PageSourceSearch

https://console.azion.com/assets/useSubscriptionState-ZmOCSsRF.js

js azion.com collected 2026-09-24 09:56:29 UTC 3,270 bytes, 1 lines download raw bytes

1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`7d8eaa80bf7a8452addada54ce261c290201fccb`};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`6e4141ca-844b-419b-969b-4dc4321e22dd`,e._sentryDebugIdIdentifier=`sentry-dbid-6e4141ca-844b-419b-969b-4dc4321e22dd`)}catch{}})();import{r as e}from"./rolldown-runtime-FgGdQMz3.js";import{bt as t,l as n}from"./runtime-core.esm-bundler-BWDoNL2S.js";import{a as r,c as i,o as a,p as o}from"./baseService-D9rH_cRO.js";import{t as s,u as c}from"./subscriptions-service-CBEXQnhi.js";var l=404,u=e=>e?.statusCode===l||e?.response?.status===l||e?.status===l,d=501,f=e=>e?.statusCode===d||e?.response?.status===d||e?.status===d,p=e({UNAVAILABLE_REASON:()=>_,ensureCurrentSubscription:()=>E,getCachedCurrentSubscription:()=>O,getCurrentSubscriptionSnapshot:()=>k,invalidateSubscriptionState:()=>A,isEntitled:()=>w,useSubscriptionState:()=>T,waitForActiveSubscription:()=>D}),m={persist:!1},h={data:null},g=15e3,_=Object.freeze({AMBIGUOUS_CONTEXT:`ambiguous_context`,NOT_IMPLEMENTED:`not_implemented`,NOT_AUTHORIZED:`not_authorized`}),v=e=>({data:null,unavailable:!0,reason:e}),y=e=>e?.status===409||e?.statusCode===409,b=[401,403],x=e=>b.includes(e?.statusCode??e?.response?.status??e?.status),S=async()=>{try{return await s.getCurrentSubscription()}catch(e){if(u(e))return h;if(y(e))return v(_.AMBIGUOUS_CONTEXT);if(f(e))return v(_.NOT_IMPLEMENTED);if(x(e))return v(_.NOT_AUTHORIZED);throw e}},C=()=>({queryKey:a.subscriptions.current(),queryFn:S,staleTime:g,gcTime:g,meta:m}),w=e=>c(e?.status);function T(e={}){let{enabled:r=!0}=e,i=o({...C(),enabled:n(()=>!!t(r)),refetchOnMount:!0,refetchOnWindowFocus:!1}),a=n(()=>i.data.value?.data??null),s=n(()=>i.data.value?.unavailable===!0),c=n(()=>i.data.value?.reason??null),l=n(()=>c.value===_.AMBIGUOUS_CONTEXT);return{subscriptionQuery:i,subscription:a,subscriptionId:n(()=>a.value?.id??null),planId:n(()=>a.value?.planId??null),planPricingId:n(()=>a.value?.planPricingId??null),accountMode:n(()=>a.value?.accountMode??null),billingMode:n(()=>a.value?.billingMode??null),pendingTransition:n(()=>a.value?.pendingTransition??null),hasSubscription:n(()=>!!a.value),isActive:n(()=>w(a.value)),isUnavailable:s,unavailableReason:c,isAmbiguousContext:l,isLoading:i.isLoading,isFetching:i.isFetching,refetch:async()=>{await i.refetch()}}}async function E({fresh:e=!1}={}){if(await r(),e){let e=i.getQueryState(a.subscriptions.current());if(e?.status===`error`&&Date.now()-e.errorUpdatedAt<g)throw e.error}return i.fetchQuery({...C(),...e&&{staleTime:0}})}async function D({attempts:e=4,delayMs:t=1200}={}){let n=null;for(let r=0;r<e;r+=1){if(n=await E({fresh:!0}),w(n?.data))return n.data;if(n?.unavailable===!0)return null;r<e-1&&await new Promise(e=>setTimeout(e,t))}return null}function O(){return i.getQueryData(a.subscriptions.current())?.data??null}function k(){let e=i.getQueryState(a.subscriptions.current());return!e||e.isInvalidated||e.status!==`success`?null:e.data??null}function A({refetchType:e=`active`}={}){i.invalidateQueries({queryKey:a.subscriptions.all,refetchType:e})}export{T as a,u as c,A as i,O as n,p as o,k as r,D as s,E as t};

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.