TelegramPWA/dist/6930.a27d6db10bc54eaebe5d.js
Alexander Zinchuk 98807061ed [Build]
2025-01-21 20:11:19 +01:00

2 lines
60 KiB
JavaScript

"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[6930],{34339:(e,t,a)=>{a.r(t),a.d(t,{GiftInfoModal:()=>ct,GiftModal:()=>at,GiftRecipientPicker:()=>rt,GiftUpgradeModal:()=>yt,PaidReactionModal:()=>De,StarPaymentModal:()=>de,StarsBalanceModal:()=>se,StarsGiftModal:()=>b,StarsGiftingPickerModal:()=>T,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),y=a(56440),f=a(64493),g=a(8410),h=a(1526);const S={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"},E=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),I=Boolean(e?.isOpen),C=(0,m.A)(e),k=(0,u.A)(),[G,T]=(0,r.J0)(),[B,w]=(0,r.J0)(!0);(0,r.vJ)((()=>{I||w(!0)}),[I]);const M=(0,d.A)((()=>{const e=N.current;if(e&&I){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)((()=>{C?.isCompleted&&M()}),[C,M]);const P=(0,d.A)((e=>{C&&(T(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(y.A,{url:k("StarsTOSLink"),text:k("lng_credits_summary_options_about_link")}),e[1]]}),[k]);return r.Ay.createElement(g.A,{className:(0,o.A)(S.modalDialog),contentClassName:S.content,dialogRef:N,isSlim:!0,onClose:x,isOpen:I},r.Ay.createElement("div",{className:(0,o.A)(S.main,"custom-scroll"),onScroll:function(e){const{scrollTop:t}=e.currentTarget;w(t<=150)}},r.Ay.createElement(f.A,{round:!0,size:"smaller",className:S.closeButton,color:"translucent",onClick:()=>a(),ariaLabel:k("Close")},r.Ay.createElement(p.A,{name:"close"})),r.Ay.createElement("div",{className:(0,o.A)(S.header,B&&S.hiddenHeader)},r.Ay.createElement("h2",{className:S.starHeaderText},k(t?"GiftStarsTitle":"Star.List.GetStars"))),r.Ay.createElement("div",{className:S.headerInfo},t?r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement(A.A,{size:100,peer:t,className:S.avatar}),r.Ay.createElement("img",{className:S.logoBackground,src:v,alt:"",draggable:!1})):r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement("img",{className:S.logo,src:E,alt:"",draggable:!1}),r.Ay.createElement("img",{className:S.logoBackground,src:v,alt:"",draggable:!1}))),r.Ay.createElement("h2",{className:(0,o.A)(S.headerText,S.center)},C?.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:S.description},t?(0,c.A)(k("ActionGiftStarsSubtitle",(0,s.F9N)(k,t)),["simple_markdown"]):k("Stars.Purchase.GetStarsInfo")),r.Ay.createElement("div",{className:S.section},r.Ay.createElement(h.A,{options:C?.starsGiftOptions,onClick:P}),r.Ay.createElement("div",{className:S.secondaryInfo},U))))})));var N=a(31481),I=a(87894),C=a(79582),k=a(54960),G=a(34642);const T=(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)(""),y=(0,r.Kr)((()=>{const e=(0,n.mS)().users.byId,r=[...o||[],...a||[],...i||[]],l=(0,s.Z$K)(r,e,A);return(0,C.A)((0,I.Am)(l).filter((a=>{const r=e[a];return!(!r||r.isSupport||(0,s.tvf)(r)||(0,s.PL2)(r)||a===t||a===N.zv8)})))}),[t,A,o,a,i]),f=(0,d.A)((e=>{e?.length&&(c({forUserId:e}),l())}));return r.Ay.createElement(G.A,{className:"s3k01dTm",isOpen:e,onClose:l,title:m("GiftStarsTitle"),hasCloseButton:!0,shouldAdaptToSearch:!0,withFixedHeight:!0,confirmButtonText:m("Continue"),onEnter:l},r.Ay.createElement(k.A,{className:"cuI2eDIY",itemIds:y,filterValue:A,filterPlaceholder:m("Search"),onFilterChange:p,isSearchable:!0,withDefaultPadding:!0,withStatus:!0,onSelectedIdChange:f}))})));var B=a(37661),w=a(39351),M=a(9267),P=a(46222),x=a(24680),U=a(41036),R=a(86046);const D={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"},O=(0,r.ph)((({balance:e,className:t})=>{const a=(0,w.A)();return r.Ay.createElement("div",{className:(0,o.A)(D.balance,t)},r.Ay.createElement("span",{className:D.smallerText},a("StarsBalance")),r.Ay.createElement("div",{className:D.balanceBottom},r.Ay.createElement(M.A,{type:"gold",size:"middle"}),void 0!==e?(0,R.ZF)(a,e):"…"))}));var L=a(17663),K=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,r.ph)((({subscription:e})=>{const{openStarsSubscriptionModal:t}=(0,n.ko)(),{peerId:a,pricing:o,until:l,isCancelled:m,title:p,photo:y}=e,f=(0,u.A)(),g=(0,z.A)(function(e){return t=>(0,i.PVB)(t,e)}(a)),h=(0,d.A)((()=>{t({subscription:e})}));if(!g)return;const S=l<Date.now()/1e3,E=(0,L.A)(1e3*l,f.code,!0,"long");return r.Ay.createElement("div",{className:F.root,onClick:h},r.Ay.createElement("div",{className:F.preview},r.Ay.createElement(A.A,{size:"medium",peer:g}),r.Ay.createElement(M.A,{className:F.subscriptionStar,type:"gold",size:"small"})),r.Ay.createElement("div",{className:F.info},r.Ay.createElement("h3",{className:F.title},(0,c.A)((0,s.F9N)(f,g)||"")),p&&r.Ay.createElement("p",{className:F.subtitle},y&&r.Ay.createElement(A.A,{webPhoto:y,size:"micro"}),(0,c.A)(p)),r.Ay.createElement("p",{className:F.description},f(S?"StarsSubscriptionExpired":m?"StarsSubscriptionExpires":"StarsSubscriptionRenews",E))),r.Ay.createElement("div",{className:F.status},m||S?r.Ay.createElement("div",{className:F.statusEnded},f(S?"StarsSubscriptionStatusExpired":"StarsSubscriptionStatusCancelled")):r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement("div",{className:F.statusPricing},r.Ay.createElement(M.A,{className:F.star,type:"gold",size:"adaptive"}),r.Ay.createElement("span",{className:F.amount},(0,K.Sm)(o.amount))),r.Ay.createElement("div",{className:F.statusPeriod},f("StarsParticipantSubscriptionPerMonth")))))}));var _=a(58968),H=a(66833);function q(e,t){if(t.starRefCommision)return e("StarTransactionCommission",(0,K.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,R.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(79577),j=a(40558),Y=a(62587),Q=a(27860);const X={root:"jQkp75Gb",preview:"OYGSN3PF",count:"KX1yz2Jy",thumb:"EvinKr5k",noOutline:"KSAAsUDv",itemCount1:"GxDajfX_",itemCount2:"jXuZoxq8",itemCount3:"TPn3XGHJ",blurry:"hWZuxLS8",full:"w56QPFhl",fadeIn:"ds43W8Wq"};function Z({boughtMedia:e,index:t,className:a}){const n=e.video||e.photo,i=(0,s.VOI)(n,"pictogram"),l=(0,s.VDY)(n),c=(0,Y.A)(i);return r.Ay.createElement("div",{className:(0,o.A)(X.thumb,void 0!==t&&`stars-transaction-media-${t}`,a)},l&&r.Ay.createElement("img",{className:X.blurry,src:l,alt:""}),c&&r.Ay.createElement("img",{className:X.full,src:c,alt:""}))}const $=(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)(X.root,X[`itemCount${s}`],a&&X.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(Q.A,{className:X.thumb,isVisible:!0,width:e.width,height:e.height,thumbDataUri:e.thumbnail?.dataUri}):r.Ay.createElement(Z,{className:(0,o.A)(a&&s>0&&X.noOutline),boughtMedia:e,index:s})})),i&&r.Ay.createElement("div",{className:X.count},r.Ay.createElement(p.A,{name:"stars-lock"}),e.length>1?e.length:""))})),ee={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",uniqueGift:"QsvgfDmw"},te=(0,r.ph)((({transaction:e,className:t})=>{const{openStarsTransactionModal:a}=(0,n.ko)(),{date:l,stars:m,photo:p,peer:y,extendedMedia:f,subscriptionPeriod:g}=e,h=(0,w.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)),b="starGiftUnique"===e.starGift?.type?e.starGift:void 0,N=b&&(0,H.yQ)(b),I=(0,r.Kr)((()=>{let t,a,r,n=q(S,e);if("peer"===e.peer.type)t=v&&(0,s.F9N)(S,v),r=v||_.lw;else{const a=(0,R.Pc)(e.peer);n=a.title||S(a.titleKey),t=S(a.subtitleKey),r=a}return e.isGiftUpgrade&&"starGiftUnique"===e.starGift?.type&&(t=e.starGift.title),e.photo&&(r=void 0),e.isRefund&&(a=S("StarsRefunded")),e.hasFailed&&(a=S("StarsFailed")),e.isPending&&(a=S("StarsPending")),{title:n,description:t,avatarPeer:r,status:a}}),[S,v,e]),C=(0,r.Kr)((()=>{if(N){const{backdrop:e}=(0,H.uc)(b),t=[e.centerColor,e.edgeColor];return r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement(j.A,{className:ee.uniqueGiftBackground,backgroundColors:t}),r.Ay.createElement(W.A,{className:ee.uniqueGift,sticker:N,size:36,play:!1}))}return f?r.Ay.createElement($,{media:f,isTransactionPreview:!0}):r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement(A.A,{size:"medium",webPhoto:p,peer:I.avatarPeer}),Boolean(g)&&r.Ay.createElement(M.A,{className:ee.subscriptionStar,type:"gold",size:"small"}))}),[f,p,N,g,I.avatarPeer,b]),k=(0,d.A)((()=>{a({transaction:e})}));return r.Ay.createElement("div",{className:(0,o.A)(ee.root,t),onClick:k},r.Ay.createElement("div",{className:ee.preview},C),r.Ay.createElement("div",{className:ee.info},r.Ay.createElement("h3",{className:ee.title},I.title),I.description&&r.Ay.createElement("p",{className:ee.description},(0,c.A)(I.description)),r.Ay.createElement("p",{className:ee.date},(0,L.L2)(1e3*l,S.code,!0),I.status&&` — (${I.status})`)),r.Ay.createElement("div",{className:ee.stars},r.Ay.createElement("span",{className:(0,o.A)(ee.amount,V(m)?ee.negative:ee.positive)},(0,R.hk)(h,m)),r.Ay.createElement(M.A,{className:ee.star,type:"gold",size:"adaptive"})))})),ae=["all","inbound","outbound"],re=["StarsTransactionsAll","StarsTransactionsIncoming","StarsTransactionsOutgoing"],ne="StarsTransactionItem",se=(0,r.ph)((0,n.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:S,openInvoice:b}=(0,n.ko)(),{balance:N,history:I,subscriptions:C}=t||{},k=(0,u.A)(),G=(0,w.A)(),[T,R]=(0,r.J0)(!0),[L,K]=(0,r.J0)(0),[z,F,_]=(0,B.A)(),H=Boolean(e&&t),{originStarsPayment:q,originReaction:V,originGift:W,topup:j}=e||{},Y=q||V||W||j,Q=q?.form?.invoice?.totalAmount||q?.subscriptionInfo?.subscriptionPricing?.amount||V?.amount||W?.gift.stars||j?.balanceNeeded,X=Q?Q-(N?.amount||0):void 0,Z=(0,r.Kr)((()=>{const e=(0,n.mS)();if(V){const t=(0,i.hds)(e,V.chatId);if(!t)return;return k("StarsNeededTextReactions",(0,s.JsG)(k,t))}if(q){const t=q.form?.botId?(0,i.mBe)(e,q.form.botId):void 0;if(!t)return;return k("StarsNeededText",(0,s.YgS)(t))}if(W){const t=(0,i.mBe)(e,W.userId);if(!t)return;return k("StarsNeededTextGift",(0,s.YgS)(t))}if("subs"===j?.purpose)return k("StarsNeededTextLink")}),[V,q,W,j?.purpose,k]),$=Boolean(I?.all?.transactions.length&&!Y),ee=!Y,se=(0,r.Kr)((()=>re.map((e=>({title:G(e)})))),[G]);(0,r.vJ)((()=>{H||(R(!0),K(0),_())}),[H]),(0,r.vJ)((()=>{Y?F():_()}),[Y]);const ie=(0,r.Kr)((()=>{if(!H)return;const e=k("lng_credits_summary_options_about").split("{link}");return[e[0],r.Ay.createElement(y.A,{url:k("StarsTOSLink"),text:k("lng_credits_summary_options_about_link")}),e[1]]}),[H,k]),oe=(0,d.A)((()=>{m({type:ae[L]})})),le=(0,d.A)((()=>{A()})),ce=(0,d.A)((()=>{S({})})),me=(0,d.A)((e=>{b({type:"stars",stars:e.stars,currency:e.currency,amount:e.amount})}));return r.Ay.createElement(g.A,{className:D.root,isOpen:H,onClose:l},r.Ay.createElement("div",{className:(0,o.A)(D.main,"custom-scroll"),onScroll:function(e){const{scrollTop:t}=e.currentTarget;R(t<=150)}},r.Ay.createElement(f.A,{round:!0,size:"smaller",className:D.closeButton,color:"translucent",onClick:()=>l(),ariaLabel:G("Close")},r.Ay.createElement(p.A,{name:"close"})),r.Ay.createElement(O,{balance:N,className:D.modalBalance}),r.Ay.createElement("div",{className:(0,o.A)(D.header,T&&D.hiddenHeader)},r.Ay.createElement("h2",{className:D.starHeaderText},k("TelegramStars"))),r.Ay.createElement("div",{className:D.section},r.Ay.createElement("img",{className:D.logo,src:E,alt:"",draggable:!1}),r.Ay.createElement("img",{className:D.logoBackground,src:v,alt:"",draggable:!1}),r.Ay.createElement("h2",{className:D.headerText},X?k("StarsNeededTitle",Q):k("TelegramStars")),r.Ay.createElement("div",{className:D.description},(0,c.A)(Z||k("TelegramStarsInfo"),["simple_markdown","emoji"])),a&&!z&&r.Ay.createElement(f.A,{className:D.starButton,onClick:F},k("Star.List.BuyMoreStars")),a&&!z&&ee&&r.Ay.createElement(f.A,{className:(0,o.A)(D.starButton,"settings-main-menu-star"),color:"translucent",onClick:ce},r.Ay.createElement(M.A,{className:"icon",type:"gold",size:"big"}),k("TelegramStarsGift")),z&&t?.topupOptions&&r.Ay.createElement(h.A,{starsNeeded:X,options:t.topupOptions,onClick:me})),z&&r.Ay.createElement("div",{className:D.tos},ie),$&&Boolean(C?.list.length)&&r.Ay.createElement("div",{className:D.section},r.Ay.createElement("h3",{className:D.sectionTitle},k("StarMySubscriptions")),r.Ay.createElement("div",{className:D.subscriptions},C?.list.map((e=>r.Ay.createElement(J,{key:e.id,subscription:e}))),C?.nextOffset&&r.Ay.createElement(f.A,{isText:!0,disabled:C.isLoading,size:"smaller",noForcedUpperCase:!0,className:D.loadMore,onClick:le},r.Ay.createElement(p.A,{name:"down",className:D.loadMoreIcon}),k("StarMySubscriptionsExpand")))),$&&r.Ay.createElement("div",{className:D.container},r.Ay.createElement("div",{className:D.section},r.Ay.createElement(U.Ay,{name:G.isRtl?"slideOptimizedRtl":"slideOptimized",activeKey:L,renderCount:re.length,shouldRestoreHeight:!0,className:D.transition},r.Ay.createElement(P.A,{onLoadMore:oe,items:I?.[ae[L]]?.transactions,scrollContainerClosest:`.${D.main}`,itemSelector:`.${ne}`,className:D.transactions,noFastList:!0},I?.[ae[L]]?.transactions.map((e=>r.Ay.createElement(te,{key:`${e.id}-${e.isRefund}`,transaction:e,className:ne})))))),r.Ay.createElement(x.A,{className:D.tabs,tabClassName:D.tab,activeTab:L,tabs:se,onSwitchTab:K}))))})));function ie(e,t){return e("StarsAmountText",{amount:t},{pluralValue:t})}function oe(e,t,a){const{asFont:n,className:s}=a||{},i=n?r.Ay.createElement(p.A,{name:"star",className:(0,o.A)("star-amount-icon",s)}):r.Ay.createElement(M.A,{type:"gold",className:(0,o.A)("star-amount-icon",s),size:"adaptive"});return e("StarsAmount",{amount:t},{withNodes:!0,specialReplacement:{[N.Cyx]:i}})}var le=a(29886),ce=a(84991),me=a(10187);const de=(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:h}=(0,n.ko)(),[S,E,b]=(0,B.A)(),N=Boolean(e?.inputInvoice&&a),I=(0,le.A)(e),C=e||I,{form:k,subscriptionInfo:G}=C||{},T=k?.invoice?.totalAmount||G?.subscriptionPricing?.amount,P=Boolean(k?.invoice.subscriptionPeriod),x=!G?.subscriptionPricing,U=k?.photo,R=(0,u.A)(),L=(0,w.A)();(0,r.vJ)((()=>{N||b()}),[N]);const z=(0,r.Kr)((()=>{if(!C?.inputInvoice)return"";const e=(0,s.YgS)(t),a=R("Stars.Intro.PurchasedText.Stars",T);if(i){const e=i.content.paidMedia.extendedMedia,t=e.every((e=>!e.duration)),r=e.every((e=>!!e.duration)),n=R(t?"Stars.Transfer.Photos":r?"Stars.Transfer.Videos":"Media",e.length),o=(0,s.JsG)(R,l);return R("Stars.Transfer.UnlockInfo",[n,o,a])}return G?L("StarsSubscribeText",{chat:G.title,amount:T},{withNodes:!0,withMarkdown:!0,pluralValue:T}):P?L("StarsSubscribeBotText",{name:k.title,amount:T,bot:e},{pluralValue:T}):R("Stars.Transfer.Info",[k.title,e,a])}),[C?.inputInvoice,t,R,T,i,G,P,k,l,L]),F=(0,r.Kr)((()=>{if(G)return L("StarsSubscribeInfo",{link:r.Ay.createElement(y.A,{url:L("StarsSubscribeInfoLink"),text:L("StarsSubscribeInfoLinkText")})},{withNodes:!0})}),[G,L]),J=(0,r.Kr)((()=>{if(G)return(0,s.nrT)(G)}),[G]),_=(0,d.A)((()=>{const t=a?.balance;void 0!==T&&void 0!==t&&(T>t.amount?p({originStarsPayment:e}):(h({}),E()))}));return r.Ay.createElement(g.A,{contentClassName:D.paymentContent,isOpen:N,hasAbsoluteCloseButton:!0,isSlim:!0,onClose:m},r.Ay.createElement(O,{balance:a?.balance,className:D.modalBalance}),r.Ay.createElement("div",{className:D.paymentImages,dir:R.isRtl?"ltr":"rtl"},i?r.Ay.createElement($,{media:i.content.paidMedia.extendedMedia}):J?r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement(A.A,{className:D.paymentPhoto,peer:J,size:"giant"}),r.Ay.createElement(M.A,{type:"gold",size:"adaptive",className:D.avatarStar})):r.Ay.createElement(ce.A,{peer:U?void 0:t,avatarWebPhoto:U,avatarSize:"giant",badgeIcon:"star",badgeText:(0,K.Sm)(T),badgeClassName:D.amountBadge,className:D.paymentPhoto}),r.Ay.createElement("img",{className:D.paymentImageBackground,src:v,alt:"",draggable:!1})),r.Ay.createElement("h2",{className:D.headerText},R(J?"StarsSubscribeTitle":"StarsConfirmPurchaseTitle")),x&&r.Ay.createElement(me.A,{className:D.botItem,peerId:k?.botId}),r.Ay.createElement("div",{className:D.description},(0,c.A)(z,["simple_markdown","emoji"])),r.Ay.createElement(f.A,{className:D.paymentButton,size:"smaller",onClick:_,isLoading:S},L(P?"StarsSubscribeBotButtonMonth":"StarsPay",{amount:oe(L,T,{asFont:!0})},{withNodes:!0})),F&&r.Ay.createElement("div",{className:(0,o.A)(D.disclaimer,D.smallerText)},F))})));var ue=a(89925),Ae=a(85982),pe=a(70046),ye=a(95807);const fe=(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(j.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(W.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",he="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)(),f=(0,w.A)(),g=(0,u.A)(),{transaction:h}=e||{},S=(0,d.A)((()=>{const e=h?.extendedMedia;e&&c({origin:ue.TQ.StarsTransaction,standaloneMedia:e.flatMap((e=>Object.values(e)))})})),E=(0,r.Kr)((()=>{if(!h)return;const{giveawayPostId:e,photo:n,stars:c,isGiftUpgrade:m,starGift:d}=h,u=h?.starGift,E="starGiftUnique"===u?.type,b=h?.starGift?(0,H.yQ)(h.starGift):i,N=E?(0,H.uc)(u):void 0,I=h.peer&&"peer"!==h.peer.type&&(0,R.Pc)(h.peer)||void 0,C="peer"===h.peer?.type?h.peer.id:void 0,k=h.peer&&g(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)),G=q(g,h),T=t&&h.messageId&&!m?(0,s.ytg)(t,void 0,h.messageId):void 0,B=t&&e&&(0,s.ytg)(t,void 0,e),w=h.extendedMedia,P=w?.length||0,x=w?.every((e=>!e.video)),U=w?.every((e=>!e.photo)),D=g(x?"Stars.Transfer.Photos":U?"Stars.Transfer.Videos":"Media",P),O=h.description||(m&&"starGiftUnique"===d?.type?d.title:void 0)||(w?D:void 0),K=!w&&!b,z=n?void 0:t||I,F=E&&r.Ay.createElement("div",{className:(0,o.A)(ge,"ApoQz22o")},r.Ay.createElement(fe,{backdropAttribute:N.backdrop,patternAttribute:N.pattern,modelAttribute:N.model,title:u.title,subtitle:f("GiftInfoCollectible",{number:u.number})})),J=r.Ay.createElement("div",{className:ge},w&&r.Ay.createElement($,{className:(0,o.A)("C5r59yiV","transaction-media-preview"),media:w,onClick:S}),!w&&b&&r.Ay.createElement(W.A,{key:h.id,sticker:b,play:a,noLoop:!0}),K&&r.Ay.createElement(A.A,{peer:z,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:he},r.Ay.createElement("span",{className:(0,o.A)(he,V(c)?"xDyq9cc0":"jvBZSrpd")},(0,R.hk)(f,c)),r.Ay.createElement(M.A,{type:"gold",size:"middle"}))),_=[];let j;h.starRefCommision&&_.push([g("StarsTransaction.StarRefReason.Title"),g("StarsTransaction.StarRefReason.Program")]),m&&_.push([g("StarGiftReason"),g("StarGiftReasonUpgrade")]),j=m?g("Stars.Transaction.GiftFrom"):V(c)||h.isMyGift?g("Stars.Transaction.To"):h.starRefCommision?g("StarsTransaction.StarRefReason.Miniapp"):g(C?"Star.Transaction.From":"Stars.Transaction.Via"),_.push([j,C?{chatId:C}:k||""]),T&&_.push([g("Stars.Transaction.Reaction.Post"),r.Ay.createElement(y.A,{url:T,text:T})]),B&&(_.push([g("BoostReason"),r.Ay.createElement(y.A,{url:B,text:g("Giveaway")})]),_.push([g("Gift"),g("Stars",h.stars,"i")])),h.id&&_.push([g("Stars.Transaction.Id"),r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement("div",{className:"tMF8VIOM",onClick:()=>{(0,Ae.eM)(h.id),l({message:g("StarsTransactionIDCopied")})}},h.id),r.Ay.createElement(p.A,{className:"voCttFzS",name:"copy"}))]),_.push([g("Stars.Transaction.Date"),(0,L.L2)(1e3*h.date,g.code,!0)]);const Y=g("lng_credits_box_out_about").split("{link}");return{header:E?F:J,tableData:_,footer:r.Ay.createElement("span",{className:"KgzPpgS6"},Y[0],r.Ay.createElement(y.A,{url:g("StarsTOSLink"),text:g("lng_credits_summary_options_about_link")}),Y[1])}}),[h,g,f,t,a,i]),b=(0,le.A)(E)||E;return r.Ay.createElement(pe.A,{isOpen:Boolean(h),className:"IzhfRIWu",hasBackdrop:"starGiftUnique"===h?.starGift?.type,header:b?.header,tableData:b?.tableData,footer:b?.footer,buttonText:g("OK"),onClose:m})})));var Ee=a(70636);const 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)(),g=(0,w.A)(),{subscription:h}=e||{},S=(0,r.Kr)((()=>{if(!h)return"hidden";if(h.canRefulfill)return"refulfill";const e=h.until>Date.now()/1e3;if(e&&!h.isCancelled)return"cancel";if(e&&h.isCancelled)return"renew";const t=h.chatInviteHash||h.invoiceSlug;return!e&&t?"restart":"ok"}),[h]),E=(0,d.A)((()=>{if(h){switch(S){case"refulfill":s({id:h.id});break;case"restart":h.chatInviteHash?l({hash:h.chatInviteHash}):h.invoiceSlug&&m({type:"slug",slug:h.invoiceSlug}),c();break;case"renew":i({id:h.id,isCancelled:!1});break;case"cancel":i({id:h.id,isCancelled:!0})}a()}})),b=(0,r.Kr)((()=>{if(!h||!t)return;const{pricing:e,until:a,isCancelled:n,canRefulfill:s,photo:i,title:l,hasBotCancelled:c}=h,m=(0,Ee.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(M.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"},g("StarsPerMonth",{amount:e.amount},{withNodes:!0,specialReplacement:{[N.Cyx]:r.Ay.createElement(M.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,L.L2)(1e3*a,p.code,!0)]);const I=g("StarsTransactionTOS",{link:r.Ay.createElement(y.A,{url:g("StarsTransactionTOSLink"),text:g("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,L.L2)(1e3*a,p.code,!0))),!n&&!s&&b&&r.Ay.createElement("p",{className:ve},p("StarsSubscriptionExpiredInfo",(0,L.L2)(1e3*a,p.code,!0))),!n&&!s&&!b&&r.Ay.createElement("p",{className:ve},p("StarsSubscriptionCancelInfo",(0,L.L2)(1e3*a,p.code,!0))),"hidden"!==S&&r.Ay.createElement(f.A,{size:"smaller",color:"cancel"===S?"danger":"primary",isText:"cancel"===S,onClick:E},p("cancel"===S?"StarsSubscriptionCancel":"refulfill"===S?"StarsSubscriptionRefulfill":"restart"===S?"StarsSubscriptionAgain":"renew"===S?"StarsSubscriptionRenew":"OK")))}}),[S,g,p,t,h]),I=(0,le.A)(b)||b;return r.Ay.createElement(pe.A,{isOpen:Boolean(h),className:"eR_RZfGB",header:I?.header,tableData:I?.tableData,footer:I?.footer,onClose:a})})));var Ne=a(19806),Ie=a(32581),Ce=a(66644),ke=a(15283),Ge=a(93545),Te=a(68292),Be=a(85118);const we={root:"CuBAw2yg",slider:"euOOAbZi",sparkles:"_L1YQTIP",progress:"kwK0cNPX",floatingBadgeWrapper:"uvlMoXj0",floatingBadge:"BGSDWAYc",floatingBadgeText:"qqQan8uF",floatingBadgeTriangle:"mIdJOmsB"},Me=[50,100,500,1e3,2e3,5e3,1e4];function Pe(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 xe(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 Ue=(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<Me.length;a++)if(Me[a]<e&&t.push(Me[a]),Me[a]>=e){t.push(e);break}return t}),[e]),[l,c]=(0,r.J0)(0);(0,ke.A)((()=>{c(Pe(i,t))}));const m=(0,d.A)((()=>{const e=s.current;if(!e)return;const t=e.parentElement;(0,Ce.YS)((()=>{const a=t.offsetLeft+e.offsetWidth/2,r=t.offsetLeft+t.offsetWidth-e.offsetWidth/2;(0,Ce.RK)((()=>{t.style.setProperty("--_min-x",`${a}px`),t.style.setProperty("--_max-x",`${r}px`)}))}))}));(0,Ge.A)(s,m);const u=(0,d.A)((e=>{const t=Number(e.currentTarget.value);c(t),n(xe(i,t))}));return r.Ay.createElement("div",{className:(0,o.A)(we.root,a),style:"--progress: "+l/i.length},r.Ay.createElement("div",{className:we.floatingBadgeWrapper},r.Ay.createElement("div",{className:we.floatingBadge,ref:s},r.Ay.createElement("div",{className:we.floatingBadgeText},r.Ay.createElement(p.A,{name:"star",className:we.floatingBadgeIcon}),r.Ay.createElement(Te.A,{text:(0,K.Sm)(xe(i,l))})),r.Ay.createElement("svg",{className:we.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:we.progress}),r.Ay.createElement(Be.A,{preset:"progress",className:we.sparkles}),r.Ay.createElement("input",{className:we.slider,type:"range",min:0,max:i.length,defaultValue:Pe(i,t),step:"any",onChange:u}))})),Re={avatarIcon:"author-hidden",customPeerAvatarColor:"#9eaab5",isCustomPeer:!0,titleKey:"StarsReactionAnonymous"},De=(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;return{chat:a,message:r,starBalance:n,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,n.ko)(),[S,E]=(0,r.J0)(50),[v,b,I]=(0,B.A)(),[C,k]=(0,r.J0)(!0),G=(0,u.A)(),T=(0,w.A)(),M=(0,d.A)((e=>{k(e.target.checked)})),P=(0,d.A)((e=>{E(e),b()}));(0,r.vJ)((()=>{e||I()}),[e]),(0,r.vJ)((()=>{const e=a?.reactions?.topReactors?.find((e=>e.isMe));k(e?!e.isAnonymous:m||!0)}),[m,a?.reactions?.topReactors]);const x=(0,d.A)((()=>{e&&(h({chatId:e.chatId,messageId:e.messageId,count:S,isPrivate:!C}),A())})),U=(0,r.Kr)((()=>{const e=(0,n.mS)(),t=a?.reactions?.topReactors;if(!t)return;const r=[];let s=!1;if(t.forEach((t=>{const a=t.peerId?(0,i.mBe)(e,t.peerId):void 0;(a||t.isAnonymous||t.isMe)&&(t.isMe&&(s=!0),r.push({amount:t.count,localAmount:t.isMe&&v?S:0,isMe:t.isMe,isAnonymous:t.isAnonymous,user:a}))})),!s&&v){const t=(0,i.mBe)(e,e.currentUserId);r.push({amount:0,localAmount:S,isMe:!0,user:t})}return r.sort(((e,t)=>t.amount+t.localAmount-(e.amount+e.localAmount))),r.slice(0,3)}),[v,a?.reactions?.topReactors,S]),R=t&&(0,s.JsG)(G,t);return r.Ay.createElement(g.A,{isOpen:Boolean(e),onClose:A,isSlim:!0,hasAbsoluteCloseButton:!0,contentClassName:"RdhRpsCn"},r.Ay.createElement(O,{balance:l,className:"Q3560fzx"}),r.Ay.createElement(Ue,{className:"xePPMXOI",defaultValue:50,maxValue:o,onChange:P}),r.Ay.createElement("h3",{className:"yzbjj73U"},G("StarsReactionTitle")),r.Ay.createElement("div",{className:"BlpfdOtK"},(0,c.A)(G("StarsReactionText",R),["simple_markdown","emoji"])),r.Ay.createElement(Ie.A,null,U&&r.Ay.createElement("div",{className:"bnou4CpV"},G("StarsReactionTopSenders"))),U&&r.Ay.createElement("div",{className:"QludQDKR"},U.map((e=>{const t=(0,K.Sm)(e.amount+e.localAmount),a=e.isAnonymous||!e.user||e.isMe&&!C?Re:e.user,n="isCustomPeer"in a?G(a.titleKey):(0,s.YgS)(a);return r.Ay.createElement(ce.A,{className:"Ty4Ud_Rd",key:`${e.user?.id||"anonymous"}-${t}`,peer:a,badgeText:t,badgeIcon:"star",badgeClassName:"JBF9pTUK",text:n})}))),r.Ay.createElement(Ne.A,{className:"oQ5Ar48z",checked:C,onChange:M,label:G("StarsReactionShowMeInTopSenders")}),r.Ay.createElement(f.A,{size:"smaller",onClick:x},T("SendPaidReaction",{amount:S},{withNodes:!0,specialReplacement:{[N.Cyx]:r.Ay.createElement(p.A,{className:"NJJFuym9",name:"star"})}})),r.Ay.createElement("p",{className:"KRvkHeo1"},T("StarsReactionTerms",{link:r.Ay.createElement(y.A,{text:T("StarsReactionLinkText"),url:T("StarsReactionLink")})},{withNodes:!0})))})));var Oe=a(5912),Le=a(65632),Ke=a(20333),ze=a(75373),Fe=a(96530),Je=a(22720),_e=a(63152),He=a(94079);const qe="zZUpGRSI",Ve="nTPAv1ci",We=(0,r.ph)((0,n.EK)(((e,{userId:t})=>{const a=(0,i.SJA)(e),{isBlurred:r,patternColor:n,background:s,backgroundColor:o}=e.settings.themes[a]||{},l=(0,i.mBe)(e,t),c=(0,i.nTw)(e);return{user:l,theme:a,isBackgroundBlurred:r,patternColor:n,customBackground:s,backgroundColor:o,captionLimit:e.appConfig?.starGiftMaxMessageLength,currentUserId:e.currentUserId,isPaymentFormLoading:c.isPaymentFormLoading}}))((function({gift:e,userId:t,user:a,captionLimit:i,theme:c,isBackgroundBlurred:m,patternColor:u,backgroundColor:A,customBackground:p,currentUserId:y,isPaymentFormLoading:g}){const{sendStarGift:h,openInvoice:S,openGiftUpgradeModal:E}=(0,n.ko)(),v=(0,w.A)(),[b,I]=(0,r.J0)(""),[C,k]=(0,r.J0)(!1),[G,T]=(0,r.J0)(!1),B=(0,Le.A)(c,p),M="id"in e,P=(0,r.Kr)((()=>M?{id:-1,chatId:y,isOutgoing:!1,senderId:y,date:Math.floor(Date.now()/1e3),content:{action:{targetUserIds:[t],mediaType:"action",text:"ActionGiftInbound",type:"starGift",currency:N.OUy,amount:e.stars,starGift:{type:"starGift",message:b?.length?{text:b}:void 0,isNameHidden:C,starsToConvert:e.starsToConvert,canUpgrade:G||void 0,isSaved:!1,gift:e},translationValues:["%action_origin%","%gift_payment_amount%"]}}}:{id:-1,chatId:"0",isOutgoing:!0,senderId:y,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:b},translationValues:["%action_origin%","%gift_payment_amount%"]}}}),[y,e,b,M,C,G,t]),x=(0,d.A)((e=>{I(e.target.value)})),U=(0,d.A)((()=>{k(!C)})),R=(0,d.A)((()=>{T(!G)})),D=(0,d.A)((()=>{M&&E({giftId:e.id,peerId:t})})),O=(0,d.A)((()=>{M?h({userId:t,shouldHideName:C,gift:e,message:b?{text:b}:void 0,shouldUpgrade:G}):S({type:"giftcode",userIds:[t],currency:e.currency,amount:e.amount,option:e,message:b?{text:b}:void 0})})),L=(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:L,style:B?`--custom-background: ${B}`:void 0}),r.Ay.createElement(ze.A,{key:M?e.id:e.months,message:P})),function(){const t=i?i-b.length:void 0,n=(0,s.YgS)(a);return r.Ay.createElement("div",{className:"Y68CEIKn"},r.Ay.createElement(He.A,{className:"o5r2IPoA",onChange:x,value:b,label:v("GiftMessagePlaceholder"),maxLength:i,maxLengthIndicator:t&&t<50?t.toString():void 0}),M&&e.upgradeStars&&r.Ay.createElement(Je.A,{className:qe,narrow:!0,ripple:!0,onClick:R},r.Ay.createElement("span",null,v("GiftMakeUnique",{stars:oe(v,e.upgradeStars,{className:"zAee80Dv"})},{withNodes:!0})),r.Ay.createElement(_e.A,{checked:G,onChange:R,label:v("GiftMakeUniqueAcc")})),M&&r.Ay.createElement("div",{className:Ve},v("GiftMakeUniqueDescription",{user:n,link:r.Ay.createElement(Fe.A,{isPrimary:!0,onClick:D},v("GiftMakeUniqueLink"))},{withNodes:!0})),M&&r.Ay.createElement(Je.A,{className:qe,narrow:!0,ripple:!0,onClick:U},r.Ay.createElement("span",null,v("GiftHideMyName")),r.Ay.createElement(_e.A,{checked:C,onChange:U,label:v("GiftHideMyName")})),M&&r.Ay.createElement("div",{className:Ve},v("GiftHideNameDescription",{profile:n,receiver:n})))}(),r.Ay.createElement("div",{className:"ATowWJ60"}),function(){const t=M?oe(v,e.stars+(G?e.upgradeStars:0),{asFont:!0}):(0,l.v)(e.amount,e.currency);return r.Ay.createElement("div",{className:"jxWZSvet"},M&&e.availabilityRemains&&r.Ay.createElement(Ke.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(f.A,{className:"IDuhjrne",onClick:O,isLoading:g},v("GiftSend",{amount:t},{withNodes:!0})))}())})));var je=a(87049);const Ye="G1mBmzxs",Qe="a8no5WH0",Xe=(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,w.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:Ye,tabIndex:0,role:"button",onClick:u},r.Ay.createElement(W.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(f.A,{className:Qe,nonInteractive:!0,size:"tiny",pill:!0,fluid:!0},(0,l.A)(o,c)),Boolean(p)&&r.Ay.createElement(je.A,{color:"red",text:m("GiftDiscount",{percent:p})}))}))),Ze=(0,r.ph)((function({gift:e,observeIntersection:t,onClick:a}){const{openGiftInfoModal:s}=(0,n.ko)(),i=(0,r.li)(null),l=(0,w.A)(),[c,m]=(0,B.A)(),{stars:u,isLimited:A,isSoldOut:y,sticker:g}=e,h=(0,d.A)((()=>{y?s({gift:e}):a(e)}));return(0,Oe.mv)(i,t,(e=>{e.isIntersecting&&m()})),r.Ay.createElement("div",{ref:i,className:(0,o.A)(Ye,"f5ArEO1S"),tabIndex:0,role:"button",onClick:h},r.Ay.createElement(W.A,{sticker:g,noLoop:!0,play:c,nonInteractive:!0,size:90}),r.Ay.createElement(f.A,{className:Qe,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&&!y&&r.Ay.createElement(je.A,{color:"blue",text:l("GiftLimited")}),y&&r.Ay.createElement(je.A,{color:"red",text:l("GiftSoldOut")}))}));var $e=a(36838);const et=(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,w.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(M.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,$e.A)(a,void 0,!0),r.Ay.createElement("div",{ref:a,className:(0,o.A)("cUjwvN00","no-scrollbar")},c("all"),c("stock"),c("limited"),s?.map(c))}))),tt={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"},at=(0,r.ph)((0,n.EK)(((e,{modal:t})=>{const{starGifts:a,stars:r,currentUserId:n}=e,s=t?.forUserId?(0,i.mBe)(e,t.forUserId):void 0,o=Boolean(n&&t?.forUserId===n);return{boostPerSentGift:e.appConfig?.boostsPerSentGift,starGiftsById:a?.byId,starGiftIdsByCategory:a?.idsByCategory,starBalance:r?.balance,user:s,isSelf:o}}))((({modal:e,starGiftsById:t,starGiftIdsByCategory:a,starBalance:i,user:l,isSelf:c})=>{const{closeGiftModal:p,requestConfetti:h}=(0,n.ko)(),S=(0,r.li)(null),E=(0,r.li)(null),b=(0,r.li)(null),N=(0,r.li)(null),I=Boolean(e),C=(0,m.A)(e),[k,G]=(0,r.J0)(),[T,B]=(0,r.J0)(!0),[M,P]=(0,r.J0)(!1),[x,R]=(0,r.J0)("all"),D=(0,u.A)(),L=(0,w.A)(),K=(0,r.Kr)((()=>C?.gifts?.sort(((e,t)=>e.months-t.months)).filter((e=>1===e.users))),[C]),z=(0,r.Kr)((()=>K?.reduce(((e,t)=>e.amount<t.amount?e:t))),[K]),{observe:F}=(0,Oe.BL)({rootRef:N,throttleMs:200,isDisabled:!I}),J=(0,d.A)((()=>{const e=S.current;if(e&&I){const{top:t,left:a,width:r,height:n}=e.querySelector(".modal-content").getBoundingClientRect();h({top:t,left:a,width:r,height:n,withStars:!0})}}));(0,r.vJ)((()=>{C?.isCompleted&&J()}),[C]),(0,r.vJ)((()=>{I||(B(!0),G(void 0))}),[I]);const _=(0,d.A)((e=>{if(k)return;const{scrollTop:t}=e.currentTarget;if(B(t<=150),E.current&&b.current){const{top:e}=b.current.getBoundingClientRect(),{top:t}=E.current.getBoundingClientRect();P(e-t<=0)}})),H=L("GiftPremiumDescription",{user:(0,s.YgS)(l),link:r.Ay.createElement(y.A,{text:L("GiftPremiumDescriptionLinkCaption"),url:L("GiftPremiumDescriptionLink")})},{withNodes:!0}),q=c?L("StarGiftDescriptionSelf",void 0,{withNodes:!0,renderTextFilters:["br"]}):L("StarGiftDescription",{user:(0,s.YgS)(l)},{withNodes:!0,withMarkdown:!0}),V=(0,d.A)((e=>{G(e),P("id"in e),B(!1)})),W=(0,d.A)((e=>{R(e)})),j=(0,d.A)((()=>{k?G(void 0):p()})),Y=Boolean(k),Q=(0,o.A)("animated-close-icon",Y&&"state-back");return r.Ay.createElement(g.A,{dialogRef:S,onClose:p,isOpen:I,isSlim:!0,contentClassName:tt.content,className:(0,o.A)(tt.modalDialog,tt.root)},r.Ay.createElement(f.A,{className:tt.closeButton,round:!0,color:"translucent",size:"smaller",onClick:j,ariaLabel:D(Y?"Common.Back":"Common.Close")},r.Ay.createElement("div",{className:Q})),r.Ay.createElement(O,{className:tt.balance,balance:i}),r.Ay.createElement("div",{className:(0,o.A)(tt.header,T&&tt.hiddenHeader)},r.Ay.createElement(U.Ay,{name:"slideVerticalFade",activeKey:Number(M),slideClassName:tt.headerSlide},r.Ay.createElement("h2",{className:tt.commonHeaderText},L(M?c?"StarsGiftHeaderSelf":"StarsGiftHeader":"GiftPremiumHeader")))),r.Ay.createElement(U.Ay,{ref:E,className:tt.transition,name:"pushSlide",activeKey:k?1:0},!k&&r.Ay.createElement("div",{ref:N,className:(0,o.A)(tt.main,"custom-scroll"),onScroll:_},r.Ay.createElement("div",{className:tt.avatars},r.Ay.createElement(A.A,{size:100,peer:l}),r.Ay.createElement("img",{className:tt.logoBackground,src:v,alt:"",draggable:!1})),!c&&r.Ay.createElement("h2",{className:(0,o.A)(tt.headerText,tt.center)},L("GiftPremiumHeader")),!c&&r.Ay.createElement("p",{className:(0,o.A)(tt.description,tt.center)},H),!c&&r.Ay.createElement("div",{className:tt.premiumGiftsGallery},K?.map((e=>r.Ay.createElement(Xe,{option:e,baseMonthAmount:z?Math.floor(z.amount/z.months):void 0,onClick:V})))),r.Ay.createElement("h2",{ref:b,className:(0,o.A)(tt.headerText,tt.center)},L(c?"StarsGiftHeaderSelf":"StarsGiftHeader")),r.Ay.createElement("p",{className:(0,o.A)(tt.description,tt.starGiftsDescription,tt.center)},q),r.Ay.createElement(et,{onCategoryChanged:W}),r.Ay.createElement(U.Ay,{name:"zoomFade",activeKey:(X=x,"all"===X?-2:"stock"===X?-1:"limited"===X?0:X),className:tt.starGiftsTransition},r.Ay.createElement("div",{className:tt.starGiftsContainer},t&&a?.[x].map((e=>{const a=t[e];return r.Ay.createElement(Ze,{gift:a,observeIntersection:F,onClick:V})}))))),k&&C?.forUserId&&r.Ay.createElement(We,{gift:k,userId:C.forUserId})));var X})));const rt=(0,r.ph)((0,n.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,n.ko)(),l=(0,u.A)(),c=e,[m,A]=(0,r.J0)(""),p=(0,r.Kr)((()=>{const e=(0,n.mS)().users.byId,r=a?a.concat(t):void 0,i=r?(0,s.Z$K)(r,e,m):[];return(0,C.A)((0,I.Am)(i).filter((t=>{const a=e[t];return!a||!(0,s.tvf)(a)})),void 0,[t])}),[t,m,a]),y=(0,d.A)((e=>{o({forUserId:e}),i()}));return r.Ay.createElement(G.A,{className:"W3JMs1YE",isOpen:c,onClose:i,title:l("GiftTelegramPremiumOrStarsTitle"),hasCloseButton:!0,shouldAdaptToSearch:!0,withFixedHeight:!0},r.Ay.createElement(k.A,{className:"wOipz1Y_",itemIds:p,filterValue:m,filterPlaceholder:l("Search"),onSelectedIdChange:y,onFilterChange:A,isSearchable:!0,withDefaultPadding:!0,withStatus:!0,forceShowSelf:!0}))})));var nt=a(80140),st=a(18501),it=a(81949),ot=a(94189);const lt={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"},ct=(0,r.ph)((0,n.EK)(((e,{modal:t})=>{const a=t?.gift,r=a&&"gift"in a&&a.fromId;return{userFrom:r?(0,i.mBe)(e,r):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,changeGiftVisibility:y,convertGiftToStars:g,openChatWithInfo:h,focusMessage:S,openGiftUpgradeModal:E}=(0,n.ko)(),[v,b,N]=(0,B.A)(),I=(0,w.A)(),C=(0,u.A)(),k=Boolean(e),G=(0,m.A)(e),{gift:T}=G||{},M=T&&"gift"in T,P=M?T:void 0,x=P?.fromId===l,U=P&&c&&P.date+c-(0,nt.Fm)()||0,R=Math.ceil(U/60/60/24),D=M?T.gift:T,O=D&&(0,H.yQ)(D),z=Boolean(P?.upgradeMsgId),F=Boolean(P?.messageId)&&a?.id===l&&!z,J=(0,d.A)((()=>{p()})),q=(0,d.A)((()=>{if(!P?.upgradeMsgId||!a)return;const{upgradeMsgId:e}=P;S({chatId:a.id,messageId:e}),J()})),V=(0,d.A)((()=>{const{messageId:e,isUnsaved:t}=P;y({messageId:e,shouldUnsave:!t}),J()})),j=(0,d.A)((()=>{const{messageId:e}=P;g({messageId:e}),N(),J()})),Y=(0,d.A)((()=>{P&&E({giftId:P.gift.id,gift:P})})),Q=(0,r.Kr)((()=>D&&(0,H.uc)(D)),[D]),X=(0,d.A)((()=>z?r.Ay.createElement(f.A,{size:"smaller",onClick:q},I("GiftInfoViewUpgraded")):F&&P?.alreadyPaidUpgradeStars&&!P.upgradeMsgId?r.Ay.createElement(f.A,{size:"smaller",isShiny:!0,onClick:Y},I("GiftInfoUpgradeForFree")):r.Ay.createElement(f.A,{size:"smaller",onClick:J},I("OK")))),Z=(0,r.Kr)((()=>{if(!T||!D)return;const{fromId:e,isNameHidden:t,starsToConvert:l,isUnsaved:c,isConverted:m}=P||{},d=t&&a,u=P?P.upgradeMsgId?I("GiftInfoDescriptionUpgraded"):P.canUpgrade&&P.alreadyPaidUpgradeStars?F?I("GiftInfoDescriptionFreeUpgrade"):I("GiftInfoDescriptionFreeUpgradeOut",{user:(0,s.YgS)(a)}):F||x?m&&l?F?I("GiftInfoDescriptionConverted",{amount:(0,K.Sm)(l)},{pluralValue:l,withNodes:!0,withMarkdown:!0}):I("GiftInfoDescriptionOutConverted",{amount:(0,K.Sm)(l),user:(0,s.YgS)(a)},{pluralValue:l,withNodes:!0,withMarkdown:!0}):P.canUpgrade&&F?I("GiftInfoDescriptionUpgrade",{amount:(0,K.Sm)(l)},{pluralValue:l,withNodes:!0,withMarkdown:!0}):F?I("GiftInfoDescription",{amount:l},{withNodes:!0,withMarkdown:!0,pluralValue:l||0}):I("GiftInfoDescriptionOut",{amount:l,user:(0,s.YgS)(a)},{withNodes:!0,withMarkdown:!0,pluralValue:l||0}):void 0:I("GiftInfoSoldOutDescription"),y="starGiftUnique"===D.type,f=y&&r.Ay.createElement("div",{className:(0,o.A)(lt.header,lt.uniqueGift)},r.Ay.createElement(fe,{backdropAttribute:Q.backdrop,patternAttribute:Q.pattern,modelAttribute:Q.model,title:D.title,subtitle:I("GiftInfoCollectible",{number:D.number})})),g=r.Ay.createElement("div",{className:lt.header},r.Ay.createElement(W.A,{className:lt.giftSticker,sticker:O,size:120}),r.Ay.createElement("h1",{className:lt.title},"starGiftUnique"===D?.type?D.title:I(P?F?"GiftInfoReceived":"GiftInfoTitle":"GiftInfoSoldOutTitle")),u&&r.Ay.createElement("p",{className:(0,o.A)(lt.description,!P&&"starGift"===D?.type&&lt.soldOut)},u)),S=[];if("starGift"===D.type){(e||t)&&S.push([I("GiftInfoFrom"),e?{chatId:e}:r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement(A.A,{size:"small",peer:_.I5}),r.Ay.createElement("span",{className:lt.unknown},C(_.I5.titleKey)))]),P?.date&&S.push([I("GiftInfoDate"),(0,L.L2)(1e3*P.date,I.code,!0)]),D.firstSaleDate&&S.push([I("GiftInfoFirstSale"),(0,L.L2)(1e3*D.firstSaleDate,I.code,!0)]),D.lastSaleDate&&S.push([I("GiftInfoLastSale"),(0,L.L2)(1e3*D.lastSaleDate,I.code,!0)]);const a=D.stars+(P?.alreadyPaidUpgradeStars||0);S.push([I("GiftInfoValue"),r.Ay.createElement("div",{className:lt.giftValue},oe(I,a,{className:lt.starAmountIcon}),F&&U>0&&Boolean(l)&&r.Ay.createElement(it.A,{onClick:b},I("GiftInfoConvert",{amount:l},{pluralValue:l})))]),D.availabilityTotal&&S.push([I("GiftInfoAvailability"),I("GiftInfoAvailabilityValue",{count:D.availabilityRemains||0,total:D.availabilityTotal},{pluralValue:D.availabilityRemains||0})]),D.upgradeStars&&!P?.upgradeMsgId&&S.push([I("GiftInfoStatus"),r.Ay.createElement("div",{className:lt.giftValue},I("GiftInfoStatusNonUnique"),F&&r.Ay.createElement(it.A,{onClick:Y},I("GiftInfoUpgradeBadge")))]),P?.message&&S.push([void 0,(0,st.f)(P.message)])}if("starGiftUnique"===D.type){const{model:e,backdrop:t,pattern:a,originalDetails:o}=Q||{},l=D.ownerName;if(S.push([I("GiftInfoOwner"),D.ownerId?{chatId:D.ownerId}:l||""]),e&&S.push([I("GiftAttributeModel"),r.Ay.createElement("span",{className:lt.uniqueAttribute},e.name,r.Ay.createElement(it.A,null,(0,K.l9)(e.rarityPercent)))]),t&&S.push([I("GiftAttributeBackdrop"),r.Ay.createElement("span",{className:lt.uniqueAttribute},t.name,r.Ay.createElement(it.A,null,(0,K.l9)(t.rarityPercent)))]),a&&S.push([I("GiftAttributeSymbol"),r.Ay.createElement("span",{className:lt.uniqueAttribute},a.name,r.Ay.createElement(it.A,null,(0,K.l9)(a.rarityPercent)))]),S.push([I("GiftInfoAvailability"),I("GiftInfoIssued",{issued:D.issuedCount,total:D.totalCount})]),o){const{date:e,recipientId:t,message:a,senderId:l}=o,c=(0,n.mS)(),m=e=>{h({id:e}),p()},d=(0,i.mBe)(c,t),u=l?(0,i.mBe)(c,l):void 0,A=(0,L.L2)(1e3*e,I.code,!0),y=r.Ay.createElement(Fe.A,{onClick:()=>m(t),isPrimary:!0},(0,s.YgS)(d));let f;if(u&&l!==t){const e=r.Ay.createElement(Fe.A,{onClick:()=>m(u.id),isPrimary:!0},(0,s.YgS)(u));f=a?I("GiftInfoOriginalInfoTextSender",{user:y,sender:e,text:(0,st.f)(a),date:A},{withNodes:!0}):I("GiftInfoOriginalInfoSender",{user:y,date:A,sender:e},{withNodes:!0})}else f=a?I("GiftInfoOriginalInfoText",{user:y,text:(0,st.f)(a),date:A},{withNodes:!0}):I("GiftInfoOriginalInfo",{user:y,date:A},{withNodes:!0});S.push([void 0,r.Ay.createElement("span",null,f)])}}return{header:y?f:g,tableData:S,footer:r.Ay.createElement("div",{className:lt.footer},F&&r.Ay.createElement("div",{className:lt.footerDescription},r.Ay.createElement("div",null,I(c?"GiftInfoHidden":"GiftInfoSaved",{link:r.Ay.createElement(Fe.A,{isPrimary:!0,onClick:V},I("GiftInfoSavedHide"))},{withNodes:!0})),d&&r.Ay.createElement("div",null,I("GiftInfoSenderHidden"))),X())}}),[T,P,a,O,I,F,U,x,C,D,Q,X]);return r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement(pe.A,{isOpen:k,header:Z?.header,hasBackdrop:"starGiftUnique"===D?.type,tableData:Z?.tableData,footer:Z?.footer,className:lt.modal,onClose:J}),P&&r.Ay.createElement(ot.A,{isOpen:v,onClose:N,confirmHandler:j,title:I("GiftInfoConvertTitle")},r.Ay.createElement("div",null,I("GiftInfoConvertDescription1",{amount:ie(I,P.starsToConvert),user:(0,s.YgS)(t)},{withNodes:!0,withMarkdown:!0})),U>0&&r.Ay.createElement("div",null,I("GiftInfoConvertDescriptionPeriod",{count:R},{withNodes:!0,withMarkdown:!0,pluralValue:R})),r.Ay.createElement("div",null,I("GiftInfoConvertDescription2"))))})));var mt=a(23174),dt=a(58554),ut=a(32625),At=a(5463);const pt="_Dt6RSQV",yt=(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,y]=(0,r.J0)(),g=(0,w.A)(),h=(0,d.A)((()=>a())),S=(0,d.A)((()=>{const e=l?.gift;e?.messageId&&(i({messageId:e.messageId,shouldKeepOriginalDetails:u,upgradeStars:e.alreadyPaidUpgradeStars?void 0:e.gift.upgradeStars}),h())})),E=(0,d.A)((()=>{l?.sampleAttributes&&y(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,ut.A)(E,o?3e3:void 0,!0),(0,r.vJ)((()=>{o&&l?.sampleAttributes&&E()}),[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.Mwy)(e,"full"))).forEach((e=>{(0,dt.hd)(e,mt.qZ.BlobUrl)}))}),[l?.sampleAttributes]);const v=(0,r.Kr)((()=>{if(!p)return;const e=l?.gift,t=[["diamond",g("GiftUpgradeUniqueTitle"),g("GiftUpgradeUniqueDescription")],["trade",g("GiftUpgradeTransferableTitle"),g("GiftUpgradeTransferableDescription")],["auction",g("GiftUpgradeTradeableTitle"),g("GiftUpgradeTradeableDescription")]],a=c?g("GiftUpgradeText",{peer:(0,s.F9N)(g,c)}):g("GiftUpgradeTextOwn");return{listItemData:t,header:r.Ay.createElement(fe,{modelAttribute:p.model,backdropAttribute:p.backdrop,patternAttribute:p.pattern,title:g("GiftUpgradeTitle"),subtitle:a}),footer:r.Ay.createElement("div",{className:"EWaVCxY4"},!e&&r.Ay.createElement(f.A,{className:pt,size:"smaller",onClick:h},g("OK")),e&&r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement(Ne.A,{label:g("GiftUpgradeKeepDetails"),onCheck:A,checked:u}),r.Ay.createElement(f.A,{className:pt,size:"smaller",isShiny:!0,onClick:S},e.alreadyPaidUpgradeStars?g("GeneralConfirm"):g("GiftUpgradeButton",{amount:oe(g,e.gift.upgradeStars,{asFont:!0})},{withNodes:!0}))))}}),[p,g,c,l?.gift,u]);return r.Ay.createElement(At.A,{isOpen:o,header:v?.header,footer:v?.footer,listItemData:v?.listItemData,hasBackdrop:!0,onClose:h})})))},81949:(e,t,a)=>{a.d(t,{A:()=>s});var r=a(84051),n=a(87357);const s=({children:e,className:t,onClick:a})=>r.Ay.createElement("div",{className:(0,n.A)("hJUqHi4B",a&&"hjDEmFaT",t),onClick:a},e)},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:y})=>r.Ay.createElement("div",{className:(0,n.A)(o.root,y&&o.clickable,d),onClick:y},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:()=>c});var r=a(84051),n=a(18276),s=a(64493),i=a(22720),o=a(8410),l=a(32581);const c=(0,r.ph)((({isOpen:e,listItemData:t,headerIconName:a,header:c,footer:m,buttonText:d,hasBackdrop:u,withSeparator:A,onClose:p,onButtonClick:y})=>r.Ay.createElement(o.A,{isOpen:e,className:"LAh8evux",contentClassName:"hrizpMDe",hasAbsoluteCloseButton:!0,absoluteCloseButtonColor:u?"translucent-white":void 0,onClose:p},a&&r.Ay.createElement("div",{className:"jySLtQNG"},r.Ay.createElement(n.A,{name:a})),c,r.Ay.createElement("div",null,t?.map((([e,t,a])=>r.Ay.createElement(i.A,{isStatic:!0,multiline:!0,icon:e},r.Ay.createElement("span",{className:"title"},t),r.Ay.createElement("span",{className:"subtitle"},a))))),A&&r.Ay.createElement(l.A,{className:"En1zD2cT"}),m,d&&r.Ay.createElement(s.A,{size:"smaller",onClick:y||p},d))))},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,footer:p,buttonText:y,className:f,hasBackdrop:g,onClose:h,onButtonClick:S})=>{const{openChat:E}=(0,n.ko)(),v=(0,i.A)((e=>{E({id:e}),h()}));return r.Ay.createElement(m.A,{isOpen:e,hasCloseButton:Boolean(t),hasAbsoluteCloseButton:!t,absoluteCloseButtonColor:g?"translucent-white":void 0,isSlim:!0,title:t,className:f,contentClassName:"KYHkJ9Qf",onClose:h},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:v}):t))))),p,y&&r.Ay.createElement(c.A,{className:p?void 0:"cSamlkt9",size:"smaller",onClick:S||h},y))}))},1526:(e,t,a)=>{a.d(t,{A:()=>y});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"},y=(0,r.ph)((({isActive:e,className:t,options:a,selectedStarOption:y,selectedStarCount:f,starsNeeded:g,onClick:h})=>{const S=(0,m.A)(),E=(0,c.A)(),[v,b,N]=(0,l.A)();(0,r.vJ)((()=>{e||N()}),[e]);const[I,C]=(0,r.Kr)((()=>{if(!a)return[void 0,!1];const e=a.reduce(((e,t)=>e.stars>t.stars?e:t)),t=g&&e.stars<g,r=[];let n=0,s=!1;return a.forEach(((e,i)=>{e.isExtended||n++,g&&!t&&e.stars<g||(v||!e.isExtended?r.push({option:e,starsCount:Math.min(n,6),isWide:i===a.length-1}):s=!0)})),[r,s]}),[v,a,g]);return r.Ay.createElement("div",{className:(0,n.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 r.Ay.createElement("div",{className:(0,n.A)(p.option,!c&&a&&p.wideOption,m&&p.active),key:e.stars,onClick:()=>h?.(e)},r.Ay.createElement("div",{className:p.optionTop},"+",(0,i.Sm)(e.stars),r.Ay.createElement("div",{className:p.stackedStars,dir:E.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)(e.amount,e.currency,S.code)),(m||y&&"winners"in y)&&d&&r.Ay.createElement("div",{className:p.optionBottom},r.Ay.createElement("div",{className:p.perUserStars},(0,o.A)(S("BoostGift.Stars.PerUser",(0,i.Sm)(d))))))})),!v&&C&&r.Ay.createElement(A.A,{className:p.moreOptions,isText:!0,noForcedUpperCase:!0,onClick:b},S("Stars.Purchase.ShowMore"),r.Ay.createElement(d.A,{className:p.iconDown,name:"down"})))}))},65632:(e,t,a)=>{a.d(t,{A:()=>l});var r=a(84051),n=a(13439),s=a(31481),i=a(74824),o=a(87679);const l=(e,t)=>{const{setThemeSettings:a}=(0,n.ko)(),[l,c]=(0,r.J0)(t);return(0,r.vJ)((()=>{t&&(t.startsWith("#")?c(t):i.fetch(s.nfi,e,i.Type.Blob).then((e=>{const t=URL.createObjectURL(e);(0,o.NN)(t).then((()=>{c(`url(${t})`)}))})).catch((()=>{a({theme:e,background:void 0,backgroundColor:void 0,isBlurred:!0,patternColor:"dark"===e?s.MkD:s.be8})})))}),[t,e]),t?l:void 0}}}]);
//# sourceMappingURL=6930.a27d6db10bc54eaebe5d.js.map