@espresso-lab/mantine-data-table 1.9.45 → 1.9.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DataTable/DataTableInner.d.ts +1 -1
- package/dist/index.es.js +3331 -3314
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +9 -9
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
(function(we,
|
|
1
|
+
(function(we,G){typeof exports=="object"&&typeof module<"u"?G(exports,require("react"),require("@mantine/core"),require("@mantine/form"),require("@tabler/icons-react"),require("@mantine/hooks")):typeof define=="function"&&define.amd?define(["exports","react","@mantine/core","@mantine/form","@tabler/icons-react","@mantine/hooks"],G):(we=typeof globalThis<"u"?globalThis:we||self,G(we.MantineDataTable={},we.React,we.MantineCore,we.MantineForm,we.TablerIconsReact,we.MantineHooks))})(this,(function(we,G,T,On,jt,Le){"use strict";function Bs(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const Re=Bs(G);function An(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Qt={exports:{}},Tr={};var En;function Is(){if(En)return Tr;En=1;var t=G.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return Tr.c=function(e){return t.H.useMemoCache(e)},Tr}var jr={};var Tn;function Ys(){return Tn||(Tn=1,process.env.NODE_ENV!=="production"&&(function(){var t=G.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;jr.c=function(e){var r=t.H;return r===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
2
2
|
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
3
3
|
2. You might be breaking the Rules of Hooks
|
|
4
4
|
3. You might have more than one copy of React in the same app
|
|
5
|
-
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),r.useMemoCache(e)}})()),jr}var jn;function zs(){return jn||(jn=1,process.env.NODE_ENV==="production"?Qt.exports=Is():Qt.exports=Ys()),Qt.exports}var Qe=zs(),Zt=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Fs={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Ws=class{#t=Fs;#e=!1;setTimeoutProvider(t){process.env.NODE_ENV!=="production"&&this.#e&&t!==this.#t&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:this.#t,provider:t}),this.#t=t,process.env.NODE_ENV!=="production"&&(this.#e=!1)}setTimeout(t,e){return process.env.NODE_ENV!=="production"&&(this.#e=!0),this.#t.setTimeout(t,e)}clearTimeout(t){this.#t.clearTimeout(t)}setInterval(t,e){return process.env.NODE_ENV!=="production"&&(this.#e=!0),this.#t.setInterval(t,e)}clearInterval(t){this.#t.clearInterval(t)}},Kt=new Ws;function Us(t){setTimeout(t,0)}var $t=typeof window>"u"||"Deno"in globalThis;function Jt(){}function $n(t){return typeof t=="number"&&t>=0&&t!==1/0}function qs(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Rt(t,e){return typeof t=="function"?t(e):t}function Ze(t,e){return typeof t=="function"?t(e):t}function Rn(t){return JSON.stringify(t,(e,r)=>Rr(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}var Vs=Object.prototype.hasOwnProperty;function $r(t,e){if(t===e)return t;const r=Nn(t)&&Nn(e);if(!r&&!(Rr(t)&&Rr(e)))return e;const s=(r?t:Object.keys(t)).length,c=r?e:Object.keys(e),h=c.length,a=r?new Array(h):{};let g=0;for(let y=0;y<h;y++){const _=r?y:c[y],P=t[_],S=e[_];if(P===S){a[_]=P,(r?y<s:Vs.call(t,_))&&g++;continue}if(P===null||S===null||typeof P!="object"||typeof S!="object"){a[_]=S;continue}const x=$r(P,S);a[_]=x,x===P&&g++}return s===h&&g===s?t:a}function Xt(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const r in t)if(t[r]!==e[r])return!1;return!0}function Nn(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Rr(t){if(!Ln(t))return!1;const e=t.constructor;if(e===void 0)return!0;const r=e.prototype;return!(!Ln(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Ln(t){return Object.prototype.toString.call(t)==="[object Object]"}function Bn(t,e,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(t,e);if(r.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return $r(t,e)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return $r(t,e)}return e}function In(t,e){return typeof t=="function"?t(...e):!!t}var Hs=class extends Zt{#t;#e;#r;constructor(){super(),this.#r=t=>{if(!$t&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#e||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#r=t,this.#e?.(),this.#e=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#t!==t&&(this.#t=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},Gs=new Hs;function Yn(){let t,e;const r=new Promise((s,c)=>{t=s,e=c});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),t(s)},r.reject=s=>{n({status:"rejected",reason:s}),e(s)},r}var Qs=Us;function Zs(){let t=[],e=0,r=a=>{a()},n=a=>{a()},s=Qs;const c=a=>{e?t.push(a):s(()=>{r(a)})},h=()=>{const a=t;t=[],a.length&&s(()=>{n(()=>{a.forEach(g=>{r(g)})})})};return{batch:a=>{let g;e++;try{g=a()}finally{e--,e||h()}return g},batchCalls:a=>(...g)=>{c(()=>{a(...g)})},schedule:c,setNotifyFunction:a=>{r=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{s=a}}}var er=Zs(),Ks=class extends Zt{#t=!0;#e;#r;constructor(){super(),this.#r=t=>{if(!$t&&window.addEventListener){const e=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#e||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#r=t,this.#e?.(),this.#e=t(this.setOnline.bind(this))}setOnline(t){this.#t!==t&&(this.#t=t,this.listeners.forEach(r=>{r(t)}))}isOnline(){return this.#t}},Js=new Ks;function Xs(t){return(t??"online")==="online"?Js.isOnline():!0}function ei(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Xs(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}var ti=class extends Zt{constructor(t,e){super(),this.options=e,this.#t=t,this.#a=null,this.#i=Yn(),this.bindMethods(),this.setOptions(e)}#t;#e=void 0;#r=void 0;#n=void 0;#o;#s;#i;#a;#g;#h;#f;#u;#c;#l;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),zn(this.#e,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Nr(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Nr(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#w(),this.#_(),this.#e.removeObserver(this)}setOptions(t){const e=this.options,r=this.#e;if(this.options=this.#t.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ze(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#C(),this.#e.setOptions(this.options),e._defaulted&&!Xt(this.options,e)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const n=this.hasListeners();n&&Fn(this.#e,r,this.options,e)&&this.#d(),this.updateResult(),n&&(this.#e!==r||Ze(this.options.enabled,this.#e)!==Ze(e.enabled,this.#e)||Rt(this.options.staleTime,this.#e)!==Rt(e.staleTime,this.#e))&&this.#m();const s=this.#y();n&&(this.#e!==r||Ze(this.options.enabled,this.#e)!==Ze(e.enabled,this.#e)||s!==this.#l)&&this.#v(s)}getOptimisticResult(t){const e=this.#t.getQueryCache().build(this.#t,t),r=this.createResult(e,t);return ni(this,r)&&(this.#n=r,this.#s=this.options,this.#o=this.#e.state),r}getCurrentResult(){return this.#n}trackResult(t,e){return new Proxy(t,{get:(r,n)=>(this.trackProp(n),e?.(n),n==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#i.status==="pending"&&this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,n))})}trackProp(t){this.#p.add(t)}getCurrentQuery(){return this.#e}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#t.defaultQueryOptions(t),r=this.#t.getQueryCache().build(this.#t,e);return r.fetch().then(()=>this.createResult(r,e))}fetch(t){return this.#d({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#n))}#d(t){this.#C();let e=this.#e.fetch(this.options,t);return t?.throwOnError||(e=e.catch(Jt)),e}#m(){this.#w();const t=Rt(this.options.staleTime,this.#e);if($t||this.#n.isStale||!$n(t))return;const r=qs(this.#n.dataUpdatedAt,t)+1;this.#u=Kt.setTimeout(()=>{this.#n.isStale||this.updateResult()},r)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#v(t){this.#_(),this.#l=t,!($t||Ze(this.options.enabled,this.#e)===!1||!$n(this.#l)||this.#l===0)&&(this.#c=Kt.setInterval(()=>{(this.options.refetchIntervalInBackground||Gs.isFocused())&&this.#d()},this.#l))}#b(){this.#m(),this.#v(this.#y())}#w(){this.#u&&(Kt.clearTimeout(this.#u),this.#u=void 0)}#_(){this.#c&&(Kt.clearInterval(this.#c),this.#c=void 0)}createResult(t,e){const r=this.#e,n=this.options,s=this.#n,c=this.#o,h=this.#s,g=t!==r?t.state:this.#r,{state:y}=t;let _={...y},P=!1,S;if(e._optimisticResults){const J=this.hasListeners(),q=!J&&zn(t,e),H=J&&Fn(t,r,e,n);(q||H)&&(_={..._,...ei(y.data,t.options)}),e._optimisticResults==="isRestoring"&&(_.fetchStatus="idle")}let{error:x,errorUpdatedAt:k,status:O}=_;S=_.data;let N=!1;if(e.placeholderData!==void 0&&S===void 0&&O==="pending"){let J;s?.isPlaceholderData&&e.placeholderData===h?.placeholderData?(J=s.data,N=!0):J=typeof e.placeholderData=="function"?e.placeholderData(this.#f?.state.data,this.#f):e.placeholderData,J!==void 0&&(O="success",S=Bn(s?.data,J,e),P=!0)}if(e.select&&S!==void 0&&!N)if(s&&S===c?.data&&e.select===this.#g)S=this.#h;else try{this.#g=e.select,S=e.select(S),S=Bn(s?.data,S,e),this.#h=S,this.#a=null}catch(J){this.#a=J}this.#a&&(x=this.#a,S=this.#h,k=Date.now(),O="error");const F=_.fetchStatus==="fetching",B=O==="pending",Z=O==="error",U=B&&F,ee=S!==void 0,K={status:O,fetchStatus:_.fetchStatus,isPending:B,isSuccess:O==="success",isError:Z,isInitialLoading:U,isLoading:U,data:S,dataUpdatedAt:_.dataUpdatedAt,error:x,errorUpdatedAt:k,failureCount:_.fetchFailureCount,failureReason:_.fetchFailureReason,errorUpdateCount:_.errorUpdateCount,isFetched:_.dataUpdateCount>0||_.errorUpdateCount>0,isFetchedAfterMount:_.dataUpdateCount>g.dataUpdateCount||_.errorUpdateCount>g.errorUpdateCount,isFetching:F,isRefetching:F&&!B,isLoadingError:Z&&!ee,isPaused:_.fetchStatus==="paused",isPlaceholderData:P,isRefetchError:Z&&ee,isStale:Lr(t,e),refetch:this.refetch,promise:this.#i,isEnabled:Ze(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const J=W=>{K.status==="error"?W.reject(K.error):K.data!==void 0&&W.resolve(K.data)},q=()=>{const W=this.#i=K.promise=Yn();J(W)},H=this.#i;switch(H.status){case"pending":t.queryHash===r.queryHash&&J(H);break;case"fulfilled":(K.status==="error"||K.data!==H.value)&&q();break;case"rejected":(K.status!=="error"||K.error!==H.reason)&&q();break}}return K}updateResult(){const t=this.#n,e=this.createResult(this.#e,this.options);if(this.#o=this.#e.state,this.#s=this.options,this.#o.data!==void 0&&(this.#f=this.#e),Xt(e,t))return;this.#n=e;const r=()=>{if(!t)return!0;const{notifyOnChangeProps:n}=this.options,s=typeof n=="function"?n():n;if(s==="all"||!s&&!this.#p.size)return!0;const c=new Set(s??this.#p);return this.options.throwOnError&&c.add("error"),Object.keys(this.#n).some(h=>{const a=h;return this.#n[a]!==t[a]&&c.has(a)})};this.#x({listeners:r()})}#C(){const t=this.#t.getQueryCache().build(this.#t,this.options);if(t===this.#e)return;const e=this.#e;this.#e=t,this.#r=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#x(t){er.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#n)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function ri(t,e){return Ze(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function zn(t,e){return ri(t,e)||t.state.data!==void 0&&Nr(t,e,e.refetchOnMount)}function Nr(t,e,r){if(Ze(e.enabled,t)!==!1&&Rt(e.staleTime,t)!=="static"){const n=typeof r=="function"?r(t):r;return n==="always"||n!==!1&&Lr(t,e)}return!1}function Fn(t,e,r,n){return(t!==e||Ze(n.enabled,t)===!1)&&(!r.suspense||t.state.status!=="error")&&Lr(t,r)}function Lr(t,e){return Ze(e.enabled,t)!==!1&&t.isStaleByTime(Rt(e.staleTime,t))}function ni(t,e){return!Xt(t.getCurrentResult(),e)}function oi(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var si=class extends Zt{#t;#e=void 0;#r;#n;constructor(t,e){super(),this.#t=t,this.setOptions(e),this.bindMethods(),this.#o()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const e=this.options;this.options=this.#t.defaultMutationOptions(t),Xt(this.options,e)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),e?.mutationKey&&this.options.mutationKey&&Rn(e.mutationKey)!==Rn(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(t){this.#o(),this.#s(t)}getCurrentResult(){return this.#e}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#o(),this.#s()}mutate(t,e){return this.#n=e,this.#r?.removeObserver(this),this.#r=this.#t.getMutationCache().build(this.#t,this.options),this.#r.addObserver(this),this.#r.execute(t)}#o(){const t=this.#r?.state??oi();this.#e={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#s(t){er.batch(()=>{if(this.#n&&this.hasListeners()){const e=this.#e.variables,r=this.#e.context,n={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};t?.type==="success"?(this.#n.onSuccess?.(t.data,e,r,n),this.#n.onSettled?.(t.data,null,e,r,n)):t?.type==="error"&&(this.#n.onError?.(t.error,e,r,n),this.#n.onSettled?.(void 0,t.error,e,r,n))}this.listeners.forEach(e=>{e(this.#e)})})}},tr={exports:{}},Nt={};var Wn;function ii(){if(Wn)return Nt;Wn=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(n,s,c){var h=null;if(c!==void 0&&(h=""+c),s.key!==void 0&&(h=""+s.key),"key"in s){c={};for(var a in s)a!=="key"&&(c[a]=s[a])}else c=s;return s=c.ref,{$$typeof:t,type:n,key:h,ref:s!==void 0?s:null,props:c}}return Nt.Fragment=e,Nt.jsx=r,Nt.jsxs=r,Nt}var Lt={};var Un;function ai(){return Un||(Un=1,process.env.NODE_ENV!=="production"&&(function(){function t(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===W?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case N:return"Fragment";case B:return"Profiler";case F:return"StrictMode";case re:return"Suspense";case K:return"SuspenseList";case H:return"Activity"}if(typeof i=="object")switch(typeof i.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),i.$$typeof){case O:return"Portal";case U:return i.displayName||"Context";case Z:return(i._context.displayName||"Context")+".Consumer";case ee:var v=i.render;return i=i.displayName,i||(i=v.displayName||v.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case J:return v=i.displayName||null,v!==null?v:t(i.type)||"Memo";case q:v=i._payload,i=i._init;try{return t(i(v))}catch{}}return null}function e(i){return""+i}function r(i){try{e(i);var v=!1}catch{v=!0}if(v){v=console;var E=v.error,j=typeof Symbol=="function"&&Symbol.toStringTag&&i[Symbol.toStringTag]||i.constructor.name||"Object";return E.call(v,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",j),e(i)}}function n(i){if(i===N)return"<>";if(typeof i=="object"&&i!==null&&i.$$typeof===q)return"<...>";try{var v=t(i);return v?"<"+v+">":"<...>"}catch{return"<...>"}}function s(){var i=ae.A;return i===null?null:i.getOwner()}function c(){return Error("react-stack-top-frame")}function h(i){if(oe.call(i,"key")){var v=Object.getOwnPropertyDescriptor(i,"key").get;if(v&&v.isReactWarning)return!1}return i.key!==void 0}function a(i,v){function E(){b||(b=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",v))}E.isReactWarning=!0,Object.defineProperty(i,"key",{get:E,configurable:!0})}function g(){var i=t(this.type);return u[i]||(u[i]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),i=this.props.ref,i!==void 0?i:null}function y(i,v,E,j,G,X){var te=E.ref;return i={$$typeof:k,type:i,key:v,props:E,_owner:j},(te!==void 0?te:null)!==null?Object.defineProperty(i,"ref",{enumerable:!1,get:g}):Object.defineProperty(i,"ref",{enumerable:!1,value:null}),i._store={},Object.defineProperty(i._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(i,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(i,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:G}),Object.defineProperty(i,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:X}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i}function _(i,v,E,j,G,X){var te=v.children;if(te!==void 0)if(j)if(D(te)){for(j=0;j<te.length;j++)P(te[j]);Object.freeze&&Object.freeze(te)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else P(te);if(oe.call(v,"key")){te=t(i);var V=Object.keys(v).filter(function(ie){return ie!=="key"});j=0<V.length?"{key: someKey, "+V.join(": ..., ")+": ...}":"{key: someKey}",f[te+j]||(V=0<V.length?"{"+V.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
5
|
+
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),r.useMemoCache(e)}})()),jr}var jn;function zs(){return jn||(jn=1,process.env.NODE_ENV==="production"?Qt.exports=Is():Qt.exports=Ys()),Qt.exports}var Qe=zs(),Zt=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Fs={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Ws=class{#t=Fs;#e=!1;setTimeoutProvider(t){process.env.NODE_ENV!=="production"&&this.#e&&t!==this.#t&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:this.#t,provider:t}),this.#t=t,process.env.NODE_ENV!=="production"&&(this.#e=!1)}setTimeout(t,e){return process.env.NODE_ENV!=="production"&&(this.#e=!0),this.#t.setTimeout(t,e)}clearTimeout(t){this.#t.clearTimeout(t)}setInterval(t,e){return process.env.NODE_ENV!=="production"&&(this.#e=!0),this.#t.setInterval(t,e)}clearInterval(t){this.#t.clearInterval(t)}},Kt=new Ws;function Us(t){setTimeout(t,0)}var Rt=typeof window>"u"||"Deno"in globalThis;function Jt(){}function Rn(t){return typeof t=="number"&&t>=0&&t!==1/0}function qs(t,e){return Math.max(t+(e||0)-Date.now(),0)}function $t(t,e){return typeof t=="function"?t(e):t}function Ze(t,e){return typeof t=="function"?t(e):t}function $n(t){return JSON.stringify(t,(e,r)=>$r(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}var Vs=Object.prototype.hasOwnProperty;function Rr(t,e){if(t===e)return t;const r=Nn(t)&&Nn(e);if(!r&&!($r(t)&&$r(e)))return e;const s=(r?t:Object.keys(t)).length,u=r?e:Object.keys(e),d=u.length,i=r?new Array(d):{};let m=0;for(let v=0;v<d;v++){const _=r?v:u[v],M=t[_],S=e[_];if(M===S){i[_]=M,(r?v<s:Vs.call(t,_))&&m++;continue}if(M===null||S===null||typeof M!="object"||typeof S!="object"){i[_]=S;continue}const x=Rr(M,S);i[_]=x,x===M&&m++}return s===d&&m===s?t:i}function Xt(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const r in t)if(t[r]!==e[r])return!1;return!0}function Nn(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function $r(t){if(!Ln(t))return!1;const e=t.constructor;if(e===void 0)return!0;const r=e.prototype;return!(!Ln(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Ln(t){return Object.prototype.toString.call(t)==="[object Object]"}function Bn(t,e,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(t,e);if(r.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return Rr(t,e)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return Rr(t,e)}return e}function In(t,e){return typeof t=="function"?t(...e):!!t}var Hs=class extends Zt{#t;#e;#r;constructor(){super(),this.#r=t=>{if(!Rt&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#e||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#r=t,this.#e?.(),this.#e=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#t!==t&&(this.#t=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},Gs=new Hs;function Yn(){let t,e;const r=new Promise((s,u)=>{t=s,e=u});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),t(s)},r.reject=s=>{n({status:"rejected",reason:s}),e(s)},r}var Qs=Us;function Zs(){let t=[],e=0,r=i=>{i()},n=i=>{i()},s=Qs;const u=i=>{e?t.push(i):s(()=>{r(i)})},d=()=>{const i=t;t=[],i.length&&s(()=>{n(()=>{i.forEach(m=>{r(m)})})})};return{batch:i=>{let m;e++;try{m=i()}finally{e--,e||d()}return m},batchCalls:i=>(...m)=>{u(()=>{i(...m)})},schedule:u,setNotifyFunction:i=>{r=i},setBatchNotifyFunction:i=>{n=i},setScheduler:i=>{s=i}}}var er=Zs(),Ks=class extends Zt{#t=!0;#e;#r;constructor(){super(),this.#r=t=>{if(!Rt&&window.addEventListener){const e=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#e||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#r=t,this.#e?.(),this.#e=t(this.setOnline.bind(this))}setOnline(t){this.#t!==t&&(this.#t=t,this.listeners.forEach(r=>{r(t)}))}isOnline(){return this.#t}},Js=new Ks;function Xs(t){return(t??"online")==="online"?Js.isOnline():!0}function ei(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Xs(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}var ti=class extends Zt{constructor(t,e){super(),this.options=e,this.#t=t,this.#a=null,this.#i=Yn(),this.bindMethods(),this.setOptions(e)}#t;#e=void 0;#r=void 0;#n=void 0;#o;#s;#i;#a;#g;#h;#f;#u;#c;#l;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),zn(this.#e,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Nr(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Nr(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#w(),this.#_(),this.#e.removeObserver(this)}setOptions(t){const e=this.options,r=this.#e;if(this.options=this.#t.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ze(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#C(),this.#e.setOptions(this.options),e._defaulted&&!Xt(this.options,e)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const n=this.hasListeners();n&&Fn(this.#e,r,this.options,e)&&this.#d(),this.updateResult(),n&&(this.#e!==r||Ze(this.options.enabled,this.#e)!==Ze(e.enabled,this.#e)||$t(this.options.staleTime,this.#e)!==$t(e.staleTime,this.#e))&&this.#m();const s=this.#y();n&&(this.#e!==r||Ze(this.options.enabled,this.#e)!==Ze(e.enabled,this.#e)||s!==this.#l)&&this.#v(s)}getOptimisticResult(t){const e=this.#t.getQueryCache().build(this.#t,t),r=this.createResult(e,t);return ni(this,r)&&(this.#n=r,this.#s=this.options,this.#o=this.#e.state),r}getCurrentResult(){return this.#n}trackResult(t,e){return new Proxy(t,{get:(r,n)=>(this.trackProp(n),e?.(n),n==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#i.status==="pending"&&this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,n))})}trackProp(t){this.#p.add(t)}getCurrentQuery(){return this.#e}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#t.defaultQueryOptions(t),r=this.#t.getQueryCache().build(this.#t,e);return r.fetch().then(()=>this.createResult(r,e))}fetch(t){return this.#d({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#n))}#d(t){this.#C();let e=this.#e.fetch(this.options,t);return t?.throwOnError||(e=e.catch(Jt)),e}#m(){this.#w();const t=$t(this.options.staleTime,this.#e);if(Rt||this.#n.isStale||!Rn(t))return;const r=qs(this.#n.dataUpdatedAt,t)+1;this.#u=Kt.setTimeout(()=>{this.#n.isStale||this.updateResult()},r)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#v(t){this.#_(),this.#l=t,!(Rt||Ze(this.options.enabled,this.#e)===!1||!Rn(this.#l)||this.#l===0)&&(this.#c=Kt.setInterval(()=>{(this.options.refetchIntervalInBackground||Gs.isFocused())&&this.#d()},this.#l))}#b(){this.#m(),this.#v(this.#y())}#w(){this.#u&&(Kt.clearTimeout(this.#u),this.#u=void 0)}#_(){this.#c&&(Kt.clearInterval(this.#c),this.#c=void 0)}createResult(t,e){const r=this.#e,n=this.options,s=this.#n,u=this.#o,d=this.#s,m=t!==r?t.state:this.#r,{state:v}=t;let _={...v},M=!1,S;if(e._optimisticResults){const X=this.hasListeners(),V=!X&&zn(t,e),q=X&&Fn(t,r,e,n);(V||q)&&(_={..._,...ei(v.data,t.options)}),e._optimisticResults==="isRestoring"&&(_.fetchStatus="idle")}let{error:x,errorUpdatedAt:P,status:A}=_;S=_.data;let N=!1;if(e.placeholderData!==void 0&&S===void 0&&A==="pending"){let X;s?.isPlaceholderData&&e.placeholderData===d?.placeholderData?(X=s.data,N=!0):X=typeof e.placeholderData=="function"?e.placeholderData(this.#f?.state.data,this.#f):e.placeholderData,X!==void 0&&(A="success",S=Bn(s?.data,X,e),M=!0)}if(e.select&&S!==void 0&&!N)if(s&&S===u?.data&&e.select===this.#g)S=this.#h;else try{this.#g=e.select,S=e.select(S),S=Bn(s?.data,S,e),this.#h=S,this.#a=null}catch(X){this.#a=X}this.#a&&(x=this.#a,S=this.#h,P=Date.now(),A="error");const F=_.fetchStatus==="fetching",B=A==="pending",Q=A==="error",U=B&&F,ee=S!==void 0,K={status:A,fetchStatus:_.fetchStatus,isPending:B,isSuccess:A==="success",isError:Q,isInitialLoading:U,isLoading:U,data:S,dataUpdatedAt:_.dataUpdatedAt,error:x,errorUpdatedAt:P,failureCount:_.fetchFailureCount,failureReason:_.fetchFailureReason,errorUpdateCount:_.errorUpdateCount,isFetched:_.dataUpdateCount>0||_.errorUpdateCount>0,isFetchedAfterMount:_.dataUpdateCount>m.dataUpdateCount||_.errorUpdateCount>m.errorUpdateCount,isFetching:F,isRefetching:F&&!B,isLoadingError:Q&&!ee,isPaused:_.fetchStatus==="paused",isPlaceholderData:M,isRefetchError:Q&&ee,isStale:Lr(t,e),refetch:this.refetch,promise:this.#i,isEnabled:Ze(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const X=J=>{K.status==="error"?J.reject(K.error):K.data!==void 0&&J.resolve(K.data)},V=()=>{const J=this.#i=K.promise=Yn();X(J)},q=this.#i;switch(q.status){case"pending":t.queryHash===r.queryHash&&X(q);break;case"fulfilled":(K.status==="error"||K.data!==q.value)&&V();break;case"rejected":(K.status!=="error"||K.error!==q.reason)&&V();break}}return K}updateResult(){const t=this.#n,e=this.createResult(this.#e,this.options);if(this.#o=this.#e.state,this.#s=this.options,this.#o.data!==void 0&&(this.#f=this.#e),Xt(e,t))return;this.#n=e;const r=()=>{if(!t)return!0;const{notifyOnChangeProps:n}=this.options,s=typeof n=="function"?n():n;if(s==="all"||!s&&!this.#p.size)return!0;const u=new Set(s??this.#p);return this.options.throwOnError&&u.add("error"),Object.keys(this.#n).some(d=>{const i=d;return this.#n[i]!==t[i]&&u.has(i)})};this.#x({listeners:r()})}#C(){const t=this.#t.getQueryCache().build(this.#t,this.options);if(t===this.#e)return;const e=this.#e;this.#e=t,this.#r=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#x(t){er.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#n)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function ri(t,e){return Ze(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function zn(t,e){return ri(t,e)||t.state.data!==void 0&&Nr(t,e,e.refetchOnMount)}function Nr(t,e,r){if(Ze(e.enabled,t)!==!1&&$t(e.staleTime,t)!=="static"){const n=typeof r=="function"?r(t):r;return n==="always"||n!==!1&&Lr(t,e)}return!1}function Fn(t,e,r,n){return(t!==e||Ze(n.enabled,t)===!1)&&(!r.suspense||t.state.status!=="error")&&Lr(t,r)}function Lr(t,e){return Ze(e.enabled,t)!==!1&&t.isStaleByTime($t(e.staleTime,t))}function ni(t,e){return!Xt(t.getCurrentResult(),e)}function oi(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var si=class extends Zt{#t;#e=void 0;#r;#n;constructor(t,e){super(),this.#t=t,this.setOptions(e),this.bindMethods(),this.#o()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const e=this.options;this.options=this.#t.defaultMutationOptions(t),Xt(this.options,e)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),e?.mutationKey&&this.options.mutationKey&&$n(e.mutationKey)!==$n(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(t){this.#o(),this.#s(t)}getCurrentResult(){return this.#e}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#o(),this.#s()}mutate(t,e){return this.#n=e,this.#r?.removeObserver(this),this.#r=this.#t.getMutationCache().build(this.#t,this.options),this.#r.addObserver(this),this.#r.execute(t)}#o(){const t=this.#r?.state??oi();this.#e={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#s(t){er.batch(()=>{if(this.#n&&this.hasListeners()){const e=this.#e.variables,r=this.#e.context,n={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};t?.type==="success"?(this.#n.onSuccess?.(t.data,e,r,n),this.#n.onSettled?.(t.data,null,e,r,n)):t?.type==="error"&&(this.#n.onError?.(t.error,e,r,n),this.#n.onSettled?.(void 0,t.error,e,r,n))}this.listeners.forEach(e=>{e(this.#e)})})}},tr={exports:{}},Nt={};var Wn;function ii(){if(Wn)return Nt;Wn=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(n,s,u){var d=null;if(u!==void 0&&(d=""+u),s.key!==void 0&&(d=""+s.key),"key"in s){u={};for(var i in s)i!=="key"&&(u[i]=s[i])}else u=s;return s=u.ref,{$$typeof:t,type:n,key:d,ref:s!==void 0?s:null,props:u}}return Nt.Fragment=e,Nt.jsx=r,Nt.jsxs=r,Nt}var Lt={};var Un;function ai(){return Un||(Un=1,process.env.NODE_ENV!=="production"&&(function(){function t(c){if(c==null)return null;if(typeof c=="function")return c.$$typeof===J?null:c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case N:return"Fragment";case B:return"Profiler";case F:return"StrictMode";case re:return"Suspense";case K:return"SuspenseList";case q:return"Activity"}if(typeof c=="object")switch(typeof c.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),c.$$typeof){case A:return"Portal";case U:return c.displayName||"Context";case Q:return(c._context.displayName||"Context")+".Consumer";case ee:var y=c.render;return c=c.displayName,c||(c=y.displayName||y.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case X:return y=c.displayName||null,y!==null?y:t(c.type)||"Memo";case V:y=c._payload,c=c._init;try{return t(c(y))}catch{}}return null}function e(c){return""+c}function r(c){try{e(c);var y=!1}catch{y=!0}if(y){y=console;var D=y.error,j=typeof Symbol=="function"&&Symbol.toStringTag&&c[Symbol.toStringTag]||c.constructor.name||"Object";return D.call(y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",j),e(c)}}function n(c){if(c===N)return"<>";if(typeof c=="object"&&c!==null&&c.$$typeof===V)return"<...>";try{var y=t(c);return y?"<"+y+">":"<...>"}catch{return"<...>"}}function s(){var c=ae.A;return c===null?null:c.getOwner()}function u(){return Error("react-stack-top-frame")}function d(c){if(ne.call(c,"key")){var y=Object.getOwnPropertyDescriptor(c,"key").get;if(y&&y.isReactWarning)return!1}return c.key!==void 0}function i(c,y){function D(){b||(b=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",y))}D.isReactWarning=!0,Object.defineProperty(c,"key",{get:D,configurable:!0})}function m(){var c=t(this.type);return h[c]||(h[c]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),c=this.props.ref,c!==void 0?c:null}function v(c,y,D,j,W,Z){var te=D.ref;return c={$$typeof:P,type:c,key:y,props:D,_owner:j},(te!==void 0?te:null)!==null?Object.defineProperty(c,"ref",{enumerable:!1,get:m}):Object.defineProperty(c,"ref",{enumerable:!1,value:null}),c._store={},Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(c,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(c,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:W}),Object.defineProperty(c,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Z}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c}function _(c,y,D,j,W,Z){var te=y.children;if(te!==void 0)if(j)if(k(te)){for(j=0;j<te.length;j++)M(te[j]);Object.freeze&&Object.freeze(te)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else M(te);if(ne.call(y,"key")){te=t(c);var H=Object.keys(y).filter(function(ie){return ie!=="key"});j=0<H.length?"{key: someKey, "+H.join(": ..., ")+": ...}":"{key: someKey}",f[te+j]||(H=0<H.length?"{"+H.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
6
6
|
let props = %s;
|
|
7
7
|
<%s {...props} />
|
|
8
8
|
React keys must be passed directly to JSX without using spread:
|
|
9
9
|
let props = %s;
|
|
10
|
-
<%s key={someKey} {...props} />`,j,te,
|
|
10
|
+
<%s key={someKey} {...props} />`,j,te,H,te),f[te+j]=!0)}if(te=null,D!==void 0&&(r(D),te=""+D),d(y)&&(r(y.key),te=""+y.key),"key"in y){D={};for(var se in y)se!=="key"&&(D[se]=y[se])}else D=y;return te&&i(D,typeof c=="function"?c.displayName||c.name||"Unknown":c),v(c,te,D,s(),W,Z)}function M(c){S(c)?c._store&&(c._store.validated=1):typeof c=="object"&&c!==null&&c.$$typeof===V&&(c._payload.status==="fulfilled"?S(c._payload.value)&&c._payload.value._store&&(c._payload.value._store.validated=1):c._store&&(c._store.validated=1))}function S(c){return typeof c=="object"&&c!==null&&c.$$typeof===P}var x=G,P=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),F=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),Q=Symbol.for("react.consumer"),U=Symbol.for("react.context"),ee=Symbol.for("react.forward_ref"),re=Symbol.for("react.suspense"),K=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),J=Symbol.for("react.client.reference"),ae=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne=Object.prototype.hasOwnProperty,k=Array.isArray,C=console.createTask?console.createTask:function(){return null};x={react_stack_bottom_frame:function(c){return c()}};var b,h={},a=x.react_stack_bottom_frame.bind(x,u)(),p=C(n(u)),f={};Lt.Fragment=N,Lt.jsx=function(c,y,D){var j=1e4>ae.recentlyCreatedOwnerStacks++;return _(c,y,D,!1,j?Error("react-stack-top-frame"):a,j?C(n(c)):p)},Lt.jsxs=function(c,y,D){var j=1e4>ae.recentlyCreatedOwnerStacks++;return _(c,y,D,!0,j?Error("react-stack-top-frame"):a,j?C(n(c)):p)}})()),Lt}var qn;function li(){return qn||(qn=1,process.env.NODE_ENV==="production"?tr.exports=ii():tr.exports=ai()),tr.exports}var w=li(),Vn=Re.createContext(void 0),Hn=t=>{const e=Re.useContext(Vn);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Gn=({client:t,children:e})=>(Re.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),w.jsx(Vn.Provider,{value:t,children:e})),Qn=Re.createContext(!1),ui=()=>Re.useContext(Qn);Qn.Provider;function ci(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var di=Re.createContext(ci()),hi=()=>Re.useContext(di),fi=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},pi=t=>{Re.useEffect(()=>{t.clearReset()},[t])},gi=({result:t,errorResetBoundary:e,throwOnError:r,query:n,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&n&&(s&&t.data===void 0||In(r,[t.error,n])),mi=t=>{if(t.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),n=t.staleTime;t.staleTime=typeof n=="function"?(...s)=>r(n(...s)):r(n),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},yi=(t,e)=>t.isLoading&&t.isFetching&&!e,vi=(t,e)=>t?.suspense&&e.isPending,Zn=(t,e,r)=>e.fetchOptimistic(t).catch(()=>{r.clearReset()});function bi(t,e,r){if(process.env.NODE_ENV!=="production"&&(typeof t!="object"||Array.isArray(t)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const n=ui(),s=hi(),u=Hn(),d=u.defaultQueryOptions(t);u.getDefaultOptions().queries?._experimental_beforeQuery?.(d),process.env.NODE_ENV!=="production"&&(d.queryFn||console.error(`[${d.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),d._optimisticResults=n?"isRestoring":"optimistic",mi(d),fi(d,s),pi(s);const i=!u.getQueryCache().get(d.queryHash),[m]=Re.useState(()=>new e(u,d)),v=m.getOptimisticResult(d),_=!n&&t.subscribed!==!1;if(Re.useSyncExternalStore(Re.useCallback(M=>{const S=_?m.subscribe(er.batchCalls(M)):Jt;return m.updateResult(),S},[m,_]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),Re.useEffect(()=>{m.setOptions(d)},[d,m]),vi(d,v))throw Zn(d,m,s);if(gi({result:v,errorResetBoundary:s,throwOnError:d.throwOnError,query:u.getQueryCache().get(d.queryHash),suspense:d.suspense}))throw v.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(d,v),d.experimental_prefetchInRender&&!Rt&&yi(v,n)&&(i?Zn(d,m,s):u.getQueryCache().get(d.queryHash)?.promise)?.catch(Jt).finally(()=>{m.updateResult()}),d.notifyOnChangeProps?v:m.trackResult(v)}function Kn(t,e){return bi(t,ti)}function Br(t,e){const r=Hn(),[n]=Re.useState(()=>new si(r,t));Re.useEffect(()=>{n.setOptions(t)},[n,t]);const s=Re.useSyncExternalStore(Re.useCallback(d=>n.subscribe(er.batchCalls(d)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),u=Re.useCallback((d,i)=>{n.mutate(d,i).catch(Jt)},[n]);if(s.error&&In(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:u,mutateAsync:s.mutate}}var Jn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ir(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:function(){return t[n]}})}),r}var Yr={exports:{}},Bt={};var Xn;function wi(){if(Xn)return Bt;Xn=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(n,s,u){var d=null;if(u!==void 0&&(d=""+u),s.key!==void 0&&(d=""+s.key),"key"in s){u={};for(var i in s)i!=="key"&&(u[i]=s[i])}else u=s;return s=u.ref,{$$typeof:t,type:n,key:d,ref:s!==void 0?s:null,props:u}}return Bt.Fragment=e,Bt.jsx=r,Bt.jsxs=r,Bt}var rr={};var eo;function _i(){return eo||(eo=1,process.env.NODE_ENV!=="production"&&(function(){function t(f){if(f==null)return null;if(typeof f=="function")return f.$$typeof===q?null:f.displayName||f.name||null;if(typeof f=="string")return f;switch(f){case A:return"Fragment";case F:return"Profiler";case N:return"StrictMode";case ee:return"Suspense";case re:return"SuspenseList";case V:return"Activity"}if(typeof f=="object")switch(typeof f.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),f.$$typeof){case P:return"Portal";case Q:return(f.displayName||"Context")+".Provider";case B:return(f._context.displayName||"Context")+".Consumer";case U:var c=f.render;return f=f.displayName,f||(f=c.displayName||c.name||"",f=f!==""?"ForwardRef("+f+")":"ForwardRef"),f;case K:return c=f.displayName||null,c!==null?c:t(f.type)||"Memo";case X:c=f._payload,f=f._init;try{return t(f(c))}catch{}}return null}function e(f){return""+f}function r(f){try{e(f);var c=!1}catch{c=!0}if(c){c=console;var y=c.error,D=typeof Symbol=="function"&&Symbol.toStringTag&&f[Symbol.toStringTag]||f.constructor.name||"Object";return y.call(c,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",D),e(f)}}function n(f){if(f===A)return"<>";if(typeof f=="object"&&f!==null&&f.$$typeof===X)return"<...>";try{var c=t(f);return c?"<"+c+">":"<...>"}catch{return"<...>"}}function s(){var f=J.A;return f===null?null:f.getOwner()}function u(){return Error("react-stack-top-frame")}function d(f){if(ae.call(f,"key")){var c=Object.getOwnPropertyDescriptor(f,"key").get;if(c&&c.isReactWarning)return!1}return f.key!==void 0}function i(f,c){function y(){C||(C=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",c))}y.isReactWarning=!0,Object.defineProperty(f,"key",{get:y,configurable:!0})}function m(){var f=t(this.type);return b[f]||(b[f]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),f=this.props.ref,f!==void 0?f:null}function v(f,c,y,D,j,W,Z,te){return y=W.ref,f={$$typeof:x,type:f,key:c,props:W,_owner:j},(y!==void 0?y:null)!==null?Object.defineProperty(f,"ref",{enumerable:!1,get:m}):Object.defineProperty(f,"ref",{enumerable:!1,value:null}),f._store={},Object.defineProperty(f._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(f,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(f,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Z}),Object.defineProperty(f,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:te}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f}function _(f,c,y,D,j,W,Z,te){var H=c.children;if(H!==void 0)if(D)if(ne(H)){for(D=0;D<H.length;D++)M(H[D]);Object.freeze&&Object.freeze(H)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else M(H);if(ae.call(c,"key")){H=t(f);var se=Object.keys(c).filter(function(ue){return ue!=="key"});D=0<se.length?"{key: someKey, "+se.join(": ..., ")+": ...}":"{key: someKey}",p[H+D]||(se=0<se.length?"{"+se.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
11
11
|
let props = %s;
|
|
12
12
|
<%s {...props} />
|
|
13
13
|
React keys must be passed directly to JSX without using spread:
|
|
14
14
|
let props = %s;
|
|
15
|
-
<%s key={someKey} {...props} />`,
|
|
15
|
+
<%s key={someKey} {...props} />`,D,H,se,H),p[H+D]=!0)}if(H=null,y!==void 0&&(r(y),H=""+y),d(c)&&(r(c.key),H=""+c.key),"key"in c){y={};for(var ie in c)ie!=="key"&&(y[ie]=c[ie])}else y=c;return H&&i(y,typeof f=="function"?f.displayName||f.name||"Unknown":f),v(f,H,W,j,s(),y,Z,te)}function M(f){typeof f=="object"&&f!==null&&f.$$typeof===x&&f._store&&(f._store.validated=1)}var S=G,x=Symbol.for("react.transitional.element"),P=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),B=Symbol.for("react.consumer"),Q=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),ee=Symbol.for("react.suspense"),re=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),q=Symbol.for("react.client.reference"),J=S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae=Object.prototype.hasOwnProperty,ne=Array.isArray,k=console.createTask?console.createTask:function(){return null};S={react_stack_bottom_frame:function(f){return f()}};var C,b={},h=S.react_stack_bottom_frame.bind(S,u)(),a=k(n(u)),p={};rr.Fragment=A,rr.jsx=function(f,c,y,D,j){var W=1e4>J.recentlyCreatedOwnerStacks++;return _(f,c,y,!1,D,j,W?Error("react-stack-top-frame"):h,W?k(n(f)):a)},rr.jsxs=function(f,c,y,D,j){var W=1e4>J.recentlyCreatedOwnerStacks++;return _(f,c,y,!0,D,j,W?Error("react-stack-top-frame"):h,W?k(n(f)):a)}})()),rr}var to;function Ci(){return to||(to=1,process.env.NODE_ENV==="production"?Yr.exports=wi():Yr.exports=_i()),Yr.exports}Ci();var zr={exports:{}},Fr={};var ro;function xi(){if(ro)return Fr;ro=1;var t=G.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return Fr.c=function(e){return t.H.useMemoCache(e)},Fr}var no={};var oo;function Si(){return oo||(oo=1,process.env.NODE_ENV!=="production"&&(function(){var t=G.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;no.c=function(e){var r=t.H;return r===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
16
16
|
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
17
17
|
2. You might be breaking the Rules of Hooks
|
|
18
18
|
3. You might have more than one copy of React in the same app
|
|
19
|
-
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),r.useMemoCache(e)}})()),no}var so;function Di(){return so||(so=1,process.env.NODE_ENV==="production"?zr.exports=xi():zr.exports=Si()),zr.exports}Di();var io={},It={},ao;function ki(){if(ao)return It;ao=1,It.byteLength=a,It.toByteArray=y,It.fromByteArray=S;for(var t=[],e=[],r=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,c=n.length;s<c;++s)t[s]=n[s],e[n.charCodeAt(s)]=s;e[45]=62,e[95]=63;function h(x){var k=x.length;if(k%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var O=x.indexOf("=");O===-1&&(O=k);var N=O===k?0:4-O%4;return[O,N]}function a(x){var k=h(x),O=k[0],N=k[1];return(O+N)*3/4-N}function g(x,k,O){return(k+O)*3/4-O}function y(x){var k,O=h(x),N=O[0],F=O[1],B=new r(g(x,N,F)),Z=0,U=F>0?N-4:N,ee;for(ee=0;ee<U;ee+=4)k=e[x.charCodeAt(ee)]<<18|e[x.charCodeAt(ee+1)]<<12|e[x.charCodeAt(ee+2)]<<6|e[x.charCodeAt(ee+3)],B[Z++]=k>>16&255,B[Z++]=k>>8&255,B[Z++]=k&255;return F===2&&(k=e[x.charCodeAt(ee)]<<2|e[x.charCodeAt(ee+1)]>>4,B[Z++]=k&255),F===1&&(k=e[x.charCodeAt(ee)]<<10|e[x.charCodeAt(ee+1)]<<4|e[x.charCodeAt(ee+2)]>>2,B[Z++]=k>>8&255,B[Z++]=k&255),B}function _(x){return t[x>>18&63]+t[x>>12&63]+t[x>>6&63]+t[x&63]}function P(x,k,O){for(var N,F=[],B=k;B<O;B+=3)N=(x[B]<<16&16711680)+(x[B+1]<<8&65280)+(x[B+2]&255),F.push(_(N));return F.join("")}function S(x){for(var k,O=x.length,N=O%3,F=[],B=16383,Z=0,U=O-N;Z<U;Z+=B)F.push(P(x,Z,Z+B>U?U:Z+B));return N===1?(k=x[O-1],F.push(t[k>>2]+t[k<<4&63]+"==")):N===2&&(k=(x[O-2]<<8)+x[O-1],F.push(t[k>>10]+t[k>>4&63]+t[k<<2&63]+"=")),F.join("")}return It}var Wr={};var lo;function Pi(){return lo||(lo=1,Wr.read=function(t,e,r,n,s){var c,h,a=s*8-n-1,g=(1<<a)-1,y=g>>1,_=-7,P=r?s-1:0,S=r?-1:1,x=t[e+P];for(P+=S,c=x&(1<<-_)-1,x>>=-_,_+=a;_>0;c=c*256+t[e+P],P+=S,_-=8);for(h=c&(1<<-_)-1,c>>=-_,_+=n;_>0;h=h*256+t[e+P],P+=S,_-=8);if(c===0)c=1-y;else{if(c===g)return h?NaN:(x?-1:1)*(1/0);h=h+Math.pow(2,n),c=c-y}return(x?-1:1)*h*Math.pow(2,c-n)},Wr.write=function(t,e,r,n,s,c){var h,a,g,y=c*8-s-1,_=(1<<y)-1,P=_>>1,S=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=n?0:c-1,k=n?1:-1,O=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,h=_):(h=Math.floor(Math.log(e)/Math.LN2),e*(g=Math.pow(2,-h))<1&&(h--,g*=2),h+P>=1?e+=S/g:e+=S*Math.pow(2,1-P),e*g>=2&&(h++,g/=2),h+P>=_?(a=0,h=_):h+P>=1?(a=(e*g-1)*Math.pow(2,s),h=h+P):(a=e*Math.pow(2,P-1)*Math.pow(2,s),h=0));s>=8;t[r+x]=a&255,x+=k,a/=256,s-=8);for(h=h<<s|a,y+=s;y>0;t[r+x]=h&255,x+=k,h/=256,y-=8);t[r+x-k]|=O*128}),Wr}var Ur,uo;function Mi(){if(uo)return Ur;uo=1;var t={}.toString;return Ur=Array.isArray||function(e){return t.call(e)=="[object Array]"},Ur}var co;function Oi(){return co||(co=1,(function(t){var e=ki(),r=Pi(),n=Mi();t.Buffer=a,t.SlowBuffer=F,t.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=Jn.TYPED_ARRAY_SUPPORT!==void 0?Jn.TYPED_ARRAY_SUPPORT:s(),t.kMaxLength=c();function s(){try{var o=new Uint8Array(1);return o.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},o.foo()===42&&typeof o.subarray=="function"&&o.subarray(1,1).byteLength===0}catch{return!1}}function c(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function h(o,l){if(c()<l)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(o=new Uint8Array(l),o.__proto__=a.prototype):(o===null&&(o=new a(l)),o.length=l),o}function a(o,l,p){if(!a.TYPED_ARRAY_SUPPORT&&!(this instanceof a))return new a(o,l,p);if(typeof o=="number"){if(typeof l=="string")throw new Error("If encoding is specified then the first argument must be a string");return P(this,o)}return g(this,o,l,p)}a.poolSize=8192,a._augment=function(o){return o.__proto__=a.prototype,o};function g(o,l,p,M){if(typeof l=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&l instanceof ArrayBuffer?k(o,l,p,M):typeof l=="string"?S(o,l,p):O(o,l)}a.from=function(o,l,p){return g(null,o,l,p)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0}));function y(o){if(typeof o!="number")throw new TypeError('"size" argument must be a number');if(o<0)throw new RangeError('"size" argument must not be negative')}function _(o,l,p,M){return y(l),l<=0?h(o,l):p!==void 0?typeof M=="string"?h(o,l).fill(p,M):h(o,l).fill(p):h(o,l)}a.alloc=function(o,l,p){return _(null,o,l,p)};function P(o,l){if(y(l),o=h(o,l<0?0:N(l)|0),!a.TYPED_ARRAY_SUPPORT)for(var p=0;p<l;++p)o[p]=0;return o}a.allocUnsafe=function(o){return P(null,o)},a.allocUnsafeSlow=function(o){return P(null,o)};function S(o,l,p){if((typeof p!="string"||p==="")&&(p="utf8"),!a.isEncoding(p))throw new TypeError('"encoding" must be a valid string encoding');var M=B(l,p)|0;o=h(o,M);var R=o.write(l,p);return R!==M&&(o=o.slice(0,R)),o}function x(o,l){var p=l.length<0?0:N(l.length)|0;o=h(o,p);for(var M=0;M<p;M+=1)o[M]=l[M]&255;return o}function k(o,l,p,M){if(l.byteLength,p<0||l.byteLength<p)throw new RangeError("'offset' is out of bounds");if(l.byteLength<p+(M||0))throw new RangeError("'length' is out of bounds");return p===void 0&&M===void 0?l=new Uint8Array(l):M===void 0?l=new Uint8Array(l,p):l=new Uint8Array(l,p,M),a.TYPED_ARRAY_SUPPORT?(o=l,o.__proto__=a.prototype):o=x(o,l),o}function O(o,l){if(a.isBuffer(l)){var p=N(l.length)|0;return o=h(o,p),o.length===0||l.copy(o,0,0,p),o}if(l){if(typeof ArrayBuffer<"u"&&l.buffer instanceof ArrayBuffer||"length"in l)return typeof l.length!="number"||de(l.length)?h(o,0):x(o,l);if(l.type==="Buffer"&&n(l.data))return x(o,l.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function N(o){if(o>=c())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+c().toString(16)+" bytes");return o|0}function F(o){return+o!=o&&(o=0),a.alloc(+o)}a.isBuffer=function(o){return!!(o!=null&&o._isBuffer)},a.compare=function(o,l){if(!a.isBuffer(o)||!a.isBuffer(l))throw new TypeError("Arguments must be Buffers");if(o===l)return 0;for(var p=o.length,M=l.length,R=0,z=Math.min(p,M);R<z;++R)if(o[R]!==l[R]){p=o[R],M=l[R];break}return p<M?-1:M<p?1:0},a.isEncoding=function(o){switch(String(o).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(o,l){if(!n(o))throw new TypeError('"list" argument must be an Array of Buffers');if(o.length===0)return a.alloc(0);var p;if(l===void 0)for(l=0,p=0;p<o.length;++p)l+=o[p].length;var M=a.allocUnsafe(l),R=0;for(p=0;p<o.length;++p){var z=o[p];if(!a.isBuffer(z))throw new TypeError('"list" argument must be an Array of Buffers');z.copy(M,R),R+=z.length}return M};function B(o,l){if(a.isBuffer(o))return o.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(o)||o instanceof ArrayBuffer))return o.byteLength;typeof o!="string"&&(o=""+o);var p=o.length;if(p===0)return 0;for(var M=!1;;)switch(l){case"ascii":case"latin1":case"binary":return p;case"utf8":case"utf-8":case void 0:return A(o).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return p*2;case"hex":return p>>>1;case"base64":return Y(o).length;default:if(M)return A(o).length;l=(""+l).toLowerCase(),M=!0}}a.byteLength=B;function Z(o,l,p){var M=!1;if((l===void 0||l<0)&&(l=0),l>this.length||((p===void 0||p>this.length)&&(p=this.length),p<=0)||(p>>>=0,l>>>=0,p<=l))return"";for(o||(o="utf8");;)switch(o){case"hex":return m(this,l,p);case"utf8":case"utf-8":return D(this,l,p);case"ascii":return u(this,l,p);case"latin1":case"binary":return d(this,l,p);case"base64":return oe(this,l,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f(this,l,p);default:if(M)throw new TypeError("Unknown encoding: "+o);o=(o+"").toLowerCase(),M=!0}}a.prototype._isBuffer=!0;function U(o,l,p){var M=o[l];o[l]=o[p],o[p]=M}a.prototype.swap16=function(){var o=this.length;if(o%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var l=0;l<o;l+=2)U(this,l,l+1);return this},a.prototype.swap32=function(){var o=this.length;if(o%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var l=0;l<o;l+=4)U(this,l,l+3),U(this,l+1,l+2);return this},a.prototype.swap64=function(){var o=this.length;if(o%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var l=0;l<o;l+=8)U(this,l,l+7),U(this,l+1,l+6),U(this,l+2,l+5),U(this,l+3,l+4);return this},a.prototype.toString=function(){var o=this.length|0;return o===0?"":arguments.length===0?D(this,0,o):Z.apply(this,arguments)},a.prototype.equals=function(o){if(!a.isBuffer(o))throw new TypeError("Argument must be a Buffer");return this===o?!0:a.compare(this,o)===0},a.prototype.inspect=function(){var o="",l=t.INSPECT_MAX_BYTES;return this.length>0&&(o=this.toString("hex",0,l).match(/.{2}/g).join(" "),this.length>l&&(o+=" ... ")),"<Buffer "+o+">"},a.prototype.compare=function(o,l,p,M,R){if(!a.isBuffer(o))throw new TypeError("Argument must be a Buffer");if(l===void 0&&(l=0),p===void 0&&(p=o?o.length:0),M===void 0&&(M=0),R===void 0&&(R=this.length),l<0||p>o.length||M<0||R>this.length)throw new RangeError("out of range index");if(M>=R&&l>=p)return 0;if(M>=R)return-1;if(l>=p)return 1;if(l>>>=0,p>>>=0,M>>>=0,R>>>=0,this===o)return 0;for(var z=R-M,le=p-l,ce=Math.min(z,le),fe=this.slice(M,R),ne=o.slice(l,p),pe=0;pe<ce;++pe)if(fe[pe]!==ne[pe]){z=fe[pe],le=ne[pe];break}return z<le?-1:le<z?1:0};function ee(o,l,p,M,R){if(o.length===0)return-1;if(typeof p=="string"?(M=p,p=0):p>2147483647?p=2147483647:p<-2147483648&&(p=-2147483648),p=+p,isNaN(p)&&(p=R?0:o.length-1),p<0&&(p=o.length+p),p>=o.length){if(R)return-1;p=o.length-1}else if(p<0)if(R)p=0;else return-1;if(typeof l=="string"&&(l=a.from(l,M)),a.isBuffer(l))return l.length===0?-1:re(o,l,p,M,R);if(typeof l=="number")return l=l&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?R?Uint8Array.prototype.indexOf.call(o,l,p):Uint8Array.prototype.lastIndexOf.call(o,l,p):re(o,[l],p,M,R);throw new TypeError("val must be string, number or Buffer")}function re(o,l,p,M,R){var z=1,le=o.length,ce=l.length;if(M!==void 0&&(M=String(M).toLowerCase(),M==="ucs2"||M==="ucs-2"||M==="utf16le"||M==="utf-16le")){if(o.length<2||l.length<2)return-1;z=2,le/=2,ce/=2,p/=2}function fe(xe,Ce){return z===1?xe[Ce]:xe.readUInt16BE(Ce*z)}var ne;if(R){var pe=-1;for(ne=p;ne<le;ne++)if(fe(o,ne)===fe(l,pe===-1?0:ne-pe)){if(pe===-1&&(pe=ne),ne-pe+1===ce)return pe*z}else pe!==-1&&(ne-=ne-pe),pe=-1}else for(p+ce>le&&(p=le-ce),ne=p;ne>=0;ne--){for(var me=!0,ge=0;ge<ce;ge++)if(fe(o,ne+ge)!==fe(l,ge)){me=!1;break}if(me)return ne}return-1}a.prototype.includes=function(o,l,p){return this.indexOf(o,l,p)!==-1},a.prototype.indexOf=function(o,l,p){return ee(this,o,l,p,!0)},a.prototype.lastIndexOf=function(o,l,p){return ee(this,o,l,p,!1)};function K(o,l,p,M){p=Number(p)||0;var R=o.length-p;M?(M=Number(M),M>R&&(M=R)):M=R;var z=l.length;if(z%2!==0)throw new TypeError("Invalid hex string");M>z/2&&(M=z/2);for(var le=0;le<M;++le){var ce=parseInt(l.substr(le*2,2),16);if(isNaN(ce))return le;o[p+le]=ce}return le}function J(o,l,p,M){return I(A(l,o.length-p),o,p,M)}function q(o,l,p,M){return I(L(l),o,p,M)}function H(o,l,p,M){return q(o,l,p,M)}function W(o,l,p,M){return I(Y(l),o,p,M)}function ae(o,l,p,M){return I($(l,o.length-p),o,p,M)}a.prototype.write=function(o,l,p,M){if(l===void 0)M="utf8",p=this.length,l=0;else if(p===void 0&&typeof l=="string")M=l,p=this.length,l=0;else if(isFinite(l))l=l|0,isFinite(p)?(p=p|0,M===void 0&&(M="utf8")):(M=p,p=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var R=this.length-l;if((p===void 0||p>R)&&(p=R),o.length>0&&(p<0||l<0)||l>this.length)throw new RangeError("Attempt to write outside buffer bounds");M||(M="utf8");for(var z=!1;;)switch(M){case"hex":return K(this,o,l,p);case"utf8":case"utf-8":return J(this,o,l,p);case"ascii":return q(this,o,l,p);case"latin1":case"binary":return H(this,o,l,p);case"base64":return W(this,o,l,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ae(this,o,l,p);default:if(z)throw new TypeError("Unknown encoding: "+M);M=(""+M).toLowerCase(),z=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function oe(o,l,p){return l===0&&p===o.length?e.fromByteArray(o):e.fromByteArray(o.slice(l,p))}function D(o,l,p){p=Math.min(o.length,p);for(var M=[],R=l;R<p;){var z=o[R],le=null,ce=z>239?4:z>223?3:z>191?2:1;if(R+ce<=p){var fe,ne,pe,me;switch(ce){case 1:z<128&&(le=z);break;case 2:fe=o[R+1],(fe&192)===128&&(me=(z&31)<<6|fe&63,me>127&&(le=me));break;case 3:fe=o[R+1],ne=o[R+2],(fe&192)===128&&(ne&192)===128&&(me=(z&15)<<12|(fe&63)<<6|ne&63,me>2047&&(me<55296||me>57343)&&(le=me));break;case 4:fe=o[R+1],ne=o[R+2],pe=o[R+3],(fe&192)===128&&(ne&192)===128&&(pe&192)===128&&(me=(z&15)<<18|(fe&63)<<12|(ne&63)<<6|pe&63,me>65535&&me<1114112&&(le=me))}}le===null?(le=65533,ce=1):le>65535&&(le-=65536,M.push(le>>>10&1023|55296),le=56320|le&1023),M.push(le),R+=ce}return b(M)}var C=4096;function b(o){var l=o.length;if(l<=C)return String.fromCharCode.apply(String,o);for(var p="",M=0;M<l;)p+=String.fromCharCode.apply(String,o.slice(M,M+=C));return p}function u(o,l,p){var M="";p=Math.min(o.length,p);for(var R=l;R<p;++R)M+=String.fromCharCode(o[R]&127);return M}function d(o,l,p){var M="";p=Math.min(o.length,p);for(var R=l;R<p;++R)M+=String.fromCharCode(o[R]);return M}function m(o,l,p){var M=o.length;(!l||l<0)&&(l=0),(!p||p<0||p>M)&&(p=M);for(var R="",z=l;z<p;++z)R+=ue(o[z]);return R}function f(o,l,p){for(var M=o.slice(l,p),R="",z=0;z<M.length;z+=2)R+=String.fromCharCode(M[z]+M[z+1]*256);return R}a.prototype.slice=function(o,l){var p=this.length;o=~~o,l=l===void 0?p:~~l,o<0?(o+=p,o<0&&(o=0)):o>p&&(o=p),l<0?(l+=p,l<0&&(l=0)):l>p&&(l=p),l<o&&(l=o);var M;if(a.TYPED_ARRAY_SUPPORT)M=this.subarray(o,l),M.__proto__=a.prototype;else{var R=l-o;M=new a(R,void 0);for(var z=0;z<R;++z)M[z]=this[z+o]}return M};function i(o,l,p){if(o%1!==0||o<0)throw new RangeError("offset is not uint");if(o+l>p)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUIntLE=function(o,l,p){o=o|0,l=l|0,p||i(o,l,this.length);for(var M=this[o],R=1,z=0;++z<l&&(R*=256);)M+=this[o+z]*R;return M},a.prototype.readUIntBE=function(o,l,p){o=o|0,l=l|0,p||i(o,l,this.length);for(var M=this[o+--l],R=1;l>0&&(R*=256);)M+=this[o+--l]*R;return M},a.prototype.readUInt8=function(o,l){return l||i(o,1,this.length),this[o]},a.prototype.readUInt16LE=function(o,l){return l||i(o,2,this.length),this[o]|this[o+1]<<8},a.prototype.readUInt16BE=function(o,l){return l||i(o,2,this.length),this[o]<<8|this[o+1]},a.prototype.readUInt32LE=function(o,l){return l||i(o,4,this.length),(this[o]|this[o+1]<<8|this[o+2]<<16)+this[o+3]*16777216},a.prototype.readUInt32BE=function(o,l){return l||i(o,4,this.length),this[o]*16777216+(this[o+1]<<16|this[o+2]<<8|this[o+3])},a.prototype.readIntLE=function(o,l,p){o=o|0,l=l|0,p||i(o,l,this.length);for(var M=this[o],R=1,z=0;++z<l&&(R*=256);)M+=this[o+z]*R;return R*=128,M>=R&&(M-=Math.pow(2,8*l)),M},a.prototype.readIntBE=function(o,l,p){o=o|0,l=l|0,p||i(o,l,this.length);for(var M=l,R=1,z=this[o+--M];M>0&&(R*=256);)z+=this[o+--M]*R;return R*=128,z>=R&&(z-=Math.pow(2,8*l)),z},a.prototype.readInt8=function(o,l){return l||i(o,1,this.length),this[o]&128?(255-this[o]+1)*-1:this[o]},a.prototype.readInt16LE=function(o,l){l||i(o,2,this.length);var p=this[o]|this[o+1]<<8;return p&32768?p|4294901760:p},a.prototype.readInt16BE=function(o,l){l||i(o,2,this.length);var p=this[o+1]|this[o]<<8;return p&32768?p|4294901760:p},a.prototype.readInt32LE=function(o,l){return l||i(o,4,this.length),this[o]|this[o+1]<<8|this[o+2]<<16|this[o+3]<<24},a.prototype.readInt32BE=function(o,l){return l||i(o,4,this.length),this[o]<<24|this[o+1]<<16|this[o+2]<<8|this[o+3]},a.prototype.readFloatLE=function(o,l){return l||i(o,4,this.length),r.read(this,o,!0,23,4)},a.prototype.readFloatBE=function(o,l){return l||i(o,4,this.length),r.read(this,o,!1,23,4)},a.prototype.readDoubleLE=function(o,l){return l||i(o,8,this.length),r.read(this,o,!0,52,8)},a.prototype.readDoubleBE=function(o,l){return l||i(o,8,this.length),r.read(this,o,!1,52,8)};function v(o,l,p,M,R,z){if(!a.isBuffer(o))throw new TypeError('"buffer" argument must be a Buffer instance');if(l>R||l<z)throw new RangeError('"value" argument is out of bounds');if(p+M>o.length)throw new RangeError("Index out of range")}a.prototype.writeUIntLE=function(o,l,p,M){if(o=+o,l=l|0,p=p|0,!M){var R=Math.pow(2,8*p)-1;v(this,o,l,p,R,0)}var z=1,le=0;for(this[l]=o&255;++le<p&&(z*=256);)this[l+le]=o/z&255;return l+p},a.prototype.writeUIntBE=function(o,l,p,M){if(o=+o,l=l|0,p=p|0,!M){var R=Math.pow(2,8*p)-1;v(this,o,l,p,R,0)}var z=p-1,le=1;for(this[l+z]=o&255;--z>=0&&(le*=256);)this[l+z]=o/le&255;return l+p},a.prototype.writeUInt8=function(o,l,p){return o=+o,l=l|0,p||v(this,o,l,1,255,0),a.TYPED_ARRAY_SUPPORT||(o=Math.floor(o)),this[l]=o&255,l+1};function E(o,l,p,M){l<0&&(l=65535+l+1);for(var R=0,z=Math.min(o.length-p,2);R<z;++R)o[p+R]=(l&255<<8*(M?R:1-R))>>>(M?R:1-R)*8}a.prototype.writeUInt16LE=function(o,l,p){return o=+o,l=l|0,p||v(this,o,l,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[l]=o&255,this[l+1]=o>>>8):E(this,o,l,!0),l+2},a.prototype.writeUInt16BE=function(o,l,p){return o=+o,l=l|0,p||v(this,o,l,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[l]=o>>>8,this[l+1]=o&255):E(this,o,l,!1),l+2};function j(o,l,p,M){l<0&&(l=4294967295+l+1);for(var R=0,z=Math.min(o.length-p,4);R<z;++R)o[p+R]=l>>>(M?R:3-R)*8&255}a.prototype.writeUInt32LE=function(o,l,p){return o=+o,l=l|0,p||v(this,o,l,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[l+3]=o>>>24,this[l+2]=o>>>16,this[l+1]=o>>>8,this[l]=o&255):j(this,o,l,!0),l+4},a.prototype.writeUInt32BE=function(o,l,p){return o=+o,l=l|0,p||v(this,o,l,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[l]=o>>>24,this[l+1]=o>>>16,this[l+2]=o>>>8,this[l+3]=o&255):j(this,o,l,!1),l+4},a.prototype.writeIntLE=function(o,l,p,M){if(o=+o,l=l|0,!M){var R=Math.pow(2,8*p-1);v(this,o,l,p,R-1,-R)}var z=0,le=1,ce=0;for(this[l]=o&255;++z<p&&(le*=256);)o<0&&ce===0&&this[l+z-1]!==0&&(ce=1),this[l+z]=(o/le>>0)-ce&255;return l+p},a.prototype.writeIntBE=function(o,l,p,M){if(o=+o,l=l|0,!M){var R=Math.pow(2,8*p-1);v(this,o,l,p,R-1,-R)}var z=p-1,le=1,ce=0;for(this[l+z]=o&255;--z>=0&&(le*=256);)o<0&&ce===0&&this[l+z+1]!==0&&(ce=1),this[l+z]=(o/le>>0)-ce&255;return l+p},a.prototype.writeInt8=function(o,l,p){return o=+o,l=l|0,p||v(this,o,l,1,127,-128),a.TYPED_ARRAY_SUPPORT||(o=Math.floor(o)),o<0&&(o=255+o+1),this[l]=o&255,l+1},a.prototype.writeInt16LE=function(o,l,p){return o=+o,l=l|0,p||v(this,o,l,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[l]=o&255,this[l+1]=o>>>8):E(this,o,l,!0),l+2},a.prototype.writeInt16BE=function(o,l,p){return o=+o,l=l|0,p||v(this,o,l,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[l]=o>>>8,this[l+1]=o&255):E(this,o,l,!1),l+2},a.prototype.writeInt32LE=function(o,l,p){return o=+o,l=l|0,p||v(this,o,l,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[l]=o&255,this[l+1]=o>>>8,this[l+2]=o>>>16,this[l+3]=o>>>24):j(this,o,l,!0),l+4},a.prototype.writeInt32BE=function(o,l,p){return o=+o,l=l|0,p||v(this,o,l,4,2147483647,-2147483648),o<0&&(o=4294967295+o+1),a.TYPED_ARRAY_SUPPORT?(this[l]=o>>>24,this[l+1]=o>>>16,this[l+2]=o>>>8,this[l+3]=o&255):j(this,o,l,!1),l+4};function G(o,l,p,M,R,z){if(p+M>o.length)throw new RangeError("Index out of range");if(p<0)throw new RangeError("Index out of range")}function X(o,l,p,M,R){return R||G(o,l,p,4),r.write(o,l,p,M,23,4),p+4}a.prototype.writeFloatLE=function(o,l,p){return X(this,o,l,!0,p)},a.prototype.writeFloatBE=function(o,l,p){return X(this,o,l,!1,p)};function te(o,l,p,M,R){return R||G(o,l,p,8),r.write(o,l,p,M,52,8),p+8}a.prototype.writeDoubleLE=function(o,l,p){return te(this,o,l,!0,p)},a.prototype.writeDoubleBE=function(o,l,p){return te(this,o,l,!1,p)},a.prototype.copy=function(o,l,p,M){if(p||(p=0),!M&&M!==0&&(M=this.length),l>=o.length&&(l=o.length),l||(l=0),M>0&&M<p&&(M=p),M===p||o.length===0||this.length===0)return 0;if(l<0)throw new RangeError("targetStart out of bounds");if(p<0||p>=this.length)throw new RangeError("sourceStart out of bounds");if(M<0)throw new RangeError("sourceEnd out of bounds");M>this.length&&(M=this.length),o.length-l<M-p&&(M=o.length-l+p);var R=M-p,z;if(this===o&&p<l&&l<M)for(z=R-1;z>=0;--z)o[z+l]=this[z+p];else if(R<1e3||!a.TYPED_ARRAY_SUPPORT)for(z=0;z<R;++z)o[z+l]=this[z+p];else Uint8Array.prototype.set.call(o,this.subarray(p,p+R),l);return R},a.prototype.fill=function(o,l,p,M){if(typeof o=="string"){if(typeof l=="string"?(M=l,l=0,p=this.length):typeof p=="string"&&(M=p,p=this.length),o.length===1){var R=o.charCodeAt(0);R<256&&(o=R)}if(M!==void 0&&typeof M!="string")throw new TypeError("encoding must be a string");if(typeof M=="string"&&!a.isEncoding(M))throw new TypeError("Unknown encoding: "+M)}else typeof o=="number"&&(o=o&255);if(l<0||this.length<l||this.length<p)throw new RangeError("Out of range index");if(p<=l)return this;l=l>>>0,p=p===void 0?this.length:p>>>0,o||(o=0);var z;if(typeof o=="number")for(z=l;z<p;++z)this[z]=o;else{var le=a.isBuffer(o)?o:A(new a(o,M).toString()),ce=le.length;for(z=0;z<p-l;++z)this[z+l]=le[z%ce]}return this};var V=/[^+\/0-9A-Za-z-_]/g;function se(o){if(o=ie(o).replace(V,""),o.length<2)return"";for(;o.length%4!==0;)o=o+"=";return o}function ie(o){return o.trim?o.trim():o.replace(/^\s+|\s+$/g,"")}function ue(o){return o<16?"0"+o.toString(16):o.toString(16)}function A(o,l){l=l||1/0;for(var p,M=o.length,R=null,z=[],le=0;le<M;++le){if(p=o.charCodeAt(le),p>55295&&p<57344){if(!R){if(p>56319){(l-=3)>-1&&z.push(239,191,189);continue}else if(le+1===M){(l-=3)>-1&&z.push(239,191,189);continue}R=p;continue}if(p<56320){(l-=3)>-1&&z.push(239,191,189),R=p;continue}p=(R-55296<<10|p-56320)+65536}else R&&(l-=3)>-1&&z.push(239,191,189);if(R=null,p<128){if((l-=1)<0)break;z.push(p)}else if(p<2048){if((l-=2)<0)break;z.push(p>>6|192,p&63|128)}else if(p<65536){if((l-=3)<0)break;z.push(p>>12|224,p>>6&63|128,p&63|128)}else if(p<1114112){if((l-=4)<0)break;z.push(p>>18|240,p>>12&63|128,p>>6&63|128,p&63|128)}else throw new Error("Invalid code point")}return z}function L(o){for(var l=[],p=0;p<o.length;++p)l.push(o.charCodeAt(p)&255);return l}function $(o,l){for(var p,M,R,z=[],le=0;le<o.length&&!((l-=2)<0);++le)p=o.charCodeAt(le),M=p>>8,R=p%256,z.push(R),z.push(M);return z}function Y(o){return e.toByteArray(se(o))}function I(o,l,p,M){for(var R=0;R<M&&!(R+p>=l.length||R>=o.length);++R)l[R+p]=o[R];return R}function de(o){return o!==o}})(io)),io}Oi();var _t;if(typeof window<"u"&&window.crypto&&(_t=window.crypto),!_t&&typeof window<"u"&&window.msCrypto&&(_t=window.msCrypto),!_t&&typeof global<"u"&&global.crypto&&(_t=global.crypto),!_t&&typeof require=="function")try{_t=require("crypto")}catch{}var ho={};var qr=function(t,e){return qr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var s in n)n.hasOwnProperty(s)&&(r[s]=n[s])},qr(t,e)};function Ai(t,e){qr(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Vr=function(){return Vr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])}return t},Vr.apply(this,arguments)};function Ei(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]]);return r}function Ti(t,e,r,n){var s=arguments.length,c=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(h=t[a])&&(c=(s<3?h(c):s>3?h(e,r,c):h(e,r))||c);return s>3&&c&&Object.defineProperty(e,r,c),c}function ji(t,e){return function(r,n){e(r,n,t)}}function $i(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Ri(t,e,r,n){function s(c){return c instanceof r?c:new r(function(h){h(c)})}return new(r||(r=Promise))(function(c,h){function a(_){try{y(n.next(_))}catch(P){h(P)}}function g(_){try{y(n.throw(_))}catch(P){h(P)}}function y(_){_.done?c(_.value):s(_.value).then(a,g)}y((n=n.apply(t,e||[])).next())})}function Ni(t,e){var r={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},n,s,c,h;return h={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function a(y){return function(_){return g([y,_])}}function g(y){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,s&&(c=y[0]&2?s.return:y[0]?s.throw||((c=s.return)&&c.call(s),0):s.next)&&!(c=c.call(s,y[1])).done)return c;switch(s=0,c&&(y=[y[0]&2,c.value]),y[0]){case 0:case 1:c=y;break;case 4:return r.label++,{value:y[1],done:!1};case 5:r.label++,s=y[1],y=[0];continue;case 7:y=r.ops.pop(),r.trys.pop();continue;default:if(c=r.trys,!(c=c.length>0&&c[c.length-1])&&(y[0]===6||y[0]===2)){r=0;continue}if(y[0]===3&&(!c||y[1]>c[0]&&y[1]<c[3])){r.label=y[1];break}if(y[0]===6&&r.label<c[1]){r.label=c[1],c=y;break}if(c&&r.label<c[2]){r.label=c[2],r.ops.push(y);break}c[2]&&r.ops.pop(),r.trys.pop();continue}y=e.call(t,r)}catch(_){y=[6,_],s=0}finally{n=c=0}if(y[0]&5)throw y[1];return{value:y[0]?y[1]:void 0,done:!0}}}function Li(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function Bi(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Hr(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function fo(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),s,c=[],h;try{for(;(e===void 0||e-- >0)&&!(s=n.next()).done;)c.push(s.value)}catch(a){h={error:a}}finally{try{s&&!s.done&&(r=n.return)&&r.call(n)}finally{if(h)throw h.error}}return c}function Ii(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(fo(arguments[e]));return t}function Yi(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),s=0,e=0;e<r;e++)for(var c=arguments[e],h=0,a=c.length;h<a;h++,s++)n[s]=c[h];return n}function Yt(t){return this instanceof Yt?(this.v=t,this):new Yt(t)}function zi(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),s,c=[];return s={},h("next"),h("throw"),h("return"),s[Symbol.asyncIterator]=function(){return this},s;function h(S){n[S]&&(s[S]=function(x){return new Promise(function(k,O){c.push([S,x,k,O])>1||a(S,x)})})}function a(S,x){try{g(n[S](x))}catch(k){P(c[0][3],k)}}function g(S){S.value instanceof Yt?Promise.resolve(S.value.v).then(y,_):P(c[0][2],S)}function y(S){a("next",S)}function _(S){a("throw",S)}function P(S,x){S(x),c.shift(),c.length&&a(c[0][0],c[0][1])}}function Fi(t){var e,r;return e={},n("next"),n("throw",function(s){throw s}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(s,c){e[s]=t[s]?function(h){return(r=!r)?{value:Yt(t[s](h)),done:s==="return"}:c?c(h):h}:c}}function Wi(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Hr=="function"?Hr(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(c){r[c]=t[c]&&function(h){return new Promise(function(a,g){h=t[c](h),s(a,g,h.done,h.value)})}}function s(c,h,a,g){Promise.resolve(g).then(function(y){c({value:y,done:a})},h)}}function Ui(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function qi(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function Vi(t){return t&&t.__esModule?t:{default:t}}function Hi(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function Gi(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}const Qi=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return Vr},__asyncDelegator:Fi,__asyncGenerator:zi,__asyncValues:Wi,__await:Yt,__awaiter:Ri,__classPrivateFieldGet:Hi,__classPrivateFieldSet:Gi,__createBinding:Li,__decorate:Ti,__exportStar:Bi,__extends:Ai,__generator:Ni,__importDefault:Vi,__importStar:qi,__makeTemplateObject:Ui,__metadata:$i,__param:ji,__read:fo,__rest:Ei,__spread:Ii,__spreadArrays:Yi,__values:Hr},Symbol.toStringTag,{value:"Module"})),po=Ir(Qi);var zt={},Fe={},go;function mo(){return go||(go=1,Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.MAX_HASHABLE_LENGTH=Fe.INIT=Fe.KEY=Fe.DIGEST_LENGTH=Fe.BLOCK_SIZE=void 0,Fe.BLOCK_SIZE=64,Fe.DIGEST_LENGTH=32,Fe.KEY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Fe.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],Fe.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1),Fe}var Ft={},yo;function Zi(){if(yo)return Ft;yo=1,Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.RawSha256=void 0;var t=mo(),e=(function(){function r(){this.state=Int32Array.from(t.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return r.prototype.update=function(n){if(this.finished)throw new Error("Attempted to update an already finished hash.");var s=0,c=n.byteLength;if(this.bytesHashed+=c,this.bytesHashed*8>t.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;c>0;)this.buffer[this.bufferLength++]=n[s++],c--,this.bufferLength===t.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},r.prototype.digest=function(){if(!this.finished){var n=this.bytesHashed*8,s=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),c=this.bufferLength;if(s.setUint8(this.bufferLength++,128),c%t.BLOCK_SIZE>=t.BLOCK_SIZE-8){for(var h=this.bufferLength;h<t.BLOCK_SIZE;h++)s.setUint8(h,0);this.hashBuffer(),this.bufferLength=0}for(var h=this.bufferLength;h<t.BLOCK_SIZE-8;h++)s.setUint8(h,0);s.setUint32(t.BLOCK_SIZE-8,Math.floor(n/4294967296),!0),s.setUint32(t.BLOCK_SIZE-4,n),this.hashBuffer(),this.finished=!0}for(var a=new Uint8Array(t.DIGEST_LENGTH),h=0;h<8;h++)a[h*4]=this.state[h]>>>24&255,a[h*4+1]=this.state[h]>>>16&255,a[h*4+2]=this.state[h]>>>8&255,a[h*4+3]=this.state[h]>>>0&255;return a},r.prototype.hashBuffer=function(){for(var n=this,s=n.buffer,c=n.state,h=c[0],a=c[1],g=c[2],y=c[3],_=c[4],P=c[5],S=c[6],x=c[7],k=0;k<t.BLOCK_SIZE;k++){if(k<16)this.temp[k]=(s[k*4]&255)<<24|(s[k*4+1]&255)<<16|(s[k*4+2]&255)<<8|s[k*4+3]&255;else{var O=this.temp[k-2],N=(O>>>17|O<<15)^(O>>>19|O<<13)^O>>>10;O=this.temp[k-15];var F=(O>>>7|O<<25)^(O>>>18|O<<14)^O>>>3;this.temp[k]=(N+this.temp[k-7]|0)+(F+this.temp[k-16]|0)}var B=(((_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7))+(_&P^~_&S)|0)+(x+(t.KEY[k]+this.temp[k]|0)|0)|0,Z=((h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10))+(h&a^h&g^a&g)|0;x=S,S=P,P=_,_=y+B|0,y=g,g=a,a=h,h=B+Z|0}c[0]+=h,c[1]+=a,c[2]+=g,c[3]+=y,c[4]+=_,c[5]+=P,c[6]+=S,c[7]+=x},r})();return Ft.RawSha256=e,Ft}var vo={},Wt={};const Ki=t=>{const e=[];for(let r=0,n=t.length;r<n;r++){const s=t.charCodeAt(r);if(s<128)e.push(s);else if(s<2048)e.push(s>>6|192,s&63|128);else if(r+1<t.length&&(s&64512)===55296&&(t.charCodeAt(r+1)&64512)===56320){const c=65536+((s&1023)<<10)+(t.charCodeAt(++r)&1023);e.push(c>>18|240,c>>12&63|128,c>>6&63|128,c&63|128)}else e.push(s>>12|224,s>>6&63|128,s&63|128)}return Uint8Array.from(e)},Ji=t=>{let e="";for(let r=0,n=t.length;r<n;r++){const s=t[r];if(s<128)e+=String.fromCharCode(s);else if(192<=s&&s<224){const c=t[++r];e+=String.fromCharCode((s&31)<<6|c&63)}else if(240<=s&&s<365){const c="%"+[s,t[++r],t[++r],t[++r]].map(h=>h.toString(16)).join("%");e+=decodeURIComponent(c)}else e+=String.fromCharCode((s&15)<<12|(t[++r]&63)<<6|t[++r]&63)}return e};function Xi(t){return new TextEncoder().encode(t)}function ea(t){return new TextDecoder("utf-8").decode(t)}const ta=t=>typeof TextEncoder=="function"?Xi(t):Ki(t),ra=t=>typeof TextDecoder=="function"?ea(t):Ji(t),na=Object.freeze(Object.defineProperty({__proto__:null,fromUtf8:ta,toUtf8:ra},Symbol.toStringTag,{value:"Module"})),oa=Ir(na);var bo;function sa(){if(bo)return Wt;bo=1,Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.convertToBuffer=void 0;var t=oa,e=typeof Buffer<"u"&&Buffer.from?function(n){return Buffer.from(n,"utf8")}:t.fromUtf8;function r(n){return n instanceof Uint8Array?n:typeof n=="string"?e(n):ArrayBuffer.isView(n)?new Uint8Array(n.buffer,n.byteOffset,n.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(n)}return Wt.convertToBuffer=r,Wt}var Ut={},wo;function ia(){if(wo)return Ut;wo=1,Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.isEmptyData=void 0;function t(e){return typeof e=="string"?e.length===0:e.byteLength===0}return Ut.isEmptyData=t,Ut}var qt={},_o;function aa(){if(_o)return qt;_o=1,Object.defineProperty(qt,"__esModule",{value:!0}),qt.numToUint8=void 0;function t(e){return new Uint8Array([(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&255])}return qt.numToUint8=t,qt}var Vt={},Co;function la(){if(Co)return Vt;Co=1,Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.uint32ArrayFrom=void 0;function t(e){if(!Array.from){for(var r=new Uint32Array(e.length),n=0;n<e.length;)r[n]=e[n];return r}return Uint32Array.from(e)}return Vt.uint32ArrayFrom=t,Vt}var xo;function ua(){return xo||(xo=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.uint32ArrayFrom=t.numToUint8=t.isEmptyData=t.convertToBuffer=void 0;var e=sa();Object.defineProperty(t,"convertToBuffer",{enumerable:!0,get:function(){return e.convertToBuffer}});var r=ia();Object.defineProperty(t,"isEmptyData",{enumerable:!0,get:function(){return r.isEmptyData}});var n=aa();Object.defineProperty(t,"numToUint8",{enumerable:!0,get:function(){return n.numToUint8}});var s=la();Object.defineProperty(t,"uint32ArrayFrom",{enumerable:!0,get:function(){return s.uint32ArrayFrom}})})(vo)),vo}var So;function ca(){if(So)return zt;So=1,Object.defineProperty(zt,"__esModule",{value:!0}),zt.Sha256=void 0;var t=po,e=mo(),r=Zi(),n=ua(),s=(function(){function h(a){if(this.hash=new r.RawSha256,a){this.outer=new r.RawSha256;var g=c(a),y=new Uint8Array(e.BLOCK_SIZE);y.set(g);for(var _=0;_<e.BLOCK_SIZE;_++)g[_]^=54,y[_]^=92;this.hash.update(g),this.outer.update(y);for(var _=0;_<g.byteLength;_++)g[_]=0}}return h.prototype.update=function(a){if(!((0,n.isEmptyData)(a)||this.error))try{this.hash.update((0,n.convertToBuffer)(a))}catch(g){this.error=g}},h.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},h.prototype.digest=function(){return(0,t.__awaiter)(this,void 0,void 0,function(){return(0,t.__generator)(this,function(a){return[2,this.digestSync()]})})},h})();zt.Sha256=s;function c(h){var a=(0,n.convertToBuffer)(h);if(a.byteLength>e.BLOCK_SIZE){var g=new r.RawSha256;g.update(a),a=g.digest()}var y=new Uint8Array(e.BLOCK_SIZE);return y.set(a),y}return zt}var Do;function da(){return Do||(Do=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=po;(0,e.__exportStar)(ca(),t)})(ho)),ho}da();function ye(t,e){t!=null&&this.fromString(t,e)}function Be(){return new ye(null)}var ht,ha=0xdeadbeefcafe,ko=(ha&16777215)==15715070;function fa(t,e,r,n,s,c){for(;--c>=0;){var h=e*this[t++]+r[n]+s;s=Math.floor(h/67108864),r[n++]=h&67108863}return s}function pa(t,e,r,n,s,c){for(var h=e&32767,a=e>>15;--c>=0;){var g=this[t]&32767,y=this[t++]>>15,_=a*g+y*h;g=h*g+((_&32767)<<15)+r[n]+(s&1073741823),s=(g>>>30)+(_>>>15)+a*y+(s>>>30),r[n++]=g&1073741823}return s}function ga(t,e,r,n,s,c){for(var h=e&16383,a=e>>14;--c>=0;){var g=this[t]&16383,y=this[t++]>>14,_=a*g+y*h;g=h*g+((_&16383)<<14)+r[n]+s,s=(g>>28)+(_>>14)+a*y,r[n++]=g&268435455}return s}var Po=typeof navigator<"u";Po&&ko&&navigator.appName=="Microsoft Internet Explorer"?(ye.prototype.am=pa,ht=30):Po&&ko&&navigator.appName!="Netscape"?(ye.prototype.am=fa,ht=26):(ye.prototype.am=ga,ht=28),ye.prototype.DB=ht,ye.prototype.DM=(1<<ht)-1,ye.prototype.DV=1<<ht;var Gr=52;ye.prototype.FV=Math.pow(2,Gr),ye.prototype.F1=Gr-ht,ye.prototype.F2=2*ht-Gr;var ma="0123456789abcdefghijklmnopqrstuvwxyz",nr=new Array,kt,We;for(kt=48,We=0;We<=9;++We)nr[kt++]=We;for(kt=97,We=10;We<36;++We)nr[kt++]=We;for(kt=65,We=10;We<36;++We)nr[kt++]=We;function Mo(t){return ma.charAt(t)}function ya(t,e){var r=nr[t.charCodeAt(e)];return r??-1}function va(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}function ba(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0}function Qr(t){var e=Be();return e.fromInt(t),e}function wa(t,e){var r;if(e==16)r=4;else if(e==8)r=3;else if(e==2)r=1;else if(e==32)r=5;else if(e==4)r=2;else throw new Error("Only radix 2, 4, 8, 16, 32 are supported");this.t=0,this.s=0;for(var n=t.length,s=!1,c=0;--n>=0;){var h=ya(t,n);if(h<0){t.charAt(n)=="-"&&(s=!0);continue}s=!1,c==0?this[this.t++]=h:c+r>this.DB?(this[this.t-1]|=(h&(1<<this.DB-c)-1)<<c,this[this.t++]=h>>this.DB-c):this[this.t-1]|=h<<c,c+=r,c>=this.DB&&(c-=this.DB)}this.clamp(),s&&ye.ZERO.subTo(this,this)}function _a(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t}function Ca(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else throw new Error("Only radix 2, 4, 8, 16, 32 are supported");var r=(1<<e)-1,n,s=!1,c="",h=this.t,a=this.DB-h*this.DB%e;if(h-- >0)for(a<this.DB&&(n=this[h]>>a)>0&&(s=!0,c=Mo(n));h>=0;)a<e?(n=(this[h]&(1<<a)-1)<<e-a,n|=this[--h]>>(a+=this.DB-e)):(n=this[h]>>(a-=e)&r,a<=0&&(a+=this.DB,--h)),n>0&&(s=!0),s&&(c+=Mo(n));return s?c:"0"}function xa(){var t=Be();return ye.ZERO.subTo(this,t),t}function Sa(){return this.s<0?this.negate():this}function Da(t){var e=this.s-t.s;if(e!=0)return e;var r=this.t;if(e=r-t.t,e!=0)return this.s<0?-e:e;for(;--r>=0;)if((e=this[r]-t[r])!=0)return e;return 0}function Zr(t){var e=1,r;return(r=t>>>16)!=0&&(t=r,e+=16),(r=t>>8)!=0&&(t=r,e+=8),(r=t>>4)!=0&&(t=r,e+=4),(r=t>>2)!=0&&(t=r,e+=2),(r=t>>1)!=0&&(t=r,e+=1),e}function ka(){return this.t<=0?0:this.DB*(this.t-1)+Zr(this[this.t-1]^this.s&this.DM)}function Pa(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t,e.s=this.s}function Ma(t,e){for(var r=t;r<this.t;++r)e[r-t]=this[r];e.t=Math.max(this.t-t,0),e.s=this.s}function Oa(t,e){var r=t%this.DB,n=this.DB-r,s=(1<<n)-1,c=Math.floor(t/this.DB),h=this.s<<r&this.DM,a;for(a=this.t-1;a>=0;--a)e[a+c+1]=this[a]>>n|h,h=(this[a]&s)<<r;for(a=c-1;a>=0;--a)e[a]=0;e[c]=h,e.t=this.t+c+1,e.s=this.s,e.clamp()}function Aa(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){e.t=0;return}var n=t%this.DB,s=this.DB-n,c=(1<<n)-1;e[0]=this[r]>>n;for(var h=r+1;h<this.t;++h)e[h-r-1]|=(this[h]&c)<<s,e[h-r]=this[h]>>n;n>0&&(e[this.t-r-1]|=(this.s&c)<<s),e.t=this.t-r,e.clamp()}function Ea(t,e){for(var r=0,n=0,s=Math.min(t.t,this.t);r<s;)n+=this[r]-t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n-=t[r],e[r++]=n&this.DM,n>>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e[r++]=this.DV+n:n>0&&(e[r++]=n),e.t=r,e.clamp()}function Ta(t,e){var r=this.abs(),n=t.abs(),s=r.t;for(e.t=s+n.t;--s>=0;)e[s]=0;for(s=0;s<n.t;++s)e[s+r.t]=r.am(0,n[s],e,s,0,r.t);e.s=0,e.clamp(),this.s!=t.s&&ye.ZERO.subTo(e,e)}function ja(t){for(var e=this.abs(),r=t.t=2*e.t;--r>=0;)t[r]=0;for(r=0;r<e.t-1;++r){var n=e.am(r,e[r],t,2*r,0,1);(t[r+e.t]+=e.am(r+1,2*e[r],t,2*r+1,n,e.t-r-1))>=e.DV&&(t[r+e.t]-=e.DV,t[r+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(r,e[r],t,2*r,0,1)),t.s=0,t.clamp()}function $a(t,e,r){var n=t.abs();if(!(n.t<=0)){var s=this.abs();if(s.t<n.t){e?.fromInt(0),r!=null&&this.copyTo(r);return}r==null&&(r=Be());var c=Be(),h=this.s,a=t.s,g=this.DB-Zr(n[n.t-1]);g>0?(n.lShiftTo(g,c),s.lShiftTo(g,r)):(n.copyTo(c),s.copyTo(r));var y=c.t,_=c[y-1];if(_!=0){var P=_*(1<<this.F1)+(y>1?c[y-2]>>this.F2:0),S=this.FV/P,x=(1<<this.F1)/P,k=1<<this.F2,O=r.t,N=O-y,F=e??Be();for(c.dlShiftTo(N,F),r.compareTo(F)>=0&&(r[r.t++]=1,r.subTo(F,r)),ye.ONE.dlShiftTo(y,F),F.subTo(c,c);c.t<y;)c[c.t++]=0;for(;--N>=0;){var B=r[--O]==_?this.DM:Math.floor(r[O]*S+(r[O-1]+k)*x);if((r[O]+=c.am(0,B,r,N,0,y))<B)for(c.dlShiftTo(N,F),r.subTo(F,r);r[O]<--B;)r.subTo(F,r)}e!=null&&(r.drShiftTo(y,e),h!=a&&ye.ZERO.subTo(e,e)),r.t=y,r.clamp(),g>0&&r.rShiftTo(g,r),h<0&&ye.ZERO.subTo(r,r)}}}function Ra(t){var e=Be();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(ye.ZERO)>0&&t.subTo(e,e),e}function Na(){if(this.t<1)return 0;var t=this[0];if((t&1)==0)return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function La(t){return this.compareTo(t)==0}function Ba(t,e){for(var r=0,n=0,s=Math.min(t.t,this.t);r<s;)n+=this[r]+t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n+=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n+=t[r],e[r++]=n&this.DM,n>>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e[r++]=n:n<-1&&(e[r++]=this.DV+n),e.t=r,e.clamp()}function Ia(t){var e=Be();return this.addTo(t,e),e}function Ya(t){var e=Be();return this.subTo(t,e),e}function za(t){var e=Be();return this.multiplyTo(t,e),e}function Fa(t){var e=Be();return this.divRemTo(t,e,null),e}function Pt(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function Wa(t){var e=Be();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(ye.ZERO)>0&&this.m.subTo(e,e),e}function Ua(t){var e=Be();return t.copyTo(e),this.reduce(e),e}function qa(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=t[e]&32767,n=r*this.mpl+((r*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t[r]+=this.m.am(0,n,t,e,0,this.m.t);t[r]>=t.DV;)t[r]-=t.DV,t[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function Va(t,e){t.squareTo(e),this.reduce(e)}function Ha(t,e,r){t.multiplyTo(e,r),this.reduce(r)}Pt.prototype.convert=Wa,Pt.prototype.revert=Ua,Pt.prototype.reduce=qa,Pt.prototype.mulTo=Ha,Pt.prototype.sqrTo=Va;function Ga(t,e,r){var n=t.bitLength(),s,c=Qr(1),h=new Pt(e);if(n<=0)return c;n<18?s=1:n<48?s=3:n<144?s=4:n<768?s=5:s=6;var a=new Array,g=3,y=s-1,_=(1<<s)-1;if(a[1]=h.convert(this),s>1){var P=Be();for(h.sqrTo(a[1],P);g<=_;)a[g]=Be(),h.mulTo(P,a[g-2],a[g]),g+=2}var S=t.t-1,x,k=!0,O=Be(),N;for(n=Zr(t[S])-1;S>=0;){for(n>=y?x=t[S]>>n-y&_:(x=(t[S]&(1<<n+1)-1)<<y-n,S>0&&(x|=t[S-1]>>this.DB+n-y)),g=s;(x&1)==0;)x>>=1,--g;if((n-=g)<0&&(n+=this.DB,--S),k)a[x].copyTo(c),k=!1;else{for(;g>1;)h.sqrTo(c,O),h.sqrTo(O,c),g-=2;g>0?h.sqrTo(c,O):(N=c,c=O,O=N),h.mulTo(O,a[x],c)}for(;S>=0&&(t[S]&1<<n)==0;)h.sqrTo(c,O),N=c,c=O,O=N,--n<0&&(n=this.DB-1,--S)}var F=h.revert(c);return r(null,F),F}ye.prototype.copyTo=va,ye.prototype.fromInt=ba,ye.prototype.fromString=wa,ye.prototype.clamp=_a,ye.prototype.dlShiftTo=Pa,ye.prototype.drShiftTo=Ma,ye.prototype.lShiftTo=Oa,ye.prototype.rShiftTo=Aa,ye.prototype.subTo=Ea,ye.prototype.multiplyTo=Ta,ye.prototype.squareTo=ja,ye.prototype.divRemTo=$a,ye.prototype.invDigit=Na,ye.prototype.addTo=Ba,ye.prototype.toString=Ca,ye.prototype.negate=xa,ye.prototype.abs=Sa,ye.prototype.compareTo=Da,ye.prototype.bitLength=ka,ye.prototype.mod=Ra,ye.prototype.equals=La,ye.prototype.add=Ia,ye.prototype.subtract=Ya,ye.prototype.multiply=za,ye.prototype.divide=Fa,ye.prototype.modPow=Ga,ye.ZERO=Qr(0),ye.ONE=Qr(1);function Qa(t,e){return e=e||{},new Promise(function(r,n){var s=new XMLHttpRequest,c=[],h=[],a={},g=function(){return{ok:(s.status/100|0)==2,statusText:s.statusText,status:s.status,url:s.responseURL,text:function(){return Promise.resolve(s.responseText)},json:function(){return Promise.resolve(s.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([s.response]))},clone:g,headers:{keys:function(){return c},entries:function(){return h},get:function(_){return a[_.toLowerCase()]},has:function(_){return _.toLowerCase()in a}}}};for(var y in s.open(e.method||"get",t,!0),s.onload=function(){s.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(_,P,S){c.push(P=P.toLowerCase()),h.push([P,S]),a[P]=a[P]?a[P]+","+S:S}),r(g())},s.onerror=n,s.withCredentials=e.credentials=="include",e.headers)s.setRequestHeader(y,e.headers[y]);s.send(e.body||null)})}const Za=Object.freeze(Object.defineProperty({__proto__:null,default:Qa},Symbol.toStringTag,{value:"Module"})),Oo=Ir(Za);var Ao,Eo;function Ka(){return Eo||(Eo=1,Ao=self.fetch||(self.fetch=Oo.default||Oo)),Ao}Ka();var To={exports:{}};var jo;function Ja(){return jo||(jo=1,(function(t,e){(function(r){var n;if(t.exports=r(),n=!0,!n){var s=window.Cookies,c=window.Cookies=r();c.noConflict=function(){return window.Cookies=s,c}}})(function(){function r(){for(var c=0,h={};c<arguments.length;c++){var a=arguments[c];for(var g in a)h[g]=a[g]}return h}function n(c){return c.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}function s(c){function h(){}function a(y,_,P){if(!(typeof document>"u")){P=r({path:"/"},h.defaults,P),typeof P.expires=="number"&&(P.expires=new Date(new Date*1+P.expires*864e5)),P.expires=P.expires?P.expires.toUTCString():"";try{var S=JSON.stringify(_);/^[\{\[]/.test(S)&&(_=S)}catch{}_=c.write?c.write(_,y):encodeURIComponent(String(_)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),y=encodeURIComponent(String(y)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var x="";for(var k in P)P[k]&&(x+="; "+k,P[k]!==!0&&(x+="="+P[k].split(";")[0]));return document.cookie=y+"="+_+x}}function g(y,_){if(!(typeof document>"u")){for(var P={},S=document.cookie?document.cookie.split("; "):[],x=0;x<S.length;x++){var k=S[x].split("="),O=k.slice(1).join("=");!_&&O.charAt(0)==='"'&&(O=O.slice(1,-1));try{var N=n(k[0]);if(O=(c.read||c)(O,N)||n(O),_)try{O=JSON.parse(O)}catch{}if(P[N]=O,y===N)break}catch{}}return y?P[y]:P}}return h.set=a,h.get=function(y){return g(y,!1)},h.getJSON=function(y){return g(y,!0)},h.remove=function(y,_){a(y,"",r(_,{expires:-1}))},h.defaults={},h.withConverter=s,h}return s(function(){})})})(To)),To.exports}Ja();function Xa(){if(!window.MantineCognitoUserPool)throw new Error("Cognito Userpool has not been initialized.");return window.MantineCognitoUserPool}function el(){return Xa().getCurrentUser()}function tl(){return new Promise((t,e)=>{const r=el();r===null&&e(null),r?.getSession((n,s)=>{if(n!==null||s===null)return e(null);t({session:s,authenticatedUser:r})})})}async function rl(){const{session:t}=await tl();return t?.getIdToken().getJwtToken()}Q.createContext(void 0);var nl="undefined",ol="object",or="browser",$o="cpu",Ro="device",Kr="engine",sr="os",ft="name",ir="type",Jr="vendor",Ke="version",Xr="architecture",en="major",tn="model",sl="console",il="mobile",al="tablet",ll="smarttv",ul="wearable",cl="embedded",dl=typeof window!==nl,rn=dl&&window.navigator?window.navigator:void 0;rn&&rn.userAgentData&&rn.userAgentData;var ar=function(t){for(var e={},r=0;r<t.length;r++)e[t[r].toUpperCase()]=t[r];return e},lr=function(t){for(var e in t){var r=t[e];typeof r==ol&&r.length==2?this[r[0]]=r[1]:this[r]=void 0}return this};(function(){var t={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return lr.call(t.init,[[or,[ft,Ke,en,ir]],[$o,[Xr]],[Ro,[ir,tn,Jr]],[Kr,[ft,Ke]],[sr,[ft,Ke]]]),lr.call(t.isIgnore,[[or,[Ke,en]],[Kr,[Ke]],[sr,[Ke]]]),lr.call(t.isIgnoreRgx,[[or,/ ?browser$/i],[sr,/ ?os$/i]]),lr.call(t.toString,[[or,[ft,Ke]],[$o,[Xr]],[Ro,[Jr,tn]],[Kr,[ft,Ke]],[sr,[ft,Ke]]]),t})(),ar([ft,Ke,en,ir]),ar([Xr]),ar([tn,Jr,ir,sl,il,ll,al,ul,cl]),ar([ft,Ke]);var nn={exports:{}},hl=nn.exports,No;function fl(){return No||(No=1,(function(t,e){(function(r,n){t.exports=n()})(hl,()=>(()=>{var r={873:(h,a)=>{var g,y,_=(function(){var P=function(D,C){var b=D,u=F[C],d=null,m=0,f=null,i=[],v={},E=function(A,L){d=(function($){for(var Y=new Array($),I=0;I<$;I+=1){Y[I]=new Array($);for(var de=0;de<$;de+=1)Y[I][de]=null}return Y})(m=4*b+17),j(0,0),j(m-7,0),j(0,m-7),X(),G(),V(A,L),b>=7&&te(A),f==null&&(f=ie(b,u,i)),se(f,L)},j=function(A,L){for(var $=-1;$<=7;$+=1)if(!(A+$<=-1||m<=A+$))for(var Y=-1;Y<=7;Y+=1)L+Y<=-1||m<=L+Y||(d[A+$][L+Y]=0<=$&&$<=6&&(Y==0||Y==6)||0<=Y&&Y<=6&&($==0||$==6)||2<=$&&$<=4&&2<=Y&&Y<=4)},G=function(){for(var A=8;A<m-8;A+=1)d[A][6]==null&&(d[A][6]=A%2==0);for(var L=8;L<m-8;L+=1)d[6][L]==null&&(d[6][L]=L%2==0)},X=function(){for(var A=B.getPatternPosition(b),L=0;L<A.length;L+=1)for(var $=0;$<A.length;$+=1){var Y=A[L],I=A[$];if(d[Y][I]==null)for(var de=-2;de<=2;de+=1)for(var o=-2;o<=2;o+=1)d[Y+de][I+o]=de==-2||de==2||o==-2||o==2||de==0&&o==0}},te=function(A){for(var L=B.getBCHTypeNumber(b),$=0;$<18;$+=1){var Y=!A&&(L>>$&1)==1;d[Math.floor($/3)][$%3+m-8-3]=Y}for($=0;$<18;$+=1)Y=!A&&(L>>$&1)==1,d[$%3+m-8-3][Math.floor($/3)]=Y},V=function(A,L){for(var $=u<<3|L,Y=B.getBCHTypeInfo($),I=0;I<15;I+=1){var de=!A&&(Y>>I&1)==1;I<6?d[I][8]=de:I<8?d[I+1][8]=de:d[m-15+I][8]=de}for(I=0;I<15;I+=1)de=!A&&(Y>>I&1)==1,I<8?d[8][m-I-1]=de:I<9?d[8][15-I-1+1]=de:d[8][15-I-1]=de;d[m-8][8]=!A},se=function(A,L){for(var $=-1,Y=m-1,I=7,de=0,o=B.getMaskFunction(L),l=m-1;l>0;l-=2)for(l==6&&(l-=1);;){for(var p=0;p<2;p+=1)if(d[Y][l-p]==null){var M=!1;de<A.length&&(M=(A[de]>>>I&1)==1),o(Y,l-p)&&(M=!M),d[Y][l-p]=M,(I-=1)==-1&&(de+=1,I=7)}if((Y+=$)<0||m<=Y){Y-=$,$=-$;break}}},ie=function(A,L,$){for(var Y=ee.getRSBlocks(A,L),I=re(),de=0;de<$.length;de+=1){var o=$[de];I.put(o.getMode(),4),I.put(o.getLength(),B.getLengthInBits(o.getMode(),A)),o.write(I)}var l=0;for(de=0;de<Y.length;de+=1)l+=Y[de].dataCount;if(I.getLengthInBits()>8*l)throw"code length overflow. ("+I.getLengthInBits()+">"+8*l+")";for(I.getLengthInBits()+4<=8*l&&I.put(0,4);I.getLengthInBits()%8!=0;)I.putBit(!1);for(;!(I.getLengthInBits()>=8*l||(I.put(236,8),I.getLengthInBits()>=8*l));)I.put(17,8);return(function(p,M){for(var R=0,z=0,le=0,ce=new Array(M.length),fe=new Array(M.length),ne=0;ne<M.length;ne+=1){var pe=M[ne].dataCount,me=M[ne].totalCount-pe;z=Math.max(z,pe),le=Math.max(le,me),ce[ne]=new Array(pe);for(var ge=0;ge<ce[ne].length;ge+=1)ce[ne][ge]=255&p.getBuffer()[ge+R];R+=pe;var xe=B.getErrorCorrectPolynomial(me),Ce=U(ce[ne],xe.getLength()-1).mod(xe);for(fe[ne]=new Array(xe.getLength()-1),ge=0;ge<fe[ne].length;ge+=1){var ke=ge+Ce.getLength()-fe[ne].length;fe[ne][ge]=ke>=0?Ce.getAt(ke):0}}var qe=0;for(ge=0;ge<M.length;ge+=1)qe+=M[ge].totalCount;var Re=new Array(qe),_e=0;for(ge=0;ge<z;ge+=1)for(ne=0;ne<M.length;ne+=1)ge<ce[ne].length&&(Re[_e]=ce[ne][ge],_e+=1);for(ge=0;ge<le;ge+=1)for(ne=0;ne<M.length;ne+=1)ge<fe[ne].length&&(Re[_e]=fe[ne][ge],_e+=1);return Re})(I,Y)};v.addData=function(A,L){var $=null;switch(L=L||"Byte"){case"Numeric":$=K(A);break;case"Alphanumeric":$=J(A);break;case"Byte":$=q(A);break;case"Kanji":$=H(A);break;default:throw"mode:"+L}i.push($),f=null},v.isDark=function(A,L){if(A<0||m<=A||L<0||m<=L)throw A+","+L;return d[A][L]},v.getModuleCount=function(){return m},v.make=function(){if(b<1){for(var A=1;A<40;A++){for(var L=ee.getRSBlocks(A,u),$=re(),Y=0;Y<i.length;Y++){var I=i[Y];$.put(I.getMode(),4),$.put(I.getLength(),B.getLengthInBits(I.getMode(),A)),I.write($)}var de=0;for(Y=0;Y<L.length;Y++)de+=L[Y].dataCount;if($.getLengthInBits()<=8*de)break}b=A}E(!1,(function(){for(var o=0,l=0,p=0;p<8;p+=1){E(!0,p);var M=B.getLostPoint(v);(p==0||o>M)&&(o=M,l=p)}return l})())},v.createTableTag=function(A,L){A=A||2;var $="";$+='<table style="',$+=" border-width: 0px; border-style: none;",$+=" border-collapse: collapse;",$+=" padding: 0px; margin: "+(L=L===void 0?4*A:L)+"px;",$+='">',$+="<tbody>";for(var Y=0;Y<v.getModuleCount();Y+=1){$+="<tr>";for(var I=0;I<v.getModuleCount();I+=1)$+='<td style="',$+=" border-width: 0px; border-style: none;",$+=" border-collapse: collapse;",$+=" padding: 0px; margin: 0px;",$+=" width: "+A+"px;",$+=" height: "+A+"px;",$+=" background-color: ",$+=v.isDark(Y,I)?"#000000":"#ffffff",$+=";",$+='"/>';$+="</tr>"}return($+="</tbody>")+"</table>"},v.createSvgTag=function(A,L,$,Y){var I={};typeof arguments[0]=="object"&&(A=(I=arguments[0]).cellSize,L=I.margin,$=I.alt,Y=I.title),A=A||2,L=L===void 0?4*A:L,($=typeof $=="string"?{text:$}:$||{}).text=$.text||null,$.id=$.text?$.id||"qrcode-description":null,(Y=typeof Y=="string"?{text:Y}:Y||{}).text=Y.text||null,Y.id=Y.text?Y.id||"qrcode-title":null;var de,o,l,p,M=v.getModuleCount()*A+2*L,R="";for(p="l"+A+",0 0,"+A+" -"+A+",0 0,-"+A+"z ",R+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',R+=I.scalable?"":' width="'+M+'px" height="'+M+'px"',R+=' viewBox="0 0 '+M+" "+M+'" ',R+=' preserveAspectRatio="xMinYMin meet"',R+=Y.text||$.text?' role="img" aria-labelledby="'+ue([Y.id,$.id].join(" ").trim())+'"':"",R+=">",R+=Y.text?'<title id="'+ue(Y.id)+'">'+ue(Y.text)+"</title>":"",R+=$.text?'<description id="'+ue($.id)+'">'+ue($.text)+"</description>":"",R+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',R+='<path d="',o=0;o<v.getModuleCount();o+=1)for(l=o*A+L,de=0;de<v.getModuleCount();de+=1)v.isDark(o,de)&&(R+="M"+(de*A+L)+","+l+p);return(R+='" stroke="transparent" fill="black"/>')+"</svg>"},v.createDataURL=function(A,L){A=A||2,L=L===void 0?4*A:L;var $=v.getModuleCount()*A+2*L,Y=L,I=$-L;return oe($,$,function(de,o){if(Y<=de&&de<I&&Y<=o&&o<I){var l=Math.floor((de-Y)/A),p=Math.floor((o-Y)/A);return v.isDark(p,l)?0:1}return 1})},v.createImgTag=function(A,L,$){A=A||2,L=L===void 0?4*A:L;var Y=v.getModuleCount()*A+2*L,I="";return I+="<img",I+=' src="',I+=v.createDataURL(A,L),I+='"',I+=' width="',I+=Y,I+='"',I+=' height="',I+=Y,I+='"',$&&(I+=' alt="',I+=ue($),I+='"'),I+"/>"};var ue=function(A){for(var L="",$=0;$<A.length;$+=1){var Y=A.charAt($);switch(Y){case"<":L+="<";break;case">":L+=">";break;case"&":L+="&";break;case'"':L+=""";break;default:L+=Y}}return L};return v.createASCII=function(A,L){if((A=A||1)<2)return(function(ce){ce=ce===void 0?2:ce;var fe,ne,pe,me,ge,xe=1*v.getModuleCount()+2*ce,Ce=ce,ke=xe-ce,qe={"██":"█","█ ":"▀"," █":"▄"," ":" "},Re={"██":"▀","█ ":"▀"," █":" "," ":" "},_e="";for(fe=0;fe<xe;fe+=2){for(pe=Math.floor((fe-Ce)/1),me=Math.floor((fe+1-Ce)/1),ne=0;ne<xe;ne+=1)ge="█",Ce<=ne&&ne<ke&&Ce<=fe&&fe<ke&&v.isDark(pe,Math.floor((ne-Ce)/1))&&(ge=" "),Ce<=ne&&ne<ke&&Ce<=fe+1&&fe+1<ke&&v.isDark(me,Math.floor((ne-Ce)/1))?ge+=" ":ge+="█",_e+=ce<1&&fe+1>=ke?Re[ge]:qe[ge];_e+=`
|
|
20
|
-
`}return xe%2&&ce>0?_e.substring(0,_e.length-xe-1)+Array(xe+1).join("▀"):_e.substring(0,_e.length-1)})(L);
|
|
21
|
-
`}return z.substring(0,z.length-1)},v.renderTo2dContext=function(A,L){L=L||2;for(var $=v.getModuleCount(),Y=0;Y<$;Y++)for(var I=0;I<$;I++)A.fillStyle=v.isDark(Y,I)?"black":"white",A.fillRect(Y*L,I*L,L,L)},v};P.stringToBytes=(P.stringToBytesFuncs={default:function(D){for(var C=[],b=0;b<D.length;b+=1){var u=D.charCodeAt(b);C.push(255&u)}return C}}).default,P.createStringToBytes=function(D,C){var b=(function(){for(var d=ae(D),m=function(){var G=d.read();if(G==-1)throw"eof";return G},f=0,i={};;){var v=d.read();if(v==-1)break;var E=m(),j=m()<<8|m();i[String.fromCharCode(v<<8|E)]=j,f+=1}if(f!=C)throw f+" != "+C;return i})(),u=63;return function(d){for(var m=[],f=0;f<d.length;f+=1){var i=d.charCodeAt(f);if(i<128)m.push(i);else{var v=b[d.charAt(f)];typeof v=="number"?(255&v)==v?m.push(v):(m.push(v>>>8),m.push(255&v)):m.push(u)}}return m}};var S,x,k,O,N,F={L:1,M:0,Q:3,H:2},B=(S=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],x=1335,k=7973,N=function(D){for(var C=0;D!=0;)C+=1,D>>>=1;return C},(O={}).getBCHTypeInfo=function(D){for(var C=D<<10;N(C)-N(x)>=0;)C^=x<<N(C)-N(x);return 21522^(D<<10|C)},O.getBCHTypeNumber=function(D){for(var C=D<<12;N(C)-N(k)>=0;)C^=k<<N(C)-N(k);return D<<12|C},O.getPatternPosition=function(D){return S[D-1]},O.getMaskFunction=function(D){switch(D){case 0:return function(C,b){return(C+b)%2==0};case 1:return function(C,b){return C%2==0};case 2:return function(C,b){return b%3==0};case 3:return function(C,b){return(C+b)%3==0};case 4:return function(C,b){return(Math.floor(C/2)+Math.floor(b/3))%2==0};case 5:return function(C,b){return C*b%2+C*b%3==0};case 6:return function(C,b){return(C*b%2+C*b%3)%2==0};case 7:return function(C,b){return(C*b%3+(C+b)%2)%2==0};default:throw"bad maskPattern:"+D}},O.getErrorCorrectPolynomial=function(D){for(var C=U([1],0),b=0;b<D;b+=1)C=C.multiply(U([1,Z.gexp(b)],0));return C},O.getLengthInBits=function(D,C){if(1<=C&&C<10)switch(D){case 1:return 10;case 2:return 9;case 4:case 8:return 8;default:throw"mode:"+D}else if(C<27)switch(D){case 1:return 12;case 2:return 11;case 4:return 16;case 8:return 10;default:throw"mode:"+D}else{if(!(C<41))throw"type:"+C;switch(D){case 1:return 14;case 2:return 13;case 4:return 16;case 8:return 12;default:throw"mode:"+D}}},O.getLostPoint=function(D){for(var C=D.getModuleCount(),b=0,u=0;u<C;u+=1)for(var d=0;d<C;d+=1){for(var m=0,f=D.isDark(u,d),i=-1;i<=1;i+=1)if(!(u+i<0||C<=u+i))for(var v=-1;v<=1;v+=1)d+v<0||C<=d+v||i==0&&v==0||f==D.isDark(u+i,d+v)&&(m+=1);m>5&&(b+=3+m-5)}for(u=0;u<C-1;u+=1)for(d=0;d<C-1;d+=1){var E=0;D.isDark(u,d)&&(E+=1),D.isDark(u+1,d)&&(E+=1),D.isDark(u,d+1)&&(E+=1),D.isDark(u+1,d+1)&&(E+=1),E!=0&&E!=4||(b+=3)}for(u=0;u<C;u+=1)for(d=0;d<C-6;d+=1)D.isDark(u,d)&&!D.isDark(u,d+1)&&D.isDark(u,d+2)&&D.isDark(u,d+3)&&D.isDark(u,d+4)&&!D.isDark(u,d+5)&&D.isDark(u,d+6)&&(b+=40);for(d=0;d<C;d+=1)for(u=0;u<C-6;u+=1)D.isDark(u,d)&&!D.isDark(u+1,d)&&D.isDark(u+2,d)&&D.isDark(u+3,d)&&D.isDark(u+4,d)&&!D.isDark(u+5,d)&&D.isDark(u+6,d)&&(b+=40);var j=0;for(d=0;d<C;d+=1)for(u=0;u<C;u+=1)D.isDark(u,d)&&(j+=1);return b+Math.abs(100*j/C/C-50)/5*10},O),Z=(function(){for(var D=new Array(256),C=new Array(256),b=0;b<8;b+=1)D[b]=1<<b;for(b=8;b<256;b+=1)D[b]=D[b-4]^D[b-5]^D[b-6]^D[b-8];for(b=0;b<255;b+=1)C[D[b]]=b;return{glog:function(u){if(u<1)throw"glog("+u+")";return C[u]},gexp:function(u){for(;u<0;)u+=255;for(;u>=256;)u-=255;return D[u]}}})();function U(D,C){if(D.length===void 0)throw D.length+"/"+C;var b=(function(){for(var d=0;d<D.length&&D[d]==0;)d+=1;for(var m=new Array(D.length-d+C),f=0;f<D.length-d;f+=1)m[f]=D[f+d];return m})(),u={getAt:function(d){return b[d]},getLength:function(){return b.length},multiply:function(d){for(var m=new Array(u.getLength()+d.getLength()-1),f=0;f<u.getLength();f+=1)for(var i=0;i<d.getLength();i+=1)m[f+i]^=Z.gexp(Z.glog(u.getAt(f))+Z.glog(d.getAt(i)));return U(m,0)},mod:function(d){if(u.getLength()-d.getLength()<0)return u;for(var m=Z.glog(u.getAt(0))-Z.glog(d.getAt(0)),f=new Array(u.getLength()),i=0;i<u.getLength();i+=1)f[i]=u.getAt(i);for(i=0;i<d.getLength();i+=1)f[i]^=Z.gexp(Z.glog(d.getAt(i))+m);return U(f,0).mod(d)}};return u}var ee=(function(){var D=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],C=function(u,d){var m={};return m.totalCount=u,m.dataCount=d,m},b={getRSBlocks:function(u,d){var m=(function(te,V){switch(V){case F.L:return D[4*(te-1)+0];case F.M:return D[4*(te-1)+1];case F.Q:return D[4*(te-1)+2];case F.H:return D[4*(te-1)+3];default:return}})(u,d);if(m===void 0)throw"bad rs block @ typeNumber:"+u+"/errorCorrectionLevel:"+d;for(var f=m.length/3,i=[],v=0;v<f;v+=1)for(var E=m[3*v+0],j=m[3*v+1],G=m[3*v+2],X=0;X<E;X+=1)i.push(C(j,G));return i}};return b})(),re=function(){var D=[],C=0,b={getBuffer:function(){return D},getAt:function(u){var d=Math.floor(u/8);return(D[d]>>>7-u%8&1)==1},put:function(u,d){for(var m=0;m<d;m+=1)b.putBit((u>>>d-m-1&1)==1)},getLengthInBits:function(){return C},putBit:function(u){var d=Math.floor(C/8);D.length<=d&&D.push(0),u&&(D[d]|=128>>>C%8),C+=1}};return b},K=function(D){var C=D,b={getMode:function(){return 1},getLength:function(m){return C.length},write:function(m){for(var f=C,i=0;i+2<f.length;)m.put(u(f.substring(i,i+3)),10),i+=3;i<f.length&&(f.length-i==1?m.put(u(f.substring(i,i+1)),4):f.length-i==2&&m.put(u(f.substring(i,i+2)),7))}},u=function(m){for(var f=0,i=0;i<m.length;i+=1)f=10*f+d(m.charAt(i));return f},d=function(m){if("0"<=m&&m<="9")return m.charCodeAt(0)-48;throw"illegal char :"+m};return b},J=function(D){var C=D,b={getMode:function(){return 2},getLength:function(d){return C.length},write:function(d){for(var m=C,f=0;f+1<m.length;)d.put(45*u(m.charAt(f))+u(m.charAt(f+1)),11),f+=2;f<m.length&&d.put(u(m.charAt(f)),6)}},u=function(d){if("0"<=d&&d<="9")return d.charCodeAt(0)-48;if("A"<=d&&d<="Z")return d.charCodeAt(0)-65+10;switch(d){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+d}};return b},q=function(D){var C=P.stringToBytes(D);return{getMode:function(){return 4},getLength:function(b){return C.length},write:function(b){for(var u=0;u<C.length;u+=1)b.put(C[u],8)}}},H=function(D){var C=P.stringToBytesFuncs.SJIS;if(!C)throw"sjis not supported.";(function(){var d=C("友");if(d.length!=2||(d[0]<<8|d[1])!=38726)throw"sjis not supported."})();var b=C(D),u={getMode:function(){return 8},getLength:function(d){return~~(b.length/2)},write:function(d){for(var m=b,f=0;f+1<m.length;){var i=(255&m[f])<<8|255&m[f+1];if(33088<=i&&i<=40956)i-=33088;else{if(!(57408<=i&&i<=60351))throw"illegal char at "+(f+1)+"/"+i;i-=49472}i=192*(i>>>8&255)+(255&i),d.put(i,13),f+=2}if(f<m.length)throw"illegal char at "+(f+1)}};return u},W=function(){var D=[],C={writeByte:function(b){D.push(255&b)},writeShort:function(b){C.writeByte(b),C.writeByte(b>>>8)},writeBytes:function(b,u,d){u=u||0,d=d||b.length;for(var m=0;m<d;m+=1)C.writeByte(b[m+u])},writeString:function(b){for(var u=0;u<b.length;u+=1)C.writeByte(b.charCodeAt(u))},toByteArray:function(){return D},toString:function(){var b="";b+="[";for(var u=0;u<D.length;u+=1)u>0&&(b+=","),b+=D[u];return b+"]"}};return C},ae=function(D){var C=D,b=0,u=0,d=0,m={read:function(){for(;d<8;){if(b>=C.length){if(d==0)return-1;throw"unexpected end of file./"+d}var i=C.charAt(b);if(b+=1,i=="=")return d=0,-1;i.match(/^\s$/)||(u=u<<6|f(i.charCodeAt(0)),d+=6)}var v=u>>>d-8&255;return d-=8,v}},f=function(i){if(65<=i&&i<=90)return i-65;if(97<=i&&i<=122)return i-97+26;if(48<=i&&i<=57)return i-48+52;if(i==43)return 62;if(i==47)return 63;throw"c:"+i};return m},oe=function(D,C,b){for(var u=(function(j,G){var X=j,te=G,V=new Array(j*G),se={setPixel:function(A,L,$){V[L*X+A]=$},write:function(A){A.writeString("GIF87a"),A.writeShort(X),A.writeShort(te),A.writeByte(128),A.writeByte(0),A.writeByte(0),A.writeByte(0),A.writeByte(0),A.writeByte(0),A.writeByte(255),A.writeByte(255),A.writeByte(255),A.writeString(","),A.writeShort(0),A.writeShort(0),A.writeShort(X),A.writeShort(te),A.writeByte(0);var L=ie(2);A.writeByte(2);for(var $=0;L.length-$>255;)A.writeByte(255),A.writeBytes(L,$,255),$+=255;A.writeByte(L.length-$),A.writeBytes(L,$,L.length-$),A.writeByte(0),A.writeString(";")}},ie=function(A){for(var L=1<<A,$=1+(1<<A),Y=A+1,I=ue(),de=0;de<L;de+=1)I.add(String.fromCharCode(de));I.add(String.fromCharCode(L)),I.add(String.fromCharCode($));var o,l,p,M=W(),R=(o=M,l=0,p=0,{write:function(fe,ne){if(fe>>>ne)throw"length over";for(;l+ne>=8;)o.writeByte(255&(fe<<l|p)),ne-=8-l,fe>>>=8-l,p=0,l=0;p|=fe<<l,l+=ne},flush:function(){l>0&&o.writeByte(p)}});R.write(L,Y);var z=0,le=String.fromCharCode(V[z]);for(z+=1;z<V.length;){var ce=String.fromCharCode(V[z]);z+=1,I.contains(le+ce)?le+=ce:(R.write(I.indexOf(le),Y),I.size()<4095&&(I.size()==1<<Y&&(Y+=1),I.add(le+ce)),le=ce)}return R.write(I.indexOf(le),Y),R.write($,Y),R.flush(),M.toByteArray()},ue=function(){var A={},L=0,$={add:function(Y){if($.contains(Y))throw"dup key:"+Y;A[Y]=L,L+=1},size:function(){return L},indexOf:function(Y){return A[Y]},contains:function(Y){return A[Y]!==void 0}};return $};return se})(D,C),d=0;d<C;d+=1)for(var m=0;m<D;m+=1)u.setPixel(m,d,b(m,d));var f=W();u.write(f);for(var i=(function(){var j=0,G=0,X=0,te="",V={},se=function(ue){te+=String.fromCharCode(ie(63&ue))},ie=function(ue){if(!(ue<0)){if(ue<26)return 65+ue;if(ue<52)return ue-26+97;if(ue<62)return ue-52+48;if(ue==62)return 43;if(ue==63)return 47}throw"n:"+ue};return V.writeByte=function(ue){for(j=j<<8|255&ue,G+=8,X+=1;G>=6;)se(j>>>G-6),G-=6},V.flush=function(){if(G>0&&(se(j<<6-G),j=0,G=0),X%3!=0)for(var ue=3-X%3,A=0;A<ue;A+=1)te+="="},V.toString=function(){return te},V})(),v=f.toByteArray(),E=0;E<v.length;E+=1)i.writeByte(v[E]);return i.flush(),"data:image/gif;base64,"+i};return P})();_.stringToBytesFuncs["UTF-8"]=function(P){return(function(S){for(var x=[],k=0;k<S.length;k++){var O=S.charCodeAt(k);O<128?x.push(O):O<2048?x.push(192|O>>6,128|63&O):O<55296||O>=57344?x.push(224|O>>12,128|O>>6&63,128|63&O):(k++,O=65536+((1023&O)<<10|1023&S.charCodeAt(k)),x.push(240|O>>18,128|O>>12&63,128|O>>6&63,128|63&O))}return x})(P)},(y=typeof(g=function(){return _})=="function"?g.apply(a,[]):g)===void 0||(h.exports=y)}},n={};function s(h){var a=n[h];if(a!==void 0)return a.exports;var g=n[h]={exports:{}};return r[h](g,g.exports,s),g.exports}s.n=h=>{var a=h&&h.__esModule?()=>h.default:()=>h;return s.d(a,{a}),a},s.d=(h,a)=>{for(var g in a)s.o(a,g)&&!s.o(h,g)&&Object.defineProperty(h,g,{enumerable:!0,get:a[g]})},s.o=(h,a)=>Object.prototype.hasOwnProperty.call(h,a);var c={};return(()=>{s.d(c,{default:()=>C});const h=b=>!!b&&typeof b=="object"&&!Array.isArray(b);function a(b,...u){if(!u.length)return b;const d=u.shift();return d!==void 0&&h(b)&&h(d)?(b=Object.assign({},b),Object.keys(d).forEach(m=>{const f=b[m],i=d[m];Array.isArray(f)&&Array.isArray(i)?b[m]=i:h(f)&&h(i)?b[m]=a(Object.assign({},f),i):b[m]=i}),a(b,...u)):b}function g(b,u){const d=document.createElement("a");d.download=u,d.href=b,document.body.appendChild(d),d.click(),document.body.removeChild(d)}const y={L:.07,M:.15,Q:.25,H:.3};class _{constructor({svg:u,type:d,window:m}){this._svg=u,this._type=d,this._window=m}draw(u,d,m,f){let i;switch(this._type){case"dots":i=this._drawDot;break;case"classy":i=this._drawClassy;break;case"classy-rounded":i=this._drawClassyRounded;break;case"rounded":i=this._drawRounded;break;case"extra-rounded":i=this._drawExtraRounded;break;default:i=this._drawSquare}i.call(this,{x:u,y:d,size:m,getNeighbor:f})}_rotateFigure({x:u,y:d,size:m,rotation:f=0,draw:i}){var v;const E=u+m/2,j=d+m/2;i(),(v=this._element)===null||v===void 0||v.setAttribute("transform",`rotate(${180*f/Math.PI},${E},${j})`)}_basicDot(u){const{size:d,x:m,y:f}=u;this._rotateFigure(Object.assign(Object.assign({},u),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","circle"),this._element.setAttribute("cx",String(m+d/2)),this._element.setAttribute("cy",String(f+d/2)),this._element.setAttribute("r",String(d/2))}}))}_basicSquare(u){const{size:d,x:m,y:f}=u;this._rotateFigure(Object.assign(Object.assign({},u),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect"),this._element.setAttribute("x",String(m)),this._element.setAttribute("y",String(f)),this._element.setAttribute("width",String(d)),this._element.setAttribute("height",String(d))}}))}_basicSideRounded(u){const{size:d,x:m,y:f}=u;this._rotateFigure(Object.assign(Object.assign({},u),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${m} ${f}v ${d}h `+d/2+`a ${d/2} ${d/2}, 0, 0, 0, 0 ${-d}`)}}))}_basicCornerRounded(u){const{size:d,x:m,y:f}=u;this._rotateFigure(Object.assign(Object.assign({},u),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${m} ${f}v ${d}h ${d}v `+-d/2+`a ${d/2} ${d/2}, 0, 0, 0, ${-d/2} ${-d/2}`)}}))}_basicCornerExtraRounded(u){const{size:d,x:m,y:f}=u;this._rotateFigure(Object.assign(Object.assign({},u),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${m} ${f}v ${d}h ${d}a ${d} ${d}, 0, 0, 0, ${-d} ${-d}`)}}))}_basicCornersRounded(u){const{size:d,x:m,y:f}=u;this._rotateFigure(Object.assign(Object.assign({},u),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${m} ${f}v `+d/2+`a ${d/2} ${d/2}, 0, 0, 0, ${d/2} ${d/2}h `+d/2+"v "+-d/2+`a ${d/2} ${d/2}, 0, 0, 0, ${-d/2} ${-d/2}`)}}))}_drawDot({x:u,y:d,size:m}){this._basicDot({x:u,y:d,size:m,rotation:0})}_drawSquare({x:u,y:d,size:m}){this._basicSquare({x:u,y:d,size:m,rotation:0})}_drawRounded({x:u,y:d,size:m,getNeighbor:f}){const i=f?+f(-1,0):0,v=f?+f(1,0):0,E=f?+f(0,-1):0,j=f?+f(0,1):0,G=i+v+E+j;if(G!==0)if(G>2||i&&v||E&&j)this._basicSquare({x:u,y:d,size:m,rotation:0});else{if(G===2){let X=0;return i&&E?X=Math.PI/2:E&&v?X=Math.PI:v&&j&&(X=-Math.PI/2),void this._basicCornerRounded({x:u,y:d,size:m,rotation:X})}if(G===1){let X=0;return E?X=Math.PI/2:v?X=Math.PI:j&&(X=-Math.PI/2),void this._basicSideRounded({x:u,y:d,size:m,rotation:X})}}else this._basicDot({x:u,y:d,size:m,rotation:0})}_drawExtraRounded({x:u,y:d,size:m,getNeighbor:f}){const i=f?+f(-1,0):0,v=f?+f(1,0):0,E=f?+f(0,-1):0,j=f?+f(0,1):0,G=i+v+E+j;if(G!==0)if(G>2||i&&v||E&&j)this._basicSquare({x:u,y:d,size:m,rotation:0});else{if(G===2){let X=0;return i&&E?X=Math.PI/2:E&&v?X=Math.PI:v&&j&&(X=-Math.PI/2),void this._basicCornerExtraRounded({x:u,y:d,size:m,rotation:X})}if(G===1){let X=0;return E?X=Math.PI/2:v?X=Math.PI:j&&(X=-Math.PI/2),void this._basicSideRounded({x:u,y:d,size:m,rotation:X})}}else this._basicDot({x:u,y:d,size:m,rotation:0})}_drawClassy({x:u,y:d,size:m,getNeighbor:f}){const i=f?+f(-1,0):0,v=f?+f(1,0):0,E=f?+f(0,-1):0,j=f?+f(0,1):0;i+v+E+j!==0?i||E?v||j?this._basicSquare({x:u,y:d,size:m,rotation:0}):this._basicCornerRounded({x:u,y:d,size:m,rotation:Math.PI/2}):this._basicCornerRounded({x:u,y:d,size:m,rotation:-Math.PI/2}):this._basicCornersRounded({x:u,y:d,size:m,rotation:Math.PI/2})}_drawClassyRounded({x:u,y:d,size:m,getNeighbor:f}){const i=f?+f(-1,0):0,v=f?+f(1,0):0,E=f?+f(0,-1):0,j=f?+f(0,1):0;i+v+E+j!==0?i||E?v||j?this._basicSquare({x:u,y:d,size:m,rotation:0}):this._basicCornerExtraRounded({x:u,y:d,size:m,rotation:Math.PI/2}):this._basicCornerExtraRounded({x:u,y:d,size:m,rotation:-Math.PI/2}):this._basicCornersRounded({x:u,y:d,size:m,rotation:Math.PI/2})}}const P={dot:"dot",square:"square",extraRounded:"extra-rounded"},S=Object.values(P);class x{constructor({svg:u,type:d,window:m}){this._svg=u,this._type=d,this._window=m}draw(u,d,m,f){let i;switch(this._type){case P.square:i=this._drawSquare;break;case P.extraRounded:i=this._drawExtraRounded;break;default:i=this._drawDot}i.call(this,{x:u,y:d,size:m,rotation:f})}_rotateFigure({x:u,y:d,size:m,rotation:f=0,draw:i}){var v;const E=u+m/2,j=d+m/2;i(),(v=this._element)===null||v===void 0||v.setAttribute("transform",`rotate(${180*f/Math.PI},${E},${j})`)}_basicDot(u){const{size:d,x:m,y:f}=u,i=d/7;this._rotateFigure(Object.assign(Object.assign({},u),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("clip-rule","evenodd"),this._element.setAttribute("d",`M ${m+d/2} ${f}a ${d/2} ${d/2} 0 1 0 0.1 0zm 0 ${i}a ${d/2-i} ${d/2-i} 0 1 1 -0.1 0Z`)}}))}_basicSquare(u){const{size:d,x:m,y:f}=u,i=d/7;this._rotateFigure(Object.assign(Object.assign({},u),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("clip-rule","evenodd"),this._element.setAttribute("d",`M ${m} ${f}v ${d}h ${d}v `+-d+`zM ${m+i} ${f+i}h `+(d-2*i)+"v "+(d-2*i)+"h "+(2*i-d)+"z")}}))}_basicExtraRounded(u){const{size:d,x:m,y:f}=u,i=d/7;this._rotateFigure(Object.assign(Object.assign({},u),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("clip-rule","evenodd"),this._element.setAttribute("d",`M ${m} ${f+2.5*i}v `+2*i+`a ${2.5*i} ${2.5*i}, 0, 0, 0, ${2.5*i} ${2.5*i}h `+2*i+`a ${2.5*i} ${2.5*i}, 0, 0, 0, ${2.5*i} ${2.5*-i}v `+-2*i+`a ${2.5*i} ${2.5*i}, 0, 0, 0, ${2.5*-i} ${2.5*-i}h `+-2*i+`a ${2.5*i} ${2.5*i}, 0, 0, 0, ${2.5*-i} ${2.5*i}M ${m+2.5*i} ${f+i}h `+2*i+`a ${1.5*i} ${1.5*i}, 0, 0, 1, ${1.5*i} ${1.5*i}v `+2*i+`a ${1.5*i} ${1.5*i}, 0, 0, 1, ${1.5*-i} ${1.5*i}h `+-2*i+`a ${1.5*i} ${1.5*i}, 0, 0, 1, ${1.5*-i} ${1.5*-i}v `+-2*i+`a ${1.5*i} ${1.5*i}, 0, 0, 1, ${1.5*i} ${1.5*-i}`)}}))}_drawDot({x:u,y:d,size:m,rotation:f}){this._basicDot({x:u,y:d,size:m,rotation:f})}_drawSquare({x:u,y:d,size:m,rotation:f}){this._basicSquare({x:u,y:d,size:m,rotation:f})}_drawExtraRounded({x:u,y:d,size:m,rotation:f}){this._basicExtraRounded({x:u,y:d,size:m,rotation:f})}}const k={dot:"dot",square:"square"},O=Object.values(k);class N{constructor({svg:u,type:d,window:m}){this._svg=u,this._type=d,this._window=m}draw(u,d,m,f){let i;i=this._type===k.square?this._drawSquare:this._drawDot,i.call(this,{x:u,y:d,size:m,rotation:f})}_rotateFigure({x:u,y:d,size:m,rotation:f=0,draw:i}){var v;const E=u+m/2,j=d+m/2;i(),(v=this._element)===null||v===void 0||v.setAttribute("transform",`rotate(${180*f/Math.PI},${E},${j})`)}_basicDot(u){const{size:d,x:m,y:f}=u;this._rotateFigure(Object.assign(Object.assign({},u),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","circle"),this._element.setAttribute("cx",String(m+d/2)),this._element.setAttribute("cy",String(f+d/2)),this._element.setAttribute("r",String(d/2))}}))}_basicSquare(u){const{size:d,x:m,y:f}=u;this._rotateFigure(Object.assign(Object.assign({},u),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect"),this._element.setAttribute("x",String(m)),this._element.setAttribute("y",String(f)),this._element.setAttribute("width",String(d)),this._element.setAttribute("height",String(d))}}))}_drawDot({x:u,y:d,size:m,rotation:f}){this._basicDot({x:u,y:d,size:m,rotation:f})}_drawSquare({x:u,y:d,size:m,rotation:f}){this._basicSquare({x:u,y:d,size:m,rotation:f})}}const F="circle",B=[[1,1,1,1,1,1,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,1,1,1,1,1,1]],Z=[[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,1,1,1,0,0],[0,0,1,1,1,0,0],[0,0,1,1,1,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]];class U{constructor(u,d){this._roundSize=m=>this._options.dotsOptions.roundSize?Math.floor(m):m,this._window=d,this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("width",String(u.width)),this._element.setAttribute("height",String(u.height)),this._element.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),u.dotsOptions.roundSize||this._element.setAttribute("shape-rendering","crispEdges"),this._element.setAttribute("viewBox",`0 0 ${u.width} ${u.height}`),this._defs=this._window.document.createElementNS("http://www.w3.org/2000/svg","defs"),this._element.appendChild(this._defs),this._imageUri=u.image,this._instanceId=U.instanceCount++,this._options=u}get width(){return this._options.width}get height(){return this._options.height}getElement(){return this._element}async drawQR(u){const d=u.getModuleCount(),m=Math.min(this._options.width,this._options.height)-2*this._options.margin,f=this._options.shape===F?m/Math.sqrt(2):m,i=this._roundSize(f/d);let v={hideXDots:0,hideYDots:0,width:0,height:0};if(this._qr=u,this._options.image){if(await this.loadImage(),!this._image)return;const{imageOptions:E,qrOptions:j}=this._options,G=E.imageSize*y[j.errorCorrectionLevel],X=Math.floor(G*d*d);v=(function({originalHeight:te,originalWidth:V,maxHiddenDots:se,maxHiddenAxisDots:ie,dotSize:ue}){const A={x:0,y:0},L={x:0,y:0};if(te<=0||V<=0||se<=0||ue<=0)return{height:0,width:0,hideYDots:0,hideXDots:0};const $=te/V;return A.x=Math.floor(Math.sqrt(se/$)),A.x<=0&&(A.x=1),ie&&ie<A.x&&(A.x=ie),A.x%2==0&&A.x--,L.x=A.x*ue,A.y=1+2*Math.ceil((A.x*$-1)/2),L.y=Math.round(L.x*$),(A.y*A.x>se||ie&&ie<A.y)&&(ie&&ie<A.y?(A.y=ie,A.y%2==0&&A.x--):A.y-=2,L.y=A.y*ue,A.x=1+2*Math.ceil((A.y/$-1)/2),L.x=Math.round(L.y/$)),{height:L.y,width:L.x,hideYDots:A.y,hideXDots:A.x}})({originalWidth:this._image.width,originalHeight:this._image.height,maxHiddenDots:X,maxHiddenAxisDots:d-14,dotSize:i})}this.drawBackground(),this.drawDots((E,j)=>{var G,X,te,V,se,ie;return!(this._options.imageOptions.hideBackgroundDots&&E>=(d-v.hideYDots)/2&&E<(d+v.hideYDots)/2&&j>=(d-v.hideXDots)/2&&j<(d+v.hideXDots)/2||!((G=B[E])===null||G===void 0)&&G[j]||!((X=B[E-d+7])===null||X===void 0)&&X[j]||!((te=B[E])===null||te===void 0)&&te[j-d+7]||!((V=Z[E])===null||V===void 0)&&V[j]||!((se=Z[E-d+7])===null||se===void 0)&&se[j]||!((ie=Z[E])===null||ie===void 0)&&ie[j-d+7])}),this.drawCorners(),this._options.image&&await this.drawImage({width:v.width,height:v.height,count:d,dotSize:i})}drawBackground(){var u,d,m;const f=this._element,i=this._options;if(f){const v=(u=i.backgroundOptions)===null||u===void 0?void 0:u.gradient,E=(d=i.backgroundOptions)===null||d===void 0?void 0:d.color;let j=i.height,G=i.width;if(v||E){const X=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect");this._backgroundClipPath=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),this._backgroundClipPath.setAttribute("id",`clip-path-background-color-${this._instanceId}`),this._defs.appendChild(this._backgroundClipPath),!((m=i.backgroundOptions)===null||m===void 0)&&m.round&&(j=G=Math.min(i.width,i.height),X.setAttribute("rx",String(j/2*i.backgroundOptions.round))),X.setAttribute("x",String(this._roundSize((i.width-G)/2))),X.setAttribute("y",String(this._roundSize((i.height-j)/2))),X.setAttribute("width",String(G)),X.setAttribute("height",String(j)),this._backgroundClipPath.appendChild(X),this._createColor({options:v,color:E,additionalRotation:0,x:0,y:0,height:i.height,width:i.width,name:`background-color-${this._instanceId}`})}}}drawDots(u){var d,m;if(!this._qr)throw"QR code is not defined";const f=this._options,i=this._qr.getModuleCount();if(i>f.width||i>f.height)throw"The canvas is too small.";const v=Math.min(f.width,f.height)-2*f.margin,E=f.shape===F?v/Math.sqrt(2):v,j=this._roundSize(E/i),G=this._roundSize((f.width-i*j)/2),X=this._roundSize((f.height-i*j)/2),te=new _({svg:this._element,type:f.dotsOptions.type,window:this._window});this._dotsClipPath=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),this._dotsClipPath.setAttribute("id",`clip-path-dot-color-${this._instanceId}`),this._defs.appendChild(this._dotsClipPath),this._createColor({options:(d=f.dotsOptions)===null||d===void 0?void 0:d.gradient,color:f.dotsOptions.color,additionalRotation:0,x:0,y:0,height:f.height,width:f.width,name:`dot-color-${this._instanceId}`});for(let V=0;V<i;V++)for(let se=0;se<i;se++)u&&!u(V,se)||!((m=this._qr)===null||m===void 0)&&m.isDark(V,se)&&(te.draw(G+se*j,X+V*j,j,(ie,ue)=>!(se+ie<0||V+ue<0||se+ie>=i||V+ue>=i)&&!(u&&!u(V+ue,se+ie))&&!!this._qr&&this._qr.isDark(V+ue,se+ie)),te._element&&this._dotsClipPath&&this._dotsClipPath.appendChild(te._element));if(f.shape===F){const V=this._roundSize((v/j-i)/2),se=i+2*V,ie=G-V*j,ue=X-V*j,A=[],L=this._roundSize(se/2);for(let $=0;$<se;$++){A[$]=[];for(let Y=0;Y<se;Y++)$>=V-1&&$<=se-V&&Y>=V-1&&Y<=se-V||Math.sqrt(($-L)*($-L)+(Y-L)*(Y-L))>L?A[$][Y]=0:A[$][Y]=this._qr.isDark(Y-2*V<0?Y:Y>=i?Y-2*V:Y-V,$-2*V<0?$:$>=i?$-2*V:$-V)?1:0}for(let $=0;$<se;$++)for(let Y=0;Y<se;Y++)A[$][Y]&&(te.draw(ie+Y*j,ue+$*j,j,(I,de)=>{var o;return!!(!((o=A[$+de])===null||o===void 0)&&o[Y+I])}),te._element&&this._dotsClipPath&&this._dotsClipPath.appendChild(te._element))}}drawCorners(){if(!this._qr)throw"QR code is not defined";const u=this._element,d=this._options;if(!u)throw"Element code is not defined";const m=this._qr.getModuleCount(),f=Math.min(d.width,d.height)-2*d.margin,i=d.shape===F?f/Math.sqrt(2):f,v=this._roundSize(i/m),E=7*v,j=3*v,G=this._roundSize((d.width-m*v)/2),X=this._roundSize((d.height-m*v)/2);[[0,0,0],[1,0,Math.PI/2],[0,1,-Math.PI/2]].forEach(([te,V,se])=>{var ie,ue,A,L,$,Y,I,de,o,l,p,M,R,z;const le=G+te*v*(m-7),ce=X+V*v*(m-7);let fe=this._dotsClipPath,ne=this._dotsClipPath;if((!((ie=d.cornersSquareOptions)===null||ie===void 0)&&ie.gradient||!((ue=d.cornersSquareOptions)===null||ue===void 0)&&ue.color)&&(fe=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),fe.setAttribute("id",`clip-path-corners-square-color-${te}-${V}-${this._instanceId}`),this._defs.appendChild(fe),this._cornersSquareClipPath=this._cornersDotClipPath=ne=fe,this._createColor({options:(A=d.cornersSquareOptions)===null||A===void 0?void 0:A.gradient,color:(L=d.cornersSquareOptions)===null||L===void 0?void 0:L.color,additionalRotation:se,x:le,y:ce,height:E,width:E,name:`corners-square-color-${te}-${V}-${this._instanceId}`})),(($=d.cornersSquareOptions)===null||$===void 0?void 0:$.type)&&S.includes(d.cornersSquareOptions.type)){const pe=new x({svg:this._element,type:d.cornersSquareOptions.type,window:this._window});pe.draw(le,ce,E,se),pe._element&&fe&&fe.appendChild(pe._element)}else{const pe=new _({svg:this._element,type:((Y=d.cornersSquareOptions)===null||Y===void 0?void 0:Y.type)||d.dotsOptions.type,window:this._window});for(let me=0;me<B.length;me++)for(let ge=0;ge<B[me].length;ge++)!((I=B[me])===null||I===void 0)&&I[ge]&&(pe.draw(le+ge*v,ce+me*v,v,(xe,Ce)=>{var ke;return!!(!((ke=B[me+Ce])===null||ke===void 0)&&ke[ge+xe])}),pe._element&&fe&&fe.appendChild(pe._element))}if((!((de=d.cornersDotOptions)===null||de===void 0)&&de.gradient||!((o=d.cornersDotOptions)===null||o===void 0)&&o.color)&&(ne=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),ne.setAttribute("id",`clip-path-corners-dot-color-${te}-${V}-${this._instanceId}`),this._defs.appendChild(ne),this._cornersDotClipPath=ne,this._createColor({options:(l=d.cornersDotOptions)===null||l===void 0?void 0:l.gradient,color:(p=d.cornersDotOptions)===null||p===void 0?void 0:p.color,additionalRotation:se,x:le+2*v,y:ce+2*v,height:j,width:j,name:`corners-dot-color-${te}-${V}-${this._instanceId}`})),((M=d.cornersDotOptions)===null||M===void 0?void 0:M.type)&&O.includes(d.cornersDotOptions.type)){const pe=new N({svg:this._element,type:d.cornersDotOptions.type,window:this._window});pe.draw(le+2*v,ce+2*v,j,se),pe._element&&ne&&ne.appendChild(pe._element)}else{const pe=new _({svg:this._element,type:((R=d.cornersDotOptions)===null||R===void 0?void 0:R.type)||d.dotsOptions.type,window:this._window});for(let me=0;me<Z.length;me++)for(let ge=0;ge<Z[me].length;ge++)!((z=Z[me])===null||z===void 0)&&z[ge]&&(pe.draw(le+ge*v,ce+me*v,v,(xe,Ce)=>{var ke;return!!(!((ke=Z[me+Ce])===null||ke===void 0)&&ke[ge+xe])}),pe._element&&ne&&ne.appendChild(pe._element))}})}loadImage(){return new Promise((u,d)=>{var m;const f=this._options;if(!f.image)return d("Image is not defined");if(!((m=f.nodeCanvas)===null||m===void 0)&&m.loadImage)f.nodeCanvas.loadImage(f.image).then(i=>{var v,E;if(this._image=i,this._options.imageOptions.saveAsBlob){const j=(v=f.nodeCanvas)===null||v===void 0?void 0:v.createCanvas(this._image.width,this._image.height);(E=j?.getContext("2d"))===null||E===void 0||E.drawImage(i,0,0),this._imageUri=j?.toDataURL()}u()}).catch(d);else{const i=new this._window.Image;typeof f.imageOptions.crossOrigin=="string"&&(i.crossOrigin=f.imageOptions.crossOrigin),this._image=i,i.onload=async()=>{this._options.imageOptions.saveAsBlob&&(this._imageUri=await(async function(v,E){return new Promise(j=>{const G=new E.XMLHttpRequest;G.onload=function(){const X=new E.FileReader;X.onloadend=function(){j(X.result)},X.readAsDataURL(G.response)},G.open("GET",v),G.responseType="blob",G.send()})})(f.image||"",this._window)),u()},i.src=f.image}})}async drawImage({width:u,height:d,count:m,dotSize:f}){const i=this._options,v=this._roundSize((i.width-m*f)/2),E=this._roundSize((i.height-m*f)/2),j=v+this._roundSize(i.imageOptions.margin+(m*f-u)/2),G=E+this._roundSize(i.imageOptions.margin+(m*f-d)/2),X=u-2*i.imageOptions.margin,te=d-2*i.imageOptions.margin,V=this._window.document.createElementNS("http://www.w3.org/2000/svg","image");V.setAttribute("href",this._imageUri||""),V.setAttribute("xlink:href",this._imageUri||""),V.setAttribute("x",String(j)),V.setAttribute("y",String(G)),V.setAttribute("width",`${X}px`),V.setAttribute("height",`${te}px`),this._element.appendChild(V)}_createColor({options:u,color:d,additionalRotation:m,x:f,y:i,height:v,width:E,name:j}){const G=E>v?E:v,X=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect");if(X.setAttribute("x",String(f)),X.setAttribute("y",String(i)),X.setAttribute("height",String(v)),X.setAttribute("width",String(E)),X.setAttribute("clip-path",`url('#clip-path-${j}')`),u){let te;if(u.type==="radial")te=this._window.document.createElementNS("http://www.w3.org/2000/svg","radialGradient"),te.setAttribute("id",j),te.setAttribute("gradientUnits","userSpaceOnUse"),te.setAttribute("fx",String(f+E/2)),te.setAttribute("fy",String(i+v/2)),te.setAttribute("cx",String(f+E/2)),te.setAttribute("cy",String(i+v/2)),te.setAttribute("r",String(G/2));else{const V=((u.rotation||0)+m)%(2*Math.PI),se=(V+2*Math.PI)%(2*Math.PI);let ie=f+E/2,ue=i+v/2,A=f+E/2,L=i+v/2;se>=0&&se<=.25*Math.PI||se>1.75*Math.PI&&se<=2*Math.PI?(ie-=E/2,ue-=v/2*Math.tan(V),A+=E/2,L+=v/2*Math.tan(V)):se>.25*Math.PI&&se<=.75*Math.PI?(ue-=v/2,ie-=E/2/Math.tan(V),L+=v/2,A+=E/2/Math.tan(V)):se>.75*Math.PI&&se<=1.25*Math.PI?(ie+=E/2,ue+=v/2*Math.tan(V),A-=E/2,L-=v/2*Math.tan(V)):se>1.25*Math.PI&&se<=1.75*Math.PI&&(ue+=v/2,ie+=E/2/Math.tan(V),L-=v/2,A-=E/2/Math.tan(V)),te=this._window.document.createElementNS("http://www.w3.org/2000/svg","linearGradient"),te.setAttribute("id",j),te.setAttribute("gradientUnits","userSpaceOnUse"),te.setAttribute("x1",String(Math.round(ie))),te.setAttribute("y1",String(Math.round(ue))),te.setAttribute("x2",String(Math.round(A))),te.setAttribute("y2",String(Math.round(L)))}u.colorStops.forEach(({offset:V,color:se})=>{const ie=this._window.document.createElementNS("http://www.w3.org/2000/svg","stop");ie.setAttribute("offset",100*V+"%"),ie.setAttribute("stop-color",se),te.appendChild(ie)}),X.setAttribute("fill",`url('#${j}')`),this._defs.appendChild(te)}else d&&X.setAttribute("fill",d);this._element.appendChild(X)}}U.instanceCount=0;const ee=U,re="canvas",K={};for(let b=0;b<=40;b++)K[b]=b;const J={type:re,shape:"square",width:300,height:300,data:"",margin:0,qrOptions:{typeNumber:K[0],mode:void 0,errorCorrectionLevel:"Q"},imageOptions:{saveAsBlob:!0,hideBackgroundDots:!0,imageSize:.4,crossOrigin:void 0,margin:0},dotsOptions:{type:"square",color:"#000",roundSize:!0},backgroundOptions:{round:0,color:"#fff"}};function q(b){const u=Object.assign({},b);if(!u.colorStops||!u.colorStops.length)throw"Field 'colorStops' is required in gradient";return u.rotation?u.rotation=Number(u.rotation):u.rotation=0,u.colorStops=u.colorStops.map(d=>Object.assign(Object.assign({},d),{offset:Number(d.offset)})),u}function H(b){const u=Object.assign({},b);return u.width=Number(u.width),u.height=Number(u.height),u.margin=Number(u.margin),u.imageOptions=Object.assign(Object.assign({},u.imageOptions),{hideBackgroundDots:!!u.imageOptions.hideBackgroundDots,imageSize:Number(u.imageOptions.imageSize),margin:Number(u.imageOptions.margin)}),u.margin>Math.min(u.width,u.height)&&(u.margin=Math.min(u.width,u.height)),u.dotsOptions=Object.assign({},u.dotsOptions),u.dotsOptions.gradient&&(u.dotsOptions.gradient=q(u.dotsOptions.gradient)),u.cornersSquareOptions&&(u.cornersSquareOptions=Object.assign({},u.cornersSquareOptions),u.cornersSquareOptions.gradient&&(u.cornersSquareOptions.gradient=q(u.cornersSquareOptions.gradient))),u.cornersDotOptions&&(u.cornersDotOptions=Object.assign({},u.cornersDotOptions),u.cornersDotOptions.gradient&&(u.cornersDotOptions.gradient=q(u.cornersDotOptions.gradient))),u.backgroundOptions&&(u.backgroundOptions=Object.assign({},u.backgroundOptions),u.backgroundOptions.gradient&&(u.backgroundOptions.gradient=q(u.backgroundOptions.gradient))),u}var W=s(873),ae=s.n(W);function oe(b){if(!b)throw new Error("Extension must be defined");b[0]==="."&&(b=b.substring(1));const u={bmp:"image/bmp",gif:"image/gif",ico:"image/vnd.microsoft.icon",jpeg:"image/jpeg",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml",tif:"image/tiff",tiff:"image/tiff",webp:"image/webp",pdf:"application/pdf"}[b.toLowerCase()];if(!u)throw new Error(`Extension "${b}" is not supported`);return u}class D{constructor(u){u!=null&&u.jsdom?this._window=new u.jsdom("",{resources:"usable"}).window:this._window=window,this._options=u?H(a(J,u)):J,this.update()}static _clearContainer(u){u&&(u.innerHTML="")}_setupSvg(){if(!this._qr)return;const u=new ee(this._options,this._window);this._svg=u.getElement(),this._svgDrawingPromise=u.drawQR(this._qr).then(()=>{var d;this._svg&&((d=this._extension)===null||d===void 0||d.call(this,u.getElement(),this._options))})}_setupCanvas(){var u,d;this._qr&&(!((u=this._options.nodeCanvas)===null||u===void 0)&&u.createCanvas?(this._nodeCanvas=this._options.nodeCanvas.createCanvas(this._options.width,this._options.height),this._nodeCanvas.width=this._options.width,this._nodeCanvas.height=this._options.height):(this._domCanvas=document.createElement("canvas"),this._domCanvas.width=this._options.width,this._domCanvas.height=this._options.height),this._setupSvg(),this._canvasDrawingPromise=(d=this._svgDrawingPromise)===null||d===void 0?void 0:d.then(()=>{var m;if(!this._svg)return;const f=this._svg,i=new this._window.XMLSerializer().serializeToString(f),v=btoa(i),E=`data:${oe("svg")};base64,${v}`;if(!((m=this._options.nodeCanvas)===null||m===void 0)&&m.loadImage)return this._options.nodeCanvas.loadImage(E).then(j=>{var G,X;j.width=this._options.width,j.height=this._options.height,(X=(G=this._nodeCanvas)===null||G===void 0?void 0:G.getContext("2d"))===null||X===void 0||X.drawImage(j,0,0)});{const j=new this._window.Image;return new Promise(G=>{j.onload=()=>{var X,te;(te=(X=this._domCanvas)===null||X===void 0?void 0:X.getContext("2d"))===null||te===void 0||te.drawImage(j,0,0),G()},j.src=E})}}))}async _getElement(u="png"){if(!this._qr)throw"QR code is empty";return u.toLowerCase()==="svg"?(this._svg&&this._svgDrawingPromise||this._setupSvg(),await this._svgDrawingPromise,this._svg):((this._domCanvas||this._nodeCanvas)&&this._canvasDrawingPromise||this._setupCanvas(),await this._canvasDrawingPromise,this._domCanvas||this._nodeCanvas)}update(u){D._clearContainer(this._container),this._options=u?H(a(this._options,u)):this._options,this._options.data&&(this._qr=ae()(this._options.qrOptions.typeNumber,this._options.qrOptions.errorCorrectionLevel),this._qr.addData(this._options.data,this._options.qrOptions.mode||(function(d){switch(!0){case/^[0-9]*$/.test(d):return"Numeric";case/^[0-9A-Z $%*+\-./:]*$/.test(d):return"Alphanumeric";default:return"Byte"}})(this._options.data)),this._qr.make(),this._options.type===re?this._setupCanvas():this._setupSvg(),this.append(this._container))}append(u){if(u){if(typeof u.appendChild!="function")throw"Container should be a single DOM node";this._options.type===re?this._domCanvas&&u.appendChild(this._domCanvas):this._svg&&u.appendChild(this._svg),this._container=u}}applyExtension(u){if(!u)throw"Extension function should be defined.";this._extension=u,this.update()}deleteExtension(){this._extension=void 0,this.update()}async getRawData(u="png"){if(!this._qr)throw"QR code is empty";const d=await this._getElement(u),m=oe(u);if(!d)return null;if(u.toLowerCase()==="svg"){const f=`<?xml version="1.0" standalone="no"?>\r
|
|
22
|
-
${new this._window.XMLSerializer().serializeToString(
|
|
23
|
-
`+i,g(`data:${oe(d)};charset=utf-8,${encodeURIComponent(i)}`,`${m}.svg`)}else g(f.toDataURL(oe(d)),`${m}.${d}`)}}const C=D})(),c.default})())})(nn)),nn.exports}fl();const Lo=Q.createContext(void 0);function pl(t){const e=Qe.c(9),{children:r,baseUrl:n,queryClient:s}=t;let c;e[0]!==n||e[1]!==s?(c={baseUrl:n,queryClient:s},e[0]=n,e[1]=s,e[2]=c):c=e[2];let h;e[3]!==r||e[4]!==s?(h=w.jsx(Gn,{client:s,children:r}),e[3]=r,e[4]=s,e[5]=h):h=e[5];let a;return e[6]!==c||e[7]!==h?(a=w.jsx(Lo.Provider,{value:c,children:h}),e[6]=c,e[7]=h,e[8]=a):a=e[8],a}function pt(){const t=Q.useContext(Lo);if(!t)throw new Error("useDataTable must be used within a DataTableProvider");return t}function on(t){if(typeof t=="string")try{const e=JSON.parse(t);return{message:e.message||t,code:e.code,details:e.details}}catch{return{message:t}}return t instanceof Error?{message:t.message}:{message:"Unbekannter Fehler"}}async function Mt(t){const e=await t.text();if(!e)throw new Error(`HTTP ${t.status}: ${t.statusText}`);let r=null;try{r=JSON.parse(e)}catch{throw new Error(e)}throw r?.message?new Error(r.message):r?.error?new Error(r.error):new Error(e)}function gl(){const t=localStorage.getItem("a360.assumed-org");return t?{"X-Assume-Org":t}:{}}async function Ct(){return{"Content-Type":"application/json",Authorization:`Bearer ${await rl()??""}`,...gl()}}async function Bo(t){return fetch(t,{method:"GET",headers:await Ct()}).then(async e=>(e.status>=400&&await Mt(e),e)).then(e=>e.json()).then(e=>e)}async function Io(t,e){return fetch(`${t}/${e}`,{method:"GET",headers:await Ct()}).then(async r=>(r.status>=400&&await Mt(r),r)).then(r=>r.json()).then(r=>r)}async function Yo(t,e){const r=await fetch(`${t}/${e}`,{method:"DELETE",headers:await Ct()});r.status>=400&&await Mt(r)}async function zo(t,e){return fetch(t,{method:"POST",headers:await Ct(),body:JSON.stringify(e)}).then(async r=>(r.status>=400&&await Mt(r),r)).then(r=>r.status==204?e:r.json()).then(r=>r)}async function ml(t,e,r){return fetch(e,{method:t,headers:await Ct(),body:r?JSON.stringify(r):void 0}).then(async n=>(n.status>=400&&await Mt(n),n)).then(n=>{if(n.status!=204)return n.json()}).then(n=>n)}async function Fo(t,e){return fetch(`${t}/${e.id}`,{method:"PUT",headers:await Ct(),body:JSON.stringify(e)}).then(async r=>(r.status>=400&&await Mt(r),r)).then(r=>r.status==204?e:r.json()).then(r=>r)}function Wo(t,e,r){const n=Qe.c(13),{baseUrl:s}=pt();let c;if(n[0]!==r||n[1]!==e){let y;n[3]!==r?(y=r?.toString(),n[3]=r,n[4]=y):y=n[4],c=[...e.map(yl),String(y)],n[0]=r,n[1]=e,n[2]=c}else c=n[2];let h;n[5]!==t||n[6]!==s||n[7]!==r?(h=()=>Io(`${s}${t}`,r),n[5]=t,n[6]=s,n[7]=r,n[8]=h):h=n[8];const a=!!r;let g;return n[9]!==c||n[10]!==h||n[11]!==a?(g={queryKey:c,queryFn:h,enabled:a},n[9]=c,n[10]=h,n[11]=a,n[12]=g):g=n[12],Kn(g)}function yl(t){return t.toString()}function Uo(t,e,r){const n=Qe.c(9),s=r===void 0?!0:r,{baseUrl:c}=pt();let h;n[0]!==e?(h=[...e.map(vl)],n[0]=e,n[1]=h):h=n[1];let a;n[2]!==t||n[3]!==c?(a=()=>Bo(`${c}${t}`),n[2]=t,n[3]=c,n[4]=a):a=n[4];let g;return n[5]!==s||n[6]!==h||n[7]!==a?(g={queryKey:h,queryFn:a,enabled:s},n[5]=s,n[6]=h,n[7]=a,n[8]=g):g=n[8],Kn(g)}function vl(t){return t.toString()}function qo(t,e){const r=Qe.c(10),{baseUrl:n,queryClient:s}=pt();let c;r[0]!==e?(c=[...e.map(wl)],r[0]=e,r[1]=c):c=r[1];let h;r[2]!==t||r[3]!==n?(h=g=>zo(`${n}${t}`,g),r[2]=t,r[3]=n,r[4]=h):h=r[4];let a;return r[5]!==s||r[6]!==e||r[7]!==c||r[8]!==h?(a={mutationKey:c,mutationFn:h,onSettled(){return s.invalidateQueries({queryKey:[...e.map(bl)]})},onError(g){on(g)}},r[5]=s,r[6]=e,r[7]=c,r[8]=h,r[9]=a):a=r[9],Br(a)}function bl(t){return t.toString()}function wl(t){return t.toString()}function sn(t,e){const r=Qe.c(10),{baseUrl:n,queryClient:s}=pt();let c;r[0]!==e?(c=[...e.map(Cl)],r[0]=e,r[1]=c):c=r[1];let h;r[2]!==t||r[3]!==n?(h=g=>Fo(`${n}${t}`,g),r[2]=t,r[3]=n,r[4]=h):h=r[4];let a;return r[5]!==s||r[6]!==e||r[7]!==c||r[8]!==h?(a={mutationKey:c,mutationFn:h,onSettled(){return s.invalidateQueries({queryKey:[...e.map(_l)]})},onError(g){on(g)}},r[5]=s,r[6]=e,r[7]=c,r[8]=h,r[9]=a):a=r[9],Br(a)}function _l(t){return t.toString()}function Cl(t){return t.toString()}function Vo(t,e){const r=Qe.c(10),{baseUrl:n,queryClient:s}=pt();let c;r[0]!==e?(c=[...e.map(Sl)],r[0]=e,r[1]=c):c=r[1];let h;r[2]!==t||r[3]!==n?(h=g=>Yo(`${n}${t}`,g),r[2]=t,r[3]=n,r[4]=h):h=r[4];let a;return r[5]!==s||r[6]!==e||r[7]!==c||r[8]!==h?(a={mutationKey:c,mutationFn:h,onSettled(){return s.invalidateQueries({queryKey:[...e.map(xl)]})},onError(g){on(g)}},r[5]=s,r[6]=e,r[7]=c,r[8]=h,r[9]=a):a=r[9],Br(a)}function xl(t){return t.toString()}function Sl(t){return t.toString()}var ur={exports:{}},Dl=ur.exports,Ho;function kl(){return Ho||(Ho=1,(function(t,e){(function(r,n){t.exports=n()})(Dl,(function(){var r=1e3,n=6e4,s=36e5,c="millisecond",h="second",a="minute",g="hour",y="day",_="week",P="month",S="quarter",x="year",k="date",O="Invalid Date",N=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,F=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,B={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(D){var C=["th","st","nd","rd"],b=D%100;return"["+D+(C[(b-20)%10]||C[b]||C[0])+"]"}},Z=function(D,C,b){var u=String(D);return!u||u.length>=C?D:""+Array(C+1-u.length).join(b)+D},U={s:Z,z:function(D){var C=-D.utcOffset(),b=Math.abs(C),u=Math.floor(b/60),d=b%60;return(C<=0?"+":"-")+Z(u,2,"0")+":"+Z(d,2,"0")},m:function D(C,b){if(C.date()<b.date())return-D(b,C);var u=12*(b.year()-C.year())+(b.month()-C.month()),d=C.clone().add(u,P),m=b-d<0,f=C.clone().add(u+(m?-1:1),P);return+(-(u+(b-d)/(m?d-f:f-d))||0)},a:function(D){return D<0?Math.ceil(D)||0:Math.floor(D)},p:function(D){return{M:P,y:x,w:_,d:y,D:k,h:g,m:a,s:h,ms:c,Q:S}[D]||String(D||"").toLowerCase().replace(/s$/,"")},u:function(D){return D===void 0}},ee="en",re={};re[ee]=B;var K="$isDayjsObject",J=function(D){return D instanceof ae||!(!D||!D[K])},q=function D(C,b,u){var d;if(!C)return ee;if(typeof C=="string"){var m=C.toLowerCase();re[m]&&(d=m),b&&(re[m]=b,d=m);var f=C.split("-");if(!d&&f.length>1)return D(f[0])}else{var i=C.name;re[i]=C,d=i}return!u&&d&&(ee=d),d||!u&&ee},H=function(D,C){if(J(D))return D.clone();var b=typeof C=="object"?C:{};return b.date=D,b.args=arguments,new ae(b)},W=U;W.l=q,W.i=J,W.w=function(D,C){return H(D,{locale:C.$L,utc:C.$u,x:C.$x,$offset:C.$offset})};var ae=(function(){function D(b){this.$L=q(b.locale,null,!0),this.parse(b),this.$x=this.$x||b.x||{},this[K]=!0}var C=D.prototype;return C.parse=function(b){this.$d=(function(u){var d=u.date,m=u.utc;if(d===null)return new Date(NaN);if(W.u(d))return new Date;if(d instanceof Date)return new Date(d);if(typeof d=="string"&&!/Z$/i.test(d)){var f=d.match(N);if(f){var i=f[2]-1||0,v=(f[7]||"0").substring(0,3);return m?new Date(Date.UTC(f[1],i,f[3]||1,f[4]||0,f[5]||0,f[6]||0,v)):new Date(f[1],i,f[3]||1,f[4]||0,f[5]||0,f[6]||0,v)}}return new Date(d)})(b),this.init()},C.init=function(){var b=this.$d;this.$y=b.getFullYear(),this.$M=b.getMonth(),this.$D=b.getDate(),this.$W=b.getDay(),this.$H=b.getHours(),this.$m=b.getMinutes(),this.$s=b.getSeconds(),this.$ms=b.getMilliseconds()},C.$utils=function(){return W},C.isValid=function(){return this.$d.toString()!==O},C.isSame=function(b,u){var d=H(b);return this.startOf(u)<=d&&d<=this.endOf(u)},C.isAfter=function(b,u){return H(b)<this.startOf(u)},C.isBefore=function(b,u){return this.endOf(u)<H(b)},C.$g=function(b,u,d){return W.u(b)?this[u]:this.set(d,b)},C.unix=function(){return Math.floor(this.valueOf()/1e3)},C.valueOf=function(){return this.$d.getTime()},C.startOf=function(b,u){var d=this,m=!!W.u(u)||u,f=W.p(b),i=function(se,ie){var ue=W.w(d.$u?Date.UTC(d.$y,ie,se):new Date(d.$y,ie,se),d);return m?ue:ue.endOf(y)},v=function(se,ie){return W.w(d.toDate()[se].apply(d.toDate("s"),(m?[0,0,0,0]:[23,59,59,999]).slice(ie)),d)},E=this.$W,j=this.$M,G=this.$D,X="set"+(this.$u?"UTC":"");switch(f){case x:return m?i(1,0):i(31,11);case P:return m?i(1,j):i(0,j+1);case _:var te=this.$locale().weekStart||0,V=(E<te?E+7:E)-te;return i(m?G-V:G+(6-V),j);case y:case k:return v(X+"Hours",0);case g:return v(X+"Minutes",1);case a:return v(X+"Seconds",2);case h:return v(X+"Milliseconds",3);default:return this.clone()}},C.endOf=function(b){return this.startOf(b,!1)},C.$set=function(b,u){var d,m=W.p(b),f="set"+(this.$u?"UTC":""),i=(d={},d[y]=f+"Date",d[k]=f+"Date",d[P]=f+"Month",d[x]=f+"FullYear",d[g]=f+"Hours",d[a]=f+"Minutes",d[h]=f+"Seconds",d[c]=f+"Milliseconds",d)[m],v=m===y?this.$D+(u-this.$W):u;if(m===P||m===x){var E=this.clone().set(k,1);E.$d[i](v),E.init(),this.$d=E.set(k,Math.min(this.$D,E.daysInMonth())).$d}else i&&this.$d[i](v);return this.init(),this},C.set=function(b,u){return this.clone().$set(b,u)},C.get=function(b){return this[W.p(b)]()},C.add=function(b,u){var d,m=this;b=Number(b);var f=W.p(u),i=function(j){var G=H(m);return W.w(G.date(G.date()+Math.round(j*b)),m)};if(f===P)return this.set(P,this.$M+b);if(f===x)return this.set(x,this.$y+b);if(f===y)return i(1);if(f===_)return i(7);var v=(d={},d[a]=n,d[g]=s,d[h]=r,d)[f]||1,E=this.$d.getTime()+b*v;return W.w(E,this)},C.subtract=function(b,u){return this.add(-1*b,u)},C.format=function(b){var u=this,d=this.$locale();if(!this.isValid())return d.invalidDate||O;var m=b||"YYYY-MM-DDTHH:mm:ssZ",f=W.z(this),i=this.$H,v=this.$m,E=this.$M,j=d.weekdays,G=d.months,X=d.meridiem,te=function(ie,ue,A,L){return ie&&(ie[ue]||ie(u,m))||A[ue].slice(0,L)},V=function(ie){return W.s(i%12||12,ie,"0")},se=X||function(ie,ue,A){var L=ie<12?"AM":"PM";return A?L.toLowerCase():L};return m.replace(F,(function(ie,ue){return ue||(function(A){switch(A){case"YY":return String(u.$y).slice(-2);case"YYYY":return W.s(u.$y,4,"0");case"M":return E+1;case"MM":return W.s(E+1,2,"0");case"MMM":return te(d.monthsShort,E,G,3);case"MMMM":return te(G,E);case"D":return u.$D;case"DD":return W.s(u.$D,2,"0");case"d":return String(u.$W);case"dd":return te(d.weekdaysMin,u.$W,j,2);case"ddd":return te(d.weekdaysShort,u.$W,j,3);case"dddd":return j[u.$W];case"H":return String(i);case"HH":return W.s(i,2,"0");case"h":return V(1);case"hh":return V(2);case"a":return se(i,v,!0);case"A":return se(i,v,!1);case"m":return String(v);case"mm":return W.s(v,2,"0");case"s":return String(u.$s);case"ss":return W.s(u.$s,2,"0");case"SSS":return W.s(u.$ms,3,"0");case"Z":return f}return null})(ie)||f.replace(":","")}))},C.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},C.diff=function(b,u,d){var m,f=this,i=W.p(u),v=H(b),E=(v.utcOffset()-this.utcOffset())*n,j=this-v,G=function(){return W.m(f,v)};switch(i){case x:m=G()/12;break;case P:m=G();break;case S:m=G()/3;break;case _:m=(j-E)/6048e5;break;case y:m=(j-E)/864e5;break;case g:m=j/s;break;case a:m=j/n;break;case h:m=j/r;break;default:m=j}return d?m:W.a(m)},C.daysInMonth=function(){return this.endOf(P).$D},C.$locale=function(){return re[this.$L]},C.locale=function(b,u){if(!b)return this.$L;var d=this.clone(),m=q(b,u,!0);return m&&(d.$L=m),d},C.clone=function(){return W.w(this.$d,this)},C.toDate=function(){return new Date(this.valueOf())},C.toJSON=function(){return this.isValid()?this.toISOString():null},C.toISOString=function(){return this.$d.toISOString()},C.toString=function(){return this.$d.toUTCString()},D})(),oe=ae.prototype;return H.prototype=oe,[["$ms",c],["$s",h],["$m",a],["$H",g],["$W",y],["$M",P],["$y",x],["$D",k]].forEach((function(D){oe[D[1]]=function(C){return this.$g(C,D[0],D[1])}})),H.extend=function(D,C){return D.$i||(D(C,ae,H),D.$i=!0),H},H.locale=q,H.isDayjs=J,H.unix=function(D){return H(1e3*D)},H.en=re[ee],H.Ls=re,H.p={},H}))})(ur)),ur.exports}var Pl=kl();const he=An(Pl);function Ml({direction:t,levelIndex:e,rowIndex:r,cellIndex:n,size:s}){switch(t){case"up":return e===0&&r===0?null:r===0?{levelIndex:e-1,rowIndex:n<=s[e-1][s[e-1].length-1]-1?s[e-1].length-1:s[e-1].length-2,cellIndex:n}:{levelIndex:e,rowIndex:r-1,cellIndex:n};case"down":return r===s[e].length-1?{levelIndex:e+1,rowIndex:0,cellIndex:n}:r===s[e].length-2&&n>=s[e][s[e].length-1]?{levelIndex:e+1,rowIndex:0,cellIndex:n}:{levelIndex:e,rowIndex:r+1,cellIndex:n};case"left":return e===0&&r===0&&n===0?null:r===0&&n===0?{levelIndex:e-1,rowIndex:s[e-1].length-1,cellIndex:s[e-1][s[e-1].length-1]-1}:n===0?{levelIndex:e,rowIndex:r-1,cellIndex:s[e][r-1]-1}:{levelIndex:e,rowIndex:r,cellIndex:n-1};case"right":return r===s[e].length-1&&n===s[e][r]-1?{levelIndex:e+1,rowIndex:0,cellIndex:0}:n===s[e][r]-1?{levelIndex:e,rowIndex:r+1,cellIndex:0}:{levelIndex:e,rowIndex:r,cellIndex:n+1};default:return{levelIndex:e,rowIndex:r,cellIndex:n}}}function Go({controlsRef:t,direction:e,levelIndex:r,rowIndex:n,cellIndex:s,size:c}){const h=Ml({direction:e,size:c,rowIndex:n,cellIndex:s,levelIndex:r});if(!h)return;const a=t.current?.[h.levelIndex]?.[h.rowIndex]?.[h.cellIndex];a&&(a.disabled||a.getAttribute("data-hidden")||a.getAttribute("data-outside")?Go({controlsRef:t,direction:e,levelIndex:h.levelIndex,cellIndex:h.cellIndex,rowIndex:h.rowIndex,size:c}):a.focus())}function Ol(t){switch(t){case"ArrowDown":return"down";case"ArrowUp":return"up";case"ArrowRight":return"right";case"ArrowLeft":return"left";default:return null}}function Al(t){return t.current?.map(e=>e.map(r=>r.length))}function an({controlsRef:t,levelIndex:e,rowIndex:r,cellIndex:n,event:s}){const c=Ol(s.key);if(c){s.preventDefault();const h=Al(t);Go({controlsRef:t,direction:c,levelIndex:e,rowIndex:r,cellIndex:n,size:h})}}function Ue(t){return t==null||t===""?t:he(t).format("YYYY-MM-DD")}function Qo(t){return t==null||t===""?t:he(t).format("YYYY-MM-DD HH:mm:ss")}const El={locale:"en",firstDayOfWeek:1,weekendDays:[0,6],labelSeparator:"–",consistentWeeks:!1},Tl=Q.createContext(El);function gt(){const t=Q.useContext(Tl),e=Q.useCallback(c=>c||t.locale,[t.locale]),r=Q.useCallback(c=>typeof c=="number"?c:t.firstDayOfWeek,[t.firstDayOfWeek]),n=Q.useCallback(c=>Array.isArray(c)?c:t.weekendDays,[t.weekendDays]),s=Q.useCallback(c=>typeof c=="string"?c:t.labelSeparator,[t.labelSeparator]);return{...t,getLocale:e,getFirstDayOfWeek:r,getWeekendDays:n,getLabelSeparator:s}}function jl({value:t,type:e,withTime:r}){const n=r?Qo:Ue;if(e==="range"&&Array.isArray(t)){const s=n(t[0]),c=n(t[1]);return s?c?`${s} – ${c}`:`${s} –`:""}return e==="multiple"&&Array.isArray(t)?t.filter(Boolean).join(", "):!Array.isArray(t)&&t?n(t):""}function Zo({value:t,type:e,name:r,form:n,withTime:s=!1}){return w.jsx("input",{type:"hidden",value:jl({value:t,type:e,withTime:s}),name:r,form:n})}Zo.displayName="@mantine/dates/HiddenDatesInput";function Ko(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(r=Ko(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function Pe(){for(var t,e,r=0,n="",s=arguments.length;r<s;r++)(t=arguments[r])&&(e=Ko(t))&&(n&&(n+=" "),n+=e);return n}var Jo={day:"m_396ce5cb"};const $l=T.createVarsResolver((t,{size:e})=>({day:{"--day-size":T.getSize(e,"day-size")}})),ln=T.factory((t,e)=>{const r=T.useProps("Day",null,t),{classNames:n,className:s,style:c,styles:h,unstyled:a,vars:g,date:y,disabled:_,__staticSelector:P,weekend:S,outside:x,selected:k,renderDay:O,inRange:N,firstInRange:F,lastInRange:B,hidden:Z,static:U,highlightToday:ee,attributes:re,...K}=r,J=T.useStyles({name:P||"Day",classes:Jo,props:r,className:s,style:c,classNames:n,styles:h,unstyled:a,attributes:re,vars:g,varsResolver:$l,rootSelector:"day"});return w.jsx(T.UnstyledButton,{...J("day",{style:Z?{display:"none"}:void 0}),component:U?"div":"button",ref:e,disabled:_,"data-today":he(y).isSame(new Date,"day")||void 0,"data-hidden":Z||void 0,"data-highlight-today":ee||void 0,"data-disabled":_||void 0,"data-weekend":!_&&!x&&S||void 0,"data-outside":!_&&x||void 0,"data-selected":!_&&k||void 0,"data-in-range":N&&!_||void 0,"data-first-in-range":F&&!_||void 0,"data-last-in-range":B&&!_||void 0,"data-static":U||void 0,unstyled:a,...K,children:O?.(y)||he(y).date()})});ln.classes=Jo,ln.displayName="@mantine/dates/Day";function Rl({locale:t,format:e="dd",firstDayOfWeek:r=1}){const n=he().day(r),s=[];for(let c=0;c<7;c+=1)typeof e=="string"?s.push(he(n).add(c,"days").locale(t).format(e)):s.push(e(he(n).add(c,"days").format("YYYY-MM-DD")));return s}var Xo={weekday:"m_18a3eca"};const Nl=T.createVarsResolver((t,{size:e})=>({weekdaysRow:{"--wr-fz":T.getFontSize(e),"--wr-spacing":T.getSpacing(e)}})),un=T.factory((t,e)=>{const r=T.useProps("WeekdaysRow",null,t),{classNames:n,className:s,style:c,styles:h,unstyled:a,vars:g,locale:y,firstDayOfWeek:_,weekdayFormat:P,cellComponent:S="th",__staticSelector:x,withWeekNumbers:k,attributes:O,...N}=r,F=T.useStyles({name:x||"WeekdaysRow",classes:Xo,props:r,className:s,style:c,classNames:n,styles:h,unstyled:a,attributes:O,vars:g,varsResolver:Nl,rootSelector:"weekdaysRow"}),B=gt(),Z=Rl({locale:B.getLocale(y),format:P,firstDayOfWeek:B.getFirstDayOfWeek(_)}).map((U,ee)=>w.jsx(S,{...F("weekday"),children:U},ee));return w.jsxs(T.Box,{component:"tr",ref:e,...F("weekdaysRow"),...N,children:[k&&w.jsx(S,{...F("weekday"),children:"#"}),Z]})});un.classes=Xo,un.displayName="@mantine/dates/WeekdaysRow";function Ll(t,e=1){let r=he(t);if(!r.isValid())return r;const n=e===0?6:e-1;for(;r.day()!==n;)r=r.add(1,"day");return r.format("YYYY-MM-DD")}function Bl(t,e=1){let r=he(t);for(;r.day()!==e;)r=r.subtract(1,"day");return r.format("YYYY-MM-DD")}function Il({month:t,firstDayOfWeek:e=1,consistentWeeks:r}){const n=he(t).subtract(he(t).date()-1,"day"),s=he(n.format("YYYY-M-D")),c=s.format("YYYY-MM-DD"),h=s.add(+s.daysInMonth()-1,"day").format("YYYY-MM-DD"),a=Ll(h,e),g=[];let y=he(Bl(c,e));for(;he(y).isBefore(a,"day");){const _=[];for(let P=0;P<7;P+=1)_.push(y.format("YYYY-MM-DD")),y=y.add(1,"day");g.push(_)}if(r&&g.length<6){const _=g[g.length-1],P=_[_.length-1];let S=he(P).add(1,"day");for(;g.length<6;){const x=[];for(let k=0;k<7;k+=1)x.push(S.format("YYYY-MM-DD")),S=S.add(1,"day");g.push(x)}}return g}function cn(t,e){return he(t).format("YYYY-MM")===he(e).format("YYYY-MM")}function es(t,e){return e?he(t).isAfter(he(e).subtract(1,"day"),"day"):!0}function ts(t,e){return e?he(t).isBefore(he(e).add(1,"day"),"day"):!0}function Yl({dates:t,minDate:e,maxDate:r,getDayProps:n,excludeDate:s,hideOutsideDates:c,month:h}){const a=t.flat().filter(_=>ts(_,r)&&es(_,e)&&!s?.(_)&&!n?.(_)?.disabled&&(!c||cn(_,h))),g=a.find(_=>n?.(_)?.selected);if(g)return g;const y=a.find(_=>he().isSame(_,"date"));return y||a[0]}var cr={exports:{}},zl=cr.exports,rs;function Fl(){return rs||(rs=1,(function(t,e){(function(r,n){t.exports=n()})(zl,(function(){var r="day";return function(n,s,c){var h=function(y){return y.add(4-y.isoWeekday(),r)},a=s.prototype;a.isoWeekYear=function(){return h(this).year()},a.isoWeek=function(y){if(!this.$utils().u(y))return this.add(7*(y-this.isoWeek()),r);var _,P,S,x,k=h(this),O=(_=this.isoWeekYear(),P=this.$u,S=(P?c.utc:c)().year(_).startOf("year"),x=4-S.isoWeekday(),S.isoWeekday()>4&&(x+=7),S.add(x,r));return k.diff(O,"week")+1},a.isoWeekday=function(y){return this.$utils().u(y)?this.day()||7:this.day(this.day()%7?y:y-7)};var g=a.startOf;a.startOf=function(y,_){var P=this.$utils(),S=!!P.u(_)||_;return P.p(y)==="isoweek"?S?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):g.bind(this)(y,_)}}}))})(cr)),cr.exports}var Wl=Fl();const Ul=An(Wl);he.extend(Ul);function ql(t){const e=t.find(r=>he(r).day()===1);return he(e).isoWeek()}var ns={month:"m_cc9820d3",monthCell:"m_8f457cd5",weekNumber:"m_6cff9dea"};const Vl={withCellSpacing:!0},Hl=T.createVarsResolver((t,{size:e})=>({weekNumber:{"--wn-fz":T.getFontSize(e),"--wn-size":T.getSize(e,"wn-size")}})),dr=T.factory((t,e)=>{const r=T.useProps("Month",Vl,t),{classNames:n,className:s,style:c,styles:h,unstyled:a,vars:g,__staticSelector:y,locale:_,firstDayOfWeek:P,weekdayFormat:S,month:x,weekendDays:k,getDayProps:O,excludeDate:N,minDate:F,maxDate:B,renderDay:Z,hideOutsideDates:U,hideWeekdays:ee,getDayAriaLabel:re,static:K,__getDayRef:J,__onDayKeyDown:q,__onDayClick:H,__onDayMouseEnter:W,__preventFocus:ae,__stopPropagation:oe,withCellSpacing:D,size:C,highlightToday:b,withWeekNumbers:u,attributes:d,...m}=r,f=T.useStyles({name:y||"Month",classes:ns,props:r,className:s,style:c,classNames:n,styles:h,unstyled:a,attributes:d,vars:g,varsResolver:Hl,rootSelector:"month"}),i=gt(),v=Il({month:x,firstDayOfWeek:i.getFirstDayOfWeek(P),consistentWeeks:i.consistentWeeks}),E=Yl({dates:v,minDate:Ue(F),maxDate:Ue(B),getDayProps:O,excludeDate:N,hideOutsideDates:U,month:x}),{resolvedClassNames:j,resolvedStyles:G}=T.useResolvedStylesApi({classNames:n,styles:h,props:r}),X=v.map((te,V)=>{const se=te.map((ie,ue)=>{const A=!cn(ie,x),L=re?.(ie)||he(ie).locale(_||i.locale).format("D MMMM YYYY"),$=O?.(ie),Y=he(ie).isSame(E,"date");return w.jsx("td",{...f("monthCell"),"data-with-spacing":D||void 0,children:w.jsx(ln,{__staticSelector:y||"Month",classNames:j,styles:G,unstyled:a,"data-mantine-stop-propagation":oe||void 0,highlightToday:b,renderDay:Z,date:ie,size:C,weekend:i.getWeekendDays(k).includes(he(ie).get("day")),outside:A,hidden:U?A:!1,"aria-label":L,static:K,disabled:N?.(ie)||!ts(ie,Ue(B))||!es(ie,Ue(F)),ref:I=>{I&&J?.(V,ue,I)},...$,onKeyDown:I=>{$?.onKeyDown?.(I),q?.(I,{rowIndex:V,cellIndex:ue,date:ie})},onMouseEnter:I=>{$?.onMouseEnter?.(I),W?.(I,ie)},onClick:I=>{$?.onClick?.(I),H?.(I,ie)},onMouseDown:I=>{$?.onMouseDown?.(I),ae&&I.preventDefault()},tabIndex:ae||!Y?-1:0})},ie.toString())});return w.jsxs("tr",{...f("monthRow"),children:[u&&w.jsx("td",{...f("weekNumber"),children:ql(te)}),se]},V)});return w.jsxs(T.Box,{component:"table",...f("month"),size:C,ref:e,...m,children:[!ee&&w.jsx("thead",{...f("monthThead"),children:w.jsx(un,{__staticSelector:y||"Month",locale:_,firstDayOfWeek:P,weekdayFormat:S,size:C,classNames:j,styles:G,unstyled:a,withWeekNumbers:u})}),w.jsx("tbody",{...f("monthTbody"),children:X})]})});dr.classes=ns,dr.displayName="@mantine/dates/Month";var os={pickerControl:"m_dc6a3c71"};const Gl=T.createVarsResolver((t,{size:e})=>({pickerControl:{"--dpc-fz":T.getFontSize(e),"--dpc-size":T.getSize(e,"dpc-size")}})),hr=T.factory((t,e)=>{const r=T.useProps("PickerControl",null,t),{classNames:n,className:s,style:c,styles:h,unstyled:a,vars:g,firstInRange:y,lastInRange:_,inRange:P,__staticSelector:S,selected:x,disabled:k,attributes:O,...N}=r,F=T.useStyles({name:S||"PickerControl",classes:os,props:r,className:s,style:c,classNames:n,styles:h,unstyled:a,attributes:O,vars:g,varsResolver:Gl,rootSelector:"pickerControl"});return w.jsx(T.UnstyledButton,{...F("pickerControl"),ref:e,unstyled:a,"data-picker-control":!0,"data-selected":x&&!k||void 0,"data-disabled":k||void 0,"data-in-range":P&&!k&&!x||void 0,"data-first-in-range":y&&!k||void 0,"data-last-in-range":_&&!k||void 0,disabled:k,...N})});hr.classes=os,hr.displayName="@mantine/dates/PickerControl";function ss({year:t,minDate:e,maxDate:r}){return!e&&!r?!1:!!(e&&he(t).isBefore(e,"year")||r&&he(t).isAfter(r,"year"))}function Ql({years:t,minDate:e,maxDate:r,getYearControlProps:n}){const s=t.flat().filter(a=>!ss({year:a,minDate:e,maxDate:r})&&!n?.(a)?.disabled),c=s.find(a=>n?.(a)?.selected);if(c)return c;const h=s.find(a=>he().isSame(a,"year"));return h||s[0]}function is(t){const e=he(t).year(),r=e-e%10;let n=0;const s=[[],[],[],[]];for(let c=0;c<4;c+=1){const h=c===3?1:3;for(let a=0;a<h;a+=1)s[c].push(he(new Date(r+n,0)).format("YYYY-MM-DD")),n+=1}return s}var as={yearsList:"m_9206547b",yearsListCell:"m_c5a19c7d"};const Zl={yearsListFormat:"YYYY",withCellSpacing:!0},fr=T.factory((t,e)=>{const r=T.useProps("YearsList",Zl,t),{classNames:n,className:s,style:c,styles:h,unstyled:a,vars:g,decade:y,yearsListFormat:_,locale:P,minDate:S,maxDate:x,getYearControlProps:k,__staticSelector:O,__getControlRef:N,__onControlKeyDown:F,__onControlClick:B,__onControlMouseEnter:Z,__preventFocus:U,__stopPropagation:ee,withCellSpacing:re,size:K,attributes:J,...q}=r,H=T.useStyles({name:O||"YearsList",classes:as,props:r,className:s,style:c,classNames:n,styles:h,unstyled:a,attributes:J,vars:g,rootSelector:"yearsList"}),W=gt(),ae=is(y),oe=Ql({years:ae,minDate:S,maxDate:x,getYearControlProps:k}),D=ae.map((C,b)=>{const u=C.map((d,m)=>{const f=k?.(d),i=he(d).isSame(oe,"year");return w.jsx("td",{...H("yearsListCell"),"data-with-spacing":re||void 0,children:w.jsx(hr,{...H("yearsListControl"),size:K,unstyled:a,"data-mantine-stop-propagation":ee||void 0,disabled:ss({year:d,minDate:S,maxDate:x}),ref:v=>{v&&N?.(b,m,v)},...f,onKeyDown:v=>{f?.onKeyDown?.(v),F?.(v,{rowIndex:b,cellIndex:m,date:d})},onClick:v=>{f?.onClick?.(v),B?.(v,d)},onMouseEnter:v=>{f?.onMouseEnter?.(v),Z?.(v,d)},onMouseDown:v=>{f?.onMouseDown?.(v),U&&v.preventDefault()},tabIndex:U||!i?-1:0,children:he(d).locale(W.getLocale(P)).format(_)})},m)});return w.jsx("tr",{...H("yearsListRow"),children:u},b)});return w.jsx(T.Box,{component:"table",ref:e,size:K,...H("yearsList"),...q,children:w.jsx("tbody",{children:D})})});fr.classes=as,fr.displayName="@mantine/dates/YearsList";function ls({month:t,minDate:e,maxDate:r}){return!e&&!r?!1:!!(e&&he(t).isBefore(e,"month")||r&&he(t).isAfter(r,"month"))}function Kl({months:t,minDate:e,maxDate:r,getMonthControlProps:n}){const s=t.flat().filter(a=>!ls({month:a,minDate:e,maxDate:r})&&!n?.(a)?.disabled),c=s.find(a=>n?.(a)?.selected);if(c)return c;const h=s.find(a=>he().isSame(a,"month"));return h||s[0]}function Jl(t){const e=he(t).startOf("year").toDate(),r=[[],[],[],[]];let n=0;for(let s=0;s<4;s+=1)for(let c=0;c<3;c+=1)r[s].push(he(e).add(n,"months").format("YYYY-MM-DD")),n+=1;return r}var us={monthsList:"m_2a6c32d",monthsListCell:"m_fe27622f"};const Xl={monthsListFormat:"MMM",withCellSpacing:!0},pr=T.factory((t,e)=>{const r=T.useProps("MonthsList",Xl,t),{classNames:n,className:s,style:c,styles:h,unstyled:a,vars:g,__staticSelector:y,year:_,monthsListFormat:P,locale:S,minDate:x,maxDate:k,getMonthControlProps:O,__getControlRef:N,__onControlKeyDown:F,__onControlClick:B,__onControlMouseEnter:Z,__preventFocus:U,__stopPropagation:ee,withCellSpacing:re,size:K,attributes:J,...q}=r,H=T.useStyles({name:y||"MonthsList",classes:us,props:r,className:s,style:c,classNames:n,styles:h,unstyled:a,attributes:J,vars:g,rootSelector:"monthsList"}),W=gt(),ae=Jl(_),oe=Kl({months:ae,minDate:Ue(x),maxDate:Ue(k),getMonthControlProps:O}),D=ae.map((C,b)=>{const u=C.map((d,m)=>{const f=O?.(d),i=he(d).isSame(oe,"month");return w.jsx("td",{...H("monthsListCell"),"data-with-spacing":re||void 0,children:w.jsx(hr,{...H("monthsListControl"),size:K,unstyled:a,__staticSelector:y||"MonthsList","data-mantine-stop-propagation":ee||void 0,disabled:ls({month:d,minDate:Ue(x),maxDate:Ue(k)}),ref:v=>{v&&N?.(b,m,v)},...f,onKeyDown:v=>{f?.onKeyDown?.(v),F?.(v,{rowIndex:b,cellIndex:m,date:d})},onClick:v=>{f?.onClick?.(v),B?.(v,d)},onMouseEnter:v=>{f?.onMouseEnter?.(v),Z?.(v,d)},onMouseDown:v=>{f?.onMouseDown?.(v),U&&v.preventDefault()},tabIndex:U||!i?-1:0,children:he(d).locale(W.getLocale(S)).format(P)})},m)});return w.jsx("tr",{...H("monthsListRow"),children:u},b)});return w.jsx(T.Box,{component:"table",ref:e,size:K,...H("monthsList"),...q,children:w.jsx("tbody",{children:D})})});pr.classes=us,pr.displayName="@mantine/dates/MonthsList";var cs={calendarHeader:"m_730a79ed",calendarHeaderLevel:"m_f6645d97",calendarHeaderControl:"m_2351eeb0",calendarHeaderControlIcon:"m_367dc749"};const eu={hasNextLevel:!0,withNext:!0,withPrevious:!0,headerControlsOrder:["previous","level","next"]},tu=T.createVarsResolver((t,{size:e})=>({calendarHeader:{"--dch-control-size":T.getSize(e,"dch-control-size"),"--dch-fz":T.getFontSize(e)}})),mt=T.factory((t,e)=>{const r=T.useProps("CalendarHeader",eu,t),{classNames:n,className:s,style:c,styles:h,unstyled:a,vars:g,nextIcon:y,previousIcon:_,nextLabel:P,previousLabel:S,onNext:x,onPrevious:k,onLevelClick:O,label:N,nextDisabled:F,previousDisabled:B,hasNextLevel:Z,levelControlAriaLabel:U,withNext:ee,withPrevious:re,headerControlsOrder:K,__staticSelector:J,__preventFocus:q,__stopPropagation:H,attributes:W,...ae}=r,oe=T.useStyles({name:J||"CalendarHeader",classes:cs,props:r,className:s,style:c,classNames:n,styles:h,unstyled:a,attributes:W,vars:g,varsResolver:tu,rootSelector:"calendarHeader"}),D=q?m=>m.preventDefault():void 0,C=re&&Q.createElement(T.UnstyledButton,{...oe("calendarHeaderControl"),key:"previous","data-direction":"previous","aria-label":S,onClick:k,unstyled:a,onMouseDown:D,disabled:B,"data-disabled":B||void 0,tabIndex:q||B?-1:0,"data-mantine-stop-propagation":H||void 0},_||w.jsx(T.AccordionChevron,{...oe("calendarHeaderControlIcon"),"data-direction":"previous",size:"45%"})),b=Q.createElement(T.UnstyledButton,{component:Z?"button":"div",...oe("calendarHeaderLevel"),key:"level",onClick:Z?O:void 0,unstyled:a,onMouseDown:Z?D:void 0,disabled:!Z,"data-static":!Z||void 0,"aria-label":U,tabIndex:q||!Z?-1:0,"data-mantine-stop-propagation":H||void 0},N),u=ee&&Q.createElement(T.UnstyledButton,{...oe("calendarHeaderControl"),key:"next","data-direction":"next","aria-label":P,onClick:x,unstyled:a,onMouseDown:D,disabled:F,"data-disabled":F||void 0,tabIndex:q||F?-1:0,"data-mantine-stop-propagation":H||void 0},y||w.jsx(T.AccordionChevron,{...oe("calendarHeaderControlIcon"),"data-direction":"next",size:"45%"})),d=K.map(m=>m==="previous"?C:m==="level"?b:m==="next"?u:null);return w.jsx(T.Box,{...oe("calendarHeader"),ref:e,...ae,children:d})});mt.classes=cs,mt.displayName="@mantine/dates/CalendarHeader";function ru(t){const e=is(t);return[e[0][0],e[3][0]]}const nu={decadeLabelFormat:"YYYY"},gr=T.factory((t,e)=>{const r=T.useProps("DecadeLevel",nu,t),{decade:n,locale:s,minDate:c,maxDate:h,yearsListFormat:a,getYearControlProps:g,__getControlRef:y,__onControlKeyDown:_,__onControlClick:P,__onControlMouseEnter:S,withCellSpacing:x,__preventFocus:k,nextIcon:O,previousIcon:N,nextLabel:F,previousLabel:B,onNext:Z,onPrevious:U,nextDisabled:ee,previousDisabled:re,levelControlAriaLabel:K,withNext:J,withPrevious:q,headerControlsOrder:H,decadeLabelFormat:W,classNames:ae,styles:oe,unstyled:D,__staticSelector:C,__stopPropagation:b,size:u,attributes:d,...m}=r,f=gt(),[i,v]=ru(n),E={__staticSelector:C||"DecadeLevel",classNames:ae,styles:oe,unstyled:D,size:u,attributes:d},j=typeof ee=="boolean"?ee:h?!he(v).endOf("year").isBefore(h):!1,G=typeof re=="boolean"?re:c?!he(i).startOf("year").isAfter(c):!1,X=(te,V)=>he(te).locale(s||f.locale).format(V);return w.jsxs(T.Box,{"data-decade-level":!0,size:u,ref:e,...m,children:[w.jsx(mt,{label:typeof W=="function"?W(i,v):`${X(i,W)} – ${X(v,W)}`,__preventFocus:k,__stopPropagation:b,nextIcon:O,previousIcon:N,nextLabel:F,previousLabel:B,onNext:Z,onPrevious:U,nextDisabled:j,previousDisabled:G,hasNextLevel:!1,levelControlAriaLabel:K,withNext:J,withPrevious:q,headerControlsOrder:H,...E}),w.jsx(fr,{decade:n,locale:s,minDate:c,maxDate:h,yearsListFormat:a,getYearControlProps:g,__getControlRef:y,__onControlKeyDown:_,__onControlClick:P,__onControlMouseEnter:S,__preventFocus:k,__stopPropagation:b,withCellSpacing:x,...E})]})});gr.classes={...fr.classes,...mt.classes},gr.displayName="@mantine/dates/DecadeLevel";const ou={yearLabelFormat:"YYYY"},mr=T.factory((t,e)=>{const r=T.useProps("YearLevel",ou,t),{year:n,locale:s,minDate:c,maxDate:h,monthsListFormat:a,getMonthControlProps:g,__getControlRef:y,__onControlKeyDown:_,__onControlClick:P,__onControlMouseEnter:S,withCellSpacing:x,__preventFocus:k,nextIcon:O,previousIcon:N,nextLabel:F,previousLabel:B,onNext:Z,onPrevious:U,onLevelClick:ee,nextDisabled:re,previousDisabled:K,hasNextLevel:J,levelControlAriaLabel:q,withNext:H,withPrevious:W,headerControlsOrder:ae,yearLabelFormat:oe,__staticSelector:D,__stopPropagation:C,size:b,classNames:u,styles:d,unstyled:m,attributes:f,...i}=r,v=gt(),E={__staticSelector:D||"YearLevel",classNames:u,styles:d,unstyled:m,size:b,attributes:f},j=typeof re=="boolean"?re:h?!he(n).endOf("year").isBefore(h):!1,G=typeof K=="boolean"?K:c?!he(n).startOf("year").isAfter(c):!1;return w.jsxs(T.Box,{"data-year-level":!0,size:b,ref:e,...i,children:[w.jsx(mt,{label:typeof oe=="function"?oe(n):he(n).locale(s||v.locale).format(oe),__preventFocus:k,__stopPropagation:C,nextIcon:O,previousIcon:N,nextLabel:F,previousLabel:B,onNext:Z,onPrevious:U,onLevelClick:ee,nextDisabled:j,previousDisabled:G,hasNextLevel:J,levelControlAriaLabel:q,withNext:H,withPrevious:W,headerControlsOrder:ae,...E}),w.jsx(pr,{year:n,locale:s,minDate:c,maxDate:h,monthsListFormat:a,getMonthControlProps:g,__getControlRef:y,__onControlKeyDown:_,__onControlClick:P,__onControlMouseEnter:S,__preventFocus:k,__stopPropagation:C,withCellSpacing:x,...E})]})});mr.classes={...mt.classes,...pr.classes},mr.displayName="@mantine/dates/YearLevel";const su={monthLabelFormat:"MMMM YYYY"},yr=T.factory((t,e)=>{const r=T.useProps("MonthLevel",su,t),{month:n,locale:s,firstDayOfWeek:c,weekdayFormat:h,weekendDays:a,getDayProps:g,excludeDate:y,minDate:_,maxDate:P,renderDay:S,hideOutsideDates:x,hideWeekdays:k,getDayAriaLabel:O,__getDayRef:N,__onDayKeyDown:F,__onDayClick:B,__onDayMouseEnter:Z,withCellSpacing:U,highlightToday:ee,withWeekNumbers:re,__preventFocus:K,__stopPropagation:J,nextIcon:q,previousIcon:H,nextLabel:W,previousLabel:ae,onNext:oe,onPrevious:D,onLevelClick:C,nextDisabled:b,previousDisabled:u,hasNextLevel:d,levelControlAriaLabel:m,withNext:f,withPrevious:i,headerControlsOrder:v,monthLabelFormat:E,classNames:j,styles:G,unstyled:X,__staticSelector:te,size:V,static:se,attributes:ie,...ue}=r,A=gt(),L={__staticSelector:te||"MonthLevel",classNames:j,styles:G,unstyled:X,size:V,attributes:ie},$=typeof b=="boolean"?b:P?!he(n).endOf("month").isBefore(P):!1,Y=typeof u=="boolean"?u:_?!he(n).startOf("month").isAfter(_):!1;return w.jsxs(T.Box,{"data-month-level":!0,size:V,ref:e,...ue,children:[w.jsx(mt,{label:typeof E=="function"?E(n):he(n).locale(s||A.locale).format(E),__preventFocus:K,__stopPropagation:J,nextIcon:q,previousIcon:H,nextLabel:W,previousLabel:ae,onNext:oe,onPrevious:D,onLevelClick:C,nextDisabled:$,previousDisabled:Y,hasNextLevel:d,levelControlAriaLabel:m,withNext:f,withPrevious:i,headerControlsOrder:v,...L}),w.jsx(dr,{month:n,locale:s,firstDayOfWeek:c,weekdayFormat:h,weekendDays:a,getDayProps:g,excludeDate:y,minDate:_,maxDate:P,renderDay:S,hideOutsideDates:x,hideWeekdays:k,getDayAriaLabel:O,__getDayRef:N,__onDayKeyDown:F,__onDayClick:B,__onDayMouseEnter:Z,__preventFocus:K,__stopPropagation:J,static:se,withCellSpacing:U,highlightToday:ee,withWeekNumbers:re,...L})]})});yr.classes={...dr.classes,...mt.classes},yr.displayName="@mantine/dates/MonthLevel";var ds={levelsGroup:"m_30b26e33"};const yt=T.factory((t,e)=>{const r=T.useProps("LevelsGroup",null,t),{classNames:n,className:s,style:c,styles:h,unstyled:a,vars:g,__staticSelector:y,attributes:_,...P}=r,S=T.useStyles({name:y||"LevelsGroup",classes:ds,props:r,className:s,style:c,classNames:n,styles:h,unstyled:a,attributes:_,vars:g,rootSelector:"levelsGroup"});return w.jsx(T.Box,{ref:e,...S("levelsGroup"),...P})});yt.classes=ds,yt.displayName="@mantine/dates/LevelsGroup";const iu={numberOfColumns:1},vr=T.factory((t,e)=>{const r=T.useProps("DecadeLevelGroup",iu,t),{decade:n,locale:s,minDate:c,maxDate:h,yearsListFormat:a,getYearControlProps:g,__onControlClick:y,__onControlMouseEnter:_,withCellSpacing:P,__preventFocus:S,nextIcon:x,previousIcon:k,nextLabel:O,previousLabel:N,onNext:F,onPrevious:B,nextDisabled:Z,previousDisabled:U,headerControlsOrder:ee,classNames:re,styles:K,unstyled:J,__staticSelector:q,__stopPropagation:H,numberOfColumns:W,levelControlAriaLabel:ae,decadeLabelFormat:oe,size:D,vars:C,attributes:b,...u}=r,d=Q.useRef([]),m=Array(W).fill(0).map((f,i)=>{const v=he(n).add(i*10,"years").format("YYYY-MM-DD");return w.jsx(gr,{size:D,yearsListFormat:a,decade:v,withNext:i===W-1,withPrevious:i===0,decadeLabelFormat:oe,__onControlClick:y,__onControlMouseEnter:_,__onControlKeyDown:(E,j)=>an({levelIndex:i,rowIndex:j.rowIndex,cellIndex:j.cellIndex,event:E,controlsRef:d}),__getControlRef:(E,j,G)=>{Array.isArray(d.current[i])||(d.current[i]=[]),Array.isArray(d.current[i][E])||(d.current[i][E]=[]),d.current[i][E][j]=G},levelControlAriaLabel:typeof ae=="function"?ae(v):ae,locale:s,minDate:c,maxDate:h,__preventFocus:S,__stopPropagation:H,nextIcon:x,previousIcon:k,nextLabel:O,previousLabel:N,onNext:F,onPrevious:B,nextDisabled:Z,previousDisabled:U,getYearControlProps:g,__staticSelector:q||"DecadeLevelGroup",classNames:re,styles:K,unstyled:J,withCellSpacing:P,headerControlsOrder:ee,attributes:b},i)});return w.jsx(yt,{classNames:re,styles:K,__staticSelector:q||"DecadeLevelGroup",ref:e,size:D,unstyled:J,attributes:b,...u,children:m})});vr.classes={...yt.classes,...gr.classes},vr.displayName="@mantine/dates/DecadeLevelGroup";const au={numberOfColumns:1},br=T.factory((t,e)=>{const r=T.useProps("YearLevelGroup",au,t),{year:n,locale:s,minDate:c,maxDate:h,monthsListFormat:a,getMonthControlProps:g,__onControlClick:y,__onControlMouseEnter:_,withCellSpacing:P,__preventFocus:S,nextIcon:x,previousIcon:k,nextLabel:O,previousLabel:N,onNext:F,onPrevious:B,onLevelClick:Z,nextDisabled:U,previousDisabled:ee,hasNextLevel:re,headerControlsOrder:K,classNames:J,styles:q,unstyled:H,__staticSelector:W,__stopPropagation:ae,numberOfColumns:oe,levelControlAriaLabel:D,yearLabelFormat:C,size:b,vars:u,attributes:d,...m}=r,f=Q.useRef([]),i=Array(oe).fill(0).map((v,E)=>{const j=he(n).add(E,"years").format("YYYY-MM-DD");return w.jsx(mr,{size:b,monthsListFormat:a,year:j,withNext:E===oe-1,withPrevious:E===0,yearLabelFormat:C,__stopPropagation:ae,__onControlClick:y,__onControlMouseEnter:_,__onControlKeyDown:(G,X)=>an({levelIndex:E,rowIndex:X.rowIndex,cellIndex:X.cellIndex,event:G,controlsRef:f}),__getControlRef:(G,X,te)=>{Array.isArray(f.current[E])||(f.current[E]=[]),Array.isArray(f.current[E][G])||(f.current[E][G]=[]),f.current[E][G][X]=te},levelControlAriaLabel:typeof D=="function"?D(j):D,locale:s,minDate:c,maxDate:h,__preventFocus:S,nextIcon:x,previousIcon:k,nextLabel:O,previousLabel:N,onNext:F,onPrevious:B,onLevelClick:Z,nextDisabled:U,previousDisabled:ee,hasNextLevel:re,getMonthControlProps:g,classNames:J,styles:q,unstyled:H,__staticSelector:W||"YearLevelGroup",withCellSpacing:P,headerControlsOrder:K,attributes:d},E)});return w.jsx(yt,{classNames:J,styles:q,__staticSelector:W||"YearLevelGroup",ref:e,size:b,unstyled:H,attributes:d,...m,children:i})});br.classes={...mr.classes,...yt.classes},br.displayName="@mantine/dates/YearLevelGroup";const lu={numberOfColumns:1},wr=T.factory((t,e)=>{const r=T.useProps("MonthLevelGroup",lu,t),{month:n,locale:s,firstDayOfWeek:c,weekdayFormat:h,weekendDays:a,getDayProps:g,excludeDate:y,minDate:_,maxDate:P,renderDay:S,hideOutsideDates:x,hideWeekdays:k,getDayAriaLabel:O,__onDayClick:N,__onDayMouseEnter:F,withCellSpacing:B,highlightToday:Z,withWeekNumbers:U,__preventFocus:ee,nextIcon:re,previousIcon:K,nextLabel:J,previousLabel:q,onNext:H,onPrevious:W,onLevelClick:ae,nextDisabled:oe,previousDisabled:D,hasNextLevel:C,headerControlsOrder:b,classNames:u,styles:d,unstyled:m,numberOfColumns:f,levelControlAriaLabel:i,monthLabelFormat:v,__staticSelector:E,__stopPropagation:j,size:G,static:X,vars:te,attributes:V,...se}=r,ie=Q.useRef([]),ue=Array(f).fill(0).map((A,L)=>{const $=he(n).add(L,"months").format("YYYY-MM-DD");return w.jsx(yr,{month:$,withNext:L===f-1,withPrevious:L===0,monthLabelFormat:v,__stopPropagation:j,__onDayClick:N,__onDayMouseEnter:F,__onDayKeyDown:(Y,I)=>an({levelIndex:L,rowIndex:I.rowIndex,cellIndex:I.cellIndex,event:Y,controlsRef:ie}),__getDayRef:(Y,I,de)=>{Array.isArray(ie.current[L])||(ie.current[L]=[]),Array.isArray(ie.current[L][Y])||(ie.current[L][Y]=[]),ie.current[L][Y][I]=de},levelControlAriaLabel:typeof i=="function"?i($):i,locale:s,firstDayOfWeek:c,weekdayFormat:h,weekendDays:a,getDayProps:g,excludeDate:y,minDate:_,maxDate:P,renderDay:S,hideOutsideDates:x,hideWeekdays:k,getDayAriaLabel:O,__preventFocus:ee,nextIcon:re,previousIcon:K,nextLabel:J,previousLabel:q,onNext:H,onPrevious:W,onLevelClick:ae,nextDisabled:oe,previousDisabled:D,hasNextLevel:C,classNames:u,styles:d,unstyled:m,__staticSelector:E||"MonthLevelGroup",size:G,static:X,withCellSpacing:B,highlightToday:Z,withWeekNumbers:U,headerControlsOrder:b,attributes:V},L)});return w.jsx(yt,{classNames:u,styles:d,__staticSelector:E||"MonthLevelGroup",ref:e,size:G,attributes:V,...se,children:ue})});wr.classes={...yt.classes,...yr.classes},wr.displayName="@mantine/dates/MonthLevelGroup";const hs=t=>t==="range"?[null,null]:t==="multiple"?[]:null,fs=(t,e)=>{const r=e?Qo:Ue;return Array.isArray(t)?t.map(r):r(t)};function dn({type:t,value:e,defaultValue:r,onChange:n,withTime:s=!1}){const c=Q.useRef(t),[h,a,g]=Le.useUncontrolled({value:fs(e,s),defaultValue:fs(r,s),finalValue:hs(t),onChange:n});let y=h;return c.current!==t&&(c.current=t,e===void 0&&(y=r!==void 0?r:hs(t),a(y))),[y,a,g]}function hn(t,e){return t?t==="month"?0:t==="year"?1:2:e||0}function uu(t){return t===0?"month":t===1?"year":"decade"}function Ht(t,e,r){return uu(Le.clamp(hn(t,0),hn(e,0),hn(r,2)))}const cu={maxLevel:"decade",minLevel:"month",__updateDateOnYearSelect:!0,__updateDateOnMonthSelect:!0,enableKeyboardNavigation:!0},_r=T.factory((t,e)=>{const r=T.useProps("Calendar",cu,t),{vars:n,maxLevel:s,minLevel:c,defaultLevel:h,level:a,onLevelChange:g,date:y,defaultDate:_,onDateChange:P,numberOfColumns:S,columnsToScroll:x,ariaLabels:k,nextLabel:O,previousLabel:N,onYearSelect:F,onMonthSelect:B,onYearMouseEnter:Z,onMonthMouseEnter:U,headerControlsOrder:ee,__updateDateOnYearSelect:re,__updateDateOnMonthSelect:K,__setDateRef:J,__setLevelRef:q,firstDayOfWeek:H,weekdayFormat:W,weekendDays:ae,getDayProps:oe,excludeDate:D,renderDay:C,hideOutsideDates:b,hideWeekdays:u,getDayAriaLabel:d,monthLabelFormat:m,nextIcon:f,previousIcon:i,__onDayClick:v,__onDayMouseEnter:E,withCellSpacing:j,highlightToday:G,withWeekNumbers:X,monthsListFormat:te,getMonthControlProps:V,yearLabelFormat:se,yearsListFormat:ie,getYearControlProps:ue,decadeLabelFormat:A,classNames:L,styles:$,unstyled:Y,minDate:I,maxDate:de,locale:o,__staticSelector:l,size:p,__preventFocus:M,__stopPropagation:R,onNextDecade:z,onPreviousDecade:le,onNextYear:ce,onPreviousYear:fe,onNextMonth:ne,onPreviousMonth:pe,static:me,enableKeyboardNavigation:ge,attributes:xe,...Ce}=r,{resolvedClassNames:ke,resolvedStyles:qe}=T.useResolvedStylesApi({classNames:L,styles:$,props:r}),[Re,_e]=Le.useUncontrolled({value:a?Ht(a,c,s):void 0,defaultValue:h?Ht(h,c,s):void 0,finalValue:Ht(void 0,c,s),onChange:g}),[ot,Te]=dn({type:"default",value:Ue(y),defaultValue:Ue(_),onChange:P});Q.useImperativeHandle(J,()=>ve=>{Te(ve)}),Q.useImperativeHandle(q,()=>ve=>{_e(ve)});const Ve={__staticSelector:l||"Calendar",styles:qe,classNames:ke,unstyled:Y,size:p,attributes:xe},Ye=x||S||1,Xe=new Date,st=I&&he(Xe).isAfter(I)?I:he(Xe).format("YYYY-MM-DD"),je=ot||st,it=()=>{const ve=he(je).add(Ye,"month").format("YYYY-MM-DD");ne?.(ve),Te(ve)},at=()=>{const ve=he(je).subtract(Ye,"month").format("YYYY-MM-DD");pe?.(ve),Te(ve)},lt=()=>{const ve=he(je).add(Ye,"year").format("YYYY-MM-DD");ce?.(ve),Te(ve)},dt=()=>{const ve=he(je).subtract(Ye,"year").format("YYYY-MM-DD");fe?.(ve),Te(ve)},He=()=>{const ve=he(je).add(10*Ye,"year").format("YYYY-MM-DD");z?.(ve),Te(ve)},Ge=()=>{const ve=he(je).subtract(10*Ye,"year").format("YYYY-MM-DD");le?.(ve),Te(ve)},et=Q.useRef(null);Q.useEffect(()=>{if(!ge||me)return;const ve=Me=>{if(!et.current?.contains(document.activeElement))return;const tt=Me.ctrlKey||Me.metaKey,rt=Me.shiftKey;switch(Me.key){case"ArrowUp":tt&&rt?(Me.preventDefault(),Ge()):tt&&(Me.preventDefault(),dt());break;case"ArrowDown":tt&&rt?(Me.preventDefault(),He()):tt&&(Me.preventDefault(),lt());break;case"y":case"Y":Re==="month"&&(Me.preventDefault(),_e("year"));break}};return document.addEventListener("keydown",ve),()=>{document.removeEventListener("keydown",ve)}},[ge,me,Re,lt,dt,He,Ge]);const vt=ve=>{et.current=ve,typeof e=="function"?e(ve):e&&(e.current=ve)};return w.jsxs(T.Box,{ref:vt,size:p,"data-calendar":!0,...Ce,children:[Re==="month"&&w.jsx(wr,{month:je,minDate:I,maxDate:de,firstDayOfWeek:H,weekdayFormat:W,weekendDays:ae,getDayProps:oe,excludeDate:D,renderDay:C,hideOutsideDates:b,hideWeekdays:u,getDayAriaLabel:d,onNext:it,onPrevious:at,hasNextLevel:s!=="month",onLevelClick:()=>_e("year"),numberOfColumns:S,locale:o,levelControlAriaLabel:k?.monthLevelControl,nextLabel:k?.nextMonth??O,nextIcon:f,previousLabel:k?.previousMonth??N,previousIcon:i,monthLabelFormat:m,__onDayClick:v,__onDayMouseEnter:E,__preventFocus:M,__stopPropagation:R,static:me,withCellSpacing:j,highlightToday:G,withWeekNumbers:X,headerControlsOrder:ee,...Ve}),Re==="year"&&w.jsx(br,{year:je,numberOfColumns:S,minDate:I,maxDate:de,monthsListFormat:te,getMonthControlProps:V,locale:o,onNext:lt,onPrevious:dt,hasNextLevel:s!=="month"&&s!=="year",onLevelClick:()=>_e("decade"),levelControlAriaLabel:k?.yearLevelControl,nextLabel:k?.nextYear??O,nextIcon:f,previousLabel:k?.previousYear??N,previousIcon:i,yearLabelFormat:se,__onControlMouseEnter:U,__onControlClick:(ve,Me)=>{K&&Te(Me),_e(Ht("month",c,s)),B?.(Me)},__preventFocus:M,__stopPropagation:R,withCellSpacing:j,headerControlsOrder:ee,...Ve}),Re==="decade"&&w.jsx(vr,{decade:je,minDate:I,maxDate:de,yearsListFormat:ie,getYearControlProps:ue,locale:o,onNext:He,onPrevious:Ge,numberOfColumns:S,nextLabel:k?.nextDecade??O,nextIcon:f,previousLabel:k?.previousDecade??N,previousIcon:i,decadeLabelFormat:A,__onControlMouseEnter:Z,__onControlClick:(ve,Me)=>{re&&Te(Me),_e(Ht("year",c,s)),F?.(Me)},__preventFocus:M,__stopPropagation:R,withCellSpacing:j,headerControlsOrder:ee,...Ve})]})});_r.classes={...vr.classes,...br.classes,...wr.classes},_r.displayName="@mantine/dates/Calendar";function du(t){const{maxLevel:e,minLevel:r,defaultLevel:n,level:s,onLevelChange:c,nextIcon:h,previousIcon:a,date:g,defaultDate:y,onDateChange:_,numberOfColumns:P,columnsToScroll:S,ariaLabels:x,nextLabel:k,previousLabel:O,onYearSelect:N,onMonthSelect:F,onYearMouseEnter:B,onMonthMouseEnter:Z,onNextMonth:U,onPreviousMonth:ee,onNextYear:re,onPreviousYear:K,onNextDecade:J,onPreviousDecade:q,withCellSpacing:H,highlightToday:W,__updateDateOnYearSelect:ae,__updateDateOnMonthSelect:oe,__setDateRef:D,__setLevelRef:C,withWeekNumbers:b,headerControlsOrder:u,firstDayOfWeek:d,weekdayFormat:m,weekendDays:f,getDayProps:i,excludeDate:v,renderDay:E,hideOutsideDates:j,hideWeekdays:G,getDayAriaLabel:X,monthLabelFormat:te,monthsListFormat:V,getMonthControlProps:se,yearLabelFormat:ie,yearsListFormat:ue,getYearControlProps:A,decadeLabelFormat:L,allowSingleDateInRange:$,allowDeselect:Y,minDate:I,maxDate:de,locale:o,...l}=t;return{calendarProps:{maxLevel:e,minLevel:r,defaultLevel:n,level:s,onLevelChange:c,nextIcon:h,previousIcon:a,date:g,defaultDate:y,onDateChange:_,numberOfColumns:P,columnsToScroll:S,ariaLabels:x,nextLabel:k,previousLabel:O,onYearSelect:N,onMonthSelect:F,onYearMouseEnter:B,onMonthMouseEnter:Z,onNextMonth:U,onPreviousMonth:ee,onNextYear:re,onPreviousYear:K,onNextDecade:J,onPreviousDecade:q,withCellSpacing:H,highlightToday:W,__updateDateOnYearSelect:ae,__updateDateOnMonthSelect:oe,__setDateRef:D,withWeekNumbers:b,headerControlsOrder:u,firstDayOfWeek:d,weekdayFormat:m,weekendDays:f,getDayProps:i,excludeDate:v,renderDay:E,hideOutsideDates:j,hideWeekdays:G,getDayAriaLabel:X,monthLabelFormat:te,monthsListFormat:V,getMonthControlProps:se,yearLabelFormat:ie,yearsListFormat:ue,getYearControlProps:A,decadeLabelFormat:L,allowSingleDateInRange:$,allowDeselect:Y,minDate:I,maxDate:de,locale:o},others:l}}function hu(t){if(t===null)return null;const e=new Date(t);return Number.isNaN(e.getTime())||!t?null:he(e).format("YYYY-MM-DD")}function fu({date:t,maxDate:e,minDate:r}){return!(t==null||Number.isNaN(new Date(t).getTime())||e&&he(t).isAfter(e,"date")||r&&he(t).isBefore(r,"date"))}const pu={valueFormat:"MMMM D, YYYY",fixOnBlur:!0,size:"sm"},Cr=T.factory((t,e)=>{const r=T.useInputProps("DateInput",pu,t),{inputProps:n,wrapperProps:s,value:c,defaultValue:h,onChange:a,clearable:g,clearButtonProps:y,popoverProps:_,getDayProps:P,locale:S,valueFormat:x,dateParser:k,minDate:O,maxDate:N,fixOnBlur:F,onFocus:B,onBlur:Z,onClick:U,onKeyDown:ee,readOnly:re,name:K,form:J,rightSection:q,unstyled:H,classNames:W,styles:ae,allowDeselect:oe,date:D,defaultDate:C,onDateChange:b,getMonthControlProps:u,getYearControlProps:d,disabled:m,...f}=r,i=Q.useRef(null),v=Q.useRef(null),[E,j]=Q.useState(!1),{calendarProps:G,others:X}=du(f),te=gt(),se=k||(ne=>{const pe=he(ne,x,te.getLocale(S)).toDate();return Number.isNaN(pe.getTime())?hu(ne):he(pe).format("YYYY-MM-DD")}),ie=oe!==void 0?oe:g,ue=ne=>ne?he(ne).locale(te.getLocale(S)).format(x):"",[A,L,$]=dn({type:"default",value:c,defaultValue:h,onChange:a}),[Y,I]=dn({type:"default",value:D,defaultValue:h||C,onChange:b});Q.useEffect(()=>{$&&c!==null&&I(c)},[$,c]);const[de,o]=Q.useState(ue(A));Q.useEffect(()=>{o(ue(A))},[te.getLocale(S)]);const l=ne=>{const pe=ne.currentTarget.value;if(o(pe),j(!0),pe.trim()===""&&(oe||g))L(null);else{const me=se(pe);me&&fu({date:me,minDate:O,maxDate:N})&&(L(me),I(me))}},p=ne=>{Z?.(ne),j(!1),F&&o(ue(A))},M=ne=>{B?.(ne),j(!0)},R=ne=>{U?.(ne),j(!0)},z=ne=>{ne.key==="Escape"&&j(!1),ee?.(ne)},le=ne=>({...P?.(ne),selected:he(A).isSame(ne,"day"),onClick:pe=>{P?.(ne).onClick?.(pe);const me=ie&&he(A).isSame(ne,"day")?null:ne;L(me),!$&&me&&o(ue(me)),j(!1)}}),ce=w.jsx(T.Input.ClearButton,{onClick:()=>{L(null),!$&&o(""),j(!1)},unstyled:H,...y}),fe=g&&!!A&&!re&&!m;return Le.useDidUpdate(()=>{A!==void 0&&!E&&o(ue(A))},[A]),Le.useClickOutside(()=>j(!1),void 0,[i.current,v.current]),w.jsxs(w.Fragment,{children:[w.jsx(T.Input.Wrapper,{...s,__staticSelector:"DateInput",ref:i,children:w.jsxs(T.Popover,{opened:E,trapFocus:!1,position:"bottom-start",disabled:re||m,withRoles:!1,unstyled:H,..._,children:[w.jsx(T.Popover.Target,{children:w.jsx(T.Input,{"data-dates-input":!0,"data-read-only":re||void 0,autoComplete:"off",ref:e,value:de,onChange:l,onBlur:p,onFocus:M,onClick:R,onKeyDown:z,readOnly:re,rightSection:q,__clearSection:ce,__clearable:fe,...n,...X,disabled:m,__staticSelector:"DateInput"})}),w.jsx(T.Popover.Dropdown,{onMouseDown:ne=>ne.preventDefault(),"data-dates-dropdown":!0,ref:v,children:w.jsx(_r,{__staticSelector:"DateInput",...G,classNames:W,styles:ae,unstyled:H,__preventFocus:!0,minDate:O,maxDate:N,locale:S,getDayProps:le,size:n.size,date:Y,onDateChange:I,getMonthControlProps:ne=>({selected:typeof A=="string"?cn(ne,A):!1,...u?.(ne)}),getYearControlProps:ne=>({selected:typeof A=="string"?he(ne).isSame(A,"year"):!1,...d?.(ne)}),attributes:s.attributes})})]})}),w.jsx(Zo,{name:K,form:J,value:A,type:"default"})]})});Cr.classes={...T.Input.classes,..._r.classes},Cr.displayName="@mantine/dates/DateInput";function ps(t){const e=Qe.c(47),{fields:r,onClose:n,queryKey:s,apiPath:c,steps:h,onCreated:a}=t,[g,y]=Q.useState(0),[_,P]=Q.useState(!1),[S,x]=Q.useState(),{mutateAsync:k,isError:O,error:N,isPending:F}=qo(c,s),{mutateAsync:B,isPending:Z}=sn(c,s),U=F||Z;let ee;e[0]!==r?(ee=new Set(r.filter(bu).map(vu)),e[0]=r,e[1]=ee):ee=e[1];let re;e[2]!==ee?(re=[...ee],e[2]=ee,e[3]=re):re=e[3];const K=re;let J;e[4]!==r?(J=r.reduce(yu,{}),e[4]=r,e[5]=J):J=e[5];let q;e[6]!==r?(q=r.filter(mu).reduce(gu,{}),e[6]=r,e[7]=q):q=e[7];let H;e[8]!==J||e[9]!==q?(H={mode:"uncontrolled",initialValues:J,validate:q},e[8]=J,e[9]=q,e[10]=H):H=e[10];const W=On.useForm(H);let ae;e[11]!==W||e[12]!==S?(ae=function(i){const v=W.getValues();return i.conditional&&!i.conditional(v)?null:w.jsxs(Q.Fragment,{children:[(i.type===void 0||i.type=="text")&&w.jsx(T.TextInput,{label:i.column.title,placeholder:i.placeholder??"",...W.getInputProps(i.id),type:i.id.includes("email")?"email":void 0,required:i.required},W.key(i.id)),i.type==="number"&&w.jsx(T.NumberInput,{decimalSeparator:",",label:i.column.title,placeholder:i.placeholder??"",...W.getInputProps(i.id),required:i.required},W.key(i.id)),i.type==="date"&&w.jsx(Cr,{label:i.column.title,placeholder:i.placeholder??"",valueFormat:"DD.MM.YYYY",clearable:!0,...W.getInputProps(i.id),required:i.required},W.key(i.id)),i.type==="boolean"&&w.jsx(T.Checkbox,{mt:"md",label:i.column.title,...W.getInputProps(i.id,{type:"checkbox"}),required:i.required},W.key(i.id)),i.type==="textarea"&&w.jsx(T.Textarea,{label:i.column.title,placeholder:i.placeholder??"",...W.getInputProps(i.id),minRows:3,autosize:!0,required:i.required},W.key(i.id)),i.type==="custom"&&i.render&&i.render({...W.getValues(),...S&&{id:S}},W.setValues,P,{error:W.getInputProps(i.id).error,required:i.required})]},i.id)},e[11]=W,e[12]=S,e[13]=ae):ae=e[13];const oe=ae;let D;e[14]!==N?.message||e[15]!==N?.name||e[16]!==O?(D=O&&w.jsx(T.Alert,{variant:"outline",color:"red",title:N?.name??"Fehler aufgetreten",mb:"lg",children:N?.message??"Fehler aufgetreten"}),e[14]=N?.message,e[15]=N?.name,e[16]=O,e[17]=D):D=e[17];let C;e[18]!==g||e[19]!==k||e[20]!==W||e[21]!==O||e[22]!==n||e[23]!==a||e[24]!==S||e[25]!==K.length||e[26]!==B?(C=W.onSubmit(async f=>{if(S)await B({...f,id:S});else{const i=await k(f);x(i.id),a?.(i.id)}K.length&&g<K.length-1?O||y(g+1):O||(W.setInitialValues(f),W.reset(),n())}),e[18]=g,e[19]=k,e[20]=W,e[21]=O,e[22]=n,e[23]=a,e[24]=S,e[25]=K.length,e[26]=B,e[27]=C):C=e[27];let b;e[28]!==g||e[29]!==r||e[30]!==oe||e[31]!==h||e[32]!==K?(b=K.length?w.jsx(T.Stepper,{active:g,size:"sm",children:K.map(f=>w.jsx(T.Stepper.Step,{...h&&h[f-1]?{label:h[f-1].label}:{},children:r.filter(i=>i.step===f).map(i=>oe(i))},f))}):r.map(f=>oe(f)),e[28]=g,e[29]=r,e[30]=oe,e[31]=h,e[32]=K,e[33]=b):b=e[33];let u;e[34]!==g||e[35]!==_||e[36]!==U||e[37]!==n||e[38]!==K.length?(u=!_&&w.jsxs(T.Group,{mt:"md",justify:"end",children:[w.jsx(T.Button,{onClick:()=>K.length?g===0?n():y(g-1):n(),variant:"outline",children:K.length?g===0?"Abbrechen":"Zurück":"Abbrechen"}),w.jsx(T.Button,{type:"submit",loading:U,children:K.length?g===K.length-1?"Speichern":"Weiter":"Speichern"})]}),e[34]=g,e[35]=_,e[36]=U,e[37]=n,e[38]=K.length,e[39]=u):u=e[39];let d;e[40]!==u||e[41]!==C||e[42]!==b?(d=w.jsxs("form",{onSubmit:C,children:[b,u]}),e[40]=u,e[41]=C,e[42]=b,e[43]=d):d=e[43];let m;return e[44]!==d||e[45]!==D?(m=w.jsxs(w.Fragment,{children:[D,d]}),e[44]=d,e[45]=D,e[46]=m):m=e[46],m}function gu(t,e){return t[e.id]=(r,n)=>e.conditional&&!e.conditional(n)||r?null:"Pflichtfeld",t}function mu(t){return t.required}function yu(t,e){return t[e.id]=e.type==="boolean"?!1:e.defaultValue??"",t}function vu(t){return t.step}function bu(t){return typeof t.step=="number"}var[wu,fn]=T.createSafeContext("useDataTableColumnsContext must be used within DataTableColumnProvider"),gs=t=>{let{children:e,columnsOrder:r,setColumnsOrder:n,columnsToggle:s,setColumnsToggle:c,resetColumnsOrder:h,resetColumnsToggle:a,setColumnWidth:g,setMultipleColumnWidths:y,resetColumnsWidth:_}=t,[P,S]=Q.useState(""),[x,k]=Q.useState("");return w.jsx(wu,{value:{sourceColumn:P,setSourceColumn:S,targetColumn:x,setTargetColumn:k,columnsToggle:s,setColumnsToggle:c,swapColumns:()=>{if(!r||!n||!P||!x)return;let O=r.indexOf(P),N=r.indexOf(x);if(O!==-1&&N!==-1){let F=r.splice(O,1)[0];r.splice(N,0,F),n([...r])}},resetColumnsOrder:h,resetColumnsToggle:a,setColumnWidth:g,setMultipleColumnWidths:y,resetColumnsWidth:_},children:e})};function _u(){return w.jsx("tr",{className:"mantine-datatable-empty-row",children:w.jsx("td",{})})}function Cu(){return w.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),w.jsx("path",{d:"M12.983 8.978c3.955 -.182 7.017 -1.446 7.017 -2.978c0 -1.657 -3.582 -3 -8 -3c-1.661 0 -3.204 .19 -4.483 .515m-2.783 1.228c-.471 .382 -.734 .808 -.734 1.257c0 1.22 1.944 2.271 4.734 2.74"}),w.jsx("path",{d:"M4 6v6c0 1.657 3.582 3 8 3c.986 0 1.93 -.067 2.802 -.19m3.187 -.82c1.251 -.53 2.011 -1.228 2.011 -1.99v-6"}),w.jsx("path",{d:"M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4"}),w.jsx("path",{d:"M3 3l18 18"})]})}function xu({icon:t,text:e,active:r,children:n}){return w.jsx(T.Center,{className:"mantine-datatable-empty-state","data-active":r||void 0,children:n||w.jsxs(w.Fragment,{children:[t||w.jsx("div",{className:"mantine-datatable-empty-state-icon",children:w.jsx(Cu,{})}),w.jsx(T.Text,{component:"div",size:"sm",c:"dimmed",children:e})]})})}function Su({key:t,columns:e=[],getInitialValueInEffect:r=!0}){function n(P,S){let x=[];return P.forEach(k=>{S.find(O=>O.accessor===k)&&x.push(k)}),S.forEach(k=>{x.includes(k.accessor)||x.push(k.accessor)}),x}let s=e&&e.map(P=>P.accessor)||[],[c,h]=Le.useLocalStorage({key:t?`${t}-columns-order`:"",defaultValue:t?s:void 0,getInitialValueInEffect:r});function a(P){t&&h(P)}let g=()=>{a(s)};if(!t)return{columnsOrder:c,setColumnsOrder:a,resetColumnsOrder:g};let y=n(c,e),_=JSON.stringify(c);return JSON.stringify(y)!==_&&a(y),{columnsOrder:y,setColumnsOrder:a,resetColumnsOrder:g}}function Du({key:t,columns:e=[],getInitialValueInEffect:r=!0,headerRef:n,onFixedLayoutChange:s}){let c=Q.useRef(!1),h=Q.useRef({}),[a,g]=Q.useState(!0),y=Q.useMemo(()=>e.some(q=>q.resizable&&!q.hidden&&q.accessor!=="__selection__"),[e]),_=Q.useMemo(()=>e.filter(q=>q.resizable&&!q.hidden&&q.accessor!=="__selection__"),[e]),P=Q.useMemo(()=>_.some(q=>q.width===void 0||q.width===""||q.width==="initial"),[_]),S=Q.useCallback(()=>e.filter(q=>q.accessor!=="__selection__").map(q=>({[q.accessor]:q.width??"auto"})),[e]),[x,k]=Le.useLocalStorage({key:t?`${t}-columns-width`:"",defaultValue:t?S():void 0,getInitialValueInEffect:!1}),[O,N]=Q.useState(()=>S());Q.useEffect(()=>{g(!1)},[]);let F=Q.useCallback(()=>{if(!n?.current||a)return{};let q=n.current,H=Array.from(q.querySelectorAll("th[data-accessor]")),W={};return H.forEach(ae=>{let oe=ae.getAttribute("data-accessor");if(!oe||oe==="__selection__")return;let D=_.find(C=>C.accessor===oe);if(D&&(D.width===void 0||D.width===""||D.width==="initial")){let C=ae.getBoundingClientRect();W[oe]=Math.round(C.width)}}),W},[n,_,a]),B=Q.useCallback(q=>{let H=q.filter(ae=>ae.accessor!=="__selection__"),W=O.map(ae=>{let oe=Object.keys(ae)[0],D=H.find(C=>C.accessor===oe);return D?{[oe]:D.width}:ae});N(W),t&&k(W)},[O,t,k]),Z=Q.useCallback(q=>{B(q)},[B]),U=Q.useCallback(()=>{if(!(!n?.current||!s||a))if(P)s(!1),requestAnimationFrame(()=>{requestAnimationFrame(()=>{let q=F();h.current={...h.current,...q};let H=e.filter(W=>W.accessor!=="__selection__").map(W=>{let ae=W.accessor,oe=x?.find(C=>Object.keys(C)[0]===ae);if(oe&&oe[ae]!=="auto")return{[ae]:oe[ae]};let D=q[ae];return D?{[ae]:`${D}px`}:{[ae]:W.width??"auto"}});N(H),setTimeout(()=>{s(!0),c.current=!0},10)})});else{let q=e.filter(H=>H.accessor!=="__selection__").map(H=>({[H.accessor]:H.width??"auto"}));N(q),s(!0),c.current=!0}},[n,s,a,P,F,e,x]),ee=U;Q.useEffect(()=>{if(!y||!s||a){s?.(!1);return}c.current=!1;let q=setTimeout(()=>{U()},50);return()=>clearTimeout(q)},[y,s,a,U]),Q.useEffect(()=>{a||!t||!r||x&&x.length>0&&N(x)},[a,t,r,x]);let re=Q.useCallback(()=>{t&&k(S()),h.current={},c.current=!1,s&&(s(!1),setTimeout(()=>{U()},10))},[t,k,S,s,U]),K=Q.useCallback((q,H)=>{B([{accessor:q,width:H}])},[B]),J=Q.useMemo(()=>y?O.filter(q=>{let H=Object.keys(q)[0];return _.some(W=>W.accessor===H)}).every(q=>{let H=Object.values(q)[0];return H==="auto"||H==="initial"}):!1,[y,O,_]);return{columnsWidth:O,setColumnsWidth:B,setColumnWidth:K,setMultipleColumnWidths:Z,resetColumnsWidth:re,hasResizableColumns:y,allResizableWidthsInitial:J,measureAndSetColumnWidths:ee}}function ku({key:t,columns:e=[],getInitialValueInEffect:r=!0}){function n(P,S){let x=[];return P.forEach(k=>{S.find(O=>O.accessor===k.accessor)&&x.push(k)}),S.forEach(k=>{x.find(O=>O.accessor===k.accessor)||x.push({accessor:k.accessor,defaultToggle:k.defaultToggle||!0,toggleable:k.toggleable,toggled:k.defaultToggle===void 0?!0:k.defaultToggle})}),x}let s=e&&e.map(P=>({accessor:P.accessor,defaultToggle:P.defaultToggle||!0,toggleable:P.toggleable,toggled:P.defaultToggle===void 0?!0:P.defaultToggle})),[c,h]=Le.useLocalStorage({key:t?`${t}-columns-toggle`:"",defaultValue:t?s:void 0,getInitialValueInEffect:r});function a(P){t&&h(P)}let g=()=>{a(s)};if(!t)return{columnsToggle:c,setColumnsToggle:a,resetColumnsToggle:g};let y=n(c,e),_=JSON.stringify(c);return JSON.stringify(y)!==_&&a(y),{columnsToggle:y,setColumnsToggle:a,resetColumnsToggle:g}}var Pu=({key:t,columns:e=[],getInitialValueInEffect:r=!0,headerRef:n,scrollViewportRef:s,onFixedLayoutChange:c})=>{let{columnsOrder:h,setColumnsOrder:a,resetColumnsOrder:g}=Su({key:t,columns:e,getInitialValueInEffect:r}),{columnsToggle:y,setColumnsToggle:_,resetColumnsToggle:P}=ku({key:t,columns:e,getInitialValueInEffect:r}),{columnsWidth:S,setColumnsWidth:x,setColumnWidth:k,setMultipleColumnWidths:O,resetColumnsWidth:N,hasResizableColumns:F,allResizableWidthsInitial:B,measureAndSetColumnWidths:Z}=Du({key:t,columns:e,getInitialValueInEffect:r,headerRef:n,onFixedLayoutChange:c});return{effectiveColumns:Q.useMemo(()=>h?h.map(U=>e.find(ee=>ee.accessor===U)).map(U=>({...U,hidden:U?.hidden||!y.find(ee=>ee.accessor===U?.accessor)?.toggled})).map(U=>U?.accessor==="__selection__"?U:{...U,width:S.find(ee=>ee[U?.accessor])?.[U?.accessor]}):e,[e,h,y,S]),setColumnsOrder:a,columnsOrder:h,resetColumnsOrder:g,columnsToggle:y,setColumnsToggle:_,resetColumnsToggle:P,columnsWidth:S,setColumnsWidth:x,setColumnWidth:k,setMultipleColumnWidths:O,resetColumnsWidth:N,hasResizableColumns:F,allResizableWidthsInitial:B,measureAndSetColumnWidths:Z}},ms=typeof window<"u"?Q.useLayoutEffect:Q.useEffect;function ys(t){let e=Q.useRef(t);return e.current=t,e}var vs="--mantine-datatable-header-height",bs="--mantine-datatable-footer-height",ws="--mantine-datatable-selection-column-width",_s="--mantine-datatable-last-row-border-bottom";function Je(t,e,r){t?.style.setProperty(e,r)}function pn(t){let e=t.borderBoxSize?.[0]||t.contentBoxSize?.[0];return e?{width:e.inlineSize,height:e.blockSize}:{width:t.contentRect.width,height:t.contentRect.height}}function gn(t,e,r){if(t){let n=new ResizeObserver(s=>{let c=s[0];c&&e(pn(c))});return n.observe(t),()=>{n.disconnect(),r()}}}function Mu({scrollCallbacks:t,withRowBorders:e}){let r={root:Q.useRef(null),table:Q.useRef(null),scrollViewport:Q.useRef(null),header:Q.useRef(null),footer:Q.useRef(null),selectionColumnHeader:Q.useRef(null)},{root:n,table:s,scrollViewport:c,header:h,footer:a,selectionColumnHeader:g}=r,y=ys({withRowBorders:e}),_=ys(t),P=Q.useRef(()=>{}),S=Q.useRef(()=>{}),x=Q.useCallback(k=>{_.current.onScroll?.(k),P.current()},[]);return Q.useEffect(()=>gn(h.current,k=>{Je(n.current,vs,`${k.height}px`)},()=>Je(n.current,vs,"0")),[h.current]),Q.useEffect(()=>gn(a.current,k=>{Je(n.current,bs,`${k.height}px`)},()=>Je(n.current,bs,"0")),[a.current]),Q.useEffect(()=>gn(g.current,k=>{Je(n.current,ws,`${k.width}px`)},()=>Je(n.current,ws,"0")),[g.current]),ms(()=>{if(typeof window===void 0)return;let k={top:!0,bottom:!0,left:!0,right:!0},O={width:0,height:0},N={width:0,height:0};function F(re,K){let J=k[re];return k[re]=K,Je(n.current,`--mantine-datatable-${re}-shadow-opacity`,K?"0":"1"),J}function B(){let re=O.height-N.height,K=re<0;Je(n.current,"--mantine-datatable-footer-position",K?"relative":"sticky"),Je(n.current,"--mantine-datatable-footer-bottom",K?`${re}px`:"0")}function Z(){y.current.withRowBorders&&O.height<N.height?Je(n.current,_s,`${T.rem("1px")} solid var(--mantine-datatable-border-color)`):Je(n.current,_s,"unset")}S.current=Z;function U(){let re=_.current,K=c.current,J=K?.scrollTop??0,q=K?.scrollLeft??0,H=J===0,W=O.height-J-N.height<1,ae=F("top",H),oe=F("bottom",W);H&&H!==ae&&re.onScrollToTop?.(),W&&W!==oe&&re.onScrollToBottom?.();let D=K?getComputedStyle(K).direction==="rtl":!1,C=(K?.scrollWidth??0)-N.width,b,u;if(D){let f=Math.abs(q);u=f<1,b=C-f<1}else b=q<1,u=O.width-q-N.width<1;let d=F("left",b),m=F("right",u);b&&b!==d&&re.onScrollToLeft?.(),u&&u!==m&&re.onScrollToRight?.()}P.current=U;let ee=new ResizeObserver(re=>{for(let K of re)switch(K.target.tagName){case"TABLE":{O=pn(K);break}case"DIV":{N=pn(K);break}}U(),B(),Z()});return ee.observe(s.current),ee.observe(c.current),()=>{ee.disconnect()}},[]),ms(()=>{S.current()},[e]),{refs:r,onScroll:x}}function Ou(t){let[e,r]=Q.useState(null),n=t?.join(":")||"";return Q.useEffect(()=>{r(null)},[n]),{lastSelectionChangeIndex:e,setLastSelectionChangeIndex:r}}function Au(t,e){let r=()=>{e(t.map(s=>s.matches))},n=t.map(s=>{try{return s.addEventListener("change",r),()=>s.removeEventListener("change",r)}catch{return s.addListener(r),()=>s.removeListener(r)}});return()=>{n.forEach(s=>s())}}function Eu(t,e){return e||(typeof window<"u"&&"matchMedia"in window?t.map(r=>window.matchMedia(r).matches):t.map(()=>!1))}function Tu(t,e,{getInitialValueInEffect:r}={getInitialValueInEffect:!0}){let[n,s]=Q.useState(r?e:Eu(t,e)),c=Q.useRef(null);return Q.useEffect(()=>{if("matchMedia"in window)return c.current=t.map(h=>window.matchMedia(h)),s(c.current.map(h=>h.matches)),Au(c.current,h=>{s(h)})},[t]),n}function ju(t){let e=T.useMantineTheme(),r=Q.useMemo(()=>t.map(s=>(typeof s=="function"?s(e):s)??""),[t,e]),n=Q.useMemo(()=>t.map(()=>!0),[t]);return Tu(r,n)}function xr(t){let e=T.useMantineTheme(),r=typeof t=="function"?t(e):t;return Le.useMediaQuery(r||"",!0)}function mn(t){let e=t.replace(/([a-z\d])([A-Z]+)/g,"$1 $2").replace(/\W|_/g," ").trim().toLowerCase();return`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function $u(t,e,r){return t.filter(n=>!e.map(r).includes(r(n)))}function yn(t,e){return t.filter((r,n,s)=>n===s.findIndex(c=>e(r)===e(c)))}function Cs(t,e){return e?e.match(/([^[.\]])+/g).reduce((r,n)=>r&&r[n],t):void 0}function Ie(t,e){return typeof e=="string"?Cs(t,e):e(t)}function xs(t){return!t||t.length===0?0:Math.max(...t.map(e=>e.groups&&e.groups.length>0?1+xs(e.groups):1))}function vn(t){let e=[];for(let r of t)r.columns&&r.columns.length>0?e.push(...r.columns.filter(n=>n!=null)):r.groups&&r.groups.length>0&&e.push(...vn(r.groups));return e.filter(r=>r!=null)}function bn(t,e){return t.columns&&t.columns.length>0?t.columns.filter((r,n)=>r.hidden?!1:e?e[n]!==!1:!0).length:t.groups&&t.groups.length>0?t.groups.reduce((r,n)=>r+bn(n,e),0):0}function Ss(t,e,r=0){if(r===e)return[...t];let n=[];for(let s of t)s.groups&&s.groups.length>0&&n.push(...Ss(s.groups,e,r+1));return n}function Ru(t,e,r){return r?!t||e:!1}function Nu({rowExpansion:t,records:e,idAccessor:r}){let n=[];if(t&&e){let{trigger:a,allowMultiple:g,initiallyExpanded:y}=t;e&&a==="always"?n=e.map(_=>Ie(_,r)):y&&(n=e.filter((_,P)=>y({record:_,index:P})).map(_=>Ie(_,r)),g||(n=[n[0]]))}let s,c,h=Q.useState(n);if(t){let{expandable:a,trigger:g,allowMultiple:y,collapseProps:_,content:P}=t;t.expanded?{recordIds:s,onRecordIdsChange:c}=t.expanded:[s,c]=h;let S=x=>c?.(s.filter(k=>k!==Ie(x,r)));return{expandOnClick:g!=="always"&&g!=="never",isRowExpanded:x=>g==="always"?!0:s.includes(Ie(x,r)),isExpandable:({record:x,index:k})=>a?a({record:x,index:k}):!0,expandRow:x=>{let k=Ie(x,r);c?.(y?[...s,k]:[k])},collapseRow:S,collapseProps:_,content:({record:x,index:k})=>()=>P({record:x,index:k,collapse:()=>S(x)})}}}function Lu(t,e){let[r,n]=Q.useState(t),[s,c]=Q.useState(t),h=Le.useTimeout(()=>n(!0),0),a=Le.useTimeout(()=>c(!1),e||200);return Q.useEffect(()=>{t?(a.clear(),c(!0),h.start()):(h.clear(),n(!1),a.start())},[h,a,t]),{expanded:r,visible:s}}var wn="mantine-datatable-nowrap",_n="mantine-datatable-ellipsis",Ot="mantine-datatable-pointer-cursor",Ds="mantine-datatable-context-menu-cursor",Bu="mantine-datatable-text-selection-disabled",Sr="mantine-datatable-text-align-left",Dr="mantine-datatable-text-align-center",kr="mantine-datatable-text-align-right";function Iu({className:t,style:e,visibleMediaQuery:r,title:n,noWrap:s,ellipsis:c,textAlign:h,width:a}){return xr(r)?w.jsx(T.TableTh,{className:Pe({[wn]:s||c,[_n]:c,[Sr]:h==="left",[Dr]:h==="center",[kr]:h==="right"},t),style:[{width:a,minWidth:a,maxWidth:a},e],children:n}):null}function Yu({shadowVisible:t}){return w.jsx(T.TableTh,{className:"mantine-datatable-footer-selector-placeholder-cell","data-shadow-visible":t||void 0})}function zu({className:t,style:e,columns:r,defaultColumnProps:n,selectionVisible:s,selectorCellShadowVisible:c,ref:h}){return w.jsx(T.TableTfoot,{ref:h,className:Pe("mantine-datatable-footer",t),style:e,children:w.jsxs(T.TableTr,{children:[s&&w.jsx(Yu,{shadowVisible:c}),r.map(({hidden:a,...g})=>{if(a)return null;let{accessor:y,visibleMediaQuery:_,textAlign:P,width:S,footer:x,footerClassName:k,footerStyle:O,noWrap:N,ellipsis:F}={...n,...g};return w.jsx(Iu,{className:k,style:O,visibleMediaQuery:_,textAlign:P,width:S,title:x,noWrap:N,ellipsis:F},y)})]})})}function Fu({group:{id:t,columns:e,groups:r,title:n,textAlign:s,className:c,style:h},maxDepth:a,currentDepth:g,previousGroups:y,isLastGroup:_,withColumnBorders:P=!1,totalTableColumns:S}){let x=Q.useMemo(()=>e&&e.length>0?e:r&&r.length>0?vn([{id:t,columns:e,groups:r}]):[],[e,r,t]),k=Q.useMemo(()=>x.map(({visibleMediaQuery:ee})=>ee),[x]),O=ju(k),N=Q.useMemo(()=>bn({columns:e,groups:r},O),[t,e,r,O]),F=Q.useMemo(()=>y.reduce((ee,re)=>ee+bn(re,O),0),[y,O]),B=r&&r.length>0?1:a-g,Z=F+N<S,U=Ru(_,Z,P);return N>0?w.jsx(T.TableTh,{colSpan:N,rowSpan:B>1?B:void 0,className:Pe("mantine-datatable-column-group-header-cell",{[Sr]:s==="left",[Dr]:s==="center",[kr]:s==="right","mantine-datatable-column-group-header-cell--needs-border":U},c),style:h,children:n??mn(t)}):null}function Wu(){return w.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),w.jsx("path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z"})]})}function Uu(){return w.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),w.jsx("path",{d:"M20 3h-16a1 1 0 0 0 -1 1v2.227l.008 .223a3 3 0 0 0 .772 1.795l4.22 4.641v8.114a1 1 0 0 0 1.316 .949l6 -2l.108 -.043a1 1 0 0 0 .576 -.906v-6.586l4.121 -4.12a3 3 0 0 0 .879 -2.123v-2.171a1 1 0 0 0 -1 -1z",strokeWidth:"0",fill:"currentColor"})]})}function qu({children:t,isActive:e,filterPopoverProps:r,filterPopoverDisableClickOutside:n}){let[s,{close:c,toggle:h}]=Le.useDisclosure(!1),a=e?Uu:Wu,g=Le.useClickOutside(c);return n&&(g=void 0),w.jsxs(T.Popover,{withArrow:!0,shadow:"md",opened:s,onClose:c,trapFocus:!0,...r,children:[w.jsx(T.PopoverTarget,{children:w.jsx(T.ActionIcon,{className:"mantine-datatable-header-cell-filter-action-icon","data-active":e||void 0,size:"sm",variant:"default",onClick:y=>{y.preventDefault(),h()},onKeyDown:y=>y.stopPropagation(),children:w.jsx(a,{})})}),w.jsx(T.PopoverDropdown,{ref:g,onClick:y=>y.stopPropagation(),onKeyDown:y=>y.stopPropagation(),children:typeof t=="function"?t({close:c}):t})]})}var Vu=t=>{let{accessor:e,columnRef:r}=t,[n,s]=Q.useState(!1),c=Q.useRef(0),h=Q.useRef({current:0,next:0}),{dir:a}=T.useDirection(),g=a==="rtl",{setMultipleColumnWidths:y}=fn(),_=Q.useCallback(S=>{if(S.preventDefault(),S.stopPropagation(),!r.current)return;let x=r.current,k=x.nextElementSibling;for(;k;){let ee=k.getAttribute("data-accessor");if(ee&&ee!=="__selection__")break;k=k.nextElementSibling}if(!k)return;let O=k.getAttribute("data-accessor");if(!O)return;let N=O==="__selection__";s(!0),c.current=S.clientX;let F=x.offsetWidth,B=k.offsetWidth;h.current={current:F,next:B};let Z=ee=>{if(!r.current)return;let re=r.current,K=re.nextElementSibling;if(!K)return;let J=ee.clientX-c.current;g&&(J=-J);let q=50,H=h.current.current-q,W=h.current.next-q,ae=Math.max(-H,Math.min(J,W)),oe=h.current.current+ae,D=h.current.next-ae;re.style.width=`${oe}px`,K.style.width=`${D}px`,re.style.minWidth=`${oe}px`,re.style.maxWidth=`${oe}px`,K.style.minWidth=`${D}px`,K.style.maxWidth=`${D}px`},U=()=>{if(!r.current)return;let ee=r.current,re=ee.nextElementSibling;s(!1),document.body.style.cursor="initial",document.body.style.userSelect="initial";let K=parseInt(ee.style.width)||ee.offsetWidth,J=re?parseInt(re.style.width)||re.offsetWidth:0,q=[{accessor:e,width:`${K}px`}];if(re&&!N){let H=re.getAttribute("data-accessor");H&&q.push({accessor:H,width:`${J}px`})}setTimeout(()=>{y(q)},0),document.removeEventListener("mousemove",Z),document.removeEventListener("mouseup",U)};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",Z),document.addEventListener("mouseup",U)},[e,r,g,y]),P=Q.useCallback(()=>{if(!r.current)return;let S=r.current,x=S.nextElementSibling;S.style.width="",S.style.minWidth="",S.style.maxWidth="";let k=[{accessor:e,width:"auto"}];if(x){x.style.width="",x.style.minWidth="",x.style.maxWidth="";let O=x.getAttribute("data-accessor");O&&O!=="__selection__"&&k.push({accessor:O,width:"auto"})}setTimeout(()=>{y(k)},0)},[e,r,y]);return w.jsx("div",{className:"mantine-datatable-header-resizable-handle",style:{cursor:n?"col-resize":void 0},onMouseDown:_,onDoubleClick:P,onClick:S=>S.stopPropagation(),title:"Drag to resize column, double-click to reset"})};function Hu(){return w.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),w.jsx("path",{d:"M12 5l0 14"}),w.jsx("path",{d:"M16 9l-4 -4"}),w.jsx("path",{d:"M8 9l4 -4"})]})}function Gu(){return w.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),w.jsx("path",{d:"M8 7l4 -4l4 4"}),w.jsx("path",{d:"M8 17l4 4l4 -4"}),w.jsx("path",{d:"M12 3l0 18"})]})}function Qu(){return w.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),w.jsx("path",{d:"M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),w.jsx("path",{d:"M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),w.jsx("path",{d:"M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),w.jsx("path",{d:"M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),w.jsx("path",{d:"M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),w.jsx("path",{d:"M15 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"})]})}function Zu(){return w.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),w.jsx("path",{d:"M18 6l-12 12"}),w.jsx("path",{d:"M6 6l12 12"})]})}function Ku({className:t,style:e,accessor:r,visibleMediaQuery:n,title:s,sortable:c,draggable:h,toggleable:a,resizable:g,sortIcons:y,textAlign:_,width:P,sortStatus:S,onSortStatusChange:x,filter:k,filterPopoverProps:O,filterPopoverDisableClickOutside:N,filtering:F,sortKey:B}){let{setSourceColumn:Z,setTargetColumn:U,swapColumns:ee,setColumnsToggle:re}=fn(),[K,J]=Q.useState(!1),q=Q.useRef(null);if(!xr(n))return null;let H=s??mn(r),W=typeof H=="string"?H:void 0,ae=c&&x?m=>{m?.defaultPrevented||x({sortKey:B,columnAccessor:r,direction:S?.columnAccessor===r?S.direction==="asc"?"desc":"asc":S?.direction??"asc"})}:void 0,oe=m=>{m.stopPropagation(),Z(r),J(!1)},D=m=>{m.preventDefault(),U(r),J(!0)},C=()=>{U(r),J(!1),ee()},b=()=>{J(!0)},u=()=>{J(!1)},d=m=>{m.stopPropagation(),re(f=>f.map(i=>i.accessor===r?{...i,toggled:!1}:i))};return w.jsxs(T.TableTh,{"data-accessor":r,className:Pe({"mantine-datatable-header-cell-sortable":c,"mantine-datatable-header-cell-toggleable":a,"mantine-datatable-header-cell-resizable":g},t),style:[{width:P,...g?{}:{minWidth:P,maxWidth:P}},e],role:c?"button":void 0,tabIndex:c?0:void 0,onClick:ae,onKeyDown:m=>m.key==="Enter"&&ae?.(),ref:q,children:[w.jsxs(T.Group,{className:"mantine-datatable-header-cell-sortable-group",justify:"space-between",wrap:"nowrap",children:[w.jsxs(T.Flex,{align:"center",w:"100%",className:Pe({"mantine-datatable-header-cell-draggable":h,"mantine-datatable-header-cell-drag-over":K}),draggable:h,onDragStart:h?oe:void 0,onDragEnter:h?b:void 0,onDragOver:h?D:void 0,onDrop:h?C:void 0,onDragLeave:h?u:void 0,children:[h?w.jsx(T.Center,{role:"img","aria-label":"Drag column",children:w.jsx(T.ActionIcon,{className:"mantine-datatable-header-cell-draggable-action-icon",variant:"subtle",size:"xs",onClick:m=>{m.stopPropagation()},children:w.jsx(Qu,{})})}):null,w.jsx(T.Box,{className:Pe("mantine-datatable-header-cell-sortable-text",{[Sr]:_==="left",[Dr]:_==="center",[kr]:_==="right"},wn,_n),title:W,children:H})]}),a?w.jsx(T.Center,{className:"mantine-datatable-header-cell-toggleable-icon",role:"img","aria-label":"Toggle column",children:w.jsx(T.ActionIcon,{size:"xs",variant:"light",onClick:d,children:w.jsx(Zu,{})})}):null,c||S?.columnAccessor===r?w.jsx(w.Fragment,{children:S?.columnAccessor===r?w.jsx(T.Center,{className:Pe("mantine-datatable-header-cell-sortable-icon",{"mantine-datatable-header-cell-sortable-icon-reversed":S.direction==="desc"}),role:"img","aria-label":`Sorted ${S.direction==="desc"?"descending":"ascending"}`,children:y?.sorted||w.jsx(Hu,{})}):w.jsx(T.Center,{className:"mantine-datatable-header-cell-sortable-unsorted-icon",role:"img","aria-label":"Not sorted",children:y?.unsorted||w.jsx(Gu,{})})}):null,k?w.jsx(qu,{filterPopoverProps:O,isActive:!!F,filterPopoverDisableClickOutside:N,children:k}):null]}),g&&r!=="__selection__"?w.jsx(Vu,{accessor:r,columnRef:q}):null]})}function Ju({className:t,style:e,trigger:r,shadowVisible:n,checked:s,indeterminate:c,checkboxProps:h,onChange:a,rowSpan:g,ref:y}){let _=!h.disabled;return w.jsx(T.TableTh,{ref:y,className:Pe("mantine-datatable-header-selector-cell",{[Ot]:r==="cell"&&_},t),style:e,rowSpan:g,"data-shadow-visible":n||void 0,"data-accessor":"__selection__",onClick:r==="cell"&&_?a:void 0,children:w.jsx(T.Checkbox,{classNames:_?{input:Ot}:void 0,checked:s,indeterminate:c,onChange:a,...h,disabled:!(a||h.onChange)||h.disabled})})}function Xu({selectionColumnHeaderRef:t,className:e,style:r,sortStatus:n,sortIcons:s,onSortStatusChange:c,columns:h,defaultColumnProps:a,groups:g,selectionTrigger:y,selectionVisible:_,selectionChecked:P,selectionIndeterminate:S,onSelectionChange:x,selectionCheckboxProps:k,selectorCellShadowVisible:O,selectionColumnClassName:N,selectionColumnStyle:F,withColumnBorders:B=!1,ref:Z}){let U=g?xs(g):0,ee=U>0?U+1:1,re=_?w.jsx(Ju,{ref:t,className:N,style:F,trigger:y,shadowVisible:O,checked:P,indeterminate:S,checkboxProps:k,onChange:x,rowSpan:g?ee:void 0}):null,{columnsToggle:K,setColumnsToggle:J}=fn(),[q,H]=Q.useState(!1),W=h.some(D=>D.toggleable),ae=W?Object.fromEntries(h.map(({accessor:D,title:C})=>[D,C??mn(String(D))])):void 0,oe=w.jsxs(T.TableThead,{className:Pe("mantine-datatable-header",e),style:r,ref:Z,onContextMenu:W?D=>{D.preventDefault(),H(C=>!C)}:void 0,children:[g&&Array.from({length:U},(D,C)=>{let b=Ss(g,C);return w.jsxs(T.TableTr,{children:[C===0&&re,b.map((u,d)=>w.jsx(Fu,{group:u,maxDepth:U,currentDepth:C,previousGroups:b.slice(0,d),isLastGroup:d===b.length-1,withColumnBorders:B,totalTableColumns:h.length},u.id))]},`group-depth-${C}`)}),w.jsxs(T.TableTr,{children:[!g&&re,h.map(({hidden:D,...C},b)=>{if(D)return null;let{accessor:u,visibleMediaQuery:d,textAlign:m,width:f,title:i,sortable:v,draggable:E,toggleable:j,resizable:G,titleClassName:X,titleStyle:te,filter:V,filterPopoverProps:se,filterPopoverDisableClickOutside:ie,filtering:ue,sortKey:A}={...a,...C};return w.jsx(Ku,{accessor:u,className:X,style:te,visibleMediaQuery:d,textAlign:m,width:f,title:i,sortable:v,draggable:E,toggleable:j,resizable:G&&b<h.length-1,sortStatus:n,sortIcons:s,sortKey:A,onSortStatusChange:c,filter:V,filterPopoverProps:se,filterPopoverDisableClickOutside:ie,filtering:ue},u)})]})]});return W?w.jsxs(T.Popover,{position:"bottom",withArrow:!0,shadow:"md",opened:q,onChange:H,children:[w.jsx(T.PopoverTarget,{children:oe}),w.jsx(T.PopoverDropdown,{children:w.jsx(T.Stack,{children:K.filter(D=>D.toggleable).map(D=>w.jsx(T.Group,{children:w.jsx(T.Checkbox,{classNames:{label:"mantine-datatable-header-column-toggle-checkbox-label"},size:"xs",label:ae[D.accessor],checked:D.toggled,onChange:C=>{J(K.map(b=>b.accessor===D.accessor?{...b,toggled:C.currentTarget.checked}:b))}})},D.accessor))})})]}):oe}function ec({fetching:t,customContent:e,backgroundBlur:r,size:n,type:s,color:c}){return w.jsx(T.Center,{className:Pe("mantine-datatable-loader",{"mantine-datatable-loader-fetching":t}),style:[{backdropFilter:r?`blur(${r}px)`:void 0}],children:t&&(e||w.jsx(T.Loader,{size:n,type:s,color:c}))})}function Ee(t,e,r){return t?T.parseThemeColor({color:typeof t=="object"?t[r]:t,theme:e}).value:void 0}function tc({theme:t,c:e,backgroundColor:r,borderColor:n,rowBorderColor:s,stripedColor:c,highlightOnHoverColor:h}){return{"--mantine-datatable-color-light":Ee(e,t,"light"),"--mantine-datatable-color-dark":Ee(e,t,"dark"),"--mantine-datatable-background-color-light":Ee(r,t,"light"),"--mantine-datatable-background-color-dark":Ee(r,t,"dark"),"--mantine-datatable-border-color-light":Ee(n,t,"light"),"--mantine-datatable-border-color-dark":Ee(n,t,"dark"),"--mantine-datatable-row-border-color-light":Ee(s,t,"light"),"--mantine-datatable-row-border-color-dark":Ee(s,t,"dark"),"--mantine-datatable-striped-color-light":Ee(c,t,"light"),"--mantine-datatable-striped-color-dark":Ee(c,t,"dark"),"--mantine-datatable-highlight-on-hover-color-light":Ee(h,t,"light"),"--mantine-datatable-highlight-on-hover-color-dark":Ee(h,t,"dark")}}function ks({theme:t,paginationActiveTextColor:e,paginationActiveBackgroundColor:r}){return{"--mantine-datatable-pagination-active-text-color-light":Ee(e,t,"light"),"--mantine-datatable-pagination-active-text-color-dark":Ee(e,t,"dark"),"--mantine-datatable-pagination-active-background-color-light":Ee(r,t,"light"),"--mantine-datatable-pagination-active-background-color-dark":Ee(r,t,"dark")}}function rc({theme:t,color:e,backgroundColor:r}){return{"--mantine-datatable-row-color-light":Ee(e,t,"light"),"--mantine-datatable-row-color-dark":Ee(e,t,"dark"),"--mantine-datatable-row-background-color-light":Ee(r,t,"light"),"--mantine-datatable-row-background-color-dark":Ee(r,t,"dark")}}function nc(){return w.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),w.jsx("path",{d:"M8 9l4 -4l4 4"}),w.jsx("path",{d:"M16 15l-4 4l-4 -4"})]})}var Ps={xs:T.rem(22),sm:T.rem(26),md:T.rem(32),lg:T.rem(38),xl:T.rem(44)};function oc({size:t,label:e,values:r,value:n,activeTextColor:s,activeBackgroundColor:c,onChange:h}){return w.jsxs(T.Group,{gap:"xs",children:[w.jsx(T.Text,{component:"div",size:t,children:e}),w.jsxs(T.Menu,{withinPortal:!0,withArrow:!0,offset:2,classNames:{arrow:"mantine-datatable-page-size-selector-menu-arrow"},children:[w.jsx(T.MenuTarget,{children:w.jsx(T.Button,{size:t,variant:"default",classNames:{section:"mantine-datatable-page-size-selector-button-icon"},rightSection:w.jsx(nc,{}),style:[{fontWeight:"normal"},a=>({height:Ps[t],paddingLeft:a.spacing[t],paddingRight:a.spacing[t]})],children:n})}),w.jsx(T.MenuDropdown,{children:r.map(a=>{let g=a===n;return w.jsx(T.MenuItem,{className:Pe({"mantine-datatable-page-size-selector-active":g}),style:[{height:Ps[t]},g&&(s||c)?y=>ks({theme:y,paginationActiveTextColor:s,paginationActiveBackgroundColor:c}):void 0],disabled:g,onClick:()=>h(a),children:w.jsx(T.Text,{component:"div",size:t,children:a})},a)})})]})]})}function sc({className:t,style:e,fetching:r,page:n,onPageChange:s,paginationWithEdges:c,paginationWithControls:h,paginationActiveTextColor:a,paginationActiveBackgroundColor:g,paginationSize:y,loadingText:_,noRecordsText:P,paginationText:S,totalRecords:x,recordsPerPage:k,onRecordsPerPageChange:O,recordsPerPageLabel:N,recordsPerPageOptions:F,recordsLength:B,horizontalSpacing:Z,paginationWrapBreakpoint:U,getPaginationControlProps:ee,getPaginationItemProps:re,renderPagination:K}){let J;if(x){let C=(n-1)*k+1,b=C+(B||0)-1;J=S({from:C,to:b,totalRecords:x})}else J=r?_:P;let q=x&&k?Math.max(1,Math.ceil(x/k)):1,H=x?(n-1)*(k??0)+1:void 0,W=x?(H??1)+(B??0)-1:void 0,ae=!xr(({breakpoints:C})=>`(min-width: ${typeof U=="number"?`${T.rem(U)}rem`:C[U]||U})`),oe={Text:C=>w.jsx(T.Text,{component:"div",className:"mantine-datatable-pagination-text",size:y,...C,children:J}),PageSizeSelector:C=>F?w.jsx(oc,{activeTextColor:a,activeBackgroundColor:g,size:y,label:N,values:F,value:k,onChange:O,...C}):w.jsx(w.Fragment,{}),Pagination:C=>w.jsx(T.Pagination,{classNames:{root:Pe("mantine-datatable-pagination-pages",{"mantine-datatable-pagination-pages-fetching":r||!B}),control:"mantine-datatable-pagination-pages-control"},style:a||g?b=>ks({theme:b,paginationActiveTextColor:a,paginationActiveBackgroundColor:g}):void 0,withEdges:c,withControls:h,value:n,onChange:s,size:y,total:q,getControlProps:ee,getItemProps:re,...C})},D={state:{paginationSize:y,page:n,totalPages:q,totalRecords:x,recordsPerPage:k,recordsLength:B,fetching:r,from:H,to:W,isWrapped:ae},actions:{setPage:C=>s?.(C),setRecordsPerPage:O?C=>O(C):void 0},Controls:oe};return w.jsx(T.Box,{px:Z??"xs",py:"xs",className:Pe("mantine-datatable-pagination",t),style:[{flexDirection:ae?"column":"row"},e],children:typeof K=="function"?K(D):w.jsxs(w.Fragment,{children:[w.jsx(oe.Text,{}),w.jsx(oe.PageSizeSelector,{}),w.jsx(oe.Pagination,{})]})})}function ic({className:t,style:e,visibleMediaQuery:r,record:n,index:s,onClick:c,onDoubleClick:h,onContextMenu:a,noWrap:g,ellipsis:y,textAlign:_,width:P,accessor:S,render:x,defaultRender:k,customCellAttributes:O}){return xr(r)?w.jsx(T.TableTd,{className:Pe({[wn]:g||y,[_n]:y,[Ot]:c||h,[Ds]:a,[Sr]:_==="left",[Dr]:_==="center",[kr]:_==="right"},t),style:[{width:P,minWidth:P,maxWidth:P},e],onClick:c,onDoubleClick:h,onContextMenu:a,...O?.(n,s),children:x?x(n,s):k?k(n,s,S):Cs(n,S)}):null}function ac({open:t,colSpan:e,content:r,collapseProps:n}){let{expanded:s,visible:c}=Lu(t,n?.transitionDuration);return c?w.jsxs(w.Fragment,{children:[w.jsx(T.TableTr,{}),w.jsx(T.TableTr,{children:w.jsx(T.TableTd,{className:"mantine-datatable-row-expansion-cell",colSpan:e,children:w.jsx(T.Collapse,{in:s,...n,children:w.jsx("div",{className:"mantine-datatable-row-expansion-cell-content",children:r()})})})})]}):null}function lc({className:t,style:e,record:r,index:n,trigger:s,onChange:c,withRightShadow:h,checkboxProps:a,getCheckboxProps:g,...y}){let _={...a,...g(r,n)},P=!y.disabled&&!_.disabled,S=x=>{x.stopPropagation(),s==="cell"&&P&&c?.(x)};return w.jsx(T.TableTd,{className:Pe("mantine-datatable-row-selector-cell",{[Ot]:s==="cell"&&P},t),style:e,"data-shadow-visible":h||void 0,onClick:S,children:w.jsx(T.Checkbox,{classNames:P?{input:Ot}:void 0,onChange:c,...y,..._})})}function uc({record:t,index:e,columns:r,defaultColumnProps:n,defaultColumnRender:s,selectionTrigger:c,selectionVisible:h,selectionChecked:a,onSelectionChange:g,isRecordSelectable:y,selectionCheckboxProps:_,getSelectionCheckboxProps:P,onClick:S,onDoubleClick:x,onContextMenu:k,onCellClick:O,onCellDoubleClick:N,onCellContextMenu:F,expansion:B,customAttributes:Z,color:U,backgroundColor:ee,className:re,style:K,selectorCellShadowVisible:J,selectionColumnClassName:q,selectionColumnStyle:H,rowFactory:W}){let ae=w.jsxs(w.Fragment,{children:[h&&w.jsx(lc,{className:q,style:H,record:t,index:e,trigger:c,withRightShadow:J,checked:a,disabled:!g||(y?!y(t,e):!1),onChange:g,checkboxProps:_,getCheckboxProps:P}),r.map(({hidden:C,hiddenContent:b,...u},d)=>{if(C||b)return null;let{accessor:m,visibleMediaQuery:f,textAlign:i,noWrap:v,ellipsis:E,width:j,render:G,cellsClassName:X,cellsStyle:te,customCellAttributes:V}={...n,...u};return w.jsx(ic,{className:typeof X=="function"?X(t,e):X,style:te?.(t,e),visibleMediaQuery:f,record:t,index:e,onClick:O?se=>O({event:se,record:t,index:e,column:u,columnIndex:d}):void 0,onDoubleClick:N?se=>N({event:se,record:t,index:e,column:u,columnIndex:d}):void 0,onContextMenu:F?se=>F({event:se,record:t,index:e,column:u,columnIndex:d}):void 0,accessor:m,textAlign:i,noWrap:v,ellipsis:E,width:j,render:G,defaultRender:s,customCellAttributes:V},m)})]}),oe=B&&w.jsx(ac,{colSpan:r.filter(({hidden:C})=>!C).length+(h?1:0),open:B.isRowExpanded(t),content:B.content({record:t,index:e}),collapseProps:B.collapseProps}),D=cc({record:t,index:e,selectionChecked:a,onClick:S,onDoubleClick:x,onContextMenu:k,expansion:B,customAttributes:Z,color:U,backgroundColor:ee,className:re,style:K});return W?W({record:t,index:e,rowProps:D,children:ae,expandedElement:oe}):w.jsxs(w.Fragment,{children:[w.jsx(T.TableTr,{...D,children:ae}),oe]})}function cc({record:t,index:e,selectionChecked:r,onClick:n,onDoubleClick:s,onContextMenu:c,expansion:h,customAttributes:a,color:g,backgroundColor:y,className:_,style:P}){return{className:Pe("mantine-datatable-row",{[Ot]:n||s||h?.isExpandable({record:t,index:e})&&h?.expandOnClick},{[Ds]:c},typeof _=="function"?_(t,e):_),"data-selected":r||void 0,onClick:S=>{if(h){let{isExpandable:x,isRowExpanded:k,expandOnClick:O,expandRow:N,collapseRow:F}=h;x({record:t,index:e})&&O&&(k(t)?F(t):N(t))}n?.({event:S,record:t,index:e})},onDoubleClick:s?S=>s({event:S,record:t,index:e}):void 0,onContextMenu:c?S=>c({event:S,record:t,index:e}):void 0,style:[g||y?S=>{let x=g?.(t,e),k=y?.(t,e);return rc({theme:S,color:x,backgroundColor:k})}:void 0,P?.(t,e)],...a?.(t,e)??{}}}function dc({leftShadowBehind:t,rightShadowBehind:e,onScrollPositionChange:r,children:n,viewportRef:s,scrollAreaProps:c}){return w.jsxs(T.ScrollArea,{...c,viewportRef:s,classNames:{root:"mantine-datatable-scroll-area",scrollbar:"mantine-datatable-scroll-area-scrollbar",thumb:"mantine-datatable-scroll-area-thumb",corner:"mantine-datatable-scroll-area-corner"},onScrollPositionChange:r,children:[n,w.jsx(T.Box,{className:Pe("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-top-shadow")}),w.jsx("div",{className:Pe("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-left-shadow",{"mantine-datatable-scroll-area-shadow-behind":t})}),w.jsx("div",{className:Pe("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-right-shadow",{"mantine-datatable-scroll-area-shadow-behind":e})}),w.jsx(T.Box,{className:Pe("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-bottom-shadow")})]})}function hc({withTableBorder:t,borderRadius:e,textSelectionDisabled:r,height:n="100%",minHeight:s,maxHeight:c,shadow:h,verticalAlign:a="center",fetching:g,columns:y,storeColumnsKey:_,groups:P,pinFirstColumn:S,pinLastColumn:x,defaultColumnProps:k,defaultColumnRender:O,idAccessor:N="id",records:F,selectionTrigger:B="checkbox",selectedRecords:Z,onSelectedRecordsChange:U,selectionColumnClassName:ee,selectionColumnStyle:re,isRecordSelectable:K,selectionCheckboxProps:J,allRecordsSelectionCheckboxProps:q={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:H=(Ae,ut)=>({"aria-label":`Select record ${ut+1}`}),sortStatus:W,sortIcons:ae,onSortStatusChange:oe,horizontalSpacing:D,page:C,onPageChange:b,totalRecords:u,recordsPerPage:d,onRecordsPerPageChange:m,recordsPerPageOptions:f,recordsPerPageLabel:i="Records per page",paginationWithEdges:v,paginationWithControls:E,paginationActiveTextColor:j,paginationActiveBackgroundColor:G,paginationSize:X="sm",paginationText:te=({from:Ae,to:ut,totalRecords:Cn})=>`${Ae} - ${ut} / ${Cn}`,paginationWrapBreakpoint:V="sm",getPaginationControlProps:se=Ae=>Ae==="previous"?{"aria-label":"Previous page"}:Ae==="next"?{"aria-label":"Next page"}:{},getPaginationItemProps:ie,renderPagination:ue,loaderBackgroundBlur:A,customLoader:L,loaderSize:$,loaderType:Y,loaderColor:I,loadingText:de="...",emptyState:o,noRecordsText:l="No records",noRecordsIcon:p,highlightOnHover:M,striped:R,noHeader:z,onRowClick:le,onRowDoubleClick:ce,onRowContextMenu:fe,onCellClick:ne,onCellDoubleClick:pe,onCellContextMenu:me,onScroll:ge,onScrollToTop:xe,onScrollToBottom:Ce,onScrollToLeft:ke,onScrollToRight:qe,c:Re,backgroundColor:_e,borderColor:ot,rowBorderColor:Te,stripedColor:Ve,highlightOnHoverColor:Ye,rowColor:Xe,rowBackgroundColor:st,rowExpansion:je,rowClassName:it,rowStyle:at,customRowAttributes:lt,scrollViewportRef:dt,scrollAreaProps:He,tableRef:Ge,bodyRef:et,m:vt,my:ve,mx:Me,mt:tt,mb:rt,ml:bt,mr:wt,className:At,classNames:Se,style:Oe,styles:nt,rowFactory:Ne,tableWrapper:De,...ze}){let Ae=Q.useMemo(()=>P?vn(P):y,[y,P]),[ut,Cn]=Q.useState(!1),{refs:ct,onScroll:jc}=Mu({scrollCallbacks:{onScroll:ge,onScrollToTop:xe,onScrollToBottom:Ce,onScrollToLeft:ke,onScrollToRight:qe},withRowBorders:ze.withRowBorders}),xn=Pu({key:_,columns:Ae,headerRef:ct.header,scrollViewportRef:ct.scrollViewport,onFixedLayoutChange:Cn}),$c=Le.useMergedRef(ct.table,Ge),Rc=Le.useMergedRef(ct.scrollViewport,dt),Nc=Nu({rowExpansion:je,records:F,idAccessor:N}),Pr=Q.useRef(!1),$s=Q.useRef(C),Sn=Q.useRef(F),Lc=Q.useCallback(be=>{Pr.current=!0,Sn.current=F,b(be)},[b,F]);Q.useEffect(()=>{$s.current!==C&&(Pr.current=!0,Sn.current=F,$s.current=C)},[C,F]);let Mr=F?.length;Q.useLayoutEffect(()=>{if(!Pr.current||g||F===Sn.current)return;let be=ct.scrollViewport.current;if(!be)return;let xt=requestAnimationFrame(()=>{be.scrollTo({top:0,left:0}),Pr.current=!1});return()=>cancelAnimationFrame(xt)},[g,F,ct.scrollViewport]);let Rs=F?.map(be=>Ie(be,N)),Et=!!Z,Gt=Z?.map(be=>Ie(be,N)),Ns=Rs!==void 0&&Gt!==void 0&&Gt.length>0,Dn=K?F?.filter(K):F,Or=Dn?.map(be=>Ie(be,N)),Ar=Ns&&Or.every(be=>Gt.includes(be)),Bc=Ns&&Or.some(be=>Gt.includes(be)),Ic=Q.useCallback(()=>{Z&&U&&U(Ar?Z.filter(be=>!Or.includes(Ie(be,N))):yn([...Z,...Dn],be=>Ie(be,N)))},[Ar,N,U,Or,Dn,Z]),{lastSelectionChangeIndex:Er,setLastSelectionChangeIndex:Yc}=Ou(Rs),kn=Et&&!S,zc={m:vt,my:ve,mx:Me,mt:tt,mb:rt,ml:bt,mr:wt},Fc=Q.useCallback(({children:be})=>De?De({children:be}):be,[De]);return w.jsx(gs,{...xn,children:w.jsxs(T.Box,{ref:ct.root,...zc,className:Pe("mantine-datatable",{"mantine-datatable-with-border":t},At,Se?.root),style:[be=>({...tc({theme:be,c:Re,backgroundColor:_e,borderColor:ot,rowBorderColor:Te,stripedColor:Ve,highlightOnHoverColor:Ye}),borderRadius:be.radius[e]||e,boxShadow:be.shadows[h]||h,height:n,minHeight:s,maxHeight:c}),Oe,nt?.root,{position:"relative"}],children:[w.jsx(dc,{viewportRef:Rc,leftShadowBehind:Et||!!S,rightShadowBehind:x,onScrollPositionChange:jc,scrollAreaProps:He,children:w.jsx(Fc,{children:w.jsxs(T.Table,{ref:$c,horizontalSpacing:D,className:Pe("mantine-datatable-table",{[Bu]:r,"mantine-datatable-vertical-align-top":a==="top","mantine-datatable-vertical-align-bottom":a==="bottom","mantine-datatable-pin-last-column":x,"mantine-datatable-selection-column-visible":Et,"mantine-datatable-pin-first-column":S,"mantine-datatable-resizable-columns":xn.hasResizableColumns&&ut},Se?.table),style:{...nt?.table},"data-striped":Mr&&R||void 0,"data-highlight-on-hover":M||void 0,...ze,children:[z?null:w.jsx(gs,{...xn,children:w.jsx(Xu,{ref:ct.header,selectionColumnHeaderRef:ct.selectionColumnHeader,className:Se?.header,style:nt?.header,columns:Ae,defaultColumnProps:k,groups:P,sortStatus:W,sortIcons:ae,onSortStatusChange:oe,selectionTrigger:B,selectionVisible:Et,selectionChecked:Ar,selectionIndeterminate:Bc&&!Ar,onSelectionChange:Ic,selectionCheckboxProps:{...J,...q},selectorCellShadowVisible:kn,selectionColumnClassName:ee,selectionColumnStyle:re,withColumnBorders:ze.withColumnBorders})}),w.jsx("tbody",{ref:et,children:Mr?F.map((be,xt)=>{let Pn=Ie(be,N),Mn=Gt?.includes(Pn)||!1,Ls;return U&&Z&&(Ls=Wc=>{if(Wc.nativeEvent.shiftKey&&Er!==null){let Tt=F.filter(xt>Er?(St,Dt)=>Dt>=Er&&Dt<=xt&&(K?K(St,Dt):!0):(St,Dt)=>Dt>=xt&&Dt<=Er&&(K?K(St,Dt):!0));U(Mn?$u(Z,Tt,St=>Ie(St,N)):yn([...Z,...Tt],St=>Ie(St,N)))}else U(Mn?Z.filter(Tt=>Ie(Tt,N)!==Pn):yn([...Z,be],Tt=>Ie(Tt,N)));Yc(xt)}),w.jsx(uc,{record:be,index:xt,columns:Ae,defaultColumnProps:k,defaultColumnRender:O,selectionTrigger:B,selectionVisible:Et,selectionChecked:Mn,onSelectionChange:Ls,isRecordSelectable:K,selectionCheckboxProps:J,getSelectionCheckboxProps:H,onClick:le,onDoubleClick:ce,onCellClick:ne,onCellDoubleClick:pe,onContextMenu:fe,onCellContextMenu:me,expansion:Nc,color:Xe,backgroundColor:st,className:it,style:at,customAttributes:lt,selectorCellShadowVisible:kn,selectionColumnClassName:ee,selectionColumnStyle:re,idAccessor:N,rowFactory:Ne},Pn)}):w.jsx(_u,{})}),Ae.some(({footer:be})=>be)&&w.jsx(zu,{ref:ct.footer,className:Se?.footer,style:nt?.footer,columns:Ae,defaultColumnProps:k,selectionVisible:Et,selectorCellShadowVisible:kn})]})})}),C&&w.jsx(sc,{className:Se?.pagination,style:nt?.pagination,horizontalSpacing:D,fetching:g,page:C,onPageChange:Lc,totalRecords:u,recordsPerPage:d,onRecordsPerPageChange:m,recordsPerPageOptions:f,recordsPerPageLabel:i,paginationWithEdges:v,paginationWithControls:E,paginationActiveTextColor:j,paginationActiveBackgroundColor:G,paginationSize:X,paginationText:te,paginationWrapBreakpoint:V,getPaginationControlProps:se,getPaginationItemProps:ie,noRecordsText:l,loadingText:de,recordsLength:Mr,renderPagination:ue}),w.jsx(ec,{fetching:g,backgroundBlur:A,customContent:L,size:$,type:Y,color:I}),w.jsx(xu,{icon:p,text:l,active:!g&&!Mr,children:o})]})})}function Ms(t){const e=Qe.c(41),{fields:r,onClose:n,queryKey:s,apiPath:c,id:h,steps:a}=t,[g,y]=Q.useState(0),[_,P]=Q.useState(!1),{data:S,isLoading:x}=Wo(c,s,h),{mutateAsync:k,isError:O,error:N,isPending:F}=sn(c,s);let B;e[0]!==r?(B=new Set(r.filter(vc).map(yc)),e[0]=r,e[1]=B):B=e[1];let Z;e[2]!==B?(Z=[...B],e[2]=B,e[3]=Z):Z=e[3];const U=Z;let ee;e[4]!==r?(ee=r.reduce(mc,{}),e[4]=r,e[5]=ee):ee=e[5];let re;e[6]!==r?(re=r.filter(gc).reduce(pc,{}),e[6]=r,e[7]=re):re=e[7];let K;e[8]!==ee||e[9]!==re?(K={mode:"uncontrolled",initialValues:ee,validate:re},e[8]=ee,e[9]=re,e[10]=K):K=e[10];const J=On.useForm(K);let q;e[11]!==S||e[12]!==r||e[13]!==J?(q=()=>{if(S){const b={...S};r.forEach(u=>{const d=u.id;u.type==="boolean"&&b[d]===null?b[d]=!1:u.type==="date"&&b[d]?b[d]=new Date(b[d]):b[d]===null&&(b[d]="")}),J.initialize(b),J.setValues(b)}},e[11]=S,e[12]=r,e[13]=J,e[14]=q):q=e[14];let H;e[15]!==S?(H=[S],e[15]=S,e[16]=H):H=e[16],Q.useEffect(q,H);let W;e[17]!==J||e[18]!==h?(W=function(u){const d=J.getValues();return u.conditional&&!u.conditional(d)?null:w.jsxs(Q.Fragment,{children:[(u.type===void 0||u.type=="text")&&w.jsx(T.TextInput,{label:u.column.title,placeholder:u.placeholder??"",...J.getInputProps(u.id),type:u.id.includes("email")?"email":void 0,required:u.required},J.key(u.id)),u.type==="number"&&w.jsx(T.NumberInput,{decimalSeparator:",",label:u.column.title,placeholder:u.placeholder??"",...J.getInputProps(u.id),required:u.required},J.key(u.id)),u.type==="date"&&w.jsx(Cr,{label:u.column.title,placeholder:u.placeholder??"",valueFormat:"DD.MM.YYYY",clearable:!0,...J.getInputProps(u.id),required:u.required},J.key(u.id)),u.type==="boolean"&&w.jsx(T.Checkbox,{mt:"md",label:u.column.title,...J.getInputProps(u.id,{type:"checkbox"}),required:u.required},J.key(u.id)),u.type==="textarea"&&w.jsx(T.Textarea,{label:u.column.title,placeholder:u.placeholder??"",...J.getInputProps(u.id),minRows:3,autosize:!0,required:u.required},J.key(u.id)),u.type==="custom"&&u.render&&u.render({...J.getValues(),id:h},J.setValues,P,{error:J.getInputProps(u.id).error,required:u.required})]},u.id)},e[17]=J,e[18]=h,e[19]=W):W=e[19];const ae=W;let oe;e[20]!==O||e[21]!==N?.message||e[22]!==N?.name?(oe=O&&w.jsx(T.Alert,{variant:"outline",color:"red",title:N?.name??"Fehler aufgetreten",mb:"lg",children:N?.message??"Fehler aufgetreten"}),e[20]=O,e[21]=N?.message,e[22]=N?.name,e[23]=oe):oe=e[23];let D;e[24]!==g||e[25]!==r||e[26]!==J||e[27]!==_||e[28]!==h||e[29]!==x||e[30]!==F||e[31]!==O||e[32]!==n||e[33]!==ae||e[34]!==a||e[35]!==U||e[36]!==k?(D=x?w.jsxs(T.Stack,{gap:"md",children:[w.jsx(T.Skeleton,{height:40}),Array(r.length).fill(0).map(fc),w.jsxs(T.Group,{mt:"md",justify:"end",children:[w.jsx(T.Skeleton,{width:100,height:36}),w.jsx(T.Skeleton,{width:100,height:36})]})]}):w.jsxs("form",{onSubmit:J.onSubmit(async b=>{await k({...b,id:h}),U.length&&g<U.length-1?O||y(g+1):O||(J.setInitialValues(b),J.reset(),n())}),children:[U.length?w.jsx(T.Stepper,{active:g,size:"sm",children:U.map(b=>w.jsx(T.Stepper.Step,{...a&&a[b-1]?{label:a[b-1].label}:{},children:r.filter(u=>u.step===b).map(u=>ae(u))},b))}):r.map(b=>ae(b)),!_&&w.jsxs(T.Group,{mt:"md",justify:"end",children:[w.jsx(T.Button,{onClick:()=>U.length?g===0?n():y(g-1):n(),variant:"outline",children:U.length?g===0?"Abbrechen":"Zurück":"Abbrechen"}),w.jsx(T.Button,{type:"submit",loading:F,children:U.length?g===U.length-1?"Speichern":"Weiter":"Speichern"})]})]}),e[24]=g,e[25]=r,e[26]=J,e[27]=_,e[28]=h,e[29]=x,e[30]=F,e[31]=O,e[32]=n,e[33]=ae,e[34]=a,e[35]=U,e[36]=k,e[37]=D):D=e[37];let C;return e[38]!==D||e[39]!==oe?(C=w.jsxs(w.Fragment,{children:[oe,D]}),e[38]=D,e[39]=oe,e[40]=C):C=e[40],C}function fc(t,e){return w.jsx(T.Skeleton,{height:35},`skeleton-field-${e}`)}function pc(t,e){return t[e.id]=(r,n)=>e.conditional&&!e.conditional(n)||r?null:"Pflichtfeld",t}function gc(t){return t.required}function mc(t,e){return t[e.id]=e.type==="boolean"?e.defaultValue??!1:e.defaultValue??"",t}function yc(t){return t.step}function vc(t){return typeof t.step=="number"}function Os({queryKey:t,apiPath:e,onClose:r,selectedRecords:n}){const{mutateAsync:s,isError:c,error:h,isPending:a}=Vo(e,t),[g,y]=Q.useState(n),[_,P]=Q.useState(!1),S=_||a;return Q.useEffect(()=>{g.length||r()},[r,g]),g.length?w.jsxs(w.Fragment,{children:[c&&h.message&&w.jsx(T.Alert,{variant:"outline",color:"red",title:h.name,children:h.message}),w.jsx(T.Text,{children:g.length===1?`Soll ${g.length} Eintrag wirklich gelöscht werden?`:`Sollen ${g.length} Einträge wirklich gelöscht werden?`}),w.jsxs(T.Group,{mt:"md",justify:"end",children:[w.jsx(T.Button,{onClick:r,variant:"outline",disabled:S,children:"Abbrechen"}),w.jsx(T.Button,{color:"red",loading:S,onClick:async()=>{P(!0);try{await Promise.all(g.map(x=>s(x.id))),y([])}finally{P(!1)}},children:"Löschen"})]})]}):w.jsx(w.Fragment,{})}function As(t,e){const r=Qe.c(8);let n;r[0]!==t||r[1]!==e?(n=()=>{const y=localStorage.getItem(`use_persistent_storage_${e}`);return y?JSON.parse(y):t},r[0]=t,r[1]=e,r[2]=n):n=r[2];const[s,c]=Q.useState(n);let h;r[3]!==e?(h=y=>{c(y),localStorage.setItem(`use_persistent_storage_${e}`,JSON.stringify(y))},r[3]=e,r[4]=h):h=r[4];const a=h;let g;return r[5]!==a||r[6]!==s?(g=[s,a],r[5]=a,r[6]=s,r[7]=g):g=r[7],g}const bc=(t,e)=>{const r=t.map(g=>g[e]).filter(g=>g!=null&&g!=="");if(r.length===0)return"string";const n=Math.min(100,r.length),s=r.slice(0,n),c={string:0,number:0,date:0},h=[/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/,/^\d{4}-\d{2}-\d{2}$/,/^\d{1,2}\/\d{1,2}\/\d{4}$/,/^\d{1,2}\.\d{1,2}\.\d{4}$/];s.forEach(g=>{if(typeof g=="number")c.number++;else if(typeof g=="string"){const y=g.trim();if(y!==""&&!isNaN(Number(y))&&!isNaN(parseFloat(y))){c.number++;return}if(h.some(_=>_.test(y))){const _=new Date(y);if(!isNaN(_.getTime())){c.date++;return}}c.string++}else g instanceof Date?c.date++:c.string++});const a=c.string+c.number+c.date;return c.date/a>=.6?"date":c.number/a>=.6?"number":c.string/a>=.6?"string":"mixed"},Es=new Map,Ts=(t,e,r="asc")=>{if(!t||t.length===0)return[];const n=`${String(e)}_${t.length}`;let s=Es.get(n);return s||(s=bc(t,e),Es.set(n,s)),[...t].sort((h,a)=>{const g=h[e],y=a[e],_=g==null||g==="",P=y==null||y==="";if(_&&P)return 0;if(_)return r==="asc"?-1:1;if(P)return r==="asc"?1:-1;let S,x;switch(s){case"date":if(typeof g=="string"){const B=new Date(g.trim());S=isNaN(B.getTime())?null:B.getTime()}else g instanceof Date?S=g.getTime():S=null;if(typeof y=="string"){const B=new Date(y.trim());x=isNaN(B.getTime())?null:B.getTime()}else y instanceof Date?x=y.getTime():x=null;break;case"number":if(typeof g=="number")S=g;else{const B=String(g).trim(),Z=parseFloat(B);S=isNaN(Z)?null:Z}if(typeof y=="number")x=y;else{const B=String(y).trim(),Z=parseFloat(B);x=isNaN(Z)?null:Z}break;case"string":const k=typeof g=="string"?g:String(g),O=typeof y=="string"?y:String(y);S=k.toLowerCase().trim(),x=O.toLowerCase().trim();break;case"mixed":default:const N=String(g),F=String(y);S=N.toLowerCase().trim(),x=F.toLowerCase().trim();break}return S===null&&x===null?0:S===null?r==="asc"?1:-1:x===null||S<x?r==="asc"?-1:1:S>x?r==="asc"?1:-1:0})},js=[10,15,50,100,500];function wc(t){const e=Qe.c(114),{title:r,queryKey:n,connectedQueryKeys:s,apiPath:c,mutationApiPath:h,buttons:a,fields:g,selection:y,pagination:_,filters:P,actions:S,steps:x,defaultSort:k,onSortChange:O,createButtonText:N,queryParams:F,tabs:B,defaultTab:Z,activeTab:U,onActiveTabChange:ee,canUpdate:re,canDelete:K,showRefresh:J,rowExpansion:q,onRowClick:H}=t,W=J===void 0?!0:J,[ae,oe]=Q.useState(Z||(B&&B.length>0?B[0].value:null)),D=U!==void 0?U:ae;let C;e[0]!==U||e[1]!==ee?(C=Se=>{U===void 0&&oe(Se),ee&&ee(Se)},e[0]=U,e[1]=ee,e[2]=C):C=e[2];const b=C,u=B?.find(Se=>Se.value===D)?.queryParams||{},d={...F,...u},m=d?"?"+Object.entries(d).filter(Ec).map(Ac).join("&"):"";let f;e[3]!==D||e[4]!==n?(f=D?[...n,D]:n,e[3]=D,e[4]=n,e[5]=f):f=e[5];const i=f,{data:v,isLoading:E,isError:j,isRefetching:G,refetch:X}=Uo(c+m,i),{queryClient:te}=pt();let V,se;e[6]!==v||e[7]!==s||e[8]!==te?(V=()=>{!v||!Array.isArray(v)||s?.forEach(Se=>te.invalidateQueries({queryKey:Se}))},se=[v,s,te],e[6]=v,e[7]=s,e[8]=te,e[9]=V,e[10]=se):(V=e[9],se=e[10]),Q.useEffect(V,se);const ie=!v||!Array.isArray(v)?[]:!P||P.length===0?v:v.filter(Se=>P.every(Oe=>{if(Oe.value===void 0)return!0;const nt=Oe.id;if(Oe.type==="query"){const Ne=Se[nt];return Array.isArray(Oe.value)?Array.isArray(Ne)?Ne.some(De=>{if(typeof De=="string"||typeof De=="number")return Oe.value.includes(String(De));if(De&&typeof De=="object"){if("id"in De&&Oe.value.includes(De.id))return!0;for(const ze in De){const Ae=De[ze];if(typeof Ae=="string"&&Oe.value.includes(Ae)||Ae&&typeof Ae=="object"&&"id"in Ae&&Oe.value.includes(Ae.id))return!0}}return!1}):Ne&&typeof Ne=="object"&&"id"in Ne?Oe.value.includes(Ne.id):!1:typeof Ne=="string"&&Ne.includes(Oe.value)}else if(Oe.type==="date"){const Ne=Oe.value;if(!Ne)return!0;const[De,ze]=Ne;if(!De&&!ze)return!0;const Ae=Se[nt];if(typeof Ae=="string"){const ut=Ae.split(" ")[0];if(De&&ze)return ut>=De&&ut<=ze;if(De&&!ze)return ut>=De;if(!De&&ze)return ut<=ze}return!0}else if(Oe.type==="boolean")return Se[nt]===Oe.value;return!0})),ue=k?.field??g[0].id,A=k?.direction??"desc";let L;e[11]!==ue||e[12]!==A?(L={columnAccessor:ue,direction:A},e[11]=ue,e[12]=A,e[13]=L):L=e[13];const[$,Y]=Q.useState(L);let I;e[14]!==O?(I=Se=>{Y(Se),O&&O(String(Se.columnAccessor),Se.direction)},e[14]=O,e[15]=I):I=e[15];const de=I,o=Ts(ie,$.columnAccessor,$.direction),[l,p]=As(js[1],"mantine-table-page-size"),[M,R]=Q.useState(1),z=_?o.slice((M-1)*l,M*l):o;let le;e[16]===Symbol.for("react.memo_cache_sentinel")?(le=[],e[16]=le):le=e[16];const[ce,fe]=Q.useState(le);let ne;e[17]===Symbol.for("react.memo_cache_sentinel")?(ne=()=>{fe([])},e[17]=ne):ne=e[17];let pe;e[18]!==D?(pe=[D],e[18]=D,e[19]=pe):pe=e[19],Q.useEffect(ne,pe);const[me,ge]=Q.useState(!1),[xe,Ce]=Q.useState(!1),[ke,qe]=Q.useState(!1),Re=r?"space-between":"end";let _e;e[20]!==r?(_e=r&&(typeof r=="string"?w.jsx(T.Title,{order:4,children:r}):r),e[20]=r,e[21]=_e):_e=e[21];let ot;e[22]!==X||e[23]!==W?(ot=W&&w.jsx(T.ActionIcon,{variant:"subtle",onClick:()=>X(),"aria-label":"Neuladen",children:w.jsx(jt.IconRefresh,{})}),e[22]=X,e[23]=W,e[24]=ot):ot=e[24];let Te;e[25]!==S||e[26]!==K||e[27]!==re||e[28]!==g||e[29]!==ce||e[30]!==y?(Te=(g.some(Oc)||y)&&(()=>{const Se=g.find(Mc)&&(!re||ce.length>0&&re(ce[0])),Oe=g.find(Pc)&&(!K||ce.length>0&&K(ce[0])),nt=(S??[]).length>0,Ne=Se||Oe||nt;return w.jsxs(T.Menu,{shadow:"md",children:[w.jsx(T.Menu.Target,{children:w.jsx(T.Button,{variant:"outline",rightSection:w.jsx(jt.IconCaretDownFilled,{size:14}),disabled:!ce.length||!Ne,children:"Aktionen"})}),w.jsxs(T.Menu.Dropdown,{children:[Se&&w.jsx(T.Menu.Item,{leftSection:w.jsx(jt.IconPencil,{size:14}),onClick:()=>Ce(!0),disabled:ce.length!==1,children:"Bearbeiten"}),(S??[]).map((De,ze)=>Q.createElement(T.Menu.Item,{...De.icon&&{leftSection:De.icon},key:`custom_action_${ze}`,onClick:()=>De.onClick(ce)},De.label)),Oe&&w.jsx(T.Menu.Item,{leftSection:w.jsx(jt.IconTrash,{size:14}),onClick:()=>qe(!0),color:"red",children:"Löschen"})]})]})})(),e[25]=S,e[26]=K,e[27]=re,e[28]=g,e[29]=ce,e[30]=y,e[31]=Te):Te=e[31];let Ve;e[32]!==N||e[33]!==g||e[34]!==E?(Ve=g.find(kc)&&w.jsx(T.Button,{onClick:()=>ge(!0),disabled:E,children:N??"Erstellen"}),e[32]=N,e[33]=g,e[34]=E,e[35]=Ve):Ve=e[35];let Ye;e[36]!==a||e[37]!==ot||e[38]!==Te||e[39]!==Ve?(Ye=w.jsxs(T.Group,{align:"center",gap:"xs",children:[ot,Te,Ve,a]}),e[36]=a,e[37]=ot,e[38]=Te,e[39]=Ve,e[40]=Ye):Ye=e[40];let Xe;e[41]!==Re||e[42]!==_e||e[43]!==Ye?(Xe=w.jsxs(T.Group,{gap:"xs",justify:Re,align:"center",children:[_e,Ye]}),e[41]=Re,e[42]=_e,e[43]=Ye,e[44]=Xe):Xe=e[44];let st;e[45]!==D||e[46]!==b||e[47]!==B?(st=B&&B.length>0&&w.jsx(T.Tabs,{value:D,onChange:b,mt:"md",children:w.jsx(T.Tabs.List,{children:B.map(Dc)})}),e[45]=D,e[46]=b,e[47]=B,e[48]=st):st=e[48];let je;e[49]!==j?(je=j&&w.jsx(T.Alert,{mt:"md",variant:"light",color:"red",title:"Es ist ein Fehler aufgetreten.",icon:w.jsx(jt.IconInfoCircle,{}),children:"Bitte versuche es später erneut oder sende eine Nachricht an unseren Support."}),e[49]=j,e[50]=je):je=e[50];let it;e[51]!==E||e[52]!==G?(it=(E||G)&&w.jsxs(T.Stack,{my:"md",children:[w.jsx(T.Skeleton,{height:40}),Array(5).fill(0).map(Sc)]}),e[51]=E,e[52]=G,e[53]=it):it=e[53];let at;e[54]!==g||e[55]!==de||e[56]!==j||e[57]!==E||e[58]!==G||e[59]!==H||e[60]!==M||e[61]!==l||e[62]!==_||e[63]!==z||e[64]!==q||e[65]!==ce||e[66]!==y||e[67]!==R||e[68]!==p||e[69]!==$||e[70]!==o?(at=!E&&!G&&w.jsx(hc,{my:"md",striped:!0,highlightOnHover:!0,minHeight:150,fetching:j,records:z,sortStatus:$,onSortStatusChange:de,...y&&{selectedRecords:ce,onSelectedRecordsChange:fe},..._&&z.length&&{totalRecords:o.length,recordsPerPage:l,onPageChange:R,page:M,recordsPerPageOptions:js,onRecordsPerPageChange:p,recordsPerPageLabel:"Einträge pro Seite"},...q&&{rowExpansion:{allowMultiple:q.allowMultiple??!1,content:Se=>{const{record:Oe}=Se;return q.content(Oe)},...q.expanded&&{expanded:q.expanded}}},columns:g.map(xc),noRecordsText:"Keine Einträge gefunden",onRowClick:H,...H&&{style:{cursor:"pointer"}}}),e[54]=g,e[55]=de,e[56]=j,e[57]=E,e[58]=G,e[59]=H,e[60]=M,e[61]=l,e[62]=_,e[63]=z,e[64]=q,e[65]=ce,e[66]=y,e[67]=R,e[68]=p,e[69]=$,e[70]=o,e[71]=at):at=e[71];let lt;e[72]===Symbol.for("react.memo_cache_sentinel")?(lt=()=>{Ce(!1),fe([])},e[72]=lt):lt=e[72];const dt=r??"Bearbeiten";let He;e[73]!==c||e[74]!==g||e[75]!==h||e[76]!==n||e[77]!==ce[0]||e[78]!==ce.length||e[79]!==x?(He=ce.length>0&&w.jsx(Ms,{fields:g.filter(Cc),queryKey:n,apiPath:h??c,id:ce[0].id,onClose:()=>{Ce(!1),fe([])},steps:x}),e[73]=c,e[74]=g,e[75]=h,e[76]=n,e[77]=ce[0],e[78]=ce.length,e[79]=x,e[80]=He):He=e[80];let Ge;e[81]!==dt||e[82]!==He||e[83]!==xe?(Ge=w.jsx(T.Modal,{opened:xe,onClose:lt,title:dt,children:He}),e[81]=dt,e[82]=He,e[83]=xe,e[84]=Ge):Ge=e[84];let et;e[85]!==c||e[86]!==ke||e[87]!==h||e[88]!==n||e[89]!==ce||e[90]!==r?(et=ce.length>0&&w.jsx(T.Modal,{opened:ke,onClose:()=>{qe(!1),fe([])},title:r??"Löschen",children:w.jsx(Os,{onClose:()=>{qe(!1),fe([])},queryKey:n,apiPath:h??c,selectedRecords:ce})}),e[85]=c,e[86]=ke,e[87]=h,e[88]=n,e[89]=ce,e[90]=r,e[91]=et):et=e[91];let vt;e[92]===Symbol.for("react.memo_cache_sentinel")?(vt=()=>{ge(!1)},e[92]=vt):vt=e[92];const ve=r??"Anlegen",Me=h??c;let tt;e[93]===Symbol.for("react.memo_cache_sentinel")?(tt=()=>{ge(!1)},e[93]=tt):tt=e[93];let rt;e[94]!==g?(rt=g.filter(_c),e[94]=g,e[95]=rt):rt=e[95];let bt;e[96]!==n||e[97]!==x||e[98]!==Me||e[99]!==rt?(bt=w.jsx(ps,{queryKey:n,apiPath:Me,onClose:tt,fields:rt,steps:x}),e[96]=n,e[97]=x,e[98]=Me,e[99]=rt,e[100]=bt):bt=e[100];let wt;e[101]!==me||e[102]!==ve||e[103]!==bt?(wt=w.jsx(T.Modal,{opened:me,onClose:vt,title:ve,children:bt}),e[101]=me,e[102]=ve,e[103]=bt,e[104]=wt):wt=e[104];let At;return e[105]!==Xe||e[106]!==st||e[107]!==je||e[108]!==it||e[109]!==at||e[110]!==Ge||e[111]!==et||e[112]!==wt?(At=w.jsxs(w.Fragment,{children:[Xe,st,je,it,at,Ge,et,wt]}),e[105]=Xe,e[106]=st,e[107]=je,e[108]=it,e[109]=at,e[110]=Ge,e[111]=et,e[112]=wt,e[113]=At):At=e[113],At}function _c(t){return t.create}function Cc(t){return t.update}function xc(t){return t.column}function Sc(t,e){return w.jsx(T.Skeleton,{height:35},`skeleton-${e}`)}function Dc(t){return w.jsx(T.Tabs.Tab,{value:t.value,leftSection:t.icon,children:t.label},t.value)}function kc(t){return t.create}function Pc(t){return t.delete}function Mc(t){return t.update}function Oc(t){return t.update}function Ac(t){const[e,r]=t;return`${e}=${encodeURIComponent(r??"")}`}function Ec(t){const[,e]=t;return e!=null}function Tc(t){const e=Qe.c(5),{queryClient:r}=pt();let n;e[0]!==t?(n=w.jsx(wc,{...t}),e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==r||e[3]!==n?(s=w.jsx(Gn,{client:r,children:n}),e[2]=r,e[3]=n,e[4]=s):s=e[4],s}we.CreateModal=ps,we.DataTable=Tc,we.DataTableProvider=pl,we.DeleteModal=Os,we.UpdateModal=Ms,we.api=ml,we.createOne=zo,we.deleteOne=Yo,we.getAll=Bo,we.getApiHeaders=Ct,we.getOne=Io,we.sortData=Ts,we.updateOne=Fo,we.useAddOne=qo,we.useDataTable=pt,we.useDeleteOne=Vo,we.useGetAll=Uo,we.useGetOne=Wo,we.usePersistentState=As,we.useUpdateOne=sn,Object.defineProperty(we,Symbol.toStringTag,{value:"Module"})}));
|
|
19
|
+
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),r.useMemoCache(e)}})()),no}var so;function Di(){return so||(so=1,process.env.NODE_ENV==="production"?zr.exports=xi():zr.exports=Si()),zr.exports}Di();var io={},It={},ao;function ki(){if(ao)return It;ao=1,It.byteLength=i,It.toByteArray=v,It.fromByteArray=S;for(var t=[],e=[],r=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=n.length;s<u;++s)t[s]=n[s],e[n.charCodeAt(s)]=s;e[45]=62,e[95]=63;function d(x){var P=x.length;if(P%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var A=x.indexOf("=");A===-1&&(A=P);var N=A===P?0:4-A%4;return[A,N]}function i(x){var P=d(x),A=P[0],N=P[1];return(A+N)*3/4-N}function m(x,P,A){return(P+A)*3/4-A}function v(x){var P,A=d(x),N=A[0],F=A[1],B=new r(m(x,N,F)),Q=0,U=F>0?N-4:N,ee;for(ee=0;ee<U;ee+=4)P=e[x.charCodeAt(ee)]<<18|e[x.charCodeAt(ee+1)]<<12|e[x.charCodeAt(ee+2)]<<6|e[x.charCodeAt(ee+3)],B[Q++]=P>>16&255,B[Q++]=P>>8&255,B[Q++]=P&255;return F===2&&(P=e[x.charCodeAt(ee)]<<2|e[x.charCodeAt(ee+1)]>>4,B[Q++]=P&255),F===1&&(P=e[x.charCodeAt(ee)]<<10|e[x.charCodeAt(ee+1)]<<4|e[x.charCodeAt(ee+2)]>>2,B[Q++]=P>>8&255,B[Q++]=P&255),B}function _(x){return t[x>>18&63]+t[x>>12&63]+t[x>>6&63]+t[x&63]}function M(x,P,A){for(var N,F=[],B=P;B<A;B+=3)N=(x[B]<<16&16711680)+(x[B+1]<<8&65280)+(x[B+2]&255),F.push(_(N));return F.join("")}function S(x){for(var P,A=x.length,N=A%3,F=[],B=16383,Q=0,U=A-N;Q<U;Q+=B)F.push(M(x,Q,Q+B>U?U:Q+B));return N===1?(P=x[A-1],F.push(t[P>>2]+t[P<<4&63]+"==")):N===2&&(P=(x[A-2]<<8)+x[A-1],F.push(t[P>>10]+t[P>>4&63]+t[P<<2&63]+"=")),F.join("")}return It}var Wr={};var lo;function Pi(){return lo||(lo=1,Wr.read=function(t,e,r,n,s){var u,d,i=s*8-n-1,m=(1<<i)-1,v=m>>1,_=-7,M=r?s-1:0,S=r?-1:1,x=t[e+M];for(M+=S,u=x&(1<<-_)-1,x>>=-_,_+=i;_>0;u=u*256+t[e+M],M+=S,_-=8);for(d=u&(1<<-_)-1,u>>=-_,_+=n;_>0;d=d*256+t[e+M],M+=S,_-=8);if(u===0)u=1-v;else{if(u===m)return d?NaN:(x?-1:1)*(1/0);d=d+Math.pow(2,n),u=u-v}return(x?-1:1)*d*Math.pow(2,u-n)},Wr.write=function(t,e,r,n,s,u){var d,i,m,v=u*8-s-1,_=(1<<v)-1,M=_>>1,S=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=n?0:u-1,P=n?1:-1,A=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(i=isNaN(e)?1:0,d=_):(d=Math.floor(Math.log(e)/Math.LN2),e*(m=Math.pow(2,-d))<1&&(d--,m*=2),d+M>=1?e+=S/m:e+=S*Math.pow(2,1-M),e*m>=2&&(d++,m/=2),d+M>=_?(i=0,d=_):d+M>=1?(i=(e*m-1)*Math.pow(2,s),d=d+M):(i=e*Math.pow(2,M-1)*Math.pow(2,s),d=0));s>=8;t[r+x]=i&255,x+=P,i/=256,s-=8);for(d=d<<s|i,v+=s;v>0;t[r+x]=d&255,x+=P,d/=256,v-=8);t[r+x-P]|=A*128}),Wr}var Ur,uo;function Mi(){if(uo)return Ur;uo=1;var t={}.toString;return Ur=Array.isArray||function(e){return t.call(e)=="[object Array]"},Ur}var co;function Oi(){return co||(co=1,(function(t){var e=ki(),r=Pi(),n=Mi();t.Buffer=i,t.SlowBuffer=F,t.INSPECT_MAX_BYTES=50,i.TYPED_ARRAY_SUPPORT=Jn.TYPED_ARRAY_SUPPORT!==void 0?Jn.TYPED_ARRAY_SUPPORT:s(),t.kMaxLength=u();function s(){try{var o=new Uint8Array(1);return o.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},o.foo()===42&&typeof o.subarray=="function"&&o.subarray(1,1).byteLength===0}catch{return!1}}function u(){return i.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function d(o,l){if(u()<l)throw new RangeError("Invalid typed array length");return i.TYPED_ARRAY_SUPPORT?(o=new Uint8Array(l),o.__proto__=i.prototype):(o===null&&(o=new i(l)),o.length=l),o}function i(o,l,g){if(!i.TYPED_ARRAY_SUPPORT&&!(this instanceof i))return new i(o,l,g);if(typeof o=="number"){if(typeof l=="string")throw new Error("If encoding is specified then the first argument must be a string");return M(this,o)}return m(this,o,l,g)}i.poolSize=8192,i._augment=function(o){return o.__proto__=i.prototype,o};function m(o,l,g,O){if(typeof l=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&l instanceof ArrayBuffer?P(o,l,g,O):typeof l=="string"?S(o,l,g):A(o,l)}i.from=function(o,l,g){return m(null,o,l,g)},i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0}));function v(o){if(typeof o!="number")throw new TypeError('"size" argument must be a number');if(o<0)throw new RangeError('"size" argument must not be negative')}function _(o,l,g,O){return v(l),l<=0?d(o,l):g!==void 0?typeof O=="string"?d(o,l).fill(g,O):d(o,l).fill(g):d(o,l)}i.alloc=function(o,l,g){return _(null,o,l,g)};function M(o,l){if(v(l),o=d(o,l<0?0:N(l)|0),!i.TYPED_ARRAY_SUPPORT)for(var g=0;g<l;++g)o[g]=0;return o}i.allocUnsafe=function(o){return M(null,o)},i.allocUnsafeSlow=function(o){return M(null,o)};function S(o,l,g){if((typeof g!="string"||g==="")&&(g="utf8"),!i.isEncoding(g))throw new TypeError('"encoding" must be a valid string encoding');var O=B(l,g)|0;o=d(o,O);var $=o.write(l,g);return $!==O&&(o=o.slice(0,$)),o}function x(o,l){var g=l.length<0?0:N(l.length)|0;o=d(o,g);for(var O=0;O<g;O+=1)o[O]=l[O]&255;return o}function P(o,l,g,O){if(l.byteLength,g<0||l.byteLength<g)throw new RangeError("'offset' is out of bounds");if(l.byteLength<g+(O||0))throw new RangeError("'length' is out of bounds");return g===void 0&&O===void 0?l=new Uint8Array(l):O===void 0?l=new Uint8Array(l,g):l=new Uint8Array(l,g,O),i.TYPED_ARRAY_SUPPORT?(o=l,o.__proto__=i.prototype):o=x(o,l),o}function A(o,l){if(i.isBuffer(l)){var g=N(l.length)|0;return o=d(o,g),o.length===0||l.copy(o,0,0,g),o}if(l){if(typeof ArrayBuffer<"u"&&l.buffer instanceof ArrayBuffer||"length"in l)return typeof l.length!="number"||de(l.length)?d(o,0):x(o,l);if(l.type==="Buffer"&&n(l.data))return x(o,l.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function N(o){if(o>=u())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u().toString(16)+" bytes");return o|0}function F(o){return+o!=o&&(o=0),i.alloc(+o)}i.isBuffer=function(o){return!!(o!=null&&o._isBuffer)},i.compare=function(o,l){if(!i.isBuffer(o)||!i.isBuffer(l))throw new TypeError("Arguments must be Buffers");if(o===l)return 0;for(var g=o.length,O=l.length,$=0,z=Math.min(g,O);$<z;++$)if(o[$]!==l[$]){g=o[$],O=l[$];break}return g<O?-1:O<g?1:0},i.isEncoding=function(o){switch(String(o).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(o,l){if(!n(o))throw new TypeError('"list" argument must be an Array of Buffers');if(o.length===0)return i.alloc(0);var g;if(l===void 0)for(l=0,g=0;g<o.length;++g)l+=o[g].length;var O=i.allocUnsafe(l),$=0;for(g=0;g<o.length;++g){var z=o[g];if(!i.isBuffer(z))throw new TypeError('"list" argument must be an Array of Buffers');z.copy(O,$),$+=z.length}return O};function B(o,l){if(i.isBuffer(o))return o.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(o)||o instanceof ArrayBuffer))return o.byteLength;typeof o!="string"&&(o=""+o);var g=o.length;if(g===0)return 0;for(var O=!1;;)switch(l){case"ascii":case"latin1":case"binary":return g;case"utf8":case"utf-8":case void 0:return E(o).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g*2;case"hex":return g>>>1;case"base64":return Y(o).length;default:if(O)return E(o).length;l=(""+l).toLowerCase(),O=!0}}i.byteLength=B;function Q(o,l,g){var O=!1;if((l===void 0||l<0)&&(l=0),l>this.length||((g===void 0||g>this.length)&&(g=this.length),g<=0)||(g>>>=0,l>>>=0,g<=l))return"";for(o||(o="utf8");;)switch(o){case"hex":return p(this,l,g);case"utf8":case"utf-8":return k(this,l,g);case"ascii":return h(this,l,g);case"latin1":case"binary":return a(this,l,g);case"base64":return ne(this,l,g);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f(this,l,g);default:if(O)throw new TypeError("Unknown encoding: "+o);o=(o+"").toLowerCase(),O=!0}}i.prototype._isBuffer=!0;function U(o,l,g){var O=o[l];o[l]=o[g],o[g]=O}i.prototype.swap16=function(){var o=this.length;if(o%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var l=0;l<o;l+=2)U(this,l,l+1);return this},i.prototype.swap32=function(){var o=this.length;if(o%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var l=0;l<o;l+=4)U(this,l,l+3),U(this,l+1,l+2);return this},i.prototype.swap64=function(){var o=this.length;if(o%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var l=0;l<o;l+=8)U(this,l,l+7),U(this,l+1,l+6),U(this,l+2,l+5),U(this,l+3,l+4);return this},i.prototype.toString=function(){var o=this.length|0;return o===0?"":arguments.length===0?k(this,0,o):Q.apply(this,arguments)},i.prototype.equals=function(o){if(!i.isBuffer(o))throw new TypeError("Argument must be a Buffer");return this===o?!0:i.compare(this,o)===0},i.prototype.inspect=function(){var o="",l=t.INSPECT_MAX_BYTES;return this.length>0&&(o=this.toString("hex",0,l).match(/.{2}/g).join(" "),this.length>l&&(o+=" ... ")),"<Buffer "+o+">"},i.prototype.compare=function(o,l,g,O,$){if(!i.isBuffer(o))throw new TypeError("Argument must be a Buffer");if(l===void 0&&(l=0),g===void 0&&(g=o?o.length:0),O===void 0&&(O=0),$===void 0&&($=this.length),l<0||g>o.length||O<0||$>this.length)throw new RangeError("out of range index");if(O>=$&&l>=g)return 0;if(O>=$)return-1;if(l>=g)return 1;if(l>>>=0,g>>>=0,O>>>=0,$>>>=0,this===o)return 0;for(var z=$-O,le=g-l,ce=Math.min(z,le),fe=this.slice(O,$),oe=o.slice(l,g),pe=0;pe<ce;++pe)if(fe[pe]!==oe[pe]){z=fe[pe],le=oe[pe];break}return z<le?-1:le<z?1:0};function ee(o,l,g,O,$){if(o.length===0)return-1;if(typeof g=="string"?(O=g,g=0):g>2147483647?g=2147483647:g<-2147483648&&(g=-2147483648),g=+g,isNaN(g)&&(g=$?0:o.length-1),g<0&&(g=o.length+g),g>=o.length){if($)return-1;g=o.length-1}else if(g<0)if($)g=0;else return-1;if(typeof l=="string"&&(l=i.from(l,O)),i.isBuffer(l))return l.length===0?-1:re(o,l,g,O,$);if(typeof l=="number")return l=l&255,i.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?$?Uint8Array.prototype.indexOf.call(o,l,g):Uint8Array.prototype.lastIndexOf.call(o,l,g):re(o,[l],g,O,$);throw new TypeError("val must be string, number or Buffer")}function re(o,l,g,O,$){var z=1,le=o.length,ce=l.length;if(O!==void 0&&(O=String(O).toLowerCase(),O==="ucs2"||O==="ucs-2"||O==="utf16le"||O==="utf-16le")){if(o.length<2||l.length<2)return-1;z=2,le/=2,ce/=2,g/=2}function fe(xe,Ce){return z===1?xe[Ce]:xe.readUInt16BE(Ce*z)}var oe;if($){var pe=-1;for(oe=g;oe<le;oe++)if(fe(o,oe)===fe(l,pe===-1?0:oe-pe)){if(pe===-1&&(pe=oe),oe-pe+1===ce)return pe*z}else pe!==-1&&(oe-=oe-pe),pe=-1}else for(g+ce>le&&(g=le-ce),oe=g;oe>=0;oe--){for(var me=!0,ge=0;ge<ce;ge++)if(fe(o,oe+ge)!==fe(l,ge)){me=!1;break}if(me)return oe}return-1}i.prototype.includes=function(o,l,g){return this.indexOf(o,l,g)!==-1},i.prototype.indexOf=function(o,l,g){return ee(this,o,l,g,!0)},i.prototype.lastIndexOf=function(o,l,g){return ee(this,o,l,g,!1)};function K(o,l,g,O){g=Number(g)||0;var $=o.length-g;O?(O=Number(O),O>$&&(O=$)):O=$;var z=l.length;if(z%2!==0)throw new TypeError("Invalid hex string");O>z/2&&(O=z/2);for(var le=0;le<O;++le){var ce=parseInt(l.substr(le*2,2),16);if(isNaN(ce))return le;o[g+le]=ce}return le}function X(o,l,g,O){return I(E(l,o.length-g),o,g,O)}function V(o,l,g,O){return I(L(l),o,g,O)}function q(o,l,g,O){return V(o,l,g,O)}function J(o,l,g,O){return I(Y(l),o,g,O)}function ae(o,l,g,O){return I(R(l,o.length-g),o,g,O)}i.prototype.write=function(o,l,g,O){if(l===void 0)O="utf8",g=this.length,l=0;else if(g===void 0&&typeof l=="string")O=l,g=this.length,l=0;else if(isFinite(l))l=l|0,isFinite(g)?(g=g|0,O===void 0&&(O="utf8")):(O=g,g=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var $=this.length-l;if((g===void 0||g>$)&&(g=$),o.length>0&&(g<0||l<0)||l>this.length)throw new RangeError("Attempt to write outside buffer bounds");O||(O="utf8");for(var z=!1;;)switch(O){case"hex":return K(this,o,l,g);case"utf8":case"utf-8":return X(this,o,l,g);case"ascii":return V(this,o,l,g);case"latin1":case"binary":return q(this,o,l,g);case"base64":return J(this,o,l,g);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ae(this,o,l,g);default:if(z)throw new TypeError("Unknown encoding: "+O);O=(""+O).toLowerCase(),z=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ne(o,l,g){return l===0&&g===o.length?e.fromByteArray(o):e.fromByteArray(o.slice(l,g))}function k(o,l,g){g=Math.min(o.length,g);for(var O=[],$=l;$<g;){var z=o[$],le=null,ce=z>239?4:z>223?3:z>191?2:1;if($+ce<=g){var fe,oe,pe,me;switch(ce){case 1:z<128&&(le=z);break;case 2:fe=o[$+1],(fe&192)===128&&(me=(z&31)<<6|fe&63,me>127&&(le=me));break;case 3:fe=o[$+1],oe=o[$+2],(fe&192)===128&&(oe&192)===128&&(me=(z&15)<<12|(fe&63)<<6|oe&63,me>2047&&(me<55296||me>57343)&&(le=me));break;case 4:fe=o[$+1],oe=o[$+2],pe=o[$+3],(fe&192)===128&&(oe&192)===128&&(pe&192)===128&&(me=(z&15)<<18|(fe&63)<<12|(oe&63)<<6|pe&63,me>65535&&me<1114112&&(le=me))}}le===null?(le=65533,ce=1):le>65535&&(le-=65536,O.push(le>>>10&1023|55296),le=56320|le&1023),O.push(le),$+=ce}return b(O)}var C=4096;function b(o){var l=o.length;if(l<=C)return String.fromCharCode.apply(String,o);for(var g="",O=0;O<l;)g+=String.fromCharCode.apply(String,o.slice(O,O+=C));return g}function h(o,l,g){var O="";g=Math.min(o.length,g);for(var $=l;$<g;++$)O+=String.fromCharCode(o[$]&127);return O}function a(o,l,g){var O="";g=Math.min(o.length,g);for(var $=l;$<g;++$)O+=String.fromCharCode(o[$]);return O}function p(o,l,g){var O=o.length;(!l||l<0)&&(l=0),(!g||g<0||g>O)&&(g=O);for(var $="",z=l;z<g;++z)$+=ue(o[z]);return $}function f(o,l,g){for(var O=o.slice(l,g),$="",z=0;z<O.length;z+=2)$+=String.fromCharCode(O[z]+O[z+1]*256);return $}i.prototype.slice=function(o,l){var g=this.length;o=~~o,l=l===void 0?g:~~l,o<0?(o+=g,o<0&&(o=0)):o>g&&(o=g),l<0?(l+=g,l<0&&(l=0)):l>g&&(l=g),l<o&&(l=o);var O;if(i.TYPED_ARRAY_SUPPORT)O=this.subarray(o,l),O.__proto__=i.prototype;else{var $=l-o;O=new i($,void 0);for(var z=0;z<$;++z)O[z]=this[z+o]}return O};function c(o,l,g){if(o%1!==0||o<0)throw new RangeError("offset is not uint");if(o+l>g)throw new RangeError("Trying to access beyond buffer length")}i.prototype.readUIntLE=function(o,l,g){o=o|0,l=l|0,g||c(o,l,this.length);for(var O=this[o],$=1,z=0;++z<l&&($*=256);)O+=this[o+z]*$;return O},i.prototype.readUIntBE=function(o,l,g){o=o|0,l=l|0,g||c(o,l,this.length);for(var O=this[o+--l],$=1;l>0&&($*=256);)O+=this[o+--l]*$;return O},i.prototype.readUInt8=function(o,l){return l||c(o,1,this.length),this[o]},i.prototype.readUInt16LE=function(o,l){return l||c(o,2,this.length),this[o]|this[o+1]<<8},i.prototype.readUInt16BE=function(o,l){return l||c(o,2,this.length),this[o]<<8|this[o+1]},i.prototype.readUInt32LE=function(o,l){return l||c(o,4,this.length),(this[o]|this[o+1]<<8|this[o+2]<<16)+this[o+3]*16777216},i.prototype.readUInt32BE=function(o,l){return l||c(o,4,this.length),this[o]*16777216+(this[o+1]<<16|this[o+2]<<8|this[o+3])},i.prototype.readIntLE=function(o,l,g){o=o|0,l=l|0,g||c(o,l,this.length);for(var O=this[o],$=1,z=0;++z<l&&($*=256);)O+=this[o+z]*$;return $*=128,O>=$&&(O-=Math.pow(2,8*l)),O},i.prototype.readIntBE=function(o,l,g){o=o|0,l=l|0,g||c(o,l,this.length);for(var O=l,$=1,z=this[o+--O];O>0&&($*=256);)z+=this[o+--O]*$;return $*=128,z>=$&&(z-=Math.pow(2,8*l)),z},i.prototype.readInt8=function(o,l){return l||c(o,1,this.length),this[o]&128?(255-this[o]+1)*-1:this[o]},i.prototype.readInt16LE=function(o,l){l||c(o,2,this.length);var g=this[o]|this[o+1]<<8;return g&32768?g|4294901760:g},i.prototype.readInt16BE=function(o,l){l||c(o,2,this.length);var g=this[o+1]|this[o]<<8;return g&32768?g|4294901760:g},i.prototype.readInt32LE=function(o,l){return l||c(o,4,this.length),this[o]|this[o+1]<<8|this[o+2]<<16|this[o+3]<<24},i.prototype.readInt32BE=function(o,l){return l||c(o,4,this.length),this[o]<<24|this[o+1]<<16|this[o+2]<<8|this[o+3]},i.prototype.readFloatLE=function(o,l){return l||c(o,4,this.length),r.read(this,o,!0,23,4)},i.prototype.readFloatBE=function(o,l){return l||c(o,4,this.length),r.read(this,o,!1,23,4)},i.prototype.readDoubleLE=function(o,l){return l||c(o,8,this.length),r.read(this,o,!0,52,8)},i.prototype.readDoubleBE=function(o,l){return l||c(o,8,this.length),r.read(this,o,!1,52,8)};function y(o,l,g,O,$,z){if(!i.isBuffer(o))throw new TypeError('"buffer" argument must be a Buffer instance');if(l>$||l<z)throw new RangeError('"value" argument is out of bounds');if(g+O>o.length)throw new RangeError("Index out of range")}i.prototype.writeUIntLE=function(o,l,g,O){if(o=+o,l=l|0,g=g|0,!O){var $=Math.pow(2,8*g)-1;y(this,o,l,g,$,0)}var z=1,le=0;for(this[l]=o&255;++le<g&&(z*=256);)this[l+le]=o/z&255;return l+g},i.prototype.writeUIntBE=function(o,l,g,O){if(o=+o,l=l|0,g=g|0,!O){var $=Math.pow(2,8*g)-1;y(this,o,l,g,$,0)}var z=g-1,le=1;for(this[l+z]=o&255;--z>=0&&(le*=256);)this[l+z]=o/le&255;return l+g},i.prototype.writeUInt8=function(o,l,g){return o=+o,l=l|0,g||y(this,o,l,1,255,0),i.TYPED_ARRAY_SUPPORT||(o=Math.floor(o)),this[l]=o&255,l+1};function D(o,l,g,O){l<0&&(l=65535+l+1);for(var $=0,z=Math.min(o.length-g,2);$<z;++$)o[g+$]=(l&255<<8*(O?$:1-$))>>>(O?$:1-$)*8}i.prototype.writeUInt16LE=function(o,l,g){return o=+o,l=l|0,g||y(this,o,l,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[l]=o&255,this[l+1]=o>>>8):D(this,o,l,!0),l+2},i.prototype.writeUInt16BE=function(o,l,g){return o=+o,l=l|0,g||y(this,o,l,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[l]=o>>>8,this[l+1]=o&255):D(this,o,l,!1),l+2};function j(o,l,g,O){l<0&&(l=4294967295+l+1);for(var $=0,z=Math.min(o.length-g,4);$<z;++$)o[g+$]=l>>>(O?$:3-$)*8&255}i.prototype.writeUInt32LE=function(o,l,g){return o=+o,l=l|0,g||y(this,o,l,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[l+3]=o>>>24,this[l+2]=o>>>16,this[l+1]=o>>>8,this[l]=o&255):j(this,o,l,!0),l+4},i.prototype.writeUInt32BE=function(o,l,g){return o=+o,l=l|0,g||y(this,o,l,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[l]=o>>>24,this[l+1]=o>>>16,this[l+2]=o>>>8,this[l+3]=o&255):j(this,o,l,!1),l+4},i.prototype.writeIntLE=function(o,l,g,O){if(o=+o,l=l|0,!O){var $=Math.pow(2,8*g-1);y(this,o,l,g,$-1,-$)}var z=0,le=1,ce=0;for(this[l]=o&255;++z<g&&(le*=256);)o<0&&ce===0&&this[l+z-1]!==0&&(ce=1),this[l+z]=(o/le>>0)-ce&255;return l+g},i.prototype.writeIntBE=function(o,l,g,O){if(o=+o,l=l|0,!O){var $=Math.pow(2,8*g-1);y(this,o,l,g,$-1,-$)}var z=g-1,le=1,ce=0;for(this[l+z]=o&255;--z>=0&&(le*=256);)o<0&&ce===0&&this[l+z+1]!==0&&(ce=1),this[l+z]=(o/le>>0)-ce&255;return l+g},i.prototype.writeInt8=function(o,l,g){return o=+o,l=l|0,g||y(this,o,l,1,127,-128),i.TYPED_ARRAY_SUPPORT||(o=Math.floor(o)),o<0&&(o=255+o+1),this[l]=o&255,l+1},i.prototype.writeInt16LE=function(o,l,g){return o=+o,l=l|0,g||y(this,o,l,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[l]=o&255,this[l+1]=o>>>8):D(this,o,l,!0),l+2},i.prototype.writeInt16BE=function(o,l,g){return o=+o,l=l|0,g||y(this,o,l,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[l]=o>>>8,this[l+1]=o&255):D(this,o,l,!1),l+2},i.prototype.writeInt32LE=function(o,l,g){return o=+o,l=l|0,g||y(this,o,l,4,2147483647,-2147483648),i.TYPED_ARRAY_SUPPORT?(this[l]=o&255,this[l+1]=o>>>8,this[l+2]=o>>>16,this[l+3]=o>>>24):j(this,o,l,!0),l+4},i.prototype.writeInt32BE=function(o,l,g){return o=+o,l=l|0,g||y(this,o,l,4,2147483647,-2147483648),o<0&&(o=4294967295+o+1),i.TYPED_ARRAY_SUPPORT?(this[l]=o>>>24,this[l+1]=o>>>16,this[l+2]=o>>>8,this[l+3]=o&255):j(this,o,l,!1),l+4};function W(o,l,g,O,$,z){if(g+O>o.length)throw new RangeError("Index out of range");if(g<0)throw new RangeError("Index out of range")}function Z(o,l,g,O,$){return $||W(o,l,g,4),r.write(o,l,g,O,23,4),g+4}i.prototype.writeFloatLE=function(o,l,g){return Z(this,o,l,!0,g)},i.prototype.writeFloatBE=function(o,l,g){return Z(this,o,l,!1,g)};function te(o,l,g,O,$){return $||W(o,l,g,8),r.write(o,l,g,O,52,8),g+8}i.prototype.writeDoubleLE=function(o,l,g){return te(this,o,l,!0,g)},i.prototype.writeDoubleBE=function(o,l,g){return te(this,o,l,!1,g)},i.prototype.copy=function(o,l,g,O){if(g||(g=0),!O&&O!==0&&(O=this.length),l>=o.length&&(l=o.length),l||(l=0),O>0&&O<g&&(O=g),O===g||o.length===0||this.length===0)return 0;if(l<0)throw new RangeError("targetStart out of bounds");if(g<0||g>=this.length)throw new RangeError("sourceStart out of bounds");if(O<0)throw new RangeError("sourceEnd out of bounds");O>this.length&&(O=this.length),o.length-l<O-g&&(O=o.length-l+g);var $=O-g,z;if(this===o&&g<l&&l<O)for(z=$-1;z>=0;--z)o[z+l]=this[z+g];else if($<1e3||!i.TYPED_ARRAY_SUPPORT)for(z=0;z<$;++z)o[z+l]=this[z+g];else Uint8Array.prototype.set.call(o,this.subarray(g,g+$),l);return $},i.prototype.fill=function(o,l,g,O){if(typeof o=="string"){if(typeof l=="string"?(O=l,l=0,g=this.length):typeof g=="string"&&(O=g,g=this.length),o.length===1){var $=o.charCodeAt(0);$<256&&(o=$)}if(O!==void 0&&typeof O!="string")throw new TypeError("encoding must be a string");if(typeof O=="string"&&!i.isEncoding(O))throw new TypeError("Unknown encoding: "+O)}else typeof o=="number"&&(o=o&255);if(l<0||this.length<l||this.length<g)throw new RangeError("Out of range index");if(g<=l)return this;l=l>>>0,g=g===void 0?this.length:g>>>0,o||(o=0);var z;if(typeof o=="number")for(z=l;z<g;++z)this[z]=o;else{var le=i.isBuffer(o)?o:E(new i(o,O).toString()),ce=le.length;for(z=0;z<g-l;++z)this[z+l]=le[z%ce]}return this};var H=/[^+\/0-9A-Za-z-_]/g;function se(o){if(o=ie(o).replace(H,""),o.length<2)return"";for(;o.length%4!==0;)o=o+"=";return o}function ie(o){return o.trim?o.trim():o.replace(/^\s+|\s+$/g,"")}function ue(o){return o<16?"0"+o.toString(16):o.toString(16)}function E(o,l){l=l||1/0;for(var g,O=o.length,$=null,z=[],le=0;le<O;++le){if(g=o.charCodeAt(le),g>55295&&g<57344){if(!$){if(g>56319){(l-=3)>-1&&z.push(239,191,189);continue}else if(le+1===O){(l-=3)>-1&&z.push(239,191,189);continue}$=g;continue}if(g<56320){(l-=3)>-1&&z.push(239,191,189),$=g;continue}g=($-55296<<10|g-56320)+65536}else $&&(l-=3)>-1&&z.push(239,191,189);if($=null,g<128){if((l-=1)<0)break;z.push(g)}else if(g<2048){if((l-=2)<0)break;z.push(g>>6|192,g&63|128)}else if(g<65536){if((l-=3)<0)break;z.push(g>>12|224,g>>6&63|128,g&63|128)}else if(g<1114112){if((l-=4)<0)break;z.push(g>>18|240,g>>12&63|128,g>>6&63|128,g&63|128)}else throw new Error("Invalid code point")}return z}function L(o){for(var l=[],g=0;g<o.length;++g)l.push(o.charCodeAt(g)&255);return l}function R(o,l){for(var g,O,$,z=[],le=0;le<o.length&&!((l-=2)<0);++le)g=o.charCodeAt(le),O=g>>8,$=g%256,z.push($),z.push(O);return z}function Y(o){return e.toByteArray(se(o))}function I(o,l,g,O){for(var $=0;$<O&&!($+g>=l.length||$>=o.length);++$)l[$+g]=o[$];return $}function de(o){return o!==o}})(io)),io}Oi();var _t;if(typeof window<"u"&&window.crypto&&(_t=window.crypto),!_t&&typeof window<"u"&&window.msCrypto&&(_t=window.msCrypto),!_t&&typeof global<"u"&&global.crypto&&(_t=global.crypto),!_t&&typeof require=="function")try{_t=require("crypto")}catch{}var ho={};var qr=function(t,e){return qr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var s in n)n.hasOwnProperty(s)&&(r[s]=n[s])},qr(t,e)};function Ai(t,e){qr(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Vr=function(){return Vr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])}return t},Vr.apply(this,arguments)};function Ei(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]]);return r}function Ti(t,e,r,n){var s=arguments.length,u=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(t,e,r,n);else for(var i=t.length-1;i>=0;i--)(d=t[i])&&(u=(s<3?d(u):s>3?d(e,r,u):d(e,r))||u);return s>3&&u&&Object.defineProperty(e,r,u),u}function ji(t,e){return function(r,n){e(r,n,t)}}function Ri(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function $i(t,e,r,n){function s(u){return u instanceof r?u:new r(function(d){d(u)})}return new(r||(r=Promise))(function(u,d){function i(_){try{v(n.next(_))}catch(M){d(M)}}function m(_){try{v(n.throw(_))}catch(M){d(M)}}function v(_){_.done?u(_.value):s(_.value).then(i,m)}v((n=n.apply(t,e||[])).next())})}function Ni(t,e){var r={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},n,s,u,d;return d={next:i(0),throw:i(1),return:i(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function i(v){return function(_){return m([v,_])}}function m(v){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,s&&(u=v[0]&2?s.return:v[0]?s.throw||((u=s.return)&&u.call(s),0):s.next)&&!(u=u.call(s,v[1])).done)return u;switch(s=0,u&&(v=[v[0]&2,u.value]),v[0]){case 0:case 1:u=v;break;case 4:return r.label++,{value:v[1],done:!1};case 5:r.label++,s=v[1],v=[0];continue;case 7:v=r.ops.pop(),r.trys.pop();continue;default:if(u=r.trys,!(u=u.length>0&&u[u.length-1])&&(v[0]===6||v[0]===2)){r=0;continue}if(v[0]===3&&(!u||v[1]>u[0]&&v[1]<u[3])){r.label=v[1];break}if(v[0]===6&&r.label<u[1]){r.label=u[1],u=v;break}if(u&&r.label<u[2]){r.label=u[2],r.ops.push(v);break}u[2]&&r.ops.pop(),r.trys.pop();continue}v=e.call(t,r)}catch(_){v=[6,_],s=0}finally{n=u=0}if(v[0]&5)throw v[1];return{value:v[0]?v[1]:void 0,done:!0}}}function Li(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function Bi(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Hr(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function fo(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),s,u=[],d;try{for(;(e===void 0||e-- >0)&&!(s=n.next()).done;)u.push(s.value)}catch(i){d={error:i}}finally{try{s&&!s.done&&(r=n.return)&&r.call(n)}finally{if(d)throw d.error}}return u}function Ii(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(fo(arguments[e]));return t}function Yi(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),s=0,e=0;e<r;e++)for(var u=arguments[e],d=0,i=u.length;d<i;d++,s++)n[s]=u[d];return n}function Yt(t){return this instanceof Yt?(this.v=t,this):new Yt(t)}function zi(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),s,u=[];return s={},d("next"),d("throw"),d("return"),s[Symbol.asyncIterator]=function(){return this},s;function d(S){n[S]&&(s[S]=function(x){return new Promise(function(P,A){u.push([S,x,P,A])>1||i(S,x)})})}function i(S,x){try{m(n[S](x))}catch(P){M(u[0][3],P)}}function m(S){S.value instanceof Yt?Promise.resolve(S.value.v).then(v,_):M(u[0][2],S)}function v(S){i("next",S)}function _(S){i("throw",S)}function M(S,x){S(x),u.shift(),u.length&&i(u[0][0],u[0][1])}}function Fi(t){var e,r;return e={},n("next"),n("throw",function(s){throw s}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(s,u){e[s]=t[s]?function(d){return(r=!r)?{value:Yt(t[s](d)),done:s==="return"}:u?u(d):d}:u}}function Wi(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Hr=="function"?Hr(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(u){r[u]=t[u]&&function(d){return new Promise(function(i,m){d=t[u](d),s(i,m,d.done,d.value)})}}function s(u,d,i,m){Promise.resolve(m).then(function(v){u({value:v,done:i})},d)}}function Ui(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function qi(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function Vi(t){return t&&t.__esModule?t:{default:t}}function Hi(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function Gi(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}const Qi=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return Vr},__asyncDelegator:Fi,__asyncGenerator:zi,__asyncValues:Wi,__await:Yt,__awaiter:$i,__classPrivateFieldGet:Hi,__classPrivateFieldSet:Gi,__createBinding:Li,__decorate:Ti,__exportStar:Bi,__extends:Ai,__generator:Ni,__importDefault:Vi,__importStar:qi,__makeTemplateObject:Ui,__metadata:Ri,__param:ji,__read:fo,__rest:Ei,__spread:Ii,__spreadArrays:Yi,__values:Hr},Symbol.toStringTag,{value:"Module"})),po=Ir(Qi);var zt={},Fe={},go;function mo(){return go||(go=1,Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.MAX_HASHABLE_LENGTH=Fe.INIT=Fe.KEY=Fe.DIGEST_LENGTH=Fe.BLOCK_SIZE=void 0,Fe.BLOCK_SIZE=64,Fe.DIGEST_LENGTH=32,Fe.KEY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Fe.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],Fe.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1),Fe}var Ft={},yo;function Zi(){if(yo)return Ft;yo=1,Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.RawSha256=void 0;var t=mo(),e=(function(){function r(){this.state=Int32Array.from(t.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return r.prototype.update=function(n){if(this.finished)throw new Error("Attempted to update an already finished hash.");var s=0,u=n.byteLength;if(this.bytesHashed+=u,this.bytesHashed*8>t.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;u>0;)this.buffer[this.bufferLength++]=n[s++],u--,this.bufferLength===t.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},r.prototype.digest=function(){if(!this.finished){var n=this.bytesHashed*8,s=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),u=this.bufferLength;if(s.setUint8(this.bufferLength++,128),u%t.BLOCK_SIZE>=t.BLOCK_SIZE-8){for(var d=this.bufferLength;d<t.BLOCK_SIZE;d++)s.setUint8(d,0);this.hashBuffer(),this.bufferLength=0}for(var d=this.bufferLength;d<t.BLOCK_SIZE-8;d++)s.setUint8(d,0);s.setUint32(t.BLOCK_SIZE-8,Math.floor(n/4294967296),!0),s.setUint32(t.BLOCK_SIZE-4,n),this.hashBuffer(),this.finished=!0}for(var i=new Uint8Array(t.DIGEST_LENGTH),d=0;d<8;d++)i[d*4]=this.state[d]>>>24&255,i[d*4+1]=this.state[d]>>>16&255,i[d*4+2]=this.state[d]>>>8&255,i[d*4+3]=this.state[d]>>>0&255;return i},r.prototype.hashBuffer=function(){for(var n=this,s=n.buffer,u=n.state,d=u[0],i=u[1],m=u[2],v=u[3],_=u[4],M=u[5],S=u[6],x=u[7],P=0;P<t.BLOCK_SIZE;P++){if(P<16)this.temp[P]=(s[P*4]&255)<<24|(s[P*4+1]&255)<<16|(s[P*4+2]&255)<<8|s[P*4+3]&255;else{var A=this.temp[P-2],N=(A>>>17|A<<15)^(A>>>19|A<<13)^A>>>10;A=this.temp[P-15];var F=(A>>>7|A<<25)^(A>>>18|A<<14)^A>>>3;this.temp[P]=(N+this.temp[P-7]|0)+(F+this.temp[P-16]|0)}var B=(((_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7))+(_&M^~_&S)|0)+(x+(t.KEY[P]+this.temp[P]|0)|0)|0,Q=((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+(d&i^d&m^i&m)|0;x=S,S=M,M=_,_=v+B|0,v=m,m=i,i=d,d=B+Q|0}u[0]+=d,u[1]+=i,u[2]+=m,u[3]+=v,u[4]+=_,u[5]+=M,u[6]+=S,u[7]+=x},r})();return Ft.RawSha256=e,Ft}var vo={},Wt={};const Ki=t=>{const e=[];for(let r=0,n=t.length;r<n;r++){const s=t.charCodeAt(r);if(s<128)e.push(s);else if(s<2048)e.push(s>>6|192,s&63|128);else if(r+1<t.length&&(s&64512)===55296&&(t.charCodeAt(r+1)&64512)===56320){const u=65536+((s&1023)<<10)+(t.charCodeAt(++r)&1023);e.push(u>>18|240,u>>12&63|128,u>>6&63|128,u&63|128)}else e.push(s>>12|224,s>>6&63|128,s&63|128)}return Uint8Array.from(e)},Ji=t=>{let e="";for(let r=0,n=t.length;r<n;r++){const s=t[r];if(s<128)e+=String.fromCharCode(s);else if(192<=s&&s<224){const u=t[++r];e+=String.fromCharCode((s&31)<<6|u&63)}else if(240<=s&&s<365){const u="%"+[s,t[++r],t[++r],t[++r]].map(d=>d.toString(16)).join("%");e+=decodeURIComponent(u)}else e+=String.fromCharCode((s&15)<<12|(t[++r]&63)<<6|t[++r]&63)}return e};function Xi(t){return new TextEncoder().encode(t)}function ea(t){return new TextDecoder("utf-8").decode(t)}const ta=t=>typeof TextEncoder=="function"?Xi(t):Ki(t),ra=t=>typeof TextDecoder=="function"?ea(t):Ji(t),na=Object.freeze(Object.defineProperty({__proto__:null,fromUtf8:ta,toUtf8:ra},Symbol.toStringTag,{value:"Module"})),oa=Ir(na);var bo;function sa(){if(bo)return Wt;bo=1,Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.convertToBuffer=void 0;var t=oa,e=typeof Buffer<"u"&&Buffer.from?function(n){return Buffer.from(n,"utf8")}:t.fromUtf8;function r(n){return n instanceof Uint8Array?n:typeof n=="string"?e(n):ArrayBuffer.isView(n)?new Uint8Array(n.buffer,n.byteOffset,n.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(n)}return Wt.convertToBuffer=r,Wt}var Ut={},wo;function ia(){if(wo)return Ut;wo=1,Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.isEmptyData=void 0;function t(e){return typeof e=="string"?e.length===0:e.byteLength===0}return Ut.isEmptyData=t,Ut}var qt={},_o;function aa(){if(_o)return qt;_o=1,Object.defineProperty(qt,"__esModule",{value:!0}),qt.numToUint8=void 0;function t(e){return new Uint8Array([(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&255])}return qt.numToUint8=t,qt}var Vt={},Co;function la(){if(Co)return Vt;Co=1,Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.uint32ArrayFrom=void 0;function t(e){if(!Array.from){for(var r=new Uint32Array(e.length),n=0;n<e.length;)r[n]=e[n];return r}return Uint32Array.from(e)}return Vt.uint32ArrayFrom=t,Vt}var xo;function ua(){return xo||(xo=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.uint32ArrayFrom=t.numToUint8=t.isEmptyData=t.convertToBuffer=void 0;var e=sa();Object.defineProperty(t,"convertToBuffer",{enumerable:!0,get:function(){return e.convertToBuffer}});var r=ia();Object.defineProperty(t,"isEmptyData",{enumerable:!0,get:function(){return r.isEmptyData}});var n=aa();Object.defineProperty(t,"numToUint8",{enumerable:!0,get:function(){return n.numToUint8}});var s=la();Object.defineProperty(t,"uint32ArrayFrom",{enumerable:!0,get:function(){return s.uint32ArrayFrom}})})(vo)),vo}var So;function ca(){if(So)return zt;So=1,Object.defineProperty(zt,"__esModule",{value:!0}),zt.Sha256=void 0;var t=po,e=mo(),r=Zi(),n=ua(),s=(function(){function d(i){if(this.hash=new r.RawSha256,i){this.outer=new r.RawSha256;var m=u(i),v=new Uint8Array(e.BLOCK_SIZE);v.set(m);for(var _=0;_<e.BLOCK_SIZE;_++)m[_]^=54,v[_]^=92;this.hash.update(m),this.outer.update(v);for(var _=0;_<m.byteLength;_++)m[_]=0}}return d.prototype.update=function(i){if(!((0,n.isEmptyData)(i)||this.error))try{this.hash.update((0,n.convertToBuffer)(i))}catch(m){this.error=m}},d.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},d.prototype.digest=function(){return(0,t.__awaiter)(this,void 0,void 0,function(){return(0,t.__generator)(this,function(i){return[2,this.digestSync()]})})},d})();zt.Sha256=s;function u(d){var i=(0,n.convertToBuffer)(d);if(i.byteLength>e.BLOCK_SIZE){var m=new r.RawSha256;m.update(i),i=m.digest()}var v=new Uint8Array(e.BLOCK_SIZE);return v.set(i),v}return zt}var Do;function da(){return Do||(Do=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=po;(0,e.__exportStar)(ca(),t)})(ho)),ho}da();function ye(t,e){t!=null&&this.fromString(t,e)}function Be(){return new ye(null)}var ht,ha=0xdeadbeefcafe,ko=(ha&16777215)==15715070;function fa(t,e,r,n,s,u){for(;--u>=0;){var d=e*this[t++]+r[n]+s;s=Math.floor(d/67108864),r[n++]=d&67108863}return s}function pa(t,e,r,n,s,u){for(var d=e&32767,i=e>>15;--u>=0;){var m=this[t]&32767,v=this[t++]>>15,_=i*m+v*d;m=d*m+((_&32767)<<15)+r[n]+(s&1073741823),s=(m>>>30)+(_>>>15)+i*v+(s>>>30),r[n++]=m&1073741823}return s}function ga(t,e,r,n,s,u){for(var d=e&16383,i=e>>14;--u>=0;){var m=this[t]&16383,v=this[t++]>>14,_=i*m+v*d;m=d*m+((_&16383)<<14)+r[n]+s,s=(m>>28)+(_>>14)+i*v,r[n++]=m&268435455}return s}var Po=typeof navigator<"u";Po&&ko&&navigator.appName=="Microsoft Internet Explorer"?(ye.prototype.am=pa,ht=30):Po&&ko&&navigator.appName!="Netscape"?(ye.prototype.am=fa,ht=26):(ye.prototype.am=ga,ht=28),ye.prototype.DB=ht,ye.prototype.DM=(1<<ht)-1,ye.prototype.DV=1<<ht;var Gr=52;ye.prototype.FV=Math.pow(2,Gr),ye.prototype.F1=Gr-ht,ye.prototype.F2=2*ht-Gr;var ma="0123456789abcdefghijklmnopqrstuvwxyz",nr=new Array,kt,We;for(kt=48,We=0;We<=9;++We)nr[kt++]=We;for(kt=97,We=10;We<36;++We)nr[kt++]=We;for(kt=65,We=10;We<36;++We)nr[kt++]=We;function Mo(t){return ma.charAt(t)}function ya(t,e){var r=nr[t.charCodeAt(e)];return r??-1}function va(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}function ba(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0}function Qr(t){var e=Be();return e.fromInt(t),e}function wa(t,e){var r;if(e==16)r=4;else if(e==8)r=3;else if(e==2)r=1;else if(e==32)r=5;else if(e==4)r=2;else throw new Error("Only radix 2, 4, 8, 16, 32 are supported");this.t=0,this.s=0;for(var n=t.length,s=!1,u=0;--n>=0;){var d=ya(t,n);if(d<0){t.charAt(n)=="-"&&(s=!0);continue}s=!1,u==0?this[this.t++]=d:u+r>this.DB?(this[this.t-1]|=(d&(1<<this.DB-u)-1)<<u,this[this.t++]=d>>this.DB-u):this[this.t-1]|=d<<u,u+=r,u>=this.DB&&(u-=this.DB)}this.clamp(),s&&ye.ZERO.subTo(this,this)}function _a(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t}function Ca(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else throw new Error("Only radix 2, 4, 8, 16, 32 are supported");var r=(1<<e)-1,n,s=!1,u="",d=this.t,i=this.DB-d*this.DB%e;if(d-- >0)for(i<this.DB&&(n=this[d]>>i)>0&&(s=!0,u=Mo(n));d>=0;)i<e?(n=(this[d]&(1<<i)-1)<<e-i,n|=this[--d]>>(i+=this.DB-e)):(n=this[d]>>(i-=e)&r,i<=0&&(i+=this.DB,--d)),n>0&&(s=!0),s&&(u+=Mo(n));return s?u:"0"}function xa(){var t=Be();return ye.ZERO.subTo(this,t),t}function Sa(){return this.s<0?this.negate():this}function Da(t){var e=this.s-t.s;if(e!=0)return e;var r=this.t;if(e=r-t.t,e!=0)return this.s<0?-e:e;for(;--r>=0;)if((e=this[r]-t[r])!=0)return e;return 0}function Zr(t){var e=1,r;return(r=t>>>16)!=0&&(t=r,e+=16),(r=t>>8)!=0&&(t=r,e+=8),(r=t>>4)!=0&&(t=r,e+=4),(r=t>>2)!=0&&(t=r,e+=2),(r=t>>1)!=0&&(t=r,e+=1),e}function ka(){return this.t<=0?0:this.DB*(this.t-1)+Zr(this[this.t-1]^this.s&this.DM)}function Pa(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t,e.s=this.s}function Ma(t,e){for(var r=t;r<this.t;++r)e[r-t]=this[r];e.t=Math.max(this.t-t,0),e.s=this.s}function Oa(t,e){var r=t%this.DB,n=this.DB-r,s=(1<<n)-1,u=Math.floor(t/this.DB),d=this.s<<r&this.DM,i;for(i=this.t-1;i>=0;--i)e[i+u+1]=this[i]>>n|d,d=(this[i]&s)<<r;for(i=u-1;i>=0;--i)e[i]=0;e[u]=d,e.t=this.t+u+1,e.s=this.s,e.clamp()}function Aa(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){e.t=0;return}var n=t%this.DB,s=this.DB-n,u=(1<<n)-1;e[0]=this[r]>>n;for(var d=r+1;d<this.t;++d)e[d-r-1]|=(this[d]&u)<<s,e[d-r]=this[d]>>n;n>0&&(e[this.t-r-1]|=(this.s&u)<<s),e.t=this.t-r,e.clamp()}function Ea(t,e){for(var r=0,n=0,s=Math.min(t.t,this.t);r<s;)n+=this[r]-t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n-=t[r],e[r++]=n&this.DM,n>>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e[r++]=this.DV+n:n>0&&(e[r++]=n),e.t=r,e.clamp()}function Ta(t,e){var r=this.abs(),n=t.abs(),s=r.t;for(e.t=s+n.t;--s>=0;)e[s]=0;for(s=0;s<n.t;++s)e[s+r.t]=r.am(0,n[s],e,s,0,r.t);e.s=0,e.clamp(),this.s!=t.s&&ye.ZERO.subTo(e,e)}function ja(t){for(var e=this.abs(),r=t.t=2*e.t;--r>=0;)t[r]=0;for(r=0;r<e.t-1;++r){var n=e.am(r,e[r],t,2*r,0,1);(t[r+e.t]+=e.am(r+1,2*e[r],t,2*r+1,n,e.t-r-1))>=e.DV&&(t[r+e.t]-=e.DV,t[r+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(r,e[r],t,2*r,0,1)),t.s=0,t.clamp()}function Ra(t,e,r){var n=t.abs();if(!(n.t<=0)){var s=this.abs();if(s.t<n.t){e?.fromInt(0),r!=null&&this.copyTo(r);return}r==null&&(r=Be());var u=Be(),d=this.s,i=t.s,m=this.DB-Zr(n[n.t-1]);m>0?(n.lShiftTo(m,u),s.lShiftTo(m,r)):(n.copyTo(u),s.copyTo(r));var v=u.t,_=u[v-1];if(_!=0){var M=_*(1<<this.F1)+(v>1?u[v-2]>>this.F2:0),S=this.FV/M,x=(1<<this.F1)/M,P=1<<this.F2,A=r.t,N=A-v,F=e??Be();for(u.dlShiftTo(N,F),r.compareTo(F)>=0&&(r[r.t++]=1,r.subTo(F,r)),ye.ONE.dlShiftTo(v,F),F.subTo(u,u);u.t<v;)u[u.t++]=0;for(;--N>=0;){var B=r[--A]==_?this.DM:Math.floor(r[A]*S+(r[A-1]+P)*x);if((r[A]+=u.am(0,B,r,N,0,v))<B)for(u.dlShiftTo(N,F),r.subTo(F,r);r[A]<--B;)r.subTo(F,r)}e!=null&&(r.drShiftTo(v,e),d!=i&&ye.ZERO.subTo(e,e)),r.t=v,r.clamp(),m>0&&r.rShiftTo(m,r),d<0&&ye.ZERO.subTo(r,r)}}}function $a(t){var e=Be();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(ye.ZERO)>0&&t.subTo(e,e),e}function Na(){if(this.t<1)return 0;var t=this[0];if((t&1)==0)return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function La(t){return this.compareTo(t)==0}function Ba(t,e){for(var r=0,n=0,s=Math.min(t.t,this.t);r<s;)n+=this[r]+t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n+=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n+=t[r],e[r++]=n&this.DM,n>>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e[r++]=n:n<-1&&(e[r++]=this.DV+n),e.t=r,e.clamp()}function Ia(t){var e=Be();return this.addTo(t,e),e}function Ya(t){var e=Be();return this.subTo(t,e),e}function za(t){var e=Be();return this.multiplyTo(t,e),e}function Fa(t){var e=Be();return this.divRemTo(t,e,null),e}function Pt(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function Wa(t){var e=Be();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(ye.ZERO)>0&&this.m.subTo(e,e),e}function Ua(t){var e=Be();return t.copyTo(e),this.reduce(e),e}function qa(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=t[e]&32767,n=r*this.mpl+((r*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t[r]+=this.m.am(0,n,t,e,0,this.m.t);t[r]>=t.DV;)t[r]-=t.DV,t[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function Va(t,e){t.squareTo(e),this.reduce(e)}function Ha(t,e,r){t.multiplyTo(e,r),this.reduce(r)}Pt.prototype.convert=Wa,Pt.prototype.revert=Ua,Pt.prototype.reduce=qa,Pt.prototype.mulTo=Ha,Pt.prototype.sqrTo=Va;function Ga(t,e,r){var n=t.bitLength(),s,u=Qr(1),d=new Pt(e);if(n<=0)return u;n<18?s=1:n<48?s=3:n<144?s=4:n<768?s=5:s=6;var i=new Array,m=3,v=s-1,_=(1<<s)-1;if(i[1]=d.convert(this),s>1){var M=Be();for(d.sqrTo(i[1],M);m<=_;)i[m]=Be(),d.mulTo(M,i[m-2],i[m]),m+=2}var S=t.t-1,x,P=!0,A=Be(),N;for(n=Zr(t[S])-1;S>=0;){for(n>=v?x=t[S]>>n-v&_:(x=(t[S]&(1<<n+1)-1)<<v-n,S>0&&(x|=t[S-1]>>this.DB+n-v)),m=s;(x&1)==0;)x>>=1,--m;if((n-=m)<0&&(n+=this.DB,--S),P)i[x].copyTo(u),P=!1;else{for(;m>1;)d.sqrTo(u,A),d.sqrTo(A,u),m-=2;m>0?d.sqrTo(u,A):(N=u,u=A,A=N),d.mulTo(A,i[x],u)}for(;S>=0&&(t[S]&1<<n)==0;)d.sqrTo(u,A),N=u,u=A,A=N,--n<0&&(n=this.DB-1,--S)}var F=d.revert(u);return r(null,F),F}ye.prototype.copyTo=va,ye.prototype.fromInt=ba,ye.prototype.fromString=wa,ye.prototype.clamp=_a,ye.prototype.dlShiftTo=Pa,ye.prototype.drShiftTo=Ma,ye.prototype.lShiftTo=Oa,ye.prototype.rShiftTo=Aa,ye.prototype.subTo=Ea,ye.prototype.multiplyTo=Ta,ye.prototype.squareTo=ja,ye.prototype.divRemTo=Ra,ye.prototype.invDigit=Na,ye.prototype.addTo=Ba,ye.prototype.toString=Ca,ye.prototype.negate=xa,ye.prototype.abs=Sa,ye.prototype.compareTo=Da,ye.prototype.bitLength=ka,ye.prototype.mod=$a,ye.prototype.equals=La,ye.prototype.add=Ia,ye.prototype.subtract=Ya,ye.prototype.multiply=za,ye.prototype.divide=Fa,ye.prototype.modPow=Ga,ye.ZERO=Qr(0),ye.ONE=Qr(1);function Qa(t,e){return e=e||{},new Promise(function(r,n){var s=new XMLHttpRequest,u=[],d=[],i={},m=function(){return{ok:(s.status/100|0)==2,statusText:s.statusText,status:s.status,url:s.responseURL,text:function(){return Promise.resolve(s.responseText)},json:function(){return Promise.resolve(s.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([s.response]))},clone:m,headers:{keys:function(){return u},entries:function(){return d},get:function(_){return i[_.toLowerCase()]},has:function(_){return _.toLowerCase()in i}}}};for(var v in s.open(e.method||"get",t,!0),s.onload=function(){s.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(_,M,S){u.push(M=M.toLowerCase()),d.push([M,S]),i[M]=i[M]?i[M]+","+S:S}),r(m())},s.onerror=n,s.withCredentials=e.credentials=="include",e.headers)s.setRequestHeader(v,e.headers[v]);s.send(e.body||null)})}const Za=Object.freeze(Object.defineProperty({__proto__:null,default:Qa},Symbol.toStringTag,{value:"Module"})),Oo=Ir(Za);var Ao,Eo;function Ka(){return Eo||(Eo=1,Ao=self.fetch||(self.fetch=Oo.default||Oo)),Ao}Ka();var To={exports:{}};var jo;function Ja(){return jo||(jo=1,(function(t,e){(function(r){var n;if(t.exports=r(),n=!0,!n){var s=window.Cookies,u=window.Cookies=r();u.noConflict=function(){return window.Cookies=s,u}}})(function(){function r(){for(var u=0,d={};u<arguments.length;u++){var i=arguments[u];for(var m in i)d[m]=i[m]}return d}function n(u){return u.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}function s(u){function d(){}function i(v,_,M){if(!(typeof document>"u")){M=r({path:"/"},d.defaults,M),typeof M.expires=="number"&&(M.expires=new Date(new Date*1+M.expires*864e5)),M.expires=M.expires?M.expires.toUTCString():"";try{var S=JSON.stringify(_);/^[\{\[]/.test(S)&&(_=S)}catch{}_=u.write?u.write(_,v):encodeURIComponent(String(_)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),v=encodeURIComponent(String(v)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var x="";for(var P in M)M[P]&&(x+="; "+P,M[P]!==!0&&(x+="="+M[P].split(";")[0]));return document.cookie=v+"="+_+x}}function m(v,_){if(!(typeof document>"u")){for(var M={},S=document.cookie?document.cookie.split("; "):[],x=0;x<S.length;x++){var P=S[x].split("="),A=P.slice(1).join("=");!_&&A.charAt(0)==='"'&&(A=A.slice(1,-1));try{var N=n(P[0]);if(A=(u.read||u)(A,N)||n(A),_)try{A=JSON.parse(A)}catch{}if(M[N]=A,v===N)break}catch{}}return v?M[v]:M}}return d.set=i,d.get=function(v){return m(v,!1)},d.getJSON=function(v){return m(v,!0)},d.remove=function(v,_){i(v,"",r(_,{expires:-1}))},d.defaults={},d.withConverter=s,d}return s(function(){})})})(To)),To.exports}Ja();function Xa(){if(!window.MantineCognitoUserPool)throw new Error("Cognito Userpool has not been initialized.");return window.MantineCognitoUserPool}function el(){return Xa().getCurrentUser()}function tl(){return new Promise((t,e)=>{const r=el();r===null&&e(null),r?.getSession((n,s)=>{if(n!==null||s===null)return e(null);t({session:s,authenticatedUser:r})})})}async function rl(){const{session:t}=await tl();return t?.getIdToken().getJwtToken()}G.createContext(void 0);var nl="undefined",ol="object",or="browser",Ro="cpu",$o="device",Kr="engine",sr="os",ft="name",ir="type",Jr="vendor",Ke="version",Xr="architecture",en="major",tn="model",sl="console",il="mobile",al="tablet",ll="smarttv",ul="wearable",cl="embedded",dl=typeof window!==nl,rn=dl&&window.navigator?window.navigator:void 0;rn&&rn.userAgentData&&rn.userAgentData;var ar=function(t){for(var e={},r=0;r<t.length;r++)e[t[r].toUpperCase()]=t[r];return e},lr=function(t){for(var e in t){var r=t[e];typeof r==ol&&r.length==2?this[r[0]]=r[1]:this[r]=void 0}return this};(function(){var t={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return lr.call(t.init,[[or,[ft,Ke,en,ir]],[Ro,[Xr]],[$o,[ir,tn,Jr]],[Kr,[ft,Ke]],[sr,[ft,Ke]]]),lr.call(t.isIgnore,[[or,[Ke,en]],[Kr,[Ke]],[sr,[Ke]]]),lr.call(t.isIgnoreRgx,[[or,/ ?browser$/i],[sr,/ ?os$/i]]),lr.call(t.toString,[[or,[ft,Ke]],[Ro,[Xr]],[$o,[Jr,tn]],[Kr,[ft,Ke]],[sr,[ft,Ke]]]),t})(),ar([ft,Ke,en,ir]),ar([Xr]),ar([tn,Jr,ir,sl,il,ll,al,ul,cl]),ar([ft,Ke]);var nn={exports:{}},hl=nn.exports,No;function fl(){return No||(No=1,(function(t,e){(function(r,n){t.exports=n()})(hl,()=>(()=>{var r={873:(d,i)=>{var m,v,_=(function(){var M=function(k,C){var b=k,h=F[C],a=null,p=0,f=null,c=[],y={},D=function(E,L){a=(function(R){for(var Y=new Array(R),I=0;I<R;I+=1){Y[I]=new Array(R);for(var de=0;de<R;de+=1)Y[I][de]=null}return Y})(p=4*b+17),j(0,0),j(p-7,0),j(0,p-7),Z(),W(),H(E,L),b>=7&&te(E),f==null&&(f=ie(b,h,c)),se(f,L)},j=function(E,L){for(var R=-1;R<=7;R+=1)if(!(E+R<=-1||p<=E+R))for(var Y=-1;Y<=7;Y+=1)L+Y<=-1||p<=L+Y||(a[E+R][L+Y]=0<=R&&R<=6&&(Y==0||Y==6)||0<=Y&&Y<=6&&(R==0||R==6)||2<=R&&R<=4&&2<=Y&&Y<=4)},W=function(){for(var E=8;E<p-8;E+=1)a[E][6]==null&&(a[E][6]=E%2==0);for(var L=8;L<p-8;L+=1)a[6][L]==null&&(a[6][L]=L%2==0)},Z=function(){for(var E=B.getPatternPosition(b),L=0;L<E.length;L+=1)for(var R=0;R<E.length;R+=1){var Y=E[L],I=E[R];if(a[Y][I]==null)for(var de=-2;de<=2;de+=1)for(var o=-2;o<=2;o+=1)a[Y+de][I+o]=de==-2||de==2||o==-2||o==2||de==0&&o==0}},te=function(E){for(var L=B.getBCHTypeNumber(b),R=0;R<18;R+=1){var Y=!E&&(L>>R&1)==1;a[Math.floor(R/3)][R%3+p-8-3]=Y}for(R=0;R<18;R+=1)Y=!E&&(L>>R&1)==1,a[R%3+p-8-3][Math.floor(R/3)]=Y},H=function(E,L){for(var R=h<<3|L,Y=B.getBCHTypeInfo(R),I=0;I<15;I+=1){var de=!E&&(Y>>I&1)==1;I<6?a[I][8]=de:I<8?a[I+1][8]=de:a[p-15+I][8]=de}for(I=0;I<15;I+=1)de=!E&&(Y>>I&1)==1,I<8?a[8][p-I-1]=de:I<9?a[8][15-I-1+1]=de:a[8][15-I-1]=de;a[p-8][8]=!E},se=function(E,L){for(var R=-1,Y=p-1,I=7,de=0,o=B.getMaskFunction(L),l=p-1;l>0;l-=2)for(l==6&&(l-=1);;){for(var g=0;g<2;g+=1)if(a[Y][l-g]==null){var O=!1;de<E.length&&(O=(E[de]>>>I&1)==1),o(Y,l-g)&&(O=!O),a[Y][l-g]=O,(I-=1)==-1&&(de+=1,I=7)}if((Y+=R)<0||p<=Y){Y-=R,R=-R;break}}},ie=function(E,L,R){for(var Y=ee.getRSBlocks(E,L),I=re(),de=0;de<R.length;de+=1){var o=R[de];I.put(o.getMode(),4),I.put(o.getLength(),B.getLengthInBits(o.getMode(),E)),o.write(I)}var l=0;for(de=0;de<Y.length;de+=1)l+=Y[de].dataCount;if(I.getLengthInBits()>8*l)throw"code length overflow. ("+I.getLengthInBits()+">"+8*l+")";for(I.getLengthInBits()+4<=8*l&&I.put(0,4);I.getLengthInBits()%8!=0;)I.putBit(!1);for(;!(I.getLengthInBits()>=8*l||(I.put(236,8),I.getLengthInBits()>=8*l));)I.put(17,8);return(function(g,O){for(var $=0,z=0,le=0,ce=new Array(O.length),fe=new Array(O.length),oe=0;oe<O.length;oe+=1){var pe=O[oe].dataCount,me=O[oe].totalCount-pe;z=Math.max(z,pe),le=Math.max(le,me),ce[oe]=new Array(pe);for(var ge=0;ge<ce[oe].length;ge+=1)ce[oe][ge]=255&g.getBuffer()[ge+$];$+=pe;var xe=B.getErrorCorrectPolynomial(me),Ce=U(ce[oe],xe.getLength()-1).mod(xe);for(fe[oe]=new Array(xe.getLength()-1),ge=0;ge<fe[oe].length;ge+=1){var ke=ge+Ce.getLength()-fe[oe].length;fe[oe][ge]=ke>=0?Ce.getAt(ke):0}}var qe=0;for(ge=0;ge<O.length;ge+=1)qe+=O[ge].totalCount;var $e=new Array(qe),_e=0;for(ge=0;ge<z;ge+=1)for(oe=0;oe<O.length;oe+=1)ge<ce[oe].length&&($e[_e]=ce[oe][ge],_e+=1);for(ge=0;ge<le;ge+=1)for(oe=0;oe<O.length;oe+=1)ge<fe[oe].length&&($e[_e]=fe[oe][ge],_e+=1);return $e})(I,Y)};y.addData=function(E,L){var R=null;switch(L=L||"Byte"){case"Numeric":R=K(E);break;case"Alphanumeric":R=X(E);break;case"Byte":R=V(E);break;case"Kanji":R=q(E);break;default:throw"mode:"+L}c.push(R),f=null},y.isDark=function(E,L){if(E<0||p<=E||L<0||p<=L)throw E+","+L;return a[E][L]},y.getModuleCount=function(){return p},y.make=function(){if(b<1){for(var E=1;E<40;E++){for(var L=ee.getRSBlocks(E,h),R=re(),Y=0;Y<c.length;Y++){var I=c[Y];R.put(I.getMode(),4),R.put(I.getLength(),B.getLengthInBits(I.getMode(),E)),I.write(R)}var de=0;for(Y=0;Y<L.length;Y++)de+=L[Y].dataCount;if(R.getLengthInBits()<=8*de)break}b=E}D(!1,(function(){for(var o=0,l=0,g=0;g<8;g+=1){D(!0,g);var O=B.getLostPoint(y);(g==0||o>O)&&(o=O,l=g)}return l})())},y.createTableTag=function(E,L){E=E||2;var R="";R+='<table style="',R+=" border-width: 0px; border-style: none;",R+=" border-collapse: collapse;",R+=" padding: 0px; margin: "+(L=L===void 0?4*E:L)+"px;",R+='">',R+="<tbody>";for(var Y=0;Y<y.getModuleCount();Y+=1){R+="<tr>";for(var I=0;I<y.getModuleCount();I+=1)R+='<td style="',R+=" border-width: 0px; border-style: none;",R+=" border-collapse: collapse;",R+=" padding: 0px; margin: 0px;",R+=" width: "+E+"px;",R+=" height: "+E+"px;",R+=" background-color: ",R+=y.isDark(Y,I)?"#000000":"#ffffff",R+=";",R+='"/>';R+="</tr>"}return(R+="</tbody>")+"</table>"},y.createSvgTag=function(E,L,R,Y){var I={};typeof arguments[0]=="object"&&(E=(I=arguments[0]).cellSize,L=I.margin,R=I.alt,Y=I.title),E=E||2,L=L===void 0?4*E:L,(R=typeof R=="string"?{text:R}:R||{}).text=R.text||null,R.id=R.text?R.id||"qrcode-description":null,(Y=typeof Y=="string"?{text:Y}:Y||{}).text=Y.text||null,Y.id=Y.text?Y.id||"qrcode-title":null;var de,o,l,g,O=y.getModuleCount()*E+2*L,$="";for(g="l"+E+",0 0,"+E+" -"+E+",0 0,-"+E+"z ",$+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',$+=I.scalable?"":' width="'+O+'px" height="'+O+'px"',$+=' viewBox="0 0 '+O+" "+O+'" ',$+=' preserveAspectRatio="xMinYMin meet"',$+=Y.text||R.text?' role="img" aria-labelledby="'+ue([Y.id,R.id].join(" ").trim())+'"':"",$+=">",$+=Y.text?'<title id="'+ue(Y.id)+'">'+ue(Y.text)+"</title>":"",$+=R.text?'<description id="'+ue(R.id)+'">'+ue(R.text)+"</description>":"",$+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',$+='<path d="',o=0;o<y.getModuleCount();o+=1)for(l=o*E+L,de=0;de<y.getModuleCount();de+=1)y.isDark(o,de)&&($+="M"+(de*E+L)+","+l+g);return($+='" stroke="transparent" fill="black"/>')+"</svg>"},y.createDataURL=function(E,L){E=E||2,L=L===void 0?4*E:L;var R=y.getModuleCount()*E+2*L,Y=L,I=R-L;return ne(R,R,function(de,o){if(Y<=de&&de<I&&Y<=o&&o<I){var l=Math.floor((de-Y)/E),g=Math.floor((o-Y)/E);return y.isDark(g,l)?0:1}return 1})},y.createImgTag=function(E,L,R){E=E||2,L=L===void 0?4*E:L;var Y=y.getModuleCount()*E+2*L,I="";return I+="<img",I+=' src="',I+=y.createDataURL(E,L),I+='"',I+=' width="',I+=Y,I+='"',I+=' height="',I+=Y,I+='"',R&&(I+=' alt="',I+=ue(R),I+='"'),I+"/>"};var ue=function(E){for(var L="",R=0;R<E.length;R+=1){var Y=E.charAt(R);switch(Y){case"<":L+="<";break;case">":L+=">";break;case"&":L+="&";break;case'"':L+=""";break;default:L+=Y}}return L};return y.createASCII=function(E,L){if((E=E||1)<2)return(function(ce){ce=ce===void 0?2:ce;var fe,oe,pe,me,ge,xe=1*y.getModuleCount()+2*ce,Ce=ce,ke=xe-ce,qe={"██":"█","█ ":"▀"," █":"▄"," ":" "},$e={"██":"▀","█ ":"▀"," █":" "," ":" "},_e="";for(fe=0;fe<xe;fe+=2){for(pe=Math.floor((fe-Ce)/1),me=Math.floor((fe+1-Ce)/1),oe=0;oe<xe;oe+=1)ge="█",Ce<=oe&&oe<ke&&Ce<=fe&&fe<ke&&y.isDark(pe,Math.floor((oe-Ce)/1))&&(ge=" "),Ce<=oe&&oe<ke&&Ce<=fe+1&&fe+1<ke&&y.isDark(me,Math.floor((oe-Ce)/1))?ge+=" ":ge+="█",_e+=ce<1&&fe+1>=ke?$e[ge]:qe[ge];_e+=`
|
|
20
|
+
`}return xe%2&&ce>0?_e.substring(0,_e.length-xe-1)+Array(xe+1).join("▀"):_e.substring(0,_e.length-1)})(L);E-=1,L=L===void 0?2*E:L;var R,Y,I,de,o=y.getModuleCount()*E+2*L,l=L,g=o-L,O=Array(E+1).join("██"),$=Array(E+1).join(" "),z="",le="";for(R=0;R<o;R+=1){for(I=Math.floor((R-l)/E),le="",Y=0;Y<o;Y+=1)de=1,l<=Y&&Y<g&&l<=R&&R<g&&y.isDark(I,Math.floor((Y-l)/E))&&(de=0),le+=de?O:$;for(I=0;I<E;I+=1)z+=le+`
|
|
21
|
+
`}return z.substring(0,z.length-1)},y.renderTo2dContext=function(E,L){L=L||2;for(var R=y.getModuleCount(),Y=0;Y<R;Y++)for(var I=0;I<R;I++)E.fillStyle=y.isDark(Y,I)?"black":"white",E.fillRect(Y*L,I*L,L,L)},y};M.stringToBytes=(M.stringToBytesFuncs={default:function(k){for(var C=[],b=0;b<k.length;b+=1){var h=k.charCodeAt(b);C.push(255&h)}return C}}).default,M.createStringToBytes=function(k,C){var b=(function(){for(var a=ae(k),p=function(){var W=a.read();if(W==-1)throw"eof";return W},f=0,c={};;){var y=a.read();if(y==-1)break;var D=p(),j=p()<<8|p();c[String.fromCharCode(y<<8|D)]=j,f+=1}if(f!=C)throw f+" != "+C;return c})(),h=63;return function(a){for(var p=[],f=0;f<a.length;f+=1){var c=a.charCodeAt(f);if(c<128)p.push(c);else{var y=b[a.charAt(f)];typeof y=="number"?(255&y)==y?p.push(y):(p.push(y>>>8),p.push(255&y)):p.push(h)}}return p}};var S,x,P,A,N,F={L:1,M:0,Q:3,H:2},B=(S=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],x=1335,P=7973,N=function(k){for(var C=0;k!=0;)C+=1,k>>>=1;return C},(A={}).getBCHTypeInfo=function(k){for(var C=k<<10;N(C)-N(x)>=0;)C^=x<<N(C)-N(x);return 21522^(k<<10|C)},A.getBCHTypeNumber=function(k){for(var C=k<<12;N(C)-N(P)>=0;)C^=P<<N(C)-N(P);return k<<12|C},A.getPatternPosition=function(k){return S[k-1]},A.getMaskFunction=function(k){switch(k){case 0:return function(C,b){return(C+b)%2==0};case 1:return function(C,b){return C%2==0};case 2:return function(C,b){return b%3==0};case 3:return function(C,b){return(C+b)%3==0};case 4:return function(C,b){return(Math.floor(C/2)+Math.floor(b/3))%2==0};case 5:return function(C,b){return C*b%2+C*b%3==0};case 6:return function(C,b){return(C*b%2+C*b%3)%2==0};case 7:return function(C,b){return(C*b%3+(C+b)%2)%2==0};default:throw"bad maskPattern:"+k}},A.getErrorCorrectPolynomial=function(k){for(var C=U([1],0),b=0;b<k;b+=1)C=C.multiply(U([1,Q.gexp(b)],0));return C},A.getLengthInBits=function(k,C){if(1<=C&&C<10)switch(k){case 1:return 10;case 2:return 9;case 4:case 8:return 8;default:throw"mode:"+k}else if(C<27)switch(k){case 1:return 12;case 2:return 11;case 4:return 16;case 8:return 10;default:throw"mode:"+k}else{if(!(C<41))throw"type:"+C;switch(k){case 1:return 14;case 2:return 13;case 4:return 16;case 8:return 12;default:throw"mode:"+k}}},A.getLostPoint=function(k){for(var C=k.getModuleCount(),b=0,h=0;h<C;h+=1)for(var a=0;a<C;a+=1){for(var p=0,f=k.isDark(h,a),c=-1;c<=1;c+=1)if(!(h+c<0||C<=h+c))for(var y=-1;y<=1;y+=1)a+y<0||C<=a+y||c==0&&y==0||f==k.isDark(h+c,a+y)&&(p+=1);p>5&&(b+=3+p-5)}for(h=0;h<C-1;h+=1)for(a=0;a<C-1;a+=1){var D=0;k.isDark(h,a)&&(D+=1),k.isDark(h+1,a)&&(D+=1),k.isDark(h,a+1)&&(D+=1),k.isDark(h+1,a+1)&&(D+=1),D!=0&&D!=4||(b+=3)}for(h=0;h<C;h+=1)for(a=0;a<C-6;a+=1)k.isDark(h,a)&&!k.isDark(h,a+1)&&k.isDark(h,a+2)&&k.isDark(h,a+3)&&k.isDark(h,a+4)&&!k.isDark(h,a+5)&&k.isDark(h,a+6)&&(b+=40);for(a=0;a<C;a+=1)for(h=0;h<C-6;h+=1)k.isDark(h,a)&&!k.isDark(h+1,a)&&k.isDark(h+2,a)&&k.isDark(h+3,a)&&k.isDark(h+4,a)&&!k.isDark(h+5,a)&&k.isDark(h+6,a)&&(b+=40);var j=0;for(a=0;a<C;a+=1)for(h=0;h<C;h+=1)k.isDark(h,a)&&(j+=1);return b+Math.abs(100*j/C/C-50)/5*10},A),Q=(function(){for(var k=new Array(256),C=new Array(256),b=0;b<8;b+=1)k[b]=1<<b;for(b=8;b<256;b+=1)k[b]=k[b-4]^k[b-5]^k[b-6]^k[b-8];for(b=0;b<255;b+=1)C[k[b]]=b;return{glog:function(h){if(h<1)throw"glog("+h+")";return C[h]},gexp:function(h){for(;h<0;)h+=255;for(;h>=256;)h-=255;return k[h]}}})();function U(k,C){if(k.length===void 0)throw k.length+"/"+C;var b=(function(){for(var a=0;a<k.length&&k[a]==0;)a+=1;for(var p=new Array(k.length-a+C),f=0;f<k.length-a;f+=1)p[f]=k[f+a];return p})(),h={getAt:function(a){return b[a]},getLength:function(){return b.length},multiply:function(a){for(var p=new Array(h.getLength()+a.getLength()-1),f=0;f<h.getLength();f+=1)for(var c=0;c<a.getLength();c+=1)p[f+c]^=Q.gexp(Q.glog(h.getAt(f))+Q.glog(a.getAt(c)));return U(p,0)},mod:function(a){if(h.getLength()-a.getLength()<0)return h;for(var p=Q.glog(h.getAt(0))-Q.glog(a.getAt(0)),f=new Array(h.getLength()),c=0;c<h.getLength();c+=1)f[c]=h.getAt(c);for(c=0;c<a.getLength();c+=1)f[c]^=Q.gexp(Q.glog(a.getAt(c))+p);return U(f,0).mod(a)}};return h}var ee=(function(){var k=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],C=function(h,a){var p={};return p.totalCount=h,p.dataCount=a,p},b={getRSBlocks:function(h,a){var p=(function(te,H){switch(H){case F.L:return k[4*(te-1)+0];case F.M:return k[4*(te-1)+1];case F.Q:return k[4*(te-1)+2];case F.H:return k[4*(te-1)+3];default:return}})(h,a);if(p===void 0)throw"bad rs block @ typeNumber:"+h+"/errorCorrectionLevel:"+a;for(var f=p.length/3,c=[],y=0;y<f;y+=1)for(var D=p[3*y+0],j=p[3*y+1],W=p[3*y+2],Z=0;Z<D;Z+=1)c.push(C(j,W));return c}};return b})(),re=function(){var k=[],C=0,b={getBuffer:function(){return k},getAt:function(h){var a=Math.floor(h/8);return(k[a]>>>7-h%8&1)==1},put:function(h,a){for(var p=0;p<a;p+=1)b.putBit((h>>>a-p-1&1)==1)},getLengthInBits:function(){return C},putBit:function(h){var a=Math.floor(C/8);k.length<=a&&k.push(0),h&&(k[a]|=128>>>C%8),C+=1}};return b},K=function(k){var C=k,b={getMode:function(){return 1},getLength:function(p){return C.length},write:function(p){for(var f=C,c=0;c+2<f.length;)p.put(h(f.substring(c,c+3)),10),c+=3;c<f.length&&(f.length-c==1?p.put(h(f.substring(c,c+1)),4):f.length-c==2&&p.put(h(f.substring(c,c+2)),7))}},h=function(p){for(var f=0,c=0;c<p.length;c+=1)f=10*f+a(p.charAt(c));return f},a=function(p){if("0"<=p&&p<="9")return p.charCodeAt(0)-48;throw"illegal char :"+p};return b},X=function(k){var C=k,b={getMode:function(){return 2},getLength:function(a){return C.length},write:function(a){for(var p=C,f=0;f+1<p.length;)a.put(45*h(p.charAt(f))+h(p.charAt(f+1)),11),f+=2;f<p.length&&a.put(h(p.charAt(f)),6)}},h=function(a){if("0"<=a&&a<="9")return a.charCodeAt(0)-48;if("A"<=a&&a<="Z")return a.charCodeAt(0)-65+10;switch(a){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+a}};return b},V=function(k){var C=M.stringToBytes(k);return{getMode:function(){return 4},getLength:function(b){return C.length},write:function(b){for(var h=0;h<C.length;h+=1)b.put(C[h],8)}}},q=function(k){var C=M.stringToBytesFuncs.SJIS;if(!C)throw"sjis not supported.";(function(){var a=C("友");if(a.length!=2||(a[0]<<8|a[1])!=38726)throw"sjis not supported."})();var b=C(k),h={getMode:function(){return 8},getLength:function(a){return~~(b.length/2)},write:function(a){for(var p=b,f=0;f+1<p.length;){var c=(255&p[f])<<8|255&p[f+1];if(33088<=c&&c<=40956)c-=33088;else{if(!(57408<=c&&c<=60351))throw"illegal char at "+(f+1)+"/"+c;c-=49472}c=192*(c>>>8&255)+(255&c),a.put(c,13),f+=2}if(f<p.length)throw"illegal char at "+(f+1)}};return h},J=function(){var k=[],C={writeByte:function(b){k.push(255&b)},writeShort:function(b){C.writeByte(b),C.writeByte(b>>>8)},writeBytes:function(b,h,a){h=h||0,a=a||b.length;for(var p=0;p<a;p+=1)C.writeByte(b[p+h])},writeString:function(b){for(var h=0;h<b.length;h+=1)C.writeByte(b.charCodeAt(h))},toByteArray:function(){return k},toString:function(){var b="";b+="[";for(var h=0;h<k.length;h+=1)h>0&&(b+=","),b+=k[h];return b+"]"}};return C},ae=function(k){var C=k,b=0,h=0,a=0,p={read:function(){for(;a<8;){if(b>=C.length){if(a==0)return-1;throw"unexpected end of file./"+a}var c=C.charAt(b);if(b+=1,c=="=")return a=0,-1;c.match(/^\s$/)||(h=h<<6|f(c.charCodeAt(0)),a+=6)}var y=h>>>a-8&255;return a-=8,y}},f=function(c){if(65<=c&&c<=90)return c-65;if(97<=c&&c<=122)return c-97+26;if(48<=c&&c<=57)return c-48+52;if(c==43)return 62;if(c==47)return 63;throw"c:"+c};return p},ne=function(k,C,b){for(var h=(function(j,W){var Z=j,te=W,H=new Array(j*W),se={setPixel:function(E,L,R){H[L*Z+E]=R},write:function(E){E.writeString("GIF87a"),E.writeShort(Z),E.writeShort(te),E.writeByte(128),E.writeByte(0),E.writeByte(0),E.writeByte(0),E.writeByte(0),E.writeByte(0),E.writeByte(255),E.writeByte(255),E.writeByte(255),E.writeString(","),E.writeShort(0),E.writeShort(0),E.writeShort(Z),E.writeShort(te),E.writeByte(0);var L=ie(2);E.writeByte(2);for(var R=0;L.length-R>255;)E.writeByte(255),E.writeBytes(L,R,255),R+=255;E.writeByte(L.length-R),E.writeBytes(L,R,L.length-R),E.writeByte(0),E.writeString(";")}},ie=function(E){for(var L=1<<E,R=1+(1<<E),Y=E+1,I=ue(),de=0;de<L;de+=1)I.add(String.fromCharCode(de));I.add(String.fromCharCode(L)),I.add(String.fromCharCode(R));var o,l,g,O=J(),$=(o=O,l=0,g=0,{write:function(fe,oe){if(fe>>>oe)throw"length over";for(;l+oe>=8;)o.writeByte(255&(fe<<l|g)),oe-=8-l,fe>>>=8-l,g=0,l=0;g|=fe<<l,l+=oe},flush:function(){l>0&&o.writeByte(g)}});$.write(L,Y);var z=0,le=String.fromCharCode(H[z]);for(z+=1;z<H.length;){var ce=String.fromCharCode(H[z]);z+=1,I.contains(le+ce)?le+=ce:($.write(I.indexOf(le),Y),I.size()<4095&&(I.size()==1<<Y&&(Y+=1),I.add(le+ce)),le=ce)}return $.write(I.indexOf(le),Y),$.write(R,Y),$.flush(),O.toByteArray()},ue=function(){var E={},L=0,R={add:function(Y){if(R.contains(Y))throw"dup key:"+Y;E[Y]=L,L+=1},size:function(){return L},indexOf:function(Y){return E[Y]},contains:function(Y){return E[Y]!==void 0}};return R};return se})(k,C),a=0;a<C;a+=1)for(var p=0;p<k;p+=1)h.setPixel(p,a,b(p,a));var f=J();h.write(f);for(var c=(function(){var j=0,W=0,Z=0,te="",H={},se=function(ue){te+=String.fromCharCode(ie(63&ue))},ie=function(ue){if(!(ue<0)){if(ue<26)return 65+ue;if(ue<52)return ue-26+97;if(ue<62)return ue-52+48;if(ue==62)return 43;if(ue==63)return 47}throw"n:"+ue};return H.writeByte=function(ue){for(j=j<<8|255&ue,W+=8,Z+=1;W>=6;)se(j>>>W-6),W-=6},H.flush=function(){if(W>0&&(se(j<<6-W),j=0,W=0),Z%3!=0)for(var ue=3-Z%3,E=0;E<ue;E+=1)te+="="},H.toString=function(){return te},H})(),y=f.toByteArray(),D=0;D<y.length;D+=1)c.writeByte(y[D]);return c.flush(),"data:image/gif;base64,"+c};return M})();_.stringToBytesFuncs["UTF-8"]=function(M){return(function(S){for(var x=[],P=0;P<S.length;P++){var A=S.charCodeAt(P);A<128?x.push(A):A<2048?x.push(192|A>>6,128|63&A):A<55296||A>=57344?x.push(224|A>>12,128|A>>6&63,128|63&A):(P++,A=65536+((1023&A)<<10|1023&S.charCodeAt(P)),x.push(240|A>>18,128|A>>12&63,128|A>>6&63,128|63&A))}return x})(M)},(v=typeof(m=function(){return _})=="function"?m.apply(i,[]):m)===void 0||(d.exports=v)}},n={};function s(d){var i=n[d];if(i!==void 0)return i.exports;var m=n[d]={exports:{}};return r[d](m,m.exports,s),m.exports}s.n=d=>{var i=d&&d.__esModule?()=>d.default:()=>d;return s.d(i,{a:i}),i},s.d=(d,i)=>{for(var m in i)s.o(i,m)&&!s.o(d,m)&&Object.defineProperty(d,m,{enumerable:!0,get:i[m]})},s.o=(d,i)=>Object.prototype.hasOwnProperty.call(d,i);var u={};return(()=>{s.d(u,{default:()=>C});const d=b=>!!b&&typeof b=="object"&&!Array.isArray(b);function i(b,...h){if(!h.length)return b;const a=h.shift();return a!==void 0&&d(b)&&d(a)?(b=Object.assign({},b),Object.keys(a).forEach(p=>{const f=b[p],c=a[p];Array.isArray(f)&&Array.isArray(c)?b[p]=c:d(f)&&d(c)?b[p]=i(Object.assign({},f),c):b[p]=c}),i(b,...h)):b}function m(b,h){const a=document.createElement("a");a.download=h,a.href=b,document.body.appendChild(a),a.click(),document.body.removeChild(a)}const v={L:.07,M:.15,Q:.25,H:.3};class _{constructor({svg:h,type:a,window:p}){this._svg=h,this._type=a,this._window=p}draw(h,a,p,f){let c;switch(this._type){case"dots":c=this._drawDot;break;case"classy":c=this._drawClassy;break;case"classy-rounded":c=this._drawClassyRounded;break;case"rounded":c=this._drawRounded;break;case"extra-rounded":c=this._drawExtraRounded;break;default:c=this._drawSquare}c.call(this,{x:h,y:a,size:p,getNeighbor:f})}_rotateFigure({x:h,y:a,size:p,rotation:f=0,draw:c}){var y;const D=h+p/2,j=a+p/2;c(),(y=this._element)===null||y===void 0||y.setAttribute("transform",`rotate(${180*f/Math.PI},${D},${j})`)}_basicDot(h){const{size:a,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","circle"),this._element.setAttribute("cx",String(p+a/2)),this._element.setAttribute("cy",String(f+a/2)),this._element.setAttribute("r",String(a/2))}}))}_basicSquare(h){const{size:a,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect"),this._element.setAttribute("x",String(p)),this._element.setAttribute("y",String(f)),this._element.setAttribute("width",String(a)),this._element.setAttribute("height",String(a))}}))}_basicSideRounded(h){const{size:a,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${p} ${f}v ${a}h `+a/2+`a ${a/2} ${a/2}, 0, 0, 0, 0 ${-a}`)}}))}_basicCornerRounded(h){const{size:a,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${p} ${f}v ${a}h ${a}v `+-a/2+`a ${a/2} ${a/2}, 0, 0, 0, ${-a/2} ${-a/2}`)}}))}_basicCornerExtraRounded(h){const{size:a,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${p} ${f}v ${a}h ${a}a ${a} ${a}, 0, 0, 0, ${-a} ${-a}`)}}))}_basicCornersRounded(h){const{size:a,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${p} ${f}v `+a/2+`a ${a/2} ${a/2}, 0, 0, 0, ${a/2} ${a/2}h `+a/2+"v "+-a/2+`a ${a/2} ${a/2}, 0, 0, 0, ${-a/2} ${-a/2}`)}}))}_drawDot({x:h,y:a,size:p}){this._basicDot({x:h,y:a,size:p,rotation:0})}_drawSquare({x:h,y:a,size:p}){this._basicSquare({x:h,y:a,size:p,rotation:0})}_drawRounded({x:h,y:a,size:p,getNeighbor:f}){const c=f?+f(-1,0):0,y=f?+f(1,0):0,D=f?+f(0,-1):0,j=f?+f(0,1):0,W=c+y+D+j;if(W!==0)if(W>2||c&&y||D&&j)this._basicSquare({x:h,y:a,size:p,rotation:0});else{if(W===2){let Z=0;return c&&D?Z=Math.PI/2:D&&y?Z=Math.PI:y&&j&&(Z=-Math.PI/2),void this._basicCornerRounded({x:h,y:a,size:p,rotation:Z})}if(W===1){let Z=0;return D?Z=Math.PI/2:y?Z=Math.PI:j&&(Z=-Math.PI/2),void this._basicSideRounded({x:h,y:a,size:p,rotation:Z})}}else this._basicDot({x:h,y:a,size:p,rotation:0})}_drawExtraRounded({x:h,y:a,size:p,getNeighbor:f}){const c=f?+f(-1,0):0,y=f?+f(1,0):0,D=f?+f(0,-1):0,j=f?+f(0,1):0,W=c+y+D+j;if(W!==0)if(W>2||c&&y||D&&j)this._basicSquare({x:h,y:a,size:p,rotation:0});else{if(W===2){let Z=0;return c&&D?Z=Math.PI/2:D&&y?Z=Math.PI:y&&j&&(Z=-Math.PI/2),void this._basicCornerExtraRounded({x:h,y:a,size:p,rotation:Z})}if(W===1){let Z=0;return D?Z=Math.PI/2:y?Z=Math.PI:j&&(Z=-Math.PI/2),void this._basicSideRounded({x:h,y:a,size:p,rotation:Z})}}else this._basicDot({x:h,y:a,size:p,rotation:0})}_drawClassy({x:h,y:a,size:p,getNeighbor:f}){const c=f?+f(-1,0):0,y=f?+f(1,0):0,D=f?+f(0,-1):0,j=f?+f(0,1):0;c+y+D+j!==0?c||D?y||j?this._basicSquare({x:h,y:a,size:p,rotation:0}):this._basicCornerRounded({x:h,y:a,size:p,rotation:Math.PI/2}):this._basicCornerRounded({x:h,y:a,size:p,rotation:-Math.PI/2}):this._basicCornersRounded({x:h,y:a,size:p,rotation:Math.PI/2})}_drawClassyRounded({x:h,y:a,size:p,getNeighbor:f}){const c=f?+f(-1,0):0,y=f?+f(1,0):0,D=f?+f(0,-1):0,j=f?+f(0,1):0;c+y+D+j!==0?c||D?y||j?this._basicSquare({x:h,y:a,size:p,rotation:0}):this._basicCornerExtraRounded({x:h,y:a,size:p,rotation:Math.PI/2}):this._basicCornerExtraRounded({x:h,y:a,size:p,rotation:-Math.PI/2}):this._basicCornersRounded({x:h,y:a,size:p,rotation:Math.PI/2})}}const M={dot:"dot",square:"square",extraRounded:"extra-rounded"},S=Object.values(M);class x{constructor({svg:h,type:a,window:p}){this._svg=h,this._type=a,this._window=p}draw(h,a,p,f){let c;switch(this._type){case M.square:c=this._drawSquare;break;case M.extraRounded:c=this._drawExtraRounded;break;default:c=this._drawDot}c.call(this,{x:h,y:a,size:p,rotation:f})}_rotateFigure({x:h,y:a,size:p,rotation:f=0,draw:c}){var y;const D=h+p/2,j=a+p/2;c(),(y=this._element)===null||y===void 0||y.setAttribute("transform",`rotate(${180*f/Math.PI},${D},${j})`)}_basicDot(h){const{size:a,x:p,y:f}=h,c=a/7;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("clip-rule","evenodd"),this._element.setAttribute("d",`M ${p+a/2} ${f}a ${a/2} ${a/2} 0 1 0 0.1 0zm 0 ${c}a ${a/2-c} ${a/2-c} 0 1 1 -0.1 0Z`)}}))}_basicSquare(h){const{size:a,x:p,y:f}=h,c=a/7;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("clip-rule","evenodd"),this._element.setAttribute("d",`M ${p} ${f}v ${a}h ${a}v `+-a+`zM ${p+c} ${f+c}h `+(a-2*c)+"v "+(a-2*c)+"h "+(2*c-a)+"z")}}))}_basicExtraRounded(h){const{size:a,x:p,y:f}=h,c=a/7;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("clip-rule","evenodd"),this._element.setAttribute("d",`M ${p} ${f+2.5*c}v `+2*c+`a ${2.5*c} ${2.5*c}, 0, 0, 0, ${2.5*c} ${2.5*c}h `+2*c+`a ${2.5*c} ${2.5*c}, 0, 0, 0, ${2.5*c} ${2.5*-c}v `+-2*c+`a ${2.5*c} ${2.5*c}, 0, 0, 0, ${2.5*-c} ${2.5*-c}h `+-2*c+`a ${2.5*c} ${2.5*c}, 0, 0, 0, ${2.5*-c} ${2.5*c}M ${p+2.5*c} ${f+c}h `+2*c+`a ${1.5*c} ${1.5*c}, 0, 0, 1, ${1.5*c} ${1.5*c}v `+2*c+`a ${1.5*c} ${1.5*c}, 0, 0, 1, ${1.5*-c} ${1.5*c}h `+-2*c+`a ${1.5*c} ${1.5*c}, 0, 0, 1, ${1.5*-c} ${1.5*-c}v `+-2*c+`a ${1.5*c} ${1.5*c}, 0, 0, 1, ${1.5*c} ${1.5*-c}`)}}))}_drawDot({x:h,y:a,size:p,rotation:f}){this._basicDot({x:h,y:a,size:p,rotation:f})}_drawSquare({x:h,y:a,size:p,rotation:f}){this._basicSquare({x:h,y:a,size:p,rotation:f})}_drawExtraRounded({x:h,y:a,size:p,rotation:f}){this._basicExtraRounded({x:h,y:a,size:p,rotation:f})}}const P={dot:"dot",square:"square"},A=Object.values(P);class N{constructor({svg:h,type:a,window:p}){this._svg=h,this._type=a,this._window=p}draw(h,a,p,f){let c;c=this._type===P.square?this._drawSquare:this._drawDot,c.call(this,{x:h,y:a,size:p,rotation:f})}_rotateFigure({x:h,y:a,size:p,rotation:f=0,draw:c}){var y;const D=h+p/2,j=a+p/2;c(),(y=this._element)===null||y===void 0||y.setAttribute("transform",`rotate(${180*f/Math.PI},${D},${j})`)}_basicDot(h){const{size:a,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","circle"),this._element.setAttribute("cx",String(p+a/2)),this._element.setAttribute("cy",String(f+a/2)),this._element.setAttribute("r",String(a/2))}}))}_basicSquare(h){const{size:a,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect"),this._element.setAttribute("x",String(p)),this._element.setAttribute("y",String(f)),this._element.setAttribute("width",String(a)),this._element.setAttribute("height",String(a))}}))}_drawDot({x:h,y:a,size:p,rotation:f}){this._basicDot({x:h,y:a,size:p,rotation:f})}_drawSquare({x:h,y:a,size:p,rotation:f}){this._basicSquare({x:h,y:a,size:p,rotation:f})}}const F="circle",B=[[1,1,1,1,1,1,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,1,1,1,1,1,1]],Q=[[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,1,1,1,0,0],[0,0,1,1,1,0,0],[0,0,1,1,1,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]];class U{constructor(h,a){this._roundSize=p=>this._options.dotsOptions.roundSize?Math.floor(p):p,this._window=a,this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("width",String(h.width)),this._element.setAttribute("height",String(h.height)),this._element.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),h.dotsOptions.roundSize||this._element.setAttribute("shape-rendering","crispEdges"),this._element.setAttribute("viewBox",`0 0 ${h.width} ${h.height}`),this._defs=this._window.document.createElementNS("http://www.w3.org/2000/svg","defs"),this._element.appendChild(this._defs),this._imageUri=h.image,this._instanceId=U.instanceCount++,this._options=h}get width(){return this._options.width}get height(){return this._options.height}getElement(){return this._element}async drawQR(h){const a=h.getModuleCount(),p=Math.min(this._options.width,this._options.height)-2*this._options.margin,f=this._options.shape===F?p/Math.sqrt(2):p,c=this._roundSize(f/a);let y={hideXDots:0,hideYDots:0,width:0,height:0};if(this._qr=h,this._options.image){if(await this.loadImage(),!this._image)return;const{imageOptions:D,qrOptions:j}=this._options,W=D.imageSize*v[j.errorCorrectionLevel],Z=Math.floor(W*a*a);y=(function({originalHeight:te,originalWidth:H,maxHiddenDots:se,maxHiddenAxisDots:ie,dotSize:ue}){const E={x:0,y:0},L={x:0,y:0};if(te<=0||H<=0||se<=0||ue<=0)return{height:0,width:0,hideYDots:0,hideXDots:0};const R=te/H;return E.x=Math.floor(Math.sqrt(se/R)),E.x<=0&&(E.x=1),ie&&ie<E.x&&(E.x=ie),E.x%2==0&&E.x--,L.x=E.x*ue,E.y=1+2*Math.ceil((E.x*R-1)/2),L.y=Math.round(L.x*R),(E.y*E.x>se||ie&&ie<E.y)&&(ie&&ie<E.y?(E.y=ie,E.y%2==0&&E.x--):E.y-=2,L.y=E.y*ue,E.x=1+2*Math.ceil((E.y/R-1)/2),L.x=Math.round(L.y/R)),{height:L.y,width:L.x,hideYDots:E.y,hideXDots:E.x}})({originalWidth:this._image.width,originalHeight:this._image.height,maxHiddenDots:Z,maxHiddenAxisDots:a-14,dotSize:c})}this.drawBackground(),this.drawDots((D,j)=>{var W,Z,te,H,se,ie;return!(this._options.imageOptions.hideBackgroundDots&&D>=(a-y.hideYDots)/2&&D<(a+y.hideYDots)/2&&j>=(a-y.hideXDots)/2&&j<(a+y.hideXDots)/2||!((W=B[D])===null||W===void 0)&&W[j]||!((Z=B[D-a+7])===null||Z===void 0)&&Z[j]||!((te=B[D])===null||te===void 0)&&te[j-a+7]||!((H=Q[D])===null||H===void 0)&&H[j]||!((se=Q[D-a+7])===null||se===void 0)&&se[j]||!((ie=Q[D])===null||ie===void 0)&&ie[j-a+7])}),this.drawCorners(),this._options.image&&await this.drawImage({width:y.width,height:y.height,count:a,dotSize:c})}drawBackground(){var h,a,p;const f=this._element,c=this._options;if(f){const y=(h=c.backgroundOptions)===null||h===void 0?void 0:h.gradient,D=(a=c.backgroundOptions)===null||a===void 0?void 0:a.color;let j=c.height,W=c.width;if(y||D){const Z=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect");this._backgroundClipPath=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),this._backgroundClipPath.setAttribute("id",`clip-path-background-color-${this._instanceId}`),this._defs.appendChild(this._backgroundClipPath),!((p=c.backgroundOptions)===null||p===void 0)&&p.round&&(j=W=Math.min(c.width,c.height),Z.setAttribute("rx",String(j/2*c.backgroundOptions.round))),Z.setAttribute("x",String(this._roundSize((c.width-W)/2))),Z.setAttribute("y",String(this._roundSize((c.height-j)/2))),Z.setAttribute("width",String(W)),Z.setAttribute("height",String(j)),this._backgroundClipPath.appendChild(Z),this._createColor({options:y,color:D,additionalRotation:0,x:0,y:0,height:c.height,width:c.width,name:`background-color-${this._instanceId}`})}}}drawDots(h){var a,p;if(!this._qr)throw"QR code is not defined";const f=this._options,c=this._qr.getModuleCount();if(c>f.width||c>f.height)throw"The canvas is too small.";const y=Math.min(f.width,f.height)-2*f.margin,D=f.shape===F?y/Math.sqrt(2):y,j=this._roundSize(D/c),W=this._roundSize((f.width-c*j)/2),Z=this._roundSize((f.height-c*j)/2),te=new _({svg:this._element,type:f.dotsOptions.type,window:this._window});this._dotsClipPath=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),this._dotsClipPath.setAttribute("id",`clip-path-dot-color-${this._instanceId}`),this._defs.appendChild(this._dotsClipPath),this._createColor({options:(a=f.dotsOptions)===null||a===void 0?void 0:a.gradient,color:f.dotsOptions.color,additionalRotation:0,x:0,y:0,height:f.height,width:f.width,name:`dot-color-${this._instanceId}`});for(let H=0;H<c;H++)for(let se=0;se<c;se++)h&&!h(H,se)||!((p=this._qr)===null||p===void 0)&&p.isDark(H,se)&&(te.draw(W+se*j,Z+H*j,j,(ie,ue)=>!(se+ie<0||H+ue<0||se+ie>=c||H+ue>=c)&&!(h&&!h(H+ue,se+ie))&&!!this._qr&&this._qr.isDark(H+ue,se+ie)),te._element&&this._dotsClipPath&&this._dotsClipPath.appendChild(te._element));if(f.shape===F){const H=this._roundSize((y/j-c)/2),se=c+2*H,ie=W-H*j,ue=Z-H*j,E=[],L=this._roundSize(se/2);for(let R=0;R<se;R++){E[R]=[];for(let Y=0;Y<se;Y++)R>=H-1&&R<=se-H&&Y>=H-1&&Y<=se-H||Math.sqrt((R-L)*(R-L)+(Y-L)*(Y-L))>L?E[R][Y]=0:E[R][Y]=this._qr.isDark(Y-2*H<0?Y:Y>=c?Y-2*H:Y-H,R-2*H<0?R:R>=c?R-2*H:R-H)?1:0}for(let R=0;R<se;R++)for(let Y=0;Y<se;Y++)E[R][Y]&&(te.draw(ie+Y*j,ue+R*j,j,(I,de)=>{var o;return!!(!((o=E[R+de])===null||o===void 0)&&o[Y+I])}),te._element&&this._dotsClipPath&&this._dotsClipPath.appendChild(te._element))}}drawCorners(){if(!this._qr)throw"QR code is not defined";const h=this._element,a=this._options;if(!h)throw"Element code is not defined";const p=this._qr.getModuleCount(),f=Math.min(a.width,a.height)-2*a.margin,c=a.shape===F?f/Math.sqrt(2):f,y=this._roundSize(c/p),D=7*y,j=3*y,W=this._roundSize((a.width-p*y)/2),Z=this._roundSize((a.height-p*y)/2);[[0,0,0],[1,0,Math.PI/2],[0,1,-Math.PI/2]].forEach(([te,H,se])=>{var ie,ue,E,L,R,Y,I,de,o,l,g,O,$,z;const le=W+te*y*(p-7),ce=Z+H*y*(p-7);let fe=this._dotsClipPath,oe=this._dotsClipPath;if((!((ie=a.cornersSquareOptions)===null||ie===void 0)&&ie.gradient||!((ue=a.cornersSquareOptions)===null||ue===void 0)&&ue.color)&&(fe=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),fe.setAttribute("id",`clip-path-corners-square-color-${te}-${H}-${this._instanceId}`),this._defs.appendChild(fe),this._cornersSquareClipPath=this._cornersDotClipPath=oe=fe,this._createColor({options:(E=a.cornersSquareOptions)===null||E===void 0?void 0:E.gradient,color:(L=a.cornersSquareOptions)===null||L===void 0?void 0:L.color,additionalRotation:se,x:le,y:ce,height:D,width:D,name:`corners-square-color-${te}-${H}-${this._instanceId}`})),((R=a.cornersSquareOptions)===null||R===void 0?void 0:R.type)&&S.includes(a.cornersSquareOptions.type)){const pe=new x({svg:this._element,type:a.cornersSquareOptions.type,window:this._window});pe.draw(le,ce,D,se),pe._element&&fe&&fe.appendChild(pe._element)}else{const pe=new _({svg:this._element,type:((Y=a.cornersSquareOptions)===null||Y===void 0?void 0:Y.type)||a.dotsOptions.type,window:this._window});for(let me=0;me<B.length;me++)for(let ge=0;ge<B[me].length;ge++)!((I=B[me])===null||I===void 0)&&I[ge]&&(pe.draw(le+ge*y,ce+me*y,y,(xe,Ce)=>{var ke;return!!(!((ke=B[me+Ce])===null||ke===void 0)&&ke[ge+xe])}),pe._element&&fe&&fe.appendChild(pe._element))}if((!((de=a.cornersDotOptions)===null||de===void 0)&&de.gradient||!((o=a.cornersDotOptions)===null||o===void 0)&&o.color)&&(oe=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),oe.setAttribute("id",`clip-path-corners-dot-color-${te}-${H}-${this._instanceId}`),this._defs.appendChild(oe),this._cornersDotClipPath=oe,this._createColor({options:(l=a.cornersDotOptions)===null||l===void 0?void 0:l.gradient,color:(g=a.cornersDotOptions)===null||g===void 0?void 0:g.color,additionalRotation:se,x:le+2*y,y:ce+2*y,height:j,width:j,name:`corners-dot-color-${te}-${H}-${this._instanceId}`})),((O=a.cornersDotOptions)===null||O===void 0?void 0:O.type)&&A.includes(a.cornersDotOptions.type)){const pe=new N({svg:this._element,type:a.cornersDotOptions.type,window:this._window});pe.draw(le+2*y,ce+2*y,j,se),pe._element&&oe&&oe.appendChild(pe._element)}else{const pe=new _({svg:this._element,type:(($=a.cornersDotOptions)===null||$===void 0?void 0:$.type)||a.dotsOptions.type,window:this._window});for(let me=0;me<Q.length;me++)for(let ge=0;ge<Q[me].length;ge++)!((z=Q[me])===null||z===void 0)&&z[ge]&&(pe.draw(le+ge*y,ce+me*y,y,(xe,Ce)=>{var ke;return!!(!((ke=Q[me+Ce])===null||ke===void 0)&&ke[ge+xe])}),pe._element&&oe&&oe.appendChild(pe._element))}})}loadImage(){return new Promise((h,a)=>{var p;const f=this._options;if(!f.image)return a("Image is not defined");if(!((p=f.nodeCanvas)===null||p===void 0)&&p.loadImage)f.nodeCanvas.loadImage(f.image).then(c=>{var y,D;if(this._image=c,this._options.imageOptions.saveAsBlob){const j=(y=f.nodeCanvas)===null||y===void 0?void 0:y.createCanvas(this._image.width,this._image.height);(D=j?.getContext("2d"))===null||D===void 0||D.drawImage(c,0,0),this._imageUri=j?.toDataURL()}h()}).catch(a);else{const c=new this._window.Image;typeof f.imageOptions.crossOrigin=="string"&&(c.crossOrigin=f.imageOptions.crossOrigin),this._image=c,c.onload=async()=>{this._options.imageOptions.saveAsBlob&&(this._imageUri=await(async function(y,D){return new Promise(j=>{const W=new D.XMLHttpRequest;W.onload=function(){const Z=new D.FileReader;Z.onloadend=function(){j(Z.result)},Z.readAsDataURL(W.response)},W.open("GET",y),W.responseType="blob",W.send()})})(f.image||"",this._window)),h()},c.src=f.image}})}async drawImage({width:h,height:a,count:p,dotSize:f}){const c=this._options,y=this._roundSize((c.width-p*f)/2),D=this._roundSize((c.height-p*f)/2),j=y+this._roundSize(c.imageOptions.margin+(p*f-h)/2),W=D+this._roundSize(c.imageOptions.margin+(p*f-a)/2),Z=h-2*c.imageOptions.margin,te=a-2*c.imageOptions.margin,H=this._window.document.createElementNS("http://www.w3.org/2000/svg","image");H.setAttribute("href",this._imageUri||""),H.setAttribute("xlink:href",this._imageUri||""),H.setAttribute("x",String(j)),H.setAttribute("y",String(W)),H.setAttribute("width",`${Z}px`),H.setAttribute("height",`${te}px`),this._element.appendChild(H)}_createColor({options:h,color:a,additionalRotation:p,x:f,y:c,height:y,width:D,name:j}){const W=D>y?D:y,Z=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect");if(Z.setAttribute("x",String(f)),Z.setAttribute("y",String(c)),Z.setAttribute("height",String(y)),Z.setAttribute("width",String(D)),Z.setAttribute("clip-path",`url('#clip-path-${j}')`),h){let te;if(h.type==="radial")te=this._window.document.createElementNS("http://www.w3.org/2000/svg","radialGradient"),te.setAttribute("id",j),te.setAttribute("gradientUnits","userSpaceOnUse"),te.setAttribute("fx",String(f+D/2)),te.setAttribute("fy",String(c+y/2)),te.setAttribute("cx",String(f+D/2)),te.setAttribute("cy",String(c+y/2)),te.setAttribute("r",String(W/2));else{const H=((h.rotation||0)+p)%(2*Math.PI),se=(H+2*Math.PI)%(2*Math.PI);let ie=f+D/2,ue=c+y/2,E=f+D/2,L=c+y/2;se>=0&&se<=.25*Math.PI||se>1.75*Math.PI&&se<=2*Math.PI?(ie-=D/2,ue-=y/2*Math.tan(H),E+=D/2,L+=y/2*Math.tan(H)):se>.25*Math.PI&&se<=.75*Math.PI?(ue-=y/2,ie-=D/2/Math.tan(H),L+=y/2,E+=D/2/Math.tan(H)):se>.75*Math.PI&&se<=1.25*Math.PI?(ie+=D/2,ue+=y/2*Math.tan(H),E-=D/2,L-=y/2*Math.tan(H)):se>1.25*Math.PI&&se<=1.75*Math.PI&&(ue+=y/2,ie+=D/2/Math.tan(H),L-=y/2,E-=D/2/Math.tan(H)),te=this._window.document.createElementNS("http://www.w3.org/2000/svg","linearGradient"),te.setAttribute("id",j),te.setAttribute("gradientUnits","userSpaceOnUse"),te.setAttribute("x1",String(Math.round(ie))),te.setAttribute("y1",String(Math.round(ue))),te.setAttribute("x2",String(Math.round(E))),te.setAttribute("y2",String(Math.round(L)))}h.colorStops.forEach(({offset:H,color:se})=>{const ie=this._window.document.createElementNS("http://www.w3.org/2000/svg","stop");ie.setAttribute("offset",100*H+"%"),ie.setAttribute("stop-color",se),te.appendChild(ie)}),Z.setAttribute("fill",`url('#${j}')`),this._defs.appendChild(te)}else a&&Z.setAttribute("fill",a);this._element.appendChild(Z)}}U.instanceCount=0;const ee=U,re="canvas",K={};for(let b=0;b<=40;b++)K[b]=b;const X={type:re,shape:"square",width:300,height:300,data:"",margin:0,qrOptions:{typeNumber:K[0],mode:void 0,errorCorrectionLevel:"Q"},imageOptions:{saveAsBlob:!0,hideBackgroundDots:!0,imageSize:.4,crossOrigin:void 0,margin:0},dotsOptions:{type:"square",color:"#000",roundSize:!0},backgroundOptions:{round:0,color:"#fff"}};function V(b){const h=Object.assign({},b);if(!h.colorStops||!h.colorStops.length)throw"Field 'colorStops' is required in gradient";return h.rotation?h.rotation=Number(h.rotation):h.rotation=0,h.colorStops=h.colorStops.map(a=>Object.assign(Object.assign({},a),{offset:Number(a.offset)})),h}function q(b){const h=Object.assign({},b);return h.width=Number(h.width),h.height=Number(h.height),h.margin=Number(h.margin),h.imageOptions=Object.assign(Object.assign({},h.imageOptions),{hideBackgroundDots:!!h.imageOptions.hideBackgroundDots,imageSize:Number(h.imageOptions.imageSize),margin:Number(h.imageOptions.margin)}),h.margin>Math.min(h.width,h.height)&&(h.margin=Math.min(h.width,h.height)),h.dotsOptions=Object.assign({},h.dotsOptions),h.dotsOptions.gradient&&(h.dotsOptions.gradient=V(h.dotsOptions.gradient)),h.cornersSquareOptions&&(h.cornersSquareOptions=Object.assign({},h.cornersSquareOptions),h.cornersSquareOptions.gradient&&(h.cornersSquareOptions.gradient=V(h.cornersSquareOptions.gradient))),h.cornersDotOptions&&(h.cornersDotOptions=Object.assign({},h.cornersDotOptions),h.cornersDotOptions.gradient&&(h.cornersDotOptions.gradient=V(h.cornersDotOptions.gradient))),h.backgroundOptions&&(h.backgroundOptions=Object.assign({},h.backgroundOptions),h.backgroundOptions.gradient&&(h.backgroundOptions.gradient=V(h.backgroundOptions.gradient))),h}var J=s(873),ae=s.n(J);function ne(b){if(!b)throw new Error("Extension must be defined");b[0]==="."&&(b=b.substring(1));const h={bmp:"image/bmp",gif:"image/gif",ico:"image/vnd.microsoft.icon",jpeg:"image/jpeg",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml",tif:"image/tiff",tiff:"image/tiff",webp:"image/webp",pdf:"application/pdf"}[b.toLowerCase()];if(!h)throw new Error(`Extension "${b}" is not supported`);return h}class k{constructor(h){h!=null&&h.jsdom?this._window=new h.jsdom("",{resources:"usable"}).window:this._window=window,this._options=h?q(i(X,h)):X,this.update()}static _clearContainer(h){h&&(h.innerHTML="")}_setupSvg(){if(!this._qr)return;const h=new ee(this._options,this._window);this._svg=h.getElement(),this._svgDrawingPromise=h.drawQR(this._qr).then(()=>{var a;this._svg&&((a=this._extension)===null||a===void 0||a.call(this,h.getElement(),this._options))})}_setupCanvas(){var h,a;this._qr&&(!((h=this._options.nodeCanvas)===null||h===void 0)&&h.createCanvas?(this._nodeCanvas=this._options.nodeCanvas.createCanvas(this._options.width,this._options.height),this._nodeCanvas.width=this._options.width,this._nodeCanvas.height=this._options.height):(this._domCanvas=document.createElement("canvas"),this._domCanvas.width=this._options.width,this._domCanvas.height=this._options.height),this._setupSvg(),this._canvasDrawingPromise=(a=this._svgDrawingPromise)===null||a===void 0?void 0:a.then(()=>{var p;if(!this._svg)return;const f=this._svg,c=new this._window.XMLSerializer().serializeToString(f),y=btoa(c),D=`data:${ne("svg")};base64,${y}`;if(!((p=this._options.nodeCanvas)===null||p===void 0)&&p.loadImage)return this._options.nodeCanvas.loadImage(D).then(j=>{var W,Z;j.width=this._options.width,j.height=this._options.height,(Z=(W=this._nodeCanvas)===null||W===void 0?void 0:W.getContext("2d"))===null||Z===void 0||Z.drawImage(j,0,0)});{const j=new this._window.Image;return new Promise(W=>{j.onload=()=>{var Z,te;(te=(Z=this._domCanvas)===null||Z===void 0?void 0:Z.getContext("2d"))===null||te===void 0||te.drawImage(j,0,0),W()},j.src=D})}}))}async _getElement(h="png"){if(!this._qr)throw"QR code is empty";return h.toLowerCase()==="svg"?(this._svg&&this._svgDrawingPromise||this._setupSvg(),await this._svgDrawingPromise,this._svg):((this._domCanvas||this._nodeCanvas)&&this._canvasDrawingPromise||this._setupCanvas(),await this._canvasDrawingPromise,this._domCanvas||this._nodeCanvas)}update(h){k._clearContainer(this._container),this._options=h?q(i(this._options,h)):this._options,this._options.data&&(this._qr=ae()(this._options.qrOptions.typeNumber,this._options.qrOptions.errorCorrectionLevel),this._qr.addData(this._options.data,this._options.qrOptions.mode||(function(a){switch(!0){case/^[0-9]*$/.test(a):return"Numeric";case/^[0-9A-Z $%*+\-./:]*$/.test(a):return"Alphanumeric";default:return"Byte"}})(this._options.data)),this._qr.make(),this._options.type===re?this._setupCanvas():this._setupSvg(),this.append(this._container))}append(h){if(h){if(typeof h.appendChild!="function")throw"Container should be a single DOM node";this._options.type===re?this._domCanvas&&h.appendChild(this._domCanvas):this._svg&&h.appendChild(this._svg),this._container=h}}applyExtension(h){if(!h)throw"Extension function should be defined.";this._extension=h,this.update()}deleteExtension(){this._extension=void 0,this.update()}async getRawData(h="png"){if(!this._qr)throw"QR code is empty";const a=await this._getElement(h),p=ne(h);if(!a)return null;if(h.toLowerCase()==="svg"){const f=`<?xml version="1.0" standalone="no"?>\r
|
|
22
|
+
${new this._window.XMLSerializer().serializeToString(a)}`;return typeof Blob>"u"||this._options.jsdom?Buffer.from(f):new Blob([f],{type:p})}return new Promise(f=>{const c=a;if("toBuffer"in c)if(p==="image/png")f(c.toBuffer(p));else if(p==="image/jpeg")f(c.toBuffer(p));else{if(p!=="application/pdf")throw Error("Unsupported extension");f(c.toBuffer(p))}else"toBlob"in c&&c.toBlob(f,p,1)})}async download(h){if(!this._qr)throw"QR code is empty";if(typeof Blob>"u")throw"Cannot download in Node.js, call getRawData instead.";let a="png",p="qr";typeof h=="string"?(a=h,console.warn("Extension is deprecated as argument for 'download' method, please pass object { name: '...', extension: '...' } as argument")):typeof h=="object"&&h!==null&&(h.name&&(p=h.name),h.extension&&(a=h.extension));const f=await this._getElement(a);if(f)if(a.toLowerCase()==="svg"){let c=new XMLSerializer().serializeToString(f);c=`<?xml version="1.0" standalone="no"?>\r
|
|
23
|
+
`+c,m(`data:${ne(a)};charset=utf-8,${encodeURIComponent(c)}`,`${p}.svg`)}else m(f.toDataURL(ne(a)),`${p}.${a}`)}}const C=k})(),u.default})())})(nn)),nn.exports}fl();const Lo=G.createContext(void 0);function pl(t){const e=Qe.c(9),{children:r,baseUrl:n,queryClient:s}=t;let u;e[0]!==n||e[1]!==s?(u={baseUrl:n,queryClient:s},e[0]=n,e[1]=s,e[2]=u):u=e[2];let d;e[3]!==r||e[4]!==s?(d=w.jsx(Gn,{client:s,children:r}),e[3]=r,e[4]=s,e[5]=d):d=e[5];let i;return e[6]!==u||e[7]!==d?(i=w.jsx(Lo.Provider,{value:u,children:d}),e[6]=u,e[7]=d,e[8]=i):i=e[8],i}function pt(){const t=G.useContext(Lo);if(!t)throw new Error("useDataTable must be used within a DataTableProvider");return t}function on(t){if(typeof t=="string")try{const e=JSON.parse(t);return{message:e.message||t,code:e.code,details:e.details}}catch{return{message:t}}return t instanceof Error?{message:t.message}:{message:"Unbekannter Fehler"}}async function Mt(t){const e=await t.text();if(!e)throw new Error(`HTTP ${t.status}: ${t.statusText}`);let r=null;try{r=JSON.parse(e)}catch{throw new Error(e)}throw r?.message?new Error(r.message):r?.error?new Error(r.error):new Error(e)}function gl(){const t=localStorage.getItem("a360.assumed-org");return t?{"X-Assume-Org":t}:{}}async function Ct(){return{"Content-Type":"application/json",Authorization:`Bearer ${await rl()??""}`,...gl()}}async function Bo(t){return fetch(t,{method:"GET",headers:await Ct()}).then(async e=>(e.status>=400&&await Mt(e),e)).then(e=>e.json()).then(e=>e)}async function Io(t,e){return fetch(`${t}/${e}`,{method:"GET",headers:await Ct()}).then(async r=>(r.status>=400&&await Mt(r),r)).then(r=>r.json()).then(r=>r)}async function Yo(t,e){const r=await fetch(`${t}/${e}`,{method:"DELETE",headers:await Ct()});r.status>=400&&await Mt(r)}async function zo(t,e){return fetch(t,{method:"POST",headers:await Ct(),body:JSON.stringify(e)}).then(async r=>(r.status>=400&&await Mt(r),r)).then(r=>r.status==204?e:r.json()).then(r=>r)}async function ml(t,e,r){return fetch(e,{method:t,headers:await Ct(),body:r?JSON.stringify(r):void 0}).then(async n=>(n.status>=400&&await Mt(n),n)).then(n=>{if(n.status!=204)return n.json()}).then(n=>n)}async function Fo(t,e){return fetch(`${t}/${e.id}`,{method:"PUT",headers:await Ct(),body:JSON.stringify(e)}).then(async r=>(r.status>=400&&await Mt(r),r)).then(r=>r.status==204?e:r.json()).then(r=>r)}function Wo(t,e,r){const n=Qe.c(13),{baseUrl:s}=pt();let u;if(n[0]!==r||n[1]!==e){let v;n[3]!==r?(v=r?.toString(),n[3]=r,n[4]=v):v=n[4],u=[...e.map(yl),String(v)],n[0]=r,n[1]=e,n[2]=u}else u=n[2];let d;n[5]!==t||n[6]!==s||n[7]!==r?(d=()=>Io(`${s}${t}`,r),n[5]=t,n[6]=s,n[7]=r,n[8]=d):d=n[8];const i=!!r;let m;return n[9]!==u||n[10]!==d||n[11]!==i?(m={queryKey:u,queryFn:d,enabled:i},n[9]=u,n[10]=d,n[11]=i,n[12]=m):m=n[12],Kn(m)}function yl(t){return t.toString()}function Uo(t,e,r){const n=Qe.c(9),s=r===void 0?!0:r,{baseUrl:u}=pt();let d;n[0]!==e?(d=[...e.map(vl)],n[0]=e,n[1]=d):d=n[1];let i;n[2]!==t||n[3]!==u?(i=()=>Bo(`${u}${t}`),n[2]=t,n[3]=u,n[4]=i):i=n[4];let m;return n[5]!==s||n[6]!==d||n[7]!==i?(m={queryKey:d,queryFn:i,enabled:s},n[5]=s,n[6]=d,n[7]=i,n[8]=m):m=n[8],Kn(m)}function vl(t){return t.toString()}function qo(t,e){const r=Qe.c(10),{baseUrl:n,queryClient:s}=pt();let u;r[0]!==e?(u=[...e.map(wl)],r[0]=e,r[1]=u):u=r[1];let d;r[2]!==t||r[3]!==n?(d=m=>zo(`${n}${t}`,m),r[2]=t,r[3]=n,r[4]=d):d=r[4];let i;return r[5]!==s||r[6]!==e||r[7]!==u||r[8]!==d?(i={mutationKey:u,mutationFn:d,onSettled(){return s.invalidateQueries({queryKey:[...e.map(bl)]})},onError(m){on(m)}},r[5]=s,r[6]=e,r[7]=u,r[8]=d,r[9]=i):i=r[9],Br(i)}function bl(t){return t.toString()}function wl(t){return t.toString()}function sn(t,e){const r=Qe.c(10),{baseUrl:n,queryClient:s}=pt();let u;r[0]!==e?(u=[...e.map(Cl)],r[0]=e,r[1]=u):u=r[1];let d;r[2]!==t||r[3]!==n?(d=m=>Fo(`${n}${t}`,m),r[2]=t,r[3]=n,r[4]=d):d=r[4];let i;return r[5]!==s||r[6]!==e||r[7]!==u||r[8]!==d?(i={mutationKey:u,mutationFn:d,onSettled(){return s.invalidateQueries({queryKey:[...e.map(_l)]})},onError(m){on(m)}},r[5]=s,r[6]=e,r[7]=u,r[8]=d,r[9]=i):i=r[9],Br(i)}function _l(t){return t.toString()}function Cl(t){return t.toString()}function Vo(t,e){const r=Qe.c(10),{baseUrl:n,queryClient:s}=pt();let u;r[0]!==e?(u=[...e.map(Sl)],r[0]=e,r[1]=u):u=r[1];let d;r[2]!==t||r[3]!==n?(d=m=>Yo(`${n}${t}`,m),r[2]=t,r[3]=n,r[4]=d):d=r[4];let i;return r[5]!==s||r[6]!==e||r[7]!==u||r[8]!==d?(i={mutationKey:u,mutationFn:d,onSettled(){return s.invalidateQueries({queryKey:[...e.map(xl)]})},onError(m){on(m)}},r[5]=s,r[6]=e,r[7]=u,r[8]=d,r[9]=i):i=r[9],Br(i)}function xl(t){return t.toString()}function Sl(t){return t.toString()}var ur={exports:{}},Dl=ur.exports,Ho;function kl(){return Ho||(Ho=1,(function(t,e){(function(r,n){t.exports=n()})(Dl,(function(){var r=1e3,n=6e4,s=36e5,u="millisecond",d="second",i="minute",m="hour",v="day",_="week",M="month",S="quarter",x="year",P="date",A="Invalid Date",N=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,F=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,B={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(k){var C=["th","st","nd","rd"],b=k%100;return"["+k+(C[(b-20)%10]||C[b]||C[0])+"]"}},Q=function(k,C,b){var h=String(k);return!h||h.length>=C?k:""+Array(C+1-h.length).join(b)+k},U={s:Q,z:function(k){var C=-k.utcOffset(),b=Math.abs(C),h=Math.floor(b/60),a=b%60;return(C<=0?"+":"-")+Q(h,2,"0")+":"+Q(a,2,"0")},m:function k(C,b){if(C.date()<b.date())return-k(b,C);var h=12*(b.year()-C.year())+(b.month()-C.month()),a=C.clone().add(h,M),p=b-a<0,f=C.clone().add(h+(p?-1:1),M);return+(-(h+(b-a)/(p?a-f:f-a))||0)},a:function(k){return k<0?Math.ceil(k)||0:Math.floor(k)},p:function(k){return{M,y:x,w:_,d:v,D:P,h:m,m:i,s:d,ms:u,Q:S}[k]||String(k||"").toLowerCase().replace(/s$/,"")},u:function(k){return k===void 0}},ee="en",re={};re[ee]=B;var K="$isDayjsObject",X=function(k){return k instanceof ae||!(!k||!k[K])},V=function k(C,b,h){var a;if(!C)return ee;if(typeof C=="string"){var p=C.toLowerCase();re[p]&&(a=p),b&&(re[p]=b,a=p);var f=C.split("-");if(!a&&f.length>1)return k(f[0])}else{var c=C.name;re[c]=C,a=c}return!h&&a&&(ee=a),a||!h&&ee},q=function(k,C){if(X(k))return k.clone();var b=typeof C=="object"?C:{};return b.date=k,b.args=arguments,new ae(b)},J=U;J.l=V,J.i=X,J.w=function(k,C){return q(k,{locale:C.$L,utc:C.$u,x:C.$x,$offset:C.$offset})};var ae=(function(){function k(b){this.$L=V(b.locale,null,!0),this.parse(b),this.$x=this.$x||b.x||{},this[K]=!0}var C=k.prototype;return C.parse=function(b){this.$d=(function(h){var a=h.date,p=h.utc;if(a===null)return new Date(NaN);if(J.u(a))return new Date;if(a instanceof Date)return new Date(a);if(typeof a=="string"&&!/Z$/i.test(a)){var f=a.match(N);if(f){var c=f[2]-1||0,y=(f[7]||"0").substring(0,3);return p?new Date(Date.UTC(f[1],c,f[3]||1,f[4]||0,f[5]||0,f[6]||0,y)):new Date(f[1],c,f[3]||1,f[4]||0,f[5]||0,f[6]||0,y)}}return new Date(a)})(b),this.init()},C.init=function(){var b=this.$d;this.$y=b.getFullYear(),this.$M=b.getMonth(),this.$D=b.getDate(),this.$W=b.getDay(),this.$H=b.getHours(),this.$m=b.getMinutes(),this.$s=b.getSeconds(),this.$ms=b.getMilliseconds()},C.$utils=function(){return J},C.isValid=function(){return this.$d.toString()!==A},C.isSame=function(b,h){var a=q(b);return this.startOf(h)<=a&&a<=this.endOf(h)},C.isAfter=function(b,h){return q(b)<this.startOf(h)},C.isBefore=function(b,h){return this.endOf(h)<q(b)},C.$g=function(b,h,a){return J.u(b)?this[h]:this.set(a,b)},C.unix=function(){return Math.floor(this.valueOf()/1e3)},C.valueOf=function(){return this.$d.getTime()},C.startOf=function(b,h){var a=this,p=!!J.u(h)||h,f=J.p(b),c=function(se,ie){var ue=J.w(a.$u?Date.UTC(a.$y,ie,se):new Date(a.$y,ie,se),a);return p?ue:ue.endOf(v)},y=function(se,ie){return J.w(a.toDate()[se].apply(a.toDate("s"),(p?[0,0,0,0]:[23,59,59,999]).slice(ie)),a)},D=this.$W,j=this.$M,W=this.$D,Z="set"+(this.$u?"UTC":"");switch(f){case x:return p?c(1,0):c(31,11);case M:return p?c(1,j):c(0,j+1);case _:var te=this.$locale().weekStart||0,H=(D<te?D+7:D)-te;return c(p?W-H:W+(6-H),j);case v:case P:return y(Z+"Hours",0);case m:return y(Z+"Minutes",1);case i:return y(Z+"Seconds",2);case d:return y(Z+"Milliseconds",3);default:return this.clone()}},C.endOf=function(b){return this.startOf(b,!1)},C.$set=function(b,h){var a,p=J.p(b),f="set"+(this.$u?"UTC":""),c=(a={},a[v]=f+"Date",a[P]=f+"Date",a[M]=f+"Month",a[x]=f+"FullYear",a[m]=f+"Hours",a[i]=f+"Minutes",a[d]=f+"Seconds",a[u]=f+"Milliseconds",a)[p],y=p===v?this.$D+(h-this.$W):h;if(p===M||p===x){var D=this.clone().set(P,1);D.$d[c](y),D.init(),this.$d=D.set(P,Math.min(this.$D,D.daysInMonth())).$d}else c&&this.$d[c](y);return this.init(),this},C.set=function(b,h){return this.clone().$set(b,h)},C.get=function(b){return this[J.p(b)]()},C.add=function(b,h){var a,p=this;b=Number(b);var f=J.p(h),c=function(j){var W=q(p);return J.w(W.date(W.date()+Math.round(j*b)),p)};if(f===M)return this.set(M,this.$M+b);if(f===x)return this.set(x,this.$y+b);if(f===v)return c(1);if(f===_)return c(7);var y=(a={},a[i]=n,a[m]=s,a[d]=r,a)[f]||1,D=this.$d.getTime()+b*y;return J.w(D,this)},C.subtract=function(b,h){return this.add(-1*b,h)},C.format=function(b){var h=this,a=this.$locale();if(!this.isValid())return a.invalidDate||A;var p=b||"YYYY-MM-DDTHH:mm:ssZ",f=J.z(this),c=this.$H,y=this.$m,D=this.$M,j=a.weekdays,W=a.months,Z=a.meridiem,te=function(ie,ue,E,L){return ie&&(ie[ue]||ie(h,p))||E[ue].slice(0,L)},H=function(ie){return J.s(c%12||12,ie,"0")},se=Z||function(ie,ue,E){var L=ie<12?"AM":"PM";return E?L.toLowerCase():L};return p.replace(F,(function(ie,ue){return ue||(function(E){switch(E){case"YY":return String(h.$y).slice(-2);case"YYYY":return J.s(h.$y,4,"0");case"M":return D+1;case"MM":return J.s(D+1,2,"0");case"MMM":return te(a.monthsShort,D,W,3);case"MMMM":return te(W,D);case"D":return h.$D;case"DD":return J.s(h.$D,2,"0");case"d":return String(h.$W);case"dd":return te(a.weekdaysMin,h.$W,j,2);case"ddd":return te(a.weekdaysShort,h.$W,j,3);case"dddd":return j[h.$W];case"H":return String(c);case"HH":return J.s(c,2,"0");case"h":return H(1);case"hh":return H(2);case"a":return se(c,y,!0);case"A":return se(c,y,!1);case"m":return String(y);case"mm":return J.s(y,2,"0");case"s":return String(h.$s);case"ss":return J.s(h.$s,2,"0");case"SSS":return J.s(h.$ms,3,"0");case"Z":return f}return null})(ie)||f.replace(":","")}))},C.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},C.diff=function(b,h,a){var p,f=this,c=J.p(h),y=q(b),D=(y.utcOffset()-this.utcOffset())*n,j=this-y,W=function(){return J.m(f,y)};switch(c){case x:p=W()/12;break;case M:p=W();break;case S:p=W()/3;break;case _:p=(j-D)/6048e5;break;case v:p=(j-D)/864e5;break;case m:p=j/s;break;case i:p=j/n;break;case d:p=j/r;break;default:p=j}return a?p:J.a(p)},C.daysInMonth=function(){return this.endOf(M).$D},C.$locale=function(){return re[this.$L]},C.locale=function(b,h){if(!b)return this.$L;var a=this.clone(),p=V(b,h,!0);return p&&(a.$L=p),a},C.clone=function(){return J.w(this.$d,this)},C.toDate=function(){return new Date(this.valueOf())},C.toJSON=function(){return this.isValid()?this.toISOString():null},C.toISOString=function(){return this.$d.toISOString()},C.toString=function(){return this.$d.toUTCString()},k})(),ne=ae.prototype;return q.prototype=ne,[["$ms",u],["$s",d],["$m",i],["$H",m],["$W",v],["$M",M],["$y",x],["$D",P]].forEach((function(k){ne[k[1]]=function(C){return this.$g(C,k[0],k[1])}})),q.extend=function(k,C){return k.$i||(k(C,ae,q),k.$i=!0),q},q.locale=V,q.isDayjs=X,q.unix=function(k){return q(1e3*k)},q.en=re[ee],q.Ls=re,q.p={},q}))})(ur)),ur.exports}var Pl=kl();const he=An(Pl);function Ml({direction:t,levelIndex:e,rowIndex:r,cellIndex:n,size:s}){switch(t){case"up":return e===0&&r===0?null:r===0?{levelIndex:e-1,rowIndex:n<=s[e-1][s[e-1].length-1]-1?s[e-1].length-1:s[e-1].length-2,cellIndex:n}:{levelIndex:e,rowIndex:r-1,cellIndex:n};case"down":return r===s[e].length-1?{levelIndex:e+1,rowIndex:0,cellIndex:n}:r===s[e].length-2&&n>=s[e][s[e].length-1]?{levelIndex:e+1,rowIndex:0,cellIndex:n}:{levelIndex:e,rowIndex:r+1,cellIndex:n};case"left":return e===0&&r===0&&n===0?null:r===0&&n===0?{levelIndex:e-1,rowIndex:s[e-1].length-1,cellIndex:s[e-1][s[e-1].length-1]-1}:n===0?{levelIndex:e,rowIndex:r-1,cellIndex:s[e][r-1]-1}:{levelIndex:e,rowIndex:r,cellIndex:n-1};case"right":return r===s[e].length-1&&n===s[e][r]-1?{levelIndex:e+1,rowIndex:0,cellIndex:0}:n===s[e][r]-1?{levelIndex:e,rowIndex:r+1,cellIndex:0}:{levelIndex:e,rowIndex:r,cellIndex:n+1};default:return{levelIndex:e,rowIndex:r,cellIndex:n}}}function Go({controlsRef:t,direction:e,levelIndex:r,rowIndex:n,cellIndex:s,size:u}){const d=Ml({direction:e,size:u,rowIndex:n,cellIndex:s,levelIndex:r});if(!d)return;const i=t.current?.[d.levelIndex]?.[d.rowIndex]?.[d.cellIndex];i&&(i.disabled||i.getAttribute("data-hidden")||i.getAttribute("data-outside")?Go({controlsRef:t,direction:e,levelIndex:d.levelIndex,cellIndex:d.cellIndex,rowIndex:d.rowIndex,size:u}):i.focus())}function Ol(t){switch(t){case"ArrowDown":return"down";case"ArrowUp":return"up";case"ArrowRight":return"right";case"ArrowLeft":return"left";default:return null}}function Al(t){return t.current?.map(e=>e.map(r=>r.length))}function an({controlsRef:t,levelIndex:e,rowIndex:r,cellIndex:n,event:s}){const u=Ol(s.key);if(u){s.preventDefault();const d=Al(t);Go({controlsRef:t,direction:u,levelIndex:e,rowIndex:r,cellIndex:n,size:d})}}function Ue(t){return t==null||t===""?t:he(t).format("YYYY-MM-DD")}function Qo(t){return t==null||t===""?t:he(t).format("YYYY-MM-DD HH:mm:ss")}const El={locale:"en",firstDayOfWeek:1,weekendDays:[0,6],labelSeparator:"–",consistentWeeks:!1},Tl=G.createContext(El);function gt(){const t=G.useContext(Tl),e=G.useCallback(u=>u||t.locale,[t.locale]),r=G.useCallback(u=>typeof u=="number"?u:t.firstDayOfWeek,[t.firstDayOfWeek]),n=G.useCallback(u=>Array.isArray(u)?u:t.weekendDays,[t.weekendDays]),s=G.useCallback(u=>typeof u=="string"?u:t.labelSeparator,[t.labelSeparator]);return{...t,getLocale:e,getFirstDayOfWeek:r,getWeekendDays:n,getLabelSeparator:s}}function jl({value:t,type:e,withTime:r}){const n=r?Qo:Ue;if(e==="range"&&Array.isArray(t)){const s=n(t[0]),u=n(t[1]);return s?u?`${s} – ${u}`:`${s} –`:""}return e==="multiple"&&Array.isArray(t)?t.filter(Boolean).join(", "):!Array.isArray(t)&&t?n(t):""}function Zo({value:t,type:e,name:r,form:n,withTime:s=!1}){return w.jsx("input",{type:"hidden",value:jl({value:t,type:e,withTime:s}),name:r,form:n})}Zo.displayName="@mantine/dates/HiddenDatesInput";function Ko(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(r=Ko(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function Pe(){for(var t,e,r=0,n="",s=arguments.length;r<s;r++)(t=arguments[r])&&(e=Ko(t))&&(n&&(n+=" "),n+=e);return n}var Jo={day:"m_396ce5cb"};const Rl=T.createVarsResolver((t,{size:e})=>({day:{"--day-size":T.getSize(e,"day-size")}})),ln=T.factory((t,e)=>{const r=T.useProps("Day",null,t),{classNames:n,className:s,style:u,styles:d,unstyled:i,vars:m,date:v,disabled:_,__staticSelector:M,weekend:S,outside:x,selected:P,renderDay:A,inRange:N,firstInRange:F,lastInRange:B,hidden:Q,static:U,highlightToday:ee,attributes:re,...K}=r,X=T.useStyles({name:M||"Day",classes:Jo,props:r,className:s,style:u,classNames:n,styles:d,unstyled:i,attributes:re,vars:m,varsResolver:Rl,rootSelector:"day"});return w.jsx(T.UnstyledButton,{...X("day",{style:Q?{display:"none"}:void 0}),component:U?"div":"button",ref:e,disabled:_,"data-today":he(v).isSame(new Date,"day")||void 0,"data-hidden":Q||void 0,"data-highlight-today":ee||void 0,"data-disabled":_||void 0,"data-weekend":!_&&!x&&S||void 0,"data-outside":!_&&x||void 0,"data-selected":!_&&P||void 0,"data-in-range":N&&!_||void 0,"data-first-in-range":F&&!_||void 0,"data-last-in-range":B&&!_||void 0,"data-static":U||void 0,unstyled:i,...K,children:A?.(v)||he(v).date()})});ln.classes=Jo,ln.displayName="@mantine/dates/Day";function $l({locale:t,format:e="dd",firstDayOfWeek:r=1}){const n=he().day(r),s=[];for(let u=0;u<7;u+=1)typeof e=="string"?s.push(he(n).add(u,"days").locale(t).format(e)):s.push(e(he(n).add(u,"days").format("YYYY-MM-DD")));return s}var Xo={weekday:"m_18a3eca"};const Nl=T.createVarsResolver((t,{size:e})=>({weekdaysRow:{"--wr-fz":T.getFontSize(e),"--wr-spacing":T.getSpacing(e)}})),un=T.factory((t,e)=>{const r=T.useProps("WeekdaysRow",null,t),{classNames:n,className:s,style:u,styles:d,unstyled:i,vars:m,locale:v,firstDayOfWeek:_,weekdayFormat:M,cellComponent:S="th",__staticSelector:x,withWeekNumbers:P,attributes:A,...N}=r,F=T.useStyles({name:x||"WeekdaysRow",classes:Xo,props:r,className:s,style:u,classNames:n,styles:d,unstyled:i,attributes:A,vars:m,varsResolver:Nl,rootSelector:"weekdaysRow"}),B=gt(),Q=$l({locale:B.getLocale(v),format:M,firstDayOfWeek:B.getFirstDayOfWeek(_)}).map((U,ee)=>w.jsx(S,{...F("weekday"),children:U},ee));return w.jsxs(T.Box,{component:"tr",ref:e,...F("weekdaysRow"),...N,children:[P&&w.jsx(S,{...F("weekday"),children:"#"}),Q]})});un.classes=Xo,un.displayName="@mantine/dates/WeekdaysRow";function Ll(t,e=1){let r=he(t);if(!r.isValid())return r;const n=e===0?6:e-1;for(;r.day()!==n;)r=r.add(1,"day");return r.format("YYYY-MM-DD")}function Bl(t,e=1){let r=he(t);for(;r.day()!==e;)r=r.subtract(1,"day");return r.format("YYYY-MM-DD")}function Il({month:t,firstDayOfWeek:e=1,consistentWeeks:r}){const n=he(t).subtract(he(t).date()-1,"day"),s=he(n.format("YYYY-M-D")),u=s.format("YYYY-MM-DD"),d=s.add(+s.daysInMonth()-1,"day").format("YYYY-MM-DD"),i=Ll(d,e),m=[];let v=he(Bl(u,e));for(;he(v).isBefore(i,"day");){const _=[];for(let M=0;M<7;M+=1)_.push(v.format("YYYY-MM-DD")),v=v.add(1,"day");m.push(_)}if(r&&m.length<6){const _=m[m.length-1],M=_[_.length-1];let S=he(M).add(1,"day");for(;m.length<6;){const x=[];for(let P=0;P<7;P+=1)x.push(S.format("YYYY-MM-DD")),S=S.add(1,"day");m.push(x)}}return m}function cn(t,e){return he(t).format("YYYY-MM")===he(e).format("YYYY-MM")}function es(t,e){return e?he(t).isAfter(he(e).subtract(1,"day"),"day"):!0}function ts(t,e){return e?he(t).isBefore(he(e).add(1,"day"),"day"):!0}function Yl({dates:t,minDate:e,maxDate:r,getDayProps:n,excludeDate:s,hideOutsideDates:u,month:d}){const i=t.flat().filter(_=>ts(_,r)&&es(_,e)&&!s?.(_)&&!n?.(_)?.disabled&&(!u||cn(_,d))),m=i.find(_=>n?.(_)?.selected);if(m)return m;const v=i.find(_=>he().isSame(_,"date"));return v||i[0]}var cr={exports:{}},zl=cr.exports,rs;function Fl(){return rs||(rs=1,(function(t,e){(function(r,n){t.exports=n()})(zl,(function(){var r="day";return function(n,s,u){var d=function(v){return v.add(4-v.isoWeekday(),r)},i=s.prototype;i.isoWeekYear=function(){return d(this).year()},i.isoWeek=function(v){if(!this.$utils().u(v))return this.add(7*(v-this.isoWeek()),r);var _,M,S,x,P=d(this),A=(_=this.isoWeekYear(),M=this.$u,S=(M?u.utc:u)().year(_).startOf("year"),x=4-S.isoWeekday(),S.isoWeekday()>4&&(x+=7),S.add(x,r));return P.diff(A,"week")+1},i.isoWeekday=function(v){return this.$utils().u(v)?this.day()||7:this.day(this.day()%7?v:v-7)};var m=i.startOf;i.startOf=function(v,_){var M=this.$utils(),S=!!M.u(_)||_;return M.p(v)==="isoweek"?S?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):m.bind(this)(v,_)}}}))})(cr)),cr.exports}var Wl=Fl();const Ul=An(Wl);he.extend(Ul);function ql(t){const e=t.find(r=>he(r).day()===1);return he(e).isoWeek()}var ns={month:"m_cc9820d3",monthCell:"m_8f457cd5",weekNumber:"m_6cff9dea"};const Vl={withCellSpacing:!0},Hl=T.createVarsResolver((t,{size:e})=>({weekNumber:{"--wn-fz":T.getFontSize(e),"--wn-size":T.getSize(e,"wn-size")}})),dr=T.factory((t,e)=>{const r=T.useProps("Month",Vl,t),{classNames:n,className:s,style:u,styles:d,unstyled:i,vars:m,__staticSelector:v,locale:_,firstDayOfWeek:M,weekdayFormat:S,month:x,weekendDays:P,getDayProps:A,excludeDate:N,minDate:F,maxDate:B,renderDay:Q,hideOutsideDates:U,hideWeekdays:ee,getDayAriaLabel:re,static:K,__getDayRef:X,__onDayKeyDown:V,__onDayClick:q,__onDayMouseEnter:J,__preventFocus:ae,__stopPropagation:ne,withCellSpacing:k,size:C,highlightToday:b,withWeekNumbers:h,attributes:a,...p}=r,f=T.useStyles({name:v||"Month",classes:ns,props:r,className:s,style:u,classNames:n,styles:d,unstyled:i,attributes:a,vars:m,varsResolver:Hl,rootSelector:"month"}),c=gt(),y=Il({month:x,firstDayOfWeek:c.getFirstDayOfWeek(M),consistentWeeks:c.consistentWeeks}),D=Yl({dates:y,minDate:Ue(F),maxDate:Ue(B),getDayProps:A,excludeDate:N,hideOutsideDates:U,month:x}),{resolvedClassNames:j,resolvedStyles:W}=T.useResolvedStylesApi({classNames:n,styles:d,props:r}),Z=y.map((te,H)=>{const se=te.map((ie,ue)=>{const E=!cn(ie,x),L=re?.(ie)||he(ie).locale(_||c.locale).format("D MMMM YYYY"),R=A?.(ie),Y=he(ie).isSame(D,"date");return w.jsx("td",{...f("monthCell"),"data-with-spacing":k||void 0,children:w.jsx(ln,{__staticSelector:v||"Month",classNames:j,styles:W,unstyled:i,"data-mantine-stop-propagation":ne||void 0,highlightToday:b,renderDay:Q,date:ie,size:C,weekend:c.getWeekendDays(P).includes(he(ie).get("day")),outside:E,hidden:U?E:!1,"aria-label":L,static:K,disabled:N?.(ie)||!ts(ie,Ue(B))||!es(ie,Ue(F)),ref:I=>{I&&X?.(H,ue,I)},...R,onKeyDown:I=>{R?.onKeyDown?.(I),V?.(I,{rowIndex:H,cellIndex:ue,date:ie})},onMouseEnter:I=>{R?.onMouseEnter?.(I),J?.(I,ie)},onClick:I=>{R?.onClick?.(I),q?.(I,ie)},onMouseDown:I=>{R?.onMouseDown?.(I),ae&&I.preventDefault()},tabIndex:ae||!Y?-1:0})},ie.toString())});return w.jsxs("tr",{...f("monthRow"),children:[h&&w.jsx("td",{...f("weekNumber"),children:ql(te)}),se]},H)});return w.jsxs(T.Box,{component:"table",...f("month"),size:C,ref:e,...p,children:[!ee&&w.jsx("thead",{...f("monthThead"),children:w.jsx(un,{__staticSelector:v||"Month",locale:_,firstDayOfWeek:M,weekdayFormat:S,size:C,classNames:j,styles:W,unstyled:i,withWeekNumbers:h})}),w.jsx("tbody",{...f("monthTbody"),children:Z})]})});dr.classes=ns,dr.displayName="@mantine/dates/Month";var os={pickerControl:"m_dc6a3c71"};const Gl=T.createVarsResolver((t,{size:e})=>({pickerControl:{"--dpc-fz":T.getFontSize(e),"--dpc-size":T.getSize(e,"dpc-size")}})),hr=T.factory((t,e)=>{const r=T.useProps("PickerControl",null,t),{classNames:n,className:s,style:u,styles:d,unstyled:i,vars:m,firstInRange:v,lastInRange:_,inRange:M,__staticSelector:S,selected:x,disabled:P,attributes:A,...N}=r,F=T.useStyles({name:S||"PickerControl",classes:os,props:r,className:s,style:u,classNames:n,styles:d,unstyled:i,attributes:A,vars:m,varsResolver:Gl,rootSelector:"pickerControl"});return w.jsx(T.UnstyledButton,{...F("pickerControl"),ref:e,unstyled:i,"data-picker-control":!0,"data-selected":x&&!P||void 0,"data-disabled":P||void 0,"data-in-range":M&&!P&&!x||void 0,"data-first-in-range":v&&!P||void 0,"data-last-in-range":_&&!P||void 0,disabled:P,...N})});hr.classes=os,hr.displayName="@mantine/dates/PickerControl";function ss({year:t,minDate:e,maxDate:r}){return!e&&!r?!1:!!(e&&he(t).isBefore(e,"year")||r&&he(t).isAfter(r,"year"))}function Ql({years:t,minDate:e,maxDate:r,getYearControlProps:n}){const s=t.flat().filter(i=>!ss({year:i,minDate:e,maxDate:r})&&!n?.(i)?.disabled),u=s.find(i=>n?.(i)?.selected);if(u)return u;const d=s.find(i=>he().isSame(i,"year"));return d||s[0]}function is(t){const e=he(t).year(),r=e-e%10;let n=0;const s=[[],[],[],[]];for(let u=0;u<4;u+=1){const d=u===3?1:3;for(let i=0;i<d;i+=1)s[u].push(he(new Date(r+n,0)).format("YYYY-MM-DD")),n+=1}return s}var as={yearsList:"m_9206547b",yearsListCell:"m_c5a19c7d"};const Zl={yearsListFormat:"YYYY",withCellSpacing:!0},fr=T.factory((t,e)=>{const r=T.useProps("YearsList",Zl,t),{classNames:n,className:s,style:u,styles:d,unstyled:i,vars:m,decade:v,yearsListFormat:_,locale:M,minDate:S,maxDate:x,getYearControlProps:P,__staticSelector:A,__getControlRef:N,__onControlKeyDown:F,__onControlClick:B,__onControlMouseEnter:Q,__preventFocus:U,__stopPropagation:ee,withCellSpacing:re,size:K,attributes:X,...V}=r,q=T.useStyles({name:A||"YearsList",classes:as,props:r,className:s,style:u,classNames:n,styles:d,unstyled:i,attributes:X,vars:m,rootSelector:"yearsList"}),J=gt(),ae=is(v),ne=Ql({years:ae,minDate:S,maxDate:x,getYearControlProps:P}),k=ae.map((C,b)=>{const h=C.map((a,p)=>{const f=P?.(a),c=he(a).isSame(ne,"year");return w.jsx("td",{...q("yearsListCell"),"data-with-spacing":re||void 0,children:w.jsx(hr,{...q("yearsListControl"),size:K,unstyled:i,"data-mantine-stop-propagation":ee||void 0,disabled:ss({year:a,minDate:S,maxDate:x}),ref:y=>{y&&N?.(b,p,y)},...f,onKeyDown:y=>{f?.onKeyDown?.(y),F?.(y,{rowIndex:b,cellIndex:p,date:a})},onClick:y=>{f?.onClick?.(y),B?.(y,a)},onMouseEnter:y=>{f?.onMouseEnter?.(y),Q?.(y,a)},onMouseDown:y=>{f?.onMouseDown?.(y),U&&y.preventDefault()},tabIndex:U||!c?-1:0,children:he(a).locale(J.getLocale(M)).format(_)})},p)});return w.jsx("tr",{...q("yearsListRow"),children:h},b)});return w.jsx(T.Box,{component:"table",ref:e,size:K,...q("yearsList"),...V,children:w.jsx("tbody",{children:k})})});fr.classes=as,fr.displayName="@mantine/dates/YearsList";function ls({month:t,minDate:e,maxDate:r}){return!e&&!r?!1:!!(e&&he(t).isBefore(e,"month")||r&&he(t).isAfter(r,"month"))}function Kl({months:t,minDate:e,maxDate:r,getMonthControlProps:n}){const s=t.flat().filter(i=>!ls({month:i,minDate:e,maxDate:r})&&!n?.(i)?.disabled),u=s.find(i=>n?.(i)?.selected);if(u)return u;const d=s.find(i=>he().isSame(i,"month"));return d||s[0]}function Jl(t){const e=he(t).startOf("year").toDate(),r=[[],[],[],[]];let n=0;for(let s=0;s<4;s+=1)for(let u=0;u<3;u+=1)r[s].push(he(e).add(n,"months").format("YYYY-MM-DD")),n+=1;return r}var us={monthsList:"m_2a6c32d",monthsListCell:"m_fe27622f"};const Xl={monthsListFormat:"MMM",withCellSpacing:!0},pr=T.factory((t,e)=>{const r=T.useProps("MonthsList",Xl,t),{classNames:n,className:s,style:u,styles:d,unstyled:i,vars:m,__staticSelector:v,year:_,monthsListFormat:M,locale:S,minDate:x,maxDate:P,getMonthControlProps:A,__getControlRef:N,__onControlKeyDown:F,__onControlClick:B,__onControlMouseEnter:Q,__preventFocus:U,__stopPropagation:ee,withCellSpacing:re,size:K,attributes:X,...V}=r,q=T.useStyles({name:v||"MonthsList",classes:us,props:r,className:s,style:u,classNames:n,styles:d,unstyled:i,attributes:X,vars:m,rootSelector:"monthsList"}),J=gt(),ae=Jl(_),ne=Kl({months:ae,minDate:Ue(x),maxDate:Ue(P),getMonthControlProps:A}),k=ae.map((C,b)=>{const h=C.map((a,p)=>{const f=A?.(a),c=he(a).isSame(ne,"month");return w.jsx("td",{...q("monthsListCell"),"data-with-spacing":re||void 0,children:w.jsx(hr,{...q("monthsListControl"),size:K,unstyled:i,__staticSelector:v||"MonthsList","data-mantine-stop-propagation":ee||void 0,disabled:ls({month:a,minDate:Ue(x),maxDate:Ue(P)}),ref:y=>{y&&N?.(b,p,y)},...f,onKeyDown:y=>{f?.onKeyDown?.(y),F?.(y,{rowIndex:b,cellIndex:p,date:a})},onClick:y=>{f?.onClick?.(y),B?.(y,a)},onMouseEnter:y=>{f?.onMouseEnter?.(y),Q?.(y,a)},onMouseDown:y=>{f?.onMouseDown?.(y),U&&y.preventDefault()},tabIndex:U||!c?-1:0,children:he(a).locale(J.getLocale(S)).format(M)})},p)});return w.jsx("tr",{...q("monthsListRow"),children:h},b)});return w.jsx(T.Box,{component:"table",ref:e,size:K,...q("monthsList"),...V,children:w.jsx("tbody",{children:k})})});pr.classes=us,pr.displayName="@mantine/dates/MonthsList";var cs={calendarHeader:"m_730a79ed",calendarHeaderLevel:"m_f6645d97",calendarHeaderControl:"m_2351eeb0",calendarHeaderControlIcon:"m_367dc749"};const eu={hasNextLevel:!0,withNext:!0,withPrevious:!0,headerControlsOrder:["previous","level","next"]},tu=T.createVarsResolver((t,{size:e})=>({calendarHeader:{"--dch-control-size":T.getSize(e,"dch-control-size"),"--dch-fz":T.getFontSize(e)}})),mt=T.factory((t,e)=>{const r=T.useProps("CalendarHeader",eu,t),{classNames:n,className:s,style:u,styles:d,unstyled:i,vars:m,nextIcon:v,previousIcon:_,nextLabel:M,previousLabel:S,onNext:x,onPrevious:P,onLevelClick:A,label:N,nextDisabled:F,previousDisabled:B,hasNextLevel:Q,levelControlAriaLabel:U,withNext:ee,withPrevious:re,headerControlsOrder:K,__staticSelector:X,__preventFocus:V,__stopPropagation:q,attributes:J,...ae}=r,ne=T.useStyles({name:X||"CalendarHeader",classes:cs,props:r,className:s,style:u,classNames:n,styles:d,unstyled:i,attributes:J,vars:m,varsResolver:tu,rootSelector:"calendarHeader"}),k=V?p=>p.preventDefault():void 0,C=re&&G.createElement(T.UnstyledButton,{...ne("calendarHeaderControl"),key:"previous","data-direction":"previous","aria-label":S,onClick:P,unstyled:i,onMouseDown:k,disabled:B,"data-disabled":B||void 0,tabIndex:V||B?-1:0,"data-mantine-stop-propagation":q||void 0},_||w.jsx(T.AccordionChevron,{...ne("calendarHeaderControlIcon"),"data-direction":"previous",size:"45%"})),b=G.createElement(T.UnstyledButton,{component:Q?"button":"div",...ne("calendarHeaderLevel"),key:"level",onClick:Q?A:void 0,unstyled:i,onMouseDown:Q?k:void 0,disabled:!Q,"data-static":!Q||void 0,"aria-label":U,tabIndex:V||!Q?-1:0,"data-mantine-stop-propagation":q||void 0},N),h=ee&&G.createElement(T.UnstyledButton,{...ne("calendarHeaderControl"),key:"next","data-direction":"next","aria-label":M,onClick:x,unstyled:i,onMouseDown:k,disabled:F,"data-disabled":F||void 0,tabIndex:V||F?-1:0,"data-mantine-stop-propagation":q||void 0},v||w.jsx(T.AccordionChevron,{...ne("calendarHeaderControlIcon"),"data-direction":"next",size:"45%"})),a=K.map(p=>p==="previous"?C:p==="level"?b:p==="next"?h:null);return w.jsx(T.Box,{...ne("calendarHeader"),ref:e,...ae,children:a})});mt.classes=cs,mt.displayName="@mantine/dates/CalendarHeader";function ru(t){const e=is(t);return[e[0][0],e[3][0]]}const nu={decadeLabelFormat:"YYYY"},gr=T.factory((t,e)=>{const r=T.useProps("DecadeLevel",nu,t),{decade:n,locale:s,minDate:u,maxDate:d,yearsListFormat:i,getYearControlProps:m,__getControlRef:v,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:S,withCellSpacing:x,__preventFocus:P,nextIcon:A,previousIcon:N,nextLabel:F,previousLabel:B,onNext:Q,onPrevious:U,nextDisabled:ee,previousDisabled:re,levelControlAriaLabel:K,withNext:X,withPrevious:V,headerControlsOrder:q,decadeLabelFormat:J,classNames:ae,styles:ne,unstyled:k,__staticSelector:C,__stopPropagation:b,size:h,attributes:a,...p}=r,f=gt(),[c,y]=ru(n),D={__staticSelector:C||"DecadeLevel",classNames:ae,styles:ne,unstyled:k,size:h,attributes:a},j=typeof ee=="boolean"?ee:d?!he(y).endOf("year").isBefore(d):!1,W=typeof re=="boolean"?re:u?!he(c).startOf("year").isAfter(u):!1,Z=(te,H)=>he(te).locale(s||f.locale).format(H);return w.jsxs(T.Box,{"data-decade-level":!0,size:h,ref:e,...p,children:[w.jsx(mt,{label:typeof J=="function"?J(c,y):`${Z(c,J)} – ${Z(y,J)}`,__preventFocus:P,__stopPropagation:b,nextIcon:A,previousIcon:N,nextLabel:F,previousLabel:B,onNext:Q,onPrevious:U,nextDisabled:j,previousDisabled:W,hasNextLevel:!1,levelControlAriaLabel:K,withNext:X,withPrevious:V,headerControlsOrder:q,...D}),w.jsx(fr,{decade:n,locale:s,minDate:u,maxDate:d,yearsListFormat:i,getYearControlProps:m,__getControlRef:v,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:S,__preventFocus:P,__stopPropagation:b,withCellSpacing:x,...D})]})});gr.classes={...fr.classes,...mt.classes},gr.displayName="@mantine/dates/DecadeLevel";const ou={yearLabelFormat:"YYYY"},mr=T.factory((t,e)=>{const r=T.useProps("YearLevel",ou,t),{year:n,locale:s,minDate:u,maxDate:d,monthsListFormat:i,getMonthControlProps:m,__getControlRef:v,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:S,withCellSpacing:x,__preventFocus:P,nextIcon:A,previousIcon:N,nextLabel:F,previousLabel:B,onNext:Q,onPrevious:U,onLevelClick:ee,nextDisabled:re,previousDisabled:K,hasNextLevel:X,levelControlAriaLabel:V,withNext:q,withPrevious:J,headerControlsOrder:ae,yearLabelFormat:ne,__staticSelector:k,__stopPropagation:C,size:b,classNames:h,styles:a,unstyled:p,attributes:f,...c}=r,y=gt(),D={__staticSelector:k||"YearLevel",classNames:h,styles:a,unstyled:p,size:b,attributes:f},j=typeof re=="boolean"?re:d?!he(n).endOf("year").isBefore(d):!1,W=typeof K=="boolean"?K:u?!he(n).startOf("year").isAfter(u):!1;return w.jsxs(T.Box,{"data-year-level":!0,size:b,ref:e,...c,children:[w.jsx(mt,{label:typeof ne=="function"?ne(n):he(n).locale(s||y.locale).format(ne),__preventFocus:P,__stopPropagation:C,nextIcon:A,previousIcon:N,nextLabel:F,previousLabel:B,onNext:Q,onPrevious:U,onLevelClick:ee,nextDisabled:j,previousDisabled:W,hasNextLevel:X,levelControlAriaLabel:V,withNext:q,withPrevious:J,headerControlsOrder:ae,...D}),w.jsx(pr,{year:n,locale:s,minDate:u,maxDate:d,monthsListFormat:i,getMonthControlProps:m,__getControlRef:v,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:S,__preventFocus:P,__stopPropagation:C,withCellSpacing:x,...D})]})});mr.classes={...mt.classes,...pr.classes},mr.displayName="@mantine/dates/YearLevel";const su={monthLabelFormat:"MMMM YYYY"},yr=T.factory((t,e)=>{const r=T.useProps("MonthLevel",su,t),{month:n,locale:s,firstDayOfWeek:u,weekdayFormat:d,weekendDays:i,getDayProps:m,excludeDate:v,minDate:_,maxDate:M,renderDay:S,hideOutsideDates:x,hideWeekdays:P,getDayAriaLabel:A,__getDayRef:N,__onDayKeyDown:F,__onDayClick:B,__onDayMouseEnter:Q,withCellSpacing:U,highlightToday:ee,withWeekNumbers:re,__preventFocus:K,__stopPropagation:X,nextIcon:V,previousIcon:q,nextLabel:J,previousLabel:ae,onNext:ne,onPrevious:k,onLevelClick:C,nextDisabled:b,previousDisabled:h,hasNextLevel:a,levelControlAriaLabel:p,withNext:f,withPrevious:c,headerControlsOrder:y,monthLabelFormat:D,classNames:j,styles:W,unstyled:Z,__staticSelector:te,size:H,static:se,attributes:ie,...ue}=r,E=gt(),L={__staticSelector:te||"MonthLevel",classNames:j,styles:W,unstyled:Z,size:H,attributes:ie},R=typeof b=="boolean"?b:M?!he(n).endOf("month").isBefore(M):!1,Y=typeof h=="boolean"?h:_?!he(n).startOf("month").isAfter(_):!1;return w.jsxs(T.Box,{"data-month-level":!0,size:H,ref:e,...ue,children:[w.jsx(mt,{label:typeof D=="function"?D(n):he(n).locale(s||E.locale).format(D),__preventFocus:K,__stopPropagation:X,nextIcon:V,previousIcon:q,nextLabel:J,previousLabel:ae,onNext:ne,onPrevious:k,onLevelClick:C,nextDisabled:R,previousDisabled:Y,hasNextLevel:a,levelControlAriaLabel:p,withNext:f,withPrevious:c,headerControlsOrder:y,...L}),w.jsx(dr,{month:n,locale:s,firstDayOfWeek:u,weekdayFormat:d,weekendDays:i,getDayProps:m,excludeDate:v,minDate:_,maxDate:M,renderDay:S,hideOutsideDates:x,hideWeekdays:P,getDayAriaLabel:A,__getDayRef:N,__onDayKeyDown:F,__onDayClick:B,__onDayMouseEnter:Q,__preventFocus:K,__stopPropagation:X,static:se,withCellSpacing:U,highlightToday:ee,withWeekNumbers:re,...L})]})});yr.classes={...dr.classes,...mt.classes},yr.displayName="@mantine/dates/MonthLevel";var ds={levelsGroup:"m_30b26e33"};const yt=T.factory((t,e)=>{const r=T.useProps("LevelsGroup",null,t),{classNames:n,className:s,style:u,styles:d,unstyled:i,vars:m,__staticSelector:v,attributes:_,...M}=r,S=T.useStyles({name:v||"LevelsGroup",classes:ds,props:r,className:s,style:u,classNames:n,styles:d,unstyled:i,attributes:_,vars:m,rootSelector:"levelsGroup"});return w.jsx(T.Box,{ref:e,...S("levelsGroup"),...M})});yt.classes=ds,yt.displayName="@mantine/dates/LevelsGroup";const iu={numberOfColumns:1},vr=T.factory((t,e)=>{const r=T.useProps("DecadeLevelGroup",iu,t),{decade:n,locale:s,minDate:u,maxDate:d,yearsListFormat:i,getYearControlProps:m,__onControlClick:v,__onControlMouseEnter:_,withCellSpacing:M,__preventFocus:S,nextIcon:x,previousIcon:P,nextLabel:A,previousLabel:N,onNext:F,onPrevious:B,nextDisabled:Q,previousDisabled:U,headerControlsOrder:ee,classNames:re,styles:K,unstyled:X,__staticSelector:V,__stopPropagation:q,numberOfColumns:J,levelControlAriaLabel:ae,decadeLabelFormat:ne,size:k,vars:C,attributes:b,...h}=r,a=G.useRef([]),p=Array(J).fill(0).map((f,c)=>{const y=he(n).add(c*10,"years").format("YYYY-MM-DD");return w.jsx(gr,{size:k,yearsListFormat:i,decade:y,withNext:c===J-1,withPrevious:c===0,decadeLabelFormat:ne,__onControlClick:v,__onControlMouseEnter:_,__onControlKeyDown:(D,j)=>an({levelIndex:c,rowIndex:j.rowIndex,cellIndex:j.cellIndex,event:D,controlsRef:a}),__getControlRef:(D,j,W)=>{Array.isArray(a.current[c])||(a.current[c]=[]),Array.isArray(a.current[c][D])||(a.current[c][D]=[]),a.current[c][D][j]=W},levelControlAriaLabel:typeof ae=="function"?ae(y):ae,locale:s,minDate:u,maxDate:d,__preventFocus:S,__stopPropagation:q,nextIcon:x,previousIcon:P,nextLabel:A,previousLabel:N,onNext:F,onPrevious:B,nextDisabled:Q,previousDisabled:U,getYearControlProps:m,__staticSelector:V||"DecadeLevelGroup",classNames:re,styles:K,unstyled:X,withCellSpacing:M,headerControlsOrder:ee,attributes:b},c)});return w.jsx(yt,{classNames:re,styles:K,__staticSelector:V||"DecadeLevelGroup",ref:e,size:k,unstyled:X,attributes:b,...h,children:p})});vr.classes={...yt.classes,...gr.classes},vr.displayName="@mantine/dates/DecadeLevelGroup";const au={numberOfColumns:1},br=T.factory((t,e)=>{const r=T.useProps("YearLevelGroup",au,t),{year:n,locale:s,minDate:u,maxDate:d,monthsListFormat:i,getMonthControlProps:m,__onControlClick:v,__onControlMouseEnter:_,withCellSpacing:M,__preventFocus:S,nextIcon:x,previousIcon:P,nextLabel:A,previousLabel:N,onNext:F,onPrevious:B,onLevelClick:Q,nextDisabled:U,previousDisabled:ee,hasNextLevel:re,headerControlsOrder:K,classNames:X,styles:V,unstyled:q,__staticSelector:J,__stopPropagation:ae,numberOfColumns:ne,levelControlAriaLabel:k,yearLabelFormat:C,size:b,vars:h,attributes:a,...p}=r,f=G.useRef([]),c=Array(ne).fill(0).map((y,D)=>{const j=he(n).add(D,"years").format("YYYY-MM-DD");return w.jsx(mr,{size:b,monthsListFormat:i,year:j,withNext:D===ne-1,withPrevious:D===0,yearLabelFormat:C,__stopPropagation:ae,__onControlClick:v,__onControlMouseEnter:_,__onControlKeyDown:(W,Z)=>an({levelIndex:D,rowIndex:Z.rowIndex,cellIndex:Z.cellIndex,event:W,controlsRef:f}),__getControlRef:(W,Z,te)=>{Array.isArray(f.current[D])||(f.current[D]=[]),Array.isArray(f.current[D][W])||(f.current[D][W]=[]),f.current[D][W][Z]=te},levelControlAriaLabel:typeof k=="function"?k(j):k,locale:s,minDate:u,maxDate:d,__preventFocus:S,nextIcon:x,previousIcon:P,nextLabel:A,previousLabel:N,onNext:F,onPrevious:B,onLevelClick:Q,nextDisabled:U,previousDisabled:ee,hasNextLevel:re,getMonthControlProps:m,classNames:X,styles:V,unstyled:q,__staticSelector:J||"YearLevelGroup",withCellSpacing:M,headerControlsOrder:K,attributes:a},D)});return w.jsx(yt,{classNames:X,styles:V,__staticSelector:J||"YearLevelGroup",ref:e,size:b,unstyled:q,attributes:a,...p,children:c})});br.classes={...mr.classes,...yt.classes},br.displayName="@mantine/dates/YearLevelGroup";const lu={numberOfColumns:1},wr=T.factory((t,e)=>{const r=T.useProps("MonthLevelGroup",lu,t),{month:n,locale:s,firstDayOfWeek:u,weekdayFormat:d,weekendDays:i,getDayProps:m,excludeDate:v,minDate:_,maxDate:M,renderDay:S,hideOutsideDates:x,hideWeekdays:P,getDayAriaLabel:A,__onDayClick:N,__onDayMouseEnter:F,withCellSpacing:B,highlightToday:Q,withWeekNumbers:U,__preventFocus:ee,nextIcon:re,previousIcon:K,nextLabel:X,previousLabel:V,onNext:q,onPrevious:J,onLevelClick:ae,nextDisabled:ne,previousDisabled:k,hasNextLevel:C,headerControlsOrder:b,classNames:h,styles:a,unstyled:p,numberOfColumns:f,levelControlAriaLabel:c,monthLabelFormat:y,__staticSelector:D,__stopPropagation:j,size:W,static:Z,vars:te,attributes:H,...se}=r,ie=G.useRef([]),ue=Array(f).fill(0).map((E,L)=>{const R=he(n).add(L,"months").format("YYYY-MM-DD");return w.jsx(yr,{month:R,withNext:L===f-1,withPrevious:L===0,monthLabelFormat:y,__stopPropagation:j,__onDayClick:N,__onDayMouseEnter:F,__onDayKeyDown:(Y,I)=>an({levelIndex:L,rowIndex:I.rowIndex,cellIndex:I.cellIndex,event:Y,controlsRef:ie}),__getDayRef:(Y,I,de)=>{Array.isArray(ie.current[L])||(ie.current[L]=[]),Array.isArray(ie.current[L][Y])||(ie.current[L][Y]=[]),ie.current[L][Y][I]=de},levelControlAriaLabel:typeof c=="function"?c(R):c,locale:s,firstDayOfWeek:u,weekdayFormat:d,weekendDays:i,getDayProps:m,excludeDate:v,minDate:_,maxDate:M,renderDay:S,hideOutsideDates:x,hideWeekdays:P,getDayAriaLabel:A,__preventFocus:ee,nextIcon:re,previousIcon:K,nextLabel:X,previousLabel:V,onNext:q,onPrevious:J,onLevelClick:ae,nextDisabled:ne,previousDisabled:k,hasNextLevel:C,classNames:h,styles:a,unstyled:p,__staticSelector:D||"MonthLevelGroup",size:W,static:Z,withCellSpacing:B,highlightToday:Q,withWeekNumbers:U,headerControlsOrder:b,attributes:H},L)});return w.jsx(yt,{classNames:h,styles:a,__staticSelector:D||"MonthLevelGroup",ref:e,size:W,attributes:H,...se,children:ue})});wr.classes={...yt.classes,...yr.classes},wr.displayName="@mantine/dates/MonthLevelGroup";const hs=t=>t==="range"?[null,null]:t==="multiple"?[]:null,fs=(t,e)=>{const r=e?Qo:Ue;return Array.isArray(t)?t.map(r):r(t)};function dn({type:t,value:e,defaultValue:r,onChange:n,withTime:s=!1}){const u=G.useRef(t),[d,i,m]=Le.useUncontrolled({value:fs(e,s),defaultValue:fs(r,s),finalValue:hs(t),onChange:n});let v=d;return u.current!==t&&(u.current=t,e===void 0&&(v=r!==void 0?r:hs(t),i(v))),[v,i,m]}function hn(t,e){return t?t==="month"?0:t==="year"?1:2:e||0}function uu(t){return t===0?"month":t===1?"year":"decade"}function Ht(t,e,r){return uu(Le.clamp(hn(t,0),hn(e,0),hn(r,2)))}const cu={maxLevel:"decade",minLevel:"month",__updateDateOnYearSelect:!0,__updateDateOnMonthSelect:!0,enableKeyboardNavigation:!0},_r=T.factory((t,e)=>{const r=T.useProps("Calendar",cu,t),{vars:n,maxLevel:s,minLevel:u,defaultLevel:d,level:i,onLevelChange:m,date:v,defaultDate:_,onDateChange:M,numberOfColumns:S,columnsToScroll:x,ariaLabels:P,nextLabel:A,previousLabel:N,onYearSelect:F,onMonthSelect:B,onYearMouseEnter:Q,onMonthMouseEnter:U,headerControlsOrder:ee,__updateDateOnYearSelect:re,__updateDateOnMonthSelect:K,__setDateRef:X,__setLevelRef:V,firstDayOfWeek:q,weekdayFormat:J,weekendDays:ae,getDayProps:ne,excludeDate:k,renderDay:C,hideOutsideDates:b,hideWeekdays:h,getDayAriaLabel:a,monthLabelFormat:p,nextIcon:f,previousIcon:c,__onDayClick:y,__onDayMouseEnter:D,withCellSpacing:j,highlightToday:W,withWeekNumbers:Z,monthsListFormat:te,getMonthControlProps:H,yearLabelFormat:se,yearsListFormat:ie,getYearControlProps:ue,decadeLabelFormat:E,classNames:L,styles:R,unstyled:Y,minDate:I,maxDate:de,locale:o,__staticSelector:l,size:g,__preventFocus:O,__stopPropagation:$,onNextDecade:z,onPreviousDecade:le,onNextYear:ce,onPreviousYear:fe,onNextMonth:oe,onPreviousMonth:pe,static:me,enableKeyboardNavigation:ge,attributes:xe,...Ce}=r,{resolvedClassNames:ke,resolvedStyles:qe}=T.useResolvedStylesApi({classNames:L,styles:R,props:r}),[$e,_e]=Le.useUncontrolled({value:i?Ht(i,u,s):void 0,defaultValue:d?Ht(d,u,s):void 0,finalValue:Ht(void 0,u,s),onChange:m}),[ot,Te]=dn({type:"default",value:Ue(v),defaultValue:Ue(_),onChange:M});G.useImperativeHandle(X,()=>ve=>{Te(ve)}),G.useImperativeHandle(V,()=>ve=>{_e(ve)});const Ve={__staticSelector:l||"Calendar",styles:qe,classNames:ke,unstyled:Y,size:g,attributes:xe},Ye=x||S||1,Xe=new Date,st=I&&he(Xe).isAfter(I)?I:he(Xe).format("YYYY-MM-DD"),je=ot||st,it=()=>{const ve=he(je).add(Ye,"month").format("YYYY-MM-DD");oe?.(ve),Te(ve)},at=()=>{const ve=he(je).subtract(Ye,"month").format("YYYY-MM-DD");pe?.(ve),Te(ve)},lt=()=>{const ve=he(je).add(Ye,"year").format("YYYY-MM-DD");ce?.(ve),Te(ve)},dt=()=>{const ve=he(je).subtract(Ye,"year").format("YYYY-MM-DD");fe?.(ve),Te(ve)},He=()=>{const ve=he(je).add(10*Ye,"year").format("YYYY-MM-DD");z?.(ve),Te(ve)},Ge=()=>{const ve=he(je).subtract(10*Ye,"year").format("YYYY-MM-DD");le?.(ve),Te(ve)},et=G.useRef(null);G.useEffect(()=>{if(!ge||me)return;const ve=Me=>{if(!et.current?.contains(document.activeElement))return;const tt=Me.ctrlKey||Me.metaKey,rt=Me.shiftKey;switch(Me.key){case"ArrowUp":tt&&rt?(Me.preventDefault(),Ge()):tt&&(Me.preventDefault(),dt());break;case"ArrowDown":tt&&rt?(Me.preventDefault(),He()):tt&&(Me.preventDefault(),lt());break;case"y":case"Y":$e==="month"&&(Me.preventDefault(),_e("year"));break}};return document.addEventListener("keydown",ve),()=>{document.removeEventListener("keydown",ve)}},[ge,me,$e,lt,dt,He,Ge]);const vt=ve=>{et.current=ve,typeof e=="function"?e(ve):e&&(e.current=ve)};return w.jsxs(T.Box,{ref:vt,size:g,"data-calendar":!0,...Ce,children:[$e==="month"&&w.jsx(wr,{month:je,minDate:I,maxDate:de,firstDayOfWeek:q,weekdayFormat:J,weekendDays:ae,getDayProps:ne,excludeDate:k,renderDay:C,hideOutsideDates:b,hideWeekdays:h,getDayAriaLabel:a,onNext:it,onPrevious:at,hasNextLevel:s!=="month",onLevelClick:()=>_e("year"),numberOfColumns:S,locale:o,levelControlAriaLabel:P?.monthLevelControl,nextLabel:P?.nextMonth??A,nextIcon:f,previousLabel:P?.previousMonth??N,previousIcon:c,monthLabelFormat:p,__onDayClick:y,__onDayMouseEnter:D,__preventFocus:O,__stopPropagation:$,static:me,withCellSpacing:j,highlightToday:W,withWeekNumbers:Z,headerControlsOrder:ee,...Ve}),$e==="year"&&w.jsx(br,{year:je,numberOfColumns:S,minDate:I,maxDate:de,monthsListFormat:te,getMonthControlProps:H,locale:o,onNext:lt,onPrevious:dt,hasNextLevel:s!=="month"&&s!=="year",onLevelClick:()=>_e("decade"),levelControlAriaLabel:P?.yearLevelControl,nextLabel:P?.nextYear??A,nextIcon:f,previousLabel:P?.previousYear??N,previousIcon:c,yearLabelFormat:se,__onControlMouseEnter:U,__onControlClick:(ve,Me)=>{K&&Te(Me),_e(Ht("month",u,s)),B?.(Me)},__preventFocus:O,__stopPropagation:$,withCellSpacing:j,headerControlsOrder:ee,...Ve}),$e==="decade"&&w.jsx(vr,{decade:je,minDate:I,maxDate:de,yearsListFormat:ie,getYearControlProps:ue,locale:o,onNext:He,onPrevious:Ge,numberOfColumns:S,nextLabel:P?.nextDecade??A,nextIcon:f,previousLabel:P?.previousDecade??N,previousIcon:c,decadeLabelFormat:E,__onControlMouseEnter:Q,__onControlClick:(ve,Me)=>{re&&Te(Me),_e(Ht("year",u,s)),F?.(Me)},__preventFocus:O,__stopPropagation:$,withCellSpacing:j,headerControlsOrder:ee,...Ve})]})});_r.classes={...vr.classes,...br.classes,...wr.classes},_r.displayName="@mantine/dates/Calendar";function du(t){const{maxLevel:e,minLevel:r,defaultLevel:n,level:s,onLevelChange:u,nextIcon:d,previousIcon:i,date:m,defaultDate:v,onDateChange:_,numberOfColumns:M,columnsToScroll:S,ariaLabels:x,nextLabel:P,previousLabel:A,onYearSelect:N,onMonthSelect:F,onYearMouseEnter:B,onMonthMouseEnter:Q,onNextMonth:U,onPreviousMonth:ee,onNextYear:re,onPreviousYear:K,onNextDecade:X,onPreviousDecade:V,withCellSpacing:q,highlightToday:J,__updateDateOnYearSelect:ae,__updateDateOnMonthSelect:ne,__setDateRef:k,__setLevelRef:C,withWeekNumbers:b,headerControlsOrder:h,firstDayOfWeek:a,weekdayFormat:p,weekendDays:f,getDayProps:c,excludeDate:y,renderDay:D,hideOutsideDates:j,hideWeekdays:W,getDayAriaLabel:Z,monthLabelFormat:te,monthsListFormat:H,getMonthControlProps:se,yearLabelFormat:ie,yearsListFormat:ue,getYearControlProps:E,decadeLabelFormat:L,allowSingleDateInRange:R,allowDeselect:Y,minDate:I,maxDate:de,locale:o,...l}=t;return{calendarProps:{maxLevel:e,minLevel:r,defaultLevel:n,level:s,onLevelChange:u,nextIcon:d,previousIcon:i,date:m,defaultDate:v,onDateChange:_,numberOfColumns:M,columnsToScroll:S,ariaLabels:x,nextLabel:P,previousLabel:A,onYearSelect:N,onMonthSelect:F,onYearMouseEnter:B,onMonthMouseEnter:Q,onNextMonth:U,onPreviousMonth:ee,onNextYear:re,onPreviousYear:K,onNextDecade:X,onPreviousDecade:V,withCellSpacing:q,highlightToday:J,__updateDateOnYearSelect:ae,__updateDateOnMonthSelect:ne,__setDateRef:k,withWeekNumbers:b,headerControlsOrder:h,firstDayOfWeek:a,weekdayFormat:p,weekendDays:f,getDayProps:c,excludeDate:y,renderDay:D,hideOutsideDates:j,hideWeekdays:W,getDayAriaLabel:Z,monthLabelFormat:te,monthsListFormat:H,getMonthControlProps:se,yearLabelFormat:ie,yearsListFormat:ue,getYearControlProps:E,decadeLabelFormat:L,allowSingleDateInRange:R,allowDeselect:Y,minDate:I,maxDate:de,locale:o},others:l}}function hu(t){if(t===null)return null;const e=new Date(t);return Number.isNaN(e.getTime())||!t?null:he(e).format("YYYY-MM-DD")}function fu({date:t,maxDate:e,minDate:r}){return!(t==null||Number.isNaN(new Date(t).getTime())||e&&he(t).isAfter(e,"date")||r&&he(t).isBefore(r,"date"))}const pu={valueFormat:"MMMM D, YYYY",fixOnBlur:!0,size:"sm"},Cr=T.factory((t,e)=>{const r=T.useInputProps("DateInput",pu,t),{inputProps:n,wrapperProps:s,value:u,defaultValue:d,onChange:i,clearable:m,clearButtonProps:v,popoverProps:_,getDayProps:M,locale:S,valueFormat:x,dateParser:P,minDate:A,maxDate:N,fixOnBlur:F,onFocus:B,onBlur:Q,onClick:U,onKeyDown:ee,readOnly:re,name:K,form:X,rightSection:V,unstyled:q,classNames:J,styles:ae,allowDeselect:ne,date:k,defaultDate:C,onDateChange:b,getMonthControlProps:h,getYearControlProps:a,disabled:p,...f}=r,c=G.useRef(null),y=G.useRef(null),[D,j]=G.useState(!1),{calendarProps:W,others:Z}=du(f),te=gt(),se=P||(oe=>{const pe=he(oe,x,te.getLocale(S)).toDate();return Number.isNaN(pe.getTime())?hu(oe):he(pe).format("YYYY-MM-DD")}),ie=ne!==void 0?ne:m,ue=oe=>oe?he(oe).locale(te.getLocale(S)).format(x):"",[E,L,R]=dn({type:"default",value:u,defaultValue:d,onChange:i}),[Y,I]=dn({type:"default",value:k,defaultValue:d||C,onChange:b});G.useEffect(()=>{R&&u!==null&&I(u)},[R,u]);const[de,o]=G.useState(ue(E));G.useEffect(()=>{o(ue(E))},[te.getLocale(S)]);const l=oe=>{const pe=oe.currentTarget.value;if(o(pe),j(!0),pe.trim()===""&&(ne||m))L(null);else{const me=se(pe);me&&fu({date:me,minDate:A,maxDate:N})&&(L(me),I(me))}},g=oe=>{Q?.(oe),j(!1),F&&o(ue(E))},O=oe=>{B?.(oe),j(!0)},$=oe=>{U?.(oe),j(!0)},z=oe=>{oe.key==="Escape"&&j(!1),ee?.(oe)},le=oe=>({...M?.(oe),selected:he(E).isSame(oe,"day"),onClick:pe=>{M?.(oe).onClick?.(pe);const me=ie&&he(E).isSame(oe,"day")?null:oe;L(me),!R&&me&&o(ue(me)),j(!1)}}),ce=w.jsx(T.Input.ClearButton,{onClick:()=>{L(null),!R&&o(""),j(!1)},unstyled:q,...v}),fe=m&&!!E&&!re&&!p;return Le.useDidUpdate(()=>{E!==void 0&&!D&&o(ue(E))},[E]),Le.useClickOutside(()=>j(!1),void 0,[c.current,y.current]),w.jsxs(w.Fragment,{children:[w.jsx(T.Input.Wrapper,{...s,__staticSelector:"DateInput",ref:c,children:w.jsxs(T.Popover,{opened:D,trapFocus:!1,position:"bottom-start",disabled:re||p,withRoles:!1,unstyled:q,..._,children:[w.jsx(T.Popover.Target,{children:w.jsx(T.Input,{"data-dates-input":!0,"data-read-only":re||void 0,autoComplete:"off",ref:e,value:de,onChange:l,onBlur:g,onFocus:O,onClick:$,onKeyDown:z,readOnly:re,rightSection:V,__clearSection:ce,__clearable:fe,...n,...Z,disabled:p,__staticSelector:"DateInput"})}),w.jsx(T.Popover.Dropdown,{onMouseDown:oe=>oe.preventDefault(),"data-dates-dropdown":!0,ref:y,children:w.jsx(_r,{__staticSelector:"DateInput",...W,classNames:J,styles:ae,unstyled:q,__preventFocus:!0,minDate:A,maxDate:N,locale:S,getDayProps:le,size:n.size,date:Y,onDateChange:I,getMonthControlProps:oe=>({selected:typeof E=="string"?cn(oe,E):!1,...h?.(oe)}),getYearControlProps:oe=>({selected:typeof E=="string"?he(oe).isSame(E,"year"):!1,...a?.(oe)}),attributes:s.attributes})})]})}),w.jsx(Zo,{name:K,form:X,value:E,type:"default"})]})});Cr.classes={...T.Input.classes,..._r.classes},Cr.displayName="@mantine/dates/DateInput";function ps(t){const e=Qe.c(49),{fields:r,onClose:n,queryKey:s,apiPath:u,steps:d,onCreated:i}=t,[m,v]=G.useState(0),[_,M]=G.useState(!1),[S,x]=G.useState(),{mutateAsync:P,isError:A,error:N,isPending:F}=qo(u,s),{mutateAsync:B,isPending:Q}=sn(u,s),U=F||Q;let ee;e[0]!==r?(ee=new Set(r.filter(vu).map(yu)),e[0]=r,e[1]=ee):ee=e[1];let re;e[2]!==ee?(re=[...ee],e[2]=ee,e[3]=re):re=e[3];const K=re;let X;e[4]===Symbol.for("react.memo_cache_sentinel")?(X=function(D,j){return typeof D.required=="function"?D.required(j??{}):!!D.required},e[4]=X):X=e[4];const V=X;let q;e[5]!==r?(q=r.reduce(mu,{}),e[5]=r,e[6]=q):q=e[6];let J;if(e[7]!==r){let y;e[9]===Symbol.for("react.memo_cache_sentinel")?(y=(D,j)=>(D[j.id]=(W,Z)=>j.conditional&&!j.conditional(Z)||!V(j,Z)||W?null:"Pflichtfeld",D),e[9]=y):y=e[9],J=r.filter(gu).reduce(y,{}),e[7]=r,e[8]=J}else J=e[8];let ae;e[10]!==q||e[11]!==J?(ae={mode:"uncontrolled",initialValues:q,validate:J},e[10]=q,e[11]=J,e[12]=ae):ae=e[12];const ne=On.useForm(ae);let k;e[13]!==ne||e[14]!==S?(k=function(D){const j=ne.getValues();if(D.conditional&&!D.conditional(j))return null;const W=V(D,j);return w.jsxs(G.Fragment,{children:[(D.type===void 0||D.type=="text")&&w.jsx(T.TextInput,{label:D.column.title,placeholder:D.placeholder??"",...ne.getInputProps(D.id),type:D.id.includes("email")?"email":void 0,required:W},ne.key(D.id)),D.type==="number"&&w.jsx(T.NumberInput,{decimalSeparator:",",label:D.column.title,placeholder:D.placeholder??"",...ne.getInputProps(D.id),required:W},ne.key(D.id)),D.type==="date"&&w.jsx(Cr,{label:D.column.title,placeholder:D.placeholder??"",valueFormat:"DD.MM.YYYY",clearable:!0,...ne.getInputProps(D.id),required:W},ne.key(D.id)),D.type==="boolean"&&w.jsx(T.Checkbox,{mt:"md",label:D.column.title,...ne.getInputProps(D.id,{type:"checkbox"}),required:W},ne.key(D.id)),D.type==="textarea"&&w.jsx(T.Textarea,{label:D.column.title,placeholder:D.placeholder??"",...ne.getInputProps(D.id),minRows:3,autosize:!0,required:W},ne.key(D.id)),D.type==="custom"&&D.render&&D.render({...ne.getValues(),...S&&{id:S}},ne.setValues,M,{error:ne.getInputProps(D.id).error,required:W})]},D.id)},e[13]=ne,e[14]=S,e[15]=k):k=e[15];const C=k;let b;e[16]!==N?.message||e[17]!==N?.name||e[18]!==A?(b=A&&w.jsx(T.Alert,{variant:"outline",color:"red",title:N?.name??"Fehler aufgetreten",mb:"lg",children:N?.message??"Fehler aufgetreten"}),e[16]=N?.message,e[17]=N?.name,e[18]=A,e[19]=b):b=e[19];let h;e[20]!==m||e[21]!==P||e[22]!==ne||e[23]!==A||e[24]!==n||e[25]!==i||e[26]!==S||e[27]!==K.length||e[28]!==B?(h=ne.onSubmit(async y=>{if(S)await B({...y,id:S});else{const D=await P(y);x(D.id),i?.(D.id)}K.length&&m<K.length-1?A||v(m+1):A||(ne.setInitialValues(y),ne.reset(),n())}),e[20]=m,e[21]=P,e[22]=ne,e[23]=A,e[24]=n,e[25]=i,e[26]=S,e[27]=K.length,e[28]=B,e[29]=h):h=e[29];let a;e[30]!==m||e[31]!==r||e[32]!==C||e[33]!==d||e[34]!==K?(a=K.length?w.jsx(T.Stepper,{active:m,size:"sm",children:K.map(y=>w.jsx(T.Stepper.Step,{...d&&d[y-1]?{label:d[y-1].label}:{},children:r.filter(D=>D.step===y).map(D=>C(D))},y))}):r.map(y=>C(y)),e[30]=m,e[31]=r,e[32]=C,e[33]=d,e[34]=K,e[35]=a):a=e[35];let p;e[36]!==m||e[37]!==_||e[38]!==U||e[39]!==n||e[40]!==K.length?(p=!_&&w.jsxs(T.Group,{mt:"md",justify:"end",children:[w.jsx(T.Button,{onClick:()=>K.length?m===0?n():v(m-1):n(),variant:"outline",children:K.length?m===0?"Abbrechen":"Zurück":"Abbrechen"}),w.jsx(T.Button,{type:"submit",loading:U,children:K.length?m===K.length-1?"Speichern":"Weiter":"Speichern"})]}),e[36]=m,e[37]=_,e[38]=U,e[39]=n,e[40]=K.length,e[41]=p):p=e[41];let f;e[42]!==a||e[43]!==p||e[44]!==h?(f=w.jsxs("form",{onSubmit:h,children:[a,p]}),e[42]=a,e[43]=p,e[44]=h,e[45]=f):f=e[45];let c;return e[46]!==f||e[47]!==b?(c=w.jsxs(w.Fragment,{children:[b,f]}),e[46]=f,e[47]=b,e[48]=c):c=e[48],c}function gu(t){return t.required}function mu(t,e){return t[e.id]=e.type==="boolean"?!1:e.defaultValue??"",t}function yu(t){return t.step}function vu(t){return typeof t.step=="number"}var[bu,fn]=T.createSafeContext("useDataTableColumnsContext must be used within DataTableColumnProvider"),gs=t=>{let{children:e,columnsOrder:r,setColumnsOrder:n,columnsToggle:s,setColumnsToggle:u,resetColumnsOrder:d,resetColumnsToggle:i,setColumnWidth:m,setMultipleColumnWidths:v,resetColumnsWidth:_}=t,[M,S]=G.useState(""),[x,P]=G.useState("");return w.jsx(bu,{value:{sourceColumn:M,setSourceColumn:S,targetColumn:x,setTargetColumn:P,columnsToggle:s,setColumnsToggle:u,swapColumns:()=>{if(!r||!n||!M||!x)return;let A=r.indexOf(M),N=r.indexOf(x);if(A!==-1&&N!==-1){let F=r.splice(A,1)[0];r.splice(N,0,F),n([...r])}},resetColumnsOrder:d,resetColumnsToggle:i,setColumnWidth:m,setMultipleColumnWidths:v,resetColumnsWidth:_},children:e})};function wu(){return w.jsx("tr",{className:"mantine-datatable-empty-row",children:w.jsx("td",{})})}function _u(){return w.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),w.jsx("path",{d:"M12.983 8.978c3.955 -.182 7.017 -1.446 7.017 -2.978c0 -1.657 -3.582 -3 -8 -3c-1.661 0 -3.204 .19 -4.483 .515m-2.783 1.228c-.471 .382 -.734 .808 -.734 1.257c0 1.22 1.944 2.271 4.734 2.74"}),w.jsx("path",{d:"M4 6v6c0 1.657 3.582 3 8 3c.986 0 1.93 -.067 2.802 -.19m3.187 -.82c1.251 -.53 2.011 -1.228 2.011 -1.99v-6"}),w.jsx("path",{d:"M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4"}),w.jsx("path",{d:"M3 3l18 18"})]})}function Cu({icon:t,text:e,active:r,children:n}){return w.jsx(T.Center,{className:"mantine-datatable-empty-state","data-active":r||void 0,children:n||w.jsxs(w.Fragment,{children:[t||w.jsx("div",{className:"mantine-datatable-empty-state-icon",children:w.jsx(_u,{})}),w.jsx(T.Text,{component:"div",size:"sm",c:"dimmed",children:e})]})})}function xu({key:t,columns:e=[],getInitialValueInEffect:r=!0}){function n(M,S){let x=[];return M.forEach(P=>{S.find(A=>A.accessor===P)&&x.push(P)}),S.forEach(P=>{x.includes(P.accessor)||x.push(P.accessor)}),x}let s=e&&e.map(M=>M.accessor)||[],[u,d]=Le.useLocalStorage({key:t?`${t}-columns-order`:"",defaultValue:t?s:void 0,getInitialValueInEffect:r});function i(M){t&&d(M)}let m=()=>{i(s)};if(!t)return{columnsOrder:u,setColumnsOrder:i,resetColumnsOrder:m};let v=n(u,e),_=JSON.stringify(u);return JSON.stringify(v)!==_&&i(v),{columnsOrder:v,setColumnsOrder:i,resetColumnsOrder:m}}function Su({key:t,columns:e=[],getInitialValueInEffect:r=!0,headerRef:n,onFixedLayoutChange:s}){let u=G.useRef(!1),d=G.useRef({}),[i,m]=G.useState(!0),v=G.useMemo(()=>e.some(V=>V.resizable&&!V.hidden&&V.accessor!=="__selection__"),[e]),_=G.useMemo(()=>e.filter(V=>V.resizable&&!V.hidden&&V.accessor!=="__selection__"),[e]),M=G.useMemo(()=>_.some(V=>V.width===void 0||V.width===""||V.width==="initial"),[_]),S=G.useCallback(()=>e.filter(V=>V.accessor!=="__selection__").map(V=>({[V.accessor]:V.width??"auto"})),[e]),[x,P]=Le.useLocalStorage({key:t?`${t}-columns-width`:"",defaultValue:t?S():void 0,getInitialValueInEffect:!1}),[A,N]=G.useState(()=>S());G.useEffect(()=>{m(!1)},[]);let F=G.useCallback(()=>{if(!n?.current||i)return{};let V=n.current,q=Array.from(V.querySelectorAll("th[data-accessor]")),J={};return q.forEach(ae=>{let ne=ae.getAttribute("data-accessor");if(!ne||ne==="__selection__")return;let k=_.find(C=>C.accessor===ne);if(k&&(k.width===void 0||k.width===""||k.width==="initial")){let C=ae.getBoundingClientRect();J[ne]=Math.round(C.width)}}),J},[n,_,i]),B=G.useCallback(V=>{let q=V.filter(ae=>ae.accessor!=="__selection__"),J=A.map(ae=>{let ne=Object.keys(ae)[0],k=q.find(C=>C.accessor===ne);return k?{[ne]:k.width}:ae});N(J),t&&P(J)},[A,t,P]),Q=G.useCallback(V=>{B(V)},[B]),U=G.useCallback(()=>{if(!(!n?.current||!s||i))if(M)s(!1),requestAnimationFrame(()=>{requestAnimationFrame(()=>{let V=F();d.current={...d.current,...V};let q=e.filter(J=>J.accessor!=="__selection__").map(J=>{let ae=J.accessor,ne=x?.find(C=>Object.keys(C)[0]===ae);if(ne&&ne[ae]!=="auto")return{[ae]:ne[ae]};let k=V[ae];return k?{[ae]:`${k}px`}:{[ae]:J.width??"auto"}});N(q),setTimeout(()=>{s(!0),u.current=!0},10)})});else{let V=e.filter(q=>q.accessor!=="__selection__").map(q=>({[q.accessor]:q.width??"auto"}));N(V),s(!0),u.current=!0}},[n,s,i,M,F,e,x]),ee=U;G.useEffect(()=>{if(!v||!s||i){s?.(!1);return}u.current=!1;let V=setTimeout(()=>{U()},50);return()=>clearTimeout(V)},[v,s,i,U]),G.useEffect(()=>{i||!t||!r||x&&x.length>0&&N(x)},[i,t,r,x]);let re=G.useCallback(()=>{t&&P(S()),d.current={},u.current=!1,s&&(s(!1),setTimeout(()=>{U()},10))},[t,P,S,s,U]),K=G.useCallback((V,q)=>{B([{accessor:V,width:q}])},[B]),X=G.useMemo(()=>v?A.filter(V=>{let q=Object.keys(V)[0];return _.some(J=>J.accessor===q)}).every(V=>{let q=Object.values(V)[0];return q==="auto"||q==="initial"}):!1,[v,A,_]);return{columnsWidth:A,setColumnsWidth:B,setColumnWidth:K,setMultipleColumnWidths:Q,resetColumnsWidth:re,hasResizableColumns:v,allResizableWidthsInitial:X,measureAndSetColumnWidths:ee}}function Du({key:t,columns:e=[],getInitialValueInEffect:r=!0}){function n(M,S){let x=[];return M.forEach(P=>{S.find(A=>A.accessor===P.accessor)&&x.push(P)}),S.forEach(P=>{x.find(A=>A.accessor===P.accessor)||x.push({accessor:P.accessor,defaultToggle:P.defaultToggle||!0,toggleable:P.toggleable,toggled:P.defaultToggle===void 0?!0:P.defaultToggle})}),x}let s=e&&e.map(M=>({accessor:M.accessor,defaultToggle:M.defaultToggle||!0,toggleable:M.toggleable,toggled:M.defaultToggle===void 0?!0:M.defaultToggle})),[u,d]=Le.useLocalStorage({key:t?`${t}-columns-toggle`:"",defaultValue:t?s:void 0,getInitialValueInEffect:r});function i(M){t&&d(M)}let m=()=>{i(s)};if(!t)return{columnsToggle:u,setColumnsToggle:i,resetColumnsToggle:m};let v=n(u,e),_=JSON.stringify(u);return JSON.stringify(v)!==_&&i(v),{columnsToggle:v,setColumnsToggle:i,resetColumnsToggle:m}}var ku=({key:t,columns:e=[],getInitialValueInEffect:r=!0,headerRef:n,scrollViewportRef:s,onFixedLayoutChange:u})=>{let{columnsOrder:d,setColumnsOrder:i,resetColumnsOrder:m}=xu({key:t,columns:e,getInitialValueInEffect:r}),{columnsToggle:v,setColumnsToggle:_,resetColumnsToggle:M}=Du({key:t,columns:e,getInitialValueInEffect:r}),{columnsWidth:S,setColumnsWidth:x,setColumnWidth:P,setMultipleColumnWidths:A,resetColumnsWidth:N,hasResizableColumns:F,allResizableWidthsInitial:B,measureAndSetColumnWidths:Q}=Su({key:t,columns:e,getInitialValueInEffect:r,headerRef:n,onFixedLayoutChange:u});return{effectiveColumns:G.useMemo(()=>d?d.map(U=>e.find(ee=>ee.accessor===U)).map(U=>({...U,hidden:U?.hidden||!v.find(ee=>ee.accessor===U?.accessor)?.toggled})).map(U=>U?.accessor==="__selection__"?U:{...U,width:S.find(ee=>ee[U?.accessor])?.[U?.accessor]}):e,[e,d,v,S]),setColumnsOrder:i,columnsOrder:d,resetColumnsOrder:m,columnsToggle:v,setColumnsToggle:_,resetColumnsToggle:M,columnsWidth:S,setColumnsWidth:x,setColumnWidth:P,setMultipleColumnWidths:A,resetColumnsWidth:N,hasResizableColumns:F,allResizableWidthsInitial:B,measureAndSetColumnWidths:Q}},ms=typeof window<"u"?G.useLayoutEffect:G.useEffect;function ys(t){let e=G.useRef(t);return e.current=t,e}var vs="--mantine-datatable-header-height",bs="--mantine-datatable-footer-height",ws="--mantine-datatable-selection-column-width",_s="--mantine-datatable-last-row-border-bottom";function Je(t,e,r){t?.style.setProperty(e,r)}function pn(t){let e=t.borderBoxSize?.[0]||t.contentBoxSize?.[0];return e?{width:e.inlineSize,height:e.blockSize}:{width:t.contentRect.width,height:t.contentRect.height}}function gn(t,e,r){if(t){let n=new ResizeObserver(s=>{let u=s[0];u&&e(pn(u))});return n.observe(t),()=>{n.disconnect(),r()}}}function Pu({scrollCallbacks:t,withRowBorders:e}){let r={root:G.useRef(null),table:G.useRef(null),scrollViewport:G.useRef(null),header:G.useRef(null),footer:G.useRef(null),selectionColumnHeader:G.useRef(null)},{root:n,table:s,scrollViewport:u,header:d,footer:i,selectionColumnHeader:m}=r,v=ys({withRowBorders:e}),_=ys(t),M=G.useRef(()=>{}),S=G.useRef(()=>{}),x=G.useCallback(P=>{_.current.onScroll?.(P),M.current()},[]);return G.useEffect(()=>gn(d.current,P=>{Je(n.current,vs,`${P.height}px`)},()=>Je(n.current,vs,"0")),[d.current]),G.useEffect(()=>gn(i.current,P=>{Je(n.current,bs,`${P.height}px`)},()=>Je(n.current,bs,"0")),[i.current]),G.useEffect(()=>gn(m.current,P=>{Je(n.current,ws,`${P.width}px`)},()=>Je(n.current,ws,"0")),[m.current]),ms(()=>{if(typeof window===void 0)return;let P={top:!0,bottom:!0,left:!0,right:!0},A={width:0,height:0},N={width:0,height:0};function F(re,K){let X=P[re];return P[re]=K,Je(n.current,`--mantine-datatable-${re}-shadow-opacity`,K?"0":"1"),X}function B(){let re=A.height-N.height,K=re<0;Je(n.current,"--mantine-datatable-footer-position",K?"relative":"sticky"),Je(n.current,"--mantine-datatable-footer-bottom",K?`${re}px`:"0")}function Q(){v.current.withRowBorders&&A.height<N.height?Je(n.current,_s,`${T.rem("1px")} solid var(--mantine-datatable-border-color)`):Je(n.current,_s,"unset")}S.current=Q;function U(){let re=_.current,K=u.current,X=K?.scrollTop??0,V=K?.scrollLeft??0,q=X===0,J=A.height-X-N.height<1,ae=F("top",q),ne=F("bottom",J);q&&q!==ae&&re.onScrollToTop?.(),J&&J!==ne&&re.onScrollToBottom?.();let k=K?getComputedStyle(K).direction==="rtl":!1,C=(K?.scrollWidth??0)-N.width,b,h;if(k){let f=Math.abs(V);h=f<1,b=C-f<1}else b=V<1,h=A.width-V-N.width<1;let a=F("left",b),p=F("right",h);b&&b!==a&&re.onScrollToLeft?.(),h&&h!==p&&re.onScrollToRight?.()}M.current=U;let ee=new ResizeObserver(re=>{for(let K of re)switch(K.target.tagName){case"TABLE":{A=pn(K);break}case"DIV":{N=pn(K);break}}U(),B(),Q()});return ee.observe(s.current),ee.observe(u.current),()=>{ee.disconnect()}},[]),ms(()=>{S.current()},[e]),{refs:r,onScroll:x}}function Mu(t){let[e,r]=G.useState(null),n=t?.join(":")||"";return G.useEffect(()=>{r(null)},[n]),{lastSelectionChangeIndex:e,setLastSelectionChangeIndex:r}}function Ou(t,e){let r=()=>{e(t.map(s=>s.matches))},n=t.map(s=>{try{return s.addEventListener("change",r),()=>s.removeEventListener("change",r)}catch{return s.addListener(r),()=>s.removeListener(r)}});return()=>{n.forEach(s=>s())}}function Au(t,e){return e||(typeof window<"u"&&"matchMedia"in window?t.map(r=>window.matchMedia(r).matches):t.map(()=>!1))}function Eu(t,e,{getInitialValueInEffect:r}={getInitialValueInEffect:!0}){let[n,s]=G.useState(r?e:Au(t,e)),u=G.useRef(null);return G.useEffect(()=>{if("matchMedia"in window)return u.current=t.map(d=>window.matchMedia(d)),s(u.current.map(d=>d.matches)),Ou(u.current,d=>{s(d)})},[t]),n}function Tu(t){let e=T.useMantineTheme(),r=G.useMemo(()=>t.map(s=>(typeof s=="function"?s(e):s)??""),[t,e]),n=G.useMemo(()=>t.map(()=>!0),[t]);return Eu(r,n)}function xr(t){let e=T.useMantineTheme(),r=typeof t=="function"?t(e):t;return Le.useMediaQuery(r||"",!0)}function mn(t){let e=t.replace(/([a-z\d])([A-Z]+)/g,"$1 $2").replace(/\W|_/g," ").trim().toLowerCase();return`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function ju(t,e,r){return t.filter(n=>!e.map(r).includes(r(n)))}function yn(t,e){return t.filter((r,n,s)=>n===s.findIndex(u=>e(r)===e(u)))}function Cs(t,e){return e?e.match(/([^[.\]])+/g).reduce((r,n)=>r&&r[n],t):void 0}function Ie(t,e){return typeof e=="string"?Cs(t,e):e(t)}function xs(t){return!t||t.length===0?0:Math.max(...t.map(e=>e.groups&&e.groups.length>0?1+xs(e.groups):1))}function vn(t){let e=[];for(let r of t)r.columns&&r.columns.length>0?e.push(...r.columns.filter(n=>n!=null)):r.groups&&r.groups.length>0&&e.push(...vn(r.groups));return e.filter(r=>r!=null)}function bn(t,e){return t.columns&&t.columns.length>0?t.columns.filter((r,n)=>r.hidden?!1:e?e[n]!==!1:!0).length:t.groups&&t.groups.length>0?t.groups.reduce((r,n)=>r+bn(n,e),0):0}function Ss(t,e,r=0){if(r===e)return[...t];let n=[];for(let s of t)s.groups&&s.groups.length>0&&n.push(...Ss(s.groups,e,r+1));return n}function Ru(t,e,r){return r?!t||e:!1}function $u({rowExpansion:t,records:e,idAccessor:r}){let n=[];if(t&&e){let{trigger:i,allowMultiple:m,initiallyExpanded:v}=t;e&&i==="always"?n=e.map(_=>Ie(_,r)):v&&(n=e.filter((_,M)=>v({record:_,index:M})).map(_=>Ie(_,r)),m||(n=[n[0]]))}let s,u,d=G.useState(n);if(t){let{expandable:i,trigger:m,allowMultiple:v,collapseProps:_,content:M}=t;t.expanded?{recordIds:s,onRecordIdsChange:u}=t.expanded:[s,u]=d;let S=x=>u?.(s.filter(P=>P!==Ie(x,r)));return{expandOnClick:m!=="always"&&m!=="never",isRowExpanded:x=>m==="always"?!0:s.includes(Ie(x,r)),isExpandable:({record:x,index:P})=>i?i({record:x,index:P}):!0,expandRow:x=>{let P=Ie(x,r);u?.(v?[...s,P]:[P])},collapseRow:S,collapseProps:_,content:({record:x,index:P})=>()=>M({record:x,index:P,collapse:()=>S(x)})}}}function Nu(t,e){let[r,n]=G.useState(t),[s,u]=G.useState(t),d=Le.useTimeout(()=>n(!0),0),i=Le.useTimeout(()=>u(!1),e||200);return G.useEffect(()=>{t?(i.clear(),u(!0),d.start()):(d.clear(),n(!1),i.start())},[d,i,t]),{expanded:r,visible:s}}var wn="mantine-datatable-nowrap",_n="mantine-datatable-ellipsis",Ot="mantine-datatable-pointer-cursor",Ds="mantine-datatable-context-menu-cursor",Lu="mantine-datatable-text-selection-disabled",Sr="mantine-datatable-text-align-left",Dr="mantine-datatable-text-align-center",kr="mantine-datatable-text-align-right";function Bu({className:t,style:e,visibleMediaQuery:r,title:n,noWrap:s,ellipsis:u,textAlign:d,width:i}){return xr(r)?w.jsx(T.TableTh,{className:Pe({[wn]:s||u,[_n]:u,[Sr]:d==="left",[Dr]:d==="center",[kr]:d==="right"},t),style:[{width:i,minWidth:i,maxWidth:i},e],children:n}):null}function Iu({shadowVisible:t}){return w.jsx(T.TableTh,{className:"mantine-datatable-footer-selector-placeholder-cell","data-shadow-visible":t||void 0})}function Yu({className:t,style:e,columns:r,defaultColumnProps:n,selectionVisible:s,selectorCellShadowVisible:u,ref:d}){return w.jsx(T.TableTfoot,{ref:d,className:Pe("mantine-datatable-footer",t),style:e,children:w.jsxs(T.TableTr,{children:[s&&w.jsx(Iu,{shadowVisible:u}),r.map(({hidden:i,...m})=>{if(i)return null;let{accessor:v,visibleMediaQuery:_,textAlign:M,width:S,footer:x,footerClassName:P,footerStyle:A,noWrap:N,ellipsis:F}={...n,...m};return w.jsx(Bu,{className:P,style:A,visibleMediaQuery:_,textAlign:M,width:S,title:x,noWrap:N,ellipsis:F},v)})]})})}function zu({group:{id:t,columns:e,groups:r,title:n,textAlign:s,className:u,style:d},maxDepth:i,currentDepth:m,previousGroups:v,isLastGroup:_,withColumnBorders:M=!1,totalTableColumns:S}){let x=G.useMemo(()=>e&&e.length>0?e:r&&r.length>0?vn([{id:t,columns:e,groups:r}]):[],[e,r,t]),P=G.useMemo(()=>x.map(({visibleMediaQuery:ee})=>ee),[x]),A=Tu(P),N=G.useMemo(()=>bn({columns:e,groups:r},A),[t,e,r,A]),F=G.useMemo(()=>v.reduce((ee,re)=>ee+bn(re,A),0),[v,A]),B=r&&r.length>0?1:i-m,Q=F+N<S,U=Ru(_,Q,M);return N>0?w.jsx(T.TableTh,{colSpan:N,rowSpan:B>1?B:void 0,className:Pe("mantine-datatable-column-group-header-cell",{[Sr]:s==="left",[Dr]:s==="center",[kr]:s==="right","mantine-datatable-column-group-header-cell--needs-border":U},u),style:d,children:n??mn(t)}):null}function Fu(){return w.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),w.jsx("path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z"})]})}function Wu(){return w.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),w.jsx("path",{d:"M20 3h-16a1 1 0 0 0 -1 1v2.227l.008 .223a3 3 0 0 0 .772 1.795l4.22 4.641v8.114a1 1 0 0 0 1.316 .949l6 -2l.108 -.043a1 1 0 0 0 .576 -.906v-6.586l4.121 -4.12a3 3 0 0 0 .879 -2.123v-2.171a1 1 0 0 0 -1 -1z",strokeWidth:"0",fill:"currentColor"})]})}function Uu({children:t,isActive:e,filterPopoverProps:r,filterPopoverDisableClickOutside:n}){let[s,{close:u,toggle:d}]=Le.useDisclosure(!1),i=e?Wu:Fu,m=Le.useClickOutside(u);return n&&(m=void 0),w.jsxs(T.Popover,{withArrow:!0,shadow:"md",opened:s,onClose:u,trapFocus:!0,...r,children:[w.jsx(T.PopoverTarget,{children:w.jsx(T.ActionIcon,{className:"mantine-datatable-header-cell-filter-action-icon","data-active":e||void 0,size:"sm",variant:"default",onClick:v=>{v.preventDefault(),d()},onKeyDown:v=>v.stopPropagation(),children:w.jsx(i,{})})}),w.jsx(T.PopoverDropdown,{ref:m,onClick:v=>v.stopPropagation(),onKeyDown:v=>v.stopPropagation(),children:typeof t=="function"?t({close:u}):t})]})}var qu=t=>{let{accessor:e,columnRef:r}=t,[n,s]=G.useState(!1),u=G.useRef(0),d=G.useRef({current:0,next:0}),{dir:i}=T.useDirection(),m=i==="rtl",{setMultipleColumnWidths:v}=fn(),_=G.useCallback(S=>{if(S.preventDefault(),S.stopPropagation(),!r.current)return;let x=r.current,P=x.nextElementSibling;for(;P;){let ee=P.getAttribute("data-accessor");if(ee&&ee!=="__selection__")break;P=P.nextElementSibling}if(!P)return;let A=P.getAttribute("data-accessor");if(!A)return;let N=A==="__selection__";s(!0),u.current=S.clientX;let F=x.offsetWidth,B=P.offsetWidth;d.current={current:F,next:B};let Q=ee=>{if(!r.current)return;let re=r.current,K=re.nextElementSibling;if(!K)return;let X=ee.clientX-u.current;m&&(X=-X);let V=50,q=d.current.current-V,J=d.current.next-V,ae=Math.max(-q,Math.min(X,J)),ne=d.current.current+ae,k=d.current.next-ae;re.style.width=`${ne}px`,K.style.width=`${k}px`,re.style.minWidth=`${ne}px`,re.style.maxWidth=`${ne}px`,K.style.minWidth=`${k}px`,K.style.maxWidth=`${k}px`},U=()=>{if(!r.current)return;let ee=r.current,re=ee.nextElementSibling;s(!1),document.body.style.cursor="initial",document.body.style.userSelect="initial";let K=parseInt(ee.style.width)||ee.offsetWidth,X=re?parseInt(re.style.width)||re.offsetWidth:0,V=[{accessor:e,width:`${K}px`}];if(re&&!N){let q=re.getAttribute("data-accessor");q&&V.push({accessor:q,width:`${X}px`})}setTimeout(()=>{v(V)},0),document.removeEventListener("mousemove",Q),document.removeEventListener("mouseup",U)};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",Q),document.addEventListener("mouseup",U)},[e,r,m,v]),M=G.useCallback(()=>{if(!r.current)return;let S=r.current,x=S.nextElementSibling;S.style.width="",S.style.minWidth="",S.style.maxWidth="";let P=[{accessor:e,width:"auto"}];if(x){x.style.width="",x.style.minWidth="",x.style.maxWidth="";let A=x.getAttribute("data-accessor");A&&A!=="__selection__"&&P.push({accessor:A,width:"auto"})}setTimeout(()=>{v(P)},0)},[e,r,v]);return w.jsx("div",{className:"mantine-datatable-header-resizable-handle",style:{cursor:n?"col-resize":void 0},onMouseDown:_,onDoubleClick:M,onClick:S=>S.stopPropagation(),title:"Drag to resize column, double-click to reset"})};function Vu(){return w.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),w.jsx("path",{d:"M12 5l0 14"}),w.jsx("path",{d:"M16 9l-4 -4"}),w.jsx("path",{d:"M8 9l4 -4"})]})}function Hu(){return w.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),w.jsx("path",{d:"M8 7l4 -4l4 4"}),w.jsx("path",{d:"M8 17l4 4l4 -4"}),w.jsx("path",{d:"M12 3l0 18"})]})}function Gu(){return w.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),w.jsx("path",{d:"M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),w.jsx("path",{d:"M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),w.jsx("path",{d:"M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),w.jsx("path",{d:"M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),w.jsx("path",{d:"M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),w.jsx("path",{d:"M15 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"})]})}function Qu(){return w.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),w.jsx("path",{d:"M18 6l-12 12"}),w.jsx("path",{d:"M6 6l12 12"})]})}function Zu({className:t,style:e,accessor:r,visibleMediaQuery:n,title:s,sortable:u,draggable:d,toggleable:i,resizable:m,sortIcons:v,textAlign:_,width:M,sortStatus:S,onSortStatusChange:x,filter:P,filterPopoverProps:A,filterPopoverDisableClickOutside:N,filtering:F,sortKey:B}){let{setSourceColumn:Q,setTargetColumn:U,swapColumns:ee,setColumnsToggle:re}=fn(),[K,X]=G.useState(!1),V=G.useRef(null);if(!xr(n))return null;let q=s??mn(r),J=typeof q=="string"?q:void 0,ae=u&&x?p=>{p?.defaultPrevented||x({sortKey:B,columnAccessor:r,direction:S?.columnAccessor===r?S.direction==="asc"?"desc":"asc":S?.direction??"asc"})}:void 0,ne=p=>{p.stopPropagation(),Q(r),X(!1)},k=p=>{p.preventDefault(),U(r),X(!0)},C=()=>{U(r),X(!1),ee()},b=()=>{X(!0)},h=()=>{X(!1)},a=p=>{p.stopPropagation(),re(f=>f.map(c=>c.accessor===r?{...c,toggled:!1}:c))};return w.jsxs(T.TableTh,{"data-accessor":r,className:Pe({"mantine-datatable-header-cell-sortable":u,"mantine-datatable-header-cell-toggleable":i,"mantine-datatable-header-cell-resizable":m},t),style:[{width:M,...m?{}:{minWidth:M,maxWidth:M}},e],role:u?"button":void 0,tabIndex:u?0:void 0,onClick:ae,onKeyDown:p=>p.key==="Enter"&&ae?.(),ref:V,children:[w.jsxs(T.Group,{className:"mantine-datatable-header-cell-sortable-group",justify:"space-between",wrap:"nowrap",children:[w.jsxs(T.Flex,{align:"center",w:"100%",className:Pe({"mantine-datatable-header-cell-draggable":d,"mantine-datatable-header-cell-drag-over":K}),draggable:d,onDragStart:d?ne:void 0,onDragEnter:d?b:void 0,onDragOver:d?k:void 0,onDrop:d?C:void 0,onDragLeave:d?h:void 0,children:[d?w.jsx(T.Center,{role:"img","aria-label":"Drag column",children:w.jsx(T.ActionIcon,{className:"mantine-datatable-header-cell-draggable-action-icon",variant:"subtle",size:"xs",onClick:p=>{p.stopPropagation()},children:w.jsx(Gu,{})})}):null,w.jsx(T.Box,{className:Pe("mantine-datatable-header-cell-sortable-text",{[Sr]:_==="left",[Dr]:_==="center",[kr]:_==="right"},wn,_n),title:J,children:q})]}),i?w.jsx(T.Center,{className:"mantine-datatable-header-cell-toggleable-icon",role:"img","aria-label":"Toggle column",children:w.jsx(T.ActionIcon,{size:"xs",variant:"light",onClick:a,children:w.jsx(Qu,{})})}):null,u||S?.columnAccessor===r?w.jsx(w.Fragment,{children:S?.columnAccessor===r?w.jsx(T.Center,{className:Pe("mantine-datatable-header-cell-sortable-icon",{"mantine-datatable-header-cell-sortable-icon-reversed":S.direction==="desc"}),role:"img","aria-label":`Sorted ${S.direction==="desc"?"descending":"ascending"}`,children:v?.sorted||w.jsx(Vu,{})}):w.jsx(T.Center,{className:"mantine-datatable-header-cell-sortable-unsorted-icon",role:"img","aria-label":"Not sorted",children:v?.unsorted||w.jsx(Hu,{})})}):null,P?w.jsx(Uu,{filterPopoverProps:A,isActive:!!F,filterPopoverDisableClickOutside:N,children:P}):null]}),m&&r!=="__selection__"?w.jsx(qu,{accessor:r,columnRef:V}):null]})}function Ku({className:t,style:e,trigger:r,shadowVisible:n,checked:s,indeterminate:u,checkboxProps:d,onChange:i,rowSpan:m,ref:v}){let _=!d.disabled;return w.jsx(T.TableTh,{ref:v,className:Pe("mantine-datatable-header-selector-cell",{[Ot]:r==="cell"&&_},t),style:e,rowSpan:m,"data-shadow-visible":n||void 0,"data-accessor":"__selection__",onClick:r==="cell"&&_?i:void 0,children:w.jsx(T.Checkbox,{classNames:_?{input:Ot}:void 0,checked:s,indeterminate:u,onChange:i,...d,disabled:!(i||d.onChange)||d.disabled})})}function Ju({selectionColumnHeaderRef:t,className:e,style:r,sortStatus:n,sortIcons:s,onSortStatusChange:u,columns:d,defaultColumnProps:i,groups:m,selectionTrigger:v,selectionVisible:_,selectionChecked:M,selectionIndeterminate:S,onSelectionChange:x,selectionCheckboxProps:P,selectorCellShadowVisible:A,selectionColumnClassName:N,selectionColumnStyle:F,withColumnBorders:B=!1,ref:Q}){let U=m?xs(m):0,ee=U>0?U+1:1,re=_?w.jsx(Ku,{ref:t,className:N,style:F,trigger:v,shadowVisible:A,checked:M,indeterminate:S,checkboxProps:P,onChange:x,rowSpan:m?ee:void 0}):null,{columnsToggle:K,setColumnsToggle:X}=fn(),[V,q]=G.useState(!1),J=d.some(k=>k.toggleable),ae=J?Object.fromEntries(d.map(({accessor:k,title:C})=>[k,C??mn(String(k))])):void 0,ne=w.jsxs(T.TableThead,{className:Pe("mantine-datatable-header",e),style:r,ref:Q,onContextMenu:J?k=>{k.preventDefault(),q(C=>!C)}:void 0,children:[m&&Array.from({length:U},(k,C)=>{let b=Ss(m,C);return w.jsxs(T.TableTr,{children:[C===0&&re,b.map((h,a)=>w.jsx(zu,{group:h,maxDepth:U,currentDepth:C,previousGroups:b.slice(0,a),isLastGroup:a===b.length-1,withColumnBorders:B,totalTableColumns:d.length},h.id))]},`group-depth-${C}`)}),w.jsxs(T.TableTr,{children:[!m&&re,d.map(({hidden:k,...C},b)=>{if(k)return null;let{accessor:h,visibleMediaQuery:a,textAlign:p,width:f,title:c,sortable:y,draggable:D,toggleable:j,resizable:W,titleClassName:Z,titleStyle:te,filter:H,filterPopoverProps:se,filterPopoverDisableClickOutside:ie,filtering:ue,sortKey:E}={...i,...C};return w.jsx(Zu,{accessor:h,className:Z,style:te,visibleMediaQuery:a,textAlign:p,width:f,title:c,sortable:y,draggable:D,toggleable:j,resizable:W&&b<d.length-1,sortStatus:n,sortIcons:s,sortKey:E,onSortStatusChange:u,filter:H,filterPopoverProps:se,filterPopoverDisableClickOutside:ie,filtering:ue},h)})]})]});return J?w.jsxs(T.Popover,{position:"bottom",withArrow:!0,shadow:"md",opened:V,onChange:q,children:[w.jsx(T.PopoverTarget,{children:ne}),w.jsx(T.PopoverDropdown,{children:w.jsx(T.Stack,{children:K.filter(k=>k.toggleable).map(k=>w.jsx(T.Group,{children:w.jsx(T.Checkbox,{classNames:{label:"mantine-datatable-header-column-toggle-checkbox-label"},size:"xs",label:ae[k.accessor],checked:k.toggled,onChange:C=>{X(K.map(b=>b.accessor===k.accessor?{...b,toggled:C.currentTarget.checked}:b))}})},k.accessor))})})]}):ne}function Xu({fetching:t,customContent:e,backgroundBlur:r,size:n,type:s,color:u}){return w.jsx(T.Center,{className:Pe("mantine-datatable-loader",{"mantine-datatable-loader-fetching":t}),style:[{backdropFilter:r?`blur(${r}px)`:void 0}],children:t&&(e||w.jsx(T.Loader,{size:n,type:s,color:u}))})}function Ee(t,e,r){return t?T.parseThemeColor({color:typeof t=="object"?t[r]:t,theme:e}).value:void 0}function ec({theme:t,c:e,backgroundColor:r,borderColor:n,rowBorderColor:s,stripedColor:u,highlightOnHoverColor:d}){return{"--mantine-datatable-color-light":Ee(e,t,"light"),"--mantine-datatable-color-dark":Ee(e,t,"dark"),"--mantine-datatable-background-color-light":Ee(r,t,"light"),"--mantine-datatable-background-color-dark":Ee(r,t,"dark"),"--mantine-datatable-border-color-light":Ee(n,t,"light"),"--mantine-datatable-border-color-dark":Ee(n,t,"dark"),"--mantine-datatable-row-border-color-light":Ee(s,t,"light"),"--mantine-datatable-row-border-color-dark":Ee(s,t,"dark"),"--mantine-datatable-striped-color-light":Ee(u,t,"light"),"--mantine-datatable-striped-color-dark":Ee(u,t,"dark"),"--mantine-datatable-highlight-on-hover-color-light":Ee(d,t,"light"),"--mantine-datatable-highlight-on-hover-color-dark":Ee(d,t,"dark")}}function ks({theme:t,paginationActiveTextColor:e,paginationActiveBackgroundColor:r}){return{"--mantine-datatable-pagination-active-text-color-light":Ee(e,t,"light"),"--mantine-datatable-pagination-active-text-color-dark":Ee(e,t,"dark"),"--mantine-datatable-pagination-active-background-color-light":Ee(r,t,"light"),"--mantine-datatable-pagination-active-background-color-dark":Ee(r,t,"dark")}}function tc({theme:t,color:e,backgroundColor:r}){return{"--mantine-datatable-row-color-light":Ee(e,t,"light"),"--mantine-datatable-row-color-dark":Ee(e,t,"dark"),"--mantine-datatable-row-background-color-light":Ee(r,t,"light"),"--mantine-datatable-row-background-color-dark":Ee(r,t,"dark")}}function rc(){return w.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),w.jsx("path",{d:"M8 9l4 -4l4 4"}),w.jsx("path",{d:"M16 15l-4 4l-4 -4"})]})}var Ps={xs:T.rem(22),sm:T.rem(26),md:T.rem(32),lg:T.rem(38),xl:T.rem(44)};function nc({size:t,label:e,values:r,value:n,activeTextColor:s,activeBackgroundColor:u,onChange:d}){return w.jsxs(T.Group,{gap:"xs",children:[w.jsx(T.Text,{component:"div",size:t,children:e}),w.jsxs(T.Menu,{withinPortal:!0,withArrow:!0,offset:2,classNames:{arrow:"mantine-datatable-page-size-selector-menu-arrow"},children:[w.jsx(T.MenuTarget,{children:w.jsx(T.Button,{size:t,variant:"default",classNames:{section:"mantine-datatable-page-size-selector-button-icon"},rightSection:w.jsx(rc,{}),style:[{fontWeight:"normal"},i=>({height:Ps[t],paddingLeft:i.spacing[t],paddingRight:i.spacing[t]})],children:n})}),w.jsx(T.MenuDropdown,{children:r.map(i=>{let m=i===n;return w.jsx(T.MenuItem,{className:Pe({"mantine-datatable-page-size-selector-active":m}),style:[{height:Ps[t]},m&&(s||u)?v=>ks({theme:v,paginationActiveTextColor:s,paginationActiveBackgroundColor:u}):void 0],disabled:m,onClick:()=>d(i),children:w.jsx(T.Text,{component:"div",size:t,children:i})},i)})})]})]})}function oc({className:t,style:e,fetching:r,page:n,onPageChange:s,paginationWithEdges:u,paginationWithControls:d,paginationActiveTextColor:i,paginationActiveBackgroundColor:m,paginationSize:v,loadingText:_,noRecordsText:M,paginationText:S,totalRecords:x,recordsPerPage:P,onRecordsPerPageChange:A,recordsPerPageLabel:N,recordsPerPageOptions:F,recordsLength:B,horizontalSpacing:Q,paginationWrapBreakpoint:U,getPaginationControlProps:ee,getPaginationItemProps:re,renderPagination:K}){let X;if(x){let C=(n-1)*P+1,b=C+(B||0)-1;X=S({from:C,to:b,totalRecords:x})}else X=r?_:M;let V=x&&P?Math.max(1,Math.ceil(x/P)):1,q=x?(n-1)*(P??0)+1:void 0,J=x?(q??1)+(B??0)-1:void 0,ae=!xr(({breakpoints:C})=>`(min-width: ${typeof U=="number"?`${T.rem(U)}rem`:C[U]||U})`),ne={Text:C=>w.jsx(T.Text,{component:"div",className:"mantine-datatable-pagination-text",size:v,...C,children:X}),PageSizeSelector:C=>F?w.jsx(nc,{activeTextColor:i,activeBackgroundColor:m,size:v,label:N,values:F,value:P,onChange:A,...C}):w.jsx(w.Fragment,{}),Pagination:C=>w.jsx(T.Pagination,{classNames:{root:Pe("mantine-datatable-pagination-pages",{"mantine-datatable-pagination-pages-fetching":r||!B}),control:"mantine-datatable-pagination-pages-control"},style:i||m?b=>ks({theme:b,paginationActiveTextColor:i,paginationActiveBackgroundColor:m}):void 0,withEdges:u,withControls:d,value:n,onChange:s,size:v,total:V,getControlProps:ee,getItemProps:re,...C})},k={state:{paginationSize:v,page:n,totalPages:V,totalRecords:x,recordsPerPage:P,recordsLength:B,fetching:r,from:q,to:J,isWrapped:ae},actions:{setPage:C=>s?.(C),setRecordsPerPage:A?C=>A(C):void 0},Controls:ne};return w.jsx(T.Box,{px:Q??"xs",py:"xs",className:Pe("mantine-datatable-pagination",t),style:[{flexDirection:ae?"column":"row"},e],children:typeof K=="function"?K(k):w.jsxs(w.Fragment,{children:[w.jsx(ne.Text,{}),w.jsx(ne.PageSizeSelector,{}),w.jsx(ne.Pagination,{})]})})}function sc({className:t,style:e,visibleMediaQuery:r,record:n,index:s,onClick:u,onDoubleClick:d,onContextMenu:i,noWrap:m,ellipsis:v,textAlign:_,width:M,accessor:S,render:x,defaultRender:P,customCellAttributes:A}){return xr(r)?w.jsx(T.TableTd,{className:Pe({[wn]:m||v,[_n]:v,[Ot]:u||d,[Ds]:i,[Sr]:_==="left",[Dr]:_==="center",[kr]:_==="right"},t),style:[{width:M,minWidth:M,maxWidth:M},e],onClick:u,onDoubleClick:d,onContextMenu:i,...A?.(n,s),children:x?x(n,s):P?P(n,s,S):Cs(n,S)}):null}function ic({open:t,colSpan:e,content:r,collapseProps:n}){let{expanded:s,visible:u}=Nu(t,n?.transitionDuration);return u?w.jsxs(w.Fragment,{children:[w.jsx(T.TableTr,{}),w.jsx(T.TableTr,{children:w.jsx(T.TableTd,{className:"mantine-datatable-row-expansion-cell",colSpan:e,children:w.jsx(T.Collapse,{in:s,...n,children:w.jsx("div",{className:"mantine-datatable-row-expansion-cell-content",children:r()})})})})]}):null}function ac({className:t,style:e,record:r,index:n,trigger:s,onChange:u,withRightShadow:d,checkboxProps:i,getCheckboxProps:m,...v}){let _={...i,...m(r,n)},M=!v.disabled&&!_.disabled,S=x=>{x.stopPropagation(),s==="cell"&&M&&u?.(x)};return w.jsx(T.TableTd,{className:Pe("mantine-datatable-row-selector-cell",{[Ot]:s==="cell"&&M},t),style:e,"data-shadow-visible":d||void 0,onClick:S,children:w.jsx(T.Checkbox,{classNames:M?{input:Ot}:void 0,onChange:u,...v,..._})})}function lc({record:t,index:e,columns:r,defaultColumnProps:n,defaultColumnRender:s,selectionTrigger:u,selectionVisible:d,selectionChecked:i,onSelectionChange:m,isRecordSelectable:v,selectionCheckboxProps:_,getSelectionCheckboxProps:M,onClick:S,onDoubleClick:x,onContextMenu:P,onCellClick:A,onCellDoubleClick:N,onCellContextMenu:F,expansion:B,customAttributes:Q,color:U,backgroundColor:ee,className:re,style:K,selectorCellShadowVisible:X,selectionColumnClassName:V,selectionColumnStyle:q,rowFactory:J}){let ae=w.jsxs(w.Fragment,{children:[d&&w.jsx(ac,{className:V,style:q,record:t,index:e,trigger:u,withRightShadow:X,checked:i,disabled:!m||(v?!v(t,e):!1),onChange:m,checkboxProps:_,getCheckboxProps:M}),r.map(({hidden:C,hiddenContent:b,...h},a)=>{if(C||b)return null;let{accessor:p,visibleMediaQuery:f,textAlign:c,noWrap:y,ellipsis:D,width:j,render:W,cellsClassName:Z,cellsStyle:te,customCellAttributes:H}={...n,...h};return w.jsx(sc,{className:typeof Z=="function"?Z(t,e):Z,style:te?.(t,e),visibleMediaQuery:f,record:t,index:e,onClick:A?se=>A({event:se,record:t,index:e,column:h,columnIndex:a}):void 0,onDoubleClick:N?se=>N({event:se,record:t,index:e,column:h,columnIndex:a}):void 0,onContextMenu:F?se=>F({event:se,record:t,index:e,column:h,columnIndex:a}):void 0,accessor:p,textAlign:c,noWrap:y,ellipsis:D,width:j,render:W,defaultRender:s,customCellAttributes:H},p)})]}),ne=B&&w.jsx(ic,{colSpan:r.filter(({hidden:C})=>!C).length+(d?1:0),open:B.isRowExpanded(t),content:B.content({record:t,index:e}),collapseProps:B.collapseProps}),k=uc({record:t,index:e,selectionChecked:i,onClick:S,onDoubleClick:x,onContextMenu:P,expansion:B,customAttributes:Q,color:U,backgroundColor:ee,className:re,style:K});return J?J({record:t,index:e,rowProps:k,children:ae,expandedElement:ne}):w.jsxs(w.Fragment,{children:[w.jsx(T.TableTr,{...k,children:ae}),ne]})}function uc({record:t,index:e,selectionChecked:r,onClick:n,onDoubleClick:s,onContextMenu:u,expansion:d,customAttributes:i,color:m,backgroundColor:v,className:_,style:M}){return{className:Pe("mantine-datatable-row",{[Ot]:n||s||d?.isExpandable({record:t,index:e})&&d?.expandOnClick},{[Ds]:u},typeof _=="function"?_(t,e):_),"data-selected":r||void 0,onClick:S=>{if(d){let{isExpandable:x,isRowExpanded:P,expandOnClick:A,expandRow:N,collapseRow:F}=d;x({record:t,index:e})&&A&&(P(t)?F(t):N(t))}n?.({event:S,record:t,index:e})},onDoubleClick:s?S=>s({event:S,record:t,index:e}):void 0,onContextMenu:u?S=>u({event:S,record:t,index:e}):void 0,style:[m||v?S=>{let x=m?.(t,e),P=v?.(t,e);return tc({theme:S,color:x,backgroundColor:P})}:void 0,M?.(t,e)],...i?.(t,e)??{}}}function cc({leftShadowBehind:t,rightShadowBehind:e,onScrollPositionChange:r,children:n,viewportRef:s,scrollAreaProps:u}){return w.jsxs(T.ScrollArea,{...u,viewportRef:s,classNames:{root:"mantine-datatable-scroll-area",scrollbar:"mantine-datatable-scroll-area-scrollbar",thumb:"mantine-datatable-scroll-area-thumb",corner:"mantine-datatable-scroll-area-corner"},onScrollPositionChange:r,children:[n,w.jsx(T.Box,{className:Pe("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-top-shadow")}),w.jsx("div",{className:Pe("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-left-shadow",{"mantine-datatable-scroll-area-shadow-behind":t})}),w.jsx("div",{className:Pe("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-right-shadow",{"mantine-datatable-scroll-area-shadow-behind":e})}),w.jsx(T.Box,{className:Pe("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-bottom-shadow")})]})}function dc({withTableBorder:t,borderRadius:e,textSelectionDisabled:r,height:n="100%",minHeight:s,maxHeight:u,shadow:d,verticalAlign:i="center",fetching:m,columns:v,storeColumnsKey:_,groups:M,pinFirstColumn:S,pinLastColumn:x,defaultColumnProps:P,defaultColumnRender:A,idAccessor:N="id",records:F,selectionTrigger:B="checkbox",selectedRecords:Q,onSelectedRecordsChange:U,selectionColumnClassName:ee,selectionColumnStyle:re,isRecordSelectable:K,selectionCheckboxProps:X,allRecordsSelectionCheckboxProps:V={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:q=(Ae,ut)=>({"aria-label":`Select record ${ut+1}`}),sortStatus:J,sortIcons:ae,onSortStatusChange:ne,horizontalSpacing:k,page:C,onPageChange:b,totalRecords:h,recordsPerPage:a,onRecordsPerPageChange:p,recordsPerPageOptions:f,recordsPerPageLabel:c="Records per page",paginationWithEdges:y,paginationWithControls:D,paginationActiveTextColor:j,paginationActiveBackgroundColor:W,paginationSize:Z="sm",paginationText:te=({from:Ae,to:ut,totalRecords:Cn})=>`${Ae} - ${ut} / ${Cn}`,paginationWrapBreakpoint:H="sm",getPaginationControlProps:se=Ae=>Ae==="previous"?{"aria-label":"Previous page"}:Ae==="next"?{"aria-label":"Next page"}:{},getPaginationItemProps:ie,renderPagination:ue,loaderBackgroundBlur:E,customLoader:L,loaderSize:R,loaderType:Y,loaderColor:I,loadingText:de="...",emptyState:o,noRecordsText:l="No records",noRecordsIcon:g,highlightOnHover:O,striped:$,noHeader:z,onRowClick:le,onRowDoubleClick:ce,onRowContextMenu:fe,onCellClick:oe,onCellDoubleClick:pe,onCellContextMenu:me,onScroll:ge,onScrollToTop:xe,onScrollToBottom:Ce,onScrollToLeft:ke,onScrollToRight:qe,c:$e,backgroundColor:_e,borderColor:ot,rowBorderColor:Te,stripedColor:Ve,highlightOnHoverColor:Ye,rowColor:Xe,rowBackgroundColor:st,rowExpansion:je,rowClassName:it,rowStyle:at,customRowAttributes:lt,scrollViewportRef:dt,scrollAreaProps:He,tableRef:Ge,bodyRef:et,m:vt,my:ve,mx:Me,mt:tt,mb:rt,ml:bt,mr:wt,className:At,classNames:Se,style:Oe,styles:nt,rowFactory:Ne,tableWrapper:De,...ze}){let Ae=G.useMemo(()=>M?vn(M):v,[v,M]),[ut,Cn]=G.useState(!1),{refs:ct,onScroll:Tc}=Pu({scrollCallbacks:{onScroll:ge,onScrollToTop:xe,onScrollToBottom:Ce,onScrollToLeft:ke,onScrollToRight:qe},withRowBorders:ze.withRowBorders}),xn=ku({key:_,columns:Ae,headerRef:ct.header,scrollViewportRef:ct.scrollViewport,onFixedLayoutChange:Cn}),jc=Le.useMergedRef(ct.table,Ge),Rc=Le.useMergedRef(ct.scrollViewport,dt),$c=$u({rowExpansion:je,records:F,idAccessor:N}),Pr=G.useRef(!1),Rs=G.useRef(C),Sn=G.useRef(F),Nc=G.useCallback(be=>{Pr.current=!0,Sn.current=F,b(be)},[b,F]);G.useEffect(()=>{Rs.current!==C&&(Pr.current=!0,Sn.current=F,Rs.current=C)},[C,F]);let Mr=F?.length;G.useLayoutEffect(()=>{if(!Pr.current||m||F===Sn.current)return;let be=ct.scrollViewport.current;if(!be)return;let xt=requestAnimationFrame(()=>{be.scrollTo({top:0,left:0}),Pr.current=!1});return()=>cancelAnimationFrame(xt)},[m,F,ct.scrollViewport]);let $s=F?.map(be=>Ie(be,N)),Et=!!Q,Gt=Q?.map(be=>Ie(be,N)),Ns=$s!==void 0&&Gt!==void 0&&Gt.length>0,Dn=K?F?.filter(K):F,Or=Dn?.map(be=>Ie(be,N)),Ar=Ns&&Or.every(be=>Gt.includes(be)),Lc=Ns&&Or.some(be=>Gt.includes(be)),Bc=G.useCallback(()=>{Q&&U&&U(Ar?Q.filter(be=>!Or.includes(Ie(be,N))):yn([...Q,...Dn],be=>Ie(be,N)))},[Ar,N,U,Or,Dn,Q]),{lastSelectionChangeIndex:Er,setLastSelectionChangeIndex:Ic}=Mu($s),kn=Et&&!S,Yc={m:vt,my:ve,mx:Me,mt:tt,mb:rt,ml:bt,mr:wt},zc=G.useCallback(({children:be})=>De?De({children:be}):be,[De]);return w.jsx(gs,{...xn,children:w.jsxs(T.Box,{ref:ct.root,...Yc,className:Pe("mantine-datatable",{"mantine-datatable-with-border":t},At,Se?.root),style:[be=>({...ec({theme:be,c:$e,backgroundColor:_e,borderColor:ot,rowBorderColor:Te,stripedColor:Ve,highlightOnHoverColor:Ye}),borderRadius:be.radius[e]||e,boxShadow:be.shadows[d]||d,height:n,minHeight:s,maxHeight:u}),Oe,nt?.root,{position:"relative"}],children:[w.jsx(cc,{viewportRef:Rc,leftShadowBehind:Et||!!S,rightShadowBehind:x,onScrollPositionChange:Tc,scrollAreaProps:He,children:w.jsx(zc,{children:w.jsxs(T.Table,{ref:jc,horizontalSpacing:k,className:Pe("mantine-datatable-table",{[Lu]:r,"mantine-datatable-vertical-align-top":i==="top","mantine-datatable-vertical-align-bottom":i==="bottom","mantine-datatable-pin-last-column":x,"mantine-datatable-selection-column-visible":Et,"mantine-datatable-pin-first-column":S,"mantine-datatable-resizable-columns":xn.hasResizableColumns&&ut},Se?.table),style:{...nt?.table},"data-striped":Mr&&$||void 0,"data-highlight-on-hover":O||void 0,...ze,children:[z?null:w.jsx(gs,{...xn,children:w.jsx(Ju,{ref:ct.header,selectionColumnHeaderRef:ct.selectionColumnHeader,className:Se?.header,style:nt?.header,columns:Ae,defaultColumnProps:P,groups:M,sortStatus:J,sortIcons:ae,onSortStatusChange:ne,selectionTrigger:B,selectionVisible:Et,selectionChecked:Ar,selectionIndeterminate:Lc&&!Ar,onSelectionChange:Bc,selectionCheckboxProps:{...X,...V},selectorCellShadowVisible:kn,selectionColumnClassName:ee,selectionColumnStyle:re,withColumnBorders:ze.withColumnBorders})}),w.jsx("tbody",{ref:et,children:Mr?F.map((be,xt)=>{let Pn=Ie(be,N),Mn=Gt?.includes(Pn)||!1,Ls;return U&&Q&&(Ls=Fc=>{if(Fc.nativeEvent.shiftKey&&Er!==null){let Tt=F.filter(xt>Er?(St,Dt)=>Dt>=Er&&Dt<=xt&&(K?K(St,Dt):!0):(St,Dt)=>Dt>=xt&&Dt<=Er&&(K?K(St,Dt):!0));U(Mn?ju(Q,Tt,St=>Ie(St,N)):yn([...Q,...Tt],St=>Ie(St,N)))}else U(Mn?Q.filter(Tt=>Ie(Tt,N)!==Pn):yn([...Q,be],Tt=>Ie(Tt,N)));Ic(xt)}),w.jsx(lc,{record:be,index:xt,columns:Ae,defaultColumnProps:P,defaultColumnRender:A,selectionTrigger:B,selectionVisible:Et,selectionChecked:Mn,onSelectionChange:Ls,isRecordSelectable:K,selectionCheckboxProps:X,getSelectionCheckboxProps:q,onClick:le,onDoubleClick:ce,onCellClick:oe,onCellDoubleClick:pe,onContextMenu:fe,onCellContextMenu:me,expansion:$c,color:Xe,backgroundColor:st,className:it,style:at,customAttributes:lt,selectorCellShadowVisible:kn,selectionColumnClassName:ee,selectionColumnStyle:re,idAccessor:N,rowFactory:Ne},Pn)}):w.jsx(wu,{})}),Ae.some(({footer:be})=>be)&&w.jsx(Yu,{ref:ct.footer,className:Se?.footer,style:nt?.footer,columns:Ae,defaultColumnProps:P,selectionVisible:Et,selectorCellShadowVisible:kn})]})})}),C&&w.jsx(oc,{className:Se?.pagination,style:nt?.pagination,horizontalSpacing:k,fetching:m,page:C,onPageChange:Nc,totalRecords:h,recordsPerPage:a,onRecordsPerPageChange:p,recordsPerPageOptions:f,recordsPerPageLabel:c,paginationWithEdges:y,paginationWithControls:D,paginationActiveTextColor:j,paginationActiveBackgroundColor:W,paginationSize:Z,paginationText:te,paginationWrapBreakpoint:H,getPaginationControlProps:se,getPaginationItemProps:ie,noRecordsText:l,loadingText:de,recordsLength:Mr,renderPagination:ue}),w.jsx(Xu,{fetching:m,backgroundBlur:E,customContent:L,size:R,type:Y,color:I}),w.jsx(Cu,{icon:g,text:l,active:!m&&!Mr,children:o})]})})}function Ms(t){const e=Qe.c(42),{fields:r,onClose:n,queryKey:s,apiPath:u,id:d,steps:i}=t,[m,v]=G.useState(0),[_,M]=G.useState(!1),{data:S,isLoading:x}=Wo(u,s,d),{mutateAsync:P,isError:A,error:N,isPending:F}=sn(u,s);let B;e[0]!==r?(B=new Set(r.filter(yc).map(mc)),e[0]=r,e[1]=B):B=e[1];let Q;e[2]!==B?(Q=[...B],e[2]=B,e[3]=Q):Q=e[3];const U=Q;let ee;e[4]!==r?(ee=r.reduce(gc,{}),e[4]=r,e[5]=ee):ee=e[5];let re;e[6]!==r?(re=r.filter(pc).reduce(fc,{}),e[6]=r,e[7]=re):re=e[7];let K;e[8]!==ee||e[9]!==re?(K={mode:"uncontrolled",initialValues:ee,validate:re},e[8]=ee,e[9]=re,e[10]=K):K=e[10];const X=On.useForm(K);let V;e[11]!==S||e[12]!==r||e[13]!==X?(V=()=>{if(S){const a={...S};r.forEach(p=>{const f=p.id;p.type==="boolean"&&a[f]===null?a[f]=!1:p.type==="date"&&a[f]?a[f]=new Date(a[f]):a[f]===null&&(a[f]="")}),X.initialize(a),X.setValues(a)}},e[11]=S,e[12]=r,e[13]=X,e[14]=V):V=e[14];let q;e[15]!==S?(q=[S],e[15]=S,e[16]=q):q=e[16],G.useEffect(V,q);let J;e[17]===Symbol.for("react.memo_cache_sentinel")?(J=function(p,f){return typeof p.required=="function"?p.required(f??{}):!!p.required},e[17]=J):J=e[17];const ae=J;let ne;e[18]!==X||e[19]!==d?(ne=function(p){const f=X.getValues();if(p.conditional&&!p.conditional(f))return null;const c=ae(p,f);return w.jsxs(G.Fragment,{children:[(p.type===void 0||p.type=="text")&&w.jsx(T.TextInput,{label:p.column.title,placeholder:p.placeholder??"",...X.getInputProps(p.id),type:p.id.includes("email")?"email":void 0,required:c},X.key(p.id)),p.type==="number"&&w.jsx(T.NumberInput,{decimalSeparator:",",label:p.column.title,placeholder:p.placeholder??"",...X.getInputProps(p.id),required:c},X.key(p.id)),p.type==="date"&&w.jsx(Cr,{label:p.column.title,placeholder:p.placeholder??"",valueFormat:"DD.MM.YYYY",clearable:!0,...X.getInputProps(p.id),required:c},X.key(p.id)),p.type==="boolean"&&w.jsx(T.Checkbox,{mt:"md",label:p.column.title,...X.getInputProps(p.id,{type:"checkbox"}),required:c},X.key(p.id)),p.type==="textarea"&&w.jsx(T.Textarea,{label:p.column.title,placeholder:p.placeholder??"",...X.getInputProps(p.id),minRows:3,autosize:!0,required:c},X.key(p.id)),p.type==="custom"&&p.render&&p.render({...X.getValues(),id:d},X.setValues,M,{error:X.getInputProps(p.id).error,required:c})]},p.id)},e[18]=X,e[19]=d,e[20]=ne):ne=e[20];const k=ne;let C;e[21]!==A||e[22]!==N?.message||e[23]!==N?.name?(C=A&&w.jsx(T.Alert,{variant:"outline",color:"red",title:N?.name??"Fehler aufgetreten",mb:"lg",children:N?.message??"Fehler aufgetreten"}),e[21]=A,e[22]=N?.message,e[23]=N?.name,e[24]=C):C=e[24];let b;e[25]!==m||e[26]!==r||e[27]!==X||e[28]!==_||e[29]!==d||e[30]!==x||e[31]!==F||e[32]!==A||e[33]!==n||e[34]!==k||e[35]!==i||e[36]!==U||e[37]!==P?(b=x?w.jsxs(T.Stack,{gap:"md",children:[w.jsx(T.Skeleton,{height:40}),Array(r.length).fill(0).map(hc),w.jsxs(T.Group,{mt:"md",justify:"end",children:[w.jsx(T.Skeleton,{width:100,height:36}),w.jsx(T.Skeleton,{width:100,height:36})]})]}):w.jsxs("form",{onSubmit:X.onSubmit(async a=>{await P({...a,id:d}),U.length&&m<U.length-1?A||v(m+1):A||(X.setInitialValues(a),X.reset(),n())}),children:[U.length?w.jsx(T.Stepper,{active:m,size:"sm",children:U.map(a=>w.jsx(T.Stepper.Step,{...i&&i[a-1]?{label:i[a-1].label}:{},children:r.filter(p=>p.step===a).map(p=>k(p))},a))}):r.map(a=>k(a)),!_&&w.jsxs(T.Group,{mt:"md",justify:"end",children:[w.jsx(T.Button,{onClick:()=>U.length?m===0?n():v(m-1):n(),variant:"outline",children:U.length?m===0?"Abbrechen":"Zurück":"Abbrechen"}),w.jsx(T.Button,{type:"submit",loading:F,children:U.length?m===U.length-1?"Speichern":"Weiter":"Speichern"})]})]}),e[25]=m,e[26]=r,e[27]=X,e[28]=_,e[29]=d,e[30]=x,e[31]=F,e[32]=A,e[33]=n,e[34]=k,e[35]=i,e[36]=U,e[37]=P,e[38]=b):b=e[38];let h;return e[39]!==C||e[40]!==b?(h=w.jsxs(w.Fragment,{children:[C,b]}),e[39]=C,e[40]=b,e[41]=h):h=e[41],h}function hc(t,e){return w.jsx(T.Skeleton,{height:35},`skeleton-field-${e}`)}function fc(t,e){return t[e.id]=(r,n)=>e.conditional&&!e.conditional(n)||!(typeof e.required=="function"?e.required(n):!!e.required)||r?null:"Pflichtfeld",t}function pc(t){return t.required}function gc(t,e){return t[e.id]=e.type==="boolean"?e.defaultValue??!1:e.defaultValue??"",t}function mc(t){return t.step}function yc(t){return typeof t.step=="number"}function Os({queryKey:t,apiPath:e,onClose:r,selectedRecords:n}){const{mutateAsync:s,isError:u,error:d,isPending:i}=Vo(e,t),[m,v]=G.useState(n),[_,M]=G.useState(!1),S=_||i;return G.useEffect(()=>{m.length||r()},[r,m]),m.length?w.jsxs(w.Fragment,{children:[u&&d.message&&w.jsx(T.Alert,{variant:"outline",color:"red",title:d.name,children:d.message}),w.jsx(T.Text,{children:m.length===1?`Soll ${m.length} Eintrag wirklich gelöscht werden?`:`Sollen ${m.length} Einträge wirklich gelöscht werden?`}),w.jsxs(T.Group,{mt:"md",justify:"end",children:[w.jsx(T.Button,{onClick:r,variant:"outline",disabled:S,children:"Abbrechen"}),w.jsx(T.Button,{color:"red",loading:S,onClick:async()=>{M(!0);try{await Promise.all(m.map(x=>s(x.id))),v([])}finally{M(!1)}},children:"Löschen"})]})]}):w.jsx(w.Fragment,{})}function As(t,e){const r=Qe.c(8);let n;r[0]!==t||r[1]!==e?(n=()=>{const v=localStorage.getItem(`use_persistent_storage_${e}`);return v?JSON.parse(v):t},r[0]=t,r[1]=e,r[2]=n):n=r[2];const[s,u]=G.useState(n);let d;r[3]!==e?(d=v=>{u(v),localStorage.setItem(`use_persistent_storage_${e}`,JSON.stringify(v))},r[3]=e,r[4]=d):d=r[4];const i=d;let m;return r[5]!==i||r[6]!==s?(m=[s,i],r[5]=i,r[6]=s,r[7]=m):m=r[7],m}const vc=(t,e)=>{const r=t.map(m=>m[e]).filter(m=>m!=null&&m!=="");if(r.length===0)return"string";const n=Math.min(100,r.length),s=r.slice(0,n),u={string:0,number:0,date:0},d=[/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/,/^\d{4}-\d{2}-\d{2}$/,/^\d{1,2}\/\d{1,2}\/\d{4}$/,/^\d{1,2}\.\d{1,2}\.\d{4}$/];s.forEach(m=>{if(typeof m=="number")u.number++;else if(typeof m=="string"){const v=m.trim();if(v!==""&&!isNaN(Number(v))&&!isNaN(parseFloat(v))){u.number++;return}if(d.some(_=>_.test(v))){const _=new Date(v);if(!isNaN(_.getTime())){u.date++;return}}u.string++}else m instanceof Date?u.date++:u.string++});const i=u.string+u.number+u.date;return u.date/i>=.6?"date":u.number/i>=.6?"number":u.string/i>=.6?"string":"mixed"},Es=new Map,Ts=(t,e,r="asc")=>{if(!t||t.length===0)return[];const n=`${String(e)}_${t.length}`;let s=Es.get(n);return s||(s=vc(t,e),Es.set(n,s)),[...t].sort((d,i)=>{const m=d[e],v=i[e],_=m==null||m==="",M=v==null||v==="";if(_&&M)return 0;if(_)return r==="asc"?-1:1;if(M)return r==="asc"?1:-1;let S,x;switch(s){case"date":if(typeof m=="string"){const B=new Date(m.trim());S=isNaN(B.getTime())?null:B.getTime()}else m instanceof Date?S=m.getTime():S=null;if(typeof v=="string"){const B=new Date(v.trim());x=isNaN(B.getTime())?null:B.getTime()}else v instanceof Date?x=v.getTime():x=null;break;case"number":if(typeof m=="number")S=m;else{const B=String(m).trim(),Q=parseFloat(B);S=isNaN(Q)?null:Q}if(typeof v=="number")x=v;else{const B=String(v).trim(),Q=parseFloat(B);x=isNaN(Q)?null:Q}break;case"string":const P=typeof m=="string"?m:String(m),A=typeof v=="string"?v:String(v);S=P.toLowerCase().trim(),x=A.toLowerCase().trim();break;case"mixed":default:const N=String(m),F=String(v);S=N.toLowerCase().trim(),x=F.toLowerCase().trim();break}return S===null&&x===null?0:S===null?r==="asc"?1:-1:x===null||S<x?r==="asc"?-1:1:S>x?r==="asc"?1:-1:0})},js=[10,15,50,100,500];function bc(t){const e=Qe.c(114),{title:r,queryKey:n,connectedQueryKeys:s,apiPath:u,mutationApiPath:d,buttons:i,fields:m,selection:v,pagination:_,filters:M,actions:S,steps:x,defaultSort:P,onSortChange:A,createButtonText:N,queryParams:F,tabs:B,defaultTab:Q,activeTab:U,onActiveTabChange:ee,canUpdate:re,canDelete:K,showRefresh:X,rowExpansion:V,onRowClick:q}=t,J=X===void 0?!0:X,[ae,ne]=G.useState(Q||(B&&B.length>0?B[0].value:null)),k=U!==void 0?U:ae;let C;e[0]!==U||e[1]!==ee?(C=Se=>{U===void 0&&ne(Se),ee&&ee(Se)},e[0]=U,e[1]=ee,e[2]=C):C=e[2];const b=C,h=B?.find(Se=>Se.value===k)?.queryParams||{},a={...F,...h},p=a?"?"+Object.entries(a).filter(Ac).map(Oc).join("&"):"";let f;e[3]!==k||e[4]!==n?(f=k?[...n,k]:n,e[3]=k,e[4]=n,e[5]=f):f=e[5];const c=f,{data:y,isLoading:D,isError:j,isRefetching:W,refetch:Z}=Uo(u+p,c),{queryClient:te}=pt();let H,se;e[6]!==y||e[7]!==s||e[8]!==te?(H=()=>{!y||!Array.isArray(y)||s?.forEach(Se=>te.invalidateQueries({queryKey:Se}))},se=[y,s,te],e[6]=y,e[7]=s,e[8]=te,e[9]=H,e[10]=se):(H=e[9],se=e[10]),G.useEffect(H,se);const ie=!y||!Array.isArray(y)?[]:!M||M.length===0?y:y.filter(Se=>M.every(Oe=>{if(Oe.value===void 0)return!0;const nt=Oe.id;if(Oe.type==="query"){const Ne=Se[nt];return Array.isArray(Oe.value)?Array.isArray(Ne)?Ne.some(De=>{if(typeof De=="string"||typeof De=="number")return Oe.value.includes(String(De));if(De&&typeof De=="object"){if("id"in De&&Oe.value.includes(De.id))return!0;for(const ze in De){const Ae=De[ze];if(typeof Ae=="string"&&Oe.value.includes(Ae)||Ae&&typeof Ae=="object"&&"id"in Ae&&Oe.value.includes(Ae.id))return!0}}return!1}):Ne&&typeof Ne=="object"&&"id"in Ne?Oe.value.includes(Ne.id):!1:typeof Ne=="string"&&Ne.includes(Oe.value)}else if(Oe.type==="date"){const Ne=Oe.value;if(!Ne)return!0;const[De,ze]=Ne;if(!De&&!ze)return!0;const Ae=Se[nt];if(typeof Ae=="string"){const ut=Ae.split(" ")[0];if(De&&ze)return ut>=De&&ut<=ze;if(De&&!ze)return ut>=De;if(!De&&ze)return ut<=ze}return!0}else if(Oe.type==="boolean")return Se[nt]===Oe.value;return!0})),ue=P?.field??m[0].id,E=P?.direction??"desc";let L;e[11]!==ue||e[12]!==E?(L={columnAccessor:ue,direction:E},e[11]=ue,e[12]=E,e[13]=L):L=e[13];const[R,Y]=G.useState(L);let I;e[14]!==A?(I=Se=>{Y(Se),A&&A(String(Se.columnAccessor),Se.direction)},e[14]=A,e[15]=I):I=e[15];const de=I,o=Ts(ie,R.columnAccessor,R.direction),[l,g]=As(js[1],"mantine-table-page-size"),[O,$]=G.useState(1),z=_?o.slice((O-1)*l,O*l):o;let le;e[16]===Symbol.for("react.memo_cache_sentinel")?(le=[],e[16]=le):le=e[16];const[ce,fe]=G.useState(le);let oe;e[17]===Symbol.for("react.memo_cache_sentinel")?(oe=()=>{fe([])},e[17]=oe):oe=e[17];let pe;e[18]!==k?(pe=[k],e[18]=k,e[19]=pe):pe=e[19],G.useEffect(oe,pe);const[me,ge]=G.useState(!1),[xe,Ce]=G.useState(!1),[ke,qe]=G.useState(!1),$e=r?"space-between":"end";let _e;e[20]!==r?(_e=r&&(typeof r=="string"?w.jsx(T.Title,{order:4,children:r}):r),e[20]=r,e[21]=_e):_e=e[21];let ot;e[22]!==Z||e[23]!==J?(ot=J&&w.jsx(T.ActionIcon,{variant:"subtle",onClick:()=>Z(),"aria-label":"Neuladen",children:w.jsx(jt.IconRefresh,{})}),e[22]=Z,e[23]=J,e[24]=ot):ot=e[24];let Te;e[25]!==S||e[26]!==K||e[27]!==re||e[28]!==m||e[29]!==ce||e[30]!==v?(Te=(m.some(Mc)||v)&&(()=>{const Se=m.find(Pc)&&(!re||ce.length>0&&re(ce[0])),Oe=m.find(kc)&&(!K||ce.length>0&&K(ce[0])),nt=(S??[]).length>0,Ne=Se||Oe||nt;return w.jsxs(T.Menu,{shadow:"md",children:[w.jsx(T.Menu.Target,{children:w.jsx(T.Button,{variant:"outline",rightSection:w.jsx(jt.IconCaretDownFilled,{size:14}),disabled:!ce.length||!Ne,children:"Aktionen"})}),w.jsxs(T.Menu.Dropdown,{children:[Se&&w.jsx(T.Menu.Item,{leftSection:w.jsx(jt.IconPencil,{size:14}),onClick:()=>Ce(!0),disabled:ce.length!==1,children:"Bearbeiten"}),(S??[]).map((De,ze)=>G.createElement(T.Menu.Item,{...De.icon&&{leftSection:De.icon},key:`custom_action_${ze}`,onClick:()=>De.onClick(ce)},De.label)),Oe&&w.jsx(T.Menu.Item,{leftSection:w.jsx(jt.IconTrash,{size:14}),onClick:()=>qe(!0),color:"red",children:"Löschen"})]})]})})(),e[25]=S,e[26]=K,e[27]=re,e[28]=m,e[29]=ce,e[30]=v,e[31]=Te):Te=e[31];let Ve;e[32]!==N||e[33]!==m||e[34]!==D?(Ve=m.find(Dc)&&w.jsx(T.Button,{onClick:()=>ge(!0),disabled:D,children:N??"Erstellen"}),e[32]=N,e[33]=m,e[34]=D,e[35]=Ve):Ve=e[35];let Ye;e[36]!==i||e[37]!==ot||e[38]!==Te||e[39]!==Ve?(Ye=w.jsxs(T.Group,{align:"center",gap:"xs",children:[ot,Te,Ve,i]}),e[36]=i,e[37]=ot,e[38]=Te,e[39]=Ve,e[40]=Ye):Ye=e[40];let Xe;e[41]!==$e||e[42]!==_e||e[43]!==Ye?(Xe=w.jsxs(T.Group,{gap:"xs",justify:$e,align:"center",children:[_e,Ye]}),e[41]=$e,e[42]=_e,e[43]=Ye,e[44]=Xe):Xe=e[44];let st;e[45]!==k||e[46]!==b||e[47]!==B?(st=B&&B.length>0&&w.jsx(T.Tabs,{value:k,onChange:b,mt:"md",children:w.jsx(T.Tabs.List,{children:B.map(Sc)})}),e[45]=k,e[46]=b,e[47]=B,e[48]=st):st=e[48];let je;e[49]!==j?(je=j&&w.jsx(T.Alert,{mt:"md",variant:"light",color:"red",title:"Es ist ein Fehler aufgetreten.",icon:w.jsx(jt.IconInfoCircle,{}),children:"Bitte versuche es später erneut oder sende eine Nachricht an unseren Support."}),e[49]=j,e[50]=je):je=e[50];let it;e[51]!==D||e[52]!==W?(it=(D||W)&&w.jsxs(T.Stack,{my:"md",children:[w.jsx(T.Skeleton,{height:40}),Array(5).fill(0).map(xc)]}),e[51]=D,e[52]=W,e[53]=it):it=e[53];let at;e[54]!==m||e[55]!==de||e[56]!==j||e[57]!==D||e[58]!==W||e[59]!==q||e[60]!==O||e[61]!==l||e[62]!==_||e[63]!==z||e[64]!==V||e[65]!==ce||e[66]!==v||e[67]!==$||e[68]!==g||e[69]!==R||e[70]!==o?(at=!D&&!W&&w.jsx(dc,{my:"md",striped:!0,highlightOnHover:!0,minHeight:150,fetching:j,records:z,sortStatus:R,onSortStatusChange:de,...v&&{selectedRecords:ce,onSelectedRecordsChange:fe},..._&&z.length&&{totalRecords:o.length,recordsPerPage:l,onPageChange:$,page:O,recordsPerPageOptions:js,onRecordsPerPageChange:g,recordsPerPageLabel:"Einträge pro Seite"},...V&&{rowExpansion:{allowMultiple:V.allowMultiple??!1,content:Se=>{const{record:Oe}=Se;return V.content(Oe)},...V.expanded&&{expanded:V.expanded}}},columns:m.map(Cc),noRecordsText:"Keine Einträge gefunden",onRowClick:q,...q&&{style:{cursor:"pointer"}}}),e[54]=m,e[55]=de,e[56]=j,e[57]=D,e[58]=W,e[59]=q,e[60]=O,e[61]=l,e[62]=_,e[63]=z,e[64]=V,e[65]=ce,e[66]=v,e[67]=$,e[68]=g,e[69]=R,e[70]=o,e[71]=at):at=e[71];let lt;e[72]===Symbol.for("react.memo_cache_sentinel")?(lt=()=>{Ce(!1),fe([])},e[72]=lt):lt=e[72];const dt=r??"Bearbeiten";let He;e[73]!==u||e[74]!==m||e[75]!==d||e[76]!==n||e[77]!==ce[0]||e[78]!==ce.length||e[79]!==x?(He=ce.length>0&&w.jsx(Ms,{fields:m.filter(_c),queryKey:n,apiPath:d??u,id:ce[0].id,onClose:()=>{Ce(!1),fe([])},steps:x}),e[73]=u,e[74]=m,e[75]=d,e[76]=n,e[77]=ce[0],e[78]=ce.length,e[79]=x,e[80]=He):He=e[80];let Ge;e[81]!==dt||e[82]!==He||e[83]!==xe?(Ge=w.jsx(T.Modal,{opened:xe,onClose:lt,title:dt,children:He}),e[81]=dt,e[82]=He,e[83]=xe,e[84]=Ge):Ge=e[84];let et;e[85]!==u||e[86]!==ke||e[87]!==d||e[88]!==n||e[89]!==ce||e[90]!==r?(et=ce.length>0&&w.jsx(T.Modal,{opened:ke,onClose:()=>{qe(!1),fe([])},title:r??"Löschen",children:w.jsx(Os,{onClose:()=>{qe(!1),fe([])},queryKey:n,apiPath:d??u,selectedRecords:ce})}),e[85]=u,e[86]=ke,e[87]=d,e[88]=n,e[89]=ce,e[90]=r,e[91]=et):et=e[91];let vt;e[92]===Symbol.for("react.memo_cache_sentinel")?(vt=()=>{ge(!1)},e[92]=vt):vt=e[92];const ve=r??"Anlegen",Me=d??u;let tt;e[93]===Symbol.for("react.memo_cache_sentinel")?(tt=()=>{ge(!1)},e[93]=tt):tt=e[93];let rt;e[94]!==m?(rt=m.filter(wc),e[94]=m,e[95]=rt):rt=e[95];let bt;e[96]!==n||e[97]!==x||e[98]!==Me||e[99]!==rt?(bt=w.jsx(ps,{queryKey:n,apiPath:Me,onClose:tt,fields:rt,steps:x}),e[96]=n,e[97]=x,e[98]=Me,e[99]=rt,e[100]=bt):bt=e[100];let wt;e[101]!==me||e[102]!==ve||e[103]!==bt?(wt=w.jsx(T.Modal,{opened:me,onClose:vt,title:ve,children:bt}),e[101]=me,e[102]=ve,e[103]=bt,e[104]=wt):wt=e[104];let At;return e[105]!==Xe||e[106]!==st||e[107]!==je||e[108]!==it||e[109]!==at||e[110]!==Ge||e[111]!==et||e[112]!==wt?(At=w.jsxs(w.Fragment,{children:[Xe,st,je,it,at,Ge,et,wt]}),e[105]=Xe,e[106]=st,e[107]=je,e[108]=it,e[109]=at,e[110]=Ge,e[111]=et,e[112]=wt,e[113]=At):At=e[113],At}function wc(t){return t.create}function _c(t){return t.update}function Cc(t){return t.column}function xc(t,e){return w.jsx(T.Skeleton,{height:35},`skeleton-${e}`)}function Sc(t){return w.jsx(T.Tabs.Tab,{value:t.value,leftSection:t.icon,children:t.label},t.value)}function Dc(t){return t.create}function kc(t){return t.delete}function Pc(t){return t.update}function Mc(t){return t.update}function Oc(t){const[e,r]=t;return`${e}=${encodeURIComponent(r??"")}`}function Ac(t){const[,e]=t;return e!=null}function Ec(t){const e=Qe.c(5),{queryClient:r}=pt();let n;e[0]!==t?(n=w.jsx(bc,{...t}),e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==r||e[3]!==n?(s=w.jsx(Gn,{client:r,children:n}),e[2]=r,e[3]=n,e[4]=s):s=e[4],s}we.CreateModal=ps,we.DataTable=Ec,we.DataTableProvider=pl,we.DeleteModal=Os,we.UpdateModal=Ms,we.api=ml,we.createOne=zo,we.deleteOne=Yo,we.getAll=Bo,we.getApiHeaders=Ct,we.getOne=Io,we.sortData=Ts,we.updateOne=Fo,we.useAddOne=qo,we.useDataTable=pt,we.useDeleteOne=Vo,we.useGetAll=Uo,we.useGetOne=Wo,we.usePersistentState=As,we.useUpdateOne=sn,Object.defineProperty(we,Symbol.toStringTag,{value:"Module"})}));
|
|
24
24
|
//# sourceMappingURL=index.umd.js.map
|