TelegramPWA/dist/6930.204bdfa0d1faa2f49d6c.js
Alexander Zinchuk cb12f1a070 [Build]
2025-01-05 20:28:02 +01:00

2 lines
53 KiB
JavaScript

"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[6930],{29851:(e,t,a)=>{a.r(t),a.d(t,{GiftInfoModal:()=>st,GiftModal:()=>qe,GiftRecipientPicker:()=>Ye,PaidReactionModal:()=>xe,StarPaymentModal:()=>le,StarsBalanceModal:()=>ae,StarsGiftModal:()=>v,StarsGiftingPickerModal:()=>G,StarsSubscriptionModal:()=>ge,StarsTransactionInfoModal:()=>ye});var n=a(84051),s=a(13439),r=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(56440),y=a(64493),f=a(8410),h=a(1526);const g={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",E=a.p+"stars-bg.dee4c4b73c7d21c2ec73.png",v=(0,n.ph)((0,s.EK)(((e,{modal:t})=>({user:t?.forUserId?(0,i.mBe)((0,s.mS)(),t.forUserId):void 0})))((({modal:e,user:t})=>{const{closeStarsGiftModal:a,openInvoice:i,requestConfetti:v}=(0,s.ko)(),N=(0,n.li)(null),b=Boolean(e?.isOpen),I=(0,m.A)(e),C=(0,u.A)(),[k,G]=(0,n.J0)(),[T,B]=(0,n.J0)(!0);(0,n.vJ)((()=>{b||B(!0)}),[b]);const w=(0,d.A)((()=>{const e=N.current;if(e&&b){const{top:t,left:a,width:n,height:s}=e.querySelector(".modal-content").getBoundingClientRect();v({top:t,left:a,width:n,height:s,withStars:!0})}}));(0,n.vJ)((()=>{I?.isCompleted&&w()}),[I,w]);const P=(0,d.A)((e=>{I&&(G(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()})),M=(0,n.Kr)((()=>{const e=C("lng_credits_summary_options_about").split("{link}");return[e[0],n.Ay.createElement(p.A,{url:C("StarsTOSLink"),text:C("lng_credits_summary_options_about_link")}),e[1]]}),[C]);return n.Ay.createElement(f.A,{className:(0,o.A)(g.modalDialog),contentClassName:g.content,dialogRef:N,isSlim:!0,onClose:x,isOpen:b},n.Ay.createElement("div",{className:(0,o.A)(g.main,"custom-scroll"),onScroll:function(e){const{scrollTop:t}=e.currentTarget;B(t<=150)}},n.Ay.createElement(y.A,{round:!0,size:"smaller",className:g.closeButton,color:"translucent",onClick:()=>a(),ariaLabel:C("Close")},n.Ay.createElement("i",{className:"icon icon-close"})),n.Ay.createElement("div",{className:(0,o.A)(g.header,T&&g.hiddenHeader)},n.Ay.createElement("h2",{className:g.starHeaderText},C(t?"GiftStarsTitle":"Star.List.GetStars"))),n.Ay.createElement("div",{className:g.headerInfo},t?n.Ay.createElement(n.Ay.Fragment,null,n.Ay.createElement(A.A,{size:100,peer:t,className:g.avatar}),n.Ay.createElement("img",{className:g.logoBackground,src:E,alt:"",draggable:!1})):n.Ay.createElement(n.Ay.Fragment,null,n.Ay.createElement("img",{className:g.logo,src:S,alt:"",draggable:!1}),n.Ay.createElement("img",{className:g.logoBackground,src:E,alt:"",draggable:!1}))),n.Ay.createElement("h2",{className:(0,o.A)(g.headerText,g.center)},I?.isCompleted?t?(0,c.A)(C("Notification.StarsGift.SentYou",(0,l.A)(k.amount,k.currency,C.code)),["simple_markdown"]):(0,c.A)(C("StarsAcquiredInfo",k?.stars),["simple_markdown"]):C(t?"GiftStarsTitle":"Star.List.GetStars")),n.Ay.createElement("p",{className:g.description},t?(0,c.A)(C("ActionGiftStarsSubtitle",(0,r.F9N)(C,t)),["simple_markdown"]):C("Stars.Purchase.GetStarsInfo")),n.Ay.createElement("div",{className:g.section},n.Ay.createElement(h.A,{options:I?.starsGiftOptions,onClick:P}),n.Ay.createElement("div",{className:g.secondaryInfo},M))))})));var N=a(31481),b=a(87894),I=a(79582),C=a(54960),k=a(34642);const G=(0,n.ph)((0,s.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,s.ko)(),m=(0,u.A)(),[A,p]=(0,n.J0)(""),y=(0,n.Kr)((()=>{const e=(0,s.mS)().users.byId,n=[...o||[],...a||[],...i||[]],l=(0,r.Z$K)(n,e,A);return(0,I.A)((0,b.Am)(l).filter((a=>{const n=e[a];return!(!n||n.isSupport||(0,r.tvf)(n)||(0,r.PL2)(n)||a===t||a===N.zv8)})))}),[t,A,o,a,i]),f=(0,d.A)((e=>{e?.length&&(c({forUserId:e}),l())}));return n.Ay.createElement(k.A,{className:"s3k01dTm",isOpen:e,onClose:l,title:m("GiftStarsTitle"),hasCloseButton:!0,shouldAdaptToSearch:!0,withFixedHeight:!0,confirmButtonText:m("Continue"),onEnter:l},n.Ay.createElement(C.A,{className:"cuI2eDIY",itemIds:y,filterValue:A,filterPlaceholder:m("Search"),onFilterChange:p,isSearchable:!0,withDefaultPadding:!0,withStatus:!0,onSelectedIdChange:f}))})));var T=a(37661),B=a(39351),w=a(18276),P=a(9267),x=a(46222),M=a(24680),R=a(41036),O=a(86046);const L={root:"TtE8LQNJ",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",balance:"LitvQduT",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"},K=(0,n.ph)((({balance:e,className:t})=>{const a=(0,B.A)();return n.Ay.createElement("div",{className:(0,o.A)(L.balance,t)},n.Ay.createElement("span",{className:L.smallerText},a("StarsBalance")),n.Ay.createElement("div",{className:L.balanceBottom},n.Ay.createElement(P.A,{type:"gold",size:"middle"}),void 0!==e?(0,O.ZF)(a,e):"…"))}));var U=a(17663),D=a(14242),z=a(63527);const F={root:"ZXnbeQxP",info:"zLaaDX3c",subtitle:"YN2J8dw6",status:"HbF2qTB2",statusPricing:"AveGvpdV",amount:"_CBiOQcv",title:"k9ZIv5Pd",description:"FlRlxMx2",statusPeriod:"MRrP7Oew",statusEnded:"pRHwfr8m",preview:"t6Syyhzd",subscriptionStar:"ftlbevPm"},J=(0,n.ph)((({subscription:e})=>{const{openStarsSubscriptionModal:t}=(0,s.ko)(),{peerId:a,pricing:o,until:l,isCancelled:c,title:m,photo:p}=e,y=(0,u.A)(),f=(0,z.A)(function(e){return t=>(0,i.PVB)(t,e)}(a)),h=(0,d.A)((()=>{t({subscription:e})}));if(!f)return;const g=l<Date.now()/1e3,S=(0,U.A)(1e3*l,y.code,!0,"long");return n.Ay.createElement("div",{className:F.root,onClick:h},n.Ay.createElement("div",{className:F.preview},n.Ay.createElement(A.A,{size:"medium",peer:f}),n.Ay.createElement(P.A,{className:F.subscriptionStar,type:"gold",size:"small"})),n.Ay.createElement("div",{className:F.info},n.Ay.createElement("h3",{className:F.title},(0,r.F9N)(y,f)),m&&n.Ay.createElement("p",{className:F.subtitle},p&&n.Ay.createElement(A.A,{webPhoto:p,size:"micro"}),m),n.Ay.createElement("p",{className:F.description},y(g?"StarsSubscriptionExpired":c?"StarsSubscriptionExpires":"StarsSubscriptionRenews",S))),n.Ay.createElement("div",{className:F.status},c||g?n.Ay.createElement("div",{className:F.statusEnded},y(g?"StarsSubscriptionStatusExpired":"StarsSubscriptionStatusCancelled")):n.Ay.createElement(n.Ay.Fragment,null,n.Ay.createElement("div",{className:F.statusPricing},n.Ay.createElement(P.A,{className:F.star,type:"gold",size:"adaptive"}),n.Ay.createElement("span",{className:F.amount},(0,D.Sm)(o.amount))),n.Ay.createElement("div",{className:F.statusPeriod},y("StarsParticipantSubscriptionPerMonth")))))}));var _=a(58968);function H(e,t){if(t.starRefCommision)return e("StarTransactionCommission",(0,D.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 V(t.stars)?e("Gift2TransactionSent"):e("Gift2ConvertedTitle");const a=t.peer&&"peer"!==t.peer.type&&(0,O.Pc)(t.peer)||void 0;return a?a.title||e(a.titleKey):t.title}function V(e){return e.amount?e.amount<0:e.nanos<0}var W=a(62587),j=a(27860);const q={root:"jQkp75Gb",preview:"OYGSN3PF",count:"KX1yz2Jy",thumb:"EvinKr5k",noOutline:"KSAAsUDv",itemCount1:"GxDajfX_",itemCount2:"jXuZoxq8",itemCount3:"TPn3XGHJ",blurry:"hWZuxLS8",full:"w56QPFhl",fadeIn:"ds43W8Wq"};function Y({boughtMedia:e,index:t,className:a}){const s=e.video||e.photo,i=(0,r.VOI)(s,"pictogram"),l=(0,r.VDY)(s),c=(0,W.A)(i);return n.Ay.createElement("div",{className:(0,o.A)(q.thumb,void 0!==t&&`stars-transaction-media-${t}`,a)},l&&n.Ay.createElement("img",{className:q.blurry,src:l,alt:""}),c&&n.Ay.createElement("img",{className:q.full,src:c,alt:""}))}const Q=(0,n.ph)((({media:e,className:t,isTransactionPreview:a,onClick:s})=>{const r=Math.min(e.length,a?2:3),i="mediaType"in e[0];return n.Ay.createElement("div",{className:(0,o.A)(q.root,q[`itemCount${r}`],a&&q.preview,t),dir:"rtl",onClick:s},e.slice(0,r).reverse().map(((e,t,s)=>{const r=s.length-t-1;return"mediaType"in e?n.Ay.createElement(j.A,{className:q.thumb,isVisible:!0,width:e.width,height:e.height,thumbDataUri:e.thumbnail?.dataUri}):n.Ay.createElement(Y,{className:(0,o.A)(a&&r>0&&q.noOutline),boughtMedia:e,index:r})})),i&&n.Ay.createElement("div",{className:q.count},n.Ay.createElement(w.A,{name:"stars-lock"}),e.length>1?e.length:""))})),X={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"},Z=(0,n.ph)((({transaction:e,className:t})=>{const{openStarsTransactionModal:a}=(0,s.ko)(),{date:l,stars:m,photo:p,peer:y,extendedMedia:f,subscriptionPeriod:h}=e,g=(0,B.A)(),S=(0,u.A)(),E="peer"===y.type?y.id:void 0,v=(0,z.A)(function(e){return t=>e?(0,i.PVB)(t,e):void 0}(E)),N=(0,n.Kr)((()=>{let t,a,n,s=H(S,e);if("peer"===e.peer.type)t=v&&(0,r.F9N)(S,v),n=v||_.lw;else{const a=(0,O.Pc)(e.peer);s=a.title||S(a.titleKey),t=S(a.subtitleKey),n=a}return e.isGiftUpgrade&&"starGiftUnique"===e.starGift?.type&&(t=e.starGift.title),e.photo&&(n=void 0),e.isRefund&&(a=S("StarsRefunded")),e.hasFailed&&(a=S("StarsFailed")),e.isPending&&(a=S("StarsPending")),{title:s,description:t,avatarPeer:n,status:a}}),[S,v,e]),b=(0,d.A)((()=>{a({transaction:e})}));return n.Ay.createElement("div",{className:(0,o.A)(X.root,t),onClick:b},n.Ay.createElement("div",{className:X.preview},f?n.Ay.createElement(Q,{media:f,isTransactionPreview:!0}):n.Ay.createElement(A.A,{size:"medium",webPhoto:p,peer:N.avatarPeer}),Boolean(h)&&n.Ay.createElement(P.A,{className:X.subscriptionStar,type:"gold",size:"small"})),n.Ay.createElement("div",{className:X.info},n.Ay.createElement("h3",{className:X.title},N.title),N.description&&n.Ay.createElement("p",{className:X.description},(0,c.A)(N.description)),n.Ay.createElement("p",{className:X.date},(0,U.L2)(1e3*l,S.code,!0),N.status&&` — (${N.status})`)),n.Ay.createElement("div",{className:X.stars},n.Ay.createElement("span",{className:(0,o.A)(X.amount,V(m)?X.negative:X.positive)},(0,O.hk)(g,m)),n.Ay.createElement(P.A,{className:X.star,type:"gold",size:"adaptive"})))})),$=["all","inbound","outbound"],ee=["StarsTransactionsAll","StarsTransactionsIncoming","StarsTransactionsOutgoing"],te="StarsTransactionItem",ae=(0,n.ph)((0,s.EK)((e=>({starsBalanceState:e.stars,canBuyPremium:!(0,i.n_C)(e)})))((({modal:e,starsBalanceState:t,canBuyPremium:a})=>{const{closeStarsBalanceModal:l,loadStarsTransactions:m,loadStarsSubscriptions:A,openStarsGiftingPickerModal:g,openInvoice:v}=(0,s.ko)(),{balance:N,history:b,subscriptions:I}=t||{},C=(0,u.A)(),k=(0,B.A)(),[G,O]=(0,n.J0)(!0),[U,D]=(0,n.J0)(0),[z,F,_]=(0,T.A)(),H=Boolean(e&&t),{originStarsPayment:V,originReaction:W,originGift:j,topup:q}=e||{},Y=V||W||j||q,Q=V?.form?.invoice?.totalAmount||V?.subscriptionInfo?.subscriptionPricing?.amount||W?.amount||j?.gift.stars||q?.balanceNeeded,X=Q?Q-(N?.amount||0):void 0,ae=(0,n.Kr)((()=>{const e=(0,s.mS)();if(W){const t=(0,i.hds)(e,W.chatId);if(!t)return;return C("StarsNeededTextReactions",(0,r.JsG)(C,t))}if(V){const t=V.form?.botId?(0,i.mBe)(e,V.form.botId):void 0;if(!t)return;return C("StarsNeededText",(0,r.YgS)(t))}if(j){const t=(0,i.mBe)(e,j.userId);if(!t)return;return C("StarsNeededTextGift",(0,r.YgS)(t))}if("subs"===q?.purpose)return C("StarsNeededTextLink")}),[W,V,j,q?.purpose,C]),ne=Boolean(b?.all?.transactions.length&&!Y),se=!Y,re=(0,n.Kr)((()=>ee.map((e=>({title:k(e)})))),[k]);(0,n.vJ)((()=>{H||(O(!0),D(0),_())}),[H]),(0,n.vJ)((()=>{Y?F():_()}),[Y]);const ie=(0,n.Kr)((()=>{if(!H)return;const e=C("lng_credits_summary_options_about").split("{link}");return[e[0],n.Ay.createElement(p.A,{url:C("StarsTOSLink"),text:C("lng_credits_summary_options_about_link")}),e[1]]}),[H,C]),oe=(0,d.A)((()=>{m({type:$[U]})})),le=(0,d.A)((()=>{A()})),ce=(0,d.A)((()=>{g({})})),me=(0,d.A)((e=>{v({type:"stars",stars:e.stars,currency:e.currency,amount:e.amount})}));return n.Ay.createElement(f.A,{className:L.root,isOpen:H,onClose:l},n.Ay.createElement("div",{className:(0,o.A)(L.main,"custom-scroll"),onScroll:function(e){const{scrollTop:t}=e.currentTarget;O(t<=150)}},n.Ay.createElement(y.A,{round:!0,size:"smaller",className:L.closeButton,color:"translucent",onClick:()=>l(),ariaLabel:k("Close")},n.Ay.createElement(w.A,{name:"close"})),n.Ay.createElement(K,{balance:N,className:L.modalBalance}),n.Ay.createElement("div",{className:(0,o.A)(L.header,G&&L.hiddenHeader)},n.Ay.createElement("h2",{className:L.starHeaderText},C("TelegramStars"))),n.Ay.createElement("div",{className:L.section},n.Ay.createElement("img",{className:L.logo,src:S,alt:"",draggable:!1}),n.Ay.createElement("img",{className:L.logoBackground,src:E,alt:"",draggable:!1}),n.Ay.createElement("h2",{className:L.headerText},X?C("StarsNeededTitle",Q):C("TelegramStars")),n.Ay.createElement("div",{className:L.description},(0,c.A)(ae||C("TelegramStarsInfo"),["simple_markdown","emoji"])),a&&!z&&n.Ay.createElement(y.A,{className:L.starButton,onClick:F},C("Star.List.BuyMoreStars")),a&&!z&&se&&n.Ay.createElement(y.A,{className:(0,o.A)(L.starButton,"settings-main-menu-star"),color:"translucent",onClick:ce},n.Ay.createElement(P.A,{className:"icon",type:"gold",size:"big"}),C("TelegramStarsGift")),z&&t?.topupOptions&&n.Ay.createElement(h.A,{starsNeeded:X,options:t.topupOptions,onClick:me})),z&&n.Ay.createElement("div",{className:L.tos},ie),ne&&Boolean(I?.list.length)&&n.Ay.createElement("div",{className:L.section},n.Ay.createElement("h3",{className:L.sectionTitle},C("StarMySubscriptions")),n.Ay.createElement("div",{className:L.subscriptions},I?.list.map((e=>n.Ay.createElement(J,{key:e.id,subscription:e}))),I?.nextOffset&&n.Ay.createElement(y.A,{isText:!0,disabled:I.isLoading,size:"smaller",noForcedUpperCase:!0,className:L.loadMore,onClick:le},n.Ay.createElement(w.A,{name:"down",className:L.loadMoreIcon}),C("StarMySubscriptionsExpand")))),ne&&n.Ay.createElement("div",{className:L.container},n.Ay.createElement("div",{className:L.section},n.Ay.createElement(R.Ay,{name:k.isRtl?"slideOptimizedRtl":"slideOptimized",activeKey:U,renderCount:ee.length,shouldRestoreHeight:!0,className:L.transition},n.Ay.createElement(x.A,{onLoadMore:oe,items:b?.[$[U]]?.transactions,scrollContainerClosest:`.${L.main}`,itemSelector:`.${te}`,className:L.transactions,noFastList:!0},b?.[$[U]]?.transactions.map((e=>n.Ay.createElement(Z,{key:`${e.id}-${e.isRefund}`,transaction:e,className:te})))))),n.Ay.createElement(M.A,{className:L.tabs,tabClassName:L.tab,activeTab:U,tabs:re,onSwitchTab:D}))))})));function ne(e,t){return e("StarsAmountText",{amount:t},{pluralValue:t})}function se(e,t,a){const s=a?n.Ay.createElement(w.A,{name:"star",className:"star-amount-icon"}):n.Ay.createElement(P.A,{type:"gold",className:"star-amount-icon",size:"adaptive"});return e("StarsAmount",{amount:t},{withNodes:!0,specialReplacement:{[N.Cyx]:s}})}var re=a(29886),ie=a(84991),oe=a(10187);const le=(0,n.ph)((0,s.EK)(((e,{modal:t})=>{const a=t?.form?.botId?(0,i.mBe)(e,t.form.botId):void 0,n="message"===t?.inputInvoice?.type?t.inputInvoice:void 0,s=n?(0,i.O5q)(e,n.chatId,n.messageId):void 0,r=n?(0,i.hds)(e,n.chatId):void 0,o=s?.content.paidMedia;return{bot:a,starsBalanceState:e.stars,paidMediaMessage:o?s:void 0,paidMediaChat:o?r:void 0}}))((({modal:e,bot:t,starsBalanceState:a,paidMediaMessage:i,paidMediaChat:l})=>{const{closeStarsPaymentModal:m,openStarsBalanceModal:h,sendStarPaymentForm:g}=(0,s.ko)(),[S,v,N]=(0,T.A)(),b=Boolean(e?.inputInvoice&&a),I=(0,re.A)(e),C=e||I,{form:k,subscriptionInfo:G}=C||{},w=k?.invoice?.totalAmount||G?.subscriptionPricing?.amount,x=Boolean(k?.invoice.subscriptionPeriod),M=!G?.subscriptionPricing,R=k?.photo,O=(0,u.A)(),U=(0,B.A)();(0,n.vJ)((()=>{b||N()}),[b]);const z=(0,n.Kr)((()=>{if(!C?.inputInvoice)return"";const e=(0,r.YgS)(t),a=O("Stars.Intro.PurchasedText.Stars",w);if(i){const e=i.content.paidMedia.extendedMedia,t=e.every((e=>!e.duration)),n=e.every((e=>!!e.duration)),s=O(t?"Stars.Transfer.Photos":n?"Stars.Transfer.Videos":"Media",e.length),o=(0,r.JsG)(O,l);return O("Stars.Transfer.UnlockInfo",[s,o,a])}return G?U("StarsSubscribeText",{chat:G.title,amount:w},{withNodes:!0,withMarkdown:!0,pluralValue:w}):x?U("StarsSubscribeBotText",{name:k.title,amount:w,bot:e},{pluralValue:w}):O("Stars.Transfer.Info",[k.title,e,a])}),[C?.inputInvoice,t,O,w,i,G,x,k,l,U]),F=(0,n.Kr)((()=>{if(G)return U("StarsSubscribeInfo",{link:n.Ay.createElement(p.A,{url:U("StarsSubscribeInfoLink"),text:U("StarsSubscribeInfoLinkText")})},{withNodes:!0})}),[G,U]),J=(0,n.Kr)((()=>{if(G)return(0,r.nrT)(G)}),[G]),_=(0,d.A)((()=>{const t=a?.balance;void 0!==w&&void 0!==t&&(w>t.amount?h({originStarsPayment:e}):(g({}),v()))}));return n.Ay.createElement(f.A,{contentClassName:L.paymentContent,isOpen:b,hasAbsoluteCloseButton:!0,isSlim:!0,onClose:m},n.Ay.createElement(K,{balance:a?.balance,className:L.modalBalance}),n.Ay.createElement("div",{className:L.paymentImages,dir:O.isRtl?"ltr":"rtl"},i?n.Ay.createElement(Q,{media:i.content.paidMedia.extendedMedia}):J?n.Ay.createElement(n.Ay.Fragment,null,n.Ay.createElement(A.A,{className:L.paymentPhoto,peer:J,size:"giant"}),n.Ay.createElement(P.A,{type:"gold",size:"adaptive",className:L.avatarStar})):n.Ay.createElement(ie.A,{peer:R?void 0:t,avatarWebPhoto:R,avatarSize:"giant",badgeIcon:"star",badgeText:(0,D.Sm)(w),badgeClassName:L.amountBadge,className:L.paymentPhoto}),n.Ay.createElement("img",{className:L.paymentImageBackground,src:E,alt:"",draggable:!1})),n.Ay.createElement("h2",{className:L.headerText},O(J?"StarsSubscribeTitle":"StarsConfirmPurchaseTitle")),M&&n.Ay.createElement(oe.A,{className:L.botItem,peerId:k?.botId}),n.Ay.createElement("div",{className:L.description},(0,c.A)(z,["simple_markdown","emoji"])),n.Ay.createElement(y.A,{className:L.paymentButton,size:"smaller",onClick:_,isLoading:S},U(x?"StarsSubscribeBotButtonMonth":"StarsPay",{amount:se(U,w,!0)},{withNodes:!0})),F&&n.Ay.createElement("div",{className:(0,o.A)(L.disclaimer,L.smallerText)},F))})));var ce=a(89925),me=a(85982),de=a(66833),ue=a(79577),Ae=a(70046);const pe="sso9uZM6",ye=(0,n.ph)((0,s.EK)(((e,{modal:t})=>{const a="peer"===t?.transaction?.peer?.type&&t.transaction.peer.id,n=a?(0,i.PVB)(e,a):void 0,s=t?.transaction.stars,r=t?.transaction.isGift&&(0,i.WLj)(e,s?.amount);return{peer:n,canPlayAnimatedEmojis:(0,i.BWX)(e),topSticker:r}}))((({modal:e,peer:t,canPlayAnimatedEmojis:a,topSticker:i})=>{const{showNotification:l,openMediaViewer:c,closeStarsTransactionModal:m}=(0,s.ko)(),y=(0,B.A)(),f=(0,u.A)(),{transaction:h}=e||{},g=h?.starGift?(0,de.yQ)(h.starGift):i,S=(0,d.A)((()=>{const e=h?.extendedMedia;e&&c({origin:ce.TQ.StarsTransaction,standaloneMedia:e.flatMap((e=>Object.values(e)))})})),v=(0,n.Kr)((()=>{if(!h)return;const{giveawayPostId:e,photo:s,stars:i,isGiftUpgrade:c,starGift:m}=h,d=h.peer&&"peer"!==h.peer.type&&(0,O.Pc)(h.peer)||void 0,u="peer"===h.peer?.type?h.peer.id:void 0,v=h.peer&&f(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"}}(h.peer)),N=H(f,h),b=t&&h.messageId&&!c?(0,r.ytg)(t,void 0,h.messageId):void 0,I=t&&e&&(0,r.ytg)(t,void 0,e),C=h.extendedMedia,k=C?.length||0,G=C?.every((e=>!e.video)),T=C?.every((e=>!e.photo)),B=f(G?"Stars.Transfer.Photos":T?"Stars.Transfer.Videos":"Media",k),x=h.description||(c&&"starGiftUnique"===m?.type?m.title:void 0)||(C?B:void 0),M=!C&&!g,R=s?void 0:t||d,L=n.Ay.createElement("div",{className:"qBOIq6Jn"},C&&n.Ay.createElement(Q,{className:(0,o.A)("C5r59yiV","transaction-media-preview"),media:C,onClick:S}),!C&&g&&n.Ay.createElement(ue.A,{key:h.id,sticker:g,play:a,noLoop:!0,nonInteractive:!0}),M&&n.Ay.createElement(A.A,{peer:R,webPhoto:s,size:"giant"}),!g&&n.Ay.createElement("img",{className:(0,o.A)("nML8IQqX"),src:E,alt:"",draggable:!1}),N&&n.Ay.createElement("h1",{className:"ZZAj3hj7"},N),n.Ay.createElement("p",{className:"NuWOY7ED"},x),n.Ay.createElement("p",{className:pe},n.Ay.createElement("span",{className:(0,o.A)(pe,V(i)?"xDyq9cc0":"jvBZSrpd")},(0,O.hk)(y,i)),n.Ay.createElement(P.A,{type:"gold",size:"middle"}))),K=[];let D;h.starRefCommision&&K.push([f("StarsTransaction.StarRefReason.Title"),f("StarsTransaction.StarRefReason.Program")]),c&&K.push([f("StarGiftReason"),f("StarGiftReasonUpgrade")]),D=c?f("Stars.Transaction.GiftFrom"):V(i)||h.isMyGift?f("Stars.Transaction.To"):h.starRefCommision?f("StarsTransaction.StarRefReason.Miniapp"):f(u?"Star.Transaction.From":"Stars.Transaction.Via"),K.push([D,u?{chatId:u}:v||""]),b&&K.push([f("Stars.Transaction.Reaction.Post"),n.Ay.createElement(p.A,{url:b,text:b})]),I&&(K.push([f("BoostReason"),n.Ay.createElement(p.A,{url:I,text:f("Giveaway")})]),K.push([f("Gift"),f("Stars",h.stars,"i")])),h.id&&K.push([f("Stars.Transaction.Id"),n.Ay.createElement(n.Ay.Fragment,null,n.Ay.createElement("div",{className:"tMF8VIOM",onClick:()=>{(0,me.eM)(h.id),l({message:f("StarsTransactionIDCopied")})}},h.id),n.Ay.createElement(w.A,{className:"voCttFzS",name:"copy"}))]),K.push([f("Stars.Transaction.Date"),(0,U.L2)(1e3*h.date,f.code,!0)]);const z=f("lng_credits_box_out_about").split("{link}");return{header:L,tableData:K,footer:n.Ay.createElement("span",{className:"KgzPpgS6"},z[0],n.Ay.createElement(p.A,{url:f("StarsTOSLink"),text:f("lng_credits_summary_options_about_link")}),z[1])}}),[h,f,y,t,g,a]),N=(0,re.A)(v)||v;return n.Ay.createElement(Ae.A,{isOpen:Boolean(h),className:"IzhfRIWu",header:N?.header,tableData:N?.tableData,footer:N?.footer,buttonText:f("OK"),onClose:m})})));var fe=a(70636);const he="oBLHWBtJ",ge=(0,n.ph)((0,s.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:r,changeStarsSubscription:i,checkChatInvite:l,loadStarStatus:c,openInvoice:m}=(0,s.ko)(),f=(0,u.A)(),h=(0,B.A)(),{subscription:g}=e||{},S=(0,n.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]),v=(0,d.A)((()=>{if(g){switch(S){case"refulfill":r({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,n.Kr)((()=>{if(!g||!t)return;const{pricing:e,until:a,isCancelled:s,canRefulfill:r,photo:i,title:l,hasBotCancelled:c}=g,m=(0,fe.mO)(t),d=n.Ay.createElement("div",{className:"E3R22yAI"},n.Ay.createElement("div",{className:"wuTMXDP9"},n.Ay.createElement(A.A,{peer:i?void 0:t,webPhoto:i,size:"giant"}),n.Ay.createElement(P.A,{className:"enRetSny",type:"gold",size:"adaptive"})),n.Ay.createElement("img",{className:(0,o.A)("zGCayu45"),src:E,alt:"",draggable:!1}),n.Ay.createElement("h1",{className:"qdydQHgc"},l||f("StarsSubscriptionTitle")),n.Ay.createElement("p",{className:"FI6rEJlK"},h("StarsPerMonth",{amount:e.amount},{withNodes:!0,specialReplacement:{[N.Cyx]:n.Ay.createElement(P.A,{className:"J8HIcN6k",size:"adaptive",type:"gold"})}}))),u=[];u.push([f(m?"StarsSubscriptionBot":"StarsSubscriptionChannel"),{chatId:t.id}]),l&&u.push([f("StarsSubscriptionBotProduct"),l]);const b=a<Date.now()/1e3;u.push([f(b?"StarsSubscriptionUntilExpired":s?"StarsSubscriptionUntilExpires":"StarsSubscriptionUntilRenews"),(0,U.L2)(1e3*a,f.code,!0)]);const I=h("StarsTransactionTOS",{link:n.Ay.createElement(p.A,{url:h("StarsTransactionTOSLink"),text:h("StarsTransactionTOSLinkText")})},{withNodes:!0});return{header:d,tableData:u,footer:n.Ay.createElement("span",{className:"GMWMuWCr"},n.Ay.createElement("p",{className:he},I),s&&n.Ay.createElement("p",{className:"nkwiG25Q"},f(c?"StarsSubscriptionBotCancelledText":"StarsSubscriptionCancelledText")),r&&n.Ay.createElement("p",{className:he},f("StarsSubscriptionRefulfillInfo",(0,U.L2)(1e3*a,f.code,!0))),!s&&!r&&b&&n.Ay.createElement("p",{className:he},f("StarsSubscriptionExpiredInfo",(0,U.L2)(1e3*a,f.code,!0))),!s&&!r&&!b&&n.Ay.createElement("p",{className:he},f("StarsSubscriptionCancelInfo",(0,U.L2)(1e3*a,f.code,!0))),"hidden"!==S&&n.Ay.createElement(y.A,{size:"smaller",color:"cancel"===S?"danger":"primary",isText:"cancel"===S,onClick:v},f("cancel"===S?"StarsSubscriptionCancel":"refulfill"===S?"StarsSubscriptionRefulfill":"restart"===S?"StarsSubscriptionAgain":"renew"===S?"StarsSubscriptionRenew":"OK")))}}),[S,h,f,t,g]),I=(0,re.A)(b)||b;return n.Ay.createElement(Ae.A,{isOpen:Boolean(g),className:"eR_RZfGB",header:I?.header,tableData:I?.tableData,footer:I?.footer,onClose:a})})));var Se=a(19806),Ee=a(32581),ve=a(66644),Ne=a(15283),be=a(93545),Ie=a(68292),Ce=a(85118);const ke={root:"CuBAw2yg",slider:"euOOAbZi",sparkles:"_L1YQTIP",progress:"kwK0cNPX",floatingBadgeWrapper:"uvlMoXj0",floatingBadge:"BGSDWAYc",floatingBadgeText:"qqQan8uF",floatingBadgeTriangle:"mIdJOmsB"},Ge=[50,100,500,1e3,2e3,5e3,1e4];function Te(e,t){const a=e.findIndex((e=>t<=e)),n=e[a-1]||1,s=e[a]||e[e.length-1];return a+(t-n)/(s-n)}function Be(e,t){const a=Math.floor(t),n=e[a-1]||1,s=n+((e[a]||e[e.length-1])-n)*(t-a);return Math.round(s)}const we=(0,n.ph)((({maxValue:e,defaultValue:t,className:a,onChange:s})=>{const r=(0,n.li)(null),i=(0,n.Kr)((()=>{const t=[];for(let a=0;a<Ge.length;a++)if(Ge[a]<e&&t.push(Ge[a]),Ge[a]>=e){t.push(e);break}return t}),[e]),[l,c]=(0,n.J0)(0);(0,Ne.A)((()=>{c(Te(i,t))}));const m=(0,d.A)((()=>{const e=r.current;if(!e)return;const t=e.parentElement;(0,ve.YS)((()=>{const a=t.offsetLeft+e.offsetWidth/2,n=t.offsetLeft+t.offsetWidth-e.offsetWidth/2;(0,ve.RK)((()=>{t.style.setProperty("--_min-x",`${a}px`),t.style.setProperty("--_max-x",`${n}px`)}))}))}));(0,be.A)(r,m);const u=(0,d.A)((e=>{const t=Number(e.currentTarget.value);c(t),s(Be(i,t))}));return n.Ay.createElement("div",{className:(0,o.A)(ke.root,a),style:"--progress: "+l/i.length},n.Ay.createElement("div",{className:ke.floatingBadgeWrapper},n.Ay.createElement("div",{className:ke.floatingBadge,ref:r},n.Ay.createElement("div",{className:ke.floatingBadgeText},n.Ay.createElement(w.A,{name:"star",className:ke.floatingBadgeIcon}),n.Ay.createElement(Ie.A,{text:(0,D.Sm)(Be(i,l))})),n.Ay.createElement("svg",{className:ke.floatingBadgeTriangle,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none"},n.Ay.createElement("defs",null,n.Ay.createElement("linearGradient",{id:"StarBadgeTriangle",x1:"0",x2:"1",y1:"0",y2:"0"},n.Ay.createElement("stop",{offset:"-50%","stop-color":"#FFAA00"}),n.Ay.createElement("stop",{offset:"150%","stop-color":"#FFCD3A"}))),n.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)"})))),n.Ay.createElement("div",{className:ke.progress}),n.Ay.createElement(Ce.A,{preset:"progress",className:ke.sparkles}),n.Ay.createElement("input",{className:ke.slider,type:"range",min:0,max:i.length,defaultValue:Te(i,t),step:"any",onChange:u}))})),Pe={avatarIcon:"author-hidden",customPeerAvatarColor:"#9eaab5",isCustomPeer:!0,titleKey:"StarsReactionAnonymous"},xe=(0,n.ph)((0,s.EK)(((e,{modal:t})=>{const a=t&&(0,i.hds)(e,t.chatId),n=t&&(0,i.O5q)(e,t.chatId,t.messageId),s=e.stars?.balance;return{chat:a,message:n,starBalance:s,maxAmount:e.appConfig?.paidReactionMaxAmount||2500,defaultPrivacy:e.settings.paidReactionPrivacy}}))((({modal:e,chat:t,message:a,maxAmount:o,starBalance:l,defaultPrivacy:m})=>{const{closePaidReactionModal:A,addLocalPaidReaction:h}=(0,s.ko)(),[g,S]=(0,n.J0)(50),[E,v,b]=(0,T.A)(),[I,C]=(0,n.J0)(!0),k=(0,u.A)(),G=(0,B.A)(),P=(0,d.A)((e=>{C(e.target.checked)})),x=(0,d.A)((e=>{S(e),v()}));(0,n.vJ)((()=>{e||b()}),[e]),(0,n.vJ)((()=>{const e=a?.reactions?.topReactors?.find((e=>e.isMe));C(e?!e.isAnonymous:m||!0)}),[m,a?.reactions?.topReactors]);const M=(0,d.A)((()=>{e&&(h({chatId:e.chatId,messageId:e.messageId,count:g,isPrivate:!I}),A())})),R=(0,n.Kr)((()=>{const e=(0,s.mS)(),t=a?.reactions?.topReactors;if(!t)return;const n=[];let r=!1;if(t.forEach((t=>{const a=t.peerId?(0,i.mBe)(e,t.peerId):void 0;(a||t.isAnonymous||t.isMe)&&(t.isMe&&(r=!0),n.push({amount:t.count,localAmount:t.isMe&&E?g:0,isMe:t.isMe,isAnonymous:t.isAnonymous,user:a}))})),!r&&E){const t=(0,i.mBe)(e,e.currentUserId);n.push({amount:0,localAmount:g,isMe:!0,user:t})}return n.sort(((e,t)=>t.amount+t.localAmount-(e.amount+e.localAmount))),n.slice(0,3)}),[E,a?.reactions?.topReactors,g]),O=t&&(0,r.JsG)(k,t);return n.Ay.createElement(f.A,{isOpen:Boolean(e),onClose:A,isSlim:!0,hasAbsoluteCloseButton:!0,contentClassName:"RdhRpsCn"},n.Ay.createElement(K,{balance:l,className:"Q3560fzx"}),n.Ay.createElement(we,{className:"xePPMXOI",defaultValue:50,maxValue:o,onChange:x}),n.Ay.createElement("h3",{className:"yzbjj73U"},k("StarsReactionTitle")),n.Ay.createElement("div",{className:"BlpfdOtK"},(0,c.A)(k("StarsReactionText",O),["simple_markdown","emoji"])),n.Ay.createElement(Ee.A,null,R&&n.Ay.createElement("div",{className:"bnou4CpV"},k("StarsReactionTopSenders"))),R&&n.Ay.createElement("div",{className:"QludQDKR"},R.map((e=>{const t=(0,D.Sm)(e.amount+e.localAmount),a=e.isAnonymous||!e.user||e.isMe&&!I?Pe:e.user,s="isCustomPeer"in a?k(a.titleKey):(0,r.YgS)(a);return n.Ay.createElement(ie.A,{className:"Ty4Ud_Rd",key:`${e.user?.id||"anonymous"}-${t}`,peer:a,badgeText:t,badgeIcon:"star",badgeClassName:"JBF9pTUK",text:s})}))),n.Ay.createElement(Se.A,{className:"oQ5Ar48z",checked:I,onChange:P,label:k("StarsReactionShowMeInTopSenders")}),n.Ay.createElement(y.A,{size:"smaller",onClick:M},G("SendPaidReaction",{amount:g},{withNodes:!0,specialReplacement:{[N.Cyx]:n.Ay.createElement(w.A,{className:"NJJFuym9",name:"star"})}})),n.Ay.createElement("p",{className:"KRvkHeo1"},G("StarsReactionTerms",{link:n.Ay.createElement(p.A,{text:G("StarsReactionLinkText"),url:G("StarsReactionLink")})},{withNodes:!0})))})));var Me=a(5912),Re=a(20333),Oe=a(75373),Le=a(22720),Ke=a(63152),Ue=a(94079);const De=(0,n.ph)((0,s.EK)(((e,{userId:t})=>{const a=(0,i.SJA)(e),{patternColor:n}=e.settings.themes[a]||{},s=(0,i.mBe)(e,t),r=(0,i.nTw)(e);return{user:s,patternColor:n,captionLimit:e.appConfig?.starGiftMaxMessageLength,currentUserId:e.currentUserId,isPaymentFormLoading:r.isPaymentFormLoading}}))((function({gift:e,userId:t,user:a,captionLimit:i,patternColor:c,currentUserId:m,isPaymentFormLoading:u}){const{sendStarGift:A,openInvoice:p}=(0,s.ko)(),f=(0,B.A)(),[h,g]=(0,n.J0)(""),[S,E]=(0,n.J0)(!1),v="id"in e,b=(0,n.Kr)((()=>v?{id:-1,chatId:m,isOutgoing:!1,senderId:m,date:Math.floor(Date.now()/1e3),content:{action:{targetUserIds:[t],mediaType:"action",text:"ActionGiftInbound",type:"starGift",currency:N.OUy,amount:e.stars,starGift:{message:h?.length?{text:h}:void 0,isNameHidden:S,starsToConvert:e.starsToConvert,isSaved:!1,isConverted:!1,gift:e},translationValues:["%action_origin%","%gift_payment_amount%"]}}}:{id:-1,chatId:"0",isOutgoing:!0,senderId:m,date:Math.floor(Date.now()/1e3),content:{action:{targetUserIds:[t],mediaType:"action",text:"ActionGiftInbound",type:"giftPremium",amount:e.amount,currency:e.currency,months:e.months,message:{text:h},translationValues:["%action_origin%","%gift_payment_amount%"]}}}),[m,e,h,v,S,t]),I=(0,d.A)((e=>{g(e.target.value)})),C=(0,d.A)((()=>{E(!S)})),k=(0,d.A)((()=>{v?A({userId:t,shouldHideName:S,gift:e,message:h?{text:h}:void 0}):p({type:"giftcode",userIds:[t],currency:e.currency,amount:e.amount,option:e,message:h?{text:h}:void 0})}));return n.Ay.createElement("div",{className:(0,o.A)("jKOG0It6","no-scroll")},n.Ay.createElement("div",{className:(0,o.A)("CB1mxsgp","MessageList"),inert:!0,style:`--pattern-color: ${c}`},n.Ay.createElement(Oe.A,{key:v?e.id:e.months,message:b})),function(){const e=i?i-h.length:void 0;return n.Ay.createElement("div",{className:"Y68CEIKn"},n.Ay.createElement(Ue.A,{className:"o5r2IPoA",onChange:I,value:h,label:f("GiftMessagePlaceholder"),maxLength:i,maxLengthIndicator:e&&e<50?e.toString():void 0}),v&&n.Ay.createElement(Le.A,{className:"zZUpGRSI",narrow:!0,ripple:!0,onClick:C},n.Ay.createElement("span",null,f("GiftHideMyName")),n.Ay.createElement(Ke.A,{checked:S,onChange:C,label:f("GiftHideMyName")})))}(),function(){const t=(0,r.YgS)(a),s=v?se(f,e.stars,!0):(0,l.v)(e.amount,e.currency);return n.Ay.createElement("div",{className:"jxWZSvet"},v&&n.Ay.createElement("div",{className:"nTPAv1ci"},f("GiftHideNameDescription",{profile:t,receiver:t})),n.Ay.createElement("div",{className:"ATowWJ60"}),v&&e.availabilityRemains&&n.Ay.createElement(Re.A,{isPrimary:!0,progress:e.availabilityRemains/e.availabilityTotal,rightText:f("GiftSoldCount",{count:e.availabilityTotal-e.availabilityRemains}),leftText:f("GiftLeftCount",{count:e.availabilityRemains}),className:"mWzLu0c0"}),n.Ay.createElement(y.A,{className:"IDuhjrne",onClick:k,isLoading:u},f("GiftSend",{amount:s},{withNodes:!0})))}())})));var ze=a(87049);const Fe="G1mBmzxs",Je="a8no5WH0",_e=(0,n.ph)((0,s.EK)(((e,{option:t})=>({sticker:(0,i.t0O)(e,t.months),canPlayAnimatedEmojis:(0,i.BWX)(e)})))((function({sticker:e,canPlayAnimatedEmojis:t,baseMonthAmount:a,option:s,onClick:r}){const{months:i,amount:o,currency:c}=s,m=(0,B.A)(),u=(0,d.A)((()=>{r(s)})),A=Math.floor(o/i),p=a&&a>A?Math.ceil(100-A/(a/100)):void 0;return n.Ay.createElement("div",{className:Fe,tabIndex:0,role:"button",onClick:u},n.Ay.createElement(ue.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 n.Ay.createElement("div",{className:"rn9aWFNA"},e)}(),n.Ay.createElement("div",{className:"q4_ydkAx"},m("PremiumGiftDescription")),n.Ay.createElement(y.A,{className:Je,nonInteractive:!0,size:"tiny",pill:!0,fluid:!0},(0,l.A)(o,c)),Boolean(p)&&n.Ay.createElement(ze.A,{color:"red",text:m("GiftDiscount",{percent:p})}))}))),He=(0,n.ph)((function({gift:e,observeIntersection:t,onClick:a}){const{openGiftInfoModal:r}=(0,s.ko)(),i=(0,n.li)(null),l=(0,B.A)(),[c,m]=(0,T.A)(),{stars:u,isLimited:A,isSoldOut:p,sticker:f}=e,h=(0,d.A)((()=>{p?r({gift:e}):a(e)}));return(0,Me.mv)(i,t,(e=>{e.isIntersecting&&m()})),n.Ay.createElement("div",{ref:i,className:(0,o.A)(Fe,"f5ArEO1S"),tabIndex:0,role:"button",onClick:h},n.Ay.createElement(ue.A,{sticker:f,noLoop:!0,play:c,nonInteractive:!0,size:90}),n.Ay.createElement(y.A,{className:Je,nonInteractive:!0,size:"tiny",color:"stars",withSparkleEffect:!0,pill:!0,fluid:!0},n.Ay.createElement(w.A,{name:"star",className:"DvJLTVFU"}),n.Ay.createElement("div",{className:"sbo2dMcH"},u)),A&&!p&&n.Ay.createElement(ze.A,{color:"blue",text:l("GiftLimited")}),p&&n.Ay.createElement(ze.A,{color:"red",text:l("GiftSoldOut")}))}));var Ve=a(36838);const We=(0,n.ph)((0,s.EK)((e=>{const{starGiftCategoriesByName:t}=e;return{starGiftCategoriesByName:t}}))((({starGiftCategoriesByName:e,onCategoryChanged:t})=>{const a=(0,n.li)(null),s=(0,B.A)(),r=(0,n.Kr)((()=>Object.keys(e).filter((e=>"all"!==e&&"limited"!==e)).map(Number).sort(((e,t)=>e-t))),[e]),[i,l]=(0,n.J0)("all");function c(e){return n.Ay.createElement("div",{className:(0,o.A)("dO7FKYY4",i===e&&"B2lEJk1v"),onClick:()=>function(e){l(e),t(e)}(e)},Number.isInteger(e)&&n.Ay.createElement(P.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,Ve.A)(a,void 0,!0),n.Ay.createElement("div",{ref:a,className:(0,o.A)("cUjwvN00","no-scrollbar")},c("all"),c("stock"),c("limited"),r.map(c))}))),je={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"},qe=(0,n.ph)((0,s.EK)(((e,{modal:t})=>{const{starGiftsById:a,starGiftCategoriesByName:n,stars:s,currentUserId:r}=e,o=t?.forUserId?(0,i.mBe)(e,t.forUserId):void 0,l=Boolean(r&&t?.forUserId===r);return{boostPerSentGift:e.appConfig?.boostsPerSentGift,starGiftsById:a,starGiftCategoriesByName:n,starBalance:s?.balance,user:o,isSelf:l}}))((({modal:e,starGiftsById:t,starGiftCategoriesByName:a,starBalance:i,user:l,isSelf:c})=>{const{closeGiftModal:h,requestConfetti:g}=(0,s.ko)(),S=(0,n.li)(null),v=(0,n.li)(null),N=(0,n.li)(null),b=(0,n.li)(null),I=Boolean(e),C=(0,m.A)(e),[k,G]=(0,n.J0)(),[T,w]=(0,n.J0)(!0),[P,x]=(0,n.J0)(!1),[M,O]=(0,n.J0)("all"),L=(0,u.A)(),U=(0,B.A)(),D=(0,n.Kr)((()=>C?.gifts?.sort(((e,t)=>e.months-t.months)).filter((e=>1===e.users))),[C]),z=(0,n.Kr)((()=>D?.reduce(((e,t)=>e.amount<t.amount?e:t))),[D]),{observe:F}=(0,Me.BL)({rootRef:b,throttleMs:200,isDisabled:!I}),J=(0,d.A)((()=>{const e=S.current;if(e&&I){const{top:t,left:a,width:n,height:s}=e.querySelector(".modal-content").getBoundingClientRect();g({top:t,left:a,width:n,height:s,withStars:!0})}}));(0,n.vJ)((()=>{C?.isCompleted&&J()}),[C]),(0,n.vJ)((()=>{I||(w(!0),G(void 0))}),[I]);const _=(0,d.A)((e=>{if(k)return;const{scrollTop:t}=e.currentTarget;if(w(t<=150),v.current&&N.current){const{top:e}=N.current.getBoundingClientRect(),{top:t}=v.current.getBoundingClientRect();x(e-t<=0)}})),H=U("GiftPremiumDescription",{user:(0,r.YgS)(l),link:n.Ay.createElement(p.A,{text:U("GiftPremiumDescriptionLinkCaption"),url:U("GiftPremiumDescriptionLink")})},{withNodes:!0}),V=c?U("StarGiftDescriptionSelf",void 0,{withNodes:!0,renderTextFilters:["br"]}):U("StarGiftDescription",{user:(0,r.YgS)(l)},{withNodes:!0,withMarkdown:!0}),W=(0,d.A)((e=>{G(e),x("id"in e),w(!1)})),j=(0,d.A)((e=>{O(e)})),q=(0,d.A)((()=>{k?G(void 0):h()})),Y=Boolean(k),Q=(0,o.A)("animated-close-icon",Y&&"state-back");return n.Ay.createElement(f.A,{dialogRef:S,onClose:h,isOpen:I,isSlim:!0,contentClassName:je.content,className:(0,o.A)(je.modalDialog,je.root)},n.Ay.createElement(y.A,{className:je.closeButton,round:!0,color:"translucent",size:"smaller",onClick:q,ariaLabel:L(Y?"Common.Back":"Common.Close")},n.Ay.createElement("div",{className:Q})),n.Ay.createElement(K,{className:je.balance,balance:i}),n.Ay.createElement("div",{className:(0,o.A)(je.header,T&&je.hiddenHeader)},n.Ay.createElement(R.Ay,{name:"slideVerticalFade",activeKey:Number(P),slideClassName:je.headerSlide},n.Ay.createElement("h2",{className:je.commonHeaderText},U(P?c?"StarsGiftHeaderSelf":"StarsGiftHeader":"GiftPremiumHeader")))),n.Ay.createElement(R.Ay,{ref:v,className:je.transition,name:"pushSlide",activeKey:k?1:0},!k&&n.Ay.createElement("div",{ref:b,className:(0,o.A)(je.main,"custom-scroll"),onScroll:_},n.Ay.createElement("div",{className:je.avatars},n.Ay.createElement(A.A,{size:100,peer:l}),n.Ay.createElement("img",{className:je.logoBackground,src:E,alt:"",draggable:!1})),!c&&n.Ay.createElement("h2",{className:(0,o.A)(je.headerText,je.center)},U("GiftPremiumHeader")),!c&&n.Ay.createElement("p",{className:(0,o.A)(je.description,je.center)},H),!c&&n.Ay.createElement("div",{className:je.premiumGiftsGallery},D?.map((e=>n.Ay.createElement(_e,{option:e,baseMonthAmount:z?Math.floor(z.amount/z.months):void 0,onClick:W})))),n.Ay.createElement("h2",{ref:N,className:(0,o.A)(je.headerText,je.center)},U(c?"StarsGiftHeaderSelf":"StarsGiftHeader")),n.Ay.createElement("p",{className:(0,o.A)(je.description,je.starGiftsDescription,je.center)},V),n.Ay.createElement(We,{onCategoryChanged:j}),n.Ay.createElement(R.Ay,{name:"zoomFade",activeKey:(X=M,"all"===X?-2:"stock"===X?-1:"limited"===X?0:X),className:je.starGiftsTransition},n.Ay.createElement("div",{className:je.starGiftsContainer},t&&a[M].map((e=>{const a=t[e];return n.Ay.createElement(He,{gift:a,observeIntersection:F,onClick:W})}))))),k&&C?.forUserId&&n.Ay.createElement(De,{gift:k,userId:C.forUserId})));var X})));const Ye=(0,n.ph)((0,s.EK)((e=>{const{currentUserId:t}=e;return{currentUserId:t,userIds:e.contactList?.userIds,userSelectionLimit:e.appConfig?.giveawayAddPeersMax}}))((({modal:e,currentUserId:t,userIds:a})=>{const{closeGiftRecipientPicker:i,openGiftModal:o}=(0,s.ko)(),l=(0,u.A)(),c=e,[m,A]=(0,n.J0)(""),p=(0,n.Kr)((()=>{const e=(0,s.mS)().users.byId,n=a?a.concat(t):void 0,i=n?(0,r.Z$K)(n,e,m):[];return(0,I.A)((0,b.Am)(i).filter((t=>{const a=e[t];return!a||!(0,r.tvf)(a)})),void 0,[t])}),[t,m,a]),y=(0,d.A)((e=>{o({forUserId:e}),i()}));return n.Ay.createElement(k.A,{className:"W3JMs1YE",isOpen:c,onClose:i,title:l("GiftTelegramPremiumOrStarsTitle"),hasCloseButton:!0,shouldAdaptToSearch:!0,withFixedHeight:!0},n.Ay.createElement(C.A,{className:"wOipz1Y_",itemIds:p,filterValue:m,filterPlaceholder:l("Search"),onSelectedIdChange:y,onFilterChange:A,isSearchable:!0,withDefaultPadding:!0,withStatus:!0,forceShowSelf:!0}))})));var Qe=a(95807),Xe=a(80140),Ze=a(18501),$e=a(81949),et=a(40558),tt=a(94189),at=a(96530);const nt={modal:"nnublcCk",header:"p7FTs7_p",amount:"zJS3I8BT",title:"pIbzzTir",description:"CCPfr26t",soldOut:"kjWcRp4W",footerDescription:"VUylTszM",unknown:"zDauXmpS",giftValue:"w_E4LkUj",radialPattern:"FTlUxUWm",uniqueAttribute:"OJQnkf17",uniqueGift:"I6o_pGAm",giftSticker:"iUDfJgbB"},st=(0,n.ph)((0,s.EK)(((e,{modal:t})=>{const a=t?.gift,n=a&&"gift"in a&&a.fromId;return{userFrom:n?(0,i.mBe)(e,n):void 0,targetUser:t?.userId?(0,i.mBe)(e,t.userId):void 0,currentUserId:e.currentUserId,starGiftMaxConvertPeriod:e.appConfig?.starGiftMaxConvertPeriod}}))((({modal:e,userFrom:t,targetUser:a,currentUserId:l,starGiftMaxConvertPeriod:c})=>{const{closeGiftInfoModal:p,changeGiftVisilibity:f,convertGiftToStars:h,openChatWithInfo:g}=(0,s.ko)(),[S,E,v]=(0,T.A)(),N=(0,B.A)(),b=(0,u.A)(),I=Boolean(e),C=(0,m.A)(e),{gift:k}=C||{},G=k&&"gift"in k,w=G?k:void 0,x=Boolean(w?.messageId),M=w?.fromId===l,R=w&&c&&w.date+c-(0,Xe.Fm)()||0,O=Math.ceil(R/60/60/24),L=G?k.gift:k,K=L&&(0,de.yQ)(L),z=(0,d.A)((()=>{p()})),F=(0,d.A)((()=>{const{fromId:e,messageId:t,isUnsaved:a}=w;f({userId:e,messageId:t,shouldUnsave:!a}),z()})),J=(0,d.A)((()=>{const{fromId:e,messageId:t}=w;h({userId:e,messageId:t}),v(),z()})),H=(0,d.A)((()=>{g({id:l,profileTab:"gifts"}),z()})),V=(0,n.Kr)((()=>L&&(0,de.uc)(L)),[L]),W=(0,n.Kr)((()=>{const{backdrop:e,pattern:t}=V||{};if(!e||!t||!I)return;const a=[e.centerColor,e.edgeColor],s=e.patternColor;return n.Ay.createElement(et.A,{className:nt.radialPattern,backgroundColors:a,patternColor:s,patternIcon:t.sticker})}),[V,I]),j=(0,n.Kr)((()=>{if(!k||!L)return;const{fromId:e,isNameHidden:t,starsToConvert:l,isUnsaved:c,isConverted:m}=w||{},d=t&&a,u="starGiftUnique"===L.type?N("GiftInfoCollectible",{number:L.number}):w?!x&&!M||!l||R<0?void 0:m?x?N("GiftInfoDescriptionConverted",{amount:(0,D.Sm)(l)},{pluralValue:l,withNodes:!0,withMarkdown:!0}):N("GiftInfoDescriptionOutConverted",{amount:(0,D.Sm)(l),user:(0,r.YgS)(a)},{pluralValue:l,withNodes:!0,withMarkdown:!0}):x?N("GiftInfoDescription",{amount:l},{withNodes:!0,withMarkdown:!0,pluralValue:l}):N("GiftInfoDescriptionOut",{amount:l,user:(0,r.YgS)(a)},{withNodes:!0,withMarkdown:!0,pluralValue:l}):N("GiftInfoSoldOutDescription"),f=V?.backdrop?.textColor,h=n.Ay.createElement("div",{className:(0,o.A)(nt.header,W&&nt.uniqueGift),style:(0,Qe.A)(f&&`--_color-description: ${f}`)},W,n.Ay.createElement(ue.A,{className:nt.giftSticker,sticker:K,noLoop:!0,nonInteractive:!0,size:120}),n.Ay.createElement("h1",{className:nt.title},"starGiftUnique"===L?.type?L.title:N(w?x?"GiftInfoReceived":"GiftInfoTitle":"GiftInfoSoldOutTitle")),"starGift"===L.type&&n.Ay.createElement("p",{className:nt.amount},n.Ay.createElement("span",{className:nt.amount},(0,D.Sm)(L.stars)),n.Ay.createElement(P.A,{type:"gold",size:"middle"})),u&&n.Ay.createElement("p",{className:(0,o.A)(nt.description,!w&&"starGift"===L?.type&&nt.soldOut)},u)),S=[];if("starGift"===L.type&&((e||t)&&S.push([N("GiftInfoFrom"),e?{chatId:e}:n.Ay.createElement(n.Ay.Fragment,null,n.Ay.createElement(A.A,{size:"small",peer:_.I5}),n.Ay.createElement("span",{className:nt.unknown},b(_.I5.titleKey)))]),w?.date&&S.push([N("GiftInfoDate"),(0,U.L2)(1e3*w.date,N.code,!0)]),L.firstSaleDate&&S.push([N("GiftInfoFirstSale"),(0,U.L2)(1e3*L.firstSaleDate,N.code,!0)]),L.lastSaleDate&&S.push([N("GiftInfoLastSale"),(0,U.L2)(1e3*L.lastSaleDate,N.code,!0)]),S.push([N("GiftInfoValue"),n.Ay.createElement("div",{className:nt.giftValue},se(N,L.stars),x&&R>0&&Boolean(l)&&n.Ay.createElement($e.A,{onClick:E},N("GiftInfoConvert",{amount:l},{pluralValue:l})))]),L.availabilityTotal&&S.push([N("GiftInfoAvailability"),N("GiftInfoAvailabilityValue",{count:L.availabilityRemains||0,total:L.availabilityTotal},{pluralValue:L.availabilityRemains||0})]),L.upgradeStars&&S.push([N("GiftInfoStatus"),N("GiftInfoStatusNonUnique")]),w?.message&&S.push([void 0,(0,Ze.f)(w.message)])),"starGiftUnique"===L.type){const{model:e,backdrop:t,pattern:a,originalDetails:o}=V||{};if(S.push([N("GiftInfoOwner"),{chatId:L.ownerId}]),e&&S.push([N("GiftAttributeModel"),n.Ay.createElement("span",{className:nt.uniqueAttribute},e.name,n.Ay.createElement($e.A,null,(0,D.l9)(e.rarityPercent)))]),t&&S.push([N("GiftAttributeBackdrop"),n.Ay.createElement("span",{className:nt.uniqueAttribute},t.name,n.Ay.createElement($e.A,null,(0,D.l9)(t.rarityPercent)))]),a&&S.push([N("GiftAttributeSymbol"),n.Ay.createElement("span",{className:nt.uniqueAttribute},a.name,n.Ay.createElement($e.A,null,(0,D.l9)(a.rarityPercent)))]),S.push([N("GiftInfoAvailability"),N("GiftInfoIssued",{issued:L.issuedCount,total:L.totalCount})]),o){const{date:e,recipientId:t,message:a,senderId:l}=o,c=(0,s.mS)(),m=e=>{g({id:e}),p()},d=(0,i.mBe)(c,t),u=l?(0,i.mBe)(c,l):void 0,A=(0,U.L2)(1e3*e,N.code,!0),y=n.Ay.createElement(at.A,{onClick:()=>m(t),isPrimary:!0},(0,r.YgS)(d));let f;if(u&&l!==t){const e=n.Ay.createElement(at.A,{onClick:()=>m(u.id),isPrimary:!0},(0,r.YgS)(u));f=a?N("GiftInfoOriginalInfoTextSender",{user:y,sender:e,text:(0,Ze.f)(a),date:A},{withNodes:!0}):N("GiftInfoOriginalInfoSender",{user:y,date:A,sender:e},{withNodes:!0})}else f=a?N("GiftInfoOriginalInfoText",{user:y,text:(0,Ze.f)(a),date:A},{withNodes:!0}):N("GiftInfoOriginalInfo",{user:y,date:A},{withNodes:!0});S.push([void 0,n.Ay.createElement("span",null,f)])}}return{header:h,tableData:S,footer:n.Ay.createElement("div",{className:nt.footer},x&&n.Ay.createElement("div",{className:nt.footerDescription},n.Ay.createElement("div",null,c?N("GiftInfoHidden"):N("GiftInfoSaved",{link:n.Ay.createElement(at.A,{isPrimary:!0,onClick:H},N("GiftInfoSavedView"))},{withNodes:!0})),d&&n.Ay.createElement("div",null,N("GiftInfoSenderHidden"))),!x&&n.Ay.createElement(y.A,{size:"smaller",onClick:z},N("OK")),x&&n.Ay.createElement(y.A,{size:"smaller",onClick:F},N(c?"GiftInfoMakeVisible":"GiftInfoMakeInvisible")))}}),[k,w,a,K,N,x,R,M,b,L,W,V]);return n.Ay.createElement(n.Ay.Fragment,null,n.Ay.createElement(Ae.A,{isOpen:I,header:j?.header,hasBackdrop:Boolean(W),tableData:j?.tableData,footer:j?.footer,className:nt.modal,onClose:z}),w&&n.Ay.createElement(tt.A,{isOpen:S,onClose:v,confirmHandler:J,title:N("GiftInfoConvertTitle")},n.Ay.createElement("div",null,N("GiftInfoConvertDescription1",{amount:ne(N,w.starsToConvert),user:(0,r.YgS)(t)},{withNodes:!0,withMarkdown:!0})),R>0&&n.Ay.createElement("div",null,N("GiftInfoConvertDescriptionPeriod",{count:O},{withNodes:!0,withMarkdown:!0,pluralValue:O})),n.Ay.createElement("div",null,N("GiftInfoConvertDescription2"))))})))},81949:(e,t,a)=>{a.d(t,{A:()=>r});var n=a(84051),s=a(87357);const r=({children:e,className:t,onClick:a})=>n.Ay.createElement("div",{className:(0,s.A)("hJUqHi4B",a&&"hjDEmFaT",t),onClick:a},e)},84991:(e,t,a)=>{a.d(t,{A:()=>l});var n=a(84051),s=a(87357),r=a(21849),i=a(18276);const o={root:"hyRfEyRz",top:"p_Ny8jqJ",badge:"QRrryqp4",text:"I5jdPgFL"},l=(0,n.ph)((({peer:e,avatarWebPhoto:t,avatarSize:a,text:l,badgeText:c,badgeIcon:m,className:d,badgeClassName:u,badgeIconClassName:A,textClassName:p,onClick:y})=>n.Ay.createElement("div",{className:(0,s.A)(o.root,y&&o.clickable,d),onClick:y},n.Ay.createElement("div",{className:o.top},n.Ay.createElement(r.A,{size:a,peer:e,webPhoto:t}),c&&n.Ay.createElement("div",{className:(0,s.A)(o.badge,u)},m&&n.Ay.createElement(i.A,{name:m,className:A}),c)),l&&n.Ay.createElement("p",{className:(0,s.A)(o.text,p)},l))))},34642:(e,t,a)=>{a.d(t,{A:()=>c});var n=a(84051),s=a(87357),r=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 n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},l.apply(this,arguments)}const c=(0,n.ph)((({confirmButtonText:e,isConfirmDisabled:t,shouldAdaptToSearch:a,withFixedHeight:c,onConfirm:m,withPremiumGradient:d,...u})=>{const A=(0,r.A)(),p=Boolean(e||m);return n.Ay.createElement(o.A,l({},u,{isSlim:!0,className:(0,s.A)(a&&"WGSZ8u75",c&&"CrEsDylb",u.className),contentClassName:(0,s.A)("FuFYE0AA",u.contentClassName),headerClassName:(0,s.A)("iEptOmIp",u.headerClassName)}),u.children,p&&n.Ay.createElement("div",{className:"HqeDTaSr"},n.Ay.createElement(i.A,{withPremiumGradient:d,onClick:m||u.onClose,color:"primary",size:"smaller",disabled:t},e||A("Confirm"))))}))},70046:(e,t,a)=>{a.d(t,{A:()=>u});var n=a(84051),s=a(13439),r=a(87357),i=a(17712),o=a(21849),l=a(10187),c=a(64493),m=a(8410);const d="Cnh5ENvm",u=(0,n.ph)((({isOpen:e,title:t,tableData:a,headerAvatarPeer:u,header:A,footer:p,buttonText:y,className:f,hasBackdrop:h,onClose:g,onButtonClick:S})=>{const{openChat:E}=(0,s.ko)(),v=(0,i.A)((e=>{E({id:e}),g()}));return n.Ay.createElement(m.A,{isOpen:e,hasCloseButton:Boolean(t),hasAbsoluteCloseButton:!t,absoluteCloseButtonColor:h?"translucent-white":void 0,isSlim:!0,title:t,className:f,contentClassName:"KYHkJ9Qf",onClose:g},u&&n.Ay.createElement(o.A,{peer:u,size:"jumbo",className:"SHQbPR5Y"}),A,n.Ay.createElement("div",{className:"DFRB0Ad4"},a?.map((([e,t])=>n.Ay.createElement(n.Ay.Fragment,null,e&&n.Ay.createElement("div",{className:(0,r.A)(d,"AwnUe4Qk")},e),n.Ay.createElement("div",{className:(0,r.A)(d,"JGH6P9Az",!e&&"UssCZwgy")},"object"==typeof t&&"chatId"in t?n.Ay.createElement(l.A,{peerId:t.chatId,className:"aS9U4hiQ",forceShowSelf:!0,fluid:!0,withEmojiStatus:t.withEmojiStatus,clickArg:t.chatId,onClick:v}):t))))),p,y&&n.Ay.createElement(c.A,{className:p?void 0:"cSamlkt9",size:"smaller",onClick:S||g},y))}))},1526:(e,t,a)=>{a.d(t,{A:()=>y});var n=a(84051),s=a(87357),r=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"},y=(0,n.ph)((({isActive:e,className:t,options:a,selectedStarOption:y,selectedStarCount:f,starsNeeded:h,onClick:g})=>{const S=(0,m.A)(),E=(0,c.A)(),[v,N,b]=(0,l.A)();(0,n.vJ)((()=>{e||b()}),[e]);const[I,C]=(0,n.Kr)((()=>{if(!a)return[void 0,!1];const e=a.reduce(((e,t)=>e.stars>t.stars?e:t)),t=h&&e.stars<h,n=[];let s=0,r=!1;return a.forEach(((e,i)=>{e.isExtended||s++,h&&!t&&e.stars<h||(v||!e.isExtended?n.push({option:e,starsCount:Math.min(s,6),isWide:i===a.length-1}):r=!0)})),[n,r]}),[v,a,h]);return n.Ay.createElement("div",{className:(0,s.A)(p.options,t)},I?.map((({option:e,starsCount:t,isWide:a})=>{const l=I?.length,c=l%2==0,m=e===y;let d;if(e&&"winners"in e){const t=e.winners.find((e=>e.users===f))||e.winners.reduce(((e,t)=>t.users>e.users?t:e),e.winners[0]);d=t?.perUserStars}return n.Ay.createElement("div",{className:(0,s.A)(p.option,!c&&a&&p.wideOption,m&&p.active),key:e.stars,onClick:()=>g?.(e)},n.Ay.createElement("div",{className:p.optionTop},"+",(0,i.Sm)(e.stars),n.Ay.createElement("div",{className:p.stackedStars,dir:E.isRtl?"ltr":"rtl"},Array.from({length:t}).map((()=>n.Ay.createElement(u.A,{className:p.stackedStar,type:"gold",size:"big"}))))),n.Ay.createElement("div",{className:p.optionBottom},(0,r.v)(e.amount,e.currency,S.code)),(m||y&&"winners"in y)&&d&&n.Ay.createElement("div",{className:p.optionBottom},n.Ay.createElement("div",{className:p.perUserStars},(0,o.A)(S("BoostGift.Stars.PerUser",(0,i.Sm)(d))))))})),!v&&C&&n.Ay.createElement(A.A,{className:p.moreOptions,isText:!0,noForcedUpperCase:!0,onClick:N},S("Stars.Purchase.ShowMore"),n.Ay.createElement(d.A,{className:p.iconDown,name:"down"})))}))}}]);
//# sourceMappingURL=6930.204bdfa0d1faa2f49d6c.js.map