1import{T as e,r as t}from"./vendor.D5UN7VOE.js";class n{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){const t={listener:e};return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}const o="undefined"==typeof window||"Deno"in window;function l(){}function i(e){return"number"==typeof e&&e>=0&&e!==1/0}function s(e,t){return e.filter((e=>!t.includes(e)))}function r(e,t){return Math.max(e+(t||0)-Date.now(),0)}function a(e,t,n){return C(e)?"function"==typeof t?{...n,queryKey:e,queryFn:t}:{...t,queryKey:e}:e}function u(e,t,n){return C(e)?[{...t,queryKey:e},n]:[e||{},t]}function d(e,t){const{type:n="all",exact:o,fetchStatus:l,predicate:i,queryKey:s,stale:r}=e;if(C(s))if(o){if(t.queryHash!==c(s,t.options))return!1}else if(!f(t.queryKey,s))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)&&((void 0===l||l===t.state.fetchStatus)&&!(i&&!i(t)))}function g(e,t){const{exact:n,fetching:o,predicate:l,mutationKey:i}=e;if(C(i)){if(!t.options.mutationKey)return!1;if(n){if(h(t.options.mutationKey)!==h(i))return!1}else if(!f(t.options.mutationKey,i))return!1}return("boolean"!=typeof o||"loading"===t.state.status===o)&&!(l&&!l(t))}function c(e,t){return((null==t?void 0:t.queryKeyHashFn)||h)(e)}function h(e){return JSON.stringify(e,((e,t)=>S(t)?Object.keys(t).sort().reduce(((e,n)=>(e[n]=t[n],e)),{}):t))}function f(e,t){return p(e,t)}function p(e,t){return e===t||typeof e==typeof t&&(!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&!Object.keys(t).some((n=>!p(e[n],t[n]))))}function m(e,t){if(e===t)return e;const n=b(e)&&b(t);if(n||S(e)&&S(t)){const o=n?e.length:Object.keys(e).length,l=n?t:Object.keys(t),i=l.length,s=n?[]:{};let r=0;for(let a=0;a<i;a++){const o=n?a:l[a];s[o]=m(e[o],t[o]),s[o]===e[o]&&r++}return o===i&&r===o?e:s}return t}function v(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function b(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function S(e){if(!w(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!!w(n)&&!!n.hasOwnProperty("isPrototypeOf")}function w(e){return"[object Object]"===Object.prototype.toString.call(e)}function C(e){return Array.isArray(e)}function R(e){return new Promise((t=>{setTimeout(t,e)}))}function y(e){R(0).then(e)}function F(e,t,n){return null!=n.isDataEqual&&n.isDataEqual(e,t)?e:"function"==typeof n.structuralSharing?n.structuralSharing(e,t):!1!==n.structuralSharing?m(e,t):t}const M=new class extends n{constructor(){super(),this.setup=e=>{if(!o&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),window.addEventListener("focus",t,!1),()=>{window.removeEventListener("visibilitychange",t),window.removeEventListener("focus",t)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){var e;this.hasListeners()||(null==(e=this.cleanup)||e.call(this),this.cleanup=void 0)}setEventListener(e){var t;this.setup=e,null==(t=this.cleanup)||t.call(this),this.cleanup=e((e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()}))}setFocused(e){this.focused!==e&&(this.focused=e,this.onFocus())}onFocus(){this.listeners.forEach((({listener:e})=>{e()}))}isFocused(){return"boolean"==typeof this.focused?this.focused:"undefined"==typeof document||[void 0,"visible","prerender"].includes(document.visibilityState)}},P=["online","offline"];const x=new class extends n{constructor(){super(),this.setup=e=>{if(!o&&window.addEventListener){const t=()=>e();return P.forEach((e=>{window.addEventListener(e,t,!1)})),()=>{P.forEach((e=>{window.removeEventListener(e,t)}))}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){var e;this.hasListeners()||(null==(e=this.cleanup)||e.call(this),this.cleanup=void 0)}setEventListener(e){var t;this.setup=e,null==(t=this.cleanup)||t.call(this),this.cleanup=e((e=>{"boolean"==typeof e?this.setOnline(e):this.onOnline()}))}setOnline(e){this.online!==e&&(this.online=e,this.onOnline())}
1onOnline(){this.listeners.forEach((({listener:e})=>{e()}))}isOnline(){return"boolean"==typeof this.online?this.online:"undefined"==typeof navigator||void 0===navigator.onLine||navigator.onLine}};function I(e){return Math.min(1e3*2**e,3e4)}function E(e){return"online"!==(null!=e?e:"online")||x.isOnline()}class O{constructor(e){this.revert=null==e?void 0:e.revert,this.silent=null==e?void 0:e.silent}}function V(e){return e instanceof O}function A(e){let t,n,o,l=!1,i=0,s=!1;const r=new Promise(((e,t)=>{n=e,o=t})),a=()=>!M.isFocused()||"always"!==e.networkMode&&!x.isOnline(),u=o=>{s||(s=!0,null==e.onSuccess||e.onSuccess(o),null==t||t(),n(o))},d=n=>{s||(s=!0,null==e.onError||e.onError(n),null==t||t(),o(n))},g=()=>new Promise((n=>{t=e=>{const t=s||!a();return t&&n(e),t},null==e.onPause||e.onPause()})).then((()=>{t=void 0,s||null==e.onContinue||e.onContinue()})),c=()=>{if(s)return;let t;try{t=e.fn()}catch(n){t=Promise.reject(n)}Promise.resolve(t).then(u).catch((t=>{var n,o;if(s)return;const r=null!=(n=e.retry)?n:3,u=null!=(o=e.retryDelay)?o:I,h="function"==typeof u?u(i,t):u,f=!0===r||"number"==typeof r&&i<r||"function"==typeof r&&r(i,t);!l&&f?(i++,null==e.onFail||e.onFail(i,t),R(h).then((()=>
1{if(a())return g()})).then((()=>{l?d(t):c()}))):d(t)}))};return E(e.networkMode)?c():g().then(c),{promise:r,cancel:t=>{s||(d(new O(t)),null==e.abort||e.abort())},continue:()=>(null==t?void 0:t())?r:Promise.resolve(),cancelRetry:()=>{l=!0},continueRetry:()=>{l=!1}}}const _=console;const D=function(){let e=[],t=0,n=e=>{e()},o=e=>{e()};const l=o=>{t?e.push(o):y((()=>{n(o)}))},i=()=>{const t=e;e=[],t.length&&y((()=>{o((()=>{t.forEach((e=>{n(e)}))}))}))};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||i()}return n},batchCalls:e=>(...t)=>{l((()=>{e(...t)}))},schedule:l,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{o=e}}}();class z{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),i(this.cacheTime)&&(this.gcTimeout=setTimeout((()=>{this.optionalRemove()}),this.cacheTime))}updateCacheTime(e){this.cacheTime=Math.max(this.cacheTime||0,null!=e?e:o?1/0:3e5)}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class L extends z{constructor(e){super(),this.abortSignalConsumed=!1,this.defaultOptions=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.cache=e.cache,this.logger=e.logger||_,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.initialState=e.state||function(e){const t="function"==typeof e.initialData?e.initialData():e.initialData,n=void 0!==t,o=n?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?null!=o?o:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"loading",fetchStatus:"idle"}}(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(e){this.options={...this.defaultOptions,...e},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.cache.remove(this)}setData(e,t){const n=F(this.state.data,e,this.options);return this.dispatch({data:n,type:"success",dataUpdatedAt:null==t?void 0:t.updatedAt,manual:null==t?void 0:t.manual}),n}setState(e,t){this.dispatch({type:"setState",state:e,setStateOptions:t})}cancel(e){var t;const n=this.promise;return null==(t=this.retryer)||t.cancel(e),n?n.then(l).catch(l):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some((e=>!1!==e.options.enabled))}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some((e=>e.getCurrentResult().isStale))}isStaleByTime(e=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!r(this.state.dataUpdatedAt,e)}onFocus(){var e;const t=this.observers.find((e=>e.shouldFetchOnWindowFocus()));t&&t.refetch({cancelRefetch:!1}),null==(e=this.retryer)||e.continue()}onOnline(){var e;const t=this.observers.find((e=>e.shouldFetchOnReconnect()));t&&t.refetch({cancelRefetch:!1}),null==(e=this.retryer)||e.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter((t=>t!==e)),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(e,t){var n,o;if("idle"!==this.state.fetchStatus)if(this.state.dataUpdatedAt&&null!=t&&t.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var l;return null==(l=this.retryer)||l.continueRetry(),this.promise}if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find((e=>e.options.queryFn));e&&this.setOptions(e.options)}const i=function(){if("function"==typeof AbortController)return new AbortController}(),s={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>
1{if(i)return this.abortSignalConsumed=!0,i.signal}})};r(s);const a={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(s)):Promise.reject("Missing queryFn for queryKey '"+this.options.queryHash+"'")};var u;(r(a),null==(n=this.options.behavior)||n.onFetch(a),this.revertState=this.state,"idle"===this.state.fetchStatus||this.state.fetchMeta!==(null==(o=a.fetchOptions)?void 0:o.meta))&&this.dispatch({type:"fetch",meta:null==(u=a.fetchOptions)?void 0:u.meta});const d=e=>{var t,n,o,l;(V(e)&&e.silent||this.dispatch({type:"error",error:e}),V(e))||(null==(t=(n=this.cache.config).onError)||t.call(n,e,this),null==(o=(l=this.cache.config).onSettled)||o.call(l,this.state.data,e,this));this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=A({fn:a.fetchFn,abort:null==i?void 0:i.abort.bind(i),onSuccess:e=>{var t,n,o,l;void 0!==e?(this.setData(e),null==(t=(n=this.cache.config).onSuccess)||t.call(n,e,this),null==(o=(l=this.cache.config).onSettled)||o.call(l,e,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1):d(new Error(this.queryHash+" data is undefined"))},onError:d,onFail:(e,t)=>{this.dispatch({type:"failed",failureCount:e,error:t})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(e){this.state=(t=>{var n,o;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,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null!=(n=e.meta)?n:null,fetchStatus:E(this.options.networkMode)?"fetching":"paused",...!t.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:null!=(o=e.dataUpdatedAt)?o:Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const l=e.error;return V(l)&&l.revert&&this.revertState?{...this.revertState,fetchStatus:"idle"}:{...t,error:l,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:l,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),D.batch((()=>{this.observers.forEach((t=>{t.onQueryUpdate(e)})),this.cache.notify({query:this,type:"updated",action:e})}))}}class G extends n{constructor(e){super(),this.config=e||{},this.queries=[],this.queriesMap={}}build(e,t,n){var o;const l=t.queryKey,i=null!=(o=t.queryHash)?o:c(l,t);let s=this.get(i);return s||(s=new L({cache:this,logger:e.getLogger(),queryKey:l,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(l)}),this.add(s)),s}add(e){this.queriesMap[e.queryHash]||(this.queriesMap[e.queryHash]=e,this.queries.push(e),this.notify({type:"added",query:e}))}remove(e){const t=this.queriesMap[e.queryHash];t&&(e.destroy(),this.queries=this.queries.filter((t=>t!==e)),t===e&&delete this.queriesMap[e.queryHash],this.notify({type:"removed",query:e}))}clear(){D.batch((()=>{this.queries.forEach((e=>{this.remove(e)}))}))}get(e){return this.queriesMap[e]}getAll(){return this.queries}find(e,t){const[n]=u(e,t);return void 0===n.exact&&(n.exact=!0),this.queries.find((e=>d(n,e)))}findAll(e,t){const[n]=u(e,t);return Object.keys(n).length>0?this.queries.filter((e=>d(n,e))):this.queries}notify(e){D.batch((()=>{this.listeners.forEach((({listener:t})=>{t(e)}))}))}onFocus(){D.batch((()=>{this.queries.forEach((e=>{e.onFocus()}))}))}onOnline(){D.batch((()=>{this.queries.forEach((e=>{e.onOnline()}))}))}}class H extends z{constructor(e){super(),this.defaultOptions=e.defaultOptions,this.mutationId=e.mutationId,this.mutationCache=e.mutationCache,this.logger=e.logger||_,this.observers=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options={...this.defaultOptions,...e},this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(e){this.dispatch({type:"setState",state:e})}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.observers=this.observers.filter((t=>t!==e)),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.observers.length||("loading"===this.state.status?this.scheduleGc():this.mutationCache.remove(this))}continue(){var e,t;return null!=(e=null==(t=this.retryer)?void 0:t.continue())?e:this.execute()}async execute(){const e=()=>{var e;return this.retryer=A({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(e,t)=>{this.dispatch({type:"failed",failureCount:e,error:t})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:null!=(e=this.options.retry)?e:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},t="loading"===this.state.status;try{var n,o,l,i,s,r,a,u;if(!t){var d,g,c,h;this.dispatch({type:"loading",variables:this.options.variables}),await(null==(d=(g=this.mutationCache.config).onMutate)?void 0:d.call(g,this.state.variables,this));const e=await(null==(c=(h=this.options).onMutate)?void 0:c.call(h,this.state.variables));e!==this.state.context&&this.dispatch({type:"loading",context:e,variables:this.state.variables})}const f=await e();return await(null==(n=(o=this.mutationCache.config).onSuccess)?void 0:n.call(o,f,this.state.variables,this.state.context,this)),await(null==(l=(i=this.options).onSuccess)?void 0:l.call(i,f,this.state.variables,this.state.context)),await(null==(s=(r=this.mutationCache.config).onSettled)?void 0:s.call(r,f,null,this.state.variables,this.state.context,this)),await(null==(a=(u=this.options).onSettled)?void 0:a.call(u,f,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:f}),f}catch(R){try{var f,p,m,v,b,S,w,C;throw await(null==(f=(p=this.mutationCache.config).onError)?void 0:f.call(p,R,this.state.variables,this.state.context,this)),await(null==(m=(v=this.options).onError)?void 0:m.call(v,R,this.state.variables,this.state.context)),await(null==(b=(S=this.mutationCache.config).onSettled)?void 0:b.call(S,void 0,R,this.state.variables,this.state.context,this)),await(null==(w=(C=this.options).onSettled)?void 0:w.call(C,void 0,R,this.state.variables,this.state.context)),R}finally{this.dispatch({type:"error",error:R})}}}dispatch(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"loading":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!E(this.options.networkMode),status:"loading",variables:e.variables};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,isPau
1sed:!1,status:"error"};case"setState":return{...t,...e.state}}})(this.state),D.batch((()=>{this.observers.forEach((t=>{t.onMutationUpdate(e)})),this.mutationCache.notify({mutation:this,type:"updated",action:e})}))}}class q extends n{constructor(e){super(),this.config=e||{},this.mutations=[],this.mutationId=0}build(e,t,n){const o=new H({mutationCache:this,logger:e.getLogger(),mutationId:++this.mutationId,options:e.defaultMutationOptions(t),state:n,defaultOptions:t.mutationKey?e.getMutationDefaults(t.mutationKey):void 0});return this.add(o),o}add(e){this.mutations.push(e),this.notify({type:"added",mutation:e})}remove(e){this.mutations=this.mutations.filter((t=>t!==e)),this.notify({type:"removed",mutation:e})}clear(){D.batch((()=>{this.mutations.forEach((e=>{this.remove(e)}))}))}getAll(){return this.mutations}find(e){return void 0===e.exact&&(e.exact=!0),this.mutations.find((t=>g(e,t)))}findAll(e){return this.mutations.filter((t=>g(e,t)))}notify(e){D.batch((()=>{this.listeners.forEach((({listener:t})=>{t(e)}))}))}resumePausedMutations(){var e;return this.resuming=(null!=(e=this.resuming)?e:Promise.resolve()).then((()=>{const e=this.mutations.filter((e=>
1e.state.isPaused));return D.batch((()=>e.reduce(((e,t)=>e.then((()=>t.continue().catch(l)))),Promise.resolve())))})).then((()=>{this.resuming=void 0})),this.resuming}}function k(){return{onFetch:e=>{e.fetchFn=()=>{var t,n,o,l,i,s;const r=null==(t=e.fetchOptions)||null==(n=t.meta)?void 0:n.refetchPage,a=null==(o=e.fetchOptions)||null==(l=o.meta)?void 0:l.fetchMore,u=null==a?void 0:a.pageParam,d="forward"===(null==a?void 0:a.direction),g="backward"===(null==a?void 0:a.direction),c=(null==(i=e.state.data)?void 0:i.pages)||[],h=(null==(s=e.state.data)?void 0:s.pageParams)||[];let f=h,p=!1;const m=e.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+e.options.queryHash+"'")),v=(e,t,n,o)=>(f=o?[t,...f]:[...f,t],o?[n,...e]:[...e,n]),b=(t,n,o,l)=>{if(p)return Promise.reject("Cancelled");if(void 0===o&&!n&&t.length)return Promise.resolve(t);const i={queryKey:e.queryKey,pageParam:o,meta:e.options.meta};var s;s=i,Object.defineProperty(s,"signal",{enumerable:!0,get:()=>{var t,n;return null!=(t=e.signal)&&t.aborted?p=!0:null==(n=e.signal)||n.addEventListener("abort",(()=>{p=!0})),e.signal}});const r=m(i);return Promise.resolve(r).then((e=>v(t,o,e,l)))};let S;if(c.length)if(d){const t=void 0!==u,n=t?u:T(e.options,c);S=b(c,t,n)}else if(g){const t=void 0!==u,n=t?u:B(e.options,c);S=b(c,t,n,!0)}else{f=[];const t=void 0===e.options.getNextPageParam;S=!r||!c[0]||r(c[0],0,c)?b([],t,h[0]):Promise.resolve(v([],h[0],c[0]));for(let n=1;n<c.length;n++)S=S.then((o=>{if(!r||!c[n]||r(c[n],n,c)){const l=t?h[n]:T(e.options,o);return b(o,t,l)}return Promise.resolve(v(o,h[n],c[n]))}))}else S=b([]);return S.then((e=>({pages:e,pageParams:f})))}}}}function T(e,t){return null==e.getNextPageParam?void 0:e.getNextPageParam(t[t.length-1],t)}function B(e,t){return null==e.getPreviousPageParam?void 0:e.getPreviousPageParam(t[0],t)}function Q(e,t){if(e.getNextPageParam&&Array.isArray(t)){const n=T(e,t);return null!=n&&!1!==n}}function U(e,t){if(e.getPreviousPageParam&&Array.isArray(t)){const n=B(e,t);return null!=n&&!1!==n}}class j{constructor(e={}){this.queryCache=e.queryCache||new G,this.mutationCache=e.mutationCache||new q,this.logger=e.logger||_,this.defaultOptions=e.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,1===this.mountCount&&(this.unsubscribeFocus=M.subscribe((()=>{M.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())})),this.unsubscribeOnline=x.subscribe((()=>{x.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())})))}unmount(){var e,t;this.mountCount--,0===this.mountCount&&(null==(e=this.unsubscribeFocus)||e.call(this),this.unsubscribeFocus=void 0,null==(t=this.unsubscribeOnline)||t.call(this),this.unsubscribeOnline=void 0)}isFetching(e,t){const[n]=u(e,t);return n.fetchStatus="fetching",this.queryCache.findAll(n).length}isMutating(e){return this.mutationCache.findAll({...e,fetching:!0}).length}getQueryData(e,t){var n;return null==(n=this.queryCache.find(e,t))?void 0:n.state.data}ensureQueryData(e,t,n){const o=a(e,t,n),l=this.getQueryData(o.queryKey);return l?Promise.resolve(l):this.fetchQuery(o)}getQueriesData(e){return this.getQueryCache().findAll(e).map((({queryKey:e,state:t})=>[e,t.data]))}setQueryData(e,t,n){const o=this.queryCache.find(e),l=function(e,t){return"function"==typeof e?e(t):e}(t,null==o?void 0:o.state.data);if(void 0===l)return;const i=a(e),s=this.defaultQueryOptions(i);return this.queryCache.build(this,s).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return D.batch((()=>this.getQueryCache().findAll(e).map((({queryKey:e})=>[e,this.setQueryData(e,t,n)]))))}getQueryState(e,t){var n;return null==(n=this.queryCache.find(e,t))?void 0:n.state}removeQueries(e,t){const[n]=u(e,t),o=this.queryCache;D.batch((()=>{o.findAll(n).forEach((e=>{o.remove(e)}))}))}resetQueries(e,t,n){const[o,l]=u(e,t,n),i=this.queryCache,s={type:"active",...o};return D.batch((()=>(i.findAll(o).forEach((e=>{e.reset()})),this.refetchQueries(s,l))))}cancelQueries(e,t,n){const[o,i={}]=u(e,t,n);void 0===i.revert&&(i.revert=!0);const s=D.batch((()=>this.queryCache.findAll(o).map((e=>e.cancel(i)))));return Promise.all(s).then(l).catch(l)}invalidateQueries(e,t,n){const[o,l]=u(e,t,n);return D.batch((()=>{var e,t;
1if(this.queryCache.findAll(o).forEach((e=>{e.invalidate()})),"none"===o.refetchType)return Promise.resolve();const n={...o,type:null!=(e=null!=(t=o.refetchType)?t:o.type)?e:"active"};return this.refetchQueries(n,l)}))}refetchQueries(e,t,n){const[o,i]=u(e,t,n),s=D.batch((()=>this.queryCache.findAll(o).filter((e=>!e.isDisabled())).map((e=>{var t;return e.fetch(void 0,{...i,cancelRefetch:null==(t=null==i?void 0:i.cancelRefetch)||t,meta:{refetchPage:o.refetchPage}})}))));let r=Promise.all(s).then(l);return null!=i&&i.throwOnError||(r=r.catch(l)),r}fetchQuery(e,t,n){const o=a(e,t,n),l=this.defaultQueryOptions(o);void 0===l.retry&&(l.retry=!1);const i=this.queryCache.build(this,l);return i.isStaleByTime(l.staleTime)?i.fetch(l):Promise.resolve(i.state.data)}prefetchQuery(e,t,n){return this.fetchQuery(e,t,n).then(l).catch(l)}fetchInfiniteQuery(e,t,n){const o=a(e,t,n);return o.behavior=k(),this.fetchQuery(o)}prefetchInfiniteQuery(e,t,n){return this.fetchInfiniteQuery(e,t,n).then(l).catch(l)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(e){this.defaultOptions=e}setQueryDefaults(e,t){const n=this.queryDefaults.find((t=>h(e)===h(t.queryKey)));n?n.defaultOptions=t:this.queryDefaults.push({queryKey:e,defaultOptions:t})}getQueryDefaults(e){if(!e)return;const t=this.queryDefaults.find((t=>f(e,t.queryKey)));return null==t?void 0:t.defaultOptions}setMutationDefaults(e,t){const n=this.mutationDefaults.find((t=>h(e)===h(t.mutationKey)));n?n.defaultOptions=t:this.mutationDefaults.push({mutationKey:e,defaultOptions:t})}getMutationDefaults(e){if(!e)return;const t=this.mutationDefaults.find((t=>f(e,t.mutationKey)));return null==t?void 0:t.defaultOptions}defaultQueryOptions(e){if(null!=e&&e._defaulted)return e;const t={...this.defaultOptions.queries,...this.getQueryDefaults(null==e?void 0:e.queryKey),...e,_defaulted:!0};return!t.queryHash&&t.queryKey&&(t.queryHash=c(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.useErrorBoundary&&(t.useErrorBoundary=!!t.suspense),t}defaultMutationOptions(e){return null!=e&&e._defaulted?e:{...this.defaultOptions.mutations,...this.getMutationDefaults(null==e?void 0:e.mutationKey),...e,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}class N extends n{constructor(e,t){super(),this.client=e,this.options=t,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.currentQuery.addObserver(this),K(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return $(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return $(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(e,t){const n=this.options,o=this.currentQuery;if(this.options=this.client.defaultQueryOptions(e),v(n,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled)throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=n.queryKey),this.updateQuery();const l=this.hasListeners();l&&W(this.currentQuery,o,this.options,n)&&this.executeFetch(),this.updateResult(t),!l||this.currentQuery===o&&this.options.enabled===n.enabled&&this.options.staleTime===n.staleTime||this.updateStaleTimeout();const i=this.computeRefetchInterval();!l||this.currentQuery===o&&this.options.enabled===n.enabled&&i===this.currentRefetchInterval||this.updateRefetchInterval(i)}getOptimisticResult(e){const t=this.client.getQueryCache().build(this.client,e),n=this.createResult(t,e);return function(e,t,n){if(n.keepPreviousData)return!1;if(void 0!==n.placeholderData)return t.isPlaceholderData;if(!v(e.getCurrentResult(),t))return!0;return!1}(this,n,e)&&(this.currentResult=n,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),n}getCurrentResult(){return this.currentResult}trackResult(e){const t={};return Object.keys(e).forEach((n=>{Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(n),e[n])})})),t}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:e,...t}={}){return this.fetch({...t,meta:{refetchPage:e}})}fetchOptimistic(e){const t=this.client.defaultQueryOptions(e),n=this.client.getQueryCache().build(this.client,t);return n.isFetchingOptimistic=!0,n.fetch().then((()=>this.createResult(n,t)))}fetch(e){var t;return this.executeFetch({...e,cancelRefetch:null==(t=e.cancelRefetch)||t}).then((()=>(this.updateResult(),this.currentResult)))}executeFetch(e){this.updateQuery();let t=this.currentQuery.fetch(this.options,e);return null!=e&&e.throwOnError||(t=t.catch(l)),t}updateStaleTimeout(){if(this.clearStaleTimeout(),o||this.currentResult.isStale||!i(this.options.staleTime))return;const e=r(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout((()=>{this.currentResult.isStale||this.updateResult()}),e)}computeRefetchInterval(){var e;return"function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.currentResult.data,this.currentQuery):null!=(e=this.options.refetchInterval)&&e}updateRefetchInterval(e){this.clearRefetchInterval(),this.currentRefetchInterval=e,!o&&!1!==this.options.enabled&&i(this.currentRefetchInterval)&&0!==this.currentRefetchInterval&&(this.refetchIntervalId=setInterval((()=>
1{(this.options.refetchIntervalInBackground||M.isFocused())&&this.executeFetch()}),this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(e,t){const n=this.currentQuery,o=this.options,l=this.currentResult,i=this.currentResultState,s=this.currentResultOptions,r=e!==n,a=r?e.state:this.currentQueryInitialState,u=r?this.currentResult:this.previousQueryResult,{state:d}=e;let g,{dataUpdatedAt:c,error:h,errorUpdatedAt:f,fetchStatus:p,status:m}=d,v=!1,b=!1;if(t._optimisticResults){const l=this.hasListeners(),i=!l&&K(e,t),s=l&&W(e,n,t,o);(i||s)&&(p=E(e.options.networkMode)?"fetching":"paused",c||(m="loading")),"isRestoring"===t._optimisticResults&&(p="idle")}if(t.keepPreviousData&&!d.dataUpdatedAt&&null!=u&&u.isSuccess&&"error"!==m)g=u.data,c=u.dataUpdatedAt,m=u.status,v=!0;else if(t.select&&void 0!==d.data)if(l&&d.data===(null==i?void 0:i.data)&&t.select===this.selectFn)g=this.selectResult;else try{this.selectFn=t.select,g=t.select(d.data),g=F(null==l?void 0:l.data,g,t),this.selectResult=g,this.selectError=null}catch(R){this.selectError=R}else g=d.data;if(void 0!==t.placeholderData&&void 0===g&&"loading"===m){let e;if(null!=l&&l.isPlaceholderData&&t.placeholderData===(null==s?void 0:s.placeholderData))e=l.data;else if(e="function"==typeof t.placeholderData?t.placeholderData():t.placeholderData,t.select&&void 0!==e)try{e=t.select(e),this.selectError=null}catch(R){this.selectError=R}void 0!==e&&(m="success",g=F(null==l?void 0:l.data,e,t),b=!0)}this.selectError&&(h=this.selectError,g=this.selectResult,f=Date.now(),m="error");const S="fetching"===p,w="loading"===m,C="error"===m;return{status:m,fetchStatus:p,isLoading:w,isSuccess:"success"===m,isError:C,isInitialLoading:w&&S,data:g,dataUpdatedAt:c,error:h,errorUpdatedAt:f,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>a.dataUpdateCount||d.errorUpdateCount>a.errorUpdateCount,isFetching:S,isRefetching:S&&!w,isLoadingError:C&&0===d.dataUpdatedAt,isPaused:"paused"===p,isPlaceholderData:b,isPreviousData:v,isRefetchError:C&&0!==d.dataUpdatedAt,isStale:X(e,t),refetch:this.refetch,remove:this.remove}}updateResult(e){const t=this.currentResult,n=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,v(n,t))return;this.currentResult=n;const o={cache:!0};!1!==(null==e?void 0:e.listeners)&&(()=>{if(!t)return!0;const{notifyOnChangeProps:e}=this.options,n="function"==typeof e?e():e;if("all"===n||!n&&!this.trackedProps.size)return!0;const o=new Set(null!=n?n:this.trackedProps);return this.options.useErrorBoundary&&o.add("error"),Object.keys(this.currentResult).some((e=>{const n=e;return this.currentResult[n]!==t[n]&&o.has(n)}))})()&&(o.listeners=!0),this.notify({...o,...e})}updateQuery(){const e=this.client.getQueryCache().build(this.client,this.options);if(e===this.currentQuery)return;const t=this.currentQuery;this.currentQuery=e,this.currentQueryInitialState=e.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(null==t||t.removeObserver(this),e.addObserver(this))}onQueryUpdate(e){const t={};"success"===e.type?t.onSuccess=!e.manual:"error"!==e.type||V(e.error)||(t.onError=!0),this.updateResult(t),this.hasListeners()&&this.updateTimers()}notify(e){D.batch((()=>{var t,n,o,l;if(e.onSuccess)null==(t=(n=this.options).onSuccess)||t.call(n,this.currentResult.data),null==(o=(l=this.options).onSettled)||o.call(l,this.currentResult.data,null);else if(e.onError){var i,s,r,a;null==(i=(s=this.options).onError)||i.call(s,this.currentResult.error),null==(r=(a=this.options).onSettled)||r.call(a,void 0,this.currentResult.error)}e.listeners&&this.listeners.forEach((({listener:e})=>{e(this.currentResult)})),e.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})}))}}function K(e,t){return function(e,t){return!(!1===t.enabled||e.state.dataUpdatedAt||"error"===e.state.status&&!1===t.retryOn
1Mount)}(e,t)||e.state.dataUpdatedAt>0&&$(e,t,t.refetchOnMount)}function $(e,t,n){if(!1!==t.enabled){const o="function"==typeof n?n(e):n;return"always"===o||!1!==o&&X(e,t)}return!1}function W(e,t,n,o){return!1!==n.enabled&&(e!==t||!1===o.enabled)&&(!n.suspense||"error"!==e.state.status)&&X(e,n)}function X(e,t){return e.isStaleByTime(t.staleTime)}class J extends n{constructor(e,t){super(),this.client=e,this.queries=[],this.result=[],this.observers=[],this.observersMap={},t&&this.setQueries(t)}onSubscribe(){1===this.listeners.size&&this.observers.forEach((e=>{e.subscribe((t=>{this.onUpdate(e,t)}))}))}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.observers.forEach((e=>{e.destroy()}))}setQueries(e,t){this.queries=e,D.batch((()=>{const e=this.observers,n=this.findMatchingObservers(this.queries);n.forEach((e=>e.observer.setOptions(e.defaultedQueryOptions,t)));const o=n.map((e=>e.observer)),l=Object.fromEntries(o.map((e=>[e.options.queryHash,e]))),i=o.map((e=>e.getCurrentResult())),r=o.some(((t,n)=>t!==e[n]));(e.length!==o.length||r)&&(this.observers=o,this.observersMap=l,this.result=i,this.hasListeners()&&(s(e,o).forEac
1h((e=>{e.destroy()})),s(o,e).forEach((e=>{e.subscribe((t=>{this.onUpdate(e,t)}))})),this.notify()))}))}getCurrentResult(){return this.result}getQueries(){return this.observers.map((e=>e.getCurrentQuery()))}getObservers(){return this.observers}getOptimisticResult(e){return this.findMatchingObservers(e).map((e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)))}findMatchingObservers(e){const t=this.observers,n=new Map(t.map((e=>[e.options.queryHash,e]))),o=e.map((e=>this.client.defaultQueryOptions(e))),l=o.flatMap((e=>{const t=n.get(e.queryHash);return null!=t?[{defaultedQueryOptions:e,observer:t}]:[]})),i=new Set(l.map((e=>e.defaultedQueryOptions.queryHash))),s=o.filter((e=>!i.has(e.queryHash))),r=new Set(l.map((e=>e.observer))),a=t.filter((e=>!r.has(e))),u=e=>{const t=this.client.defaultQueryOptions(e),n=this.observersMap[t.queryHash];return null!=n?n:new N(this.client,t)},d=s.map(((e,t)=>{if(e.keepPreviousData){const n=a[t];if(void 0!==n)return{defaultedQueryOptions:e,observer:n}}return{defaultedQueryOptions:e,observer:u(e)}}));return l.concat(d).sort(((e,t)=>o.indexOf(e.defaultedQueryOptions)-o.indexOf(t.defaultedQueryOptions)))}onUpdate(e,t){const n=this.observers.indexOf(e);-1!==n&&(this.result=function(e,t,n){const o=e.slice(0);return o[t]=n,o}(this.result,n,t),this.notify())}notify(){D.batch((()=>{this.listeners.forEach((({listener:e})=>{e(this.result)}))}))}}class Y extends N{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e,t){super.setOptions({...e,behavior:k()},t)}getOptimisticResult(e){return e.behavior=k(),super.getOptimisticResult(e)}fetchNextPage({pageParam:e,...t}={}){return this.fetch({...t,meta:{fetchMore:{direction:"forward",pageParam:e}}})}fetchPreviousPage({pageParam:e,...t}={}){return this.fetch({...t,meta:{fetchMore:{direction:"backward",pageParam:e}}})}createResult(e,t){var n,o,l,i,s,r;const{state:a}=e,u=super.createResult(e,t),{isFetching:d,isRefetching:g}=u,c=d&&"forward"===(null==(n=a.fetchMeta)||null==(o=n.fetchMore)?void 0:o.direction),h=d&&"backward"===(null==(l=a.fetchMeta)||null==(i=l.fetchMore)?void 0:i.direction);return{...u,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Q(t,null==(s=a.data)?void 0:s.pages),hasPreviousPage:U(t,null==(r=a.data)?void 0:r.pages),isFetchingNextPage:c,isFetchingPreviousPage:h,isRefetching:g&&!c&&!h}}}class Z extends n{constructor(e,t){super(),this.client=e,this.setOptions(t),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var t;const n=this.options;this.options=this.client.defaultMutationOptions(e),v(n,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this}),null==(t=this.currentMutation)||t.setOptions(this.options)}onUnsubscribe(){var e;this.hasListeners()||(null==(e=this.currentMutation)||e.removeObserver(this))}onMutationUpdate(e){this.updateResult();const t={listeners:!0};"success"===e.type?t.onSuccess=!0:"error"===e.type&&(t.onError=!0),this.notify(t)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(e,t){return this.mutateOptions=t,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:void 0!==e?e:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){const e=this.currentMutation?this.currentMutation.state:{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0},t={...e,isLoading:"loading"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset};this.currentResult=t}notify(e){D.batch((()=>{var t,n,o,l;if(this.mutateOptions&&this.hasListeners())if(e.onSuccess)null==(t=(n=this.mutateOptions).onSuccess)||t.call(n,this.currentResult.data,this.currentResult.variables,this.currentResult.context),null==(o=(l=this.mutateOptions).onSettled)||o.call(l,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context);else if(e.onError){var i,s,r,a;null==(i=(s=this.mutateOptions).onError)||i.call(s,this.currentResult.error,this.currentResult.variables,this.currentResult.context),null==(r=(a=this.mutateOptions).onSettled)||r.call(a,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context)}
1e.listeners&&this.listeners.forEach((({listener:e})=>{e(this.currentResult)}))}))}}const ee=e.useSyncExternalStore,te=t.createContext(void 0),ne=t.createContext(!1);function oe(e,t){return e||(t&&"undefined"!=typeof window?(window.ReactQueryClientContext||(window.ReactQueryClientContext=te),window.ReactQueryClientContext):te)}const le=({context:e}={})=>{const n=t.useContext(oe(e,t.useContext(ne)));if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},ie=({client:e,children:n,context:o,contextSharing:l=!1})=>{t.useEffect((()=>(e.mount(),()=>{e.unmount()})),[e]);const i=oe(o,l);return t.createElement(ne.Provider,{value:!o&&l},t.createElement(i.Provider,{value:e},n))},se=t.createContext(!1),re=()=>t.useContext(se);se.Provider;const ae=t.createContext(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),ue=()=>t.useContext(ae);function de(e,t){return"function"==typeof e?e(...t):!!e}const ge=(e,t)=>{(e.suspense||e.useErrorBoundary)&&(t.isReset()||(e.retryOnMount=!1))},ce=e=>{t.useEffect((()=>{e.clearReset()}),[e])},he=({result:e,errorResetBoundary:t,useErrorBoundary:n,query:o})=>e.isError&&!t.isReset()&&!e.isFetching&&de(n,[e.error,o]),fe=e=>{e.suspense&&"number"!=typeof e.staleTime&&(e.staleTime=1e3)},pe=(e,t)=>e.isLoading&&e.isFetching&&!t,me=(e,t,n)=>(null==e?void 0:e.suspense)&&pe(t,n),ve=(e,t,n)=>t.fetchOptimistic(e).then((({data:t})=>{null==e.onSuccess||e.onSuccess(t),null==e.onSettled||e.onSettled(t,null)})).catch((t=>{n.clearReset(),null==e.onError||e.onError(t),null==e.onSettled||e.onSettled(void 0,t)}));function be({queries:e,context:n}){const o=le({context:n}),l=re(),i=ue(),s=t.useMemo((()=>e.map((e=>{const t=o.defaultQueryOptions(e);return t._optimisticResults=l?"isRestoring":"optimistic",t}))),[e,o,l]);s.forEach((e=>{fe(e),ge(e,i)})),ce(i);const[r]=t.useState((()=>new J(o,s))),a=r.getOptimisticResult(s);ee(t.useCallback((e=>l?()=>{}:r.subscribe(D.batchCalls(e))),[r,l]),(()=>r.getCurrentResult()),(()=>r.getCurrentResult())),t.useEffect((()=>{r.setQueries(s,{listeners:!1})}),[s,r]);const u=a.some(((e,t)=>me(s[t],e,l)))?a.flatMap(((e,t)=>{const n=s[t],o=r.getObservers()[t];if(n&&o){if(me(n,e,l))return ve(n,o,i);pe(e,l)&&ve(n,o,i)}return[]})):[];if(u.length>0)throw Promise.all(u);const d=r.getQueries(),g=a.find(((e,t)=>{var n,o;return he({result:e,errorResetBoundary:i,useErrorBoundary:null!=(n=null==(o=s[t])?void 0:o.useErrorBoundary)&&n,query:d[t]})}));if(null!=g&&g.error)throw g.error;return a}function Se(e,n){const o=le({context:e.context}),l=re(),i=ue(),s=o.defaultQueryOptions(e);s._optimisticResults=l?"isRestoring":"optimistic",s.onError&&(s.onError=D.batchCalls(s.onError)),s.onSuccess&&(s.onSuccess=D.batchCalls(s.onSuccess)),s.onSettled&&(s.onSettled=D.batchCalls(s.onSettled)),fe(s),ge(s,i),ce(i);const[r]=t.useState((()=>new n(o,s))),a=r.getOptimisticResult(s);if(ee(t.useCallback((e=>{const t=l?()=>{}:r.subscribe(D.batchCalls(e));return r.updateResult(),t}),[r,l]),(()=>r.getCurrentResult()),(()=>r.getCurrentResult())),t.useEffect((()=>{r.setOptions(s,{listeners:!1})}),[s,r]),me(s,a,l))throw ve(s,r,i);if(he({result:a,errorResetBoundary:i,useErrorBoundary:s.useErrorBoundary,query:r.getCurrentQuery()}))throw a.error;return s.notifyOnChangeProps?a:r.trackResult(a)}function we(e,t,n){return Se(a(e,t,n),N)}function Ce(e,n,o){const l=function(e,t,n){return C(e)?"function"==typeof t?{...n,mutationKey:e,mutationFn:t}:{...t,mutationKey:e}:"function"==typeof e?{...t,mutationFn:e}:{...e}}(e,n,o),i=le({context:l.context}),[s]=t.useState((()=>new Z(i,l)));t.useEffect((()=>{s.setOptions(l)}),[s,l]);const r=ee(t.useCallback((e=>s.subscribe(D.batchCalls(e))),[s]),(()=>s.getCurrentResult()),(()=>s.getCurrentResult())),a=t.useCallback(((e,t)=>{s.mutate(e,t).catch(Re)}),[s]);if(r.error&&de(s.options.useErrorBoundary,[r.error]))throw r.error;return{...r,mutate:a,mutateAsync:r.mutate}}function Re(){}function ye(e,t,n){return Se(a(e,t,n),Y)}const Fe=function(){return null};function Me(e,t,n){let o,l=n.initialDeps??[],i=!0;function s(){var s,r,a;let u;n.key&&(null==(s=n.debug)?void 0:s.call(n))&&(u=Date.now());const d=e();if(!(d.length!==l.length||d.some(((e,t)=>l[t]!==e))))return o;let g;if(l=d,n.key&&(null==(r=n.debug)?void 0:r.call(n))&&(g=Date.now()),o=t(...d),n.key&&(null==(a=n.debug)?void 0:a.call(n))){const e=Math.round(100*(Date.now()-u))/100,t=Math.round(100*(Date.now()-g))/100,o=t/16,l=(e,t)=>
1{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%câ± ${l(t,5)} /${l(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*o,120))}deg 100% 31%);`,null==n?void 0:n.key)}return!(null==n?void 0:n.onChange)||i&&n.skipInitialOnChange||n.onChange(o),i=!1,o}return s.updateDeps=e=>{l=e},s}function Pe(e,t){if(void 0===e)throw new Error("Unexpected undefined");return e}const xe=(e,t,n)=>{let o;return function(...l){e.clearTimeout(o),o=e.setTimeout((()=>t.apply(this,l)),n)}},Ie=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Ee=e=>e,Oe=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),o=[];for(let l=t;l<=n;l++)o.push(l);return o},Ve=(e,t)=>{const n=e.scrollElement;if(!n)return;const o=e.targetWindow;if(!o)return;const l=e=>{const{width:n,height:o}=e;t({width:Math.round(n),height:Math.round(o)})};if(l(Ie(n)),!o.ResizeObserver)return()=>{};const i=new o.ResizeObserver((t=>{const o=()=>{const e=t[0];if(null==e?void 0:e.borderBoxSize){const t=e.borderBoxSize[0];if(t)return void l({width:t.inlineSize,height:t.blockSize})}l(Ie(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()}));return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},Ae={passive:!0},_e="undefined"==typeof window||"onscrollend"in window,De=(e,t)=>{const n=e.scrollElement;if(!n)return;const o=e.targetWindow;if(!o)return;let l=0;const i=e.options.useScrollendEvent&&_e?()=>{}:xe(o,(()=>{t(l,!1)}),e.options.isScrollingResetDelay),s=o=>()=>{const{horizontal:s,isRtl:r}=e.options;l=s?n.scrollLeft*(r?-1:1):n.scrollTop,i(),t(l,o)},r=s(!0),a=s(!1);a(),n.addEventListener("scroll",r,Ae);const u=e.options.useScrollendEvent&&_e;return u&&n.addEventListener("scrollend",a,Ae),()=>{n.removeEventListener("scroll",r),u&&n.removeEventListener("scrollend",a)}},ze=(e,t,n)=>{if(null==t?void 0:t.borderBoxSize){const e=t.borderBoxSize[0];if(e){return Math.round(e[n.options.horizontal?"inlineSize":"blockSize"])}}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},Le=(e,{adjustments:t=0,behavior:n},o)=>{var l,i;const s=e+t;null==(i=null==(l=o.scrollElement)?void 0:l.scrollTo)||i.call(l,{[o.options.horizontal?"left":"top"]:s,behavior:n})};class Ge{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let e=null;const t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver((e=>{e.forEach((e=>{const t=()=>{this._measureElement(e.target,e)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()}))})):null);return{disconnect:()=>{var n;null==(n=t())||n.disconnect(),e=null},observe:e=>{var n;return null==(n=t())?void 0:n.observe(e,{box:"border-box"})},unobserve:e=>{var n;return null==(n=t())?void 0:n.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach((([t,n])=>{void 0===n&&delete e[t]})),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Ee,rangeExtractor:Oe,onChange:()=>{},measureElement:ze,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var t,n;null==(n=(t=this.options).onChange)||n.call(t,this,e)},this.maybeNotify=Me((()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null])),(e=>{this.notify(e)}),{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>
1{this.unsubs.filter(Boolean).forEach((e=>e())),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;const t=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==t){if(this.cleanup(),!t)return void this.maybeNotify();this.scrollElement=t,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(e=this.scrollElement)?void 0:e.window)??null,this.elementsCache.forEach((e=>{this.observer.observe(e)})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,(e=>{this.scrollRect=e,this.maybeNotify()}))),this.unsubs.push(this.options.observeElementOffset(this,((e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?"forward":"backward":null,this.scrollOffset=e,this.isScrolling=t,this.maybeNotify()})))}}
1,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??("function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{const n=new Map,o=new Map;for(let l=t-1;l>=0;l--){const t=e[l];if(n.has(t.lane))continue;const i=o.get(t.lane);if(null==i||t.end>i.end?o.set(t.lane,t):t.end<i.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort(((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end))[0]:void 0},this.getMeasurementOptions=Me((()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes]),((e,t,n,o,l,i)=>(void 0!==this.prevLanes&&this.prevLanes!==i&&(this.lanesChangedFlag=!0),this.prevLanes=i,this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:n,getItemKey:o,enabled:l,lanes:i})),{key:!1,skipInitialOnChange:!0,onChange:()=>{this.notify(this.isScrolling)}}),this.getMeasurements=Me((()=>[this.getMeasurementOptions(),this.itemSizeCache]),(({count:e,paddingStart:t,scrollMargin:n,getItemKey:o,enabled:l,lanes:i},s)=>{if(!l)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(const d of this.laneAssignments.keys())d>=e&&this.laneAssignments.delete(d);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),0===this.measurementsCache.length&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach((e=>{this.itemSizeCache.set(e.key,e.size)})));const r=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1);const a=this.measurementsCache.slice(0,r),u=new Array(i).fill(void 0);for(let d=0;d<r;d++){const e=a[d];e&&(u[e.lane]=d)}for(let d=r;d<e;d++){const e=o(d),l=this.laneAssignments.get(d);let i,r;if(void 0!==l&&this.options.lanes>1){i=l;const e=u[i],o=void 0!==e?a[e]:void 0;r=o?o.end+this.options.gap:t+n}else{const e=1===this.options.lanes?a[d-1]:this.getFurthestMeasurement(a,d);r=e?e.end+this.options.gap:t+n,i=e?e.lane:d%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(d,i)}const g=s.get(e),c="number"==typeof g?g:this.options.estimateSize(d),h=r+c;a[d]={index:d,start:r,size:c,end:h,key:e,lane:i},u[i]=d}return this.measurementsCache=a,a}),{key:!1,debug:()=>this.options.debug}),this.calculateRange=Me((()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes]),((e,t,n,o)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:n,lanes:o}){const l=e.length-1,i=t=>e[t].start;if(e.length<=o)return{startIndex:0,endIndex:l};let s=He(0,l,i,n),r=s;if(1===o)for(;r<l&&e[r].end<n+t;)r++;else if(o>1){const i=Array(o).fill(0);for(;r<l&&i.some((e=>e<n+t));){const t=e[r];i[t.lane]=t.end,r++}const a=Array(o).fill(n+t);for(;s>=0&&a.some((e=>e>=n));){const t=e[s];a[t.lane]=t.start,s--}s=Math.max(0,s-s%o),r=Math.min(l,r+(o-1-r%o))}return{startIndex:s,endIndex:r}}({measurements:e,outerSize:t,scrollOffset:n,lanes:o}):null),{key:!1,debug:()=>this.options.debug}
1),this.getVirtualIndexes=Me((()=>{let e=null,t=null;const n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]}),((e,t,n,o,l)=>null===o||null===l?[]:e({startIndex:o,endIndex:l,overscan:t,count:n})),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{const t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this._measureElement=(e,t)=>{const n=this.indexFromElement(e),o=this.measurementsCache[n];if(!o)return;const l=o.key,i=this.elementsCache.get(l);i!==e&&(i&&this.observer.unobserve(i),this.observer.observe(e),this.elementsCache.set(l,e)),e.isConnected&&this.resizeItem(n,this.options.measureElement(e,t,this))},this.resizeItem=(e,t)=>{const n=this.measurementsCache[e];if(!n)return;const o=t-(this.itemSizeCache.get(n.key)??n.size);0!==o&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(n,o,this):n.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(n.index),this.itemSizeCache=new Map(this.itemSizeCache.set(n.key,t)),this.notify(!1))},this.measureElement=e=>{e?this._measureElement(e,void 0):this.elementsCache.forEach(((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))}))},this.getVirtualItems=Me((()=>
1[this.getVirtualIndexes(),this.getMeasurements()]),((e,t)=>{const n=[];for(let o=0,l=e.length;o<l;o++){const l=t[e[o]];n.push(l)}return n}),{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const t=this.getMeasurements();if(0!==t.length)return Pe(t[He(0,t.length-1,(e=>Pe(t[e]).start),e)])},this.getOffsetForAlignment=(e,t,n=0)=>{const o=this.getSize(),l=this.getScrollOffset();"auto"===t&&(t=e>=l+o?"end":"start"),"center"===t?e+=(n-o)/2:"end"===t&&(e-=o);const i=this.getTotalSize()+this.options.scrollMargin-o;return Math.max(Math.min(i,e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const n=this.measurementsCache[e];if(!n)return;const o=this.getSize(),l=this.getScrollOffset();if("auto"===t)if(n.end>=l+o-this.options.scrollPaddingEnd)t="end";else{if(!(n.start<=l+this.options.scrollPaddingStart))return[l,t];t="start"}const i="end"===t?n.end+this.options.scrollPaddingEnd:n.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(i,t,n.size),t]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(e,{align:t="start",behavior:n}={})=>{"smooth"===n&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,t),{adjustments:void 0,behavior:n})},this.scrollToIndex=(e,{align:t="auto",behavior:n}={})=>{"smooth"===n&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),e=Math.max(0,Math.min(e,this.options.count-1));let o=0;const l=t=>{if(!this.targetWindow)return;const o=this.getOffsetForIndex(e,t);if(!o)return void console.warn("Failed to get offset for index:",e);const[l,s]=o;this._scrollToOffset(l,{adjustments:void 0,behavior:n}),this.targetWindow.requestAnimationFrame((()=>{const t=this.getScrollOffset(),n=this.getOffsetForIndex(e,s);var o,l;n?(o=n[0],l=t,Math.abs(o-l)<1.01||i(s)):console.warn("Failed to get offset for index:",e)}))},i=t=>{this.targetWindow&&(o++,o<10?this.targetWindow.requestAnimationFrame((()=>l(t))):console.warn(`Failed to scroll to index ${e} after 10 attempts.`))};l(t)},this.scrollBy=(e,{behavior:t}={})=>{"smooth"===t&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adju
1stments:void 0,behavior:t})},this.getTotalSize=()=>{var e;const t=this.getMeasurements();let n;if(0===t.length)n=this.options.paddingStart;else if(1===this.options.lanes)n=(null==(e=t[t.length-1])?void 0:e.end)??0;else{const e=Array(this.options.lanes).fill(null);let o=t.length-1;for(;o>=0&&e.some((e=>null===e));){const n=t[o];null===e[n.lane]&&(e[n.lane]=n.end),o--}n=Math.max(...e.filter((e=>null!==e)))}return Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}}const He=(e,t,n,o)=>{for(;e<=t;){const l=(e+t)/2|0,i=n(l);if(i<o)e=l+1;else{if(!(i>o))return l;t=l-1}}return e>0?e-1:0};function qe(e,t){return"function"==typeof e?e(t):e}function ke(e,t){return n=>{t.setState((t=>({...t,[e]:qe(n,t[e])})))}}function Te(e){return e instanceof Function}function Be(e,t,n){let o,l=[];return i=>{let s;n.key&&n.debug&&(s=Date.now());const r=e(i);if(!(r.length!==l.length||r.some(((e,t)=>l[t]!==e))))return o;let a;if(l=r,n.key&&n.debug&&(a=Date.now()),o=t(...r),null==n||null==n.onChange||n.onChange(o),n.key&&n.debug&&null!=n&&n.debug()){const e=Math.round(100*(Date.now()-s))/100,t=Math.round(100*(Date.now()-a))/100,o=t/16,l=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%câ± ${l(t,5)} /${l(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*o,120))}deg 100% 31%);`,null==n?void 0:n.key)}return o}}function Qe(e,t,n,o){return{debug:()=>{var n;return null!=(n=null==e?void 0:e.debugAll)?n:e[t]},key:!1,onChange:o}}const Ue="debugHeaders";function je(e,t,n){var o;let l={id:null!=(o=n.id)?o: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(l),e},getContext:()=>({table:e,header:l,column:t})};return e._features.forEach((t=>{null==t.createHeader||t.createHeader(l,e)})),l}const Ne={createTable:e=>{e.getHeaderGroups=Be((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((t,n,o,l)=>{var i,s;const r=null!=(i=null==o?void 0:o.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?i:[],a=null!=(s=null==l?void 0:l.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?s:[];return Ke(t,[...r,...n.filter((e=>!(null!=o&&o.includes(e.id)||null!=l&&l.includes(e.id)))),...a],e)}),Qe(e.options,Ue)),e.getCenterHeaderGroups=Be((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((t,n,o,l)=>Ke(t,n=n.filter((e=>!(null!=o&&o.includes(e.id)||null!=l&&l.includes(e.id)))),e,"center")),Qe(e.options,Ue)),e.getLeftHeaderGroups=Be((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left]),((t,n,o)=>{var l;return Ke(t,null!=(l=null==o?void 0:o.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?l:[],e,"left")}),Qe(e.options,Ue)),e.getRightHeaderGroups=Be((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right]),((t,n,o)=>{var l;return Ke(t,null!=(l=null==o?void 0:o.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?l:[],e,"right")}),Qe(e.options,Ue)),e.getFooterGroups=Be((()=>[e.getHeaderGroups()]),(e=>[...e].reverse()),Qe(e.options,Ue)),e.getLeftFooterGroups=Be((()=>[e.getLeftHeaderGroups()]),(e=>[...e].reverse()),Qe(e.options,Ue)),e.getCenterFooterGroups=Be((()=>[e.getCenterHeaderGroups()]),(e=>[...e].reverse()),Qe(e.options,Ue)),e.getRightFooterGroups=Be((()=>[e.getRightHeaderGroups()]),(e=>[...e].reverse()),Qe(e.options,Ue)),e.getFlatHeaders=Be((()=>[e.getHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),Qe(e.options,Ue)),e.getLeftFlatHeaders=Be((()=>[e.getLeftHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),Qe(e.options,Ue)),e.getCenterFlatHeaders=Be((()=>[e.getCenterHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),Qe(e.options,Ue)),e.getRightFlatHeaders=Be((()=>[e.getRightHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),Qe(e.options,Ue)),e.getCenterLeafHeaders=Be((()=>[e.getCenterFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),Qe(e.options,Ue)),e.getLeftLeafHeaders=Be((()=>[e.getLeftFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),Qe(e.options,Ue)),e.getRightLeafHeaders=Be((()=>[e.getRightFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),Qe(e.options,Ue)),e.getLeafHeaders=Be((()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()]),((e,t,n)=>{var o,l,i,s,r,a;return[...null!=(o=null==(l=e[0])?void 0:l.headers)?o:[],...null!=(i=null==(s=t[0])?void 0:s.headers)?i:[],...null!=(r=null==(a=n[0])?void 0:a.headers)?r:[]].map((e=>e.getLeafHeaders())).flat()}),Qe(e.options,Ue))}};function Ke(e,t,n,o){var l,i;let s=0;const r=function(e,t){void 0===t&&(t=1),s=Math.max(s,t),e.filter((e=>
vendor: 43,291 bytes, line 1
1e.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 l={depth:t,id:[o,`${t}`].filter(Boolean).join("_"),headers:[]},i=[];e.forEach((e=>{const s=[...i].reverse()[0];let r,a=!1;if(e.column.depth===l.depth&&e.column.parent?r=e.column.parent:(r=e.column,a=!0),s&&(null==s?void 0:s.column)===r)s.subHeaders.push(e);else{const l=je(n,r,{id:[o,t,r.id,null==e?void 0:e.id].filter(Boolean).join("_"),isPlaceholder:a,placeholderId:a?`${i.filter((e=>e.column===r)).length}`:void 0,depth:t,index:i.length});l.subHeaders.push(e),i.push(l)}l.headers.push(e),e.headerGroup=l})),a.push(l),t>0&&u(i,t-1)},d=t.map(((e,t)=>je(n,e,{depth:s,index:t})));u(d,s-1),a.reverse();const g=e=>e.filter((e=>e.column.getIsVisible())).map((e=>{let t=0,n=0,o=[0];e.subHeaders&&e.subHeaders.length?(o=[],g(e.subHeaders).forEach((e=>{let{colSpan:n,rowSpan:l}=e;t+=n,o.push(l)}))):t=1;return n+=Math.min(...o),e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}}));return g(null!=(l=null==(i=a[0])?void 0:i.headers)?l:[]),a}const $e=(e,t,n,o,l,i,s)=>{let r={id:t,index:o,original:n,depth:l,parentId:s,_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,o),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,o),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=[],o=e=>{e.forEach((e=>{n.push(e);const l=t(e);null!=l&&l.length&&o(l)}))};return o(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:Be((()=>[e.getAllLeafColumns()]),(t=>t.map((t=>function(e,t,n,o){const l={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(o),renderValue:()=>{var t;return null!=(t=l.getValue())?t:e.options.renderFallbackValue},getContext:Be((()=>[e,n,t,l]),((e,t,n,o)=>({table:e,column:t,row:n,cell:o,getValue:o.getValue,renderValue:o.renderValue})),Qe(e.options,"debugCells"))};return e._features.forEach((o=>{null==o.createCell||o.createCell(l,n,t,e)}),{}),l}(e,r,t,t.id)))),Qe(e.options,"debugRows")),_getAllCellsByColumnId:Be((()=>[r.getAllCells()]),(e=>e.reduce(((e,t)=>(e[t.column.id]=t,e)),{})),Qe(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},We={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()}}},Xe=(e,t,n)=>{var o,l;const i=null==n||null==(o=n.toString())?void 0:o.toLowerCase();return Boolean(null==(l=e.getValue(t))||null==(l=l.toString())||null==(l=l.toLowerCase())?void 0:l.includes(i))};Xe.autoRemove=e=>st(e);const Je=(e,t,n)=>{var o;return Boolean(null==(o=e.getValue(t))||null==(o=o.toString())?void 0:o.includes(n))};Je.autoRemove=e=>st(e);const Ye=(e,t,n)=>{var o;return(null==(o=e.getValue(t))||null==(o=o.toString())?void 0:o.toLowerCase())===(null==n?void 0:n.toLowerCase())};Ye.autoRemove=e=>st(e);const Ze=(e,t,n)=>{var o;return null==(o=e.getValue(t))?void 0:o.includes(n)};Ze.autoRemove=e=>st(e);const et=(e,t,n)=>!n.some((n=>{var o;return!(null!=(o=e.getValue(t))&&o.includes(n))}));et.autoRemove=e=>st(e)||!(null!=e&&e.length);const tt=(e,t,n)=>n.some((n=>{var o;return null==(o=e.getValue(t))?void 0:o.includes(n)}));tt.autoRemove=e=>st(e)||!(null!=e&&e.length);const nt=(e,t,n)=>e.getValue(t)===n;nt.autoRemove=e=>st(e);const ot=(e,t,n)=>e.getValue(t)==n;ot.autoRemove=e=>st(e);const lt=(e,t,n)=>{let[o,l]=n;const i=e.getValue(t);return i>=o&&i<=l};lt.resolveFilterValue=e=>{let[t,n]=e,o="number"!=typeof t?parseFloat(t):t,l="number"!=typeof n?parseFloat(n):n,i=null===t||Number.isNaN(o)?-1/0:o,s=null===n||Number.isNaN(l)?1/0:l;if(i>s){const e=i;i=s,s=e}return[i,s]},lt.autoRemove=e=>st(e)||st(e[0])&&st(e[1]);const it={includesString:Xe,includesStringSensitive:Je,equalsString:Ye,arrIncludes:Ze,arrIncludesAll:et,arrIncludesSome:tt,equals:nt,weakEquals:ot,inNumberRange:lt};function st(e){return null==e||""===e}const rt={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:ke("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],o=null==n?void 0:n.getValue(e.id);return"string"==typeof o?it.includesString:"number"==typeof o?it.inNumberRange:"boolean"==typeof o||null!==o&&"object"==typeof o?it.equals:Array.isArray(o)?it.arrIncludes:it.weakEquals},e.getFilterFn=()=>{var n,o;return Te(e.columnDef.filterFn)?e.columnDef.filterFn:"auto"===e.columnDef.filterFn?e.getAutoFilterFn():null!=(n=null==(o=t.options.filterFns)?void 0:o[e.columnDef.filterFn])?n:it[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,o,l;return(null==(n=e.columnDef.enableColumnFilter)||n)&&(null==(o=t.options.enableColumnFilters)||o)&&(null==(l=t.options.enableFilters)||l)&&!!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,o;return null!=(n=null==(o=t.getState().columnFilters)?void 0:o.findIndex((t=>t.id===e.id)))?n:-1},e.setFilterValue=n=>{t.setColumnFilters((t=>{const o=e.getFilterFn(),l=null==t?void 0:t.find((t=>t.id===e.id)),i=qe(n,l?l.value:void 0);var s;if(at(o,i,e))return null!=(s=null==t?void 0:t.filter((t=>t.id!==e.id)))?s:[];const r={id:e.id,value:i};var a;return l?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 o;return null==(o=qe(t,e))?void 0:o.filter((e=>{const t=n.find((t=>t.id===e.id));if(t){if(at(t.getFilterFn(),e.value,t))return!1}return!0}))}))},e.resetColumnFilters=t=>{var n,o;e.setColumnFilters(t?[]:null!=(n=null==(o=e.initialState)?void 0:o.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 at(e,t,n){return!(!e||!e.autoRemove)&&e.autoRemove(t,n)||void 0===t||"string"==typeof t&&!t}const ut={sum:(e,t,n)=>n.reduce(((t,n)=>{const o=n.getValue(e);return t+("number"==typeof o?o:0)}),0),min:(e,t,n)=>{let o;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(o>n||void 0===o&&n>=n)&&(o=n)})),o},max:(e,t,n)=>{let o;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(o<n||void 0===o&&n>=n)&&(o=n)})),o},extent:(e,t,n)=>{let o,l;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(void 0===o?n>=n&&(o=l=n):(o>n&&(o=n),l<n&&(l=n)))})),[o,l]},mean:(e,t)=>{let n=0,o=0;if(t.forEach((t=>{let l=t.getValue(e);null!=l&&(l=+l)>=l&&(++n,o+=l)})),n)return o/n},median:(e,t)=>{if(!t.length)return;const n=t.map((t=>t.getValue(e)));if(o=n,!Array.isArray(o)||!o.every((e=>"number"==typeof e)))return;var o;if(1===n.length)return n[0];const l=Math.floor(n.length/2),i=n.sort(((e,t)=>e-t));return n.length%2!=0?i[l]:(i[l-1]+i[l])/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},dt={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:ke("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,o;return(null==(n=e.columnDef.enableGrouping)||n)&&(null==(o=t.options.enableGrouping)||o)&&(!!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],o=null==n?void 0:n.getValue(e.id);return"number"==typeof o?ut.sum:"[object Date]"===Object.prototype.toString.call(o)?ut.extent:void 0},e.getAggregationFn=()=>{var n,o;if(!e)throw new Error;return Te(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:"auto"===e.columnDef.aggregationFn?e.getAutoAggregationFn():null!=(n=null==(o=t.options.aggregationFns)?void 0:o[e.columnDef.aggregationFn])?n:ut[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>null==e.options.onGroupingChange?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,o;e.setGrouping(t?[]:null!=(n=null==(o=e.initialState)?void 0:o.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 o=t.getColumn(n);return null!=o&&o.columnDef.getGroupingValue?(e._groupingValuesCache[n]=o.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,o)=>{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 gt={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:ke("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Be((e=>[vt(t,e)]),(t=>t.findIndex((t=>t.id===e.id))),Qe(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var o;return(null==(o=vt(t,n)[0])?void 0:o.id)===e.id},e.getIsLastColumn=n=>{var o;const l=vt(t,n);return(null==(o=l[l.length-1])?void 0:o.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=Be((()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode]),((e,t,n)=>o=>{let l=[];if(null!=e&&e.length){const t=[...e],n=[...o];for(;n.length&&t.length;){const e=t.shift(),o=n.findIndex((t=>t.id===e));o>-1&&l.push(n.splice(o,1)[0])}l=[...l,...n]}else l=o;return function(e,t,n){if(null==t||!t.length||!n)return e;const o=e.filter((e=>!t.includes(e.id)));return"remove"===n?o:[...t.map((t=>e.find((e=>e.id===t)))).filter(Boolean),...o]}(l,t,n)}),Qe(e.options,"debugTable"))}},ct={getInitialState:e=>({columnPinning:{left:[],right:[]},...e}),getDefaultOptions:e=>({onColumnPinningChange:ke("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const o=e.getLeafColumns().map((e=>e.id)).filter(Boolean);t.setColumnPinning((e=>{var t,l,i,s,r,a;return"right"===n?{left:(null!=(i=null==e?void 0:e.left)?i:[]).filter((e=>!(null!=o&&o.includes(e)))),right:[...(null!=(s=null==e?void 0:e.right)?s:[]).filter((e=>!(null!=o&&o.includes(e)))),...o]}:"left"===n?{left:[...(null!=(r=null==e?void 0:e.left)?r:[]).filter((e=>!(null!=o&&o.includes(e)))),...o],right:(null!=(a=null==e?void 0:e.right)?a:[]).filter((e=>!(null!=o&&o.includes(e))))}:{left:(null!=(t=null==e?void 0:e.left)?t:[]).filter((e=>!(null!=o&&o.includes(e)))),right:(null!=(l=null==e?void 0:e.right)?l:[]).filter((e=>!(null!=o&&o.includes(e))))}}))},e.getCanPin=()=>e.getLeafColumns().some((e=>{var n,o,l;return(null==(n=e.columnDef.enablePinning)||n)&&(null==(o=null!=(l=t.options.enableColumnPinning)?l:t.options.enablePinning)||o)})),e.getIsPinned=()=>{const n=e.getLeafColumns().map((e=>e.id)),{left:o,right:l}=t.getState().columnPinning,i=n.some((e=>null==o?void 0:o.includes(e))),s=n.some((e=>null==l?void 0:l.includes(e)));return i?"left":!!s&&"right"},e.getPinnedIndex=()=>{var n,o;const l=e.getIsPinned();return l?null!=(n=null==(o=t.getState().columnPinning)||null==(o=o[l])?void 0:o.indexOf(e.id))?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=Be((()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right]),((e,t,n)=>{const o=[...null!=t?t:[],...null!=n?n:[]];return e.filter((e=>!o.includes(e.column.id)))}),Qe(t.options,"debugRows")),e.getLeftVisibleCells=Be((()=>[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"})))),Qe(t.options,"debugRows")),e.getRightVisibleCells=Be((()=>[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"})))),Qe(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>null==e.options.onColumnPinningChange?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,o;return e.setColumnPinning(t?{left:[],right:[]}:null!=(n=null==(o=e.initialState)?void 0:o.columnPinning)?n:{left:[],right:[]})},e.getIsSomeColumnsPinned=t=>{var n;const o=e.getState().columnPinning;var l,i;return t?Boolean(null==(n=o[t])?void 0:n.length):Boolean((null==(l=o.left)?void 0:l.length)||(null==(i=o.right)?void 0:i.length))},e.getLeftLeafColumns=Be((()=>[e.getAllLeafColumns(),e.getState().columnPinning.left]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.id===t)))).filter(Boolean)),Qe(e.options,"debugColumns")),e.getRightLeafColumns=Be((()=>[e.getAllLeafColumns(),e.getState().columnPinning.right]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.id===t)))).filter(Boolean)),Qe(e.options,"debugColumns")),e.getCenterLeafColumns=Be((()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((e,t,n)=>{const o=[...null!=t?t:[],...null!=n?n:[]];return e.filter((e=>!o.includes(e.id)))}),Qe(e.options,"debugColumns"))}};const ht={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},ft={getDefaultColumnDef:()=>ht,getInitialState:e=>({columnSizing:{},columnSizingInfo:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]},...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:ke("columnSizing",e),onColumnSizingInfoChange:ke("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,o,l;const i=t.getState().columnSizing[e.id];return Math.min(Math.max(null!=(n=e.columnDef.minSize)?n:ht.minSize,null!=(o=null!=i?i:e.columnDef.size)?o:ht.size),null!=(l=e.columnDef.maxSize)?l:ht.maxSize)},e.getStart=Be((e=>[e,vt(t,e),t.getState().columnSizing]),((t,n)=>n.slice(0,e.getIndex(t)).reduce(((e,t)=>e+t.getSize()),0)),Qe(t.options,"debugColumns")),e.getAfter=Be((e=>[e,vt(t,e),t.getState().columnSizing]),((t,n)=>n.slice(e.getIndex(t)+1).reduce(((e,t)=>e+t.getSize()),0)),Qe(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing((t=>{let{[e.id]:n,...o}=t;return o}))},e.getCanResize=()=>{var n,o;return(null==(n=e.columnDef.enableResizing)||n)&&(null==(o=t.options.enableColumnResizing)||o)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let t=0;const n=e=>{var o;e.subHeaders.length?e.subHeaders.forEach(n):t+=null!=(o=e.column.getSize())?o: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 o=t.getColumn(e.column.id),l=null==o?void 0:o.getCanResize();return i=>{if(!o||!l)return;if(null==i.persist||i.persist(),mt(i)&&i.touches&&i.touches.length>1)return;const s=e.getSize(),r=e?e.getLeafHeaders().map((e=>[e.column.id,e.column.getSize()])):[[o.id,o.getSize()]],a=mt(i)?Math.round(i.touches[0].clientX):i.clientX,u={},d=(e,n)=>{"number"==typeof n&&(t.setColumnSizingInfo((e=>{var o,l;const i="rtl"===t.options.columnResizeDirection?-1:1,s=(n-(null!=(o=null==e?void 0:e.startOffset)?o:0))*i,r=Math.max(s/(null!=(l=null==e?void 0:e.startSize)?l: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:s,deltaPercentage:r}})),"onChange"!==t.options.columnResizeMode&&"end"!==e||t.setColumnSizing((e=>({...e,...u}))))},g=e=>d("move",e),c=e=>{d("end",e),t.setColumnSizingInfo((e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]})))},h=n||("undefined"!=typeof document?document:null);const f={moveHandler:e=>g(e.clientX),upHandler:e=>{null==h||h.removeEventListener("mousemove",f.moveHandler),null==h||h.removeEventListener("mouseup",f.upHandler),c(e.clientX)}},p={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),g(e.touches[0].clientX),!1),upHandler:e=>{var t;null==h||h.removeEventListener("touchmove",p.moveHandler),null==h||h.removeEventListener("touchend",p.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),c(null==(t=e.touches[0])?void 0:t.clientX)}},m=!!function(){if("boolean"==typeof pt)return pt;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 pt=e,pt}()&&{passive:!1};mt(i)?(null==h||h.addEventListener("touchmove",p.moveHandler,m),null==h||h.addEventListener("touchend",p.upHandler,m)):(null==h||h.addEventListener("mousemove",f.moveHandler,m),null==h||h.addEventListener("mouseup",f.upHandler,m)),t.setColumnSizingInfo((e=>({...e,startOffset:a,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:r,isResizingColumn:o.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 pt=null;function mt(e){return"touchstart"===e.type}function vt(e,t){return t?"center"===t?e.getCenterVisibleLeafColumns():"left"===t?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const bt={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:ke("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),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 o={...n},l=e.getPreGroupedRowModel().flatRows;return t?l.forEach((e=>{e.getCanSelect()&&(o[e.id]=!0)})):l.forEach((e=>{delete o[e.id]})),o}))},e.toggleAllPageRowsSelected=t=>e.setRowSelection((n=>{const o=void 0!==t?t:!e.getIsAllPageRowsSelected(),l={...n};return e.getRowModel().rows.forEach((t=>{St(l,t.id,o,!0,e)})),l})),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Be((()=>[e.getState().rowSelection,e.getCoreRowModel()]),((t,n)=>Object.keys(t).length?wt(e,n):{rows:[],flatRows:[],rowsById:{}}),Qe(e.options,"debugTable")),e.getFilteredSelectedRowModel=Be((()=>[e.getState().rowSelection,e.getFilteredRowModel()]),((t,n)=>Object.keys(t).length?wt(e,n):{rows:[],flatRows:[],rowsById:{}}),Qe(e.options,"debugTable")),e.getGroupedSelectedRowModel=Be((()=>[e.getState().rowSelection,e.getSortedRowModel()]),((t,n)=>Object.keys(t).length?wt(e,n):{rows:[],flatRows:[],rowsById:{}}),Qe(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let o=Boolean(t.length&&Object.keys(n).length);return o&&t.some((e=>e.getCanSelect()&&!n[e.id]))&&(o=!1),o},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter((e=>e.getCanSelect())),{rowSelection:n}=e.getState();let o=!!t.length;return o&&t.some((e=>!n[e.id]))&&(o=!1),o},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,o)=>{const l=e.getIsSelected();t.setRowSelection((i=>{var s;if(n=void 0!==n?n:!l,e.getCanSelect()&&l===n)return i;const r={...i};return St(r,e.id,n,null==(s=null==o?void 0:o.selectChildren)||s,t),r}))},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Ct(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return"some"===Rt(e,n)},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return"all"===Rt(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 o;t&&e.toggleSelected(null==(o=n.target)?void 0:o.checked)}}}},St=(e,t,n,o,l)=>{var i;const s=l.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach((t=>delete e[t])),s.getCanSelect()&&(e[t]=!0)):delete e[t],o&&null!=(i=s.subRows)&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach((t=>St(e,t.id,n,o,l)))};function wt(e,t){const n=e.getState().rowSelection,o=[],l={},i=function(e,t){return e.map((e=>{var t;const s=Ct(e,n);if(s&&(o.push(e),l[e.id]=e),null!=(t=e.subRows)&&t.length&&(e={...e,subRows:i(e.subRows)}),s)return e})).filter(Boolean)};return{rows:i(t.rows),flatRows:o,rowsById:l}}function Ct(e,t){var n;return null!=(n=t[e.id])&&n}function Rt(e,t,n){var o;if(null==(o=e.subRows)||!o.length)return!1;let l=!0,i=!1;return e.subRows.forEach((e=>{if((!i||l)&&(e.getCanSelect()&&(Ct(e,t)?i=!0:l=!1),e.subRows&&e.subRows.length)){const n=Rt(e,t);"all"===n?i=!0:"some"===n?(i=!0,l=!1):l=!1}})),l?"all":!!i&&"some"}const yt=/([0-9]+)/gm;function Ft(e,t){return e===t?0:e>t?1:-1}function Mt(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}function Pt(e,t){const n=e.split(yt).filter(Boolean),o=t.split(yt).filter(Boolean);for(;n.length&&o.length;){const e=n.shift(),t=o.shift(),l=parseInt(e,10),i=parseInt(t,10),s=[l,i].sort();if(isNaN(s[0])){if(e>t)return 1;if(t>e)return-1}else{if(isNaN(s[1]))return isNaN(l)?-1:1;if(l>i)return 1;if(i>l)return-1}}return n.length-o.length}const xt={alphanumeric:(e,t,n)=>Pt(Mt(e.getValue(n)).toLowerCase(),Mt(t.getValue(n)).toLowerCase()),alphanumericCaseSensitive:(e,t,n)=>Pt(Mt(e.getValue(n)),Mt(t.getValue(n))),text:(e,t,n)=>Ft(Mt(e.getValue(n)).toLowerCase(),Mt(t.getValue(n)).toLowerCase()),textCaseSensitive:(e,t,n)=>Ft(Mt(e.getValue(n)),Mt(t.getValue(n))),datetime:(e,t,n)=>{const o=e.getValue(n),l=t.getValue(n);return o>l?1:o<l?-1:0},basic:(e,t,n)=>Ft(e.getValue(n),t.getValue(n))},It=[Ne,{getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:ke("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,o;const l=e.columns;return null==(n=l.length?l.some((e=>e.getIsVisible())):null==(o=t.getState().columnVisibility)?void 0:o[e.id])||n},e.getCanHide=()=>{var n,o;return(null==(n=e.columnDef.enableHiding)||n)&&(null==(o=t.options.enableHiding)||o)},e.getToggleVisibilityHandler=()=>t=>{null==e.toggleVisibility||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=Be((()=>[e.getAllCells(),t.getState().columnVisibility]),(e=>e.filter((e=>e.column.getIsVisible()))),Qe(t.options,"debugRows")),e.getVisibleCells=Be((()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()]),((e,t,n)=>[...e,...t,...n]),Qe(t.options,"debugRows"))},createTable:e=>{const t=(t,n)=>Be((()=>[n(),n().filter((e=>e.getIsVisible())).map((e=>e.id)).join("_")]),(e=>e.filter((e=>null==e.getIsVisible?void 0:e.getIsVisible()))),Qe(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)}}},gt,ct,We,rt,{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:ke("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const o=null==(n=e.getCoreRowModel().flatRows[0])||null==(n=n._getAllCellsByColumnId()[t.id])?void 0:n.getValue();return"string"==typeof o||"number"==typeof o}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,o,l,i;return(null==(n=e.columnDef.enableGlobalFilter)||n)&&(null==(o=t.options.enableGlobalFilter)||o)&&(null==(l=t.options.enableFilters)||l)&&(null==(i=null==t.options.getColumnCanGlobalFilter?void 0:t.options.getColumnCanGlobalFilter(e))||i)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>it.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:o}=e.options;return Te(o)?o:"auto"===o?e.getGlobalAutoFilterFn():null!=(t=null==(n=e.options.filterFns)?void 0:n[o])?t:it[o]},e.setGlobalFilter=t=>{null==e.options.onGlobalFilterChange||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:ke("sorting",e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let o=!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 xt.datetime;if("string"==typeof n&&(o=!0,n.split(yt).length>1))return xt.alphanumeric}return o?xt.text:xt.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,o;if(!e)throw new Error;return Te(e.columnDef.sortingFn)?e.columnDef.sortingFn:"auto"===e.columnDef.sortingFn?e.getAutoSortingFn():null!=(n=null==(o=t.options.sortingFns)?void 0:o[e.columnDef.sortingFn])?n:xt[e.columnDef.sortingFn]},e.toggleSorting=(n,o)=>{const l=e.getNextSortingOrder(),i=null!=n;t.setSorting((s=>{const r=null==s?void 0:s.find((t=>t.id===e.id)),a=null==s?void 0:s.findIndex((t=>t.id===e.id));let u,d=[],g=i?n:"desc"===l;var c;(u=null!=s&&s.length&&e.getCanMultiSort()&&o?r?"toggle":"add":null!=s&&s.length&&a!==s.length-1?"replace":r?"toggle":"replace","toggle"===u&&(i||l||(u="remove")),"add"===u)?(d=[...s,{id:e.id,desc:g}],d.splice(0,d.length-(null!=(c=t.options.maxMultiSortColCount)?c:Number.MAX_SAFE_INTEGER))):d="toggle"===u?s.map((t=>t.id===e.id?{...t,desc:g}:t)):"remove"===u?s.filter((t=>t.id!==e.id)):[{id:e.id,desc:g}];return d}))},e.getFirstSortDir=()=>{var n,o;return(null!=(n=null!=(o=e.columnDef.sortDescFirst)?o:t.options.sortDescFirst)?n:"desc"===e.getAutoSortDir())?"desc":"asc"},e.getNextSortingOrder=n=>{var o,l;const i=e.getFirstSortDir(),s=e.getIsSorted();return s?!!(s===i||null!=(o=t.options.enableSortingRemoval)&&!o||n&&null!=(l=t.options.enableMultiRemove)&&!l)&&("desc"===s?"asc":"desc"):i},e.getCanSort=()=>{var n,o;return(null==(n=e.columnDef.enableSorting)||n)&&(null==(o=t.options.enableSorting)||o)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,o;return null!=(n=null!=(o=e.columnDef.enableMultiSort)?o:t.options.enableMultiSort)?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const o=null==(n=t.getState().sorting)?void 0:n.find((t=>t.id===e.id));return!!o&&(o.desc?"desc":"asc")},e.getSortIndex=()=>{var n,o;return null!=(n=null==(o=t.getState().sorting)?void 0:o.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 o=>{n&&(null==o.persist||o.persist(),null==e.toggleSorting||e.toggleSorting(void 0,!!e.getCanMultiSort()&&(null==t.options.isMultiSortEvent?void 0:t.options.isMultiSortEvent(o))))}}},createTable:e=>{e.setSorting=t=>null==e.options.onSortingChange?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,o;e.setSorting(t?[]:null!=(n=null==(o=e.initialState)?void 0:o.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())}},dt,{getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:ke("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var o,l;if(t){if(null!=(o=null!=(l=e.options.autoResetAll)?l:e.options.autoResetExpanded)?o:!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,o;e.setExpanded(t?{}:null!=(n=null==(o=e.initialState)?void 0:o.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)).forEach((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((o=>{var l;const i=!0===o||!(null==o||!o[e.id]);let s={};if(!0===o?Object.keys(t.getRowModel().rowsById).forEach((e=>{s[e]=!0})):s=o,n=null!=(l=n)?l:!i,!i&&n)return{...s,[e.id]:!0};if(i&&!n){const{[e.id]:t,...n}=s;return n}return o}))},e.getIsExpanded=()=>{var n;const o=t.getState().expanded;return!!(null!=(n=null==t.options.getIsRowExpanded?void 0:t.options.getIsRowExpanded(e))?n:!0===o||(null==o?void 0:o[e.id]))},e.getCanExpand=()=>{var n,o,l;return null!=(n=null==t.options.getRowCanExpand?void 0:t.options.getRowCanExpand(e))?n:(null==(o=t.options.enableExpanding)||o)&&!(null==(l=e.subRows)||!l.length)},e.getIsAllParentsExpanded=()=>{let n=!0,o=e;for(;n&&o.parentId;)o=t.getRow(o.parentId,!0),n=o.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:ke("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var o,l;if(t){if(null!=(o=null!=(l=e.options.autoResetAll)?l:e.options.autoResetPageIndex)?o:!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=>qe(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 o=qe(t,n.pageIndex);const l=void 0===e.options.pageCount||-1===e.options.pageCount?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,l)),{...n,pageIndex:o}}))},e.resetPageIndex=t=>{var n,o;e.setPageIndex(t?0:null!=(n=null==(o=e.initialState)||null==(o=o.pagination)?void 0:o.pageIndex)?n:0)},e.resetPageSize=t=>{var n,o;e.setPageSize(t?10:null!=(n=null==(o=e.initialState)||null==(o=o.pagination)?void 0:o.pageSize)?n:10)},e.setPageSize=t=>{e.setPagination((e=>{const n=Math.max(1,qe(t,e.pageSize)),o=e.pageSize*e.pageIndex,l=Math.floor(o/n);return{...e,pageIndex:l,pageSize:n}}))},e.setPageCount=t=>e.setPagination((n=>{var o;let l=qe(t,null!=(o=e.options.pageCount)?o:-1);return"number"==typeof l&&(l=Math.max(-1,l)),{...n,pageCount:l}})),e.getPageOptions=Be((()=>[e.getPageCount()]),(e=>{let t=[];return e&&e>0&&(t=[...new Array(e)].fill(null).map(((e,t)=>t))),t}),Qe(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:t}=e.getState().pagination,n=e.getPageCount();return-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:ke("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,o,l)=>{const i=o?e.getLeafRows().map((e=>{let{id:t}=e;return t})):[],s=l?e.getParentRows().map((e=>{let{id:t}=e;return t})):[],r=new Set([...s,e.id,...i]);t.setRowPinning((e=>{var t,o,l,i,s,a;return"bottom"===n?{top:(null!=(l=null==e?void 0:e.top)?l:[]).filter((e=>!(null!=r&&r.has(e)))),bottom:[...(null!=(i=null==e?void 0:e.bottom)?i:[]).filter((e=>!(null!=r&&r.has(e)))),...Array.from(r)]}:"top"===n?{top:[...(null!=(s=null==e?void 0:e.top)?s:[]).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!=(o=null==e?void 0:e.bottom)?o:[]).filter((e=>!(null!=r&&r.has(e))))}}))},e.getCanPin=()=>{var n;const{enableRowPinning:o,enablePinning:l}=t.options;return"function"==typeof o?o(e):null==(n=null!=o?o:l)||n},e.getIsPinned=()=>{const n=[e.id],{top:o,bottom:l}=t.getState().rowPinning,i=n.some((e=>null==o?void 0:o.includes(e))),s=n.some((e=>null==l?void 0:l.includes(e)));return i?"top":!!s&&"bottom"},e.getPinnedIndex=()=>{var n,o;const l=e.getIsPinned();if(!l)return-1;const i=null==(n="top"===l?t.getTopRows():t.getBottomRows())?void 0:n.map((e=>{let{id:t}=e;return t}));return null!=(o=null==i?void 0:i.indexOf(e.id))?o:-1}},createTable:e=>{e.setRowPinning=t=>null==e.options.onRowPinningChange?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,o;return e.setRowPinning(t?{top:[],bottom:[]}:null!=(n=null==(o=e.initialState)?void 0:o.rowPinning)?n:{top:[],bottom:[]})},e.getIsSomeRowsPinned=t=>{var n;const o=e.getState().rowPinning;var l,i;return t?Boolean(null==(n=o[t])?void 0:n.length):Boolean((null==(l=o.top)?void 0:l.length)||(null==(i=o.bottom)?void 0:i.length))},e._getPinnedRows=(t,n,o)=>{var l;return(null==(l=e.options.keepPinnedRows)||l?(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:o})))},e.getTopRows=Be((()=>[e.getRowModel().rows,e.getState().rowPinning.top]),((t,n)=>e._getPinnedRows(t,n,"top")),Qe(e.options,"debugRows")),e.getBottomRows=Be((()=>[e.getRowModel().rows,e.getState().rowPinning.bottom]),((t,n)=>e._getPinnedRows(t,n,"bottom")),Qe(e.options,"debugRows")),e.getCenterRows=Be((()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom]),((e,t,n)=>{const o=new Set([...null!=t?t:[],...null!=n?n:[]]);return e.filter((e=>!o.has(e.id)))}),Qe(e.options,"debugRows"))}},bt,ft];function Et(e){var t,n;const o=[...It,...null!=(t=e._features)?t:[]];let l={_features:o};const i=l._features.reduce(((e,t)=>Object.assign(e,null==t.getDefaultOptions?void 0:t.getDefaultOptions(l))),{});let s={...null!=(n=e.initialState)?n:{}};l._features.forEach((e=>{var t;s=null!=(t=null==e.getInitialState?void 0:e.getInitialState(s))?t:s}));const r=[];let a=!1;const u={_features:o,options:{...i,...e},initialState:s,_queue:e=>{r.push(e),a||(a=!0,Promise.resolve().then((()=>{for(;r.length;)r.shift()();a=!1})).catch((e=>setTimeout((()=>{throw e})))))},reset:()=>{l.setState(l.initialState)},setOptions:e=>{const t=qe(e,l.options);var n;l.options=(n=t,l.options.mergeOptions?l.options.mergeOptions(i,n):{...i,...n})},getState:()=>l.options.state,setState:e=>{null==l.options.onStateChange||l.options.onStateChange(e)},_getRowId:(e,t,n)=>{var o;return null!=(o=null==l.options.getRowId?void 0:l.options.getRowId(e,t,n))?o:`${n?[n.id,t].join("."):t}`},getCoreRowModel:()=>(l._getCoreRowModel||(l._getCoreRowModel=l.options.getCoreRowModel(l)),l._getCoreRowModel()),getRowModel:()=>l.getPaginationRowModel(),getRow:(e,t)=>{let n=(t?l.getPrePaginationRowModel():l.getRowModel()).rowsById[e];if(!n&&(n=l.getCoreRowModel().rowsById[e],!n))throw new Error;return n},_getDefaultColumnDef:Be((()=>[l.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},...l._features.reduce(((e,t)=>Object.assign(e,null==t.getDefaultColumnDef?void 0:t.getDefaultColumnDef())),{}),...e}}),Qe(e,"debugColumns")),_getColumnDefs:()=>l.options.columns,getAllColumns:Be((()=>[l._getColumnDefs()]),(e=>{const t=function(e,n,o){return void 0===o&&(o=0),e.map((e=>{const i=function(e,t,n,o){var l,i;const s={...e._getDefaultColumnDef(),...t},r=s.accessorKey;let a,u=null!=(l=null!=(i=s.id)?i:r?"function"==typeof String.prototype.replaceAll?r.replaceAll(".","_"):r.replace(/\./g,"_"):void 0)?l:"string"==typeof s.header?s.header:void 0;if(s.accessorFn?a=s.accessorFn:r&&(a=r.includes(".")?e=>{let t=e;for(const o of r.split(".")){var n;t=null==(n=t)?void 0:n[o]}return t}:e=>e[s.accessorKey]),!u)throw new Error;let d={id:`${String(u)}`,accessorFn:a,parent:o,depth:n,columnDef:s,columns:[],getFlatColumns:Be((()=>[!0]),(()=>{var e;
1return[d,...null==(e=d.columns)?void 0:e.flatMap((e=>e.getFlatColumns()))]}),Qe(e.options,"debugColumns")),getLeafColumns:Be((()=>[e._getOrderColumnsFn()]),(e=>{var t;return null!=(t=d.columns)&&t.length?e(d.columns.flatMap((e=>e.getLeafColumns()))):[d]}),Qe(e.options,"debugColumns"))};for(const g of e._features)null==g.createColumn||g.createColumn(d,e);return d}(l,e,o,n),s=e;return i.columns=s.columns?t(s.columns,i,o+1):[],i}))};return t(e)}),Qe(e,"debugColumns")),getAllFlatColumns:Be((()=>[l.getAllColumns()]),(e=>e.flatMap((e=>e.getFlatColumns()))),Qe(e,"debugColumns")),_getAllFlatColumnsById:Be((()=>[l.getAllFlatColumns()]),(e=>e.reduce(((e,t)=>(e[t.id]=t,e)),{})),Qe(e,"debugColumns")),getAllLeafColumns:Be((()=>[l.getAllColumns(),l._getOrderColumnsFn()]),((e,t)=>t(e.flatMap((e=>e.getLeafColumns())))),Qe(e,"debugColumns")),getColumn:e=>l._getAllFlatColumnsById()[e]};Object.assign(l,u);for(let d=0;d<l._features.length;d++){const e=l._features[d];null==e||null==e.createTable||e.createTable(l)}return l}function Ot(){return e=>Be((()=>[e.options.data]),(t=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(t,l,i){void 0===l&&(l=0);const s=[];for(let a=0;a<t.length;a++){const u=$e(e,e._getRowId(t[a],a,i),t[a],a,l,void 0,null==i?void 0:i.id);var r;if(n.flatRows.push(u),n.rowsById[u.id]=u,s.push(u),e.options.getSubRows)u.originalSubRows=e.options.getSubRows(t[a],a),null!=(r=u.originalSubRows)&&r.length&&(u.subRows=o(u.originalSubRows,l+1,u))}return s};return n.rows=o(t),n}),Qe(e.options,"debugTable",0,(()=>e._autoResetPageIndex())))}function Vt(e,t,n){return n.options.filterFromLeafRows?function(e,t,n){var o;const l=[],i={},s=null!=(o=n.options.maxLeafRowFilterDepth)?o:100,r=function(e,o){void 0===o&&(o=0);const a=[];for(let d=0;d<e.length;d++){var u;let g=e[d];const c=$e(n,g.id,g.original,g.index,g.depth,void 0,g.parentId);if(c.columnFilters=g.columnFilters,null!=(u=g.subRows)&&u.length&&o<s){if(c.subRows=r(g.subRows,o+1),g=c,t(g)&&!c.subRows.length){a.push(g),i[g.id]=g,l.push(g);continue}if(t(g)||c.subRows.length){a.push(g),i[g.id]=g,l.push(g);continue}}else g=c,t(g)&&(a.push(g),i[g.id]=g,l.push(g))}return a};return{rows:r(e),flatRows:l,rowsById:i}}(e,t,n):function(e,t,n){var o;const l=[],i={},s=null!=(o=n.options.maxLeafRowFilterDepth)?o:100,r=function(e,o){void 0===o&&(o=0);const a=[];for(let d=0;d<e.length;d++){let g=e[d];if(t(g)){var u;if(null!=(u=g.subRows)&&u.length&&o<s){const e=$e(n,g.id,g.original,g.index,g.depth,void 0,g.parentId);e.subRows=r(g.subRows,o+1),g=e}a.push(g),l.push(g),i[g.id]=g}}return a};return{rows:r(e),flatRows:l,rowsById:i}}(e,t,n)}function At(){return e=>Be((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter]),((t,n,o)=>{if(!t.rows.length||(null==n||!n.length)&&!o){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}const l=[],i=[];(null!=n?n:[]).forEach((t=>{var n;const o=e.getColumn(t.id);if(!o)return;const i=o.getFilterFn();i&&l.push({id:t.id,filterFn:i,resolvedValue:null!=(n=null==i.resolveFilterValue?void 0:i.resolveFilterValue(t.value))?n:t.value})}));const s=(null!=n?n:[]).map((e=>e.id)),r=e.getGlobalFilterFn(),a=e.getAllLeafColumns().filter((e=>e.getCanGlobalFilter()));let u,d;o&&r&&a.length&&(s.push("__global__"),a.forEach((e=>{var t;i.push({id:e.id,filterFn:r,resolvedValue:null!=(t=null==r.resolveFilterValue?void 0:r.resolveFilterValue(o))?t:o})})));for(let e=0;e<t.flatRows.length;e++){const n=t.flatRows[e];if(n.columnFilters={},l.length)for(let e=0;e<l.length;e++){u=l[e];const t=u.id;n.columnFilters[t]=u.filterFn(n,t,u.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))}if(i.length){for(let e=0;e<i.length;e++){d=i[e];const t=d.id;if(d.filterFn(n,t,d.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))){n.columnFilters.__global__=!0;break}}!0!==n.columnFilters.__global__&&(n.columnFilters.__global__=!1)}}return Vt(t.rows,(e=>{for(let t=0;t<s.length;t++)if(!1===e.columnFilters[s[t]])return!1;return!0}),e)}),Qe(e.options,"debugTable",0,(()=>e._autoResetPageIndex())))}function _t(){return e=>Be((()=>[e.getState().sorting,e.getPreSortedRowModel()]),((t,n)=>{if(!n.rows.length||null==t||!t.length)return n;const o=e.getState().sorting,l=[],i=o.filter((t=>{var n;return null==(n=e.getColumn(t.id))?void 0:n.getCanSort()})),s={};
1i.forEach((t=>{const n=e.getColumn(t.id);n&&(s[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 o=0;o<i.length;o+=1){var n;const l=i[o],r=s[l.id],a=r.sortUndefined,u=null!=(n=null==l?void 0:l.desc)&&n;let d=0;if(a){const n=void 0===e.getValue(l.id),o=void 0===t.getValue(l.id);if(n||o){if("first"===a)return n?-1:1;if("last"===a)return n?1:-1;d=n&&o?0:n?a:-a}}if(0===d&&(d=r.sortingFn(e,t,l.id)),0!==d)return u&&(d*=-1),r.invertSorting&&(d*=-1),d}return e.index-t.index})),t.forEach((e=>{var t;l.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=r(e.subRows))})),t};return{rows:r(n.rows),flatRows:l,rowsById:n.rowsById}}),Qe(e.options,"debugTable",0,(()=>e._autoResetPageIndex())))}function Dt(e,n){return e?function(e){return"function"==typeof e&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}(o=e)||"function"==typeof o||function(e){return"object"==typeof e&&"symbol"==typeof e.$$typeof&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}(o)?t.createElement(e,n):e:null;var o}function zt(e){const n={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[o]=t.useState((()=>({current:Et(n)}))),[l,i]=t.useState((()=>o.current.initialState));return o.current.setOptions((t=>({...t,...e,state:{...l,...e.state},onStateChange:t=>{i(t),null==e.onStateChange||e.onStateChange(t)}}))),o.current}function Lt(e,t){return"function"==typeof e?e(t):e}function Gt(e,t){return n=>{t.setState((t=>({...t,[e]:Lt(n,t[e])})))}}function Ht(e){return e instanceof Function}function qt(e,t,n){let o,l=[];return()=>{let i;n.key&&n.debug&&(i=Date.now());const s=e();if(!(s.length!==l.length||s.some(((e,t)=>l[t]!==e))))return o;let r;if(l=s,n.key&&n.debug&&(r=Date.now()),o=t(...s),null==n||null==n.onChange||n.onChange(o),n.key&&n.debug&&null!=n&&n.debug()){const e=Math.round(100*(Date.now()-i))/100,t=Math.round(100*(Date.now()-r))/100,o=t/16,l=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%câ± ${l(t,5)} /${l(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*o,120))}deg 100% 31%);`,null==n?void 0:n.key)}return o}}function kt(e,t,n){var o;let l={id:null!=(o=n.id)?o: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(l),e},getContext:()=>({table:e,header:l,column:t})};return e._features.forEach((t=>{null==t.createHeader||t.createHeader(l,e)})),l}const Tt={createTable:e=>{e.getHeaderGroups=qt((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((t,n,o,l)=>{var i,s;const r=null!=(i=null==o?void 0:o.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?i:[],a=null!=(s=null==l?void 0:l.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?s:[];return Bt(t,[...r,...n.filter((e=>!(null!=o&&o.includes(e.id)||null!=l&&l.includes(e.id)))),...a],e)}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getCenterHeaderGroups=qt((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((t,n,o,l)=>Bt(t,n=n.filter((e=>!(null!=o&&o.includes(e.id)||null!=l&&l.includes(e.id)))),e,"center")),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getLeftHeaderGroups=qt((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left]),((t,n,o)=>{var l;return Bt(t,null!=(l=null==o?void 0:o.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?l:[],e,"left")}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getRightHeaderGroups=qt((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right]),((t,n,o)=>{var l;return Bt(t,null!=(l=null==o?void 0:o.map((e=>n.find((t=>
1t.id===e)))).filter(Boolean))?l:[],e,"right")}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getFooterGroups=qt((()=>[e.getHeaderGroups()]),(e=>[...e].reverse()),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getLeftFooterGroups=qt((()=>[e.getLeftHeaderGroups()]),(e=>[...e].reverse()),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getCenterFooterGroups=qt((()=>[e.getCenterHeaderGroups()]),(e=>[...e].reverse()),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getRightFooterGroups=qt((()=>[e.getRightHeaderGroups()]),(e=>[...e].reverse()),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getFlatHeaders=qt((()=>[e.getHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getLeftFlatHeaders=qt((()=>[e.getLeftHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getCenterFlatHeaders=qt((()=>[e.getCenterHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getRightFlatHeaders=qt((()=>[e.getRightHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getCenterLeafHeaders=qt((()=>[e.getCenterFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getLeftLeafHeaders=qt((()=>[e.getLeftFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getRightLeafHeaders=qt((()=>[e.getRightFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getLeafHeaders=qt((()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()]),((e,t,n)=>{var o,l,i,s,r,a;return[...null!=(o=null==(l=e[0])?void 0:l.headers)?o:[],...null!=(i=null==(s=t[0])?void 0:s.headers)?i:[],...null!=(r=null==(a=n[0])?void 0:a.headers)?r:[]].map((e=>e.getLeafHeaders())).flat()}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}})}};function Bt(e,t,n,o){var l,i;let s=0;const r=function(e,t){void 0===t&&(t=1),s=Math.max(s,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 l={depth:t,id:[o,`${t}`].filter(Boolean).join("_"),headers:[]},i=[];e.forEach((e=>{const s=[...i].reverse()[0];let r,a=!1;if(e.column.depth===l.depth&&e.column.parent?r=e.column.parent:(r=e.column,a=!0),s&&(null==s?void 0:s.column)===r)s.subHeaders.push(e);else{const l=kt(n,r,{id:[o,t,r.id,null==e?void 0:e.id].filter(Boolean).join("_"),isPlaceholder:a,placeholderId:a?`${i.filter((e=>e.column===r)).length}`:void 0,depth:t,index:i.length});l.subHeaders.push(e),i.push(l)}l.headers.push(e),e.headerGroup=l})),a.push(l),t>0&&u(i,t-1)},d=t.map(((e,t)=>kt(n,e,{depth:s,index:t})));u(d,s-1),a.reverse();const g=e=>e.filter((e=>e.column.getIsVisible())).map((e=>{let t=0,n=0,o=[0];e.subHeaders&&e.subHeaders.length?(o=[],g(e.subHeaders).forEach((e=>{let{colSpan:n,rowSpan:l}=e;t+=n,o.push(l)}))):t=1;return n+=Math.min(...o),e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}}));return g(null!=(l=null==(i=a[0])?void 0:i.headers)?l:[]),a}const Qt={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Ut={getDefaultColumnDef:()=>Qt,getInitialState:e=>({columnSizing:{},columnSizingInfo:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]},...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Gt("columnSizing",e),onColumnSizingInfoChange:Gt("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,o,l;const i=t.getState().columnSizing[e.id];return Math.min(Math.max(null!=(n=e.columnDef.minSize)?n:Qt.minSize,null!=(o=null!=i?i:e.columnDef.size)?o:Qt.size),null!=(l=e.columnDef.maxSize)?l:Qt.maxSize)},e.getStart=n=>{const o=n?"left"===n?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns(),l=o.findIndex((t=>t.id===e.id));if(l>0){const e=o[l-1];return e.getStart(n)+e.getSize()}return 0},e.resetSize=()=>{t.setColumnSizing((t=>{let{[e.id]:n,...o}=t;return o}
vendor: 21,751 bytes, line 1
1))},e.getCanResize=()=>{var n,o;return(null==(n=e.columnDef.enableResizing)||n)&&(null==(o=t.options.enableColumnResizing)||o)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let t=0;const n=e=>{var o;e.subHeaders.length?e.subHeaders.forEach(n):t+=null!=(o=e.column.getSize())?o: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 o=t.getColumn(e.column.id),l=null==o?void 0:o.getCanResize();return i=>{if(!o||!l)return;if(null==i.persist||i.persist(),Nt(i)&&i.touches&&i.touches.length>1)return;const s=e.getSize(),r=e?e.getLeafHeaders().map((e=>[e.column.id,e.column.getSize()])):[[o.id,o.getSize()]],a=Nt(i)?Math.round(i.touches[0].clientX):i.clientX,u={},d=(e,n)=>{"number"==typeof n&&(t.setColumnSizingInfo((e=>{var o,l;const i="rtl"===t.options.columnResizeDirection?-1:1,s=(n-(null!=(o=null==e?void 0:e.startOffset)?o:0))*i,r=Math.max(s/(null!=(l=null==e?void 0:e.startSize)?l: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:s,deltaPercentage:r}})),"onChange"!==t.options.columnResizeMode&&"end"!==e||t.setColumnSizing((e=>({...e,...u}))))},g=e=>d("move",e),c=e=>{d("end",e),t.setColumnSizingInfo((e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]})))},h=n||"undefined"!=typeof document?document:null,f={moveHandler:e=>g(e.clientX),upHandler:e=>{null==h||h.removeEventListener("mousemove",f.moveHandler),null==h||h.removeEventListener("mouseup",f.upHandler),c(e.clientX)}},p={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),g(e.touches[0].clientX),!1),upHandler:e=>{var t;null==h||h.removeEventListener("touchmove",p.moveHandler),null==h||h.removeEventListener("touchend",p.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),c(null==(t=e.touches[0])?void 0:t.clientX)}},m=!!function(){if("boolean"==typeof jt)return jt;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 jt=e,jt}()&&{passive:!1};Nt(i)?(null==h||h.addEventListener("touchmove",p.moveHandler,m),null==h||h.addEventListener("touchend",p.upHandler,m)):(null==h||h.addEventListener("mousemove",f.moveHandler,m),null==h||h.addEventListener("mouseup",f.upHandler,m)),t.setColumnSizingInfo((e=>({...e,startOffset:a,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:r,isResizingColumn:o.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 jt=null;function Nt(e){return"touchstart"===e.type}const Kt={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Gt("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var o,l;if(t){if(null!=(o=null!=(l=e.options.autoResetAll)?l:e.options.autoResetExpanded)?o:!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,o;e.setExpanded(t?{}:null!=(n=null==(o=e.initialState)?void 0:o.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)).forEach((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((o=>{var l;const i=!0===o||!(null==o||!o[e.id]);let s={};if(!0===o?Object.keys(t.getRowModel().rowsById).forEach((e=>{s[e]=!0})):s=o,n=null!=(l=n)?l:!i,!i&&n)return{...s,[e.id]:!0};if(i&&!n){const{[e.id]:t,...n}=s;return n}return o}))},e.getIsExpanded=()=>{var n;const o=t.getState().expanded;return!!(null!=(n=null==t.options.getIsRowExpanded?void 0:t.options.getIsRowExpanded(e))?n:!0===o||(null==o?void 0:o[e.id]))},e.getCanExpand=()=>{var n,o,l;return null!=(n=null==t.options.getRowCanExpand?void 0:t.options.getRowCanExpand(e))?n:(null==(o=t.options.enableExpanding)||o)&&!(null==(l=e.subRows)||!l.length)},e.getIsAllParentsExpanded=()=>{let n=!0,o=e;for(;n&&o.parentId;)o=t.getRow(o.parentId,!0),n=o.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},$t=(e,t,n)=>{var o;const l=n.toLowerCase();return Boolean(null==(o=e.getValue(t))||null==(o=o.toString())||null==(o=o.toLowerCase())?void 0:o.includes(l))};$t.autoRemove=e=>ln(e);const Wt=(e,t,n)=>{var o;return Boolean(null==(o=e.getValue(t))||null==(o=o.toString())?void 0:o.includes(n))};Wt.autoRemove=e=>ln(e);const Xt=(e,t,n)=>{var o;return(null==(o=e.getValue(t))||null==(o=o.toString())?void 0:o.toLowerCase())===(null==n?void 0:n.toLowerCase())};Xt.autoRemove=e=>ln(e);const Jt=(e,t,n)=>{var o;return null==(o=e.getValue(t))?void 0:o.includes(n)};Jt.autoRemove=e=>ln(e)||!(null!=e&&e.length);const Yt=(e,t,n)=>!n.some((n=>{var o;return!(null!=(o=e.getValue(t))&&o.includes(n))}));Yt.autoRemove=e=>ln(e)||!(null!=e&&e.length);const Zt=(e,t,n)=>n.some((n=>{var o;return null==(o=e.getValue(t))?void 0:o.includes(n)}));Zt.autoRemove=e=>ln(e)||!(null!=e&&e.length);const en=(e,t,n)=>e.getValue(t)===n;en.autoRemove=e=>ln(e);const tn=(e,t,n)=>e.getValue(t)==n;tn.autoRemove=e=>ln(e);const nn=(e,t,n)=>{let[o,l]=n;const i=e.getValue(t);return i>=o&&i<=l};nn.resolveFilterValue=e=>{let[t,n]=e,o="number"!=typeof t?parseFloat(t):t,l="number"!=typeof n?parseFloat(n):n,i=null===t||Number.isNaN(o)?-1/0:o,s=null===n||Number.isNaN(l)?1/0:l;if(i>s){const e=i;i=s,s=e}return[i,s]},nn.autoRemove=e=>ln(e)||ln(e[0])&&ln(e[1]);const on={includesString:$t,includesStringSensitive:Wt,equalsString:Xt,arrIncludes:Jt,arrIncludesAll:Yt,arrIncludesSome:Zt,equals:en,weakEquals:tn,inNumberRange:nn};function ln(e){return null==e||""===e}function sn(e,t,n){return!(!e||!e.autoRemove)&&e.autoRemove(t,n)||void 0===t||"string"==typeof t&&!t}const rn={sum:(e,t,n)=>n.reduce(((t,n)=>{const o=n.getValue(e);return t+("number"==typeof o?o:0)}),0),min:(e,t,n)=>{let o;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(o>n||void 0===o&&n>=n)&&(o=n)})),o},max:(e,t,n)=>{let o;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(o<n||void 0===o&&n>=n)&&(o=n)})),o},extent:(e,t,n)=>{let o,l;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(void 0===o?n>=n&&(o=l=n):(o>n&&(o=n),l<n&&(l=n)))})),[o,l]},mean:(e,t)=>{let n=0,o=0;if(t.forEach((t=>{let l=t.getValue(e);null!=l&&(l=+l)>=l&&(++n,o+=l)})),n)return o/n},median:(e,t)=>{if(!t.length)return;const n=t.map((t=>t.getValue(e)));if(o=n,!Array.isArray(o)||!o.every((e=>"number"==typeof e)))return;var o;if(1===n.length)return n[0];const l=Math.floor(n.length/2),i=n.sort(((e,t)=>e-t));return n.length%2!=0?i[l]:(i[l-1]+i[l])/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};const an={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Gt("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),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 o={...n},l=e.getPreGroupedRowModel().flatRows;return t?l.forEach((e=>{e.getCanSelect()&&(o[e.id]=!0)})):l.forEach((e=>{delete o[e.id]})),o}))},e.toggleAllPageRowsSelected=t=>e.setRowSelection((n=>{const o=void 0!==t?t:!e.getIsAllPageRowsSelected(),l={...n};return e.getRowModel().rows.forEach((t=>{un(l,t.id,o,!0,e)})),l})),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=qt((()=>[e.getState().rowSelection,e.getCoreRowModel()]),((t,n)=>Object.keys(t).length?dn(e,n):{rows:[],flatRows:[],rowsById:{}}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable}}),e.getFilteredSelectedRowModel=qt((()=>[e.getState().rowSelection,e.getFilteredRowModel()]),((t,n)=>Object.keys(t).length?dn(e,n):{rows:[],flatRows:[],rowsById:{}}),{key:"getFilteredSelectedRowModel",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable}}),e.getGroupedSelectedRowModel=qt((()=>[e.getState().rowSelection,e.getSortedRowModel()]),((t,n)=>Object.keys(t).length?dn(e,n):{rows:[],flatRows:[],rowsById:{}}),{key:"getGroupedSelectedRowModel",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable}}),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let o=Boolean(t.length&&Object.keys(n).length);return o&&t.some((e=>e.getCanSelect()&&!n[e.id]))&&(o=!1),o},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter((e=>e.getCanSelect())),{rowSelection:n}=e.getState();let o=!!t.length;return o&&t.some((e=>!n[e.id]))&&(o=!1),o},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,o)=>{const l=e.getIsSelected();t.setRowSelection((i=>{var s;if(n=void 0!==n?n:!l,e.getCanSelect()&&l===n)return i;const r={...i};return un(r,e.id,n,null==(s=null==o?void 0:o.selectChildren)||s,t),r}))},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return gn(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return"some"===cn(e,n)},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return"all"===cn(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 o;t&&e.toggleSelected(null==(o=n.target)?void 0:o.checked)}}}},un=(e,t,n,o,l)=>{var i;const s=l.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach((t=>delete e[t])),s.getCanSelect()&&(e[t]=!0)):delete e[t],o&&null!=(i=s.subRows)&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach((t=>un(e,t.id,n,o,l)))};function dn(e,t){const n=e.getState().rowSelection,o=[],l={},i=function(e,t){return e.map((e=>{var t;const s=gn(e,n);if(s&&(o.push(e),l[e.id]=e),null!=(t=e.subRows)&&t.length&&(e={...e,subRows:i(e.subRows)}),s)return e})).filter(Boolean)};return{rows:i(t.rows),flatRows:o,rowsById:l}}function gn(e,t){var n;return null!=(n=t[e.id])&&n}function cn(e,t,n){var o;if(null==(o=e.subRows)||!o.length)return!1;let l=!0,i=!1;return e.subRows.forEach((e=>{if((!i||l)&&(e.getCanSelect()&&(gn(e,t)?i=!0:l=!1),e.subRows&&e.subRows.length)){const n=cn(e,t);"all"===n?i=!0:"some"===n?(i=!0,l=!1):l=!1}})),l?"all":!!i&&"some"}const hn=/([0-9]+)/gm;function fn(e,t){return e===t?0:e>t?1:-1}function pn(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}function mn(e,t){const n=e.split(hn).filter(Boolean),o=t.split(hn).filter(Boolean);for(;n.length&&o.length;){const e=n.shift(),t=o.shift(),l=parseInt(e,10),i=parseInt(t,10),s=[l,i].sort();if(isNaN(s[0])){if(e>t)return 1;if(t>e)return-1}else{if(isNaN(s[1]))return isNaN(l)?-1:1;if(l>i)return 1;if(i>l)return-1}}return n.length-o.length}const vn={alphanumeric:(e,t,n)=>mn(pn(e.getValue(n)).toLowerCase(),pn(t.getValue(n)).toLowerCase()),alphanumericCaseSensitive:(e,t,n)=>mn(pn(e.getValue(n)),pn(t.getValue(n))),text:(e,t,n)=>fn(pn(e.getValue(n)).toLowerCase(),pn(t.getValue(n)).toLowerCase()),textCaseSensitive:(e,t,n)=>fn(pn(e.getValue(n)),pn(t.getValue(n))),datetime:(e,t,n)=>{const o=e.getValue(n),l=t.getValue(n);return o>l?1:o<l?-1:0},basic:(e,t,n)=>fn(e.getValue(n),t.getValue(n))},bn=[Tt,{getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Gt("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,o;return null==(n=null==(o=t.getState().columnVisibility)?void 0:o[e.id])||n},e.getCanHide=()=>{var n,o;return(null==(n=e.columnDef.enableHiding)||n)&&(null==(o=t.options.enableHiding)||o)},e.getToggleVisibilityHandler=()=>t=>{null==e.toggleVisibility||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=qt((()=>[e.getAllCells(),t.getState().columnVisibility]),(e=>e.filter((e=>e.column.getIsVisible()))),{key:"row._getAllVisibleCells",debug:()=>{var e;return null!=(e=t.options.debugAll)?e:t.options.debugRows}}),e.getVisibleCells=qt((()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()]),((e,t,n)=>[...e,...t,...n]),{key:!1,debug:()=>{var e;return null!=(e=t.options.debugAll)?e:t.options.debugRows}})},createTable:e=>{const t=(t,n)=>qt((()=>[n(),n().filter((e=>e.getIsVisible())).map((e=>e.id)).join("_")]),(e=>e.filter((e=>null==e.getIsVisible?void 0:e.getIsVisible()))),{key:t,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugColumns}});e.getVisibleFlatColumns=t("getVisibleFlatColumns",(()=>e.getAllFlatColumns())),e.getVisibleLeafColumns=t("getVisibleLeafColumns",(()=>e.getAllLeafColumns())),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",(()=>e.getLeftLeafColumns())),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",(()=>e.getRightLeafColumns())),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",(()=>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)}}},{getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Gt("columnOrder",e)}),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=qt((()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode]),((e,t,n)=>o=>{let l=[];if(null!=e&&e.length){const t=[...e],n=[...o];for(;n.length&&t.length;){const e=t.shift(),o=n.findIndex((t=>t.id===e));o>-1&&l.push(n.splice(o,1)[0])}l=[...l,...n]}else l=o;return function(e,t,n){if(null==t||!t.length||!n)return e;const o=e.filter((e=>!t.includes(e.id)));return"remove"===n?o:[...t.map((t=>e.find((e=>e.id===t)))).filter(Boolean),...o]}(l,t,n)}),{key:!1})}},{getInitialState:e=>({columnPinning:{left:[],right:[]},rowPinning:{top:[],bottom:[]},...e}),getDefaultOptions:e=>({onColumnPinningChange:Gt("columnPinning",e),onRowPinningChange:Gt("rowPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const o=e.getLeafColumns().map((e=>e.id)).filter(Boolean);t.setColumnPinning((e=>{var t,l,i,s,r,a;return"right"===n?{left:(null!=(i=null==e?void 0:e.left)?i:[]).filter((e=>!(null!=o&&o.includes(e)))),right:[...(null!=(s=null==e?void 0:e.right)?s:[]).filter((e=>!(null!=o&&o.includes(e)))),...o]}:"left"===n?{left:[...(null!=(r=null==e?void 0:e.left)?r:[]).filter((e=>!(null!=o&&o.includes(e)))),...o],right:(null!=(a=null==e?void 0:e.right)?a:[]).filter((e=>!(null!=o&&o.includes(e))))}:{left:(null!=(t=null==e?void 0:e.left)?t:[]).filter((e=>!(null!=o&&o.includes(e)))),right:(null!=(l=null==e?void 0:e.right)?l:[]).filter((e=>!(null!=o&&o.includes(e))))}}))},e.getCanPin=()=>e.getLeafColumns().some((e=>{var n,o,l;return(null==(n=e.columnDef.enablePinning)||n)&&(null==(o=null!=(l=t.options.enableColumnPinning)?l:t.options.enablePinning)||o)})),e.getIsPinned=()=>{const n=e.getLeafColumns().map((e=>e.id)),{left:o,right:l}=t.getState().columnPinning,i=n.some((e=>null==o?void 0:o.includes(e))),s=n.some((e=>null==l?void 0:l.includes(e)));return i?"left":!!s&&"right"},e.getPinnedIndex=()=>{var n,o;const l=e.getIsPinned();return l?null!=(n=null==(o=t.getState().columnPinning)||null==(o=o[l])?void 0:o.indexOf(e.id))?n:-1:0}},createRow:(e,t)=>{e.pin=(n,o,l)=>{const i=o?e.getLeafRows().map((e=>{let{id:t}=e;return t})):[],s=l?e.getParentRows().map((e=>{let{id:t}=e;return t})):[],r=new Set([...s,e.id,...i]);t.setRowPinning((e=>{var t,o,l,i,s,a;return"bottom"===n?{top:(null!=(l=null==e?void 0:e.top)?l:[]).filter((e=>!(null!=r&&r.has(e)))),bottom:[...(null!=(i=null==e?void 0:e.bottom)?i:[]).filter((e=>!(null!=r&&r.has(e)))),...Array.from(r)]}:"top"===n?{top:[...(null!=(s=null==e?void 0:e.top)?s:[]).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!=(o=null==e?void 0:e.bottom)?o:[]).filter((e=>!(null!=r&&r.has(e))))}}))},e.getCanPin=()=>{var n;const{enableRowPinning:o,enablePinning:l}=t.options;return"function"==typeof o?o(e):null==(n=null!=o?o:l)||n},e.getIsPinned=()=>{const n=[e.id],{top:o,bottom:l}=t.getState().rowPinning,i=n.some((e=>null==o?void 0:o.includes(e))),s=n.some((e=>null==l?void 0:l.includes(e)));return i?"top":!!s&&"bottom"},e.getPinnedIndex=()=>{var n,o;const l=e.getIsPinned();if(!l)return-1;const i=null==(n=t._getPinnedRows(l))?void 0:n.map((e=>{let{id:t}=e;return t}));return null!=(o=null==i?void 0:i.indexOf(e.id))?o:-1},e.getCenterVisibleCells=qt((()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right]),((e,t,n)=>{const o=[...null!=t?t:[],...null!=n?n:[]];return e.filter((e=>!o.includes(e.column.id)))}),{key:!1,debug:()=>{var e;return null!=(e=t.options.debugAll)?e:t.options.debugRows}}),e.getLeftVisibleCells=qt((()=>[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"})))),{key:!1,debug:()=>{var e;return null!=(e=t.options.debugAll)?e:t.options.debugRows}}),e.getRightVisibleCells=qt((()=>[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"})))),{key:!1,debug:()=>{var e;return null!=(e=t.options.debugAll)?e:t.options.debugRows}})},createTable:e=>{e.setColumnPinning=t=>null==e.options.onColumnPinningChange?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,o;
1return e.setColumnPinning(t?{left:[],right:[]}:null!=(n=null==(o=e.initialState)?void 0:o.columnPinning)?n:{left:[],right:[]})},e.getIsSomeColumnsPinned=t=>{var n;const o=e.getState().columnPinning;var l,i;return t?Boolean(null==(n=o[t])?void 0:n.length):Boolean((null==(l=o.left)?void 0:l.length)||(null==(i=o.right)?void 0:i.length))},e.getLeftLeafColumns=qt((()=>[e.getAllLeafColumns(),e.getState().columnPinning.left]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.id===t)))).filter(Boolean)),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugColumns}}),e.getRightLeafColumns=qt((()=>[e.getAllLeafColumns(),e.getState().columnPinning.right]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.id===t)))).filter(Boolean)),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugColumns}}),e.getCenterLeafColumns=qt((()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((e,t,n)=>{const o=[...null!=t?t:[],...null!=n?n:[]];return e.filter((e=>!o.includes(e.id)))}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugColumns}}),e.setRowPinning=t=>null==e.options.onRowPinningChange?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,o;return e.setRowPinning(t?{top:[],bottom:[]}:null!=(n=null==(o=e.initialState)?void 0:o.rowPinning)?n:{top:[],bottom:[]})},e.getIsSomeRowsPinned=t=>{var n;const o=e.getState().rowPinning;var l,i;return t?Boolean(null==(n=o[t])?void 0:n.length):Boolean((null==(l=o.top)?void 0:l.length)||(null==(i=o.bottom)?void 0:i.length))},e._getPinnedRows=t=>qt((()=>[e.getRowModel().rows,e.getState().rowPinning[t]]),((n,o)=>{var l;return(null==(l=e.options.keepPinnedRows)||l?(null!=o?o:[]).map((t=>{const n=e.getRow(t,!0);return n.getIsAllParentsExpanded()?n:null})):(null!=o?o:[]).map((e=>n.find((t=>t.id===e))))).filter(Boolean).map((e=>({...e,position:t})))}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugRows}})(),e.getTopRows=()=>e._getPinnedRows("top"),e.getBottomRows=()=>e._getPinnedRows("bottom"),e.getCenterRows=qt((()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom]),((e,t,n)=>{const o=new Set([...null!=t?t:[],...null!=n?n:[]]);return e.filter((e=>!o.has(e.id)))}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugRows}})}},{getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:Gt("columnFilters",e),onGlobalFilterChange:Gt("globalFilter",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100,globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const o=null==(n=e.getCoreRowModel().flatRows[0])||null==(n=n._getAllCellsByColumnId()[t.id])?void 0:n.getValue();return"string"==typeof o||"number"==typeof o}}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],o=null==n?void 0:n.getValue(e.id);return"string"==typeof o?on.includesString:"number"==typeof o?on.inNumberRange:"boolean"==typeof o||null!==o&&"object"==typeof o?on.equals:Array.isArray(o)?on.arrIncludes:on.weakEquals},e.getFilterFn=()=>{var n,o;return Ht(e.columnDef.filterFn)?e.columnDef.filterFn:"auto"===e.columnDef.filterFn?e.getAutoFilterFn():null!=(n=null==(o=t.options.filterFns)?void 0:o[e.columnDef.filterFn])?n:on[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,o,l;return(null==(n=e.columnDef.enableColumnFilter)||n)&&(null==(o=t.options.enableColumnFilters)||o)&&(null==(l=t.options.enableFilters)||l)&&!!e.accessorFn},e.getCanGlobalFilter=()=>{var n,o,l,i;return(null==(n=e.columnDef.enableGlobalFilter)||n)&&(null==(o=t.options.enableGlobalFilter)||o)&&(null==(l=t.options.enableFilters)||l)&&(null==(i=null==t.options.getColumnCanGlobalFilter?void 0:t.options.getColumnCanGlobalFilter(e))||i)&&!!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,o;return null!=(n=null==(o=t.getState().columnFilters)?void 0:o.findIndex((t=>t.id===e.id)))?n:-1},e.setFilterValue=n=>{t.setColumnFilters((t=>{const o=e.getFilterFn(),l=null==t?void 0:t.find((t=>t.id===e.id)),i=Lt(n,l?l.value:void 0);var s;if(sn(o,i,e))return null!=(s=null==t?void 0:t.filter((t=>
1t.id!==e.id)))?s:[];const r={id:e.id,value:i};var a;return l?null!=(a=null==t?void 0:t.map((t=>t.id===e.id?r:t)))?a:[]:null!=t&&t.length?[...t,r]:[r]}))},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()}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.getGlobalAutoFilterFn=()=>on.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:o}=e.options;return Ht(o)?o:"auto"===o?e.getGlobalAutoFilterFn():null!=(t=null==(n=e.options.filterFns)?void 0:n[o])?t:on[o]},e.setColumnFilters=t=>{const n=e.getAllLeafColumns();null==e.options.onColumnFiltersChange||e.options.onColumnFiltersChange((e=>{var o;return null==(o=Lt(t,e))?void 0:o.filter((e=>{const t=n.find((t=>t.id===e.id));if(t){if(sn(t.getFilterFn(),e.value,t))return!1}return!0}))}))},e.setGlobalFilter=t=>{null==e.options.onGlobalFilterChange||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)},e.resetColumnFilters=t=>{var n,o;e.setColumnFilters(t?[]:null!=(n=null==(o=e.initialState)?void 0:o.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()),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=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Gt("sorting",e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let o=!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 vn.datetime;if("string"==typeof n&&(o=!0,n.split(hn).length>1))return vn.alphanumeric}return o?vn.text:vn.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,o;if(!e)throw new Error;return Ht(e.columnDef.sortingFn)?e.columnDef.sortingFn:"auto"===e.columnDef.sortingFn?e.getAutoSortingFn():null!=(n=null==(o=t.options.sortingFns)?void 0:o[e.columnDef.sortingFn])?n:vn[e.columnDef.sortingFn]},e.toggleSorting=(n,o)=>{const l=e.getNextSortingOrder(),i=null!=n;t.setSorting((s=>{const r=null==s?void 0:s.find((t=>t.id===e.id)),a=null==s?void 0:s.findIndex((t=>t.id===e.id));let u,d=[],g=i?n:"desc"===l;var c;(u=null!=s&&s.length&&e.getCanMultiSort()&&o?r?"toggle":"add":null!=s&&s.length&&a!==s.length-1?"replace":r?"toggle":"replace","toggle"===u&&(i||l||(u="remove")),"add"===u)?(d=[...s,{id:e.id,desc:g}],d.splice(0,d.length-(null!=(c=t.options.maxMultiSortColCount)?c:Number.MAX_SAFE_INTEGER))):d="toggle"===u?s.map((t=>t.id===e.id?{...t,desc:g}:t)):"remove"===u?s.filter((t=>
vendor: 4,207 bytes, line 1
1t.id!==e.id)):[{id:e.id,desc:g}];return d}))},e.getFirstSortDir=()=>{var n,o;return(null!=(n=null!=(o=e.columnDef.sortDescFirst)?o:t.options.sortDescFirst)?n:"desc"===e.getAutoSortDir())?"desc":"asc"},e.getNextSortingOrder=n=>{var o,l;const i=e.getFirstSortDir(),s=e.getIsSorted();return s?!!(s===i||null!=(o=t.options.enableSortingRemoval)&&!o||n&&null!=(l=t.options.enableMultiRemove)&&!l)&&("desc"===s?"asc":"desc"):i},e.getCanSort=()=>{var n,o;return(null==(n=e.columnDef.enableSorting)||n)&&(null==(o=t.options.enableSorting)||o)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,o;return null!=(n=null!=(o=e.columnDef.enableMultiSort)?o:t.options.enableMultiSort)?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const o=null==(n=t.getState().sorting)?void 0:n.find((t=>t.id===e.id));return!!o&&(o.desc?"desc":"asc")},e.getSortIndex=()=>{var n,o;return null!=(n=null==(o=t.getState().sorting)?void 0:o.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 o=>{n&&(null==o.persist||o.persist(),null==e.toggleSorting||e.toggleSorting(void 0,!!e.getCanMultiSort()&&(null==t.options.isMultiSortEvent?void 0:t.options.isMultiSortEvent(o))))}}},createTable:e=>{e.setSorting=t=>null==e.options.onSortingChange?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,o;e.setSorting(t?[]:null!=(n=null==(o=e.initialState)?void 0:o.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())}},{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:Gt("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,o,l,i;return null!=(n=null==(o=null!=(l=null==(i=e.columnDef.enableGrouping)||i)?l:t.options.enableGrouping)||o)?n:!!e.accessorFn},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],o=null==n?void 0:n.getValue(e.id);return"number"==typeof o?rn.sum:"[object Date]"===Object.prototype.toString.call(o)?rn.extent:void 0},e.getAggregationFn=()=>{var n,o;if(!e)throw new Error;return Ht(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:"auto"===e.columnDef.aggregationFn?e.getAutoAggregationFn():null!=(n=null==(o=t.options.aggregationFns)?void 0:o[e.columnDef.aggregationFn])?n:rn[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>null==e.options.onGroupingChange?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,o;e.setGrouping(t?[]:null!=(n=null==(o=e.initialState)?void 0:o.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 o=t.getColumn(n);return null!=o&&o.columnDef.getGroupingValue?(e._groupingValuesCache[n]=o.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,o)=>{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)||
1!t.length)}}},Kt,{getInitialState:e=>({...e,pagination:{pageIndex:0,pageSize:10,...null==e?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Gt("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var o,l;if(t){if(null!=(o=null!=(l=e.options.autoResetAll)?l:e.options.autoResetPageIndex)?o:!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=>Lt(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 o=Lt(t,n.pageIndex);const l=void 0===e.options.pageCount||-1===e.options.pageCount?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,l)),{...n,pageIndex:o}}))},e.resetPageIndex=t=>{var n,o;e.setPageIndex(t?0:null!=(n=null==(o=e.initialState)||null==(o=o.pagination)?void 0:o.pageIndex)?n:0)},e.resetPageSize=t=>{var n,o;e.setPageSize(t?10:null!=(n=null==(o=e.initialState)||null==(o=o.pagination)?void 0:o.pageSize)?n:10)},e.setPageSize=t=>{e.setPagination((e=>{const n=Math.max(1,Lt(t,e.pageSize)),o=e.pageSize*e.pageIndex,l=Math.floor(o/n);return{...e,pageIndex:l,pageSize:n}}))},e.setPageCount=t=>e.setPagination((n=>{var o;let l=Lt(t,null!=(o=e.options.pageCount)?o:-1);return"number"==typeof l&&(l=Math.max(-1,l)),{...n,pageCount:l}})),e.getPageOptions=qt((()=>[e.getPageCount()]),(e=>{let t=[];return e&&e>0&&(t=[...new Array(e)].fill(null).map(((e,t)=>t))),t}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable}}),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:t}=e.getState().pagination,n=e.getPageCount();
1return-1===n||0!==n&&t<n-1},e.previousPage=()=>e.setPageIndex((e=>e-1)),e.nextPage=()=>e.setPageIndex((e=>e+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.getPrePaginationRowModel().rows.length/e.getState().pagination.pageSize)}}},an,Ut];function Sn(e){var t;(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let n={_features:bn};const o=n._features.reduce(((e,t)=>Object.assign(e,null==t.getDefaultOptions?void 0:t.getDefaultOptions(n))),{});let l={...null!=(t=e.initialState)?t:{}};n._features.forEach((e=>{var t;l=null!=(t=null==e.getInitialState?void 0:e.getInitialState(l))?t:l}));const i=[];let s=!1;const r={_features:bn,options:{...o,...e},initialState:l,_queue:e=>{i.push(e),s||(s=!0,Promise.resolve().then((()=>{for(;i.length;)i.shift()();s=!1})).catch((e=>setTimeout((()=>{throw e})))))},reset:()=>{n.setState(n.initialState)},setOptions:e=>{const t=Lt(e,n.options);var l;n.options=(l=t,n.options.mergeOptions?n.options.mergeOptions(o,l):{...o,...l})},getState:()=>n.options.state,setState:e=>{null==n.options.onStateChange||n.options.onStateChange(e)},_getRowId:(e,t,o)=>{var l;return null!=(l=null==n.options.getRowId?void 0:n.options.getRowId(e,t,o))?l:`${o?[o.id,t].join("."):t}`},getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:(e,t)=>{let o=(t?n.getPrePaginationRowModel():n.getRowModel()).rowsById[e];if(!o&&(o=n.getCoreRowModel().rowsById[e],!o))throw new Error;return o},_getDefaultColumnDef:qt((()=>[n.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},...n._features.reduce(((e,t)=>Object.assign(e,null==t.getDefaultColumnDef?void 0:t.getDefaultColumnDef())),{}),...e}}),{debug:()=>{var e;return null!=(e=n.options.debugAll)?e:n.options.debugColumns},key:!1}),_getColumnDefs:()=>n.options.columns,getAllColumns:qt((()=>[n._getColumnDefs()]),(e=>{const t=function(e,o,l){return void 0===l&&(l=0),e.map((e=>{const i=function(e,t,n,o){var l,i;const s={...e._getDefaultColumnDef(),...t},r=s.accessorKey;let a,u=null!=(l=null!=(i=s.id)?i:r?r.replace(".","_"):void 0)?l:"string"==typeof s.header?s.header:void 0;if(s.accessorFn?a=s.accessorFn:r&&(a=r.includes(".")?e=>{let t=e;for(const o of r.split(".")){var n;t=null==(n=t)?void 0:n[o]}return t}:e=>e[s.accessorKey]),!u)throw new Error;let d={id:`${String(u)}`,accessorFn:a,parent:o,depth:n,columnDef:s,columns:[],getFlatColumns:qt((()=>[!0]),(()=>{var e;return[d,...null==(e=d.columns)?void 0:e.flatMap((e=>e.getFlatColumns()))]}),{key:"column.getFlatColumns",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugColumns}}),getLeafColumns:qt((()=>[e._getOrderColumnsFn()]),(e=>{var t;return null!=(t=d.columns)&&t.length?e(d.columns.flatMap((e=>e.getLeafColumns()))):[d]}),{key:"column.getLeafColumns",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugColumns}})};for(const g of e._features)null==g.createColumn||g.createColumn(d,e);return d}(n,e,l,o),s=e;return i.columns=s.columns?t(s.columns,i,l+1):[],i}))};return t(e)}),{key:!1,debug:()=>{var e;return null!=(e=n.options.debugAll)?e:n.options.debugColumns}}),getAllFlatColumns:qt((()=>[n.getAllColumns()]),(e=>e.flatMap((e=>e.getFlatColumns()))),{key:!1,debug:()=>{var e;return null!=(e=n.options.debugAll)?e:n.options.debugColumns}}),_getAllFlatColumnsById:qt((()=>[n.getAllFlatColumns()]),(e=>e.reduce(((e,t)=>(e[t.id]=t,e)),{})),{key:!1,debug:()=>{var e;return null!=(e=n.options.debugAll)?e:n.options.debugColumns}}),getAllLeafColumns:qt((()=>[n.getAllColumns(),n._getOrderColumnsFn()]),((e,t)=>t(e.flatMap((e=>e.getLeafColumns())))),{key:!1,debug:()=>{var e;return null!=(e=n.options.debugAll)?e:n.options.debugColumns}}),getColumn:e=>n._getAllFlatColumnsById()[e]};Object.assign(n,r);for(let a=0;a<n._features.length;a++){const e=n._features[a];null==e||null==e.createTable||e.createTable(n)}return n}const wn=(e,t,n,o,l,i,s)=>{let r={id:t,index:o,original:n,depth:l,parentId:s,_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,o),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,o),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=[],o=e=>{e.forEach((e=>{n.push(e);const l=t(e);null!=l&&l.length&&o(l)}))};return o(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:qt((()=>[e.getAllLeafColumns()]),(t=>t.map((t=>function(e,t,n,o){const l={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(o),renderValue:()=>{var t;return null!=(t=l.getValue())?t:e.options.renderFallbackValue},getContext:qt((()=>[e,n,t,l]),((e,t,n,o)=>({table:e,column:t,row:n,cell:o,getValue:o.getValue,renderValue:o.renderValue})),{key:!1,debug:()=>e.options.debugAll})};
1return e._features.forEach((o=>{null==o.createCell||o.createCell(l,n,t,e)}),{}),l}(e,r,t,t.id)))),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugRows}}),_getAllCellsByColumnId:qt((()=>[r.getAllCells()]),(e=>e.reduce(((e,t)=>(e[t.column.id]=t,e)),{})),{key:"row.getAllCellsByColumnId",debug:()=>{var t;return null!=(t=e.options.debugAll)?t: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};function Cn(){return e=>qt((()=>[e.options.data]),(t=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(t,l,i){void 0===l&&(l=0);const s=[];for(let a=0;a<t.length;a++){const u=wn(e,e._getRowId(t[a],a,i),t[a],a,l,void 0,null==i?void 0:i.id);var r;if(n.flatRows.push(u),n.rowsById[u.id]=u,s.push(u),e.options.getSubRows)u.originalSubRows=e.options.getSubRows(t[a],a),null!=(r=u.originalSubRows)&&r.length&&(u.subRows=o(u.originalSubRows,l+1,u))}return s};return n.rows=o(t),n}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function Rn(e,t,n){return n.options.filterFromLeafRows?function(e,t,n){var o;const l=[],i={},s=null!=(o=n.options.maxLeafRowFilterDepth)?o:100,r=function(e,o){void 0===o&&(o=0);const a=[];for(let d=0;d<e.length;d++){var u;let g=e[d];const c=wn(n,g.id,g.original,g.index,g.depth,void 0,g.parentId);if(c.columnFilters=g.columnFilters,null!=(u=g.subRows)&&u.length&&o<s){if(c.subRows=r(g.subRows,o+1),g=c,t(g)&&!c.subRows.length){a.push(g),i[g.id]=g,l.push(g);continue}if(t(g)||c.subRows.length){a.push(g),i[g.id]=g,l.push(g);continue}}else g=c,t(g)&&(a.push(g),i[g.id]=g,l.push(g))}return a};return{rows:r(e),flatRows:l,rowsById:i}}(e,t,n):function(e,t,n){var o;const l=[],i={},s=null!=(o=n.options.maxLeafRowFilterDepth)?o:100,r=function(e,o){void 0===o&&(o=0);const a=[];for(let d=0;d<e.length;d++){let g=e[d];if(t(g)){var u;if(null!=(u=g.subRows)&&u.length&&o<s){const e=wn(n,g.id,g.original,g.index,g.depth,void 0,g.parentId);e.subRows=r(g.subRows,o+1),g=e}a.push(g),l.push(g),i[g.id]=g}}return a};return{rows:r(e),flatRows:l,rowsById:i}}(e,t,n)}function yn(){return e=>qt((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter]),((t,n,o)=>{if(!t.rows.length||(null==n||!n.length)&&!o){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}const l=[],i=[];(null!=n?n:[]).forEach((t=>{var n;const o=e.getColumn(t.id);if(!o)return;const i=o.getFilterFn();i&&l.push({id:t.id,filterFn:i,resolvedValue:null!=(n=null==i.resolveFilterValue?void 0:i.resolveFilterValue(t.value))?n:t.value})}));const s=n.map((e=>e.id)),r=e.getGlobalFilterFn(),a=e.getAllLeafColumns().filter((e=>e.getCanGlobalFilter()));let u,d;o&&r&&a.length&&(s.push("__global__"),a.forEach((e=>{var t;i.push({id:e.id,filterFn:r,resolvedValue:null!=(t=null==r.resolveFilterValue?void 0:r.resolveFilterValue(o))?t:o})})));for(let e=0;e<t.flatRows.length;e++){const n=t.flatRows[e];if(n.columnFilters={},l.length)for(let e=0;e<l.length;e++){u=l[e];const t=u.id;n.columnFilters[t]=u.filterFn(n,t,u.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))}if(i.length){for(let e=0;e<i.length;e++){d=i[e];const t=d.id;if(d.filterFn(n,t,d.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))){n.columnFilters.__global__=!0;break}}!0!==n.columnFilters.__global__&&(n.columnFilters.__global__=!1)}}return Rn(t.rows,(e=>{for(let t=0;t<s.length;t++)if(!1===e.columnFilters[s[t]])return!1;return!0}),e)}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function Fn(){return e=>qt((()=>[e.getState().sorting,e.getPreSortedRowModel()]),((t,n)=>{if(!n.rows.length||null==t||!t.length)return n;const o=e.getState().sorting,l=[],i=o.filter((t=>{var n;return null==(n=e.getColumn(t.id))?void 0:n.getCanSort()})),s={};i.forEach((t=>{const n=e.getColumn(t.id);n&&(s[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 o=0;o<i.length;o+=1){var n;const l=i[o],r=s[l.id],a=null!=(n=null==l?void 0:l.desc)&&n;let u=0;if(r.sortUndefined){const n=void 0===e.getValue(l.id),o=void 0===t.getValue(l.id);(n||o)&&(u=n&&o?0:n?r.sortUndefined:-r.sortUndefined)}if(0===u&&(u=r.sortingFn(e,t,l.id)),0!==u)return a&&(u*=-1),r.invertSorting&&(u*=-1),u}return e.index-t.index})),t.forEach((e=>{var t;l.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=r(e.subRows))})),t};return{rows:r(n.rows),flatRows:l,rowsById:n.rowsById}}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function Mn(e){return e=>qt((()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded]),((t,n)=>{if(!n.rows.length)return n;const{pageSize:o,pageIndex:l}=t;let{rows:i,flatRows:s,rowsById:r}=n;const a=o*l,u=a+o;let d;i=i.slice(a,u),d=e.options.paginateExpandedRows?{rows:i,flatRows:s,rowsById:r}:function(e){const t=[],n=e=>{var o;t.push(e),null!=(o=e.subRows)&&o.length&&e.getIsExpanded()&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}({rows:i,flatRows:s,rowsById:r}),d.flatRows=[];const g=e=>{d.flatRows.push(e),e.subRows.length&&e.subRows.forEach(g)};return d.rows.forEach(g),d}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable}})}function Pn(e,n){return e?function(e){return"function"==typeof e&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}(o=e)||"function"==typeof o||function(e){return"object"==typeof e&&"symbol"==typeof e.$$typeof&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}(o)?t.createElement(e,n):e:null;var o}function xn(e){const n={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[o]=t.useState((()=>({current:Sn(n)}))),[l,i]=t.useState((()=>o.current.initialState));return o.current.setOptions((t=>({...t,...e,state:{...l,...e.state},onStateChange:t=>{i(t),null==e.onStateChange||e.onStateChange(t)}
1}))),o.current}export{j as Q,Fe as R,Ge as V,Ve as a,_t as b,Ot as c,we as d,Le as e,Dt as f,At as g,le as h,Ce as i,ye as j,be as k,xn as l,Cn as m,Pn as n,De as o,Mn as p,yn as q,Fn as r,G as s,ie as t,zt as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.