2 lines
72 KiB
JavaScript
2 lines
72 KiB
JavaScript
"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[6930],{59585:(e,t,a)=>{a.r(t),a.d(t,{GiftInfoModal:()=>ht,GiftModal:()=>mt,GiftRecipientPicker:()=>dt,GiftStatusInfoModal:()=>Ct,GiftTransferModal:()=>qt,GiftUpgradeModal:()=>bt,GiftWithdrawModal:()=>Tt,PaidReactionModal:()=>ze,StarPaymentModal:()=>ue,StarsBalanceModal:()=>oe,StarsGiftModal:()=>b,StarsGiftingPickerModal:()=>w,StarsSubscriptionModal:()=>be,StarsTransactionInfoModal:()=>Se});var r=a(84051),n=a(13439),s=a(90709),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)((0,n.mS)(),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),I=(0,m.A)(e),k=(0,u.A)(),[G,P]=(0,r.J0)(),[w,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)((()=>{I?.isCompleted&&T()}),[I,T]);const M=(0,d.A)((e=>{I&&(P(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=k("lng_credits_summary_options_about").split("{link}");return[e[0],r.Ay.createElement(f.A,{url:k("StarsTOSLink"),text:k("lng_credits_summary_options_about_link")}),e[1]]}),[k]);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:k("Close")},r.Ay.createElement(p.A,{name:"close"})),r.Ay.createElement("div",{className:(0,o.A)(E.header,w&&E.hiddenHeader)},r.Ay.createElement("h2",{className:E.starHeaderText},k(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)},I?.isCompleted?t?(0,c.A)(k("Notification.StarsGift.SentYou",(0,l.A)(G.amount,G.currency,k.code)),["simple_markdown"]):(0,c.A)(k("StarsAcquiredInfo",G?.stars),["simple_markdown"]):k(t?"GiftStarsTitle":"Star.List.GetStars")),r.Ay.createElement("p",{className:E.description},t?(0,c.A)(k("ActionGiftStarsSubtitle",(0,s.F9)(k,t)),["simple_markdown"]):k("Stars.Purchase.GetStarsInfo")),r.Ay.createElement("div",{className:E.section},r.Ay.createElement(g.A,{options:I?.starsGiftOptions,onClick:M}),r.Ay.createElement("div",{className:E.secondaryInfo},U))))})));var N=a(31481),C=a(70636),I=a(87894),k=a(79582),G=a(54960),P=a(34642);const w=(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,I.Am)([...o||[],...a||[],...i||[]]),l=(0,C.PU)({ids:r,query:A,type:"user"});return(0,k.A)(l.filter((a=>{const r=e[a];return!(!r||r.isSupport||(0,s.tv)(r)||(0,s.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(P.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),O=a(81949),R=a(9267);const K={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"},L=(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)(K.balanceBlock,t)},r.Ay.createElement("div",{className:K.balanceInfo},r.Ay.createElement("span",{className:K.smallerText},s("StarsBalance")),r.Ay.createElement("div",{className:K.balanceBottom},r.Ay.createElement(R.A,{type:"gold",size:"middle"}),void 0!==e?(0,D.ZF)(s,e):"…",a&&r.Ay.createElement(O.A,{className:K.addStarsButton,onClick:()=>i({})},r.Ay.createElement(p.A,{className:K.addStarsIcon,name:"add"})))))}));var F=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,F.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(R.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(R.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 _(e,t){if(t.starRefCommision)return e("StarTransactionCommission",(0,z.l9)(t.starRefCommision));if(t.isGiftUpgrade)return e("Gift2TransactionUpgraded");if(t.extendedMedia)return e("StarMediaPurchase");if(t.subscriptionPeriod)return t.title||e("StarSubscriptionPurchase");if(t.isReaction)return e("StarsReactionsSent");if(t.giveawayPostId)return e("StarsGiveawayPrizeReceived");if(t.isMyGift)return e("StarsGiftSent");if(t.isGift)return e("StarsGiftReceived");if(t.starGift)return W(t.stars)?e("Gift2TransactionSent"):e("Gift2ConvertedTitle");const a=t.peer&&"peer"!==t.peer.type&&(0,D.Pc)(t.peer)||void 0;return a?a.title||e(a.titleKey):t.title}function W(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,i=(0,s.VO)(n,"pictogram"),l=(0,s.VD)(n),c=(0,Y.A)(i);return r.Ay.createElement("div",{className:(0,o.A)($.thumb,void 0!==t&&`stars-transaction-media-${t}`,a)},l&&r.Ay.createElement("img",{className:$.blurry,src:l,alt:""}),c&&r.Ay.createElement("img",{className:$.full,src:c,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),I=(0,r.Kr)((()=>{let t,a,r,n=_(E,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,v,e]),k=(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:I.avatarPeer}),Boolean(h)&&r.Ay.createElement(R.A,{className:ae.subscriptionStar,type:"gold",size:"small"}))}),[N,y,p,I.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},k),r.Ay.createElement("div",{className:ae.info},r.Ay.createElement("h3",{className:ae.title},I.title),I.description&&r.Ay.createElement("p",{className:ae.description},(0,c.A)(I.description)),r.Ay.createElement("p",{className:ae.date},(0,F.L2)(1e3*l,E.code,!0),I.status&&` — (${I.status})`)),r.Ay.createElement("div",{className:ae.stars},r.Ay.createElement("span",{className:(0,o.A)(ae.amount,W(m)?ae.negative:ae.positive)},(0,D.hk)(g,m)),r.Ay.createElement(R.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:N}=(0,n.ko)(),{balance:C,history:I,subscriptions:k}=t||{},G=(0,u.A)(),P=(0,T.A)(),[w,D]=(0,r.J0)(!0),[O,R]=(0,r.J0)(0),[F,z,J]=(0,B.A)(),V=Boolean(e&&t),{originStarsPayment:q,originReaction:j,originGift:_,topup:W}=e||{},Q=q||j||_||W,X=q?.form?.invoice?.totalAmount||q?.subscriptionInfo?.subscriptionPricing?.amount||j?.amount||_?.gift.stars||W?.balanceNeeded,Y=X?X-(C?.amount||0):void 0,Z=(0,r.Kr)((()=>{const e=(0,n.mS)();if(j){const t=(0,i.hds)(e,j.chatId);if(!t)return;return G("StarsNeededTextReactions",(0,s.Js)(G,t))}if(q){const t=q.form?.botId?(0,i.mBe)(e,q.form.botId):void 0;if(!t)return;return G("StarsNeededText",(0,s.Yg)(t))}if(_){const t=(0,i.mBe)(e,_.peerId);if(!t)return;return G("StarsNeededTextGift",(0,s.F9)(P,t))}if("subs"===W?.purpose)return G("StarsNeededTextLink")}),[j,q,_,W?.purpose,P,G]),$=Boolean(I?.all?.transactions.length&&!Q),ee=!Q,te=(0,r.Kr)((()=>se.map((e=>({title:P(e)})))),[P]);(0,r.vJ)((()=>{V||(D(!0),R(0),J())}),[V]),(0,r.vJ)((()=>{Q?z():J()}),[Q]);const ae=(0,r.Kr)((()=>{if(!V)return;const e=G("lng_credits_summary_options_about").split("{link}");return[e[0],r.Ay.createElement(f.A,{url:G("StarsTOSLink"),text:G("lng_credits_summary_options_about_link")}),e[1]]}),[V,G]),oe=(0,d.A)((()=>{A({type:ne[O]})})),le=(0,d.A)((()=>{E()})),ce=(0,d.A)((()=>{b({})})),me=(0,d.A)((e=>{N({type:"stars",stars:e.stars,currency:e.currency,amount:e.amount})}));return r.Ay.createElement(h.A,{className:(0,o.A)(K.root,!l&&!F&&K.minimal),isOpen:V,onClose:m},r.Ay.createElement("div",{className:(0,o.A)(K.main,"custom-scroll"),onScroll:function(e){const{scrollTop:t}=e.currentTarget;D(t<=150)}},r.Ay.createElement(y.A,{round:!0,size:"smaller",className:K.closeButton,color:"translucent",onClick:()=>m(),ariaLabel:P("Close")},r.Ay.createElement(p.A,{name:"close"})),r.Ay.createElement(L,{balance:C,className:K.modalBalance}),r.Ay.createElement("div",{className:(0,o.A)(K.header,w&&K.hiddenHeader)},r.Ay.createElement("h2",{className:K.starHeaderText},G("TelegramStars"))),r.Ay.createElement("div",{className:K.section},r.Ay.createElement("img",{className:K.logo,src:S,alt:"",draggable:!1}),r.Ay.createElement("img",{className:K.logoBackground,src:v,alt:"",draggable:!1}),r.Ay.createElement("h2",{className:K.headerText},Y?G("StarsNeededTitle",X):G("TelegramStars")),r.Ay.createElement("div",{className:K.description},(0,c.A)(Z||G("TelegramStarsInfo"),["simple_markdown","emoji"])),a&&!F&&r.Ay.createElement(y.A,{className:K.starButton,onClick:z},G("Star.List.BuyMoreStars")),a&&!F&&ee&&r.Ay.createElement(y.A,{isText:!0,noForcedUpperCase:!0,className:K.starButton,onClick:ce},G("TelegramStarsGift")),F&&t?.topupOptions&&r.Ay.createElement(g.A,{starsNeeded:Y,options:t.topupOptions,onClick:me})),F&&r.Ay.createElement("div",{className:K.tos},ae),$&&Boolean(k?.list.length)&&r.Ay.createElement("div",{className:K.section},r.Ay.createElement("h3",{className:K.sectionTitle},G("StarMySubscriptions")),r.Ay.createElement("div",{className:K.subscriptions},k?.list.map((e=>r.Ay.createElement(H,{key:e.id,subscription:e}))),k?.nextOffset&&r.Ay.createElement(y.A,{isText:!0,disabled:k.isLoading,size:"smaller",noForcedUpperCase:!0,className:K.loadMore,onClick:le},r.Ay.createElement(p.A,{name:"down",className:K.loadMoreIcon}),G("StarMySubscriptionsExpand")))),$&&r.Ay.createElement("div",{className:K.container},r.Ay.createElement("div",{className:K.section},r.Ay.createElement(U.Ay,{name:P.isRtl?"slideOptimizedRtl":"slideOptimized",activeKey:O,renderCount:se.length,shouldRestoreHeight:!0,className:K.transition},r.Ay.createElement(M.A,{onLoadMore:oe,items:I?.[ne[O]]?.transactions,scrollContainerClosest:`.${K.main}`,itemSelector:`.${ie}`,className:K.transactions,noFastList:!0,noScrollRestoreOnTop:!0},I?.[ne[O]]?.transactions.map((e=>r.Ay.createElement(re,{key:`${e.id}-${e.isRefund}`,transaction:e,className:ie})))))),r.Ay.createElement(x.A,{className:K.tabs,tabClassName:K.tab,activeTab:O,tabs:te,onSwitchTab:R}))))})));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:i,paidMediaChat:l})=>{const{closeStarsPaymentModal:m,openStarsBalanceModal:p,sendStarPaymentForm:g}=(0,n.ko)(),[E,S,b]=(0,B.A)(),N=Boolean(e?.inputInvoice&&a),C=(0,ce.A)(e),I=e||C,{form:k,subscriptionInfo:G}=I||{},P=k?.invoice?.totalAmount||G?.subscriptionPricing?.amount,w=Boolean(k?.invoice.subscriptionPeriod),M=!G?.subscriptionPricing,x=k?.photo,U=(0,u.A)(),D=(0,T.A)();(0,r.vJ)((()=>{N||b()}),[N]);const O=(0,r.Kr)((()=>{if(!I?.inputInvoice)return"";const e=(0,s.Yg)(t),a=U("Stars.Intro.PurchasedText.Stars",P);if(i){const e=i.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,s.Js)(U,l);return U("Stars.Transfer.UnlockInfo",[n,o,a])}return G?D("StarsSubscribeText",{chat:G.title,amount:P},{withNodes:!0,withMarkdown:!0,pluralValue:P}):w?D("StarsSubscribeBotText",{name:k.title,amount:P,bot:e},{pluralValue:P}):U("Stars.Transfer.Info",[k.title,e,a])}),[I?.inputInvoice,t,U,P,i,G,w,k,l,D]),F=(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,s.nr)(G)}),[G]),V=(0,d.A)((()=>{const t=a?.balance;void 0!==P&&void 0!==t&&(P>t.amount?p({originStarsPayment:e}):(g({}),S()))}));return r.Ay.createElement(h.A,{contentClassName:K.paymentContent,isOpen:N,hasAbsoluteCloseButton:!0,isSlim:!0,onClose:m},r.Ay.createElement(L,{balance:a?.balance,className:K.modalBalance}),r.Ay.createElement("div",{className:K.paymentImages,dir:U.isRtl?"ltr":"rtl"},i?r.Ay.createElement(te,{media:i.content.paidMedia.extendedMedia}):J?r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement(A.A,{className:K.paymentPhoto,peer:J,size:"giant"}),r.Ay.createElement(R.A,{type:"gold",size:"adaptive",className:K.avatarStar})):r.Ay.createElement(me.A,{peer:x?void 0:t,avatarWebPhoto:x,avatarSize:"giant",badgeIcon:"star",badgeText:(0,z.Sm)(P),badgeClassName:K.amountBadge,className:K.paymentPhoto}),r.Ay.createElement("img",{className:K.paymentImageBackground,src:v,alt:"",draggable:!1})),r.Ay.createElement("h2",{className:K.headerText},U(J?"StarsSubscribeTitle":"StarsConfirmPurchaseTitle")),M&&r.Ay.createElement(de.A,{className:K.botItem,peerId:k?.botId}),r.Ay.createElement("div",{className:K.description},(0,c.A)(O,["simple_markdown","emoji"])),r.Ay.createElement(y.A,{className:K.paymentButton,size:"smaller",onClick:V,isLoading:E},D(w?"StarsSubscribeBotButtonMonth":"StarsPay",{amount:(0,le.U)(D,P,{asFont:!0})},{withNodes:!0})),F&&r.Ay.createElement("div",{className:(0,o.A)(K.disclaimer,K.smallerText)},F))})));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=(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=t?.transaction.stars,s=t?.transaction.isGift&&(0,i.WLj)(e,n?.amount);return{peer:r,canPlayAnimatedEmojis:(0,i.BWX)(e),topSticker:s}}))((({modal:e,peer:t,canPlayAnimatedEmojis:a,topSticker: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):i,N=S?(0,j.uc)(u):void 0,C=g.peer&&"peer"!==g.peer.type&&(0,D.Pc)(g.peer)||void 0,I="peer"===g.peer?.type?g.peer.id:void 0,k=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)),G=_(h,g),P=t&&g.messageId&&!m?(0,s.yt)(t,void 0,g.messageId):void 0,w=t&&e&&(0,s.yt)(t,void 0,e),B=g.extendedMedia,T=B?.length||0,M=B?.every((e=>!e.video)),x=B?.every((e=>!e.photo)),U=h(M?"Stars.Transfer.Photos":x?"Stars.Transfer.Videos":"Media",T),O=g.description||(m&&"starGiftUnique"===d?.type?d.title:void 0)||(B?U:void 0),K=!B&&!b,L=n?void 0:t||C,z=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})})),J=r.Ay.createElement("div",{className:ge},B&&r.Ay.createElement(te,{className:(0,o.A)("C5r59yiV","transaction-media-preview"),media:B,onClick:E}),!B&&b&&r.Ay.createElement(Q.A,{key:g.id,sticker:b,play:a,noLoop:!0}),K&&r.Ay.createElement(A.A,{peer:L,webPhoto:n,size:"giant"}),!b&&r.Ay.createElement("img",{className:(0,o.A)("nML8IQqX"),src:v,alt:"",draggable:!1}),G&&r.Ay.createElement("h1",{className:"ZZAj3hj7"},G),r.Ay.createElement("p",{className:"NuWOY7ED"},O),r.Ay.createElement("p",{className:Ee},r.Ay.createElement("span",{className:(0,o.A)(Ee,W(c)?"xDyq9cc0":"jvBZSrpd")},(0,D.hk)(y,c)),r.Ay.createElement(R.A,{type:"gold",size:"middle"}))),V=[];let H;g.starRefCommision&&V.push([h("StarsTransaction.StarRefReason.Title"),h("StarsTransaction.StarRefReason.Program")]),m&&V.push([h("StarGiftReason"),h("StarGiftReasonUpgrade")]),H=m?h("Stars.Transaction.GiftFrom"):W(c)||g.isMyGift?h("Stars.Transaction.To"):g.starRefCommision?h("StarsTransaction.StarRefReason.Miniapp"):h(I?"Star.Transaction.From":"Stars.Transaction.Via"),V.push([H,I?{chatId:I}:k||""]),P&&V.push([h("Stars.Transaction.Reaction.Post"),r.Ay.createElement(f.A,{url:P,text:P})]),w&&(V.push([h("BoostReason"),r.Ay.createElement(f.A,{url:w,text:h("Giveaway")})]),V.push([h("Gift"),h("Stars",g.stars,"i")])),g.id&&V.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"}))]),V.push([h("Stars.Transaction.Date"),(0,F.L2)(1e3*g.date,h.code,!0)]);const q=h("lng_credits_box_out_about").split("{link}");return{header:S?z:J,tableData:V,footer:r.Ay.createElement("span",{className:"KgzPpgS6"},q[0],r.Ay.createElement(f.A,{url:h("StarsTOSLink"),text:h("lng_credits_summary_options_about_link")}),q[1])}}),[g,h,y,t,a,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})}))),ve="oBLHWBtJ",be=(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:s,changeStarsSubscription:i,checkChatInvite:l,loadStarStatus:c,openInvoice:m}=(0,n.ko)(),p=(0,u.A)(),h=(0,T.A)(),{subscription:g}=e||{},E=(0,r.Kr)((()=>{if(!g)return"hidden";if(g.canRefulfill)return"refulfill";const e=g.until>Date.now()/1e3;if(e&&!g.isCancelled)return"cancel";if(e&&g.isCancelled)return"renew";const t=g.chatInviteHash||g.invoiceSlug;return!e&&t?"restart":"ok"}),[g]),S=(0,d.A)((()=>{if(g){switch(E){case"refulfill":s({id:g.id});break;case"restart":g.chatInviteHash?l({hash:g.chatInviteHash}):g.invoiceSlug&&m({type:"slug",slug:g.invoiceSlug}),c();break;case"renew":i({id:g.id,isCancelled:!1});break;case"cancel":i({id:g.id,isCancelled:!0})}a()}})),b=(0,r.Kr)((()=>{if(!g||!t)return;const{pricing:e,until:a,isCancelled:n,canRefulfill:s,photo:i,title:l,hasBotCancelled:c}=g,m=(0,C.mO)(t),d=r.Ay.createElement("div",{className:"E3R22yAI"},r.Ay.createElement("div",{className:"wuTMXDP9"},r.Ay.createElement(A.A,{peer:i?void 0:t,webPhoto:i,size:"giant"}),r.Ay.createElement(R.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"},l||p("StarsSubscriptionTitle")),r.Ay.createElement("p",{className:"FI6rEJlK"},h("StarsPerMonth",{amount:e.amount},{withNodes:!0,specialReplacement:{[N.Cyx]:r.Ay.createElement(R.A,{className:"J8HIcN6k",size:"adaptive",type:"gold"})}}))),u=[];u.push([p(m?"StarsSubscriptionBot":"StarsSubscriptionChannel"),{chatId:t.id}]),l&&u.push([p("StarsSubscriptionBotProduct"),l]);const b=a<Date.now()/1e3;u.push([p(b?"StarsSubscriptionUntilExpired":n?"StarsSubscriptionUntilExpires":"StarsSubscriptionUntilRenews"),(0,F.L2)(1e3*a,p.code,!0)]);const I=h("StarsTransactionTOS",{link:r.Ay.createElement(f.A,{url:h("StarsTransactionTOSLink"),text:h("StarsTransactionTOSLinkText")})},{withNodes:!0});return{header:d,tableData:u,footer:r.Ay.createElement("span",{className:"GMWMuWCr"},r.Ay.createElement("p",{className:ve},I),n&&r.Ay.createElement("p",{className:"nkwiG25Q"},p(c?"StarsSubscriptionBotCancelledText":"StarsSubscriptionCancelledText")),s&&r.Ay.createElement("p",{className:ve},p("StarsSubscriptionRefulfillInfo",(0,F.L2)(1e3*a,p.code,!0))),!n&&!s&&b&&r.Ay.createElement("p",{className:ve},p("StarsSubscriptionExpiredInfo",(0,F.L2)(1e3*a,p.code,!0))),!n&&!s&&!b&&r.Ay.createElement("p",{className:ve},p("StarsSubscriptionCancelInfo",(0,F.L2)(1e3*a,p.code,!0))),"hidden"!==E&&r.Ay.createElement(y.A,{size:"smaller",color:"cancel"===E?"danger":"primary",isText:"cancel"===E,onClick:S},p("cancel"===E?"StarsSubscriptionCancel":"refulfill"===E?"StarsSubscriptionRefulfill":"restart"===E?"StarsSubscriptionAgain":"renew"===E?"StarsSubscriptionRenew":"OK")))}}),[E,h,p,t,g]),I=(0,ce.A)(b)||b;return r.Ay.createElement(fe.A,{isOpen:Boolean(g),className:"eR_RZfGB",header:I?.header,tableData:I?.tableData,footer:I?.footer,onClose:a})})));var Ne=a(43874),Ce=a(34431),Ie=a(19806),ke=a(22699),Ge=a(24433),Pe=a(32581),we=a(66644),Be=a(15283),Te=a(93545),Me=a(68292),xe=a(85118);const Ue={root:"CuBAw2yg",slider:"euOOAbZi",sparkles:"_L1YQTIP",progress:"kwK0cNPX",floatingBadgeWrapper:"uvlMoXj0",floatingBadge:"BGSDWAYc",floatingBadgeText:"qqQan8uF",floatingBadgeTriangle:"mIdJOmsB"},De=[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 Re(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 Ke=(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<De.length;a++)if(De[a]<e&&t.push(De[a]),De[a]>=e){t.push(e);break}return t}),[e]),[l,c]=(0,r.J0)(0);(0,Be.A)((()=>{c(Oe(i,t))}));const m=(0,d.A)((()=>{const e=s.current;if(!e)return;const t=e.parentElement;(0,we.YS)((()=>{const a=t.offsetLeft+e.offsetWidth/2,r=t.offsetLeft+t.offsetWidth-e.offsetWidth/2;(0,we.RK)((()=>{t.style.setProperty("--_min-x",`${a}px`),t.style.setProperty("--_max-x",`${r}px`)}))}))}));(0,Te.A)(s,m);const u=(0,d.A)((e=>{const t=Number(e.currentTarget.value);c(t),n(Re(i,t))}));return r.Ay.createElement("div",{className:(0,o.A)(Ue.root,a),style:"--progress: "+l/i.length},r.Ay.createElement("div",{className:Ue.floatingBadgeWrapper},r.Ay.createElement("div",{className:Ue.floatingBadge,ref:s},r.Ay.createElement("div",{className:Ue.floatingBadgeText},r.Ay.createElement(p.A,{name:"star",className:Ue.floatingBadgeIcon}),r.Ay.createElement(Me.A,{text:(0,z.Sm)(Re(i,l))})),r.Ay.createElement("svg",{className:Ue.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:Ue.progress},r.Ay.createElement(xe.A,{preset:"progress",className:Ue.sparkles})),r.Ay.createElement("input",{className:Ue.slider,type:"range",min:0,max:i.length,defaultValue:Oe(i,t),step:"any",onChange:u}))})),Le={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"},Fe={avatarIcon:"author-hidden",customPeerAvatarColor:"#9eaab5",isCustomPeer:!0,titleKey:"StarsReactionAnonymous"},ze=(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:I,loadSendPaidReactionsAs:k}=(0,n.ko)(),[G,P]=(0,r.J0)(50),[w,M,x]=(0,B.A)(),[U,D]=(0,r.J0)(!0),[O,R]=(0,r.J0)(S),K=t?.id,F=O?(0,i.PVB)((0,n.mS)(),O):v,J=(0,u.A)(),{isMobile:V}=(0,Ne.Ay)(),H=(0,T.A)(),q=(0,d.A)((e=>{D(!e.target.checked)})),j=(0,d.A)((e=>{P(e),M()}));(0,r.vJ)((()=>{K&&!E&&k({chatId:K})}),[K,E]);const _=(0,r.Kr)((()=>{const e=E?.map((e=>e.id)).filter((e=>e!==K));return e?.unshift(S),e}),[E,K,S]),W=_&&_.length>1;(0,r.vJ)((()=>{e||x()}),[e]),(0,r.vJ)((()=>{const e=a?.reactions?.topReactors?.find((e=>e.isMy));if(e)return D(Boolean(e.isAnonymous)),void(e.peerId&&R(e.peerId));D("anonymous"===g?.type||!1),"peer"===g?.type&&_?.includes(g.peerId)?R(g.peerId):R(S)}),[g,a?.reactions?.topReactors,_,S]);const Q=(0,d.A)((()=>{e&&(I({chatId:e.chatId,messageId:e.messageId,count:G,isPrivate:U,peerId:U||O===S?void 0:O,shouldIgnoreDefaultPrivacy:!0}),b())})),X=(0,d.A)((e=>{D(!1),R(e)})),Y=(0,d.A)((e=>{const t=(0,i.PVB)((0,n.mS)(),e),a=O===e&&!U;if(t)return r.Ay.createElement(Ge.A,{onClick:()=>X(e)},r.Ay.createElement(A.A,{size:"small",peer:t}),r.Ay.createElement("div",{className:(0,o.A)(Le.itemInfo)},r.Ay.createElement(Ce.A,{className:Le.itemTitle,peer:t,noFake:!0,noVerified:!0}),r.Ay.createElement("span",{className:Le.itemSubtitle},(0,C.mO)(t)?H("PeerPersonalAccount"):H("PeerChannel"))),r.Ay.createElement(p.A,{className:Le.itemIcon,name:a?"check":"placeholder"}))})),Z=(0,r.Kr)((()=>({onTrigger:e,isOpen:t})=>r.Ay.createElement(y.A,{ripple:!V,size:"smaller",color:"translucent",className:(0,o.A)(Le.sendAsPeerMenuButton,t?"active":""),onClick:e,ariaLabel:H("AccDescrOpenMenu2")},r.Ay.createElement(A.A,{className:Le.sendAsPeerButtonAvatar,size:"mini",peer:U?Fe:F}),r.Ay.createElement(p.A,{name:"down",className:Le.buttonDownIcon}))),[V,H,F,U]),$=(0,r.Kr)((()=>{if(W)return r.Ay.createElement(ke.A,{className:(0,o.A)(Le.sendAsPeerMenu,"with-menu-transitions"),bubbleClassName:Le.sendAsPeerMenuBubble,trigger:Z,positionX:"right",autoClose:!0},_.map((e=>Y(e))))}),[Z,_,W]),ee=(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!==O||t.isAnonymous&&!U))return;const n=O===t.peerId||U&&t.isAnonymous;n&&(s=!0),r.push({amount:t.count,localAmount:n&&w?G:0,isMy:t.isMy,isAnonymous:t.isAnonymous,user:a})})),!s){const t=(0,i.PVB)(e,O);r.push({amount:o,localAmount:w?G: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,G,O,U]),te=t&&(0,s.F9)(J,t);return r.Ay.createElement(h.A,{isOpen:Boolean(e),onClose:b,isSlim:!0,hasAbsoluteCloseButton:!0,contentClassName:Le.content,isLowStackPriority:!0},r.Ay.createElement("div",{className:Le.sendAsPeersMenuContainer},$),r.Ay.createElement("div",{className:Le.headerControlPanel},r.Ay.createElement(L,{balance:m,className:Le.modalBalance,withAddButton:!0})),r.Ay.createElement(Ke,{className:Le.slider,defaultValue:50,maxValue:l,onChange:j}),r.Ay.createElement("h3",{className:Le.title},J("StarsReactionTitle")),r.Ay.createElement("div",{className:Le.description},(0,c.A)(J("StarsReactionText",te),["simple_markdown","emoji"])),r.Ay.createElement(Pe.A,null,ee&&r.Ay.createElement("div",{className:Le.topLabel},J("StarsReactionTopSenders"))),ee&&r.Ay.createElement("div",{className:Le.top},ee.map((e=>{const t=(0,z.Sm)(e.amount+e.localAmount),a=e.isAnonymous||!e.user||e.isMy&&U?Fe:e.user,n="isCustomPeer"in a?J(a.titleKey):a&&(0,s.F9)(J,a);return r.Ay.createElement(me.A,{className:Le.topPeer,key:`${e.user?.id||"anonymous"}-${t}`,peer:a,badgeText:t,badgeIcon:"star",badgeClassName:Le.topBadge,text:n})}))),ee&&r.Ay.createElement(Pe.A,{className:Le.separator}),r.Ay.createElement(Ie.A,{className:(0,o.A)(Le.checkBox,"dialog-checkbox"),checked:!U,onChange:q,label:J("StarsReactionShowMeInTopSenders")}),r.Ay.createElement(y.A,{size:"smaller",onClick:Q},H("SendPaidReaction",{amount:G},{withNodes:!0,specialReplacement:{[N.Cyx]:r.Ay.createElement(p.A,{className:Le.buttonStar,name:"star"})}})),r.Ay.createElement("p",{className:Le.disclaimer},H("StarsReactionTerms",{link:r.Ay.createElement(f.A,{text:H("StarsReactionLinkText"),url:H("StarsReactionLink")})},{withNodes:!0})))})));var Je=a(37836),Ve=a(5912),He=a(23174),qe=a(65632),je=a(20333),_e=a(88668),We=a(96530),Qe=a(22720),Xe=a(63152),Ye=a(94079);const Ze="zZUpGRSI",$e="nTPAv1ci",et=(0,r.ph)((0,n.EK)(((e,{peerId:t})=>{const a=(0,i.SJA)(e),{isBlurred:r,patternColor:n,background:s,backgroundColor:o}=e.settings.themes[a]||{},l=(0,i.PVB)(e,t),c=(0,i.nTw)(e);return{peer:l,theme:a,isBackgroundBlurred:r,patternColor:n,customBackground:s,backgroundColor:o,captionLimit:e.appConfig?.starGiftMaxMessageLength,currentUserId:e.currentUserId,isPaymentFormLoading:c.isPaymentFormLoading}}))((function({gift:e,peerId:t,peer:a,captionLimit:i,theme:c,isBackgroundBlurred:m,patternColor:u,backgroundColor:A,customBackground:p,currentUserId:f,isPaymentFormLoading:h}){const{sendStarGift:g,openInvoice:E,openGiftUpgradeModal:S}=(0,n.ko)(),v=(0,T.A)(),[b,N]=(0,r.J0)(""),[I,k]=(0,r.J0)(!1),[G,P]=(0,r.J0)(!1),w=(0,qe.A)(c,p),B="id"in e,M=a&&(0,C.mO)(a),x=t===f,U=(0,r.Kr)((()=>B?{id:-1,chatId:"0",isOutgoing:!1,senderId:f,date:Math.floor(Date.now()/1e3),content:{action:{mediaType:"action",type:"starGift",message:b?.length?{text:b}:void 0,isNameHidden:I||void 0,starsToConvert:e.starsToConvert,canUpgrade:G||void 0,alreadyPaidUpgradeStars:G?e.upgradeStars:void 0,gift:e,peerId:t,fromId:f}}}:{id:-1,chatId:"0",isOutgoing:!1,senderId:f,date:Math.floor(Date.now()/1e3),content:{action:{mediaType:"action",type:"giftPremium",currency:e.currency,amount:e.amount,months:e.months,message:b?{text:b}:void 0}}}),[f,e,b,B,I,G,t]),D=(0,d.A)((e=>{N(e.target.value)})),O=(0,d.A)((()=>{k(!I)})),R=(0,d.A)((()=>{P(!G)})),K=(0,d.A)((()=>{B&&S({giftId:e.id,peerId:t})})),L=(0,d.A)((()=>{B?g({peerId:t,shouldHideName:I,gift:e,message:b?{text:b}:void 0,shouldUpgrade:G}):E({type:"giftcode",userIds:[t],currency:e.currency,amount:e.amount,option:e,message:b?{text:b}:void 0})})),F=(0,o.A)("ZORVRSG3","soDpW2YR",p&&"Eny_G3JI",A&&"TkJZPU2u",p&&m&&"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: ${u}`,A&&`--theme-background-color: ${A}`)},r.Ay.createElement("div",{className:F,style:w?`--custom-background: ${w}`:void 0}),r.Ay.createElement(_e.A,{key:B?e.id:e.months,message:U,threadId:He.l3,appearanceOrder:0})),function(){const t=i?i-b.length:void 0,n=(0,s.F9)(v,a);return r.Ay.createElement("div",{className:"Y68CEIKn"},r.Ay.createElement(Ye.A,{className:"o5r2IPoA",onChange:D,value:b,label:v("GiftMessagePlaceholder"),maxLength:i,maxLengthIndicator:t&&t<50?t.toString():void 0}),B&&e.upgradeStars&&r.Ay.createElement(Qe.A,{className:Ze,narrow:!0,ripple:!0,onClick:R},r.Ay.createElement("span",null,v("GiftMakeUnique",{stars:(0,le.U)(v,e.upgradeStars,{className:"zAee80Dv"})},{withNodes:!0})),r.Ay.createElement(Xe.A,{checked:G,onChange:R,label:v("GiftMakeUniqueAcc")})),B&&e.upgradeStars&&r.Ay.createElement("div",{className:$e},M?v("GiftMakeUniqueDescription",{user:n,link:r.Ay.createElement(We.A,{isPrimary:!0,onClick:K},v("GiftMakeUniqueLink"))},{withNodes:!0}):v("GiftMakeUniqueDescriptionChannel",{peer:n,link:r.Ay.createElement(We.A,{isPrimary:!0,onClick:K},v("GiftMakeUniqueLink"))},{withNodes:!0})),B&&r.Ay.createElement(Qe.A,{className:Ze,narrow:!0,ripple:!0,onClick:O},r.Ay.createElement("span",null,v("GiftHideMyName")),r.Ay.createElement(Xe.A,{checked:I,onChange:O,label:v("GiftHideMyName")})),B&&r.Ay.createElement("div",{className:$e},x?v("GiftHideNameDescriptionSelf"):M?v("GiftHideNameDescription",{receiver:n}):v("GiftHideNameDescriptionChannel")))}(),r.Ay.createElement("div",{className:"ATowWJ60"}),function(){const t=B?(0,le.U)(v,e.stars+(G?e.upgradeStars:0),{asFont:!0}):(0,l.v)(v,e.amount,e.currency);return r.Ay.createElement("div",{className:"jxWZSvet"},B&&e.availabilityRemains&&r.Ay.createElement(je.A,{isPrimary:!0,progress:e.availabilityRemains/e.availabilityTotal,rightText:v("GiftSoldCount",{count:e.availabilityTotal-e.availabilityRemains}),leftText:v("GiftLeftCount",{count:e.availabilityRemains}),className:"mWzLu0c0"}),r.Ay.createElement(y.A,{className:"IDuhjrne",size:"smaller",onClick:L,isLoading:h},v("GiftSend",{amount:t},{withNodes:!0})))}())})));var tt=a(87049);const at="G1mBmzxs",rt="a8no5WH0",nt=(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,onClick:s}){const{months:i,amount:o,currency:c}=n,m=(0,T.A)(),u=(0,d.A)((()=>{s(n)})),A=Math.floor(o/i),p=a&&a>A?Math.ceil(100-A/(a/100)):void 0;return r.Ay.createElement("div",{className:at,tabIndex:0,role:"button",onClick:u},r.Ay.createElement(Q.A,{sticker:e,play:t,noLoop:!0,nonInteractive:!0,size:86}),function(){const e=12===i?m("Years",{count:1},{pluralValue:1}):m("Months",{count:i},{pluralValue:i});return r.Ay.createElement("div",{className:"rn9aWFNA"},e)}(),r.Ay.createElement("div",{className:"q4_ydkAx"},m("PremiumGiftDescription")),r.Ay.createElement(y.A,{className:rt,nonInteractive:!0,size:"tiny",pill:!0,fluid:!0},(0,l.A)(o,c)),Boolean(p)&&r.Ay.createElement(tt.A,{color:"red",text:m("GiftDiscount",{percent:p})}))}))),st=(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,Ve.mv)(i,t,(e=>{e.isIntersecting&&m()})),r.Ay.createElement("div",{ref:i,className:(0,o.A)(at,"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:rt,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(tt.A,{color:"blue",text:l("GiftLimited")}),f&&r.Ay.createElement(tt.A,{color:"red",text:l("GiftSoldOut")}))}));var it=a(36838);const ot=(0,r.ph)((0,n.EK)((e=>{const{starGifts:t}=e;return{idsByCategory:t?.idsByCategory}}))((({idsByCategory:e,onCategoryChanged:t})=>{const a=(0,r.li)(null),n=(0,T.A)(),s=(0,r.Kr)((()=>e&&Object.keys(e).filter((e=>"all"!==e&&"limited"!==e)).map(Number).sort(((e,t)=>e-t))),[e]),[i,l]=(0,r.J0)("all");function c(e){return r.Ay.createElement("div",{className:(0,o.A)("dO7FKYY4",i===e&&"B2lEJk1v"),onClick:()=>function(e){l(e),t(e)}(e)},Number.isInteger(e)&&r.Ay.createElement(R.A,{className:"Pb7AU805",type:"gold",size:"middle"}),function(e){return"all"===e?n("AllGiftsCategory"):"stock"===e?n("StockGiftsCategory"):"limited"===e?n("LimitedGiftsCategory"):e}(e))}return(0,it.A)(a,void 0,!0),r.Ay.createElement("div",{ref:a,className:(0,o.A)("cUjwvN00","no-scrollbar")},c("all"),c("limited"),c("stock"),s?.map(c))}))),lt={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"},ct=(0,Je.nF)((e=>e()),200,!0),mt=(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);return{boostPerSentGift:e.appConfig?.boostsPerSentGift,starGiftsById:a?.byId,starGiftIdsByCategory:a?.idsByCategory,starBalance:r?.balance,peer:s,isSelf:o}}))((({modal:e,starGiftsById:t,starGiftIdsByCategory:a,starBalance:i,peer:l,isSelf:c})=>{const{closeGiftModal:p}=(0,n.ko)(),g=(0,r.li)(null),E=(0,r.li)(null),S=(0,r.li)(null),b=(0,r.li)(null),N=Boolean(e),I=(0,m.A)(e),k=l&&(0,C.mO)(l)?l:void 0,G=l&&(0,C.vj)(l)?l:void 0,[P,w]=(0,r.J0)(),[B,M]=(0,r.J0)(!1),[x,D]=(0,r.J0)(!1),[O,R]=(0,r.J0)(!1),[K,F]=(0,r.J0)("all"),z=(0,u.A)(),J=(0,T.A)(),V=(0,r.Kr)((()=>I?.gifts?.sort(((e,t)=>e.months-t.months)).filter((e=>1===e.users))),[I]),H=(0,r.Kr)((()=>V?.reduce(((e,t)=>e.amount<t.amount?e:t))),[V]),{observe:q}=(0,Ve.BL)({rootRef:b,throttleMs:200,isDisabled:!N}),j=Boolean(P),_=j||B,W=j?O:x;(0,r.vJ)((()=>{N||(M(!1),w(void 0),F("all"))}),[N]);const Q=(0,d.A)((e=>{if(j)return;const t=e.currentTarget;ct((()=>{const{scrollTop:e}=t;if(M(e>150),E.current&&S.current){const{top:e}=S.current.getBoundingClientRect(),{top:t}=E.current.getBoundingClientRect();D(e-t<=0)}}))})),X=J("GiftPremiumDescription",{user:(0,s.Yg)(k),link:r.Ay.createElement(f.A,{text:J("GiftPremiumDescriptionLinkCaption"),url:J("GiftPremiumDescriptionLink")})},{withNodes:!0}),Y=G?J("StarGiftDescriptionChannel",{peer:(0,s.F9)(J,G)},{withNodes:!0,withMarkdown:!0}):c?J("StarGiftDescriptionSelf",void 0,{withNodes:!0,renderTextFilters:["br"]}):J("StarGiftDescription",{user:(0,s.Yg)(k)},{withNodes:!0,withMarkdown:!0}),Z=(0,d.A)((e=>{w(e),R("id"in e)})),$=(0,d.A)((e=>{F(e)})),ee=(0,d.A)((()=>{j?w(void 0):p()})),te=j,ae=(0,o.A)("animated-close-icon",te&&"state-back");return r.Ay.createElement(h.A,{dialogRef:g,onClose:p,isOpen:N,isSlim:!0,contentClassName:lt.content,className:(0,o.A)(lt.modalDialog,lt.root),isLowStackPriority:!0},r.Ay.createElement(y.A,{className:lt.closeButton,round:!0,color:"translucent",size:"smaller",onClick:ee,ariaLabel:z(te?"Common.Back":"Common.Close")},r.Ay.createElement("div",{className:ae})),r.Ay.createElement(L,{className:lt.balance,balance:i,withAddButton:!0}),r.Ay.createElement("div",{className:(0,o.A)(lt.header,!_&<.hiddenHeader)},r.Ay.createElement(U.Ay,{name:"slideVerticalFade",activeKey:Number(W),slideClassName:lt.headerSlide},r.Ay.createElement("h2",{className:lt.commonHeaderText},J(W?c?"StarsGiftHeaderSelf":"StarsGiftHeader":"GiftPremiumHeader")))),r.Ay.createElement(U.Ay,{ref:E,className:lt.transition,name:"pushSlide",activeKey:j?1:0},!j&&r.Ay.createElement("div",{ref:b,className:(0,o.A)(lt.main,"custom-scroll"),onScroll:Q},r.Ay.createElement("div",{className:lt.avatars},r.Ay.createElement(A.A,{size:100,peer:l}),r.Ay.createElement("img",{className:lt.logoBackground,src:v,alt:"",draggable:!1})),!c&&!G&&r.Ay.createElement("h2",{className:(0,o.A)(lt.headerText,lt.center)},J("GiftPremiumHeader")),!c&&!G&&r.Ay.createElement("p",{className:(0,o.A)(lt.description,lt.center)},X),!c&&!G&&r.Ay.createElement("div",{className:lt.premiumGiftsGallery},V?.map((e=>r.Ay.createElement(nt,{option:e,baseMonthAmount:H?Math.floor(H.amount/H.months):void 0,onClick:Z})))),r.Ay.createElement("h2",{ref:S,className:(0,o.A)(lt.headerText,lt.center)},J(c?"StarsGiftHeaderSelf":"StarsGiftHeader")),r.Ay.createElement("p",{className:(0,o.A)(lt.description,lt.starGiftsDescription,lt.center)},Y),r.Ay.createElement(ot,{onCategoryChanged:$}),r.Ay.createElement(U.Ay,{name:"zoomFade",activeKey:(re=K,"all"===re?-2:"limited"===re?-1:"stock"===re?0:re),className:lt.starGiftsTransition},r.Ay.createElement("div",{className:lt.starGiftsContainer},t&&a?.[K].map((e=>{const a=t[e];return r.Ay.createElement(st,{gift:a,observeIntersection:q,onClick:Z})}))))),j&&I?.forPeerId&&r.Ay.createElement(et,{gift:P,peerId:I.forPeerId})));var re})));const dt=(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:s,openGiftModal:o}=(0,n.ko)(),l=(0,u.A)(),c=e,[m,A]=(0,r.J0)(""),p=(0,r.Kr)((()=>{const e=(0,n.mS)(),r=a?a.concat(t):void 0,s=r?(0,C.PU)({ids:r,query:m}):[];return(0,k.A)((0,I.Am)(s).filter((t=>(0,i.X2D)(e,t))),void 0,[t])}),[t,m,a]),f=(0,d.A)((e=>{o({forUserId:e}),s()}));return r.Ay.createElement(P.A,{className:"W3JMs1YE",isOpen:c,onClose:s,title:l("GiftTelegramPremiumOrStarsTitle"),hasCloseButton:!0,shouldAdaptToSearch:!0,withFixedHeight:!0},r.Ay.createElement(G.A,{className:"wOipz1Y_",itemIds:p,filterValue:m,filterPlaceholder:l("Search"),onSelectedIdChange:f,onFilterChange:A,isSearchable:!0,withDefaultPadding:!0,withStatus:!0,forceShowSelf:!0}))})));var ut=a(80140),At=a(18501),pt=a(25404),ft=a(94189);const yt={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"},ht=(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,C.vj)(c)?c:void 0,d=m&&(0,s.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:I,focusMessage:k,openGiftUpgradeModal:G,showNotification:P}=(0,n.ko)(),[w,M,x]=(0,B.A)(),U=(0,T.A)(),D=(0,u.A)(),R=Boolean(e),K=(0,m.A)(e),L=(0,m.A)(t),J=(0,m.A)(a),V=J&&(0,C.vj)(J),{gift:H}=K||{},_=H&&"gift"in H,W=_?H:void 0,X=W?.fromId===l,Y=W&&c&&W.date+c-(0,ut.Fm)()||0,Z=Math.ceil(Y/60/60/24),$=_?H.gift:H,ee=$&&(0,j.yQ)($),te=Y>0&&Boolean(W?.starsToConvert),ae=$&&"starGiftUnique"===$.type,re=Boolean(W?.upgradeMsgId),ne=!re&&W?.inputGift&&(V?h:J?.id===l),se=(0,d.A)((()=>{v()})),ie=(0,d.A)((()=>{const e=X?J:L;if(!W?.upgradeMsgId||!e)return;const{upgradeMsgId:t}=W;k({chatId:e.id,messageId:t}),se()})),oe=(0,d.A)((()=>{const{inputGift:e,isUnsaved:t}=W;b({gift:e,shouldUnsave:!t}),se()})),ce=(0,d.A)((()=>{const{inputGift:e}=W;N({gift:e}),x(),se()})),me=(0,d.A)((()=>{W&&G({giftId:W.gift.id,gift:W})})),de=(0,r.Kr)((()=>$&&(0,j.uc)($)),[$]),ue=(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:U("AriaMoreButton")},r.Ay.createElement(p.A,{name:"more"}))),[U]),Ae=(0,d.A)((()=>re?r.Ay.createElement(y.A,{size:"smaller",onClick:ie},U("GiftInfoViewUpgraded")):ne&&W?.alreadyPaidUpgradeStars&&!W.upgradeMsgId?r.Ay.createElement(y.A,{size:"smaller",isShiny:!0,onClick:me},U("GiftInfoUpgradeForFree")):r.Ay.createElement(y.A,{size:"smaller",onClick:se},U("OK")))),ye=(0,r.Kr)((()=>{if(!H||!$)return;const{fromId:e,isNameHidden:t,starsToConvert:a,isUnsaved:l,isConverted:c,upgradeMsgId:m}=W||{},d=te&&Boolean(a),u=t&&J,h=(()=>{if(!W)return U("GiftInfoSoldOutDescription");if(!V){if(W.upgradeMsgId)return U("GiftInfoDescriptionUpgraded");if(W.canUpgrade&&W.alreadyPaidUpgradeStars)return ne?U("GiftInfoDescriptionFreeUpgrade"):U("GiftInfoPeerDescriptionFreeUpgradeOut",{peer:(0,s.F9)(U,J)});if(ne||X)return c&&d?ne?U("GiftInfoDescriptionConverted",{amount:a},{pluralValue:a,withNodes:!0,withMarkdown:!0}):U("GiftInfoPeerDescriptionOutConverted",{amount:a,peer:(0,s.F9)(U,J)},{pluralValue:a,withNodes:!0,withMarkdown:!0}):W.canUpgrade&&ne?d?U("GiftInfoDescriptionUpgrade",{amount:a},{pluralValue:a,withNodes:!0,withMarkdown:!0}):U("GiftInfoDescriptionUpgradeRegular"):ne?d?U("GiftInfoDescription",{amount:a},{withNodes:!0,withMarkdown:!0,pluralValue:a}):U("GiftInfoDescriptionRegular"):d?U("GiftInfoPeerDescriptionOut",{amount:a,peer:(0,s.F9)(U,J)},{withNodes:!0,withMarkdown:!0,pluralValue:a}):U("GiftInfoPeerDescriptionOutRegular",{peer:(0,s.F9)(U,J)})}})(),b=r.Ay.createElement(ke.A,{className:"with-menu-transitions",trigger:ue,positionX:"right"},r.Ay.createElement(pt.A,{peerId:K.peerId,gift:H,canManage:ne,collectibleEmojiStatuses:E,currentUserEmojiStatus:g})),N=r.Ay.createElement("div",{className:yt.modalHeader},r.Ay.createElement(y.A,{className:yt.modalCloseButton,round:!0,color:"translucent-white",size:"smaller",ariaLabel:U("Close"),onClick:se},r.Ay.createElement(p.A,{name:"close"})),R&&b),C=ae&&r.Ay.createElement("div",{className:(0,o.A)(yt.header,yt.uniqueGift)},r.Ay.createElement(he,{backdropAttribute:de.backdrop,patternAttribute:de.pattern,modelAttribute:de.model,title:$.title,subtitle:U("GiftInfoCollectible",{number:$.number})})),k=r.Ay.createElement("div",{className:yt.header},r.Ay.createElement(Q.A,{className:yt.giftSticker,sticker:ee,size:120}),r.Ay.createElement("h1",{className:yt.title},ae?$.title:U(W?ne?"GiftInfoReceived":"GiftInfoTitle":"GiftInfoSoldOutTitle")),h&&r.Ay.createElement("p",{className:(0,o.A)(yt.description,!W&&"starGift"===$?.type&&yt.soldOut)},h)),G=[];if("starGift"===$.type){(e||t)&&G.push([U("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:yt.unknown},D(q.I5.titleKey)))]),W?.date&&G.push([U("GiftInfoDate"),(0,F.L2)(1e3*W.date,U.code,!0)]),$.firstSaleDate&&G.push([U("GiftInfoFirstSale"),(0,F.L2)(1e3*$.firstSaleDate,U.code,!0)]),$.lastSaleDate&&G.push([U("GiftInfoLastSale"),(0,F.L2)(1e3*$.lastSaleDate,U.code,!0)]);const n=$.stars+(W?.alreadyPaidUpgradeStars||0);G.push([U("GiftInfoValue"),r.Ay.createElement("div",{className:yt.giftValue},(0,le.U)(U,n,{className:yt.starAmountIcon}),ne&&te&&Boolean(a)&&r.Ay.createElement(O.A,{onClick:M},U("GiftInfoConvert",{amount:a},{pluralValue:a})))]),$.availabilityTotal&&G.push([U("GiftInfoAvailability"),U("GiftInfoAvailabilityValue",{count:$.availabilityRemains||0,total:$.availabilityTotal},{pluralValue:$.availabilityRemains||0})]),$.upgradeStars&&!m&&G.push([U("GiftInfoStatus"),r.Ay.createElement("div",{className:yt.giftValue},U("GiftInfoStatusNonUnique"),ne&&r.Ay.createElement(O.A,{onClick:me},U("GiftInfoUpgradeBadge")))]),W?.message&&G.push([void 0,(0,At.f)(W.message)])}if(ae){const{ownerName:e,ownerAddress:t,ownerId:a}=$,{model:o,backdrop:l,pattern:c,originalDetails:m}=de||{};if(t?G.push([U("GiftInfoOwner"),r.Ay.createElement("span",{className:yt.ownerAddress,onClick:()=>{(0,pe.eM)(t),P({message:{key:"WalletAddressCopied"},icon:"copy"})}},t,r.Ay.createElement(p.A,{className:yt.copyIcon,name:"copy"}))]):G.push([U("GiftInfoOwner"),a?{chatId:a,withEmojiStatus:!0}:e||""]),o&&G.push([U("GiftAttributeModel"),r.Ay.createElement("span",{className:yt.uniqueAttribute},o.name,r.Ay.createElement(O.A,null,(0,z.l9)(o.rarityPercent)))]),l&&G.push([U("GiftAttributeBackdrop"),r.Ay.createElement("span",{className:yt.uniqueAttribute},l.name,r.Ay.createElement(O.A,null,(0,z.l9)(l.rarityPercent)))]),c&&G.push([U("GiftAttributeSymbol"),r.Ay.createElement("span",{className:yt.uniqueAttribute},c.name,r.Ay.createElement(O.A,null,(0,z.l9)(c.rarityPercent)))]),G.push([U("GiftInfoAvailability"),U("GiftInfoIssued",{issued:$.issuedCount,total:$.totalCount})]),m){const{date:e,recipientId:t,message:a,senderId:o}=m,l=(0,n.mS)(),c=e=>{I({id:e}),v()},d=(0,i.PVB)(l,t),u=o?(0,i.PVB)(l,o):void 0,A=(0,F.L2)(1e3*e,U.code,!0),p=r.Ay.createElement(We.A,{onClick:()=>c(t),isPrimary:!0},(0,s.F9)(U,d));let f;if(u&&o!==t){const e=r.Ay.createElement(We.A,{onClick:()=>c(u.id),isPrimary:!0},(0,s.F9)(U,u));f=a?U("GiftInfoPeerOriginalInfoTextSender",{peer:p,sender:e,text:(0,At.f)(a),date:A},{withNodes:!0}):U("GiftInfoPeerOriginalInfoSender",{peer:p,date:A,sender:e},{withNodes:!0})}else f=a?U("GiftInfoPeerOriginalInfoText",{peer:p,text:(0,At.f)(a),date:A},{withNodes:!0}):U("GiftInfoPeerOriginalInfo",{peer:p,date:A},{withNodes:!0});G.push([void 0,r.Ay.createElement("span",null,f)])}}const w=S&&ae&&$.giftAddress&&`${S}${$.giftAddress}`,B=r.Ay.createElement("div",{className:yt.footer},(ne||w)&&r.Ay.createElement("div",{className:yt.footerDescription},w&&r.Ay.createElement("div",null,U("GiftInfoTonText",{link:r.Ay.createElement(f.A,{url:w,shouldSkipModal:!0,text:U("GiftInfoTonLinkText")})},{withNodes:!0})),ne&&r.Ay.createElement("div",null,U(`GiftInfo${V?"Channel":""}${l?"Hidden":"Saved"}`,{link:r.Ay.createElement(We.A,{isPrimary:!0,onClick:oe},U("GiftInfoSaved"+(l?"Show":"Hide")))},{withNodes:!0})),u&&r.Ay.createElement("div",null,U("GiftInfoSenderHidden"))),Ae());return{modalHeader:ae?N:void 0,header:ae?C:k,tableData:G,footer:B}}),[H,W,J,ee,U,ne,te,X,D,S,$,de,Ae,V,ue,R,ae,K,E,g]);return r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement(fe.A,{isOpen:R,modalHeader:ye?.modalHeader,header:ye?.header,hasBackdrop:ae,tableData:ye?.tableData,footer:ye?.footer,className:yt.modal,onClose:se}),W&&r.Ay.createElement(ft.A,{isOpen:w,onClose:x,confirmHandler:ce,title:U("GiftInfoConvertTitle")},r.Ay.createElement("div",null,U("GiftInfoPeerConvertDescription",{amount:(0,le.K)(U,W.starsToConvert),peer:(0,s.F9)(U,L)},{withNodes:!0,withMarkdown:!0})),te&&r.Ay.createElement("div",null,U("GiftInfoConvertDescriptionPeriod",{count:Z},{withNodes:!0,withMarkdown:!0,pluralValue:Z})),r.Ay.createElement("div",null,U("GiftInfoConvertDescription2"))))})));var gt=a(58554),Et=a(32625),St=a(5463);const vt="_Dt6RSQV",bt=(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,Et.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,s.Mw)(e,"full"))).forEach((e=>{(0,gt.hd)(e,He.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:vt,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:vt,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(St.A,{isOpen:o,header:v?.header,footer:v?.footer,listItemData:v?.listItemData,hasBackdrop:!0,onClose:g})})));var Nt=a(47483);const Ct=(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,Nt.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(Ce.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")]],I=(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(St.A,{isOpen:c,header:N,listItemData:C,footer:I,hasBackdrop:!0,onClose:E})})));var It=a(21309),kt=a(76023),Gt=a(15535);const Pt={header:"LQgz8Nlx",giftPreview:"hgs0ts_O",backdrop:"OnBhMaBw",description:"HBxB4QPY",arrow:"kXTOUpfb",noPassword:"BnqLhoKr"},wt={isCustomPeer:!0,avatarIcon:"fragment",title:"",customPeerAvatarColor:"#000000"},Bt=4.5*kt.$,Tt=(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,ut.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:Pt.header},r.Ay.createElement("div",{className:Pt.giftPreview},r.Ay.createElement(X.A,{className:Pt.backdrop,backgroundColors:[E.backdrop.centerColor,E.backdrop.edgeColor],patternColor:E.backdrop?.patternColor,patternIcon:E.pattern?.sticker}),r.Ay.createElement(Q.A,{className:Pt.sticker,size:Bt,sticker:E.model?.sticker})),r.Ay.createElement(p.A,{name:"next",className:Pt.arrow}),r.Ay.createElement(A.A,{peer:wt,size:"giant",className:Pt.avatar})),r.Ay.createElement("p",{className:Pt.description},f("GiftWithdrawDescription",{gift:`${g.title} #${g.number}`},{withNodes:!0,withMarkdown:!0,renderTextFilters:["br"]}))),Boolean(S)&&r.Ay.createElement("p",{className:Pt.exportHint},f("GiftWithdrawWait",{days:(0,It._k)(S)},{pluralValue:(0,It._k)(S)})),!t&&r.Ay.createElement("span",{className:Pt.noPassword},f("ErrorPasswordMissing")),t&&!S&&r.Ay.createElement(Gt.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 Mt=a(79824),xt=a(74984),Ut=a(4875),Dt=a(56863),Ot=a(30857),Rt=a(84080),Kt=a(56133),Lt=a(35297);function Ft(){}async function zt(e){const t=await(0,Ut.px)("searchChats",{query:e});if(t)return[...t.accountResultIds,...t.globalResultIds]}const Jt={header:"PvaNNycU",giftPreview:"nCQxWKdu",backdrop:"JCP9JNuS",arrow:"p_1cyCau"},Vt=4*kt.$,Ht=3*kt.$,qt=(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),w=(0,r.Kr)((()=>{const e=(0,n.mS)();return C?(0,i.PVB)(e,C):void 0}),[C]),B=(0,xt.Rh)(N.DSF),M=(0,r.Kr)((()=>(0,I.Am)([...t||[],...B||[]])),[t,B]),{result:x,currentResultsQuery:U}=function({query:e,queryFn:t=zt,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,Ot.A)(),n=(0,r.hb)((()=>{e.current&&(e.current=!1,a())}),[a]);return(0,Rt.Ay)(Ft,n),{isFrozen:(0,r.OV)(),updateWhenUnfrozen:t}}(),l=(0,Kt.A)(t,!0);return(0,Lt.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,Dt.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,O=(0,r.Kr)((()=>U?Mt.p:[{type:"withdraw",isCustomPeer:!0,avatarIcon:"toncoin",peerColorId:5,title:f("GiftTransferTON")}]),[f,U]),R=(0,d.A)((e=>{"withdraw"===e&&(l({gift:g.gift}),o())})),K=(0,r.Kr)((()=>{if(D)return Mt.p;const e=(0,n.mS)();return(0,k.A)((x||[]).filter((t=>t!==a&&(0,i.X2D)(e,t))),!1)}),[D,x,a]),L=(0,d.A)((()=>{b(void 0)}));(0,r.vJ)((()=>{u||b(void 0)}),[u]);const F=(0,d.A)((()=>{g?.gift.inputGift&&(c({gift:g.gift.inputGift,recipientId:C,transferStars:g.gift.transferStars}),L(),o())}));return r.Ay.createElement(P.A,{isOpen:u,onClose:o,title:f("GiftTransferTitle"),hasCloseButton:!0,shouldAdaptToSearch:!0,withFixedHeight:!0,ignoreFreeze:!0},r.Ay.createElement(G.A,{itemIds:K,categories:O,onSelectedCategoryChange:R,withDefaultPadding:!0,withPeerUsernames:!0,isSearchable:!0,noScrollRestore:!0,isLoading:D,filterValue:y,filterPlaceholder:f("Search"),onFilterChange:h,onSelectedIdChange:b}),S&&r.Ay.createElement(ft.A,{isOpen:Boolean(v),noDefaultTitle:!0,onClose:L,confirmLabel:g?.gift.transferStars?f("GiftTransferConfirmButton",{amount:(0,le.U)(f,g.gift.transferStars,{asFont:!0})},{withNodes:!0}):f("GiftTransferConfirmButtonFree"),confirmHandler:F},r.Ay.createElement("div",{className:Jt.header},r.Ay.createElement("div",{className:Jt.giftPreview},r.Ay.createElement(X.A,{className:Jt.backdrop,backgroundColors:[S.backdrop.centerColor,S.backdrop.edgeColor],patternColor:S.backdrop?.patternColor,patternIcon:S.pattern?.sticker}),r.Ay.createElement(Q.A,{className:Jt.sticker,size:Ht,sticker:S.model?.sticker})),r.Ay.createElement(p.A,{name:"next",className:Jt.arrow}),r.Ay.createElement(A.A,{peer:w,size:Vt,className:Jt.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,w)},{withNodes:!0,withMarkdown:!0}):f("GiftTransferConfirmDescriptionFree",{gift:f("GiftUnique",{title:E.title,number:E.number}),peer:(0,s.F9)(f,w)},{withNodes:!0,withMarkdown:!0}))))})))},84991:(e,t,a)=>{a.d(t,{A:()=>l});var r=a(84051),n=a(87357),s=a(21849),i=a(18276);const o={root:"hyRfEyRz",top:"p_Ny8jqJ",badge:"QRrryqp4",text:"I5jdPgFL"},l=(0,r.ph)((({peer:e,avatarWebPhoto:t,avatarSize:a,text:l,badgeText:c,badgeIcon:m,className:d,badgeClassName:u,badgeIconClassName:A,textClassName:p,onClick:f})=>r.Ay.createElement("div",{className:(0,n.A)(o.root,f&&o.clickable,d),onClick:f},r.Ay.createElement("div",{className:o.top},r.Ay.createElement(s.A,{size:a,peer:e,webPhoto:t}),c&&r.Ay.createElement("div",{className:(0,n.A)(o.badge,u)},m&&r.Ay.createElement(i.A,{name:m,className:A}),c)),l&&r.Ay.createElement("p",{className:(0,n.A)(o.text,p)},l))))},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,I]=(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&&I&&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.1673a7c82f2edcd83d2d.js.map
|