1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="789e9ead-884c-4e24-92d1-8b931e39c84d",e._sentryDebugIdIdentifier="sentry-dbid-789e9ead-884c-4e24-92d1-8b931e39c84d")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5986],{95986:(e,t,s)=>{s.r(t),s.d(t,{LowBalanceWarning:()=>h,default:()=>p});var n=s(95155),i=s(12115),a=s(73321),r=s(1809),d=s(62725),l=s(5980),o=s(89319),c=s(34193),u=s(77106),b=s(51059),f=s(43631);let m=e=>{let t=Number(e);return Number.isFinite(t)?t:0},h=()=>{let{user:e}=(0,d.H$)(),t="string"==typeof e?.subscriptionType&&e.subscriptionType.includes("UNLIMITED")||!!e&&(m(e.instantPeriodCredits??e.instantCredits)>=1e9||m(e.instantCreditsTotal)>=1e9),s=(0,r.Of)(e=>e.outputType),h=(0,r.dE)(e=>e.selectedDuration),p=(0,r.dE)(e=>e.selectedSize),_=(0,r.dE)(e=>e.isGenerating),g=(0,d.ST)(),w=(0,f.n)(e=>e.modals.dailyWheel),x=(0,f.n)(e=>e.modals.noCredits),y=(0,f.n)(e=>e.openModal),N=(0,a.usePathname)()===l.K$,C=(0,i.useRef)(!1),v=(0,i.useMemo)(()=>e?.id?`engagement:wheel_low_balance_nudge_dismissed_session:${e.id}`:null,[e?.id]),[j,k]=(0,i.useState)(!1);(0,i.useEffect)(()=>{v?k("1"===window.sessionStorage.getItem(v)):k(!1)},[v]);let E="video"===s?(0,o.rd)({duration:m(h)||3,size:p}):1,I=e?Math.max(0,m(e.instantPeriodCredits??e.instantCredits)+m(e.dailyCredits)+m(e.subscriptionBonusCredits)+m(e.bonusCredits)):0,T=Math.floor(I/Math.max(1,E)),D=(0,i.useMemo)(()=>({user_id:e?.id??null,project:"zone",attempts_left:T,total_credits:I,action_cost:E,event_source:"low_balance_card",is_unlimited_plan:t}),[E,T,t,I,e?.id]),M=!!(e?.id&&(0,b.q)(e)&&!j&&!N&&!w&&!x&&!(g||_)&&T>0&&T<=2);(0,i.useEffect)(()=>{if(!M){C.current=!1;return}C.current||(C.current=!0,(0,c.s)("wheel_low_balance_nudge_shown",D))},[D,M]);let S=()=>{v&&(window.sessionStorage.setItem(v,"1"),k(!0))};return M?(0,n.jsxs)("section",{className:"fixed bottom-24 right-4 z-[92] w-[calc(100%-2rem)] max-w-sm overflow-hidden rounded-2xl border border-[#bcff47]/55 bg-[linear-gradient(135deg,rgba(34,64,20,0.96),rgba(16,32,12,0.98))] p-4 shadow-[0_0_24px_rgba(160,234,71,0.22)] backdrop-blur lg:bottom-6 lg:right-6",children:[(0,n.jsx)("div",{className:"pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_top_right,rgba(196,255,112,0.24),transparent_58%)]"}),(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-[0.09em] text-[#d8ff9a]",children:"Daily Wheel Ready"}),(0,n.jsxs)("p",{className:"mt-2 text-sm text-[#ecffd0]",children:["Low balance: only"," ",(0,n.jsx)("span",{className:"font-semibold",children:T})," generation",1===T?"":"s"," left."]}),(0,n.jsx)("p",{className:"mt-1 text-xs text-[#bdd991]",children:"Spin the wheel now for a chance to top up free credits."}),(0,n.jsxs)("div",{className:"mt-4 flex items-center gap-2",children:[(0,n.jsx)("button",{type:"button",onClick:()=>{S(),(0,c.s)("wheel_low_balance_nudge_dismissed",D)},className:"h-10 flex-1 rounded-full border border-[#7ea947]/70 bg-[#172711] text-sm font-medium text-[#d7edb3] transition hover:bg-[#21371a]",children:"Later"}),(0,n.jsx)("button",{type:"button","data-testcrew-priority":"fortune-wheel",onClick:()=>{(0,u.pL)(),S(),(0,c.s)("wheel_low_balance_nudge_open_clicked",D),y("dailyWheel")},className:"h-10 flex-1 rounded-full bg-[#d2f266] text-sm font-semibold text-[#1d2f13] transition hover:brightness-105",children:"Spin Wheel"})]})]})]}):null},p=h}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.