2 lines
64 KiB
JavaScript
2 lines
64 KiB
JavaScript
"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[6930],{17563:(e,t,a)=>{a.r(t),a.d(t,{GiftInfoModal:()=>At,GiftModal:()=>nt,GiftRecipientPicker:()=>st,GiftUpgradeModal:()=>Et,GiftWithdrawModal:()=>It,PaidReactionModal:()=>De,StarPaymentModal:()=>de,StarsBalanceModal:()=>se,StarsGiftModal:()=>N,StarsGiftingPickerModal:()=>w,StarsSubscriptionModal:()=>Ne,StarsTransactionInfoModal:()=>Ee});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 E={modalDialog:"MFXAwnxJ",content:"Sl6xVf1R",main:"bTN9Jeph",headerInfo:"c6MiyJgW",logo:"StGLWvzb",logoBackground:"SyTXSfml",description:"kFe3mIZo",section:"BgfHkWd2",header:"zMtAGfXs",starHeaderText:"q3v8orGj",hiddenHeader:"bq3FnXT0",closeButton:"bDsDTkbe",avatar:"jK36xUj4",center:"v1PckUQn",secondaryInfo:"TDWSRfP9"},v=a.p+"StarLogo.600328787c79d99dfd66.svg",S=a.p+"stars-bg.dee4c4b73c7d21c2ec73.png",N=(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:N}=(0,n.ko)(),b=(0,r.li)(null),C=Boolean(e?.isOpen),k=(0,m.A)(e),I=(0,u.A)(),[G,w]=(0,r.J0)(),[T,P]=(0,r.J0)(!0);(0,r.vJ)((()=>{C||P(!0)}),[C]);const B=(0,d.A)((()=>{const e=b.current;if(e&&C){const{top:t,left:a,width:r,height:n}=e.querySelector(".modal-content").getBoundingClientRect();N({top:t,left:a,width:r,height:n,withStars:!0})}}));(0,r.vJ)((()=>{k?.isCompleted&&B()}),[k,B]);const M=(0,d.A)((e=>{k&&(w(e),i(t?{type:"starsgift",userId:t.id,stars:e.stars,currency:e.currency,amount:e.amount}:{type:"stars",stars:e.stars,currency:e.currency,amount:e.amount}))})),x=(0,d.A)((()=>{a()})),U=(0,r.Kr)((()=>{const e=I("lng_credits_summary_options_about").split("{link}");return[e[0],r.Ay.createElement(y.A,{url:I("StarsTOSLink"),text:I("lng_credits_summary_options_about_link")}),e[1]]}),[I]);return r.Ay.createElement(g.A,{className:(0,o.A)(E.modalDialog),contentClassName:E.content,dialogRef:b,isSlim:!0,onClose:x,isOpen:C},r.Ay.createElement("div",{className:(0,o.A)(E.main,"custom-scroll"),onScroll:function(e){const{scrollTop:t}=e.currentTarget;P(t<=150)}},r.Ay.createElement(f.A,{round:!0,size:"smaller",className:E.closeButton,color:"translucent",onClick:()=>a(),ariaLabel:I("Close")},r.Ay.createElement(p.A,{name:"close"})),r.Ay.createElement("div",{className:(0,o.A)(E.header,T&&E.hiddenHeader)},r.Ay.createElement("h2",{className:E.starHeaderText},I(t?"GiftStarsTitle":"Star.List.GetStars"))),r.Ay.createElement("div",{className:E.headerInfo},t?r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement(A.A,{size:100,peer:t,className:E.avatar}),r.Ay.createElement("img",{className:E.logoBackground,src:S,alt:"",draggable:!1})):r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement("img",{className:E.logo,src:v,alt:"",draggable:!1}),r.Ay.createElement("img",{className:E.logoBackground,src:S,alt:"",draggable:!1}))),r.Ay.createElement("h2",{className:(0,o.A)(E.headerText,E.center)},k?.isCompleted?t?(0,c.A)(I("Notification.StarsGift.SentYou",(0,l.A)(G.amount,G.currency,I.code)),["simple_markdown"]):(0,c.A)(I("StarsAcquiredInfo",G?.stars),["simple_markdown"]):I(t?"GiftStarsTitle":"Star.List.GetStars")),r.Ay.createElement("p",{className:E.description},t?(0,c.A)(I("ActionGiftStarsSubtitle",(0,s.F9N)(I,t)),["simple_markdown"]):I("Stars.Purchase.GetStarsInfo")),r.Ay.createElement("div",{className:E.section},r.Ay.createElement(h.A,{options:k?.starsGiftOptions,onClick:M}),r.Ay.createElement("div",{className:E.secondaryInfo},U))))})));var b=a(31481),C=a(87894),k=a(79582),I=a(54960),G=a(34642);const w=(0,r.ph)((0,n.EK)((e=>{const{chats:{listIds:t},currentUserId:a}=e;return{userIds:e.contactList?.userIds,activeListIds:t.active,archivedListIds:t.archived,currentUserId:a}}))((({isOpen:e,currentUserId:t,activeListIds:a,archivedListIds:i,userIds:o})=>{const{closeStarsGiftingPickerModal:l,openStarsGiftModal:c}=(0,n.ko)(),m=(0,u.A)(),[A,p]=(0,r.J0)(""),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,k.A)((0,C.Am)(l).filter((a=>{const r=e[a];return!(!r||r.isSupport||(0,s.tvf)(r)||(0,s.PL2)(r)||a===t||a===b.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(I.A,{className:"cuI2eDIY",itemIds:y,filterValue:A,filterPlaceholder:m("Search"),onFilterChange:p,isSearchable:!0,withDefaultPadding:!0,withStatus:!0,onSelectedIdChange:f}))})));var T=a(37661),P=a(39351),B=a(9267),M=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,P.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(B.A,{type:"gold",size:"middle"}),void 0!==e?(0,R.ZF)(a,e):"…"))}));var L=a(17663),K=a(14242),F=a(63527);const z={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,F.A)(function(e){return t=>(0,i.PVB)(t,e)}(a)),h=(0,d.A)((()=>{t({subscription:e})}));if(!g)return;const E=l<Date.now()/1e3,v=(0,L.A)(1e3*l,f.code,!0,"long");return r.Ay.createElement("div",{className:z.root,onClick:h},r.Ay.createElement("div",{className:z.preview},r.Ay.createElement(A.A,{size:"medium",peer:g}),r.Ay.createElement(B.A,{className:z.subscriptionStar,type:"gold",size:"small"})),r.Ay.createElement("div",{className:z.info},r.Ay.createElement("h3",{className:z.title},(0,c.A)((0,s.F9N)(f,g)||"")),p&&r.Ay.createElement("p",{className:z.subtitle},y&&r.Ay.createElement(A.A,{webPhoto:y,size:"micro"}),(0,c.A)(p)),r.Ay.createElement("p",{className:z.description},f(E?"StarsSubscriptionExpired":m?"StarsSubscriptionExpires":"StarsSubscriptionRenews",v))),r.Ay.createElement("div",{className:z.status},m||E?r.Ay.createElement("div",{className:z.statusEnded},f(E?"StarsSubscriptionStatusExpired":"StarsSubscriptionStatusCancelled")):r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement("div",{className:z.statusPricing},r.Ay.createElement(B.A,{className:z.star,type:"gold",size:"adaptive"}),r.Ay.createElement("span",{className:z.amount},(0,K.Sm)(o.amount))),r.Ay.createElement("div",{className:z.statusPeriod},f("StarsParticipantSubscriptionPerMonth")))))}));var H=a(58968),V=a(66833);function _(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 q(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 q(e){return e.amount?e.amount<0:e.nanos<0}var W=a(79577),j=a(40558),Q=a(62587),X=a(27860);const Y={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,Q.A)(i);return r.Ay.createElement("div",{className:(0,o.A)(Y.thumb,void 0!==t&&`stars-transaction-media-${t}`,a)},l&&r.Ay.createElement("img",{className:Y.blurry,src:l,alt:""}),c&&r.Ay.createElement("img",{className:Y.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)(Y.root,Y[`itemCount${s}`],a&&Y.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(X.A,{className:Y.thumb,isVisible:!0,width:e.width,height:e.height,thumbDataUri:e.thumbnail?.dataUri}):r.Ay.createElement(Z,{className:(0,o.A)(a&&s>0&&Y.noOutline),boughtMedia:e,index:s})})),i&&r.Ay.createElement("div",{className:Y.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,P.A)(),E=(0,u.A)(),v="peer"===y.type?y.id:void 0,S=(0,F.A)(function(e){return t=>e?(0,i.PVB)(t,e):void 0}(v)),N="starGiftUnique"===e.starGift?.type?e.starGift:void 0,b=N&&(0,V.yQ)(N),C=(0,r.Kr)((()=>{let t,a,r,n=_(E,e);if("peer"===e.peer.type)t=S&&(0,s.F9N)(E,S),r=S||H.lw;else{const a=(0,R.Pc)(e.peer);n=a.title||E(a.titleKey),t=E(a.subtitleKey),r=a}return e.isGiftUpgrade&&"starGiftUnique"===e.starGift?.type&&(t=e.starGift.title),e.photo&&(r=void 0),e.isRefund&&(a=E("StarsRefunded")),e.hasFailed&&(a=E("StarsFailed")),e.isPending&&(a=E("StarsPending")),{title:n,description:t,avatarPeer:r,status:a}}),[E,S,e]),k=(0,r.Kr)((()=>{if(b){const{backdrop:e}=(0,V.uc)(N),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:b,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:C.avatarPeer}),Boolean(g)&&r.Ay.createElement(B.A,{className:ee.subscriptionStar,type:"gold",size:"small"}))}),[f,p,b,g,C.avatarPeer,N]),I=(0,d.A)((()=>{a({transaction:e})}));return r.Ay.createElement("div",{className:(0,o.A)(ee.root,t),onClick:I},r.Ay.createElement("div",{className:ee.preview},k),r.Ay.createElement("div",{className:ee.info},r.Ay.createElement("h3",{className:ee.title},C.title),C.description&&r.Ay.createElement("p",{className:ee.description},(0,c.A)(C.description)),r.Ay.createElement("p",{className:ee.date},(0,L.L2)(1e3*l,E.code,!0),C.status&&` — (${C.status})`)),r.Ay.createElement("div",{className:ee.stars},r.Ay.createElement("span",{className:(0,o.A)(ee.amount,q(m)?ee.negative:ee.positive)},(0,R.hk)(h,m)),r.Ay.createElement(B.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:E,openInvoice:N}=(0,n.ko)(),{balance:b,history:C,subscriptions:k}=t||{},I=(0,u.A)(),G=(0,P.A)(),[w,R]=(0,r.J0)(!0),[L,K]=(0,r.J0)(0),[F,z,H]=(0,T.A)(),V=Boolean(e&&t),{originStarsPayment:_,originReaction:q,originGift:W,topup:j}=e||{},Q=_||q||W||j,X=_?.form?.invoice?.totalAmount||_?.subscriptionInfo?.subscriptionPricing?.amount||q?.amount||W?.gift.stars||j?.balanceNeeded,Y=X?X-(b?.amount||0):void 0,Z=(0,r.Kr)((()=>{const e=(0,n.mS)();if(q){const t=(0,i.hds)(e,q.chatId);if(!t)return;return I("StarsNeededTextReactions",(0,s.JsG)(I,t))}if(_){const t=_.form?.botId?(0,i.mBe)(e,_.form.botId):void 0;if(!t)return;return I("StarsNeededText",(0,s.YgS)(t))}if(W){const t=(0,i.mBe)(e,W.peerId);if(!t)return;return I("StarsNeededTextGift",(0,s.F9N)(G,t))}if("subs"===j?.purpose)return I("StarsNeededTextLink")}),[q,_,W,j?.purpose,G,I]),$=Boolean(C?.all?.transactions.length&&!Q),ee=!Q,se=(0,r.Kr)((()=>re.map((e=>({title:G(e)})))),[G]);(0,r.vJ)((()=>{V||(R(!0),K(0),H())}),[V]),(0,r.vJ)((()=>{Q?z():H()}),[Q]);const ie=(0,r.Kr)((()=>{if(!V)return;const e=I("lng_credits_summary_options_about").split("{link}");return[e[0],r.Ay.createElement(y.A,{url:I("StarsTOSLink"),text:I("lng_credits_summary_options_about_link")}),e[1]]}),[V,I]),oe=(0,d.A)((()=>{m({type:ae[L]})})),le=(0,d.A)((()=>{A()})),ce=(0,d.A)((()=>{E({})})),me=(0,d.A)((e=>{N({type:"stars",stars:e.stars,currency:e.currency,amount:e.amount})}));return r.Ay.createElement(g.A,{className:D.root,isOpen:V,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:b,className:D.modalBalance}),r.Ay.createElement("div",{className:(0,o.A)(D.header,w&&D.hiddenHeader)},r.Ay.createElement("h2",{className:D.starHeaderText},I("TelegramStars"))),r.Ay.createElement("div",{className:D.section},r.Ay.createElement("img",{className:D.logo,src:v,alt:"",draggable:!1}),r.Ay.createElement("img",{className:D.logoBackground,src:S,alt:"",draggable:!1}),r.Ay.createElement("h2",{className:D.headerText},Y?I("StarsNeededTitle",X):I("TelegramStars")),r.Ay.createElement("div",{className:D.description},(0,c.A)(Z||I("TelegramStarsInfo"),["simple_markdown","emoji"])),a&&!F&&r.Ay.createElement(f.A,{className:D.starButton,onClick:z},I("Star.List.BuyMoreStars")),a&&!F&&ee&&r.Ay.createElement(f.A,{className:(0,o.A)(D.starButton,"settings-main-menu-star"),color:"translucent",onClick:ce},r.Ay.createElement(B.A,{className:"icon",type:"gold",size:"big"}),I("TelegramStarsGift")),F&&t?.topupOptions&&r.Ay.createElement(h.A,{starsNeeded:Y,options:t.topupOptions,onClick:me})),F&&r.Ay.createElement("div",{className:D.tos},ie),$&&Boolean(k?.list.length)&&r.Ay.createElement("div",{className:D.section},r.Ay.createElement("h3",{className:D.sectionTitle},I("StarMySubscriptions")),r.Ay.createElement("div",{className:D.subscriptions},k?.list.map((e=>r.Ay.createElement(J,{key:e.id,subscription:e}))),k?.nextOffset&&r.Ay.createElement(f.A,{isText:!0,disabled:k.isLoading,size:"smaller",noForcedUpperCase:!0,className:D.loadMore,onClick:le},r.Ay.createElement(p.A,{name:"down",className:D.loadMoreIcon}),I("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(M.A,{onLoadMore:oe,items:C?.[ae[L]]?.transactions,scrollContainerClosest:`.${D.main}`,itemSelector:`.${ne}`,className:D.transactions,noFastList:!0},C?.[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(B.A,{type:"gold",className:(0,o.A)("star-amount-icon",s),size:"adaptive"});return e("StarsAmount",{amount:t},{withNodes:!0,specialReplacement:{[b.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)(),[E,v,N]=(0,T.A)(),b=Boolean(e?.inputInvoice&&a),C=(0,le.A)(e),k=e||C,{form:I,subscriptionInfo:G}=k||{},w=I?.invoice?.totalAmount||G?.subscriptionPricing?.amount,M=Boolean(I?.invoice.subscriptionPeriod),x=!G?.subscriptionPricing,U=I?.photo,R=(0,u.A)(),L=(0,P.A)();(0,r.vJ)((()=>{b||N()}),[b]);const F=(0,r.Kr)((()=>{if(!k?.inputInvoice)return"";const e=(0,s.YgS)(t),a=R("Stars.Intro.PurchasedText.Stars",w);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:w},{withNodes:!0,withMarkdown:!0,pluralValue:w}):M?L("StarsSubscribeBotText",{name:I.title,amount:w,bot:e},{pluralValue:w}):R("Stars.Transfer.Info",[I.title,e,a])}),[k?.inputInvoice,t,R,w,i,G,M,I,l,L]),z=(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]),H=(0,d.A)((()=>{const t=a?.balance;void 0!==w&&void 0!==t&&(w>t.amount?p({originStarsPayment:e}):(h({}),v()))}));return r.Ay.createElement(g.A,{contentClassName:D.paymentContent,isOpen:b,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(B.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)(w),badgeClassName:D.amountBadge,className:D.paymentPhoto}),r.Ay.createElement("img",{className:D.paymentImageBackground,src:S,alt:"",draggable:!1})),r.Ay.createElement("h2",{className:D.headerText},R(J?"StarsSubscribeTitle":"StarsConfirmPurchaseTitle")),x&&r.Ay.createElement(me.A,{className:D.botItem,peerId:I?.botId}),r.Ay.createElement("div",{className:D.description},(0,c.A)(F,["simple_markdown","emoji"])),r.Ay.createElement(f.A,{className:D.paymentButton,size:"smaller",onClick:H,isLoading:E},L(M?"StarsSubscribeBotButtonMonth":"StarsPay",{amount:oe(L,w,{asFont:!0})},{withNodes:!0})),z&&r.Ay.createElement("div",{className:(0,o.A)(D.disclaimer,D.smallerText)},z))})));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",Ee=(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,P.A)(),g=(0,u.A)(),{transaction:h}=e||{},E=(0,d.A)((()=>{const e=h?.extendedMedia;e&&c({origin:ue.TQ.StarsTransaction,standaloneMedia:e.flatMap((e=>Object.values(e)))})})),v=(0,r.Kr)((()=>{if(!h)return;const{giveawayPostId:e,photo:n,stars:c,isGiftUpgrade:m,starGift:d}=h,u=h?.starGift,v="starGiftUnique"===u?.type,N=h?.starGift?(0,V.yQ)(h.starGift):i,b=v?(0,V.uc)(u):void 0,C=h.peer&&"peer"!==h.peer.type&&(0,R.Pc)(h.peer)||void 0,k="peer"===h.peer?.type?h.peer.id:void 0,I=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=_(g,h),w=t&&h.messageId&&!m?(0,s.ytg)(t,void 0,h.messageId):void 0,T=t&&e&&(0,s.ytg)(t,void 0,e),P=h.extendedMedia,M=P?.length||0,x=P?.every((e=>!e.video)),U=P?.every((e=>!e.photo)),D=g(x?"Stars.Transfer.Photos":U?"Stars.Transfer.Videos":"Media",M),O=h.description||(m&&"starGiftUnique"===d?.type?d.title:void 0)||(P?D:void 0),K=!P&&!N,F=n?void 0:t||C,z=v&&r.Ay.createElement("div",{className:(0,o.A)(ge,"ApoQz22o")},r.Ay.createElement(fe,{backdropAttribute:b.backdrop,patternAttribute:b.pattern,modelAttribute:b.model,title:u.title,subtitle:f("GiftInfoCollectible",{number:u.number})})),J=r.Ay.createElement("div",{className:ge},P&&r.Ay.createElement($,{className:(0,o.A)("C5r59yiV","transaction-media-preview"),media:P,onClick:E}),!P&&N&&r.Ay.createElement(W.A,{key:h.id,sticker:N,play:a,noLoop:!0}),K&&r.Ay.createElement(A.A,{peer:F,webPhoto:n,size:"giant"}),!N&&r.Ay.createElement("img",{className:(0,o.A)("nML8IQqX"),src:S,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,q(c)?"xDyq9cc0":"jvBZSrpd")},(0,R.hk)(f,c)),r.Ay.createElement(B.A,{type:"gold",size:"middle"}))),H=[];let j;h.starRefCommision&&H.push([g("StarsTransaction.StarRefReason.Title"),g("StarsTransaction.StarRefReason.Program")]),m&&H.push([g("StarGiftReason"),g("StarGiftReasonUpgrade")]),j=m?g("Stars.Transaction.GiftFrom"):q(c)||h.isMyGift?g("Stars.Transaction.To"):h.starRefCommision?g("StarsTransaction.StarRefReason.Miniapp"):g(k?"Star.Transaction.From":"Stars.Transaction.Via"),H.push([j,k?{chatId:k}:I||""]),w&&H.push([g("Stars.Transaction.Reaction.Post"),r.Ay.createElement(y.A,{url:w,text:w})]),T&&(H.push([g("BoostReason"),r.Ay.createElement(y.A,{url:T,text:g("Giveaway")})]),H.push([g("Gift"),g("Stars",h.stars,"i")])),h.id&&H.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"}))]),H.push([g("Stars.Transaction.Date"),(0,L.L2)(1e3*h.date,g.code,!0)]);const Q=g("lng_credits_box_out_about").split("{link}");return{header:v?z:J,tableData:H,footer:r.Ay.createElement("span",{className:"KgzPpgS6"},Q[0],r.Ay.createElement(y.A,{url:g("StarsTOSLink"),text:g("lng_credits_summary_options_about_link")}),Q[1])}}),[h,g,f,t,a,i]),N=(0,le.A)(v)||v;return r.Ay.createElement(pe.A,{isOpen:Boolean(h),className:"IzhfRIWu",hasBackdrop:"starGiftUnique"===h?.starGift?.type,header:N?.header,tableData:N?.tableData,footer:N?.footer,buttonText:g("OK"),onClose:m})})));var ve=a(70636);const Se="oBLHWBtJ",Ne=(0,r.ph)((0,n.EK)(((e,{modal:t})=>{const a=t?.subscription.peerId;return{peer:a?(0,i.PVB)(e,a):void 0}}))((({modal:e,peer:t})=>{const{closeStarsSubscriptionModal:a,fulfillStarsSubscription:s,changeStarsSubscription:i,checkChatInvite:l,loadStarStatus:c,openInvoice:m}=(0,n.ko)(),p=(0,u.A)(),g=(0,P.A)(),{subscription:h}=e||{},E=(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]),v=(0,d.A)((()=>{if(h){switch(E){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()}})),N=(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,ve.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(B.A,{className:"enRetSny",type:"gold",size:"adaptive"})),r.Ay.createElement("img",{className:(0,o.A)("zGCayu45"),src:S,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:{[b.Cyx]:r.Ay.createElement(B.A,{className:"J8HIcN6k",size:"adaptive",type:"gold"})}}))),u=[];u.push([p(m?"StarsSubscriptionBot":"StarsSubscriptionChannel"),{chatId:t.id}]),l&&u.push([p("StarsSubscriptionBotProduct"),l]);const N=a<Date.now()/1e3;u.push([p(N?"StarsSubscriptionUntilExpired":n?"StarsSubscriptionUntilExpires":"StarsSubscriptionUntilRenews"),(0,L.L2)(1e3*a,p.code,!0)]);const C=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:Se},C),n&&r.Ay.createElement("p",{className:"nkwiG25Q"},p(c?"StarsSubscriptionBotCancelledText":"StarsSubscriptionCancelledText")),s&&r.Ay.createElement("p",{className:Se},p("StarsSubscriptionRefulfillInfo",(0,L.L2)(1e3*a,p.code,!0))),!n&&!s&&N&&r.Ay.createElement("p",{className:Se},p("StarsSubscriptionExpiredInfo",(0,L.L2)(1e3*a,p.code,!0))),!n&&!s&&!N&&r.Ay.createElement("p",{className:Se},p("StarsSubscriptionCancelInfo",(0,L.L2)(1e3*a,p.code,!0))),"hidden"!==E&&r.Ay.createElement(f.A,{size:"smaller",color:"cancel"===E?"danger":"primary",isText:"cancel"===E,onClick:v},p("cancel"===E?"StarsSubscriptionCancel":"refulfill"===E?"StarsSubscriptionRefulfill":"restart"===E?"StarsSubscriptionAgain":"renew"===E?"StarsSubscriptionRenew":"OK")))}}),[E,g,p,t,h]),C=(0,le.A)(N)||N;return r.Ay.createElement(pe.A,{isOpen:Boolean(h),className:"eR_RZfGB",header:C?.header,tableData:C?.tableData,footer:C?.footer,onClose:a})})));var be=a(19806),Ce=a(32581),ke=a(66644),Ie=a(15283),Ge=a(93545),we=a(68292),Te=a(85118);const Pe={root:"CuBAw2yg",slider:"euOOAbZi",sparkles:"_L1YQTIP",progress:"kwK0cNPX",floatingBadgeWrapper:"uvlMoXj0",floatingBadge:"BGSDWAYc",floatingBadgeText:"qqQan8uF",floatingBadgeTriangle:"mIdJOmsB"},Be=[50,100,500,1e3,2e3,5e3,1e4];function Me(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<Be.length;a++)if(Be[a]<e&&t.push(Be[a]),Be[a]>=e){t.push(e);break}return t}),[e]),[l,c]=(0,r.J0)(0);(0,Ie.A)((()=>{c(Me(i,t))}));const m=(0,d.A)((()=>{const e=s.current;if(!e)return;const t=e.parentElement;(0,ke.YS)((()=>{const a=t.offsetLeft+e.offsetWidth/2,r=t.offsetLeft+t.offsetWidth-e.offsetWidth/2;(0,ke.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)(Pe.root,a),style:"--progress: "+l/i.length},r.Ay.createElement("div",{className:Pe.floatingBadgeWrapper},r.Ay.createElement("div",{className:Pe.floatingBadge,ref:s},r.Ay.createElement("div",{className:Pe.floatingBadgeText},r.Ay.createElement(p.A,{name:"star",className:Pe.floatingBadgeIcon}),r.Ay.createElement(we.A,{text:(0,K.Sm)(xe(i,l))})),r.Ay.createElement("svg",{className:Pe.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:Pe.progress}),r.Ay.createElement(Te.A,{preset:"progress",className:Pe.sparkles}),r.Ay.createElement("input",{className:Pe.slider,type:"range",min:0,max:i.length,defaultValue:Me(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)(),[E,v]=(0,r.J0)(50),[S,N,C]=(0,T.A)(),[k,I]=(0,r.J0)(!0),G=(0,u.A)(),w=(0,P.A)(),B=(0,d.A)((e=>{I(e.target.checked)})),M=(0,d.A)((e=>{v(e),N()}));(0,r.vJ)((()=>{e||C()}),[e]),(0,r.vJ)((()=>{const e=a?.reactions?.topReactors?.find((e=>e.isMe));I(e?!e.isAnonymous:m||!0)}),[m,a?.reactions?.topReactors]);const x=(0,d.A)((()=>{e&&(h({chatId:e.chatId,messageId:e.messageId,count:E,isPrivate:!k}),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&&S?E:0,isMe:t.isMe,isAnonymous:t.isAnonymous,user:a}))})),!s&&S){const t=(0,i.mBe)(e,e.currentUserId);r.push({amount:0,localAmount:E,isMe:!0,user:t})}return r.sort(((e,t)=>t.amount+t.localAmount-(e.amount+e.localAmount))),r.slice(0,3)}),[S,a?.reactions?.topReactors,E]),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:M}),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(Ce.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&&!k?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(be.A,{className:"oQ5Ar48z",checked:k,onChange:B,label:G("StarsReactionShowMeInTopSenders")}),r.Ay.createElement(f.A,{size:"smaller",onClick:x},w("SendPaidReaction",{amount:E},{withNodes:!0,specialReplacement:{[b.Cyx]:r.Ay.createElement(p.A,{className:"NJJFuym9",name:"star"})}})),r.Ay.createElement("p",{className:"KRvkHeo1"},w("StarsReactionTerms",{link:r.Ay.createElement(y.A,{text:w("StarsReactionLinkText"),url:w("StarsReactionLink")})},{withNodes:!0})))})));var Oe=a(37836),Le=a(5912),Ke=a(65632),Fe=a(20333),ze=a(75373),Je=a(96530),He=a(22720),Ve=a(63152),_e=a(94079);const qe="zZUpGRSI",We="nTPAv1ci",je=(0,r.ph)((0,n.EK)(((e,{peerId:t})=>{const a=(0,i.SJA)(e),{isBlurred:r,patternColor:n,background:s,backgroundColor:o}=e.settings.themes[a]||{},l=(0,i.PVB)(e,t),c=(0,i.nTw)(e);return{peer:l,theme:a,isBackgroundBlurred:r,patternColor:n,customBackground:s,backgroundColor:o,captionLimit:e.appConfig?.starGiftMaxMessageLength,currentUserId:e.currentUserId,isPaymentFormLoading:c.isPaymentFormLoading}}))((function({gift:e,peerId:t,peer:a,captionLimit:i,theme:c,isBackgroundBlurred:m,patternColor:u,backgroundColor:A,customBackground:p,currentUserId:y,isPaymentFormLoading:g}){const{sendStarGift:h,openInvoice:E,openGiftUpgradeModal:v}=(0,n.ko)(),S=(0,P.A)(),[N,C]=(0,r.J0)(""),[k,I]=(0,r.J0)(!1),[G,w]=(0,r.J0)(!1),T=(0,Ke.A)(c,p),B="id"in e,M=a&&(0,ve.mO)(a),x=(0,r.Kr)((()=>B?{id:-1,chatId:y,isOutgoing:!1,senderId:y,date:Math.floor(Date.now()/1e3),content:{action:{targetChatId:t,mediaType:"action",text:"ActionGiftInbound",type:"starGift",currency:b.OUy,amount:e.stars,starGift:{type:"starGift",message:N?.length?{text:N}:void 0,isNameHidden:k,starsToConvert:e.starsToConvert,canUpgrade:G||void 0,alreadyPaidUpgradeStars:G?e.upgradeStars:void 0,isSaved:!1,gift:e,peerId:t,fromId:y},translationValues:["%action_origin%","%gift_payment_amount%"]}}}:{id:-1,chatId:"0",isOutgoing:!0,senderId:y,date:Math.floor(Date.now()/1e3),content:{action:{targetChatId:t,mediaType:"action",text:"ActionGiftInbound",type:"giftPremium",amount:e.amount,currency:e.currency,months:e.months,message:{text:N},translationValues:["%action_origin%","%gift_payment_amount%"]}}}),[y,e,N,B,k,G,t]),U=(0,d.A)((e=>{C(e.target.value)})),R=(0,d.A)((()=>{I(!k)})),D=(0,d.A)((()=>{w(!G)})),O=(0,d.A)((()=>{B&&v({giftId:e.id,peerId:t})})),L=(0,d.A)((()=>{B?h({peerId:t,shouldHideName:k,gift:e,message:N?{text:N}:void 0,shouldUpgrade:G}):E({type:"giftcode",userIds:[t],currency:e.currency,amount:e.amount,option:e,message:N?{text:N}:void 0})})),K=(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:K,style:T?`--custom-background: ${T}`:void 0}),r.Ay.createElement(ze.A,{key:B?e.id:e.months,message:x})),function(){const t=i?i-N.length:void 0,n=(0,s.F9N)(S,a);return r.Ay.createElement("div",{className:"Y68CEIKn"},r.Ay.createElement(_e.A,{className:"o5r2IPoA",onChange:U,value:N,label:S("GiftMessagePlaceholder"),maxLength:i,maxLengthIndicator:t&&t<50?t.toString():void 0}),B&&e.upgradeStars&&r.Ay.createElement(He.A,{className:qe,narrow:!0,ripple:!0,onClick:D},r.Ay.createElement("span",null,S("GiftMakeUnique",{stars:oe(S,e.upgradeStars,{className:"zAee80Dv"})},{withNodes:!0})),r.Ay.createElement(Ve.A,{checked:G,onChange:D,label:S("GiftMakeUniqueAcc")})),B&&r.Ay.createElement("div",{className:We},M?S("GiftMakeUniqueDescription",{user:n,link:r.Ay.createElement(Je.A,{isPrimary:!0,onClick:O},S("GiftMakeUniqueLink"))},{withNodes:!0}):S("GiftMakeUniqueDescriptionChannel",{peer:n,link:r.Ay.createElement(Je.A,{isPrimary:!0,onClick:O},S("GiftMakeUniqueLink"))},{withNodes:!0})),B&&r.Ay.createElement(He.A,{className:qe,narrow:!0,ripple:!0,onClick:R},r.Ay.createElement("span",null,S("GiftHideMyName")),r.Ay.createElement(Ve.A,{checked:k,onChange:R,label:S("GiftHideMyName")})),B&&r.Ay.createElement("div",{className:We},M?S("GiftHideNameDescription",{receiver:n}):S("GiftHideNameDescriptionChannel")))}(),r.Ay.createElement("div",{className:"ATowWJ60"}),function(){const t=B?oe(S,e.stars+(G?e.upgradeStars:0),{asFont:!0}):(0,l.v)(e.amount,e.currency);return r.Ay.createElement("div",{className:"jxWZSvet"},B&&e.availabilityRemains&&r.Ay.createElement(Fe.A,{isPrimary:!0,progress:e.availabilityRemains/e.availabilityTotal,rightText:S("GiftSoldCount",{count:e.availabilityTotal-e.availabilityRemains}),leftText:S("GiftLeftCount",{count:e.availabilityRemains}),className:"mWzLu0c0"}),r.Ay.createElement(f.A,{className:"IDuhjrne",onClick:L,isLoading:g},S("GiftSend",{amount:t},{withNodes:!0})))}())})));var Qe=a(87049);const Xe="G1mBmzxs",Ye="a8no5WH0",Ze=(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,P.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:Xe,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:Ye,nonInteractive:!0,size:"tiny",pill:!0,fluid:!0},(0,l.A)(o,c)),Boolean(p)&&r.Ay.createElement(Qe.A,{color:"red",text:m("GiftDiscount",{percent:p})}))}))),$e=(0,r.ph)((function({gift:e,observeIntersection:t,onClick:a}){const{openGiftInfoModal:s}=(0,n.ko)(),i=(0,r.li)(null),l=(0,P.A)(),[c,m]=(0,T.A)(),{stars:u,isLimited:A,isSoldOut:y,sticker:g}=e,h=(0,d.A)((()=>{y?s({gift:e}):a(e)}));return(0,Le.mv)(i,t,(e=>{e.isIntersecting&&m()})),r.Ay.createElement("div",{ref:i,className:(0,o.A)(Xe,"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:Ye,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(Qe.A,{color:"blue",text:l("GiftLimited")}),y&&r.Ay.createElement(Qe.A,{color:"red",text:l("GiftSoldOut")}))}));var et=a(36838);const tt=(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,P.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(B.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,et.A)(a,void 0,!0),r.Ay.createElement("div",{ref:a,className:(0,o.A)("cUjwvN00","no-scrollbar")},c("all"),c("limited"),c("stock"),s?.map(c))}))),at={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"},rt=(0,Oe.nF)((e=>e()),200,!0),nt=(0,r.ph)((0,n.EK)(((e,{modal:t})=>{const{starGifts:a,stars:r,currentUserId:n}=e,s=t?.forPeerId?(0,i.PVB)(e,t.forPeerId):void 0,o=Boolean(n&&t?.forPeerId===n);return{boostPerSentGift:e.appConfig?.boostsPerSentGift,starGiftsById:a?.byId,starGiftIdsByCategory:a?.idsByCategory,starBalance:r?.balance,peer:s,isSelf:o}}))((({modal:e,starGiftsById:t,starGiftIdsByCategory:a,starBalance:i,peer:l,isSelf:c})=>{const{closeGiftModal:p,requestConfetti:h}=(0,n.ko)(),E=(0,r.li)(null),v=(0,r.li)(null),N=(0,r.li)(null),b=(0,r.li)(null),C=Boolean(e),k=(0,m.A)(e),I=l&&(0,ve.mO)(l)?l:void 0,G=l&&(0,ve.vj)(l)?l:void 0,[w,T]=(0,r.J0)(),[B,M]=(0,r.J0)(!0),[x,R]=(0,r.J0)(!1),[D,L]=(0,r.J0)("all"),K=(0,u.A)(),F=(0,P.A)(),z=(0,r.Kr)((()=>k?.gifts?.sort(((e,t)=>e.months-t.months)).filter((e=>1===e.users))),[k]),J=(0,r.Kr)((()=>z?.reduce(((e,t)=>e.amount<t.amount?e:t))),[z]),{observe:H}=(0,Le.BL)({rootRef:b,throttleMs:200,isDisabled:!C}),V=(0,d.A)((()=>{const e=E.current;if(e&&C){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)((()=>{k?.isCompleted&&V()}),[k]),(0,r.vJ)((()=>{C||(M(!0),T(void 0),L("all"))}),[C]);const _=(0,d.A)((e=>{if(w)return;const t=e.currentTarget;rt((()=>{const{scrollTop:e}=t;if(M(e<=150),v.current&&N.current){const{top:e}=N.current.getBoundingClientRect(),{top:t}=v.current.getBoundingClientRect();R(e-t<=0)}}))})),q=F("GiftPremiumDescription",{user:(0,s.YgS)(I),link:r.Ay.createElement(y.A,{text:F("GiftPremiumDescriptionLinkCaption"),url:F("GiftPremiumDescriptionLink")})},{withNodes:!0}),W=G?F("StarGiftDescriptionChannel",{peer:(0,s.F9N)(F,G)},{withNodes:!0,withMarkdown:!0}):c?F("StarGiftDescriptionSelf",void 0,{withNodes:!0,renderTextFilters:["br"]}):F("StarGiftDescription",{user:(0,s.YgS)(I)},{withNodes:!0,withMarkdown:!0}),j=(0,d.A)((e=>{T(e),R("id"in e),M(!1)})),Q=(0,d.A)((e=>{L(e)})),X=(0,d.A)((()=>{w?T(void 0):p()})),Y=Boolean(w),Z=(0,o.A)("animated-close-icon",Y&&"state-back");return r.Ay.createElement(g.A,{dialogRef:E,onClose:p,isOpen:C,isSlim:!0,contentClassName:at.content,className:(0,o.A)(at.modalDialog,at.root)},r.Ay.createElement(f.A,{className:at.closeButton,round:!0,color:"translucent",size:"smaller",onClick:X,ariaLabel:K(Y?"Common.Back":"Common.Close")},r.Ay.createElement("div",{className:Z})),r.Ay.createElement(O,{className:at.balance,balance:i}),r.Ay.createElement("div",{className:(0,o.A)(at.header,B&&at.hiddenHeader)},r.Ay.createElement(U.Ay,{name:"slideVerticalFade",activeKey:Number(x),slideClassName:at.headerSlide},r.Ay.createElement("h2",{className:at.commonHeaderText},F(x?c?"StarsGiftHeaderSelf":"StarsGiftHeader":"GiftPremiumHeader")))),r.Ay.createElement(U.Ay,{ref:v,className:at.transition,name:"pushSlide",activeKey:w?1:0},!w&&r.Ay.createElement("div",{ref:b,className:(0,o.A)(at.main,"custom-scroll"),onScroll:_},r.Ay.createElement("div",{className:at.avatars},r.Ay.createElement(A.A,{size:100,peer:l}),r.Ay.createElement("img",{className:at.logoBackground,src:S,alt:"",draggable:!1})),!c&&!G&&r.Ay.createElement("h2",{className:(0,o.A)(at.headerText,at.center)},F("GiftPremiumHeader")),!c&&!G&&r.Ay.createElement("p",{className:(0,o.A)(at.description,at.center)},q),!c&&!G&&r.Ay.createElement("div",{className:at.premiumGiftsGallery},z?.map((e=>r.Ay.createElement(Ze,{option:e,baseMonthAmount:J?Math.floor(J.amount/J.months):void 0,onClick:j})))),r.Ay.createElement("h2",{ref:N,className:(0,o.A)(at.headerText,at.center)},F(c?"StarsGiftHeaderSelf":"StarsGiftHeader")),r.Ay.createElement("p",{className:(0,o.A)(at.description,at.starGiftsDescription,at.center)},W),r.Ay.createElement(tt,{onCategoryChanged:Q}),r.Ay.createElement(U.Ay,{name:"zoomFade",activeKey:($=D,"all"===$?-2:"limited"===$?-1:"stock"===$?0:$),className:at.starGiftsTransition},r.Ay.createElement("div",{className:at.starGiftsContainer},t&&a?.[D].map((e=>{const a=t[e];return r.Ay.createElement($e,{gift:a,observeIntersection:H,onClick:j})}))))),w&&k?.forPeerId&&r.Ay.createElement(je,{gift:w,peerId:k.forPeerId})));var $})));const st=(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,k.A)((0,C.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(I.A,{className:"wOipz1Y_",itemIds:p,filterValue:m,filterPlaceholder:l("Search"),onSelectedIdChange:y,onFilterChange:A,isSearchable:!0,withDefaultPadding:!0,withStatus:!0,forceShowSelf:!0}))})));var it=a(80140),ot=a(18501),lt=a(81949),ct=a(94189),mt=a(22699),dt=a(24433);const ut={modal:"nnublcCk",header:"p7FTs7_p",title:"pIbzzTir",description:"CCPfr26t",soldOut:"kjWcRp4W",footer:"bho0GTYt",footerDescription:"VUylTszM",unknown:"zDauXmpS",giftValue:"w_E4LkUj",uniqueAttribute:"OJQnkf17",uniqueGift:"I6o_pGAm",starAmountIcon:"_5guecUe",modalHeader:"ie9tImaj",modalCloseButton:"p38RBGdC",ownerAddress:"DavMRg4Q",copyIcon:"SLX5tX8C"},At=(0,r.ph)((0,n.EK)(((e,{modal:t})=>{const a=t?.gift,r=a&&"gift"in a&&a.fromId,n=r?(0,i.PVB)(e,r):void 0,o=t?.peerId?(0,i.PVB)(e,t.peerId):void 0,l=o&&(0,ve.vj)(o)?o:void 0,c=l&&(0,s.ubU)(l,"postMessages");return{fromPeer:n,targetPeer:o,currentUserId:e.currentUserId,starGiftMaxConvertPeriod:e.appConfig?.starGiftMaxConvertPeriod,hasAdminRights:c}}))((({modal:e,fromPeer:t,targetPeer:a,currentUserId:l,starGiftMaxConvertPeriod:c,hasAdminRights:y})=>{const{closeGiftInfoModal:g,changeGiftVisibility:h,convertGiftToStars:E,openChatWithInfo:v,focusMessage:S,openGiftUpgradeModal:N,showNotification:C,openChatWithDraft:k,openGiftWithdrawModal:I}=(0,n.ko)(),[G,w,B]=(0,T.A)(),M=(0,P.A)(),x=(0,u.A)(),U=Boolean(e),R=(0,m.A)(e),D=(0,m.A)(t),O=(0,m.A)(a),F=O&&(0,ve.vj)(O),{gift:z}=R||{},J=z&&"gift"in z,_=J?z:void 0,q=_?.fromId===l,j=_&&c&&_.date+c-(0,it.Fm)()||0,Q=Math.ceil(j/60/60/24),X=J?z.gift:z,Y=X&&(0,V.yQ)(X),Z=Boolean(_?.upgradeMsgId),$=!Z&&_?.inputGift&&(F?y:O?.id===l),ee=(0,d.A)((()=>{g()})),te=(0,r.Kr)((()=>{const e="starGiftUnique"===X?.type?X.slug:void 0;if(e)return`${b.jsp}nft/${e}`}),[X]),ae=(0,d.A)((()=>{te&&((0,Ae.eM)(te),C({message:M("LinkCopied")}))})),re=(0,d.A)((()=>{te&&(k({text:{text:te}}),ee())})),ne=(0,d.A)((()=>{"starGiftUnique"===_?.gift.type&&I({gift:_})})),se=(0,d.A)((()=>{if(!_?.upgradeMsgId||!O)return;const{upgradeMsgId:e}=_;S({chatId:O.id,messageId:e}),ee()})),le=(0,d.A)((()=>{const{inputGift:e,isUnsaved:t}=_;h({gift:e,shouldUnsave:!t}),ee()})),ce=(0,d.A)((()=>{const{inputGift:e}=_;E({gift:e}),B(),ee()})),me=(0,d.A)((()=>{_&&N({giftId:_.gift.id,gift:_})})),de=(0,r.Kr)((()=>X&&(0,V.uc)(X)),[X]),ue=(0,r.Kr)((()=>({onTrigger:e,isMenuOpen:t})=>r.Ay.createElement(f.A,{round:!0,size:"smaller",color:"translucent-white",className:t?"active":"",onClick:e,ariaLabel:M("AriaMoreButton")},r.Ay.createElement(p.A,{name:"more"}))),[M]),ye=(0,d.A)((()=>Z?r.Ay.createElement(f.A,{size:"smaller",onClick:se},M("GiftInfoViewUpgraded")):$&&_?.alreadyPaidUpgradeStars&&!_.upgradeMsgId?r.Ay.createElement(f.A,{size:"smaller",isShiny:!0,onClick:me},M("GiftInfoUpgradeForFree")):r.Ay.createElement(f.A,{size:"smaller",onClick:ee},M("OK")))),ge=(0,r.Kr)((()=>{if(!z||!X)return;const{fromId:e,isNameHidden:t,starsToConvert:a,isUnsaved:l,isConverted:c}=_||{},m=t&&O,d=(()=>{if(!_)return M("GiftInfoSoldOutDescription");if(!F){if(_.upgradeMsgId)return M("GiftInfoDescriptionUpgraded");if(_.canUpgrade&&_.alreadyPaidUpgradeStars)return $?M("GiftInfoDescriptionFreeUpgrade"):M("GiftInfoPeerDescriptionFreeUpgradeOut",{peer:(0,s.F9N)(M,O)});if($||q)return c&&a?$?M("GiftInfoDescriptionConverted",{amount:(0,K.Sm)(a)},{pluralValue:a,withNodes:!0,withMarkdown:!0}):M("GiftInfoPeerDescriptionOutConverted",{amount:(0,K.Sm)(a),peer:(0,s.F9N)(M,O)},{pluralValue:a,withNodes:!0,withMarkdown:!0}):_.canUpgrade&&$?M("GiftInfoDescriptionUpgrade",{amount:(0,K.Sm)(a)},{pluralValue:a,withNodes:!0,withMarkdown:!0}):$?M("GiftInfoDescription",{amount:a},{withNodes:!0,withMarkdown:!0,pluralValue:a||0}):M("GiftInfoPeerDescriptionOut",{amount:a,peer:(0,s.F9N)(M,O)},{withNodes:!0,withMarkdown:!0,pluralValue:a||0})}})(),u="starGiftUnique"===X.type,y=r.Ay.createElement(mt.A,{className:"with-menu-transitions",trigger:ue,positionX:"right"},r.Ay.createElement(dt.A,{icon:"link-badge",onClick:ae},M("CopyLink")),r.Ay.createElement(dt.A,{icon:"forward",onClick:re},M("Share")),$&&u&&r.Ay.createElement(dt.A,{icon:"diamond",onClick:ne},M("GiftInfoWithdraw"))),h=r.Ay.createElement("div",{className:ut.modalHeader},r.Ay.createElement(f.A,{className:ut.modalCloseButton,round:!0,color:"translucent-white",size:"smaller",ariaLabel:M("Close"),onClick:ee},r.Ay.createElement(p.A,{name:"close"})),U&&y),E=u&&r.Ay.createElement("div",{className:(0,o.A)(ut.header,ut.uniqueGift)},r.Ay.createElement(fe,{backdropAttribute:de.backdrop,patternAttribute:de.pattern,modelAttribute:de.model,title:X.title,subtitle:M("GiftInfoCollectible",{number:X.number})})),S=r.Ay.createElement("div",{className:ut.header},r.Ay.createElement(W.A,{className:ut.giftSticker,sticker:Y,size:120}),r.Ay.createElement("h1",{className:ut.title},"starGiftUnique"===X?.type?X.title:M(_?$?"GiftInfoReceived":"GiftInfoTitle":"GiftInfoSoldOutTitle")),d&&r.Ay.createElement("p",{className:(0,o.A)(ut.description,!_&&"starGift"===X?.type&&ut.soldOut)},d)),N=[];if("starGift"===X.type){(e||t)&&N.push([M("GiftInfoFrom"),e?{chatId:e}:r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement(A.A,{size:"small",peer:H.I5}),r.Ay.createElement("span",{className:ut.unknown},x(H.I5.titleKey)))]),_?.date&&N.push([M("GiftInfoDate"),(0,L.L2)(1e3*_.date,M.code,!0)]),X.firstSaleDate&&N.push([M("GiftInfoFirstSale"),(0,L.L2)(1e3*X.firstSaleDate,M.code,!0)]),X.lastSaleDate&&N.push([M("GiftInfoLastSale"),(0,L.L2)(1e3*X.lastSaleDate,M.code,!0)]);const n=X.stars+(_?.alreadyPaidUpgradeStars||0);N.push([M("GiftInfoValue"),r.Ay.createElement("div",{className:ut.giftValue},oe(M,n,{className:ut.starAmountIcon}),$&&j>0&&Boolean(a)&&r.Ay.createElement(lt.A,{onClick:w},M("GiftInfoConvert",{amount:a},{pluralValue:a})))]),X.availabilityTotal&&N.push([M("GiftInfoAvailability"),M("GiftInfoAvailabilityValue",{count:X.availabilityRemains||0,total:X.availabilityTotal},{pluralValue:X.availabilityRemains||0})]),X.upgradeStars&&!_?.upgradeMsgId&&N.push([M("GiftInfoStatus"),r.Ay.createElement("div",{className:ut.giftValue},M("GiftInfoStatusNonUnique"),$&&r.Ay.createElement(lt.A,{onClick:me},M("GiftInfoUpgradeBadge")))]),_?.message&&N.push([void 0,(0,ot.f)(_.message)])}if("starGiftUnique"===X.type){const{ownerName:e,ownerAddress:t,ownerId:a}=X,{model:o,backdrop:l,pattern:c,originalDetails:m}=de||{};if(t?N.push([M("GiftInfoOwner"),r.Ay.createElement("span",{className:ut.ownerAddress,onClick:()=>{(0,Ae.eM)(t),C({message:{key:"WalletAddressCopied"},icon:"copy"})}},t,r.Ay.createElement(p.A,{className:ut.copyIcon,name:"copy"}))]):N.push([M("GiftInfoOwner"),a?{chatId:a}:e||""]),o&&N.push([M("GiftAttributeModel"),r.Ay.createElement("span",{className:ut.uniqueAttribute},o.name,r.Ay.createElement(lt.A,null,(0,K.l9)(o.rarityPercent)))]),l&&N.push([M("GiftAttributeBackdrop"),r.Ay.createElement("span",{className:ut.uniqueAttribute},l.name,r.Ay.createElement(lt.A,null,(0,K.l9)(l.rarityPercent)))]),c&&N.push([M("GiftAttributeSymbol"),r.Ay.createElement("span",{className:ut.uniqueAttribute},c.name,r.Ay.createElement(lt.A,null,(0,K.l9)(c.rarityPercent)))]),N.push([M("GiftInfoAvailability"),M("GiftInfoIssued",{issued:X.issuedCount,total:X.totalCount})]),m){const{date:e,recipientId:t,message:a,senderId:o}=m,l=(0,n.mS)(),c=e=>{v({id:e}),g()},d=(0,i.PVB)(l,t),u=o?(0,i.PVB)(l,o):void 0,A=(0,L.L2)(1e3*e,M.code,!0),p=r.Ay.createElement(Je.A,{onClick:()=>c(t),isPrimary:!0},(0,s.F9N)(M,d));let y;if(u&&o!==t){const e=r.Ay.createElement(Je.A,{onClick:()=>c(u.id),isPrimary:!0},(0,s.F9N)(M,u));y=a?M("GiftInfoPeerOriginalInfoTextSender",{peer:p,sender:e,text:(0,ot.f)(a),date:A},{withNodes:!0}):M("GiftInfoPeerOriginalInfoSender",{peer:p,date:A,sender:e},{withNodes:!0})}else y=a?M("GiftInfoPeerOriginalInfoText",{peer:p,text:(0,ot.f)(a),date:A},{withNodes:!0}):M("GiftInfoPeerOriginalInfo",{peer:p,date:A},{withNodes:!0});N.push([void 0,r.Ay.createElement("span",null,y)])}}return{modalHeader:u?h:void 0,header:u?E:S,tableData:N,footer:r.Ay.createElement("div",{className:ut.footer},$&&r.Ay.createElement("div",{className:ut.footerDescription},r.Ay.createElement("div",null,M(`GiftInfo${F?"Channel":""}${l?"Hidden":"Saved"}`,{link:r.Ay.createElement(Je.A,{isPrimary:!0,onClick:le},M("GiftInfoSaved"+(l?"Show":"Hide")))},{withNodes:!0})),m&&r.Ay.createElement("div",null,M("GiftInfoSenderHidden"))),ye())}}),[z,_,O,Y,M,$,j,q,x,X,de,ye,F,ue,U]);return r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement(pe.A,{isOpen:U,modalHeader:ge?.modalHeader,header:ge?.header,hasBackdrop:"starGiftUnique"===X?.type,tableData:ge?.tableData,footer:ge?.footer,className:ut.modal,onClose:ee}),_&&r.Ay.createElement(ct.A,{isOpen:G,onClose:B,confirmHandler:ce,title:M("GiftInfoConvertTitle")},r.Ay.createElement("div",null,M("GiftInfoPeerConvertDescription",{amount:ie(M,_.starsToConvert),peer:(0,s.F9N)(M,D)},{withNodes:!0,withMarkdown:!0})),j>0&&r.Ay.createElement("div",null,M("GiftInfoConvertDescriptionPeriod",{count:Q},{withNodes:!0,withMarkdown:!0,pluralValue:Q})),r.Ay.createElement("div",null,M("GiftInfoConvertDescription2"))))})));var pt=a(23174),yt=a(58554),ft=a(32625),gt=a(5463);const ht="_Dt6RSQV",Et=(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,P.A)(),h=(0,d.A)((()=>a())),E=(0,d.A)((()=>{const e=l?.gift;e?.inputGift&&(i({gift:e.inputGift,shouldKeepOriginalDetails:u,upgradeStars:e.alreadyPaidUpgradeStars?void 0:e.gift.upgradeStars}),h())})),v=(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,ft.A)(v,o?3e3:void 0,!0),(0,r.vJ)((()=>{o&&l?.sampleAttributes&&v()}),[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,yt.hd)(e,pt.qZ.BlobUrl)}))}),[l?.sampleAttributes]);const S=(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("GiftPeerUpgradeText",{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:ht,size:"smaller",onClick:h},g("OK")),e&&r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement(be.A,{label:g("GiftUpgradeKeepDetails"),onCheck:A,checked:u}),r.Ay.createElement(f.A,{className:ht,size:"smaller",isShiny:!0,onClick:E},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(gt.A,{isOpen:o,header:S?.header,footer:S?.footer,listItemData:S?.listItemData,hasBackdrop:!0,onClose:h})})));var vt=a(21309),St=a(76023),Nt=a(15535);const bt={header:"omOOKktw",giftPreview:"U_aropYW",backdrop:"FJcFY5PJ",description:"L26FNUBR",arrow:"SjEeGvk8",noPassword:"fQoPDdGf"},Ct={isCustomPeer:!0,avatarIcon:"fragment",title:"",customPeerAvatarColor:"#000000"},kt=4.5*St.$,It=(0,r.ph)((0,n.EK)((e=>{const{settings:{byKey:{hasPassword:t}},twoFaSettings:{hint:a}}=e;return{hasPassword:t,passwordHint:a}}))((({modal:e,hasPassword:t,passwordHint:a})=>{const{closeGiftWithdrawModal:s,clearGiftWithdrawError:i,processStarGiftWithdrawal:o}=(0,n.ko)(),l=Boolean(e),[c,u]=(0,r.J0)(!1),y=(0,P.A)(),f=(0,m.A)(e),h=f?.gift?.gift,E=h&&(0,V.uc)(h),v=f?.gift?.canExportAt?Math.max(f.gift.canExportAt-(0,it.Fm)(),0):void 0,S=(0,d.A)((()=>{s()})),N=(0,d.A)((e=>{o({gift:f.gift.inputGift,password:e})}));return r.Ay.createElement(g.A,{isOpen:l,title:y("GiftWithdrawTitle"),hasCloseButton:!0,isSlim:!0,onClose:S},E&&r.Ay.createElement(r.Ay.Fragment,null,r.Ay.createElement("div",{className:bt.header},r.Ay.createElement("div",{className:bt.giftPreview},r.Ay.createElement(j.A,{className:bt.backdrop,backgroundColors:[E.backdrop.centerColor,E.backdrop.edgeColor],patternColor:E.backdrop?.patternColor,patternIcon:E.pattern?.sticker}),r.Ay.createElement(W.A,{className:bt.sticker,size:kt,sticker:E.model?.sticker})),r.Ay.createElement(p.A,{name:"next",className:bt.arrow}),r.Ay.createElement(A.A,{peer:Ct,size:"giant",className:bt.avatar})),r.Ay.createElement("p",{className:bt.description},y("GiftWithdrawDescription",{gift:`${h.title} #${h.number}`},{withNodes:!0,withMarkdown:!0,renderTextFilters:["br"]}))),Boolean(v)&&r.Ay.createElement("p",{className:bt.exportHint},y("GiftWithdrawWait",{days:(0,vt._k)(v)},{pluralValue:(0,vt._k)(v)})),!t&&r.Ay.createElement("span",{className:bt.noPassword},y("ErrorPasswordMissing")),t&&!v&&r.Ay.createElement(Nt.A,{shouldShowSubmit:!0,placeholder:y("CheckPasswordPlaceholder"),error:f?.errorKey&&y.withRegular(f?.errorKey),description:y("CheckPasswordDescription"),clearError:i,isLoading:f?.isLoading,hint:a,isPasswordVisible:c,shouldResetValue:l,onChangePasswordVisibility:u,submitLabel:y("GiftWithdrawSubmit"),onSubmit:N}))})))},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,modalHeader:p,footer:y,buttonText:f,className:g,hasBackdrop:h,onClose:E,onButtonClick:v})=>{const{openChat:S}=(0,n.ko)(),N=(0,i.A)((e=>{S({id:e}),E()}));return r.Ay.createElement(m.A,{isOpen:e,hasCloseButton:Boolean(t),hasAbsoluteCloseButton:!t,absoluteCloseButtonColor:h?"translucent-white":void 0,isSlim:!0,header:p,title:t,className:g,contentClassName:"KYHkJ9Qf",onClose:E},u&&r.Ay.createElement(o.A,{peer:u,size:"jumbo",className:"SHQbPR5Y"}),A,r.Ay.createElement("div",{className:"DFRB0Ad4"},a?.map((([e,t])=>r.Ay.createElement(r.Ay.Fragment,null,e&&r.Ay.createElement("div",{className:(0,s.A)(d,"AwnUe4Qk")},e),r.Ay.createElement("div",{className:(0,s.A)(d,"JGH6P9Az",!e&&"UssCZwgy")},"object"==typeof t&&"chatId"in t?r.Ay.createElement(l.A,{peerId:t.chatId,className:"aS9U4hiQ",forceShowSelf:!0,withEmojiStatus:t.withEmojiStatus,clickArg:t.chatId,onClick:N}):t))))),y,f&&r.Ay.createElement(c.A,{className:y?void 0:"cSamlkt9",size:"smaller",onClick:v||E},f))}))},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 E=(0,m.A)(),v=(0,c.A)(),[S,N,b]=(0,l.A)();(0,r.vJ)((()=>{e||b()}),[e]);const[C,k]=(0,r.Kr)((()=>{if(!a)return[void 0,!1];const e=a.reduce(((e,t)=>e.stars>t.stars?e:t)),t=g&&e.stars<g,r=[];let n=0,s=!1;return a.forEach(((e,i)=>{e.isExtended||n++,g&&!t&&e.stars<g||(S||!e.isExtended?r.push({option:e,starsCount:Math.min(n,6),isWide:i===a.length-1}):s=!0)})),[r,s]}),[S,a,g]);return r.Ay.createElement("div",{className:(0,n.A)(p.options,t)},C?.map((({option:e,starsCount:t,isWide:a})=>{const l=C?.length,c=l%2==0,m=e===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:v.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,E.code)),(m||y&&"winners"in y)&&d&&r.Ay.createElement("div",{className:p.optionBottom},r.Ay.createElement("div",{className:p.perUserStars},(0,o.A)(E("BoostGift.Stars.PerUser",(0,i.Sm)(d))))))})),!S&&k&&r.Ay.createElement(A.A,{className:p.moreOptions,isText:!0,noForcedUpperCase:!0,onClick:N},E("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.2dc2ea133529b0d74d44.js.map
|