1var e,t,n,i,o,s,l,r,a,u,d,c,h,g,p,f,m,v,b,w,y,S,C,R,M,F,P,O,x,I,E,V,_,A,D,k,G,L,q,H,z,T,Q,W,j,U,B,K,N,$,X,J,Y,Z,ee,te,ne,ie,oe,se,le,re,ae,ue,de,ce,he,ge,pe,fe,me,ve,be,we,ye,Se,Ce,Re,Me,Fe,Pe,Oe,xe,Ie,Ee,Ve,_e,Ae,De,ke,Ge,Le=e=>{throw TypeError(e)},qe=(e,t,n)=>t.has(e)||Le("Cannot "+n),He=(e,t,n)=>(qe(e,t,"read from private field"),n?n.call(e):t.get(e)),ze=(e,t,n)=>t.has(e)?Le("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Te=(e,t,n,i)=>(qe(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n),Qe=(e,t,n)=>(qe(e,t,"access private method"),n),We=(e,t,n,i)=>({set _(i){Te(e,t,i,n)},get _(){return He(e,t,i)}});!function(){try{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]="b9d0e06c-216e-47f5-8823-1922c783d068",e._sentryDebugIdIdentifier="sentry-dbid-b9d0e06c-216e-47f5-8823-1922c783d068")}catch(n){}}();import{r as je}from"./vendor-CP0q9zwG.js";import{j as Ue}from"./ui-B_psxLNs.js";var Be=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(){}},Ke="undefined"==typeof window||"Deno"in globalThis;function Ne(){}function $e(e){return"number"==typeof e&&e>=0&&e!==1/0}function Xe(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Je(e,t){return"function"==typeof e?e(t):e}function Ye(e,t){return"function"==typeof e?e(t):e}function Ze(e,t){const{type:n="all",exact:i,fetchStatus:o,predicate:s,queryKey:l,stale:r}=e;if(l)if(i){if(t.queryHash!==tt(l,t.options))return!1}else if(!it(t.queryKey,l))return!1;if("all"!==n){const e=t.isActive();if("active"===n&&!e)return!1;if("inactive"===n&&e)return!1}return("boolean"!=typeof r||t.isStale()===r)&&((!o||o===t.state.fetchStatus)&&!(s&&!s(t)))}function et(e,t){const{exact:n,status:i,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(nt(t.options.mutationKey)!==nt(s))return!1}else if(!it(t.options.mutationKey,s))return!1}return(!i||t.state.status===i)&&!(o&&!o(t))}function tt(e,t){return((null==t?void 0:t.queryKeyHashFn)||nt)(e)}function nt(e){return JSON.stringify(e,(e,t)=>rt(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function it(e,t){return e===t||typeof e==typeof t&&(!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&Object.keys(t).every(n=>it(e[n],t[n])))}function ot(e,t){if(e===t)return e;const n=lt(e)&<(t);if(n||rt(e)&&rt(t)){const i=n?e:Object.keys(e),o=i.length,s=n?t:Object.keys(t),l=s.length,r=n?[]:{};let a=0;for(let u=0;u<l;u++){const o=n?u:s[u];(!n&&i.includes(o)||n)&&void 0===e[o]&&void 0===t[o]?(r[o]=void 0,a++):(r[o]=ot(e[o],t[o]),r[o]===e[o]&&void 0!==e[o]&&a++)}return o===l&&a===o?e:r}return t}function st(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function lt(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function rt(e){if(!at(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!!at(n)&&(!!n.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype)}function at(e){return"[object Object]"===Object.prototype.toString.call(e)}function ut(e,t,n){return"function"==typeof n.structuralSharing?n.structuralSharing(e,t):!1!==n.structuralSharing?ot(e,t):t}function dt(e,t,n=0){const i=[...e,t];return n&&i.length>n?i.slice(1):i}function ct(e,t,n=0){const i=[t,...e];return n&&i.length>n?i.slice(0,-1):i}var ht=Symbol();function gt(e,t){return!e.queryFn&&(null==t?void 0:t.initialPromise)?()=>t.initialPromise:e.queryFn&&e.queryFn!==ht?e.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`))}var pt=new(i=class extends Be{constructor(){super(),ze(this,e),ze(this,t),ze(this,n),Te(this,n,e=>{if(!Ke&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}})}onSubscribe(){He(this,t)||this.setEventListener(He(this,n))}onUnsubscribe(){var e;this.hasListeners()||(null==(e=He(this,t))||e.call(this),Te(this,t,void 0))}setEventListener(e){var i;Te(this,n,e),null==(i=He(this,t))||i.call(this),Te(this,t,e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()}))}setFocused(t){He(this,e)!==t&&(Te(this,e,t),this.onFocus())}onFocus(){const e=this.isFocused();
1this.listeners.forEach(t=>{t(e)})}isFocused(){var t;return"boolean"==typeof He(this,e)?He(this,e):"hidden"!==(null==(t=globalThis.document)?void 0:t.visibilityState)}},e=new WeakMap,t=new WeakMap,n=new WeakMap,i),ft=new(r=class extends Be{constructor(){super(),ze(this,o,!0),ze(this,s),ze(this,l),Te(this,l,e=>{if(!Ke&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}})}onSubscribe(){He(this,s)||this.setEventListener(He(this,l))}onUnsubscribe(){var e;this.hasListeners()||(null==(e=He(this,s))||e.call(this),Te(this,s,void 0))}setEventListener(e){var t;Te(this,l,e),null==(t=He(this,s))||t.call(this),Te(this,s,e(this.setOnline.bind(this)))}setOnline(e){He(this,o)!==e&&(Te(this,o,e),this.listeners.forEach(t=>{t(e)}))}isOnline(){return He(this,o)}},o=new WeakMap,s=new WeakMap,l=new WeakMap,r);function mt(){let e,t;const n=new Promise((n,i)=>{e=n,t=i});function i(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.status="pending",n.catch(()=>{}),n.resolve=t=>{i({status:"fulfilled",value:t}),e(t)},n.reject=e=>{i({status:"rejected",reason:e}),t(e)},n}function vt(e){return Math.min(1e3*2**e,3e4)}function bt(e){return"online"!==(e??"online")||ft.isOnline()}var wt=class extends Error{constructor(e){super("CancelledError"),this.revert=null==e?void 0:e.revert,this.silent=null==e?void 0:e.silent}};function yt(e){return e instanceof wt}function St(e){let t,n=!1,i=0,o=!1;const s=mt(),l=()=>pt.isFocused()&&("always"===e.networkMode||ft.isOnline())&&e.canRun(),r=()=>bt(e.networkMode)&&e.canRun(),a=n=>{var i;o||(o=!0,null==(i=e.onSuccess)||i.call(e,n),null==t||t(),s.resolve(n))},u=n=>{var i;o||(o=!0,null==(i=e.onError)||i.call(e,n),null==t||t(),s.reject(n))},d=()=>new Promise(n=>{var i;t=e=>{(o||l())&&n(e)},null==(i=e.onPause)||i.call(e)}).then(()=>{var n;t=void 0,o||null==(n=e.onContinue)||n.call(e)}),c=()=>{if(o)return;let t;const s=0===i?e.initialPromise:void 0;try{t=s??e.fn()}catch(r){t=Promise.reject(r)}Promise.resolve(t).then(a).catch(t=>{var s;if(o)return;const r=e.retry??(Ke?0:3),a=e.retryDelay??vt,h="function"==typeof a?a(i,t):a,g=!0===r||"number"==typeof r&&i<r||"function"==typeof r&&r(i,t);var p;!n&&g?(i++,null==(s=e.onFail)||s.call(e,i,t),(p=h,new Promise(e=>{setTimeout(e,p)})).then(()=>l()?void 0:d()).then(()=>{n?u(t):c()})):u(t)})};return{promise:s,cancel:t=>{var n;o||(u(new wt(t)),null==(n=e.abort)||n.call(e))},continue:()=>(null==t||t(),s),cancelRetry:()=>{n=!0},continueRetry:()=>{n=!1},canStart:r,start:()=>(r()?c():d().then(c),s)}}var Ct=e=>setTimeout(e,0);var Rt=function(){let e=[],t=0,n=e=>{e()},i=e=>{e()},o=Ct;const s=i=>{t?e.push(i):o(()=>{n(i)})};return{batch:s=>{let l;t++;try{l=s()}finally{t--,t||(()=>{const t=e;e=[],t.length&&o(()=>{i(()=>{t.forEach(e=>{n(e)})})})})()}return l},batchCalls:e=>(...t)=>{s(()=>{e(...t)})},schedule:s,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{i=e},setScheduler:e=>{o=e}}}(),Mt=(u=class{constructor(){ze(this,a)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),$e(this.gcTime)&&Te(this,a,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ke?1/0:3e5))}clearGcTimeout(){He(this,a)&&(clearTimeout(He(this,a)),Te(this,a,void 0))}},a=new WeakMap,u),Ft=(w=class extends Mt{constructor(e){super(),ze(this,v),ze(this,d),ze(this,c),ze(this,h),ze(this,g),ze(this,p),ze(this,f),ze(this,m),Te(this,m,!1),Te(this,f,e.defaultOptions),this.setOptions(e.options),this.observers=[],Te(this,g,e.client),Te(this,h,He(this,g).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Te(this,d,function(e){const t="function"==typeof e.initialData?e.initialData():e.initialData,n=void 0!==t,i=n?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}(this.options)),this.state=e.state??He(this,d),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return null==(e=He(this,p))?void 0:e.promise}setOptions(e){this.options={...He(this,f),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||He(this,h).remove(this)}setData(e,t){const n=ut(this.state.data,e,this.options);return Qe(this,v,b).call(this,{data:n,type:"success",dataUpdatedAt:null==t?void 0:t.updatedAt,manual:null==t?void 0:t.manual}),n}setState(e,t){Qe(this,v,b).call(this,{type:"setState",state:e,setStateOptions:t})}cancel(e){var t,n;const i=null==(t=He(this,p))?void 0:t.promise;return null==(n=He(this,p))||n.cancel(e),i?i.then(Ne).catch(Ne):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(He(this,d))}isActive(){return this.observers.some(e=>!1!==Ye(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ht||this.state.dataUpdateCount+this.state.errorUpdate
1Count===0}isStale(){return!!this.state.isInvalidated||(this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data)}isStaleByTime(e=0){return this.state.isInvalidated||void 0===this.state.data||!Xe(this.state.dataUpdatedAt,e)}onFocus(){var e;const t=this.observers.find(e=>e.shouldFetchOnWindowFocus());null==t||t.refetch({cancelRefetch:!1}),null==(e=He(this,p))||e.continue()}onOnline(){var e;const t=this.observers.find(e=>e.shouldFetchOnReconnect());null==t||t.refetch({cancelRefetch:!1}),null==(e=He(this,p))||e.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),He(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||(He(this,p)&&(He(this,m)?He(this,p).cancel({revert:!0}):He(this,p).cancelRetry()),this.scheduleGc()),He(this,h).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Qe(this,v,b).call(this,{type:"invalidate"})}fetch(e,t){var n,i,o;if("idle"!==this.state.fetchStatus)if(void 0!==this.state.data&&(null==t?void 0:t.cancelRefetch))this.cancel({silent:!0});else if(He(this,p))return He(this,p).continueRetry(),He(this,p).promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}const s=new AbortController,l=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(Te(this,m,!0),s.signal)})},r={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:He(this,g),state:this.state,fetchFn:()=>{const e=gt(this.options,t),n={client:He(this,g),queryKey:this.queryKey,meta:this.meta};return l(n),Te(this,m,!1),this.options.persister?this.options.persister(e,n,this):e(n)}};l(r),null==(n=this.options.behavior)||n.onFetch(r,this),Te(this,c,this.state),"idle"!==this.state.fetchStatus&&this.state.fetchMeta===(null==(i=r.fetchOptions)?void 0:i.meta)||Qe(this,v,b).call(this,{type:"fetch",meta:null==(o=r.fetchOptions)?void 0:o.meta});const a=e=>{var t,n,i,o;yt(e)&&e.silent||Qe(this,v,b).call(this,{type:"error",error:e}),yt(e)||(null==(n=(t=He(this,h).config).onError)||n.call(t,e,this),null==(o=(i=He(this,h).config).onSettled)||o.call(i,this.state.data,e,this)),this.scheduleGc()};return Te(this,p,St({initialPromise:null==t?void 0:t.initialPromise,fn:r.fetchFn,abort:s.abort.bind(s),onSuccess:e=>{var t,n,i,o;if(void 0!==e){try{this.setData(e)}catch(s){return void a(s)}null==(n=(t=He(this,h).config).onSuccess)||n.call(t,e,this),null==(o=(i=He(this,h).config).onSettled)||o.call(i,e,this.state.error,this),this.scheduleGc()}else a(new Error(`${this.queryHash} data is undefined`))},onError:a,onFail:(e,t)=>{Qe(this,v,b).call(this,{type:"failed",failureCount:e,error:t})},onPause:()=>{Qe(this,v,b).call(this,{type:"pause"})},onContinue:()=>{Qe(this,v,b).call(this,{type:"continue"})},retry:r.options.retry,retryDelay:r.options.retryDelay,networkMode:r.options.networkMode,canRun:()=>!0})),He(this,p).start()}},d=new WeakMap,c=new WeakMap,h=new WeakMap,g=new WeakMap,p=new WeakMap,f=new WeakMap,m=new WeakMap,v=new WeakSet,b=function(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,...Pt(t.data,this.options),fetchMeta:e.meta??null};case"success":return{...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const n=e.error;return yt(n)&&n.revert&&He(this,c)?{...He(this,c),fetchStatus:"idle"}:{...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),Rt.batch(()=>
1{this.observers.forEach(e=>{e.onQueryUpdate()}),He(this,h).notify({query:this,type:"updated",action:e})})},w);function Pt(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:bt(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}var Ot=(S=class extends Be{constructor(e={}){super(),ze(this,y),this.config=e,Te(this,y,new Map)}build(e,t,n){const i=t.queryKey,o=t.queryHash??tt(i,t);let s=this.get(o);return s||(s=new Ft({client:e,queryKey:i,queryHash:o,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(i)}),this.add(s)),s}add(e){He(this,y).has(e.queryHash)||(He(this,y).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=He(this,y).get(e.queryHash);t&&(e.destroy(),t===e&&He(this,y).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Rt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return He(this,y).get(e)}getAll(){return[...He(this,y).values()]}find(e){const t={exact:!0,...e};return this.getAll().find(e=>Ze(t,e))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Ze(e,t)):t}notify(e){Rt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Rt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Rt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},y=new WeakMap,S),xt=(O=class extends Mt{constructor(e){super(),ze(this,F),ze(this,C),ze(this,R),ze(this,M),this.mutationId=e.mutationId,Te(this,R,e.mutationCache),Te(this,C,[]),this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){He(this,C).includes(e)||(He(this,C).push(e),this.clearGcTimeout(),He(this,R).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Te(this,C,He(this,C).filter(t=>t!==e)),this.scheduleGc(),He(this,R).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){He(this,C).length||("pending"===this.state.status?this.scheduleGc():He(this,R).remove(this))}continue(){var e;return(null==(e=He(this,M))?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var t,n,i,o,s,l,r,a,u,d,c,h,g,p,f,m,v,b,w,y;const S=()=>{Qe(this,F,P).call(this,{type:"continue"})};Te(this,M,St({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(e,t)=>{Qe(this,F,P).call(this,{type:"failed",failureCount:e,error:t})},onPause:()=>{Qe(this,F,P).call(this,{type:"pause"})},onContinue:S,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>He(this,R).canRun(this)}));const C="pending"===this.state.status,O=!He(this,M).canStart();try{if(C)S();else{Qe(this,F,P).call(this,{type:"pending",variables:e,isPaused:O}),await(null==(n=(t=He(this,R).config).onMutate)?void 0:n.call(t,e,this));const s=await(null==(o=(i=this.options).onMutate)?void 0:o.call(i,e));s!==this.state.context&&Qe(this,F,P).call(this,{type:"pending",context:s,variables:e,isPaused:O})}const g=await He(this,M).start();return await(null==(l=(s=He(this,R).config).onSuccess)?void 0:l.call(s,g,e,this.state.context,this)),await(null==(a=(r=this.options).onSuccess)?void 0:a.call(r,g,e,this.state.context)),await(null==(d=(u=He(this,R).config).onSettled)?void 0:d.call(u,g,null,this.state.variables,this.state.context,this)),await(null==(h=(c=this.options).onSettled)?void 0:h.call(c,g,null,e,this.state.context)),Qe(this,F,P).call(this,{type:"success",data:g}),g}catch(x){try{throw await(null==(p=(g=He(this,R).config).onError)?void 0:p.call(g,x,e,this.state.context,this)),await(null==(m=(f=this.options).onError)?void 0:m.call(f,x,e,this.state.context)),await(null==(b=(v=He(this,R).config).onSettled)?void 0:b.call(v,void 0,x,this.state.variables,this.state.context,this)),await(null==(y=(w=this.options).onSettled)?void 0:y.call(w,void 0,x,e,this.state.context)),x}finally{Qe(this,F,P).call(this,{type:"error",error:x})}}finally{He(this,R).runNext(this)}}},C=new WeakMap,R=new WeakMap,M=new WeakMap,F=new WeakSet,P=function(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};
1case"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),Rt.batch(()=>{He(this,C).forEach(t=>{t.onMutationUpdate(e)}),He(this,R).notify({mutation:this,type:"updated",action:e})})},O);var It=(V=class extends Be{constructor(e={}){super(),ze(this,x),ze(this,I),ze(this,E),this.config=e,Te(this,x,new Set),Te(this,I,new Map),Te(this,E,0)}build(e,t,n){const i=new xt({mutationCache:this,mutationId:++We(this,E)._,options:e.defaultMutationOptions(t),state:n});return this.add(i),i}add(e){He(this,x).add(e);const t=Et(e);if("string"==typeof t){const n=He(this,I).get(t);n?n.push(e):He(this,I).set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(He(this,x).delete(e)){const t=Et(e);if("string"==typeof t){const n=He(this,I).get(t);if(n)if(n.length>1){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}else n[0]===e&&He(this,I).delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Et(e);if("string"==typeof t){const n=He(this,I).get(t),i=null==n?void 0:n.find(e=>"pending"===e.state.status);return!i||i===e}return!0}runNext(e){var t;const n=Et(e);if("string"==typeof n){const i=null==(t=He(this,I).get(n))?void 0:t.find(t=>
1t!==e&&t.state.isPaused);return(null==i?void 0:i.continue())??Promise.resolve()}return Promise.resolve()}clear(){Rt.batch(()=>{He(this,x).forEach(e=>{this.notify({type:"removed",mutation:e})}),He(this,x).clear(),He(this,I).clear()})}getAll(){return Array.from(He(this,x))}find(e){const t={exact:!0,...e};return this.getAll().find(e=>et(t,e))}findAll(e={}){return this.getAll().filter(t=>et(e,t))}notify(e){Rt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(e=>e.state.isPaused);return Rt.batch(()=>Promise.all(e.map(e=>e.continue().catch(Ne))))}},x=new WeakMap,I=new WeakMap,E=new WeakMap,V);function Et(e){var t;return null==(t=e.options.scope)?void 0:t.id}function Vt(e){return{onFetch:(t,n)=>{var i,o,s,l,r;const a=t.options,u=null==(s=null==(o=null==(i=t.fetchOptions)?void 0:i.meta)?void 0:o.fetchMore)?void 0:s.direction,d=(null==(l=t.state.data)?void 0:l.pages)||[],c=(null==(r=t.state.data)?void 0:r.pageParams)||[];let h={pages:[],pageParams:[]},g=0;const p=async()=>{let n=!1;const i=gt(t.options,t.fetchOptions),o=async(e,o,s)=>{if(n)return Promise.reject();if(null==o&&e.pages.length)return Promise.resolve(e);const l={client:t.client,queryKey:t.queryKey,pageParam:o,direction:s?"backward":"forward",meta:t.options.meta};var r;r=l,Object.defineProperty(r,"signal",{enumerable:!0,get:()=>(t.signal.aborted?n=!0:t.signal.addEventListener("abort",()=>{n=!0}),t.signal)});const a=await i(l),{maxPages:u}=t.options,d=s?ct:dt;return{pages:d(e.pages,a,u),pageParams:d(e.pageParams,o,u)}};if(u&&d.length){const e="backward"===u,t={pages:d,pageParams:c},n=(e?At:_t)(a,t);h=await o(t,n,e)}else{const t=e??d.length;do{const e=0===g?c[0]??a.initialPageParam:_t(a,h);if(g>0&&null==e)break;h=await o(h,e),g++}while(g<t)}return h};t.options.persister?t.fetchFn=()=>{var e,i;return null==(i=(e=t.options).persister)?void 0:i.call(e,p,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=p}}}function _t(e,{pages:t,pageParams:n}){const i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,n[i],n):void 0}function At(e,{pages:t,pageParams:n}){var i;return t.length>0?null==(i=e.getPreviousPageParam)?void 0:i.call(e,t[0],t,n[0],n):void 0}var Dt=(z=class{constructor(e={}){ze(this,_),ze(this,A),ze(this,D),ze(this,k),ze(this,G),ze(this,L),ze(this,q),ze(this,H),Te(this,_,e.queryCache||new Ot),Te(this,A,e.mutationCache||new It),Te(this,D,e.defaultOptions||{}),Te(this,k,new Map),Te(this,G,new Map),Te(this,L,0)}
1mount(){We(this,L)._++,1===He(this,L)&&(Te(this,q,pt.subscribe(async e=>{e&&(await this.resumePausedMutations(),He(this,_).onFocus())})),Te(this,H,ft.subscribe(async e=>{e&&(await this.resumePausedMutations(),He(this,_).onOnline())})))}unmount(){var e,t;We(this,L)._--,0===He(this,L)&&(null==(e=He(this,q))||e.call(this),Te(this,q,void 0),null==(t=He(this,H))||t.call(this),Te(this,H,void 0))}isFetching(e){return He(this,_).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return He(this,A).findAll({...e,status:"pending"}).length}getQueryData(e){var t;const n=this.defaultQueryOptions({queryKey:e});return null==(t=He(this,_).get(n.queryHash))?void 0:t.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=He(this,_).build(this,t),i=n.state.data;return void 0===i?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Je(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return He(this,_).findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){const i=this.defaultQueryOptions({queryKey:e}),o=He(this,_).get(i.queryHash),s=function(e,t){return"function"==typeof e?e(t):e}(t,null==o?void 0:o.state.data);if(void 0!==s)return He(this,_).build(this,i).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return Rt.batch(()=>He(this,_).findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){var t;const n=this.defaultQueryOptions({queryKey:e});return null==(t=He(this,_).get(n.queryHash))?void 0:t.state}removeQueries(e){const t=He(this,_);Rt.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){const n=He(this,_);return Rt.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},i=Rt.batch(()=>He(this,_).findAll(e).map(e=>e.cancel(n)));return Promise.all(i).then(Ne).catch(Ne)}invalidateQueries(e,t={}){return Rt.batch(()=>(He(this,_).findAll(e).forEach(e=>{e.invalidate()}),"none"===(null==e?void 0:e.refetchType)?Promise.resolve():this.refetchQueries({...e,type:(null==e?void 0:e.refetchType)??(null==e?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},i=Rt.batch(()=>He(this,_).findAll(e).filter(e=>!e.isDisabled()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(Ne)),"paused"===e.state.fetchStatus?Promise.resolve():t}));return Promise.all(i).then(Ne)}fetchQuery(e){const t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);const n=He(this,_).build(this,t);return n.isStaleByTime(Je(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ne).catch(Ne)}fetchInfiniteQuery(e){return e.behavior=Vt(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ne).catch(Ne)}ensureInfiniteQueryData(e){return e.behavior=Vt(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ft.isOnline()?He(this,A).resumePausedMutations():Promise.resolve()}getQueryCache(){return He(this,_)}getMutationCache(){return He(this,A)}getDefaultOptions(){return He(this,D)}setDefaultOptions(e){Te(this,D,e)}setQueryDefaults(e,t){He(this,k).set(nt(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...He(this,k).values()],n={};return t.forEach(t=>{it(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){He(this,G).set(nt(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...He(this,G).values()],n={};return t.forEach(t=>{it(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...He(this,D).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=tt(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===ht&&(t.enabled=!1),t}defaultMutationOptions(e){return(null==e?void 0:e._defaulted)?e:{...He(this,D).mutations,...(null==e?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){He(this,_).clear(),He(this,A).clear()}},_=new WeakMap,A=new WeakMap,D=new WeakMap,k=new WeakMap,G=new WeakMap,L=new WeakMap,q=new WeakMap,H=new WeakMap,z),kt=(he=class extends Be{constructor(e,t){super(),ze(this,ne),ze(this,T),ze(this,Q),ze(this,W),ze(this,j),ze(this,U),ze(this,B),ze(this,K),ze(this,N),ze(this,$),ze(this,X),ze(this,J),ze(this,Y),ze(this,Z),ze(this,ee),ze(this,te,new Set),this.options=t,Te(this,T,e),Te(this,N,null),Te(this,K,mt()),this.options.experimental_prefetchInRender||He(this,K).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(He(this,Q).addObserver(this),Gt(He(this,Q),this.options)?Qe(this,ne,ie).call(this):this.updateResult(),Qe(this,ne,re).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Lt(He(this,Q),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Lt(He(this,Q),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Qe(this,ne,ae).call(this),Qe(this,ne,ue).call(this),He(this,Q).removeObserver(this)}setOptions(e){const t=this.options,n=He(this,Q);if(this.options=He(this,T).defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof Ye(this.options.enabled,He(this,Q)))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Qe(this,ne,de).call(this),He(this,Q).setOptions(this.options),t._defaulted&&!st(this.options,t)&&He(this,T).getQueryCache().notify({type:"observerOptionsUpdated",query:He(this,Q),observer:this});const i=this.hasListeners();i&&qt(He(this,Q),n,this.options,t)&&Qe(this,ne,ie).call(this),this.updateResult(),!i||He(this,Q)===n&&Ye(this.options.enabled,He(this,Q))===Ye(t.enabled,He(this,Q))&&Je(this.options.staleTime,He(this,Q))===Je(t.staleTime,He(this,Q))||Qe(this,ne,oe).call(this);const o=Qe(this,ne,se).call(this);!i||He(this,Q)===n&&Ye(this.options.enabled,He(this,Q))===Ye(t.enabled,He(this,Q))&&o===He(this,ee)||Qe(this,ne,le).call(this,o)}getOptimisticResult(e){const t=He(this,T).getQueryCache().build(He(this,T),e),n=this.createResult(t,e);return function(e,t){if(!st(e.getCurrentResult(),t))return!0;return!1}(this,n)&&(Te(this,j,n),Te(this,B,this.options),Te(this,U,He(this,Q).state)),n}getCurrentResult(){return He(this,j)}trackResult(e,t){const n={};return Object.keys(e).forEach(i=>
1{Object.defineProperty(n,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),null==t||t(i),e[i])})}),n}trackProp(e){He(this,te).add(e)}getCurrentQuery(){return He(this,Q)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=He(this,T).defaultQueryOptions(e),n=He(this,T).getQueryCache().build(He(this,T),t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return Qe(this,ne,ie).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),He(this,j)))}createResult(e,t){var n;const i=He(this,Q),o=this.options,s=He(this,j),l=He(this,U),r=He(this,B),a=e!==i?e.state:He(this,W),{state:u}=e;let d,c={...u},h=!1;if(t._optimisticResults){const n=this.hasListeners(),s=!n&&Gt(e,t),l=n&&qt(e,i,t,o);(s||l)&&(c={...c,...Pt(u.data,e.options)}),"isRestoring"===t._optimisticResults&&(c.fetchStatus="idle")}let{error:g,errorUpdatedAt:p,status:f}=c;d=c.data;let m=!1;if(void 0!==t.placeholderData&&void 0===d&&"pending"===f){let e;(null==s?void 0:s.isPlaceholderData)&&t.placeholderData===(null==r?void 0:r.placeholderData)?(e=s.data,m=!0):e="function"==typeof t.placeholderData?t.placeholderData(null==(n=He(this,J))?void 0:n.state.data,He(this,J)):t.placeholderData,void 0!==e&&(f="success",d=ut(null==s?void 0:s.data,e,t),h=!0)}if(t.select&&void 0!==d&&!m)if(s&&d===(null==l?void 0:l.data)&&t.select===He(this,$))d=He(this,X);else try{Te(this,$,t.select),d=t.select(d),d=ut(null==s?void 0:s.data,d,t),Te(this,X,d),Te(this,N,null)}catch(R){Te(this,N,R)}He(this,N)&&(g=He(this,N),d=He(this,X),p=Date.now(),f="error");const v="fetching"===c.fetchStatus,b="pending"===f,w="error"===f,y=b&&v,S=void 0!==d,C={status:f,fetchStatus:c.fetchStatus,isPending:b,isSuccess:"success"===f,isError:w,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:c.dataUpdatedAt,error:g,errorUpdatedAt:p,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>a.dataUpdateCount||c.errorUpdateCount>a.errorUpdateCount,isFetching:v,isRefetching:v&&!b,isLoadingError:w&&!S,isPaused:"paused"===c.fetchStatus,isPlaceholderData:h,isRefetchError:w&&S,isStale:Ht(e,t),refetch:this.refetch,promise:He(this,K)};if(this.options.experimental_prefetchInRender){const t=e=>{"error"===C.status?e.reject(C.error):void 0!==C.data&&e.resolve(C.data)},n=()=>{const e=Te(this,K,C.promise=mt());t(e)},o=He(this,K);switch(o.status){case"pending":e.queryHash===i.queryHash&&t(o);break;case"fulfilled":"error"!==C.status&&C.data===o.value||n();break;case"rejected":"error"===C.status&&C.error===o.reason||n()}}return C}updateResult(){const e=He(this,j),t=this.createResult(He(this,Q),this.options);if(Te(this,U,He(this,Q).state),Te(this,B,this.options),void 0!==He(this,U).data&&Te(this,J,He(this,Q)),st(t,e))return;Te(this,j,t);Qe(this,ne,ce).call(this,{listeners:(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,n="function"==typeof t?t():t;if("all"===n||!n&&!He(this,te).size)return!0;const i=new Set(n??He(this,te));return this.options.throwOnError&&i.add("error"),Object.keys(He(this,j)).some(t=>{const n=t;return He(this,j)[n]!==e[n]&&i.has(n)})})()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Qe(this,ne,re).call(this)}},T=new WeakMap,Q=new WeakMap,W=new WeakMap,j=new WeakMap,U=new WeakMap,B=new WeakMap,K=new WeakMap,N=new WeakMap,$=new WeakMap,X=new WeakMap,J=new WeakMap,Y=new WeakMap,Z=new WeakMap,ee=new WeakMap,te=new WeakMap,ne=new WeakSet,ie=function(e){Qe(this,ne,de).call(this);let t=He(this,Q).fetch(this.options,e);return(null==e?void 0:e.throwOnError)||(t=t.catch(Ne)),t},oe=function(){Qe(this,ne,ae).call(this);const e=Je(this.options.staleTime,He(this,Q));if(Ke||He(this,j).isStale||!$e(e))return;const t=Xe(He(this,j).dataUpdatedAt,e);Te(this,Y,setTimeout(()=>{He(this,j).isStale||this.updateResult()},t+1))},se=function(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(He(this,Q)):this.options.refetchInterval)??!1},le=function(e){Qe(this,ne,ue).call(this),Te(this,ee,e),!Ke&&!1!==Ye(this.options.enabled,He(this,Q))&&$e(He(this,ee))&&0!==He(this,ee)&&Te(this,Z,setInterval(()=>
1{(this.options.refetchIntervalInBackground||pt.isFocused())&&Qe(this,ne,ie).call(this)},He(this,ee)))},re=function(){Qe(this,ne,oe).call(this),Qe(this,ne,le).call(this,Qe(this,ne,se).call(this))},ae=function(){He(this,Y)&&(clearTimeout(He(this,Y)),Te(this,Y,void 0))},ue=function(){He(this,Z)&&(clearInterval(He(this,Z)),Te(this,Z,void 0))},de=function(){const e=He(this,T).getQueryCache().build(He(this,T),this.options);if(e===He(this,Q))return;const t=He(this,Q);Te(this,Q,e),Te(this,W,e.state),this.hasListeners()&&(null==t||t.removeObserver(this),e.addObserver(this))},ce=function(e){Rt.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(He(this,j))}),He(this,T).getQueryCache().notify({query:He(this,Q),type:"observerResultsUpdated"})})},he);function Gt(e,t){return function(e,t){return!1!==Ye(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)}(e,t)||void 0!==e.state.data&&Lt(e,t,t.refetchOnMount)}function Lt(e,t,n){if(!1!==Ye(t.enabled,e)){const i="function"==typeof n?n(e):n;return"always"===i||!1!==i&&Ht(e,t)}return!1}function qt(e,t,n,i){return(e!==t||!1===Ye(i.enabled,e))&&(!n.suspense||"error"!==e.state.status)&&Ht(e,n)}function Ht(e,t){return!1!==Ye(t.enabled,e)&&e.isStaleByTime(Je(t.staleTime,e))}function zt(e,t){return e.filter(e=>!t.includes(e))}var Tt=(xe=class extends Be{constructor(e,t,n){super(),ze(this,Ce),ze(this,ge),ze(this,pe),ze(this,fe),ze(this,me),ze(this,ve),ze(this,be),ze(this,we),ze(this,ye),ze(this,Se,[]),Te(this,ge,e),Te(this,me,n),Te(this,fe,[]),Te(this,ve,[]),Te(this,pe,[]),this.setQueries(t)}onSubscribe(){1===this.listeners.size&&He(this,ve).forEach(e=>{e.subscribe(t=>{Qe(this,Ce,Pe).call(this,e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,He(this,ve).forEach(e=>{e.destroy()})}setQueries(e,t){Te(this,fe,e),Te(this,me,t),Rt.batch(()=>{const e=He(this,ve),t=Qe(this,Ce,Fe).call(this,He(this,fe));Te(this,Se,t),t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));const n=t.map(e=>e.observer),i=n.map(e=>e.getCurrentResult()),o=n.some((t,n)=>t!==e[n]);(e.length!==n.length||o)&&(Te(this,ve,n),Te(this,pe,i),this.hasListeners()&&(zt(e,n).forEach(e=>{e.destroy()}),zt(n,e).forEach(e=>{e.subscribe(t=>{Qe(this,Ce,Pe).call(this,e,t)})}),Qe(this,Ce,Oe).call(this)))})}getCurrentResult(){return He(this,pe)}getQueries(){return He(this,ve).map(e=>e.getCurrentQuery())}getObservers(){return He(this,ve)}getOptimisticResult(e,t){const n=Qe(this,Ce,Fe).call(this,e),i=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions));return[i,e=>Qe(this,Ce,Me).call(this,e??i,t),()=>Qe(this,Ce,Re).call(this,i,n)]}},ge=new WeakMap,pe=new WeakMap,fe=new WeakMap,me=new WeakMap,ve=new WeakMap,be=new WeakMap,we=new WeakMap,ye=new WeakMap,Se=new WeakMap,Ce=new WeakSet,Re=function(e,t){return t.map((n,i)=>{const o=e[i];return n.defaultedQueryOptions.notifyOnChangeProps?o:n.observer.trackResult(o,e=>{t.forEach(t=>{t.observer.trackProp(e)})})})},Me=function(e,t){return t?(He(this,be)&&He(this,pe)===He(this,ye)&&t===He(this,we)||(Te(this,we,t),Te(this,ye,He(this,pe)),Te(this,be,ot(He(this,be),t(e)))),He(this,be)):e},Fe=function(e){const t=new Map(He(this,ve).map(e=>[e.options.queryHash,e])),n=[];return e.forEach(e=>{const i=He(this,ge).defaultQueryOptions(e),o=t.get(i.queryHash);o?n.push({defaultedQueryOptions:i,observer:o}):n.push({defaultedQueryOptions:i,observer:new kt(He(this,ge),i)})}),n},Pe=function(e,t){const n=He(this,ve).indexOf(e);-1!==n&&(Te(this,pe,function(e,t,n){const i=e.slice(0);return i[t]=n,i}(He(this,pe),n,t)),Qe(this,Ce,Oe).call(this))},Oe=function(){var e;if(this.hasListeners()){const t=He(this,be),n=Qe(this,Ce,Re).call(this,He(this,pe),He(this,Se));t!==Qe(this,Ce,Me).call(this,n,null==(e=He(this,me))?void 0:e.combine)&&Rt.batch(()=>{this.listeners.forEach(e=>{e(He(this,pe))})})}},xe),Qt=(Ge=class extends Be{constructor(e,t){super(),ze(this,Ae),ze(this,Ie),ze(this,Ee),ze(this,Ve),ze(this,_e),Te(this,Ie,e),this.setOptions(t),this.bindMethods(),Qe(this,Ae,De).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var t;const n=this.options;this.options=He(this,Ie).defaultMutationOptions(e),st(this.options,n)||He(this,Ie).getMutationCache().notify({type:"observerOptionsUpdated",mutation:He(this,Ve),observer:this}),(null==n?void 0:n.mutationKey)&&this.options.mutationKey&&nt(n.mutationKey)!==nt(this.options.mutationKey)?this.reset():"pending"===(null==(t=He(this,Ve))?void 0:t.state.status)&&He(this,Ve).setOptions(this.options)}onUnsubscribe(){var e;this.hasListeners()||null==(e=He(this,Ve))||e.removeObserver(this)}onMutationUpdate(e){Qe(this,Ae,De).call(this),Qe(this,Ae,ke).call(this,e)}getCurrentResult(){return He(this,Ee)}reset(){var e;null==(e=He(this,Ve))||e.removeObserver(this),Te(this,Ve,void 0),Qe(this,Ae,De).call(this),Qe(this,Ae,ke).call(this)}mutate(e,t){var n;return Te(this,_e,t),null==(n=He(this,Ve))||n.removeObserver(this),Te(this,Ve,He(this,Ie).getMutationCache().build(He(this,Ie),this.options)),He(this,Ve).addObserver(this),He(this,Ve).execute(e)}},Ie=new WeakMap,Ee=new WeakMap,Ve=new WeakMap,_e=new WeakMap,Ae=new WeakSet,De=function(){var e;const t=(null==(e=He(this,Ve))?void 0:e.state)??{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0};Te(this,Ee,{...t,isPending:"pending"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset})},ke=function(e){Rt.batch(()=>{var t,n,i,o,s,l,r,a;if(He(this,_e)&&this.hasListeners()){const u=He(this,Ee).variables,d=He(this,Ee).context;"success"===(null==e?void 0:e.type)?(null==(n=(t=He(this,_e)).onSuccess)||n.call(t,e.data,u,d),null==(o=(i=He(this,_e)).onSettled)||o.call(i,e.data,null,u,d)):"error"===(null==e?void 0:e.type)&&(null==(l=(s=He(this,_e)).onError)||l.call(s,e.error,u,d),null==(a=(r=He(this,_e)).onSettled)||a.call(r,void 0,e.error,u,d))}
1this.listeners.forEach(e=>{e(He(this,Ee))})})},Ge),Wt=je.createContext(void 0),jt=e=>{const t=je.useContext(Wt);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Ut=({client:e,children:t})=>(je.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),Ue.jsx(Wt.Provider,{value:e,children:t})),Bt=je.createContext(!1),Kt=()=>je.useContext(Bt);Bt.Provider;var Nt=je.createContext(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),$t=()=>je.useContext(Nt);function Xt(e,t){return"function"==typeof e?e(...t):!!e}function Jt(){}var Yt=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Zt=e=>{je.useEffect(()=>{e.clearReset()},[e])},en=({result:e,errorResetBoundary:t,throwOnError:n,query:i,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(o&&void 0===e.data||Xt(n,[e.error,i])),tn=e=>{const t=e.staleTime;e.suspense&&(e.staleTime="function"==typeof t?(...e)=>Math.max(t(...e),1e3):Math.max(t??1e3,1e3),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,1e3)))},nn=(e,t)=>e.isLoading&&e.isFetching&&!t,on=(e,t)=>(null==e?void 0:e.suspense)&&t.isPending,sn=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function ln({queries:e,...t},n){const i=jt(),o=Kt(),s=$t(),l=je.useMemo(()=>e.map(e=>{const t=i.defaultQueryOptions(e);return t._optimisticResults=o?"isRestoring":"optimistic",t}),[e,i,o]);l.forEach(e=>{tn(e),Yt(e,s)}),Zt(s);const[r]=je.useState(()=>new Tt(i,l,t)),[a,u,d]=r.getOptimisticResult(l,t.combine),c=!o&&!1!==t.subscribed;je.useSyncExternalStore(je.useCallback(e=>c?r.subscribe(Rt.batchCalls(e)):Jt,[r,c]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),je.useEffect(()=>{r.setQueries(l,t)},[l,t,r]);const h=a.some((e,t)=>on(l[t],e))?a.flatMap((e,t)=>{const n=l[t];if(n){const t=new kt(i,n);if(on(n,e))return sn(n,t,s);nn(e,o)&&sn(n,t,s)}return[]}):[];if(h.length>0)throw Promise.all(h);const g=a.find((e,t)=>{const n=l[t];return n&&en({result:e,errorResetBoundary:s,throwOnError:n.throwOnError,query:i.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(null==g?void 0:g.error)throw g.error;return u(d())}function rn(e,t){return function(e,t){var n,i,o,s,l;const r=jt(),a=Kt(),u=$t(),d=r.defaultQueryOptions(e);
1null==(i=null==(n=r.getDefaultOptions().queries)?void 0:n._experimental_beforeQuery)||i.call(n,d),d._optimisticResults=a?"isRestoring":"optimistic",tn(d),Yt(d,u),Zt(u);const c=!r.getQueryCache().get(d.queryHash),[h]=je.useState(()=>new t(r,d)),g=h.getOptimisticResult(d),p=!a&&!1!==e.subscribed;if(je.useSyncExternalStore(je.useCallback(e=>{const t=p?h.subscribe(Rt.batchCalls(e)):Jt;return h.updateResult(),t},[h,p]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),je.useEffect(()=>{h.setOptions(d)},[d,h]),on(d,g))throw sn(d,h,u);if(en({result:g,errorResetBoundary:u,throwOnError:d.throwOnError,query:r.getQueryCache().get(d.queryHash),suspense:d.suspense}))throw g.error;if(null==(s=null==(o=r.getDefaultOptions().queries)?void 0:o._experimental_afterQuery)||s.call(o,d,g),d.experimental_prefetchInRender&&!Ke&&nn(g,a)){const e=c?sn(d,h,u):null==(l=r.getQueryCache().get(d.queryHash))?void 0:l.promise;null==e||e.catch(Jt).finally(()=>{h.updateResult()})}return d.notifyOnChangeProps?g:h.trackResult(g)}(e,kt)}function an(e,t){const n=jt(),[i]=je.useState(()=>new Qt(n,e));je.useEffect(()=>{i.setOptions(e)},[i,e]);const o=je.useSyncExternalStore(je.useCallback(e=>i.subscribe(Rt.batchCalls(e)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),s=je.useCallback((e,t)=>{i.mutate(e,t).catch(Jt)},[i]);if(o.error&&Xt(i.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}} 2/** 3 * table-core 4 * 5 * Copyright (c) TanStack 6 * 7 * This source code is licensed under the MIT license found in the 8 * LICENSE.md file in the root directory of this source tree. 9 * 10 * @license MIT 11 */function un(){return{accessor:(e,t)=>"function"==typeof e?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}}function dn(e,t){return"function"==typeof e?e(t):e}function cn(e,t){return n=>{t.setState(t=>({...t,[e]:dn(n,t[e])}))}}function hn(e){return e instanceof Function}function gn(e,t,n){let i,o=[];return s=>{let l;n.key&&n.debug&&(l=Date.now());const r=e(s);if(!(r.length!==o.length||r.some((e,t)=>o[t]!==e)))return i;let a;if(o=r,n.key&&n.debug&&(a=Date.now()),i=t(...r),null==n||null==n.onChange||n.onChange(i),n.key&&n.debug&&null!=n&&n.debug()){const e=Math.round(100*(Date.now()-l))/100,t=Math.round(100*(Date.now()-a))/100,i=t/16,o=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%câ± ${o(t,5)} /${o(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*i,120))}deg 100% 31%);`,null==n?void 0:n.key)}return i}}function pn(e,t,n,i){return{debug:()=>{var n;return null!=(n=null==e?void 0:e.debugAll)?n:e[t]},key:!1,onChange:i}}const fn="debugHeaders";function mn(e,t,n){var i;let o={id:null!=(i=n.id)?i:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const e=[],t=n=>{n.subHeaders&&n.subHeaders.length&&n.subHeaders.map(t),e.push(n)};return t(o),e},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(t=>{null==t.createHeader||t.createHeader(o,e)}),o}const vn={createTable:e=>{e.getHeaderGroups=gn(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,i,o)=>{var s,l;const r=null!=(s=null==i?void 0:i.map(e=>n.find(t=>t.id===e)).filter(Boolean))?s:[],a=null!=(l=null==o?void 0:o.map(e=>n.find(t=>t.id===e)).filter(Boolean))?l:[];return bn(t,[...r,...n.filter(e=>!(null!=i&&i.includes(e.id)||null!=o&&o.includes(e.id))),...a],e)},pn(e.options,fn)),e.getCenterHeaderGroups=gn(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,i,o)=>bn(t,n=n.filter(e=>!(null!=i&&i.includes(e.id)||null!=o&&o.includes(e.id))),e,"center"),pn(e.options,fn)),e.getLeftHeaderGroups=gn(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,i)=>{var o;return bn(t,null!=(o=null==i?void 0:i.map(e=>n.find(t=>t.id===e)).filter(Boolean))?o:[],e,"left")},pn(e.options,fn)),e.getRightHeaderGroups=gn(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,i)=>{var o;return bn(t,null!=(o=null==i?void 0:i.map(e=>n.find(t=>
11t.id===e)).filter(Boolean))?o:[],e,"right")},pn(e.options,fn)),e.getFooterGroups=gn(()=>[e.getHeaderGroups()],e=>[...e].reverse(),pn(e.options,fn)),e.getLeftFooterGroups=gn(()=>[e.getLeftHeaderGroups()],e=>[...e].reverse(),pn(e.options,fn)),e.getCenterFooterGroups=gn(()=>[e.getCenterHeaderGroups()],e=>[...e].reverse(),pn(e.options,fn)),e.getRightFooterGroups=gn(()=>[e.getRightHeaderGroups()],e=>[...e].reverse(),pn(e.options,fn)),e.getFlatHeaders=gn(()=>[e.getHeaderGroups()],e=>e.map(e=>e.headers).flat(),pn(e.options,fn)),e.getLeftFlatHeaders=gn(()=>[e.getLeftHeaderGroups()],e=>e.map(e=>e.headers).flat(),pn(e.options,fn)),e.getCenterFlatHeaders=gn(()=>[e.getCenterHeaderGroups()],e=>e.map(e=>e.headers).flat(),pn(e.options,fn)),e.getRightFlatHeaders=gn(()=>[e.getRightHeaderGroups()],e=>e.map(e=>e.headers).flat(),pn(e.options,fn)),e.getCenterLeafHeaders=gn(()=>[e.getCenterFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),pn(e.options,fn)),e.getLeftLeafHeaders=gn(()=>[e.getLeftFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),pn(e.options,fn)),e.getRightLeafHeaders=gn(()=>[e.getRightFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),pn(e.options,fn)),e.getLeafHeaders=gn(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(e,t,n)=>{var i,o,s,l,r,a;return[...null!=(i=null==(o=e[0])?void 0:o.headers)?i:[],...null!=(s=null==(l=t[0])?void 0:l.headers)?s:[],...null!=(r=null==(a=n[0])?void 0:a.headers)?r:[]].map(e=>e.getLeafHeaders()).flat()},pn(e.options,fn))}};function bn(e,t,n,i){var o,s;let l=0;const r=function(e,t){void 0===t&&(t=1),l=Math.max(l,t),e.filter(e=>e.getIsVisible()).forEach(e=>{var n;null!=(n=e.columns)&&n.length&&r(e.columns,t+1)},0)};r(e);let a=[];const u=(e,t)=>{const o={depth:t,id:[i,`${t}`].filter(Boolean).join("_"),headers:[]},s=[];e.forEach(e=>{const l=[...s].reverse()[0];let r,a=!1;if(e.column.depth===o.depth&&e.column.parent?r=e.column.parent:(r=e.column,a=!0),l&&(null==l?void 0:l.column)===r)l.subHeaders.push(e);else{const o=mn(n,r,{id:[i,t,r.id,null==e?void 0:e.id].filter(Boolean).join("_"),isPlaceholder:a,placeholderId:a?`${s.filter(e=>e.column===r).length}`:void 0,depth:t,index:s.length});o.subHeaders.push(e),s.push(o)}o.headers.push(e),e.headerGroup=o}),a.push(o),t>0&&u(s,t-1)},d=t.map((e,t)=>mn(n,e,{depth:l,index:t}));u(d,l-1),a.reverse();const c=e=>e.filter(e=>e.column.getIsVisible()).map(e=>{let t=0,n=0,i=[0];e.subHeaders&&e.subHeaders.length?(i=[],c(e.subHeaders).forEach(e=>{let{colSpan:n,rowSpan:o}=e;t+=n,i.push(o)})):t=1;return n+=Math.min(...i),e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}});return c(null!=(o=null==(s=a[0])?void 0:s.headers)?o:[]),a}const wn=(e,t,n,i,o,s,l)=>{let r={id:t,index:i,original:n,depth:o,parentId:l,_valuesCache:{},_uniqueValuesCache:{},getValue:t=>{if(r._valuesCache.hasOwnProperty(t))return r._valuesCache[t];const n=e.getColumn(t);return null!=n&&n.accessorFn?(r._valuesCache[t]=n.accessorFn(r.original,i),r._valuesCache[t]):void 0},getUniqueValues:t=>{if(r._uniqueValuesCache.hasOwnProperty(t))return r._uniqueValuesCache[t];const n=e.getColumn(t);return null!=n&&n.accessorFn?n.columnDef.getUniqueValues?(r._uniqueValuesCache[t]=n.columnDef.getUniqueValues(r.original,i),r._uniqueValuesCache[t]):(r._uniqueValuesCache[t]=[r.getValue(t)],r._uniqueValuesCache[t]):void 0},renderValue:t=>{var n;return null!=(n=r.getValue(t))?n:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>function(e,t){const n=[],i=e=>{e.forEach(e=>{n.push(e);const o=t(e);null!=o&&o.length&&i(o)})};return i(e),n}(r.subRows,e=>e.subRows),getParentRow:()=>r.parentId?e.getRow(r.parentId,!0):void 0,getParentRows:()=>{let e=[],t=r;for(;;){const n=t.getParentRow();if(!n)break;e.push(n),t=n}return e.reverse()},getAllCells:gn(()=>[e.getAllLeafColumns()],t=>t.map(t=>function(e,t,n,i){const o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(i),renderValue:()=>{var t;return null!=(t=o.getValue())?t:e.options.renderFallbackValue},getContext:gn(()=>[e,n,t,o],(e,t,n,i)=>({table:e,column:t,row:n,cell:i,getValue:i.getValue,renderValue:i.renderValue}),pn(e.options,"debugCells"))};
11return e._features.forEach(i=>{null==i.createCell||i.createCell(o,n,t,e)},{}),o}(e,r,t,t.id)),pn(e.options,"debugRows")),_getAllCellsByColumnId:gn(()=>[r.getAllCells()],e=>e.reduce((e,t)=>(e[t.column.id]=t,e),{}),pn(e.options,"debugRows"))};for(let a=0;a<e._features.length;a++){const t=e._features[a];null==t||null==t.createRow||t.createRow(r,e)}return r},yn={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},Sn=(e,t,n)=>{var i,o;const s=null==n||null==(i=n.toString())?void 0:i.toLowerCase();return Boolean(null==(o=e.getValue(t))||null==(o=o.toString())||null==(o=o.toLowerCase())?void 0:o.includes(s))};Sn.autoRemove=e=>Vn(e);const Cn=(e,t,n)=>{var i;return Boolean(null==(i=e.getValue(t))||null==(i=i.toString())?void 0:i.includes(n))};Cn.autoRemove=e=>Vn(e);const Rn=(e,t,n)=>{var i;return(null==(i=e.getValue(t))||null==(i=i.toString())?void 0:i.toLowerCase())===(null==n?void 0:n.toLowerCase())};Rn.autoRemove=e=>Vn(e);const Mn=(e,t,n)=>{var i;return null==(i=e.getValue(t))?void 0:i.includes(n)};Mn.autoRemove=e=>Vn(e)||!(null!=e&&e.length);const Fn=(e,t,n)=>!n.some(n=>{var i;return!(null!=(i=e.getValue(t))&&i.includes(n))});Fn.autoRemove=e=>Vn(e)||!(null!=e&&e.length);const Pn=(e,t,n)=>n.some(n=>{var i;return null==(i=e.getValue(t))?void 0:i.includes(n)});Pn.autoRemove=e=>Vn(e)||!(null!=e&&e.length);const On=(e,t,n)=>e.getValue(t)===n;On.autoRemove=e=>Vn(e);const xn=(e,t,n)=>e.getValue(t)==n;xn.autoRemove=e=>Vn(e);const In=(e,t,n)=>{let[i,o]=n;const s=e.getValue(t);return s>=i&&s<=o};In.resolveFilterValue=e=>{let[t,n]=e,i="number"!=typeof t?parseFloat(t):t,o="number"!=typeof n?parseFloat(n):n,s=null===t||Number.isNaN(i)?-1/0:i,l=null===n||Number.isNaN(o)?1/0:o;if(s>l){const e=s;s=l,l=e}return[s,l]},In.autoRemove=e=>Vn(e)||Vn(e[0])&&Vn(e[1]);const En={includesString:Sn,includesStringSensitive:Cn,equalsString:Rn,arrIncludes:Mn,arrIncludesAll:Fn,arrIncludesSome:Pn,equals:On,weakEquals:xn,inNumberRange:In};function Vn(e){return null==e||""===e}const _n={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:cn("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],i=null==n?void 0:n.getValue(e.id);return"string"==typeof i?En.includesString:"number"==typeof i?En.inNumberRange:"boolean"==typeof i||null!==i&&"object"==typeof i?En.equals:Array.isArray(i)?En.arrIncludes:En.weakEquals},e.getFilterFn=()=>{var n,i;return hn(e.columnDef.filterFn)?e.columnDef.filterFn:"auto"===e.columnDef.filterFn?e.getAutoFilterFn():null!=(n=null==(i=t.options.filterFns)?void 0:i[e.columnDef.filterFn])?n:En[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,i,o;return(null==(n=e.columnDef.enableColumnFilter)||n)&&(null==(i=t.options.enableColumnFilters)||i)&&(null==(o=t.options.enableFilters)||o)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return null==(n=t.getState().columnFilters)||null==(n=n.find(t=>t.id===e.id))?void 0:n.value},e.getFilterIndex=()=>{var n,i;return null!=(n=null==(i=t.getState().columnFilters)?void 0:i.findIndex(t=>t.id===e.id))?n:-1},e.setFilterValue=n=>{t.setColumnFilters(t=>{const i=e.getFilterFn(),o=null==t?void 0:t.find(t=>t.id===e.id),s=dn(n,o?o.value:void 0);var l;if(An(i,s,e))return null!=(l=null==t?void 0:t.filter(t=>t.id!==e.id))?l:[];const r={id:e.id,value:s};var a;return o?null!=(a=null==t?void 0:t.map(t=>t.id===e.id?r:t))?a:[]:null!=t&&t.length?[...t,r]:[r]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns();null==e.options.onColumnFiltersChange||e.options.onColumnFiltersChange(e=>{var i;return null==(i=dn(t,e))?void 0:i.filter(e=>{const t=n.find(t=>
11t.id===e.id);if(t){if(An(t.getFilterFn(),e.value,t))return!1}return!0})})},e.resetColumnFilters=t=>{var n,i;e.setColumnFilters(t?[]:null!=(n=null==(i=e.initialState)?void 0:i.columnFilters)?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function An(e,t,n){return!(!e||!e.autoRemove)&&e.autoRemove(t,n)||void 0===t||"string"==typeof t&&!t}const Dn={sum:(e,t,n)=>n.reduce((t,n)=>{const i=n.getValue(e);return t+("number"==typeof i?i:0)},0),min:(e,t,n)=>{let i;return n.forEach(t=>{const n=t.getValue(e);null!=n&&(i>n||void 0===i&&n>=n)&&(i=n)}),i},max:(e,t,n)=>{let i;return n.forEach(t=>{const n=t.getValue(e);null!=n&&(i<n||void 0===i&&n>=n)&&(i=n)}),i},extent:(e,t,n)=>{let i,o;return n.forEach(t=>{const n=t.getValue(e);null!=n&&(void 0===i?n>=n&&(i=o=n):(i>n&&(i=n),o<n&&(o=n)))}),[i,o]},mean:(e,t)=>{let n=0,i=0;if(t.forEach(t=>{let o=t.getValue(e);null!=o&&(o=+o)>=o&&(++n,i+=o)}),n)return i/n},median:(e,t)=>{if(!t.length)return;const n=t.map(t=>t.getValue(e));if(i=n,!Array.isArray(i)||!i.every(e=>"number"==typeof e))return;var i;if(1===n.length)return n[0];const o=Math.floor(n.length/2),s=n.sort((e,t)=>e-t);return n.length%2!=0?s[o]:(s[o-1]+s[o])/2},unique:(e,t)=>Array.from(new Set(t.map(t=>t.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(t=>t.getValue(e))).size,count:(e,t)=>t.length},kn={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return null!=(t=null==(n=e.getValue())||null==n.toString?void 0:n.toString())?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:cn("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(t=>null!=t&&t.includes(e.id)?t.filter(t=>t!==e.id):[...null!=t?t:[],e.id])},e.getCanGroup=()=>{var n,i;return(null==(n=e.columnDef.enableGrouping)||n)&&(null==(i=t.options.enableGrouping)||i)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],i=null==n?void 0:n.getValue(e.id);return"number"==typeof i?Dn.sum:"[object Date]"===Object.prototype.toString.call(i)?Dn.extent:void 0},e.getAggregationFn=()=>{var n,i;if(!e)throw new Error;return hn(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:"auto"===e.columnDef.aggregationFn?e.getAutoAggregationFn():null!=(n=null==(i=t.options.aggregationFns)?void 0:i[e.columnDef.aggregationFn])?n:Dn[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>null==e.options.onGroupingChange?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,i;e.setGrouping(t?[]:null!=(n=null==(i=e.initialState)?void 0:i.grouping)?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const i=t.getColumn(n);return null!=i&&i.columnDef.getGroupingValue?(e._groupingValuesCache[n]=i.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,i)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!(null==(t=n.subRows)||!t.length)}}};const Gn={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:cn("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=gn(e=>[Qn(t,e)],t=>t.findIndex(t=>
11t.id===e.id),pn(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var i;return(null==(i=Qn(t,n)[0])?void 0:i.id)===e.id},e.getIsLastColumn=n=>{var i;const o=Qn(t,n);return(null==(i=o[o.length-1])?void 0:i.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>null==e.options.onColumnOrderChange?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:null!=(n=e.initialState.columnOrder)?n:[])},e._getOrderColumnsFn=gn(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(e,t,n)=>i=>{let o=[];if(null!=e&&e.length){const t=[...e],n=[...i];for(;n.length&&t.length;){const e=t.shift(),i=n.findIndex(t=>t.id===e);i>-1&&o.push(n.splice(i,1)[0])}o=[...o,...n]}else o=i;return function(e,t,n){if(null==t||!t.length||!n)return e;const i=e.filter(e=>!t.includes(e.id));return"remove"===n?i:[...t.map(t=>e.find(e=>e.id===t)).filter(Boolean),...i]}(o,t,n)},pn(e.options,"debugTable"))}},Ln={getInitialState:e=>({columnPinning:{left:[],right:[]},...e}),getDefaultOptions:e=>({onColumnPinningChange:cn("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const i=e.getLeafColumns().map(e=>e.id).filter(Boolean);t.setColumnPinning(e=>{var t,o,s,l,r,a;return"right"===n?{left:(null!=(s=null==e?void 0:e.left)?s:[]).filter(e=>!(null!=i&&i.includes(e))),right:[...(null!=(l=null==e?void 0:e.right)?l:[]).filter(e=>!(null!=i&&i.includes(e))),...i]}:"left"===n?{left:[...(null!=(r=null==e?void 0:e.left)?r:[]).filter(e=>!(null!=i&&i.includes(e))),...i],right:(null!=(a=null==e?void 0:e.right)?a:[]).filter(e=>!(null!=i&&i.includes(e)))}:{left:(null!=(t=null==e?void 0:e.left)?t:[]).filter(e=>!(null!=i&&i.includes(e))),right:(null!=(o=null==e?void 0:e.right)?o:[]).filter(e=>!(null!=i&&i.includes(e)))}})},e.getCanPin=()=>e.getLeafColumns().some(e=>{var n,i,o;return(null==(n=e.columnDef.enablePinning)||n)&&(null==(i=null!=(o=t.options.enableColumnPinning)?o:t.options.enablePinning)||i)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(e=>e.id),{left:i,right:o}=t.getState().columnPinning,s=n.some(e=>null==i?void 0:i.includes(e)),l=n.some(e=>null==o?void 0:o.includes(e));return s?"left":!!l&&"right"},e.getPinnedIndex=()=>{var n,i;const o=e.getIsPinned();return o?null!=(n=null==(i=t.getState().columnPinning)||null==(i=i[o])?void 0:i.indexOf(e.id))?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=gn(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,t,n)=>{const i=[...null!=t?t:[],...null!=n?n:[]];return e.filter(e=>!i.includes(e.column.id))},pn(t.options,"debugRows")),e.getLeftVisibleCells=gn(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:"left"})),pn(t.options,"debugRows")),e.getRightVisibleCells=gn(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:"right"})),pn(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>null==e.options.onColumnPinningChange?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,i;return e.setColumnPinning(t?{left:[],right:[]}:null!=(n=null==(i=e.initialState)?void 0:i.columnPinning)?n:{left:[],right:[]})},e.getIsSomeColumnsPinned=t=>{var n;const i=e.getState().columnPinning;var o,s;return t?Boolean(null==(n=i[t])?void 0:n.length):Boolean((null==(o=i.left)?void 0:o.length)||(null==(s=i.right)?void 0:s.length))},e.getLeftLeafColumns=gn(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),pn(e.options,"debugColumns")),e.getRightLeafColumns=gn(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),pn(e.options,"debugColumns")),e.getCenterLeafColumns=gn(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(e,t,n)=>{const i=[...null!=t?t:[],...null!=n?n:[]];return e.filter(e=>!i.includes(e.id))},pn(e.options,"debugColumns"))}},qn={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Hn={getDefaultColumnDef:()=>qn,getInitialState:e=>({columnSizing:{},columnSizingInfo:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]},...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:cn("columnSizing",e),onColumnSizingInfoChange:cn("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,i,o;const s=t.getState().columnSizing[e.id];return Math.min(Math.max(null!=(n=e.columnDef.minSize)?n:qn.minSize,null!=(i=null!=s?s:e.columnDef.size)?i:qn.size),null!=(o=e.columnDef.maxSize)?o:qn.maxSize)},e.getStart=gn(e=>[e,Qn(t,e),t.getState().columnSizing],(t,n)=>n.slice(0,e.getIndex(t)).reduce((e,t)=>
11e+t.getSize(),0),pn(t.options,"debugColumns")),e.getAfter=gn(e=>[e,Qn(t,e),t.getState().columnSizing],(t,n)=>n.slice(e.getIndex(t)+1).reduce((e,t)=>e+t.getSize(),0),pn(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(t=>{let{[e.id]:n,...i}=t;return i})},e.getCanResize=()=>{var n,i;return(null==(n=e.columnDef.enableResizing)||n)&&(null==(i=t.options.enableColumnResizing)||i)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let t=0;const n=e=>{var i;e.subHeaders.length?e.subHeaders.forEach(n):t+=null!=(i=e.column.getSize())?i:0};return n(e),t},e.getStart=()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=n=>{const i=t.getColumn(e.column.id),o=null==i?void 0:i.getCanResize();return s=>{if(!i||!o)return;if(null==s.persist||s.persist(),Tn(s)&&s.touches&&s.touches.length>1)return;const l=e.getSize(),r=e?e.getLeafHeaders().map(e=>[e.column.id,e.column.getSize()]):[[i.id,i.getSize()]],a=Tn(s)?Math.round(s.touches[0].clientX):s.clientX,u={},d=(e,n)=>{"number"==typeof n&&(t.setColumnSizingInfo(e=>{var i,o;const s="rtl"===t.options.columnResizeDirection?-1:1,l=(n-(null!=(i=null==e?void 0:e.startOffset)?i:0))*s,r=Math.max(l/(null!=(o=null==e?void 0:e.startSize)?o:0),-.999999);return e.columnSizingStart.forEach(e=>{let[t,n]=e;u[t]=Math.round(100*Math.max(n+n*r,0))/100}),{...e,deltaOffset:l,deltaPercentage:r}}),"onChange"!==t.options.columnResizeMode&&"end"!==e||t.setColumnSizing(e=>({...e,...u})))},c=e=>d("move",e),h=e=>{d("end",e),t.setColumnSizingInfo(e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},g=n||"undefined"!=typeof document?document:null,p={moveHandler:e=>c(e.clientX),upHandler:e=>{null==g||g.removeEventListener("mousemove",p.moveHandler),null==g||g.removeEventListener("mouseup",p.upHandler),h(e.clientX)}},f={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),c(e.touches[0].clientX),!1),upHandler:e=>{var t;null==g||g.removeEventListener("touchmove",f.moveHandler),null==g||g.removeEventListener("touchend",f.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),h(null==(t=e.touches[0])?void 0:t.clientX)}},m=!!function(){if("boolean"==typeof zn)return zn;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch(t){e=!1}return zn=e,zn}()&&{passive:!1};Tn(s)?(null==g||g.addEventListener("touchmove",f.moveHandler,m),null==g||g.addEventListener("touchend",f.upHandler,m)):(null==g||g.addEventListener("mousemove",p.moveHandler,m),null==g||g.addEventListener("mouseup",p.upHandler,m)),t.setColumnSizingInfo(e=>({...e,startOffset:a,startSize:l,deltaOffset:0,deltaPercentage:0,columnSizingStart:r,isResizingColumn:i.id}))}}},createTable:e=>{e.setColumnSizing=t=>null==e.options.onColumnSizingChange?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>null==e.options.onColumnSizingInfoChange?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:null!=(n=e.initialState.columnSizing)?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}:null!=(n=e.initialState.columnSizingInfo)?n:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]})},e.getTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getLeftTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getLeftHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getCenterTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getCenterHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getRightTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getRightHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0}}};let zn=null;function Tn(e){return"touchstart"===e.type}function Qn(e,t){return t?"center"===t?e.getCenterVisibleLeafColumns():"left"===t?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const Wn={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:cn("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}
11),createTable:e=>{e.setRowSelection=t=>null==e.options.onRowSelectionChange?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:null!=(n=e.initialState.rowSelection)?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=void 0!==t?t:!e.getIsAllRowsSelected();const i={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(e=>{e.getCanSelect()&&(i[e.id]=!0)}):o.forEach(e=>{delete i[e.id]}),i})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const i=void 0!==t?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(t=>{jn(o,t.id,i,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=gn(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Un(e,n):{rows:[],flatRows:[],rowsById:{}},pn(e.options,"debugTable")),e.getFilteredSelectedRowModel=gn(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Un(e,n):{rows:[],flatRows:[],rowsById:{}},pn(e.options,"debugTable")),e.getGroupedSelectedRowModel=gn(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Un(e,n):{rows:[],flatRows:[],rowsById:{}},pn(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let i=Boolean(t.length&&Object.keys(n).length);return i&&t.some(e=>e.getCanSelect()&&!n[e.id])&&(i=!1),i},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(e=>e.getCanSelect()),{rowSelection:n}=e.getState();let i=!!t.length;return i&&t.some(e=>!n[e.id])&&(i=!1),i},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys(null!=(t=e.getState().rowSelection)?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return!e.getIsAllPageRowsSelected()&&t.filter(e=>e.getCanSelect()).some(e=>e.getIsSelected()||e.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,i)=>{const o=e.getIsSelected();t.setRowSelection(s=>{var l;if(n=void 0!==n?n:!o,e.getCanSelect()&&o===n)return s;const r={...s};return jn(r,e.id,n,null==(l=null==i?void 0:i.selectChildren)||l,t),r})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Bn(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return"some"===Kn(e,n)},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return"all"===Kn(e,n)},e.getCanSelect=()=>{var n;return"function"==typeof t.options.enableRowSelection?t.options.enableRowSelection(e):null==(n=t.options.enableRowSelection)||n},e.getCanSelectSubRows=()=>{var n;return"function"==typeof t.options.enableSubRowSelection?t.options.enableSubRowSelection(e):null==(n=t.options.enableSubRowSelection)||n},e.getCanMultiSelect=()=>{var n;return"function"==typeof t.options.enableMultiRowSelection?t.options.enableMultiRowSelection(e):null==(n=t.options.enableMultiRowSelection)||n},e.getToggleSelectedHandler=()=>{const t=e.getCanSelect();return n=>{var i;t&&e.toggleSelected(null==(i=n.target)?void 0:i.checked)}}}},jn=(e,t,n,i,o)=>{var s;const l=o.getRow(t,!0);n?(l.getCanMultiSelect()||Object.keys(e).forEach(t=>delete e[t]),l.getCanSelect()&&(e[t]=!0)):delete e[t],i&&null!=(s=l.subRows)&&s.length&&l.getCanSelectSubRows()&&l.subRows.forEach(t=>jn(e,t.id,n,i,o))};function Un(e,t){const n=e.getState().rowSelection,i=[],o={},s=function(e,t){return e.map(e=>{var t;const l=Bn(e,n);if(l&&(i.push(e),o[e.id]=e),null!=(t=e.subRows)&&t.length&&(e={...e,subRows:s(e.subRows)}),l)return e}).filter(Boolean)};return{rows:s(t.rows),flatRows:i,rowsById:o}}function Bn(e,t){var n;return null!=(n=t[e.id])&&n}function Kn(e,t,n){var i;
11if(null==(i=e.subRows)||!i.length)return!1;let o=!0,s=!1;return e.subRows.forEach(e=>{if((!s||o)&&(e.getCanSelect()&&(Bn(e,t)?s=!0:o=!1),e.subRows&&e.subRows.length)){const n=Kn(e,t);"all"===n?s=!0:"some"===n?(s=!0,o=!1):o=!1}}),o?"all":!!s&&"some"}const Nn=/([0-9]+)/gm;function $n(e,t){return e===t?0:e>t?1:-1}function Xn(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}function Jn(e,t){const n=e.split(Nn).filter(Boolean),i=t.split(Nn).filter(Boolean);for(;n.length&&i.length;){const e=n.shift(),t=i.shift(),o=parseInt(e,10),s=parseInt(t,10),l=[o,s].sort();if(isNaN(l[0])){if(e>t)return 1;if(t>e)return-1}else{if(isNaN(l[1]))return isNaN(o)?-1:1;if(o>s)return 1;if(s>o)return-1}}return n.length-i.length}const Yn={alphanumeric:(e,t,n)=>Jn(Xn(e.getValue(n)).toLowerCase(),Xn(t.getValue(n)).toLowerCase()),alphanumericCaseSensitive:(e,t,n)=>Jn(Xn(e.getValue(n)),Xn(t.getValue(n))),text:(e,t,n)=>$n(Xn(e.getValue(n)).toLowerCase(),Xn(t.getValue(n)).toLowerCase()),textCaseSensitive:(e,t,n)=>$n(Xn(e.getValue(n)),Xn(t.getValue(n))),datetime:(e,t,n)=>{const i=e.getValue(n),o=t.getValue(n);return i>o?1:i<o?-1:0},basic:(e,t,n)=>$n(e.getValue(n),t.getValue(n))},Zn=[vn,{getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:cn("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(t=>({...t,[e.id]:null!=n?n:!e.getIsVisible()}))},e.getIsVisible=()=>{var n,i;const o=e.columns;return null==(n=o.length?o.some(e=>e.getIsVisible()):null==(i=t.getState().columnVisibility)?void 0:i[e.id])||n},e.getCanHide=()=>{var n,i;return(null==(n=e.columnDef.enableHiding)||n)&&(null==(i=t.options.enableHiding)||i)},e.getToggleVisibilityHandler=()=>t=>{null==e.toggleVisibility||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=gn(()=>[e.getAllCells(),t.getState().columnVisibility],e=>e.filter(e=>e.column.getIsVisible()),pn(t.options,"debugRows")),e.getVisibleCells=gn(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(e,t,n)=>[...e,...t,...n],pn(t.options,"debugRows"))},createTable:e=>{const t=(t,n)=>gn(()=>[n(),n().filter(e=>e.getIsVisible()).map(e=>e.id).join("_")],e=>e.filter(e=>null==e.getIsVisible?void 0:e.getIsVisible()),pn(e.options,"debugColumns"));e.getVisibleFlatColumns=t(0,()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t(0,()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t(0,()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t(0,()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t(0,()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>null==e.options.onColumnVisibilityChange?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var n;e.setColumnVisibility(t?{}:null!=(n=e.initialState.columnVisibility)?n:{})},e.toggleAllColumnsVisible=t=>{var n;t=null!=(n=t)?n:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((e,n)=>({...e,[n.id]:t||!(null!=n.getCanHide&&n.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(e=>!(null!=e.getIsVisible&&e.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(e=>null==e.getIsVisible?void 0:e.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var n;e.toggleAllColumnsVisible(null==(n=t.target)?void 0:n.checked)}}},Gn,Ln,yn,_n,{createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},{getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:cn("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const i=null==(n=e.getCoreRowModel().flatRows[0])||null==(n=n._getAllCellsByColumnId()[t.id])?void 0:n.getValue();return"string"==typeof i||"number"==typeof i}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,i,o,s;return(null==(n=e.columnDef.enableGlobalFilter)||n)&&(null==(i=t.options.enableGlobalFilter)||i)&&(null==(o=t.options.enableFilters)||o)&&(null==(s=null==t.options.getColumnCanGlobalFilter?void 0:t.options.getColumnCanGlobalFilter(e))||s)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>En.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:i}=e.options;return hn(i)?i:"auto"===i?e.getGlobalAutoFilterFn():null!=(t=null==(n=e.options.filterFns)?void 0:n[i])?t:En[i]},e.setGlobalFilter=t=>{null==e.options.onGlobalFilterChange||e.options.onGlobalFilterChange(t)}
11,e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:cn("sorting",e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let i=!1;for(const t of n){const n=null==t?void 0:t.getValue(e.id);if("[object Date]"===Object.prototype.toString.call(n))return Yn.datetime;if("string"==typeof n&&(i=!0,n.split(Nn).length>1))return Yn.alphanumeric}return i?Yn.text:Yn.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return"string"==typeof(null==n?void 0:n.getValue(e.id))?"asc":"desc"},e.getSortingFn=()=>{var n,i;if(!e)throw new Error;return hn(e.columnDef.sortingFn)?e.columnDef.sortingFn:"auto"===e.columnDef.sortingFn?e.getAutoSortingFn():null!=(n=null==(i=t.options.sortingFns)?void 0:i[e.columnDef.sortingFn])?n:Yn[e.columnDef.sortingFn]},e.toggleSorting=(n,i)=>{const o=e.getNextSortingOrder(),s=null!=n;t.setSorting(l=>{const r=null==l?void 0:l.find(t=>t.id===e.id),a=null==l?void 0:l.findIndex(t=>t.id===e.id);let u,d=[],c=s?n:"desc"===o;var h;(u=null!=l&&l.length&&e.getCanMultiSort()&&i?r?"toggle":"add":null!=l&&l.length&&a!==l.length-1?"replace":r?"toggle":"replace","toggle"===u&&(s||o||(u="remove")),"add"===u)?(d=[...l,{id:e.id,desc:c}],d.splice(0,d.length-(null!=(h=t.options.maxMultiSortColCount)?h:Number.MAX_SAFE_INTEGER))):d="toggle"===u?l.map(t=>t.id===e.id?{...t,desc:c}:t):"remove"===u?l.filter(t=>t.id!==e.id):[{id:e.id,desc:c}];return d})},e.getFirstSortDir=()=>{var n,i;return(null!=(n=null!=(i=e.columnDef.sortDescFirst)?i:t.options.sortDescFirst)?n:"desc"===e.getAutoSortDir())?"desc":"asc"},e.getNextSortingOrder=n=>{var i,o;const s=e.getFirstSortDir(),l=e.getIsSorted();return l?!!(l===s||null!=(i=t.options.enableSortingRemoval)&&!i||n&&null!=(o=t.options.enableMultiRemove)&&!o)&&("desc"===l?"asc":"desc"):s},e.getCanSort=()=>{var n,i;return(null==(n=e.columnDef.enableSorting)||n)&&(null==(i=t.options.enableSorting)||i)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,i;return null!=(n=null!=(i=e.columnDef.enableMultiSort)?i:t.options.enableMultiSort)?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const i=null==(n=t.getState().sorting)?void 0:n.find(t=>t.id===e.id);return!!i&&(i.desc?"desc":"asc")},e.getSortIndex=()=>{var n,i;return null!=(n=null==(i=t.getState().sorting)?void 0:i.findIndex(t=>t.id===e.id))?n:-1},e.clearSorting=()=>{t.setSorting(t=>null!=t&&t.length?t.filter(t=>t.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return i=>{n&&(null==i.persist||i.persist(),null==e.toggleSorting||e.toggleSorting(void 0,!!e.getCanMultiSort()&&(null==t.options.isMultiSortEvent?void 0:t.options.isMultiSortEvent(i))))}}},createTable:e=>{e.setSorting=t=>null==e.options.onSortingChange?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,i;e.setSorting(t?[]:null!=(n=null==(i=e.initialState)?void 0:i.sorting)?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},kn,{getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:cn("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var i,o;if(t){if(null!=(i=null!=(o=e.options.autoResetAll)?o:e.options.autoResetExpanded)?i:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}}else e._queue(()=>{t=!0})},e.setExpanded=t=>null==e.options.onExpandedChange?void 0:e.options.onExpandedChange(t),e.toggleAllRowsExpanded=t=>{(null!=t?t:!e.getIsAllRowsExpanded())?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=t=>{var n,i;e.setExpanded(t?{}:null!=(n=null==(i=e.initialState)?void 0:i.expanded)?n:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(e=>e.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>t=>{null==t.persist||t.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const t=e.getState().expanded;return!0===t||Object.values(t).some(Boolean)},e.getIsAllRowsExpanded=()=>{const t=e.getState().expanded;return"boolean"==typeof t?!0===t:!!Object.keys(t).length&&!e.getRowModel().flatRows.some(e=>!e.getIsExpanded())},e.getExpandedDepth=()=>{let t=0;return(!0===e.getState().expanded?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEac
11h(e=>{const n=e.split(".");t=Math.max(t,n.length)}),t},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(i=>{var o;const s=!0===i||!(null==i||!i[e.id]);let l={};if(!0===i?Object.keys(t.getRowModel().rowsById).forEach(e=>{l[e]=!0}):l=i,n=null!=(o=n)?o:!s,!s&&n)return{...l,[e.id]:!0};if(s&&!n){const{[e.id]:t,...n}=l;return n}return i})},e.getIsExpanded=()=>{var n;const i=t.getState().expanded;return!!(null!=(n=null==t.options.getIsRowExpanded?void 0:t.options.getIsRowExpanded(e))?n:!0===i||(null==i?void 0:i[e.id]))},e.getCanExpand=()=>{var n,i,o;return null!=(n=null==t.options.getRowCanExpand?void 0:t.options.getRowCanExpand(e))?n:(null==(i=t.options.enableExpanding)||i)&&!(null==(o=e.subRows)||!o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,i=e;for(;n&&i.parentId;)i=t.getRow(i.parentId,!0),n=i.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},{getInitialState:e=>({...e,pagination:{pageIndex:0,pageSize:10,...null==e?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:cn("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var i,o;if(t){if(null!=(i=null!=(o=e.options.autoResetAll)?o:e.options.autoResetPageIndex)?i:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}}else e._queue(()=>{t=!0})},e.setPagination=t=>null==e.options.onPaginationChange?void 0:e.options.onPaginationChange(e=>dn(t,e)),e.resetPagination=t=>{var n;e.setPagination(t?{pageIndex:0,pageSize:10}:null!=(n=e.initialState.pagination)?n:{pageIndex:0,pageSize:10})},e.setPageIndex=t=>{e.setPagination(n=>{let i=dn(t,n.pageIndex);const o=void 0===e.options.pageCount||-1===e.options.pageCount?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,o)),{...n,pageIndex:i}})},e.resetPageIndex=t=>{var n,i;e.setPageIndex(t?0:null!=(n=null==(i=e.initialState)||null==(i=i.pagination)?void 0:i.pageIndex)?n:0)},e.resetPageSize=t=>{var n,i;e.setPageSize(t?10:null!=(n=null==(i=e.initialState)||null==(i=i.pagination)?void 0:i.pageSize)?n:10)},e.setPageSize=t=>{e.setPagination(e=>{const n=Math.max(1,dn(t,e.pageSize)),i=e.pageSize*e.pageIndex,o=Math.floor(i/n);return{...e,pageIndex:o,pageSize:n}})},e.setPageCount=t=>e.setPagination(n=>{var i;let o=dn(t,null!=(i=e.options.pageCount)?i:-1);return"number"==typeof o&&(o=Math.max(-1,o)),{...n,pageCount:o}}),e.getPageOptions=gn(()=>[e.getPageCount()],e=>{let t=[];return e&&e>0&&(t=[...new Array(e)].fill(null).map((e,t)=>t)),t},pn(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:t}=e.getState().pagination,n=e.getPageCount();
11return-1===n||0!==n&&t<n-1},e.previousPage=()=>e.setPageIndex(e=>e-1),e.nextPage=()=>e.setPageIndex(e=>e+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var t;return null!=(t=e.options.pageCount)?t:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var t;return null!=(t=e.options.rowCount)?t:e.getPrePaginationRowModel().rows.length}}},{getInitialState:e=>({rowPinning:{top:[],bottom:[]},...e}),getDefaultOptions:e=>({onRowPinningChange:cn("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,i,o)=>{const s=i?e.getLeafRows().map(e=>{let{id:t}=e;return t}):[],l=o?e.getParentRows().map(e=>{let{id:t}=e;return t}):[],r=new Set([...l,e.id,...s]);t.setRowPinning(e=>{var t,i,o,s,l,a;return"bottom"===n?{top:(null!=(o=null==e?void 0:e.top)?o:[]).filter(e=>!(null!=r&&r.has(e))),bottom:[...(null!=(s=null==e?void 0:e.bottom)?s:[]).filter(e=>!(null!=r&&r.has(e))),...Array.from(r)]}:"top"===n?{top:[...(null!=(l=null==e?void 0:e.top)?l:[]).filter(e=>!(null!=r&&r.has(e))),...Array.from(r)],bottom:(null!=(a=null==e?void 0:e.bottom)?a:[]).filter(e=>!(null!=r&&r.has(e)))}:{top:(null!=(t=null==e?void 0:e.top)?t:[]).filter(e=>!(null!=r&&r.has(e))),bottom:(null!=(i=null==e?void 0:e.bottom)?i:[]).filter(e=>!(null!=r&&r.has(e)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:i,enablePinning:o}=t.options;return"function"==typeof i?i(e):null==(n=null!=i?i:o)||n},e.getIsPinned=()=>{const n=[e.id],{top:i,bottom:o}=t.getState().rowPinning,s=n.some(e=>null==i?void 0:i.includes(e)),l=n.some(e=>null==o?void 0:o.includes(e));return s?"top":!!l&&"bottom"},e.getPinnedIndex=()=>{var n,i;const o=e.getIsPinned();if(!o)return-1;const s=null==(n="top"===o?t.getTopRows():t.getBottomRows())?void 0:n.map(e=>{let{id:t}=e;return t});return null!=(i=null==s?void 0:s.indexOf(e.id))?i:-1}},createTable:e=>{e.setRowPinning=t=>null==e.options.onRowPinningChange?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,i;return e.setRowPinning(t?{top:[],bottom:[]}:null!=(n=null==(i=e.initialState)?void 0:i.rowPinning)?n:{top:[],bottom:[]})},e.getIsSomeRowsPinned=t=>{var n;const i=e.getState().rowPinning;var o,s;return t?Boolean(null==(n=i[t])?void 0:n.length):Boolean((null==(o=i.top)?void 0:o.length)||(null==(s=i.bottom)?void 0:s.length))},e._getPinnedRows=(t,n,i)=>{var o;return(null==(o=e.options.keepPinnedRows)||o?(null!=n?n:[]).map(t=>{const n=e.getRow(t,!0);return n.getIsAllParentsExpanded()?n:null}):(null!=n?n:[]).map(e=>t.find(t=>t.id===e))).filter(Boolean).map(e=>({...e,position:i}))},e.getTopRows=gn(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),pn(e.options,"debugRows")),e.getBottomRows=gn(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),pn(e.options,"debugRows")),e.getCenterRows=gn(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(e,t,n)=>{const i=new Set([...null!=t?t:[],...null!=n?n:[]]);return e.filter(e=>!i.has(e.id))},pn(e.options,"debugRows"))}},Wn,Hn];function ei(e){var t,n;const i=[...Zn,...null!=(t=e._features)?t:[]];let o={_features:i};const s=o._features.reduce((e,t)=>Object.assign(e,null==t.getDefaultOptions?void 0:t.getDefaultOptions(o)),{});let l={...null!=(n=e.initialState)?n:{}};o._features.forEach(e=>{var t;l=null!=(t=null==e.getInitialState?void 0:e.getInitialState(l))?t:l});const r=[];let a=!1;const u={_features:i,options:{...s,...e},initialState:l,_queue:e=>{r.push(e),a||(a=!0,Promise.resolve().then(()=>{for(;r.length;)r.shift()();a=!1}).catch(e=>setTimeout(()=>{throw e})))},reset:()=>{o.setState(o.initialState)},setOptions:e=>{const t=dn(e,o.options);var n;o.options=(n=t,o.options.mergeOptions?o.options.mergeOptions(s,n):{...s,...n})},getState:()=>o.options.state,setState:e=>{null==o.options.onStateChange||o.options.onStateChange(e)},_getRowId:(e,t,n)=>{var i;return null!=(i=null==o.options.getRowId?void 0:o.options.getRowId(e,t,n))?i:`${n?[n.id,t].join("."):t}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(e,t)=>{let n=(t?o.getPrePaginationRowModel():o.getRowModel()).rowsById[e];if(!n&&(n=o.getCoreRowModel().rowsById[e],!n))throw new Error;return n},_getDefaultColumnDef:gn(()=>[o.options.defaultColumn],e=>{var t;return e=null!=(t=e)?t:{},{header:e=>{const t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t,n;return null!=(t=null==(n=e.renderValue())||null==n.toString?void 0:n.toString())?t:null},...o._features.reduce((e,t)=>
11Object.assign(e,null==t.getDefaultColumnDef?void 0:t.getDefaultColumnDef()),{}),...e}},pn(e,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:gn(()=>[o._getColumnDefs()],e=>{const t=function(e,n,i){return void 0===i&&(i=0),e.map(e=>{const s=function(e,t,n,i){var o,s;const l={...e._getDefaultColumnDef(),...t},r=l.accessorKey;let a,u=null!=(o=null!=(s=l.id)?s:r?"function"==typeof String.prototype.replaceAll?r.replaceAll(".","_"):r.replace(/\./g,"_"):void 0)?o:"string"==typeof l.header?l.header:void 0;if(l.accessorFn?a=l.accessorFn:r&&(a=r.includes(".")?e=>{let t=e;for(const i of r.split(".")){var n;t=null==(n=t)?void 0:n[i]}return t}:e=>e[l.accessorKey]),!u)throw new Error;let d={id:`${String(u)}`,accessorFn:a,parent:i,depth:n,columnDef:l,columns:[],getFlatColumns:gn(()=>[!0],()=>{var e;return[d,...null==(e=d.columns)?void 0:e.flatMap(e=>e.getFlatColumns())]},pn(e.options,"debugColumns")),getLeafColumns:gn(()=>[e._getOrderColumnsFn()],e=>{var t;return null!=(t=d.columns)&&t.length?e(d.columns.flatMap(e=>e.getLeafColumns())):[d]},pn(e.options,"debugColumns"))};for(const c of e._features)null==c.createColumn||c.createColumn(d,e);return d}(o,e,i,n),l=e;return s.columns=l.columns?t(l.columns,s,i+1):[],s})};return t(e)},pn(e,"debugColumns")),getAllFlatColumns:gn(()=>[o.getAllColumns()],e=>e.flatMap(e=>e.getFlatColumns()),pn(e,"debugColumns")),_getAllFlatColumnsById:gn(()=>[o.getAllFlatColumns()],e=>e.reduce((e,t)=>(e[t.id]=t,e),{}),pn(e,"debugColumns")),getAllLeafColumns:gn(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(e,t)=>t(e.flatMap(e=>e.getLeafColumns())),pn(e,"debugColumns")),getColumn:e=>o._getAllFlatColumnsById()[e]};Object.assign(o,u);for(let d=0;d<o._features.length;d++){const e=o._features[d];null==e||null==e.createTable||e.createTable(o)}return o}function ti(){return e=>gn(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},i=function(t,o,s){void 0===o&&(o=0);const l=[];for(let a=0;a<t.length;a++){const u=wn(e,e._getRowId(t[a],a,s),t[a],a,o,0,null==s?void 0:s.id);var r;if(n.flatRows.push(u),n.rowsById[u.id]=u,l.push(u),e.options.getSubRows)u.originalSubRows=e.options.getSubRows(t[a],a),null!=(r=u.originalSubRows)&&r.length&&(u.subRows=i(u.originalSubRows,o+1,u))}return l};return n.rows=i(t),n},pn(e.options,"debugTable",0,()=>e._autoResetPageIndex()))}function ni(){return e=>gn(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||null==t||!t.length)return n;const i=e.getState().sorting,o=[],s=i.filter(t=>{var n;return null==(n=e.getColumn(t.id))?void 0:n.getCanSort()}),l={};s.forEach(t=>{const n=e.getColumn(t.id);n&&(l[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})});const r=e=>{const t=e.map(e=>({...e}));return t.sort((e,t)=>{for(let i=0;i<s.length;i+=1){var n;const o=s[i],r=l[o.id],a=r.sortUndefined,u=null!=(n=null==o?void 0:o.desc)&&n;let d=0;if(a){const n=void 0===e.getValue(o.id),i=void 0===t.getValue(o.id);if(n||i){if("first"===a)return n?-1:1;if("last"===a)return n?1:-1;d=n&&i?0:n?a:-a}}if(0===d&&(d=r.sortingFn(e,t,o.id)),0!==d)return u&&(d*=-1),r.invertSorting&&(d*=-1),d}return e.index-t.index}),t.forEach(e=>{var t;o.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=r(e.subRows))}),t};return{rows:r(n.rows),flatRows:o,rowsById:n.rowsById}},pn(e.options,"debugTable",0,()=>e._autoResetPageIndex()))} 12/** 13 * react-table 14 * 15 * Copyright (c) TanStack 16 * 17 * This source code is licensed under the MIT license found in the 18 * LICENSE.md file in the root directory of this source tree. 19 * 20 * @license MIT 21 */function ii(e,t){return e?function(e){return"function"==typeof e&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}(n=e)||"function"==typeof n||function(e){return"object"==typeof e&&"symbol"==typeof e.$$typeof&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}(n)?je.createElement(e,t):e:null;var n}function oi(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=je.useState(()=>({current:ei(t)})),[i,o]=je.useState(()=>n.current.initialState);return n.current.setOptions(t=>({...t,...e,state:{...i,...e.state},onStateChange:t=>{o(t),null==e.onStateChange||e.onStateChange(t)}
21})),n.current}export{Dt as Q,kt as a,an as b,jt as c,oi as d,un as e,ii as f,ti as g,ni as h,Ut as i,ln as j,Rt as n,rn as u}; 22//# sourceMappingURL=query-D6Z9akkj.js.map
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.