PageSourceSearch

https://help.jpegmini.com/_next/static/chunks/5521-81aa1942d390274f.js?dpl=dpl_CAX12HAS2JQ3rd2BHKZtvqMSAVVN

js jpegmini.com collected 2026-09-24 15:15:36 UTC 92,128 bytes, 8 lines download raw bytes

1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6cbc0148-bca2-42b2-b97d-baf89de0d151",e._sentryDebugIdIdentifier="sentry-dbid-6cbc0148-bca2-42b2-b97d-baf89de0d151")}()}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5521],{5264:function(e,t,r){r.d(t,{D:function(){return o}});var n=r(62489),i=r(25566),s=r(25566);function o(e){let t="object"==typeof e.client?e.client:{},r="object"==typeof e.server?e.server:{},o=e.shared,a=e.runtimeEnv?e.runtimeEnv:{...s.env,...e.experimental__runtimeEnv};return function(e){let t=e.runtimeEnvStrict??e.runtimeEnv??i.env;if(e.emptyStringAsUndefined)for(let[e,r]of Object.entries(t))""===r&&delete t[e];if(e.skipValidation)return t;let r="object"==typeof e.client?e.client:{},s="object"==typeof e.server?e.server:{},o="object"==typeof e.shared?e.shared:{},a=(0,n.Ry)(r),u=(0,n.Ry)(s),l=(0,n.Ry)(o),c=e.isServer??("undefined"==typeof window||"Deno"in window),h=a.merge(l),f=u.merge(l).merge(a),d=c?f.safeParse(t):h.safeParse(t),p=e.onValidationError??(e=>{throw console.error("❌ Invalid environment variables:",e.flatten().fieldErrors),Error("Invalid environment variables")}),y=e.onInvalidAccess??(e=>{throw Error("❌ Attempted to access a server-side environment variable on the client")});if(!1===d.success)return p(d.error);let m=t=>!e.clientPrefix||!t.startsWith(e.clientPrefix)&&!(t in l.shape),b=e=>c||!m(e),g=e=>"__esModule"===e||"$$typeof"===e,v=(e.extends??[]).reduce((e,t)=>Object.assign(e,t),{});return new Proxy(Object.assign(d.data,v),{get(e,t){if("string"==typeof t&&!g(t))return b(t)?Reflect.get(e,t):y(t)}})}({...e,shared:o,client:t,server:r,clientPrefix:"NEXT_PUBLIC_",runtimeEnv:a})}},87045:function(e,t,r){r.d(t,{j:function(){return s}});var n=r(24112),i=r(45345),s=new class extends n.l{#e;#t;#r;constructor(){super(),this.#r=e=>{if(!i.sk&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#e?this.#e:globalThis.document?.visibilityState!=="hidden"}}},21636:function(e,t,r){r.d(t,{Gm:function(){return i},Qy:function(){return a},ZF:function(){return u}});var n=r(45345);function i(e){return{onFetch:(t,r)=>{let i=t.options,a=t.fetchOptions?.meta?.fetchMore?.direction,u=t.state.data?.pages||[],l=t.state.data?.pageParams||[],c={pages:[],pageParams:[]},h=0,f=async()=>{let r=!1,f=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(t.signal.aborted?r=!0:t.signal.addEventListener("abort",()=>{r=!0}),t.signal)})},d=(0,n.cG)(t.options,t.fetchOptions),p=async(e,i,s)=>{if(r)return Promise.reject();if(null==i&&e.pages.length)return Promise.resolve(e);let o=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:i,direction:s?"backward":"forward",meta:t.options.meta};return f(e),e})(),a=await d(o),{maxPages:u}=t.options,l=s?n.Ht:n.VX;return{pages:l(e.pages,a,u),pageParams:l(e.pageParams,i,u)}};if(a&&u.length){let e="backward"===a,t={pages:u,pageParams:l},r=(e?o:s)(i,t);c=await p(t,r,e)}else{let t=e??u.length;do{let e=0===h?l[0]??i.initialPageParam:s(i,c);if(h>0&&null==e)break;c=await p(c,e),h++}while(h<t)}return c};t.options.persister?t.fetchFn=()=>t.options.persister?.(f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=f}}}function s(e,{pages:t,pageParams:r}){let n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function o(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}function a(e,t){return!!t&&null!=s(e,t)}function u(e,t){return!!t&&!!e.getPreviousPageParam&&null!=o(e,t)}},2894:function(e,t,r){r.d(t,{R:function(){return a},m:function(){return o}});var n=r(18238),i=r(7989),s=r(11255),o=class extends i.F{#n;#i;#s;#o;constructor(e){super(),this.#n=e.client,this.mutationId=e.mutationId,this.#s=e.mutationCache,this.#i=[],this.state=e.state||a(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#i.includes(e)||(this.#i.push(e),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#i=this.#i.filter(t=>t!==e),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#i.length||("pending"===this.state.status?this.scheduleGc():this.#s.remove(this))}continue(){return this.#o?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#a({type:"continue"})},r={client:this.#n,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#o=(0,s.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#a({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#a({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>
1this.#s.canRun(this)});let n="pending"===this.state.status,i=!this.#o.canStart();try{if(n)t();else{this.#a({type:"pending",variables:e,isPaused:i}),await this.#s.config.onMutate?.(e,this,r);let t=await this.options.onMutate?.(e,r);t!==this.state.context&&this.#a({type:"pending",context:t,variables:e,isPaused:i})}let s=await this.#o.start();return await this.#s.config.onSuccess?.(s,e,this.state.context,this,r),await this.options.onSuccess?.(s,e,this.state.context,r),await this.#s.config.onSettled?.(s,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(s,null,e,this.state.context,r),this.#a({type:"success",data:s}),s}catch(t){try{throw await this.#s.config.onError?.(t,e,this.state.context,this,r),await this.options.onError?.(t,e,this.state.context,r),await this.#s.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(void 0,t,e,this.state.context,r),t}finally{this.#a({type:"error",error:t})}}finally{this.#s.runNext(this)}}#a(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),n.Vr.batch(()=>{this.#i.forEach(t=>{t.onMutationUpdate(e)}),this.#s.notify({mutation:this,type:"updated",action:e})})}};function a(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},18238:function(e,t,r){r.d(t,{Vr:function(){return i}});var n=r(84554).Hp,i=function(){let e=[],t=0,r=e=>{e()},i=e=>{e()},s=n,o=n=>{t?e.push(n):s(()=>{r(n)})},a=()=>{let t=e;e=[],t.length&&s(()=>{i(()=>{t.forEach(e=>{r(e)})})})};return{batch:e=>{let r;t++;try{r=e()}finally{--t||a()}return r},batchCalls:e=>(...t)=>{o(()=>{e(...t)})},schedule:o,setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{i=e},setScheduler:e=>{s=e}}}()},57853:function(e,t,r){r.d(t,{N:function(){return s}});var n=r(24112),i=r(45345),s=new class extends n.l{#u=!0;#t;#r;constructor(){super(),this.#r=e=>{if(!i.sk&&window.addEventListener){let t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#u!==e&&(this.#u=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#u}}},21733:function(e,t,r){r.d(t,{A:function(){return a},z:function(){return u}});var n=r(45345),i=r(18238),s=r(11255),o=r(7989),a=class extends o.F{#l;#c;#h;#n;#o;#f;#d;constructor(e){super(),this.#d=!1,this.#f=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#n=e.client,this.#h=this.#n.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#l=c(this.options),this.state=e.state??this.#l,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#o?.promise}setOptions(e){if(this.options={...this.#f,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let e=c(this.options);void 0!==e.data&&(this.setState(l(e.data,e.dataUpdatedAt)),this.#l=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#h.remove(this)}setData(e,t){let r=(0,n.oE)(this.state.data,e,this.options);return this.#a({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#a({type:"setState",state:e,setStateOptions:t})}cancel(e){let t=this.#o?.promise;return this.#o?.cancel(e),t?t.then(n.ZT).catch(n.ZT):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#l)}isActive(){return this.observers.some(e=>!1!==(0,n.Nc)(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===n.CN||this.state.dataUpdateCount+this.state.errorUpdate
1Count===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===(0,n.KC)(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!(0,n.Kp)(this.state.dataUpdatedAt,e))}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#o?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#o?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#h.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#o&&(this.#d?this.#o.cancel({revert:!0}):this.#o.cancelRetry()),this.scheduleGc()),this.#h.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#a({type:"invalidate"})}async fetch(e,t){if("idle"!==this.state.fetchStatus&&this.#o?.status()!=="rejected"){if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#o)return this.#o.continueRetry(),this.#o.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let r=new AbortController,i=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#d=!0,r.signal)})},o=()=>{let e=(0,n.cG)(this.options,t),r=(()=>{let e={client:this.#n,queryKey:this.queryKey,meta:this.meta};return i(e),e})();return(this.#d=!1,this.options.persister)?this.options.persister(e,r,this):e(r)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#n,state:this.state,fetchFn:o};return i(e),e})();this.options.behavior?.onFetch(a,this),this.#c=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#a({type:"fetch",meta:a.fetchOptions?.meta}),this.#o=(0,s.Mz)({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof s.p8&&e.revert&&this.setState({...this.#c,fetchStatus:"idle"}),r.abort()},onFail:(e,t)=>{this.#a({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#a({type:"pause"})},onContinue:()=>{this.#a({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#o.start();if(void 0===e)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#h.config.onSuccess?.(e,this),this.#h.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof s.p8){if(e.silent)return this.#o.promise;if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#a({type:"error",error:e}),this.#h.config.onError?.(e,this),this.#h.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#a(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...u(t.data,this.options),fetchMeta:e.meta??null};case"success":let r={...t,...l(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#c=e.manual?r:void 0,r;case"error":let n=e.error;return{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),i.Vr.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#h.notify({query:this,type:"updated",action:e})})}};function u(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:(0,s.Kw)(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function l(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function c(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,n=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdate
1Count:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}},54114:function(e,t,r){r.d(t,{S:function(){return p}});var n=r(45345),i=r(21733),s=r(18238),o=r(24112),a=class extends o.l{constructor(e={}){super(),this.config=e,this.#p=new Map}#p;build(e,t,r){let s=t.queryKey,o=t.queryHash??(0,n.Rm)(s,t),a=this.get(o);return a||(a=new i.A({client:e,queryKey:s,queryHash:o,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(a)),a}add(e){this.#p.has(e.queryHash)||(this.#p.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#p.get(e.queryHash);t&&(e.destroy(),t===e&&this.#p.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){s.Vr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#p.get(e)}getAll(){return[...this.#p.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n._x)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,n._x)(e,t)):t}notify(e){s.Vr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){s.Vr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){s.Vr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},u=r(2894),l=class extends o.l{constructor(e={}){super(),this.config=e,this.#y=new Set,this.#m=new Map,this.#b=0}#y;#m;#b;build(e,t,r){let n=new u.m({client:e,mutationCache:this,mutationId:++this.#b,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#y.add(e);let t=c(e);if("string"==typeof t){let r=this.#m.get(t);r?r.push(e):this.#m.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#y.delete(e)){let t=c(e);if("string"==typeof t){let r=this.#m.get(t);if(r){if(r.length>1){let t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#m.delete(t)}}}this.notify({type:"removed",mutation:e})}canRun(e){let t=c(e);if("string"!=typeof t)return!0;{let r=this.#m.get(t),n=r?.find(e=>"pending"===e.state.status);return!n||n===e}}runNext(e){let t=c(e);if("string"!=typeof t)return Promise.resolve();{let r=this.#m.get(t)?.find(t=>
1t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}}clear(){s.Vr.batch(()=>{this.#y.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#y.clear(),this.#m.clear()})}getAll(){return Array.from(this.#y)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n.X7)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,n.X7)(e,t))}notify(e){s.Vr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return s.Vr.batch(()=>Promise.all(e.map(e=>e.continue().catch(n.ZT))))}};function c(e){return e.options.scope?.id}var h=r(87045),f=r(57853),d=r(21636),p=class{#g;#s;#f;#v;#w;#O;#E;#R;constructor(e={}){this.#g=e.queryCache||new a,this.#s=e.mutationCache||new l,this.#f=e.defaultOptions||{},this.#v=new Map,this.#w=new Map,this.#O=0}mount(){this.#O++,1===this.#O&&(this.#E=h.j.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#g.onFocus())}),this.#R=f.N.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#g.onOnline())}))}unmount(){this.#O--,0===this.#O&&(this.#E?.(),this.#E=void 0,this.#R?.(),this.#R=void 0)}isFetching(e){return this.#g.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#s.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#g.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),r=this.#g.build(this,t),i=r.state.data;return void 0===i?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime((0,n.KC)(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return this.#g.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,r){let i=this.defaultQueryOptions({queryKey:e}),s=this.#g.get(i.queryHash),o=s?.state.data,a=(0,n.SE)(t,o);if(void 0!==a)return this.#g.build(this,i).setData(a,{...r,manual:!0})}setQueriesData(e,t,r){return s.Vr.batch(()=>this.#g.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#g.get(t.queryHash)?.state}removeQueries(e){let t=this.#g;s.Vr.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=this.#g;return s.Vr.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let r={revert:!0,...t};return Promise.all(s.Vr.batch(()=>this.#g.findAll(e).map(e=>e.cancel(r)))).then(n.ZT).catch(n.ZT)}invalidateQueries(e,t={}){return s.Vr.batch(()=>(this.#g.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let r={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(s.Vr.batch(()=>this.#g.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(n.ZT)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(n.ZT)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let r=this.#g.build(this,t);return r.isStaleByTime((0,n.KC)(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(n.ZT).catch(n.ZT)}fetchInfiniteQuery(e){return e.behavior=(0,d.Gm)(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(n.ZT).catch(n.ZT)}ensureInfiniteQueryData(e){return e.behavior=(0,d.Gm)(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return f.N.isOnline()?this.#s.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#g}getMutationCache(){return this.#s}getDefaultOptions(){return this.#f}setDefaultOptions(e){this.#f=e}setQueryDefaults(e,t){this.#v.set((0,n.Ym)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#v.values()],r={};return t.forEach(t=>{(0,n.to)(e,t.queryKey)&&Object.assign(r,t.defaultOptions)}),r}setMutationDefaults(e,t){this.#w.set((0,n.Ym)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#w.values()],r={};return t.forEach(t=>{(0,n.to)(e,t.mutationKey)&&Object.assign(r,t.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#f.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,n.Rm)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===n.CN&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#f.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#g.clear(),this.#s.clear()}}},7989:function(e,t,r){r.d(t,{F:function(){return s}});var n=r(84554),i=r(45345),s=class{#S;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,i.PN)(this.gcTime)&&(this.#S=n.mr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(i.sk?1/0:3e5))}clearGcTimeout(){this.#S&&(n.mr.clearTimeout(this.#S),this.#S=void 0)}}},11255:function(e,t,r){r.d(t,{Kw:function(){return u},Mz:function(){return c},p8:function(){return l}});var n=r(87045),i=r(57853),s=r(16803),o=r(45345);function a(e){return Math.min(1e3*2**e,3e4)}function u(e){return(e??"online")!=="online"||i.N.isOnline()}
1var l=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function c(e){let t,r=!1,c=0,h=(0,s.O)(),f=()=>"pending"!==h.status,d=()=>n.j.isFocused()&&("always"===e.networkMode||i.N.isOnline())&&e.canRun(),p=()=>u(e.networkMode)&&e.canRun(),y=e=>{f()||(t?.(),h.resolve(e))},m=e=>{f()||(t?.(),h.reject(e))},b=()=>new Promise(r=>{t=e=>{(f()||d())&&r(e)},e.onPause?.()}).then(()=>{t=void 0,f()||e.onContinue?.()}),g=()=>{let t;if(f())return;let n=0===c?e.initialPromise:void 0;try{t=n??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(y).catch(t=>{if(f())return;let n=e.retry??(o.sk?0:3),i=e.retryDelay??a,s="function"==typeof i?i(c,t):i,u=!0===n||"number"==typeof n&&c<n||"function"==typeof n&&n(c,t);if(r||!u){m(t);return}c++,e.onFail?.(c,t),(0,o._v)(s).then(()=>d()?void 0:b()).then(()=>{r?m(t):g()})})};return{promise:h,status:()=>h.status,cancel:t=>{if(!f()){let r=new l(t);m(r),e.onCancel?.(r)}},continue:()=>(t?.(),h),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:p,start:()=>(p()?g():b().then(g),h)}}},24112:function(e,t,r){r.d(t,{l:function(){return n}});var n=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}},16803:function(e,t,r){r.d(t,{O:function(){return n}});function n(){let e,t;let r=new Promise((r,n)=>{e=r,t=n});function n(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{n({status:"fulfilled",value:t}),e(t)},r.reject=e=>{n({status:"rejected",reason:e}),t(e)},r}},84554:function(e,t,r){r.d(t,{Hp:function(){return s},mr:function(){return i}});var n={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},i=new class{#C=n;#P=!1;setTimeoutProvider(e){this.#C=e}setTimeout(e,t){return this.#C.setTimeout(e,t)}clearTimeout(e){this.#C.clearTimeout(e)}setInterval(e,t){return this.#C.setInterval(e,t)}clearInterval(e){this.#C.clearInterval(e)}};function s(e){setTimeout(e,0)}},45345:function(e,t,r){r.d(t,{CN:function(){return T},Ht:function(){return P},KC:function(){return l},Kp:function(){return u},L3:function(){return Q},Nc:function(){return c},PN:function(){return a},Q$:function(){return b},Rm:function(){return d},SE:function(){return o},VS:function(){return g},VX:function(){return C},Wk:function(){return S},X7:function(){return f},Ym:function(){return p},ZT:function(){return s},_v:function(){return E},_x:function(){return h},cG:function(){return q},oE:function(){return R},sk:function(){return i},to:function(){return y}});var n=r(84554),i="undefined"==typeof window||"Deno"in globalThis;function s(){}function o(e,t){return"function"==typeof e?e(t):e}function a(e){return"number"==typeof e&&e>=0&&e!==1/0}function u(e,t){return Math.max(e+(t||0)-Date.now(),0)}function l(e,t){return"function"==typeof e?e(t):e}function c(e,t){return"function"==typeof e?e(t):e}function h(e,t){let{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(o){if(n){if(t.queryHash!==d(o,t.options))return!1}else if(!y(t.queryKey,o))return!1}if("all"!==r){let e=t.isActive();if("active"===r&&!e||"inactive"===r&&e)return!1}return("boolean"!=typeof a||t.isStale()===a)&&(!i||i===t.state.fetchStatus)&&(!s||!!s(t))}function f(e,t){let{exact:r,status:n,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(r){if(p(t.options.mutationKey)!==p(s))return!1}else if(!y(t.options.mutationKey,s))return!1}return(!n||t.state.status===n)&&(!i||!!i(t))}function d(e,t){return(t?.queryKeyHashFn||p)(e)}function p(e){return JSON.stringify(e,(e,t)=>w(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function y(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).every(r=>y(e[r],t[r]))}var m=Object.prototype.hasOwnProperty;function b(e,t){if(e===t)return e;let r=v(e)&&v(t);if(!r&&!(w(e)&&w(t)))return t;let n=(r?e:Object.keys(e)).length,i=r?t:Object.keys(t),s=i.length,o=r?Array(s):{},a=0;for(let u=0;u<s;u++){let s=r?u:i[u],l=e[s],c=t[s];if(l===c){o[s]=l,(r?u<n:m.call(e,s))&&a++;continue}if(null===l||null===c||"object"!=typeof l||"object"!=typeof c){o[s]=c;continue}let h=b(l,c);o[s]=h,h===l&&a++}return n===s&&a===n?e:o}function g(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(e[r]!==t[r])return!1;return!0}function v(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function w(e){if(!O(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!!(O(r)&&r.hasOwnProperty("isPrototypeOf"))&&Object.getPrototypeOf(e)===Object.prototype}function O(e){return"[object Object]"===Object.prototype.toString.call(e)}function E(e){return new Promise(t=>{n.mr.setTimeout(t,e)})}function R(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?b(e,t):t}function S(e){return e}function C(e,t,r=0){let n=[...e,t];return r&&n.length>r?n.slice(1):n}function P(e,t,r=0){let n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var T=Symbol();function q(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==T?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))}function Q(e,t){return"function"==typeof e?e(...t):!!e}},29827:function(e,t,r){r.d(t,{NL:function(){return o},aH:function(){return a}});var n=r(2265),i=r(57437),s=n.createContext(void 0),o=e=>{let t=n.useContext(s);if(e)return e;if(!t)throw Error("No QueryClient set, use QueryClientProvider to set one");return t},a=e=>{let{client:t,children:r}=e;return n.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),(0,i.jsx)(s.Provider,{value:t,children:r})}},32419:function(e,t,r){function n(e){let t={subscribe(t){let r=null,n=!1,i=!1,s=!1;function o(){if(null===r){s=!0;return}!i&&(i=!0,"function"==typeof r?r():r&&r.unsubscribe())}return r=e({next(e){n||t.next?.(e)},error(e){n||(n=!0,t.error?.(e),o())},complete(){n||(n=!0,t.complete?.(),o())}}),s&&o(),{unsubscribe:o}},pipe:(...e)=>e.reduce(i,t)};return t}function i(e,t){return t(e)}function s(e){return n(t=>(function t(r=0,n=e.op){let i=e.links[r];if(!i)throw Error("No more links to execute - did you forget to add an ending link?");return i({op:n,next:e=>t(r+1,e)})})().subscribe(t))}r.d(t,{NT:function(){return c},BJ:function(){return y},Bm:function(){return p},K5:function(){return y},ny:function(){return m},uh:function(){return T},gb:function(){return I},u_:function(){return x}}),Symbol();var o=r(76968);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}
1class u extends Error{static from(e,t={}){return e instanceof u||e instanceof Error&&"TRPCClientError"===e.name?(t.meta&&(e.meta={...e.meta,...t.meta}),e):(0,o.Kn)(e)&&(0,o.Kn)(e.error)&&"number"==typeof e.error.code&&"string"==typeof e.error.message?new u(e.error.message,{...t,result:e}):new u("string"==typeof e?e:(0,o.Kn)(e)&&"string"==typeof e.message?e.message:"Unknown error",{...t,cause:e})}constructor(e,t){let r=t?.cause;super(e,{cause:r}),a(this,"cause",void 0),a(this,"shape",void 0),a(this,"data",void 0),a(this,"meta",void 0),this.meta=t?.meta,this.cause=r,this.shape=t?.result?.error,this.data=t?.result?.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,u.prototype)}}function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class c{$request(e){return s({links:this.links,op:{...e,context:e.context??{},id:++this.requestId}}).pipe(e=>{let t=0,r=null,i=[];return n(n=>(t++,i.push(n),r||(r=e.subscribe({next(e){for(let t of i)t.next?.(e)},error(e){for(let t of i)t.error?.(e)},complete(){for(let e of i)e.complete?.()}})),{unsubscribe(){t--,function(){if(0===t&&r){let e=r;r=null,e.unsubscribe()}}();let e=i.findIndex(e=>e===n);e>-1&&i.splice(e,1)}}))})}async requestAsPromise(e){try{let t=this.$request(e);return(await function(e){let t=new AbortController;return new Promise((r,n)=>{let i=!1;function s(){i||(i=!0,o.unsubscribe())}t.signal.addEventListener("abort",()=>{n(t.signal.reason)});let o=e.subscribe({next(e){i=!0,r(e),s()},error(e){n(e)},complete(){t.abort(),s()}})})}(t)).result.data}catch(e){throw u.from(e)}}query(e,t,r){return this.requestAsPromise({type:"query",path:e,input:t,context:r?.context,signal:r?.signal})}mutation(e,t,r){return this.requestAsPromise({type:"mutation",path:e,input:t,context:r?.context,signal:r?.signal})}subscription(e,t,r){return this.$request({type:"subscription",path:e,input:t,context:r.context,signal:r.signal}).subscribe({next(e){switch(e.result.type){case"state":r.onConnectionStateChange?.(e.result);break;case"started":r.onStarted?.({context:e.context});break;case"stopped":r.onStopped?.();break;case"data":case void 0:r.onData?.(e.result.data)}},error(e){r.onError?.(e)},complete(){r.onComplete?.()}})}constructor(e){l(this,"links",void 0),l(this,"runtime",void 0),l(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=e.links.map(e=>e(this.runtime))}}let h=Symbol.for("trpc_untypedClient"),f={query:"query",mutate:"mutation",subscribe:"subscription"},d=e=>f[e];function p(e){let t=(0,o.IX)(({path:t,args:r})=>{let n=[...t],i=d(n.pop()),s=n.join(".");return e[i](s,...r)});return(0,o.yh)(r=>r===h?e:t[r])}function y(e){return p(new c(e))}function m(e){return e[h]}let b=e=>"function"==typeof e,g={query:"GET",mutation:"POST",subscription:"PATCH"};function v(e){return"input"in e?e.transformer.input.serialize(e.input):function(e){let t={};for(let r=0;r<e.length;r++){let n=e[r];t[r]=n}return t}(e.inputs.map(t=>e.transformer.input.serialize(t)))}let w=e=>{let t=e.url.split("?"),r=t[0].replace(/\/$/,"")+"/"+e.path,n=[];if(t[1]&&n.push(t[1]),"inputs"in e&&n.push("batch=1"),"query"===e.type||"subscription"===e.type){let t=v(e);void 0!==t&&"POST"!==e.methodOverride&&n.push(`input=${encodeURIComponent(JSON.stringify(t))}`)}return n.length&&(r+="?"+n.join("&")),r},O=e=>{if("query"===e.type&&"POST"!==e.methodOverride)return;let t=v(e);return void 0!==t?JSON.stringify(t):void 0};class E extends Error{constructor(){let e="AbortError";super(e),this.name=e,this.message=e}}let R=e=>{if(e?.aborted){if(e.throwIfAborted?.(),"undefined"!=typeof DOMException)throw new DOMException("AbortError","AbortError");throw new E}};async function S(e){R(e.signal);let t=e.getUrl(e),r=e.getBody(e),{type:n}=e,i=await (async()=>{let t=await e.headers();return Symbol.iterator in t?Object.fromEntries(t):t})(),s={...e.contentTypeHeader?{"content-type":e.contentTypeHeader}:{},...e.trpcAcceptHeader?{"trpc-accept":e.trpcAcceptHeader}:void 0,...i};return(function(e){if(e)return e;if("undefined"!=typeof window&&b(window.fetch))return window.fetch;if("undefined"!=typeof globalThis&&b(globalThis.fetch))return globalThis.fetch;throw Error("No fetch implementation found")})(e.fetch)(t,{method:e.methodOverride??g[n],signal:e.signal,body:r,headers:s})}let C=()=>{throw Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function P(e){let t=null,r=null,n=()=>{clearTimeout(r),r=null,t=null};function i(){let r=function(t){let r=[[]],n=0;for(;;){let i=t[n];if(!i)break;let s=r[r.length-1];if(i.aborted){i.reject?.(Error("Aborted")),n++;continue}if(e.validate(s.concat(i).map(e=>
1e.key))){s.push(i),n++;continue}if(0===s.length){i.reject?.(Error("Input is too big for a single dispatch")),n++;continue}r.push([])}return r}(t);for(let t of(n(),r)){if(!t.length)continue;let r={items:t};for(let e of t)e.batch=r;e.fetch(r.items.map(e=>e.key)).then(async e=>{for(let t of(await Promise.all(e.map(async(e,t)=>{let n=r.items[t];try{let t=await Promise.resolve(e);n.resolve?.(t)}catch(e){n.reject?.(e)}n.batch=null,n.reject=null,n.resolve=null})),r.items))t.reject?.(Error("Missing result")),t.batch=null}).catch(e=>{for(let t of r.items)t.reject?.(e),t.batch=null})}}return{load:function(e){let n={aborted:!1,key:e,batch:null,resolve:C,reject:C},s=new Promise((e,r)=>{n.reject=r,n.resolve=e,t||(t=[]),t.push(n)});return r||(r=setTimeout(i)),s}}}function T(e){var t;let r={url:e.url.toString(),fetch:e.fetch,transformer:(t=e.transformer)?"input"in t?t:{input:t,output:t}:{input:{serialize:e=>e,deserialize:e=>e},output:{serialize:e=>e,deserialize:e=>e}},methodOverride:e.methodOverride},i=e.maxURLLength??1/0,s=e.maxItems??1/0;return()=>{let t=t=>({validate(e){if(i===1/0&&s===1/0)return!0;if(e.length>s)return!1;let n=e.map(e=>e.path).join(","),o=e.map(e=>e.input);return w({...r,type:t,path:n,inputs:o,signal:null}).length<=i},async fetch(n){let i=n.map(e=>e.path).join(","),s=n.map(e=>e.input),a=function(...e){let t=new AbortController,r=e.length,n=0,i=()=>{++n===r&&t.abort()};for(let t of e)t?.aborted?i():t?.addEventListener("abort",i,{once:!0});return t.signal}(...n.map(e=>e.signal)),l=new AbortController,c=S({...r,signal:function(...e){let t=new AbortController;for(let r of e)r?.aborted?t.abort():r?.addEventListener("abort",()=>t.abort(),{once:!0});return t.signal}(a,l.signal),type:t,contentTypeHeader:"application/json",trpcAcceptHeader:"application/jsonl",getUrl:w,getBody:O,inputs:s,path:i,headers:()=>e.headers?"function"==typeof e.headers?e.headers({opList:n}):e.headers:{}}),h=await c,[f]=await (0,o.$N)({from:h.body,deserialize:r.transformer.output.deserialize,formatError(e){let t=e.error;return u.from({error:t})},abortController:l});return Object.keys(n).map(async e=>{let t=await Promise.resolve(f[e]);if("result"in t){let e=await Promise.resolve(t.result);t={result:{data:await Promise.resolve(e.data)}}}return{json:t,meta:{response:h}}})}}),a={query:P(t("query")),mutation:P(t("mutation"))};return({op:e})=>n(t=>{let r;if("subscription"===e.type)throw Error("Subscriptions are unsupported by `httpBatchStreamLink` - use `httpSubscriptionLink` or `wsLink`");return a[e.type].load(e).then(e=>{if(r=e,"error"in e.json){t.error(u.from(e.json,{meta:e.meta}));return}if("result"in e.json){t.next({context:e.meta,result:e.json.result}),t.complete();return}t.complete()}).catch(e=>{t.error(u.from(e,{meta:r?.meta}))}),()=>{}})}}let q={css:{query:["72e3ff","3fb0d8"],mutation:["c5a3fc","904dfc"],subscription:["ff49e1","d83fbe"]},ansi:{regular:{query:["\x1b[30;46m","\x1b[97;46m"],mutation:["\x1b[30;45m","\x1b[97;45m"],subscription:["\x1b[30;42m","\x1b[97;42m"]},bold:{query:["\x1b[1;30;46m","\x1b[1;97;46m"],mutation:["\x1b[1;30;45m","\x1b[1;97;45m"],subscription:["\x1b[1;30;42m","\x1b[1;97;42m"]}}},Q=({c:e=console,colorMode:t="css",withContext:r})=>n=>{let i=n.input,s="undefined"!=typeof FormData&&i instanceof FormData?Object.fromEntries(i):i,{parts:o,args:a}=function(e){let{direction:t,type:r,withContext:n,path:i,id:s,input:o}=e,a=[],u=[];if("none"===e.colorMode)a.push("up"===t?">>":"<<",r,`#${s}`,i);else if("ansi"===e.colorMode){let[e,n]=q.ansi.regular[r],[o,u]=q.ansi.bold[r];a.push("up"===t?e:n,"up"===t?">>":"<<",r,"up"===t?o:u,`#${s}`,i,"\x1b[0m")}else{let[e,n]=q.css[r],o=`
2    background-color: #${"up"===t?e:n};
3    color: ${"up"===t?"black":"white"};
4    padding: 2px;
5  `;a.push("%c","up"===t?">>":"<<",r,`#${s}`,`%c${i}%c`,"%O"),u.push(o,`${o}; font-weight: bold;`,`${o}; font-weight: normal;`)}return"up"===t?u.push(n?{input:o,context:e.context}:{input:o}):u.push({input:o,result:e.result,elapsedMs:e.elapsedMs,...n&&{context:e.context}}),{parts:a,args:u}}({...n,colorMode:t,input:s,withContext:r});e["down"===n.direction&&n.result&&(n.result instanceof Error||"error"in n.result.result&&n.result.result.error)?"error":"log"].apply(null,[o.join(" ")].concat(a))};function I(e={}){let{enabled:t=()=>!0}=e,r=e.colorMode??("undefined"==typeof window?"ansi":"css"),i=e.withContext??"css"===r,{logger:s=Q({c:e.console,colorMode:r,withContext:i})}=e;return()=>({op:e,next:r})=>n(i=>{var o;t({...e,direction:"up"})&&s({...e,direction:"up"});let a=Date.now();function u(r){let n=Date.now()-a;t({...e,direction:"down",result:r})&&s({...e,direction:"down",elapsedMs:n,result:r})}return r(e).pipe((o={next(e){u(e)},error(e){u(e)}},e=>n(t=>e.subscribe({next(e){o.next?.(e),t.next(e)},error(e){o.error?.(e),t.error(e)},complete(){o.complete?.(),t.complete()}})))).subscribe(i)})}function D(e){return Array.isArray(e)?e:[e]}function x(e){return t=>{let r=D(e.true).map(e=>e(t)),i=D(e.false).map(e=>e(t));return t=>n(n=>{let o=e.condition(t.op)?r:i;return s({op:t.op,links:o}).subscribe(n)})}}let k=(e,...t)=>"function"==typeof e?e(...t):e;async function _(e){let t=await k(e.url);if(!e.connectionParams)return t;let r=t.includes("?")?"&":"?";return t+`${r}connectionParams=1`}async function A(e){return JSON.stringify({method:"connectionParams",data:await k(e)})}function j(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class M{get ws(){return this.wsObservable.get()}set ws(e){this.wsObservable.next(e)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){if(this.openPromise)return this.openPromise;this.id=++M.connectCount;let e=_(this.urlOptions).then(e=>new this.WebSocketPonyfill(e));this.openPromise=e.then(async e=>{this.ws=e,e.addEventListener("message",function({data:e}){"PING"===e&&this.send("PONG")}),this.keepAliveOpts.enabled&&function(e,{intervalMs:t,pongTimeoutMs:r}){let n,i;function s(){n=setTimeout(()=>{e.send("PING"),i=setTimeout(()=>{e.close()},r)},t)}e.addEventListener("open",s),e.addEventListener("message",({data:e})=>{clearTimeout(n),s(),"PONG"===e&&(clearTimeout(i),clearTimeout(n),s())}),e.addEventListener("close",()=>{clearTimeout(n),clearTimeout(i)})}(e,this.keepAliveOpts),e.addEventListener("close",()=>{this.ws===e&&(this.ws=null)}),await function(e){let t,r;let{promise:n,resolve:i,reject:s}
5={promise:new Promise((e,n)=>{t=e,r=n}),resolve:t,reject:r};return e.addEventListener("open",()=>{e.removeEventListener("error",s),i()}),e.addEventListener("error",s),n}(e),this.urlOptions.connectionParams&&e.send(await A(this.urlOptions.connectionParams))});try{await this.openPromise}finally{this.openPromise=null}}async close(){try{await this.openPromise}finally{this.ws?.close()}}constructor(e){if(j(this,"id",++M.connectCount),j(this,"WebSocketPonyfill",void 0),j(this,"urlOptions",void 0),j(this,"keepAliveOpts",void 0),j(this,"wsObservable",function(e){let t=null,r=[],i=e=>{void 0!==t&&e.next(t),r.push(e)},s=e=>{r.splice(r.indexOf(e),1)},o=n(e=>(i(e),()=>{s(e)}));return o.next=e=>{if(t!==e)for(let n of(t=e,r))n.next(e)},o.get=()=>t,o}(0)),j(this,"openPromise",null),this.WebSocketPonyfill=e.WebSocketPonyfill??WebSocket,!this.WebSocketPonyfill)throw Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=e.urlOptions,this.keepAliveOpts=e.keepAlive}}j(M,"connectCount",0);var N=r(95840);r(70060),r(1881),r(5194),r(22728),N.u.BAD_GATEWAY,N.u.SERVICE_UNAVAILABLE,N.u.GATEWAY_TIMEOUT,N.u.INTERNAL_SERVER_ERROR},61169:function(e,t,r){let n;r.d(t,{ec:function(){return Y}});var i=r(32419),s=r(45345),o=r(76968);function a(e,t,r){let n=e.flatMap(e=>e.split("."));if(!t&&(!r||"any"===r))return n.length?[n]:[];if("infinite"===r&&(0,o.Kn)(t)&&("direction"in t||"cursor"in t)){let{cursor:e,direction:r,...i}=t;return[n,{input:i,type:"infinite"}]}return[n,{...void 0!==t&&t!==s.CN&&{input:t},...r&&"any"!==r&&{type:r}}]}function u(e){return a(e,void 0,"any")}var l=r(2265);let c=["client","ssrContext","ssrState","abortOnUnmount"],h=l.createContext?.(null),f=e=>{switch(e){case"queryOptions":case"fetch":case"ensureData":case"prefetch":case"getData":case"setData":case"setQueriesData":return"query";case"infiniteQueryOptions":case"fetchInfinite":case"prefetchInfinite":case"getInfiniteData":case"setInfiniteData":return"infinite";case"setMutationDefaults":case"getMutationDefaults":case"isMutating":case"cancel":case"invalidate":case"refetch":case"reset":return"any"}};var d=r(87045),p=r(18238),y=r(21733),m=r(24112),b=r(16803),g=r(84554),v=class extends m.l{constructor(e,t){super(),this.options=t,this.#n=e,this.#T=null,this.#q=(0,b.O)(),this.bindMethods(),this.setOptions(t)}#n;#Q=void 0;#I=void 0;#D=void 0;#x;#k;#q;#T;#_;#A;#j;#M;#N;#F;#U=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#Q.addObserver(this),w(this.#Q,this.options)?this.#K():this.updateResult(),this.#L())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return O(this.#Q,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return O(this.#Q,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#V(),this.#z(),this.#Q.removeObserver(this)}setOptions(e){let t=this.options,r=this.#Q;if(this.options=this.#n.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,s.Nc)(this.options.enabled,this.#Q))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#H(),this.#Q.setOptions(this.options),t._defaulted&&!(0,s.VS)(this.options,t)&&this.#n.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#Q,observer:this});let n=this.hasListeners();n&&E(this.#Q,r,this.options,t)&&this.#K(),this.updateResult(),n&&(this.#Q!==r||(0,s.Nc)(this.options.enabled,this.#Q)!==(0,s.Nc)(t.enabled,this.#Q)||(0,s.KC)(this.options.staleTime,this.#Q)!==(0,s.KC)(t.staleTime,this.#Q))&&this.#G();let i=this.#B();n&&(this.#Q!==r||(0,s.Nc)(this.options.enabled,this.#Q)!==(0,s.Nc)(t.enabled,this.#Q)||i!==this.#F)&&this.#$(i)}getOptimisticResult(e){let t=this.#n.getQueryCache().build(this.#n,e),r=this.createResult(t,e);return(0,s.VS)(this.getCurrentResult(),r)||(this.#D=r,this.#k=this.options,this.#x=this.#Q.state),r}getCurrentResult(){return this.#D}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),"promise"!==r||(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#q.status||this.#q.reject(Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){this.#U.add(e)}getCurrentQuery(){return this.#Q}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#n.defaultQueryOptions(e),r=this.#n.getQueryCache().build(this.#n,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#K({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#D))}#K(e){this.#H();let t=this.#Q.fetch(this.options,e);return e?.throwOnError||(t=t.catch(s.ZT)),t}#G(){this.#V();let e=(0,s.KC)(this.options.staleTime,this.#Q);if(s.sk||this.#D.isStale||!(0,s.PN)(e))return;let t=(0,s.Kp)(this.#D.dataUpdatedAt,e);this.#M=g.mr.setTimeout(()=>{this.#D.isStale||this.updateResult()},t+1)}#B(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#Q):this.options.refetchInterval)??!1}#$(e){this.#z(),this.#F=e,!s.sk&&!1!==(0,s.Nc)(this.options.enabled,this.#Q)&&(0,s.PN)(this.#F)&&0!==this.#F&&(this.#N=g.mr.setInterval(()=>
5{(this.options.refetchIntervalInBackground||d.j.isFocused())&&this.#K()},this.#F))}#L(){this.#G(),this.#$(this.#B())}#V(){this.#M&&(g.mr.clearTimeout(this.#M),this.#M=void 0)}#z(){this.#N&&(g.mr.clearInterval(this.#N),this.#N=void 0)}createResult(e,t){let r;let n=this.#Q,i=this.options,o=this.#D,a=this.#x,u=this.#k,l=e!==n?e.state:this.#I,{state:c}=e,h={...c},f=!1;if(t._optimisticResults){let r=this.hasListeners(),s=!r&&w(e,t),o=r&&E(e,n,t,i);(s||o)&&(h={...h,...(0,y.z)(c.data,e.options)}),"isRestoring"===t._optimisticResults&&(h.fetchStatus="idle")}let{error:d,errorUpdatedAt:p,status:m}=h;r=h.data;let g=!1;if(void 0!==t.placeholderData&&void 0===r&&"pending"===m){let e;o?.isPlaceholderData&&t.placeholderData===u?.placeholderData?(e=o.data,g=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#j?.state.data,this.#j):t.placeholderData,void 0!==e&&(m="success",r=(0,s.oE)(o?.data,e,t),f=!0)}if(t.select&&void 0!==r&&!g){if(o&&r===a?.data&&t.select===this.#_)r=this.#A;else try{this.#_=t.select,r=t.select(r),r=(0,s.oE)(o?.data,r,t),this.#A=r,this.#T=null}catch(e){this.#T=e}}this.#T&&(d=this.#T,r=this.#A,p=Date.now(),m="error");let v="fetching"===h.fetchStatus,O="pending"===m,S="error"===m,C=O&&v,P=void 0!==r,T={status:m,fetchStatus:h.fetchStatus,isPending:O,isSuccess:"success"===m,isError:S,isInitialLoading:C,isLoading:C,data:r,dataUpdatedAt:h.dataUpdatedAt,error:d,errorUpdatedAt:p,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>l.dataUpdateCount||h.errorUpdateCount>l.errorUpdateCount,isFetching:v,isRefetching:v&&!O,isLoadingError:S&&!P,isPaused:"paused"===h.fetchStatus,isPlaceholderData:f,isRefetchError:S&&P,isStale:R(e,t),refetch:this.refetch,promise:this.#q,isEnabled:!1!==(0,s.Nc)(t.enabled,e)};if(this.options.experimental_prefetchInRender){let t=e=>{"error"===T.status?e.reject(T.error):void 0!==T.data&&e.resolve(T.data)},r=()=>{t(this.#q=T.promise=(0,b.O)())},i=this.#q;switch(i.status){case"pending":e.queryHash===n.queryHash&&t(i);break;case"fulfilled":("error"===T.status||T.data!==i.value)&&r();break;case"rejected":("error"!==T.status||T.error!==i.reason)&&r()}}return T}updateResult(){let e=this.#D,t=this.createResult(this.#Q,this.options);this.#x=this.#Q.state,this.#k=this.options,void 0!==this.#x.data&&(this.#j=this.#Q),(0,s.VS)(t,e)||(this.#D=t,this.#W({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#U.size)return!0;let n=new Set(r??this.#U);return this.options.throwOnError&&n.add("error"),Object.keys(this.#D).some(t=>this.#D[t]!==e[t]&&n.has(t))})()}))}#H(){let e=this.#n.getQueryCache().build(this.#n,this.options);if(e===this.#Q)return;let t=this.#Q;this.#Q=e,this.#I=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#L()}#W(e){p.Vr.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#D)}),this.#n.getQueryCache().notify({query:this.#Q,type:"observerResultsUpdated"})})}};function w(e,t){return!1!==(0,s.Nc)(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)||void 0!==e.state.data&&O(e,t,t.refetchOnMount)}function O(e,t,r){if(!1!==(0,s.Nc)(t.enabled,e)&&"static"!==(0,s.KC)(t.staleTime,e)){let n="function"==typeof r?r(e):r;return"always"===n||!1!==n&&R(e,t)}return!1}function E(e,t,r,n){return(e!==t||!1===(0,s.Nc)(n.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&R(e,r)}function R(e,t){return!1!==(0,s.Nc)(t.enabled,e)&&e.isStaleByTime((0,s.KC)(t.staleTime,e))}var S=r(29827);r(57437);
5var C=l.createContext((n=!1,{clearReset:()=>{n=!1},reset:()=>{n=!0},isReset:()=>n})),P=()=>l.useContext(C),T=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&!t.isReset()&&(e.retryOnMount=!1)},q=e=>{l.useEffect(()=>{e.clearReset()},[e])},Q=e=>{let{result:t,errorResetBoundary:r,throwOnError:n,query:i,suspense:o}=e;return t.isError&&!r.isReset()&&!t.isFetching&&i&&(o&&void 0===t.data||(0,s.L3)(n,[t.error,i]))},I=l.createContext(!1),D=()=>l.useContext(I);I.Provider;var x=(e,t)=>void 0===t.state.data,k=e=>{if(e.suspense){let t=e=>"static"===e?e:Math.max(e??1e3,1e3),r=e.staleTime;e.staleTime="function"==typeof r?(...e)=>t(r(...e)):t(r),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,1e3))}},_=(e,t)=>e.isLoading&&e.isFetching&&!t,A=(e,t)=>e?.suspense&&t.isPending,j=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function M(e,t,r){var n,i,o,a,u;let c=D(),h=P(),f=(0,S.NL)(r),d=f.defaultQueryOptions(e);null===(i=f.getDefaultOptions().queries)||void 0===i||null===(n=i._experimental_beforeQuery)||void 0===n||n.call(i,d),d._optimisticResults=c?"isRestoring":"optimistic",k(d),T(d,h),q(h);let y=!f.getQueryCache().get(d.queryHash),[m]=l.useState(()=>new t(f,d)),b=m.getOptimisticResult(d),g=!c&&!1!==e.subscribed;if(l.useSyncExternalStore(l.useCallback(e=>{let t=g?m.subscribe(p.Vr.batchCalls(e)):s.ZT;return m.updateResult(),t},[m,g]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),l.useEffect(()=>{m.setOptions(d)},[d,m]),A(d,b))throw j(d,m,h);if(Q({result:b,errorResetBoundary:h,throwOnError:d.throwOnError,query:f.getQueryCache().get(d.queryHash),suspense:d.suspense}))throw b.error;if(null===(a=f.getDefaultOptions().queries)||void 0===a||null===(o=a._experimental_afterQuery)||void 0===o||o.call(a,d,b),d.experimental_prefetchInRender&&!s.sk&&_(b,c)){let e=y?j(d,m,h):null===(u=f.getQueryCache().get(d.queryHash))||void 0===u?void 0:u.promise;null==e||e.catch(s.ZT).finally(()=>{m.updateResult()})}return d.notifyOnChangeProps?b:m.trackResult(b)}var N=r(2894),F=class extends m.l{#n;#D=void 0;#Z;#Y;constructor(e,t){super(),this.#n=e,this.setOptions(t),this.bindMethods(),this.#J()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#n.defaultMutationOptions(e),(0,s.VS)(this.options,t)||this.#n.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#Z,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,s.Ym)(t.mutationKey)!==(0,s.Ym)(this.options.mutationKey)?this.reset():this.#Z?.state.status==="pending"&&this.#Z.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#Z?.removeObserver(this)}onMutationUpdate(e){this.#J(),this.#W(e)}getCurrentResult(){return this.#D}reset(){this.#Z?.removeObserver(this),this.#Z=void 0,this.#J(),this.#W()}mutate(e,t){return this.#Y=t,this.#Z?.removeObserver(this),this.#Z=this.#n.getMutationCache().build(this.#n,this.options),this.#Z.addObserver(this),this.#Z.execute(e)}#J(){let e=this.#Z?.state??(0,N.R)();this.#D={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#W(e){p.Vr.batch(()=>{if(this.#Y&&this.hasListeners()){let t=this.#D.variables,r=this.#D.context,n={client:this.#n,meta:this.options.meta,mutationKey:this.options.mutationKey};e?.type==="success"?(this.#Y.onSuccess?.(e.data,t,r,n),this.#Y.onSettled?.(e.data,null,t,r,n)):e?.type==="error"&&(this.#Y.onError?.(e.error,t,r,n),this.#Y.onSettled?.(void 0,e.error,t,r,n))}this.listeners.forEach(e=>{e(this.#D)})})}},U=r(21636),K=class extends v{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:(0,U.Gm)()})}getOptimisticResult(e){return e.behavior=(0,U.Gm)(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){let{state:r}=e,n=super.createResult(e,t),{isFetching:i,isRefetching:s,isError:o,isRefetchError:a}
5=n,u=r.fetchMeta?.fetchMore?.direction,l=o&&"forward"===u,c=i&&"forward"===u,h=o&&"backward"===u,f=i&&"backward"===u;return{...n,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:(0,U.Qy)(t,r.data),hasPreviousPage:(0,U.ZF)(t,r.data),isFetchNextPageError:l,isFetchingNextPage:c,isFetchPreviousPageError:h,isFetchingPreviousPage:f,isRefetchError:a&&!l&&!h,isRefetching:s&&!c&&!f}}};function L(e,t){let r=new Set(t);return e.filter(e=>!r.has(e))}var V=class extends m.l{#n;#X;#p;#ee;#i;#et;#er;#en;#ei=[];constructor(e,t,r){super(),this.#n=e,this.#ee=r,this.#p=[],this.#i=[],this.#X=[],this.setQueries(t)}onSubscribe(){1===this.listeners.size&&this.#i.forEach(e=>{e.subscribe(t=>{this.#es(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#p=e,this.#ee=t,p.Vr.batch(()=>{let e=this.#i,t=this.#eo(this.#p);this.#ei=t,t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let r=t.map(e=>e.observer),n=r.map(e=>e.getCurrentResult()),i=e.length!==r.length,o=r.some((t,r)=>t!==e[r]),a=i||o,u=!!a||n.some((e,t)=>{let r=this.#X[t];return!r||!(0,s.VS)(e,r)});(a||u)&&(a&&(this.#i=r),this.#X=n,this.hasListeners()&&(a&&(L(e,r).forEach(e=>{e.destroy()}),L(r,e).forEach(e=>{e.subscribe(t=>{this.#es(e,t)})})),this.#W()))})}getCurrentResult(){return this.#X}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let r=this.#eo(e),n=r.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions));return[n,e=>this.#ea(e??n,t),()=>this.#eu(n,r)]}#eu(e,t){return t.map((r,n)=>{let i=e[n];return r.defaultedQueryOptions.notifyOnChangeProps?i:r.observer.trackResult(i,e=>{t.forEach(t=>{t.observer.trackProp(e)})})})}#ea(e,t){return t?(this.#et&&this.#X===this.#en&&t===this.#er||(this.#er=t,this.#en=this.#X,this.#et=(0,s.Q$)(this.#et,t(e))),this.#et):e}#eo(e){let t=new Map;this.#i.forEach(e=>{let r=e.options.queryHash;if(!r)return;let n=t.get(r);n?n.push(e):t.set(r,[e])});let r=[];return e.forEach(e=>{let n=this.#n.defaultQueryOptions(e),i=t.get(n.queryHash)?.shift()??new v(this.#n,n);r.push({defaultedQueryOptions:n,observer:i})}),r}#es(e,t){let r=this.#i.indexOf(e);-1!==r&&(this.#X=function(e,t,r){let n=e.slice(0);return n[t]=r,n}(this.#X,r,t),this.#W())}
5#W(){if(this.hasListeners()){let e=this.#et,t=this.#eu(this.#X,this.#ei);e!==this.#ea(t,this.#ee?.combine)&&p.Vr.batch(()=>{this.listeners.forEach(e=>{e(this.#X)})})}}};function z(e,t){let{queries:r,...n}=e,i=(0,S.NL)(t),o=D(),a=P(),u=l.useMemo(()=>r.map(e=>{let t=i.defaultQueryOptions(e);return t._optimisticResults=o?"isRestoring":"optimistic",t}),[r,i,o]);u.forEach(e=>{k(e),T(e,a)}),q(a);let[c]=l.useState(()=>new V(i,u,n)),[h,f,d]=c.getOptimisticResult(u,n.combine),y=!o&&!1!==n.subscribed;l.useSyncExternalStore(l.useCallback(e=>y?c.subscribe(p.Vr.batchCalls(e)):s.ZT,[c,y]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),l.useEffect(()=>{c.setQueries(u,n)},[u,n,c]);let m=h.some((e,t)=>A(u[t],e))?h.flatMap((e,t)=>{let r=u[t];if(r){let t=new v(i,r);if(A(r,e))return j(r,t,a);_(e,o)&&j(r,t,a)}return[]}):[];if(m.length>0)throw Promise.all(m);let b=h.find((e,t)=>{let r=u[t];return r&&Q({result:e,errorResetBoundary:a,throwOnError:r.throwOnError,query:i.getQueryCache().get(r.queryHash),suspense:r.suspense})});if(null==b?void 0:b.error)throw b.error;return f(d())}function H(e,t,r){let n=e[0],i=e[1]?.input;return r&&(i={...i??{},...r.pageParam?{cursor:r.pageParam}:{},direction:r.direction}),[n.join("."),i,t?.trpc]}function G(e){return{path:e.path.join(".")}}function B(e){let t=G(e);return l.useMemo(()=>t,[t])}async function $(e,t,r){let n=t.getQueryCache().build(t,{queryKey:r});n.setState({data:[],status:"success"});let i=[];for await(let t of e)i.push(t),n.setState({data:[...i]});return i}function W(e){let t=e instanceof i.NT?e:(0,i.ny)(e);return(0,o.IX)(e=>{let r=e.path,n=r.join("."),[i,s]=e.args;return{queryKey:a(r,i,"query"),queryFn:()=>t.query(n,i,s?.trpc),...s}})}let Z=(e,t)=>new Proxy(e,{get:(e,r)=>(t(r),e[r])});function Y(e){return function(e){let t=(0,o.IX)(({path:t,args:r})=>{let n=[...t],i=n.pop();if("useMutation"===i)return e[i](n,...r);if("_def"===i)return{path:n};let[s,...o]=r,a=o[0]||{};return e[i](n,s,a)});return(0,o.yh)(r=>"useContext"===r||"useUtils"===r?()=>{let t=e.useUtils();return l.useMemo(()=>(function(e){let t=(0,i.Bm)(e.client),r=(0,o.IX)(t=>{let r=[...t.path],n=r.pop(),i=[...t.args],s=i.shift(),o=a(r,s,f(n));return({infiniteQueryOptions:()=>e.infiniteQueryOptions(r,o,i[0]),queryOptions:()=>e.queryOptions(r,o,...i),fetch:()=>e.fetchQuery(o,...i),fetchInfinite:()=>e.fetchInfiniteQuery(o,i[0]),prefetch:()=>e.prefetchQuery(o,...i),prefetchInfinite:()=>e.prefetchInfiniteQuery(o,i[0]),ensureData:()=>e.ensureQueryData(o,...i),invalidate:()=>e.invalidateQueries(o,...i),reset:()=>e.resetQueries(o,...i),refetch:()=>e.refetchQueries(o,...i),cancel:()=>e.cancelQuery(o,...i),setData:()=>{e.setQueryData(o,i[0],i[1])},setQueriesData:()=>e.setQueriesData(o,i[0],i[1],i[2]),setInfiniteData:()=>{e.setInfiniteQueryData(o,i[0],i[1])},getData:()=>e.getQueryData(o),getInfiniteData:()=>e.getInfiniteQueryData(o),setMutationDefaults:()=>e.setMutationDefaults(u(r),s),getMutationDefaults:()=>e.getMutationDefaults(u(r)),isMutating:()=>e.isMutating({mutationKey:u(r)})})[n]()});return(0,o.yh)(n=>"client"===n?t:c.includes(n)?e[n]:r[n])})(t),[t])}:e.hasOwnProperty(r)?e[r]:t[r])}(function(e){let t=e?.overrides?.useMutation?.onSuccess??(e=>e.originalFn()),r=e?.context??h,n=i.BJ;function c(){let e=l.useContext(r);if(!e)throw Error("Unable to find tRPC Context. Did you forget to wrap your App inside `withTRPC` HoC?");return e}function f(e,t){let{queryClient:r,ssrState:n}=c();return n&&"mounted"!==n&&r.getQueryCache().find({queryKey:e})?.state.status==="error"?{retryOnMount:!1,...t}:t}let d={data:void 0,error:null,status:"idle"},y={data:void 0,error:null,status:"connecting"};return{Provider:e=>{let{abortOnUnmount:t=!1,queryClient:n,ssrContext:a}=e,[u,c]=l.useState(e.ssrState??!1),h=e.client instanceof i.NT?e.client:(0,i.ny)(e.client),f=l.useMemo(()=>(function(e){let{client:t,queryClient:r}=e,n=t instanceof i.NT?t:(0,i.ny)(t);return{infiniteQueryOptions:(e,t,r)=>{let i=t[1]?.input===s.CN,o=async e=>{let i={...r,trpc:{...r?.trpc,...r?.trpc?.abortOnUnmount?{signal:e.signal}:{signal:null}}};return await n.query(...H(t,i,{direction:e.direction,pageParam:e.pageParam}))};return Object.assign({...r,initialData:r?.initialData,queryKey:t,queryFn:i?s.CN:o,initialPageParam:r?.initialCursor??null},{trpc:G({path:e})})},queryOptions:(e,t,i)=>{let a=t[1]?.input===s.CN,u=async e=>{let s={...i,trpc:{...i?.trpc,...i?.trpc?.abortOnUnmount?{signal:e.signal}:{signal:null}}},a=await n.query(...H(t,s));return(0,o.D0)(a)?$(a,r,t):a};return Object.assign({...i,initialData:i?.initialData,queryKey:t,queryFn:a?s.CN:u},{trpc:G({path:e})})},fetchQuery:(e,t)=>r.fetchQuery({...t,queryKey:e,queryFn:()=>n.query(...H(e,t))}),fetchInfiniteQuery:(e,t)=>r.fetchInfiniteQuery({...t,queryKey:e,queryFn:({pageParam:r,direction:i})=>n.query(...H(e,t,{pageParam:r,direction:i})),initialPageParam:t?.initialCursor??null}),prefetchQuery:(e,t)=>r.prefetchQuery({...t,queryKey:e,queryFn:()=>n.query(...H(e,t))}),prefetchInfiniteQuery:(e,t)=>r.prefetchInfiniteQuery({...t,queryKey:e,queryFn:({pageParam:r,direction:i})=>n.query(...H(e,t,{pageParam:r,direction:i})),initialPageParam:t?.initialCursor??null}),ensureQueryData:(e,t)=>r.ensureQueryData({...t,queryKey:e,queryFn:()=>n.query(...H(e,t))}),invalidateQueries:(e,t,n)=>
5r.invalidateQueries({...t,queryKey:e},n),resetQueries:(e,t,n)=>r.resetQueries({...t,queryKey:e},n),refetchQueries:(e,t,n)=>r.refetchQueries({...t,queryKey:e},n),cancelQuery:(e,t)=>r.cancelQueries({queryKey:e},t),setQueryData:(e,t,n)=>r.setQueryData(e,t,n),setQueriesData:(e,t,n,i)=>r.setQueriesData({...t,queryKey:e},n,i),getQueryData:e=>r.getQueryData(e),setInfiniteQueryData:(e,t,n)=>r.setQueryData(e,t,n),getInfiniteQueryData:e=>r.getQueryData(e),setMutationDefaults:(t,i)=>{let s=t[0];return r.setMutationDefaults(t,"function"==typeof i?i({canonicalMutationFn:t=>n.mutation(...H([s,{input:t}],e))}):i)},getMutationDefaults:e=>r.getMutationDefaults(e),isMutating:e=>r.isMutating({...e,exact:!0})}})({client:h,queryClient:n}),[h,n]),d=l.useMemo(()=>({abortOnUnmount:t,queryClient:n,client:h,ssrContext:a??null,ssrState:u,...f}),[t,h,f,n,a,u]);return l.useEffect(()=>{c(e=>!!e&&"mounted")},[]),l.createElement(r.Provider,{value:d},e.children)},createClient:n,useContext:c,useUtils:c,useQuery:function(t,r,n){let{abortOnUnmount:i,client:u,ssrState:l,queryClient:h,prefetchQuery:d}=c(),p=a(t,r,"query"),y=h.getQueryDefaults(p),m=r===s.CN;"undefined"!=typeof window||"prepass"!==l||n?.trpc?.ssr===!1||(n?.enabled??y?.enabled)===!1||m||h.getQueryCache().find({queryKey:p})||d(p,n);let b=f(p,{...y,...n}),g=n?.trpc?.abortOnUnmount??e?.abortOnUnmount??i,w=M({...b,queryKey:p,queryFn:m?r:async e=>{let t={...b,trpc:{...b?.trpc,...g?{signal:e.signal}:{signal:null}}},r=await u.query(...H(p,t));return(0,o.D0)(r)?$(r,h,p):r}},v,h);return w.trpc=B({path:t}),w},usePrefetchQuery:function(t,r,n){let i=c(),o=a(t,r,"query"),u=r===s.CN,l=n?.trpc?.abortOnUnmount??e?.abortOnUnmount??i.abortOnUnmount;!function(e,t){let r=(0,S.NL)(void 0);r.getQueryState(e.queryKey)||r.prefetchQuery(e)}({...n,queryKey:o,queryFn:u?r:e=>{let t={trpc:{...n?.trpc,...l?{signal:e.signal}:{}}};return i.client.query(...H(o,t))}})},useSuspenseQuery:function(t,r,n){var i,s;let o=c(),u=a(t,r,"query"),l=n?.trpc?.abortOnUnmount??e?.abortOnUnmount??o.abortOnUnmount,h=(i={...n,queryKey:u,queryFn:e=>{let t={...n,trpc:{...n?.trpc,...l?{signal:e.signal}:{signal:null}}};return o.client.query(...H(u,t))}},s=o.queryClient,M({...i,enabled:!0,suspense:!0,throwOnError:x,placeholderData:void 0},v,s));return h.trpc=B({path:t}),[h.data,h]},useQueries:(e,t)=>{let{ssrState:r,queryClient:n,prefetchQuery:i,client:s}=c(),o=e(W(s));if("undefined"==typeof window&&"prepass"===r)for(let e of o)e.trpc?.ssr===!1||n.getQueryCache().find({queryKey:e.queryKey})||i(e.queryKey,e);return z({queries:o.map(e=>({...e,queryKey:e.queryKey})),combine:t?.combine},n)},useSuspenseQueries:e=>{var t;let{queryClient:r,client:n}=c(),i=z({...t={queries:e(W(n)).map(e=>({...e,queryFn:e.queryFn,queryKey:e.queryKey}))},queries:t.queries.map(e=>({...e,suspense:!0,throwOnError:x,enabled:!0,placeholderData:void 0}))},r);return[i.map(e=>e.data),i]},useMutation:function(e,r){let{client:n,queryClient:i}=c(),o=u(e),a=i.defaultMutationOptions(i.getMutationDefaults(o)),h=function(e,t){let r=(0,S.NL)(t),[n]=l.useState(()=>new F(r,e));l.useEffect(()=>{n.setOptions(e)},[n,e]);let i=l.useSyncExternalStore(l.useCallback(e=>n.subscribe(p.Vr.batchCalls(e)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),o=l.useCallback((e,t)=>{n.mutate(e,t).catch(s.ZT)},[n]);if(i.error&&(0,s.L3)(n.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}({...r,mutationKey:o,mutationFn:t=>n.mutation(...H([e,{input:t}],r)),onSuccess:(...e)=>t({originalFn:()=>r?.onSuccess?.(...e)??a?.onSuccess?.(...e),queryClient:i,meta:r?.meta??a?.meta??{}})},i);return h.trpc=B({path:e}),h},useSubscription:function(e,t,r){let n=r?.enabled??t!==s.CN,i=(0,s.Ym)(a(e,t,"any")),{client:o}=c(),u=l.useRef(r);l.useEffect(()=>{u.current=r});let[h]=l.useState(new Set([])),f=l.useCallback(e=>{h.add(e)},[h]),p=l.useRef(null),m=l.useCallback(e=>{let t=g.current,r=g.current=e(t),n=!1;for(let e of h)if(t[e]!==r[e]){n=!0;break}n&&w(Z(r,f))},[f,h]),b=l.useCallback(()=>{if(p.current?.unsubscribe(),!n){m(()=>({...d,reset:b}));return}m(()=>({...y,reset:b}));let r=o.subscription(e.join("."),t??void 0,{onStarted:()=>{u.current.onStarted?.(),m(e=>({...e,status:"pending",error:null}))},onData:e=>{u.current.onData?.(e),m(t=>({...t,status:"pending",data:e,error:null}))},onError:e=>{u.current.onError?.(e),m(t=>({...t,status:"error",error:e}))},onConnectionStateChange:e=>{m(t=>{switch(e.state){case"idle":return{...t,status:e.state,error:null,data:void 0};case"connecting":return{...t,error:e.error,status:e.state};
5case"pending":return t}})},onComplete:()=>{u.current.onComplete?.(),m(e=>({...e,status:"idle",error:null,data:void 0}))}});p.current=r},[o,i,n,m]);l.useEffect(()=>(b(),()=>{p.current?.unsubscribe()}),[b]);let g=l.useRef(n?{...y,reset:b}:{...d,reset:b}),[v,w]=l.useState(Z(g.current,f));return v},useInfiniteQuery:function(e,t,r){let{client:n,ssrState:i,prefetchInfiniteQuery:o,queryClient:u,abortOnUnmount:l}=c(),h=a(e,t,"infinite"),d=u.getQueryDefaults(h),p=t===s.CN;"undefined"!=typeof window||"prepass"!==i||r?.trpc?.ssr===!1||(r?.enabled??d?.enabled)===!1||p||u.getQueryCache().find({queryKey:h})||o(h,{...d,...r});let y=f(h,{...d,...r}),m=r?.trpc?.abortOnUnmount??l,b=M({...y,initialPageParam:r.initialCursor??null,persister:r.persister,queryKey:h,queryFn:p?t:e=>{let t={...y,trpc:{...y?.trpc,...m?{signal:e.signal}:{signal:null}}};return n.query(...H(h,t,{pageParam:e.pageParam??r.initialCursor,direction:e.direction}))}},K,u);return b.trpc=B({path:e}),b},usePrefetchInfiniteQuery:function(e,t,r){let n=c(),i=a(e,t,"infinite"),o=n.queryClient.getQueryDefaults(i),u=t===s.CN,l=f(i,{...o,...r}),h=r?.trpc?.abortOnUnmount??n.abortOnUnmount;!function(e,t){let r=(0,S.NL)(void 0);r.getQueryState(e.queryKey)||r.prefetchInfiniteQuery(e)}({...r,initialPageParam:r.initialCursor??null,queryKey:i,queryFn:u?t:e=>{let t={...l,trpc:{...l?.trpc,...h?{signal:e.signal}:{}}};return n.client.query(...H(i,t,{pageParam:e.pageParam??r.initialCursor,direction:e.direction}))}})},useSuspenseInfiniteQuery:function(e,t,r){var n,i;let s=c(),o=a(e,t,"infinite"),u=s.queryClient.getQueryDefaults(o),l=f(o,{...u,...r}),h=r?.trpc?.abortOnUnmount??s.abortOnUnmount,d=(n={...r,initialPageParam:r.initialCursor??null,queryKey:o,queryFn:e=>{let t={...l,trpc:{...l?.trpc,...h?{signal:e.signal}:{}}};return s.client.query(...H(o,t,{pageParam:e.pageParam??r.initialCursor,direction:e.direction}))}},i=s.queryClient,M({...n,enabled:!0,suspense:!0,throwOnError:x},K,i));return d.trpc=B({path:e}),[d.data,d]}}}(e))}},76968:function(e,t,r){r.d(t,{yh:function(){return o},IX:function(){return s},D0:function(){return a.D0},Kn:function(){return a.Kn},$N:function(){return P}});let n=()=>{},i=e=>{Object.freeze&&Object.freeze(e)},s=e=>(function e(t,r,s){let o=r.join(".");return s[o]??(s[o]=new Proxy(n,{get(n,i){if("string"==typeof i&&"then"!==i)return e(t,[...r,i],s)},apply(e,n,s){let o=r[r.length-1],a={args:s,path:r};return"call"===o?a={args:s.length>=2?[s[1]]:[],path:r.slice(0,-1)}:"apply"===o&&(a={args:s.length>=2?s[1]:[],path:r.slice(0,-1)}),i(a.args),i(a.path),t(a)}})),s[o]})(e,[],Object.create(null)),o=e=>new Proxy(n,{get(t,r){if("then"!==r)return e(r)}});r(95840);var a=r(77757);function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class l extends Error{}function c(e){if(e instanceof h||e instanceof Error&&"TRPCError"===e.name)return e;let t=new h({code:"INTERNAL_SERVER_ERROR",cause:e});return e instanceof Error&&e.stack&&(t.stack=e.stack),t}
5class h extends Error{constructor(e){let t=function(e){if(e instanceof Error)return e;let t=typeof e;if("undefined"!==t&&"function"!==t&&null!==e){if("object"!==t)return Error(String(e));if((0,a.Kn)(e)){let t=new l;for(let r in e)t[r]=e[r];return t}}}(e.cause);super(e.message??t?.message??e.code,{cause:t}),u(this,"cause",void 0),u(this,"code",void 0),this.code=e.code,this.name="TRPCError",this.cause||(this.cause=t)}}let f=({shape:e})=>e,d={input:{serialize:e=>e,deserialize:e=>e},output:{serialize:e=>e,deserialize:e=>e}},p=Symbol("lazy"),y={_ctx:null,_errorShape:null,_meta:null,queries:{},mutations:{},subscriptions:{},errorFormatter:f,transformer:d},m=["then","call","apply"];function b(e){return function(t){let r=new Set(Object.keys(t).filter(e=>m.includes(e)));if(r.size>0)throw Error("Reserved words used in `router({})` call: "+Array.from(r).join(", "));let n=(0,a.St)({}),i=(0,a.St)({}),s=function e(t,r=[]){let s=(0,a.St)({});for(let[o,u]of Object.entries(t??{})){if("function"==typeof u&&p in u){i[[...r,o].join(".")]=function t(r){return{ref:r.ref,load:function(e){let t=Symbol(),r=t;return()=>(r===t&&(r=e()),r)}(async()=>{let n=await r.ref(),s=[...r.path,r.key],o=s.join(".");for(let[a,u]of(r.aggregate[r.key]=e(n._def.record,s),delete i[o],Object.entries(n._def.lazy)))i[[...s,a].join(".")]=t({ref:u.ref,path:s,key:a,aggregate:r.aggregate[r.key]})})}}({path:r,ref:u,key:o,aggregate:s});continue}if((0,a.Kn)(u)&&(0,a.Kn)(u._def)&&"router"in u._def){s[o]=e(u._def.record,[...r,o]);continue}if("function"!=typeof u){s[o]=e(u,[...r,o]);continue}let t=[...r,o].join(".");if(n[t])throw Error(`Duplicate key: ${t}`);n[t]=u,s[o]=u}return s}(t),o={_config:e,router:!0,procedures:n,lazy:i,...y,record:s};return{...s,_def:o,createCaller:v()({_def:o})}}}async function g(e,t){let{_def:r}=e,n=r.procedures[t];for(;!n;){let e=Object.keys(r.lazy).find(e=>t.startsWith(e));if(!e)return null;let i=r.lazy[e];await i.load(),n=r.procedures[t]}return n}function v(){return function(e){let{_def:t}=e;return function(r,n){return s(async({path:i,args:s})=>{let o;let u=i.join(".");if(1===i.length&&"_def"===i[0])return t;let l=await g(e,u);try{if(!l)throw new h({code:"NOT_FOUND",message:`No procedure found on path "${i}"`});return o=(0,a.mf)(r)?await Promise.resolve(r()):r,await l({path:u,getRawInput:async()=>s[0],ctx:o,type:l._def.type,signal:n?.signal})}catch(e){throw n?.onError?.({ctx:o,error:c(e),input:s[0],path:u,type:l?._def.type??"unknown"}),e}})}}}function w(...e){let t=(0,a.Ne)({},...e.map(e=>e._def.record));return b({errorFormatter:e.reduce((e,t)=>{if(t._def._config.errorFormatter&&t._def._config.errorFormatter!==f){if(e!==f&&e!==t._def._config.errorFormatter)throw Error("You seem to have several error formatters");return t._def._config.errorFormatter}return e},f),transformer:e.reduce((e,t)=>{if(t._def._config.transformer&&t._def._config.transformer!==d){if(e!==d&&e!==t._def._config.transformer)throw Error("You seem to have several transformers");return t._def._config.transformer}return e},d),isDev:e.every(e=>e._def._config.isDev),allowOutsideOfServer:e.every(e=>e._def._config.allowOutsideOfServer),isServer:e.every(e=>e._def._config.isServer),$types:e[0]?._def._config.$types})(t)}r(1881);var O=r(5194);function E(e,t,r){if(null!=t){var n,i;if("object"!=typeof t&&"function"!=typeof t)throw TypeError("Object expected.");if(r){if(!Symbol.asyncDispose)throw TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],r&&(i=n)}if("function"!=typeof n)throw TypeError("Object not disposable.");i&&(n=function(){try{i.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}function R(e){var t="function"==typeof SuppressedError?SuppressedError:function(e,t,r){var n=Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};return(R=function(e){function r(r){e.error=e.hasError?new t(r,e.error,"An error was suppressed during disposal."):r,e.hasError=!0}var n,i=0;return function t(){for(;n=e.stack.pop();)try{if(!n.async&&1===i)return i=0,e.stack.push(n),Promise.resolve().then(t);if(n.dispose){var s=n.dispose.call(n.value);if(n.async)return i|=2,Promise.resolve(s).then(t,function(e){return r(e),t()})}else i|=1}catch(e){r(e)}
5if(1===i)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}()})(e)}Symbol(),Symbol("ping");class S extends Error{constructor(e){var t,r;super("Received error from server"),r=void 0,(t="data")in this?Object.defineProperty(this,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):this[t]=r,this.data=e}}let C=e=>({getReader:()=>new ReadableStream({start(t){e.on("data",e=>{t.enqueue(e)}),e.on("end",()=>{t.close()}),e.on("error",e=>{t.error(e)})}}).getReader()});async function P(e){let t,r;let{deserialize:n=e=>e}=e,i=function(e){let t=function(e){let t="getReader"in e?e.getReader():C(e).getReader(),r="";return new ReadableStream({async pull(e){let{done:r,value:n}=await t.read();r?e.close():e.enqueue(n)},cancel:()=>t.cancel()}).pipeThrough(new TextDecoderStream).pipeThrough(new TransformStream({transform(e,t){let n=(r+=e).split("\n");for(let e of(r=n.pop()??"",n))t.enqueue(e)}}))}(e),r=!1;return t.pipeThrough(new TransformStream({transform(e,t){if(r){let r=JSON.parse(e);t.enqueue(r)}else{let n=JSON.parse(e);t.enqueue(n),r=!0}}}))}(e.from);n&&(i=i.pipeThrough(new TransformStream({transform(e,t){t.enqueue(n(e))}})));let s={promise:new Promise((e,n)=>{t=e,r=n}),resolve:t,reject:r},o=function(e){let t=new Map;function r(){return Array.from(t.values()).every(e=>e.closed)}return{getOrCreate:function(n){let i=t.get(n);return i||(i=function(){let t;let n=new ReadableStream({start(e){t=e}}),i={enqueue:e=>t.enqueue(e),close:()=>{t.close(),s(),r()&&e.abort()},closed:!1,getReaderResource:()=>{let e=n.getReader();return(0,O.H)(e,()=>{e.releaseLock(),i.close()})},error:e=>{t.error(e),s()}};function s(){Object.assign(i,{closed:!0,close:()=>{},enqueue:()=>{},getReaderResource:null,error:()=>{}})}return i}(),t.set(n,i)),i},isEmpty:r,cancelAll:function(e){for(let r of t.values())r.error(e)}}}(e.abortController),u=e=>{s?.reject(e),o.cancelAll(e)};return i.pipeTo(new WritableStream({write(t){if(s){for(let[r,n]of Object.entries(t)){let i=function t(r){let[[n],...i]=r;for(let r of i){let[i]=r,s=function(r){let[n,i,s]=r,u=o.getOrCreate(s);switch(i){case 0:return(0,a.KH)(async()=>{let r={stack:[],error:void 0,hasError:!1};try{let n=E(r,u.getReaderResource(),!1),{value:i}=await n.read(),[s,o,a]=i;switch(o){case 0:return t(a);case 1:throw e.formatError?.({error:a})??new S(a)}}catch(e){r.error=e,r.hasError=!0}finally{R(r)}});case 1:return(0,a.KH)(async function*(){let r={stack:[],error:void 0,hasError:!1};try{let n=E(r,u.getReaderResource(),!1);for(;;){let{value:r}=await n.read(),[i,s,o]=r;switch(s){case 1:yield t(o);break;case 0:return t(o);case 2:throw e.formatError?.({error:o})??new S(o)}}}catch(e){r.error=e,r.hasError=!0}finally{R(r)}})}}(r);if(null===i)return s;n[i]=s}return n}(n);t[r]=i}s.resolve(t),s=null;return}let[r]=t;o.getOrCreate(r).enqueue(t)},close:()=>u(Error("Stream closed")),abort:u}),{signal:e.abortController.signal}).catch(t=>{e.onError?.({error:t}),u(t)}),[await s.promise,o]}Symbol();let T="middlewareMarker";class q extends Error{constructor(e){var t,r;super(e[0]?.message),r=void 0,(t="issues")in this?Object.defineProperty(this,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):this[t]=r,this.name="SchemaError",this.issues=e}}function Q(e){if("function"==typeof e&&"function"==typeof e.assert)return e.assert.bind(e);if("function"==typeof e)return e;if("function"==typeof e.parseAsync)return e.parseAsync.bind(e);if("function"==typeof e.parse)return e.parse.bind(e);if("function"==typeof e.validateSync)return e.validateSync.bind(e);if("function"==typeof e.create)return e.create.bind(e);if("function"==typeof e.assert)return t=>(e.assert(t),t);if("~standard"in e)return async t=>{let r=await e["~standard"].validate(t);if(r.issues)throw new q(r.issues);return r.value};throw Error("Could not find a validator fn")}function I(e,t){let{middlewares:r=[],inputs:n,meta:i,...s}=t;return D({...(0,a.Ne)(e,s),inputs:[...e.inputs,...n??[]],middlewares:[...e.middlewares,...r],meta:e.meta&&i?{...e.meta,...i}:i??e.meta})}function D(e={}){let t={procedure:!0,inputs:[],middlewares:[],...e};return{_def:t,input(e){let r=Q(e);return I(t,{inputs:[e],middlewares:[function(e){let t=async function(t){let r;let n=await t.getRawInput();try{r=await e(n)}catch(e){throw new h({code:"BAD_REQUEST",cause:e})}let i=(0,a.Kn)(t.input)&&(0,a.Kn)(r)?{...t.input,...r}:r;return t.next({input:i})};return t._type="input",t}(r)]})},output(e){let r=Q(e);return I(t,{output:e,middlewares:[function(e){let t=async function({next:t}){let r=await t();if(!r.ok)return r;try{let t=await e(r.data);return{...r,data:t}}catch(e){throw new h({message:"Output validation failed",code:"INTERNAL_SERVER_ERROR",cause:e})}};return t._type="output",t}(r)]})},meta:e=>I(t,{meta:e}),use:e=>I(t,{middlewares:"_middlewares"in e?e._middlewares:[e]}),unstable_concat:e=>I(t,e._def),concat:e=>I(t,e._def),query:e=>x({...t,type:"query"},e),mutation:e=>x({...t,type:"mutation"},e),subscription:e=>x({...t,type:"subscription"},e),experimental_caller:e=>I(t,{caller:e})}}function x(e,t){let r=I(e,{resolver:t,middlewares:[async function(e){return{marker:T,ok:!0,data:await t(e),ctx:e.ctx}}]}),n={...r._def,type:e.type,experimental_caller:!!r._def.caller,meta:r._def.meta,$types:null},i=function(e){async function t(t){if(!t||!("getRawInput"in t))throw Error(k);let r=await _(0,e,t);if(!r)throw new h({code:"INTERNAL_SERVER_ERROR",message:"No result from middlewares - did you forget to `return next()`?"});if(!r.ok)throw r.error;return r.data}return t._def=e,t.procedure=!0,t}(r._def),s=r._def.caller;if(!s)return i;let o=async(...e)=>await s({args:e,invoke:i,_def:n});return o._def=n,o}let k=`
6This is a client-only function.
7If you want to call this function on the server, see https://trpc.io/docs/v11/server/server-side-calls
8`.trim();async function _(e,t,r){try{let n=t.middlewares[e];return await n({...r,meta:t.meta,input:r.input,next:n=>_(e+1,t,{...r,ctx:n?.ctx?{...r.ctx,...n.ctx}
8:r.ctx,input:n&&"input"in n?n.input:r.input,getRawInput:n?.getRawInput??r.getRawInput})})}catch(e){return{ok:!1,error:c(e),marker:T}}}var A=r(22728);class j{context(){return new j}meta(){return new j}create(e){var t;let r={...e,transformer:"input"in(t=e?.transformer??d)?t:{input:t,output:t},isDev:e?.isDev??globalThis.process?.env.NODE_ENV!=="production",allowOutsideOfServer:e?.allowOutsideOfServer??!1,errorFormatter:e?.errorFormatter??f,isServer:e?.isServer??A.h,$types:null};if(!(e?.isServer??A.h)&&e?.allowOutsideOfServer!==!0)throw Error("You're trying to use @trpc/server in a non-server environment. This is not supported by default.");return{_config:r,procedure:D({meta:e?.defaultMeta}),middleware:function(e){return function e(t){return{_middlewares:t,unstable_pipe:r=>e([...t,..."_middlewares"in r?r._middlewares:[r]])}}([e])},router:b(r),mergeRouters:w,createCallerFactory:v()}}}new j,r(70060)},22728:function(e,t,r){r.d(t,{h:function(){return n}});let n="undefined"==typeof window||"Deno"in window||globalThis.process?.env?.NODE_ENV==="test"||!!globalThis.process?.env?.JEST_WORKER_ID||!!globalThis.process?.env?.VITEST_WORKER_ID},95840:function(e,t,r){r.d(t,{u:function(){return n}});let n={PARSE_ERROR:-32700,BAD_REQUEST:-32600,INTERNAL_SERVER_ERROR:-32603,NOT_IMPLEMENTED:-32603,BAD_GATEWAY:-32603,SERVICE_UNAVAILABLE:-32603,GATEWAY_TIMEOUT:-32603,UNAUTHORIZED:-32001,FORBIDDEN:-32003,NOT_FOUND:-32004,METHOD_NOT_SUPPORTED:-32005,TIMEOUT:-32008,CONFLICT:-32009,PRECONDITION_FAILED:-32012,PAYLOAD_TOO_LARGE:-32013,UNSUPPORTED_MEDIA_TYPE:-32015,UNPROCESSABLE_CONTENT:-32022,TOO_MANY_REQUESTS:-32029,CLIENT_CLOSED_REQUEST:-32099}},70060:function(e,t,r){r(77757)},5194:function(e,t,r){var n,i;function s(e,t){let r=e[Symbol.dispose];return e[Symbol.dispose]=()=>{t(),r?.()},e}r.d(t,{H:function(){return s}}),(n=Symbol).dispose??(n.dispose=Symbol()),(i=Symbol).asyncDispose??(i.asyncDispose=Symbol())},77757:function(e,t,r){r.d(t,{D0:function(){return l},KH:function(){return c},Kn:function(){return s},Ne:function(){return i},St:function(){return a},mf:function(){return o},yu:function(){return n}});let n=Symbol();function i(e,...t){let r=Object.assign(Object.create(null),e);for(let e of t)for(let t in e){if(t in r&&r[t]!==e[t])throw Error(`Duplicate key ${t}`);r[t]=e[t]}return r}function s(e){return!!e&&!Array.isArray(e)&&"object"==typeof e}function o(e){return"function"==typeof e}function a(e){return Object.assign(Object.create(null),e)}let u="function"==typeof Symbol&&!!Symbol.asyncIterator;function l(e){return u&&s(e)&&Symbol.asyncIterator in e}let c=e=>e()},1881:function(e,t,r){new WeakMap},5126:function(e,t,r){r.d(t,{ZP:function(){return J}});class n{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(e,t){this.keyToValue.set(e,t),this.valueToKey.set(t,e)}getByKey(e){return this.keyToValue.get(e)}getByValue(e){return this.valueToKey.get(e)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}}class i{constructor(e){this.generateIdentifier=e,this.kv=new n}register(e,t){this.kv.getByValue(e)||(t||(t=this.generateIdentifier(e)),this.kv.set(t,e))}clear(){this.kv.clear()}getIdentifier(e){return this.kv.getByValue(e)}getValue(e){return this.kv.getByKey(e)}}class s extends i{constructor(){super(e=>e.name),this.classToAllowedProps=new Map}register(e,t){"object"==typeof t?(t.allowProps&&this.classToAllowedProps.set(e,t.allowProps),super.register(e,t.identifier)):super.register(e,t)}getAllowedProps(e){return this.classToAllowedProps.get(e)}}function o(e,t){Object.entries(e).forEach(([e,r])=>t(r,e))}function a(e,t){return -1!==e.indexOf(t)}function u(e,t){for(let r=0;r<e.length;r++){let n=e[r];if(t(n))return n}}class l{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return function(e,t){let r=function(e){if("values"in Object)return Object.values(e);let t=[];for(let r in e)e.hasOwnProperty(r)&&t.push(e[r]);return t}(e);if("find"in r)return r.find(t);for(let e=0;e<r.length;e++){let n=r[e];if(t(n))return n}}(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}}let c=e=>Object.prototype.toString.call(e).slice(8,-1),h=e=>void 0===e,f=e=>null===e,d=e=>"object"==typeof e&&null!==e&&e!==Object.prototype&&(null===Object.getPrototypeOf(e)||Object.getPrototypeOf(e)===Object.prototype),p=e=>d(e)&&0===Object.keys(e).length,y=e=>Array.isArray(e),m=e=>
8"string"==typeof e,b=e=>"number"==typeof e&&!isNaN(e),g=e=>"boolean"==typeof e,v=e=>e instanceof Map,w=e=>e instanceof Set,O=e=>"Symbol"===c(e),E=e=>e instanceof Error,R=e=>"number"==typeof e&&isNaN(e),S=e=>g(e)||f(e)||h(e)||b(e)||m(e)||O(e),C=e=>e===1/0||e===-1/0,P=e=>e.replace(/\\/g,"\\\\").replace(/\./g,"\\."),T=e=>e.map(String).map(P).join("."),q=(e,t)=>{let r=[],n="";for(let i=0;i<e.length;i++){let s=e.charAt(i);if(!t&&"\\"===s){let t=e.charAt(i+1);if("\\"===t){n+="\\",i++;continue}if("."!==t)throw Error("invalid path")}if("\\"===s&&"."===e.charAt(i+1)){n+=".",i++;continue}if("."===s){r.push(n),n="";continue}n+=s}let i=n;return r.push(i),r};function Q(e,t,r,n){return{isApplicable:e,annotation:t,transform:r,untransform:n}}let I=[Q(h,"undefined",()=>null,()=>void 0),Q(e=>"bigint"==typeof e,"bigint",e=>e.toString(),e=>"undefined"!=typeof BigInt?BigInt(e):(console.error("Please add a BigInt polyfill."),e)),Q(e=>e instanceof Date&&!isNaN(e.valueOf()),"Date",e=>e.toISOString(),e=>new Date(e)),Q(E,"Error",(e,t)=>{let r={name:e.name,message:e.message};return"cause"in e&&(r.cause=e.cause),t.allowedErrorProps.forEach(t=>{r[t]=e[t]}),r},(e,t)=>{let r=Error(e.message,{cause:e.cause});return r.name=e.name,r.stack=e.stack,t.allowedErrorProps.forEach(t=>{r[t]=e[t]}),r}),Q(e=>e instanceof RegExp,"regexp",e=>""+e,e=>new RegExp(e.slice(1,e.lastIndexOf("/")),e.slice(e.lastIndexOf("/")+1))),Q(w,"set",e=>[...e.values()],e=>new Set(e)),Q(v,"map",e=>[...e.entries()],e=>new Map(e)),Q(e=>R(e)||C(e),"number",e=>R(e)?"NaN":e>0?"Infinity":"-Infinity",Number),Q(e=>0===e&&1/e==-1/0,"number",()=>"-0",Number),Q(e=>e instanceof URL,"URL",e=>e.toString(),e=>new URL(e))];function D(e,t,r,n){return{isApplicable:e,annotation:t,transform:r,untransform:n}}let x=D((e,t)=>!!O(e)&&!!t.symbolRegistry.getIdentifier(e),(e,t)=>["symbol",t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,r)=>{let n=r.symbolRegistry.getValue(t[1]);if(!n)throw Error("Trying to deserialize unknown symbol");return n}),k=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),_=D(e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{let r=k[t[1]];if(!r)throw Error("Trying to deserialize unknown typed array");return new r(e)});function A(e,t){return!!e?.constructor&&!!t.classRegistry.getIdentifier(e.constructor)}let j=D(A,(e,t)=>["class",t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{let r=t.classRegistry.getAllowedProps(e.constructor);if(!r)return{...e};let n={};return r.forEach(t=>{n[t]=e[t]}),n},(e,t,r)=>{let n=r.classRegistry.getValue(t[1]);if(!n)throw Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(n.prototype),e)}),M=D((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>["custom",t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,r)=>{let n=r.customTransformerRegistry.findByName(t[1]);if(!n)throw Error("Trying to deserialize unknown custom value");return n.deserialize(e)}),N=[j,x,M,_],F=(e,t)=>{let r=u(N,r=>r.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation(e,t)};let n=u(I,r=>r.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation}},U={};I.forEach(e=>{U[e.annotation]=e});let K=(e,t,r)=>{if(y(t))switch(t[0]){case"symbol":return x.untransform(e,t,r);case"class":return j.untransform(e,t,r);case"custom":return M.untransform(e,t,r);case"typed-array":return _.untransform(e,t,r);default:throw Error("Unknown transformation: "+t)}else{let n=U[t];if(!n)throw Error("Unknown transformation: "+t);return n.untransform(e,r)}},L=(e,t)=>{if(t>e.size)throw Error("index out of bounds");let r=e.keys();for(;t>0;)r.next(),t--;return r.next().value};function V(e){if(a(e,"__proto__"))throw Error("__proto__ is not allowed as a property");if(a(e,"prototype"))throw Error("prototype is not allowed as a property");if(a(e,"constructor"))throw Error("constructor is not allowed as a property")}let z=(e,t)=>{V(t);for(let r=0;r<t.length;r++){let n=t[r];
8if(w(e))e=L(e,+n);else if(v(e)){let i=+n,s=0==+t[++r]?"key":"value",o=L(e,i);switch(s){case"key":e=o;break;case"value":e=e.get(o)}}else e=e[n]}return e},H=(e,t,r)=>{if(V(t),0===t.length)return r(e);let n=e;for(let e=0;e<t.length-1;e++){let r=t[e];if(y(n))n=n[+r];else if(d(n))n=n[r];else if(w(n))n=L(n,+r);else if(v(n)){if(e===t.length-2)break;let i=+r,s=0==+t[++e]?"key":"value",o=L(n,i);switch(s){case"key":n=o;break;case"value":n=n.get(o)}}}let i=t[t.length-1];if(y(n)?n[+i]=r(n[+i]):d(n)&&(n[i]=r(n[i])),w(n)){let e=L(n,+i),t=r(e);e!==t&&(n.delete(e),n.add(t))}if(v(n)){let e=L(n,+t[t.length-2]);switch(0==+i?"key":"value"){case"key":{let t=r(e);n.set(t,n.get(e)),t!==e&&n.delete(e);break}case"value":n.set(e,r(n.get(e)))}}return e},G=e=>e<1,B=(e,t)=>d(e)||y(e)||v(e)||w(e)||E(e)||A(e,t),$=(e,t,r,n,i=[],s=[],u=new Map)=>{let l=S(e);if(!l){!function(e,t,r){let n=r.get(e);n?n.push(t):r.set(e,[t])}(e,i,t);let r=u.get(e);if(r)return n?{transformedValue:null}:r}if(!B(e,r)){let t=F(e,r),n=t?{transformedValue:t.value,annotations:[t.type]}:{transformedValue:e};return l||u.set(e,n),n}if(a(s,e))return{transformedValue:null};let c=F(e,r),h=c?.value??e,f=y(h)?[]:{},m={};o(h,(a,l)=>{if("__proto__"===l||"constructor"===l||"prototype"===l)throw Error(`Detected property ${l}. This is a prototype pollution risk, please remove it from your object.`);let c=$(a,t,r,n,[...i,l],[...s,e],u);f[l]=c.transformedValue,y(c.annotations)?m[P(l)]=c.annotations:d(c.annotations)&&o(c.annotations,(e,t)=>{m[P(l)+"."+t]=e})});let b=p(m)?{transformedValue:f,annotations:c?[c.type]:void 0}:{transformedValue:f,annotations:c?[c.type,m]:m};return l||u.set(e,b),b};function W(e){return Object.prototype.toString.call(e).slice(8,-1)}function Z(e){return"Array"===W(e)}class Y{constructor({dedupe:e=!1}={}){this.classRegistry=new s,this.symbolRegistry=new i(e=>e.description??""),this.customTransformerRegistry=new l,this.allowedErrorProps=[],this.dedupe=e}serialize(e){let t=new Map,r=$(e,t,this,this.dedupe),n={json:r.transformedValue};r.annotations&&(n.meta={...n.meta,values:r.annotations});let i=function(e,t){let r;let n={};return(e.forEach(e=>{if(e.length<=1)return;t||(e=e.map(e=>e.map(String)).sort((e,t)=>e.length-t.length));let[i,...s]=e;0===i.length?r=s.map(T):n[T(i)]=s.map(T)}),r)?p(n)?[r]:[r,n]:p(n)?void 0:n}(t,this.dedupe);return i&&(n.meta={...n.meta,referentialEqualities:i}),n.meta&&(n.meta.v=1),n}deserialize(e,t){let{json:r,meta:n}=e,i=t?.inPlace?r:function e(t,r={}){return Z(t)?t.map(t=>e(t,r)):!function(e){if("Object"!==W(e))return!1;let t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}(t)?t:[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)].reduce((n,i)=>{if("__proto__"===i||Z(r.props)&&!r.props.includes(i))return n;let s=e(t[i],r);return!function(e,t,r,n,i){let s=({}).propertyIsEnumerable.call(n,t)?"enumerable":"nonenumerable";"enumerable"===s&&(e[t]=r),i&&"nonenumerable"===s&&Object.defineProperty(e,t,{value:r,enumerable:!1,writable:!0,configurable:!0})}(n,i,s,t,r.nonenumerable),n},{})}(r);if(n?.values){var s,a,u,l;s=i,a=n.values,u=n.v??0,l=this,function e(t,r,n,i=[]){if(!t)return;let s=G(n);if(!y(t)){o(t,(t,o)=>e(t,r,n,[...i,...q(o,s)]));return}let[a,u]=t;u&&o(u,(t,o)=>{e(t,r,n,[...i,...q(o,s)])}),r(a,i)}(a,(e,t)=>{s=H(s,t,t=>K(t,e,l))},u),i=s}return n?.referentialEqualities&&(i=function(e,t,r){let n=G(r);function i(t,r){let i=z(e,q(r,n));t.map(e=>q(e,n)).forEach(t=>{e=H(e,t,()=>i)})}if(y(t)){let[r,s]=t;r.forEach(t=>{e=H(e,q(t,n),()=>e)}),s&&o(s,i)}else o(t,i);return e}(i,n.referentialEqualities,n.v??0)),i}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e),{inPlace:!0})}registerClass(e,t){this.classRegistry.register(e,t)}registerSymbol(e,t){this.symbolRegistry.register(e,t)}registerCustom(e,t){this.customTransformerRegistry.register({name:t,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}}Y.defaultInstance=new Y,Y.serialize=Y.defaultInstance.serialize.bind(Y.defaultInstance),Y.deserialize=Y.defaultInstance.deserialize.bind(Y.defaultInstance),Y.stringify=Y.defaultInstance.stringify.bind(Y.defaultInstance),Y.parse=Y.defaultInstance.parse.bind(Y.defaultInstance),Y.registerClass=Y.defaultInstance.registerClass.bind(Y.defaultInstance),Y.registerSymbol=Y.defaultInstance.registerSymbol.bind(Y.defaultInstance),Y.registerCustom=Y.defaultInstance.registerCustom.bind(Y.defaultInstance),Y.allowErrorProps=Y.defaultInstance.allowErrorProps.bind(Y.defaultInstance);var J=Y;Y.serialize,Y.deserialize,Y.stringify,Y.parse,Y.registerClass,Y.registerCustom,Y.registerSymbol,Y.allowErrorProps}
8}]);

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.