1import{c as x,u as A,r as E,a8 as y,a9 as R,aa as m,ab as j}from"./index-CEDIJ4CS.js";function O(r){if(Array.isArray(r))return r.flatMap(u=>O(u));if(typeof r!="string")return[];const n=[];let e=0,t,i,a,s,o;const d=()=>{for(;e<r.length&&/\s/.test(r.charAt(e));)e+=1;return e<r.length},c=()=>(i=r.charAt(e),i!=="="&&i!==";"&&i!==",");for(;e<r.length;){for(t=e,o=!1;d();)if(i=r.charAt(e),i===","){for(a=e,e+=1,d(),s=e;e<r.length&&c();)e+=1;e<r.length&&r.charAt(e)==="="?(o=!0,e=s,n.push(r.slice(t,a)),t=e):e=a+1}else e+=1;(!o||e>=r.length)&&n.push(r.slice(t))}return n}function C(r){return r instanceof Headers?r:Array.isArray(r)?new Headers(r):typeof r=="object"?new Headers(r):null}function S(...r){return r.reduce((n,e)=>{const t=C(e);if(!t)return n;for(const[i,a]of t.entries())i==="set-cookie"?O(a).forEach(s=>n.append("set-cookie",s)):n.set(i,a);return n},new Headers)}const V=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],T=x("loader-circle",V);function q(r){const n=A();return E.useCallback(async(...e)=>{try{const t=await r(...e);if(y(t))throw t;return t}catch(t){if(y(t))return t.options._fromLocation=n.stores.location.get(),n.navigate(n.resolveRedirect(t).options);throw t}},[n,r])}function M(r){return r!=="__proto__"&&r!=="constructor"&&r!=="prototype"}function v(r,n){const e=Object.create(null);if(r)for(const t of Object.keys(r))M(t)&&(e[t]=r[t]);if(n&&typeof n=="object")for(const t of Object.keys(n))M(t)&&(e[t]=n[t]);return e}function _(r){return Object.create(null)}var b=()=>{throw new Error("createServerOnlyFn() functions can only be called on the server!")},p=(r,n)=>{const e=n||r||{};typeof e.method>"u"&&(e.method="GET");const t=s=>p(void 0,{...e,validator:s,inputValidator:s});return Object.assign(s=>p(void 0,{...e,...s}),{options:e,middleware:s=>{const o=[...e.middleware||[]];s.map(c=>{m in c?c.options.middleware&&o.push(...c.options.middleware):o.push(c)});const d=p(void 0,{...e,middleware:o});return d[m]=!0,d},validator:t,inputValidator:t,handler:(...s)=>{const[o,d]=s,c={...e,extractedFn:o,serverFn:d},u=[...c.middleware||[],g(c)];return o.method=e.method,Object.assign(async l=>{const f=await F(u,"client",{...o,...c,data:l?.data,headers:l?.headers,signal:l?.signal,fetch:l?.fetch,context:_()}),h=R(f.error);if(h)throw h;if(f.error)throw f.error;return f.result},{...o,method:e.method,__executeServer:async l=>{const f=b(),h=f.contextAfterGlobalMiddlewares;return await F(u,"server",{...o,...l,serverFnMeta:o.serverFnMeta,context:v(l.context,h),request:f.request}).then(w=>({result:w.result,error:w.error,context:w.sendContext}))}})}})};async function F(r,n,e){let t=N([...j()?.functionMiddleware||[],...r]);if(n==="server"){const a=b();a?.executedRequestMiddlewares&&(t=t.filter(s=>!a.executedRequestMiddlewares.has(s)))}const i=async a=>{const s=t.shift();if(!s)return a;try{let o="validator"in s.options?s.options.validator:void 0;!o&&"inputValidator"in s.options&&(o=s.options.inputValidator),o&&n==="server"&&(a.data=await H(o,a.data));let d;if(n==="client"?"client"in s.options&&(d=s.options.client):"server"in s.options&&(d=s.options.server),d){const u=await d({...a,next:async(l={})=>{const f=await i({...a,...l,context:v(a.context,l.context),sendContext:v(a.sendContext,l.sendContext),headers:S(a.headers,l.headers),_callSiteFetch:a._callSiteFetch,fetch:a._callSiteFetch??l.fetch??a.fetch,result:l.result!==void 0?l.result:l instanceof Response?l:a.result,error:l.error??a.error});if(f.error)throw f.error;return f}});if(y(u))return{...a,error:u};if(u instanceof Response)return{...a,result:u};if(!u)throw new Error("User middleware returned undefined. You must call next() or return a result in your middlewares.");return u}return i(a)}catch(o){return{...a,error:o}}};return i({...e,headers:e.headers||{},sendContext:e.sendContext||{},context:e.context||_(),_callSiteFetch:e.fetch})}function N(r,n=100){const e=new Set,t=[],i=(a,s)=>{if(s>n)throw new Error(`Middleware nesting depth exceeded maximum of ${n}. Check for circular references.`);a.forEach(o=>{o.options.middleware&&i(o.options.middleware,s+1),e.has(o)||(e.add(o),t.push(o))})};return i(r,0),t}async function H(r,n){if(r==null)return{};if("~standard"in r){const e=await r["~standard"].validate(n);if(e.issues)throw new Error(JSON.stringify(e.issues,void 0,2));return e.value}if("parse"in r)return r.parse(n);if(typeof r=="function")return r(n);throw new Error("Invalid validator type!")}function g(r){return{"~types":void 0,options:{inputValidator:r.validator??r.inputValidator,client:async({next:n,sendContext:e,fetch:t,...i})=>{const a={...i,context:e,fetch:t};return n(await r.extractedFn?.(a))},server:async({next:n,...e})=>{const t=await r.serverFn?.(e);return n({...e,result:t})}}}}export{T as L,p as c,q as u};
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.