2 lines
76 KiB
JavaScript
2 lines
76 KiB
JavaScript
"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[6930],{62386:(e,t,a)=>{a.r(t),a.d(t,{ChatRefundModal:()=>_t,GiftInfoModal:()=>Et,GiftModal:()=>ut,GiftRecipientPicker:()=>At,GiftStatusInfoModal:()=>It,GiftTransferModal:()=>Wt,GiftUpgradeModal:()=>Ct,GiftWithdrawModal:()=>xt,PaidReactionModal:()=>Je,StarPaymentModal:()=>ue,StarsBalanceModal:()=>oe,StarsGiftModal:()=>b,StarsGiftingPickerModal:()=>P,StarsSubscriptionModal:()=>Ne,StarsTransactionInfoModal:()=>ve});var r=a(84051),n=a(13439),s=a(70636),i=a(29807),o=a(87357),l=a(17142),c=a(4961),m=a(14),d=a(17712),u=a(59030),A=a(21849),p=a(18276),f=a(84685),y=a(64493),h=a(8410),g=a(1526);const E={modalDialog:"MFXAwnxJ",content:"Sl6xVf1R",main:"bTN9Jeph",headerInfo:"c6MiyJgW",logo:"StGLWvzb",logoBackground:"SyTXSfml",description:"kFe3mIZo",section:"BgfHkWd2",header:"zMtAGfXs",starHeaderText:"q3v8orGj",hiddenHeader:"bq3FnXT0",closeButton:"bDsDTkbe",avatar:"jK36xUj4",center:"v1PckUQn",secondaryInfo:"TDWSRfP9"},S=a.p+"StarLogo.600328787c79d99dfd66.svg",v=a.p+"stars-bg.dee4c4b73c7d21c2ec73.png",b=(0,r.ph)((0,n.EK)(((e,{modal:t})=>({user:t?.forUserId?(0,i.mBe)(e,t.forUserId):void 0})))((({modal:e,user:t})=>{const{closeStarsGiftModal:a,openInvoice:i,requestConfetti:b}=(0,n.ko)(),N=(0,r.li)(null),C=Boolean(e?.isOpen),k=(0,m.A)(e),I=(0,u.A)(),[G,w]=(0,r.J0)(),[P,B]=(0,r.J0)(!0);(0,r.vJ)((()=>{C||B(!0)}),[C]);const T=(0,d.A)((()=>{const e=N.current;if(e&&C){const{top:t,left:a,width:r,height:n}=e.querySelector(".modal-content").getBoundingClientRect();b({top:t,left:a,width:r,height:n,withStars:!0})}}));(0,r.vJ)((()=>{k?.isCompleted&&T()}),[k,T]);const M=(0,d.A)((e=>{k&&(w(e),i(t?{type:"starsgift",userId:t.id,stars:e.stars,currency:e.currency,amount:e.amount}:{type:"stars",stars:e.stars,currency:e.currency,amount:e.amount}))})),x=(0,d.A)((()=>{a()})),U=(0,r.Kr)((()=>{const e=I("lng_credits_summary_options_about").split("{link}");return[e[0],r.Ay.createElement(f.A,{url:I("StarsTOSLink"),text:I("lng_credits_summary_options_about_link")}),e[1]]}),[I]);return r.Ay.createElement(h.A,{className:(0,o.A)(E.modalDialog),contentClassName:E.content,dialogRef:N,isSlim:!0,onClose:x,isOpen:C},r.Ay.createElement("div",{className:(0,o.A)(E.main,"custom-scroll"),onScroll:function(e){const{scrollTop:t}=e.currentTarget;B(t<=150)}},r.Ay.createElement(y.A,{round:!0,size:"smaller",className:E.closeButton,color:"translucent",onClick:()=>a(),ariaLabel:I("Close")},r.Ay.createElement(p.A,{name:"close"})),r.Ay.createElement("div",{className:(0,o.A)(E.header,P&&E.hiddenHeader)},r.Ay.createElement("h2",{className:E.starHeaderText},I(t?"GiftStarsTitle":"Star.List.GetStars"))),r.Ay.createElement("div",{className:E.headerInfo},t?r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement(A.A,{size:100,peer:t,className:E.avatar}),r.Ay.createElement("img",{className:E.logoBackground,src:v,alt:"",draggable:!1})):r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement("img",{className:E.logo,src:S,alt:"",draggable:!1}),r.Ay.createElement("img",{className:E.logoBackground,src:v,alt:"",draggable:!1}))),r.Ay.createElement("h2",{className:(0,o.A)(E.headerText,E.center)},k?.isCompleted?t?(0,c.A)(I("Notification.StarsGift.SentYou",(0,l.A)(G.amount,G.currency,I.code)),["simple_markdown"]):(0,c.A)(I("StarsAcquiredInfo",G?.stars),["simple_markdown"]):I(t?"GiftStarsTitle":"Star.List.GetStars")),r.Ay.createElement("p",{className:E.description},t?(0,c.A)(I("ActionGiftStarsSubtitle",(0,s.F9)(I,t)),["simple_markdown"]):I("Stars.Purchase.GetStarsInfo")),r.Ay.createElement("div",{className:E.section},r.Ay.createElement(g.A,{options:k?.starsGiftOptions,onClick:M}),r.Ay.createElement("div",{className:E.secondaryInfo},U))))})));var N=a(31481),C=a(90709),k=a(87894),I=a(79582),G=a(54960),w=a(34642);const P=(0,r.ph)((0,n.EK)((e=>{const{chats:{listIds:t},currentUserId:a}=e;return{userIds:e.contactList?.userIds,activeListIds:t.active,archivedListIds:t.archived,currentUserId:a}}))((({isOpen:e,currentUserId:t,activeListIds:a,archivedListIds:i,userIds:o})=>{const{closeStarsGiftingPickerModal:l,openStarsGiftModal:c}=(0,n.ko)(),m=(0,u.A)(),[A,p]=(0,r.J0)(""),f=(0,r.Kr)((()=>{const e=(0,n.mS)().users.byId,r=(0,k.Am)([...o||[],...a||[],...i||[]]),l=(0,s.PU)({ids:r,query:A,type:"user"});return(0,I.A)(l.filter((a=>{const r=e[a];return!(!r||r.isSupport||(0,C.tv)(r)||(0,C.PL)(r)||a===t||a===N.zv8)})))}),[t,A,o,a,i]),y=(0,d.A)((e=>{e?.length&&(c({forUserId:e}),l())}));return r.Ay.createElement(w.A,{className:"s3k01dTm",isOpen:e,onClose:l,title:m("GiftStarsTitle"),hasCloseButton:!0,shouldAdaptToSearch:!0,withFixedHeight:!0,confirmButtonText:m("Continue"),onEnter:l},r.Ay.createElement(G.A,{className:"cuI2eDIY",itemIds:f,filterValue:A,filterPlaceholder:m("Search"),onFilterChange:p,isSearchable:!0,withDefaultPadding:!0,withStatus:!0,onSelectedIdChange:y}))})));var B=a(37661),T=a(39351),M=a(46222),x=a(24680),U=a(41036),D=a(86046),R=a(81949),O=a(9267);const L={root:"TtE8LQNJ",minimal:"nkV4JXHc",transition:"nXQS4E59",main:"JuWZY1ds",container:"mnhBs1uK",section:"lYkNd_gb",sectionTitle:"FF8gm7MP",tos:"Vu6blJk9",logo:"sjhpNB8l",logoBackground:"jjESKN3H",headerHext:"xbpAOr37",description:"teXilLxe",header:"fnhXotO2",starHeaderText:"iUwego5s",botItem:"AhxcrKWn",hiddenHeader:"DZk6d6hF",closeButton:"piD1PXHW",addStarsButton:"dqnGL2uh",addStarsIcon:"w9Db2eiK",balanceBlock:"Yk0OQBKC",balanceInfo:"p2dW9NOV",smallerText:"rUnPcfmE",balanceBottom:"F5BTkZ9G",modalBalance:"t8tMrx3y",starButton:"oOt4VBD2",paymentContent:"OReEUNTV",paymentImages:"oKorQYTC",paymentPhoto:"HGTrEtUF",avatarStar:"Wu10dXoa",paymentImageBackground:"os8jb_qv",paymentButton:"VzR5cibf",paymentButtonStar:"Uhg7yWxK",transactions:"Qvc0fTTH",subscriptions:"IX5BhCUF",tabs:"KZVEyKOX",disclaimer:"bpVifdwH",amountBadge:"BPM7LKwo",loadMore:"TKmZjMyd",loadMoreIcon:"buepwtN1"},F=(0,r.ph)((({balance:e,className:t,withAddButton:a})=>{const s=(0,T.A)(),{openStarsBalanceModal:i}=(0,n.ko)();return r.Ay.createElement("div",{className:(0,o.A)(L.balanceBlock,t)},r.Ay.createElement("div",{className:L.balanceInfo},r.Ay.createElement("span",{className:L.smallerText},s("StarsBalance")),r.Ay.createElement("div",{className:L.balanceBottom},r.Ay.createElement(O.A,{type:"gold",size:"middle"}),void 0!==e?(0,D.ZF)(s,e):"…",a&&r.Ay.createElement(R.A,{className:L.addStarsButton,onClick:()=>i({})},r.Ay.createElement(p.A,{className:L.addStarsIcon,name:"add"})))))}));var K=a(17663),z=a(14242),J=a(63527);const V={root:"ZXnbeQxP",info:"zLaaDX3c",status:"HbF2qTB2",statusPricing:"AveGvpdV",amount:"_CBiOQcv",title:"k9ZIv5Pd",description:"FlRlxMx2",subtitle:"YN2J8dw6",statusPeriod:"MRrP7Oew",statusEnded:"pRHwfr8m",preview:"t6Syyhzd",subscriptionStar:"ftlbevPm"},H=(0,r.ph)((({subscription:e})=>{const{openStarsSubscriptionModal:t}=(0,n.ko)(),{peerId:a,pricing:o,until:l,isCancelled:m,title:p,photo:f}=e,y=(0,u.A)(),h=(0,J.A)(function(e){return t=>(0,i.PVB)(t,e)}(a)),g=(0,d.A)((()=>{t({subscription:e})}));if(!h)return;const E=l<Date.now()/1e3,S=(0,K.A)(1e3*l,y.code,!0,"long");return r.Ay.createElement("div",{className:V.root,onClick:g},r.Ay.createElement("div",{className:V.preview},r.Ay.createElement(A.A,{size:"medium",peer:h}),r.Ay.createElement(O.A,{className:V.subscriptionStar,type:"gold",size:"small"})),r.Ay.createElement("div",{className:V.info},r.Ay.createElement("h3",{className:V.title},(0,c.A)((0,s.F9)(y,h)||"")),p&&r.Ay.createElement("p",{className:V.subtitle},f&&r.Ay.createElement(A.A,{webPhoto:f,size:"micro"}),(0,c.A)(p)),r.Ay.createElement("p",{className:V.description},y(E?"StarsSubscriptionExpired":m?"StarsSubscriptionExpires":"StarsSubscriptionRenews",S))),r.Ay.createElement("div",{className:V.status},m||E?r.Ay.createElement("div",{className:V.statusEnded},y(E?"StarsSubscriptionStatusExpired":"StarsSubscriptionStatusCancelled")):r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement("div",{className:V.statusPricing},r.Ay.createElement(O.A,{className:V.star,type:"gold",size:"adaptive"}),r.Ay.createElement("span",{className:V.amount},(0,z.Sm)(o.amount))),r.Ay.createElement("div",{className:V.statusPeriod},y("StarsParticipantSubscriptionPerMonth")))))}));var q=a(58968),j=a(66833);function W(e,t,a){if(a.paidMessages)return t("PaidMessageTransaction",{count:a.paidMessages},{withNodes:!0,pluralValue:a.paidMessages});if(a.starRefCommision)return e("StarTransactionCommission",(0,z.l9)(a.starRefCommision));if(a.isGiftUpgrade)return e("Gift2TransactionUpgraded");if(a.extendedMedia)return e("StarMediaPurchase");if(a.subscriptionPeriod)return a.title||e("StarSubscriptionPurchase");if(a.isReaction)return e("StarsReactionsSent");if(a.giveawayPostId)return e("StarsGiveawayPrizeReceived");if(a.isMyGift)return e("StarsGiftSent");if(a.isGift)return e("StarsGiftReceived");if(a.starGift)return _(a.stars)?e("Gift2TransactionSent"):e("Gift2ConvertedTitle");const r=a.peer&&"peer"!==a.peer.type&&(0,D.Pc)(a.peer)||void 0;return r?r.title||e(r.titleKey):a.title}function _(e){return e.amount?e.amount<0:e.nanos<0}var Q=a(79577),X=a(40558),Y=a(62587),Z=a(27860);const $={root:"jQkp75Gb",preview:"OYGSN3PF",count:"KX1yz2Jy",thumb:"EvinKr5k",noOutline:"KSAAsUDv",itemCount1:"GxDajfX_",itemCount2:"jXuZoxq8",itemCount3:"TPn3XGHJ",blurry:"hWZuxLS8",full:"w56QPFhl",fadeIn:"ds43W8Wq"};function ee({boughtMedia:e,index:t,className:a}){const n=e.video||e.photo,s=(0,C.VO)(n,"pictogram"),i=(0,C.VD)(n),l=(0,Y.A)(s);return r.Ay.createElement("div",{className:(0,o.A)($.thumb,void 0!==t&&`stars-transaction-media-${t}`,a)},i&&r.Ay.createElement("img",{className:$.blurry,src:i,alt:""}),l&&r.Ay.createElement("img",{className:$.full,src:l,alt:""}))}const te=(0,r.ph)((({media:e,className:t,isTransactionPreview:a,onClick:n})=>{const s=Math.min(e.length,a?2:3),i="mediaType"in e[0];return r.Ay.createElement("div",{className:(0,o.A)($.root,$[`itemCount${s}`],a&&$.preview,t),dir:"rtl",onClick:n},e.slice(0,s).reverse().map(((e,t,n)=>{const s=n.length-t-1;return"mediaType"in e?r.Ay.createElement(Z.A,{className:$.thumb,isVisible:!0,width:e.width,height:e.height,thumbDataUri:e.thumbnail?.dataUri}):r.Ay.createElement(ee,{className:(0,o.A)(a&&s>0&&$.noOutline),boughtMedia:e,index:s})})),i&&r.Ay.createElement("div",{className:$.count},r.Ay.createElement(p.A,{name:"stars-lock"}),e.length>1?e.length:""))})),ae={root:"aHAxv_Jg",info:"oyYrn3II",stars:"K5lc75ku",amount:"QLQPuLAr",title:"e0pK8CJ_",description:"xbERdDMQ",date:"l6CwQ0Ev",positive:"P_42_ZWR",negative:"TGjnLJfH",preview:"cnjGihOT",subscriptionStar:"z43YvnDX",uniqueGiftBackground:"eNvzMw2p",giftSticker:"U3dqmnM4"},re=(0,r.ph)((({transaction:e,className:t})=>{const{openStarsTransactionModal:a}=(0,n.ko)(),{date:l,stars:m,photo:p,peer:f,extendedMedia:y,subscriptionPeriod:h}=e,g=(0,T.A)(),E=(0,u.A)(),S="peer"===f.type?f.id:void 0,v=(0,J.A)(function(e){return t=>e?(0,i.PVB)(t,e):void 0}(S)),b=e.starGift,N="starGiftUnique"===b?.type,C=b&&(0,j.yQ)(b),k=(0,r.Kr)((()=>{let t,a,r,n=W(E,g,e);if("peer"===e.peer.type)t=v&&(0,s.F9)(E,v),r=v||q.lw;else{const a=(0,D.Pc)(e.peer);n=a.title||E(a.titleKey),t=E(a.subtitleKey),r=a}return e.isGiftUpgrade&&"starGiftUnique"===e.starGift?.type&&(t=e.starGift.title),e.photo&&(r=void 0),e.isRefund&&(a=E("StarsRefunded")),e.hasFailed&&(a=E("StarsFailed")),e.isPending&&(a=E("StarsPending")),{title:n,description:t,avatarPeer:r,status:a}}),[E,g,v,e]),I=(0,r.Kr)((()=>{if(N){const{backdrop:e}=(0,j.uc)(b),t=[e.centerColor,e.edgeColor];return r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement(X.A,{className:ae.uniqueGiftBackground,backgroundColors:t}),r.Ay.createElement(Q.A,{className:ae.giftSticker,sticker:C,size:36,play:!1}))}return C?r.Ay.createElement(Q.A,{className:ae.giftSticker,sticker:C,size:36,play:!1}):y?r.Ay.createElement(te,{media:y,isTransactionPreview:!0}):r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement(A.A,{size:"medium",webPhoto:p,peer:k.avatarPeer}),Boolean(h)&&r.Ay.createElement(O.A,{className:ae.subscriptionStar,type:"gold",size:"small"}))}),[N,y,p,k.avatarPeer,h,b,C]),G=(0,d.A)((()=>{a({transaction:e})}));return r.Ay.createElement("div",{className:(0,o.A)(ae.root,t),onClick:G},r.Ay.createElement("div",{className:ae.preview},I),r.Ay.createElement("div",{className:ae.info},r.Ay.createElement("h3",{className:ae.title},k.title),k.description&&r.Ay.createElement("p",{className:ae.description},(0,c.A)(k.description)),r.Ay.createElement("p",{className:ae.date},(0,K.L2)(1e3*l,E.code,!0),k.status&&` — (${k.status})`)),r.Ay.createElement("div",{className:ae.stars},r.Ay.createElement("span",{className:(0,o.A)(ae.amount,_(m)?ae.negative:ae.positive)},(0,D.hk)(g,m)),r.Ay.createElement(O.A,{className:ae.star,type:"gold",size:"adaptive"})))})),ne=["all","inbound","outbound"],se=["StarsTransactionsAll","StarsTransactionsIncoming","StarsTransactionsOutgoing"],ie="StarsTransactionItem",oe=(0,r.ph)((0,n.EK)((e=>({shouldForceHeight:Boolean(e.stars?.history?.all?.transactions.length),starsBalanceState:e.stars,canBuyPremium:!(0,i.n_C)(e)})))((({modal:e,starsBalanceState:t,canBuyPremium:a,shouldForceHeight:l})=>{const{closeStarsBalanceModal:m,loadStarsTransactions:A,loadStarsSubscriptions:E,openStarsGiftingPickerModal:b,openInvoice:k}=(0,n.ko)(),{balance:I,history:G,subscriptions:w}=t||{},P=(0,u.A)(),D=(0,T.A)(),[R,O]=(0,r.J0)(!0),[K,z]=(0,r.J0)(0),[J,V,q]=(0,B.A)(),j=Boolean(e&&t),{originStarsPayment:W,originReaction:_,originGift:Q,topup:X}=e||{},Y=W||_||Q||X,Z=W?.form?.invoice?.totalAmount||W?.subscriptionInfo?.subscriptionPricing?.amount||_?.amount||Q?.gift.stars||X?.balanceNeeded,$=Z?Z-(I?.amount||0):void 0,ee=(0,r.Kr)((()=>{const e=(0,n.mS)();if(_){const t=(0,i.hds)(e,_.chatId);if(!t)return;return P("StarsNeededTextReactions",(0,C.Js)(P,t))}if(W){const t=W.form?.botId?(0,i.mBe)(e,W.form.botId):void 0;if(!t)return;return P("StarsNeededText",(0,C.Yg)(t))}if(Q){const t=(0,i.mBe)(e,Q.peerId);if(!t)return;return P("StarsNeededTextGift",(0,s.F9)(D,t))}return"subs"===X?.purpose?P("StarsNeededTextLink"):X?.purpose===N.D3m?D("StarsNeededTextSendPaidMessages",void 0,{withMarkdown:!0,withNodes:!0}):void 0}),[_,W,Q,X?.purpose,D,P]),te=Boolean(G?.all?.transactions.length&&!Y),ae=!Y,oe=(0,r.Kr)((()=>se.map((e=>({title:D(e)})))),[D]);(0,r.vJ)((()=>{j||(O(!0),z(0),q())}),[j]),(0,r.vJ)((()=>{Y?V():q()}),[Y]);const le=(0,r.Kr)((()=>{if(!j)return;const e=P("lng_credits_summary_options_about").split("{link}");return[e[0],r.Ay.createElement(f.A,{url:P("StarsTOSLink"),text:P("lng_credits_summary_options_about_link")}),e[1]]}),[j,P]),ce=(0,d.A)((()=>{A({type:ne[K]})})),me=(0,d.A)((()=>{E()})),de=(0,d.A)((()=>{b({})})),ue=(0,d.A)((e=>{k({type:"stars",stars:e.stars,currency:e.currency,amount:e.amount})}));return r.Ay.createElement(h.A,{className:(0,o.A)(L.root,!l&&!J&&L.minimal),isOpen:j,onClose:m},r.Ay.createElement("div",{className:(0,o.A)(L.main,"custom-scroll"),onScroll:function(e){const{scrollTop:t}=e.currentTarget;O(t<=150)}},r.Ay.createElement(y.A,{round:!0,size:"smaller",className:L.closeButton,color:"translucent",onClick:()=>m(),ariaLabel:D("Close")},r.Ay.createElement(p.A,{name:"close"})),r.Ay.createElement(F,{balance:I,className:L.modalBalance}),r.Ay.createElement("div",{className:(0,o.A)(L.header,R&&L.hiddenHeader)},r.Ay.createElement("h2",{className:L.starHeaderText},P("TelegramStars"))),r.Ay.createElement("div",{className:L.section},r.Ay.createElement("img",{className:L.logo,src:S,alt:"",draggable:!1}),r.Ay.createElement("img",{className:L.logoBackground,src:v,alt:"",draggable:!1}),r.Ay.createElement("h2",{className:L.headerText},$?P("StarsNeededTitle",Z):P("TelegramStars")),r.Ay.createElement("div",{className:L.description},(0,c.A)(ee||P("TelegramStarsInfo"),["simple_markdown","emoji"])),a&&!J&&r.Ay.createElement(y.A,{className:L.starButton,onClick:V},P("Star.List.BuyMoreStars")),a&&!J&&ae&&r.Ay.createElement(y.A,{isText:!0,noForcedUpperCase:!0,className:L.starButton,onClick:de},P("TelegramStarsGift")),J&&t?.topupOptions&&r.Ay.createElement(g.A,{starsNeeded:$,options:t.topupOptions,onClick:ue})),J&&r.Ay.createElement("div",{className:L.tos},le),te&&Boolean(w?.list.length)&&r.Ay.createElement("div",{className:L.section},r.Ay.createElement("h3",{className:L.sectionTitle},P("StarMySubscriptions")),r.Ay.createElement("div",{className:L.subscriptions},w?.list.map((e=>r.Ay.createElement(H,{key:e.id,subscription:e}))),w?.nextOffset&&r.Ay.createElement(y.A,{isText:!0,disabled:w.isLoading,size:"smaller",noForcedUpperCase:!0,className:L.loadMore,onClick:me},r.Ay.createElement(p.A,{name:"down",className:L.loadMoreIcon}),P("StarMySubscriptionsExpand")))),te&&r.Ay.createElement("div",{className:L.container},r.Ay.createElement("div",{className:L.section},r.Ay.createElement(U.Ay,{name:D.isRtl?"slideOptimizedRtl":"slideOptimized",activeKey:K,renderCount:se.length,shouldRestoreHeight:!0,className:L.transition},r.Ay.createElement(M.A,{onLoadMore:ce,items:G?.[ne[K]]?.transactions,scrollContainerClosest:`.${L.main}`,itemSelector:`.${ie}`,className:L.transactions,noFastList:!0,noScrollRestoreOnTop:!0},G?.[ne[K]]?.transactions.map((e=>r.Ay.createElement(re,{key:`${e.id}-${e.isRefund}`,transaction:e,className:ie})))))),r.Ay.createElement(x.A,{className:L.tabs,tabClassName:L.tab,activeTab:K,tabs:oe,onSwitchTab:z}))))})));var le=a(48775),ce=a(29886),me=a(84991),de=a(10187);const ue=(0,r.ph)((0,n.EK)(((e,{modal:t})=>{const a=t?.form?.botId?(0,i.mBe)(e,t.form.botId):void 0,r="message"===t?.inputInvoice?.type?t.inputInvoice:void 0,n=r?(0,i.O5q)(e,r.chatId,r.messageId):void 0,s=r?(0,i.hds)(e,r.chatId):void 0,o=n?.content.paidMedia;return{bot:a,starsBalanceState:e.stars,paidMediaMessage:o?n:void 0,paidMediaChat:o?s:void 0}}))((({modal:e,bot:t,starsBalanceState:a,paidMediaMessage:s,paidMediaChat:i})=>{const{closeStarsPaymentModal:l,openStarsBalanceModal:m,sendStarPaymentForm:p}=(0,n.ko)(),[g,E,S]=(0,B.A)(),b=Boolean(e?.inputInvoice&&a),N=(0,ce.A)(e),k=e||N,{form:I,subscriptionInfo:G}=k||{},w=I?.invoice?.totalAmount||G?.subscriptionPricing?.amount,P=Boolean(I?.invoice.subscriptionPeriod),M=!G?.subscriptionPricing,x=I?.photo,U=(0,u.A)(),D=(0,T.A)();(0,r.vJ)((()=>{b||S()}),[b]);const R=(0,r.Kr)((()=>{if(!k?.inputInvoice)return"";const e=(0,C.Yg)(t),a=U("Stars.Intro.PurchasedText.Stars",w);if(s){const e=s.content.paidMedia.extendedMedia,t=e.every((e=>!e.duration)),r=e.every((e=>!!e.duration)),n=U(t?"Stars.Transfer.Photos":r?"Stars.Transfer.Videos":"Media",e.length),o=(0,C.Js)(U,i);return U("Stars.Transfer.UnlockInfo",[n,o,a])}return G?D("StarsSubscribeText",{chat:G.title,amount:w},{withNodes:!0,withMarkdown:!0,pluralValue:w}):P?D("StarsSubscribeBotText",{name:I.title,amount:w,bot:e},{pluralValue:w}):U("Stars.Transfer.Info",[I.title,e,a])}),[k?.inputInvoice,t,U,w,s,G,P,I,i,D]),K=(0,r.Kr)((()=>{if(G)return D("StarsSubscribeInfo",{link:r.Ay.createElement(f.A,{url:D("StarsSubscribeInfoLink"),text:D("StarsSubscribeInfoLinkText")})},{withNodes:!0})}),[G,D]),J=(0,r.Kr)((()=>{if(G)return(0,C.nr)(G)}),[G]),V=(0,d.A)((()=>{const t=a?.balance;void 0!==w&&void 0!==t&&(w>t.amount?m({originStarsPayment:e}):(p({}),E()))}));return r.Ay.createElement(h.A,{contentClassName:L.paymentContent,isOpen:b,hasAbsoluteCloseButton:!0,isSlim:!0,onClose:l},r.Ay.createElement(F,{balance:a?.balance,className:L.modalBalance}),r.Ay.createElement("div",{className:L.paymentImages,dir:U.isRtl?"ltr":"rtl"},s?r.Ay.createElement(te,{media:s.content.paidMedia.extendedMedia}):J?r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement(A.A,{className:L.paymentPhoto,peer:J,size:"giant"}),r.Ay.createElement(O.A,{type:"gold",size:"adaptive",className:L.avatarStar})):r.Ay.createElement(me.A,{peer:x?void 0:t,avatarWebPhoto:x,avatarSize:"giant",badgeIcon:"star",badgeText:(0,z.Sm)(w),badgeClassName:L.amountBadge,className:L.paymentPhoto}),r.Ay.createElement("img",{className:L.paymentImageBackground,src:v,alt:"",draggable:!1})),r.Ay.createElement("h2",{className:L.headerText},U(J?"StarsSubscribeTitle":"StarsConfirmPurchaseTitle")),M&&r.Ay.createElement(de.A,{className:L.botItem,peerId:I?.botId}),r.Ay.createElement("div",{className:L.description},(0,c.A)(R,["simple_markdown","emoji"])),r.Ay.createElement(y.A,{className:L.paymentButton,size:"smaller",onClick:V,isLoading:g},D(P?"StarsSubscribeBotButtonMonth":"StarsPay",{amount:(0,le.U)(D,w,{asFont:!0})},{withNodes:!0})),K&&r.Ay.createElement("div",{className:(0,o.A)(L.disclaimer,L.smallerText)},K))})));var Ae=a(89925),pe=a(85982),fe=a(70046),ye=a(95807);const he=(0,r.ph)((({modelAttribute:e,backdropAttribute:t,patternAttribute:a,title:n,subtitle:s,className:i})=>{const l=function(e,t){const a=(0,r.li)(0);let n=!1;return(0,r.Kr)((()=>{a.current+=1,n=!0}),e),a.current}([e,t,a]),c=t?.textColor,m=(0,r.Kr)((()=>{const e=[t.centerColor,t.edgeColor],n=t.patternColor;return r.Ay.createElement(X.A,{className:"UvhsGZLf",backgroundColors:e,patternColor:n,patternIcon:a.sticker})}),[t,a]);return r.Ay.createElement("div",{className:(0,o.A)("irv1C8bo",i)},r.Ay.createElement(U.Ay,{className:"Tu6_OHoq",slideClassName:"iUTKLzTN",activeKey:l,direction:1,name:"zoomBounceSemiFade"},m,r.Ay.createElement(Q.A,{className:"a1ASgPwu",sticker:e.sticker,size:120})),n&&r.Ay.createElement("h1",{className:"ECTvfOda"},n),s&&r.Ay.createElement("p",{className:"S6JwvHWD",style:(0,ye.A)(c&&`color: ${c}`)},s))})),ge="qBOIq6Jn",Ee="sso9uZM6",Se="NuWOY7ED",ve=(0,r.ph)((0,n.EK)(((e,{modal:t})=>{const a="peer"===t?.transaction?.peer?.type&&t.transaction.peer.id,r=a?(0,i.PVB)(e,a):void 0,n=e.appConfig?.starsPaidMessageCommissionPermille,s=t?.transaction.stars,o=t?.transaction.isGift&&(0,i.WLj)(e,s?.amount);return{peer:r,canPlayAnimatedEmojis:(0,i.BWX)(e),topSticker:o,paidMessageCommission:n}}))((({modal:e,peer:t,canPlayAnimatedEmojis:a,topSticker:s,paidMessageCommission:i})=>{const{showNotification:l,openMediaViewer:c,closeStarsTransactionModal:m}=(0,n.ko)(),y=(0,T.A)(),h=(0,u.A)(),{transaction:g}=e||{},E=(0,d.A)((()=>{const e=g?.extendedMedia;e&&c({origin:Ae.TQ.StarsTransaction,standaloneMedia:e.flatMap((e=>Object.values(e)))})})),S=(0,r.Kr)((()=>{if(!g)return;const{giveawayPostId:e,photo:n,stars:c,isGiftUpgrade:m,starGift:d}=g,u=g?.starGift,S="starGiftUnique"===u?.type,b=g?.starGift?(0,j.yQ)(g.starGift):s,N=S?(0,j.uc)(u):void 0,k=g.peer&&"peer"!==g.peer.type&&(0,D.Pc)(g.peer)||void 0,I="peer"===g.peer?.type?g.peer.id:void 0,G=g.peer&&h(function(e){switch(e.type){case"appStore":return"AppStore";case"playMarket":return"PlayMarket";case"fragment":return"Fragment";case"premiumBot":return"StarsTransactionBot";case"ads":return"StarsTransactionAds";case"api":return"Stars.Intro.Transaction.TelegramBotApi.Subtitle";default:return"Stars.Transaction.Unsupported.Title"}}(g.peer)),w=W(h,y,g),P=t&&g.messageId&&!m?(0,C.yt)(t,void 0,g.messageId):void 0,B=t&&e&&(0,C.yt)(t,void 0,e),T=g.extendedMedia,M=T?.length||0,x=T?.every((e=>!e.video)),U=T?.every((e=>!e.photo)),R=h(x?"Stars.Transfer.Photos":U?"Stars.Transfer.Videos":"Media",M),L=g.description||(m&&"starGiftUnique"===d?.type?d.title:void 0)||(T?R:void 0),F=!T&&!b,J=n?void 0:t||k,V=S&&r.Ay.createElement("div",{className:(0,o.A)(ge,"ApoQz22o")},r.Ay.createElement(he,{backdropAttribute:N.backdrop,patternAttribute:N.pattern,modelAttribute:N.model,title:u.title,subtitle:y("GiftInfoCollectible",{number:u.number})})),H=r.Ay.createElement("div",{className:ge},T&&r.Ay.createElement(te,{className:(0,o.A)("C5r59yiV","transaction-media-preview"),media:T,onClick:E}),!T&&b&&r.Ay.createElement(Q.A,{key:g.id,sticker:b,play:a,noLoop:!0}),F&&r.Ay.createElement(A.A,{peer:J,webPhoto:n,size:"giant"}),!b&&r.Ay.createElement("img",{className:(0,o.A)("nML8IQqX"),src:v,alt:"",draggable:!1}),w&&r.Ay.createElement("h1",{className:"ZZAj3hj7"},w),r.Ay.createElement("p",{className:Se},L),r.Ay.createElement("p",{className:Ee},r.Ay.createElement("span",{className:(0,o.A)(Ee,_(c)?"xDyq9cc0":"jvBZSrpd")},(0,D.hk)(y,c)),r.Ay.createElement(O.A,{type:"gold",size:"middle"})),g.paidMessages&&g.starRefCommision&&i&&r.Ay.createElement("p",{className:Se},y("PaidMessageTransactionDescription",{percent:(0,z.l9)(i/10)},{withNodes:!0,withMarkdown:!0}))),q=[];let X;g&&!g.paidMessages&&q.push([h("StarsTransaction.StarRefReason.Title"),h("StarsTransaction.StarRefReason.Program")]),m&&q.push([h("StarGiftReason"),h("StarGiftReasonUpgrade")]),X=m?h("Stars.Transaction.GiftFrom"):_(c)||g.isMyGift?h("Stars.Transaction.To"):g.starRefCommision&&!g.paidMessages?h("StarsTransaction.StarRefReason.Miniapp"):h(I?"Star.Transaction.From":"Stars.Transaction.Via"),q.push([X,I?{chatId:I}:G||""]),g.starRefCommision&&g.paidMessages&&q.push([y("PaidMessageTransactionTotal"),(0,le.U)(y,g.stars.amount/((100-g.starRefCommision)/100),{asFont:!1,className:"cU5QlvwL",containerClassName:"Z2YALGgl"})]),P&&q.push([h("Stars.Transaction.Reaction.Post"),r.Ay.createElement(f.A,{url:P,text:P})]),B&&(q.push([h("BoostReason"),r.Ay.createElement(f.A,{url:B,text:h("Giveaway")})]),q.push([h("Gift"),h("Stars",g.stars,"i")])),g.id&&q.push([h("Stars.Transaction.Id"),r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement("div",{className:"tMF8VIOM",onClick:()=>{(0,pe.eM)(g.id),l({message:h("StarsTransactionIDCopied")})}},g.id),r.Ay.createElement(p.A,{className:"voCttFzS",name:"copy"}))]),q.push([h("Stars.Transaction.Date"),(0,K.L2)(1e3*g.date,h.code,!0)]);const Y=h("lng_credits_box_out_about").split("{link}");return{header:S?V:H,tableData:q,footer:r.Ay.createElement("span",{className:"KgzPpgS6"},Y[0],r.Ay.createElement(f.A,{url:h("StarsTOSLink"),text:h("lng_credits_summary_options_about_link")}),Y[1])}}),[g,h,y,t,a,s,i]),b=(0,ce.A)(S)||S;return r.Ay.createElement(fe.A,{isOpen:Boolean(g),className:"IzhfRIWu",hasBackdrop:"starGiftUnique"===g?.starGift?.type,header:b?.header,tableData:b?.tableData,footer:b?.footer,buttonText:h("OK"),onClose:m})}))),be="oBLHWBtJ",Ne=(0,r.ph)((0,n.EK)(((e,{modal:t})=>{const a=t?.subscription.peerId;return{peer:a?(0,i.PVB)(e,a):void 0}}))((({modal:e,peer:t})=>{const{closeStarsSubscriptionModal:a,fulfillStarsSubscription:i,changeStarsSubscription:l,checkChatInvite:c,loadStarStatus:m,openInvoice:p}=(0,n.ko)(),h=(0,u.A)(),g=(0,T.A)(),{subscription:E}=e||{},S=(0,r.Kr)((()=>{if(!E)return"hidden";if(E.canRefulfill)return"refulfill";const e=E.until>Date.now()/1e3;if(e&&!E.isCancelled)return"cancel";if(e&&E.isCancelled)return"renew";const t=E.chatInviteHash||E.invoiceSlug;return!e&&t?"restart":"ok"}),[E]),b=(0,d.A)((()=>{if(E){switch(S){case"refulfill":i({id:E.id});break;case"restart":E.chatInviteHash?c({hash:E.chatInviteHash}):E.invoiceSlug&&p({type:"slug",slug:E.invoiceSlug}),m();break;case"renew":l({id:E.id,isCancelled:!1});break;case"cancel":l({id:E.id,isCancelled:!0})}a()}})),C=(0,r.Kr)((()=>{if(!E||!t)return;const{pricing:e,until:a,isCancelled:n,canRefulfill:i,photo:l,title:c,hasBotCancelled:m}=E,d=(0,s.mO)(t),u=r.Ay.createElement("div",{className:"E3R22yAI"},r.Ay.createElement("div",{className:"wuTMXDP9"},r.Ay.createElement(A.A,{peer:l?void 0:t,webPhoto:l,size:"giant"}),r.Ay.createElement(O.A,{className:"enRetSny",type:"gold",size:"adaptive"})),r.Ay.createElement("img",{className:(0,o.A)("zGCayu45"),src:v,alt:"",draggable:!1}),r.Ay.createElement("h1",{className:"qdydQHgc"},c||h("StarsSubscriptionTitle")),r.Ay.createElement("p",{className:"FI6rEJlK"},g("StarsPerMonth",{amount:e.amount},{withNodes:!0,specialReplacement:{[N.Cyx]:r.Ay.createElement(O.A,{className:"J8HIcN6k",size:"adaptive",type:"gold"})}}))),p=[];p.push([h(d?"StarsSubscriptionBot":"StarsSubscriptionChannel"),{chatId:t.id}]),c&&p.push([h("StarsSubscriptionBotProduct"),c]);const C=a<Date.now()/1e3;p.push([h(C?"StarsSubscriptionUntilExpired":n?"StarsSubscriptionUntilExpires":"StarsSubscriptionUntilRenews"),(0,K.L2)(1e3*a,h.code,!0)]);const k=g("StarsTransactionTOS",{link:r.Ay.createElement(f.A,{url:g("StarsTransactionTOSLink"),text:g("StarsTransactionTOSLinkText")})},{withNodes:!0});return{header:u,tableData:p,footer:r.Ay.createElement("span",{className:"GMWMuWCr"},r.Ay.createElement("p",{className:be},k),n&&r.Ay.createElement("p",{className:"nkwiG25Q"},h(m?"StarsSubscriptionBotCancelledText":"StarsSubscriptionCancelledText")),i&&r.Ay.createElement("p",{className:be},h("StarsSubscriptionRefulfillInfo",(0,K.L2)(1e3*a,h.code,!0))),!n&&!i&&C&&r.Ay.createElement("p",{className:be},h("StarsSubscriptionExpiredInfo",(0,K.L2)(1e3*a,h.code,!0))),!n&&!i&&!C&&r.Ay.createElement("p",{className:be},h("StarsSubscriptionCancelInfo",(0,K.L2)(1e3*a,h.code,!0))),"hidden"!==S&&r.Ay.createElement(y.A,{size:"smaller",color:"cancel"===S?"danger":"primary",isText:"cancel"===S,onClick:b},h("cancel"===S?"StarsSubscriptionCancel":"refulfill"===S?"StarsSubscriptionRefulfill":"restart"===S?"StarsSubscriptionAgain":"renew"===S?"StarsSubscriptionRenew":"OK")))}}),[S,g,h,t,E]),k=(0,ce.A)(C)||C;return r.Ay.createElement(fe.A,{isOpen:Boolean(E),className:"eR_RZfGB",header:k?.header,tableData:k?.tableData,footer:k?.footer,onClose:a})})));var Ce=a(43874),ke=a(34431),Ie=a(19806),Ge=a(22699),we=a(24433),Pe=a(32581),Be=a(66644),Te=a(15283),Me=a(93545),xe=a(68292),Ue=a(85118);const De={root:"CuBAw2yg",slider:"euOOAbZi",sparkles:"_L1YQTIP",progress:"kwK0cNPX",floatingBadgeWrapper:"uvlMoXj0",floatingBadge:"BGSDWAYc",floatingBadgeText:"qqQan8uF",floatingBadgeTriangle:"mIdJOmsB"},Re=[50,100,500,1e3,2e3,5e3,1e4];function Oe(e,t){const a=e.findIndex((e=>t<=e)),r=e[a-1]||1,n=e[a]||e[e.length-1];return a+(t-r)/(n-r)}function Le(e,t){const a=Math.floor(t),r=e[a-1]||1,n=r+((e[a]||e[e.length-1])-r)*(t-a);return Math.round(n)}const Fe=(0,r.ph)((({maxValue:e,defaultValue:t,className:a,onChange:n})=>{const s=(0,r.li)(null),i=(0,r.Kr)((()=>{const t=[];for(let a=0;a<Re.length;a++)if(Re[a]<e&&t.push(Re[a]),Re[a]>=e){t.push(e);break}return t}),[e]),[l,c]=(0,r.J0)(0);(0,Te.A)((()=>{c(Oe(i,t))}));const m=(0,d.A)((()=>{const e=s.current;if(!e)return;const t=e.parentElement;(0,Be.YS)((()=>{const a=t.offsetLeft+e.offsetWidth/2,r=t.offsetLeft+t.offsetWidth-e.offsetWidth/2;(0,Be.RK)((()=>{t.style.setProperty("--_min-x",`${a}px`),t.style.setProperty("--_max-x",`${r}px`)}))}))}));(0,Me.A)(s,m);const u=(0,d.A)((e=>{const t=Number(e.currentTarget.value);c(t),n(Le(i,t))}));return r.Ay.createElement("div",{className:(0,o.A)(De.root,a),style:"--progress: "+l/i.length},r.Ay.createElement("div",{className:De.floatingBadgeWrapper},r.Ay.createElement("div",{className:De.floatingBadge,ref:s},r.Ay.createElement("div",{className:De.floatingBadgeText},r.Ay.createElement(p.A,{name:"star",className:De.floatingBadgeIcon}),r.Ay.createElement(xe.A,{text:(0,z.Sm)(Le(i,l))})),r.Ay.createElement("svg",{className:De.floatingBadgeTriangle,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none"},r.Ay.createElement("defs",null,r.Ay.createElement("linearGradient",{id:"StarBadgeTriangle",x1:"0",x2:"1",y1:"0",y2:"0"},r.Ay.createElement("stop",{offset:"-50%","stop-color":"#FFAA00"}),r.Ay.createElement("stop",{offset:"150%","stop-color":"#FFCD3A"}))),r.Ay.createElement("path",{d:"m 28,4 v 9 c 0.0089,7.283278 -3.302215,5.319646 -6.750951,8.589815 l -5.8284,5.82843 c -0.781,0.78105 -2.0474,0.78104 -2.8284,0 L 6.7638083,21.589815 C 2.8288652,17.959047 0.04527024,20.332086 0,13 V 4 C 0,4 0.00150581,0.97697493 3,1 5.3786658,1.018266 22.594519,0.9142007 25,1 c 2.992326,0.1067311 3,3 3,3 z",fill:"url(#StarBadgeTriangle)"})))),r.Ay.createElement("div",{className:De.progress},r.Ay.createElement(Ue.A,{preset:"progress",className:De.sparkles})),r.Ay.createElement("input",{className:De.slider,type:"range",min:0,max:i.length,defaultValue:Oe(i,t),step:"any",onChange:u}))})),Ke={content:"RdhRpsCn",title:"yzbjj73U",slider:"xePPMXOI",description:"BlpfdOtK",itemInfo:"nS9V516D",itemTitle:"sH5Nukjy",itemSubtitle:"dHlNODTI",itemIcon:"H_iHihXU",sendAsPeerButtonAvatar:"_mjvLELm",sendAsPeerMenuButton:"zxsRaWYV",buttonDownIcon:"zrwUUELS",sendAsPeerMenuBubble:"X1PB6mhQ",sendAsPeerMenu:"Px1MDij9",sendAsPeersMenuContainer:"Al1nfhHJ",headerControlPanel:"vu90kSL_",separator:"uhQLUjmo",checkBox:"Mc3bVeF0",topLabel:"bnou4CpV",top:"QludQDKR",topBadge:"JBF9pTUK",buttonStar:"NJJFuym9",topPeer:"Ty4Ud_Rd",disclaimer:"KRvkHeo1"},ze={avatarIcon:"author-hidden",customPeerAvatarColor:"#9eaab5",isCustomPeer:!0,titleKey:"StarsReactionAnonymous"},Je=(0,r.ph)((0,n.EK)(((e,{modal:t})=>{const a=t&&(0,i.hds)(e,t.chatId),r=t&&(0,i.O5q)(e,t.chatId,t.messageId),n=e.stars?.balance,s=e.appConfig?.paidReactionMaxAmount||2500,o=e.settings.paidReactionPrivacy,l=a?.sendPaidReactionsAsPeerIds,c=e.currentUserId;return{chat:a,message:r,starBalance:n,maxAmount:s,defaultPrivacy:o,sendPaidReactionsAsPeerIds:l,currentUserId:c,currentUser:(0,i.mBe)(e,c)}}))((({modal:e,chat:t,message:a,maxAmount:l,starBalance:m,defaultPrivacy:g,sendPaidReactionsAsPeerIds:E,currentUserId:S,currentUser:v})=>{const{closePaidReactionModal:b,addLocalPaidReaction:C,loadSendPaidReactionsAs:k}=(0,n.ko)(),[I,G]=(0,r.J0)(50),[w,P,M]=(0,B.A)(),[x,U]=(0,r.J0)(!0),[D,R]=(0,r.J0)(S),O=t?.id,L=D?(0,i.PVB)((0,n.mS)(),D):v,K=(0,u.A)(),{isMobile:J}=(0,Ce.Ay)(),V=(0,T.A)(),H=(0,d.A)((e=>{U(!e.target.checked)})),q=(0,d.A)((e=>{G(e),P()}));(0,r.vJ)((()=>{O&&!E&&k({chatId:O})}),[O,E]);const j=(0,r.Kr)((()=>{const e=E?.map((e=>e.id)).filter((e=>e!==O));return e?.unshift(S),e}),[E,O,S]),W=j&&j.length>1;(0,r.vJ)((()=>{e||M()}),[e]),(0,r.vJ)((()=>{const e=a?.reactions?.topReactors?.find((e=>e.isMy));if(e)return U(Boolean(e.isAnonymous)),void(e.peerId&&R(e.peerId));U("anonymous"===g?.type||!1),"peer"===g?.type&&j?.includes(g.peerId)?R(g.peerId):R(S)}),[g,a?.reactions?.topReactors,j,S]);const _=(0,d.A)((()=>{e&&(C({chatId:e.chatId,messageId:e.messageId,count:I,isPrivate:x,peerId:x||D===S?void 0:D,shouldIgnoreDefaultPrivacy:!0}),b())})),Q=(0,d.A)((e=>{U(!1),R(e)})),X=(0,d.A)((e=>{const t=(0,i.PVB)((0,n.mS)(),e),a=D===e&&!x;if(t)return r.Ay.createElement(we.A,{onClick:()=>Q(e)},r.Ay.createElement(A.A,{size:"small",peer:t}),r.Ay.createElement("div",{className:(0,o.A)(Ke.itemInfo)},r.Ay.createElement(ke.A,{className:Ke.itemTitle,peer:t,noFake:!0,noVerified:!0}),r.Ay.createElement("span",{className:Ke.itemSubtitle},(0,s.mO)(t)?V("PeerPersonalAccount"):V("PeerChannel"))),r.Ay.createElement(p.A,{className:Ke.itemIcon,name:a?"check":"placeholder"}))})),Y=(0,r.Kr)((()=>({onTrigger:e,isOpen:t})=>r.Ay.createElement(y.A,{ripple:!J,size:"smaller",color:"translucent",className:(0,o.A)(Ke.sendAsPeerMenuButton,t?"active":""),onClick:e,ariaLabel:V("AccDescrOpenMenu2")},r.Ay.createElement(A.A,{className:Ke.sendAsPeerButtonAvatar,size:"mini",peer:x?ze:L}),r.Ay.createElement(p.A,{name:"down",className:Ke.buttonDownIcon}))),[J,V,L,x]),Z=(0,r.Kr)((()=>{if(W)return r.Ay.createElement(Ge.A,{className:(0,o.A)(Ke.sendAsPeerMenu,"with-menu-transitions"),bubbleClassName:Ke.sendAsPeerMenuBubble,trigger:Y,positionX:"right",autoClose:!0},j.map((e=>X(e))))}),[Y,j,W]),$=(0,r.Kr)((()=>{const e=(0,n.mS)(),t=a?.reactions?.topReactors;if(!t)return;const r=[];let s=!1,o=0;if(t.forEach((t=>{const a=t.peerId?(0,i.PVB)(e,t.peerId):void 0;if(!a&&!t.isAnonymous&&!t.isMy)return;if(t.isMy&&(o=t.count),t.isMy&&(t.peerId!==D||t.isAnonymous&&!x))return;const n=D===t.peerId||x&&t.isAnonymous;n&&(s=!0),r.push({amount:t.count,localAmount:n&&w?I:0,isMy:t.isMy,isAnonymous:t.isAnonymous,user:a})})),!s){const t=(0,i.PVB)(e,D);r.push({amount:o,localAmount:w?I:0,isMy:!0,user:t})}return r.sort(((e,t)=>t.amount+t.localAmount-(e.amount+e.localAmount))),r.slice(0,3)}),[w,a?.reactions?.topReactors,I,D,x]),ee=t&&(0,s.F9)(K,t);return r.Ay.createElement(h.A,{isOpen:Boolean(e),onClose:b,isSlim:!0,hasAbsoluteCloseButton:!0,contentClassName:Ke.content,isLowStackPriority:!0},r.Ay.createElement("div",{className:Ke.sendAsPeersMenuContainer},Z),r.Ay.createElement("div",{className:Ke.headerControlPanel},r.Ay.createElement(F,{balance:m,className:Ke.modalBalance,withAddButton:!0})),r.Ay.createElement(Fe,{className:Ke.slider,defaultValue:50,maxValue:l,onChange:q}),r.Ay.createElement("h3",{className:Ke.title},K("StarsReactionTitle")),r.Ay.createElement("div",{className:Ke.description},(0,c.A)(K("StarsReactionText",ee),["simple_markdown","emoji"])),r.Ay.createElement(Pe.A,null,$&&r.Ay.createElement("div",{className:Ke.topLabel},K("StarsReactionTopSenders"))),$&&r.Ay.createElement("div",{className:Ke.top},$.map((e=>{const t=(0,z.Sm)(e.amount+e.localAmount),a=e.isAnonymous||!e.user||e.isMy&&x?ze:e.user,n="isCustomPeer"in a?K(a.titleKey):a&&(0,s.F9)(K,a);return r.Ay.createElement(me.A,{className:Ke.topPeer,key:`${e.user?.id||"anonymous"}-${t}`,peer:a,badgeText:t,badgeIcon:"star",badgeClassName:Ke.topBadge,text:n})}))),$&&r.Ay.createElement(Pe.A,{className:Ke.separator}),r.Ay.createElement(Ie.A,{className:(0,o.A)(Ke.checkBox,"dialog-checkbox"),checked:!x,onChange:H,label:K("StarsReactionShowMeInTopSenders")}),r.Ay.createElement(y.A,{size:"smaller",onClick:_},V("SendPaidReaction",{amount:I},{withNodes:!0,specialReplacement:{[N.Cyx]:r.Ay.createElement(p.A,{className:Ke.buttonStar,name:"star"})}})),r.Ay.createElement("p",{className:Ke.disclaimer},V("StarsReactionTerms",{link:r.Ay.createElement(f.A,{text:V("StarsReactionLinkText"),url:V("StarsReactionLink")})},{withNodes:!0})))})));var Ve=a(37836),He=a(5912),qe=a(23174),je=a(65632),We=a(20333),_e=a(4523),Qe=a(96530),Xe=a(22720),Ye=a(63152),Ze=a(94079);const $e="zZUpGRSI",et="zAee80Dv",tt="nTPAv1ci",at=(0,r.ph)((0,n.EK)(((e,{peerId:t})=>{const a=(0,i.SJA)(e),{stars:r}=e,{isBlurred:n,patternColor:s,background:o,backgroundColor:l}=(0,i.Gyz)(e,a)||{},c=(0,i.PVB)(e,t),m=(0,i.WA9)(e,t),d=(0,i.vGo)(e,t),u=e.currentUserId===t,A=!u&&d?.disallowedGifts?.shouldDisallowUniqueStarGifts,p=!u&&d?.disallowedGifts?.shouldDisallowLimitedStarGifts,f=(0,i.nTw)(e);return{starBalance:r?.balance,peer:c,theme:a,isBackgroundBlurred:n,patternColor:s,customBackground:o,backgroundColor:l,captionLimit:e.appConfig?.starGiftMaxMessageLength,currentUserId:e.currentUserId,isPaymentFormLoading:f.isPaymentFormLoading,paidMessagesStars:m,areUniqueStarGiftsDisallowed:A,shouldDisallowLimitedStarGifts:p}}))((function({gift:e,giftByStars:t,peerId:a,peer:i,captionLimit:c,theme:m,isBackgroundBlurred:u,patternColor:A,backgroundColor:p,customBackground:f,currentUserId:h,isPaymentFormLoading:g,starBalance:E,paidMessagesStars:S,areUniqueStarGiftsDisallowed:v,shouldDisallowLimitedStarGifts:b}){const{sendStarGift:N,sendPremiumGiftByStars:C,openInvoice:k,openGiftUpgradeModal:I,openStarsBalanceModal:G}=(0,n.ko)(),w=(0,T.A)(),[P,B]=(0,r.J0)(""),[M,x]=(0,r.J0)(!1),[U,D]=(0,r.J0)(!1),[R,O]=(0,r.J0)(!1),L=(0,je.A)(m,f);(0,r.vJ)((()=>{b&&D(!0)}),[b,U]);const F="id"in e,K=t&&"amount"in t,z=i&&(0,s.mO)(i),J=a===h,V=(0,r.Kr)((()=>{if(!F){const a=R&&K?t:e;return{id:-1,chatId:"0",isOutgoing:!1,senderId:h,date:Math.floor(Date.now()/1e3),content:{action:{mediaType:"action",type:"giftPremium",amount:a.amount,currency:a.currency,months:e.months,message:P?{text:P}:void 0}}}}return{id:-1,chatId:"0",isOutgoing:!1,senderId:h,date:Math.floor(Date.now()/1e3),content:{action:{mediaType:"action",type:"starGift",message:P?.length?{text:P}:void 0,isNameHidden:M||void 0,starsToConvert:e.starsToConvert,canUpgrade:U||void 0,alreadyPaidUpgradeStars:U?e.upgradeStars:void 0,gift:e,peerId:a,fromId:h}}}}),[h,e,P,F,M,U,a,R,K,t]),H=(0,d.A)((e=>{B(e.target.value)})),q=(0,d.A)((()=>{x(!M)})),j=(0,d.A)((()=>{D(!U)})),W=(0,d.A)((()=>{K&&O(!R)})),_=(0,d.A)((()=>{F&&I({giftId:e.id,peerId:a})})),Q=(0,d.A)((()=>{G({})})),X=(0,d.A)((()=>{F?N({peerId:a,shouldHideName:M,gift:e,message:P?{text:P}:void 0,shouldUpgrade:U}):R&&K?C({userId:a,months:t.months,amount:t.amount,message:P?{text:P}:void 0}):k({type:"giftcode",userIds:[a],currency:e.currency,amount:e.amount,option:e,message:P?{text:P}:void 0})})),Y=K&&E&&E.amount>t.amount,Z=(0,o.A)("ZORVRSG3","soDpW2YR",f&&"Eny_G3JI",p&&"TkJZPU2u",f&&u&&"M6k91TdM");return r.Ay.createElement("div",{className:(0,o.A)("jKOG0It6","custom-scroll")},r.Ay.createElement("div",{className:(0,o.A)("CB1mxsgp","MessageList"),inert:!0,style:(0,ye.A)(`--pattern-color: ${A}`,p&&`--theme-background-color: ${p}`)},r.Ay.createElement("div",{className:Z,style:L?`--custom-background: ${L}`:void 0}),r.Ay.createElement(_e.A,{key:F?e.id:e.months,message:V,threadId:qe.l3,appearanceOrder:0})),function(){const a=c?c-P.length:void 0,n=(0,s.F9)(w,i);return r.Ay.createElement("div",{className:"Y68CEIKn"},!S&&r.Ay.createElement(Ze.A,{className:"o5r2IPoA",onChange:H,value:P,label:w("GiftMessagePlaceholder"),maxLength:c,maxLengthIndicator:a&&a<50?a.toString():void 0}),Y&&r.Ay.createElement(Xe.A,{className:$e,narrow:!0,ripple:!0,onClick:W},r.Ay.createElement("span",null,w("GiftPremiumPayWithStars",{stars:(0,le.U)(w,t.amount,{className:et})},{withNodes:!0})),r.Ay.createElement(Ye.A,{checked:R,onChange:W,label:w("GiftPremiumPayWithStarsAcc")})),K&&E&&r.Ay.createElement("div",{className:tt},w("GiftPremiumDescriptionYourBalance",{stars:(0,le.U)(w,E.amount,{className:et}),link:r.Ay.createElement(Qe.A,{isPrimary:!0,onClick:Q},w("GetMoreStarsLinkText"))},{withNodes:!0,withMarkdown:!0})),F&&e.upgradeStars&&!v&&r.Ay.createElement(Xe.A,{className:$e,narrow:!0,ripple:!0,onClick:j,disabled:b},r.Ay.createElement("span",null,w("GiftMakeUnique",{stars:(0,le.U)(w,e.upgradeStars,{className:et})},{withNodes:!0})),r.Ay.createElement(Ye.A,{checked:U,onChange:j,label:w("GiftMakeUniqueAcc")})),F&&e.upgradeStars&&!v&&r.Ay.createElement("div",{className:tt},z?w("GiftMakeUniqueDescription",{user:n,link:r.Ay.createElement(Qe.A,{isPrimary:!0,onClick:_},w("GiftMakeUniqueLink"))},{withNodes:!0}):w("GiftMakeUniqueDescriptionChannel",{peer:n,link:r.Ay.createElement(Qe.A,{isPrimary:!0,onClick:_},w("GiftMakeUniqueLink"))},{withNodes:!0})),F&&r.Ay.createElement(Xe.A,{className:$e,narrow:!0,ripple:!0,onClick:q},r.Ay.createElement("span",null,w("GiftHideMyName")),r.Ay.createElement(Ye.A,{checked:M,onChange:q,label:w("GiftHideMyName")})),F&&r.Ay.createElement("div",{className:tt},J?w("GiftHideNameDescriptionSelf"):z?w("GiftHideNameDescription",{receiver:n}):w("GiftHideNameDescriptionChannel")))}(),r.Ay.createElement("div",{className:"ATowWJ60"}),function(){const a=R&&K?(0,le.U)(w,t.amount,{asFont:!0}):F?(0,le.U)(w,e.stars+(U?e.upgradeStars:0),{asFont:!0}):(0,l.v)(w,e.amount,e.currency);return r.Ay.createElement("div",{className:"jxWZSvet"},F&&e.availabilityRemains&&r.Ay.createElement(We.A,{isPrimary:!0,progress:e.availabilityRemains/e.availabilityTotal,rightText:w("GiftSoldCount",{count:e.availabilityTotal-e.availabilityRemains}),leftText:w("GiftLeftCount",{count:e.availabilityRemains}),className:"mWzLu0c0"}),r.Ay.createElement(y.A,{className:"IDuhjrne",size:"smaller",onClick:X,isLoading:g},w("GiftSend",{amount:a},{withNodes:!0})))}())})));var rt=a(87049);const nt="G1mBmzxs",st="a8no5WH0",it=(0,r.ph)((0,n.EK)(((e,{option:t})=>({sticker:(0,i.t0O)(e,t.months),canPlayAnimatedEmojis:(0,i.BWX)(e)})))((function({sticker:e,canPlayAnimatedEmojis:t,baseMonthAmount:a,option:n,optionByStars:s,onClick:i}){const{months:o,amount:c,currency:m}=n,u=(0,T.A)(),A=(0,d.A)((()=>{i(n)})),p=Math.floor(c/o),f=a&&a>p?Math.ceil(100-p/(a/100)):void 0;return r.Ay.createElement("div",{className:nt,tabIndex:0,role:"button",onClick:A},r.Ay.createElement(Q.A,{sticker:e,play:t,noLoop:!0,nonInteractive:!0,size:86}),function(){const e=12===o?u("Years",{count:1},{pluralValue:1}):u("Months",{count:o},{pluralValue:o});return r.Ay.createElement("div",{className:"rn9aWFNA"},e)}(),r.Ay.createElement("div",{className:"q4_ydkAx"},u("PremiumGiftDescription")),r.Ay.createElement(y.A,{className:st,nonInteractive:!0,size:"tiny",pill:!0,fluid:!0},(0,l.A)(c,m)),s&&r.Ay.createElement("div",{className:"QB5SI7ta"},u("GiftPremiumStarsPrice",{stars:(0,le.U)(u,s.amount,{className:"jgnEfoeM"})},{withNodes:!0,withMarkdown:!0})),Boolean(f)&&r.Ay.createElement(rt.A,{color:"purple",text:u("GiftDiscount",{percent:f})}))}))),ot=(0,r.ph)((function({gift:e,observeIntersection:t,onClick:a}){const{openGiftInfoModal:s}=(0,n.ko)(),i=(0,r.li)(null),l=(0,T.A)(),[c,m]=(0,B.A)(),{stars:u,isLimited:A,isSoldOut:f,sticker:h}=e,g=(0,d.A)((()=>{f?s({gift:e}):a(e)}));return(0,He.mv)(i,t,(e=>{e.isIntersecting&&m()})),r.Ay.createElement("div",{ref:i,className:(0,o.A)(nt,"f5ArEO1S"),tabIndex:0,role:"button",onClick:g},r.Ay.createElement(Q.A,{sticker:h,noLoop:!0,play:c,nonInteractive:!0,size:90}),r.Ay.createElement(y.A,{className:st,nonInteractive:!0,size:"tiny",color:"stars",withSparkleEffect:!0,pill:!0,fluid:!0},r.Ay.createElement(p.A,{name:"star",className:"DvJLTVFU"}),r.Ay.createElement("div",{className:"sbo2dMcH"},u)),A&&!f&&r.Ay.createElement(rt.A,{color:"blue",text:l("GiftLimited")}),f&&r.Ay.createElement(rt.A,{color:"red",text:l("GiftSoldOut")}))}));var lt=a(36838);const ct=(0,r.ph)((0,n.EK)((e=>{const{starGifts:t}=e;return{idsByCategory:t?.idsByCategory}}))((({idsByCategory:e,onCategoryChanged:t,areLimitedStarGiftsDisallowed:a})=>{const n=(0,r.li)(null),s=(0,T.A)(),i=(0,r.Kr)((()=>e&&Object.keys(e).filter((e=>"all"!==e&&"limited"!==e)).map(Number).sort(((e,t)=>e-t))),[e]),[l,c]=(0,r.J0)("all");function m(e){return r.Ay.createElement("div",{className:(0,o.A)("dO7FKYY4",l===e&&"B2lEJk1v"),onClick:()=>function(e){c(e),t(e)}(e)},Number.isInteger(e)&&r.Ay.createElement(O.A,{className:"Pb7AU805",type:"gold",size:"middle"}),function(e){return"all"===e?s("AllGiftsCategory"):"stock"===e?s("StockGiftsCategory"):"limited"===e?s("LimitedGiftsCategory"):e}(e))}return(0,lt.A)(n,void 0,!0),r.Ay.createElement("div",{ref:n,className:(0,o.A)("cUjwvN00","no-scrollbar")},m("all"),!a&&m("limited"),m("stock"),i?.map(m))}))),mt={root:"tJK1W0pJ",transition:"pP8TxefR",content:"o3V1HqbL",main:"cVXqeu9P",giftSection:"v4eKefwN",section:"EqfarEYb",starGiftsContainer:"OQX3GZl5",premiumGiftsGallery:"n40m3BK2",header:"iqqoyRgW",headerSlide:"BTWhJUQB",headerText:"lLRmbpIu",hiddenHeader:"XgGzn1cQ",commonHeaderText:"ybZo03if",closeButton:"r_Y5uG1T",balance:"soqAknia",avatars:"N_7tYJKr",logoBackground:"ieK4TzSb",center:"Ey5gX40t",description:"ZioU5h_k",starGiftsDescription:"gFgzS8pV",boostIcon:"Qi2YR6Dz",optionBottom:"RTbClMKE",secondaryInfo:"g0R9GSNq",footer:"J3Gju3bv",starGiftsTransition:"kB6IyXqS"},dt=(0,Ve.nF)((e=>e()),200,!0),ut=(0,r.ph)((0,n.EK)(((e,{modal:t})=>{const{starGifts:a,stars:r,currentUserId:n}=e,s=t?.forPeerId?(0,i.PVB)(e,t.forPeerId):void 0,o=Boolean(n&&t?.forPeerId===n),l=s?(0,i.vGo)(e,s?.id):void 0;return{boostPerSentGift:e.appConfig?.boostsPerSentGift,starGiftsById:a?.byId,starGiftIdsByCategory:a?.idsByCategory,starBalance:r?.balance,peer:s,isSelf:o,disallowedGifts:l?.disallowedGifts}}))((({modal:e,starGiftsById:t,starGiftIdsByCategory:a,starBalance:i,peer:l,isSelf:c,disallowedGifts:p})=>{const{closeGiftModal:g}=(0,n.ko)(),E=(0,r.li)(null),S=(0,r.li)(null),b=(0,r.li)(null),k=(0,r.li)(null),I=Boolean(e),G=(0,m.A)(e),w=l&&(0,s.mO)(l)?l:void 0,P=l&&(0,s.vj)(l)?l:void 0,[B,M]=(0,r.J0)(),[x,D]=(0,r.J0)(!1),[R,O]=(0,r.J0)(!1),[L,K]=(0,r.J0)(!1),[z,J]=(0,r.J0)("all"),V=(0,r.Kr)((()=>{if(!p)return;const{shouldDisallowPremiumGifts:e,...t}=p;return!c&&Object.values(t).every(Boolean)}),[c,p]),H=!c&&p?.shouldDisallowUnlimitedStarGifts,q=!c&&p?.shouldDisallowLimitedStarGifts,j=(0,u.A)(),W=(0,T.A)(),_=G?.gifts,Q=(0,r.Kr)((()=>_?.sort(((e,t)=>e.months-t.months)).filter((e=>1===e.users&&"XTR"!==e.currency))),[_]),X=(0,r.Kr)((()=>{const e=new Map;return Q?(Q.forEach((t=>{const a=_?.find((e=>e.currency===N.OUy&&e.months===t.months));a&&e.set(t,a)})),e):e}),[_,Q]),Y=(0,r.Kr)((()=>Q?.reduce(((e,t)=>e.amount<t.amount?e:t))),[Q]),{observe:Z}=(0,He.BL)({rootRef:k,throttleMs:200,isDisabled:!I}),$=Boolean(B),ee=$||x,te=$?L:R;(0,r.vJ)((()=>{I||(D(!1),M(void 0),J("all"))}),[I]);const ae=(0,d.A)((e=>{if($)return;const t=e.currentTarget;dt((()=>{const{scrollTop:e}=t;if(D(e>150),S.current&&b.current){const{top:e}=b.current.getBoundingClientRect(),{top:t}=S.current.getBoundingClientRect();O(e-t<=0)}}))})),re=W("GiftPremiumDescription",{user:(0,C.Yg)(w),link:r.Ay.createElement(f.A,{text:W("GiftPremiumDescriptionLinkCaption"),url:W("GiftPremiumDescriptionLink")})},{withNodes:!0}),ne=P?W("StarGiftDescriptionChannel",{peer:(0,s.F9)(W,P)},{withNodes:!0,withMarkdown:!0}):c?W("StarGiftDescriptionSelf",void 0,{withNodes:!0,renderTextFilters:["br"]}):W("StarGiftDescription",{user:(0,C.Yg)(w)},{withNodes:!0,withMarkdown:!0}),se=(0,d.A)((e=>{M(e),K("id"in e)})),ie=(0,d.A)((e=>{J(e)})),oe=(0,d.A)((()=>{$?M(void 0):g()})),le=$,ce=(0,o.A)("animated-close-icon",le&&"state-back");return r.Ay.createElement(h.A,{dialogRef:E,onClose:g,isOpen:I,isSlim:!0,contentClassName:mt.content,className:(0,o.A)(mt.modalDialog,mt.root),isLowStackPriority:!0},r.Ay.createElement(y.A,{className:mt.closeButton,round:!0,color:"translucent",size:"smaller",onClick:oe,ariaLabel:j(le?"Common.Back":"Common.Close")},r.Ay.createElement("div",{className:ce})),r.Ay.createElement(F,{className:mt.balance,balance:i,withAddButton:!0}),r.Ay.createElement("div",{className:(0,o.A)(mt.header,!ee&&mt.hiddenHeader)},r.Ay.createElement(U.Ay,{name:"slideVerticalFade",activeKey:Number(te),slideClassName:mt.headerSlide},r.Ay.createElement("h2",{className:mt.commonHeaderText},W(te?c?"StarsGiftHeaderSelf":"StarsGiftHeader":"GiftPremiumHeader")))),r.Ay.createElement(U.Ay,{ref:S,className:mt.transition,name:"pushSlide",activeKey:$?1:0},!$&&r.Ay.createElement("div",{ref:k,className:(0,o.A)(mt.main,"custom-scroll"),onScroll:ae},r.Ay.createElement("div",{className:mt.avatars},r.Ay.createElement(A.A,{size:100,peer:l}),r.Ay.createElement("img",{className:mt.logoBackground,src:v,alt:"",draggable:!1})),!c&&!P&&!p?.shouldDisallowPremiumGifts&&r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement("h2",{className:(0,o.A)(mt.headerText,mt.center)},W("GiftPremiumHeader")),r.Ay.createElement("p",{className:(0,o.A)(mt.description,mt.center)},re),r.Ay.createElement("div",{className:mt.premiumGiftsGallery},Q?.map((e=>r.Ay.createElement(it,{option:e,optionByStars:X.get(e),baseMonthAmount:Y?Math.floor(Y.amount/Y.months):void 0,onClick:se}))))),!V&&r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement("h2",{ref:b,className:(0,o.A)(mt.headerText,mt.center)},W(c?"StarsGiftHeaderSelf":"StarsGiftHeader")),r.Ay.createElement("p",{className:(0,o.A)(mt.description,mt.starGiftsDescription,mt.center)},ne),r.Ay.createElement(ct,{areLimitedStarGiftsDisallowed:q,onCategoryChanged:ie}),r.Ay.createElement(U.Ay,{name:"zoomFade",activeKey:(me=z,"all"===me?-2:"limited"===me?-1:"stock"===me?0:me),className:mt.starGiftsTransition},function(){const e=a?.[z]?.filter((e=>{const a=t?.[e];if(!a)return!1;const{isLimited:r,isSoldOut:n,upgradeStars:s}=a;return H&&!q?r:q&&!H?!r&&!n:!H||!q||Boolean(r&&!!s)}));return r.Ay.createElement("div",{className:mt.starGiftsContainer},t&&e?.map((e=>{const a=t[e];return r.Ay.createElement(ot,{key:e,gift:a,observeIntersection:Z,onClick:se})})))}()))),$&&G?.forPeerId&&r.Ay.createElement(at,{gift:B,giftByStars:X.get(B),peerId:G.forPeerId})));var me})));const At=(0,r.ph)((0,n.EK)((e=>{const{currentUserId:t}=e;return{currentUserId:t,userIds:e.contactList?.userIds}}))((({modal:e,currentUserId:t,userIds:a})=>{const{closeGiftRecipientPicker:o,openGiftModal:l}=(0,n.ko)(),c=(0,u.A)(),m=e,[A,p]=(0,r.J0)(""),f=(0,r.Kr)((()=>{const e=(0,n.mS)(),r=a?a.concat(t):void 0,o=r?(0,s.PU)({ids:r,query:A}):[];return(0,I.A)((0,k.Am)(o).filter((t=>(0,i.X2D)(e,t))),void 0,[t])}),[t,A,a]),y=(0,d.A)((e=>{l({forUserId:e}),o()}));return r.Ay.createElement(w.A,{className:"W3JMs1YE",isOpen:m,onClose:o,title:c("GiftTelegramPremiumOrStarsTitle"),hasCloseButton:!0,shouldAdaptToSearch:!0,withFixedHeight:!0},r.Ay.createElement(G.A,{className:"wOipz1Y_",itemIds:f,filterValue:A,filterPlaceholder:c("Search"),onSelectedIdChange:y,onFilterChange:p,isSearchable:!0,withDefaultPadding:!0,withStatus:!0,forceShowSelf:!0}))})));var pt=a(80140),ft=a(18501),yt=a(25404),ht=a(94189);const gt={modal:"nnublcCk",header:"p7FTs7_p",title:"pIbzzTir",description:"CCPfr26t",soldOut:"kjWcRp4W",footer:"bho0GTYt",footerDescription:"VUylTszM",unknown:"zDauXmpS",giftValue:"w_E4LkUj",uniqueAttribute:"OJQnkf17",uniqueGift:"I6o_pGAm",starAmountIcon:"_5guecUe",modalHeader:"ie9tImaj",modalCloseButton:"p38RBGdC",ownerAddress:"DavMRg4Q",copyIcon:"SLX5tX8C"},Et=(0,r.ph)((0,n.EK)(((e,{modal:t})=>{const a=t?.gift,r=a&&"gift"in a,n=e.currentUserId,o=r&&a.fromId,l=o?(0,i.PVB)(e,o):void 0,c=t?.peerId?(0,i.PVB)(e,t.peerId):void 0,m=c&&(0,s.vj)(c)?c:void 0,d=m&&(0,C.ub)(m,"postMessages"),u=(0,i.mBe)(e,n),A=u?.emojiStatus,p=e.collectibleEmojiStatuses?.statuses;return{fromPeer:l,targetPeer:c,currentUserId:n,starGiftMaxConvertPeriod:e.appConfig?.starGiftMaxConvertPeriod,tonExplorerUrl:e.appConfig?.tonExplorerUrl,hasAdminRights:d,currentUserEmojiStatus:A,collectibleEmojiStatuses:p}}))((({modal:e,fromPeer:t,targetPeer:a,currentUserId:l,starGiftMaxConvertPeriod:c,hasAdminRights:h,currentUserEmojiStatus:g,collectibleEmojiStatuses:E,tonExplorerUrl:S})=>{const{closeGiftInfoModal:v,changeGiftVisibility:b,convertGiftToStars:N,openChatWithInfo:C,focusMessage:k,openGiftUpgradeModal:I,showNotification:G}=(0,n.ko)(),[w,P,M]=(0,B.A)(),x=(0,T.A)(),U=(0,u.A)(),D=Boolean(e),O=(0,m.A)(e),L=(0,m.A)(t),F=(0,m.A)(a),J=F&&(0,s.vj)(F),{gift:V}=O||{},H=V&&"gift"in V,W=H?V:void 0,_=W?.fromId===l,X=W&&c&&W.date+c-(0,pt.Fm)()||0,Y=Math.ceil(X/60/60/24),Z=H?V.gift:V,$=Z&&(0,j.yQ)(Z),ee=X>0&&Boolean(W?.starsToConvert),te=Z&&"starGiftUnique"===Z.type,ae=Boolean(W?.upgradeMsgId),re=!ae&&W?.inputGift&&(J?h:F?.id===l),ne=(0,d.A)((()=>{v()})),se=(0,d.A)((()=>{const e=_?F:L;if(!W?.upgradeMsgId||!e)return;const{upgradeMsgId:t}=W;k({chatId:e.id,messageId:t}),ne()})),ie=(0,d.A)((()=>{const{inputGift:e,isUnsaved:t}=W;b({gift:e,shouldUnsave:!t}),ne()})),oe=(0,d.A)((()=>{const{inputGift:e}=W;N({gift:e}),M(),ne()})),ce=(0,d.A)((()=>{W&&I({giftId:W.gift.id,gift:W})})),me=(0,r.Kr)((()=>Z&&(0,j.uc)(Z)),[Z]),de=(0,r.Kr)((()=>({onTrigger:e,isMenuOpen:t})=>r.Ay.createElement(y.A,{round:!0,size:"smaller",color:"translucent-white",className:t?"active":"",onClick:e,ariaLabel:x("AriaMoreButton")},r.Ay.createElement(p.A,{name:"more"}))),[x]),ue=(0,d.A)((()=>ae?r.Ay.createElement(y.A,{size:"smaller",onClick:se},x("GiftInfoViewUpgraded")):re&&W?.alreadyPaidUpgradeStars&&!W.upgradeMsgId?r.Ay.createElement(y.A,{size:"smaller",isShiny:!0,onClick:ce},x("GiftInfoUpgradeForFree")):r.Ay.createElement(y.A,{size:"smaller",onClick:ne},x("OK")))),Ae=(0,r.Kr)((()=>{if(!Z)return;let e="";return"starGift"===Z.type&&(Z.firstSaleDate&&(e+=`${x("GiftInfoFirstSale")} ${(0,K.L2)(1e3*Z.firstSaleDate,x.code,!0)}`),Z.lastSaleDate&&(e+="\n",e+=`${x("GiftInfoLastSale")} ${(0,K.L2)(1e3*Z.lastSaleDate,x.code,!0)}`)),e}),[Z,x]),ye=(0,r.Kr)((()=>{if(!V||!Z)return;const{fromId:e,isNameHidden:t,starsToConvert:a,isUnsaved:l,isConverted:c,upgradeMsgId:m}=W||{},d=ee&&Boolean(a),u=t&&F,h=(()=>{if(!W)return x("GiftInfoSoldOutDescription");if(!J){if(W.upgradeMsgId)return x("GiftInfoDescriptionUpgraded");if(W.canUpgrade&&W.alreadyPaidUpgradeStars)return re?x("GiftInfoDescriptionFreeUpgrade"):x("GiftInfoPeerDescriptionFreeUpgradeOut",{peer:(0,s.F9)(x,F)});if(re||_)return c&&d?re?x("GiftInfoDescriptionConverted",{amount:a},{pluralValue:a,withNodes:!0,withMarkdown:!0}):x("GiftInfoPeerDescriptionOutConverted",{amount:a,peer:(0,s.F9)(x,F)},{pluralValue:a,withNodes:!0,withMarkdown:!0}):W.canUpgrade&&re?d?x("GiftInfoDescriptionUpgrade",{amount:a},{pluralValue:a,withNodes:!0,withMarkdown:!0}):x("GiftInfoDescriptionUpgradeRegular"):re?d?x("GiftInfoDescription",{amount:a},{withNodes:!0,withMarkdown:!0,pluralValue:a}):x("GiftInfoDescriptionRegular"):d?x("GiftInfoPeerDescriptionOut",{amount:a,peer:(0,s.F9)(x,F)},{withNodes:!0,withMarkdown:!0,pluralValue:a}):x("GiftInfoPeerDescriptionOutRegular",{peer:(0,s.F9)(x,F)})}})(),b=r.Ay.createElement(Ge.A,{className:"with-menu-transitions",trigger:de,positionX:"right"},r.Ay.createElement(yt.A,{peerId:O.peerId,gift:V,canManage:re,collectibleEmojiStatuses:E,currentUserEmojiStatus:g})),N=r.Ay.createElement("div",{className:gt.modalHeader},r.Ay.createElement(y.A,{className:gt.modalCloseButton,round:!0,color:"translucent-white",size:"smaller",ariaLabel:x("Close"),onClick:ne},r.Ay.createElement(p.A,{name:"close"})),D&&b),k=te&&r.Ay.createElement("div",{className:(0,o.A)(gt.header,gt.uniqueGift)},r.Ay.createElement(he,{backdropAttribute:me.backdrop,patternAttribute:me.pattern,modelAttribute:me.model,title:Z.title,subtitle:x("GiftInfoCollectible",{number:Z.number})})),I=r.Ay.createElement("div",{className:gt.header},r.Ay.createElement(Q.A,{className:gt.giftSticker,sticker:$,size:120}),r.Ay.createElement("h1",{className:gt.title},te?Z.title:x(W?re?"GiftInfoReceived":"GiftInfoTitle":"GiftInfoSoldOutTitle")),h&&r.Ay.createElement("p",{className:(0,o.A)(gt.description,!W&&"starGift"===Z?.type&>.soldOut)},h)),w=[];if("starGift"===Z.type){(e||t)&&w.push([x("GiftInfoFrom"),e?{chatId:e}:r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement(A.A,{size:"small",peer:q.I5}),r.Ay.createElement("span",{className:gt.unknown},U(q.I5.titleKey)))]),W?.date&&w.push([x("GiftInfoDate"),r.Ay.createElement("span",{title:Ae},(0,K.L2)(1e3*W.date,x.code,!0))]),Z.firstSaleDate&&!W&&w.push([x("GiftInfoFirstSale"),(0,K.L2)(1e3*Z.firstSaleDate,x.code,!0)]),Z.lastSaleDate&&!W&&w.push([x("GiftInfoLastSale"),(0,K.L2)(1e3*Z.lastSaleDate,x.code,!0)]);const n=Z.stars+(W?.alreadyPaidUpgradeStars||0);w.push([x("GiftInfoValue"),r.Ay.createElement("div",{className:gt.giftValue},(0,le.U)(x,n,{className:gt.starAmountIcon}),re&&ee&&Boolean(a)&&r.Ay.createElement(R.A,{onClick:P},x("GiftInfoConvert",{amount:a},{pluralValue:a})))]),Z.availabilityTotal&&w.push([x("GiftInfoAvailability"),x("GiftInfoAvailabilityValue",{count:Z.availabilityRemains||0,total:Z.availabilityTotal},{pluralValue:Z.availabilityRemains||0})]),Z.upgradeStars&&!m&&w.push([x("GiftInfoStatus"),r.Ay.createElement("div",{className:gt.giftValue},x("GiftInfoStatusNonUnique"),re&&r.Ay.createElement(R.A,{onClick:ce},x("GiftInfoUpgradeBadge")))]),W?.message&&w.push([void 0,(0,ft.fd)(W.message)])}if(te){const{ownerName:e,ownerAddress:t,ownerId:a}=Z,{model:o,backdrop:l,pattern:c,originalDetails:m}=me||{};if(t?w.push([x("GiftInfoOwner"),r.Ay.createElement("span",{className:gt.ownerAddress,onClick:()=>{(0,pe.eM)(t),G({message:{key:"WalletAddressCopied"},icon:"copy"})}},t,r.Ay.createElement(p.A,{className:gt.copyIcon,name:"copy"}))]):w.push([x("GiftInfoOwner"),a?{chatId:a,withEmojiStatus:!0}:e||""]),o&&w.push([x("GiftAttributeModel"),r.Ay.createElement("span",{className:gt.uniqueAttribute},o.name,r.Ay.createElement(R.A,null,(0,z.l9)(o.rarityPercent)))]),l&&w.push([x("GiftAttributeBackdrop"),r.Ay.createElement("span",{className:gt.uniqueAttribute},l.name,r.Ay.createElement(R.A,null,(0,z.l9)(l.rarityPercent)))]),c&&w.push([x("GiftAttributeSymbol"),r.Ay.createElement("span",{className:gt.uniqueAttribute},c.name,r.Ay.createElement(R.A,null,(0,z.l9)(c.rarityPercent)))]),w.push([x("GiftInfoAvailability"),x("GiftInfoIssued",{issued:Z.issuedCount,total:Z.totalCount})]),m){const{date:e,recipientId:t,message:a,senderId:o}=m,l=(0,n.mS)(),c=e=>{C({id:e}),v()},d=(0,i.PVB)(l,t),u=o?(0,i.PVB)(l,o):void 0,A=(0,K.L2)(1e3*e,x.code,!0),p=r.Ay.createElement(Qe.A,{onClick:()=>c(t),isPrimary:!0},(0,s.F9)(x,d));let f;if(u&&o!==t){const e=r.Ay.createElement(Qe.A,{onClick:()=>c(u.id),isPrimary:!0},(0,s.F9)(x,u));f=a?x("GiftInfoPeerOriginalInfoTextSender",{peer:p,sender:e,text:(0,ft.fd)(a),date:A},{withNodes:!0}):x("GiftInfoPeerOriginalInfoSender",{peer:p,date:A,sender:e},{withNodes:!0})}else f=a?x("GiftInfoPeerOriginalInfoText",{peer:p,text:(0,ft.fd)(a),date:A},{withNodes:!0}):x("GiftInfoPeerOriginalInfo",{peer:p,date:A},{withNodes:!0});w.push([void 0,r.Ay.createElement("span",null,f)])}}const B=S&&te&&Z.giftAddress&&`${S}${Z.giftAddress}`,T=r.Ay.createElement("div",{className:gt.footer},(re||B)&&r.Ay.createElement("div",{className:gt.footerDescription},B&&r.Ay.createElement("div",null,x("GiftInfoTonText",{link:r.Ay.createElement(f.A,{url:B,shouldSkipModal:!0,text:x("GiftInfoTonLinkText")})},{withNodes:!0})),re&&r.Ay.createElement("div",null,x(`GiftInfo${J?"Channel":""}${l?"Hidden":"Saved"}`,{link:r.Ay.createElement(Qe.A,{isPrimary:!0,onClick:ie},x("GiftInfoSaved"+(l?"Show":"Hide")))},{withNodes:!0})),u&&r.Ay.createElement("div",null,x("GiftInfoSenderHidden"))),ue());return{modalHeader:te?N:void 0,header:te?k:I,tableData:w,footer:T}}),[V,W,F,$,x,re,ee,_,U,S,Z,me,ue,J,de,D,te,O,E,g,Ae]);return r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement(fe.A,{isOpen:D,modalHeader:ye?.modalHeader,header:ye?.header,hasBackdrop:te,tableData:ye?.tableData,footer:ye?.footer,className:gt.modal,onClose:ne}),W&&r.Ay.createElement(ht.A,{isOpen:w,onClose:M,confirmHandler:oe,title:x("GiftInfoConvertTitle")},r.Ay.createElement("div",null,x("GiftInfoPeerConvertDescription",{amount:(0,le.K)(x,W.starsToConvert),peer:(0,s.F9)(x,L)},{withNodes:!0,withMarkdown:!0})),ee&&r.Ay.createElement("div",null,x("GiftInfoConvertDescriptionPeriod",{count:Y},{withNodes:!0,withMarkdown:!0,pluralValue:Y})),r.Ay.createElement("div",null,x("GiftInfoConvertDescription2"))))})));var St=a(58554),vt=a(32625),bt=a(5463);const Nt="_Dt6RSQV",Ct=(0,r.ph)((0,n.EK)(((e,{modal:t})=>{const a=t?.recipientId;return{recipient:a?(0,i.PVB)(e,a):void 0}}))((({modal:e,recipient:t})=>{const{closeGiftUpgradeModal:a,upgradeGift:i}=(0,n.ko)(),o=Boolean(e),l=(0,m.A)(e),c=(0,m.A)(t),[u,A]=(0,r.J0)(!1),[p,f]=(0,r.J0)(),h=(0,T.A)(),g=(0,d.A)((()=>a())),E=(0,d.A)((()=>{const e=l?.gift;e?.inputGift&&(i({gift:e.inputGift,shouldKeepOriginalDetails:u,upgradeStars:e.alreadyPaidUpgradeStars?void 0:e.gift.upgradeStars}),g())})),S=(0,d.A)((()=>{l?.sampleAttributes&&f(function(e,t){const a=e.filter((e=>"model"===e.type&&e.name!==t?.model.name)),r=e.filter((e=>"pattern"===e.type&&e.name!==t?.pattern.name)),n=e.filter((e=>"backdrop"===e.type&&e.name!==t?.backdrop.name));return{model:a[Math.floor(Math.random()*a.length)],pattern:r[Math.floor(Math.random()*r.length)],backdrop:n[Math.floor(Math.random()*n.length)]}}(l.sampleAttributes,p))}));(0,vt.A)(S,o?3e3:void 0,!0),(0,r.vJ)((()=>{o&&l?.sampleAttributes&&S()}),[o,l?.sampleAttributes]),(0,r.vJ)((()=>{const e=l?.sampleAttributes;e&&[...e.filter((e=>"pattern"===e.type)).map((e=>e.sticker)),...e.filter((e=>"model"===e.type)).map((e=>e.sticker))].map((e=>(0,C.Mw)(e,"full"))).forEach((e=>{(0,St.hd)(e,qe.qZ.BlobUrl)}))}),[l?.sampleAttributes]);const v=(0,r.Kr)((()=>{if(!p||!o)return;const e=l?.gift,t=[["diamond",h("GiftUpgradeUniqueTitle"),h("GiftUpgradeUniqueDescription")],["trade",h("GiftUpgradeTransferableTitle"),h("GiftUpgradeTransferableDescription")],["auction",h("GiftUpgradeTradeableTitle"),h("GiftUpgradeTradeableDescription")]],a=c?h("GiftPeerUpgradeText",{peer:(0,s.F9)(h,c)}):h("GiftUpgradeTextOwn");return{listItemData:t,header:r.Ay.createElement(he,{modelAttribute:p.model,backdropAttribute:p.backdrop,patternAttribute:p.pattern,title:h("GiftUpgradeTitle"),subtitle:a}),footer:r.Ay.createElement("div",{className:"EWaVCxY4"},!e&&r.Ay.createElement(y.A,{className:Nt,size:"smaller",onClick:g},h("OK")),e&&r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement(Ie.A,{label:h("GiftUpgradeKeepDetails"),onCheck:A,checked:u}),r.Ay.createElement(y.A,{className:Nt,size:"smaller",isShiny:!0,onClick:E},e.alreadyPaidUpgradeStars?h("GeneralConfirm"):h("GiftUpgradeButton",{amount:(0,le.U)(h,e.gift.upgradeStars,{asFont:!0})},{withNodes:!0}))))}}),[p,o,h,c,l?.gift,u]);return r.Ay.createElement(bt.A,{isOpen:o,header:v?.header,footer:v?.footer,listItemData:v?.listItemData,hasBackdrop:!0,onClose:g})})));var kt=a(47483);const It=(0,r.ph)((0,n.EK)((e=>({currentUser:(0,i.mBe)(e,e.currentUserId),isCurrentUserPremium:(0,i.g29)(e)})))((({modal:e,currentUser:t,isCurrentUserPremium:a})=>{const{closeGiftStatusInfoModal:s,setEmojiStatus:i}=(0,n.ko)(),l=(0,T.A)(),c=Boolean(e),u=(0,m.A)(e),{emojiStatus:f}=u||{},h=f?.textColor,g=(0,kt.A)(f?.patternDocumentId),E=(0,d.A)((()=>{s()})),S=(0,d.A)((()=>{f&&i({emojiStatus:f}),s()})),v=(0,r.Kr)((()=>{if(!f||!c)return;const e=[f.centerColor,f.edgeColor],t=f.patternColor;return r.Ay.createElement(X.A,{className:"_1RfhkfB",backgroundColors:e,patternColor:t,patternIcon:g.customEmoji})}),[f,c,g]),b=(0,r.Kr)((()=>({...t,emojiStatus:f})),[t,f]),N=(0,r.Kr)((()=>r.Ay.createElement("div",{className:"qL0cHbwS"},r.Ay.createElement("div",{className:(0,o.A)("t18QCmAb"),style:(0,ye.A)(h&&`color: ${h}`)},v,r.Ay.createElement(A.A,{peer:b,size:"jumbo",className:"JK2zOWA7"}),r.Ay.createElement(ke.A,{peer:b,className:"lxxbgNCl",withEmojiStatus:!0,noFake:!0,noVerified:!0,statusSparklesColor:h}),r.Ay.createElement("p",{className:"MLMdxkUg",style:(0,ye.A)(h&&`color: ${h}`)},l("Online"))),r.Ay.createElement("div",{className:"q8w7tnmR"},r.Ay.createElement("div",{className:"wxg_5ou_"},l("UniqueStatusWearTitle",{gift:b?.emojiStatus?.title})),r.Ay.createElement("div",{className:"KSCLIMZm"},l("UniqueStatusBenefitsDescription"))))),[h,v,b,l]),C=[["radial-badge",l("UniqueStatusBadgeBenefitTitle"),l("UniqueStatusBadgeDescription")],["unique-profile",l("UniqueStatusProfileDesignBenefitTitle"),l("UniqueStatusProfileDesignDescription")],["proof-of-ownership",l("UniqueStatusProofOfOwnershipBenefitTitle"),l("UniqueStatusProofOfOwnershipDescription")]],k=(0,r.Kr)((()=>{if(c)return r.Ay.createElement("div",{className:"VDrvalBo"},r.Ay.createElement(y.A,{size:"smaller",onClick:S},l("UniqueStatusWearButton"),!a&&r.Ay.createElement(p.A,{name:"lock-badge",className:"jiPObOWv"})))}),[l,a,c]);return r.Ay.createElement(bt.A,{isOpen:c,header:N,listItemData:C,footer:k,hasBackdrop:!0,onClose:E})})));var Gt=a(21309),wt=a(76023),Pt=a(15535);const Bt={header:"LQgz8Nlx",giftPreview:"hgs0ts_O",backdrop:"OnBhMaBw",description:"HBxB4QPY",arrow:"kXTOUpfb",noPassword:"BnqLhoKr"},Tt={isCustomPeer:!0,avatarIcon:"fragment",title:"",customPeerAvatarColor:"#000000"},Mt=4.5*wt.$,xt=(0,r.ph)((0,n.EK)((e=>{const{settings:{byKey:{hasPassword:t}},twoFaSettings:{hint:a}}=e;return{hasPassword:t,passwordHint:a}}))((({modal:e,hasPassword:t,passwordHint:a})=>{const{closeGiftWithdrawModal:s,clearGiftWithdrawError:i,processStarGiftWithdrawal:o}=(0,n.ko)(),l=Boolean(e),[c,u]=(0,r.J0)(!1),f=(0,T.A)(),y=(0,m.A)(e),g=y?.gift?.gift,E=g&&(0,j.uc)(g),S=y?.gift?.canExportAt?Math.max(y.gift.canExportAt-(0,pt.Fm)(),0):void 0,v=(0,d.A)((()=>{s()})),b=(0,d.A)((e=>{o({gift:y.gift.inputGift,password:e})}));return r.Ay.createElement(h.A,{isOpen:l,title:f("GiftWithdrawTitle"),hasCloseButton:!0,isSlim:!0,onClose:v},E&&r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement("div",{className:Bt.header},r.Ay.createElement("div",{className:Bt.giftPreview},r.Ay.createElement(X.A,{className:Bt.backdrop,backgroundColors:[E.backdrop.centerColor,E.backdrop.edgeColor],patternColor:E.backdrop?.patternColor,patternIcon:E.pattern?.sticker}),r.Ay.createElement(Q.A,{className:Bt.sticker,size:Mt,sticker:E.model?.sticker})),r.Ay.createElement(p.A,{name:"next",className:Bt.arrow}),r.Ay.createElement(A.A,{peer:Tt,size:"giant",className:Bt.avatar})),r.Ay.createElement("p",{className:Bt.description},f("GiftWithdrawDescription",{gift:`${g.title} #${g.number}`},{withNodes:!0,withMarkdown:!0,renderTextFilters:["br"]}))),Boolean(S)&&r.Ay.createElement("p",{className:Bt.exportHint},f("GiftWithdrawWait",{days:(0,Gt._k)(S)},{pluralValue:(0,Gt._k)(S)})),!t&&r.Ay.createElement("span",{className:Bt.noPassword},f("ErrorPasswordMissing")),t&&!S&&r.Ay.createElement(Pt.A,{shouldShowSubmit:!0,placeholder:f("CheckPasswordPlaceholder"),error:y?.errorKey&&f.withRegular(y?.errorKey),description:f("CheckPasswordDescription"),clearError:i,isLoading:y?.isLoading,hint:a,isPasswordVisible:c,shouldResetValue:l,onChangePasswordVisibility:u,submitLabel:f("GiftWithdrawSubmit"),onSubmit:b}))})));var Ut=a(79824),Dt=a(74984),Rt=a(4875),Ot=a(56863),Lt=a(30857),Ft=a(84080),Kt=a(56133),zt=a(35297);function Jt(){}async function Vt(e){const t=await(0,Rt.px)("searchChats",{query:e});if(t)return[...t.accountResultIds,...t.globalResultIds]}const Ht={header:"PvaNNycU",giftPreview:"nCQxWKdu",backdrop:"JCP9JNuS",arrow:"p_1cyCau"},qt=4*wt.$,jt=3*wt.$,Wt=(0,r.ph)((0,n.EK)((e=>{const{contactList:t,currentUserId:a}=e;return{contactIds:t?.userIds,currentUserId:a}}))((({modal:e,contactIds:t,currentUserId:a})=>{const{closeGiftTransferModal:o,openGiftWithdrawModal:l,transferGift:c}=(0,n.ko)(),u=Boolean(e),f=(0,T.A)(),[y,h]=(0,r.J0)(""),g=(0,m.A)(e),E=g?.gift?.gift,S=E&&(0,j.uc)(E),[v,b]=(0,r.J0)(),C=(0,m.A)(v),P=(0,r.Kr)((()=>{const e=(0,n.mS)();return C?(0,i.PVB)(e,C):void 0}),[C]),B=(0,Dt.Rh)(N.DSF),M=(0,r.Kr)((()=>(0,k.Am)([...t||[],...B||[]])),[t,B]),{result:x,currentResultsQuery:U}=function({query:e,queryFn:t=Vt,defaultValue:a,debounceTimeout:n=300,isDisabled:s}){const i=function(e,t,a){const[n,s]=(0,r.J0)(),{isFrozen:i,updateWhenUnfrozen:o}=function(){const e=(0,r.li)(!1),t=(0,r.hb)((()=>{e.current=!0}),[]),a=(0,Lt.A)(),n=(0,r.hb)((()=>{e.current&&(e.current=!1,a())}),[a]);return(0,Ft.Ay)(Jt,n),{isFrozen:(0,r.OV)(),updateWhenUnfrozen:t}}(),l=(0,Kt.A)(t,!0);return(0,zt.A)((()=>{i?o():l((()=>{s(e())}))}),[...a,i]),n}((()=>e),n,[e]),[o,l]=(0,r.J0)(""),c=e?i:e,m=(0,d.A)(t);return{...(0,Ot.A)((async()=>{if(!c||s)return l(""),Promise.resolve(a);const e=await m(c);return l(c),e}),[c,a,m,s],a),currentResultsQuery:o}}({query:y,defaultValue:M}),D=U!==y,R=(0,r.Kr)((()=>U?Ut.p:[{type:"withdraw",isCustomPeer:!0,avatarIcon:"toncoin",peerColorId:5,title:f("GiftTransferTON")}]),[f,U]),O=(0,d.A)((e=>{"withdraw"===e&&(l({gift:g.gift}),o())})),L=(0,r.Kr)((()=>{if(D)return Ut.p;const e=(0,n.mS)();return(0,I.A)((x||[]).filter((t=>t!==a&&(0,i.X2D)(e,t))),!1)}),[D,x,a]),F=(0,d.A)((()=>{b(void 0)}));(0,r.vJ)((()=>{u||b(void 0)}),[u]);const K=(0,d.A)((()=>{g?.gift.inputGift&&(c({gift:g.gift.inputGift,recipientId:C,transferStars:g.gift.transferStars}),F(),o())}));return r.Ay.createElement(w.A,{isOpen:u,onClose:o,title:f("GiftTransferTitle"),hasCloseButton:!0,shouldAdaptToSearch:!0,withFixedHeight:!0,ignoreFreeze:!0},r.Ay.createElement(G.A,{itemIds:L,categories:R,onSelectedCategoryChange:O,withDefaultPadding:!0,withPeerUsernames:!0,isSearchable:!0,noScrollRestore:!0,isLoading:D,filterValue:y,filterPlaceholder:f("Search"),onFilterChange:h,onSelectedIdChange:b}),S&&r.Ay.createElement(ht.A,{isOpen:Boolean(v),noDefaultTitle:!0,onClose:F,confirmLabel:g?.gift.transferStars?f("GiftTransferConfirmButton",{amount:(0,le.U)(f,g.gift.transferStars,{asFont:!0})},{withNodes:!0}):f("GiftTransferConfirmButtonFree"),confirmHandler:K},r.Ay.createElement("div",{className:Ht.header},r.Ay.createElement("div",{className:Ht.giftPreview},r.Ay.createElement(X.A,{className:Ht.backdrop,backgroundColors:[S.backdrop.centerColor,S.backdrop.edgeColor],patternColor:S.backdrop?.patternColor,patternIcon:S.pattern?.sticker}),r.Ay.createElement(Q.A,{className:Ht.sticker,size:jt,sticker:S.model?.sticker})),r.Ay.createElement(p.A,{name:"next",className:Ht.arrow}),r.Ay.createElement(A.A,{peer:P,size:qt,className:Ht.avatar})),r.Ay.createElement("p",null,g?.gift.transferStars?f("GiftTransferConfirmDescription",{gift:f("GiftUnique",{title:E.title,number:E.number}),amount:(0,le.K)(f,g.gift.transferStars),peer:(0,s.F9)(f,P)},{withNodes:!0,withMarkdown:!0}):f("GiftTransferConfirmDescriptionFree",{gift:f("GiftUnique",{title:E.title,number:E.number}),peer:(0,s.F9)(f,P)},{withNodes:!0,withMarkdown:!0}))))}))),_t=(0,r.ph)((0,n.EK)(((e,{modal:t})=>({user:t?.userId?(0,i.mBe)(e,t.userId):void 0})))((({modal:e,user:t})=>{const{closeChatRefundModal:a,addNoPaidMessagesException:i}=(0,n.ko)(),[o,l]=(0,r.J0)(!1),c=(0,m.A)(e),u=(0,m.A)(t),{starsToRefund:A,userId:p}=c||{},f=(0,T.A)(),y=Boolean(e),h=(0,d.A)((()=>{a(),p&&i({userId:p,shouldRefundCharged:o})}));return r.Ay.createElement(ht.A,{isOpen:y,onClose:a,title:f("RemoveFeeTitle"),confirmLabel:f("ConfirmRemoveMessageFee"),confirmHandler:h},f("ConfirmDialogMessageRemoveFee",{peer:u&&(0,s.F9)(f,u)},{withMarkdown:!0,withNodes:!0}),Boolean(A)&&r.Ay.createElement(Ie.A,{className:"dialog-checkbox",label:f("ConfirmDialogRemoveFeeRefundStars",{amount:(0,le.K)(f,A)},{withMarkdown:!0,withNodes:!0}),checked:o,onCheck:l}))})))},84991:(e,t,a)=>{a.d(t,{A:()=>c});var r=a(84051),n=a(87357),s=a(39351),i=a(21849),o=a(18276);const l={root:"hyRfEyRz",top:"p_Ny8jqJ",badge:"QRrryqp4",text:"I5jdPgFL"},c=(0,r.ph)((({peer:e,avatarWebPhoto:t,avatarSize:a,text:c,badgeText:m,badgeIcon:d,className:u,badgeClassName:A,badgeIconClassName:p,textClassName:f,onClick:y})=>{const h=(0,s.A)();return r.Ay.createElement("div",{className:(0,n.A)(l.root,y&&l.clickable,u),onClick:y},r.Ay.createElement("div",{className:l.top},r.Ay.createElement(i.A,{size:a,peer:e,webPhoto:t}),m&&r.Ay.createElement("div",{className:(0,n.A)(l.badge,A),dir:h.isRtl?"rtl":"ltr"},d&&r.Ay.createElement(o.A,{name:d,className:p}),m)),c&&r.Ay.createElement("p",{className:(0,n.A)(l.text,f)},c))}))},34642:(e,t,a)=>{a.d(t,{A:()=>c});var r=a(84051),n=a(87357),s=a(59030),i=a(64493),o=a(8410);function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},l.apply(this,arguments)}const c=(0,r.ph)((({confirmButtonText:e,isConfirmDisabled:t,shouldAdaptToSearch:a,withFixedHeight:c,onConfirm:m,withPremiumGradient:d,...u})=>{const A=(0,s.A)(),p=Boolean(e||m);return r.Ay.createElement(o.A,l({},u,{isSlim:!0,className:(0,n.A)(a&&"WGSZ8u75",c&&"CrEsDylb",u.className),contentClassName:(0,n.A)("FuFYE0AA",u.contentClassName),headerClassName:(0,n.A)("iEptOmIp",u.headerClassName)}),u.children,p&&r.Ay.createElement("div",{className:"HqeDTaSr"},r.Ay.createElement(i.A,{withPremiumGradient:d,onClick:m||u.onClose,color:"primary",size:"smaller",disabled:t},e||A("Confirm"))))}))},5463:(e,t,a)=>{a.d(t,{A:()=>m});var r=a(84051),n=a(87357),s=a(18276),i=a(64493),o=a(22720),l=a(8410),c=a(32581);const m=(0,r.ph)((({isOpen:e,listItemData:t,headerIconName:a,header:m,footer:d,buttonText:u,hasBackdrop:A,withSeparator:p,onClose:f,onButtonClick:y,contentClassName:h})=>r.Ay.createElement(l.A,{isOpen:e,className:(0,n.A)("LAh8evux",h),contentClassName:"hrizpMDe",hasAbsoluteCloseButton:!0,absoluteCloseButtonColor:A?"translucent-white":void 0,onClose:f},a&&r.Ay.createElement("div",{className:"jySLtQNG"},r.Ay.createElement(s.A,{name:a})),m,r.Ay.createElement("div",null,t?.map((([e,t,a])=>r.Ay.createElement(o.A,{isStatic:!0,multiline:!0,icon:e,iconClassName:"hQbEPsTU"},r.Ay.createElement("span",{className:"title"},t),r.Ay.createElement("span",{className:"subtitle"},a))))),p&&r.Ay.createElement(c.A,{className:"En1zD2cT"}),d,u&&r.Ay.createElement(i.A,{size:"smaller",onClick:y||f},u))))},70046:(e,t,a)=>{a.d(t,{A:()=>u});var r=a(84051),n=a(13439),s=a(87357),i=a(17712),o=a(21849),l=a(10187),c=a(64493),m=a(8410);const d="Cnh5ENvm",u=(0,r.ph)((({isOpen:e,title:t,tableData:a,headerAvatarPeer:u,header:A,modalHeader:p,footer:f,buttonText:y,className:h,hasBackdrop:g,onClose:E,onButtonClick:S})=>{const{openChat:v}=(0,n.ko)(),b=(0,i.A)((e=>{v({id:e}),E()}));return r.Ay.createElement(m.A,{isOpen:e,hasCloseButton:Boolean(t),hasAbsoluteCloseButton:!t,absoluteCloseButtonColor:g?"translucent-white":void 0,isSlim:!0,header:p,title:t,className:h,contentClassName:"KYHkJ9Qf",onClose:E},u&&r.Ay.createElement(o.A,{peer:u,size:"jumbo",className:"SHQbPR5Y"}),A,r.Ay.createElement("div",{className:"DFRB0Ad4"},a?.map((([e,t])=>r.Ay.createElement(r.Ay.Fragment,null,e&&r.Ay.createElement("div",{className:(0,s.A)(d,"AwnUe4Qk")},e),r.Ay.createElement("div",{className:(0,s.A)(d,"JGH6P9Az",!e&&"UssCZwgy")},"object"==typeof t&&"chatId"in t?r.Ay.createElement(l.A,{peerId:t.chatId,className:"aS9U4hiQ",forceShowSelf:!0,withEmojiStatus:t.withEmojiStatus,clickArg:t.chatId,onClick:b}):t))))),f,y&&r.Ay.createElement(c.A,{className:f?void 0:"cSamlkt9",size:"smaller",onClick:S||E},y))}))},1526:(e,t,a)=>{a.d(t,{A:()=>f});var r=a(84051),n=a(87357),s=a(17142),i=a(14242),o=a(4961),l=a(37661),c=a(39351),m=a(59030),d=a(18276),u=a(9267),A=a(64493);const p={options:"OnCj9kef",option:"tpTHQAUF",active:"U_9MXPG5",wideOption:"dJcJl33b",optionTop:"x9G4lqMf",stackedStars:"etXLebjM",stackedStar:"swttXv9P",optionBottom:"tK7La7L2",moreOptions:"AWXBaWLW",iconDown:"zWYHZJmd"},f=(0,r.ph)((({isActive:e,className:t,options:a,selectedStarOption:f,selectedStarCount:y,starsNeeded:h,onClick:g})=>{const E=(0,m.A)(),S=(0,c.A)(),[v,b,N]=(0,l.A)();(0,r.vJ)((()=>{e||N()}),[e]);const[C,k]=(0,r.Kr)((()=>{if(!a)return[void 0,!1];const e=a.reduce(((e,t)=>e.stars>t.stars?e:t)),t=h&&e.stars<h,r=[];let n=0,s=!1;return a.forEach(((e,i)=>{e.isExtended||n++,h&&!t&&e.stars<h||(v||!e.isExtended?r.push({option:e,starsCount:Math.min(n,6),isWide:i===a.length-1}):s=!0)})),[r,s]}),[v,a,h]);return r.Ay.createElement("div",{className:(0,n.A)(p.options,t)},C?.map((({option:e,starsCount:t,isWide:a})=>{const l=C?.length,c=l%2==0,m=e===f;let d;if(e&&"winners"in e){const t=e.winners.find((e=>e.users===y))||e.winners.reduce(((e,t)=>t.users>e.users?t:e),e.winners[0]);d=t?.perUserStars}return r.Ay.createElement("div",{className:(0,n.A)(p.option,!c&&a&&p.wideOption,m&&p.active),key:e.stars,onClick:()=>g?.(e)},r.Ay.createElement("div",{className:p.optionTop},"+",(0,i.Sm)(e.stars),r.Ay.createElement("div",{className:p.stackedStars,dir:S.isRtl?"ltr":"rtl"},Array.from({length:t}).map((()=>r.Ay.createElement(u.A,{className:p.stackedStar,type:"gold",size:"big"}))))),r.Ay.createElement("div",{className:p.optionBottom},(0,s.v)(S,e.amount,e.currency)),(m||f&&"winners"in f)&&d&&r.Ay.createElement("div",{className:p.optionBottom},r.Ay.createElement("div",{className:p.perUserStars},(0,o.A)(E("BoostGift.Stars.PerUser",(0,i.Sm)(d))))))})),!v&&k&&r.Ay.createElement(A.A,{className:p.moreOptions,isText:!0,noForcedUpperCase:!0,onClick:b},E("Stars.Purchase.ShowMore"),r.Ay.createElement(d.A,{className:p.iconDown,name:"down"})))}))}}]);
|
|
//# sourceMappingURL=6930.3600a6e84a9ffd66bd02.js.map
|