1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25284],{14618:(e,t,r)=>{function o(e,t){return!!t&&e.adminId===t}r.d(t,{X:()=>o})},25284:(e,t,r)=>{r.r(t),r.d(t,{GlobalCreditInterceptor:()=>s});var o=r(24342),n=r(98272),a=r(92226);let i=!1;function s(){return(0,o.useEffect)(()=>{!function(){if(i)return;i=!0;let e=window.fetch.bind(window);window.fetch=async function(){for(var t,r=arguments.length,o=Array(r),i=0;i<r;i++)o[i]=arguments[i];let s=await e(...o);if(s.ok&&402!==s.status||s.status<400||!(null!=(t=s.headers.get("content-type"))?t:"").includes("application/json")&&402!==s.status)return s;try{let e=s.clone(),t=await e.json().catch(()=>null);if((0,n._m)(t))return s;(function(e,t){if(402===e)return!0;if(!t||"object"!=typeof t)return!1;let r="object"==typeof t.error?t.error:null,o=r&&"code"in r?r.code:void 0;if("PAYMENT_REQUIRED"===o||"INSUFFICIENT_CREDITS"===o)return!0;let n=r&&"message"in r?r.message:"string"==typeof t.error?t.error:void 0;return!!("string"==typeof n&&/insufficient credits/i.test(n))})(s.status,t)&&(0,a.D)()}catch(e){}return s}}()},[]),null}},26726:(e,t,r)=>{r.d(t,{R:()=>o});let o=(0,r(66896).v)(e=>({open:!1,reason:null,openPaywall:t=>e({open:!0,reason:null!=t?t:null}),closePaywall:()=>e({open:!1,reason:null})}))},46830:(e,t,r)=>{r.d(t,{m:()=>n});var o=r(21830);let n=(0,o.createServerReference)("00d8843524f875889c1db26ae34e083c926575c5a6",o.callServer,void 0,o.findSourceMapURL,"getUserCredits")},90984:(e,t,r)=>{r.d(t,{n:()=>o});let o=(0,r(66896).v)(e=>({open:!1,openModal:()=>e({open:!0}),closeModal:()=>e({open:!1})}))},91829:(e,t,r)=>{r.d(t,{N:()=>a});var o=r(66896),n=r(46830);let a=(0,o.v)((e,t)=>({getCreatorCredits:null,loadingGetCreatorCredits:!1,errorGetCreatorCredits:null,hasFetchedCreatorCredits:!1,fetchCreatorCredits:async()=>{if(!t().hasFetchedCreatorCredits){e({loadingGetCreatorCredits:!0,errorGetCreatorCredits:null});try{let t=await (0,n.m)();if(!t)return void e({errorGetCreatorCredits:"Failed to reach server",loadingGetCreatorCredits:!1});t.success&&t.data?e({getCreatorCredits:t.data,loadingGetCreatorCredits:!1,hasFetchedCreatorCredits:!0}):e({errorGetCreatorCredits:t.error||"Failed to fetch credits",loadingGetCreatorCredits:!1})}catch(t){console.error("Error fetching credits:",t),e({errorGetCreatorCredits:"Unexpected error",loadingGetCreatorCredits:!1})}}},refresCreatorCredits:async()=>{e({hasFetchedCreatorCredits:!1}),await t().fetchCreatorCredits()},setCredits:t=>{e({getCreatorCredits:t,hasFetchedCreatorCredits:!0,loadingGetCreatorCredits:!1,errorGetCreatorCredits:null})}}))},92226:(e,t,r)=>{r.d(t,{D:()=>s});var o=r(9391),n=r(91829),a=r(26726),i=r(90984);function s(){if(o.useActiveTeamStore.getState().activeTeamId)return void i.n.getState().openModal();!function(){let e=n.N.getState().getCreatorCredits;return!!((null==e?void 0:e.membershipStatus)==="active"&&!(null==e?void 0:e.subscription_status_canceled)&&(null==e?void 0:e.planType)!=="one_time")}()&&(a.R.getState().open||a.R.getState().openPaywall())}},98272:(e,t,r)=>{r.d(t,{_m:()=>C,lQ:()=>c,rK:()=>d});var o=r(48154),n=r(18834),a=r(14618),i=r(9391),s=r(71704);let l=new Set(["TEAM_NO_SUBSCRIPTION","TEAM_OUT_OF_CREDITS","MEMBER_CAP_REACHED","MEMBER_PAUSED"]);function d(e){return"string"==typeof e&&l.has(e)}async function u(){var e,t,r;let o=i.useActiveTeamStore.getState().activeTeamId,l=null!=(t=null==(e=s.k.getState().user)?void 0:e.id)?t:null;if(!o)return{isOwner:!1,slug:null,teamId:null};try{let e=(await n.t.teams.list()).find(e=>e.id===o);return{isOwner:!!e&&(0,a.X)(e,l),slug:null!=(r=null==e?void 0:e.slug)?r:null,teamId:o}}catch(e){return{isOwner:!1,slug:null,teamId:o}}}function c(e){u().then(t=>{let{isOwner:r,slug:n,teamId:a}=t,i=r&&(null!=n?n:a)?"/creator-dashboard/teams/".concat(null!=n?n:a,"/billing"):null;switch(e){case"TEAM_NO_SUBSCRIPTION":o.toast.error("Team has no active subscription",{description:r?"Subscribe to start using AI generation for this team.":"Ask your team owner to subscribe before running AI generation.",action:i?{label:"Open team billing",onClick:()=>{window.location.assign(i)}}:void 0,duration:1e4});return;case"TEAM_OUT_OF_CREDITS":o.toast.error("Team is out of credits",{description:r?"Add seats or wait for the next cycle to top up the pool.":"Generation is paused until your team owner restores credits.",action:i?{label:"View team billing",onClick:()=>{window.location.assign(i)}}:void 0,duration:1e4});return;case"MEMBER_CAP_REACHED":o.toast.error("You've reached your monthly cap",{description:"Ask your team owner to raise it or wait for the next cycle.",duration:1e4});return;case"MEMBER_PAUSED":o.toast.error("Your spending is paused",{description:"Contact your team owner to resume.",duration:1e4});return;default:return e}})}function C(e){if(!e||"object"!=typeof e)return!1;let t="object"==typeof e.error&&null!==e.error?e.error:null,r=t&&"code"in t?t.code:void 0;return!!d(r)&&(c(r),!0)}}}]);
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.