@espresso-lab/mantine-data-table 1.10.5 → 1.10.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DataTable/DataTableInner.d.ts +1 -1
- package/dist/DataTable/MobileCardList.d.ts +3 -9
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js +368 -366
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -20,5 +20,5 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
|
|
|
20
20
|
`}return Se%2&&he>0?Me.substring(0,Me.length-Se-1)+Array(Se+1).join("▀"):Me.substring(0,Me.length-1)})(L);E-=1,L=L===void 0?2*E:L;var $,z,Y,ce,o=b.getModuleCount()*E+2*L,u=L,g=o-L,A=Array(E+1).join("██"),R=Array(E+1).join(" "),W="",le="";for($=0;$<o;$+=1){for(Y=Math.floor(($-u)/E),le="",z=0;z<o;z+=1)ce=1,u<=z&&z<g&&u<=$&&$<g&&b.isDark(Y,Math.floor((z-u)/E))&&(ce=0),le+=ce?A:R;for(Y=0;Y<E;Y+=1)W+=le+`
|
|
21
21
|
`}return W.substring(0,W.length-1)},b.renderTo2dContext=function(E,L){L=L||2;for(var $=b.getModuleCount(),z=0;z<$;z++)for(var Y=0;Y<$;Y++)E.fillStyle=b.isDark(z,Y)?"black":"white",E.fillRect(z*L,Y*L,L,L)},b};M.stringToBytes=(M.stringToBytesFuncs={default:function(P){for(var x=[],w=0;w<P.length;w+=1){var h=P.charCodeAt(w);x.push(255&h)}return x}}).default,M.createStringToBytes=function(P,x){var w=(function(){for(var a=ie(P),p=function(){var I=a.read();if(I==-1)throw"eof";return I},f=0,c={};;){var b=a.read();if(b==-1)break;var D=p(),T=p()<<8|p();c[String.fromCharCode(b<<8|D)]=T,f+=1}if(f!=x)throw f+" != "+x;return c})(),h=63;return function(a){for(var p=[],f=0;f<a.length;f+=1){var c=a.charCodeAt(f);if(c<128)p.push(c);else{var b=w[a.charAt(f)];typeof b=="number"?(255&b)==b?p.push(b):(p.push(b>>>8),p.push(255&b)):p.push(h)}}return p}};var S,C,k,j,N,F={L:1,M:0,Q:3,H:2},B=(S=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],C=1335,k=7973,N=function(P){for(var x=0;P!=0;)x+=1,P>>>=1;return x},(j={}).getBCHTypeInfo=function(P){for(var x=P<<10;N(x)-N(C)>=0;)x^=C<<N(x)-N(C);return 21522^(P<<10|x)},j.getBCHTypeNumber=function(P){for(var x=P<<12;N(x)-N(k)>=0;)x^=k<<N(x)-N(k);return P<<12|x},j.getPatternPosition=function(P){return S[P-1]},j.getMaskFunction=function(P){switch(P){case 0:return function(x,w){return(x+w)%2==0};case 1:return function(x,w){return x%2==0};case 2:return function(x,w){return w%3==0};case 3:return function(x,w){return(x+w)%3==0};case 4:return function(x,w){return(Math.floor(x/2)+Math.floor(w/3))%2==0};case 5:return function(x,w){return x*w%2+x*w%3==0};case 6:return function(x,w){return(x*w%2+x*w%3)%2==0};case 7:return function(x,w){return(x*w%3+(x+w)%2)%2==0};default:throw"bad maskPattern:"+P}},j.getErrorCorrectPolynomial=function(P){for(var x=U([1],0),w=0;w<P;w+=1)x=x.multiply(U([1,H.gexp(w)],0));return x},j.getLengthInBits=function(P,x){if(1<=x&&x<10)switch(P){case 1:return 10;case 2:return 9;case 4:case 8:return 8;default:throw"mode:"+P}else if(x<27)switch(P){case 1:return 12;case 2:return 11;case 4:return 16;case 8:return 10;default:throw"mode:"+P}else{if(!(x<41))throw"type:"+x;switch(P){case 1:return 14;case 2:return 13;case 4:return 16;case 8:return 12;default:throw"mode:"+P}}},j.getLostPoint=function(P){for(var x=P.getModuleCount(),w=0,h=0;h<x;h+=1)for(var a=0;a<x;a+=1){for(var p=0,f=P.isDark(h,a),c=-1;c<=1;c+=1)if(!(h+c<0||x<=h+c))for(var b=-1;b<=1;b+=1)a+b<0||x<=a+b||c==0&&b==0||f==P.isDark(h+c,a+b)&&(p+=1);p>5&&(w+=3+p-5)}for(h=0;h<x-1;h+=1)for(a=0;a<x-1;a+=1){var D=0;P.isDark(h,a)&&(D+=1),P.isDark(h+1,a)&&(D+=1),P.isDark(h,a+1)&&(D+=1),P.isDark(h+1,a+1)&&(D+=1),D!=0&&D!=4||(w+=3)}for(h=0;h<x;h+=1)for(a=0;a<x-6;a+=1)P.isDark(h,a)&&!P.isDark(h,a+1)&&P.isDark(h,a+2)&&P.isDark(h,a+3)&&P.isDark(h,a+4)&&!P.isDark(h,a+5)&&P.isDark(h,a+6)&&(w+=40);for(a=0;a<x;a+=1)for(h=0;h<x-6;h+=1)P.isDark(h,a)&&!P.isDark(h+1,a)&&P.isDark(h+2,a)&&P.isDark(h+3,a)&&P.isDark(h+4,a)&&!P.isDark(h+5,a)&&P.isDark(h+6,a)&&(w+=40);var T=0;for(a=0;a<x;a+=1)for(h=0;h<x;h+=1)P.isDark(h,a)&&(T+=1);return w+Math.abs(100*T/x/x-50)/5*10},j),H=(function(){for(var P=new Array(256),x=new Array(256),w=0;w<8;w+=1)P[w]=1<<w;for(w=8;w<256;w+=1)P[w]=P[w-4]^P[w-5]^P[w-6]^P[w-8];for(w=0;w<255;w+=1)x[P[w]]=w;return{glog:function(h){if(h<1)throw"glog("+h+")";return x[h]},gexp:function(h){for(;h<0;)h+=255;for(;h>=256;)h-=255;return P[h]}}})();function U(P,x){if(P.length===void 0)throw P.length+"/"+x;var w=(function(){for(var a=0;a<P.length&&P[a]==0;)a+=1;for(var p=new Array(P.length-a+x),f=0;f<P.length-a;f+=1)p[f]=P[f+a];return p})(),h={getAt:function(a){return w[a]},getLength:function(){return w.length},multiply:function(a){for(var p=new Array(h.getLength()+a.getLength()-1),f=0;f<h.getLength();f+=1)for(var c=0;c<a.getLength();c+=1)p[f+c]^=H.gexp(H.glog(h.getAt(f))+H.glog(a.getAt(c)));return U(p,0)},mod:function(a){if(h.getLength()-a.getLength()<0)return h;for(var p=H.glog(h.getAt(0))-H.glog(a.getAt(0)),f=new Array(h.getLength()),c=0;c<h.getLength();c+=1)f[c]=h.getAt(c);for(c=0;c<a.getLength();c+=1)f[c]^=H.gexp(H.glog(a.getAt(c))+p);return U(f,0).mod(a)}};return h}var re=(function(){var P=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],x=function(h,a){var p={};return p.totalCount=h,p.dataCount=a,p},w={getRSBlocks:function(h,a){var p=(function(ne,te){switch(te){case F.L:return P[4*(ne-1)+0];case F.M:return P[4*(ne-1)+1];case F.Q:return P[4*(ne-1)+2];case F.H:return P[4*(ne-1)+3];default:return}})(h,a);if(p===void 0)throw"bad rs block @ typeNumber:"+h+"/errorCorrectionLevel:"+a;for(var f=p.length/3,c=[],b=0;b<f;b+=1)for(var D=p[3*b+0],T=p[3*b+1],I=p[3*b+2],Q=0;Q<D;Q+=1)c.push(x(T,I));return c}};return w})(),oe=function(){var P=[],x=0,w={getBuffer:function(){return P},getAt:function(h){var a=Math.floor(h/8);return(P[a]>>>7-h%8&1)==1},put:function(h,a){for(var p=0;p<a;p+=1)w.putBit((h>>>a-p-1&1)==1)},getLengthInBits:function(){return x},putBit:function(h){var a=Math.floor(x/8);P.length<=a&&P.push(0),h&&(P[a]|=128>>>x%8),x+=1}};return w},K=function(P){var x=P,w={getMode:function(){return 1},getLength:function(p){return x.length},write:function(p){for(var f=x,c=0;c+2<f.length;)p.put(h(f.substring(c,c+3)),10),c+=3;c<f.length&&(f.length-c==1?p.put(h(f.substring(c,c+1)),4):f.length-c==2&&p.put(h(f.substring(c,c+2)),7))}},h=function(p){for(var f=0,c=0;c<p.length;c+=1)f=10*f+a(p.charAt(c));return f},a=function(p){if("0"<=p&&p<="9")return p.charCodeAt(0)-48;throw"illegal char :"+p};return w},X=function(P){var x=P,w={getMode:function(){return 2},getLength:function(a){return x.length},write:function(a){for(var p=x,f=0;f+1<p.length;)a.put(45*h(p.charAt(f))+h(p.charAt(f+1)),11),f+=2;f<p.length&&a.put(h(p.charAt(f)),6)}},h=function(a){if("0"<=a&&a<="9")return a.charCodeAt(0)-48;if("A"<=a&&a<="Z")return a.charCodeAt(0)-65+10;switch(a){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+a}};return w},q=function(P){var x=M.stringToBytes(P);return{getMode:function(){return 4},getLength:function(w){return x.length},write:function(w){for(var h=0;h<x.length;h+=1)w.put(x[h],8)}}},V=function(P){var x=M.stringToBytesFuncs.SJIS;if(!x)throw"sjis not supported.";(function(){var a=x("友");if(a.length!=2||(a[0]<<8|a[1])!=38726)throw"sjis not supported."})();var w=x(P),h={getMode:function(){return 8},getLength:function(a){return~~(w.length/2)},write:function(a){for(var p=w,f=0;f+1<p.length;){var c=(255&p[f])<<8|255&p[f+1];if(33088<=c&&c<=40956)c-=33088;else{if(!(57408<=c&&c<=60351))throw"illegal char at "+(f+1)+"/"+c;c-=49472}c=192*(c>>>8&255)+(255&c),a.put(c,13),f+=2}if(f<p.length)throw"illegal char at "+(f+1)}};return h},G=function(){var P=[],x={writeByte:function(w){P.push(255&w)},writeShort:function(w){x.writeByte(w),x.writeByte(w>>>8)},writeBytes:function(w,h,a){h=h||0,a=a||w.length;for(var p=0;p<a;p+=1)x.writeByte(w[p+h])},writeString:function(w){for(var h=0;h<w.length;h+=1)x.writeByte(w.charCodeAt(h))},toByteArray:function(){return P},toString:function(){var w="";w+="[";for(var h=0;h<P.length;h+=1)h>0&&(w+=","),w+=P[h];return w+"]"}};return x},ie=function(P){var x=P,w=0,h=0,a=0,p={read:function(){for(;a<8;){if(w>=x.length){if(a==0)return-1;throw"unexpected end of file./"+a}var c=x.charAt(w);if(w+=1,c=="=")return a=0,-1;c.match(/^\s$/)||(h=h<<6|f(c.charCodeAt(0)),a+=6)}var b=h>>>a-8&255;return a-=8,b}},f=function(c){if(65<=c&&c<=90)return c-65;if(97<=c&&c<=122)return c-97+26;if(48<=c&&c<=57)return c-48+52;if(c==43)return 62;if(c==47)return 63;throw"c:"+c};return p},ee=function(P,x,w){for(var h=(function(T,I){var Q=T,ne=I,te=new Array(T*I),ae={setPixel:function(E,L,$){te[L*Q+E]=$},write:function(E){E.writeString("GIF87a"),E.writeShort(Q),E.writeShort(ne),E.writeByte(128),E.writeByte(0),E.writeByte(0),E.writeByte(0),E.writeByte(0),E.writeByte(0),E.writeByte(255),E.writeByte(255),E.writeByte(255),E.writeString(","),E.writeShort(0),E.writeShort(0),E.writeShort(Q),E.writeShort(ne),E.writeByte(0);var L=se(2);E.writeByte(2);for(var $=0;L.length-$>255;)E.writeByte(255),E.writeBytes(L,$,255),$+=255;E.writeByte(L.length-$),E.writeBytes(L,$,L.length-$),E.writeByte(0),E.writeString(";")}},se=function(E){for(var L=1<<E,$=1+(1<<E),z=E+1,Y=ue(),ce=0;ce<L;ce+=1)Y.add(String.fromCharCode(ce));Y.add(String.fromCharCode(L)),Y.add(String.fromCharCode($));var o,u,g,A=G(),R=(o=A,u=0,g=0,{write:function(pe,Z){if(pe>>>Z)throw"length over";for(;u+Z>=8;)o.writeByte(255&(pe<<u|g)),Z-=8-u,pe>>>=8-u,g=0,u=0;g|=pe<<u,u+=Z},flush:function(){u>0&&o.writeByte(g)}});R.write(L,z);var W=0,le=String.fromCharCode(te[W]);for(W+=1;W<te.length;){var he=String.fromCharCode(te[W]);W+=1,Y.contains(le+he)?le+=he:(R.write(Y.indexOf(le),z),Y.size()<4095&&(Y.size()==1<<z&&(z+=1),Y.add(le+he)),le=he)}return R.write(Y.indexOf(le),z),R.write($,z),R.flush(),A.toByteArray()},ue=function(){var E={},L=0,$={add:function(z){if($.contains(z))throw"dup key:"+z;E[z]=L,L+=1},size:function(){return L},indexOf:function(z){return E[z]},contains:function(z){return E[z]!==void 0}};return $};return ae})(P,x),a=0;a<x;a+=1)for(var p=0;p<P;p+=1)h.setPixel(p,a,w(p,a));var f=G();h.write(f);for(var c=(function(){var T=0,I=0,Q=0,ne="",te={},ae=function(ue){ne+=String.fromCharCode(se(63&ue))},se=function(ue){if(!(ue<0)){if(ue<26)return 65+ue;if(ue<52)return ue-26+97;if(ue<62)return ue-52+48;if(ue==62)return 43;if(ue==63)return 47}throw"n:"+ue};return te.writeByte=function(ue){for(T=T<<8|255&ue,I+=8,Q+=1;I>=6;)ae(T>>>I-6),I-=6},te.flush=function(){if(I>0&&(ae(T<<6-I),T=0,I=0),Q%3!=0)for(var ue=3-Q%3,E=0;E<ue;E+=1)ne+="="},te.toString=function(){return ne},te})(),b=f.toByteArray(),D=0;D<b.length;D+=1)c.writeByte(b[D]);return c.flush(),"data:image/gif;base64,"+c};return M})();_.stringToBytesFuncs["UTF-8"]=function(M){return(function(S){for(var C=[],k=0;k<S.length;k++){var j=S.charCodeAt(k);j<128?C.push(j):j<2048?C.push(192|j>>6,128|63&j):j<55296||j>=57344?C.push(224|j>>12,128|j>>6&63,128|63&j):(k++,j=65536+((1023&j)<<10|1023&S.charCodeAt(k)),C.push(240|j>>18,128|j>>12&63,128|j>>6&63,128|63&j))}return C})(M)},(v=typeof(m=function(){return _})=="function"?m.apply(i,[]):m)===void 0||(d.exports=v)}},n={};function s(d){var i=n[d];if(i!==void 0)return i.exports;var m=n[d]={exports:{}};return r[d](m,m.exports,s),m.exports}s.n=d=>{var i=d&&d.__esModule?()=>d.default:()=>d;return s.d(i,{a:i}),i},s.d=(d,i)=>{for(var m in i)s.o(i,m)&&!s.o(d,m)&&Object.defineProperty(d,m,{enumerable:!0,get:i[m]})},s.o=(d,i)=>Object.prototype.hasOwnProperty.call(d,i);var l={};return(()=>{s.d(l,{default:()=>x});const d=w=>!!w&&typeof w=="object"&&!Array.isArray(w);function i(w,...h){if(!h.length)return w;const a=h.shift();return a!==void 0&&d(w)&&d(a)?(w=Object.assign({},w),Object.keys(a).forEach(p=>{const f=w[p],c=a[p];Array.isArray(f)&&Array.isArray(c)?w[p]=c:d(f)&&d(c)?w[p]=i(Object.assign({},f),c):w[p]=c}),i(w,...h)):w}function m(w,h){const a=document.createElement("a");a.download=h,a.href=w,document.body.appendChild(a),a.click(),document.body.removeChild(a)}const v={L:.07,M:.15,Q:.25,H:.3};class _{constructor({svg:h,type:a,window:p}){this._svg=h,this._type=a,this._window=p}draw(h,a,p,f){let c;switch(this._type){case"dots":c=this._drawDot;break;case"classy":c=this._drawClassy;break;case"classy-rounded":c=this._drawClassyRounded;break;case"rounded":c=this._drawRounded;break;case"extra-rounded":c=this._drawExtraRounded;break;default:c=this._drawSquare}c.call(this,{x:h,y:a,size:p,getNeighbor:f})}_rotateFigure({x:h,y:a,size:p,rotation:f=0,draw:c}){var b;const D=h+p/2,T=a+p/2;c(),(b=this._element)===null||b===void 0||b.setAttribute("transform",`rotate(${180*f/Math.PI},${D},${T})`)}_basicDot(h){const{size:a,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","circle"),this._element.setAttribute("cx",String(p+a/2)),this._element.setAttribute("cy",String(f+a/2)),this._element.setAttribute("r",String(a/2))}}))}_basicSquare(h){const{size:a,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect"),this._element.setAttribute("x",String(p)),this._element.setAttribute("y",String(f)),this._element.setAttribute("width",String(a)),this._element.setAttribute("height",String(a))}}))}_basicSideRounded(h){const{size:a,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${p} ${f}v ${a}h `+a/2+`a ${a/2} ${a/2}, 0, 0, 0, 0 ${-a}`)}}))}_basicCornerRounded(h){const{size:a,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${p} ${f}v ${a}h ${a}v `+-a/2+`a ${a/2} ${a/2}, 0, 0, 0, ${-a/2} ${-a/2}`)}}))}_basicCornerExtraRounded(h){const{size:a,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${p} ${f}v ${a}h ${a}a ${a} ${a}, 0, 0, 0, ${-a} ${-a}`)}}))}_basicCornersRounded(h){const{size:a,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${p} ${f}v `+a/2+`a ${a/2} ${a/2}, 0, 0, 0, ${a/2} ${a/2}h `+a/2+"v "+-a/2+`a ${a/2} ${a/2}, 0, 0, 0, ${-a/2} ${-a/2}`)}}))}_drawDot({x:h,y:a,size:p}){this._basicDot({x:h,y:a,size:p,rotation:0})}_drawSquare({x:h,y:a,size:p}){this._basicSquare({x:h,y:a,size:p,rotation:0})}_drawRounded({x:h,y:a,size:p,getNeighbor:f}){const c=f?+f(-1,0):0,b=f?+f(1,0):0,D=f?+f(0,-1):0,T=f?+f(0,1):0,I=c+b+D+T;if(I!==0)if(I>2||c&&b||D&&T)this._basicSquare({x:h,y:a,size:p,rotation:0});else{if(I===2){let Q=0;return c&&D?Q=Math.PI/2:D&&b?Q=Math.PI:b&&T&&(Q=-Math.PI/2),void this._basicCornerRounded({x:h,y:a,size:p,rotation:Q})}if(I===1){let Q=0;return D?Q=Math.PI/2:b?Q=Math.PI:T&&(Q=-Math.PI/2),void this._basicSideRounded({x:h,y:a,size:p,rotation:Q})}}else this._basicDot({x:h,y:a,size:p,rotation:0})}_drawExtraRounded({x:h,y:a,size:p,getNeighbor:f}){const c=f?+f(-1,0):0,b=f?+f(1,0):0,D=f?+f(0,-1):0,T=f?+f(0,1):0,I=c+b+D+T;if(I!==0)if(I>2||c&&b||D&&T)this._basicSquare({x:h,y:a,size:p,rotation:0});else{if(I===2){let Q=0;return c&&D?Q=Math.PI/2:D&&b?Q=Math.PI:b&&T&&(Q=-Math.PI/2),void this._basicCornerExtraRounded({x:h,y:a,size:p,rotation:Q})}if(I===1){let Q=0;return D?Q=Math.PI/2:b?Q=Math.PI:T&&(Q=-Math.PI/2),void this._basicSideRounded({x:h,y:a,size:p,rotation:Q})}}else this._basicDot({x:h,y:a,size:p,rotation:0})}_drawClassy({x:h,y:a,size:p,getNeighbor:f}){const c=f?+f(-1,0):0,b=f?+f(1,0):0,D=f?+f(0,-1):0,T=f?+f(0,1):0;c+b+D+T!==0?c||D?b||T?this._basicSquare({x:h,y:a,size:p,rotation:0}):this._basicCornerRounded({x:h,y:a,size:p,rotation:Math.PI/2}):this._basicCornerRounded({x:h,y:a,size:p,rotation:-Math.PI/2}):this._basicCornersRounded({x:h,y:a,size:p,rotation:Math.PI/2})}_drawClassyRounded({x:h,y:a,size:p,getNeighbor:f}){const c=f?+f(-1,0):0,b=f?+f(1,0):0,D=f?+f(0,-1):0,T=f?+f(0,1):0;c+b+D+T!==0?c||D?b||T?this._basicSquare({x:h,y:a,size:p,rotation:0}):this._basicCornerExtraRounded({x:h,y:a,size:p,rotation:Math.PI/2}):this._basicCornerExtraRounded({x:h,y:a,size:p,rotation:-Math.PI/2}):this._basicCornersRounded({x:h,y:a,size:p,rotation:Math.PI/2})}}const M={dot:"dot",square:"square",extraRounded:"extra-rounded"},S=Object.values(M);class C{constructor({svg:h,type:a,window:p}){this._svg=h,this._type=a,this._window=p}draw(h,a,p,f){let c;switch(this._type){case M.square:c=this._drawSquare;break;case M.extraRounded:c=this._drawExtraRounded;break;default:c=this._drawDot}c.call(this,{x:h,y:a,size:p,rotation:f})}_rotateFigure({x:h,y:a,size:p,rotation:f=0,draw:c}){var b;const D=h+p/2,T=a+p/2;c(),(b=this._element)===null||b===void 0||b.setAttribute("transform",`rotate(${180*f/Math.PI},${D},${T})`)}_basicDot(h){const{size:a,x:p,y:f}=h,c=a/7;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("clip-rule","evenodd"),this._element.setAttribute("d",`M ${p+a/2} ${f}a ${a/2} ${a/2} 0 1 0 0.1 0zm 0 ${c}a ${a/2-c} ${a/2-c} 0 1 1 -0.1 0Z`)}}))}_basicSquare(h){const{size:a,x:p,y:f}=h,c=a/7;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("clip-rule","evenodd"),this._element.setAttribute("d",`M ${p} ${f}v ${a}h ${a}v `+-a+`zM ${p+c} ${f+c}h `+(a-2*c)+"v "+(a-2*c)+"h "+(2*c-a)+"z")}}))}_basicExtraRounded(h){const{size:a,x:p,y:f}=h,c=a/7;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("clip-rule","evenodd"),this._element.setAttribute("d",`M ${p} ${f+2.5*c}v `+2*c+`a ${2.5*c} ${2.5*c}, 0, 0, 0, ${2.5*c} ${2.5*c}h `+2*c+`a ${2.5*c} ${2.5*c}, 0, 0, 0, ${2.5*c} ${2.5*-c}v `+-2*c+`a ${2.5*c} ${2.5*c}, 0, 0, 0, ${2.5*-c} ${2.5*-c}h `+-2*c+`a ${2.5*c} ${2.5*c}, 0, 0, 0, ${2.5*-c} ${2.5*c}M ${p+2.5*c} ${f+c}h `+2*c+`a ${1.5*c} ${1.5*c}, 0, 0, 1, ${1.5*c} ${1.5*c}v `+2*c+`a ${1.5*c} ${1.5*c}, 0, 0, 1, ${1.5*-c} ${1.5*c}h `+-2*c+`a ${1.5*c} ${1.5*c}, 0, 0, 1, ${1.5*-c} ${1.5*-c}v `+-2*c+`a ${1.5*c} ${1.5*c}, 0, 0, 1, ${1.5*c} ${1.5*-c}`)}}))}_drawDot({x:h,y:a,size:p,rotation:f}){this._basicDot({x:h,y:a,size:p,rotation:f})}_drawSquare({x:h,y:a,size:p,rotation:f}){this._basicSquare({x:h,y:a,size:p,rotation:f})}_drawExtraRounded({x:h,y:a,size:p,rotation:f}){this._basicExtraRounded({x:h,y:a,size:p,rotation:f})}}const k={dot:"dot",square:"square"},j=Object.values(k);class N{constructor({svg:h,type:a,window:p}){this._svg=h,this._type=a,this._window=p}draw(h,a,p,f){let c;c=this._type===k.square?this._drawSquare:this._drawDot,c.call(this,{x:h,y:a,size:p,rotation:f})}_rotateFigure({x:h,y:a,size:p,rotation:f=0,draw:c}){var b;const D=h+p/2,T=a+p/2;c(),(b=this._element)===null||b===void 0||b.setAttribute("transform",`rotate(${180*f/Math.PI},${D},${T})`)}_basicDot(h){const{size:a,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","circle"),this._element.setAttribute("cx",String(p+a/2)),this._element.setAttribute("cy",String(f+a/2)),this._element.setAttribute("r",String(a/2))}}))}_basicSquare(h){const{size:a,x:p,y:f}=h;this._rotateFigure(Object.assign(Object.assign({},h),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect"),this._element.setAttribute("x",String(p)),this._element.setAttribute("y",String(f)),this._element.setAttribute("width",String(a)),this._element.setAttribute("height",String(a))}}))}_drawDot({x:h,y:a,size:p,rotation:f}){this._basicDot({x:h,y:a,size:p,rotation:f})}_drawSquare({x:h,y:a,size:p,rotation:f}){this._basicSquare({x:h,y:a,size:p,rotation:f})}}const F="circle",B=[[1,1,1,1,1,1,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,1,1,1,1,1,1]],H=[[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,1,1,1,0,0],[0,0,1,1,1,0,0],[0,0,1,1,1,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]];class U{constructor(h,a){this._roundSize=p=>this._options.dotsOptions.roundSize?Math.floor(p):p,this._window=a,this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("width",String(h.width)),this._element.setAttribute("height",String(h.height)),this._element.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),h.dotsOptions.roundSize||this._element.setAttribute("shape-rendering","crispEdges"),this._element.setAttribute("viewBox",`0 0 ${h.width} ${h.height}`),this._defs=this._window.document.createElementNS("http://www.w3.org/2000/svg","defs"),this._element.appendChild(this._defs),this._imageUri=h.image,this._instanceId=U.instanceCount++,this._options=h}get width(){return this._options.width}get height(){return this._options.height}getElement(){return this._element}async drawQR(h){const a=h.getModuleCount(),p=Math.min(this._options.width,this._options.height)-2*this._options.margin,f=this._options.shape===F?p/Math.sqrt(2):p,c=this._roundSize(f/a);let b={hideXDots:0,hideYDots:0,width:0,height:0};if(this._qr=h,this._options.image){if(await this.loadImage(),!this._image)return;const{imageOptions:D,qrOptions:T}=this._options,I=D.imageSize*v[T.errorCorrectionLevel],Q=Math.floor(I*a*a);b=(function({originalHeight:ne,originalWidth:te,maxHiddenDots:ae,maxHiddenAxisDots:se,dotSize:ue}){const E={x:0,y:0},L={x:0,y:0};if(ne<=0||te<=0||ae<=0||ue<=0)return{height:0,width:0,hideYDots:0,hideXDots:0};const $=ne/te;return E.x=Math.floor(Math.sqrt(ae/$)),E.x<=0&&(E.x=1),se&&se<E.x&&(E.x=se),E.x%2==0&&E.x--,L.x=E.x*ue,E.y=1+2*Math.ceil((E.x*$-1)/2),L.y=Math.round(L.x*$),(E.y*E.x>ae||se&&se<E.y)&&(se&&se<E.y?(E.y=se,E.y%2==0&&E.x--):E.y-=2,L.y=E.y*ue,E.x=1+2*Math.ceil((E.y/$-1)/2),L.x=Math.round(L.y/$)),{height:L.y,width:L.x,hideYDots:E.y,hideXDots:E.x}})({originalWidth:this._image.width,originalHeight:this._image.height,maxHiddenDots:Q,maxHiddenAxisDots:a-14,dotSize:c})}this.drawBackground(),this.drawDots((D,T)=>{var I,Q,ne,te,ae,se;return!(this._options.imageOptions.hideBackgroundDots&&D>=(a-b.hideYDots)/2&&D<(a+b.hideYDots)/2&&T>=(a-b.hideXDots)/2&&T<(a+b.hideXDots)/2||!((I=B[D])===null||I===void 0)&&I[T]||!((Q=B[D-a+7])===null||Q===void 0)&&Q[T]||!((ne=B[D])===null||ne===void 0)&&ne[T-a+7]||!((te=H[D])===null||te===void 0)&&te[T]||!((ae=H[D-a+7])===null||ae===void 0)&&ae[T]||!((se=H[D])===null||se===void 0)&&se[T-a+7])}),this.drawCorners(),this._options.image&&await this.drawImage({width:b.width,height:b.height,count:a,dotSize:c})}drawBackground(){var h,a,p;const f=this._element,c=this._options;if(f){const b=(h=c.backgroundOptions)===null||h===void 0?void 0:h.gradient,D=(a=c.backgroundOptions)===null||a===void 0?void 0:a.color;let T=c.height,I=c.width;if(b||D){const Q=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect");this._backgroundClipPath=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),this._backgroundClipPath.setAttribute("id",`clip-path-background-color-${this._instanceId}`),this._defs.appendChild(this._backgroundClipPath),!((p=c.backgroundOptions)===null||p===void 0)&&p.round&&(T=I=Math.min(c.width,c.height),Q.setAttribute("rx",String(T/2*c.backgroundOptions.round))),Q.setAttribute("x",String(this._roundSize((c.width-I)/2))),Q.setAttribute("y",String(this._roundSize((c.height-T)/2))),Q.setAttribute("width",String(I)),Q.setAttribute("height",String(T)),this._backgroundClipPath.appendChild(Q),this._createColor({options:b,color:D,additionalRotation:0,x:0,y:0,height:c.height,width:c.width,name:`background-color-${this._instanceId}`})}}}drawDots(h){var a,p;if(!this._qr)throw"QR code is not defined";const f=this._options,c=this._qr.getModuleCount();if(c>f.width||c>f.height)throw"The canvas is too small.";const b=Math.min(f.width,f.height)-2*f.margin,D=f.shape===F?b/Math.sqrt(2):b,T=this._roundSize(D/c),I=this._roundSize((f.width-c*T)/2),Q=this._roundSize((f.height-c*T)/2),ne=new _({svg:this._element,type:f.dotsOptions.type,window:this._window});this._dotsClipPath=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),this._dotsClipPath.setAttribute("id",`clip-path-dot-color-${this._instanceId}`),this._defs.appendChild(this._dotsClipPath),this._createColor({options:(a=f.dotsOptions)===null||a===void 0?void 0:a.gradient,color:f.dotsOptions.color,additionalRotation:0,x:0,y:0,height:f.height,width:f.width,name:`dot-color-${this._instanceId}`});for(let te=0;te<c;te++)for(let ae=0;ae<c;ae++)h&&!h(te,ae)||!((p=this._qr)===null||p===void 0)&&p.isDark(te,ae)&&(ne.draw(I+ae*T,Q+te*T,T,(se,ue)=>!(ae+se<0||te+ue<0||ae+se>=c||te+ue>=c)&&!(h&&!h(te+ue,ae+se))&&!!this._qr&&this._qr.isDark(te+ue,ae+se)),ne._element&&this._dotsClipPath&&this._dotsClipPath.appendChild(ne._element));if(f.shape===F){const te=this._roundSize((b/T-c)/2),ae=c+2*te,se=I-te*T,ue=Q-te*T,E=[],L=this._roundSize(ae/2);for(let $=0;$<ae;$++){E[$]=[];for(let z=0;z<ae;z++)$>=te-1&&$<=ae-te&&z>=te-1&&z<=ae-te||Math.sqrt(($-L)*($-L)+(z-L)*(z-L))>L?E[$][z]=0:E[$][z]=this._qr.isDark(z-2*te<0?z:z>=c?z-2*te:z-te,$-2*te<0?$:$>=c?$-2*te:$-te)?1:0}for(let $=0;$<ae;$++)for(let z=0;z<ae;z++)E[$][z]&&(ne.draw(se+z*T,ue+$*T,T,(Y,ce)=>{var o;return!!(!((o=E[$+ce])===null||o===void 0)&&o[z+Y])}),ne._element&&this._dotsClipPath&&this._dotsClipPath.appendChild(ne._element))}}drawCorners(){if(!this._qr)throw"QR code is not defined";const h=this._element,a=this._options;if(!h)throw"Element code is not defined";const p=this._qr.getModuleCount(),f=Math.min(a.width,a.height)-2*a.margin,c=a.shape===F?f/Math.sqrt(2):f,b=this._roundSize(c/p),D=7*b,T=3*b,I=this._roundSize((a.width-p*b)/2),Q=this._roundSize((a.height-p*b)/2);[[0,0,0],[1,0,Math.PI/2],[0,1,-Math.PI/2]].forEach(([ne,te,ae])=>{var se,ue,E,L,$,z,Y,ce,o,u,g,A,R,W;const le=I+ne*b*(p-7),he=Q+te*b*(p-7);let pe=this._dotsClipPath,Z=this._dotsClipPath;if((!((se=a.cornersSquareOptions)===null||se===void 0)&&se.gradient||!((ue=a.cornersSquareOptions)===null||ue===void 0)&&ue.color)&&(pe=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),pe.setAttribute("id",`clip-path-corners-square-color-${ne}-${te}-${this._instanceId}`),this._defs.appendChild(pe),this._cornersSquareClipPath=this._cornersDotClipPath=Z=pe,this._createColor({options:(E=a.cornersSquareOptions)===null||E===void 0?void 0:E.gradient,color:(L=a.cornersSquareOptions)===null||L===void 0?void 0:L.color,additionalRotation:ae,x:le,y:he,height:D,width:D,name:`corners-square-color-${ne}-${te}-${this._instanceId}`})),(($=a.cornersSquareOptions)===null||$===void 0?void 0:$.type)&&S.includes(a.cornersSquareOptions.type)){const fe=new C({svg:this._element,type:a.cornersSquareOptions.type,window:this._window});fe.draw(le,he,D,ae),fe._element&&pe&&pe.appendChild(fe._element)}else{const fe=new _({svg:this._element,type:((z=a.cornersSquareOptions)===null||z===void 0?void 0:z.type)||a.dotsOptions.type,window:this._window});for(let me=0;me<B.length;me++)for(let ge=0;ge<B[me].length;ge++)!((Y=B[me])===null||Y===void 0)&&Y[ge]&&(fe.draw(le+ge*b,he+me*b,b,(Se,xe)=>{var Pe;return!!(!((Pe=B[me+xe])===null||Pe===void 0)&&Pe[ge+Se])}),fe._element&&pe&&pe.appendChild(fe._element))}if((!((ce=a.cornersDotOptions)===null||ce===void 0)&&ce.gradient||!((o=a.cornersDotOptions)===null||o===void 0)&&o.color)&&(Z=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),Z.setAttribute("id",`clip-path-corners-dot-color-${ne}-${te}-${this._instanceId}`),this._defs.appendChild(Z),this._cornersDotClipPath=Z,this._createColor({options:(u=a.cornersDotOptions)===null||u===void 0?void 0:u.gradient,color:(g=a.cornersDotOptions)===null||g===void 0?void 0:g.color,additionalRotation:ae,x:le+2*b,y:he+2*b,height:T,width:T,name:`corners-dot-color-${ne}-${te}-${this._instanceId}`})),((A=a.cornersDotOptions)===null||A===void 0?void 0:A.type)&&j.includes(a.cornersDotOptions.type)){const fe=new N({svg:this._element,type:a.cornersDotOptions.type,window:this._window});fe.draw(le+2*b,he+2*b,T,ae),fe._element&&Z&&Z.appendChild(fe._element)}else{const fe=new _({svg:this._element,type:((R=a.cornersDotOptions)===null||R===void 0?void 0:R.type)||a.dotsOptions.type,window:this._window});for(let me=0;me<H.length;me++)for(let ge=0;ge<H[me].length;ge++)!((W=H[me])===null||W===void 0)&&W[ge]&&(fe.draw(le+ge*b,he+me*b,b,(Se,xe)=>{var Pe;return!!(!((Pe=H[me+xe])===null||Pe===void 0)&&Pe[ge+Se])}),fe._element&&Z&&Z.appendChild(fe._element))}})}loadImage(){return new Promise((h,a)=>{var p;const f=this._options;if(!f.image)return a("Image is not defined");if(!((p=f.nodeCanvas)===null||p===void 0)&&p.loadImage)f.nodeCanvas.loadImage(f.image).then(c=>{var b,D;if(this._image=c,this._options.imageOptions.saveAsBlob){const T=(b=f.nodeCanvas)===null||b===void 0?void 0:b.createCanvas(this._image.width,this._image.height);(D=T?.getContext("2d"))===null||D===void 0||D.drawImage(c,0,0),this._imageUri=T?.toDataURL()}h()}).catch(a);else{const c=new this._window.Image;typeof f.imageOptions.crossOrigin=="string"&&(c.crossOrigin=f.imageOptions.crossOrigin),this._image=c,c.onload=async()=>{this._options.imageOptions.saveAsBlob&&(this._imageUri=await(async function(b,D){return new Promise(T=>{const I=new D.XMLHttpRequest;I.onload=function(){const Q=new D.FileReader;Q.onloadend=function(){T(Q.result)},Q.readAsDataURL(I.response)},I.open("GET",b),I.responseType="blob",I.send()})})(f.image||"",this._window)),h()},c.src=f.image}})}async drawImage({width:h,height:a,count:p,dotSize:f}){const c=this._options,b=this._roundSize((c.width-p*f)/2),D=this._roundSize((c.height-p*f)/2),T=b+this._roundSize(c.imageOptions.margin+(p*f-h)/2),I=D+this._roundSize(c.imageOptions.margin+(p*f-a)/2),Q=h-2*c.imageOptions.margin,ne=a-2*c.imageOptions.margin,te=this._window.document.createElementNS("http://www.w3.org/2000/svg","image");te.setAttribute("href",this._imageUri||""),te.setAttribute("xlink:href",this._imageUri||""),te.setAttribute("x",String(T)),te.setAttribute("y",String(I)),te.setAttribute("width",`${Q}px`),te.setAttribute("height",`${ne}px`),this._element.appendChild(te)}_createColor({options:h,color:a,additionalRotation:p,x:f,y:c,height:b,width:D,name:T}){const I=D>b?D:b,Q=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect");if(Q.setAttribute("x",String(f)),Q.setAttribute("y",String(c)),Q.setAttribute("height",String(b)),Q.setAttribute("width",String(D)),Q.setAttribute("clip-path",`url('#clip-path-${T}')`),h){let ne;if(h.type==="radial")ne=this._window.document.createElementNS("http://www.w3.org/2000/svg","radialGradient"),ne.setAttribute("id",T),ne.setAttribute("gradientUnits","userSpaceOnUse"),ne.setAttribute("fx",String(f+D/2)),ne.setAttribute("fy",String(c+b/2)),ne.setAttribute("cx",String(f+D/2)),ne.setAttribute("cy",String(c+b/2)),ne.setAttribute("r",String(I/2));else{const te=((h.rotation||0)+p)%(2*Math.PI),ae=(te+2*Math.PI)%(2*Math.PI);let se=f+D/2,ue=c+b/2,E=f+D/2,L=c+b/2;ae>=0&&ae<=.25*Math.PI||ae>1.75*Math.PI&&ae<=2*Math.PI?(se-=D/2,ue-=b/2*Math.tan(te),E+=D/2,L+=b/2*Math.tan(te)):ae>.25*Math.PI&&ae<=.75*Math.PI?(ue-=b/2,se-=D/2/Math.tan(te),L+=b/2,E+=D/2/Math.tan(te)):ae>.75*Math.PI&&ae<=1.25*Math.PI?(se+=D/2,ue+=b/2*Math.tan(te),E-=D/2,L-=b/2*Math.tan(te)):ae>1.25*Math.PI&&ae<=1.75*Math.PI&&(ue+=b/2,se+=D/2/Math.tan(te),L-=b/2,E-=D/2/Math.tan(te)),ne=this._window.document.createElementNS("http://www.w3.org/2000/svg","linearGradient"),ne.setAttribute("id",T),ne.setAttribute("gradientUnits","userSpaceOnUse"),ne.setAttribute("x1",String(Math.round(se))),ne.setAttribute("y1",String(Math.round(ue))),ne.setAttribute("x2",String(Math.round(E))),ne.setAttribute("y2",String(Math.round(L)))}h.colorStops.forEach(({offset:te,color:ae})=>{const se=this._window.document.createElementNS("http://www.w3.org/2000/svg","stop");se.setAttribute("offset",100*te+"%"),se.setAttribute("stop-color",ae),ne.appendChild(se)}),Q.setAttribute("fill",`url('#${T}')`),this._defs.appendChild(ne)}else a&&Q.setAttribute("fill",a);this._element.appendChild(Q)}}U.instanceCount=0;const re=U,oe="canvas",K={};for(let w=0;w<=40;w++)K[w]=w;const X={type:oe,shape:"square",width:300,height:300,data:"",margin:0,qrOptions:{typeNumber:K[0],mode:void 0,errorCorrectionLevel:"Q"},imageOptions:{saveAsBlob:!0,hideBackgroundDots:!0,imageSize:.4,crossOrigin:void 0,margin:0},dotsOptions:{type:"square",color:"#000",roundSize:!0},backgroundOptions:{round:0,color:"#fff"}};function q(w){const h=Object.assign({},w);if(!h.colorStops||!h.colorStops.length)throw"Field 'colorStops' is required in gradient";return h.rotation?h.rotation=Number(h.rotation):h.rotation=0,h.colorStops=h.colorStops.map(a=>Object.assign(Object.assign({},a),{offset:Number(a.offset)})),h}function V(w){const h=Object.assign({},w);return h.width=Number(h.width),h.height=Number(h.height),h.margin=Number(h.margin),h.imageOptions=Object.assign(Object.assign({},h.imageOptions),{hideBackgroundDots:!!h.imageOptions.hideBackgroundDots,imageSize:Number(h.imageOptions.imageSize),margin:Number(h.imageOptions.margin)}),h.margin>Math.min(h.width,h.height)&&(h.margin=Math.min(h.width,h.height)),h.dotsOptions=Object.assign({},h.dotsOptions),h.dotsOptions.gradient&&(h.dotsOptions.gradient=q(h.dotsOptions.gradient)),h.cornersSquareOptions&&(h.cornersSquareOptions=Object.assign({},h.cornersSquareOptions),h.cornersSquareOptions.gradient&&(h.cornersSquareOptions.gradient=q(h.cornersSquareOptions.gradient))),h.cornersDotOptions&&(h.cornersDotOptions=Object.assign({},h.cornersDotOptions),h.cornersDotOptions.gradient&&(h.cornersDotOptions.gradient=q(h.cornersDotOptions.gradient))),h.backgroundOptions&&(h.backgroundOptions=Object.assign({},h.backgroundOptions),h.backgroundOptions.gradient&&(h.backgroundOptions.gradient=q(h.backgroundOptions.gradient))),h}var G=s(873),ie=s.n(G);function ee(w){if(!w)throw new Error("Extension must be defined");w[0]==="."&&(w=w.substring(1));const h={bmp:"image/bmp",gif:"image/gif",ico:"image/vnd.microsoft.icon",jpeg:"image/jpeg",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml",tif:"image/tiff",tiff:"image/tiff",webp:"image/webp",pdf:"application/pdf"}[w.toLowerCase()];if(!h)throw new Error(`Extension "${w}" is not supported`);return h}class P{constructor(h){h!=null&&h.jsdom?this._window=new h.jsdom("",{resources:"usable"}).window:this._window=window,this._options=h?V(i(X,h)):X,this.update()}static _clearContainer(h){h&&(h.innerHTML="")}_setupSvg(){if(!this._qr)return;const h=new re(this._options,this._window);this._svg=h.getElement(),this._svgDrawingPromise=h.drawQR(this._qr).then(()=>{var a;this._svg&&((a=this._extension)===null||a===void 0||a.call(this,h.getElement(),this._options))})}_setupCanvas(){var h,a;this._qr&&(!((h=this._options.nodeCanvas)===null||h===void 0)&&h.createCanvas?(this._nodeCanvas=this._options.nodeCanvas.createCanvas(this._options.width,this._options.height),this._nodeCanvas.width=this._options.width,this._nodeCanvas.height=this._options.height):(this._domCanvas=document.createElement("canvas"),this._domCanvas.width=this._options.width,this._domCanvas.height=this._options.height),this._setupSvg(),this._canvasDrawingPromise=(a=this._svgDrawingPromise)===null||a===void 0?void 0:a.then(()=>{var p;if(!this._svg)return;const f=this._svg,c=new this._window.XMLSerializer().serializeToString(f),b=btoa(c),D=`data:${ee("svg")};base64,${b}`;if(!((p=this._options.nodeCanvas)===null||p===void 0)&&p.loadImage)return this._options.nodeCanvas.loadImage(D).then(T=>{var I,Q;T.width=this._options.width,T.height=this._options.height,(Q=(I=this._nodeCanvas)===null||I===void 0?void 0:I.getContext("2d"))===null||Q===void 0||Q.drawImage(T,0,0)});{const T=new this._window.Image;return new Promise(I=>{T.onload=()=>{var Q,ne;(ne=(Q=this._domCanvas)===null||Q===void 0?void 0:Q.getContext("2d"))===null||ne===void 0||ne.drawImage(T,0,0),I()},T.src=D})}}))}async _getElement(h="png"){if(!this._qr)throw"QR code is empty";return h.toLowerCase()==="svg"?(this._svg&&this._svgDrawingPromise||this._setupSvg(),await this._svgDrawingPromise,this._svg):((this._domCanvas||this._nodeCanvas)&&this._canvasDrawingPromise||this._setupCanvas(),await this._canvasDrawingPromise,this._domCanvas||this._nodeCanvas)}update(h){P._clearContainer(this._container),this._options=h?V(i(this._options,h)):this._options,this._options.data&&(this._qr=ie()(this._options.qrOptions.typeNumber,this._options.qrOptions.errorCorrectionLevel),this._qr.addData(this._options.data,this._options.qrOptions.mode||(function(a){switch(!0){case/^[0-9]*$/.test(a):return"Numeric";case/^[0-9A-Z $%*+\-./:]*$/.test(a):return"Alphanumeric";default:return"Byte"}})(this._options.data)),this._qr.make(),this._options.type===oe?this._setupCanvas():this._setupSvg(),this.append(this._container))}append(h){if(h){if(typeof h.appendChild!="function")throw"Container should be a single DOM node";this._options.type===oe?this._domCanvas&&h.appendChild(this._domCanvas):this._svg&&h.appendChild(this._svg),this._container=h}}applyExtension(h){if(!h)throw"Extension function should be defined.";this._extension=h,this.update()}deleteExtension(){this._extension=void 0,this.update()}async getRawData(h="png"){if(!this._qr)throw"QR code is empty";const a=await this._getElement(h),p=ee(h);if(!a)return null;if(h.toLowerCase()==="svg"){const f=`<?xml version="1.0" standalone="no"?>\r
|
|
22
22
|
${new this._window.XMLSerializer().serializeToString(a)}`;return typeof Blob>"u"||this._options.jsdom?Buffer.from(f):new Blob([f],{type:p})}return new Promise(f=>{const c=a;if("toBuffer"in c)if(p==="image/png")f(c.toBuffer(p));else if(p==="image/jpeg")f(c.toBuffer(p));else{if(p!=="application/pdf")throw Error("Unsupported extension");f(c.toBuffer(p))}else"toBlob"in c&&c.toBlob(f,p,1)})}async download(h){if(!this._qr)throw"QR code is empty";if(typeof Blob>"u")throw"Cannot download in Node.js, call getRawData instead.";let a="png",p="qr";typeof h=="string"?(a=h,console.warn("Extension is deprecated as argument for 'download' method, please pass object { name: '...', extension: '...' } as argument")):typeof h=="object"&&h!==null&&(h.name&&(p=h.name),h.extension&&(a=h.extension));const f=await this._getElement(a);if(f)if(a.toLowerCase()==="svg"){let c=new XMLSerializer().serializeToString(f);c=`<?xml version="1.0" standalone="no"?>\r
|
|
23
|
-
`+c,m(`data:${ee(a)};charset=utf-8,${encodeURIComponent(c)}`,`${p}.svg`)}else m(f.toDataURL(ee(a)),`${p}.${a}`)}}const x=P})(),l.default})())})(sn)),sn.exports}gl();const Io=J.createContext(void 0);function ml(t){const e=Fe.c(9),{children:r,baseUrl:n,queryClient:s}=t;let l;e[0]!==n||e[1]!==s?(l={baseUrl:n,queryClient:s},e[0]=n,e[1]=s,e[2]=l):l=e[2];let d;e[3]!==r||e[4]!==s?(d=y.jsx(Kn,{client:s,children:r}),e[3]=r,e[4]=s,e[5]=d):d=e[5];let i;return e[6]!==l||e[7]!==d?(i=y.jsx(Io.Provider,{value:l,children:d}),e[6]=l,e[7]=d,e[8]=i):i=e[8],i}function ft(){const t=J.useContext(Io);if(!t)throw new Error("useDataTable must be used within a DataTableProvider");return t}function an(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 Ot(t){const e=await t.text();if(!e)throw new Error(`HTTP ${t.status}: ${t.statusText}`);let r=null;try{r=JSON.parse(e)}catch{throw new Error(e)}throw r?.message?new Error(r.message):r?.error?new Error(r.error):new Error(e)}function yl(){const t=localStorage.getItem("a360.assumed-org");return t?{"X-Assume-Org":t}:{}}async function xt(){return{"Content-Type":"application/json",Authorization:`Bearer ${await ol()??""}`,...yl()}}async function Yo(t){return fetch(t,{method:"GET",headers:await xt()}).then(async e=>(e.status>=400&&await Ot(e),e)).then(e=>e.json()).then(e=>e)}async function zo(t,e){return fetch(`${t}/${e}`,{method:"GET",headers:await xt()}).then(async r=>(r.status>=400&&await Ot(r),r)).then(r=>r.json()).then(r=>r)}async function Fo(t,e){const r=await fetch(`${t}/${e}`,{method:"DELETE",headers:await xt()});r.status>=400&&await Ot(r)}async function Wo(t,e){return fetch(t,{method:"POST",headers:await xt(),body:JSON.stringify(e)}).then(async r=>(r.status>=400&&await Ot(r),r)).then(r=>r.status==204?e:r.json()).then(r=>r)}async function vl(t,e,r){return fetch(e,{method:t,headers:await xt(),body:r?JSON.stringify(r):void 0}).then(async n=>(n.status>=400&&await Ot(n),n)).then(n=>{if(n.status!=204)return n.json()}).then(n=>n)}async function Uo(t,e){return fetch(`${t}/${e.id}`,{method:"PUT",headers:await xt(),body:JSON.stringify(e)}).then(async r=>(r.status>=400&&await Ot(r),r)).then(r=>r.status==204?e:r.json()).then(r=>r)}function qo(t,e,r){const n=Fe.c(13),{baseUrl:s}=ft();let l;if(n[0]!==r||n[1]!==e){let v;n[3]!==r?(v=r?.toString(),n[3]=r,n[4]=v):v=n[4],l=[...e.map(bl),String(v)],n[0]=r,n[1]=e,n[2]=l}else l=n[2];let d;n[5]!==t||n[6]!==s||n[7]!==r?(d=()=>zo(`${s}${t}`,r),n[5]=t,n[6]=s,n[7]=r,n[8]=d):d=n[8];const i=!!r;let m;return n[9]!==l||n[10]!==d||n[11]!==i?(m={queryKey:l,queryFn:d,enabled:i},n[9]=l,n[10]=d,n[11]=i,n[12]=m):m=n[12],Xn(m)}function bl(t){return t.toString()}function Vo(t,e,r){const n=Fe.c(9),s=r===void 0?!0:r,{baseUrl:l}=ft();let d;n[0]!==e?(d=[...e.map(wl)],n[0]=e,n[1]=d):d=n[1];let i;n[2]!==t||n[3]!==l?(i=()=>Yo(`${l}${t}`),n[2]=t,n[3]=l,n[4]=i):i=n[4];let m;return n[5]!==s||n[6]!==d||n[7]!==i?(m={queryKey:d,queryFn:i,enabled:s},n[5]=s,n[6]=d,n[7]=i,n[8]=m):m=n[8],Xn(m)}function wl(t){return t.toString()}function Ho(t,e){const r=Fe.c(10),{baseUrl:n,queryClient:s}=ft();let l;r[0]!==e?(l=[...e.map(xl)],r[0]=e,r[1]=l):l=r[1];let d;r[2]!==t||r[3]!==n?(d=m=>Wo(`${n}${t}`,m),r[2]=t,r[3]=n,r[4]=d):d=r[4];let i;return r[5]!==s||r[6]!==e||r[7]!==l||r[8]!==d?(i={mutationKey:l,mutationFn:d,onSettled(){return s.invalidateQueries({queryKey:[...e.map(_l)]})},onError(m){an(m)}},r[5]=s,r[6]=e,r[7]=l,r[8]=d,r[9]=i):i=r[9],Yr(i)}function _l(t){return t.toString()}function xl(t){return t.toString()}function ln(t,e){const r=Fe.c(10),{baseUrl:n,queryClient:s}=ft();let l;r[0]!==e?(l=[...e.map(Sl)],r[0]=e,r[1]=l):l=r[1];let d;r[2]!==t||r[3]!==n?(d=m=>Uo(`${n}${t}`,m),r[2]=t,r[3]=n,r[4]=d):d=r[4];let i;return r[5]!==s||r[6]!==e||r[7]!==l||r[8]!==d?(i={mutationKey:l,mutationFn:d,onSettled(){return s.invalidateQueries({queryKey:[...e.map(Cl)]})},onError(m){an(m)}},r[5]=s,r[6]=e,r[7]=l,r[8]=d,r[9]=i):i=r[9],Yr(i)}function Cl(t){return t.toString()}function Sl(t){return t.toString()}function Go(t,e){const r=Fe.c(10),{baseUrl:n,queryClient:s}=ft();let l;r[0]!==e?(l=[...e.map(kl)],r[0]=e,r[1]=l):l=r[1];let d;r[2]!==t||r[3]!==n?(d=m=>Fo(`${n}${t}`,m),r[2]=t,r[3]=n,r[4]=d):d=r[4];let i;return r[5]!==s||r[6]!==e||r[7]!==l||r[8]!==d?(i={mutationKey:l,mutationFn:d,onSettled(){return s.invalidateQueries({queryKey:[...e.map(Dl)]})},onError(m){an(m)}},r[5]=s,r[6]=e,r[7]=l,r[8]=d,r[9]=i):i=r[9],Yr(i)}function Dl(t){return t.toString()}function kl(t){return t.toString()}var dr={exports:{}},Pl=dr.exports,Qo;function Ml(){return Qo||(Qo=1,(function(t,e){(function(r,n){t.exports=n()})(Pl,(function(){var r=1e3,n=6e4,s=36e5,l="millisecond",d="second",i="minute",m="hour",v="day",_="week",M="month",S="quarter",C="year",k="date",j="Invalid Date",N=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,F=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,B={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(P){var x=["th","st","nd","rd"],w=P%100;return"["+P+(x[(w-20)%10]||x[w]||x[0])+"]"}},H=function(P,x,w){var h=String(P);return!h||h.length>=x?P:""+Array(x+1-h.length).join(w)+P},U={s:H,z:function(P){var x=-P.utcOffset(),w=Math.abs(x),h=Math.floor(w/60),a=w%60;return(x<=0?"+":"-")+H(h,2,"0")+":"+H(a,2,"0")},m:function P(x,w){if(x.date()<w.date())return-P(w,x);var h=12*(w.year()-x.year())+(w.month()-x.month()),a=x.clone().add(h,M),p=w-a<0,f=x.clone().add(h+(p?-1:1),M);return+(-(h+(w-a)/(p?a-f:f-a))||0)},a:function(P){return P<0?Math.ceil(P)||0:Math.floor(P)},p:function(P){return{M,y:C,w:_,d:v,D:k,h:m,m:i,s:d,ms:l,Q:S}[P]||String(P||"").toLowerCase().replace(/s$/,"")},u:function(P){return P===void 0}},re="en",oe={};oe[re]=B;var K="$isDayjsObject",X=function(P){return P instanceof ie||!(!P||!P[K])},q=function P(x,w,h){var a;if(!x)return re;if(typeof x=="string"){var p=x.toLowerCase();oe[p]&&(a=p),w&&(oe[p]=w,a=p);var f=x.split("-");if(!a&&f.length>1)return P(f[0])}else{var c=x.name;oe[c]=x,a=c}return!h&&a&&(re=a),a||!h&&re},V=function(P,x){if(X(P))return P.clone();var w=typeof x=="object"?x:{};return w.date=P,w.args=arguments,new ie(w)},G=U;G.l=q,G.i=X,G.w=function(P,x){return V(P,{locale:x.$L,utc:x.$u,x:x.$x,$offset:x.$offset})};var ie=(function(){function P(w){this.$L=q(w.locale,null,!0),this.parse(w),this.$x=this.$x||w.x||{},this[K]=!0}var x=P.prototype;return x.parse=function(w){this.$d=(function(h){var a=h.date,p=h.utc;if(a===null)return new Date(NaN);if(G.u(a))return new Date;if(a instanceof Date)return new Date(a);if(typeof a=="string"&&!/Z$/i.test(a)){var f=a.match(N);if(f){var c=f[2]-1||0,b=(f[7]||"0").substring(0,3);return p?new Date(Date.UTC(f[1],c,f[3]||1,f[4]||0,f[5]||0,f[6]||0,b)):new Date(f[1],c,f[3]||1,f[4]||0,f[5]||0,f[6]||0,b)}}return new Date(a)})(w),this.init()},x.init=function(){var w=this.$d;this.$y=w.getFullYear(),this.$M=w.getMonth(),this.$D=w.getDate(),this.$W=w.getDay(),this.$H=w.getHours(),this.$m=w.getMinutes(),this.$s=w.getSeconds(),this.$ms=w.getMilliseconds()},x.$utils=function(){return G},x.isValid=function(){return this.$d.toString()!==j},x.isSame=function(w,h){var a=V(w);return this.startOf(h)<=a&&a<=this.endOf(h)},x.isAfter=function(w,h){return V(w)<this.startOf(h)},x.isBefore=function(w,h){return this.endOf(h)<V(w)},x.$g=function(w,h,a){return G.u(w)?this[h]:this.set(a,w)},x.unix=function(){return Math.floor(this.valueOf()/1e3)},x.valueOf=function(){return this.$d.getTime()},x.startOf=function(w,h){var a=this,p=!!G.u(h)||h,f=G.p(w),c=function(ae,se){var ue=G.w(a.$u?Date.UTC(a.$y,se,ae):new Date(a.$y,se,ae),a);return p?ue:ue.endOf(v)},b=function(ae,se){return G.w(a.toDate()[ae].apply(a.toDate("s"),(p?[0,0,0,0]:[23,59,59,999]).slice(se)),a)},D=this.$W,T=this.$M,I=this.$D,Q="set"+(this.$u?"UTC":"");switch(f){case C:return p?c(1,0):c(31,11);case M:return p?c(1,T):c(0,T+1);case _:var ne=this.$locale().weekStart||0,te=(D<ne?D+7:D)-ne;return c(p?I-te:I+(6-te),T);case v:case k:return b(Q+"Hours",0);case m:return b(Q+"Minutes",1);case i:return b(Q+"Seconds",2);case d:return b(Q+"Milliseconds",3);default:return this.clone()}},x.endOf=function(w){return this.startOf(w,!1)},x.$set=function(w,h){var a,p=G.p(w),f="set"+(this.$u?"UTC":""),c=(a={},a[v]=f+"Date",a[k]=f+"Date",a[M]=f+"Month",a[C]=f+"FullYear",a[m]=f+"Hours",a[i]=f+"Minutes",a[d]=f+"Seconds",a[l]=f+"Milliseconds",a)[p],b=p===v?this.$D+(h-this.$W):h;if(p===M||p===C){var D=this.clone().set(k,1);D.$d[c](b),D.init(),this.$d=D.set(k,Math.min(this.$D,D.daysInMonth())).$d}else c&&this.$d[c](b);return this.init(),this},x.set=function(w,h){return this.clone().$set(w,h)},x.get=function(w){return this[G.p(w)]()},x.add=function(w,h){var a,p=this;w=Number(w);var f=G.p(h),c=function(T){var I=V(p);return G.w(I.date(I.date()+Math.round(T*w)),p)};if(f===M)return this.set(M,this.$M+w);if(f===C)return this.set(C,this.$y+w);if(f===v)return c(1);if(f===_)return c(7);var b=(a={},a[i]=n,a[m]=s,a[d]=r,a)[f]||1,D=this.$d.getTime()+w*b;return G.w(D,this)},x.subtract=function(w,h){return this.add(-1*w,h)},x.format=function(w){var h=this,a=this.$locale();if(!this.isValid())return a.invalidDate||j;var p=w||"YYYY-MM-DDTHH:mm:ssZ",f=G.z(this),c=this.$H,b=this.$m,D=this.$M,T=a.weekdays,I=a.months,Q=a.meridiem,ne=function(se,ue,E,L){return se&&(se[ue]||se(h,p))||E[ue].slice(0,L)},te=function(se){return G.s(c%12||12,se,"0")},ae=Q||function(se,ue,E){var L=se<12?"AM":"PM";return E?L.toLowerCase():L};return p.replace(F,(function(se,ue){return ue||(function(E){switch(E){case"YY":return String(h.$y).slice(-2);case"YYYY":return G.s(h.$y,4,"0");case"M":return D+1;case"MM":return G.s(D+1,2,"0");case"MMM":return ne(a.monthsShort,D,I,3);case"MMMM":return ne(I,D);case"D":return h.$D;case"DD":return G.s(h.$D,2,"0");case"d":return String(h.$W);case"dd":return ne(a.weekdaysMin,h.$W,T,2);case"ddd":return ne(a.weekdaysShort,h.$W,T,3);case"dddd":return T[h.$W];case"H":return String(c);case"HH":return G.s(c,2,"0");case"h":return te(1);case"hh":return te(2);case"a":return ae(c,b,!0);case"A":return ae(c,b,!1);case"m":return String(b);case"mm":return G.s(b,2,"0");case"s":return String(h.$s);case"ss":return G.s(h.$s,2,"0");case"SSS":return G.s(h.$ms,3,"0");case"Z":return f}return null})(se)||f.replace(":","")}))},x.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},x.diff=function(w,h,a){var p,f=this,c=G.p(h),b=V(w),D=(b.utcOffset()-this.utcOffset())*n,T=this-b,I=function(){return G.m(f,b)};switch(c){case C:p=I()/12;break;case M:p=I();break;case S:p=I()/3;break;case _:p=(T-D)/6048e5;break;case v:p=(T-D)/864e5;break;case m:p=T/s;break;case i:p=T/n;break;case d:p=T/r;break;default:p=T}return a?p:G.a(p)},x.daysInMonth=function(){return this.endOf(M).$D},x.$locale=function(){return oe[this.$L]},x.locale=function(w,h){if(!w)return this.$L;var a=this.clone(),p=q(w,h,!0);return p&&(a.$L=p),a},x.clone=function(){return G.w(this.$d,this)},x.toDate=function(){return new Date(this.valueOf())},x.toJSON=function(){return this.isValid()?this.toISOString():null},x.toISOString=function(){return this.$d.toISOString()},x.toString=function(){return this.$d.toUTCString()},P})(),ee=ie.prototype;return V.prototype=ee,[["$ms",l],["$s",d],["$m",i],["$H",m],["$W",v],["$M",M],["$y",C],["$D",k]].forEach((function(P){ee[P[1]]=function(x){return this.$g(x,P[0],P[1])}})),V.extend=function(P,x){return P.$i||(P(x,ie,V),P.$i=!0),V},V.locale=q,V.isDayjs=X,V.unix=function(P){return V(1e3*P)},V.en=oe[re],V.Ls=oe,V.p={},V}))})(dr)),dr.exports}var Ol=Ml();const de=En(Ol);function jl({direction:t,levelIndex:e,rowIndex:r,cellIndex:n,size:s}){switch(t){case"up":return e===0&&r===0?null:r===0?{levelIndex:e-1,rowIndex:n<=s[e-1][s[e-1].length-1]-1?s[e-1].length-1:s[e-1].length-2,cellIndex:n}:{levelIndex:e,rowIndex:r-1,cellIndex:n};case"down":return r===s[e].length-1?{levelIndex:e+1,rowIndex:0,cellIndex:n}:r===s[e].length-2&&n>=s[e][s[e].length-1]?{levelIndex:e+1,rowIndex:0,cellIndex:n}:{levelIndex:e,rowIndex:r+1,cellIndex:n};case"left":return e===0&&r===0&&n===0?null:r===0&&n===0?{levelIndex:e-1,rowIndex:s[e-1].length-1,cellIndex:s[e-1][s[e-1].length-1]-1}:n===0?{levelIndex:e,rowIndex:r-1,cellIndex:s[e][r-1]-1}:{levelIndex:e,rowIndex:r,cellIndex:n-1};case"right":return r===s[e].length-1&&n===s[e][r]-1?{levelIndex:e+1,rowIndex:0,cellIndex:0}:n===s[e][r]-1?{levelIndex:e,rowIndex:r+1,cellIndex:0}:{levelIndex:e,rowIndex:r,cellIndex:n+1};default:return{levelIndex:e,rowIndex:r,cellIndex:n}}}function Ko({controlsRef:t,direction:e,levelIndex:r,rowIndex:n,cellIndex:s,size:l}){const d=jl({direction:e,size:l,rowIndex:n,cellIndex:s,levelIndex:r});if(!d)return;const i=t.current?.[d.levelIndex]?.[d.rowIndex]?.[d.cellIndex];i&&(i.disabled||i.getAttribute("data-hidden")||i.getAttribute("data-outside")?Ko({controlsRef:t,direction:e,levelIndex:d.levelIndex,cellIndex:d.cellIndex,rowIndex:d.rowIndex,size:l}):i.focus())}function Al(t){switch(t){case"ArrowDown":return"down";case"ArrowUp":return"up";case"ArrowRight":return"right";case"ArrowLeft":return"left";default:return null}}function El(t){return t.current?.map(e=>e.map(r=>r.length))}function un({controlsRef:t,levelIndex:e,rowIndex:r,cellIndex:n,event:s}){const l=Al(s.key);if(l){s.preventDefault();const d=El(t);Ko({controlsRef:t,direction:l,levelIndex:e,rowIndex:r,cellIndex:n,size:d})}}function qe(t){return t==null||t===""?t:de(t).format("YYYY-MM-DD")}function Zo(t){return t==null||t===""?t:de(t).format("YYYY-MM-DD HH:mm:ss")}const Tl={locale:"en",firstDayOfWeek:1,weekendDays:[0,6],labelSeparator:"–",consistentWeeks:!1},$l=J.createContext(Tl);function pt(){const t=J.useContext($l),e=J.useCallback(l=>l||t.locale,[t.locale]),r=J.useCallback(l=>typeof l=="number"?l:t.firstDayOfWeek,[t.firstDayOfWeek]),n=J.useCallback(l=>Array.isArray(l)?l:t.weekendDays,[t.weekendDays]),s=J.useCallback(l=>typeof l=="string"?l:t.labelSeparator,[t.labelSeparator]);return{...t,getLocale:e,getFirstDayOfWeek:r,getWeekendDays:n,getLabelSeparator:s}}function Rl({value:t,type:e,withTime:r}){const n=r?Zo:qe;if(e==="range"&&Array.isArray(t)){const s=n(t[0]),l=n(t[1]);return s?l?`${s} – ${l}`:`${s} –`:""}return e==="multiple"&&Array.isArray(t)?t.filter(Boolean).join(", "):!Array.isArray(t)&&t?n(t):""}function Jo({value:t,type:e,name:r,form:n,withTime:s=!1}){return y.jsx("input",{type:"hidden",value:Rl({value:t,type:e,withTime:s}),name:r,form:n})}Jo.displayName="@mantine/dates/HiddenDatesInput";function Xo(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(r=Xo(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function je(){for(var t,e,r=0,n="",s=arguments.length;r<s;r++)(t=arguments[r])&&(e=Xo(t))&&(n&&(n+=" "),n+=e);return n}var es={day:"m_396ce5cb"};const Nl=O.createVarsResolver((t,{size:e})=>({day:{"--day-size":O.getSize(e,"day-size")}})),cn=O.factory((t,e)=>{const r=O.useProps("Day",null,t),{classNames:n,className:s,style:l,styles:d,unstyled:i,vars:m,date:v,disabled:_,__staticSelector:M,weekend:S,outside:C,selected:k,renderDay:j,inRange:N,firstInRange:F,lastInRange:B,hidden:H,static:U,highlightToday:re,attributes:oe,...K}=r,X=O.useStyles({name:M||"Day",classes:es,props:r,className:s,style:l,classNames:n,styles:d,unstyled:i,attributes:oe,vars:m,varsResolver:Nl,rootSelector:"day"});return y.jsx(O.UnstyledButton,{...X("day",{style:H?{display:"none"}:void 0}),component:U?"div":"button",ref:e,disabled:_,"data-today":de(v).isSame(new Date,"day")||void 0,"data-hidden":H||void 0,"data-highlight-today":re||void 0,"data-disabled":_||void 0,"data-weekend":!_&&!C&&S||void 0,"data-outside":!_&&C||void 0,"data-selected":!_&&k||void 0,"data-in-range":N&&!_||void 0,"data-first-in-range":F&&!_||void 0,"data-last-in-range":B&&!_||void 0,"data-static":U||void 0,unstyled:i,...K,children:j?.(v)||de(v).date()})});cn.classes=es,cn.displayName="@mantine/dates/Day";function Ll({locale:t,format:e="dd",firstDayOfWeek:r=1}){const n=de().day(r),s=[];for(let l=0;l<7;l+=1)typeof e=="string"?s.push(de(n).add(l,"days").locale(t).format(e)):s.push(e(de(n).add(l,"days").format("YYYY-MM-DD")));return s}var ts={weekday:"m_18a3eca"};const Bl=O.createVarsResolver((t,{size:e})=>({weekdaysRow:{"--wr-fz":O.getFontSize(e),"--wr-spacing":O.getSpacing(e)}})),dn=O.factory((t,e)=>{const r=O.useProps("WeekdaysRow",null,t),{classNames:n,className:s,style:l,styles:d,unstyled:i,vars:m,locale:v,firstDayOfWeek:_,weekdayFormat:M,cellComponent:S="th",__staticSelector:C,withWeekNumbers:k,attributes:j,...N}=r,F=O.useStyles({name:C||"WeekdaysRow",classes:ts,props:r,className:s,style:l,classNames:n,styles:d,unstyled:i,attributes:j,vars:m,varsResolver:Bl,rootSelector:"weekdaysRow"}),B=pt(),H=Ll({locale:B.getLocale(v),format:M,firstDayOfWeek:B.getFirstDayOfWeek(_)}).map((U,re)=>y.jsx(S,{...F("weekday"),children:U},re));return y.jsxs(O.Box,{component:"tr",ref:e,...F("weekdaysRow"),...N,children:[k&&y.jsx(S,{...F("weekday"),children:"#"}),H]})});dn.classes=ts,dn.displayName="@mantine/dates/WeekdaysRow";function Il(t,e=1){let r=de(t);if(!r.isValid())return r;const n=e===0?6:e-1;for(;r.day()!==n;)r=r.add(1,"day");return r.format("YYYY-MM-DD")}function Yl(t,e=1){let r=de(t);for(;r.day()!==e;)r=r.subtract(1,"day");return r.format("YYYY-MM-DD")}function zl({month:t,firstDayOfWeek:e=1,consistentWeeks:r}){const n=de(t).subtract(de(t).date()-1,"day"),s=de(n.format("YYYY-M-D")),l=s.format("YYYY-MM-DD"),d=s.add(+s.daysInMonth()-1,"day").format("YYYY-MM-DD"),i=Il(d,e),m=[];let v=de(Yl(l,e));for(;de(v).isBefore(i,"day");){const _=[];for(let M=0;M<7;M+=1)_.push(v.format("YYYY-MM-DD")),v=v.add(1,"day");m.push(_)}if(r&&m.length<6){const _=m[m.length-1],M=_[_.length-1];let S=de(M).add(1,"day");for(;m.length<6;){const C=[];for(let k=0;k<7;k+=1)C.push(S.format("YYYY-MM-DD")),S=S.add(1,"day");m.push(C)}}return m}function hn(t,e){return de(t).format("YYYY-MM")===de(e).format("YYYY-MM")}function rs(t,e){return e?de(t).isAfter(de(e).subtract(1,"day"),"day"):!0}function ns(t,e){return e?de(t).isBefore(de(e).add(1,"day"),"day"):!0}function Fl({dates:t,minDate:e,maxDate:r,getDayProps:n,excludeDate:s,hideOutsideDates:l,month:d}){const i=t.flat().filter(_=>ns(_,r)&&rs(_,e)&&!s?.(_)&&!n?.(_)?.disabled&&(!l||hn(_,d))),m=i.find(_=>n?.(_)?.selected);if(m)return m;const v=i.find(_=>de().isSame(_,"date"));return v||i[0]}var hr={exports:{}},Wl=hr.exports,os;function Ul(){return os||(os=1,(function(t,e){(function(r,n){t.exports=n()})(Wl,(function(){var r="day";return function(n,s,l){var d=function(v){return v.add(4-v.isoWeekday(),r)},i=s.prototype;i.isoWeekYear=function(){return d(this).year()},i.isoWeek=function(v){if(!this.$utils().u(v))return this.add(7*(v-this.isoWeek()),r);var _,M,S,C,k=d(this),j=(_=this.isoWeekYear(),M=this.$u,S=(M?l.utc:l)().year(_).startOf("year"),C=4-S.isoWeekday(),S.isoWeekday()>4&&(C+=7),S.add(C,r));return k.diff(j,"week")+1},i.isoWeekday=function(v){return this.$utils().u(v)?this.day()||7:this.day(this.day()%7?v:v-7)};var m=i.startOf;i.startOf=function(v,_){var M=this.$utils(),S=!!M.u(_)||_;return M.p(v)==="isoweek"?S?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):m.bind(this)(v,_)}}}))})(hr)),hr.exports}var ql=Ul();const Vl=En(ql);de.extend(Vl);function Hl(t){const e=t.find(r=>de(r).day()===1);return de(e).isoWeek()}var ss={month:"m_cc9820d3",monthCell:"m_8f457cd5",weekNumber:"m_6cff9dea"};const Gl={withCellSpacing:!0},Ql=O.createVarsResolver((t,{size:e})=>({weekNumber:{"--wn-fz":O.getFontSize(e),"--wn-size":O.getSize(e,"wn-size")}})),fr=O.factory((t,e)=>{const r=O.useProps("Month",Gl,t),{classNames:n,className:s,style:l,styles:d,unstyled:i,vars:m,__staticSelector:v,locale:_,firstDayOfWeek:M,weekdayFormat:S,month:C,weekendDays:k,getDayProps:j,excludeDate:N,minDate:F,maxDate:B,renderDay:H,hideOutsideDates:U,hideWeekdays:re,getDayAriaLabel:oe,static:K,__getDayRef:X,__onDayKeyDown:q,__onDayClick:V,__onDayMouseEnter:G,__preventFocus:ie,__stopPropagation:ee,withCellSpacing:P,size:x,highlightToday:w,withWeekNumbers:h,attributes:a,...p}=r,f=O.useStyles({name:v||"Month",classes:ss,props:r,className:s,style:l,classNames:n,styles:d,unstyled:i,attributes:a,vars:m,varsResolver:Ql,rootSelector:"month"}),c=pt(),b=zl({month:C,firstDayOfWeek:c.getFirstDayOfWeek(M),consistentWeeks:c.consistentWeeks}),D=Fl({dates:b,minDate:qe(F),maxDate:qe(B),getDayProps:j,excludeDate:N,hideOutsideDates:U,month:C}),{resolvedClassNames:T,resolvedStyles:I}=O.useResolvedStylesApi({classNames:n,styles:d,props:r}),Q=b.map((ne,te)=>{const ae=ne.map((se,ue)=>{const E=!hn(se,C),L=oe?.(se)||de(se).locale(_||c.locale).format("D MMMM YYYY"),$=j?.(se),z=de(se).isSame(D,"date");return y.jsx("td",{...f("monthCell"),"data-with-spacing":P||void 0,children:y.jsx(cn,{__staticSelector:v||"Month",classNames:T,styles:I,unstyled:i,"data-mantine-stop-propagation":ee||void 0,highlightToday:w,renderDay:H,date:se,size:x,weekend:c.getWeekendDays(k).includes(de(se).get("day")),outside:E,hidden:U?E:!1,"aria-label":L,static:K,disabled:N?.(se)||!ns(se,qe(B))||!rs(se,qe(F)),ref:Y=>{Y&&X?.(te,ue,Y)},...$,onKeyDown:Y=>{$?.onKeyDown?.(Y),q?.(Y,{rowIndex:te,cellIndex:ue,date:se})},onMouseEnter:Y=>{$?.onMouseEnter?.(Y),G?.(Y,se)},onClick:Y=>{$?.onClick?.(Y),V?.(Y,se)},onMouseDown:Y=>{$?.onMouseDown?.(Y),ie&&Y.preventDefault()},tabIndex:ie||!z?-1:0})},se.toString())});return y.jsxs("tr",{...f("monthRow"),children:[h&&y.jsx("td",{...f("weekNumber"),children:Hl(ne)}),ae]},te)});return y.jsxs(O.Box,{component:"table",...f("month"),size:x,ref:e,...p,children:[!re&&y.jsx("thead",{...f("monthThead"),children:y.jsx(dn,{__staticSelector:v||"Month",locale:_,firstDayOfWeek:M,weekdayFormat:S,size:x,classNames:T,styles:I,unstyled:i,withWeekNumbers:h})}),y.jsx("tbody",{...f("monthTbody"),children:Q})]})});fr.classes=ss,fr.displayName="@mantine/dates/Month";var is={pickerControl:"m_dc6a3c71"};const Kl=O.createVarsResolver((t,{size:e})=>({pickerControl:{"--dpc-fz":O.getFontSize(e),"--dpc-size":O.getSize(e,"dpc-size")}})),pr=O.factory((t,e)=>{const r=O.useProps("PickerControl",null,t),{classNames:n,className:s,style:l,styles:d,unstyled:i,vars:m,firstInRange:v,lastInRange:_,inRange:M,__staticSelector:S,selected:C,disabled:k,attributes:j,...N}=r,F=O.useStyles({name:S||"PickerControl",classes:is,props:r,className:s,style:l,classNames:n,styles:d,unstyled:i,attributes:j,vars:m,varsResolver:Kl,rootSelector:"pickerControl"});return y.jsx(O.UnstyledButton,{...F("pickerControl"),ref:e,unstyled:i,"data-picker-control":!0,"data-selected":C&&!k||void 0,"data-disabled":k||void 0,"data-in-range":M&&!k&&!C||void 0,"data-first-in-range":v&&!k||void 0,"data-last-in-range":_&&!k||void 0,disabled:k,...N})});pr.classes=is,pr.displayName="@mantine/dates/PickerControl";function as({year:t,minDate:e,maxDate:r}){return!e&&!r?!1:!!(e&&de(t).isBefore(e,"year")||r&&de(t).isAfter(r,"year"))}function Zl({years:t,minDate:e,maxDate:r,getYearControlProps:n}){const s=t.flat().filter(i=>!as({year:i,minDate:e,maxDate:r})&&!n?.(i)?.disabled),l=s.find(i=>n?.(i)?.selected);if(l)return l;const d=s.find(i=>de().isSame(i,"year"));return d||s[0]}function ls(t){const e=de(t).year(),r=e-e%10;let n=0;const s=[[],[],[],[]];for(let l=0;l<4;l+=1){const d=l===3?1:3;for(let i=0;i<d;i+=1)s[l].push(de(new Date(r+n,0)).format("YYYY-MM-DD")),n+=1}return s}var us={yearsList:"m_9206547b",yearsListCell:"m_c5a19c7d"};const Jl={yearsListFormat:"YYYY",withCellSpacing:!0},gr=O.factory((t,e)=>{const r=O.useProps("YearsList",Jl,t),{classNames:n,className:s,style:l,styles:d,unstyled:i,vars:m,decade:v,yearsListFormat:_,locale:M,minDate:S,maxDate:C,getYearControlProps:k,__staticSelector:j,__getControlRef:N,__onControlKeyDown:F,__onControlClick:B,__onControlMouseEnter:H,__preventFocus:U,__stopPropagation:re,withCellSpacing:oe,size:K,attributes:X,...q}=r,V=O.useStyles({name:j||"YearsList",classes:us,props:r,className:s,style:l,classNames:n,styles:d,unstyled:i,attributes:X,vars:m,rootSelector:"yearsList"}),G=pt(),ie=ls(v),ee=Zl({years:ie,minDate:S,maxDate:C,getYearControlProps:k}),P=ie.map((x,w)=>{const h=x.map((a,p)=>{const f=k?.(a),c=de(a).isSame(ee,"year");return y.jsx("td",{...V("yearsListCell"),"data-with-spacing":oe||void 0,children:y.jsx(pr,{...V("yearsListControl"),size:K,unstyled:i,"data-mantine-stop-propagation":re||void 0,disabled:as({year:a,minDate:S,maxDate:C}),ref:b=>{b&&N?.(w,p,b)},...f,onKeyDown:b=>{f?.onKeyDown?.(b),F?.(b,{rowIndex:w,cellIndex:p,date:a})},onClick:b=>{f?.onClick?.(b),B?.(b,a)},onMouseEnter:b=>{f?.onMouseEnter?.(b),H?.(b,a)},onMouseDown:b=>{f?.onMouseDown?.(b),U&&b.preventDefault()},tabIndex:U||!c?-1:0,children:de(a).locale(G.getLocale(M)).format(_)})},p)});return y.jsx("tr",{...V("yearsListRow"),children:h},w)});return y.jsx(O.Box,{component:"table",ref:e,size:K,...V("yearsList"),...q,children:y.jsx("tbody",{children:P})})});gr.classes=us,gr.displayName="@mantine/dates/YearsList";function cs({month:t,minDate:e,maxDate:r}){return!e&&!r?!1:!!(e&&de(t).isBefore(e,"month")||r&&de(t).isAfter(r,"month"))}function Xl({months:t,minDate:e,maxDate:r,getMonthControlProps:n}){const s=t.flat().filter(i=>!cs({month:i,minDate:e,maxDate:r})&&!n?.(i)?.disabled),l=s.find(i=>n?.(i)?.selected);if(l)return l;const d=s.find(i=>de().isSame(i,"month"));return d||s[0]}function eu(t){const e=de(t).startOf("year").toDate(),r=[[],[],[],[]];let n=0;for(let s=0;s<4;s+=1)for(let l=0;l<3;l+=1)r[s].push(de(e).add(n,"months").format("YYYY-MM-DD")),n+=1;return r}var ds={monthsList:"m_2a6c32d",monthsListCell:"m_fe27622f"};const tu={monthsListFormat:"MMM",withCellSpacing:!0},mr=O.factory((t,e)=>{const r=O.useProps("MonthsList",tu,t),{classNames:n,className:s,style:l,styles:d,unstyled:i,vars:m,__staticSelector:v,year:_,monthsListFormat:M,locale:S,minDate:C,maxDate:k,getMonthControlProps:j,__getControlRef:N,__onControlKeyDown:F,__onControlClick:B,__onControlMouseEnter:H,__preventFocus:U,__stopPropagation:re,withCellSpacing:oe,size:K,attributes:X,...q}=r,V=O.useStyles({name:v||"MonthsList",classes:ds,props:r,className:s,style:l,classNames:n,styles:d,unstyled:i,attributes:X,vars:m,rootSelector:"monthsList"}),G=pt(),ie=eu(_),ee=Xl({months:ie,minDate:qe(C),maxDate:qe(k),getMonthControlProps:j}),P=ie.map((x,w)=>{const h=x.map((a,p)=>{const f=j?.(a),c=de(a).isSame(ee,"month");return y.jsx("td",{...V("monthsListCell"),"data-with-spacing":oe||void 0,children:y.jsx(pr,{...V("monthsListControl"),size:K,unstyled:i,__staticSelector:v||"MonthsList","data-mantine-stop-propagation":re||void 0,disabled:cs({month:a,minDate:qe(C),maxDate:qe(k)}),ref:b=>{b&&N?.(w,p,b)},...f,onKeyDown:b=>{f?.onKeyDown?.(b),F?.(b,{rowIndex:w,cellIndex:p,date:a})},onClick:b=>{f?.onClick?.(b),B?.(b,a)},onMouseEnter:b=>{f?.onMouseEnter?.(b),H?.(b,a)},onMouseDown:b=>{f?.onMouseDown?.(b),U&&b.preventDefault()},tabIndex:U||!c?-1:0,children:de(a).locale(G.getLocale(S)).format(M)})},p)});return y.jsx("tr",{...V("monthsListRow"),children:h},w)});return y.jsx(O.Box,{component:"table",ref:e,size:K,...V("monthsList"),...q,children:y.jsx("tbody",{children:P})})});mr.classes=ds,mr.displayName="@mantine/dates/MonthsList";var hs={calendarHeader:"m_730a79ed",calendarHeaderLevel:"m_f6645d97",calendarHeaderControl:"m_2351eeb0",calendarHeaderControlIcon:"m_367dc749"};const ru={hasNextLevel:!0,withNext:!0,withPrevious:!0,headerControlsOrder:["previous","level","next"]},nu=O.createVarsResolver((t,{size:e})=>({calendarHeader:{"--dch-control-size":O.getSize(e,"dch-control-size"),"--dch-fz":O.getFontSize(e)}})),gt=O.factory((t,e)=>{const r=O.useProps("CalendarHeader",ru,t),{classNames:n,className:s,style:l,styles:d,unstyled:i,vars:m,nextIcon:v,previousIcon:_,nextLabel:M,previousLabel:S,onNext:C,onPrevious:k,onLevelClick:j,label:N,nextDisabled:F,previousDisabled:B,hasNextLevel:H,levelControlAriaLabel:U,withNext:re,withPrevious:oe,headerControlsOrder:K,__staticSelector:X,__preventFocus:q,__stopPropagation:V,attributes:G,...ie}=r,ee=O.useStyles({name:X||"CalendarHeader",classes:hs,props:r,className:s,style:l,classNames:n,styles:d,unstyled:i,attributes:G,vars:m,varsResolver:nu,rootSelector:"calendarHeader"}),P=q?p=>p.preventDefault():void 0,x=oe&&J.createElement(O.UnstyledButton,{...ee("calendarHeaderControl"),key:"previous","data-direction":"previous","aria-label":S,onClick:k,unstyled:i,onMouseDown:P,disabled:B,"data-disabled":B||void 0,tabIndex:q||B?-1:0,"data-mantine-stop-propagation":V||void 0},_||y.jsx(O.AccordionChevron,{...ee("calendarHeaderControlIcon"),"data-direction":"previous",size:"45%"})),w=J.createElement(O.UnstyledButton,{component:H?"button":"div",...ee("calendarHeaderLevel"),key:"level",onClick:H?j:void 0,unstyled:i,onMouseDown:H?P:void 0,disabled:!H,"data-static":!H||void 0,"aria-label":U,tabIndex:q||!H?-1:0,"data-mantine-stop-propagation":V||void 0},N),h=re&&J.createElement(O.UnstyledButton,{...ee("calendarHeaderControl"),key:"next","data-direction":"next","aria-label":M,onClick:C,unstyled:i,onMouseDown:P,disabled:F,"data-disabled":F||void 0,tabIndex:q||F?-1:0,"data-mantine-stop-propagation":V||void 0},v||y.jsx(O.AccordionChevron,{...ee("calendarHeaderControlIcon"),"data-direction":"next",size:"45%"})),a=K.map(p=>p==="previous"?x:p==="level"?w:p==="next"?h:null);return y.jsx(O.Box,{...ee("calendarHeader"),ref:e,...ie,children:a})});gt.classes=hs,gt.displayName="@mantine/dates/CalendarHeader";function ou(t){const e=ls(t);return[e[0][0],e[3][0]]}const su={decadeLabelFormat:"YYYY"},yr=O.factory((t,e)=>{const r=O.useProps("DecadeLevel",su,t),{decade:n,locale:s,minDate:l,maxDate:d,yearsListFormat:i,getYearControlProps:m,__getControlRef:v,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:S,withCellSpacing:C,__preventFocus:k,nextIcon:j,previousIcon:N,nextLabel:F,previousLabel:B,onNext:H,onPrevious:U,nextDisabled:re,previousDisabled:oe,levelControlAriaLabel:K,withNext:X,withPrevious:q,headerControlsOrder:V,decadeLabelFormat:G,classNames:ie,styles:ee,unstyled:P,__staticSelector:x,__stopPropagation:w,size:h,attributes:a,...p}=r,f=pt(),[c,b]=ou(n),D={__staticSelector:x||"DecadeLevel",classNames:ie,styles:ee,unstyled:P,size:h,attributes:a},T=typeof re=="boolean"?re:d?!de(b).endOf("year").isBefore(d):!1,I=typeof oe=="boolean"?oe:l?!de(c).startOf("year").isAfter(l):!1,Q=(ne,te)=>de(ne).locale(s||f.locale).format(te);return y.jsxs(O.Box,{"data-decade-level":!0,size:h,ref:e,...p,children:[y.jsx(gt,{label:typeof G=="function"?G(c,b):`${Q(c,G)} – ${Q(b,G)}`,__preventFocus:k,__stopPropagation:w,nextIcon:j,previousIcon:N,nextLabel:F,previousLabel:B,onNext:H,onPrevious:U,nextDisabled:T,previousDisabled:I,hasNextLevel:!1,levelControlAriaLabel:K,withNext:X,withPrevious:q,headerControlsOrder:V,...D}),y.jsx(gr,{decade:n,locale:s,minDate:l,maxDate:d,yearsListFormat:i,getYearControlProps:m,__getControlRef:v,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:S,__preventFocus:k,__stopPropagation:w,withCellSpacing:C,...D})]})});yr.classes={...gr.classes,...gt.classes},yr.displayName="@mantine/dates/DecadeLevel";const iu={yearLabelFormat:"YYYY"},vr=O.factory((t,e)=>{const r=O.useProps("YearLevel",iu,t),{year:n,locale:s,minDate:l,maxDate:d,monthsListFormat:i,getMonthControlProps:m,__getControlRef:v,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:S,withCellSpacing:C,__preventFocus:k,nextIcon:j,previousIcon:N,nextLabel:F,previousLabel:B,onNext:H,onPrevious:U,onLevelClick:re,nextDisabled:oe,previousDisabled:K,hasNextLevel:X,levelControlAriaLabel:q,withNext:V,withPrevious:G,headerControlsOrder:ie,yearLabelFormat:ee,__staticSelector:P,__stopPropagation:x,size:w,classNames:h,styles:a,unstyled:p,attributes:f,...c}=r,b=pt(),D={__staticSelector:P||"YearLevel",classNames:h,styles:a,unstyled:p,size:w,attributes:f},T=typeof oe=="boolean"?oe:d?!de(n).endOf("year").isBefore(d):!1,I=typeof K=="boolean"?K:l?!de(n).startOf("year").isAfter(l):!1;return y.jsxs(O.Box,{"data-year-level":!0,size:w,ref:e,...c,children:[y.jsx(gt,{label:typeof ee=="function"?ee(n):de(n).locale(s||b.locale).format(ee),__preventFocus:k,__stopPropagation:x,nextIcon:j,previousIcon:N,nextLabel:F,previousLabel:B,onNext:H,onPrevious:U,onLevelClick:re,nextDisabled:T,previousDisabled:I,hasNextLevel:X,levelControlAriaLabel:q,withNext:V,withPrevious:G,headerControlsOrder:ie,...D}),y.jsx(mr,{year:n,locale:s,minDate:l,maxDate:d,monthsListFormat:i,getMonthControlProps:m,__getControlRef:v,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:S,__preventFocus:k,__stopPropagation:x,withCellSpacing:C,...D})]})});vr.classes={...gt.classes,...mr.classes},vr.displayName="@mantine/dates/YearLevel";const au={monthLabelFormat:"MMMM YYYY"},br=O.factory((t,e)=>{const r=O.useProps("MonthLevel",au,t),{month:n,locale:s,firstDayOfWeek:l,weekdayFormat:d,weekendDays:i,getDayProps:m,excludeDate:v,minDate:_,maxDate:M,renderDay:S,hideOutsideDates:C,hideWeekdays:k,getDayAriaLabel:j,__getDayRef:N,__onDayKeyDown:F,__onDayClick:B,__onDayMouseEnter:H,withCellSpacing:U,highlightToday:re,withWeekNumbers:oe,__preventFocus:K,__stopPropagation:X,nextIcon:q,previousIcon:V,nextLabel:G,previousLabel:ie,onNext:ee,onPrevious:P,onLevelClick:x,nextDisabled:w,previousDisabled:h,hasNextLevel:a,levelControlAriaLabel:p,withNext:f,withPrevious:c,headerControlsOrder:b,monthLabelFormat:D,classNames:T,styles:I,unstyled:Q,__staticSelector:ne,size:te,static:ae,attributes:se,...ue}=r,E=pt(),L={__staticSelector:ne||"MonthLevel",classNames:T,styles:I,unstyled:Q,size:te,attributes:se},$=typeof w=="boolean"?w:M?!de(n).endOf("month").isBefore(M):!1,z=typeof h=="boolean"?h:_?!de(n).startOf("month").isAfter(_):!1;return y.jsxs(O.Box,{"data-month-level":!0,size:te,ref:e,...ue,children:[y.jsx(gt,{label:typeof D=="function"?D(n):de(n).locale(s||E.locale).format(D),__preventFocus:K,__stopPropagation:X,nextIcon:q,previousIcon:V,nextLabel:G,previousLabel:ie,onNext:ee,onPrevious:P,onLevelClick:x,nextDisabled:$,previousDisabled:z,hasNextLevel:a,levelControlAriaLabel:p,withNext:f,withPrevious:c,headerControlsOrder:b,...L}),y.jsx(fr,{month:n,locale:s,firstDayOfWeek:l,weekdayFormat:d,weekendDays:i,getDayProps:m,excludeDate:v,minDate:_,maxDate:M,renderDay:S,hideOutsideDates:C,hideWeekdays:k,getDayAriaLabel:j,__getDayRef:N,__onDayKeyDown:F,__onDayClick:B,__onDayMouseEnter:H,__preventFocus:K,__stopPropagation:X,static:ae,withCellSpacing:U,highlightToday:re,withWeekNumbers:oe,...L})]})});br.classes={...fr.classes,...gt.classes},br.displayName="@mantine/dates/MonthLevel";var fs={levelsGroup:"m_30b26e33"};const mt=O.factory((t,e)=>{const r=O.useProps("LevelsGroup",null,t),{classNames:n,className:s,style:l,styles:d,unstyled:i,vars:m,__staticSelector:v,attributes:_,...M}=r,S=O.useStyles({name:v||"LevelsGroup",classes:fs,props:r,className:s,style:l,classNames:n,styles:d,unstyled:i,attributes:_,vars:m,rootSelector:"levelsGroup"});return y.jsx(O.Box,{ref:e,...S("levelsGroup"),...M})});mt.classes=fs,mt.displayName="@mantine/dates/LevelsGroup";const lu={numberOfColumns:1},wr=O.factory((t,e)=>{const r=O.useProps("DecadeLevelGroup",lu,t),{decade:n,locale:s,minDate:l,maxDate:d,yearsListFormat:i,getYearControlProps:m,__onControlClick:v,__onControlMouseEnter:_,withCellSpacing:M,__preventFocus:S,nextIcon:C,previousIcon:k,nextLabel:j,previousLabel:N,onNext:F,onPrevious:B,nextDisabled:H,previousDisabled:U,headerControlsOrder:re,classNames:oe,styles:K,unstyled:X,__staticSelector:q,__stopPropagation:V,numberOfColumns:G,levelControlAriaLabel:ie,decadeLabelFormat:ee,size:P,vars:x,attributes:w,...h}=r,a=J.useRef([]),p=Array(G).fill(0).map((f,c)=>{const b=de(n).add(c*10,"years").format("YYYY-MM-DD");return y.jsx(yr,{size:P,yearsListFormat:i,decade:b,withNext:c===G-1,withPrevious:c===0,decadeLabelFormat:ee,__onControlClick:v,__onControlMouseEnter:_,__onControlKeyDown:(D,T)=>un({levelIndex:c,rowIndex:T.rowIndex,cellIndex:T.cellIndex,event:D,controlsRef:a}),__getControlRef:(D,T,I)=>{Array.isArray(a.current[c])||(a.current[c]=[]),Array.isArray(a.current[c][D])||(a.current[c][D]=[]),a.current[c][D][T]=I},levelControlAriaLabel:typeof ie=="function"?ie(b):ie,locale:s,minDate:l,maxDate:d,__preventFocus:S,__stopPropagation:V,nextIcon:C,previousIcon:k,nextLabel:j,previousLabel:N,onNext:F,onPrevious:B,nextDisabled:H,previousDisabled:U,getYearControlProps:m,__staticSelector:q||"DecadeLevelGroup",classNames:oe,styles:K,unstyled:X,withCellSpacing:M,headerControlsOrder:re,attributes:w},c)});return y.jsx(mt,{classNames:oe,styles:K,__staticSelector:q||"DecadeLevelGroup",ref:e,size:P,unstyled:X,attributes:w,...h,children:p})});wr.classes={...mt.classes,...yr.classes},wr.displayName="@mantine/dates/DecadeLevelGroup";const uu={numberOfColumns:1},_r=O.factory((t,e)=>{const r=O.useProps("YearLevelGroup",uu,t),{year:n,locale:s,minDate:l,maxDate:d,monthsListFormat:i,getMonthControlProps:m,__onControlClick:v,__onControlMouseEnter:_,withCellSpacing:M,__preventFocus:S,nextIcon:C,previousIcon:k,nextLabel:j,previousLabel:N,onNext:F,onPrevious:B,onLevelClick:H,nextDisabled:U,previousDisabled:re,hasNextLevel:oe,headerControlsOrder:K,classNames:X,styles:q,unstyled:V,__staticSelector:G,__stopPropagation:ie,numberOfColumns:ee,levelControlAriaLabel:P,yearLabelFormat:x,size:w,vars:h,attributes:a,...p}=r,f=J.useRef([]),c=Array(ee).fill(0).map((b,D)=>{const T=de(n).add(D,"years").format("YYYY-MM-DD");return y.jsx(vr,{size:w,monthsListFormat:i,year:T,withNext:D===ee-1,withPrevious:D===0,yearLabelFormat:x,__stopPropagation:ie,__onControlClick:v,__onControlMouseEnter:_,__onControlKeyDown:(I,Q)=>un({levelIndex:D,rowIndex:Q.rowIndex,cellIndex:Q.cellIndex,event:I,controlsRef:f}),__getControlRef:(I,Q,ne)=>{Array.isArray(f.current[D])||(f.current[D]=[]),Array.isArray(f.current[D][I])||(f.current[D][I]=[]),f.current[D][I][Q]=ne},levelControlAriaLabel:typeof P=="function"?P(T):P,locale:s,minDate:l,maxDate:d,__preventFocus:S,nextIcon:C,previousIcon:k,nextLabel:j,previousLabel:N,onNext:F,onPrevious:B,onLevelClick:H,nextDisabled:U,previousDisabled:re,hasNextLevel:oe,getMonthControlProps:m,classNames:X,styles:q,unstyled:V,__staticSelector:G||"YearLevelGroup",withCellSpacing:M,headerControlsOrder:K,attributes:a},D)});return y.jsx(mt,{classNames:X,styles:q,__staticSelector:G||"YearLevelGroup",ref:e,size:w,unstyled:V,attributes:a,...p,children:c})});_r.classes={...vr.classes,...mt.classes},_r.displayName="@mantine/dates/YearLevelGroup";const cu={numberOfColumns:1},xr=O.factory((t,e)=>{const r=O.useProps("MonthLevelGroup",cu,t),{month:n,locale:s,firstDayOfWeek:l,weekdayFormat:d,weekendDays:i,getDayProps:m,excludeDate:v,minDate:_,maxDate:M,renderDay:S,hideOutsideDates:C,hideWeekdays:k,getDayAriaLabel:j,__onDayClick:N,__onDayMouseEnter:F,withCellSpacing:B,highlightToday:H,withWeekNumbers:U,__preventFocus:re,nextIcon:oe,previousIcon:K,nextLabel:X,previousLabel:q,onNext:V,onPrevious:G,onLevelClick:ie,nextDisabled:ee,previousDisabled:P,hasNextLevel:x,headerControlsOrder:w,classNames:h,styles:a,unstyled:p,numberOfColumns:f,levelControlAriaLabel:c,monthLabelFormat:b,__staticSelector:D,__stopPropagation:T,size:I,static:Q,vars:ne,attributes:te,...ae}=r,se=J.useRef([]),ue=Array(f).fill(0).map((E,L)=>{const $=de(n).add(L,"months").format("YYYY-MM-DD");return y.jsx(br,{month:$,withNext:L===f-1,withPrevious:L===0,monthLabelFormat:b,__stopPropagation:T,__onDayClick:N,__onDayMouseEnter:F,__onDayKeyDown:(z,Y)=>un({levelIndex:L,rowIndex:Y.rowIndex,cellIndex:Y.cellIndex,event:z,controlsRef:se}),__getDayRef:(z,Y,ce)=>{Array.isArray(se.current[L])||(se.current[L]=[]),Array.isArray(se.current[L][z])||(se.current[L][z]=[]),se.current[L][z][Y]=ce},levelControlAriaLabel:typeof c=="function"?c($):c,locale:s,firstDayOfWeek:l,weekdayFormat:d,weekendDays:i,getDayProps:m,excludeDate:v,minDate:_,maxDate:M,renderDay:S,hideOutsideDates:C,hideWeekdays:k,getDayAriaLabel:j,__preventFocus:re,nextIcon:oe,previousIcon:K,nextLabel:X,previousLabel:q,onNext:V,onPrevious:G,onLevelClick:ie,nextDisabled:ee,previousDisabled:P,hasNextLevel:x,classNames:h,styles:a,unstyled:p,__staticSelector:D||"MonthLevelGroup",size:I,static:Q,withCellSpacing:B,highlightToday:H,withWeekNumbers:U,headerControlsOrder:w,attributes:te},L)});return y.jsx(mt,{classNames:h,styles:a,__staticSelector:D||"MonthLevelGroup",ref:e,size:I,attributes:te,...ae,children:ue})});xr.classes={...mt.classes,...br.classes},xr.displayName="@mantine/dates/MonthLevelGroup";const ps=t=>t==="range"?[null,null]:t==="multiple"?[]:null,gs=(t,e)=>{const r=e?Zo:qe;return Array.isArray(t)?t.map(r):r(t)};function fn({type:t,value:e,defaultValue:r,onChange:n,withTime:s=!1}){const l=J.useRef(t),[d,i,m]=Le.useUncontrolled({value:gs(e,s),defaultValue:gs(r,s),finalValue:ps(t),onChange:n});let v=d;return l.current!==t&&(l.current=t,e===void 0&&(v=r!==void 0?r:ps(t),i(v))),[v,i,m]}function pn(t,e){return t?t==="month"?0:t==="year"?1:2:e||0}function du(t){return t===0?"month":t===1?"year":"decade"}function Gt(t,e,r){return du(Le.clamp(pn(t,0),pn(e,0),pn(r,2)))}const hu={maxLevel:"decade",minLevel:"month",__updateDateOnYearSelect:!0,__updateDateOnMonthSelect:!0,enableKeyboardNavigation:!0},Cr=O.factory((t,e)=>{const r=O.useProps("Calendar",hu,t),{vars:n,maxLevel:s,minLevel:l,defaultLevel:d,level:i,onLevelChange:m,date:v,defaultDate:_,onDateChange:M,numberOfColumns:S,columnsToScroll:C,ariaLabels:k,nextLabel:j,previousLabel:N,onYearSelect:F,onMonthSelect:B,onYearMouseEnter:H,onMonthMouseEnter:U,headerControlsOrder:re,__updateDateOnYearSelect:oe,__updateDateOnMonthSelect:K,__setDateRef:X,__setLevelRef:q,firstDayOfWeek:V,weekdayFormat:G,weekendDays:ie,getDayProps:ee,excludeDate:P,renderDay:x,hideOutsideDates:w,hideWeekdays:h,getDayAriaLabel:a,monthLabelFormat:p,nextIcon:f,previousIcon:c,__onDayClick:b,__onDayMouseEnter:D,withCellSpacing:T,highlightToday:I,withWeekNumbers:Q,monthsListFormat:ne,getMonthControlProps:te,yearLabelFormat:ae,yearsListFormat:se,getYearControlProps:ue,decadeLabelFormat:E,classNames:L,styles:$,unstyled:z,minDate:Y,maxDate:ce,locale:o,__staticSelector:u,size:g,__preventFocus:A,__stopPropagation:R,onNextDecade:W,onPreviousDecade:le,onNextYear:he,onPreviousYear:pe,onNextMonth:Z,onPreviousMonth:fe,static:me,enableKeyboardNavigation:ge,attributes:Se,...xe}=r,{resolvedClassNames:Pe,resolvedStyles:Ve}=O.useResolvedStylesApi({classNames:L,styles:$,props:r}),[Ne,Me]=Le.useUncontrolled({value:i?Gt(i,l,s):void 0,defaultValue:d?Gt(d,l,s):void 0,finalValue:Gt(void 0,l,s),onChange:m}),[Ct,Te]=fn({type:"default",value:qe(v),defaultValue:qe(_),onChange:M});J.useImperativeHandle(X,()=>ve=>{Te(ve)}),J.useImperativeHandle(q,()=>ve=>{Me(ve)});const rt={__staticSelector:u||"Calendar",styles:Ve,classNames:Pe,unstyled:z,size:g,attributes:Se},Ye=C||S||1,et=new Date,nt=Y&&de(et).isAfter(Y)?Y:de(et).format("YYYY-MM-DD"),$e=Ct||nt,ot=()=>{const ve=de($e).add(Ye,"month").format("YYYY-MM-DD");Z?.(ve),Te(ve)},st=()=>{const ve=de($e).subtract(Ye,"month").format("YYYY-MM-DD");fe?.(ve),Te(ve)},He=()=>{const ve=de($e).add(Ye,"year").format("YYYY-MM-DD");he?.(ve),Te(ve)},Ge=()=>{const ve=de($e).subtract(Ye,"year").format("YYYY-MM-DD");pe?.(ve),Te(ve)},Qe=()=>{const ve=de($e).add(10*Ye,"year").format("YYYY-MM-DD");W?.(ve),Te(ve)},it=()=>{const ve=de($e).subtract(10*Ye,"year").format("YYYY-MM-DD");le?.(ve),Te(ve)},yt=J.useRef(null);J.useEffect(()=>{if(!ge||me)return;const ve=Oe=>{if(!yt.current?.contains(document.activeElement))return;const tt=Oe.ctrlKey||Oe.metaKey,vt=Oe.shiftKey;switch(Oe.key){case"ArrowUp":tt&&vt?(Oe.preventDefault(),it()):tt&&(Oe.preventDefault(),Ge());break;case"ArrowDown":tt&&vt?(Oe.preventDefault(),Qe()):tt&&(Oe.preventDefault(),He());break;case"y":case"Y":Ne==="month"&&(Oe.preventDefault(),Me("year"));break}};return document.addEventListener("keydown",ve),()=>{document.removeEventListener("keydown",ve)}},[ge,me,Ne,He,Ge,Qe,it]);const at=ve=>{yt.current=ve,typeof e=="function"?e(ve):e&&(e.current=ve)};return y.jsxs(O.Box,{ref:at,size:g,"data-calendar":!0,...xe,children:[Ne==="month"&&y.jsx(xr,{month:$e,minDate:Y,maxDate:ce,firstDayOfWeek:V,weekdayFormat:G,weekendDays:ie,getDayProps:ee,excludeDate:P,renderDay:x,hideOutsideDates:w,hideWeekdays:h,getDayAriaLabel:a,onNext:ot,onPrevious:st,hasNextLevel:s!=="month",onLevelClick:()=>Me("year"),numberOfColumns:S,locale:o,levelControlAriaLabel:k?.monthLevelControl,nextLabel:k?.nextMonth??j,nextIcon:f,previousLabel:k?.previousMonth??N,previousIcon:c,monthLabelFormat:p,__onDayClick:b,__onDayMouseEnter:D,__preventFocus:A,__stopPropagation:R,static:me,withCellSpacing:T,highlightToday:I,withWeekNumbers:Q,headerControlsOrder:re,...rt}),Ne==="year"&&y.jsx(_r,{year:$e,numberOfColumns:S,minDate:Y,maxDate:ce,monthsListFormat:ne,getMonthControlProps:te,locale:o,onNext:He,onPrevious:Ge,hasNextLevel:s!=="month"&&s!=="year",onLevelClick:()=>Me("decade"),levelControlAriaLabel:k?.yearLevelControl,nextLabel:k?.nextYear??j,nextIcon:f,previousLabel:k?.previousYear??N,previousIcon:c,yearLabelFormat:ae,__onControlMouseEnter:U,__onControlClick:(ve,Oe)=>{K&&Te(Oe),Me(Gt("month",l,s)),B?.(Oe)},__preventFocus:A,__stopPropagation:R,withCellSpacing:T,headerControlsOrder:re,...rt}),Ne==="decade"&&y.jsx(wr,{decade:$e,minDate:Y,maxDate:ce,yearsListFormat:se,getYearControlProps:ue,locale:o,onNext:Qe,onPrevious:it,numberOfColumns:S,nextLabel:k?.nextDecade??j,nextIcon:f,previousLabel:k?.previousDecade??N,previousIcon:c,decadeLabelFormat:E,__onControlMouseEnter:H,__onControlClick:(ve,Oe)=>{oe&&Te(Oe),Me(Gt("year",l,s)),F?.(Oe)},__preventFocus:A,__stopPropagation:R,withCellSpacing:T,headerControlsOrder:re,...rt})]})});Cr.classes={...wr.classes,..._r.classes,...xr.classes},Cr.displayName="@mantine/dates/Calendar";function fu(t){const{maxLevel:e,minLevel:r,defaultLevel:n,level:s,onLevelChange:l,nextIcon:d,previousIcon:i,date:m,defaultDate:v,onDateChange:_,numberOfColumns:M,columnsToScroll:S,ariaLabels:C,nextLabel:k,previousLabel:j,onYearSelect:N,onMonthSelect:F,onYearMouseEnter:B,onMonthMouseEnter:H,onNextMonth:U,onPreviousMonth:re,onNextYear:oe,onPreviousYear:K,onNextDecade:X,onPreviousDecade:q,withCellSpacing:V,highlightToday:G,__updateDateOnYearSelect:ie,__updateDateOnMonthSelect:ee,__setDateRef:P,__setLevelRef:x,withWeekNumbers:w,headerControlsOrder:h,firstDayOfWeek:a,weekdayFormat:p,weekendDays:f,getDayProps:c,excludeDate:b,renderDay:D,hideOutsideDates:T,hideWeekdays:I,getDayAriaLabel:Q,monthLabelFormat:ne,monthsListFormat:te,getMonthControlProps:ae,yearLabelFormat:se,yearsListFormat:ue,getYearControlProps:E,decadeLabelFormat:L,allowSingleDateInRange:$,allowDeselect:z,minDate:Y,maxDate:ce,locale:o,...u}=t;return{calendarProps:{maxLevel:e,minLevel:r,defaultLevel:n,level:s,onLevelChange:l,nextIcon:d,previousIcon:i,date:m,defaultDate:v,onDateChange:_,numberOfColumns:M,columnsToScroll:S,ariaLabels:C,nextLabel:k,previousLabel:j,onYearSelect:N,onMonthSelect:F,onYearMouseEnter:B,onMonthMouseEnter:H,onNextMonth:U,onPreviousMonth:re,onNextYear:oe,onPreviousYear:K,onNextDecade:X,onPreviousDecade:q,withCellSpacing:V,highlightToday:G,__updateDateOnYearSelect:ie,__updateDateOnMonthSelect:ee,__setDateRef:P,withWeekNumbers:w,headerControlsOrder:h,firstDayOfWeek:a,weekdayFormat:p,weekendDays:f,getDayProps:c,excludeDate:b,renderDay:D,hideOutsideDates:T,hideWeekdays:I,getDayAriaLabel:Q,monthLabelFormat:ne,monthsListFormat:te,getMonthControlProps:ae,yearLabelFormat:se,yearsListFormat:ue,getYearControlProps:E,decadeLabelFormat:L,allowSingleDateInRange:$,allowDeselect:z,minDate:Y,maxDate:ce,locale:o},others:u}}function pu(t){if(t===null)return null;const e=new Date(t);return Number.isNaN(e.getTime())||!t?null:de(e).format("YYYY-MM-DD")}function gu({date:t,maxDate:e,minDate:r}){return!(t==null||Number.isNaN(new Date(t).getTime())||e&&de(t).isAfter(e,"date")||r&&de(t).isBefore(r,"date"))}const mu={valueFormat:"MMMM D, YYYY",fixOnBlur:!0,size:"sm"},Sr=O.factory((t,e)=>{const r=O.useInputProps("DateInput",mu,t),{inputProps:n,wrapperProps:s,value:l,defaultValue:d,onChange:i,clearable:m,clearButtonProps:v,popoverProps:_,getDayProps:M,locale:S,valueFormat:C,dateParser:k,minDate:j,maxDate:N,fixOnBlur:F,onFocus:B,onBlur:H,onClick:U,onKeyDown:re,readOnly:oe,name:K,form:X,rightSection:q,unstyled:V,classNames:G,styles:ie,allowDeselect:ee,date:P,defaultDate:x,onDateChange:w,getMonthControlProps:h,getYearControlProps:a,disabled:p,...f}=r,c=J.useRef(null),b=J.useRef(null),[D,T]=J.useState(!1),{calendarProps:I,others:Q}=fu(f),ne=pt(),ae=k||(Z=>{const fe=de(Z,C,ne.getLocale(S)).toDate();return Number.isNaN(fe.getTime())?pu(Z):de(fe).format("YYYY-MM-DD")}),se=ee!==void 0?ee:m,ue=Z=>Z?de(Z).locale(ne.getLocale(S)).format(C):"",[E,L,$]=fn({type:"default",value:l,defaultValue:d,onChange:i}),[z,Y]=fn({type:"default",value:P,defaultValue:d||x,onChange:w});J.useEffect(()=>{$&&l!==null&&Y(l)},[$,l]);const[ce,o]=J.useState(ue(E));J.useEffect(()=>{o(ue(E))},[ne.getLocale(S)]);const u=Z=>{const fe=Z.currentTarget.value;if(o(fe),T(!0),fe.trim()===""&&(ee||m))L(null);else{const me=ae(fe);me&&gu({date:me,minDate:j,maxDate:N})&&(L(me),Y(me))}},g=Z=>{H?.(Z),T(!1),F&&o(ue(E))},A=Z=>{B?.(Z),T(!0)},R=Z=>{U?.(Z),T(!0)},W=Z=>{Z.key==="Escape"&&T(!1),re?.(Z)},le=Z=>({...M?.(Z),selected:de(E).isSame(Z,"day"),onClick:fe=>{M?.(Z).onClick?.(fe);const me=se&&de(E).isSame(Z,"day")?null:Z;L(me),!$&&me&&o(ue(me)),T(!1)}}),he=y.jsx(O.Input.ClearButton,{onClick:()=>{L(null),!$&&o(""),T(!1)},unstyled:V,...v}),pe=m&&!!E&&!oe&&!p;return Le.useDidUpdate(()=>{E!==void 0&&!D&&o(ue(E))},[E]),Le.useClickOutside(()=>T(!1),void 0,[c.current,b.current]),y.jsxs(y.Fragment,{children:[y.jsx(O.Input.Wrapper,{...s,__staticSelector:"DateInput",ref:c,children:y.jsxs(O.Popover,{opened:D,trapFocus:!1,position:"bottom-start",disabled:oe||p,withRoles:!1,unstyled:V,..._,children:[y.jsx(O.Popover.Target,{children:y.jsx(O.Input,{"data-dates-input":!0,"data-read-only":oe||void 0,autoComplete:"off",ref:e,value:ce,onChange:u,onBlur:g,onFocus:A,onClick:R,onKeyDown:W,readOnly:oe,rightSection:q,__clearSection:he,__clearable:pe,...n,...Q,disabled:p,__staticSelector:"DateInput"})}),y.jsx(O.Popover.Dropdown,{onMouseDown:Z=>Z.preventDefault(),"data-dates-dropdown":!0,ref:b,children:y.jsx(Cr,{__staticSelector:"DateInput",...I,classNames:G,styles:ie,unstyled:V,__preventFocus:!0,minDate:j,maxDate:N,locale:S,getDayProps:le,size:n.size,date:z,onDateChange:Y,getMonthControlProps:Z=>({selected:typeof E=="string"?hn(Z,E):!1,...h?.(Z)}),getYearControlProps:Z=>({selected:typeof E=="string"?de(Z).isSame(E,"year"):!1,...a?.(Z)}),attributes:s.attributes})})]})}),y.jsx(Jo,{name:K,form:X,value:E,type:"default"})]})});Sr.classes={...O.Input.classes,...Cr.classes},Sr.displayName="@mantine/dates/DateInput";function ms(t){const e=Fe.c(49),{fields:r,onClose:n,queryKey:s,apiPath:l,steps:d,onCreated:i}=t,[m,v]=J.useState(0),[_,M]=J.useState(!1),[S,C]=J.useState(),{mutateAsync:k,isError:j,error:N,isPending:F}=Ho(l,s),{mutateAsync:B,isPending:H}=ln(l,s),U=F||H;let re;e[0]!==r?(re=new Set(r.filter(wu).map(bu)),e[0]=r,e[1]=re):re=e[1];let oe;e[2]!==re?(oe=[...re],e[2]=re,e[3]=oe):oe=e[3];const K=oe;let X;e[4]===Symbol.for("react.memo_cache_sentinel")?(X=function(D,T){return typeof D.required=="function"?D.required(T??{}):!!D.required},e[4]=X):X=e[4];const q=X;let V;e[5]!==r?(V=r.reduce(vu,{}),e[5]=r,e[6]=V):V=e[6];let G;if(e[7]!==r){let b;e[9]===Symbol.for("react.memo_cache_sentinel")?(b=(D,T)=>(D[T.id]=(I,Q)=>T.conditional&&!T.conditional(Q)||!q(T,Q)||I?null:"Pflichtfeld",D),e[9]=b):b=e[9],G=r.filter(yu).reduce(b,{}),e[7]=r,e[8]=G}else G=e[8];let ie;e[10]!==V||e[11]!==G?(ie={mode:"uncontrolled",initialValues:V,validate:G},e[10]=V,e[11]=G,e[12]=ie):ie=e[12];const ee=An.useForm(ie);let P;e[13]!==ee||e[14]!==S?(P=function(D){const T=ee.getValues();if(D.conditional&&!D.conditional(T))return null;const I=q(D,T);return y.jsxs(J.Fragment,{children:[(D.type===void 0||D.type=="text")&&y.jsx(O.TextInput,{label:D.column.title,placeholder:D.placeholder??"",...ee.getInputProps(D.id),type:D.id.includes("email")?"email":void 0,required:I},ee.key(D.id)),D.type==="number"&&y.jsx(O.NumberInput,{decimalSeparator:",",label:D.column.title,placeholder:D.placeholder??"",...ee.getInputProps(D.id),required:I},ee.key(D.id)),D.type==="date"&&y.jsx(Sr,{label:D.column.title,placeholder:D.placeholder??"",valueFormat:"DD.MM.YYYY",clearable:!0,...ee.getInputProps(D.id),required:I},ee.key(D.id)),D.type==="boolean"&&y.jsx(O.Checkbox,{mt:"md",label:D.column.title,...ee.getInputProps(D.id,{type:"checkbox"}),required:I},ee.key(D.id)),D.type==="textarea"&&y.jsx(O.Textarea,{label:D.column.title,placeholder:D.placeholder??"",...ee.getInputProps(D.id),minRows:3,autosize:!0,required:I},ee.key(D.id)),D.type==="custom"&&D.render&&D.render({...ee.getValues(),...S&&{id:S}},ee.setValues,M,{error:ee.getInputProps(D.id).error,required:I})]},D.id)},e[13]=ee,e[14]=S,e[15]=P):P=e[15];const x=P;let w;e[16]!==N?.message||e[17]!==N?.name||e[18]!==j?(w=j&&y.jsx(O.Alert,{variant:"outline",color:"red",title:N?.name??"Fehler aufgetreten",mb:"lg",children:N?.message??"Fehler aufgetreten"}),e[16]=N?.message,e[17]=N?.name,e[18]=j,e[19]=w):w=e[19];let h;e[20]!==m||e[21]!==k||e[22]!==ee||e[23]!==j||e[24]!==n||e[25]!==i||e[26]!==S||e[27]!==K.length||e[28]!==B?(h=ee.onSubmit(async b=>{if(S)await B({...b,id:S});else{const D=await k(b);C(D.id),i?.(D.id)}K.length&&m<K.length-1?j||v(m+1):j||(ee.setInitialValues(b),ee.reset(),n())}),e[20]=m,e[21]=k,e[22]=ee,e[23]=j,e[24]=n,e[25]=i,e[26]=S,e[27]=K.length,e[28]=B,e[29]=h):h=e[29];let a;e[30]!==m||e[31]!==r||e[32]!==x||e[33]!==d||e[34]!==K?(a=K.length?y.jsx(O.Stepper,{active:m,size:"sm",children:K.map(b=>y.jsx(O.Stepper.Step,{...d&&d[b-1]?{label:d[b-1].label}:{},children:r.filter(D=>D.step===b).map(D=>x(D))},b))}):r.map(b=>x(b)),e[30]=m,e[31]=r,e[32]=x,e[33]=d,e[34]=K,e[35]=a):a=e[35];let p;e[36]!==m||e[37]!==_||e[38]!==U||e[39]!==n||e[40]!==K.length?(p=!_&&y.jsxs(O.Group,{mt:"md",justify:"end",children:[y.jsx(O.Button,{onClick:()=>K.length?m===0?n():v(m-1):n(),variant:"outline",children:K.length?m===0?"Abbrechen":"Zurück":"Abbrechen"}),y.jsx(O.Button,{type:"submit",loading:U,children:K.length?m===K.length-1?"Speichern":"Weiter":"Speichern"})]}),e[36]=m,e[37]=_,e[38]=U,e[39]=n,e[40]=K.length,e[41]=p):p=e[41];let f;e[42]!==a||e[43]!==p||e[44]!==h?(f=y.jsxs("form",{onSubmit:h,children:[a,p]}),e[42]=a,e[43]=p,e[44]=h,e[45]=f):f=e[45];let c;return e[46]!==f||e[47]!==w?(c=y.jsxs(y.Fragment,{children:[w,f]}),e[46]=f,e[47]=w,e[48]=c):c=e[48],c}function yu(t){return t.required}function vu(t,e){return t[e.id]=e.type==="boolean"?!1:e.defaultValue??"",t}function bu(t){return t.step}function wu(t){return typeof t.step=="number"}var[_u,gn]=O.createSafeContext("useDataTableColumnsContext must be used within DataTableColumnProvider"),ys=t=>{let{children:e,columnsOrder:r,setColumnsOrder:n,columnsToggle:s,setColumnsToggle:l,resetColumnsOrder:d,resetColumnsToggle:i,setColumnWidth:m,setMultipleColumnWidths:v,resetColumnsWidth:_}=t,[M,S]=J.useState(""),[C,k]=J.useState("");return y.jsx(_u,{value:{sourceColumn:M,setSourceColumn:S,targetColumn:C,setTargetColumn:k,columnsToggle:s,setColumnsToggle:l,swapColumns:()=>{if(!r||!n||!M||!C)return;let j=r.indexOf(M),N=r.indexOf(C);if(j!==-1&&N!==-1){let F=r.splice(j,1)[0];r.splice(N,0,F),n([...r])}},resetColumnsOrder:d,resetColumnsToggle:i,setColumnWidth:m,setMultipleColumnWidths:v,resetColumnsWidth:_},children:e})};function xu(){return y.jsx("tr",{className:"mantine-datatable-empty-row",children:y.jsx("td",{})})}function Cu(){return y.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.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"}),y.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"}),y.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"}),y.jsx("path",{d:"M3 3l18 18"})]})}function Su({icon:t,text:e,active:r,children:n}){return y.jsx(O.Center,{className:"mantine-datatable-empty-state","data-active":r||void 0,children:n||y.jsxs(y.Fragment,{children:[t||y.jsx("div",{className:"mantine-datatable-empty-state-icon",children:y.jsx(Cu,{})}),y.jsx(O.Text,{component:"div",size:"sm",c:"dimmed",children:e})]})})}function Du({key:t,columns:e=[],getInitialValueInEffect:r=!0}){function n(M,S){let C=[];return M.forEach(k=>{S.find(j=>j.accessor===k)&&C.push(k)}),S.forEach(k=>{C.includes(k.accessor)||C.push(k.accessor)}),C}let s=e&&e.map(M=>M.accessor)||[],[l,d]=Le.useLocalStorage({key:t?`${t}-columns-order`:"",defaultValue:t?s:void 0,getInitialValueInEffect:r});function i(M){t&&d(M)}let m=()=>{i(s)};if(!t)return{columnsOrder:l,setColumnsOrder:i,resetColumnsOrder:m};let v=n(l,e),_=JSON.stringify(l);return JSON.stringify(v)!==_&&i(v),{columnsOrder:v,setColumnsOrder:i,resetColumnsOrder:m}}function ku({key:t,columns:e=[],getInitialValueInEffect:r=!0,headerRef:n,onFixedLayoutChange:s}){let l=J.useRef(!1),d=J.useRef({}),[i,m]=J.useState(!0),v=J.useMemo(()=>e.some(q=>q.resizable&&!q.hidden&&q.accessor!=="__selection__"),[e]),_=J.useMemo(()=>e.filter(q=>q.resizable&&!q.hidden&&q.accessor!=="__selection__"),[e]),M=J.useMemo(()=>_.some(q=>q.width===void 0||q.width===""||q.width==="initial"),[_]),S=J.useCallback(()=>e.filter(q=>q.accessor!=="__selection__").map(q=>({[q.accessor]:q.width??"auto"})),[e]),[C,k]=Le.useLocalStorage({key:t?`${t}-columns-width`:"",defaultValue:t?S():void 0,getInitialValueInEffect:!1}),[j,N]=J.useState(()=>S());J.useEffect(()=>{m(!1)},[]);let F=J.useCallback(()=>{if(!n?.current||i)return{};let q=n.current,V=Array.from(q.querySelectorAll("th[data-accessor]")),G={};return V.forEach(ie=>{let ee=ie.getAttribute("data-accessor");if(!ee||ee==="__selection__")return;let P=_.find(x=>x.accessor===ee);if(P&&(P.width===void 0||P.width===""||P.width==="initial")){let x=ie.getBoundingClientRect();G[ee]=Math.round(x.width)}}),G},[n,_,i]),B=J.useCallback(q=>{let V=q.filter(ie=>ie.accessor!=="__selection__"),G=j.map(ie=>{let ee=Object.keys(ie)[0],P=V.find(x=>x.accessor===ee);return P?{[ee]:P.width}:ie});N(G),t&&k(G)},[j,t,k]),H=J.useCallback(q=>{B(q)},[B]),U=J.useCallback(()=>{if(!(!n?.current||!s||i))if(M)s(!1),requestAnimationFrame(()=>{requestAnimationFrame(()=>{let q=F();d.current={...d.current,...q};let V=e.filter(G=>G.accessor!=="__selection__").map(G=>{let ie=G.accessor,ee=C?.find(x=>Object.keys(x)[0]===ie);if(ee&&ee[ie]!=="auto")return{[ie]:ee[ie]};let P=q[ie];return P?{[ie]:`${P}px`}:{[ie]:G.width??"auto"}});N(V),setTimeout(()=>{s(!0),l.current=!0},10)})});else{let q=e.filter(V=>V.accessor!=="__selection__").map(V=>({[V.accessor]:V.width??"auto"}));N(q),s(!0),l.current=!0}},[n,s,i,M,F,e,C]),re=U;J.useEffect(()=>{if(!v||!s||i){s?.(!1);return}l.current=!1;let q=setTimeout(()=>{U()},50);return()=>clearTimeout(q)},[v,s,i,U]),J.useEffect(()=>{i||!t||!r||C&&C.length>0&&N(C)},[i,t,r,C]);let oe=J.useCallback(()=>{t&&k(S()),d.current={},l.current=!1,s&&(s(!1),setTimeout(()=>{U()},10))},[t,k,S,s,U]),K=J.useCallback((q,V)=>{B([{accessor:q,width:V}])},[B]),X=J.useMemo(()=>v?j.filter(q=>{let V=Object.keys(q)[0];return _.some(G=>G.accessor===V)}).every(q=>{let V=Object.values(q)[0];return V==="auto"||V==="initial"}):!1,[v,j,_]);return{columnsWidth:j,setColumnsWidth:B,setColumnWidth:K,setMultipleColumnWidths:H,resetColumnsWidth:oe,hasResizableColumns:v,allResizableWidthsInitial:X,measureAndSetColumnWidths:re}}function Pu({key:t,columns:e=[],getInitialValueInEffect:r=!0}){function n(M,S){let C=[];return M.forEach(k=>{S.find(j=>j.accessor===k.accessor)&&C.push(k)}),S.forEach(k=>{C.find(j=>j.accessor===k.accessor)||C.push({accessor:k.accessor,defaultToggle:k.defaultToggle||!0,toggleable:k.toggleable,toggled:k.defaultToggle===void 0?!0:k.defaultToggle})}),C}let s=e&&e.map(M=>({accessor:M.accessor,defaultToggle:M.defaultToggle||!0,toggleable:M.toggleable,toggled:M.defaultToggle===void 0?!0:M.defaultToggle})),[l,d]=Le.useLocalStorage({key:t?`${t}-columns-toggle`:"",defaultValue:t?s:void 0,getInitialValueInEffect:r});function i(M){t&&d(M)}let m=()=>{i(s)};if(!t)return{columnsToggle:l,setColumnsToggle:i,resetColumnsToggle:m};let v=n(l,e),_=JSON.stringify(l);return JSON.stringify(v)!==_&&i(v),{columnsToggle:v,setColumnsToggle:i,resetColumnsToggle:m}}var Mu=({key:t,columns:e=[],getInitialValueInEffect:r=!0,headerRef:n,scrollViewportRef:s,onFixedLayoutChange:l})=>{let{columnsOrder:d,setColumnsOrder:i,resetColumnsOrder:m}=Du({key:t,columns:e,getInitialValueInEffect:r}),{columnsToggle:v,setColumnsToggle:_,resetColumnsToggle:M}=Pu({key:t,columns:e,getInitialValueInEffect:r}),{columnsWidth:S,setColumnsWidth:C,setColumnWidth:k,setMultipleColumnWidths:j,resetColumnsWidth:N,hasResizableColumns:F,allResizableWidthsInitial:B,measureAndSetColumnWidths:H}=ku({key:t,columns:e,getInitialValueInEffect:r,headerRef:n,onFixedLayoutChange:l});return{effectiveColumns:J.useMemo(()=>d?d.map(U=>e.find(re=>re.accessor===U)).map(U=>({...U,hidden:U?.hidden||!v.find(re=>re.accessor===U?.accessor)?.toggled})).map(U=>U?.accessor==="__selection__"?U:{...U,width:S.find(re=>re[U?.accessor])?.[U?.accessor]}):e,[e,d,v,S]),setColumnsOrder:i,columnsOrder:d,resetColumnsOrder:m,columnsToggle:v,setColumnsToggle:_,resetColumnsToggle:M,columnsWidth:S,setColumnsWidth:C,setColumnWidth:k,setMultipleColumnWidths:j,resetColumnsWidth:N,hasResizableColumns:F,allResizableWidthsInitial:B,measureAndSetColumnWidths:H}},vs=typeof window<"u"?J.useLayoutEffect:J.useEffect;function bs(t){let e=J.useRef(t);return e.current=t,e}var ws="--mantine-datatable-header-height",_s="--mantine-datatable-footer-height",xs="--mantine-datatable-selection-column-width",Cs="--mantine-datatable-last-row-border-bottom";function Xe(t,e,r){t?.style.setProperty(e,r)}function mn(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 yn(t,e,r){if(t){let n=new ResizeObserver(s=>{let l=s[0];l&&e(mn(l))});return n.observe(t),()=>{n.disconnect(),r()}}}function Ou({scrollCallbacks:t,withRowBorders:e}){let r={root:J.useRef(null),table:J.useRef(null),scrollViewport:J.useRef(null),header:J.useRef(null),footer:J.useRef(null),selectionColumnHeader:J.useRef(null)},{root:n,table:s,scrollViewport:l,header:d,footer:i,selectionColumnHeader:m}=r,v=bs({withRowBorders:e}),_=bs(t),M=J.useRef(()=>{}),S=J.useRef(()=>{}),C=J.useCallback(k=>{_.current.onScroll?.(k),M.current()},[]);return J.useEffect(()=>yn(d.current,k=>{Xe(n.current,ws,`${k.height}px`)},()=>Xe(n.current,ws,"0")),[d.current]),J.useEffect(()=>yn(i.current,k=>{Xe(n.current,_s,`${k.height}px`)},()=>Xe(n.current,_s,"0")),[i.current]),J.useEffect(()=>yn(m.current,k=>{Xe(n.current,xs,`${k.width}px`)},()=>Xe(n.current,xs,"0")),[m.current]),vs(()=>{if(typeof window===void 0)return;let k={top:!0,bottom:!0,left:!0,right:!0},j={width:0,height:0},N={width:0,height:0};function F(oe,K){let X=k[oe];return k[oe]=K,Xe(n.current,`--mantine-datatable-${oe}-shadow-opacity`,K?"0":"1"),X}function B(){let oe=j.height-N.height,K=oe<0;Xe(n.current,"--mantine-datatable-footer-position",K?"relative":"sticky"),Xe(n.current,"--mantine-datatable-footer-bottom",K?`${oe}px`:"0")}function H(){v.current.withRowBorders&&j.height<N.height?Xe(n.current,Cs,`${O.rem("1px")} solid var(--mantine-datatable-border-color)`):Xe(n.current,Cs,"unset")}S.current=H;function U(){let oe=_.current,K=l.current,X=K?.scrollTop??0,q=K?.scrollLeft??0,V=X===0,G=j.height-X-N.height<1,ie=F("top",V),ee=F("bottom",G);V&&V!==ie&&oe.onScrollToTop?.(),G&&G!==ee&&oe.onScrollToBottom?.();let P=K?getComputedStyle(K).direction==="rtl":!1,x=(K?.scrollWidth??0)-N.width,w,h;if(P){let f=Math.abs(q);h=f<1,w=x-f<1}else w=q<1,h=j.width-q-N.width<1;let a=F("left",w),p=F("right",h);w&&w!==a&&oe.onScrollToLeft?.(),h&&h!==p&&oe.onScrollToRight?.()}M.current=U;let re=new ResizeObserver(oe=>{for(let K of oe)switch(K.target.tagName){case"TABLE":{j=mn(K);break}case"DIV":{N=mn(K);break}}U(),B(),H()});return re.observe(s.current),re.observe(l.current),()=>{re.disconnect()}},[]),vs(()=>{S.current()},[e]),{refs:r,onScroll:C}}function ju(t){let[e,r]=J.useState(null),n=t?.join(":")||"";return J.useEffect(()=>{r(null)},[n]),{lastSelectionChangeIndex:e,setLastSelectionChangeIndex:r}}function Au(t,e){let r=()=>{e(t.map(s=>s.matches))},n=t.map(s=>{try{return s.addEventListener("change",r),()=>s.removeEventListener("change",r)}catch{return s.addListener(r),()=>s.removeListener(r)}});return()=>{n.forEach(s=>s())}}function Eu(t,e){return e||(typeof window<"u"&&"matchMedia"in window?t.map(r=>window.matchMedia(r).matches):t.map(()=>!1))}function Tu(t,e,{getInitialValueInEffect:r}={getInitialValueInEffect:!0}){let[n,s]=J.useState(r?e:Eu(t,e)),l=J.useRef(null);return J.useEffect(()=>{if("matchMedia"in window)return l.current=t.map(d=>window.matchMedia(d)),s(l.current.map(d=>d.matches)),Au(l.current,d=>{s(d)})},[t]),n}function $u(t){let e=O.useMantineTheme(),r=J.useMemo(()=>t.map(s=>(typeof s=="function"?s(e):s)??""),[t,e]),n=J.useMemo(()=>t.map(()=>!0),[t]);return Tu(r,n)}function Dr(t){let e=O.useMantineTheme(),r=typeof t=="function"?t(e):t;return Le.useMediaQuery(r||"",!0)}function vn(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 Ru(t,e,r){return t.filter(n=>!e.map(r).includes(r(n)))}function bn(t,e){return t.filter((r,n,s)=>n===s.findIndex(l=>e(r)===e(l)))}function Ss(t,e){return e?e.match(/([^[.\]])+/g).reduce((r,n)=>r&&r[n],t):void 0}function Ie(t,e){return typeof e=="string"?Ss(t,e):e(t)}function Ds(t){return!t||t.length===0?0:Math.max(...t.map(e=>e.groups&&e.groups.length>0?1+Ds(e.groups):1))}function wn(t){let e=[];for(let r of t)r.columns&&r.columns.length>0?e.push(...r.columns.filter(n=>n!=null)):r.groups&&r.groups.length>0&&e.push(...wn(r.groups));return e.filter(r=>r!=null)}function _n(t,e){return t.columns&&t.columns.length>0?t.columns.filter((r,n)=>r.hidden?!1:e?e[n]!==!1:!0).length:t.groups&&t.groups.length>0?t.groups.reduce((r,n)=>r+_n(n,e),0):0}function ks(t,e,r=0){if(r===e)return[...t];let n=[];for(let s of t)s.groups&&s.groups.length>0&&n.push(...ks(s.groups,e,r+1));return n}function Nu(t,e,r){return r?!t||e:!1}function Lu({rowExpansion:t,records:e,idAccessor:r}){let n=[];if(t&&e){let{trigger:i,allowMultiple:m,initiallyExpanded:v}=t;e&&i==="always"?n=e.map(_=>Ie(_,r)):v&&(n=e.filter((_,M)=>v({record:_,index:M})).map(_=>Ie(_,r)),m||(n=[n[0]]))}let s,l,d=J.useState(n);if(t){let{expandable:i,trigger:m,allowMultiple:v,collapseProps:_,content:M}=t;t.expanded?{recordIds:s,onRecordIdsChange:l}=t.expanded:[s,l]=d;let S=C=>l?.(s.filter(k=>k!==Ie(C,r)));return{expandOnClick:m!=="always"&&m!=="never",isRowExpanded:C=>m==="always"?!0:s.includes(Ie(C,r)),isExpandable:({record:C,index:k})=>i?i({record:C,index:k}):!0,expandRow:C=>{let k=Ie(C,r);l?.(v?[...s,k]:[k])},collapseRow:S,collapseProps:_,content:({record:C,index:k})=>()=>M({record:C,index:k,collapse:()=>S(C)})}}}function Bu(t,e){let[r,n]=J.useState(t),[s,l]=J.useState(t),d=Le.useTimeout(()=>n(!0),0),i=Le.useTimeout(()=>l(!1),e||200);return J.useEffect(()=>{t?(i.clear(),l(!0),d.start()):(d.clear(),n(!1),i.start())},[d,i,t]),{expanded:r,visible:s}}var xn="mantine-datatable-nowrap",Cn="mantine-datatable-ellipsis",jt="mantine-datatable-pointer-cursor",Ps="mantine-datatable-context-menu-cursor",Iu="mantine-datatable-text-selection-disabled",kr="mantine-datatable-text-align-left",Pr="mantine-datatable-text-align-center",Mr="mantine-datatable-text-align-right";function Yu({className:t,style:e,visibleMediaQuery:r,title:n,noWrap:s,ellipsis:l,textAlign:d,width:i}){return Dr(r)?y.jsx(O.TableTh,{className:je({[xn]:s||l,[Cn]:l,[kr]:d==="left",[Pr]:d==="center",[Mr]:d==="right"},t),style:[{width:i,minWidth:i,maxWidth:i},e],children:n}):null}function zu({shadowVisible:t}){return y.jsx(O.TableTh,{className:"mantine-datatable-footer-selector-placeholder-cell","data-shadow-visible":t||void 0})}function Fu({className:t,style:e,columns:r,defaultColumnProps:n,selectionVisible:s,selectorCellShadowVisible:l,ref:d}){return y.jsx(O.TableTfoot,{ref:d,className:je("mantine-datatable-footer",t),style:e,children:y.jsxs(O.TableTr,{children:[s&&y.jsx(zu,{shadowVisible:l}),r.map(({hidden:i,...m})=>{if(i)return null;let{accessor:v,visibleMediaQuery:_,textAlign:M,width:S,footer:C,footerClassName:k,footerStyle:j,noWrap:N,ellipsis:F}={...n,...m};return y.jsx(Yu,{className:k,style:j,visibleMediaQuery:_,textAlign:M,width:S,title:C,noWrap:N,ellipsis:F},v)})]})})}function Wu({group:{id:t,columns:e,groups:r,title:n,textAlign:s,className:l,style:d},maxDepth:i,currentDepth:m,previousGroups:v,isLastGroup:_,withColumnBorders:M=!1,totalTableColumns:S}){let C=J.useMemo(()=>e&&e.length>0?e:r&&r.length>0?wn([{id:t,columns:e,groups:r}]):[],[e,r,t]),k=J.useMemo(()=>C.map(({visibleMediaQuery:re})=>re),[C]),j=$u(k),N=J.useMemo(()=>_n({columns:e,groups:r},j),[t,e,r,j]),F=J.useMemo(()=>v.reduce((re,oe)=>re+_n(oe,j),0),[v,j]),B=r&&r.length>0?1:i-m,H=F+N<S,U=Nu(_,H,M);return N>0?y.jsx(O.TableTh,{colSpan:N,rowSpan:B>1?B:void 0,className:je("mantine-datatable-column-group-header-cell",{[kr]:s==="left",[Pr]:s==="center",[Mr]:s==="right","mantine-datatable-column-group-header-cell--needs-border":U},l),style:d,children:n??vn(t)}):null}function Uu(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.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 qu(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.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 Vu({children:t,isActive:e,filterPopoverProps:r,filterPopoverDisableClickOutside:n}){let[s,{close:l,toggle:d}]=Le.useDisclosure(!1),i=e?qu:Uu,m=Le.useClickOutside(l);return n&&(m=void 0),y.jsxs(O.Popover,{withArrow:!0,shadow:"md",opened:s,onClose:l,trapFocus:!0,...r,children:[y.jsx(O.PopoverTarget,{children:y.jsx(O.ActionIcon,{className:"mantine-datatable-header-cell-filter-action-icon","data-active":e||void 0,size:"sm",variant:"default",onClick:v=>{v.preventDefault(),d()},onKeyDown:v=>v.stopPropagation(),children:y.jsx(i,{})})}),y.jsx(O.PopoverDropdown,{ref:m,onClick:v=>v.stopPropagation(),onKeyDown:v=>v.stopPropagation(),children:typeof t=="function"?t({close:l}):t})]})}var Hu=t=>{let{accessor:e,columnRef:r}=t,[n,s]=J.useState(!1),l=J.useRef(0),d=J.useRef({current:0,next:0}),{dir:i}=O.useDirection(),m=i==="rtl",{setMultipleColumnWidths:v}=gn(),_=J.useCallback(S=>{if(S.preventDefault(),S.stopPropagation(),!r.current)return;let C=r.current,k=C.nextElementSibling;for(;k;){let re=k.getAttribute("data-accessor");if(re&&re!=="__selection__")break;k=k.nextElementSibling}if(!k)return;let j=k.getAttribute("data-accessor");if(!j)return;let N=j==="__selection__";s(!0),l.current=S.clientX;let F=C.offsetWidth,B=k.offsetWidth;d.current={current:F,next:B};let H=re=>{if(!r.current)return;let oe=r.current,K=oe.nextElementSibling;if(!K)return;let X=re.clientX-l.current;m&&(X=-X);let q=50,V=d.current.current-q,G=d.current.next-q,ie=Math.max(-V,Math.min(X,G)),ee=d.current.current+ie,P=d.current.next-ie;oe.style.width=`${ee}px`,K.style.width=`${P}px`,oe.style.minWidth=`${ee}px`,oe.style.maxWidth=`${ee}px`,K.style.minWidth=`${P}px`,K.style.maxWidth=`${P}px`},U=()=>{if(!r.current)return;let re=r.current,oe=re.nextElementSibling;s(!1),document.body.style.cursor="initial",document.body.style.userSelect="initial";let K=parseInt(re.style.width)||re.offsetWidth,X=oe?parseInt(oe.style.width)||oe.offsetWidth:0,q=[{accessor:e,width:`${K}px`}];if(oe&&!N){let V=oe.getAttribute("data-accessor");V&&q.push({accessor:V,width:`${X}px`})}setTimeout(()=>{v(q)},0),document.removeEventListener("mousemove",H),document.removeEventListener("mouseup",U)};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",H),document.addEventListener("mouseup",U)},[e,r,m,v]),M=J.useCallback(()=>{if(!r.current)return;let S=r.current,C=S.nextElementSibling;S.style.width="",S.style.minWidth="",S.style.maxWidth="";let k=[{accessor:e,width:"auto"}];if(C){C.style.width="",C.style.minWidth="",C.style.maxWidth="";let j=C.getAttribute("data-accessor");j&&j!=="__selection__"&&k.push({accessor:j,width:"auto"})}setTimeout(()=>{v(k)},0)},[e,r,v]);return y.jsx("div",{className:"mantine-datatable-header-resizable-handle",style:{cursor:n?"col-resize":void 0},onMouseDown:_,onDoubleClick:M,onClick:S=>S.stopPropagation(),title:"Drag to resize column, double-click to reset"})};function Gu(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.jsx("path",{d:"M12 5l0 14"}),y.jsx("path",{d:"M16 9l-4 -4"}),y.jsx("path",{d:"M8 9l4 -4"})]})}function Qu(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.jsx("path",{d:"M8 7l4 -4l4 4"}),y.jsx("path",{d:"M8 17l4 4l4 -4"}),y.jsx("path",{d:"M12 3l0 18"})]})}function Ku(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.jsx("path",{d:"M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),y.jsx("path",{d:"M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),y.jsx("path",{d:"M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),y.jsx("path",{d:"M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),y.jsx("path",{d:"M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),y.jsx("path",{d:"M15 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"})]})}function Zu(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.jsx("path",{d:"M18 6l-12 12"}),y.jsx("path",{d:"M6 6l12 12"})]})}function Ju({className:t,style:e,accessor:r,visibleMediaQuery:n,title:s,sortable:l,draggable:d,toggleable:i,resizable:m,sortIcons:v,textAlign:_,width:M,sortStatus:S,onSortStatusChange:C,filter:k,filterPopoverProps:j,filterPopoverDisableClickOutside:N,filtering:F,sortKey:B}){let{setSourceColumn:H,setTargetColumn:U,swapColumns:re,setColumnsToggle:oe}=gn(),[K,X]=J.useState(!1),q=J.useRef(null);if(!Dr(n))return null;let V=s??vn(r),G=typeof V=="string"?V:void 0,ie=l&&C?p=>{p?.defaultPrevented||C({sortKey:B,columnAccessor:r,direction:S?.columnAccessor===r?S.direction==="asc"?"desc":"asc":S?.direction??"asc"})}:void 0,ee=p=>{p.stopPropagation(),H(r),X(!1)},P=p=>{p.preventDefault(),U(r),X(!0)},x=()=>{U(r),X(!1),re()},w=()=>{X(!0)},h=()=>{X(!1)},a=p=>{p.stopPropagation(),oe(f=>f.map(c=>c.accessor===r?{...c,toggled:!1}:c))};return y.jsxs(O.TableTh,{"data-accessor":r,className:je({"mantine-datatable-header-cell-sortable":l,"mantine-datatable-header-cell-toggleable":i,"mantine-datatable-header-cell-resizable":m},t),style:[{width:M,...m?{}:{minWidth:M,maxWidth:M}},e],role:l?"button":void 0,tabIndex:l?0:void 0,onClick:ie,onKeyDown:p=>p.key==="Enter"&&ie?.(),ref:q,children:[y.jsxs(O.Group,{className:"mantine-datatable-header-cell-sortable-group",justify:"space-between",wrap:"nowrap",children:[y.jsxs(O.Flex,{align:"center",w:"100%",className:je({"mantine-datatable-header-cell-draggable":d,"mantine-datatable-header-cell-drag-over":K}),draggable:d,onDragStart:d?ee:void 0,onDragEnter:d?w:void 0,onDragOver:d?P:void 0,onDrop:d?x:void 0,onDragLeave:d?h:void 0,children:[d?y.jsx(O.Center,{role:"img","aria-label":"Drag column",children:y.jsx(O.ActionIcon,{className:"mantine-datatable-header-cell-draggable-action-icon",variant:"subtle",size:"xs",onClick:p=>{p.stopPropagation()},children:y.jsx(Ku,{})})}):null,y.jsx(O.Box,{className:je("mantine-datatable-header-cell-sortable-text",{[kr]:_==="left",[Pr]:_==="center",[Mr]:_==="right"},xn,Cn),title:G,children:V})]}),i?y.jsx(O.Center,{className:"mantine-datatable-header-cell-toggleable-icon",role:"img","aria-label":"Toggle column",children:y.jsx(O.ActionIcon,{size:"xs",variant:"light",onClick:a,children:y.jsx(Zu,{})})}):null,l||S?.columnAccessor===r?y.jsx(y.Fragment,{children:S?.columnAccessor===r?y.jsx(O.Center,{className:je("mantine-datatable-header-cell-sortable-icon",{"mantine-datatable-header-cell-sortable-icon-reversed":S.direction==="desc"}),role:"img","aria-label":`Sorted ${S.direction==="desc"?"descending":"ascending"}`,children:v?.sorted||y.jsx(Gu,{})}):y.jsx(O.Center,{className:"mantine-datatable-header-cell-sortable-unsorted-icon",role:"img","aria-label":"Not sorted",children:v?.unsorted||y.jsx(Qu,{})})}):null,k?y.jsx(Vu,{filterPopoverProps:j,isActive:!!F,filterPopoverDisableClickOutside:N,children:k}):null]}),m&&r!=="__selection__"?y.jsx(Hu,{accessor:r,columnRef:q}):null]})}function Xu({className:t,style:e,trigger:r,shadowVisible:n,checked:s,indeterminate:l,checkboxProps:d,onChange:i,rowSpan:m,ref:v}){let _=!d.disabled;return y.jsx(O.TableTh,{ref:v,className:je("mantine-datatable-header-selector-cell",{[jt]:r==="cell"&&_},t),style:e,rowSpan:m,"data-shadow-visible":n||void 0,"data-accessor":"__selection__",onClick:r==="cell"&&_?i:void 0,children:y.jsx(O.Checkbox,{classNames:_?{input:jt}:void 0,checked:s,indeterminate:l,onChange:i,...d,disabled:!(i||d.onChange)||d.disabled})})}function ec({selectionColumnHeaderRef:t,className:e,style:r,sortStatus:n,sortIcons:s,onSortStatusChange:l,columns:d,defaultColumnProps:i,groups:m,selectionTrigger:v,selectionVisible:_,selectionChecked:M,selectionIndeterminate:S,onSelectionChange:C,selectionCheckboxProps:k,selectorCellShadowVisible:j,selectionColumnClassName:N,selectionColumnStyle:F,withColumnBorders:B=!1,ref:H}){let U=m?Ds(m):0,re=U>0?U+1:1,oe=_?y.jsx(Xu,{ref:t,className:N,style:F,trigger:v,shadowVisible:j,checked:M,indeterminate:S,checkboxProps:k,onChange:C,rowSpan:m?re:void 0}):null,{columnsToggle:K,setColumnsToggle:X}=gn(),[q,V]=J.useState(!1),G=d.some(P=>P.toggleable),ie=G?Object.fromEntries(d.map(({accessor:P,title:x})=>[P,x??vn(String(P))])):void 0,ee=y.jsxs(O.TableThead,{className:je("mantine-datatable-header",e),style:r,ref:H,onContextMenu:G?P=>{P.preventDefault(),V(x=>!x)}:void 0,children:[m&&Array.from({length:U},(P,x)=>{let w=ks(m,x);return y.jsxs(O.TableTr,{children:[x===0&&oe,w.map((h,a)=>y.jsx(Wu,{group:h,maxDepth:U,currentDepth:x,previousGroups:w.slice(0,a),isLastGroup:a===w.length-1,withColumnBorders:B,totalTableColumns:d.length},h.id))]},`group-depth-${x}`)}),y.jsxs(O.TableTr,{children:[!m&&oe,d.map(({hidden:P,...x},w)=>{if(P)return null;let{accessor:h,visibleMediaQuery:a,textAlign:p,width:f,title:c,sortable:b,draggable:D,toggleable:T,resizable:I,titleClassName:Q,titleStyle:ne,filter:te,filterPopoverProps:ae,filterPopoverDisableClickOutside:se,filtering:ue,sortKey:E}={...i,...x};return y.jsx(Ju,{accessor:h,className:Q,style:ne,visibleMediaQuery:a,textAlign:p,width:f,title:c,sortable:b,draggable:D,toggleable:T,resizable:I&&w<d.length-1,sortStatus:n,sortIcons:s,sortKey:E,onSortStatusChange:l,filter:te,filterPopoverProps:ae,filterPopoverDisableClickOutside:se,filtering:ue},h)})]})]});return G?y.jsxs(O.Popover,{position:"bottom",withArrow:!0,shadow:"md",opened:q,onChange:V,children:[y.jsx(O.PopoverTarget,{children:ee}),y.jsx(O.PopoverDropdown,{children:y.jsx(O.Stack,{children:K.filter(P=>P.toggleable).map(P=>y.jsx(O.Group,{children:y.jsx(O.Checkbox,{classNames:{label:"mantine-datatable-header-column-toggle-checkbox-label"},size:"xs",label:ie[P.accessor],checked:P.toggled,onChange:x=>{X(K.map(w=>w.accessor===P.accessor?{...w,toggled:x.currentTarget.checked}:w))}})},P.accessor))})})]}):ee}function tc({fetching:t,customContent:e,backgroundBlur:r,size:n,type:s,color:l}){return y.jsx(O.Center,{className:je("mantine-datatable-loader",{"mantine-datatable-loader-fetching":t}),style:[{backdropFilter:r?`blur(${r}px)`:void 0}],children:t&&(e||y.jsx(O.Loader,{size:n,type:s,color:l}))})}function Ae(t,e,r){return t?O.parseThemeColor({color:typeof t=="object"?t[r]:t,theme:e}).value:void 0}function rc({theme:t,c:e,backgroundColor:r,borderColor:n,rowBorderColor:s,stripedColor:l,highlightOnHoverColor:d}){return{"--mantine-datatable-color-light":Ae(e,t,"light"),"--mantine-datatable-color-dark":Ae(e,t,"dark"),"--mantine-datatable-background-color-light":Ae(r,t,"light"),"--mantine-datatable-background-color-dark":Ae(r,t,"dark"),"--mantine-datatable-border-color-light":Ae(n,t,"light"),"--mantine-datatable-border-color-dark":Ae(n,t,"dark"),"--mantine-datatable-row-border-color-light":Ae(s,t,"light"),"--mantine-datatable-row-border-color-dark":Ae(s,t,"dark"),"--mantine-datatable-striped-color-light":Ae(l,t,"light"),"--mantine-datatable-striped-color-dark":Ae(l,t,"dark"),"--mantine-datatable-highlight-on-hover-color-light":Ae(d,t,"light"),"--mantine-datatable-highlight-on-hover-color-dark":Ae(d,t,"dark")}}function Ms({theme:t,paginationActiveTextColor:e,paginationActiveBackgroundColor:r}){return{"--mantine-datatable-pagination-active-text-color-light":Ae(e,t,"light"),"--mantine-datatable-pagination-active-text-color-dark":Ae(e,t,"dark"),"--mantine-datatable-pagination-active-background-color-light":Ae(r,t,"light"),"--mantine-datatable-pagination-active-background-color-dark":Ae(r,t,"dark")}}function nc({theme:t,color:e,backgroundColor:r}){return{"--mantine-datatable-row-color-light":Ae(e,t,"light"),"--mantine-datatable-row-color-dark":Ae(e,t,"dark"),"--mantine-datatable-row-background-color-light":Ae(r,t,"light"),"--mantine-datatable-row-background-color-dark":Ae(r,t,"dark")}}function oc(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.jsx("path",{d:"M8 9l4 -4l4 4"}),y.jsx("path",{d:"M16 15l-4 4l-4 -4"})]})}var Os={xs:O.rem(22),sm:O.rem(26),md:O.rem(32),lg:O.rem(38),xl:O.rem(44)};function sc({size:t,label:e,values:r,value:n,activeTextColor:s,activeBackgroundColor:l,onChange:d}){return y.jsxs(O.Group,{gap:"xs",children:[y.jsx(O.Text,{component:"div",size:t,children:e}),y.jsxs(O.Menu,{withinPortal:!0,withArrow:!0,offset:2,classNames:{arrow:"mantine-datatable-page-size-selector-menu-arrow"},children:[y.jsx(O.MenuTarget,{children:y.jsx(O.Button,{size:t,variant:"default",classNames:{section:"mantine-datatable-page-size-selector-button-icon"},rightSection:y.jsx(oc,{}),style:[{fontWeight:"normal"},i=>({height:Os[t],paddingLeft:i.spacing[t],paddingRight:i.spacing[t]})],children:n})}),y.jsx(O.MenuDropdown,{children:r.map(i=>{let m=i===n;return y.jsx(O.MenuItem,{className:je({"mantine-datatable-page-size-selector-active":m}),style:[{height:Os[t]},m&&(s||l)?v=>Ms({theme:v,paginationActiveTextColor:s,paginationActiveBackgroundColor:l}):void 0],disabled:m,onClick:()=>d(i),children:y.jsx(O.Text,{component:"div",size:t,children:i})},i)})})]})]})}function ic({className:t,style:e,fetching:r,page:n,onPageChange:s,paginationWithEdges:l,paginationWithControls:d,paginationActiveTextColor:i,paginationActiveBackgroundColor:m,paginationSize:v,loadingText:_,noRecordsText:M,paginationText:S,totalRecords:C,recordsPerPage:k,onRecordsPerPageChange:j,recordsPerPageLabel:N,recordsPerPageOptions:F,recordsLength:B,horizontalSpacing:H,paginationWrapBreakpoint:U,getPaginationControlProps:re,getPaginationItemProps:oe,renderPagination:K}){let X;if(C){let x=(n-1)*k+1,w=x+(B||0)-1;X=S({from:x,to:w,totalRecords:C})}else X=r?_:M;let q=C&&k?Math.max(1,Math.ceil(C/k)):1,V=C?(n-1)*(k??0)+1:void 0,G=C?(V??1)+(B??0)-1:void 0,ie=!Dr(({breakpoints:x})=>`(min-width: ${typeof U=="number"?`${O.rem(U)}rem`:x[U]||U})`),ee={Text:x=>y.jsx(O.Text,{component:"div",className:"mantine-datatable-pagination-text",size:v,...x,children:X}),PageSizeSelector:x=>F?y.jsx(sc,{activeTextColor:i,activeBackgroundColor:m,size:v,label:N,values:F,value:k,onChange:j,...x}):y.jsx(y.Fragment,{}),Pagination:x=>y.jsx(O.Pagination,{classNames:{root:je("mantine-datatable-pagination-pages",{"mantine-datatable-pagination-pages-fetching":r||!B}),control:"mantine-datatable-pagination-pages-control"},style:i||m?w=>Ms({theme:w,paginationActiveTextColor:i,paginationActiveBackgroundColor:m}):void 0,withEdges:l,withControls:d,value:n,onChange:s,size:v,total:q,getControlProps:re,getItemProps:oe,...x})},P={state:{paginationSize:v,page:n,totalPages:q,totalRecords:C,recordsPerPage:k,recordsLength:B,fetching:r,from:V,to:G,isWrapped:ie},actions:{setPage:x=>s?.(x),setRecordsPerPage:j?x=>j(x):void 0},Controls:ee};return y.jsx(O.Box,{px:H??"xs",py:"xs",className:je("mantine-datatable-pagination",t),style:[{flexDirection:ie?"column":"row"},e],children:typeof K=="function"?K(P):y.jsxs(y.Fragment,{children:[y.jsx(ee.Text,{}),y.jsx(ee.PageSizeSelector,{}),y.jsx(ee.Pagination,{})]})})}function ac({className:t,style:e,visibleMediaQuery:r,record:n,index:s,onClick:l,onDoubleClick:d,onContextMenu:i,noWrap:m,ellipsis:v,textAlign:_,width:M,accessor:S,render:C,defaultRender:k,customCellAttributes:j}){return Dr(r)?y.jsx(O.TableTd,{className:je({[xn]:m||v,[Cn]:v,[jt]:l||d,[Ps]:i,[kr]:_==="left",[Pr]:_==="center",[Mr]:_==="right"},t),style:[{width:M,minWidth:M,maxWidth:M},e],onClick:l,onDoubleClick:d,onContextMenu:i,...j?.(n,s),children:C?C(n,s):k?k(n,s,S):Ss(n,S)}):null}function lc({open:t,colSpan:e,content:r,collapseProps:n}){let{expanded:s,visible:l}=Bu(t,n?.transitionDuration);return l?y.jsxs(y.Fragment,{children:[y.jsx(O.TableTr,{}),y.jsx(O.TableTr,{children:y.jsx(O.TableTd,{className:"mantine-datatable-row-expansion-cell",colSpan:e,children:y.jsx(O.Collapse,{in:s,...n,children:y.jsx("div",{className:"mantine-datatable-row-expansion-cell-content",children:r()})})})})]}):null}function uc({className:t,style:e,record:r,index:n,trigger:s,onChange:l,withRightShadow:d,checkboxProps:i,getCheckboxProps:m,...v}){let _={...i,...m(r,n)},M=!v.disabled&&!_.disabled,S=C=>{C.stopPropagation(),s==="cell"&&M&&l?.(C)};return y.jsx(O.TableTd,{className:je("mantine-datatable-row-selector-cell",{[jt]:s==="cell"&&M},t),style:e,"data-shadow-visible":d||void 0,onClick:S,children:y.jsx(O.Checkbox,{classNames:M?{input:jt}:void 0,onChange:l,...v,..._})})}function cc({record:t,index:e,columns:r,defaultColumnProps:n,defaultColumnRender:s,selectionTrigger:l,selectionVisible:d,selectionChecked:i,onSelectionChange:m,isRecordSelectable:v,selectionCheckboxProps:_,getSelectionCheckboxProps:M,onClick:S,onDoubleClick:C,onContextMenu:k,onCellClick:j,onCellDoubleClick:N,onCellContextMenu:F,expansion:B,customAttributes:H,color:U,backgroundColor:re,className:oe,style:K,selectorCellShadowVisible:X,selectionColumnClassName:q,selectionColumnStyle:V,rowFactory:G}){let ie=y.jsxs(y.Fragment,{children:[d&&y.jsx(uc,{className:q,style:V,record:t,index:e,trigger:l,withRightShadow:X,checked:i,disabled:!m||(v?!v(t,e):!1),onChange:m,checkboxProps:_,getCheckboxProps:M}),r.map(({hidden:x,hiddenContent:w,...h},a)=>{if(x||w)return null;let{accessor:p,visibleMediaQuery:f,textAlign:c,noWrap:b,ellipsis:D,width:T,render:I,cellsClassName:Q,cellsStyle:ne,customCellAttributes:te}={...n,...h};return y.jsx(ac,{className:typeof Q=="function"?Q(t,e):Q,style:ne?.(t,e),visibleMediaQuery:f,record:t,index:e,onClick:j?ae=>j({event:ae,record:t,index:e,column:h,columnIndex:a}):void 0,onDoubleClick:N?ae=>N({event:ae,record:t,index:e,column:h,columnIndex:a}):void 0,onContextMenu:F?ae=>F({event:ae,record:t,index:e,column:h,columnIndex:a}):void 0,accessor:p,textAlign:c,noWrap:b,ellipsis:D,width:T,render:I,defaultRender:s,customCellAttributes:te},p)})]}),ee=B&&y.jsx(lc,{colSpan:r.filter(({hidden:x})=>!x).length+(d?1:0),open:B.isRowExpanded(t),content:B.content({record:t,index:e}),collapseProps:B.collapseProps}),P=dc({record:t,index:e,selectionChecked:i,onClick:S,onDoubleClick:C,onContextMenu:k,expansion:B,customAttributes:H,color:U,backgroundColor:re,className:oe,style:K});return G?G({record:t,index:e,rowProps:P,children:ie,expandedElement:ee}):y.jsxs(y.Fragment,{children:[y.jsx(O.TableTr,{...P,children:ie}),ee]})}function dc({record:t,index:e,selectionChecked:r,onClick:n,onDoubleClick:s,onContextMenu:l,expansion:d,customAttributes:i,color:m,backgroundColor:v,className:_,style:M}){return{className:je("mantine-datatable-row",{[jt]:n||s||d?.isExpandable({record:t,index:e})&&d?.expandOnClick},{[Ps]:l},typeof _=="function"?_(t,e):_),"data-selected":r||void 0,onClick:S=>{if(d){let{isExpandable:C,isRowExpanded:k,expandOnClick:j,expandRow:N,collapseRow:F}=d;C({record:t,index:e})&&j&&(k(t)?F(t):N(t))}n?.({event:S,record:t,index:e})},onDoubleClick:s?S=>s({event:S,record:t,index:e}):void 0,onContextMenu:l?S=>l({event:S,record:t,index:e}):void 0,style:[m||v?S=>{let C=m?.(t,e),k=v?.(t,e);return nc({theme:S,color:C,backgroundColor:k})}:void 0,M?.(t,e)],...i?.(t,e)??{}}}function hc({leftShadowBehind:t,rightShadowBehind:e,onScrollPositionChange:r,children:n,viewportRef:s,scrollAreaProps:l}){return y.jsxs(O.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:r,children:[n,y.jsx(O.Box,{className:je("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-top-shadow")}),y.jsx("div",{className:je("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-left-shadow",{"mantine-datatable-scroll-area-shadow-behind":t})}),y.jsx("div",{className:je("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-right-shadow",{"mantine-datatable-scroll-area-shadow-behind":e})}),y.jsx(O.Box,{className:je("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-bottom-shadow")})]})}function fc({withTableBorder:t,borderRadius:e,textSelectionDisabled:r,height:n="100%",minHeight:s,maxHeight:l,shadow:d,verticalAlign:i="center",fetching:m,columns:v,storeColumnsKey:_,groups:M,pinFirstColumn:S,pinLastColumn:C,defaultColumnProps:k,defaultColumnRender:j,idAccessor:N="id",records:F,selectionTrigger:B="checkbox",selectedRecords:H,onSelectedRecordsChange:U,selectionColumnClassName:re,selectionColumnStyle:oe,isRecordSelectable:K,selectionCheckboxProps:X,allRecordsSelectionCheckboxProps:q={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:V=(Ce,_e)=>({"aria-label":`Select record ${_e+1}`}),sortStatus:G,sortIcons:ie,onSortStatusChange:ee,horizontalSpacing:P,page:x,onPageChange:w,totalRecords:h,recordsPerPage:a,onRecordsPerPageChange:p,recordsPerPageOptions:f,recordsPerPageLabel:c="Records per page",paginationWithEdges:b,paginationWithControls:D,paginationActiveTextColor:T,paginationActiveBackgroundColor:I,paginationSize:Q="sm",paginationText:ne=({from:Ce,to:_e,totalRecords:ze})=>`${Ce} - ${_e} / ${ze}`,paginationWrapBreakpoint:te="sm",getPaginationControlProps:ae=Ce=>Ce==="previous"?{"aria-label":"Previous page"}:Ce==="next"?{"aria-label":"Next page"}:{},getPaginationItemProps:se,renderPagination:ue,loaderBackgroundBlur:E,customLoader:L,loaderSize:$,loaderType:z,loaderColor:Y,loadingText:ce="...",emptyState:o,noRecordsText:u="No records",noRecordsIcon:g,highlightOnHover:A,striped:R,noHeader:W,onRowClick:le,onRowDoubleClick:he,onRowContextMenu:pe,onCellClick:Z,onCellDoubleClick:fe,onCellContextMenu:me,onScroll:ge,onScrollToTop:Se,onScrollToBottom:xe,onScrollToLeft:Pe,onScrollToRight:Ve,c:Ne,backgroundColor:Me,borderColor:Ct,rowBorderColor:Te,stripedColor:rt,highlightOnHoverColor:Ye,rowColor:et,rowBackgroundColor:nt,rowExpansion:$e,rowClassName:ot,rowStyle:st,customRowAttributes:He,scrollViewportRef:Ge,scrollAreaProps:Qe,tableRef:it,bodyRef:yt,m:at,my:ve,mx:Oe,mt:tt,mb:vt,ml:Qt,mr:At,className:bt,classNames:Ke,style:wt,styles:lt,rowFactory:De,tableWrapper:ke,...ct}){let Ce=J.useMemo(()=>M?wn(M):v,[v,M]),[_e,ze]=J.useState(!1),{refs:Ee,onScroll:Et}=Ou({scrollCallbacks:{onScroll:ge,onScrollToTop:Se,onScrollToBottom:xe,onScrollToLeft:Pe,onScrollToRight:Ve},withRowBorders:ct.withRowBorders}),Dn=Mu({key:_,columns:Ce,headerRef:Ee.header,scrollViewportRef:Ee.scrollViewport,onFixedLayoutChange:ze}),Wc=Le.useMergedRef(Ee.table,it),Uc=Le.useMergedRef(Ee.scrollViewport,Ge),qc=Lu({rowExpansion:$e,records:F,idAccessor:N}),Or=J.useRef(!1),Ns=J.useRef(x),kn=J.useRef(F),Vc=J.useCallback(we=>{Or.current=!0,kn.current=F,w(we)},[w,F]);J.useEffect(()=>{Ns.current!==x&&(Or.current=!0,kn.current=F,Ns.current=x)},[x,F]);let jr=F?.length;J.useLayoutEffect(()=>{if(!Or.current||m||F===kn.current)return;let we=Ee.scrollViewport.current;if(!we)return;let St=requestAnimationFrame(()=>{we.scrollTo({top:0,left:0}),Or.current=!1});return()=>cancelAnimationFrame(St)},[m,F,Ee.scrollViewport]);let Ls=F?.map(we=>Ie(we,N)),Tt=!!H,Kt=H?.map(we=>Ie(we,N)),Bs=Ls!==void 0&&Kt!==void 0&&Kt.length>0,Pn=K?F?.filter(K):F,Ar=Pn?.map(we=>Ie(we,N)),Er=Bs&&Ar.every(we=>Kt.includes(we)),Hc=Bs&&Ar.some(we=>Kt.includes(we)),Gc=J.useCallback(()=>{H&&U&&U(Er?H.filter(we=>!Ar.includes(Ie(we,N))):bn([...H,...Pn],we=>Ie(we,N)))},[Er,N,U,Ar,Pn,H]),{lastSelectionChangeIndex:Tr,setLastSelectionChangeIndex:Qc}=ju(Ls),Mn=Tt&&!S,Kc={m:at,my:ve,mx:Oe,mt:tt,mb:vt,ml:Qt,mr:At},Zc=J.useCallback(({children:we})=>ke?ke({children:we}):we,[ke]);return y.jsx(ys,{...Dn,children:y.jsxs(O.Box,{ref:Ee.root,...Kc,className:je("mantine-datatable",{"mantine-datatable-with-border":t},bt,Ke?.root),style:[we=>({...rc({theme:we,c:Ne,backgroundColor:Me,borderColor:Ct,rowBorderColor:Te,stripedColor:rt,highlightOnHoverColor:Ye}),borderRadius:we.radius[e]||e,boxShadow:we.shadows[d]||d,height:n,minHeight:s,maxHeight:l}),wt,lt?.root,{position:"relative"}],children:[y.jsx(hc,{viewportRef:Uc,leftShadowBehind:Tt||!!S,rightShadowBehind:C,onScrollPositionChange:Et,scrollAreaProps:Qe,children:y.jsx(Zc,{children:y.jsxs(O.Table,{ref:Wc,horizontalSpacing:P,className:je("mantine-datatable-table",{[Iu]:r,"mantine-datatable-vertical-align-top":i==="top","mantine-datatable-vertical-align-bottom":i==="bottom","mantine-datatable-pin-last-column":C,"mantine-datatable-selection-column-visible":Tt,"mantine-datatable-pin-first-column":S,"mantine-datatable-resizable-columns":Dn.hasResizableColumns&&_e},Ke?.table),style:{...lt?.table},"data-striped":jr&&R||void 0,"data-highlight-on-hover":A||void 0,...ct,children:[W?null:y.jsx(ys,{...Dn,children:y.jsx(ec,{ref:Ee.header,selectionColumnHeaderRef:Ee.selectionColumnHeader,className:Ke?.header,style:lt?.header,columns:Ce,defaultColumnProps:k,groups:M,sortStatus:G,sortIcons:ie,onSortStatusChange:ee,selectionTrigger:B,selectionVisible:Tt,selectionChecked:Er,selectionIndeterminate:Hc&&!Er,onSelectionChange:Gc,selectionCheckboxProps:{...X,...q},selectorCellShadowVisible:Mn,selectionColumnClassName:re,selectionColumnStyle:oe,withColumnBorders:ct.withColumnBorders})}),y.jsx("tbody",{ref:yt,children:jr?F.map((we,St)=>{let On=Ie(we,N),jn=Kt?.includes(On)||!1,Is;return U&&H&&(Is=Jc=>{if(Jc.nativeEvent.shiftKey&&Tr!==null){let $t=F.filter(St>Tr?(Dt,kt)=>kt>=Tr&&kt<=St&&(K?K(Dt,kt):!0):(Dt,kt)=>kt>=St&&kt<=Tr&&(K?K(Dt,kt):!0));U(jn?Ru(H,$t,Dt=>Ie(Dt,N)):bn([...H,...$t],Dt=>Ie(Dt,N)))}else U(jn?H.filter($t=>Ie($t,N)!==On):bn([...H,we],$t=>Ie($t,N)));Qc(St)}),y.jsx(cc,{record:we,index:St,columns:Ce,defaultColumnProps:k,defaultColumnRender:j,selectionTrigger:B,selectionVisible:Tt,selectionChecked:jn,onSelectionChange:Is,isRecordSelectable:K,selectionCheckboxProps:X,getSelectionCheckboxProps:V,onClick:le,onDoubleClick:he,onCellClick:Z,onCellDoubleClick:fe,onContextMenu:pe,onCellContextMenu:me,expansion:qc,color:et,backgroundColor:nt,className:ot,style:st,customAttributes:He,selectorCellShadowVisible:Mn,selectionColumnClassName:re,selectionColumnStyle:oe,idAccessor:N,rowFactory:De},On)}):y.jsx(xu,{})}),Ce.some(({footer:we})=>we)&&y.jsx(Fu,{ref:Ee.footer,className:Ke?.footer,style:lt?.footer,columns:Ce,defaultColumnProps:k,selectionVisible:Tt,selectorCellShadowVisible:Mn})]})})}),x&&y.jsx(ic,{className:Ke?.pagination,style:lt?.pagination,horizontalSpacing:P,fetching:m,page:x,onPageChange:Vc,totalRecords:h,recordsPerPage:a,onRecordsPerPageChange:p,recordsPerPageOptions:f,recordsPerPageLabel:c,paginationWithEdges:b,paginationWithControls:D,paginationActiveTextColor:T,paginationActiveBackgroundColor:I,paginationSize:Q,paginationText:ne,paginationWrapBreakpoint:te,getPaginationControlProps:ae,getPaginationItemProps:se,noRecordsText:u,loadingText:ce,recordsLength:jr,renderPagination:ue}),y.jsx(tc,{fetching:m,backgroundBlur:E,customContent:L,size:$,type:z,color:Y}),y.jsx(Su,{icon:g,text:u,active:!m&&!jr,children:o})]})})}function js(t){const e=Fe.c(42),{fields:r,onClose:n,queryKey:s,apiPath:l,id:d,steps:i}=t,[m,v]=J.useState(0),[_,M]=J.useState(!1),{data:S,isLoading:C}=qo(l,s,d),{mutateAsync:k,isError:j,error:N,isPending:F}=ln(l,s);let B;e[0]!==r?(B=new Set(r.filter(bc).map(vc)),e[0]=r,e[1]=B):B=e[1];let H;e[2]!==B?(H=[...B],e[2]=B,e[3]=H):H=e[3];const U=H;let re;e[4]!==r?(re=r.reduce(yc,{}),e[4]=r,e[5]=re):re=e[5];let oe;e[6]!==r?(oe=r.filter(mc).reduce(gc,{}),e[6]=r,e[7]=oe):oe=e[7];let K;e[8]!==re||e[9]!==oe?(K={mode:"uncontrolled",initialValues:re,validate:oe},e[8]=re,e[9]=oe,e[10]=K):K=e[10];const X=An.useForm(K);let q;e[11]!==S||e[12]!==r||e[13]!==X?(q=()=>{if(S){const a={...S};r.forEach(p=>{const f=p.id;p.type==="boolean"&&a[f]===null?a[f]=!1:p.type==="date"&&a[f]?a[f]=new Date(a[f]):a[f]===null&&(a[f]="")}),X.initialize(a),X.setValues(a)}},e[11]=S,e[12]=r,e[13]=X,e[14]=q):q=e[14];let V;e[15]!==S?(V=[S],e[15]=S,e[16]=V):V=e[16],J.useEffect(q,V);let G;e[17]===Symbol.for("react.memo_cache_sentinel")?(G=function(p,f){return typeof p.required=="function"?p.required(f??{}):!!p.required},e[17]=G):G=e[17];const ie=G;let ee;e[18]!==X||e[19]!==d?(ee=function(p){const f=X.getValues();if(p.conditional&&!p.conditional(f))return null;const c=ie(p,f);return y.jsxs(J.Fragment,{children:[(p.type===void 0||p.type=="text")&&y.jsx(O.TextInput,{label:p.column.title,placeholder:p.placeholder??"",...X.getInputProps(p.id),type:p.id.includes("email")?"email":void 0,required:c},X.key(p.id)),p.type==="number"&&y.jsx(O.NumberInput,{decimalSeparator:",",label:p.column.title,placeholder:p.placeholder??"",...X.getInputProps(p.id),required:c},X.key(p.id)),p.type==="date"&&y.jsx(Sr,{label:p.column.title,placeholder:p.placeholder??"",valueFormat:"DD.MM.YYYY",clearable:!0,...X.getInputProps(p.id),required:c},X.key(p.id)),p.type==="boolean"&&y.jsx(O.Checkbox,{mt:"md",label:p.column.title,...X.getInputProps(p.id,{type:"checkbox"}),required:c},X.key(p.id)),p.type==="textarea"&&y.jsx(O.Textarea,{label:p.column.title,placeholder:p.placeholder??"",...X.getInputProps(p.id),minRows:3,autosize:!0,required:c},X.key(p.id)),p.type==="custom"&&p.render&&p.render({...X.getValues(),id:d},X.setValues,M,{error:X.getInputProps(p.id).error,required:c})]},p.id)},e[18]=X,e[19]=d,e[20]=ee):ee=e[20];const P=ee;let x;e[21]!==j||e[22]!==N?.message||e[23]!==N?.name?(x=j&&y.jsx(O.Alert,{variant:"outline",color:"red",title:N?.name??"Fehler aufgetreten",mb:"lg",children:N?.message??"Fehler aufgetreten"}),e[21]=j,e[22]=N?.message,e[23]=N?.name,e[24]=x):x=e[24];let w;e[25]!==m||e[26]!==r||e[27]!==X||e[28]!==_||e[29]!==d||e[30]!==C||e[31]!==F||e[32]!==j||e[33]!==n||e[34]!==P||e[35]!==i||e[36]!==U||e[37]!==k?(w=C?y.jsxs(O.Stack,{gap:"md",children:[y.jsx(O.Skeleton,{height:40}),Array(r.length).fill(0).map(pc),y.jsxs(O.Group,{mt:"md",justify:"end",children:[y.jsx(O.Skeleton,{width:100,height:36}),y.jsx(O.Skeleton,{width:100,height:36})]})]}):y.jsxs("form",{onSubmit:X.onSubmit(async a=>{await k({...a,id:d}),U.length&&m<U.length-1?j||v(m+1):j||(X.setInitialValues(a),X.reset(),n())}),children:[U.length?y.jsx(O.Stepper,{active:m,size:"sm",children:U.map(a=>y.jsx(O.Stepper.Step,{...i&&i[a-1]?{label:i[a-1].label}:{},children:r.filter(p=>p.step===a).map(p=>P(p))},a))}):r.map(a=>P(a)),!_&&y.jsxs(O.Group,{mt:"md",justify:"end",children:[y.jsx(O.Button,{onClick:()=>U.length?m===0?n():v(m-1):n(),variant:"outline",children:U.length?m===0?"Abbrechen":"Zurück":"Abbrechen"}),y.jsx(O.Button,{type:"submit",loading:F,children:U.length?m===U.length-1?"Speichern":"Weiter":"Speichern"})]})]}),e[25]=m,e[26]=r,e[27]=X,e[28]=_,e[29]=d,e[30]=C,e[31]=F,e[32]=j,e[33]=n,e[34]=P,e[35]=i,e[36]=U,e[37]=k,e[38]=w):w=e[38];let h;return e[39]!==x||e[40]!==w?(h=y.jsxs(y.Fragment,{children:[x,w]}),e[39]=x,e[40]=w,e[41]=h):h=e[41],h}function pc(t,e){return y.jsx(O.Skeleton,{height:35},`skeleton-field-${e}`)}function gc(t,e){return t[e.id]=(r,n)=>e.conditional&&!e.conditional(n)||!(typeof e.required=="function"?e.required(n):!!e.required)||r?null:"Pflichtfeld",t}function mc(t){return t.required}function yc(t,e){return t[e.id]=e.type==="boolean"?e.defaultValue??!1:e.defaultValue??"",t}function vc(t){return t.step}function bc(t){return typeof t.step=="number"}function As({queryKey:t,apiPath:e,onClose:r,selectedRecords:n}){const{mutateAsync:s,isError:l,error:d,isPending:i}=Go(e,t),[m,v]=J.useState(n),[_,M]=J.useState(!1),S=_||i;return J.useEffect(()=>{m.length||r()},[r,m]),m.length?y.jsxs(y.Fragment,{children:[l&&d.message&&y.jsx(O.Alert,{variant:"outline",color:"red",title:d.name,children:d.message}),y.jsx(O.Text,{children:m.length===1?`Soll ${m.length} Eintrag wirklich gelöscht werden?`:`Sollen ${m.length} Einträge wirklich gelöscht werden?`}),y.jsxs(O.Group,{mt:"md",justify:"end",children:[y.jsx(O.Button,{onClick:r,variant:"outline",disabled:S,children:"Abbrechen"}),y.jsx(O.Button,{color:"red",loading:S,onClick:async()=>{M(!0);try{await Promise.all(m.map(C=>s(C.id))),v([])}finally{M(!1)}},children:"Löschen"})]})]}):y.jsx(y.Fragment,{})}function Es(t,e){const r=Fe.c(8);let n;r[0]!==t||r[1]!==e?(n=()=>{const v=localStorage.getItem(`use_persistent_storage_${e}`);return v?JSON.parse(v):t},r[0]=t,r[1]=e,r[2]=n):n=r[2];const[s,l]=J.useState(n);let d;r[3]!==e?(d=v=>{l(v),localStorage.setItem(`use_persistent_storage_${e}`,JSON.stringify(v))},r[3]=e,r[4]=d):d=r[4];const i=d;let m;return r[5]!==i||r[6]!==s?(m=[s,i],r[5]=i,r[6]=s,r[7]=m):m=r[7],m}const wc=(t,e)=>{const r=t.map(m=>m[e]).filter(m=>m!=null&&m!=="");if(r.length===0)return"string";const n=Math.min(100,r.length),s=r.slice(0,n),l={string:0,number:0,date:0},d=[/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/,/^\d{4}-\d{2}-\d{2}$/,/^\d{1,2}\/\d{1,2}\/\d{4}$/,/^\d{1,2}\.\d{1,2}\.\d{4}$/];s.forEach(m=>{if(typeof m=="number")l.number++;else if(typeof m=="string"){const v=m.trim();if(v!==""&&!isNaN(Number(v))&&!isNaN(parseFloat(v))){l.number++;return}if(d.some(_=>_.test(v))){const _=new Date(v);if(!isNaN(_.getTime())){l.date++;return}}l.string++}else m instanceof Date?l.date++:l.string++});const i=l.string+l.number+l.date;return l.date/i>=.6?"date":l.number/i>=.6?"number":l.string/i>=.6?"string":"mixed"},Ts=new Map,$s=(t,e,r="asc")=>{if(!t||t.length===0)return[];const n=`${String(e)}_${t.length}`;let s=Ts.get(n);return s||(s=wc(t,e),Ts.set(n,s)),[...t].sort((d,i)=>{const m=d[e],v=i[e],_=m==null||m==="",M=v==null||v==="";if(_&&M)return 0;if(_)return r==="asc"?-1:1;if(M)return r==="asc"?1:-1;let S,C;switch(s){case"date":if(typeof m=="string"){const B=new Date(m.trim());S=isNaN(B.getTime())?null:B.getTime()}else m instanceof Date?S=m.getTime():S=null;if(typeof v=="string"){const B=new Date(v.trim());C=isNaN(B.getTime())?null:B.getTime()}else v instanceof Date?C=v.getTime():C=null;break;case"number":if(typeof m=="number")S=m;else{const B=String(m).trim(),H=parseFloat(B);S=isNaN(H)?null:H}if(typeof v=="number")C=v;else{const B=String(v).trim(),H=parseFloat(B);C=isNaN(H)?null:H}break;case"string":const k=typeof m=="string"?m:String(m),j=typeof v=="string"?v:String(v);S=k.toLowerCase().trim(),C=j.toLowerCase().trim();break;case"mixed":default:const N=String(m),F=String(v);S=N.toLowerCase().trim(),C=F.toLowerCase().trim();break}return S===null&&C===null?0:S===null?r==="asc"?1:-1:C===null||S<C?r==="asc"?-1:1:S>C?r==="asc"?1:-1:0})};function _c(t,e){return e.split(".").reduce((r,n)=>{if(r&&typeof r=="object"&&n in r)return r[n]},t)}function xc(t,e){const r=e.column;if(r.render)return r.render(t,0);const n=r.accessor??e.id,s=_c(t,n);return s==null?y.jsx(O.Text,{c:"dimmed",children:"–"}):typeof s=="boolean"?y.jsx(O.Text,{fz:"sm",children:s?"Ja":"Nein"}):y.jsx(O.Text,{fz:"sm",children:String(s)})}function Cc(t){const e=Fe.c(10),{field:r,record:n}=t,s=r.column.title??r.id;let l;e[0]!==s?(l=y.jsx(O.Text,{fw:700,fz:"sm",children:s}),e[0]=s,e[1]=l):l=e[1];let d;e[2]!==r||e[3]!==n?(d=xc(n,r),e[2]=r,e[3]=n,e[4]=d):d=e[4];let i;e[5]!==d?(i=y.jsx(O.Box,{ta:"right",fz:"sm",children:d}),e[5]=d,e[6]=i):i=e[6];let m;return e[7]!==l||e[8]!==i?(m=y.jsxs(O.Group,{wrap:"nowrap",justify:"space-between",align:"center",py:"xs",px:"sm",children:[l,i]}),e[7]=l,e[8]=i,e[9]=m):m=e[9],m}function Rs(t){const e=Fe.c(40),{records:r,fields:n,selection:s,selectedRecords:l,onSelectedRecordsChange:d,onRowClick:i,cardActions:m,pagination:v,sort:_,rowExpansion:M}=t;let S;e[0]!==l?(S=l===void 0?[]:l,e[0]=l,e[1]=S):S=e[1];const C=S;let k;e[2]===Symbol.for("react.memo_cache_sentinel")?(k=new Set,e[2]=k):k=e[2];const[j,N]=J.useState(k);let F;e[3]===Symbol.for("react.memo_cache_sentinel")?(F=G=>{N(ie=>{const ee=new Set(ie);return ee.has(G)?ee.delete(G):ee.add(G),ee})},e[3]=F):F=e[3];const B=F;let H,U,re,oe,K,X;if(e[4]!==m||e[5]!==j||e[6]!==n||e[7]!==i||e[8]!==d||e[9]!==r||e[10]!==M||e[11]!==C||e[12]!==s||e[13]!==_){X=Symbol.for("react.early_return_sentinel");e:{const G=n.filter(Oc),ie=G.filter(Mc).reduce(Pc,[]);let ee;e[20]!==C?(ee=p=>C.some(f=>f.id===p.id),e[20]=C,e[21]=ee):ee=e[21];const P=ee;let x;e[22]!==P||e[23]!==d||e[24]!==C?(x=p=>{d&&(P(p)?d(C.filter(f=>f.id!==p.id)):d([...C,p]))},e[22]=P,e[23]=d,e[24]=C,e[25]=x):x=e[25];const w=x;let h;e[26]!==i||e[27]!==s||e[28]!==w?(h=(p,f,c)=>{i?i({record:p,index:f,event:c}):s&&w(p)},e[26]=i,e[27]=s,e[28]=w,e[29]=h):h=e[29];const a=h;if(r.length===0){let p;e[30]===Symbol.for("react.memo_cache_sentinel")?(p=y.jsx(O.Text,{c:"dimmed",ta:"center",py:"xl",children:"Keine Einträge gefunden"}),e[30]=p):p=e[30],X=p;break e}H=O.Stack,U="sm",re="md",oe=_&&ie.length>0&&y.jsxs(O.Group,{gap:"xs",wrap:"nowrap",children:[y.jsx(O.Select,{data:ie,value:_.field,onChange:p=>p&&_.onSortChange(p,_.direction),allowDeselect:!1,style:{flex:1}}),y.jsx(O.ActionIcon,{variant:"filled",size:"input-sm",onClick:()=>_.onSortChange(_.field,_.direction==="asc"?"desc":"asc"),children:_.direction==="asc"?y.jsx(ut.IconSortAscending,{size:18}):y.jsx(ut.IconSortDescending,{size:18})})]}),K=r.map((p,f)=>{const c=P(p),b=!!i||!!s,D=p.id??f,T=j.has(D);return y.jsx(J.Fragment,{children:y.jsxs(O.Box,{bg:c?"var(--mantine-primary-color-light)":f%2===0?"var(--mantine-color-gray-0)":"white",bd:c?void 0:"1px solid var(--mantine-color-gray-2)",style:{borderRadius:"var(--mantine-radius-md)",overflow:"hidden"},children:[y.jsxs(O.Box,{w:"100%",style:{cursor:b||M?"pointer":"default"},onClick:I=>{M&&!i?B(D):a(p,f,I)},children:[(s||M||m&&m.length>0)&&y.jsxs(O.Group,{px:"sm",pt:"sm",justify:"space-between",children:[y.jsxs(O.Group,{gap:"xs",children:[M&&y.jsx(O.Box,{c:"var(--mantine-primary-color-filled)",style:{cursor:"pointer",display:"flex",alignItems:"center"},onClick:I=>{I.stopPropagation(),B(D)},children:y.jsx(ut.IconChevronDown,{size:16,style:{transform:T?"rotate(0deg)":"rotate(-90deg)",transition:"transform 200ms"}})}),s&&y.jsx(O.Checkbox,{checked:c,onChange:()=>w(p),onClick:kc})]}),m&&m.length>0&&y.jsxs(O.Menu,{shadow:"md",position:"bottom-end",children:[y.jsx(O.Menu.Target,{children:y.jsx(O.ActionIcon,{variant:"subtle",color:"gray",size:"sm",onClick:Dc,children:y.jsx(ut.IconDotsVertical,{size:16})})}),y.jsx(O.Menu.Dropdown,{children:m.map((I,Q)=>y.jsx(O.Menu.Item,{leftSection:I.icon,color:I.color,onClick:ne=>{ne.stopPropagation(),I.onClick(p)},children:I.label},`card_action_${Q}`))})]})]}),G.map((I,Q)=>y.jsxs(J.Fragment,{children:[Q>0&&y.jsx(O.Divider,{}),y.jsx(Cc,{field:I,record:p})]},I.id))]}),M&&y.jsxs(O.Collapse,{in:T,children:[y.jsx(O.Divider,{}),y.jsx(O.Box,{px:"sm",py:"sm",children:M.content(p)})]})]})},D)})}e[4]=m,e[5]=j,e[6]=n,e[7]=i,e[8]=d,e[9]=r,e[10]=M,e[11]=C,e[12]=s,e[13]=_,e[14]=H,e[15]=U,e[16]=re,e[17]=oe,e[18]=K,e[19]=X}else H=e[14],U=e[15],re=e[16],oe=e[17],K=e[18],X=e[19];if(X!==Symbol.for("react.early_return_sentinel"))return X;let q;e[31]!==v?(q=v&&v.totalRecords>v.recordsPerPage&&y.jsxs(O.Stack,{gap:"xs",mt:"sm",children:[y.jsx(O.Group,{justify:"center",children:y.jsx(O.Pagination,{total:Math.ceil(v.totalRecords/v.recordsPerPage),value:v.page,onChange:v.onPageChange,size:"sm"})}),v.recordsPerPageOptions&&v.onRecordsPerPageChange&&y.jsxs(O.Group,{justify:"center",gap:"xs",children:[y.jsx(O.Text,{fz:"xs",c:"dimmed",children:"Einträge pro Seite:"}),y.jsx(O.Select,{data:v.recordsPerPageOptions.map(Sc),value:String(v.recordsPerPage),onChange:G=>G&&v.onRecordsPerPageChange(Number(G)),allowDeselect:!1,size:"xs",w:70})]})]}),e[31]=v,e[32]=q):q=e[32];let V;return e[33]!==H||e[34]!==q||e[35]!==U||e[36]!==re||e[37]!==oe||e[38]!==K?(V=y.jsxs(H,{gap:U,my:re,children:[oe,K,q]}),e[33]=H,e[34]=q,e[35]=U,e[36]=re,e[37]=oe,e[38]=K,e[39]=V):V=e[39],V}function Sc(t){return{value:String(t),label:String(t)}}function Dc(t){return t.stopPropagation()}function kc(t){return t.stopPropagation()}function Pc(t,e){const r=e.column.accessor??e.id;return t.some(n=>n.value===r)||t.push({value:r,label:e.column.title??e.id}),t}function Mc(t){return t.column.sortable!==!1}function Oc(t){return t.list&&t.column}const Sn=[10,15,50,100,500];function jc(t){const e=Fe.c(117),{title:r,queryKey:n,connectedQueryKeys:s,apiPath:l,mutationApiPath:d,buttons:i,fields:m,selection:v,pagination:_,filters:M,actions:S,steps:C,defaultSort:k,onSortChange:j,createButtonText:N,queryParams:F,tabs:B,defaultTab:H,activeTab:U,onActiveTabChange:re,canUpdate:oe,canDelete:K,showRefresh:X,rowExpansion:q,onRowClick:V,mobileCards:G}=t,ie=X===void 0?!0:X,ee=G===void 0?!1:G,[P,x]=J.useState(H||(B&&B.length>0?B[0].value:null)),w=U!==void 0?U:P;let h;e[0]!==U||e[1]!==re?(h=De=>{U===void 0&&x(De),re&&re(De)},e[0]=U,e[1]=re,e[2]=h):h=e[2];const a=h,p=B?.find(De=>De.value===w)?.queryParams||{},f={...F,...p},c=f?"?"+Object.entries(f).filter(zc).map(Yc).join("&"):"";let b;e[3]!==w||e[4]!==n?(b=w?[...n,w]:n,e[3]=w,e[4]=n,e[5]=b):b=e[5];const D=b,{data:T,isLoading:I,isError:Q,isRefetching:ne,refetch:te}=Vo(l+c,D),{queryClient:ae}=ft();let se,ue;e[6]!==T||e[7]!==s||e[8]!==ae?(se=()=>{!T||!Array.isArray(T)||s?.forEach(De=>ae.invalidateQueries({queryKey:De}))},ue=[T,s,ae],e[6]=T,e[7]=s,e[8]=ae,e[9]=se,e[10]=ue):(se=e[9],ue=e[10]),J.useEffect(se,ue);const E=!T||!Array.isArray(T)?[]:!M||M.length===0?T:T.filter(De=>M.every(ke=>{if(ke.value===void 0)return!0;const ct=ke.id;if(ke.type==="query"){const Ce=De[ct];return Array.isArray(ke.value)?Array.isArray(Ce)?Ce.some(_e=>{if(typeof _e=="string"||typeof _e=="number")return ke.value.includes(String(_e));if(_e&&typeof _e=="object"){if("id"in _e&&ke.value.includes(_e.id))return!0;for(const ze in _e){const Ee=_e[ze];if(typeof Ee=="string"&&ke.value.includes(Ee)||Ee&&typeof Ee=="object"&&"id"in Ee&&ke.value.includes(Ee.id))return!0}}return!1}):Ce&&typeof Ce=="object"&&"id"in Ce?ke.value.includes(Ce.id):!1:typeof Ce=="string"&&Ce.includes(ke.value)}else if(ke.type==="date"){const Ce=ke.value;if(!Ce)return!0;const[_e,ze]=Ce;if(!_e&&!ze)return!0;const Ee=De[ct];if(typeof Ee=="string"){const Et=Ee.split(" ")[0];if(_e&&ze)return Et>=_e&&Et<=ze;if(_e&&!ze)return Et>=_e;if(!_e&&ze)return Et<=ze}return!0}else if(ke.type==="boolean")return De[ct]===ke.value;return!0})),L=k?.field??m[0].id,$=k?.direction??"desc";let z;e[11]!==L||e[12]!==$?(z={columnAccessor:L,direction:$},e[11]=L,e[12]=$,e[13]=z):z=e[13];const[Y,ce]=J.useState(z);let o;e[14]!==j?(o=De=>{ce(De),j&&j(String(De.columnAccessor),De.direction)},e[14]=j,e[15]=o):o=e[15];const u=o,g=$s(E,Y.columnAccessor,Y.direction),[A,R]=Es(Sn[1],"mantine-table-page-size"),[W,le]=J.useState(1),he=_?g.slice((W-1)*A,W*A):g;let pe;e[16]===Symbol.for("react.memo_cache_sentinel")?(pe=[],e[16]=pe):pe=e[16];const[Z,fe]=J.useState(pe);let me;e[17]===Symbol.for("react.memo_cache_sentinel")?(me=()=>{fe([])},e[17]=me):me=e[17];let ge;e[18]!==w?(ge=[w],e[18]=w,e[19]=ge):ge=e[19],J.useEffect(me,ge);const[Se,xe]=J.useState(!1),[Pe,Ve]=J.useState(!1),[Ne,Me]=J.useState(!1),Ct=r?"space-between":"end";let Te;e[20]!==r?(Te=r&&(typeof r=="string"?y.jsx(O.Title,{order:4,children:r}):r),e[20]=r,e[21]=Te):Te=e[21];let rt;e[22]===Symbol.for("react.memo_cache_sentinel")?(rt={marginLeft:"auto"},e[22]=rt):rt=e[22];let Ye;e[23]!==te||e[24]!==ie?(Ye=ie&&y.jsx(O.ActionIcon,{variant:"subtle",onClick:()=>te(),"aria-label":"Neuladen",children:y.jsx(ut.IconRefresh,{})}),e[23]=te,e[24]=ie,e[25]=Ye):Ye=e[25];let et;e[26]!==S||e[27]!==K||e[28]!==oe||e[29]!==m||e[30]!==ee||e[31]!==Z||e[32]!==v?(et=(m.some(Ic)||v)&&(()=>{const De=m.find(Bc)&&(!oe||Z.length>0&&oe(Z[0])),ke=m.find(Lc)&&(!K||Z.length>0&&K(Z[0])),ct=(S??[]).length>0,Ce=De||ke||ct;return y.jsx(O.Box,{...ee?{visibleFrom:"sm"}:{},children:y.jsxs(O.Menu,{shadow:"md",children:[y.jsx(O.Menu.Target,{children:y.jsx(O.Button,{variant:"outline",rightSection:y.jsx(ut.IconCaretDownFilled,{size:14}),disabled:!Z.length||!Ce,children:"Aktionen"})}),y.jsxs(O.Menu.Dropdown,{children:[De&&y.jsx(O.Menu.Item,{leftSection:y.jsx(ut.IconPencil,{size:14}),onClick:()=>Ve(!0),disabled:Z.length!==1,children:"Bearbeiten"}),(S??[]).map((_e,ze)=>J.createElement(O.Menu.Item,{..._e.icon&&{leftSection:_e.icon},key:`custom_action_${ze}`,onClick:()=>_e.onClick(Z)},_e.label)),ke&&y.jsx(O.Menu.Item,{leftSection:y.jsx(ut.IconTrash,{size:14}),onClick:()=>Me(!0),color:"red",children:"Löschen"})]})]})})})(),e[26]=S,e[27]=K,e[28]=oe,e[29]=m,e[30]=ee,e[31]=Z,e[32]=v,e[33]=et):et=e[33];let nt;e[34]!==N||e[35]!==m||e[36]!==I?(nt=m.find(Nc)&&y.jsx(O.Button,{onClick:()=>xe(!0),disabled:I,children:N??"Erstellen"}),e[34]=N,e[35]=m,e[36]=I,e[37]=nt):nt=e[37];let $e;e[38]!==i||e[39]!==Ye||e[40]!==et||e[41]!==nt?($e=y.jsxs(O.Group,{align:"center",gap:"xs",wrap:"wrap",justify:"end",style:rt,children:[Ye,et,nt,i]}),e[38]=i,e[39]=Ye,e[40]=et,e[41]=nt,e[42]=$e):$e=e[42];let ot;e[43]!==Ct||e[44]!==Te||e[45]!==$e?(ot=y.jsxs(O.Group,{gap:"xs",justify:Ct,align:"center",wrap:"wrap",children:[Te,$e]}),e[43]=Ct,e[44]=Te,e[45]=$e,e[46]=ot):ot=e[46];let st;e[47]!==w||e[48]!==a||e[49]!==B?(st=B&&B.length>0&&y.jsx(O.Tabs,{value:w,onChange:a,mt:"md",children:y.jsx(O.Tabs.List,{children:B.map(Rc)})}),e[47]=w,e[48]=a,e[49]=B,e[50]=st):st=e[50];let He;e[51]!==Q?(He=Q&&y.jsx(O.Alert,{mt:"md",variant:"light",color:"red",title:"Es ist ein Fehler aufgetreten.",icon:y.jsx(ut.IconInfoCircle,{}),children:"Bitte versuche es später erneut oder sende eine Nachricht an unseren Support."}),e[51]=Q,e[52]=He):He=e[52];let Ge;e[53]!==I||e[54]!==ne?(Ge=(I||ne)&&y.jsxs(O.Stack,{my:"md",children:[y.jsx(O.Skeleton,{height:40}),Array(5).fill(0).map($c)]}),e[53]=I,e[54]=ne,e[55]=Ge):Ge=e[55];let Qe;e[56]!==m||e[57]!==u||e[58]!==Q||e[59]!==I||e[60]!==ne||e[61]!==ee||e[62]!==V||e[63]!==W||e[64]!==A||e[65]!==_||e[66]!==he||e[67]!==q||e[68]!==Z||e[69]!==v||e[70]!==le||e[71]!==R||e[72]!==Y||e[73]!==g?(Qe=!I&&!ne&&y.jsxs(y.Fragment,{children:[y.jsx(O.Box,{...ee?{visibleFrom:"sm"}:{},children:y.jsx(fc,{my:"md",striped:!0,highlightOnHover:!0,minHeight:150,fetching:Q,records:he,sortStatus:Y,onSortStatusChange:u,...v&&{selectedRecords:Z,onSelectedRecordsChange:fe},..._&&he.length&&{totalRecords:g.length,recordsPerPage:A,onPageChange:le,page:W,recordsPerPageOptions:Sn,onRecordsPerPageChange:R,recordsPerPageLabel:"Einträge pro Seite"},...q&&{rowExpansion:{allowMultiple:q.allowMultiple??!1,content:De=>{const{record:ke}=De;return q.content(ke)},...q.expanded&&{expanded:q.expanded}}},columns:m.map(Tc),noRecordsText:"Keine Einträge gefunden",onRowClick:V,...V&&{style:{cursor:"pointer"}}})}),ee&&y.jsx(O.Box,{hiddenFrom:"sm",children:y.jsx(Rs,{records:he,fields:m,selection:v,selectedRecords:Z,onSelectedRecordsChange:fe,onRowClick:V,sort:{field:String(Y.columnAccessor),direction:Y.direction,onSortChange:(De,ke)=>{u({columnAccessor:De,direction:ke})}},..._&&he.length&&{pagination:{totalRecords:g.length,recordsPerPage:A,page:W,onPageChange:le,recordsPerPageOptions:Sn,onRecordsPerPageChange:De=>{R(De),le(1)}}},...q&&{rowExpansion:{content:q.content}}})})]}),e[56]=m,e[57]=u,e[58]=Q,e[59]=I,e[60]=ne,e[61]=ee,e[62]=V,e[63]=W,e[64]=A,e[65]=_,e[66]=he,e[67]=q,e[68]=Z,e[69]=v,e[70]=le,e[71]=R,e[72]=Y,e[73]=g,e[74]=Qe):Qe=e[74];let it;e[75]===Symbol.for("react.memo_cache_sentinel")?(it=()=>{Ve(!1),fe([])},e[75]=it):it=e[75];const yt=r??"Bearbeiten";let at;e[76]!==l||e[77]!==m||e[78]!==d||e[79]!==n||e[80]!==Z[0]||e[81]!==Z.length||e[82]!==C?(at=Z.length>0&&y.jsx(js,{fields:m.filter(Ec),queryKey:n,apiPath:d??l,id:Z[0].id,onClose:()=>{Ve(!1),fe([])},steps:C}),e[76]=l,e[77]=m,e[78]=d,e[79]=n,e[80]=Z[0],e[81]=Z.length,e[82]=C,e[83]=at):at=e[83];let ve;e[84]!==yt||e[85]!==at||e[86]!==Pe?(ve=y.jsx(O.Modal,{opened:Pe,onClose:it,title:yt,children:at}),e[84]=yt,e[85]=at,e[86]=Pe,e[87]=ve):ve=e[87];let Oe;e[88]!==l||e[89]!==Ne||e[90]!==d||e[91]!==n||e[92]!==Z||e[93]!==r?(Oe=Z.length>0&&y.jsx(O.Modal,{opened:Ne,onClose:()=>{Me(!1),fe([])},title:r??"Löschen",children:y.jsx(As,{onClose:()=>{Me(!1),fe([])},queryKey:n,apiPath:d??l,selectedRecords:Z})}),e[88]=l,e[89]=Ne,e[90]=d,e[91]=n,e[92]=Z,e[93]=r,e[94]=Oe):Oe=e[94];let tt;e[95]===Symbol.for("react.memo_cache_sentinel")?(tt=()=>{xe(!1)},e[95]=tt):tt=e[95];const vt=r??"Anlegen",Qt=d??l;let At;e[96]===Symbol.for("react.memo_cache_sentinel")?(At=()=>{xe(!1)},e[96]=At):At=e[96];let bt;e[97]!==m?(bt=m.filter(Ac),e[97]=m,e[98]=bt):bt=e[98];let Ke;e[99]!==n||e[100]!==C||e[101]!==Qt||e[102]!==bt?(Ke=y.jsx(ms,{queryKey:n,apiPath:Qt,onClose:At,fields:bt,steps:C}),e[99]=n,e[100]=C,e[101]=Qt,e[102]=bt,e[103]=Ke):Ke=e[103];let wt;e[104]!==Se||e[105]!==vt||e[106]!==Ke?(wt=y.jsx(O.Modal,{opened:Se,onClose:tt,title:vt,children:Ke}),e[104]=Se,e[105]=vt,e[106]=Ke,e[107]=wt):wt=e[107];let lt;return e[108]!==ot||e[109]!==st||e[110]!==He||e[111]!==Ge||e[112]!==Qe||e[113]!==ve||e[114]!==Oe||e[115]!==wt?(lt=y.jsxs(y.Fragment,{children:[ot,st,He,Ge,Qe,ve,Oe,wt]}),e[108]=ot,e[109]=st,e[110]=He,e[111]=Ge,e[112]=Qe,e[113]=ve,e[114]=Oe,e[115]=wt,e[116]=lt):lt=e[116],lt}function Ac(t){return t.create}function Ec(t){return t.update}function Tc(t){return t.column}function $c(t,e){return y.jsx(O.Skeleton,{height:35},`skeleton-${e}`)}function Rc(t){return y.jsx(O.Tabs.Tab,{value:t.value,leftSection:t.icon,children:t.label},t.value)}function Nc(t){return t.create}function Lc(t){return t.delete}function Bc(t){return t.update}function Ic(t){return t.update}function Yc(t){const[e,r]=t;return`${e}=${encodeURIComponent(r??"")}`}function zc(t){const[,e]=t;return e!=null}function Fc(t){const e=Fe.c(5),{queryClient:r}=ft();let n;e[0]!==t?(n=y.jsx(jc,{...t}),e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==r||e[3]!==n?(s=y.jsx(Kn,{client:r,children:n}),e[2]=r,e[3]=n,e[4]=s):s=e[4],s}be.CreateModal=ms,be.DataTable=Fc,be.DataTableProvider=ml,be.DeleteModal=As,be.MobileCardList=Rs,be.UpdateModal=js,be.api=vl,be.createOne=Wo,be.deleteOne=Fo,be.getAll=Yo,be.getApiHeaders=xt,be.getOne=zo,be.sortData=$s,be.updateOne=Uo,be.useAddOne=Ho,be.useDataTable=ft,be.useDeleteOne=Go,be.useGetAll=Vo,be.useGetOne=qo,be.usePersistentState=Es,be.useUpdateOne=ln,Object.defineProperty(be,Symbol.toStringTag,{value:"Module"})}));
|
|
23
|
+
`+c,m(`data:${ee(a)};charset=utf-8,${encodeURIComponent(c)}`,`${p}.svg`)}else m(f.toDataURL(ee(a)),`${p}.${a}`)}}const x=P})(),l.default})())})(sn)),sn.exports}gl();const Io=J.createContext(void 0);function ml(t){const e=Fe.c(9),{children:r,baseUrl:n,queryClient:s}=t;let l;e[0]!==n||e[1]!==s?(l={baseUrl:n,queryClient:s},e[0]=n,e[1]=s,e[2]=l):l=e[2];let d;e[3]!==r||e[4]!==s?(d=y.jsx(Kn,{client:s,children:r}),e[3]=r,e[4]=s,e[5]=d):d=e[5];let i;return e[6]!==l||e[7]!==d?(i=y.jsx(Io.Provider,{value:l,children:d}),e[6]=l,e[7]=d,e[8]=i):i=e[8],i}function ft(){const t=J.useContext(Io);if(!t)throw new Error("useDataTable must be used within a DataTableProvider");return t}function an(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 Ot(t){const e=await t.text();if(!e)throw new Error(`HTTP ${t.status}: ${t.statusText}`);let r=null;try{r=JSON.parse(e)}catch{throw new Error(e)}throw r?.message?new Error(r.message):r?.error?new Error(r.error):new Error(e)}function yl(){const t=localStorage.getItem("a360.assumed-org");return t?{"X-Assume-Org":t}:{}}async function xt(){return{"Content-Type":"application/json",Authorization:`Bearer ${await ol()??""}`,...yl()}}async function Yo(t){return fetch(t,{method:"GET",headers:await xt()}).then(async e=>(e.status>=400&&await Ot(e),e)).then(e=>e.json()).then(e=>e)}async function zo(t,e){return fetch(`${t}/${e}`,{method:"GET",headers:await xt()}).then(async r=>(r.status>=400&&await Ot(r),r)).then(r=>r.json()).then(r=>r)}async function Fo(t,e){const r=await fetch(`${t}/${e}`,{method:"DELETE",headers:await xt()});r.status>=400&&await Ot(r)}async function Wo(t,e){return fetch(t,{method:"POST",headers:await xt(),body:JSON.stringify(e)}).then(async r=>(r.status>=400&&await Ot(r),r)).then(r=>r.status==204?e:r.json()).then(r=>r)}async function vl(t,e,r){return fetch(e,{method:t,headers:await xt(),body:r?JSON.stringify(r):void 0}).then(async n=>(n.status>=400&&await Ot(n),n)).then(n=>{if(n.status!=204)return n.json()}).then(n=>n)}async function Uo(t,e){return fetch(`${t}/${e.id}`,{method:"PUT",headers:await xt(),body:JSON.stringify(e)}).then(async r=>(r.status>=400&&await Ot(r),r)).then(r=>r.status==204?e:r.json()).then(r=>r)}function qo(t,e,r){const n=Fe.c(13),{baseUrl:s}=ft();let l;if(n[0]!==r||n[1]!==e){let v;n[3]!==r?(v=r?.toString(),n[3]=r,n[4]=v):v=n[4],l=[...e.map(bl),String(v)],n[0]=r,n[1]=e,n[2]=l}else l=n[2];let d;n[5]!==t||n[6]!==s||n[7]!==r?(d=()=>zo(`${s}${t}`,r),n[5]=t,n[6]=s,n[7]=r,n[8]=d):d=n[8];const i=!!r;let m;return n[9]!==l||n[10]!==d||n[11]!==i?(m={queryKey:l,queryFn:d,enabled:i},n[9]=l,n[10]=d,n[11]=i,n[12]=m):m=n[12],Xn(m)}function bl(t){return t.toString()}function Vo(t,e,r){const n=Fe.c(9),s=r===void 0?!0:r,{baseUrl:l}=ft();let d;n[0]!==e?(d=[...e.map(wl)],n[0]=e,n[1]=d):d=n[1];let i;n[2]!==t||n[3]!==l?(i=()=>Yo(`${l}${t}`),n[2]=t,n[3]=l,n[4]=i):i=n[4];let m;return n[5]!==s||n[6]!==d||n[7]!==i?(m={queryKey:d,queryFn:i,enabled:s},n[5]=s,n[6]=d,n[7]=i,n[8]=m):m=n[8],Xn(m)}function wl(t){return t.toString()}function Ho(t,e){const r=Fe.c(10),{baseUrl:n,queryClient:s}=ft();let l;r[0]!==e?(l=[...e.map(xl)],r[0]=e,r[1]=l):l=r[1];let d;r[2]!==t||r[3]!==n?(d=m=>Wo(`${n}${t}`,m),r[2]=t,r[3]=n,r[4]=d):d=r[4];let i;return r[5]!==s||r[6]!==e||r[7]!==l||r[8]!==d?(i={mutationKey:l,mutationFn:d,onSettled(){return s.invalidateQueries({queryKey:[...e.map(_l)]})},onError(m){an(m)}},r[5]=s,r[6]=e,r[7]=l,r[8]=d,r[9]=i):i=r[9],Yr(i)}function _l(t){return t.toString()}function xl(t){return t.toString()}function ln(t,e){const r=Fe.c(10),{baseUrl:n,queryClient:s}=ft();let l;r[0]!==e?(l=[...e.map(Sl)],r[0]=e,r[1]=l):l=r[1];let d;r[2]!==t||r[3]!==n?(d=m=>Uo(`${n}${t}`,m),r[2]=t,r[3]=n,r[4]=d):d=r[4];let i;return r[5]!==s||r[6]!==e||r[7]!==l||r[8]!==d?(i={mutationKey:l,mutationFn:d,onSettled(){return s.invalidateQueries({queryKey:[...e.map(Cl)]})},onError(m){an(m)}},r[5]=s,r[6]=e,r[7]=l,r[8]=d,r[9]=i):i=r[9],Yr(i)}function Cl(t){return t.toString()}function Sl(t){return t.toString()}function Go(t,e){const r=Fe.c(10),{baseUrl:n,queryClient:s}=ft();let l;r[0]!==e?(l=[...e.map(kl)],r[0]=e,r[1]=l):l=r[1];let d;r[2]!==t||r[3]!==n?(d=m=>Fo(`${n}${t}`,m),r[2]=t,r[3]=n,r[4]=d):d=r[4];let i;return r[5]!==s||r[6]!==e||r[7]!==l||r[8]!==d?(i={mutationKey:l,mutationFn:d,onSettled(){return s.invalidateQueries({queryKey:[...e.map(Dl)]})},onError(m){an(m)}},r[5]=s,r[6]=e,r[7]=l,r[8]=d,r[9]=i):i=r[9],Yr(i)}function Dl(t){return t.toString()}function kl(t){return t.toString()}var dr={exports:{}},Pl=dr.exports,Qo;function Ml(){return Qo||(Qo=1,(function(t,e){(function(r,n){t.exports=n()})(Pl,(function(){var r=1e3,n=6e4,s=36e5,l="millisecond",d="second",i="minute",m="hour",v="day",_="week",M="month",S="quarter",C="year",k="date",j="Invalid Date",N=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,F=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,B={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(P){var x=["th","st","nd","rd"],w=P%100;return"["+P+(x[(w-20)%10]||x[w]||x[0])+"]"}},H=function(P,x,w){var h=String(P);return!h||h.length>=x?P:""+Array(x+1-h.length).join(w)+P},U={s:H,z:function(P){var x=-P.utcOffset(),w=Math.abs(x),h=Math.floor(w/60),a=w%60;return(x<=0?"+":"-")+H(h,2,"0")+":"+H(a,2,"0")},m:function P(x,w){if(x.date()<w.date())return-P(w,x);var h=12*(w.year()-x.year())+(w.month()-x.month()),a=x.clone().add(h,M),p=w-a<0,f=x.clone().add(h+(p?-1:1),M);return+(-(h+(w-a)/(p?a-f:f-a))||0)},a:function(P){return P<0?Math.ceil(P)||0:Math.floor(P)},p:function(P){return{M,y:C,w:_,d:v,D:k,h:m,m:i,s:d,ms:l,Q:S}[P]||String(P||"").toLowerCase().replace(/s$/,"")},u:function(P){return P===void 0}},re="en",oe={};oe[re]=B;var K="$isDayjsObject",X=function(P){return P instanceof ie||!(!P||!P[K])},q=function P(x,w,h){var a;if(!x)return re;if(typeof x=="string"){var p=x.toLowerCase();oe[p]&&(a=p),w&&(oe[p]=w,a=p);var f=x.split("-");if(!a&&f.length>1)return P(f[0])}else{var c=x.name;oe[c]=x,a=c}return!h&&a&&(re=a),a||!h&&re},V=function(P,x){if(X(P))return P.clone();var w=typeof x=="object"?x:{};return w.date=P,w.args=arguments,new ie(w)},G=U;G.l=q,G.i=X,G.w=function(P,x){return V(P,{locale:x.$L,utc:x.$u,x:x.$x,$offset:x.$offset})};var ie=(function(){function P(w){this.$L=q(w.locale,null,!0),this.parse(w),this.$x=this.$x||w.x||{},this[K]=!0}var x=P.prototype;return x.parse=function(w){this.$d=(function(h){var a=h.date,p=h.utc;if(a===null)return new Date(NaN);if(G.u(a))return new Date;if(a instanceof Date)return new Date(a);if(typeof a=="string"&&!/Z$/i.test(a)){var f=a.match(N);if(f){var c=f[2]-1||0,b=(f[7]||"0").substring(0,3);return p?new Date(Date.UTC(f[1],c,f[3]||1,f[4]||0,f[5]||0,f[6]||0,b)):new Date(f[1],c,f[3]||1,f[4]||0,f[5]||0,f[6]||0,b)}}return new Date(a)})(w),this.init()},x.init=function(){var w=this.$d;this.$y=w.getFullYear(),this.$M=w.getMonth(),this.$D=w.getDate(),this.$W=w.getDay(),this.$H=w.getHours(),this.$m=w.getMinutes(),this.$s=w.getSeconds(),this.$ms=w.getMilliseconds()},x.$utils=function(){return G},x.isValid=function(){return this.$d.toString()!==j},x.isSame=function(w,h){var a=V(w);return this.startOf(h)<=a&&a<=this.endOf(h)},x.isAfter=function(w,h){return V(w)<this.startOf(h)},x.isBefore=function(w,h){return this.endOf(h)<V(w)},x.$g=function(w,h,a){return G.u(w)?this[h]:this.set(a,w)},x.unix=function(){return Math.floor(this.valueOf()/1e3)},x.valueOf=function(){return this.$d.getTime()},x.startOf=function(w,h){var a=this,p=!!G.u(h)||h,f=G.p(w),c=function(ae,se){var ue=G.w(a.$u?Date.UTC(a.$y,se,ae):new Date(a.$y,se,ae),a);return p?ue:ue.endOf(v)},b=function(ae,se){return G.w(a.toDate()[ae].apply(a.toDate("s"),(p?[0,0,0,0]:[23,59,59,999]).slice(se)),a)},D=this.$W,T=this.$M,I=this.$D,Q="set"+(this.$u?"UTC":"");switch(f){case C:return p?c(1,0):c(31,11);case M:return p?c(1,T):c(0,T+1);case _:var ne=this.$locale().weekStart||0,te=(D<ne?D+7:D)-ne;return c(p?I-te:I+(6-te),T);case v:case k:return b(Q+"Hours",0);case m:return b(Q+"Minutes",1);case i:return b(Q+"Seconds",2);case d:return b(Q+"Milliseconds",3);default:return this.clone()}},x.endOf=function(w){return this.startOf(w,!1)},x.$set=function(w,h){var a,p=G.p(w),f="set"+(this.$u?"UTC":""),c=(a={},a[v]=f+"Date",a[k]=f+"Date",a[M]=f+"Month",a[C]=f+"FullYear",a[m]=f+"Hours",a[i]=f+"Minutes",a[d]=f+"Seconds",a[l]=f+"Milliseconds",a)[p],b=p===v?this.$D+(h-this.$W):h;if(p===M||p===C){var D=this.clone().set(k,1);D.$d[c](b),D.init(),this.$d=D.set(k,Math.min(this.$D,D.daysInMonth())).$d}else c&&this.$d[c](b);return this.init(),this},x.set=function(w,h){return this.clone().$set(w,h)},x.get=function(w){return this[G.p(w)]()},x.add=function(w,h){var a,p=this;w=Number(w);var f=G.p(h),c=function(T){var I=V(p);return G.w(I.date(I.date()+Math.round(T*w)),p)};if(f===M)return this.set(M,this.$M+w);if(f===C)return this.set(C,this.$y+w);if(f===v)return c(1);if(f===_)return c(7);var b=(a={},a[i]=n,a[m]=s,a[d]=r,a)[f]||1,D=this.$d.getTime()+w*b;return G.w(D,this)},x.subtract=function(w,h){return this.add(-1*w,h)},x.format=function(w){var h=this,a=this.$locale();if(!this.isValid())return a.invalidDate||j;var p=w||"YYYY-MM-DDTHH:mm:ssZ",f=G.z(this),c=this.$H,b=this.$m,D=this.$M,T=a.weekdays,I=a.months,Q=a.meridiem,ne=function(se,ue,E,L){return se&&(se[ue]||se(h,p))||E[ue].slice(0,L)},te=function(se){return G.s(c%12||12,se,"0")},ae=Q||function(se,ue,E){var L=se<12?"AM":"PM";return E?L.toLowerCase():L};return p.replace(F,(function(se,ue){return ue||(function(E){switch(E){case"YY":return String(h.$y).slice(-2);case"YYYY":return G.s(h.$y,4,"0");case"M":return D+1;case"MM":return G.s(D+1,2,"0");case"MMM":return ne(a.monthsShort,D,I,3);case"MMMM":return ne(I,D);case"D":return h.$D;case"DD":return G.s(h.$D,2,"0");case"d":return String(h.$W);case"dd":return ne(a.weekdaysMin,h.$W,T,2);case"ddd":return ne(a.weekdaysShort,h.$W,T,3);case"dddd":return T[h.$W];case"H":return String(c);case"HH":return G.s(c,2,"0");case"h":return te(1);case"hh":return te(2);case"a":return ae(c,b,!0);case"A":return ae(c,b,!1);case"m":return String(b);case"mm":return G.s(b,2,"0");case"s":return String(h.$s);case"ss":return G.s(h.$s,2,"0");case"SSS":return G.s(h.$ms,3,"0");case"Z":return f}return null})(se)||f.replace(":","")}))},x.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},x.diff=function(w,h,a){var p,f=this,c=G.p(h),b=V(w),D=(b.utcOffset()-this.utcOffset())*n,T=this-b,I=function(){return G.m(f,b)};switch(c){case C:p=I()/12;break;case M:p=I();break;case S:p=I()/3;break;case _:p=(T-D)/6048e5;break;case v:p=(T-D)/864e5;break;case m:p=T/s;break;case i:p=T/n;break;case d:p=T/r;break;default:p=T}return a?p:G.a(p)},x.daysInMonth=function(){return this.endOf(M).$D},x.$locale=function(){return oe[this.$L]},x.locale=function(w,h){if(!w)return this.$L;var a=this.clone(),p=q(w,h,!0);return p&&(a.$L=p),a},x.clone=function(){return G.w(this.$d,this)},x.toDate=function(){return new Date(this.valueOf())},x.toJSON=function(){return this.isValid()?this.toISOString():null},x.toISOString=function(){return this.$d.toISOString()},x.toString=function(){return this.$d.toUTCString()},P})(),ee=ie.prototype;return V.prototype=ee,[["$ms",l],["$s",d],["$m",i],["$H",m],["$W",v],["$M",M],["$y",C],["$D",k]].forEach((function(P){ee[P[1]]=function(x){return this.$g(x,P[0],P[1])}})),V.extend=function(P,x){return P.$i||(P(x,ie,V),P.$i=!0),V},V.locale=q,V.isDayjs=X,V.unix=function(P){return V(1e3*P)},V.en=oe[re],V.Ls=oe,V.p={},V}))})(dr)),dr.exports}var Ol=Ml();const de=En(Ol);function jl({direction:t,levelIndex:e,rowIndex:r,cellIndex:n,size:s}){switch(t){case"up":return e===0&&r===0?null:r===0?{levelIndex:e-1,rowIndex:n<=s[e-1][s[e-1].length-1]-1?s[e-1].length-1:s[e-1].length-2,cellIndex:n}:{levelIndex:e,rowIndex:r-1,cellIndex:n};case"down":return r===s[e].length-1?{levelIndex:e+1,rowIndex:0,cellIndex:n}:r===s[e].length-2&&n>=s[e][s[e].length-1]?{levelIndex:e+1,rowIndex:0,cellIndex:n}:{levelIndex:e,rowIndex:r+1,cellIndex:n};case"left":return e===0&&r===0&&n===0?null:r===0&&n===0?{levelIndex:e-1,rowIndex:s[e-1].length-1,cellIndex:s[e-1][s[e-1].length-1]-1}:n===0?{levelIndex:e,rowIndex:r-1,cellIndex:s[e][r-1]-1}:{levelIndex:e,rowIndex:r,cellIndex:n-1};case"right":return r===s[e].length-1&&n===s[e][r]-1?{levelIndex:e+1,rowIndex:0,cellIndex:0}:n===s[e][r]-1?{levelIndex:e,rowIndex:r+1,cellIndex:0}:{levelIndex:e,rowIndex:r,cellIndex:n+1};default:return{levelIndex:e,rowIndex:r,cellIndex:n}}}function Ko({controlsRef:t,direction:e,levelIndex:r,rowIndex:n,cellIndex:s,size:l}){const d=jl({direction:e,size:l,rowIndex:n,cellIndex:s,levelIndex:r});if(!d)return;const i=t.current?.[d.levelIndex]?.[d.rowIndex]?.[d.cellIndex];i&&(i.disabled||i.getAttribute("data-hidden")||i.getAttribute("data-outside")?Ko({controlsRef:t,direction:e,levelIndex:d.levelIndex,cellIndex:d.cellIndex,rowIndex:d.rowIndex,size:l}):i.focus())}function Al(t){switch(t){case"ArrowDown":return"down";case"ArrowUp":return"up";case"ArrowRight":return"right";case"ArrowLeft":return"left";default:return null}}function El(t){return t.current?.map(e=>e.map(r=>r.length))}function un({controlsRef:t,levelIndex:e,rowIndex:r,cellIndex:n,event:s}){const l=Al(s.key);if(l){s.preventDefault();const d=El(t);Ko({controlsRef:t,direction:l,levelIndex:e,rowIndex:r,cellIndex:n,size:d})}}function qe(t){return t==null||t===""?t:de(t).format("YYYY-MM-DD")}function Zo(t){return t==null||t===""?t:de(t).format("YYYY-MM-DD HH:mm:ss")}const Tl={locale:"en",firstDayOfWeek:1,weekendDays:[0,6],labelSeparator:"–",consistentWeeks:!1},$l=J.createContext(Tl);function pt(){const t=J.useContext($l),e=J.useCallback(l=>l||t.locale,[t.locale]),r=J.useCallback(l=>typeof l=="number"?l:t.firstDayOfWeek,[t.firstDayOfWeek]),n=J.useCallback(l=>Array.isArray(l)?l:t.weekendDays,[t.weekendDays]),s=J.useCallback(l=>typeof l=="string"?l:t.labelSeparator,[t.labelSeparator]);return{...t,getLocale:e,getFirstDayOfWeek:r,getWeekendDays:n,getLabelSeparator:s}}function Rl({value:t,type:e,withTime:r}){const n=r?Zo:qe;if(e==="range"&&Array.isArray(t)){const s=n(t[0]),l=n(t[1]);return s?l?`${s} – ${l}`:`${s} –`:""}return e==="multiple"&&Array.isArray(t)?t.filter(Boolean).join(", "):!Array.isArray(t)&&t?n(t):""}function Jo({value:t,type:e,name:r,form:n,withTime:s=!1}){return y.jsx("input",{type:"hidden",value:Rl({value:t,type:e,withTime:s}),name:r,form:n})}Jo.displayName="@mantine/dates/HiddenDatesInput";function Xo(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(r=Xo(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function je(){for(var t,e,r=0,n="",s=arguments.length;r<s;r++)(t=arguments[r])&&(e=Xo(t))&&(n&&(n+=" "),n+=e);return n}var es={day:"m_396ce5cb"};const Nl=O.createVarsResolver((t,{size:e})=>({day:{"--day-size":O.getSize(e,"day-size")}})),cn=O.factory((t,e)=>{const r=O.useProps("Day",null,t),{classNames:n,className:s,style:l,styles:d,unstyled:i,vars:m,date:v,disabled:_,__staticSelector:M,weekend:S,outside:C,selected:k,renderDay:j,inRange:N,firstInRange:F,lastInRange:B,hidden:H,static:U,highlightToday:re,attributes:oe,...K}=r,X=O.useStyles({name:M||"Day",classes:es,props:r,className:s,style:l,classNames:n,styles:d,unstyled:i,attributes:oe,vars:m,varsResolver:Nl,rootSelector:"day"});return y.jsx(O.UnstyledButton,{...X("day",{style:H?{display:"none"}:void 0}),component:U?"div":"button",ref:e,disabled:_,"data-today":de(v).isSame(new Date,"day")||void 0,"data-hidden":H||void 0,"data-highlight-today":re||void 0,"data-disabled":_||void 0,"data-weekend":!_&&!C&&S||void 0,"data-outside":!_&&C||void 0,"data-selected":!_&&k||void 0,"data-in-range":N&&!_||void 0,"data-first-in-range":F&&!_||void 0,"data-last-in-range":B&&!_||void 0,"data-static":U||void 0,unstyled:i,...K,children:j?.(v)||de(v).date()})});cn.classes=es,cn.displayName="@mantine/dates/Day";function Ll({locale:t,format:e="dd",firstDayOfWeek:r=1}){const n=de().day(r),s=[];for(let l=0;l<7;l+=1)typeof e=="string"?s.push(de(n).add(l,"days").locale(t).format(e)):s.push(e(de(n).add(l,"days").format("YYYY-MM-DD")));return s}var ts={weekday:"m_18a3eca"};const Bl=O.createVarsResolver((t,{size:e})=>({weekdaysRow:{"--wr-fz":O.getFontSize(e),"--wr-spacing":O.getSpacing(e)}})),dn=O.factory((t,e)=>{const r=O.useProps("WeekdaysRow",null,t),{classNames:n,className:s,style:l,styles:d,unstyled:i,vars:m,locale:v,firstDayOfWeek:_,weekdayFormat:M,cellComponent:S="th",__staticSelector:C,withWeekNumbers:k,attributes:j,...N}=r,F=O.useStyles({name:C||"WeekdaysRow",classes:ts,props:r,className:s,style:l,classNames:n,styles:d,unstyled:i,attributes:j,vars:m,varsResolver:Bl,rootSelector:"weekdaysRow"}),B=pt(),H=Ll({locale:B.getLocale(v),format:M,firstDayOfWeek:B.getFirstDayOfWeek(_)}).map((U,re)=>y.jsx(S,{...F("weekday"),children:U},re));return y.jsxs(O.Box,{component:"tr",ref:e,...F("weekdaysRow"),...N,children:[k&&y.jsx(S,{...F("weekday"),children:"#"}),H]})});dn.classes=ts,dn.displayName="@mantine/dates/WeekdaysRow";function Il(t,e=1){let r=de(t);if(!r.isValid())return r;const n=e===0?6:e-1;for(;r.day()!==n;)r=r.add(1,"day");return r.format("YYYY-MM-DD")}function Yl(t,e=1){let r=de(t);for(;r.day()!==e;)r=r.subtract(1,"day");return r.format("YYYY-MM-DD")}function zl({month:t,firstDayOfWeek:e=1,consistentWeeks:r}){const n=de(t).subtract(de(t).date()-1,"day"),s=de(n.format("YYYY-M-D")),l=s.format("YYYY-MM-DD"),d=s.add(+s.daysInMonth()-1,"day").format("YYYY-MM-DD"),i=Il(d,e),m=[];let v=de(Yl(l,e));for(;de(v).isBefore(i,"day");){const _=[];for(let M=0;M<7;M+=1)_.push(v.format("YYYY-MM-DD")),v=v.add(1,"day");m.push(_)}if(r&&m.length<6){const _=m[m.length-1],M=_[_.length-1];let S=de(M).add(1,"day");for(;m.length<6;){const C=[];for(let k=0;k<7;k+=1)C.push(S.format("YYYY-MM-DD")),S=S.add(1,"day");m.push(C)}}return m}function hn(t,e){return de(t).format("YYYY-MM")===de(e).format("YYYY-MM")}function rs(t,e){return e?de(t).isAfter(de(e).subtract(1,"day"),"day"):!0}function ns(t,e){return e?de(t).isBefore(de(e).add(1,"day"),"day"):!0}function Fl({dates:t,minDate:e,maxDate:r,getDayProps:n,excludeDate:s,hideOutsideDates:l,month:d}){const i=t.flat().filter(_=>ns(_,r)&&rs(_,e)&&!s?.(_)&&!n?.(_)?.disabled&&(!l||hn(_,d))),m=i.find(_=>n?.(_)?.selected);if(m)return m;const v=i.find(_=>de().isSame(_,"date"));return v||i[0]}var hr={exports:{}},Wl=hr.exports,os;function Ul(){return os||(os=1,(function(t,e){(function(r,n){t.exports=n()})(Wl,(function(){var r="day";return function(n,s,l){var d=function(v){return v.add(4-v.isoWeekday(),r)},i=s.prototype;i.isoWeekYear=function(){return d(this).year()},i.isoWeek=function(v){if(!this.$utils().u(v))return this.add(7*(v-this.isoWeek()),r);var _,M,S,C,k=d(this),j=(_=this.isoWeekYear(),M=this.$u,S=(M?l.utc:l)().year(_).startOf("year"),C=4-S.isoWeekday(),S.isoWeekday()>4&&(C+=7),S.add(C,r));return k.diff(j,"week")+1},i.isoWeekday=function(v){return this.$utils().u(v)?this.day()||7:this.day(this.day()%7?v:v-7)};var m=i.startOf;i.startOf=function(v,_){var M=this.$utils(),S=!!M.u(_)||_;return M.p(v)==="isoweek"?S?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):m.bind(this)(v,_)}}}))})(hr)),hr.exports}var ql=Ul();const Vl=En(ql);de.extend(Vl);function Hl(t){const e=t.find(r=>de(r).day()===1);return de(e).isoWeek()}var ss={month:"m_cc9820d3",monthCell:"m_8f457cd5",weekNumber:"m_6cff9dea"};const Gl={withCellSpacing:!0},Ql=O.createVarsResolver((t,{size:e})=>({weekNumber:{"--wn-fz":O.getFontSize(e),"--wn-size":O.getSize(e,"wn-size")}})),fr=O.factory((t,e)=>{const r=O.useProps("Month",Gl,t),{classNames:n,className:s,style:l,styles:d,unstyled:i,vars:m,__staticSelector:v,locale:_,firstDayOfWeek:M,weekdayFormat:S,month:C,weekendDays:k,getDayProps:j,excludeDate:N,minDate:F,maxDate:B,renderDay:H,hideOutsideDates:U,hideWeekdays:re,getDayAriaLabel:oe,static:K,__getDayRef:X,__onDayKeyDown:q,__onDayClick:V,__onDayMouseEnter:G,__preventFocus:ie,__stopPropagation:ee,withCellSpacing:P,size:x,highlightToday:w,withWeekNumbers:h,attributes:a,...p}=r,f=O.useStyles({name:v||"Month",classes:ss,props:r,className:s,style:l,classNames:n,styles:d,unstyled:i,attributes:a,vars:m,varsResolver:Ql,rootSelector:"month"}),c=pt(),b=zl({month:C,firstDayOfWeek:c.getFirstDayOfWeek(M),consistentWeeks:c.consistentWeeks}),D=Fl({dates:b,minDate:qe(F),maxDate:qe(B),getDayProps:j,excludeDate:N,hideOutsideDates:U,month:C}),{resolvedClassNames:T,resolvedStyles:I}=O.useResolvedStylesApi({classNames:n,styles:d,props:r}),Q=b.map((ne,te)=>{const ae=ne.map((se,ue)=>{const E=!hn(se,C),L=oe?.(se)||de(se).locale(_||c.locale).format("D MMMM YYYY"),$=j?.(se),z=de(se).isSame(D,"date");return y.jsx("td",{...f("monthCell"),"data-with-spacing":P||void 0,children:y.jsx(cn,{__staticSelector:v||"Month",classNames:T,styles:I,unstyled:i,"data-mantine-stop-propagation":ee||void 0,highlightToday:w,renderDay:H,date:se,size:x,weekend:c.getWeekendDays(k).includes(de(se).get("day")),outside:E,hidden:U?E:!1,"aria-label":L,static:K,disabled:N?.(se)||!ns(se,qe(B))||!rs(se,qe(F)),ref:Y=>{Y&&X?.(te,ue,Y)},...$,onKeyDown:Y=>{$?.onKeyDown?.(Y),q?.(Y,{rowIndex:te,cellIndex:ue,date:se})},onMouseEnter:Y=>{$?.onMouseEnter?.(Y),G?.(Y,se)},onClick:Y=>{$?.onClick?.(Y),V?.(Y,se)},onMouseDown:Y=>{$?.onMouseDown?.(Y),ie&&Y.preventDefault()},tabIndex:ie||!z?-1:0})},se.toString())});return y.jsxs("tr",{...f("monthRow"),children:[h&&y.jsx("td",{...f("weekNumber"),children:Hl(ne)}),ae]},te)});return y.jsxs(O.Box,{component:"table",...f("month"),size:x,ref:e,...p,children:[!re&&y.jsx("thead",{...f("monthThead"),children:y.jsx(dn,{__staticSelector:v||"Month",locale:_,firstDayOfWeek:M,weekdayFormat:S,size:x,classNames:T,styles:I,unstyled:i,withWeekNumbers:h})}),y.jsx("tbody",{...f("monthTbody"),children:Q})]})});fr.classes=ss,fr.displayName="@mantine/dates/Month";var is={pickerControl:"m_dc6a3c71"};const Kl=O.createVarsResolver((t,{size:e})=>({pickerControl:{"--dpc-fz":O.getFontSize(e),"--dpc-size":O.getSize(e,"dpc-size")}})),pr=O.factory((t,e)=>{const r=O.useProps("PickerControl",null,t),{classNames:n,className:s,style:l,styles:d,unstyled:i,vars:m,firstInRange:v,lastInRange:_,inRange:M,__staticSelector:S,selected:C,disabled:k,attributes:j,...N}=r,F=O.useStyles({name:S||"PickerControl",classes:is,props:r,className:s,style:l,classNames:n,styles:d,unstyled:i,attributes:j,vars:m,varsResolver:Kl,rootSelector:"pickerControl"});return y.jsx(O.UnstyledButton,{...F("pickerControl"),ref:e,unstyled:i,"data-picker-control":!0,"data-selected":C&&!k||void 0,"data-disabled":k||void 0,"data-in-range":M&&!k&&!C||void 0,"data-first-in-range":v&&!k||void 0,"data-last-in-range":_&&!k||void 0,disabled:k,...N})});pr.classes=is,pr.displayName="@mantine/dates/PickerControl";function as({year:t,minDate:e,maxDate:r}){return!e&&!r?!1:!!(e&&de(t).isBefore(e,"year")||r&&de(t).isAfter(r,"year"))}function Zl({years:t,minDate:e,maxDate:r,getYearControlProps:n}){const s=t.flat().filter(i=>!as({year:i,minDate:e,maxDate:r})&&!n?.(i)?.disabled),l=s.find(i=>n?.(i)?.selected);if(l)return l;const d=s.find(i=>de().isSame(i,"year"));return d||s[0]}function ls(t){const e=de(t).year(),r=e-e%10;let n=0;const s=[[],[],[],[]];for(let l=0;l<4;l+=1){const d=l===3?1:3;for(let i=0;i<d;i+=1)s[l].push(de(new Date(r+n,0)).format("YYYY-MM-DD")),n+=1}return s}var us={yearsList:"m_9206547b",yearsListCell:"m_c5a19c7d"};const Jl={yearsListFormat:"YYYY",withCellSpacing:!0},gr=O.factory((t,e)=>{const r=O.useProps("YearsList",Jl,t),{classNames:n,className:s,style:l,styles:d,unstyled:i,vars:m,decade:v,yearsListFormat:_,locale:M,minDate:S,maxDate:C,getYearControlProps:k,__staticSelector:j,__getControlRef:N,__onControlKeyDown:F,__onControlClick:B,__onControlMouseEnter:H,__preventFocus:U,__stopPropagation:re,withCellSpacing:oe,size:K,attributes:X,...q}=r,V=O.useStyles({name:j||"YearsList",classes:us,props:r,className:s,style:l,classNames:n,styles:d,unstyled:i,attributes:X,vars:m,rootSelector:"yearsList"}),G=pt(),ie=ls(v),ee=Zl({years:ie,minDate:S,maxDate:C,getYearControlProps:k}),P=ie.map((x,w)=>{const h=x.map((a,p)=>{const f=k?.(a),c=de(a).isSame(ee,"year");return y.jsx("td",{...V("yearsListCell"),"data-with-spacing":oe||void 0,children:y.jsx(pr,{...V("yearsListControl"),size:K,unstyled:i,"data-mantine-stop-propagation":re||void 0,disabled:as({year:a,minDate:S,maxDate:C}),ref:b=>{b&&N?.(w,p,b)},...f,onKeyDown:b=>{f?.onKeyDown?.(b),F?.(b,{rowIndex:w,cellIndex:p,date:a})},onClick:b=>{f?.onClick?.(b),B?.(b,a)},onMouseEnter:b=>{f?.onMouseEnter?.(b),H?.(b,a)},onMouseDown:b=>{f?.onMouseDown?.(b),U&&b.preventDefault()},tabIndex:U||!c?-1:0,children:de(a).locale(G.getLocale(M)).format(_)})},p)});return y.jsx("tr",{...V("yearsListRow"),children:h},w)});return y.jsx(O.Box,{component:"table",ref:e,size:K,...V("yearsList"),...q,children:y.jsx("tbody",{children:P})})});gr.classes=us,gr.displayName="@mantine/dates/YearsList";function cs({month:t,minDate:e,maxDate:r}){return!e&&!r?!1:!!(e&&de(t).isBefore(e,"month")||r&&de(t).isAfter(r,"month"))}function Xl({months:t,minDate:e,maxDate:r,getMonthControlProps:n}){const s=t.flat().filter(i=>!cs({month:i,minDate:e,maxDate:r})&&!n?.(i)?.disabled),l=s.find(i=>n?.(i)?.selected);if(l)return l;const d=s.find(i=>de().isSame(i,"month"));return d||s[0]}function eu(t){const e=de(t).startOf("year").toDate(),r=[[],[],[],[]];let n=0;for(let s=0;s<4;s+=1)for(let l=0;l<3;l+=1)r[s].push(de(e).add(n,"months").format("YYYY-MM-DD")),n+=1;return r}var ds={monthsList:"m_2a6c32d",monthsListCell:"m_fe27622f"};const tu={monthsListFormat:"MMM",withCellSpacing:!0},mr=O.factory((t,e)=>{const r=O.useProps("MonthsList",tu,t),{classNames:n,className:s,style:l,styles:d,unstyled:i,vars:m,__staticSelector:v,year:_,monthsListFormat:M,locale:S,minDate:C,maxDate:k,getMonthControlProps:j,__getControlRef:N,__onControlKeyDown:F,__onControlClick:B,__onControlMouseEnter:H,__preventFocus:U,__stopPropagation:re,withCellSpacing:oe,size:K,attributes:X,...q}=r,V=O.useStyles({name:v||"MonthsList",classes:ds,props:r,className:s,style:l,classNames:n,styles:d,unstyled:i,attributes:X,vars:m,rootSelector:"monthsList"}),G=pt(),ie=eu(_),ee=Xl({months:ie,minDate:qe(C),maxDate:qe(k),getMonthControlProps:j}),P=ie.map((x,w)=>{const h=x.map((a,p)=>{const f=j?.(a),c=de(a).isSame(ee,"month");return y.jsx("td",{...V("monthsListCell"),"data-with-spacing":oe||void 0,children:y.jsx(pr,{...V("monthsListControl"),size:K,unstyled:i,__staticSelector:v||"MonthsList","data-mantine-stop-propagation":re||void 0,disabled:cs({month:a,minDate:qe(C),maxDate:qe(k)}),ref:b=>{b&&N?.(w,p,b)},...f,onKeyDown:b=>{f?.onKeyDown?.(b),F?.(b,{rowIndex:w,cellIndex:p,date:a})},onClick:b=>{f?.onClick?.(b),B?.(b,a)},onMouseEnter:b=>{f?.onMouseEnter?.(b),H?.(b,a)},onMouseDown:b=>{f?.onMouseDown?.(b),U&&b.preventDefault()},tabIndex:U||!c?-1:0,children:de(a).locale(G.getLocale(S)).format(M)})},p)});return y.jsx("tr",{...V("monthsListRow"),children:h},w)});return y.jsx(O.Box,{component:"table",ref:e,size:K,...V("monthsList"),...q,children:y.jsx("tbody",{children:P})})});mr.classes=ds,mr.displayName="@mantine/dates/MonthsList";var hs={calendarHeader:"m_730a79ed",calendarHeaderLevel:"m_f6645d97",calendarHeaderControl:"m_2351eeb0",calendarHeaderControlIcon:"m_367dc749"};const ru={hasNextLevel:!0,withNext:!0,withPrevious:!0,headerControlsOrder:["previous","level","next"]},nu=O.createVarsResolver((t,{size:e})=>({calendarHeader:{"--dch-control-size":O.getSize(e,"dch-control-size"),"--dch-fz":O.getFontSize(e)}})),gt=O.factory((t,e)=>{const r=O.useProps("CalendarHeader",ru,t),{classNames:n,className:s,style:l,styles:d,unstyled:i,vars:m,nextIcon:v,previousIcon:_,nextLabel:M,previousLabel:S,onNext:C,onPrevious:k,onLevelClick:j,label:N,nextDisabled:F,previousDisabled:B,hasNextLevel:H,levelControlAriaLabel:U,withNext:re,withPrevious:oe,headerControlsOrder:K,__staticSelector:X,__preventFocus:q,__stopPropagation:V,attributes:G,...ie}=r,ee=O.useStyles({name:X||"CalendarHeader",classes:hs,props:r,className:s,style:l,classNames:n,styles:d,unstyled:i,attributes:G,vars:m,varsResolver:nu,rootSelector:"calendarHeader"}),P=q?p=>p.preventDefault():void 0,x=oe&&J.createElement(O.UnstyledButton,{...ee("calendarHeaderControl"),key:"previous","data-direction":"previous","aria-label":S,onClick:k,unstyled:i,onMouseDown:P,disabled:B,"data-disabled":B||void 0,tabIndex:q||B?-1:0,"data-mantine-stop-propagation":V||void 0},_||y.jsx(O.AccordionChevron,{...ee("calendarHeaderControlIcon"),"data-direction":"previous",size:"45%"})),w=J.createElement(O.UnstyledButton,{component:H?"button":"div",...ee("calendarHeaderLevel"),key:"level",onClick:H?j:void 0,unstyled:i,onMouseDown:H?P:void 0,disabled:!H,"data-static":!H||void 0,"aria-label":U,tabIndex:q||!H?-1:0,"data-mantine-stop-propagation":V||void 0},N),h=re&&J.createElement(O.UnstyledButton,{...ee("calendarHeaderControl"),key:"next","data-direction":"next","aria-label":M,onClick:C,unstyled:i,onMouseDown:P,disabled:F,"data-disabled":F||void 0,tabIndex:q||F?-1:0,"data-mantine-stop-propagation":V||void 0},v||y.jsx(O.AccordionChevron,{...ee("calendarHeaderControlIcon"),"data-direction":"next",size:"45%"})),a=K.map(p=>p==="previous"?x:p==="level"?w:p==="next"?h:null);return y.jsx(O.Box,{...ee("calendarHeader"),ref:e,...ie,children:a})});gt.classes=hs,gt.displayName="@mantine/dates/CalendarHeader";function ou(t){const e=ls(t);return[e[0][0],e[3][0]]}const su={decadeLabelFormat:"YYYY"},yr=O.factory((t,e)=>{const r=O.useProps("DecadeLevel",su,t),{decade:n,locale:s,minDate:l,maxDate:d,yearsListFormat:i,getYearControlProps:m,__getControlRef:v,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:S,withCellSpacing:C,__preventFocus:k,nextIcon:j,previousIcon:N,nextLabel:F,previousLabel:B,onNext:H,onPrevious:U,nextDisabled:re,previousDisabled:oe,levelControlAriaLabel:K,withNext:X,withPrevious:q,headerControlsOrder:V,decadeLabelFormat:G,classNames:ie,styles:ee,unstyled:P,__staticSelector:x,__stopPropagation:w,size:h,attributes:a,...p}=r,f=pt(),[c,b]=ou(n),D={__staticSelector:x||"DecadeLevel",classNames:ie,styles:ee,unstyled:P,size:h,attributes:a},T=typeof re=="boolean"?re:d?!de(b).endOf("year").isBefore(d):!1,I=typeof oe=="boolean"?oe:l?!de(c).startOf("year").isAfter(l):!1,Q=(ne,te)=>de(ne).locale(s||f.locale).format(te);return y.jsxs(O.Box,{"data-decade-level":!0,size:h,ref:e,...p,children:[y.jsx(gt,{label:typeof G=="function"?G(c,b):`${Q(c,G)} – ${Q(b,G)}`,__preventFocus:k,__stopPropagation:w,nextIcon:j,previousIcon:N,nextLabel:F,previousLabel:B,onNext:H,onPrevious:U,nextDisabled:T,previousDisabled:I,hasNextLevel:!1,levelControlAriaLabel:K,withNext:X,withPrevious:q,headerControlsOrder:V,...D}),y.jsx(gr,{decade:n,locale:s,minDate:l,maxDate:d,yearsListFormat:i,getYearControlProps:m,__getControlRef:v,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:S,__preventFocus:k,__stopPropagation:w,withCellSpacing:C,...D})]})});yr.classes={...gr.classes,...gt.classes},yr.displayName="@mantine/dates/DecadeLevel";const iu={yearLabelFormat:"YYYY"},vr=O.factory((t,e)=>{const r=O.useProps("YearLevel",iu,t),{year:n,locale:s,minDate:l,maxDate:d,monthsListFormat:i,getMonthControlProps:m,__getControlRef:v,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:S,withCellSpacing:C,__preventFocus:k,nextIcon:j,previousIcon:N,nextLabel:F,previousLabel:B,onNext:H,onPrevious:U,onLevelClick:re,nextDisabled:oe,previousDisabled:K,hasNextLevel:X,levelControlAriaLabel:q,withNext:V,withPrevious:G,headerControlsOrder:ie,yearLabelFormat:ee,__staticSelector:P,__stopPropagation:x,size:w,classNames:h,styles:a,unstyled:p,attributes:f,...c}=r,b=pt(),D={__staticSelector:P||"YearLevel",classNames:h,styles:a,unstyled:p,size:w,attributes:f},T=typeof oe=="boolean"?oe:d?!de(n).endOf("year").isBefore(d):!1,I=typeof K=="boolean"?K:l?!de(n).startOf("year").isAfter(l):!1;return y.jsxs(O.Box,{"data-year-level":!0,size:w,ref:e,...c,children:[y.jsx(gt,{label:typeof ee=="function"?ee(n):de(n).locale(s||b.locale).format(ee),__preventFocus:k,__stopPropagation:x,nextIcon:j,previousIcon:N,nextLabel:F,previousLabel:B,onNext:H,onPrevious:U,onLevelClick:re,nextDisabled:T,previousDisabled:I,hasNextLevel:X,levelControlAriaLabel:q,withNext:V,withPrevious:G,headerControlsOrder:ie,...D}),y.jsx(mr,{year:n,locale:s,minDate:l,maxDate:d,monthsListFormat:i,getMonthControlProps:m,__getControlRef:v,__onControlKeyDown:_,__onControlClick:M,__onControlMouseEnter:S,__preventFocus:k,__stopPropagation:x,withCellSpacing:C,...D})]})});vr.classes={...gt.classes,...mr.classes},vr.displayName="@mantine/dates/YearLevel";const au={monthLabelFormat:"MMMM YYYY"},br=O.factory((t,e)=>{const r=O.useProps("MonthLevel",au,t),{month:n,locale:s,firstDayOfWeek:l,weekdayFormat:d,weekendDays:i,getDayProps:m,excludeDate:v,minDate:_,maxDate:M,renderDay:S,hideOutsideDates:C,hideWeekdays:k,getDayAriaLabel:j,__getDayRef:N,__onDayKeyDown:F,__onDayClick:B,__onDayMouseEnter:H,withCellSpacing:U,highlightToday:re,withWeekNumbers:oe,__preventFocus:K,__stopPropagation:X,nextIcon:q,previousIcon:V,nextLabel:G,previousLabel:ie,onNext:ee,onPrevious:P,onLevelClick:x,nextDisabled:w,previousDisabled:h,hasNextLevel:a,levelControlAriaLabel:p,withNext:f,withPrevious:c,headerControlsOrder:b,monthLabelFormat:D,classNames:T,styles:I,unstyled:Q,__staticSelector:ne,size:te,static:ae,attributes:se,...ue}=r,E=pt(),L={__staticSelector:ne||"MonthLevel",classNames:T,styles:I,unstyled:Q,size:te,attributes:se},$=typeof w=="boolean"?w:M?!de(n).endOf("month").isBefore(M):!1,z=typeof h=="boolean"?h:_?!de(n).startOf("month").isAfter(_):!1;return y.jsxs(O.Box,{"data-month-level":!0,size:te,ref:e,...ue,children:[y.jsx(gt,{label:typeof D=="function"?D(n):de(n).locale(s||E.locale).format(D),__preventFocus:K,__stopPropagation:X,nextIcon:q,previousIcon:V,nextLabel:G,previousLabel:ie,onNext:ee,onPrevious:P,onLevelClick:x,nextDisabled:$,previousDisabled:z,hasNextLevel:a,levelControlAriaLabel:p,withNext:f,withPrevious:c,headerControlsOrder:b,...L}),y.jsx(fr,{month:n,locale:s,firstDayOfWeek:l,weekdayFormat:d,weekendDays:i,getDayProps:m,excludeDate:v,minDate:_,maxDate:M,renderDay:S,hideOutsideDates:C,hideWeekdays:k,getDayAriaLabel:j,__getDayRef:N,__onDayKeyDown:F,__onDayClick:B,__onDayMouseEnter:H,__preventFocus:K,__stopPropagation:X,static:ae,withCellSpacing:U,highlightToday:re,withWeekNumbers:oe,...L})]})});br.classes={...fr.classes,...gt.classes},br.displayName="@mantine/dates/MonthLevel";var fs={levelsGroup:"m_30b26e33"};const mt=O.factory((t,e)=>{const r=O.useProps("LevelsGroup",null,t),{classNames:n,className:s,style:l,styles:d,unstyled:i,vars:m,__staticSelector:v,attributes:_,...M}=r,S=O.useStyles({name:v||"LevelsGroup",classes:fs,props:r,className:s,style:l,classNames:n,styles:d,unstyled:i,attributes:_,vars:m,rootSelector:"levelsGroup"});return y.jsx(O.Box,{ref:e,...S("levelsGroup"),...M})});mt.classes=fs,mt.displayName="@mantine/dates/LevelsGroup";const lu={numberOfColumns:1},wr=O.factory((t,e)=>{const r=O.useProps("DecadeLevelGroup",lu,t),{decade:n,locale:s,minDate:l,maxDate:d,yearsListFormat:i,getYearControlProps:m,__onControlClick:v,__onControlMouseEnter:_,withCellSpacing:M,__preventFocus:S,nextIcon:C,previousIcon:k,nextLabel:j,previousLabel:N,onNext:F,onPrevious:B,nextDisabled:H,previousDisabled:U,headerControlsOrder:re,classNames:oe,styles:K,unstyled:X,__staticSelector:q,__stopPropagation:V,numberOfColumns:G,levelControlAriaLabel:ie,decadeLabelFormat:ee,size:P,vars:x,attributes:w,...h}=r,a=J.useRef([]),p=Array(G).fill(0).map((f,c)=>{const b=de(n).add(c*10,"years").format("YYYY-MM-DD");return y.jsx(yr,{size:P,yearsListFormat:i,decade:b,withNext:c===G-1,withPrevious:c===0,decadeLabelFormat:ee,__onControlClick:v,__onControlMouseEnter:_,__onControlKeyDown:(D,T)=>un({levelIndex:c,rowIndex:T.rowIndex,cellIndex:T.cellIndex,event:D,controlsRef:a}),__getControlRef:(D,T,I)=>{Array.isArray(a.current[c])||(a.current[c]=[]),Array.isArray(a.current[c][D])||(a.current[c][D]=[]),a.current[c][D][T]=I},levelControlAriaLabel:typeof ie=="function"?ie(b):ie,locale:s,minDate:l,maxDate:d,__preventFocus:S,__stopPropagation:V,nextIcon:C,previousIcon:k,nextLabel:j,previousLabel:N,onNext:F,onPrevious:B,nextDisabled:H,previousDisabled:U,getYearControlProps:m,__staticSelector:q||"DecadeLevelGroup",classNames:oe,styles:K,unstyled:X,withCellSpacing:M,headerControlsOrder:re,attributes:w},c)});return y.jsx(mt,{classNames:oe,styles:K,__staticSelector:q||"DecadeLevelGroup",ref:e,size:P,unstyled:X,attributes:w,...h,children:p})});wr.classes={...mt.classes,...yr.classes},wr.displayName="@mantine/dates/DecadeLevelGroup";const uu={numberOfColumns:1},_r=O.factory((t,e)=>{const r=O.useProps("YearLevelGroup",uu,t),{year:n,locale:s,minDate:l,maxDate:d,monthsListFormat:i,getMonthControlProps:m,__onControlClick:v,__onControlMouseEnter:_,withCellSpacing:M,__preventFocus:S,nextIcon:C,previousIcon:k,nextLabel:j,previousLabel:N,onNext:F,onPrevious:B,onLevelClick:H,nextDisabled:U,previousDisabled:re,hasNextLevel:oe,headerControlsOrder:K,classNames:X,styles:q,unstyled:V,__staticSelector:G,__stopPropagation:ie,numberOfColumns:ee,levelControlAriaLabel:P,yearLabelFormat:x,size:w,vars:h,attributes:a,...p}=r,f=J.useRef([]),c=Array(ee).fill(0).map((b,D)=>{const T=de(n).add(D,"years").format("YYYY-MM-DD");return y.jsx(vr,{size:w,monthsListFormat:i,year:T,withNext:D===ee-1,withPrevious:D===0,yearLabelFormat:x,__stopPropagation:ie,__onControlClick:v,__onControlMouseEnter:_,__onControlKeyDown:(I,Q)=>un({levelIndex:D,rowIndex:Q.rowIndex,cellIndex:Q.cellIndex,event:I,controlsRef:f}),__getControlRef:(I,Q,ne)=>{Array.isArray(f.current[D])||(f.current[D]=[]),Array.isArray(f.current[D][I])||(f.current[D][I]=[]),f.current[D][I][Q]=ne},levelControlAriaLabel:typeof P=="function"?P(T):P,locale:s,minDate:l,maxDate:d,__preventFocus:S,nextIcon:C,previousIcon:k,nextLabel:j,previousLabel:N,onNext:F,onPrevious:B,onLevelClick:H,nextDisabled:U,previousDisabled:re,hasNextLevel:oe,getMonthControlProps:m,classNames:X,styles:q,unstyled:V,__staticSelector:G||"YearLevelGroup",withCellSpacing:M,headerControlsOrder:K,attributes:a},D)});return y.jsx(mt,{classNames:X,styles:q,__staticSelector:G||"YearLevelGroup",ref:e,size:w,unstyled:V,attributes:a,...p,children:c})});_r.classes={...vr.classes,...mt.classes},_r.displayName="@mantine/dates/YearLevelGroup";const cu={numberOfColumns:1},xr=O.factory((t,e)=>{const r=O.useProps("MonthLevelGroup",cu,t),{month:n,locale:s,firstDayOfWeek:l,weekdayFormat:d,weekendDays:i,getDayProps:m,excludeDate:v,minDate:_,maxDate:M,renderDay:S,hideOutsideDates:C,hideWeekdays:k,getDayAriaLabel:j,__onDayClick:N,__onDayMouseEnter:F,withCellSpacing:B,highlightToday:H,withWeekNumbers:U,__preventFocus:re,nextIcon:oe,previousIcon:K,nextLabel:X,previousLabel:q,onNext:V,onPrevious:G,onLevelClick:ie,nextDisabled:ee,previousDisabled:P,hasNextLevel:x,headerControlsOrder:w,classNames:h,styles:a,unstyled:p,numberOfColumns:f,levelControlAriaLabel:c,monthLabelFormat:b,__staticSelector:D,__stopPropagation:T,size:I,static:Q,vars:ne,attributes:te,...ae}=r,se=J.useRef([]),ue=Array(f).fill(0).map((E,L)=>{const $=de(n).add(L,"months").format("YYYY-MM-DD");return y.jsx(br,{month:$,withNext:L===f-1,withPrevious:L===0,monthLabelFormat:b,__stopPropagation:T,__onDayClick:N,__onDayMouseEnter:F,__onDayKeyDown:(z,Y)=>un({levelIndex:L,rowIndex:Y.rowIndex,cellIndex:Y.cellIndex,event:z,controlsRef:se}),__getDayRef:(z,Y,ce)=>{Array.isArray(se.current[L])||(se.current[L]=[]),Array.isArray(se.current[L][z])||(se.current[L][z]=[]),se.current[L][z][Y]=ce},levelControlAriaLabel:typeof c=="function"?c($):c,locale:s,firstDayOfWeek:l,weekdayFormat:d,weekendDays:i,getDayProps:m,excludeDate:v,minDate:_,maxDate:M,renderDay:S,hideOutsideDates:C,hideWeekdays:k,getDayAriaLabel:j,__preventFocus:re,nextIcon:oe,previousIcon:K,nextLabel:X,previousLabel:q,onNext:V,onPrevious:G,onLevelClick:ie,nextDisabled:ee,previousDisabled:P,hasNextLevel:x,classNames:h,styles:a,unstyled:p,__staticSelector:D||"MonthLevelGroup",size:I,static:Q,withCellSpacing:B,highlightToday:H,withWeekNumbers:U,headerControlsOrder:w,attributes:te},L)});return y.jsx(mt,{classNames:h,styles:a,__staticSelector:D||"MonthLevelGroup",ref:e,size:I,attributes:te,...ae,children:ue})});xr.classes={...mt.classes,...br.classes},xr.displayName="@mantine/dates/MonthLevelGroup";const ps=t=>t==="range"?[null,null]:t==="multiple"?[]:null,gs=(t,e)=>{const r=e?Zo:qe;return Array.isArray(t)?t.map(r):r(t)};function fn({type:t,value:e,defaultValue:r,onChange:n,withTime:s=!1}){const l=J.useRef(t),[d,i,m]=Le.useUncontrolled({value:gs(e,s),defaultValue:gs(r,s),finalValue:ps(t),onChange:n});let v=d;return l.current!==t&&(l.current=t,e===void 0&&(v=r!==void 0?r:ps(t),i(v))),[v,i,m]}function pn(t,e){return t?t==="month"?0:t==="year"?1:2:e||0}function du(t){return t===0?"month":t===1?"year":"decade"}function Gt(t,e,r){return du(Le.clamp(pn(t,0),pn(e,0),pn(r,2)))}const hu={maxLevel:"decade",minLevel:"month",__updateDateOnYearSelect:!0,__updateDateOnMonthSelect:!0,enableKeyboardNavigation:!0},Cr=O.factory((t,e)=>{const r=O.useProps("Calendar",hu,t),{vars:n,maxLevel:s,minLevel:l,defaultLevel:d,level:i,onLevelChange:m,date:v,defaultDate:_,onDateChange:M,numberOfColumns:S,columnsToScroll:C,ariaLabels:k,nextLabel:j,previousLabel:N,onYearSelect:F,onMonthSelect:B,onYearMouseEnter:H,onMonthMouseEnter:U,headerControlsOrder:re,__updateDateOnYearSelect:oe,__updateDateOnMonthSelect:K,__setDateRef:X,__setLevelRef:q,firstDayOfWeek:V,weekdayFormat:G,weekendDays:ie,getDayProps:ee,excludeDate:P,renderDay:x,hideOutsideDates:w,hideWeekdays:h,getDayAriaLabel:a,monthLabelFormat:p,nextIcon:f,previousIcon:c,__onDayClick:b,__onDayMouseEnter:D,withCellSpacing:T,highlightToday:I,withWeekNumbers:Q,monthsListFormat:ne,getMonthControlProps:te,yearLabelFormat:ae,yearsListFormat:se,getYearControlProps:ue,decadeLabelFormat:E,classNames:L,styles:$,unstyled:z,minDate:Y,maxDate:ce,locale:o,__staticSelector:u,size:g,__preventFocus:A,__stopPropagation:R,onNextDecade:W,onPreviousDecade:le,onNextYear:he,onPreviousYear:pe,onNextMonth:Z,onPreviousMonth:fe,static:me,enableKeyboardNavigation:ge,attributes:Se,...xe}=r,{resolvedClassNames:Pe,resolvedStyles:Ve}=O.useResolvedStylesApi({classNames:L,styles:$,props:r}),[Ne,Me]=Le.useUncontrolled({value:i?Gt(i,l,s):void 0,defaultValue:d?Gt(d,l,s):void 0,finalValue:Gt(void 0,l,s),onChange:m}),[Ct,Te]=fn({type:"default",value:qe(v),defaultValue:qe(_),onChange:M});J.useImperativeHandle(X,()=>ve=>{Te(ve)}),J.useImperativeHandle(q,()=>ve=>{Me(ve)});const rt={__staticSelector:u||"Calendar",styles:Ve,classNames:Pe,unstyled:z,size:g,attributes:Se},Ye=C||S||1,et=new Date,nt=Y&&de(et).isAfter(Y)?Y:de(et).format("YYYY-MM-DD"),$e=Ct||nt,ot=()=>{const ve=de($e).add(Ye,"month").format("YYYY-MM-DD");Z?.(ve),Te(ve)},st=()=>{const ve=de($e).subtract(Ye,"month").format("YYYY-MM-DD");fe?.(ve),Te(ve)},He=()=>{const ve=de($e).add(Ye,"year").format("YYYY-MM-DD");he?.(ve),Te(ve)},Ge=()=>{const ve=de($e).subtract(Ye,"year").format("YYYY-MM-DD");pe?.(ve),Te(ve)},Qe=()=>{const ve=de($e).add(10*Ye,"year").format("YYYY-MM-DD");W?.(ve),Te(ve)},it=()=>{const ve=de($e).subtract(10*Ye,"year").format("YYYY-MM-DD");le?.(ve),Te(ve)},yt=J.useRef(null);J.useEffect(()=>{if(!ge||me)return;const ve=Oe=>{if(!yt.current?.contains(document.activeElement))return;const tt=Oe.ctrlKey||Oe.metaKey,vt=Oe.shiftKey;switch(Oe.key){case"ArrowUp":tt&&vt?(Oe.preventDefault(),it()):tt&&(Oe.preventDefault(),Ge());break;case"ArrowDown":tt&&vt?(Oe.preventDefault(),Qe()):tt&&(Oe.preventDefault(),He());break;case"y":case"Y":Ne==="month"&&(Oe.preventDefault(),Me("year"));break}};return document.addEventListener("keydown",ve),()=>{document.removeEventListener("keydown",ve)}},[ge,me,Ne,He,Ge,Qe,it]);const at=ve=>{yt.current=ve,typeof e=="function"?e(ve):e&&(e.current=ve)};return y.jsxs(O.Box,{ref:at,size:g,"data-calendar":!0,...xe,children:[Ne==="month"&&y.jsx(xr,{month:$e,minDate:Y,maxDate:ce,firstDayOfWeek:V,weekdayFormat:G,weekendDays:ie,getDayProps:ee,excludeDate:P,renderDay:x,hideOutsideDates:w,hideWeekdays:h,getDayAriaLabel:a,onNext:ot,onPrevious:st,hasNextLevel:s!=="month",onLevelClick:()=>Me("year"),numberOfColumns:S,locale:o,levelControlAriaLabel:k?.monthLevelControl,nextLabel:k?.nextMonth??j,nextIcon:f,previousLabel:k?.previousMonth??N,previousIcon:c,monthLabelFormat:p,__onDayClick:b,__onDayMouseEnter:D,__preventFocus:A,__stopPropagation:R,static:me,withCellSpacing:T,highlightToday:I,withWeekNumbers:Q,headerControlsOrder:re,...rt}),Ne==="year"&&y.jsx(_r,{year:$e,numberOfColumns:S,minDate:Y,maxDate:ce,monthsListFormat:ne,getMonthControlProps:te,locale:o,onNext:He,onPrevious:Ge,hasNextLevel:s!=="month"&&s!=="year",onLevelClick:()=>Me("decade"),levelControlAriaLabel:k?.yearLevelControl,nextLabel:k?.nextYear??j,nextIcon:f,previousLabel:k?.previousYear??N,previousIcon:c,yearLabelFormat:ae,__onControlMouseEnter:U,__onControlClick:(ve,Oe)=>{K&&Te(Oe),Me(Gt("month",l,s)),B?.(Oe)},__preventFocus:A,__stopPropagation:R,withCellSpacing:T,headerControlsOrder:re,...rt}),Ne==="decade"&&y.jsx(wr,{decade:$e,minDate:Y,maxDate:ce,yearsListFormat:se,getYearControlProps:ue,locale:o,onNext:Qe,onPrevious:it,numberOfColumns:S,nextLabel:k?.nextDecade??j,nextIcon:f,previousLabel:k?.previousDecade??N,previousIcon:c,decadeLabelFormat:E,__onControlMouseEnter:H,__onControlClick:(ve,Oe)=>{oe&&Te(Oe),Me(Gt("year",l,s)),F?.(Oe)},__preventFocus:A,__stopPropagation:R,withCellSpacing:T,headerControlsOrder:re,...rt})]})});Cr.classes={...wr.classes,..._r.classes,...xr.classes},Cr.displayName="@mantine/dates/Calendar";function fu(t){const{maxLevel:e,minLevel:r,defaultLevel:n,level:s,onLevelChange:l,nextIcon:d,previousIcon:i,date:m,defaultDate:v,onDateChange:_,numberOfColumns:M,columnsToScroll:S,ariaLabels:C,nextLabel:k,previousLabel:j,onYearSelect:N,onMonthSelect:F,onYearMouseEnter:B,onMonthMouseEnter:H,onNextMonth:U,onPreviousMonth:re,onNextYear:oe,onPreviousYear:K,onNextDecade:X,onPreviousDecade:q,withCellSpacing:V,highlightToday:G,__updateDateOnYearSelect:ie,__updateDateOnMonthSelect:ee,__setDateRef:P,__setLevelRef:x,withWeekNumbers:w,headerControlsOrder:h,firstDayOfWeek:a,weekdayFormat:p,weekendDays:f,getDayProps:c,excludeDate:b,renderDay:D,hideOutsideDates:T,hideWeekdays:I,getDayAriaLabel:Q,monthLabelFormat:ne,monthsListFormat:te,getMonthControlProps:ae,yearLabelFormat:se,yearsListFormat:ue,getYearControlProps:E,decadeLabelFormat:L,allowSingleDateInRange:$,allowDeselect:z,minDate:Y,maxDate:ce,locale:o,...u}=t;return{calendarProps:{maxLevel:e,minLevel:r,defaultLevel:n,level:s,onLevelChange:l,nextIcon:d,previousIcon:i,date:m,defaultDate:v,onDateChange:_,numberOfColumns:M,columnsToScroll:S,ariaLabels:C,nextLabel:k,previousLabel:j,onYearSelect:N,onMonthSelect:F,onYearMouseEnter:B,onMonthMouseEnter:H,onNextMonth:U,onPreviousMonth:re,onNextYear:oe,onPreviousYear:K,onNextDecade:X,onPreviousDecade:q,withCellSpacing:V,highlightToday:G,__updateDateOnYearSelect:ie,__updateDateOnMonthSelect:ee,__setDateRef:P,withWeekNumbers:w,headerControlsOrder:h,firstDayOfWeek:a,weekdayFormat:p,weekendDays:f,getDayProps:c,excludeDate:b,renderDay:D,hideOutsideDates:T,hideWeekdays:I,getDayAriaLabel:Q,monthLabelFormat:ne,monthsListFormat:te,getMonthControlProps:ae,yearLabelFormat:se,yearsListFormat:ue,getYearControlProps:E,decadeLabelFormat:L,allowSingleDateInRange:$,allowDeselect:z,minDate:Y,maxDate:ce,locale:o},others:u}}function pu(t){if(t===null)return null;const e=new Date(t);return Number.isNaN(e.getTime())||!t?null:de(e).format("YYYY-MM-DD")}function gu({date:t,maxDate:e,minDate:r}){return!(t==null||Number.isNaN(new Date(t).getTime())||e&&de(t).isAfter(e,"date")||r&&de(t).isBefore(r,"date"))}const mu={valueFormat:"MMMM D, YYYY",fixOnBlur:!0,size:"sm"},Sr=O.factory((t,e)=>{const r=O.useInputProps("DateInput",mu,t),{inputProps:n,wrapperProps:s,value:l,defaultValue:d,onChange:i,clearable:m,clearButtonProps:v,popoverProps:_,getDayProps:M,locale:S,valueFormat:C,dateParser:k,minDate:j,maxDate:N,fixOnBlur:F,onFocus:B,onBlur:H,onClick:U,onKeyDown:re,readOnly:oe,name:K,form:X,rightSection:q,unstyled:V,classNames:G,styles:ie,allowDeselect:ee,date:P,defaultDate:x,onDateChange:w,getMonthControlProps:h,getYearControlProps:a,disabled:p,...f}=r,c=J.useRef(null),b=J.useRef(null),[D,T]=J.useState(!1),{calendarProps:I,others:Q}=fu(f),ne=pt(),ae=k||(Z=>{const fe=de(Z,C,ne.getLocale(S)).toDate();return Number.isNaN(fe.getTime())?pu(Z):de(fe).format("YYYY-MM-DD")}),se=ee!==void 0?ee:m,ue=Z=>Z?de(Z).locale(ne.getLocale(S)).format(C):"",[E,L,$]=fn({type:"default",value:l,defaultValue:d,onChange:i}),[z,Y]=fn({type:"default",value:P,defaultValue:d||x,onChange:w});J.useEffect(()=>{$&&l!==null&&Y(l)},[$,l]);const[ce,o]=J.useState(ue(E));J.useEffect(()=>{o(ue(E))},[ne.getLocale(S)]);const u=Z=>{const fe=Z.currentTarget.value;if(o(fe),T(!0),fe.trim()===""&&(ee||m))L(null);else{const me=ae(fe);me&&gu({date:me,minDate:j,maxDate:N})&&(L(me),Y(me))}},g=Z=>{H?.(Z),T(!1),F&&o(ue(E))},A=Z=>{B?.(Z),T(!0)},R=Z=>{U?.(Z),T(!0)},W=Z=>{Z.key==="Escape"&&T(!1),re?.(Z)},le=Z=>({...M?.(Z),selected:de(E).isSame(Z,"day"),onClick:fe=>{M?.(Z).onClick?.(fe);const me=se&&de(E).isSame(Z,"day")?null:Z;L(me),!$&&me&&o(ue(me)),T(!1)}}),he=y.jsx(O.Input.ClearButton,{onClick:()=>{L(null),!$&&o(""),T(!1)},unstyled:V,...v}),pe=m&&!!E&&!oe&&!p;return Le.useDidUpdate(()=>{E!==void 0&&!D&&o(ue(E))},[E]),Le.useClickOutside(()=>T(!1),void 0,[c.current,b.current]),y.jsxs(y.Fragment,{children:[y.jsx(O.Input.Wrapper,{...s,__staticSelector:"DateInput",ref:c,children:y.jsxs(O.Popover,{opened:D,trapFocus:!1,position:"bottom-start",disabled:oe||p,withRoles:!1,unstyled:V,..._,children:[y.jsx(O.Popover.Target,{children:y.jsx(O.Input,{"data-dates-input":!0,"data-read-only":oe||void 0,autoComplete:"off",ref:e,value:ce,onChange:u,onBlur:g,onFocus:A,onClick:R,onKeyDown:W,readOnly:oe,rightSection:q,__clearSection:he,__clearable:pe,...n,...Q,disabled:p,__staticSelector:"DateInput"})}),y.jsx(O.Popover.Dropdown,{onMouseDown:Z=>Z.preventDefault(),"data-dates-dropdown":!0,ref:b,children:y.jsx(Cr,{__staticSelector:"DateInput",...I,classNames:G,styles:ie,unstyled:V,__preventFocus:!0,minDate:j,maxDate:N,locale:S,getDayProps:le,size:n.size,date:z,onDateChange:Y,getMonthControlProps:Z=>({selected:typeof E=="string"?hn(Z,E):!1,...h?.(Z)}),getYearControlProps:Z=>({selected:typeof E=="string"?de(Z).isSame(E,"year"):!1,...a?.(Z)}),attributes:s.attributes})})]})}),y.jsx(Jo,{name:K,form:X,value:E,type:"default"})]})});Sr.classes={...O.Input.classes,...Cr.classes},Sr.displayName="@mantine/dates/DateInput";function ms(t){const e=Fe.c(49),{fields:r,onClose:n,queryKey:s,apiPath:l,steps:d,onCreated:i}=t,[m,v]=J.useState(0),[_,M]=J.useState(!1),[S,C]=J.useState(),{mutateAsync:k,isError:j,error:N,isPending:F}=Ho(l,s),{mutateAsync:B,isPending:H}=ln(l,s),U=F||H;let re;e[0]!==r?(re=new Set(r.filter(wu).map(bu)),e[0]=r,e[1]=re):re=e[1];let oe;e[2]!==re?(oe=[...re],e[2]=re,e[3]=oe):oe=e[3];const K=oe;let X;e[4]===Symbol.for("react.memo_cache_sentinel")?(X=function(D,T){return typeof D.required=="function"?D.required(T??{}):!!D.required},e[4]=X):X=e[4];const q=X;let V;e[5]!==r?(V=r.reduce(vu,{}),e[5]=r,e[6]=V):V=e[6];let G;if(e[7]!==r){let b;e[9]===Symbol.for("react.memo_cache_sentinel")?(b=(D,T)=>(D[T.id]=(I,Q)=>T.conditional&&!T.conditional(Q)||!q(T,Q)||I?null:"Pflichtfeld",D),e[9]=b):b=e[9],G=r.filter(yu).reduce(b,{}),e[7]=r,e[8]=G}else G=e[8];let ie;e[10]!==V||e[11]!==G?(ie={mode:"uncontrolled",initialValues:V,validate:G},e[10]=V,e[11]=G,e[12]=ie):ie=e[12];const ee=An.useForm(ie);let P;e[13]!==ee||e[14]!==S?(P=function(D){const T=ee.getValues();if(D.conditional&&!D.conditional(T))return null;const I=q(D,T);return y.jsxs(J.Fragment,{children:[(D.type===void 0||D.type=="text")&&y.jsx(O.TextInput,{label:D.column.title,placeholder:D.placeholder??"",...ee.getInputProps(D.id),type:D.id.includes("email")?"email":void 0,required:I},ee.key(D.id)),D.type==="number"&&y.jsx(O.NumberInput,{decimalSeparator:",",label:D.column.title,placeholder:D.placeholder??"",...ee.getInputProps(D.id),required:I},ee.key(D.id)),D.type==="date"&&y.jsx(Sr,{label:D.column.title,placeholder:D.placeholder??"",valueFormat:"DD.MM.YYYY",clearable:!0,...ee.getInputProps(D.id),required:I},ee.key(D.id)),D.type==="boolean"&&y.jsx(O.Checkbox,{mt:"md",label:D.column.title,...ee.getInputProps(D.id,{type:"checkbox"}),required:I},ee.key(D.id)),D.type==="textarea"&&y.jsx(O.Textarea,{label:D.column.title,placeholder:D.placeholder??"",...ee.getInputProps(D.id),minRows:3,autosize:!0,required:I},ee.key(D.id)),D.type==="custom"&&D.render&&D.render({...ee.getValues(),...S&&{id:S}},ee.setValues,M,{error:ee.getInputProps(D.id).error,required:I})]},D.id)},e[13]=ee,e[14]=S,e[15]=P):P=e[15];const x=P;let w;e[16]!==N?.message||e[17]!==N?.name||e[18]!==j?(w=j&&y.jsx(O.Alert,{variant:"outline",color:"red",title:N?.name??"Fehler aufgetreten",mb:"lg",children:N?.message??"Fehler aufgetreten"}),e[16]=N?.message,e[17]=N?.name,e[18]=j,e[19]=w):w=e[19];let h;e[20]!==m||e[21]!==k||e[22]!==ee||e[23]!==j||e[24]!==n||e[25]!==i||e[26]!==S||e[27]!==K.length||e[28]!==B?(h=ee.onSubmit(async b=>{if(S)await B({...b,id:S});else{const D=await k(b);C(D.id),i?.(D.id)}K.length&&m<K.length-1?j||v(m+1):j||(ee.setInitialValues(b),ee.reset(),n())}),e[20]=m,e[21]=k,e[22]=ee,e[23]=j,e[24]=n,e[25]=i,e[26]=S,e[27]=K.length,e[28]=B,e[29]=h):h=e[29];let a;e[30]!==m||e[31]!==r||e[32]!==x||e[33]!==d||e[34]!==K?(a=K.length?y.jsx(O.Stepper,{active:m,size:"sm",children:K.map(b=>y.jsx(O.Stepper.Step,{...d&&d[b-1]?{label:d[b-1].label}:{},children:r.filter(D=>D.step===b).map(D=>x(D))},b))}):r.map(b=>x(b)),e[30]=m,e[31]=r,e[32]=x,e[33]=d,e[34]=K,e[35]=a):a=e[35];let p;e[36]!==m||e[37]!==_||e[38]!==U||e[39]!==n||e[40]!==K.length?(p=!_&&y.jsxs(O.Group,{mt:"md",justify:"end",children:[y.jsx(O.Button,{onClick:()=>K.length?m===0?n():v(m-1):n(),variant:"outline",children:K.length?m===0?"Abbrechen":"Zurück":"Abbrechen"}),y.jsx(O.Button,{type:"submit",loading:U,children:K.length?m===K.length-1?"Speichern":"Weiter":"Speichern"})]}),e[36]=m,e[37]=_,e[38]=U,e[39]=n,e[40]=K.length,e[41]=p):p=e[41];let f;e[42]!==a||e[43]!==p||e[44]!==h?(f=y.jsxs("form",{onSubmit:h,children:[a,p]}),e[42]=a,e[43]=p,e[44]=h,e[45]=f):f=e[45];let c;return e[46]!==f||e[47]!==w?(c=y.jsxs(y.Fragment,{children:[w,f]}),e[46]=f,e[47]=w,e[48]=c):c=e[48],c}function yu(t){return t.required}function vu(t,e){return t[e.id]=e.type==="boolean"?!1:e.defaultValue??"",t}function bu(t){return t.step}function wu(t){return typeof t.step=="number"}var[_u,gn]=O.createSafeContext("useDataTableColumnsContext must be used within DataTableColumnProvider"),ys=t=>{let{children:e,columnsOrder:r,setColumnsOrder:n,columnsToggle:s,setColumnsToggle:l,resetColumnsOrder:d,resetColumnsToggle:i,setColumnWidth:m,setMultipleColumnWidths:v,resetColumnsWidth:_}=t,[M,S]=J.useState(""),[C,k]=J.useState("");return y.jsx(_u,{value:{sourceColumn:M,setSourceColumn:S,targetColumn:C,setTargetColumn:k,columnsToggle:s,setColumnsToggle:l,swapColumns:()=>{if(!r||!n||!M||!C)return;let j=r.indexOf(M),N=r.indexOf(C);if(j!==-1&&N!==-1){let F=r.splice(j,1)[0];r.splice(N,0,F),n([...r])}},resetColumnsOrder:d,resetColumnsToggle:i,setColumnWidth:m,setMultipleColumnWidths:v,resetColumnsWidth:_},children:e})};function xu(){return y.jsx("tr",{className:"mantine-datatable-empty-row",children:y.jsx("td",{})})}function Cu(){return y.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.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"}),y.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"}),y.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"}),y.jsx("path",{d:"M3 3l18 18"})]})}function Su({icon:t,text:e,active:r,children:n}){return y.jsx(O.Center,{className:"mantine-datatable-empty-state","data-active":r||void 0,children:n||y.jsxs(y.Fragment,{children:[t||y.jsx("div",{className:"mantine-datatable-empty-state-icon",children:y.jsx(Cu,{})}),y.jsx(O.Text,{component:"div",size:"sm",c:"dimmed",children:e})]})})}function Du({key:t,columns:e=[],getInitialValueInEffect:r=!0}){function n(M,S){let C=[];return M.forEach(k=>{S.find(j=>j.accessor===k)&&C.push(k)}),S.forEach(k=>{C.includes(k.accessor)||C.push(k.accessor)}),C}let s=e&&e.map(M=>M.accessor)||[],[l,d]=Le.useLocalStorage({key:t?`${t}-columns-order`:"",defaultValue:t?s:void 0,getInitialValueInEffect:r});function i(M){t&&d(M)}let m=()=>{i(s)};if(!t)return{columnsOrder:l,setColumnsOrder:i,resetColumnsOrder:m};let v=n(l,e),_=JSON.stringify(l);return JSON.stringify(v)!==_&&i(v),{columnsOrder:v,setColumnsOrder:i,resetColumnsOrder:m}}function ku({key:t,columns:e=[],getInitialValueInEffect:r=!0,headerRef:n,onFixedLayoutChange:s}){let l=J.useRef(!1),d=J.useRef({}),[i,m]=J.useState(!0),v=J.useMemo(()=>e.some(q=>q.resizable&&!q.hidden&&q.accessor!=="__selection__"),[e]),_=J.useMemo(()=>e.filter(q=>q.resizable&&!q.hidden&&q.accessor!=="__selection__"),[e]),M=J.useMemo(()=>_.some(q=>q.width===void 0||q.width===""||q.width==="initial"),[_]),S=J.useCallback(()=>e.filter(q=>q.accessor!=="__selection__").map(q=>({[q.accessor]:q.width??"auto"})),[e]),[C,k]=Le.useLocalStorage({key:t?`${t}-columns-width`:"",defaultValue:t?S():void 0,getInitialValueInEffect:!1}),[j,N]=J.useState(()=>S());J.useEffect(()=>{m(!1)},[]);let F=J.useCallback(()=>{if(!n?.current||i)return{};let q=n.current,V=Array.from(q.querySelectorAll("th[data-accessor]")),G={};return V.forEach(ie=>{let ee=ie.getAttribute("data-accessor");if(!ee||ee==="__selection__")return;let P=_.find(x=>x.accessor===ee);if(P&&(P.width===void 0||P.width===""||P.width==="initial")){let x=ie.getBoundingClientRect();G[ee]=Math.round(x.width)}}),G},[n,_,i]),B=J.useCallback(q=>{let V=q.filter(ie=>ie.accessor!=="__selection__"),G=j.map(ie=>{let ee=Object.keys(ie)[0],P=V.find(x=>x.accessor===ee);return P?{[ee]:P.width}:ie});N(G),t&&k(G)},[j,t,k]),H=J.useCallback(q=>{B(q)},[B]),U=J.useCallback(()=>{if(!(!n?.current||!s||i))if(M)s(!1),requestAnimationFrame(()=>{requestAnimationFrame(()=>{let q=F();d.current={...d.current,...q};let V=e.filter(G=>G.accessor!=="__selection__").map(G=>{let ie=G.accessor,ee=C?.find(x=>Object.keys(x)[0]===ie);if(ee&&ee[ie]!=="auto")return{[ie]:ee[ie]};let P=q[ie];return P?{[ie]:`${P}px`}:{[ie]:G.width??"auto"}});N(V),setTimeout(()=>{s(!0),l.current=!0},10)})});else{let q=e.filter(V=>V.accessor!=="__selection__").map(V=>({[V.accessor]:V.width??"auto"}));N(q),s(!0),l.current=!0}},[n,s,i,M,F,e,C]),re=U;J.useEffect(()=>{if(!v||!s||i){s?.(!1);return}l.current=!1;let q=setTimeout(()=>{U()},50);return()=>clearTimeout(q)},[v,s,i,U]),J.useEffect(()=>{i||!t||!r||C&&C.length>0&&N(C)},[i,t,r,C]);let oe=J.useCallback(()=>{t&&k(S()),d.current={},l.current=!1,s&&(s(!1),setTimeout(()=>{U()},10))},[t,k,S,s,U]),K=J.useCallback((q,V)=>{B([{accessor:q,width:V}])},[B]),X=J.useMemo(()=>v?j.filter(q=>{let V=Object.keys(q)[0];return _.some(G=>G.accessor===V)}).every(q=>{let V=Object.values(q)[0];return V==="auto"||V==="initial"}):!1,[v,j,_]);return{columnsWidth:j,setColumnsWidth:B,setColumnWidth:K,setMultipleColumnWidths:H,resetColumnsWidth:oe,hasResizableColumns:v,allResizableWidthsInitial:X,measureAndSetColumnWidths:re}}function Pu({key:t,columns:e=[],getInitialValueInEffect:r=!0}){function n(M,S){let C=[];return M.forEach(k=>{S.find(j=>j.accessor===k.accessor)&&C.push(k)}),S.forEach(k=>{C.find(j=>j.accessor===k.accessor)||C.push({accessor:k.accessor,defaultToggle:k.defaultToggle||!0,toggleable:k.toggleable,toggled:k.defaultToggle===void 0?!0:k.defaultToggle})}),C}let s=e&&e.map(M=>({accessor:M.accessor,defaultToggle:M.defaultToggle||!0,toggleable:M.toggleable,toggled:M.defaultToggle===void 0?!0:M.defaultToggle})),[l,d]=Le.useLocalStorage({key:t?`${t}-columns-toggle`:"",defaultValue:t?s:void 0,getInitialValueInEffect:r});function i(M){t&&d(M)}let m=()=>{i(s)};if(!t)return{columnsToggle:l,setColumnsToggle:i,resetColumnsToggle:m};let v=n(l,e),_=JSON.stringify(l);return JSON.stringify(v)!==_&&i(v),{columnsToggle:v,setColumnsToggle:i,resetColumnsToggle:m}}var Mu=({key:t,columns:e=[],getInitialValueInEffect:r=!0,headerRef:n,scrollViewportRef:s,onFixedLayoutChange:l})=>{let{columnsOrder:d,setColumnsOrder:i,resetColumnsOrder:m}=Du({key:t,columns:e,getInitialValueInEffect:r}),{columnsToggle:v,setColumnsToggle:_,resetColumnsToggle:M}=Pu({key:t,columns:e,getInitialValueInEffect:r}),{columnsWidth:S,setColumnsWidth:C,setColumnWidth:k,setMultipleColumnWidths:j,resetColumnsWidth:N,hasResizableColumns:F,allResizableWidthsInitial:B,measureAndSetColumnWidths:H}=ku({key:t,columns:e,getInitialValueInEffect:r,headerRef:n,onFixedLayoutChange:l});return{effectiveColumns:J.useMemo(()=>d?d.map(U=>e.find(re=>re.accessor===U)).map(U=>({...U,hidden:U?.hidden||!v.find(re=>re.accessor===U?.accessor)?.toggled})).map(U=>U?.accessor==="__selection__"?U:{...U,width:S.find(re=>re[U?.accessor])?.[U?.accessor]}):e,[e,d,v,S]),setColumnsOrder:i,columnsOrder:d,resetColumnsOrder:m,columnsToggle:v,setColumnsToggle:_,resetColumnsToggle:M,columnsWidth:S,setColumnsWidth:C,setColumnWidth:k,setMultipleColumnWidths:j,resetColumnsWidth:N,hasResizableColumns:F,allResizableWidthsInitial:B,measureAndSetColumnWidths:H}},vs=typeof window<"u"?J.useLayoutEffect:J.useEffect;function bs(t){let e=J.useRef(t);return e.current=t,e}var ws="--mantine-datatable-header-height",_s="--mantine-datatable-footer-height",xs="--mantine-datatable-selection-column-width",Cs="--mantine-datatable-last-row-border-bottom";function Xe(t,e,r){t?.style.setProperty(e,r)}function mn(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 yn(t,e,r){if(t){let n=new ResizeObserver(s=>{let l=s[0];l&&e(mn(l))});return n.observe(t),()=>{n.disconnect(),r()}}}function Ou({scrollCallbacks:t,withRowBorders:e}){let r={root:J.useRef(null),table:J.useRef(null),scrollViewport:J.useRef(null),header:J.useRef(null),footer:J.useRef(null),selectionColumnHeader:J.useRef(null)},{root:n,table:s,scrollViewport:l,header:d,footer:i,selectionColumnHeader:m}=r,v=bs({withRowBorders:e}),_=bs(t),M=J.useRef(()=>{}),S=J.useRef(()=>{}),C=J.useCallback(k=>{_.current.onScroll?.(k),M.current()},[]);return J.useEffect(()=>yn(d.current,k=>{Xe(n.current,ws,`${k.height}px`)},()=>Xe(n.current,ws,"0")),[d.current]),J.useEffect(()=>yn(i.current,k=>{Xe(n.current,_s,`${k.height}px`)},()=>Xe(n.current,_s,"0")),[i.current]),J.useEffect(()=>yn(m.current,k=>{Xe(n.current,xs,`${k.width}px`)},()=>Xe(n.current,xs,"0")),[m.current]),vs(()=>{if(typeof window===void 0)return;let k={top:!0,bottom:!0,left:!0,right:!0},j={width:0,height:0},N={width:0,height:0};function F(oe,K){let X=k[oe];return k[oe]=K,Xe(n.current,`--mantine-datatable-${oe}-shadow-opacity`,K?"0":"1"),X}function B(){let oe=j.height-N.height,K=oe<0;Xe(n.current,"--mantine-datatable-footer-position",K?"relative":"sticky"),Xe(n.current,"--mantine-datatable-footer-bottom",K?`${oe}px`:"0")}function H(){v.current.withRowBorders&&j.height<N.height?Xe(n.current,Cs,`${O.rem("1px")} solid var(--mantine-datatable-border-color)`):Xe(n.current,Cs,"unset")}S.current=H;function U(){let oe=_.current,K=l.current,X=K?.scrollTop??0,q=K?.scrollLeft??0,V=X===0,G=j.height-X-N.height<1,ie=F("top",V),ee=F("bottom",G);V&&V!==ie&&oe.onScrollToTop?.(),G&&G!==ee&&oe.onScrollToBottom?.();let P=K?getComputedStyle(K).direction==="rtl":!1,x=(K?.scrollWidth??0)-N.width,w,h;if(P){let f=Math.abs(q);h=f<1,w=x-f<1}else w=q<1,h=j.width-q-N.width<1;let a=F("left",w),p=F("right",h);w&&w!==a&&oe.onScrollToLeft?.(),h&&h!==p&&oe.onScrollToRight?.()}M.current=U;let re=new ResizeObserver(oe=>{for(let K of oe)switch(K.target.tagName){case"TABLE":{j=mn(K);break}case"DIV":{N=mn(K);break}}U(),B(),H()});return re.observe(s.current),re.observe(l.current),()=>{re.disconnect()}},[]),vs(()=>{S.current()},[e]),{refs:r,onScroll:C}}function ju(t){let[e,r]=J.useState(null),n=t?.join(":")||"";return J.useEffect(()=>{r(null)},[n]),{lastSelectionChangeIndex:e,setLastSelectionChangeIndex:r}}function Au(t,e){let r=()=>{e(t.map(s=>s.matches))},n=t.map(s=>{try{return s.addEventListener("change",r),()=>s.removeEventListener("change",r)}catch{return s.addListener(r),()=>s.removeListener(r)}});return()=>{n.forEach(s=>s())}}function Eu(t,e){return e||(typeof window<"u"&&"matchMedia"in window?t.map(r=>window.matchMedia(r).matches):t.map(()=>!1))}function Tu(t,e,{getInitialValueInEffect:r}={getInitialValueInEffect:!0}){let[n,s]=J.useState(r?e:Eu(t,e)),l=J.useRef(null);return J.useEffect(()=>{if("matchMedia"in window)return l.current=t.map(d=>window.matchMedia(d)),s(l.current.map(d=>d.matches)),Au(l.current,d=>{s(d)})},[t]),n}function $u(t){let e=O.useMantineTheme(),r=J.useMemo(()=>t.map(s=>(typeof s=="function"?s(e):s)??""),[t,e]),n=J.useMemo(()=>t.map(()=>!0),[t]);return Tu(r,n)}function Dr(t){let e=O.useMantineTheme(),r=typeof t=="function"?t(e):t;return Le.useMediaQuery(r||"",!0)}function vn(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 Ru(t,e,r){return t.filter(n=>!e.map(r).includes(r(n)))}function bn(t,e){return t.filter((r,n,s)=>n===s.findIndex(l=>e(r)===e(l)))}function Ss(t,e){return e?e.match(/([^[.\]])+/g).reduce((r,n)=>r&&r[n],t):void 0}function Ie(t,e){return typeof e=="string"?Ss(t,e):e(t)}function Ds(t){return!t||t.length===0?0:Math.max(...t.map(e=>e.groups&&e.groups.length>0?1+Ds(e.groups):1))}function wn(t){let e=[];for(let r of t)r.columns&&r.columns.length>0?e.push(...r.columns.filter(n=>n!=null)):r.groups&&r.groups.length>0&&e.push(...wn(r.groups));return e.filter(r=>r!=null)}function _n(t,e){return t.columns&&t.columns.length>0?t.columns.filter((r,n)=>r.hidden?!1:e?e[n]!==!1:!0).length:t.groups&&t.groups.length>0?t.groups.reduce((r,n)=>r+_n(n,e),0):0}function ks(t,e,r=0){if(r===e)return[...t];let n=[];for(let s of t)s.groups&&s.groups.length>0&&n.push(...ks(s.groups,e,r+1));return n}function Nu(t,e,r){return r?!t||e:!1}function Lu({rowExpansion:t,records:e,idAccessor:r}){let n=[];if(t&&e){let{trigger:i,allowMultiple:m,initiallyExpanded:v}=t;e&&i==="always"?n=e.map(_=>Ie(_,r)):v&&(n=e.filter((_,M)=>v({record:_,index:M})).map(_=>Ie(_,r)),m||(n=[n[0]]))}let s,l,d=J.useState(n);if(t){let{expandable:i,trigger:m,allowMultiple:v,collapseProps:_,content:M}=t;t.expanded?{recordIds:s,onRecordIdsChange:l}=t.expanded:[s,l]=d;let S=C=>l?.(s.filter(k=>k!==Ie(C,r)));return{expandOnClick:m!=="always"&&m!=="never",isRowExpanded:C=>m==="always"?!0:s.includes(Ie(C,r)),isExpandable:({record:C,index:k})=>i?i({record:C,index:k}):!0,expandRow:C=>{let k=Ie(C,r);l?.(v?[...s,k]:[k])},collapseRow:S,collapseProps:_,content:({record:C,index:k})=>()=>M({record:C,index:k,collapse:()=>S(C)})}}}function Bu(t,e){let[r,n]=J.useState(t),[s,l]=J.useState(t),d=Le.useTimeout(()=>n(!0),0),i=Le.useTimeout(()=>l(!1),e||200);return J.useEffect(()=>{t?(i.clear(),l(!0),d.start()):(d.clear(),n(!1),i.start())},[d,i,t]),{expanded:r,visible:s}}var xn="mantine-datatable-nowrap",Cn="mantine-datatable-ellipsis",jt="mantine-datatable-pointer-cursor",Ps="mantine-datatable-context-menu-cursor",Iu="mantine-datatable-text-selection-disabled",kr="mantine-datatable-text-align-left",Pr="mantine-datatable-text-align-center",Mr="mantine-datatable-text-align-right";function Yu({className:t,style:e,visibleMediaQuery:r,title:n,noWrap:s,ellipsis:l,textAlign:d,width:i}){return Dr(r)?y.jsx(O.TableTh,{className:je({[xn]:s||l,[Cn]:l,[kr]:d==="left",[Pr]:d==="center",[Mr]:d==="right"},t),style:[{width:i,minWidth:i,maxWidth:i},e],children:n}):null}function zu({shadowVisible:t}){return y.jsx(O.TableTh,{className:"mantine-datatable-footer-selector-placeholder-cell","data-shadow-visible":t||void 0})}function Fu({className:t,style:e,columns:r,defaultColumnProps:n,selectionVisible:s,selectorCellShadowVisible:l,ref:d}){return y.jsx(O.TableTfoot,{ref:d,className:je("mantine-datatable-footer",t),style:e,children:y.jsxs(O.TableTr,{children:[s&&y.jsx(zu,{shadowVisible:l}),r.map(({hidden:i,...m})=>{if(i)return null;let{accessor:v,visibleMediaQuery:_,textAlign:M,width:S,footer:C,footerClassName:k,footerStyle:j,noWrap:N,ellipsis:F}={...n,...m};return y.jsx(Yu,{className:k,style:j,visibleMediaQuery:_,textAlign:M,width:S,title:C,noWrap:N,ellipsis:F},v)})]})})}function Wu({group:{id:t,columns:e,groups:r,title:n,textAlign:s,className:l,style:d},maxDepth:i,currentDepth:m,previousGroups:v,isLastGroup:_,withColumnBorders:M=!1,totalTableColumns:S}){let C=J.useMemo(()=>e&&e.length>0?e:r&&r.length>0?wn([{id:t,columns:e,groups:r}]):[],[e,r,t]),k=J.useMemo(()=>C.map(({visibleMediaQuery:re})=>re),[C]),j=$u(k),N=J.useMemo(()=>_n({columns:e,groups:r},j),[t,e,r,j]),F=J.useMemo(()=>v.reduce((re,oe)=>re+_n(oe,j),0),[v,j]),B=r&&r.length>0?1:i-m,H=F+N<S,U=Nu(_,H,M);return N>0?y.jsx(O.TableTh,{colSpan:N,rowSpan:B>1?B:void 0,className:je("mantine-datatable-column-group-header-cell",{[kr]:s==="left",[Pr]:s==="center",[Mr]:s==="right","mantine-datatable-column-group-header-cell--needs-border":U},l),style:d,children:n??vn(t)}):null}function Uu(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.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 qu(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.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 Vu({children:t,isActive:e,filterPopoverProps:r,filterPopoverDisableClickOutside:n}){let[s,{close:l,toggle:d}]=Le.useDisclosure(!1),i=e?qu:Uu,m=Le.useClickOutside(l);return n&&(m=void 0),y.jsxs(O.Popover,{withArrow:!0,shadow:"md",opened:s,onClose:l,trapFocus:!0,...r,children:[y.jsx(O.PopoverTarget,{children:y.jsx(O.ActionIcon,{className:"mantine-datatable-header-cell-filter-action-icon","data-active":e||void 0,size:"sm",variant:"default",onClick:v=>{v.preventDefault(),d()},onKeyDown:v=>v.stopPropagation(),children:y.jsx(i,{})})}),y.jsx(O.PopoverDropdown,{ref:m,onClick:v=>v.stopPropagation(),onKeyDown:v=>v.stopPropagation(),children:typeof t=="function"?t({close:l}):t})]})}var Hu=t=>{let{accessor:e,columnRef:r}=t,[n,s]=J.useState(!1),l=J.useRef(0),d=J.useRef({current:0,next:0}),{dir:i}=O.useDirection(),m=i==="rtl",{setMultipleColumnWidths:v}=gn(),_=J.useCallback(S=>{if(S.preventDefault(),S.stopPropagation(),!r.current)return;let C=r.current,k=C.nextElementSibling;for(;k;){let re=k.getAttribute("data-accessor");if(re&&re!=="__selection__")break;k=k.nextElementSibling}if(!k)return;let j=k.getAttribute("data-accessor");if(!j)return;let N=j==="__selection__";s(!0),l.current=S.clientX;let F=C.offsetWidth,B=k.offsetWidth;d.current={current:F,next:B};let H=re=>{if(!r.current)return;let oe=r.current,K=oe.nextElementSibling;if(!K)return;let X=re.clientX-l.current;m&&(X=-X);let q=50,V=d.current.current-q,G=d.current.next-q,ie=Math.max(-V,Math.min(X,G)),ee=d.current.current+ie,P=d.current.next-ie;oe.style.width=`${ee}px`,K.style.width=`${P}px`,oe.style.minWidth=`${ee}px`,oe.style.maxWidth=`${ee}px`,K.style.minWidth=`${P}px`,K.style.maxWidth=`${P}px`},U=()=>{if(!r.current)return;let re=r.current,oe=re.nextElementSibling;s(!1),document.body.style.cursor="initial",document.body.style.userSelect="initial";let K=parseInt(re.style.width)||re.offsetWidth,X=oe?parseInt(oe.style.width)||oe.offsetWidth:0,q=[{accessor:e,width:`${K}px`}];if(oe&&!N){let V=oe.getAttribute("data-accessor");V&&q.push({accessor:V,width:`${X}px`})}setTimeout(()=>{v(q)},0),document.removeEventListener("mousemove",H),document.removeEventListener("mouseup",U)};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",H),document.addEventListener("mouseup",U)},[e,r,m,v]),M=J.useCallback(()=>{if(!r.current)return;let S=r.current,C=S.nextElementSibling;S.style.width="",S.style.minWidth="",S.style.maxWidth="";let k=[{accessor:e,width:"auto"}];if(C){C.style.width="",C.style.minWidth="",C.style.maxWidth="";let j=C.getAttribute("data-accessor");j&&j!=="__selection__"&&k.push({accessor:j,width:"auto"})}setTimeout(()=>{v(k)},0)},[e,r,v]);return y.jsx("div",{className:"mantine-datatable-header-resizable-handle",style:{cursor:n?"col-resize":void 0},onMouseDown:_,onDoubleClick:M,onClick:S=>S.stopPropagation(),title:"Drag to resize column, double-click to reset"})};function Gu(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.jsx("path",{d:"M12 5l0 14"}),y.jsx("path",{d:"M16 9l-4 -4"}),y.jsx("path",{d:"M8 9l4 -4"})]})}function Qu(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.jsx("path",{d:"M8 7l4 -4l4 4"}),y.jsx("path",{d:"M8 17l4 4l4 -4"}),y.jsx("path",{d:"M12 3l0 18"})]})}function Ku(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.jsx("path",{d:"M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),y.jsx("path",{d:"M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),y.jsx("path",{d:"M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),y.jsx("path",{d:"M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),y.jsx("path",{d:"M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),y.jsx("path",{d:"M15 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"})]})}function Zu(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.jsx("path",{d:"M18 6l-12 12"}),y.jsx("path",{d:"M6 6l12 12"})]})}function Ju({className:t,style:e,accessor:r,visibleMediaQuery:n,title:s,sortable:l,draggable:d,toggleable:i,resizable:m,sortIcons:v,textAlign:_,width:M,sortStatus:S,onSortStatusChange:C,filter:k,filterPopoverProps:j,filterPopoverDisableClickOutside:N,filtering:F,sortKey:B}){let{setSourceColumn:H,setTargetColumn:U,swapColumns:re,setColumnsToggle:oe}=gn(),[K,X]=J.useState(!1),q=J.useRef(null);if(!Dr(n))return null;let V=s??vn(r),G=typeof V=="string"?V:void 0,ie=l&&C?p=>{p?.defaultPrevented||C({sortKey:B,columnAccessor:r,direction:S?.columnAccessor===r?S.direction==="asc"?"desc":"asc":S?.direction??"asc"})}:void 0,ee=p=>{p.stopPropagation(),H(r),X(!1)},P=p=>{p.preventDefault(),U(r),X(!0)},x=()=>{U(r),X(!1),re()},w=()=>{X(!0)},h=()=>{X(!1)},a=p=>{p.stopPropagation(),oe(f=>f.map(c=>c.accessor===r?{...c,toggled:!1}:c))};return y.jsxs(O.TableTh,{"data-accessor":r,className:je({"mantine-datatable-header-cell-sortable":l,"mantine-datatable-header-cell-toggleable":i,"mantine-datatable-header-cell-resizable":m},t),style:[{width:M,...m?{}:{minWidth:M,maxWidth:M}},e],role:l?"button":void 0,tabIndex:l?0:void 0,onClick:ie,onKeyDown:p=>p.key==="Enter"&&ie?.(),ref:q,children:[y.jsxs(O.Group,{className:"mantine-datatable-header-cell-sortable-group",justify:"space-between",wrap:"nowrap",children:[y.jsxs(O.Flex,{align:"center",w:"100%",className:je({"mantine-datatable-header-cell-draggable":d,"mantine-datatable-header-cell-drag-over":K}),draggable:d,onDragStart:d?ee:void 0,onDragEnter:d?w:void 0,onDragOver:d?P:void 0,onDrop:d?x:void 0,onDragLeave:d?h:void 0,children:[d?y.jsx(O.Center,{role:"img","aria-label":"Drag column",children:y.jsx(O.ActionIcon,{className:"mantine-datatable-header-cell-draggable-action-icon",variant:"subtle",size:"xs",onClick:p=>{p.stopPropagation()},children:y.jsx(Ku,{})})}):null,y.jsx(O.Box,{className:je("mantine-datatable-header-cell-sortable-text",{[kr]:_==="left",[Pr]:_==="center",[Mr]:_==="right"},xn,Cn),title:G,children:V})]}),i?y.jsx(O.Center,{className:"mantine-datatable-header-cell-toggleable-icon",role:"img","aria-label":"Toggle column",children:y.jsx(O.ActionIcon,{size:"xs",variant:"light",onClick:a,children:y.jsx(Zu,{})})}):null,l||S?.columnAccessor===r?y.jsx(y.Fragment,{children:S?.columnAccessor===r?y.jsx(O.Center,{className:je("mantine-datatable-header-cell-sortable-icon",{"mantine-datatable-header-cell-sortable-icon-reversed":S.direction==="desc"}),role:"img","aria-label":`Sorted ${S.direction==="desc"?"descending":"ascending"}`,children:v?.sorted||y.jsx(Gu,{})}):y.jsx(O.Center,{className:"mantine-datatable-header-cell-sortable-unsorted-icon",role:"img","aria-label":"Not sorted",children:v?.unsorted||y.jsx(Qu,{})})}):null,k?y.jsx(Vu,{filterPopoverProps:j,isActive:!!F,filterPopoverDisableClickOutside:N,children:k}):null]}),m&&r!=="__selection__"?y.jsx(Hu,{accessor:r,columnRef:q}):null]})}function Xu({className:t,style:e,trigger:r,shadowVisible:n,checked:s,indeterminate:l,checkboxProps:d,onChange:i,rowSpan:m,ref:v}){let _=!d.disabled;return y.jsx(O.TableTh,{ref:v,className:je("mantine-datatable-header-selector-cell",{[jt]:r==="cell"&&_},t),style:e,rowSpan:m,"data-shadow-visible":n||void 0,"data-accessor":"__selection__",onClick:r==="cell"&&_?i:void 0,children:y.jsx(O.Checkbox,{classNames:_?{input:jt}:void 0,checked:s,indeterminate:l,onChange:i,...d,disabled:!(i||d.onChange)||d.disabled})})}function ec({selectionColumnHeaderRef:t,className:e,style:r,sortStatus:n,sortIcons:s,onSortStatusChange:l,columns:d,defaultColumnProps:i,groups:m,selectionTrigger:v,selectionVisible:_,selectionChecked:M,selectionIndeterminate:S,onSelectionChange:C,selectionCheckboxProps:k,selectorCellShadowVisible:j,selectionColumnClassName:N,selectionColumnStyle:F,withColumnBorders:B=!1,ref:H}){let U=m?Ds(m):0,re=U>0?U+1:1,oe=_?y.jsx(Xu,{ref:t,className:N,style:F,trigger:v,shadowVisible:j,checked:M,indeterminate:S,checkboxProps:k,onChange:C,rowSpan:m?re:void 0}):null,{columnsToggle:K,setColumnsToggle:X}=gn(),[q,V]=J.useState(!1),G=d.some(P=>P.toggleable),ie=G?Object.fromEntries(d.map(({accessor:P,title:x})=>[P,x??vn(String(P))])):void 0,ee=y.jsxs(O.TableThead,{className:je("mantine-datatable-header",e),style:r,ref:H,onContextMenu:G?P=>{P.preventDefault(),V(x=>!x)}:void 0,children:[m&&Array.from({length:U},(P,x)=>{let w=ks(m,x);return y.jsxs(O.TableTr,{children:[x===0&&oe,w.map((h,a)=>y.jsx(Wu,{group:h,maxDepth:U,currentDepth:x,previousGroups:w.slice(0,a),isLastGroup:a===w.length-1,withColumnBorders:B,totalTableColumns:d.length},h.id))]},`group-depth-${x}`)}),y.jsxs(O.TableTr,{children:[!m&&oe,d.map(({hidden:P,...x},w)=>{if(P)return null;let{accessor:h,visibleMediaQuery:a,textAlign:p,width:f,title:c,sortable:b,draggable:D,toggleable:T,resizable:I,titleClassName:Q,titleStyle:ne,filter:te,filterPopoverProps:ae,filterPopoverDisableClickOutside:se,filtering:ue,sortKey:E}={...i,...x};return y.jsx(Ju,{accessor:h,className:Q,style:ne,visibleMediaQuery:a,textAlign:p,width:f,title:c,sortable:b,draggable:D,toggleable:T,resizable:I&&w<d.length-1,sortStatus:n,sortIcons:s,sortKey:E,onSortStatusChange:l,filter:te,filterPopoverProps:ae,filterPopoverDisableClickOutside:se,filtering:ue},h)})]})]});return G?y.jsxs(O.Popover,{position:"bottom",withArrow:!0,shadow:"md",opened:q,onChange:V,children:[y.jsx(O.PopoverTarget,{children:ee}),y.jsx(O.PopoverDropdown,{children:y.jsx(O.Stack,{children:K.filter(P=>P.toggleable).map(P=>y.jsx(O.Group,{children:y.jsx(O.Checkbox,{classNames:{label:"mantine-datatable-header-column-toggle-checkbox-label"},size:"xs",label:ie[P.accessor],checked:P.toggled,onChange:x=>{X(K.map(w=>w.accessor===P.accessor?{...w,toggled:x.currentTarget.checked}:w))}})},P.accessor))})})]}):ee}function tc({fetching:t,customContent:e,backgroundBlur:r,size:n,type:s,color:l}){return y.jsx(O.Center,{className:je("mantine-datatable-loader",{"mantine-datatable-loader-fetching":t}),style:[{backdropFilter:r?`blur(${r}px)`:void 0}],children:t&&(e||y.jsx(O.Loader,{size:n,type:s,color:l}))})}function Ae(t,e,r){return t?O.parseThemeColor({color:typeof t=="object"?t[r]:t,theme:e}).value:void 0}function rc({theme:t,c:e,backgroundColor:r,borderColor:n,rowBorderColor:s,stripedColor:l,highlightOnHoverColor:d}){return{"--mantine-datatable-color-light":Ae(e,t,"light"),"--mantine-datatable-color-dark":Ae(e,t,"dark"),"--mantine-datatable-background-color-light":Ae(r,t,"light"),"--mantine-datatable-background-color-dark":Ae(r,t,"dark"),"--mantine-datatable-border-color-light":Ae(n,t,"light"),"--mantine-datatable-border-color-dark":Ae(n,t,"dark"),"--mantine-datatable-row-border-color-light":Ae(s,t,"light"),"--mantine-datatable-row-border-color-dark":Ae(s,t,"dark"),"--mantine-datatable-striped-color-light":Ae(l,t,"light"),"--mantine-datatable-striped-color-dark":Ae(l,t,"dark"),"--mantine-datatable-highlight-on-hover-color-light":Ae(d,t,"light"),"--mantine-datatable-highlight-on-hover-color-dark":Ae(d,t,"dark")}}function Ms({theme:t,paginationActiveTextColor:e,paginationActiveBackgroundColor:r}){return{"--mantine-datatable-pagination-active-text-color-light":Ae(e,t,"light"),"--mantine-datatable-pagination-active-text-color-dark":Ae(e,t,"dark"),"--mantine-datatable-pagination-active-background-color-light":Ae(r,t,"light"),"--mantine-datatable-pagination-active-background-color-dark":Ae(r,t,"dark")}}function nc({theme:t,color:e,backgroundColor:r}){return{"--mantine-datatable-row-color-light":Ae(e,t,"light"),"--mantine-datatable-row-color-dark":Ae(e,t,"dark"),"--mantine-datatable-row-background-color-light":Ae(r,t,"light"),"--mantine-datatable-row-background-color-dark":Ae(r,t,"dark")}}function oc(){return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.jsx("path",{d:"M8 9l4 -4l4 4"}),y.jsx("path",{d:"M16 15l-4 4l-4 -4"})]})}var Os={xs:O.rem(22),sm:O.rem(26),md:O.rem(32),lg:O.rem(38),xl:O.rem(44)};function sc({size:t,label:e,values:r,value:n,activeTextColor:s,activeBackgroundColor:l,onChange:d}){return y.jsxs(O.Group,{gap:"xs",children:[y.jsx(O.Text,{component:"div",size:t,children:e}),y.jsxs(O.Menu,{withinPortal:!0,withArrow:!0,offset:2,classNames:{arrow:"mantine-datatable-page-size-selector-menu-arrow"},children:[y.jsx(O.MenuTarget,{children:y.jsx(O.Button,{size:t,variant:"default",classNames:{section:"mantine-datatable-page-size-selector-button-icon"},rightSection:y.jsx(oc,{}),style:[{fontWeight:"normal"},i=>({height:Os[t],paddingLeft:i.spacing[t],paddingRight:i.spacing[t]})],children:n})}),y.jsx(O.MenuDropdown,{children:r.map(i=>{let m=i===n;return y.jsx(O.MenuItem,{className:je({"mantine-datatable-page-size-selector-active":m}),style:[{height:Os[t]},m&&(s||l)?v=>Ms({theme:v,paginationActiveTextColor:s,paginationActiveBackgroundColor:l}):void 0],disabled:m,onClick:()=>d(i),children:y.jsx(O.Text,{component:"div",size:t,children:i})},i)})})]})]})}function ic({className:t,style:e,fetching:r,page:n,onPageChange:s,paginationWithEdges:l,paginationWithControls:d,paginationActiveTextColor:i,paginationActiveBackgroundColor:m,paginationSize:v,loadingText:_,noRecordsText:M,paginationText:S,totalRecords:C,recordsPerPage:k,onRecordsPerPageChange:j,recordsPerPageLabel:N,recordsPerPageOptions:F,recordsLength:B,horizontalSpacing:H,paginationWrapBreakpoint:U,getPaginationControlProps:re,getPaginationItemProps:oe,renderPagination:K}){let X;if(C){let x=(n-1)*k+1,w=x+(B||0)-1;X=S({from:x,to:w,totalRecords:C})}else X=r?_:M;let q=C&&k?Math.max(1,Math.ceil(C/k)):1,V=C?(n-1)*(k??0)+1:void 0,G=C?(V??1)+(B??0)-1:void 0,ie=!Dr(({breakpoints:x})=>`(min-width: ${typeof U=="number"?`${O.rem(U)}rem`:x[U]||U})`),ee={Text:x=>y.jsx(O.Text,{component:"div",className:"mantine-datatable-pagination-text",size:v,...x,children:X}),PageSizeSelector:x=>F?y.jsx(sc,{activeTextColor:i,activeBackgroundColor:m,size:v,label:N,values:F,value:k,onChange:j,...x}):y.jsx(y.Fragment,{}),Pagination:x=>y.jsx(O.Pagination,{classNames:{root:je("mantine-datatable-pagination-pages",{"mantine-datatable-pagination-pages-fetching":r||!B}),control:"mantine-datatable-pagination-pages-control"},style:i||m?w=>Ms({theme:w,paginationActiveTextColor:i,paginationActiveBackgroundColor:m}):void 0,withEdges:l,withControls:d,value:n,onChange:s,size:v,total:q,getControlProps:re,getItemProps:oe,...x})},P={state:{paginationSize:v,page:n,totalPages:q,totalRecords:C,recordsPerPage:k,recordsLength:B,fetching:r,from:V,to:G,isWrapped:ie},actions:{setPage:x=>s?.(x),setRecordsPerPage:j?x=>j(x):void 0},Controls:ee};return y.jsx(O.Box,{px:H??"xs",py:"xs",className:je("mantine-datatable-pagination",t),style:[{flexDirection:ie?"column":"row"},e],children:typeof K=="function"?K(P):y.jsxs(y.Fragment,{children:[y.jsx(ee.Text,{}),y.jsx(ee.PageSizeSelector,{}),y.jsx(ee.Pagination,{})]})})}function ac({className:t,style:e,visibleMediaQuery:r,record:n,index:s,onClick:l,onDoubleClick:d,onContextMenu:i,noWrap:m,ellipsis:v,textAlign:_,width:M,accessor:S,render:C,defaultRender:k,customCellAttributes:j}){return Dr(r)?y.jsx(O.TableTd,{className:je({[xn]:m||v,[Cn]:v,[jt]:l||d,[Ps]:i,[kr]:_==="left",[Pr]:_==="center",[Mr]:_==="right"},t),style:[{width:M,minWidth:M,maxWidth:M},e],onClick:l,onDoubleClick:d,onContextMenu:i,...j?.(n,s),children:C?C(n,s):k?k(n,s,S):Ss(n,S)}):null}function lc({open:t,colSpan:e,content:r,collapseProps:n}){let{expanded:s,visible:l}=Bu(t,n?.transitionDuration);return l?y.jsxs(y.Fragment,{children:[y.jsx(O.TableTr,{}),y.jsx(O.TableTr,{children:y.jsx(O.TableTd,{className:"mantine-datatable-row-expansion-cell",colSpan:e,children:y.jsx(O.Collapse,{in:s,...n,children:y.jsx("div",{className:"mantine-datatable-row-expansion-cell-content",children:r()})})})})]}):null}function uc({className:t,style:e,record:r,index:n,trigger:s,onChange:l,withRightShadow:d,checkboxProps:i,getCheckboxProps:m,...v}){let _={...i,...m(r,n)},M=!v.disabled&&!_.disabled,S=C=>{C.stopPropagation(),s==="cell"&&M&&l?.(C)};return y.jsx(O.TableTd,{className:je("mantine-datatable-row-selector-cell",{[jt]:s==="cell"&&M},t),style:e,"data-shadow-visible":d||void 0,onClick:S,children:y.jsx(O.Checkbox,{classNames:M?{input:jt}:void 0,onChange:l,...v,..._})})}function cc({record:t,index:e,columns:r,defaultColumnProps:n,defaultColumnRender:s,selectionTrigger:l,selectionVisible:d,selectionChecked:i,onSelectionChange:m,isRecordSelectable:v,selectionCheckboxProps:_,getSelectionCheckboxProps:M,onClick:S,onDoubleClick:C,onContextMenu:k,onCellClick:j,onCellDoubleClick:N,onCellContextMenu:F,expansion:B,customAttributes:H,color:U,backgroundColor:re,className:oe,style:K,selectorCellShadowVisible:X,selectionColumnClassName:q,selectionColumnStyle:V,rowFactory:G}){let ie=y.jsxs(y.Fragment,{children:[d&&y.jsx(uc,{className:q,style:V,record:t,index:e,trigger:l,withRightShadow:X,checked:i,disabled:!m||(v?!v(t,e):!1),onChange:m,checkboxProps:_,getCheckboxProps:M}),r.map(({hidden:x,hiddenContent:w,...h},a)=>{if(x||w)return null;let{accessor:p,visibleMediaQuery:f,textAlign:c,noWrap:b,ellipsis:D,width:T,render:I,cellsClassName:Q,cellsStyle:ne,customCellAttributes:te}={...n,...h};return y.jsx(ac,{className:typeof Q=="function"?Q(t,e):Q,style:ne?.(t,e),visibleMediaQuery:f,record:t,index:e,onClick:j?ae=>j({event:ae,record:t,index:e,column:h,columnIndex:a}):void 0,onDoubleClick:N?ae=>N({event:ae,record:t,index:e,column:h,columnIndex:a}):void 0,onContextMenu:F?ae=>F({event:ae,record:t,index:e,column:h,columnIndex:a}):void 0,accessor:p,textAlign:c,noWrap:b,ellipsis:D,width:T,render:I,defaultRender:s,customCellAttributes:te},p)})]}),ee=B&&y.jsx(lc,{colSpan:r.filter(({hidden:x})=>!x).length+(d?1:0),open:B.isRowExpanded(t),content:B.content({record:t,index:e}),collapseProps:B.collapseProps}),P=dc({record:t,index:e,selectionChecked:i,onClick:S,onDoubleClick:C,onContextMenu:k,expansion:B,customAttributes:H,color:U,backgroundColor:re,className:oe,style:K});return G?G({record:t,index:e,rowProps:P,children:ie,expandedElement:ee}):y.jsxs(y.Fragment,{children:[y.jsx(O.TableTr,{...P,children:ie}),ee]})}function dc({record:t,index:e,selectionChecked:r,onClick:n,onDoubleClick:s,onContextMenu:l,expansion:d,customAttributes:i,color:m,backgroundColor:v,className:_,style:M}){return{className:je("mantine-datatable-row",{[jt]:n||s||d?.isExpandable({record:t,index:e})&&d?.expandOnClick},{[Ps]:l},typeof _=="function"?_(t,e):_),"data-selected":r||void 0,onClick:S=>{if(d){let{isExpandable:C,isRowExpanded:k,expandOnClick:j,expandRow:N,collapseRow:F}=d;C({record:t,index:e})&&j&&(k(t)?F(t):N(t))}n?.({event:S,record:t,index:e})},onDoubleClick:s?S=>s({event:S,record:t,index:e}):void 0,onContextMenu:l?S=>l({event:S,record:t,index:e}):void 0,style:[m||v?S=>{let C=m?.(t,e),k=v?.(t,e);return nc({theme:S,color:C,backgroundColor:k})}:void 0,M?.(t,e)],...i?.(t,e)??{}}}function hc({leftShadowBehind:t,rightShadowBehind:e,onScrollPositionChange:r,children:n,viewportRef:s,scrollAreaProps:l}){return y.jsxs(O.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:r,children:[n,y.jsx(O.Box,{className:je("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-top-shadow")}),y.jsx("div",{className:je("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-left-shadow",{"mantine-datatable-scroll-area-shadow-behind":t})}),y.jsx("div",{className:je("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-right-shadow",{"mantine-datatable-scroll-area-shadow-behind":e})}),y.jsx(O.Box,{className:je("mantine-datatable-scroll-area-shadow","mantine-datatable-scroll-area-bottom-shadow")})]})}function fc({withTableBorder:t,borderRadius:e,textSelectionDisabled:r,height:n="100%",minHeight:s,maxHeight:l,shadow:d,verticalAlign:i="center",fetching:m,columns:v,storeColumnsKey:_,groups:M,pinFirstColumn:S,pinLastColumn:C,defaultColumnProps:k,defaultColumnRender:j,idAccessor:N="id",records:F,selectionTrigger:B="checkbox",selectedRecords:H,onSelectedRecordsChange:U,selectionColumnClassName:re,selectionColumnStyle:oe,isRecordSelectable:K,selectionCheckboxProps:X,allRecordsSelectionCheckboxProps:q={"aria-label":"Select all records"},getRecordSelectionCheckboxProps:V=(Ce,_e)=>({"aria-label":`Select record ${_e+1}`}),sortStatus:G,sortIcons:ie,onSortStatusChange:ee,horizontalSpacing:P,page:x,onPageChange:w,totalRecords:h,recordsPerPage:a,onRecordsPerPageChange:p,recordsPerPageOptions:f,recordsPerPageLabel:c="Records per page",paginationWithEdges:b,paginationWithControls:D,paginationActiveTextColor:T,paginationActiveBackgroundColor:I,paginationSize:Q="sm",paginationText:ne=({from:Ce,to:_e,totalRecords:ze})=>`${Ce} - ${_e} / ${ze}`,paginationWrapBreakpoint:te="sm",getPaginationControlProps:ae=Ce=>Ce==="previous"?{"aria-label":"Previous page"}:Ce==="next"?{"aria-label":"Next page"}:{},getPaginationItemProps:se,renderPagination:ue,loaderBackgroundBlur:E,customLoader:L,loaderSize:$,loaderType:z,loaderColor:Y,loadingText:ce="...",emptyState:o,noRecordsText:u="No records",noRecordsIcon:g,highlightOnHover:A,striped:R,noHeader:W,onRowClick:le,onRowDoubleClick:he,onRowContextMenu:pe,onCellClick:Z,onCellDoubleClick:fe,onCellContextMenu:me,onScroll:ge,onScrollToTop:Se,onScrollToBottom:xe,onScrollToLeft:Pe,onScrollToRight:Ve,c:Ne,backgroundColor:Me,borderColor:Ct,rowBorderColor:Te,stripedColor:rt,highlightOnHoverColor:Ye,rowColor:et,rowBackgroundColor:nt,rowExpansion:$e,rowClassName:ot,rowStyle:st,customRowAttributes:He,scrollViewportRef:Ge,scrollAreaProps:Qe,tableRef:it,bodyRef:yt,m:at,my:ve,mx:Oe,mt:tt,mb:vt,ml:Qt,mr:At,className:bt,classNames:Ke,style:wt,styles:lt,rowFactory:De,tableWrapper:ke,...ct}){let Ce=J.useMemo(()=>M?wn(M):v,[v,M]),[_e,ze]=J.useState(!1),{refs:Ee,onScroll:Et}=Ou({scrollCallbacks:{onScroll:ge,onScrollToTop:Se,onScrollToBottom:xe,onScrollToLeft:Pe,onScrollToRight:Ve},withRowBorders:ct.withRowBorders}),Dn=Mu({key:_,columns:Ce,headerRef:Ee.header,scrollViewportRef:Ee.scrollViewport,onFixedLayoutChange:ze}),Wc=Le.useMergedRef(Ee.table,it),Uc=Le.useMergedRef(Ee.scrollViewport,Ge),qc=Lu({rowExpansion:$e,records:F,idAccessor:N}),Or=J.useRef(!1),Ns=J.useRef(x),kn=J.useRef(F),Vc=J.useCallback(we=>{Or.current=!0,kn.current=F,w(we)},[w,F]);J.useEffect(()=>{Ns.current!==x&&(Or.current=!0,kn.current=F,Ns.current=x)},[x,F]);let jr=F?.length;J.useLayoutEffect(()=>{if(!Or.current||m||F===kn.current)return;let we=Ee.scrollViewport.current;if(!we)return;let St=requestAnimationFrame(()=>{we.scrollTo({top:0,left:0}),Or.current=!1});return()=>cancelAnimationFrame(St)},[m,F,Ee.scrollViewport]);let Ls=F?.map(we=>Ie(we,N)),Tt=!!H,Kt=H?.map(we=>Ie(we,N)),Bs=Ls!==void 0&&Kt!==void 0&&Kt.length>0,Pn=K?F?.filter(K):F,Ar=Pn?.map(we=>Ie(we,N)),Er=Bs&&Ar.every(we=>Kt.includes(we)),Hc=Bs&&Ar.some(we=>Kt.includes(we)),Gc=J.useCallback(()=>{H&&U&&U(Er?H.filter(we=>!Ar.includes(Ie(we,N))):bn([...H,...Pn],we=>Ie(we,N)))},[Er,N,U,Ar,Pn,H]),{lastSelectionChangeIndex:Tr,setLastSelectionChangeIndex:Qc}=ju(Ls),Mn=Tt&&!S,Kc={m:at,my:ve,mx:Oe,mt:tt,mb:vt,ml:Qt,mr:At},Zc=J.useCallback(({children:we})=>ke?ke({children:we}):we,[ke]);return y.jsx(ys,{...Dn,children:y.jsxs(O.Box,{ref:Ee.root,...Kc,className:je("mantine-datatable",{"mantine-datatable-with-border":t},bt,Ke?.root),style:[we=>({...rc({theme:we,c:Ne,backgroundColor:Me,borderColor:Ct,rowBorderColor:Te,stripedColor:rt,highlightOnHoverColor:Ye}),borderRadius:we.radius[e]||e,boxShadow:we.shadows[d]||d,height:n,minHeight:s,maxHeight:l}),wt,lt?.root,{position:"relative"}],children:[y.jsx(hc,{viewportRef:Uc,leftShadowBehind:Tt||!!S,rightShadowBehind:C,onScrollPositionChange:Et,scrollAreaProps:Qe,children:y.jsx(Zc,{children:y.jsxs(O.Table,{ref:Wc,horizontalSpacing:P,className:je("mantine-datatable-table",{[Iu]:r,"mantine-datatable-vertical-align-top":i==="top","mantine-datatable-vertical-align-bottom":i==="bottom","mantine-datatable-pin-last-column":C,"mantine-datatable-selection-column-visible":Tt,"mantine-datatable-pin-first-column":S,"mantine-datatable-resizable-columns":Dn.hasResizableColumns&&_e},Ke?.table),style:{...lt?.table},"data-striped":jr&&R||void 0,"data-highlight-on-hover":A||void 0,...ct,children:[W?null:y.jsx(ys,{...Dn,children:y.jsx(ec,{ref:Ee.header,selectionColumnHeaderRef:Ee.selectionColumnHeader,className:Ke?.header,style:lt?.header,columns:Ce,defaultColumnProps:k,groups:M,sortStatus:G,sortIcons:ie,onSortStatusChange:ee,selectionTrigger:B,selectionVisible:Tt,selectionChecked:Er,selectionIndeterminate:Hc&&!Er,onSelectionChange:Gc,selectionCheckboxProps:{...X,...q},selectorCellShadowVisible:Mn,selectionColumnClassName:re,selectionColumnStyle:oe,withColumnBorders:ct.withColumnBorders})}),y.jsx("tbody",{ref:yt,children:jr?F.map((we,St)=>{let On=Ie(we,N),jn=Kt?.includes(On)||!1,Is;return U&&H&&(Is=Jc=>{if(Jc.nativeEvent.shiftKey&&Tr!==null){let $t=F.filter(St>Tr?(Dt,kt)=>kt>=Tr&&kt<=St&&(K?K(Dt,kt):!0):(Dt,kt)=>kt>=St&&kt<=Tr&&(K?K(Dt,kt):!0));U(jn?Ru(H,$t,Dt=>Ie(Dt,N)):bn([...H,...$t],Dt=>Ie(Dt,N)))}else U(jn?H.filter($t=>Ie($t,N)!==On):bn([...H,we],$t=>Ie($t,N)));Qc(St)}),y.jsx(cc,{record:we,index:St,columns:Ce,defaultColumnProps:k,defaultColumnRender:j,selectionTrigger:B,selectionVisible:Tt,selectionChecked:jn,onSelectionChange:Is,isRecordSelectable:K,selectionCheckboxProps:X,getSelectionCheckboxProps:V,onClick:le,onDoubleClick:he,onCellClick:Z,onCellDoubleClick:fe,onContextMenu:pe,onCellContextMenu:me,expansion:qc,color:et,backgroundColor:nt,className:ot,style:st,customAttributes:He,selectorCellShadowVisible:Mn,selectionColumnClassName:re,selectionColumnStyle:oe,idAccessor:N,rowFactory:De},On)}):y.jsx(xu,{})}),Ce.some(({footer:we})=>we)&&y.jsx(Fu,{ref:Ee.footer,className:Ke?.footer,style:lt?.footer,columns:Ce,defaultColumnProps:k,selectionVisible:Tt,selectorCellShadowVisible:Mn})]})})}),x&&y.jsx(ic,{className:Ke?.pagination,style:lt?.pagination,horizontalSpacing:P,fetching:m,page:x,onPageChange:Vc,totalRecords:h,recordsPerPage:a,onRecordsPerPageChange:p,recordsPerPageOptions:f,recordsPerPageLabel:c,paginationWithEdges:b,paginationWithControls:D,paginationActiveTextColor:T,paginationActiveBackgroundColor:I,paginationSize:Q,paginationText:ne,paginationWrapBreakpoint:te,getPaginationControlProps:ae,getPaginationItemProps:se,noRecordsText:u,loadingText:ce,recordsLength:jr,renderPagination:ue}),y.jsx(tc,{fetching:m,backgroundBlur:E,customContent:L,size:$,type:z,color:Y}),y.jsx(Su,{icon:g,text:u,active:!m&&!jr,children:o})]})})}function js(t){const e=Fe.c(42),{fields:r,onClose:n,queryKey:s,apiPath:l,id:d,steps:i}=t,[m,v]=J.useState(0),[_,M]=J.useState(!1),{data:S,isLoading:C}=qo(l,s,d),{mutateAsync:k,isError:j,error:N,isPending:F}=ln(l,s);let B;e[0]!==r?(B=new Set(r.filter(bc).map(vc)),e[0]=r,e[1]=B):B=e[1];let H;e[2]!==B?(H=[...B],e[2]=B,e[3]=H):H=e[3];const U=H;let re;e[4]!==r?(re=r.reduce(yc,{}),e[4]=r,e[5]=re):re=e[5];let oe;e[6]!==r?(oe=r.filter(mc).reduce(gc,{}),e[6]=r,e[7]=oe):oe=e[7];let K;e[8]!==re||e[9]!==oe?(K={mode:"uncontrolled",initialValues:re,validate:oe},e[8]=re,e[9]=oe,e[10]=K):K=e[10];const X=An.useForm(K);let q;e[11]!==S||e[12]!==r||e[13]!==X?(q=()=>{if(S){const a={...S};r.forEach(p=>{const f=p.id;p.type==="boolean"&&a[f]===null?a[f]=!1:p.type==="date"&&a[f]?a[f]=new Date(a[f]):a[f]===null&&(a[f]="")}),X.initialize(a),X.setValues(a)}},e[11]=S,e[12]=r,e[13]=X,e[14]=q):q=e[14];let V;e[15]!==S?(V=[S],e[15]=S,e[16]=V):V=e[16],J.useEffect(q,V);let G;e[17]===Symbol.for("react.memo_cache_sentinel")?(G=function(p,f){return typeof p.required=="function"?p.required(f??{}):!!p.required},e[17]=G):G=e[17];const ie=G;let ee;e[18]!==X||e[19]!==d?(ee=function(p){const f=X.getValues();if(p.conditional&&!p.conditional(f))return null;const c=ie(p,f);return y.jsxs(J.Fragment,{children:[(p.type===void 0||p.type=="text")&&y.jsx(O.TextInput,{label:p.column.title,placeholder:p.placeholder??"",...X.getInputProps(p.id),type:p.id.includes("email")?"email":void 0,required:c},X.key(p.id)),p.type==="number"&&y.jsx(O.NumberInput,{decimalSeparator:",",label:p.column.title,placeholder:p.placeholder??"",...X.getInputProps(p.id),required:c},X.key(p.id)),p.type==="date"&&y.jsx(Sr,{label:p.column.title,placeholder:p.placeholder??"",valueFormat:"DD.MM.YYYY",clearable:!0,...X.getInputProps(p.id),required:c},X.key(p.id)),p.type==="boolean"&&y.jsx(O.Checkbox,{mt:"md",label:p.column.title,...X.getInputProps(p.id,{type:"checkbox"}),required:c},X.key(p.id)),p.type==="textarea"&&y.jsx(O.Textarea,{label:p.column.title,placeholder:p.placeholder??"",...X.getInputProps(p.id),minRows:3,autosize:!0,required:c},X.key(p.id)),p.type==="custom"&&p.render&&p.render({...X.getValues(),id:d},X.setValues,M,{error:X.getInputProps(p.id).error,required:c})]},p.id)},e[18]=X,e[19]=d,e[20]=ee):ee=e[20];const P=ee;let x;e[21]!==j||e[22]!==N?.message||e[23]!==N?.name?(x=j&&y.jsx(O.Alert,{variant:"outline",color:"red",title:N?.name??"Fehler aufgetreten",mb:"lg",children:N?.message??"Fehler aufgetreten"}),e[21]=j,e[22]=N?.message,e[23]=N?.name,e[24]=x):x=e[24];let w;e[25]!==m||e[26]!==r||e[27]!==X||e[28]!==_||e[29]!==d||e[30]!==C||e[31]!==F||e[32]!==j||e[33]!==n||e[34]!==P||e[35]!==i||e[36]!==U||e[37]!==k?(w=C?y.jsxs(O.Stack,{gap:"md",children:[y.jsx(O.Skeleton,{height:40}),Array(r.length).fill(0).map(pc),y.jsxs(O.Group,{mt:"md",justify:"end",children:[y.jsx(O.Skeleton,{width:100,height:36}),y.jsx(O.Skeleton,{width:100,height:36})]})]}):y.jsxs("form",{onSubmit:X.onSubmit(async a=>{await k({...a,id:d}),U.length&&m<U.length-1?j||v(m+1):j||(X.setInitialValues(a),X.reset(),n())}),children:[U.length?y.jsx(O.Stepper,{active:m,size:"sm",children:U.map(a=>y.jsx(O.Stepper.Step,{...i&&i[a-1]?{label:i[a-1].label}:{},children:r.filter(p=>p.step===a).map(p=>P(p))},a))}):r.map(a=>P(a)),!_&&y.jsxs(O.Group,{mt:"md",justify:"end",children:[y.jsx(O.Button,{onClick:()=>U.length?m===0?n():v(m-1):n(),variant:"outline",children:U.length?m===0?"Abbrechen":"Zurück":"Abbrechen"}),y.jsx(O.Button,{type:"submit",loading:F,children:U.length?m===U.length-1?"Speichern":"Weiter":"Speichern"})]})]}),e[25]=m,e[26]=r,e[27]=X,e[28]=_,e[29]=d,e[30]=C,e[31]=F,e[32]=j,e[33]=n,e[34]=P,e[35]=i,e[36]=U,e[37]=k,e[38]=w):w=e[38];let h;return e[39]!==x||e[40]!==w?(h=y.jsxs(y.Fragment,{children:[x,w]}),e[39]=x,e[40]=w,e[41]=h):h=e[41],h}function pc(t,e){return y.jsx(O.Skeleton,{height:35},`skeleton-field-${e}`)}function gc(t,e){return t[e.id]=(r,n)=>e.conditional&&!e.conditional(n)||!(typeof e.required=="function"?e.required(n):!!e.required)||r?null:"Pflichtfeld",t}function mc(t){return t.required}function yc(t,e){return t[e.id]=e.type==="boolean"?e.defaultValue??!1:e.defaultValue??"",t}function vc(t){return t.step}function bc(t){return typeof t.step=="number"}function As({queryKey:t,apiPath:e,onClose:r,selectedRecords:n}){const{mutateAsync:s,isError:l,error:d,isPending:i}=Go(e,t),[m,v]=J.useState(n),[_,M]=J.useState(!1),S=_||i;return J.useEffect(()=>{m.length||r()},[r,m]),m.length?y.jsxs(y.Fragment,{children:[l&&d.message&&y.jsx(O.Alert,{variant:"outline",color:"red",title:d.name,children:d.message}),y.jsx(O.Text,{children:m.length===1?`Soll ${m.length} Eintrag wirklich gelöscht werden?`:`Sollen ${m.length} Einträge wirklich gelöscht werden?`}),y.jsxs(O.Group,{mt:"md",justify:"end",children:[y.jsx(O.Button,{onClick:r,variant:"outline",disabled:S,children:"Abbrechen"}),y.jsx(O.Button,{color:"red",loading:S,onClick:async()=>{M(!0);try{await Promise.all(m.map(C=>s(C.id))),v([])}finally{M(!1)}},children:"Löschen"})]})]}):y.jsx(y.Fragment,{})}function Es(t,e){const r=Fe.c(8);let n;r[0]!==t||r[1]!==e?(n=()=>{const v=localStorage.getItem(`use_persistent_storage_${e}`);return v?JSON.parse(v):t},r[0]=t,r[1]=e,r[2]=n):n=r[2];const[s,l]=J.useState(n);let d;r[3]!==e?(d=v=>{l(v),localStorage.setItem(`use_persistent_storage_${e}`,JSON.stringify(v))},r[3]=e,r[4]=d):d=r[4];const i=d;let m;return r[5]!==i||r[6]!==s?(m=[s,i],r[5]=i,r[6]=s,r[7]=m):m=r[7],m}const wc=(t,e)=>{const r=t.map(m=>m[e]).filter(m=>m!=null&&m!=="");if(r.length===0)return"string";const n=Math.min(100,r.length),s=r.slice(0,n),l={string:0,number:0,date:0},d=[/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/,/^\d{4}-\d{2}-\d{2}$/,/^\d{1,2}\/\d{1,2}\/\d{4}$/,/^\d{1,2}\.\d{1,2}\.\d{4}$/];s.forEach(m=>{if(typeof m=="number")l.number++;else if(typeof m=="string"){const v=m.trim();if(v!==""&&!isNaN(Number(v))&&!isNaN(parseFloat(v))){l.number++;return}if(d.some(_=>_.test(v))){const _=new Date(v);if(!isNaN(_.getTime())){l.date++;return}}l.string++}else m instanceof Date?l.date++:l.string++});const i=l.string+l.number+l.date;return l.date/i>=.6?"date":l.number/i>=.6?"number":l.string/i>=.6?"string":"mixed"},Ts=new Map,$s=(t,e,r="asc")=>{if(!t||t.length===0)return[];const n=`${String(e)}_${t.length}`;let s=Ts.get(n);return s||(s=wc(t,e),Ts.set(n,s)),[...t].sort((d,i)=>{const m=d[e],v=i[e],_=m==null||m==="",M=v==null||v==="";if(_&&M)return 0;if(_)return r==="asc"?-1:1;if(M)return r==="asc"?1:-1;let S,C;switch(s){case"date":if(typeof m=="string"){const B=new Date(m.trim());S=isNaN(B.getTime())?null:B.getTime()}else m instanceof Date?S=m.getTime():S=null;if(typeof v=="string"){const B=new Date(v.trim());C=isNaN(B.getTime())?null:B.getTime()}else v instanceof Date?C=v.getTime():C=null;break;case"number":if(typeof m=="number")S=m;else{const B=String(m).trim(),H=parseFloat(B);S=isNaN(H)?null:H}if(typeof v=="number")C=v;else{const B=String(v).trim(),H=parseFloat(B);C=isNaN(H)?null:H}break;case"string":const k=typeof m=="string"?m:String(m),j=typeof v=="string"?v:String(v);S=k.toLowerCase().trim(),C=j.toLowerCase().trim();break;case"mixed":default:const N=String(m),F=String(v);S=N.toLowerCase().trim(),C=F.toLowerCase().trim();break}return S===null&&C===null?0:S===null?r==="asc"?1:-1:C===null||S<C?r==="asc"?-1:1:S>C?r==="asc"?1:-1:0})};function _c(t,e){return e.split(".").reduce((r,n)=>{if(r&&typeof r=="object"&&n in r)return r[n]},t)}function xc(t,e){const r=e.column;if(r.render)return r.render(t,0);const n=r.accessor??e.id,s=_c(t,n);return s==null?y.jsx(O.Text,{c:"dimmed",children:"–"}):typeof s=="boolean"?y.jsx(O.Text,{fz:"sm",children:s?"Ja":"Nein"}):y.jsx(O.Text,{fz:"sm",children:String(s)})}function Cc(t){const e=Fe.c(10),{field:r,record:n}=t,s=r.column.title??r.id;let l;e[0]!==s?(l=y.jsx(O.Text,{fw:700,fz:"sm",children:s}),e[0]=s,e[1]=l):l=e[1];let d;e[2]!==r||e[3]!==n?(d=xc(n,r),e[2]=r,e[3]=n,e[4]=d):d=e[4];let i;e[5]!==d?(i=y.jsx(O.Box,{ta:"right",fz:"sm",children:d}),e[5]=d,e[6]=i):i=e[6];let m;return e[7]!==l||e[8]!==i?(m=y.jsxs(O.Group,{wrap:"nowrap",justify:"space-between",align:"center",py:"xs",px:"sm",children:[l,i]}),e[7]=l,e[8]=i,e[9]=m):m=e[9],m}function Rs(t){const e=Fe.c(40),{records:r,fields:n,selection:s,selectedRecords:l,onSelectedRecordsChange:d,onRowClick:i,actions:m,pagination:v,sort:_,rowExpansion:M}=t;let S;e[0]!==l?(S=l===void 0?[]:l,e[0]=l,e[1]=S):S=e[1];const C=S;let k;e[2]===Symbol.for("react.memo_cache_sentinel")?(k=new Set,e[2]=k):k=e[2];const[j,N]=J.useState(k);let F;e[3]===Symbol.for("react.memo_cache_sentinel")?(F=G=>{N(ie=>{const ee=new Set(ie);return ee.has(G)?ee.delete(G):ee.add(G),ee})},e[3]=F):F=e[3];const B=F;let H,U,re,oe,K,X;if(e[4]!==m||e[5]!==j||e[6]!==n||e[7]!==i||e[8]!==d||e[9]!==r||e[10]!==M||e[11]!==C||e[12]!==s||e[13]!==_){X=Symbol.for("react.early_return_sentinel");e:{const G=n.filter(Oc),ie=G.filter(Mc).reduce(Pc,[]);let ee;e[20]!==C?(ee=p=>C.some(f=>f.id===p.id),e[20]=C,e[21]=ee):ee=e[21];const P=ee;let x;e[22]!==P||e[23]!==d||e[24]!==C?(x=p=>{d&&(P(p)?d(C.filter(f=>f.id!==p.id)):d([...C,p]))},e[22]=P,e[23]=d,e[24]=C,e[25]=x):x=e[25];const w=x;let h;e[26]!==i||e[27]!==s||e[28]!==w?(h=(p,f,c)=>{i?i({record:p,index:f,event:c}):s&&w(p)},e[26]=i,e[27]=s,e[28]=w,e[29]=h):h=e[29];const a=h;if(r.length===0){let p;e[30]===Symbol.for("react.memo_cache_sentinel")?(p=y.jsx(O.Text,{c:"dimmed",ta:"center",py:"xl",children:"Keine Einträge gefunden"}),e[30]=p):p=e[30],X=p;break e}H=O.Stack,U="sm",re="md",oe=_&&ie.length>0&&y.jsxs(O.Group,{gap:"xs",wrap:"nowrap",children:[y.jsx(O.Select,{data:ie,value:_.field,onChange:p=>p&&_.onSortChange(p,_.direction),allowDeselect:!1,style:{flex:1}}),y.jsx(O.ActionIcon,{variant:"filled",size:"input-sm",onClick:()=>_.onSortChange(_.field,_.direction==="asc"?"desc":"asc"),children:_.direction==="asc"?y.jsx(ut.IconSortAscending,{size:18}):y.jsx(ut.IconSortDescending,{size:18})})]}),K=r.map((p,f)=>{const c=P(p),b=!!i||!!s,D=p.id??f,T=j.has(D);return y.jsx(J.Fragment,{children:y.jsxs(O.Box,{bg:c?"var(--mantine-primary-color-light)":f%2===0?"var(--mantine-color-gray-0)":"white",bd:c?void 0:"1px solid var(--mantine-color-gray-2)",style:{borderRadius:"var(--mantine-radius-md)",overflow:"hidden"},children:[y.jsxs(O.Box,{w:"100%",style:{cursor:b||M?"pointer":"default"},onClick:I=>{M&&!i?B(D):a(p,f,I)},children:[(s||M||m&&m.length>0)&&y.jsxs(O.Group,{px:"sm",pt:"sm",justify:"space-between",children:[y.jsxs(O.Group,{gap:"xs",children:[M&&y.jsx(O.Box,{c:"var(--mantine-primary-color-filled)",style:{cursor:"pointer",display:"flex",alignItems:"center"},onClick:I=>{I.stopPropagation(),B(D)},children:y.jsx(ut.IconChevronDown,{size:16,style:{transform:T?"rotate(0deg)":"rotate(-90deg)",transition:"transform 200ms"}})}),s&&y.jsx(O.Checkbox,{checked:c,onChange:()=>w(p),onClick:kc})]}),m&&m.length>0&&y.jsxs(O.Menu,{shadow:"md",position:"bottom-end",children:[y.jsx(O.Menu.Target,{children:y.jsx(O.ActionIcon,{variant:"subtle",color:"gray",size:"sm",onClick:Dc,children:y.jsx(ut.IconDotsVertical,{size:16})})}),y.jsx(O.Menu.Dropdown,{children:m.map((I,Q)=>y.jsx(O.Menu.Item,{leftSection:I.icon,onClick:ne=>{ne.stopPropagation(),I.onClick([p])},children:I.label},`card_action_${Q}`))})]})]}),G.map((I,Q)=>y.jsxs(J.Fragment,{children:[Q>0&&y.jsx(O.Divider,{}),y.jsx(Cc,{field:I,record:p})]},I.id))]}),M&&y.jsxs(O.Collapse,{in:T,children:[y.jsx(O.Divider,{}),y.jsx(O.Box,{px:"sm",py:"sm",children:M.content(p)})]})]})},D)})}e[4]=m,e[5]=j,e[6]=n,e[7]=i,e[8]=d,e[9]=r,e[10]=M,e[11]=C,e[12]=s,e[13]=_,e[14]=H,e[15]=U,e[16]=re,e[17]=oe,e[18]=K,e[19]=X}else H=e[14],U=e[15],re=e[16],oe=e[17],K=e[18],X=e[19];if(X!==Symbol.for("react.early_return_sentinel"))return X;let q;e[31]!==v?(q=v&&v.totalRecords>v.recordsPerPage&&y.jsxs(O.Stack,{gap:"xs",mt:"sm",children:[y.jsx(O.Group,{justify:"center",children:y.jsx(O.Pagination,{total:Math.ceil(v.totalRecords/v.recordsPerPage),value:v.page,onChange:v.onPageChange,size:"sm"})}),v.recordsPerPageOptions&&v.onRecordsPerPageChange&&y.jsxs(O.Group,{justify:"center",gap:"xs",children:[y.jsx(O.Text,{fz:"xs",c:"dimmed",children:"Einträge pro Seite:"}),y.jsx(O.Select,{data:v.recordsPerPageOptions.map(Sc),value:String(v.recordsPerPage),onChange:G=>G&&v.onRecordsPerPageChange(Number(G)),allowDeselect:!1,size:"xs",w:70})]})]}),e[31]=v,e[32]=q):q=e[32];let V;return e[33]!==H||e[34]!==q||e[35]!==U||e[36]!==re||e[37]!==oe||e[38]!==K?(V=y.jsxs(H,{gap:U,my:re,children:[oe,K,q]}),e[33]=H,e[34]=q,e[35]=U,e[36]=re,e[37]=oe,e[38]=K,e[39]=V):V=e[39],V}function Sc(t){return{value:String(t),label:String(t)}}function Dc(t){return t.stopPropagation()}function kc(t){return t.stopPropagation()}function Pc(t,e){const r=e.column.accessor??e.id;return t.some(n=>n.value===r)||t.push({value:r,label:e.column.title??e.id}),t}function Mc(t){return t.column.sortable!==!1}function Oc(t){return t.list&&t.column}const Sn=[10,15,50,100,500];function jc(t){const e=Fe.c(118),{title:r,queryKey:n,connectedQueryKeys:s,apiPath:l,mutationApiPath:d,buttons:i,fields:m,selection:v,pagination:_,filters:M,actions:S,steps:C,defaultSort:k,onSortChange:j,createButtonText:N,queryParams:F,tabs:B,defaultTab:H,activeTab:U,onActiveTabChange:re,canUpdate:oe,canDelete:K,showRefresh:X,rowExpansion:q,onRowClick:V,mobileCards:G}=t,ie=X===void 0?!0:X,ee=G===void 0?!1:G,[P,x]=J.useState(H||(B&&B.length>0?B[0].value:null)),w=U!==void 0?U:P;let h;e[0]!==U||e[1]!==re?(h=De=>{U===void 0&&x(De),re&&re(De)},e[0]=U,e[1]=re,e[2]=h):h=e[2];const a=h,p=B?.find(De=>De.value===w)?.queryParams||{},f={...F,...p},c=f?"?"+Object.entries(f).filter(zc).map(Yc).join("&"):"";let b;e[3]!==w||e[4]!==n?(b=w?[...n,w]:n,e[3]=w,e[4]=n,e[5]=b):b=e[5];const D=b,{data:T,isLoading:I,isError:Q,isRefetching:ne,refetch:te}=Vo(l+c,D),{queryClient:ae}=ft();let se,ue;e[6]!==T||e[7]!==s||e[8]!==ae?(se=()=>{!T||!Array.isArray(T)||s?.forEach(De=>ae.invalidateQueries({queryKey:De}))},ue=[T,s,ae],e[6]=T,e[7]=s,e[8]=ae,e[9]=se,e[10]=ue):(se=e[9],ue=e[10]),J.useEffect(se,ue);const E=!T||!Array.isArray(T)?[]:!M||M.length===0?T:T.filter(De=>M.every(ke=>{if(ke.value===void 0)return!0;const ct=ke.id;if(ke.type==="query"){const Ce=De[ct];return Array.isArray(ke.value)?Array.isArray(Ce)?Ce.some(_e=>{if(typeof _e=="string"||typeof _e=="number")return ke.value.includes(String(_e));if(_e&&typeof _e=="object"){if("id"in _e&&ke.value.includes(_e.id))return!0;for(const ze in _e){const Ee=_e[ze];if(typeof Ee=="string"&&ke.value.includes(Ee)||Ee&&typeof Ee=="object"&&"id"in Ee&&ke.value.includes(Ee.id))return!0}}return!1}):Ce&&typeof Ce=="object"&&"id"in Ce?ke.value.includes(Ce.id):!1:typeof Ce=="string"&&Ce.includes(ke.value)}else if(ke.type==="date"){const Ce=ke.value;if(!Ce)return!0;const[_e,ze]=Ce;if(!_e&&!ze)return!0;const Ee=De[ct];if(typeof Ee=="string"){const Et=Ee.split(" ")[0];if(_e&&ze)return Et>=_e&&Et<=ze;if(_e&&!ze)return Et>=_e;if(!_e&&ze)return Et<=ze}return!0}else if(ke.type==="boolean")return De[ct]===ke.value;return!0})),L=k?.field??m[0].id,$=k?.direction??"desc";let z;e[11]!==L||e[12]!==$?(z={columnAccessor:L,direction:$},e[11]=L,e[12]=$,e[13]=z):z=e[13];const[Y,ce]=J.useState(z);let o;e[14]!==j?(o=De=>{ce(De),j&&j(String(De.columnAccessor),De.direction)},e[14]=j,e[15]=o):o=e[15];const u=o,g=$s(E,Y.columnAccessor,Y.direction),[A,R]=Es(Sn[1],"mantine-table-page-size"),[W,le]=J.useState(1),he=_?g.slice((W-1)*A,W*A):g;let pe;e[16]===Symbol.for("react.memo_cache_sentinel")?(pe=[],e[16]=pe):pe=e[16];const[Z,fe]=J.useState(pe);let me;e[17]===Symbol.for("react.memo_cache_sentinel")?(me=()=>{fe([])},e[17]=me):me=e[17];let ge;e[18]!==w?(ge=[w],e[18]=w,e[19]=ge):ge=e[19],J.useEffect(me,ge);const[Se,xe]=J.useState(!1),[Pe,Ve]=J.useState(!1),[Ne,Me]=J.useState(!1),Ct=r?"space-between":"end";let Te;e[20]!==r?(Te=r&&(typeof r=="string"?y.jsx(O.Title,{order:4,children:r}):r),e[20]=r,e[21]=Te):Te=e[21];let rt;e[22]===Symbol.for("react.memo_cache_sentinel")?(rt={marginLeft:"auto"},e[22]=rt):rt=e[22];let Ye;e[23]!==te||e[24]!==ie?(Ye=ie&&y.jsx(O.ActionIcon,{variant:"subtle",onClick:()=>te(),"aria-label":"Neuladen",children:y.jsx(ut.IconRefresh,{})}),e[23]=te,e[24]=ie,e[25]=Ye):Ye=e[25];let et;e[26]!==S||e[27]!==K||e[28]!==oe||e[29]!==m||e[30]!==ee||e[31]!==Z||e[32]!==v?(et=(m.some(Ic)||v)&&(()=>{const De=m.find(Bc)&&(!oe||Z.length>0&&oe(Z[0])),ke=m.find(Lc)&&(!K||Z.length>0&&K(Z[0])),ct=(S??[]).length>0,Ce=De||ke||ct;return y.jsx(O.Box,{...ee?{visibleFrom:"sm"}:{},children:y.jsxs(O.Menu,{shadow:"md",children:[y.jsx(O.Menu.Target,{children:y.jsx(O.Button,{variant:"outline",rightSection:y.jsx(ut.IconCaretDownFilled,{size:14}),disabled:!Z.length||!Ce,children:"Aktionen"})}),y.jsxs(O.Menu.Dropdown,{children:[De&&y.jsx(O.Menu.Item,{leftSection:y.jsx(ut.IconPencil,{size:14}),onClick:()=>Ve(!0),disabled:Z.length!==1,children:"Bearbeiten"}),(S??[]).map((_e,ze)=>J.createElement(O.Menu.Item,{..._e.icon&&{leftSection:_e.icon},key:`custom_action_${ze}`,onClick:()=>_e.onClick(Z)},_e.label)),ke&&y.jsx(O.Menu.Item,{leftSection:y.jsx(ut.IconTrash,{size:14}),onClick:()=>Me(!0),color:"red",children:"Löschen"})]})]})})})(),e[26]=S,e[27]=K,e[28]=oe,e[29]=m,e[30]=ee,e[31]=Z,e[32]=v,e[33]=et):et=e[33];let nt;e[34]!==N||e[35]!==m||e[36]!==I?(nt=m.find(Nc)&&y.jsx(O.Button,{onClick:()=>xe(!0),disabled:I,children:N??"Erstellen"}),e[34]=N,e[35]=m,e[36]=I,e[37]=nt):nt=e[37];let $e;e[38]!==i||e[39]!==Ye||e[40]!==et||e[41]!==nt?($e=y.jsxs(O.Group,{align:"center",gap:"xs",wrap:"wrap",justify:"end",style:rt,children:[Ye,et,nt,i]}),e[38]=i,e[39]=Ye,e[40]=et,e[41]=nt,e[42]=$e):$e=e[42];let ot;e[43]!==Ct||e[44]!==Te||e[45]!==$e?(ot=y.jsxs(O.Group,{gap:"xs",justify:Ct,align:"center",wrap:"wrap",children:[Te,$e]}),e[43]=Ct,e[44]=Te,e[45]=$e,e[46]=ot):ot=e[46];let st;e[47]!==w||e[48]!==a||e[49]!==B?(st=B&&B.length>0&&y.jsx(O.Tabs,{value:w,onChange:a,mt:"md",children:y.jsx(O.Tabs.List,{children:B.map(Rc)})}),e[47]=w,e[48]=a,e[49]=B,e[50]=st):st=e[50];let He;e[51]!==Q?(He=Q&&y.jsx(O.Alert,{mt:"md",variant:"light",color:"red",title:"Es ist ein Fehler aufgetreten.",icon:y.jsx(ut.IconInfoCircle,{}),children:"Bitte versuche es später erneut oder sende eine Nachricht an unseren Support."}),e[51]=Q,e[52]=He):He=e[52];let Ge;e[53]!==I||e[54]!==ne?(Ge=(I||ne)&&y.jsxs(O.Stack,{my:"md",children:[y.jsx(O.Skeleton,{height:40}),Array(5).fill(0).map($c)]}),e[53]=I,e[54]=ne,e[55]=Ge):Ge=e[55];let Qe;e[56]!==S||e[57]!==m||e[58]!==u||e[59]!==Q||e[60]!==I||e[61]!==ne||e[62]!==ee||e[63]!==V||e[64]!==W||e[65]!==A||e[66]!==_||e[67]!==he||e[68]!==q||e[69]!==Z||e[70]!==v||e[71]!==le||e[72]!==R||e[73]!==Y||e[74]!==g?(Qe=!I&&!ne&&y.jsxs(y.Fragment,{children:[y.jsx(O.Box,{...ee?{visibleFrom:"sm"}:{},children:y.jsx(fc,{my:"md",striped:!0,highlightOnHover:!0,minHeight:150,fetching:Q,records:he,sortStatus:Y,onSortStatusChange:u,...v&&{selectedRecords:Z,onSelectedRecordsChange:fe},..._&&he.length&&{totalRecords:g.length,recordsPerPage:A,onPageChange:le,page:W,recordsPerPageOptions:Sn,onRecordsPerPageChange:R,recordsPerPageLabel:"Einträge pro Seite"},...q&&{rowExpansion:{allowMultiple:q.allowMultiple??!1,content:De=>{const{record:ke}=De;return q.content(ke)},...q.expanded&&{expanded:q.expanded}}},columns:m.map(Tc),noRecordsText:"Keine Einträge gefunden",onRowClick:V,...V&&{style:{cursor:"pointer"}}})}),ee&&y.jsx(O.Box,{hiddenFrom:"sm",children:y.jsx(Rs,{records:he,fields:m,selection:v,selectedRecords:Z,onSelectedRecordsChange:fe,onRowClick:V,sort:{field:String(Y.columnAccessor),direction:Y.direction,onSortChange:(De,ke)=>{u({columnAccessor:De,direction:ke})}},..._&&he.length&&{pagination:{totalRecords:g.length,recordsPerPage:A,page:W,onPageChange:le,recordsPerPageOptions:Sn,onRecordsPerPageChange:De=>{R(De),le(1)}}},...q&&{rowExpansion:{content:q.content}},...S&&S.length>0&&{actions:S}})})]}),e[56]=S,e[57]=m,e[58]=u,e[59]=Q,e[60]=I,e[61]=ne,e[62]=ee,e[63]=V,e[64]=W,e[65]=A,e[66]=_,e[67]=he,e[68]=q,e[69]=Z,e[70]=v,e[71]=le,e[72]=R,e[73]=Y,e[74]=g,e[75]=Qe):Qe=e[75];let it;e[76]===Symbol.for("react.memo_cache_sentinel")?(it=()=>{Ve(!1),fe([])},e[76]=it):it=e[76];const yt=r??"Bearbeiten";let at;e[77]!==l||e[78]!==m||e[79]!==d||e[80]!==n||e[81]!==Z[0]||e[82]!==Z.length||e[83]!==C?(at=Z.length>0&&y.jsx(js,{fields:m.filter(Ec),queryKey:n,apiPath:d??l,id:Z[0].id,onClose:()=>{Ve(!1),fe([])},steps:C}),e[77]=l,e[78]=m,e[79]=d,e[80]=n,e[81]=Z[0],e[82]=Z.length,e[83]=C,e[84]=at):at=e[84];let ve;e[85]!==yt||e[86]!==at||e[87]!==Pe?(ve=y.jsx(O.Modal,{opened:Pe,onClose:it,title:yt,children:at}),e[85]=yt,e[86]=at,e[87]=Pe,e[88]=ve):ve=e[88];let Oe;e[89]!==l||e[90]!==Ne||e[91]!==d||e[92]!==n||e[93]!==Z||e[94]!==r?(Oe=Z.length>0&&y.jsx(O.Modal,{opened:Ne,onClose:()=>{Me(!1),fe([])},title:r??"Löschen",children:y.jsx(As,{onClose:()=>{Me(!1),fe([])},queryKey:n,apiPath:d??l,selectedRecords:Z})}),e[89]=l,e[90]=Ne,e[91]=d,e[92]=n,e[93]=Z,e[94]=r,e[95]=Oe):Oe=e[95];let tt;e[96]===Symbol.for("react.memo_cache_sentinel")?(tt=()=>{xe(!1)},e[96]=tt):tt=e[96];const vt=r??"Anlegen",Qt=d??l;let At;e[97]===Symbol.for("react.memo_cache_sentinel")?(At=()=>{xe(!1)},e[97]=At):At=e[97];let bt;e[98]!==m?(bt=m.filter(Ac),e[98]=m,e[99]=bt):bt=e[99];let Ke;e[100]!==n||e[101]!==C||e[102]!==Qt||e[103]!==bt?(Ke=y.jsx(ms,{queryKey:n,apiPath:Qt,onClose:At,fields:bt,steps:C}),e[100]=n,e[101]=C,e[102]=Qt,e[103]=bt,e[104]=Ke):Ke=e[104];let wt;e[105]!==Se||e[106]!==vt||e[107]!==Ke?(wt=y.jsx(O.Modal,{opened:Se,onClose:tt,title:vt,children:Ke}),e[105]=Se,e[106]=vt,e[107]=Ke,e[108]=wt):wt=e[108];let lt;return e[109]!==ot||e[110]!==st||e[111]!==He||e[112]!==Ge||e[113]!==Qe||e[114]!==ve||e[115]!==Oe||e[116]!==wt?(lt=y.jsxs(y.Fragment,{children:[ot,st,He,Ge,Qe,ve,Oe,wt]}),e[109]=ot,e[110]=st,e[111]=He,e[112]=Ge,e[113]=Qe,e[114]=ve,e[115]=Oe,e[116]=wt,e[117]=lt):lt=e[117],lt}function Ac(t){return t.create}function Ec(t){return t.update}function Tc(t){return t.column}function $c(t,e){return y.jsx(O.Skeleton,{height:35},`skeleton-${e}`)}function Rc(t){return y.jsx(O.Tabs.Tab,{value:t.value,leftSection:t.icon,children:t.label},t.value)}function Nc(t){return t.create}function Lc(t){return t.delete}function Bc(t){return t.update}function Ic(t){return t.update}function Yc(t){const[e,r]=t;return`${e}=${encodeURIComponent(r??"")}`}function zc(t){const[,e]=t;return e!=null}function Fc(t){const e=Fe.c(5),{queryClient:r}=ft();let n;e[0]!==t?(n=y.jsx(jc,{...t}),e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==r||e[3]!==n?(s=y.jsx(Kn,{client:r,children:n}),e[2]=r,e[3]=n,e[4]=s):s=e[4],s}be.CreateModal=ms,be.DataTable=Fc,be.DataTableProvider=ml,be.DeleteModal=As,be.MobileCardList=Rs,be.UpdateModal=js,be.api=vl,be.createOne=Wo,be.deleteOne=Fo,be.getAll=Yo,be.getApiHeaders=xt,be.getOne=zo,be.sortData=$s,be.updateOne=Uo,be.useAddOne=Ho,be.useDataTable=ft,be.useDeleteOne=Go,be.useGetAll=Vo,be.useGetOne=qo,be.usePersistentState=Es,be.useUpdateOne=ln,Object.defineProperty(be,Symbol.toStringTag,{value:"Module"})}));
|
|
24
24
|
//# sourceMappingURL=index.umd.js.map
|