formue-crud 0.0.40 → 0.0.41
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/formue-crud.js +582 -574
- package/dist/formue-crud.umd.cjs +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/formue-crud.umd.cjs
CHANGED
@@ -27,7 +27,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
27
27
|
}`;var Z=Gu(function(){return oe(v,N+"return "+F).apply(t,C)});if(Z.source=F,Ao(Z))throw Z;return Z}function G1(n){return ae(n).toLowerCase()}function $1(n){return ae(n).toUpperCase()}function U1(n,s,l){if(n=ae(n),n&&(l||s===t))return Zl(n);if(!n||!(s=je(s)))return n;var c=dt(n),m=dt(s),v=Ql(c,m),C=eh(c,m)+1;return Jt(c,v,C).join("")}function j1(n,s,l){if(n=ae(n),n&&(l||s===t))return n.slice(0,ih(n)+1);if(!n||!(s=je(s)))return n;var c=dt(n),m=eh(c,dt(s))+1;return Jt(c,0,m).join("")}function K1(n,s,l){if(n=ae(n),n&&(l||s===t))return n.replace(Ls,"");if(!n||!(s=je(s)))return n;var c=dt(n),m=Ql(c,dt(s));return Jt(c,m).join("")}function q1(n,s){var l=ze,c=wt;if(me(s)){var m="separator"in s?s.separator:m;l="length"in s?J(s.length):l,c="omission"in s?je(s.omission):c}n=ae(n);var v=n.length;if(Oi(n)){var C=dt(n);v=C.length}if(l>=v)return n;var x=l-zi(c);if(x<1)return c;var R=C?Jt(C,0,x).join(""):n.slice(0,x);if(m===t)return R+c;if(C&&(x+=R.length-x),Do(m)){if(n.slice(x).search(m)){var L,A=R;for(m.global||(m=Ks(m.source,ae(yl.exec(m))+"g")),m.lastIndex=0;L=m.exec(A);)var F=L.index;R=R.slice(0,F===t?x:F)}}else if(n.indexOf(je(m),x)!=x){var O=R.lastIndexOf(m);O>-1&&(R=R.slice(0,O))}return R+c}function X1(n){return n=ae(n),n&&ov.test(n)?n.replace(bl,_w):n}var Y1=Gi(function(n,s,l){return n+(l?" ":"")+s.toUpperCase()}),Oo=$h("toUpperCase");function Wu(n,s,l){return n=ae(n),s=l?t:s,s===t?ww(n)?Sw(n):uw(n):n.match(s)||[]}var Gu=Q(function(n,s){try{return $e(n,t,s)}catch(l){return Ao(l)?l:new q(l)}}),J1=Dt(function(n,s){return et(s,function(l){l=xt(l),Lt(n,l,Mo(n[l],n))}),n});function Z1(n){var s=n==null?0:n.length,l=$();return n=s?pe(n,function(c){if(typeof c[1]!="function")throw new tt(a);return[l(c[0]),c[1]]}):[],Q(function(c){for(var m=-1;++m<s;){var v=n[m];if($e(v[0],this,c))return $e(v[1],this,c)}})}function Q1(n){return _y(nt(n,y))}function zo(n){return function(){return n}}function ex(n,s){return n==null||n!==n?s:n}var tx=jh(),ix=jh(!0);function Be(n){return n}function Ho(n){return Eh(typeof n=="function"?n:nt(n,y))}function nx(n){return _h(nt(n,y))}function rx(n,s){return Rh(n,nt(s,y))}var sx=Q(function(n,s){return function(l){return Rn(l,n,s)}}),ox=Q(function(n,s){return function(l){return Rn(n,l,s)}});function Io(n,s,l){var c=xe(s),m=Cr(s,c);l==null&&!(me(s)&&(m.length||!c.length))&&(l=s,s=n,n=this,m=Cr(s,xe(s)));var v=!(me(l)&&"chain"in l)||!!l.chain,C=Pt(n);return et(m,function(x){var R=s[x];n[x]=R,C&&(n.prototype[x]=function(){var L=this.__chain__;if(v||L){var A=n(this.__wrapped__),F=A.__actions__=He(this.__actions__);return F.push({func:R,args:arguments,thisArg:n}),A.__chain__=L,A}return R.apply(n,Ut([this.value()],arguments))})}),n}function ax(){return _e._===this&&(_e._=Fw),this}function No(){}function lx(n){return n=J(n),Q(function(s){return Th(s,n)})}var hx=go(pe),ux=go(Kl),dx=go(Bs);function $u(n){return xo(n)?Vs(xt(n)):Vy(n)}function cx(n){return function(s){return n==null?t:ci(n,s)}}var fx=qh(),px=qh(!0);function Bo(){return[]}function Vo(){return!1}function mx(){return{}}function gx(){return""}function bx(){return!0}function vx(n,s){if(n=J(n),n<1||n>Gt)return[];var l=yt,c=ke(n,yt);s=$(s),n-=yt;for(var m=$s(c,s);++l<n;)s(l);return m}function wx(n){return Y(n)?pe(n,xt):Ke(n)?[n]:He(uu(ae(n)))}function yx(n){var s=++Aw;return ae(n)+s}var Cx=Sr(function(n,s){return n+s},0),Ex=bo("ceil"),xx=Sr(function(n,s){return n/s},1),_x=bo("floor");function Rx(n){return n&&n.length?yr(n,Be,to):t}function Tx(n,s){return n&&n.length?yr(n,$(s,2),to):t}function Sx(n){return Yl(n,Be)}function kx(n,s){return Yl(n,$(s,2))}function Mx(n){return n&&n.length?yr(n,Be,so):t}function Lx(n,s){return n&&n.length?yr(n,$(s,2),so):t}var Ax=Sr(function(n,s){return n*s},1),Dx=bo("round"),Fx=Sr(function(n,s){return n-s},0);function Px(n){return n&&n.length?Gs(n,Be):0}function Ox(n,s){return n&&n.length?Gs(n,$(s,2)):0}return b.after=nE,b.ary=Cu,b.assign=$E,b.assignIn=Ou,b.assignInWith=Br,b.assignWith=UE,b.at=jE,b.before=Eu,b.bind=Mo,b.bindAll=J1,b.bindKey=xu,b.castArray=mE,b.chain=vu,b.chunk=_C,b.compact=RC,b.concat=TC,b.cond=Z1,b.conforms=Q1,b.constant=zo,b.countBy=P0,b.create=KE,b.curry=_u,b.curryRight=Ru,b.debounce=Tu,b.defaults=qE,b.defaultsDeep=XE,b.defer=rE,b.delay=sE,b.difference=SC,b.differenceBy=kC,b.differenceWith=MC,b.drop=LC,b.dropRight=AC,b.dropRightWhile=DC,b.dropWhile=FC,b.fill=PC,b.filter=z0,b.flatMap=N0,b.flatMapDeep=B0,b.flatMapDepth=V0,b.flatten=pu,b.flattenDeep=OC,b.flattenDepth=zC,b.flip=oE,b.flow=tx,b.flowRight=ix,b.fromPairs=HC,b.functions=i1,b.functionsIn=n1,b.groupBy=W0,b.initial=NC,b.intersection=BC,b.intersectionBy=VC,b.intersectionWith=WC,b.invert=s1,b.invertBy=o1,b.invokeMap=$0,b.iteratee=Ho,b.keyBy=U0,b.keys=xe,b.keysIn=Ne,b.map=Pr,b.mapKeys=l1,b.mapValues=h1,b.matches=nx,b.matchesProperty=rx,b.memoize=zr,b.merge=u1,b.mergeWith=zu,b.method=sx,b.methodOf=ox,b.mixin=Io,b.negate=Hr,b.nthArg=lx,b.omit=d1,b.omitBy=c1,b.once=aE,b.orderBy=j0,b.over=hx,b.overArgs=lE,b.overEvery=ux,b.overSome=dx,b.partial=Lo,b.partialRight=Su,b.partition=K0,b.pick=f1,b.pickBy=Hu,b.property=$u,b.propertyOf=cx,b.pull=jC,b.pullAll=gu,b.pullAllBy=KC,b.pullAllWith=qC,b.pullAt=XC,b.range=fx,b.rangeRight=px,b.rearg=hE,b.reject=Y0,b.remove=YC,b.rest=uE,b.reverse=So,b.sampleSize=Z0,b.set=m1,b.setWith=g1,b.shuffle=Q0,b.slice=JC,b.sortBy=iE,b.sortedUniq=r0,b.sortedUniqBy=s0,b.split=N1,b.spread=dE,b.tail=o0,b.take=a0,b.takeRight=l0,b.takeRightWhile=h0,b.takeWhile=u0,b.tap=R0,b.throttle=cE,b.thru=Fr,b.toArray=Du,b.toPairs=Iu,b.toPairsIn=Nu,b.toPath=wx,b.toPlainObject=Pu,b.transform=b1,b.unary=fE,b.union=d0,b.unionBy=c0,b.unionWith=f0,b.uniq=p0,b.uniqBy=m0,b.uniqWith=g0,b.unset=v1,b.unzip=ko,b.unzipWith=bu,b.update=w1,b.updateWith=y1,b.values=ji,b.valuesIn=C1,b.without=b0,b.words=Wu,b.wrap=pE,b.xor=v0,b.xorBy=w0,b.xorWith=y0,b.zip=C0,b.zipObject=E0,b.zipObjectDeep=x0,b.zipWith=_0,b.entries=Iu,b.entriesIn=Nu,b.extend=Ou,b.extendWith=Br,Io(b,b),b.add=Cx,b.attempt=Gu,b.camelCase=R1,b.capitalize=Bu,b.ceil=Ex,b.clamp=E1,b.clone=gE,b.cloneDeep=vE,b.cloneDeepWith=wE,b.cloneWith=bE,b.conformsTo=yE,b.deburr=Vu,b.defaultTo=ex,b.divide=xx,b.endsWith=T1,b.eq=ft,b.escape=S1,b.escapeRegExp=k1,b.every=O0,b.find=H0,b.findIndex=cu,b.findKey=YE,b.findLast=I0,b.findLastIndex=fu,b.findLastKey=JE,b.floor=_x,b.forEach=wu,b.forEachRight=yu,b.forIn=ZE,b.forInRight=QE,b.forOwn=e1,b.forOwnRight=t1,b.get=Fo,b.gt=CE,b.gte=EE,b.has=r1,b.hasIn=Po,b.head=mu,b.identity=Be,b.includes=G0,b.indexOf=IC,b.inRange=x1,b.invoke=a1,b.isArguments=mi,b.isArray=Y,b.isArrayBuffer=xE,b.isArrayLike=Ie,b.isArrayLikeObject=be,b.isBoolean=_E,b.isBuffer=Zt,b.isDate=RE,b.isElement=TE,b.isEmpty=SE,b.isEqual=kE,b.isEqualWith=ME,b.isError=Ao,b.isFinite=LE,b.isFunction=Pt,b.isInteger=ku,b.isLength=Ir,b.isMap=Mu,b.isMatch=AE,b.isMatchWith=DE,b.isNaN=FE,b.isNative=PE,b.isNil=zE,b.isNull=OE,b.isNumber=Lu,b.isObject=me,b.isObjectLike=ge,b.isPlainObject=An,b.isRegExp=Do,b.isSafeInteger=HE,b.isSet=Au,b.isString=Nr,b.isSymbol=Ke,b.isTypedArray=Ui,b.isUndefined=IE,b.isWeakMap=NE,b.isWeakSet=BE,b.join=GC,b.kebabCase=M1,b.last=st,b.lastIndexOf=$C,b.lowerCase=L1,b.lowerFirst=A1,b.lt=VE,b.lte=WE,b.max=Rx,b.maxBy=Tx,b.mean=Sx,b.meanBy=kx,b.min=Mx,b.minBy=Lx,b.stubArray=Bo,b.stubFalse=Vo,b.stubObject=mx,b.stubString=gx,b.stubTrue=bx,b.multiply=Ax,b.nth=UC,b.noConflict=ax,b.noop=No,b.now=Or,b.pad=D1,b.padEnd=F1,b.padStart=P1,b.parseInt=O1,b.random=_1,b.reduce=q0,b.reduceRight=X0,b.repeat=z1,b.replace=H1,b.result=p1,b.round=Dx,b.runInContext=_,b.sample=J0,b.size=eE,b.snakeCase=I1,b.some=tE,b.sortedIndex=ZC,b.sortedIndexBy=QC,b.sortedIndexOf=e0,b.sortedLastIndex=t0,b.sortedLastIndexBy=i0,b.sortedLastIndexOf=n0,b.startCase=B1,b.startsWith=V1,b.subtract=Fx,b.sum=Px,b.sumBy=Ox,b.template=W1,b.times=vx,b.toFinite=Ot,b.toInteger=J,b.toLength=Fu,b.toLower=G1,b.toNumber=ot,b.toSafeInteger=GE,b.toString=ae,b.toUpper=$1,b.trim=U1,b.trimEnd=j1,b.trimStart=K1,b.truncate=q1,b.unescape=X1,b.uniqueId=yx,b.upperCase=Y1,b.upperFirst=Oo,b.each=wu,b.eachRight=yu,b.first=mu,Io(b,function(){var n={};return Ct(b,function(s,l){he.call(b.prototype,l)||(n[l]=s)}),n}(),{chain:!1}),b.VERSION=i,et(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){b[n].placeholder=b}),et(["drop","take"],function(n,s){ne.prototype[n]=function(l){l=l===t?1:ye(J(l),0);var c=this.__filtered__&&!s?new ne(this):this.clone();return c.__filtered__?c.__takeCount__=ke(l,c.__takeCount__):c.__views__.push({size:ke(l,yt),type:n+(c.__dir__<0?"Right":"")}),c},ne.prototype[n+"Right"]=function(l){return this.reverse()[n](l).reverse()}}),et(["filter","map","takeWhile"],function(n,s){var l=s+1,c=l==Ze||l==Wt;ne.prototype[n]=function(m){var v=this.clone();return v.__iteratees__.push({iteratee:$(m,3),type:l}),v.__filtered__=v.__filtered__||c,v}}),et(["head","last"],function(n,s){var l="take"+(s?"Right":"");ne.prototype[n]=function(){return this[l](1).value()[0]}}),et(["initial","tail"],function(n,s){var l="drop"+(s?"":"Right");ne.prototype[n]=function(){return this.__filtered__?new ne(this):this[l](1)}}),ne.prototype.compact=function(){return this.filter(Be)},ne.prototype.find=function(n){return this.filter(n).head()},ne.prototype.findLast=function(n){return this.reverse().find(n)},ne.prototype.invokeMap=Q(function(n,s){return typeof n=="function"?new ne(this):this.map(function(l){return Rn(l,n,s)})}),ne.prototype.reject=function(n){return this.filter(Hr($(n)))},ne.prototype.slice=function(n,s){n=J(n);var l=this;return l.__filtered__&&(n>0||s<0)?new ne(l):(n<0?l=l.takeRight(-n):n&&(l=l.drop(n)),s!==t&&(s=J(s),l=s<0?l.dropRight(-s):l.take(s-n)),l)},ne.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},ne.prototype.toArray=function(){return this.take(yt)},Ct(ne.prototype,function(n,s){var l=/^(?:filter|find|map|reject)|While$/.test(s),c=/^(?:head|last)$/.test(s),m=b[c?"take"+(s=="last"?"Right":""):s],v=c||/^find/.test(s);m&&(b.prototype[s]=function(){var C=this.__wrapped__,x=c?[1]:arguments,R=C instanceof ne,L=x[0],A=R||Y(C),F=function(te){var re=m.apply(b,Ut([te],x));return c&&O?re[0]:re};A&&l&&typeof L=="function"&&L.length!=1&&(R=A=!1);var O=this.__chain__,N=!!this.__actions__.length,U=v&&!O,Z=R&&!N;if(!v&&A){C=Z?C:new ne(this);var j=n.apply(C,x);return j.__actions__.push({func:Fr,args:[F],thisArg:t}),new it(j,O)}return U&&Z?n.apply(this,x):(j=this.thru(F),U?c?j.value()[0]:j.value():j)})}),et(["pop","push","shift","sort","splice","unshift"],function(n){var s=sr[n],l=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",c=/^(?:pop|shift)$/.test(n);b.prototype[n]=function(){var m=arguments;if(c&&!this.__chain__){var v=this.value();return s.apply(Y(v)?v:[],m)}return this[l](function(C){return s.apply(Y(C)?C:[],m)})}}),Ct(ne.prototype,function(n,s){var l=b[s];if(l){var c=l.name+"";he.call(Bi,c)||(Bi[c]=[]),Bi[c].push({name:s,func:l})}}),Bi[Tr(t,k).name]=[{name:"wrapper",func:t}],ne.prototype.clone=Xw,ne.prototype.reverse=Yw,ne.prototype.value=Jw,b.prototype.at=T0,b.prototype.chain=S0,b.prototype.commit=k0,b.prototype.next=M0,b.prototype.plant=A0,b.prototype.reverse=D0,b.prototype.toJSON=b.prototype.valueOf=b.prototype.value=F0,b.prototype.first=b.prototype.head,vn&&(b.prototype[vn]=L0),b},Hi=kw();ai?((ai.exports=Hi)._=Hi,zs._=Hi):_e._=Hi}).call(Ki)}(Dn,Dn.exports);var W=Dn.exports;const Vr=h=>W.upperFirst(W.camelCase(h));var qu=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),i=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var r=42;e[t]=r;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(e,t);if(a.value!==r||a.enumerable!==!0)return!1}return!0},Go=typeof Symbol<"u"&&Symbol,Xu=qu,Yu=function(){return typeof Go!="function"||typeof Symbol!="function"||typeof Go("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Xu()},$o={foo:{}},Ju=Object,Zu=function(){return{__proto__:$o}.foo===$o.foo&&!({__proto__:null}instanceof Ju)},Qu="Function.prototype.bind called on incompatible ",Wr=Array.prototype.slice,ed=Object.prototype.toString,td="[object Function]",id=function(e){var t=this;if(typeof t!="function"||ed.call(t)!==td)throw new TypeError(Qu+t);for(var i=Wr.call(arguments,1),r,o=function(){if(this instanceof r){var g=t.apply(this,i.concat(Wr.call(arguments)));return Object(g)===g?g:this}else return t.apply(e,i.concat(Wr.call(arguments)))},a=Math.max(0,t.length-i.length),u=[],d=0;d<a;d++)u.push("$"+d);if(r=Function("binder","return function ("+u.join(",")+"){ return binder.apply(this,arguments); }")(o),t.prototype){var f=function(){};f.prototype=t.prototype,r.prototype=new f,f.prototype=null}return r},nd=id,Gr=Function.prototype.bind||nd,rd=Gr,sd=rd.call(Function.call,Object.prototype.hasOwnProperty),ie,gi=SyntaxError,Uo=Function,bi=TypeError,$r=function(h){try{return Uo('"use strict"; return ('+h+").constructor;")()}catch{}},Qt=Object.getOwnPropertyDescriptor;if(Qt)try{Qt({},"")}catch{Qt=null}var Ur=function(){throw new bi},od=Qt?function(){try{return arguments.callee,Ur}catch{try{return Qt(arguments,"callee").get}catch{return Ur}}}():Ur,vi=Yu(),ad=Zu(),Ce=Object.getPrototypeOf||(ad?function(h){return h.__proto__}:null),wi={},ld=typeof Uint8Array>"u"||!Ce?ie:Ce(Uint8Array),ei={"%AggregateError%":typeof AggregateError>"u"?ie:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ie:ArrayBuffer,"%ArrayIteratorPrototype%":vi&&Ce?Ce([][Symbol.iterator]()):ie,"%AsyncFromSyncIteratorPrototype%":ie,"%AsyncFunction%":wi,"%AsyncGenerator%":wi,"%AsyncGeneratorFunction%":wi,"%AsyncIteratorPrototype%":wi,"%Atomics%":typeof Atomics>"u"?ie:Atomics,"%BigInt%":typeof BigInt>"u"?ie:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ie:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ie:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ie:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?ie:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ie:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ie:FinalizationRegistry,"%Function%":Uo,"%GeneratorFunction%":wi,"%Int8Array%":typeof Int8Array>"u"?ie:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ie:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ie:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":vi&&Ce?Ce(Ce([][Symbol.iterator]())):ie,"%JSON%":typeof JSON=="object"?JSON:ie,"%Map%":typeof Map>"u"?ie:Map,"%MapIteratorPrototype%":typeof Map>"u"||!vi||!Ce?ie:Ce(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ie:Promise,"%Proxy%":typeof Proxy>"u"?ie:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?ie:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ie:Set,"%SetIteratorPrototype%":typeof Set>"u"||!vi||!Ce?ie:Ce(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ie:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":vi&&Ce?Ce(""[Symbol.iterator]()):ie,"%Symbol%":vi?Symbol:ie,"%SyntaxError%":gi,"%ThrowTypeError%":od,"%TypedArray%":ld,"%TypeError%":bi,"%Uint8Array%":typeof Uint8Array>"u"?ie:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ie:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ie:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ie:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?ie:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ie:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ie:WeakSet};if(Ce)try{null.error}catch(h){var hd=Ce(Ce(h));ei["%Error.prototype%"]=hd}var ud=function h(e){var t;if(e==="%AsyncFunction%")t=$r("async function () {}");else if(e==="%GeneratorFunction%")t=$r("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=$r("async function* () {}");else if(e==="%AsyncGenerator%"){var i=h("%AsyncGeneratorFunction%");i&&(t=i.prototype)}else if(e==="%AsyncIteratorPrototype%"){var r=h("%AsyncGenerator%");r&&Ce&&(t=Ce(r.prototype))}return ei[e]=t,t},jo={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},qi=Gr,Fn=sd,dd=qi.call(Function.call,Array.prototype.concat),cd=qi.call(Function.apply,Array.prototype.splice),Ko=qi.call(Function.call,String.prototype.replace),Pn=qi.call(Function.call,String.prototype.slice),fd=qi.call(Function.call,RegExp.prototype.exec),pd=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,md=/\\(\\)?/g,gd=function(e){var t=Pn(e,0,1),i=Pn(e,-1);if(t==="%"&&i!=="%")throw new gi("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&t!=="%")throw new gi("invalid intrinsic syntax, expected opening `%`");var r=[];return Ko(e,pd,function(o,a,u,d){r[r.length]=u?Ko(d,md,"$1"):a||o}),r},bd=function(e,t){var i=e,r;if(Fn(jo,i)&&(r=jo[i],i="%"+r[0]+"%"),Fn(ei,i)){var o=ei[i];if(o===wi&&(o=ud(i)),typeof o>"u"&&!t)throw new bi("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:i,value:o}}throw new gi("intrinsic "+e+" does not exist!")},jr=function(e,t){if(typeof e!="string"||e.length===0)throw new bi("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new bi('"allowMissing" argument must be a boolean');if(fd(/^%?[^%]*%?$/,e)===null)throw new gi("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=gd(e),r=i.length>0?i[0]:"",o=bd("%"+r+"%",t),a=o.name,u=o.value,d=!1,f=o.alias;f&&(r=f[0],cd(i,dd([0,1],f)));for(var g=1,y=!0;g<i.length;g+=1){var w=i[g],E=Pn(w,0,1),S=Pn(w,-1);if((E==='"'||E==="'"||E==="`"||S==='"'||S==="'"||S==="`")&&E!==S)throw new gi("property names with quotes must have matching quotes");if((w==="constructor"||!y)&&(d=!0),r+="."+w,a="%"+r+"%",Fn(ei,a))u=ei[a];else if(u!=null){if(!(w in u)){if(!t)throw new bi("base intrinsic for "+e+" exists, but the property is not available.");return}if(Qt&&g+1>=i.length){var D=Qt(u,w);y=!!D,y&&"get"in D&&!("originalValue"in D.get)?u=D.get:u=u[w]}else y=Fn(u,w),u=u[w];y&&!d&&(ei[a]=u)}}return u},qo={exports:{}};(function(h){var e=Gr,t=jr,i=t("%Function.prototype.apply%"),r=t("%Function.prototype.call%"),o=t("%Reflect.apply%",!0)||e.call(r,i),a=t("%Object.getOwnPropertyDescriptor%",!0),u=t("%Object.defineProperty%",!0),d=t("%Math.max%");if(u)try{u({},"a",{value:1})}catch{u=null}h.exports=function(y){var w=o(e,r,arguments);if(a&&u){var E=a(w,"length");E.configurable&&u(w,"length",{value:1+d(0,y.length-(arguments.length-1))})}return w};var f=function(){return o(e,i,arguments)};u?u(h.exports,"apply",{value:f}):h.exports.apply=f})(qo);var vd=qo.exports,Xo=jr,Yo=vd,wd=Yo(Xo("String.prototype.indexOf")),yd=function(e,t){var i=Xo(e,!!t);return typeof i=="function"&&wd(e,".prototype.")>-1?Yo(i):i};const Cd=Ku(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Kr=typeof Map=="function"&&Map.prototype,qr=Object.getOwnPropertyDescriptor&&Kr?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,On=Kr&&qr&&typeof qr.get=="function"?qr.get:null,Jo=Kr&&Map.prototype.forEach,Xr=typeof Set=="function"&&Set.prototype,Yr=Object.getOwnPropertyDescriptor&&Xr?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,zn=Xr&&Yr&&typeof Yr.get=="function"?Yr.get:null,Zo=Xr&&Set.prototype.forEach,Ed=typeof WeakMap=="function"&&WeakMap.prototype,Xi=Ed?WeakMap.prototype.has:null,xd=typeof WeakSet=="function"&&WeakSet.prototype,Yi=xd?WeakSet.prototype.has:null,_d=typeof WeakRef=="function"&&WeakRef.prototype,Qo=_d?WeakRef.prototype.deref:null,Rd=Boolean.prototype.valueOf,Td=Object.prototype.toString,Sd=Function.prototype.toString,kd=String.prototype.match,Jr=String.prototype.slice,Ht=String.prototype.replace,Md=String.prototype.toUpperCase,ea=String.prototype.toLowerCase,ta=RegExp.prototype.test,ia=Array.prototype.concat,gt=Array.prototype.join,Ld=Array.prototype.slice,na=Math.floor,Zr=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Qr=Object.getOwnPropertySymbols,es=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,yi=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Te=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===yi||"symbol")?Symbol.toStringTag:null,ra=Object.prototype.propertyIsEnumerable,sa=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(h){return h.__proto__}:null);function oa(h,e){if(h===1/0||h===-1/0||h!==h||h&&h>-1e3&&h<1e3||ta.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof h=="number"){var i=h<0?-na(-h):na(h);if(i!==h){var r=String(i),o=Jr.call(e,r.length+1);return Ht.call(r,t,"$&_")+"."+Ht.call(Ht.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ht.call(e,t,"$&_")}var ts=Cd,aa=ts.custom,la=da(aa)?aa:null,Ad=function h(e,t,i,r){var o=t||{};if(It(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(It(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=It(o,"customInspect")?o.customInspect:!0;if(typeof a!="boolean"&&a!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(It(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(It(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var u=o.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return fa(e,o);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var d=String(e);return u?oa(e,d):d}if(typeof e=="bigint"){var f=String(e)+"n";return u?oa(e,f):f}var g=typeof o.depth>"u"?5:o.depth;if(typeof i>"u"&&(i=0),i>=g&&g>0&&typeof e=="object")return is(e)?"[Array]":"[Object]";var y=Xd(o,i);if(typeof r>"u")r=[];else if(ca(r,e)>=0)return"[Circular]";function w(Je,Ze,Li){if(Ze&&(r=Ld.call(r),r.push(Ze)),Li){var Wt={depth:o.depth};return It(o,"quoteStyle")&&(Wt.quoteStyle=o.quoteStyle),h(Je,Wt,i+1,r)}return h(Je,o,i+1,r)}if(typeof e=="function"&&!ua(e)){var E=Bd(e),S=Hn(e,w);return"[Function"+(E?": "+E:" (anonymous)")+"]"+(S.length>0?" { "+gt.call(S,", ")+" }":"")}if(da(e)){var D=yi?Ht.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):es.call(e);return typeof e=="object"&&!yi?Ji(D):D}if(jd(e)){for(var P="<"+ea.call(String(e.nodeName)),k=e.attributes||[],G=0;G<k.length;G++)P+=" "+k[G].name+"="+ha(Dd(k[G].value),"double",o);return P+=">",e.childNodes&&e.childNodes.length&&(P+="..."),P+="</"+ea.call(String(e.nodeName))+">",P}if(is(e)){if(e.length===0)return"[]";var K=Hn(e,w);return y&&!qd(K)?"["+rs(K,y)+"]":"[ "+gt.call(K,", ")+" ]"}if(Pd(e)){var z=Hn(e,w);return!("cause"in Error.prototype)&&"cause"in e&&!ra.call(e,"cause")?"{ ["+String(e)+"] "+gt.call(ia.call("[cause]: "+w(e.cause),z),", ")+" }":z.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+gt.call(z,", ")+" }"}if(typeof e=="object"&&a){if(la&&typeof e[la]=="function"&&ts)return ts(e,{depth:g-i});if(a!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(Vd(e)){var V=[];return Jo&&Jo.call(e,function(Je,Ze){V.push(w(Ze,e,!0)+" => "+w(Je,e))}),pa("Map",On.call(e),V,y)}if($d(e)){var se=[];return Zo&&Zo.call(e,function(Je){se.push(w(Je,e))}),pa("Set",zn.call(e),se,y)}if(Wd(e))return ns("WeakMap");if(Ud(e))return ns("WeakSet");if(Gd(e))return ns("WeakRef");if(zd(e))return Ji(w(Number(e)));if(Id(e))return Ji(w(Zr.call(e)));if(Hd(e))return Ji(Rd.call(e));if(Od(e))return Ji(w(String(e)));if(!Fd(e)&&!ua(e)){var B=Hn(e,w),H=sa?sa(e)===Object.prototype:e instanceof Object||e.constructor===Object,le=e instanceof Object?"":"null prototype",ze=!H&&Te&&Object(e)===e&&Te in e?Jr.call(Nt(e),8,-1):le?"Object":"",wt=H||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",X=wt+(ze||le?"["+gt.call(ia.call([],ze||[],le||[]),": ")+"] ":"");return B.length===0?X+"{}":y?X+"{"+rs(B,y)+"}":X+"{ "+gt.call(B,", ")+" }"}return String(e)};function ha(h,e,t){var i=(t.quoteStyle||e)==="double"?'"':"'";return i+h+i}function Dd(h){return Ht.call(String(h),/"/g,""")}function is(h){return Nt(h)==="[object Array]"&&(!Te||!(typeof h=="object"&&Te in h))}function Fd(h){return Nt(h)==="[object Date]"&&(!Te||!(typeof h=="object"&&Te in h))}function ua(h){return Nt(h)==="[object RegExp]"&&(!Te||!(typeof h=="object"&&Te in h))}function Pd(h){return Nt(h)==="[object Error]"&&(!Te||!(typeof h=="object"&&Te in h))}function Od(h){return Nt(h)==="[object String]"&&(!Te||!(typeof h=="object"&&Te in h))}function zd(h){return Nt(h)==="[object Number]"&&(!Te||!(typeof h=="object"&&Te in h))}function Hd(h){return Nt(h)==="[object Boolean]"&&(!Te||!(typeof h=="object"&&Te in h))}function da(h){if(yi)return h&&typeof h=="object"&&h instanceof Symbol;if(typeof h=="symbol")return!0;if(!h||typeof h!="object"||!es)return!1;try{return es.call(h),!0}catch{}return!1}function Id(h){if(!h||typeof h!="object"||!Zr)return!1;try{return Zr.call(h),!0}catch{}return!1}var Nd=Object.prototype.hasOwnProperty||function(h){return h in this};function It(h,e){return Nd.call(h,e)}function Nt(h){return Td.call(h)}function Bd(h){if(h.name)return h.name;var e=kd.call(Sd.call(h),/^function\s*([\w$]+)/);return e?e[1]:null}function ca(h,e){if(h.indexOf)return h.indexOf(e);for(var t=0,i=h.length;t<i;t++)if(h[t]===e)return t;return-1}function Vd(h){if(!On||!h||typeof h!="object")return!1;try{On.call(h);try{zn.call(h)}catch{return!0}return h instanceof Map}catch{}return!1}function Wd(h){if(!Xi||!h||typeof h!="object")return!1;try{Xi.call(h,Xi);try{Yi.call(h,Yi)}catch{return!0}return h instanceof WeakMap}catch{}return!1}function Gd(h){if(!Qo||!h||typeof h!="object")return!1;try{return Qo.call(h),!0}catch{}return!1}function $d(h){if(!zn||!h||typeof h!="object")return!1;try{zn.call(h);try{On.call(h)}catch{return!0}return h instanceof Set}catch{}return!1}function Ud(h){if(!Yi||!h||typeof h!="object")return!1;try{Yi.call(h,Yi);try{Xi.call(h,Xi)}catch{return!0}return h instanceof WeakSet}catch{}return!1}function jd(h){return!h||typeof h!="object"?!1:typeof HTMLElement<"u"&&h instanceof HTMLElement?!0:typeof h.nodeName=="string"&&typeof h.getAttribute=="function"}function fa(h,e){if(h.length>e.maxStringLength){var t=h.length-e.maxStringLength,i="... "+t+" more character"+(t>1?"s":"");return fa(Jr.call(h,0,e.maxStringLength),e)+i}var r=Ht.call(Ht.call(h,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Kd);return ha(r,"single",e)}function Kd(h){var e=h.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+Md.call(e.toString(16))}function Ji(h){return"Object("+h+")"}function ns(h){return h+" { ? }"}function pa(h,e,t,i){var r=i?rs(t,i):gt.call(t,", ");return h+" ("+e+") {"+r+"}"}function qd(h){for(var e=0;e<h.length;e++)if(ca(h[e],`
|
28
28
|
`)>=0)return!1;return!0}function Xd(h,e){var t;if(h.indent===" ")t=" ";else if(typeof h.indent=="number"&&h.indent>0)t=gt.call(Array(h.indent+1)," ");else return null;return{base:t,prev:gt.call(Array(e+1),t)}}function rs(h,e){if(h.length===0)return"";var t=`
|
29
29
|
`+e.prev+e.base;return t+gt.call(h,","+t)+`
|
30
|
-
`+e.prev}function Hn(h,e){var t=is(h),i=[];if(t){i.length=h.length;for(var r=0;r<h.length;r++)i[r]=It(h,r)?e(h[r],h):""}var o=typeof Qr=="function"?Qr(h):[],a;if(yi){a={};for(var u=0;u<o.length;u++)a["$"+o[u]]=o[u]}for(var d in h)It(h,d)&&(t&&String(Number(d))===d&&d<h.length||yi&&a["$"+d]instanceof Symbol||(ta.call(/[^\w$]/,d)?i.push(e(d,h)+": "+e(h[d],h)):i.push(d+": "+e(h[d],h))));if(typeof Qr=="function")for(var f=0;f<o.length;f++)ra.call(h,o[f])&&i.push("["+e(o[f])+"]: "+e(h[o[f]],h));return i}var ss=jr,Ci=yd,Yd=Ad,Jd=ss("%TypeError%"),In=ss("%WeakMap%",!0),Nn=ss("%Map%",!0),Zd=Ci("WeakMap.prototype.get",!0),Qd=Ci("WeakMap.prototype.set",!0),ec=Ci("WeakMap.prototype.has",!0),tc=Ci("Map.prototype.get",!0),ic=Ci("Map.prototype.set",!0),nc=Ci("Map.prototype.has",!0),os=function(h,e){for(var t=h,i;(i=t.next)!==null;t=i)if(i.key===e)return t.next=i.next,i.next=h.next,h.next=i,i},rc=function(h,e){var t=os(h,e);return t&&t.value},sc=function(h,e,t){var i=os(h,e);i?i.value=t:h.next={key:e,next:h.next,value:t}},oc=function(h,e){return!!os(h,e)},ac=function(){var e,t,i,r={assert:function(o){if(!r.has(o))throw new Jd("Side channel does not contain "+Yd(o))},get:function(o){if(In&&o&&(typeof o=="object"||typeof o=="function")){if(e)return Zd(e,o)}else if(Nn){if(t)return tc(t,o)}else if(i)return rc(i,o)},has:function(o){if(In&&o&&(typeof o=="object"||typeof o=="function")){if(e)return ec(e,o)}else if(Nn){if(t)return nc(t,o)}else if(i)return oc(i,o);return!1},set:function(o,a){In&&o&&(typeof o=="object"||typeof o=="function")?(e||(e=new In),Qd(e,o,a)):Nn?(t||(t=new Nn),ic(t,o,a)):(i||(i={key:{},next:null}),sc(i,o,a))}};return r},lc=String.prototype.replace,hc=/%20/g,as={RFC1738:"RFC1738",RFC3986:"RFC3986"},ls={default:as.RFC3986,formatters:{RFC1738:function(h){return lc.call(h,hc,"+")},RFC3986:function(h){return String(h)}},RFC1738:as.RFC1738,RFC3986:as.RFC3986},uc=ls,hs=Object.prototype.hasOwnProperty,ti=Array.isArray,bt=function(){for(var h=[],e=0;e<256;++e)h.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return h}(),dc=function(e){for(;e.length>1;){var t=e.pop(),i=t.obj[t.prop];if(ti(i)){for(var r=[],o=0;o<i.length;++o)typeof i[o]<"u"&&r.push(i[o]);t.obj[t.prop]=r}}},ma=function(e,t){for(var i=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)typeof e[r]<"u"&&(i[r]=e[r]);return i},cc=function h(e,t,i){if(!t)return e;if(typeof t!="object"){if(ti(e))e.push(t);else if(e&&typeof e=="object")(i&&(i.plainObjects||i.allowPrototypes)||!hs.call(Object.prototype,t))&&(e[t]=!0);else return[e,t];return e}if(!e||typeof e!="object")return[e].concat(t);var r=e;return ti(e)&&!ti(t)&&(r=ma(e,i)),ti(e)&&ti(t)?(t.forEach(function(o,a){if(hs.call(e,a)){var u=e[a];u&&typeof u=="object"&&o&&typeof o=="object"?e[a]=h(u,o,i):e.push(o)}else e[a]=o}),e):Object.keys(t).reduce(function(o,a){var u=t[a];return hs.call(o,a)?o[a]=h(o[a],u,i):o[a]=u,o},r)},fc=function(e,t){return Object.keys(t).reduce(function(i,r){return i[r]=t[r],i},e)},pc=function(h,e,t){var i=h.replace(/\+/g," ");if(t==="iso-8859-1")return i.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(i)}catch{return i}},mc=function(e,t,i,r,o){if(e.length===0)return e;var a=e;if(typeof e=="symbol"?a=Symbol.prototype.toString.call(e):typeof e!="string"&&(a=String(e)),i==="iso-8859-1")return escape(a).replace(/%u[0-9a-f]{4}/gi,function(g){return"%26%23"+parseInt(g.slice(2),16)+"%3B"});for(var u="",d=0;d<a.length;++d){var f=a.charCodeAt(d);if(f===45||f===46||f===95||f===126||f>=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||o===uc.RFC1738&&(f===40||f===41)){u+=a.charAt(d);continue}if(f<128){u=u+bt[f];continue}if(f<2048){u=u+(bt[192|f>>6]+bt[128|f&63]);continue}if(f<55296||f>=57344){u=u+(bt[224|f>>12]+bt[128|f>>6&63]+bt[128|f&63]);continue}d+=1,f=65536+((f&1023)<<10|a.charCodeAt(d)&1023),u+=bt[240|f>>18]+bt[128|f>>12&63]+bt[128|f>>6&63]+bt[128|f&63]}return u},gc=function(e){for(var t=[{obj:{o:e},prop:"o"}],i=[],r=0;r<t.length;++r)for(var o=t[r],a=o.obj[o.prop],u=Object.keys(a),d=0;d<u.length;++d){var f=u[d],g=a[f];typeof g=="object"&&g!==null&&i.indexOf(g)===-1&&(t.push({obj:a,prop:f}),i.push(g))}return dc(t),e},bc=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},vc=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},wc=function(e,t){return[].concat(e,t)},yc=function(e,t){if(ti(e)){for(var i=[],r=0;r<e.length;r+=1)i.push(t(e[r]));return i}return t(e)},ga={arrayToObject:ma,assign:fc,combine:wc,compact:gc,decode:pc,encode:mc,isBuffer:vc,isRegExp:bc,maybeMap:yc,merge:cc},ba=ac,Bn=ga,Zi=ls,Cc=Object.prototype.hasOwnProperty,va={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},_t=Array.isArray,Ec=Array.prototype.push,wa=function(h,e){Ec.apply(h,_t(e)?e:[e])},xc=Date.prototype.toISOString,ya=Zi.default,Se={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Bn.encode,encodeValuesOnly:!1,format:ya,formatter:Zi.formatters[ya],indices:!1,serializeDate:function(e){return xc.call(e)},skipNulls:!1,strictNullHandling:!1},_c=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},us={},Rc=function h(e,t,i,r,o,a,u,d,f,g,y,w,E,S,D,P){for(var k=e,G=P,K=0,z=!1;(G=G.get(us))!==void 0&&!z;){var V=G.get(e);if(K+=1,typeof V<"u"){if(V===K)throw new RangeError("Cyclic object value");z=!0}typeof G.get(us)>"u"&&(K=0)}if(typeof d=="function"?k=d(t,k):k instanceof Date?k=y(k):i==="comma"&&_t(k)&&(k=Bn.maybeMap(k,function(Wt){return Wt instanceof Date?y(Wt):Wt})),k===null){if(o)return u&&!S?u(t,Se.encoder,D,"key",w):t;k=""}if(_c(k)||Bn.isBuffer(k)){if(u){var se=S?t:u(t,Se.encoder,D,"key",w);return[E(se)+"="+E(u(k,Se.encoder,D,"value",w))]}return[E(t)+"="+E(String(k))]}var B=[];if(typeof k>"u")return B;var H;if(i==="comma"&&_t(k))S&&u&&(k=Bn.maybeMap(k,u)),H=[{value:k.length>0?k.join(",")||null:void 0}];else if(_t(d))H=d;else{var le=Object.keys(k);H=f?le.sort(f):le}for(var ze=r&&_t(k)&&k.length===1?t+"[]":t,wt=0;wt<H.length;++wt){var X=H[wt],Je=typeof X=="object"&&typeof X.value<"u"?X.value:k[X];if(!(a&&Je===null)){var Ze=_t(k)?typeof i=="function"?i(ze,X):ze:ze+(g?"."+X:"["+X+"]");P.set(e,K);var Li=ba();Li.set(us,P),wa(B,h(Je,Ze,i,r,o,a,i==="comma"&&S&&_t(k)?null:u,d,f,g,y,w,E,S,D,Li))}}return B},Tc=function(e){if(!e)return Se;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var t=e.charset||Se.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var i=Zi.default;if(typeof e.format<"u"){if(!Cc.call(Zi.formatters,e.format))throw new TypeError("Unknown format option provided.");i=e.format}var r=Zi.formatters[i],o=Se.filter;return(typeof e.filter=="function"||_t(e.filter))&&(o=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:Se.addQueryPrefix,allowDots:typeof e.allowDots>"u"?Se.allowDots:!!e.allowDots,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Se.charsetSentinel,delimiter:typeof e.delimiter>"u"?Se.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:Se.encode,encoder:typeof e.encoder=="function"?e.encoder:Se.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:Se.encodeValuesOnly,filter:o,format:i,formatter:r,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:Se.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:Se.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Se.strictNullHandling}},Sc=function(h,e){var t=h,i=Tc(e),r,o;typeof i.filter=="function"?(o=i.filter,t=o("",t)):_t(i.filter)&&(o=i.filter,r=o);var a=[];if(typeof t!="object"||t===null)return"";var u;e&&e.arrayFormat in va?u=e.arrayFormat:e&&"indices"in e?u=e.indices?"indices":"repeat":u="indices";var d=va[u];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var f=d==="comma"&&e&&e.commaRoundTrip;r||(r=Object.keys(t)),i.sort&&r.sort(i.sort);for(var g=ba(),y=0;y<r.length;++y){var w=r[y];i.skipNulls&&t[w]===null||wa(a,Rc(t[w],w,d,f,i.strictNullHandling,i.skipNulls,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,g))}var E=a.join(i.delimiter),S=i.addQueryPrefix===!0?"?":"";return i.charsetSentinel&&(i.charset==="iso-8859-1"?S+="utf8=%26%2310003%3B&":S+="utf8=%E2%9C%93&"),E.length>0?S+E:""},Ei=ga,ds=Object.prototype.hasOwnProperty,kc=Array.isArray,Ee={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Ei.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Mc=function(h){return h.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},Ca=function(h,e){return h&&typeof h=="string"&&e.comma&&h.indexOf(",")>-1?h.split(","):h},Lc="utf8=%26%2310003%3B",Ac="utf8=%E2%9C%93",Dc=function(e,t){var i={__proto__:null},r=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,o=t.parameterLimit===1/0?void 0:t.parameterLimit,a=r.split(t.delimiter,o),u=-1,d,f=t.charset;if(t.charsetSentinel)for(d=0;d<a.length;++d)a[d].indexOf("utf8=")===0&&(a[d]===Ac?f="utf-8":a[d]===Lc&&(f="iso-8859-1"),u=d,d=a.length);for(d=0;d<a.length;++d)if(d!==u){var g=a[d],y=g.indexOf("]="),w=y===-1?g.indexOf("="):y+1,E,S;w===-1?(E=t.decoder(g,Ee.decoder,f,"key"),S=t.strictNullHandling?null:""):(E=t.decoder(g.slice(0,w),Ee.decoder,f,"key"),S=Ei.maybeMap(Ca(g.slice(w+1),t),function(D){return t.decoder(D,Ee.decoder,f,"value")})),S&&t.interpretNumericEntities&&f==="iso-8859-1"&&(S=Mc(S)),g.indexOf("[]=")>-1&&(S=kc(S)?[S]:S),ds.call(i,E)?i[E]=Ei.combine(i[E],S):i[E]=S}return i},Fc=function(h,e,t,i){for(var r=i?e:Ca(e,t),o=h.length-1;o>=0;--o){var a,u=h[o];if(u==="[]"&&t.parseArrays)a=[].concat(r);else{a=t.plainObjects?Object.create(null):{};var d=u.charAt(0)==="["&&u.charAt(u.length-1)==="]"?u.slice(1,-1):u,f=parseInt(d,10);!t.parseArrays&&d===""?a={0:r}:!isNaN(f)&&u!==d&&String(f)===d&&f>=0&&t.parseArrays&&f<=t.arrayLimit?(a=[],a[f]=r):d!=="__proto__"&&(a[d]=r)}r=a}return r},Pc=function(e,t,i,r){if(e){var o=i.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/,u=/(\[[^[\]]*])/g,d=i.depth>0&&a.exec(o),f=d?o.slice(0,d.index):o,g=[];if(f){if(!i.plainObjects&&ds.call(Object.prototype,f)&&!i.allowPrototypes)return;g.push(f)}for(var y=0;i.depth>0&&(d=u.exec(o))!==null&&y<i.depth;){if(y+=1,!i.plainObjects&&ds.call(Object.prototype,d[1].slice(1,-1))&&!i.allowPrototypes)return;g.push(d[1])}return d&&g.push("["+o.slice(d.index)+"]"),Fc(g,t,i,r)}},Oc=function(e){if(!e)return Ee;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=typeof e.charset>"u"?Ee.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?Ee.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:Ee.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:Ee.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:Ee.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Ee.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:Ee.comma,decoder:typeof e.decoder=="function"?e.decoder:Ee.decoder,delimiter:typeof e.delimiter=="string"||Ei.isRegExp(e.delimiter)?e.delimiter:Ee.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:Ee.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:Ee.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:Ee.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:Ee.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Ee.strictNullHandling}},zc=function(h,e){var t=Oc(e);if(h===""||h===null||typeof h>"u")return t.plainObjects?Object.create(null):{};for(var i=typeof h=="string"?Dc(h,t):h,r=t.plainObjects?Object.create(null):{},o=Object.keys(i),a=0;a<o.length;++a){var u=o[a],d=Pc(u,i[u],t,typeof h=="string");r=Ei.merge(r,d,t)}return t.allowSparse===!0?r:Ei.compact(r)},Hc=Sc,Ic=zc,Nc=ls,Bc={formats:Nc,parse:Ic,stringify:Hc};const Vc=ju(Bc);function Wc(h){let e=[];function t(i){for(let r in i)typeof i[r]=="object"&&i[r]!==null&&(!["schema","columns"].includes(r)&&!W.has(i[r],"schema")&&W.get(i[r],"type")!="group"?(W.has(i[r],"placeholder")||(i[r].placeholder=W.get(i[r],"title")),i[r].field=r,e.push(i[r])):t(i[r]))}return t(h),e}const{event:Rt}=We.emitter,Gc=(h="myStore")=>Wo.defineStore(h,{state:()=>({mainKey:"",form:{},items:{},routes:{},fields:[],options:[],filters:[],loadings:{},structure:{},paginations:{},searchParam:"",isEditing:!1,panelName:!1,hiddenActions:[],isFiltering:!1,sorts:["id:desc"],selected:new Set([])}),getters:{getItems(e){return t=>W.get(e.items,t,[])},getPaginations(e){return t=>W.get(e.paginations,t,[])},mainItems(e){return W.get(e.items,e.mainKey,[])},mainPagination(e){return this.getPaginations(e.mainKey)},mainRoute(e){return W.get(e.routes,e.mainKey,"")},flatFields(e){let t=Wc(e.fields);return t.unshift(p.reactive({title:"",type:"hidden",value:"_select_",field:"_select_",align:"center",headerSort:!1})),t},formFields(e){return e.fields},flatFieldsWithoutActions(){return this.flatFields.filter(e=>!["_actions_","_index_","_select_"].includes(e.field))},headers(){return Jc(this.flatFields)},headersWithoutActions(){return this.headers.filter(e=>!["_actions_","_index_","_select_"].includes(e.field))}},actions:{reset(){this.items={},this.loadings={},this.routes={},this.options=[]},setData(e,t){this.items[e]=t},addData(e){Array.isArray(this.items[this.mainKey])||(this.items[this.mainKey]=[]),this.items[this.mainKey]=[e,...this.items[this.mainKey]]},editData(e){let t=this.items[this.mainKey];t=t.map(i=>i.id==e.id?{_index_:i._index_,...e}:i),this.items[this.mainKey]=[...t]},removeData(e){let t=this.items[this.mainKey];t=t.filter(i=>i.id!=e),this.items[this.mainKey]=[...t]},getModelKey(e){let t=typeof e=="string"?e.substr(e.lastIndexOf("/")+1):e.key;return this.mainKey=this.mainKey||Vr(t),Vr(t)},setPagination(e,t){t in this.paginations||(this.paginations[t]={total:0,currentPage:0,lastPage:0}),this.paginations[t].total=W.get(e,"total"),this.paginations[t].currentPage=W.get(e,"current_page"),this.paginations[t].lastPage=W.get(e,"last_page")},paginate(e){this.isFiltering?this.getWithFilter(e):this.loadItems(this.mainKey,e)},reloadData(){this.isFiltering?this.getWithFilter():this.loadItems()},loadItemsPlus(e=this.mainKey,t=1,i="",r=()=>{},o=!0){let a=W.get(this.routes,e,"").indexOf("?")>-1?"&page=":"?page=";this.loadings[e]=!0;const u=W.get(this.routes,e,"")+a+t+"&"+i;mt.get(u).then(d=>{if(d=W.get(d,"data",{}),Array.isArray(this.items[e])||(this.items[e]=[]),o)for(const f of d.data)this.items[e].push(f);else this.items[e]=d.data;this.setPagination(d,e)}).finally(()=>{r(),this.loadings[e]=!1})},convertToFilterForm(){var t;let e={};for(const i of this.filters)(t=i==null?void 0:i.field)!=null&&t.field&&(e[i.field.field]={[i.op]:i.value});return Vc.stringify({filters:e,sort:this.sorts},{encodeValuesOnly:!0})},async loadItems(e=this.mainKey,t=1){let i=W.get(this.routes,e,"").indexOf("?")>-1?"&page=":"?page=";i+=t,this.searchParam&&(i+="&search="+this.searchParam),this.loadings[e]=!0,this.loadings.mainLoading=e===this.mainKey;const r=W.get(this.routes,e,"")+i+"&"+this.convertToFilterForm();return mt.get(r).then(o=>{o=W.get(o,"data",{}),this.items[e]=W.get(o,"data"),this.setPagination(o,e)}).finally(()=>{this.loadings[e]=!1,this.loadings.mainLoading=!1})},customLoadItems(e,t=1,i=()=>({})){this.loadings[e]=!0,i(r=>{this.items[e]=r.data,this.setPagination(r,e)},()=>{},()=>{this.loadings[e]=!1},t)},getWithFilter(e=1,t=15){const i="http://192.168.190.10:9090/api/filter";return this.loadings.filter=!0,mt.post(`${i}?page=${e}`,{model:this.mainKey,itemPerPage:t,filters:this.filters}).then(r=>{r=W.get(r,"data",{}),this.items[this.mainKey]=r.data,this.setPagination(r,this.mainKey)}).finally(()=>{this.loadings.filter=!1})},addItem(e){this.loadings.mainLoading=!0;let t=this.routes[this.mainKey],i=Ta(e,this.flatFields);return mt.post(t,i).then(async()=>{this.reloadData(),Rt("alert",{text:"با موفقیت ثبت شد",color:"green"}),Rt("handleDialogForm",!1)}).catch(r=>{Rt("alert",{text:W.get(r,"response.message"),color:"red"})}).finally(()=>{this.loadings.mainLoading=!1})},editItem(e){let t=this.routes[this.mainKey].split("?")[0],i=Ta(e,this.flatFields);return this.loadings.mainLoading=!0,mt.patch(t+"/"+e.id,i).then(async()=>{this.reloadData(),Rt("alert",{text:"با موفقیت ویرایش شد",color:"green"}),Rt("handleDialogForm",!1)}).catch(r=>{Rt("alert",{text:W.get(r,"response.message"),color:"red"})}).finally(()=>{this.loadings.mainLoading=!1})},remove(e){const t=Array.isArray(e)?e:[e];let i=this.routes[this.mainKey].split("?")[0];this.loadings.mainLoading=!0,t.forEach(r=>{mt.delete(i+"/"+r).then(()=>{Rt("alert",{text:"با موفقیت حذف شد",color:"green"}),Rt("handleDeleteDialog",!1),this.removeData(e),this.reloadData()}).catch(o=>{Rt("alert",{text:W.get(o,"response.data.message"),color:"red"})}).finally(()=>{this.loadings.mainLoading=!1})})}}}),$c=h=>Gc(h)(),Uc=h=>({onChange:(...e)=>{window.tester=e[2];const t=e[2].form$.el$(h);t&&"clear"in t&&t.clear(),t&&"updateItems"in t&&t.updateItems()}}),jc=(h={})=>({search:!0,clearOnSearch:!0,type:"select",delay:1e3,object:!0,filterResults:!1,native:!1,formatter:e=>W.get(e.getValue(),W.get(h,"labelProp")),...h}),Kc=(h={})=>({search:!0,clearOnSearch:!0,type:"select",object:!0,native:!1,formatter:e=>W.get(e.getValue(),W.get(h,"labelProp"),e.getValue()),...h}),qc=(h={})=>({search:!0,clearOnSearch:!0,type:"multiselect",delay:1e3,object:!0,filterResults:!1,native:!1,formatter:e=>W.get(e.getValue(),W.get(h,"labelProp")),...h}),Ea=(h={})=>({search:!0,clearOnSearch:!0,type:"tags",delay:1e3,object:!0,filterResults:!1,hideSelected:!0,native:!1,formatter:e=>W.get(e.getValue(),W.get(h,"labelProp")),...h}),xa=(h={})=>({type:"date",...h}),_a={normalSelect:Kc,hasRel:Uc,select:jc,multiSelect:qc,tags:Ea,date:xa};let Ra={};function Ta(h,e){let t={},i=!1;for(let r in h){let o=Yc(r,e);if(!o)continue;i=!0;let a=Xc(o),u=r;W.has(o,"valueProp")&&(u+="."+W.get(o,"valueProp","")),t[a]=W.get(h,u)}return i?t:h}function Xc(h){return"sendKey"in h?h.sendKey:h.field}function Yc(h,e){return e.find(t=>t.field==h)}function Jc(h){let e=h.filter(i=>i.isHeader);e.push({title:"",value:"_actions_",field:"_actions_",type:"text",align:"left",headerSort:!1,hozAlign:"left",headerHozAlign:"left"});let t=0;return h.find(i=>i.field==="_select_"&&i.isHeader)&&(t=1),e.splice(t,0,{title:"#",type:"text",value:"_index_",field:"_index_",align:"center",headerSort:!1}),e}function Zc(h){for(const e of h)"init"in e&&e.init()}const Qc=h=>{const e=W.get(Ra,h);return e?p.markRaw(e):""},ef=h=>({url:e,key:t,foreignKey:i,dataKey:r}={url:!1,key:!1,foreignKey:!1,dataKey:!1})=>async(...o)=>{let a=o[0],u=e;i&&r&&(u+=u.includes("?")?"&":"?",u+=`filters[${i}][$eq]={${r}}`);const d=w=>{let E=w.substr(w.lastIndexOf("/")+1);return Vr(E)};typeof route=="string"&&(t=d(u)),(u.match(/\{(.*?)\}/g)||[]).forEach(w=>{const E=w.replace(/[{}]/g,"");u=u.replace(w,W.get(h.form,E,""))});const g=u.includes("?")?"&":"?",y=await mt.get(u+g+"search="+(a||""));return W.get(y,"data.data",[])},tf=(h,e)=>h({getRegisterField:Qc,axios:mt,get:ef(e),getSafe:W.get,useFields:_a}),Sa=h=>{Ra=h};function nf({fields:h,hiddenActions:e,options:t,route:i}){const r=$c("Store-"+parseInt(Math.random()*1e7));r.fields=tf(h,r),We.emitter.event("beforeFormueInit");const o=r.getModelKey(i);return r.routes[o]=typeof i=="string"?i:i==null?void 0:i.route,r.loadItems(),r.options=t,r.hiddenActions=e,Zc(r.flatFields),r}const rf={en:{clear:"Clear",no:"No",yes:"yes",alert_to_delete:"Are you sure to delete?",first:"First",previous:"Previous",next:"Next",last:"Last",apply_filter:"Apply filter",filter:"Filter",add_filter:"Add filter",clear_all:"Clear all",add:"Add",save:"Save",edit:"Edit",cancel:"Cancel",choose_filter:"Choose filter",select_type:"Select type",equal_to:"Equal to",not_equal_to:"Not equal to",greater_than:"Greater than",less_than:"Less than",look_like:"Look like",search:"Search ...",range:"Range",add:"Add",export:"Export",export_as_pdf:"Export as PDF",export_as_excel:" Export as Excel",print:"Print",reload:"Reload",select_row:"Select row",custom_column:"Custom column",filter_data:"Filter data",active_filter:"Active filter"},fa:{clear:"پاک کردن",no:"خیر",yes:"بله",alert_to_delete:"آیا از حذف کردن مطمئن هستید؟",first:"ابتدا",previous:"قبلی",next:"بعدی",last:"آخرین",apply_filter:"اعمال فیلتر",filter:"فیلتر",add_filter:"افزودن فیلتر",clear_all:"حذف فیلترها",add:"افرودن",save:"ذخیره",edit:"ویرایش",cancel:"لغو",choose_filter:"انتخاب فیلتر",select_type:"انتخاب کنید",equal_to:"برابر با",not_equal_to:"نابرابر با",greater_than:"بزرگتر از",less_than:"کوچکتر از",look_like:"مشابه",search:"جستجو ...",range:"محدوده",edit_filter:"ویرایش فیلتر",export:"خروجیگرفتن",export_as_pdf:"PDF خروجی",export_as_excel:"Excel خروجی",print:"خروجی چاپی",reload:"بارگذاری مجدد",select_row:"انتخاب ردیف",custom_column:"ستون سفارشی",filter_data:"فیلترکردن ",active_filter:"فیلترهای فعال",not_load_or_existing_data:"دیتایی وجود ندارد :(",filter_save_placeholder:"اسم فیلتر",not_filter_create_yes:"هنوز فیلتری ایجاد نشده است",operator:"عملگر",in:"برابر با مقادیر",not_in:"نابرابر با مقادیر",value:"مقدار",between:"از میان"}},Qi=Wo.defineStore("formuCrudLangs",{state:()=>({lang:"fa",dir:"rtl",langs:rf}),getters:{currentLang(h){return W.get(h.langs,h.lang,"fa")}},actions:{translate(h){return W.get(this.currentLang,h,h)}}});class Pe{constructor(e){this.table=e}reloadData(e,t,i){return this.table.dataLoader.load(e,void 0,void 0,void 0,t,i)}langText(){return this.table.modules.localize.getText(...arguments)}langBind(){return this.table.modules.localize.bind(...arguments)}langLocale(){return this.table.modules.localize.getLocale(...arguments)}commsConnections(){return this.table.modules.comms.getConnections(...arguments)}commsSend(){return this.table.modules.comms.send(...arguments)}layoutMode(){return this.table.modules.layout.getMode()}layoutRefresh(e){return this.table.modules.layout.layout(e)}subscribe(){return this.table.eventBus.subscribe(...arguments)}unsubscribe(){return this.table.eventBus.unsubscribe(...arguments)}subscribed(e){return this.table.eventBus.subscribed(e)}subscriptionChange(){return this.table.eventBus.subscriptionChange(...arguments)}dispatch(){return this.table.eventBus.dispatch(...arguments)}chain(){return this.table.eventBus.chain(...arguments)}confirm(){return this.table.eventBus.confirm(...arguments)}dispatchExternal(){return this.table.externalEvents.dispatch(...arguments)}subscribedExternal(e){return this.table.externalEvents.subscribed(e)}subscriptionChangeExternal(){return this.table.externalEvents.subscriptionChange(...arguments)}options(e){return this.table.options[e]}setOption(e,t){return typeof t<"u"&&(this.table.options[e]=t),this.table.options[e]}deprecationCheck(e,t){return this.table.deprecationAdvisor.check(e,t)}deprecationCheckMsg(e,t){return this.table.deprecationAdvisor.checkMsg(e,t)}deprecationMsg(e){return this.table.deprecationAdvisor.msg(e)}module(e){return this.table.module(e)}}class fe{static elVisible(e){return!(e.offsetWidth<=0&&e.offsetHeight<=0)}static elOffset(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset-document.documentElement.clientTop,left:t.left+window.pageXOffset-document.documentElement.clientLeft}}static deepClone(e,t,i=[]){var r={}.__proto__,o=[].__proto__;t||(t=Object.assign(Array.isArray(e)?[]:{},e));for(var a in e){let u=e[a],d,f;u!=null&&typeof u=="object"&&(u.__proto__===r||u.__proto__===o)&&(d=i.findIndex(g=>g.subject===u),d>-1?t[a]=i[d].copy:(f=Object.assign(Array.isArray(u)?[]:{},u),i.unshift({subject:u,copy:f}),t[a]=this.deepClone(u,f,i)))}return t}}class cs extends Pe{constructor(e,t,i){super(e),this.element=t,this.container=this._lookupContainer(),this.parent=i,this.reversedX=!1,this.childPopup=null,this.blurable=!1,this.blurCallback=null,this.blurEventsBound=!1,this.renderedCallback=null,this.visible=!1,this.hideable=!0,this.element.classList.add("tabulator-popup-container"),this.blurEvent=this.hide.bind(this,!1),this.escEvent=this._escapeCheck.bind(this),this.destroyBinding=this.tableDestroyed.bind(this),this.destroyed=!1}tableDestroyed(){this.destroyed=!0,this.hide(!0)}_lookupContainer(){var e=this.table.options.popupContainer;return typeof e=="string"?(e=document.querySelector(e),e||console.warn("Menu Error - no container element found matching selector:",this.table.options.popupContainer,"(defaulting to document body)")):e===!0&&(e=this.table.element),e&&!this._checkContainerIsParent(e)&&(e=!1,console.warn("Menu Error - container element does not contain this table:",this.table.options.popupContainer,"(defaulting to document body)")),e||(e=document.body),e}_checkContainerIsParent(e,t=this.table.element){return e===t?!0:t.parentNode?this._checkContainerIsParent(e,t.parentNode):!1}renderCallback(e){this.renderedCallback=e}containerEventCoords(e){var t=!(e instanceof MouseEvent),i=t?e.touches[0].pageX:e.pageX,r=t?e.touches[0].pageY:e.pageY;if(this.container!==document.body){let o=fe.elOffset(this.container);i-=o.left,r-=o.top}return{x:i,y:r}}elementPositionCoords(e,t="right"){var i=fe.elOffset(e),r,o,a;switch(this.container!==document.body&&(r=fe.elOffset(this.container),i.left-=r.left,i.top-=r.top),t){case"right":o=i.left+e.offsetWidth,a=i.top-1;break;case"bottom":o=i.left,a=i.top+e.offsetHeight;break;case"left":o=i.left,a=i.top-1;break;case"top":o=i.left,a=i.top;break;case"center":o=i.left+e.offsetWidth/2,a=i.top+e.offsetHeight/2;break}return{x:o,y:a,offset:i}}show(e,t){var i,r,o,a,u;return this.destroyed||this.table.destroyed?this:(e instanceof HTMLElement?(o=e,u=this.elementPositionCoords(e,t),a=u.offset,i=u.x,r=u.y):typeof e=="number"?(a={top:0,left:0},i=e,r=t):(u=this.containerEventCoords(e),i=u.x,r=u.y,this.reversedX=!1),this.element.style.top=r+"px",this.element.style.left=i+"px",this.container.appendChild(this.element),typeof this.renderedCallback=="function"&&this.renderedCallback(),this._fitToScreen(i,r,o,a,t),this.visible=!0,this.subscribe("table-destroy",this.destroyBinding),this.element.addEventListener("mousedown",d=>{d.stopPropagation()}),this)}_fitToScreen(e,t,i,r,o){var a=this.container===document.body?document.documentElement.scrollTop:this.container.scrollTop;if((e+this.element.offsetWidth>=this.container.offsetWidth||this.reversedX)&&(this.element.style.left="",i?this.element.style.right=this.container.offsetWidth-r.left+"px":this.element.style.right=this.container.offsetWidth-e+"px",this.reversedX=!0),t+this.element.offsetHeight>Math.max(this.container.offsetHeight,a?this.container.scrollHeight:0))if(i)switch(o){case"bottom":this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight-i.offsetHeight-1+"px";break;default:this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight+i.offsetHeight+1+"px"}else this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight+"px"}isVisible(){return this.visible}hideOnBlur(e){return this.blurable=!0,this.visible&&(setTimeout(()=>{this.visible&&(this.table.rowManager.element.addEventListener("scroll",this.blurEvent),this.subscribe("cell-editing",this.blurEvent),document.body.addEventListener("click",this.blurEvent),document.body.addEventListener("contextmenu",this.blurEvent),document.body.addEventListener("mousedown",this.blurEvent),window.addEventListener("resize",this.blurEvent),document.body.addEventListener("keydown",this.escEvent),this.blurEventsBound=!0)},100),this.blurCallback=e),this}_escapeCheck(e){e.keyCode==27&&this.hide()}blockHide(){this.hideable=!1}restoreHide(){this.hideable=!0}hide(e=!1){return this.visible&&this.hideable&&(this.blurable&&this.blurEventsBound&&(document.body.removeEventListener("keydown",this.escEvent),document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),document.body.removeEventListener("mousedown",this.blurEvent),window.removeEventListener("resize",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent),this.unsubscribe("cell-editing",this.blurEvent),this.blurEventsBound=!1),this.childPopup&&this.childPopup.hide(),this.parent&&(this.parent.childPopup=null),this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.visible=!1,this.blurCallback&&!e&&this.blurCallback(),this.unsubscribe("table-destroy",this.destroyBinding)),this}child(e){return this.childPopup&&this.childPopup.hide(),this.childPopup=new cs(this.table,e,this),this.childPopup}}class ee extends Pe{constructor(e,t){super(e),this._handler=null}initialize(){}registerTableOption(e,t){this.table.optionsList.register(e,t)}registerColumnOption(e,t){this.table.columnManager.optionsList.register(e,t)}registerTableFunction(e,t){typeof this.table[e]>"u"?this.table[e]=(...i)=>(this.table.initGuard(e),t(...i)):console.warn("Unable to bind table function, name already in use",e)}registerComponentFunction(e,t,i){return this.table.componentFunctionBinder.bind(e,t,i)}registerDataHandler(e,t){this.table.rowManager.registerDataPipelineHandler(e,t),this._handler=e}registerDisplayHandler(e,t){this.table.rowManager.registerDisplayPipelineHandler(e,t),this._handler=e}displayRows(e){var t=this.table.rowManager.displayRows.length-1,i;if(this._handler&&(i=this.table.rowManager.displayPipeline.findIndex(r=>r.handler===this._handler),i>-1&&(t=i)),e&&(t=t+e),this._handler)return t>-1?this.table.rowManager.getDisplayRows(t):this.activeRows()}activeRows(){return this.table.rowManager.activeRows}refreshData(e,t){t||(t=this._handler),t&&this.table.rowManager.refreshActiveData(t,!1,e)}footerAppend(e){return this.table.footerManager.append(e)}footerPrepend(e){return this.table.footerManager.prepend(e)}footerRemove(e){return this.table.footerManager.remove(e)}popup(e,t){return new cs(this.table,e,t)}alert(e,t){return this.table.alertManager.alert(e,t)}clearAlert(){return this.table.alertManager.clear()}}var sf={};class xi extends ee{constructor(e){super(e),this.allowedTypes=["","data","download","clipboard","print","htmlOutput"],this.registerColumnOption("accessor"),this.registerColumnOption("accessorParams"),this.registerColumnOption("accessorData"),this.registerColumnOption("accessorDataParams"),this.registerColumnOption("accessorDownload"),this.registerColumnOption("accessorDownloadParams"),this.registerColumnOption("accessorClipboard"),this.registerColumnOption("accessorClipboardParams"),this.registerColumnOption("accessorPrint"),this.registerColumnOption("accessorPrintParams"),this.registerColumnOption("accessorHtmlOutput"),this.registerColumnOption("accessorHtmlOutputParams")}initialize(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-retrieve",this.transformRow.bind(this))}initializeColumn(e){var t=!1,i={};this.allowedTypes.forEach(r=>{var o="accessor"+(r.charAt(0).toUpperCase()+r.slice(1)),a;e.definition[o]&&(a=this.lookupAccessor(e.definition[o]),a&&(t=!0,i[o]={accessor:a,params:e.definition[o+"Params"]||{}}))}),t&&(e.modules.accessor=i)}lookupAccessor(e){var t=!1;switch(typeof e){case"string":xi.accessors[e]?t=xi.accessors[e]:console.warn("Accessor Error - No such accessor found, ignoring: ",e);break;case"function":t=e;break}return t}transformRow(e,t){var i="accessor"+(t.charAt(0).toUpperCase()+t.slice(1)),r=e.getComponent(),o=fe.deepClone(e.data||{});return this.table.columnManager.traverse(function(a){var u,d,f,g;a.modules.accessor&&(d=a.modules.accessor[i]||a.modules.accessor.accessor||!1,d&&(u=a.getFieldValue(o),u!="undefined"&&(g=a.getComponent(),f=typeof d.params=="function"?d.params(u,o,t,g,r):d.params,a.setFieldValue(o,d.accessor(u,o,t,f,g,r)))))}),o}}xi.moduleName="accessor",xi.accessors=sf;var of={method:"GET"};function fs(h,e){var t=[];if(e=e||"",Array.isArray(h))h.forEach((r,o)=>{t=t.concat(fs(r,e?e+"["+o+"]":o))});else if(typeof h=="object")for(var i in h)t=t.concat(fs(h[i],e?e+"["+i+"]":i));else t.push({key:e,value:h});return t}function af(h){var e=fs(h),t=[];return e.forEach(function(i){t.push(encodeURIComponent(i.key)+"="+encodeURIComponent(i.value))}),t.join("&")}function ka(h,e,t){return h&&t&&Object.keys(t).length&&(!e.method||e.method.toLowerCase()=="get")&&(e.method="get",h+=(h.includes("?")?"&":"?")+af(t)),h}function lf(h,e,t){var i;return new Promise((r,o)=>{if(h=this.urlGenerator.call(this.table,h,e,t),e.method.toUpperCase()!="GET")if(i=typeof this.table.options.ajaxContentType=="object"?this.table.options.ajaxContentType:this.contentTypeFormatters[this.table.options.ajaxContentType],i){for(var a in i.headers)e.headers||(e.headers={}),typeof e.headers[a]>"u"&&(e.headers[a]=i.headers[a]);e.body=i.body.call(this,h,e,t)}else console.warn("Ajax Error - Invalid ajaxContentType value:",this.table.options.ajaxContentType);h?(typeof e.headers>"u"&&(e.headers={}),typeof e.headers.Accept>"u"&&(e.headers.Accept="application/json"),typeof e.headers["X-Requested-With"]>"u"&&(e.headers["X-Requested-With"]="XMLHttpRequest"),typeof e.mode>"u"&&(e.mode="cors"),e.mode=="cors"?(typeof e.headers.Origin>"u"&&(e.headers.Origin=window.location.origin),typeof e.credentials>"u"&&(e.credentials="same-origin")):typeof e.credentials>"u"&&(e.credentials="include"),fetch(h,e).then(u=>{u.ok?u.json().then(d=>{r(d)}).catch(d=>{o(d),console.warn("Ajax Load Error - Invalid JSON returned",d)}):(console.error("Ajax Load Error - Connection Error: "+u.status,u.statusText),o(u))}).catch(u=>{console.error("Ajax Load Error - Connection Error: ",u),o(u)})):(console.warn("Ajax Load Error - No URL Set"),r([]))})}function ps(h,e){var t=[];if(e=e||"",Array.isArray(h))h.forEach((r,o)=>{t=t.concat(ps(r,e?e+"["+o+"]":o))});else if(typeof h=="object")for(var i in h)t=t.concat(ps(h[i],e?e+"["+i+"]":i));else t.push({key:e,value:h});return t}var hf={json:{headers:{"Content-Type":"application/json"},body:function(h,e,t){return JSON.stringify(t)}},form:{headers:{},body:function(h,e,t){var i=ps(t),r=new FormData;return i.forEach(function(o){r.append(o.key,o.value)}),r}}};class at extends ee{constructor(e){super(e),this.config={},this.url="",this.urlGenerator=!1,this.params=!1,this.loaderPromise=!1,this.registerTableOption("ajaxURL",!1),this.registerTableOption("ajaxURLGenerator",!1),this.registerTableOption("ajaxParams",{}),this.registerTableOption("ajaxConfig","get"),this.registerTableOption("ajaxContentType","form"),this.registerTableOption("ajaxRequestFunc",!1),this.registerTableOption("ajaxRequesting",function(){}),this.registerTableOption("ajaxResponse",!1),this.contentTypeFormatters=at.contentTypeFormatters}initialize(){this.loaderPromise=this.table.options.ajaxRequestFunc||at.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||at.defaultURLGenerator,this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.setDefaultConfig(this.table.options.ajaxConfig),this.registerTableFunction("getAjaxUrl",this.getUrl.bind(this)),this.subscribe("data-loading",this.requestDataCheck.bind(this)),this.subscribe("data-params",this.requestParams.bind(this)),this.subscribe("data-load",this.requestData.bind(this))}requestParams(e,t,i,r){var o=this.table.options.ajaxParams;return o&&(typeof o=="function"&&(o=o.call(this.table)),r=Object.assign(r,o)),r}requestDataCheck(e,t,i,r){return!!(!e&&this.url||typeof e=="string")}requestData(e,t,i,r,o){var a;return!o&&this.requestDataCheck(e)?(e&&this.setUrl(e),a=this.generateConfig(i),this.sendRequest(this.url,t,a)):o}setDefaultConfig(e={}){this.config=Object.assign({},at.defaultConfig),typeof e=="string"?this.config.method=e:Object.assign(this.config,e)}generateConfig(e={}){var t=Object.assign({},this.config);return typeof e=="string"?t.method=e:Object.assign(t,e),t}setUrl(e){this.url=e}getUrl(){return this.url}sendRequest(e,t,i){return this.table.options.ajaxRequesting.call(this.table,e,t)!==!1?this.loaderPromise(e,i,t).then(r=>(this.table.options.ajaxResponse&&(r=this.table.options.ajaxResponse.call(this.table,e,t,r)),r)):Promise.reject()}}at.moduleName="ajax",at.defaultConfig=of,at.defaultURLGenerator=ka,at.defaultLoaderPromise=lf,at.contentTypeFormatters=hf;var uf={replace:function(h){return this.table.setData(h)},update:function(h){return this.table.updateOrAddData(h)},insert:function(h){return this.table.addData(h)}},df={table:function(h){var e=[],t=!0,i=this.table.columnManager.columns,r=[],o=[];return h=h.split(`
|
30
|
+
`+e.prev}function Hn(h,e){var t=is(h),i=[];if(t){i.length=h.length;for(var r=0;r<h.length;r++)i[r]=It(h,r)?e(h[r],h):""}var o=typeof Qr=="function"?Qr(h):[],a;if(yi){a={};for(var u=0;u<o.length;u++)a["$"+o[u]]=o[u]}for(var d in h)It(h,d)&&(t&&String(Number(d))===d&&d<h.length||yi&&a["$"+d]instanceof Symbol||(ta.call(/[^\w$]/,d)?i.push(e(d,h)+": "+e(h[d],h)):i.push(d+": "+e(h[d],h))));if(typeof Qr=="function")for(var f=0;f<o.length;f++)ra.call(h,o[f])&&i.push("["+e(o[f])+"]: "+e(h[o[f]],h));return i}var ss=jr,Ci=yd,Yd=Ad,Jd=ss("%TypeError%"),In=ss("%WeakMap%",!0),Nn=ss("%Map%",!0),Zd=Ci("WeakMap.prototype.get",!0),Qd=Ci("WeakMap.prototype.set",!0),ec=Ci("WeakMap.prototype.has",!0),tc=Ci("Map.prototype.get",!0),ic=Ci("Map.prototype.set",!0),nc=Ci("Map.prototype.has",!0),os=function(h,e){for(var t=h,i;(i=t.next)!==null;t=i)if(i.key===e)return t.next=i.next,i.next=h.next,h.next=i,i},rc=function(h,e){var t=os(h,e);return t&&t.value},sc=function(h,e,t){var i=os(h,e);i?i.value=t:h.next={key:e,next:h.next,value:t}},oc=function(h,e){return!!os(h,e)},ac=function(){var e,t,i,r={assert:function(o){if(!r.has(o))throw new Jd("Side channel does not contain "+Yd(o))},get:function(o){if(In&&o&&(typeof o=="object"||typeof o=="function")){if(e)return Zd(e,o)}else if(Nn){if(t)return tc(t,o)}else if(i)return rc(i,o)},has:function(o){if(In&&o&&(typeof o=="object"||typeof o=="function")){if(e)return ec(e,o)}else if(Nn){if(t)return nc(t,o)}else if(i)return oc(i,o);return!1},set:function(o,a){In&&o&&(typeof o=="object"||typeof o=="function")?(e||(e=new In),Qd(e,o,a)):Nn?(t||(t=new Nn),ic(t,o,a)):(i||(i={key:{},next:null}),sc(i,o,a))}};return r},lc=String.prototype.replace,hc=/%20/g,as={RFC1738:"RFC1738",RFC3986:"RFC3986"},ls={default:as.RFC3986,formatters:{RFC1738:function(h){return lc.call(h,hc,"+")},RFC3986:function(h){return String(h)}},RFC1738:as.RFC1738,RFC3986:as.RFC3986},uc=ls,hs=Object.prototype.hasOwnProperty,ti=Array.isArray,bt=function(){for(var h=[],e=0;e<256;++e)h.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return h}(),dc=function(e){for(;e.length>1;){var t=e.pop(),i=t.obj[t.prop];if(ti(i)){for(var r=[],o=0;o<i.length;++o)typeof i[o]<"u"&&r.push(i[o]);t.obj[t.prop]=r}}},ma=function(e,t){for(var i=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)typeof e[r]<"u"&&(i[r]=e[r]);return i},cc=function h(e,t,i){if(!t)return e;if(typeof t!="object"){if(ti(e))e.push(t);else if(e&&typeof e=="object")(i&&(i.plainObjects||i.allowPrototypes)||!hs.call(Object.prototype,t))&&(e[t]=!0);else return[e,t];return e}if(!e||typeof e!="object")return[e].concat(t);var r=e;return ti(e)&&!ti(t)&&(r=ma(e,i)),ti(e)&&ti(t)?(t.forEach(function(o,a){if(hs.call(e,a)){var u=e[a];u&&typeof u=="object"&&o&&typeof o=="object"?e[a]=h(u,o,i):e.push(o)}else e[a]=o}),e):Object.keys(t).reduce(function(o,a){var u=t[a];return hs.call(o,a)?o[a]=h(o[a],u,i):o[a]=u,o},r)},fc=function(e,t){return Object.keys(t).reduce(function(i,r){return i[r]=t[r],i},e)},pc=function(h,e,t){var i=h.replace(/\+/g," ");if(t==="iso-8859-1")return i.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(i)}catch{return i}},mc=function(e,t,i,r,o){if(e.length===0)return e;var a=e;if(typeof e=="symbol"?a=Symbol.prototype.toString.call(e):typeof e!="string"&&(a=String(e)),i==="iso-8859-1")return escape(a).replace(/%u[0-9a-f]{4}/gi,function(g){return"%26%23"+parseInt(g.slice(2),16)+"%3B"});for(var u="",d=0;d<a.length;++d){var f=a.charCodeAt(d);if(f===45||f===46||f===95||f===126||f>=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||o===uc.RFC1738&&(f===40||f===41)){u+=a.charAt(d);continue}if(f<128){u=u+bt[f];continue}if(f<2048){u=u+(bt[192|f>>6]+bt[128|f&63]);continue}if(f<55296||f>=57344){u=u+(bt[224|f>>12]+bt[128|f>>6&63]+bt[128|f&63]);continue}d+=1,f=65536+((f&1023)<<10|a.charCodeAt(d)&1023),u+=bt[240|f>>18]+bt[128|f>>12&63]+bt[128|f>>6&63]+bt[128|f&63]}return u},gc=function(e){for(var t=[{obj:{o:e},prop:"o"}],i=[],r=0;r<t.length;++r)for(var o=t[r],a=o.obj[o.prop],u=Object.keys(a),d=0;d<u.length;++d){var f=u[d],g=a[f];typeof g=="object"&&g!==null&&i.indexOf(g)===-1&&(t.push({obj:a,prop:f}),i.push(g))}return dc(t),e},bc=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},vc=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},wc=function(e,t){return[].concat(e,t)},yc=function(e,t){if(ti(e)){for(var i=[],r=0;r<e.length;r+=1)i.push(t(e[r]));return i}return t(e)},ga={arrayToObject:ma,assign:fc,combine:wc,compact:gc,decode:pc,encode:mc,isBuffer:vc,isRegExp:bc,maybeMap:yc,merge:cc},ba=ac,Bn=ga,Zi=ls,Cc=Object.prototype.hasOwnProperty,va={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},_t=Array.isArray,Ec=Array.prototype.push,wa=function(h,e){Ec.apply(h,_t(e)?e:[e])},xc=Date.prototype.toISOString,ya=Zi.default,Se={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Bn.encode,encodeValuesOnly:!1,format:ya,formatter:Zi.formatters[ya],indices:!1,serializeDate:function(e){return xc.call(e)},skipNulls:!1,strictNullHandling:!1},_c=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},us={},Rc=function h(e,t,i,r,o,a,u,d,f,g,y,w,E,S,D,P){for(var k=e,G=P,K=0,z=!1;(G=G.get(us))!==void 0&&!z;){var V=G.get(e);if(K+=1,typeof V<"u"){if(V===K)throw new RangeError("Cyclic object value");z=!0}typeof G.get(us)>"u"&&(K=0)}if(typeof d=="function"?k=d(t,k):k instanceof Date?k=y(k):i==="comma"&&_t(k)&&(k=Bn.maybeMap(k,function(Wt){return Wt instanceof Date?y(Wt):Wt})),k===null){if(o)return u&&!S?u(t,Se.encoder,D,"key",w):t;k=""}if(_c(k)||Bn.isBuffer(k)){if(u){var se=S?t:u(t,Se.encoder,D,"key",w);return[E(se)+"="+E(u(k,Se.encoder,D,"value",w))]}return[E(t)+"="+E(String(k))]}var B=[];if(typeof k>"u")return B;var H;if(i==="comma"&&_t(k))S&&u&&(k=Bn.maybeMap(k,u)),H=[{value:k.length>0?k.join(",")||null:void 0}];else if(_t(d))H=d;else{var le=Object.keys(k);H=f?le.sort(f):le}for(var ze=r&&_t(k)&&k.length===1?t+"[]":t,wt=0;wt<H.length;++wt){var X=H[wt],Je=typeof X=="object"&&typeof X.value<"u"?X.value:k[X];if(!(a&&Je===null)){var Ze=_t(k)?typeof i=="function"?i(ze,X):ze:ze+(g?"."+X:"["+X+"]");P.set(e,K);var Li=ba();Li.set(us,P),wa(B,h(Je,Ze,i,r,o,a,i==="comma"&&S&&_t(k)?null:u,d,f,g,y,w,E,S,D,Li))}}return B},Tc=function(e){if(!e)return Se;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var t=e.charset||Se.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var i=Zi.default;if(typeof e.format<"u"){if(!Cc.call(Zi.formatters,e.format))throw new TypeError("Unknown format option provided.");i=e.format}var r=Zi.formatters[i],o=Se.filter;return(typeof e.filter=="function"||_t(e.filter))&&(o=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:Se.addQueryPrefix,allowDots:typeof e.allowDots>"u"?Se.allowDots:!!e.allowDots,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Se.charsetSentinel,delimiter:typeof e.delimiter>"u"?Se.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:Se.encode,encoder:typeof e.encoder=="function"?e.encoder:Se.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:Se.encodeValuesOnly,filter:o,format:i,formatter:r,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:Se.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:Se.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Se.strictNullHandling}},Sc=function(h,e){var t=h,i=Tc(e),r,o;typeof i.filter=="function"?(o=i.filter,t=o("",t)):_t(i.filter)&&(o=i.filter,r=o);var a=[];if(typeof t!="object"||t===null)return"";var u;e&&e.arrayFormat in va?u=e.arrayFormat:e&&"indices"in e?u=e.indices?"indices":"repeat":u="indices";var d=va[u];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var f=d==="comma"&&e&&e.commaRoundTrip;r||(r=Object.keys(t)),i.sort&&r.sort(i.sort);for(var g=ba(),y=0;y<r.length;++y){var w=r[y];i.skipNulls&&t[w]===null||wa(a,Rc(t[w],w,d,f,i.strictNullHandling,i.skipNulls,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,g))}var E=a.join(i.delimiter),S=i.addQueryPrefix===!0?"?":"";return i.charsetSentinel&&(i.charset==="iso-8859-1"?S+="utf8=%26%2310003%3B&":S+="utf8=%E2%9C%93&"),E.length>0?S+E:""},Ei=ga,ds=Object.prototype.hasOwnProperty,kc=Array.isArray,Ee={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Ei.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Mc=function(h){return h.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},Ca=function(h,e){return h&&typeof h=="string"&&e.comma&&h.indexOf(",")>-1?h.split(","):h},Lc="utf8=%26%2310003%3B",Ac="utf8=%E2%9C%93",Dc=function(e,t){var i={__proto__:null},r=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,o=t.parameterLimit===1/0?void 0:t.parameterLimit,a=r.split(t.delimiter,o),u=-1,d,f=t.charset;if(t.charsetSentinel)for(d=0;d<a.length;++d)a[d].indexOf("utf8=")===0&&(a[d]===Ac?f="utf-8":a[d]===Lc&&(f="iso-8859-1"),u=d,d=a.length);for(d=0;d<a.length;++d)if(d!==u){var g=a[d],y=g.indexOf("]="),w=y===-1?g.indexOf("="):y+1,E,S;w===-1?(E=t.decoder(g,Ee.decoder,f,"key"),S=t.strictNullHandling?null:""):(E=t.decoder(g.slice(0,w),Ee.decoder,f,"key"),S=Ei.maybeMap(Ca(g.slice(w+1),t),function(D){return t.decoder(D,Ee.decoder,f,"value")})),S&&t.interpretNumericEntities&&f==="iso-8859-1"&&(S=Mc(S)),g.indexOf("[]=")>-1&&(S=kc(S)?[S]:S),ds.call(i,E)?i[E]=Ei.combine(i[E],S):i[E]=S}return i},Fc=function(h,e,t,i){for(var r=i?e:Ca(e,t),o=h.length-1;o>=0;--o){var a,u=h[o];if(u==="[]"&&t.parseArrays)a=[].concat(r);else{a=t.plainObjects?Object.create(null):{};var d=u.charAt(0)==="["&&u.charAt(u.length-1)==="]"?u.slice(1,-1):u,f=parseInt(d,10);!t.parseArrays&&d===""?a={0:r}:!isNaN(f)&&u!==d&&String(f)===d&&f>=0&&t.parseArrays&&f<=t.arrayLimit?(a=[],a[f]=r):d!=="__proto__"&&(a[d]=r)}r=a}return r},Pc=function(e,t,i,r){if(e){var o=i.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/,u=/(\[[^[\]]*])/g,d=i.depth>0&&a.exec(o),f=d?o.slice(0,d.index):o,g=[];if(f){if(!i.plainObjects&&ds.call(Object.prototype,f)&&!i.allowPrototypes)return;g.push(f)}for(var y=0;i.depth>0&&(d=u.exec(o))!==null&&y<i.depth;){if(y+=1,!i.plainObjects&&ds.call(Object.prototype,d[1].slice(1,-1))&&!i.allowPrototypes)return;g.push(d[1])}return d&&g.push("["+o.slice(d.index)+"]"),Fc(g,t,i,r)}},Oc=function(e){if(!e)return Ee;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=typeof e.charset>"u"?Ee.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?Ee.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:Ee.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:Ee.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:Ee.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Ee.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:Ee.comma,decoder:typeof e.decoder=="function"?e.decoder:Ee.decoder,delimiter:typeof e.delimiter=="string"||Ei.isRegExp(e.delimiter)?e.delimiter:Ee.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:Ee.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:Ee.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:Ee.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:Ee.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Ee.strictNullHandling}},zc=function(h,e){var t=Oc(e);if(h===""||h===null||typeof h>"u")return t.plainObjects?Object.create(null):{};for(var i=typeof h=="string"?Dc(h,t):h,r=t.plainObjects?Object.create(null):{},o=Object.keys(i),a=0;a<o.length;++a){var u=o[a],d=Pc(u,i[u],t,typeof h=="string");r=Ei.merge(r,d,t)}return t.allowSparse===!0?r:Ei.compact(r)},Hc=Sc,Ic=zc,Nc=ls,Bc={formats:Nc,parse:Ic,stringify:Hc};const Vc=ju(Bc);function Wc(h){let e=[];function t(i){for(let r in i)typeof i[r]=="object"&&i[r]!==null&&(!["schema","columns"].includes(r)&&!W.has(i[r],"schema")&&W.get(i[r],"type")!="group"?(W.has(i[r],"placeholder")||(i[r].placeholder=W.get(i[r],"title")),i[r].field=r,e.push(i[r])):t(i[r]))}return t(h),e}const{event:Rt}=We.emitter,Gc=(h="myStore")=>Wo.defineStore(h,{state:()=>({mainKey:"",form:{},items:{},routes:{},fields:[],options:[],filters:[],loadings:{},structure:{},paginations:{},searchParam:"",isEditing:!1,panelName:!1,hiddenActions:[],isFiltering:!1,sorts:["id:desc"],selected:new Set([])}),getters:{getItems(e){return t=>W.get(e.items,t,[])},getPaginations(e){return t=>W.get(e.paginations,t,[])},mainItems(e){return W.get(e.items,e.mainKey,[])},mainPagination(e){return this.getPaginations(e.mainKey)},mainRoute(e){return W.get(e.routes,e.mainKey,"")},flatFields(e){let t=Wc(e.fields);return t.unshift(p.reactive({title:"",type:"hidden",value:"_select_",field:"_select_",align:"center",headerSort:!1})),t},formFields(e){return e.fields},flatFieldsWithoutActions(){return this.flatFields.filter(e=>!["_actions_","_index_","_select_"].includes(e.field))},headers(){return Jc(this.flatFields)},headersWithoutActions(){return this.headers.filter(e=>!["_actions_","_index_","_select_"].includes(e.field))}},actions:{reset(){this.items={},this.loadings={},this.routes={},this.options=[]},setData(e,t){this.items[e]=t},addData(e){Array.isArray(this.items[this.mainKey])||(this.items[this.mainKey]=[]),this.items[this.mainKey]=[e,...this.items[this.mainKey]]},editData(e){let t=this.items[this.mainKey];t=t.map(i=>i.id==e.id?{_index_:i._index_,...e}:i),this.items[this.mainKey]=[...t]},removeData(e){let t=this.items[this.mainKey];t=t.filter(i=>i.id!=e),this.items[this.mainKey]=[...t]},getModelKey(e){let t=typeof e=="string"?e.substr(e.lastIndexOf("/")+1):e.key;return this.mainKey=this.mainKey||Vr(t),Vr(t)},setPagination(e,t){t in this.paginations||(this.paginations[t]={total:0,currentPage:0,lastPage:0}),this.paginations[t].total=W.get(e,"total"),this.paginations[t].currentPage=W.get(e,"current_page"),this.paginations[t].lastPage=W.get(e,"last_page")},paginate(e){this.isFiltering?this.getWithFilter(e):this.loadItems(this.mainKey,e)},reloadData(){this.isFiltering?this.getWithFilter():this.loadItems()},loadItemsPlus(e=this.mainKey,t=1,i="",r=()=>{},o=!0){let a=W.get(this.routes,e,"").indexOf("?")>-1?"&page=":"?page=";this.loadings[e]=!0;const u=W.get(this.routes,e,"")+a+t+"&"+i;mt.get(u).then(d=>{if(d=W.get(d,"data",{}),Array.isArray(this.items[e])||(this.items[e]=[]),o)for(const f of d.data)this.items[e].push(f);else this.items[e]=d.data;this.setPagination(d,e)}).finally(()=>{r(),this.loadings[e]=!1})},convertToFilterForm(){var t;let e={};for(const i of this.filters)(t=i==null?void 0:i.field)!=null&&t.field&&(e[i.field.field]={[i.op]:i.value});return Vc.stringify({filters:e,sort:this.sorts},{encodeValuesOnly:!0})},async loadItems(e=this.mainKey,t=1){let i=W.get(this.routes,e,"").indexOf("?")>-1?"&page=":"?page=";i+=t,this.searchParam&&(i+="&search="+this.searchParam),this.loadings[e]=!0,this.loadings.mainLoading=e===this.mainKey;const r=W.get(this.routes,e,"")+i+"&"+this.convertToFilterForm();return mt.get(r).then(o=>{o=W.get(o,"data",{}),this.items[e]=W.get(o,"data"),this.setPagination(o,e)}).finally(()=>{this.loadings[e]=!1,this.loadings.mainLoading=!1})},customLoadItems(e,t=1,i=()=>({})){this.loadings[e]=!0,i(r=>{this.items[e]=r.data,this.setPagination(r,e)},()=>{},()=>{this.loadings[e]=!1},t)},getWithFilter(e=1,t=15){const i="http://192.168.190.10:9090/api/filter";return this.loadings.filter=!0,mt.post(`${i}?page=${e}`,{model:this.mainKey,itemPerPage:t,filters:this.filters}).then(r=>{r=W.get(r,"data",{}),this.items[this.mainKey]=r.data,this.setPagination(r,this.mainKey)}).finally(()=>{this.loadings.filter=!1})},addItem(e){this.loadings.mainLoading=!0;let t=this.routes[this.mainKey],i=Ta(e,this.flatFields);return mt.post(t,i).then(async()=>{this.reloadData(),Rt("alert",{text:"با موفقیت ثبت شد",color:"green"}),Rt("handleDialogForm",!1)}).catch(r=>{Rt("alert",{text:W.get(r,"response.message"),color:"red"})}).finally(()=>{this.loadings.mainLoading=!1})},editItem(e){let t=this.routes[this.mainKey].split("?")[0],i=Ta(e,this.flatFields);return this.loadings.mainLoading=!0,mt.patch(t+"/"+e.id,i).then(async()=>{this.reloadData(),Rt("alert",{text:"با موفقیت ویرایش شد",color:"green"}),Rt("handleDialogForm",!1)}).catch(r=>{Rt("alert",{text:W.get(r,"response.message"),color:"red"})}).finally(()=>{this.loadings.mainLoading=!1})},remove(e){const t=Array.isArray(e)?e:[e];let i=this.routes[this.mainKey].split("?")[0];this.loadings.mainLoading=!0,t.forEach(r=>{mt.delete(i+"/"+r).then(()=>{Rt("alert",{text:"با موفقیت حذف شد",color:"green"}),Rt("handleDeleteDialog",!1),this.removeData(e),this.reloadData()}).catch(o=>{Rt("alert",{text:W.get(o,"response.data.message"),color:"red"})}).finally(()=>{this.loadings.mainLoading=!1})})}}}),$c=h=>Gc(h)(),Uc=h=>({onChange:(...e)=>{window.tester=e[2];const t=e[2].form$.el$(h);t&&"clear"in t&&t.clear(),t&&"updateItems"in t&&t.updateItems()}}),jc=(h={})=>({search:!0,clearOnSearch:!0,type:"select",delay:1e3,object:!0,filterResults:!1,native:!1,formatter:e=>W.get(e.getValue(),W.get(h,"labelProp")),...h}),Kc=(h={})=>({search:!0,clearOnSearch:!0,type:"select",object:!0,native:!1,formatter:e=>W.get(e.getValue(),W.get(h,"labelProp"),e.getValue()),...h}),qc=(h={})=>({search:!0,clearOnSearch:!0,type:"multiselect",delay:1e3,object:!0,filterResults:!1,native:!1,formatter:e=>W.get(e.getValue(),W.get(h,"labelProp")),...h}),Ea=(h={})=>({search:!0,clearOnSearch:!0,type:"tags",delay:1e3,object:!0,filterResults:!1,hideSelected:!0,native:!1,formatter:e=>W.get(e.getValue(),W.get(h,"labelProp")),...h}),xa=(h={})=>({type:"date",...h}),_a={normalSelect:Kc,hasRel:Uc,select:jc,multiSelect:qc,tags:Ea,date:xa};let Ra={};function Ta(h,e){let t={},i=!1;for(let r in h){let o=Yc(r,e);if(!o)continue;i=!0;let a=Xc(o),u=r;W.has(o,"valueProp")&&(u+="."+W.get(o,"valueProp","")),t[a]=W.get(h,u)}return i?t:h}function Xc(h){return"sendKey"in h?h.sendKey:h.field}function Yc(h,e){return e.find(t=>t.field==h)}function Jc(h){let e=h.filter(i=>i.isHeader);e.push({title:"",value:"_actions_",field:"_actions_",type:"text",align:"left",headerSort:!1,hozAlign:"left",headerHozAlign:"left"});let t=0;return h.find(i=>i.field==="_select_"&&i.isHeader)&&(t=1),e.splice(t,0,{title:"#",type:"text",value:"_index_",field:"_index_",align:"center",headerSort:!1}),e}function Zc(h){for(const e of h)"init"in e&&e.init()}const Qc=h=>{const e=W.get(Ra,h);return e?p.markRaw(e):""},ef=h=>({url:e,key:t,foreignKey:i,dataKey:r}={url:!1,key:!1,foreignKey:!1,dataKey:!1})=>async(...o)=>{let a=o[0],u=e;i&&r&&(u+=u.includes("?")?"&":"?",u+=`filters[${i}][$eq]={${r}}`);const d=w=>{let E=w.substr(w.lastIndexOf("/")+1);return Vr(E)};typeof route=="string"&&(t=d(u)),(u.match(/\{(.*?)\}/g)||[]).forEach(w=>{const E=w.replace(/[{}]/g,"");u=u.replace(w,W.get(h.form,E,""))});const g=u.includes("?")?"&":"?",y=await mt.get(u+g+"search="+(a||""));return W.get(y,"data.data",[])},tf=(h,e)=>h({getRegisterField:Qc,axios:mt,get:ef(e),getSafe:W.get,useFields:_a}),Sa=h=>{Ra=h};function nf({fields:h,hiddenActions:e,options:t,route:i,structure:r}){const o=$c("Store-"+parseInt(Math.random()*1e7));o.fields=tf(h,o),We.emitter.event("beforeFormueInit");const a=o.getModelKey(i);return o.routes[a]=typeof i=="string"?i:i==null?void 0:i.route,o.loadItems(),o.options=t,o.hiddenActions=e,o.structure=r,Zc(o.flatFields),o}const rf={en:{clear:"Clear",no:"No",yes:"yes",alert_to_delete:"Are you sure to delete?",first:"First",previous:"Previous",next:"Next",last:"Last",apply_filter:"Apply filter",filter:"Filter",add_filter:"Add filter",clear_all:"Clear all",add:"Add",save:"Save",edit:"Edit",cancel:"Cancel",choose_filter:"Choose filter",select_type:"Select type",equal_to:"Equal to",not_equal_to:"Not equal to",greater_than:"Greater than",less_than:"Less than",look_like:"Look like",search:"Search ...",range:"Range",add:"Add",export:"Export",export_as_pdf:"Export as PDF",export_as_excel:" Export as Excel",print:"Print",reload:"Reload",select_row:"Select row",custom_column:"Custom column",filter_data:"Filter data",active_filter:"Active filter"},fa:{clear:"پاک کردن",no:"خیر",yes:"بله",alert_to_delete:"آیا از حذف کردن مطمئن هستید؟",first:"ابتدا",previous:"قبلی",next:"بعدی",last:"آخرین",apply_filter:"اعمال فیلتر",filter:"فیلتر",add_filter:"افزودن فیلتر",clear_all:"حذف فیلترها",add:"افرودن",save:"ذخیره",edit:"ویرایش",cancel:"لغو",choose_filter:"انتخاب فیلتر",select_type:"انتخاب کنید",equal_to:"برابر با",not_equal_to:"نابرابر با",greater_than:"بزرگتر از",less_than:"کوچکتر از",look_like:"مشابه",search:"جستجو ...",range:"محدوده",edit_filter:"ویرایش فیلتر",export:"خروجیگرفتن",export_as_pdf:"PDF خروجی",export_as_excel:"Excel خروجی",print:"خروجی چاپی",reload:"بارگذاری مجدد",select_row:"انتخاب ردیف",custom_column:"ستون سفارشی",filter_data:"فیلترکردن ",active_filter:"فیلترهای فعال",not_load_or_existing_data:"دیتایی وجود ندارد :(",filter_save_placeholder:"اسم فیلتر",not_filter_create_yes:"هنوز فیلتری ایجاد نشده است",operator:"عملگر",in:"برابر با مقادیر",not_in:"نابرابر با مقادیر",value:"مقدار",between:"از میان"}},Qi=Wo.defineStore("formuCrudLangs",{state:()=>({lang:"fa",dir:"rtl",langs:rf}),getters:{currentLang(h){return W.get(h.langs,h.lang,"fa")}},actions:{translate(h){return W.get(this.currentLang,h,h)}}});class Pe{constructor(e){this.table=e}reloadData(e,t,i){return this.table.dataLoader.load(e,void 0,void 0,void 0,t,i)}langText(){return this.table.modules.localize.getText(...arguments)}langBind(){return this.table.modules.localize.bind(...arguments)}langLocale(){return this.table.modules.localize.getLocale(...arguments)}commsConnections(){return this.table.modules.comms.getConnections(...arguments)}commsSend(){return this.table.modules.comms.send(...arguments)}layoutMode(){return this.table.modules.layout.getMode()}layoutRefresh(e){return this.table.modules.layout.layout(e)}subscribe(){return this.table.eventBus.subscribe(...arguments)}unsubscribe(){return this.table.eventBus.unsubscribe(...arguments)}subscribed(e){return this.table.eventBus.subscribed(e)}subscriptionChange(){return this.table.eventBus.subscriptionChange(...arguments)}dispatch(){return this.table.eventBus.dispatch(...arguments)}chain(){return this.table.eventBus.chain(...arguments)}confirm(){return this.table.eventBus.confirm(...arguments)}dispatchExternal(){return this.table.externalEvents.dispatch(...arguments)}subscribedExternal(e){return this.table.externalEvents.subscribed(e)}subscriptionChangeExternal(){return this.table.externalEvents.subscriptionChange(...arguments)}options(e){return this.table.options[e]}setOption(e,t){return typeof t<"u"&&(this.table.options[e]=t),this.table.options[e]}deprecationCheck(e,t){return this.table.deprecationAdvisor.check(e,t)}deprecationCheckMsg(e,t){return this.table.deprecationAdvisor.checkMsg(e,t)}deprecationMsg(e){return this.table.deprecationAdvisor.msg(e)}module(e){return this.table.module(e)}}class fe{static elVisible(e){return!(e.offsetWidth<=0&&e.offsetHeight<=0)}static elOffset(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset-document.documentElement.clientTop,left:t.left+window.pageXOffset-document.documentElement.clientLeft}}static deepClone(e,t,i=[]){var r={}.__proto__,o=[].__proto__;t||(t=Object.assign(Array.isArray(e)?[]:{},e));for(var a in e){let u=e[a],d,f;u!=null&&typeof u=="object"&&(u.__proto__===r||u.__proto__===o)&&(d=i.findIndex(g=>g.subject===u),d>-1?t[a]=i[d].copy:(f=Object.assign(Array.isArray(u)?[]:{},u),i.unshift({subject:u,copy:f}),t[a]=this.deepClone(u,f,i)))}return t}}class cs extends Pe{constructor(e,t,i){super(e),this.element=t,this.container=this._lookupContainer(),this.parent=i,this.reversedX=!1,this.childPopup=null,this.blurable=!1,this.blurCallback=null,this.blurEventsBound=!1,this.renderedCallback=null,this.visible=!1,this.hideable=!0,this.element.classList.add("tabulator-popup-container"),this.blurEvent=this.hide.bind(this,!1),this.escEvent=this._escapeCheck.bind(this),this.destroyBinding=this.tableDestroyed.bind(this),this.destroyed=!1}tableDestroyed(){this.destroyed=!0,this.hide(!0)}_lookupContainer(){var e=this.table.options.popupContainer;return typeof e=="string"?(e=document.querySelector(e),e||console.warn("Menu Error - no container element found matching selector:",this.table.options.popupContainer,"(defaulting to document body)")):e===!0&&(e=this.table.element),e&&!this._checkContainerIsParent(e)&&(e=!1,console.warn("Menu Error - container element does not contain this table:",this.table.options.popupContainer,"(defaulting to document body)")),e||(e=document.body),e}_checkContainerIsParent(e,t=this.table.element){return e===t?!0:t.parentNode?this._checkContainerIsParent(e,t.parentNode):!1}renderCallback(e){this.renderedCallback=e}containerEventCoords(e){var t=!(e instanceof MouseEvent),i=t?e.touches[0].pageX:e.pageX,r=t?e.touches[0].pageY:e.pageY;if(this.container!==document.body){let o=fe.elOffset(this.container);i-=o.left,r-=o.top}return{x:i,y:r}}elementPositionCoords(e,t="right"){var i=fe.elOffset(e),r,o,a;switch(this.container!==document.body&&(r=fe.elOffset(this.container),i.left-=r.left,i.top-=r.top),t){case"right":o=i.left+e.offsetWidth,a=i.top-1;break;case"bottom":o=i.left,a=i.top+e.offsetHeight;break;case"left":o=i.left,a=i.top-1;break;case"top":o=i.left,a=i.top;break;case"center":o=i.left+e.offsetWidth/2,a=i.top+e.offsetHeight/2;break}return{x:o,y:a,offset:i}}show(e,t){var i,r,o,a,u;return this.destroyed||this.table.destroyed?this:(e instanceof HTMLElement?(o=e,u=this.elementPositionCoords(e,t),a=u.offset,i=u.x,r=u.y):typeof e=="number"?(a={top:0,left:0},i=e,r=t):(u=this.containerEventCoords(e),i=u.x,r=u.y,this.reversedX=!1),this.element.style.top=r+"px",this.element.style.left=i+"px",this.container.appendChild(this.element),typeof this.renderedCallback=="function"&&this.renderedCallback(),this._fitToScreen(i,r,o,a,t),this.visible=!0,this.subscribe("table-destroy",this.destroyBinding),this.element.addEventListener("mousedown",d=>{d.stopPropagation()}),this)}_fitToScreen(e,t,i,r,o){var a=this.container===document.body?document.documentElement.scrollTop:this.container.scrollTop;if((e+this.element.offsetWidth>=this.container.offsetWidth||this.reversedX)&&(this.element.style.left="",i?this.element.style.right=this.container.offsetWidth-r.left+"px":this.element.style.right=this.container.offsetWidth-e+"px",this.reversedX=!0),t+this.element.offsetHeight>Math.max(this.container.offsetHeight,a?this.container.scrollHeight:0))if(i)switch(o){case"bottom":this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight-i.offsetHeight-1+"px";break;default:this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight+i.offsetHeight+1+"px"}else this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight+"px"}isVisible(){return this.visible}hideOnBlur(e){return this.blurable=!0,this.visible&&(setTimeout(()=>{this.visible&&(this.table.rowManager.element.addEventListener("scroll",this.blurEvent),this.subscribe("cell-editing",this.blurEvent),document.body.addEventListener("click",this.blurEvent),document.body.addEventListener("contextmenu",this.blurEvent),document.body.addEventListener("mousedown",this.blurEvent),window.addEventListener("resize",this.blurEvent),document.body.addEventListener("keydown",this.escEvent),this.blurEventsBound=!0)},100),this.blurCallback=e),this}_escapeCheck(e){e.keyCode==27&&this.hide()}blockHide(){this.hideable=!1}restoreHide(){this.hideable=!0}hide(e=!1){return this.visible&&this.hideable&&(this.blurable&&this.blurEventsBound&&(document.body.removeEventListener("keydown",this.escEvent),document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),document.body.removeEventListener("mousedown",this.blurEvent),window.removeEventListener("resize",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent),this.unsubscribe("cell-editing",this.blurEvent),this.blurEventsBound=!1),this.childPopup&&this.childPopup.hide(),this.parent&&(this.parent.childPopup=null),this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.visible=!1,this.blurCallback&&!e&&this.blurCallback(),this.unsubscribe("table-destroy",this.destroyBinding)),this}child(e){return this.childPopup&&this.childPopup.hide(),this.childPopup=new cs(this.table,e,this),this.childPopup}}class ee extends Pe{constructor(e,t){super(e),this._handler=null}initialize(){}registerTableOption(e,t){this.table.optionsList.register(e,t)}registerColumnOption(e,t){this.table.columnManager.optionsList.register(e,t)}registerTableFunction(e,t){typeof this.table[e]>"u"?this.table[e]=(...i)=>(this.table.initGuard(e),t(...i)):console.warn("Unable to bind table function, name already in use",e)}registerComponentFunction(e,t,i){return this.table.componentFunctionBinder.bind(e,t,i)}registerDataHandler(e,t){this.table.rowManager.registerDataPipelineHandler(e,t),this._handler=e}registerDisplayHandler(e,t){this.table.rowManager.registerDisplayPipelineHandler(e,t),this._handler=e}displayRows(e){var t=this.table.rowManager.displayRows.length-1,i;if(this._handler&&(i=this.table.rowManager.displayPipeline.findIndex(r=>r.handler===this._handler),i>-1&&(t=i)),e&&(t=t+e),this._handler)return t>-1?this.table.rowManager.getDisplayRows(t):this.activeRows()}activeRows(){return this.table.rowManager.activeRows}refreshData(e,t){t||(t=this._handler),t&&this.table.rowManager.refreshActiveData(t,!1,e)}footerAppend(e){return this.table.footerManager.append(e)}footerPrepend(e){return this.table.footerManager.prepend(e)}footerRemove(e){return this.table.footerManager.remove(e)}popup(e,t){return new cs(this.table,e,t)}alert(e,t){return this.table.alertManager.alert(e,t)}clearAlert(){return this.table.alertManager.clear()}}var sf={};class xi extends ee{constructor(e){super(e),this.allowedTypes=["","data","download","clipboard","print","htmlOutput"],this.registerColumnOption("accessor"),this.registerColumnOption("accessorParams"),this.registerColumnOption("accessorData"),this.registerColumnOption("accessorDataParams"),this.registerColumnOption("accessorDownload"),this.registerColumnOption("accessorDownloadParams"),this.registerColumnOption("accessorClipboard"),this.registerColumnOption("accessorClipboardParams"),this.registerColumnOption("accessorPrint"),this.registerColumnOption("accessorPrintParams"),this.registerColumnOption("accessorHtmlOutput"),this.registerColumnOption("accessorHtmlOutputParams")}initialize(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-retrieve",this.transformRow.bind(this))}initializeColumn(e){var t=!1,i={};this.allowedTypes.forEach(r=>{var o="accessor"+(r.charAt(0).toUpperCase()+r.slice(1)),a;e.definition[o]&&(a=this.lookupAccessor(e.definition[o]),a&&(t=!0,i[o]={accessor:a,params:e.definition[o+"Params"]||{}}))}),t&&(e.modules.accessor=i)}lookupAccessor(e){var t=!1;switch(typeof e){case"string":xi.accessors[e]?t=xi.accessors[e]:console.warn("Accessor Error - No such accessor found, ignoring: ",e);break;case"function":t=e;break}return t}transformRow(e,t){var i="accessor"+(t.charAt(0).toUpperCase()+t.slice(1)),r=e.getComponent(),o=fe.deepClone(e.data||{});return this.table.columnManager.traverse(function(a){var u,d,f,g;a.modules.accessor&&(d=a.modules.accessor[i]||a.modules.accessor.accessor||!1,d&&(u=a.getFieldValue(o),u!="undefined"&&(g=a.getComponent(),f=typeof d.params=="function"?d.params(u,o,t,g,r):d.params,a.setFieldValue(o,d.accessor(u,o,t,f,g,r)))))}),o}}xi.moduleName="accessor",xi.accessors=sf;var of={method:"GET"};function fs(h,e){var t=[];if(e=e||"",Array.isArray(h))h.forEach((r,o)=>{t=t.concat(fs(r,e?e+"["+o+"]":o))});else if(typeof h=="object")for(var i in h)t=t.concat(fs(h[i],e?e+"["+i+"]":i));else t.push({key:e,value:h});return t}function af(h){var e=fs(h),t=[];return e.forEach(function(i){t.push(encodeURIComponent(i.key)+"="+encodeURIComponent(i.value))}),t.join("&")}function ka(h,e,t){return h&&t&&Object.keys(t).length&&(!e.method||e.method.toLowerCase()=="get")&&(e.method="get",h+=(h.includes("?")?"&":"?")+af(t)),h}function lf(h,e,t){var i;return new Promise((r,o)=>{if(h=this.urlGenerator.call(this.table,h,e,t),e.method.toUpperCase()!="GET")if(i=typeof this.table.options.ajaxContentType=="object"?this.table.options.ajaxContentType:this.contentTypeFormatters[this.table.options.ajaxContentType],i){for(var a in i.headers)e.headers||(e.headers={}),typeof e.headers[a]>"u"&&(e.headers[a]=i.headers[a]);e.body=i.body.call(this,h,e,t)}else console.warn("Ajax Error - Invalid ajaxContentType value:",this.table.options.ajaxContentType);h?(typeof e.headers>"u"&&(e.headers={}),typeof e.headers.Accept>"u"&&(e.headers.Accept="application/json"),typeof e.headers["X-Requested-With"]>"u"&&(e.headers["X-Requested-With"]="XMLHttpRequest"),typeof e.mode>"u"&&(e.mode="cors"),e.mode=="cors"?(typeof e.headers.Origin>"u"&&(e.headers.Origin=window.location.origin),typeof e.credentials>"u"&&(e.credentials="same-origin")):typeof e.credentials>"u"&&(e.credentials="include"),fetch(h,e).then(u=>{u.ok?u.json().then(d=>{r(d)}).catch(d=>{o(d),console.warn("Ajax Load Error - Invalid JSON returned",d)}):(console.error("Ajax Load Error - Connection Error: "+u.status,u.statusText),o(u))}).catch(u=>{console.error("Ajax Load Error - Connection Error: ",u),o(u)})):(console.warn("Ajax Load Error - No URL Set"),r([]))})}function ps(h,e){var t=[];if(e=e||"",Array.isArray(h))h.forEach((r,o)=>{t=t.concat(ps(r,e?e+"["+o+"]":o))});else if(typeof h=="object")for(var i in h)t=t.concat(ps(h[i],e?e+"["+i+"]":i));else t.push({key:e,value:h});return t}var hf={json:{headers:{"Content-Type":"application/json"},body:function(h,e,t){return JSON.stringify(t)}},form:{headers:{},body:function(h,e,t){var i=ps(t),r=new FormData;return i.forEach(function(o){r.append(o.key,o.value)}),r}}};class at extends ee{constructor(e){super(e),this.config={},this.url="",this.urlGenerator=!1,this.params=!1,this.loaderPromise=!1,this.registerTableOption("ajaxURL",!1),this.registerTableOption("ajaxURLGenerator",!1),this.registerTableOption("ajaxParams",{}),this.registerTableOption("ajaxConfig","get"),this.registerTableOption("ajaxContentType","form"),this.registerTableOption("ajaxRequestFunc",!1),this.registerTableOption("ajaxRequesting",function(){}),this.registerTableOption("ajaxResponse",!1),this.contentTypeFormatters=at.contentTypeFormatters}initialize(){this.loaderPromise=this.table.options.ajaxRequestFunc||at.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||at.defaultURLGenerator,this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.setDefaultConfig(this.table.options.ajaxConfig),this.registerTableFunction("getAjaxUrl",this.getUrl.bind(this)),this.subscribe("data-loading",this.requestDataCheck.bind(this)),this.subscribe("data-params",this.requestParams.bind(this)),this.subscribe("data-load",this.requestData.bind(this))}requestParams(e,t,i,r){var o=this.table.options.ajaxParams;return o&&(typeof o=="function"&&(o=o.call(this.table)),r=Object.assign(r,o)),r}requestDataCheck(e,t,i,r){return!!(!e&&this.url||typeof e=="string")}requestData(e,t,i,r,o){var a;return!o&&this.requestDataCheck(e)?(e&&this.setUrl(e),a=this.generateConfig(i),this.sendRequest(this.url,t,a)):o}setDefaultConfig(e={}){this.config=Object.assign({},at.defaultConfig),typeof e=="string"?this.config.method=e:Object.assign(this.config,e)}generateConfig(e={}){var t=Object.assign({},this.config);return typeof e=="string"?t.method=e:Object.assign(t,e),t}setUrl(e){this.url=e}getUrl(){return this.url}sendRequest(e,t,i){return this.table.options.ajaxRequesting.call(this.table,e,t)!==!1?this.loaderPromise(e,i,t).then(r=>(this.table.options.ajaxResponse&&(r=this.table.options.ajaxResponse.call(this.table,e,t,r)),r)):Promise.reject()}}at.moduleName="ajax",at.defaultConfig=of,at.defaultURLGenerator=ka,at.defaultLoaderPromise=lf,at.contentTypeFormatters=hf;var uf={replace:function(h){return this.table.setData(h)},update:function(h){return this.table.updateOrAddData(h)},insert:function(h){return this.table.addData(h)}},df={table:function(h){var e=[],t=!0,i=this.table.columnManager.columns,r=[],o=[];return h=h.split(`
|
31
31
|
`),h.forEach(function(a){e.push(a.split(" "))}),e.length&&!(e.length===1&&e[0].length<2)?(e[0].forEach(function(a){var u=i.find(function(d){return a&&d.definition.title&&a.trim()&&d.definition.title.trim()===a.trim()});u?r.push(u):t=!1}),t||(t=!0,r=[],e[0].forEach(function(a){var u=i.find(function(d){return a&&d.field&&a.trim()&&d.field.trim()===a.trim()});u?r.push(u):t=!1}),t||(r=this.table.columnManager.columnsByIndex)),t&&e.shift(),e.forEach(function(a){var u={};a.forEach(function(d,f){r[f]&&(u[r[f].field]=d)}),o.push(u)}),o):!1}};class ii extends ee{constructor(e){super(e),this.mode=!0,this.pasteParser=function(){},this.pasteAction=function(){},this.customSelection=!1,this.rowRange=!1,this.blocked=!0,this.registerTableOption("clipboard",!1),this.registerTableOption("clipboardCopyStyled",!0),this.registerTableOption("clipboardCopyConfig",!1),this.registerTableOption("clipboardCopyFormatter",!1),this.registerTableOption("clipboardCopyRowRange","active"),this.registerTableOption("clipboardPasteParser","table"),this.registerTableOption("clipboardPasteAction","insert"),this.registerColumnOption("clipboard"),this.registerColumnOption("titleClipboard")}initialize(){this.mode=this.table.options.clipboard,this.rowRange=this.table.options.clipboardCopyRowRange,(this.mode===!0||this.mode==="copy")&&this.table.element.addEventListener("copy",e=>{var t,i,r;this.blocked||(e.preventDefault(),this.customSelection?(t=this.customSelection,this.table.options.clipboardCopyFormatter&&(t=this.table.options.clipboardCopyFormatter("plain",t))):(r=this.table.modules.export.generateExportList(this.table.options.clipboardCopyConfig,this.table.options.clipboardCopyStyled,this.rowRange,"clipboard"),i=this.table.modules.export.generateHTMLTable(r),t=i?this.generatePlainContent(r):"",this.table.options.clipboardCopyFormatter&&(t=this.table.options.clipboardCopyFormatter("plain",t),i=this.table.options.clipboardCopyFormatter("html",i))),window.clipboardData&&window.clipboardData.setData?window.clipboardData.setData("Text",t):e.clipboardData&&e.clipboardData.setData?(e.clipboardData.setData("text/plain",t),i&&e.clipboardData.setData("text/html",i)):e.originalEvent&&e.originalEvent.clipboardData.setData&&(e.originalEvent.clipboardData.setData("text/plain",t),i&&e.originalEvent.clipboardData.setData("text/html",i)),this.dispatchExternal("clipboardCopied",t,i),this.reset())}),(this.mode===!0||this.mode==="paste")&&this.table.element.addEventListener("paste",e=>{this.paste(e)}),this.setPasteParser(this.table.options.clipboardPasteParser),this.setPasteAction(this.table.options.clipboardPasteAction),this.registerTableFunction("copyToClipboard",this.copy.bind(this))}reset(){this.blocked=!0,this.customSelection=!1}generatePlainContent(e){var t=[];return e.forEach(i=>{var r=[];i.columns.forEach(o=>{var a="";if(o)if(i.type==="group"&&(o.value=o.component.getKey()),o.value===null)a="";else switch(typeof o.value){case"object":a=JSON.stringify(o.value);break;case"undefined":a="";break;default:a=o.value}r.push(a)}),t.push(r.join(" "))}),t.join(`
|
32
32
|
`)}copy(e,t){var i,r;this.blocked=!1,this.customSelection=!1,(this.mode===!0||this.mode==="copy")&&(this.rowRange=e||this.table.options.clipboardCopyRowRange,typeof window.getSelection<"u"&&typeof document.createRange<"u"?(e=document.createRange(),e.selectNodeContents(this.table.element),i=window.getSelection(),i.toString()&&t&&(this.customSelection=i.toString()),i.removeAllRanges(),i.addRange(e)):typeof document.selection<"u"&&typeof document.body.createTextRange<"u"&&(r=document.body.createTextRange(),r.moveToElementText(this.table.element),r.select()),document.execCommand("copy"),i&&i.removeAllRanges())}setPasteAction(e){switch(typeof e){case"string":this.pasteAction=ii.pasteActions[e],this.pasteAction||console.warn("Clipboard Error - No such paste action found:",e);break;case"function":this.pasteAction=e;break}}setPasteParser(e){switch(typeof e){case"string":this.pasteParser=ii.pasteParsers[e],this.pasteParser||console.warn("Clipboard Error - No such paste parser found:",e);break;case"function":this.pasteParser=e;break}}paste(e){var t,i,r;this.checkPaseOrigin(e)&&(t=this.getPasteData(e),i=this.pasteParser.call(this,t),i?(e.preventDefault(),this.table.modExists("mutator")&&(i=this.mutateData(i)),r=this.pasteAction.call(this,i),this.dispatchExternal("clipboardPasted",t,i,r)):this.dispatchExternal("clipboardPasteError",t))}mutateData(e){var t=[];return Array.isArray(e)?e.forEach(i=>{t.push(this.table.modules.mutator.transformRow(i,"clipboard"))}):t=e,t}checkPaseOrigin(e){var t=!0;return(e.target.tagName!="DIV"||this.table.modules.edit.currentCell)&&(t=!1),t}getPasteData(e){var t;return window.clipboardData&&window.clipboardData.getData?t=window.clipboardData.getData("Text"):e.clipboardData&&e.clipboardData.getData?t=e.clipboardData.getData("text/plain"):e.originalEvent&&e.originalEvent.clipboardData.getData&&(t=e.originalEvent.clipboardData.getData("text/plain")),t}}ii.moduleName="clipboard",ii.pasteActions=uf,ii.pasteParsers=df;class cf{constructor(e){return this._row=e,new Proxy(this,{get:function(t,i,r){return typeof t[i]<"u"?t[i]:t._row.table.componentFunctionBinder.handle("row",t._row,i)}})}getData(e){return this._row.getData(e)}getElement(){return this._row.getElement()}getTable(){return this._row.table}getCells(){var e=[];return this._row.getCells().forEach(function(t){e.push(t.getComponent())}),e}getCell(e){var t=this._row.getCell(e);return t?t.getComponent():!1}_getSelf(){return this._row}}class Ma{constructor(e){return this._cell=e,new Proxy(this,{get:function(t,i,r){return typeof t[i]<"u"?t[i]:t._cell.table.componentFunctionBinder.handle("cell",t._cell,i)}})}getValue(){return this._cell.getValue()}getOldValue(){return this._cell.getOldValue()}getInitialValue(){return this._cell.initialValue}getElement(){return this._cell.getElement()}getRow(){return this._cell.row.getComponent()}getData(e){return this._cell.row.getData(e)}getType(){return"cell"}getField(){return this._cell.column.getField()}getColumn(){return this._cell.column.getComponent()}setValue(e,t){typeof t>"u"&&(t=!0),this._cell.setValue(e,t)}restoreOldValue(){this._cell.setValueActual(this._cell.getOldValue())}restoreInitialValue(){this._cell.setValueActual(this._cell.initialValue)}checkHeight(){this._cell.checkHeight()}getTable(){return this._cell.table}_getSelf(){return this._cell}}class en extends Pe{constructor(e,t){super(e.table),this.table=e.table,this.column=e,this.row=t,this.element=null,this.value=null,this.initialValue,this.oldValue=null,this.modules={},this.height=null,this.width=null,this.minWidth=null,this.component=null,this.loaded=!1,this.build()}build(){this.generateElement(),this.setWidth(),this._configureCell(),this.setValueActual(this.column.getFieldValue(this.row.data)),this.initialValue=this.value}generateElement(){this.element=document.createElement("div"),this.element.className="tabulator-cell",this.element.setAttribute("role","gridcell")}_configureCell(){var e=this.element,t=this.column.getField(),i={top:"flex-start",bottom:"flex-end",middle:"center"},r={left:"flex-start",right:"flex-end",center:"center"};if(e.style.textAlign=this.column.hozAlign,this.column.vertAlign&&(e.style.display="inline-flex",e.style.alignItems=i[this.column.vertAlign]||"",this.column.hozAlign&&(e.style.justifyContent=r[this.column.hozAlign]||"")),t&&e.setAttribute("tabulator-field",t),this.column.definition.cssClass){var o=this.column.definition.cssClass.split(" ");o.forEach(a=>{e.classList.add(a)})}this.dispatch("cell-init",this),this.column.visible||this.hide()}_generateContents(){var e;switch(e=this.chain("cell-format",this,null,()=>this.element.innerHTML=this.value),typeof e){case"object":if(e instanceof Node){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.element.appendChild(e)}else this.element.innerHTML="",e!=null&&console.warn("Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",e);break;case"undefined":this.element.innerHTML="";break;default:this.element.innerHTML=e}}cellRendered(){this.dispatch("cell-rendered",this)}getElement(e){return this.loaded||(this.loaded=!0,e||this.layoutElement()),this.element}getValue(){return this.value}getOldValue(){return this.oldValue}setValue(e,t,i){var r=this.setValueProcessData(e,t,i);r&&(this.dispatch("cell-value-updated",this),this.cellRendered(),this.column.definition.cellEdited&&this.column.definition.cellEdited.call(this.table,this.getComponent()),this.dispatchExternal("cellEdited",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()))}setValueProcessData(e,t,i){var r=!1;return(this.value!==e||i)&&(r=!0,t&&(e=this.chain("cell-value-changing",[this,e],null,e))),this.setValueActual(e),r&&this.dispatch("cell-value-changed",this),r}setValueActual(e){this.oldValue=this.value,this.value=e,this.dispatch("cell-value-save-before",this),this.column.setFieldValue(this.row.data,e),this.dispatch("cell-value-save-after",this),this.loaded&&this.layoutElement()}layoutElement(){this._generateContents(),this.dispatch("cell-layout",this)}setWidth(){this.width=this.column.width,this.element.style.width=this.column.widthStyled}clearWidth(){this.width="",this.element.style.width=""}getWidth(){return this.width||this.element.offsetWidth}setMinWidth(){this.minWidth=this.column.minWidth,this.element.style.minWidth=this.column.minWidthStyled}setMaxWidth(){this.maxWidth=this.column.maxWidth,this.element.style.maxWidth=this.column.maxWidthStyled}checkHeight(){this.row.reinitializeHeight()}clearHeight(){this.element.style.height="",this.height=null,this.dispatch("cell-height",this,"")}setHeight(){this.height=this.row.height,this.element.style.height=this.row.heightStyled,this.dispatch("cell-height",this,this.row.heightStyled)}getHeight(){return this.height||this.element.offsetHeight}show(){this.element.style.display=this.column.vertAlign?"inline-flex":""}hide(){this.element.style.display="none"}delete(){this.dispatch("cell-delete",this),!this.table.rowManager.redrawBlock&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=!1,this.column.deleteCell(this),this.row.deleteCell(this),this.calcs={}}getIndex(){return this.row.getCellIndex(this)}getComponent(){return this.component||(this.component=new Ma(this)),this.component}}class La{constructor(e){return this._column=e,this.type="ColumnComponent",new Proxy(this,{get:function(t,i,r){return typeof t[i]<"u"?t[i]:t._column.table.componentFunctionBinder.handle("column",t._column,i)}})}getElement(){return this._column.getElement()}getDefinition(){return this._column.getDefinition()}getField(){return this._column.getField()}getTitleDownload(){return this._column.getTitleDownload()}getCells(){var e=[];return this._column.cells.forEach(function(t){e.push(t.getComponent())}),e}isVisible(){return this._column.visible}show(){this._column.isGroup?this._column.columns.forEach(function(e){e.show()}):this._column.show()}hide(){this._column.isGroup?this._column.columns.forEach(function(e){e.hide()}):this._column.hide()}toggle(){this._column.visible?this.hide():this.show()}delete(){return this._column.delete()}getSubColumns(){var e=[];return this._column.columns.length&&this._column.columns.forEach(function(t){e.push(t.getComponent())}),e}getParentColumn(){return this._column.parent instanceof vt?this._column.parent.getComponent():!1}_getSelf(){return this._column}scrollTo(e,t){return this._column.table.columnManager.scrollToColumn(this._column,e,t)}getTable(){return this._column.table}move(e,t){var i=this._column.table.columnManager.findColumn(e);i?this._column.table.columnManager.moveColumn(this._column,i,t):console.warn("Move Error - No matching column found:",i)}getNextColumn(){var e=this._column.nextColumn();return e?e.getComponent():!1}getPrevColumn(){var e=this._column.prevColumn();return e?e.getComponent():!1}updateDefinition(e){return this._column.updateDefinition(e)}getWidth(){return this._column.getWidth()}setWidth(e){var t;return e===!0?t=this._column.reinitializeWidth(!0):t=this._column.setWidth(e),this._column.table.columnManager.rerenderColumns(!0),t}}var Aa={title:void 0,field:void 0,columns:void 0,visible:void 0,hozAlign:void 0,vertAlign:void 0,width:void 0,minWidth:40,maxWidth:void 0,maxInitialWidth:void 0,cssClass:void 0,variableHeight:void 0,headerVertical:void 0,headerHozAlign:void 0,headerWordWrap:!1,editableTitle:void 0};class vt extends Pe{constructor(e,t){super(t.table),this.definition=e,this.parent=t,this.type="column",this.columns=[],this.cells=[],this.element=this.createElement(),this.contentElement=!1,this.titleHolderElement=!1,this.titleElement=!1,this.groupElement=this.createGroupElement(),this.isGroup=!1,this.hozAlign="",this.vertAlign="",this.field="",this.fieldStructure="",this.getFieldValue="",this.setFieldValue="",this.titleDownload=null,this.titleFormatterRendered=!1,this.mapDefinitions(),this.setField(this.definition.field),this.modules={},this.width=null,this.widthStyled="",this.maxWidth=null,this.maxWidthStyled="",this.maxInitialWidth=null,this.minWidth=null,this.minWidthStyled="",this.widthFixed=!1,this.visible=!0,this.component=null,this.definition.columns?(this.isGroup=!0,this.definition.columns.forEach((i,r)=>{var o=new vt(i,this);this.attachColumn(o)}),this.checkColumnVisibility()):t.registerColumnField(this),this._initialize()}createElement(){var e=document.createElement("div");switch(e.classList.add("tabulator-col"),e.setAttribute("role","columnheader"),e.setAttribute("aria-sort","none"),this.table.options.columnHeaderVertAlign){case"middle":e.style.justifyContent="center";break;case"bottom":e.style.justifyContent="flex-end";break}return e}createGroupElement(){var e=document.createElement("div");return e.classList.add("tabulator-col-group-cols"),e}mapDefinitions(){var e=this.table.options.columnDefaults;if(e)for(let t in e)typeof this.definition[t]>"u"&&(this.definition[t]=e[t]);this.definition=this.table.columnManager.optionsList.generate(vt.defaultOptionList,this.definition)}checkDefinition(){Object.keys(this.definition).forEach(e=>{vt.defaultOptionList.indexOf(e)===-1&&console.warn("Invalid column definition option in '"+(this.field||this.definition.title)+"' column:",e)})}setField(e){this.field=e,this.fieldStructure=e?this.table.options.nestedFieldSeparator?e.split(this.table.options.nestedFieldSeparator):[e]:[],this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData,this.setFieldValue=this.fieldStructure.length>1?this._setNestedData:this._setFlatData}registerColumnPosition(e){this.parent.registerColumnPosition(e)}registerColumnField(e){this.parent.registerColumnField(e)}reRegisterPosition(){this.isGroup?this.columns.forEach(function(e){e.reRegisterPosition()}):this.registerColumnPosition(this)}_initialize(){for(var e=this.definition;this.element.firstChild;)this.element.removeChild(this.element.firstChild);e.headerVertical&&(this.element.classList.add("tabulator-col-vertical"),e.headerVertical==="flip"&&this.element.classList.add("tabulator-col-vertical-flip")),this.contentElement=this._buildColumnHeaderContent(),this.element.appendChild(this.contentElement),this.isGroup?this._buildGroupHeader():this._buildColumnHeader(),this.dispatch("column-init",this)}_buildColumnHeader(){var e=this.definition;if(this.dispatch("column-layout",this),typeof e.visible<"u"&&(e.visible?this.show(!0):this.hide(!0)),e.cssClass){var t=e.cssClass.split(" ");t.forEach(i=>{this.element.classList.add(i)})}e.field&&this.element.setAttribute("tabulator-field",e.field),this.setMinWidth(parseInt(e.minWidth)),e.maxInitialWidth&&(this.maxInitialWidth=parseInt(e.maxInitialWidth)),e.maxWidth&&this.setMaxWidth(parseInt(e.maxWidth)),this.reinitializeWidth(),this.hozAlign=this.definition.hozAlign,this.vertAlign=this.definition.vertAlign,this.titleElement.style.textAlign=this.definition.headerHozAlign}_buildColumnHeaderContent(){var e=document.createElement("div");return e.classList.add("tabulator-col-content"),this.titleHolderElement=document.createElement("div"),this.titleHolderElement.classList.add("tabulator-col-title-holder"),e.appendChild(this.titleHolderElement),this.titleElement=this._buildColumnHeaderTitle(),this.titleHolderElement.appendChild(this.titleElement),e}_buildColumnHeaderTitle(){var e=this.definition,t=document.createElement("div");if(t.classList.add("tabulator-col-title"),e.headerWordWrap&&t.classList.add("tabulator-col-title-wrap"),e.editableTitle){var i=document.createElement("input");i.classList.add("tabulator-title-editor"),i.addEventListener("click",r=>{r.stopPropagation(),i.focus()}),i.addEventListener("change",()=>{e.title=i.value,this.dispatchExternal("columnTitleChanged",this.getComponent())}),t.appendChild(i),e.field?this.langBind("columns|"+e.field,r=>{i.value=r||e.title||" "}):i.value=e.title||" "}else e.field?this.langBind("columns|"+e.field,r=>{this._formatColumnHeaderTitle(t,r||e.title||" ")}):this._formatColumnHeaderTitle(t,e.title||" ");return t}_formatColumnHeaderTitle(e,t){var i=this.chain("column-format",[this,t,e],null,()=>t);switch(typeof i){case"object":i instanceof Node?e.appendChild(i):(e.innerHTML="",console.warn("Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",i));break;case"undefined":e.innerHTML="";break;default:e.innerHTML=i}}_buildGroupHeader(){if(this.element.classList.add("tabulator-col-group"),this.element.setAttribute("role","columngroup"),this.element.setAttribute("aria-title",this.definition.title),this.definition.cssClass){var e=this.definition.cssClass.split(" ");e.forEach(t=>{this.element.classList.add(t)})}this.titleElement.style.textAlign=this.definition.headerHozAlign,this.element.appendChild(this.groupElement)}_getFlatData(e){return e[this.field]}_getNestedData(e){var t=e,i=this.fieldStructure,r=i.length,o;for(let a=0;a<r&&(t=t[i[a]],o=t,!!t);a++);return o}_setFlatData(e,t){this.field&&(e[this.field]=t)}_setNestedData(e,t){var i=e,r=this.fieldStructure,o=r.length;for(let a=0;a<o;a++)if(a==o-1)i[r[a]]=t;else{if(!i[r[a]])if(typeof t<"u")i[r[a]]={};else break;i=i[r[a]]}}attachColumn(e){this.groupElement?(this.columns.push(e),this.groupElement.appendChild(e.getElement()),e.columnRendered()):console.warn("Column Warning - Column being attached to another column instead of column group")}verticalAlign(e,t){var i=this.parent.isGroup?this.parent.getGroupElement().clientHeight:t||this.parent.getHeadersElement().clientHeight;this.element.style.height=i+"px",this.dispatch("column-height",this,this.element.style.height),this.isGroup&&(this.groupElement.style.minHeight=i-this.contentElement.offsetHeight+"px"),this.columns.forEach(function(r){r.verticalAlign(e)})}clearVerticalAlign(){this.element.style.paddingTop="",this.element.style.height="",this.element.style.minHeight="",this.groupElement.style.minHeight="",this.columns.forEach(function(e){e.clearVerticalAlign()}),this.dispatch("column-height",this,"")}getElement(){return this.element}getGroupElement(){return this.groupElement}getField(){return this.field}getTitleDownload(){return this.titleDownload}getFirstColumn(){return this.isGroup?this.columns.length?this.columns[0].getFirstColumn():!1:this}getLastColumn(){return this.isGroup?this.columns.length?this.columns[this.columns.length-1].getLastColumn():!1:this}getColumns(e){var t=[];return e?this.columns.forEach(i=>{t.push(i),t=t.concat(i.getColumns(!0))}):t=this.columns,t}getCells(){return this.cells}getTopColumn(){return this.parent.isGroup?this.parent.getTopColumn():this}getDefinition(e){var t=[];return this.isGroup&&e&&(this.columns.forEach(function(i){t.push(i.getDefinition(!0))}),this.definition.columns=t),this.definition}checkColumnVisibility(){var e=!1;this.columns.forEach(function(t){t.visible&&(e=!0)}),e?(this.show(),this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!1)):this.hide()}show(e,t){this.visible||(this.visible=!0,this.element.style.display="",this.parent.isGroup&&this.parent.checkColumnVisibility(),this.cells.forEach(function(i){i.show()}),!this.isGroup&&this.width===null&&this.reinitializeWidth(),this.table.columnManager.verticalAlignHeaders(),this.dispatch("column-show",this,t),e||this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!0),this.parent.isGroup&&this.parent.matchChildWidths(),this.silent||this.table.columnManager.rerenderColumns())}hide(e,t){this.visible&&(this.visible=!1,this.element.style.display="none",this.table.columnManager.verticalAlignHeaders(),this.parent.isGroup&&this.parent.checkColumnVisibility(),this.cells.forEach(function(i){i.hide()}),this.dispatch("column-hide",this,t),e||this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!1),this.parent.isGroup&&this.parent.matchChildWidths(),this.silent||this.table.columnManager.rerenderColumns())}matchChildWidths(){var e=0;this.contentElement&&this.columns.length&&(this.columns.forEach(function(t){t.visible&&(e+=t.getWidth())}),this.contentElement.style.maxWidth=e-1+"px",this.parent.isGroup&&this.parent.matchChildWidths())}removeChild(e){var t=this.columns.indexOf(e);t>-1&&this.columns.splice(t,1),this.columns.length||this.delete()}setWidth(e){this.widthFixed=!0,this.setWidthActual(e)}setWidthActual(e){isNaN(e)&&(e=Math.floor(this.table.element.clientWidth/100*parseInt(e))),e=Math.max(this.minWidth,e),this.maxWidth&&(e=Math.min(this.maxWidth,e)),this.width=e,this.widthStyled=e?e+"px":"",this.element.style.width=this.widthStyled,this.isGroup||this.cells.forEach(function(t){t.setWidth()}),this.parent.isGroup&&this.parent.matchChildWidths(),this.dispatch("column-width",this)}checkCellHeights(){var e=[];this.cells.forEach(function(t){t.row.heightInitialized&&(t.row.getElement().offsetParent!==null?(e.push(t.row),t.row.clearCellHeight()):t.row.heightInitialized=!1)}),e.forEach(function(t){t.calcHeight()}),e.forEach(function(t){t.setCellHeight()})}getWidth(){var e=0;return this.isGroup?this.columns.forEach(function(t){t.visible&&(e+=t.getWidth())}):e=this.width,e}getLeftOffset(){var e=this.element.offsetLeft;return this.parent.isGroup&&(e+=this.parent.getLeftOffset()),e}getHeight(){return Math.ceil(this.element.getBoundingClientRect().height)}setMinWidth(e){this.maxWidth&&e>this.maxWidth&&(e=this.maxWidth,console.warn("the minWidth ("+e+"px) for column '"+this.field+"' cannot be bigger that its maxWidth ("+this.maxWidthStyled+")")),this.minWidth=e,this.minWidthStyled=e?e+"px":"",this.element.style.minWidth=this.minWidthStyled,this.cells.forEach(function(t){t.setMinWidth()})}setMaxWidth(e){this.minWidth&&e<this.minWidth&&(e=this.minWidth,console.warn("the maxWidth ("+e+"px) for column '"+this.field+"' cannot be smaller that its minWidth ("+this.minWidthStyled+")")),this.maxWidth=e,this.maxWidthStyled=e?e+"px":"",this.element.style.maxWidth=this.maxWidthStyled,this.cells.forEach(function(t){t.setMaxWidth()})}delete(){return new Promise((e,t)=>{this.isGroup&&this.columns.forEach(function(r){r.delete()}),this.dispatch("column-delete",this);var i=this.cells.length;for(let r=0;r<i;r++)this.cells[0].delete();this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=!1,this.contentElement=!1,this.titleElement=!1,this.groupElement=!1,this.parent.isGroup&&this.parent.removeChild(this),this.table.columnManager.deregisterColumn(this),this.table.columnManager.rerenderColumns(!0),e()})}columnRendered(){this.titleFormatterRendered&&this.titleFormatterRendered(),this.dispatch("column-rendered",this)}generateCell(e){var t=new en(this,e);return this.cells.push(t),t}nextColumn(){var e=this.table.columnManager.findColumnIndex(this);return e>-1?this._nextVisibleColumn(e+1):!1}_nextVisibleColumn(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._nextVisibleColumn(e+1)}prevColumn(){var e=this.table.columnManager.findColumnIndex(this);return e>-1?this._prevVisibleColumn(e-1):!1}_prevVisibleColumn(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._prevVisibleColumn(e-1)}reinitializeWidth(e){this.widthFixed=!1,typeof this.definition.width<"u"&&!e&&this.setWidth(this.definition.width),this.dispatch("column-width-fit-before",this),this.fitToData(e),this.dispatch("column-width-fit-after",this)}fitToData(e){if(!this.isGroup){this.widthFixed||(this.element.style.width="",this.cells.forEach(r=>{r.clearWidth()}));var t=this.element.offsetWidth;if((!this.width||!this.widthFixed)&&(this.cells.forEach(r=>{var o=r.getWidth();o>t&&(t=o)}),t)){var i=t+1;this.maxInitialWidth&&!e&&(i=Math.min(i,this.maxInitialWidth)),this.setWidthActual(i)}}}updateDefinition(e){var t;return this.isGroup||this.parent.isGroup?(console.error("Column Update Error - The updateDefinition function is only available on ungrouped columns"),Promise.reject("Column Update Error - The updateDefinition function is only available on columns, not column groups")):(t=Object.assign({},this.getDefinition()),t=Object.assign(t,e),this.table.columnManager.addColumn(t,!1,this).then(i=>(t.field==this.field&&(this.field=!1),this.delete().then(()=>i.getComponent()))))}deleteCell(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)}getComponent(){return this.component||(this.component=new La(this)),this.component}}vt.defaultOptionList=Aa;class Vn{constructor(e){return this._row=e,new Proxy(this,{get:function(t,i,r){return typeof t[i]<"u"?t[i]:t._row.table.componentFunctionBinder.handle("row",t._row,i)}})}getData(e){return this._row.getData(e)}getElement(){return this._row.getElement()}getCells(){var e=[];return this._row.getCells().forEach(function(t){e.push(t.getComponent())}),e}getCell(e){var t=this._row.getCell(e);return t?t.getComponent():!1}getIndex(){return this._row.getData("data")[this._row.table.options.index]}getPosition(){return this._row.getPosition()}watchPosition(e){return this._row.watchPosition(e)}delete(){return this._row.delete()}scrollTo(e,t){return this._row.table.rowManager.scrollToRow(this._row,e,t)}move(e,t){this._row.moveToRow(e,t)}update(e){return this._row.updateData(e)}normalizeHeight(){this._row.normalizeHeight(!0)}_getSelf(){return this._row}reformat(){return this._row.reinitialize()}getTable(){return this._row.table}getNextRow(){var e=this._row.nextRow();return e&&e.getComponent()}getPrevRow(){var e=this._row.prevRow();return e&&e.getComponent()}}class Le extends Pe{constructor(e,t,i="row"){super(t.table),this.parent=t,this.data={},this.type=i,this.element=!1,this.modules={},this.cells=[],this.height=0,this.heightStyled="",this.manualHeight=!1,this.outerHeight=0,this.initialized=!1,this.heightInitialized=!1,this.position=0,this.positionWatchers=[],this.component=null,this.created=!1,this.setData(e)}create(){this.created||(this.created=!0,this.generateElement())}createElement(){var e=document.createElement("div");e.classList.add("tabulator-row"),e.setAttribute("role","row"),this.element=e}getElement(){return this.create(),this.element}detachElement(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}generateElement(){this.createElement(),this.dispatch("row-init",this)}generateCells(){this.cells=this.table.columnManager.generateCells(this)}initialize(e,t){if(this.create(),!this.initialized||e){for(this.deleteCells();this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.dispatch("row-layout-before",this),this.generateCells(),this.initialized=!0,this.table.columnManager.renderer.renderRowCells(this,t),e&&this.normalizeHeight(),this.dispatch("row-layout",this),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent()),this.dispatch("row-layout-after",this)}else this.table.columnManager.renderer.rerenderRowCells(this,t)}rendered(){this.cells.forEach(e=>{e.cellRendered()})}reinitializeHeight(){this.heightInitialized=!1,this.element&&this.element.offsetParent!==null&&this.normalizeHeight(!0)}deinitialize(){this.initialized=!1}deinitializeHeight(){this.heightInitialized=!1}reinitialize(e){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),this.element&&this.element.offsetParent!==null&&this.initialize(!0),this.dispatch("row-relayout",this)}calcHeight(e){var t=0,i;this.table.options.rowHeight?this.height=this.table.options.rowHeight:(i=this.table.options.resizableRows?this.element.clientHeight:0,this.cells.forEach(function(r){var o=r.getHeight();o>t&&(t=o)}),e?this.height=Math.max(t,i):this.height=this.manualHeight?this.height:Math.max(t,i)),this.heightStyled=this.height?this.height+"px":"",this.outerHeight=this.element.offsetHeight}setCellHeight(){this.cells.forEach(function(e){e.setHeight()}),this.heightInitialized=!0}clearCellHeight(){this.cells.forEach(function(e){e.clearHeight()})}normalizeHeight(e){e&&!this.table.options.rowHeight&&this.clearCellHeight(),this.calcHeight(e),this.setCellHeight()}setHeight(e,t){(this.height!=e||t)&&(this.manualHeight=!0,this.height=e,this.heightStyled=e?e+"px":"",this.setCellHeight(),this.outerHeight=this.element.offsetHeight)}getHeight(){return this.outerHeight}getWidth(){return this.element.offsetWidth}deleteCell(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)}setData(e){this.data=this.chain("row-data-init-before",[this,e],void 0,e),this.dispatch("row-data-init-after",this)}updateData(e){var t=this.element&&fe.elVisible(this.element),i={},r;return new Promise((o,a)=>{typeof e=="string"&&(e=JSON.parse(e)),this.dispatch("row-data-save-before",this),this.subscribed("row-data-changing")&&(i=Object.assign(i,this.data),i=Object.assign(i,e)),r=this.chain("row-data-changing",[this,i,e],null,e);for(let u in r)this.data[u]=r[u];this.dispatch("row-data-save-after",this);for(let u in e)this.table.columnManager.getColumnsByFieldRoot(u).forEach(f=>{let g=this.getCell(f.getField());if(g){let y=f.getFieldValue(r);g.getValue()!==y&&(g.setValueProcessData(y),t&&g.cellRendered())}});t?(this.normalizeHeight(!0),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent())):(this.initialized=!1,this.height=0,this.heightStyled=""),this.dispatch("row-data-changed",this,t,e),this.dispatchExternal("rowUpdated",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()),o()})}getData(e){return e?this.chain("row-data-retrieve",[this,e],null,this.data):this.data}getCell(e){var t=!1;return e=this.table.columnManager.findColumn(e),!this.initialized&&this.cells.length===0&&this.generateCells(),t=this.cells.find(function(i){return i.column===e}),t}getCellIndex(e){return this.cells.findIndex(function(t){return t===e})}findCell(e){return this.cells.find(t=>t.element===e)}getCells(){return!this.initialized&&this.cells.length===0&&this.generateCells(),this.cells}nextRow(){var e=this.table.rowManager.nextDisplayRow(this,!0);return e||!1}prevRow(){var e=this.table.rowManager.prevDisplayRow(this,!0);return e||!1}moveToRow(e,t){var i=this.table.rowManager.findRow(e);i?(this.table.rowManager.moveRowActual(this,i,!t),this.table.rowManager.refreshActiveData("display",!1,!0)):console.warn("Move Error - No matching row found:",e)}delete(){return this.dispatch("row-delete",this),this.deleteActual(),Promise.resolve()}deleteActual(e){this.detachModules(),this.table.rowManager.deleteRow(this,e),this.deleteCells(),this.initialized=!1,this.heightInitialized=!1,this.element=!1,this.dispatch("row-deleted",this)}detachModules(){this.dispatch("row-deleting",this)}deleteCells(){var e=this.cells.length;for(let t=0;t<e;t++)this.cells[0].delete()}wipe(){if(this.detachModules(),this.deleteCells(),this.element){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.element.parentNode&&this.element.parentNode.removeChild(this.element)}this.element=!1,this.modules={}}isDisplayed(){return this.table.rowManager.getDisplayRows().includes(this)}getPosition(){return this.isDisplayed()?this.position:!1}setPosition(e){e!=this.position&&(this.position=e,this.positionWatchers.forEach(t=>{t(this.position)}))}watchPosition(e){this.positionWatchers.push(e),e(this.position)}getGroup(){return this.modules.group||!1}getComponent(){return this.component||(this.component=new Vn(this)),this.component}}var ff={avg:function(h,e,t){var i=0,r=typeof t.precision<"u"?t.precision:2;return h.length&&(i=h.reduce(function(o,a){return Number(o)+Number(a)}),i=i/h.length,i=r!==!1?i.toFixed(r):i),parseFloat(i).toString()},max:function(h,e,t){var i=null,r=typeof t.precision<"u"?t.precision:!1;return h.forEach(function(o){o=Number(o),(o>i||i===null)&&(i=o)}),i!==null?r!==!1?i.toFixed(r):i:""},min:function(h,e,t){var i=null,r=typeof t.precision<"u"?t.precision:!1;return h.forEach(function(o){o=Number(o),(o<i||i===null)&&(i=o)}),i!==null?r!==!1?i.toFixed(r):i:""},sum:function(h,e,t){var i=0,r=typeof t.precision<"u"?t.precision:!1;return h.length&&h.forEach(function(o){o=Number(o),i+=isNaN(o)?0:Number(o)}),r!==!1?i.toFixed(r):i},concat:function(h,e,t){var i=0;return h.length&&(i=h.reduce(function(r,o){return String(r)+String(o)})),i},count:function(h,e,t){var i=0;return h.length&&h.forEach(function(r){r&&i++}),i},unique:function(h,e,t){var i=h.filter((r,o)=>(h||r===0)&&h.indexOf(r)===o);return i.length}};class Bt extends ee{constructor(e){super(e),this.topCalcs=[],this.botCalcs=[],this.genColumn=!1,this.topElement=this.createElement(),this.botElement=this.createElement(),this.topRow=!1,this.botRow=!1,this.topInitialized=!1,this.botInitialized=!1,this.blocked=!1,this.recalcAfterBlock=!1,this.registerTableOption("columnCalcs",!0),this.registerColumnOption("topCalc"),this.registerColumnOption("topCalcParams"),this.registerColumnOption("topCalcFormatter"),this.registerColumnOption("topCalcFormatterParams"),this.registerColumnOption("bottomCalc"),this.registerColumnOption("bottomCalcParams"),this.registerColumnOption("bottomCalcFormatter"),this.registerColumnOption("bottomCalcFormatterParams")}createElement(){var e=document.createElement("div");return e.classList.add("tabulator-calcs-holder"),e}initialize(){this.genColumn=new vt({field:"value"},this),this.subscribe("cell-value-changed",this.cellValueChanged.bind(this)),this.subscribe("column-init",this.initializeColumnCheck.bind(this)),this.subscribe("row-deleted",this.rowsUpdated.bind(this)),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this)),this.subscribe("row-added",this.rowsUpdated.bind(this)),this.subscribe("column-moved",this.recalcActiveRows.bind(this)),this.subscribe("column-add",this.recalcActiveRows.bind(this)),this.subscribe("data-refreshed",this.recalcActiveRowsRefresh.bind(this)),this.subscribe("table-redraw",this.tableRedraw.bind(this)),this.subscribe("rows-visible",this.visibleRows.bind(this)),this.subscribe("scrollbar-vertical",this.adjustForScrollbar.bind(this)),this.subscribe("redraw-blocked",this.blockRedraw.bind(this)),this.subscribe("redraw-restored",this.restoreRedraw.bind(this)),this.subscribe("table-redrawing",this.resizeHolderWidth.bind(this)),this.subscribe("column-resized",this.resizeHolderWidth.bind(this)),this.subscribe("column-show",this.resizeHolderWidth.bind(this)),this.subscribe("column-hide",this.resizeHolderWidth.bind(this)),this.registerTableFunction("getCalcResults",this.getResults.bind(this)),this.registerTableFunction("recalc",this.userRecalc.bind(this)),this.resizeHolderWidth()}resizeHolderWidth(){this.topElement.style.minWidth=this.table.columnManager.headersElement.offsetWidth+"px"}tableRedraw(e){this.recalc(this.table.rowManager.activeRows),e&&this.redraw()}blockRedraw(){this.blocked=!0,this.recalcAfterBlock=!1}restoreRedraw(){this.blocked=!1,this.recalcAfterBlock&&(this.recalcAfterBlock=!1,this.recalcActiveRowsRefresh())}userRecalc(){this.recalc(this.table.rowManager.activeRows)}blockCheck(){return this.blocked&&(this.recalcAfterBlock=!0),this.blocked}visibleRows(e,t){return this.topRow&&t.unshift(this.topRow),this.botRow&&t.push(this.botRow),t}rowsUpdated(e){this.table.options.groupBy?this.recalcRowGroup(e):this.recalcActiveRows()}recalcActiveRowsRefresh(){this.table.options.groupBy&&this.table.options.dataTreeStartExpanded&&this.table.options.dataTree?this.recalcAll():this.recalcActiveRows()}recalcActiveRows(){this.recalc(this.table.rowManager.activeRows)}cellValueChanged(e){(e.column.definition.topCalc||e.column.definition.bottomCalc)&&(this.table.options.groupBy?((this.table.options.columnCalcs=="table"||this.table.options.columnCalcs=="both")&&this.recalcActiveRows(),this.table.options.columnCalcs!="table"&&this.recalcRowGroup(e.row)):this.recalcActiveRows())}initializeColumnCheck(e){(e.definition.topCalc||e.definition.bottomCalc)&&this.initializeColumn(e)}initializeColumn(e){var t=e.definition,i={topCalcParams:t.topCalcParams||{},botCalcParams:t.bottomCalcParams||{}};if(t.topCalc){switch(typeof t.topCalc){case"string":Bt.calculations[t.topCalc]?i.topCalc=Bt.calculations[t.topCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",t.topCalc);break;case"function":i.topCalc=t.topCalc;break}i.topCalc&&(e.modules.columnCalcs=i,this.topCalcs.push(e),this.table.options.columnCalcs!="group"&&this.initializeTopRow())}if(t.bottomCalc){switch(typeof t.bottomCalc){case"string":Bt.calculations[t.bottomCalc]?i.botCalc=Bt.calculations[t.bottomCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",t.bottomCalc);break;case"function":i.botCalc=t.bottomCalc;break}i.botCalc&&(e.modules.columnCalcs=i,this.botCalcs.push(e),this.table.options.columnCalcs!="group"&&this.initializeBottomRow())}}registerColumnField(){}removeCalcs(){var e=!1;this.topInitialized&&(this.topInitialized=!1,this.topElement.parentNode.removeChild(this.topElement),e=!0),this.botInitialized&&(this.botInitialized=!1,this.footerRemove(this.botElement),e=!0),e&&this.table.rowManager.adjustTableSize()}reinitializeCalcs(){this.topCalcs.length&&this.initializeTopRow(),this.botCalcs.length&&this.initializeBottomRow()}initializeTopRow(){this.topInitialized||(this.table.columnManager.getContentsElement().insertBefore(this.topElement,this.table.columnManager.headersElement.nextSibling),this.topInitialized=!0)}initializeBottomRow(){this.botInitialized||(this.footerPrepend(this.botElement),this.botInitialized=!0)}scrollHorizontal(e){this.botInitialized&&this.botRow&&(this.botElement.scrollLeft=e)}recalc(e){var t,i;if(!this.blockCheck()&&(this.topInitialized||this.botInitialized)){if(t=this.rowsToData(e),this.topInitialized){for(this.topRow&&this.topRow.deleteCells(),i=this.generateRow("top",t),this.topRow=i;this.topElement.firstChild;)this.topElement.removeChild(this.topElement.firstChild);this.topElement.appendChild(i.getElement()),i.initialize(!0)}if(this.botInitialized){for(this.botRow&&this.botRow.deleteCells(),i=this.generateRow("bottom",t),this.botRow=i;this.botElement.firstChild;)this.botElement.removeChild(this.botElement.firstChild);this.botElement.appendChild(i.getElement()),i.initialize(!0)}this.table.rowManager.adjustTableSize(),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout()}}recalcRowGroup(e){this.recalcGroup(this.table.modules.groupRows.getRowGroup(e))}recalcAll(){if((this.topCalcs.length||this.botCalcs.length)&&(this.table.options.columnCalcs!=="group"&&this.recalcActiveRows(),this.table.options.groupBy&&this.table.options.columnCalcs!=="table")){var e=this.table.modules.groupRows.getChildGroups();e.forEach(t=>{this.recalcGroup(t)})}}recalcGroup(e){var t,i;this.blockCheck()||e&&e.calcs&&(e.calcs.bottom&&(t=this.rowsToData(e.rows),i=this.generateRowData("bottom",t),e.calcs.bottom.updateData(i),e.calcs.bottom.reinitialize()),e.calcs.top&&(t=this.rowsToData(e.rows),i=this.generateRowData("top",t),e.calcs.top.updateData(i),e.calcs.top.reinitialize()))}generateTopRow(e){return this.generateRow("top",this.rowsToData(e))}generateBottomRow(e){return this.generateRow("bottom",this.rowsToData(e))}rowsToData(e){var t=[];return e.forEach(i=>{if(t.push(i.getData()),this.table.options.dataTree&&this.table.options.dataTreeChildColumnCalcs&&i.modules.dataTree&&i.modules.dataTree.open){var r=this.rowsToData(this.table.modules.dataTree.getFilteredTreeChildren(i));t=t.concat(r)}}),t}generateRow(e,t){var i=this.generateRowData(e,t),r;return this.table.modExists("mutator")&&this.table.modules.mutator.disable(),r=new Le(i,this,"calc"),this.table.modExists("mutator")&&this.table.modules.mutator.enable(),r.getElement().classList.add("tabulator-calcs","tabulator-calcs-"+e),r.component=!1,r.getComponent=()=>(r.component||(r.component=new cf(r)),r.component),r.generateCells=()=>{var o=[];this.table.columnManager.columnsByIndex.forEach(a=>{this.genColumn.setField(a.getField()),this.genColumn.hozAlign=a.hozAlign,a.definition[e+"CalcFormatter"]&&this.table.modExists("format")?this.genColumn.modules.format={formatter:this.table.modules.format.getFormatter(a.definition[e+"CalcFormatter"]),params:a.definition[e+"CalcFormatterParams"]||{}}:this.genColumn.modules.format={formatter:this.table.modules.format.getFormatter("plaintext"),params:{}},this.genColumn.definition.cssClass=a.definition.cssClass;var u=new en(this.genColumn,r);u.getElement(),u.column=a,u.setWidth(),a.cells.push(u),o.push(u),a.visible||u.hide()}),r.cells=o},r}generateRowData(e,t){var i={},r=e=="top"?this.topCalcs:this.botCalcs,o=e=="top"?"topCalc":"botCalc",a,u;return r.forEach(function(d){var f=[];d.modules.columnCalcs&&d.modules.columnCalcs[o]&&(t.forEach(function(g){f.push(d.getFieldValue(g))}),u=o+"Params",a=typeof d.modules.columnCalcs[u]=="function"?d.modules.columnCalcs[u](f,t):d.modules.columnCalcs[u],d.setFieldValue(i,d.modules.columnCalcs[o](f,t,a)))}),i}hasTopCalcs(){return!!this.topCalcs.length}hasBottomCalcs(){return!!this.botCalcs.length}redraw(){this.topRow&&this.topRow.normalizeHeight(!0),this.botRow&&this.botRow.normalizeHeight(!0)}getResults(){var e={},t;return this.table.options.groupBy&&this.table.modExists("groupRows")?(t=this.table.modules.groupRows.getGroups(!0),t.forEach(i=>{e[i.getKey()]=this.getGroupResults(i)})):e={top:this.topRow?this.topRow.getData():{},bottom:this.botRow?this.botRow.getData():{}},e}getGroupResults(e){var t=e._getSelf(),i=e.getSubGroups(),r={},o={};return i.forEach(a=>{r[a.getKey()]=this.getGroupResults(a)}),o={top:t.calcs.top?t.calcs.top.getData():{},bottom:t.calcs.bottom?t.calcs.bottom.getData():{},groups:r},o}adjustForScrollbar(e){this.botRow&&(this.table.rtl?this.botElement.style.paddingLeft=e+"px":this.botElement.style.paddingRight=e+"px")}}Bt.moduleName="columnCalcs",Bt.calculations=ff;class Da extends ee{constructor(e){super(e),this.indent=10,this.field="",this.collapseEl=null,this.expandEl=null,this.branchEl=null,this.elementField=!1,this.startOpen=function(){},this.registerTableOption("dataTree",!1),this.registerTableOption("dataTreeFilter",!0),this.registerTableOption("dataTreeSort",!0),this.registerTableOption("dataTreeElementColumn",!1),this.registerTableOption("dataTreeBranchElement",!0),this.registerTableOption("dataTreeChildIndent",9),this.registerTableOption("dataTreeChildField","_children"),this.registerTableOption("dataTreeCollapseElement",!1),this.registerTableOption("dataTreeExpandElement",!1),this.registerTableOption("dataTreeStartExpanded",!1),this.registerTableOption("dataTreeChildColumnCalcs",!1),this.registerTableOption("dataTreeSelectPropagate",!1),this.registerComponentFunction("row","treeCollapse",this.collapseRow.bind(this)),this.registerComponentFunction("row","treeExpand",this.expandRow.bind(this)),this.registerComponentFunction("row","treeToggle",this.toggleRow.bind(this)),this.registerComponentFunction("row","getTreeParent",this.getTreeParent.bind(this)),this.registerComponentFunction("row","getTreeChildren",this.getRowChildren.bind(this)),this.registerComponentFunction("row","addTreeChild",this.addTreeChildRow.bind(this)),this.registerComponentFunction("row","isTreeExpanded",this.isRowExpanded.bind(this))}initialize(){if(this.table.options.dataTree){var e=null,t=this.table.options;switch(this.field=t.dataTreeChildField,this.indent=t.dataTreeChildIndent,this.options("movableRows")&&console.warn("The movableRows option is not available with dataTree enabled, moving of child rows could result in unpredictable behavior"),t.dataTreeBranchElement?t.dataTreeBranchElement===!0?(this.branchEl=document.createElement("div"),this.branchEl.classList.add("tabulator-data-tree-branch")):typeof t.dataTreeBranchElement=="string"?(e=document.createElement("div"),e.innerHTML=t.dataTreeBranchElement,this.branchEl=e.firstChild):this.branchEl=t.dataTreeBranchElement:(this.branchEl=document.createElement("div"),this.branchEl.classList.add("tabulator-data-tree-branch-empty")),t.dataTreeCollapseElement?typeof t.dataTreeCollapseElement=="string"?(e=document.createElement("div"),e.innerHTML=t.dataTreeCollapseElement,this.collapseEl=e.firstChild):this.collapseEl=t.dataTreeCollapseElement:(this.collapseEl=document.createElement("div"),this.collapseEl.classList.add("tabulator-data-tree-control"),this.collapseEl.tabIndex=0,this.collapseEl.innerHTML="<div class='tabulator-data-tree-control-collapse'></div>"),t.dataTreeExpandElement?typeof t.dataTreeExpandElement=="string"?(e=document.createElement("div"),e.innerHTML=t.dataTreeExpandElement,this.expandEl=e.firstChild):this.expandEl=t.dataTreeExpandElement:(this.expandEl=document.createElement("div"),this.expandEl.classList.add("tabulator-data-tree-control"),this.expandEl.tabIndex=0,this.expandEl.innerHTML="<div class='tabulator-data-tree-control-expand'></div>"),typeof t.dataTreeStartExpanded){case"boolean":this.startOpen=function(i,r){return t.dataTreeStartExpanded};break;case"function":this.startOpen=t.dataTreeStartExpanded;break;default:this.startOpen=function(i,r){return t.dataTreeStartExpanded[r]};break}this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-layout-after",this.layoutRow.bind(this)),this.subscribe("row-deleted",this.rowDelete.bind(this),0),this.subscribe("row-data-changed",this.rowDataChanged.bind(this),10),this.subscribe("cell-value-updated",this.cellValueChanged.bind(this)),this.subscribe("edit-cancelled",this.cellValueChanged.bind(this)),this.subscribe("column-moving-rows",this.columnMoving.bind(this)),this.subscribe("table-built",this.initializeElementField.bind(this)),this.subscribe("table-redrawing",this.tableRedrawing.bind(this)),this.registerDisplayHandler(this.getRows.bind(this),30)}}tableRedrawing(e){var t;e&&(t=this.table.rowManager.getRows(),t.forEach(i=>{this.reinitializeRowChildren(i)}))}initializeElementField(){var e=this.table.columnManager.getFirstVisibleColumn();this.elementField=this.table.options.dataTreeElementColumn||(e?e.field:!1)}getRowChildren(e){return this.getTreeChildren(e,!0)}columnMoving(){var e=[];return this.table.rowManager.rows.forEach(t=>{e=e.concat(this.getTreeChildren(t,!1,!0))}),e}rowDataChanged(e,t,i){this.redrawNeeded(i)&&(this.initializeRow(e),t&&(this.layoutRow(e),this.refreshData(!0)))}cellValueChanged(e){var t=e.column.getField();t===this.elementField&&this.layoutRow(e.row)}initializeRow(e){var t=e.getData()[this.field],i=Array.isArray(t),r=i||!i&&typeof t=="object"&&t!==null;!r&&e.modules.dataTree&&e.modules.dataTree.branchEl&&e.modules.dataTree.branchEl.parentNode.removeChild(e.modules.dataTree.branchEl),!r&&e.modules.dataTree&&e.modules.dataTree.controlEl&&e.modules.dataTree.controlEl.parentNode.removeChild(e.modules.dataTree.controlEl),e.modules.dataTree={index:e.modules.dataTree?e.modules.dataTree.index:0,open:r?e.modules.dataTree?e.modules.dataTree.open:this.startOpen(e.getComponent(),0):!1,controlEl:e.modules.dataTree&&r?e.modules.dataTree.controlEl:!1,branchEl:e.modules.dataTree&&r?e.modules.dataTree.branchEl:!1,parent:e.modules.dataTree?e.modules.dataTree.parent:!1,children:r}}reinitializeRowChildren(e){var t=this.getTreeChildren(e,!1,!0);t.forEach(function(i){i.reinitialize(!0)})}layoutRow(e){var t=this.elementField?e.getCell(this.elementField):e.getCells()[0],i=t.getElement(),r=e.modules.dataTree;r.branchEl&&(r.branchEl.parentNode&&r.branchEl.parentNode.removeChild(r.branchEl),r.branchEl=!1),r.controlEl&&(r.controlEl.parentNode&&r.controlEl.parentNode.removeChild(r.controlEl),r.controlEl=!1),this.generateControlElement(e,i),e.getElement().classList.add("tabulator-tree-level-"+r.index),r.index&&(this.branchEl?(r.branchEl=this.branchEl.cloneNode(!0),i.insertBefore(r.branchEl,i.firstChild),this.table.rtl?r.branchEl.style.marginRight=(r.branchEl.offsetWidth+r.branchEl.style.marginLeft)*(r.index-1)+r.index*this.indent+"px":r.branchEl.style.marginLeft=(r.branchEl.offsetWidth+r.branchEl.style.marginRight)*(r.index-1)+r.index*this.indent+"px"):this.table.rtl?i.style.paddingRight=parseInt(window.getComputedStyle(i,null).getPropertyValue("padding-right"))+r.index*this.indent+"px":i.style.paddingLeft=parseInt(window.getComputedStyle(i,null).getPropertyValue("padding-left"))+r.index*this.indent+"px")}generateControlElement(e,t){var i=e.modules.dataTree,r=i.controlEl;t=t||e.getCells()[0].getElement(),i.children!==!1&&(i.open?(i.controlEl=this.collapseEl.cloneNode(!0),i.controlEl.addEventListener("click",o=>{o.stopPropagation(),this.collapseRow(e)})):(i.controlEl=this.expandEl.cloneNode(!0),i.controlEl.addEventListener("click",o=>{o.stopPropagation(),this.expandRow(e)})),i.controlEl.addEventListener("mousedown",o=>{o.stopPropagation()}),r&&r.parentNode===t?r.parentNode.replaceChild(i.controlEl,r):t.insertBefore(i.controlEl,t.firstChild))}getRows(e){var t=[];return e.forEach((i,r)=>{var o,a;t.push(i),i instanceof Le&&(i.create(),o=i.modules.dataTree,!o.index&&o.children!==!1&&(a=this.getChildren(i),a.forEach(u=>{u.create(),t.push(u)})))}),t}getChildren(e,t){var i=e.modules.dataTree,r=[],o=[];return i.children!==!1&&(i.open||t)&&(Array.isArray(i.children)||(i.children=this.generateChildren(e)),this.table.modExists("filter")&&this.table.options.dataTreeFilter?r=this.table.modules.filter.filter(i.children):r=i.children,this.table.modExists("sort")&&this.table.options.dataTreeSort&&this.table.modules.sort.sort(r),r.forEach(a=>{o.push(a);var u=this.getChildren(a);u.forEach(d=>{o.push(d)})})),o}generateChildren(e){var t=[],i=e.getData()[this.field];return Array.isArray(i)||(i=[i]),i.forEach(r=>{var o=new Le(r||{},this.table.rowManager);o.create(),o.modules.dataTree.index=e.modules.dataTree.index+1,o.modules.dataTree.parent=e,o.modules.dataTree.children&&(o.modules.dataTree.open=this.startOpen(o.getComponent(),o.modules.dataTree.index)),t.push(o)}),t}expandRow(e,t){var i=e.modules.dataTree;i.children!==!1&&(i.open=!0,e.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowExpanded",e.getComponent(),e.modules.dataTree.index))}collapseRow(e){var t=e.modules.dataTree;t.children!==!1&&(t.open=!1,e.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowCollapsed",e.getComponent(),e.modules.dataTree.index))}toggleRow(e){var t=e.modules.dataTree;t.children!==!1&&(t.open?this.collapseRow(e):this.expandRow(e))}isRowExpanded(e){return e.modules.dataTree.open}getTreeParent(e){return e.modules.dataTree.parent?e.modules.dataTree.parent.getComponent():!1}getTreeParentRoot(e){return e.modules.dataTree&&e.modules.dataTree.parent?this.getTreeParentRoot(e.modules.dataTree.parent):e}getFilteredTreeChildren(e){var t=e.modules.dataTree,i=[],r;return t.children&&(Array.isArray(t.children)||(t.children=this.generateChildren(e)),this.table.modExists("filter")&&this.table.options.dataTreeFilter?r=this.table.modules.filter.filter(t.children):r=t.children,r.forEach(o=>{o instanceof Le&&i.push(o)})),i}rowDelete(e){var t=e.modules.dataTree.parent,i;t&&(i=this.findChildIndex(e,t),i!==!1&&t.data[this.field].splice(i,1),t.data[this.field].length||delete t.data[this.field],this.initializeRow(t),this.layoutRow(t)),this.refreshData(!0)}addTreeChildRow(e,t,i,r){var o=!1;typeof t=="string"&&(t=JSON.parse(t)),Array.isArray(e.data[this.field])||(e.data[this.field]=[],e.modules.dataTree.open=this.startOpen(e.getComponent(),e.modules.dataTree.index)),typeof r<"u"&&(o=this.findChildIndex(r,e),o!==!1&&e.data[this.field].splice(i?o:o+1,0,t)),o===!1&&(i?e.data[this.field].unshift(t):e.data[this.field].push(t)),this.initializeRow(e),this.layoutRow(e),this.refreshData(!0)}findChildIndex(e,t){var i=!1;return typeof e=="object"?e instanceof Le?i=e.data:e instanceof Vn?i=e._getSelf().data:typeof HTMLElement<"u"&&e instanceof HTMLElement?t.modules.dataTree&&(i=t.modules.dataTree.children.find(r=>r instanceof Le?r.element===e:!1),i&&(i=i.data)):e===null&&(i=!1):typeof e>"u"?i=!1:i=t.data[this.field].find(r=>r.data[this.table.options.index]==e),i&&(Array.isArray(t.data[this.field])&&(i=t.data[this.field].indexOf(i)),i==-1&&(i=!1)),i}getTreeChildren(e,t,i){var r=e.modules.dataTree,o=[];return r&&r.children&&(Array.isArray(r.children)||(r.children=this.generateChildren(e)),r.children.forEach(a=>{a instanceof Le&&(o.push(t?a.getComponent():a),i&&(o=o.concat(this.getTreeChildren(a,t,i))))})),o}getChildField(){return this.field}redrawNeeded(e){return(this.field?typeof e[this.field]<"u":!1)||(this.elementField?typeof e[this.elementField]<"u":!1)}}Da.moduleName="dataTree";function pf(h,e={},t){var i=e.delimiter?e.delimiter:",",r=[],o=[];h.forEach(a=>{var u=[];switch(a.type){case"group":console.warn("Download Warning - CSV downloader cannot process row groups");break;case"calc":console.warn("Download Warning - CSV downloader cannot process column calculations");break;case"header":a.columns.forEach((d,f)=>{d&&d.depth===1&&(o[f]=typeof d.value>"u"||d.value===null?"":'"'+String(d.value).split('"').join('""')+'"')});break;case"row":a.columns.forEach(d=>{if(d){switch(typeof d.value){case"object":d.value=d.value!==null?JSON.stringify(d.value):"";break;case"undefined":d.value="";break}u.push('"'+String(d.value).split('"').join('""')+'"')}}),r.push(u.join(i));break}}),o.length&&r.unshift(o.join(i)),r=r.join(`
|
33
33
|
`),e.bom&&(r="\uFEFF"+r),t(r,"text/csv")}function mf(h,e,t){var i=[];h.forEach(r=>{var o={};switch(r.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":r.columns.forEach(a=>{a&&(o[a.component.getTitleDownload()||a.component.getField()]=a.value)}),i.push(o);break}}),i=JSON.stringify(i,null," "),t(i,"application/json")}function gf(h,e={},t){var i=[],r=[],o={},a=e.rowGroupStyles||{fontStyle:"bold",fontSize:12,cellPadding:6,fillColor:220},u=e.rowCalcStyles||{fontStyle:"bold",fontSize:10,cellPadding:4,fillColor:232},d=e.jsPDF||{},f=e.title?e.title:"";d.orientation||(d.orientation=e.orientation||"landscape"),d.unit||(d.unit="pt"),h.forEach(w=>{switch(w.type){case"header":i.push(g(w));break;case"group":r.push(g(w,a));break;case"calc":r.push(g(w,u));break;case"row":r.push(g(w));break}});function g(w,E){var S=[];return w.columns.forEach(D=>{var P;if(D){switch(typeof D.value){case"object":D.value=D.value!==null?JSON.stringify(D.value):"";break;case"undefined":D.value="";break}P={content:D.value,colSpan:D.width,rowSpan:D.height},E&&(P.styles=E),S.push(P)}}),S}var y=new jspdf.jsPDF(d);e.autoTable&&(typeof e.autoTable=="function"?o=e.autoTable(y)||{}:o=e.autoTable),f&&(o.didDrawPage=function(w){y.text(f,40,30)}),o.head=i,o.body=r,y.autoTable(o),e.documentProcessing&&e.documentProcessing(y),t(y.output("arraybuffer"),"application/pdf")}function bf(h,e,t){var i=this,r=e.sheetName||"Sheet1",o=XLSX.utils.book_new(),a=new Pe(this),u="compress"in e?e.compress:!0,d=e.writeOptions||{bookType:"xlsx",bookSST:!0,compression:u},f;d.type="binary",o.SheetNames=[],o.Sheets={};function g(){var E=[],S=[],D={},P={s:{c:0,r:0},e:{c:h[0]?h[0].columns.reduce((k,G)=>k+(G&&G.width?G.width:1),0):0,r:h.length}};return h.forEach((k,G)=>{var K=[];k.columns.forEach(function(z,V){z?(K.push(!(z.value instanceof Date)&&typeof z.value=="object"?JSON.stringify(z.value):z.value),(z.width>1||z.height>-1)&&(z.height>1||z.width>1)&&S.push({s:{r:G,c:V},e:{r:G+z.height-1,c:V+z.width-1}})):K.push("")}),E.push(K)}),XLSX.utils.sheet_add_aoa(D,E),D["!ref"]=XLSX.utils.encode_range(P),S.length&&(D["!merges"]=S),D}if(e.sheetOnly){t(g());return}if(e.sheets)for(var y in e.sheets)e.sheets[y]===!0?(o.SheetNames.push(y),o.Sheets[y]=g()):(o.SheetNames.push(y),a.commsSend(e.sheets[y],"download","intercept",{type:"xlsx",options:{sheetOnly:!0},active:i.active,intercept:function(E){o.Sheets[y]=E}}));else o.SheetNames.push(r),o.Sheets[r]=g();e.documentProcessing&&(o=e.documentProcessing(o));function w(E){for(var S=new ArrayBuffer(E.length),D=new Uint8Array(S),P=0;P!=E.length;++P)D[P]=E.charCodeAt(P)&255;return S}f=XLSX.write(o,d),t(w(f),"application/octet-stream")}function vf(h,e,t){this.modExists("export",!0)&&t(this.modules.export.generateHTMLTable(h),"text/html")}function wf(h,e,t){const i=[];h.forEach(r=>{const o={};switch(r.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":r.columns.forEach(a=>{a&&(o[a.component.getTitleDownload()||a.component.getField()]=a.value)}),i.push(JSON.stringify(o));break}}),t(i.join(`
|
@@ -44,4 +44,4 @@ function print() { __p += __j.call(arguments, '') }
|
|
44
44
|
Expecting: array
|
45
45
|
Received: `,typeof e,`
|
46
46
|
Data: `,e)}_wipeElements(){this.dispatch("rows-wipe"),this.destroy(),this.adjustTableSize(),this.dispatch("rows-wiped")}destroy(){this.rows.forEach(e=>{e.wipe()}),this.rows=[],this.activeRows=[],this.activeRowsPipeline=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0}deleteRow(e,t){var i=this.rows.indexOf(e),r=this.activeRows.indexOf(e);r>-1&&this.activeRows.splice(r,1),i>-1&&this.rows.splice(i,1),this.setActiveRows(this.activeRows),this.displayRowIterator(o=>{var a=o.indexOf(e);a>-1&&o.splice(a,1)}),t||this.reRenderInPosition(),this.regenerateRowPositions(),this.dispatchExternal("rowDeleted",e.getComponent()),this.displayRowsCount||this.tableEmpty(),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.getData())}addRow(e,t,i,r){var o=this.addRowActual(e,t,i,r);return o}addRows(e,t,i,r){var o=[];return new Promise((a,u)=>{t=this.findAddRowPos(t),Array.isArray(e)||(e=[e]),(typeof i>"u"&&t||typeof i<"u"&&!t)&&e.reverse(),e.forEach((d,f)=>{var g=this.addRow(d,t,i,!0);o.push(g),this.dispatch("row-added",g,d,t,i)}),this.refreshActiveData(r?"displayPipeline":!1,!1,!0),this.regenerateRowPositions(),o.length&&this._clearPlaceholder(),a(o)})}findAddRowPos(e){return typeof e>"u"&&(e=this.table.options.addRowPos),e==="pos"&&(e=!0),e==="bottom"&&(e=!1),e}addRowActual(e,t,i,r){var o=e instanceof Le?e:new Le(e||{},this),a=this.findAddRowPos(t),u=-1,d,f;return i||(f=this.chain("row-adding-position",[o,a],null,{index:i,top:a}),i=f.index,a=f.top),typeof i<"u"&&(i=this.findRow(i)),i=this.chain("row-adding-index",[o,i,a],null,i),i&&(u=this.rows.indexOf(i)),i&&u>-1?(d=this.activeRows.indexOf(i),this.displayRowIterator(function(g){var y=g.indexOf(i);y>-1&&g.splice(a?y:y+1,0,o)}),d>-1&&this.activeRows.splice(a?d:d+1,0,o),this.rows.splice(a?u:u+1,0,o)):a?(this.displayRowIterator(function(g){g.unshift(o)}),this.activeRows.unshift(o),this.rows.unshift(o)):(this.displayRowIterator(function(g){g.push(o)}),this.activeRows.push(o),this.rows.push(o)),this.setActiveRows(this.activeRows),this.dispatchExternal("rowAdded",o.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()),r||this.reRenderInPosition(),o}moveRow(e,t,i){this.dispatch("row-move",e,t,i),this.moveRowActual(e,t,i),this.regenerateRowPositions(),this.dispatch("row-moved",e,t,i),this.dispatchExternal("rowMoved",e.getComponent())}moveRowActual(e,t,i){this.moveRowInArray(this.rows,e,t,i),this.moveRowInArray(this.activeRows,e,t,i),this.displayRowIterator(r=>{this.moveRowInArray(r,e,t,i)}),this.dispatch("row-moving",e,t,i)}moveRowInArray(e,t,i,r){var o,a,u,d;if(t!==i&&(o=e.indexOf(t),o>-1&&(e.splice(o,1),a=e.indexOf(i),a>-1?r?e.splice(a+1,0,t):e.splice(a,0,t):e.splice(o,0,t)),e===this.getDisplayRows())){u=o<a?o:a,d=a>o?a:o+1;for(let f=u;f<=d;f++)e[f]&&this.styleRow(e[f],f)}}clearData(){this.setData([])}getRowIndex(e){return this.findRowIndex(e,this.rows)}getDisplayRowIndex(e){var t=this.getDisplayRows().indexOf(e);return t>-1?t:!1}nextDisplayRow(e,t){var i=this.getDisplayRowIndex(e),r=!1;return i!==!1&&i<this.displayRowsCount-1&&(r=this.getDisplayRows()[i+1]),r&&(!(r instanceof Le)||r.type!="row")?this.nextDisplayRow(r,t):r}prevDisplayRow(e,t){var i=this.getDisplayRowIndex(e),r=!1;return i&&(r=this.getDisplayRows()[i-1]),t&&r&&(!(r instanceof Le)||r.type!="row")?this.prevDisplayRow(r,t):r}findRowIndex(e,t){var i;return e=this.findRow(e),e&&(i=t.indexOf(e),i>-1)?i:!1}getData(e,t){var i=[],r=this.getRows(e);return r.forEach(function(o){o.type=="row"&&i.push(o.getData(t||"data"))}),i}getComponents(e){var t=[],i=this.getRows(e);return i.forEach(function(r){t.push(r.getComponent())}),t}getDataCount(e){var t=this.getRows(e);return t.length}scrollHorizontal(e){this.scrollLeft=e,this.element.scrollLeft=e,this.dispatch("scroll-horizontal",e)}registerDataPipelineHandler(e,t){typeof t<"u"?(this.dataPipeline.push({handler:e,priority:t}),this.dataPipeline.sort((i,r)=>i.priority-r.priority)):console.error("Data pipeline handlers must have a priority in order to be registered")}registerDisplayPipelineHandler(e,t){typeof t<"u"?(this.displayPipeline.push({handler:e,priority:t}),this.displayPipeline.sort((i,r)=>i.priority-r.priority)):console.error("Display pipeline handlers must have a priority in order to be registered")}refreshActiveData(e,t,i){var r=this.table,o="",a=0,u=["all","dataPipeline","display","displayPipeline","end"];if(!this.table.destroyed){if(typeof e=="function")if(a=this.dataPipeline.findIndex(d=>d.handler===e),a>-1)o="dataPipeline",t&&(a==this.dataPipeline.length-1?o="display":a++);else if(a=this.displayPipeline.findIndex(d=>d.handler===e),a>-1)o="displayPipeline",t&&(a==this.displayPipeline.length-1?o="end":a++);else{console.error("Unable to refresh data, invalid handler provided",e);return}else o=e||"all",a=0;if(this.redrawBlock){(!this.redrawBlockRestoreConfig||this.redrawBlockRestoreConfig&&(this.redrawBlockRestoreConfig.stage===o&&a<this.redrawBlockRestoreConfig.index||u.indexOf(o)<u.indexOf(this.redrawBlockRestoreConfig.stage)))&&(this.redrawBlockRestoreConfig={handler:e,skipStage:t,renderInPosition:i,stage:o,index:a});return}else fe.elVisible(this.element)?i?this.reRenderInPosition(this.refreshPipelines.bind(this,e,o,a,i)):(this.refreshPipelines(e,o,a,i),e||this.table.columnManager.renderer.renderColumns(),this.renderTable(),r.options.layoutColumnsOnNewData&&this.table.columnManager.redraw(!0)):this.refreshPipelines(e,o,a,i),this.dispatch("data-refreshed")}}refreshPipelines(e,t,i,r){switch(this.dispatch("data-refreshing"),e||(this.activeRowsPipeline[0]=this.rows.slice(0)),t){case"all":case"dataPipeline":for(let o=i;o<this.dataPipeline.length;o++){let a=this.dataPipeline[o].handler(this.activeRowsPipeline[o].slice(0));this.activeRowsPipeline[o+1]=a||this.activeRowsPipeline[o].slice(0)}this.setActiveRows(this.activeRowsPipeline[this.dataPipeline.length]);case"display":i=0,this.resetDisplayRows();case"displayPipeline":for(let o=i;o<this.displayPipeline.length;o++){let a=this.displayPipeline[o].handler((o?this.getDisplayRows(o-1):this.activeRows).slice(0),r);this.setDisplayRows(a||this.getDisplayRows(o-1).slice(0),o)}case"end":this.regenerateRowPositions()}this.getDisplayRows().length&&this._clearPlaceholder()}regenerateRowPositions(){var e=this.getDisplayRows(),t=1;e.forEach(i=>{i.type==="row"&&(i.setPosition(t),t++)})}setActiveRows(e){this.activeRows=this.activeRows=Object.assign([],e),this.activeRowsCount=this.activeRows.length}resetDisplayRows(){this.displayRows=[],this.displayRows.push(this.activeRows.slice(0)),this.displayRowsCount=this.displayRows[0].length}setDisplayRows(e,t){this.displayRows[t]=e,t==this.displayRows.length-1&&(this.displayRowsCount=this.displayRows[this.displayRows.length-1].length)}getDisplayRows(e){return typeof e>"u"?this.displayRows.length?this.displayRows[this.displayRows.length-1]:[]:this.displayRows[e]||[]}getVisibleRows(e,t){var i=Object.assign([],this.renderer.visibleRows(!t));return e&&(i=this.chain("rows-visible",[t],i,i)),i}displayRowIterator(e){this.activeRowsPipeline.forEach(e),this.displayRows.forEach(e),this.displayRowsCount=this.displayRows[this.displayRows.length-1].length}getRows(e){var t=[];switch(e){case"active":t=this.activeRows;break;case"display":t=this.table.rowManager.getDisplayRows();break;case"visible":t=this.getVisibleRows(!1,!0);break;default:t=this.chain("rows-retrieve",e,null,this.rows)||this.rows}return t}reRenderInPosition(e){this.redrawBlock?e?e():this.redrawBlockRenderInPosition=!0:(this.dispatchExternal("renderStarted"),this.renderer.rerenderRows(e),this.fixedHeight||this.adjustTableSize(),this.scrollBarCheck(),this.dispatchExternal("renderComplete"))}scrollBarCheck(){var e=0;this.element.scrollHeight>this.element.clientHeight&&(e=this.element.offsetWidth-this.element.clientWidth),e!==this.scrollbarWidth&&(this.scrollbarWidth=e,this.dispatch("scrollbar-vertical",e))}initializeRenderer(){var e,t={virtual:Pp,basic:Fp};typeof this.table.options.renderVertical=="string"?e=t[this.table.options.renderVertical]:e=this.table.options.renderVertical,e?(this.renderMode=this.table.options.renderVertical,this.renderer=new e(this.table,this.element,this.tableElement),this.renderer.initialize(),(this.table.element.clientHeight||this.table.options.height)&&!(this.table.options.minHeight&&this.table.options.maxHeight)?this.fixedHeight=!0:this.fixedHeight=!1):console.error("Unable to find matching renderer:",this.table.options.renderVertical)}getRenderMode(){return this.renderMode}renderTable(){this.dispatchExternal("renderStarted"),this.element.scrollTop=0,this._clearTable(),this.displayRowsCount?(this.renderer.renderRows(),this.firstRender&&(this.firstRender=!1,this.fixedHeight||this.adjustTableSize(),this.layoutRefresh(!0))):this.renderEmptyScroll(),this.fixedHeight||this.adjustTableSize(),this.dispatch("table-layout"),this.displayRowsCount||this._showPlaceholder(),this.scrollBarCheck(),this.dispatchExternal("renderComplete")}renderEmptyScroll(){this.placeholder?this.tableElement.style.display="none":this.tableElement.style.minWidth=this.table.columnManager.getWidth()+"px"}_clearTable(){this._clearPlaceholder(),this.scrollTop=0,this.scrollLeft=0,this.renderer.clearRows()}tableEmpty(){this.renderEmptyScroll(),this._showPlaceholder()}_showPlaceholder(){this.placeholder&&(this.placeholder&&this.placeholder.parentNode&&this.placeholder.parentNode.removeChild(this.placeholder),this.initializePlaceholder(),this.placeholder.setAttribute("tabulator-render-mode",this.renderMode),this.getElement().appendChild(this.placeholder),this._positionPlaceholder(),this.adjustTableSize())}_clearPlaceholder(){this.placeholder&&this.placeholder.parentNode&&this.placeholder.parentNode.removeChild(this.placeholder),this.tableElement.style.minWidth="",this.tableElement.style.display=""}_positionPlaceholder(){this.placeholder&&this.placeholder.parentNode&&(this.placeholder.style.width=this.table.columnManager.getWidth()+"px",this.placeholderContents.style.width=this.table.rowManager.element.clientWidth+"px",this.placeholderContents.style.marginLeft=this.scrollLeft+"px")}styleRow(e,t){var i=e.getElement();t%2?(i.classList.add("tabulator-row-even"),i.classList.remove("tabulator-row-odd")):(i.classList.add("tabulator-row-odd"),i.classList.remove("tabulator-row-even"))}normalizeHeight(){this.activeRows.forEach(function(e){e.normalizeHeight()})}adjustTableSize(){let e=this.element.clientHeight,t,i=!1;if(this.renderer.verticalFillMode==="fill"){let r=Math.floor(this.table.columnManager.getElement().getBoundingClientRect().height+(this.table.footerManager&&this.table.footerManager.active&&!this.table.footerManager.external?this.table.footerManager.getElement().getBoundingClientRect().height:0));if(this.fixedHeight){t=isNaN(this.table.options.minHeight)?this.table.options.minHeight:this.table.options.minHeight+"px";const o="calc(100% - "+r+"px)";this.element.style.minHeight=t||"calc(100% - "+r+"px)",this.element.style.height=o,this.element.style.maxHeight=o}else this.element.style.height="",this.element.style.height=this.table.element.clientHeight-r+"px",this.element.scrollTop=this.scrollTop;this.renderer.resize(),!this.fixedHeight&&e!=this.element.clientHeight&&(i=!0,this.subscribed("table-resize")?this.dispatch("table-resize"):this.redraw()),this.scrollBarCheck()}return this._positionPlaceholder(),i}reinitialize(){this.rows.forEach(function(e){e.reinitialize(!0)})}blockRedraw(){this.redrawBlock=!0,this.redrawBlockRestoreConfig=!1}restoreRedraw(){this.redrawBlock=!1,this.redrawBlockRestoreConfig?(this.refreshActiveData(this.redrawBlockRestoreConfig.handler,this.redrawBlockRestoreConfig.skipStage,this.redrawBlockRestoreConfig.renderInPosition),this.redrawBlockRestoreConfig=!1):this.redrawBlockRenderInPosition&&this.reRenderInPosition(),this.redrawBlockRenderInPosition=!1}redraw(e){const t=this.adjustTableSize();this.table.tableWidth=this.table.element.clientWidth,e?this.renderTable():(t&&this.reRenderInPosition(),this.scrollHorizontal(this.scrollLeft))}resetScroll(){if(this.element.scrollLeft=0,this.element.scrollTop=0,this.table.browser==="ie"){var e=document.createEvent("Event");e.initEvent("scroll",!1,!0),this.element.dispatchEvent(e)}else this.element.dispatchEvent(new Event("scroll"))}}class zp extends Pe{constructor(e){super(e),this.active=!1,this.element=this.createElement(),this.containerElement=this.createContainerElement(),this.external=!1}initialize(){this.initializeElement()}createElement(){var e=document.createElement("div");return e.classList.add("tabulator-footer"),e}createContainerElement(){var e=document.createElement("div");return e.classList.add("tabulator-footer-contents"),this.element.appendChild(e),e}initializeElement(){if(this.table.options.footerElement)switch(typeof this.table.options.footerElement){case"string":this.table.options.footerElement[0]==="<"?this.containerElement.innerHTML=this.table.options.footerElement:(this.external=!0,this.containerElement=document.querySelector(this.table.options.footerElement));break;default:this.element=this.table.options.footerElement;break}}getElement(){return this.element}append(e){this.activate(),this.containerElement.appendChild(e),this.table.rowManager.adjustTableSize()}prepend(e){this.activate(),this.element.insertBefore(e,this.element.firstChild),this.table.rowManager.adjustTableSize()}remove(e){e.parentNode.removeChild(e),this.deactivate()}deactivate(e){(!this.element.firstChild||e)&&(this.external||this.element.parentNode.removeChild(this.element),this.active=!1)}activate(){this.active||(this.active=!0,this.external||(this.table.element.appendChild(this.getElement()),this.table.element.style.display=""))}redraw(){this.dispatch("footer-redraw")}}class Hp extends Pe{constructor(e){super(e),this.el=null,this.abortClasses=["tabulator-headers","tabulator-table"],this.previousTargets={},this.listeners=["click","dblclick","contextmenu","mouseenter","mouseleave","mouseover","mouseout","mousemove","mouseup","mousedown","touchstart","touchend"],this.componentMap={"tabulator-cell":"cell","tabulator-row":"row","tabulator-group":"group","tabulator-col":"column"},this.pseudoTrackers={row:{subscriber:null,target:null},cell:{subscriber:null,target:null},group:{subscriber:null,target:null},column:{subscriber:null,target:null}},this.pseudoTracking=!1}initialize(){this.el=this.table.element,this.buildListenerMap(),this.bindSubscriptionWatchers()}buildListenerMap(){var e={};this.listeners.forEach(t=>{e[t]={handler:null,components:[]}}),this.listeners=e}bindPseudoEvents(){Object.keys(this.pseudoTrackers).forEach(e=>{this.pseudoTrackers[e].subscriber=this.pseudoMouseEnter.bind(this,e),this.subscribe(e+"-mouseover",this.pseudoTrackers[e].subscriber)}),this.pseudoTracking=!0}pseudoMouseEnter(e,t,i){this.pseudoTrackers[e].target!==i&&(this.pseudoTrackers[e].target&&this.dispatch(e+"-mouseleave",t,this.pseudoTrackers[e].target),this.pseudoMouseLeave(e,t),this.pseudoTrackers[e].target=i,this.dispatch(e+"-mouseenter",t,i))}pseudoMouseLeave(e,t){var i=Object.keys(this.pseudoTrackers),r={row:["cell"],cell:["row"]};i=i.filter(o=>{var a=r[e];return o!==e&&(!a||a&&!a.includes(o))}),i.forEach(o=>{var a=this.pseudoTrackers[o].target;this.pseudoTrackers[o].target&&(this.dispatch(o+"-mouseleave",t,a),this.pseudoTrackers[o].target=null)})}bindSubscriptionWatchers(){var e=Object.keys(this.listeners),t=Object.values(this.componentMap);for(let i of t)for(let r of e){let o=i+"-"+r;this.subscriptionChange(o,this.subscriptionChanged.bind(this,i,r))}this.subscribe("table-destroy",this.clearWatchers.bind(this))}subscriptionChanged(e,t,i){var r=this.listeners[t].components,o=r.indexOf(e),a=!1;i?o===-1&&(r.push(e),a=!0):this.subscribed(e+"-"+t)||o>-1&&(r.splice(o,1),a=!0),(t==="mouseenter"||t==="mouseleave")&&!this.pseudoTracking&&this.bindPseudoEvents(),a&&this.updateEventListeners()}updateEventListeners(){for(let e in this.listeners){let t=this.listeners[e];t.components.length?t.handler||(t.handler=this.track.bind(this,e),this.el.addEventListener(e,t.handler)):t.handler&&(this.el.removeEventListener(e,t.handler),t.handler=null)}}track(e,t){var i=t.composedPath&&t.composedPath()||t.path,r=this.findTargets(i);r=this.bindComponents(e,r),this.triggerEvents(e,t,r),this.pseudoTracking&&(e=="mouseover"||e=="mouseleave")&&!Object.keys(r).length&&this.pseudoMouseLeave("none",t)}findTargets(e){var t={};let i=Object.keys(this.componentMap);for(let r of e){let o=r.classList?[...r.classList]:[];if(o.filter(d=>this.abortClasses.includes(d)).length)break;let u=o.filter(d=>i.includes(d));for(let d of u)t[this.componentMap[d]]||(t[this.componentMap[d]]=r)}return t.group&&t.group===t.row&&delete t.row,t}bindComponents(e,t){var i=Object.keys(t).reverse(),r=this.listeners[e],o={},a={};for(let u of i){let d,f=t[u],g=this.previousTargets[u];if(g&&g.target===f)d=g.component;else switch(u){case"row":case"group":(r.components.includes("row")||r.components.includes("cell")||r.components.includes("group"))&&(d=this.table.rowManager.getVisibleRows(!0).find(w=>w.getElement()===f),t.row&&t.row.parentNode&&t.row.parentNode.closest(".tabulator-row")&&(t[u]=!1));break;case"column":r.components.includes("column")&&(d=this.table.columnManager.findColumn(f));break;case"cell":r.components.includes("cell")&&(o.row instanceof Le?d=o.row.findCell(f):t.row&&console.warn("Event Target Lookup Error - The row this cell is attached to cannot be found, has the table been reinitialized without being destroyed first?"));break}d&&(o[u]=d,a[u]={target:f,component:d})}return this.previousTargets=a,o}triggerEvents(e,t,i){var r=this.listeners[e];for(let o in i)i[o]&&r.components.includes(o)&&this.dispatch(o+"-"+e,t,i[o])}clearWatchers(){for(let e in this.listeners){let t=this.listeners[e];t.handler&&(this.el.removeEventListener(e,t.handler),t.handler=null)}}}class Ip{constructor(e){this.table=e,this.bindings={}}bind(e,t,i){this.bindings[e]||(this.bindings[e]={}),this.bindings[e][t]?console.warn("Unable to bind component handler, a matching function name is already bound",e,t,i):this.bindings[e][t]=i}handle(e,t,i){if(this.bindings[e]&&this.bindings[e][i]&&typeof this.bindings[e][i].bind=="function")return this.bindings[e][i].bind(null,t);i!=="then"&&typeof i=="string"&&!i.startsWith("_")&&this.table.options.debugInvalidComponentFuncs&&console.error("The "+e+" component does not have a "+i+" function, have you checked that you have the correct Tabulator module installed?")}}class Np extends Pe{constructor(e){super(e),this.requestOrder=0,this.loading=!1}initialize(){}load(e,t,i,r,o,a){var u=++this.requestOrder;if(this.table.destroyed)return Promise.resolve();if(this.dispatchExternal("dataLoading",e),e&&(e.indexOf("{")==0||e.indexOf("[")==0)&&(e=JSON.parse(e)),this.confirm("data-loading",[e,t,i,o])){this.loading=!0,o||this.alertLoader(),t=this.chain("data-params",[e,i,o],t||{},t||{}),t=this.mapParams(t,this.table.options.dataSendParams);var d=this.chain("data-load",[e,t,i,o],!1,Promise.resolve([]));return d.then(f=>{if(this.table.destroyed)console.warn("Data Load Response Blocked - Table has been destroyed");else{!Array.isArray(f)&&typeof f=="object"&&(f=this.mapParams(f,this.objectInvert(this.table.options.dataReceiveParams)));var g=this.chain("data-loaded",f,null,f);u==this.requestOrder?(this.clearAlert(),g!==!1&&(this.dispatchExternal("dataLoaded",g),this.table.rowManager.setData(g,r,typeof a>"u"?!r:a))):console.warn("Data Load Response Blocked - An active data load request was blocked by an attempt to change table data while the request was being made")}}).catch(f=>{console.error("Data Load Error: ",f),this.dispatchExternal("dataLoadError",f),o||this.alertError(),setTimeout(()=>{this.clearAlert()},this.table.options.dataLoaderErrorTimeout)}).finally(()=>{this.loading=!1})}else return this.dispatchExternal("dataLoaded",e),e||(e=[]),this.table.rowManager.setData(e,r,typeof a>"u"?!r:a),Promise.resolve()}mapParams(e,t){var i={};for(let r in e)i[t.hasOwnProperty(r)?t[r]:r]=e[r];return i}objectInvert(e){var t={};for(let i in e)t[e[i]]=i;return t}blockActiveLoad(){this.requestOrder++}alertLoader(){var e=typeof this.table.options.dataLoader=="function"?this.table.options.dataLoader():this.table.options.dataLoader;e&&this.table.alertManager.alert(this.table.options.dataLoaderLoading||this.langText("data|loading"))}alertError(){this.table.alertManager.alert(this.table.options.dataLoaderError||this.langText("data|error"),"error")}clearAlert(){this.table.alertManager.clear()}}class Bp{constructor(e,t,i){this.table=e,this.events={},this.optionsList=t||{},this.subscriptionNotifiers={},this.dispatch=i?this._debugDispatch.bind(this):this._dispatch.bind(this),this.debug=i}subscriptionChange(e,t){this.subscriptionNotifiers[e]||(this.subscriptionNotifiers[e]=[]),this.subscriptionNotifiers[e].push(t),this.subscribed(e)&&this._notifySubscriptionChange(e,!0)}subscribe(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t),this._notifySubscriptionChange(e,!0)}unsubscribe(e,t){var i;if(this.events[e])if(t)if(i=this.events[e].findIndex(r=>r===t),i>-1)this.events[e].splice(i,1);else{console.warn("Cannot remove event, no matching event found:",e,t);return}else delete this.events[e];else{console.warn("Cannot remove event, no events set on:",e);return}this._notifySubscriptionChange(e,!1)}subscribed(e){return this.events[e]&&this.events[e].length}_notifySubscriptionChange(e,t){var i=this.subscriptionNotifiers[e];i&&i.forEach(r=>{r(t)})}_dispatch(){var e=Array.from(arguments),t=e.shift(),i;return this.events[t]&&this.events[t].forEach((r,o)=>{let a=r.apply(this.table,e);o||(i=a)}),i}_debugDispatch(){var e=Array.from(arguments),t=e[0];return e[0]="ExternalEvent:"+e[0],(this.debug===!0||this.debug.includes(t))&&console.log(...e),this._dispatch(...arguments)}}class Vp{constructor(e){this.events={},this.subscriptionNotifiers={},this.dispatch=e?this._debugDispatch.bind(this):this._dispatch.bind(this),this.chain=e?this._debugChain.bind(this):this._chain.bind(this),this.confirm=e?this._debugConfirm.bind(this):this._confirm.bind(this),this.debug=e}subscriptionChange(e,t){this.subscriptionNotifiers[e]||(this.subscriptionNotifiers[e]=[]),this.subscriptionNotifiers[e].push(t),this.subscribed(e)&&this._notifySubscriptionChange(e,!0)}subscribe(e,t,i=1e4){this.events[e]||(this.events[e]=[]),this.events[e].push({callback:t,priority:i}),this.events[e].sort((r,o)=>r.priority-o.priority),this._notifySubscriptionChange(e,!0)}unsubscribe(e,t){var i;if(this.events[e]){if(t)if(i=this.events[e].findIndex(r=>r.callback===t),i>-1)this.events[e].splice(i,1);else{console.warn("Cannot remove event, no matching event found:",e,t);return}}else{console.warn("Cannot remove event, no events set on:",e);return}this._notifySubscriptionChange(e,!1)}subscribed(e){return this.events[e]&&this.events[e].length}_chain(e,t,i,r){var o=i;return Array.isArray(t)||(t=[t]),this.subscribed(e)?(this.events[e].forEach((a,u)=>{o=a.callback.apply(this,t.concat([o]))}),o):typeof r=="function"?r():r}_confirm(e,t){var i=!1;return Array.isArray(t)||(t=[t]),this.subscribed(e)&&this.events[e].forEach((r,o)=>{r.callback.apply(this,t)&&(i=!0)}),i}_notifySubscriptionChange(e,t){var i=this.subscriptionNotifiers[e];i&&i.forEach(r=>{r(t)})}_dispatch(){var e=Array.from(arguments),t=e.shift();this.events[t]&&this.events[t].forEach(i=>{i.callback.apply(this,e)})}_debugDispatch(){var e=Array.from(arguments),t=e[0];return e[0]="InternalEvent:"+t,(this.debug===!0||this.debug.includes(t))&&console.log(...e),this._dispatch(...arguments)}_debugChain(){var e=Array.from(arguments),t=e[0];return e[0]="InternalEvent:"+t,(this.debug===!0||this.debug.includes(t))&&console.log(...e),this._chain(...arguments)}_debugConfirm(){var e=Array.from(arguments),t=e[0];return e[0]="InternalEvent:"+t,(this.debug===!0||this.debug.includes(t))&&console.log(...e),this._confirm(...arguments)}}class Wp extends Pe{constructor(e){super(e)}_warnUser(){this.options("debugDeprecation")&&console.warn(...arguments)}check(e,t){var i="";return typeof this.options(e)<"u"?(i="Deprecated Setup Option - Use of the %c"+e+"%c option is now deprecated",t?(i=i+", Please use the %c"+t+"%c option instead",this._warnUser(i,"font-weight: bold;","font-weight: normal;","font-weight: bold;","font-weight: normal;")):this._warnUser(i,"font-weight: bold;","font-weight: normal;"),!1):!0}checkMsg(e,t){return typeof this.options(e)<"u"?(this._warnUser("%cDeprecated Setup Option - Use of the %c"+e+" %c option is now deprecated, "+t,"font-weight: normal;","font-weight: bold;","font-weight: normal;"),!1):!0}msg(e){this._warnUser(e)}}class Ge{static register(e){Ge.tables.push(e)}static deregister(e){var t=Ge.tables.indexOf(e);t>-1&&Ge.tables.splice(t,1)}static lookupTable(e,t){var i=[],r,o;if(typeof e=="string"){if(r=document.querySelectorAll(e),r.length)for(var a=0;a<r.length;a++)o=Ge.matchElement(r[a]),o&&i.push(o)}else typeof HTMLElement<"u"&&e instanceof HTMLElement||e instanceof si?(o=Ge.matchElement(e),o&&i.push(o)):Array.isArray(e)?e.forEach(function(u){i=i.concat(Ge.lookupTable(u))}):t||console.warn("Table Connection Error - Invalid Selector",e);return i}static matchElement(e){return Ge.tables.find(function(t){return e instanceof si?t===e:t.element===e})}}Ge.tables=[];function Gp(h,e){e&&this.table.columnManager.renderer.reinitializeColumnWidths(h),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()}function Za(h,e){h.forEach(function(t){t.reinitializeWidth()}),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()}function $p(h,e){var t=0,i=this.table.rowManager.element.clientWidth,r=0,o=!1;h.forEach((a,u)=>{a.widthFixed||a.reinitializeWidth(),(this.table.options.responsiveLayout?a.modules.responsive.visible:a.visible)&&(o=a),a.visible&&(t+=a.getWidth())}),o?(r=i-t+o.getWidth(),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&(o.setWidth(0),this.table.modules.responsiveLayout.update()),r>0?o.setWidth(r):o.reinitializeWidth()):this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()}function Up(h,e){var t=this.table.rowManager.element.getBoundingClientRect().width,i=0,r=0,o=0,a=0,u=[],d=[],f=0,g=0,y=0;function w(S){var D;return typeof S=="string"?S.indexOf("%")>-1?D=t/100*parseInt(S):D=parseInt(S):D=S,D}function E(S,D,P,k){var G=[],K=0,z=0,V=0,se=o,B=0,H=0,le=[];function ze(X){return P*(X.column.definition.widthGrow||1)}function wt(X){return w(X.width)-P*(X.column.definition.widthShrink||0)}return S.forEach(function(X,Je){var Ze=k?wt(X):ze(X);X.column.minWidth>=Ze?G.push(X):X.column.maxWidth&&X.column.maxWidth<Ze?(X.width=X.column.maxWidth,D-=X.column.maxWidth,se-=k?X.column.definition.widthShrink||1:X.column.definition.widthGrow||1,se&&(P=Math.floor(D/se))):(le.push(X),H+=k?X.column.definition.widthShrink||1:X.column.definition.widthGrow||1)}),G.length?(G.forEach(function(X){K+=k?X.width-X.column.minWidth:X.column.minWidth,X.width=X.column.minWidth}),z=D-K,V=H?Math.floor(z/H):z,B=E(le,z,V,k)):(B=H?D-Math.floor(D/H)*H:D,le.forEach(function(X){X.width=k?wt(X):ze(X)})),B}this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update(),this.table.rowManager.element.scrollHeight>this.table.rowManager.element.clientHeight&&(t-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),h.forEach(function(S){var D,P,k;S.visible&&(D=S.definition.width,P=parseInt(S.minWidth),D?(k=w(D),i+=k>P?k:P,S.definition.widthShrink&&(d.push({column:S,width:k>P?k:P}),f+=S.definition.widthShrink)):(u.push({column:S,width:0}),o+=S.definition.widthGrow||1))}),r=t-i,a=Math.floor(r/o),y=E(u,r,a,!1),u.length&&y>0&&(u[u.length-1].width+=y),u.forEach(function(S){r-=S.width}),g=Math.abs(y)+r,g>0&&f&&(y=E(d,g,Math.floor(g/f),!0)),y&&d.length&&(d[d.length-1].width-=y),u.forEach(function(S){S.column.setWidth(S.width)}),d.forEach(function(S){S.column.setWidth(S.width)})}var jp={fitData:Gp,fitDataFill:Za,fitDataTable:Za,fitDataStretch:$p,fitColumns:Up};class Si extends ee{constructor(e){super(e,"layout"),this.mode=null,this.registerTableOption("layout","fitData"),this.registerTableOption("layoutColumnsOnNewData",!1),this.registerColumnOption("widthGrow"),this.registerColumnOption("widthShrink")}initialize(){var e=this.table.options.layout;Si.modes[e]?this.mode=e:(console.warn("Layout Error - invalid mode set, defaulting to 'fitData' : "+e),this.mode="fitData"),this.table.element.setAttribute("tabulator-layout",this.mode)}getMode(){return this.mode}layout(e){this.dispatch("layout-refreshing"),Si.modes[this.mode].call(this,this.table.columnManager.columnsByIndex,e),this.dispatch("layout-refreshed")}}Si.moduleName="layout",Si.modes=jp;var Kp={default:{groups:{item:"item",items:"items"},columns:{},data:{loading:"Loading",error:"Error"},pagination:{page_size:"Page Size",page_title:"Show Page",first:"First",first_title:"First Page",last:"Last",last_title:"Last Page",prev:"Prev",prev_title:"Prev Page",next:"Next",next_title:"Next Page",all:"All",counter:{showing:"Showing",of:"of",rows:"rows",pages:"pages"}},headerFilters:{default:"filter column...",columns:{}}}};class on extends ee{constructor(e){super(e),this.locale="default",this.lang=!1,this.bindings={},this.langList={},this.registerTableOption("locale",!1),this.registerTableOption("langs",{})}initialize(){this.langList=fe.deepClone(on.langs),this.table.options.columnDefaults.headerFilterPlaceholder!==!1&&this.setHeaderFilterPlaceholder(this.table.options.columnDefaults.headerFilterPlaceholder);for(let e in this.table.options.langs)this.installLang(e,this.table.options.langs[e]);this.setLocale(this.table.options.locale),this.registerTableFunction("setLocale",this.setLocale.bind(this)),this.registerTableFunction("getLocale",this.getLocale.bind(this)),this.registerTableFunction("getLang",this.getLang.bind(this))}setHeaderFilterPlaceholder(e){this.langList.default.headerFilters.default=e}installLang(e,t){this.langList[e]?this._setLangProp(this.langList[e],t):this.langList[e]=t}_setLangProp(e,t){for(let i in t)e[i]&&typeof e[i]=="object"?this._setLangProp(e[i],t[i]):e[i]=t[i]}setLocale(e){e=e||"default";function t(i,r){for(var o in i)typeof i[o]=="object"?(r[o]||(r[o]={}),t(i[o],r[o])):r[o]=i[o]}if(e===!0&&navigator.language&&(e=navigator.language.toLowerCase()),e&&!this.langList[e]){let i=e.split("-")[0];this.langList[i]?(console.warn("Localization Error - Exact matching locale not found, using closest match: ",e,i),e=i):(console.warn("Localization Error - Matching locale not found, using default: ",e),e="default")}this.locale=e,this.lang=fe.deepClone(this.langList.default||{}),e!="default"&&t(this.langList[e],this.lang),this.dispatchExternal("localized",this.locale,this.lang),this._executeBindings()}getLocale(e){return this.locale}getLang(e){return e?this.langList[e]:this.lang}getText(e,t){var i=t?e+"|"+t:e,r=i.split("|"),o=this._getLangElement(r,this.locale);return o||""}_getLangElement(e,t){var i=this.lang;return e.forEach(function(r){var o;i&&(o=i[r],typeof o<"u"?i=o:i=!1)}),i}bind(e,t){this.bindings[e]||(this.bindings[e]=[]),this.bindings[e].push(t),t(this.getText(e),this.lang)}_executeBindings(){for(let e in this.bindings)this.bindings[e].forEach(t=>{t(this.getText(e),this.lang)})}}on.moduleName="localize",on.langs=Kp;class Qa extends ee{constructor(e){super(e)}initialize(){this.registerTableFunction("tableComms",this.receive.bind(this))}getConnections(e){var t=[],i;return i=Ge.lookupTable(e),i.forEach(r=>{this.table!==r&&t.push(r)}),t}send(e,t,i,r){var o=this.getConnections(e);o.forEach(a=>{a.tableComms(this.table.element,t,i,r)}),!o.length&&e&&console.warn("Table Connection Error - No tables matching selector found",e)}receive(e,t,i,r){if(this.table.modExists(t))return this.table.modules[t].commsReceived(e,i,r);console.warn("Inter-table Comms Error - no such module:",t)}}Qa.moduleName="comms";var qp=Object.freeze({__proto__:null,LayoutModule:Si,LocalizeModule:on,CommsModule:Qa});class el{constructor(e,t){this.bindStaticFunctionality(e),this.bindModules(e,qp,!0),t&&this.bindModules(e,t)}bindStaticFunctionality(e){e.moduleBindings={},e.extendModule=function(t,i,r){if(e.moduleBindings[t]){var o=e.moduleBindings[t][i];if(o)if(typeof r=="object")for(let a in r)o[a]=r[a];else console.warn("Module Error - Invalid value type, it must be an object");else console.warn("Module Error - property does not exist:",i)}else console.warn("Module Error - module does not exist:",t)},e.registerModule=function(t){Array.isArray(t)||(t=[t]),t.forEach(i=>{e.registerModuleBinding(i)})},e.registerModuleBinding=function(t){e.moduleBindings[t.moduleName]=t},e.findTable=function(t){var i=Ge.lookupTable(t,!0);return Array.isArray(i)&&!i.length?!1:i},e.prototype.bindModules=function(){var t=[],i=[],r=[];this.modules={};for(var o in e.moduleBindings){let a=e.moduleBindings[o],u=new a(this);this.modules[o]=u,a.prototype.moduleCore?this.modulesCore.push(u):a.moduleInitOrder?a.moduleInitOrder<0?t.push(u):i.push(u):r.push(u)}t.sort((a,u)=>a.moduleInitOrder>u.moduleInitOrder?1:-1),i.sort((a,u)=>a.moduleInitOrder>u.moduleInitOrder?1:-1),this.modulesRegular=t.concat(r.concat(i))}}bindModules(e,t,i){var r=Object.values(t);i&&r.forEach(o=>{o.prototype.moduleCore=!0}),e.registerModule(r)}}class Xp extends Pe{constructor(e){super(e),this.element=this._createAlertElement(),this.msgElement=this._createMsgElement(),this.type=null,this.element.appendChild(this.msgElement)}_createAlertElement(){var e=document.createElement("div");return e.classList.add("tabulator-alert"),e}_createMsgElement(){var e=document.createElement("div");return e.classList.add("tabulator-alert-msg"),e.setAttribute("role","alert"),e}_typeClass(){return"tabulator-alert-state-"+this.type}alert(e,t="msg"){if(e){for(this.clear(),this.type=t;this.msgElement.firstChild;)this.msgElement.removeChild(this.msgElement.firstChild);this.msgElement.classList.add(this._typeClass()),typeof e=="function"&&(e=e()),e instanceof HTMLElement?this.msgElement.appendChild(e):this.msgElement.innerHTML=e,this.table.element.appendChild(this.element)}}clear(){this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.msgElement.classList.remove(this._typeClass())}}class si{constructor(e,t){this.options={},this.columnManager=null,this.rowManager=null,this.footerManager=null,this.alertManager=null,this.vdomHoz=null,this.externalEvents=null,this.eventBus=null,this.interactionMonitor=!1,this.browser="",this.browserSlow=!1,this.browserMobile=!1,this.rtl=!1,this.originalElement=null,this.componentFunctionBinder=new Ip(this),this.dataLoader=!1,this.modules={},this.modulesCore=[],this.modulesRegular=[],this.deprecationAdvisor=new Wp(this),this.optionsList=new Ja(this,"table constructor"),this.initialized=!1,this.destroyed=!1,this.initializeElement(e)&&(this.initializeCoreSystems(t),setTimeout(()=>{this._create()})),Ge.register(this)}initializeElement(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement?(this.element=e,!0):typeof e=="string"?(this.element=document.querySelector(e),this.element?!0:(console.error("Tabulator Creation Error - no element found matching selector: ",e),!1)):(console.error("Tabulator Creation Error - Invalid element provided:",e),!1)}initializeCoreSystems(e){this.columnManager=new Dp(this),this.rowManager=new Op(this),this.footerManager=new zp(this),this.dataLoader=new Np(this),this.alertManager=new Xp(this),this.bindModules(),this.options=this.optionsList.generate(si.defaultOptions,e),this._clearObjectPointers(),this._mapDeprecatedFunctionality(),this.externalEvents=new Bp(this,this.options,this.options.debugEventsExternal),this.eventBus=new Vp(this.options.debugEventsInternal),this.interactionMonitor=new Hp(this),this.dataLoader.initialize(),this.footerManager.initialize()}_mapDeprecatedFunctionality(){}_clearSelection(){this.element.classList.add("tabulator-block-select"),window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty(),this.element.classList.remove("tabulator-block-select")}_create(){this.externalEvents.dispatch("tableBuilding"),this.eventBus.dispatch("table-building"),this._rtlCheck(),this._buildElement(),this._initializeTable(),this._loadInitialData(),this.initialized=!0,this.externalEvents.dispatch("tableBuilt")}_rtlCheck(){var e=window.getComputedStyle(this.element);switch(this.options.textDirection){case"auto":if(e.direction!=="rtl")break;case"rtl":this.element.classList.add("tabulator-rtl"),this.rtl=!0;break;case"ltr":this.element.classList.add("tabulator-ltr");default:this.rtl=!1}}_clearObjectPointers(){this.options.columns=this.options.columns.slice(0),Array.isArray(this.options.data)&&!this.options.reactiveData&&(this.options.data=this.options.data.slice(0))}_buildElement(){var e=this.element,t=this.options,i;if(e.tagName==="TABLE"){this.originalElement=this.element,i=document.createElement("div");var r=e.attributes;for(var o in r)typeof r[o]=="object"&&i.setAttribute(r[o].name,r[o].value);e.parentNode.replaceChild(i,e),this.element=e=i}for(e.classList.add("tabulator"),e.setAttribute("role","grid");e.firstChild;)e.removeChild(e.firstChild);t.height&&(t.height=isNaN(t.height)?t.height:t.height+"px",e.style.height=t.height),t.minHeight!==!1&&(t.minHeight=isNaN(t.minHeight)?t.minHeight:t.minHeight+"px",e.style.minHeight=t.minHeight),t.maxHeight!==!1&&(t.maxHeight=isNaN(t.maxHeight)?t.maxHeight:t.maxHeight+"px",e.style.maxHeight=t.maxHeight)}_initializeTable(){var e=this.element,t=this.options;this.interactionMonitor.initialize(),this.columnManager.initialize(),this.rowManager.initialize(),this._detectBrowser(),this.modulesCore.forEach(i=>{i.initialize()}),e.appendChild(this.columnManager.getElement()),e.appendChild(this.rowManager.getElement()),t.footerElement&&this.footerManager.activate(),t.autoColumns&&t.data&&this.columnManager.generateColumnsFromRowData(this.options.data),this.modulesRegular.forEach(i=>{i.initialize()}),this.columnManager.setColumns(t.columns),this.eventBus.dispatch("table-built")}_loadInitialData(){this.dataLoader.load(this.options.data)}destroy(){var e=this.element;for(this.destroyed=!0,Ge.deregister(this),this.eventBus.dispatch("table-destroy"),this.rowManager.destroy();e.firstChild;)e.removeChild(e.firstChild);e.classList.remove("tabulator"),this.externalEvents.dispatch("tableDestroyed")}_detectBrowser(){var e=navigator.userAgent||navigator.vendor||window.opera;e.indexOf("Trident")>-1?(this.browser="ie",this.browserSlow=!0):e.indexOf("Edge")>-1?(this.browser="edge",this.browserSlow=!0):e.indexOf("Firefox")>-1?(this.browser="firefox",this.browserSlow=!1):e.indexOf("Mac OS")>-1?(this.browser="safari",this.browserSlow=!1):(this.browser="other",this.browserSlow=!1),this.browserMobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e.slice(0,4))}initGuard(e,t){var i,r;return this.options.debugInitialization&&!this.initialized&&(e||(i=new Error().stack.split(`
|
47
|
-
`),r=i[0]=="Error"?i[2]:i[1],r[0]==" "?e=r.trim().split(" ")[1].split(".")[1]:e=r.trim().split("@")[0]),console.warn("Table Not Initialized - Calling the "+e+" function before the table is initialized may result in inconsistent behavior, Please wait for the `tableBuilt` event before calling this function."+(t?" "+t:""))),this.initialized}blockRedraw(){this.initGuard(),this.eventBus.dispatch("redraw-blocking"),this.rowManager.blockRedraw(),this.columnManager.blockRedraw(),this.eventBus.dispatch("redraw-blocked")}restoreRedraw(){this.initGuard(),this.eventBus.dispatch("redraw-restoring"),this.rowManager.restoreRedraw(),this.columnManager.restoreRedraw(),this.eventBus.dispatch("redraw-restored")}setData(e,t,i){return this.initGuard(!1,"To set initial data please use the 'data' property in the table constructor."),this.dataLoader.load(e,t,i,!1)}clearData(){this.initGuard(),this.dataLoader.blockActiveLoad(),this.rowManager.clearData()}getData(e){return this.rowManager.getData(e)}getDataCount(e){return this.rowManager.getDataCount(e)}replaceData(e,t,i){return this.initGuard(),this.dataLoader.load(e,t,i,!0,!0)}updateData(e){var t=0;return this.initGuard(),new Promise((i,r)=>{this.dataLoader.blockActiveLoad(),typeof e=="string"&&(e=JSON.parse(e)),e&&e.length>0?e.forEach(o=>{var a=this.rowManager.findRow(o[this.options.index]);a?(t++,a.updateData(o).then(()=>{t--,t||i()}).catch(u=>{r("Update Error - Unable to update row",o,u)})):r("Update Error - Unable to find row",o)}):(console.warn("Update Error - No data provided"),r("Update Error - No data provided"))})}addData(e,t,i){return this.initGuard(),new Promise((r,o)=>{this.dataLoader.blockActiveLoad(),typeof e=="string"&&(e=JSON.parse(e)),e?this.rowManager.addRows(e,t,i).then(a=>{var u=[];a.forEach(function(d){u.push(d.getComponent())}),r(u)}):(console.warn("Update Error - No data provided"),o("Update Error - No data provided"))})}updateOrAddData(e){var t=[],i=0;return this.initGuard(),new Promise((r,o)=>{this.dataLoader.blockActiveLoad(),typeof e=="string"&&(e=JSON.parse(e)),e&&e.length>0?e.forEach(a=>{var u=this.rowManager.findRow(a[this.options.index]);i++,u?u.updateData(a).then(()=>{i--,t.push(u.getComponent()),i||r(t)}):this.rowManager.addRows(a).then(d=>{i--,t.push(d[0].getComponent()),i||r(t)})}):(console.warn("Update Error - No data provided"),o("Update Error - No data provided"))})}getRow(e){var t=this.rowManager.findRow(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)}getRowFromPosition(e){var t=this.rowManager.getRowFromPosition(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)}deleteRow(e){var t=[];this.initGuard(),Array.isArray(e)||(e=[e]);for(let i of e){let r=this.rowManager.findRow(i,!0);if(r)t.push(r);else return console.error("Delete Error - No matching row found:",i),Promise.reject("Delete Error - No matching row found")}return t.sort((i,r)=>this.rowManager.rows.indexOf(i)>this.rowManager.rows.indexOf(r)?1:-1),t.forEach(i=>{i.delete()}),this.rowManager.reRenderInPosition(),Promise.resolve()}addRow(e,t,i){return this.initGuard(),typeof e=="string"&&(e=JSON.parse(e)),this.rowManager.addRows(e,t,i,!0).then(r=>r[0].getComponent())}updateOrAddRow(e,t){var i=this.rowManager.findRow(e);return this.initGuard(),typeof t=="string"&&(t=JSON.parse(t)),i?i.updateData(t).then(()=>i.getComponent()):this.rowManager.addRows(t).then(r=>r[0].getComponent())}updateRow(e,t){var i=this.rowManager.findRow(e);return this.initGuard(),typeof t=="string"&&(t=JSON.parse(t)),i?i.updateData(t).then(()=>Promise.resolve(i.getComponent())):(console.warn("Update Error - No matching row found:",e),Promise.reject("Update Error - No matching row found"))}scrollToRow(e,t,i){var r=this.rowManager.findRow(e);return r?this.rowManager.scrollToRow(r,t,i):(console.warn("Scroll Error - No matching row found:",e),Promise.reject("Scroll Error - No matching row found"))}moveRow(e,t,i){var r=this.rowManager.findRow(e);this.initGuard(),r?r.moveToRow(t,i):console.warn("Move Error - No matching row found:",e)}getRows(e){return this.rowManager.getComponents(e)}getRowPosition(e){var t=this.rowManager.findRow(e);return t?t.getPosition():(console.warn("Position Error - No matching row found:",e),!1)}setColumns(e){this.initGuard(!1,"To set initial columns please use the 'columns' property in the table constructor"),this.columnManager.setColumns(e)}getColumns(e){return this.columnManager.getComponents(e)}getColumn(e){var t=this.columnManager.findColumn(e);return t?t.getComponent():(console.warn("Find Error - No matching column found:",e),!1)}getColumnDefinitions(){return this.columnManager.getDefinitionTree()}showColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),t)t.show();else return console.warn("Column Show Error - No matching column found:",e),!1}hideColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),t)t.hide();else return console.warn("Column Hide Error - No matching column found:",e),!1}toggleColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),t)t.visible?t.hide():t.show();else return console.warn("Column Visibility Toggle Error - No matching column found:",e),!1}addColumn(e,t,i){var r=this.columnManager.findColumn(i);return this.initGuard(),this.columnManager.addColumn(e,t,r).then(o=>o.getComponent())}deleteColumn(e){var t=this.columnManager.findColumn(e);return this.initGuard(),t?t.delete():(console.warn("Column Delete Error - No matching column found:",e),Promise.reject())}updateColumnDefinition(e,t){var i=this.columnManager.findColumn(e);return this.initGuard(),i?i.updateDefinition(t):(console.warn("Column Update Error - No matching column found:",e),Promise.reject())}moveColumn(e,t,i){var r=this.columnManager.findColumn(e),o=this.columnManager.findColumn(t);this.initGuard(),r?o?this.columnManager.moveColumn(r,o,i):console.warn("Move Error - No matching column found:",o):console.warn("Move Error - No matching column found:",e)}scrollToColumn(e,t,i){return new Promise((r,o)=>{var a=this.columnManager.findColumn(e);return a?this.columnManager.scrollToColumn(a,t,i):(console.warn("Scroll Error - No matching column found:",e),Promise.reject("Scroll Error - No matching column found"))})}redraw(e){this.initGuard(),this.columnManager.redraw(e),this.rowManager.redraw(e)}setHeight(e){this.options.height=isNaN(e)?e:e+"px",this.element.style.height=this.options.height,this.rowManager.initializeRenderer(),this.rowManager.redraw()}on(e,t){this.externalEvents.subscribe(e,t)}off(e,t){this.externalEvents.unsubscribe(e,t)}dispatchEvent(){var e=Array.from(arguments);e.shift(),this.externalEvents.dispatch(...arguments)}alert(e,t){this.initGuard(),this.alertManager.alert(e,t)}clearAlert(){this.initGuard(),this.alertManager.clear()}modExists(e,t){return this.modules[e]?!0:(t&&console.error("Tabulator Module Not Installed: "+e),!1)}module(e){var t=this.modules[e];return t||console.error("Tabulator module not installed: "+e),t}}si.defaultOptions=Mp,new el(si);class tl extends si{}new el(tl,kp);const Yp=[p.createElementVNode("svg",{class:"h-4 w-4 fill-muted-600 dark:fill-muted-200",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512"},[p.createElementVNode("path",{d:"M177.7 32h92.5c5.5 0 10.6 2.8 13.6 7.5L299.1 64H148.9l15.3-24.5c2.9-4.7 8.1-7.5 13.6-7.5zM336.9 64L311 22.6C302.2 8.5 286.8 0 270.3 0H177.7C161.2 0 145.8 8.5 137 22.6L111.1 64H64.1 32 16C7.2 64 0 71.2 0 80s7.2 16 16 16H34.3L59.8 452.6C62.1 486.1 90 512 123.6 512H324.4c33.6 0 61.4-25.9 63.8-59.4L413.7 96H432c8.8 0 16-7.2 16-16s-7.2-16-16-16H416 383.9 336.9zm44.8 32L356.3 450.3C355.1 467 341.2 480 324.4 480H123.6c-16.8 0-30.7-13-31.9-29.7L66.4 96H381.6z"})],-1)],Jp=[p.createElementVNode("svg",{class:"h-4 w-4 fill-muted-600 dark:fill-muted-200",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},[p.createElementVNode("path",{d:"M454.6 45.3l12.1 12.1c12.5 12.5 12.5 32.8 0 45.3L440 129.4 382.6 72l26.7-26.7c12.5-12.5 32.8-12.5 45.3 0zM189 265.6l171-171L417.4 152l-171 171c-4.2 4.2-9.6 7.2-15.4 8.6l-65.6 15.1L180.5 281c1.3-5.8 4.3-11.2 8.6-15.4zm197.7-243L166.4 243c-8.5 8.5-14.4 19.2-17.1 30.9l-20.9 90.6c-1.2 5.4 .4 11 4.3 14.9s9.5 5.5 14.9 4.3l90.6-20.9c11.7-2.7 22.4-8.6 30.9-17.1L489.4 125.3c25-25 25-65.5 0-90.5L477.3 22.6c-25-25-65.5-25-90.5 0zM80 64C35.8 64 0 99.8 0 144V432c0 44.2 35.8 80 80 80H368c44.2 0 80-35.8 80-80V304c0-8.8-7.2-16-16-16s-16 7.2-16 16V432c0 26.5-21.5 48-48 48H80c-26.5 0-48-21.5-48-48V144c0-26.5 21.5-48 48-48H208c8.8 0 16-7.2 16-16s-7.2-16-16-16H80z"})],-1)],Zp={__name:"ActionButton",props:{data:{},index:{}},setup(h){const e=h;return(t,i)=>(p.openBlock(),p.createElementBlock(p.Fragment,null,[p.createElementVNode("button",{onClick:i[0]||(i[0]=r=>p.unref(We.emitter).event("deleteBtn",e.data)),class:"mx-2 inline-flex items-center justify-center w-5 h-5 rounded-full text-gray-500 hover:text-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500"},Yp),p.createElementVNode("button",{onClick:i[1]||(i[1]=r=>p.unref(We.emitter).event("editBtn",e.data)),class:"mx-2 inline-flex items-center justify-center w-5 h-5 rounded-full text-gray-500 hover:text-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500"},Jp)],64))}},il={__name:"SelectColumn",props:{data:{default:()=>({})},index:{default:-1},all:{default:!1}},setup(h){const e=h,t=p.ref(!1);We.emitter.listen("toggle.select.all",r=>{e.all||(t.value=r,We.emitter.event("toggle.select",e.data.id))});function i(r){if(e.all)return We.emitter.event("toggle.select.all",t.value);We.emitter.event("toggle.select",e.data.id)}return(r,o)=>p.withDirectives((p.openBlock(),p.createElementBlock("input",{"onUpdate:modelValue":o[0]||(o[0]=a=>t.value=a),class:"rounded",type:"checkbox",onChange:i,style:{border:"1px dashed rgba(0, 0, 0, 0.2)"}},null,544)),[[p.vModelCheckbox,t.value]])}};let Un;const Qp=({element:h,headers:e,options:t}={element:null,headers:[],options:{}})=>(Un=new tl(h,{pagination:!1,paginationMode:"remote",layout:"fitDataStretch",resizableColumnFit:!0,paginationSize:5,paginationInitialPage:1,paginationSizeSelector:[3,6,8,10],paginationCounter:"rows",ajaxLoaderLoading:"<div style='display:inline-block; border:4px solid #333; border-radius:10px; background:#fff; font-weight:bold; font-size:16px; color:#000; padding:10px 20px;'>Loading Data</div>",columns:nl(e),...t}),Un);function nl(h){const e={_select_:{formatter:tm,formatterParams:{component:il},titleFormatter:im},_actions_:{formatter:em,formatterParams:{component:Zp}}};return h.map(t=>t.field in e?{...t,...e[t.field]}:t).map(t=>({...t,headerSort:!1}))}function em(h,e){const t=h.getRow().getData(),i=h.getRow().getPosition(),r=document.createElement("div"),o=e.component;return p.createApp(o,{data:t,index:i}).mount(r),r}function tm(h,e){const t=h.getRow().getData(),i=h.getRow().getPosition(),r=document.createElement("div"),o=e.component;return p.createApp(o,{data:t,index:i}).mount(r),r}function im(){const h=document.createElement("div");return p.createApp(il,{all:!0}).mount(h),h}function rl(h){Un.setData(h)}function nm(h){Un.setColumns(h)}const rm={up:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0NDggNTEyIj48IS0tISBGb250IEF3ZXNvbWUgUHJvIDYuNC4wIGJ5IEBmb250YXdlc29tZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tIExpY2Vuc2UgLSBodHRwczovL2ZvbnRhd2Vzb21lLmNvbS9saWNlbnNlIChDb21tZXJjaWFsIExpY2Vuc2UpIENvcHlyaWdodCAyMDIzIEZvbnRpY29ucywgSW5jLiAtLT48cGF0aCBkPSJNMjEyLjcgMTQ4LjdjNi4yLTYuMiAxNi40LTYuMiAyMi42IDBsMTYwIDE2MGM2LjIgNi4yIDYuMiAxNi40IDAgMjIuNnMtMTYuNCA2LjItMjIuNiAwTDIyNCAxODIuNiA3NS4zIDMzMS4zYy02LjIgNi4yLTE2LjQgNi4yLTIyLjYgMHMtNi4yLTE2LjQgMC0yMi42bDE2MC0xNjB6Ii8+PC9zdmc+",down:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0NDggNTEyIj48IS0tISBGb250IEF3ZXNvbWUgUHJvIDYuNC4wIGJ5IEBmb250YXdlc29tZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tIExpY2Vuc2UgLSBodHRwczovL2ZvbnRhd2Vzb21lLmNvbS9saWNlbnNlIChDb21tZXJjaWFsIExpY2Vuc2UpIENvcHlyaWdodCAyMDIzIEZvbnRpY29ucywgSW5jLiAtLT48cGF0aCBkPSJNMjEyLjcgMzMxLjNjNi4yIDYuMiAxNi40IDYuMiAyMi42IDBsMTYwLTE2MGM2LjItNi4yIDYuMi0xNi40IDAtMjIuNnMtMTYuNC02LjItMjIuNiAwTDIyNCAyOTcuNCA3NS4zIDE0OC43Yy02LjItNi4yLTE2LjQtNi4yLTIyLjYgMHMtNi4yIDE2LjQgMCAyMi42bDE2MCAxNjB6Ii8+PC9zdmc+"},sl=(h="up")=>{const e=document.createElement("img");return e.src=rm[h],e.style.width="10px",e.style.height="10px",e.style.marginLeft="5px",e},ol=(h,e)=>{h._column.titleHolderElement.style.display="flex",h._column.titleHolderElement.style.alignItems="center",h._column.titleHolderElement.appendChild(e)},al=h=>{h._column.titleHolderElement.lastChild.remove()};function sm(h,e){let t=[];e.on("headerClick",(i,r)=>{const o=r.getField();if(!["_index_","_select_","_actions_"].includes(o)){if(t.includes(o+":asc")){let a=t.indexOf(o+":asc");t[a]=o+":desc",al(r),ol(r,sl("down"))}else if(t.includes(o+":desc")){let a=t.indexOf(o+":desc");t.splice(a,1),al(r)}else ol(r,sl()),t.push(o+":asc");h.sorts=t,h.loadItems()}}),p.watch(()=>h.mainItems,i=>{rl(i)},{immediate:!0}),p.watch(()=>h.flatFields,()=>{nm(nl(h.headers))},{deep:!0}),p.watch(()=>h.loadings.mainLoading,i=>{i&&rl([])},{deep:!0})}const $x="",an=(h,e)=>{const t=h.__vccOpts||h;for(const[i,r]of e)t[i]=r;return t},ll=h=>(p.pushScopeId("data-v-86bb6d78"),h=h(),p.popScopeId(),h),om={key:0,id:"paginate"},am={class:"flex items-center justify-center py-2 lg:px-0 sm:px-6 px-4"},lm={class:"lg:w-5/5 w-full flex items-center justify-between border-t border-gray-200"},hm={class:"sm:flex hidden"},um=[ll(()=>p.createElementVNode("svg",{class:"rtl:rotate-180 w-[10px] fill-muted-600",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512"},[p.createElementVNode("path",{d:"M15 239c-9.4 9.4-9.4 24.6 0 33.9L207 465c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L65.9 256 241 81c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L15 239z"})],-1))],dm=["onClick"],cm={key:1,class:"text-sm font-medium leading-none text-gray-600 pt-3 mr-4 px-2"},fm=[ll(()=>p.createElementVNode("svg",{class:"ltr:rotate-180 w-[10px] fill-muted-600",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512"},[p.createElementVNode("path",{d:"M15 239c-9.4 9.4-9.4 24.6 0 33.9L207 465c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L65.9 256 241 81c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L15 239z"})],-1))],pm=an({__name:"MTablePagination",setup(h){const e=p.inject("store");function t(u){e.paginate(u)}function i(){e.mainPagination.currentPage>1&&t(e.mainPagination.currentPage-1)}function r(u){t(u)}function o(){e.mainPagination.currentPage<e.mainPagination.lastPage&&t(e.mainPagination.currentPage+1)}function a(){let u=[];if(e.mainPagination.lastPage>10){let d=e.mainPagination.currentPage,f=d-1,g=d+1;d!=1&&u.push(1),d!=1&&d!=2&&f!=2&&u.push("..."),f>1&&u.push(f),u.push(d),g<e.mainPagination.lastPage&&u.push(g),d!=e.mainPagination.lastPage&&d!=e.mainPagination.lastPage-1&&g!=e.mainPagination.lastPage-1&&u.push("..."),e.mainPagination.lastPage!=d&&u.push(e.mainPagination.lastPage)}else u=e.mainPagination.lastPage;return u}return(u,d)=>p.unref(e).mainPagination.lastPage?(p.openBlock(),p.createElementBlock("div",om,[p.createElementVNode("div",am,[p.createElementVNode("div",lm,[p.createElementVNode("div",hm,[p.createElementVNode("div",{onClick:i,class:"flex items-center pt-3 text-gray-600 hover:text-indigo-700 cursor-pointer"},um),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(a(),f=>(p.openBlock(),p.createElementBlock(p.Fragment,{key:f},[typeof f=="number"?(p.openBlock(),p.createElementBlock("p",{key:0,class:p.normalizeClass(p.unref(e).mainPagination.currentPage===f?"text-sm font-medium leading-none cursor-pointer text-indigo-700 !border-indigo-400 border-t-[1px] pt-3 mr-4 px-2":"text-sm font-medium leading-none cursor-pointer text-gray-600 hover:text-indigo-700 border-t-[1px] border-transparent hover:border-indigo-400 pt-3 mr-4 px-2"),onClick:g=>r(f)},p.toDisplayString(f),11,dm)):(p.openBlock(),p.createElementBlock("p",cm,p.toDisplayString(f),1))],64))),128)),p.createElementVNode("div",{onClick:o,class:"flex items-center pt-3 text-gray-600 hover:text-indigo-700 cursor-pointer"},fm)])])])])):p.createCommentVNode("",!0)}},[["__scopeId","data-v-86bb6d78"]]),mm={key:0,class:"mt-[-20px]"},gm={class:"flex animate-pulse flex-row items-center h-full justify-center"},bm={class:"w-full flex flex-row items-start rtl:mr-8 ltr:ml-8"},vm={key:1,class:"padding: 100px; mt-[-20px] rounded-b-xl bg-white text-center p-[100px] dark:bg-muted-800"},wm={class:"dark:text-muted-200 text-muted-600"},ym={__name:"MTable",setup(h){const e=p.ref(null),t=p.inject("store"),i=p.inject("dir"),r=p.computed(()=>t.mainItems.length===0&&!t.loadings.mainLoading);return p.onMounted(()=>{const o=Qp({options:{textDirection:i},element:e.value,headers:t.headers});sm(t,o)}),(o,a)=>(p.openBlock(),p.createElementBlock(p.Fragment,null,[p.createElementVNode("div",{ref_key:"table",ref:e,class:"mt-2"},null,512),p.unref(t).loadings.mainLoading?(p.openBlock(),p.createElementBlock("div",mm,[(p.openBlock(),p.createElementBlock(p.Fragment,null,p.renderList(10,u=>p.createElementVNode("div",{key:u,class:p.normalizeClass([{"border-t-0":u===1,"border-b-0":u===10,"bg-muted-50 dark:bg-muted-700":u%2!==0,"bg-white dark:bg-muted-800":u%2===0},"w-full py-4 mx-auto border-b-1"])},[p.createElementVNode("div",gm,[p.createElementVNode("div",bm,[(p.openBlock(),p.createElementBlock(p.Fragment,null,p.renderList(9,d=>p.createElementVNode("div",{key:d,class:"mx-1 w-[10%] bg-muted-300 dark:bg-muted-900 h-2.5 rounded-md"})),64))])])],2)),64))])):p.createCommentVNode("",!0),r.value?(p.openBlock(),p.createElementBlock("div",vm,[p.createElementVNode("h2",wm,p.toDisplayString(o.$fcTr("not_load_or_existing_data")),1)])):p.createCommentVNode("",!0),p.createVNode(pm)],64))}},Cm={class:"w-full"},Em={__name:"MList",setup(h){const e=p.inject("store");We.emitter.listen("toggle.select",i=>{if(e.selected.has(i))return e.selected.delete(i);e.selected.add(i)});function t(){return{}}return(i,r)=>(p.openBlock(),p.createElementBlock("div",Cm,[(p.openBlock(),p.createBlock(p.resolveDynamicComponent(ym),p.normalizeProps(p.guardReactiveProps(t())),null,16))]))}},xm={class:"flex items-center gap-3 relative hover:bg-muted-200 dark:hover:bg-muted-700 rounded-lg px-5 pl-3 rtl:pl-8 rtl:pr-5 py-2 duration-300"},_m=["modelValue"],Rm={class:"text-success-500 peer-disabled:opacity-75"},Tm=p.createElementVNode("svg",{"aria-hidden":"true",viewBox:"0 0 52 52","data-v-3e8a7b5f":""},[p.createElementVNode("circle",{cx:"26",cy:"26",r:"25",fill:"none",stroke:"currentColor"}),p.createElementVNode("path",{fill:"none",stroke:"currentColor",d:"m14.1 27.2 7.1 7.2 16.7-16.8"})],-1),Sm={class:"font-heading text-muted-800 text-xs font-semibold leading-tight dark:text-white"},km={__name:"SelectColumnItem",props:{checked:{default:!1},columnName:{default:""}},setup(h){return(e,t)=>(p.openBlock(),p.createElementBlock("div",xm,[p.createElementVNode("div",{class:p.normalizeClass(["nui-focus block focus-within:outline-current rounded-full",JSON.parse(h.checked)?"is-checked":"is-unchecked"])},[p.createElementVNode("input",{modelValue:h.checked,type:"checkbox",class:"peer cursor-pointer disabled:cursor-not-allowed","true-value":"true","false-value":"false",onClick:t[0]||(t[0]=i=>e.$emit("toggle"))},null,8,_m),p.createElementVNode("label",Rm,[p.createElementVNode("div",{class:p.normalizeClass(["rtl:left-[auto] rtl:!right-0 ltr:right-[auto] ltr:left-0",JSON.parse(h.checked)?"is-opaque":""])},null,2),Tm])],2),p.createElementVNode("div",null,[p.createElementVNode("h6",Sm,p.toDisplayString(h.columnName),1)])]))}};function Mm(h){return p.getCurrentScope()?(p.onScopeDispose(h),!0):!1}function vs(h){return typeof h=="function"?h():p.unref(h)}const hl=typeof window<"u"&&typeof document<"u",ws=()=>{},Lm=Am();function Am(){var h;return hl&&((h=window==null?void 0:window.navigator)==null?void 0:h.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent)}function Dm(h,e){function t(...i){return new Promise((r,o)=>{Promise.resolve(h(()=>e.apply(this,i),{fn:e,thisArg:this,args:i})).then(r).catch(o)})}return t}const ul=h=>h();function Fm(h=ul){const e=p.ref(!0);function t(){e.value=!1}function i(){e.value=!0}const r=(...o)=>{e.value&&h(...o)};return{isActive:p.readonly(e),pause:t,resume:i,eventFilter:r}}function Pm(h,e,t={}){const{eventFilter:i=ul,...r}=t;return p.watch(h,Dm(i,e),r)}function Om(h,e,t={}){const{eventFilter:i,...r}=t,{eventFilter:o,pause:a,resume:u,isActive:d}=Fm(i);return{stop:Pm(h,e,{...r,eventFilter:o}),pause:a,resume:u,isActive:d}}function ln(h){const e=vs(h);return(e==null?void 0:e.$el)??e}const ki=hl?window:void 0;function hn(...h){let e,t,i,r;if(typeof h[0]=="string"||Array.isArray(h[0])?([t,i,r]=h,e=ki):[e,t,i,r]=h,!e)return ws;Array.isArray(t)||(t=[t]),Array.isArray(i)||(i=[i]);const o=[],a=()=>{o.forEach(g=>g()),o.length=0},u=(g,y,w,E)=>(g.addEventListener(y,w,E),()=>g.removeEventListener(y,w,E)),d=p.watch(()=>[ln(e),vs(r)],([g,y])=>{a(),g&&o.push(...t.flatMap(w=>i.map(E=>u(g,w,E,y))))},{immediate:!0,flush:"post"}),f=()=>{d(),a()};return Mm(f),f}let dl=!1;function zm(h,e,t={}){const{window:i=ki,ignore:r=[],capture:o=!0,detectIframe:a=!1}=t;if(!i)return;Lm&&!dl&&(dl=!0,Array.from(i.document.body.children).forEach(w=>w.addEventListener("click",ws)),i.document.documentElement.addEventListener("click",ws));let u=!0;const d=w=>r.some(E=>{if(typeof E=="string")return Array.from(i.document.querySelectorAll(E)).some(S=>S===w.target||w.composedPath().includes(S));{const S=ln(E);return S&&(w.target===S||w.composedPath().includes(S))}}),g=[hn(i,"click",w=>{const E=ln(h);if(!(!E||E===w.target||w.composedPath().includes(E))){if(w.detail===0&&(u=!d(w)),!u){u=!0;return}e(w)}},{passive:!0,capture:o}),hn(i,"pointerdown",w=>{const E=ln(h);E&&(u=!w.composedPath().includes(E)&&!d(w))},{passive:!0}),a&&hn(i,"blur",w=>{setTimeout(()=>{var S;const E=ln(h);((S=i.document.activeElement)==null?void 0:S.tagName)==="IFRAME"&&!(E!=null&&E.contains(i.document.activeElement))&&e(w)},0)})].filter(Boolean);return()=>g.forEach(w=>w())}const jn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Kn="__vueuse_ssr_handlers__",Hm=Im();function Im(){return Kn in jn||(jn[Kn]=jn[Kn]||{}),jn[Kn]}function Nm(h,e){return Hm[h]||e}function Bm(h){return h==null?"any":h instanceof Set?"set":h instanceof Map?"map":h instanceof Date?"date":typeof h=="boolean"?"boolean":typeof h=="string"?"string":typeof h=="object"?"object":Number.isNaN(h)?"any":"number"}const Vm={boolean:{read:h=>h==="true",write:h=>String(h)},object:{read:h=>JSON.parse(h),write:h=>JSON.stringify(h)},number:{read:h=>Number.parseFloat(h),write:h=>String(h)},any:{read:h=>h,write:h=>String(h)},string:{read:h=>h,write:h=>String(h)},map:{read:h=>new Map(JSON.parse(h)),write:h=>JSON.stringify(Array.from(h.entries()))},set:{read:h=>new Set(JSON.parse(h)),write:h=>JSON.stringify(Array.from(h))},date:{read:h=>new Date(h),write:h=>h.toISOString()}},cl="vueuse-storage";function Wm(h,e,t,i={}){const{flush:r="pre",deep:o=!0,listenToStorageChanges:a=!0,writeDefaults:u=!0,mergeDefaults:d=!1,shallow:f,window:g=ki,eventFilter:y,onError:w=B=>{console.error(B)}}=i,E=(f?p.shallowRef:p.ref)(e);if(!t)try{t=Nm("getDefaultStorage",()=>ki==null?void 0:ki.localStorage)()}catch(B){w(B)}if(!t)return E;const S=vs(e),D=Bm(S),P=i.serializer??Vm[D],{pause:k,resume:G}=Om(E,()=>K(E.value),{flush:r,deep:o,eventFilter:y});return g&&a&&(hn(g,"storage",se),hn(g,cl,V)),se(),E;function K(B){try{if(B==null)t.removeItem(h);else{const H=P.write(B),le=t.getItem(h);le!==H&&(t.setItem(h,H),g&&g.dispatchEvent(new CustomEvent(cl,{detail:{key:h,oldValue:le,newValue:H,storageArea:t}})))}}catch(H){w(H)}}function z(B){const H=B?B.newValue:t.getItem(h);if(H==null)return u&&S!==null&&t.setItem(h,P.write(S)),S;if(!B&&d){const le=P.read(H);return typeof d=="function"?d(le,S):D==="object"&&!Array.isArray(le)?{...S,...le}:le}else return typeof H!="string"?H:P.read(H)}function V(B){se(B.detail)}function se(B){if(!(B&&B.storageArea!==t)){if(B&&B.key==null){E.value=S;return}if(!(B&&B.key!==h)){k();try{(B==null?void 0:B.newValue)!==P.write(E.value)&&(E.value=z(B))}catch(H){w(H)}finally{B?p.nextTick(G):G()}}}}}const Gm={class:"relative"},$m=p.createElementVNode("ul",{class:"py-2"},[p.createElementVNode("li",{class:"px-4 py-2 hover:bg-gray-100 cursor-pointer"},"Item 1"),p.createElementVNode("li",{class:"px-4 py-2 hover:bg-gray-100 cursor-pointer"},"Item 2"),p.createElementVNode("li",{class:"px-4 py-2 hover:bg-gray-100 cursor-pointer"},"Item 3")],-1),fl={__name:"MMenu",setup(h){const e=p.ref(null);zm(e,o=>console.log(o));const t=p.ref(!1),i={isOpen:t.value},r={click:()=>t.value=!t.value};return(o,a)=>(p.openBlock(),p.createElementBlock("div",Gm,[p.renderSlot(o.$slots,"activator",p.normalizeProps(p.guardReactiveProps({on:r,props:i})),()=>[p.createElementVNode("button",p.mergeProps({class:"bg-blue-500 text-white px-4 py-2 rounded-md"},p.toHandlers(r,!0))," Open Menu "+p.toDisplayString(t.value),17)]),t.value?(p.openBlock(),p.createElementBlock("div",{key:0,class:"absolute top-[35px] left-0 mt-2 w-48 rounded-md shadow-lg z-[1]",ref_key:"target",ref:e},[p.renderSlot(o.$slots,"default",{},()=>[$m])],512)):p.createCommentVNode("",!0)]))}},qx="",lt=h=>(p.pushScopeId("data-v-9eed8c8f"),h=h(),p.popScopeId(),h),Um={class:"fc-header"},jm={class:"fc-header-left-sid"},Km=[lt(()=>p.createElementVNode("svg",{viewBox:"0 0 24 24"},[p.createElementVNode("path",{stroke:"currentColor","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1))],qm={class:"z-[1]"},Xm={class:"bg-muted-200 dark:bg-muted-800 cursor-pointer rounded-xl fm-light-shadow"},Ym={class:"group flex w-full items-center py-3 text-sm duration-300 text-muted-500 hover:bg-muted-300 dark:hover:bg-muted-700 rounded-xl justify-end flex-row-reverse"},Jm={class:"text-muted-400 font-sans text-xs"},Zm=lt(()=>p.createElementVNode("svg",{class:"fill-muted-400 w-3.5 mx-2",viewBox:"0 0 512 512"},[p.createElementVNode("path",{d:"M64 464H96v48H64c-35.3 0-64-28.7-64-64V64C0 28.7 28.7 0 64 0H229.5c17 0 33.3 6.7 45.3 18.7l90.5 90.5c12 12 18.7 28.3 18.7 45.3V288H336V160H256c-17.7 0-32-14.3-32-32V48H64c-8.8 0-16 7.2-16 16V448c0 8.8 7.2 16 16 16zM176 352h32c30.9 0 56 25.1 56 56s-25.1 56-56 56H192v32c0 8.8-7.2 16-16 16s-16-7.2-16-16V448 368c0-8.8 7.2-16 16-16zm32 80c13.3 0 24-10.7 24-24s-10.7-24-24-24H192v48h16zm96-80h32c26.5 0 48 21.5 48 48v64c0 26.5-21.5 48-48 48H304c-8.8 0-16-7.2-16-16V368c0-8.8 7.2-16 16-16zm32 128c8.8 0 16-7.2 16-16V400c0-8.8-7.2-16-16-16H320v96h16zm80-112c0-8.8 7.2-16 16-16h48c8.8 0 16 7.2 16 16s-7.2 16-16 16H448v32h32c8.8 0 16 7.2 16 16s-7.2 16-16 16H448v48c0 8.8-7.2 16-16 16s-16-7.2-16-16V432 368z"})],-1)),Qm={class:"group flex w-full items-center py-3 text-sm duration-300 text-muted-500 hover:bg-muted-300 dark:hover:bg-muted-700 rounded-xl justify-end flex-row-reverse"},eg={class:"text-muted-400 font-sans text-xs"},tg=lt(()=>p.createElementVNode("svg",{class:"fill-muted-400 w-3.5 mx-2",viewBox:"0 0 512 512"},[p.createElementVNode("path",{d:"M48 448V64c0-8.8 7.2-16 16-16H224v80c0 17.7 14.3 32 32 32h80V448c0 8.8-7.2 16-16 16H64c-8.8 0-16-7.2-16-16zM64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V154.5c0-17-6.7-33.3-18.7-45.3L274.7 18.7C262.7 6.7 246.5 0 229.5 0H64zm90.9 233.3c-8.1-10.5-23.2-12.3-33.7-4.2s-12.3 23.2-4.2 33.7L161.6 320l-44.5 57.3c-8.1 10.5-6.3 25.5 4.2 33.7s25.5 6.3 33.7-4.2L192 359.1l37.1 47.6c8.1 10.5 23.2 12.3 33.7 4.2s12.3-23.2 4.2-33.7L222.4 320l44.5-57.3c8.1-10.5 6.3-25.5-4.2-33.7s-25.5-6.3-33.7 4.2L192 280.9l-37.1-47.6z"})],-1)),ig={class:"group flex w-full items-center py-3 text-sm duration-300 text-muted-500 hover:bg-muted-300 dark:hover:bg-muted-700 rounded-xl justify-end flex-row-reverse"},ng={class:"text-muted-400 font-sans text-xs"},rg=lt(()=>p.createElementVNode("svg",{class:"fill-muted-400 w-3.5 mx-2",viewBox:"0 0 512 512"},[p.createElementVNode("path",{d:"M112 160V64c0-8.8 7.2-16 16-16H357.5c4.2 0 8.3 1.7 11.3 4.7l26.5 26.5c3 3 4.7 7.1 4.7 11.3V160h48V90.5c0-17-6.7-33.3-18.7-45.3L402.7 18.7C390.7 6.7 374.5 0 357.5 0H128C92.7 0 64 28.7 64 64v96h48zm16 208H384v96H128V368zm-16-48c-17.7 0-32 14.3-32 32H48V256c0-8.8 7.2-16 16-16H448c8.8 0 16 7.2 16 16v96H432c0-17.7-14.3-32-32-32H112zm320 80h48c17.7 0 32-14.3 32-32V256c0-35.3-28.7-64-64-64H64c-35.3 0-64 28.7-64 64V368c0 17.7 14.3 32 32 32H80v80c0 17.7 14.3 32 32 32H400c17.7 0 32-14.3 32-32V400z"})],-1)),sg=[lt(()=>p.createElementVNode("path",{d:"M371.2 122.9C340.3 96.2 300 80 256 80C158.8 80 80 158.8 80 256s78.8 176 176 176c39.7 0 76.2-13.1 105.6-35.2c10.6-8 25.6-5.8 33.6 4.8s5.8 25.6-4.8 33.6C353 463.3 306.4 480 256 480C132.3 480 32 379.7 32 256S132.3 32 256 32c57.3 0 109.6 21.5 149.2 56.9l30.5-30.5c6.6-6.6 15.6-10.3 25-10.3C480.2 48 496 63.8 496 83.3V200c0 13.3-10.7 24-24 24H355.3c-19.5 0-35.3-15.8-35.3-35.3c0-9.4 3.7-18.3 10.3-25l40.8-40.8zm76.8-9L385.9 176H448V113.9z"},null,-1))],og=[lt(()=>p.createElementVNode("svg",{viewBox:"0 0 512 512"},[p.createElementVNode("path",{d:"M384 48c8.8 0 16 7.2 16 16V448c0 8.8-7.2 16-16 16H64c-8.8 0-16-7.2-16-16V64c0-8.8 7.2-16 16-16H384zM64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V64c0-35.3-28.7-64-64-64H64zM80 112v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V112c0-8.8-7.2-16-16-16H96c-8.8 0-16 7.2-16 16zM96 352c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V368c0-8.8-7.2-16-16-16H96zm80-224c0 13.3 10.7 24 24 24H344c13.3 0 24-10.7 24-24s-10.7-24-24-24H200c-13.3 0-24 10.7-24 24zm32 128c0 13.3 10.7 24 24 24H344c13.3 0 24-10.7 24-24s-10.7-24-24-24H232c-13.3 0-24 10.7-24 24zM176 384c0 13.3 10.7 24 24 24H344c13.3 0 24-10.7 24-24s-10.7-24-24-24H200c-13.3 0-24 10.7-24 24zm-4.7-140.7c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0L112 257.4 99.3 244.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l24 24c6.2 6.2 16.4 6.2 22.6 0l48-48z"})],-1))],ag=[lt(()=>p.createElementVNode("svg",{viewBox:"0 0 448 512",class:"z-[1]"},[p.createElementVNode("path",{d:"M64 448c-17.7 0-32-14.3-32-32V96c0-17.7 14.3-32 32-32H384c17.7 0 32 14.3 32 32V416c0 17.7-14.3 32-32 32H64zM0 416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64C28.7 32 0 60.7 0 96V416zM128 288c8.8 0 16-7.2 16-16V144c0-8.8-7.2-16-16-16s-16 7.2-16 16V272c0 8.8 7.2 16 16 16zm176 48c0 8.8 7.2 16 16 16s16-7.2 16-16V144c0-8.8-7.2-16-16-16s-16 7.2-16 16V336zm-80-80c8.8 0 16-7.2 16-16V144c0-8.8-7.2-16-16-16s-16 7.2-16 16v96c0 8.8 7.2 16 16 16z"})],-1))],lg={class:"bg-white dark:bg-muted-800 rounded-xl pt-1 rtl:text-right ltr:text-left fm-light-shadow"},hg={class:"m-3 mt-2 text-muted-600 dark:text-muted-200"},ug={class:"p-2"},dg={class:"fm-header-rigth-sid flex w-full sm:w-auto rtl:flex-row-reverse rtl:justify-end z-10"},cg={key:0},fg=[lt(()=>p.createElementVNode("span",null,null,-1))],pg=[lt(()=>p.createElementVNode("path",{d:"M0 73.7C0 50.7 18.7 32 41.7 32H470.3c23 0 41.7 18.7 41.7 41.7c0 9.6-3.3 18.9-9.4 26.3L336 304.5V447.7c0 17.8-14.5 32.3-32.3 32.3c-7.3 0-14.4-2.5-20.1-7l-92.5-73.4c-9.6-7.6-15.1-19.1-15.1-31.3V304.5L9.4 100C3.3 92.6 0 83.3 0 73.7zM55 80L218.6 280.8c3.5 4.3 5.4 9.6 5.4 15.2v68.4l64 50.8V296c0-5.5 1.9-10.9 5.4-15.2L457 80H55z"},null,-1))],mg={class:"group/nui-input relative rtl:"},gg=["placeholder"],bg={class:"ltr:left-0 text-muted-400 group-focus-within/nui-input:text-primary-500 absolute end-0 rtl:start-0 top-0 flex items-center justify-center transition-colors duration-300 peer-disabled:cursor-not-allowed peer-disabled:opacity-75 h-10 w-10"},vg={key:0,class:"icon h-[1.15rem] w-[1.15rem]",width:"1em",height:"1em",viewBox:"0 0 24 24"},wg=[lt(()=>p.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[p.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),p.createElementVNode("path",{d:"m21 21l-4.35-4.35"})],-1))],yg={key:1,xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",class:"icon animate-spin"},Cg=[lt(()=>p.createElementVNode("path",{d:"M457 372c11.5 6.6 26.3 2.7 31.8-9.3C503.7 330.2 512 294.1 512 256C512 122.7 410.1 13.2 280 1.1C266.8-.1 256 10.7 256 24v0c0 13.3 10.8 23.9 24 25.4C383.5 61.2 464 149.2 464 256c0 29.3-6.1 57.3-17 82.6c-5.3 12.2-1.5 26.8 10 33.5v0z"},null,-1))],Eg=an({__name:"MButtonBox",setup(h){const{event:e}=We.emitter,t=p.inject("store");function i(y){y===t.panel?t.panel="":t.panel=y}const r=p.ref(null);p.onMounted(()=>{r.value=document.body.getAttribute("dir")});const o=p.computed(()=>t.flatFields.find(y=>y.field==="_select_")),a=p.computed(()=>!!o.value.isHeader);function u(){o.value.isHeader=!o.value.isHeader,o.value.isHeader||t.selected.clear()}const d=p.ref(!1);function f(){d.value=!0,t.loadItems().finally(()=>d.value=!1)}const g=W.debounce(f,600);return(y,w)=>(p.openBlock(),p.createElementBlock("div",Um,[p.createElementVNode("div",jm,[p.createElementVNode("button",p.mergeProps(y.props,{class:"fc-plus-btn",onClick:w[0]||(w[0]=E=>p.unref(e)("createBtn"))}),Km,16),p.createVNode(fl,null,{activator:p.withCtx(({on:E,props:S})=>[p.createElementVNode("button",p.mergeProps({class:S.isOpen?"before:block":"before:hidden"},S,p.toHandlers(E,!0),{class:"fc-header-icon-btn fc-drop-down-btn min-w-[130px]"}),[p.createElementVNode("span",qm,p.toDisplayString(y.$fcTr("export")),1)],16)]),default:p.withCtx(()=>[p.createElementVNode("div",Xm,[p.createElementVNode("a",Ym,[p.createElementVNode("p",Jm,p.toDisplayString(y.$fcTr("export_as_pdf")),1),Zm]),p.createElementVNode("a",Qm,[p.createElementVNode("p",eg,p.toDisplayString(y.$fcTr("export_as_excel")),1),tg]),p.createElementVNode("a",ig,[p.createElementVNode("p",ng,p.toDisplayString(y.$fcTr("print")),1),rg])])]),_:1}),p.createElementVNode("button",p.mergeProps(y.props,{class:"fc-header-icon-btn",onClick:w[1]||(w[1]=(...E)=>p.unref(t).reloadData&&p.unref(t).reloadData(...E))}),[(p.openBlock(),p.createElementBlock("svg",{class:p.normalizeClass({spin:p.unref(t).loadings.mainLoading}),viewBox:"0 0 512 512"},sg,2))],16),p.createElementVNode("button",p.mergeProps(y.props,{class:["fc-header-icon-btn",{"fm-active-btn":a.value}],onClick:u}),og,16),p.createVNode(fl,{"close-on-content-click":!1,location:r.value==="rtl"?"end":"start"},{activator:p.withCtx(({props:E,on:S})=>[p.createElementVNode("button",p.mergeProps(p.toHandlers(S,!0),{class:["fc-header-icon-btn",[E.isOpen?"light:!bg-white dark:bg-muted-800":"",E.isOpen?r.value==="rtl"?"expanded-rtl":"expanded2":""]]}),ag,16)]),default:p.withCtx(()=>[p.createElementVNode("div",lg,[p.createElementVNode("div",hg,p.toDisplayString(y.$fcTr("custom_column")),1),p.createElementVNode("ul",ug,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(p.unref(t).flatFieldsWithoutActions,E=>(p.openBlock(),p.createBlock(km,{key:E.field,"column-name":E.title,checked:E.isHeader,onToggle:S=>E.isHeader=!E.isHeader},null,8,["column-name","checked","onToggle"]))),128))])])]),_:1},8,["location"])]),p.createElementVNode("div",dg,[p.createElementVNode("button",p.mergeProps(y.props,{class:["test fc-header-icon-btn transform transition-all",p.unref(t).panel==="filters"?"!bg-white dark:!bg-muted-800 !rounded-b-none ":""],onClick:w[2]||(w[2]=E=>i("filters"))}),[p.createVNode(p.Transition,{name:"scale"},{default:p.withCtx(()=>[p.unref(t).panel==="filters"?(p.openBlock(),p.createElementBlock("div",cg,fg)):p.createCommentVNode("",!0)]),_:1}),(p.openBlock(),p.createElementBlock("svg",{class:p.normalizeClass(p.unref(t).panel==="filters"?"light:!fill-primary-700":""),stroke:"currentColor",viewBox:"0 0 512 512"},pg,2))],16),p.createElementVNode("div",mg,[p.withDirectives(p.createElementVNode("input",{"onUpdate:modelValue":w[3]||(w[3]=E=>p.unref(t).searchParam=E),type:"text",class:"nui-focus !pl-4 border-muted-300 text-muted-600 placeholder:text-muted-300 dark:border-muted-700 dark:bg-muted-900/75 dark:text-muted-200 dark:placeholder:text-muted-500 dark:focus:border-muted-700 peer w-full border bg-white font-sans transition-all duration-300 disabled:cursor-not-allowed disabled:opacity-75 px-2 h-10 py-2 text-sm leading-5 pe-4 ps-9 rounded-full",placeholder:y.$fcTr("search"),onKeyup:w[4]||(w[4]=(...E)=>p.unref(g)&&p.unref(g)(...E))},null,40,gg),[[p.vModelText,p.unref(t).searchParam]]),p.createElementVNode("div",bg,[d.value?(p.openBlock(),p.createElementBlock("svg",yg,Cg)):(p.openBlock(),p.createElementBlock("svg",vg,wg))])])])]))}},[["__scopeId","data-v-9eed8c8f"]]),xg={TextFilter:()=>{const h=Qi();return{op:{placeholder:h.translate("operator"),columns:4,items:[{value:"$eq",text:h.translate("equal_to")},{value:"$ne",text:h.translate("not_equal_to")},{value:"$gt",text:h.translate("greater_than")},{value:"$lt",text:h.translate("less_than")},{value:"$contains",text:h.translate("look_like")}],"label-prop":"text","value-prop":"value",native:!1,type:"select"},value:{placeholder:h.translate("value"),type:"text",columns:4}}},SelectFilter:h=>{const e=Qi();return{op:{placeholder:e.translate("operator"),columns:4,items:[{value:"$in",text:e.translate("in")},{value:"$notIn",text:e.translate("not_in")}],labelProp:"text",valueProp:"value",native:!1,type:"select"},value:Ea({placeholder:e.translate("value"),items:"filterItems"in h?h.filterItems:h.items,search:!0,columns:4,labelProp:h.labelProp,valueProp:h.valueProp,object:!1})}},DateFilter:()=>{const h=Qi();return{op:{placeholder:h.translate("operator"),columns:4,items:[{value:"$eq",text:h.translate("equal_to")},{value:"$between",text:h.translate("between")},{value:"$gt",text:h.translate("greater_than")},{value:"$lt",text:h.translate("less_than")}],labelProp:"text",valueProp:"value",native:!1,type:"select"},value:xa({placeholder:h.translate("value"),columns:4})}}},a_="",Mi=h=>(p.pushScopeId("data-v-f90907f7"),h=h(),p.popScopeId(),h),_g={class:"border-muted-200 dark:border-muted-700 dark:bg-muted-800 relative mb-4 w-full rounded-lg border bg-white p-6 transition-all duration-300"},Rg={class:"flex flex-col ml-1 border-[rgba(0,0,0,.1)] pb-4"},Tg={class:"flex flex-row justify-between mb-4 items-center"},Sg={class:"font-heading text-base font-semibold leading-tight text-muted-800 dark:text-white"},kg={class:"flex items-center"},Mg={class:"z-[1]"},Lg={class:"fc-drop-down-content"},Ag={key:0,class:"p-2 text-center"},Dg=["onClick"],Fg={class:"text-muted-400 font-sans text-sm"},Pg=Mi(()=>p.createElementVNode("svg",{"data-v-74b3417a":"","aria-hidden":"true",viewBox:"0 0 24 24",class:"h-4 w-4 text-muted-500"},[p.createElementVNode("path",{"data-v-74b3417a":"",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6 6 18M6 6l12 12"})],-1)),Og={class:"flex w-full justify-between align-start"},zg={class:"w-[12%] flex justify-center items-center"},Hg=["disabled"],Ig=Mi(()=>p.createElementVNode("svg",{class:"icon h-4 ml-1 w-4",viewBox:"0 0 24 24"},[p.createElementVNode("path",{stroke:"currentColor","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)),Ng=Mi(()=>p.createElementVNode("svg",{class:"icon h-4 w-4",viewBox:"0 0 24 24"},[p.createElementVNode("path",{stroke:"currentColor","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)),Bg={class:"flex border-t dark:border-muted-600 flex-col p-2 mt-2"},Vg={class:"flex items-center"},Wg={class:"font-heading text-base font-semibold leading-tight text-muted-800 dark:text-white"},Gg={class:"group-hover:text-red-500"},$g=Mi(()=>p.createElementVNode("svg",{stroke:"currentColor",width:"1em",height:"1em",class:"ml-1 rtl:ml-1 rtl:mr-1 group-hover:fill-red-500 dark:fill-muted-400 fill-muted-600",viewBox:"0 0 512 512"},[p.createElementVNode("path",{d:"M340 148L488 0l24 24L364 172l52 52L257.2 483.9 240 512l-23.3-23.3L23.3 295.3 0 272l28.1-17.2L288 96l52 52zM51.4 278.1l47.9 47.9 33.4-33.4L144 281.4 166.6 304l-11.3 11.3-33.4 33.4L233.9 460.6l89.6-146.6L197.9 188.6 51.4 278.1zM340.6 286l34.9-57.2-92.4-92.4L226 171.4 340.6 286z"})],-1)),Ug={class:"my-2 flex overflow-x-auto slimscroll"},jg={class:"flex"},Kg=["onClick"],qg={class:"mt-[0px]"},Xg=["onClick"],Yg=[Mi(()=>p.createElementVNode("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",class:"h-4 w-4 text-primary-500"},[p.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6 6 18M6 6l12 12"})],-1))],Jg={key:0,class:"flex items-center mx-2 text-[0.75rem]"},Zg={class:"flex w-full gap-x-2 justify-between !items-end"},Qg={class:"pt-4 md:pt-6"},eb={class:"flex gap-x-2"},tb=["placeholder"],ib=[Mi(()=>p.createElementVNode("svg",{"data-v-74b3417a":"","aria-hidden":"true",viewBox:"0 0 24 24",class:"h-4 w-4 text-primary-500"},[p.createElementVNode("path",{"data-v-74b3417a":"",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6 6 18M6 6l12 12"})],-1))],nb=an({__name:"MFilter",setup(h){const e=p.inject("store");let t=-1;const i=p.ref(!1),r=p.ref({field:""}),o=p.ref(!1),a=p.ref(""),u=w(),d=p.ref(null);function f(z){if(!z)return!1;const V={text:"TextFilter",date:"DateFilter",select:"SelectFilter"},se=W.get(V,z.type),B=W.get(xg,se);return typeof B=="function"?B(z):!1}const g={field:{placeholder:"field",type:"select",native:!1,items:e.headersWithoutActions,"label-prop":"title","value-prop":"field",object:!0,search:!0,trackBy:["title"],columns:2,onChange(z,V,se){const B=f(z)||[];for(const H in r.value)H!=="field"&&delete r.value[H];y.value={...g,...B},p.nextTick(()=>{const H=se.form$.el$("value");"clear"in H&&H.clear(),"updateItems"in H&&H.updateItems()})}}},y=p.ref({...g});function w(){const z=window.location.pathname.replace(/^\/|\/$/g,"")+"-filters";return Wm(z,{},localStorage,{mergeDefaults:!0})}function E(){e.filters.push(W.cloneDeep(r.value)),r.value={}}function S(){t!==-1&&e.filters.splice(t,1,r.value),i.value=!1,r.value={}}function D(z,V){i.value=!0,t=V,r.value=z,p.nextTick(()=>{r.value.op=z.op,r.value.value=z.value})}function P(z){e.filters=e.filters.filter(V=>V!==z)}function k(){e.filters=[],e.loadItems()}function G(){if(!o.value)return o.value=!0,d.value.focus();a.value&&(u.value[a.value]={...e.filters},o.value=!1,a.value="",d.value.blur())}function K(){e.loadItems()}return(z,V)=>{const se=p.resolveComponent("v-menu"),B=p.resolveComponent("Vueform");return p.withDirectives((p.openBlock(),p.createElementBlock("div",{class:p.normalizeClass(["accordion-content",{hide:p.unref(e).panel!=="filters"}])},[p.createElementVNode("div",_g,[p.createElementVNode("div",Rg,[p.createElementVNode("div",Tg,[p.createElementVNode("h3",Sg,p.toDisplayString(z.$fcTr("filter_data")),1),p.createElementVNode("div",kg,[p.createVNode(se,{transition:"scale-transition"},{activator:p.withCtx(({props:H})=>[p.createElementVNode("button",p.mergeProps({class:JSON.parse(H["aria-expanded"])?"before:block":"before:hidden"},H,{class:"fc-filter-choose is-button rounded is-button-default min-w-[130px]"}),[p.createElementVNode("span",Mg,p.toDisplayString(z.$fcTr("choose_filter")),1)],16)]),default:p.withCtx(()=>[p.createElementVNode("div",Lg,[Object.keys(p.unref(u)).length===0?(p.openBlock(),p.createElementBlock("p",Ag,p.toDisplayString(z.$fcTr("not_filter_create_yes")),1)):p.createCommentVNode("",!0),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(p.unref(u),(H,le)=>(p.openBlock(),p.createElementBlock("a",{class:"group rounded flex w-full items-center py-3 text-sm duration-300 text-muted-500 hover:bg-muted-100 dark:hover:bg-muted-700 justify-between rtl:pl-4 rtl:pr-5",key:le,onClick:p.withModifiers(ze=>p.unref(e).filters=Object.values(H),["stop"])},[p.createElementVNode("p",Fg,p.toDisplayString(le),1),Pg],8,Dg))),128))])]),_:1})])]),p.createElementVNode("div",Og,[p.createVNode(B,{modelValue:r.value,"onUpdate:modelValue":V[0]||(V[0]=H=>r.value=H),schema:y.value,sync:!0,class:"w-[100%] justify-between ml-4",columns:{label:12}},null,8,["modelValue","schema"]),p.createElementVNode("div",zg,[i.value?(p.openBlock(),p.createElementBlock("button",{key:1,class:"!border-dashed is-button-default is-button w-full rounded-full font-bold py-1 px-2 !border-green-400 !text-green-400 hover:!bg-green-50",onClick:S},[p.createTextVNode(p.toDisplayString(z.$fcTr("edit_filter"))+" ",1),Ng])):(p.openBlock(),p.createElementBlock("button",{key:0,disabled:!r.value.field,class:"disabled:cursor-not-allowed disabled:hover:bg-transparent !border-dashed !h-[86%] is-button-default is-button w-full rounded font-bold py-1 px-2 !border-green-400 !text-green-400 dark:active:hover:bg-muted-600 active:hover:!bg-green-50",onClick:E},[Ig,p.createTextVNode(" "+p.toDisplayString(z.$fcTr("add_filter")),1)],8,Hg))])])]),p.withDirectives(p.createElementVNode("div",Bg,[p.createElementVNode("div",Vg,[p.createElementVNode("h3",Wg,p.toDisplayString(z.$fcTr("active_filter")),1),p.createElementVNode("button",{onClick:k,class:"is-button group hover:text-red-500 hover:border-red-500 w-fit text-muted-600 dark:text-muted-400 !text-xs border !px-3 !py-0 !h-[1.5rem] mx-2 !rounded-full"},[p.createElementVNode("span",Gg,p.toDisplayString(z.$fcTr("clear_all")),1),$g])]),p.createElementVNode("div",Ug,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(p.unref(e).filters,(H,le)=>(p.openBlock(),p.createElementBlock(p.Fragment,{key:le},[p.createElementVNode("div",jg,[p.createElementVNode("span",{class:"flex px-3 font-sans transition-shadow duration-300 py-1 text-[0.75rem] cursor-pointer rounded-full bg-primary-100 text-primary-500 border-primary-100 dark:border-primary-500 dark:text-primary-500 border dark:bg-transparent",onClick:ze=>D(H,le)},[p.createElementVNode("span",qg,p.toDisplayString(p.unref(W.get)(H,"field.title")),1),p.createElementVNode("button",{class:"text-white font-bold rounded px-1 hover:bg-primary-500 hover:text-black-500",onClick:p.withModifiers(ze=>P(H),["stop"])},Yg,8,Xg)],8,Kg)]),p.unref(e).filters.length-1!==le?(p.openBlock(),p.createElementBlock("span",Jg,p.toDisplayString(z.$fcTr("&")),1)):p.createCommentVNode("",!0)],64))),128))])],512),[[p.vShow,p.unref(e).filters.length>0]]),p.createElementVNode("div",Zg,[p.createElementVNode("button",{onClick:V[1]||(V[1]=H=>p.unref(e).panel=""),class:"is-button text-muted-500 rounded hover:text-red-500 !underline focus-within:!outline-none"},p.toDisplayString(z.$fcTr("cancel")),1),p.createElementVNode("div",Qg,[p.createElementVNode("div",eb,[p.createElementVNode("button",{onClick:V[5]||(V[5]=p.withModifiers(H=>Object.keys(p.unref(e).filters).length!==0?G():"",["self"])),class:p.normalizeClass([{"!bg-muted-100 dark:!bg-muted-700 ltr:pr-1":o.value," focus:outline-none !cursor-not-allowed":Object.keys(p.unref(e).filters).length===0},"transitionX-inp is-button rounded is-button-default"])},[p.createElementVNode("span",{onClick:V[2]||(V[2]=p.withModifiers(H=>Object.keys(p.unref(e).filters).length!==0?G():"",["self"])),class:p.normalizeClass({" bg-green-500 px-2 py-1 rounded text-muted-50":o.value," focus:outline-none !cursor-not-allowed":Object.keys(p.unref(e).filters).length===0})},p.toDisplayString(z.$fcTr("save")),3),p.createElementVNode("span",{class:p.normalizeClass(["transitionX-inp overflow-hidden flex items-center justify-between",o.value?"w-[221px] opacity-1 ltr:pl-3 rtl:mr-3":"opacity-0 w-[0px]"])},[p.withDirectives(p.createElementVNode("input",{"onUpdate:modelValue":V[3]||(V[3]=H=>a.value=H),class:p.normalizeClass(["fc-focus py-1 rounded px-2 dark:bg-muted-800",o.value?" border border-1":"flex "]),placeholder:z.$fcTr("filter_save_placeholder"),ref_key:"filterNameInp",ref:d},null,10,tb),[[p.vModelText,a.value]]),p.createElementVNode("span",{class:"px-2",onClick:V[4]||(V[4]=H=>o.value=!1)},ib)],2)],2),p.createElementVNode("button",{onClick:K,class:"is-button rounded bg-primary-500 dark:bg-primary-500 hover:enabled:bg-primary-400 dark:hover:enabled:bg-primary-400 text-white hover:enabled:shadow-lg hover:enabled:shadow-primary-500/50 dark:hover:enabled:shadow-primary-800/20 focus-visible:outline-primary-400/70 focus-within:outline-primary-400/70 focus-visible:bg-primary-500 active:enabled:bg-primary-500 dark:focus-visible:outline-primary-400 dark:focus-within:outline-primary-400 dark:focus-visible:bg-primary-500 dark:active:enabled:bg-primary-500"},p.toDisplayString(z.$fcTr("filter")),1)])])])])],2)),[[p.vShow,p.unref(e).panel==="filters"]])}}},[["__scopeId","data-v-f90907f7"]]);function rb(h,e){return Array.isArray(h)?W.every(h,t=>W.isType(t,e)):!1}const sb=(h,e)=>{const t=W.get(h,"field"),i=W.get(h,"valueProp");return rb(e,"object")?e.map(r=>W.get(r,i)):W.get(e,t)},pl=(h,e)=>W.get(e,h.field),ob={select:sb,text:pl},ab=(h,e)=>{if(h.normalizer)return h.normalizer(e);const t=ob[h.type];return t?t(h,e):pl(h,e)},d_="",lb=h=>(p.pushScopeId("data-v-3044facd"),h=h(),p.popScopeId(),h),hb={key:0,class:"fixed z-10 inset-0 overflow-y-auto backdrop-blur-[4px]"},ub={class:"flex items-center overflow-y justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0"},db=lb(()=>p.createElementVNode("div",{class:"fixed inset-0 transition-opacity"},[p.createElementVNode("div",{class:"absolute inset-0 bg-gray-500 opacity-50"})],-1)),cb={class:"inline-block max-h-full align-bottom bg-white rounded-lg text-left shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full"},fb={class:"bg-card-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4 dark:bg-muted-700 dark:text-muted-200"},pb={class:"flex flex-col text-right"},mb={class:"mb-4 flex justify-between w-full"},gb={key:0,class:"text-primerr-700"},bb={key:1,class:"text-primerr-700"},vb={class:"mb-5"},wb={class:"flex justify-end"},yb=["disabled"],Cb={key:0},Eb={key:1},xb=an({__name:"MDialogForm",setup(h){const{event:e,listen:t}=We.emitter,i=p.inject("store"),r=p.ref(!1),o=p.ref(null);let a={};const u=f=>{let g={};for(const y of i.flatFieldsWithoutActions)g[y.field]=ab(y,f);return g};return(()=>{t("createBtn",()=>{a={},i.isEditing=!1,r.value=!0,i.form={}}),t("editBtn",f=>{a=f,i.isEditing=!0,r.value=!0,i.form=u(f)}),t("handleDialogForm",f=>{r.value=f}),t("saveForm",()=>(o.value.validate(),o.value.invalid?void 0:(()=>{i.isEditing?i.editItem({...i.form,id:a==null?void 0:a.id}):i.addItem({...i.form})})())),t(["createBtn"],()=>{i.form={}}),t("editTheItem",f=>{edit(f)}),t("addTheItem",f=>{add(f)})})(),(f,g)=>{const y=p.resolveComponent("Vueform");return p.openBlock(),p.createBlock(p.Transition,{name:"fade",appear:""},{default:p.withCtx(()=>[r.value?(p.openBlock(),p.createElementBlock("div",hb,[p.createElementVNode("div",ub,[db,p.createElementVNode("div",cb,[p.createElementVNode("div",fb,[p.createElementVNode("div",pb,[p.createElementVNode("h1",mb,[p.unref(i).isEditing?(p.openBlock(),p.createElementBlock("span",gb,p.toDisplayString(f.$fcTr("edit")),1)):(p.openBlock(),p.createElementBlock("span",bb,p.toDisplayString(f.$fcTr("add")),1)),p.createElementVNode("i",{class:"text-primerr-700 fal fa-times cursor-pointer",onClick:g[0]||(g[0]=w=>r.value=!1)})]),p.createElementVNode("div",vb,[p.createVNode(y,p.mergeProps({modelValue:p.unref(i).form,"onUpdate:modelValue":g[1]||(g[1]=w=>p.unref(i).form=w),schema:p.unref(i).formFields,columns:{label:12}},p.unref(i).structure,{ref_key:"form$",ref:o,sync:""}),null,16,["modelValue","schema"])]),p.createElementVNode("div",wb,[p.createElementVNode("button",{onClick:g[2]||(g[2]=w=>r.value=!1),class:"border p-2 px-8 rounded-md text-red-400 border-red-400"},p.toDisplayString(f.$fcTr("cancel")),1),p.createElementVNode("button",{disabled:p.unref(i).loadings.mainLoading,onClick:g[3]||(g[3]=w=>p.unref(e)("saveForm")),class:"border p-2 mx-1 px-8 rounded-md text-green-400 border-green-400"},[p.unref(i).loadings.mainLoading?(p.openBlock(),p.createElementBlock("span",Eb,"loading")):(p.openBlock(),p.createElementBlock("span",Cb,p.toDisplayString(f.$fcTr("save")),1))],8,yb)])])])])])])):p.createCommentVNode("",!0)]),_:1})}}},[["__scopeId","data-v-3044facd"]]),_b={};function Rb(h,e){return p.openBlock(),p.createElementBlock("div")}const Tb=an(_b,[["render",Rb]]),Sb={key:0,class:"fixed z-10 inset-0 overflow-y-auto"},kb={class:"flex items-center overflow-y justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0"},Mb=p.createElementVNode("div",{class:"fixed inset-0 transition-opacity"},[p.createElementVNode("div",{class:"absolute inset-0 bg-gray-500 opacity-75"})],-1),Lb={class:"inline-block max-h-full align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full"},Ab={class:"bg-card-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},Db={class:"flex flex-col text-right"},Fb={class:"mb-4 flex justify-between w-full"},Pb=p.createElementVNode("span",{class:"text-primerr-700"},"حذف",-1),Ob={class:"mb-5 flex flex-row flex-wrap"},zb={class:"flex justify-end"},Hb=["disabled"],Ib={key:0},Nb={key:1},Bb={__name:"MDeleteDialog",setup(h){const e=p.inject("store"),t=p.ref(!1);let i="";return We.emitter.listen("deleteBtn",r=>{t.value=!0,i=r.id}),We.emitter.listen("handleDeleteDialog",r=>{t.value=r}),(r,o)=>(p.openBlock(),p.createBlock(p.Transition,{name:"fade",appear:""},{default:p.withCtx(()=>[t.value?(p.openBlock(),p.createElementBlock("div",Sb,[p.createElementVNode("div",kb,[Mb,p.createElementVNode("div",Lb,[p.createElementVNode("div",Ab,[p.createElementVNode("div",Db,[p.createElementVNode("h1",Fb,[Pb,p.createElementVNode("i",{class:"text-primerr-700 fal fa-times cursor-pointer",onClick:o[0]||(o[0]=a=>t.value=!1)})]),p.createElementVNode("div",Ob,p.toDisplayString(r.$fcTr("alert_to_delete")),1),p.createElementVNode("div",zb,[p.createElementVNode("button",{onClick:o[1]||(o[1]=a=>t.value=!1),class:"border p-2 px-8 rounded-md text-red-400 border-red-400"},p.toDisplayString(r.$fcTr("no")),1),p.createElementVNode("button",{disabled:p.unref(e).loadings.mainLoading,class:"border p-2 mx-1 px-8 rounded-md text-green-400 border-green-400",onClick:o[2]||(o[2]=a=>p.unref(e).remove(p.unref(i)))},[p.unref(e).loadings.mainLoading?(p.openBlock(),p.createElementBlock("span",Nb,"loading")):(p.openBlock(),p.createElementBlock("span",Ib,p.toDisplayString(r.$fcTr("yes")),1))],8,Hb)])])])])])])):p.createCommentVNode("",!0)]),_:1}))}},f_="",Vb={key:0,class:"w-full border bg-white rounded p-2 flex align-center mt-2"},Wb=["onClick"],Gb={__name:"MHeaderBox",setup(h){const e=p.inject("store");let t=null;p.watch(()=>e.panel,r=>{e.panel==="headerBox"&&e.headersWithoutActions.forEach(o=>{t=document.querySelector(`[tabulator-field="${o.field}"]`),t.innerHTML=t.innerHTML+'<span class="fc-remove"><button class="text-white font-bold rounded px-1" onclick=""><svg aria-hidden="true" viewBox="0 0 24 24" class="h-4 w-4 text-primary-500"><path data-v-74b3417a="" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18 6 6 18M6 6l12 12"></path></svg></button></span>'})});function i(r){r.isHeader=!r.isHeader}return(r,o)=>p.unref(e).panel==="headerBox"?(p.openBlock(),p.createElementBlock("div",Vb,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(p.unref(e).flatFields,a=>(p.openBlock(),p.createElementBlock("div",{key:a.field,class:p.normalizeClass(["px-1 mx-1 cursor-pointer divide-y rounded",{"bg-primary-600 text-white":a.isHeader}]),onClick:u=>i(a)},p.toDisplayString(a.title),11,Wb))),128))])):p.createCommentVNode("",!0)}},$b={__name:"MCrud",props:{options:{default:()=>({})},hiddenActions:{default:()=>[]},fields:{default:()=>[]},dir:{default:()=>Qi().dir},route:{default:"route"}},emits:["mounted"],setup(h,{emit:e}){const t=h,i=nf({fields:t.fields,hiddenActions:t.hiddenActions,options:t.options,route:t.route});return p.provide("store",i),p.provide("dir",t.dir),document.body.setAttribute("dir",t.dir),p.onMounted(()=>{e("mounted")}),(r,o)=>(p.openBlock(),p.createElementBlock(p.Fragment,null,[p.createVNode(Eg),p.createVNode(nb),p.createVNode(Gb),p.createVNode(Em),p.createVNode(xb),p.createVNode(Tb),p.createVNode(Bb),p.renderSlot(r.$slots,"extra")],64))}},p_="",m_="",Ub=({headers:h,baseURL:e}={headers:[],baseURL:""})=>{mt.defaults.baseURL=e;for(const t in h)W.set(mt.defaults.headers,t,h[t])},jb=(h,{fields:e,axiosConfig:t,dir:i}={fields:{},axiosConfig:{},dir:"rtl"})=>{Ub(t);const r=Qi();r.dir=i||"rtl",h.config.globalProperties.$fcTr=o=>r.translate(o),Sa(e)};Ve.MCrud=$b,Ve.fields=_a,Ve.install=jb,Ve.registerFields=Sa,Object.defineProperty(Ve,Symbol.toStringTag,{value:"Module"})});
|
47
|
+
`),r=i[0]=="Error"?i[2]:i[1],r[0]==" "?e=r.trim().split(" ")[1].split(".")[1]:e=r.trim().split("@")[0]),console.warn("Table Not Initialized - Calling the "+e+" function before the table is initialized may result in inconsistent behavior, Please wait for the `tableBuilt` event before calling this function."+(t?" "+t:""))),this.initialized}blockRedraw(){this.initGuard(),this.eventBus.dispatch("redraw-blocking"),this.rowManager.blockRedraw(),this.columnManager.blockRedraw(),this.eventBus.dispatch("redraw-blocked")}restoreRedraw(){this.initGuard(),this.eventBus.dispatch("redraw-restoring"),this.rowManager.restoreRedraw(),this.columnManager.restoreRedraw(),this.eventBus.dispatch("redraw-restored")}setData(e,t,i){return this.initGuard(!1,"To set initial data please use the 'data' property in the table constructor."),this.dataLoader.load(e,t,i,!1)}clearData(){this.initGuard(),this.dataLoader.blockActiveLoad(),this.rowManager.clearData()}getData(e){return this.rowManager.getData(e)}getDataCount(e){return this.rowManager.getDataCount(e)}replaceData(e,t,i){return this.initGuard(),this.dataLoader.load(e,t,i,!0,!0)}updateData(e){var t=0;return this.initGuard(),new Promise((i,r)=>{this.dataLoader.blockActiveLoad(),typeof e=="string"&&(e=JSON.parse(e)),e&&e.length>0?e.forEach(o=>{var a=this.rowManager.findRow(o[this.options.index]);a?(t++,a.updateData(o).then(()=>{t--,t||i()}).catch(u=>{r("Update Error - Unable to update row",o,u)})):r("Update Error - Unable to find row",o)}):(console.warn("Update Error - No data provided"),r("Update Error - No data provided"))})}addData(e,t,i){return this.initGuard(),new Promise((r,o)=>{this.dataLoader.blockActiveLoad(),typeof e=="string"&&(e=JSON.parse(e)),e?this.rowManager.addRows(e,t,i).then(a=>{var u=[];a.forEach(function(d){u.push(d.getComponent())}),r(u)}):(console.warn("Update Error - No data provided"),o("Update Error - No data provided"))})}updateOrAddData(e){var t=[],i=0;return this.initGuard(),new Promise((r,o)=>{this.dataLoader.blockActiveLoad(),typeof e=="string"&&(e=JSON.parse(e)),e&&e.length>0?e.forEach(a=>{var u=this.rowManager.findRow(a[this.options.index]);i++,u?u.updateData(a).then(()=>{i--,t.push(u.getComponent()),i||r(t)}):this.rowManager.addRows(a).then(d=>{i--,t.push(d[0].getComponent()),i||r(t)})}):(console.warn("Update Error - No data provided"),o("Update Error - No data provided"))})}getRow(e){var t=this.rowManager.findRow(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)}getRowFromPosition(e){var t=this.rowManager.getRowFromPosition(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)}deleteRow(e){var t=[];this.initGuard(),Array.isArray(e)||(e=[e]);for(let i of e){let r=this.rowManager.findRow(i,!0);if(r)t.push(r);else return console.error("Delete Error - No matching row found:",i),Promise.reject("Delete Error - No matching row found")}return t.sort((i,r)=>this.rowManager.rows.indexOf(i)>this.rowManager.rows.indexOf(r)?1:-1),t.forEach(i=>{i.delete()}),this.rowManager.reRenderInPosition(),Promise.resolve()}addRow(e,t,i){return this.initGuard(),typeof e=="string"&&(e=JSON.parse(e)),this.rowManager.addRows(e,t,i,!0).then(r=>r[0].getComponent())}updateOrAddRow(e,t){var i=this.rowManager.findRow(e);return this.initGuard(),typeof t=="string"&&(t=JSON.parse(t)),i?i.updateData(t).then(()=>i.getComponent()):this.rowManager.addRows(t).then(r=>r[0].getComponent())}updateRow(e,t){var i=this.rowManager.findRow(e);return this.initGuard(),typeof t=="string"&&(t=JSON.parse(t)),i?i.updateData(t).then(()=>Promise.resolve(i.getComponent())):(console.warn("Update Error - No matching row found:",e),Promise.reject("Update Error - No matching row found"))}scrollToRow(e,t,i){var r=this.rowManager.findRow(e);return r?this.rowManager.scrollToRow(r,t,i):(console.warn("Scroll Error - No matching row found:",e),Promise.reject("Scroll Error - No matching row found"))}moveRow(e,t,i){var r=this.rowManager.findRow(e);this.initGuard(),r?r.moveToRow(t,i):console.warn("Move Error - No matching row found:",e)}getRows(e){return this.rowManager.getComponents(e)}getRowPosition(e){var t=this.rowManager.findRow(e);return t?t.getPosition():(console.warn("Position Error - No matching row found:",e),!1)}setColumns(e){this.initGuard(!1,"To set initial columns please use the 'columns' property in the table constructor"),this.columnManager.setColumns(e)}getColumns(e){return this.columnManager.getComponents(e)}getColumn(e){var t=this.columnManager.findColumn(e);return t?t.getComponent():(console.warn("Find Error - No matching column found:",e),!1)}getColumnDefinitions(){return this.columnManager.getDefinitionTree()}showColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),t)t.show();else return console.warn("Column Show Error - No matching column found:",e),!1}hideColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),t)t.hide();else return console.warn("Column Hide Error - No matching column found:",e),!1}toggleColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),t)t.visible?t.hide():t.show();else return console.warn("Column Visibility Toggle Error - No matching column found:",e),!1}addColumn(e,t,i){var r=this.columnManager.findColumn(i);return this.initGuard(),this.columnManager.addColumn(e,t,r).then(o=>o.getComponent())}deleteColumn(e){var t=this.columnManager.findColumn(e);return this.initGuard(),t?t.delete():(console.warn("Column Delete Error - No matching column found:",e),Promise.reject())}updateColumnDefinition(e,t){var i=this.columnManager.findColumn(e);return this.initGuard(),i?i.updateDefinition(t):(console.warn("Column Update Error - No matching column found:",e),Promise.reject())}moveColumn(e,t,i){var r=this.columnManager.findColumn(e),o=this.columnManager.findColumn(t);this.initGuard(),r?o?this.columnManager.moveColumn(r,o,i):console.warn("Move Error - No matching column found:",o):console.warn("Move Error - No matching column found:",e)}scrollToColumn(e,t,i){return new Promise((r,o)=>{var a=this.columnManager.findColumn(e);return a?this.columnManager.scrollToColumn(a,t,i):(console.warn("Scroll Error - No matching column found:",e),Promise.reject("Scroll Error - No matching column found"))})}redraw(e){this.initGuard(),this.columnManager.redraw(e),this.rowManager.redraw(e)}setHeight(e){this.options.height=isNaN(e)?e:e+"px",this.element.style.height=this.options.height,this.rowManager.initializeRenderer(),this.rowManager.redraw()}on(e,t){this.externalEvents.subscribe(e,t)}off(e,t){this.externalEvents.unsubscribe(e,t)}dispatchEvent(){var e=Array.from(arguments);e.shift(),this.externalEvents.dispatch(...arguments)}alert(e,t){this.initGuard(),this.alertManager.alert(e,t)}clearAlert(){this.initGuard(),this.alertManager.clear()}modExists(e,t){return this.modules[e]?!0:(t&&console.error("Tabulator Module Not Installed: "+e),!1)}module(e){var t=this.modules[e];return t||console.error("Tabulator module not installed: "+e),t}}si.defaultOptions=Mp,new el(si);class tl extends si{}new el(tl,kp);const Yp=[p.createElementVNode("svg",{class:"h-4 w-4 fill-muted-600 dark:fill-muted-200",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512"},[p.createElementVNode("path",{d:"M177.7 32h92.5c5.5 0 10.6 2.8 13.6 7.5L299.1 64H148.9l15.3-24.5c2.9-4.7 8.1-7.5 13.6-7.5zM336.9 64L311 22.6C302.2 8.5 286.8 0 270.3 0H177.7C161.2 0 145.8 8.5 137 22.6L111.1 64H64.1 32 16C7.2 64 0 71.2 0 80s7.2 16 16 16H34.3L59.8 452.6C62.1 486.1 90 512 123.6 512H324.4c33.6 0 61.4-25.9 63.8-59.4L413.7 96H432c8.8 0 16-7.2 16-16s-7.2-16-16-16H416 383.9 336.9zm44.8 32L356.3 450.3C355.1 467 341.2 480 324.4 480H123.6c-16.8 0-30.7-13-31.9-29.7L66.4 96H381.6z"})],-1)],Jp=[p.createElementVNode("svg",{class:"h-4 w-4 fill-muted-600 dark:fill-muted-200",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},[p.createElementVNode("path",{d:"M454.6 45.3l12.1 12.1c12.5 12.5 12.5 32.8 0 45.3L440 129.4 382.6 72l26.7-26.7c12.5-12.5 32.8-12.5 45.3 0zM189 265.6l171-171L417.4 152l-171 171c-4.2 4.2-9.6 7.2-15.4 8.6l-65.6 15.1L180.5 281c1.3-5.8 4.3-11.2 8.6-15.4zm197.7-243L166.4 243c-8.5 8.5-14.4 19.2-17.1 30.9l-20.9 90.6c-1.2 5.4 .4 11 4.3 14.9s9.5 5.5 14.9 4.3l90.6-20.9c11.7-2.7 22.4-8.6 30.9-17.1L489.4 125.3c25-25 25-65.5 0-90.5L477.3 22.6c-25-25-65.5-25-90.5 0zM80 64C35.8 64 0 99.8 0 144V432c0 44.2 35.8 80 80 80H368c44.2 0 80-35.8 80-80V304c0-8.8-7.2-16-16-16s-16 7.2-16 16V432c0 26.5-21.5 48-48 48H80c-26.5 0-48-21.5-48-48V144c0-26.5 21.5-48 48-48H208c8.8 0 16-7.2 16-16s-7.2-16-16-16H80z"})],-1)],Zp={__name:"ActionButton",props:{data:{},index:{}},setup(h){const e=h;return(t,i)=>(p.openBlock(),p.createElementBlock(p.Fragment,null,[p.createElementVNode("button",{onClick:i[0]||(i[0]=r=>p.unref(We.emitter).event("deleteBtn",e.data)),class:"mx-2 inline-flex items-center justify-center w-5 h-5 rounded-full text-gray-500 hover:text-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500"},Yp),p.createElementVNode("button",{onClick:i[1]||(i[1]=r=>p.unref(We.emitter).event("editBtn",e.data)),class:"mx-2 inline-flex items-center justify-center w-5 h-5 rounded-full text-gray-500 hover:text-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500"},Jp)],64))}},il={__name:"SelectColumn",props:{data:{default:()=>({})},index:{default:-1},all:{default:!1}},setup(h){const e=h,t=p.ref(!1);We.emitter.listen("toggle.select.all",r=>{e.all||(t.value=r,We.emitter.event("toggle.select",e.data.id))});function i(r){if(e.all)return We.emitter.event("toggle.select.all",t.value);We.emitter.event("toggle.select",e.data.id)}return(r,o)=>p.withDirectives((p.openBlock(),p.createElementBlock("input",{"onUpdate:modelValue":o[0]||(o[0]=a=>t.value=a),class:"rounded",type:"checkbox",onChange:i,style:{border:"1px dashed rgba(0, 0, 0, 0.2)"}},null,544)),[[p.vModelCheckbox,t.value]])}};let Un;const Qp=({element:h,headers:e,options:t}={element:null,headers:[],options:{}})=>(Un=new tl(h,{pagination:!1,paginationMode:"remote",layout:"fitDataStretch",resizableColumnFit:!0,paginationSize:5,paginationInitialPage:1,paginationSizeSelector:[3,6,8,10],paginationCounter:"rows",ajaxLoaderLoading:"<div style='display:inline-block; border:4px solid #333; border-radius:10px; background:#fff; font-weight:bold; font-size:16px; color:#000; padding:10px 20px;'>Loading Data</div>",columns:nl(e),...t}),Un);function nl(h){const e={_select_:{formatter:tm,formatterParams:{component:il},titleFormatter:im},_actions_:{formatter:em,formatterParams:{component:Zp}}};return h.map(t=>t.field in e?{...t,...e[t.field]}:t).map(t=>({...t,headerSort:!1}))}function em(h,e){const t=h.getRow().getData(),i=h.getRow().getPosition(),r=document.createElement("div"),o=e.component;return p.createApp(o,{data:t,index:i}).mount(r),r}function tm(h,e){const t=h.getRow().getData(),i=h.getRow().getPosition(),r=document.createElement("div"),o=e.component;return p.createApp(o,{data:t,index:i}).mount(r),r}function im(){const h=document.createElement("div");return p.createApp(il,{all:!0}).mount(h),h}function rl(h){Un.setData(h)}function nm(h){Un.setColumns(h)}const rm={up:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0NDggNTEyIj48IS0tISBGb250IEF3ZXNvbWUgUHJvIDYuNC4wIGJ5IEBmb250YXdlc29tZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tIExpY2Vuc2UgLSBodHRwczovL2ZvbnRhd2Vzb21lLmNvbS9saWNlbnNlIChDb21tZXJjaWFsIExpY2Vuc2UpIENvcHlyaWdodCAyMDIzIEZvbnRpY29ucywgSW5jLiAtLT48cGF0aCBkPSJNMjEyLjcgMTQ4LjdjNi4yLTYuMiAxNi40LTYuMiAyMi42IDBsMTYwIDE2MGM2LjIgNi4yIDYuMiAxNi40IDAgMjIuNnMtMTYuNCA2LjItMjIuNiAwTDIyNCAxODIuNiA3NS4zIDMzMS4zYy02LjIgNi4yLTE2LjQgNi4yLTIyLjYgMHMtNi4yLTE2LjQgMC0yMi42bDE2MC0xNjB6Ii8+PC9zdmc+",down:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0NDggNTEyIj48IS0tISBGb250IEF3ZXNvbWUgUHJvIDYuNC4wIGJ5IEBmb250YXdlc29tZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tIExpY2Vuc2UgLSBodHRwczovL2ZvbnRhd2Vzb21lLmNvbS9saWNlbnNlIChDb21tZXJjaWFsIExpY2Vuc2UpIENvcHlyaWdodCAyMDIzIEZvbnRpY29ucywgSW5jLiAtLT48cGF0aCBkPSJNMjEyLjcgMzMxLjNjNi4yIDYuMiAxNi40IDYuMiAyMi42IDBsMTYwLTE2MGM2LjItNi4yIDYuMi0xNi40IDAtMjIuNnMtMTYuNC02LjItMjIuNiAwTDIyNCAyOTcuNCA3NS4zIDE0OC43Yy02LjItNi4yLTE2LjQtNi4yLTIyLjYgMHMtNi4yIDE2LjQgMCAyMi42bDE2MCAxNjB6Ii8+PC9zdmc+"},sl=(h="up")=>{const e=document.createElement("img");return e.src=rm[h],e.style.width="10px",e.style.height="10px",e.style.marginLeft="5px",e},ol=(h,e)=>{h._column.titleHolderElement.style.display="flex",h._column.titleHolderElement.style.alignItems="center",h._column.titleHolderElement.appendChild(e)},al=h=>{h._column.titleHolderElement.lastChild.remove()};function sm(h,e){let t=[];e.on("headerClick",(i,r)=>{const o=r.getField();if(!["_index_","_select_","_actions_"].includes(o)){if(t.includes(o+":asc")){let a=t.indexOf(o+":asc");t[a]=o+":desc",al(r),ol(r,sl("down"))}else if(t.includes(o+":desc")){let a=t.indexOf(o+":desc");t.splice(a,1),al(r)}else ol(r,sl()),t.push(o+":asc");h.sorts=t,h.loadItems()}}),p.watch(()=>h.mainItems,i=>{rl(i)},{immediate:!0}),p.watch(()=>h.flatFields,()=>{nm(nl(h.headers))},{deep:!0}),p.watch(()=>h.loadings.mainLoading,i=>{i&&rl([])},{deep:!0})}const $x="",an=(h,e)=>{const t=h.__vccOpts||h;for(const[i,r]of e)t[i]=r;return t},ll=h=>(p.pushScopeId("data-v-86bb6d78"),h=h(),p.popScopeId(),h),om={key:0,id:"paginate"},am={class:"flex items-center justify-center py-2 lg:px-0 sm:px-6 px-4"},lm={class:"lg:w-5/5 w-full flex items-center justify-between border-t border-gray-200"},hm={class:"sm:flex hidden"},um=[ll(()=>p.createElementVNode("svg",{class:"rtl:rotate-180 w-[10px] fill-muted-600",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512"},[p.createElementVNode("path",{d:"M15 239c-9.4 9.4-9.4 24.6 0 33.9L207 465c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L65.9 256 241 81c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L15 239z"})],-1))],dm=["onClick"],cm={key:1,class:"text-sm font-medium leading-none text-gray-600 pt-3 mr-4 px-2"},fm=[ll(()=>p.createElementVNode("svg",{class:"ltr:rotate-180 w-[10px] fill-muted-600",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512"},[p.createElementVNode("path",{d:"M15 239c-9.4 9.4-9.4 24.6 0 33.9L207 465c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L65.9 256 241 81c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0L15 239z"})],-1))],pm=an({__name:"MTablePagination",setup(h){const e=p.inject("store");function t(u){e.paginate(u)}function i(){e.mainPagination.currentPage>1&&t(e.mainPagination.currentPage-1)}function r(u){t(u)}function o(){e.mainPagination.currentPage<e.mainPagination.lastPage&&t(e.mainPagination.currentPage+1)}function a(){let u=[];if(e.mainPagination.lastPage>10){let d=e.mainPagination.currentPage,f=d-1,g=d+1;d!=1&&u.push(1),d!=1&&d!=2&&f!=2&&u.push("..."),f>1&&u.push(f),u.push(d),g<e.mainPagination.lastPage&&u.push(g),d!=e.mainPagination.lastPage&&d!=e.mainPagination.lastPage-1&&g!=e.mainPagination.lastPage-1&&u.push("..."),e.mainPagination.lastPage!=d&&u.push(e.mainPagination.lastPage)}else u=e.mainPagination.lastPage;return u}return(u,d)=>p.unref(e).mainPagination.lastPage?(p.openBlock(),p.createElementBlock("div",om,[p.createElementVNode("div",am,[p.createElementVNode("div",lm,[p.createElementVNode("div",hm,[p.createElementVNode("div",{onClick:i,class:"flex items-center pt-3 text-gray-600 hover:text-indigo-700 cursor-pointer"},um),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(a(),f=>(p.openBlock(),p.createElementBlock(p.Fragment,{key:f},[typeof f=="number"?(p.openBlock(),p.createElementBlock("p",{key:0,class:p.normalizeClass(p.unref(e).mainPagination.currentPage===f?"text-sm font-medium leading-none cursor-pointer text-indigo-700 !border-indigo-400 border-t-[1px] pt-3 mr-4 px-2":"text-sm font-medium leading-none cursor-pointer text-gray-600 hover:text-indigo-700 border-t-[1px] border-transparent hover:border-indigo-400 pt-3 mr-4 px-2"),onClick:g=>r(f)},p.toDisplayString(f),11,dm)):(p.openBlock(),p.createElementBlock("p",cm,p.toDisplayString(f),1))],64))),128)),p.createElementVNode("div",{onClick:o,class:"flex items-center pt-3 text-gray-600 hover:text-indigo-700 cursor-pointer"},fm)])])])])):p.createCommentVNode("",!0)}},[["__scopeId","data-v-86bb6d78"]]),mm={key:0,class:"mt-[-20px]"},gm={class:"flex animate-pulse flex-row items-center h-full justify-center"},bm={class:"w-full flex flex-row items-start rtl:mr-8 ltr:ml-8"},vm={key:1,class:"padding: 100px; mt-[-20px] rounded-b-xl bg-white text-center p-[100px] dark:bg-muted-800"},wm={class:"dark:text-muted-200 text-muted-600"},ym={__name:"MTable",setup(h){const e=p.ref(null),t=p.inject("store"),i=p.inject("dir"),r=p.computed(()=>t.mainItems.length===0&&!t.loadings.mainLoading);return p.onMounted(()=>{const o=Qp({options:{textDirection:i},element:e.value,headers:t.headers});sm(t,o)}),(o,a)=>(p.openBlock(),p.createElementBlock(p.Fragment,null,[p.createElementVNode("div",{ref_key:"table",ref:e,class:"mt-2"},null,512),p.unref(t).loadings.mainLoading?(p.openBlock(),p.createElementBlock("div",mm,[(p.openBlock(),p.createElementBlock(p.Fragment,null,p.renderList(10,u=>p.createElementVNode("div",{key:u,class:p.normalizeClass([{"border-t-0":u===1,"border-b-0":u===10,"bg-muted-50 dark:bg-muted-700":u%2!==0,"bg-white dark:bg-muted-800":u%2===0},"w-full py-4 mx-auto border-b-1"])},[p.createElementVNode("div",gm,[p.createElementVNode("div",bm,[(p.openBlock(),p.createElementBlock(p.Fragment,null,p.renderList(9,d=>p.createElementVNode("div",{key:d,class:"mx-1 w-[10%] bg-muted-300 dark:bg-muted-900 h-2.5 rounded-md"})),64))])])],2)),64))])):p.createCommentVNode("",!0),r.value?(p.openBlock(),p.createElementBlock("div",vm,[p.createElementVNode("h2",wm,p.toDisplayString(o.$fcTr("not_load_or_existing_data")),1)])):p.createCommentVNode("",!0),p.createVNode(pm)],64))}},Cm={class:"w-full"},Em={__name:"MList",setup(h){const e=p.inject("store");We.emitter.listen("toggle.select",i=>{if(e.selected.has(i))return e.selected.delete(i);e.selected.add(i)});function t(){return{}}return(i,r)=>(p.openBlock(),p.createElementBlock("div",Cm,[(p.openBlock(),p.createBlock(p.resolveDynamicComponent(ym),p.normalizeProps(p.guardReactiveProps(t())),null,16))]))}},xm={TextFilter:()=>{const h=Qi();return{op:{placeholder:h.translate("operator"),columns:4,items:[{value:"$eq",text:h.translate("equal_to")},{value:"$ne",text:h.translate("not_equal_to")},{value:"$gt",text:h.translate("greater_than")},{value:"$lt",text:h.translate("less_than")},{value:"$contains",text:h.translate("look_like")}],"label-prop":"text","value-prop":"value",native:!1,type:"select"},value:{placeholder:h.translate("value"),type:"text",columns:4}}},SelectFilter:h=>{const e=Qi();return{op:{placeholder:e.translate("operator"),columns:4,items:[{value:"$in",text:e.translate("in")},{value:"$notIn",text:e.translate("not_in")}],labelProp:"text",valueProp:"value",native:!1,type:"select"},value:Ea({placeholder:e.translate("value"),items:"filterItems"in h?h.filterItems:h.items,search:!0,columns:4,labelProp:h.labelProp,valueProp:h.valueProp,object:!1})}},DateFilter:()=>{const h=Qi();return{op:{placeholder:h.translate("operator"),columns:4,items:[{value:"$eq",text:h.translate("equal_to")},{value:"$between",text:h.translate("between")},{value:"$gt",text:h.translate("greater_than")},{value:"$lt",text:h.translate("less_than")}],labelProp:"text",valueProp:"value",native:!1,type:"select"},value:xa({placeholder:h.translate("value"),columns:4})}}};function _m(h){return p.getCurrentScope()?(p.onScopeDispose(h),!0):!1}function vs(h){return typeof h=="function"?h():p.unref(h)}const hl=typeof window<"u"&&typeof document<"u",ws=()=>{},Rm=Tm();function Tm(){var h;return hl&&((h=window==null?void 0:window.navigator)==null?void 0:h.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent)}function Sm(h,e){function t(...i){return new Promise((r,o)=>{Promise.resolve(h(()=>e.apply(this,i),{fn:e,thisArg:this,args:i})).then(r).catch(o)})}return t}const ul=h=>h();function km(h=ul){const e=p.ref(!0);function t(){e.value=!1}function i(){e.value=!0}const r=(...o)=>{e.value&&h(...o)};return{isActive:p.readonly(e),pause:t,resume:i,eventFilter:r}}function Mm(h,e,t={}){const{eventFilter:i=ul,...r}=t;return p.watch(h,Sm(i,e),r)}function Lm(h,e,t={}){const{eventFilter:i,...r}=t,{eventFilter:o,pause:a,resume:u,isActive:d}=km(i);return{stop:Mm(h,e,{...r,eventFilter:o}),pause:a,resume:u,isActive:d}}function ln(h){const e=vs(h);return(e==null?void 0:e.$el)??e}const ki=hl?window:void 0;function hn(...h){let e,t,i,r;if(typeof h[0]=="string"||Array.isArray(h[0])?([t,i,r]=h,e=ki):[e,t,i,r]=h,!e)return ws;Array.isArray(t)||(t=[t]),Array.isArray(i)||(i=[i]);const o=[],a=()=>{o.forEach(g=>g()),o.length=0},u=(g,y,w,E)=>(g.addEventListener(y,w,E),()=>g.removeEventListener(y,w,E)),d=p.watch(()=>[ln(e),vs(r)],([g,y])=>{a(),g&&o.push(...t.flatMap(w=>i.map(E=>u(g,w,E,y))))},{immediate:!0,flush:"post"}),f=()=>{d(),a()};return _m(f),f}let dl=!1;function Am(h,e,t={}){const{window:i=ki,ignore:r=[],capture:o=!0,detectIframe:a=!1}=t;if(!i)return;Rm&&!dl&&(dl=!0,Array.from(i.document.body.children).forEach(w=>w.addEventListener("click",ws)),i.document.documentElement.addEventListener("click",ws));let u=!0;const d=w=>r.some(E=>{if(typeof E=="string")return Array.from(i.document.querySelectorAll(E)).some(S=>S===w.target||w.composedPath().includes(S));{const S=ln(E);return S&&(w.target===S||w.composedPath().includes(S))}}),g=[hn(i,"click",w=>{const E=ln(h);if(!(!E||E===w.target||w.composedPath().includes(E))){if(w.detail===0&&(u=!d(w)),!u){u=!0;return}e(w)}},{passive:!0,capture:o}),hn(i,"pointerdown",w=>{const E=ln(h);E&&(u=!w.composedPath().includes(E)&&!d(w))},{passive:!0}),a&&hn(i,"blur",w=>{setTimeout(()=>{var S;const E=ln(h);((S=i.document.activeElement)==null?void 0:S.tagName)==="IFRAME"&&!(E!=null&&E.contains(i.document.activeElement))&&e(w)},0)})].filter(Boolean);return()=>g.forEach(w=>w())}const jn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Kn="__vueuse_ssr_handlers__",Dm=Fm();function Fm(){return Kn in jn||(jn[Kn]=jn[Kn]||{}),jn[Kn]}function Pm(h,e){return Dm[h]||e}function Om(h){return h==null?"any":h instanceof Set?"set":h instanceof Map?"map":h instanceof Date?"date":typeof h=="boolean"?"boolean":typeof h=="string"?"string":typeof h=="object"?"object":Number.isNaN(h)?"any":"number"}const zm={boolean:{read:h=>h==="true",write:h=>String(h)},object:{read:h=>JSON.parse(h),write:h=>JSON.stringify(h)},number:{read:h=>Number.parseFloat(h),write:h=>String(h)},any:{read:h=>h,write:h=>String(h)},string:{read:h=>h,write:h=>String(h)},map:{read:h=>new Map(JSON.parse(h)),write:h=>JSON.stringify(Array.from(h.entries()))},set:{read:h=>new Set(JSON.parse(h)),write:h=>JSON.stringify(Array.from(h))},date:{read:h=>new Date(h),write:h=>h.toISOString()}},cl="vueuse-storage";function Hm(h,e,t,i={}){const{flush:r="pre",deep:o=!0,listenToStorageChanges:a=!0,writeDefaults:u=!0,mergeDefaults:d=!1,shallow:f,window:g=ki,eventFilter:y,onError:w=B=>{console.error(B)}}=i,E=(f?p.shallowRef:p.ref)(e);if(!t)try{t=Pm("getDefaultStorage",()=>ki==null?void 0:ki.localStorage)()}catch(B){w(B)}if(!t)return E;const S=vs(e),D=Om(S),P=i.serializer??zm[D],{pause:k,resume:G}=Lm(E,()=>K(E.value),{flush:r,deep:o,eventFilter:y});return g&&a&&(hn(g,"storage",se),hn(g,cl,V)),se(),E;function K(B){try{if(B==null)t.removeItem(h);else{const H=P.write(B),le=t.getItem(h);le!==H&&(t.setItem(h,H),g&&g.dispatchEvent(new CustomEvent(cl,{detail:{key:h,oldValue:le,newValue:H,storageArea:t}})))}}catch(H){w(H)}}function z(B){const H=B?B.newValue:t.getItem(h);if(H==null)return u&&S!==null&&t.setItem(h,P.write(S)),S;if(!B&&d){const le=P.read(H);return typeof d=="function"?d(le,S):D==="object"&&!Array.isArray(le)?{...S,...le}:le}else return typeof H!="string"?H:P.read(H)}function V(B){se(B.detail)}function se(B){if(!(B&&B.storageArea!==t)){if(B&&B.key==null){E.value=S;return}if(!(B&&B.key!==h)){k();try{(B==null?void 0:B.newValue)!==P.write(E.value)&&(E.value=z(B))}catch(H){w(H)}finally{B?p.nextTick(G):G()}}}}}const Jx="",Mi=h=>(p.pushScopeId("data-v-f90907f7"),h=h(),p.popScopeId(),h),Im={class:"border-muted-200 dark:border-muted-700 dark:bg-muted-800 relative mb-4 w-full rounded-lg border bg-white p-6 transition-all duration-300"},Nm={class:"flex flex-col ml-1 border-[rgba(0,0,0,.1)] pb-4"},Bm={class:"flex flex-row justify-between mb-4 items-center"},Vm={class:"font-heading text-base font-semibold leading-tight text-muted-800 dark:text-white"},Wm={class:"flex items-center"},Gm={class:"z-[1]"},$m={class:"fc-drop-down-content"},Um={key:0,class:"p-2 text-center"},jm=["onClick"],Km={class:"text-muted-400 font-sans text-sm"},qm=Mi(()=>p.createElementVNode("svg",{"data-v-74b3417a":"","aria-hidden":"true",viewBox:"0 0 24 24",class:"h-4 w-4 text-muted-500"},[p.createElementVNode("path",{"data-v-74b3417a":"",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6 6 18M6 6l12 12"})],-1)),Xm={class:"flex w-full justify-between align-start"},Ym={class:"w-[12%] flex justify-center items-center"},Jm=["disabled"],Zm=Mi(()=>p.createElementVNode("svg",{class:"icon h-4 ml-1 w-4",viewBox:"0 0 24 24"},[p.createElementVNode("path",{stroke:"currentColor","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)),Qm=Mi(()=>p.createElementVNode("svg",{class:"icon h-4 w-4",viewBox:"0 0 24 24"},[p.createElementVNode("path",{stroke:"currentColor","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)),eg={class:"flex border-t dark:border-muted-600 flex-col p-2 mt-2"},tg={class:"flex items-center"},ig={class:"font-heading text-base font-semibold leading-tight text-muted-800 dark:text-white"},ng={class:"group-hover:text-red-500"},rg=Mi(()=>p.createElementVNode("svg",{stroke:"currentColor",width:"1em",height:"1em",class:"ml-1 rtl:ml-1 rtl:mr-1 group-hover:fill-red-500 dark:fill-muted-400 fill-muted-600",viewBox:"0 0 512 512"},[p.createElementVNode("path",{d:"M340 148L488 0l24 24L364 172l52 52L257.2 483.9 240 512l-23.3-23.3L23.3 295.3 0 272l28.1-17.2L288 96l52 52zM51.4 278.1l47.9 47.9 33.4-33.4L144 281.4 166.6 304l-11.3 11.3-33.4 33.4L233.9 460.6l89.6-146.6L197.9 188.6 51.4 278.1zM340.6 286l34.9-57.2-92.4-92.4L226 171.4 340.6 286z"})],-1)),sg={class:"my-2 flex overflow-x-auto slimscroll"},og={class:"flex"},ag=["onClick"],lg={class:"mt-[0px]"},hg=["onClick"],ug=[Mi(()=>p.createElementVNode("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",class:"h-4 w-4 text-primary-500"},[p.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6 6 18M6 6l12 12"})],-1))],dg={key:0,class:"flex items-center mx-2 text-[0.75rem]"},cg={class:"flex w-full gap-x-2 justify-between !items-end"},fg={class:"pt-4 md:pt-6"},pg={class:"flex gap-x-2"},mg=["placeholder"],gg=[Mi(()=>p.createElementVNode("svg",{"data-v-74b3417a":"","aria-hidden":"true",viewBox:"0 0 24 24",class:"h-4 w-4 text-primary-500"},[p.createElementVNode("path",{"data-v-74b3417a":"",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6 6 18M6 6l12 12"})],-1))],bg=an({__name:"MFilter",setup(h){const e=p.inject("store");let t=-1;const i=p.ref(!1),r=p.ref({field:""}),o=p.ref(!1),a=p.ref(""),u=w(),d=p.ref(null);function f(z){if(!z)return!1;const V={text:"TextFilter",date:"DateFilter",select:"SelectFilter"},se=W.get(V,z.type),B=W.get(xm,se);return typeof B=="function"?B(z):!1}const g={field:{placeholder:"field",type:"select",native:!1,items:e.headersWithoutActions,"label-prop":"title","value-prop":"field",object:!0,search:!0,trackBy:["title"],columns:2,onChange(z,V,se){const B=f(z)||[];for(const H in r.value)H!=="field"&&delete r.value[H];y.value={...g,...B},p.nextTick(()=>{const H=se.form$.el$("value");"clear"in H&&H.clear(),"updateItems"in H&&H.updateItems()})}}},y=p.ref({...g});function w(){const z=window.location.pathname.replace(/^\/|\/$/g,"")+"-filters";return Hm(z,{},localStorage,{mergeDefaults:!0})}function E(){e.filters.push(W.cloneDeep(r.value)),r.value={}}function S(){t!==-1&&e.filters.splice(t,1,r.value),i.value=!1,r.value={}}function D(z,V){i.value=!0,t=V,r.value=z,p.nextTick(()=>{r.value.op=z.op,r.value.value=z.value})}function P(z){e.filters=e.filters.filter(V=>V!==z)}function k(){e.filters=[],e.loadItems()}function G(){if(!o.value)return o.value=!0,d.value.focus();a.value&&(u.value[a.value]={...e.filters},o.value=!1,a.value="",d.value.blur())}function K(){e.loadItems()}return(z,V)=>{const se=p.resolveComponent("v-menu"),B=p.resolveComponent("Vueform");return p.withDirectives((p.openBlock(),p.createElementBlock("div",{class:p.normalizeClass(["accordion-content",{hide:p.unref(e).panel!=="filters"}])},[p.createElementVNode("div",Im,[p.createElementVNode("div",Nm,[p.createElementVNode("div",Bm,[p.createElementVNode("h3",Vm,p.toDisplayString(z.$fcTr("filter_data")),1),p.createElementVNode("div",Wm,[p.createVNode(se,{transition:"scale-transition"},{activator:p.withCtx(({props:H})=>[p.createElementVNode("button",p.mergeProps({class:JSON.parse(H["aria-expanded"])?"before:block":"before:hidden"},H,{class:"fc-filter-choose is-button rounded is-button-default min-w-[130px]"}),[p.createElementVNode("span",Gm,p.toDisplayString(z.$fcTr("choose_filter")),1)],16)]),default:p.withCtx(()=>[p.createElementVNode("div",$m,[Object.keys(p.unref(u)).length===0?(p.openBlock(),p.createElementBlock("p",Um,p.toDisplayString(z.$fcTr("not_filter_create_yes")),1)):p.createCommentVNode("",!0),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(p.unref(u),(H,le)=>(p.openBlock(),p.createElementBlock("a",{class:"group rounded flex w-full items-center py-3 text-sm duration-300 text-muted-500 hover:bg-muted-100 dark:hover:bg-muted-700 justify-between rtl:pl-4 rtl:pr-5",key:le,onClick:p.withModifiers(ze=>p.unref(e).filters=Object.values(H),["stop"])},[p.createElementVNode("p",Km,p.toDisplayString(le),1),qm],8,jm))),128))])]),_:1})])]),p.createElementVNode("div",Xm,[p.createVNode(B,{modelValue:r.value,"onUpdate:modelValue":V[0]||(V[0]=H=>r.value=H),schema:y.value,sync:!0,class:"w-[100%] justify-between ml-4",columns:{label:12}},null,8,["modelValue","schema"]),p.createElementVNode("div",Ym,[i.value?(p.openBlock(),p.createElementBlock("button",{key:1,class:"!border-dashed is-button-default is-button w-full rounded-full font-bold py-1 px-2 !border-green-400 !text-green-400 hover:!bg-green-50",onClick:S},[p.createTextVNode(p.toDisplayString(z.$fcTr("edit_filter"))+" ",1),Qm])):(p.openBlock(),p.createElementBlock("button",{key:0,disabled:!r.value.field,class:"disabled:cursor-not-allowed disabled:hover:bg-transparent !border-dashed !h-[86%] is-button-default is-button w-full rounded font-bold py-1 px-2 !border-green-400 !text-green-400 dark:active:hover:bg-muted-600 active:hover:!bg-green-50",onClick:E},[Zm,p.createTextVNode(" "+p.toDisplayString(z.$fcTr("add_filter")),1)],8,Jm))])])]),p.withDirectives(p.createElementVNode("div",eg,[p.createElementVNode("div",tg,[p.createElementVNode("h3",ig,p.toDisplayString(z.$fcTr("active_filter")),1),p.createElementVNode("button",{onClick:k,class:"is-button group hover:text-red-500 hover:border-red-500 w-fit text-muted-600 dark:text-muted-400 !text-xs border !px-3 !py-0 !h-[1.5rem] mx-2 !rounded-full"},[p.createElementVNode("span",ng,p.toDisplayString(z.$fcTr("clear_all")),1),rg])]),p.createElementVNode("div",sg,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(p.unref(e).filters,(H,le)=>(p.openBlock(),p.createElementBlock(p.Fragment,{key:le},[p.createElementVNode("div",og,[p.createElementVNode("span",{class:"flex px-3 font-sans transition-shadow duration-300 py-1 text-[0.75rem] cursor-pointer rounded-full bg-primary-100 text-primary-500 border-primary-100 dark:border-primary-500 dark:text-primary-500 border dark:bg-transparent",onClick:ze=>D(H,le)},[p.createElementVNode("span",lg,p.toDisplayString(p.unref(W.get)(H,"field.title")),1),p.createElementVNode("button",{class:"text-white font-bold rounded px-1 hover:bg-primary-500 hover:text-black-500",onClick:p.withModifiers(ze=>P(H),["stop"])},ug,8,hg)],8,ag)]),p.unref(e).filters.length-1!==le?(p.openBlock(),p.createElementBlock("span",dg,p.toDisplayString(z.$fcTr("&")),1)):p.createCommentVNode("",!0)],64))),128))])],512),[[p.vShow,p.unref(e).filters.length>0]]),p.createElementVNode("div",cg,[p.createElementVNode("button",{onClick:V[1]||(V[1]=H=>p.unref(e).panel=""),class:"is-button text-muted-500 rounded hover:text-red-500 !underline focus-within:!outline-none"},p.toDisplayString(z.$fcTr("cancel")),1),p.createElementVNode("div",fg,[p.createElementVNode("div",pg,[p.createElementVNode("button",{onClick:V[5]||(V[5]=p.withModifiers(H=>Object.keys(p.unref(e).filters).length!==0?G():"",["self"])),class:p.normalizeClass([{"!bg-muted-100 dark:!bg-muted-700 ltr:pr-1":o.value," focus:outline-none !cursor-not-allowed":Object.keys(p.unref(e).filters).length===0},"transitionX-inp is-button rounded is-button-default"])},[p.createElementVNode("span",{onClick:V[2]||(V[2]=p.withModifiers(H=>Object.keys(p.unref(e).filters).length!==0?G():"",["self"])),class:p.normalizeClass({" bg-green-500 px-2 py-1 rounded text-muted-50":o.value," focus:outline-none !cursor-not-allowed":Object.keys(p.unref(e).filters).length===0})},p.toDisplayString(z.$fcTr("save")),3),p.createElementVNode("span",{class:p.normalizeClass(["transitionX-inp overflow-hidden flex items-center justify-between",o.value?"w-[221px] opacity-1 ltr:pl-3 rtl:mr-3":"opacity-0 w-[0px]"])},[p.withDirectives(p.createElementVNode("input",{"onUpdate:modelValue":V[3]||(V[3]=H=>a.value=H),class:p.normalizeClass(["fc-focus py-1 rounded px-2 dark:bg-muted-800",o.value?" border border-1":"flex "]),placeholder:z.$fcTr("filter_save_placeholder"),ref_key:"filterNameInp",ref:d},null,10,mg),[[p.vModelText,a.value]]),p.createElementVNode("span",{class:"px-2",onClick:V[4]||(V[4]=H=>o.value=!1)},gg)],2)],2),p.createElementVNode("button",{onClick:K,class:"is-button rounded bg-primary-500 dark:bg-primary-500 hover:enabled:bg-primary-400 dark:hover:enabled:bg-primary-400 text-white hover:enabled:shadow-lg hover:enabled:shadow-primary-500/50 dark:hover:enabled:shadow-primary-800/20 focus-visible:outline-primary-400/70 focus-within:outline-primary-400/70 focus-visible:bg-primary-500 active:enabled:bg-primary-500 dark:focus-visible:outline-primary-400 dark:focus-within:outline-primary-400 dark:focus-visible:bg-primary-500 dark:active:enabled:bg-primary-500"},p.toDisplayString(z.$fcTr("filter")),1)])])])])],2)),[[p.vShow,p.unref(e).panel==="filters"]])}}},[["__scopeId","data-v-f90907f7"]]),t_="",vg={key:0,class:"w-full border bg-white rounded p-2 flex align-center mt-2"},wg=["onClick"],yg={__name:"MHeaderBox",setup(h){const e=p.inject("store");let t=null;p.watch(()=>e.panel,r=>{e.panel==="headerBox"&&e.headersWithoutActions.forEach(o=>{t=document.querySelector(`[tabulator-field="${o.field}"]`),t.innerHTML=t.innerHTML+'<span class="fc-remove"><button class="text-white font-bold rounded px-1" onclick=""><svg aria-hidden="true" viewBox="0 0 24 24" class="h-4 w-4 text-primary-500"><path data-v-74b3417a="" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18 6 6 18M6 6l12 12"></path></svg></button></span>'})});function i(r){r.isHeader=!r.isHeader}return(r,o)=>p.unref(e).panel==="headerBox"?(p.openBlock(),p.createElementBlock("div",vg,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(p.unref(e).flatFields,a=>(p.openBlock(),p.createElementBlock("div",{key:a.field,class:p.normalizeClass(["px-1 mx-1 cursor-pointer divide-y rounded",{"bg-primary-600 text-white":a.isHeader}]),onClick:u=>i(a)},p.toDisplayString(a.title),11,wg))),128))])):p.createCommentVNode("",!0)}},Cg={class:"flex items-center gap-3 relative hover:bg-muted-200 dark:hover:bg-muted-700 rounded-lg px-5 pl-3 rtl:pl-8 rtl:pr-5 py-2 duration-300"},Eg=["modelValue"],xg={class:"text-success-500 peer-disabled:opacity-75"},_g=p.createElementVNode("svg",{"aria-hidden":"true",viewBox:"0 0 52 52","data-v-3e8a7b5f":""},[p.createElementVNode("circle",{cx:"26",cy:"26",r:"25",fill:"none",stroke:"currentColor"}),p.createElementVNode("path",{fill:"none",stroke:"currentColor",d:"m14.1 27.2 7.1 7.2 16.7-16.8"})],-1),Rg={class:"font-heading text-muted-800 text-xs font-semibold leading-tight dark:text-white"},Tg={__name:"SelectColumnItem",props:{checked:{default:!1},columnName:{default:""}},setup(h){return(e,t)=>(p.openBlock(),p.createElementBlock("div",Cg,[p.createElementVNode("div",{class:p.normalizeClass(["nui-focus block focus-within:outline-current rounded-full",JSON.parse(h.checked)?"is-checked":"is-unchecked"])},[p.createElementVNode("input",{modelValue:h.checked,type:"checkbox",class:"peer cursor-pointer disabled:cursor-not-allowed","true-value":"true","false-value":"false",onClick:t[0]||(t[0]=i=>e.$emit("toggle"))},null,8,Eg),p.createElementVNode("label",xg,[p.createElementVNode("div",{class:p.normalizeClass(["rtl:left-[auto] rtl:!right-0 ltr:right-[auto] ltr:left-0",JSON.parse(h.checked)?"is-opaque":""])},null,2),_g])],2),p.createElementVNode("div",null,[p.createElementVNode("h6",Rg,p.toDisplayString(h.columnName),1)])]))}},Sg={class:"relative"},kg=p.createElementVNode("ul",{class:"py-2"},[p.createElementVNode("li",{class:"px-4 py-2 hover:bg-gray-100 cursor-pointer"},"Item 1"),p.createElementVNode("li",{class:"px-4 py-2 hover:bg-gray-100 cursor-pointer"},"Item 2"),p.createElementVNode("li",{class:"px-4 py-2 hover:bg-gray-100 cursor-pointer"},"Item 3")],-1),fl={__name:"MMenu",setup(h){const e=p.ref(null);Am(e,o=>console.log(o));const t=p.ref(!1),i={isOpen:t.value},r={click:()=>t.value=!t.value};return(o,a)=>(p.openBlock(),p.createElementBlock("div",Sg,[p.renderSlot(o.$slots,"activator",p.normalizeProps(p.guardReactiveProps({on:r,props:i})),()=>[p.createElementVNode("button",p.mergeProps({class:"bg-blue-500 text-white px-4 py-2 rounded-md"},p.toHandlers(r,!0))," Open Menu "+p.toDisplayString(t.value),17)]),t.value?(p.openBlock(),p.createElementBlock("div",{key:0,class:"absolute top-[35px] left-0 mt-2 w-48 rounded-md shadow-lg z-[1]",ref_key:"target",ref:e},[p.renderSlot(o.$slots,"default",{},()=>[kg])],512)):p.createCommentVNode("",!0)]))}},i_="",lt=h=>(p.pushScopeId("data-v-9eed8c8f"),h=h(),p.popScopeId(),h),Mg={class:"fc-header"},Lg={class:"fc-header-left-sid"},Ag=[lt(()=>p.createElementVNode("svg",{viewBox:"0 0 24 24"},[p.createElementVNode("path",{stroke:"currentColor","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1))],Dg={class:"z-[1]"},Fg={class:"bg-muted-200 dark:bg-muted-800 cursor-pointer rounded-xl fm-light-shadow"},Pg={class:"group flex w-full items-center py-3 text-sm duration-300 text-muted-500 hover:bg-muted-300 dark:hover:bg-muted-700 rounded-xl justify-end flex-row-reverse"},Og={class:"text-muted-400 font-sans text-xs"},zg=lt(()=>p.createElementVNode("svg",{class:"fill-muted-400 w-3.5 mx-2",viewBox:"0 0 512 512"},[p.createElementVNode("path",{d:"M64 464H96v48H64c-35.3 0-64-28.7-64-64V64C0 28.7 28.7 0 64 0H229.5c17 0 33.3 6.7 45.3 18.7l90.5 90.5c12 12 18.7 28.3 18.7 45.3V288H336V160H256c-17.7 0-32-14.3-32-32V48H64c-8.8 0-16 7.2-16 16V448c0 8.8 7.2 16 16 16zM176 352h32c30.9 0 56 25.1 56 56s-25.1 56-56 56H192v32c0 8.8-7.2 16-16 16s-16-7.2-16-16V448 368c0-8.8 7.2-16 16-16zm32 80c13.3 0 24-10.7 24-24s-10.7-24-24-24H192v48h16zm96-80h32c26.5 0 48 21.5 48 48v64c0 26.5-21.5 48-48 48H304c-8.8 0-16-7.2-16-16V368c0-8.8 7.2-16 16-16zm32 128c8.8 0 16-7.2 16-16V400c0-8.8-7.2-16-16-16H320v96h16zm80-112c0-8.8 7.2-16 16-16h48c8.8 0 16 7.2 16 16s-7.2 16-16 16H448v32h32c8.8 0 16 7.2 16 16s-7.2 16-16 16H448v48c0 8.8-7.2 16-16 16s-16-7.2-16-16V432 368z"})],-1)),Hg={class:"group flex w-full items-center py-3 text-sm duration-300 text-muted-500 hover:bg-muted-300 dark:hover:bg-muted-700 rounded-xl justify-end flex-row-reverse"},Ig={class:"text-muted-400 font-sans text-xs"},Ng=lt(()=>p.createElementVNode("svg",{class:"fill-muted-400 w-3.5 mx-2",viewBox:"0 0 512 512"},[p.createElementVNode("path",{d:"M48 448V64c0-8.8 7.2-16 16-16H224v80c0 17.7 14.3 32 32 32h80V448c0 8.8-7.2 16-16 16H64c-8.8 0-16-7.2-16-16zM64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V154.5c0-17-6.7-33.3-18.7-45.3L274.7 18.7C262.7 6.7 246.5 0 229.5 0H64zm90.9 233.3c-8.1-10.5-23.2-12.3-33.7-4.2s-12.3 23.2-4.2 33.7L161.6 320l-44.5 57.3c-8.1 10.5-6.3 25.5 4.2 33.7s25.5 6.3 33.7-4.2L192 359.1l37.1 47.6c8.1 10.5 23.2 12.3 33.7 4.2s12.3-23.2 4.2-33.7L222.4 320l44.5-57.3c8.1-10.5 6.3-25.5-4.2-33.7s-25.5-6.3-33.7 4.2L192 280.9l-37.1-47.6z"})],-1)),Bg={class:"group flex w-full items-center py-3 text-sm duration-300 text-muted-500 hover:bg-muted-300 dark:hover:bg-muted-700 rounded-xl justify-end flex-row-reverse"},Vg={class:"text-muted-400 font-sans text-xs"},Wg=lt(()=>p.createElementVNode("svg",{class:"fill-muted-400 w-3.5 mx-2",viewBox:"0 0 512 512"},[p.createElementVNode("path",{d:"M112 160V64c0-8.8 7.2-16 16-16H357.5c4.2 0 8.3 1.7 11.3 4.7l26.5 26.5c3 3 4.7 7.1 4.7 11.3V160h48V90.5c0-17-6.7-33.3-18.7-45.3L402.7 18.7C390.7 6.7 374.5 0 357.5 0H128C92.7 0 64 28.7 64 64v96h48zm16 208H384v96H128V368zm-16-48c-17.7 0-32 14.3-32 32H48V256c0-8.8 7.2-16 16-16H448c8.8 0 16 7.2 16 16v96H432c0-17.7-14.3-32-32-32H112zm320 80h48c17.7 0 32-14.3 32-32V256c0-35.3-28.7-64-64-64H64c-35.3 0-64 28.7-64 64V368c0 17.7 14.3 32 32 32H80v80c0 17.7 14.3 32 32 32H400c17.7 0 32-14.3 32-32V400z"})],-1)),Gg=[lt(()=>p.createElementVNode("path",{d:"M371.2 122.9C340.3 96.2 300 80 256 80C158.8 80 80 158.8 80 256s78.8 176 176 176c39.7 0 76.2-13.1 105.6-35.2c10.6-8 25.6-5.8 33.6 4.8s5.8 25.6-4.8 33.6C353 463.3 306.4 480 256 480C132.3 480 32 379.7 32 256S132.3 32 256 32c57.3 0 109.6 21.5 149.2 56.9l30.5-30.5c6.6-6.6 15.6-10.3 25-10.3C480.2 48 496 63.8 496 83.3V200c0 13.3-10.7 24-24 24H355.3c-19.5 0-35.3-15.8-35.3-35.3c0-9.4 3.7-18.3 10.3-25l40.8-40.8zm76.8-9L385.9 176H448V113.9z"},null,-1))],$g=[lt(()=>p.createElementVNode("svg",{viewBox:"0 0 512 512"},[p.createElementVNode("path",{d:"M384 48c8.8 0 16 7.2 16 16V448c0 8.8-7.2 16-16 16H64c-8.8 0-16-7.2-16-16V64c0-8.8 7.2-16 16-16H384zM64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V64c0-35.3-28.7-64-64-64H64zM80 112v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V112c0-8.8-7.2-16-16-16H96c-8.8 0-16 7.2-16 16zM96 352c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V368c0-8.8-7.2-16-16-16H96zm80-224c0 13.3 10.7 24 24 24H344c13.3 0 24-10.7 24-24s-10.7-24-24-24H200c-13.3 0-24 10.7-24 24zm32 128c0 13.3 10.7 24 24 24H344c13.3 0 24-10.7 24-24s-10.7-24-24-24H232c-13.3 0-24 10.7-24 24zM176 384c0 13.3 10.7 24 24 24H344c13.3 0 24-10.7 24-24s-10.7-24-24-24H200c-13.3 0-24 10.7-24 24zm-4.7-140.7c6.2-6.2 6.2-16.4 0-22.6s-16.4-6.2-22.6 0L112 257.4 99.3 244.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l24 24c6.2 6.2 16.4 6.2 22.6 0l48-48z"})],-1))],Ug=[lt(()=>p.createElementVNode("svg",{viewBox:"0 0 448 512",class:"z-[1]"},[p.createElementVNode("path",{d:"M64 448c-17.7 0-32-14.3-32-32V96c0-17.7 14.3-32 32-32H384c17.7 0 32 14.3 32 32V416c0 17.7-14.3 32-32 32H64zM0 416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64C28.7 32 0 60.7 0 96V416zM128 288c8.8 0 16-7.2 16-16V144c0-8.8-7.2-16-16-16s-16 7.2-16 16V272c0 8.8 7.2 16 16 16zm176 48c0 8.8 7.2 16 16 16s16-7.2 16-16V144c0-8.8-7.2-16-16-16s-16 7.2-16 16V336zm-80-80c8.8 0 16-7.2 16-16V144c0-8.8-7.2-16-16-16s-16 7.2-16 16v96c0 8.8 7.2 16 16 16z"})],-1))],jg={class:"bg-white dark:bg-muted-800 rounded-xl pt-1 rtl:text-right ltr:text-left fm-light-shadow"},Kg={class:"m-3 mt-2 text-muted-600 dark:text-muted-200"},qg={class:"p-2"},Xg={class:"fm-header-rigth-sid flex w-full sm:w-auto rtl:flex-row-reverse rtl:justify-end z-10"},Yg={key:0},Jg=[lt(()=>p.createElementVNode("span",null,null,-1))],Zg=[lt(()=>p.createElementVNode("path",{d:"M0 73.7C0 50.7 18.7 32 41.7 32H470.3c23 0 41.7 18.7 41.7 41.7c0 9.6-3.3 18.9-9.4 26.3L336 304.5V447.7c0 17.8-14.5 32.3-32.3 32.3c-7.3 0-14.4-2.5-20.1-7l-92.5-73.4c-9.6-7.6-15.1-19.1-15.1-31.3V304.5L9.4 100C3.3 92.6 0 83.3 0 73.7zM55 80L218.6 280.8c3.5 4.3 5.4 9.6 5.4 15.2v68.4l64 50.8V296c0-5.5 1.9-10.9 5.4-15.2L457 80H55z"},null,-1))],Qg={class:"group/nui-input relative rtl:"},eb=["placeholder"],tb={class:"ltr:left-0 text-muted-400 group-focus-within/nui-input:text-primary-500 absolute end-0 rtl:start-0 top-0 flex items-center justify-center transition-colors duration-300 peer-disabled:cursor-not-allowed peer-disabled:opacity-75 h-10 w-10"},ib={key:0,class:"icon h-[1.15rem] w-[1.15rem]",width:"1em",height:"1em",viewBox:"0 0 24 24"},nb=[lt(()=>p.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[p.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),p.createElementVNode("path",{d:"m21 21l-4.35-4.35"})],-1))],rb={key:1,xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",class:"icon animate-spin"},sb=[lt(()=>p.createElementVNode("path",{d:"M457 372c11.5 6.6 26.3 2.7 31.8-9.3C503.7 330.2 512 294.1 512 256C512 122.7 410.1 13.2 280 1.1C266.8-.1 256 10.7 256 24v0c0 13.3 10.8 23.9 24 25.4C383.5 61.2 464 149.2 464 256c0 29.3-6.1 57.3-17 82.6c-5.3 12.2-1.5 26.8 10 33.5v0z"},null,-1))],ob=an({__name:"MButtonBox",setup(h){const{event:e}=We.emitter,t=p.inject("store");function i(y){y===t.panel?t.panel="":t.panel=y}const r=p.ref(null);p.onMounted(()=>{r.value=document.body.getAttribute("dir")});const o=p.computed(()=>t.flatFields.find(y=>y.field==="_select_")),a=p.computed(()=>!!o.value.isHeader);function u(){o.value.isHeader=!o.value.isHeader,o.value.isHeader||t.selected.clear()}const d=p.ref(!1);function f(){d.value=!0,t.loadItems().finally(()=>d.value=!1)}const g=W.debounce(f,600);return(y,w)=>(p.openBlock(),p.createElementBlock("div",Mg,[p.createElementVNode("div",Lg,[p.createElementVNode("button",p.mergeProps(y.props,{class:"fc-plus-btn",onClick:w[0]||(w[0]=E=>p.unref(e)("createBtn"))}),Ag,16),p.createVNode(fl,null,{activator:p.withCtx(({on:E,props:S})=>[p.createElementVNode("button",p.mergeProps({class:S.isOpen?"before:block":"before:hidden"},S,p.toHandlers(E,!0),{class:"fc-header-icon-btn fc-drop-down-btn min-w-[130px]"}),[p.createElementVNode("span",Dg,p.toDisplayString(y.$fcTr("export")),1)],16)]),default:p.withCtx(()=>[p.createElementVNode("div",Fg,[p.createElementVNode("a",Pg,[p.createElementVNode("p",Og,p.toDisplayString(y.$fcTr("export_as_pdf")),1),zg]),p.createElementVNode("a",Hg,[p.createElementVNode("p",Ig,p.toDisplayString(y.$fcTr("export_as_excel")),1),Ng]),p.createElementVNode("a",Bg,[p.createElementVNode("p",Vg,p.toDisplayString(y.$fcTr("print")),1),Wg])])]),_:1}),p.createElementVNode("button",p.mergeProps(y.props,{class:"fc-header-icon-btn",onClick:w[1]||(w[1]=(...E)=>p.unref(t).reloadData&&p.unref(t).reloadData(...E))}),[(p.openBlock(),p.createElementBlock("svg",{class:p.normalizeClass({spin:p.unref(t).loadings.mainLoading}),viewBox:"0 0 512 512"},Gg,2))],16),p.createElementVNode("button",p.mergeProps(y.props,{class:["fc-header-icon-btn",{"fm-active-btn":a.value}],onClick:u}),$g,16),p.createVNode(fl,{"close-on-content-click":!1,location:r.value==="rtl"?"end":"start"},{activator:p.withCtx(({props:E,on:S})=>[p.createElementVNode("button",p.mergeProps(p.toHandlers(S,!0),{class:["fc-header-icon-btn",[E.isOpen?"light:!bg-white dark:bg-muted-800":"",E.isOpen?r.value==="rtl"?"expanded-rtl":"expanded2":""]]}),Ug,16)]),default:p.withCtx(()=>[p.createElementVNode("div",jg,[p.createElementVNode("div",Kg,p.toDisplayString(y.$fcTr("custom_column")),1),p.createElementVNode("ul",qg,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(p.unref(t).flatFieldsWithoutActions,E=>(p.openBlock(),p.createBlock(Tg,{key:E.field,"column-name":E.title,checked:E.isHeader,onToggle:S=>E.isHeader=!E.isHeader},null,8,["column-name","checked","onToggle"]))),128))])])]),_:1},8,["location"])]),p.createElementVNode("div",Xg,[p.createElementVNode("button",p.mergeProps(y.props,{class:["test fc-header-icon-btn transform transition-all",p.unref(t).panel==="filters"?"!bg-white dark:!bg-muted-800 !rounded-b-none ":""],onClick:w[2]||(w[2]=E=>i("filters"))}),[p.createVNode(p.Transition,{name:"scale"},{default:p.withCtx(()=>[p.unref(t).panel==="filters"?(p.openBlock(),p.createElementBlock("div",Yg,Jg)):p.createCommentVNode("",!0)]),_:1}),(p.openBlock(),p.createElementBlock("svg",{class:p.normalizeClass(p.unref(t).panel==="filters"?"light:!fill-primary-700":""),stroke:"currentColor",viewBox:"0 0 512 512"},Zg,2))],16),p.createElementVNode("div",Qg,[p.withDirectives(p.createElementVNode("input",{"onUpdate:modelValue":w[3]||(w[3]=E=>p.unref(t).searchParam=E),type:"text",class:"nui-focus !pl-4 border-muted-300 text-muted-600 placeholder:text-muted-300 dark:border-muted-700 dark:bg-muted-900/75 dark:text-muted-200 dark:placeholder:text-muted-500 dark:focus:border-muted-700 peer w-full border bg-white font-sans transition-all duration-300 disabled:cursor-not-allowed disabled:opacity-75 px-2 h-10 py-2 text-sm leading-5 pe-4 ps-9 rounded-full",placeholder:y.$fcTr("search"),onKeyup:w[4]||(w[4]=(...E)=>p.unref(g)&&p.unref(g)(...E))},null,40,eb),[[p.vModelText,p.unref(t).searchParam]]),p.createElementVNode("div",tb,[d.value?(p.openBlock(),p.createElementBlock("svg",rb,sb)):(p.openBlock(),p.createElementBlock("svg",ib,nb))])])])]))}},[["__scopeId","data-v-9eed8c8f"]]);function ab(h,e){return Array.isArray(h)?W.every(h,t=>W.isType(t,e)):!1}const lb=(h,e)=>{const t=W.get(h,"field"),i=W.get(h,"valueProp");return ab(e,"object")?e.map(r=>W.get(r,i)):W.get(e,t)},pl=(h,e)=>W.get(e,h.field),hb={select:lb,text:pl},ub=(h,e)=>{if(h.normalizer)return h.normalizer(e);const t=hb[h.type];return t?t(h,e):pl(h,e)},c_="",db=h=>(p.pushScopeId("data-v-c3b8e659"),h=h(),p.popScopeId(),h),cb={key:0,class:"fixed z-10 inset-0 overflow-y-auto backdrop-blur-[4px]"},fb={class:"flex items-center overflow-y justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0"},pb=db(()=>p.createElementVNode("div",{class:"fixed inset-0 transition-opacity"},[p.createElementVNode("div",{class:"absolute inset-0 bg-gray-500 opacity-50"})],-1)),mb={class:"inline-block max-h-full align-bottom bg-white rounded-lg text-left shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full"},gb={class:"bg-card-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4 dark:bg-muted-700 dark:text-muted-200"},bb={class:"flex flex-col text-right"},vb={class:"mb-4 flex justify-between w-full"},wb={key:0,class:"text-primerr-700"},yb={key:1,class:"text-primerr-700"},Cb={class:"mb-5"},Eb={class:"flex justify-end"},xb=["disabled"],_b={key:0},Rb={key:1},Tb=an({__name:"MDialogForm",setup(h){const{event:e,listen:t}=We.emitter,i=p.inject("store"),r=p.ref(!1),o=p.ref(null);let a={};const u=f=>{let g={};for(const y of i.flatFieldsWithoutActions)g[y.field]=ub(y,f);return g};return(()=>{t("createBtn",()=>{a={},i.isEditing=!1,r.value=!0,i.form={}}),t("editBtn",f=>{a=f,i.isEditing=!0,r.value=!0,i.form=u(f)}),t("handleDialogForm",f=>{r.value=f}),t("saveForm",()=>{try{if(o.value.validate(),o.value.invalid)return}catch{}return(()=>{i.isEditing?i.editItem({...i.form,id:a==null?void 0:a.id}):i.addItem({...i.form})})()}),t(["createBtn"],()=>{i.form={}}),t("editTheItem",f=>{edit(f)}),t("addTheItem",f=>{add(f)})})(),(f,g)=>{const y=p.resolveComponent("Vueform");return p.openBlock(),p.createBlock(p.Transition,{name:"fade",appear:""},{default:p.withCtx(()=>[r.value?(p.openBlock(),p.createElementBlock("div",cb,[p.createElementVNode("div",fb,[pb,p.createElementVNode("div",mb,[p.createElementVNode("div",gb,[p.createElementVNode("div",bb,[p.createElementVNode("h1",vb,[p.unref(i).isEditing?(p.openBlock(),p.createElementBlock("span",wb,p.toDisplayString(f.$fcTr("edit")),1)):(p.openBlock(),p.createElementBlock("span",yb,p.toDisplayString(f.$fcTr("add")),1)),p.createElementVNode("i",{class:"text-primerr-700 fal fa-times cursor-pointer",onClick:g[0]||(g[0]=w=>r.value=!1)})]),p.createElementVNode("div",Cb,[p.createVNode(y,p.mergeProps({modelValue:p.unref(i).form,"onUpdate:modelValue":g[1]||(g[1]=w=>p.unref(i).form=w),schema:p.unref(i).formFields,columns:{label:12}},p.unref(i).structure,{ref_key:"form$",ref:o,sync:""}),null,16,["modelValue","schema"])]),p.createElementVNode("div",Eb,[p.createElementVNode("button",{onClick:g[2]||(g[2]=w=>r.value=!1),class:"border p-2 px-8 rounded-md text-red-400 border-red-400"},p.toDisplayString(f.$fcTr("cancel")),1),p.createElementVNode("button",{disabled:p.unref(i).loadings.mainLoading,onClick:g[3]||(g[3]=w=>p.unref(e)("saveForm")),class:"border p-2 mx-1 px-8 rounded-md text-green-400 border-green-400"},[p.unref(i).loadings.mainLoading?(p.openBlock(),p.createElementBlock("span",Rb,"loading")):(p.openBlock(),p.createElementBlock("span",_b,p.toDisplayString(f.$fcTr("save")),1))],8,xb)])])])])])])):p.createCommentVNode("",!0)]),_:1})}}},[["__scopeId","data-v-c3b8e659"]]),Sb={};function kb(h,e){return p.openBlock(),p.createElementBlock("div")}const Mb=an(Sb,[["render",kb]]),Lb={key:0,class:"fixed z-10 inset-0 overflow-y-auto"},Ab={class:"flex items-center overflow-y justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0"},Db=p.createElementVNode("div",{class:"fixed inset-0 transition-opacity"},[p.createElementVNode("div",{class:"absolute inset-0 bg-gray-500 opacity-75"})],-1),Fb={class:"inline-block max-h-full align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full"},Pb={class:"bg-card-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},Ob={class:"flex flex-col text-right"},zb={class:"mb-4 flex justify-between w-full"},Hb=p.createElementVNode("span",{class:"text-primerr-700"},"حذف",-1),Ib={class:"mb-5 flex flex-row flex-wrap"},Nb={class:"flex justify-end"},Bb=["disabled"],Vb={key:0},Wb={key:1},Gb={__name:"MDeleteDialog",setup(h){const e=p.inject("store"),t=p.ref(!1);let i="";return We.emitter.listen("deleteBtn",r=>{t.value=!0,i=r.id}),We.emitter.listen("handleDeleteDialog",r=>{t.value=r}),(r,o)=>(p.openBlock(),p.createBlock(p.Transition,{name:"fade",appear:""},{default:p.withCtx(()=>[t.value?(p.openBlock(),p.createElementBlock("div",Lb,[p.createElementVNode("div",Ab,[Db,p.createElementVNode("div",Fb,[p.createElementVNode("div",Pb,[p.createElementVNode("div",Ob,[p.createElementVNode("h1",zb,[Hb,p.createElementVNode("i",{class:"text-primerr-700 fal fa-times cursor-pointer",onClick:o[0]||(o[0]=a=>t.value=!1)})]),p.createElementVNode("div",Ib,p.toDisplayString(r.$fcTr("alert_to_delete")),1),p.createElementVNode("div",Nb,[p.createElementVNode("button",{onClick:o[1]||(o[1]=a=>t.value=!1),class:"border p-2 px-8 rounded-md text-red-400 border-red-400"},p.toDisplayString(r.$fcTr("no")),1),p.createElementVNode("button",{disabled:p.unref(e).loadings.mainLoading,class:"border p-2 mx-1 px-8 rounded-md text-green-400 border-green-400",onClick:o[2]||(o[2]=a=>p.unref(e).remove(p.unref(i)))},[p.unref(e).loadings.mainLoading?(p.openBlock(),p.createElementBlock("span",Wb,"loading")):(p.openBlock(),p.createElementBlock("span",Vb,p.toDisplayString(r.$fcTr("yes")),1))],8,Bb)])])])])])])):p.createCommentVNode("",!0)]),_:1}))}},$b={__name:"MCrud",props:{options:{default:()=>({})},structure:{default:()=>({})},hiddenActions:{default:()=>[]},fields:{default:()=>[]},dir:{default:()=>Qi().dir},route:{default:"route"}},emits:["mounted"],setup(h,{emit:e}){const t=h,i=nf({fields:t.fields,hiddenActions:t.hiddenActions,options:t.options,structure:t.structure,route:t.route});return p.provide("store",i),p.provide("dir",t.dir),document.body.setAttribute("dir",t.dir),p.onMounted(()=>{e("mounted")}),(r,o)=>(p.openBlock(),p.createElementBlock(p.Fragment,null,[p.createVNode(ob),p.createVNode(bg),p.createVNode(yg),p.createVNode(Em),p.createVNode(Tb),p.createVNode(Mb),p.createVNode(Gb),p.renderSlot(r.$slots,"extra")],64))}},p_="",m_="",Ub=({headers:h,baseURL:e}={headers:[],baseURL:""})=>{mt.defaults.baseURL=e;for(const t in h)W.set(mt.defaults.headers,t,h[t])},jb=(h,{fields:e,axiosConfig:t,dir:i}={fields:{},axiosConfig:{},dir:"rtl"})=>{Ub(t);const r=Qi();r.dir=i||"rtl",h.config.globalProperties.$fcTr=o=>r.translate(o),Sa(e)};Ve.MCrud=$b,Ve.fields=_a,Ve.install=jb,Ve.registerFields=Sa,Object.defineProperty(Ve,Symbol.toStringTag,{value:"Module"})});
|