@espresso-lab/mantine-data-table 1.9.41 → 1.9.43
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 +6 -1
- package/dist/Hooks/useApi.d.ts +1 -1
- package/dist/index.es.js +2570 -2565
- 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,Q){typeof exports=="object"&&typeof module<"u"?Q(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"],Q):(we=typeof globalThis<"u"?globalThis:we||self,Q(we.MantineDataTable={},we.React,we.MantineCore,we.MantineForm,we.TablerIconsReact,we.MantineHooks))})(this,(function(we,Q,T,On,Tt,Ne){"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 $e=Bs(Q);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=Q.__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=Q.__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)}})()),Tr}var jn;function zs(){return jn||(jn=1,process.env.NODE_ENV==="production"?Gt.exports=Is():Gt.exports=Ys()),Gt.exports}var Ze=zs(),Qt=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)}},Zt=new Ws;function Us(t){setTimeout(t,0)}var Tt=typeof window>"u"||"Deno"in globalThis;function Kt(){}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 jt(t,e){return typeof t=="function"?t(e):t}function Ke(t,e){return typeof t=="function"?t(e):t}function Rn(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 jr(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),h=u.length,a=r?new Array(h):{};let g=0;for(let y=0;y<h;y++){const _=r?y:u[y],P=t[_],x=e[_];if(P===x){a[_]=P,(r?y<s:Vs.call(t,_))&&g++;continue}if(P===null||x===null||typeof P!="object"||typeof x!="object"){a[_]=x;continue}const S=jr(P,x);a[_]=S,S===P&&g++}return s===h&&g===s?t:a}function Jt(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 jr(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 jr(t,e)}return e}function In(t,e){return typeof t=="function"?t(...e):!!t}var Hs=class extends Qt{#t;#e;#r;constructor(){super(),this.#r=t=>{if(!Tt&&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=a=>{a()},n=a=>{a()},s=Qs;const u=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)=>{u(()=>{a(...g)})},schedule:u,setNotifyFunction:a=>{r=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{s=a}}}var Xt=Zs(),Ks=class extends Qt{#t=!0;#e;#r;constructor(){super(),this.#r=t=>{if(!Tt&&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 Qt{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 Rr(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Rr(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 Ke(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&&!Jt(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||Ke(this.options.enabled,this.#e)!==Ke(e.enabled,this.#e)||jt(this.options.staleTime,this.#e)!==jt(e.staleTime,this.#e))&&this.#m();const s=this.#y();n&&(this.#e!==r||Ke(this.options.enabled,this.#e)!==Ke(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(Kt)),e}#m(){this.#w();const t=jt(this.options.staleTime,this.#e);if(Tt||this.#n.isStale||!$n(t))return;const r=qs(this.#n.dataUpdatedAt,t)+1;this.#u=Zt.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,!(Tt||Ke(this.options.enabled,this.#e)===!1||!$n(this.#l)||this.#l===0)&&(this.#c=Zt.setInterval(()=>{(this.options.refetchIntervalInBackground||Gs.isFocused())&&this.#d()},this.#l))}#b(){this.#m(),this.#v(this.#y())}#w(){this.#u&&(Zt.clearTimeout(this.#u),this.#u=void 0)}#_(){this.#c&&(Zt.clearInterval(this.#c),this.#c=void 0)}createResult(t,e){const r=this.#e,n=this.options,s=this.#n,u=this.#o,h=this.#s,g=t!==r?t.state:this.#r,{state:y}=t;let _={...y},P=!1,x;if(e._optimisticResults){const V=this.hasListeners(),H=!V&&zn(t,e),K=V&&Fn(t,r,e,n);(H||K)&&(_={..._,...ei(y.data,t.options)}),e._optimisticResults==="isRestoring"&&(_.fetchStatus="idle")}let{error:S,errorUpdatedAt:D,status:O}=_;x=_.data;let N=!1;if(e.placeholderData!==void 0&&x===void 0&&O==="pending"){let V;s?.isPlaceholderData&&e.placeholderData===h?.placeholderData?(V=s.data,N=!0):V=typeof e.placeholderData=="function"?e.placeholderData(this.#f?.state.data,this.#f):e.placeholderData,V!==void 0&&(O="success",x=Bn(s?.data,V,e),P=!0)}if(e.select&&x!==void 0&&!N)if(s&&x===u?.data&&e.select===this.#g)x=this.#h;else try{this.#g=e.select,x=e.select(x),x=Bn(s?.data,x,e),this.#h=x,this.#a=null}catch(V){this.#a=V}this.#a&&(S=this.#a,x=this.#h,D=Date.now(),O="error");const z=_.fetchStatus==="fetching",F=O==="pending",q=O==="error",U=F&&z,ee=x!==void 0,X={status:O,fetchStatus:_.fetchStatus,isPending:F,isSuccess:O==="success",isError:q,isInitialLoading:U,isLoading:U,data:x,dataUpdatedAt:_.dataUpdatedAt,error:S,errorUpdatedAt:D,failureCount:_.fetchFailureCount,failureReason:_.fetchFailureReason,errorUpdateCount:_.errorUpdateCount,isFetched:_.dataUpdateCount>0||_.errorUpdateCount>0,isFetchedAfterMount:_.dataUpdateCount>g.dataUpdateCount||_.errorUpdateCount>g.errorUpdateCount,isFetching:z,isRefetching:z&&!F,isLoadingError:q&&!ee,isPaused:_.fetchStatus==="paused",isPlaceholderData:P,isRefetchError:q&&ee,isStale:Nr(t,e),refetch:this.refetch,promise:this.#i,isEnabled:Ke(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const V=W=>{X.status==="error"?W.reject(X.error):X.data!==void 0&&W.resolve(X.data)},H=()=>{const W=this.#i=X.promise=Yn();V(W)},K=this.#i;switch(K.status){case"pending":t.queryHash===r.queryHash&&V(K);break;case"fulfilled":(X.status==="error"||X.data!==K.value)&&H();break;case"rejected":(X.status!=="error"||X.error!==K.reason)&&H();break}}return X}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),Jt(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(h=>{const a=h;return this.#n[a]!==t[a]&&u.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){Xt.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#n)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function ri(t,e){return Ke(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&&Rr(t,e,e.refetchOnMount)}function Rr(t,e,r){if(Ke(e.enabled,t)!==!1&&jt(e.staleTime,t)!=="static"){const n=typeof r=="function"?r(t):r;return n==="always"||n!==!1&&Nr(t,e)}return!1}function Fn(t,e,r,n){return(t!==e||Ke(n.enabled,t)===!1)&&(!r.suspense||t.state.status!=="error")&&Nr(t,r)}function Nr(t,e){return Ke(e.enabled,t)!==!1&&t.isStaleByTime(jt(e.staleTime,t))}function ni(t,e){return!Jt(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 Qt{#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),Jt(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){Xt.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)})})}},er={exports:{}},$t={};var Wn;function ii(){if(Wn)return $t;Wn=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(n,s,u){var h=null;if(u!==void 0&&(h=""+u),s.key!==void 0&&(h=""+s.key),"key"in s){u={};for(var a in s)a!=="key"&&(u[a]=s[a])}else u=s;return s=u.ref,{$$typeof:t,type:n,key:h,ref:s!==void 0?s:null,props:u}}return $t.Fragment=e,$t.jsx=r,$t.jsxs=r,$t}var Rt={};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 F:return"Profiler";case z:return"StrictMode";case re:return"Suspense";case X:return"SuspenseList";case K: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 q: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 V:return v=i.displayName||null,v!==null?v:t(i.type)||"Memo";case H: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===H)return"<...>";try{var v=t(i);return v?"<"+v+">":"<...>"}catch{return"<...>"}}function s(){var i=oe.A;return i===null?null:i.getOwner()}function u(){return Error("react-stack-top-frame")}function h(i){if(se.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 c[i]||(c[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,Q,J){var te=E.ref;return i={$$typeof:D,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:Q}),Object.defineProperty(i,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:J}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i}function _(i,v,E,j,Q,J){var te=v.children;if(te!==void 0)if(j)if(k(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(se.call(v,"key")){te=t(i);var Z=Object.keys(v).filter(function(ie){return ie!=="key"});j=0<Z.length?"{key: someKey, "+Z.join(": ..., ")+": ...}":"{key: someKey}",f[te+j]||(Z=0<Z.length?"{"+Z.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 Ke=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 jt=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 $t(t,e){return typeof t=="function"?t(e):t}function Je(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[_],x=e[_];if(P===x){a[_]=P,(r?y<s:Vs.call(t,_))&&g++;continue}if(P===null||x===null||typeof P!="object"||typeof x!="object"){a[_]=x;continue}const S=$r(P,x);a[_]=S,S===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(!jt&&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(!jt&&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 Je(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||Je(this.options.enabled,this.#e)!==Je(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||Je(this.options.enabled,this.#e)!==Je(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(jt||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,!(jt||Je(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,x;if(e._optimisticResults){const H=this.hasListeners(),V=!H&&zn(t,e),Z=H&&Fn(t,r,e,n);(V||Z)&&(_={..._,...ei(y.data,t.options)}),e._optimisticResults==="isRestoring"&&(_.fetchStatus="idle")}let{error:S,errorUpdatedAt:k,status:M}=_;x=_.data;let L=!1;if(e.placeholderData!==void 0&&x===void 0&&M==="pending"){let H;s?.isPlaceholderData&&e.placeholderData===h?.placeholderData?(H=s.data,L=!0):H=typeof e.placeholderData=="function"?e.placeholderData(this.#f?.state.data,this.#f):e.placeholderData,H!==void 0&&(M="success",x=Bn(s?.data,H,e),P=!0)}if(e.select&&x!==void 0&&!L)if(s&&x===c?.data&&e.select===this.#g)x=this.#h;else try{this.#g=e.select,x=e.select(x),x=Bn(s?.data,x,e),this.#h=x,this.#a=null}catch(H){this.#a=H}this.#a&&(S=this.#a,x=this.#h,k=Date.now(),M="error");const I=_.fetchStatus==="fetching",z=M==="pending",q=M==="error",U=z&&I,ee=x!==void 0,X={status:M,fetchStatus:_.fetchStatus,isPending:z,isSuccess:M==="success",isError:q,isInitialLoading:U,isLoading:U,data:x,dataUpdatedAt:_.dataUpdatedAt,error:S,errorUpdatedAt:k,failureCount:_.fetchFailureCount,failureReason:_.fetchFailureReason,errorUpdateCount:_.errorUpdateCount,isFetched:_.dataUpdateCount>0||_.errorUpdateCount>0,isFetchedAfterMount:_.dataUpdateCount>g.dataUpdateCount||_.errorUpdateCount>g.errorUpdateCount,isFetching:I,isRefetching:I&&!z,isLoadingError:q&&!ee,isPaused:_.fetchStatus==="paused",isPlaceholderData:P,isRefetchError:q&&ee,isStale:Lr(t,e),refetch:this.refetch,promise:this.#i,isEnabled:Je(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const H=W=>{X.status==="error"?W.reject(X.error):X.data!==void 0&&W.resolve(X.data)},V=()=>{const W=this.#i=X.promise=Yn();H(W)},Z=this.#i;switch(Z.status){case"pending":t.queryHash===r.queryHash&&H(Z);break;case"fulfilled":(X.status==="error"||X.data!==Z.value)&&V();break;case"rejected":(X.status!=="error"||X.error!==Z.reason)&&V();break}}return X}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 Je(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(Je(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||Je(n.enabled,t)===!1)&&(!r.suspense||t.state.status!=="error")&&Lr(t,r)}function Lr(t,e){return Je(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&&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:{}},Rt={};var Wn;function ii(){if(Wn)return Rt;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 Rt.Fragment=e,Rt.jsx=r,Rt.jsxs=r,Rt}var Nt={};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 L:return"Fragment";case z:return"Profiler";case I:return"StrictMode";case re:return"Suspense";case X:return"SuspenseList";case Z: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 M:return"Portal";case U:return i.displayName||"Context";case q: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 H:return v=i.displayName||null,v!==null?v:t(i.type)||"Memo";case V: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===L)return"<>";if(typeof i=="object"&&i!==null&&i.$$typeof===V)return"<...>";try{var v=t(i);return v?"<"+v+">":"<...>"}catch{return"<...>"}}function s(){var i=le.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,K,J){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:K}),Object.defineProperty(i,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:J}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i}function _(i,v,E,j,K,J){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 G=Object.keys(v).filter(function(ie){return ie!=="key"});j=0<G.length?"{key: someKey, "+G.join(": ..., ")+": ...}":"{key: someKey}",f[te+j]||(G=0<G.length?"{"+G.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,G,te),f[te+j]=!0)}if(te=null,E!==void 0&&(r(E),te=""+E),h(v)&&(r(v.key),te=""+v.key),"key"in v){E={};for(var ae in v)ae!=="key"&&(E[ae]=v[ae])}else E=v;return te&&a(E,typeof i=="function"?i.displayName||i.name||"Unknown":i),y(i,te,E,s(),K,J)}function P(i){x(i)?i._store&&(i._store.validated=1):typeof i=="object"&&i!==null&&i.$$typeof===V&&(i._payload.status==="fulfilled"?x(i._payload.value)&&i._payload.value._store&&(i._payload.value._store.validated=1):i._store&&(i._store.validated=1))}function x(i){return typeof i=="object"&&i!==null&&i.$$typeof===k}var S=Q,k=Symbol.for("react.transitional.element"),M=Symbol.for("react.portal"),L=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),z=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"),X=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),W=Symbol.for("react.client.reference"),le=S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe=Object.prototype.hasOwnProperty,D=Array.isArray,C=console.createTask?console.createTask:function(){return null};S={react_stack_bottom_frame:function(i){return i()}};var b,u={},d=S.react_stack_bottom_frame.bind(S,c)(),m=C(n(c)),f={};Nt.Fragment=L,Nt.jsx=function(i,v,E){var j=1e4>le.recentlyCreatedOwnerStacks++;return _(i,v,E,!1,j?Error("react-stack-top-frame"):d,j?C(n(i)):m)},Nt.jsxs=function(i,v,E){var j=1e4>le.recentlyCreatedOwnerStacks++;return _(i,v,E,!0,j?Error("react-stack-top-frame"):d,j?C(n(i)):m)}})()),Nt}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=$e.createContext(void 0),Hn=t=>{const e=$e.useContext(Vn);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Gn=({client:t,children:e})=>($e.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),w.jsx(Vn.Provider,{value:t,children:e})),Qn=$e.createContext(!1),ui=()=>$e.useContext(Qn);Qn.Provider;function ci(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var di=$e.createContext(ci()),hi=()=>$e.useContext(di),fi=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},pi=t=>{$e.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(),c=Hn(),h=c.defaultQueryOptions(t);c.getDefaultOptions().queries?._experimental_beforeQuery?.(h),process.env.NODE_ENV!=="production"&&(h.queryFn||console.error(`[${h.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`)),h._optimisticResults=n?"isRestoring":"optimistic",mi(h),fi(h,s),pi(s);const a=!c.getQueryCache().get(h.queryHash),[g]=$e.useState(()=>new e(c,h)),y=g.getOptimisticResult(h),_=!n&&t.subscribed!==!1;if($e.useSyncExternalStore($e.useCallback(P=>{const x=_?g.subscribe(er.batchCalls(P)):Jt;return g.updateResult(),x},[g,_]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),$e.useEffect(()=>{g.setOptions(h)},[h,g]),vi(h,y))throw Zn(h,g,s);if(gi({result:y,errorResetBoundary:s,throwOnError:h.throwOnError,query:c.getQueryCache().get(h.queryHash),suspense:h.suspense}))throw y.error;return c.getDefaultOptions().queries?._experimental_afterQuery?.(h,y),h.experimental_prefetchInRender&&!jt&&yi(y,n)&&(a?Zn(h,g,s):c.getQueryCache().get(h.queryHash)?.promise)?.catch(Jt).finally(()=>{g.updateResult()}),h.notifyOnChangeProps?y:g.trackResult(y)}function Kn(t,e){return bi(t,ti)}function Br(t,e){const r=Hn(),[n]=$e.useState(()=>new si(r,t));$e.useEffect(()=>{n.setOptions(t)},[n,t]);const s=$e.useSyncExternalStore($e.useCallback(h=>n.subscribe(er.batchCalls(h)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),c=$e.useCallback((h,a)=>{n.mutate(h,a).catch(Jt)},[n]);if(s.error&&In(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:c,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:{}},Lt={};var Xn;function wi(){if(Xn)return Lt;Xn=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 Lt.Fragment=e,Lt.jsx=r,Lt.jsxs=r,Lt}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===Z?null:f.displayName||f.name||null;if(typeof f=="string")return f;switch(f){case M:return"Fragment";case I:return"Profiler";case L: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 k:return"Portal";case q:return(f.displayName||"Context")+".Provider";case z:return(f._context.displayName||"Context")+".Consumer";case U:var i=f.render;return f=f.displayName,f||(f=i.displayName||i.name||"",f=f!==""?"ForwardRef("+f+")":"ForwardRef"),f;case X:return i=f.displayName||null,i!==null?i:t(f.type)||"Memo";case H:i=f._payload,f=f._init;try{return t(f(i))}catch{}}return null}function e(f){return""+f}function r(f){try{e(f);var i=!1}catch{i=!0}if(i){i=console;var v=i.error,E=typeof Symbol=="function"&&Symbol.toStringTag&&f[Symbol.toStringTag]||f.constructor.name||"Object";return v.call(i,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",E),e(f)}}function n(f){if(f===M)return"<>";if(typeof f=="object"&&f!==null&&f.$$typeof===H)return"<...>";try{var i=t(f);return i?"<"+i+">":"<...>"}catch{return"<...>"}}function s(){var f=W.A;return f===null?null:f.getOwner()}function c(){return Error("react-stack-top-frame")}function h(f){if(le.call(f,"key")){var i=Object.getOwnPropertyDescriptor(f,"key").get;if(i&&i.isReactWarning)return!1}return f.key!==void 0}function a(f,i){function v(){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)",i))}v.isReactWarning=!0,Object.defineProperty(f,"key",{get:v,configurable:!0})}function g(){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 y(f,i,v,E,j,K,J,te){return v=K.ref,f={$$typeof:S,type:f,key:i,props:K,_owner:j},(v!==void 0?v:null)!==null?Object.defineProperty(f,"ref",{enumerable:!1,get:g}):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:J}),Object.defineProperty(f,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:te}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f}function _(f,i,v,E,j,K,J,te){var G=i.children;if(G!==void 0)if(E)if(oe(G)){for(E=0;E<G.length;E++)P(G[E]);Object.freeze&&Object.freeze(G)}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(G);if(le.call(i,"key")){G=t(f);var ae=Object.keys(i).filter(function(ue){return ue!=="key"});E=0<ae.length?"{key: someKey, "+ae.join(": ..., ")+": ...}":"{key: someKey}",m[G+E]||(ae=0<ae.length?"{"+ae.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} />`,E,
|
|
15
|
+
<%s key={someKey} {...props} />`,E,G,ae,G),m[G+E]=!0)}if(G=null,v!==void 0&&(r(v),G=""+v),h(i)&&(r(i.key),G=""+i.key),"key"in i){v={};for(var ie in i)ie!=="key"&&(v[ie]=i[ie])}else v=i;return G&&a(v,typeof f=="function"?f.displayName||f.name||"Unknown":f),y(f,G,K,j,s(),v,J,te)}function P(f){typeof f=="object"&&f!==null&&f.$$typeof===S&&f._store&&(f._store.validated=1)}var x=Q,S=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),L=Symbol.for("react.strict_mode"),I=Symbol.for("react.profiler"),z=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"),X=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),Z=Symbol.for("react.client.reference"),W=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le=Object.prototype.hasOwnProperty,oe=Array.isArray,D=console.createTask?console.createTask:function(){return null};x={react_stack_bottom_frame:function(f){return f()}};var C,b={},u=x.react_stack_bottom_frame.bind(x,c)(),d=D(n(c)),m={};rr.Fragment=M,rr.jsx=function(f,i,v,E,j){var K=1e4>W.recentlyCreatedOwnerStacks++;return _(f,i,v,!1,E,j,K?Error("react-stack-top-frame"):u,K?D(n(f)):d)},rr.jsxs=function(f,i,v,E,j){var K=1e4>W.recentlyCreatedOwnerStacks++;return _(f,i,v,!0,E,j,K?Error("react-stack-top-frame"):u,K?D(n(f)):d)}})()),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=Q.__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=Q.__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"?Yr.exports=xi():Yr.exports=Si()),Yr.exports}Di();var io={},Lt={},ao;function ki(){if(ao)return Lt;ao=1,Lt.byteLength=a,Lt.toByteArray=y,Lt.fromByteArray=x;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 h(S){var D=S.length;if(D%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var O=S.indexOf("=");O===-1&&(O=D);var N=O===D?0:4-O%4;return[O,N]}function a(S){var D=h(S),O=D[0],N=D[1];return(O+N)*3/4-N}function g(S,D,O){return(D+O)*3/4-O}function y(S){var D,O=h(S),N=O[0],z=O[1],F=new r(g(S,N,z)),q=0,U=z>0?N-4:N,ee;for(ee=0;ee<U;ee+=4)D=e[S.charCodeAt(ee)]<<18|e[S.charCodeAt(ee+1)]<<12|e[S.charCodeAt(ee+2)]<<6|e[S.charCodeAt(ee+3)],F[q++]=D>>16&255,F[q++]=D>>8&255,F[q++]=D&255;return z===2&&(D=e[S.charCodeAt(ee)]<<2|e[S.charCodeAt(ee+1)]>>4,F[q++]=D&255),z===1&&(D=e[S.charCodeAt(ee)]<<10|e[S.charCodeAt(ee+1)]<<4|e[S.charCodeAt(ee+2)]>>2,F[q++]=D>>8&255,F[q++]=D&255),F}function _(S){return t[S>>18&63]+t[S>>12&63]+t[S>>6&63]+t[S&63]}function P(S,D,O){for(var N,z=[],F=D;F<O;F+=3)N=(S[F]<<16&16711680)+(S[F+1]<<8&65280)+(S[F+2]&255),z.push(_(N));return z.join("")}function x(S){for(var D,O=S.length,N=O%3,z=[],F=16383,q=0,U=O-N;q<U;q+=F)z.push(P(S,q,q+F>U?U:q+F));return N===1?(D=S[O-1],z.push(t[D>>2]+t[D<<4&63]+"==")):N===2&&(D=(S[O-2]<<8)+S[O-1],z.push(t[D>>10]+t[D>>4&63]+t[D<<2&63]+"=")),z.join("")}return Lt}var Fr={};var lo;function Pi(){return lo||(lo=1,Fr.read=function(t,e,r,n,s){var u,h,a=s*8-n-1,g=(1<<a)-1,y=g>>1,_=-7,P=r?s-1:0,x=r?-1:1,S=t[e+P];for(P+=x,u=S&(1<<-_)-1,S>>=-_,_+=a;_>0;u=u*256+t[e+P],P+=x,_-=8);for(h=u&(1<<-_)-1,u>>=-_,_+=n;_>0;h=h*256+t[e+P],P+=x,_-=8);if(u===0)u=1-y;else{if(u===g)return h?NaN:(S?-1:1)*(1/0);h=h+Math.pow(2,n),u=u-y}return(S?-1:1)*h*Math.pow(2,u-n)},Fr.write=function(t,e,r,n,s,u){var h,a,g,y=u*8-s-1,_=(1<<y)-1,P=_>>1,x=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=n?0:u-1,D=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+=x/g:e+=x*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+S]=a&255,S+=D,a/=256,s-=8);for(h=h<<s|a,y+=s;y>0;t[r+S]=h&255,S+=D,h/=256,y-=8);t[r+S-D]|=O*128}),Fr}var Wr,uo;function Mi(){if(uo)return Wr;uo=1;var t={}.toString;return Wr=Array.isArray||function(e){return t.call(e)=="[object Array]"},Wr}var co;function Oi(){return co||(co=1,(function(t){var e=ki(),r=Pi(),n=Mi();t.Buffer=a,t.SlowBuffer=z,t.INSPECT_MAX_BYTES=50,a.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 a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function h(o,l){if(u()<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?D(o,l,p,M):typeof l=="string"?x(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 x(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=F(l,p)|0;o=h(o,M);var R=o.write(l,p);return R!==M&&(o=o.slice(0,R)),o}function S(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 D(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=S(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"||ce(l.length)?h(o,0):S(o,l);if(l.type==="Buffer"&&n(l.data))return S(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 z(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,B=Math.min(p,M);R<B;++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 B=o[p];if(!a.isBuffer(B))throw new TypeError('"list" argument must be an Array of Buffers');B.copy(M,R),R+=B.length}return M};function F(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 I(o).length;default:if(M)return A(o).length;l=(""+l).toLowerCase(),M=!0}}a.byteLength=F;function q(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 k(this,l,p);case"ascii":return c(this,l,p);case"latin1":case"binary":return d(this,l,p);case"base64":return se(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?k(this,0,o):q.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 B=R-M,le=p-l,he=Math.min(B,le),pe=this.slice(M,R),ne=o.slice(l,p),fe=0;fe<he;++fe)if(pe[fe]!==ne[fe]){B=pe[fe],le=ne[fe];break}return B<le?-1:le<B?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 B=1,le=o.length,he=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;B=2,le/=2,he/=2,p/=2}function pe(xe,Ce){return B===1?xe[Ce]:xe.readUInt16BE(Ce*B)}var ne;if(R){var fe=-1;for(ne=p;ne<le;ne++)if(pe(o,ne)===pe(l,fe===-1?0:ne-fe)){if(fe===-1&&(fe=ne),ne-fe+1===he)return fe*B}else fe!==-1&&(ne-=ne-fe),fe=-1}else for(p+he>le&&(p=le-he),ne=p;ne>=0;ne--){for(var me=!0,ge=0;ge<he;ge++)if(pe(o,ne+ge)!==pe(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 X(o,l,p,M){p=Number(p)||0;var R=o.length-p;M?(M=Number(M),M>R&&(M=R)):M=R;var B=l.length;if(B%2!==0)throw new TypeError("Invalid hex string");M>B/2&&(M=B/2);for(var le=0;le<M;++le){var he=parseInt(l.substr(le*2,2),16);if(isNaN(he))return le;o[p+le]=he}return le}function V(o,l,p,M){return Y(A(l,o.length-p),o,p,M)}function H(o,l,p,M){return Y(L(l),o,p,M)}function K(o,l,p,M){return H(o,l,p,M)}function W(o,l,p,M){return Y(I(l),o,p,M)}function oe(o,l,p,M){return Y($(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 B=!1;;)switch(M){case"hex":return X(this,o,l,p);case"utf8":case"utf-8":return V(this,o,l,p);case"ascii":return H(this,o,l,p);case"latin1":case"binary":return K(this,o,l,p);case"base64":return W(this,o,l,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return oe(this,o,l,p);default:if(B)throw new TypeError("Unknown encoding: "+M);M=(""+M).toLowerCase(),B=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function se(o,l,p){return l===0&&p===o.length?e.fromByteArray(o):e.fromByteArray(o.slice(l,p))}function k(o,l,p){p=Math.min(o.length,p);for(var M=[],R=l;R<p;){var B=o[R],le=null,he=B>239?4:B>223?3:B>191?2:1;if(R+he<=p){var pe,ne,fe,me;switch(he){case 1:B<128&&(le=B);break;case 2:pe=o[R+1],(pe&192)===128&&(me=(B&31)<<6|pe&63,me>127&&(le=me));break;case 3:pe=o[R+1],ne=o[R+2],(pe&192)===128&&(ne&192)===128&&(me=(B&15)<<12|(pe&63)<<6|ne&63,me>2047&&(me<55296||me>57343)&&(le=me));break;case 4:pe=o[R+1],ne=o[R+2],fe=o[R+3],(pe&192)===128&&(ne&192)===128&&(fe&192)===128&&(me=(B&15)<<18|(pe&63)<<12|(ne&63)<<6|fe&63,me>65535&&me<1114112&&(le=me))}}le===null?(le=65533,he=1):le>65535&&(le-=65536,M.push(le>>>10&1023|55296),le=56320|le&1023),M.push(le),R+=he}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 c(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="",B=l;B<p;++B)R+=ue(o[B]);return R}function f(o,l,p){for(var M=o.slice(l,p),R="",B=0;B<M.length;B+=2)R+=String.fromCharCode(M[B]+M[B+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 B=0;B<R;++B)M[B]=this[B+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,B=0;++B<l&&(R*=256);)M+=this[o+B]*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,B=0;++B<l&&(R*=256);)M+=this[o+B]*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,B=this[o+--M];M>0&&(R*=256);)B+=this[o+--M]*R;return R*=128,B>=R&&(B-=Math.pow(2,8*l)),B},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,B){if(!a.isBuffer(o))throw new TypeError('"buffer" argument must be a Buffer instance');if(l>R||l<B)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 B=1,le=0;for(this[l]=o&255;++le<p&&(B*=256);)this[l+le]=o/B&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 B=p-1,le=1;for(this[l+B]=o&255;--B>=0&&(le*=256);)this[l+B]=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,B=Math.min(o.length-p,2);R<B;++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,B=Math.min(o.length-p,4);R<B;++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 B=0,le=1,he=0;for(this[l]=o&255;++B<p&&(le*=256);)o<0&&he===0&&this[l+B-1]!==0&&(he=1),this[l+B]=(o/le>>0)-he&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 B=p-1,le=1,he=0;for(this[l+B]=o&255;--B>=0&&(le*=256);)o<0&&he===0&&this[l+B+1]!==0&&(he=1),this[l+B]=(o/le>>0)-he&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 Q(o,l,p,M,R,B){if(p+M>o.length)throw new RangeError("Index out of range");if(p<0)throw new RangeError("Index out of range")}function J(o,l,p,M,R){return R||Q(o,l,p,4),r.write(o,l,p,M,23,4),p+4}a.prototype.writeFloatLE=function(o,l,p){return J(this,o,l,!0,p)},a.prototype.writeFloatBE=function(o,l,p){return J(this,o,l,!1,p)};function te(o,l,p,M,R){return R||Q(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,B;if(this===o&&p<l&&l<M)for(B=R-1;B>=0;--B)o[B+l]=this[B+p];else if(R<1e3||!a.TYPED_ARRAY_SUPPORT)for(B=0;B<R;++B)o[B+l]=this[B+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 B;if(typeof o=="number")for(B=l;B<p;++B)this[B]=o;else{var le=a.isBuffer(o)?o:A(new a(o,M).toString()),he=le.length;for(B=0;B<p-l;++B)this[B+l]=le[B%he]}return this};var Z=/[^+\/0-9A-Za-z-_]/g;function ae(o){if(o=ie(o).replace(Z,""),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,B=[],le=0;le<M;++le){if(p=o.charCodeAt(le),p>55295&&p<57344){if(!R){if(p>56319){(l-=3)>-1&&B.push(239,191,189);continue}else if(le+1===M){(l-=3)>-1&&B.push(239,191,189);continue}R=p;continue}if(p<56320){(l-=3)>-1&&B.push(239,191,189),R=p;continue}p=(R-55296<<10|p-56320)+65536}else R&&(l-=3)>-1&&B.push(239,191,189);if(R=null,p<128){if((l-=1)<0)break;B.push(p)}else if(p<2048){if((l-=2)<0)break;B.push(p>>6|192,p&63|128)}else if(p<65536){if((l-=3)<0)break;B.push(p>>12|224,p>>6&63|128,p&63|128)}else if(p<1114112){if((l-=4)<0)break;B.push(p>>18|240,p>>12&63|128,p>>6&63|128,p&63|128)}else throw new Error("Invalid code point")}return B}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,B=[],le=0;le<o.length&&!((l-=2)<0);++le)p=o.charCodeAt(le),M=p>>8,R=p%256,B.push(R),B.push(M);return B}function I(o){return e.toByteArray(ae(o))}function Y(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 ce(o){return o!==o}})(io)),io}Oi();var vt;if(typeof window<"u"&&window.crypto&&(vt=window.crypto),!vt&&typeof window<"u"&&window.msCrypto&&(vt=window.msCrypto),!vt&&typeof global<"u"&&global.crypto&&(vt=global.crypto),!vt&&typeof require=="function")try{vt=require("crypto")}catch{}var ho={};var Ur=function(t,e){return Ur=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])},Ur(t,e)};function Ai(t,e){Ur(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var qr=function(){return qr=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},qr.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,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(h=t[a])&&(u=(s<3?h(u):s>3?h(e,r,u):h(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 $i(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Ri(t,e,r,n){function s(u){return u instanceof r?u:new r(function(h){h(u)})}return new(r||(r=Promise))(function(u,h){function a(_){try{y(n.next(_))}catch(P){h(P)}}function g(_){try{y(n.throw(_))}catch(P){h(P)}}function y(_){_.done?u(_.value):s(_.value).then(a,g)}y((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,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&&(u=y[0]&2?s.return:y[0]?s.throw||((u=s.return)&&u.call(s),0):s.next)&&!(u=u.call(s,y[1])).done)return u;switch(s=0,u&&(y=[y[0]&2,u.value]),y[0]){case 0:case 1:u=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(u=r.trys,!(u=u.length>0&&u[u.length-1])&&(y[0]===6||y[0]===2)){r=0;continue}if(y[0]===3&&(!u||y[1]>u[0]&&y[1]<u[3])){r.label=y[1];break}if(y[0]===6&&r.label<u[1]){r.label=u[1],u=y;break}if(u&&r.label<u[2]){r.label=u[2],r.ops.push(y);break}u[2]&&r.ops.pop(),r.trys.pop();continue}y=e.call(t,r)}catch(_){y=[6,_],s=0}finally{n=u=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 Vr(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=[],h;try{for(;(e===void 0||e-- >0)&&!(s=n.next()).done;)u.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 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],h=0,a=u.length;h<a;h++,s++)n[s]=u[h];return n}function Bt(t){return this instanceof Bt?(this.v=t,this):new Bt(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={},h("next"),h("throw"),h("return"),s[Symbol.asyncIterator]=function(){return this},s;function h(x){n[x]&&(s[x]=function(S){return new Promise(function(D,O){u.push([x,S,D,O])>1||a(x,S)})})}function a(x,S){try{g(n[x](S))}catch(D){P(u[0][3],D)}}function g(x){x.value instanceof Bt?Promise.resolve(x.value.v).then(y,_):P(u[0][2],x)}function y(x){a("next",x)}function _(x){a("throw",x)}function P(x,S){x(S),u.shift(),u.length&&a(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(h){return(r=!r)?{value:Bt(t[s](h)),done:s==="return"}:u?u(h):h}: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 Vr=="function"?Vr(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(h){return new Promise(function(a,g){h=t[u](h),s(a,g,h.done,h.value)})}}function s(u,h,a,g){Promise.resolve(g).then(function(y){u({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 qr},__asyncDelegator:Fi,__asyncGenerator:zi,__asyncValues:Wi,__await:Bt,__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:Vr},Symbol.toStringTag,{value:"Module"})),po=Br(Qi);var It={},We={},go;function mo(){return go||(go=1,Object.defineProperty(We,"__esModule",{value:!0}),We.MAX_HASHABLE_LENGTH=We.INIT=We.KEY=We.DIGEST_LENGTH=We.BLOCK_SIZE=void 0,We.BLOCK_SIZE=64,We.DIGEST_LENGTH=32,We.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]),We.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],We.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1),We}var Yt={},yo;function Zi(){if(yo)return Yt;yo=1,Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.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 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,u=n.state,h=u[0],a=u[1],g=u[2],y=u[3],_=u[4],P=u[5],x=u[6],S=u[7],D=0;D<t.BLOCK_SIZE;D++){if(D<16)this.temp[D]=(s[D*4]&255)<<24|(s[D*4+1]&255)<<16|(s[D*4+2]&255)<<8|s[D*4+3]&255;else{var O=this.temp[D-2],N=(O>>>17|O<<15)^(O>>>19|O<<13)^O>>>10;O=this.temp[D-15];var z=(O>>>7|O<<25)^(O>>>18|O<<14)^O>>>3;this.temp[D]=(N+this.temp[D-7]|0)+(z+this.temp[D-16]|0)}var F=(((_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7))+(_&P^~_&x)|0)+(S+(t.KEY[D]+this.temp[D]|0)|0)|0,q=((h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10))+(h&a^h&g^a&g)|0;S=x,x=P,P=_,_=y+F|0,y=g,g=a,a=h,h=F+q|0}u[0]+=h,u[1]+=a,u[2]+=g,u[3]+=y,u[4]+=_,u[5]+=P,u[6]+=x,u[7]+=S},r})();return Yt.RawSha256=e,Yt}var vo={},zt={};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(h=>h.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=Br(na);var bo;function sa(){if(bo)return zt;bo=1,Object.defineProperty(zt,"__esModule",{value:!0}),zt.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 zt.convertToBuffer=r,zt}var Ft={},wo;function ia(){if(wo)return Ft;wo=1,Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.isEmptyData=void 0;function t(e){return typeof e=="string"?e.length===0:e.byteLength===0}return Ft.isEmptyData=t,Ft}var Wt={},_o;function aa(){if(_o)return Wt;_o=1,Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.numToUint8=void 0;function t(e){return new Uint8Array([(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&255])}return Wt.numToUint8=t,Wt}var Ut={},Co;function la(){if(Co)return Ut;Co=1,Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.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 Ut.uint32ArrayFrom=t,Ut}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 It;So=1,Object.defineProperty(It,"__esModule",{value:!0}),It.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=u(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})();It.Sha256=s;function u(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 It}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 lt,ha=0xdeadbeefcafe,ko=(ha&16777215)==15715070;function fa(t,e,r,n,s,u){for(;--u>=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,u){for(var h=e&32767,a=e>>15;--u>=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,u){for(var h=e&16383,a=e>>14;--u>=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,lt=30):Po&&ko&&navigator.appName!="Netscape"?(ye.prototype.am=fa,lt=26):(ye.prototype.am=ga,lt=28),ye.prototype.DB=lt,ye.prototype.DM=(1<<lt)-1,ye.prototype.DV=1<<lt;var Hr=52;ye.prototype.FV=Math.pow(2,Hr),ye.prototype.F1=Hr-lt,ye.prototype.F2=2*lt-Hr;var ma="0123456789abcdefghijklmnopqrstuvwxyz",rr=new Array,Dt,Ue;for(Dt=48,Ue=0;Ue<=9;++Ue)rr[Dt++]=Ue;for(Dt=97,Ue=10;Ue<36;++Ue)rr[Dt++]=Ue;for(Dt=65,Ue=10;Ue<36;++Ue)rr[Dt++]=Ue;function Mo(t){return ma.charAt(t)}function ya(t,e){var r=rr[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 Gr(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 h=ya(t,n);if(h<0){t.charAt(n)=="-"&&(s=!0);continue}s=!1,u==0?this[this.t++]=h:u+r>this.DB?(this[this.t-1]|=(h&(1<<this.DB-u)-1)<<u,this[this.t++]=h>>this.DB-u):this[this.t-1]|=h<<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="",h=this.t,a=this.DB-h*this.DB%e;if(h-- >0)for(a<this.DB&&(n=this[h]>>a)>0&&(s=!0,u=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&&(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 Qr(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)+Qr(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),h=this.s<<r&this.DM,a;for(a=this.t-1;a>=0;--a)e[a+u+1]=this[a]>>n|h,h=(this[a]&s)<<r;for(a=u-1;a>=0;--a)e[a]=0;e[u]=h,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 h=r+1;h<this.t;++h)e[h-r-1]|=(this[h]&u)<<s,e[h-r]=this[h]>>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 $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 u=Be(),h=this.s,a=t.s,g=this.DB-Qr(n[n.t-1]);g>0?(n.lShiftTo(g,u),s.lShiftTo(g,r)):(n.copyTo(u),s.copyTo(r));var y=u.t,_=u[y-1];if(_!=0){var P=_*(1<<this.F1)+(y>1?u[y-2]>>this.F2:0),x=this.FV/P,S=(1<<this.F1)/P,D=1<<this.F2,O=r.t,N=O-y,z=e??Be();for(u.dlShiftTo(N,z),r.compareTo(z)>=0&&(r[r.t++]=1,r.subTo(z,r)),ye.ONE.dlShiftTo(y,z),z.subTo(u,u);u.t<y;)u[u.t++]=0;for(;--N>=0;){var F=r[--O]==_?this.DM:Math.floor(r[O]*x+(r[O-1]+D)*S);if((r[O]+=u.am(0,F,r,N,0,y))<F)for(u.dlShiftTo(N,z),r.subTo(z,r);r[O]<--F;)r.subTo(z,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 kt(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)}kt.prototype.convert=Wa,kt.prototype.revert=Ua,kt.prototype.reduce=qa,kt.prototype.mulTo=Ha,kt.prototype.sqrTo=Va;function Ga(t,e,r){var n=t.bitLength(),s,u=Gr(1),h=new kt(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 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 x=t.t-1,S,D=!0,O=Be(),N;for(n=Qr(t[x])-1;x>=0;){for(n>=y?S=t[x]>>n-y&_:(S=(t[x]&(1<<n+1)-1)<<y-n,x>0&&(S|=t[x-1]>>this.DB+n-y)),g=s;(S&1)==0;)S>>=1,--g;if((n-=g)<0&&(n+=this.DB,--x),D)a[S].copyTo(u),D=!1;else{for(;g>1;)h.sqrTo(u,O),h.sqrTo(O,u),g-=2;g>0?h.sqrTo(u,O):(N=u,u=O,O=N),h.mulTo(O,a[S],u)}for(;x>=0&&(t[x]&1<<n)==0;)h.sqrTo(u,O),N=u,u=O,O=N,--n<0&&(n=this.DB-1,--x)}var z=h.revert(u);return r(null,z),z}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=Gr(0),ye.ONE=Gr(1);function Qa(t,e){return e=e||{},new Promise(function(r,n){var s=new XMLHttpRequest,u=[],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 u},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,x){u.push(P=P.toLowerCase()),h.push([P,x]),a[P]=a[P]?a[P]+","+x:x}),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=Br(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,h={};u<arguments.length;u++){var a=arguments[u];for(var g in a)h[g]=a[g]}return h}function n(u){return u.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}function s(u){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 x=JSON.stringify(_);/^[\{\[]/.test(x)&&(_=x)}catch{}_=u.write?u.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 S="";for(var D in P)P[D]&&(S+="; "+D,P[D]!==!0&&(S+="="+P[D].split(";")[0]));return document.cookie=y+"="+_+S}}function g(y,_){if(!(typeof document>"u")){for(var P={},x=document.cookie?document.cookie.split("; "):[],S=0;S<x.length;S++){var D=x[S].split("="),O=D.slice(1).join("=");!_&&O.charAt(0)==='"'&&(O=O.slice(1,-1));try{var N=n(D[0]);if(O=(u.read||u)(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()}G.createContext(void 0);var nl="undefined",ol="object",nr="browser",$o="cpu",Ro="device",Zr="engine",or="os",ut="name",sr="type",Kr="vendor",Je="version",Jr="architecture",Xr="major",en="model",sl="console",il="mobile",al="tablet",ll="smarttv",ul="wearable",cl="embedded",dl=typeof window!==nl,tn=dl&&window.navigator?window.navigator:void 0;tn&&tn.userAgentData&&tn.userAgentData;var ir=function(t){for(var e={},r=0;r<t.length;r++)e[t[r].toUpperCase()]=t[r];return e},ar=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 ar.call(t.init,[[nr,[ut,Je,Xr,sr]],[$o,[Jr]],[Ro,[sr,en,Kr]],[Zr,[ut,Je]],[or,[ut,Je]]]),ar.call(t.isIgnore,[[nr,[Je,Xr]],[Zr,[Je]],[or,[Je]]]),ar.call(t.isIgnoreRgx,[[nr,/ ?browser$/i],[or,/ ?os$/i]]),ar.call(t.toString,[[nr,[ut,Je]],[$o,[Jr]],[Ro,[Kr,en]],[Zr,[ut,Je]],[or,[ut,Je]]]),t})(),ir([ut,Je,Xr,sr]),ir([Jr]),ir([en,Kr,sr,sl,il,ll,al,ul,cl]),ir([ut,Je]);var rn={exports:{}},hl=rn.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(k,C){var b=k,c=z[C],d=null,m=0,f=null,i=[],v={},E=function(A,L){d=(function($){for(var I=new Array($),Y=0;Y<$;Y+=1){I[Y]=new Array($);for(var ce=0;ce<$;ce+=1)I[Y][ce]=null}return I})(m=4*b+17),j(0,0),j(m-7,0),j(0,m-7),J(),Q(),Z(A,L),b>=7&&te(A),f==null&&(f=ie(b,c,i)),ae(f,L)},j=function(A,L){for(var $=-1;$<=7;$+=1)if(!(A+$<=-1||m<=A+$))for(var I=-1;I<=7;I+=1)L+I<=-1||m<=L+I||(d[A+$][L+I]=0<=$&&$<=6&&(I==0||I==6)||0<=I&&I<=6&&($==0||$==6)||2<=$&&$<=4&&2<=I&&I<=4)},Q=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)},J=function(){for(var A=F.getPatternPosition(b),L=0;L<A.length;L+=1)for(var $=0;$<A.length;$+=1){var I=A[L],Y=A[$];if(d[I][Y]==null)for(var ce=-2;ce<=2;ce+=1)for(var o=-2;o<=2;o+=1)d[I+ce][Y+o]=ce==-2||ce==2||o==-2||o==2||ce==0&&o==0}},te=function(A){for(var L=F.getBCHTypeNumber(b),$=0;$<18;$+=1){var I=!A&&(L>>$&1)==1;d[Math.floor($/3)][$%3+m-8-3]=I}for($=0;$<18;$+=1)I=!A&&(L>>$&1)==1,d[$%3+m-8-3][Math.floor($/3)]=I},Z=function(A,L){for(var $=c<<3|L,I=F.getBCHTypeInfo($),Y=0;Y<15;Y+=1){var ce=!A&&(I>>Y&1)==1;Y<6?d[Y][8]=ce:Y<8?d[Y+1][8]=ce:d[m-15+Y][8]=ce}for(Y=0;Y<15;Y+=1)ce=!A&&(I>>Y&1)==1,Y<8?d[8][m-Y-1]=ce:Y<9?d[8][15-Y-1+1]=ce:d[8][15-Y-1]=ce;d[m-8][8]=!A},ae=function(A,L){for(var $=-1,I=m-1,Y=7,ce=0,o=F.getMaskFunction(L),l=m-1;l>0;l-=2)for(l==6&&(l-=1);;){for(var p=0;p<2;p+=1)if(d[I][l-p]==null){var M=!1;ce<A.length&&(M=(A[ce]>>>Y&1)==1),o(I,l-p)&&(M=!M),d[I][l-p]=M,(Y-=1)==-1&&(ce+=1,Y=7)}if((I+=$)<0||m<=I){I-=$,$=-$;break}}},ie=function(A,L,$){for(var I=ee.getRSBlocks(A,L),Y=re(),ce=0;ce<$.length;ce+=1){var o=$[ce];Y.put(o.getMode(),4),Y.put(o.getLength(),F.getLengthInBits(o.getMode(),A)),o.write(Y)}var l=0;for(ce=0;ce<I.length;ce+=1)l+=I[ce].dataCount;if(Y.getLengthInBits()>8*l)throw"code length overflow. ("+Y.getLengthInBits()+">"+8*l+")";for(Y.getLengthInBits()+4<=8*l&&Y.put(0,4);Y.getLengthInBits()%8!=0;)Y.putBit(!1);for(;!(Y.getLengthInBits()>=8*l||(Y.put(236,8),Y.getLengthInBits()>=8*l));)Y.put(17,8);return(function(p,M){for(var R=0,B=0,le=0,he=new Array(M.length),pe=new Array(M.length),ne=0;ne<M.length;ne+=1){var fe=M[ne].dataCount,me=M[ne].totalCount-fe;B=Math.max(B,fe),le=Math.max(le,me),he[ne]=new Array(fe);for(var ge=0;ge<he[ne].length;ge+=1)he[ne][ge]=255&p.getBuffer()[ge+R];R+=fe;var xe=F.getErrorCorrectPolynomial(me),Ce=U(he[ne],xe.getLength()-1).mod(xe);for(pe[ne]=new Array(xe.getLength()-1),ge=0;ge<pe[ne].length;ge+=1){var Se=ge+Ce.getLength()-pe[ne].length;pe[ne][ge]=Se>=0?Ce.getAt(Se):0}}var Ye=0;for(ge=0;ge<M.length;ge+=1)Ye+=M[ge].totalCount;var Ee=new Array(Ye),_e=0;for(ge=0;ge<B;ge+=1)for(ne=0;ne<M.length;ne+=1)ge<he[ne].length&&(Ee[_e]=he[ne][ge],_e+=1);for(ge=0;ge<le;ge+=1)for(ne=0;ne<M.length;ne+=1)ge<pe[ne].length&&(Ee[_e]=pe[ne][ge],_e+=1);return Ee})(Y,I)};v.addData=function(A,L){var $=null;switch(L=L||"Byte"){case"Numeric":$=X(A);break;case"Alphanumeric":$=V(A);break;case"Byte":$=H(A);break;case"Kanji":$=K(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,c),$=re(),I=0;I<i.length;I++){var Y=i[I];$.put(Y.getMode(),4),$.put(Y.getLength(),F.getLengthInBits(Y.getMode(),A)),Y.write($)}var ce=0;for(I=0;I<L.length;I++)ce+=L[I].dataCount;if($.getLengthInBits()<=8*ce)break}b=A}E(!1,(function(){for(var o=0,l=0,p=0;p<8;p+=1){E(!0,p);var M=F.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 I=0;I<v.getModuleCount();I+=1){$+="<tr>";for(var Y=0;Y<v.getModuleCount();Y+=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(I,Y)?"#000000":"#ffffff",$+=";",$+='"/>';$+="</tr>"}return($+="</tbody>")+"</table>"},v.createSvgTag=function(A,L,$,I){var Y={};typeof arguments[0]=="object"&&(A=(Y=arguments[0]).cellSize,L=Y.margin,$=Y.alt,I=Y.title),A=A||2,L=L===void 0?4*A:L,($=typeof $=="string"?{text:$}:$||{}).text=$.text||null,$.id=$.text?$.id||"qrcode-description":null,(I=typeof I=="string"?{text:I}:I||{}).text=I.text||null,I.id=I.text?I.id||"qrcode-title":null;var ce,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+=Y.scalable?"":' width="'+M+'px" height="'+M+'px"',R+=' viewBox="0 0 '+M+" "+M+'" ',R+=' preserveAspectRatio="xMinYMin meet"',R+=I.text||$.text?' role="img" aria-labelledby="'+ue([I.id,$.id].join(" ").trim())+'"':"",R+=">",R+=I.text?'<title id="'+ue(I.id)+'">'+ue(I.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,ce=0;ce<v.getModuleCount();ce+=1)v.isDark(o,ce)&&(R+="M"+(ce*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,I=L,Y=$-L;return se($,$,function(ce,o){if(I<=ce&&ce<Y&&I<=o&&o<Y){var l=Math.floor((ce-I)/A),p=Math.floor((o-I)/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 I=v.getModuleCount()*A+2*L,Y="";return Y+="<img",Y+=' src="',Y+=v.createDataURL(A,L),Y+='"',Y+=' width="',Y+=I,Y+='"',Y+=' height="',Y+=I,Y+='"',$&&(Y+=' alt="',Y+=ue($),Y+='"'),Y+"/>"};var ue=function(A){for(var L="",$=0;$<A.length;$+=1){var I=A.charAt($);switch(I){case"<":L+="<";break;case">":L+=">";break;case"&":L+="&";break;case'"':L+=""";break;default:L+=I}}return L};return v.createASCII=function(A,L){if((A=A||1)<2)return(function(he){he=he===void 0?2:he;var pe,ne,fe,me,ge,xe=1*v.getModuleCount()+2*he,Ce=he,Se=xe-he,Ye={"██":"█","█ ":"▀"," █":"▄"," ":" "},Ee={"██":"▀","█ ":"▀"," █":" "," ":" "},_e="";for(pe=0;pe<xe;pe+=2){for(fe=Math.floor((pe-Ce)/1),me=Math.floor((pe+1-Ce)/1),ne=0;ne<xe;ne+=1)ge="█",Ce<=ne&&ne<Se&&Ce<=pe&&pe<Se&&v.isDark(fe,Math.floor((ne-Ce)/1))&&(ge=" "),Ce<=ne&&ne<Se&&Ce<=pe+1&&pe+1<Se&&v.isDark(me,Math.floor((ne-Ce)/1))?ge+=" ":ge+="█",_e+=he<1&&pe+1>=Se?Ee[ge]:Ye[ge];_e+=`
|
|
20
|
-
`}return
|
|
21
|
-
`}return B.substring(0,B.length-1)},v.renderTo2dContext=function(A,L){L=L||2;for(var $=v.getModuleCount(),I=0;I<$;I++)for(var Y=0;Y<$;Y++)A.fillStyle=v.isDark(I,Y)?"black":"white",A.fillRect(I*L,Y*L,L,L)},v};P.stringToBytes=(P.stringToBytesFuncs={default:function(k){for(var C=[],b=0;b<k.length;b+=1){var c=k.charCodeAt(b);C.push(255&c)}return C}}).default,P.createStringToBytes=function(k,C){var b=(function(){for(var d=oe(k),m=function(){var Q=d.read();if(Q==-1)throw"eof";return Q},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})(),c=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(c)}}return m}};var x,S,D,O,N,z={L:1,M:0,Q:3,H:2},F=(x=[[],[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]],S=1335,D=7973,N=function(k){for(var C=0;k!=0;)C+=1,k>>>=1;return C},(O={}).getBCHTypeInfo=function(k){for(var C=k<<10;N(C)-N(S)>=0;)C^=S<<N(C)-N(S);return 21522^(k<<10|C)},O.getBCHTypeNumber=function(k){for(var C=k<<12;N(C)-N(D)>=0;)C^=D<<N(C)-N(D);return k<<12|C},O.getPatternPosition=function(k){return x[k-1]},O.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}},O.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},O.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}}},O.getLostPoint=function(k){for(var C=k.getModuleCount(),b=0,c=0;c<C;c+=1)for(var d=0;d<C;d+=1){for(var m=0,f=k.isDark(c,d),i=-1;i<=1;i+=1)if(!(c+i<0||C<=c+i))for(var v=-1;v<=1;v+=1)d+v<0||C<=d+v||i==0&&v==0||f==k.isDark(c+i,d+v)&&(m+=1);m>5&&(b+=3+m-5)}for(c=0;c<C-1;c+=1)for(d=0;d<C-1;d+=1){var E=0;k.isDark(c,d)&&(E+=1),k.isDark(c+1,d)&&(E+=1),k.isDark(c,d+1)&&(E+=1),k.isDark(c+1,d+1)&&(E+=1),E!=0&&E!=4||(b+=3)}for(c=0;c<C;c+=1)for(d=0;d<C-6;d+=1)k.isDark(c,d)&&!k.isDark(c,d+1)&&k.isDark(c,d+2)&&k.isDark(c,d+3)&&k.isDark(c,d+4)&&!k.isDark(c,d+5)&&k.isDark(c,d+6)&&(b+=40);for(d=0;d<C;d+=1)for(c=0;c<C-6;c+=1)k.isDark(c,d)&&!k.isDark(c+1,d)&&k.isDark(c+2,d)&&k.isDark(c+3,d)&&k.isDark(c+4,d)&&!k.isDark(c+5,d)&&k.isDark(c+6,d)&&(b+=40);var j=0;for(d=0;d<C;d+=1)for(c=0;c<C;c+=1)k.isDark(c,d)&&(j+=1);return b+Math.abs(100*j/C/C-50)/5*10},O),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(c){if(c<1)throw"glog("+c+")";return C[c]},gexp:function(c){for(;c<0;)c+=255;for(;c>=256;)c-=255;return k[c]}}})();function U(k,C){if(k.length===void 0)throw k.length+"/"+C;var b=(function(){for(var d=0;d<k.length&&k[d]==0;)d+=1;for(var m=new Array(k.length-d+C),f=0;f<k.length-d;f+=1)m[f]=k[f+d];return m})(),c={getAt:function(d){return b[d]},getLength:function(){return b.length},multiply:function(d){for(var m=new Array(c.getLength()+d.getLength()-1),f=0;f<c.getLength();f+=1)for(var i=0;i<d.getLength();i+=1)m[f+i]^=q.gexp(q.glog(c.getAt(f))+q.glog(d.getAt(i)));return U(m,0)},mod:function(d){if(c.getLength()-d.getLength()<0)return c;for(var m=q.glog(c.getAt(0))-q.glog(d.getAt(0)),f=new Array(c.getLength()),i=0;i<c.getLength();i+=1)f[i]=c.getAt(i);for(i=0;i<d.getLength();i+=1)f[i]^=q.gexp(q.glog(d.getAt(i))+m);return U(f,0).mod(d)}};return c}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(c,d){var m={};return m.totalCount=c,m.dataCount=d,m},b={getRSBlocks:function(c,d){var m=(function(te,Z){switch(Z){case z.L:return k[4*(te-1)+0];case z.M:return k[4*(te-1)+1];case z.Q:return k[4*(te-1)+2];case z.H:return k[4*(te-1)+3];default:return}})(c,d);if(m===void 0)throw"bad rs block @ typeNumber:"+c+"/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],Q=m[3*v+2],J=0;J<E;J+=1)i.push(C(j,Q));return i}};return b})(),re=function(){var k=[],C=0,b={getBuffer:function(){return k},getAt:function(c){var d=Math.floor(c/8);return(k[d]>>>7-c%8&1)==1},put:function(c,d){for(var m=0;m<d;m+=1)b.putBit((c>>>d-m-1&1)==1)},getLengthInBits:function(){return C},putBit:function(c){var d=Math.floor(C/8);k.length<=d&&k.push(0),c&&(k[d]|=128>>>C%8),C+=1}};return b},X=function(k){var C=k,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(c(f.substring(i,i+3)),10),i+=3;i<f.length&&(f.length-i==1?m.put(c(f.substring(i,i+1)),4):f.length-i==2&&m.put(c(f.substring(i,i+2)),7))}},c=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},V=function(k){var C=k,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*c(m.charAt(f))+c(m.charAt(f+1)),11),f+=2;f<m.length&&d.put(c(m.charAt(f)),6)}},c=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},H=function(k){var C=P.stringToBytes(k);return{getMode:function(){return 4},getLength:function(b){return C.length},write:function(b){for(var c=0;c<C.length;c+=1)b.put(C[c],8)}}},K=function(k){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(k),c={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 c},W=function(){var k=[],C={writeByte:function(b){k.push(255&b)},writeShort:function(b){C.writeByte(b),C.writeByte(b>>>8)},writeBytes:function(b,c,d){c=c||0,d=d||b.length;for(var m=0;m<d;m+=1)C.writeByte(b[m+c])},writeString:function(b){for(var c=0;c<b.length;c+=1)C.writeByte(b.charCodeAt(c))},toByteArray:function(){return k},toString:function(){var b="";b+="[";for(var c=0;c<k.length;c+=1)c>0&&(b+=","),b+=k[c];return b+"]"}};return C},oe=function(k){var C=k,b=0,c=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$/)||(c=c<<6|f(i.charCodeAt(0)),d+=6)}var v=c>>>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},se=function(k,C,b){for(var c=(function(j,Q){var J=j,te=Q,Z=new Array(j*Q),ae={setPixel:function(A,L,$){Z[L*J+A]=$},write:function(A){A.writeString("GIF87a"),A.writeShort(J),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(J),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),I=A+1,Y=ue(),ce=0;ce<L;ce+=1)Y.add(String.fromCharCode(ce));Y.add(String.fromCharCode(L)),Y.add(String.fromCharCode($));var o,l,p,M=W(),R=(o=M,l=0,p=0,{write:function(pe,ne){if(pe>>>ne)throw"length over";for(;l+ne>=8;)o.writeByte(255&(pe<<l|p)),ne-=8-l,pe>>>=8-l,p=0,l=0;p|=pe<<l,l+=ne},flush:function(){l>0&&o.writeByte(p)}});R.write(L,I);var B=0,le=String.fromCharCode(Z[B]);for(B+=1;B<Z.length;){var he=String.fromCharCode(Z[B]);B+=1,Y.contains(le+he)?le+=he:(R.write(Y.indexOf(le),I),Y.size()<4095&&(Y.size()==1<<I&&(I+=1),Y.add(le+he)),le=he)}return R.write(Y.indexOf(le),I),R.write($,I),R.flush(),M.toByteArray()},ue=function(){var A={},L=0,$={add:function(I){if($.contains(I))throw"dup key:"+I;A[I]=L,L+=1},size:function(){return L},indexOf:function(I){return A[I]},contains:function(I){return A[I]!==void 0}};return $};return ae})(k,C),d=0;d<C;d+=1)for(var m=0;m<k;m+=1)c.setPixel(m,d,b(m,d));var f=W();c.write(f);for(var i=(function(){var j=0,Q=0,J=0,te="",Z={},ae=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 Z.writeByte=function(ue){for(j=j<<8|255&ue,Q+=8,J+=1;Q>=6;)ae(j>>>Q-6),Q-=6},Z.flush=function(){if(Q>0&&(ae(j<<6-Q),j=0,Q=0),J%3!=0)for(var ue=3-J%3,A=0;A<ue;A+=1)te+="="},Z.toString=function(){return te},Z})(),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(x){for(var S=[],D=0;D<x.length;D++){var O=x.charCodeAt(D);O<128?S.push(O):O<2048?S.push(192|O>>6,128|63&O):O<55296||O>=57344?S.push(224|O>>12,128|O>>6&63,128|63&O):(D++,O=65536+((1023&O)<<10|1023&x.charCodeAt(D)),S.push(240|O>>18,128|O>>12&63,128|O>>6&63,128|63&O))}return S})(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 u={};return(()=>{s.d(u,{default:()=>C});const h=b=>!!b&&typeof b=="object"&&!Array.isArray(b);function a(b,...c){if(!c.length)return b;const d=c.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,...c)):b}function g(b,c){const d=document.createElement("a");d.download=c,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:c,type:d,window:m}){this._svg=c,this._type=d,this._window=m}draw(c,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:c,y:d,size:m,getNeighbor:f})}_rotateFigure({x:c,y:d,size:m,rotation:f=0,draw:i}){var v;const E=c+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(c){const{size:d,x:m,y:f}=c;this._rotateFigure(Object.assign(Object.assign({},c),{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(c){const{size:d,x:m,y:f}=c;this._rotateFigure(Object.assign(Object.assign({},c),{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(c){const{size:d,x:m,y:f}=c;this._rotateFigure(Object.assign(Object.assign({},c),{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(c){const{size:d,x:m,y:f}=c;this._rotateFigure(Object.assign(Object.assign({},c),{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(c){const{size:d,x:m,y:f}=c;this._rotateFigure(Object.assign(Object.assign({},c),{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(c){const{size:d,x:m,y:f}=c;this._rotateFigure(Object.assign(Object.assign({},c),{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:c,y:d,size:m}){this._basicDot({x:c,y:d,size:m,rotation:0})}_drawSquare({x:c,y:d,size:m}){this._basicSquare({x:c,y:d,size:m,rotation:0})}_drawRounded({x:c,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,Q=i+v+E+j;if(Q!==0)if(Q>2||i&&v||E&&j)this._basicSquare({x:c,y:d,size:m,rotation:0});else{if(Q===2){let J=0;return i&&E?J=Math.PI/2:E&&v?J=Math.PI:v&&j&&(J=-Math.PI/2),void this._basicCornerRounded({x:c,y:d,size:m,rotation:J})}if(Q===1){let J=0;return E?J=Math.PI/2:v?J=Math.PI:j&&(J=-Math.PI/2),void this._basicSideRounded({x:c,y:d,size:m,rotation:J})}}else this._basicDot({x:c,y:d,size:m,rotation:0})}_drawExtraRounded({x:c,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,Q=i+v+E+j;if(Q!==0)if(Q>2||i&&v||E&&j)this._basicSquare({x:c,y:d,size:m,rotation:0});else{if(Q===2){let J=0;return i&&E?J=Math.PI/2:E&&v?J=Math.PI:v&&j&&(J=-Math.PI/2),void this._basicCornerExtraRounded({x:c,y:d,size:m,rotation:J})}if(Q===1){let J=0;return E?J=Math.PI/2:v?J=Math.PI:j&&(J=-Math.PI/2),void this._basicSideRounded({x:c,y:d,size:m,rotation:J})}}else this._basicDot({x:c,y:d,size:m,rotation:0})}_drawClassy({x:c,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:c,y:d,size:m,rotation:0}):this._basicCornerRounded({x:c,y:d,size:m,rotation:Math.PI/2}):this._basicCornerRounded({x:c,y:d,size:m,rotation:-Math.PI/2}):this._basicCornersRounded({x:c,y:d,size:m,rotation:Math.PI/2})}_drawClassyRounded({x:c,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:c,y:d,size:m,rotation:0}):this._basicCornerExtraRounded({x:c,y:d,size:m,rotation:Math.PI/2}):this._basicCornerExtraRounded({x:c,y:d,size:m,rotation:-Math.PI/2}):this._basicCornersRounded({x:c,y:d,size:m,rotation:Math.PI/2})}}const P={dot:"dot",square:"square",extraRounded:"extra-rounded"},x=Object.values(P);class S{constructor({svg:c,type:d,window:m}){this._svg=c,this._type=d,this._window=m}draw(c,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:c,y:d,size:m,rotation:f})}_rotateFigure({x:c,y:d,size:m,rotation:f=0,draw:i}){var v;const E=c+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(c){const{size:d,x:m,y:f}=c,i=d/7;this._rotateFigure(Object.assign(Object.assign({},c),{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(c){const{size:d,x:m,y:f}=c,i=d/7;this._rotateFigure(Object.assign(Object.assign({},c),{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(c){const{size:d,x:m,y:f}=c,i=d/7;this._rotateFigure(Object.assign(Object.assign({},c),{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:c,y:d,size:m,rotation:f}){this._basicDot({x:c,y:d,size:m,rotation:f})}_drawSquare({x:c,y:d,size:m,rotation:f}){this._basicSquare({x:c,y:d,size:m,rotation:f})}_drawExtraRounded({x:c,y:d,size:m,rotation:f}){this._basicExtraRounded({x:c,y:d,size:m,rotation:f})}}const D={dot:"dot",square:"square"},O=Object.values(D);class N{constructor({svg:c,type:d,window:m}){this._svg=c,this._type=d,this._window=m}draw(c,d,m,f){let i;i=this._type===D.square?this._drawSquare:this._drawDot,i.call(this,{x:c,y:d,size:m,rotation:f})}_rotateFigure({x:c,y:d,size:m,rotation:f=0,draw:i}){var v;const E=c+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(c){const{size:d,x:m,y:f}=c;this._rotateFigure(Object.assign(Object.assign({},c),{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(c){const{size:d,x:m,y:f}=c;this._rotateFigure(Object.assign(Object.assign({},c),{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:c,y:d,size:m,rotation:f}){this._basicDot({x:c,y:d,size:m,rotation:f})}_drawSquare({x:c,y:d,size:m,rotation:f}){this._basicSquare({x:c,y:d,size:m,rotation:f})}}const z="circle",F=[[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(c,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(c.width)),this._element.setAttribute("height",String(c.height)),this._element.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),c.dotsOptions.roundSize||this._element.setAttribute("shape-rendering","crispEdges"),this._element.setAttribute("viewBox",`0 0 ${c.width} ${c.height}`),this._defs=this._window.document.createElementNS("http://www.w3.org/2000/svg","defs"),this._element.appendChild(this._defs),this._imageUri=c.image,this._instanceId=U.instanceCount++,this._options=c}get width(){return this._options.width}get height(){return this._options.height}getElement(){return this._element}async drawQR(c){const d=c.getModuleCount(),m=Math.min(this._options.width,this._options.height)-2*this._options.margin,f=this._options.shape===z?m/Math.sqrt(2):m,i=this._roundSize(f/d);let v={hideXDots:0,hideYDots:0,width:0,height:0};if(this._qr=c,this._options.image){if(await this.loadImage(),!this._image)return;const{imageOptions:E,qrOptions:j}=this._options,Q=E.imageSize*y[j.errorCorrectionLevel],J=Math.floor(Q*d*d);v=(function({originalHeight:te,originalWidth:Z,maxHiddenDots:ae,maxHiddenAxisDots:ie,dotSize:ue}){const A={x:0,y:0},L={x:0,y:0};if(te<=0||Z<=0||ae<=0||ue<=0)return{height:0,width:0,hideYDots:0,hideXDots:0};const $=te/Z;return A.x=Math.floor(Math.sqrt(ae/$)),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>ae||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:J,maxHiddenAxisDots:d-14,dotSize:i})}this.drawBackground(),this.drawDots((E,j)=>{var Q,J,te,Z,ae,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||!((Q=F[E])===null||Q===void 0)&&Q[j]||!((J=F[E-d+7])===null||J===void 0)&&J[j]||!((te=F[E])===null||te===void 0)&&te[j-d+7]||!((Z=q[E])===null||Z===void 0)&&Z[j]||!((ae=q[E-d+7])===null||ae===void 0)&&ae[j]||!((ie=q[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 c,d,m;const f=this._element,i=this._options;if(f){const v=(c=i.backgroundOptions)===null||c===void 0?void 0:c.gradient,E=(d=i.backgroundOptions)===null||d===void 0?void 0:d.color;let j=i.height,Q=i.width;if(v||E){const J=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=Q=Math.min(i.width,i.height),J.setAttribute("rx",String(j/2*i.backgroundOptions.round))),J.setAttribute("x",String(this._roundSize((i.width-Q)/2))),J.setAttribute("y",String(this._roundSize((i.height-j)/2))),J.setAttribute("width",String(Q)),J.setAttribute("height",String(j)),this._backgroundClipPath.appendChild(J),this._createColor({options:v,color:E,additionalRotation:0,x:0,y:0,height:i.height,width:i.width,name:`background-color-${this._instanceId}`})}}}drawDots(c){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===z?v/Math.sqrt(2):v,j=this._roundSize(E/i),Q=this._roundSize((f.width-i*j)/2),J=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 Z=0;Z<i;Z++)for(let ae=0;ae<i;ae++)c&&!c(Z,ae)||!((m=this._qr)===null||m===void 0)&&m.isDark(Z,ae)&&(te.draw(Q+ae*j,J+Z*j,j,(ie,ue)=>!(ae+ie<0||Z+ue<0||ae+ie>=i||Z+ue>=i)&&!(c&&!c(Z+ue,ae+ie))&&!!this._qr&&this._qr.isDark(Z+ue,ae+ie)),te._element&&this._dotsClipPath&&this._dotsClipPath.appendChild(te._element));if(f.shape===z){const Z=this._roundSize((v/j-i)/2),ae=i+2*Z,ie=Q-Z*j,ue=J-Z*j,A=[],L=this._roundSize(ae/2);for(let $=0;$<ae;$++){A[$]=[];for(let I=0;I<ae;I++)$>=Z-1&&$<=ae-Z&&I>=Z-1&&I<=ae-Z||Math.sqrt(($-L)*($-L)+(I-L)*(I-L))>L?A[$][I]=0:A[$][I]=this._qr.isDark(I-2*Z<0?I:I>=i?I-2*Z:I-Z,$-2*Z<0?$:$>=i?$-2*Z:$-Z)?1:0}for(let $=0;$<ae;$++)for(let I=0;I<ae;I++)A[$][I]&&(te.draw(ie+I*j,ue+$*j,j,(Y,ce)=>{var o;return!!(!((o=A[$+ce])===null||o===void 0)&&o[I+Y])}),te._element&&this._dotsClipPath&&this._dotsClipPath.appendChild(te._element))}}drawCorners(){if(!this._qr)throw"QR code is not defined";const c=this._element,d=this._options;if(!c)throw"Element code is not defined";const m=this._qr.getModuleCount(),f=Math.min(d.width,d.height)-2*d.margin,i=d.shape===z?f/Math.sqrt(2):f,v=this._roundSize(i/m),E=7*v,j=3*v,Q=this._roundSize((d.width-m*v)/2),J=this._roundSize((d.height-m*v)/2);[[0,0,0],[1,0,Math.PI/2],[0,1,-Math.PI/2]].forEach(([te,Z,ae])=>{var ie,ue,A,L,$,I,Y,ce,o,l,p,M,R,B;const le=Q+te*v*(m-7),he=J+Z*v*(m-7);let pe=this._dotsClipPath,ne=this._dotsClipPath;if((!((ie=d.cornersSquareOptions)===null||ie===void 0)&&ie.gradient||!((ue=d.cornersSquareOptions)===null||ue===void 0)&&ue.color)&&(pe=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),pe.setAttribute("id",`clip-path-corners-square-color-${te}-${Z}-${this._instanceId}`),this._defs.appendChild(pe),this._cornersSquareClipPath=this._cornersDotClipPath=ne=pe,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:ae,x:le,y:he,height:E,width:E,name:`corners-square-color-${te}-${Z}-${this._instanceId}`})),(($=d.cornersSquareOptions)===null||$===void 0?void 0:$.type)&&x.includes(d.cornersSquareOptions.type)){const fe=new S({svg:this._element,type:d.cornersSquareOptions.type,window:this._window});fe.draw(le,he,E,ae),fe._element&&pe&&pe.appendChild(fe._element)}else{const fe=new _({svg:this._element,type:((I=d.cornersSquareOptions)===null||I===void 0?void 0:I.type)||d.dotsOptions.type,window:this._window});for(let me=0;me<F.length;me++)for(let ge=0;ge<F[me].length;ge++)!((Y=F[me])===null||Y===void 0)&&Y[ge]&&(fe.draw(le+ge*v,he+me*v,v,(xe,Ce)=>{var Se;return!!(!((Se=F[me+Ce])===null||Se===void 0)&&Se[ge+xe])}),fe._element&&pe&&pe.appendChild(fe._element))}if((!((ce=d.cornersDotOptions)===null||ce===void 0)&&ce.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}-${Z}-${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:ae,x:le+2*v,y:he+2*v,height:j,width:j,name:`corners-dot-color-${te}-${Z}-${this._instanceId}`})),((M=d.cornersDotOptions)===null||M===void 0?void 0:M.type)&&O.includes(d.cornersDotOptions.type)){const fe=new N({svg:this._element,type:d.cornersDotOptions.type,window:this._window});fe.draw(le+2*v,he+2*v,j,ae),fe._element&&ne&&ne.appendChild(fe._element)}else{const fe=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<q.length;me++)for(let ge=0;ge<q[me].length;ge++)!((B=q[me])===null||B===void 0)&&B[ge]&&(fe.draw(le+ge*v,he+me*v,v,(xe,Ce)=>{var Se;return!!(!((Se=q[me+Ce])===null||Se===void 0)&&Se[ge+xe])}),fe._element&&ne&&ne.appendChild(fe._element))}})}loadImage(){return new Promise((c,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()}c()}).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 Q=new E.XMLHttpRequest;Q.onload=function(){const J=new E.FileReader;J.onloadend=function(){j(J.result)},J.readAsDataURL(Q.response)},Q.open("GET",v),Q.responseType="blob",Q.send()})})(f.image||"",this._window)),c()},i.src=f.image}})}async drawImage({width:c,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-c)/2),Q=E+this._roundSize(i.imageOptions.margin+(m*f-d)/2),J=c-2*i.imageOptions.margin,te=d-2*i.imageOptions.margin,Z=this._window.document.createElementNS("http://www.w3.org/2000/svg","image");Z.setAttribute("href",this._imageUri||""),Z.setAttribute("xlink:href",this._imageUri||""),Z.setAttribute("x",String(j)),Z.setAttribute("y",String(Q)),Z.setAttribute("width",`${J}px`),Z.setAttribute("height",`${te}px`),this._element.appendChild(Z)}_createColor({options:c,color:d,additionalRotation:m,x:f,y:i,height:v,width:E,name:j}){const Q=E>v?E:v,J=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect");if(J.setAttribute("x",String(f)),J.setAttribute("y",String(i)),J.setAttribute("height",String(v)),J.setAttribute("width",String(E)),J.setAttribute("clip-path",`url('#clip-path-${j}')`),c){let te;if(c.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(Q/2));else{const Z=((c.rotation||0)+m)%(2*Math.PI),ae=(Z+2*Math.PI)%(2*Math.PI);let ie=f+E/2,ue=i+v/2,A=f+E/2,L=i+v/2;ae>=0&&ae<=.25*Math.PI||ae>1.75*Math.PI&&ae<=2*Math.PI?(ie-=E/2,ue-=v/2*Math.tan(Z),A+=E/2,L+=v/2*Math.tan(Z)):ae>.25*Math.PI&&ae<=.75*Math.PI?(ue-=v/2,ie-=E/2/Math.tan(Z),L+=v/2,A+=E/2/Math.tan(Z)):ae>.75*Math.PI&&ae<=1.25*Math.PI?(ie+=E/2,ue+=v/2*Math.tan(Z),A-=E/2,L-=v/2*Math.tan(Z)):ae>1.25*Math.PI&&ae<=1.75*Math.PI&&(ue+=v/2,ie+=E/2/Math.tan(Z),L-=v/2,A-=E/2/Math.tan(Z)),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)))}c.colorStops.forEach(({offset:Z,color:ae})=>{const ie=this._window.document.createElementNS("http://www.w3.org/2000/svg","stop");ie.setAttribute("offset",100*Z+"%"),ie.setAttribute("stop-color",ae),te.appendChild(ie)}),J.setAttribute("fill",`url('#${j}')`),this._defs.appendChild(te)}else d&&J.setAttribute("fill",d);this._element.appendChild(J)}}U.instanceCount=0;const ee=U,re="canvas",X={};for(let b=0;b<=40;b++)X[b]=b;const V={type:re,shape:"square",width:300,height:300,data:"",margin:0,qrOptions:{typeNumber:X[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 H(b){const c=Object.assign({},b);if(!c.colorStops||!c.colorStops.length)throw"Field 'colorStops' is required in gradient";return c.rotation?c.rotation=Number(c.rotation):c.rotation=0,c.colorStops=c.colorStops.map(d=>Object.assign(Object.assign({},d),{offset:Number(d.offset)})),c}function K(b){const c=Object.assign({},b);return c.width=Number(c.width),c.height=Number(c.height),c.margin=Number(c.margin),c.imageOptions=Object.assign(Object.assign({},c.imageOptions),{hideBackgroundDots:!!c.imageOptions.hideBackgroundDots,imageSize:Number(c.imageOptions.imageSize),margin:Number(c.imageOptions.margin)}),c.margin>Math.min(c.width,c.height)&&(c.margin=Math.min(c.width,c.height)),c.dotsOptions=Object.assign({},c.dotsOptions),c.dotsOptions.gradient&&(c.dotsOptions.gradient=H(c.dotsOptions.gradient)),c.cornersSquareOptions&&(c.cornersSquareOptions=Object.assign({},c.cornersSquareOptions),c.cornersSquareOptions.gradient&&(c.cornersSquareOptions.gradient=H(c.cornersSquareOptions.gradient))),c.cornersDotOptions&&(c.cornersDotOptions=Object.assign({},c.cornersDotOptions),c.cornersDotOptions.gradient&&(c.cornersDotOptions.gradient=H(c.cornersDotOptions.gradient))),c.backgroundOptions&&(c.backgroundOptions=Object.assign({},c.backgroundOptions),c.backgroundOptions.gradient&&(c.backgroundOptions.gradient=H(c.backgroundOptions.gradient))),c}var W=s(873),oe=s.n(W);function se(b){if(!b)throw new Error("Extension must be defined");b[0]==="."&&(b=b.substring(1));const c={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(!c)throw new Error(`Extension "${b}" is not supported`);return c}class k{constructor(c){c!=null&&c.jsdom?this._window=new c.jsdom("",{resources:"usable"}).window:this._window=window,this._options=c?K(a(V,c)):V,this.update()}static _clearContainer(c){c&&(c.innerHTML="")}_setupSvg(){if(!this._qr)return;const c=new ee(this._options,this._window);this._svg=c.getElement(),this._svgDrawingPromise=c.drawQR(this._qr).then(()=>{var d;this._svg&&((d=this._extension)===null||d===void 0||d.call(this,c.getElement(),this._options))})}_setupCanvas(){var c,d;this._qr&&(!((c=this._options.nodeCanvas)===null||c===void 0)&&c.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:${se("svg")};base64,${v}`;if(!((m=this._options.nodeCanvas)===null||m===void 0)&&m.loadImage)return this._options.nodeCanvas.loadImage(E).then(j=>{var Q,J;j.width=this._options.width,j.height=this._options.height,(J=(Q=this._nodeCanvas)===null||Q===void 0?void 0:Q.getContext("2d"))===null||J===void 0||J.drawImage(j,0,0)});{const j=new this._window.Image;return new Promise(Q=>{j.onload=()=>{var J,te;(te=(J=this._domCanvas)===null||J===void 0?void 0:J.getContext("2d"))===null||te===void 0||te.drawImage(j,0,0),Q()},j.src=E})}}))}async _getElement(c="png"){if(!this._qr)throw"QR code is empty";return c.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(c){k._clearContainer(this._container),this._options=c?K(a(this._options,c)):this._options,this._options.data&&(this._qr=oe()(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(c){if(c){if(typeof c.appendChild!="function")throw"Container should be a single DOM node";this._options.type===re?this._domCanvas&&c.appendChild(this._domCanvas):this._svg&&c.appendChild(this._svg),this._container=c}}applyExtension(c){if(!c)throw"Extension function should be defined.";this._extension=c,this.update()}deleteExtension(){this._extension=void 0,this.update()}async getRawData(c="png"){if(!this._qr)throw"QR code is empty";const d=await this._getElement(c),m=se(c);if(!d)return null;if(c.toLowerCase()==="svg"){const f=`<?xml version="1.0" standalone="no"?>\r
|
|
22
|
-
${new this._window.XMLSerializer().serializeToString(d)}`;return typeof Blob>"u"||this._options.jsdom?Buffer.from(f):new Blob([f],{type:m})}return new Promise(f=>{const i=d;if("toBuffer"in i)if(m==="image/png")f(i.toBuffer(m));else if(m==="image/jpeg")f(i.toBuffer(m));else{if(m!=="application/pdf")throw Error("Unsupported extension");f(i.toBuffer(m))}else"toBlob"in i&&i.toBlob(f,m,1)})}async download(
|
|
23
|
-
`+i,g(`data:${se(d)};charset=utf-8,${encodeURIComponent(i)}`,`${m}.svg`)}else g(f.toDataURL(se(d)),`${m}.${d}`)}}const C=k})(),u.default})())})(rn)),rn.exports}fl();const Lo=G.createContext(void 0);function pl(t){const e=Ze.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 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]!==u||e[7]!==h?(a=w.jsx(Lo.Provider,{value:u,children:h}),e[6]=u,e[7]=h,e[8]=a):a=e[8],a}function ct(){const t=G.useContext(Lo);if(!t)throw new Error("useDataTable must be used within a DataTableProvider");return t}function nn(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 Pt(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 bt(){return{"Content-Type":"application/json",Authorization:`Bearer ${await rl()??""}`,...gl()}}async function Bo(t){return fetch(t,{method:"GET",headers:await bt()}).then(async e=>(e.status>=400&&await Pt(e),e)).then(e=>e.json()).then(e=>e)}async function Io(t,e){return fetch(`${t}/${e}`,{method:"GET",headers:await bt()}).then(async r=>(r.status>=400&&await Pt(r),r)).then(r=>r.json()).then(r=>r)}async function Yo(t,e){const r=await fetch(`${t}/${e}`,{method:"DELETE",headers:await bt()});r.status>=400&&await Pt(r)}async function zo(t,e){return fetch(t,{method:"POST",headers:await bt(),body:JSON.stringify(e)}).then(async r=>(r.status>=400&&await Pt(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 bt(),body:r?JSON.stringify(r):void 0}).then(async n=>(n.status>=400&&await Pt(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 bt(),body:JSON.stringify(e)}).then(async r=>(r.status>=400&&await Pt(r),r)).then(r=>r.status==204?e:r.json()).then(r=>r)}function Wo(t,e,r){const n=Ze.c(13),{baseUrl:s}=ct();let u;if(n[0]!==r||n[1]!==e){let y;n[3]!==r?(y=r?.toString(),n[3]=r,n[4]=y):y=n[4],u=[...e.map(yl),String(y)],n[0]=r,n[1]=e,n[2]=u}else u=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]!==u||n[10]!==h||n[11]!==a?(g={queryKey:u,queryFn:h,enabled:a},n[9]=u,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=Ze.c(9),s=r===void 0?!0:r,{baseUrl:u}=ct();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]!==u?(a=()=>Bo(`${u}${t}`),n[2]=t,n[3]=u,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=Ze.c(10),{baseUrl:n,queryClient:s}=ct();let u;r[0]!==e?(u=[...e.map(wl)],r[0]=e,r[1]=u):u=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]!==u||r[8]!==h?(a={mutationKey:u,mutationFn:h,onSettled(){return s.invalidateQueries({queryKey:[...e.map(bl)]})},onError(g){nn(g)}},r[5]=s,r[6]=e,r[7]=u,r[8]=h,r[9]=a):a=r[9],Lr(a)}function bl(t){return t.toString()}function wl(t){return t.toString()}function on(t,e){const r=Ze.c(10),{baseUrl:n,queryClient:s}=ct();let u;r[0]!==e?(u=[...e.map(Cl)],r[0]=e,r[1]=u):u=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]!==u||r[8]!==h?(a={mutationKey:u,mutationFn:h,onSettled(){return s.invalidateQueries({queryKey:[...e.map(_l)]})},onError(g){nn(g)}},r[5]=s,r[6]=e,r[7]=u,r[8]=h,r[9]=a):a=r[9],Lr(a)}function _l(t){return t.toString()}function Cl(t){return t.toString()}function Vo(t,e){const r=Ze.c(10),{baseUrl:n,queryClient:s}=ct();let u;r[0]!==e?(u=[...e.map(Sl)],r[0]=e,r[1]=u):u=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]!==u||r[8]!==h?(a={mutationKey:u,mutationFn:h,onSettled(){return s.invalidateQueries({queryKey:[...e.map(xl)]})},onError(g){nn(g)}},r[5]=s,r[6]=e,r[7]=u,r[8]=h,r[9]=a):a=r[9],Lr(a)}function xl(t){return t.toString()}function Sl(t){return t.toString()}var lr={exports:{}},Dl=lr.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",h="second",a="minute",g="hour",y="day",_="week",P="month",x="quarter",S="year",D="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+)?$/,z=/\[([^\]]+)]|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,F={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 c=String(k);return!c||c.length>=C?k:""+Array(C+1-c.length).join(b)+k},U={s:q,z:function(k){var C=-k.utcOffset(),b=Math.abs(C),c=Math.floor(b/60),d=b%60;return(C<=0?"+":"-")+q(c,2,"0")+":"+q(d,2,"0")},m:function k(C,b){if(C.date()<b.date())return-k(b,C);var c=12*(b.year()-C.year())+(b.month()-C.month()),d=C.clone().add(c,P),m=b-d<0,f=C.clone().add(c+(m?-1:1),P);return+(-(c+(b-d)/(m?d-f:f-d))||0)},a:function(k){return k<0?Math.ceil(k)||0:Math.floor(k)},p:function(k){return{M:P,y:S,w:_,d:y,D,h:g,m:a,s:h,ms:u,Q:x}[k]||String(k||"").toLowerCase().replace(/s$/,"")},u:function(k){return k===void 0}},ee="en",re={};re[ee]=F;var X="$isDayjsObject",V=function(k){return k instanceof oe||!(!k||!k[X])},H=function k(C,b,c){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 k(f[0])}else{var i=C.name;re[i]=C,d=i}return!c&&d&&(ee=d),d||!c&&ee},K=function(k,C){if(V(k))return k.clone();var b=typeof C=="object"?C:{};return b.date=k,b.args=arguments,new oe(b)},W=U;W.l=H,W.i=V,W.w=function(k,C){return K(k,{locale:C.$L,utc:C.$u,x:C.$x,$offset:C.$offset})};var oe=(function(){function k(b){this.$L=H(b.locale,null,!0),this.parse(b),this.$x=this.$x||b.x||{},this[X]=!0}var C=k.prototype;return C.parse=function(b){this.$d=(function(c){var d=c.date,m=c.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,c){var d=K(b);return this.startOf(c)<=d&&d<=this.endOf(c)},C.isAfter=function(b,c){return K(b)<this.startOf(c)},C.isBefore=function(b,c){return this.endOf(c)<K(b)},C.$g=function(b,c,d){return W.u(b)?this[c]:this.set(d,b)},C.unix=function(){return Math.floor(this.valueOf()/1e3)},C.valueOf=function(){return this.$d.getTime()},C.startOf=function(b,c){var d=this,m=!!W.u(c)||c,f=W.p(b),i=function(ae,ie){var ue=W.w(d.$u?Date.UTC(d.$y,ie,ae):new Date(d.$y,ie,ae),d);return m?ue:ue.endOf(y)},v=function(ae,ie){return W.w(d.toDate()[ae].apply(d.toDate("s"),(m?[0,0,0,0]:[23,59,59,999]).slice(ie)),d)},E=this.$W,j=this.$M,Q=this.$D,J="set"+(this.$u?"UTC":"");switch(f){case S: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,Z=(E<te?E+7:E)-te;return i(m?Q-Z:Q+(6-Z),j);case y:case D:return v(J+"Hours",0);case g:return v(J+"Minutes",1);case a:return v(J+"Seconds",2);case h:return v(J+"Milliseconds",3);default:return this.clone()}},C.endOf=function(b){return this.startOf(b,!1)},C.$set=function(b,c){var d,m=W.p(b),f="set"+(this.$u?"UTC":""),i=(d={},d[y]=f+"Date",d[D]=f+"Date",d[P]=f+"Month",d[S]=f+"FullYear",d[g]=f+"Hours",d[a]=f+"Minutes",d[h]=f+"Seconds",d[u]=f+"Milliseconds",d)[m],v=m===y?this.$D+(c-this.$W):c;if(m===P||m===S){var E=this.clone().set(D,1);E.$d[i](v),E.init(),this.$d=E.set(D,Math.min(this.$D,E.daysInMonth())).$d}else i&&this.$d[i](v);return this.init(),this},C.set=function(b,c){return this.clone().$set(b,c)},C.get=function(b){return this[W.p(b)]()},C.add=function(b,c){var d,m=this;b=Number(b);var f=W.p(c),i=function(j){var Q=K(m);return W.w(Q.date(Q.date()+Math.round(j*b)),m)};if(f===P)return this.set(P,this.$M+b);if(f===S)return this.set(S,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,c){return this.add(-1*b,c)},C.format=function(b){var c=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,Q=d.months,J=d.meridiem,te=function(ie,ue,A,L){return ie&&(ie[ue]||ie(c,m))||A[ue].slice(0,L)},Z=function(ie){return W.s(i%12||12,ie,"0")},ae=J||function(ie,ue,A){var L=ie<12?"AM":"PM";return A?L.toLowerCase():L};return m.replace(z,(function(ie,ue){return ue||(function(A){switch(A){case"YY":return String(c.$y).slice(-2);case"YYYY":return W.s(c.$y,4,"0");case"M":return E+1;case"MM":return W.s(E+1,2,"0");case"MMM":return te(d.monthsShort,E,Q,3);case"MMMM":return te(Q,E);case"D":return c.$D;case"DD":return W.s(c.$D,2,"0");case"d":return String(c.$W);case"dd":return te(d.weekdaysMin,c.$W,j,2);case"ddd":return te(d.weekdaysShort,c.$W,j,3);case"dddd":return j[c.$W];case"H":return String(i);case"HH":return W.s(i,2,"0");case"h":return Z(1);case"hh":return Z(2);case"a":return ae(i,v,!0);case"A":return ae(i,v,!1);case"m":return String(v);case"mm":return W.s(v,2,"0");case"s":return String(c.$s);case"ss":return W.s(c.$s,2,"0");case"SSS":return W.s(c.$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,c,d){var m,f=this,i=W.p(c),v=K(b),E=(v.utcOffset()-this.utcOffset())*n,j=this-v,Q=function(){return W.m(f,v)};switch(i){case S:m=Q()/12;break;case P:m=Q();break;case x:m=Q()/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,c){if(!b)return this.$L;var d=this.clone(),m=H(b,c,!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()},k})(),se=oe.prototype;return K.prototype=se,[["$ms",u],["$s",h],["$m",a],["$H",g],["$W",y],["$M",P],["$y",S],["$D",D]].forEach((function(k){se[k[1]]=function(C){return this.$g(C,k[0],k[1])}})),K.extend=function(k,C){return k.$i||(k(C,oe,K),k.$i=!0),K},K.locale=H,K.isDayjs=V,K.unix=function(k){return K(1e3*k)},K.en=re[ee],K.Ls=re,K.p={},K}))})(lr)),lr.exports}var Pl=kl();const de=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 h=Ml({direction:e,size:u,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:u}):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 sn({controlsRef:t,levelIndex:e,rowIndex:r,cellIndex:n,event:s}){const u=Ol(s.key);if(u){s.preventDefault();const h=Al(t);Go({controlsRef:t,direction:u,levelIndex:e,rowIndex:r,cellIndex:n,size:h})}}function qe(t){return t==null||t===""?t:de(t).format("YYYY-MM-DD")}function Qo(t){return t==null||t===""?t:de(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 dt(){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:qe;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 $l=T.createVarsResolver((t,{size:e})=>({day:{"--day-size":T.getSize(e,"day-size")}})),an=T.factory((t,e)=>{const r=T.useProps("Day",null,t),{classNames:n,className:s,style:u,styles:h,unstyled:a,vars:g,date:y,disabled:_,__staticSelector:P,weekend:x,outside:S,selected:D,renderDay:O,inRange:N,firstInRange:z,lastInRange:F,hidden:q,static:U,highlightToday:ee,attributes:re,...X}=r,V=T.useStyles({name:P||"Day",classes:Jo,props:r,className:s,style:u,classNames:n,styles:h,unstyled:a,attributes:re,vars:g,varsResolver:$l,rootSelector:"day"});return w.jsx(T.UnstyledButton,{...V("day",{style:q?{display:"none"}:void 0}),component:U?"div":"button",ref:e,disabled:_,"data-today":de(y).isSame(new Date,"day")||void 0,"data-hidden":q||void 0,"data-highlight-today":ee||void 0,"data-disabled":_||void 0,"data-weekend":!_&&!S&&x||void 0,"data-outside":!_&&S||void 0,"data-selected":!_&&D||void 0,"data-in-range":N&&!_||void 0,"data-first-in-range":z&&!_||void 0,"data-last-in-range":F&&!_||void 0,"data-static":U||void 0,unstyled:a,...X,children:O?.(y)||de(y).date()})});an.classes=Jo,an.displayName="@mantine/dates/Day";function Rl({locale:t,format:e="dd",firstDayOfWeek:r=1}){const n=de().day(r),s=[];for(let u=0;u<7;u+=1)typeof e=="string"?s.push(de(n).add(u,"days").locale(t).format(e)):s.push(e(de(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)}})),ln=T.factory((t,e)=>{const r=T.useProps("WeekdaysRow",null,t),{classNames:n,className:s,style:u,styles:h,unstyled:a,vars:g,locale:y,firstDayOfWeek:_,weekdayFormat:P,cellComponent:x="th",__staticSelector:S,withWeekNumbers:D,attributes:O,...N}=r,z=T.useStyles({name:S||"WeekdaysRow",classes:Xo,props:r,className:s,style:u,classNames:n,styles:h,unstyled:a,attributes:O,vars:g,varsResolver:Nl,rootSelector:"weekdaysRow"}),F=dt(),q=Rl({locale:F.getLocale(y),format:P,firstDayOfWeek:F.getFirstDayOfWeek(_)}).map((U,ee)=>w.jsx(x,{...z("weekday"),children:U},ee));return w.jsxs(T.Box,{component:"tr",ref:e,...z("weekdaysRow"),...N,children:[D&&w.jsx(x,{...z("weekday"),children:"#"}),q]})});ln.classes=Xo,ln.displayName="@mantine/dates/WeekdaysRow";function Ll(t,e=1){let r=de(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=de(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=de(t).subtract(de(t).date()-1,"day"),s=de(n.format("YYYY-M-D")),u=s.format("YYYY-MM-DD"),h=s.add(+s.daysInMonth()-1,"day").format("YYYY-MM-DD"),a=Ll(h,e),g=[];let y=de(Bl(u,e));for(;de(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 x=de(P).add(1,"day");for(;g.length<6;){const S=[];for(let D=0;D<7;D+=1)S.push(x.format("YYYY-MM-DD")),x=x.add(1,"day");g.push(S)}}return g}function un(t,e){return de(t).format("YYYY-MM")===de(e).format("YYYY-MM")}function es(t,e){return e?de(t).isAfter(de(e).subtract(1,"day"),"day"):!0}function ts(t,e){return e?de(t).isBefore(de(e).add(1,"day"),"day"):!0}function Yl({dates:t,minDate:e,maxDate:r,getDayProps:n,excludeDate:s,hideOutsideDates:u,month:h}){const a=t.flat().filter(_=>ts(_,r)&&es(_,e)&&!s?.(_)&&!n?.(_)?.disabled&&(!u||un(_,h))),g=a.find(_=>n?.(_)?.selected);if(g)return g;const y=a.find(_=>de().isSame(_,"date"));return y||a[0]}var ur={exports:{}},zl=ur.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 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,x,S,D=h(this),O=(_=this.isoWeekYear(),P=this.$u,x=(P?u.utc:u)().year(_).startOf("year"),S=4-x.isoWeekday(),x.isoWeekday()>4&&(S+=7),x.add(S,r));return D.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(),x=!!P.u(_)||_;return P.p(y)==="isoweek"?x?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):g.bind(this)(y,_)}}}))})(ur)),ur.exports}var Wl=Fl();const Ul=An(Wl);de.extend(Ul);function ql(t){const e=t.find(r=>de(r).day()===1);return de(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")}})),cr=T.factory((t,e)=>{const r=T.useProps("Month",Vl,t),{classNames:n,className:s,style:u,styles:h,unstyled:a,vars:g,__staticSelector:y,locale:_,firstDayOfWeek:P,weekdayFormat:x,month:S,weekendDays:D,getDayProps:O,excludeDate:N,minDate:z,maxDate:F,renderDay:q,hideOutsideDates:U,hideWeekdays:ee,getDayAriaLabel:re,static:X,__getDayRef:V,__onDayKeyDown:H,__onDayClick:K,__onDayMouseEnter:W,__preventFocus:oe,__stopPropagation:se,withCellSpacing:k,size:C,highlightToday:b,withWeekNumbers:c,attributes:d,...m}=r,f=T.useStyles({name:y||"Month",classes:ns,props:r,className:s,style:u,classNames:n,styles:h,unstyled:a,attributes:d,vars:g,varsResolver:Hl,rootSelector:"month"}),i=dt(),v=Il({month:S,firstDayOfWeek:i.getFirstDayOfWeek(P),consistentWeeks:i.consistentWeeks}),E=Yl({dates:v,minDate:qe(z),maxDate:qe(F),getDayProps:O,excludeDate:N,hideOutsideDates:U,month:S}),{resolvedClassNames:j,resolvedStyles:Q}=T.useResolvedStylesApi({classNames:n,styles:h,props:r}),J=v.map((te,Z)=>{const ae=te.map((ie,ue)=>{const A=!un(ie,S),L=re?.(ie)||de(ie).locale(_||i.locale).format("D MMMM YYYY"),$=O?.(ie),I=de(ie).isSame(E,"date");return w.jsx("td",{...f("monthCell"),"data-with-spacing":k||void 0,children:w.jsx(an,{__staticSelector:y||"Month",classNames:j,styles:Q,unstyled:a,"data-mantine-stop-propagation":se||void 0,highlightToday:b,renderDay:q,date:ie,size:C,weekend:i.getWeekendDays(D).includes(de(ie).get("day")),outside:A,hidden:U?A:!1,"aria-label":L,static:X,disabled:N?.(ie)||!ts(ie,qe(F))||!es(ie,qe(z)),ref:Y=>{Y&&V?.(Z,ue,Y)},...$,onKeyDown:Y=>{$?.onKeyDown?.(Y),H?.(Y,{rowIndex:Z,cellIndex:ue,date:ie})},onMouseEnter:Y=>{$?.onMouseEnter?.(Y),W?.(Y,ie)},onClick:Y=>{$?.onClick?.(Y),K?.(Y,ie)},onMouseDown:Y=>{$?.onMouseDown?.(Y),oe&&Y.preventDefault()},tabIndex:oe||!I?-1:0})},ie.toString())});return w.jsxs("tr",{...f("monthRow"),children:[c&&w.jsx("td",{...f("weekNumber"),children:ql(te)}),ae]},Z)});return w.jsxs(T.Box,{component:"table",...f("month"),size:C,ref:e,...m,children:[!ee&&w.jsx("thead",{...f("monthThead"),children:w.jsx(ln,{__staticSelector:y||"Month",locale:_,firstDayOfWeek:P,weekdayFormat:x,size:C,classNames:j,styles:Q,unstyled:a,withWeekNumbers:c})}),w.jsx("tbody",{...f("monthTbody"),children:J})]})});cr.classes=ns,cr.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")}})),dr=T.factory((t,e)=>{const r=T.useProps("PickerControl",null,t),{classNames:n,className:s,style:u,styles:h,unstyled:a,vars:g,firstInRange:y,lastInRange:_,inRange:P,__staticSelector:x,selected:S,disabled:D,attributes:O,...N}=r,z=T.useStyles({name:x||"PickerControl",classes:os,props:r,className:s,style:u,classNames:n,styles:h,unstyled:a,attributes:O,vars:g,varsResolver:Gl,rootSelector:"pickerControl"});return w.jsx(T.UnstyledButton,{...z("pickerControl"),ref:e,unstyled:a,"data-picker-control":!0,"data-selected":S&&!D||void 0,"data-disabled":D||void 0,"data-in-range":P&&!D&&!S||void 0,"data-first-in-range":y&&!D||void 0,"data-last-in-range":_&&!D||void 0,disabled:D,...N})});dr.classes=os,dr.displayName="@mantine/dates/PickerControl";function ss({year:t,minDate:e,maxDate:r}){return!e&&!r?!1:!!(e&&de(t).isBefore(e,"year")||r&&de(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),u=s.find(a=>n?.(a)?.selected);if(u)return u;const h=s.find(a=>de().isSame(a,"year"));return h||s[0]}function is(t){const e=de(t).year(),r=e-e%10;let n=0;const s=[[],[],[],[]];for(let u=0;u<4;u+=1){const h=u===3?1:3;for(let a=0;a<h;a+=1)s[u].push(de(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},hr=T.factory((t,e)=>{const r=T.useProps("YearsList",Zl,t),{classNames:n,className:s,style:u,styles:h,unstyled:a,vars:g,decade:y,yearsListFormat:_,locale:P,minDate:x,maxDate:S,getYearControlProps:D,__staticSelector:O,__getControlRef:N,__onControlKeyDown:z,__onControlClick:F,__onControlMouseEnter:q,__preventFocus:U,__stopPropagation:ee,withCellSpacing:re,size:X,attributes:V,...H}=r,K=T.useStyles({name:O||"YearsList",classes:as,props:r,className:s,style:u,classNames:n,styles:h,unstyled:a,attributes:V,vars:g,rootSelector:"yearsList"}),W=dt(),oe=is(y),se=Ql({years:oe,minDate:x,maxDate:S,getYearControlProps:D}),k=oe.map((C,b)=>{const c=C.map((d,m)=>{const f=D?.(d),i=de(d).isSame(se,"year");return w.jsx("td",{...K("yearsListCell"),"data-with-spacing":re||void 0,children:w.jsx(dr,{...K("yearsListControl"),size:X,unstyled:a,"data-mantine-stop-propagation":ee||void 0,disabled:ss({year:d,minDate:x,maxDate:S}),ref:v=>{v&&N?.(b,m,v)},...f,onKeyDown:v=>{f?.onKeyDown?.(v),z?.(v,{rowIndex:b,cellIndex:m,date:d})},onClick:v=>{f?.onClick?.(v),F?.(v,d)},onMouseEnter:v=>{f?.onMouseEnter?.(v),q?.(v,d)},onMouseDown:v=>{f?.onMouseDown?.(v),U&&v.preventDefault()},tabIndex:U||!i?-1:0,children:de(d).locale(W.getLocale(P)).format(_)})},m)});return w.jsx("tr",{...K("yearsListRow"),children:c},b)});return w.jsx(T.Box,{component:"table",ref:e,size:X,...K("yearsList"),...H,children:w.jsx("tbody",{children:k})})});hr.classes=as,hr.displayName="@mantine/dates/YearsList";function ls({month:t,minDate:e,maxDate:r}){return!e&&!r?!1:!!(e&&de(t).isBefore(e,"month")||r&&de(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),u=s.find(a=>n?.(a)?.selected);if(u)return u;const h=s.find(a=>de().isSame(a,"month"));return h||s[0]}function Jl(t){const e=de(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(de(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},fr=T.factory((t,e)=>{const r=T.useProps("MonthsList",Xl,t),{classNames:n,className:s,style:u,styles:h,unstyled:a,vars:g,__staticSelector:y,year:_,monthsListFormat:P,locale:x,minDate:S,maxDate:D,getMonthControlProps:O,__getControlRef:N,__onControlKeyDown:z,__onControlClick:F,__onControlMouseEnter:q,__preventFocus:U,__stopPropagation:ee,withCellSpacing:re,size:X,attributes:V,...H}=r,K=T.useStyles({name:y||"MonthsList",classes:us,props:r,className:s,style:u,classNames:n,styles:h,unstyled:a,attributes:V,vars:g,rootSelector:"monthsList"}),W=dt(),oe=Jl(_),se=Kl({months:oe,minDate:qe(S),maxDate:qe(D),getMonthControlProps:O}),k=oe.map((C,b)=>{const c=C.map((d,m)=>{const f=O?.(d),i=de(d).isSame(se,"month");return w.jsx("td",{...K("monthsListCell"),"data-with-spacing":re||void 0,children:w.jsx(dr,{...K("monthsListControl"),size:X,unstyled:a,__staticSelector:y||"MonthsList","data-mantine-stop-propagation":ee||void 0,disabled:ls({month:d,minDate:qe(S),maxDate:qe(D)}),ref:v=>{v&&N?.(b,m,v)},...f,onKeyDown:v=>{f?.onKeyDown?.(v),z?.(v,{rowIndex:b,cellIndex:m,date:d})},onClick:v=>{f?.onClick?.(v),F?.(v,d)},onMouseEnter:v=>{f?.onMouseEnter?.(v),q?.(v,d)},onMouseDown:v=>{f?.onMouseDown?.(v),U&&v.preventDefault()},tabIndex:U||!i?-1:0,children:de(d).locale(W.getLocale(x)).format(P)})},m)});return w.jsx("tr",{...K("monthsListRow"),children:c},b)});return w.jsx(T.Box,{component:"table",ref:e,size:X,...K("monthsList"),...H,children:w.jsx("tbody",{children:k})})});fr.classes=us,fr.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)}})),ht=T.factory((t,e)=>{const r=T.useProps("CalendarHeader",eu,t),{classNames:n,className:s,style:u,styles:h,unstyled:a,vars:g,nextIcon:y,previousIcon:_,nextLabel:P,previousLabel:x,onNext:S,onPrevious:D,onLevelClick:O,label:N,nextDisabled:z,previousDisabled:F,hasNextLevel:q,levelControlAriaLabel:U,withNext:ee,withPrevious:re,headerControlsOrder:X,__staticSelector:V,__preventFocus:H,__stopPropagation:K,attributes:W,...oe}=r,se=T.useStyles({name:V||"CalendarHeader",classes:cs,props:r,className:s,style:u,classNames:n,styles:h,unstyled:a,attributes:W,vars:g,varsResolver:tu,rootSelector:"calendarHeader"}),k=H?m=>m.preventDefault():void 0,C=re&&G.createElement(T.UnstyledButton,{...se("calendarHeaderControl"),key:"previous","data-direction":"previous","aria-label":x,onClick:D,unstyled:a,onMouseDown:k,disabled:F,"data-disabled":F||void 0,tabIndex:H||F?-1:0,"data-mantine-stop-propagation":K||void 0},_||w.jsx(T.AccordionChevron,{...se("calendarHeaderControlIcon"),"data-direction":"previous",size:"45%"})),b=G.createElement(T.UnstyledButton,{component:q?"button":"div",...se("calendarHeaderLevel"),key:"level",onClick:q?O:void 0,unstyled:a,onMouseDown:q?k:void 0,disabled:!q,"data-static":!q||void 0,"aria-label":U,tabIndex:H||!q?-1:0,"data-mantine-stop-propagation":K||void 0},N),c=ee&&G.createElement(T.UnstyledButton,{...se("calendarHeaderControl"),key:"next","data-direction":"next","aria-label":P,onClick:S,unstyled:a,onMouseDown:k,disabled:z,"data-disabled":z||void 0,tabIndex:H||z?-1:0,"data-mantine-stop-propagation":K||void 0},y||w.jsx(T.AccordionChevron,{...se("calendarHeaderControlIcon"),"data-direction":"next",size:"45%"})),d=X.map(m=>m==="previous"?C:m==="level"?b:m==="next"?c:null);return w.jsx(T.Box,{...se("calendarHeader"),ref:e,...oe,children:d})});ht.classes=cs,ht.displayName="@mantine/dates/CalendarHeader";function ru(t){const e=is(t);return[e[0][0],e[3][0]]}const nu={decadeLabelFormat:"YYYY"},pr=T.factory((t,e)=>{const r=T.useProps("DecadeLevel",nu,t),{decade:n,locale:s,minDate:u,maxDate:h,yearsListFormat:a,getYearControlProps:g,__getControlRef:y,__onControlKeyDown:_,__onControlClick:P,__onControlMouseEnter:x,withCellSpacing:S,__preventFocus:D,nextIcon:O,previousIcon:N,nextLabel:z,previousLabel:F,onNext:q,onPrevious:U,nextDisabled:ee,previousDisabled:re,levelControlAriaLabel:X,withNext:V,withPrevious:H,headerControlsOrder:K,decadeLabelFormat:W,classNames:oe,styles:se,unstyled:k,__staticSelector:C,__stopPropagation:b,size:c,attributes:d,...m}=r,f=dt(),[i,v]=ru(n),E={__staticSelector:C||"DecadeLevel",classNames:oe,styles:se,unstyled:k,size:c,attributes:d},j=typeof ee=="boolean"?ee:h?!de(v).endOf("year").isBefore(h):!1,Q=typeof re=="boolean"?re:u?!de(i).startOf("year").isAfter(u):!1,J=(te,Z)=>de(te).locale(s||f.locale).format(Z);return w.jsxs(T.Box,{"data-decade-level":!0,size:c,ref:e,...m,children:[w.jsx(ht,{label:typeof W=="function"?W(i,v):`${J(i,W)} – ${J(v,W)}`,__preventFocus:D,__stopPropagation:b,nextIcon:O,previousIcon:N,nextLabel:z,previousLabel:F,onNext:q,onPrevious:U,nextDisabled:j,previousDisabled:Q,hasNextLevel:!1,levelControlAriaLabel:X,withNext:V,withPrevious:H,headerControlsOrder:K,...E}),w.jsx(hr,{decade:n,locale:s,minDate:u,maxDate:h,yearsListFormat:a,getYearControlProps:g,__getControlRef:y,__onControlKeyDown:_,__onControlClick:P,__onControlMouseEnter:x,__preventFocus:D,__stopPropagation:b,withCellSpacing:S,...E})]})});pr.classes={...hr.classes,...ht.classes},pr.displayName="@mantine/dates/DecadeLevel";const ou={yearLabelFormat:"YYYY"},gr=T.factory((t,e)=>{const r=T.useProps("YearLevel",ou,t),{year:n,locale:s,minDate:u,maxDate:h,monthsListFormat:a,getMonthControlProps:g,__getControlRef:y,__onControlKeyDown:_,__onControlClick:P,__onControlMouseEnter:x,withCellSpacing:S,__preventFocus:D,nextIcon:O,previousIcon:N,nextLabel:z,previousLabel:F,onNext:q,onPrevious:U,onLevelClick:ee,nextDisabled:re,previousDisabled:X,hasNextLevel:V,levelControlAriaLabel:H,withNext:K,withPrevious:W,headerControlsOrder:oe,yearLabelFormat:se,__staticSelector:k,__stopPropagation:C,size:b,classNames:c,styles:d,unstyled:m,attributes:f,...i}=r,v=dt(),E={__staticSelector:k||"YearLevel",classNames:c,styles:d,unstyled:m,size:b,attributes:f},j=typeof re=="boolean"?re:h?!de(n).endOf("year").isBefore(h):!1,Q=typeof X=="boolean"?X:u?!de(n).startOf("year").isAfter(u):!1;return w.jsxs(T.Box,{"data-year-level":!0,size:b,ref:e,...i,children:[w.jsx(ht,{label:typeof se=="function"?se(n):de(n).locale(s||v.locale).format(se),__preventFocus:D,__stopPropagation:C,nextIcon:O,previousIcon:N,nextLabel:z,previousLabel:F,onNext:q,onPrevious:U,onLevelClick:ee,nextDisabled:j,previousDisabled:Q,hasNextLevel:V,levelControlAriaLabel:H,withNext:K,withPrevious:W,headerControlsOrder:oe,...E}),w.jsx(fr,{year:n,locale:s,minDate:u,maxDate:h,monthsListFormat:a,getMonthControlProps:g,__getControlRef:y,__onControlKeyDown:_,__onControlClick:P,__onControlMouseEnter:x,__preventFocus:D,__stopPropagation:C,withCellSpacing:S,...E})]})});gr.classes={...ht.classes,...fr.classes},gr.displayName="@mantine/dates/YearLevel";const su={monthLabelFormat:"MMMM YYYY"},mr=T.factory((t,e)=>{const r=T.useProps("MonthLevel",su,t),{month:n,locale:s,firstDayOfWeek:u,weekdayFormat:h,weekendDays:a,getDayProps:g,excludeDate:y,minDate:_,maxDate:P,renderDay:x,hideOutsideDates:S,hideWeekdays:D,getDayAriaLabel:O,__getDayRef:N,__onDayKeyDown:z,__onDayClick:F,__onDayMouseEnter:q,withCellSpacing:U,highlightToday:ee,withWeekNumbers:re,__preventFocus:X,__stopPropagation:V,nextIcon:H,previousIcon:K,nextLabel:W,previousLabel:oe,onNext:se,onPrevious:k,onLevelClick:C,nextDisabled:b,previousDisabled:c,hasNextLevel:d,levelControlAriaLabel:m,withNext:f,withPrevious:i,headerControlsOrder:v,monthLabelFormat:E,classNames:j,styles:Q,unstyled:J,__staticSelector:te,size:Z,static:ae,attributes:ie,...ue}=r,A=dt(),L={__staticSelector:te||"MonthLevel",classNames:j,styles:Q,unstyled:J,size:Z,attributes:ie},$=typeof b=="boolean"?b:P?!de(n).endOf("month").isBefore(P):!1,I=typeof c=="boolean"?c:_?!de(n).startOf("month").isAfter(_):!1;return w.jsxs(T.Box,{"data-month-level":!0,size:Z,ref:e,...ue,children:[w.jsx(ht,{label:typeof E=="function"?E(n):de(n).locale(s||A.locale).format(E),__preventFocus:X,__stopPropagation:V,nextIcon:H,previousIcon:K,nextLabel:W,previousLabel:oe,onNext:se,onPrevious:k,onLevelClick:C,nextDisabled:$,previousDisabled:I,hasNextLevel:d,levelControlAriaLabel:m,withNext:f,withPrevious:i,headerControlsOrder:v,...L}),w.jsx(cr,{month:n,locale:s,firstDayOfWeek:u,weekdayFormat:h,weekendDays:a,getDayProps:g,excludeDate:y,minDate:_,maxDate:P,renderDay:x,hideOutsideDates:S,hideWeekdays:D,getDayAriaLabel:O,__getDayRef:N,__onDayKeyDown:z,__onDayClick:F,__onDayMouseEnter:q,__preventFocus:X,__stopPropagation:V,static:ae,withCellSpacing:U,highlightToday:ee,withWeekNumbers:re,...L})]})});mr.classes={...cr.classes,...ht.classes},mr.displayName="@mantine/dates/MonthLevel";var ds={levelsGroup:"m_30b26e33"};const ft=T.factory((t,e)=>{const r=T.useProps("LevelsGroup",null,t),{classNames:n,className:s,style:u,styles:h,unstyled:a,vars:g,__staticSelector:y,attributes:_,...P}=r,x=T.useStyles({name:y||"LevelsGroup",classes:ds,props:r,className:s,style:u,classNames:n,styles:h,unstyled:a,attributes:_,vars:g,rootSelector:"levelsGroup"});return w.jsx(T.Box,{ref:e,...x("levelsGroup"),...P})});ft.classes=ds,ft.displayName="@mantine/dates/LevelsGroup";const iu={numberOfColumns:1},yr=T.factory((t,e)=>{const r=T.useProps("DecadeLevelGroup",iu,t),{decade:n,locale:s,minDate:u,maxDate:h,yearsListFormat:a,getYearControlProps:g,__onControlClick:y,__onControlMouseEnter:_,withCellSpacing:P,__preventFocus:x,nextIcon:S,previousIcon:D,nextLabel:O,previousLabel:N,onNext:z,onPrevious:F,nextDisabled:q,previousDisabled:U,headerControlsOrder:ee,classNames:re,styles:X,unstyled:V,__staticSelector:H,__stopPropagation:K,numberOfColumns:W,levelControlAriaLabel:oe,decadeLabelFormat:se,size:k,vars:C,attributes:b,...c}=r,d=G.useRef([]),m=Array(W).fill(0).map((f,i)=>{const v=de(n).add(i*10,"years").format("YYYY-MM-DD");return w.jsx(pr,{size:k,yearsListFormat:a,decade:v,withNext:i===W-1,withPrevious:i===0,decadeLabelFormat:se,__onControlClick:y,__onControlMouseEnter:_,__onControlKeyDown:(E,j)=>sn({levelIndex:i,rowIndex:j.rowIndex,cellIndex:j.cellIndex,event:E,controlsRef:d}),__getControlRef:(E,j,Q)=>{Array.isArray(d.current[i])||(d.current[i]=[]),Array.isArray(d.current[i][E])||(d.current[i][E]=[]),d.current[i][E][j]=Q},levelControlAriaLabel:typeof oe=="function"?oe(v):oe,locale:s,minDate:u,maxDate:h,__preventFocus:x,__stopPropagation:K,nextIcon:S,previousIcon:D,nextLabel:O,previousLabel:N,onNext:z,onPrevious:F,nextDisabled:q,previousDisabled:U,getYearControlProps:g,__staticSelector:H||"DecadeLevelGroup",classNames:re,styles:X,unstyled:V,withCellSpacing:P,headerControlsOrder:ee,attributes:b},i)});return w.jsx(ft,{classNames:re,styles:X,__staticSelector:H||"DecadeLevelGroup",ref:e,size:k,unstyled:V,attributes:b,...c,children:m})});yr.classes={...ft.classes,...pr.classes},yr.displayName="@mantine/dates/DecadeLevelGroup";const au={numberOfColumns:1},vr=T.factory((t,e)=>{const r=T.useProps("YearLevelGroup",au,t),{year:n,locale:s,minDate:u,maxDate:h,monthsListFormat:a,getMonthControlProps:g,__onControlClick:y,__onControlMouseEnter:_,withCellSpacing:P,__preventFocus:x,nextIcon:S,previousIcon:D,nextLabel:O,previousLabel:N,onNext:z,onPrevious:F,onLevelClick:q,nextDisabled:U,previousDisabled:ee,hasNextLevel:re,headerControlsOrder:X,classNames:V,styles:H,unstyled:K,__staticSelector:W,__stopPropagation:oe,numberOfColumns:se,levelControlAriaLabel:k,yearLabelFormat:C,size:b,vars:c,attributes:d,...m}=r,f=G.useRef([]),i=Array(se).fill(0).map((v,E)=>{const j=de(n).add(E,"years").format("YYYY-MM-DD");return w.jsx(gr,{size:b,monthsListFormat:a,year:j,withNext:E===se-1,withPrevious:E===0,yearLabelFormat:C,__stopPropagation:oe,__onControlClick:y,__onControlMouseEnter:_,__onControlKeyDown:(Q,J)=>sn({levelIndex:E,rowIndex:J.rowIndex,cellIndex:J.cellIndex,event:Q,controlsRef:f}),__getControlRef:(Q,J,te)=>{Array.isArray(f.current[E])||(f.current[E]=[]),Array.isArray(f.current[E][Q])||(f.current[E][Q]=[]),f.current[E][Q][J]=te},levelControlAriaLabel:typeof k=="function"?k(j):k,locale:s,minDate:u,maxDate:h,__preventFocus:x,nextIcon:S,previousIcon:D,nextLabel:O,previousLabel:N,onNext:z,onPrevious:F,onLevelClick:q,nextDisabled:U,previousDisabled:ee,hasNextLevel:re,getMonthControlProps:g,classNames:V,styles:H,unstyled:K,__staticSelector:W||"YearLevelGroup",withCellSpacing:P,headerControlsOrder:X,attributes:d},E)});return w.jsx(ft,{classNames:V,styles:H,__staticSelector:W||"YearLevelGroup",ref:e,size:b,unstyled:K,attributes:d,...m,children:i})});vr.classes={...gr.classes,...ft.classes},vr.displayName="@mantine/dates/YearLevelGroup";const lu={numberOfColumns:1},br=T.factory((t,e)=>{const r=T.useProps("MonthLevelGroup",lu,t),{month:n,locale:s,firstDayOfWeek:u,weekdayFormat:h,weekendDays:a,getDayProps:g,excludeDate:y,minDate:_,maxDate:P,renderDay:x,hideOutsideDates:S,hideWeekdays:D,getDayAriaLabel:O,__onDayClick:N,__onDayMouseEnter:z,withCellSpacing:F,highlightToday:q,withWeekNumbers:U,__preventFocus:ee,nextIcon:re,previousIcon:X,nextLabel:V,previousLabel:H,onNext:K,onPrevious:W,onLevelClick:oe,nextDisabled:se,previousDisabled:k,hasNextLevel:C,headerControlsOrder:b,classNames:c,styles:d,unstyled:m,numberOfColumns:f,levelControlAriaLabel:i,monthLabelFormat:v,__staticSelector:E,__stopPropagation:j,size:Q,static:J,vars:te,attributes:Z,...ae}=r,ie=G.useRef([]),ue=Array(f).fill(0).map((A,L)=>{const $=de(n).add(L,"months").format("YYYY-MM-DD");return w.jsx(mr,{month:$,withNext:L===f-1,withPrevious:L===0,monthLabelFormat:v,__stopPropagation:j,__onDayClick:N,__onDayMouseEnter:z,__onDayKeyDown:(I,Y)=>sn({levelIndex:L,rowIndex:Y.rowIndex,cellIndex:Y.cellIndex,event:I,controlsRef:ie}),__getDayRef:(I,Y,ce)=>{Array.isArray(ie.current[L])||(ie.current[L]=[]),Array.isArray(ie.current[L][I])||(ie.current[L][I]=[]),ie.current[L][I][Y]=ce},levelControlAriaLabel:typeof i=="function"?i($):i,locale:s,firstDayOfWeek:u,weekdayFormat:h,weekendDays:a,getDayProps:g,excludeDate:y,minDate:_,maxDate:P,renderDay:x,hideOutsideDates:S,hideWeekdays:D,getDayAriaLabel:O,__preventFocus:ee,nextIcon:re,previousIcon:X,nextLabel:V,previousLabel:H,onNext:K,onPrevious:W,onLevelClick:oe,nextDisabled:se,previousDisabled:k,hasNextLevel:C,classNames:c,styles:d,unstyled:m,__staticSelector:E||"MonthLevelGroup",size:Q,static:J,withCellSpacing:F,highlightToday:q,withWeekNumbers:U,headerControlsOrder:b,attributes:Z},L)});return w.jsx(ft,{classNames:c,styles:d,__staticSelector:E||"MonthLevelGroup",ref:e,size:Q,attributes:Z,...ae,children:ue})});br.classes={...ft.classes,...mr.classes},br.displayName="@mantine/dates/MonthLevelGroup";const hs=t=>t==="range"?[null,null]:t==="multiple"?[]:null,fs=(t,e)=>{const r=e?Qo:qe;return Array.isArray(t)?t.map(r):r(t)};function cn({type:t,value:e,defaultValue:r,onChange:n,withTime:s=!1}){const u=G.useRef(t),[h,a,g]=Le.useUncontrolled({value:fs(e,s),defaultValue:fs(r,s),finalValue:hs(t),onChange:n});let y=h;return u.current!==t&&(u.current=t,e===void 0&&(y=r!==void 0?r:hs(t),a(y))),[y,a,g]}function dn(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 qt(t,e,r){return uu(Le.clamp(dn(t,0),dn(e,0),dn(r,2)))}const cu={maxLevel:"decade",minLevel:"month",__updateDateOnYearSelect:!0,__updateDateOnMonthSelect:!0,enableKeyboardNavigation:!0},wr=T.factory((t,e)=>{const r=T.useProps("Calendar",cu,t),{vars:n,maxLevel:s,minLevel:u,defaultLevel:h,level:a,onLevelChange:g,date:y,defaultDate:_,onDateChange:P,numberOfColumns:x,columnsToScroll:S,ariaLabels:D,nextLabel:O,previousLabel:N,onYearSelect:z,onMonthSelect:F,onYearMouseEnter:q,onMonthMouseEnter:U,headerControlsOrder:ee,__updateDateOnYearSelect:re,__updateDateOnMonthSelect:X,__setDateRef:V,__setLevelRef:H,firstDayOfWeek:K,weekdayFormat:W,weekendDays:oe,getDayProps:se,excludeDate:k,renderDay:C,hideOutsideDates:b,hideWeekdays:c,getDayAriaLabel:d,monthLabelFormat:m,nextIcon:f,previousIcon:i,__onDayClick:v,__onDayMouseEnter:E,withCellSpacing:j,highlightToday:Q,withWeekNumbers:J,monthsListFormat:te,getMonthControlProps:Z,yearLabelFormat:ae,yearsListFormat:ie,getYearControlProps:ue,decadeLabelFormat:A,classNames:L,styles:$,unstyled:I,minDate:Y,maxDate:ce,locale:o,__staticSelector:l,size:p,__preventFocus:M,__stopPropagation:R,onNextDecade:B,onPreviousDecade:le,onNextYear:he,onPreviousYear:pe,onNextMonth:ne,onPreviousMonth:fe,static:me,enableKeyboardNavigation:ge,attributes:xe,...Ce}=r,{resolvedClassNames:Se,resolvedStyles:Ye}=T.useResolvedStylesApi({classNames:L,styles:$,props:r}),[Ee,_e]=Le.useUncontrolled({value:a?qt(a,u,s):void 0,defaultValue:h?qt(h,u,s):void 0,finalValue:qt(void 0,u,s),onChange:g}),[nt,je]=cn({type:"default",value:qe(y),defaultValue:qe(_),onChange:P});G.useImperativeHandle(V,()=>ve=>{je(ve)}),G.useImperativeHandle(H,()=>ve=>{_e(ve)});const Ve={__staticSelector:l||"Calendar",styles:Ye,classNames:Se,unstyled:I,size:p,attributes:xe},ze=S||x||1,et=new Date,ot=Y&&de(et).isAfter(Y)?Y:de(et).format("YYYY-MM-DD"),$e=nt||ot,pt=()=>{const ve=de($e).add(ze,"month").format("YYYY-MM-DD");ne?.(ve),je(ve)},wt=()=>{const ve=de($e).subtract(ze,"month").format("YYYY-MM-DD");fe?.(ve),je(ve)},He=()=>{const ve=de($e).add(ze,"year").format("YYYY-MM-DD");he?.(ve),je(ve)},Ge=()=>{const ve=de($e).subtract(ze,"year").format("YYYY-MM-DD");pe?.(ve),je(ve)},Qe=()=>{const ve=de($e).add(10*ze,"year").format("YYYY-MM-DD");B?.(ve),je(ve)},st=()=>{const ve=de($e).subtract(10*ze,"year").format("YYYY-MM-DD");le?.(ve),je(ve)},gt=G.useRef(null);G.useEffect(()=>{if(!ge||me)return;const ve=De=>{if(!gt.current?.contains(document.activeElement))return;const Fe=De.ctrlKey||De.metaKey,at=De.shiftKey;switch(De.key){case"ArrowUp":Fe&&at?(De.preventDefault(),st()):Fe&&(De.preventDefault(),Ge());break;case"ArrowDown":Fe&&at?(De.preventDefault(),Qe()):Fe&&(De.preventDefault(),He());break;case"y":case"Y":Ee==="month"&&(De.preventDefault(),_e("year"));break}};return document.addEventListener("keydown",ve),()=>{document.removeEventListener("keydown",ve)}},[ge,me,Ee,He,Ge,Qe,st]);const mt=ve=>{gt.current=ve,typeof e=="function"?e(ve):e&&(e.current=ve)};return w.jsxs(T.Box,{ref:mt,size:p,"data-calendar":!0,...Ce,children:[Ee==="month"&&w.jsx(br,{month:$e,minDate:Y,maxDate:ce,firstDayOfWeek:K,weekdayFormat:W,weekendDays:oe,getDayProps:se,excludeDate:k,renderDay:C,hideOutsideDates:b,hideWeekdays:c,getDayAriaLabel:d,onNext:pt,onPrevious:wt,hasNextLevel:s!=="month",onLevelClick:()=>_e("year"),numberOfColumns:x,locale:o,levelControlAriaLabel:D?.monthLevelControl,nextLabel:D?.nextMonth??O,nextIcon:f,previousLabel:D?.previousMonth??N,previousIcon:i,monthLabelFormat:m,__onDayClick:v,__onDayMouseEnter:E,__preventFocus:M,__stopPropagation:R,static:me,withCellSpacing:j,highlightToday:Q,withWeekNumbers:J,headerControlsOrder:ee,...Ve}),Ee==="year"&&w.jsx(vr,{year:$e,numberOfColumns:x,minDate:Y,maxDate:ce,monthsListFormat:te,getMonthControlProps:Z,locale:o,onNext:He,onPrevious:Ge,hasNextLevel:s!=="month"&&s!=="year",onLevelClick:()=>_e("decade"),levelControlAriaLabel:D?.yearLevelControl,nextLabel:D?.nextYear??O,nextIcon:f,previousLabel:D?.previousYear??N,previousIcon:i,yearLabelFormat:ae,__onControlMouseEnter:U,__onControlClick:(ve,De)=>{X&&je(De),_e(qt("month",u,s)),F?.(De)},__preventFocus:M,__stopPropagation:R,withCellSpacing:j,headerControlsOrder:ee,...Ve}),Ee==="decade"&&w.jsx(yr,{decade:$e,minDate:Y,maxDate:ce,yearsListFormat:ie,getYearControlProps:ue,locale:o,onNext:Qe,onPrevious:st,numberOfColumns:x,nextLabel:D?.nextDecade??O,nextIcon:f,previousLabel:D?.previousDecade??N,previousIcon:i,decadeLabelFormat:A,__onControlMouseEnter:q,__onControlClick:(ve,De)=>{re&&je(De),_e(qt("year",u,s)),z?.(De)},__preventFocus:M,__stopPropagation:R,withCellSpacing:j,headerControlsOrder:ee,...Ve})]})});wr.classes={...yr.classes,...vr.classes,...br.classes},wr.displayName="@mantine/dates/Calendar";function du(t){const{maxLevel:e,minLevel:r,defaultLevel:n,level:s,onLevelChange:u,nextIcon:h,previousIcon:a,date:g,defaultDate:y,onDateChange:_,numberOfColumns:P,columnsToScroll:x,ariaLabels:S,nextLabel:D,previousLabel:O,onYearSelect:N,onMonthSelect:z,onYearMouseEnter:F,onMonthMouseEnter:q,onNextMonth:U,onPreviousMonth:ee,onNextYear:re,onPreviousYear:X,onNextDecade:V,onPreviousDecade:H,withCellSpacing:K,highlightToday:W,__updateDateOnYearSelect:oe,__updateDateOnMonthSelect:se,__setDateRef:k,__setLevelRef:C,withWeekNumbers:b,headerControlsOrder:c,firstDayOfWeek:d,weekdayFormat:m,weekendDays:f,getDayProps:i,excludeDate:v,renderDay:E,hideOutsideDates:j,hideWeekdays:Q,getDayAriaLabel:J,monthLabelFormat:te,monthsListFormat:Z,getMonthControlProps:ae,yearLabelFormat:ie,yearsListFormat:ue,getYearControlProps:A,decadeLabelFormat:L,allowSingleDateInRange:$,allowDeselect:I,minDate:Y,maxDate:ce,locale:o,...l}=t;return{calendarProps:{maxLevel:e,minLevel:r,defaultLevel:n,level:s,onLevelChange:u,nextIcon:h,previousIcon:a,date:g,defaultDate:y,onDateChange:_,numberOfColumns:P,columnsToScroll:x,ariaLabels:S,nextLabel:D,previousLabel:O,onYearSelect:N,onMonthSelect:z,onYearMouseEnter:F,onMonthMouseEnter:q,onNextMonth:U,onPreviousMonth:ee,onNextYear:re,onPreviousYear:X,onNextDecade:V,onPreviousDecade:H,withCellSpacing:K,highlightToday:W,__updateDateOnYearSelect:oe,__updateDateOnMonthSelect:se,__setDateRef:k,withWeekNumbers:b,headerControlsOrder:c,firstDayOfWeek:d,weekdayFormat:m,weekendDays:f,getDayProps:i,excludeDate:v,renderDay:E,hideOutsideDates:j,hideWeekdays:Q,getDayAriaLabel:J,monthLabelFormat:te,monthsListFormat:Z,getMonthControlProps:ae,yearLabelFormat:ie,yearsListFormat:ue,getYearControlProps:A,decadeLabelFormat:L,allowSingleDateInRange:$,allowDeselect:I,minDate:Y,maxDate:ce,locale:o},others:l}}function hu(t){if(t===null)return null;const e=new Date(t);return Number.isNaN(e.getTime())||!t?null:de(e).format("YYYY-MM-DD")}function fu({date:t,maxDate:e,minDate:r}){return!(t==null||Number.isNaN(new Date(t).getTime())||e&&de(t).isAfter(e,"date")||r&&de(t).isBefore(r,"date"))}const pu={valueFormat:"MMMM D, YYYY",fixOnBlur:!0,size:"sm"},_r=T.factory((t,e)=>{const r=T.useInputProps("DateInput",pu,t),{inputProps:n,wrapperProps:s,value:u,defaultValue:h,onChange:a,clearable:g,clearButtonProps:y,popoverProps:_,getDayProps:P,locale:x,valueFormat:S,dateParser:D,minDate:O,maxDate:N,fixOnBlur:z,onFocus:F,onBlur:q,onClick:U,onKeyDown:ee,readOnly:re,name:X,form:V,rightSection:H,unstyled:K,classNames:W,styles:oe,allowDeselect:se,date:k,defaultDate:C,onDateChange:b,getMonthControlProps:c,getYearControlProps:d,disabled:m,...f}=r,i=G.useRef(null),v=G.useRef(null),[E,j]=G.useState(!1),{calendarProps:Q,others:J}=du(f),te=dt(),ae=D||(ne=>{const fe=de(ne,S,te.getLocale(x)).toDate();return Number.isNaN(fe.getTime())?hu(ne):de(fe).format("YYYY-MM-DD")}),ie=se!==void 0?se:g,ue=ne=>ne?de(ne).locale(te.getLocale(x)).format(S):"",[A,L,$]=cn({type:"default",value:u,defaultValue:h,onChange:a}),[I,Y]=cn({type:"default",value:k,defaultValue:h||C,onChange:b});G.useEffect(()=>{$&&u!==null&&Y(u)},[$,u]);const[ce,o]=G.useState(ue(A));G.useEffect(()=>{o(ue(A))},[te.getLocale(x)]);const l=ne=>{const fe=ne.currentTarget.value;if(o(fe),j(!0),fe.trim()===""&&(se||g))L(null);else{const me=ae(fe);me&&fu({date:me,minDate:O,maxDate:N})&&(L(me),Y(me))}},p=ne=>{q?.(ne),j(!1),z&&o(ue(A))},M=ne=>{F?.(ne),j(!0)},R=ne=>{U?.(ne),j(!0)},B=ne=>{ne.key==="Escape"&&j(!1),ee?.(ne)},le=ne=>({...P?.(ne),selected:de(A).isSame(ne,"day"),onClick:fe=>{P?.(ne).onClick?.(fe);const me=ie&&de(A).isSame(ne,"day")?null:ne;L(me),!$&&me&&o(ue(me)),j(!1)}}),he=w.jsx(T.Input.ClearButton,{onClick:()=>{L(null),!$&&o(""),j(!1)},unstyled:K,...y}),pe=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:K,..._,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:ce,onChange:l,onBlur:p,onFocus:M,onClick:R,onKeyDown:B,readOnly:re,rightSection:H,__clearSection:he,__clearable:pe,...n,...J,disabled:m,__staticSelector:"DateInput"})}),w.jsx(T.Popover.Dropdown,{onMouseDown:ne=>ne.preventDefault(),"data-dates-dropdown":!0,ref:v,children:w.jsx(wr,{__staticSelector:"DateInput",...Q,classNames:W,styles:oe,unstyled:K,__preventFocus:!0,minDate:O,maxDate:N,locale:x,getDayProps:le,size:n.size,date:I,onDateChange:Y,getMonthControlProps:ne=>({selected:typeof A=="string"?un(ne,A):!1,...c?.(ne)}),getYearControlProps:ne=>({selected:typeof A=="string"?de(ne).isSame(A,"year"):!1,...d?.(ne)}),attributes:s.attributes})})]})}),w.jsx(Zo,{name:X,form:V,value:A,type:"default"})]})});_r.classes={...T.Input.classes,...wr.classes},_r.displayName="@mantine/dates/DateInput";function ps(t){const e=Ze.c(47),{fields:r,onClose:n,queryKey:s,apiPath:u,steps:h,onCreated:a}=t,[g,y]=G.useState(0),[_,P]=G.useState(!1),[x,S]=G.useState(),{mutateAsync:D,isError:O,error:N,isPending:z}=qo(u,s),{mutateAsync:F,isPending:q}=on(u,s),U=z||q;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 X=re;let V;e[4]!==r?(V=r.reduce(yu,{}),e[4]=r,e[5]=V):V=e[5];let H;e[6]!==r?(H=r.filter(mu).reduce(gu,{}),e[6]=r,e[7]=H):H=e[7];let K;e[8]!==V||e[9]!==H?(K={mode:"uncontrolled",initialValues:V,validate:H},e[8]=V,e[9]=H,e[10]=K):K=e[10];const W=On.useForm(K);let oe;e[11]!==W||e[12]!==x?(oe=function(i){const v=W.getValues();return i.conditional&&!i.conditional(v)?null:w.jsxs(G.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(_r,{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(),...x&&{id:x}},W.setValues,P,{error:W.getInputProps(i.id).error,required:i.required})]},i.id)},e[11]=W,e[12]=x,e[13]=oe):oe=e[13];const se=oe;let k;e[14]!==N?.message||e[15]!==N?.name||e[16]!==O?(k=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]=k):k=e[17];let C;e[18]!==g||e[19]!==D||e[20]!==W||e[21]!==O||e[22]!==n||e[23]!==a||e[24]!==x||e[25]!==X.length||e[26]!==F?(C=W.onSubmit(async f=>{if(x)await F({...f,id:x});else{const i=await D(f);S(i.id),a?.(i.id)}X.length&&g<X.length-1?O||y(g+1):O||(W.setInitialValues(f),W.reset(),n())}),e[18]=g,e[19]=D,e[20]=W,e[21]=O,e[22]=n,e[23]=a,e[24]=x,e[25]=X.length,e[26]=F,e[27]=C):C=e[27];let b;e[28]!==g||e[29]!==r||e[30]!==se||e[31]!==h||e[32]!==X?(b=X.length?w.jsx(T.Stepper,{active:g,size:"sm",children:X.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=>se(i))},f))}):r.map(f=>se(f)),e[28]=g,e[29]=r,e[30]=se,e[31]=h,e[32]=X,e[33]=b):b=e[33];let c;e[34]!==g||e[35]!==_||e[36]!==U||e[37]!==n||e[38]!==X.length?(c=!_&&w.jsxs(T.Group,{mt:"md",justify:"end",children:[w.jsx(T.Button,{onClick:()=>X.length?g===0?n():y(g-1):n(),variant:"outline",children:X.length?g===0?"Abbrechen":"Zurück":"Abbrechen"}),w.jsx(T.Button,{type:"submit",loading:U,children:X.length?g===X.length-1?"Speichern":"Weiter":"Speichern"})]}),e[34]=g,e[35]=_,e[36]=U,e[37]=n,e[38]=X.length,e[39]=c):c=e[39];let d;e[40]!==c||e[41]!==C||e[42]!==b?(d=w.jsxs("form",{onSubmit:C,children:[b,c]}),e[40]=c,e[41]=C,e[42]=b,e[43]=d):d=e[43];let m;return e[44]!==d||e[45]!==k?(m=w.jsxs(w.Fragment,{children:[k,d]}),e[44]=d,e[45]=k,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,hn]=T.createSafeContext("useDataTableColumnsContext must be used within DataTableColumnProvider"),gs=t=>{let{children:e,columnsOrder:r,setColumnsOrder:n,columnsToggle:s,setColumnsToggle:u,resetColumnsOrder:h,resetColumnsToggle:a,setColumnWidth:g,setMultipleColumnWidths:y,resetColumnsWidth:_}=t,[P,x]=G.useState(""),[S,D]=G.useState("");return w.jsx(wu,{value:{sourceColumn:P,setSourceColumn:x,targetColumn:S,setTargetColumn:D,columnsToggle:s,setColumnsToggle:u,swapColumns:()=>{if(!r||!n||!P||!S)return;let O=r.indexOf(P),N=r.indexOf(S);if(O!==-1&&N!==-1){let z=r.splice(O,1)[0];r.splice(N,0,z),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,x){let S=[];return P.forEach(D=>{x.find(O=>O.accessor===D)&&S.push(D)}),x.forEach(D=>{S.includes(D.accessor)||S.push(D.accessor)}),S}let s=e&&e.map(P=>P.accessor)||[],[u,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:u,setColumnsOrder:a,resetColumnsOrder:g};let y=n(u,e),_=JSON.stringify(u);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 u=G.useRef(!1),h=G.useRef({}),[a,g]=G.useState(!0),y=G.useMemo(()=>e.some(H=>H.resizable&&!H.hidden&&H.accessor!=="__selection__"),[e]),_=G.useMemo(()=>e.filter(H=>H.resizable&&!H.hidden&&H.accessor!=="__selection__"),[e]),P=G.useMemo(()=>_.some(H=>H.width===void 0||H.width===""||H.width==="initial"),[_]),x=G.useCallback(()=>e.filter(H=>H.accessor!=="__selection__").map(H=>({[H.accessor]:H.width??"auto"})),[e]),[S,D]=Le.useLocalStorage({key:t?`${t}-columns-width`:"",defaultValue:t?x():void 0,getInitialValueInEffect:!1}),[O,N]=G.useState(()=>x());G.useEffect(()=>{g(!1)},[]);let z=G.useCallback(()=>{if(!n?.current||a)return{};let H=n.current,K=Array.from(H.querySelectorAll("th[data-accessor]")),W={};return K.forEach(oe=>{let se=oe.getAttribute("data-accessor");if(!se||se==="__selection__")return;let k=_.find(C=>C.accessor===se);if(k&&(k.width===void 0||k.width===""||k.width==="initial")){let C=oe.getBoundingClientRect();W[se]=Math.round(C.width)}}),W},[n,_,a]),F=G.useCallback(H=>{let K=H.filter(oe=>oe.accessor!=="__selection__"),W=O.map(oe=>{let se=Object.keys(oe)[0],k=K.find(C=>C.accessor===se);return k?{[se]:k.width}:oe});N(W),t&&D(W)},[O,t,D]),q=G.useCallback(H=>{F(H)},[F]),U=G.useCallback(()=>{if(!(!n?.current||!s||a))if(P)s(!1),requestAnimationFrame(()=>{requestAnimationFrame(()=>{let H=z();h.current={...h.current,...H};let K=e.filter(W=>W.accessor!=="__selection__").map(W=>{let oe=W.accessor,se=S?.find(C=>Object.keys(C)[0]===oe);if(se&&se[oe]!=="auto")return{[oe]:se[oe]};let k=H[oe];return k?{[oe]:`${k}px`}:{[oe]:W.width??"auto"}});N(K),setTimeout(()=>{s(!0),u.current=!0},10)})});else{let H=e.filter(K=>K.accessor!=="__selection__").map(K=>({[K.accessor]:K.width??"auto"}));N(H),s(!0),u.current=!0}},[n,s,a,P,z,e,S]),ee=U;G.useEffect(()=>{if(!y||!s||a){s?.(!1);return}u.current=!1;let H=setTimeout(()=>{U()},50);return()=>clearTimeout(H)},[y,s,a,U]),G.useEffect(()=>{a||!t||!r||S&&S.length>0&&N(S)},[a,t,r,S]);let re=G.useCallback(()=>{t&&D(x()),h.current={},u.current=!1,s&&(s(!1),setTimeout(()=>{U()},10))},[t,D,x,s,U]),X=G.useCallback((H,K)=>{F([{accessor:H,width:K}])},[F]),V=G.useMemo(()=>y?O.filter(H=>{let K=Object.keys(H)[0];return _.some(W=>W.accessor===K)}).every(H=>{let K=Object.values(H)[0];return K==="auto"||K==="initial"}):!1,[y,O,_]);return{columnsWidth:O,setColumnsWidth:F,setColumnWidth:X,setMultipleColumnWidths:q,resetColumnsWidth:re,hasResizableColumns:y,allResizableWidthsInitial:V,measureAndSetColumnWidths:ee}}function ku({key:t,columns:e=[],getInitialValueInEffect:r=!0}){function n(P,x){let S=[];return P.forEach(D=>{x.find(O=>O.accessor===D.accessor)&&S.push(D)}),x.forEach(D=>{S.find(O=>O.accessor===D.accessor)||S.push({accessor:D.accessor,defaultToggle:D.defaultToggle||!0,toggleable:D.toggleable,toggled:D.defaultToggle===void 0?!0:D.defaultToggle})}),S}let s=e&&e.map(P=>({accessor:P.accessor,defaultToggle:P.defaultToggle||!0,toggleable:P.toggleable,toggled:P.defaultToggle===void 0?!0:P.defaultToggle})),[u,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:u,setColumnsToggle:a,resetColumnsToggle:g};let y=n(u,e),_=JSON.stringify(u);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:u})=>{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:x,setColumnsWidth:S,setColumnWidth:D,setMultipleColumnWidths:O,resetColumnsWidth:N,hasResizableColumns:z,allResizableWidthsInitial:F,measureAndSetColumnWidths:q}=Du({key:t,columns:e,getInitialValueInEffect:r,headerRef:n,onFixedLayoutChange:u});return{effectiveColumns:G.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:x.find(ee=>ee[U?.accessor])?.[U?.accessor]}):e,[e,h,y,x]),setColumnsOrder:a,columnsOrder:h,resetColumnsOrder:g,columnsToggle:y,setColumnsToggle:_,resetColumnsToggle:P,columnsWidth:x,setColumnsWidth:S,setColumnWidth:D,setMultipleColumnWidths:O,resetColumnsWidth:N,hasResizableColumns:z,allResizableWidthsInitial:F,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 Xe(t,e,r){t?.style.setProperty(e,r)}function fn(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 pn(t,e,r){if(t){let n=new ResizeObserver(s=>{let u=s[0];u&&e(fn(u))});return n.observe(t),()=>{n.disconnect(),r()}}}function Mu({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:h,footer:a,selectionColumnHeader:g}=r,y=ys({withRowBorders:e}),_=ys(t),P=G.useRef(()=>{}),x=G.useRef(()=>{}),S=G.useCallback(D=>{_.current.onScroll?.(D),P.current()},[]);return G.useEffect(()=>pn(h.current,D=>{Xe(n.current,vs,`${D.height}px`)},()=>Xe(n.current,vs,"0")),[h.current]),G.useEffect(()=>pn(a.current,D=>{Xe(n.current,bs,`${D.height}px`)},()=>Xe(n.current,bs,"0")),[a.current]),G.useEffect(()=>pn(g.current,D=>{Xe(n.current,ws,`${D.width}px`)},()=>Xe(n.current,ws,"0")),[g.current]),ms(()=>{if(typeof window===void 0)return;let D={top:!0,bottom:!0,left:!0,right:!0},O={width:0,height:0},N={width:0,height:0};function z(re,X){let V=D[re];return D[re]=X,Xe(n.current,`--mantine-datatable-${re}-shadow-opacity`,X?"0":"1"),V}function F(){let re=O.height-N.height,X=re<0;Xe(n.current,"--mantine-datatable-footer-position",X?"relative":"sticky"),Xe(n.current,"--mantine-datatable-footer-bottom",X?`${re}px`:"0")}function q(){y.current.withRowBorders&&O.height<N.height?Xe(n.current,_s,`${T.rem("1px")} solid var(--mantine-datatable-border-color)`):Xe(n.current,_s,"unset")}x.current=q;function U(){let re=_.current,X=u.current,V=X?.scrollTop??0,H=X?.scrollLeft??0,K=V===0,W=O.height-V-N.height<1,oe=z("top",K),se=z("bottom",W);K&&K!==oe&&re.onScrollToTop?.(),W&&W!==se&&re.onScrollToBottom?.();let k=X?getComputedStyle(X).direction==="rtl":!1,C=(X?.scrollWidth??0)-N.width,b,c;if(k){let f=Math.abs(H);c=f<1,b=C-f<1}else b=H<1,c=O.width-H-N.width<1;let d=z("left",b),m=z("right",c);b&&b!==d&&re.onScrollToLeft?.(),c&&c!==m&&re.onScrollToRight?.()}P.current=U;let ee=new ResizeObserver(re=>{for(let X of re)switch(X.target.tagName){case"TABLE":{O=fn(X);break}case"DIV":{N=fn(X);break}}U(),F(),q()});return ee.observe(s.current),ee.observe(u.current),()=>{ee.disconnect()}},[]),ms(()=>{x.current()},[e]),{refs:r,onScroll:S}}function Ou(t){let[e,r]=G.useState(null),n=t?.join(":")||"";return G.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]=G.useState(r?e:Eu(t,e)),u=G.useRef(null);return G.useEffect(()=>{if("matchMedia"in window)return u.current=t.map(h=>window.matchMedia(h)),s(u.current.map(h=>h.matches)),Au(u.current,h=>{s(h)})},[t]),n}function ju(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 Tu(r,n)}function Cr(t){let e=T.useMantineTheme(),r=typeof t=="function"?t(e):t;return Le.useMediaQuery(r||"",!0)}function gn(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 mn(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 yn(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(...yn(r.groups));return e.filter(r=>r!=null)}function vn(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+vn(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,u,h=G.useState(n);if(t){let{expandable:a,trigger:g,allowMultiple:y,collapseProps:_,content:P}=t;t.expanded?{recordIds:s,onRecordIdsChange:u}=t.expanded:[s,u]=h;let x=S=>u?.(s.filter(D=>D!==Ie(S,r)));return{expandOnClick:g!=="always"&&g!=="never",isRowExpanded:S=>g==="always"?!0:s.includes(Ie(S,r)),isExpandable:({record:S,index:D})=>a?a({record:S,index:D}):!0,expandRow:S=>{let D=Ie(S,r);u?.(y?[...s,D]:[D])},collapseRow:x,collapseProps:_,content:({record:S,index:D})=>()=>P({record:S,index:D,collapse:()=>x(S)})}}}function Lu(t,e){let[r,n]=G.useState(t),[s,u]=G.useState(t),h=Le.useTimeout(()=>n(!0),0),a=Le.useTimeout(()=>u(!1),e||200);return G.useEffect(()=>{t?(a.clear(),u(!0),h.start()):(h.clear(),n(!1),a.start())},[h,a,t]),{expanded:r,visible:s}}var bn="mantine-datatable-nowrap",wn="mantine-datatable-ellipsis",Mt="mantine-datatable-pointer-cursor",Ds="mantine-datatable-context-menu-cursor",Bu="mantine-datatable-text-selection-disabled",xr="mantine-datatable-text-align-left",Sr="mantine-datatable-text-align-center",Dr="mantine-datatable-text-align-right";function Iu({className:t,style:e,visibleMediaQuery:r,title:n,noWrap:s,ellipsis:u,textAlign:h,width:a}){return Cr(r)?w.jsx(T.TableTh,{className:Pe({[bn]:s||u,[wn]:u,[xr]:h==="left",[Sr]:h==="center",[Dr]: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:u,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:u}),r.map(({hidden:a,...g})=>{if(a)return null;let{accessor:y,visibleMediaQuery:_,textAlign:P,width:x,footer:S,footerClassName:D,footerStyle:O,noWrap:N,ellipsis:z}={...n,...g};return w.jsx(Iu,{className:D,style:O,visibleMediaQuery:_,textAlign:P,width:x,title:S,noWrap:N,ellipsis:z},y)})]})})}function Fu({group:{id:t,columns:e,groups:r,title:n,textAlign:s,className:u,style:h},maxDepth:a,currentDepth:g,previousGroups:y,isLastGroup:_,withColumnBorders:P=!1,totalTableColumns:x}){let S=G.useMemo(()=>e&&e.length>0?e:r&&r.length>0?yn([{id:t,columns:e,groups:r}]):[],[e,r,t]),D=G.useMemo(()=>S.map(({visibleMediaQuery:ee})=>ee),[S]),O=ju(D),N=G.useMemo(()=>vn({columns:e,groups:r},O),[t,e,r,O]),z=G.useMemo(()=>y.reduce((ee,re)=>ee+vn(re,O),0),[y,O]),F=r&&r.length>0?1:a-g,q=z+N<x,U=Ru(_,q,P);return N>0?w.jsx(T.TableTh,{colSpan:N,rowSpan:F>1?F:void 0,className:Pe("mantine-datatable-column-group-header-cell",{[xr]:s==="left",[Sr]:s==="center",[Dr]:s==="right","mantine-datatable-column-group-header-cell--needs-border":U},u),style:h,children:n??gn(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:u,toggle:h}]=Le.useDisclosure(!1),a=e?Uu:Wu,g=Le.useClickOutside(u);return n&&(g=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: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:u}):t})]})}var Vu=t=>{let{accessor:e,columnRef:r}=t,[n,s]=G.useState(!1),u=G.useRef(0),h=G.useRef({current:0,next:0}),{dir:a}=T.useDirection(),g=a==="rtl",{setMultipleColumnWidths:y}=hn(),_=G.useCallback(x=>{if(x.preventDefault(),x.stopPropagation(),!r.current)return;let S=r.current,D=S.nextElementSibling;for(;D;){let ee=D.getAttribute("data-accessor");if(ee&&ee!=="__selection__")break;D=D.nextElementSibling}if(!D)return;let O=D.getAttribute("data-accessor");if(!O)return;let N=O==="__selection__";s(!0),u.current=x.clientX;let z=S.offsetWidth,F=D.offsetWidth;h.current={current:z,next:F};let q=ee=>{if(!r.current)return;let re=r.current,X=re.nextElementSibling;if(!X)return;let V=ee.clientX-u.current;g&&(V=-V);let H=50,K=h.current.current-H,W=h.current.next-H,oe=Math.max(-K,Math.min(V,W)),se=h.current.current+oe,k=h.current.next-oe;re.style.width=`${se}px`,X.style.width=`${k}px`,re.style.minWidth=`${se}px`,re.style.maxWidth=`${se}px`,X.style.minWidth=`${k}px`,X.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 X=parseInt(ee.style.width)||ee.offsetWidth,V=re?parseInt(re.style.width)||re.offsetWidth:0,H=[{accessor:e,width:`${X}px`}];if(re&&!N){let K=re.getAttribute("data-accessor");K&&H.push({accessor:K,width:`${V}px`})}setTimeout(()=>{y(H)},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,g,y]),P=G.useCallback(()=>{if(!r.current)return;let x=r.current,S=x.nextElementSibling;x.style.width="",x.style.minWidth="",x.style.maxWidth="";let D=[{accessor:e,width:"auto"}];if(S){S.style.width="",S.style.minWidth="",S.style.maxWidth="";let O=S.getAttribute("data-accessor");O&&O!=="__selection__"&&D.push({accessor:O,width:"auto"})}setTimeout(()=>{y(D)},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:x=>x.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:u,draggable:h,toggleable:a,resizable:g,sortIcons:y,textAlign:_,width:P,sortStatus:x,onSortStatusChange:S,filter:D,filterPopoverProps:O,filterPopoverDisableClickOutside:N,filtering:z,sortKey:F}){let{setSourceColumn:q,setTargetColumn:U,swapColumns:ee,setColumnsToggle:re}=hn(),[X,V]=G.useState(!1),H=G.useRef(null);if(!Cr(n))return null;let K=s??gn(r),W=typeof K=="string"?K:void 0,oe=u&&S?m=>{m?.defaultPrevented||S({sortKey:F,columnAccessor:r,direction:x?.columnAccessor===r?x.direction==="asc"?"desc":"asc":x?.direction??"asc"})}:void 0,se=m=>{m.stopPropagation(),q(r),V(!1)},k=m=>{m.preventDefault(),U(r),V(!0)},C=()=>{U(r),V(!1),ee()},b=()=>{V(!0)},c=()=>{V(!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":u,"mantine-datatable-header-cell-toggleable":a,"mantine-datatable-header-cell-resizable":g},t),style:[{width:P,...g?{}:{minWidth:P,maxWidth:P}},e],role:u?"button":void 0,tabIndex:u?0:void 0,onClick:oe,onKeyDown:m=>m.key==="Enter"&&oe?.(),ref:H,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":X}),draggable:h,onDragStart:h?se:void 0,onDragEnter:h?b:void 0,onDragOver:h?k:void 0,onDrop:h?C:void 0,onDragLeave:h?c: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",{[xr]:_==="left",[Sr]:_==="center",[Dr]:_==="right"},bn,wn),title:W,children:K})]}),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,u||x?.columnAccessor===r?w.jsx(w.Fragment,{children:x?.columnAccessor===r?w.jsx(T.Center,{className:Pe("mantine-datatable-header-cell-sortable-icon",{"mantine-datatable-header-cell-sortable-icon-reversed":x.direction==="desc"}),role:"img","aria-label":`Sorted ${x.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,D?w.jsx(qu,{filterPopoverProps:O,isActive:!!z,filterPopoverDisableClickOutside:N,children:D}):null]}),g&&r!=="__selection__"?w.jsx(Vu,{accessor:r,columnRef:H}):null]})}function Ju({className:t,style:e,trigger:r,shadowVisible:n,checked:s,indeterminate:u,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",{[Mt]: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:Mt}:void 0,checked:s,indeterminate:u,onChange:a,...h,disabled:!(a||h.onChange)||h.disabled})})}function Xu({selectionColumnHeaderRef:t,className:e,style:r,sortStatus:n,sortIcons:s,onSortStatusChange:u,columns:h,defaultColumnProps:a,groups:g,selectionTrigger:y,selectionVisible:_,selectionChecked:P,selectionIndeterminate:x,onSelectionChange:S,selectionCheckboxProps:D,selectorCellShadowVisible:O,selectionColumnClassName:N,selectionColumnStyle:z,withColumnBorders:F=!1,ref:q}){let U=g?xs(g):0,ee=U>0?U+1:1,re=_?w.jsx(Ju,{ref:t,className:N,style:z,trigger:y,shadowVisible:O,checked:P,indeterminate:x,checkboxProps:D,onChange:S,rowSpan:g?ee:void 0}):null,{columnsToggle:X,setColumnsToggle:V}=hn(),[H,K]=G.useState(!1),W=h.some(k=>k.toggleable),oe=W?Object.fromEntries(h.map(({accessor:k,title:C})=>[k,C??gn(String(k))])):void 0,se=w.jsxs(T.TableThead,{className:Pe("mantine-datatable-header",e),style:r,ref:q,onContextMenu:W?k=>{k.preventDefault(),K(C=>!C)}:void 0,children:[g&&Array.from({length:U},(k,C)=>{let b=Ss(g,C);return w.jsxs(T.TableTr,{children:[C===0&&re,b.map((c,d)=>w.jsx(Fu,{group:c,maxDepth:U,currentDepth:C,previousGroups:b.slice(0,d),isLastGroup:d===b.length-1,withColumnBorders:F,totalTableColumns:h.length},c.id))]},`group-depth-${C}`)}),w.jsxs(T.TableTr,{children:[!g&&re,h.map(({hidden:k,...C},b)=>{if(k)return null;let{accessor:c,visibleMediaQuery:d,textAlign:m,width:f,title:i,sortable:v,draggable:E,toggleable:j,resizable:Q,titleClassName:J,titleStyle:te,filter:Z,filterPopoverProps:ae,filterPopoverDisableClickOutside:ie,filtering:ue,sortKey:A}={...a,...C};return w.jsx(Ku,{accessor:c,className:J,style:te,visibleMediaQuery:d,textAlign:m,width:f,title:i,sortable:v,draggable:E,toggleable:j,resizable:Q&&b<h.length-1,sortStatus:n,sortIcons:s,sortKey:A,onSortStatusChange:u,filter:Z,filterPopoverProps:ae,filterPopoverDisableClickOutside:ie,filtering:ue},c)})]})]});return W?w.jsxs(T.Popover,{position:"bottom",withArrow:!0,shadow:"md",opened:H,onChange:K,children:[w.jsx(T.PopoverTarget,{children:se}),w.jsx(T.PopoverDropdown,{children:w.jsx(T.Stack,{children:X.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:oe[k.accessor],checked:k.toggled,onChange:C=>{V(X.map(b=>b.accessor===k.accessor?{...b,toggled:C.currentTarget.checked}:b))}})},k.accessor))})})]}):se}function ec({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 Ae(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:u,highlightOnHoverColor:h}){return{"--mantine-datatable-color-light":Ae(e,t,"light"),"--mantine-datatable-color-dark":Ae(e,t,"dark"),"--mantine-datatable-background-color-light":Ae(r,t,"light"),"--mantine-datatable-background-color-dark":Ae(r,t,"dark"),"--mantine-datatable-border-color-light":Ae(n,t,"light"),"--mantine-datatable-border-color-dark":Ae(n,t,"dark"),"--mantine-datatable-row-border-color-light":Ae(s,t,"light"),"--mantine-datatable-row-border-color-dark":Ae(s,t,"dark"),"--mantine-datatable-striped-color-light":Ae(u,t,"light"),"--mantine-datatable-striped-color-dark":Ae(u,t,"dark"),"--mantine-datatable-highlight-on-hover-color-light":Ae(h,t,"light"),"--mantine-datatable-highlight-on-hover-color-dark":Ae(h,t,"dark")}}function ks({theme:t,paginationActiveTextColor:e,paginationActiveBackgroundColor:r}){return{"--mantine-datatable-pagination-active-text-color-light":Ae(e,t,"light"),"--mantine-datatable-pagination-active-text-color-dark":Ae(e,t,"dark"),"--mantine-datatable-pagination-active-background-color-light":Ae(r,t,"light"),"--mantine-datatable-pagination-active-background-color-dark":Ae(r,t,"dark")}}function rc({theme:t,color:e,backgroundColor:r}){return{"--mantine-datatable-row-color-light":Ae(e,t,"light"),"--mantine-datatable-row-color-dark":Ae(e,t,"dark"),"--mantine-datatable-row-background-color-light":Ae(r,t,"light"),"--mantine-datatable-row-background-color-dark":Ae(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:u,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||u)?y=>ks({theme:y,paginationActiveTextColor:s,paginationActiveBackgroundColor:u}):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:u,paginationWithControls:h,paginationActiveTextColor:a,paginationActiveBackgroundColor:g,paginationSize:y,loadingText:_,noRecordsText:P,paginationText:x,totalRecords:S,recordsPerPage:D,onRecordsPerPageChange:O,recordsPerPageLabel:N,recordsPerPageOptions:z,recordsLength:F,horizontalSpacing:q,paginationWrapBreakpoint:U,getPaginationControlProps:ee,getPaginationItemProps:re,renderPagination:X}){let V;if(S){let C=(n-1)*D+1,b=C+(F||0)-1;V=x({from:C,to:b,totalRecords:S})}else V=r?_:P;let H=S&&D?Math.max(1,Math.ceil(S/D)):1,K=S?(n-1)*(D??0)+1:void 0,W=S?(K??1)+(F??0)-1:void 0,oe=!Cr(({breakpoints:C})=>`(min-width: ${typeof U=="number"?`${T.rem(U)}rem`:C[U]||U})`),se={Text:C=>w.jsx(T.Text,{component:"div",className:"mantine-datatable-pagination-text",size:y,...C,children:V}),PageSizeSelector:C=>z?w.jsx(oc,{activeTextColor:a,activeBackgroundColor:g,size:y,label:N,values:z,value:D,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||!F}),control:"mantine-datatable-pagination-pages-control"},style:a||g?b=>ks({theme:b,paginationActiveTextColor:a,paginationActiveBackgroundColor:g}):void 0,withEdges:u,withControls:h,value:n,onChange:s,size:y,total:H,getControlProps:ee,getItemProps:re,...C})},k={state:{paginationSize:y,page:n,totalPages:H,totalRecords:S,recordsPerPage:D,recordsLength:F,fetching:r,from:K,to:W,isWrapped:oe},actions:{setPage:C=>s?.(C),setRecordsPerPage:O?C=>O(C):void 0},Controls:se};return w.jsx(T.Box,{px:q??"xs",py:"xs",className:Pe("mantine-datatable-pagination",t),style:[{flexDirection:oe?"column":"row"},e],children:typeof X=="function"?X(k):w.jsxs(w.Fragment,{children:[w.jsx(se.Text,{}),w.jsx(se.PageSizeSelector,{}),w.jsx(se.Pagination,{})]})})}function ic({className:t,style:e,visibleMediaQuery:r,record:n,index:s,onClick:u,onDoubleClick:h,onContextMenu:a,noWrap:g,ellipsis:y,textAlign:_,width:P,accessor:x,render:S,defaultRender:D,customCellAttributes:O}){return Cr(r)?w.jsx(T.TableTd,{className:Pe({[bn]:g||y,[wn]:y,[Mt]:u||h,[Ds]:a,[xr]:_==="left",[Sr]:_==="center",[Dr]:_==="right"},t),style:[{width:P,minWidth:P,maxWidth:P},e],onClick:u,onDoubleClick:h,onContextMenu:a,...O?.(n,s),children:S?S(n,s):D?D(n,s,x):Cs(n,x)}):null}function ac({open:t,colSpan:e,content:r,collapseProps:n}){let{expanded:s,visible:u}=Lu(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 lc({className:t,style:e,record:r,index:n,trigger:s,onChange:u,withRightShadow:h,checkboxProps:a,getCheckboxProps:g,...y}){let _={...a,...g(r,n)},P=!y.disabled&&!_.disabled,x=S=>{S.stopPropagation(),s==="cell"&&P&&u?.(S)};return w.jsx(T.TableTd,{className:Pe("mantine-datatable-row-selector-cell",{[Mt]:s==="cell"&&P},t),style:e,"data-shadow-visible":h||void 0,onClick:x,children:w.jsx(T.Checkbox,{classNames:P?{input:Mt}:void 0,onChange:u,...y,..._})})}function uc({record:t,index:e,columns:r,defaultColumnProps:n,defaultColumnRender:s,selectionTrigger:u,selectionVisible:h,selectionChecked:a,onSelectionChange:g,isRecordSelectable:y,selectionCheckboxProps:_,getSelectionCheckboxProps:P,onClick:x,onDoubleClick:S,onContextMenu:D,onCellClick:O,onCellDoubleClick:N,onCellContextMenu:z,expansion:F,customAttributes:q,color:U,backgroundColor:ee,className:re,style:X,selectorCellShadowVisible:V,selectionColumnClassName:H,selectionColumnStyle:K,rowFactory:W}){let oe=w.jsxs(w.Fragment,{children:[h&&w.jsx(lc,{className:H,style:K,record:t,index:e,trigger:u,withRightShadow:V,checked:a,disabled:!g||(y?!y(t,e):!1),onChange:g,checkboxProps:_,getCheckboxProps:P}),r.map(({hidden:C,hiddenContent:b,...c},d)=>{if(C||b)return null;let{accessor:m,visibleMediaQuery:f,textAlign:i,noWrap:v,ellipsis:E,width:j,render:Q,cellsClassName:J,cellsStyle:te,customCellAttributes:Z}={...n,...c};return w.jsx(ic,{className:typeof J=="function"?J(t,e):J,style:te?.(t,e),visibleMediaQuery:f,record:t,index:e,onClick:O?ae=>O({event:ae,record:t,index:e,column:c,columnIndex:d}):void 0,onDoubleClick:N?ae=>N({event:ae,record:t,index:e,column:c,columnIndex:d}):void 0,onContextMenu:z?ae=>z({event:ae,record:t,index:e,column:c,columnIndex:d}):void 0,accessor:m,textAlign:i,noWrap:v,ellipsis:E,width:j,render:Q,defaultRender:s,customCellAttributes:Z},m)})]}),se=F&&w.jsx(ac,{colSpan:r.filter(({hidden:C})=>!C).length+(h?1:0),open:F.isRowExpanded(t),content:F.content({record:t,index:e}),collapseProps:F.collapseProps}),k=cc({record:t,index:e,selectionChecked:a,onClick:x,onDoubleClick:S,onContextMenu:D,expansion:F,customAttributes:q,color:U,backgroundColor:ee,className:re,style:X});return W?W({record:t,index:e,rowProps:k,children:oe,expandedElement:se}):w.jsxs(w.Fragment,{children:[w.jsx(T.TableTr,{...k,children:oe}),se]})}function cc({record:t,index:e,selectionChecked:r,onClick:n,onDoubleClick:s,onContextMenu:u,expansion:h,customAttributes:a,color:g,backgroundColor:y,className:_,style:P}){return{className:Pe("mantine-datatable-row",{[Mt]:n||s||h?.isExpandable({record:t,index:e})&&h?.expandOnClick},{[Ds]:u},typeof _=="function"?_(t,e):_),"data-selected":r||void 0,onClick:x=>{if(h){let{isExpandable:S,isRowExpanded:D,expandOnClick:O,expandRow:N,collapseRow:z}=h;S({record:t,index:e})&&O&&(D(t)?z(t):N(t))}n?.({event:x,record:t,index:e})},onDoubleClick:s?x=>s({event:x,record:t,index:e}):void 0,onContextMenu:u?x=>u({event:x,record:t,index:e}):void 0,style:[g||y?x=>{let S=g?.(t,e),D=y?.(t,e);return rc({theme:x,color:S,backgroundColor:D})}:void 0,P?.(t,e)],...a?.(t,e)??{}}}function dc({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 hc({withTableBorder:t,borderRadius:e,textSelectionDisabled:r,height:n="100%",minHeight:s,maxHeight:u,shadow:h,verticalAlign:a="center",fetching:g,columns:y,storeColumnsKey:_,groups:P,pinFirstColumn:x,pinLastColumn:S,defaultColumnProps:D,defaultColumnRender:O,idAccessor:N="id",records:z,selectionTrigger:F="checkbox",selectedRecords:q,onSelectedRecordsChange:U,selectionColumnClassName:ee,selectionColumnStyle:re,isRecordSelectable:X,selectionCheckboxProps:V,allRecordsSelectionCheckboxProps:H={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:K=(rt,Vt)=>({"aria-label":`Select record ${Vt+1}`}),sortStatus:W,sortIcons:oe,onSortStatusChange:se,horizontalSpacing:k,page:C,onPageChange:b,totalRecords:c,recordsPerPage:d,onRecordsPerPageChange:m,recordsPerPageOptions:f,recordsPerPageLabel:i="Records per page",paginationWithEdges:v,paginationWithControls:E,paginationActiveTextColor:j,paginationActiveBackgroundColor:Q,paginationSize:J="sm",paginationText:te=({from:rt,to:Vt,totalRecords:Cn})=>`${rt} - ${Vt} / ${Cn}`,paginationWrapBreakpoint:Z="sm",getPaginationControlProps:ae=rt=>rt==="previous"?{"aria-label":"Previous page"}:rt==="next"?{"aria-label":"Next page"}:{},getPaginationItemProps:ie,renderPagination:ue,loaderBackgroundBlur:A,customLoader:L,loaderSize:$,loaderType:I,loaderColor:Y,loadingText:ce="...",emptyState:o,noRecordsText:l="No records",noRecordsIcon:p,highlightOnHover:M,striped:R,noHeader:B,onRowClick:le,onRowDoubleClick:he,onRowContextMenu:pe,onCellClick:ne,onCellDoubleClick:fe,onCellContextMenu:me,onScroll:ge,onScrollToTop:xe,onScrollToBottom:Ce,onScrollToLeft:Se,onScrollToRight:Ye,c:Ee,backgroundColor:_e,borderColor:nt,rowBorderColor:je,stripedColor:Ve,highlightOnHoverColor:ze,rowColor:et,rowBackgroundColor:ot,rowExpansion:$e,rowClassName:pt,rowStyle:wt,customRowAttributes:He,scrollViewportRef:Ge,scrollAreaProps:Qe,tableRef:st,bodyRef:gt,m:mt,my:ve,mx:De,mt:Fe,mb:at,ml:Me,mr:Oe,className:_t,classNames:Te,style:ke,styles:Ne,rowFactory:tt,tableWrapper:yt,..._n}){let rt=G.useMemo(()=>P?yn(P):y,[y,P]),[Vt,Cn]=G.useState(!1),{refs:it,onScroll:jc}=Mu({scrollCallbacks:{onScroll:ge,onScrollToTop:xe,onScrollToBottom:Ce,onScrollToLeft:Se,onScrollToRight:Ye},withRowBorders:_n.withRowBorders}),xn=Pu({key:_,columns:rt,headerRef:it.header,scrollViewportRef:it.scrollViewport,onFixedLayoutChange:Cn}),$c=Le.useMergedRef(it.table,st),Rc=Le.useMergedRef(it.scrollViewport,Ge),Nc=Nu({rowExpansion:$e,records:z,idAccessor:N}),kr=G.useRef(!1),$s=G.useRef(C),Sn=G.useRef(z),Lc=G.useCallback(be=>{kr.current=!0,Sn.current=z,b(be)},[b,z]);G.useEffect(()=>{$s.current!==C&&(kr.current=!0,Sn.current=z,$s.current=C)},[C,z]);let Pr=z?.length;G.useLayoutEffect(()=>{if(!kr.current||g||z===Sn.current)return;let be=it.scrollViewport.current;if(!be)return;let Ct=requestAnimationFrame(()=>{be.scrollTo({top:0,left:0}),kr.current=!1});return()=>cancelAnimationFrame(Ct)},[g,z,it.scrollViewport]);let Rs=z?.map(be=>Ie(be,N)),Ot=!!q,Ht=q?.map(be=>Ie(be,N)),Ns=Rs!==void 0&&Ht!==void 0&&Ht.length>0,Dn=X?z?.filter(X):z,Mr=Dn?.map(be=>Ie(be,N)),Or=Ns&&Mr.every(be=>Ht.includes(be)),Bc=Ns&&Mr.some(be=>Ht.includes(be)),Ic=G.useCallback(()=>{q&&U&&U(Or?q.filter(be=>!Mr.includes(Ie(be,N))):mn([...q,...Dn],be=>Ie(be,N)))},[Or,N,U,Mr,Dn,q]),{lastSelectionChangeIndex:Ar,setLastSelectionChangeIndex:Yc}=Ou(Rs),kn=Ot&&!x,zc={m:mt,my:ve,mx:De,mt:Fe,mb:at,ml:Me,mr:Oe},Fc=G.useCallback(({children:be})=>yt?yt({children:be}):be,[yt]);return w.jsx(gs,{...xn,children:w.jsxs(T.Box,{ref:it.root,...zc,className:Pe("mantine-datatable",{"mantine-datatable-with-border":t},_t,Te?.root),style:[be=>({...tc({theme:be,c:Ee,backgroundColor:_e,borderColor:nt,rowBorderColor:je,stripedColor:Ve,highlightOnHoverColor:ze}),borderRadius:be.radius[e]||e,boxShadow:be.shadows[h]||h,height:n,minHeight:s,maxHeight:u}),ke,Ne?.root,{position:"relative"}],children:[w.jsx(dc,{viewportRef:Rc,leftShadowBehind:Ot||!!x,rightShadowBehind:S,onScrollPositionChange:jc,scrollAreaProps:Qe,children:w.jsx(Fc,{children:w.jsxs(T.Table,{ref:$c,horizontalSpacing:k,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":S,"mantine-datatable-selection-column-visible":Ot,"mantine-datatable-pin-first-column":x,"mantine-datatable-resizable-columns":xn.hasResizableColumns&&Vt},Te?.table),style:{...Ne?.table},"data-striped":Pr&&R||void 0,"data-highlight-on-hover":M||void 0,..._n,children:[B?null:w.jsx(gs,{...xn,children:w.jsx(Xu,{ref:it.header,selectionColumnHeaderRef:it.selectionColumnHeader,className:Te?.header,style:Ne?.header,columns:rt,defaultColumnProps:D,groups:P,sortStatus:W,sortIcons:oe,onSortStatusChange:se,selectionTrigger:F,selectionVisible:Ot,selectionChecked:Or,selectionIndeterminate:Bc&&!Or,onSelectionChange:Ic,selectionCheckboxProps:{...V,...H},selectorCellShadowVisible:kn,selectionColumnClassName:ee,selectionColumnStyle:re,withColumnBorders:_n.withColumnBorders})}),w.jsx("tbody",{ref:gt,children:Pr?z.map((be,Ct)=>{let Pn=Ie(be,N),Mn=Ht?.includes(Pn)||!1,Ls;return U&&q&&(Ls=Wc=>{if(Wc.nativeEvent.shiftKey&&Ar!==null){let At=z.filter(Ct>Ar?(xt,St)=>St>=Ar&&St<=Ct&&(X?X(xt,St):!0):(xt,St)=>St>=Ct&&St<=Ar&&(X?X(xt,St):!0));U(Mn?$u(q,At,xt=>Ie(xt,N)):mn([...q,...At],xt=>Ie(xt,N)))}else U(Mn?q.filter(At=>Ie(At,N)!==Pn):mn([...q,be],At=>Ie(At,N)));Yc(Ct)}),w.jsx(uc,{record:be,index:Ct,columns:rt,defaultColumnProps:D,defaultColumnRender:O,selectionTrigger:F,selectionVisible:Ot,selectionChecked:Mn,onSelectionChange:Ls,isRecordSelectable:X,selectionCheckboxProps:V,getSelectionCheckboxProps:K,onClick:le,onDoubleClick:he,onCellClick:ne,onCellDoubleClick:fe,onContextMenu:pe,onCellContextMenu:me,expansion:Nc,color:et,backgroundColor:ot,className:pt,style:wt,customAttributes:He,selectorCellShadowVisible:kn,selectionColumnClassName:ee,selectionColumnStyle:re,idAccessor:N,rowFactory:tt},Pn)}):w.jsx(_u,{})}),rt.some(({footer:be})=>be)&&w.jsx(zu,{ref:it.footer,className:Te?.footer,style:Ne?.footer,columns:rt,defaultColumnProps:D,selectionVisible:Ot,selectorCellShadowVisible:kn})]})})}),C&&w.jsx(sc,{className:Te?.pagination,style:Ne?.pagination,horizontalSpacing:k,fetching:g,page:C,onPageChange:Lc,totalRecords:c,recordsPerPage:d,onRecordsPerPageChange:m,recordsPerPageOptions:f,recordsPerPageLabel:i,paginationWithEdges:v,paginationWithControls:E,paginationActiveTextColor:j,paginationActiveBackgroundColor:Q,paginationSize:J,paginationText:te,paginationWrapBreakpoint:Z,getPaginationControlProps:ae,getPaginationItemProps:ie,noRecordsText:l,loadingText:ce,recordsLength:Pr,renderPagination:ue}),w.jsx(ec,{fetching:g,backgroundBlur:A,customContent:L,size:$,type:I,color:Y}),w.jsx(xu,{icon:p,text:l,active:!g&&!Pr,children:o})]})})}function Ms(t){const e=Ze.c(41),{fields:r,onClose:n,queryKey:s,apiPath:u,id:h,steps:a}=t,[g,y]=G.useState(0),[_,P]=G.useState(!1),{data:x,isLoading:S}=Wo(u,s,h),{mutateAsync:D,isError:O,error:N,isPending:z}=on(u,s);let F;e[0]!==r?(F=new Set(r.filter(vc).map(yc)),e[0]=r,e[1]=F):F=e[1];let q;e[2]!==F?(q=[...F],e[2]=F,e[3]=q):q=e[3];const U=q;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 X;e[8]!==ee||e[9]!==re?(X={mode:"uncontrolled",initialValues:ee,validate:re},e[8]=ee,e[9]=re,e[10]=X):X=e[10];const V=On.useForm(X);let H;e[11]!==x||e[12]!==r||e[13]!==V?(H=()=>{if(x){const b={...x};r.forEach(c=>{const d=c.id;c.type==="boolean"&&b[d]===null?b[d]=!1:c.type==="date"&&b[d]?b[d]=new Date(b[d]):b[d]===null&&(b[d]="")}),V.initialize(b),V.setValues(b)}},e[11]=x,e[12]=r,e[13]=V,e[14]=H):H=e[14];let K;e[15]!==x?(K=[x],e[15]=x,e[16]=K):K=e[16],G.useEffect(H,K);let W;e[17]!==V||e[18]!==h?(W=function(c){const d=V.getValues();return c.conditional&&!c.conditional(d)?null:w.jsxs(G.Fragment,{children:[(c.type===void 0||c.type=="text")&&w.jsx(T.TextInput,{label:c.column.title,placeholder:c.placeholder??"",...V.getInputProps(c.id),type:c.id.includes("email")?"email":void 0,required:c.required},V.key(c.id)),c.type==="number"&&w.jsx(T.NumberInput,{decimalSeparator:",",label:c.column.title,placeholder:c.placeholder??"",...V.getInputProps(c.id),required:c.required},V.key(c.id)),c.type==="date"&&w.jsx(_r,{label:c.column.title,placeholder:c.placeholder??"",valueFormat:"DD.MM.YYYY",clearable:!0,...V.getInputProps(c.id),required:c.required},V.key(c.id)),c.type==="boolean"&&w.jsx(T.Checkbox,{mt:"md",label:c.column.title,...V.getInputProps(c.id,{type:"checkbox"}),required:c.required},V.key(c.id)),c.type==="textarea"&&w.jsx(T.Textarea,{label:c.column.title,placeholder:c.placeholder??"",...V.getInputProps(c.id),minRows:3,autosize:!0,required:c.required},V.key(c.id)),c.type==="custom"&&c.render&&c.render({...V.getValues(),id:h},V.setValues,P,{error:V.getInputProps(c.id).error,required:c.required})]},c.id)},e[17]=V,e[18]=h,e[19]=W):W=e[19];const oe=W;let se;e[20]!==O||e[21]!==N?.message||e[22]!==N?.name?(se=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]=se):se=e[23];let k;e[24]!==g||e[25]!==r||e[26]!==V||e[27]!==_||e[28]!==h||e[29]!==S||e[30]!==z||e[31]!==O||e[32]!==n||e[33]!==oe||e[34]!==a||e[35]!==U||e[36]!==D?(k=S?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:V.onSubmit(async b=>{await D({...b,id:h}),U.length&&g<U.length-1?O||y(g+1):O||(V.setInitialValues(b),V.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(c=>c.step===b).map(c=>oe(c))},b))}):r.map(b=>oe(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:z,children:U.length?g===U.length-1?"Speichern":"Weiter":"Speichern"})]})]}),e[24]=g,e[25]=r,e[26]=V,e[27]=_,e[28]=h,e[29]=S,e[30]=z,e[31]=O,e[32]=n,e[33]=oe,e[34]=a,e[35]=U,e[36]=D,e[37]=k):k=e[37];let C;return e[38]!==k||e[39]!==se?(C=w.jsxs(w.Fragment,{children:[se,k]}),e[38]=k,e[39]=se,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:u,error:h,isPending:a}=Vo(e,t),[g,y]=G.useState(n),[_,P]=G.useState(!1),x=_||a;return G.useEffect(()=>{g.length||r()},[r,g]),g.length?w.jsxs(w.Fragment,{children:[u&&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:x,children:"Abbrechen"}),w.jsx(T.Button,{color:"red",loading:x,onClick:async()=>{P(!0);try{await Promise.all(g.map(S=>s(S.id))),y([])}finally{P(!1)}},children:"Löschen"})]})]}):w.jsx(w.Fragment,{})}function As(t,e){const r=Ze.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,u]=G.useState(n);let h;r[3]!==e?(h=y=>{u(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),u={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")u.number++;else if(typeof g=="string"){const y=g.trim();if(y!==""&&!isNaN(Number(y))&&!isNaN(parseFloat(y))){u.number++;return}if(h.some(_=>_.test(y))){const _=new Date(y);if(!isNaN(_.getTime())){u.date++;return}}u.string++}else g instanceof Date?u.date++:u.string++});const a=u.string+u.number+u.date;return u.date/a>=.6?"date":u.number/a>=.6?"number":u.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 x,S;switch(s){case"date":if(typeof g=="string"){const F=new Date(g.trim());x=isNaN(F.getTime())?null:F.getTime()}else g instanceof Date?x=g.getTime():x=null;if(typeof y=="string"){const F=new Date(y.trim());S=isNaN(F.getTime())?null:F.getTime()}else y instanceof Date?S=y.getTime():S=null;break;case"number":if(typeof g=="number")x=g;else{const F=String(g).trim(),q=parseFloat(F);x=isNaN(q)?null:q}if(typeof y=="number")S=y;else{const F=String(y).trim(),q=parseFloat(F);S=isNaN(q)?null:q}break;case"string":const D=typeof g=="string"?g:String(g),O=typeof y=="string"?y:String(y);x=D.toLowerCase().trim(),S=O.toLowerCase().trim();break;case"mixed":default:const N=String(g),z=String(y);x=N.toLowerCase().trim(),S=z.toLowerCase().trim();break}return x===null&&S===null?0:x===null?r==="asc"?1:-1:S===null||x<S?r==="asc"?-1:1:x>S?r==="asc"?1:-1:0})},js=[10,15,50,100,500];function wc(t){const e=Ze.c(111),{title:r,queryKey:n,connectedQueryKeys:s,apiPath:u,buttons:h,fields:a,selection:g,pagination:y,filters:_,actions:P,steps:x,defaultSort:S,onSortChange:D,createButtonText:O,queryParams:N,tabs:z,defaultTab:F,activeTab:q,onActiveTabChange:U,canUpdate:ee,canDelete:re,showRefresh:X,rowExpansion:V}=t,H=X===void 0?!0:X,[K,W]=G.useState(F||(z&&z.length>0?z[0].value:null)),oe=q!==void 0?q:K;let se;e[0]!==q||e[1]!==U?(se=Me=>{q===void 0&&W(Me),U&&U(Me)},e[0]=q,e[1]=U,e[2]=se):se=e[2];const k=se,C=z?.find(Me=>Me.value===oe)?.queryParams||{},b={...N,...C},c=b?"?"+Object.entries(b).filter(Ec).map(Ac).join("&"):"";let d;e[3]!==oe||e[4]!==n?(d=oe?[...n,oe]:n,e[3]=oe,e[4]=n,e[5]=d):d=e[5];const m=d,{data:f,isLoading:i,isError:v,isRefetching:E,refetch:j}=Uo(u+c,m),{queryClient:Q}=ct();let J,te;e[6]!==f||e[7]!==s||e[8]!==Q?(J=()=>{!f||!Array.isArray(f)||s?.forEach(Me=>Q.invalidateQueries({queryKey:Me}))},te=[f,s,Q],e[6]=f,e[7]=s,e[8]=Q,e[9]=J,e[10]=te):(J=e[9],te=e[10]),G.useEffect(J,te);const Z=!f||!Array.isArray(f)?[]:!_||_.length===0?f:f.filter(Me=>_.every(Oe=>{if(Oe.value===void 0)return!0;const _t=Oe.id;if(Oe.type==="query"){const Te=Me[_t];return Array.isArray(Oe.value)?Array.isArray(Te)?Te.some(ke=>{if(typeof ke=="string"||typeof ke=="number")return Oe.value.includes(String(ke));if(ke&&typeof ke=="object"){if("id"in ke&&Oe.value.includes(ke.id))return!0;for(const Ne in ke){const tt=ke[Ne];if(typeof tt=="string"&&Oe.value.includes(tt)||tt&&typeof tt=="object"&&"id"in tt&&Oe.value.includes(tt.id))return!0}}return!1}):Te&&typeof Te=="object"&&"id"in Te?Oe.value.includes(Te.id):!1:typeof Te=="string"&&Te.includes(Oe.value)}else if(Oe.type==="date"){const Te=Oe.value;if(!Te)return!0;const[ke,Ne]=Te;if(!ke&&!Ne)return!0;const tt=Me[_t];if(typeof tt=="string"){const yt=tt.split(" ")[0];if(ke&&Ne)return yt>=ke&&yt<=Ne;if(ke&&!Ne)return yt>=ke;if(!ke&&Ne)return yt<=Ne}return!0}else if(Oe.type==="boolean")return Me[_t]===Oe.value;return!0})),ae=S?.field??a[0].id,ie=S?.direction??"desc";let ue;e[11]!==ae||e[12]!==ie?(ue={columnAccessor:ae,direction:ie},e[11]=ae,e[12]=ie,e[13]=ue):ue=e[13];const[A,L]=G.useState(ue);let $;e[14]!==D?($=Me=>{L(Me),D&&D(String(Me.columnAccessor),Me.direction)},e[14]=D,e[15]=$):$=e[15];const I=$,Y=Ts(Z,A.columnAccessor,A.direction),[ce,o]=As(js[1],"mantine-table-page-size"),[l,p]=G.useState(1),M=y?Y.slice((l-1)*ce,l*ce):Y;let R;e[16]===Symbol.for("react.memo_cache_sentinel")?(R=[],e[16]=R):R=e[16];const[B,le]=G.useState(R);let he;e[17]===Symbol.for("react.memo_cache_sentinel")?(he=()=>{le([])},e[17]=he):he=e[17];let pe;e[18]!==oe?(pe=[oe],e[18]=oe,e[19]=pe):pe=e[19],G.useEffect(he,pe);const[ne,fe]=G.useState(!1),[me,ge]=G.useState(!1),[xe,Ce]=G.useState(!1),Se=r?"space-between":"end";let Ye;e[20]!==r?(Ye=r&&(typeof r=="string"?w.jsx(T.Title,{order:4,children:r}):r),e[20]=r,e[21]=Ye):Ye=e[21];let Ee;e[22]!==j||e[23]!==H?(Ee=H&&w.jsx(T.ActionIcon,{variant:"subtle",onClick:()=>j(),"aria-label":"Neuladen",children:w.jsx(Et.IconRefresh,{})}),e[22]=j,e[23]=H,e[24]=Ee):Ee=e[24];let _e;e[25]!==P||e[26]!==re||e[27]!==ee||e[28]!==a||e[29]!==B||e[30]!==g?(_e=(a.some(Oc)||g)&&(()=>{const Me=a.find(Mc)&&(!ee||B.length>0&&ee(B[0])),Oe=a.find(Pc)&&(!re||B.length>0&&re(B[0])),_t=(P??[]).length>0,Te=Me||Oe||_t;return w.jsxs(T.Menu,{shadow:"md",children:[w.jsx(T.Menu.Target,{children:w.jsx(T.Button,{variant:"outline",rightSection:w.jsx(Et.IconCaretDownFilled,{size:14}),disabled:!B.length||!Te,children:"Aktionen"})}),w.jsxs(T.Menu.Dropdown,{children:[Me&&w.jsx(T.Menu.Item,{leftSection:w.jsx(Et.IconPencil,{size:14}),onClick:()=>ge(!0),disabled:B.length!==1,children:"Bearbeiten"}),(P??[]).map((ke,Ne)=>G.createElement(T.Menu.Item,{...ke.icon&&{leftSection:ke.icon},key:`custom_action_${Ne}`,onClick:()=>ke.onClick(B)},ke.label)),Oe&&w.jsx(T.Menu.Item,{leftSection:w.jsx(Et.IconTrash,{size:14}),onClick:()=>Ce(!0),color:"red",children:"Löschen"})]})]})})(),e[25]=P,e[26]=re,e[27]=ee,e[28]=a,e[29]=B,e[30]=g,e[31]=_e):_e=e[31];let nt;e[32]!==O||e[33]!==a||e[34]!==i?(nt=a.find(kc)&&w.jsx(T.Button,{onClick:()=>fe(!0),disabled:i,children:O??"Erstellen"}),e[32]=O,e[33]=a,e[34]=i,e[35]=nt):nt=e[35];let je;e[36]!==h||e[37]!==Ee||e[38]!==_e||e[39]!==nt?(je=w.jsxs(T.Group,{align:"center",gap:"xs",children:[Ee,_e,nt,h]}),e[36]=h,e[37]=Ee,e[38]=_e,e[39]=nt,e[40]=je):je=e[40];let Ve;e[41]!==Se||e[42]!==Ye||e[43]!==je?(Ve=w.jsxs(T.Group,{gap:"xs",justify:Se,align:"center",children:[Ye,je]}),e[41]=Se,e[42]=Ye,e[43]=je,e[44]=Ve):Ve=e[44];let ze;e[45]!==oe||e[46]!==k||e[47]!==z?(ze=z&&z.length>0&&w.jsx(T.Tabs,{value:oe,onChange:k,mt:"md",children:w.jsx(T.Tabs.List,{children:z.map(Dc)})}),e[45]=oe,e[46]=k,e[47]=z,e[48]=ze):ze=e[48];let et;e[49]!==v?(et=v&&w.jsx(T.Alert,{mt:"md",variant:"light",color:"red",title:"Es ist ein Fehler aufgetreten.",icon:w.jsx(Et.IconInfoCircle,{}),children:"Bitte versuche es später erneut oder sende eine Nachricht an unseren Support."}),e[49]=v,e[50]=et):et=e[50];let ot;e[51]!==i||e[52]!==E?(ot=(i||E)&&w.jsxs(T.Stack,{my:"md",children:[w.jsx(T.Skeleton,{height:40}),Array(5).fill(0).map(Sc)]}),e[51]=i,e[52]=E,e[53]=ot):ot=e[53];let $e;e[54]!==a||e[55]!==I||e[56]!==v||e[57]!==i||e[58]!==E||e[59]!==l||e[60]!==ce||e[61]!==y||e[62]!==M||e[63]!==V||e[64]!==B||e[65]!==g||e[66]!==p||e[67]!==o||e[68]!==A||e[69]!==Y?($e=!i&&!E&&w.jsx(hc,{my:"md",striped:!0,minHeight:150,fetching:v,records:M,sortStatus:A,onSortStatusChange:I,...g&&{selectedRecords:B,onSelectedRecordsChange:le},...y&&M.length&&{totalRecords:Y.length,recordsPerPage:ce,onPageChange:p,page:l,recordsPerPageOptions:js,onRecordsPerPageChange:o,recordsPerPageLabel:"Einträge pro Seite"},...V&&{rowExpansion:{allowMultiple:V.allowMultiple??!1,content:Me=>{const{record:Oe}=Me;return V.content(Oe)},...V.expanded&&{expanded:V.expanded}}},columns:a.map(xc),noRecordsText:"Keine Einträge gefunden"}),e[54]=a,e[55]=I,e[56]=v,e[57]=i,e[58]=E,e[59]=l,e[60]=ce,e[61]=y,e[62]=M,e[63]=V,e[64]=B,e[65]=g,e[66]=p,e[67]=o,e[68]=A,e[69]=Y,e[70]=$e):$e=e[70];let pt;e[71]===Symbol.for("react.memo_cache_sentinel")?(pt=()=>{ge(!1),le([])},e[71]=pt):pt=e[71];const wt=r??"Bearbeiten";let He;e[72]!==u||e[73]!==a||e[74]!==n||e[75]!==B[0]||e[76]!==B.length||e[77]!==x?(He=B.length>0&&w.jsx(Ms,{fields:a.filter(Cc),queryKey:n,apiPath:u,id:B[0].id,onClose:()=>{ge(!1),le([])},steps:x}),e[72]=u,e[73]=a,e[74]=n,e[75]=B[0],e[76]=B.length,e[77]=x,e[78]=He):He=e[78];let Ge;e[79]!==wt||e[80]!==He||e[81]!==me?(Ge=w.jsx(T.Modal,{opened:me,onClose:pt,title:wt,children:He}),e[79]=wt,e[80]=He,e[81]=me,e[82]=Ge):Ge=e[82];let Qe;e[83]!==u||e[84]!==xe||e[85]!==n||e[86]!==B||e[87]!==r?(Qe=B.length>0&&w.jsx(T.Modal,{opened:xe,onClose:()=>{Ce(!1),le([])},title:r??"Löschen",children:w.jsx(Os,{onClose:()=>{Ce(!1),le([])},queryKey:n,apiPath:u,selectedRecords:B})}),e[83]=u,e[84]=xe,e[85]=n,e[86]=B,e[87]=r,e[88]=Qe):Qe=e[88];let st;e[89]===Symbol.for("react.memo_cache_sentinel")?(st=()=>{fe(!1)},e[89]=st):st=e[89];const gt=r??"Anlegen";let mt;e[90]===Symbol.for("react.memo_cache_sentinel")?(mt=()=>{fe(!1)},e[90]=mt):mt=e[90];let ve;e[91]!==a?(ve=a.filter(_c),e[91]=a,e[92]=ve):ve=e[92];let De;e[93]!==u||e[94]!==n||e[95]!==x||e[96]!==ve?(De=w.jsx(ps,{queryKey:n,apiPath:u,onClose:mt,fields:ve,steps:x}),e[93]=u,e[94]=n,e[95]=x,e[96]=ve,e[97]=De):De=e[97];let Fe;e[98]!==ne||e[99]!==gt||e[100]!==De?(Fe=w.jsx(T.Modal,{opened:ne,onClose:st,title:gt,children:De}),e[98]=ne,e[99]=gt,e[100]=De,e[101]=Fe):Fe=e[101];let at;return e[102]!==Ve||e[103]!==ze||e[104]!==et||e[105]!==ot||e[106]!==$e||e[107]!==Ge||e[108]!==Qe||e[109]!==Fe?(at=w.jsxs(w.Fragment,{children:[Ve,ze,et,ot,$e,Ge,Qe,Fe]}),e[102]=Ve,e[103]=ze,e[104]=et,e[105]=ot,e[106]=$e,e[107]=Ge,e[108]=Qe,e[109]=Fe,e[110]=at):at=e[110],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=Ze.c(5),{queryClient:r}=ct();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=bt,we.getOne=Io,we.sortData=Ts,we.updateOne=Fo,we.useAddOne=qo,we.useDataTable=ct,we.useDeleteOne=Vo,we.useGetAll=Uo,we.useGetOne=Wo,we.usePersistentState=As,we.useUpdateOne=on,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={},Bt={},ao;function ki(){if(ao)return Bt;ao=1,Bt.byteLength=a,Bt.toByteArray=y,Bt.fromByteArray=x;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(S){var k=S.length;if(k%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var M=S.indexOf("=");M===-1&&(M=k);var L=M===k?0:4-M%4;return[M,L]}function a(S){var k=h(S),M=k[0],L=k[1];return(M+L)*3/4-L}function g(S,k,M){return(k+M)*3/4-M}function y(S){var k,M=h(S),L=M[0],I=M[1],z=new r(g(S,L,I)),q=0,U=I>0?L-4:L,ee;for(ee=0;ee<U;ee+=4)k=e[S.charCodeAt(ee)]<<18|e[S.charCodeAt(ee+1)]<<12|e[S.charCodeAt(ee+2)]<<6|e[S.charCodeAt(ee+3)],z[q++]=k>>16&255,z[q++]=k>>8&255,z[q++]=k&255;return I===2&&(k=e[S.charCodeAt(ee)]<<2|e[S.charCodeAt(ee+1)]>>4,z[q++]=k&255),I===1&&(k=e[S.charCodeAt(ee)]<<10|e[S.charCodeAt(ee+1)]<<4|e[S.charCodeAt(ee+2)]>>2,z[q++]=k>>8&255,z[q++]=k&255),z}function _(S){return t[S>>18&63]+t[S>>12&63]+t[S>>6&63]+t[S&63]}function P(S,k,M){for(var L,I=[],z=k;z<M;z+=3)L=(S[z]<<16&16711680)+(S[z+1]<<8&65280)+(S[z+2]&255),I.push(_(L));return I.join("")}function x(S){for(var k,M=S.length,L=M%3,I=[],z=16383,q=0,U=M-L;q<U;q+=z)I.push(P(S,q,q+z>U?U:q+z));return L===1?(k=S[M-1],I.push(t[k>>2]+t[k<<4&63]+"==")):L===2&&(k=(S[M-2]<<8)+S[M-1],I.push(t[k>>10]+t[k>>4&63]+t[k<<2&63]+"=")),I.join("")}return Bt}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,x=r?-1:1,S=t[e+P];for(P+=x,c=S&(1<<-_)-1,S>>=-_,_+=a;_>0;c=c*256+t[e+P],P+=x,_-=8);for(h=c&(1<<-_)-1,c>>=-_,_+=n;_>0;h=h*256+t[e+P],P+=x,_-=8);if(c===0)c=1-y;else{if(c===g)return h?NaN:(S?-1:1)*(1/0);h=h+Math.pow(2,n),c=c-y}return(S?-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,x=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=n?0:c-1,k=n?1:-1,M=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+=x/g:e+=x*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+S]=a&255,S+=k,a/=256,s-=8);for(h=h<<s|a,y+=s;y>0;t[r+S]=h&255,S+=k,h/=256,y-=8);t[r+S-k]|=M*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=I,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,O){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,O):typeof l=="string"?x(o,l,p):M(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,O){return y(l),l<=0?h(o,l):p!==void 0?typeof O=="string"?h(o,l).fill(p,O):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:L(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 x(o,l,p){if((typeof p!="string"||p==="")&&(p="utf8"),!a.isEncoding(p))throw new TypeError('"encoding" must be a valid string encoding');var O=z(l,p)|0;o=h(o,O);var R=o.write(l,p);return R!==O&&(o=o.slice(0,R)),o}function S(o,l){var p=l.length<0?0:L(l.length)|0;o=h(o,p);for(var O=0;O<p;O+=1)o[O]=l[O]&255;return o}function k(o,l,p,O){if(l.byteLength,p<0||l.byteLength<p)throw new RangeError("'offset' is out of bounds");if(l.byteLength<p+(O||0))throw new RangeError("'length' is out of bounds");return p===void 0&&O===void 0?l=new Uint8Array(l):O===void 0?l=new Uint8Array(l,p):l=new Uint8Array(l,p,O),a.TYPED_ARRAY_SUPPORT?(o=l,o.__proto__=a.prototype):o=S(o,l),o}function M(o,l){if(a.isBuffer(l)){var p=L(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"||ce(l.length)?h(o,0):S(o,l);if(l.type==="Buffer"&&n(l.data))return S(o,l.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function L(o){if(o>=c())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+c().toString(16)+" bytes");return o|0}function I(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,O=l.length,R=0,F=Math.min(p,O);R<F;++R)if(o[R]!==l[R]){p=o[R],O=l[R];break}return p<O?-1:O<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 O=a.allocUnsafe(l),R=0;for(p=0;p<o.length;++p){var F=o[p];if(!a.isBuffer(F))throw new TypeError('"list" argument must be an Array of Buffers');F.copy(O,R),R+=F.length}return O};function z(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 O=!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 B(o).length;default:if(O)return A(o).length;l=(""+l).toLowerCase(),O=!0}}a.byteLength=z;function q(o,l,p){var O=!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(O)throw new TypeError("Unknown encoding: "+o);o=(o+"").toLowerCase(),O=!0}}a.prototype._isBuffer=!0;function U(o,l,p){var O=o[l];o[l]=o[p],o[p]=O}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):q.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,O,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),O===void 0&&(O=0),R===void 0&&(R=this.length),l<0||p>o.length||O<0||R>this.length)throw new RangeError("out of range index");if(O>=R&&l>=p)return 0;if(O>=R)return-1;if(l>=p)return 1;if(l>>>=0,p>>>=0,O>>>=0,R>>>=0,this===o)return 0;for(var F=R-O,se=p-l,he=Math.min(F,se),pe=this.slice(O,R),ne=o.slice(l,p),fe=0;fe<he;++fe)if(pe[fe]!==ne[fe]){F=pe[fe],se=ne[fe];break}return F<se?-1:se<F?1:0};function ee(o,l,p,O,R){if(o.length===0)return-1;if(typeof p=="string"?(O=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,O)),a.isBuffer(l))return l.length===0?-1:re(o,l,p,O,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,O,R);throw new TypeError("val must be string, number or Buffer")}function re(o,l,p,O,R){var F=1,se=o.length,he=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;F=2,se/=2,he/=2,p/=2}function pe(Se,xe){return F===1?Se[xe]:Se.readUInt16BE(xe*F)}var ne;if(R){var fe=-1;for(ne=p;ne<se;ne++)if(pe(o,ne)===pe(l,fe===-1?0:ne-fe)){if(fe===-1&&(fe=ne),ne-fe+1===he)return fe*F}else fe!==-1&&(ne-=ne-fe),fe=-1}else for(p+he>se&&(p=se-he),ne=p;ne>=0;ne--){for(var me=!0,ge=0;ge<he;ge++)if(pe(o,ne+ge)!==pe(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 X(o,l,p,O){p=Number(p)||0;var R=o.length-p;O?(O=Number(O),O>R&&(O=R)):O=R;var F=l.length;if(F%2!==0)throw new TypeError("Invalid hex string");O>F/2&&(O=F/2);for(var se=0;se<O;++se){var he=parseInt(l.substr(se*2,2),16);if(isNaN(he))return se;o[p+se]=he}return se}function H(o,l,p,O){return Y(A(l,o.length-p),o,p,O)}function V(o,l,p,O){return Y(N(l),o,p,O)}function Z(o,l,p,O){return V(o,l,p,O)}function W(o,l,p,O){return Y(B(l),o,p,O)}function le(o,l,p,O){return Y($(l,o.length-p),o,p,O)}a.prototype.write=function(o,l,p,O){if(l===void 0)O="utf8",p=this.length,l=0;else if(p===void 0&&typeof l=="string")O=l,p=this.length,l=0;else if(isFinite(l))l=l|0,isFinite(p)?(p=p|0,O===void 0&&(O="utf8")):(O=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");O||(O="utf8");for(var F=!1;;)switch(O){case"hex":return X(this,o,l,p);case"utf8":case"utf-8":return H(this,o,l,p);case"ascii":return V(this,o,l,p);case"latin1":case"binary":return Z(this,o,l,p);case"base64":return W(this,o,l,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return le(this,o,l,p);default:if(F)throw new TypeError("Unknown encoding: "+O);O=(""+O).toLowerCase(),F=!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 O=[],R=l;R<p;){var F=o[R],se=null,he=F>239?4:F>223?3:F>191?2:1;if(R+he<=p){var pe,ne,fe,me;switch(he){case 1:F<128&&(se=F);break;case 2:pe=o[R+1],(pe&192)===128&&(me=(F&31)<<6|pe&63,me>127&&(se=me));break;case 3:pe=o[R+1],ne=o[R+2],(pe&192)===128&&(ne&192)===128&&(me=(F&15)<<12|(pe&63)<<6|ne&63,me>2047&&(me<55296||me>57343)&&(se=me));break;case 4:pe=o[R+1],ne=o[R+2],fe=o[R+3],(pe&192)===128&&(ne&192)===128&&(fe&192)===128&&(me=(F&15)<<18|(pe&63)<<12|(ne&63)<<6|fe&63,me>65535&&me<1114112&&(se=me))}}se===null?(se=65533,he=1):se>65535&&(se-=65536,O.push(se>>>10&1023|55296),se=56320|se&1023),O.push(se),R+=he}return b(O)}var C=4096;function b(o){var l=o.length;if(l<=C)return String.fromCharCode.apply(String,o);for(var p="",O=0;O<l;)p+=String.fromCharCode.apply(String,o.slice(O,O+=C));return p}function u(o,l,p){var O="";p=Math.min(o.length,p);for(var R=l;R<p;++R)O+=String.fromCharCode(o[R]&127);return O}function d(o,l,p){var O="";p=Math.min(o.length,p);for(var R=l;R<p;++R)O+=String.fromCharCode(o[R]);return O}function m(o,l,p){var O=o.length;(!l||l<0)&&(l=0),(!p||p<0||p>O)&&(p=O);for(var R="",F=l;F<p;++F)R+=ue(o[F]);return R}function f(o,l,p){for(var O=o.slice(l,p),R="",F=0;F<O.length;F+=2)R+=String.fromCharCode(O[F]+O[F+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 O;if(a.TYPED_ARRAY_SUPPORT)O=this.subarray(o,l),O.__proto__=a.prototype;else{var R=l-o;O=new a(R,void 0);for(var F=0;F<R;++F)O[F]=this[F+o]}return O};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 O=this[o],R=1,F=0;++F<l&&(R*=256);)O+=this[o+F]*R;return O},a.prototype.readUIntBE=function(o,l,p){o=o|0,l=l|0,p||i(o,l,this.length);for(var O=this[o+--l],R=1;l>0&&(R*=256);)O+=this[o+--l]*R;return O},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 O=this[o],R=1,F=0;++F<l&&(R*=256);)O+=this[o+F]*R;return R*=128,O>=R&&(O-=Math.pow(2,8*l)),O},a.prototype.readIntBE=function(o,l,p){o=o|0,l=l|0,p||i(o,l,this.length);for(var O=l,R=1,F=this[o+--O];O>0&&(R*=256);)F+=this[o+--O]*R;return R*=128,F>=R&&(F-=Math.pow(2,8*l)),F},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,O,R,F){if(!a.isBuffer(o))throw new TypeError('"buffer" argument must be a Buffer instance');if(l>R||l<F)throw new RangeError('"value" argument is out of bounds');if(p+O>o.length)throw new RangeError("Index out of range")}a.prototype.writeUIntLE=function(o,l,p,O){if(o=+o,l=l|0,p=p|0,!O){var R=Math.pow(2,8*p)-1;v(this,o,l,p,R,0)}var F=1,se=0;for(this[l]=o&255;++se<p&&(F*=256);)this[l+se]=o/F&255;return l+p},a.prototype.writeUIntBE=function(o,l,p,O){if(o=+o,l=l|0,p=p|0,!O){var R=Math.pow(2,8*p)-1;v(this,o,l,p,R,0)}var F=p-1,se=1;for(this[l+F]=o&255;--F>=0&&(se*=256);)this[l+F]=o/se&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,O){l<0&&(l=65535+l+1);for(var R=0,F=Math.min(o.length-p,2);R<F;++R)o[p+R]=(l&255<<8*(O?R:1-R))>>>(O?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,O){l<0&&(l=4294967295+l+1);for(var R=0,F=Math.min(o.length-p,4);R<F;++R)o[p+R]=l>>>(O?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,O){if(o=+o,l=l|0,!O){var R=Math.pow(2,8*p-1);v(this,o,l,p,R-1,-R)}var F=0,se=1,he=0;for(this[l]=o&255;++F<p&&(se*=256);)o<0&&he===0&&this[l+F-1]!==0&&(he=1),this[l+F]=(o/se>>0)-he&255;return l+p},a.prototype.writeIntBE=function(o,l,p,O){if(o=+o,l=l|0,!O){var R=Math.pow(2,8*p-1);v(this,o,l,p,R-1,-R)}var F=p-1,se=1,he=0;for(this[l+F]=o&255;--F>=0&&(se*=256);)o<0&&he===0&&this[l+F+1]!==0&&(he=1),this[l+F]=(o/se>>0)-he&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 K(o,l,p,O,R,F){if(p+O>o.length)throw new RangeError("Index out of range");if(p<0)throw new RangeError("Index out of range")}function J(o,l,p,O,R){return R||K(o,l,p,4),r.write(o,l,p,O,23,4),p+4}a.prototype.writeFloatLE=function(o,l,p){return J(this,o,l,!0,p)},a.prototype.writeFloatBE=function(o,l,p){return J(this,o,l,!1,p)};function te(o,l,p,O,R){return R||K(o,l,p,8),r.write(o,l,p,O,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,O){if(p||(p=0),!O&&O!==0&&(O=this.length),l>=o.length&&(l=o.length),l||(l=0),O>0&&O<p&&(O=p),O===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(O<0)throw new RangeError("sourceEnd out of bounds");O>this.length&&(O=this.length),o.length-l<O-p&&(O=o.length-l+p);var R=O-p,F;if(this===o&&p<l&&l<O)for(F=R-1;F>=0;--F)o[F+l]=this[F+p];else if(R<1e3||!a.TYPED_ARRAY_SUPPORT)for(F=0;F<R;++F)o[F+l]=this[F+p];else Uint8Array.prototype.set.call(o,this.subarray(p,p+R),l);return R},a.prototype.fill=function(o,l,p,O){if(typeof o=="string"){if(typeof l=="string"?(O=l,l=0,p=this.length):typeof p=="string"&&(O=p,p=this.length),o.length===1){var R=o.charCodeAt(0);R<256&&(o=R)}if(O!==void 0&&typeof O!="string")throw new TypeError("encoding must be a string");if(typeof O=="string"&&!a.isEncoding(O))throw new TypeError("Unknown encoding: "+O)}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 F;if(typeof o=="number")for(F=l;F<p;++F)this[F]=o;else{var se=a.isBuffer(o)?o:A(new a(o,O).toString()),he=se.length;for(F=0;F<p-l;++F)this[F+l]=se[F%he]}return this};var G=/[^+\/0-9A-Za-z-_]/g;function ae(o){if(o=ie(o).replace(G,""),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,O=o.length,R=null,F=[],se=0;se<O;++se){if(p=o.charCodeAt(se),p>55295&&p<57344){if(!R){if(p>56319){(l-=3)>-1&&F.push(239,191,189);continue}else if(se+1===O){(l-=3)>-1&&F.push(239,191,189);continue}R=p;continue}if(p<56320){(l-=3)>-1&&F.push(239,191,189),R=p;continue}p=(R-55296<<10|p-56320)+65536}else R&&(l-=3)>-1&&F.push(239,191,189);if(R=null,p<128){if((l-=1)<0)break;F.push(p)}else if(p<2048){if((l-=2)<0)break;F.push(p>>6|192,p&63|128)}else if(p<65536){if((l-=3)<0)break;F.push(p>>12|224,p>>6&63|128,p&63|128)}else if(p<1114112){if((l-=4)<0)break;F.push(p>>18|240,p>>12&63|128,p>>6&63|128,p&63|128)}else throw new Error("Invalid code point")}return F}function N(o){for(var l=[],p=0;p<o.length;++p)l.push(o.charCodeAt(p)&255);return l}function $(o,l){for(var p,O,R,F=[],se=0;se<o.length&&!((l-=2)<0);++se)p=o.charCodeAt(se),O=p>>8,R=p%256,F.push(R),F.push(O);return F}function B(o){return e.toByteArray(ae(o))}function Y(o,l,p,O){for(var R=0;R<O&&!(R+p>=l.length||R>=o.length);++R)l[R+p]=o[R];return R}function ce(o){return o!==o}})(io)),io}Oi();var bt;if(typeof window<"u"&&window.crypto&&(bt=window.crypto),!bt&&typeof window<"u"&&window.msCrypto&&(bt=window.msCrypto),!bt&&typeof global<"u"&&global.crypto&&(bt=global.crypto),!bt&&typeof require=="function")try{bt=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 It(t){return this instanceof It?(this.v=t,this):new It(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(x){n[x]&&(s[x]=function(S){return new Promise(function(k,M){c.push([x,S,k,M])>1||a(x,S)})})}function a(x,S){try{g(n[x](S))}catch(k){P(c[0][3],k)}}function g(x){x.value instanceof It?Promise.resolve(x.value.v).then(y,_):P(c[0][2],x)}function y(x){a("next",x)}function _(x){a("throw",x)}function P(x,S){x(S),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:It(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:It,__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 Yt={},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 zt={},yo;function Zi(){if(yo)return zt;yo=1,Object.defineProperty(zt,"__esModule",{value:!0}),zt.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],x=c[6],S=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 M=this.temp[k-2],L=(M>>>17|M<<15)^(M>>>19|M<<13)^M>>>10;M=this.temp[k-15];var I=(M>>>7|M<<25)^(M>>>18|M<<14)^M>>>3;this.temp[k]=(L+this.temp[k-7]|0)+(I+this.temp[k-16]|0)}var z=(((_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7))+(_&P^~_&x)|0)+(S+(t.KEY[k]+this.temp[k]|0)|0)|0,q=((h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10))+(h&a^h&g^a&g)|0;S=x,x=P,P=_,_=y+z|0,y=g,g=a,a=h,h=z+q|0}c[0]+=h,c[1]+=a,c[2]+=g,c[3]+=y,c[4]+=_,c[5]+=P,c[6]+=x,c[7]+=S},r})();return zt.RawSha256=e,zt}var vo={},Ft={};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 Ft;bo=1,Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.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 Ft.convertToBuffer=r,Ft}var Wt={},wo;function ia(){if(wo)return Wt;wo=1,Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.isEmptyData=void 0;function t(e){return typeof e=="string"?e.length===0:e.byteLength===0}return Wt.isEmptyData=t,Wt}var Ut={},_o;function aa(){if(_o)return Ut;_o=1,Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.numToUint8=void 0;function t(e){return new Uint8Array([(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&255])}return Ut.numToUint8=t,Ut}var qt={},Co;function la(){if(Co)return qt;Co=1,Object.defineProperty(qt,"__esModule",{value:!0}),qt.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 qt.uint32ArrayFrom=t,qt}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 Yt;So=1,Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.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})();Yt.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 Yt}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 Le(){return new ye(null)}var dt,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,dt=30):Po&&ko&&navigator.appName!="Netscape"?(ye.prototype.am=fa,dt=26):(ye.prototype.am=ga,dt=28),ye.prototype.DB=dt,ye.prototype.DM=(1<<dt)-1,ye.prototype.DV=1<<dt;var Gr=52;ye.prototype.FV=Math.pow(2,Gr),ye.prototype.F1=Gr-dt,ye.prototype.F2=2*dt-Gr;var ma="0123456789abcdefghijklmnopqrstuvwxyz",nr=new Array,Dt,We;for(Dt=48,We=0;We<=9;++We)nr[Dt++]=We;for(Dt=97,We=10;We<36;++We)nr[Dt++]=We;for(Dt=65,We=10;We<36;++We)nr[Dt++]=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=Le();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=Le();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=Le());var c=Le(),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),x=this.FV/P,S=(1<<this.F1)/P,k=1<<this.F2,M=r.t,L=M-y,I=e??Le();for(c.dlShiftTo(L,I),r.compareTo(I)>=0&&(r[r.t++]=1,r.subTo(I,r)),ye.ONE.dlShiftTo(y,I),I.subTo(c,c);c.t<y;)c[c.t++]=0;for(;--L>=0;){var z=r[--M]==_?this.DM:Math.floor(r[M]*x+(r[M-1]+k)*S);if((r[M]+=c.am(0,z,r,L,0,y))<z)for(c.dlShiftTo(L,I),r.subTo(I,r);r[M]<--z;)r.subTo(I,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=Le();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=Le();return this.addTo(t,e),e}function Ya(t){var e=Le();return this.subTo(t,e),e}function za(t){var e=Le();return this.multiplyTo(t,e),e}function Fa(t){var e=Le();return this.divRemTo(t,e,null),e}function kt(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=Le();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=Le();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)}kt.prototype.convert=Wa,kt.prototype.revert=Ua,kt.prototype.reduce=qa,kt.prototype.mulTo=Ha,kt.prototype.sqrTo=Va;function Ga(t,e,r){var n=t.bitLength(),s,c=Qr(1),h=new kt(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=Le();for(h.sqrTo(a[1],P);g<=_;)a[g]=Le(),h.mulTo(P,a[g-2],a[g]),g+=2}var x=t.t-1,S,k=!0,M=Le(),L;for(n=Zr(t[x])-1;x>=0;){for(n>=y?S=t[x]>>n-y&_:(S=(t[x]&(1<<n+1)-1)<<y-n,x>0&&(S|=t[x-1]>>this.DB+n-y)),g=s;(S&1)==0;)S>>=1,--g;if((n-=g)<0&&(n+=this.DB,--x),k)a[S].copyTo(c),k=!1;else{for(;g>1;)h.sqrTo(c,M),h.sqrTo(M,c),g-=2;g>0?h.sqrTo(c,M):(L=c,c=M,M=L),h.mulTo(M,a[S],c)}for(;x>=0&&(t[x]&1<<n)==0;)h.sqrTo(c,M),L=c,c=M,M=L,--n<0&&(n=this.DB-1,--x)}var I=h.revert(c);return r(null,I),I}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,x){c.push(P=P.toLowerCase()),h.push([P,x]),a[P]=a[P]?a[P]+","+x:x}),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 x=JSON.stringify(_);/^[\{\[]/.test(x)&&(_=x)}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 S="";for(var k in P)P[k]&&(S+="; "+k,P[k]!==!0&&(S+="="+P[k].split(";")[0]));return document.cookie=y+"="+_+S}}function g(y,_){if(!(typeof document>"u")){for(var P={},x=document.cookie?document.cookie.split("; "):[],S=0;S<x.length;S++){var k=x[S].split("="),M=k.slice(1).join("=");!_&&M.charAt(0)==='"'&&(M=M.slice(1,-1));try{var L=n(k[0]);if(M=(c.read||c)(M,L)||n(M),_)try{M=JSON.parse(M)}catch{}if(P[L]=M,y===L)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",ht="name",ir="type",Jr="vendor",Xe="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,[ht,Xe,en,ir]],[$o,[Xr]],[Ro,[ir,tn,Jr]],[Kr,[ht,Xe]],[sr,[ht,Xe]]]),lr.call(t.isIgnore,[[or,[Xe,en]],[Kr,[Xe]],[sr,[Xe]]]),lr.call(t.isIgnoreRgx,[[or,/ ?browser$/i],[sr,/ ?os$/i]]),lr.call(t.toString,[[or,[ht,Xe]],[$o,[Xr]],[Ro,[Jr,tn]],[Kr,[ht,Xe]],[sr,[ht,Xe]]]),t})(),ar([ht,Xe,en,ir]),ar([Xr]),ar([tn,Jr,ir,sl,il,ll,al,ul,cl]),ar([ht,Xe]);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=I[C],d=null,m=0,f=null,i=[],v={},E=function(A,N){d=(function($){for(var B=new Array($),Y=0;Y<$;Y+=1){B[Y]=new Array($);for(var ce=0;ce<$;ce+=1)B[Y][ce]=null}return B})(m=4*b+17),j(0,0),j(m-7,0),j(0,m-7),J(),K(),G(A,N),b>=7&&te(A),f==null&&(f=ie(b,u,i)),ae(f,N)},j=function(A,N){for(var $=-1;$<=7;$+=1)if(!(A+$<=-1||m<=A+$))for(var B=-1;B<=7;B+=1)N+B<=-1||m<=N+B||(d[A+$][N+B]=0<=$&&$<=6&&(B==0||B==6)||0<=B&&B<=6&&($==0||$==6)||2<=$&&$<=4&&2<=B&&B<=4)},K=function(){for(var A=8;A<m-8;A+=1)d[A][6]==null&&(d[A][6]=A%2==0);for(var N=8;N<m-8;N+=1)d[6][N]==null&&(d[6][N]=N%2==0)},J=function(){for(var A=z.getPatternPosition(b),N=0;N<A.length;N+=1)for(var $=0;$<A.length;$+=1){var B=A[N],Y=A[$];if(d[B][Y]==null)for(var ce=-2;ce<=2;ce+=1)for(var o=-2;o<=2;o+=1)d[B+ce][Y+o]=ce==-2||ce==2||o==-2||o==2||ce==0&&o==0}},te=function(A){for(var N=z.getBCHTypeNumber(b),$=0;$<18;$+=1){var B=!A&&(N>>$&1)==1;d[Math.floor($/3)][$%3+m-8-3]=B}for($=0;$<18;$+=1)B=!A&&(N>>$&1)==1,d[$%3+m-8-3][Math.floor($/3)]=B},G=function(A,N){for(var $=u<<3|N,B=z.getBCHTypeInfo($),Y=0;Y<15;Y+=1){var ce=!A&&(B>>Y&1)==1;Y<6?d[Y][8]=ce:Y<8?d[Y+1][8]=ce:d[m-15+Y][8]=ce}for(Y=0;Y<15;Y+=1)ce=!A&&(B>>Y&1)==1,Y<8?d[8][m-Y-1]=ce:Y<9?d[8][15-Y-1+1]=ce:d[8][15-Y-1]=ce;d[m-8][8]=!A},ae=function(A,N){for(var $=-1,B=m-1,Y=7,ce=0,o=z.getMaskFunction(N),l=m-1;l>0;l-=2)for(l==6&&(l-=1);;){for(var p=0;p<2;p+=1)if(d[B][l-p]==null){var O=!1;ce<A.length&&(O=(A[ce]>>>Y&1)==1),o(B,l-p)&&(O=!O),d[B][l-p]=O,(Y-=1)==-1&&(ce+=1,Y=7)}if((B+=$)<0||m<=B){B-=$,$=-$;break}}},ie=function(A,N,$){for(var B=ee.getRSBlocks(A,N),Y=re(),ce=0;ce<$.length;ce+=1){var o=$[ce];Y.put(o.getMode(),4),Y.put(o.getLength(),z.getLengthInBits(o.getMode(),A)),o.write(Y)}var l=0;for(ce=0;ce<B.length;ce+=1)l+=B[ce].dataCount;if(Y.getLengthInBits()>8*l)throw"code length overflow. ("+Y.getLengthInBits()+">"+8*l+")";for(Y.getLengthInBits()+4<=8*l&&Y.put(0,4);Y.getLengthInBits()%8!=0;)Y.putBit(!1);for(;!(Y.getLengthInBits()>=8*l||(Y.put(236,8),Y.getLengthInBits()>=8*l));)Y.put(17,8);return(function(p,O){for(var R=0,F=0,se=0,he=new Array(O.length),pe=new Array(O.length),ne=0;ne<O.length;ne+=1){var fe=O[ne].dataCount,me=O[ne].totalCount-fe;F=Math.max(F,fe),se=Math.max(se,me),he[ne]=new Array(fe);for(var ge=0;ge<he[ne].length;ge+=1)he[ne][ge]=255&p.getBuffer()[ge+R];R+=fe;var Se=z.getErrorCorrectPolynomial(me),xe=U(he[ne],Se.getLength()-1).mod(Se);for(pe[ne]=new Array(Se.getLength()-1),ge=0;ge<pe[ne].length;ge+=1){var De=ge+xe.getLength()-pe[ne].length;pe[ne][ge]=De>=0?xe.getAt(De):0}}var qe=0;for(ge=0;ge<O.length;ge+=1)qe+=O[ge].totalCount;var Ee=new Array(qe),_e=0;for(ge=0;ge<F;ge+=1)for(ne=0;ne<O.length;ne+=1)ge<he[ne].length&&(Ee[_e]=he[ne][ge],_e+=1);for(ge=0;ge<se;ge+=1)for(ne=0;ne<O.length;ne+=1)ge<pe[ne].length&&(Ee[_e]=pe[ne][ge],_e+=1);return Ee})(Y,B)};v.addData=function(A,N){var $=null;switch(N=N||"Byte"){case"Numeric":$=X(A);break;case"Alphanumeric":$=H(A);break;case"Byte":$=V(A);break;case"Kanji":$=Z(A);break;default:throw"mode:"+N}i.push($),f=null},v.isDark=function(A,N){if(A<0||m<=A||N<0||m<=N)throw A+","+N;return d[A][N]},v.getModuleCount=function(){return m},v.make=function(){if(b<1){for(var A=1;A<40;A++){for(var N=ee.getRSBlocks(A,u),$=re(),B=0;B<i.length;B++){var Y=i[B];$.put(Y.getMode(),4),$.put(Y.getLength(),z.getLengthInBits(Y.getMode(),A)),Y.write($)}var ce=0;for(B=0;B<N.length;B++)ce+=N[B].dataCount;if($.getLengthInBits()<=8*ce)break}b=A}E(!1,(function(){for(var o=0,l=0,p=0;p<8;p+=1){E(!0,p);var O=z.getLostPoint(v);(p==0||o>O)&&(o=O,l=p)}return l})())},v.createTableTag=function(A,N){A=A||2;var $="";$+='<table style="',$+=" border-width: 0px; border-style: none;",$+=" border-collapse: collapse;",$+=" padding: 0px; margin: "+(N=N===void 0?4*A:N)+"px;",$+='">',$+="<tbody>";for(var B=0;B<v.getModuleCount();B+=1){$+="<tr>";for(var Y=0;Y<v.getModuleCount();Y+=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(B,Y)?"#000000":"#ffffff",$+=";",$+='"/>';$+="</tr>"}return($+="</tbody>")+"</table>"},v.createSvgTag=function(A,N,$,B){var Y={};typeof arguments[0]=="object"&&(A=(Y=arguments[0]).cellSize,N=Y.margin,$=Y.alt,B=Y.title),A=A||2,N=N===void 0?4*A:N,($=typeof $=="string"?{text:$}:$||{}).text=$.text||null,$.id=$.text?$.id||"qrcode-description":null,(B=typeof B=="string"?{text:B}:B||{}).text=B.text||null,B.id=B.text?B.id||"qrcode-title":null;var ce,o,l,p,O=v.getModuleCount()*A+2*N,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+=Y.scalable?"":' width="'+O+'px" height="'+O+'px"',R+=' viewBox="0 0 '+O+" "+O+'" ',R+=' preserveAspectRatio="xMinYMin meet"',R+=B.text||$.text?' role="img" aria-labelledby="'+ue([B.id,$.id].join(" ").trim())+'"':"",R+=">",R+=B.text?'<title id="'+ue(B.id)+'">'+ue(B.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+N,ce=0;ce<v.getModuleCount();ce+=1)v.isDark(o,ce)&&(R+="M"+(ce*A+N)+","+l+p);return(R+='" stroke="transparent" fill="black"/>')+"</svg>"},v.createDataURL=function(A,N){A=A||2,N=N===void 0?4*A:N;var $=v.getModuleCount()*A+2*N,B=N,Y=$-N;return oe($,$,function(ce,o){if(B<=ce&&ce<Y&&B<=o&&o<Y){var l=Math.floor((ce-B)/A),p=Math.floor((o-B)/A);return v.isDark(p,l)?0:1}return 1})},v.createImgTag=function(A,N,$){A=A||2,N=N===void 0?4*A:N;var B=v.getModuleCount()*A+2*N,Y="";return Y+="<img",Y+=' src="',Y+=v.createDataURL(A,N),Y+='"',Y+=' width="',Y+=B,Y+='"',Y+=' height="',Y+=B,Y+='"',$&&(Y+=' alt="',Y+=ue($),Y+='"'),Y+"/>"};var ue=function(A){for(var N="",$=0;$<A.length;$+=1){var B=A.charAt($);switch(B){case"<":N+="<";break;case">":N+=">";break;case"&":N+="&";break;case'"':N+=""";break;default:N+=B}}return N};return v.createASCII=function(A,N){if((A=A||1)<2)return(function(he){he=he===void 0?2:he;var pe,ne,fe,me,ge,Se=1*v.getModuleCount()+2*he,xe=he,De=Se-he,qe={"██":"█","█ ":"▀"," █":"▄"," ":" "},Ee={"██":"▀","█ ":"▀"," █":" "," ":" "},_e="";for(pe=0;pe<Se;pe+=2){for(fe=Math.floor((pe-xe)/1),me=Math.floor((pe+1-xe)/1),ne=0;ne<Se;ne+=1)ge="█",xe<=ne&&ne<De&&xe<=pe&&pe<De&&v.isDark(fe,Math.floor((ne-xe)/1))&&(ge=" "),xe<=ne&&ne<De&&xe<=pe+1&&pe+1<De&&v.isDark(me,Math.floor((ne-xe)/1))?ge+=" ":ge+="█",_e+=he<1&&pe+1>=De?Ee[ge]:qe[ge];_e+=`
|
|
20
|
+
`}return Se%2&&he>0?_e.substring(0,_e.length-Se-1)+Array(Se+1).join("▀"):_e.substring(0,_e.length-1)})(N);A-=1,N=N===void 0?2*A:N;var $,B,Y,ce,o=v.getModuleCount()*A+2*N,l=N,p=o-N,O=Array(A+1).join("██"),R=Array(A+1).join(" "),F="",se="";for($=0;$<o;$+=1){for(Y=Math.floor(($-l)/A),se="",B=0;B<o;B+=1)ce=1,l<=B&&B<p&&l<=$&&$<p&&v.isDark(Y,Math.floor((B-l)/A))&&(ce=0),se+=ce?O:R;for(Y=0;Y<A;Y+=1)F+=se+`
|
|
21
|
+
`}return F.substring(0,F.length-1)},v.renderTo2dContext=function(A,N){N=N||2;for(var $=v.getModuleCount(),B=0;B<$;B++)for(var Y=0;Y<$;Y++)A.fillStyle=v.isDark(B,Y)?"black":"white",A.fillRect(B*N,Y*N,N,N)},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=le(D),m=function(){var K=d.read();if(K==-1)throw"eof";return K},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 x,S,k,M,L,I={L:1,M:0,Q:3,H:2},z=(x=[[],[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]],S=1335,k=7973,L=function(D){for(var C=0;D!=0;)C+=1,D>>>=1;return C},(M={}).getBCHTypeInfo=function(D){for(var C=D<<10;L(C)-L(S)>=0;)C^=S<<L(C)-L(S);return 21522^(D<<10|C)},M.getBCHTypeNumber=function(D){for(var C=D<<12;L(C)-L(k)>=0;)C^=k<<L(C)-L(k);return D<<12|C},M.getPatternPosition=function(D){return x[D-1]},M.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}},M.getErrorCorrectPolynomial=function(D){for(var C=U([1],0),b=0;b<D;b+=1)C=C.multiply(U([1,q.gexp(b)],0));return C},M.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}}},M.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},M),q=(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]^=q.gexp(q.glog(u.getAt(f))+q.glog(d.getAt(i)));return U(m,0)},mod:function(d){if(u.getLength()-d.getLength()<0)return u;for(var m=q.glog(u.getAt(0))-q.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]^=q.gexp(q.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,G){switch(G){case I.L:return D[4*(te-1)+0];case I.M:return D[4*(te-1)+1];case I.Q:return D[4*(te-1)+2];case I.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],K=m[3*v+2],J=0;J<E;J+=1)i.push(C(j,K));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},X=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},H=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},V=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)}}},Z=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},le=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,K){var J=j,te=K,G=new Array(j*K),ae={setPixel:function(A,N,$){G[N*J+A]=$},write:function(A){A.writeString("GIF87a"),A.writeShort(J),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(J),A.writeShort(te),A.writeByte(0);var N=ie(2);A.writeByte(2);for(var $=0;N.length-$>255;)A.writeByte(255),A.writeBytes(N,$,255),$+=255;A.writeByte(N.length-$),A.writeBytes(N,$,N.length-$),A.writeByte(0),A.writeString(";")}},ie=function(A){for(var N=1<<A,$=1+(1<<A),B=A+1,Y=ue(),ce=0;ce<N;ce+=1)Y.add(String.fromCharCode(ce));Y.add(String.fromCharCode(N)),Y.add(String.fromCharCode($));var o,l,p,O=W(),R=(o=O,l=0,p=0,{write:function(pe,ne){if(pe>>>ne)throw"length over";for(;l+ne>=8;)o.writeByte(255&(pe<<l|p)),ne-=8-l,pe>>>=8-l,p=0,l=0;p|=pe<<l,l+=ne},flush:function(){l>0&&o.writeByte(p)}});R.write(N,B);var F=0,se=String.fromCharCode(G[F]);for(F+=1;F<G.length;){var he=String.fromCharCode(G[F]);F+=1,Y.contains(se+he)?se+=he:(R.write(Y.indexOf(se),B),Y.size()<4095&&(Y.size()==1<<B&&(B+=1),Y.add(se+he)),se=he)}return R.write(Y.indexOf(se),B),R.write($,B),R.flush(),O.toByteArray()},ue=function(){var A={},N=0,$={add:function(B){if($.contains(B))throw"dup key:"+B;A[B]=N,N+=1},size:function(){return N},indexOf:function(B){return A[B]},contains:function(B){return A[B]!==void 0}};return $};return ae})(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,K=0,J=0,te="",G={},ae=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 G.writeByte=function(ue){for(j=j<<8|255&ue,K+=8,J+=1;K>=6;)ae(j>>>K-6),K-=6},G.flush=function(){if(K>0&&(ae(j<<6-K),j=0,K=0),J%3!=0)for(var ue=3-J%3,A=0;A<ue;A+=1)te+="="},G.toString=function(){return te},G})(),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(x){for(var S=[],k=0;k<x.length;k++){var M=x.charCodeAt(k);M<128?S.push(M):M<2048?S.push(192|M>>6,128|63&M):M<55296||M>=57344?S.push(224|M>>12,128|M>>6&63,128|63&M):(k++,M=65536+((1023&M)<<10|1023&x.charCodeAt(k)),S.push(240|M>>18,128|M>>12&63,128|M>>6&63,128|63&M))}return S})(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,K=i+v+E+j;if(K!==0)if(K>2||i&&v||E&&j)this._basicSquare({x:u,y:d,size:m,rotation:0});else{if(K===2){let J=0;return i&&E?J=Math.PI/2:E&&v?J=Math.PI:v&&j&&(J=-Math.PI/2),void this._basicCornerRounded({x:u,y:d,size:m,rotation:J})}if(K===1){let J=0;return E?J=Math.PI/2:v?J=Math.PI:j&&(J=-Math.PI/2),void this._basicSideRounded({x:u,y:d,size:m,rotation:J})}}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,K=i+v+E+j;if(K!==0)if(K>2||i&&v||E&&j)this._basicSquare({x:u,y:d,size:m,rotation:0});else{if(K===2){let J=0;return i&&E?J=Math.PI/2:E&&v?J=Math.PI:v&&j&&(J=-Math.PI/2),void this._basicCornerExtraRounded({x:u,y:d,size:m,rotation:J})}if(K===1){let J=0;return E?J=Math.PI/2:v?J=Math.PI:j&&(J=-Math.PI/2),void this._basicSideRounded({x:u,y:d,size:m,rotation:J})}}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"},x=Object.values(P);class S{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"},M=Object.values(k);class L{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 I="circle",z=[[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(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===I?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,K=E.imageSize*y[j.errorCorrectionLevel],J=Math.floor(K*d*d);v=(function({originalHeight:te,originalWidth:G,maxHiddenDots:ae,maxHiddenAxisDots:ie,dotSize:ue}){const A={x:0,y:0},N={x:0,y:0};if(te<=0||G<=0||ae<=0||ue<=0)return{height:0,width:0,hideYDots:0,hideXDots:0};const $=te/G;return A.x=Math.floor(Math.sqrt(ae/$)),A.x<=0&&(A.x=1),ie&&ie<A.x&&(A.x=ie),A.x%2==0&&A.x--,N.x=A.x*ue,A.y=1+2*Math.ceil((A.x*$-1)/2),N.y=Math.round(N.x*$),(A.y*A.x>ae||ie&&ie<A.y)&&(ie&&ie<A.y?(A.y=ie,A.y%2==0&&A.x--):A.y-=2,N.y=A.y*ue,A.x=1+2*Math.ceil((A.y/$-1)/2),N.x=Math.round(N.y/$)),{height:N.y,width:N.x,hideYDots:A.y,hideXDots:A.x}})({originalWidth:this._image.width,originalHeight:this._image.height,maxHiddenDots:J,maxHiddenAxisDots:d-14,dotSize:i})}this.drawBackground(),this.drawDots((E,j)=>{var K,J,te,G,ae,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||!((K=z[E])===null||K===void 0)&&K[j]||!((J=z[E-d+7])===null||J===void 0)&&J[j]||!((te=z[E])===null||te===void 0)&&te[j-d+7]||!((G=q[E])===null||G===void 0)&&G[j]||!((ae=q[E-d+7])===null||ae===void 0)&&ae[j]||!((ie=q[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,K=i.width;if(v||E){const J=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=K=Math.min(i.width,i.height),J.setAttribute("rx",String(j/2*i.backgroundOptions.round))),J.setAttribute("x",String(this._roundSize((i.width-K)/2))),J.setAttribute("y",String(this._roundSize((i.height-j)/2))),J.setAttribute("width",String(K)),J.setAttribute("height",String(j)),this._backgroundClipPath.appendChild(J),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===I?v/Math.sqrt(2):v,j=this._roundSize(E/i),K=this._roundSize((f.width-i*j)/2),J=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 G=0;G<i;G++)for(let ae=0;ae<i;ae++)u&&!u(G,ae)||!((m=this._qr)===null||m===void 0)&&m.isDark(G,ae)&&(te.draw(K+ae*j,J+G*j,j,(ie,ue)=>!(ae+ie<0||G+ue<0||ae+ie>=i||G+ue>=i)&&!(u&&!u(G+ue,ae+ie))&&!!this._qr&&this._qr.isDark(G+ue,ae+ie)),te._element&&this._dotsClipPath&&this._dotsClipPath.appendChild(te._element));if(f.shape===I){const G=this._roundSize((v/j-i)/2),ae=i+2*G,ie=K-G*j,ue=J-G*j,A=[],N=this._roundSize(ae/2);for(let $=0;$<ae;$++){A[$]=[];for(let B=0;B<ae;B++)$>=G-1&&$<=ae-G&&B>=G-1&&B<=ae-G||Math.sqrt(($-N)*($-N)+(B-N)*(B-N))>N?A[$][B]=0:A[$][B]=this._qr.isDark(B-2*G<0?B:B>=i?B-2*G:B-G,$-2*G<0?$:$>=i?$-2*G:$-G)?1:0}for(let $=0;$<ae;$++)for(let B=0;B<ae;B++)A[$][B]&&(te.draw(ie+B*j,ue+$*j,j,(Y,ce)=>{var o;return!!(!((o=A[$+ce])===null||o===void 0)&&o[B+Y])}),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===I?f/Math.sqrt(2):f,v=this._roundSize(i/m),E=7*v,j=3*v,K=this._roundSize((d.width-m*v)/2),J=this._roundSize((d.height-m*v)/2);[[0,0,0],[1,0,Math.PI/2],[0,1,-Math.PI/2]].forEach(([te,G,ae])=>{var ie,ue,A,N,$,B,Y,ce,o,l,p,O,R,F;const se=K+te*v*(m-7),he=J+G*v*(m-7);let pe=this._dotsClipPath,ne=this._dotsClipPath;if((!((ie=d.cornersSquareOptions)===null||ie===void 0)&&ie.gradient||!((ue=d.cornersSquareOptions)===null||ue===void 0)&&ue.color)&&(pe=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),pe.setAttribute("id",`clip-path-corners-square-color-${te}-${G}-${this._instanceId}`),this._defs.appendChild(pe),this._cornersSquareClipPath=this._cornersDotClipPath=ne=pe,this._createColor({options:(A=d.cornersSquareOptions)===null||A===void 0?void 0:A.gradient,color:(N=d.cornersSquareOptions)===null||N===void 0?void 0:N.color,additionalRotation:ae,x:se,y:he,height:E,width:E,name:`corners-square-color-${te}-${G}-${this._instanceId}`})),(($=d.cornersSquareOptions)===null||$===void 0?void 0:$.type)&&x.includes(d.cornersSquareOptions.type)){const fe=new S({svg:this._element,type:d.cornersSquareOptions.type,window:this._window});fe.draw(se,he,E,ae),fe._element&&pe&&pe.appendChild(fe._element)}else{const fe=new _({svg:this._element,type:((B=d.cornersSquareOptions)===null||B===void 0?void 0:B.type)||d.dotsOptions.type,window:this._window});for(let me=0;me<z.length;me++)for(let ge=0;ge<z[me].length;ge++)!((Y=z[me])===null||Y===void 0)&&Y[ge]&&(fe.draw(se+ge*v,he+me*v,v,(Se,xe)=>{var De;return!!(!((De=z[me+xe])===null||De===void 0)&&De[ge+Se])}),fe._element&&pe&&pe.appendChild(fe._element))}if((!((ce=d.cornersDotOptions)===null||ce===void 0)&&ce.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}-${G}-${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:ae,x:se+2*v,y:he+2*v,height:j,width:j,name:`corners-dot-color-${te}-${G}-${this._instanceId}`})),((O=d.cornersDotOptions)===null||O===void 0?void 0:O.type)&&M.includes(d.cornersDotOptions.type)){const fe=new L({svg:this._element,type:d.cornersDotOptions.type,window:this._window});fe.draw(se+2*v,he+2*v,j,ae),fe._element&&ne&&ne.appendChild(fe._element)}else{const fe=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<q.length;me++)for(let ge=0;ge<q[me].length;ge++)!((F=q[me])===null||F===void 0)&&F[ge]&&(fe.draw(se+ge*v,he+me*v,v,(Se,xe)=>{var De;return!!(!((De=q[me+xe])===null||De===void 0)&&De[ge+Se])}),fe._element&&ne&&ne.appendChild(fe._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 K=new E.XMLHttpRequest;K.onload=function(){const J=new E.FileReader;J.onloadend=function(){j(J.result)},J.readAsDataURL(K.response)},K.open("GET",v),K.responseType="blob",K.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),K=E+this._roundSize(i.imageOptions.margin+(m*f-d)/2),J=u-2*i.imageOptions.margin,te=d-2*i.imageOptions.margin,G=this._window.document.createElementNS("http://www.w3.org/2000/svg","image");G.setAttribute("href",this._imageUri||""),G.setAttribute("xlink:href",this._imageUri||""),G.setAttribute("x",String(j)),G.setAttribute("y",String(K)),G.setAttribute("width",`${J}px`),G.setAttribute("height",`${te}px`),this._element.appendChild(G)}_createColor({options:u,color:d,additionalRotation:m,x:f,y:i,height:v,width:E,name:j}){const K=E>v?E:v,J=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect");if(J.setAttribute("x",String(f)),J.setAttribute("y",String(i)),J.setAttribute("height",String(v)),J.setAttribute("width",String(E)),J.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(K/2));else{const G=((u.rotation||0)+m)%(2*Math.PI),ae=(G+2*Math.PI)%(2*Math.PI);let ie=f+E/2,ue=i+v/2,A=f+E/2,N=i+v/2;ae>=0&&ae<=.25*Math.PI||ae>1.75*Math.PI&&ae<=2*Math.PI?(ie-=E/2,ue-=v/2*Math.tan(G),A+=E/2,N+=v/2*Math.tan(G)):ae>.25*Math.PI&&ae<=.75*Math.PI?(ue-=v/2,ie-=E/2/Math.tan(G),N+=v/2,A+=E/2/Math.tan(G)):ae>.75*Math.PI&&ae<=1.25*Math.PI?(ie+=E/2,ue+=v/2*Math.tan(G),A-=E/2,N-=v/2*Math.tan(G)):ae>1.25*Math.PI&&ae<=1.75*Math.PI&&(ue+=v/2,ie+=E/2/Math.tan(G),N-=v/2,A-=E/2/Math.tan(G)),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(N)))}u.colorStops.forEach(({offset:G,color:ae})=>{const ie=this._window.document.createElementNS("http://www.w3.org/2000/svg","stop");ie.setAttribute("offset",100*G+"%"),ie.setAttribute("stop-color",ae),te.appendChild(ie)}),J.setAttribute("fill",`url('#${j}')`),this._defs.appendChild(te)}else d&&J.setAttribute("fill",d);this._element.appendChild(J)}}U.instanceCount=0;const ee=U,re="canvas",X={};for(let b=0;b<=40;b++)X[b]=b;const H={type:re,shape:"square",width:300,height:300,data:"",margin:0,qrOptions:{typeNumber:X[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 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 Z(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=V(u.dotsOptions.gradient)),u.cornersSquareOptions&&(u.cornersSquareOptions=Object.assign({},u.cornersSquareOptions),u.cornersSquareOptions.gradient&&(u.cornersSquareOptions.gradient=V(u.cornersSquareOptions.gradient))),u.cornersDotOptions&&(u.cornersDotOptions=Object.assign({},u.cornersDotOptions),u.cornersDotOptions.gradient&&(u.cornersDotOptions.gradient=V(u.cornersDotOptions.gradient))),u.backgroundOptions&&(u.backgroundOptions=Object.assign({},u.backgroundOptions),u.backgroundOptions.gradient&&(u.backgroundOptions.gradient=V(u.backgroundOptions.gradient))),u}var W=s(873),le=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?Z(a(H,u)):H,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 K,J;j.width=this._options.width,j.height=this._options.height,(J=(K=this._nodeCanvas)===null||K===void 0?void 0:K.getContext("2d"))===null||J===void 0||J.drawImage(j,0,0)});{const j=new this._window.Image;return new Promise(K=>{j.onload=()=>{var J,te;(te=(J=this._domCanvas)===null||J===void 0?void 0:J.getContext("2d"))===null||te===void 0||te.drawImage(j,0,0),K()},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?Z(a(this._options,u)):this._options,this._options.data&&(this._qr=le()(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(d)}`;return typeof Blob>"u"||this._options.jsdom?Buffer.from(f):new Blob([f],{type:m})}return new Promise(f=>{const i=d;if("toBuffer"in i)if(m==="image/png")f(i.toBuffer(m));else if(m==="image/jpeg")f(i.toBuffer(m));else{if(m!=="application/pdf")throw Error("Unsupported extension");f(i.toBuffer(m))}else"toBlob"in i&&i.toBlob(f,m,1)})}async download(u){if(!this._qr)throw"QR code is empty";if(typeof Blob>"u")throw"Cannot download in Node.js, call getRawData instead.";let d="png",m="qr";typeof u=="string"?(d=u,console.warn("Extension is deprecated as argument for 'download' method, please pass object { name: '...', extension: '...' } as argument")):typeof u=="object"&&u!==null&&(u.name&&(m=u.name),u.extension&&(d=u.extension));const f=await this._getElement(d);if(f)if(d.toLowerCase()==="svg"){let i=new XMLSerializer().serializeToString(f);i=`<?xml version="1.0" standalone="no"?>\r
|
|
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=Ke.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 ft(){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 Pt(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 wt(){return{"Content-Type":"application/json",Authorization:`Bearer ${await rl()??""}`,...gl()}}async function Bo(t){return fetch(t,{method:"GET",headers:await wt()}).then(async e=>(e.status>=400&&await Pt(e),e)).then(e=>e.json()).then(e=>e)}async function Io(t,e){return fetch(`${t}/${e}`,{method:"GET",headers:await wt()}).then(async r=>(r.status>=400&&await Pt(r),r)).then(r=>r.json()).then(r=>r)}async function Yo(t,e){const r=await fetch(`${t}/${e}`,{method:"DELETE",headers:await wt()});r.status>=400&&await Pt(r)}async function zo(t,e){return fetch(t,{method:"POST",headers:await wt(),body:JSON.stringify(e)}).then(async r=>(r.status>=400&&await Pt(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 wt(),body:r?JSON.stringify(r):void 0}).then(async n=>(n.status>=400&&await Pt(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 wt(),body:JSON.stringify(e)}).then(async r=>(r.status>=400&&await Pt(r),r)).then(r=>r.status==204?e:r.json()).then(r=>r)}function Wo(t,e,r){const n=Ke.c(13),{baseUrl:s}=ft();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=Ke.c(9),s=r===void 0?!0:r,{baseUrl:c}=ft();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=Ke.c(10),{baseUrl:n,queryClient:s}=ft();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=Ke.c(10),{baseUrl:n,queryClient:s}=ft();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=Ke.c(10),{baseUrl:n,queryClient:s}=ft();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",x="quarter",S="year",k="date",M="Invalid Date",L=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,I=/\[([^\]]+)]|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,z={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])+"]"}},q=function(D,C,b){var u=String(D);return!u||u.length>=C?D:""+Array(C+1-u.length).join(b)+D},U={s:q,z:function(D){var C=-D.utcOffset(),b=Math.abs(C),u=Math.floor(b/60),d=b%60;return(C<=0?"+":"-")+q(u,2,"0")+":"+q(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:S,w:_,d:y,D:k,h:g,m:a,s:h,ms:c,Q:x}[D]||String(D||"").toLowerCase().replace(/s$/,"")},u:function(D){return D===void 0}},ee="en",re={};re[ee]=z;var X="$isDayjsObject",H=function(D){return D instanceof le||!(!D||!D[X])},V=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},Z=function(D,C){if(H(D))return D.clone();var b=typeof C=="object"?C:{};return b.date=D,b.args=arguments,new le(b)},W=U;W.l=V,W.i=H,W.w=function(D,C){return Z(D,{locale:C.$L,utc:C.$u,x:C.$x,$offset:C.$offset})};var le=(function(){function D(b){this.$L=V(b.locale,null,!0),this.parse(b),this.$x=this.$x||b.x||{},this[X]=!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(L);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()!==M},C.isSame=function(b,u){var d=Z(b);return this.startOf(u)<=d&&d<=this.endOf(u)},C.isAfter=function(b,u){return Z(b)<this.startOf(u)},C.isBefore=function(b,u){return this.endOf(u)<Z(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(ae,ie){var ue=W.w(d.$u?Date.UTC(d.$y,ie,ae):new Date(d.$y,ie,ae),d);return m?ue:ue.endOf(y)},v=function(ae,ie){return W.w(d.toDate()[ae].apply(d.toDate("s"),(m?[0,0,0,0]:[23,59,59,999]).slice(ie)),d)},E=this.$W,j=this.$M,K=this.$D,J="set"+(this.$u?"UTC":"");switch(f){case S: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,G=(E<te?E+7:E)-te;return i(m?K-G:K+(6-G),j);case y:case k:return v(J+"Hours",0);case g:return v(J+"Minutes",1);case a:return v(J+"Seconds",2);case h:return v(J+"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[S]=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===S){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 K=Z(m);return W.w(K.date(K.date()+Math.round(j*b)),m)};if(f===P)return this.set(P,this.$M+b);if(f===S)return this.set(S,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||M;var m=b||"YYYY-MM-DDTHH:mm:ssZ",f=W.z(this),i=this.$H,v=this.$m,E=this.$M,j=d.weekdays,K=d.months,J=d.meridiem,te=function(ie,ue,A,N){return ie&&(ie[ue]||ie(u,m))||A[ue].slice(0,N)},G=function(ie){return W.s(i%12||12,ie,"0")},ae=J||function(ie,ue,A){var N=ie<12?"AM":"PM";return A?N.toLowerCase():N};return m.replace(I,(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,K,3);case"MMMM":return te(K,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 G(1);case"hh":return G(2);case"a":return ae(i,v,!0);case"A":return ae(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=Z(b),E=(v.utcOffset()-this.utcOffset())*n,j=this-v,K=function(){return W.m(f,v)};switch(i){case S:m=K()/12;break;case P:m=K();break;case x:m=K()/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=V(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=le.prototype;return Z.prototype=oe,[["$ms",c],["$s",h],["$m",a],["$H",g],["$W",y],["$M",P],["$y",S],["$D",k]].forEach((function(D){oe[D[1]]=function(C){return this.$g(C,D[0],D[1])}})),Z.extend=function(D,C){return D.$i||(D(C,le,Z),D.$i=!0),Z},Z.locale=V,Z.isDayjs=H,Z.unix=function(D){return Z(1e3*D)},Z.en=re[ee],Z.Ls=re,Z.p={},Z}))})(ur)),ur.exports}var Pl=kl();const de=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:de(t).format("YYYY-MM-DD")}function Qo(t){return t==null||t===""?t:de(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 pt(){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:x,outside:S,selected:k,renderDay:M,inRange:L,firstInRange:I,lastInRange:z,hidden:q,static:U,highlightToday:ee,attributes:re,...X}=r,H=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,{...H("day",{style:q?{display:"none"}:void 0}),component:U?"div":"button",ref:e,disabled:_,"data-today":de(y).isSame(new Date,"day")||void 0,"data-hidden":q||void 0,"data-highlight-today":ee||void 0,"data-disabled":_||void 0,"data-weekend":!_&&!S&&x||void 0,"data-outside":!_&&S||void 0,"data-selected":!_&&k||void 0,"data-in-range":L&&!_||void 0,"data-first-in-range":I&&!_||void 0,"data-last-in-range":z&&!_||void 0,"data-static":U||void 0,unstyled:a,...X,children:M?.(y)||de(y).date()})});ln.classes=Jo,ln.displayName="@mantine/dates/Day";function Rl({locale:t,format:e="dd",firstDayOfWeek:r=1}){const n=de().day(r),s=[];for(let c=0;c<7;c+=1)typeof e=="string"?s.push(de(n).add(c,"days").locale(t).format(e)):s.push(e(de(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:x="th",__staticSelector:S,withWeekNumbers:k,attributes:M,...L}=r,I=T.useStyles({name:S||"WeekdaysRow",classes:Xo,props:r,className:s,style:c,classNames:n,styles:h,unstyled:a,attributes:M,vars:g,varsResolver:Nl,rootSelector:"weekdaysRow"}),z=pt(),q=Rl({locale:z.getLocale(y),format:P,firstDayOfWeek:z.getFirstDayOfWeek(_)}).map((U,ee)=>w.jsx(x,{...I("weekday"),children:U},ee));return w.jsxs(T.Box,{component:"tr",ref:e,...I("weekdaysRow"),...L,children:[k&&w.jsx(x,{...I("weekday"),children:"#"}),q]})});un.classes=Xo,un.displayName="@mantine/dates/WeekdaysRow";function Ll(t,e=1){let r=de(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=de(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=de(t).subtract(de(t).date()-1,"day"),s=de(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=de(Bl(c,e));for(;de(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 x=de(P).add(1,"day");for(;g.length<6;){const S=[];for(let k=0;k<7;k+=1)S.push(x.format("YYYY-MM-DD")),x=x.add(1,"day");g.push(S)}}return g}function cn(t,e){return de(t).format("YYYY-MM")===de(e).format("YYYY-MM")}function es(t,e){return e?de(t).isAfter(de(e).subtract(1,"day"),"day"):!0}function ts(t,e){return e?de(t).isBefore(de(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(_=>de().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,x,S,k=h(this),M=(_=this.isoWeekYear(),P=this.$u,x=(P?c.utc:c)().year(_).startOf("year"),S=4-x.isoWeekday(),x.isoWeekday()>4&&(S+=7),x.add(S,r));return k.diff(M,"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(),x=!!P.u(_)||_;return P.p(y)==="isoweek"?x?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);de.extend(Ul);function ql(t){const e=t.find(r=>de(r).day()===1);return de(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:x,month:S,weekendDays:k,getDayProps:M,excludeDate:L,minDate:I,maxDate:z,renderDay:q,hideOutsideDates:U,hideWeekdays:ee,getDayAriaLabel:re,static:X,__getDayRef:H,__onDayKeyDown:V,__onDayClick:Z,__onDayMouseEnter:W,__preventFocus:le,__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=pt(),v=Il({month:S,firstDayOfWeek:i.getFirstDayOfWeek(P),consistentWeeks:i.consistentWeeks}),E=Yl({dates:v,minDate:Ue(I),maxDate:Ue(z),getDayProps:M,excludeDate:L,hideOutsideDates:U,month:S}),{resolvedClassNames:j,resolvedStyles:K}=T.useResolvedStylesApi({classNames:n,styles:h,props:r}),J=v.map((te,G)=>{const ae=te.map((ie,ue)=>{const A=!cn(ie,S),N=re?.(ie)||de(ie).locale(_||i.locale).format("D MMMM YYYY"),$=M?.(ie),B=de(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:K,unstyled:a,"data-mantine-stop-propagation":oe||void 0,highlightToday:b,renderDay:q,date:ie,size:C,weekend:i.getWeekendDays(k).includes(de(ie).get("day")),outside:A,hidden:U?A:!1,"aria-label":N,static:X,disabled:L?.(ie)||!ts(ie,Ue(z))||!es(ie,Ue(I)),ref:Y=>{Y&&H?.(G,ue,Y)},...$,onKeyDown:Y=>{$?.onKeyDown?.(Y),V?.(Y,{rowIndex:G,cellIndex:ue,date:ie})},onMouseEnter:Y=>{$?.onMouseEnter?.(Y),W?.(Y,ie)},onClick:Y=>{$?.onClick?.(Y),Z?.(Y,ie)},onMouseDown:Y=>{$?.onMouseDown?.(Y),le&&Y.preventDefault()},tabIndex:le||!B?-1:0})},ie.toString())});return w.jsxs("tr",{...f("monthRow"),children:[u&&w.jsx("td",{...f("weekNumber"),children:ql(te)}),ae]},G)});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:x,size:C,classNames:j,styles:K,unstyled:a,withWeekNumbers:u})}),w.jsx("tbody",{...f("monthTbody"),children:J})]})});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:x,selected:S,disabled:k,attributes:M,...L}=r,I=T.useStyles({name:x||"PickerControl",classes:os,props:r,className:s,style:c,classNames:n,styles:h,unstyled:a,attributes:M,vars:g,varsResolver:Gl,rootSelector:"pickerControl"});return w.jsx(T.UnstyledButton,{...I("pickerControl"),ref:e,unstyled:a,"data-picker-control":!0,"data-selected":S&&!k||void 0,"data-disabled":k||void 0,"data-in-range":P&&!k&&!S||void 0,"data-first-in-range":y&&!k||void 0,"data-last-in-range":_&&!k||void 0,disabled:k,...L})});hr.classes=os,hr.displayName="@mantine/dates/PickerControl";function ss({year:t,minDate:e,maxDate:r}){return!e&&!r?!1:!!(e&&de(t).isBefore(e,"year")||r&&de(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=>de().isSame(a,"year"));return h||s[0]}function is(t){const e=de(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(de(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:x,maxDate:S,getYearControlProps:k,__staticSelector:M,__getControlRef:L,__onControlKeyDown:I,__onControlClick:z,__onControlMouseEnter:q,__preventFocus:U,__stopPropagation:ee,withCellSpacing:re,size:X,attributes:H,...V}=r,Z=T.useStyles({name:M||"YearsList",classes:as,props:r,className:s,style:c,classNames:n,styles:h,unstyled:a,attributes:H,vars:g,rootSelector:"yearsList"}),W=pt(),le=is(y),oe=Ql({years:le,minDate:x,maxDate:S,getYearControlProps:k}),D=le.map((C,b)=>{const u=C.map((d,m)=>{const f=k?.(d),i=de(d).isSame(oe,"year");return w.jsx("td",{...Z("yearsListCell"),"data-with-spacing":re||void 0,children:w.jsx(hr,{...Z("yearsListControl"),size:X,unstyled:a,"data-mantine-stop-propagation":ee||void 0,disabled:ss({year:d,minDate:x,maxDate:S}),ref:v=>{v&&L?.(b,m,v)},...f,onKeyDown:v=>{f?.onKeyDown?.(v),I?.(v,{rowIndex:b,cellIndex:m,date:d})},onClick:v=>{f?.onClick?.(v),z?.(v,d)},onMouseEnter:v=>{f?.onMouseEnter?.(v),q?.(v,d)},onMouseDown:v=>{f?.onMouseDown?.(v),U&&v.preventDefault()},tabIndex:U||!i?-1:0,children:de(d).locale(W.getLocale(P)).format(_)})},m)});return w.jsx("tr",{...Z("yearsListRow"),children:u},b)});return w.jsx(T.Box,{component:"table",ref:e,size:X,...Z("yearsList"),...V,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&&de(t).isBefore(e,"month")||r&&de(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=>de().isSame(a,"month"));return h||s[0]}function Jl(t){const e=de(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(de(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:x,minDate:S,maxDate:k,getMonthControlProps:M,__getControlRef:L,__onControlKeyDown:I,__onControlClick:z,__onControlMouseEnter:q,__preventFocus:U,__stopPropagation:ee,withCellSpacing:re,size:X,attributes:H,...V}=r,Z=T.useStyles({name:y||"MonthsList",classes:us,props:r,className:s,style:c,classNames:n,styles:h,unstyled:a,attributes:H,vars:g,rootSelector:"monthsList"}),W=pt(),le=Jl(_),oe=Kl({months:le,minDate:Ue(S),maxDate:Ue(k),getMonthControlProps:M}),D=le.map((C,b)=>{const u=C.map((d,m)=>{const f=M?.(d),i=de(d).isSame(oe,"month");return w.jsx("td",{...Z("monthsListCell"),"data-with-spacing":re||void 0,children:w.jsx(hr,{...Z("monthsListControl"),size:X,unstyled:a,__staticSelector:y||"MonthsList","data-mantine-stop-propagation":ee||void 0,disabled:ls({month:d,minDate:Ue(S),maxDate:Ue(k)}),ref:v=>{v&&L?.(b,m,v)},...f,onKeyDown:v=>{f?.onKeyDown?.(v),I?.(v,{rowIndex:b,cellIndex:m,date:d})},onClick:v=>{f?.onClick?.(v),z?.(v,d)},onMouseEnter:v=>{f?.onMouseEnter?.(v),q?.(v,d)},onMouseDown:v=>{f?.onMouseDown?.(v),U&&v.preventDefault()},tabIndex:U||!i?-1:0,children:de(d).locale(W.getLocale(x)).format(P)})},m)});return w.jsx("tr",{...Z("monthsListRow"),children:u},b)});return w.jsx(T.Box,{component:"table",ref:e,size:X,...Z("monthsList"),...V,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)}})),gt=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:x,onNext:S,onPrevious:k,onLevelClick:M,label:L,nextDisabled:I,previousDisabled:z,hasNextLevel:q,levelControlAriaLabel:U,withNext:ee,withPrevious:re,headerControlsOrder:X,__staticSelector:H,__preventFocus:V,__stopPropagation:Z,attributes:W,...le}=r,oe=T.useStyles({name:H||"CalendarHeader",classes:cs,props:r,className:s,style:c,classNames:n,styles:h,unstyled:a,attributes:W,vars:g,varsResolver:tu,rootSelector:"calendarHeader"}),D=V?m=>m.preventDefault():void 0,C=re&&Q.createElement(T.UnstyledButton,{...oe("calendarHeaderControl"),key:"previous","data-direction":"previous","aria-label":x,onClick:k,unstyled:a,onMouseDown:D,disabled:z,"data-disabled":z||void 0,tabIndex:V||z?-1:0,"data-mantine-stop-propagation":Z||void 0},_||w.jsx(T.AccordionChevron,{...oe("calendarHeaderControlIcon"),"data-direction":"previous",size:"45%"})),b=Q.createElement(T.UnstyledButton,{component:q?"button":"div",...oe("calendarHeaderLevel"),key:"level",onClick:q?M:void 0,unstyled:a,onMouseDown:q?D:void 0,disabled:!q,"data-static":!q||void 0,"aria-label":U,tabIndex:V||!q?-1:0,"data-mantine-stop-propagation":Z||void 0},L),u=ee&&Q.createElement(T.UnstyledButton,{...oe("calendarHeaderControl"),key:"next","data-direction":"next","aria-label":P,onClick:S,unstyled:a,onMouseDown:D,disabled:I,"data-disabled":I||void 0,tabIndex:V||I?-1:0,"data-mantine-stop-propagation":Z||void 0},y||w.jsx(T.AccordionChevron,{...oe("calendarHeaderControlIcon"),"data-direction":"next",size:"45%"})),d=X.map(m=>m==="previous"?C:m==="level"?b:m==="next"?u:null);return w.jsx(T.Box,{...oe("calendarHeader"),ref:e,...le,children:d})});gt.classes=cs,gt.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:x,withCellSpacing:S,__preventFocus:k,nextIcon:M,previousIcon:L,nextLabel:I,previousLabel:z,onNext:q,onPrevious:U,nextDisabled:ee,previousDisabled:re,levelControlAriaLabel:X,withNext:H,withPrevious:V,headerControlsOrder:Z,decadeLabelFormat:W,classNames:le,styles:oe,unstyled:D,__staticSelector:C,__stopPropagation:b,size:u,attributes:d,...m}=r,f=pt(),[i,v]=ru(n),E={__staticSelector:C||"DecadeLevel",classNames:le,styles:oe,unstyled:D,size:u,attributes:d},j=typeof ee=="boolean"?ee:h?!de(v).endOf("year").isBefore(h):!1,K=typeof re=="boolean"?re:c?!de(i).startOf("year").isAfter(c):!1,J=(te,G)=>de(te).locale(s||f.locale).format(G);return w.jsxs(T.Box,{"data-decade-level":!0,size:u,ref:e,...m,children:[w.jsx(gt,{label:typeof W=="function"?W(i,v):`${J(i,W)} – ${J(v,W)}`,__preventFocus:k,__stopPropagation:b,nextIcon:M,previousIcon:L,nextLabel:I,previousLabel:z,onNext:q,onPrevious:U,nextDisabled:j,previousDisabled:K,hasNextLevel:!1,levelControlAriaLabel:X,withNext:H,withPrevious:V,headerControlsOrder:Z,...E}),w.jsx(fr,{decade:n,locale:s,minDate:c,maxDate:h,yearsListFormat:a,getYearControlProps:g,__getControlRef:y,__onControlKeyDown:_,__onControlClick:P,__onControlMouseEnter:x,__preventFocus:k,__stopPropagation:b,withCellSpacing:S,...E})]})});gr.classes={...fr.classes,...gt.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:x,withCellSpacing:S,__preventFocus:k,nextIcon:M,previousIcon:L,nextLabel:I,previousLabel:z,onNext:q,onPrevious:U,onLevelClick:ee,nextDisabled:re,previousDisabled:X,hasNextLevel:H,levelControlAriaLabel:V,withNext:Z,withPrevious:W,headerControlsOrder:le,yearLabelFormat:oe,__staticSelector:D,__stopPropagation:C,size:b,classNames:u,styles:d,unstyled:m,attributes:f,...i}=r,v=pt(),E={__staticSelector:D||"YearLevel",classNames:u,styles:d,unstyled:m,size:b,attributes:f},j=typeof re=="boolean"?re:h?!de(n).endOf("year").isBefore(h):!1,K=typeof X=="boolean"?X:c?!de(n).startOf("year").isAfter(c):!1;return w.jsxs(T.Box,{"data-year-level":!0,size:b,ref:e,...i,children:[w.jsx(gt,{label:typeof oe=="function"?oe(n):de(n).locale(s||v.locale).format(oe),__preventFocus:k,__stopPropagation:C,nextIcon:M,previousIcon:L,nextLabel:I,previousLabel:z,onNext:q,onPrevious:U,onLevelClick:ee,nextDisabled:j,previousDisabled:K,hasNextLevel:H,levelControlAriaLabel:V,withNext:Z,withPrevious:W,headerControlsOrder:le,...E}),w.jsx(pr,{year:n,locale:s,minDate:c,maxDate:h,monthsListFormat:a,getMonthControlProps:g,__getControlRef:y,__onControlKeyDown:_,__onControlClick:P,__onControlMouseEnter:x,__preventFocus:k,__stopPropagation:C,withCellSpacing:S,...E})]})});mr.classes={...gt.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:x,hideOutsideDates:S,hideWeekdays:k,getDayAriaLabel:M,__getDayRef:L,__onDayKeyDown:I,__onDayClick:z,__onDayMouseEnter:q,withCellSpacing:U,highlightToday:ee,withWeekNumbers:re,__preventFocus:X,__stopPropagation:H,nextIcon:V,previousIcon:Z,nextLabel:W,previousLabel:le,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:K,unstyled:J,__staticSelector:te,size:G,static:ae,attributes:ie,...ue}=r,A=pt(),N={__staticSelector:te||"MonthLevel",classNames:j,styles:K,unstyled:J,size:G,attributes:ie},$=typeof b=="boolean"?b:P?!de(n).endOf("month").isBefore(P):!1,B=typeof u=="boolean"?u:_?!de(n).startOf("month").isAfter(_):!1;return w.jsxs(T.Box,{"data-month-level":!0,size:G,ref:e,...ue,children:[w.jsx(gt,{label:typeof E=="function"?E(n):de(n).locale(s||A.locale).format(E),__preventFocus:X,__stopPropagation:H,nextIcon:V,previousIcon:Z,nextLabel:W,previousLabel:le,onNext:oe,onPrevious:D,onLevelClick:C,nextDisabled:$,previousDisabled:B,hasNextLevel:d,levelControlAriaLabel:m,withNext:f,withPrevious:i,headerControlsOrder:v,...N}),w.jsx(dr,{month:n,locale:s,firstDayOfWeek:c,weekdayFormat:h,weekendDays:a,getDayProps:g,excludeDate:y,minDate:_,maxDate:P,renderDay:x,hideOutsideDates:S,hideWeekdays:k,getDayAriaLabel:M,__getDayRef:L,__onDayKeyDown:I,__onDayClick:z,__onDayMouseEnter:q,__preventFocus:X,__stopPropagation:H,static:ae,withCellSpacing:U,highlightToday:ee,withWeekNumbers:re,...N})]})});yr.classes={...dr.classes,...gt.classes},yr.displayName="@mantine/dates/MonthLevel";var ds={levelsGroup:"m_30b26e33"};const mt=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,x=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,...x("levelsGroup"),...P})});mt.classes=ds,mt.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:x,nextIcon:S,previousIcon:k,nextLabel:M,previousLabel:L,onNext:I,onPrevious:z,nextDisabled:q,previousDisabled:U,headerControlsOrder:ee,classNames:re,styles:X,unstyled:H,__staticSelector:V,__stopPropagation:Z,numberOfColumns:W,levelControlAriaLabel:le,decadeLabelFormat:oe,size:D,vars:C,attributes:b,...u}=r,d=Q.useRef([]),m=Array(W).fill(0).map((f,i)=>{const v=de(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,K)=>{Array.isArray(d.current[i])||(d.current[i]=[]),Array.isArray(d.current[i][E])||(d.current[i][E]=[]),d.current[i][E][j]=K},levelControlAriaLabel:typeof le=="function"?le(v):le,locale:s,minDate:c,maxDate:h,__preventFocus:x,__stopPropagation:Z,nextIcon:S,previousIcon:k,nextLabel:M,previousLabel:L,onNext:I,onPrevious:z,nextDisabled:q,previousDisabled:U,getYearControlProps:g,__staticSelector:V||"DecadeLevelGroup",classNames:re,styles:X,unstyled:H,withCellSpacing:P,headerControlsOrder:ee,attributes:b},i)});return w.jsx(mt,{classNames:re,styles:X,__staticSelector:V||"DecadeLevelGroup",ref:e,size:D,unstyled:H,attributes:b,...u,children:m})});vr.classes={...mt.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:x,nextIcon:S,previousIcon:k,nextLabel:M,previousLabel:L,onNext:I,onPrevious:z,onLevelClick:q,nextDisabled:U,previousDisabled:ee,hasNextLevel:re,headerControlsOrder:X,classNames:H,styles:V,unstyled:Z,__staticSelector:W,__stopPropagation:le,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=de(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:le,__onControlClick:y,__onControlMouseEnter:_,__onControlKeyDown:(K,J)=>an({levelIndex:E,rowIndex:J.rowIndex,cellIndex:J.cellIndex,event:K,controlsRef:f}),__getControlRef:(K,J,te)=>{Array.isArray(f.current[E])||(f.current[E]=[]),Array.isArray(f.current[E][K])||(f.current[E][K]=[]),f.current[E][K][J]=te},levelControlAriaLabel:typeof D=="function"?D(j):D,locale:s,minDate:c,maxDate:h,__preventFocus:x,nextIcon:S,previousIcon:k,nextLabel:M,previousLabel:L,onNext:I,onPrevious:z,onLevelClick:q,nextDisabled:U,previousDisabled:ee,hasNextLevel:re,getMonthControlProps:g,classNames:H,styles:V,unstyled:Z,__staticSelector:W||"YearLevelGroup",withCellSpacing:P,headerControlsOrder:X,attributes:d},E)});return w.jsx(mt,{classNames:H,styles:V,__staticSelector:W||"YearLevelGroup",ref:e,size:b,unstyled:Z,attributes:d,...m,children:i})});br.classes={...mr.classes,...mt.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:x,hideOutsideDates:S,hideWeekdays:k,getDayAriaLabel:M,__onDayClick:L,__onDayMouseEnter:I,withCellSpacing:z,highlightToday:q,withWeekNumbers:U,__preventFocus:ee,nextIcon:re,previousIcon:X,nextLabel:H,previousLabel:V,onNext:Z,onPrevious:W,onLevelClick:le,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:K,static:J,vars:te,attributes:G,...ae}=r,ie=Q.useRef([]),ue=Array(f).fill(0).map((A,N)=>{const $=de(n).add(N,"months").format("YYYY-MM-DD");return w.jsx(yr,{month:$,withNext:N===f-1,withPrevious:N===0,monthLabelFormat:v,__stopPropagation:j,__onDayClick:L,__onDayMouseEnter:I,__onDayKeyDown:(B,Y)=>an({levelIndex:N,rowIndex:Y.rowIndex,cellIndex:Y.cellIndex,event:B,controlsRef:ie}),__getDayRef:(B,Y,ce)=>{Array.isArray(ie.current[N])||(ie.current[N]=[]),Array.isArray(ie.current[N][B])||(ie.current[N][B]=[]),ie.current[N][B][Y]=ce},levelControlAriaLabel:typeof i=="function"?i($):i,locale:s,firstDayOfWeek:c,weekdayFormat:h,weekendDays:a,getDayProps:g,excludeDate:y,minDate:_,maxDate:P,renderDay:x,hideOutsideDates:S,hideWeekdays:k,getDayAriaLabel:M,__preventFocus:ee,nextIcon:re,previousIcon:X,nextLabel:H,previousLabel:V,onNext:Z,onPrevious:W,onLevelClick:le,nextDisabled:oe,previousDisabled:D,hasNextLevel:C,classNames:u,styles:d,unstyled:m,__staticSelector:E||"MonthLevelGroup",size:K,static:J,withCellSpacing:z,highlightToday:q,withWeekNumbers:U,headerControlsOrder:b,attributes:G},N)});return w.jsx(mt,{classNames:u,styles:d,__staticSelector:E||"MonthLevelGroup",ref:e,size:K,attributes:G,...ae,children:ue})});wr.classes={...mt.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]=Ne.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 Vt(t,e,r){return uu(Ne.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:x,columnsToScroll:S,ariaLabels:k,nextLabel:M,previousLabel:L,onYearSelect:I,onMonthSelect:z,onYearMouseEnter:q,onMonthMouseEnter:U,headerControlsOrder:ee,__updateDateOnYearSelect:re,__updateDateOnMonthSelect:X,__setDateRef:H,__setLevelRef:V,firstDayOfWeek:Z,weekdayFormat:W,weekendDays:le,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:K,withWeekNumbers:J,monthsListFormat:te,getMonthControlProps:G,yearLabelFormat:ae,yearsListFormat:ie,getYearControlProps:ue,decadeLabelFormat:A,classNames:N,styles:$,unstyled:B,minDate:Y,maxDate:ce,locale:o,__staticSelector:l,size:p,__preventFocus:O,__stopPropagation:R,onNextDecade:F,onPreviousDecade:se,onNextYear:he,onPreviousYear:pe,onNextMonth:ne,onPreviousMonth:fe,static:me,enableKeyboardNavigation:ge,attributes:Se,...xe}=r,{resolvedClassNames:De,resolvedStyles:qe}=T.useResolvedStylesApi({classNames:N,styles:$,props:r}),[Ee,_e]=Ne.useUncontrolled({value:a?Vt(a,c,s):void 0,defaultValue:h?Vt(h,c,s):void 0,finalValue:Vt(void 0,c,s),onChange:g}),[st,Te]=dn({type:"default",value:Ue(y),defaultValue:Ue(_),onChange:P});Q.useImperativeHandle(H,()=>ve=>{Te(ve)}),Q.useImperativeHandle(V,()=>ve=>{_e(ve)});const Ve={__staticSelector:l||"Calendar",styles:qe,classNames:De,unstyled:B,size:p,attributes:Se},Ie=S||x||1,tt=new Date,it=Y&&de(tt).isAfter(Y)?Y:de(tt).format("YYYY-MM-DD"),je=st||it,at=()=>{const ve=de(je).add(Ie,"month").format("YYYY-MM-DD");ne?.(ve),Te(ve)},yt=()=>{const ve=de(je).subtract(Ie,"month").format("YYYY-MM-DD");fe?.(ve),Te(ve)},ut=()=>{const ve=de(je).add(Ie,"year").format("YYYY-MM-DD");he?.(ve),Te(ve)},He=()=>{const ve=de(je).subtract(Ie,"year").format("YYYY-MM-DD");pe?.(ve),Te(ve)},Ge=()=>{const ve=de(je).add(10*Ie,"year").format("YYYY-MM-DD");F?.(ve),Te(ve)},Qe=()=>{const ve=de(je).subtract(10*Ie,"year").format("YYYY-MM-DD");se?.(ve),Te(ve)},ct=Q.useRef(null);Q.useEffect(()=>{if(!ge||me)return;const ve=ke=>{if(!ct.current?.contains(document.activeElement))return;const Ye=ke.ctrlKey||ke.metaKey,rt=ke.shiftKey;switch(ke.key){case"ArrowUp":Ye&&rt?(ke.preventDefault(),Qe()):Ye&&(ke.preventDefault(),He());break;case"ArrowDown":Ye&&rt?(ke.preventDefault(),Ge()):Ye&&(ke.preventDefault(),ut());break;case"y":case"Y":Ee==="month"&&(ke.preventDefault(),_e("year"));break}};return document.addEventListener("keydown",ve),()=>{document.removeEventListener("keydown",ve)}},[ge,me,Ee,ut,He,Ge,Qe]);const _t=ve=>{ct.current=ve,typeof e=="function"?e(ve):e&&(e.current=ve)};return w.jsxs(T.Box,{ref:_t,size:p,"data-calendar":!0,...xe,children:[Ee==="month"&&w.jsx(wr,{month:je,minDate:Y,maxDate:ce,firstDayOfWeek:Z,weekdayFormat:W,weekendDays:le,getDayProps:oe,excludeDate:D,renderDay:C,hideOutsideDates:b,hideWeekdays:u,getDayAriaLabel:d,onNext:at,onPrevious:yt,hasNextLevel:s!=="month",onLevelClick:()=>_e("year"),numberOfColumns:x,locale:o,levelControlAriaLabel:k?.monthLevelControl,nextLabel:k?.nextMonth??M,nextIcon:f,previousLabel:k?.previousMonth??L,previousIcon:i,monthLabelFormat:m,__onDayClick:v,__onDayMouseEnter:E,__preventFocus:O,__stopPropagation:R,static:me,withCellSpacing:j,highlightToday:K,withWeekNumbers:J,headerControlsOrder:ee,...Ve}),Ee==="year"&&w.jsx(br,{year:je,numberOfColumns:x,minDate:Y,maxDate:ce,monthsListFormat:te,getMonthControlProps:G,locale:o,onNext:ut,onPrevious:He,hasNextLevel:s!=="month"&&s!=="year",onLevelClick:()=>_e("decade"),levelControlAriaLabel:k?.yearLevelControl,nextLabel:k?.nextYear??M,nextIcon:f,previousLabel:k?.previousYear??L,previousIcon:i,yearLabelFormat:ae,__onControlMouseEnter:U,__onControlClick:(ve,ke)=>{X&&Te(ke),_e(Vt("month",c,s)),z?.(ke)},__preventFocus:O,__stopPropagation:R,withCellSpacing:j,headerControlsOrder:ee,...Ve}),Ee==="decade"&&w.jsx(vr,{decade:je,minDate:Y,maxDate:ce,yearsListFormat:ie,getYearControlProps:ue,locale:o,onNext:Ge,onPrevious:Qe,numberOfColumns:x,nextLabel:k?.nextDecade??M,nextIcon:f,previousLabel:k?.previousDecade??L,previousIcon:i,decadeLabelFormat:A,__onControlMouseEnter:q,__onControlClick:(ve,ke)=>{re&&Te(ke),_e(Vt("year",c,s)),I?.(ke)},__preventFocus:O,__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:x,ariaLabels:S,nextLabel:k,previousLabel:M,onYearSelect:L,onMonthSelect:I,onYearMouseEnter:z,onMonthMouseEnter:q,onNextMonth:U,onPreviousMonth:ee,onNextYear:re,onPreviousYear:X,onNextDecade:H,onPreviousDecade:V,withCellSpacing:Z,highlightToday:W,__updateDateOnYearSelect:le,__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:K,getDayAriaLabel:J,monthLabelFormat:te,monthsListFormat:G,getMonthControlProps:ae,yearLabelFormat:ie,yearsListFormat:ue,getYearControlProps:A,decadeLabelFormat:N,allowSingleDateInRange:$,allowDeselect:B,minDate:Y,maxDate:ce,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:x,ariaLabels:S,nextLabel:k,previousLabel:M,onYearSelect:L,onMonthSelect:I,onYearMouseEnter:z,onMonthMouseEnter:q,onNextMonth:U,onPreviousMonth:ee,onNextYear:re,onPreviousYear:X,onNextDecade:H,onPreviousDecade:V,withCellSpacing:Z,highlightToday:W,__updateDateOnYearSelect:le,__updateDateOnMonthSelect:oe,__setDateRef:D,withWeekNumbers:b,headerControlsOrder:u,firstDayOfWeek:d,weekdayFormat:m,weekendDays:f,getDayProps:i,excludeDate:v,renderDay:E,hideOutsideDates:j,hideWeekdays:K,getDayAriaLabel:J,monthLabelFormat:te,monthsListFormat:G,getMonthControlProps:ae,yearLabelFormat:ie,yearsListFormat:ue,getYearControlProps:A,decadeLabelFormat:N,allowSingleDateInRange:$,allowDeselect:B,minDate:Y,maxDate:ce,locale:o},others:l}}function hu(t){if(t===null)return null;const e=new Date(t);return Number.isNaN(e.getTime())||!t?null:de(e).format("YYYY-MM-DD")}function fu({date:t,maxDate:e,minDate:r}){return!(t==null||Number.isNaN(new Date(t).getTime())||e&&de(t).isAfter(e,"date")||r&&de(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:x,valueFormat:S,dateParser:k,minDate:M,maxDate:L,fixOnBlur:I,onFocus:z,onBlur:q,onClick:U,onKeyDown:ee,readOnly:re,name:X,form:H,rightSection:V,unstyled:Z,classNames:W,styles:le,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:K,others:J}=du(f),te=pt(),ae=k||(ne=>{const fe=de(ne,S,te.getLocale(x)).toDate();return Number.isNaN(fe.getTime())?hu(ne):de(fe).format("YYYY-MM-DD")}),ie=oe!==void 0?oe:g,ue=ne=>ne?de(ne).locale(te.getLocale(x)).format(S):"",[A,N,$]=dn({type:"default",value:c,defaultValue:h,onChange:a}),[B,Y]=dn({type:"default",value:D,defaultValue:h||C,onChange:b});Q.useEffect(()=>{$&&c!==null&&Y(c)},[$,c]);const[ce,o]=Q.useState(ue(A));Q.useEffect(()=>{o(ue(A))},[te.getLocale(x)]);const l=ne=>{const fe=ne.currentTarget.value;if(o(fe),j(!0),fe.trim()===""&&(oe||g))N(null);else{const me=ae(fe);me&&fu({date:me,minDate:M,maxDate:L})&&(N(me),Y(me))}},p=ne=>{q?.(ne),j(!1),I&&o(ue(A))},O=ne=>{z?.(ne),j(!0)},R=ne=>{U?.(ne),j(!0)},F=ne=>{ne.key==="Escape"&&j(!1),ee?.(ne)},se=ne=>({...P?.(ne),selected:de(A).isSame(ne,"day"),onClick:fe=>{P?.(ne).onClick?.(fe);const me=ie&&de(A).isSame(ne,"day")?null:ne;N(me),!$&&me&&o(ue(me)),j(!1)}}),he=w.jsx(T.Input.ClearButton,{onClick:()=>{N(null),!$&&o(""),j(!1)},unstyled:Z,...y}),pe=g&&!!A&&!re&&!m;return Ne.useDidUpdate(()=>{A!==void 0&&!E&&o(ue(A))},[A]),Ne.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:Z,..._,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:ce,onChange:l,onBlur:p,onFocus:O,onClick:R,onKeyDown:F,readOnly:re,rightSection:V,__clearSection:he,__clearable:pe,...n,...J,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",...K,classNames:W,styles:le,unstyled:Z,__preventFocus:!0,minDate:M,maxDate:L,locale:x,getDayProps:se,size:n.size,date:B,onDateChange:Y,getMonthControlProps:ne=>({selected:typeof A=="string"?cn(ne,A):!1,...u?.(ne)}),getYearControlProps:ne=>({selected:typeof A=="string"?de(ne).isSame(A,"year"):!1,...d?.(ne)}),attributes:s.attributes})})]})}),w.jsx(Zo,{name:X,form:H,value:A,type:"default"})]})});Cr.classes={...T.Input.classes,..._r.classes},Cr.displayName="@mantine/dates/DateInput";function ps(t){const e=Ke.c(47),{fields:r,onClose:n,queryKey:s,apiPath:c,steps:h,onCreated:a}=t,[g,y]=Q.useState(0),[_,P]=Q.useState(!1),[x,S]=Q.useState(),{mutateAsync:k,isError:M,error:L,isPending:I}=qo(c,s),{mutateAsync:z,isPending:q}=sn(c,s),U=I||q;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 X=re;let H;e[4]!==r?(H=r.reduce(yu,{}),e[4]=r,e[5]=H):H=e[5];let V;e[6]!==r?(V=r.filter(mu).reduce(gu,{}),e[6]=r,e[7]=V):V=e[7];let Z;e[8]!==H||e[9]!==V?(Z={mode:"uncontrolled",initialValues:H,validate:V},e[8]=H,e[9]=V,e[10]=Z):Z=e[10];const W=On.useForm(Z);let le;e[11]!==W||e[12]!==x?(le=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(),...x&&{id:x}},W.setValues,P,{error:W.getInputProps(i.id).error,required:i.required})]},i.id)},e[11]=W,e[12]=x,e[13]=le):le=e[13];const oe=le;let D;e[14]!==L?.message||e[15]!==L?.name||e[16]!==M?(D=M&&w.jsx(T.Alert,{variant:"outline",color:"red",title:L?.name??"Fehler aufgetreten",mb:"lg",children:L?.message??"Fehler aufgetreten"}),e[14]=L?.message,e[15]=L?.name,e[16]=M,e[17]=D):D=e[17];let C;e[18]!==g||e[19]!==k||e[20]!==W||e[21]!==M||e[22]!==n||e[23]!==a||e[24]!==x||e[25]!==X.length||e[26]!==z?(C=W.onSubmit(async f=>{if(x)await z({...f,id:x});else{const i=await k(f);S(i.id),a?.(i.id)}X.length&&g<X.length-1?M||y(g+1):M||(W.setInitialValues(f),W.reset(),n())}),e[18]=g,e[19]=k,e[20]=W,e[21]=M,e[22]=n,e[23]=a,e[24]=x,e[25]=X.length,e[26]=z,e[27]=C):C=e[27];let b;e[28]!==g||e[29]!==r||e[30]!==oe||e[31]!==h||e[32]!==X?(b=X.length?w.jsx(T.Stepper,{active:g,size:"sm",children:X.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]=X,e[33]=b):b=e[33];let u;e[34]!==g||e[35]!==_||e[36]!==U||e[37]!==n||e[38]!==X.length?(u=!_&&w.jsxs(T.Group,{mt:"md",justify:"end",children:[w.jsx(T.Button,{onClick:()=>X.length?g===0?n():y(g-1):n(),variant:"outline",children:X.length?g===0?"Abbrechen":"Zurück":"Abbrechen"}),w.jsx(T.Button,{type:"submit",loading:U,children:X.length?g===X.length-1?"Speichern":"Weiter":"Speichern"})]}),e[34]=g,e[35]=_,e[36]=U,e[37]=n,e[38]=X.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,x]=Q.useState(""),[S,k]=Q.useState("");return w.jsx(wu,{value:{sourceColumn:P,setSourceColumn:x,targetColumn:S,setTargetColumn:k,columnsToggle:s,setColumnsToggle:c,swapColumns:()=>{if(!r||!n||!P||!S)return;let M=r.indexOf(P),L=r.indexOf(S);if(M!==-1&&L!==-1){let I=r.splice(M,1)[0];r.splice(L,0,I),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,x){let S=[];return P.forEach(k=>{x.find(M=>M.accessor===k)&&S.push(k)}),x.forEach(k=>{S.includes(k.accessor)||S.push(k.accessor)}),S}let s=e&&e.map(P=>P.accessor)||[],[c,h]=Ne.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(V=>V.resizable&&!V.hidden&&V.accessor!=="__selection__"),[e]),_=Q.useMemo(()=>e.filter(V=>V.resizable&&!V.hidden&&V.accessor!=="__selection__"),[e]),P=Q.useMemo(()=>_.some(V=>V.width===void 0||V.width===""||V.width==="initial"),[_]),x=Q.useCallback(()=>e.filter(V=>V.accessor!=="__selection__").map(V=>({[V.accessor]:V.width??"auto"})),[e]),[S,k]=Ne.useLocalStorage({key:t?`${t}-columns-width`:"",defaultValue:t?x():void 0,getInitialValueInEffect:!1}),[M,L]=Q.useState(()=>x());Q.useEffect(()=>{g(!1)},[]);let I=Q.useCallback(()=>{if(!n?.current||a)return{};let V=n.current,Z=Array.from(V.querySelectorAll("th[data-accessor]")),W={};return Z.forEach(le=>{let oe=le.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=le.getBoundingClientRect();W[oe]=Math.round(C.width)}}),W},[n,_,a]),z=Q.useCallback(V=>{let Z=V.filter(le=>le.accessor!=="__selection__"),W=M.map(le=>{let oe=Object.keys(le)[0],D=Z.find(C=>C.accessor===oe);return D?{[oe]:D.width}:le});L(W),t&&k(W)},[M,t,k]),q=Q.useCallback(V=>{z(V)},[z]),U=Q.useCallback(()=>{if(!(!n?.current||!s||a))if(P)s(!1),requestAnimationFrame(()=>{requestAnimationFrame(()=>{let V=I();h.current={...h.current,...V};let Z=e.filter(W=>W.accessor!=="__selection__").map(W=>{let le=W.accessor,oe=S?.find(C=>Object.keys(C)[0]===le);if(oe&&oe[le]!=="auto")return{[le]:oe[le]};let D=V[le];return D?{[le]:`${D}px`}:{[le]:W.width??"auto"}});L(Z),setTimeout(()=>{s(!0),c.current=!0},10)})});else{let V=e.filter(Z=>Z.accessor!=="__selection__").map(Z=>({[Z.accessor]:Z.width??"auto"}));L(V),s(!0),c.current=!0}},[n,s,a,P,I,e,S]),ee=U;Q.useEffect(()=>{if(!y||!s||a){s?.(!1);return}c.current=!1;let V=setTimeout(()=>{U()},50);return()=>clearTimeout(V)},[y,s,a,U]),Q.useEffect(()=>{a||!t||!r||S&&S.length>0&&L(S)},[a,t,r,S]);let re=Q.useCallback(()=>{t&&k(x()),h.current={},c.current=!1,s&&(s(!1),setTimeout(()=>{U()},10))},[t,k,x,s,U]),X=Q.useCallback((V,Z)=>{z([{accessor:V,width:Z}])},[z]),H=Q.useMemo(()=>y?M.filter(V=>{let Z=Object.keys(V)[0];return _.some(W=>W.accessor===Z)}).every(V=>{let Z=Object.values(V)[0];return Z==="auto"||Z==="initial"}):!1,[y,M,_]);return{columnsWidth:M,setColumnsWidth:z,setColumnWidth:X,setMultipleColumnWidths:q,resetColumnsWidth:re,hasResizableColumns:y,allResizableWidthsInitial:H,measureAndSetColumnWidths:ee}}function ku({key:t,columns:e=[],getInitialValueInEffect:r=!0}){function n(P,x){let S=[];return P.forEach(k=>{x.find(M=>M.accessor===k.accessor)&&S.push(k)}),x.forEach(k=>{S.find(M=>M.accessor===k.accessor)||S.push({accessor:k.accessor,defaultToggle:k.defaultToggle||!0,toggleable:k.toggleable,toggled:k.defaultToggle===void 0?!0:k.defaultToggle})}),S}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]=Ne.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:x,setColumnsWidth:S,setColumnWidth:k,setMultipleColumnWidths:M,resetColumnsWidth:L,hasResizableColumns:I,allResizableWidthsInitial:z,measureAndSetColumnWidths:q}=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:x.find(ee=>ee[U?.accessor])?.[U?.accessor]}):e,[e,h,y,x]),setColumnsOrder:a,columnsOrder:h,resetColumnsOrder:g,columnsToggle:y,setColumnsToggle:_,resetColumnsToggle:P,columnsWidth:x,setColumnsWidth:S,setColumnWidth:k,setMultipleColumnWidths:M,resetColumnsWidth:L,hasResizableColumns:I,allResizableWidthsInitial:z,measureAndSetColumnWidths:q}},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 et(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(()=>{}),x=Q.useRef(()=>{}),S=Q.useCallback(k=>{_.current.onScroll?.(k),P.current()},[]);return Q.useEffect(()=>gn(h.current,k=>{et(n.current,vs,`${k.height}px`)},()=>et(n.current,vs,"0")),[h.current]),Q.useEffect(()=>gn(a.current,k=>{et(n.current,bs,`${k.height}px`)},()=>et(n.current,bs,"0")),[a.current]),Q.useEffect(()=>gn(g.current,k=>{et(n.current,ws,`${k.width}px`)},()=>et(n.current,ws,"0")),[g.current]),ms(()=>{if(typeof window===void 0)return;let k={top:!0,bottom:!0,left:!0,right:!0},M={width:0,height:0},L={width:0,height:0};function I(re,X){let H=k[re];return k[re]=X,et(n.current,`--mantine-datatable-${re}-shadow-opacity`,X?"0":"1"),H}function z(){let re=M.height-L.height,X=re<0;et(n.current,"--mantine-datatable-footer-position",X?"relative":"sticky"),et(n.current,"--mantine-datatable-footer-bottom",X?`${re}px`:"0")}function q(){y.current.withRowBorders&&M.height<L.height?et(n.current,_s,`${T.rem("1px")} solid var(--mantine-datatable-border-color)`):et(n.current,_s,"unset")}x.current=q;function U(){let re=_.current,X=c.current,H=X?.scrollTop??0,V=X?.scrollLeft??0,Z=H===0,W=M.height-H-L.height<1,le=I("top",Z),oe=I("bottom",W);Z&&Z!==le&&re.onScrollToTop?.(),W&&W!==oe&&re.onScrollToBottom?.();let D=X?getComputedStyle(X).direction==="rtl":!1,C=(X?.scrollWidth??0)-L.width,b,u;if(D){let f=Math.abs(V);u=f<1,b=C-f<1}else b=V<1,u=M.width-V-L.width<1;let d=I("left",b),m=I("right",u);b&&b!==d&&re.onScrollToLeft?.(),u&&u!==m&&re.onScrollToRight?.()}P.current=U;let ee=new ResizeObserver(re=>{for(let X of re)switch(X.target.tagName){case"TABLE":{M=pn(X);break}case"DIV":{L=pn(X);break}}U(),z(),q()});return ee.observe(s.current),ee.observe(c.current),()=>{ee.disconnect()}},[]),ms(()=>{x.current()},[e]),{refs:r,onScroll:S}}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 Ne.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 Be(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(_=>Be(_,r)):y&&(n=e.filter((_,P)=>y({record:_,index:P})).map(_=>Be(_,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 x=S=>c?.(s.filter(k=>k!==Be(S,r)));return{expandOnClick:g!=="always"&&g!=="never",isRowExpanded:S=>g==="always"?!0:s.includes(Be(S,r)),isExpandable:({record:S,index:k})=>a?a({record:S,index:k}):!0,expandRow:S=>{let k=Be(S,r);c?.(y?[...s,k]:[k])},collapseRow:x,collapseProps:_,content:({record:S,index:k})=>()=>P({record:S,index:k,collapse:()=>x(S)})}}}function Lu(t,e){let[r,n]=Q.useState(t),[s,c]=Q.useState(t),h=Ne.useTimeout(()=>n(!0),0),a=Ne.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",Mt="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:x,footer:S,footerClassName:k,footerStyle:M,noWrap:L,ellipsis:I}={...n,...g};return w.jsx(Iu,{className:k,style:M,visibleMediaQuery:_,textAlign:P,width:x,title:S,noWrap:L,ellipsis:I},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:x}){let S=Q.useMemo(()=>e&&e.length>0?e:r&&r.length>0?vn([{id:t,columns:e,groups:r}]):[],[e,r,t]),k=Q.useMemo(()=>S.map(({visibleMediaQuery:ee})=>ee),[S]),M=ju(k),L=Q.useMemo(()=>bn({columns:e,groups:r},M),[t,e,r,M]),I=Q.useMemo(()=>y.reduce((ee,re)=>ee+bn(re,M),0),[y,M]),z=r&&r.length>0?1:a-g,q=I+L<x,U=Ru(_,q,P);return L>0?w.jsx(T.TableTh,{colSpan:L,rowSpan:z>1?z: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}]=Ne.useDisclosure(!1),a=e?Uu:Wu,g=Ne.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(x=>{if(x.preventDefault(),x.stopPropagation(),!r.current)return;let S=r.current,k=S.nextElementSibling;for(;k;){let ee=k.getAttribute("data-accessor");if(ee&&ee!=="__selection__")break;k=k.nextElementSibling}if(!k)return;let M=k.getAttribute("data-accessor");if(!M)return;let L=M==="__selection__";s(!0),c.current=x.clientX;let I=S.offsetWidth,z=k.offsetWidth;h.current={current:I,next:z};let q=ee=>{if(!r.current)return;let re=r.current,X=re.nextElementSibling;if(!X)return;let H=ee.clientX-c.current;g&&(H=-H);let V=50,Z=h.current.current-V,W=h.current.next-V,le=Math.max(-Z,Math.min(H,W)),oe=h.current.current+le,D=h.current.next-le;re.style.width=`${oe}px`,X.style.width=`${D}px`,re.style.minWidth=`${oe}px`,re.style.maxWidth=`${oe}px`,X.style.minWidth=`${D}px`,X.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 X=parseInt(ee.style.width)||ee.offsetWidth,H=re?parseInt(re.style.width)||re.offsetWidth:0,V=[{accessor:e,width:`${X}px`}];if(re&&!L){let Z=re.getAttribute("data-accessor");Z&&V.push({accessor:Z,width:`${H}px`})}setTimeout(()=>{y(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,g,y]),P=Q.useCallback(()=>{if(!r.current)return;let x=r.current,S=x.nextElementSibling;x.style.width="",x.style.minWidth="",x.style.maxWidth="";let k=[{accessor:e,width:"auto"}];if(S){S.style.width="",S.style.minWidth="",S.style.maxWidth="";let M=S.getAttribute("data-accessor");M&&M!=="__selection__"&&k.push({accessor:M,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:x=>x.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:x,onSortStatusChange:S,filter:k,filterPopoverProps:M,filterPopoverDisableClickOutside:L,filtering:I,sortKey:z}){let{setSourceColumn:q,setTargetColumn:U,swapColumns:ee,setColumnsToggle:re}=fn(),[X,H]=Q.useState(!1),V=Q.useRef(null);if(!xr(n))return null;let Z=s??mn(r),W=typeof Z=="string"?Z:void 0,le=c&&S?m=>{m?.defaultPrevented||S({sortKey:z,columnAccessor:r,direction:x?.columnAccessor===r?x.direction==="asc"?"desc":"asc":x?.direction??"asc"})}:void 0,oe=m=>{m.stopPropagation(),q(r),H(!1)},D=m=>{m.preventDefault(),U(r),H(!0)},C=()=>{U(r),H(!1),ee()},b=()=>{H(!0)},u=()=>{H(!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:le,onKeyDown:m=>m.key==="Enter"&&le?.(),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":h,"mantine-datatable-header-cell-drag-over":X}),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:Z})]}),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||x?.columnAccessor===r?w.jsx(w.Fragment,{children:x?.columnAccessor===r?w.jsx(T.Center,{className:Pe("mantine-datatable-header-cell-sortable-icon",{"mantine-datatable-header-cell-sortable-icon-reversed":x.direction==="desc"}),role:"img","aria-label":`Sorted ${x.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:M,isActive:!!I,filterPopoverDisableClickOutside:L,children:k}):null]}),g&&r!=="__selection__"?w.jsx(Vu,{accessor:r,columnRef:V}):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",{[Mt]: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:Mt}: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:x,onSelectionChange:S,selectionCheckboxProps:k,selectorCellShadowVisible:M,selectionColumnClassName:L,selectionColumnStyle:I,withColumnBorders:z=!1,ref:q}){let U=g?xs(g):0,ee=U>0?U+1:1,re=_?w.jsx(Ju,{ref:t,className:L,style:I,trigger:y,shadowVisible:M,checked:P,indeterminate:x,checkboxProps:k,onChange:S,rowSpan:g?ee:void 0}):null,{columnsToggle:X,setColumnsToggle:H}=fn(),[V,Z]=Q.useState(!1),W=h.some(D=>D.toggleable),le=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:q,onContextMenu:W?D=>{D.preventDefault(),Z(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:z,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:K,titleClassName:J,titleStyle:te,filter:G,filterPopoverProps:ae,filterPopoverDisableClickOutside:ie,filtering:ue,sortKey:A}={...a,...C};return w.jsx(Ku,{accessor:u,className:J,style:te,visibleMediaQuery:d,textAlign:m,width:f,title:i,sortable:v,draggable:E,toggleable:j,resizable:K&&b<h.length-1,sortStatus:n,sortIcons:s,sortKey:A,onSortStatusChange:c,filter:G,filterPopoverProps:ae,filterPopoverDisableClickOutside:ie,filtering:ue},u)})]})]});return W?w.jsxs(T.Popover,{position:"bottom",withArrow:!0,shadow:"md",opened:V,onChange:Z,children:[w.jsx(T.PopoverTarget,{children:oe}),w.jsx(T.PopoverDropdown,{children:w.jsx(T.Stack,{children:X.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:le[D.accessor],checked:D.toggled,onChange:C=>{H(X.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 Ae(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":Ae(e,t,"light"),"--mantine-datatable-color-dark":Ae(e,t,"dark"),"--mantine-datatable-background-color-light":Ae(r,t,"light"),"--mantine-datatable-background-color-dark":Ae(r,t,"dark"),"--mantine-datatable-border-color-light":Ae(n,t,"light"),"--mantine-datatable-border-color-dark":Ae(n,t,"dark"),"--mantine-datatable-row-border-color-light":Ae(s,t,"light"),"--mantine-datatable-row-border-color-dark":Ae(s,t,"dark"),"--mantine-datatable-striped-color-light":Ae(c,t,"light"),"--mantine-datatable-striped-color-dark":Ae(c,t,"dark"),"--mantine-datatable-highlight-on-hover-color-light":Ae(h,t,"light"),"--mantine-datatable-highlight-on-hover-color-dark":Ae(h,t,"dark")}}function ks({theme:t,paginationActiveTextColor:e,paginationActiveBackgroundColor:r}){return{"--mantine-datatable-pagination-active-text-color-light":Ae(e,t,"light"),"--mantine-datatable-pagination-active-text-color-dark":Ae(e,t,"dark"),"--mantine-datatable-pagination-active-background-color-light":Ae(r,t,"light"),"--mantine-datatable-pagination-active-background-color-dark":Ae(r,t,"dark")}}function rc({theme:t,color:e,backgroundColor:r}){return{"--mantine-datatable-row-color-light":Ae(e,t,"light"),"--mantine-datatable-row-color-dark":Ae(e,t,"dark"),"--mantine-datatable-row-background-color-light":Ae(r,t,"light"),"--mantine-datatable-row-background-color-dark":Ae(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:x,totalRecords:S,recordsPerPage:k,onRecordsPerPageChange:M,recordsPerPageLabel:L,recordsPerPageOptions:I,recordsLength:z,horizontalSpacing:q,paginationWrapBreakpoint:U,getPaginationControlProps:ee,getPaginationItemProps:re,renderPagination:X}){let H;if(S){let C=(n-1)*k+1,b=C+(z||0)-1;H=x({from:C,to:b,totalRecords:S})}else H=r?_:P;let V=S&&k?Math.max(1,Math.ceil(S/k)):1,Z=S?(n-1)*(k??0)+1:void 0,W=S?(Z??1)+(z??0)-1:void 0,le=!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:H}),PageSizeSelector:C=>I?w.jsx(oc,{activeTextColor:a,activeBackgroundColor:g,size:y,label:L,values:I,value:k,onChange:M,...C}):w.jsx(w.Fragment,{}),Pagination:C=>w.jsx(T.Pagination,{classNames:{root:Pe("mantine-datatable-pagination-pages",{"mantine-datatable-pagination-pages-fetching":r||!z}),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:V,getControlProps:ee,getItemProps:re,...C})},D={state:{paginationSize:y,page:n,totalPages:V,totalRecords:S,recordsPerPage:k,recordsLength:z,fetching:r,from:Z,to:W,isWrapped:le},actions:{setPage:C=>s?.(C),setRecordsPerPage:M?C=>M(C):void 0},Controls:oe};return w.jsx(T.Box,{px:q??"xs",py:"xs",className:Pe("mantine-datatable-pagination",t),style:[{flexDirection:le?"column":"row"},e],children:typeof X=="function"?X(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:x,render:S,defaultRender:k,customCellAttributes:M}){return xr(r)?w.jsx(T.TableTd,{className:Pe({[wn]:g||y,[_n]:y,[Mt]: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,...M?.(n,s),children:S?S(n,s):k?k(n,s,x):Cs(n,x)}):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,x=S=>{S.stopPropagation(),s==="cell"&&P&&c?.(S)};return w.jsx(T.TableTd,{className:Pe("mantine-datatable-row-selector-cell",{[Mt]:s==="cell"&&P},t),style:e,"data-shadow-visible":h||void 0,onClick:x,children:w.jsx(T.Checkbox,{classNames:P?{input:Mt}: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:x,onDoubleClick:S,onContextMenu:k,onCellClick:M,onCellDoubleClick:L,onCellContextMenu:I,expansion:z,customAttributes:q,color:U,backgroundColor:ee,className:re,style:X,selectorCellShadowVisible:H,selectionColumnClassName:V,selectionColumnStyle:Z,rowFactory:W}){let le=w.jsxs(w.Fragment,{children:[h&&w.jsx(lc,{className:V,style:Z,record:t,index:e,trigger:c,withRightShadow:H,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:K,cellsClassName:J,cellsStyle:te,customCellAttributes:G}={...n,...u};return w.jsx(ic,{className:typeof J=="function"?J(t,e):J,style:te?.(t,e),visibleMediaQuery:f,record:t,index:e,onClick:M?ae=>M({event:ae,record:t,index:e,column:u,columnIndex:d}):void 0,onDoubleClick:L?ae=>L({event:ae,record:t,index:e,column:u,columnIndex:d}):void 0,onContextMenu:I?ae=>I({event:ae,record:t,index:e,column:u,columnIndex:d}):void 0,accessor:m,textAlign:i,noWrap:v,ellipsis:E,width:j,render:K,defaultRender:s,customCellAttributes:G},m)})]}),oe=z&&w.jsx(ac,{colSpan:r.filter(({hidden:C})=>!C).length+(h?1:0),open:z.isRowExpanded(t),content:z.content({record:t,index:e}),collapseProps:z.collapseProps}),D=cc({record:t,index:e,selectionChecked:a,onClick:x,onDoubleClick:S,onContextMenu:k,expansion:z,customAttributes:q,color:U,backgroundColor:ee,className:re,style:X});return W?W({record:t,index:e,rowProps:D,children:le,expandedElement:oe}):w.jsxs(w.Fragment,{children:[w.jsx(T.TableTr,{...D,children:le}),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",{[Mt]:n||s||h?.isExpandable({record:t,index:e})&&h?.expandOnClick},{[Ds]:c},typeof _=="function"?_(t,e):_),"data-selected":r||void 0,onClick:x=>{if(h){let{isExpandable:S,isRowExpanded:k,expandOnClick:M,expandRow:L,collapseRow:I}=h;S({record:t,index:e})&&M&&(k(t)?I(t):L(t))}n?.({event:x,record:t,index:e})},onDoubleClick:s?x=>s({event:x,record:t,index:e}):void 0,onContextMenu:c?x=>c({event:x,record:t,index:e}):void 0,style:[g||y?x=>{let S=g?.(t,e),k=y?.(t,e);return rc({theme:x,color:S,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:x,pinLastColumn:S,defaultColumnProps:k,defaultColumnRender:M,idAccessor:L="id",records:I,selectionTrigger:z="checkbox",selectedRecords:q,onSelectedRecordsChange:U,selectionColumnClassName:ee,selectionColumnStyle:re,isRecordSelectable:X,selectionCheckboxProps:H,allRecordsSelectionCheckboxProps:V={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:Z=(ot,Ht)=>({"aria-label":`Select record ${Ht+1}`}),sortStatus:W,sortIcons:le,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:K,paginationSize:J="sm",paginationText:te=({from:ot,to:Ht,totalRecords:Cn})=>`${ot} - ${Ht} / ${Cn}`,paginationWrapBreakpoint:G="sm",getPaginationControlProps:ae=ot=>ot==="previous"?{"aria-label":"Previous page"}:ot==="next"?{"aria-label":"Next page"}:{},getPaginationItemProps:ie,renderPagination:ue,loaderBackgroundBlur:A,customLoader:N,loaderSize:$,loaderType:B,loaderColor:Y,loadingText:ce="...",emptyState:o,noRecordsText:l="No records",noRecordsIcon:p,highlightOnHover:O,striped:R,noHeader:F,onRowClick:se,onRowDoubleClick:he,onRowContextMenu:pe,onCellClick:ne,onCellDoubleClick:fe,onCellContextMenu:me,onScroll:ge,onScrollToTop:Se,onScrollToBottom:xe,onScrollToLeft:De,onScrollToRight:qe,c:Ee,backgroundColor:_e,borderColor:st,rowBorderColor:Te,stripedColor:Ve,highlightOnHoverColor:Ie,rowColor:tt,rowBackgroundColor:it,rowExpansion:je,rowClassName:at,rowStyle:yt,customRowAttributes:ut,scrollViewportRef:He,scrollAreaProps:Ge,tableRef:Qe,bodyRef:ct,m:_t,my:ve,mx:ke,mt:Ye,mb:rt,ml:Ot,mr:Me,className:Oe,classNames:nt,style:Re,styles:Ce,rowFactory:Ze,tableWrapper:ze,...vt}){let ot=Q.useMemo(()=>P?vn(P):y,[y,P]),[Ht,Cn]=Q.useState(!1),{refs:lt,onScroll:jc}=Mu({scrollCallbacks:{onScroll:ge,onScrollToTop:Se,onScrollToBottom:xe,onScrollToLeft:De,onScrollToRight:qe},withRowBorders:vt.withRowBorders}),xn=Pu({key:_,columns:ot,headerRef:lt.header,scrollViewportRef:lt.scrollViewport,onFixedLayoutChange:Cn}),$c=Ne.useMergedRef(lt.table,Qe),Rc=Ne.useMergedRef(lt.scrollViewport,He),Nc=Nu({rowExpansion:je,records:I,idAccessor:L}),Pr=Q.useRef(!1),$s=Q.useRef(C),Sn=Q.useRef(I),Lc=Q.useCallback(be=>{Pr.current=!0,Sn.current=I,b(be)},[b,I]);Q.useEffect(()=>{$s.current!==C&&(Pr.current=!0,Sn.current=I,$s.current=C)},[C,I]);let Mr=I?.length;Q.useLayoutEffect(()=>{if(!Pr.current||g||I===Sn.current)return;let be=lt.scrollViewport.current;if(!be)return;let Ct=requestAnimationFrame(()=>{be.scrollTo({top:0,left:0}),Pr.current=!1});return()=>cancelAnimationFrame(Ct)},[g,I,lt.scrollViewport]);let Rs=I?.map(be=>Be(be,L)),At=!!q,Gt=q?.map(be=>Be(be,L)),Ns=Rs!==void 0&&Gt!==void 0&&Gt.length>0,Dn=X?I?.filter(X):I,Or=Dn?.map(be=>Be(be,L)),Ar=Ns&&Or.every(be=>Gt.includes(be)),Bc=Ns&&Or.some(be=>Gt.includes(be)),Ic=Q.useCallback(()=>{q&&U&&U(Ar?q.filter(be=>!Or.includes(Be(be,L))):yn([...q,...Dn],be=>Be(be,L)))},[Ar,L,U,Or,Dn,q]),{lastSelectionChangeIndex:Er,setLastSelectionChangeIndex:Yc}=Ou(Rs),kn=At&&!x,zc={m:_t,my:ve,mx:ke,mt:Ye,mb:rt,ml:Ot,mr:Me},Fc=Q.useCallback(({children:be})=>ze?ze({children:be}):be,[ze]);return w.jsx(gs,{...xn,children:w.jsxs(T.Box,{ref:lt.root,...zc,className:Pe("mantine-datatable",{"mantine-datatable-with-border":t},Oe,nt?.root),style:[be=>({...tc({theme:be,c:Ee,backgroundColor:_e,borderColor:st,rowBorderColor:Te,stripedColor:Ve,highlightOnHoverColor:Ie}),borderRadius:be.radius[e]||e,boxShadow:be.shadows[h]||h,height:n,minHeight:s,maxHeight:c}),Re,Ce?.root,{position:"relative"}],children:[w.jsx(dc,{viewportRef:Rc,leftShadowBehind:At||!!x,rightShadowBehind:S,onScrollPositionChange:jc,scrollAreaProps:Ge,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":S,"mantine-datatable-selection-column-visible":At,"mantine-datatable-pin-first-column":x,"mantine-datatable-resizable-columns":xn.hasResizableColumns&&Ht},nt?.table),style:{...Ce?.table},"data-striped":Mr&&R||void 0,"data-highlight-on-hover":O||void 0,...vt,children:[F?null:w.jsx(gs,{...xn,children:w.jsx(Xu,{ref:lt.header,selectionColumnHeaderRef:lt.selectionColumnHeader,className:nt?.header,style:Ce?.header,columns:ot,defaultColumnProps:k,groups:P,sortStatus:W,sortIcons:le,onSortStatusChange:oe,selectionTrigger:z,selectionVisible:At,selectionChecked:Ar,selectionIndeterminate:Bc&&!Ar,onSelectionChange:Ic,selectionCheckboxProps:{...H,...V},selectorCellShadowVisible:kn,selectionColumnClassName:ee,selectionColumnStyle:re,withColumnBorders:vt.withColumnBorders})}),w.jsx("tbody",{ref:ct,children:Mr?I.map((be,Ct)=>{let Pn=Be(be,L),Mn=Gt?.includes(Pn)||!1,Ls;return U&&q&&(Ls=Wc=>{if(Wc.nativeEvent.shiftKey&&Er!==null){let Et=I.filter(Ct>Er?(xt,St)=>St>=Er&&St<=Ct&&(X?X(xt,St):!0):(xt,St)=>St>=Ct&&St<=Er&&(X?X(xt,St):!0));U(Mn?$u(q,Et,xt=>Be(xt,L)):yn([...q,...Et],xt=>Be(xt,L)))}else U(Mn?q.filter(Et=>Be(Et,L)!==Pn):yn([...q,be],Et=>Be(Et,L)));Yc(Ct)}),w.jsx(uc,{record:be,index:Ct,columns:ot,defaultColumnProps:k,defaultColumnRender:M,selectionTrigger:z,selectionVisible:At,selectionChecked:Mn,onSelectionChange:Ls,isRecordSelectable:X,selectionCheckboxProps:H,getSelectionCheckboxProps:Z,onClick:se,onDoubleClick:he,onCellClick:ne,onCellDoubleClick:fe,onContextMenu:pe,onCellContextMenu:me,expansion:Nc,color:tt,backgroundColor:it,className:at,style:yt,customAttributes:ut,selectorCellShadowVisible:kn,selectionColumnClassName:ee,selectionColumnStyle:re,idAccessor:L,rowFactory:Ze},Pn)}):w.jsx(_u,{})}),ot.some(({footer:be})=>be)&&w.jsx(zu,{ref:lt.footer,className:nt?.footer,style:Ce?.footer,columns:ot,defaultColumnProps:k,selectionVisible:At,selectorCellShadowVisible:kn})]})})}),C&&w.jsx(sc,{className:nt?.pagination,style:Ce?.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:K,paginationSize:J,paginationText:te,paginationWrapBreakpoint:G,getPaginationControlProps:ae,getPaginationItemProps:ie,noRecordsText:l,loadingText:ce,recordsLength:Mr,renderPagination:ue}),w.jsx(ec,{fetching:g,backgroundBlur:A,customContent:N,size:$,type:B,color:Y}),w.jsx(xu,{icon:p,text:l,active:!g&&!Mr,children:o})]})})}function Ms(t){const e=Ke.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:x,isLoading:S}=Wo(c,s,h),{mutateAsync:k,isError:M,error:L,isPending:I}=sn(c,s);let z;e[0]!==r?(z=new Set(r.filter(vc).map(yc)),e[0]=r,e[1]=z):z=e[1];let q;e[2]!==z?(q=[...z],e[2]=z,e[3]=q):q=e[3];const U=q;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 X;e[8]!==ee||e[9]!==re?(X={mode:"uncontrolled",initialValues:ee,validate:re},e[8]=ee,e[9]=re,e[10]=X):X=e[10];const H=On.useForm(X);let V;e[11]!==x||e[12]!==r||e[13]!==H?(V=()=>{if(x){const b={...x};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]="")}),H.initialize(b),H.setValues(b)}},e[11]=x,e[12]=r,e[13]=H,e[14]=V):V=e[14];let Z;e[15]!==x?(Z=[x],e[15]=x,e[16]=Z):Z=e[16],Q.useEffect(V,Z);let W;e[17]!==H||e[18]!==h?(W=function(u){const d=H.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??"",...H.getInputProps(u.id),type:u.id.includes("email")?"email":void 0,required:u.required},H.key(u.id)),u.type==="number"&&w.jsx(T.NumberInput,{decimalSeparator:",",label:u.column.title,placeholder:u.placeholder??"",...H.getInputProps(u.id),required:u.required},H.key(u.id)),u.type==="date"&&w.jsx(Cr,{label:u.column.title,placeholder:u.placeholder??"",valueFormat:"DD.MM.YYYY",clearable:!0,...H.getInputProps(u.id),required:u.required},H.key(u.id)),u.type==="boolean"&&w.jsx(T.Checkbox,{mt:"md",label:u.column.title,...H.getInputProps(u.id,{type:"checkbox"}),required:u.required},H.key(u.id)),u.type==="textarea"&&w.jsx(T.Textarea,{label:u.column.title,placeholder:u.placeholder??"",...H.getInputProps(u.id),minRows:3,autosize:!0,required:u.required},H.key(u.id)),u.type==="custom"&&u.render&&u.render({...H.getValues(),id:h},H.setValues,P,{error:H.getInputProps(u.id).error,required:u.required})]},u.id)},e[17]=H,e[18]=h,e[19]=W):W=e[19];const le=W;let oe;e[20]!==M||e[21]!==L?.message||e[22]!==L?.name?(oe=M&&w.jsx(T.Alert,{variant:"outline",color:"red",title:L?.name??"Fehler aufgetreten",mb:"lg",children:L?.message??"Fehler aufgetreten"}),e[20]=M,e[21]=L?.message,e[22]=L?.name,e[23]=oe):oe=e[23];let D;e[24]!==g||e[25]!==r||e[26]!==H||e[27]!==_||e[28]!==h||e[29]!==S||e[30]!==I||e[31]!==M||e[32]!==n||e[33]!==le||e[34]!==a||e[35]!==U||e[36]!==k?(D=S?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:H.onSubmit(async b=>{await k({...b,id:h}),U.length&&g<U.length-1?M||y(g+1):M||(H.setInitialValues(b),H.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=>le(u))},b))}):r.map(b=>le(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:I,children:U.length?g===U.length-1?"Speichern":"Weiter":"Speichern"})]})]}),e[24]=g,e[25]=r,e[26]=H,e[27]=_,e[28]=h,e[29]=S,e[30]=I,e[31]=M,e[32]=n,e[33]=le,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),x=_||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:x,children:"Abbrechen"}),w.jsx(T.Button,{color:"red",loading:x,onClick:async()=>{P(!0);try{await Promise.all(g.map(S=>s(S.id))),y([])}finally{P(!1)}},children:"Löschen"})]})]}):w.jsx(w.Fragment,{})}function As(t,e){const r=Ke.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 x,S;switch(s){case"date":if(typeof g=="string"){const z=new Date(g.trim());x=isNaN(z.getTime())?null:z.getTime()}else g instanceof Date?x=g.getTime():x=null;if(typeof y=="string"){const z=new Date(y.trim());S=isNaN(z.getTime())?null:z.getTime()}else y instanceof Date?S=y.getTime():S=null;break;case"number":if(typeof g=="number")x=g;else{const z=String(g).trim(),q=parseFloat(z);x=isNaN(q)?null:q}if(typeof y=="number")S=y;else{const z=String(y).trim(),q=parseFloat(z);S=isNaN(q)?null:q}break;case"string":const k=typeof g=="string"?g:String(g),M=typeof y=="string"?y:String(y);x=k.toLowerCase().trim(),S=M.toLowerCase().trim();break;case"mixed":default:const L=String(g),I=String(y);x=L.toLowerCase().trim(),S=I.toLowerCase().trim();break}return x===null&&S===null?0:x===null?r==="asc"?1:-1:S===null||x<S?r==="asc"?-1:1:x>S?r==="asc"?1:-1:0})},js=[10,15,50,100,500];function wc(t){const e=Ke.c(112),{title:r,queryKey:n,connectedQueryKeys:s,apiPath:c,buttons:h,fields:a,selection:g,pagination:y,filters:_,actions:P,steps:x,defaultSort:S,onSortChange:k,createButtonText:M,queryParams:L,tabs:I,defaultTab:z,activeTab:q,onActiveTabChange:U,canUpdate:ee,canDelete:re,showRefresh:X,rowExpansion:H,onRowClick:V}=t,Z=X===void 0?!0:X,[W,le]=Q.useState(z||(I&&I.length>0?I[0].value:null)),oe=q!==void 0?q:W;let D;e[0]!==q||e[1]!==U?(D=Me=>{q===void 0&&le(Me),U&&U(Me)},e[0]=q,e[1]=U,e[2]=D):D=e[2];const C=D,b=I?.find(Me=>Me.value===oe)?.queryParams||{},u={...L,...b},d=u?"?"+Object.entries(u).filter(Ec).map(Ac).join("&"):"";let m;e[3]!==oe||e[4]!==n?(m=oe?[...n,oe]:n,e[3]=oe,e[4]=n,e[5]=m):m=e[5];const f=m,{data:i,isLoading:v,isError:E,isRefetching:j,refetch:K}=Uo(c+d,f),{queryClient:J}=ft();let te,G;e[6]!==i||e[7]!==s||e[8]!==J?(te=()=>{!i||!Array.isArray(i)||s?.forEach(Me=>J.invalidateQueries({queryKey:Me}))},G=[i,s,J],e[6]=i,e[7]=s,e[8]=J,e[9]=te,e[10]=G):(te=e[9],G=e[10]),Q.useEffect(te,G);const ae=!i||!Array.isArray(i)?[]:!_||_.length===0?i:i.filter(Me=>_.every(Oe=>{if(Oe.value===void 0)return!0;const nt=Oe.id;if(Oe.type==="query"){const Re=Me[nt];return Array.isArray(Oe.value)?Array.isArray(Re)?Re.some(Ce=>{if(typeof Ce=="string"||typeof Ce=="number")return Oe.value.includes(String(Ce));if(Ce&&typeof Ce=="object"){if("id"in Ce&&Oe.value.includes(Ce.id))return!0;for(const Ze in Ce){const ze=Ce[Ze];if(typeof ze=="string"&&Oe.value.includes(ze)||ze&&typeof ze=="object"&&"id"in ze&&Oe.value.includes(ze.id))return!0}}return!1}):Re&&typeof Re=="object"&&"id"in Re?Oe.value.includes(Re.id):!1:typeof Re=="string"&&Re.includes(Oe.value)}else if(Oe.type==="date"){const Re=Oe.value;if(!Re)return!0;const[Ce,Ze]=Re;if(!Ce&&!Ze)return!0;const ze=Me[nt];if(typeof ze=="string"){const vt=ze.split(" ")[0];if(Ce&&Ze)return vt>=Ce&&vt<=Ze;if(Ce&&!Ze)return vt>=Ce;if(!Ce&&Ze)return vt<=Ze}return!0}else if(Oe.type==="boolean")return Me[nt]===Oe.value;return!0})),ie=S?.field??a[0].id,ue=S?.direction??"desc";let A;e[11]!==ie||e[12]!==ue?(A={columnAccessor:ie,direction:ue},e[11]=ie,e[12]=ue,e[13]=A):A=e[13];const[N,$]=Q.useState(A);let B;e[14]!==k?(B=Me=>{$(Me),k&&k(String(Me.columnAccessor),Me.direction)},e[14]=k,e[15]=B):B=e[15];const Y=B,ce=Ts(ae,N.columnAccessor,N.direction),[o,l]=As(js[1],"mantine-table-page-size"),[p,O]=Q.useState(1),R=y?ce.slice((p-1)*o,p*o):ce;let F;e[16]===Symbol.for("react.memo_cache_sentinel")?(F=[],e[16]=F):F=e[16];const[se,he]=Q.useState(F);let pe;e[17]===Symbol.for("react.memo_cache_sentinel")?(pe=()=>{he([])},e[17]=pe):pe=e[17];let ne;e[18]!==oe?(ne=[oe],e[18]=oe,e[19]=ne):ne=e[19],Q.useEffect(pe,ne);const[fe,me]=Q.useState(!1),[ge,Se]=Q.useState(!1),[xe,De]=Q.useState(!1),qe=r?"space-between":"end";let Ee;e[20]!==r?(Ee=r&&(typeof r=="string"?w.jsx(T.Title,{order:4,children:r}):r),e[20]=r,e[21]=Ee):Ee=e[21];let _e;e[22]!==K||e[23]!==Z?(_e=Z&&w.jsx(T.ActionIcon,{variant:"subtle",onClick:()=>K(),"aria-label":"Neuladen",children:w.jsx(Tt.IconRefresh,{})}),e[22]=K,e[23]=Z,e[24]=_e):_e=e[24];let st;e[25]!==P||e[26]!==re||e[27]!==ee||e[28]!==a||e[29]!==se||e[30]!==g?(st=(a.some(Oc)||g)&&(()=>{const Me=a.find(Mc)&&(!ee||se.length>0&&ee(se[0])),Oe=a.find(Pc)&&(!re||se.length>0&&re(se[0])),nt=(P??[]).length>0,Re=Me||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(Tt.IconCaretDownFilled,{size:14}),disabled:!se.length||!Re,children:"Aktionen"})}),w.jsxs(T.Menu.Dropdown,{children:[Me&&w.jsx(T.Menu.Item,{leftSection:w.jsx(Tt.IconPencil,{size:14}),onClick:()=>Se(!0),disabled:se.length!==1,children:"Bearbeiten"}),(P??[]).map((Ce,Ze)=>Q.createElement(T.Menu.Item,{...Ce.icon&&{leftSection:Ce.icon},key:`custom_action_${Ze}`,onClick:()=>Ce.onClick(se)},Ce.label)),Oe&&w.jsx(T.Menu.Item,{leftSection:w.jsx(Tt.IconTrash,{size:14}),onClick:()=>De(!0),color:"red",children:"Löschen"})]})]})})(),e[25]=P,e[26]=re,e[27]=ee,e[28]=a,e[29]=se,e[30]=g,e[31]=st):st=e[31];let Te;e[32]!==M||e[33]!==a||e[34]!==v?(Te=a.find(kc)&&w.jsx(T.Button,{onClick:()=>me(!0),disabled:v,children:M??"Erstellen"}),e[32]=M,e[33]=a,e[34]=v,e[35]=Te):Te=e[35];let Ve;e[36]!==h||e[37]!==_e||e[38]!==st||e[39]!==Te?(Ve=w.jsxs(T.Group,{align:"center",gap:"xs",children:[_e,st,Te,h]}),e[36]=h,e[37]=_e,e[38]=st,e[39]=Te,e[40]=Ve):Ve=e[40];let Ie;e[41]!==qe||e[42]!==Ee||e[43]!==Ve?(Ie=w.jsxs(T.Group,{gap:"xs",justify:qe,align:"center",children:[Ee,Ve]}),e[41]=qe,e[42]=Ee,e[43]=Ve,e[44]=Ie):Ie=e[44];let tt;e[45]!==oe||e[46]!==C||e[47]!==I?(tt=I&&I.length>0&&w.jsx(T.Tabs,{value:oe,onChange:C,mt:"md",children:w.jsx(T.Tabs.List,{children:I.map(Dc)})}),e[45]=oe,e[46]=C,e[47]=I,e[48]=tt):tt=e[48];let it;e[49]!==E?(it=E&&w.jsx(T.Alert,{mt:"md",variant:"light",color:"red",title:"Es ist ein Fehler aufgetreten.",icon:w.jsx(Tt.IconInfoCircle,{}),children:"Bitte versuche es später erneut oder sende eine Nachricht an unseren Support."}),e[49]=E,e[50]=it):it=e[50];let je;e[51]!==v||e[52]!==j?(je=(v||j)&&w.jsxs(T.Stack,{my:"md",children:[w.jsx(T.Skeleton,{height:40}),Array(5).fill(0).map(Sc)]}),e[51]=v,e[52]=j,e[53]=je):je=e[53];let at;e[54]!==a||e[55]!==Y||e[56]!==E||e[57]!==v||e[58]!==j||e[59]!==V||e[60]!==p||e[61]!==o||e[62]!==y||e[63]!==R||e[64]!==H||e[65]!==se||e[66]!==g||e[67]!==O||e[68]!==l||e[69]!==N||e[70]!==ce?(at=!v&&!j&&w.jsx(hc,{my:"md",striped:!0,minHeight:150,fetching:E,records:R,sortStatus:N,onSortStatusChange:Y,...g&&{selectedRecords:se,onSelectedRecordsChange:he},...y&&R.length&&{totalRecords:ce.length,recordsPerPage:o,onPageChange:O,page:p,recordsPerPageOptions:js,onRecordsPerPageChange:l,recordsPerPageLabel:"Einträge pro Seite"},...H&&{rowExpansion:{allowMultiple:H.allowMultiple??!1,content:Me=>{const{record:Oe}=Me;return H.content(Oe)},...H.expanded&&{expanded:H.expanded}}},columns:a.map(xc),noRecordsText:"Keine Einträge gefunden",onRowClick:V,...V&&{style:{cursor:"pointer"}}}),e[54]=a,e[55]=Y,e[56]=E,e[57]=v,e[58]=j,e[59]=V,e[60]=p,e[61]=o,e[62]=y,e[63]=R,e[64]=H,e[65]=se,e[66]=g,e[67]=O,e[68]=l,e[69]=N,e[70]=ce,e[71]=at):at=e[71];let yt;e[72]===Symbol.for("react.memo_cache_sentinel")?(yt=()=>{Se(!1),he([])},e[72]=yt):yt=e[72];const ut=r??"Bearbeiten";let He;e[73]!==c||e[74]!==a||e[75]!==n||e[76]!==se[0]||e[77]!==se.length||e[78]!==x?(He=se.length>0&&w.jsx(Ms,{fields:a.filter(Cc),queryKey:n,apiPath:c,id:se[0].id,onClose:()=>{Se(!1),he([])},steps:x}),e[73]=c,e[74]=a,e[75]=n,e[76]=se[0],e[77]=se.length,e[78]=x,e[79]=He):He=e[79];let Ge;e[80]!==ut||e[81]!==He||e[82]!==ge?(Ge=w.jsx(T.Modal,{opened:ge,onClose:yt,title:ut,children:He}),e[80]=ut,e[81]=He,e[82]=ge,e[83]=Ge):Ge=e[83];let Qe;e[84]!==c||e[85]!==xe||e[86]!==n||e[87]!==se||e[88]!==r?(Qe=se.length>0&&w.jsx(T.Modal,{opened:xe,onClose:()=>{De(!1),he([])},title:r??"Löschen",children:w.jsx(Os,{onClose:()=>{De(!1),he([])},queryKey:n,apiPath:c,selectedRecords:se})}),e[84]=c,e[85]=xe,e[86]=n,e[87]=se,e[88]=r,e[89]=Qe):Qe=e[89];let ct;e[90]===Symbol.for("react.memo_cache_sentinel")?(ct=()=>{me(!1)},e[90]=ct):ct=e[90];const _t=r??"Anlegen";let ve;e[91]===Symbol.for("react.memo_cache_sentinel")?(ve=()=>{me(!1)},e[91]=ve):ve=e[91];let ke;e[92]!==a?(ke=a.filter(_c),e[92]=a,e[93]=ke):ke=e[93];let Ye;e[94]!==c||e[95]!==n||e[96]!==x||e[97]!==ke?(Ye=w.jsx(ps,{queryKey:n,apiPath:c,onClose:ve,fields:ke,steps:x}),e[94]=c,e[95]=n,e[96]=x,e[97]=ke,e[98]=Ye):Ye=e[98];let rt;e[99]!==fe||e[100]!==_t||e[101]!==Ye?(rt=w.jsx(T.Modal,{opened:fe,onClose:ct,title:_t,children:Ye}),e[99]=fe,e[100]=_t,e[101]=Ye,e[102]=rt):rt=e[102];let Ot;return e[103]!==Ie||e[104]!==tt||e[105]!==it||e[106]!==je||e[107]!==at||e[108]!==Ge||e[109]!==Qe||e[110]!==rt?(Ot=w.jsxs(w.Fragment,{children:[Ie,tt,it,je,at,Ge,Qe,rt]}),e[103]=Ie,e[104]=tt,e[105]=it,e[106]=je,e[107]=at,e[108]=Ge,e[109]=Qe,e[110]=rt,e[111]=Ot):Ot=e[111],Ot}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=Ke.c(5),{queryClient:r}=ft();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=wt,we.getOne=Io,we.sortData=Ts,we.updateOne=Fo,we.useAddOne=qo,we.useDataTable=ft,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
|