1 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="28c616e8-b67e-5210-bc7e-69908ecba0cd")}catch(e){}}(); 3import{a as C,p as U,R as J}from"./chunk-6CSD65Y2-DjtNb_ff.js";import{C as rt,D as F,E as at,F as ct,Q as X,n as it,G as ut,H as ft,I as _t,J as dt,K as ht,L as lt,M as z,N as mt,O as Et,e as At,a as pt}from"./useAuthentication-X70MRig0.js";import"./debug-build-BtUWSgWk.js";import{a as St,B as Tt}from"./urls-D3qjKvID.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"2a3b4ea4db4c495d724e88e0b293f68b57fd7294"}}catch{}})();function q(t,e){const n=new Set(e);return t.filter(s=>!n.has(s))}function Ct(t,e,n){const s=t.slice(0);return s[e]=n,s}var Rt=class extends rt{#o;#t;#r;#s;#e;#n;#a;#c;#i;#u=[];constructor(t,e,n){super(),this.#o=t,this.#s=n,this.#r=[],this.#e=[],this.#t=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#e.forEach(t=>{t.subscribe(e=>{this.#h(t,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#e.forEach(t=>{t.destroy()})}setQueries(t,e){this.#r=t,this.#s=e,F.batch(()=>{const n=this.#e,s=this.#d(this.#r);s.forEach(u=>u.observer.setOptions(u.defaultedQueryOptions));const o=s.map(u=>u.observer),r=o.map(u=>u.getCurrentResult()),a=n.length!==o.length,i=o.some((u,_)=>u!==n[_]),f=a||i,E=f?!0:r.some((u,_)=>{const c=this.#t[_];return!c||!at(u,c)});!f&&!E||(f&&(this.#u=s,this.#e=o),this.#t=r,this.hasListeners()&&(f&&(q(n,o).forEach(u=>{u.destroy()}),q(o,n).forEach(u=>{u.subscribe(_=>{this.#h(u,_)})})),this.#l()))})}getCurrentResult(){return this.#t}getQueries(){return this.#e.map(t=>t.getCurrentQuery())}getObservers(){return this.#e}getOptimisticResult(t,e){const n=this.#d(t),s=n.map(r=>r.observer.getOptimisticResult(r.defaultedQueryOptions)),o=n.map(r=>r.defaultedQueryOptions.queryHash);return[s,r=>this.#_(r??s,e,o),()=>this.#f(s,n)]}#f(t,e){return e.map((n,s)=>{const o=t[s];return n.defaultedQueryOptions.notifyOnChangeProps?o:n.observer.trackResult(o,r=>{e.forEach(a=>{a.observer.trackProp(r)})})})}#_(t,e,n){if(e){const s=this.#i,o=n!==void 0&&s!==void 0&&(s.length!==n.length||n.some((r,a)=>r!==s[a]));return(!this.#n||this.#t!==this.#c||o||e!==this.#a)&&(this.#a=e,this.#c=this.#t,n!==void 0&&(this.#i=n),this.#n=ct(this.#n,e(t))),this.#n}return t}#m(){return this.#s?.combine!==void 0&&this.#e.some((t,e)=>t.options.suspense&&this.#t[e]?.data===void 0)}#d(t){const e=new Map;this.#e.forEach(s=>{const o=s.options.queryHash;if(!o)return;const r=e.get(o);r?r.push(s):e.set(o,[s])});const n=[];return t.forEach(s=>{const o=this.#o.defaultQueryOptions(s),a=e.get(o.queryHash)?.shift()??new X(this.#o,o);n.push({defaultedQueryOptions:o,observer:a})}),n}#h(t,e){const n=this.#e.indexOf(t);n!==-1&&(this.#t=Ct(this.#t,n,e),this.#l())}#l(){if(this.hasListeners()){const t=this.#f(this.#t,this.#u),e=this.#m(),n=this.#n,s=e?n:this.#_(t,this.#s?.combine);(e||n!==s)&&F.batch(()=>{this.listeners.forEach(o=>{o(this.#t)})})}}};function It({queries:t,...e},n){const s=it(),o=ut(),r=ft(),a=C.useMemo(()=>t.map(d=>{const p=s.defaultQueryOptions(d);return p._optimisticResults=o?"isRestoring":"optimistic",p}),[t,s,o]);a.forEach(d=>{_t(d);const p=s.getQueryCache().get(d.queryHash);dt(d,r,p)}),ht(r);const[i]=C.useState(()=>new Rt(s,a,e)),[f,E,u]=i.getOptimisticResult(a,e.combine),_=!o&&e.subscribed!==!1;C.useSyncExternalStore(C.useCallback(d=>_?i.subscribe(F.batchCalls(d)):lt,[i,_]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),C.useEffect(()=>{i.setQueries(a,e)},[a,e,i]);const l=f.some((d,p)=>z(a[p],d))?f.flatMap((d,p)=>{const m=a[p];if(m&&z(m,d)){const T=new X(s,m);return mt(m,T,r)}return[]}):[];if(l.length>0)throw Promise.all(l);const A=f.find((d,p)=>{const m=a[p];return m&&Et({result:d,errorResetBoundary:r,throwOnError:m.throwOnError,query:s.getQueryCache().get(m.queryHash),suspense:m.suspense})});if(A?.error)throw A.error;return E(u())}const $=C.createContext();function Ae({value:t,...e}){return U.jsx($.Provider,{value:t??!0,...e})}const pe=()=>C.useContext($)??!1,Se={USE_OFFER_ENGINE_IN_UPGRADE_ENDPOINT:"gm-use-offer-engine-in-upgrade-endpoint",HANDLE_RENEWAL_IN_TSM_SIGNUP:"gm-handle-renewal-in-tsm-signup",LOW_WTP_2026_SPRING_NEW_STACK:"gm-low-wtp-2026-spring-new-stack",PAID_MARKETING_TRACKING_NEW_STACK:"gm-paid-marketing-tracking-new-stack",DISABLE_TRIAL_IN_COUNTRIES:"gm-disable-trial-in-countries",NEW_STACK_LOGIN:"gm-new-stack-login",SOCIAL_AUTH_TOKEN_ERROR_GRACEFUL_RETRY:"gm-social-auth-token-error-graceful-retry",SIMPLE_SIGNUP:"gm-simple-signup",AI_MASTER:"ai-master",CRAFT_AI_MASTER:"gm-craft-ai-master",CRAFT_AI_V2_AB_TEST:"gm-abtest-craft-ai-v2",CRAFT_AI_V3_AB_TEST:"gm-abtest-craft-ai-v3",CRAFT_AI_V4_AB_TEST:"gm-abtest-craft-ai-v4",CRAFT_ONBOARDING:"gm-craft-onboarding",CRAFT_OFFER_PAYWALL:"gm-craft-offer-paywall",CRAFT_OFFER_PAYWALL_AB_TEST:"gm-abtest-craft-offer-paywall",ONETRUST:"onetrust",TAG_GOOGLE_TAG_MANAGER:"tag-google-tag-manager",SSO_REDESIGN:"gm-sso-redesign",DASHBOARD_ENGAGEMENT_TOOLS:"dashboard-engagement-tools",DASHBOARD_BRAZE_IN_APP_MESSAGING:"dashboard-braze-in-app-messaging",NEW_STACK_CREDITS_V2_PRICING_PAGE:"gm-new-stack-credits-v2-pricing-page",NEW_STACK_USE_LANGUAGE_SELECT:"gm-new-stack-use-language-select",NEW_STACK_DASHBOARD:"gm-new-stack-dashboard",NEW_STACK_SLACK_NOTIFICATIONS_SETTINGS:"gm-new-stack-slack-notifications-settings",NEW_STACK_WITH_STRIPE:"gm-new-stack-with-stripe",STRIPE_ADDRESS_ELEMENT_BILLING_ADDRESS:"gm-stripe-address-element-billing-address",NEW_STACK_USER_SETTINGS:"gm-new-stack-user-settings",NEW_STACK_EDIT_EMAIL:"gm-new-stack-edit-email",NEW_STACK_MONTHLY_FREQUENCY_SELECTOR:"gm-new-stack-monthly-frequency-selector",ONETAP_SIGNUP_BOXFISH:"gm-google-onetap-signup-to-boxfish",ONETAP_SIGNUP_DASHBOARD:"gm-google-onetap-signup-to-dashboard",NEW_STACK_PAYWALLS:"gm-use-new-stack-paywalls",REFERRAL_SYSTEM_AI_CREDITS:"gm-referral-system-ai-credits-for-referrals",NEW_STACK_ENABLE_GOOGLE_SSO:"gm-new-stack-enable-google-sso",NEW_STACK_ENABLE_APPLE_SSO:"gm-new-stack-enable-apple-sso",NEW_STACK_ENABLE_OTHER_SSO:"gm-new-stack-enable-other-sso",CREDITS_V2:"gm-credits-v2",NEW_STACK_RTL:"gm-new-stack-rtl",NEW_STACK_POSTHOG_TRACKING:"gm-new-stack-posthog-tracking",NEW_STACK_JOIN_THE_TEAM:"gm-new-stack-join-the-team",NEW_STACK_PAYMENTS_MOBILE:"gm-new-stack-payments-mobile",PARTNERSTACK_TAG_PRODUCT_KEY:"gm-partnerstack-tag-product-key",NEW_DESIGN_SYSTEM:"gm-new-design-system",OPTIMIZELY_SNIPPET:"optimizely-snippet",STRIPE_CREDIT_SYSTEM:"gm-stripe-credit-system",CHURNKEY_CANCEL_FLOW:"gm-use-churnkey-cancel-flow",STRIPE_CREDIT_SYSTEM_ALLOW_TOP_UP:"gm-stripe-credit-system-allow-top-up",REFERRAL_CREDIT_GRANTS_IN_TSM_SIGNUP:"gm-referral-credit-grants-in-tsm-signup",CRAFT_P2_USD_HIGH_MONTHLY:"craft-p2-usd-high-monthly",ENABLE_NEW_STACK_FOR_OLD_STACK_BASIC_USERS:"gm-enable-new-stack-for-zuora-basic-users",STACK_ROUTING_V2:"payments-stack-routing-v2",SKIP_RECAPTCHA:"gm-skip-recaptcha",NEW_STACK_VIEW_PAGE:"gm-new-stack-view-page",NEW_STACK_SIGNUP_FLOWS:"gm-new-stack-signup-flows",NEW_STACK_INVITE_TEAM:"gm-new-stack-invite-team",HOMEPAGE_DRAFT_V2:"draft-v2-homepage",HOMEPAGE_CRAFT_V3_VARIANT_C:"craft-v3-variant-c",LATAM_CURRENCY_MXN:"gm-new-stack-latam-currency-mxn",LATAM_CURRENCY_COP:"gm-new-stack-latam-currency-cop",LATAM_CURRENCY_BRL:"gm-new-stack-latam-currency-brl",LATAM_CURRENCY_MXN_AB_TEST:"abtest-gm-new-stack-latam-currency-mxn",LATAM_CURRENCY_COP_AB_TEST:"abtest-gm-new-stack-latam-currency-cop",LATAM_CURRENCY_BRL_AB_TEST:"abtest-gm-new-stack-latam-currency-brl",NEW_STACK_LATAM_PRICING:"gm-new-stack-latam-pricing",DUMMY_BUCKETING_DEBUG_PANEL:"gm-dummy-bucketing-debug-panel",DUMMY_BUCKETING_CLIENT_TEST:"gm-dummy-bucketing-client-test",DUMMY_BUCKETING_SERVER_TEST:"gm-dummy-bucketing-server-test"},wt=100;class vt{constructor(e,n=wt){this.pending=[],this.timer=null,this.fetchFn=e,this.batchWindowMs=n}load(e){return new Promise((n,s)=>{this.pending.push({flagName:e,resolve:n,reject:s}),this.scheduleFlush()})}scheduleFlush(){this.timer===null&&(this.timer=setTimeout(()=>this.flush(),this.batchWindowMs))}async flush(){this.timer=null;const e=this.pending.splice(0);if(e.length===0)return;const n=[...new Set(e.map(s=>s.flagName))];try{const s=await this.fetchFn(n);for(const o of e)o.resolve(s[o.flagName]??!1)}catch(s){for(const o of e)o.reject(s instanceof Error?s:new Error(String(s)))}}}const I={BASE_URL:"/gts/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_BACKEND_URL:"https://prezi.com",VITE_ENABLE_MOCK_SOCIAL_AUTH:"false",VITE_GOOGLE_OAUTH_CLIENT_ID:"733691752913-92koi2nsmq47a12bipaltcavufel8l9t.apps.googleusercontent.com",VITE_LAST_COMMIT:"2a3b4ea4db4c495d724e88e0b293f68b57fd7294",VITE_PAYPAL_CLIENT_ID:"AU6xA2JmR31_aaNjOfON7XEynNwN65rFE8mq5FY_WCpBhC0mE_93KeHkbUbzw55eKm2GX6sXxeufqKdV",VITE_PAYPAL_CUSTOM_PAYMENT_METHOD_ID:"cpmt_1SBNG6A0xHayJ9eqlK50EkXg",VITE_POSTHOG_API_KEY:"phc_q1YziAYreRJayCuelPRX3ZTYXO75k6hutHN4SlyPqRy",VITE_RECAPTCHA_SITE_KEY:"6LfqdegrAAAAAIYoa7N2OydvQR5TiQa8RiuYFVL8",VITE_SENTRY_DSN:"https://[email protected]/4509315559063552",VITE_STRIPE_PUBLISHABLE_KEY:"pk_live_51Nvf7MA0xHayJ9eqi95JydNkKihTpn4TxTE2Z0Z8wr8Gml4dsut3RwFeLrz5EiI5M9TcnnLO4dK6mtyBM4X55uP700f0im7m0l"};function Z(t){return"init"in t}function b(t){return typeof t.write=="function"}function Nt(t){return!!t.onMount}function Q(t){return"v"in t||"e"in t}function D(t){if("e"in t)throw t.e;if((I?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v}function P(t){return typeof t?.then=="function"}function gt(t){if(!(t instanceof Error))return!1;const e=t.name,n=t.message.toLowerCase();return(e==="RangeError"||e==="InternalError")&&(n.includes("call stack")||n.includes("too much recursion")||n.includes("stack overflow"))}function k(t,e,n){if(!n.p.has(t)){n.p.add(t);const s=()=>n.p.delete(t);e.then(s,s)}}function B(t,e,n){const s=n.get(t),o=s?.t,r=e.p;if(!o?.size)return r;
3if(!r.size)return o;const a=new Set(o);for(const i of r)a.add(i);return a}function Ot(t){return!!t.INTERNAL_onInit}const yt=(t,e,n,...s)=>n.read(...s),Lt=(t,e,n,...s)=>n.write(...s),Mt=(t,e,n)=>n.INTERNAL_onInit(e),Dt=(t,e,n,s)=>{var o;return(o=n.onMount)==null?void 0:o.call(n,s)},Pt=(t,e,n)=>{var s;const o=t[0];let r=o.get(n);if(!r){const a=t[6],i=t[9];r={d:new Map,p:new Set,n:0},o.set(n,r),(s=a.i)==null||s.call(a,n),Ot(n)&&i(t,e,n)}return r},Gt=(t,e)=>{var n;const s=t[1],o=t[3],r=t[4],a=t[5],i=t[6],f=t[13];if(!i.f&&!o.size&&!r.size&&!a.size)return;const E=[],u=_=>{try{_()}catch(c){E.push(c)}};do{i.f&&u(i.f);const _=new Set;for(const c of o){const l=(n=s.get(c))==null?void 0:n.l;if(l)for(const A of l)_.add(A)}o.clear();for(const c of a)_.add(c);a.clear();for(const c of r)_.add(c);r.clear();for(const c of _)u(c);o.size&&f(t,e)}while(o.size||a.size||r.size);if(E.length)throw new AggregateError(E)},Kt=(t,e)=>{const n=t[1],s=t[2],o=t[3],r=t[11],a=t[14],i=t[17];if(!o.size)return;const f=[],E=[],u=new WeakSet,_=new WeakSet,c=[],l=[];for(const A of o)c.push(A),l.push(r(t,e,A));for(;c.length;){const A=c.length-1,d=c[A],p=l[A];if(_.has(d)){c.pop(),l.pop();continue}if(u.has(d)){if(s.get(d)===p.n)f.push(d),E.push(p);else if((I?"production":void 0)!=="production"&&s.has(d))throw new Error("[Bug] invalidated atom exists");_.add(d),c.pop(),l.pop();continue}u.add(d);for(const m of B(d,p,n))u.has(m)||(c.push(m),l.push(r(t,e,m)))}for(let A=f.length-1;A>=0;--A){const d=f[A],p=E[A];let m=!1;for(const T of p.d.keys())if(T!==d&&o.has(T)){m=!0;break}m&&(s.set(d,p.n),a(t,e,d),i(t,e,d)),s.delete(d)}},W=new WeakSet,Ut=(t,e,n)=>{var s,o;const r=t[1],a=t[2],i=t[3],f=t[6],E=t[7],u=t[11],_=t[12],c=t[13],l=t[14],A=t[16],d=t[17],p=t[20],m=t[26],T=t[28],h=u(t,e,n),R=T[0];if(Q(h)){if(r.has(n)&&a.get(n)!==h.n||h.m===R)return h.m=R,h;let S=!1;for(const[v,O]of h.d)if(l(t,e,v).n!==O){S=!0;break}if(!S)return h.m=R,h}let w=!0;const N=new Set(h.d.keys()),L=()=>{for(const S of N)h.d.delete(S)},M=()=>{if(r.has(n)){const S=!i.size;d(t,e,n),S&&(c(t,e),_(t,e))}},nt=S=>{var v;if(S===n){const x=u(t,e,S);if(!Q(x))if(Z(S))p(t,e,S,S.init);else throw new Error("no atom init");return D(x)}const O=l(t,e,S);try{return D(O)}finally{N.delete(S),h.d.set(S,O.n),P(h.v)&&k(n,h.v,O),r.has(n)&&((v=r.get(S))==null||v.t.add(n)),w||M()}};let g,G;const st={get signal(){return g||(g=new AbortController),g.signal},get setSelf(){return(I?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(I?"production":void 0)!=="production"&&!b(n)&&console.warn("setSelf function cannot be used with read-only atom"),!G&&b(n)&&(G=(...S)=>{if((I?"production":void 0)!=="production"&&w&&console.warn("setSelf function cannot be called in sync"),!w)try{return A(t,e,n,S)}finally{c(t,e),_(t,e)}}),G}},Y=h.n,ot=a.get(n)===Y;try{(I?"production":void 0)!=="production"&&W.delete(e);const S=E(t,e,n,nt,st);if((I?"production":void 0)!=="production"&&W.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),p(t,e,n,S),P(S)){m(t,e,S,()=>g?.abort());const v=()=>{L(),M()};S.then(v,v)}else L();return(s=f.r)==null||s.call(f,n),h.m=R,h}catch(S){if(gt(S))throw S;return delete h.v,h.e=S,++h.n,h.m=R,h}finally{w=!1,h.n!==Y&&ot&&(a.set(n,h.n),i.add(n),(o=f.c)==null||o.call(f,n))}},Ft=(t,e,n)=>{const s=t[1],o=t[2],r=t[11],a=[n];for(;a.length;){const i=a.pop(),f=r(t,e,i);for(const E of B(i,f,s)){const u=r(t,e,E);o.get(E)!==u.n&&(o.set(E,u.n),a.push(E))}}},bt=(t,e,n,s)=>{const o=t[3],r=t[6],a=t[8],i=t[11],f=t[12],E=t[13],u=t[14],_=t[15],c=t[16],l=t[17],A=t[20],d=t[28];let p=!0;const m=h=>D(u(t,e,h)),T=(h,...R)=>{var w;const N=i(t,e,h);try{if(h===n){if(!Z(h))throw new Error("atom not writable");(I?"production":void 0)!=="production"&&W.add(e);const L=N.n,M=R[0];A(t,e,h,M),l(t,e,h),L!==N.n&&(++d[0],o.add(h),_(t,e,h),(w=r.c)==null||w.call(r,h));return}else return c(t,e,h,R)}finally{p||(E(t,e),f(t,e))}};try{return a(t,e,n,m,T,...s)}finally{p=!1}},Wt=(t,e,n)=>{var s;const o=t[1],r=t[3],a=t[6],i=t[11],f=t[15],E=t[18],u=t[19],_=i(t,e,n),c=o.get(n);if(c&&_.d.size>0){for(const[l,A]of _.d)if(!c.d.has(l)){const d=i(t,e,l);E(t,e,l).t.add(n),c.d.add(l),A!==d.n&&(r.add(l),f(t,e,l),(s=a.c)==null||s.call(a,l))}for(const l of c.d)if(!_.d.has(l)){c.d.delete(l);const A=u(t,e,l);A?.t.delete(n)}}},Ht=(t,e,n)=>{var s;const o=t[1],r=t[4],a=t[6],i=t[10],f=t[11],E=t[12],u=t[13],_=t[14],c=t[16],l=t[18],A=f(t,e,n);let d=o.get(n);if(!d){_(t,e,n);for(const p of A.d.keys())l(t,e,p).t.add(n);if(d={l:new Set,d:new Set(A.d.keys()),t:new Set},o.set(n,d),b(n)&&Nt(n)){const p=()=>{let m=!0;const T=(...h)=>{try{return c(t,e,n,h)}finally{m||(u(t,e),E(t,e))}};try{const h=i(t,e,n,T);h&&(d.u=()=>{m=!0;try{h()}finally{m=!1}})}finally{m=!1}};r.add(p)}(s=a.m)==null||s.call(a,n)}return d},Vt=(t,e,n)=>{var s,o;const r=t[1],a=t[5],i=t[6],f=t[11],E=t[19],u=f(t,e,n);let _=r.get(n);if(!_||_.l.size)return _;let c=!1;for(const l of _.t)if((s=r.get(l))!=null&&s.d.has(n)){c=!0;break}if(!c){_.u&&a.add(_.u),_=void 0,r.delete(n);for(const l of u.d.keys()){const A=E(t,e,l);A?.t.delete(n)}(o=i.u)==null||o.call(i,n);return}return _},Yt=(t,e,n,s)=>{const o=t[11],r=t[27],a=o(t,e,n),i="v"in a,f=a.v;if(P(s))for(const E of a.d.keys())k(n,s,o(t,e,E));a.v=s,delete a.e,(!i||!Object.is(f,a.v))&&(++a.n,P(f)&&r(t,e,f))},xt=(t,e,n)=>{const s=t[14];return D(s(t,e,n))}
3,zt=(t,e,n,...s)=>{const o=t[3],r=t[12],a=t[13],i=t[16],f=o.size;try{return i(t,e,n,s)}finally{o.size!==f&&(a(t,e),r(t,e))}},qt=(t,e,n,s)=>{const o=t[12],r=t[18],a=t[19],f=r(t,e,n).l;return f.add(s),o(t,e),()=>{f.delete(s),a(t,e,n),o(t,e)}},Qt=(t,e,n,s)=>{const o=t[25];let r=o.get(n);if(!r){r=new Set,o.set(n,r);const a=()=>o.delete(n);n.then(a,a)}r.add(s)},jt=(t,e,n)=>{const o=t[25].get(n);o?.forEach(r=>r())},tt=new WeakMap;function Jt(t){const e=tt.get(t);if((I?"production":void 0)!=="production"&&!e)throw new Error("Store must be created by buildStore to read its building blocks");const n=e[24];return n?n(e,t):e}function Xt(...t){const e={get(a){return s(n,e,a)},set(a,...i){return o(n,e,a,...i)},sub(a,i){return r(n,e,a,i)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},yt,Lt,Mt,Dt,Pt,Gt,Kt,Ut,Ft,bt,Wt,Ht,Vt,Yt,xt,zt,qt,void 0,new WeakMap,Qt,jt,[0]].map((a,i)=>t[i]||a);tt.set(e,Object.freeze(n));const s=n[21],o=n[22],r=n[23];return e}const et={};let $t=0;function Zt(t,e){const n=`atom${++$t}`,s={toString(){return(et?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?s.read=t:(s.init=t,s.read=kt,s.write=Bt),s}function kt(t){return t(this)}function Bt(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}function te(){return Xt()}let y;function ee(){return y||(y=te(),(et?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=y),globalThis.__JOTAI_DEFAULT_STORE__!==y&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),y}const ne=C.createContext(void 0);function se(t){return C.useContext(ne)||ee()}const H=t=>typeof t?.then=="function",V=t=>{t.status||(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}))},oe=J.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(V(t),t)}),K=new WeakMap,j=(t,e,n)=>{const s=Jt(t),o=s[26];let r=K.get(e);return r||(r=new Promise((a,i)=>{let f=e;const E=c=>l=>{f===c&&a(l)},u=c=>l=>{f===c&&i(l)},_=()=>{try{const c=n();H(c)?(K.set(c,r),f=c,c.then(E(c),u(c)),o(s,t,c,_)):a(c)}catch(c){i(c)}};e.then(E(e),u(e)),o(s,t,e,_)}),K.set(e,r)),r};function re(t,e){const{delay:n,unstable_promiseStatus:s=!J.use}={},o=se(),[[r,a,i],f]=C.useReducer(u=>{const _=o.get(t);return Object.is(u[0],_)&&u[1]===o&&u[2]===t?u:[_,o,t]},void 0,()=>[o.get(t),o,t]);let E=r;if((a!==o||i!==t)&&(f(),E=o.get(t)),C.useEffect(()=>{const u=o.sub(t,()=>{if(s)try{const _=o.get(t);H(_)&&V(j(o,_,()=>o.get(t)))}catch{}if(typeof n=="number"){console.warn(`[DEPRECATED] delay option is deprecated and will be removed in v3. 4 5Migration guide: 6 7Create a custom hook like the following. 8 9function useAtomValueWithDelay<Value>( 10 atom: Atom<Value>, 11 options: { delay: number }, 12): Value { 13 const { delay } = options 14 const store = useStore(options) 15 const [value, setValue] = useState(() => store.get(atom)) 16 useEffect(() => { 17 const unsub = store.sub(atom, () => { 18 setTimeout(() => setValue(store.get(atom)), delay) 19 }) 20 return unsub 21 }, [store, atom, delay]) 22 return value 23} 24`),setTimeout(f,n);return}f()});return f(),u},[o,t,n,s]),C.useDebugValue(E),H(E)){const u=j(o,E,()=>o.get(t));return s&&V(u),oe(u)}return E}const ae=300*1e3,ce=600*1e3,ie=t=>{if(typeof t=="string")return{[t]:!0};for(const[n,s]of Object.entries(t))if(s!==!0&&s!==!1)throw new Error(`Feature flag "${n}" must be explicitly true or false, received: ${s}`);const e=Object.entries(t).sort(([n],[s])=>n.localeCompare(s));return Object.fromEntries(e)},ue=()=>({isLoading:!1});function fe(t){const e=new vt(t.fetchFn,t.batchWindowMs),n=Zt(e),s=t.useReadinessGate??ue,o=a=>{const i=re(n),{isLoading:f}=s(),E=typeof a=="string"?a:JSON.stringify(Object.entries(a).sort(([m],[T])=>m.localeCompare(T))),u=C.useMemo(()=>ie(a),[E]),_=C.useMemo(()=>Object.keys(u),[u]),c=It({queries:_.map(m=>({queryKey:["featureSwitch",m],queryFn:()=>i.load(m),staleTime:ae,gcTime:ce,enabled:!f}))}),l=f||c.some(m=>m.isLoading),A=!f&&c.every(m=>m.isFetched),d=c.some(m=>m.isFetching);return{shouldRender:!f&&_.every((m,T)=>{const h=c[T]?.data??!1,R=u[m]??!0;return h===R}),isLoading:l,isFetched:A,isFetching:d}};return{batchLoaderAtom:n,useFeature:o,Feature:({names:a,children:i})=>{const{shouldRender:f}=o(a);return f?U.jsx(U.Fragment,{children:i}):null}}}const _e=async t=>(await At(St.post(`${Tt}/api/v1/featureswitches/`,{feature_switches:t},{withCredentials:!0}))).data,de=fe({fetchFn:_e,useReadinessGate:pt}),{useFeature:Te,Feature:Ce,batchLoaderAtom:Re}=de;export{Se as F,Ae as R,pe as a,Ce as b,re as c,Re as d,_e as f,Te as u}; 25 26//# debugId=28c616e8-b67e-5210-bc7e-69908ecba0cd
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.