@espresso-lab/mantine-data-table 2.0.3 → 2.0.4
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/index.es.js +673 -663
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
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.`),n.useMemoCache(e)}})()),gn}var Gn;function ms(){return Gn||(Gn=1,process.env.NODE_ENV==="production"?Ft.exports=hs():Ft.exports=fs()),Ft.exports}var Me=ms(),Wt=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(){}},ps={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},gs=class{#t=ps;#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 gs;function bs(t){setTimeout(t,0)}var Lt=typeof window>"u"||"Deno"in globalThis;function Bt(){}function Qn(t){return typeof t=="number"&&t>=0&&t!==1/0}function ys(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Nt(t,e){return typeof t=="function"?t(e):t}function He(t,e){return typeof t=="function"?t(e):t}function Kn(t){return JSON.stringify(t,(e,n)=>yn(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}var vs=Object.prototype.hasOwnProperty;function bn(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=Jn(t)&&Jn(e);if(!r&&!(yn(t)&&yn(e)))return e;const l=(r?t:Object.keys(t)).length,i=r?e:Object.keys(e),a=i.length,c=r?new Array(a):{};let h=0;for(let f=0;f<a;f++){const g=r?f:i[f],m=t[g],p=e[g];if(m===p){c[g]=m,(r?f<l:vs.call(t,g))&&h++;continue}if(m===null||p===null||typeof m!="object"||typeof p!="object"){c[g]=p;continue}const y=bn(m,p,n+1);c[g]=y,y===m&&h++}return l===a&&h===l?t:c}function Vt(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function Jn(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function yn(t){if(!Zn(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!Zn(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Zn(t){return Object.prototype.toString.call(t)==="[object Object]"}function Xn(t,e,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(t,e);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return bn(t,e)}catch(r){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. [${n.queryHash}]: ${r}`),r}return bn(t,e)}return e}function vn(t,e){return typeof t=="function"?t(...e):!!t}var xs=class extends Wt{#t;#e;#n;constructor(){super(),this.#n=t=>{if(!Lt&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#n=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"}},Cs=new xs;function er(){let t,e;const n=new Promise((s,l)=>{t=s,e=l});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),t(s)},n.reject=s=>{r({status:"rejected",reason:s}),e(s)},n}var Ss=bs;function ws(){let t=[],e=0,n=a=>{a()},r=a=>{a()},s=Ss;const l=a=>{e?t.push(a):s(()=>{n(a)})},i=()=>{const a=t;t=[],a.length&&s(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;e++;try{c=a()}finally{e--,e||i()}return c},batchCalls:a=>(...c)=>{l(()=>{a(...c)})},schedule:l,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{s=a}}}var Ht=ws(),Ds=class extends Wt{#t=!0;#e;#n;constructor(){super(),this.#n=t=>{if(!Lt&&window.addEventListener){const e=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#n=t,this.#e?.(),this.#e=t(this.setOnline.bind(this))}setOnline(t){this.#t!==t&&(this.#t=t,this.listeners.forEach(n=>{n(t)}))}isOnline(){return this.#t}},ks=new Ds;function _s(t){return(t??"online")==="online"?ks.isOnline():!0}function js(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:_s(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}var Ps=class extends Wt{constructor(t,e){super(),this.options=e,this.#t=t,this.#i=null,this.#a=er(),this.bindMethods(),this.setOptions(e)}#t;#e=void 0;#n=void 0;#r=void 0;#s;#o;#a;#i;#p;#h;#f;#c;#u;#l;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),tr(this.#e,this.options)?this.#d():this.updateResult(),this.#v())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return xn(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return xn(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#C(),this.#e.removeObserver(this)}setOptions(t){const e=this.options,n=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 He(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#e.setOptions(this.options),e._defaulted&&!Vt(this.options,e)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const r=this.hasListeners();r&&nr(this.#e,n,this.options,e)&&this.#d(),this.updateResult(),r&&(this.#e!==n||He(this.options.enabled,this.#e)!==He(e.enabled,this.#e)||Nt(this.options.staleTime,this.#e)!==Nt(e.staleTime,this.#e))&&this.#g();const s=this.#b();r&&(this.#e!==n||He(this.options.enabled,this.#e)!==He(e.enabled,this.#e)||s!==this.#l)&&this.#y(s)}getOptimisticResult(t){const e=this.#t.getQueryCache().build(this.#t,t),n=this.createResult(e,t);return Ts(this,n)&&(this.#r=n,this.#o=this.options,this.#s=this.#e.state),n}getCurrentResult(){return this.#r}trackResult(t,e){return new Proxy(t,{get:(n,r)=>(this.trackProp(r),e?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(t){this.#m.add(t)}getCurrentQuery(){return this.#e}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#t.defaultQueryOptions(t),n=this.#t.getQueryCache().build(this.#t,e);return n.fetch().then(()=>this.createResult(n,e))}fetch(t){return this.#d({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#d(t){this.#S();let e=this.#e.fetch(this.options,t);return t?.throwOnError||(e=e.catch(Bt)),e}#g(){this.#x();const t=Nt(this.options.staleTime,this.#e);if(Lt||this.#r.isStale||!Qn(t))return;const n=ys(this.#r.dataUpdatedAt,t)+1;this.#c=zt.setTimeout(()=>{this.#r.isStale||this.updateResult()},n)}#b(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#y(t){this.#C(),this.#l=t,!(Lt||He(this.options.enabled,this.#e)===!1||!Qn(this.#l)||this.#l===0)&&(this.#u=zt.setInterval(()=>{(this.options.refetchIntervalInBackground||Cs.isFocused())&&this.#d()},this.#l))}#v(){this.#g(),this.#y(this.#b())}#x(){this.#c&&(zt.clearTimeout(this.#c),this.#c=void 0)}#C(){this.#u&&(zt.clearInterval(this.#u),this.#u=void 0)}createResult(t,e){const n=this.#e,r=this.options,s=this.#r,l=this.#s,i=this.#o,c=t!==n?t.state:this.#n,{state:h}=t;let f={...h},g=!1,m;if(e._optimisticResults){const L=this.hasListeners(),_=!L&&tr(t,e),j=L&&nr(t,n,e,r);(_||j)&&(f={...f,...js(h.data,t.options)}),e._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:p,errorUpdatedAt:y,status:k}=f;m=f.data;let A=!1;if(e.placeholderData!==void 0&&m===void 0&&k==="pending"){let L;s?.isPlaceholderData&&e.placeholderData===i?.placeholderData?(L=s.data,A=!0):L=typeof e.placeholderData=="function"?e.placeholderData(this.#f?.state.data,this.#f):e.placeholderData,L!==void 0&&(k="success",m=Xn(s?.data,L,e),g=!0)}if(e.select&&m!==void 0&&!A)if(s&&m===l?.data&&e.select===this.#p)m=this.#h;else try{this.#p=e.select,m=e.select(m),m=Xn(s?.data,m,e),this.#h=m,this.#i=null}catch(L){this.#i=L}this.#i&&(p=this.#i,m=this.#h,y=Date.now(),k="error");const I=f.fetchStatus==="fetching",F=k==="pending",z=k==="error",R=F&&I,Y=m!==void 0,O={status:k,fetchStatus:f.fetchStatus,isPending:F,isSuccess:k==="success",isError:z,isInitialLoading:R,isLoading:R,data:m,dataUpdatedAt:f.dataUpdatedAt,error:p,errorUpdatedAt:y,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>c.dataUpdateCount||f.errorUpdateCount>c.errorUpdateCount,isFetching:I,isRefetching:I&&!F,isLoadingError:z&&!Y,isPaused:f.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:z&&Y,isStale:Cn(t,e),refetch:this.refetch,promise:this.#a,isEnabled:He(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const L=O.data!==void 0,_=O.status==="error"&&!L,j=E=>{_?E.reject(O.error):L&&E.resolve(O.data)},N=()=>{const E=this.#a=O.promise=er();j(E)},W=this.#a;switch(W.status){case"pending":t.queryHash===n.queryHash&&j(W);break;case"fulfilled":(_||O.data!==W.value)&&N();break;case"rejected":(!_||O.error!==W.reason)&&N();break}}return O}updateResult(){const t=this.#r,e=this.createResult(this.#e,this.options);if(this.#s=this.#e.state,this.#o=this.options,this.#s.data!==void 0&&(this.#f=this.#e),Vt(e,t))return;this.#r=e;const n=()=>{if(!t)return!0;const{notifyOnChangeProps:r}=this.options,s=typeof r=="function"?r():r;if(s==="all"||!s&&!this.#m.size)return!0;const l=new Set(s??this.#m);return this.options.throwOnError&&l.add("error"),Object.keys(this.#r).some(i=>{const a=i;return this.#r[a]!==t[a]&&l.has(a)})};this.#w({listeners:n()})}#S(){const t=this.#t.getQueryCache().build(this.#t,this.options);if(t===this.#e)return;const e=this.#e;this.#e=t,this.#n=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#v()}#w(t){Ht.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function Ms(t,e){return He(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function tr(t,e){return Ms(t,e)||t.state.data!==void 0&&xn(t,e,e.refetchOnMount)}function xn(t,e,n){if(He(e.enabled,t)!==!1&&Nt(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&Cn(t,e)}return!1}function nr(t,e,n,r){return(t!==e||He(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&Cn(t,n)}function Cn(t,e){return He(e.enabled,t)!==!1&&t.isStaleByTime(Nt(e.staleTime,t))}function Ts(t,e){return!Vt(t.getCurrentResult(),e)}function Os(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Es=class extends Wt{#t;#e=void 0;#n;#r;constructor(t,e){super(),this.#t=t,this.setOptions(e),this.bindMethods(),this.#s()}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),Vt(this.options,e)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),e?.mutationKey&&this.options.mutationKey&&Kn(e.mutationKey)!==Kn(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#s(),this.#o(t)}getCurrentResult(){return this.#e}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#s(),this.#o()}mutate(t,e){return this.#r=e,this.#n?.removeObserver(this),this.#n=this.#t.getMutationCache().build(this.#t,this.options),this.#n.addObserver(this),this.#n.execute(t)}#s(){const t=this.#n?.state??Os();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}}#o(t){Ht.batch(()=>{if(this.#r&&this.hasListeners()){const e=this.#e.variables,n=this.#e.context,r={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#r.onSuccess?.(t.data,e,n,r)}catch(s){Promise.reject(s)}try{this.#r.onSettled?.(t.data,null,e,n,r)}catch(s){Promise.reject(s)}}else if(t?.type==="error"){try{this.#r.onError?.(t.error,e,n,r)}catch(s){Promise.reject(s)}try{this.#r.onSettled?.(void 0,t.error,e,n,r)}catch(s){Promise.reject(s)}}}this.listeners.forEach(e=>{e(this.#e)})})}},Ut={exports:{}},At={};var rr;function Ls(){if(rr)return At;rr=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,s,l){var i=null;if(l!==void 0&&(i=""+l),s.key!==void 0&&(i=""+s.key),"key"in s){l={};for(var a in s)a!=="key"&&(l[a]=s[a])}else l=s;return s=l.ref,{$$typeof:t,type:r,key:i,ref:s!==void 0?s:null,props:l}}return At.Fragment=e,At.jsx=n,At.jsxs=n,At}var Rt={};var sr;function Ns(){return sr||(sr=1,process.env.NODE_ENV!=="production"&&(function(){function t(d){if(d==null)return null;if(typeof d=="function")return d.$$typeof===N?null:d.displayName||d.name||null;if(typeof d=="string")return d;switch(d){case A:return"Fragment";case F:return"Profiler";case I:return"StrictMode";case $:return"Suspense";case O:return"SuspenseList";case j:return"Activity"}if(typeof d=="object")switch(typeof d.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),d.$$typeof){case k:return"Portal";case R:return d.displayName||"Context";case z:return(d._context.displayName||"Context")+".Consumer";case Y:var w=d.render;return d=d.displayName,d||(d=w.displayName||w.name||"",d=d!==""?"ForwardRef("+d+")":"ForwardRef"),d;case L:return w=d.displayName||null,w!==null?w:t(d.type)||"Memo";case _:w=d._payload,d=d._init;try{return t(d(w))}catch{}}return null}function e(d){return""+d}function n(d){try{e(d);var w=!1}catch{w=!0}if(w){w=console;var S=w.error,B=typeof Symbol=="function"&&Symbol.toStringTag&&d[Symbol.toStringTag]||d.constructor.name||"Object";return S.call(w,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",B),e(d)}}function r(d){if(d===A)return"<>";if(typeof d=="object"&&d!==null&&d.$$typeof===_)return"<...>";try{var w=t(d);return w?"<"+w+">":"<...>"}catch{return"<...>"}}function s(){var d=W.A;return d===null?null:d.getOwner()}function l(){return Error("react-stack-top-frame")}function i(d){if(E.call(d,"key")){var w=Object.getOwnPropertyDescriptor(d,"key").get;if(w&&w.isReactWarning)return!1}return d.key!==void 0}function a(d,w){function S(){v||(v=!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)",w))}S.isReactWarning=!0,Object.defineProperty(d,"key",{get:S,configurable:!0})}function c(){var d=t(this.type);return P[d]||(P[d]=!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.")),d=this.props.ref,d!==void 0?d:null}function h(d,w,S,B,H,Q){var U=S.ref;return d={$$typeof:y,type:d,key:w,props:S,_owner:B},(U!==void 0?U:null)!==null?Object.defineProperty(d,"ref",{enumerable:!1,get:c}):Object.defineProperty(d,"ref",{enumerable:!1,value:null}),d._store={},Object.defineProperty(d._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(d,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(d,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:H}),Object.defineProperty(d,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Q}),Object.freeze&&(Object.freeze(d.props),Object.freeze(d)),d}function f(d,w,S,B,H,Q){var U=w.children;if(U!==void 0)if(B)if(D(U)){for(B=0;B<U.length;B++)g(U[B]);Object.freeze&&Object.freeze(U)}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 g(U);if(E.call(w,"key")){U=t(d);var G=Object.keys(w).filter(function(q){return q!=="key"});B=0<G.length?"{key: someKey, "+G.join(": ..., ")+": ...}":"{key: someKey}",T[U+B]||(G=0<G.length?"{"+G.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.`),n.useMemoCache(e)}})()),gn}var Gn;function ms(){return Gn||(Gn=1,process.env.NODE_ENV==="production"?Ft.exports=hs():Ft.exports=fs()),Ft.exports}var Me=ms(),Wt=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(){}},ps={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},gs=class{#t=ps;#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 gs;function bs(t){setTimeout(t,0)}var Lt=typeof window>"u"||"Deno"in globalThis;function Bt(){}function Qn(t){return typeof t=="number"&&t>=0&&t!==1/0}function ys(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Nt(t,e){return typeof t=="function"?t(e):t}function He(t,e){return typeof t=="function"?t(e):t}function Kn(t){return JSON.stringify(t,(e,n)=>yn(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}var vs=Object.prototype.hasOwnProperty;function bn(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=Jn(t)&&Jn(e);if(!r&&!(yn(t)&&yn(e)))return e;const l=(r?t:Object.keys(t)).length,i=r?e:Object.keys(e),a=i.length,c=r?new Array(a):{};let h=0;for(let f=0;f<a;f++){const g=r?f:i[f],m=t[g],p=e[g];if(m===p){c[g]=m,(r?f<l:vs.call(t,g))&&h++;continue}if(m===null||p===null||typeof m!="object"||typeof p!="object"){c[g]=p;continue}const y=bn(m,p,n+1);c[g]=y,y===m&&h++}return l===a&&h===l?t:c}function Vt(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function Jn(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function yn(t){if(!Zn(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!Zn(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Zn(t){return Object.prototype.toString.call(t)==="[object Object]"}function Xn(t,e,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(t,e);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return bn(t,e)}catch(r){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. [${n.queryHash}]: ${r}`),r}return bn(t,e)}return e}function vn(t,e){return typeof t=="function"?t(...e):!!t}var xs=class extends Wt{#t;#e;#n;constructor(){super(),this.#n=t=>{if(!Lt&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#n=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"}},Cs=new xs;function er(){let t,e;const n=new Promise((s,l)=>{t=s,e=l});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),t(s)},n.reject=s=>{r({status:"rejected",reason:s}),e(s)},n}var Ss=bs;function ws(){let t=[],e=0,n=a=>{a()},r=a=>{a()},s=Ss;const l=a=>{e?t.push(a):s(()=>{n(a)})},i=()=>{const a=t;t=[],a.length&&s(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;e++;try{c=a()}finally{e--,e||i()}return c},batchCalls:a=>(...c)=>{l(()=>{a(...c)})},schedule:l,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{s=a}}}var Ht=ws(),Ds=class extends Wt{#t=!0;#e;#n;constructor(){super(),this.#n=t=>{if(!Lt&&window.addEventListener){const e=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#n=t,this.#e?.(),this.#e=t(this.setOnline.bind(this))}setOnline(t){this.#t!==t&&(this.#t=t,this.listeners.forEach(n=>{n(t)}))}isOnline(){return this.#t}},ks=new Ds;function _s(t){return(t??"online")==="online"?ks.isOnline():!0}function js(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:_s(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}var Ps=class extends Wt{constructor(t,e){super(),this.options=e,this.#t=t,this.#i=null,this.#a=er(),this.bindMethods(),this.setOptions(e)}#t;#e=void 0;#n=void 0;#r=void 0;#s;#o;#a;#i;#p;#h;#f;#c;#u;#l;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),tr(this.#e,this.options)?this.#d():this.updateResult(),this.#v())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return xn(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return xn(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#C(),this.#e.removeObserver(this)}setOptions(t){const e=this.options,n=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 He(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#e.setOptions(this.options),e._defaulted&&!Vt(this.options,e)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const r=this.hasListeners();r&&nr(this.#e,n,this.options,e)&&this.#d(),this.updateResult(),r&&(this.#e!==n||He(this.options.enabled,this.#e)!==He(e.enabled,this.#e)||Nt(this.options.staleTime,this.#e)!==Nt(e.staleTime,this.#e))&&this.#g();const s=this.#b();r&&(this.#e!==n||He(this.options.enabled,this.#e)!==He(e.enabled,this.#e)||s!==this.#l)&&this.#y(s)}getOptimisticResult(t){const e=this.#t.getQueryCache().build(this.#t,t),n=this.createResult(e,t);return Ts(this,n)&&(this.#r=n,this.#o=this.options,this.#s=this.#e.state),n}getCurrentResult(){return this.#r}trackResult(t,e){return new Proxy(t,{get:(n,r)=>(this.trackProp(r),e?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(t){this.#m.add(t)}getCurrentQuery(){return this.#e}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#t.defaultQueryOptions(t),n=this.#t.getQueryCache().build(this.#t,e);return n.fetch().then(()=>this.createResult(n,e))}fetch(t){return this.#d({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#d(t){this.#S();let e=this.#e.fetch(this.options,t);return t?.throwOnError||(e=e.catch(Bt)),e}#g(){this.#x();const t=Nt(this.options.staleTime,this.#e);if(Lt||this.#r.isStale||!Qn(t))return;const n=ys(this.#r.dataUpdatedAt,t)+1;this.#c=zt.setTimeout(()=>{this.#r.isStale||this.updateResult()},n)}#b(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#y(t){this.#C(),this.#l=t,!(Lt||He(this.options.enabled,this.#e)===!1||!Qn(this.#l)||this.#l===0)&&(this.#u=zt.setInterval(()=>{(this.options.refetchIntervalInBackground||Cs.isFocused())&&this.#d()},this.#l))}#v(){this.#g(),this.#y(this.#b())}#x(){this.#c&&(zt.clearTimeout(this.#c),this.#c=void 0)}#C(){this.#u&&(zt.clearInterval(this.#u),this.#u=void 0)}createResult(t,e){const n=this.#e,r=this.options,s=this.#r,l=this.#s,i=this.#o,c=t!==n?t.state:this.#n,{state:h}=t;let f={...h},g=!1,m;if(e._optimisticResults){const L=this.hasListeners(),_=!L&&tr(t,e),j=L&&nr(t,n,e,r);(_||j)&&(f={...f,...js(h.data,t.options)}),e._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:p,errorUpdatedAt:y,status:k}=f;m=f.data;let A=!1;if(e.placeholderData!==void 0&&m===void 0&&k==="pending"){let L;s?.isPlaceholderData&&e.placeholderData===i?.placeholderData?(L=s.data,A=!0):L=typeof e.placeholderData=="function"?e.placeholderData(this.#f?.state.data,this.#f):e.placeholderData,L!==void 0&&(k="success",m=Xn(s?.data,L,e),g=!0)}if(e.select&&m!==void 0&&!A)if(s&&m===l?.data&&e.select===this.#p)m=this.#h;else try{this.#p=e.select,m=e.select(m),m=Xn(s?.data,m,e),this.#h=m,this.#i=null}catch(L){this.#i=L}this.#i&&(p=this.#i,m=this.#h,y=Date.now(),k="error");const I=f.fetchStatus==="fetching",F=k==="pending",B=k==="error",R=F&&I,Y=m!==void 0,O={status:k,fetchStatus:f.fetchStatus,isPending:F,isSuccess:k==="success",isError:B,isInitialLoading:R,isLoading:R,data:m,dataUpdatedAt:f.dataUpdatedAt,error:p,errorUpdatedAt:y,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>c.dataUpdateCount||f.errorUpdateCount>c.errorUpdateCount,isFetching:I,isRefetching:I&&!F,isLoadingError:B&&!Y,isPaused:f.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:B&&Y,isStale:Cn(t,e),refetch:this.refetch,promise:this.#a,isEnabled:He(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const L=O.data!==void 0,_=O.status==="error"&&!L,j=E=>{_?E.reject(O.error):L&&E.resolve(O.data)},N=()=>{const E=this.#a=O.promise=er();j(E)},W=this.#a;switch(W.status){case"pending":t.queryHash===n.queryHash&&j(W);break;case"fulfilled":(_||O.data!==W.value)&&N();break;case"rejected":(!_||O.error!==W.reason)&&N();break}}return O}updateResult(){const t=this.#r,e=this.createResult(this.#e,this.options);if(this.#s=this.#e.state,this.#o=this.options,this.#s.data!==void 0&&(this.#f=this.#e),Vt(e,t))return;this.#r=e;const n=()=>{if(!t)return!0;const{notifyOnChangeProps:r}=this.options,s=typeof r=="function"?r():r;if(s==="all"||!s&&!this.#m.size)return!0;const l=new Set(s??this.#m);return this.options.throwOnError&&l.add("error"),Object.keys(this.#r).some(i=>{const a=i;return this.#r[a]!==t[a]&&l.has(a)})};this.#w({listeners:n()})}#S(){const t=this.#t.getQueryCache().build(this.#t,this.options);if(t===this.#e)return;const e=this.#e;this.#e=t,this.#n=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#v()}#w(t){Ht.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function Ms(t,e){return He(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function tr(t,e){return Ms(t,e)||t.state.data!==void 0&&xn(t,e,e.refetchOnMount)}function xn(t,e,n){if(He(e.enabled,t)!==!1&&Nt(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&Cn(t,e)}return!1}function nr(t,e,n,r){return(t!==e||He(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&Cn(t,n)}function Cn(t,e){return He(e.enabled,t)!==!1&&t.isStaleByTime(Nt(e.staleTime,t))}function Ts(t,e){return!Vt(t.getCurrentResult(),e)}function Os(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Es=class extends Wt{#t;#e=void 0;#n;#r;constructor(t,e){super(),this.#t=t,this.setOptions(e),this.bindMethods(),this.#s()}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),Vt(this.options,e)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),e?.mutationKey&&this.options.mutationKey&&Kn(e.mutationKey)!==Kn(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#s(),this.#o(t)}getCurrentResult(){return this.#e}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#s(),this.#o()}mutate(t,e){return this.#r=e,this.#n?.removeObserver(this),this.#n=this.#t.getMutationCache().build(this.#t,this.options),this.#n.addObserver(this),this.#n.execute(t)}#s(){const t=this.#n?.state??Os();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}}#o(t){Ht.batch(()=>{if(this.#r&&this.hasListeners()){const e=this.#e.variables,n=this.#e.context,r={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#r.onSuccess?.(t.data,e,n,r)}catch(s){Promise.reject(s)}try{this.#r.onSettled?.(t.data,null,e,n,r)}catch(s){Promise.reject(s)}}else if(t?.type==="error"){try{this.#r.onError?.(t.error,e,n,r)}catch(s){Promise.reject(s)}try{this.#r.onSettled?.(void 0,t.error,e,n,r)}catch(s){Promise.reject(s)}}}this.listeners.forEach(e=>{e(this.#e)})})}},Ut={exports:{}},At={};var rr;function Ls(){if(rr)return At;rr=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,s,l){var i=null;if(l!==void 0&&(i=""+l),s.key!==void 0&&(i=""+s.key),"key"in s){l={};for(var a in s)a!=="key"&&(l[a]=s[a])}else l=s;return s=l.ref,{$$typeof:t,type:r,key:i,ref:s!==void 0?s:null,props:l}}return At.Fragment=e,At.jsx=n,At.jsxs=n,At}var Rt={};var sr;function Ns(){return sr||(sr=1,process.env.NODE_ENV!=="production"&&(function(){function t(d){if(d==null)return null;if(typeof d=="function")return d.$$typeof===N?null:d.displayName||d.name||null;if(typeof d=="string")return d;switch(d){case A:return"Fragment";case F:return"Profiler";case I:return"StrictMode";case $:return"Suspense";case O:return"SuspenseList";case j:return"Activity"}if(typeof d=="object")switch(typeof d.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),d.$$typeof){case k:return"Portal";case R:return d.displayName||"Context";case B:return(d._context.displayName||"Context")+".Consumer";case Y:var w=d.render;return d=d.displayName,d||(d=w.displayName||w.name||"",d=d!==""?"ForwardRef("+d+")":"ForwardRef"),d;case L:return w=d.displayName||null,w!==null?w:t(d.type)||"Memo";case _:w=d._payload,d=d._init;try{return t(d(w))}catch{}}return null}function e(d){return""+d}function n(d){try{e(d);var w=!1}catch{w=!0}if(w){w=console;var S=w.error,z=typeof Symbol=="function"&&Symbol.toStringTag&&d[Symbol.toStringTag]||d.constructor.name||"Object";return S.call(w,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",z),e(d)}}function r(d){if(d===A)return"<>";if(typeof d=="object"&&d!==null&&d.$$typeof===_)return"<...>";try{var w=t(d);return w?"<"+w+">":"<...>"}catch{return"<...>"}}function s(){var d=W.A;return d===null?null:d.getOwner()}function l(){return Error("react-stack-top-frame")}function i(d){if(E.call(d,"key")){var w=Object.getOwnPropertyDescriptor(d,"key").get;if(w&&w.isReactWarning)return!1}return d.key!==void 0}function a(d,w){function S(){v||(v=!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)",w))}S.isReactWarning=!0,Object.defineProperty(d,"key",{get:S,configurable:!0})}function c(){var d=t(this.type);return P[d]||(P[d]=!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.")),d=this.props.ref,d!==void 0?d:null}function h(d,w,S,z,H,Q){var U=S.ref;return d={$$typeof:y,type:d,key:w,props:S,_owner:z},(U!==void 0?U:null)!==null?Object.defineProperty(d,"ref",{enumerable:!1,get:c}):Object.defineProperty(d,"ref",{enumerable:!1,value:null}),d._store={},Object.defineProperty(d._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(d,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(d,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:H}),Object.defineProperty(d,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Q}),Object.freeze&&(Object.freeze(d.props),Object.freeze(d)),d}function f(d,w,S,z,H,Q){var U=w.children;if(U!==void 0)if(z)if(D(U)){for(z=0;z<U.length;z++)g(U[z]);Object.freeze&&Object.freeze(U)}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 g(U);if(E.call(w,"key")){U=t(d);var G=Object.keys(w).filter(function(q){return q!=="key"});z=0<G.length?"{key: someKey, "+G.join(": ..., ")+": ...}":"{key: someKey}",T[U+z]||(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} />`,B,U,G,U),T[U+B]=!0)}if(U=null,S!==void 0&&(n(S),U=""+S),i(w)&&(n(w.key),U=""+w.key),"key"in w){S={};for(var K in w)K!=="key"&&(S[K]=w[K])}else S=w;return U&&a(S,typeof d=="function"?d.displayName||d.name||"Unknown":d),h(d,U,S,s(),H,Q)}function g(d){m(d)?d._store&&(d._store.validated=1):typeof d=="object"&&d!==null&&d.$$typeof===_&&(d._payload.status==="fulfilled"?m(d._payload.value)&&d._payload.value._store&&(d._payload.value._store.validated=1):d._store&&(d._store.validated=1))}function m(d){return typeof d=="object"&&d!==null&&d.$$typeof===y}var p=M,y=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),z=Symbol.for("react.consumer"),R=Symbol.for("react.context"),Y=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),N=Symbol.for("react.client.reference"),W=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,E=Object.prototype.hasOwnProperty,D=Array.isArray,b=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(d){return d()}};var v,P={},x=p.react_stack_bottom_frame.bind(p,l)(),C=b(r(l)),T={};Rt.Fragment=A,Rt.jsx=function(d,w,S){var B=1e4>W.recentlyCreatedOwnerStacks++;return f(d,w,S,!1,B?Error("react-stack-top-frame"):x,B?b(r(d)):C)},Rt.jsxs=function(d,w,S){var B=1e4>W.recentlyCreatedOwnerStacks++;return f(d,w,S,!0,B?Error("react-stack-top-frame"):x,B?b(r(d)):C)}})()),Rt}var or;function As(){return or||(or=1,process.env.NODE_ENV==="production"?Ut.exports=Ls():Ut.exports=Ns()),Ut.exports}var o=As(),ar=be.createContext(void 0),ir=t=>{const e=be.useContext(ar);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Rs=({client:t,children:e})=>(be.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),o.jsx(ar.Provider,{value:t,children:e})),lr=be.createContext(!1),$s=()=>be.useContext(lr);lr.Provider;function Ys(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var Is=be.createContext(Ys()),Fs=()=>be.useContext(Is),Ws=(t,e,n)=>{const r=n?.state.error&&typeof t.throwOnError=="function"?vn(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||r)&&(e.isReset()||(t.retryOnMount=!1))},zs=t=>{be.useEffect(()=>{t.clearReset()},[t])},Bs=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||vn(n,[t.error,r])),Vs=t=>{if(t.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=t.staleTime;t.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},Hs=(t,e)=>t.isLoading&&t.isFetching&&!e,Us=(t,e)=>t?.suspense&&e.isPending,cr=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function qs(t,e,n){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 r=$s(),s=Fs(),l=ir(),i=l.defaultQueryOptions(t);l.getDefaultOptions().queries?._experimental_beforeQuery?.(i);const a=l.getQueryCache().get(i.queryHash);process.env.NODE_ENV!=="production"&&(i.queryFn||console.error(`[${i.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`)),i._optimisticResults=r?"isRestoring":"optimistic",Vs(i),Ws(i,s,a),zs(s);const c=!l.getQueryCache().get(i.queryHash),[h]=be.useState(()=>new e(l,i)),f=h.getOptimisticResult(i),g=!r&&t.subscribed!==!1;if(be.useSyncExternalStore(be.useCallback(m=>{const p=g?h.subscribe(Ht.batchCalls(m)):Bt;return h.updateResult(),p},[h,g]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),be.useEffect(()=>{h.setOptions(i)},[i,h]),Us(i,f))throw cr(i,h,s);if(Bs({result:f,errorResetBoundary:s,throwOnError:i.throwOnError,query:a,suspense:i.suspense}))throw f.error;return l.getDefaultOptions().queries?._experimental_afterQuery?.(i,f),i.experimental_prefetchInRender&&!Lt&&Hs(f,r)&&(c?cr(i,h,s):a?.promise)?.catch(Bt).finally(()=>{h.updateResult()}),i.notifyOnChangeProps?f:h.trackResult(f)}function ur(t,e){return qs(t,Ps)}function Sn(t,e){const n=ir(),[r]=be.useState(()=>new Es(n,t));be.useEffect(()=>{r.setOptions(t)},[r,t]);const s=be.useSyncExternalStore(be.useCallback(i=>r.subscribe(Ht.batchCalls(i)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),l=be.useCallback((i,a)=>{r.mutate(i,a).catch(Bt)},[r]);if(s.error&&vn(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:l,mutateAsync:s.mutate}}const dr=M.createContext(void 0),Gs=async()=>({"Content-Type":"application/json"});function Qs(t){const e=Me.c(10),{children:n,baseUrl:r,queryClient:s,getHeaders:l}=t,i=l===void 0?Gs:l;let a;e[0]!==r||e[1]!==i||e[2]!==s?(a={baseUrl:r,queryClient:s,getHeaders:i},e[0]=r,e[1]=i,e[2]=s,e[3]=a):a=e[3];let c;e[4]!==n||e[5]!==s?(c=o.jsx(Rs,{client:s,children:n}),e[4]=n,e[5]=s,e[6]=c):c=e[6];let h;return e[7]!==a||e[8]!==c?(h=o.jsx(dr.Provider,{value:a,children:c}),e[7]=a,e[8]=c,e[9]=h):h=e[9],h}function vt(){const t=M.useContext(dr);if(!t)throw new Error("useDataTable must be used within a DataTableProvider");return t}function Ks(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 jt(t,e){const n=await fetch(t,e);if(n.status>=400){const r=await n.text();if(!r)throw new Error(`HTTP ${n.status}: ${n.statusText}`);let s=null;try{s=JSON.parse(r)}catch{throw new Error(r)}throw new Error(s?.message??s?.error??r)}return n}async function hr(t,e){return(await jt(t,{method:"GET",headers:await e()})).json()}async function fr(t,e,n){return(await jt(`${t}/${e}`,{method:"GET",headers:await n()})).json()}async function mr(t,e,n){await jt(`${t}/${e}`,{method:"DELETE",headers:await n()})}async function pr(t,e,n){const r=await jt(t,{method:"POST",headers:await n(),body:JSON.stringify(e)});return r.status===204?e:r.json()}async function Js(t,e,n,r){const s=await jt(e,{method:t,headers:await n(),body:r?JSON.stringify(r):void 0});if(s.status!==204)return s.json()}async function gr(t,e,n){const r=await jt(`${t}/${e.id}`,{method:"PUT",headers:await n(),body:JSON.stringify(e)});return r.status===204?e:r.json()}function br(t,e,n){const r=Me.c(14),{baseUrl:s,getHeaders:l}=vt();let i;if(r[0]!==n||r[1]!==e){let f;r[3]!==n?(f=n?.toString(),r[3]=n,r[4]=f):f=r[4],i=[...e.map(Zs),String(f)],r[0]=n,r[1]=e,r[2]=i}else i=r[2];let a;r[5]!==t||r[6]!==s||r[7]!==l||r[8]!==n?(a=()=>fr(`${s}${t}`,n,l),r[5]=t,r[6]=s,r[7]=l,r[8]=n,r[9]=a):a=r[9];const c=!!n;let h;return r[10]!==i||r[11]!==a||r[12]!==c?(h={queryKey:i,queryFn:a,enabled:c},r[10]=i,r[11]=a,r[12]=c,r[13]=h):h=r[13],ur(h)}function Zs(t){return t.toString()}function yr(t,e,n){const r=Me.c(10),s=n===void 0?!0:n,{baseUrl:l,getHeaders:i}=vt();let a;r[0]!==e?(a=[...e.map(Xs)],r[0]=e,r[1]=a):a=r[1];let c;r[2]!==t||r[3]!==l||r[4]!==i?(c=()=>hr(`${l}${t}`,i),r[2]=t,r[3]=l,r[4]=i,r[5]=c):c=r[5];let h;return r[6]!==s||r[7]!==a||r[8]!==c?(h={queryKey:a,queryFn:c,enabled:s},r[6]=s,r[7]=a,r[8]=c,r[9]=h):h=r[9],ur(h)}function Xs(t){return t.toString()}function vr(t,e){const n=Me.c(11),{baseUrl:r,queryClient:s,getHeaders:l}=vt();let i;n[0]!==e?(i=[...e.map(to)],n[0]=e,n[1]=i):i=n[1];let a;n[2]!==t||n[3]!==r||n[4]!==l?(a=h=>pr(`${r}${t}`,h,l),n[2]=t,n[3]=r,n[4]=l,n[5]=a):a=n[5];let c;return n[6]!==s||n[7]!==e||n[8]!==i||n[9]!==a?(c={mutationKey:i,mutationFn:a,onSettled(){return s.invalidateQueries({queryKey:[...e.map(eo)]})}},n[6]=s,n[7]=e,n[8]=i,n[9]=a,n[10]=c):c=n[10],Sn(c)}function eo(t){return t.toString()}function to(t){return t.toString()}function wn(t,e){const n=Me.c(11),{baseUrl:r,queryClient:s,getHeaders:l}=vt();let i;n[0]!==e?(i=[...e.map(ro)],n[0]=e,n[1]=i):i=n[1];let a;n[2]!==t||n[3]!==r||n[4]!==l?(a=h=>gr(`${r}${t}`,h,l),n[2]=t,n[3]=r,n[4]=l,n[5]=a):a=n[5];let c;return n[6]!==s||n[7]!==e||n[8]!==i||n[9]!==a?(c={mutationKey:i,mutationFn:a,onSettled(){return s.invalidateQueries({queryKey:[...e.map(no)]})}},n[6]=s,n[7]=e,n[8]=i,n[9]=a,n[10]=c):c=n[10],Sn(c)}function no(t){return t.toString()}function ro(t){return t.toString()}function xr(t,e){const n=Me.c(11),{baseUrl:r,queryClient:s,getHeaders:l}=vt();let i;n[0]!==e?(i=[...e.map(oo)],n[0]=e,n[1]=i):i=n[1];let a;n[2]!==t||n[3]!==r||n[4]!==l?(a=h=>mr(`${r}${t}`,h,l),n[2]=t,n[3]=r,n[4]=l,n[5]=a):a=n[5];let c;return n[6]!==s||n[7]!==e||n[8]!==i||n[9]!==a?(c={mutationKey:i,mutationFn:a,onSettled(){return s.invalidateQueries({queryKey:[...e.map(so)]})}},n[6]=s,n[7]=e,n[8]=i,n[9]=a,n[10]=c):c=n[10],Sn(c)}function so(t){return t.toString()}function oo(t){return t.toString()}var qt={exports:{}},ao=qt.exports,Cr;function io(){return Cr||(Cr=1,(function(t,e){(function(n,r){t.exports=r()})(ao,(function(){var n=1e3,r=6e4,s=36e5,l="millisecond",i="second",a="minute",c="hour",h="day",f="week",g="month",m="quarter",p="year",y="date",k="Invalid Date",A=/^(\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,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(D){var b=["th","st","nd","rd"],v=D%100;return"["+D+(b[(v-20)%10]||b[v]||b[0])+"]"}},z=function(D,b,v){var P=String(D);return!P||P.length>=b?D:""+Array(b+1-P.length).join(v)+D},R={s:z,z:function(D){var b=-D.utcOffset(),v=Math.abs(b),P=Math.floor(v/60),x=v%60;return(b<=0?"+":"-")+z(P,2,"0")+":"+z(x,2,"0")},m:function D(b,v){if(b.date()<v.date())return-D(v,b);var P=12*(v.year()-b.year())+(v.month()-b.month()),x=b.clone().add(P,g),C=v-x<0,T=b.clone().add(P+(C?-1:1),g);return+(-(P+(v-x)/(C?x-T:T-x))||0)},a:function(D){return D<0?Math.ceil(D)||0:Math.floor(D)},p:function(D){return{M:g,y:p,w:f,d:h,D:y,h:c,m:a,s:i,ms:l,Q:m}[D]||String(D||"").toLowerCase().replace(/s$/,"")},u:function(D){return D===void 0}},Y="en",$={};$[Y]=F;var O="$isDayjsObject",L=function(D){return D instanceof W||!(!D||!D[O])},_=function D(b,v,P){var x;if(!b)return Y;if(typeof b=="string"){var C=b.toLowerCase();$[C]&&(x=C),v&&($[C]=v,x=C);var T=b.split("-");if(!x&&T.length>1)return D(T[0])}else{var d=b.name;$[d]=b,x=d}return!P&&x&&(Y=x),x||!P&&Y},j=function(D,b){if(L(D))return D.clone();var v=typeof b=="object"?b:{};return v.date=D,v.args=arguments,new W(v)},N=R;N.l=_,N.i=L,N.w=function(D,b){return j(D,{locale:b.$L,utc:b.$u,x:b.$x,$offset:b.$offset})};var W=(function(){function D(v){this.$L=_(v.locale,null,!0),this.parse(v),this.$x=this.$x||v.x||{},this[O]=!0}var b=D.prototype;return b.parse=function(v){this.$d=(function(P){var x=P.date,C=P.utc;if(x===null)return new Date(NaN);if(N.u(x))return new Date;if(x instanceof Date)return new Date(x);if(typeof x=="string"&&!/Z$/i.test(x)){var T=x.match(A);if(T){var d=T[2]-1||0,w=(T[7]||"0").substring(0,3);return C?new Date(Date.UTC(T[1],d,T[3]||1,T[4]||0,T[5]||0,T[6]||0,w)):new Date(T[1],d,T[3]||1,T[4]||0,T[5]||0,T[6]||0,w)}}return new Date(x)})(v),this.init()},b.init=function(){var v=this.$d;this.$y=v.getFullYear(),this.$M=v.getMonth(),this.$D=v.getDate(),this.$W=v.getDay(),this.$H=v.getHours(),this.$m=v.getMinutes(),this.$s=v.getSeconds(),this.$ms=v.getMilliseconds()},b.$utils=function(){return N},b.isValid=function(){return this.$d.toString()!==k},b.isSame=function(v,P){var x=j(v);return this.startOf(P)<=x&&x<=this.endOf(P)},b.isAfter=function(v,P){return j(v)<this.startOf(P)},b.isBefore=function(v,P){return this.endOf(P)<j(v)},b.$g=function(v,P,x){return N.u(v)?this[P]:this.set(x,v)},b.unix=function(){return Math.floor(this.valueOf()/1e3)},b.valueOf=function(){return this.$d.getTime()},b.startOf=function(v,P){var x=this,C=!!N.u(P)||P,T=N.p(v),d=function(K,q){var te=N.w(x.$u?Date.UTC(x.$y,q,K):new Date(x.$y,q,K),x);return C?te:te.endOf(h)},w=function(K,q){return N.w(x.toDate()[K].apply(x.toDate("s"),(C?[0,0,0,0]:[23,59,59,999]).slice(q)),x)},S=this.$W,B=this.$M,H=this.$D,Q="set"+(this.$u?"UTC":"");switch(T){case p:return C?d(1,0):d(31,11);case g:return C?d(1,B):d(0,B+1);case f:var U=this.$locale().weekStart||0,G=(S<U?S+7:S)-U;return d(C?H-G:H+(6-G),B);case h:case y:return w(Q+"Hours",0);case c:return w(Q+"Minutes",1);case a:return w(Q+"Seconds",2);case i:return w(Q+"Milliseconds",3);default:return this.clone()}},b.endOf=function(v){return this.startOf(v,!1)},b.$set=function(v,P){var x,C=N.p(v),T="set"+(this.$u?"UTC":""),d=(x={},x[h]=T+"Date",x[y]=T+"Date",x[g]=T+"Month",x[p]=T+"FullYear",x[c]=T+"Hours",x[a]=T+"Minutes",x[i]=T+"Seconds",x[l]=T+"Milliseconds",x)[C],w=C===h?this.$D+(P-this.$W):P;if(C===g||C===p){var S=this.clone().set(y,1);S.$d[d](w),S.init(),this.$d=S.set(y,Math.min(this.$D,S.daysInMonth())).$d}else d&&this.$d[d](w);return this.init(),this},b.set=function(v,P){return this.clone().$set(v,P)},b.get=function(v){return this[N.p(v)]()},b.add=function(v,P){var x,C=this;v=Number(v);var T=N.p(P),d=function(B){var H=j(C);return N.w(H.date(H.date()+Math.round(B*v)),C)};if(T===g)return this.set(g,this.$M+v);if(T===p)return this.set(p,this.$y+v);if(T===h)return d(1);if(T===f)return d(7);var w=(x={},x[a]=r,x[c]=s,x[i]=n,x)[T]||1,S=this.$d.getTime()+v*w;return N.w(S,this)},b.subtract=function(v,P){return this.add(-1*v,P)},b.format=function(v){var P=this,x=this.$locale();if(!this.isValid())return x.invalidDate||k;var C=v||"YYYY-MM-DDTHH:mm:ssZ",T=N.z(this),d=this.$H,w=this.$m,S=this.$M,B=x.weekdays,H=x.months,Q=x.meridiem,U=function(q,te,X,ne){return q&&(q[te]||q(P,C))||X[te].slice(0,ne)},G=function(q){return N.s(d%12||12,q,"0")},K=Q||function(q,te,X){var ne=q<12?"AM":"PM";return X?ne.toLowerCase():ne};return C.replace(I,(function(q,te){return te||(function(X){switch(X){case"YY":return String(P.$y).slice(-2);case"YYYY":return N.s(P.$y,4,"0");case"M":return S+1;case"MM":return N.s(S+1,2,"0");case"MMM":return U(x.monthsShort,S,H,3);case"MMMM":return U(H,S);case"D":return P.$D;case"DD":return N.s(P.$D,2,"0");case"d":return String(P.$W);case"dd":return U(x.weekdaysMin,P.$W,B,2);case"ddd":return U(x.weekdaysShort,P.$W,B,3);case"dddd":return B[P.$W];case"H":return String(d);case"HH":return N.s(d,2,"0");case"h":return G(1);case"hh":return G(2);case"a":return K(d,w,!0);case"A":return K(d,w,!1);case"m":return String(w);case"mm":return N.s(w,2,"0");case"s":return String(P.$s);case"ss":return N.s(P.$s,2,"0");case"SSS":return N.s(P.$ms,3,"0");case"Z":return T}return null})(q)||T.replace(":","")}))},b.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},b.diff=function(v,P,x){var C,T=this,d=N.p(P),w=j(v),S=(w.utcOffset()-this.utcOffset())*r,B=this-w,H=function(){return N.m(T,w)};switch(d){case p:C=H()/12;break;case g:C=H();break;case m:C=H()/3;break;case f:C=(B-S)/6048e5;break;case h:C=(B-S)/864e5;break;case c:C=B/s;break;case a:C=B/r;break;case i:C=B/n;break;default:C=B}return x?C:N.a(C)},b.daysInMonth=function(){return this.endOf(g).$D},b.$locale=function(){return $[this.$L]},b.locale=function(v,P){if(!v)return this.$L;var x=this.clone(),C=_(v,P,!0);return C&&(x.$L=C),x},b.clone=function(){return N.w(this.$d,this)},b.toDate=function(){return new Date(this.valueOf())},b.toJSON=function(){return this.isValid()?this.toISOString():null},b.toISOString=function(){return this.$d.toISOString()},b.toString=function(){return this.$d.toUTCString()},D})(),E=W.prototype;return j.prototype=E,[["$ms",l],["$s",i],["$m",a],["$H",c],["$W",h],["$M",g],["$y",p],["$D",y]].forEach((function(D){E[D[1]]=function(b){return this.$g(b,D[0],D[1])}})),j.extend=function(D,b){return D.$i||(D(b,W,j),D.$i=!0),j},j.locale=_,j.isDayjs=L,j.unix=function(D){return j(1e3*D)},j.en=$[Y],j.Ls=$,j.p={},j}))})(qt)),qt.exports}var lo=io();const V=Hn(lo);function co({direction:t,levelIndex:e,rowIndex:n,cellIndex:r,size:s}){switch(t){case"up":return e===0&&n===0?null:n===0?{levelIndex:e-1,rowIndex:r<=s[e-1][s[e-1].length-1]-1?s[e-1].length-1:s[e-1].length-2,cellIndex:r}:{levelIndex:e,rowIndex:n-1,cellIndex:r};case"down":return n===s[e].length-1?{levelIndex:e+1,rowIndex:0,cellIndex:r}:n===s[e].length-2&&r>=s[e][s[e].length-1]?{levelIndex:e+1,rowIndex:0,cellIndex:r}:{levelIndex:e,rowIndex:n+1,cellIndex:r};case"left":return e===0&&n===0&&r===0?null:n===0&&r===0?{levelIndex:e-1,rowIndex:s[e-1].length-1,cellIndex:s[e-1][s[e-1].length-1]-1}:r===0?{levelIndex:e,rowIndex:n-1,cellIndex:s[e][n-1]-1}:{levelIndex:e,rowIndex:n,cellIndex:r-1};case"right":return n===s[e].length-1&&r===s[e][n]-1?{levelIndex:e+1,rowIndex:0,cellIndex:0}:r===s[e][n]-1?{levelIndex:e,rowIndex:n+1,cellIndex:0}:{levelIndex:e,rowIndex:n,cellIndex:r+1};default:return{levelIndex:e,rowIndex:n,cellIndex:r}}}function Sr({controlsRef:t,direction:e,levelIndex:n,rowIndex:r,cellIndex:s,size:l}){const i=co({direction:e,size:l,rowIndex:r,cellIndex:s,levelIndex:n});if(!i)return;const a=t.current?.[i.levelIndex]?.[i.rowIndex]?.[i.cellIndex];a&&(a.disabled||a.getAttribute("data-hidden")||a.getAttribute("data-outside")?Sr({controlsRef:t,direction:e,levelIndex:i.levelIndex,cellIndex:i.cellIndex,rowIndex:i.rowIndex,size:l}):a.focus())}function uo(t){switch(t){case"ArrowDown":return"down";case"ArrowUp":return"up";case"ArrowRight":return"right";case"ArrowLeft":return"left";default:return null}}function ho(t){return t.current?.map(e=>e.map(n=>n.length))}function Dn({controlsRef:t,levelIndex:e,rowIndex:n,cellIndex:r,event:s}){const l=uo(s.key);if(l){s.preventDefault();const i=ho(t);Sr({controlsRef:t,direction:l,levelIndex:e,rowIndex:n,cellIndex:r,size:i})}}function Ae(t){return t==null||t===""?t:V(t).format("YYYY-MM-DD")}function wr(t){return t==null||t===""?t:V(t).format("YYYY-MM-DD HH:mm:ss")}const fo={locale:"en",firstDayOfWeek:1,weekendDays:[0,6],labelSeparator:"–",consistentWeeks:!1},mo=M.createContext(fo);function lt(){const t=M.useContext(mo),e=M.useCallback(l=>l||t.locale,[t.locale]),n=M.useCallback(l=>typeof l=="number"?l:t.firstDayOfWeek,[t.firstDayOfWeek]),r=M.useCallback(l=>Array.isArray(l)?l:t.weekendDays,[t.weekendDays]),s=M.useCallback(l=>typeof l=="string"?l:t.labelSeparator,[t.labelSeparator]);return{...t,getLocale:e,getFirstDayOfWeek:n,getWeekendDays:r,getLabelSeparator:s}}function po({value:t,type:e,withTime:n}){const r=n?wr:Ae;if(e==="range"&&Array.isArray(t)){const s=r(t[0]),l=r(t[1]);return s?l?`${s} – ${l}`:`${s} –`:""}return e==="multiple"&&Array.isArray(t)?t.filter(Boolean).join(", "):!Array.isArray(t)&&t?r(t):""}function Dr({value:t,type:e,name:n,form:r,withTime:s=!1}){return o.jsx("input",{type:"hidden",value:po({value:t,type:e,withTime:s}),name:n,form:r})}Dr.displayName="@mantine/dates/HiddenDatesInput";function kr(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(n=kr(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function de(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=kr(t))&&(r&&(r+=" "),r+=e);return r}var _r={day:"m_396ce5cb"};const go=u.createVarsResolver((t,{size:e})=>({day:{"--day-size":u.getSize(e,"day-size")}})),kn=u.factory((t,e)=>{const n=u.useProps("Day",null,t),{classNames:r,className:s,style:l,styles:i,unstyled:a,vars:c,date:h,disabled:f,__staticSelector:g,weekend:m,outside:p,selected:y,renderDay:k,inRange:A,firstInRange:I,lastInRange:F,hidden:z,static:R,highlightToday:Y,attributes:$,...O}=n,L=u.useStyles({name:g||"Day",classes:_r,props:n,className:s,style:l,classNames:r,styles:i,unstyled:a,attributes:$,vars:c,varsResolver:go,rootSelector:"day"});return o.jsx(u.UnstyledButton,{...L("day",{style:z?{display:"none"}:void 0}),component:R?"div":"button",ref:e,disabled:f,"data-today":V(h).isSame(new Date,"day")||void 0,"data-hidden":z||void 0,"data-highlight-today":Y||void 0,"data-disabled":f||void 0,"data-weekend":!f&&!p&&m||void 0,"data-outside":!f&&p||void 0,"data-selected":!f&&y||void 0,"data-in-range":A&&!f||void 0,"data-first-in-range":I&&!f||void 0,"data-last-in-range":F&&!f||void 0,"data-static":R||void 0,unstyled:a,...O,children:k?.(h)||V(h).date()})});kn.classes=_r,kn.displayName="@mantine/dates/Day";function bo({locale:t,format:e="dd",firstDayOfWeek:n=1}){const r=V().day(n),s=[];for(let l=0;l<7;l+=1)typeof e=="string"?s.push(V(r).add(l,"days").locale(t).format(e)):s.push(e(V(r).add(l,"days").format("YYYY-MM-DD")));return s}var jr={weekday:"m_18a3eca"};const yo=u.createVarsResolver((t,{size:e})=>({weekdaysRow:{"--wr-fz":u.getFontSize(e),"--wr-spacing":u.getSpacing(e)}})),_n=u.factory((t,e)=>{const n=u.useProps("WeekdaysRow",null,t),{classNames:r,className:s,style:l,styles:i,unstyled:a,vars:c,locale:h,firstDayOfWeek:f,weekdayFormat:g,cellComponent:m="th",__staticSelector:p,withWeekNumbers:y,attributes:k,...A}=n,I=u.useStyles({name:p||"WeekdaysRow",classes:jr,props:n,className:s,style:l,classNames:r,styles:i,unstyled:a,attributes:k,vars:c,varsResolver:yo,rootSelector:"weekdaysRow"}),F=lt(),z=bo({locale:F.getLocale(h),format:g,firstDayOfWeek:F.getFirstDayOfWeek(f)}).map((R,Y)=>o.jsx(m,{...I("weekday"),children:R},Y));return o.jsxs(u.Box,{component:"tr",ref:e,...I("weekdaysRow"),...A,children:[y&&o.jsx(m,{...I("weekday"),children:"#"}),z]})});_n.classes=jr,_n.displayName="@mantine/dates/WeekdaysRow";function vo(t,e=1){let n=V(t);if(!n.isValid())return n;const r=e===0?6:e-1;for(;n.day()!==r;)n=n.add(1,"day");return n.format("YYYY-MM-DD")}function xo(t,e=1){let n=V(t);for(;n.day()!==e;)n=n.subtract(1,"day");return n.format("YYYY-MM-DD")}function Co({month:t,firstDayOfWeek:e=1,consistentWeeks:n}){const r=V(t).subtract(V(t).date()-1,"day"),s=V(r.format("YYYY-M-D")),l=s.format("YYYY-MM-DD"),i=s.add(+s.daysInMonth()-1,"day").format("YYYY-MM-DD"),a=vo(i,e),c=[];let h=V(xo(l,e));for(;V(h).isBefore(a,"day");){const f=[];for(let g=0;g<7;g+=1)f.push(h.format("YYYY-MM-DD")),h=h.add(1,"day");c.push(f)}if(n&&c.length<6){const f=c[c.length-1],g=f[f.length-1];let m=V(g).add(1,"day");for(;c.length<6;){const p=[];for(let y=0;y<7;y+=1)p.push(m.format("YYYY-MM-DD")),m=m.add(1,"day");c.push(p)}}return c}function jn(t,e){return V(t).format("YYYY-MM")===V(e).format("YYYY-MM")}function Pr(t,e){return e?V(t).isAfter(V(e).subtract(1,"day"),"day"):!0}function Mr(t,e){return e?V(t).isBefore(V(e).add(1,"day"),"day"):!0}function So({dates:t,minDate:e,maxDate:n,getDayProps:r,excludeDate:s,hideOutsideDates:l,month:i}){const a=t.flat().filter(f=>Mr(f,n)&&Pr(f,e)&&!s?.(f)&&!r?.(f)?.disabled&&(!l||jn(f,i))),c=a.find(f=>r?.(f)?.selected);if(c)return c;const h=a.find(f=>V().isSame(f,"date"));return h||a[0]}var Gt={exports:{}},wo=Gt.exports,Tr;function Do(){return Tr||(Tr=1,(function(t,e){(function(n,r){t.exports=r()})(wo,(function(){var n="day";return function(r,s,l){var i=function(h){return h.add(4-h.isoWeekday(),n)},a=s.prototype;a.isoWeekYear=function(){return i(this).year()},a.isoWeek=function(h){if(!this.$utils().u(h))return this.add(7*(h-this.isoWeek()),n);var f,g,m,p,y=i(this),k=(f=this.isoWeekYear(),g=this.$u,m=(g?l.utc:l)().year(f).startOf("year"),p=4-m.isoWeekday(),m.isoWeekday()>4&&(p+=7),m.add(p,n));return y.diff(k,"week")+1},a.isoWeekday=function(h){return this.$utils().u(h)?this.day()||7:this.day(this.day()%7?h:h-7)};var c=a.startOf;a.startOf=function(h,f){var g=this.$utils(),m=!!g.u(f)||f;return g.p(h)==="isoweek"?m?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):c.bind(this)(h,f)}}}))})(Gt)),Gt.exports}var ko=Do();const _o=Hn(ko);V.extend(_o);function jo(t){const e=t.find(n=>V(n).day()===1);return V(e).isoWeek()}var Or={month:"m_cc9820d3",monthCell:"m_8f457cd5",weekNumber:"m_6cff9dea"};const Po={withCellSpacing:!0},Mo=u.createVarsResolver((t,{size:e})=>({weekNumber:{"--wn-fz":u.getFontSize(e),"--wn-size":u.getSize(e,"wn-size")}})),Qt=u.factory((t,e)=>{const n=u.useProps("Month",Po,t),{classNames:r,className:s,style:l,styles:i,unstyled:a,vars:c,__staticSelector:h,locale:f,firstDayOfWeek:g,weekdayFormat:m,month:p,weekendDays:y,getDayProps:k,excludeDate:A,minDate:I,maxDate:F,renderDay:z,hideOutsideDates:R,hideWeekdays:Y,getDayAriaLabel:$,static:O,__getDayRef:L,__onDayKeyDown:_,__onDayClick:j,__onDayMouseEnter:N,__preventFocus:W,__stopPropagation:E,withCellSpacing:D,size:b,highlightToday:v,withWeekNumbers:P,attributes:x,...C}=n,T=u.useStyles({name:h||"Month",classes:Or,props:n,className:s,style:l,classNames:r,styles:i,unstyled:a,attributes:x,vars:c,varsResolver:Mo,rootSelector:"month"}),d=lt(),w=Co({month:p,firstDayOfWeek:d.getFirstDayOfWeek(g),consistentWeeks:d.consistentWeeks}),S=So({dates:w,minDate:Ae(I),maxDate:Ae(F),getDayProps:k,excludeDate:A,hideOutsideDates:R,month:p}),{resolvedClassNames:B,resolvedStyles:H}=u.useResolvedStylesApi({classNames:r,styles:i,props:n}),Q=w.map((U,G)=>{const K=U.map((q,te)=>{const X=!jn(q,p),ne=$?.(q)||V(q).locale(f||d.locale).format("D MMMM YYYY"),le=k?.(q),he=V(q).isSame(S,"date");return o.jsx("td",{...T("monthCell"),"data-with-spacing":D||void 0,children:o.jsx(kn,{__staticSelector:h||"Month",classNames:B,styles:H,unstyled:a,"data-mantine-stop-propagation":E||void 0,highlightToday:v,renderDay:z,date:q,size:b,weekend:d.getWeekendDays(y).includes(V(q).get("day")),outside:X,hidden:R?X:!1,"aria-label":ne,static:O,disabled:A?.(q)||!Mr(q,Ae(F))||!Pr(q,Ae(I)),ref:re=>{re&&L?.(G,te,re)},...le,onKeyDown:re=>{le?.onKeyDown?.(re),_?.(re,{rowIndex:G,cellIndex:te,date:q})},onMouseEnter:re=>{le?.onMouseEnter?.(re),N?.(re,q)},onClick:re=>{le?.onClick?.(re),j?.(re,q)},onMouseDown:re=>{le?.onMouseDown?.(re),W&&re.preventDefault()},tabIndex:W||!he?-1:0})},q.toString())});return o.jsxs("tr",{...T("monthRow"),children:[P&&o.jsx("td",{...T("weekNumber"),children:jo(U)}),K]},G)});return o.jsxs(u.Box,{component:"table",...T("month"),size:b,ref:e,...C,children:[!Y&&o.jsx("thead",{...T("monthThead"),children:o.jsx(_n,{__staticSelector:h||"Month",locale:f,firstDayOfWeek:g,weekdayFormat:m,size:b,classNames:B,styles:H,unstyled:a,withWeekNumbers:P})}),o.jsx("tbody",{...T("monthTbody"),children:Q})]})});Qt.classes=Or,Qt.displayName="@mantine/dates/Month";var Er={pickerControl:"m_dc6a3c71"};const To=u.createVarsResolver((t,{size:e})=>({pickerControl:{"--dpc-fz":u.getFontSize(e),"--dpc-size":u.getSize(e,"dpc-size")}})),Kt=u.factory((t,e)=>{const n=u.useProps("PickerControl",null,t),{classNames:r,className:s,style:l,styles:i,unstyled:a,vars:c,firstInRange:h,lastInRange:f,inRange:g,__staticSelector:m,selected:p,disabled:y,attributes:k,...A}=n,I=u.useStyles({name:m||"PickerControl",classes:Er,props:n,className:s,style:l,classNames:r,styles:i,unstyled:a,attributes:k,vars:c,varsResolver:To,rootSelector:"pickerControl"});return o.jsx(u.UnstyledButton,{...I("pickerControl"),ref:e,unstyled:a,"data-picker-control":!0,"data-selected":p&&!y||void 0,"data-disabled":y||void 0,"data-in-range":g&&!y&&!p||void 0,"data-first-in-range":h&&!y||void 0,"data-last-in-range":f&&!y||void 0,disabled:y,...A})});Kt.classes=Er,Kt.displayName="@mantine/dates/PickerControl";function Lr({year:t,minDate:e,maxDate:n}){return!e&&!n?!1:!!(e&&V(t).isBefore(e,"year")||n&&V(t).isAfter(n,"year"))}function Oo({years:t,minDate:e,maxDate:n,getYearControlProps:r}){const s=t.flat().filter(a=>!Lr({year:a,minDate:e,maxDate:n})&&!r?.(a)?.disabled),l=s.find(a=>r?.(a)?.selected);if(l)return l;const i=s.find(a=>V().isSame(a,"year"));return i||s[0]}function Nr(t){const e=V(t).year(),n=e-e%10;let r=0;const s=[[],[],[],[]];for(let l=0;l<4;l+=1){const i=l===3?1:3;for(let a=0;a<i;a+=1)s[l].push(V(new Date(n+r,0)).format("YYYY-MM-DD")),r+=1}return s}var Ar={yearsList:"m_9206547b",yearsListCell:"m_c5a19c7d"};const Eo={yearsListFormat:"YYYY",withCellSpacing:!0},Jt=u.factory((t,e)=>{const n=u.useProps("YearsList",Eo,t),{classNames:r,className:s,style:l,styles:i,unstyled:a,vars:c,decade:h,yearsListFormat:f,locale:g,minDate:m,maxDate:p,getYearControlProps:y,__staticSelector:k,__getControlRef:A,__onControlKeyDown:I,__onControlClick:F,__onControlMouseEnter:z,__preventFocus:R,__stopPropagation:Y,withCellSpacing:$,size:O,attributes:L,..._}=n,j=u.useStyles({name:k||"YearsList",classes:Ar,props:n,className:s,style:l,classNames:r,styles:i,unstyled:a,attributes:L,vars:c,rootSelector:"yearsList"}),N=lt(),W=Nr(h),E=Oo({years:W,minDate:m,maxDate:p,getYearControlProps:y}),D=W.map((b,v)=>{const P=b.map((x,C)=>{const T=y?.(x),d=V(x).isSame(E,"year");return o.jsx("td",{...j("yearsListCell"),"data-with-spacing":$||void 0,children:o.jsx(Kt,{...j("yearsListControl"),size:O,unstyled:a,"data-mantine-stop-propagation":Y||void 0,disabled:Lr({year:x,minDate:m,maxDate:p}),ref:w=>{w&&A?.(v,C,w)},...T,onKeyDown:w=>{T?.onKeyDown?.(w),I?.(w,{rowIndex:v,cellIndex:C,date:x})},onClick:w=>{T?.onClick?.(w),F?.(w,x)},onMouseEnter:w=>{T?.onMouseEnter?.(w),z?.(w,x)},onMouseDown:w=>{T?.onMouseDown?.(w),R&&w.preventDefault()},tabIndex:R||!d?-1:0,children:T?.children??V(x).locale(N.getLocale(g)).format(f)})},C)});return o.jsx("tr",{...j("yearsListRow"),children:P},v)});return o.jsx(u.Box,{component:"table",ref:e,size:O,...j("yearsList"),..._,children:o.jsx("tbody",{children:D})})});Jt.classes=Ar,Jt.displayName="@mantine/dates/YearsList";function Rr({month:t,minDate:e,maxDate:n}){return!e&&!n?!1:!!(e&&V(t).isBefore(e,"month")||n&&V(t).isAfter(n,"month"))}function Lo({months:t,minDate:e,maxDate:n,getMonthControlProps:r}){const s=t.flat().filter(a=>!Rr({month:a,minDate:e,maxDate:n})&&!r?.(a)?.disabled),l=s.find(a=>r?.(a)?.selected);if(l)return l;const i=s.find(a=>V().isSame(a,"month"));return i||s[0]}function No(t){const e=V(t).startOf("year").toDate(),n=[[],[],[],[]];let r=0;for(let s=0;s<4;s+=1)for(let l=0;l<3;l+=1)n[s].push(V(e).add(r,"months").format("YYYY-MM-DD")),r+=1;return n}var $r={monthsList:"m_2a6c32d",monthsListCell:"m_fe27622f"};const Ao={monthsListFormat:"MMM",withCellSpacing:!0},Zt=u.factory((t,e)=>{const n=u.useProps("MonthsList",Ao,t),{classNames:r,className:s,style:l,styles:i,unstyled:a,vars:c,__staticSelector:h,year:f,monthsListFormat:g,locale:m,minDate:p,maxDate:y,getMonthControlProps:k,__getControlRef:A,__onControlKeyDown:I,__onControlClick:F,__onControlMouseEnter:z,__preventFocus:R,__stopPropagation:Y,withCellSpacing:$,size:O,attributes:L,..._}=n,j=u.useStyles({name:h||"MonthsList",classes:$r,props:n,className:s,style:l,classNames:r,styles:i,unstyled:a,attributes:L,vars:c,rootSelector:"monthsList"}),N=lt(),W=No(f),E=Lo({months:W,minDate:Ae(p),maxDate:Ae(y),getMonthControlProps:k}),D=W.map((b,v)=>{const P=b.map((x,C)=>{const T=k?.(x),d=V(x).isSame(E,"month");return o.jsx("td",{...j("monthsListCell"),"data-with-spacing":$||void 0,children:o.jsx(Kt,{...j("monthsListControl"),size:O,unstyled:a,__staticSelector:h||"MonthsList","data-mantine-stop-propagation":Y||void 0,disabled:Rr({month:x,minDate:Ae(p),maxDate:Ae(y)}),ref:w=>{w&&A?.(v,C,w)},...T,onKeyDown:w=>{T?.onKeyDown?.(w),I?.(w,{rowIndex:v,cellIndex:C,date:x})},onClick:w=>{T?.onClick?.(w),F?.(w,x)},onMouseEnter:w=>{T?.onMouseEnter?.(w),z?.(w,x)},onMouseDown:w=>{T?.onMouseDown?.(w),R&&w.preventDefault()},tabIndex:R||!d?-1:0,children:T?.children??V(x).locale(N.getLocale(m)).format(g)})},C)});return o.jsx("tr",{...j("monthsListRow"),children:P},v)});return o.jsx(u.Box,{component:"table",ref:e,size:O,...j("monthsList"),..._,children:o.jsx("tbody",{children:D})})});Zt.classes=$r,Zt.displayName="@mantine/dates/MonthsList";var Yr={calendarHeader:"m_730a79ed",calendarHeaderLevel:"m_f6645d97",calendarHeaderControl:"m_2351eeb0",calendarHeaderControlIcon:"m_367dc749"};const Ro={hasNextLevel:!0,withNext:!0,withPrevious:!0,headerControlsOrder:["previous","level","next"]},$o=u.createVarsResolver((t,{size:e})=>({calendarHeader:{"--dch-control-size":u.getSize(e,"dch-control-size"),"--dch-fz":u.getFontSize(e)}})),ct=u.factory((t,e)=>{const n=u.useProps("CalendarHeader",Ro,t),{classNames:r,className:s,style:l,styles:i,unstyled:a,vars:c,nextIcon:h,previousIcon:f,nextLabel:g,previousLabel:m,onNext:p,onPrevious:y,onLevelClick:k,label:A,nextDisabled:I,previousDisabled:F,hasNextLevel:z,levelControlAriaLabel:R,withNext:Y,withPrevious:$,headerControlsOrder:O,__staticSelector:L,__preventFocus:_,__stopPropagation:j,attributes:N,...W}=n,E=u.useStyles({name:L||"CalendarHeader",classes:Yr,props:n,className:s,style:l,classNames:r,styles:i,unstyled:a,attributes:N,vars:c,varsResolver:$o,rootSelector:"calendarHeader"}),D=_?C=>C.preventDefault():void 0,b=$&&M.createElement(u.UnstyledButton,{...E("calendarHeaderControl"),key:"previous","data-direction":"previous","aria-label":m,onClick:y,unstyled:a,onMouseDown:D,disabled:F,"data-disabled":F||void 0,tabIndex:_||F?-1:0,"data-mantine-stop-propagation":j||void 0},f||o.jsx(u.AccordionChevron,{...E("calendarHeaderControlIcon"),"data-direction":"previous",size:"45%"})),v=M.createElement(u.UnstyledButton,{component:z?"button":"div",...E("calendarHeaderLevel"),key:"level",onClick:z?k:void 0,unstyled:a,onMouseDown:z?D:void 0,disabled:!z,"data-static":!z||void 0,"aria-label":R,tabIndex:_||!z?-1:0,"data-mantine-stop-propagation":j||void 0},A),P=Y&&M.createElement(u.UnstyledButton,{...E("calendarHeaderControl"),key:"next","data-direction":"next","aria-label":g,onClick:p,unstyled:a,onMouseDown:D,disabled:I,"data-disabled":I||void 0,tabIndex:_||I?-1:0,"data-mantine-stop-propagation":j||void 0},h||o.jsx(u.AccordionChevron,{...E("calendarHeaderControlIcon"),"data-direction":"next",size:"45%"})),x=O.map(C=>C==="previous"?b:C==="level"?v:C==="next"?P:null);return o.jsx(u.Box,{...E("calendarHeader"),ref:e,...W,children:x})});ct.classes=Yr,ct.displayName="@mantine/dates/CalendarHeader";function Yo(t){const e=Nr(t);return[e[0][0],e[3][0]]}const Io={decadeLabelFormat:"YYYY"},Xt=u.factory((t,e)=>{const n=u.useProps("DecadeLevel",Io,t),{decade:r,locale:s,minDate:l,maxDate:i,yearsListFormat:a,getYearControlProps:c,__getControlRef:h,__onControlKeyDown:f,__onControlClick:g,__onControlMouseEnter:m,withCellSpacing:p,__preventFocus:y,nextIcon:k,previousIcon:A,nextLabel:I,previousLabel:F,onNext:z,onPrevious:R,nextDisabled:Y,previousDisabled:$,levelControlAriaLabel:O,withNext:L,withPrevious:_,headerControlsOrder:j,decadeLabelFormat:N,classNames:W,styles:E,unstyled:D,__staticSelector:b,__stopPropagation:v,size:P,attributes:x,...C}=n,T=lt(),[d,w]=Yo(r),S={__staticSelector:b||"DecadeLevel",classNames:W,styles:E,unstyled:D,size:P,attributes:x},B=typeof Y=="boolean"?Y:i?!V(w).endOf("year").isBefore(i):!1,H=typeof $=="boolean"?$:l?!V(d).startOf("year").isAfter(l):!1,Q=(U,G)=>V(U).locale(s||T.locale).format(G);return o.jsxs(u.Box,{"data-decade-level":!0,size:P,ref:e,...C,children:[o.jsx(ct,{label:typeof N=="function"?N(d,w):`${Q(d,N)} – ${Q(w,N)}`,__preventFocus:y,__stopPropagation:v,nextIcon:k,previousIcon:A,nextLabel:I,previousLabel:F,onNext:z,onPrevious:R,nextDisabled:B,previousDisabled:H,hasNextLevel:!1,levelControlAriaLabel:O,withNext:L,withPrevious:_,headerControlsOrder:j,...S}),o.jsx(Jt,{decade:r,locale:s,minDate:l,maxDate:i,yearsListFormat:a,getYearControlProps:c,__getControlRef:h,__onControlKeyDown:f,__onControlClick:g,__onControlMouseEnter:m,__preventFocus:y,__stopPropagation:v,withCellSpacing:p,...S})]})});Xt.classes={...Jt.classes,...ct.classes},Xt.displayName="@mantine/dates/DecadeLevel";const Fo={yearLabelFormat:"YYYY"},en=u.factory((t,e)=>{const n=u.useProps("YearLevel",Fo,t),{year:r,locale:s,minDate:l,maxDate:i,monthsListFormat:a,getMonthControlProps:c,__getControlRef:h,__onControlKeyDown:f,__onControlClick:g,__onControlMouseEnter:m,withCellSpacing:p,__preventFocus:y,nextIcon:k,previousIcon:A,nextLabel:I,previousLabel:F,onNext:z,onPrevious:R,onLevelClick:Y,nextDisabled:$,previousDisabled:O,hasNextLevel:L,levelControlAriaLabel:_,withNext:j,withPrevious:N,headerControlsOrder:W,yearLabelFormat:E,__staticSelector:D,__stopPropagation:b,size:v,classNames:P,styles:x,unstyled:C,attributes:T,...d}=n,w=lt(),S={__staticSelector:D||"YearLevel",classNames:P,styles:x,unstyled:C,size:v,attributes:T},B=typeof $=="boolean"?$:i?!V(r).endOf("year").isBefore(i):!1,H=typeof O=="boolean"?O:l?!V(r).startOf("year").isAfter(l):!1;return o.jsxs(u.Box,{"data-year-level":!0,size:v,ref:e,...d,children:[o.jsx(ct,{label:typeof E=="function"?E(r):V(r).locale(s||w.locale).format(E),__preventFocus:y,__stopPropagation:b,nextIcon:k,previousIcon:A,nextLabel:I,previousLabel:F,onNext:z,onPrevious:R,onLevelClick:Y,nextDisabled:B,previousDisabled:H,hasNextLevel:L,levelControlAriaLabel:_,withNext:j,withPrevious:N,headerControlsOrder:W,...S}),o.jsx(Zt,{year:r,locale:s,minDate:l,maxDate:i,monthsListFormat:a,getMonthControlProps:c,__getControlRef:h,__onControlKeyDown:f,__onControlClick:g,__onControlMouseEnter:m,__preventFocus:y,__stopPropagation:b,withCellSpacing:p,...S})]})});en.classes={...ct.classes,...Zt.classes},en.displayName="@mantine/dates/YearLevel";const Wo={monthLabelFormat:"MMMM YYYY"},tn=u.factory((t,e)=>{const n=u.useProps("MonthLevel",Wo,t),{month:r,locale:s,firstDayOfWeek:l,weekdayFormat:i,weekendDays:a,getDayProps:c,excludeDate:h,minDate:f,maxDate:g,renderDay:m,hideOutsideDates:p,hideWeekdays:y,getDayAriaLabel:k,__getDayRef:A,__onDayKeyDown:I,__onDayClick:F,__onDayMouseEnter:z,withCellSpacing:R,highlightToday:Y,withWeekNumbers:$,__preventFocus:O,__stopPropagation:L,nextIcon:_,previousIcon:j,nextLabel:N,previousLabel:W,onNext:E,onPrevious:D,onLevelClick:b,nextDisabled:v,previousDisabled:P,hasNextLevel:x,levelControlAriaLabel:C,withNext:T,withPrevious:d,headerControlsOrder:w,monthLabelFormat:S,classNames:B,styles:H,unstyled:Q,__staticSelector:U,size:G,static:K,attributes:q,...te}=n,X=lt(),ne={__staticSelector:U||"MonthLevel",classNames:B,styles:H,unstyled:Q,size:G,attributes:q},le=typeof v=="boolean"?v:g?!V(r).endOf("month").isBefore(g):!1,he=typeof P=="boolean"?P:f?!V(r).startOf("month").isAfter(f):!1;return o.jsxs(u.Box,{"data-month-level":!0,size:G,ref:e,...te,children:[o.jsx(ct,{label:typeof S=="function"?S(r):V(r).locale(s||X.locale).format(S),__preventFocus:O,__stopPropagation:L,nextIcon:_,previousIcon:j,nextLabel:N,previousLabel:W,onNext:E,onPrevious:D,onLevelClick:b,nextDisabled:le,previousDisabled:he,hasNextLevel:x,levelControlAriaLabel:C,withNext:T,withPrevious:d,headerControlsOrder:w,...ne}),o.jsx(Qt,{month:r,locale:s,firstDayOfWeek:l,weekdayFormat:i,weekendDays:a,getDayProps:c,excludeDate:h,minDate:f,maxDate:g,renderDay:m,hideOutsideDates:p,hideWeekdays:y,getDayAriaLabel:k,__getDayRef:A,__onDayKeyDown:I,__onDayClick:F,__onDayMouseEnter:z,__preventFocus:O,__stopPropagation:L,static:K,withCellSpacing:R,highlightToday:Y,withWeekNumbers:$,...ne})]})});tn.classes={...Qt.classes,...ct.classes},tn.displayName="@mantine/dates/MonthLevel";var Ir={levelsGroup:"m_30b26e33"};const ut=u.factory((t,e)=>{const n=u.useProps("LevelsGroup",null,t),{classNames:r,className:s,style:l,styles:i,unstyled:a,vars:c,__staticSelector:h,attributes:f,...g}=n,m=u.useStyles({name:h||"LevelsGroup",classes:Ir,props:n,className:s,style:l,classNames:r,styles:i,unstyled:a,attributes:f,vars:c,rootSelector:"levelsGroup"});return o.jsx(u.Box,{ref:e,...m("levelsGroup"),...g})});ut.classes=Ir,ut.displayName="@mantine/dates/LevelsGroup";const zo={numberOfColumns:1},nn=u.factory((t,e)=>{const n=u.useProps("DecadeLevelGroup",zo,t),{decade:r,locale:s,minDate:l,maxDate:i,yearsListFormat:a,getYearControlProps:c,__onControlClick:h,__onControlMouseEnter:f,withCellSpacing:g,__preventFocus:m,nextIcon:p,previousIcon:y,nextLabel:k,previousLabel:A,onNext:I,onPrevious:F,nextDisabled:z,previousDisabled:R,headerControlsOrder:Y,classNames:$,styles:O,unstyled:L,__staticSelector:_,__stopPropagation:j,numberOfColumns:N,levelControlAriaLabel:W,decadeLabelFormat:E,size:D,vars:b,attributes:v,...P}=n,x=M.useRef([]),C=Array(N).fill(0).map((T,d)=>{const w=V(r).add(d*10,"years").format("YYYY-MM-DD");return o.jsx(Xt,{size:D,yearsListFormat:a,decade:w,withNext:d===N-1,withPrevious:d===0,decadeLabelFormat:E,__onControlClick:h,__onControlMouseEnter:f,__onControlKeyDown:(S,B)=>Dn({levelIndex:d,rowIndex:B.rowIndex,cellIndex:B.cellIndex,event:S,controlsRef:x}),__getControlRef:(S,B,H)=>{Array.isArray(x.current[d])||(x.current[d]=[]),Array.isArray(x.current[d][S])||(x.current[d][S]=[]),x.current[d][S][B]=H},levelControlAriaLabel:typeof W=="function"?W(w):W,locale:s,minDate:l,maxDate:i,__preventFocus:m,__stopPropagation:j,nextIcon:p,previousIcon:y,nextLabel:k,previousLabel:A,onNext:I,onPrevious:F,nextDisabled:z,previousDisabled:R,getYearControlProps:c,__staticSelector:_||"DecadeLevelGroup",classNames:$,styles:O,unstyled:L,withCellSpacing:g,headerControlsOrder:Y,attributes:v},d)});return o.jsx(ut,{classNames:$,styles:O,__staticSelector:_||"DecadeLevelGroup",ref:e,size:D,unstyled:L,attributes:v,...P,children:C})});nn.classes={...ut.classes,...Xt.classes},nn.displayName="@mantine/dates/DecadeLevelGroup";const Bo={numberOfColumns:1},rn=u.factory((t,e)=>{const n=u.useProps("YearLevelGroup",Bo,t),{year:r,locale:s,minDate:l,maxDate:i,monthsListFormat:a,getMonthControlProps:c,__onControlClick:h,__onControlMouseEnter:f,withCellSpacing:g,__preventFocus:m,nextIcon:p,previousIcon:y,nextLabel:k,previousLabel:A,onNext:I,onPrevious:F,onLevelClick:z,nextDisabled:R,previousDisabled:Y,hasNextLevel:$,headerControlsOrder:O,classNames:L,styles:_,unstyled:j,__staticSelector:N,__stopPropagation:W,numberOfColumns:E,levelControlAriaLabel:D,yearLabelFormat:b,size:v,vars:P,attributes:x,...C}=n,T=M.useRef([]),d=Array(E).fill(0).map((w,S)=>{const B=V(r).add(S,"years").format("YYYY-MM-DD");return o.jsx(en,{size:v,monthsListFormat:a,year:B,withNext:S===E-1,withPrevious:S===0,yearLabelFormat:b,__stopPropagation:W,__onControlClick:h,__onControlMouseEnter:f,__onControlKeyDown:(H,Q)=>Dn({levelIndex:S,rowIndex:Q.rowIndex,cellIndex:Q.cellIndex,event:H,controlsRef:T}),__getControlRef:(H,Q,U)=>{Array.isArray(T.current[S])||(T.current[S]=[]),Array.isArray(T.current[S][H])||(T.current[S][H]=[]),T.current[S][H][Q]=U},levelControlAriaLabel:typeof D=="function"?D(B):D,locale:s,minDate:l,maxDate:i,__preventFocus:m,nextIcon:p,previousIcon:y,nextLabel:k,previousLabel:A,onNext:I,onPrevious:F,onLevelClick:z,nextDisabled:R,previousDisabled:Y,hasNextLevel:$,getMonthControlProps:c,classNames:L,styles:_,unstyled:j,__staticSelector:N||"YearLevelGroup",withCellSpacing:g,headerControlsOrder:O,attributes:x},S)});return o.jsx(ut,{classNames:L,styles:_,__staticSelector:N||"YearLevelGroup",ref:e,size:v,unstyled:j,attributes:x,...C,children:d})});rn.classes={...en.classes,...ut.classes},rn.displayName="@mantine/dates/YearLevelGroup";const Vo={numberOfColumns:1},sn=u.factory((t,e)=>{const n=u.useProps("MonthLevelGroup",Vo,t),{month:r,locale:s,firstDayOfWeek:l,weekdayFormat:i,weekendDays:a,getDayProps:c,excludeDate:h,minDate:f,maxDate:g,renderDay:m,hideOutsideDates:p,hideWeekdays:y,getDayAriaLabel:k,__onDayClick:A,__onDayMouseEnter:I,withCellSpacing:F,highlightToday:z,withWeekNumbers:R,__preventFocus:Y,nextIcon:$,previousIcon:O,nextLabel:L,previousLabel:_,onNext:j,onPrevious:N,onLevelClick:W,nextDisabled:E,previousDisabled:D,hasNextLevel:b,headerControlsOrder:v,classNames:P,styles:x,unstyled:C,numberOfColumns:T,levelControlAriaLabel:d,monthLabelFormat:w,__staticSelector:S,__stopPropagation:B,size:H,static:Q,vars:U,attributes:G,...K}=n,q=M.useRef([]),te=Array(T).fill(0).map((X,ne)=>{const le=V(r).add(ne,"months").format("YYYY-MM-DD");return o.jsx(tn,{month:le,withNext:ne===T-1,withPrevious:ne===0,monthLabelFormat:w,__stopPropagation:B,__onDayClick:A,__onDayMouseEnter:I,__onDayKeyDown:(he,re)=>Dn({levelIndex:ne,rowIndex:re.rowIndex,cellIndex:re.cellIndex,event:he,controlsRef:q}),__getDayRef:(he,re,_e)=>{Array.isArray(q.current[ne])||(q.current[ne]=[]),Array.isArray(q.current[ne][he])||(q.current[ne][he]=[]),q.current[ne][he][re]=_e},levelControlAriaLabel:typeof d=="function"?d(le):d,locale:s,firstDayOfWeek:l,weekdayFormat:i,weekendDays:a,getDayProps:c,excludeDate:h,minDate:f,maxDate:g,renderDay:m,hideOutsideDates:p,hideWeekdays:y,getDayAriaLabel:k,__preventFocus:Y,nextIcon:$,previousIcon:O,nextLabel:L,previousLabel:_,onNext:j,onPrevious:N,onLevelClick:W,nextDisabled:E,previousDisabled:D,hasNextLevel:b,classNames:P,styles:x,unstyled:C,__staticSelector:S||"MonthLevelGroup",size:H,static:Q,withCellSpacing:F,highlightToday:z,withWeekNumbers:R,headerControlsOrder:v,attributes:G},ne)});return o.jsx(ut,{classNames:P,styles:x,__staticSelector:S||"MonthLevelGroup",ref:e,size:H,attributes:G,...K,children:te})});sn.classes={...ut.classes,...tn.classes},sn.displayName="@mantine/dates/MonthLevelGroup";const Fr=t=>t==="range"?[null,null]:t==="multiple"?[]:null,Wr=(t,e)=>{const n=e?wr:Ae;return Array.isArray(t)?t.map(n):n(t)};function Pn({type:t,value:e,defaultValue:n,onChange:r,withTime:s=!1}){const l=M.useRef(t),[i,a,c]=De.useUncontrolled({value:Wr(e,s),defaultValue:Wr(n,s),finalValue:Fr(t),onChange:r});let h=i;return l.current!==t&&(l.current=t,e===void 0&&(h=n!==void 0?n:Fr(t),a(h))),[h,a,c]}function Mn(t,e){return t?t==="month"?0:t==="year"?1:2:e||0}function Ho(t){return t===0?"month":t===1?"year":"decade"}function $t(t,e,n){return Ho(De.clamp(Mn(t,0),Mn(e,0),Mn(n,2)))}const Uo={maxLevel:"decade",minLevel:"month",__updateDateOnYearSelect:!0,__updateDateOnMonthSelect:!0,enableKeyboardNavigation:!0},on=u.factory((t,e)=>{const n=u.useProps("Calendar",Uo,t),{vars:r,maxLevel:s,minLevel:l,defaultLevel:i,level:a,onLevelChange:c,date:h,defaultDate:f,onDateChange:g,numberOfColumns:m,columnsToScroll:p,ariaLabels:y,nextLabel:k,previousLabel:A,onYearSelect:I,onMonthSelect:F,onYearMouseEnter:z,onMonthMouseEnter:R,headerControlsOrder:Y,__updateDateOnYearSelect:$,__updateDateOnMonthSelect:O,__setDateRef:L,__setLevelRef:_,firstDayOfWeek:j,weekdayFormat:N,weekendDays:W,getDayProps:E,excludeDate:D,renderDay:b,hideOutsideDates:v,hideWeekdays:P,getDayAriaLabel:x,monthLabelFormat:C,nextIcon:T,previousIcon:d,__onDayClick:w,__onDayMouseEnter:S,withCellSpacing:B,highlightToday:H,withWeekNumbers:Q,monthsListFormat:U,getMonthControlProps:G,yearLabelFormat:K,yearsListFormat:q,getYearControlProps:te,decadeLabelFormat:X,classNames:ne,styles:le,unstyled:he,minDate:re,maxDate:_e,locale:pe,__staticSelector:Te,size:je,__preventFocus:nt,__stopPropagation:Re,onNextDecade:Je,onPreviousDecade:$e,onNextYear:Ye,onPreviousYear:Ze,onNextMonth:J,onPreviousMonth:ge,static:fe,enableKeyboardNavigation:rt,attributes:ie,...Oe}=n,{resolvedClassNames:dt,resolvedStyles:ht}=u.useResolvedStylesApi({classNames:ne,styles:le,props:n}),[qe,Ie]=De.useUncontrolled({value:a?$t(a,l,s):void 0,defaultValue:i?$t(i,l,s):void 0,finalValue:$t(void 0,l,s),onChange:c}),[xt,ve]=Pn({type:"default",value:Ae(h),defaultValue:Ae(f),onChange:g});M.useImperativeHandle(L,()=>Z=>{ve(Z)}),M.useImperativeHandle(_,()=>Z=>{Ie(Z)});const st={__staticSelector:Te||"Calendar",styles:ht,classNames:dt,unstyled:he,size:je,attributes:ie},Ee=p||m||1,ot=new Date,Ct=re&&V(ot).isAfter(re)?re:V(ot).format("YYYY-MM-DD"),xe=xt||Ct,St=()=>{const Z=V(xe).add(Ee,"month").format("YYYY-MM-DD");J?.(Z),ve(Z)},Pe=()=>{const Z=V(xe).subtract(Ee,"month").format("YYYY-MM-DD");ge?.(Z),ve(Z)},at=()=>{const Z=V(xe).add(Ee,"year").format("YYYY-MM-DD");Ye?.(Z),ve(Z)},Fe=()=>{const Z=V(xe).subtract(Ee,"year").format("YYYY-MM-DD");Ze?.(Z),ve(Z)},Xe=()=>{const Z=V(xe).add(10*Ee,"year").format("YYYY-MM-DD");Je?.(Z),ve(Z)},We=()=>{const Z=V(xe).subtract(10*Ee,"year").format("YYYY-MM-DD");$e?.(Z),ve(Z)},Ge=M.useRef(null);M.useEffect(()=>{if(!rt||fe)return;const Z=ce=>{if(!Ge.current?.contains(document.activeElement))return;const Le=ce.ctrlKey||ce.metaKey,Qe=ce.shiftKey;switch(ce.key){case"ArrowUp":Le&&Qe?(ce.preventDefault(),We()):Le&&(ce.preventDefault(),Fe());break;case"ArrowDown":Le&&Qe?(ce.preventDefault(),Xe()):Le&&(ce.preventDefault(),at());break;case"y":case"Y":qe==="month"&&(ce.preventDefault(),Ie("year"));break}};return document.addEventListener("keydown",Z),()=>{document.removeEventListener("keydown",Z)}},[rt,fe,qe,at,Fe,Xe,We]);const et=Z=>{Ge.current=Z,typeof e=="function"?e(Z):e&&(e.current=Z)};return o.jsxs(u.Box,{ref:et,size:je,"data-calendar":!0,...Oe,children:[qe==="month"&&o.jsx(sn,{month:xe,minDate:re,maxDate:_e,firstDayOfWeek:j,weekdayFormat:N,weekendDays:W,getDayProps:E,excludeDate:D,renderDay:b,hideOutsideDates:v,hideWeekdays:P,getDayAriaLabel:x,onNext:St,onPrevious:Pe,hasNextLevel:s!=="month",onLevelClick:()=>Ie("year"),numberOfColumns:m,locale:pe,levelControlAriaLabel:y?.monthLevelControl,nextLabel:y?.nextMonth??k,nextIcon:T,previousLabel:y?.previousMonth??A,previousIcon:d,monthLabelFormat:C,__onDayClick:w,__onDayMouseEnter:S,__preventFocus:nt,__stopPropagation:Re,static:fe,withCellSpacing:B,highlightToday:H,withWeekNumbers:Q,headerControlsOrder:Y,...st}),qe==="year"&&o.jsx(rn,{year:xe,numberOfColumns:m,minDate:re,maxDate:_e,monthsListFormat:U,getMonthControlProps:G,locale:pe,onNext:at,onPrevious:Fe,hasNextLevel:s!=="month"&&s!=="year",onLevelClick:()=>Ie("decade"),levelControlAriaLabel:y?.yearLevelControl,nextLabel:y?.nextYear??k,nextIcon:T,previousLabel:y?.previousYear??A,previousIcon:d,yearLabelFormat:K,__onControlMouseEnter:R,__onControlClick:(Z,ce)=>{O&&ve(ce),Ie($t("month",l,s)),F?.(ce)},__preventFocus:nt,__stopPropagation:Re,withCellSpacing:B,headerControlsOrder:Y,...st}),qe==="decade"&&o.jsx(nn,{decade:xe,minDate:re,maxDate:_e,yearsListFormat:q,getYearControlProps:te,locale:pe,onNext:Xe,onPrevious:We,numberOfColumns:m,nextLabel:y?.nextDecade??k,nextIcon:T,previousLabel:y?.previousDecade??A,previousIcon:d,decadeLabelFormat:X,__onControlMouseEnter:z,__onControlClick:(Z,ce)=>{$&&ve(ce),Ie($t("year",l,s)),I?.(ce)},__preventFocus:nt,__stopPropagation:Re,withCellSpacing:B,headerControlsOrder:Y,...st})]})});on.classes={...nn.classes,...rn.classes,...sn.classes},on.displayName="@mantine/dates/Calendar";function qo(t){const{maxLevel:e,minLevel:n,defaultLevel:r,level:s,onLevelChange:l,nextIcon:i,previousIcon:a,date:c,defaultDate:h,onDateChange:f,numberOfColumns:g,columnsToScroll:m,ariaLabels:p,nextLabel:y,previousLabel:k,onYearSelect:A,onMonthSelect:I,onYearMouseEnter:F,onMonthMouseEnter:z,onNextMonth:R,onPreviousMonth:Y,onNextYear:$,onPreviousYear:O,onNextDecade:L,onPreviousDecade:_,withCellSpacing:j,highlightToday:N,__updateDateOnYearSelect:W,__updateDateOnMonthSelect:E,__setDateRef:D,__setLevelRef:b,withWeekNumbers:v,headerControlsOrder:P,firstDayOfWeek:x,weekdayFormat:C,weekendDays:T,getDayProps:d,excludeDate:w,renderDay:S,hideOutsideDates:B,hideWeekdays:H,getDayAriaLabel:Q,monthLabelFormat:U,monthsListFormat:G,getMonthControlProps:K,yearLabelFormat:q,yearsListFormat:te,getYearControlProps:X,decadeLabelFormat:ne,allowSingleDateInRange:le,allowDeselect:he,minDate:re,maxDate:_e,locale:pe,...Te}=t;return{calendarProps:{maxLevel:e,minLevel:n,defaultLevel:r,level:s,onLevelChange:l,nextIcon:i,previousIcon:a,date:c,defaultDate:h,onDateChange:f,numberOfColumns:g,columnsToScroll:m,ariaLabels:p,nextLabel:y,previousLabel:k,onYearSelect:A,onMonthSelect:I,onYearMouseEnter:F,onMonthMouseEnter:z,onNextMonth:R,onPreviousMonth:Y,onNextYear:$,onPreviousYear:O,onNextDecade:L,onPreviousDecade:_,withCellSpacing:j,highlightToday:N,__updateDateOnYearSelect:W,__updateDateOnMonthSelect:E,__setDateRef:D,withWeekNumbers:v,headerControlsOrder:P,firstDayOfWeek:x,weekdayFormat:C,weekendDays:T,getDayProps:d,excludeDate:w,renderDay:S,hideOutsideDates:B,hideWeekdays:H,getDayAriaLabel:Q,monthLabelFormat:U,monthsListFormat:G,getMonthControlProps:K,yearLabelFormat:q,yearsListFormat:te,getYearControlProps:X,decadeLabelFormat:ne,allowSingleDateInRange:le,allowDeselect:he,minDate:re,maxDate:_e,locale:pe},others:Te}}function Go(t){if(t===null)return null;const e=new Date(t);return Number.isNaN(e.getTime())||!t?null:V(e).format("YYYY-MM-DD")}function Qo({date:t,maxDate:e,minDate:n}){return!(t==null||Number.isNaN(new Date(t).getTime())||e&&V(t).isAfter(e,"date")||n&&V(t).isBefore(n,"date"))}const Ko={valueFormat:"MMMM D, YYYY",fixOnBlur:!0,size:"sm"},an=u.factory((t,e)=>{const n=u.useInputProps("DateInput",Ko,t),{inputProps:r,wrapperProps:s,value:l,defaultValue:i,onChange:a,clearable:c,clearButtonProps:h,popoverProps:f,getDayProps:g,locale:m,valueFormat:p,dateParser:y,minDate:k,maxDate:A,fixOnBlur:I,onFocus:F,onBlur:z,onClick:R,onKeyDown:Y,readOnly:$,name:O,form:L,rightSection:_,unstyled:j,classNames:N,styles:W,allowDeselect:E,date:D,defaultDate:b,onDateChange:v,getMonthControlProps:P,getYearControlProps:x,disabled:C,...T}=n,d=M.useRef(null),w=M.useRef(null),[S,B]=M.useState(!1),{calendarProps:H,others:Q}=qo(T),U=lt(),K=y||(J=>{const ge=V(J,p,U.getLocale(m)).toDate();return Number.isNaN(ge.getTime())?Go(J):V(ge).format("YYYY-MM-DD")}),q=E!==void 0?E:c,te=J=>J?V(J).locale(U.getLocale(m)).format(p):"",[X,ne,le]=Pn({type:"default",value:l,defaultValue:i,onChange:a}),[he,re]=Pn({type:"default",value:D,defaultValue:i||b,onChange:v});M.useEffect(()=>{le&&l!==null&&re(l)},[le,l]);const[_e,pe]=M.useState(te(X));M.useEffect(()=>{pe(te(X))},[U.getLocale(m)]);const Te=J=>{const ge=J.currentTarget.value;if(pe(ge),B(!0),ge.trim()===""&&(E||c))ne(null);else{const fe=K(ge);fe&&Qo({date:fe,minDate:k,maxDate:A})&&(ne(fe),re(fe))}},je=J=>{z?.(J),B(!1),I&&pe(te(X))},nt=J=>{F?.(J),B(!0)},Re=J=>{R?.(J),B(!0)},Je=J=>{J.key==="Escape"&&B(!1),Y?.(J)},$e=J=>({...g?.(J),selected:V(X).isSame(J,"day"),onClick:ge=>{g?.(J).onClick?.(ge);const fe=q&&V(X).isSame(J,"day")?null:J;ne(fe),!le&&fe&&pe(te(fe)),B(!1)}}),Ye=o.jsx(u.Input.ClearButton,{onClick:()=>{ne(null),!le&&pe(""),B(!1)},unstyled:j,...h}),Ze=c&&!!X&&!$&&!C;return De.useDidUpdate(()=>{X!==void 0&&!S&&pe(te(X))},[X]),De.useClickOutside(()=>B(!1),void 0,[d.current,w.current]),o.jsxs(o.Fragment,{children:[o.jsx(u.Input.Wrapper,{...s,__staticSelector:"DateInput",ref:d,children:o.jsxs(u.Popover,{opened:S,trapFocus:!1,position:"bottom-start",disabled:$||C,withRoles:!1,unstyled:j,...f,children:[o.jsx(u.Popover.Target,{children:o.jsx(u.Input,{"data-dates-input":!0,"data-read-only":$||void 0,autoComplete:"off",ref:e,value:_e,onChange:Te,onBlur:je,onFocus:nt,onClick:Re,onKeyDown:Je,readOnly:$,rightSection:_,__clearSection:Ye,__clearable:Ze,...r,...Q,disabled:C,__staticSelector:"DateInput"})}),o.jsx(u.Popover.Dropdown,{onMouseDown:J=>J.preventDefault(),"data-dates-dropdown":!0,ref:w,children:o.jsx(on,{__staticSelector:"DateInput",...H,classNames:N,styles:W,unstyled:j,__preventFocus:!0,minDate:k,maxDate:A,locale:m,getDayProps:$e,size:r.size,date:he,onDateChange:re,getMonthControlProps:J=>({selected:typeof X=="string"?jn(J,X):!1,...P?.(J)}),getYearControlProps:J=>({selected:typeof X=="string"?V(J).isSame(X,"year"):!1,...x?.(J)}),attributes:s.attributes})})]})}),o.jsx(Dr,{name:O,form:L,value:X,type:"default"})]})});an.classes={...u.Input.classes,...on.classes},an.displayName="@mantine/dates/DateInput";function zr(t){const e=Me.c(49),{fields:n,onClose:r,queryKey:s,apiPath:l,steps:i,onCreated:a}=t,[c,h]=M.useState(0),[f,g]=M.useState(!1),[m,p]=M.useState(),{mutateAsync:y,isError:k,error:A,isPending:I}=vr(l,s),{mutateAsync:F,isPending:z}=wn(l,s),R=I||z;let Y;e[0]!==n?(Y=new Set(n.filter(ea).map(Xo)),e[0]=n,e[1]=Y):Y=e[1];let $;e[2]!==Y?($=[...Y],e[2]=Y,e[3]=$):$=e[3];const O=$;let L;e[4]===Symbol.for("react.memo_cache_sentinel")?(L=function(S,B){return typeof S.required=="function"?S.required(B??{}):!!S.required},e[4]=L):L=e[4];const _=L;let j;e[5]!==n?(j=n.reduce(Zo,{}),e[5]=n,e[6]=j):j=e[6];let N;if(e[7]!==n){let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=(S,B)=>(S[B.id]=(H,Q)=>B.conditional&&!B.conditional(Q)||!_(B,Q)||H?null:"Pflichtfeld",S),e[9]=w):w=e[9],N=n.filter(Jo).reduce(w,{}),e[7]=n,e[8]=N}else N=e[8];let W;e[10]!==j||e[11]!==N?(W={mode:"uncontrolled",initialValues:j,validate:N},e[10]=j,e[11]=N,e[12]=W):W=e[12];const E=Vn.useForm(W);let D;e[13]!==E||e[14]!==m?(D=function(S){const B=E.getValues();if(S.conditional&&!S.conditional(B))return null;const H=_(S,B);return o.jsxs(M.Fragment,{children:[(S.type===void 0||S.type=="text")&&o.jsx(u.TextInput,{label:S.column.title,placeholder:S.placeholder??"",...E.getInputProps(S.id),type:S.id.includes("email")?"email":void 0,required:H},E.key(S.id)),S.type==="number"&&o.jsx(u.NumberInput,{decimalSeparator:",",label:S.column.title,placeholder:S.placeholder??"",...E.getInputProps(S.id),required:H},E.key(S.id)),S.type==="date"&&o.jsx(an,{label:S.column.title,placeholder:S.placeholder??"",valueFormat:"DD.MM.YYYY",clearable:!0,...E.getInputProps(S.id),required:H},E.key(S.id)),S.type==="boolean"&&o.jsx(u.Checkbox,{mt:"md",label:S.column.title,...E.getInputProps(S.id,{type:"checkbox"}),required:H},E.key(S.id)),S.type==="textarea"&&o.jsx(u.Textarea,{label:S.column.title,placeholder:S.placeholder??"",...E.getInputProps(S.id),minRows:3,autosize:!0,required:H},E.key(S.id)),S.type==="custom"&&S.render&&S.render({...E.getValues(),...m&&{id:m}},E.setValues,g,{error:E.getInputProps(S.id).error,required:H})]},S.id)},e[13]=E,e[14]=m,e[15]=D):D=e[15];const b=D;let v;e[16]!==A?.message||e[17]!==A?.name||e[18]!==k?(v=k&&o.jsx(u.Alert,{variant:"outline",color:"red",title:A?.name??"Fehler aufgetreten",mb:"lg",children:A?.message??"Fehler aufgetreten"}),e[16]=A?.message,e[17]=A?.name,e[18]=k,e[19]=v):v=e[19];let P;e[20]!==c||e[21]!==y||e[22]!==E||e[23]!==k||e[24]!==r||e[25]!==a||e[26]!==m||e[27]!==O.length||e[28]!==F?(P=E.onSubmit(async w=>{if(m)await F({...w,id:m});else{const S=await y(w);p(S.id),a?.(S.id)}O.length&&c<O.length-1?k||h(c+1):k||(E.setInitialValues(w),E.reset(),r())}),e[20]=c,e[21]=y,e[22]=E,e[23]=k,e[24]=r,e[25]=a,e[26]=m,e[27]=O.length,e[28]=F,e[29]=P):P=e[29];let x;e[30]!==c||e[31]!==n||e[32]!==b||e[33]!==i||e[34]!==O?(x=O.length?o.jsx(u.Stepper,{active:c,size:"sm",children:O.map(w=>o.jsx(u.Stepper.Step,{...i&&i[w-1]?{label:i[w-1].label}:{},children:n.filter(S=>S.step===w).map(S=>b(S))},w))}):n.map(w=>b(w)),e[30]=c,e[31]=n,e[32]=b,e[33]=i,e[34]=O,e[35]=x):x=e[35];let C;e[36]!==c||e[37]!==f||e[38]!==R||e[39]!==r||e[40]!==O.length?(C=!f&&o.jsxs(u.Group,{mt:"md",justify:"end",children:[o.jsx(u.Button,{onClick:()=>O.length?c===0?r():h(c-1):r(),variant:"outline",children:O.length?c===0?"Abbrechen":"Zurück":"Abbrechen"}),o.jsx(u.Button,{type:"submit",loading:R,children:O.length?c===O.length-1?"Speichern":"Weiter":"Speichern"})]}),e[36]=c,e[37]=f,e[38]=R,e[39]=r,e[40]=O.length,e[41]=C):C=e[41];let T;e[42]!==x||e[43]!==C||e[44]!==P?(T=o.jsxs("form",{onSubmit:P,children:[x,C]}),e[42]=x,e[43]=C,e[44]=P,e[45]=T):T=e[45];let d;return e[46]!==T||e[47]!==v?(d=o.jsxs(o.Fragment,{children:[v,T]}),e[46]=T,e[47]=v,e[48]=d):d=e[48],d}function Jo(t){return t.required}function Zo(t,e){return t[e.id]=e.type==="boolean"?!1:e.defaultValue??"",t}function Xo(t){return t.step}function ea(t){return typeof t.step=="number"}var[ta,Tn]=u.createSafeContext("useDataTableColumnsContext must be used within DataTableColumnProvider"),Br=t=>{let{children:e,columnsOrder:n,setColumnsOrder:r,columnsToggle:s,setColumnsToggle:l,resetColumnsOrder:i,resetColumnsToggle:a,setColumnWidth:c,setMultipleColumnWidths:h,resetColumnsWidth:f}=t,[g,m]=M.useState(""),[p,y]=M.useState("");return o.jsx(ta,{value:{sourceColumn:g,setSourceColumn:m,targetColumn:p,setTargetColumn:y,columnsToggle:s,setColumnsToggle:l,swapColumns:()=>{if(!n||!r||!g||!p)return;let k=n.indexOf(g),A=n.indexOf(p);if(k!==-1&&A!==-1){let I=n.splice(k,1)[0];n.splice(A,0,I),r([...n])}},resetColumnsOrder:i,resetColumnsToggle:a,setColumnWidth:c,setMultipleColumnWidths:h,resetColumnsWidth:f},children:e})};function na(){return o.jsx("tr",{className:"mantine-datatable-empty-row",children:o.jsx("td",{})})}function ra(){return o.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),o.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"}),o.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"}),o.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"}),o.jsx("path",{d:"M3 3l18 18"})]})}function sa({icon:t,text:e,active:n,children:r}){return o.jsx(u.Center,{className:"mantine-datatable-empty-state","data-active":n||void 0,children:r||o.jsxs(o.Fragment,{children:[t||o.jsx("div",{className:"mantine-datatable-empty-state-icon",children:o.jsx(ra,{})}),o.jsx(u.Text,{component:"div",size:"sm",c:"dimmed",children:e})]})})}function oa({key:t,columns:e=[],getInitialValueInEffect:n=!0}){function r(g,m){let p=[];return g.forEach(y=>{m.find(k=>k.accessor===y)&&p.push(y)}),m.forEach(y=>{p.includes(y.accessor)||p.push(y.accessor)}),p}let s=e&&e.map(g=>g.accessor)||[],[l,i]=De.useLocalStorage({key:t?`${t}-columns-order`:"",defaultValue:t?s:void 0,getInitialValueInEffect:n});function a(g){t&&i(g)}let c=()=>{a(s)};if(!t)return{columnsOrder:l,setColumnsOrder:a,resetColumnsOrder:c};let h=r(l,e),f=JSON.stringify(l);return JSON.stringify(h)!==f&&a(h),{columnsOrder:h,setColumnsOrder:a,resetColumnsOrder:c}}function aa({key:t,columns:e=[],getInitialValueInEffect:n=!0,headerRef:r,onFixedLayoutChange:s}){let l=M.useRef(!1),i=M.useRef({}),[a,c]=M.useState(!0),h=M.useMemo(()=>e.some(_=>_.resizable&&!_.hidden&&_.accessor!=="__selection__"),[e]),f=M.useMemo(()=>e.filter(_=>_.resizable&&!_.hidden&&_.accessor!=="__selection__"),[e]),g=M.useMemo(()=>f.some(_=>_.width===void 0||_.width===""||_.width==="initial"),[f]),m=M.useCallback(()=>e.filter(_=>_.accessor!=="__selection__").map(_=>({[_.accessor]:_.width??"auto"})),[e]),[p,y]=De.useLocalStorage({key:t?`${t}-columns-width`:"",defaultValue:t?m():void 0,getInitialValueInEffect:!1}),[k,A]=M.useState(()=>m());M.useEffect(()=>{c(!1)},[]);let I=M.useCallback(()=>{if(!r?.current||a)return{};let _=r.current,j=Array.from(_.querySelectorAll("th[data-accessor]")),N={};return j.forEach(W=>{let E=W.getAttribute("data-accessor");if(!E||E==="__selection__")return;let D=f.find(b=>b.accessor===E);if(D&&(D.width===void 0||D.width===""||D.width==="initial")){let b=W.getBoundingClientRect();N[E]=Math.round(b.width)}}),N},[r,f,a]),F=M.useCallback(_=>{let j=_.filter(W=>W.accessor!=="__selection__"),N=k.map(W=>{let E=Object.keys(W)[0],D=j.find(b=>b.accessor===E);return D?{[E]:D.width}:W});A(N),t&&y(N)},[k,t,y]),z=M.useCallback(_=>{F(_)},[F]),R=M.useCallback(()=>{if(!(!r?.current||!s||a))if(g)s(!1),requestAnimationFrame(()=>{requestAnimationFrame(()=>{let _=I();i.current={...i.current,..._};let j=e.filter(N=>N.accessor!=="__selection__").map(N=>{let W=N.accessor,E=p?.find(b=>Object.keys(b)[0]===W);if(E&&E[W]!=="auto")return{[W]:E[W]};let D=_[W];return D?{[W]:`${D}px`}:{[W]:N.width??"auto"}});A(j),setTimeout(()=>{s(!0),l.current=!0},10)})});else{let _=e.filter(j=>j.accessor!=="__selection__").map(j=>({[j.accessor]:j.width??"auto"}));A(_),s(!0),l.current=!0}},[r,s,a,g,I,e,p]),Y=R;M.useEffect(()=>{if(!h||!s||a){s?.(!1);return}l.current=!1;let _=setTimeout(()=>{R()},50);return()=>clearTimeout(_)},[h,s,a,R]),M.useEffect(()=>{a||!t||!n||p&&p.length>0&&A(p)},[a,t,n,p]);let $=M.useCallback(()=>{t&&y(m()),i.current={},l.current=!1,s&&(s(!1),setTimeout(()=>{R()},10))},[t,y,m,s,R]),O=M.useCallback((_,j)=>{F([{accessor:_,width:j}])},[F]),L=M.useMemo(()=>h?k.filter(_=>{let j=Object.keys(_)[0];return f.some(N=>N.accessor===j)}).every(_=>{let j=Object.values(_)[0];return j==="auto"||j==="initial"}):!1,[h,k,f]);return{columnsWidth:k,setColumnsWidth:F,setColumnWidth:O,setMultipleColumnWidths:z,resetColumnsWidth:$,hasResizableColumns:h,allResizableWidthsInitial:L,measureAndSetColumnWidths:Y}}function ia({key:t,columns:e=[],getInitialValueInEffect:n=!0}){function r(g,m){let p=[];return g.forEach(y=>{m.find(k=>k.accessor===y.accessor)&&p.push(y)}),m.forEach(y=>{p.find(k=>k.accessor===y.accessor)||p.push({accessor:y.accessor,defaultToggle:y.defaultToggle||!0,toggleable:y.toggleable,toggled:y.defaultToggle===void 0?!0:y.defaultToggle})}),p}let s=e&&e.map(g=>({accessor:g.accessor,defaultToggle:g.defaultToggle||!0,toggleable:g.toggleable,toggled:g.defaultToggle===void 0?!0:g.defaultToggle})),[l,i]=De.useLocalStorage({key:t?`${t}-columns-toggle`:"",defaultValue:t?s:void 0,getInitialValueInEffect:n});function a(g){t&&i(g)}let c=()=>{a(s)};if(!t)return{columnsToggle:l,setColumnsToggle:a,resetColumnsToggle:c};let h=r(l,e),f=JSON.stringify(l);return JSON.stringify(h)!==f&&a(h),{columnsToggle:h,setColumnsToggle:a,resetColumnsToggle:c}}var la=({key:t,columns:e=[],getInitialValueInEffect:n=!0,headerRef:r,scrollViewportRef:s,onFixedLayoutChange:l})=>{let{columnsOrder:i,setColumnsOrder:a,resetColumnsOrder:c}=oa({key:t,columns:e,getInitialValueInEffect:n}),{columnsToggle:h,setColumnsToggle:f,resetColumnsToggle:g}=ia({key:t,columns:e,getInitialValueInEffect:n}),{columnsWidth:m,setColumnsWidth:p,setColumnWidth:y,setMultipleColumnWidths:k,resetColumnsWidth:A,hasResizableColumns:I,allResizableWidthsInitial:F,measureAndSetColumnWidths:z}=aa({key:t,columns:e,getInitialValueInEffect:n,headerRef:r,onFixedLayoutChange:l});return{effectiveColumns:M.useMemo(()=>i?i.map(R=>e.find(Y=>Y.accessor===R)).map(R=>({...R,hidden:R?.hidden||!h.find(Y=>Y.accessor===R?.accessor)?.toggled})).map(R=>R?.accessor==="__selection__"?R:{...R,width:m.find(Y=>Y[R?.accessor])?.[R?.accessor]}):e,[e,i,h,m]),setColumnsOrder:a,columnsOrder:i,resetColumnsOrder:c,columnsToggle:h,setColumnsToggle:f,resetColumnsToggle:g,columnsWidth:m,setColumnsWidth:p,setColumnWidth:y,setMultipleColumnWidths:k,resetColumnsWidth:A,hasResizableColumns:I,allResizableWidthsInitial:F,measureAndSetColumnWidths:z}},Vr=typeof window<"u"?M.useLayoutEffect:M.useEffect;function Hr(t){let e=M.useRef(t);return e.current=t,e}var Ur="--mantine-datatable-header-height",qr="--mantine-datatable-footer-height",Gr="--mantine-datatable-selection-column-width",Qr="--mantine-datatable-last-row-border-bottom";function Ue(t,e,n){t?.style.setProperty(e,n)}function On(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 En(t,e,n){if(t){let r=new ResizeObserver(s=>{let l=s[0];l&&e(On(l))});return r.observe(t),()=>{r.disconnect(),n()}}}function ca({scrollCallbacks:t,withRowBorders:e}){let n={root:M.useRef(null),table:M.useRef(null),scrollViewport:M.useRef(null),header:M.useRef(null),footer:M.useRef(null),selectionColumnHeader:M.useRef(null)},{root:r,table:s,scrollViewport:l,header:i,footer:a,selectionColumnHeader:c}=n,h=Hr({withRowBorders:e}),f=Hr(t),g=M.useRef(()=>{}),m=M.useRef(()=>{}),p=M.useCallback(y=>{f.current.onScroll?.(y),g.current()},[]);return M.useEffect(()=>En(i.current,y=>{Ue(r.current,Ur,`${y.height}px`)},()=>Ue(r.current,Ur,"0")),[i.current]),M.useEffect(()=>En(a.current,y=>{Ue(r.current,qr,`${y.height}px`)},()=>Ue(r.current,qr,"0")),[a.current]),M.useEffect(()=>En(c.current,y=>{Ue(r.current,Gr,`${y.width}px`)},()=>Ue(r.current,Gr,"0")),[c.current]),Vr(()=>{if(typeof window===void 0)return;let y={top:!0,bottom:!0,left:!0,right:!0},k={width:0,height:0},A={width:0,height:0};function I($,O){let L=y[$];return y[$]=O,Ue(r.current,`--mantine-datatable-${$}-shadow-opacity`,O?"0":"1"),L}function F(){let $=k.height-A.height,O=$<0;Ue(r.current,"--mantine-datatable-footer-position",O?"relative":"sticky"),Ue(r.current,"--mantine-datatable-footer-bottom",O?`${$}px`:"0")}function z(){h.current.withRowBorders&&k.height<A.height?Ue(r.current,Qr,`${u.rem("1px")} solid var(--mantine-datatable-border-color)`):Ue(r.current,Qr,"unset")}m.current=z;function R(){let $=f.current,O=l.current,L=O?.scrollTop??0,_=O?.scrollLeft??0,j=L===0,N=k.height-L-A.height<1,W=I("top",j),E=I("bottom",N);j&&j!==W&&$.onScrollToTop?.(),N&&N!==E&&$.onScrollToBottom?.();let D=O?getComputedStyle(O).direction==="rtl":!1,b=(O?.scrollWidth??0)-A.width,v,P;if(D){let T=Math.abs(_);P=T<1,v=b-T<1}else v=_<1,P=k.width-_-A.width<1;let x=I("left",v),C=I("right",P);v&&v!==x&&$.onScrollToLeft?.(),P&&P!==C&&$.onScrollToRight?.()}g.current=R;let Y=new ResizeObserver($=>{for(let O of $)switch(O.target.tagName){case"TABLE":{k=On(O);break}case"DIV":{A=On(O);break}}R(),F(),z()});return Y.observe(s.current),Y.observe(l.current),()=>{Y.disconnect()}},[]),Vr(()=>{m.current()},[e]),{refs:n,onScroll:p}}function ua(t){let[e,n]=M.useState(null),r=t?.join(":")||"";return M.useEffect(()=>{n(null)},[r]),{lastSelectionChangeIndex:e,setLastSelectionChangeIndex:n}}function da(t,e){let n=()=>{e(t.map(s=>s.matches))},r=t.map(s=>{try{return s.addEventListener("change",n),()=>s.removeEventListener("change",n)}catch{return s.addListener(n),()=>s.removeListener(n)}});return()=>{r.forEach(s=>s())}}function ha(t,e){return e||(typeof window<"u"&&"matchMedia"in window?t.map(n=>window.matchMedia(n).matches):t.map(()=>!1))}function fa(t,e,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){let[r,s]=M.useState(n?e:ha(t,e)),l=M.useRef(null);return M.useEffect(()=>{if("matchMedia"in window)return l.current=t.map(i=>window.matchMedia(i)),s(l.current.map(i=>i.matches)),da(l.current,i=>{s(i)})},[t]),r}function ma(t){let e=u.useMantineTheme(),n=M.useMemo(()=>t.map(s=>(typeof s=="function"?s(e):s)??""),[t,e]),r=M.useMemo(()=>t.map(()=>!0),[t]);return fa(n,r)}function ln(t){let e=u.useMantineTheme(),n=typeof t=="function"?t(e):t;return De.useMediaQuery(n||"",!0)}function Ln(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 pa(t,e,n){return t.filter(r=>!e.map(n).includes(n(r)))}function Nn(t,e){return t.filter((n,r,s)=>r===s.findIndex(l=>e(n)===e(l)))}function Kr(t,e){return e?e.match(/([^[.\]])+/g).reduce((n,r)=>n&&n[r],t):void 0}function ke(t,e){return typeof e=="string"?Kr(t,e):e(t)}function Jr(t){return!t||t.length===0?0:Math.max(...t.map(e=>e.groups&&e.groups.length>0?1+Jr(e.groups):1))}function An(t){let e=[];for(let n of t)n.columns&&n.columns.length>0?e.push(...n.columns.filter(r=>r!=null)):n.groups&&n.groups.length>0&&e.push(...An(n.groups));return e.filter(n=>n!=null)}function Rn(t,e){return t.columns&&t.columns.length>0?t.columns.filter((n,r)=>n.hidden?!1:e?e[r]!==!1:!0).length:t.groups&&t.groups.length>0?t.groups.reduce((n,r)=>n+Rn(r,e),0):0}function Zr(t,e,n=0){if(n===e)return[...t];let r=[];for(let s of t)s.groups&&s.groups.length>0&&r.push(...Zr(s.groups,e,n+1));return r}function ga(t,e,n){return n?!t||e:!1}function ba({rowExpansion:t,records:e,idAccessor:n}){let r=[];if(t&&e){let{trigger:a,allowMultiple:c,initiallyExpanded:h}=t;e&&a==="always"?r=e.map(f=>ke(f,n)):h&&(r=e.filter((f,g)=>h({record:f,index:g})).map(f=>ke(f,n)),c||(r=[r[0]]))}let s,l,i=M.useState(r);if(t){let{expandable:a,trigger:c,allowMultiple:h,collapseProps:f,content:g}=t;t.expanded?{recordIds:s,onRecordIdsChange:l}=t.expanded:[s,l]=i;let m=p=>l?.(s.filter(y=>y!==ke(p,n)));return{expandOnClick:c!=="always"&&c!=="never",isRowExpanded:p=>c==="always"?!0:s.includes(ke(p,n)),isExpandable:({record:p,index:y})=>a?a({record:p,index:y}):!0,expandRow:p=>{let y=ke(p,n);l?.(h?[...s,y]:[y])},collapseRow:m,collapseProps:f,content:({record:p,index:y})=>()=>g({record:p,index:y,collapse:()=>m(p)})}}}function ya(t,e){let[n,r]=M.useState(t),[s,l]=M.useState(t),i=De.useTimeout(()=>r(!0),0),a=De.useTimeout(()=>l(!1),e||200);return M.useEffect(()=>{t?(a.clear(),l(!0),i.start()):(i.clear(),r(!1),a.start())},[i,a,t]),{expanded:n,visible:s}}var $n="mantine-datatable-nowrap",Yn="mantine-datatable-ellipsis",Pt="mantine-datatable-pointer-cursor",Xr="mantine-datatable-context-menu-cursor",va="mantine-datatable-text-selection-disabled",cn="mantine-datatable-text-align-left",un="mantine-datatable-text-align-center",dn="mantine-datatable-text-align-right";function xa({className:t,style:e,visibleMediaQuery:n,title:r,noWrap:s,ellipsis:l,textAlign:i,width:a}){return ln(n)?o.jsx(u.TableTh,{className:de({[$n]:s||l,[Yn]:l,[cn]:i==="left",[un]:i==="center",[dn]:i==="right"},t),style:[{width:a,minWidth:a,maxWidth:a},e],children:r}):null}function Ca({shadowVisible:t}){return o.jsx(u.TableTh,{className:"mantine-datatable-footer-selector-placeholder-cell","data-shadow-visible":t||void 0})}function Sa({className:t,style:e,columns:n,defaultColumnProps:r,selectionVisible:s,selectorCellShadowVisible:l,ref:i}){return o.jsx(u.TableTfoot,{ref:i,className:de("mantine-datatable-footer",t),style:e,children:o.jsxs(u.TableTr,{children:[s&&o.jsx(Ca,{shadowVisible:l}),n.map(({hidden:a,...c})=>{if(a)return null;let{accessor:h,visibleMediaQuery:f,textAlign:g,width:m,footer:p,footerClassName:y,footerStyle:k,noWrap:A,ellipsis:I}={...r,...c};return o.jsx(xa,{className:y,style:k,visibleMediaQuery:f,textAlign:g,width:m,title:p,noWrap:A,ellipsis:I},h)})]})})}function wa({group:{id:t,columns:e,groups:n,title:r,textAlign:s,className:l,style:i},maxDepth:a,currentDepth:c,previousGroups:h,isLastGroup:f,withColumnBorders:g=!1,totalTableColumns:m}){let p=M.useMemo(()=>e&&e.length>0?e:n&&n.length>0?An([{id:t,columns:e,groups:n}]):[],[e,n,t]),y=M.useMemo(()=>p.map(({visibleMediaQuery:Y})=>Y),[p]),k=ma(y),A=M.useMemo(()=>Rn({columns:e,groups:n},k),[t,e,n,k]),I=M.useMemo(()=>h.reduce((Y,$)=>Y+Rn($,k),0),[h,k]),F=n&&n.length>0?1:a-c,z=I+A<m,R=ga(f,z,g);return A>0?o.jsx(u.TableTh,{colSpan:A,rowSpan:F>1?F:void 0,className:de("mantine-datatable-column-group-header-cell",{[cn]:s==="left",[un]:s==="center",[dn]:s==="right","mantine-datatable-column-group-header-cell--needs-border":R},l),style:i,children:r??Ln(t)}):null}function Da(){return o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),o.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 ka(){return o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),o.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 _a({children:t,isActive:e,filterPopoverProps:n,filterPopoverDisableClickOutside:r}){let[s,{close:l,toggle:i}]=De.useDisclosure(!1),a=e?ka:Da,c=De.useClickOutside(l);return r&&(c=void 0),o.jsxs(u.Popover,{withArrow:!0,shadow:"md",opened:s,onClose:l,trapFocus:!0,...n,children:[o.jsx(u.PopoverTarget,{children:o.jsx(u.ActionIcon,{className:"mantine-datatable-header-cell-filter-action-icon","data-active":e||void 0,size:"sm",variant:"default",onClick:h=>{h.preventDefault(),i()},onKeyDown:h=>h.stopPropagation(),children:o.jsx(a,{})})}),o.jsx(u.PopoverDropdown,{ref:c,onClick:h=>h.stopPropagation(),onKeyDown:h=>h.stopPropagation(),children:typeof t=="function"?t({close:l}):t})]})}var ja=t=>{let{accessor:e,columnRef:n}=t,[r,s]=M.useState(!1),l=M.useRef(0),i=M.useRef({current:0,next:0}),{dir:a}=u.useDirection(),c=a==="rtl",{setMultipleColumnWidths:h}=Tn(),f=M.useCallback(m=>{if(m.preventDefault(),m.stopPropagation(),!n.current)return;let p=n.current,y=p.nextElementSibling;for(;y;){let Y=y.getAttribute("data-accessor");if(Y&&Y!=="__selection__")break;y=y.nextElementSibling}if(!y)return;let k=y.getAttribute("data-accessor");if(!k)return;let A=k==="__selection__";s(!0),l.current=m.clientX;let I=p.offsetWidth,F=y.offsetWidth;i.current={current:I,next:F};let z=Y=>{if(!n.current)return;let $=n.current,O=$.nextElementSibling;if(!O)return;let L=Y.clientX-l.current;c&&(L=-L);let _=50,j=i.current.current-_,N=i.current.next-_,W=Math.max(-j,Math.min(L,N)),E=i.current.current+W,D=i.current.next-W;$.style.width=`${E}px`,O.style.width=`${D}px`,$.style.minWidth=`${E}px`,$.style.maxWidth=`${E}px`,O.style.minWidth=`${D}px`,O.style.maxWidth=`${D}px`},R=()=>{if(!n.current)return;let Y=n.current,$=Y.nextElementSibling;s(!1),document.body.style.cursor="initial",document.body.style.userSelect="initial";let O=parseInt(Y.style.width)||Y.offsetWidth,L=$?parseInt($.style.width)||$.offsetWidth:0,_=[{accessor:e,width:`${O}px`}];if($&&!A){let j=$.getAttribute("data-accessor");j&&_.push({accessor:j,width:`${L}px`})}setTimeout(()=>{h(_)},0),document.removeEventListener("mousemove",z),document.removeEventListener("mouseup",R)};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",z),document.addEventListener("mouseup",R)},[e,n,c,h]),g=M.useCallback(()=>{if(!n.current)return;let m=n.current,p=m.nextElementSibling;m.style.width="",m.style.minWidth="",m.style.maxWidth="";let y=[{accessor:e,width:"auto"}];if(p){p.style.width="",p.style.minWidth="",p.style.maxWidth="";let k=p.getAttribute("data-accessor");k&&k!=="__selection__"&&y.push({accessor:k,width:"auto"})}setTimeout(()=>{h(y)},0)},[e,n,h]);return o.jsx("div",{className:"mantine-datatable-header-resizable-handle",style:{cursor:r?"col-resize":void 0},onMouseDown:f,onDoubleClick:g,onClick:m=>m.stopPropagation(),title:"Drag to resize column, double-click to reset"})};function Pa(){return o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),o.jsx("path",{d:"M12 5l0 14"}),o.jsx("path",{d:"M16 9l-4 -4"}),o.jsx("path",{d:"M8 9l4 -4"})]})}function Ma(){return o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),o.jsx("path",{d:"M8 7l4 -4l4 4"}),o.jsx("path",{d:"M8 17l4 4l4 -4"}),o.jsx("path",{d:"M12 3l0 18"})]})}function Ta(){return o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),o.jsx("path",{d:"M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),o.jsx("path",{d:"M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),o.jsx("path",{d:"M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),o.jsx("path",{d:"M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),o.jsx("path",{d:"M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),o.jsx("path",{d:"M15 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"})]})}function Oa(){return o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),o.jsx("path",{d:"M18 6l-12 12"}),o.jsx("path",{d:"M6 6l12 12"})]})}function Ea({className:t,style:e,accessor:n,visibleMediaQuery:r,title:s,sortable:l,draggable:i,toggleable:a,resizable:c,sortIcons:h,textAlign:f,width:g,sortStatus:m,onSortStatusChange:p,filter:y,filterPopoverProps:k,filterPopoverDisableClickOutside:A,filtering:I,sortKey:F}){let{setSourceColumn:z,setTargetColumn:R,swapColumns:Y,setColumnsToggle:$}=Tn(),[O,L]=M.useState(!1),_=M.useRef(null);if(!ln(r))return null;let j=s??Ln(n),N=typeof j=="string"?j:void 0,W=l&&p?C=>{C?.defaultPrevented||p({sortKey:F,columnAccessor:n,direction:m?.columnAccessor===n?m.direction==="asc"?"desc":"asc":m?.direction??"asc"})}:void 0,E=C=>{C.stopPropagation(),z(n),L(!1)},D=C=>{C.preventDefault(),R(n),L(!0)},b=()=>{R(n),L(!1),Y()},v=()=>{L(!0)},P=()=>{L(!1)},x=C=>{C.stopPropagation(),$(T=>T.map(d=>d.accessor===n?{...d,toggled:!1}:d))};return o.jsxs(u.TableTh,{"data-accessor":n,className:de({"mantine-datatable-header-cell-sortable":l,"mantine-datatable-header-cell-toggleable":a,"mantine-datatable-header-cell-resizable":c},t),style:[{width:g,...c?{}:{minWidth:g,maxWidth:g}},e],role:l?"button":void 0,tabIndex:l?0:void 0,onClick:W,onKeyDown:C=>C.key==="Enter"&&W?.(),ref:_,children:[o.jsxs(u.Group,{className:"mantine-datatable-header-cell-sortable-group",justify:"space-between",wrap:"nowrap",children:[o.jsxs(u.Flex,{align:"center",w:"100%",className:de({"mantine-datatable-header-cell-draggable":i,"mantine-datatable-header-cell-drag-over":O}),draggable:i,onDragStart:i?E:void 0,onDragEnter:i?v:void 0,onDragOver:i?D:void 0,onDrop:i?b:void 0,onDragLeave:i?P:void 0,children:[i?o.jsx(u.Center,{role:"img","aria-label":"Drag column",children:o.jsx(u.ActionIcon,{className:"mantine-datatable-header-cell-draggable-action-icon",variant:"subtle",size:"xs",onClick:C=>{C.stopPropagation()},children:o.jsx(Ta,{})})}):null,o.jsx(u.Box,{className:de("mantine-datatable-header-cell-sortable-text",{[cn]:f==="left",[un]:f==="center",[dn]:f==="right"},$n,Yn),title:N,children:j})]}),a?o.jsx(u.Center,{className:"mantine-datatable-header-cell-toggleable-icon",role:"img","aria-label":"Toggle column",children:o.jsx(u.ActionIcon,{size:"xs",variant:"light",onClick:x,children:o.jsx(Oa,{})})}):null,l||m?.columnAccessor===n?o.jsx(o.Fragment,{children:m?.columnAccessor===n?o.jsx(u.Center,{className:de("mantine-datatable-header-cell-sortable-icon",{"mantine-datatable-header-cell-sortable-icon-reversed":m.direction==="desc"}),role:"img","aria-label":`Sorted ${m.direction==="desc"?"descending":"ascending"}`,children:h?.sorted||o.jsx(Pa,{})}):o.jsx(u.Center,{className:"mantine-datatable-header-cell-sortable-unsorted-icon",role:"img","aria-label":"Not sorted",children:h?.unsorted||o.jsx(Ma,{})})}):null,y?o.jsx(_a,{filterPopoverProps:k,isActive:!!I,filterPopoverDisableClickOutside:A,children:y}):null]}),c&&n!=="__selection__"?o.jsx(ja,{accessor:n,columnRef:_}):null]})}function La({className:t,style:e,trigger:n,shadowVisible:r,checked:s,indeterminate:l,checkboxProps:i,onChange:a,rowSpan:c,ref:h}){let f=!i.disabled;return o.jsx(u.TableTh,{ref:h,className:de("mantine-datatable-header-selector-cell",{[Pt]:n==="cell"&&f},t),style:e,rowSpan:c,"data-shadow-visible":r||void 0,"data-accessor":"__selection__",onClick:n==="cell"&&f?a:void 0,children:o.jsx(u.Checkbox,{classNames:f?{input:Pt}:void 0,checked:s,indeterminate:l,onChange:a,...i,disabled:!(a||i.onChange)||i.disabled})})}function Na({selectionColumnHeaderRef:t,className:e,style:n,sortStatus:r,sortIcons:s,onSortStatusChange:l,columns:i,defaultColumnProps:a,groups:c,selectionTrigger:h,selectionVisible:f,selectionChecked:g,selectionIndeterminate:m,onSelectionChange:p,selectionCheckboxProps:y,selectorCellShadowVisible:k,selectionColumnClassName:A,selectionColumnStyle:I,withColumnBorders:F=!1,ref:z}){let R=c?Jr(c):0,Y=R>0?R+1:1,$=f?o.jsx(La,{ref:t,className:A,style:I,trigger:h,shadowVisible:k,checked:g,indeterminate:m,checkboxProps:y,onChange:p,rowSpan:c?Y:void 0}):null,{columnsToggle:O,setColumnsToggle:L}=Tn(),[_,j]=M.useState(!1),N=i.some(D=>D.toggleable),W=N?Object.fromEntries(i.map(({accessor:D,title:b})=>[D,b??Ln(String(D))])):void 0,E=o.jsxs(u.TableThead,{className:de("mantine-datatable-header",e),style:n,ref:z,onContextMenu:N?D=>{D.preventDefault(),j(b=>!b)}:void 0,children:[c&&Array.from({length:R},(D,b)=>{let v=Zr(c,b);return o.jsxs(u.TableTr,{children:[b===0&&$,v.map((P,x)=>o.jsx(wa,{group:P,maxDepth:R,currentDepth:b,previousGroups:v.slice(0,x),isLastGroup:x===v.length-1,withColumnBorders:F,totalTableColumns:i.length},P.id))]},`group-depth-${b}`)}),o.jsxs(u.TableTr,{children:[!c&&$,i.map(({hidden:D,...b},v)=>{if(D)return null;let{accessor:P,visibleMediaQuery:x,textAlign:C,width:T,title:d,sortable:w,draggable:S,toggleable:B,resizable:H,titleClassName:Q,titleStyle:U,filter:G,filterPopoverProps:K,filterPopoverDisableClickOutside:q,filtering:te,sortKey:X}={...a,...b};return o.jsx(Ea,{accessor:P,className:Q,style:U,visibleMediaQuery:x,textAlign:C,width:T,title:d,sortable:w,draggable:S,toggleable:B,resizable:H&&v<i.length-1,sortStatus:r,sortIcons:s,sortKey:X,onSortStatusChange:l,filter:G,filterPopoverProps:K,filterPopoverDisableClickOutside:q,filtering:te},P)})]})]});return N?o.jsxs(u.Popover,{position:"bottom",withArrow:!0,shadow:"md",opened:_,onChange:j,children:[o.jsx(u.PopoverTarget,{children:E}),o.jsx(u.PopoverDropdown,{children:o.jsx(u.Stack,{children:O.filter(D=>D.toggleable).map(D=>o.jsx(u.Group,{children:o.jsx(u.Checkbox,{classNames:{label:"mantine-datatable-header-column-toggle-checkbox-label"},size:"xs",label:W[D.accessor],checked:D.toggled,onChange:b=>{L(O.map(v=>v.accessor===D.accessor?{...v,toggled:b.currentTarget.checked}:v))}})},D.accessor))})})]}):E}function Aa({fetching:t,customContent:e,backgroundBlur:n,size:r,type:s,color:l}){return o.jsx(u.Center,{className:de("mantine-datatable-loader",{"mantine-datatable-loader-fetching":t}),style:[{backdropFilter:n?`blur(${n}px)`:void 0}],children:t&&(e||o.jsx(u.Loader,{size:r,type:s,color:l}))})}function me(t,e,n){return t?u.parseThemeColor({color:typeof t=="object"?t[n]:t,theme:e}).value:void 0}function Ra({theme:t,c:e,backgroundColor:n,borderColor:r,rowBorderColor:s,stripedColor:l,highlightOnHoverColor:i}){return{"--mantine-datatable-color-light":me(e,t,"light"),"--mantine-datatable-color-dark":me(e,t,"dark"),"--mantine-datatable-background-color-light":me(n,t,"light"),"--mantine-datatable-background-color-dark":me(n,t,"dark"),"--mantine-datatable-border-color-light":me(r,t,"light"),"--mantine-datatable-border-color-dark":me(r,t,"dark"),"--mantine-datatable-row-border-color-light":me(s,t,"light"),"--mantine-datatable-row-border-color-dark":me(s,t,"dark"),"--mantine-datatable-striped-color-light":me(l,t,"light"),"--mantine-datatable-striped-color-dark":me(l,t,"dark"),"--mantine-datatable-highlight-on-hover-color-light":me(i,t,"light"),"--mantine-datatable-highlight-on-hover-color-dark":me(i,t,"dark")}}function es({theme:t,paginationActiveTextColor:e,paginationActiveBackgroundColor:n}){return{"--mantine-datatable-pagination-active-text-color-light":me(e,t,"light"),"--mantine-datatable-pagination-active-text-color-dark":me(e,t,"dark"),"--mantine-datatable-pagination-active-background-color-light":me(n,t,"light"),"--mantine-datatable-pagination-active-background-color-dark":me(n,t,"dark")}}function $a({theme:t,color:e,backgroundColor:n}){return{"--mantine-datatable-row-color-light":me(e,t,"light"),"--mantine-datatable-row-color-dark":me(e,t,"dark"),"--mantine-datatable-row-background-color-light":me(n,t,"light"),"--mantine-datatable-row-background-color-dark":me(n,t,"dark")}}function Ya(){return o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),o.jsx("path",{d:"M8 9l4 -4l4 4"}),o.jsx("path",{d:"M16 15l-4 4l-4 -4"})]})}var ts={xs:u.rem(22),sm:u.rem(26),md:u.rem(32),lg:u.rem(38),xl:u.rem(44)};function Ia({size:t,label:e,values:n,value:r,activeTextColor:s,activeBackgroundColor:l,onChange:i}){return o.jsxs(u.Group,{gap:"xs",children:[o.jsx(u.Text,{component:"div",size:t,children:e}),o.jsxs(u.Menu,{withinPortal:!0,withArrow:!0,offset:2,classNames:{arrow:"mantine-datatable-page-size-selector-menu-arrow"},children:[o.jsx(u.MenuTarget,{children:o.jsx(u.Button,{size:t,variant:"default",classNames:{section:"mantine-datatable-page-size-selector-button-icon"},rightSection:o.jsx(Ya,{}),style:[{fontWeight:"normal"},a=>({height:ts[t],paddingLeft:a.spacing[t],paddingRight:a.spacing[t]})],children:r})}),o.jsx(u.MenuDropdown,{children:n.map(a=>{let c=a===r;return o.jsx(u.MenuItem,{className:de({"mantine-datatable-page-size-selector-active":c}),style:[{height:ts[t]},c&&(s||l)?h=>es({theme:h,paginationActiveTextColor:s,paginationActiveBackgroundColor:l}):void 0],disabled:c,onClick:()=>i(a),children:o.jsx(u.Text,{component:"div",size:t,children:a})},a)})})]})]})}function Fa({className:t,style:e,fetching:n,page:r,onPageChange:s,paginationWithEdges:l,paginationWithControls:i,paginationActiveTextColor:a,paginationActiveBackgroundColor:c,paginationSize:h,loadingText:f,noRecordsText:g,paginationText:m,totalRecords:p,recordsPerPage:y,onRecordsPerPageChange:k,recordsPerPageLabel:A,recordsPerPageOptions:I,recordsLength:F,horizontalSpacing:z,paginationWrapBreakpoint:R,getPaginationControlProps:Y,getPaginationItemProps:$,renderPagination:O}){let L;if(p){let b=(r-1)*y+1,v=b+(F||0)-1;L=m({from:b,to:v,totalRecords:p})}else L=n?f:g;let _=p&&y?Math.max(1,Math.ceil(p/y)):1,j=p?(r-1)*(y??0)+1:void 0,N=p?(j??1)+(F??0)-1:void 0,W=!ln(({breakpoints:b})=>`(min-width: ${typeof R=="number"?`${u.rem(R)}rem`:b[R]||R})`),E={Text:b=>o.jsx(u.Text,{component:"div",className:"mantine-datatable-pagination-text",size:h,...b,children:L}),PageSizeSelector:b=>I?o.jsx(Ia,{activeTextColor:a,activeBackgroundColor:c,size:h,label:A,values:I,value:y,onChange:k,...b}):o.jsx(o.Fragment,{}),Pagination:b=>o.jsx(u.Pagination,{classNames:{root:de("mantine-datatable-pagination-pages",{"mantine-datatable-pagination-pages-fetching":n||!F}),control:"mantine-datatable-pagination-pages-control"},style:a||c?v=>es({theme:v,paginationActiveTextColor:a,paginationActiveBackgroundColor:c}):void 0,withEdges:l,withControls:i,value:r,onChange:s,size:h,total:_,getControlProps:Y,getItemProps:$,...b})},D={state:{paginationSize:h,page:r,totalPages:_,totalRecords:p,recordsPerPage:y,recordsLength:F,fetching:n,from:j,to:N,isWrapped:W},actions:{setPage:b=>s?.(b),setRecordsPerPage:k?b=>k(b):void 0},Controls:E};return o.jsx(u.Box,{px:z??"xs",py:"xs",className:de("mantine-datatable-pagination",t),style:[{flexDirection:W?"column":"row"},e],children:typeof O=="function"?O(D):o.jsxs(o.Fragment,{children:[o.jsx(E.Text,{}),o.jsx(E.PageSizeSelector,{}),o.jsx(E.Pagination,{})]})})}function Wa({className:t,style:e,visibleMediaQuery:n,record:r,index:s,onClick:l,onDoubleClick:i,onContextMenu:a,noWrap:c,ellipsis:h,textAlign:f,width:g,accessor:m,render:p,defaultRender:y,customCellAttributes:k}){return ln(n)?o.jsx(u.TableTd,{className:de({[$n]:c||h,[Yn]:h,[Pt]:l||i,[Xr]:a,[cn]:f==="left",[un]:f==="center",[dn]:f==="right"},t),style:[{width:g,minWidth:g,maxWidth:g},e],onClick:l,onDoubleClick:i,onContextMenu:a,...k?.(r,s),children:p?p(r,s):y?y(r,s,m):Kr(r,m)}):null}function za({open:t,colSpan:e,content:n,collapseProps:r}){let{expanded:s,visible:l}=ya(t,r?.transitionDuration);return l?o.jsxs(o.Fragment,{children:[o.jsx(u.TableTr,{}),o.jsx(u.TableTr,{children:o.jsx(u.TableTd,{className:"mantine-datatable-row-expansion-cell",colSpan:e,children:o.jsx(u.Collapse,{in:s,...r,children:o.jsx("div",{className:"mantine-datatable-row-expansion-cell-content",children:n()})})})})]}):null}function Ba({className:t,style:e,record:n,index:r,trigger:s,onChange:l,withRightShadow:i,checkboxProps:a,getCheckboxProps:c,...h}){let f={...a,...c(n,r)},g=!h.disabled&&!f.disabled,m=p=>{p.stopPropagation(),s==="cell"&&g&&l?.(p)};return o.jsx(u.TableTd,{className:de("mantine-datatable-row-selector-cell",{[Pt]:s==="cell"&&g},t),style:e,"data-shadow-visible":i||void 0,onClick:m,children:o.jsx(u.Checkbox,{classNames:g?{input:Pt}:void 0,onChange:l,...h,...f})})}function Va({record:t,index:e,columns:n,defaultColumnProps:r,defaultColumnRender:s,selectionTrigger:l,selectionVisible:i,selectionChecked:a,onSelectionChange:c,isRecordSelectable:h,selectionCheckboxProps:f,getSelectionCheckboxProps:g,onClick:m,onDoubleClick:p,onContextMenu:y,onCellClick:k,onCellDoubleClick:A,onCellContextMenu:I,expansion:F,customAttributes:z,color:R,backgroundColor:Y,className:$,style:O,selectorCellShadowVisible:L,selectionColumnClassName:_,selectionColumnStyle:j,rowFactory:N}){let W=o.jsxs(o.Fragment,{children:[i&&o.jsx(Ba,{className:_,style:j,record:t,index:e,trigger:l,withRightShadow:L,checked:a,disabled:!c||(h?!h(t,e):!1),onChange:c,checkboxProps:f,getCheckboxProps:g}),n.map(({hidden:b,hiddenContent:v,...P},x)=>{if(b||v)return null;let{accessor:C,visibleMediaQuery:T,textAlign:d,noWrap:w,ellipsis:S,width:B,render:H,cellsClassName:Q,cellsStyle:U,customCellAttributes:G}={...r,...P};return o.jsx(Wa,{className:typeof Q=="function"?Q(t,e):Q,style:U?.(t,e),visibleMediaQuery:T,record:t,index:e,onClick:k?K=>k({event:K,record:t,index:e,column:P,columnIndex:x}):void 0,onDoubleClick:A?K=>A({event:K,record:t,index:e,column:P,columnIndex:x}):void 0,onContextMenu:I?K=>I({event:K,record:t,index:e,column:P,columnIndex:x}):void 0,accessor:C,textAlign:d,noWrap:w,ellipsis:S,width:B,render:H,defaultRender:s,customCellAttributes:G},C)})]}),E=F&&o.jsx(za,{colSpan:n.filter(({hidden:b})=>!b).length+(i?1:0),open:F.isRowExpanded(t),content:F.content({record:t,index:e}),collapseProps:F.collapseProps}),D=Ha({record:t,index:e,selectionChecked:a,onClick:m,onDoubleClick:p,onContextMenu:y,expansion:F,customAttributes:z,color:R,backgroundColor:Y,className:$,style:O});return N?N({record:t,index:e,rowProps:D,children:W,expandedElement:E}):o.jsxs(o.Fragment,{children:[o.jsx(u.TableTr,{...D,children:W}),E]})}function Ha({record:t,index:e,selectionChecked:n,onClick:r,onDoubleClick:s,onContextMenu:l,expansion:i,customAttributes:a,color:c,backgroundColor:h,className:f,style:g}){return{className:de("mantine-datatable-row",{[Pt]:r||s||i?.isExpandable({record:t,index:e})&&i?.expandOnClick},{[Xr]:l},typeof f=="function"?f(t,e):f),"data-selected":n||void 0,onClick:m=>{if(i){let{isExpandable:p,isRowExpanded:y,expandOnClick:k,expandRow:A,collapseRow:I}=i;p({record:t,index:e})&&k&&(y(t)?I(t):A(t))}r?.({event:m,record:t,index:e})},onDoubleClick:s?m=>s({event:m,record:t,index:e}):void 0,onContextMenu:l?m=>l({event:m,record:t,index:e}):void 0,style:[c||h?m=>{let p=c?.(t,e),y=h?.(t,e);return $a({theme:m,color:p,backgroundColor:y})}:void 0,g?.(t,e)],...a?.(t,e)??{}}}function Ua({leftShadowBehind:t,rightShadowBehind:e,onScrollPositionChange:n,children:r,viewportRef:s,scrollAreaProps:l}){return o.jsxs(u.ScrollArea,{...l,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:n,children:[r,o.jsx(u.Box,{className:de("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-top-shadow")}),o.jsx("div",{className:de("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-left-shadow",{"mantine-datatable-scroll-area-shadow-behind":t})}),o.jsx("div",{className:de("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-right-shadow",{"mantine-datatable-scroll-area-shadow-behind":e})}),o.jsx(u.Box,{className:de("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-bottom-shadow")})]})}function qa({withTableBorder:t,borderRadius:e,textSelectionDisabled:n,height:r="100%",minHeight:s,maxHeight:l,shadow:i,verticalAlign:a="center",fetching:c,columns:h,storeColumnsKey:f,groups:g,pinFirstColumn:m,pinLastColumn:p,defaultColumnProps:y,defaultColumnRender:k,idAccessor:A="id",records:I,selectionTrigger:F="checkbox",selectedRecords:z,onSelectedRecordsChange:R,selectionColumnClassName:Y,selectionColumnStyle:$,isRecordSelectable:O,selectionCheckboxProps:L,allRecordsSelectionCheckboxProps:_={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:j=(Ce,Be)=>({"aria-label":`Select record ${Be+1}`}),sortStatus:N,sortIcons:W,onSortStatusChange:E,horizontalSpacing:D,page:b,onPageChange:v,totalRecords:P,recordsPerPage:x,onRecordsPerPageChange:C,recordsPerPageOptions:T,recordsPerPageLabel:d="Records per page",paginationWithEdges:w,paginationWithControls:S,paginationActiveTextColor:B,paginationActiveBackgroundColor:H,paginationSize:Q="sm",paginationText:U=({from:Ce,to:Be,totalRecords:tt})=>`${Ce} - ${Be} / ${tt}`,paginationWrapBreakpoint:G="sm",getPaginationControlProps:K=Ce=>Ce==="previous"?{"aria-label":"Previous page"}:Ce==="next"?{"aria-label":"Next page"}:{},getPaginationItemProps:q,renderPagination:te,loaderBackgroundBlur:X,customLoader:ne,loaderSize:le,loaderType:he,loaderColor:re,loadingText:_e="...",emptyState:pe,noRecordsText:Te="No records",noRecordsIcon:je,highlightOnHover:nt,striped:Re,noHeader:Je,onRowClick:$e,onRowDoubleClick:Ye,onRowContextMenu:Ze,onCellClick:J,onCellDoubleClick:ge,onCellContextMenu:fe,onScroll:rt,onScrollToTop:ie,onScrollToBottom:Oe,onScrollToLeft:dt,onScrollToRight:ht,c:qe,backgroundColor:Ie,borderColor:xt,rowBorderColor:ve,stripedColor:st,highlightOnHoverColor:Ee,rowColor:ot,rowBackgroundColor:Ct,rowExpansion:xe,rowClassName:St,rowStyle:Pe,customRowAttributes:at,scrollViewportRef:Fe,scrollAreaProps:Xe,tableRef:We,bodyRef:Ge,m:et,my:Z,mx:ce,mt:Le,mb:Qe,ml:ft,mr:mt,className:Mt,classNames:it,style:pt,styles:ze,rowFactory:gt,tableWrapper:bt,...wt}){let Ce=M.useMemo(()=>g?An(g):h,[h,g]),[Be,tt]=M.useState(!1),{refs:ye,onScroll:Tt}=ca({scrollCallbacks:{onScroll:rt,onScrollToTop:ie,onScrollToBottom:Oe,onScrollToLeft:dt,onScrollToRight:ht},withRowBorders:wt.withRowBorders}),ee=la({key:f,columns:Ce,headerRef:ye.header,scrollViewportRef:ye.scrollViewport,onFixedLayoutChange:tt}),se=De.useMergedRef(ye.table,We),Ke=De.useMergedRef(ye.scrollViewport,Fe),Se=ba({rowExpansion:xe,records:I,idAccessor:A}),ue=M.useRef(!1),we=M.useRef(b),yt=M.useRef(I),Ne=M.useCallback(ae=>{ue.current=!0,yt.current=I,v(ae)},[v,I]);M.useEffect(()=>{we.current!==b&&(ue.current=!0,yt.current=I,we.current=b)},[b,I]);let Yt=I?.length;M.useLayoutEffect(()=>{if(!ue.current||c||I===yt.current)return;let ae=ye.scrollViewport.current;if(!ae)return;let Dt=requestAnimationFrame(()=>{ae.scrollTo({top:0,left:0}),ue.current=!1});return()=>cancelAnimationFrame(Dt)},[c,I,ye.scrollViewport]);let ls=I?.map(ae=>ke(ae,A)),Ot=!!z,It=z?.map(ae=>ke(ae,A)),cs=ls!==void 0&&It!==void 0&&It.length>0,Fn=O?I?.filter(O):I,hn=Fn?.map(ae=>ke(ae,A)),fn=cs&&hn.every(ae=>It.includes(ae)),_i=cs&&hn.some(ae=>It.includes(ae)),ji=M.useCallback(()=>{z&&R&&R(fn?z.filter(ae=>!hn.includes(ke(ae,A))):Nn([...z,...Fn],ae=>ke(ae,A)))},[fn,A,R,hn,Fn,z]),{lastSelectionChangeIndex:mn,setLastSelectionChangeIndex:Pi}=ua(ls),Wn=Ot&&!m,Mi={m:et,my:Z,mx:ce,mt:Le,mb:Qe,ml:ft,mr:mt},Ti=M.useCallback(({children:ae})=>bt?bt({children:ae}):ae,[bt]);return o.jsx(Br,{...ee,children:o.jsxs(u.Box,{ref:ye.root,...Mi,className:de("mantine-datatable",{"mantine-datatable-with-border":t},Mt,it?.root),style:[ae=>({...Ra({theme:ae,c:qe,backgroundColor:Ie,borderColor:xt,rowBorderColor:ve,stripedColor:st,highlightOnHoverColor:Ee}),borderRadius:ae.radius[e]||e,boxShadow:ae.shadows[i]||i,height:r,minHeight:s,maxHeight:l}),pt,ze?.root,{position:"relative"}],children:[o.jsx(Ua,{viewportRef:Ke,leftShadowBehind:Ot||!!m,rightShadowBehind:p,onScrollPositionChange:Tt,scrollAreaProps:Xe,children:o.jsx(Ti,{children:o.jsxs(u.Table,{ref:se,horizontalSpacing:D,className:de("mantine-datatable-table",{[va]:n,"mantine-datatable-vertical-align-top":a==="top","mantine-datatable-vertical-align-bottom":a==="bottom","mantine-datatable-pin-last-column":p,"mantine-datatable-selection-column-visible":Ot,"mantine-datatable-pin-first-column":m,"mantine-datatable-resizable-columns":ee.hasResizableColumns&&Be},it?.table),style:{...ze?.table},"data-striped":Yt&&Re||void 0,"data-highlight-on-hover":nt||void 0,...wt,children:[Je?null:o.jsx(Br,{...ee,children:o.jsx(Na,{ref:ye.header,selectionColumnHeaderRef:ye.selectionColumnHeader,className:it?.header,style:ze?.header,columns:Ce,defaultColumnProps:y,groups:g,sortStatus:N,sortIcons:W,onSortStatusChange:E,selectionTrigger:F,selectionVisible:Ot,selectionChecked:fn,selectionIndeterminate:_i&&!fn,onSelectionChange:ji,selectionCheckboxProps:{...L,..._},selectorCellShadowVisible:Wn,selectionColumnClassName:Y,selectionColumnStyle:$,withColumnBorders:wt.withColumnBorders})}),o.jsx("tbody",{ref:Ge,children:Yt?I.map((ae,Dt)=>{let zn=ke(ae,A),Bn=It?.includes(zn)||!1,us;return R&&z&&(us=Oi=>{if(Oi.nativeEvent.shiftKey&&mn!==null){let Et=I.filter(Dt>mn?(kt,_t)=>_t>=mn&&_t<=Dt&&(O?O(kt,_t):!0):(kt,_t)=>_t>=Dt&&_t<=mn&&(O?O(kt,_t):!0));R(Bn?pa(z,Et,kt=>ke(kt,A)):Nn([...z,...Et],kt=>ke(kt,A)))}else R(Bn?z.filter(Et=>ke(Et,A)!==zn):Nn([...z,ae],Et=>ke(Et,A)));Pi(Dt)}),o.jsx(Va,{record:ae,index:Dt,columns:Ce,defaultColumnProps:y,defaultColumnRender:k,selectionTrigger:F,selectionVisible:Ot,selectionChecked:Bn,onSelectionChange:us,isRecordSelectable:O,selectionCheckboxProps:L,getSelectionCheckboxProps:j,onClick:$e,onDoubleClick:Ye,onCellClick:J,onCellDoubleClick:ge,onContextMenu:Ze,onCellContextMenu:fe,expansion:Se,color:ot,backgroundColor:Ct,className:St,style:Pe,customAttributes:at,selectorCellShadowVisible:Wn,selectionColumnClassName:Y,selectionColumnStyle:$,idAccessor:A,rowFactory:gt},zn)}):o.jsx(na,{})}),Ce.some(({footer:ae})=>ae)&&o.jsx(Sa,{ref:ye.footer,className:it?.footer,style:ze?.footer,columns:Ce,defaultColumnProps:y,selectionVisible:Ot,selectorCellShadowVisible:Wn})]})})}),!!(b&&Yt)&&o.jsx(Fa,{className:it?.pagination,style:ze?.pagination,horizontalSpacing:D,fetching:c,page:b,onPageChange:Ne,totalRecords:P,recordsPerPage:x,onRecordsPerPageChange:C,recordsPerPageOptions:T,recordsPerPageLabel:d,paginationWithEdges:w,paginationWithControls:S,paginationActiveTextColor:B,paginationActiveBackgroundColor:H,paginationSize:Q,paginationText:U,paginationWrapBreakpoint:G,getPaginationControlProps:K,getPaginationItemProps:q,noRecordsText:Te,loadingText:_e,recordsLength:Yt,renderPagination:te}),o.jsx(Aa,{fetching:c,backgroundBlur:X,customContent:ne,size:le,type:he,color:re}),o.jsx(sa,{icon:je,text:Te,active:!c&&!Yt,children:pe})]})})}function ns(t){const e=Me.c(42),{fields:n,onClose:r,queryKey:s,apiPath:l,id:i,steps:a}=t,[c,h]=M.useState(0),[f,g]=M.useState(!1),{data:m,isLoading:p}=br(l,s,i),{mutateAsync:y,isError:k,error:A,isPending:I}=wn(l,s);let F;e[0]!==n?(F=new Set(n.filter(Xa).map(Za)),e[0]=n,e[1]=F):F=e[1];let z;e[2]!==F?(z=[...F],e[2]=F,e[3]=z):z=e[3];const R=z;let Y;e[4]!==n?(Y=n.reduce(Ja,{}),e[4]=n,e[5]=Y):Y=e[5];let $;e[6]!==n?($=n.filter(Ka).reduce(Qa,{}),e[6]=n,e[7]=$):$=e[7];let O;e[8]!==Y||e[9]!==$?(O={mode:"uncontrolled",initialValues:Y,validate:$},e[8]=Y,e[9]=$,e[10]=O):O=e[10];const L=Vn.useForm(O);let _;e[11]!==m||e[12]!==n||e[13]!==L?(_=()=>{if(m){const x={...m};n.forEach(C=>{const T=C.id;C.type==="boolean"&&x[T]===null?x[T]=!1:C.type==="date"&&x[T]?x[T]=new Date(x[T]):x[T]===null&&(x[T]="")}),L.initialize(x),L.setValues(x)}},e[11]=m,e[12]=n,e[13]=L,e[14]=_):_=e[14];let j;e[15]!==m?(j=[m],e[15]=m,e[16]=j):j=e[16],M.useEffect(_,j);let N;e[17]===Symbol.for("react.memo_cache_sentinel")?(N=function(C,T){return typeof C.required=="function"?C.required(T??{}):!!C.required},e[17]=N):N=e[17];const W=N;let E;e[18]!==L||e[19]!==i?(E=function(C){const T=L.getValues();if(C.conditional&&!C.conditional(T))return null;const d=W(C,T);return o.jsxs(M.Fragment,{children:[(C.type===void 0||C.type=="text")&&o.jsx(u.TextInput,{label:C.column.title,placeholder:C.placeholder??"",...L.getInputProps(C.id),type:C.id.includes("email")?"email":void 0,required:d},L.key(C.id)),C.type==="number"&&o.jsx(u.NumberInput,{decimalSeparator:",",label:C.column.title,placeholder:C.placeholder??"",...L.getInputProps(C.id),required:d},L.key(C.id)),C.type==="date"&&o.jsx(an,{label:C.column.title,placeholder:C.placeholder??"",valueFormat:"DD.MM.YYYY",clearable:!0,...L.getInputProps(C.id),required:d},L.key(C.id)),C.type==="boolean"&&o.jsx(u.Checkbox,{mt:"md",label:C.column.title,...L.getInputProps(C.id,{type:"checkbox"}),required:d},L.key(C.id)),C.type==="textarea"&&o.jsx(u.Textarea,{label:C.column.title,placeholder:C.placeholder??"",...L.getInputProps(C.id),minRows:3,autosize:!0,required:d},L.key(C.id)),C.type==="custom"&&C.render&&C.render({...L.getValues(),id:i},L.setValues,g,{error:L.getInputProps(C.id).error,required:d})]},C.id)},e[18]=L,e[19]=i,e[20]=E):E=e[20];const D=E;let b;e[21]!==k||e[22]!==A?.message||e[23]!==A?.name?(b=k&&o.jsx(u.Alert,{variant:"outline",color:"red",title:A?.name??"Fehler aufgetreten",mb:"lg",children:A?.message??"Fehler aufgetreten"}),e[21]=k,e[22]=A?.message,e[23]=A?.name,e[24]=b):b=e[24];let v;e[25]!==c||e[26]!==n||e[27]!==L||e[28]!==f||e[29]!==i||e[30]!==p||e[31]!==I||e[32]!==k||e[33]!==r||e[34]!==D||e[35]!==a||e[36]!==R||e[37]!==y?(v=p?o.jsxs(u.Stack,{gap:"md",children:[o.jsx(u.Skeleton,{height:40}),Array(n.length).fill(0).map(Ga),o.jsxs(u.Group,{mt:"md",justify:"end",children:[o.jsx(u.Skeleton,{width:100,height:36}),o.jsx(u.Skeleton,{width:100,height:36})]})]}):o.jsxs("form",{onSubmit:L.onSubmit(async x=>{await y({...x,id:i}),R.length&&c<R.length-1?k||h(c+1):k||(L.setInitialValues(x),L.reset(),r())}),children:[R.length?o.jsx(u.Stepper,{active:c,size:"sm",children:R.map(x=>o.jsx(u.Stepper.Step,{...a&&a[x-1]?{label:a[x-1].label}:{},children:n.filter(C=>C.step===x).map(C=>D(C))},x))}):n.map(x=>D(x)),!f&&o.jsxs(u.Group,{mt:"md",justify:"end",children:[o.jsx(u.Button,{onClick:()=>R.length?c===0?r():h(c-1):r(),variant:"outline",children:R.length?c===0?"Abbrechen":"Zurück":"Abbrechen"}),o.jsx(u.Button,{type:"submit",loading:I,children:R.length?c===R.length-1?"Speichern":"Weiter":"Speichern"})]})]}),e[25]=c,e[26]=n,e[27]=L,e[28]=f,e[29]=i,e[30]=p,e[31]=I,e[32]=k,e[33]=r,e[34]=D,e[35]=a,e[36]=R,e[37]=y,e[38]=v):v=e[38];let P;return e[39]!==b||e[40]!==v?(P=o.jsxs(o.Fragment,{children:[b,v]}),e[39]=b,e[40]=v,e[41]=P):P=e[41],P}function Ga(t,e){return o.jsx(u.Skeleton,{height:35},`skeleton-field-${e}`)}function Qa(t,e){return t[e.id]=(n,r)=>e.conditional&&!e.conditional(r)||!(typeof e.required=="function"?e.required(r):!!e.required)||n?null:"Pflichtfeld",t}function Ka(t){return t.required}function Ja(t,e){return t[e.id]=e.type==="boolean"?e.defaultValue??!1:e.defaultValue??"",t}function Za(t){return t.step}function Xa(t){return typeof t.step=="number"}function rs({queryKey:t,apiPath:e,onClose:n,selectedRecords:r}){const{mutateAsync:s,isError:l,error:i,isPending:a}=xr(e,t),[c,h]=M.useState(r),[f,g]=M.useState(!1),m=f||a;return M.useEffect(()=>{c.length||n()},[n,c]),c.length?o.jsxs(o.Fragment,{children:[l&&i.message&&o.jsx(u.Alert,{variant:"outline",color:"red",title:i.name,children:i.message}),o.jsx(u.Text,{children:c.length===1?`Soll ${c.length} Eintrag wirklich gelöscht werden?`:`Sollen ${c.length} Einträge wirklich gelöscht werden?`}),o.jsxs(u.Group,{mt:"md",justify:"end",children:[o.jsx(u.Button,{onClick:n,variant:"outline",disabled:m,children:"Abbrechen"}),o.jsx(u.Button,{color:"red",loading:m,onClick:async()=>{g(!0);try{await Promise.all(c.map(p=>s(p.id))),h([])}finally{g(!1)}},children:"Löschen"})]})]}):o.jsx(o.Fragment,{})}function ss(t,e){const n=Me.c(8);let r;n[0]!==t||n[1]!==e?(r=()=>{const h=localStorage.getItem(`use_persistent_storage_${e}`);return h?JSON.parse(h):t},n[0]=t,n[1]=e,n[2]=r):r=n[2];const[s,l]=M.useState(r);let i;n[3]!==e?(i=h=>{l(h),localStorage.setItem(`use_persistent_storage_${e}`,JSON.stringify(h))},n[3]=e,n[4]=i):i=n[4];const a=i;let c;return n[5]!==a||n[6]!==s?(c=[s,a],n[5]=a,n[6]=s,n[7]=c):c=n[7],c}const ei=[/^\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}$/],ti=(t,e)=>{const n=t.map(i=>i[e]).filter(i=>i!=null&&i!=="");if(n.length===0)return"string";const r=n.slice(0,100),s={string:0,number:0,date:0};r.forEach(i=>{if(typeof i=="number")s.number++;else if(typeof i=="string"){const a=i.trim();if(a!==""&&!isNaN(Number(a))&&!isNaN(parseFloat(a))){s.number++;return}if(ei.some(c=>c.test(a))){const c=new Date(a);if(!isNaN(c.getTime())){s.date++;return}}s.string++}else i instanceof Date?s.date++:s.string++});const l=s.string+s.number+s.date;return s.date/l>=.6?"date":s.number/l>=.6?"number":s.string/l>=.6?"string":"mixed"};function os(t,e){switch(e){case"date":if(typeof t=="string"){const r=new Date(t.trim());return isNaN(r.getTime())?null:r.getTime()}return t instanceof Date?t.getTime():null;case"number":if(typeof t=="number")return t;const n=parseFloat(String(t).trim());return isNaN(n)?null:n;case"string":return(typeof t=="string"?t:String(t)).toLowerCase().trim();default:return String(t).toLowerCase().trim()}}const as=(t,e,n="asc")=>{if(!t||t.length===0)return[];const r=ti(t,e);return[...t].sort((s,l)=>{const i=s[e],a=l[e],c=i==null||i==="",h=a==null||a==="";if(c&&h)return 0;if(c)return n==="asc"?-1:1;if(h)return n==="asc"?1:-1;const f=os(i,r),g=os(a,r);return f===null&&g===null?0:f===null?n==="asc"?1:-1:g===null||f<g?n==="asc"?-1:1:f>g?n==="asc"?1:-1:0})};function ni(t,e){return e.split(".").reduce((n,r)=>{if(n&&typeof n=="object"&&r in n)return n[r]},t)}function ri(t,e){const n=e.column;if(n.render)return n.render(t,0);const r=n.accessor??e.id,s=ni(t,r);return s==null?o.jsx(u.Text,{c:"dimmed",children:"–"}):typeof s=="boolean"?o.jsx(u.Text,{fz:"sm",children:s?"Ja":"Nein"}):o.jsx(u.Text,{fz:"sm",children:String(s)})}function si(t){const e=Me.c(10),{field:n,record:r}=t,s=n.column.title??n.id;let l;e[0]!==s?(l=o.jsx(u.Text,{fw:700,fz:"sm",children:s}),e[0]=s,e[1]=l):l=e[1];let i;e[2]!==n||e[3]!==r?(i=ri(r,n),e[2]=n,e[3]=r,e[4]=i):i=e[4];let a;e[5]!==i?(a=o.jsx(u.Box,{ta:"right",fz:"sm",children:i}),e[5]=i,e[6]=a):a=e[6];let c;return e[7]!==l||e[8]!==a?(c=o.jsxs(u.Group,{wrap:"nowrap",justify:"space-between",align:"center",py:"xs",px:"sm",children:[l,a]}),e[7]=l,e[8]=a,e[9]=c):c=e[9],c}function is(t){const e=Me.c(42),{records:n,fields:r,selection:s,selectedRecords:l,onSelectedRecordsChange:i,onRowClick:a,actions:c,canUpdate:h,canDelete:f,pagination:g,sort:m,rowExpansion:p}=t;let y;e[0]!==l?(y=l===void 0?[]:l,e[0]=l,e[1]=y):y=e[1];const k=y;let A;e[2]===Symbol.for("react.memo_cache_sentinel")?(A=new Set,e[2]=A):A=e[2];const[I,F]=M.useState(A);let z;e[3]===Symbol.for("react.memo_cache_sentinel")?(z=E=>{F(D=>{const b=new Set(D);return b.has(E)?b.delete(E):b.add(E),b})},e[3]=z):z=e[3];const R=z;let Y,$,O,L,_,j;if(e[4]!==c||e[5]!==f||e[6]!==h||e[7]!==I||e[8]!==r||e[9]!==a||e[10]!==i||e[11]!==n||e[12]!==p||e[13]!==k||e[14]!==s||e[15]!==m){j=Symbol.for("react.early_return_sentinel");e:{const E=r.filter(ui),D=E.filter(ci).reduce(li,[]);let b;e[22]!==k?(b=d=>k.some(w=>w.id===d.id),e[22]=k,e[23]=b):b=e[23];const v=b;let P;e[24]!==v||e[25]!==i||e[26]!==k?(P=d=>{i&&(v(d)?i(k.filter(w=>w.id!==d.id)):i([...k,d]))},e[24]=v,e[25]=i,e[26]=k,e[27]=P):P=e[27];const x=P;let C;e[28]!==a||e[29]!==s||e[30]!==x?(C=(d,w,S)=>{a?a({record:d,index:w,event:S}):s&&x(d)},e[28]=a,e[29]=s,e[30]=x,e[31]=C):C=e[31];const T=C;if(n.length===0){let d;e[32]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(u.Text,{c:"dimmed",ta:"center",py:"xl",children:"Keine Einträge gefunden"}),e[32]=d):d=e[32],j=d;break e}Y=u.Stack,$="sm",O="md",L=m&&D.length>0&&o.jsxs(u.Group,{gap:"xs",wrap:"nowrap",children:[o.jsx(u.Select,{data:D,value:m.field,onChange:d=>d&&m.onSortChange(d,m.direction),allowDeselect:!1,style:{flex:1}}),o.jsx(u.ActionIcon,{variant:"filled",size:"input-sm",onClick:()=>m.onSortChange(m.field,m.direction==="asc"?"desc":"asc"),children:m.direction==="asc"?o.jsx(Ve.IconSortAscending,{size:18}):o.jsx(Ve.IconSortDescending,{size:18})})]}),_=n.map((d,w)=>{const S=v(d),B=!!a||!!s,H=d.id??w,Q=I.has(H);return o.jsx(M.Fragment,{children:o.jsxs(u.Box,{bg:S?"var(--mantine-primary-color-light)":"var(--mantine-color-body)",bd:S?void 0:"1px solid var(--mantine-color-default-border)",style:{borderRadius:"var(--mantine-radius-md)",overflow:"hidden"},children:[o.jsxs(u.Box,{w:"100%",style:{cursor:B||p?"pointer":"default"},onClick:U=>{p&&!a?R(H):T(d,w,U)},children:[(s||p||c&&c.length>0)&&o.jsxs(u.Group,{px:"sm",pt:"sm",justify:"space-between",children:[o.jsxs(u.Group,{gap:"xs",children:[p&&o.jsx(u.Box,{c:"var(--mantine-primary-color-filled)",style:{cursor:"pointer",display:"flex",alignItems:"center"},onClick:U=>{U.stopPropagation(),R(H)},children:o.jsx(Ve.IconChevronDown,{size:16,style:{transform:Q?"rotate(0deg)":"rotate(-90deg)",transition:"transform 200ms"}})}),s&&o.jsx(u.Checkbox,{checked:S,onChange:()=>x(d),onClick:ii})]}),c&&c.length>0&&(()=>{const U=c.filter(G=>!(G.label==="Bearbeiten"&&h&&!h(d)||G.label==="Löschen"&&f&&!f(d)));return U.length===0?null:o.jsxs(u.Menu,{shadow:"md",position:"bottom-end",children:[o.jsx(u.Menu.Target,{children:o.jsx(u.ActionIcon,{variant:"subtle",color:"gray",size:"sm",onClick:ai,children:o.jsx(Ve.IconDotsVertical,{size:16})})}),o.jsx(u.Menu.Dropdown,{children:U.map((G,K)=>o.jsx(u.Menu.Item,{leftSection:G.icon,onClick:q=>{q.stopPropagation(),G.onClick([d])},children:G.label},`card_action_${K}`))})]})})()]}),E.map((U,G)=>o.jsxs(M.Fragment,{children:[G>0&&o.jsx(u.Divider,{}),o.jsx(si,{field:U,record:d})]},U.id))]}),p&&o.jsxs(u.Collapse,{in:Q,children:[o.jsx(u.Divider,{}),o.jsx(u.Box,{px:"sm",py:"sm",children:p.content(d)})]})]})},H)})}e[4]=c,e[5]=f,e[6]=h,e[7]=I,e[8]=r,e[9]=a,e[10]=i,e[11]=n,e[12]=p,e[13]=k,e[14]=s,e[15]=m,e[16]=Y,e[17]=$,e[18]=O,e[19]=L,e[20]=_,e[21]=j}else Y=e[16],$=e[17],O=e[18],L=e[19],_=e[20],j=e[21];if(j!==Symbol.for("react.early_return_sentinel"))return j;let N;e[33]!==g?(N=g&&g.totalRecords>g.recordsPerPage&&o.jsxs(u.Stack,{gap:"xs",mt:"sm",children:[o.jsx(u.Group,{justify:"center",children:o.jsx(u.Pagination,{total:Math.ceil(g.totalRecords/g.recordsPerPage),value:g.page,onChange:g.onPageChange,size:"sm"})}),g.recordsPerPageOptions&&g.onRecordsPerPageChange&&o.jsxs(u.Group,{justify:"center",gap:"xs",children:[o.jsx(u.Text,{fz:"xs",c:"dimmed",children:"Einträge pro Seite:"}),o.jsx(u.Select,{data:g.recordsPerPageOptions.map(oi),value:String(g.recordsPerPage),onChange:E=>E&&g.onRecordsPerPageChange(Number(E)),allowDeselect:!1,size:"xs",w:70})]})]}),e[33]=g,e[34]=N):N=e[34];let W;return e[35]!==Y||e[36]!==N||e[37]!==$||e[38]!==O||e[39]!==L||e[40]!==_?(W=o.jsxs(Y,{gap:$,my:O,children:[L,_,N]}),e[35]=Y,e[36]=N,e[37]=$,e[38]=O,e[39]=L,e[40]=_,e[41]=W):W=e[41],W}function oi(t){return{value:String(t),label:String(t)}}function ai(t){return t.stopPropagation()}function ii(t){return t.stopPropagation()}function li(t,e){const n=e.column.accessor??e.id;return t.some(r=>r.value===n)||t.push({value:n,label:e.column.title??e.id}),t}function ci(t){return t.column.sortable!==!1}function ui(t){return t.list&&t.column}const In=[10,15,50,100,500];function di(t){const e=Me.c(133),{title:n,queryKey:r,connectedQueryKeys:s,apiPath:l,mutationApiPath:i,buttons:a,fields:c,selection:h,pagination:f,filters:g,actions:m,steps:p,defaultSort:y,onSortChange:k,createButtonText:A,queryParams:I,tabs:F,defaultTab:z,activeTab:R,onActiveTabChange:Y,canUpdate:$,canDelete:O,showRefresh:L,rowExpansion:_,onRowClick:j,mobileCards:N}=t,W=L===void 0?!0:L,E=N===void 0?!1:N,[D,b]=M.useState(z||(F&&F.length>0?F[0].value:null)),v=R!==void 0?R:D;let P;e[0]!==R||e[1]!==Y?(P=ee=>{R===void 0&&b(ee),Y&&Y(ee)},e[0]=R,e[1]=Y,e[2]=P):P=e[2];const x=P;let C;e[3]!==v||e[4]!==F?(C=F?.find(ee=>ee.value===v),e[3]=v,e[4]=F,e[5]=C):C=e[5];const T=C,d=T?.queryParams||{},w=T?.apiPath??l,S=T?.mutationApiPath??i??w,B={...I,...d},H=B?"?"+Object.entries(B).filter(Di).map(wi).join("&"):"";let Q;e[6]!==v||e[7]!==r?(Q=v?[...r,v]:r,e[6]=v,e[7]=r,e[8]=Q):Q=e[8];const U=Q,{data:G,isLoading:K,isError:q,isRefetching:te,refetch:X}=yr(w+H,U),{queryClient:ne}=vt();let le,he;e[9]!==G||e[10]!==s||e[11]!==ne?(le=()=>{!G||!Array.isArray(G)||s?.forEach(ee=>ne.invalidateQueries({queryKey:ee}))},he=[G,s,ne],e[9]=G,e[10]=s,e[11]=ne,e[12]=le,e[13]=he):(le=e[12],he=e[13]),M.useEffect(le,he);const re=!G||!Array.isArray(G)?[]:!g||g.length===0?G:G.filter(ee=>g.every(se=>{if(se.value===void 0)return!0;const Ke=se.id;if(se.type==="query"){const Se=ee[Ke];return Array.isArray(se.value)?Array.isArray(Se)?Se.some(ue=>{if(typeof ue=="string"||typeof ue=="number")return se.value.includes(String(ue));if(ue&&typeof ue=="object"){const we=ue;if("id"in we&&se.value.includes(we.id))return!0;for(const yt in we){const Ne=we[yt];if(typeof Ne=="string"&&se.value.includes(Ne)||Ne&&typeof Ne=="object"&&"id"in Ne&&se.value.includes(Ne.id))return!0}}return!1}):Se&&typeof Se=="object"&&"id"in Se?se.value.includes(Se.id):!1:typeof Se=="string"&&Se.includes(se.value)}else if(se.type==="date"){const Se=se.value;if(!Se)return!0;const[ue,we]=Se;if(!ue&&!we)return!0;const yt=ee[Ke];if(typeof yt=="string"){const Ne=yt.split(" ")[0];if(ue&&we)return Ne>=ue&&Ne<=we;if(ue&&!we)return Ne>=ue;if(!ue&&we)return Ne<=we}return!0}else if(se.type==="boolean")return ee[Ke]===se.value;return!0})),_e=y?.field??c[0].id,pe=y?.direction??"desc";let Te;e[14]!==_e||e[15]!==pe?(Te={columnAccessor:_e,direction:pe},e[14]=_e,e[15]=pe,e[16]=Te):Te=e[16];const[je,nt]=M.useState(Te);let Re;e[17]!==k?(Re=ee=>{nt(ee),k&&k(String(ee.columnAccessor),ee.direction)},e[17]=k,e[18]=Re):Re=e[18];const Je=Re,$e=as(re,je.columnAccessor,je.direction),[Ye,Ze]=ss(In[1],"mantine-table-page-size"),[J,ge]=M.useState(1),fe=f?$e.slice((J-1)*Ye,J*Ye):$e;let rt;e[19]===Symbol.for("react.memo_cache_sentinel")?(rt=[],e[19]=rt):rt=e[19];const[ie,Oe]=M.useState(rt);let dt;e[20]===Symbol.for("react.memo_cache_sentinel")?(dt=()=>{Oe([])},e[20]=dt):dt=e[20];let ht;e[21]!==v?(ht=[v],e[21]=v,e[22]=ht):ht=e[22],M.useEffect(dt,ht);const[qe,Ie]=M.useState(!1),[xt,ve]=M.useState(!1),[st,Ee]=M.useState(!1);let ot;e[23]!==c?(ot=c.some(Si),e[23]=c,e[24]=ot):ot=e[24];const Ct=ot;let xe;e[25]!==c?(xe=c.some(Ci),e[25]=c,e[26]=xe):xe=e[26];const St=xe;let Pe;if(e[27]!==m||e[28]!==St||e[29]!==Ct){if(Pe=[],Ct){let ee;e[31]===Symbol.for("react.memo_cache_sentinel")?(ee=o.jsx(Ve.IconPencil,{size:14}),e[31]=ee):ee=e[31];let se;e[32]===Symbol.for("react.memo_cache_sentinel")?(se={icon:ee,label:"Bearbeiten",onClick:Ke=>{Oe(Ke),ve(!0)}},e[32]=se):se=e[32],Pe.push(se)}if(m&&Pe.push(...m),St){let ee;e[33]===Symbol.for("react.memo_cache_sentinel")?(ee=o.jsx(Ve.IconTrash,{size:14}),e[33]=ee):ee=e[33];let se;e[34]===Symbol.for("react.memo_cache_sentinel")?(se={icon:ee,label:"Löschen",onClick:Ke=>{Oe(Ke),Ee(!0)}},e[34]=se):se=e[34],Pe.push(se)}e[27]=m,e[28]=St,e[29]=Ct,e[30]=Pe}else Pe=e[30];const at=n?"space-between":"end";let Fe;e[35]!==n?(Fe=n&&(typeof n=="string"?o.jsx(u.Title,{order:4,children:n}):n),e[35]=n,e[36]=Fe):Fe=e[36];let Xe;e[37]===Symbol.for("react.memo_cache_sentinel")?(Xe={marginLeft:"auto"},e[37]=Xe):Xe=e[37];let We;e[38]!==X||e[39]!==W?(We=W&&o.jsx(u.ActionIcon,{variant:"subtle",onClick:()=>X(),"aria-label":"Neuladen",children:o.jsx(Ve.IconRefresh,{})}),e[38]=X,e[39]=W,e[40]=We):We=e[40];let Ge;e[41]!==m||e[42]!==O||e[43]!==$||e[44]!==c||e[45]!==E||e[46]!==ie||e[47]!==h?(Ge=(c.some(xi)||h)&&(()=>{const ee=c.find(vi)&&(!$||ie.length>0&&$(ie[0])),se=c.find(yi)&&(!O||ie.length>0&&O(ie[0])),Ke=(m??[]).length>0,Se=ee||se||Ke;return o.jsx(u.Box,{...E?{visibleFrom:"sm"}:{},children:o.jsxs(u.Menu,{shadow:"md",children:[o.jsx(u.Menu.Target,{children:o.jsx(u.Button,{variant:"outline",rightSection:o.jsx(Ve.IconCaretDownFilled,{size:14}),disabled:!ie.length||!Se,children:"Aktionen"})}),o.jsxs(u.Menu.Dropdown,{children:[ee&&o.jsx(u.Menu.Item,{leftSection:o.jsx(Ve.IconPencil,{size:14}),onClick:()=>ve(!0),disabled:ie.length!==1,children:"Bearbeiten"}),(m??[]).map((ue,we)=>M.createElement(u.Menu.Item,{...ue.icon&&{leftSection:ue.icon},key:`custom_action_${we}`,onClick:()=>ue.onClick(ie),disabled:ue.disabled?.(ie)??!1},ue.label)),se&&o.jsx(u.Menu.Item,{leftSection:o.jsx(Ve.IconTrash,{size:14}),onClick:()=>Ee(!0),color:"red",children:"Löschen"})]})]})})})(),e[41]=m,e[42]=O,e[43]=$,e[44]=c,e[45]=E,e[46]=ie,e[47]=h,e[48]=Ge):Ge=e[48];let et;e[49]!==A||e[50]!==c||e[51]!==K?(et=c.find(bi)&&o.jsx(u.Button,{onClick:()=>Ie(!0),disabled:K,children:A??"Erstellen"}),e[49]=A,e[50]=c,e[51]=K,e[52]=et):et=e[52];let Z;e[53]!==a||e[54]!==We||e[55]!==Ge||e[56]!==et?(Z=o.jsxs(u.Group,{align:"center",gap:"xs",wrap:"wrap",justify:"end",style:Xe,children:[We,Ge,et,a]}),e[53]=a,e[54]=We,e[55]=Ge,e[56]=et,e[57]=Z):Z=e[57];let ce;e[58]!==at||e[59]!==Fe||e[60]!==Z?(ce=o.jsxs(u.Group,{gap:"xs",justify:at,align:"center",wrap:"wrap",children:[Fe,Z]}),e[58]=at,e[59]=Fe,e[60]=Z,e[61]=ce):ce=e[61];let Le;e[62]!==v||e[63]!==x||e[64]!==F?(Le=F&&F.length>0&&o.jsx(u.Tabs,{value:v,onChange:x,mt:"md",children:o.jsx(u.Tabs.List,{children:F.map(gi)})}),e[62]=v,e[63]=x,e[64]=F,e[65]=Le):Le=e[65];let Qe;e[66]!==q?(Qe=q&&o.jsx(u.Alert,{mt:"md",variant:"light",color:"red",title:"Es ist ein Fehler aufgetreten.",icon:o.jsx(Ve.IconInfoCircle,{}),children:"Bitte versuche es später erneut oder sende eine Nachricht an unseren Support."}),e[66]=q,e[67]=Qe):Qe=e[67];let ft;e[68]!==K||e[69]!==te?(ft=(K||te)&&o.jsxs(u.Stack,{my:"md",children:[o.jsx(u.Skeleton,{height:40}),Array(5).fill(0).map(pi)]}),e[68]=K,e[69]=te,e[70]=ft):ft=e[70];let mt;e[71]!==O||e[72]!==$||e[73]!==c||e[74]!==Je||e[75]!==q||e[76]!==K||e[77]!==te||e[78]!==Pe||e[79]!==E||e[80]!==j||e[81]!==J||e[82]!==Ye||e[83]!==f||e[84]!==fe||e[85]!==_||e[86]!==ie||e[87]!==h||e[88]!==ge||e[89]!==Ze||e[90]!==je||e[91]!==$e?(mt=!K&&!te&&o.jsxs(o.Fragment,{children:[o.jsx(u.Box,{...E?{visibleFrom:"sm"}:{},children:o.jsx(qa,{my:"md",striped:!0,highlightOnHover:!0,minHeight:150,fetching:q,records:fe,sortStatus:je,onSortStatusChange:Je,...h&&{selectedRecords:ie,onSelectedRecordsChange:Oe},...f&&fe.length&&{totalRecords:$e.length,recordsPerPage:Ye,onPageChange:ge,page:J,recordsPerPageOptions:In,onRecordsPerPageChange:Ze,recordsPerPageLabel:"Einträge pro Seite"},..._&&{rowExpansion:{allowMultiple:_.allowMultiple??!1,content:ee=>{const{record:se}=ee;return _.content(se)},..._.expanded&&{expanded:_.expanded}}},columns:c.map(mi),noRecordsText:"Keine Einträge gefunden",onRowClick:j,...j&&{style:{cursor:"pointer"}}})}),E&&o.jsx(u.Box,{hiddenFrom:"sm",children:o.jsx(is,{records:fe,fields:c,selection:h,selectedRecords:ie,onSelectedRecordsChange:Oe,onRowClick:j,sort:{field:String(je.columnAccessor),direction:je.direction,onSortChange:(ee,se)=>{Je({columnAccessor:ee,direction:se})}},...f&&fe.length&&{pagination:{totalRecords:$e.length,recordsPerPage:Ye,page:J,onPageChange:ge,recordsPerPageOptions:In,onRecordsPerPageChange:ee=>{Ze(ee),ge(1)}}},..._&&{rowExpansion:{content:_.content}},...Pe.length>0&&{actions:Pe,canUpdate:$,canDelete:O}})})]}),e[71]=O,e[72]=$,e[73]=c,e[74]=Je,e[75]=q,e[76]=K,e[77]=te,e[78]=Pe,e[79]=E,e[80]=j,e[81]=J,e[82]=Ye,e[83]=f,e[84]=fe,e[85]=_,e[86]=ie,e[87]=h,e[88]=ge,e[89]=Ze,e[90]=je,e[91]=$e,e[92]=mt):mt=e[92];let Mt;e[93]===Symbol.for("react.memo_cache_sentinel")?(Mt=()=>{ve(!1),Oe([])},e[93]=Mt):Mt=e[93];const it=n??"Bearbeiten";let pt;e[94]!==S||e[95]!==c||e[96]!==r||e[97]!==ie[0]||e[98]!==ie.length||e[99]!==p?(pt=ie.length>0&&o.jsx(ns,{fields:c.filter(fi),queryKey:r,apiPath:S,id:ie[0].id,onClose:()=>{ve(!1),Oe([])},steps:p}),e[94]=S,e[95]=c,e[96]=r,e[97]=ie[0],e[98]=ie.length,e[99]=p,e[100]=pt):pt=e[100];let ze;e[101]!==it||e[102]!==pt||e[103]!==xt?(ze=o.jsx(u.Modal,{opened:xt,onClose:Mt,title:it,children:pt}),e[101]=it,e[102]=pt,e[103]=xt,e[104]=ze):ze=e[104];let gt;e[105]!==st||e[106]!==S||e[107]!==r||e[108]!==ie||e[109]!==n?(gt=ie.length>0&&o.jsx(u.Modal,{opened:st,onClose:()=>{Ee(!1),Oe([])},title:n??"Löschen",children:o.jsx(rs,{onClose:()=>{Ee(!1),Oe([])},queryKey:r,apiPath:S,selectedRecords:ie})}),e[105]=st,e[106]=S,e[107]=r,e[108]=ie,e[109]=n,e[110]=gt):gt=e[110];let bt;e[111]===Symbol.for("react.memo_cache_sentinel")?(bt=()=>{Ie(!1)},e[111]=bt):bt=e[111];const wt=n??"Anlegen";let Ce;e[112]===Symbol.for("react.memo_cache_sentinel")?(Ce=()=>{Ie(!1)},e[112]=Ce):Ce=e[112];let Be;e[113]!==c?(Be=c.filter(hi),e[113]=c,e[114]=Be):Be=e[114];let tt;e[115]!==S||e[116]!==r||e[117]!==p||e[118]!==Be?(tt=o.jsx(zr,{queryKey:r,apiPath:S,onClose:Ce,fields:Be,steps:p}),e[115]=S,e[116]=r,e[117]=p,e[118]=Be,e[119]=tt):tt=e[119];let ye;e[120]!==qe||e[121]!==wt||e[122]!==tt?(ye=o.jsx(u.Modal,{opened:qe,onClose:bt,title:wt,children:tt}),e[120]=qe,e[121]=wt,e[122]=tt,e[123]=ye):ye=e[123];let Tt;return e[124]!==ce||e[125]!==Le||e[126]!==Qe||e[127]!==ft||e[128]!==mt||e[129]!==ze||e[130]!==gt||e[131]!==ye?(Tt=o.jsxs(o.Fragment,{children:[ce,Le,Qe,ft,mt,ze,gt,ye]}),e[124]=ce,e[125]=Le,e[126]=Qe,e[127]=ft,e[128]=mt,e[129]=ze,e[130]=gt,e[131]=ye,e[132]=Tt):Tt=e[132],Tt}function hi(t){return t.create}function fi(t){return t.update}function mi(t){return t.column}function pi(t,e){return o.jsx(u.Skeleton,{height:35},`skeleton-${e}`)}function gi(t){return o.jsx(u.Tabs.Tab,{value:t.value,leftSection:t.icon,children:t.label},t.value)}function bi(t){return t.create}function yi(t){return t.delete}function vi(t){return t.update}function xi(t){return t.update}function Ci(t){return t.delete}function Si(t){return t.update}function wi(t){const[e,n]=t;return`${e}=${encodeURIComponent(n??"")}`}function Di(t){const[,e]=t;return e!=null}function ki(t){const e=Me.c(2);let n;return e[0]!==t?(n=o.jsx(di,{...t}),e[0]=t,e[1]=n):n=e[1],n}oe.CreateModal=zr,oe.DataTable=ki,oe.DataTableProvider=Qs,oe.DeleteModal=rs,oe.MobileCardList=is,oe.UpdateModal=ns,oe.api=Js,oe.createOne=pr,oe.deleteOne=mr,oe.getAll=hr,oe.getOne=fr,oe.parseApiError=Ks,oe.sortData=as,oe.updateOne=gr,oe.useAddOne=vr,oe.useDataTable=vt,oe.useDeleteOne=xr,oe.useGetAll=yr,oe.useGetOne=br,oe.usePersistentState=ss,oe.useUpdateOne=wn,Object.defineProperty(oe,Symbol.toStringTag,{value:"Module"})}));
|
|
10
|
+
<%s key={someKey} {...props} />`,z,U,G,U),T[U+z]=!0)}if(U=null,S!==void 0&&(n(S),U=""+S),i(w)&&(n(w.key),U=""+w.key),"key"in w){S={};for(var K in w)K!=="key"&&(S[K]=w[K])}else S=w;return U&&a(S,typeof d=="function"?d.displayName||d.name||"Unknown":d),h(d,U,S,s(),H,Q)}function g(d){m(d)?d._store&&(d._store.validated=1):typeof d=="object"&&d!==null&&d.$$typeof===_&&(d._payload.status==="fulfilled"?m(d._payload.value)&&d._payload.value._store&&(d._payload.value._store.validated=1):d._store&&(d._store.validated=1))}function m(d){return typeof d=="object"&&d!==null&&d.$$typeof===y}var p=M,y=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),B=Symbol.for("react.consumer"),R=Symbol.for("react.context"),Y=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),N=Symbol.for("react.client.reference"),W=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,E=Object.prototype.hasOwnProperty,D=Array.isArray,b=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(d){return d()}};var v,P={},C=p.react_stack_bottom_frame.bind(p,l)(),x=b(r(l)),T={};Rt.Fragment=A,Rt.jsx=function(d,w,S){var z=1e4>W.recentlyCreatedOwnerStacks++;return f(d,w,S,!1,z?Error("react-stack-top-frame"):C,z?b(r(d)):x)},Rt.jsxs=function(d,w,S){var z=1e4>W.recentlyCreatedOwnerStacks++;return f(d,w,S,!0,z?Error("react-stack-top-frame"):C,z?b(r(d)):x)}})()),Rt}var or;function As(){return or||(or=1,process.env.NODE_ENV==="production"?Ut.exports=Ls():Ut.exports=Ns()),Ut.exports}var o=As(),ar=be.createContext(void 0),ir=t=>{const e=be.useContext(ar);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Rs=({client:t,children:e})=>(be.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),o.jsx(ar.Provider,{value:t,children:e})),lr=be.createContext(!1),$s=()=>be.useContext(lr);lr.Provider;function Ys(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var Is=be.createContext(Ys()),Fs=()=>be.useContext(Is),Ws=(t,e,n)=>{const r=n?.state.error&&typeof t.throwOnError=="function"?vn(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||r)&&(e.isReset()||(t.retryOnMount=!1))},zs=t=>{be.useEffect(()=>{t.clearReset()},[t])},Bs=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||vn(n,[t.error,r])),Vs=t=>{if(t.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=t.staleTime;t.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},Hs=(t,e)=>t.isLoading&&t.isFetching&&!e,Us=(t,e)=>t?.suspense&&e.isPending,cr=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function qs(t,e,n){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 r=$s(),s=Fs(),l=ir(),i=l.defaultQueryOptions(t);l.getDefaultOptions().queries?._experimental_beforeQuery?.(i);const a=l.getQueryCache().get(i.queryHash);process.env.NODE_ENV!=="production"&&(i.queryFn||console.error(`[${i.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`)),i._optimisticResults=r?"isRestoring":"optimistic",Vs(i),Ws(i,s,a),zs(s);const c=!l.getQueryCache().get(i.queryHash),[h]=be.useState(()=>new e(l,i)),f=h.getOptimisticResult(i),g=!r&&t.subscribed!==!1;if(be.useSyncExternalStore(be.useCallback(m=>{const p=g?h.subscribe(Ht.batchCalls(m)):Bt;return h.updateResult(),p},[h,g]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),be.useEffect(()=>{h.setOptions(i)},[i,h]),Us(i,f))throw cr(i,h,s);if(Bs({result:f,errorResetBoundary:s,throwOnError:i.throwOnError,query:a,suspense:i.suspense}))throw f.error;return l.getDefaultOptions().queries?._experimental_afterQuery?.(i,f),i.experimental_prefetchInRender&&!Lt&&Hs(f,r)&&(c?cr(i,h,s):a?.promise)?.catch(Bt).finally(()=>{h.updateResult()}),i.notifyOnChangeProps?f:h.trackResult(f)}function ur(t,e){return qs(t,Ps)}function Sn(t,e){const n=ir(),[r]=be.useState(()=>new Es(n,t));be.useEffect(()=>{r.setOptions(t)},[r,t]);const s=be.useSyncExternalStore(be.useCallback(i=>r.subscribe(Ht.batchCalls(i)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),l=be.useCallback((i,a)=>{r.mutate(i,a).catch(Bt)},[r]);if(s.error&&vn(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:l,mutateAsync:s.mutate}}const dr=M.createContext(void 0),Gs=async()=>({"Content-Type":"application/json"});function Qs(t){const e=Me.c(10),{children:n,baseUrl:r,queryClient:s,getHeaders:l}=t,i=l===void 0?Gs:l;let a;e[0]!==r||e[1]!==i||e[2]!==s?(a={baseUrl:r,queryClient:s,getHeaders:i},e[0]=r,e[1]=i,e[2]=s,e[3]=a):a=e[3];let c;e[4]!==n||e[5]!==s?(c=o.jsx(Rs,{client:s,children:n}),e[4]=n,e[5]=s,e[6]=c):c=e[6];let h;return e[7]!==a||e[8]!==c?(h=o.jsx(dr.Provider,{value:a,children:c}),e[7]=a,e[8]=c,e[9]=h):h=e[9],h}function vt(){const t=M.useContext(dr);if(!t)throw new Error("useDataTable must be used within a DataTableProvider");return t}function Ks(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 jt(t,e){const n=await fetch(t,e);if(n.status>=400){const r=await n.text();if(!r)throw new Error(`HTTP ${n.status}: ${n.statusText}`);let s=null;try{s=JSON.parse(r)}catch{throw new Error(r)}throw new Error(s?.message??s?.error??r)}return n}async function hr(t,e){return(await jt(t,{method:"GET",headers:await e()})).json()}async function fr(t,e,n){return(await jt(`${t}/${e}`,{method:"GET",headers:await n()})).json()}async function mr(t,e,n){await jt(`${t}/${e}`,{method:"DELETE",headers:await n()})}async function pr(t,e,n){const r=await jt(t,{method:"POST",headers:await n(),body:JSON.stringify(e)});return r.status===204?e:r.json()}async function Js(t,e,n,r){const s=await jt(e,{method:t,headers:await n(),body:r?JSON.stringify(r):void 0});if(s.status!==204)return s.json()}async function gr(t,e,n){const r=await jt(`${t}/${e.id}`,{method:"PUT",headers:await n(),body:JSON.stringify(e)});return r.status===204?e:r.json()}function br(t,e,n){const r=Me.c(14),{baseUrl:s,getHeaders:l}=vt();let i;if(r[0]!==n||r[1]!==e){let f;r[3]!==n?(f=n?.toString(),r[3]=n,r[4]=f):f=r[4],i=[...e.map(Zs),String(f)],r[0]=n,r[1]=e,r[2]=i}else i=r[2];let a;r[5]!==t||r[6]!==s||r[7]!==l||r[8]!==n?(a=()=>fr(`${s}${t}`,n,l),r[5]=t,r[6]=s,r[7]=l,r[8]=n,r[9]=a):a=r[9];const c=!!n;let h;return r[10]!==i||r[11]!==a||r[12]!==c?(h={queryKey:i,queryFn:a,enabled:c},r[10]=i,r[11]=a,r[12]=c,r[13]=h):h=r[13],ur(h)}function Zs(t){return t.toString()}function yr(t,e,n){const r=Me.c(10),s=n===void 0?!0:n,{baseUrl:l,getHeaders:i}=vt();let a;r[0]!==e?(a=[...e.map(Xs)],r[0]=e,r[1]=a):a=r[1];let c;r[2]!==t||r[3]!==l||r[4]!==i?(c=()=>hr(`${l}${t}`,i),r[2]=t,r[3]=l,r[4]=i,r[5]=c):c=r[5];let h;return r[6]!==s||r[7]!==a||r[8]!==c?(h={queryKey:a,queryFn:c,enabled:s},r[6]=s,r[7]=a,r[8]=c,r[9]=h):h=r[9],ur(h)}function Xs(t){return t.toString()}function vr(t,e){const n=Me.c(11),{baseUrl:r,queryClient:s,getHeaders:l}=vt();let i;n[0]!==e?(i=[...e.map(to)],n[0]=e,n[1]=i):i=n[1];let a;n[2]!==t||n[3]!==r||n[4]!==l?(a=h=>pr(`${r}${t}`,h,l),n[2]=t,n[3]=r,n[4]=l,n[5]=a):a=n[5];let c;return n[6]!==s||n[7]!==e||n[8]!==i||n[9]!==a?(c={mutationKey:i,mutationFn:a,onSettled(){return s.invalidateQueries({queryKey:[...e.map(eo)]})}},n[6]=s,n[7]=e,n[8]=i,n[9]=a,n[10]=c):c=n[10],Sn(c)}function eo(t){return t.toString()}function to(t){return t.toString()}function wn(t,e){const n=Me.c(11),{baseUrl:r,queryClient:s,getHeaders:l}=vt();let i;n[0]!==e?(i=[...e.map(ro)],n[0]=e,n[1]=i):i=n[1];let a;n[2]!==t||n[3]!==r||n[4]!==l?(a=h=>gr(`${r}${t}`,h,l),n[2]=t,n[3]=r,n[4]=l,n[5]=a):a=n[5];let c;return n[6]!==s||n[7]!==e||n[8]!==i||n[9]!==a?(c={mutationKey:i,mutationFn:a,onSettled(){return s.invalidateQueries({queryKey:[...e.map(no)]})}},n[6]=s,n[7]=e,n[8]=i,n[9]=a,n[10]=c):c=n[10],Sn(c)}function no(t){return t.toString()}function ro(t){return t.toString()}function xr(t,e){const n=Me.c(11),{baseUrl:r,queryClient:s,getHeaders:l}=vt();let i;n[0]!==e?(i=[...e.map(oo)],n[0]=e,n[1]=i):i=n[1];let a;n[2]!==t||n[3]!==r||n[4]!==l?(a=h=>mr(`${r}${t}`,h,l),n[2]=t,n[3]=r,n[4]=l,n[5]=a):a=n[5];let c;return n[6]!==s||n[7]!==e||n[8]!==i||n[9]!==a?(c={mutationKey:i,mutationFn:a,onSettled(){return s.invalidateQueries({queryKey:[...e.map(so)]})}},n[6]=s,n[7]=e,n[8]=i,n[9]=a,n[10]=c):c=n[10],Sn(c)}function so(t){return t.toString()}function oo(t){return t.toString()}var qt={exports:{}},ao=qt.exports,Cr;function io(){return Cr||(Cr=1,(function(t,e){(function(n,r){t.exports=r()})(ao,(function(){var n=1e3,r=6e4,s=36e5,l="millisecond",i="second",a="minute",c="hour",h="day",f="week",g="month",m="quarter",p="year",y="date",k="Invalid Date",A=/^(\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,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(D){var b=["th","st","nd","rd"],v=D%100;return"["+D+(b[(v-20)%10]||b[v]||b[0])+"]"}},B=function(D,b,v){var P=String(D);return!P||P.length>=b?D:""+Array(b+1-P.length).join(v)+D},R={s:B,z:function(D){var b=-D.utcOffset(),v=Math.abs(b),P=Math.floor(v/60),C=v%60;return(b<=0?"+":"-")+B(P,2,"0")+":"+B(C,2,"0")},m:function D(b,v){if(b.date()<v.date())return-D(v,b);var P=12*(v.year()-b.year())+(v.month()-b.month()),C=b.clone().add(P,g),x=v-C<0,T=b.clone().add(P+(x?-1:1),g);return+(-(P+(v-C)/(x?C-T:T-C))||0)},a:function(D){return D<0?Math.ceil(D)||0:Math.floor(D)},p:function(D){return{M:g,y:p,w:f,d:h,D:y,h:c,m:a,s:i,ms:l,Q:m}[D]||String(D||"").toLowerCase().replace(/s$/,"")},u:function(D){return D===void 0}},Y="en",$={};$[Y]=F;var O="$isDayjsObject",L=function(D){return D instanceof W||!(!D||!D[O])},_=function D(b,v,P){var C;if(!b)return Y;if(typeof b=="string"){var x=b.toLowerCase();$[x]&&(C=x),v&&($[x]=v,C=x);var T=b.split("-");if(!C&&T.length>1)return D(T[0])}else{var d=b.name;$[d]=b,C=d}return!P&&C&&(Y=C),C||!P&&Y},j=function(D,b){if(L(D))return D.clone();var v=typeof b=="object"?b:{};return v.date=D,v.args=arguments,new W(v)},N=R;N.l=_,N.i=L,N.w=function(D,b){return j(D,{locale:b.$L,utc:b.$u,x:b.$x,$offset:b.$offset})};var W=(function(){function D(v){this.$L=_(v.locale,null,!0),this.parse(v),this.$x=this.$x||v.x||{},this[O]=!0}var b=D.prototype;return b.parse=function(v){this.$d=(function(P){var C=P.date,x=P.utc;if(C===null)return new Date(NaN);if(N.u(C))return new Date;if(C instanceof Date)return new Date(C);if(typeof C=="string"&&!/Z$/i.test(C)){var T=C.match(A);if(T){var d=T[2]-1||0,w=(T[7]||"0").substring(0,3);return x?new Date(Date.UTC(T[1],d,T[3]||1,T[4]||0,T[5]||0,T[6]||0,w)):new Date(T[1],d,T[3]||1,T[4]||0,T[5]||0,T[6]||0,w)}}return new Date(C)})(v),this.init()},b.init=function(){var v=this.$d;this.$y=v.getFullYear(),this.$M=v.getMonth(),this.$D=v.getDate(),this.$W=v.getDay(),this.$H=v.getHours(),this.$m=v.getMinutes(),this.$s=v.getSeconds(),this.$ms=v.getMilliseconds()},b.$utils=function(){return N},b.isValid=function(){return this.$d.toString()!==k},b.isSame=function(v,P){var C=j(v);return this.startOf(P)<=C&&C<=this.endOf(P)},b.isAfter=function(v,P){return j(v)<this.startOf(P)},b.isBefore=function(v,P){return this.endOf(P)<j(v)},b.$g=function(v,P,C){return N.u(v)?this[P]:this.set(C,v)},b.unix=function(){return Math.floor(this.valueOf()/1e3)},b.valueOf=function(){return this.$d.getTime()},b.startOf=function(v,P){var C=this,x=!!N.u(P)||P,T=N.p(v),d=function(K,q){var te=N.w(C.$u?Date.UTC(C.$y,q,K):new Date(C.$y,q,K),C);return x?te:te.endOf(h)},w=function(K,q){return N.w(C.toDate()[K].apply(C.toDate("s"),(x?[0,0,0,0]:[23,59,59,999]).slice(q)),C)},S=this.$W,z=this.$M,H=this.$D,Q="set"+(this.$u?"UTC":"");switch(T){case p:return x?d(1,0):d(31,11);case g:return x?d(1,z):d(0,z+1);case f:var U=this.$locale().weekStart||0,G=(S<U?S+7:S)-U;return d(x?H-G:H+(6-G),z);case h:case y:return w(Q+"Hours",0);case c:return w(Q+"Minutes",1);case a:return w(Q+"Seconds",2);case i:return w(Q+"Milliseconds",3);default:return this.clone()}},b.endOf=function(v){return this.startOf(v,!1)},b.$set=function(v,P){var C,x=N.p(v),T="set"+(this.$u?"UTC":""),d=(C={},C[h]=T+"Date",C[y]=T+"Date",C[g]=T+"Month",C[p]=T+"FullYear",C[c]=T+"Hours",C[a]=T+"Minutes",C[i]=T+"Seconds",C[l]=T+"Milliseconds",C)[x],w=x===h?this.$D+(P-this.$W):P;if(x===g||x===p){var S=this.clone().set(y,1);S.$d[d](w),S.init(),this.$d=S.set(y,Math.min(this.$D,S.daysInMonth())).$d}else d&&this.$d[d](w);return this.init(),this},b.set=function(v,P){return this.clone().$set(v,P)},b.get=function(v){return this[N.p(v)]()},b.add=function(v,P){var C,x=this;v=Number(v);var T=N.p(P),d=function(z){var H=j(x);return N.w(H.date(H.date()+Math.round(z*v)),x)};if(T===g)return this.set(g,this.$M+v);if(T===p)return this.set(p,this.$y+v);if(T===h)return d(1);if(T===f)return d(7);var w=(C={},C[a]=r,C[c]=s,C[i]=n,C)[T]||1,S=this.$d.getTime()+v*w;return N.w(S,this)},b.subtract=function(v,P){return this.add(-1*v,P)},b.format=function(v){var P=this,C=this.$locale();if(!this.isValid())return C.invalidDate||k;var x=v||"YYYY-MM-DDTHH:mm:ssZ",T=N.z(this),d=this.$H,w=this.$m,S=this.$M,z=C.weekdays,H=C.months,Q=C.meridiem,U=function(q,te,X,ne){return q&&(q[te]||q(P,x))||X[te].slice(0,ne)},G=function(q){return N.s(d%12||12,q,"0")},K=Q||function(q,te,X){var ne=q<12?"AM":"PM";return X?ne.toLowerCase():ne};return x.replace(I,(function(q,te){return te||(function(X){switch(X){case"YY":return String(P.$y).slice(-2);case"YYYY":return N.s(P.$y,4,"0");case"M":return S+1;case"MM":return N.s(S+1,2,"0");case"MMM":return U(C.monthsShort,S,H,3);case"MMMM":return U(H,S);case"D":return P.$D;case"DD":return N.s(P.$D,2,"0");case"d":return String(P.$W);case"dd":return U(C.weekdaysMin,P.$W,z,2);case"ddd":return U(C.weekdaysShort,P.$W,z,3);case"dddd":return z[P.$W];case"H":return String(d);case"HH":return N.s(d,2,"0");case"h":return G(1);case"hh":return G(2);case"a":return K(d,w,!0);case"A":return K(d,w,!1);case"m":return String(w);case"mm":return N.s(w,2,"0");case"s":return String(P.$s);case"ss":return N.s(P.$s,2,"0");case"SSS":return N.s(P.$ms,3,"0");case"Z":return T}return null})(q)||T.replace(":","")}))},b.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},b.diff=function(v,P,C){var x,T=this,d=N.p(P),w=j(v),S=(w.utcOffset()-this.utcOffset())*r,z=this-w,H=function(){return N.m(T,w)};switch(d){case p:x=H()/12;break;case g:x=H();break;case m:x=H()/3;break;case f:x=(z-S)/6048e5;break;case h:x=(z-S)/864e5;break;case c:x=z/s;break;case a:x=z/r;break;case i:x=z/n;break;default:x=z}return C?x:N.a(x)},b.daysInMonth=function(){return this.endOf(g).$D},b.$locale=function(){return $[this.$L]},b.locale=function(v,P){if(!v)return this.$L;var C=this.clone(),x=_(v,P,!0);return x&&(C.$L=x),C},b.clone=function(){return N.w(this.$d,this)},b.toDate=function(){return new Date(this.valueOf())},b.toJSON=function(){return this.isValid()?this.toISOString():null},b.toISOString=function(){return this.$d.toISOString()},b.toString=function(){return this.$d.toUTCString()},D})(),E=W.prototype;return j.prototype=E,[["$ms",l],["$s",i],["$m",a],["$H",c],["$W",h],["$M",g],["$y",p],["$D",y]].forEach((function(D){E[D[1]]=function(b){return this.$g(b,D[0],D[1])}})),j.extend=function(D,b){return D.$i||(D(b,W,j),D.$i=!0),j},j.locale=_,j.isDayjs=L,j.unix=function(D){return j(1e3*D)},j.en=$[Y],j.Ls=$,j.p={},j}))})(qt)),qt.exports}var lo=io();const V=Hn(lo);function co({direction:t,levelIndex:e,rowIndex:n,cellIndex:r,size:s}){switch(t){case"up":return e===0&&n===0?null:n===0?{levelIndex:e-1,rowIndex:r<=s[e-1][s[e-1].length-1]-1?s[e-1].length-1:s[e-1].length-2,cellIndex:r}:{levelIndex:e,rowIndex:n-1,cellIndex:r};case"down":return n===s[e].length-1?{levelIndex:e+1,rowIndex:0,cellIndex:r}:n===s[e].length-2&&r>=s[e][s[e].length-1]?{levelIndex:e+1,rowIndex:0,cellIndex:r}:{levelIndex:e,rowIndex:n+1,cellIndex:r};case"left":return e===0&&n===0&&r===0?null:n===0&&r===0?{levelIndex:e-1,rowIndex:s[e-1].length-1,cellIndex:s[e-1][s[e-1].length-1]-1}:r===0?{levelIndex:e,rowIndex:n-1,cellIndex:s[e][n-1]-1}:{levelIndex:e,rowIndex:n,cellIndex:r-1};case"right":return n===s[e].length-1&&r===s[e][n]-1?{levelIndex:e+1,rowIndex:0,cellIndex:0}:r===s[e][n]-1?{levelIndex:e,rowIndex:n+1,cellIndex:0}:{levelIndex:e,rowIndex:n,cellIndex:r+1};default:return{levelIndex:e,rowIndex:n,cellIndex:r}}}function Sr({controlsRef:t,direction:e,levelIndex:n,rowIndex:r,cellIndex:s,size:l}){const i=co({direction:e,size:l,rowIndex:r,cellIndex:s,levelIndex:n});if(!i)return;const a=t.current?.[i.levelIndex]?.[i.rowIndex]?.[i.cellIndex];a&&(a.disabled||a.getAttribute("data-hidden")||a.getAttribute("data-outside")?Sr({controlsRef:t,direction:e,levelIndex:i.levelIndex,cellIndex:i.cellIndex,rowIndex:i.rowIndex,size:l}):a.focus())}function uo(t){switch(t){case"ArrowDown":return"down";case"ArrowUp":return"up";case"ArrowRight":return"right";case"ArrowLeft":return"left";default:return null}}function ho(t){return t.current?.map(e=>e.map(n=>n.length))}function Dn({controlsRef:t,levelIndex:e,rowIndex:n,cellIndex:r,event:s}){const l=uo(s.key);if(l){s.preventDefault();const i=ho(t);Sr({controlsRef:t,direction:l,levelIndex:e,rowIndex:n,cellIndex:r,size:i})}}function Ae(t){return t==null||t===""?t:V(t).format("YYYY-MM-DD")}function wr(t){return t==null||t===""?t:V(t).format("YYYY-MM-DD HH:mm:ss")}const fo={locale:"en",firstDayOfWeek:1,weekendDays:[0,6],labelSeparator:"–",consistentWeeks:!1},mo=M.createContext(fo);function lt(){const t=M.useContext(mo),e=M.useCallback(l=>l||t.locale,[t.locale]),n=M.useCallback(l=>typeof l=="number"?l:t.firstDayOfWeek,[t.firstDayOfWeek]),r=M.useCallback(l=>Array.isArray(l)?l:t.weekendDays,[t.weekendDays]),s=M.useCallback(l=>typeof l=="string"?l:t.labelSeparator,[t.labelSeparator]);return{...t,getLocale:e,getFirstDayOfWeek:n,getWeekendDays:r,getLabelSeparator:s}}function po({value:t,type:e,withTime:n}){const r=n?wr:Ae;if(e==="range"&&Array.isArray(t)){const s=r(t[0]),l=r(t[1]);return s?l?`${s} – ${l}`:`${s} –`:""}return e==="multiple"&&Array.isArray(t)?t.filter(Boolean).join(", "):!Array.isArray(t)&&t?r(t):""}function Dr({value:t,type:e,name:n,form:r,withTime:s=!1}){return o.jsx("input",{type:"hidden",value:po({value:t,type:e,withTime:s}),name:n,form:r})}Dr.displayName="@mantine/dates/HiddenDatesInput";function kr(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(n=kr(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function de(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=kr(t))&&(r&&(r+=" "),r+=e);return r}var _r={day:"m_396ce5cb"};const go=u.createVarsResolver((t,{size:e})=>({day:{"--day-size":u.getSize(e,"day-size")}})),kn=u.factory((t,e)=>{const n=u.useProps("Day",null,t),{classNames:r,className:s,style:l,styles:i,unstyled:a,vars:c,date:h,disabled:f,__staticSelector:g,weekend:m,outside:p,selected:y,renderDay:k,inRange:A,firstInRange:I,lastInRange:F,hidden:B,static:R,highlightToday:Y,attributes:$,...O}=n,L=u.useStyles({name:g||"Day",classes:_r,props:n,className:s,style:l,classNames:r,styles:i,unstyled:a,attributes:$,vars:c,varsResolver:go,rootSelector:"day"});return o.jsx(u.UnstyledButton,{...L("day",{style:B?{display:"none"}:void 0}),component:R?"div":"button",ref:e,disabled:f,"data-today":V(h).isSame(new Date,"day")||void 0,"data-hidden":B||void 0,"data-highlight-today":Y||void 0,"data-disabled":f||void 0,"data-weekend":!f&&!p&&m||void 0,"data-outside":!f&&p||void 0,"data-selected":!f&&y||void 0,"data-in-range":A&&!f||void 0,"data-first-in-range":I&&!f||void 0,"data-last-in-range":F&&!f||void 0,"data-static":R||void 0,unstyled:a,...O,children:k?.(h)||V(h).date()})});kn.classes=_r,kn.displayName="@mantine/dates/Day";function bo({locale:t,format:e="dd",firstDayOfWeek:n=1}){const r=V().day(n),s=[];for(let l=0;l<7;l+=1)typeof e=="string"?s.push(V(r).add(l,"days").locale(t).format(e)):s.push(e(V(r).add(l,"days").format("YYYY-MM-DD")));return s}var jr={weekday:"m_18a3eca"};const yo=u.createVarsResolver((t,{size:e})=>({weekdaysRow:{"--wr-fz":u.getFontSize(e),"--wr-spacing":u.getSpacing(e)}})),_n=u.factory((t,e)=>{const n=u.useProps("WeekdaysRow",null,t),{classNames:r,className:s,style:l,styles:i,unstyled:a,vars:c,locale:h,firstDayOfWeek:f,weekdayFormat:g,cellComponent:m="th",__staticSelector:p,withWeekNumbers:y,attributes:k,...A}=n,I=u.useStyles({name:p||"WeekdaysRow",classes:jr,props:n,className:s,style:l,classNames:r,styles:i,unstyled:a,attributes:k,vars:c,varsResolver:yo,rootSelector:"weekdaysRow"}),F=lt(),B=bo({locale:F.getLocale(h),format:g,firstDayOfWeek:F.getFirstDayOfWeek(f)}).map((R,Y)=>o.jsx(m,{...I("weekday"),children:R},Y));return o.jsxs(u.Box,{component:"tr",ref:e,...I("weekdaysRow"),...A,children:[y&&o.jsx(m,{...I("weekday"),children:"#"}),B]})});_n.classes=jr,_n.displayName="@mantine/dates/WeekdaysRow";function vo(t,e=1){let n=V(t);if(!n.isValid())return n;const r=e===0?6:e-1;for(;n.day()!==r;)n=n.add(1,"day");return n.format("YYYY-MM-DD")}function xo(t,e=1){let n=V(t);for(;n.day()!==e;)n=n.subtract(1,"day");return n.format("YYYY-MM-DD")}function Co({month:t,firstDayOfWeek:e=1,consistentWeeks:n}){const r=V(t).subtract(V(t).date()-1,"day"),s=V(r.format("YYYY-M-D")),l=s.format("YYYY-MM-DD"),i=s.add(+s.daysInMonth()-1,"day").format("YYYY-MM-DD"),a=vo(i,e),c=[];let h=V(xo(l,e));for(;V(h).isBefore(a,"day");){const f=[];for(let g=0;g<7;g+=1)f.push(h.format("YYYY-MM-DD")),h=h.add(1,"day");c.push(f)}if(n&&c.length<6){const f=c[c.length-1],g=f[f.length-1];let m=V(g).add(1,"day");for(;c.length<6;){const p=[];for(let y=0;y<7;y+=1)p.push(m.format("YYYY-MM-DD")),m=m.add(1,"day");c.push(p)}}return c}function jn(t,e){return V(t).format("YYYY-MM")===V(e).format("YYYY-MM")}function Pr(t,e){return e?V(t).isAfter(V(e).subtract(1,"day"),"day"):!0}function Mr(t,e){return e?V(t).isBefore(V(e).add(1,"day"),"day"):!0}function So({dates:t,minDate:e,maxDate:n,getDayProps:r,excludeDate:s,hideOutsideDates:l,month:i}){const a=t.flat().filter(f=>Mr(f,n)&&Pr(f,e)&&!s?.(f)&&!r?.(f)?.disabled&&(!l||jn(f,i))),c=a.find(f=>r?.(f)?.selected);if(c)return c;const h=a.find(f=>V().isSame(f,"date"));return h||a[0]}var Gt={exports:{}},wo=Gt.exports,Tr;function Do(){return Tr||(Tr=1,(function(t,e){(function(n,r){t.exports=r()})(wo,(function(){var n="day";return function(r,s,l){var i=function(h){return h.add(4-h.isoWeekday(),n)},a=s.prototype;a.isoWeekYear=function(){return i(this).year()},a.isoWeek=function(h){if(!this.$utils().u(h))return this.add(7*(h-this.isoWeek()),n);var f,g,m,p,y=i(this),k=(f=this.isoWeekYear(),g=this.$u,m=(g?l.utc:l)().year(f).startOf("year"),p=4-m.isoWeekday(),m.isoWeekday()>4&&(p+=7),m.add(p,n));return y.diff(k,"week")+1},a.isoWeekday=function(h){return this.$utils().u(h)?this.day()||7:this.day(this.day()%7?h:h-7)};var c=a.startOf;a.startOf=function(h,f){var g=this.$utils(),m=!!g.u(f)||f;return g.p(h)==="isoweek"?m?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):c.bind(this)(h,f)}}}))})(Gt)),Gt.exports}var ko=Do();const _o=Hn(ko);V.extend(_o);function jo(t){const e=t.find(n=>V(n).day()===1);return V(e).isoWeek()}var Or={month:"m_cc9820d3",monthCell:"m_8f457cd5",weekNumber:"m_6cff9dea"};const Po={withCellSpacing:!0},Mo=u.createVarsResolver((t,{size:e})=>({weekNumber:{"--wn-fz":u.getFontSize(e),"--wn-size":u.getSize(e,"wn-size")}})),Qt=u.factory((t,e)=>{const n=u.useProps("Month",Po,t),{classNames:r,className:s,style:l,styles:i,unstyled:a,vars:c,__staticSelector:h,locale:f,firstDayOfWeek:g,weekdayFormat:m,month:p,weekendDays:y,getDayProps:k,excludeDate:A,minDate:I,maxDate:F,renderDay:B,hideOutsideDates:R,hideWeekdays:Y,getDayAriaLabel:$,static:O,__getDayRef:L,__onDayKeyDown:_,__onDayClick:j,__onDayMouseEnter:N,__preventFocus:W,__stopPropagation:E,withCellSpacing:D,size:b,highlightToday:v,withWeekNumbers:P,attributes:C,...x}=n,T=u.useStyles({name:h||"Month",classes:Or,props:n,className:s,style:l,classNames:r,styles:i,unstyled:a,attributes:C,vars:c,varsResolver:Mo,rootSelector:"month"}),d=lt(),w=Co({month:p,firstDayOfWeek:d.getFirstDayOfWeek(g),consistentWeeks:d.consistentWeeks}),S=So({dates:w,minDate:Ae(I),maxDate:Ae(F),getDayProps:k,excludeDate:A,hideOutsideDates:R,month:p}),{resolvedClassNames:z,resolvedStyles:H}=u.useResolvedStylesApi({classNames:r,styles:i,props:n}),Q=w.map((U,G)=>{const K=U.map((q,te)=>{const X=!jn(q,p),ne=$?.(q)||V(q).locale(f||d.locale).format("D MMMM YYYY"),le=k?.(q),he=V(q).isSame(S,"date");return o.jsx("td",{...T("monthCell"),"data-with-spacing":D||void 0,children:o.jsx(kn,{__staticSelector:h||"Month",classNames:z,styles:H,unstyled:a,"data-mantine-stop-propagation":E||void 0,highlightToday:v,renderDay:B,date:q,size:b,weekend:d.getWeekendDays(y).includes(V(q).get("day")),outside:X,hidden:R?X:!1,"aria-label":ne,static:O,disabled:A?.(q)||!Mr(q,Ae(F))||!Pr(q,Ae(I)),ref:re=>{re&&L?.(G,te,re)},...le,onKeyDown:re=>{le?.onKeyDown?.(re),_?.(re,{rowIndex:G,cellIndex:te,date:q})},onMouseEnter:re=>{le?.onMouseEnter?.(re),N?.(re,q)},onClick:re=>{le?.onClick?.(re),j?.(re,q)},onMouseDown:re=>{le?.onMouseDown?.(re),W&&re.preventDefault()},tabIndex:W||!he?-1:0})},q.toString())});return o.jsxs("tr",{...T("monthRow"),children:[P&&o.jsx("td",{...T("weekNumber"),children:jo(U)}),K]},G)});return o.jsxs(u.Box,{component:"table",...T("month"),size:b,ref:e,...x,children:[!Y&&o.jsx("thead",{...T("monthThead"),children:o.jsx(_n,{__staticSelector:h||"Month",locale:f,firstDayOfWeek:g,weekdayFormat:m,size:b,classNames:z,styles:H,unstyled:a,withWeekNumbers:P})}),o.jsx("tbody",{...T("monthTbody"),children:Q})]})});Qt.classes=Or,Qt.displayName="@mantine/dates/Month";var Er={pickerControl:"m_dc6a3c71"};const To=u.createVarsResolver((t,{size:e})=>({pickerControl:{"--dpc-fz":u.getFontSize(e),"--dpc-size":u.getSize(e,"dpc-size")}})),Kt=u.factory((t,e)=>{const n=u.useProps("PickerControl",null,t),{classNames:r,className:s,style:l,styles:i,unstyled:a,vars:c,firstInRange:h,lastInRange:f,inRange:g,__staticSelector:m,selected:p,disabled:y,attributes:k,...A}=n,I=u.useStyles({name:m||"PickerControl",classes:Er,props:n,className:s,style:l,classNames:r,styles:i,unstyled:a,attributes:k,vars:c,varsResolver:To,rootSelector:"pickerControl"});return o.jsx(u.UnstyledButton,{...I("pickerControl"),ref:e,unstyled:a,"data-picker-control":!0,"data-selected":p&&!y||void 0,"data-disabled":y||void 0,"data-in-range":g&&!y&&!p||void 0,"data-first-in-range":h&&!y||void 0,"data-last-in-range":f&&!y||void 0,disabled:y,...A})});Kt.classes=Er,Kt.displayName="@mantine/dates/PickerControl";function Lr({year:t,minDate:e,maxDate:n}){return!e&&!n?!1:!!(e&&V(t).isBefore(e,"year")||n&&V(t).isAfter(n,"year"))}function Oo({years:t,minDate:e,maxDate:n,getYearControlProps:r}){const s=t.flat().filter(a=>!Lr({year:a,minDate:e,maxDate:n})&&!r?.(a)?.disabled),l=s.find(a=>r?.(a)?.selected);if(l)return l;const i=s.find(a=>V().isSame(a,"year"));return i||s[0]}function Nr(t){const e=V(t).year(),n=e-e%10;let r=0;const s=[[],[],[],[]];for(let l=0;l<4;l+=1){const i=l===3?1:3;for(let a=0;a<i;a+=1)s[l].push(V(new Date(n+r,0)).format("YYYY-MM-DD")),r+=1}return s}var Ar={yearsList:"m_9206547b",yearsListCell:"m_c5a19c7d"};const Eo={yearsListFormat:"YYYY",withCellSpacing:!0},Jt=u.factory((t,e)=>{const n=u.useProps("YearsList",Eo,t),{classNames:r,className:s,style:l,styles:i,unstyled:a,vars:c,decade:h,yearsListFormat:f,locale:g,minDate:m,maxDate:p,getYearControlProps:y,__staticSelector:k,__getControlRef:A,__onControlKeyDown:I,__onControlClick:F,__onControlMouseEnter:B,__preventFocus:R,__stopPropagation:Y,withCellSpacing:$,size:O,attributes:L,..._}=n,j=u.useStyles({name:k||"YearsList",classes:Ar,props:n,className:s,style:l,classNames:r,styles:i,unstyled:a,attributes:L,vars:c,rootSelector:"yearsList"}),N=lt(),W=Nr(h),E=Oo({years:W,minDate:m,maxDate:p,getYearControlProps:y}),D=W.map((b,v)=>{const P=b.map((C,x)=>{const T=y?.(C),d=V(C).isSame(E,"year");return o.jsx("td",{...j("yearsListCell"),"data-with-spacing":$||void 0,children:o.jsx(Kt,{...j("yearsListControl"),size:O,unstyled:a,"data-mantine-stop-propagation":Y||void 0,disabled:Lr({year:C,minDate:m,maxDate:p}),ref:w=>{w&&A?.(v,x,w)},...T,onKeyDown:w=>{T?.onKeyDown?.(w),I?.(w,{rowIndex:v,cellIndex:x,date:C})},onClick:w=>{T?.onClick?.(w),F?.(w,C)},onMouseEnter:w=>{T?.onMouseEnter?.(w),B?.(w,C)},onMouseDown:w=>{T?.onMouseDown?.(w),R&&w.preventDefault()},tabIndex:R||!d?-1:0,children:T?.children??V(C).locale(N.getLocale(g)).format(f)})},x)});return o.jsx("tr",{...j("yearsListRow"),children:P},v)});return o.jsx(u.Box,{component:"table",ref:e,size:O,...j("yearsList"),..._,children:o.jsx("tbody",{children:D})})});Jt.classes=Ar,Jt.displayName="@mantine/dates/YearsList";function Rr({month:t,minDate:e,maxDate:n}){return!e&&!n?!1:!!(e&&V(t).isBefore(e,"month")||n&&V(t).isAfter(n,"month"))}function Lo({months:t,minDate:e,maxDate:n,getMonthControlProps:r}){const s=t.flat().filter(a=>!Rr({month:a,minDate:e,maxDate:n})&&!r?.(a)?.disabled),l=s.find(a=>r?.(a)?.selected);if(l)return l;const i=s.find(a=>V().isSame(a,"month"));return i||s[0]}function No(t){const e=V(t).startOf("year").toDate(),n=[[],[],[],[]];let r=0;for(let s=0;s<4;s+=1)for(let l=0;l<3;l+=1)n[s].push(V(e).add(r,"months").format("YYYY-MM-DD")),r+=1;return n}var $r={monthsList:"m_2a6c32d",monthsListCell:"m_fe27622f"};const Ao={monthsListFormat:"MMM",withCellSpacing:!0},Zt=u.factory((t,e)=>{const n=u.useProps("MonthsList",Ao,t),{classNames:r,className:s,style:l,styles:i,unstyled:a,vars:c,__staticSelector:h,year:f,monthsListFormat:g,locale:m,minDate:p,maxDate:y,getMonthControlProps:k,__getControlRef:A,__onControlKeyDown:I,__onControlClick:F,__onControlMouseEnter:B,__preventFocus:R,__stopPropagation:Y,withCellSpacing:$,size:O,attributes:L,..._}=n,j=u.useStyles({name:h||"MonthsList",classes:$r,props:n,className:s,style:l,classNames:r,styles:i,unstyled:a,attributes:L,vars:c,rootSelector:"monthsList"}),N=lt(),W=No(f),E=Lo({months:W,minDate:Ae(p),maxDate:Ae(y),getMonthControlProps:k}),D=W.map((b,v)=>{const P=b.map((C,x)=>{const T=k?.(C),d=V(C).isSame(E,"month");return o.jsx("td",{...j("monthsListCell"),"data-with-spacing":$||void 0,children:o.jsx(Kt,{...j("monthsListControl"),size:O,unstyled:a,__staticSelector:h||"MonthsList","data-mantine-stop-propagation":Y||void 0,disabled:Rr({month:C,minDate:Ae(p),maxDate:Ae(y)}),ref:w=>{w&&A?.(v,x,w)},...T,onKeyDown:w=>{T?.onKeyDown?.(w),I?.(w,{rowIndex:v,cellIndex:x,date:C})},onClick:w=>{T?.onClick?.(w),F?.(w,C)},onMouseEnter:w=>{T?.onMouseEnter?.(w),B?.(w,C)},onMouseDown:w=>{T?.onMouseDown?.(w),R&&w.preventDefault()},tabIndex:R||!d?-1:0,children:T?.children??V(C).locale(N.getLocale(m)).format(g)})},x)});return o.jsx("tr",{...j("monthsListRow"),children:P},v)});return o.jsx(u.Box,{component:"table",ref:e,size:O,...j("monthsList"),..._,children:o.jsx("tbody",{children:D})})});Zt.classes=$r,Zt.displayName="@mantine/dates/MonthsList";var Yr={calendarHeader:"m_730a79ed",calendarHeaderLevel:"m_f6645d97",calendarHeaderControl:"m_2351eeb0",calendarHeaderControlIcon:"m_367dc749"};const Ro={hasNextLevel:!0,withNext:!0,withPrevious:!0,headerControlsOrder:["previous","level","next"]},$o=u.createVarsResolver((t,{size:e})=>({calendarHeader:{"--dch-control-size":u.getSize(e,"dch-control-size"),"--dch-fz":u.getFontSize(e)}})),ct=u.factory((t,e)=>{const n=u.useProps("CalendarHeader",Ro,t),{classNames:r,className:s,style:l,styles:i,unstyled:a,vars:c,nextIcon:h,previousIcon:f,nextLabel:g,previousLabel:m,onNext:p,onPrevious:y,onLevelClick:k,label:A,nextDisabled:I,previousDisabled:F,hasNextLevel:B,levelControlAriaLabel:R,withNext:Y,withPrevious:$,headerControlsOrder:O,__staticSelector:L,__preventFocus:_,__stopPropagation:j,attributes:N,...W}=n,E=u.useStyles({name:L||"CalendarHeader",classes:Yr,props:n,className:s,style:l,classNames:r,styles:i,unstyled:a,attributes:N,vars:c,varsResolver:$o,rootSelector:"calendarHeader"}),D=_?x=>x.preventDefault():void 0,b=$&&M.createElement(u.UnstyledButton,{...E("calendarHeaderControl"),key:"previous","data-direction":"previous","aria-label":m,onClick:y,unstyled:a,onMouseDown:D,disabled:F,"data-disabled":F||void 0,tabIndex:_||F?-1:0,"data-mantine-stop-propagation":j||void 0},f||o.jsx(u.AccordionChevron,{...E("calendarHeaderControlIcon"),"data-direction":"previous",size:"45%"})),v=M.createElement(u.UnstyledButton,{component:B?"button":"div",...E("calendarHeaderLevel"),key:"level",onClick:B?k:void 0,unstyled:a,onMouseDown:B?D:void 0,disabled:!B,"data-static":!B||void 0,"aria-label":R,tabIndex:_||!B?-1:0,"data-mantine-stop-propagation":j||void 0},A),P=Y&&M.createElement(u.UnstyledButton,{...E("calendarHeaderControl"),key:"next","data-direction":"next","aria-label":g,onClick:p,unstyled:a,onMouseDown:D,disabled:I,"data-disabled":I||void 0,tabIndex:_||I?-1:0,"data-mantine-stop-propagation":j||void 0},h||o.jsx(u.AccordionChevron,{...E("calendarHeaderControlIcon"),"data-direction":"next",size:"45%"})),C=O.map(x=>x==="previous"?b:x==="level"?v:x==="next"?P:null);return o.jsx(u.Box,{...E("calendarHeader"),ref:e,...W,children:C})});ct.classes=Yr,ct.displayName="@mantine/dates/CalendarHeader";function Yo(t){const e=Nr(t);return[e[0][0],e[3][0]]}const Io={decadeLabelFormat:"YYYY"},Xt=u.factory((t,e)=>{const n=u.useProps("DecadeLevel",Io,t),{decade:r,locale:s,minDate:l,maxDate:i,yearsListFormat:a,getYearControlProps:c,__getControlRef:h,__onControlKeyDown:f,__onControlClick:g,__onControlMouseEnter:m,withCellSpacing:p,__preventFocus:y,nextIcon:k,previousIcon:A,nextLabel:I,previousLabel:F,onNext:B,onPrevious:R,nextDisabled:Y,previousDisabled:$,levelControlAriaLabel:O,withNext:L,withPrevious:_,headerControlsOrder:j,decadeLabelFormat:N,classNames:W,styles:E,unstyled:D,__staticSelector:b,__stopPropagation:v,size:P,attributes:C,...x}=n,T=lt(),[d,w]=Yo(r),S={__staticSelector:b||"DecadeLevel",classNames:W,styles:E,unstyled:D,size:P,attributes:C},z=typeof Y=="boolean"?Y:i?!V(w).endOf("year").isBefore(i):!1,H=typeof $=="boolean"?$:l?!V(d).startOf("year").isAfter(l):!1,Q=(U,G)=>V(U).locale(s||T.locale).format(G);return o.jsxs(u.Box,{"data-decade-level":!0,size:P,ref:e,...x,children:[o.jsx(ct,{label:typeof N=="function"?N(d,w):`${Q(d,N)} – ${Q(w,N)}`,__preventFocus:y,__stopPropagation:v,nextIcon:k,previousIcon:A,nextLabel:I,previousLabel:F,onNext:B,onPrevious:R,nextDisabled:z,previousDisabled:H,hasNextLevel:!1,levelControlAriaLabel:O,withNext:L,withPrevious:_,headerControlsOrder:j,...S}),o.jsx(Jt,{decade:r,locale:s,minDate:l,maxDate:i,yearsListFormat:a,getYearControlProps:c,__getControlRef:h,__onControlKeyDown:f,__onControlClick:g,__onControlMouseEnter:m,__preventFocus:y,__stopPropagation:v,withCellSpacing:p,...S})]})});Xt.classes={...Jt.classes,...ct.classes},Xt.displayName="@mantine/dates/DecadeLevel";const Fo={yearLabelFormat:"YYYY"},en=u.factory((t,e)=>{const n=u.useProps("YearLevel",Fo,t),{year:r,locale:s,minDate:l,maxDate:i,monthsListFormat:a,getMonthControlProps:c,__getControlRef:h,__onControlKeyDown:f,__onControlClick:g,__onControlMouseEnter:m,withCellSpacing:p,__preventFocus:y,nextIcon:k,previousIcon:A,nextLabel:I,previousLabel:F,onNext:B,onPrevious:R,onLevelClick:Y,nextDisabled:$,previousDisabled:O,hasNextLevel:L,levelControlAriaLabel:_,withNext:j,withPrevious:N,headerControlsOrder:W,yearLabelFormat:E,__staticSelector:D,__stopPropagation:b,size:v,classNames:P,styles:C,unstyled:x,attributes:T,...d}=n,w=lt(),S={__staticSelector:D||"YearLevel",classNames:P,styles:C,unstyled:x,size:v,attributes:T},z=typeof $=="boolean"?$:i?!V(r).endOf("year").isBefore(i):!1,H=typeof O=="boolean"?O:l?!V(r).startOf("year").isAfter(l):!1;return o.jsxs(u.Box,{"data-year-level":!0,size:v,ref:e,...d,children:[o.jsx(ct,{label:typeof E=="function"?E(r):V(r).locale(s||w.locale).format(E),__preventFocus:y,__stopPropagation:b,nextIcon:k,previousIcon:A,nextLabel:I,previousLabel:F,onNext:B,onPrevious:R,onLevelClick:Y,nextDisabled:z,previousDisabled:H,hasNextLevel:L,levelControlAriaLabel:_,withNext:j,withPrevious:N,headerControlsOrder:W,...S}),o.jsx(Zt,{year:r,locale:s,minDate:l,maxDate:i,monthsListFormat:a,getMonthControlProps:c,__getControlRef:h,__onControlKeyDown:f,__onControlClick:g,__onControlMouseEnter:m,__preventFocus:y,__stopPropagation:b,withCellSpacing:p,...S})]})});en.classes={...ct.classes,...Zt.classes},en.displayName="@mantine/dates/YearLevel";const Wo={monthLabelFormat:"MMMM YYYY"},tn=u.factory((t,e)=>{const n=u.useProps("MonthLevel",Wo,t),{month:r,locale:s,firstDayOfWeek:l,weekdayFormat:i,weekendDays:a,getDayProps:c,excludeDate:h,minDate:f,maxDate:g,renderDay:m,hideOutsideDates:p,hideWeekdays:y,getDayAriaLabel:k,__getDayRef:A,__onDayKeyDown:I,__onDayClick:F,__onDayMouseEnter:B,withCellSpacing:R,highlightToday:Y,withWeekNumbers:$,__preventFocus:O,__stopPropagation:L,nextIcon:_,previousIcon:j,nextLabel:N,previousLabel:W,onNext:E,onPrevious:D,onLevelClick:b,nextDisabled:v,previousDisabled:P,hasNextLevel:C,levelControlAriaLabel:x,withNext:T,withPrevious:d,headerControlsOrder:w,monthLabelFormat:S,classNames:z,styles:H,unstyled:Q,__staticSelector:U,size:G,static:K,attributes:q,...te}=n,X=lt(),ne={__staticSelector:U||"MonthLevel",classNames:z,styles:H,unstyled:Q,size:G,attributes:q},le=typeof v=="boolean"?v:g?!V(r).endOf("month").isBefore(g):!1,he=typeof P=="boolean"?P:f?!V(r).startOf("month").isAfter(f):!1;return o.jsxs(u.Box,{"data-month-level":!0,size:G,ref:e,...te,children:[o.jsx(ct,{label:typeof S=="function"?S(r):V(r).locale(s||X.locale).format(S),__preventFocus:O,__stopPropagation:L,nextIcon:_,previousIcon:j,nextLabel:N,previousLabel:W,onNext:E,onPrevious:D,onLevelClick:b,nextDisabled:le,previousDisabled:he,hasNextLevel:C,levelControlAriaLabel:x,withNext:T,withPrevious:d,headerControlsOrder:w,...ne}),o.jsx(Qt,{month:r,locale:s,firstDayOfWeek:l,weekdayFormat:i,weekendDays:a,getDayProps:c,excludeDate:h,minDate:f,maxDate:g,renderDay:m,hideOutsideDates:p,hideWeekdays:y,getDayAriaLabel:k,__getDayRef:A,__onDayKeyDown:I,__onDayClick:F,__onDayMouseEnter:B,__preventFocus:O,__stopPropagation:L,static:K,withCellSpacing:R,highlightToday:Y,withWeekNumbers:$,...ne})]})});tn.classes={...Qt.classes,...ct.classes},tn.displayName="@mantine/dates/MonthLevel";var Ir={levelsGroup:"m_30b26e33"};const ut=u.factory((t,e)=>{const n=u.useProps("LevelsGroup",null,t),{classNames:r,className:s,style:l,styles:i,unstyled:a,vars:c,__staticSelector:h,attributes:f,...g}=n,m=u.useStyles({name:h||"LevelsGroup",classes:Ir,props:n,className:s,style:l,classNames:r,styles:i,unstyled:a,attributes:f,vars:c,rootSelector:"levelsGroup"});return o.jsx(u.Box,{ref:e,...m("levelsGroup"),...g})});ut.classes=Ir,ut.displayName="@mantine/dates/LevelsGroup";const zo={numberOfColumns:1},nn=u.factory((t,e)=>{const n=u.useProps("DecadeLevelGroup",zo,t),{decade:r,locale:s,minDate:l,maxDate:i,yearsListFormat:a,getYearControlProps:c,__onControlClick:h,__onControlMouseEnter:f,withCellSpacing:g,__preventFocus:m,nextIcon:p,previousIcon:y,nextLabel:k,previousLabel:A,onNext:I,onPrevious:F,nextDisabled:B,previousDisabled:R,headerControlsOrder:Y,classNames:$,styles:O,unstyled:L,__staticSelector:_,__stopPropagation:j,numberOfColumns:N,levelControlAriaLabel:W,decadeLabelFormat:E,size:D,vars:b,attributes:v,...P}=n,C=M.useRef([]),x=Array(N).fill(0).map((T,d)=>{const w=V(r).add(d*10,"years").format("YYYY-MM-DD");return o.jsx(Xt,{size:D,yearsListFormat:a,decade:w,withNext:d===N-1,withPrevious:d===0,decadeLabelFormat:E,__onControlClick:h,__onControlMouseEnter:f,__onControlKeyDown:(S,z)=>Dn({levelIndex:d,rowIndex:z.rowIndex,cellIndex:z.cellIndex,event:S,controlsRef:C}),__getControlRef:(S,z,H)=>{Array.isArray(C.current[d])||(C.current[d]=[]),Array.isArray(C.current[d][S])||(C.current[d][S]=[]),C.current[d][S][z]=H},levelControlAriaLabel:typeof W=="function"?W(w):W,locale:s,minDate:l,maxDate:i,__preventFocus:m,__stopPropagation:j,nextIcon:p,previousIcon:y,nextLabel:k,previousLabel:A,onNext:I,onPrevious:F,nextDisabled:B,previousDisabled:R,getYearControlProps:c,__staticSelector:_||"DecadeLevelGroup",classNames:$,styles:O,unstyled:L,withCellSpacing:g,headerControlsOrder:Y,attributes:v},d)});return o.jsx(ut,{classNames:$,styles:O,__staticSelector:_||"DecadeLevelGroup",ref:e,size:D,unstyled:L,attributes:v,...P,children:x})});nn.classes={...ut.classes,...Xt.classes},nn.displayName="@mantine/dates/DecadeLevelGroup";const Bo={numberOfColumns:1},rn=u.factory((t,e)=>{const n=u.useProps("YearLevelGroup",Bo,t),{year:r,locale:s,minDate:l,maxDate:i,monthsListFormat:a,getMonthControlProps:c,__onControlClick:h,__onControlMouseEnter:f,withCellSpacing:g,__preventFocus:m,nextIcon:p,previousIcon:y,nextLabel:k,previousLabel:A,onNext:I,onPrevious:F,onLevelClick:B,nextDisabled:R,previousDisabled:Y,hasNextLevel:$,headerControlsOrder:O,classNames:L,styles:_,unstyled:j,__staticSelector:N,__stopPropagation:W,numberOfColumns:E,levelControlAriaLabel:D,yearLabelFormat:b,size:v,vars:P,attributes:C,...x}=n,T=M.useRef([]),d=Array(E).fill(0).map((w,S)=>{const z=V(r).add(S,"years").format("YYYY-MM-DD");return o.jsx(en,{size:v,monthsListFormat:a,year:z,withNext:S===E-1,withPrevious:S===0,yearLabelFormat:b,__stopPropagation:W,__onControlClick:h,__onControlMouseEnter:f,__onControlKeyDown:(H,Q)=>Dn({levelIndex:S,rowIndex:Q.rowIndex,cellIndex:Q.cellIndex,event:H,controlsRef:T}),__getControlRef:(H,Q,U)=>{Array.isArray(T.current[S])||(T.current[S]=[]),Array.isArray(T.current[S][H])||(T.current[S][H]=[]),T.current[S][H][Q]=U},levelControlAriaLabel:typeof D=="function"?D(z):D,locale:s,minDate:l,maxDate:i,__preventFocus:m,nextIcon:p,previousIcon:y,nextLabel:k,previousLabel:A,onNext:I,onPrevious:F,onLevelClick:B,nextDisabled:R,previousDisabled:Y,hasNextLevel:$,getMonthControlProps:c,classNames:L,styles:_,unstyled:j,__staticSelector:N||"YearLevelGroup",withCellSpacing:g,headerControlsOrder:O,attributes:C},S)});return o.jsx(ut,{classNames:L,styles:_,__staticSelector:N||"YearLevelGroup",ref:e,size:v,unstyled:j,attributes:C,...x,children:d})});rn.classes={...en.classes,...ut.classes},rn.displayName="@mantine/dates/YearLevelGroup";const Vo={numberOfColumns:1},sn=u.factory((t,e)=>{const n=u.useProps("MonthLevelGroup",Vo,t),{month:r,locale:s,firstDayOfWeek:l,weekdayFormat:i,weekendDays:a,getDayProps:c,excludeDate:h,minDate:f,maxDate:g,renderDay:m,hideOutsideDates:p,hideWeekdays:y,getDayAriaLabel:k,__onDayClick:A,__onDayMouseEnter:I,withCellSpacing:F,highlightToday:B,withWeekNumbers:R,__preventFocus:Y,nextIcon:$,previousIcon:O,nextLabel:L,previousLabel:_,onNext:j,onPrevious:N,onLevelClick:W,nextDisabled:E,previousDisabled:D,hasNextLevel:b,headerControlsOrder:v,classNames:P,styles:C,unstyled:x,numberOfColumns:T,levelControlAriaLabel:d,monthLabelFormat:w,__staticSelector:S,__stopPropagation:z,size:H,static:Q,vars:U,attributes:G,...K}=n,q=M.useRef([]),te=Array(T).fill(0).map((X,ne)=>{const le=V(r).add(ne,"months").format("YYYY-MM-DD");return o.jsx(tn,{month:le,withNext:ne===T-1,withPrevious:ne===0,monthLabelFormat:w,__stopPropagation:z,__onDayClick:A,__onDayMouseEnter:I,__onDayKeyDown:(he,re)=>Dn({levelIndex:ne,rowIndex:re.rowIndex,cellIndex:re.cellIndex,event:he,controlsRef:q}),__getDayRef:(he,re,_e)=>{Array.isArray(q.current[ne])||(q.current[ne]=[]),Array.isArray(q.current[ne][he])||(q.current[ne][he]=[]),q.current[ne][he][re]=_e},levelControlAriaLabel:typeof d=="function"?d(le):d,locale:s,firstDayOfWeek:l,weekdayFormat:i,weekendDays:a,getDayProps:c,excludeDate:h,minDate:f,maxDate:g,renderDay:m,hideOutsideDates:p,hideWeekdays:y,getDayAriaLabel:k,__preventFocus:Y,nextIcon:$,previousIcon:O,nextLabel:L,previousLabel:_,onNext:j,onPrevious:N,onLevelClick:W,nextDisabled:E,previousDisabled:D,hasNextLevel:b,classNames:P,styles:C,unstyled:x,__staticSelector:S||"MonthLevelGroup",size:H,static:Q,withCellSpacing:F,highlightToday:B,withWeekNumbers:R,headerControlsOrder:v,attributes:G},ne)});return o.jsx(ut,{classNames:P,styles:C,__staticSelector:S||"MonthLevelGroup",ref:e,size:H,attributes:G,...K,children:te})});sn.classes={...ut.classes,...tn.classes},sn.displayName="@mantine/dates/MonthLevelGroup";const Fr=t=>t==="range"?[null,null]:t==="multiple"?[]:null,Wr=(t,e)=>{const n=e?wr:Ae;return Array.isArray(t)?t.map(n):n(t)};function Pn({type:t,value:e,defaultValue:n,onChange:r,withTime:s=!1}){const l=M.useRef(t),[i,a,c]=De.useUncontrolled({value:Wr(e,s),defaultValue:Wr(n,s),finalValue:Fr(t),onChange:r});let h=i;return l.current!==t&&(l.current=t,e===void 0&&(h=n!==void 0?n:Fr(t),a(h))),[h,a,c]}function Mn(t,e){return t?t==="month"?0:t==="year"?1:2:e||0}function Ho(t){return t===0?"month":t===1?"year":"decade"}function $t(t,e,n){return Ho(De.clamp(Mn(t,0),Mn(e,0),Mn(n,2)))}const Uo={maxLevel:"decade",minLevel:"month",__updateDateOnYearSelect:!0,__updateDateOnMonthSelect:!0,enableKeyboardNavigation:!0},on=u.factory((t,e)=>{const n=u.useProps("Calendar",Uo,t),{vars:r,maxLevel:s,minLevel:l,defaultLevel:i,level:a,onLevelChange:c,date:h,defaultDate:f,onDateChange:g,numberOfColumns:m,columnsToScroll:p,ariaLabels:y,nextLabel:k,previousLabel:A,onYearSelect:I,onMonthSelect:F,onYearMouseEnter:B,onMonthMouseEnter:R,headerControlsOrder:Y,__updateDateOnYearSelect:$,__updateDateOnMonthSelect:O,__setDateRef:L,__setLevelRef:_,firstDayOfWeek:j,weekdayFormat:N,weekendDays:W,getDayProps:E,excludeDate:D,renderDay:b,hideOutsideDates:v,hideWeekdays:P,getDayAriaLabel:C,monthLabelFormat:x,nextIcon:T,previousIcon:d,__onDayClick:w,__onDayMouseEnter:S,withCellSpacing:z,highlightToday:H,withWeekNumbers:Q,monthsListFormat:U,getMonthControlProps:G,yearLabelFormat:K,yearsListFormat:q,getYearControlProps:te,decadeLabelFormat:X,classNames:ne,styles:le,unstyled:he,minDate:re,maxDate:_e,locale:pe,__staticSelector:Te,size:je,__preventFocus:nt,__stopPropagation:Re,onNextDecade:Je,onPreviousDecade:$e,onNextYear:Ye,onPreviousYear:Ze,onNextMonth:J,onPreviousMonth:ge,static:fe,enableKeyboardNavigation:rt,attributes:ie,...Oe}=n,{resolvedClassNames:dt,resolvedStyles:ht}=u.useResolvedStylesApi({classNames:ne,styles:le,props:n}),[qe,Ie]=De.useUncontrolled({value:a?$t(a,l,s):void 0,defaultValue:i?$t(i,l,s):void 0,finalValue:$t(void 0,l,s),onChange:c}),[xt,ve]=Pn({type:"default",value:Ae(h),defaultValue:Ae(f),onChange:g});M.useImperativeHandle(L,()=>Z=>{ve(Z)}),M.useImperativeHandle(_,()=>Z=>{Ie(Z)});const st={__staticSelector:Te||"Calendar",styles:ht,classNames:dt,unstyled:he,size:je,attributes:ie},Ee=p||m||1,ot=new Date,Ct=re&&V(ot).isAfter(re)?re:V(ot).format("YYYY-MM-DD"),xe=xt||Ct,St=()=>{const Z=V(xe).add(Ee,"month").format("YYYY-MM-DD");J?.(Z),ve(Z)},Pe=()=>{const Z=V(xe).subtract(Ee,"month").format("YYYY-MM-DD");ge?.(Z),ve(Z)},at=()=>{const Z=V(xe).add(Ee,"year").format("YYYY-MM-DD");Ye?.(Z),ve(Z)},Fe=()=>{const Z=V(xe).subtract(Ee,"year").format("YYYY-MM-DD");Ze?.(Z),ve(Z)},Xe=()=>{const Z=V(xe).add(10*Ee,"year").format("YYYY-MM-DD");Je?.(Z),ve(Z)},We=()=>{const Z=V(xe).subtract(10*Ee,"year").format("YYYY-MM-DD");$e?.(Z),ve(Z)},Ge=M.useRef(null);M.useEffect(()=>{if(!rt||fe)return;const Z=ce=>{if(!Ge.current?.contains(document.activeElement))return;const Le=ce.ctrlKey||ce.metaKey,Qe=ce.shiftKey;switch(ce.key){case"ArrowUp":Le&&Qe?(ce.preventDefault(),We()):Le&&(ce.preventDefault(),Fe());break;case"ArrowDown":Le&&Qe?(ce.preventDefault(),Xe()):Le&&(ce.preventDefault(),at());break;case"y":case"Y":qe==="month"&&(ce.preventDefault(),Ie("year"));break}};return document.addEventListener("keydown",Z),()=>{document.removeEventListener("keydown",Z)}},[rt,fe,qe,at,Fe,Xe,We]);const et=Z=>{Ge.current=Z,typeof e=="function"?e(Z):e&&(e.current=Z)};return o.jsxs(u.Box,{ref:et,size:je,"data-calendar":!0,...Oe,children:[qe==="month"&&o.jsx(sn,{month:xe,minDate:re,maxDate:_e,firstDayOfWeek:j,weekdayFormat:N,weekendDays:W,getDayProps:E,excludeDate:D,renderDay:b,hideOutsideDates:v,hideWeekdays:P,getDayAriaLabel:C,onNext:St,onPrevious:Pe,hasNextLevel:s!=="month",onLevelClick:()=>Ie("year"),numberOfColumns:m,locale:pe,levelControlAriaLabel:y?.monthLevelControl,nextLabel:y?.nextMonth??k,nextIcon:T,previousLabel:y?.previousMonth??A,previousIcon:d,monthLabelFormat:x,__onDayClick:w,__onDayMouseEnter:S,__preventFocus:nt,__stopPropagation:Re,static:fe,withCellSpacing:z,highlightToday:H,withWeekNumbers:Q,headerControlsOrder:Y,...st}),qe==="year"&&o.jsx(rn,{year:xe,numberOfColumns:m,minDate:re,maxDate:_e,monthsListFormat:U,getMonthControlProps:G,locale:pe,onNext:at,onPrevious:Fe,hasNextLevel:s!=="month"&&s!=="year",onLevelClick:()=>Ie("decade"),levelControlAriaLabel:y?.yearLevelControl,nextLabel:y?.nextYear??k,nextIcon:T,previousLabel:y?.previousYear??A,previousIcon:d,yearLabelFormat:K,__onControlMouseEnter:R,__onControlClick:(Z,ce)=>{O&&ve(ce),Ie($t("month",l,s)),F?.(ce)},__preventFocus:nt,__stopPropagation:Re,withCellSpacing:z,headerControlsOrder:Y,...st}),qe==="decade"&&o.jsx(nn,{decade:xe,minDate:re,maxDate:_e,yearsListFormat:q,getYearControlProps:te,locale:pe,onNext:Xe,onPrevious:We,numberOfColumns:m,nextLabel:y?.nextDecade??k,nextIcon:T,previousLabel:y?.previousDecade??A,previousIcon:d,decadeLabelFormat:X,__onControlMouseEnter:B,__onControlClick:(Z,ce)=>{$&&ve(ce),Ie($t("year",l,s)),I?.(ce)},__preventFocus:nt,__stopPropagation:Re,withCellSpacing:z,headerControlsOrder:Y,...st})]})});on.classes={...nn.classes,...rn.classes,...sn.classes},on.displayName="@mantine/dates/Calendar";function qo(t){const{maxLevel:e,minLevel:n,defaultLevel:r,level:s,onLevelChange:l,nextIcon:i,previousIcon:a,date:c,defaultDate:h,onDateChange:f,numberOfColumns:g,columnsToScroll:m,ariaLabels:p,nextLabel:y,previousLabel:k,onYearSelect:A,onMonthSelect:I,onYearMouseEnter:F,onMonthMouseEnter:B,onNextMonth:R,onPreviousMonth:Y,onNextYear:$,onPreviousYear:O,onNextDecade:L,onPreviousDecade:_,withCellSpacing:j,highlightToday:N,__updateDateOnYearSelect:W,__updateDateOnMonthSelect:E,__setDateRef:D,__setLevelRef:b,withWeekNumbers:v,headerControlsOrder:P,firstDayOfWeek:C,weekdayFormat:x,weekendDays:T,getDayProps:d,excludeDate:w,renderDay:S,hideOutsideDates:z,hideWeekdays:H,getDayAriaLabel:Q,monthLabelFormat:U,monthsListFormat:G,getMonthControlProps:K,yearLabelFormat:q,yearsListFormat:te,getYearControlProps:X,decadeLabelFormat:ne,allowSingleDateInRange:le,allowDeselect:he,minDate:re,maxDate:_e,locale:pe,...Te}=t;return{calendarProps:{maxLevel:e,minLevel:n,defaultLevel:r,level:s,onLevelChange:l,nextIcon:i,previousIcon:a,date:c,defaultDate:h,onDateChange:f,numberOfColumns:g,columnsToScroll:m,ariaLabels:p,nextLabel:y,previousLabel:k,onYearSelect:A,onMonthSelect:I,onYearMouseEnter:F,onMonthMouseEnter:B,onNextMonth:R,onPreviousMonth:Y,onNextYear:$,onPreviousYear:O,onNextDecade:L,onPreviousDecade:_,withCellSpacing:j,highlightToday:N,__updateDateOnYearSelect:W,__updateDateOnMonthSelect:E,__setDateRef:D,withWeekNumbers:v,headerControlsOrder:P,firstDayOfWeek:C,weekdayFormat:x,weekendDays:T,getDayProps:d,excludeDate:w,renderDay:S,hideOutsideDates:z,hideWeekdays:H,getDayAriaLabel:Q,monthLabelFormat:U,monthsListFormat:G,getMonthControlProps:K,yearLabelFormat:q,yearsListFormat:te,getYearControlProps:X,decadeLabelFormat:ne,allowSingleDateInRange:le,allowDeselect:he,minDate:re,maxDate:_e,locale:pe},others:Te}}function Go(t){if(t===null)return null;const e=new Date(t);return Number.isNaN(e.getTime())||!t?null:V(e).format("YYYY-MM-DD")}function Qo({date:t,maxDate:e,minDate:n}){return!(t==null||Number.isNaN(new Date(t).getTime())||e&&V(t).isAfter(e,"date")||n&&V(t).isBefore(n,"date"))}const Ko={valueFormat:"MMMM D, YYYY",fixOnBlur:!0,size:"sm"},an=u.factory((t,e)=>{const n=u.useInputProps("DateInput",Ko,t),{inputProps:r,wrapperProps:s,value:l,defaultValue:i,onChange:a,clearable:c,clearButtonProps:h,popoverProps:f,getDayProps:g,locale:m,valueFormat:p,dateParser:y,minDate:k,maxDate:A,fixOnBlur:I,onFocus:F,onBlur:B,onClick:R,onKeyDown:Y,readOnly:$,name:O,form:L,rightSection:_,unstyled:j,classNames:N,styles:W,allowDeselect:E,date:D,defaultDate:b,onDateChange:v,getMonthControlProps:P,getYearControlProps:C,disabled:x,...T}=n,d=M.useRef(null),w=M.useRef(null),[S,z]=M.useState(!1),{calendarProps:H,others:Q}=qo(T),U=lt(),K=y||(J=>{const ge=V(J,p,U.getLocale(m)).toDate();return Number.isNaN(ge.getTime())?Go(J):V(ge).format("YYYY-MM-DD")}),q=E!==void 0?E:c,te=J=>J?V(J).locale(U.getLocale(m)).format(p):"",[X,ne,le]=Pn({type:"default",value:l,defaultValue:i,onChange:a}),[he,re]=Pn({type:"default",value:D,defaultValue:i||b,onChange:v});M.useEffect(()=>{le&&l!==null&&re(l)},[le,l]);const[_e,pe]=M.useState(te(X));M.useEffect(()=>{pe(te(X))},[U.getLocale(m)]);const Te=J=>{const ge=J.currentTarget.value;if(pe(ge),z(!0),ge.trim()===""&&(E||c))ne(null);else{const fe=K(ge);fe&&Qo({date:fe,minDate:k,maxDate:A})&&(ne(fe),re(fe))}},je=J=>{B?.(J),z(!1),I&&pe(te(X))},nt=J=>{F?.(J),z(!0)},Re=J=>{R?.(J),z(!0)},Je=J=>{J.key==="Escape"&&z(!1),Y?.(J)},$e=J=>({...g?.(J),selected:V(X).isSame(J,"day"),onClick:ge=>{g?.(J).onClick?.(ge);const fe=q&&V(X).isSame(J,"day")?null:J;ne(fe),!le&&fe&&pe(te(fe)),z(!1)}}),Ye=o.jsx(u.Input.ClearButton,{onClick:()=>{ne(null),!le&&pe(""),z(!1)},unstyled:j,...h}),Ze=c&&!!X&&!$&&!x;return De.useDidUpdate(()=>{X!==void 0&&!S&&pe(te(X))},[X]),De.useClickOutside(()=>z(!1),void 0,[d.current,w.current]),o.jsxs(o.Fragment,{children:[o.jsx(u.Input.Wrapper,{...s,__staticSelector:"DateInput",ref:d,children:o.jsxs(u.Popover,{opened:S,trapFocus:!1,position:"bottom-start",disabled:$||x,withRoles:!1,unstyled:j,...f,children:[o.jsx(u.Popover.Target,{children:o.jsx(u.Input,{"data-dates-input":!0,"data-read-only":$||void 0,autoComplete:"off",ref:e,value:_e,onChange:Te,onBlur:je,onFocus:nt,onClick:Re,onKeyDown:Je,readOnly:$,rightSection:_,__clearSection:Ye,__clearable:Ze,...r,...Q,disabled:x,__staticSelector:"DateInput"})}),o.jsx(u.Popover.Dropdown,{onMouseDown:J=>J.preventDefault(),"data-dates-dropdown":!0,ref:w,children:o.jsx(on,{__staticSelector:"DateInput",...H,classNames:N,styles:W,unstyled:j,__preventFocus:!0,minDate:k,maxDate:A,locale:m,getDayProps:$e,size:r.size,date:he,onDateChange:re,getMonthControlProps:J=>({selected:typeof X=="string"?jn(J,X):!1,...P?.(J)}),getYearControlProps:J=>({selected:typeof X=="string"?V(J).isSame(X,"year"):!1,...C?.(J)}),attributes:s.attributes})})]})}),o.jsx(Dr,{name:O,form:L,value:X,type:"default"})]})});an.classes={...u.Input.classes,...on.classes},an.displayName="@mantine/dates/DateInput";function zr(t){const e=Me.c(49),{fields:n,onClose:r,queryKey:s,apiPath:l,steps:i,onCreated:a}=t,[c,h]=M.useState(0),[f,g]=M.useState(!1),[m,p]=M.useState(),{mutateAsync:y,isError:k,error:A,isPending:I}=vr(l,s),{mutateAsync:F,isPending:B}=wn(l,s),R=I||B;let Y;e[0]!==n?(Y=new Set(n.filter(ta).map(ea)),e[0]=n,e[1]=Y):Y=e[1];let $;e[2]!==Y?($=[...Y],e[2]=Y,e[3]=$):$=e[3];const O=$;let L;e[4]===Symbol.for("react.memo_cache_sentinel")?(L=function(S,z){return typeof S.required=="function"?S.required(z??{}):!!S.required},e[4]=L):L=e[4];const _=L;let j;e[5]!==n?(j=n.reduce(Xo,{}),e[5]=n,e[6]=j):j=e[6];let N;if(e[7]!==n){let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=(S,z)=>(S[z.id]=(H,Q)=>z.conditional&&!z.conditional(Q)||!_(z,Q)||H?null:"Pflichtfeld",S),e[9]=w):w=e[9],N=n.filter(Zo).reduce(w,{}),e[7]=n,e[8]=N}else N=e[8];let W;e[10]!==j||e[11]!==N?(W={mode:"uncontrolled",initialValues:j,validate:N},e[10]=j,e[11]=N,e[12]=W):W=e[12];const E=Vn.useForm(W);let D;e[13]!==E||e[14]!==m?(D=function(S){const z=E.getValues();if(S.conditional&&!S.conditional(z))return null;const H=_(S,z);return o.jsxs(M.Fragment,{children:[(S.type===void 0||S.type=="text")&&o.jsx(u.TextInput,{label:S.column.title,placeholder:S.placeholder??"",...E.getInputProps(S.id),type:S.id.includes("email")?"email":void 0,required:H},E.key(S.id)),S.type==="number"&&o.jsx(u.NumberInput,{decimalSeparator:",",label:S.column.title,placeholder:S.placeholder??"",...E.getInputProps(S.id),required:H},E.key(S.id)),S.type==="date"&&o.jsx(an,{label:S.column.title,placeholder:S.placeholder??"",valueFormat:"DD.MM.YYYY",clearable:!0,...E.getInputProps(S.id),required:H},E.key(S.id)),S.type==="boolean"&&o.jsx(u.Checkbox,{mt:"md",label:S.column.title,...E.getInputProps(S.id,{type:"checkbox"}),required:H},E.key(S.id)),S.type==="textarea"&&o.jsx(u.Textarea,{label:S.column.title,placeholder:S.placeholder??"",...E.getInputProps(S.id),minRows:3,autosize:!0,required:H},E.key(S.id)),S.type==="custom"&&S.render&&S.render({...E.getValues(),...m&&{id:m}},E.setValues,g,{error:E.getInputProps(S.id).error,required:H})]},S.id)},e[13]=E,e[14]=m,e[15]=D):D=e[15];const b=D;let v;e[16]!==A?.message||e[17]!==A?.name||e[18]!==k?(v=k&&o.jsx(u.Alert,{variant:"outline",color:"red",title:A?.name??"Fehler aufgetreten",mb:"lg",children:A?.message??"Fehler aufgetreten"}),e[16]=A?.message,e[17]=A?.name,e[18]=k,e[19]=v):v=e[19];let P;e[20]!==c||e[21]!==y||e[22]!==E||e[23]!==k||e[24]!==r||e[25]!==a||e[26]!==m||e[27]!==O.length||e[28]!==F?(P=E.onSubmit(async w=>{const S=Object.fromEntries(Object.entries(w).map(Jo));if(m)await F({...S,id:m});else{const z=await y(S);p(z.id),a?.(z.id)}O.length&&c<O.length-1?k||h(c+1):k||(E.setInitialValues(S),E.reset(),r())}),e[20]=c,e[21]=y,e[22]=E,e[23]=k,e[24]=r,e[25]=a,e[26]=m,e[27]=O.length,e[28]=F,e[29]=P):P=e[29];let C;e[30]!==c||e[31]!==n||e[32]!==b||e[33]!==i||e[34]!==O?(C=O.length?o.jsx(u.Stepper,{active:c,size:"sm",children:O.map(w=>o.jsx(u.Stepper.Step,{...i&&i[w-1]?{label:i[w-1].label}:{},children:n.filter(S=>S.step===w).map(S=>b(S))},w))}):n.map(w=>b(w)),e[30]=c,e[31]=n,e[32]=b,e[33]=i,e[34]=O,e[35]=C):C=e[35];let x;e[36]!==c||e[37]!==f||e[38]!==R||e[39]!==r||e[40]!==O.length?(x=!f&&o.jsxs(u.Group,{mt:"md",justify:"end",children:[o.jsx(u.Button,{onClick:()=>O.length?c===0?r():h(c-1):r(),variant:"outline",children:O.length?c===0?"Abbrechen":"Zurück":"Abbrechen"}),o.jsx(u.Button,{type:"submit",loading:R,children:O.length?c===O.length-1?"Speichern":"Weiter":"Speichern"})]}),e[36]=c,e[37]=f,e[38]=R,e[39]=r,e[40]=O.length,e[41]=x):x=e[41];let T;e[42]!==C||e[43]!==x||e[44]!==P?(T=o.jsxs("form",{onSubmit:P,children:[C,x]}),e[42]=C,e[43]=x,e[44]=P,e[45]=T):T=e[45];let d;return e[46]!==T||e[47]!==v?(d=o.jsxs(o.Fragment,{children:[v,T]}),e[46]=T,e[47]=v,e[48]=d):d=e[48],d}function Jo(t){const[e,n]=t;return[e,n===""?void 0:n]}function Zo(t){return t.required}function Xo(t,e){return t[e.id]=e.type==="boolean"?!1:e.defaultValue??"",t}function ea(t){return t.step}function ta(t){return typeof t.step=="number"}var[na,Tn]=u.createSafeContext("useDataTableColumnsContext must be used within DataTableColumnProvider"),Br=t=>{let{children:e,columnsOrder:n,setColumnsOrder:r,columnsToggle:s,setColumnsToggle:l,resetColumnsOrder:i,resetColumnsToggle:a,setColumnWidth:c,setMultipleColumnWidths:h,resetColumnsWidth:f}=t,[g,m]=M.useState(""),[p,y]=M.useState("");return o.jsx(na,{value:{sourceColumn:g,setSourceColumn:m,targetColumn:p,setTargetColumn:y,columnsToggle:s,setColumnsToggle:l,swapColumns:()=>{if(!n||!r||!g||!p)return;let k=n.indexOf(g),A=n.indexOf(p);if(k!==-1&&A!==-1){let I=n.splice(k,1)[0];n.splice(A,0,I),r([...n])}},resetColumnsOrder:i,resetColumnsToggle:a,setColumnWidth:c,setMultipleColumnWidths:h,resetColumnsWidth:f},children:e})};function ra(){return o.jsx("tr",{className:"mantine-datatable-empty-row",children:o.jsx("td",{})})}function sa(){return o.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),o.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"}),o.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"}),o.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"}),o.jsx("path",{d:"M3 3l18 18"})]})}function oa({icon:t,text:e,active:n,children:r}){return o.jsx(u.Center,{className:"mantine-datatable-empty-state","data-active":n||void 0,children:r||o.jsxs(o.Fragment,{children:[t||o.jsx("div",{className:"mantine-datatable-empty-state-icon",children:o.jsx(sa,{})}),o.jsx(u.Text,{component:"div",size:"sm",c:"dimmed",children:e})]})})}function aa({key:t,columns:e=[],getInitialValueInEffect:n=!0}){function r(g,m){let p=[];return g.forEach(y=>{m.find(k=>k.accessor===y)&&p.push(y)}),m.forEach(y=>{p.includes(y.accessor)||p.push(y.accessor)}),p}let s=e&&e.map(g=>g.accessor)||[],[l,i]=De.useLocalStorage({key:t?`${t}-columns-order`:"",defaultValue:t?s:void 0,getInitialValueInEffect:n});function a(g){t&&i(g)}let c=()=>{a(s)};if(!t)return{columnsOrder:l,setColumnsOrder:a,resetColumnsOrder:c};let h=r(l,e),f=JSON.stringify(l);return JSON.stringify(h)!==f&&a(h),{columnsOrder:h,setColumnsOrder:a,resetColumnsOrder:c}}function ia({key:t,columns:e=[],getInitialValueInEffect:n=!0,headerRef:r,onFixedLayoutChange:s}){let l=M.useRef(!1),i=M.useRef({}),[a,c]=M.useState(!0),h=M.useMemo(()=>e.some(_=>_.resizable&&!_.hidden&&_.accessor!=="__selection__"),[e]),f=M.useMemo(()=>e.filter(_=>_.resizable&&!_.hidden&&_.accessor!=="__selection__"),[e]),g=M.useMemo(()=>f.some(_=>_.width===void 0||_.width===""||_.width==="initial"),[f]),m=M.useCallback(()=>e.filter(_=>_.accessor!=="__selection__").map(_=>({[_.accessor]:_.width??"auto"})),[e]),[p,y]=De.useLocalStorage({key:t?`${t}-columns-width`:"",defaultValue:t?m():void 0,getInitialValueInEffect:!1}),[k,A]=M.useState(()=>m());M.useEffect(()=>{c(!1)},[]);let I=M.useCallback(()=>{if(!r?.current||a)return{};let _=r.current,j=Array.from(_.querySelectorAll("th[data-accessor]")),N={};return j.forEach(W=>{let E=W.getAttribute("data-accessor");if(!E||E==="__selection__")return;let D=f.find(b=>b.accessor===E);if(D&&(D.width===void 0||D.width===""||D.width==="initial")){let b=W.getBoundingClientRect();N[E]=Math.round(b.width)}}),N},[r,f,a]),F=M.useCallback(_=>{let j=_.filter(W=>W.accessor!=="__selection__"),N=k.map(W=>{let E=Object.keys(W)[0],D=j.find(b=>b.accessor===E);return D?{[E]:D.width}:W});A(N),t&&y(N)},[k,t,y]),B=M.useCallback(_=>{F(_)},[F]),R=M.useCallback(()=>{if(!(!r?.current||!s||a))if(g)s(!1),requestAnimationFrame(()=>{requestAnimationFrame(()=>{let _=I();i.current={...i.current,..._};let j=e.filter(N=>N.accessor!=="__selection__").map(N=>{let W=N.accessor,E=p?.find(b=>Object.keys(b)[0]===W);if(E&&E[W]!=="auto")return{[W]:E[W]};let D=_[W];return D?{[W]:`${D}px`}:{[W]:N.width??"auto"}});A(j),setTimeout(()=>{s(!0),l.current=!0},10)})});else{let _=e.filter(j=>j.accessor!=="__selection__").map(j=>({[j.accessor]:j.width??"auto"}));A(_),s(!0),l.current=!0}},[r,s,a,g,I,e,p]),Y=R;M.useEffect(()=>{if(!h||!s||a){s?.(!1);return}l.current=!1;let _=setTimeout(()=>{R()},50);return()=>clearTimeout(_)},[h,s,a,R]),M.useEffect(()=>{a||!t||!n||p&&p.length>0&&A(p)},[a,t,n,p]);let $=M.useCallback(()=>{t&&y(m()),i.current={},l.current=!1,s&&(s(!1),setTimeout(()=>{R()},10))},[t,y,m,s,R]),O=M.useCallback((_,j)=>{F([{accessor:_,width:j}])},[F]),L=M.useMemo(()=>h?k.filter(_=>{let j=Object.keys(_)[0];return f.some(N=>N.accessor===j)}).every(_=>{let j=Object.values(_)[0];return j==="auto"||j==="initial"}):!1,[h,k,f]);return{columnsWidth:k,setColumnsWidth:F,setColumnWidth:O,setMultipleColumnWidths:B,resetColumnsWidth:$,hasResizableColumns:h,allResizableWidthsInitial:L,measureAndSetColumnWidths:Y}}function la({key:t,columns:e=[],getInitialValueInEffect:n=!0}){function r(g,m){let p=[];return g.forEach(y=>{m.find(k=>k.accessor===y.accessor)&&p.push(y)}),m.forEach(y=>{p.find(k=>k.accessor===y.accessor)||p.push({accessor:y.accessor,defaultToggle:y.defaultToggle||!0,toggleable:y.toggleable,toggled:y.defaultToggle===void 0?!0:y.defaultToggle})}),p}let s=e&&e.map(g=>({accessor:g.accessor,defaultToggle:g.defaultToggle||!0,toggleable:g.toggleable,toggled:g.defaultToggle===void 0?!0:g.defaultToggle})),[l,i]=De.useLocalStorage({key:t?`${t}-columns-toggle`:"",defaultValue:t?s:void 0,getInitialValueInEffect:n});function a(g){t&&i(g)}let c=()=>{a(s)};if(!t)return{columnsToggle:l,setColumnsToggle:a,resetColumnsToggle:c};let h=r(l,e),f=JSON.stringify(l);return JSON.stringify(h)!==f&&a(h),{columnsToggle:h,setColumnsToggle:a,resetColumnsToggle:c}}var ca=({key:t,columns:e=[],getInitialValueInEffect:n=!0,headerRef:r,scrollViewportRef:s,onFixedLayoutChange:l})=>{let{columnsOrder:i,setColumnsOrder:a,resetColumnsOrder:c}=aa({key:t,columns:e,getInitialValueInEffect:n}),{columnsToggle:h,setColumnsToggle:f,resetColumnsToggle:g}=la({key:t,columns:e,getInitialValueInEffect:n}),{columnsWidth:m,setColumnsWidth:p,setColumnWidth:y,setMultipleColumnWidths:k,resetColumnsWidth:A,hasResizableColumns:I,allResizableWidthsInitial:F,measureAndSetColumnWidths:B}=ia({key:t,columns:e,getInitialValueInEffect:n,headerRef:r,onFixedLayoutChange:l});return{effectiveColumns:M.useMemo(()=>i?i.map(R=>e.find(Y=>Y.accessor===R)).map(R=>({...R,hidden:R?.hidden||!h.find(Y=>Y.accessor===R?.accessor)?.toggled})).map(R=>R?.accessor==="__selection__"?R:{...R,width:m.find(Y=>Y[R?.accessor])?.[R?.accessor]}):e,[e,i,h,m]),setColumnsOrder:a,columnsOrder:i,resetColumnsOrder:c,columnsToggle:h,setColumnsToggle:f,resetColumnsToggle:g,columnsWidth:m,setColumnsWidth:p,setColumnWidth:y,setMultipleColumnWidths:k,resetColumnsWidth:A,hasResizableColumns:I,allResizableWidthsInitial:F,measureAndSetColumnWidths:B}},Vr=typeof window<"u"?M.useLayoutEffect:M.useEffect;function Hr(t){let e=M.useRef(t);return e.current=t,e}var Ur="--mantine-datatable-header-height",qr="--mantine-datatable-footer-height",Gr="--mantine-datatable-selection-column-width",Qr="--mantine-datatable-last-row-border-bottom";function Ue(t,e,n){t?.style.setProperty(e,n)}function On(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 En(t,e,n){if(t){let r=new ResizeObserver(s=>{let l=s[0];l&&e(On(l))});return r.observe(t),()=>{r.disconnect(),n()}}}function ua({scrollCallbacks:t,withRowBorders:e}){let n={root:M.useRef(null),table:M.useRef(null),scrollViewport:M.useRef(null),header:M.useRef(null),footer:M.useRef(null),selectionColumnHeader:M.useRef(null)},{root:r,table:s,scrollViewport:l,header:i,footer:a,selectionColumnHeader:c}=n,h=Hr({withRowBorders:e}),f=Hr(t),g=M.useRef(()=>{}),m=M.useRef(()=>{}),p=M.useCallback(y=>{f.current.onScroll?.(y),g.current()},[]);return M.useEffect(()=>En(i.current,y=>{Ue(r.current,Ur,`${y.height}px`)},()=>Ue(r.current,Ur,"0")),[i.current]),M.useEffect(()=>En(a.current,y=>{Ue(r.current,qr,`${y.height}px`)},()=>Ue(r.current,qr,"0")),[a.current]),M.useEffect(()=>En(c.current,y=>{Ue(r.current,Gr,`${y.width}px`)},()=>Ue(r.current,Gr,"0")),[c.current]),Vr(()=>{if(typeof window===void 0)return;let y={top:!0,bottom:!0,left:!0,right:!0},k={width:0,height:0},A={width:0,height:0};function I($,O){let L=y[$];return y[$]=O,Ue(r.current,`--mantine-datatable-${$}-shadow-opacity`,O?"0":"1"),L}function F(){let $=k.height-A.height,O=$<0;Ue(r.current,"--mantine-datatable-footer-position",O?"relative":"sticky"),Ue(r.current,"--mantine-datatable-footer-bottom",O?`${$}px`:"0")}function B(){h.current.withRowBorders&&k.height<A.height?Ue(r.current,Qr,`${u.rem("1px")} solid var(--mantine-datatable-border-color)`):Ue(r.current,Qr,"unset")}m.current=B;function R(){let $=f.current,O=l.current,L=O?.scrollTop??0,_=O?.scrollLeft??0,j=L===0,N=k.height-L-A.height<1,W=I("top",j),E=I("bottom",N);j&&j!==W&&$.onScrollToTop?.(),N&&N!==E&&$.onScrollToBottom?.();let D=O?getComputedStyle(O).direction==="rtl":!1,b=(O?.scrollWidth??0)-A.width,v,P;if(D){let T=Math.abs(_);P=T<1,v=b-T<1}else v=_<1,P=k.width-_-A.width<1;let C=I("left",v),x=I("right",P);v&&v!==C&&$.onScrollToLeft?.(),P&&P!==x&&$.onScrollToRight?.()}g.current=R;let Y=new ResizeObserver($=>{for(let O of $)switch(O.target.tagName){case"TABLE":{k=On(O);break}case"DIV":{A=On(O);break}}R(),F(),B()});return Y.observe(s.current),Y.observe(l.current),()=>{Y.disconnect()}},[]),Vr(()=>{m.current()},[e]),{refs:n,onScroll:p}}function da(t){let[e,n]=M.useState(null),r=t?.join(":")||"";return M.useEffect(()=>{n(null)},[r]),{lastSelectionChangeIndex:e,setLastSelectionChangeIndex:n}}function ha(t,e){let n=()=>{e(t.map(s=>s.matches))},r=t.map(s=>{try{return s.addEventListener("change",n),()=>s.removeEventListener("change",n)}catch{return s.addListener(n),()=>s.removeListener(n)}});return()=>{r.forEach(s=>s())}}function fa(t,e){return e||(typeof window<"u"&&"matchMedia"in window?t.map(n=>window.matchMedia(n).matches):t.map(()=>!1))}function ma(t,e,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){let[r,s]=M.useState(n?e:fa(t,e)),l=M.useRef(null);return M.useEffect(()=>{if("matchMedia"in window)return l.current=t.map(i=>window.matchMedia(i)),s(l.current.map(i=>i.matches)),ha(l.current,i=>{s(i)})},[t]),r}function pa(t){let e=u.useMantineTheme(),n=M.useMemo(()=>t.map(s=>(typeof s=="function"?s(e):s)??""),[t,e]),r=M.useMemo(()=>t.map(()=>!0),[t]);return ma(n,r)}function ln(t){let e=u.useMantineTheme(),n=typeof t=="function"?t(e):t;return De.useMediaQuery(n||"",!0)}function Ln(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 ga(t,e,n){return t.filter(r=>!e.map(n).includes(n(r)))}function Nn(t,e){return t.filter((n,r,s)=>r===s.findIndex(l=>e(n)===e(l)))}function Kr(t,e){return e?e.match(/([^[.\]])+/g).reduce((n,r)=>n&&n[r],t):void 0}function ke(t,e){return typeof e=="string"?Kr(t,e):e(t)}function Jr(t){return!t||t.length===0?0:Math.max(...t.map(e=>e.groups&&e.groups.length>0?1+Jr(e.groups):1))}function An(t){let e=[];for(let n of t)n.columns&&n.columns.length>0?e.push(...n.columns.filter(r=>r!=null)):n.groups&&n.groups.length>0&&e.push(...An(n.groups));return e.filter(n=>n!=null)}function Rn(t,e){return t.columns&&t.columns.length>0?t.columns.filter((n,r)=>n.hidden?!1:e?e[r]!==!1:!0).length:t.groups&&t.groups.length>0?t.groups.reduce((n,r)=>n+Rn(r,e),0):0}function Zr(t,e,n=0){if(n===e)return[...t];let r=[];for(let s of t)s.groups&&s.groups.length>0&&r.push(...Zr(s.groups,e,n+1));return r}function ba(t,e,n){return n?!t||e:!1}function ya({rowExpansion:t,records:e,idAccessor:n}){let r=[];if(t&&e){let{trigger:a,allowMultiple:c,initiallyExpanded:h}=t;e&&a==="always"?r=e.map(f=>ke(f,n)):h&&(r=e.filter((f,g)=>h({record:f,index:g})).map(f=>ke(f,n)),c||(r=[r[0]]))}let s,l,i=M.useState(r);if(t){let{expandable:a,trigger:c,allowMultiple:h,collapseProps:f,content:g}=t;t.expanded?{recordIds:s,onRecordIdsChange:l}=t.expanded:[s,l]=i;let m=p=>l?.(s.filter(y=>y!==ke(p,n)));return{expandOnClick:c!=="always"&&c!=="never",isRowExpanded:p=>c==="always"?!0:s.includes(ke(p,n)),isExpandable:({record:p,index:y})=>a?a({record:p,index:y}):!0,expandRow:p=>{let y=ke(p,n);l?.(h?[...s,y]:[y])},collapseRow:m,collapseProps:f,content:({record:p,index:y})=>()=>g({record:p,index:y,collapse:()=>m(p)})}}}function va(t,e){let[n,r]=M.useState(t),[s,l]=M.useState(t),i=De.useTimeout(()=>r(!0),0),a=De.useTimeout(()=>l(!1),e||200);return M.useEffect(()=>{t?(a.clear(),l(!0),i.start()):(i.clear(),r(!1),a.start())},[i,a,t]),{expanded:n,visible:s}}var $n="mantine-datatable-nowrap",Yn="mantine-datatable-ellipsis",Pt="mantine-datatable-pointer-cursor",Xr="mantine-datatable-context-menu-cursor",xa="mantine-datatable-text-selection-disabled",cn="mantine-datatable-text-align-left",un="mantine-datatable-text-align-center",dn="mantine-datatable-text-align-right";function Ca({className:t,style:e,visibleMediaQuery:n,title:r,noWrap:s,ellipsis:l,textAlign:i,width:a}){return ln(n)?o.jsx(u.TableTh,{className:de({[$n]:s||l,[Yn]:l,[cn]:i==="left",[un]:i==="center",[dn]:i==="right"},t),style:[{width:a,minWidth:a,maxWidth:a},e],children:r}):null}function Sa({shadowVisible:t}){return o.jsx(u.TableTh,{className:"mantine-datatable-footer-selector-placeholder-cell","data-shadow-visible":t||void 0})}function wa({className:t,style:e,columns:n,defaultColumnProps:r,selectionVisible:s,selectorCellShadowVisible:l,ref:i}){return o.jsx(u.TableTfoot,{ref:i,className:de("mantine-datatable-footer",t),style:e,children:o.jsxs(u.TableTr,{children:[s&&o.jsx(Sa,{shadowVisible:l}),n.map(({hidden:a,...c})=>{if(a)return null;let{accessor:h,visibleMediaQuery:f,textAlign:g,width:m,footer:p,footerClassName:y,footerStyle:k,noWrap:A,ellipsis:I}={...r,...c};return o.jsx(Ca,{className:y,style:k,visibleMediaQuery:f,textAlign:g,width:m,title:p,noWrap:A,ellipsis:I},h)})]})})}function Da({group:{id:t,columns:e,groups:n,title:r,textAlign:s,className:l,style:i},maxDepth:a,currentDepth:c,previousGroups:h,isLastGroup:f,withColumnBorders:g=!1,totalTableColumns:m}){let p=M.useMemo(()=>e&&e.length>0?e:n&&n.length>0?An([{id:t,columns:e,groups:n}]):[],[e,n,t]),y=M.useMemo(()=>p.map(({visibleMediaQuery:Y})=>Y),[p]),k=pa(y),A=M.useMemo(()=>Rn({columns:e,groups:n},k),[t,e,n,k]),I=M.useMemo(()=>h.reduce((Y,$)=>Y+Rn($,k),0),[h,k]),F=n&&n.length>0?1:a-c,B=I+A<m,R=ba(f,B,g);return A>0?o.jsx(u.TableTh,{colSpan:A,rowSpan:F>1?F:void 0,className:de("mantine-datatable-column-group-header-cell",{[cn]:s==="left",[un]:s==="center",[dn]:s==="right","mantine-datatable-column-group-header-cell--needs-border":R},l),style:i,children:r??Ln(t)}):null}function ka(){return o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),o.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 _a(){return o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),o.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 ja({children:t,isActive:e,filterPopoverProps:n,filterPopoverDisableClickOutside:r}){let[s,{close:l,toggle:i}]=De.useDisclosure(!1),a=e?_a:ka,c=De.useClickOutside(l);return r&&(c=void 0),o.jsxs(u.Popover,{withArrow:!0,shadow:"md",opened:s,onClose:l,trapFocus:!0,...n,children:[o.jsx(u.PopoverTarget,{children:o.jsx(u.ActionIcon,{className:"mantine-datatable-header-cell-filter-action-icon","data-active":e||void 0,size:"sm",variant:"default",onClick:h=>{h.preventDefault(),i()},onKeyDown:h=>h.stopPropagation(),children:o.jsx(a,{})})}),o.jsx(u.PopoverDropdown,{ref:c,onClick:h=>h.stopPropagation(),onKeyDown:h=>h.stopPropagation(),children:typeof t=="function"?t({close:l}):t})]})}var Pa=t=>{let{accessor:e,columnRef:n}=t,[r,s]=M.useState(!1),l=M.useRef(0),i=M.useRef({current:0,next:0}),{dir:a}=u.useDirection(),c=a==="rtl",{setMultipleColumnWidths:h}=Tn(),f=M.useCallback(m=>{if(m.preventDefault(),m.stopPropagation(),!n.current)return;let p=n.current,y=p.nextElementSibling;for(;y;){let Y=y.getAttribute("data-accessor");if(Y&&Y!=="__selection__")break;y=y.nextElementSibling}if(!y)return;let k=y.getAttribute("data-accessor");if(!k)return;let A=k==="__selection__";s(!0),l.current=m.clientX;let I=p.offsetWidth,F=y.offsetWidth;i.current={current:I,next:F};let B=Y=>{if(!n.current)return;let $=n.current,O=$.nextElementSibling;if(!O)return;let L=Y.clientX-l.current;c&&(L=-L);let _=50,j=i.current.current-_,N=i.current.next-_,W=Math.max(-j,Math.min(L,N)),E=i.current.current+W,D=i.current.next-W;$.style.width=`${E}px`,O.style.width=`${D}px`,$.style.minWidth=`${E}px`,$.style.maxWidth=`${E}px`,O.style.minWidth=`${D}px`,O.style.maxWidth=`${D}px`},R=()=>{if(!n.current)return;let Y=n.current,$=Y.nextElementSibling;s(!1),document.body.style.cursor="initial",document.body.style.userSelect="initial";let O=parseInt(Y.style.width)||Y.offsetWidth,L=$?parseInt($.style.width)||$.offsetWidth:0,_=[{accessor:e,width:`${O}px`}];if($&&!A){let j=$.getAttribute("data-accessor");j&&_.push({accessor:j,width:`${L}px`})}setTimeout(()=>{h(_)},0),document.removeEventListener("mousemove",B),document.removeEventListener("mouseup",R)};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",B),document.addEventListener("mouseup",R)},[e,n,c,h]),g=M.useCallback(()=>{if(!n.current)return;let m=n.current,p=m.nextElementSibling;m.style.width="",m.style.minWidth="",m.style.maxWidth="";let y=[{accessor:e,width:"auto"}];if(p){p.style.width="",p.style.minWidth="",p.style.maxWidth="";let k=p.getAttribute("data-accessor");k&&k!=="__selection__"&&y.push({accessor:k,width:"auto"})}setTimeout(()=>{h(y)},0)},[e,n,h]);return o.jsx("div",{className:"mantine-datatable-header-resizable-handle",style:{cursor:r?"col-resize":void 0},onMouseDown:f,onDoubleClick:g,onClick:m=>m.stopPropagation(),title:"Drag to resize column, double-click to reset"})};function Ma(){return o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),o.jsx("path",{d:"M12 5l0 14"}),o.jsx("path",{d:"M16 9l-4 -4"}),o.jsx("path",{d:"M8 9l4 -4"})]})}function Ta(){return o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),o.jsx("path",{d:"M8 7l4 -4l4 4"}),o.jsx("path",{d:"M8 17l4 4l4 -4"}),o.jsx("path",{d:"M12 3l0 18"})]})}function Oa(){return o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),o.jsx("path",{d:"M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),o.jsx("path",{d:"M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),o.jsx("path",{d:"M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),o.jsx("path",{d:"M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),o.jsx("path",{d:"M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),o.jsx("path",{d:"M15 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"})]})}function Ea(){return o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),o.jsx("path",{d:"M18 6l-12 12"}),o.jsx("path",{d:"M6 6l12 12"})]})}function La({className:t,style:e,accessor:n,visibleMediaQuery:r,title:s,sortable:l,draggable:i,toggleable:a,resizable:c,sortIcons:h,textAlign:f,width:g,sortStatus:m,onSortStatusChange:p,filter:y,filterPopoverProps:k,filterPopoverDisableClickOutside:A,filtering:I,sortKey:F}){let{setSourceColumn:B,setTargetColumn:R,swapColumns:Y,setColumnsToggle:$}=Tn(),[O,L]=M.useState(!1),_=M.useRef(null);if(!ln(r))return null;let j=s??Ln(n),N=typeof j=="string"?j:void 0,W=l&&p?x=>{x?.defaultPrevented||p({sortKey:F,columnAccessor:n,direction:m?.columnAccessor===n?m.direction==="asc"?"desc":"asc":m?.direction??"asc"})}:void 0,E=x=>{x.stopPropagation(),B(n),L(!1)},D=x=>{x.preventDefault(),R(n),L(!0)},b=()=>{R(n),L(!1),Y()},v=()=>{L(!0)},P=()=>{L(!1)},C=x=>{x.stopPropagation(),$(T=>T.map(d=>d.accessor===n?{...d,toggled:!1}:d))};return o.jsxs(u.TableTh,{"data-accessor":n,className:de({"mantine-datatable-header-cell-sortable":l,"mantine-datatable-header-cell-toggleable":a,"mantine-datatable-header-cell-resizable":c},t),style:[{width:g,...c?{}:{minWidth:g,maxWidth:g}},e],role:l?"button":void 0,tabIndex:l?0:void 0,onClick:W,onKeyDown:x=>x.key==="Enter"&&W?.(),ref:_,children:[o.jsxs(u.Group,{className:"mantine-datatable-header-cell-sortable-group",justify:"space-between",wrap:"nowrap",children:[o.jsxs(u.Flex,{align:"center",w:"100%",className:de({"mantine-datatable-header-cell-draggable":i,"mantine-datatable-header-cell-drag-over":O}),draggable:i,onDragStart:i?E:void 0,onDragEnter:i?v:void 0,onDragOver:i?D:void 0,onDrop:i?b:void 0,onDragLeave:i?P:void 0,children:[i?o.jsx(u.Center,{role:"img","aria-label":"Drag column",children:o.jsx(u.ActionIcon,{className:"mantine-datatable-header-cell-draggable-action-icon",variant:"subtle",size:"xs",onClick:x=>{x.stopPropagation()},children:o.jsx(Oa,{})})}):null,o.jsx(u.Box,{className:de("mantine-datatable-header-cell-sortable-text",{[cn]:f==="left",[un]:f==="center",[dn]:f==="right"},$n,Yn),title:N,children:j})]}),a?o.jsx(u.Center,{className:"mantine-datatable-header-cell-toggleable-icon",role:"img","aria-label":"Toggle column",children:o.jsx(u.ActionIcon,{size:"xs",variant:"light",onClick:C,children:o.jsx(Ea,{})})}):null,l||m?.columnAccessor===n?o.jsx(o.Fragment,{children:m?.columnAccessor===n?o.jsx(u.Center,{className:de("mantine-datatable-header-cell-sortable-icon",{"mantine-datatable-header-cell-sortable-icon-reversed":m.direction==="desc"}),role:"img","aria-label":`Sorted ${m.direction==="desc"?"descending":"ascending"}`,children:h?.sorted||o.jsx(Ma,{})}):o.jsx(u.Center,{className:"mantine-datatable-header-cell-sortable-unsorted-icon",role:"img","aria-label":"Not sorted",children:h?.unsorted||o.jsx(Ta,{})})}):null,y?o.jsx(ja,{filterPopoverProps:k,isActive:!!I,filterPopoverDisableClickOutside:A,children:y}):null]}),c&&n!=="__selection__"?o.jsx(Pa,{accessor:n,columnRef:_}):null]})}function Na({className:t,style:e,trigger:n,shadowVisible:r,checked:s,indeterminate:l,checkboxProps:i,onChange:a,rowSpan:c,ref:h}){let f=!i.disabled;return o.jsx(u.TableTh,{ref:h,className:de("mantine-datatable-header-selector-cell",{[Pt]:n==="cell"&&f},t),style:e,rowSpan:c,"data-shadow-visible":r||void 0,"data-accessor":"__selection__",onClick:n==="cell"&&f?a:void 0,children:o.jsx(u.Checkbox,{classNames:f?{input:Pt}:void 0,checked:s,indeterminate:l,onChange:a,...i,disabled:!(a||i.onChange)||i.disabled})})}function Aa({selectionColumnHeaderRef:t,className:e,style:n,sortStatus:r,sortIcons:s,onSortStatusChange:l,columns:i,defaultColumnProps:a,groups:c,selectionTrigger:h,selectionVisible:f,selectionChecked:g,selectionIndeterminate:m,onSelectionChange:p,selectionCheckboxProps:y,selectorCellShadowVisible:k,selectionColumnClassName:A,selectionColumnStyle:I,withColumnBorders:F=!1,ref:B}){let R=c?Jr(c):0,Y=R>0?R+1:1,$=f?o.jsx(Na,{ref:t,className:A,style:I,trigger:h,shadowVisible:k,checked:g,indeterminate:m,checkboxProps:y,onChange:p,rowSpan:c?Y:void 0}):null,{columnsToggle:O,setColumnsToggle:L}=Tn(),[_,j]=M.useState(!1),N=i.some(D=>D.toggleable),W=N?Object.fromEntries(i.map(({accessor:D,title:b})=>[D,b??Ln(String(D))])):void 0,E=o.jsxs(u.TableThead,{className:de("mantine-datatable-header",e),style:n,ref:B,onContextMenu:N?D=>{D.preventDefault(),j(b=>!b)}:void 0,children:[c&&Array.from({length:R},(D,b)=>{let v=Zr(c,b);return o.jsxs(u.TableTr,{children:[b===0&&$,v.map((P,C)=>o.jsx(Da,{group:P,maxDepth:R,currentDepth:b,previousGroups:v.slice(0,C),isLastGroup:C===v.length-1,withColumnBorders:F,totalTableColumns:i.length},P.id))]},`group-depth-${b}`)}),o.jsxs(u.TableTr,{children:[!c&&$,i.map(({hidden:D,...b},v)=>{if(D)return null;let{accessor:P,visibleMediaQuery:C,textAlign:x,width:T,title:d,sortable:w,draggable:S,toggleable:z,resizable:H,titleClassName:Q,titleStyle:U,filter:G,filterPopoverProps:K,filterPopoverDisableClickOutside:q,filtering:te,sortKey:X}={...a,...b};return o.jsx(La,{accessor:P,className:Q,style:U,visibleMediaQuery:C,textAlign:x,width:T,title:d,sortable:w,draggable:S,toggleable:z,resizable:H&&v<i.length-1,sortStatus:r,sortIcons:s,sortKey:X,onSortStatusChange:l,filter:G,filterPopoverProps:K,filterPopoverDisableClickOutside:q,filtering:te},P)})]})]});return N?o.jsxs(u.Popover,{position:"bottom",withArrow:!0,shadow:"md",opened:_,onChange:j,children:[o.jsx(u.PopoverTarget,{children:E}),o.jsx(u.PopoverDropdown,{children:o.jsx(u.Stack,{children:O.filter(D=>D.toggleable).map(D=>o.jsx(u.Group,{children:o.jsx(u.Checkbox,{classNames:{label:"mantine-datatable-header-column-toggle-checkbox-label"},size:"xs",label:W[D.accessor],checked:D.toggled,onChange:b=>{L(O.map(v=>v.accessor===D.accessor?{...v,toggled:b.currentTarget.checked}:v))}})},D.accessor))})})]}):E}function Ra({fetching:t,customContent:e,backgroundBlur:n,size:r,type:s,color:l}){return o.jsx(u.Center,{className:de("mantine-datatable-loader",{"mantine-datatable-loader-fetching":t}),style:[{backdropFilter:n?`blur(${n}px)`:void 0}],children:t&&(e||o.jsx(u.Loader,{size:r,type:s,color:l}))})}function me(t,e,n){return t?u.parseThemeColor({color:typeof t=="object"?t[n]:t,theme:e}).value:void 0}function $a({theme:t,c:e,backgroundColor:n,borderColor:r,rowBorderColor:s,stripedColor:l,highlightOnHoverColor:i}){return{"--mantine-datatable-color-light":me(e,t,"light"),"--mantine-datatable-color-dark":me(e,t,"dark"),"--mantine-datatable-background-color-light":me(n,t,"light"),"--mantine-datatable-background-color-dark":me(n,t,"dark"),"--mantine-datatable-border-color-light":me(r,t,"light"),"--mantine-datatable-border-color-dark":me(r,t,"dark"),"--mantine-datatable-row-border-color-light":me(s,t,"light"),"--mantine-datatable-row-border-color-dark":me(s,t,"dark"),"--mantine-datatable-striped-color-light":me(l,t,"light"),"--mantine-datatable-striped-color-dark":me(l,t,"dark"),"--mantine-datatable-highlight-on-hover-color-light":me(i,t,"light"),"--mantine-datatable-highlight-on-hover-color-dark":me(i,t,"dark")}}function es({theme:t,paginationActiveTextColor:e,paginationActiveBackgroundColor:n}){return{"--mantine-datatable-pagination-active-text-color-light":me(e,t,"light"),"--mantine-datatable-pagination-active-text-color-dark":me(e,t,"dark"),"--mantine-datatable-pagination-active-background-color-light":me(n,t,"light"),"--mantine-datatable-pagination-active-background-color-dark":me(n,t,"dark")}}function Ya({theme:t,color:e,backgroundColor:n}){return{"--mantine-datatable-row-color-light":me(e,t,"light"),"--mantine-datatable-row-color-dark":me(e,t,"dark"),"--mantine-datatable-row-background-color-light":me(n,t,"light"),"--mantine-datatable-row-background-color-dark":me(n,t,"dark")}}function Ia(){return o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),o.jsx("path",{d:"M8 9l4 -4l4 4"}),o.jsx("path",{d:"M16 15l-4 4l-4 -4"})]})}var ts={xs:u.rem(22),sm:u.rem(26),md:u.rem(32),lg:u.rem(38),xl:u.rem(44)};function Fa({size:t,label:e,values:n,value:r,activeTextColor:s,activeBackgroundColor:l,onChange:i}){return o.jsxs(u.Group,{gap:"xs",children:[o.jsx(u.Text,{component:"div",size:t,children:e}),o.jsxs(u.Menu,{withinPortal:!0,withArrow:!0,offset:2,classNames:{arrow:"mantine-datatable-page-size-selector-menu-arrow"},children:[o.jsx(u.MenuTarget,{children:o.jsx(u.Button,{size:t,variant:"default",classNames:{section:"mantine-datatable-page-size-selector-button-icon"},rightSection:o.jsx(Ia,{}),style:[{fontWeight:"normal"},a=>({height:ts[t],paddingLeft:a.spacing[t],paddingRight:a.spacing[t]})],children:r})}),o.jsx(u.MenuDropdown,{children:n.map(a=>{let c=a===r;return o.jsx(u.MenuItem,{className:de({"mantine-datatable-page-size-selector-active":c}),style:[{height:ts[t]},c&&(s||l)?h=>es({theme:h,paginationActiveTextColor:s,paginationActiveBackgroundColor:l}):void 0],disabled:c,onClick:()=>i(a),children:o.jsx(u.Text,{component:"div",size:t,children:a})},a)})})]})]})}function Wa({className:t,style:e,fetching:n,page:r,onPageChange:s,paginationWithEdges:l,paginationWithControls:i,paginationActiveTextColor:a,paginationActiveBackgroundColor:c,paginationSize:h,loadingText:f,noRecordsText:g,paginationText:m,totalRecords:p,recordsPerPage:y,onRecordsPerPageChange:k,recordsPerPageLabel:A,recordsPerPageOptions:I,recordsLength:F,horizontalSpacing:B,paginationWrapBreakpoint:R,getPaginationControlProps:Y,getPaginationItemProps:$,renderPagination:O}){let L;if(p){let b=(r-1)*y+1,v=b+(F||0)-1;L=m({from:b,to:v,totalRecords:p})}else L=n?f:g;let _=p&&y?Math.max(1,Math.ceil(p/y)):1,j=p?(r-1)*(y??0)+1:void 0,N=p?(j??1)+(F??0)-1:void 0,W=!ln(({breakpoints:b})=>`(min-width: ${typeof R=="number"?`${u.rem(R)}rem`:b[R]||R})`),E={Text:b=>o.jsx(u.Text,{component:"div",className:"mantine-datatable-pagination-text",size:h,...b,children:L}),PageSizeSelector:b=>I?o.jsx(Fa,{activeTextColor:a,activeBackgroundColor:c,size:h,label:A,values:I,value:y,onChange:k,...b}):o.jsx(o.Fragment,{}),Pagination:b=>o.jsx(u.Pagination,{classNames:{root:de("mantine-datatable-pagination-pages",{"mantine-datatable-pagination-pages-fetching":n||!F}),control:"mantine-datatable-pagination-pages-control"},style:a||c?v=>es({theme:v,paginationActiveTextColor:a,paginationActiveBackgroundColor:c}):void 0,withEdges:l,withControls:i,value:r,onChange:s,size:h,total:_,getControlProps:Y,getItemProps:$,...b})},D={state:{paginationSize:h,page:r,totalPages:_,totalRecords:p,recordsPerPage:y,recordsLength:F,fetching:n,from:j,to:N,isWrapped:W},actions:{setPage:b=>s?.(b),setRecordsPerPage:k?b=>k(b):void 0},Controls:E};return o.jsx(u.Box,{px:B??"xs",py:"xs",className:de("mantine-datatable-pagination",t),style:[{flexDirection:W?"column":"row"},e],children:typeof O=="function"?O(D):o.jsxs(o.Fragment,{children:[o.jsx(E.Text,{}),o.jsx(E.PageSizeSelector,{}),o.jsx(E.Pagination,{})]})})}function za({className:t,style:e,visibleMediaQuery:n,record:r,index:s,onClick:l,onDoubleClick:i,onContextMenu:a,noWrap:c,ellipsis:h,textAlign:f,width:g,accessor:m,render:p,defaultRender:y,customCellAttributes:k}){return ln(n)?o.jsx(u.TableTd,{className:de({[$n]:c||h,[Yn]:h,[Pt]:l||i,[Xr]:a,[cn]:f==="left",[un]:f==="center",[dn]:f==="right"},t),style:[{width:g,minWidth:g,maxWidth:g},e],onClick:l,onDoubleClick:i,onContextMenu:a,...k?.(r,s),children:p?p(r,s):y?y(r,s,m):Kr(r,m)}):null}function Ba({open:t,colSpan:e,content:n,collapseProps:r}){let{expanded:s,visible:l}=va(t,r?.transitionDuration);return l?o.jsxs(o.Fragment,{children:[o.jsx(u.TableTr,{}),o.jsx(u.TableTr,{children:o.jsx(u.TableTd,{className:"mantine-datatable-row-expansion-cell",colSpan:e,children:o.jsx(u.Collapse,{in:s,...r,children:o.jsx("div",{className:"mantine-datatable-row-expansion-cell-content",children:n()})})})})]}):null}function Va({className:t,style:e,record:n,index:r,trigger:s,onChange:l,withRightShadow:i,checkboxProps:a,getCheckboxProps:c,...h}){let f={...a,...c(n,r)},g=!h.disabled&&!f.disabled,m=p=>{p.stopPropagation(),s==="cell"&&g&&l?.(p)};return o.jsx(u.TableTd,{className:de("mantine-datatable-row-selector-cell",{[Pt]:s==="cell"&&g},t),style:e,"data-shadow-visible":i||void 0,onClick:m,children:o.jsx(u.Checkbox,{classNames:g?{input:Pt}:void 0,onChange:l,...h,...f})})}function Ha({record:t,index:e,columns:n,defaultColumnProps:r,defaultColumnRender:s,selectionTrigger:l,selectionVisible:i,selectionChecked:a,onSelectionChange:c,isRecordSelectable:h,selectionCheckboxProps:f,getSelectionCheckboxProps:g,onClick:m,onDoubleClick:p,onContextMenu:y,onCellClick:k,onCellDoubleClick:A,onCellContextMenu:I,expansion:F,customAttributes:B,color:R,backgroundColor:Y,className:$,style:O,selectorCellShadowVisible:L,selectionColumnClassName:_,selectionColumnStyle:j,rowFactory:N}){let W=o.jsxs(o.Fragment,{children:[i&&o.jsx(Va,{className:_,style:j,record:t,index:e,trigger:l,withRightShadow:L,checked:a,disabled:!c||(h?!h(t,e):!1),onChange:c,checkboxProps:f,getCheckboxProps:g}),n.map(({hidden:b,hiddenContent:v,...P},C)=>{if(b||v)return null;let{accessor:x,visibleMediaQuery:T,textAlign:d,noWrap:w,ellipsis:S,width:z,render:H,cellsClassName:Q,cellsStyle:U,customCellAttributes:G}={...r,...P};return o.jsx(za,{className:typeof Q=="function"?Q(t,e):Q,style:U?.(t,e),visibleMediaQuery:T,record:t,index:e,onClick:k?K=>k({event:K,record:t,index:e,column:P,columnIndex:C}):void 0,onDoubleClick:A?K=>A({event:K,record:t,index:e,column:P,columnIndex:C}):void 0,onContextMenu:I?K=>I({event:K,record:t,index:e,column:P,columnIndex:C}):void 0,accessor:x,textAlign:d,noWrap:w,ellipsis:S,width:z,render:H,defaultRender:s,customCellAttributes:G},x)})]}),E=F&&o.jsx(Ba,{colSpan:n.filter(({hidden:b})=>!b).length+(i?1:0),open:F.isRowExpanded(t),content:F.content({record:t,index:e}),collapseProps:F.collapseProps}),D=Ua({record:t,index:e,selectionChecked:a,onClick:m,onDoubleClick:p,onContextMenu:y,expansion:F,customAttributes:B,color:R,backgroundColor:Y,className:$,style:O});return N?N({record:t,index:e,rowProps:D,children:W,expandedElement:E}):o.jsxs(o.Fragment,{children:[o.jsx(u.TableTr,{...D,children:W}),E]})}function Ua({record:t,index:e,selectionChecked:n,onClick:r,onDoubleClick:s,onContextMenu:l,expansion:i,customAttributes:a,color:c,backgroundColor:h,className:f,style:g}){return{className:de("mantine-datatable-row",{[Pt]:r||s||i?.isExpandable({record:t,index:e})&&i?.expandOnClick},{[Xr]:l},typeof f=="function"?f(t,e):f),"data-selected":n||void 0,onClick:m=>{if(i){let{isExpandable:p,isRowExpanded:y,expandOnClick:k,expandRow:A,collapseRow:I}=i;p({record:t,index:e})&&k&&(y(t)?I(t):A(t))}r?.({event:m,record:t,index:e})},onDoubleClick:s?m=>s({event:m,record:t,index:e}):void 0,onContextMenu:l?m=>l({event:m,record:t,index:e}):void 0,style:[c||h?m=>{let p=c?.(t,e),y=h?.(t,e);return Ya({theme:m,color:p,backgroundColor:y})}:void 0,g?.(t,e)],...a?.(t,e)??{}}}function qa({leftShadowBehind:t,rightShadowBehind:e,onScrollPositionChange:n,children:r,viewportRef:s,scrollAreaProps:l}){return o.jsxs(u.ScrollArea,{...l,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:n,children:[r,o.jsx(u.Box,{className:de("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-top-shadow")}),o.jsx("div",{className:de("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-left-shadow",{"mantine-datatable-scroll-area-shadow-behind":t})}),o.jsx("div",{className:de("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-right-shadow",{"mantine-datatable-scroll-area-shadow-behind":e})}),o.jsx(u.Box,{className:de("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-bottom-shadow")})]})}function Ga({withTableBorder:t,borderRadius:e,textSelectionDisabled:n,height:r="100%",minHeight:s,maxHeight:l,shadow:i,verticalAlign:a="center",fetching:c,columns:h,storeColumnsKey:f,groups:g,pinFirstColumn:m,pinLastColumn:p,defaultColumnProps:y,defaultColumnRender:k,idAccessor:A="id",records:I,selectionTrigger:F="checkbox",selectedRecords:B,onSelectedRecordsChange:R,selectionColumnClassName:Y,selectionColumnStyle:$,isRecordSelectable:O,selectionCheckboxProps:L,allRecordsSelectionCheckboxProps:_={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:j=(Ce,Be)=>({"aria-label":`Select record ${Be+1}`}),sortStatus:N,sortIcons:W,onSortStatusChange:E,horizontalSpacing:D,page:b,onPageChange:v,totalRecords:P,recordsPerPage:C,onRecordsPerPageChange:x,recordsPerPageOptions:T,recordsPerPageLabel:d="Records per page",paginationWithEdges:w,paginationWithControls:S,paginationActiveTextColor:z,paginationActiveBackgroundColor:H,paginationSize:Q="sm",paginationText:U=({from:Ce,to:Be,totalRecords:tt})=>`${Ce} - ${Be} / ${tt}`,paginationWrapBreakpoint:G="sm",getPaginationControlProps:K=Ce=>Ce==="previous"?{"aria-label":"Previous page"}:Ce==="next"?{"aria-label":"Next page"}:{},getPaginationItemProps:q,renderPagination:te,loaderBackgroundBlur:X,customLoader:ne,loaderSize:le,loaderType:he,loaderColor:re,loadingText:_e="...",emptyState:pe,noRecordsText:Te="No records",noRecordsIcon:je,highlightOnHover:nt,striped:Re,noHeader:Je,onRowClick:$e,onRowDoubleClick:Ye,onRowContextMenu:Ze,onCellClick:J,onCellDoubleClick:ge,onCellContextMenu:fe,onScroll:rt,onScrollToTop:ie,onScrollToBottom:Oe,onScrollToLeft:dt,onScrollToRight:ht,c:qe,backgroundColor:Ie,borderColor:xt,rowBorderColor:ve,stripedColor:st,highlightOnHoverColor:Ee,rowColor:ot,rowBackgroundColor:Ct,rowExpansion:xe,rowClassName:St,rowStyle:Pe,customRowAttributes:at,scrollViewportRef:Fe,scrollAreaProps:Xe,tableRef:We,bodyRef:Ge,m:et,my:Z,mx:ce,mt:Le,mb:Qe,ml:ft,mr:mt,className:Mt,classNames:it,style:pt,styles:ze,rowFactory:gt,tableWrapper:bt,...wt}){let Ce=M.useMemo(()=>g?An(g):h,[h,g]),[Be,tt]=M.useState(!1),{refs:ye,onScroll:Tt}=ua({scrollCallbacks:{onScroll:rt,onScrollToTop:ie,onScrollToBottom:Oe,onScrollToLeft:dt,onScrollToRight:ht},withRowBorders:wt.withRowBorders}),ee=ca({key:f,columns:Ce,headerRef:ye.header,scrollViewportRef:ye.scrollViewport,onFixedLayoutChange:tt}),se=De.useMergedRef(ye.table,We),Ke=De.useMergedRef(ye.scrollViewport,Fe),Se=ya({rowExpansion:xe,records:I,idAccessor:A}),ue=M.useRef(!1),we=M.useRef(b),yt=M.useRef(I),Ne=M.useCallback(ae=>{ue.current=!0,yt.current=I,v(ae)},[v,I]);M.useEffect(()=>{we.current!==b&&(ue.current=!0,yt.current=I,we.current=b)},[b,I]);let Yt=I?.length;M.useLayoutEffect(()=>{if(!ue.current||c||I===yt.current)return;let ae=ye.scrollViewport.current;if(!ae)return;let Dt=requestAnimationFrame(()=>{ae.scrollTo({top:0,left:0}),ue.current=!1});return()=>cancelAnimationFrame(Dt)},[c,I,ye.scrollViewport]);let ls=I?.map(ae=>ke(ae,A)),Ot=!!B,It=B?.map(ae=>ke(ae,A)),cs=ls!==void 0&&It!==void 0&&It.length>0,Fn=O?I?.filter(O):I,hn=Fn?.map(ae=>ke(ae,A)),fn=cs&&hn.every(ae=>It.includes(ae)),Pi=cs&&hn.some(ae=>It.includes(ae)),Mi=M.useCallback(()=>{B&&R&&R(fn?B.filter(ae=>!hn.includes(ke(ae,A))):Nn([...B,...Fn],ae=>ke(ae,A)))},[fn,A,R,hn,Fn,B]),{lastSelectionChangeIndex:mn,setLastSelectionChangeIndex:Ti}=da(ls),Wn=Ot&&!m,Oi={m:et,my:Z,mx:ce,mt:Le,mb:Qe,ml:ft,mr:mt},Ei=M.useCallback(({children:ae})=>bt?bt({children:ae}):ae,[bt]);return o.jsx(Br,{...ee,children:o.jsxs(u.Box,{ref:ye.root,...Oi,className:de("mantine-datatable",{"mantine-datatable-with-border":t},Mt,it?.root),style:[ae=>({...$a({theme:ae,c:qe,backgroundColor:Ie,borderColor:xt,rowBorderColor:ve,stripedColor:st,highlightOnHoverColor:Ee}),borderRadius:ae.radius[e]||e,boxShadow:ae.shadows[i]||i,height:r,minHeight:s,maxHeight:l}),pt,ze?.root,{position:"relative"}],children:[o.jsx(qa,{viewportRef:Ke,leftShadowBehind:Ot||!!m,rightShadowBehind:p,onScrollPositionChange:Tt,scrollAreaProps:Xe,children:o.jsx(Ei,{children:o.jsxs(u.Table,{ref:se,horizontalSpacing:D,className:de("mantine-datatable-table",{[xa]:n,"mantine-datatable-vertical-align-top":a==="top","mantine-datatable-vertical-align-bottom":a==="bottom","mantine-datatable-pin-last-column":p,"mantine-datatable-selection-column-visible":Ot,"mantine-datatable-pin-first-column":m,"mantine-datatable-resizable-columns":ee.hasResizableColumns&&Be},it?.table),style:{...ze?.table},"data-striped":Yt&&Re||void 0,"data-highlight-on-hover":nt||void 0,...wt,children:[Je?null:o.jsx(Br,{...ee,children:o.jsx(Aa,{ref:ye.header,selectionColumnHeaderRef:ye.selectionColumnHeader,className:it?.header,style:ze?.header,columns:Ce,defaultColumnProps:y,groups:g,sortStatus:N,sortIcons:W,onSortStatusChange:E,selectionTrigger:F,selectionVisible:Ot,selectionChecked:fn,selectionIndeterminate:Pi&&!fn,onSelectionChange:Mi,selectionCheckboxProps:{...L,..._},selectorCellShadowVisible:Wn,selectionColumnClassName:Y,selectionColumnStyle:$,withColumnBorders:wt.withColumnBorders})}),o.jsx("tbody",{ref:Ge,children:Yt?I.map((ae,Dt)=>{let zn=ke(ae,A),Bn=It?.includes(zn)||!1,us;return R&&B&&(us=Li=>{if(Li.nativeEvent.shiftKey&&mn!==null){let Et=I.filter(Dt>mn?(kt,_t)=>_t>=mn&&_t<=Dt&&(O?O(kt,_t):!0):(kt,_t)=>_t>=Dt&&_t<=mn&&(O?O(kt,_t):!0));R(Bn?ga(B,Et,kt=>ke(kt,A)):Nn([...B,...Et],kt=>ke(kt,A)))}else R(Bn?B.filter(Et=>ke(Et,A)!==zn):Nn([...B,ae],Et=>ke(Et,A)));Ti(Dt)}),o.jsx(Ha,{record:ae,index:Dt,columns:Ce,defaultColumnProps:y,defaultColumnRender:k,selectionTrigger:F,selectionVisible:Ot,selectionChecked:Bn,onSelectionChange:us,isRecordSelectable:O,selectionCheckboxProps:L,getSelectionCheckboxProps:j,onClick:$e,onDoubleClick:Ye,onCellClick:J,onCellDoubleClick:ge,onContextMenu:Ze,onCellContextMenu:fe,expansion:Se,color:ot,backgroundColor:Ct,className:St,style:Pe,customAttributes:at,selectorCellShadowVisible:Wn,selectionColumnClassName:Y,selectionColumnStyle:$,idAccessor:A,rowFactory:gt},zn)}):o.jsx(ra,{})}),Ce.some(({footer:ae})=>ae)&&o.jsx(wa,{ref:ye.footer,className:it?.footer,style:ze?.footer,columns:Ce,defaultColumnProps:y,selectionVisible:Ot,selectorCellShadowVisible:Wn})]})})}),!!(b&&Yt)&&o.jsx(Wa,{className:it?.pagination,style:ze?.pagination,horizontalSpacing:D,fetching:c,page:b,onPageChange:Ne,totalRecords:P,recordsPerPage:C,onRecordsPerPageChange:x,recordsPerPageOptions:T,recordsPerPageLabel:d,paginationWithEdges:w,paginationWithControls:S,paginationActiveTextColor:z,paginationActiveBackgroundColor:H,paginationSize:Q,paginationText:U,paginationWrapBreakpoint:G,getPaginationControlProps:K,getPaginationItemProps:q,noRecordsText:Te,loadingText:_e,recordsLength:Yt,renderPagination:te}),o.jsx(Ra,{fetching:c,backgroundBlur:X,customContent:ne,size:le,type:he,color:re}),o.jsx(oa,{icon:je,text:Te,active:!c&&!Yt,children:pe})]})})}function ns(t){const e=Me.c(42),{fields:n,onClose:r,queryKey:s,apiPath:l,id:i,steps:a}=t,[c,h]=M.useState(0),[f,g]=M.useState(!1),{data:m,isLoading:p}=br(l,s,i),{mutateAsync:y,isError:k,error:A,isPending:I}=wn(l,s);let F;e[0]!==n?(F=new Set(n.filter(ti).map(ei)),e[0]=n,e[1]=F):F=e[1];let B;e[2]!==F?(B=[...F],e[2]=F,e[3]=B):B=e[3];const R=B;let Y;e[4]!==n?(Y=n.reduce(Xa,{}),e[4]=n,e[5]=Y):Y=e[5];let $;e[6]!==n?($=n.filter(Za).reduce(Ja,{}),e[6]=n,e[7]=$):$=e[7];let O;e[8]!==Y||e[9]!==$?(O={mode:"uncontrolled",initialValues:Y,validate:$},e[8]=Y,e[9]=$,e[10]=O):O=e[10];const L=Vn.useForm(O);let _;e[11]!==m||e[12]!==n||e[13]!==L?(_=()=>{if(m){const C={...m};n.forEach(x=>{const T=x.id;x.type==="boolean"&&C[T]===null?C[T]=!1:x.type==="date"&&C[T]?C[T]=new Date(C[T]):C[T]===null&&(C[T]="")}),L.initialize(C),L.setValues(C)}},e[11]=m,e[12]=n,e[13]=L,e[14]=_):_=e[14];let j;e[15]!==m?(j=[m],e[15]=m,e[16]=j):j=e[16],M.useEffect(_,j);let N;e[17]===Symbol.for("react.memo_cache_sentinel")?(N=function(x,T){return typeof x.required=="function"?x.required(T??{}):!!x.required},e[17]=N):N=e[17];const W=N;let E;e[18]!==L||e[19]!==i?(E=function(x){const T=L.getValues();if(x.conditional&&!x.conditional(T))return null;const d=W(x,T);return o.jsxs(M.Fragment,{children:[(x.type===void 0||x.type=="text")&&o.jsx(u.TextInput,{label:x.column.title,placeholder:x.placeholder??"",...L.getInputProps(x.id),type:x.id.includes("email")?"email":void 0,required:d},L.key(x.id)),x.type==="number"&&o.jsx(u.NumberInput,{decimalSeparator:",",label:x.column.title,placeholder:x.placeholder??"",...L.getInputProps(x.id),required:d},L.key(x.id)),x.type==="date"&&o.jsx(an,{label:x.column.title,placeholder:x.placeholder??"",valueFormat:"DD.MM.YYYY",clearable:!0,...L.getInputProps(x.id),required:d},L.key(x.id)),x.type==="boolean"&&o.jsx(u.Checkbox,{mt:"md",label:x.column.title,...L.getInputProps(x.id,{type:"checkbox"}),required:d},L.key(x.id)),x.type==="textarea"&&o.jsx(u.Textarea,{label:x.column.title,placeholder:x.placeholder??"",...L.getInputProps(x.id),minRows:3,autosize:!0,required:d},L.key(x.id)),x.type==="custom"&&x.render&&x.render({...L.getValues(),id:i},L.setValues,g,{error:L.getInputProps(x.id).error,required:d})]},x.id)},e[18]=L,e[19]=i,e[20]=E):E=e[20];const D=E;let b;e[21]!==k||e[22]!==A?.message||e[23]!==A?.name?(b=k&&o.jsx(u.Alert,{variant:"outline",color:"red",title:A?.name??"Fehler aufgetreten",mb:"lg",children:A?.message??"Fehler aufgetreten"}),e[21]=k,e[22]=A?.message,e[23]=A?.name,e[24]=b):b=e[24];let v;e[25]!==c||e[26]!==n||e[27]!==L||e[28]!==f||e[29]!==i||e[30]!==p||e[31]!==I||e[32]!==k||e[33]!==r||e[34]!==D||e[35]!==a||e[36]!==R||e[37]!==y?(v=p?o.jsxs(u.Stack,{gap:"md",children:[o.jsx(u.Skeleton,{height:40}),Array(n.length).fill(0).map(Ka),o.jsxs(u.Group,{mt:"md",justify:"end",children:[o.jsx(u.Skeleton,{width:100,height:36}),o.jsx(u.Skeleton,{width:100,height:36})]})]}):o.jsxs("form",{onSubmit:L.onSubmit(async C=>{const x=Object.fromEntries(Object.entries(C).map(Qa));await y({...x,id:i}),R.length&&c<R.length-1?k||h(c+1):k||(L.setInitialValues(x),L.reset(),r())}),children:[R.length?o.jsx(u.Stepper,{active:c,size:"sm",children:R.map(C=>o.jsx(u.Stepper.Step,{...a&&a[C-1]?{label:a[C-1].label}:{},children:n.filter(x=>x.step===C).map(x=>D(x))},C))}):n.map(C=>D(C)),!f&&o.jsxs(u.Group,{mt:"md",justify:"end",children:[o.jsx(u.Button,{onClick:()=>R.length?c===0?r():h(c-1):r(),variant:"outline",children:R.length?c===0?"Abbrechen":"Zurück":"Abbrechen"}),o.jsx(u.Button,{type:"submit",loading:I,children:R.length?c===R.length-1?"Speichern":"Weiter":"Speichern"})]})]}),e[25]=c,e[26]=n,e[27]=L,e[28]=f,e[29]=i,e[30]=p,e[31]=I,e[32]=k,e[33]=r,e[34]=D,e[35]=a,e[36]=R,e[37]=y,e[38]=v):v=e[38];let P;return e[39]!==b||e[40]!==v?(P=o.jsxs(o.Fragment,{children:[b,v]}),e[39]=b,e[40]=v,e[41]=P):P=e[41],P}function Qa(t){const[e,n]=t;return[e,n===""?void 0:n]}function Ka(t,e){return o.jsx(u.Skeleton,{height:35},`skeleton-field-${e}`)}function Ja(t,e){return t[e.id]=(n,r)=>e.conditional&&!e.conditional(r)||!(typeof e.required=="function"?e.required(r):!!e.required)||n?null:"Pflichtfeld",t}function Za(t){return t.required}function Xa(t,e){return t[e.id]=e.type==="boolean"?e.defaultValue??!1:e.defaultValue??"",t}function ei(t){return t.step}function ti(t){return typeof t.step=="number"}function rs({queryKey:t,apiPath:e,onClose:n,selectedRecords:r}){const{mutateAsync:s,isError:l,error:i,isPending:a}=xr(e,t),[c,h]=M.useState(r),[f,g]=M.useState(!1),m=f||a;return M.useEffect(()=>{c.length||n()},[n,c]),c.length?o.jsxs(o.Fragment,{children:[l&&i.message&&o.jsx(u.Alert,{variant:"outline",color:"red",title:i.name,children:i.message}),o.jsx(u.Text,{children:c.length===1?`Soll ${c.length} Eintrag wirklich gelöscht werden?`:`Sollen ${c.length} Einträge wirklich gelöscht werden?`}),o.jsxs(u.Group,{mt:"md",justify:"end",children:[o.jsx(u.Button,{onClick:n,variant:"outline",disabled:m,children:"Abbrechen"}),o.jsx(u.Button,{color:"red",loading:m,onClick:async()=>{g(!0);try{await Promise.all(c.map(p=>s(p.id))),h([])}finally{g(!1)}},children:"Löschen"})]})]}):o.jsx(o.Fragment,{})}function ss(t,e){const n=Me.c(8);let r;n[0]!==t||n[1]!==e?(r=()=>{const h=localStorage.getItem(`use_persistent_storage_${e}`);return h?JSON.parse(h):t},n[0]=t,n[1]=e,n[2]=r):r=n[2];const[s,l]=M.useState(r);let i;n[3]!==e?(i=h=>{l(h),localStorage.setItem(`use_persistent_storage_${e}`,JSON.stringify(h))},n[3]=e,n[4]=i):i=n[4];const a=i;let c;return n[5]!==a||n[6]!==s?(c=[s,a],n[5]=a,n[6]=s,n[7]=c):c=n[7],c}const ni=[/^\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}$/],ri=(t,e)=>{const n=t.map(i=>i[e]).filter(i=>i!=null&&i!=="");if(n.length===0)return"string";const r=n.slice(0,100),s={string:0,number:0,date:0};r.forEach(i=>{if(typeof i=="number")s.number++;else if(typeof i=="string"){const a=i.trim();if(a!==""&&!isNaN(Number(a))&&!isNaN(parseFloat(a))){s.number++;return}if(ni.some(c=>c.test(a))){const c=new Date(a);if(!isNaN(c.getTime())){s.date++;return}}s.string++}else i instanceof Date?s.date++:s.string++});const l=s.string+s.number+s.date;return s.date/l>=.6?"date":s.number/l>=.6?"number":s.string/l>=.6?"string":"mixed"};function os(t,e){switch(e){case"date":if(typeof t=="string"){const r=new Date(t.trim());return isNaN(r.getTime())?null:r.getTime()}return t instanceof Date?t.getTime():null;case"number":if(typeof t=="number")return t;const n=parseFloat(String(t).trim());return isNaN(n)?null:n;case"string":return(typeof t=="string"?t:String(t)).toLowerCase().trim();default:return String(t).toLowerCase().trim()}}const as=(t,e,n="asc")=>{if(!t||t.length===0)return[];const r=ri(t,e);return[...t].sort((s,l)=>{const i=s[e],a=l[e],c=i==null||i==="",h=a==null||a==="";if(c&&h)return 0;if(c)return n==="asc"?-1:1;if(h)return n==="asc"?1:-1;const f=os(i,r),g=os(a,r);return f===null&&g===null?0:f===null?n==="asc"?1:-1:g===null||f<g?n==="asc"?-1:1:f>g?n==="asc"?1:-1:0})};function si(t,e){return e.split(".").reduce((n,r)=>{if(n&&typeof n=="object"&&r in n)return n[r]},t)}function oi(t,e){const n=e.column;if(n.render)return n.render(t,0);const r=n.accessor??e.id,s=si(t,r);return s==null?o.jsx(u.Text,{c:"dimmed",children:"–"}):typeof s=="boolean"?o.jsx(u.Text,{fz:"sm",children:s?"Ja":"Nein"}):o.jsx(u.Text,{fz:"sm",children:String(s)})}function ai(t){const e=Me.c(10),{field:n,record:r}=t,s=n.column.title??n.id;let l;e[0]!==s?(l=o.jsx(u.Text,{fw:700,fz:"sm",children:s}),e[0]=s,e[1]=l):l=e[1];let i;e[2]!==n||e[3]!==r?(i=oi(r,n),e[2]=n,e[3]=r,e[4]=i):i=e[4];let a;e[5]!==i?(a=o.jsx(u.Box,{ta:"right",fz:"sm",children:i}),e[5]=i,e[6]=a):a=e[6];let c;return e[7]!==l||e[8]!==a?(c=o.jsxs(u.Group,{wrap:"nowrap",justify:"space-between",align:"center",py:"xs",px:"sm",children:[l,a]}),e[7]=l,e[8]=a,e[9]=c):c=e[9],c}function is(t){const e=Me.c(42),{records:n,fields:r,selection:s,selectedRecords:l,onSelectedRecordsChange:i,onRowClick:a,actions:c,canUpdate:h,canDelete:f,pagination:g,sort:m,rowExpansion:p}=t;let y;e[0]!==l?(y=l===void 0?[]:l,e[0]=l,e[1]=y):y=e[1];const k=y;let A;e[2]===Symbol.for("react.memo_cache_sentinel")?(A=new Set,e[2]=A):A=e[2];const[I,F]=M.useState(A);let B;e[3]===Symbol.for("react.memo_cache_sentinel")?(B=E=>{F(D=>{const b=new Set(D);return b.has(E)?b.delete(E):b.add(E),b})},e[3]=B):B=e[3];const R=B;let Y,$,O,L,_,j;if(e[4]!==c||e[5]!==f||e[6]!==h||e[7]!==I||e[8]!==r||e[9]!==a||e[10]!==i||e[11]!==n||e[12]!==p||e[13]!==k||e[14]!==s||e[15]!==m){j=Symbol.for("react.early_return_sentinel");e:{const E=r.filter(hi),D=E.filter(di).reduce(ui,[]);let b;e[22]!==k?(b=d=>k.some(w=>w.id===d.id),e[22]=k,e[23]=b):b=e[23];const v=b;let P;e[24]!==v||e[25]!==i||e[26]!==k?(P=d=>{i&&(v(d)?i(k.filter(w=>w.id!==d.id)):i([...k,d]))},e[24]=v,e[25]=i,e[26]=k,e[27]=P):P=e[27];const C=P;let x;e[28]!==a||e[29]!==s||e[30]!==C?(x=(d,w,S)=>{a?a({record:d,index:w,event:S}):s&&C(d)},e[28]=a,e[29]=s,e[30]=C,e[31]=x):x=e[31];const T=x;if(n.length===0){let d;e[32]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(u.Text,{c:"dimmed",ta:"center",py:"xl",children:"Keine Einträge gefunden"}),e[32]=d):d=e[32],j=d;break e}Y=u.Stack,$="sm",O="md",L=m&&D.length>0&&o.jsxs(u.Group,{gap:"xs",wrap:"nowrap",children:[o.jsx(u.Select,{data:D,value:m.field,onChange:d=>d&&m.onSortChange(d,m.direction),allowDeselect:!1,style:{flex:1}}),o.jsx(u.ActionIcon,{variant:"filled",size:"input-sm",onClick:()=>m.onSortChange(m.field,m.direction==="asc"?"desc":"asc"),children:m.direction==="asc"?o.jsx(Ve.IconSortAscending,{size:18}):o.jsx(Ve.IconSortDescending,{size:18})})]}),_=n.map((d,w)=>{const S=v(d),z=!!a||!!s,H=d.id??w,Q=I.has(H);return o.jsx(M.Fragment,{children:o.jsxs(u.Box,{bg:S?"var(--mantine-primary-color-light)":"var(--mantine-color-body)",bd:S?void 0:"1px solid var(--mantine-color-default-border)",style:{borderRadius:"var(--mantine-radius-md)",overflow:"hidden"},children:[o.jsxs(u.Box,{w:"100%",style:{cursor:z||p?"pointer":"default"},onClick:U=>{p&&!a?R(H):T(d,w,U)},children:[(s||p||c&&c.length>0)&&o.jsxs(u.Group,{px:"sm",pt:"sm",justify:"space-between",children:[o.jsxs(u.Group,{gap:"xs",children:[p&&o.jsx(u.Box,{c:"var(--mantine-primary-color-filled)",style:{cursor:"pointer",display:"flex",alignItems:"center"},onClick:U=>{U.stopPropagation(),R(H)},children:o.jsx(Ve.IconChevronDown,{size:16,style:{transform:Q?"rotate(0deg)":"rotate(-90deg)",transition:"transform 200ms"}})}),s&&o.jsx(u.Checkbox,{checked:S,onChange:()=>C(d),onClick:ci})]}),c&&c.length>0&&(()=>{const U=c.filter(G=>!(G.label==="Bearbeiten"&&h&&!h(d)||G.label==="Löschen"&&f&&!f(d)));return U.length===0?null:o.jsxs(u.Menu,{shadow:"md",position:"bottom-end",children:[o.jsx(u.Menu.Target,{children:o.jsx(u.ActionIcon,{variant:"subtle",color:"gray",size:"sm",onClick:li,children:o.jsx(Ve.IconDotsVertical,{size:16})})}),o.jsx(u.Menu.Dropdown,{children:U.map((G,K)=>o.jsx(u.Menu.Item,{leftSection:G.icon,onClick:q=>{q.stopPropagation(),G.onClick([d])},children:G.label},`card_action_${K}`))})]})})()]}),E.map((U,G)=>o.jsxs(M.Fragment,{children:[G>0&&o.jsx(u.Divider,{}),o.jsx(ai,{field:U,record:d})]},U.id))]}),p&&o.jsxs(u.Collapse,{in:Q,children:[o.jsx(u.Divider,{}),o.jsx(u.Box,{px:"sm",py:"sm",children:p.content(d)})]})]})},H)})}e[4]=c,e[5]=f,e[6]=h,e[7]=I,e[8]=r,e[9]=a,e[10]=i,e[11]=n,e[12]=p,e[13]=k,e[14]=s,e[15]=m,e[16]=Y,e[17]=$,e[18]=O,e[19]=L,e[20]=_,e[21]=j}else Y=e[16],$=e[17],O=e[18],L=e[19],_=e[20],j=e[21];if(j!==Symbol.for("react.early_return_sentinel"))return j;let N;e[33]!==g?(N=g&&g.totalRecords>g.recordsPerPage&&o.jsxs(u.Stack,{gap:"xs",mt:"sm",children:[o.jsx(u.Group,{justify:"center",children:o.jsx(u.Pagination,{total:Math.ceil(g.totalRecords/g.recordsPerPage),value:g.page,onChange:g.onPageChange,size:"sm"})}),g.recordsPerPageOptions&&g.onRecordsPerPageChange&&o.jsxs(u.Group,{justify:"center",gap:"xs",children:[o.jsx(u.Text,{fz:"xs",c:"dimmed",children:"Einträge pro Seite:"}),o.jsx(u.Select,{data:g.recordsPerPageOptions.map(ii),value:String(g.recordsPerPage),onChange:E=>E&&g.onRecordsPerPageChange(Number(E)),allowDeselect:!1,size:"xs",w:70})]})]}),e[33]=g,e[34]=N):N=e[34];let W;return e[35]!==Y||e[36]!==N||e[37]!==$||e[38]!==O||e[39]!==L||e[40]!==_?(W=o.jsxs(Y,{gap:$,my:O,children:[L,_,N]}),e[35]=Y,e[36]=N,e[37]=$,e[38]=O,e[39]=L,e[40]=_,e[41]=W):W=e[41],W}function ii(t){return{value:String(t),label:String(t)}}function li(t){return t.stopPropagation()}function ci(t){return t.stopPropagation()}function ui(t,e){const n=e.column.accessor??e.id;return t.some(r=>r.value===n)||t.push({value:n,label:e.column.title??e.id}),t}function di(t){return t.column.sortable!==!1}function hi(t){return t.list&&t.column}const In=[10,15,50,100,500];function fi(t){const e=Me.c(133),{title:n,queryKey:r,connectedQueryKeys:s,apiPath:l,mutationApiPath:i,buttons:a,fields:c,selection:h,pagination:f,filters:g,actions:m,steps:p,defaultSort:y,onSortChange:k,createButtonText:A,queryParams:I,tabs:F,defaultTab:B,activeTab:R,onActiveTabChange:Y,canUpdate:$,canDelete:O,showRefresh:L,rowExpansion:_,onRowClick:j,mobileCards:N}=t,W=L===void 0?!0:L,E=N===void 0?!1:N,[D,b]=M.useState(B||(F&&F.length>0?F[0].value:null)),v=R!==void 0?R:D;let P;e[0]!==R||e[1]!==Y?(P=ee=>{R===void 0&&b(ee),Y&&Y(ee)},e[0]=R,e[1]=Y,e[2]=P):P=e[2];const C=P;let x;e[3]!==v||e[4]!==F?(x=F?.find(ee=>ee.value===v),e[3]=v,e[4]=F,e[5]=x):x=e[5];const T=x,d=T?.queryParams||{},w=T?.apiPath??l,S=T?.mutationApiPath??i??w,z={...I,...d},H=z?"?"+Object.entries(z).filter(_i).map(ki).join("&"):"";let Q;e[6]!==v||e[7]!==r?(Q=v?[...r,v]:r,e[6]=v,e[7]=r,e[8]=Q):Q=e[8];const U=Q,{data:G,isLoading:K,isError:q,isRefetching:te,refetch:X}=yr(w+H,U),{queryClient:ne}=vt();let le,he;e[9]!==G||e[10]!==s||e[11]!==ne?(le=()=>{!G||!Array.isArray(G)||s?.forEach(ee=>ne.invalidateQueries({queryKey:ee}))},he=[G,s,ne],e[9]=G,e[10]=s,e[11]=ne,e[12]=le,e[13]=he):(le=e[12],he=e[13]),M.useEffect(le,he);const re=!G||!Array.isArray(G)?[]:!g||g.length===0?G:G.filter(ee=>g.every(se=>{if(se.value===void 0)return!0;const Ke=se.id;if(se.type==="query"){const Se=ee[Ke];return Array.isArray(se.value)?Array.isArray(Se)?Se.some(ue=>{if(typeof ue=="string"||typeof ue=="number")return se.value.includes(String(ue));if(ue&&typeof ue=="object"){const we=ue;if("id"in we&&se.value.includes(we.id))return!0;for(const yt in we){const Ne=we[yt];if(typeof Ne=="string"&&se.value.includes(Ne)||Ne&&typeof Ne=="object"&&"id"in Ne&&se.value.includes(Ne.id))return!0}}return!1}):Se&&typeof Se=="object"&&"id"in Se?se.value.includes(Se.id):!1:typeof Se=="string"&&Se.includes(se.value)}else if(se.type==="date"){const Se=se.value;if(!Se)return!0;const[ue,we]=Se;if(!ue&&!we)return!0;const yt=ee[Ke];if(typeof yt=="string"){const Ne=yt.split(" ")[0];if(ue&&we)return Ne>=ue&&Ne<=we;if(ue&&!we)return Ne>=ue;if(!ue&&we)return Ne<=we}return!0}else if(se.type==="boolean")return ee[Ke]===se.value;return!0})),_e=y?.field??c[0].id,pe=y?.direction??"desc";let Te;e[14]!==_e||e[15]!==pe?(Te={columnAccessor:_e,direction:pe},e[14]=_e,e[15]=pe,e[16]=Te):Te=e[16];const[je,nt]=M.useState(Te);let Re;e[17]!==k?(Re=ee=>{nt(ee),k&&k(String(ee.columnAccessor),ee.direction)},e[17]=k,e[18]=Re):Re=e[18];const Je=Re,$e=as(re,je.columnAccessor,je.direction),[Ye,Ze]=ss(In[1],"mantine-table-page-size"),[J,ge]=M.useState(1),fe=f?$e.slice((J-1)*Ye,J*Ye):$e;let rt;e[19]===Symbol.for("react.memo_cache_sentinel")?(rt=[],e[19]=rt):rt=e[19];const[ie,Oe]=M.useState(rt);let dt;e[20]===Symbol.for("react.memo_cache_sentinel")?(dt=()=>{Oe([])},e[20]=dt):dt=e[20];let ht;e[21]!==v?(ht=[v],e[21]=v,e[22]=ht):ht=e[22],M.useEffect(dt,ht);const[qe,Ie]=M.useState(!1),[xt,ve]=M.useState(!1),[st,Ee]=M.useState(!1);let ot;e[23]!==c?(ot=c.some(Di),e[23]=c,e[24]=ot):ot=e[24];const Ct=ot;let xe;e[25]!==c?(xe=c.some(wi),e[25]=c,e[26]=xe):xe=e[26];const St=xe;let Pe;if(e[27]!==m||e[28]!==St||e[29]!==Ct){if(Pe=[],Ct){let ee;e[31]===Symbol.for("react.memo_cache_sentinel")?(ee=o.jsx(Ve.IconPencil,{size:14}),e[31]=ee):ee=e[31];let se;e[32]===Symbol.for("react.memo_cache_sentinel")?(se={icon:ee,label:"Bearbeiten",onClick:Ke=>{Oe(Ke),ve(!0)}},e[32]=se):se=e[32],Pe.push(se)}if(m&&Pe.push(...m),St){let ee;e[33]===Symbol.for("react.memo_cache_sentinel")?(ee=o.jsx(Ve.IconTrash,{size:14}),e[33]=ee):ee=e[33];let se;e[34]===Symbol.for("react.memo_cache_sentinel")?(se={icon:ee,label:"Löschen",onClick:Ke=>{Oe(Ke),Ee(!0)}},e[34]=se):se=e[34],Pe.push(se)}e[27]=m,e[28]=St,e[29]=Ct,e[30]=Pe}else Pe=e[30];const at=n?"space-between":"end";let Fe;e[35]!==n?(Fe=n&&(typeof n=="string"?o.jsx(u.Title,{order:4,children:n}):n),e[35]=n,e[36]=Fe):Fe=e[36];let Xe;e[37]===Symbol.for("react.memo_cache_sentinel")?(Xe={marginLeft:"auto"},e[37]=Xe):Xe=e[37];let We;e[38]!==X||e[39]!==W?(We=W&&o.jsx(u.ActionIcon,{variant:"subtle",onClick:()=>X(),"aria-label":"Neuladen",children:o.jsx(Ve.IconRefresh,{})}),e[38]=X,e[39]=W,e[40]=We):We=e[40];let Ge;e[41]!==m||e[42]!==O||e[43]!==$||e[44]!==c||e[45]!==E||e[46]!==ie||e[47]!==h?(Ge=(c.some(Si)||h)&&(()=>{const ee=c.find(Ci)&&(!$||ie.length>0&&$(ie[0])),se=c.find(xi)&&(!O||ie.length>0&&O(ie[0])),Ke=(m??[]).length>0,Se=ee||se||Ke;return o.jsx(u.Box,{...E?{visibleFrom:"sm"}:{},children:o.jsxs(u.Menu,{shadow:"md",children:[o.jsx(u.Menu.Target,{children:o.jsx(u.Button,{variant:"outline",rightSection:o.jsx(Ve.IconCaretDownFilled,{size:14}),disabled:!ie.length||!Se,children:"Aktionen"})}),o.jsxs(u.Menu.Dropdown,{children:[ee&&o.jsx(u.Menu.Item,{leftSection:o.jsx(Ve.IconPencil,{size:14}),onClick:()=>ve(!0),disabled:ie.length!==1,children:"Bearbeiten"}),(m??[]).map((ue,we)=>M.createElement(u.Menu.Item,{...ue.icon&&{leftSection:ue.icon},key:`custom_action_${we}`,onClick:()=>ue.onClick(ie),disabled:ue.disabled?.(ie)??!1},ue.label)),se&&o.jsx(u.Menu.Item,{leftSection:o.jsx(Ve.IconTrash,{size:14}),onClick:()=>Ee(!0),color:"red",children:"Löschen"})]})]})})})(),e[41]=m,e[42]=O,e[43]=$,e[44]=c,e[45]=E,e[46]=ie,e[47]=h,e[48]=Ge):Ge=e[48];let et;e[49]!==A||e[50]!==c||e[51]!==K?(et=c.find(vi)&&o.jsx(u.Button,{onClick:()=>Ie(!0),disabled:K,children:A??"Erstellen"}),e[49]=A,e[50]=c,e[51]=K,e[52]=et):et=e[52];let Z;e[53]!==a||e[54]!==We||e[55]!==Ge||e[56]!==et?(Z=o.jsxs(u.Group,{align:"center",gap:"xs",wrap:"wrap",justify:"end",style:Xe,children:[We,Ge,et,a]}),e[53]=a,e[54]=We,e[55]=Ge,e[56]=et,e[57]=Z):Z=e[57];let ce;e[58]!==at||e[59]!==Fe||e[60]!==Z?(ce=o.jsxs(u.Group,{gap:"xs",justify:at,align:"center",wrap:"wrap",children:[Fe,Z]}),e[58]=at,e[59]=Fe,e[60]=Z,e[61]=ce):ce=e[61];let Le;e[62]!==v||e[63]!==C||e[64]!==F?(Le=F&&F.length>0&&o.jsx(u.Tabs,{value:v,onChange:C,mt:"md",children:o.jsx(u.Tabs.List,{children:F.map(yi)})}),e[62]=v,e[63]=C,e[64]=F,e[65]=Le):Le=e[65];let Qe;e[66]!==q?(Qe=q&&o.jsx(u.Alert,{mt:"md",variant:"light",color:"red",title:"Es ist ein Fehler aufgetreten.",icon:o.jsx(Ve.IconInfoCircle,{}),children:"Bitte versuche es später erneut oder sende eine Nachricht an unseren Support."}),e[66]=q,e[67]=Qe):Qe=e[67];let ft;e[68]!==K||e[69]!==te?(ft=(K||te)&&o.jsxs(u.Stack,{my:"md",children:[o.jsx(u.Skeleton,{height:40}),Array(5).fill(0).map(bi)]}),e[68]=K,e[69]=te,e[70]=ft):ft=e[70];let mt;e[71]!==O||e[72]!==$||e[73]!==c||e[74]!==Je||e[75]!==q||e[76]!==K||e[77]!==te||e[78]!==Pe||e[79]!==E||e[80]!==j||e[81]!==J||e[82]!==Ye||e[83]!==f||e[84]!==fe||e[85]!==_||e[86]!==ie||e[87]!==h||e[88]!==ge||e[89]!==Ze||e[90]!==je||e[91]!==$e?(mt=!K&&!te&&o.jsxs(o.Fragment,{children:[o.jsx(u.Box,{...E?{visibleFrom:"sm"}:{},children:o.jsx(Ga,{my:"md",striped:!0,highlightOnHover:!0,minHeight:150,fetching:q,records:fe,sortStatus:je,onSortStatusChange:Je,...h&&{selectedRecords:ie,onSelectedRecordsChange:Oe},...f&&fe.length&&{totalRecords:$e.length,recordsPerPage:Ye,onPageChange:ge,page:J,recordsPerPageOptions:In,onRecordsPerPageChange:Ze,recordsPerPageLabel:"Einträge pro Seite"},..._&&{rowExpansion:{allowMultiple:_.allowMultiple??!1,content:ee=>{const{record:se}=ee;return _.content(se)},..._.expanded&&{expanded:_.expanded}}},columns:c.map(gi),noRecordsText:"Keine Einträge gefunden",onRowClick:j,...j&&{style:{cursor:"pointer"}}})}),E&&o.jsx(u.Box,{hiddenFrom:"sm",children:o.jsx(is,{records:fe,fields:c,selection:h,selectedRecords:ie,onSelectedRecordsChange:Oe,onRowClick:j,sort:{field:String(je.columnAccessor),direction:je.direction,onSortChange:(ee,se)=>{Je({columnAccessor:ee,direction:se})}},...f&&fe.length&&{pagination:{totalRecords:$e.length,recordsPerPage:Ye,page:J,onPageChange:ge,recordsPerPageOptions:In,onRecordsPerPageChange:ee=>{Ze(ee),ge(1)}}},..._&&{rowExpansion:{content:_.content}},...Pe.length>0&&{actions:Pe,canUpdate:$,canDelete:O}})})]}),e[71]=O,e[72]=$,e[73]=c,e[74]=Je,e[75]=q,e[76]=K,e[77]=te,e[78]=Pe,e[79]=E,e[80]=j,e[81]=J,e[82]=Ye,e[83]=f,e[84]=fe,e[85]=_,e[86]=ie,e[87]=h,e[88]=ge,e[89]=Ze,e[90]=je,e[91]=$e,e[92]=mt):mt=e[92];let Mt;e[93]===Symbol.for("react.memo_cache_sentinel")?(Mt=()=>{ve(!1),Oe([])},e[93]=Mt):Mt=e[93];const it=n??"Bearbeiten";let pt;e[94]!==S||e[95]!==c||e[96]!==r||e[97]!==ie[0]||e[98]!==ie.length||e[99]!==p?(pt=ie.length>0&&o.jsx(ns,{fields:c.filter(pi),queryKey:r,apiPath:S,id:ie[0].id,onClose:()=>{ve(!1),Oe([])},steps:p}),e[94]=S,e[95]=c,e[96]=r,e[97]=ie[0],e[98]=ie.length,e[99]=p,e[100]=pt):pt=e[100];let ze;e[101]!==it||e[102]!==pt||e[103]!==xt?(ze=o.jsx(u.Modal,{opened:xt,onClose:Mt,title:it,children:pt}),e[101]=it,e[102]=pt,e[103]=xt,e[104]=ze):ze=e[104];let gt;e[105]!==st||e[106]!==S||e[107]!==r||e[108]!==ie||e[109]!==n?(gt=ie.length>0&&o.jsx(u.Modal,{opened:st,onClose:()=>{Ee(!1),Oe([])},title:n??"Löschen",children:o.jsx(rs,{onClose:()=>{Ee(!1),Oe([])},queryKey:r,apiPath:S,selectedRecords:ie})}),e[105]=st,e[106]=S,e[107]=r,e[108]=ie,e[109]=n,e[110]=gt):gt=e[110];let bt;e[111]===Symbol.for("react.memo_cache_sentinel")?(bt=()=>{Ie(!1)},e[111]=bt):bt=e[111];const wt=n??"Anlegen";let Ce;e[112]===Symbol.for("react.memo_cache_sentinel")?(Ce=()=>{Ie(!1)},e[112]=Ce):Ce=e[112];let Be;e[113]!==c?(Be=c.filter(mi),e[113]=c,e[114]=Be):Be=e[114];let tt;e[115]!==S||e[116]!==r||e[117]!==p||e[118]!==Be?(tt=o.jsx(zr,{queryKey:r,apiPath:S,onClose:Ce,fields:Be,steps:p}),e[115]=S,e[116]=r,e[117]=p,e[118]=Be,e[119]=tt):tt=e[119];let ye;e[120]!==qe||e[121]!==wt||e[122]!==tt?(ye=o.jsx(u.Modal,{opened:qe,onClose:bt,title:wt,children:tt}),e[120]=qe,e[121]=wt,e[122]=tt,e[123]=ye):ye=e[123];let Tt;return e[124]!==ce||e[125]!==Le||e[126]!==Qe||e[127]!==ft||e[128]!==mt||e[129]!==ze||e[130]!==gt||e[131]!==ye?(Tt=o.jsxs(o.Fragment,{children:[ce,Le,Qe,ft,mt,ze,gt,ye]}),e[124]=ce,e[125]=Le,e[126]=Qe,e[127]=ft,e[128]=mt,e[129]=ze,e[130]=gt,e[131]=ye,e[132]=Tt):Tt=e[132],Tt}function mi(t){return t.create}function pi(t){return t.update}function gi(t){return t.column}function bi(t,e){return o.jsx(u.Skeleton,{height:35},`skeleton-${e}`)}function yi(t){return o.jsx(u.Tabs.Tab,{value:t.value,leftSection:t.icon,children:t.label},t.value)}function vi(t){return t.create}function xi(t){return t.delete}function Ci(t){return t.update}function Si(t){return t.update}function wi(t){return t.delete}function Di(t){return t.update}function ki(t){const[e,n]=t;return`${e}=${encodeURIComponent(n??"")}`}function _i(t){const[,e]=t;return e!=null}function ji(t){const e=Me.c(2);let n;return e[0]!==t?(n=o.jsx(fi,{...t}),e[0]=t,e[1]=n):n=e[1],n}oe.CreateModal=zr,oe.DataTable=ji,oe.DataTableProvider=Qs,oe.DeleteModal=rs,oe.MobileCardList=is,oe.UpdateModal=ns,oe.api=Js,oe.createOne=pr,oe.deleteOne=mr,oe.getAll=hr,oe.getOne=fr,oe.parseApiError=Ks,oe.sortData=as,oe.updateOne=gr,oe.useAddOne=vr,oe.useDataTable=vt,oe.useDeleteOne=xr,oe.useGetAll=yr,oe.useGetOne=br,oe.usePersistentState=ss,oe.useUpdateOne=wn,Object.defineProperty(oe,Symbol.toStringTag,{value:"Module"})}));
|
|
11
11
|
//# sourceMappingURL=index.umd.js.map
|