ziko 0.0.29 → 0.0.31

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.
Files changed (55) hide show
  1. package/dist/ziko.cjs +47 -181
  2. package/dist/ziko.js +47 -181
  3. package/dist/ziko.min.js +2 -2
  4. package/dist/ziko.mjs +46 -180
  5. package/package.json +24 -3
  6. package/src/__helpers__/index.js +6 -6
  7. package/src/app/globals.js +13 -3
  8. package/src/app/index.js +10 -10
  9. package/src/app/json-style-sheet.js +1 -1
  10. package/src/app/routes.js +0 -1
  11. package/src/app/spa-file-based-routing.js +2 -2
  12. package/src/app/spa.js +3 -3
  13. package/src/app/ziko-app.js +1 -1
  14. package/src/{reactivity/events-exp → events}/__ZikoEvent__.js +11 -6
  15. package/src/{reactivity/events-exp → events}/click.js +2 -3
  16. package/src/events/clipboard.js +16 -0
  17. package/src/events/custom-event.js +29 -0
  18. package/src/events/drag.js +16 -0
  19. package/src/events/focus.js +16 -0
  20. package/src/events/hash.js +16 -0
  21. package/src/events/index.d.ts +3 -0
  22. package/src/events/index.js +15 -0
  23. package/src/{reactivity/events-exp → events}/key.js +2 -2
  24. package/src/events/mouse.js +16 -0
  25. package/src/{reactivity/events-exp → events}/pointer.js +3 -4
  26. package/src/events/touch.js +16 -0
  27. package/src/events/types/__Shared__.d.ts +155 -0
  28. package/src/events/types/clipboard.d.ts +20 -0
  29. package/src/events/types/focus.d.ts +19 -0
  30. package/src/events/types/pointer.d.ts +45 -0
  31. package/src/events/wheel.js +16 -0
  32. package/src/index.js +16 -15
  33. package/src/reactivity/events/__note__ +1 -0
  34. package/src/reactivity/index.js +0 -3
  35. package/src/ui/elements/ZikoUIElement.js +15 -5
  36. package/src/ui/elements/embaded/html.js +1 -1
  37. package/src/ui/elements/embaded/youtube.js +2 -2
  38. package/src/ui/elements/grid/index.js +1 -1
  39. package/src/ui/index.js +21 -19
  40. package/src/ui/tags/index.d.ts +144 -0
  41. package/src/ui/tags/index.js +21 -0
  42. package/src/_global (To Be Removed )/_themes/dark.js +0 -885
  43. package/src/_global (To Be Removed )/_themes/index.js +0 -11
  44. package/src/_global (To Be Removed )/_themes/light.js +0 -255
  45. package/src/_global (To Be Removed )/app/index.js +0 -46
  46. package/src/_global (To Be Removed )/component/index.js +0 -38
  47. package/src/_global (To Be Removed )/globals/index.js +0 -20
  48. package/src/_global (To Be Removed )/index.js +0 -4
  49. package/src/_global (To Be Removed )/params/index.js +0 -40
  50. package/src/_global (To Be Removed )/router/index.js +0 -67
  51. package/src/_global (To Be Removed )/seo/index.js +0 -43
  52. package/src/_global (To Be Removed )/style/index.js +0 -1
  53. package/src/reactivity/events-exp/index.js +0 -5
  54. /package/src/{reactivity/events-exp → events}/__Events__.js +0 -0
  55. /package/src/{reactivity/events-exp → events}/utils.js +0 -0
package/dist/ziko.min.js CHANGED
@@ -1,9 +1,9 @@
1
1
  /*
2
2
  Project: ziko.js
3
3
  Author: Zakaria Elalaoui
4
- Date : Fri Jul 25 2025 11:35:58 GMT+0100 (UTC+01:00)
4
+ Date : Wed Jul 30 2025 15:18:05 GMT+0100 (UTC+01:00)
5
5
  Git-Repo : https://github.com/zakarialaoui10/ziko.js
6
6
  Git-Wiki : https://github.com/zakarialaoui10/ziko.js/wiki
7
7
  Released under MIT License
8
8
  */
9
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Ziko={})}(this,(function(t){"use strict";const{PI:e,E:s}=Math,r=Number.EPSILON;var i=Object.freeze({__proto__:null,E:s,EPSILON:r,PI:e});const{PI:n,cos:o,sin:a,tan:h,acos:l,asin:u,atan:m,cosh:p,sinh:f,tanh:g,acosh:b,asinh:y,atanh:v,log:w}=Math;let x={cos:o,sin:a,tan:h,sinc:t=>a(n*t)/(n*t),sec:t=>1/o(t),csc:t=>1/a(t),cot:t=>1/h(t),acos:l,asin:u,atan:m,acot:t=>n/2-m(t),cosh:p,sinh:f,tanh:g,coth:t=>.5*w((1+t)/(1-t)),acosh:b,asinh:y,atanh:v};x=new Proxy(x,{get(t,e){if(e in t)return s=>+t[e](s).toFixed(15)}});class _{}const k=(t,...e)=>{const s=e.map((e=>{if(null===e)return t(null);if(["number","string","boolean","bigint","undefined"].includes(typeof e))return t(e);if(e instanceof Array)return e.map((e=>k(t,e)));if(ArrayBuffer.isView(e))return e.map((e=>t(e)));if(e instanceof Set)return new Set(k(t,...e));if(e instanceof Map)return new Map([...e].map((e=>[e[0],k(t,e[1])])));if(e instanceof uo)return new uo(e.rows,e.cols,k(e.arr.flat(1)));if(e instanceof vo){const[s,r,i,n]=[e.a,e.b,e.z,e.phi];switch(t){case Math.log:return wo(Uo(i),n);case Math.exp:return wo(Do(s)*Zo(r),Do(s)*Ro(r));case Math.abs:return i;case Math.sqrt:return wo(Mo(i)*Zo(n/2),Mo(i)*Ro(n/2));case x.cos:return wo(Zo(s)*qo(r),-Ro(s)*Wo(r));case x.sin:return wo(Ro(s)*qo(r),Zo(s)*Wo(r));case x.tan:{const t=Zo(2*s)+qo(2*r);return wo(Ro(2*s)/t,Wo(2*r)/t)}case x.cosh:return wo(qo(s)*Zo(r),Wo(s)*Ro(r));case x.sinh:return wo(Wo(s)*Zo(r),qo(s)*Ro(r));case x.tanh:{const t=qo(2*s)+Zo(2*r);return wo(Wo(2*s)/t,Ro(2*r)/t)}default:return t(e)}}else if(e instanceof Object)return t(Object)||Object.fromEntries(Object.entries(e).map((e=>[e[0],k(t,e[1])])))}));return 1==s.length?s[0]:s},E=(t,e)=>{if("number"==typeof t){if("number"==typeof e)return t+e;if(e instanceof vo)return wo(t+e.a,e.b);if(e instanceof uo)return uo.nums(e.rows,e.cols,t).add(e);if(e instanceof Array)return e.map((e=>S(e,t)))}else{if(t instanceof vo||t instanceof uo)return e instanceof Array?e.map((e=>t.clone.add(e))):t.clone.add(e);if(t instanceof Array){if(!(e instanceof Array))return t.map((t=>S(t,e)));if(t.length===e.length)return t.map(((t,s)=>S(t,e[s])))}}},I=(t,e)=>{if("number"==typeof t){if("number"==typeof e)return t-e;if(e instanceof vo)return wo(t-e.a,-e.b);if(e instanceof uo)return uo.nums(e.rows,e.cols,t).sub(e);if(e instanceof Array)return e.map((e=>M(e,t)))}else{if(t instanceof vo||t instanceof uo)return e instanceof Array?e.map((e=>t.clone.sub(e))):t.clone.sub(e);if(t instanceof Array){if(!(e instanceof Array))return t.map((t=>M(t,e)));if(e instanceof Array&&t.length===e.length)return t.map(((t,s)=>M(t,e[s])))}}},A=(t,e)=>{if("number"==typeof t){if("number"==typeof e)return t*e;if(e instanceof vo)return wo(t*e.a,t*e.b);if(e instanceof uo)return uo.nums(e.rows,e.cols,t).mul(e);if(e instanceof Array)return e.map((e=>O(t,e)))}else{if(t instanceof vo||t instanceof uo)return e instanceof Array?e.map((e=>t.clone.mul(e))):t.clone.mul(e);if(t instanceof Array){if(!(e instanceof Array))return t.map((t=>O(t,e)));if(e instanceof Array&&t.length===e.length)return t.map(((t,s)=>O(t,e[s])))}}},T=(t,e)=>{if("number"==typeof t){if("number"==typeof e)return t/e;if(e instanceof vo)return wo(t/e.a,t/e.b);if(e instanceof uo)return uo.nums(e.rows,e.cols,t).div(e);if(e instanceof Array)return e.map((e=>j(t,e)))}else{if(t instanceof vo||t instanceof uo)return e instanceof Array?e.map((e=>t.clone.div(e))):t.clone.div(e);if(t instanceof Array){if(!(e instanceof Array))return t.map((t=>j(t,e)));if(e instanceof Array&&t.length===e.length)return t.map(((t,s)=>j(t,e[s])))}}},C=(t,e)=>{if("number"==typeof t){if("number"==typeof e)return t%e;if(e instanceof vo)return wo(t%e.a,t%e.b);if(e instanceof uo)return uo.nums(e.rows,e.cols,t).modulo(e);if(e instanceof Array)return e.map((e=>j(t,e)))}else{if(t instanceof vo||t instanceof uo)return e instanceof Array?e.map((e=>t.clone.div(e))):t.clone.div(e);if(t instanceof Array&&!(e instanceof Array))return t.map((t=>S(t,e)))}},S=(t,...e)=>{var s=t;for(let t=0;t<e.length;t++)s=E(s,e[t]);return s},M=(t,...e)=>{var s=t;for(let t=0;t<e.length;t++)s=I(s,e[t]);return s},O=(t,...e)=>{var s=t;for(let t=0;t<e.length;t++)s=A(s,e[t]);return s},j=(t,...e)=>{var s=t;for(let t=0;t<e.length;t++)s=T(s,e[t]);return s},D=(t,...e)=>{var s=t;for(let t=0;t<e.length;t++)s=C(s,e[t]);return s},U=t=>new Array(t).fill(0),Z=t=>new Array(t).fill(1),R=(t,e)=>new Array(e).fill(t),L=(t,e,s)=>{if("number"==typeof t)return e!==s?(t-e)/(s-e):0;if(t instanceof uo)return new uo(t.rows,t.cols,L(t.arr.flat(1),e,s));if(t instanceof vo)return new vo(L(t.a,e,s),L(t.b,e,s));if(t instanceof Array){if(t.every((t=>typeof("number"===t))))return t.map((t=>L(t,e,s)));{let e=new Array(t.length);for(let s=0;s<t.length;s++)e[s]=L(t[s])}}},P=(t,e,s)=>{if("number"==typeof t)return(s-e)*t+e;if(t instanceof uo)return new uo(t.rows,t.cols,P(t.arr.flat(1),e,s));if(t instanceof vo)return new vo(P(t.a,e,s),P(t.b,e,s));if(t instanceof Array){if(t.every((t=>typeof("number"===t))))return t.map((t=>P(t,e,s)));{let e=new Array(t.length);for(let s=0;s<t.length;s++)e[s]=P(t[s])}}},F=(t,e,s,r,i)=>{if("number"==typeof t)return P(L(t,e,s),r,i);if(t instanceof uo)return new uo(t.rows,t.cols,F(t.arr.flat(1),e,s,r,i));if(t instanceof vo)return new vo(F(t.a,s,r,i),F(t.b,e,s,r,i));if(t instanceof Array){if(t.every((t=>typeof("number"===t))))return t.map((t=>F(t,e,s,r,i)));{let n=new Array(t.length);for(let o=0;o<t.length;o++)n[o]=F(t[o],e,s,r,i)}}},N=(t,e,s)=>{const[r,i]=[Q(e,s),K(e,s)];if("number"==typeof t)return Q(K(t,r),i);if(t instanceof uo)return new uo(t.rows,t.cols,N(t.arr.flat(1),r,i));if(t instanceof vo)return new vo(N(t.a,r,i),N(t.b,r,i));if(t instanceof Array){if(t.every((t=>typeof("number"===t))))return t.map((t=>N(t,r,i)));{let e=new Array(t.length);for(let s=0;s<t.length;s++)e[s]=N(t[s],r,i)}}},B=(t,e,s,r=!1)=>{let i=[];if(t<e)for(let n=t;r?n<=e:n<e;n+=s)i.push(10*n/10);else for(let n=t;r?n>=e:n>e;n-=s)i.push(10*n/10);return i},H=(t,e,s=So(e-t)+1,r=!0)=>{if(Math.floor(s)===s){if([t,e].every((t=>"number"==typeof t))){const[o,a]=[t,e].sort(((t,e)=>e-t));var i=[];let h;h=r?(o-a)/(s-1):(o-a)/s;for(var n=0;n<s;n++)t<e?i.push(a+h*n):i.push(o-h*n);return i}if([t,e].some((t=>t instanceof vo))){const i=wo(t),n=wo(e);s=s||Math.abs(i.a-n.a)+1;const o=H(i.a,n.a,s,r),a=H(i.b,n.b,s,r);let h=new Array(s).fill(null);return h=h.map(((t,e)=>wo(o[e],a[e]))),h}}},$=(t,e,r=e-t+1,i=s,n=!0)=>H(t,e,r,n).map((t=>Oo(i,t))),V=(t,e,s=So(e-t)+1,r=!0)=>{if(Math.floor(s)===s){if([t,e].every((t=>"number"==typeof t))){const[i,n]=[t,e].sort(((t,e)=>e-t));let o;o=jo(i/n,r?s-1:s);const a=[n];for(let t=1;t<s;t++)a.push(a[t-1]*o);return t<e?a:a.reverse()}if([t,e].some((t=>t instanceof vo))){const i=wo(t),n=wo(e);let o;s=s||Math.abs(i.a-n.a)+1,o=jo(n.div(i),r?s-1:s);const a=[i];for(let t=1;t<s;t++)a.push(O(a[t-1],o));return a}}},q=(...t)=>mapfun((t=>t*Math.PI/180),...t),W=(...t)=>mapfun((t=>t/Math.PI*180),...t),Y=(...t)=>{if(t.every((t=>"number"==typeof t))){let e=t[0];for(let s=1;s<t.length;s++)e+=t[s];return e}const e=[];for(let s=0;s<t.length;s++)t[s]instanceof Array?e.push(Y(...t[s])):t[s]instanceof Object&&e.push(Y(...Object.values(t[s])));return 1===e.length?e[0]:e},X=(...t)=>{if(t.every((t=>"number"==typeof t))){let e=t[0];for(let s=1;s<t.length;s++)e*=t[s];return e}const e=[];for(let s=0;s<t.length;s++)t[s]instanceof Array?e.push(X(...t[s])):t[s]instanceof Object&&e.push(X(...Object.values(t[s])));return 1===e.length?e[0]:e},Q=(...t)=>{if(t.every((t=>"number"==typeof t)))return Math.min(...t);const e=[];for(let s=0;s<t.length;s++)t[s]instanceof Array?e.push(Q(...t[s])):t[s]instanceof Object&&e.push(Object.fromEntries([Object.entries(t[s]).sort(((t,e)=>t[1]-e[1]))[0]]));return 1===e.length?e[0]:e},K=(...t)=>{if(t.every((t=>"number"==typeof t)))return Math.max(...t);const e=[];for(let s=0;s<t.length;s++)t[s]instanceof Array?e.push(Q(...t[s])):t[s]instanceof Object&&e.push(Object.fromEntries([Object.entries(t[s]).sort(((t,e)=>e[1]-t[1]))[0]]));return 1===e.length?e[0]:e},G=(...t)=>{if(t.every((t=>"number"==typeof t))){let e=t.reduce(((t,e)=>[...t,t[t.length-1]+e]),[0]);return e.shift(),e}const e=[];for(let s=0;s<t.length;s++)t[s]instanceof Array?e.push(G(...t[s])):t[s]instanceof Object&&e.push(null);return 1===e.length?e[0]:e},J=(t,e,s)=>{const[r,i]=[Math.min(e,s),Math.max(e,s)];return t>=r&&t<=i},tt=(t,e,s=1e-4)=>Math.abs(t-e)<=s,et=(t,e)=>t.reduce(((t,s)=>[...t,...e.map((t=>[s,t]))]),[]),st=(t,e)=>{let s,r=1;if(t==ta(t)&&e==ta(e)){for(s=2;s<=t&&s<=e;++s)t%s==0&&e%s==0&&(r=s);return r}console.log("error")},rt=(t,e)=>{let s;if(t==ta(t)&&e==ta(e)){for(s=t>e?t:e;s%t!=0||s%e!=0;)++s;return s}console.log("error")},it={add:S,sub:M,mul:O,div:j,modulo:D,zeros:U,ones:Z,nums:R,norm:L,lerp:P,map:F,clamp:N,arange:B,linspace:H,logspace:$,geomspace:V,sum:Y,prod:X,accum:G,cartesianProduct:et,ppcm:rt,pgcd:st,deg2rad:q,rad2deg:W,inRange:J,isApproximatlyEqual:tt};var nt=Object.freeze({__proto__:null,Utils:it,add:S,arange:B,cartesianProduct:et,clamp:N,deg2rad:q,div:j,geomspace:V,inRange:J,isApproximatlyEqual:tt,lerp:P,linspace:H,logspace:$,map:F,mapfun:k,modulo:D,mul:O,norm:L,nums:R,ones:Z,pgcd:st,ppcm:rt,prod:X,rad2deg:W,sub:M,sum:Y,zeros:U});const ot=t=>{const e=[],s=2**t.length;for(let r=0;r<s;r+=1){const s=[];for(let e=0;e<t.length;e+=1)r&1<<e&&s.push(t[e]);e.push(s)}return e},at={_mode:Number,_map:function(t,e,s){return e instanceof uo?new uo(e.rows,e.cols,e.arr.flat(1).map((e=>t(e,s)))):e instanceof vo?new vo(t(e.a,s),t(e.b,s)):e instanceof Array?e.map((e=>t(e,s))):void 0},dec2base(t,e){return this._mode=e<=10?Number:String,"number"==typeof t?this._mode((t>>>0).toString(e)):this._map(this.dec2base,t,e)},dec2bin(t){return this.dec2base(t,2)},dec2oct(t){return this.dec2base(t,8)},dec2hex(t){return this.dec2base(t,16)},bin2base(t,e){return this.dec2base(this.bin2dec(t),e)},bin2dec(t){return this._mode("0b"+t)},bin2oct(t){return this.bin2base(t,8)},bin2hex(t){return this.bin2base(t,16)},oct2dec(t){return this._mode("0o"+t)},oct2bin(t){return this.dec2bin(this.oct2dec(t))},oct2hex(t){return this.dec2hex(this.oct2dec(t))},oct2base(t,e){return this.dec2base(this.oct2dec(t),e)},hex2dec(t){return this._mode("0x"+t)},hex2bin(t){return this.dec2bin(this.hex2dec(t))},hex2oct(t){return this.dec2oct(this.hex2dec(t))},hex2base(t,e){return this.dec2base(this.hex2dec(t),e)},IEEE32toDec(t){let e=t.split(" ").join("").padEnd(32,"0"),s=e[0],r=2**(+("0b"+e.slice(1,9))-127);return(-1)**s*(1+e.slice(9,32).split("").map((t=>+t)).map(((t,e)=>t*2**(-e-1))).reduce(((t,e)=>t+e),0))*r},IEEE64toDec(t){let e=t.split(" ").join("").padEnd(64,"0"),s=e[0],r=2**(+("0b"+e.slice(1,12))-1023);return(-1)**s*(1+e.slice(13,64).split("").map((t=>+t)).map(((t,e)=>t*2**(-e-1))).reduce(((t,e)=>t+e),0))*r}},ht={_mode:Number,_map:function(t,e,s){return e instanceof uo?new uo(e.rows,e.cols,e.arr.flat(1).map((e=>t(e,s)))):e instanceof vo?new vo(t(e.a,s),t(e.b,s)):e instanceof Array?e.map((e=>t(e,s))):void 0},not:function(t){return["number","boolean"].includes(typeof t)?ht._mode(!t):this._map(this.not,t)},and:function(t,...e){return["number","boolean"].includes(typeof t)?ht._mode(e.reduce(((t,e)=>t&e),t)):this._map(this.and,t,e)},or:function(t,...e){return["number","boolean"].includes(typeof t)?ht._mode(e.reduce(((t,e)=>t|e),t)):this._map(this.or,t,e)},nand:function(t,...e){return this.not(this.and(t,e))},nor:function(t,...e){return this.not(this.or(t,e))},xor:function(t,...e){let s=[t,...e];return["number","boolean"].includes(typeof t)?this._mode(1===s.reduce(((t,e)=>(1==+e&&(t+=1),t)),0)):this._map(this.xor,t,e)},xnor:function(t,...e){return ht.not(ht.xor(t,e))}};class lt{static withDiscount(t,e=t.length){if(1===e)return t.map((t=>[t]));const s=[];let r;return r=this.withDiscount(t,e-1),t.forEach((t=>{r.forEach((e=>{s.push([t].concat(e))}))})),s}static withoutDiscount(t){if(1===t.length)return t.map((t=>[t]));const e=[],s=this.withoutDiscount(t.slice(1)),r=t[0];for(let t=0;t<s.length;t++){const i=s[t];for(let t=0;t<=i.length;t++){const s=i.slice(0,t),n=i.slice(t);e.push(s.concat([r],n))}}return e}}class ct{static withDiscount(t,e){if(1===e)return t.map((t=>[t]));const s=[];return t.forEach(((r,i)=>{this.withDiscount(t.slice(i),e-1).forEach((t=>{s.push([r].concat(t))}))})),s}static withoutDiscount(t,e){if(1===e)return t.map((t=>[t]));const s=[];return t.forEach(((r,i)=>{this.withoutDiscount(t.slice(i+1),e-1).forEach((t=>{s.push([r].concat(t))}))})),s}}const ut=(t,e,s=!1)=>ct[s?"withDiscount":"withoutDiscount"](t,e);var mt=Object.freeze({__proto__:null,Base:at,Combinaison:ct,Logic:ht,Permutation:lt,combinaison:ut,powerSet:ot,subSet:null});class pt{static float(t=1,e){return e?Math.random()*(e-t)+t:t*Math.random()}static int(t,e){return Math.floor(this.float(t,e))}static char(t){t=t??this.bool();const e=String.fromCharCode(this.int(97,120));return t?e.toUpperCase():e}static bool(){return[!1,!0][Math.floor(2*Math.random())]}static string(t,e){return t instanceof Array?new Array(this.int(...t)).fill(0).map((()=>this.char(e))).join(""):new Array(t).fill(0).map((()=>this.char(e))).join("")}static bin(){return this.int(2)}static oct(){return this.int(8)}static dec(){return this.int(8)}static hex(){return this.int(16)}static choice(t=[1,2,3],e=new Array(t.length).fill(1/t.length)){let s=new Array(100);e=it.accum(...e).map((t=>100*t)),s.fill(t[0],0,e[0]);for(let r=1;r<t.length;r++)s.fill(t[r],e[r-1],e[r]);return s[this.int(s.length-1)]}static shuffleArr(t){return t.sort((()=>.5-Math.random()))}static shuffleMatrix(t){const{rows:e,cols:s,arr:r}=t;return mo(e,s,r.flat().sort((()=>.5-Math.random())))}static floats(t,e,s){return new Array(t).fill(0).map((()=>this.float(e,s)))}static ints(t,e,s){return new Array(t).fill(0).map((()=>this.int(e,s)))}static bools(t){return new Array(t).fill(0).map((()=>this.bool()))}static bins(t){return new Array(t).fill(0).map((()=>this.int(2)))}static octs(t){return new Array(t).fill(0).map((()=>this.int(8)))}static decs(t){return new Array(t).fill(0).map((()=>this.int(10)))}static hexs(t){return new Array(t).fill(0).map((()=>this.int(16)))}static choices(t,e,s){return new Array(t).fill(0).map((()=>this.choice(e,s)))}static perm(...t){return t.permS[this.int(t.length)]}static color(){return"#"+at.dec2hex(this.float(16777216)).padStart(6,0)}static colors(t){return new Array(t).fill(null).map((()=>this.color()))}static complex(t=[0,1],e=[0,1]){return t instanceof Array?new vo(this.float(t[0],t[1]),this.float(e[0],e[1])):new vo(...this.floats(2,t,e))}static complexInt(t=[0,1],e=[0,1]){return new vo(this.int(t[0],t[1]),this.int(e[0],e[1]))}static complexBin(){return new vo(...this.bins(2))}static complexOct(){return new vo(...this.octs(2))}static complexDec(){return new vo(...this.decs(10))}static complexHex(){return new vo(...this.octs(2))}static complexes(t,e=0,s=1){return new Array(t).fill(0).map((()=>this.complex(e,s)))}static complexesInt(t,e=0,s=1){return new Array(t).fill(0).map((()=>this.complexInt(e,s)))}static complexesBin(t){return new Array(t).fill(0).map((()=>this.complexBin()))}static complexesOct(t){return new Array(t).fill(0).map((()=>this.complexOct()))}static complexesDec(t){return new Array(t).fill(0).map((()=>this.complexDec()))}static complexesHex(t){return new Array(t).fill(0).map((()=>this.complexHex()))}static matrix(t,e,s,r){return mo(t,e,this.floats(t*e,s,r))}static matrixInt(t,e,s,r){return mo(t,e,this.ints(t*e,s,r))}static matrixBin(t,e){return mo(t,e,this.bins(t*e))}static matrixOct(t,e){return mo(t,e,this.octs(t*e))}static matrixDec(t,e){return mo(t,e,this.decs(t*e))}static matrixHex(t,e){return mo(t,e,this.hex(t*e))}static matrixColor(t,e){return mo(t,e,this.colors(t*e))}static matrixComplex(t,e,s,r){return mo(t,e,this.complexes(t*e,s,r))}static matrixComplexInt(t,e,s,r){return mo(t,e,this.complexesInt(t*e,s,r))}static matrixComplexBin(t,e){return mo(t,e,this.complexesBin(t*e))}static matrixComplexOct(t,e){return mo(t,e,this.complexesBin(t*e))}static matrixComplexDec(t,e){return mo(t,e,this.complexesBin(t*e))}static matrixComplexHex(t,e){return mo(t,e,this.complexesBin(t*e))}}var dt=Object.freeze({__proto__:null,Random:pt});const ft=t=>{t instanceof uo&&(t=t.arr);const e=t.length,s=new Array(e).fill(0).map((()=>new Array(e).fill(0))),r=new Array(e).fill(0).map((()=>new Array(e).fill(0)));for(let i=0;i<e;i++){for(let n=i;n<e;n++){let e=0;for(let t=0;t<i;t++)e+=s[i][t]*r[t][n];r[i][n]=t[i][n]-e}for(let n=i;n<e;n++)if(i==n)s[i][i]=1;else{let e=0;for(let t=0;t<i;t++)e+=s[n][t]*r[t][i];s[n][i]=(t[n][i]-e)/r[i][i]}}return[s,r].map((t=>new uo(t)))},gt=(t,e)=>t.reduce(((t,s,r)=>t+s*e[r]),0),bt=t=>Math.sqrt(t.reduce(((t,e)=>t+e*e),0)),yt=t=>t.map((e=>e/bt(t))),vt=t=>{t instanceof uo&&(t=t.arr);const e=t.length,s=t[0].length,r=[],i=[];for(let t=0;t<e;t++)i.push(new Array(s).fill(0));for(let n=0;n<s;n++){let s=t.map((t=>t[n]));for(let o=0;o<n;o++){const a=r[o],h=gt(a,t.map((t=>t[n])));for(let t=0;t<e;t++)s[t]-=h*a[t];i[o][n]=h}const o=bt(s);r.push(yt(s)),i[n][n]=o}return[r,i].map((t=>new uo(t)))},wt=t=>{t instanceof uo&&(t=t.arr);const e=t.length,s=new Array(e).fill(0).map((()=>new Array(e).fill(0)));for(let r=0;r<e;r++)for(let e=0;e<=r;e++){let i=0;for(let t=0;t<e;t++)i+=s[r][t]*s[e][t];s[r][e]=r===e?Math.sqrt(t[r][r]-i):1/s[e][e]*(t[r][e]-i)}return new uo(s)},xt=t=>{const e=new XMLHttpRequest;if(e.open("GET",t,!1),e.send(),200===e.status)return e.responseText;throw new Error(`Failed to fetch data from ${t}. Status: ${e.status}`)};globalThis.fetchdom=async function(t="https://github.com/zakarialaoui10"){const e=await fetch(t),s=await e.text();return(new DOMParser).parseFromString(s,"text/xml").documentElement},globalThis.fetchdomSync=function(t="https://github.com/zakarialaoui10"){const e=xt(t);return(new DOMParser).parseFromString(e,"text/xml").documentElement};var _t=Object.freeze({__proto__:null,preload:xt});const kt=(t,e=",")=>t.trim().trimEnd().split("\n").map((t=>t.split(e))),Et=(t,e=",")=>new uo(kt(t,e)),It=(t,e=",")=>{const[s,...r]=kt(t,e);return r.map((t=>{const e={};return s.forEach(((s,r)=>{e[s]=t[r]})),e}))},At=(t,e=",")=>JSON.stringify(It(t,e)),Tt=(t,e)=>{const s=t.trim().trimEnd().split("\n").filter((t=>t));let r=`INSERT INTO ${e} (${s[0].split(",").join(", ")}) Values `,i=[];for(let t=1;t<s.length;t++){const e=s[t].split(",");i.push(`(${e})`)}return r+i.join(",\n")},Ct=t=>t instanceof Array?[Object.keys(t[0]),...t.map((t=>Object.values(t)))]:[Object.keys(t)],St=(t,e)=>Ct(t).map((t=>t.join(e))).join("\n"),Mt=t=>Ct(t instanceof Object?t:JSON.parse(t)),Ot=(t,e=",")=>St(t instanceof Object?t:JSON.parse(t),e),jt=(t,e)=>{const s=Ot(t,e),r=new Blob([s],{type:"text/csv;charset=utf-8;"});return{str:s,blob:r,url:URL.createObjectURL(r)}},Dt=(t,e)=>{const s=[];if(Array.isArray(t))t.forEach((t=>{if("object"==typeof t&&null!==t){s.push(`${e}-`);const r=Dt(t,`${e} `);s.push(...r)}else s.push(`${e}- ${t}`)}));else for(const r in t)if(t.hasOwnProperty(r)){const i=t[r];if("object"==typeof i&&null!==i){s.push(`${e}${r}:`);const t=Dt(i,`${e} `);s.push(...t)}else s.push(`${e}${r}: ${i}`)}return s},Ut=(t,e="")=>Dt(t,e).join("\n"),Zt=(t,e)=>Ut(t instanceof Object?t:JSON.parse(t),e),Rt=(t,e)=>{const s=Zt(t,e),r=new Blob([s],{type:"text/yml;charset=utf-8;"});return{str:s,blob:r,url:URL.createObjectURL(r)}},Lt=(t,e=1)=>{let s="";for(const r in t)if(t.hasOwnProperty(r)){const i=t[r];s+="\n"+" ".repeat(e)+`<${r}>`,s+="object"==typeof i?Lt(i,e+2):`${i}`,s+=`</${r}>`}return s.trim()},Pt=(t,e)=>{const s=Lt(t,e),r=new Blob([s],{type:"text/xml;charset=utf-8;"});return{str:s,blob:r,url:URL.createObjectURL(r)}};let zt=class{constructor(t={},e=(t.hasOwnProperty("default")?"default":Object.keys(t)[0]),s=0){this.id="Ziko-Style-"+s,this.keys=new Set,this.styles={default:{fontSize:"1em",color:"green"},other:{fontSize:"2em",color:"cyan"}},t&&this.add(t),e&&this.use(e)}get current(){return[...this.keys].reduce(((t,e)=>(t[e]=`var(--${e}-${this.id})`,t)),{})}add(t,e={}){return t&&"object"==typeof t&&!Array.isArray(t)?Object.assign(this.styles,t):"string"==typeof t&&Object.assign(this.styles,{[t]:e}),this}#t(t){const e=Object.keys(this.styles);for(let s in this.styles[e[t]])Object.prototype.hasOwnProperty.call(this.styles[e[t]],s)&&(document.documentElement.style.setProperty(`--${s}-${this.id}`,this.styles[e[t]][s]),this.keys.add(s));return this}#e(t){if(!this.styles[t])return this;for(let e in this.styles[t])Object.prototype.hasOwnProperty.call(this.styles[t],e)&&(document.documentElement.style.setProperty(`--${e}-${this.id}`,this.styles[t][e]),this.keys.add(e));return this}#s(t){for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(document.documentElement.style.setProperty(`--${e}-${this.id}`,t[e]),this.keys.add(e));return this}use(t){return"number"==typeof t?this.#t(t):"string"==typeof t?this.#e(t):t&&"object"==typeof t?this.#s(t):this}};const Ft=(t,e="px")=>("number"==typeof t&&(t+=e),t instanceof Array&&(t=t.map((t=>"number"==typeof t?t+=e:t)).join(" ")),t);class Nt{constructor(t={}){this.target=null,this.styles=new Map([["default",t]]),this.cache={isHidden:!1,isFaddedOut:!1,transformation:{Flip:[0,0,0],matrix:new uo([[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]])}}}style(t){for(const[e,s]of Object.entries(t))no.isCamelCase(e)&&(delete t[e],Object.assign(t,{[no.camel2hyphencase(e)]:s}));return this?.target?.element?.style&&Object.assign(this?.target?.element?.style,t),this}linkTo(t){return this.target=t,this}use(t="default"){return this.style(this.styles.get(t)),this}update(t,e){const s=this.styles.get(t);return s?this.styles.set(t,Object.assign(s,e)):this.styles.set(t,e),this}add(t,e){return this.styles.set(t,e),this}replace(t,e){return this.styles.set(t,e),this}delete(...t){return t.forEach((t=>this.styles.delete(t))),this}updateDefaultStyle(){const t=Object.fromEntries(Object.entries(this.target.element.style).filter((t=>isNaN(+t[0]))));return this.update("default",t),this}hover(t){return t&&this.add("hover",t),this.target?.element?.addEventListener("pointerenter",(()=>this.use("hover"))),this.target?.element?.addEventListener("pointerleave",(()=>this.use("default"))),this}isInline(){return getComputedStyle(this.target.element).display.includes("inline")}isBlock(){return!this.isInline()}size(t,e){return this.style({width:t,height:e}),this}width(t){if(t instanceof Object){if(t instanceof Array&&(t={min:t[0],max:t[1]}),"min"in t||"max"in t){let e=t.min??t.max,s=t.max??t.min;e=Ft(e,"px"),s=Ft(s,"px"),this.style({minWidth:e,maxWidth:s},{target:target,maskVector:maskVector})}}else t=Ft(t,"px"),this.style({width:t});return this}height(t){if(t instanceof Object){if(t instanceof Array&&(t={min:t[0],max:t[1]}),"min"in t||"max"in t){let e=t.min??t.max,s=t.max??t.min;e=Ft(e,"px"),s=Ft(s,"px"),this.style({minHeight:e,maxHeight:s},{target:target,maskVector:maskVector})}}else t=Ft(t,"px"),this.style({height:t});return this}enableResize(t=!1,e=!1){let s="none";return s=t?e?"both":"horizontal":e?"vertical":"none",this.style({resize:s,overflow:"hidden"}),this.isInline()&&(console.group("Ziko Issue : Temporarily Incompatible Method"),console.warn(".enableResize has no effect on inline elements!"),console.info("%cConsider using other display types such as block, inline-block, flex, or grid for proper resizing behavior.","color:gold;background-color:#3333cc;padding:5px"),console.groupEnd()),this}hide({after:t,target:e,maskVector:s}={}){if("number"==typeof t){const r=()=>this.hide({target:e,maskVector:s});setTimeout(r,t),clearTimeout(r)}else this.cache.isHidden=!0,this.style({display:"none"},{target:e,maskVector:s});return this}show({after:t,target:e,maskVector:s}={}){if("number"==typeof t){const r=()=>this.show({target:e,maskVector:s});setTimeout(r,t),clearTimeout(r)}else this.cache.isHidden=!1,this.style({display:""},{target:e,maskVector:s});return this}color(t){return this.style({color:t}),this}background(t){return this.style({background:t}),this}backgroundColor(t){return this.style({backgroundColor:t}),this}opacity(t,{target:e,maskVector:s}={}){return this.style({opacity:t},{target:e,maskVector:s}),this}position(t){return this.style({position:t}),this}display(t,{target:e,maskVector:s}={}){return this.style({display:t},{target:e,maskVector:s}),this}zIndex(t){return this.style({zIndex:t}),this}float(t,{target:e,maskVector:s}={}){return this.style({float:t},{target:e,maskVector:s}),this}border(t="1px solid red",{target:e,maskVector:s}={}){return this.style({border:t},{target:e,maskVector:s}),this}borderTop(t="1px solid red",{target:e,maskVector:s}={}){return this.style({borderTop:t},{target:e,maskVector:s}),this}borderRight(t="1px solid red",{target:e,maskVector:s}={}){return this.style({borderRight:t},{target:e,maskVector:s}),this}borderBottom(t="1px solid red",{target:e,maskVector:s}={}){return this.style({borderBottom:t},{target:e,maskVector:s}),this}borderLeft(t="1px solid red",{target:e,maskVector:s}={}){return this.style({borderLeft:t},{target:e,maskVector:s}),this}borderRadius(t){return t=Ft(t,"px"),this.style({borderRadius:t},{target:target,maskVector:maskVector}),this}margin(t){return t=Ft(t,"px"),this.style({margin:t},{target:target,maskVector:maskVector}),this}marginTop(t){return t=Ft(t,"px"),this.style({marginTop:t}),this}marginRight(t){return t=Ft(t,"px"),this.style({marginRight:t}),this}marginBootom(t){return t=Ft(t,"px"),this.style({marginBootom:t}),this}marginLeft(t){return t=Ft(t,"px"),this.style({marginLeft:t}),this}padding(t){return t=Ft(t,"px"),this.style({padding:t}),this}paddingTop(t){return t=Ft(t,"px"),this.style({paddingTop:t}),this}paddingRight(t){return t=Ft(t,"px"),this.style({paddingRight:t}),this}paddingBootom(t){return t=Ft(t,"px"),this.style({paddingBootom:t}),this}paddingLeft(t){return t=Ft(t,"px"),this.style({paddingLeft:t}),this}font(t){return this.style({font:t}),this}fontFamily(t=""){return this.style({fontFamily:t}),this}fontSize(t){return this.style({fontSize:t}),this}cursor(t="pointer"){return this.style({cursor:t}),this}overflow(t,e){const s=["hidden","auto"];return this.style({overflowX:"number"==typeof t?s[t]:t,overflowY:"number"==typeof e?s[e]:e},{target:target,maskVector:maskVector}),this}clip(t,{target:e,maskVector:s}={}){return"string"==typeof t&&(t="polygon("+t+")"),this.style({clipPath:t},{target:e,maskVector:s}),this}fadeOut(t=1){return this.style({transition:`opacity ${t/1e3}s`,opacity:0}),this.cache.isFaddedOut=!0,this}fadeIn(t=1){return this.style({transition:`opacity ${t/1e3}s`,opacity:1}),this.cache.isFaddedOut=!1,this}toggleFade(t=1e3,e=t){return this.cache.isFaddedOut?this.fadeIn(t):this.fadeOut(e),this}morphBorderRadius(t,e){return this.style({borderRadius:t,transition:`borderRadius ${e/1e3}s`}),this}#r(t){const e=this.cache.transformation.matrix.arr.join(",");this.style({transform:`matrix3d(${e})`,"-webkit-transform":`matrix3d(${e})`,"-moz-transform":`matrix3d(${e})`,"-ms-transform":`matrix3d(${e})`,"-o-transform":`matrix3d(${e})`}),0!=t&&this.style({transition:`transform ${t/1e3}s ease`})}translate(t,e=t,s=0,r=0){return this.cache.transformation.matrix.set(3,0,t),this.cache.transformation.matrix.set(3,1,e),this.cache.transformation.matrix.set(3,2,s),this.#r(r),this}translateX(t,e=0){return this.cache.transformation.matrix.set(3,0,t),this.#r(e),this}translateY(t,e=0){return this.cache.transformation.matrix.set(3,1,t),this.#r(e),this}translateZ(t,e=0){const s=-1/this.cache.transformation.matrix[2][2];return this.cache.transformation.matrix.set(3,2,z),this.cache.transformation.matrix.set(3,3,1-t/s),this.#r(e),this}perspective(t,e=0){const s=this.cache.transformation.matrix[3][2];return this.cache.transformation.matrix.set(2,2,-1/d),this.cache.transformation.matrix.set(3,3,1-s/t),this.#r(e),this}scale(t,e=t,s=0){return this.cache.transformation.matrix.set(0,0,t),this.cache.transformation.matrix.set(1,1,e),this.#r(s),this}scaleX(t=1,e=0){return this.cache.transformation.matrix.set(0,0,t),this.#r(e),this}scaleY(t=1,e=0){return this.cache.transformation.matrix.set(1,1,t),this.cache.transformation.matrix.arr.join(","),this.#r(e),this}skew(t,e=t,s=0){return this.cache.transformation.matrix.set(0,1,t),this.cache.transformation.matrix.set(1,0,e),this.cache.transformation.matrix.arr.join(","),this.#r(s),this}skewX(t=1,e=0){return this.cache.transformation.matrix.set(0,1,t),this.cache.transformation.matrix.arr.join(","),this.#r(e),this}skewY(t=1,e=0){return this.cache.transformation.matrix.set(1,0,t),this.cache.transformation.matrix.arr.join(","),this.#r(e),this}rotateX(t,e=0){return this.cache.transformation.matrix.set(1,1,Zo(t)),this.cache.transformation.matrix.set(1,2,-Ro(t)),this.cache.transformation.matrix.set(2,1,Ro(t)),this.cache.transformation.matrix.set(1,2,Zo(t)),this.#r(e),this}rotateY(t,e=0){return this.cache.transformation.matrix.set(0,0,Zo(t)),this.cache.transformation.matrix.set(0,2,Ro(t)),this.cache.transformation.matrix.set(2,0,-Ro(t)),this.cache.transformation.matrix.set(2,2,Zo(t)),this.#r(e),this}rotateZ(t,e=0){return this.cache.transformation.matrix.set(0,0,Zo(t)),this.cache.transformation.matrix.set(0,1,-Ro(t)),this.cache.transformation.matrix.set(1,0,Ro(t)),this.cache.transformation.matrix.set(1,1,Zo(t)),this.#r(e),this}flipeX(t=1){return this.cache.transformation.Flip[0]+=180,this.cache.transformation.Flip[0]%=360,this.rotateX(this.cache.transformation.Flip[0],t),this}flipeY(t=1){return this.cache.transformation.Flip[1]+=180,this.cache.transformation.Flip[1]%=360,this.rotateY(this.cache.transformation.Flip[1],t),this}flipeZ(t=1){return this.cache.transformation.Flip[2]+=180,this.cache.transformation.Flip[2]%=360,this.rotateZ(this.cache.transformation.Flip[2],t),this}slideHeightIn(t=1,e=this.h){return this.style({transition:t+"s",height:e}),this}slideHeightOut(t=1){return this.style({transition:t+"s",height:0}),this.target?.element?.n("transitionend",(()=>this.style({opacity:"none"}))),this}slideWidthIn(t=1,e=this.w){return this.style({transition:t+"s",width:e}),this}slideWidthOut(t=1){this.style({transition:t+"s",width:0});const e=()=>{this.style({opacity:"none"})};return this.target?.element?.addEventListener("transitionend",e),this.target?.element?.removeEventListener("transitionend",e),this}slideIn({transitionTimming:t=1,w:e="100%",h:s="auto"}={}){return this.style({transition:t+"s",width:e,height:s,visibility:"visible"}),this}slideOut({transitionTimming:t=1,width:e=0,heightransitionTimming:s=0}={}){this.style({visibility:"hidden",transition:t+"s",opacity:"none",width:e,height:height});const r=()=>{this.style({opacity:"none"})};return this.target?.element?.addEventListener("transitionend",r),this.target?.element?.removeEventListener("transitionend",r),this}}function Bt(t,e,s,r){return this.event=t,this.cache.preventDefault[e]&&t.preventDefault(),console.log({setter:s}),s&&s(),this.cache.stream.enabled[e]&&r&&this.cache.stream.history[e].push(r),this.cache.callbacks[e].map((t=>t(this))),this}class Ht{constructor(t){this.target=null,this.setTarget(t),this.__dispose=this.dispose.bind(this)}get targetElement(){return this.target.element}setTarget(t){return this.target=t,this}__handle(t,e,s){const r="drag"===t?t:`${this.cache.prefixe}${t}`;return this.dispose(s),this.targetElement?.addEventListener(r,e),this}__onEvent(t,e,...s){if(0===s.length){if(!(this.cache.callbacks.length>1))return this;this.cache.callbacks.map((t=>e=>t.call(this,e)))}else this.cache.callbacks[t]=s.map((t=>e=>t.call(this,e)));return this.__handle(t,this.__controller[t],e),this}preventDefault(t={}){return Object.assign(this.cache.preventDefault,t),this}pause(t={}){t={...Object.fromEntries(Object.keys(this.cache.stream.enabled).map((t=>[t,!0]))),...t};for(let e in t)t[e]&&(this.targetElement?.removeEventListener(`${this.cache.prefixe}${e}`,this.__controller[`${this.cache.prefixe}${e}`]),this.cache.paused[`${this.cache.prefixe}${e}`]=!0);return this}resume(t={}){t={...Object.fromEntries(Object.keys(this.cache.stream.enabled).map((t=>[t,!0]))),...t};for(let e in t)t[e]&&(this.targetElement?.addEventListener(`${this.cache.prefixe}${e}`,this.__controller[`${this.cache.prefixe}${e}`]),this.cache.paused[`${this.cache.prefixe}${e}`]=!1);return this}dispose(t={}){return this.pause(t),this}stream(t={}){this.cache.stream.t0=Date.now();return t={...Object.fromEntries(Object.keys(this.cache.stream.enabled).map((t=>[t,!0]))),...t},Object.assign(this.cache.stream.enabled,t),this}clear(t={}){t={...Object.fromEntries(Object.keys(this.cache.stream.clear).map((t=>[t,!0]))),...t};for(let e in t)t[e]&&(this.cache.stream.history[e]=[]);return this}}function $t(t){Bt.call(this,t,"click",null,null)}function Vt(t){Bt.call(this,t,"dbclick",null,null)}class qt extends Ht{constructor(t){super(t),this.event=null,this.cache={prefixe:"",preventDefault:{click:!1,dbclick:!1},paused:{click:!1,dbclick:!1},stream:{enabled:{click:!1,dbclick:!1},clear:{click:!1,dbclick:!1},history:{click:[],dbclick:[]}},callbacks:{click:[],dbclick:[]}},this.__controller={click:$t.bind(this),dbclick:Vt.bind(this)}}onClick(...t){return this.__onEvent("click",{},...t),this}onDbClick(...t){return this.__onEvent("dbclick",{},...t),this}}const Wt=t=>new qt(t);function Yt(t){Bt.call(this,t,"down",(()=>{this.dx=parseInt(t.offsetX),this.dy=parseInt(t.offsetY),this.isDown=!0}),{x:this.dx,y:this.dy,t:Date.now()-this.cache.stream.t0})}function Xt(t){Bt.call(this,t,"move",(()=>{this.mx=parseInt(t.offsetX),this.my=parseInt(t.offsetY),this.isMoving=!0}),{x:this.mx,y:this.my,t:Date.now()-this.cache.stream.t0})}function Qt(t){Bt.call(this,t,"up",(()=>{this.ux=parseInt(t.offsetX),this.uy=parseInt(t.offsetY),this.isDown=!1;const e=this.dx,s=this.dy,r=this.ux,i=this.uy,n=(r-e)/this.target.Width,o=(s-i)/this.target.Height,a=n<0?"left":n>0?"right":"none",h=o<0?"bottom":o>0?"top":"none";this.swippe={h:a,v:h,delta_x:n,delta_y:o}}),{x:this.ux,y:this.uy,t:Date.now()-this.cache.stream.t0})}function Kt(t){Bt.call(this,t,"enter",null,null)}function Gt(t){Bt.call(this,t,"leave",null,null)}function Jt(t){Bt.call(this,t,"out",null,null)}function te(t){Bt.call(this,t,"cancel",null,null)}class ee extends Ht{constructor(t){super(t),this.event=null,this.dx=0,this.dy=0,this.dt=0,this.mx=0,this.my=0,this.mt=0,this.ux=0,this.uy=0,this.ut=0,this.swippe={h:null,v:null,delta_x:0,delta_y:0},this.isMoving=!1,this.isDown=!1,this.cache={prefixe:"pointer",preventDefault:{down:!1,move:!1,up:!1,enter:!1,out:!1,leave:!1,cancel:!1},paused:{down:!1,move:!1,up:!1,enter:!1,out:!1,leave:!1,cancel:!1},stream:{enabled:{down:!1,move:!1,up:!1,enter:!1,out:!1,leave:!1,cancel:!1},clear:{down:!1,move:!1,up:!1,enter:!1,out:!1,leave:!1,cancel:!1},history:{down:[],move:[],up:[],enter:[],out:[],leave:[]}},callbacks:{down:[t=>console.log({dx:t.dx,dy:t.dy,down:t.down,move:t.move,t:t.dt})],move:[t=>console.log({mx:t.mx,my:t.my,down:t.down,move:t.move,t:t.dt})],up:[t=>console.log({ux:t.ux,uy:t.uy,down:t.down,move:t.move,t:t.dt})],enter:[t=>console.log({dx:t.dx,dy:t.dy,down:t.down,move:t.move,t:t.dt})],out:[t=>console.log({mx:t.mx,my:t.my,down:t.down,move:t.move,t:t.dt})],leave:[t=>console.log({ux:t.ux,uy:t.uy,down:t.down,move:t.move,t:t.dt})],cancel:[t=>console.log({ux:t.ux,uy:t.uy,down:t.down,move:t.move,t:t.dt})]}},this.__controller={down:Yt.bind(this),move:Xt.bind(this),up:Qt.bind(this),enter:Kt.bind(this),out:Jt.bind(this),leave:Gt.bind(this),cancel:te.bind(this)}}onDown(...t){return 0===t.length&&(t=[()=>{}]),this.__onEvent("down",{down:!0,move:!1,up:!1,enter:!1,out:!1,leave:!1,cancel:!1},...t),this}onMove(...t){return 0===t.length&&(t=[()=>{}]),this.__onEvent("move",{down:!1,move:!0,up:!1,enter:!1,out:!1,leave:!1,cancel:!1},...t),this}onUp(...t){return 0===t.length&&(t=[()=>{}]),this.__onEvent("up",{down:!1,move:!1,up:!0,enter:!1,out:!1,leave:!1,cancel:!1},...t),this}onEnter(...t){return 0===t.length&&(t=[()=>{}]),this.__onEvent("enter",{down:!1,move:!1,up:!1,enter:!0,out:!1,leave:!1,cancel:!1},...t),this}onOut(...t){return 0===t.length&&(t=[()=>{}]),this.__onEvent("out",{down:!1,move:!1,up:!1,enter:!1,out:!0,leave:!1,cancel:!1},...t),this}onLeave(...t){return 0===t.length&&(t=[()=>{}]),this.__onEvent("leave",{down:!1,move:!1,up:!1,enter:!1,out:!1,leave:!0,cancel:!1},...t),this}onCancel(...t){return 0===t.length&&(t=[()=>{}]),this.__onEvent("cancel",{down:!1,move:!1,up:!1,enter:!1,out:!1,leave:!1,cancel:!0},...t),this}}var se=t=>new ee(t);class re extends Ht{constructor(t){super(t),this.event=null,this.dx=0,this.dy=0,this.dt=0,this.mx=0,this.my=0,this.mt=0,this.ux=0,this.uy=0,this.ut=0,this.swippe={h:null,v:null,delta_x:0,delta_y:0},this.isMoving=!1,this.isDown=!1,this.cache={prefixe:"mouse",preventDefault:{down:!1,move:!1,up:!1,enter:!1,out:!1,leave:!1,over:!1},paused:{down:!1,move:!1,up:!1,enter:!1,out:!1,leave:!1,over:!1},stream:{enabled:{down:!1,move:!1,up:!1,enter:!1,out:!1,leave:!1,over:!1},clear:{down:!1,move:!1,up:!1,enter:!1,out:!1,leave:!1,over:!1},history:{down:[],move:[],up:[],enter:[],out:[],leave:[],over:[]}},callbacks:{down:[t=>console.log({dx:t.dx,dy:t.dy,down:t.down,move:t.move,t:t.dt})],move:[t=>console.log({mx:t.mx,my:t.my,down:t.down,move:t.move,t:t.dt})],up:[t=>console.log({ux:t.ux,uy:t.uy,down:t.down,move:t.move,t:t.dt})],enter:[t=>console.log({dx:t.dx,dy:t.dy,down:t.down,move:t.move,t:t.dt})],out:[t=>console.log({mx:t.mx,my:t.my,down:t.down,move:t.move,t:t.dt})],leave:[t=>console.log({ux:t.ux,uy:t.uy,down:t.down,move:t.move,t:t.dt})],over:[t=>console.log({ux:t.ux,uy:t.uy,down:t.down,move:t.move,t:t.dt})]}},this.__controller={down:ie.bind(this),move:ne.bind(this),up:oe.bind(this),enter:ae.bind(this),out:le.bind(this),leave:he.bind(this),over:ce.bind(this)}}onDown(...t){return 0===t.length&&(t=[()=>{}]),this.__onEvent("down",{down:!0,move:!1,up:!1,enter:!1,out:!1,leave:!1,over:!1},...t),this}onMove(...t){return 0===t.length&&(t=[()=>{}]),this.__onEvent("move",{down:!1,move:!0,up:!1,enter:!1,out:!1,leave:!1,over:!1},...t),this}onUp(...t){return 0===t.length&&(t=[()=>{}]),this.__onEvent("up",{down:!1,move:!1,up:!0,enter:!1,out:!1,leave:!1,over:!1},...t),this}onEnter(...t){return 0===t.length&&(t=[()=>{}]),this.__onEvent("enter",{down:!1,move:!1,up:!1,enter:!0,out:!1,leave:!1,over:!1},...t),this}onOut(...t){return 0===t.length&&(t=[()=>{}]),this.__onEvent("out",{down:!1,move:!1,up:!1,enter:!1,out:!0,leave:!1,over:!1},...t),this}onLeave(...t){return 0===t.length&&(t=[()=>{}]),this.__onEvent("leave",{down:!1,move:!1,up:!1,enter:!1,out:!1,leave:!0,over:!1},...t),this}onOver(...t){return 0===t.length&&(t=[()=>{}]),this.__onEvent("over",{down:!1,move:!1,up:!1,enter:!1,out:!1,leave:!1,over:!0},...t),this}}function ie(t){Bt.call(this,t,"down",(()=>{this.dx=parseInt(t.offsetX),this.dy=parseInt(t.offsetY),this.isDown=!0}),{x:this.dx,y:this.dy,t:Date.now()-this.cache.stream.t0})}function ne(t){Bt.call(this,t,"move",(()=>{this.mx=parseInt(t.offsetX),this.my=parseInt(t.offsetY),this.isMoving=!0}),{x:this.mx,y:this.my,t:Date.now()-this.cache.stream.t0})}function oe(t){Bt.call(this,t,"up",(()=>{this.ux=parseInt(t.offsetX),this.uy=parseInt(t.offsetY),this.isDown=!1;const e=this.dx,s=this.dy,r=this.ux,i=this.uy,n=(r-e)/this.target.Width,o=(s-i)/this.target.Height,a=n<0?"left":n>0?"right":"none",h=o<0?"bottom":o>0?"top":"none";this.swippe={h:a,v:h,delta_x:n,delta_y:o}}),{x:this.ux,y:this.uy,t:Date.now()-this.cache.stream.t0})}function ae(t){Bt.call(this,t,"enter",null,null)}function he(t){Bt.call(this,t,"leave",null,null)}function le(t){Bt.call(this,t,"out",null,null)}function ce(t){Bt.call(this,t,"out",null,null)}const ue=t=>new re(t);function me(t){Bt.call(this,t,"wheel",null,null)}class pe extends Ht{constructor(t){super(t),this.event=null,this.cache={prefixe:"",preventDefault:{wheel:!1},paused:{wheel:!1},stream:{enabled:{wheel:!1},clear:{wheel:!1},history:{wheel:[]}},callbacks:{click:[]}},this.__controller={wheel:me.bind(this)}}onWheel(...t){return this.__onEvent("wheel",{},...t),this}}const de=t=>new pe(t);function fe(t){Bt.call(this,t,"down",(()=>this.kd=t.key),{key:t.key,t:10})}function ge(t){Bt.call(this,t,"press",(()=>this.kp=t.key),{key:t.key,t:10})}function be(t){Bt.call(this,t,"up",(()=>this.ku=t.key),{key:t.key,t:10})}class ye extends Ht{constructor(t){super(t),this.kp=null,this.kd=null,this.ku=null,this.t=0,this.cache={prefixe:"key",preventDefault:{down:!1,press:!1,up:!1},paused:{down:!1,press:!1,up:!1},stream:{enabled:{down:!1,press:!1,up:!1},clear:{down:!0,press:!1,up:!1},history:{down:[],press:[],up:[]}},callbacks:{down:[t=>console.log({kd:t.kd})],press:[t=>console.log({kp:t.kp})],up:[t=>console.log({ku:t.ku})]},successifKeysCallback:{down:[t=>console.log(1111)],press:[t=>console.log(1112)],kyup:[t=>console.log(1113)]}},this.__controller={down:fe.bind(this),press:ge.bind(this),up:be.bind(this)}}onDown(...t){return this.__onEvent("down",{down:!0},...t),this}onPress(...t){return this.__onEvent("press",{press:!0},...t),this}onUp(...t){return this.__onEvent("up",{up:!0},...t),this}}var ve=t=>new ye(t);function we(t){Bt(this,t,"start",null)}function xe(t){Bt.call(this,t,"drag",null,null)}function _e(t){Bt.call(this,t,"end",null,null)}function ke(t){Bt.call(this,t,"drop",null,null)}class Ee extends Ht{constructor(t){super(t),this.target.setAttribute("draggable",!0),this.cache={prefixe:"drag",preventDefault:{drag:!1,start:!1,end:!1,enter:!1,leave:!1,over:!1},paused:{drag:!1,start:!1,end:!1,enter:!1,leave:!1,over:!1},enabled:{drag:!1,start:!1,end:!1,enter:!1,leave:!1,over:!1},callbacks:{drag:[],start:[],end:[],enter:[],leave:[],over:[]},stream:{enabled:{drag:!1,start:!1,end:!1,enter:!1,leave:!1,over:!1},clear:{drag:!1,start:!1,end:!1,enter:!1,leave:!1,over:!1},history:{drag:[],start:[],end:[],enter:[],leave:[],over:[]}}},this.__controller={start:we.bind(this),drag:xe.bind(this),end:_e.bind(this)}}onStart(...t){return this.__onEvent("start",{},...t),this}onDrag(...t){return this.__onEvent("drag",{},...t),this}onEnd(...t){return this.__onEvent("end",{},...t),this}}class Ie extends Ht{constructor(t){super(t),this.event=null,this.cache={prefixe:"",preventDefault:{drop:!1},paused:{drop:!1},stream:{enabled:{drop:!1},clear:{drop:!1},history:{drop:[]}},callbacks:{drop:[t=>console.log({dx:t.dx,dy:t.dy,drop:t.drop,move:t.move,t:t.dt})]}},this.__controller={drop:ke.bind(this)}}onDrop(...t){return this.__onEvent("drop",{},...t),this}}const Ae=t=>new Ee(t),Te=t=>new Ie(t);function Ce(t){Bt.call(this,t,"copy",null,null)}function Se(t){Bt.call(this,t,"cut",null,null)}function Me(t){Bt.call(this,t,"paste",null,null)}function Oe(t){Bt.call(this,t,"select",null,null)}class je extends Ht{constructor(t){super(t),this.event=null,this.cache={prefixe:"",preventDefault:{copy:!1,cut:!1,paste:!1,select:!1},paused:{copy:!1,cut:!1,paste:!1,select:!1},stream:{enabled:{copy:!1,cut:!1,paste:!1,select:!1},clear:{copy:!1,cut:!1,paste:!1,select:!1},history:{copy:[],cut:[],paste:[],select:[]}},callbacks:{copy:[],cut:[],paste:[],select:[]}},this.__controller={copy:Ce.bind(this),cut:Se.bind(this),paste:Me.bind(this),select:Oe.bind(this)}}onCopy(...t){return this.__onEvent("copy",{},...t),this}onCut(...t){return this.__onEvent("cut",{},...t),this}onPaste(...t){return this.__onEvent("paste",{},...t),this}onSelect(...t){return this.__onEvent("select",{},...t),this}}const De=t=>new je(t);function Ue(t){Bt.call(this,t,"focus",null,null)}function Ze(t){Bt.call(this,t,"blur",null,null)}class Re extends Ht{constructor(t){super(t),this.event=null,this.cache={prefixe:"",preventDefault:{focus:!1,blur:!1},paused:{focus:!1,blur:!1},stream:{enabled:{focus:!1,blur:!1},clear:{focus:!1,blur:!1},history:{focus:[],blur:[]}},callbacks:{focus:[],blur:[]}},this.__controller={focus:Ue.bind(this),blur:Ze.bind(this)}}onFocus(...t){return this.__onEvent("focus",{},...t),this}onBlur(...t){return this.__onEvent("blur",{},...t),this}}const Le=t=>new Re(t);function Pe(t){Bt.call(this,t,"input",null,null)}function ze(t){Bt.call(this,t,"change",null,null)}class Fe extends Ht{constructor(t){super(t),this.event=null,this.cache={prefixe:"",preventDefault:{input:!1,change:!1},paused:{input:!1,change:!1},stream:{enabled:{input:!1,change:!1},clear:{input:!1,change:!1},history:{input:[],change:[]}},callbacks:{input:[],change:[]}},this.__controller={input:Pe.bind(this),change:ze.bind(this)}}get value(){return this.target.value}onInput(...t){return this.__onEvent("input",{},...t),this}onChange(...t){return this.__onEvent("change",{},...t),this}}const Ne=t=>new Fe(t);function Be(t){Bt.call(this,t,"hashchange",null,null)}class He extends Ht{constructor(t){super(t),this.event=null,this.cache={prefixe:"",preventDefault:{hashchange:!1},paused:{hashchange:!1},stream:{enabled:{hashchange:!1},clear:{hashchange:!1},history:{hashchange:[]}},callbacks:{hashchange:[]}},this.__controller={hashchange:Be.bind(this)}}onChange(...t){return this.__onEvent("hashchange",{},...t),this}}const $e=t=>new He(t),Ve=t=>function(e){Bt.call(this,e,t,null,null)};class qe extends Ht{constructor(t){super(t),this.event=null,this.cache={prefixe:"",preventDefault:{},paused:{},stream:{enabled:{},clear:{},history:{}},callbacks:{}},this.__controller={}}#i(t){return this.cache.preventDefault[t]=!1,this.cache.paused[t]=!1,this.cache.stream.enabled=!1,this.cache.stream.clear=!1,this.cache.stream.history=[],this.cache.callbacks[t]=[],this.__controller[t]=Ve(t).bind(this),this}on(t,...e){return this.__controller[t]||this.#i(t),this.__onEvent(t,{},...e),this}emit(t,e={}){this.__controller[t]||this.#i(t),this.detail=e;const s=new Event(t);return this.targetElement.dispatchEvent(s),this}}const We=t=>new qe(t);class Ye extends Ht{constructor(t,e=.3,s=.3){super(t);const{removeListener:r,setWidthThreshold:i,setHeightThreshold:n}=function(t,e=.5,s=.5,r,i){let n=P(e,0,r),o=P(s,0,i),a=0,h=0,l=0,c=0;const u=t=>{a=t.clientX,h=t.clientY},m=t=>{l=t.clientX,c=t.clientY,p()};function p(){const t=l-a,e=c-h;(Math.abs(t)>n||Math.abs(e)>o)&&d(t,e)}function d(e,s){const a=globalThis?.CustomEvent?new CustomEvent("swipe",{detail:{deltaX:So(e)<n?0:ia(e)*L(So(e),0,r),deltaY:So(s)<o?0:ia(s)*L(So(s),0,i),direction:{x:So(e)<n?"none":e>0?"right":"left",y:So(s)<o?"none":s>0?"down":"up"}}}):null;t?.dispatchEvent(a)}function f(t){n=P(t,0,r)}function g(t){o=P(t,0,i)}return t?.addEventListener("pointerdown",u),t?.addEventListener("pointerup",m),{removeListener(){t?.removeEventListener("pointerdown",u),t?.removeEventListener("pointerup",m),console.log("Swipe event listeners removed")},setWidthThreshold:f,setHeightThreshold:g}}(this.target?.element,e,s,this.target.width,this.target.height);this.cache={width_threshold:e,height_threshold:s,removeListener:r,setWidthThreshold:i,setHeightThreshold:n,legacyTouchAction:globalThis?.document?.body?.style?.touchAction,prefixe:"",preventDefault:{swipe:!1},paused:{swipe:!1},stream:{enabled:{swipe:!1},clear:{swipe:!1},history:{swipe:[]}},callbacks:{swipe:[]}},this.__controller={swipe:Xe.bind(this)}}onSwipe(...t){return Object.assign(globalThis?.document?.body?.style,{touchAction:"none"}),this.__onEvent("swipe",{},...t),this}updateThresholds(t=this.cache.width_threshold,e=this.cache.height_threshold){return void 0!==t&&this.cache.setWidthThreshold(t),void 0!==e&&this.cache.setHeightThreshold(e),this}destroy(){return this.cache.removeListener(),Object.assign(globalThis?.document?.body?.style,{touchAction:this.cache.legacyTouchAction}),this}}function Xe(t){Bt.call(this,t,"swipe",null,null)}const Qe=(t,e,s)=>new Ye(t,e,s);var Ke=Object.freeze({__proto__:null,ZikoCustomEvent:qe,ZikoEvent:Ht,ZikoEventClick:qt,ZikoEventClipboard:je,ZikoEventHash:He,ZikoEventInput:Fe,ZikoEventKey:ye,ZikoEventMouse:re,ZikoEventPointer:ee,ZikoEventSwipe:Ye,ZikoEventWheel:pe,useClickEvent:Wt,useClipboardEvent:De,useCustomEvent:We,useDragEvent:Ae,useDropEvent:Te,useFocusEvent:Le,useHashEvent:$e,useInputEvent:Ne,useKeyEvent:ve,useMouseEvent:ue,usePointerEvent:se,useSwipeEvent:Qe,useWheelEvent:de});class Ge{constructor(t,e){this.target=t,this.observer=null,this.cache={options:e||{attributes:!0,childList:!0,subtree:!0},streamingEnabled:!0,lastMutation:null,mutationHistory:{}},this.observeCallback=(t,e)=>{if(this.cache.streamingEnabled)for(const e of t)switch(e.type){case"attributes":this.cache.mutationHistory.attributes.push(e.target.getAttribute(e.attributeName));break;case"childList":this.cache.mutationHistory.childList.push(e);break;case"subtree":this.cache.mutationHistory.subtree.push(e)}this.callback&&this.callback(t,e)}}observe(t){if(!this.observer){if(!globalThis.MutationObserver)return void console.log("MutationObserver Nor Supported");this.observer=new MutationObserver(this.cache.observeCallback),this.observer.observe(this.target.element,this.cache.options),this.callback=([e])=>t.call(e,this),this.cache.streamingEnabled=!0}}pause(t){this.observer&&(this.observer.disconnect(),t&&this.observer.observe(this.target,t))}reset(t){this.observer&&(this.observer.disconnect(),this.observer.observe(this.target,t||this.cache.options))}clear(){return this.observer&&(this.observer.disconnect(),this.observer=null,this.cache.mutationHistory={attributes:[],childList:[],subtree:[]}),this.cache.streamingEnabled=!1,this}getMutationHistory(){return this.cache.mutationHistory}enableStreaming(){return this.cache.streamingEnabled=!0,this}disableStreaming(){return this.cache.streamingEnabled=!1,this}}const Je=(t,e={},s=null)=>{const r=new Ge(t,e);return s&&r.observe(s),r};class ts extends Ge{constructor(t,e){super(t,{attributes:!0,childList:!1,subtree:!1}),Object.assign(this.cache,{observeCallback:(t,e)=>{for(const e of t)this.cache.lastMutation={name:e.attributeName,value:e.target.getAttribute(e.attributeName)},this.cache.streamingEnabled&&this.cache.mutationHistory.attributes.push(this.cache.lastMutation);this.callback&&this.callback(t,e)}}),this.cache.mutationHistory.attributes=[],e&&this.observe(e)}get history(){return this.cache.mutationHistory.attributes}}const es=(t,e)=>new ts(t,e);class ss extends Ge{constructor(t,e){super(t,{attributes:!1,childList:!0,subtree:!1}),Object.assign(this.cache,{observeCallback:(t,e)=>{for(const e of t)e.addedNodes?this.cache.lastMutation={type:"add",item:this.target.find((t=>t.element===e.addedNodes[0]))[0],previous:this.target.find((t=>t.element===e.previousSibling))[0]}:e.addedNodes&&(this.cache.lastMutation={type:"remove",item:this.target.find((t=>t.element===e.removedNodes[0]))[0],previous:this.target.find((t=>t.element===e.previousSibling))[0]}),this.cache.streamingEnabled&&this.cache.mutationHistory.children.push(this.cache.lastMutation);this.callback&&this.callback(t,e)}}),this.cache.mutationHistory.children=[],e&&this.observe(e)}get item(){return this.cache.lastMutation.item}get history(){return this.cache.mutationHistory.children}}const rs=(t,e)=>new ss(t,e);class is{constructor(t,e,{threshold:s=0,margin:r=0}={}){this.target=t,this.config={threshold:s,margin:r},globalThis.IntersectionObserver?this.observer=new IntersectionObserver((t=>{this.entrie=t[0],e(this)}),{threshold:this.threshold}):console.log("IntersectionObserver Not Supported")}get ratio(){return this.entrie.intersectionRatio}get isIntersecting(){return this.entrie.isIntersecting}setThreshould(t){return this.config.threshold=t,this}setMargin(t){return t="number"==typeof t?t+"px":t,this.config.margin=t,this}start(){return this.observer.observe(this.target.element),this}stop(){return this}}const ns=(t,e,s)=>new is(t,e,s);class os{constructor(t,e){this.target=t,this.contentRect=null,this.observer=new ResizeObserver((()=>{e(this)}))}get BoundingRect(){return this.target.element.getBoundingClientRect()}get width(){return this.BoundingRect.width}get height(){return this.BoundingRect.height}get top(){return this.BoundingRect.top}get bottom(){return this.BoundingRect.bottom}get right(){return this.BoundingRect.right}get left(){return this.BoundingRect.left}get x(){return this.BoundingRect.x}get y(){return this.BoundingRect.y}start(){return this.observer.observe(this.target.element),this}stop(){return this.observer.unobserve(this.target.element),this}}const as=(t,e)=>new os(t,e);class hs{constructor(t=(t=>console.log({x:t.x,y:t.y}))){this.cache={},this.previousX=globalThis?.screenX,this.previousY=globalThis?.screenY}update(){Object.assign(this.cache,{screenXLeft:globalThis?.screenX,screenXRight:globalThis?.screen.availWidth-globalThis?.screenX,screenYTop:globalThis?.screenY,screenYBottom:globalThis?.screen.availHeight-globalThis?.screenY-globalThis?.outerHeight,screenCenterX:globalThis?.screen.availWidth/2,screenCenterY:globalThis?.screen.availHeight/2,windowCenterX:globalThis?.outerWidth/2+globalThis?.screenX,windowCenterY:globalThis?.outerHeight/2+globalThis?.screenY,deltaCenterX:globalThis?.screen.availWidth/2-globalThis?.outerWidth/2+globalThis?.screenX,deltaCenterY:null})}get x0(){return F(globalThis?.screenX,0,globalThis.screen.availWidth,-1,1)}get y0(){return-F(globalThis?.screenY,0,globalThis.screen.availHeight,-1,1)}get x1(){return F(globalThis?.screenX+globalThis?.outerWidth,0,globalThis.screen.availWidth,-1,1)}get y1(){return-F(globalThis?.screenY+globalThis?.outerHeight,0,globalThis.screen.availHeight,-1,1)}get cx(){return F(globalThis?.outerWidth/2+globalThis?.screenX,0,globalThis.screen.availWidth,-1,1)}get cy(){return-F(globalThis?.outerHeight/2+globalThis?.screenY,0,globalThis.screen.availHeight,-1,1)}}const ls=t=>new hs(t);var cs=Object.freeze({__proto__:null,ZikoMutationObserver:Ge,watch:Je,watchAttr:es,watchChildren:rs,watchIntersection:ns,watchScreen:ls,watchSize:as});const us=(t,e=[],s=(()=>{}))=>{t.cache.stream.enabled.down=!0;const r=e.length,i=t.cache.stream.history.down.slice(-r).map((t=>t.key));e.join("")===i.join("")&&(t.event.preventDefault(),s.call(t,t))};function ms(t,...e){const s=t.toString().match(/\(([^)]*)\)/)[1].split(",").map((t=>t.trim()));return function(...r){const i=e[e.length-1];for(let t=0;t<r.length;t++){const n=t>=e.length,o=n?i:e[t],a=r[t];n?(s[s.length-1],e.length):s[t];let h=!1;if("object"==typeof o){if(o.or)for(const t of o.types)if(ps(t,a)){h=!0;break}if(o.nor)for(const t of o.types){if(ps(t,a)){h=!1;break}h=!0}else o.not&&(h=!ps(o.type,a))}else h=ps(o,a);if(!h)throw new TypeError("jjj")}return t(...r)}}const ps=(t,e)=>"string"==typeof t?typeof e===t:t instanceof Function?e instanceof t:Array.isArray(t)?!(!Array.isArray(e)||e.length!==t.length)&&e.every(((e,s)=>ps(t[s],e))):"object"==typeof t&&!Array.isArray(t)&&("object"==typeof e&&null!==e&&Object.keys(t).every((s=>s in e&&ps(t[s],e[s]))));class ds{constructor(t,e=1e3/30,s=0,r=1/0,i=!0){this.callback=t,this.cache={isRunning:!1,AnimationId:null,t0:null,step:e,startTime:s,endTime:r,started:i},this.init(),this.i=0}init(){return this.cache.started&&(this.cache.startTime?this.startAfter(this.cache.startTime):this.start(),this.cache.endTime&&this.cache.endTime!==1/0&&this.stopAfter(this.cache.endTime)),this}start(){return this.cache.isRunning||(this.i=0,this.cache.isRunning=!0,this.cache.t0=Date.now(),this.animate()),this}pause(){return this.cache.isRunning&&(clearTimeout(this.cache.AnimationId),this.cache.isRunning=!1),this}stop(){return this.pause(),this.i=0,this}resume(){return this.cache.isRunning=!0,this.animate(),this}startAfter(t=1e3){return setTimeout(this.start.bind(this),t),this}stopAfter(t=1e3){return setTimeout(this.stop.bind(this),t),this}animate=()=>{if(this.cache.isRunning){const t=Date.now(),e=t-this.cache.t0;e>this.cache.step&&(this.callback(this),this.i++,this.cache.t0=t-e%this.cache.step),this.cache.AnimationId=setTimeout(this.animate,0)}}}const fs=t=>1e3/t,gs=(t,e,s,r,i)=>new ds(t,e,s,r,i);var bs=Object.freeze({__proto__:null,useFps:fs,useTimeLoop:gs});const ys={Linear:function(t){return t},InSin:t=>1-Math.cos(t*Math.PI/2),OutSin:t=>Math.sin(t*Math.PI/2),InOutSin:t=>-(Math.cos(Math.PI*t)-1)/2,InQuad:t=>t**2,OutQuad:t=>1-Math.pow(1-t,2),InOutQuad:t=>t<.5?2*Math.pow(t,2):1-Math.pow(-2*t+2,2)/2,InCubic:t=>t**3,OutCubic:t=>1-Math.pow(1-t,3),InOutCubic:t=>t<.5?4*Math.pow(t,3):1-Math.pow(-2*t+2,3)/2,InQuart:t=>t**4,OutQuart:t=>1-Math.pow(1-t,4),InOutQuart:t=>t<.5?8*Math.pow(t,4):1-Math.pow(-2*t+2,4)/2,InQuint:t=>t**5,OutQuint:t=>1-Math.pow(1-t,5),InOutQuint:t=>t<.5?16*Math.pow(t,5):1-Math.pow(-2*t+2,5)/2,InExpo:t=>0===t?0:Math.pow(2,10*t-10),OutExpo:t=>1===t?1:1-Math.pow(2,-10*t),InOutExpo:t=>0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2,InCirc:t=>1-Math.sqrt(1-Math.pow(t,2)),OutCirc:t=>Math.sqrt(1-Math.pow(t-1,2)),InOutCic:t=>t<.5?(1-Math.sqrt(1-Math.pow(2*t,2)))/2:(Math.sqrt(1-Math.pow(-2*t+2,2))+1)/2,Arc:t=>1-Math.sin(Math.acos(t)),Back:t=>Math.pow(t,2)*(2*t-1),Elastic:t=>-2*Math.pow(2,10*(t-1))*Math.cos(20*Math.PI*t/3*t),InBack(t){const e=1.70158;return 2.70158*Math.pow(t,3)-e*t**2},OutBack(t){const e=1.70158;return 1+2.70158*Math.pow(t-1,3)+e*Math.pow(t-1,2)},InOutBack(t){const e=2.5949095;return t<.5?Math.pow(2*t,2)*(7.189819*t-e)/2:(Math.pow(2*t-2,2)*((e+1)*(2*t-2)+e)+2)/2},InElastic(t){const e=2*Math.PI/3;return 0===t?0:1===t?1:-Math.pow(2,10*t-10)*Math.sin((10*t-10.75)*e)},OutElastic(t){const e=2*Math.PI/3;return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin((10*t-.75)*e)+1},InOutElastic(t){const e=2*Math.PI/4.5;return 0===t?0:1===t?1:t<.5?-Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*e)/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*e)/2+1},InBounce:t=>1-ys.OutBounce(1-t),OutBounce(t){const e=7.5625,s=2.75;return t<1/s?e*t*t:t<2/s?e*(t-=1.5/s)*t+.75:t<2.5/s?e*(t-=2.25/s)*t+.9375:e*(t-=2.625/s)*t+.984375},InOutBounce:t=>t<.5?(1-ys.OutBounce(1-2*t))/2:(1+ys.OutBounce(2*t-1))/2},vs=(t,e=1e3)=>(...s)=>setTimeout((()=>t(...s)),e),ws=(t,e)=>{let s=0;return(...r)=>{const i=(new Date).getTime();i-s<e||(s=i,t(...r))}},xs=t=>{const e=Date.now(),s=performance.memory.usedJSHeapSize,r=t();return{elapsedTime:Date.now()-e,usedMemory:performance.memory.usedJSHeapSize-s,result:r}},_s=t=>new Promise((e=>{if(t.element)return e(t.element);const s=new MutationObserver((()=>{t.element&&(e(t.element),s.disconnect())}));s.observe(document?.body,{childList:!0,subtree:!0})})),ks=(t,e=2e3)=>{const s=Date.now();for(;Date.now()-s<e;)if(t.element)return t.element},Es=t=>new Promise((e=>setTimeout(e,t))),Is=t=>{console.time("timeTaken");const e=t();return console.timeEnd("timeTaken"),e};var As=Object.freeze({__proto__:null,Ease:ys,timeTaken:Is,time_memory_Taken:xs,useDebounce:vs,useThrottle:ws,wait:Es,waitForUIElm:_s,waitForUIElmSync:ks});class Ts{constructor(t,e=ys.Linear,s=50,{t:r=[0,null],start:i=!0,duration:n=3e3}={}){this.cache={isRunning:!1,AnimationId:null,startTime:null,ease:e,step:s,intervall:r,started:i,duration:n},this.t=0,this.tx=0,this.ty=0,this.i=0,this.callback=t}#n(){this.t+=this.cache.step,this.i++,this.tx=F(this.t,0,this.cache.duration,0,1),this.ty=this.cache.ease(this.tx),this.callback(this),this.t>=this.cache.duration&&(clearInterval(this.cache.AnimationId),this.cache.isRunning=!1)}reset(t=!0){return this.t=0,this.tx=0,this.ty=0,this.i=0,t&&this.start(),this}#o(t=!0){return this.cache.isRunning||(t&&this.reset(!1),this.cache.isRunning=!0,this.cache.startTime=Date.now(),this.cache.AnimationId=setInterval(this.#n.bind(this),this.cache.step)),this}start(){return this.#o(!0),this}pause(){return this.cache.isRunning&&(clearTimeout(this.cache.AnimationId),this.cache.isRunning=!1),this}resume(){return this.#o(!1),this}stop(){return this.pause(),this.reset(!1),this}}const Cs={...bs,...bs,...As};let Ss=class{constructor(){this.events={},this.maxListeners=10}on(t,e){this.events[t]||(this.events[t]=[]),this.events[t].push(e),this.events[t].length>this.maxListeners&&console.warn(`Warning: Possible memory leak. Event '${t}' has more than ${this.maxListeners} listeners.`)}once(t,e){const s=r=>{this.off(t,s),e(r)};this.on(t,s)}off(t,e){const s=this.events[t];if(s){const t=s.indexOf(e);-1!==t&&s.splice(t,1)}}emit(t,e){const s=this.events[t];s&&s.forEach((t=>{t(e)}))}clear(t){t?delete this.events[t]:this.events={}}setMaxListener(t,e){this.maxListeners=e}removeAllListeners(t){t?this.events[t]=[]:this.events={}}};const Ms=()=>new Ss;let Os=class{constructor(t,e=!0){this.#i(),this.cache={Emitter:null},e&&this.useEventEmitter(),this.set(t)}#i(){return this.__FavIcon__=document.querySelector("link[rel*='icon']")||document?.createElement("link"),this.__FavIcon__.type="image/x-icon",this.__FavIcon__.rel="shortcut icon",this}set(t){return t!==this.__FavIcon__.href&&(this.__FavIcon__.href=t,this.cache.Emitter&&this.cache.Emitter.emit("ziko:favicon-changed")),this}get current(){return document.__FavIcon__.href}onChange(t){return this.cache.Emitter&&this.cache.Emitter.on("ziko:favicon-changed",t),this}useEventEmitter(){return this.cache.Emitter=Ms(),this}};const js=(t,e)=>new Os(t,e);let Ds=class{constructor({viewport:t,charset:e,description:s,author:r,keywords:i}){this.document=globalThis?.document,this.meta={},this.init({viewport:t,charset:e,description:s,author:r,keywords:i})}init({viewport:t,charset:e,description:s,author:r,keywords:i}){t&&this.setViewport(t),e&&this.setCharset(e),s&&this.describe(s),r&&this.setAuthor(r),i&&this.setKeywords(i)}set(t,e){const s="charset"===(t=t.toLowerCase()),r=s?document.querySelector("meta[charset]"):document.querySelector(`meta[name=${t}]`);return this.meta=r??document?.createElement("meta"),s?this.meta.setAttribute("charset",e):(this.meta.setAttribute("name",t),this.meta.setAttribute("content",e)),r||this.document.head.append(this.meta),this}setCharset(t="utf-8"){return this.set("charset",t),this}describe(t){return this.set("description",t),this}setViewport(t="width=device-width, initial-scale=1.0"){return this.set("viewport",t),this}setKeywords(...t){return t=[...new Set(t)].join(", "),this.set("keywords",t),this}setAuthor(t){return this.set("author",t),this}};const Us=({viewport:t,charset:e,description:s,author:r,keywords:i})=>new Ds({viewport:t,charset:e,description:s,author:r,keywords:i});let Zs=class{constructor(t=document.title,e=!0){this.cache={Emitter:null},e&&this.useEventEmitter(),this.set(t)}useEventEmitter(){return this.cache.Emitter=Ms(),this}set(t){return t!==document.title&&(document.title=t,this.cache.Emitter&&this.cache.Emitter.emit("ziko:title-changed")),this}get current(){return document.title}onChange(t){return this.cache.Emitter&&this.cache.Emitter.on("ziko:title-changed",t),this}};const Rs=(t,e)=>new Zs(t,e);let Ls=class{constructor({title:t,lang:e,icon:s,meta:r,noscript:i}){this.html=globalThis?.document?.documentElement,this.head=globalThis?.document?.head,t&&Rs(t),e&&this.setLang(e),s&&js(s),r&&Us(r),i&&this.setNoScript()}setLang(t){this.html.setAttribute("lang",t)}setNoScript(t){}};const Ps=({title:t,lang:e,icon:s,meta:r,noscript:i})=>new Ls({title:t,lang:e,icon:s,meta:r,noscript:i});let zs=class{constructor(t=""){this.channel=new BroadcastChannel(t),this.EVENTS_DATAS_PAIRS=new Map,this.EVENTS_HANDLERS_PAIRS=new Map,this.LAST_RECEIVED_EVENT="",this.UUID="ziko-channel"+pt.string(10),this.SUBSCRIBERS=new Set([this.UUID])}get broadcast(){return this}emit(t,e){return this.EVENTS_DATAS_PAIRS.set(t,e),this.#a(t),this}on(t,e=console.log){return this.EVENTS_HANDLERS_PAIRS.set(t,e),this.#h(),this}#h(){return this.channel.onmessage=t=>{this.LAST_RECEIVED_EVENT=t.data.last_sended_event;const e=t.data.userId;this.SUBSCRIBERS.add(e);const s=t.data.EVENTS_DATAS_PAIRS.get(this.LAST_RECEIVED_EVENT),r=this.EVENTS_HANDLERS_PAIRS.get(this.LAST_RECEIVED_EVENT);s&&r&&r(s)},this}#a(t){return this.channel.postMessage({EVENTS_DATAS_PAIRS:this.EVENTS_DATAS_PAIRS,last_sended_event:t,userId:this.UUID}),this}close(){return this.channel.close(),this}};const Fs=t=>new zs(t);class Ns{constructor(){this.events={},this.maxListeners=10}on(t,e){this.events[t]||(this.events[t]=[]),this.events[t].push(e),this.events[t].length>this.maxListeners&&console.warn(`Warning: Possible memory leak. Event '${t}' has more than ${this.maxListeners} listeners.`)}once(t,e){const s=r=>{this.off(t,s),e(r)};this.on(t,s)}off(t,e){const s=this.events[t];if(s){const t=s.indexOf(e);-1!==t&&s.splice(t,1)}}emit(t,e){const s=this.events[t];s&&s.forEach((t=>{t(e)}))}clear(t){t?delete this.events[t]:this.events={}}setMaxListener(t,e){this.maxListeners=e}removeAllListeners(t){t?this.events[t]=[]:this.events={}}}const Bs=()=>new Ns;class Hs{#l;constructor(){this.#l=function(t){try{let e=new Function("return "+t.data.fun)()();postMessage({result:e})}catch(t){postMessage({error:t.message})}finally{t.data.close&&self.close()}}.toString(),this.blob=new Blob(["this.onmessage = "+this.#l],{type:"text/javascript"}),this.worker=new Worker(window.URL.createObjectURL(this.blob))}call(t,e,s=!0){return this.worker.postMessage({fun:t.toString(),close:s}),this.worker.onmessage=function(t){t.data.error?console.error(t.data.error):e(t.data.result)},this}}const $s=(t,e,s)=>{const r=new Hs;return t&&r.call(t,e,s),r};class Vs{constructor(t=""){this.channel=new BroadcastChannel(t),this.EVENTS_DATAS_PAIRS=new Map,this.EVENTS_HANDLERS_PAIRS=new Map,this.LAST_RECEIVED_EVENT="",this.UUID="ziko-channel"+pt.string(10),this.SUBSCRIBERS=new Set([this.UUID])}get broadcast(){return this}emit(t,e){return this.EVENTS_DATAS_PAIRS.set(t,e),this.#a(t),this}on(t,e=console.log){return this.EVENTS_HANDLERS_PAIRS.set(t,e),this.#h(),this}#h(){return this.channel.onmessage=t=>{this.LAST_RECEIVED_EVENT=t.data.last_sended_event;const e=t.data.userId;this.SUBSCRIBERS.add(e);const s=t.data.EVENTS_DATAS_PAIRS.get(this.LAST_RECEIVED_EVENT),r=this.EVENTS_HANDLERS_PAIRS.get(this.LAST_RECEIVED_EVENT);s&&r&&r(s)},this}#a(t){return this.channel.postMessage({EVENTS_DATAS_PAIRS:this.EVENTS_DATAS_PAIRS,last_sended_event:t,userId:this.UUID}),this}close(){return this.channel.close(),this}}const qs=t=>new Vs(t);class Ws{constructor(t,e,s){this.cache={storage:t,globalKey:e,channel:qs(`Ziko:useStorage-${e}`),oldItemKeys:new Set},this.#i(s),this.#c()}get items(){return JSON.parse(this.cache.storage[this.cache.globalKey]??null)}#c(){for(let t in this.items)Object.assign(this,{[[t]]:this.items[t]})}#i(t){this.cache.channel=qs(`Ziko:useStorage-${this.cache.globalKey}`),this.cache.channel.on("Ziko-Storage-Updated",(()=>this.#c())),t&&(this.cache.storage[this.cache.globalKey]?(Object.keys(this.items).forEach((t=>this.cache.oldItemKeys.add(t))),console.group("Ziko:useStorage"),console.warn(`Storage key '${this.cache.globalKey}' already exists. we will not overwrite it.`),console.info("%cWe'll keep the existing data.","background-color:#2222dd; color:gold;"),console.group("")):this.set(t))}set(t){return this.cache.storage.setItem(this.cache.globalKey,JSON.stringify(t)),this.cache.channel.emit("Ziko-Storage-Updated",{}),Object.keys(t).forEach((t=>this.cache.oldItemKeys.add(t))),this.#c(),this}add(t){const e={...this.items,...t};return this.cache.storage.setItem(this.cache.globalKey,JSON.stringify(e)),this.#c(),this}remove(...t){const e={...this.items};for(let s=0;s<t.length;s++)delete e[t[s]],delete this[t[s]];return this.set(e),this}get(t){return this.items[t]}clear(){return this.cache.storage.removeItem(this.cache.globalKey),this.#c(),this}}const Ys=(t,e)=>new Ws(localStorage,t,e),Xs=(t,e)=>new Ws(sessionStorage,t,e);class Qs{constructor(t={},e=(t.hasOwnProperty("default")?"default":Object.keys(t)[0]),s=0){this.id="Ziko-Style-"+s,this.keys=new Set,this.styles={default:{fontSize:"1em",color:"green"},other:{fontSize:"2em",color:"cyan"}},t&&this.add(t),e&&this.use(e)}get current(){return[...this.keys].reduce(((t,e)=>(t[e]=`var(--${e}-${this.id})`,t)),{})}add(t,e={}){return t&&"object"==typeof t&&!Array.isArray(t)?Object.assign(this.styles,t):"string"==typeof t&&Object.assign(this.styles,{[t]:e}),this}#t(t){const e=Object.keys(this.styles);for(let s in this.styles[e[t]])Object.prototype.hasOwnProperty.call(this.styles[e[t]],s)&&(document.documentElement.style.setProperty(`--${s}-${this.id}`,this.styles[e[t]][s]),this.keys.add(s));return this}#e(t){if(!this.styles[t])return this;for(let e in this.styles[t])Object.prototype.hasOwnProperty.call(this.styles[t],e)&&(document.documentElement.style.setProperty(`--${e}-${this.id}`,this.styles[t][e]),this.keys.add(e));return this}#s(t){for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(document.documentElement.style.setProperty(`--${e}-${this.id}`,t[e]),this.keys.add(e));return this}use(t){return"number"==typeof t?this.#t(t):"string"==typeof t?this.#e(t):t&&"object"==typeof t?this.#s(t):this}}const Ks=(t,e,s)=>new Qs(t,e,s);class Gs{constructor(t=[],e=(()=>{})){this.mediaQueryRules=t,this.fallback=e,this.lastCalledCallback=null,this.init()}init(){this.mediaQueryRules.forEach((({query:t,callback:e})=>{const s=globalThis.matchMedia(t),r=()=>{const t=this.mediaQueryRules.some((({query:t})=>globalThis.matchMedia(t).matches));s.matches?(e(),this.lastCalledCallback=e):t||this.lastCalledCallback===this.fallback||(this.fallback(),this.lastCalledCallback=this.fallback)};r(),s.addListener(r)}))}}const Js=(t,e)=>new Gs(t,e);class tr{constructor(t){this.props={},t&&this.set(t)}get(t){return this.props[t]}set(t){return Object.entries(t).forEach((([t,e])=>this.#u(t,e))),this}#u(t,e){const s=`--${no.camel2hyphencase(t)}`;document.documentElement.style.setProperty(s,e),Object.assign(this.props,{[t]:`var(${s})`}),Object.assign(this,{[t]:`var(${s})`})}}const er=t=>(t.startsWith("--")||(t=`--${no.camel2hyphencase(t)}`),`var(${t})`),sr=t=>new tr(t);var rr=Object.freeze({__proto__:null,ZikoHead:Ls,ZikoUseRoot:tr,ZikoUseStyle:Qs,useChannel:Fs,useDebounce:vs,useEventEmitter:Bs,useFavIcon:js,useHead:Ps,useLocaleStorage:Ys,useMediaQuery:Js,useMeta:Us,useRoot:sr,useRootValue:er,useSessionStorage:Xs,useStyle:Ks,useSuccesifKeys:us,useThread:$s,useThrottle:ws,useTitle:Rs,useType:ms});const ir=(t="")=>t.startsWith("Ptr")?`pointer${t.split("Ptr")[1].toLowerCase()}`:t.toLowerCase();function nr(t,e,s,r,i){this.cache.currentEvent=e,this.cache.event=t,s?.call(this),r?.hasOwnProperty("prototype")?r?.call(this):r?.call(null,this),this.cache.preventDefault[e]&&t.preventDefault(),this.cache.stopPropagation[e]&&t.stopPropagation(),this.cache.stopImmediatePropagation[e]&&t.stopImmediatePropagation(),this.cache.stream.enabled[e]&&i&&this.cache.stream.history[e].push(i),this.cache.callbacks[e]?.map((t=>t(this)))}class or{constructor(t=null,e=[],s,r){this.target=t,this.cache={currentEvent:null,event:null,options:{},preventDefault:{},stopPropagation:{},stopImmediatePropagation:{},event_flow:{},paused:{},stream:{enabled:{},clear:{},history:{}},callbacks:{},__controllers__:{}};e.map((t=>ir(t))).forEach(((t,i)=>{Object.assign(this.cache.preventDefault,{[t]:!1}),Object.assign(this.cache.options,{[t]:{}}),Object.assign(this.cache.paused,{[t]:!1}),Object.assign(this.cache.stream.enabled,{[t]:!1}),Object.assign(this.cache.stream.clear,{[t]:!1}),Object.assign(this.cache.stream.history,{[t]:[]}),Object.assign(this.cache.__controllers__,{[t]:e=>nr.call(this,e,t,s,r)}),Object.assign(this,{[`on${e[i]}`]:(...e)=>this.__onEvent(t,this.cache.options[t],{},...e)})}))}get targetElement(){return this.target?.element}get isParent(){return this.target?.element===this.event.srcElement}get item(){return this.target.find((t=>t.element==this.event?.srcElement))?.[0]}get currentEvent(){return this.cache.currentEvent}get event(){return this.cache.event}setTarget(t){return this.target=t,this}__handle(t,e,s,r){return this.targetElement?.addEventListener(t,e,s),this}__onEvent(t,e,s,...r){if(0===r.length){if(console.log("00"),!this.cache.callbacks[t])return this;console.log("Call"),this.cache.callbacks[t].map((t=>e=>t.call(this,e)))}else this.cache.callbacks[t]=r.map((t=>e=>t.call(this,e)));return this.__handle(t,this.cache.__controllers__[t],e,s),this}#m(t,e,s){"default"===s&&Object.assign(this.cache[t],{...this.cache[t],...e});const r="default"===s?this.cache[t]:Object.fromEntries(Object.keys(this.cache.preventDefault).map((t=>[t,s])));return Object.assign(this.cache[t],{...r,...e}),this}preventDefault(t={},e="default"){return this.#m("preventDefault",t,e),this}stopPropagation(t={},e="default"){return this.#m("stopPropagation",t,e),this}stopImmediatePropagation(t={},e="default"){return this.#m("stopImmediatePropagation",t,e),this}setEventOptions(t,e){return this.pause({[t]:!0},"default"),Object.assign(this.cache.options[ir(t)],e),this.resume({[t]:!0},"default"),this}pause(t={},e="default"){t={..."default"===e?this.cache.stream.enabled:Object.entries(Object.keys(this.cache.stream.enabled).map((t=>[t,e]))),...t};for(let e in t)t[e]&&(this.targetElement?.removeEventListener(e,this.cache.__controllers__[e],this.cache.options[e]),this.cache.paused[e]=!0);return this}resume(t={},e="default"){t={..."default"===e?this.cache.stream.enabled:Object.entries(Object.keys(this.cache.stream.enabled).map((t=>[t,e]))),...t};for(let e in t)t[e]&&(this.targetElement?.addEventListener(e,this.cache.__controllers__[e],this.cache.options[e]),this.cache.paused[e]=!1);return this}stream(t={},e="default"){this.cache.stream.t0=Date.now();return t={...Object.fromEntries(Object.keys(this.cache.stream.enabled).map((t=>[t,e]))),...t},Object.assign(this.cache.stream.enabled,t),this}clear(){}dispose(t={},e="default"){return this.pause(t,e),this}}const ar={...Ke,...cs,...rr,...Object.freeze({__proto__:null,__ZikoEvent__:or,getEvent:ir})};class hr{constructor(t,e="",{el_type:s="html",useDefaultStyle:r=!1}={}){if(this.target=globalThis.__Ziko__.__Config__.default.target||globalThis?.document?.body,"string"==typeof t)switch(s){case"html":t=globalThis?.document?.createElement(t);break;case"svg":t=globalThis?.document?.createElementNS("http://www.w3.org/2000/svg",t);default:throw Error("Not supported")}else this.target=t.parentElement;t&&(this.__ele__=t),this.cache={name:e,parent:null,isBody:!1,isRoot:!1,isHidden:!1,isFrozzen:!1,legacyParent:null,style:new Nt({}),attributes:{},filters:{},temp:{}},this.events={ptr:null,mouse:null,wheel:null,key:null,drag:null,drop:null,click:null,clipboard:null,focus:null,swipe:null,custom:null},this.observer={resize:null,intersection:null},this.uuid=`${this.cache.name}-${pt.string(16)}`,this.ui_index=globalThis.__Ziko__.__CACHE__.get_ui_index(),this.cache.style.linkTo(this),r&&this.style({position:"relative",boxSizing:"border-box",margin:0,padding:0,width:"auto",height:"auto"}),this.items=[],globalThis.__Ziko__.__UI__[this.cache.name]?globalThis.__Ziko__.__UI__[this.cache.name]?.push(this):globalThis.__Ziko__.__UI__[this.cache.name]=[this],t&&globalThis.__Ziko__.__Config__.default.render&&this.render(),this.setAttr("data-ui-index",this.ui_index),"spa"===globalThis.__Ziko__.__Config__.renderingMode||globalThis.__Ziko__.__Config__.isSSC||globalThis.__Ziko__.__HYDRATION_MAP__.set(this.uuid,(()=>this))}get element(){return this.__ele__}get isZikoUIElement(){return!0}get st(){return this.cache.style}get attr(){return this.cache.attributes}get evt(){return this.events}get html(){return this.element.innerHTML}get text(){return this.element.textContent}get isBody(){return this.element===globalThis?.document.body}get parent(){return this.cache.parent}get width(){return this.element.getBoundingClientRect().width}get height(){return this.element.getBoundingClientRect().height}get top(){return this.element.getBoundingClientRect().top}get right(){return this.element.getBoundingClientRect().right}get bottom(){return this.element.getBoundingClientRect().bottom}get left(){return this.element.getBoundingClientRect().left}clone(t=!1){const e=new this.constructor;if(e.__proto__=this.__proto__,this.items.length){const t=[...this.items].map((t=>t.clone()));e.append(...t)}else e.element=this.element.cloneNode(!0);return e.render(t)}style(t){return t instanceof zt?this.st.style(t.current):this.st.style(t),this}size(t,e){return this.st.size(t,e),this}maintain(){for(let t=0;t<this.items.length;t++)Object.assign(this,{[[t]]:this.items[t]});return this.length=this.items.length,this}at(t){return this.items.at(t)}#p(t,e,...s){if(this.cache.isFrozzen)return console.warn("You can't append new item to frozzen element"),this;for(let r=0;r<s.length;r++)["number","string"].includes(typeof s[r])&&(s[r]=br(s[r])),s[r]instanceof Node&&(s[r]=new hr(s[r])),s[r]?.isZikoUIElement?(s[r].cache.parent=this,this.element[t](s[r].element),s[r].target=this.element,this.items[e](s[r])):s[r]instanceof Object&&(s[r]?.style&&this.style(s[r]?.style),s[r]?.attr&&Object.entries(s[r].attr).forEach((t=>this.setAttr(""+t[0],t[1]))));return this.maintain(),this}append(...t){return this.#p("append","push",...t),this}prepend(...t){return this.#p("prepend","unshift",...t),this}insertAt(t,...e){if(t>=this.element.children.length)this.append(...e);else for(let s=0;s<e.length;s++)["number","string"].includes(typeof e[s])&&(e[s]=br(e[s])),this.element?.insertBefore(e[s].element,this.items[t].element),this.items.splice(t,0,e[s]);return this}remove(...t){const e=t=>{"number"==typeof t&&(t=this.items[t]),t?.isZikoUIElement&&this.element?.removeChild(t.element),this.items=this.items.filter((e=>e!==t))};for(let s=0;s<t.length;s++)e(t[s]);for(let t=0;t<this.items.length;t++)Object.assign(this,{[[t]]:this.items[t]});return this}forEach(t){return this.items.forEach(t),this}map(t){return this.items.map(t)}find(t){return this.items.filter(t)}filter(t,e=(()=>{}),s=(()=>{})){const r=this.items.filter(t);return r.forEach(e),this.items.filter((t=>!r.includes(t))).forEach(s),this}filterByTextContent(t,e=!1){this.items.forEach((t=>t.render())),this.filter((s=>!(e?s.text===t:s.text.includes(t))),(t=>t.unrender()))}filterByClass(t){return this.items.map((t=>t.render())),this.items.filter((e=>!e.classes.includes(t))).map((t=>t.unrender())),this}sortByTextContent(t,e){let s=this.children;return s.filter((e=>!e.textContent.toLowerCase().includes(t.toLowerCase()))).map((t=>{t.style.display="none"})),s.filter((e=>e.textContent.toLowerCase().includes(t.toLowerCase()))).map(((t,s)=>t.style.display=e[s])),s.filter((t=>"none"!=t.style.display)),this}get#d(){const t=globalThis.getComputedStyle(this.element),e={};return"0px"!==t.marginRight&&Object.assign(e,{marginLeft:t.marginRight}),"0px"!==t.marginLeft&&Object.assign(e,{marginRight:t.marginLeft}),"0px"!==t.paddingRight&&Object.assign(e,{paddingLeft:t.paddingRight}),"0px"!==t.paddingLeft&&Object.assign(e,{paddingRight:t.paddingLeft}),"0px"!==t.left&&Object.assign(e,{right:t.left}),"0px"!==t.right&&Object.assign(e,{left:t.right}),"right"===t.textAlign&&Object.assign(e,{textAlign:"left"}),"left"===t.textAlign&&Object.assign(e,{textAlign:"right"}),"right"===t.float&&Object.assign(e,{float:"left"}),"left"===t.float&&Object.assign(e,{float:"right"}),"0px"!==t.borderRadiusLeft&&Object.assign(e,{right:t.borderRadiusRight}),"0px"!==t.borderRadiusRight&&Object.assign(e,{right:t.borderRadiusLeft}),["flex","inline-flex"].includes(t.display)&&("flex-end"===t.justifyContent&&Object.assign(e,{justifyContent:"flex-start"}),"flex-start"===t.justifyContent&&Object.assign(e,{justifyContent:"flex-end"})),e}useRtl(t=!1){return t?this.style({...this.#d,direction:"rtl"}):this.style({direction:"rtl"}),this}useLtr(t=!1){return t?this.style({...this.#d,direction:"ltr"}):this.style({direction:"ltr"}),this}freeze(t){return this.cache.isFrozzen=t,this}setTarget(t){if(!this.isBody)return t?.isZikoUIElement&&(t=t.element),this.unrender(),this.target=t,this.render(),this}describe(t){t&&this.setAttr("aria-label",t)}clear(){return this?.items?.forEach((t=>t.unrender())),this.element.innerHTML="",this}render(t=this.target){if(!this.isBody)return t?.isZikoUIElement&&(t=t.element),this.target=t,this.target?.appendChild(this.element),this}unrender(){return this.cache.parent?this.cache.parent.remove(this):this.target?.children?.length&&[...this.target?.children].includes(this.element)&&this.target.removeChild(this.element),this}renderAfter(t=1){return setTimeout((()=>this.render()),t),this}unrenderAfter(t=1){return setTimeout((()=>this.unrender()),t),this}after(t){return t?.isZikoUIElement&&(t=t.element),this.element?.after(t),this}before(t){return t?.isZikoUIElement&&(t=t.element),this.element?.before(t),this}animate(t,{duration:e=1e3,iterations:s=1,easing:r="ease"}={}){return this.element?.animate(t,{duration:e,iterations:s,easing:r}),this}#f(t,e){"svg"!==this.element.tagName&&(t=no.isCamelCase(t)?no.camel2hyphencase(t):t),this?.attr[t]&&this?.attr[t]===e||(this.element.setAttribute(t,e),Object.assign(this.cache.attributes,{[t]:e}))}setAttr(t,e){if(t instanceof Object){const[s,r]=[Object.keys(t),Object.values(t)];for(let t=0;t<s.length;t++)r[t]instanceof Array&&(e[t]=r[t].join(" ")),this.#f(s[t],r[t])}else e instanceof Array&&(e=e.join(" ")),this.#f(t,e);return this}removeAttr(...t){for(let e=0;e<t.length;e++)this.element?.removeAttribute(t[e]);return this}getAttr(t){return t=no.isCamelCase(t)?no.camel2hyphencase(t):t,this.element.attributes[t].value}setContentEditable(t=!0){return this.setAttr("contenteditable",t),this}get children(){return[...this.element.children]}get cloneElement(){return this.element.cloneNode(!0)}setClasses(...t){return this.setAttr("class",t.join(" ")),this}get classes(){const t=this.element.getAttribute("class");return null===t?[]:t.split(" ")}addClass(){}setId(t){return this.setAttr("id",t),this}get id(){return this.element.getAttribute("id")}onPtrMove(...t){return this.events.ptr||(this.events.ptr=se(this)),this.events.ptr.onMove(...t),this}onPtrDown(...t){return this.events.ptr||(this.events.ptr=se(this)),this.events.ptr.onDown(...t),this}onPtrUp(...t){return this.events.ptr||(this.events.ptr=se(this)),this.events.ptr.onUp(...t),this}onPtrEnter(...t){return this.events.ptr||(this.events.ptr=se(this)),this.events.ptr.onEnter(...t),this}onPtrLeave(...t){return this.events.ptr||(this.events.ptr=se(this)),this.events.ptr.onLeave(...t),this}onPtrOut(...t){return this.events.ptr||(this.events.ptr=se(this)),this.events.ptr.onOut(...t),this}onPtrCancel(...t){return this.events.ptr||(this.events.ptr=se(this)),this.events.ptr.onCancel(...t),this}onSwipe(t,e,...s){return this.events.swipe||(this.events.swipe=Qe(this,t,e)),this.events.swipe.onSwipe(...s),this}onMouseMove(...t){return this.events.mouse||(this.events.mouse=ue(this)),this.events.mouse.onMove(...t),this}onMouseDown(...t){return this.events.mouse||(this.events.mouse=ue(this)),this.events.mouse.onDown(...t),this}onMouseUp(...t){return this.events.mouse||(this.events.mouse=ue(this)),this.events.mouse.onUp(...t),this}onMouseEnter(...t){return this.events.mouse||(this.events.mouse=ue(this)),this.events.mouse.onEnter(...t),this}onMouseLeave(...t){return this.events.mouse||(this.events.mouse=ue(this)),this.events.mouse.onLeave(...t),this}onMouseOut(...t){return this.events.mouse||(this.events.mouse=ue(this)),this.events.mouse.onOut(...t),this}onWheel(...t){return this.events.wheel||(this.events.wheel=de(this)),this.events.wheel.onWheel(...t),this}onKeyDown(...t){return this.events.key||(this.events.key=ve(this)),this.events.key.onDown(...t),this}onKeyPress(...t){return this.events.key||(this.events.key=ve(this)),this.events.key.onPress(...t),this}onKeyUp(...t){return this.events.key||(this.events.key=ve(this)),this.events.key.onUp(...t),this}onKeysDown({keys:t=[],callback:e}={}){return this.events.key||(this.events.key=ve(this)),this.events.key.handleSuccessifKeys({keys:t,callback:e}),this}onDragStart(...t){return this.events.drag||(this.events.drag=Ae(this)),this.events.drag.onStart(...t),this}onDrag(...t){return this.events.drag||(this.events.drag=Ae(this)),this.events.drag.onDrag(...t),this}onDragEnd(...t){return this.events.drag||(this.events.drag=Ae(this)),this.events.drag.onEnd(...t),this}onDrop(...t){return this.events.drop||(this.events.drop=Te(this)),this.events.drop.onDrop(...t),this}onClick(...t){return this.events.click||(this.events.click=Wt(this)),this.events.click.onClick(...t),this}onDbClick(...t){return this.events.click||(this.events.click=Wt(this)),this.events.click.onDbClick(...t),this}onCopy(...t){return this.events.clipboard||(this.events.clipboard=De(this)),this.events.clipboard.onCopy(...t),this}onCut(...t){return this.events.clipboard||(this.events.clipboard=De(this)),this.events.clipboard.onCut(...t),this}onPaste(...t){return this.events.clipboard||(this.events.clipboard=De(this)),this.events.clipboard.onPaste(...t),this}onSelect(...t){return this.events.clipboard||(this.events.clipboard=De(this)),this.events.clipboard.onSelect(...t),this}onFocus(...t){return this.events.focus||(this.events.focus=Le(this)),this.events.focus.onFocus(...t),this}onBlur(...t){return this.events.focus||(this.events.focus=Le(this)),this.events.focus.onFocus(...t),this}on(t,...e){return this.events.custom||(this.events.custom=We(this)),this.events.custom.on(t,...e),this}emit(t,e={}){return this.events.custom||(this.events.custom=We(this)),this.events.custom.emit(t,e),this}watchAttr(t){return this.observer.attr||(this.observer.attr=es(this,t)),this}watchChildren(t){return this.observer.children||(this.observer.children=rs(this,t)),this}watchSize(t){return this.observer.resize||(this.observer.resize=as(this,t)),this.observer.resize.start(),this}watchIntersection(t,e){return this.observer.intersection||(this.observer.intersection=ns(this,t,e)),this.observer.intersection.start(),this}setFullScreen(t=!0,e){return this.element.requestFullscreen?(t?this.element.requestFullscreen(e):globalThis.document.exitFullscreen(),this):(console.error("Fullscreen API is not supported in this browser."),this)}toggleFullScreen(t){return globalThis.document.fullscreenElement?globalThis.document.exitFullscreen():this.element.requestFullscreen(t),this}toPdf(){return __ZikoPdf__,this}}class lr extends hr{constructor(t,e,s,...r){super(t,e),this.addValue(...r),this.style({margin:0,padding:0}),Object.assign(this.cache,{lineBreak:s})}get isText(){return!0}get value(){return this.element.textContent}clear(){return this.element.childNodes.forEach((t=>t.remove())),this.element.textContent="",this}addValue(...t){return t.forEach(((t,e)=>{"string"==typeof t||"number"==typeof t?this.element?.appendChild(globalThis?.document.createTextNode(t)):t instanceof hr?this.element?.appendChild(t.element):t instanceof vo||t instanceof uo?this.element?.appendChild(new Text(t.toString())):t instanceof Array?this.element?.appendChild(new Text(Jn(t))):t instanceof Object&&this.element?.appendChild(new Text(Kn(t))),this.cache.lineBreak&&this.element?.appendChild(globalThis.document?.createElement("br"))})),this}setValue(...t){return this.clear(),this.addValue(...t),this}}class cr extends lr{constructor(...t){super("span","text",!1,...t)}}class ur extends lr{constructor(...t){super("q","quote",!1,...t),this.style({fontStyle:"italic"})}get isQuote(){return!0}}class mr extends lr{constructor(...t){super("dfn","dfnText",!1,...t)}get isDfnText(){return!0}}class pr extends lr{constructor(t){super("sup","supText",!1,t)}get isSupText(){return!0}}class dr extends lr{constructor(...t){super("sub","subText",!1,...t)}get isSubText(){return!0}}class fr extends lr{constructor(...t){super("code","codeText",!1,...t)}get isCodeText(){return!0}}class gr extends lr{constructor(t,e){super("abbr","abbrText",!1,t),this.setAttr("title",e)}get isAbbrText(){return!0}}const br=(...t)=>new cr(...t),yr=(...t)=>new ur(...t),vr=(...t)=>new mr(...t),wr=(...t)=>new pr(...t),xr=(...t)=>new dr(...t),_r=(...t)=>new fr(...t),kr=(t,e)=>new gr(t,e);class Er extends lr{constructor(...t){super("p","p",!0,...t)}get isPara(){return!0}}class Ir extends lr{constructor(t,e){super("blockquote","blockquote",!0,e),this.setAttr("cite",t)}get isBlockQuote(){return!0}}const Ar=(...t)=>new Er(...t),Tr=(t,e)=>new Ir(t,e);class Cr extends hr{constructor(t=1,e=""){super(`h${t}`,`h${t}`),this.element.textContent=e}get isHeading(){return!0}get value(){return this.element.innerText}setValue(t=""){this.element.innerText=t}addValue(t=""){return this.element.innerText+=t,this}}const Sr=(t="")=>new Cr(1,t),Mr=(t="")=>new Cr(2,t),Or=(t="")=>new Cr(3,t),jr=(t="")=>new Cr(4,t),Dr=(t="")=>new Cr(5,t),Ur=(t="")=>new Cr(6,t);var Zr=Object.freeze({__proto__:null,ZikoUIAbbrText:gr,ZikoUIBlockQuote:Ir,ZikoUICodeText:fr,ZikoUIDefintion:mr,ZikoUIHeading:Cr,ZikoUIParagraphe:Er,ZikoUIQuote:ur,ZikoUISubText:dr,ZikoUISupText:pr,ZikoUIText:cr,abbrText:kr,blockQuote:Tr,codeText:_r,dfnText:vr,h1:Sr,h2:Mr,h3:Or,h4:jr,h5:Dr,h6:Ur,p:Ar,quote:yr,subText:xr,supText:wr,text:br});class Rr extends hr{constructor(t){super("li","li"),this.append(t)}get isLi(){return!0}}class Lr extends hr{constructor(t,e){super(t,e),delete this.append,this.style({listStylePosition:"inside"})}get isList(){return!0}append(...t){for(let e=0;e<t.length;e++){let s=null;["string","number"].includes(typeof t[e])&&(t[e]=br(t[e])),t[e]instanceof hr&&(s=new Rr(t[e])),s.setTarget(this.element),this.items.push(s[0]),this.maintain()}}remove(...t){if(0==t.length)this.target.children.length&&this.target.removeChild(this.element);else{const e=t=>{"number"==typeof t&&(t=this.items[t]),t instanceof hr&&this.element?.removeChild(t.parent.element),this.items=this.items.filter((e=>e!==t))};for(let s=0;s<t.length;s++)e(t[s]);for(let t=0;t<this.items.length;t++)Object.assign(this,{[[t]]:this.items[t]})}return this}insertAt(t,...e){if(t>=this.element.children.length)this.append(...e);else for(let s=0;s<e.length;s++){let r=null;["number","string"].includes(typeof e[s])&&(e[s]=br(e[s])),e[s]instanceof hr&&(r=new Rr(e[s])),this.element?.insertBefore(r.element,this.items[t].parent.element),this.items.splice(t,0,e[s][0])}return this}filterByTextContent(t,e=!1){return this.items.map((t=>t.parent.render())),this.items.filter((s=>{const r=s.element.textContent;return!(e?r===t:r.includes(t))})).map((t=>t.parent.render(!1))),this}sortByTextContent(t=1){return this.items.map((t=>t.parent.render(!1))),this.sortedItems=this.items.sort(((e,s)=>t*e.element.textContent.localeCompare(s.element.textContent))),this.append(...this.sortedItems),this}filterByClass(t){return this.items.map((t=>t.parent.render(!0))),this.items.filter((e=>!e.Classes.includes(t))).map((t=>t.parent.render(!1))),this}delete(t){return[...this.element.children].indexOf(t)}push(){}pop(){}unshift(){}shift(){}sort(){}filter(){}slice(){}}class Pr extends Lr{constructor(...t){super("ol","ol"),this.append(...t)}get isOl(){return!0}type(t=1){return this.element?.setAttribute("type",t),this}start(t=1){return this.element?.setAttribute("start",t),this}}class zr extends Lr{constructor(...t){super("ul","ul"),this.append(...t)}get isUl(){return!0}}const Fr=t=>new Rr(t),Nr=(...t)=>new Pr(...t),Br=(...t)=>new zr(...t);var Hr=Object.freeze({__proto__:null,li:Fr,ol:Nr,ul:Br});class $r extends hr{constructor(t,e,s="",r){super("input","input"),Object.assign(this.events,{input:null}),this.setValue(s),this.setAttr("type",t),this.setAttr("name",e),r&&this.linkDatalist(r)}get isInput(){return!0}setName(t){return this.setAttr("name",t),this}onInput(...t){return this.events.input||(this.events.input=Ne(this)),this.events.input.onInput(...t),this}onChange(...t){return this.events.input||(this.events.input=Ne(this)),this.events.input.onChange(...t),this}linkDatalist(t){let e;if(t instanceof ZikoUIInputDatalist)e=t.Id;else if(t instanceof Array){const s=new ZikoUIInputDatalist(...t);e=s.Id,console.log(s)}else e=t;return this.element?.setAttribute("list",e),this}get value(){return this.element.value}setValue(t=""){return this.element.value=t,this}useState(t){return this.setValue(t),[{value:this.value},t=>this.setValue(t)]}setPlaceholder(t){return t&&(this.element.placeholder=t),this}get isValide(){return this.element.checkValidity()}setRequired(t=!0){return this.element.required=t,this}select(){return this.element.select(),this}copy(){return this.element.select(),document.execCommand("copy"),this}cut(){return this.element.select(),document.execCommand("cut"),this}accept(t){return this.element.accept=t,this}}const Vr=(t,e)=>{if(t instanceof Object){const{datalist:e,placeholder:s}=t;return t=t.value??"",new $r("text","input",t,e).setPlaceholder(s)}return new $r("text","input",t,e)};class qr extends $r{constructor(t,e,s=1){super("number","inpuNumber"),this.setMin(t).setMax(e).setStep(s)}get isInputNumber(){return!0}get value(){return+this.element.value}setMin(t){return this.element.min=t,this}setMax(t){return this.element.max=t,this}setStep(t){return this.element.step=t,this}}const Wr=(t,e,s)=>{if(t instanceof Object){const{value:e,max:s=10,step:r=1,placeholder:i=""}=t;return t=t?.min??0,new ZikoUIInputSlider(t,s,r).setValue(e).setPlaceholder(i)}return new qr(t,e,s)};let Yr=class extends $r{constructor(t=0,e=0,s=10,r=1){super("range","inputSlider"),this.setMin(e).setMax(s).setValue(t).setStep(r)}get isInputSlider(){return!0}setMin(t){return this.element.min=t,this}setMax(t){return this.element.max=t,this}setStep(t){return this.element.step=t,this}};const Xr=(t,e,s,r)=>{if(t instanceof Object){const{min:e=0,max:s=10,step:r=1}=t;return new Yr(t=t?.value??5,e,s,r)}return new Yr(t,e,s,r)};class Qr extends $r{constructor(){super("color","inputColor"),this.background(this.value),this.onInput((()=>this.background(this.value)))}get isInputColor(){return!0}}const Kr=()=>new Qr;class Gr extends $r{constructor(){super("search","inputSearch"),this.Length=0}get isInputSearch(){return!0}onsearch(t){return this.element?.addEventListener("search",(()=>t())),this}connect(...t){return this}displayLength(t){return this.element?.addEventListener("keyup",(()=>t.setValue(this.Length))),this}}const Jr=(...t)=>(new Gr).connect(...t);class ti extends $r{constructor(){super("checkbox","inputCheckbox"),this.cursor("pointer")}get isInputCheckbox(){return!0}get checked(){return this.element.checked}check(t=!0){return this.element.checked=t,this}color(t){return this.element.style.accentColor=t,this}}const ei=()=>new ti;class si extends $r{constructor(){super("radio","inputRadio"),this.cursor("pointer")}get isInputRadio(){return!0}get checked(){return this.element.checked}check(t=!0){return this.element.checked=t,this}color(t){return this.element.style.accentColor=t,this}}const ri=()=>new si;class ii extends $r{constructor(){super("email","inputEmail")}get isInputEmail(){return!0}}const ni=()=>new ii;class oi extends $r{constructor(){super("password","inputPassword")}get isInputPassword(){return!0}}const ai=()=>new oi;class hi extends $r{constructor(){super("date","inputDate")}get isInputDate(){return!0}}const li=()=>new hi;class ci extends $r{constructor(){super("time","inputTime")}get isInputTime(){return!0}}const ui=()=>new ci;class mi extends $r{constructor(){super("datetime-local","inputDateTime")}get isInputDateTime(){return!0}}const pi=()=>new mi;class di extends hr{constructor(t,e){super("div",""),this.element.append("svg"===e?function(t){if(globalThis?.DOMParser){return(new DOMParser).parseFromString(t.replace(/\s+/g," ").trim(),"image/svg+xml").documentElement}}(t):function(t){if(globalThis?.DOMParser){const e=(new DOMParser).parseFromString(`<div>${t}</div>`,"text/html");return e.body.firstChild.style.display="contents",e.body.firstChild}}(t))}}class fi extends di{constructor(t){super(t,"html")}}class gi extends di{constructor(t){super(t,"svg")}}const bi=t=>new fi(t),yi=t=>new gi(t);class vi extends hr{constructor(t,e){super("div","suspense"),this.setAttr({dataTemp:"suspense"}),this.fallback_ui=t,this.append(t),(async()=>{try{const s=await e();t.unrender(),this.append(s)}catch(t){console.log({error:t})}})()}}const wi=(t,e)=>new vi(t,e),xi=(t,e,s,...r)=>{const{name:i,style:n,...o}=s;let a=new hr(t,i,e);return n&&a.style(n),o&&a.setAttr(o),r&&a.append(...r),a},_i=(t,e={},...s)=>xi(t,"html",e,...s),ki=(t,e={},...s)=>xi(t,"svg",e,...s),Ei=["a","abb","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","i","iframe","img","ipnut","ins","kbd","label","legend","li","main","map","mark","menu","meter","nav","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","small","source","span","strong","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"].reduce(((t,e)=>(t[e]=(t,...s)=>_i(e,t,...s),t)),{}),Ii=["svg","g","defs","symbol","use","image","switch","rect","circle","ellipse","line","polyline","polygon","path","text","tspan","textPath","altGlyph","altGlyphDef","altGlyphItem","glyph","glyphRef","linearGradient","radialGradient","pattern","solidColor","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncR","feFuncG","feFuncB","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","animate","animateMotion","animateTransform","set","script","desc","title","metadata","foreignObject"].reduce(((t,e)=>(t[e]=(t,...s)=>_i(e,t,...s),t)),{});class Ai extends hr{constructor(t){super(t,"html")}}class Ti extends hr{constructor(t="button"){super("button","btn"),this.setValue(t),this.st.cursor("pointer"),globalThis.__Ziko__.__Config__.default.render&&this.render()}get isBtn(){return!0}setValue(t){return t instanceof hr?t.setTarget(this.element):(this.element?.appendChild(document.createTextNode("")),this.element.childNodes[0].data=t),this}get value(){return this.element.innerText}toggleValues(...t){let e=(t=t.map((t=>""+t))).indexOf(""+this.value);return-1!=e&&e!=t.length-1?this.setValue(t[e+1]):this.setValue(t[0]),this}}class Ci extends hr{constructor(){super("br","br")}get isBr(){return!0}}class Si extends hr{constructor(){super("hr","hr"),this.setAttr("role","none")}get isHr(){return!0}}class Mi extends hr{constructor(t){super("a","link"),Object.assign(this.cache,{defaultStyle:{color:"#0275d8",textDecoration:"none"},hoverStyle:{color:"#01447e",textDecoration:"underline"}}),this.setHref(t),this.style(this.cache.defaultStyle),this.onPtrEnter((()=>this.style(this.cache.hoverStyle))),this.onPtrLeave((()=>this.style(this.cache.defaultStyle)))}setHref(t){this.element.href=t}get isLink(){return!0}}const Oi=()=>new Ci,ji=()=>new Si,Di=(t=1)=>new Array(t).fill(new Ci),Ui=(t=1)=>new Array(t).fill(new Si),Zi=(t,...e)=>new Mi(t).append(...e),Ri=(t,...e)=>new Ai(t).append(...e),Li=t=>new Ti(t);var Pi=Object.freeze({__proto__:null,HTMLWrapper:bi,SVGWrapper:yi,Suspense:wi,ZikoUIBr:Ci,ZikoUIHTMLWrapper:fi,ZikoUIHr:Si,ZikoUIHtmlTag:Ai,ZikoUILink:Mi,ZikoUISVGWrapper:gi,ZikoUISuspense:vi,ZikoUIXMLWrapper:di,br:Oi,brs:Di,btn:Li,h:_i,hTags:Ei,hr:ji,hrs:Ui,html:Ri,link:Zi,s:ki,sTags:Ii});class zi extends hr{constructor(t="File"){super("inputImage"),this._aux_element=Li(t).setTarget(this.target),this.element=document?.createElement("input"),this.element?.setAttribute("type","file"),this.element?.setAttribute("accept","image"),this._aux_element.onClick((()=>this.element.click())),this.element.onChange=this.handleImage.bind(this)}get isInputImage(){return!0}handleImage(t){const e=new FileReader,s=new Image;e.onload=function(t){s.src=t.target.result,console.log(s.src)},e.readAsDataURL(t.target.files[0]),this.img=s}get value(){return this.img}render(t=!0){return t?this.target.appendChild(this._aux_element.element):this.remove(),this}remove(){return this.target.children.length&&this.target.removeChild(this._aux_element.element),this}}const Fi=t=>new zi(t);class Ni extends hr{constructor(t,e,s,r){super("img","image"),this.value=t,"IMG"===t.nodeName?this.element.setAttribute("src",t.src):this.element?.setAttribute("src",t),"number"==typeof s&&(s+="%"),"number"==typeof r&&(r+="%"),this.setAttr("alt",e),this.style({border:"1px solid black",width:s,height:r})}get isImg(){return!0}updateSrc(t){return this.value=t,this.element.src=t,this}toggleSrc(...t){let e=(t=t.map((t=>""+t))).indexOf(""+this.value);return-1!=e&&e!=t.length-1?this.updateSrc(t[e+1]):this.updateSrc(t[0]),this}alt(t){return this.element.alt=t,this}}const Bi=(t,e,s,r)=>new Ni(t,e,s,r);class Hi extends hr{constructor(t,e){super("figure","figure"),this.img=t.width("100%").element,this.caption=document?.createElement("figcaption"),this.caption.append(e.element),this.element?.append(this.img),this.element?.append(this.caption)}get isFigure(){return!0}}const $i=(t,e)=>new Hi(t,e);class Vi extends hr{constructor(t,e){super(t,e),this.useControls()}get t(){return this.element.currentTime}useControls(t=!0){return this.element.controls=t,this}enableControls(){return this.element.controls=!0,this}disableControls(){return this.element.controls=!0,this}toggleControls(){return this.element.controls=!this.element.controls,this}play(){return this.element.play(),this}pause(){return this.element.pause(),this}seekTo(t){return this.element.currentTime=t,this}onPlay(){}onPause(){}}class qi extends Vi{constructor(t="",e="100%",s="50vh"){super("video","video"),"VIDEO"===t.nodeName?this.element?.setAttribute("src",t.src):this.element?.setAttribute("src",t),"number"==typeof e&&(e+="%"),"number"==typeof s&&(s+="%"),this.style({width:e,height:s})}get isVideo(){return!0}usePoster(t=""){return this.element.poster=t,this}usePIP(t){return this.element.requestPictureInPicture(t),this}}const Wi=(t,e,s)=>new qi(t,e,s);class Yi extends Vi{constructor(t){super("audio","audio"),this.element?.setAttribute("src",t),this.size("150px","30px")}get isAudio(){return!0}}const Xi=t=>new Yi(t);var Qi=Object.freeze({__proto__:null,ZikoUIAudio:Yi,ZikoUIFigure:Hi,ZikoUIImage:Ni,ZikoUIVideo:qi,audio:Xi,figure:$i,image:Bi,video:Wi});class Ki extends qi{constructor(){super(),this.element?.setAttribute("src",""),this.constraints={audio:!0,video:{width:1280,height:720}}}get isInputCamera(){return!0}start(){return navigator.mediaDevices.getUserMedia(this.constraints).then((t=>{this.element.srcObject=t,this.element.onloadedmetadata=()=>{this.element.play()}})).catch((function(t){console.log(t.name+": "+t.message)})),this}}const Gi=()=>new Ki;class Ji extends hr{constructor(){super(),this.element=document?.createElement("label")}get isLabel(){return!0}}class tn extends hr{constructor(t=""){super(),this.element=document?.createElement("option"),t instanceof Object&&"value"in t?(this.setValue(t.value),this.setText(t?.text??t.value)):this.setValue(t)}setValue(t=""){return this.element.value=t,this}setText(t=""){return t&&(this.element.textContent=t),this}}let en=class extends hr{constructor(...t){super(),this.element=document?.createElement("datalist"),this.addOptions(...t).setId("ziko-datalist-id"+pt.string(10))}get isDatalist(){return!0}addOptions(...t){return t.map((t=>this.append(new tn(t)))),this}};const sn=(...t)=>new en(...t);class rn extends hr{constructor(){super(),this.element=document?.createElement("select")}addOptions(...t){return t.map((t=>this.append(new tn(t)))),this}get isSelect(){return!0}}const nn=()=>new rn;class on extends hr{constructor(){super(),this.element=document?.createElement("textarea")}get value(){return this.element.textContent}get isTextArea(){return!0}}const an=()=>new on;class hn extends hr{constructor(t="div",e="100%",s="100%"){super(t,"Flex"),this.direction="cols","number"==typeof e&&(e+="%"),"number"==typeof s&&(s+="%"),this.style({width:e,height:s}),this.style({display:"flex"})}get isFlex(){return!0}resp(t,e=!0){return this.wrap(e),this.element.clientWidth<t?this.vertical():this.horizontal(),this}setSpaceAround(){return this.style({justifyContent:"space-around"}),this}setSpaceBetween(){return this.style({justifyContent:"space-between"}),this}setBaseline(){return this.style({alignItems:"baseline"}),this}gap(t){return"row"===this.direction?this.style({columnGap:t}):"column"===this.direction&&this.style({rowGap:t}),this}wrap(t="wrap"){return this.style({flexWrap:"string"==typeof t?t:["no-wrap","wrap","wrap-reverse"][+t]}),this}_justifyContent(t="center"){return this.style({justifyContent:t}),this}vertical(t,e,s=1){return cn.call(this,s),this.style({alignItems:"number"==typeof t?mn.call(this,t):t,justifyContent:"number"==typeof e?pn.call(this,e):e}),this}horizontal(t,e,s=1){return un.call(this,s),this.style({alignItems:"number"==typeof e?pn.call(this,e):e,justifyContent:"number"==typeof t?mn.call(this,t):t}),this}show(){return this.isHidden=!1,this.style({display:"flex"}),this}}const ln=(...t)=>{let e="div";return"string"==typeof t[0]&&(e=t[0],t.pop()),new hn(e).append(...t)};function cn(t){return 1==t?this.style({flexDirection:"column"}):-1==t&&this.style({flexDirection:"column-reverse"}),this}function un(t){return 1==t?this.style({flexDirection:"row"}):-1==t&&this.style({flexDirection:"row-reverse"}),this}function mn(t){return"number"==typeof t&&(t=["flex-start","center","flex-end"][t+1]),t}function pn(t){return mn(-t)}var dn=Object.freeze({__proto__:null,Flex:ln,ZikoUIFlex:hn});class fn extends hn{constructor(...t){super("form","Form"),this.append(...t),this.setMethod("POST"),this.setAction("/")}setAction(t="/"){return this.setAttr("action",t),this}setMethod(t="post"){return this.setAttr("method",t),this}get data(){let t=new FormData(this.element);return this.items.forEach((e=>{(e.isInput||e.isSelect||e.isTextarea)&&t.append(e.element.name,e.value)})),t}sendFormData(){return fetch(this.element.action,{method:this.element.method,body:this.data}).then((t=>t.json())).then((t=>console.log(t))).catch((t=>console.error("Error:",t))),this}getByName(t){return this.data.get(t)}}const gn=(...t)=>new fn(...t);var bn=Object.freeze({__proto__:null,Form:gn,ZikoUIForm:fn,ZikoUIInput:$r,ZikoUIInputCheckbox:ti,ZikoUIInputColor:Qr,ZikoUIInputDatalist:en,ZikoUIInputDate:hi,ZikoUIInputDateTime:mi,ZikoUIInputEmail:ii,ZikoUIInputImage:zi,ZikoUIInputNumber:qr,ZikoUIInputOption:tn,ZikoUIInputPassword:oi,ZikoUIInputRadio:si,ZikoUIInputSearch:Gr,ZikoUIInputSlider:Yr,ZikoUIInputTime:ci,ZikoUILabel:Ji,ZikoUISelect:rn,ZikoUITextArea:on,checkbox:ei,datalist:sn,input:Vr,inputCamera:Gi,inputColor:Kr,inputDate:li,inputDateTime:pi,inputEmail:ni,inputImage:Fi,inputNumber:Wr,inputPassword:ai,inputTime:ui,radio:ri,search:Jr,select:nn,slider:Xr,textarea:an});class yn extends hr{constructor(...t){super(),this.element=document?.createElement("Tr"),this.append(...t)}}class vn extends hr{constructor(...t){super(),this.element=document?.createElement("Td"),this.append(...t)}}class wn extends hr{constructor(...t){super(),this.element=document?.createElement("Thead"),this.append(...t)}}class xn extends hr{constructor(...t){super(),this.element=document?.createElement("Tbody"),this.append(...t)}}class _n extends hr{constructor(t){super(),this.element=document?.createElement("Caption"),this.append(t)}}const kn=(...t)=>(t=t.map((t=>(t instanceof hr||(t=br(t)),t))),new vn(...t)),En=t=>new _n(t),In=t=>{var e=new Array(t.rows).fill(null).map((()=>((...t)=>new yn(...t))())),s=t.arr.map((t=>t.map((()=>null))));for(let r=0;r<s.length;r++)for(let i=0;i<s[0].length;i++)s[r][i]=kn(t.arr[r][i]),e[r].append(s[r][i]);return e};class An extends hr{constructor(t,{caption:e=null,head:s=null,foot:r=null}={}){super("table","Table"),this.structure={caption:e,head:s,body:null,foot:r},t&&this.fromMatrix(t),e&&this.setCaption(e)}get isTable(){return!0}get caption(){return this.structure.caption}get header(){}get body(){}get footer(){}setCaption(t){return this.removeCaption(),this.structure.caption=En(t),this.append(this.structure.caption),this}removeCaption(){return this.structure.caption&&this.removeItem(...this.items.filter((t=>t instanceof _n))),this.structure.caption=null,this}setHeader(...t){return this.tHead=((...t)=>(t=t.map((t=>(t instanceof hr||(t=kn(t)),t))),new wn(...UI)))(...t),this.append(this.tHead),this}removeHeader(){return this.removeItem(...this.items.filter((t=>t instanceof _n))),this}setFooter(t){return this.structure.caption=En(t),this.append(this.structure.caption),this}removeFooter(){return this.removeItem(...this.items.filter((t=>t instanceof _n))),this}fromMatrix(t){return this.bodyMatrix=t instanceof Array?mo(t):t,this.structure.body&&this.remove(this.structure.body),this.structure.body=((...t)=>new xn(...t))(),this.append(this.structure.body),this.structure.body.append(...In(this.bodyMatrix)),this}transpose(){return this.fromMatrix(this.bodyMatrix.T),this}hstack(t){return t instanceof An&&(t=t.bodyMatrix),this.fromMatrix(this.bodyMatrix.clone.hstack(t)),this}vstack(t){return t instanceof An&&(t=t.bodyMatrix),this.fromMatrix(this.bodyMatrix.clone.vstack(t)),this}slice(t=0,e=0,s=this.bodyMatrix.rows-1,r=this.bodyMatrix.cols-1){return this.fromMatrix(this.bodyMatrix.slice(t,e,s,r)),this}sortByCols(t,e={type:"num",order:"asc"}){return this.fromMatrix(this.bodyMatrix.clone.sortTable(t,e)),this}sortByRows(t,e={type:"num",order:"asc"}){return this.fromMatrix(this.bodyMatrix.T.clone.sortTable(t,e).T),this}filterByRows(t){return this.fromMatrix(this.bodyMatrix.clone.filterByRows(t)),this}filterByCols(t){return this.fromMatrix(this.bodyMatrix.clone.filterByCols(t)),this}forEachRow(t){return this.structure.body.forEach(t),this}forEachItem(t){return this.structure.body.forEach((e=>e.forEach(t))),this}}const Tn=(t,e)=>new An(t,e);var Cn=Object.freeze({__proto__:null,Table:Tn});class Sn extends hr{constructor(){super("main","Main")}get isMain(){return!0}}class Mn extends hr{constructor(){super("header","Header")}get isHeader(){return!0}}class On extends hr{constructor(){super("nav","Nav")}get isNav(){return!0}}class jn extends hr{constructor(){super("section","Section"),this.style({position:"relative"})}get isSection(){return!0}}class Dn extends hr{constructor(){super("article","Article")}get isArticle(){return!0}}class Un extends hr{constructor(){super("aside","Aside")}get isAside(){return!0}}class Zn extends hr{constructor(){super("footer","Footer"),this.element=document?.createElement("footer")}get isFooter(){return!0}}const Rn=(...t)=>(new jn).append(...t),Ln=(...t)=>(new Dn).append(...t),Pn=(...t)=>(new Sn).append(...t),zn=(...t)=>(new Mn).append(...t),Fn=(...t)=>(new Zn).append(...t),Nn=(...t)=>(new On).append(...t),Bn=(...t)=>(new Un).append(...t);var Hn=Object.freeze({__proto__:null,Article:Ln,Aside:Bn,Footer:Fn,Header:zn,Main:Pn,Nav:Nn,Section:Rn,ZikoUIArticle:Dn,ZikoUIAside:Un,ZikoUIFooter:Zn,ZikoUIHeader:Mn,ZikoUIMain:Sn,ZikoUINav:On,ZikoUISection:jn});class $n extends hr{constructor(t="div",e="50vw",s="50vh"){super(t,"Grid"),this.direction="cols","number"==typeof e&&(e+="%"),"number"==typeof s&&(s+="%"),this.style({border:"1px solid black",width:e,height:s}),this.style({display:"grid"})}get isGird(){return!0}columns(t){let e="";for(let s=0;s<t;s++)e=e.concat(" auto");return this.#g(e),this}#g(t="auto auto"){return this.style({gridTemplateColumns:t}),this}gap(t=10,e=t){return"number"==typeof t&&(t+="px"),"number"==typeof e&&(e+="px"),this.style({gridColumnGap:t,gridRowGap:e}),this}}const Vn=(...t)=>new $n("div").append(...t);const qn={...Zr,...Hr,...bn,...Qi,...Cn,...Hn,...Pi,...dn,...Object.freeze({__proto__:null,Grid:Vn,ZikoUIGrid:$n}),ZikoUIElement:hr},Wn=t=>(new XMLSerializer).serializeToString(t),Yn=t=>btoa(Wn(t)),Xn=t=>"data:image/svg+xml;base64,"+Yn(t),Qn=(t,e=!0)=>Bi(Xn(t)).render(e),Kn=t=>JSON.stringify(k((t=>["number","string","boolean","bigint"].includes(typeof t)?String(t):t instanceof vo||t instanceof uo?t.toString():t instanceof Array?Jn(t):void 0),t),null," ").replace(/"([^"]+)":/g,"$1:").replace(/: "([^"]+)"/g,": $1"),Gn=t=>{if(!Array.isArray(t))return 0;let e=1;for(const s of t)if(Array.isArray(s)){const t=Gn(s);t+1>e&&(e=t+1)}return e},Jn=t=>{let e=0;return function t(s){let r=Gn(s),i=0;return s.some((t=>Array.isArray(t)))&&(e++,i=1),"["+s.map(((r,i)=>["number","string","boolean","bigint"].includes(typeof r)?String(r):r instanceof vo?r.toString():r instanceof Array?`\n${" ".repeat(e)}${t(r)}${i===s.length-1?"\n":""}`:r instanceof Object?Kn(r):void 0))+`${" ".repeat((r+e+1)*i)}]`}(t)},to=(t,e=0)=>{t=eo(t);let s="";const r=" ".repeat(e);for(let i in t)if("object"==typeof t[i]){s+=`${r}${i} {\n`;const n=t[i];for(let t in n)"object"==typeof n[t]?s+=to({[t]:n[t]},e+1):s+=`${r} ${t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}: ${n[t]};\n`;s+=`${r}}\n`}return s};function eo(t){return"object"!=typeof t||null===t?t:Object.keys(t).reduce(((e,s)=>(e[s.trim()]=eo(t[s]),e)),Array.isArray(t)?[]:{})}var so=Object.freeze({__proto__:null,arr2str:Jn,csv2arr:kt,csv2json:At,csv2matrix:Et,csv2object:It,csv2sql:Tt,json2arr:Mt,json2css:to,json2csv:Ot,json2csvFile:jt,json2xml:Lt,json2xmlFile:Pt,json2yml:Zt,json2ymlFile:Rt,obj2str:Kn,svg2ascii:Yn,svg2img:Qn,svg2imgUrl:Xn,svg2str:Wn}),ro=Object.freeze({__proto__:null});const io={isDigit:/^\d+$/,isURL:/^(https?:\/\/)?([\w\-]+\.)+[\w\-]+(\/[\w\-./?%&=]*)?$/,isHexColor:/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/,isIPv4:/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,isMACAddress:/^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$/,isDate:/^\d{4}-\d{2}-\d{2}$/};class no{constructor(t){this.string=t}isDigit(){return io.isDigit.test(this.string)}static isDigit(t){return new no(t).isDigit()}isNumber(){return!isNaN(this.string)}static isNumber(t){return new no(t).isNumber()}isUrl(){return io.isURL.test(this.string)}static isUrl(t){return new no(t).isUrl()}isHexColor(){return io.isHexColor.test(this.string)}static isHexColor(t){return new no(t).isHexColor()}isIPv4(){return io.isIPv4.test(this.string)}static isIPv4(t){return new no(t).isIPv4()}isDate(){return io.isDate.test(this.string)}static isDate(t){return new no(t).isDate()}isMACAddress(){return io.isMACAddress.test(this.string)}static isMACAddress(t){return new no(t).isMACAddress()}isPascalCase(){if(0===this.string.length)return!1;return/^[A-Z][a-zA-Z0-9]*$/.test(this.string)}static isPascalCase(t){return new no(t).isPascalCase()}isCamelCase(){if(0===this.string.length)return!1;return/^[a-z][a-zA-Z0-9]*$/.test(this.string)}static isCamelCase(t){return new no(t).isCamelCase()}isHyphenCase(){return this.string.split("-").length>1}static isHyphenCase(t){return new no(t).isHyphenCase()}isSnakeCase(){return this.string.split("_").length>1}static isSnakeCase(t){return new no(t).isSnakeCase()}isPalindrome(){const t=this.string.toLocaleLowerCase();let e,s=t.length;for(e=0;e<s/2;e++)if(t[e]!=t[s-e-1])return!1;return!0}static isPalindrome(t){return new no(t).isPalindrome()}static isAnagrams(t,e){return t=t.split("").sort(),e=e.split("").sort(),JSON.stringify(t)===JSON.stringify(e)}isIsogram(){return[...new Set(this.string.toLowerCase())].length===this.string.length}static isIsogram(t){return new no(t).isIsogram()}static camel2hyphencase(t){return t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}static camel2snakecase(t){return t.replace(/[A-Z]/g,(t=>"_"+t.toLowerCase()))}static camel2pascalcase(t){return t.charAt(0).toUpperCase()+t.slice(1)}static camel2constantcase(t){return t.replace(/[A-Z]/g,(t=>"_"+t)).toUpperCase()}static pascal2snakecase(t){return t.replace(/([A-Z])/g,((t,e)=>e?"_"+t.toLowerCase():t.toLowerCase()))}static pascal2hyphencase(t){return t.replace(/([A-Z])/g,((t,e)=>e?"-"+t.toLowerCase():t.toLowerCase()))}static pascal2camelcase(t){return t.charAt(0).toLowerCase()+t.slice(1)}static pascal2constantcase(t){return t.replace(/([A-Z])/g,((t,e)=>e?"_"+t:t)).toUpperCase()}static snake2camelcase(t){return t.replace(/(_\w)/g,(t=>t[1].toUpperCase()))}static snake2hyphencase(t){return t.replace(/_/g,"-")}static snake2pascalcase(t){return t.split("_").map((t=>t.charAt(0).toUpperCase()+t.slice(1))).join("")}static snake2constantcase(t){return t.toUpperCase()}static hyphen2camelcase(t){return t.replace(/-([a-z])/g,(t=>t[1].toUpperCase()))}static hyphen2snakecase(t){return t.replace(/-/g,"_")}static hyphen2pascalcase(t){return t.split("-").map((t=>t.charAt(0).toUpperCase()+t.slice(1))).join("")}static hyphen2constantcase(t){return t.replace(/-/g,"_").toUpperCase()}static constant2camelcase(t){return t.toLowerCase().replace(/_([a-z])/g,(t=>t[1].toUpperCase()))}static constant2snakecase(t){return t.toLowerCase()}static constant2pascalcase(t){return t.toLowerCase().split("_").map((t=>t.charAt(0).toUpperCase()+t.slice(1))).join("")}static constant2hyphencase(t){return t.toLowerCase().replace(/_/g,"-")}}const oo=t=>t.replace(/\s+/g," "),ao=(t,e)=>t.split("").filter((t=>t==e)).length,ho=(t,e)=>t.split(" ").filter((t=>t==e)).length,lo=t=>new no(t);const co={..._t,...so,...ro,...Object.freeze({__proto__:null,Str:no,count:ao,countWords:ho,removeExtraSpace:oo,str:lo})};class uo extends _{constructor(t,e,s=[]){if(super(),t instanceof uo)this.arr=t.arr,this.rows=t.rows,this.cols=t.cols;else{let r,i,n=[];if(arguments[0]instanceof Array)t=arguments[0].length,e=arguments[0][0].length,n=arguments[0];else for(r=0;r<t;r++)for(n.push([]),n[r].push(new Array(e)),i=0;i<e;i++)n[r][i]=s[r*e+i],null==s[r*e+i]&&(n[r][i]=0);this.rows=t,this.cols=e,this.arr=n}this._maintain()}toString(){return Jn(this.arr)}at(t=0,e=void 0){return t<0&&(t=this.rows+t),null==e?this.arr[t]:(e<0&&(e=this.cols+e),this.arr[t][e])}reshape(t,e){if(t*e==this.rows*this.cols)return new uo(t,e,this.arr.flat(1));console.error("Err")}static eye(t){let e=new uo(t,t);for(let s=0;s<t;s++)for(let r=0;r<t;r++)e.arr[s][r]=s===r?1:0;return e}get clone(){return new uo(this.rows,this.cols,this.arr.flat(1))}get size(){return this.rows*this.cols}get shape(){return[this.rows,this.cols]}get reel(){return new uo(this.cols,this.rows,this.arr.flat(1).reel)}get imag(){return new uo(this.cols,this.rows,this.arr.flat(1).imag)}_maintain(){for(let t=0;t<this.arr.length;t++)Object.assign(this,{[[t]]:this.arr[t]});return this}get(t=0,e=0){return-1==e?this.arr[t]:-1==t?this.arr.map((t=>t[e])):this.arr[t][e]}set(t=0,e=0,s){if(-1==e)return this.arr[t]=s;if(-1==t){for(let t=0;t<this.cols;t++)this.arr[t][e]=s[t]||0;return this.arr}return this.arr[t][e]=s}get isSquare(){return this.rows/this.cols==1}get isSym(){if(!this.isSquare)return!1;const t=this.T,e=this.clone;return 0==uo.sub(e,t).max&&0==uo.sub(e,t).min}get isAntiSym(){if(!this.isSquare)return!1;const t=this.T,e=this.clone;return 0==uo.add(e,t).max&&0==uo.add(e,t).min}get isDiag(){if(!this.isSquare)return!1;const t=this.T,e=this.clone,s=uo.mul(e,t),r=uo.dot(t,e);return 0==uo.sub(s,r).max&&0==uo.sub(s,r).min}get isOrtho(){return!!this.isSquare&&(this.isDiag&&(1==this.det||-1==this.det))}get isIdemp(){if(!this.isSquare)return!1;const t=this.clone,e=uo.dot(t,t);return 0==uo.sub(e,t).max&&0==uo.sub(e,t).min}get T(){let t=[];for(let e=0;e<this.arr[0].length;e++){t[e]=[];for(let s=0;s<this.arr.length;s++)t[e][s]=this.arr[s][e]}return new uo(this.cols,this.rows,t.flat(1))}get det(){if(!this.isSquare)return new Error("is not square matrix");if(1==this.rows)return this.arr[0][0];function t(t,e){var s=[];for(let e=0;e<t.length;e++)s.push(t[e].slice(0));s.splice(0,1);for(let t=0;t<s.length;t++)s[t].splice(e,1);return s}return function e(s){if(2==s.length)return s.flat(1).some((t=>t instanceof uo))?void console.warn("Tensors are not completely supported yet ..."):it.sub(it.mul(s[0][0],s[1][1]),it.mul(s[0][1],s[1][0]));for(var r=0,i=0;i<s.length;i++){const n=it.add(it.mul(Oo(-1,i),it.mul(s[0][i],e(t(s,i)))));r=it.add(r,n)}return r}(this.arr)}get inv(){if(!this.isSquare)return new Error("is not square matrix");if(0===this.det)return"determinat = 0 !!!";let t=function(t){if(t.length!==t[0].length)return;var e=0,s=0,r=0,i=t.length,n=0,o=[],a=[];for(e=0;e<i;e+=1)for(o[o.length]=[],a[a.length]=[],r=0;r<i;r+=1)o[e][r]=e==r?1:0,a[e][r]=t[e][r];for(e=0;e<i;e+=1){if(0==(n=a[e][e])){for(s=e+1;s<i;s+=1)if(0!=a[s][e]){for(r=0;r<i;r++)n=a[e][r],a[e][r]=a[s][r],a[s][r]=n,n=o[e][r],o[e][r]=o[s][r],o[s][r]=n;break}if(0==(n=a[e][e]))return}for(r=0;r<i;r++)a[e][r]=a[e][r]/n,o[e][r]=o[e][r]/n;for(s=0;s<i;s++)if(s!=e)for(n=a[s][e],r=0;r<i;r++)a[s][r]-=n*a[e][r],o[s][r]-=n*o[e][r]}return o}(this.arr);return new uo(this.rows,this.cols,t.flat(1))}static zeros(t,e){let s=new uo(t,e);for(let i=0;i<t;i++)for(var r=0;r<e;r++)s.arr[i][r]=0;return s}static ones(t,e){let s=new uo(t,e);for(let r=0;r<t;r++)for(let t=0;t<e;t++)s.arr[r][t]=1;return s}static nums(t,e,s){let r=new uo(t,e);for(let i=0;i<t;i++)for(let t=0;t<e;t++)r.arr[i][t]=s;return r}static get rand(){return{int:(t,e,s,r)=>{let i=new uo(t,e);for(let n=0;n<t;n++)for(let t=0;t<e;t++)i.arr[n][t]=pt.randInt(s,r);return i},bin:(t,e)=>{let s=new uo(t,e);for(let r=0;r<t;r++)for(let t=0;t<e;t++)s.arr[r][t]=pt.randBin;return s},hex:(t,e)=>{let s=new uo(t,e);for(let r=0;r<t;r++)for(let t=0;t<e;t++)s.arr[r][t]=pt.randHex;return s},choices:(t,e,s,r)=>{let i=new uo(t,e);for(let n=0;n<t;n++)for(let t=0;t<e;t++)i.arr[n][t]=pt.choice(s,r);return i},permutation:(t,e,s)=>{}}}static rands(t,e,s=1,r){let i=new uo(t,e);for(let n=0;n<t;n++)for(let t=0;t<e;t++)i.arr[n][t]=pt.rand(s,r);return i}map(t,e,s,r){return it.map(this,t,e,s,r)}lerp(t,e){return it.lerp(this,t,e)}norm(t,e){return it.norm(this,t,e)}clamp(t,e){return it.clamp(this,t,e)}static map(t,e,s,r,i){return it.map(t,e,s,r,i)}static lerp(t,e,s){return it.lerp(t,e,s)}static norm(t,e,s){return it.norm(t,e,s)}static clamp(t,e,s){return it.clamp(mo,e,s)}toPrecision(t){for(let e=0;e<this.cols;e++)for(let s=0;s<this.rows;s++)this.arr[e][s]=+this.arr[e][s].toPrecision(t);return this}get toBin(){let t=this.arr.flat(1).toBin;return new uo(this.rows,this.cols,t)}get toOct(){let t=this.arr.flat(1).toOct;return new uo(this.rows,this.cols,t)}get toHex(){let t=this.arr.flat(1).toHex;return new uo(this.rows,this.cols,t)}max2min(){let t=this.arr.flat(1).max2min;return new uo(this.rows,this.cols,t)}min2max(){let t=this.arr.flat(1).min2max;return new uo(this.rows,this.cols,t)}sortRows(t=void 0){let e=this.arr.map((e=>e.sort(t))).flat(1);return new uo(this.rows,this.cols,e)}sortCols(t=void 0){let e=this.T.arr.map((e=>e.sort(t))).flat(1);return new uo(this.rows,this.cols,e).T}filterByRows(t){var e=this.arr.map((e=>e.map((e=>+(""+e).includes(t))))).map((t=>!!Logic.or(...t))),s=this.arr.filter(((t,s)=>!0===e[s]));return 0===s.length&&s.push([]),console.log(s),new uo(s)}filterByCols(t){return new uo(this.T.arr.filter((e=>e.includes(t))))}sortAll(t=void 0){let e=this.arr.flat(1).sort(t);return new uo(this.rows,this.cols,e)}count(t){return this.arr.flat(1).count(t)}toBase(t){let e=this.arr.flat(1).toBase(t);return new uo(this.rows,this.cols,e)}#b(t){if(this.rows!==t.rows)return;let e=this.arr;for(let s=0;s<this.rows;s++)for(let r=this.cols;r<this.cols+t.cols;r++)e[s][r]=t.arr[s][r-this.cols];return this.cols+=t.cols,new uo(this.rows,this.cols,e.flat(1))}hstack(...t){const e=[this,...t].reduce(((t,e)=>t.#b(e)));return Object.assign(this,e),this}static hstack(t,...e){return t.clone.hstack(...e)}#y(t){if(this.cols!==t.cols)return;let e=this.arr;for(let s=this.rows;s<this.rows+t.rows;s++){e[s]=[];for(let r=0;r<this.cols;r++)e[s][r]=t.arr[s-this.rows][r]}return this.rows+=t.rows,new uo(this.rows,this.cols,e.flat(1))}vstack(...t){const e=[this,...t].reduce(((t,e)=>t.#y(e)));return Object.assign(this,e),this}static vstack(t,...e){return t.clone.vstack(...e)}hqueue(...t){const e=[this,...t].reverse().reduce(((t,e)=>t.#b(e)));return Object.assign(this,e),this}vqueue(...t){const e=[this,...t].reverse().reduce(((t,e)=>t.#y(e)));return Object.assign(this,e),this}static hqueue(t,...e){return t.clone.hqueue(...e)}static vqueue(t,...e){return t.clone.vqueue(...e)}slice(t=0,e=0,s=this.rows-1,r=this.cols-1){let i=s-t,n=r-e,o=new Array(n);for(let s=0;s<i;s++){o[s]=[];for(let r=0;r<n;r++)o[s][r]=this.arr[s+t][r+e]}return new uo(i,n,o.flat(1))}static slice(t,e=0,s=0,r=this.rows-1,i=this.cols-1){return t.slice(e,s,r,i)}splice(t,e,s,...r){}getRows(t,e=t+1){return this.slice(t,0,e,this.cols)}getCols(t,e=t+1){return this.slice(0,t,this.rows,e)}static getRows(t,e,s=e+1){return t.slice(e,0,s,t.cols)}static getCols(t,e,s=e+1){return t.slice(0,e,t.rows,s)}add(...t){for(let s=0;s<t.length;s++){("number"==typeof t[s]||t[s]instanceof vo)&&(t[s]=uo.nums(this.rows,this.cols,t[s]));for(let r=0;r<this.rows;r++)for(var e=0;e<this.cols;e++)this.arr[r][e]=it.add(this.arr[r][e],t[s].arr[r][e])}return new uo(this.rows,this.cols,this.arr.flat(1))}sub(...t){for(let s=0;s<t.length;s++){"number"==typeof t[s]&&(t[s]=uo.nums(this.rows,this.cols,t[s]));for(let r=0;r<this.rows;r++)for(var e=0;e<this.cols;e++)this.arr[r][e]=it.sub(this.arr[r][e],t[s].arr[r][e])}return new uo(this.rows,this.cols,this.arr.flat(1))}static add(t,...e){return t.clone.add(...e)}static sub(t,...e){return t.clone.sub(...e)}mul(...t){for(let r=0;r<t.length;r++){"number"==typeof t[r]&&(t[r]=uo.nums(this.rows,this.cols,t[r]));for(var e=0;e<this.rows;e++)for(var s=0;s<this.cols;s++)this.arr[e][s]=it.mul(this.arr[e][s],t[r].arr[e][s])}return new uo(this.rows,this.cols,this.arr.flat(1))}div(...t){for(let s=0;s<t.length;s++){"number"==typeof t[s]&&(t[s]=uo.nums(this.rows,this.cols,t[s]));for(let r=0;r<this.rows;r++)for(var e=0;e<this.cols;e++)this.arr[r][e]=it.div(this.arr[r][e],t[s].arr[r][e])}return new uo(this.rows,this.cols,this.arr.flat(1))}static div(t,...e){return t.clone.div(...e)}static mul(t,...e){return t.clone.mul(...e)}modulo(...t){for(let s=0;s<t.length;s++){"number"==typeof t[s]&&(t[s]=uo.nums(this.rows,this.cols,t[s]));for(let r=0;r<this.rows;r++)for(var e=0;e<this.cols;e++)this.arr[r][e]=it.modulo(this.arr[r][e],t[s].arr[r][e])}return new uo(this.rows,this.cols,this.arr.flat(1))}static modulo(t,...e){return t.clone.modulo(...e)}dot(t){for(var e=[],s=0;s<this.arr.length;s++){e[s]=[];for(var r=0;r<t.arr[0].length;r++){e[s][r]=0;for(var i=0;i<this.arr[0].length;i++)e[s][r]=it.add(e[s][r],it.mul(this.arr[s][i],t.arr[i][r]))}}return new uo(this.arr.length,t.arr[0].length,e.flat(1))}static dot(t,e){return t.dot(e)}pow(t){let e=this.clone,s=this.clone;for(let r=0;r<t-1;r++)s=s.dot(e);return s}static pow(t,e){return t.clone.pow(e)}get somme(){let t=0;for(let e=0;e<this.rows;e++)for(let s=0;s<this.cols;s++)t+=this.arr[e][s];return t}get DoesItContainComplexNumbers(){return this.arr.flat(1/0).some((t=>t instanceof vo))}get min(){this.DoesItContainComplexNumbers&&console.error("Complex numbers are not comparable");let t=[];for(let e=0;e<this.rows;e++)t.push(Q(...this.arr[e]));return Q(...t)}get max(){this.DoesItContainComplexNumbers&&console.error("Complex numbers are not comparable");let t=[];for(let e=0;e<this.rows;e++)t.push(K(...this.arr[e]));return K(...t)}get minRows(){this.DoesItContainComplexNumbers&&console.error("Complex numbers are not comparable");let t=[];for(let e=0;e<this.rows;e++)t.push(Q(...this.arr[e]));return t}get maxRows(){this.DoesItContainComplexNumbers&&console.error("Complex numbers are not comparable");let t=[];for(let e=0;e<this.rows;e++)t.push(K(...this.arr[e]));return t}get minCols(){return this.DoesItContainComplexNumbers&&console.error("Complex numbers are not comparable"),this.T.minRows}get maxCols(){return this.DoesItContainComplexNumbers&&console.error("Complex numbers are not comparable"),this.T.maxRows}static fromVector(t){return new uo(t.length,1,t)}get toArray(){let t=[];for(let e=0;e<this.rows;e++)for(let s=0;s<this.cols;s++)t.push(this.arr[e][s]);return t}get print(){let t="[";for(let e=0;e<this.arr.length;e++)t+=(0!=e?" ":"")+` [${this.arr[e].map((t=>" "+t.toString()+" "))}],\n`;console.log(t.substring(0,t.length-2)+" ]"),document.write(t.substring(0,t.length-2)+" ]")}get table(){console.table(this.arr)}get serialize(){return JSON.stringify(this)}static deserialize(t){"string"==typeof t&&(t=JSON.parse(t));let e=new uo(t.rows,t.cols);return e.arr=t.arr,e}DecompositionLU(){const[t,e]=ft(this);return{L:t,U:e}}static DecompositionLU(...t){const e=t.map((t=>t.clone.LU()));return 1===e.length?e[0]:e}DecompositionQR(){const[t,e]=vt(this);return{Q:t,R:e}}static DecompositionQR(...t){const e=t.map((t=>t.clone.DecompositionQr()));return 1===e.length?e[0]:e}DecompositionCholesky(){return{L:wt(this)}}static DecompositionCholesky(...t){const e=t.map((t=>t.clone.DecompositionCholesky()));return 1===e.length?e[0]:e}get decomposition(){return{LU:()=>this.DecompositionLU(),QR:()=>this.DecompositionQR(),Cholesky:()=>this.DecompositionCholesky()}}static get decomposition(){return{LU:(...t)=>uo.LU(...t),QR:(...t)=>uo.QR(...t),CHOLESKY:(...t)=>uo.CHOLESKY(...t)}}toTable(){var t=new DocumentFragment,e=new Array(this.rows).fill(null).map((()=>document?.createElement("tr"))),s=this.arr.map((t=>t.map((()=>document?.createElement("td")))));for(let t=0;t<s.length;t++)for(let r=0;r<s[0].length;r++)s[t][r].innerHTML=this.arr[t][r],e[t].appendChild(s[t][r]);return e.map((e=>t.appendChild(e))),t}toGrid(t,e={}){let s=Grid();return s.append(...this.map(t).arr.flat(1).map((t=>t.style(e)))),s.Columns(this.cols),s}sortTable(t=0,{type:e="num",order:s="asc"}={}){var r=this.T.arr.map((t=>t.map(((t,e)=>Object.assign({},{x:t,y:e}))))),i=this.T.arr.map((t=>t.map(((t,e)=>Object.assign({},{x:t,y:e})))));"num"===e?"asc"===s?r[t].sort(((t,e)=>t.x-e.x)):"desc"===s?r[t].sort(((t,e)=>e.x-t.x)):"toggle"===s&&(r[t][0].x>r[t][1].x?r[t].sort(((t,e)=>e.x-t.x)):r[t].sort(((t,e)=>t.x-e.x))):"alpha"===e&&("asc"===s?r[t].sort(((t,e)=>(""+t.x).localeCompare(""+e.x))):"desc"===s&&r[t].sort(((t,e)=>(""+e.x).localeCompare(""+t.x)))),s=r[t].map((t=>t.y));for(let e=0;e<r.length;e++)e!==t&&r[e].map(((t,e)=>t.y=s[e]));for(let e=0;e<r.length;e++)e!==t&&i[e].map(((t,i)=>t.x=r[e][s[i]].x));i[t]=r[t];var n=i.map((t=>t.map((t=>t.x))));return new uo(n).T}}const mo=(t,e,s)=>new uo(t,e,s),po=(...t)=>new uo(2,2,t),fo=(...t)=>new uo(3,3,t),go=(...t)=>new uo(4,4,t);class bo{static resolve(t,e){return t.inv.dot(uo.fromVector(e)).arr.flat(1).map((t=>+t.toFixed(10)))}}var yo=Object.freeze({__proto__:null,LinearSystem:bo,Matrix:uo,choleskyDecomposition:wt,luDecomposition:ft,matrix:mo,matrix2:po,matrix3:fo,matrix4:go,qrDecomposition:vt});class vo extends _{constructor(t=0,e=0){super(),t instanceof vo?(this.a=t.a,this.b=t.b):"object"==typeof t?"a"in e&&"b"in t?(this.a=t.a,this.b=t.b):"a"in e&&"z"in t?(this.a=t.a,this.b=Mo(t.z**2-t.a**2)):"a"in e&&"phi"in t?(this.a=t.a,this.b=t.a*Lo(t.phi)):"b"in e&&"z"in t?(this.b=t.b,this.a=Mo(t.z**2-t.b**2)):"b"in e&&"phi"in t?(this.b=e,this.a=t.b/Lo(t.phi)):"z"in e&&"phi"in t&&(this.a=t.z*Zo(t.phi),this.a=t.z*Ro(t.phi)):"number"==typeof t&&"number"==typeof e&&(this.a=+t.toFixed(32),this.b=+e.toFixed(32))}toString(){let t="";return t=0!==this.a?this.b>=0?`${this.a}+${this.b}*i`:`${this.a}-${Math.abs(this.b)}*i`:this.b>=0?`${this.b}*i`:`-${Math.abs(this.b)}*i`,t}get clone(){return new vo(this.a,this.b)}get z(){return oa(this.a,this.b)}get phi(){return sa(this.b,this.a)}static Zero(){return new vo(0,0)}get conj(){return new vo(this.a,-this.b)}get inv(){return new vo(this.a/(Oo(this.a,2)+Oo(this.b,2)),-this.b/(Oo(this.a,2)+Oo(this.b,2)))}add(...t){for(let e=0;e<t.length;e++)"number"==typeof t[e]&&(t[e]=new vo(t[e],0));let e=t.map((t=>t.a)),s=t.map((t=>t.b));return this.a+=+Y(...e).toFixed(15),this.b+=+Y(...s).toFixed(15),this}sub(...t){for(let e=0;e<t.length;e++)"number"==typeof t[e]&&(t[e]=new vo(t[e],0));let e=t.map((t=>t.a)),s=t.map((t=>t.b));return this.a-=+Y(...e).toFixed(15),this.b-=+Y(...s).toFixed(15),this}mul(...t){for(let e=0;e<t.length;e++)"number"==typeof t[e]&&(t[e]=new vo(t[e],0));let e=+X(this.z,...t.map((t=>t.z))).toFixed(15),s=+Y(this.phi,...t.map((t=>t.phi))).toFixed(15);return this.a=+(e*Zo(s).toFixed(15)).toFixed(14),this.b=+(e*Ro(s).toFixed(15)).toFixed(14),this}div(...t){for(let e=0;e<t.length;e++)"number"==typeof t[e]&&(t[e]=new vo(t[e],0));let e=+(this.z/X(...t.map((t=>t.z)))).toFixed(15),s=+(this.phi-Y(...t.map((t=>t.phi)))).toFixed(15);return this.a=+(e*Zo(s).toFixed(15)).toFixed(15),this.b=+(e*Ro(s).toFixed(15)).toFixed(15),this}pow(t){if(ta(t)===t&&t>0){let e=+(this.z**t).toFixed(15),s=+(this.phi*t).toFixed(15);this.a=+(e*Zo(s).toFixed(15)).toFixed(15),this.b=+(e*Ro(s).toFixed(15)).toFixed(15)}return this}static fromExpo(t,e){return new vo(+(t*Zo(e)).toFixed(13),+(t*Ro(e)).toFixed(13))}get expo(){return[this.z,this.phi]}static add(t,...e){return t.clone.add(...e)}static sub(t,...e){return t.clone.sub(...e)}static mul(t,...e){return t.clone.mul(...e)}static div(t,...e){return t.clone.div(...e)}static pow(t,e){return t.clone.pow(e)}static xpowZ(t){return wo(t**this.a*Zo(this.b*Uo(t)),t**this.a*Ro(this.b*Uo(t)))}sqrtn(t=2){return wo(jo(this.z,t)*Zo(this.phi/t),jo(this.z,t)*Ro(this.phi/t))}get sqrt(){return this.sqrtn(2)}get log(){return wo(this.z,this.phi)}get cos(){return wo(Zo(this.a)*qo(this.b),Ro(this.a)*Wo(this.b))}get sin(){return wo(Ro(this.a)*qo(this.b),Zo(this.a)*Wo(this.b))}get tan(){const t=Zo(2*this.a)+qo(2*this.b);return wo(Ro(2*this.a)/t,Wo(2*this.b)/t)}printInConsole(){let t=this.a+" + "+this.b+" * i";return console.log(t),t}print(){}UI(){return"<span>"+this.a+" + i * "+this.b+"</span>"}}const wo=(t,e)=>{if((t instanceof Array||ArrayBuffer.isView(t))&&(e instanceof Array||ArrayBuffer.isView(t)))return t.map(((s,r)=>wo(t[r],e[r])));if(t instanceof uo&&e instanceof uo){if(t.shape[0]!==e.shape[0]||t.shape[1]!==e.shape[1])return Error(0);const s=t.arr.map(((s,r)=>wo(t.arr[r],e.arr[r])));return new uo(t.rows,t.cols,...s)}return new vo(t,e)};var xo=Object.freeze({__proto__:null,Complex:vo,complex:wo});const _o=t=>{const e=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7];if(t<.5)return+(Math.PI/(Math.sin(Math.PI*t)*_o(1-t))).toFixed(10);t-=1;let s=e[0];for(let r=1;r<9;r++)s+=e[r]/(t+r);const r=t+7+.5;return+(Math.sqrt(2*Math.PI)*Math.pow(r,t+.5)*Math.exp(-r)*s).toFixed(10)},ko=(...t)=>k(_o,...t),Eo=(t,e)=>{let s=0;for(let r=0;r<100;r++){s+=Math.pow(-1,r)*Math.pow(e/2,t+2*r)/(ra(r)*ra(t+r))}return s},Io=(t,e)=>{if("number"==typeof t){if("number"==typeof t)return Eo(t,e);console.warn("Not supported yet")}else if(t instanceof Array){if("number"==typeof e)return k((t=>Eo(t,e)),...t);if(e instanceof Array){const s=[];for(let r=0;r<t.length;r++)s.push(k((e=>Eo(t[r],e)),...e));return s}}},Ao=(t,e)=>{let s=0;const r=s=>Math.pow(s,t-1)*Math.pow(1-s,e-1);s+=.5*(r(0)+r(1));for(let t=1;t<1e3;t++){s+=r(0+.001*t)}return.001*s},To=(t,e)=>{if("number"==typeof t){if("number"==typeof t)return Ao(t,e);console.warn("Not supported yet")}else if(t instanceof Array){if("number"==typeof e)return k((t=>Ao(t,e)),...t);if(e instanceof Array){const s=[];for(let r=0;r<t.length;r++)s.push(k((e=>Ao(t[r],e)),...e));return s}}};var Co=Object.freeze({__proto__:null,bessel:Io,beta:To,gamma:ko});const So=(...t)=>k(Math.abs,...t),Mo=(...t)=>k(Math.sqrt,...t),Oo=(t,e)=>{if("number"==typeof t)return"number"==typeof e?Math.pow(t,e):e instanceof vo?vo.fromExpo(t**e.a,e.b*Uo(t)):k((e=>Oo(t,e)),...e);if(t instanceof vo)return"number"==typeof e?vo.fromExpo(t.z**e,t.phi*e):e instanceof vo?vo.fromExpo(t.z**e.a*Do(-t.phi*e.b),Uo(t.z)*e.b+e.a*t.phi):k((e=>Oo(t,e)),...e);if(t instanceof Array){if("number"==typeof e)return k((t=>Oo(t,e)),...t);if(e instanceof Array){const s=[];for(let r=0;r<t.length;r++)s.push(k((e=>Oo(t[r],e)),...e));return s}}},jo=(t,e)=>{if("number"==typeof t)return"number"==typeof e?Math.pow(t,1/e):k((e=>jo(t,e)),...e);if(t instanceof vo)return"number"==typeof e?vo.fromExpo(jo(t.z,e),t.phi/e):k((e=>jo(t,e)),...e);if(t instanceof Array){if("number"==typeof e)return k((t=>jo(t,e)),...t);if(e instanceof Array){const s=[];for(let r=0;r<t.length;r++)s.push(k((e=>jo(t[r],e)),...e));return s}}},Do=(...t)=>k(Math.exp,...t),Uo=(...t)=>k(Math.log,...t),Zo=(...t)=>k(x.cos,...t),Ro=(...t)=>k(x.sin,...t),Lo=(...t)=>k(x.tan,...t),Po=(...t)=>k(x.sec,...t),zo=(...t)=>k(x.sinc,...t),Fo=(...t)=>k(x.csc,...t),No=(...t)=>k(x.cot,...t),Bo=(...t)=>k(x.acos,...t),Ho=(...t)=>k(x.asin,...t),$o=(...t)=>k(x.atan,...t),Vo=(...t)=>k(x.acot,...t),qo=(...t)=>k(x.cosh,...t),Wo=(...t)=>k(x.sinh,...t),Yo=(...t)=>k(x.tanh,...t),Xo=(...t)=>k(x.coth,...t),Qo=(...t)=>k(x.acosh,...t),Ko=(...t)=>k(x.asinh,...t),Go=(...t)=>k(x.atanh,...t),Jo=(...t)=>k(Math.ceil,...t),ta=(...t)=>k(Math.floor,...t),ea=(...t)=>k(Math.round,...t),sa=(t,e,s=!0)=>{if("number"==typeof t)return"number"==typeof e?s?Math.atan2(t,e):180*Math.atan2(t,e)/Math.PI:k((e=>sa(t,e,s)),...e);if(t instanceof Array){if("number"==typeof e)return k((t=>sa(t,e,s)),...t);if(e instanceof Array){const s=[];for(let r=0;r<t.length;r++)s.push(k((e=>Oo(t[r],e)),...e));return s}}},ra=(...t)=>k((t=>{let e,s=1;if(0==t)s=1;else if(t>0)for(e=1;e<=t;e++)s*=e;else s=NaN;return s}),...t),ia=(...t)=>k(Math.sign,...t),na=(...t)=>k((t=>1/(1+Do(-t))),...t),oa=(...t)=>t.every((t=>"number"==typeof t))?Math.hypot(...t):t.every((t=>t instanceof Array))?k(Math.hypot,...t):void 0;const aa={...i,...Object.freeze({__proto__:null,abs:So,acos:Bo,acosh:Qo,acot:Vo,asin:Ho,asinh:Ko,atan:$o,atan2:sa,atanh:Go,bessel:Io,beta:To,ceil:Jo,cos:Zo,cosh:qo,cot:No,coth:Xo,csc:Fo,e:Do,fact:ra,floor:ta,gamma:ko,hypot:oa,ln:Uo,max:K,min:Q,pow:Oo,round:ea,sec:Po,sig:na,sign:ia,sin:Ro,sinc:zo,sinh:Wo,sqrt:Mo,sqrtn:jo,tan:Lo,tanh:Yo}),...xo,...yo,...dt,...nt,...mt,...Co};class ha extends hr{constructor(t=360,e=300){super("svg","svg"),this.style({border:"1px black solid"}),this.size(t,e),this.view(-10,-10,10,10)}size(t,e){return this.setAttr({width:t,height:e}),this}view(t,e,s,r){let i=Math.abs(s-t),n=Math.abs(r-e);return this.setAttr("viewBox",[t,e,i,n].join(" ")),this.st.scaleY(-1),this}add(...t){for(let e=0;e<t.length;e++)this.element.append(t[e].element),this.items.push(t[e]);return this.maintain(),this}remove(...t){for(let e=0;e<t.length;e++)this.element?.removeChild(t[e].element),this.items=this.items.filter((e=>!t));return this.maintain(),this}mask(){}toString(){return(new XMLSerializer).serializeToString(this.element)}btoa(){return btoa(this.toString())}toImg(){return"data:image/svg+xml;base64,"+this.btoa()}toImg2(){return"data:image/svg+xml;charset=utf8,"+this.toString().replaceAll("<","%3C").replaceAll(">","%3E").replaceAll("#","%23").replaceAll('"',"'")}}const la=(t,e)=>new ha(t,e);var ca=Object.freeze({__proto__:null,Svg:la,ZikoUISvg:ha});class ua extends hr{constructor(t,e){super("canvas","canvas"),this.ctx=this.element?.getContext("2d"),this.style({border:"1px red solid"}),this.transformMatrix=new uo([[1,0,0],[0,1,0],[0,0,1]]),this.axisMatrix=new uo([[-10,-10],[10,10]]),requestAnimationFrame((()=>this.resize(t,e)),0),this.on("sizeupdated",(()=>this.adjust()))}get Xmin(){return this.axisMatrix[0][0]}get Ymin(){return this.axisMatrix[0][1]}get Xmax(){return this.axisMatrix[1][0]}get Ymax(){return this.axisMatrix[1][1]}get ImageData(){return this.ctx.getImageData(0,0,c.Width,c.Height)}draw(t=!0){return t?(this.clear(),this.items.forEach((t=>{t.parent=this,t.draw(this.ctx)}))):(this.items.at(-1).parent=this,this.items.at(-1).draw(this.ctx)),this.maintain(),this}applyTransformMatrix(){return this.ctx.setTransform(this.transformMatrix[0][0],this.transformMatrix[1][0],this.transformMatrix[0][1],this.transformMatrix[1][1],this.transformMatrix[0][2],this.transformMatrix[1][2]),this}resize(t,e){return this.size(t,e),this.lineWidth(),this.view(this.axisMatrix[0][0],this.axisMatrix[0][1],this.axisMatrix[1][0],this.axisMatrix[1][1]),this.emit("sizeupdated"),this}adjust(){return this.element.width=this.element?.getBoundingClientRect().width,this.element.height=this.element?.getBoundingClientRect().height,this.view(this.axisMatrix[0][0],this.axisMatrix[0][1],this.axisMatrix[1][0],this.axisMatrix[1][1]),this}view(t,e,s,r){return this.transformMatrix[0][0]=this.width/(s-t),this.transformMatrix[1][1]=-this.height/(r-e),this.transformMatrix[0][2]=this.width/2,this.transformMatrix[1][2]=this.height/2,this.axisMatrix=new uo([[t,e],[s,r]]),this.applyTransformMatrix(),this.clear(),this.lineWidth(1),this.draw(),this}reset(){return this.ctx.setTransform(1,0,0,0,0,0),this}append(t){return this.items.push(t),this.draw(!1),this}background(t){this.ctx.fillStyle=t,this.ctx.setTransform(1,0,0,1,0,0),this.ctx.fillRect(0,0,this.width,this.height),this.applyTransformMatrix(),this.draw()}lineWidth(t){return this.ctx.lineWidth=t/this.transformMatrix[0][0],this}getImageData(t=0,e=0,s=this.width,r=this.height){return this.ctx.getImageData(t,e,s,r)}clear(){return this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.width,this.height),this.applyTransformMatrix(),this}clone(){console.log(this.width);const t=new ua;return t.items=this.items,t.transformMatrix=this.transformMatrix,t.axisMatrix=this.axisMatrix,Object.assign(t.cache,{...this.cache}),this.size(this.element.style.width,this.element.style.width),this.applyTransformMatrix(),this.draw(),this.adjust(),t}toImage(){return this.img=document?.createElement("img"),this.img.src=this.element?.toDataURL("image/png"),this}toBlob(){this.element.toBlob((function(t){var e=document?.createElement("img"),s=URL.createObjectURL(t);e.onload=function(){URL.revokeObjectURL(s)},e.src=s,console.log(e)}))}zoomIn(){}zoomOut(){}undo(t){}redo(t){}stream(){}}const ma=(t,e)=>new ua(t,e);const pa={...ca,...Object.freeze({__proto__:null,Canvas:ma,ZikoUICanvas:ua})};class da{constructor(t,e=!0){this.#i(),this.cache={Emitter:null},e&&this.useEventEmitter(),this.set(t)}#i(){return this.__FavIcon__=document.querySelector("link[rel*='icon']")||document?.createElement("link"),this.__FavIcon__.type="image/x-icon",this.__FavIcon__.rel="shortcut icon",this}set(t){return t!==this.__FavIcon__.href&&(this.__FavIcon__.href=t,this.cache.Emitter&&this.cache.Emitter.emit("ziko:favicon-changed")),this}get current(){return document.__FavIcon__.href}onChange(t){return this.cache.Emitter&&this.cache.Emitter.on("ziko:favicon-changed",t),this}useEventEmitter(){return this.cache.Emitter=Ms(),this}}class fa{constructor({viewport:t,charset:e,description:s,author:r,keywords:i}){this.document=globalThis?.document,this.meta={},this.init({viewport:t,charset:e,description:s,author:r,keywords:i})}init({viewport:t,charset:e,description:s,author:r,keywords:i}){t&&this.setViewport(t),e&&this.setCharset(e),s&&this.describe(s),r&&this.setAuthor(r),i&&this.setKeywords(i)}set(t,e){const s="charset"===(t=t.toLowerCase()),r=s?document.querySelector("meta[charset]"):document.querySelector(`meta[name=${t}]`);return this.meta=r??document?.createElement("meta"),s?this.meta.setAttribute("charset",e):(this.meta.setAttribute("name",t),this.meta.setAttribute("content",e)),r||this.document.head.append(this.meta),this}setCharset(t="utf-8"){return this.set("charset",t),this}describe(t){return this.set("description",t),this}setViewport(t="width=device-width, initial-scale=1.0"){return this.set("viewport",t),this}setKeywords(...t){return t=[...new Set(t)].join(", "),this.set("keywords",t),this}setAuthor(t){return this.set("author",t),this}}class ga{constructor(t=document.title,e=!0){this.cache={Emitter:null},e&&this.useEventEmitter(),this.set(t)}useEventEmitter(){return this.cache.Emitter=Ms(),this}set(t){return t!==document.title&&(document.title=t,this.cache.Emitter&&this.cache.Emitter.emit("ziko:title-changed")),this}get current(){return document.title}onChange(t){return this.cache.Emitter&&this.cache.Emitter.on("ziko:title-changed",t),this}}class ba{constructor({title:t,lang:e,icon:s,meta:r,noscript:i}){this.html=globalThis?.document?.documentElement,this.head=globalThis?.document?.head,t&&((t,e)=>{new ga(t,e)})(t),e&&this.setLang(e),s&&((t,e)=>{new da(t,e)})(s),r&&(({viewport:t,charset:e,description:s,author:r,keywords:i})=>{new fa({viewport:t,charset:e,description:s,author:r,keywords:i})})(r),i&&this.setNoScript()}setLang(t){this.html.setAttribute("lang",t)}setNoScript(t){}}class ya{constructor({head:t=null,wrapper:e=null,target:s=null}){this.head=t,this.wrapper=e,this.target=s,this.init()}get isZikoApp(){return!0}init(){this.head&&this.setHead(this.head),this.wrapper&&this.setWrapper(this.wrapper),this.target&&this.setTarget(this.target),this.wrapper&&this.target&&this.wrapper.render(this.target)}setTarget(t){return t instanceof HTMLElement?this.target=t:"string"==typeof t&&(this.target=globalThis?.document?.querySelector(t)),this}setWrapper(t){return t?.isZikoUIElement?this.wrapper=t:"function"==typeof t&&(this.wrapper=t()),this}setHead(t){return this.head=t instanceof ba?t:(({title:t,lang:e,icon:s,meta:r,noscript:i})=>new ba({title:t,lang:e,icon:s,meta:r,noscript:i}))(t),this}}const va=({head:t,wrapper:e,target:s})=>new ya({head:t,wrapper:e,target:s});var wa=Object.freeze({__proto__:null,App:va,ZikoApp:ya});class xa{constructor(t={}){this.cache={JsonStyle:t,isRenderd:!1},this.target=globalThis?.document?.head,this.element=document.createElement("style"),this.element.setAttribute("data-generator","zikojs"),this.write(),this.render()}get CssText(){return to(this.cache.JsonStyle)}render(){return this.target.append(this.element),this.cache.isRenderd=!0,this}unrender(){return this.target?.children?.length&&[...this.target?.children].includes(this.element)&&this.target.removeChild(this.element),this.cache.isRenderd=!1,this}write(){return this.element.textContent=this.CssText,this}style(t,e=!1){return e&&this.clear(),Object.assign(this.cache.JsonStyle,t),this.write(),this}clear(){return this.cache.JsonStyle={},this.write(),this}}const _a=t=>new xa(t);var ka=Object.freeze({__proto__:null,ZikoJsonStyleSheet:xa,jsonStyleSheet:_a});function Ea(t){return/:\w+/.test(t)}class Ia extends ya{constructor({head:t,wrapper:e,target:s,routes:r}){super({head:t,wrapper:e,target:s}),this.routes=new Map([["404",br("Error 404")],...Object.entries(r)]),this.clear(),globalThis.onpopstate=this.render(location.pathname)}clear(){return[...this.routes].forEach((t=>{!Ea(t[0])&&t[1]?.isZikoUIElement&&t[1].unrender()})),this}render(t){const[e,s]=[...this.routes].find((e=>function(t,e){const s=t.split("/"),r=e.split("/");if(s.length!==r.length)return!1;for(let t=0;t<s.length;t++){const e=s[t],i=r[t];if(!e.startsWith(":")&&e!==i)return!1}return!0}(e[0],t)));let r;if(Ea(e)){const i=function(t,e){const s=t.split("/"),r=e.split("/"),i={};if(s.length!==r.length)return i;for(let t=0;t<s.length;t++){const e=s[t],n=r[t];if(e.startsWith(":"))i[e.slice(1)]=n;else if(e!==n)return{}}return i}(e,t);r=s.call(this,i)}else s?.isZikoUIElement&&s.render(this.wrapper),"function"==typeof s&&(r=s());return r?.isZikoUIElement&&r.render(this.wrapper),r instanceof Promise&&r.then((t=>t.render(this.wrapper))),globalThis.history.pushState({},"",t),this}}const Aa=({head:t,wrapper:e,target:s,routes:r})=>new Ia({head:t,wrapper:e,target:s,routes:r});var Ta=Object.freeze({__proto__:null,SPA:Aa,ZikoSPA:Ia});function Ca(t){Object.defineProperties(t,{QueryParams:{get:function(){return function(t){const e={};return t.replace(/[A-Z0-9]+?=([\w|:|\/\.]*)/gi,(t=>{const[s,r]=t.split("=");e[s]=r})),e}(globalThis.location.search.substring(1))},configurable:!1,enumerable:!0},HashParams:{get:function(){return globalThis.location.hash.substring(1).split("#")},configurable:!1,enumerable:!0}})}const Sa={__all__(){return Object.values(this).filter(Array.isArray).flat()},querySelectorAll(){return this.__all__().filter((t=>t))},getElementByIndex(t){return this.__all__().find((e=>e.ui_index===t))},getElementById:t=>null,getElementsByClass(){},getElementsByTagName(){}},Ma=new Map,Oa={default:{target:null,render:!0,math:{mode:"deg"}},setDefault:function(t){const e=Object.keys(t),s=Object.values(t);for(let t=0;t<e.length;t++)this.default[e[t]]=s[t]},init:()=>document.documentElement.setAttribute("data-engine","zikojs"),renderingMode:"spa",isSSC:!1},ja={ui_index:0,get_ui_index:function(){return this.ui_index++}};function Da(t,e="./src/pages",s=["js","ts"]){"/"===e.at(-1)&&(e=e.slice(0,-1));const r=t.replace(/\\/g,"/").replace(/\[(\w+)\]/g,"$1/:$1").split("/"),i=e.split("/"),n=r.indexOf(i[i.length-1]);if(-1!==n){const t=r.slice(n+1),e=t[t.length-1],i="index.js"===e||"index.ts"===e,o=s.some((t=>e===`.${t}`||e.endsWith(`.${t}`)));if(i)return"/"+(t.length>1?t.slice(0,-1).join("/"):"");if(o)return"/"+t.join("/").replace(/\.(js|ts)$/,"")}return""}const Ua={...wa,...ka,...Ta,...Object.freeze({__proto__:null,__CACHE__:ja,__Config__:Oa,__HYDRATION_MAP__:Ma,__UI__:Sa})};[Ua,aa,qn,Cs,co,ar,pa].forEach((t=>Object.assign(t,{ExtractAll:()=>(t=>{const e=Object.keys(t);for(let s=0;s<e.length;s++){const r=e[s];["__ExtractAll__","__RemoveAll__","ExtractAll","RemoveAll"].includes(r)||(globalThis[r]=t[r])}})(t),RemoveAll:()=>(t=>{const e=Object.keys(t);for(let t=0;t<e.length;t++){const s=e[t];"__RemoveAll__"!==s&&delete globalThis[s]}})(t)})));const Za={App:Ua,Math:aa,UI:qn,Time:Cs,Data:co,Reactivity:ar,Graphics:pa};globalThis.__Ziko__?console.warn("WARNING: Multiple instances of Ziko.js being imported."):(globalThis.__Ziko__={...Za,__UI__:Sa,__HYDRATION_MAP__:Ma,__Config__:Oa,__CACHE__:ja,ExtractAll:function(){return qn.ExtractAll(),aa.ExtractAll(),Cs.ExtractAll(),ar.ExtractAll(),pa.ExtractAll(),co.ExtractAll(),this},RemoveAll:function(){qn.RemoveAll(),aa.RemoveAll(),Cs.RemoveAll(),ar.RemoveAll(),pa.RemoveAll(),co.RemoveAll()}},Ca(__Ziko__)),globalThis?.document&&document?.addEventListener("DOMContentLoaded",__Ziko__.__Config__.init()),t.App=va,t.Article=Ln,t.Aside=Bn,t.Base=at,t.Canvas=ma,t.Combinaison=ct,t.Complex=vo,t.E=s,t.EPSILON=r,t.Ease=ys,t.FileBasedRouting=async function(t){const e=Object.keys(t),s=function(t){if(0===t.length)return"";const e=t.map((t=>t.split("/"))),s=Math.min(...e.map((t=>t.length)));let r=[];for(let t=0;t<s;t++){const s=e[0][t];if(!e.every((e=>e[t]===s||e[t].startsWith("["))))break;r.push(s)}return r.join("/")+(r.length?"/":"")}(e),r={};for(let i=0;i<e.length;i++){const n=await t[e[i]](),o=await n.default;Object.assign(r,{[Da(e[i],s)]:o})}return Aa({target:document.body,routes:{"/":()=>{},...r},wrapper:Rn()})},t.Flex=ln,t.Footer=Fn,t.Form=gn,t.Grid=Vn,t.HTMLWrapper=bi,t.Header=zn,t.LinearSystem=bo,t.Logic=ht,t.Main=Pn,t.Matrix=uo,t.Nav=Nn,t.PI=e,t.Permutation=lt,t.Random=pt,t.SPA=Aa,t.SVGWrapper=yi,t.Section=Rn,t.Str=no,t.Suspense=wi,t.Svg=la,t.Table=Tn,t.Utils=it,t.ZikoApp=ya,t.ZikoCustomEvent=qe,t.ZikoEvent=Ht,t.ZikoEventClick=qt,t.ZikoEventClipboard=je,t.ZikoEventHash=He,t.ZikoEventInput=Fe,t.ZikoEventKey=ye,t.ZikoEventMouse=re,t.ZikoEventPointer=ee,t.ZikoEventSwipe=Ye,t.ZikoEventWheel=pe,t.ZikoHead=Ls,t.ZikoJsonStyleSheet=xa,t.ZikoMutationObserver=Ge,t.ZikoSPA=Ia,t.ZikoUIAbbrText=gr,t.ZikoUIArticle=Dn,t.ZikoUIAside=Un,t.ZikoUIAudio=Yi,t.ZikoUIBlockQuote=Ir,t.ZikoUIBr=Ci,t.ZikoUICanvas=ua,t.ZikoUICodeText=fr,t.ZikoUIDefintion=mr,t.ZikoUIElement=hr,t.ZikoUIFigure=Hi,t.ZikoUIFlex=hn,t.ZikoUIFooter=Zn,t.ZikoUIForm=fn,t.ZikoUIGrid=$n,t.ZikoUIHTMLWrapper=fi,t.ZikoUIHeader=Mn,t.ZikoUIHeading=Cr,t.ZikoUIHr=Si,t.ZikoUIHtmlTag=Ai,t.ZikoUIImage=Ni,t.ZikoUIInput=$r,t.ZikoUIInputCheckbox=ti,t.ZikoUIInputColor=Qr,t.ZikoUIInputDatalist=en,t.ZikoUIInputDate=hi,t.ZikoUIInputDateTime=mi,t.ZikoUIInputEmail=ii,t.ZikoUIInputImage=zi,t.ZikoUIInputNumber=qr,t.ZikoUIInputOption=tn,t.ZikoUIInputPassword=oi,t.ZikoUIInputRadio=si,t.ZikoUIInputSearch=Gr,t.ZikoUIInputSlider=Yr,t.ZikoUIInputTime=ci,t.ZikoUILabel=Ji,t.ZikoUILink=Mi,t.ZikoUIMain=Sn,t.ZikoUINav=On,t.ZikoUIParagraphe=Er,t.ZikoUIQuote=ur,t.ZikoUISVGWrapper=gi,t.ZikoUISection=jn,t.ZikoUISelect=rn,t.ZikoUISubText=dr,t.ZikoUISupText=pr,t.ZikoUISuspense=vi,t.ZikoUISvg=ha,t.ZikoUIText=cr,t.ZikoUITextArea=on,t.ZikoUIVideo=qi,t.ZikoUIXMLWrapper=di,t.ZikoUseRoot=tr,t.ZikoUseStyle=Qs,t.__CACHE__=ja,t.__Config__=Oa,t.__HYDRATION_MAP__=Ma,t.__UI__=Sa,t.__ZikoEvent__=or,t.abbrText=kr,t.abs=So,t.accum=G,t.acos=Bo,t.acosh=Qo,t.acot=Vo,t.add=S,t.arange=B,t.arr2str=Jn,t.asin=Ho,t.asinh=Ko,t.atan=$o,t.atan2=sa,t.atanh=Go,t.audio=Xi,t.bessel=Io,t.beta=To,t.blockQuote=Tr,t.br=Oi,t.brs=Di,t.btn=Li,t.cartesianProduct=et,t.ceil=Jo,t.checkbox=ei,t.choleskyDecomposition=wt,t.clamp=N,t.codeText=_r,t.combinaison=ut,t.complex=wo,t.cos=Zo,t.cosh=qo,t.cot=No,t.coth=Xo,t.count=ao,t.countWords=ho,t.csc=Fo,t.csv2arr=kt,t.csv2json=At,t.csv2matrix=Et,t.csv2object=It,t.csv2sql=Tt,t.datalist=sn,t.default=Za,t.defineParamsGetter=Ca,t.deg2rad=q,t.dfnText=vr,t.div=j,t.e=Do,t.fact=ra,t.figure=$i,t.floor=ta,t.gamma=ko,t.geomspace=V,t.getEvent=ir,t.h=_i,t.h1=Sr,t.h2=Mr,t.h3=Or,t.h4=jr,t.h5=Dr,t.h6=Ur,t.hTags=Ei,t.hr=ji,t.hrs=Ui,t.html=Ri,t.hypot=oa,t.image=Bi,t.inRange=J,t.input=Vr,t.inputCamera=Gi,t.inputColor=Kr,t.inputDate=li,t.inputDateTime=pi,t.inputEmail=ni,t.inputImage=Fi,t.inputNumber=Wr,t.inputPassword=ai,t.inputTime=ui,t.isApproximatlyEqual=tt,t.json2arr=Mt,t.json2css=to,t.json2csv=Ot,t.json2csvFile=jt,t.json2xml=Lt,t.json2xmlFile=Pt,t.json2yml=Zt,t.json2ymlFile=Rt,t.jsonStyleSheet=_a,t.lerp=P,t.li=Fr,t.link=Zi,t.linspace=H,t.ln=Uo,t.logspace=$,t.luDecomposition=ft,t.map=F,t.mapfun=k,t.matrix=mo,t.matrix2=po,t.matrix3=fo,t.matrix4=go,t.max=K,t.min=Q,t.modulo=D,t.mul=O,t.norm=L,t.nums=R,t.obj2str=Kn,t.ol=Nr,t.ones=Z,t.p=Ar,t.pgcd=st,t.pow=Oo,t.powerSet=ot,t.ppcm=rt,t.preload=xt,t.prod=X,t.qrDecomposition=vt,t.quote=yr,t.rad2deg=W,t.radio=ri,t.removeExtraSpace=oo,t.round=ea,t.s=ki,t.sTags=Ii,t.search=Jr,t.sec=Po,t.select=nn,t.sig=na,t.sign=ia,t.sin=Ro,t.sinc=zo,t.sinh=Wo,t.slider=Xr,t.sqrt=Mo,t.sqrtn=jo,t.str=lo,t.sub=M,t.subSet=null,t.subText=xr,t.sum=Y,t.supText=wr,t.svg2ascii=Yn,t.svg2img=Qn,t.svg2imgUrl=Xn,t.svg2str=Wn,t.tan=Lo,t.tanh=Yo,t.text=br,t.textarea=an,t.timeTaken=Is,t.time_memory_Taken=xs,t.ul=Br,t.useAnimation=(t,e=ys.Linear,s=50,r)=>new Ts(t,ys.Linear,50,r),t.useChannel=Fs,t.useClickEvent=Wt,t.useClipboardEvent=De,t.useCustomEvent=We,t.useDebounce=vs,t.useDragEvent=Ae,t.useDropEvent=Te,t.useEventEmitter=Bs,t.useFavIcon=js,t.useFocusEvent=Le,t.useFps=fs,t.useHashEvent=$e,t.useHead=Ps,t.useInputEvent=Ne,t.useKeyEvent=ve,t.useLocaleStorage=Ys,t.useMediaQuery=Js,t.useMeta=Us,t.useMouseEvent=ue,t.usePointerEvent=se,t.useRoot=sr,t.useRootValue=er,t.useSessionStorage=Xs,t.useStyle=Ks,t.useSuccesifKeys=us,t.useSwipeEvent=Qe,t.useThread=$s,t.useThrottle=ws,t.useTimeLoop=gs,t.useTitle=Rs,t.useType=ms,t.useWheelEvent=de,t.video=Wi,t.wait=Es,t.waitForUIElm=_s,t.waitForUIElmSync=ks,t.watch=Je,t.watchAttr=es,t.watchChildren=rs,t.watchIntersection=ns,t.watchScreen=ls,t.watchSize=as,t.zeros=U,Object.defineProperty(t,"__esModule",{value:!0})}));
9
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Ziko={})}(this,(function(t){"use strict";const{PI:e,E:s}=Math,r=Number.EPSILON;var i=Object.freeze({__proto__:null,E:s,EPSILON:r,PI:e});const{PI:n,cos:o,sin:a,tan:h,acos:l,asin:u,atan:m,cosh:p,sinh:f,tanh:g,acosh:b,asinh:y,atanh:v,log:w}=Math;let x={cos:o,sin:a,tan:h,sinc:t=>a(n*t)/(n*t),sec:t=>1/o(t),csc:t=>1/a(t),cot:t=>1/h(t),acos:l,asin:u,atan:m,acot:t=>n/2-m(t),cosh:p,sinh:f,tanh:g,coth:t=>.5*w((1+t)/(1-t)),acosh:b,asinh:y,atanh:v};x=new Proxy(x,{get(t,e){if(e in t)return s=>+t[e](s).toFixed(15)}});class _{}const k=(t,...e)=>{const s=e.map((e=>{if(null===e)return t(null);if(["number","string","boolean","bigint","undefined"].includes(typeof e))return t(e);if(e instanceof Array)return e.map((e=>k(t,e)));if(ArrayBuffer.isView(e))return e.map((e=>t(e)));if(e instanceof Set)return new Set(k(t,...e));if(e instanceof Map)return new Map([...e].map((e=>[e[0],k(t,e[1])])));if(e instanceof lo)return new lo(e.rows,e.cols,k(e.arr.flat(1)));if(e instanceof bo){const[s,r,i,n]=[e.a,e.b,e.z,e.phi];switch(t){case Math.log:return yo(jo(i),n);case Math.exp:return yo(Oo(s)*Do(r),Oo(s)*Uo(r));case Math.abs:return i;case Math.sqrt:return yo(Co(i)*Do(n/2),Co(i)*Uo(n/2));case x.cos:return yo(Do(s)*Vo(r),-Uo(s)*$o(r));case x.sin:return yo(Uo(s)*Vo(r),Do(s)*$o(r));case x.tan:{const t=Do(2*s)+Vo(2*r);return yo(Uo(2*s)/t,$o(2*r)/t)}case x.cosh:return yo(Vo(s)*Do(r),$o(s)*Uo(r));case x.sinh:return yo($o(s)*Do(r),Vo(s)*Uo(r));case x.tanh:{const t=Vo(2*s)+Do(2*r);return yo($o(2*s)/t,Uo(2*r)/t)}default:return t(e)}}else if(e instanceof Object)return t(Object)||Object.fromEntries(Object.entries(e).map((e=>[e[0],k(t,e[1])])))}));return 1==s.length?s[0]:s},E=(t,e)=>{if("number"==typeof t){if("number"==typeof e)return t+e;if(e instanceof bo)return yo(t+e.a,e.b);if(e instanceof lo)return lo.nums(e.rows,e.cols,t).add(e);if(e instanceof Array)return e.map((e=>S(e,t)))}else{if(t instanceof bo||t instanceof lo)return e instanceof Array?e.map((e=>t.clone.add(e))):t.clone.add(e);if(t instanceof Array){if(!(e instanceof Array))return t.map((t=>S(t,e)));if(t.length===e.length)return t.map(((t,s)=>S(t,e[s])))}}},I=(t,e)=>{if("number"==typeof t){if("number"==typeof e)return t-e;if(e instanceof bo)return yo(t-e.a,-e.b);if(e instanceof lo)return lo.nums(e.rows,e.cols,t).sub(e);if(e instanceof Array)return e.map((e=>M(e,t)))}else{if(t instanceof bo||t instanceof lo)return e instanceof Array?e.map((e=>t.clone.sub(e))):t.clone.sub(e);if(t instanceof Array){if(!(e instanceof Array))return t.map((t=>M(t,e)));if(e instanceof Array&&t.length===e.length)return t.map(((t,s)=>M(t,e[s])))}}},A=(t,e)=>{if("number"==typeof t){if("number"==typeof e)return t*e;if(e instanceof bo)return yo(t*e.a,t*e.b);if(e instanceof lo)return lo.nums(e.rows,e.cols,t).mul(e);if(e instanceof Array)return e.map((e=>O(t,e)))}else{if(t instanceof bo||t instanceof lo)return e instanceof Array?e.map((e=>t.clone.mul(e))):t.clone.mul(e);if(t instanceof Array){if(!(e instanceof Array))return t.map((t=>O(t,e)));if(e instanceof Array&&t.length===e.length)return t.map(((t,s)=>O(t,e[s])))}}},T=(t,e)=>{if("number"==typeof t){if("number"==typeof e)return t/e;if(e instanceof bo)return yo(t/e.a,t/e.b);if(e instanceof lo)return lo.nums(e.rows,e.cols,t).div(e);if(e instanceof Array)return e.map((e=>j(t,e)))}else{if(t instanceof bo||t instanceof lo)return e instanceof Array?e.map((e=>t.clone.div(e))):t.clone.div(e);if(t instanceof Array){if(!(e instanceof Array))return t.map((t=>j(t,e)));if(e instanceof Array&&t.length===e.length)return t.map(((t,s)=>j(t,e[s])))}}},C=(t,e)=>{if("number"==typeof t){if("number"==typeof e)return t%e;if(e instanceof bo)return yo(t%e.a,t%e.b);if(e instanceof lo)return lo.nums(e.rows,e.cols,t).modulo(e);if(e instanceof Array)return e.map((e=>j(t,e)))}else{if(t instanceof bo||t instanceof lo)return e instanceof Array?e.map((e=>t.clone.div(e))):t.clone.div(e);if(t instanceof Array&&!(e instanceof Array))return t.map((t=>S(t,e)))}},S=(t,...e)=>{var s=t;for(let t=0;t<e.length;t++)s=E(s,e[t]);return s},M=(t,...e)=>{var s=t;for(let t=0;t<e.length;t++)s=I(s,e[t]);return s},O=(t,...e)=>{var s=t;for(let t=0;t<e.length;t++)s=A(s,e[t]);return s},j=(t,...e)=>{var s=t;for(let t=0;t<e.length;t++)s=T(s,e[t]);return s},D=(t,...e)=>{var s=t;for(let t=0;t<e.length;t++)s=C(s,e[t]);return s},U=t=>new Array(t).fill(0),Z=t=>new Array(t).fill(1),R=(t,e)=>new Array(e).fill(t),L=(t,e,s)=>{if("number"==typeof t)return e!==s?(t-e)/(s-e):0;if(t instanceof lo)return new lo(t.rows,t.cols,L(t.arr.flat(1),e,s));if(t instanceof bo)return new bo(L(t.a,e,s),L(t.b,e,s));if(t instanceof Array){if(t.every((t=>typeof("number"===t))))return t.map((t=>L(t,e,s)));{let e=new Array(t.length);for(let s=0;s<t.length;s++)e[s]=L(t[s])}}},P=(t,e,s)=>{if("number"==typeof t)return(s-e)*t+e;if(t instanceof lo)return new lo(t.rows,t.cols,P(t.arr.flat(1),e,s));if(t instanceof bo)return new bo(P(t.a,e,s),P(t.b,e,s));if(t instanceof Array){if(t.every((t=>typeof("number"===t))))return t.map((t=>P(t,e,s)));{let e=new Array(t.length);for(let s=0;s<t.length;s++)e[s]=P(t[s])}}},F=(t,e,s,r,i)=>{if("number"==typeof t)return P(L(t,e,s),r,i);if(t instanceof lo)return new lo(t.rows,t.cols,F(t.arr.flat(1),e,s,r,i));if(t instanceof bo)return new bo(F(t.a,s,r,i),F(t.b,e,s,r,i));if(t instanceof Array){if(t.every((t=>typeof("number"===t))))return t.map((t=>F(t,e,s,r,i)));{let n=new Array(t.length);for(let o=0;o<t.length;o++)n[o]=F(t[o],e,s,r,i)}}},N=(t,e,s)=>{const[r,i]=[Q(e,s),K(e,s)];if("number"==typeof t)return Q(K(t,r),i);if(t instanceof lo)return new lo(t.rows,t.cols,N(t.arr.flat(1),r,i));if(t instanceof bo)return new bo(N(t.a,r,i),N(t.b,r,i));if(t instanceof Array){if(t.every((t=>typeof("number"===t))))return t.map((t=>N(t,r,i)));{let e=new Array(t.length);for(let s=0;s<t.length;s++)e[s]=N(t[s],r,i)}}},H=(t,e,s,r=!1)=>{let i=[];if(t<e)for(let n=t;r?n<=e:n<e;n+=s)i.push(10*n/10);else for(let n=t;r?n>=e:n>e;n-=s)i.push(10*n/10);return i},B=(t,e,s=To(e-t)+1,r=!0)=>{if(Math.floor(s)===s){if([t,e].every((t=>"number"==typeof t))){const[o,a]=[t,e].sort(((t,e)=>e-t));var i=[];let h;h=r?(o-a)/(s-1):(o-a)/s;for(var n=0;n<s;n++)t<e?i.push(a+h*n):i.push(o-h*n);return i}if([t,e].some((t=>t instanceof bo))){const i=yo(t),n=yo(e);s=s||Math.abs(i.a-n.a)+1;const o=B(i.a,n.a,s,r),a=B(i.b,n.b,s,r);let h=new Array(s).fill(null);return h=h.map(((t,e)=>yo(o[e],a[e]))),h}}},V=(t,e,r=e-t+1,i=s,n=!0)=>B(t,e,r,n).map((t=>So(i,t))),$=(t,e,s=To(e-t)+1,r=!0)=>{if(Math.floor(s)===s){if([t,e].every((t=>"number"==typeof t))){const[i,n]=[t,e].sort(((t,e)=>e-t));let o;o=Mo(i/n,r?s-1:s);const a=[n];for(let t=1;t<s;t++)a.push(a[t-1]*o);return t<e?a:a.reverse()}if([t,e].some((t=>t instanceof bo))){const i=yo(t),n=yo(e);let o;s=s||Math.abs(i.a-n.a)+1,o=Mo(n.div(i),r?s-1:s);const a=[i];for(let t=1;t<s;t++)a.push(O(a[t-1],o));return a}}},q=(...t)=>mapfun((t=>t*Math.PI/180),...t),W=(...t)=>mapfun((t=>t/Math.PI*180),...t),Y=(...t)=>{if(t.every((t=>"number"==typeof t))){let e=t[0];for(let s=1;s<t.length;s++)e+=t[s];return e}const e=[];for(let s=0;s<t.length;s++)t[s]instanceof Array?e.push(Y(...t[s])):t[s]instanceof Object&&e.push(Y(...Object.values(t[s])));return 1===e.length?e[0]:e},X=(...t)=>{if(t.every((t=>"number"==typeof t))){let e=t[0];for(let s=1;s<t.length;s++)e*=t[s];return e}const e=[];for(let s=0;s<t.length;s++)t[s]instanceof Array?e.push(X(...t[s])):t[s]instanceof Object&&e.push(X(...Object.values(t[s])));return 1===e.length?e[0]:e},Q=(...t)=>{if(t.every((t=>"number"==typeof t)))return Math.min(...t);const e=[];for(let s=0;s<t.length;s++)t[s]instanceof Array?e.push(Q(...t[s])):t[s]instanceof Object&&e.push(Object.fromEntries([Object.entries(t[s]).sort(((t,e)=>t[1]-e[1]))[0]]));return 1===e.length?e[0]:e},K=(...t)=>{if(t.every((t=>"number"==typeof t)))return Math.max(...t);const e=[];for(let s=0;s<t.length;s++)t[s]instanceof Array?e.push(Q(...t[s])):t[s]instanceof Object&&e.push(Object.fromEntries([Object.entries(t[s]).sort(((t,e)=>e[1]-t[1]))[0]]));return 1===e.length?e[0]:e},G=(...t)=>{if(t.every((t=>"number"==typeof t))){let e=t.reduce(((t,e)=>[...t,t[t.length-1]+e]),[0]);return e.shift(),e}const e=[];for(let s=0;s<t.length;s++)t[s]instanceof Array?e.push(G(...t[s])):t[s]instanceof Object&&e.push(null);return 1===e.length?e[0]:e},J=(t,e,s)=>{const[r,i]=[Math.min(e,s),Math.max(e,s)];return t>=r&&t<=i},tt=(t,e,s=1e-4)=>Math.abs(t-e)<=s,et=(t,e)=>t.reduce(((t,s)=>[...t,...e.map((t=>[s,t]))]),[]),st=(t,e)=>{let s,r=1;if(t==Go(t)&&e==Go(e)){for(s=2;s<=t&&s<=e;++s)t%s==0&&e%s==0&&(r=s);return r}console.log("error")},rt=(t,e)=>{let s;if(t==Go(t)&&e==Go(e)){for(s=t>e?t:e;s%t!=0||s%e!=0;)++s;return s}console.log("error")},it={add:S,sub:M,mul:O,div:j,modulo:D,zeros:U,ones:Z,nums:R,norm:L,lerp:P,map:F,clamp:N,arange:H,linspace:B,logspace:V,geomspace:$,sum:Y,prod:X,accum:G,cartesianProduct:et,ppcm:rt,pgcd:st,deg2rad:q,rad2deg:W,inRange:J,isApproximatlyEqual:tt};var nt=Object.freeze({__proto__:null,Utils:it,add:S,arange:H,cartesianProduct:et,clamp:N,deg2rad:q,div:j,geomspace:$,inRange:J,isApproximatlyEqual:tt,lerp:P,linspace:B,logspace:V,map:F,mapfun:k,modulo:D,mul:O,norm:L,nums:R,ones:Z,pgcd:st,ppcm:rt,prod:X,rad2deg:W,sub:M,sum:Y,zeros:U});const ot=t=>{const e=[],s=2**t.length;for(let r=0;r<s;r+=1){const s=[];for(let e=0;e<t.length;e+=1)r&1<<e&&s.push(t[e]);e.push(s)}return e},at={_mode:Number,_map:function(t,e,s){return e instanceof lo?new lo(e.rows,e.cols,e.arr.flat(1).map((e=>t(e,s)))):e instanceof bo?new bo(t(e.a,s),t(e.b,s)):e instanceof Array?e.map((e=>t(e,s))):void 0},dec2base(t,e){return this._mode=e<=10?Number:String,"number"==typeof t?this._mode((t>>>0).toString(e)):this._map(this.dec2base,t,e)},dec2bin(t){return this.dec2base(t,2)},dec2oct(t){return this.dec2base(t,8)},dec2hex(t){return this.dec2base(t,16)},bin2base(t,e){return this.dec2base(this.bin2dec(t),e)},bin2dec(t){return this._mode("0b"+t)},bin2oct(t){return this.bin2base(t,8)},bin2hex(t){return this.bin2base(t,16)},oct2dec(t){return this._mode("0o"+t)},oct2bin(t){return this.dec2bin(this.oct2dec(t))},oct2hex(t){return this.dec2hex(this.oct2dec(t))},oct2base(t,e){return this.dec2base(this.oct2dec(t),e)},hex2dec(t){return this._mode("0x"+t)},hex2bin(t){return this.dec2bin(this.hex2dec(t))},hex2oct(t){return this.dec2oct(this.hex2dec(t))},hex2base(t,e){return this.dec2base(this.hex2dec(t),e)},IEEE32toDec(t){let e=t.split(" ").join("").padEnd(32,"0"),s=e[0],r=2**(+("0b"+e.slice(1,9))-127);return(-1)**s*(1+e.slice(9,32).split("").map((t=>+t)).map(((t,e)=>t*2**(-e-1))).reduce(((t,e)=>t+e),0))*r},IEEE64toDec(t){let e=t.split(" ").join("").padEnd(64,"0"),s=e[0],r=2**(+("0b"+e.slice(1,12))-1023);return(-1)**s*(1+e.slice(13,64).split("").map((t=>+t)).map(((t,e)=>t*2**(-e-1))).reduce(((t,e)=>t+e),0))*r}},ht={_mode:Number,_map:function(t,e,s){return e instanceof lo?new lo(e.rows,e.cols,e.arr.flat(1).map((e=>t(e,s)))):e instanceof bo?new bo(t(e.a,s),t(e.b,s)):e instanceof Array?e.map((e=>t(e,s))):void 0},not:function(t){return["number","boolean"].includes(typeof t)?ht._mode(!t):this._map(this.not,t)},and:function(t,...e){return["number","boolean"].includes(typeof t)?ht._mode(e.reduce(((t,e)=>t&e),t)):this._map(this.and,t,e)},or:function(t,...e){return["number","boolean"].includes(typeof t)?ht._mode(e.reduce(((t,e)=>t|e),t)):this._map(this.or,t,e)},nand:function(t,...e){return this.not(this.and(t,e))},nor:function(t,...e){return this.not(this.or(t,e))},xor:function(t,...e){let s=[t,...e];return["number","boolean"].includes(typeof t)?this._mode(1===s.reduce(((t,e)=>(1==+e&&(t+=1),t)),0)):this._map(this.xor,t,e)},xnor:function(t,...e){return ht.not(ht.xor(t,e))}};class lt{static withDiscount(t,e=t.length){if(1===e)return t.map((t=>[t]));const s=[];let r;return r=this.withDiscount(t,e-1),t.forEach((t=>{r.forEach((e=>{s.push([t].concat(e))}))})),s}static withoutDiscount(t){if(1===t.length)return t.map((t=>[t]));const e=[],s=this.withoutDiscount(t.slice(1)),r=t[0];for(let t=0;t<s.length;t++){const i=s[t];for(let t=0;t<=i.length;t++){const s=i.slice(0,t),n=i.slice(t);e.push(s.concat([r],n))}}return e}}class ct{static withDiscount(t,e){if(1===e)return t.map((t=>[t]));const s=[];return t.forEach(((r,i)=>{this.withDiscount(t.slice(i),e-1).forEach((t=>{s.push([r].concat(t))}))})),s}static withoutDiscount(t,e){if(1===e)return t.map((t=>[t]));const s=[];return t.forEach(((r,i)=>{this.withoutDiscount(t.slice(i+1),e-1).forEach((t=>{s.push([r].concat(t))}))})),s}}const ut=(t,e,s=!1)=>ct[s?"withDiscount":"withoutDiscount"](t,e);var mt=Object.freeze({__proto__:null,Base:at,Combinaison:ct,Logic:ht,Permutation:lt,combinaison:ut,powerSet:ot,subSet:null});class pt{static float(t=1,e){return e?Math.random()*(e-t)+t:t*Math.random()}static int(t,e){return Math.floor(this.float(t,e))}static char(t){t=t??this.bool();const e=String.fromCharCode(this.int(97,120));return t?e.toUpperCase():e}static bool(){return[!1,!0][Math.floor(2*Math.random())]}static string(t,e){return t instanceof Array?new Array(this.int(...t)).fill(0).map((()=>this.char(e))).join(""):new Array(t).fill(0).map((()=>this.char(e))).join("")}static bin(){return this.int(2)}static oct(){return this.int(8)}static dec(){return this.int(8)}static hex(){return this.int(16)}static choice(t=[1,2,3],e=new Array(t.length).fill(1/t.length)){let s=new Array(100);e=it.accum(...e).map((t=>100*t)),s.fill(t[0],0,e[0]);for(let r=1;r<t.length;r++)s.fill(t[r],e[r-1],e[r]);return s[this.int(s.length-1)]}static shuffleArr(t){return t.sort((()=>.5-Math.random()))}static shuffleMatrix(t){const{rows:e,cols:s,arr:r}=t;return co(e,s,r.flat().sort((()=>.5-Math.random())))}static floats(t,e,s){return new Array(t).fill(0).map((()=>this.float(e,s)))}static ints(t,e,s){return new Array(t).fill(0).map((()=>this.int(e,s)))}static bools(t){return new Array(t).fill(0).map((()=>this.bool()))}static bins(t){return new Array(t).fill(0).map((()=>this.int(2)))}static octs(t){return new Array(t).fill(0).map((()=>this.int(8)))}static decs(t){return new Array(t).fill(0).map((()=>this.int(10)))}static hexs(t){return new Array(t).fill(0).map((()=>this.int(16)))}static choices(t,e,s){return new Array(t).fill(0).map((()=>this.choice(e,s)))}static perm(...t){return t.permS[this.int(t.length)]}static color(){return"#"+at.dec2hex(this.float(16777216)).padStart(6,0)}static colors(t){return new Array(t).fill(null).map((()=>this.color()))}static complex(t=[0,1],e=[0,1]){return t instanceof Array?new bo(this.float(t[0],t[1]),this.float(e[0],e[1])):new bo(...this.floats(2,t,e))}static complexInt(t=[0,1],e=[0,1]){return new bo(this.int(t[0],t[1]),this.int(e[0],e[1]))}static complexBin(){return new bo(...this.bins(2))}static complexOct(){return new bo(...this.octs(2))}static complexDec(){return new bo(...this.decs(10))}static complexHex(){return new bo(...this.octs(2))}static complexes(t,e=0,s=1){return new Array(t).fill(0).map((()=>this.complex(e,s)))}static complexesInt(t,e=0,s=1){return new Array(t).fill(0).map((()=>this.complexInt(e,s)))}static complexesBin(t){return new Array(t).fill(0).map((()=>this.complexBin()))}static complexesOct(t){return new Array(t).fill(0).map((()=>this.complexOct()))}static complexesDec(t){return new Array(t).fill(0).map((()=>this.complexDec()))}static complexesHex(t){return new Array(t).fill(0).map((()=>this.complexHex()))}static matrix(t,e,s,r){return co(t,e,this.floats(t*e,s,r))}static matrixInt(t,e,s,r){return co(t,e,this.ints(t*e,s,r))}static matrixBin(t,e){return co(t,e,this.bins(t*e))}static matrixOct(t,e){return co(t,e,this.octs(t*e))}static matrixDec(t,e){return co(t,e,this.decs(t*e))}static matrixHex(t,e){return co(t,e,this.hex(t*e))}static matrixColor(t,e){return co(t,e,this.colors(t*e))}static matrixComplex(t,e,s,r){return co(t,e,this.complexes(t*e,s,r))}static matrixComplexInt(t,e,s,r){return co(t,e,this.complexesInt(t*e,s,r))}static matrixComplexBin(t,e){return co(t,e,this.complexesBin(t*e))}static matrixComplexOct(t,e){return co(t,e,this.complexesBin(t*e))}static matrixComplexDec(t,e){return co(t,e,this.complexesBin(t*e))}static matrixComplexHex(t,e){return co(t,e,this.complexesBin(t*e))}}var dt=Object.freeze({__proto__:null,Random:pt});const ft=t=>{t instanceof lo&&(t=t.arr);const e=t.length,s=new Array(e).fill(0).map((()=>new Array(e).fill(0))),r=new Array(e).fill(0).map((()=>new Array(e).fill(0)));for(let i=0;i<e;i++){for(let n=i;n<e;n++){let e=0;for(let t=0;t<i;t++)e+=s[i][t]*r[t][n];r[i][n]=t[i][n]-e}for(let n=i;n<e;n++)if(i==n)s[i][i]=1;else{let e=0;for(let t=0;t<i;t++)e+=s[n][t]*r[t][i];s[n][i]=(t[n][i]-e)/r[i][i]}}return[s,r].map((t=>new lo(t)))},gt=(t,e)=>t.reduce(((t,s,r)=>t+s*e[r]),0),bt=t=>Math.sqrt(t.reduce(((t,e)=>t+e*e),0)),yt=t=>t.map((e=>e/bt(t))),vt=t=>{t instanceof lo&&(t=t.arr);const e=t.length,s=t[0].length,r=[],i=[];for(let t=0;t<e;t++)i.push(new Array(s).fill(0));for(let n=0;n<s;n++){let s=t.map((t=>t[n]));for(let o=0;o<n;o++){const a=r[o],h=gt(a,t.map((t=>t[n])));for(let t=0;t<e;t++)s[t]-=h*a[t];i[o][n]=h}const o=bt(s);r.push(yt(s)),i[n][n]=o}return[r,i].map((t=>new lo(t)))},wt=t=>{t instanceof lo&&(t=t.arr);const e=t.length,s=new Array(e).fill(0).map((()=>new Array(e).fill(0)));for(let r=0;r<e;r++)for(let e=0;e<=r;e++){let i=0;for(let t=0;t<e;t++)i+=s[r][t]*s[e][t];s[r][e]=r===e?Math.sqrt(t[r][r]-i):1/s[e][e]*(t[r][e]-i)}return new lo(s)},xt=t=>{const e=new XMLHttpRequest;if(e.open("GET",t,!1),e.send(),200===e.status)return e.responseText;throw new Error(`Failed to fetch data from ${t}. Status: ${e.status}`)};globalThis.fetchdom=async function(t="https://github.com/zakarialaoui10"){const e=await fetch(t),s=await e.text();return(new DOMParser).parseFromString(s,"text/xml").documentElement},globalThis.fetchdomSync=function(t="https://github.com/zakarialaoui10"){const e=xt(t);return(new DOMParser).parseFromString(e,"text/xml").documentElement};var _t=Object.freeze({__proto__:null,preload:xt});const kt=(t,e=",")=>t.trim().trimEnd().split("\n").map((t=>t.split(e))),Et=(t,e=",")=>new lo(kt(t,e)),It=(t,e=",")=>{const[s,...r]=kt(t,e);return r.map((t=>{const e={};return s.forEach(((s,r)=>{e[s]=t[r]})),e}))},At=(t,e=",")=>JSON.stringify(It(t,e)),Tt=(t,e)=>{const s=t.trim().trimEnd().split("\n").filter((t=>t));let r=`INSERT INTO ${e} (${s[0].split(",").join(", ")}) Values `,i=[];for(let t=1;t<s.length;t++){const e=s[t].split(",");i.push(`(${e})`)}return r+i.join(",\n")},Ct=t=>t instanceof Array?[Object.keys(t[0]),...t.map((t=>Object.values(t)))]:[Object.keys(t)],St=(t,e)=>Ct(t).map((t=>t.join(e))).join("\n"),Mt=t=>Ct(t instanceof Object?t:JSON.parse(t)),Ot=(t,e=",")=>St(t instanceof Object?t:JSON.parse(t),e),jt=(t,e)=>{const s=Ot(t,e),r=new Blob([s],{type:"text/csv;charset=utf-8;"});return{str:s,blob:r,url:URL.createObjectURL(r)}},Dt=(t,e)=>{const s=[];if(Array.isArray(t))t.forEach((t=>{if("object"==typeof t&&null!==t){s.push(`${e}-`);const r=Dt(t,`${e} `);s.push(...r)}else s.push(`${e}- ${t}`)}));else for(const r in t)if(t.hasOwnProperty(r)){const i=t[r];if("object"==typeof i&&null!==i){s.push(`${e}${r}:`);const t=Dt(i,`${e} `);s.push(...t)}else s.push(`${e}${r}: ${i}`)}return s},Ut=(t,e="")=>Dt(t,e).join("\n"),Zt=(t,e)=>Ut(t instanceof Object?t:JSON.parse(t),e),Rt=(t,e)=>{const s=Zt(t,e),r=new Blob([s],{type:"text/yml;charset=utf-8;"});return{str:s,blob:r,url:URL.createObjectURL(r)}},Lt=(t,e=1)=>{let s="";for(const r in t)if(t.hasOwnProperty(r)){const i=t[r];s+="\n"+" ".repeat(e)+`<${r}>`,s+="object"==typeof i?Lt(i,e+2):`${i}`,s+=`</${r}>`}return s.trim()},Pt=(t,e)=>{const s=Lt(t,e),r=new Blob([s],{type:"text/xml;charset=utf-8;"});return{str:s,blob:r,url:URL.createObjectURL(r)}};let zt=class{constructor(t={},e=(t.hasOwnProperty("default")?"default":Object.keys(t)[0]),s=0){this.id="Ziko-Style-"+s,this.keys=new Set,this.styles={default:{fontSize:"1em",color:"green"},other:{fontSize:"2em",color:"cyan"}},t&&this.add(t),e&&this.use(e)}get current(){return[...this.keys].reduce(((t,e)=>(t[e]=`var(--${e}-${this.id})`,t)),{})}add(t,e={}){return t&&"object"==typeof t&&!Array.isArray(t)?Object.assign(this.styles,t):"string"==typeof t&&Object.assign(this.styles,{[t]:e}),this}#t(t){const e=Object.keys(this.styles);for(let s in this.styles[e[t]])Object.prototype.hasOwnProperty.call(this.styles[e[t]],s)&&(document.documentElement.style.setProperty(`--${s}-${this.id}`,this.styles[e[t]][s]),this.keys.add(s));return this}#e(t){if(!this.styles[t])return this;for(let e in this.styles[t])Object.prototype.hasOwnProperty.call(this.styles[t],e)&&(document.documentElement.style.setProperty(`--${e}-${this.id}`,this.styles[t][e]),this.keys.add(e));return this}#s(t){for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(document.documentElement.style.setProperty(`--${e}-${this.id}`,t[e]),this.keys.add(e));return this}use(t){return"number"==typeof t?this.#t(t):"string"==typeof t?this.#e(t):t&&"object"==typeof t?this.#s(t):this}};const Ft=(t,e="px")=>("number"==typeof t&&(t+=e),t instanceof Array&&(t=t.map((t=>"number"==typeof t?t+=e:t)).join(" ")),t);class Nt{constructor(t={}){this.target=null,this.styles=new Map([["default",t]]),this.cache={isHidden:!1,isFaddedOut:!1,transformation:{Flip:[0,0,0],matrix:new lo([[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]])}}}style(t){for(const[e,s]of Object.entries(t))ro.isCamelCase(e)&&(delete t[e],Object.assign(t,{[ro.camel2hyphencase(e)]:s}));return this?.target?.element?.style&&Object.assign(this?.target?.element?.style,t),this}linkTo(t){return this.target=t,this}use(t="default"){return this.style(this.styles.get(t)),this}update(t,e){const s=this.styles.get(t);return s?this.styles.set(t,Object.assign(s,e)):this.styles.set(t,e),this}add(t,e){return this.styles.set(t,e),this}replace(t,e){return this.styles.set(t,e),this}delete(...t){return t.forEach((t=>this.styles.delete(t))),this}updateDefaultStyle(){const t=Object.fromEntries(Object.entries(this.target.element.style).filter((t=>isNaN(+t[0]))));return this.update("default",t),this}hover(t){return t&&this.add("hover",t),this.target?.element?.addEventListener("pointerenter",(()=>this.use("hover"))),this.target?.element?.addEventListener("pointerleave",(()=>this.use("default"))),this}isInline(){return getComputedStyle(this.target.element).display.includes("inline")}isBlock(){return!this.isInline()}size(t,e){return this.style({width:t,height:e}),this}width(t){if(t instanceof Object){if(t instanceof Array&&(t={min:t[0],max:t[1]}),"min"in t||"max"in t){let e=t.min??t.max,s=t.max??t.min;e=Ft(e,"px"),s=Ft(s,"px"),this.style({minWidth:e,maxWidth:s},{target:target,maskVector:maskVector})}}else t=Ft(t,"px"),this.style({width:t});return this}height(t){if(t instanceof Object){if(t instanceof Array&&(t={min:t[0],max:t[1]}),"min"in t||"max"in t){let e=t.min??t.max,s=t.max??t.min;e=Ft(e,"px"),s=Ft(s,"px"),this.style({minHeight:e,maxHeight:s},{target:target,maskVector:maskVector})}}else t=Ft(t,"px"),this.style({height:t});return this}enableResize(t=!1,e=!1){let s="none";return s=t?e?"both":"horizontal":e?"vertical":"none",this.style({resize:s,overflow:"hidden"}),this.isInline()&&(console.group("Ziko Issue : Temporarily Incompatible Method"),console.warn(".enableResize has no effect on inline elements!"),console.info("%cConsider using other display types such as block, inline-block, flex, or grid for proper resizing behavior.","color:gold;background-color:#3333cc;padding:5px"),console.groupEnd()),this}hide({after:t,target:e,maskVector:s}={}){if("number"==typeof t){const r=()=>this.hide({target:e,maskVector:s});setTimeout(r,t),clearTimeout(r)}else this.cache.isHidden=!0,this.style({display:"none"},{target:e,maskVector:s});return this}show({after:t,target:e,maskVector:s}={}){if("number"==typeof t){const r=()=>this.show({target:e,maskVector:s});setTimeout(r,t),clearTimeout(r)}else this.cache.isHidden=!1,this.style({display:""},{target:e,maskVector:s});return this}color(t){return this.style({color:t}),this}background(t){return this.style({background:t}),this}backgroundColor(t){return this.style({backgroundColor:t}),this}opacity(t,{target:e,maskVector:s}={}){return this.style({opacity:t},{target:e,maskVector:s}),this}position(t){return this.style({position:t}),this}display(t,{target:e,maskVector:s}={}){return this.style({display:t},{target:e,maskVector:s}),this}zIndex(t){return this.style({zIndex:t}),this}float(t,{target:e,maskVector:s}={}){return this.style({float:t},{target:e,maskVector:s}),this}border(t="1px solid red",{target:e,maskVector:s}={}){return this.style({border:t},{target:e,maskVector:s}),this}borderTop(t="1px solid red",{target:e,maskVector:s}={}){return this.style({borderTop:t},{target:e,maskVector:s}),this}borderRight(t="1px solid red",{target:e,maskVector:s}={}){return this.style({borderRight:t},{target:e,maskVector:s}),this}borderBottom(t="1px solid red",{target:e,maskVector:s}={}){return this.style({borderBottom:t},{target:e,maskVector:s}),this}borderLeft(t="1px solid red",{target:e,maskVector:s}={}){return this.style({borderLeft:t},{target:e,maskVector:s}),this}borderRadius(t){return t=Ft(t,"px"),this.style({borderRadius:t},{target:target,maskVector:maskVector}),this}margin(t){return t=Ft(t,"px"),this.style({margin:t},{target:target,maskVector:maskVector}),this}marginTop(t){return t=Ft(t,"px"),this.style({marginTop:t}),this}marginRight(t){return t=Ft(t,"px"),this.style({marginRight:t}),this}marginBootom(t){return t=Ft(t,"px"),this.style({marginBootom:t}),this}marginLeft(t){return t=Ft(t,"px"),this.style({marginLeft:t}),this}padding(t){return t=Ft(t,"px"),this.style({padding:t}),this}paddingTop(t){return t=Ft(t,"px"),this.style({paddingTop:t}),this}paddingRight(t){return t=Ft(t,"px"),this.style({paddingRight:t}),this}paddingBootom(t){return t=Ft(t,"px"),this.style({paddingBootom:t}),this}paddingLeft(t){return t=Ft(t,"px"),this.style({paddingLeft:t}),this}font(t){return this.style({font:t}),this}fontFamily(t=""){return this.style({fontFamily:t}),this}fontSize(t){return this.style({fontSize:t}),this}cursor(t="pointer"){return this.style({cursor:t}),this}overflow(t,e){const s=["hidden","auto"];return this.style({overflowX:"number"==typeof t?s[t]:t,overflowY:"number"==typeof e?s[e]:e},{target:target,maskVector:maskVector}),this}clip(t,{target:e,maskVector:s}={}){return"string"==typeof t&&(t="polygon("+t+")"),this.style({clipPath:t},{target:e,maskVector:s}),this}fadeOut(t=1){return this.style({transition:`opacity ${t/1e3}s`,opacity:0}),this.cache.isFaddedOut=!0,this}fadeIn(t=1){return this.style({transition:`opacity ${t/1e3}s`,opacity:1}),this.cache.isFaddedOut=!1,this}toggleFade(t=1e3,e=t){return this.cache.isFaddedOut?this.fadeIn(t):this.fadeOut(e),this}morphBorderRadius(t,e){return this.style({borderRadius:t,transition:`borderRadius ${e/1e3}s`}),this}#r(t){const e=this.cache.transformation.matrix.arr.join(",");this.style({transform:`matrix3d(${e})`,"-webkit-transform":`matrix3d(${e})`,"-moz-transform":`matrix3d(${e})`,"-ms-transform":`matrix3d(${e})`,"-o-transform":`matrix3d(${e})`}),0!=t&&this.style({transition:`transform ${t/1e3}s ease`})}translate(t,e=t,s=0,r=0){return this.cache.transformation.matrix.set(3,0,t),this.cache.transformation.matrix.set(3,1,e),this.cache.transformation.matrix.set(3,2,s),this.#r(r),this}translateX(t,e=0){return this.cache.transformation.matrix.set(3,0,t),this.#r(e),this}translateY(t,e=0){return this.cache.transformation.matrix.set(3,1,t),this.#r(e),this}translateZ(t,e=0){const s=-1/this.cache.transformation.matrix[2][2];return this.cache.transformation.matrix.set(3,2,z),this.cache.transformation.matrix.set(3,3,1-t/s),this.#r(e),this}perspective(t,e=0){const s=this.cache.transformation.matrix[3][2];return this.cache.transformation.matrix.set(2,2,-1/d),this.cache.transformation.matrix.set(3,3,1-s/t),this.#r(e),this}scale(t,e=t,s=0){return this.cache.transformation.matrix.set(0,0,t),this.cache.transformation.matrix.set(1,1,e),this.#r(s),this}scaleX(t=1,e=0){return this.cache.transformation.matrix.set(0,0,t),this.#r(e),this}scaleY(t=1,e=0){return this.cache.transformation.matrix.set(1,1,t),this.cache.transformation.matrix.arr.join(","),this.#r(e),this}skew(t,e=t,s=0){return this.cache.transformation.matrix.set(0,1,t),this.cache.transformation.matrix.set(1,0,e),this.cache.transformation.matrix.arr.join(","),this.#r(s),this}skewX(t=1,e=0){return this.cache.transformation.matrix.set(0,1,t),this.cache.transformation.matrix.arr.join(","),this.#r(e),this}skewY(t=1,e=0){return this.cache.transformation.matrix.set(1,0,t),this.cache.transformation.matrix.arr.join(","),this.#r(e),this}rotateX(t,e=0){return this.cache.transformation.matrix.set(1,1,Do(t)),this.cache.transformation.matrix.set(1,2,-Uo(t)),this.cache.transformation.matrix.set(2,1,Uo(t)),this.cache.transformation.matrix.set(1,2,Do(t)),this.#r(e),this}rotateY(t,e=0){return this.cache.transformation.matrix.set(0,0,Do(t)),this.cache.transformation.matrix.set(0,2,Uo(t)),this.cache.transformation.matrix.set(2,0,-Uo(t)),this.cache.transformation.matrix.set(2,2,Do(t)),this.#r(e),this}rotateZ(t,e=0){return this.cache.transformation.matrix.set(0,0,Do(t)),this.cache.transformation.matrix.set(0,1,-Uo(t)),this.cache.transformation.matrix.set(1,0,Uo(t)),this.cache.transformation.matrix.set(1,1,Do(t)),this.#r(e),this}flipeX(t=1){return this.cache.transformation.Flip[0]+=180,this.cache.transformation.Flip[0]%=360,this.rotateX(this.cache.transformation.Flip[0],t),this}flipeY(t=1){return this.cache.transformation.Flip[1]+=180,this.cache.transformation.Flip[1]%=360,this.rotateY(this.cache.transformation.Flip[1],t),this}flipeZ(t=1){return this.cache.transformation.Flip[2]+=180,this.cache.transformation.Flip[2]%=360,this.rotateZ(this.cache.transformation.Flip[2],t),this}slideHeightIn(t=1,e=this.h){return this.style({transition:t+"s",height:e}),this}slideHeightOut(t=1){return this.style({transition:t+"s",height:0}),this.target?.element?.n("transitionend",(()=>this.style({opacity:"none"}))),this}slideWidthIn(t=1,e=this.w){return this.style({transition:t+"s",width:e}),this}slideWidthOut(t=1){this.style({transition:t+"s",width:0});const e=()=>{this.style({opacity:"none"})};return this.target?.element?.addEventListener("transitionend",e),this.target?.element?.removeEventListener("transitionend",e),this}slideIn({transitionTimming:t=1,w:e="100%",h:s="auto"}={}){return this.style({transition:t+"s",width:e,height:s,visibility:"visible"}),this}slideOut({transitionTimming:t=1,width:e=0,heightransitionTimming:s=0}={}){this.style({visibility:"hidden",transition:t+"s",opacity:"none",width:e,height:height});const r=()=>{this.style({opacity:"none"})};return this.target?.element?.addEventListener("transitionend",r),this.target?.element?.removeEventListener("transitionend",r),this}}function Ht(t,e,s,r){return this.event=t,this.cache.preventDefault[e]&&t.preventDefault(),console.log({setter:s}),s&&s(),this.cache.stream.enabled[e]&&r&&this.cache.stream.history[e].push(r),this.cache.callbacks[e].map((t=>t(this))),this}class Bt{constructor(t){this.target=null,this.setTarget(t),this.__dispose=this.dispose.bind(this)}get targetElement(){return this.target.element}setTarget(t){return this.target=t,this}__handle(t,e,s){const r="drag"===t?t:`${this.cache.prefixe}${t}`;return this.dispose(s),this.targetElement?.addEventListener(r,e),this}__onEvent(t,e,...s){if(0===s.length){if(!(this.cache.callbacks.length>1))return this;this.cache.callbacks.map((t=>e=>t.call(this,e)))}else this.cache.callbacks[t]=s.map((t=>e=>t.call(this,e)));return this.__handle(t,this.__controller[t],e),this}preventDefault(t={}){return Object.assign(this.cache.preventDefault,t),this}pause(t={}){t={...Object.fromEntries(Object.keys(this.cache.stream.enabled).map((t=>[t,!0]))),...t};for(let e in t)t[e]&&(this.targetElement?.removeEventListener(`${this.cache.prefixe}${e}`,this.__controller[`${this.cache.prefixe}${e}`]),this.cache.paused[`${this.cache.prefixe}${e}`]=!0);return this}resume(t={}){t={...Object.fromEntries(Object.keys(this.cache.stream.enabled).map((t=>[t,!0]))),...t};for(let e in t)t[e]&&(this.targetElement?.addEventListener(`${this.cache.prefixe}${e}`,this.__controller[`${this.cache.prefixe}${e}`]),this.cache.paused[`${this.cache.prefixe}${e}`]=!1);return this}dispose(t={}){return this.pause(t),this}stream(t={}){this.cache.stream.t0=Date.now();return t={...Object.fromEntries(Object.keys(this.cache.stream.enabled).map((t=>[t,!0]))),...t},Object.assign(this.cache.stream.enabled,t),this}clear(t={}){t={...Object.fromEntries(Object.keys(this.cache.stream.clear).map((t=>[t,!0]))),...t};for(let e in t)t[e]&&(this.cache.stream.history[e]=[]);return this}}function Vt(t){Ht.call(this,t,"click",null,null)}function $t(t){Ht.call(this,t,"dbclick",null,null)}class qt extends Bt{constructor(t){super(t),this.event=null,this.cache={prefixe:"",preventDefault:{click:!1,dbclick:!1},paused:{click:!1,dbclick:!1},stream:{enabled:{click:!1,dbclick:!1},clear:{click:!1,dbclick:!1},history:{click:[],dbclick:[]}},callbacks:{click:[],dbclick:[]}},this.__controller={click:Vt.bind(this),dbclick:$t.bind(this)}}onClick(...t){return this.__onEvent("click",{},...t),this}onDbClick(...t){return this.__onEvent("dbclick",{},...t),this}}const Wt=t=>new qt(t);function Yt(t){Ht.call(this,t,"down",(()=>{this.dx=parseInt(t.offsetX),this.dy=parseInt(t.offsetY),this.isDown=!0}),{x:this.dx,y:this.dy,t:Date.now()-this.cache.stream.t0})}function Xt(t){Ht.call(this,t,"move",(()=>{this.mx=parseInt(t.offsetX),this.my=parseInt(t.offsetY),this.isMoving=!0}),{x:this.mx,y:this.my,t:Date.now()-this.cache.stream.t0})}function Qt(t){Ht.call(this,t,"up",(()=>{this.ux=parseInt(t.offsetX),this.uy=parseInt(t.offsetY),this.isDown=!1;const e=this.dx,s=this.dy,r=this.ux,i=this.uy,n=(r-e)/this.target.Width,o=(s-i)/this.target.Height,a=n<0?"left":n>0?"right":"none",h=o<0?"bottom":o>0?"top":"none";this.swippe={h:a,v:h,delta_x:n,delta_y:o}}),{x:this.ux,y:this.uy,t:Date.now()-this.cache.stream.t0})}function Kt(t){Ht.call(this,t,"enter",null,null)}function Gt(t){Ht.call(this,t,"leave",null,null)}function Jt(t){Ht.call(this,t,"out",null,null)}function te(t){Ht.call(this,t,"cancel",null,null)}class ee extends Bt{constructor(t){super(t),this.event=null,this.dx=0,this.dy=0,this.dt=0,this.mx=0,this.my=0,this.mt=0,this.ux=0,this.uy=0,this.ut=0,this.swippe={h:null,v:null,delta_x:0,delta_y:0},this.isMoving=!1,this.isDown=!1,this.cache={prefixe:"pointer",preventDefault:{down:!1,move:!1,up:!1,enter:!1,out:!1,leave:!1,cancel:!1},paused:{down:!1,move:!1,up:!1,enter:!1,out:!1,leave:!1,cancel:!1},stream:{enabled:{down:!1,move:!1,up:!1,enter:!1,out:!1,leave:!1,cancel:!1},clear:{down:!1,move:!1,up:!1,enter:!1,out:!1,leave:!1,cancel:!1},history:{down:[],move:[],up:[],enter:[],out:[],leave:[]}},callbacks:{down:[t=>console.log({dx:t.dx,dy:t.dy,down:t.down,move:t.move,t:t.dt})],move:[t=>console.log({mx:t.mx,my:t.my,down:t.down,move:t.move,t:t.dt})],up:[t=>console.log({ux:t.ux,uy:t.uy,down:t.down,move:t.move,t:t.dt})],enter:[t=>console.log({dx:t.dx,dy:t.dy,down:t.down,move:t.move,t:t.dt})],out:[t=>console.log({mx:t.mx,my:t.my,down:t.down,move:t.move,t:t.dt})],leave:[t=>console.log({ux:t.ux,uy:t.uy,down:t.down,move:t.move,t:t.dt})],cancel:[t=>console.log({ux:t.ux,uy:t.uy,down:t.down,move:t.move,t:t.dt})]}},this.__controller={down:Yt.bind(this),move:Xt.bind(this),up:Qt.bind(this),enter:Kt.bind(this),out:Jt.bind(this),leave:Gt.bind(this),cancel:te.bind(this)}}onDown(...t){return 0===t.length&&(t=[()=>{}]),this.__onEvent("down",{down:!0,move:!1,up:!1,enter:!1,out:!1,leave:!1,cancel:!1},...t),this}onMove(...t){return 0===t.length&&(t=[()=>{}]),this.__onEvent("move",{down:!1,move:!0,up:!1,enter:!1,out:!1,leave:!1,cancel:!1},...t),this}onUp(...t){return 0===t.length&&(t=[()=>{}]),this.__onEvent("up",{down:!1,move:!1,up:!0,enter:!1,out:!1,leave:!1,cancel:!1},...t),this}onEnter(...t){return 0===t.length&&(t=[()=>{}]),this.__onEvent("enter",{down:!1,move:!1,up:!1,enter:!0,out:!1,leave:!1,cancel:!1},...t),this}onOut(...t){return 0===t.length&&(t=[()=>{}]),this.__onEvent("out",{down:!1,move:!1,up:!1,enter:!1,out:!0,leave:!1,cancel:!1},...t),this}onLeave(...t){return 0===t.length&&(t=[()=>{}]),this.__onEvent("leave",{down:!1,move:!1,up:!1,enter:!1,out:!1,leave:!0,cancel:!1},...t),this}onCancel(...t){return 0===t.length&&(t=[()=>{}]),this.__onEvent("cancel",{down:!1,move:!1,up:!1,enter:!1,out:!1,leave:!1,cancel:!0},...t),this}}var se=t=>new ee(t);class re extends Bt{constructor(t){super(t),this.event=null,this.dx=0,this.dy=0,this.dt=0,this.mx=0,this.my=0,this.mt=0,this.ux=0,this.uy=0,this.ut=0,this.swippe={h:null,v:null,delta_x:0,delta_y:0},this.isMoving=!1,this.isDown=!1,this.cache={prefixe:"mouse",preventDefault:{down:!1,move:!1,up:!1,enter:!1,out:!1,leave:!1,over:!1},paused:{down:!1,move:!1,up:!1,enter:!1,out:!1,leave:!1,over:!1},stream:{enabled:{down:!1,move:!1,up:!1,enter:!1,out:!1,leave:!1,over:!1},clear:{down:!1,move:!1,up:!1,enter:!1,out:!1,leave:!1,over:!1},history:{down:[],move:[],up:[],enter:[],out:[],leave:[],over:[]}},callbacks:{down:[t=>console.log({dx:t.dx,dy:t.dy,down:t.down,move:t.move,t:t.dt})],move:[t=>console.log({mx:t.mx,my:t.my,down:t.down,move:t.move,t:t.dt})],up:[t=>console.log({ux:t.ux,uy:t.uy,down:t.down,move:t.move,t:t.dt})],enter:[t=>console.log({dx:t.dx,dy:t.dy,down:t.down,move:t.move,t:t.dt})],out:[t=>console.log({mx:t.mx,my:t.my,down:t.down,move:t.move,t:t.dt})],leave:[t=>console.log({ux:t.ux,uy:t.uy,down:t.down,move:t.move,t:t.dt})],over:[t=>console.log({ux:t.ux,uy:t.uy,down:t.down,move:t.move,t:t.dt})]}},this.__controller={down:ie.bind(this),move:ne.bind(this),up:oe.bind(this),enter:ae.bind(this),out:le.bind(this),leave:he.bind(this),over:ce.bind(this)}}onDown(...t){return 0===t.length&&(t=[()=>{}]),this.__onEvent("down",{down:!0,move:!1,up:!1,enter:!1,out:!1,leave:!1,over:!1},...t),this}onMove(...t){return 0===t.length&&(t=[()=>{}]),this.__onEvent("move",{down:!1,move:!0,up:!1,enter:!1,out:!1,leave:!1,over:!1},...t),this}onUp(...t){return 0===t.length&&(t=[()=>{}]),this.__onEvent("up",{down:!1,move:!1,up:!0,enter:!1,out:!1,leave:!1,over:!1},...t),this}onEnter(...t){return 0===t.length&&(t=[()=>{}]),this.__onEvent("enter",{down:!1,move:!1,up:!1,enter:!0,out:!1,leave:!1,over:!1},...t),this}onOut(...t){return 0===t.length&&(t=[()=>{}]),this.__onEvent("out",{down:!1,move:!1,up:!1,enter:!1,out:!0,leave:!1,over:!1},...t),this}onLeave(...t){return 0===t.length&&(t=[()=>{}]),this.__onEvent("leave",{down:!1,move:!1,up:!1,enter:!1,out:!1,leave:!0,over:!1},...t),this}onOver(...t){return 0===t.length&&(t=[()=>{}]),this.__onEvent("over",{down:!1,move:!1,up:!1,enter:!1,out:!1,leave:!1,over:!0},...t),this}}function ie(t){Ht.call(this,t,"down",(()=>{this.dx=parseInt(t.offsetX),this.dy=parseInt(t.offsetY),this.isDown=!0}),{x:this.dx,y:this.dy,t:Date.now()-this.cache.stream.t0})}function ne(t){Ht.call(this,t,"move",(()=>{this.mx=parseInt(t.offsetX),this.my=parseInt(t.offsetY),this.isMoving=!0}),{x:this.mx,y:this.my,t:Date.now()-this.cache.stream.t0})}function oe(t){Ht.call(this,t,"up",(()=>{this.ux=parseInt(t.offsetX),this.uy=parseInt(t.offsetY),this.isDown=!1;const e=this.dx,s=this.dy,r=this.ux,i=this.uy,n=(r-e)/this.target.Width,o=(s-i)/this.target.Height,a=n<0?"left":n>0?"right":"none",h=o<0?"bottom":o>0?"top":"none";this.swippe={h:a,v:h,delta_x:n,delta_y:o}}),{x:this.ux,y:this.uy,t:Date.now()-this.cache.stream.t0})}function ae(t){Ht.call(this,t,"enter",null,null)}function he(t){Ht.call(this,t,"leave",null,null)}function le(t){Ht.call(this,t,"out",null,null)}function ce(t){Ht.call(this,t,"out",null,null)}const ue=t=>new re(t);function me(t){Ht.call(this,t,"wheel",null,null)}class pe extends Bt{constructor(t){super(t),this.event=null,this.cache={prefixe:"",preventDefault:{wheel:!1},paused:{wheel:!1},stream:{enabled:{wheel:!1},clear:{wheel:!1},history:{wheel:[]}},callbacks:{click:[]}},this.__controller={wheel:me.bind(this)}}onWheel(...t){return this.__onEvent("wheel",{},...t),this}}const de=t=>new pe(t);function fe(t){Ht.call(this,t,"down",(()=>this.kd=t.key),{key:t.key,t:10})}function ge(t){Ht.call(this,t,"press",(()=>this.kp=t.key),{key:t.key,t:10})}function be(t){Ht.call(this,t,"up",(()=>this.ku=t.key),{key:t.key,t:10})}class ye extends Bt{constructor(t){super(t),this.kp=null,this.kd=null,this.ku=null,this.t=0,this.cache={prefixe:"key",preventDefault:{down:!1,press:!1,up:!1},paused:{down:!1,press:!1,up:!1},stream:{enabled:{down:!1,press:!1,up:!1},clear:{down:!0,press:!1,up:!1},history:{down:[],press:[],up:[]}},callbacks:{down:[t=>console.log({kd:t.kd})],press:[t=>console.log({kp:t.kp})],up:[t=>console.log({ku:t.ku})]},successifKeysCallback:{down:[t=>console.log(1111)],press:[t=>console.log(1112)],kyup:[t=>console.log(1113)]}},this.__controller={down:fe.bind(this),press:ge.bind(this),up:be.bind(this)}}onDown(...t){return this.__onEvent("down",{down:!0},...t),this}onPress(...t){return this.__onEvent("press",{press:!0},...t),this}onUp(...t){return this.__onEvent("up",{up:!0},...t),this}}var ve=t=>new ye(t);function we(t){Ht(this,t,"start",null)}function xe(t){Ht.call(this,t,"drag",null,null)}function _e(t){Ht.call(this,t,"end",null,null)}function ke(t){Ht.call(this,t,"drop",null,null)}class Ee extends Bt{constructor(t){super(t),this.target.setAttribute("draggable",!0),this.cache={prefixe:"drag",preventDefault:{drag:!1,start:!1,end:!1,enter:!1,leave:!1,over:!1},paused:{drag:!1,start:!1,end:!1,enter:!1,leave:!1,over:!1},enabled:{drag:!1,start:!1,end:!1,enter:!1,leave:!1,over:!1},callbacks:{drag:[],start:[],end:[],enter:[],leave:[],over:[]},stream:{enabled:{drag:!1,start:!1,end:!1,enter:!1,leave:!1,over:!1},clear:{drag:!1,start:!1,end:!1,enter:!1,leave:!1,over:!1},history:{drag:[],start:[],end:[],enter:[],leave:[],over:[]}}},this.__controller={start:we.bind(this),drag:xe.bind(this),end:_e.bind(this)}}onStart(...t){return this.__onEvent("start",{},...t),this}onDrag(...t){return this.__onEvent("drag",{},...t),this}onEnd(...t){return this.__onEvent("end",{},...t),this}}class Ie extends Bt{constructor(t){super(t),this.event=null,this.cache={prefixe:"",preventDefault:{drop:!1},paused:{drop:!1},stream:{enabled:{drop:!1},clear:{drop:!1},history:{drop:[]}},callbacks:{drop:[t=>console.log({dx:t.dx,dy:t.dy,drop:t.drop,move:t.move,t:t.dt})]}},this.__controller={drop:ke.bind(this)}}onDrop(...t){return this.__onEvent("drop",{},...t),this}}const Ae=t=>new Ee(t),Te=t=>new Ie(t);function Ce(t){Ht.call(this,t,"copy",null,null)}function Se(t){Ht.call(this,t,"cut",null,null)}function Me(t){Ht.call(this,t,"paste",null,null)}function Oe(t){Ht.call(this,t,"select",null,null)}class je extends Bt{constructor(t){super(t),this.event=null,this.cache={prefixe:"",preventDefault:{copy:!1,cut:!1,paste:!1,select:!1},paused:{copy:!1,cut:!1,paste:!1,select:!1},stream:{enabled:{copy:!1,cut:!1,paste:!1,select:!1},clear:{copy:!1,cut:!1,paste:!1,select:!1},history:{copy:[],cut:[],paste:[],select:[]}},callbacks:{copy:[],cut:[],paste:[],select:[]}},this.__controller={copy:Ce.bind(this),cut:Se.bind(this),paste:Me.bind(this),select:Oe.bind(this)}}onCopy(...t){return this.__onEvent("copy",{},...t),this}onCut(...t){return this.__onEvent("cut",{},...t),this}onPaste(...t){return this.__onEvent("paste",{},...t),this}onSelect(...t){return this.__onEvent("select",{},...t),this}}const De=t=>new je(t);function Ue(t){Ht.call(this,t,"focus",null,null)}function Ze(t){Ht.call(this,t,"blur",null,null)}class Re extends Bt{constructor(t){super(t),this.event=null,this.cache={prefixe:"",preventDefault:{focus:!1,blur:!1},paused:{focus:!1,blur:!1},stream:{enabled:{focus:!1,blur:!1},clear:{focus:!1,blur:!1},history:{focus:[],blur:[]}},callbacks:{focus:[],blur:[]}},this.__controller={focus:Ue.bind(this),blur:Ze.bind(this)}}onFocus(...t){return this.__onEvent("focus",{},...t),this}onBlur(...t){return this.__onEvent("blur",{},...t),this}}const Le=t=>new Re(t);function Pe(t){Ht.call(this,t,"input",null,null)}function ze(t){Ht.call(this,t,"change",null,null)}class Fe extends Bt{constructor(t){super(t),this.event=null,this.cache={prefixe:"",preventDefault:{input:!1,change:!1},paused:{input:!1,change:!1},stream:{enabled:{input:!1,change:!1},clear:{input:!1,change:!1},history:{input:[],change:[]}},callbacks:{input:[],change:[]}},this.__controller={input:Pe.bind(this),change:ze.bind(this)}}get value(){return this.target.value}onInput(...t){return this.__onEvent("input",{},...t),this}onChange(...t){return this.__onEvent("change",{},...t),this}}const Ne=t=>new Fe(t);function He(t){Ht.call(this,t,"hashchange",null,null)}class Be extends Bt{constructor(t){super(t),this.event=null,this.cache={prefixe:"",preventDefault:{hashchange:!1},paused:{hashchange:!1},stream:{enabled:{hashchange:!1},clear:{hashchange:!1},history:{hashchange:[]}},callbacks:{hashchange:[]}},this.__controller={hashchange:He.bind(this)}}onChange(...t){return this.__onEvent("hashchange",{},...t),this}}const Ve=t=>new Be(t),$e=t=>function(e){Ht.call(this,e,t,null,null)};class qe extends Bt{constructor(t){super(t),this.event=null,this.cache={prefixe:"",preventDefault:{},paused:{},stream:{enabled:{},clear:{},history:{}},callbacks:{}},this.__controller={}}#i(t){return this.cache.preventDefault[t]=!1,this.cache.paused[t]=!1,this.cache.stream.enabled=!1,this.cache.stream.clear=!1,this.cache.stream.history=[],this.cache.callbacks[t]=[],this.__controller[t]=$e(t).bind(this),this}on(t,...e){return this.__controller[t]||this.#i(t),this.__onEvent(t,{},...e),this}emit(t,e={}){this.__controller[t]||this.#i(t),this.detail=e;const s=new Event(t);return this.targetElement.dispatchEvent(s),this}}const We=t=>new qe(t);class Ye extends Bt{constructor(t,e=.3,s=.3){super(t);const{removeListener:r,setWidthThreshold:i,setHeightThreshold:n}=function(t,e=.5,s=.5,r,i){let n=P(e,0,r),o=P(s,0,i),a=0,h=0,l=0,c=0;const u=t=>{a=t.clientX,h=t.clientY},m=t=>{l=t.clientX,c=t.clientY,p()};function p(){const t=l-a,e=c-h;(Math.abs(t)>n||Math.abs(e)>o)&&d(t,e)}function d(e,s){const a=globalThis?.CustomEvent?new CustomEvent("swipe",{detail:{deltaX:To(e)<n?0:sa(e)*L(To(e),0,r),deltaY:To(s)<o?0:sa(s)*L(To(s),0,i),direction:{x:To(e)<n?"none":e>0?"right":"left",y:To(s)<o?"none":s>0?"down":"up"}}}):null;t?.dispatchEvent(a)}function f(t){n=P(t,0,r)}function g(t){o=P(t,0,i)}return t?.addEventListener("pointerdown",u),t?.addEventListener("pointerup",m),{removeListener(){t?.removeEventListener("pointerdown",u),t?.removeEventListener("pointerup",m),console.log("Swipe event listeners removed")},setWidthThreshold:f,setHeightThreshold:g}}(this.target?.element,e,s,this.target.width,this.target.height);this.cache={width_threshold:e,height_threshold:s,removeListener:r,setWidthThreshold:i,setHeightThreshold:n,legacyTouchAction:globalThis?.document?.body?.style?.touchAction,prefixe:"",preventDefault:{swipe:!1},paused:{swipe:!1},stream:{enabled:{swipe:!1},clear:{swipe:!1},history:{swipe:[]}},callbacks:{swipe:[]}},this.__controller={swipe:Xe.bind(this)}}onSwipe(...t){return Object.assign(globalThis?.document?.body?.style,{touchAction:"none"}),this.__onEvent("swipe",{},...t),this}updateThresholds(t=this.cache.width_threshold,e=this.cache.height_threshold){return void 0!==t&&this.cache.setWidthThreshold(t),void 0!==e&&this.cache.setHeightThreshold(e),this}destroy(){return this.cache.removeListener(),Object.assign(globalThis?.document?.body?.style,{touchAction:this.cache.legacyTouchAction}),this}}function Xe(t){Ht.call(this,t,"swipe",null,null)}const Qe=(t,e,s)=>new Ye(t,e,s);var Ke=Object.freeze({__proto__:null,ZikoCustomEvent:qe,ZikoEvent:Bt,ZikoEventClick:qt,ZikoEventClipboard:je,ZikoEventHash:Be,ZikoEventInput:Fe,ZikoEventKey:ye,ZikoEventMouse:re,ZikoEventPointer:ee,ZikoEventSwipe:Ye,ZikoEventWheel:pe,useClickEvent:Wt,useClipboardEvent:De,useCustomEvent:We,useDragEvent:Ae,useDropEvent:Te,useFocusEvent:Le,useHashEvent:Ve,useInputEvent:Ne,useKeyEvent:ve,useMouseEvent:ue,usePointerEvent:se,useSwipeEvent:Qe,useWheelEvent:de});class Ge{constructor(t,e){this.target=t,this.observer=null,this.cache={options:e||{attributes:!0,childList:!0,subtree:!0},streamingEnabled:!0,lastMutation:null,mutationHistory:{}},this.observeCallback=(t,e)=>{if(this.cache.streamingEnabled)for(const e of t)switch(e.type){case"attributes":this.cache.mutationHistory.attributes.push(e.target.getAttribute(e.attributeName));break;case"childList":this.cache.mutationHistory.childList.push(e);break;case"subtree":this.cache.mutationHistory.subtree.push(e)}this.callback&&this.callback(t,e)}}observe(t){if(!this.observer){if(!globalThis.MutationObserver)return void console.log("MutationObserver Nor Supported");this.observer=new MutationObserver(this.cache.observeCallback),this.observer.observe(this.target.element,this.cache.options),this.callback=([e])=>t.call(e,this),this.cache.streamingEnabled=!0}}pause(t){this.observer&&(this.observer.disconnect(),t&&this.observer.observe(this.target,t))}reset(t){this.observer&&(this.observer.disconnect(),this.observer.observe(this.target,t||this.cache.options))}clear(){return this.observer&&(this.observer.disconnect(),this.observer=null,this.cache.mutationHistory={attributes:[],childList:[],subtree:[]}),this.cache.streamingEnabled=!1,this}getMutationHistory(){return this.cache.mutationHistory}enableStreaming(){return this.cache.streamingEnabled=!0,this}disableStreaming(){return this.cache.streamingEnabled=!1,this}}const Je=(t,e={},s=null)=>{const r=new Ge(t,e);return s&&r.observe(s),r};class ts extends Ge{constructor(t,e){super(t,{attributes:!0,childList:!1,subtree:!1}),Object.assign(this.cache,{observeCallback:(t,e)=>{for(const e of t)this.cache.lastMutation={name:e.attributeName,value:e.target.getAttribute(e.attributeName)},this.cache.streamingEnabled&&this.cache.mutationHistory.attributes.push(this.cache.lastMutation);this.callback&&this.callback(t,e)}}),this.cache.mutationHistory.attributes=[],e&&this.observe(e)}get history(){return this.cache.mutationHistory.attributes}}const es=(t,e)=>new ts(t,e);class ss extends Ge{constructor(t,e){super(t,{attributes:!1,childList:!0,subtree:!1}),Object.assign(this.cache,{observeCallback:(t,e)=>{for(const e of t)e.addedNodes?this.cache.lastMutation={type:"add",item:this.target.find((t=>t.element===e.addedNodes[0]))[0],previous:this.target.find((t=>t.element===e.previousSibling))[0]}:e.addedNodes&&(this.cache.lastMutation={type:"remove",item:this.target.find((t=>t.element===e.removedNodes[0]))[0],previous:this.target.find((t=>t.element===e.previousSibling))[0]}),this.cache.streamingEnabled&&this.cache.mutationHistory.children.push(this.cache.lastMutation);this.callback&&this.callback(t,e)}}),this.cache.mutationHistory.children=[],e&&this.observe(e)}get item(){return this.cache.lastMutation.item}get history(){return this.cache.mutationHistory.children}}const rs=(t,e)=>new ss(t,e);class is{constructor(t,e,{threshold:s=0,margin:r=0}={}){this.target=t,this.config={threshold:s,margin:r},globalThis.IntersectionObserver?this.observer=new IntersectionObserver((t=>{this.entrie=t[0],e(this)}),{threshold:this.threshold}):console.log("IntersectionObserver Not Supported")}get ratio(){return this.entrie.intersectionRatio}get isIntersecting(){return this.entrie.isIntersecting}setThreshould(t){return this.config.threshold=t,this}setMargin(t){return t="number"==typeof t?t+"px":t,this.config.margin=t,this}start(){return this.observer.observe(this.target.element),this}stop(){return this}}const ns=(t,e,s)=>new is(t,e,s);class os{constructor(t,e){this.target=t,this.contentRect=null,this.observer=new ResizeObserver((()=>{e(this)}))}get BoundingRect(){return this.target.element.getBoundingClientRect()}get width(){return this.BoundingRect.width}get height(){return this.BoundingRect.height}get top(){return this.BoundingRect.top}get bottom(){return this.BoundingRect.bottom}get right(){return this.BoundingRect.right}get left(){return this.BoundingRect.left}get x(){return this.BoundingRect.x}get y(){return this.BoundingRect.y}start(){return this.observer.observe(this.target.element),this}stop(){return this.observer.unobserve(this.target.element),this}}const as=(t,e)=>new os(t,e);class hs{constructor(t=(t=>console.log({x:t.x,y:t.y}))){this.cache={},this.previousX=globalThis?.screenX,this.previousY=globalThis?.screenY}update(){Object.assign(this.cache,{screenXLeft:globalThis?.screenX,screenXRight:globalThis?.screen.availWidth-globalThis?.screenX,screenYTop:globalThis?.screenY,screenYBottom:globalThis?.screen.availHeight-globalThis?.screenY-globalThis?.outerHeight,screenCenterX:globalThis?.screen.availWidth/2,screenCenterY:globalThis?.screen.availHeight/2,windowCenterX:globalThis?.outerWidth/2+globalThis?.screenX,windowCenterY:globalThis?.outerHeight/2+globalThis?.screenY,deltaCenterX:globalThis?.screen.availWidth/2-globalThis?.outerWidth/2+globalThis?.screenX,deltaCenterY:null})}get x0(){return F(globalThis?.screenX,0,globalThis.screen.availWidth,-1,1)}get y0(){return-F(globalThis?.screenY,0,globalThis.screen.availHeight,-1,1)}get x1(){return F(globalThis?.screenX+globalThis?.outerWidth,0,globalThis.screen.availWidth,-1,1)}get y1(){return-F(globalThis?.screenY+globalThis?.outerHeight,0,globalThis.screen.availHeight,-1,1)}get cx(){return F(globalThis?.outerWidth/2+globalThis?.screenX,0,globalThis.screen.availWidth,-1,1)}get cy(){return-F(globalThis?.outerHeight/2+globalThis?.screenY,0,globalThis.screen.availHeight,-1,1)}}const ls=t=>new hs(t);var cs=Object.freeze({__proto__:null,ZikoMutationObserver:Ge,watch:Je,watchAttr:es,watchChildren:rs,watchIntersection:ns,watchScreen:ls,watchSize:as});const us=(t,e=[],s=(()=>{}))=>{t.cache.stream.enabled.down=!0;const r=e.length,i=t.cache.stream.history.down.slice(-r).map((t=>t.key));e.join("")===i.join("")&&(t.event.preventDefault(),s.call(t,t))};function ms(t,...e){const s=t.toString().match(/\(([^)]*)\)/)[1].split(",").map((t=>t.trim()));return function(...r){const i=e[e.length-1];for(let t=0;t<r.length;t++){const n=t>=e.length,o=n?i:e[t],a=r[t];n?(s[s.length-1],e.length):s[t];let h=!1;if("object"==typeof o){if(o.or)for(const t of o.types)if(ps(t,a)){h=!0;break}if(o.nor)for(const t of o.types){if(ps(t,a)){h=!1;break}h=!0}else o.not&&(h=!ps(o.type,a))}else h=ps(o,a);if(!h)throw new TypeError("jjj")}return t(...r)}}const ps=(t,e)=>"string"==typeof t?typeof e===t:t instanceof Function?e instanceof t:Array.isArray(t)?!(!Array.isArray(e)||e.length!==t.length)&&e.every(((e,s)=>ps(t[s],e))):"object"==typeof t&&!Array.isArray(t)&&("object"==typeof e&&null!==e&&Object.keys(t).every((s=>s in e&&ps(t[s],e[s]))));class ds{constructor(t,e=1e3/30,s=0,r=1/0,i=!0){this.callback=t,this.cache={isRunning:!1,AnimationId:null,t0:null,step:e,startTime:s,endTime:r,started:i},this.init(),this.i=0}init(){return this.cache.started&&(this.cache.startTime?this.startAfter(this.cache.startTime):this.start(),this.cache.endTime&&this.cache.endTime!==1/0&&this.stopAfter(this.cache.endTime)),this}start(){return this.cache.isRunning||(this.i=0,this.cache.isRunning=!0,this.cache.t0=Date.now(),this.animate()),this}pause(){return this.cache.isRunning&&(clearTimeout(this.cache.AnimationId),this.cache.isRunning=!1),this}stop(){return this.pause(),this.i=0,this}resume(){return this.cache.isRunning=!0,this.animate(),this}startAfter(t=1e3){return setTimeout(this.start.bind(this),t),this}stopAfter(t=1e3){return setTimeout(this.stop.bind(this),t),this}animate=()=>{if(this.cache.isRunning){const t=Date.now(),e=t-this.cache.t0;e>this.cache.step&&(this.callback(this),this.i++,this.cache.t0=t-e%this.cache.step),this.cache.AnimationId=setTimeout(this.animate,0)}}}const fs=t=>1e3/t,gs=(t,e,s,r,i)=>new ds(t,e,s,r,i);var bs=Object.freeze({__proto__:null,useFps:fs,useTimeLoop:gs});const ys={Linear:function(t){return t},InSin:t=>1-Math.cos(t*Math.PI/2),OutSin:t=>Math.sin(t*Math.PI/2),InOutSin:t=>-(Math.cos(Math.PI*t)-1)/2,InQuad:t=>t**2,OutQuad:t=>1-Math.pow(1-t,2),InOutQuad:t=>t<.5?2*Math.pow(t,2):1-Math.pow(-2*t+2,2)/2,InCubic:t=>t**3,OutCubic:t=>1-Math.pow(1-t,3),InOutCubic:t=>t<.5?4*Math.pow(t,3):1-Math.pow(-2*t+2,3)/2,InQuart:t=>t**4,OutQuart:t=>1-Math.pow(1-t,4),InOutQuart:t=>t<.5?8*Math.pow(t,4):1-Math.pow(-2*t+2,4)/2,InQuint:t=>t**5,OutQuint:t=>1-Math.pow(1-t,5),InOutQuint:t=>t<.5?16*Math.pow(t,5):1-Math.pow(-2*t+2,5)/2,InExpo:t=>0===t?0:Math.pow(2,10*t-10),OutExpo:t=>1===t?1:1-Math.pow(2,-10*t),InOutExpo:t=>0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2,InCirc:t=>1-Math.sqrt(1-Math.pow(t,2)),OutCirc:t=>Math.sqrt(1-Math.pow(t-1,2)),InOutCic:t=>t<.5?(1-Math.sqrt(1-Math.pow(2*t,2)))/2:(Math.sqrt(1-Math.pow(-2*t+2,2))+1)/2,Arc:t=>1-Math.sin(Math.acos(t)),Back:t=>Math.pow(t,2)*(2*t-1),Elastic:t=>-2*Math.pow(2,10*(t-1))*Math.cos(20*Math.PI*t/3*t),InBack(t){const e=1.70158;return 2.70158*Math.pow(t,3)-e*t**2},OutBack(t){const e=1.70158;return 1+2.70158*Math.pow(t-1,3)+e*Math.pow(t-1,2)},InOutBack(t){const e=2.5949095;return t<.5?Math.pow(2*t,2)*(7.189819*t-e)/2:(Math.pow(2*t-2,2)*((e+1)*(2*t-2)+e)+2)/2},InElastic(t){const e=2*Math.PI/3;return 0===t?0:1===t?1:-Math.pow(2,10*t-10)*Math.sin((10*t-10.75)*e)},OutElastic(t){const e=2*Math.PI/3;return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin((10*t-.75)*e)+1},InOutElastic(t){const e=2*Math.PI/4.5;return 0===t?0:1===t?1:t<.5?-Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*e)/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*e)/2+1},InBounce:t=>1-ys.OutBounce(1-t),OutBounce(t){const e=7.5625,s=2.75;return t<1/s?e*t*t:t<2/s?e*(t-=1.5/s)*t+.75:t<2.5/s?e*(t-=2.25/s)*t+.9375:e*(t-=2.625/s)*t+.984375},InOutBounce:t=>t<.5?(1-ys.OutBounce(1-2*t))/2:(1+ys.OutBounce(2*t-1))/2},vs=(t,e=1e3)=>(...s)=>setTimeout((()=>t(...s)),e),ws=(t,e)=>{let s=0;return(...r)=>{const i=(new Date).getTime();i-s<e||(s=i,t(...r))}},xs=t=>{const e=Date.now(),s=performance.memory.usedJSHeapSize,r=t();return{elapsedTime:Date.now()-e,usedMemory:performance.memory.usedJSHeapSize-s,result:r}},_s=t=>new Promise((e=>{if(t.element)return e(t.element);const s=new MutationObserver((()=>{t.element&&(e(t.element),s.disconnect())}));s.observe(document?.body,{childList:!0,subtree:!0})})),ks=(t,e=2e3)=>{const s=Date.now();for(;Date.now()-s<e;)if(t.element)return t.element},Es=t=>new Promise((e=>setTimeout(e,t))),Is=t=>{console.time("timeTaken");const e=t();return console.timeEnd("timeTaken"),e};var As=Object.freeze({__proto__:null,Ease:ys,timeTaken:Is,time_memory_Taken:xs,useDebounce:vs,useThrottle:ws,wait:Es,waitForUIElm:_s,waitForUIElmSync:ks});class Ts{constructor(t,e=ys.Linear,s=50,{t:r=[0,null],start:i=!0,duration:n=3e3}={}){this.cache={isRunning:!1,AnimationId:null,startTime:null,ease:e,step:s,intervall:r,started:i,duration:n},this.t=0,this.tx=0,this.ty=0,this.i=0,this.callback=t}#n(){this.t+=this.cache.step,this.i++,this.tx=F(this.t,0,this.cache.duration,0,1),this.ty=this.cache.ease(this.tx),this.callback(this),this.t>=this.cache.duration&&(clearInterval(this.cache.AnimationId),this.cache.isRunning=!1)}reset(t=!0){return this.t=0,this.tx=0,this.ty=0,this.i=0,t&&this.start(),this}#o(t=!0){return this.cache.isRunning||(t&&this.reset(!1),this.cache.isRunning=!0,this.cache.startTime=Date.now(),this.cache.AnimationId=setInterval(this.#n.bind(this),this.cache.step)),this}start(){return this.#o(!0),this}pause(){return this.cache.isRunning&&(clearTimeout(this.cache.AnimationId),this.cache.isRunning=!1),this}resume(){return this.#o(!1),this}stop(){return this.pause(),this.reset(!1),this}}const Cs={...bs,...bs,...As};let Ss=class{constructor(){this.events={},this.maxListeners=10}on(t,e){this.events[t]||(this.events[t]=[]),this.events[t].push(e),this.events[t].length>this.maxListeners&&console.warn(`Warning: Possible memory leak. Event '${t}' has more than ${this.maxListeners} listeners.`)}once(t,e){const s=r=>{this.off(t,s),e(r)};this.on(t,s)}off(t,e){const s=this.events[t];if(s){const t=s.indexOf(e);-1!==t&&s.splice(t,1)}}emit(t,e){const s=this.events[t];s&&s.forEach((t=>{t(e)}))}clear(t){t?delete this.events[t]:this.events={}}setMaxListener(t,e){this.maxListeners=e}removeAllListeners(t){t?this.events[t]=[]:this.events={}}};const Ms=()=>new Ss;let Os=class{constructor(t,e=!0){this.#i(),this.cache={Emitter:null},e&&this.useEventEmitter(),this.set(t)}#i(){return this.__FavIcon__=document.querySelector("link[rel*='icon']")||document?.createElement("link"),this.__FavIcon__.type="image/x-icon",this.__FavIcon__.rel="shortcut icon",this}set(t){return t!==this.__FavIcon__.href&&(this.__FavIcon__.href=t,this.cache.Emitter&&this.cache.Emitter.emit("ziko:favicon-changed")),this}get current(){return document.__FavIcon__.href}onChange(t){return this.cache.Emitter&&this.cache.Emitter.on("ziko:favicon-changed",t),this}useEventEmitter(){return this.cache.Emitter=Ms(),this}};const js=(t,e)=>new Os(t,e);let Ds=class{constructor({viewport:t,charset:e,description:s,author:r,keywords:i}){this.document=globalThis?.document,this.meta={},this.init({viewport:t,charset:e,description:s,author:r,keywords:i})}init({viewport:t,charset:e,description:s,author:r,keywords:i}){t&&this.setViewport(t),e&&this.setCharset(e),s&&this.describe(s),r&&this.setAuthor(r),i&&this.setKeywords(i)}set(t,e){const s="charset"===(t=t.toLowerCase()),r=s?document.querySelector("meta[charset]"):document.querySelector(`meta[name=${t}]`);return this.meta=r??document?.createElement("meta"),s?this.meta.setAttribute("charset",e):(this.meta.setAttribute("name",t),this.meta.setAttribute("content",e)),r||this.document.head.append(this.meta),this}setCharset(t="utf-8"){return this.set("charset",t),this}describe(t){return this.set("description",t),this}setViewport(t="width=device-width, initial-scale=1.0"){return this.set("viewport",t),this}setKeywords(...t){return t=[...new Set(t)].join(", "),this.set("keywords",t),this}setAuthor(t){return this.set("author",t),this}};const Us=({viewport:t,charset:e,description:s,author:r,keywords:i})=>new Ds({viewport:t,charset:e,description:s,author:r,keywords:i});let Zs=class{constructor(t=document.title,e=!0){this.cache={Emitter:null},e&&this.useEventEmitter(),this.set(t)}useEventEmitter(){return this.cache.Emitter=Ms(),this}set(t){return t!==document.title&&(document.title=t,this.cache.Emitter&&this.cache.Emitter.emit("ziko:title-changed")),this}get current(){return document.title}onChange(t){return this.cache.Emitter&&this.cache.Emitter.on("ziko:title-changed",t),this}};const Rs=(t,e)=>new Zs(t,e);let Ls=class{constructor({title:t,lang:e,icon:s,meta:r,noscript:i}){this.html=globalThis?.document?.documentElement,this.head=globalThis?.document?.head,t&&Rs(t),e&&this.setLang(e),s&&js(s),r&&Us(r),i&&this.setNoScript()}setLang(t){this.html.setAttribute("lang",t)}setNoScript(t){}};const Ps=({title:t,lang:e,icon:s,meta:r,noscript:i})=>new Ls({title:t,lang:e,icon:s,meta:r,noscript:i});let zs=class{constructor(t=""){this.channel=new BroadcastChannel(t),this.EVENTS_DATAS_PAIRS=new Map,this.EVENTS_HANDLERS_PAIRS=new Map,this.LAST_RECEIVED_EVENT="",this.UUID="ziko-channel"+pt.string(10),this.SUBSCRIBERS=new Set([this.UUID])}get broadcast(){return this}emit(t,e){return this.EVENTS_DATAS_PAIRS.set(t,e),this.#a(t),this}on(t,e=console.log){return this.EVENTS_HANDLERS_PAIRS.set(t,e),this.#h(),this}#h(){return this.channel.onmessage=t=>{this.LAST_RECEIVED_EVENT=t.data.last_sended_event;const e=t.data.userId;this.SUBSCRIBERS.add(e);const s=t.data.EVENTS_DATAS_PAIRS.get(this.LAST_RECEIVED_EVENT),r=this.EVENTS_HANDLERS_PAIRS.get(this.LAST_RECEIVED_EVENT);s&&r&&r(s)},this}#a(t){return this.channel.postMessage({EVENTS_DATAS_PAIRS:this.EVENTS_DATAS_PAIRS,last_sended_event:t,userId:this.UUID}),this}close(){return this.channel.close(),this}};const Fs=t=>new zs(t);class Ns{constructor(){this.events={},this.maxListeners=10}on(t,e){this.events[t]||(this.events[t]=[]),this.events[t].push(e),this.events[t].length>this.maxListeners&&console.warn(`Warning: Possible memory leak. Event '${t}' has more than ${this.maxListeners} listeners.`)}once(t,e){const s=r=>{this.off(t,s),e(r)};this.on(t,s)}off(t,e){const s=this.events[t];if(s){const t=s.indexOf(e);-1!==t&&s.splice(t,1)}}emit(t,e){const s=this.events[t];s&&s.forEach((t=>{t(e)}))}clear(t){t?delete this.events[t]:this.events={}}setMaxListener(t,e){this.maxListeners=e}removeAllListeners(t){t?this.events[t]=[]:this.events={}}}const Hs=()=>new Ns;class Bs{#l;constructor(){this.#l=function(t){try{let e=new Function("return "+t.data.fun)()();postMessage({result:e})}catch(t){postMessage({error:t.message})}finally{t.data.close&&self.close()}}.toString(),this.blob=new Blob(["this.onmessage = "+this.#l],{type:"text/javascript"}),this.worker=new Worker(window.URL.createObjectURL(this.blob))}call(t,e,s=!0){return this.worker.postMessage({fun:t.toString(),close:s}),this.worker.onmessage=function(t){t.data.error?console.error(t.data.error):e(t.data.result)},this}}const Vs=(t,e,s)=>{const r=new Bs;return t&&r.call(t,e,s),r};class $s{constructor(t=""){this.channel=new BroadcastChannel(t),this.EVENTS_DATAS_PAIRS=new Map,this.EVENTS_HANDLERS_PAIRS=new Map,this.LAST_RECEIVED_EVENT="",this.UUID="ziko-channel"+pt.string(10),this.SUBSCRIBERS=new Set([this.UUID])}get broadcast(){return this}emit(t,e){return this.EVENTS_DATAS_PAIRS.set(t,e),this.#a(t),this}on(t,e=console.log){return this.EVENTS_HANDLERS_PAIRS.set(t,e),this.#h(),this}#h(){return this.channel.onmessage=t=>{this.LAST_RECEIVED_EVENT=t.data.last_sended_event;const e=t.data.userId;this.SUBSCRIBERS.add(e);const s=t.data.EVENTS_DATAS_PAIRS.get(this.LAST_RECEIVED_EVENT),r=this.EVENTS_HANDLERS_PAIRS.get(this.LAST_RECEIVED_EVENT);s&&r&&r(s)},this}#a(t){return this.channel.postMessage({EVENTS_DATAS_PAIRS:this.EVENTS_DATAS_PAIRS,last_sended_event:t,userId:this.UUID}),this}close(){return this.channel.close(),this}}const qs=t=>new $s(t);class Ws{constructor(t,e,s){this.cache={storage:t,globalKey:e,channel:qs(`Ziko:useStorage-${e}`),oldItemKeys:new Set},this.#i(s),this.#c()}get items(){return JSON.parse(this.cache.storage[this.cache.globalKey]??null)}#c(){for(let t in this.items)Object.assign(this,{[[t]]:this.items[t]})}#i(t){this.cache.channel=qs(`Ziko:useStorage-${this.cache.globalKey}`),this.cache.channel.on("Ziko-Storage-Updated",(()=>this.#c())),t&&(this.cache.storage[this.cache.globalKey]?(Object.keys(this.items).forEach((t=>this.cache.oldItemKeys.add(t))),console.group("Ziko:useStorage"),console.warn(`Storage key '${this.cache.globalKey}' already exists. we will not overwrite it.`),console.info("%cWe'll keep the existing data.","background-color:#2222dd; color:gold;"),console.group("")):this.set(t))}set(t){return this.cache.storage.setItem(this.cache.globalKey,JSON.stringify(t)),this.cache.channel.emit("Ziko-Storage-Updated",{}),Object.keys(t).forEach((t=>this.cache.oldItemKeys.add(t))),this.#c(),this}add(t){const e={...this.items,...t};return this.cache.storage.setItem(this.cache.globalKey,JSON.stringify(e)),this.#c(),this}remove(...t){const e={...this.items};for(let s=0;s<t.length;s++)delete e[t[s]],delete this[t[s]];return this.set(e),this}get(t){return this.items[t]}clear(){return this.cache.storage.removeItem(this.cache.globalKey),this.#c(),this}}const Ys=(t,e)=>new Ws(localStorage,t,e),Xs=(t,e)=>new Ws(sessionStorage,t,e);class Qs{constructor(t={},e=(t.hasOwnProperty("default")?"default":Object.keys(t)[0]),s=0){this.id="Ziko-Style-"+s,this.keys=new Set,this.styles={default:{fontSize:"1em",color:"green"},other:{fontSize:"2em",color:"cyan"}},t&&this.add(t),e&&this.use(e)}get current(){return[...this.keys].reduce(((t,e)=>(t[e]=`var(--${e}-${this.id})`,t)),{})}add(t,e={}){return t&&"object"==typeof t&&!Array.isArray(t)?Object.assign(this.styles,t):"string"==typeof t&&Object.assign(this.styles,{[t]:e}),this}#t(t){const e=Object.keys(this.styles);for(let s in this.styles[e[t]])Object.prototype.hasOwnProperty.call(this.styles[e[t]],s)&&(document.documentElement.style.setProperty(`--${s}-${this.id}`,this.styles[e[t]][s]),this.keys.add(s));return this}#e(t){if(!this.styles[t])return this;for(let e in this.styles[t])Object.prototype.hasOwnProperty.call(this.styles[t],e)&&(document.documentElement.style.setProperty(`--${e}-${this.id}`,this.styles[t][e]),this.keys.add(e));return this}#s(t){for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(document.documentElement.style.setProperty(`--${e}-${this.id}`,t[e]),this.keys.add(e));return this}use(t){return"number"==typeof t?this.#t(t):"string"==typeof t?this.#e(t):t&&"object"==typeof t?this.#s(t):this}}const Ks=(t,e,s)=>new Qs(t,e,s);class Gs{constructor(t=[],e=(()=>{})){this.mediaQueryRules=t,this.fallback=e,this.lastCalledCallback=null,this.init()}init(){this.mediaQueryRules.forEach((({query:t,callback:e})=>{const s=globalThis.matchMedia(t),r=()=>{const t=this.mediaQueryRules.some((({query:t})=>globalThis.matchMedia(t).matches));s.matches?(e(),this.lastCalledCallback=e):t||this.lastCalledCallback===this.fallback||(this.fallback(),this.lastCalledCallback=this.fallback)};r(),s.addListener(r)}))}}const Js=(t,e)=>new Gs(t,e);class tr{constructor(t){this.props={},t&&this.set(t)}get(t){return this.props[t]}set(t){return Object.entries(t).forEach((([t,e])=>this.#u(t,e))),this}#u(t,e){const s=`--${ro.camel2hyphencase(t)}`;document.documentElement.style.setProperty(s,e),Object.assign(this.props,{[t]:`var(${s})`}),Object.assign(this,{[t]:`var(${s})`})}}const er=t=>(t.startsWith("--")||(t=`--${ro.camel2hyphencase(t)}`),`var(${t})`),sr=t=>new tr(t);const rr={...Ke,...cs,...Object.freeze({__proto__:null,ZikoHead:Ls,ZikoUseRoot:tr,ZikoUseStyle:Qs,useChannel:Fs,useDebounce:vs,useEventEmitter:Hs,useFavIcon:js,useHead:Ps,useLocaleStorage:Ys,useMediaQuery:Js,useMeta:Us,useRoot:sr,useRootValue:er,useSessionStorage:Xs,useStyle:Ks,useSuccesifKeys:us,useThread:Vs,useThrottle:ws,useTitle:Rs,useType:ms})};class ir{constructor(t,e="",{el_type:s="html",useDefaultStyle:r=!1}={}){if(this.target=globalThis.__Ziko__.__Config__.default.target||globalThis?.document?.body,"string"==typeof t)switch(s){case"html":t=globalThis?.document?.createElement(t);break;case"svg":t=globalThis?.document?.createElementNS("http://www.w3.org/2000/svg",t);default:throw Error("Not supported")}else this.target=t.parentElement;t&&(this.__ele__=t),this.cache={name:e,parent:null,isBody:!1,isRoot:!1,isHidden:!1,isFrozzen:!1,legacyParent:null,style:new Nt({}),attributes:{},filters:{},temp:{}},this.events={ptr:null,mouse:null,wheel:null,key:null,drag:null,drop:null,click:null,clipboard:null,focus:null,swipe:null,custom:null},this.observer={resize:null,intersection:null},this.uuid=`${this.cache.name}-${pt.string(16)}`,this.ui_index=globalThis.__Ziko__.__CACHE__.get_ui_index(),this.cache.style.linkTo(this),r&&this.style({position:"relative",boxSizing:"border-box",margin:0,padding:0,width:"auto",height:"auto"}),this.items=[],globalThis.__Ziko__.__UI__[this.cache.name]?globalThis.__Ziko__.__UI__[this.cache.name]?.push(this):globalThis.__Ziko__.__UI__[this.cache.name]=[this],t&&globalThis.__Ziko__.__Config__.default.render&&this.render(),this.isInteractive()&&(this.setAttr("ziko-hydration-index",globalThis.__Ziko__.__HYDRATION__.index),globalThis.__Ziko__.__HYDRATION__.map.set(globalThis.__Ziko__.__HYDRATION__.index,(()=>this)),globalThis.__Ziko__.__HYDRATION__.increment())}get element(){return this.__ele__}isInteractive(){return[!0,!1][Math.floor(2*Math.random())]}get isZikoUIElement(){return!0}get st(){return this.cache.style}get attr(){return this.cache.attributes}get evt(){return this.events}get html(){return this.element.innerHTML}get text(){return this.element.textContent}get isBody(){return this.element===globalThis?.document.body}get parent(){return this.cache.parent}get width(){return this.element.getBoundingClientRect().width}get height(){return this.element.getBoundingClientRect().height}get top(){return this.element.getBoundingClientRect().top}get right(){return this.element.getBoundingClientRect().right}get bottom(){return this.element.getBoundingClientRect().bottom}get left(){return this.element.getBoundingClientRect().left}clone(t=!1){const e=new this.constructor;if(e.__proto__=this.__proto__,this.items.length){const t=[...this.items].map((t=>t.clone()));e.append(...t)}else e.element=this.element.cloneNode(!0);return e.render(t)}style(t){return t instanceof zt?this.st.style(t.current):this.st.style(t),this}size(t,e){return this.st.size(t,e),this}maintain(){for(let t=0;t<this.items.length;t++)Object.assign(this,{[[t]]:this.items[t]});return this.length=this.items.length,this}at(t){return this.items.at(t)}#m(t,e,...s){if(this.cache.isFrozzen)return console.warn("You can't append new item to frozzen element"),this;for(let r=0;r<s.length;r++)["number","string"].includes(typeof s[r])&&(s[r]=pr(s[r])),s[r]instanceof Node&&(s[r]=new ir(s[r])),s[r]?.isZikoUIElement?(s[r].cache.parent=this,this.element[t](s[r].element),s[r].target=this.element,this.items[e](s[r])):s[r]instanceof Object&&(s[r]?.style&&this.style(s[r]?.style),s[r]?.attr&&Object.entries(s[r].attr).forEach((t=>this.setAttr(""+t[0],t[1]))));return this.maintain(),this}append(...t){return this.#m("append","push",...t),this}prepend(...t){return this.#m("prepend","unshift",...t),this}insertAt(t,...e){if(t>=this.element.children.length)this.append(...e);else for(let s=0;s<e.length;s++)["number","string"].includes(typeof e[s])&&(e[s]=pr(e[s])),this.element?.insertBefore(e[s].element,this.items[t].element),this.items.splice(t,0,e[s]);return this}remove(...t){const e=t=>{"number"==typeof t&&(t=this.items[t]),t?.isZikoUIElement&&this.element?.removeChild(t.element),this.items=this.items.filter((e=>e!==t))};for(let s=0;s<t.length;s++)e(t[s]);for(let t=0;t<this.items.length;t++)Object.assign(this,{[[t]]:this.items[t]});return this}forEach(t){return this.items.forEach(t),this}map(t){return this.items.map(t)}find(t){return this.items.filter(t)}filter(t,e=(()=>{}),s=(()=>{})){const r=this.items.filter(t);return r.forEach(e),this.items.filter((t=>!r.includes(t))).forEach(s),this}filterByTextContent(t,e=!1){this.items.forEach((t=>t.render())),this.filter((s=>!(e?s.text===t:s.text.includes(t))),(t=>t.unrender()))}filterByClass(t){return this.items.map((t=>t.render())),this.items.filter((e=>!e.classes.includes(t))).map((t=>t.unrender())),this}sortByTextContent(t,e){let s=this.children;return s.filter((e=>!e.textContent.toLowerCase().includes(t.toLowerCase()))).map((t=>{t.style.display="none"})),s.filter((e=>e.textContent.toLowerCase().includes(t.toLowerCase()))).map(((t,s)=>t.style.display=e[s])),s.filter((t=>"none"!=t.style.display)),this}get#p(){const t=globalThis.getComputedStyle(this.element),e={};return"0px"!==t.marginRight&&Object.assign(e,{marginLeft:t.marginRight}),"0px"!==t.marginLeft&&Object.assign(e,{marginRight:t.marginLeft}),"0px"!==t.paddingRight&&Object.assign(e,{paddingLeft:t.paddingRight}),"0px"!==t.paddingLeft&&Object.assign(e,{paddingRight:t.paddingLeft}),"0px"!==t.left&&Object.assign(e,{right:t.left}),"0px"!==t.right&&Object.assign(e,{left:t.right}),"right"===t.textAlign&&Object.assign(e,{textAlign:"left"}),"left"===t.textAlign&&Object.assign(e,{textAlign:"right"}),"right"===t.float&&Object.assign(e,{float:"left"}),"left"===t.float&&Object.assign(e,{float:"right"}),"0px"!==t.borderRadiusLeft&&Object.assign(e,{right:t.borderRadiusRight}),"0px"!==t.borderRadiusRight&&Object.assign(e,{right:t.borderRadiusLeft}),["flex","inline-flex"].includes(t.display)&&("flex-end"===t.justifyContent&&Object.assign(e,{justifyContent:"flex-start"}),"flex-start"===t.justifyContent&&Object.assign(e,{justifyContent:"flex-end"})),e}useRtl(t=!1){return t?this.style({...this.#p,direction:"rtl"}):this.style({direction:"rtl"}),this}useLtr(t=!1){return t?this.style({...this.#p,direction:"ltr"}):this.style({direction:"ltr"}),this}freeze(t){return this.cache.isFrozzen=t,this}setTarget(t){if(!this.isBody)return t?.isZikoUIElement&&(t=t.element),this.unrender(),this.target=t,this.render(),this}describe(t){t&&this.setAttr("aria-label",t)}clear(){return this?.items?.forEach((t=>t.unrender())),this.element.innerHTML="",this}render(t=this.target){if(!this.isBody)return t?.isZikoUIElement&&(t=t.element),this.target=t,this.target?.appendChild(this.element),this}unrender(){return this.cache.parent?this.cache.parent.remove(this):this.target?.children?.length&&[...this.target?.children].includes(this.element)&&this.target.removeChild(this.element),this}renderAfter(t=1){return setTimeout((()=>this.render()),t),this}unrenderAfter(t=1){return setTimeout((()=>this.unrender()),t),this}after(t){return t?.isZikoUIElement&&(t=t.element),this.element?.after(t),this}before(t){return t?.isZikoUIElement&&(t=t.element),this.element?.before(t),this}animate(t,{duration:e=1e3,iterations:s=1,easing:r="ease"}={}){return this.element?.animate(t,{duration:e,iterations:s,easing:r}),this}#d(t,e){"svg"!==this.element.tagName&&(t=ro.isCamelCase(t)?ro.camel2hyphencase(t):t),this?.attr[t]&&this?.attr[t]===e||(this.element.setAttribute(t,e),Object.assign(this.cache.attributes,{[t]:e}))}setAttr(t,e){if(t instanceof Object){const[s,r]=[Object.keys(t),Object.values(t)];for(let t=0;t<s.length;t++)r[t]instanceof Array&&(e[t]=r[t].join(" ")),this.#d(s[t],r[t])}else e instanceof Array&&(e=e.join(" ")),this.#d(t,e);return this}removeAttr(...t){for(let e=0;e<t.length;e++)this.element?.removeAttribute(t[e]);return this}getAttr(t){return t=ro.isCamelCase(t)?ro.camel2hyphencase(t):t,this.element.attributes[t].value}setContentEditable(t=!0){return this.setAttr("contenteditable",t),this}get children(){return[...this.element.children]}get cloneElement(){return this.element.cloneNode(!0)}setClasses(...t){return this.setAttr("class",t.join(" ")),this}get classes(){const t=this.element.getAttribute("class");return null===t?[]:t.split(" ")}addClass(){}setId(t){return this.setAttr("id",t),this}get id(){return this.element.getAttribute("id")}onPtrMove(...t){return this.events.ptr||(this.events.ptr=se(this)),this.events.ptr.onMove(...t),this}onPtrDown(...t){return this.events.ptr||(this.events.ptr=se(this)),this.events.ptr.onDown(...t),this}onPtrUp(...t){return this.events.ptr||(this.events.ptr=se(this)),this.events.ptr.onUp(...t),this}onPtrEnter(...t){return this.events.ptr||(this.events.ptr=se(this)),this.events.ptr.onEnter(...t),this}onPtrLeave(...t){return this.events.ptr||(this.events.ptr=se(this)),this.events.ptr.onLeave(...t),this}onPtrOut(...t){return this.events.ptr||(this.events.ptr=se(this)),this.events.ptr.onOut(...t),this}onPtrCancel(...t){return this.events.ptr||(this.events.ptr=se(this)),this.events.ptr.onCancel(...t),this}onSwipe(t,e,...s){return this.events.swipe||(this.events.swipe=Qe(this,t,e)),this.events.swipe.onSwipe(...s),this}onMouseMove(...t){return this.events.mouse||(this.events.mouse=ue(this)),this.events.mouse.onMove(...t),this}onMouseDown(...t){return this.events.mouse||(this.events.mouse=ue(this)),this.events.mouse.onDown(...t),this}onMouseUp(...t){return this.events.mouse||(this.events.mouse=ue(this)),this.events.mouse.onUp(...t),this}onMouseEnter(...t){return this.events.mouse||(this.events.mouse=ue(this)),this.events.mouse.onEnter(...t),this}onMouseLeave(...t){return this.events.mouse||(this.events.mouse=ue(this)),this.events.mouse.onLeave(...t),this}onMouseOut(...t){return this.events.mouse||(this.events.mouse=ue(this)),this.events.mouse.onOut(...t),this}onWheel(...t){return this.events.wheel||(this.events.wheel=de(this)),this.events.wheel.onWheel(...t),this}onKeyDown(...t){return this.events.key||(this.events.key=ve(this)),this.events.key.onDown(...t),this}onKeyPress(...t){return this.events.key||(this.events.key=ve(this)),this.events.key.onPress(...t),this}onKeyUp(...t){return this.events.key||(this.events.key=ve(this)),this.events.key.onUp(...t),this}onKeysDown({keys:t=[],callback:e}={}){return this.events.key||(this.events.key=ve(this)),this.events.key.handleSuccessifKeys({keys:t,callback:e}),this}onDragStart(...t){return this.events.drag||(this.events.drag=Ae(this)),this.events.drag.onStart(...t),this}onDrag(...t){return this.events.drag||(this.events.drag=Ae(this)),this.events.drag.onDrag(...t),this}onDragEnd(...t){return this.events.drag||(this.events.drag=Ae(this)),this.events.drag.onEnd(...t),this}onDrop(...t){return this.events.drop||(this.events.drop=Te(this)),this.events.drop.onDrop(...t),this}onClick(...t){return this.events.click||(this.events.click=Wt(this)),this.events.click.onClick(...t),this}onDbClick(...t){return this.events.click||(this.events.click=Wt(this)),this.events.click.onDbClick(...t),this}onCopy(...t){return this.events.clipboard||(this.events.clipboard=De(this)),this.events.clipboard.onCopy(...t),this}onCut(...t){return this.events.clipboard||(this.events.clipboard=De(this)),this.events.clipboard.onCut(...t),this}onPaste(...t){return this.events.clipboard||(this.events.clipboard=De(this)),this.events.clipboard.onPaste(...t),this}onSelect(...t){return this.events.clipboard||(this.events.clipboard=De(this)),this.events.clipboard.onSelect(...t),this}onFocus(...t){return this.events.focus||(this.events.focus=Le(this)),this.events.focus.onFocus(...t),this}onBlur(...t){return this.events.focus||(this.events.focus=Le(this)),this.events.focus.onFocus(...t),this}on(t,...e){return this.events.custom||(this.events.custom=We(this)),this.events.custom.on(t,...e),this}emit(t,e={}){return this.events.custom||(this.events.custom=We(this)),this.events.custom.emit(t,e),this}watchAttr(t){return this.observer.attr||(this.observer.attr=es(this,t)),this}watchChildren(t){return this.observer.children||(this.observer.children=rs(this,t)),this}watchSize(t){return this.observer.resize||(this.observer.resize=as(this,t)),this.observer.resize.start(),this}watchIntersection(t,e){return this.observer.intersection||(this.observer.intersection=ns(this,t,e)),this.observer.intersection.start(),this}setFullScreen(t=!0,e){return this.element.requestFullscreen?(t?this.element.requestFullscreen(e):globalThis.document.exitFullscreen(),this):(console.error("Fullscreen API is not supported in this browser."),this)}toggleFullScreen(t){return globalThis.document.fullscreenElement?globalThis.document.exitFullscreen():this.element.requestFullscreen(t),this}toPdf(){return __ZikoPdf__,this}}class nr extends ir{constructor(t,e,s,...r){super(t,e),this.addValue(...r),this.style({margin:0,padding:0}),Object.assign(this.cache,{lineBreak:s})}get isText(){return!0}get value(){return this.element.textContent}clear(){return this.element.childNodes.forEach((t=>t.remove())),this.element.textContent="",this}addValue(...t){return t.forEach(((t,e)=>{"string"==typeof t||"number"==typeof t?this.element?.appendChild(globalThis?.document.createTextNode(t)):t instanceof ir?this.element?.appendChild(t.element):t instanceof bo||t instanceof lo?this.element?.appendChild(new Text(t.toString())):t instanceof Array?this.element?.appendChild(new Text(Kn(t))):t instanceof Object&&this.element?.appendChild(new Text(Xn(t))),this.cache.lineBreak&&this.element?.appendChild(globalThis.document?.createElement("br"))})),this}setValue(...t){return this.clear(),this.addValue(...t),this}}class or extends nr{constructor(...t){super("span","text",!1,...t)}}class ar extends nr{constructor(...t){super("q","quote",!1,...t),this.style({fontStyle:"italic"})}get isQuote(){return!0}}class hr extends nr{constructor(...t){super("dfn","dfnText",!1,...t)}get isDfnText(){return!0}}class lr extends nr{constructor(t){super("sup","supText",!1,t)}get isSupText(){return!0}}class cr extends nr{constructor(...t){super("sub","subText",!1,...t)}get isSubText(){return!0}}class ur extends nr{constructor(...t){super("code","codeText",!1,...t)}get isCodeText(){return!0}}class mr extends nr{constructor(t,e){super("abbr","abbrText",!1,t),this.setAttr("title",e)}get isAbbrText(){return!0}}const pr=(...t)=>new or(...t),dr=(...t)=>new ar(...t),fr=(...t)=>new hr(...t),gr=(...t)=>new lr(...t),br=(...t)=>new cr(...t),yr=(...t)=>new ur(...t),vr=(t,e)=>new mr(t,e);class wr extends nr{constructor(...t){super("p","p",!0,...t)}get isPara(){return!0}}class xr extends nr{constructor(t,e){super("blockquote","blockquote",!0,e),this.setAttr("cite",t)}get isBlockQuote(){return!0}}const _r=(...t)=>new wr(...t),kr=(t,e)=>new xr(t,e);class Er extends ir{constructor(t=1,e=""){super(`h${t}`,`h${t}`),this.element.textContent=e}get isHeading(){return!0}get value(){return this.element.innerText}setValue(t=""){this.element.innerText=t}addValue(t=""){return this.element.innerText+=t,this}}const Ir=(t="")=>new Er(1,t),Ar=(t="")=>new Er(2,t),Tr=(t="")=>new Er(3,t),Cr=(t="")=>new Er(4,t),Sr=(t="")=>new Er(5,t),Mr=(t="")=>new Er(6,t);var Or=Object.freeze({__proto__:null,ZikoUIAbbrText:mr,ZikoUIBlockQuote:xr,ZikoUICodeText:ur,ZikoUIDefintion:hr,ZikoUIHeading:Er,ZikoUIParagraphe:wr,ZikoUIQuote:ar,ZikoUISubText:cr,ZikoUISupText:lr,ZikoUIText:or,abbrText:vr,blockQuote:kr,codeText:yr,dfnText:fr,h1:Ir,h2:Ar,h3:Tr,h4:Cr,h5:Sr,h6:Mr,p:_r,quote:dr,subText:br,supText:gr,text:pr});class jr extends ir{constructor(t){super("li","li"),this.append(t)}get isLi(){return!0}}class Dr extends ir{constructor(t,e){super(t,e),delete this.append,this.style({listStylePosition:"inside"})}get isList(){return!0}append(...t){for(let e=0;e<t.length;e++){let s=null;["string","number"].includes(typeof t[e])&&(t[e]=pr(t[e])),t[e]instanceof ir&&(s=new jr(t[e])),s.setTarget(this.element),this.items.push(s[0]),this.maintain()}}remove(...t){if(0==t.length)this.target.children.length&&this.target.removeChild(this.element);else{const e=t=>{"number"==typeof t&&(t=this.items[t]),t instanceof ir&&this.element?.removeChild(t.parent.element),this.items=this.items.filter((e=>e!==t))};for(let s=0;s<t.length;s++)e(t[s]);for(let t=0;t<this.items.length;t++)Object.assign(this,{[[t]]:this.items[t]})}return this}insertAt(t,...e){if(t>=this.element.children.length)this.append(...e);else for(let s=0;s<e.length;s++){let r=null;["number","string"].includes(typeof e[s])&&(e[s]=pr(e[s])),e[s]instanceof ir&&(r=new jr(e[s])),this.element?.insertBefore(r.element,this.items[t].parent.element),this.items.splice(t,0,e[s][0])}return this}filterByTextContent(t,e=!1){return this.items.map((t=>t.parent.render())),this.items.filter((s=>{const r=s.element.textContent;return!(e?r===t:r.includes(t))})).map((t=>t.parent.render(!1))),this}sortByTextContent(t=1){return this.items.map((t=>t.parent.render(!1))),this.sortedItems=this.items.sort(((e,s)=>t*e.element.textContent.localeCompare(s.element.textContent))),this.append(...this.sortedItems),this}filterByClass(t){return this.items.map((t=>t.parent.render(!0))),this.items.filter((e=>!e.Classes.includes(t))).map((t=>t.parent.render(!1))),this}delete(t){return[...this.element.children].indexOf(t)}push(){}pop(){}unshift(){}shift(){}sort(){}filter(){}slice(){}}class Ur extends Dr{constructor(...t){super("ol","ol"),this.append(...t)}get isOl(){return!0}type(t=1){return this.element?.setAttribute("type",t),this}start(t=1){return this.element?.setAttribute("start",t),this}}class Zr extends Dr{constructor(...t){super("ul","ul"),this.append(...t)}get isUl(){return!0}}const Rr=t=>new jr(t),Lr=(...t)=>new Ur(...t),Pr=(...t)=>new Zr(...t);var zr=Object.freeze({__proto__:null,li:Rr,ol:Lr,ul:Pr});class Fr extends ir{constructor(t,e,s="",r){super("input","input"),Object.assign(this.events,{input:null}),this.setValue(s),this.setAttr("type",t),this.setAttr("name",e),r&&this.linkDatalist(r)}get isInput(){return!0}setName(t){return this.setAttr("name",t),this}onInput(...t){return this.events.input||(this.events.input=Ne(this)),this.events.input.onInput(...t),this}onChange(...t){return this.events.input||(this.events.input=Ne(this)),this.events.input.onChange(...t),this}linkDatalist(t){let e;if(t instanceof ZikoUIInputDatalist)e=t.Id;else if(t instanceof Array){const s=new ZikoUIInputDatalist(...t);e=s.Id,console.log(s)}else e=t;return this.element?.setAttribute("list",e),this}get value(){return this.element.value}setValue(t=""){return this.element.value=t,this}useState(t){return this.setValue(t),[{value:this.value},t=>this.setValue(t)]}setPlaceholder(t){return t&&(this.element.placeholder=t),this}get isValide(){return this.element.checkValidity()}setRequired(t=!0){return this.element.required=t,this}select(){return this.element.select(),this}copy(){return this.element.select(),document.execCommand("copy"),this}cut(){return this.element.select(),document.execCommand("cut"),this}accept(t){return this.element.accept=t,this}}const Nr=(t,e)=>{if(t instanceof Object){const{datalist:e,placeholder:s}=t;return t=t.value??"",new Fr("text","input",t,e).setPlaceholder(s)}return new Fr("text","input",t,e)};class Hr extends Fr{constructor(t,e,s=1){super("number","inpuNumber"),this.setMin(t).setMax(e).setStep(s)}get isInputNumber(){return!0}get value(){return+this.element.value}setMin(t){return this.element.min=t,this}setMax(t){return this.element.max=t,this}setStep(t){return this.element.step=t,this}}const Br=(t,e,s)=>{if(t instanceof Object){const{value:e,max:s=10,step:r=1,placeholder:i=""}=t;return t=t?.min??0,new ZikoUIInputSlider(t,s,r).setValue(e).setPlaceholder(i)}return new Hr(t,e,s)};let Vr=class extends Fr{constructor(t=0,e=0,s=10,r=1){super("range","inputSlider"),this.setMin(e).setMax(s).setValue(t).setStep(r)}get isInputSlider(){return!0}setMin(t){return this.element.min=t,this}setMax(t){return this.element.max=t,this}setStep(t){return this.element.step=t,this}};const $r=(t,e,s,r)=>{if(t instanceof Object){const{min:e=0,max:s=10,step:r=1}=t;return new Vr(t=t?.value??5,e,s,r)}return new Vr(t,e,s,r)};class qr extends Fr{constructor(){super("color","inputColor"),this.background(this.value),this.onInput((()=>this.background(this.value)))}get isInputColor(){return!0}}const Wr=()=>new qr;class Yr extends Fr{constructor(){super("search","inputSearch"),this.Length=0}get isInputSearch(){return!0}onsearch(t){return this.element?.addEventListener("search",(()=>t())),this}connect(...t){return this}displayLength(t){return this.element?.addEventListener("keyup",(()=>t.setValue(this.Length))),this}}const Xr=(...t)=>(new Yr).connect(...t);class Qr extends Fr{constructor(){super("checkbox","inputCheckbox"),this.cursor("pointer")}get isInputCheckbox(){return!0}get checked(){return this.element.checked}check(t=!0){return this.element.checked=t,this}color(t){return this.element.style.accentColor=t,this}}const Kr=()=>new Qr;class Gr extends Fr{constructor(){super("radio","inputRadio"),this.cursor("pointer")}get isInputRadio(){return!0}get checked(){return this.element.checked}check(t=!0){return this.element.checked=t,this}color(t){return this.element.style.accentColor=t,this}}const Jr=()=>new Gr;class ti extends Fr{constructor(){super("email","inputEmail")}get isInputEmail(){return!0}}const ei=()=>new ti;class si extends Fr{constructor(){super("password","inputPassword")}get isInputPassword(){return!0}}const ri=()=>new si;class ii extends Fr{constructor(){super("date","inputDate")}get isInputDate(){return!0}}const ni=()=>new ii;class oi extends Fr{constructor(){super("time","inputTime")}get isInputTime(){return!0}}const ai=()=>new oi;class hi extends Fr{constructor(){super("datetime-local","inputDateTime")}get isInputDateTime(){return!0}}const li=()=>new hi;class ci extends ir{constructor(t,e){super("div",""),this.element.append("svg"===e?function(t){if(globalThis?.DOMParser){return(new DOMParser).parseFromString(t.replace(/\s+/g," ").trim(),"image/svg+xml").documentElement}}(t):function(t){if(globalThis?.DOMParser){const e=(new DOMParser).parseFromString(`<div>${t}</div>`,"text/html");return e.body.firstChild.style.display="contents",e.body.firstChild}}(t))}}class ui extends ci{constructor(t){super(t,"html")}}class mi extends ci{constructor(t){super(t,"svg")}}const pi=t=>new ui(t),di=t=>new mi(t);class fi extends ir{constructor(t,e){super("div","suspense"),this.setAttr({dataTemp:"suspense"}),this.fallback_ui=t,this.append(t),(async()=>{try{const s=await e();t.unrender(),this.append(s)}catch(t){console.log({error:t})}})()}}const gi=(t,e)=>new fi(t,e),bi=(t,e,s,...r)=>{const{name:i,style:n,...o}=s;let a=new ir(t,i,e);return n&&a.style(n),o&&a.setAttr(o),r&&a.append(...r),a},yi=(t,e={},...s)=>bi(t,"html",e,...s),vi=(t,e={},...s)=>bi(t,"svg",e,...s),wi=["a","abb","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","i","iframe","img","ipnut","ins","kbd","label","legend","li","main","map","mark","menu","meter","nav","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","small","source","span","strong","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"].reduce(((t,e)=>(t[e]=(t,...s)=>yi(e,t,...s),t)),{}),xi=["svg","g","defs","symbol","use","image","switch","rect","circle","ellipse","line","polyline","polygon","path","text","tspan","textPath","altGlyph","altGlyphDef","altGlyphItem","glyph","glyphRef","linearGradient","radialGradient","pattern","solidColor","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncR","feFuncG","feFuncB","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","animate","animateMotion","animateTransform","set","script","desc","title","metadata","foreignObject"].reduce(((t,e)=>(t[e]=(t,...s)=>yi(e,t,...s),t)),{});class _i extends ir{constructor(t){super(t,"html")}}class ki extends ir{constructor(t="button"){super("button","btn"),this.setValue(t),this.st.cursor("pointer"),globalThis.__Ziko__.__Config__.default.render&&this.render()}get isBtn(){return!0}setValue(t){return t instanceof ir?t.setTarget(this.element):(this.element?.appendChild(document.createTextNode("")),this.element.childNodes[0].data=t),this}get value(){return this.element.innerText}toggleValues(...t){let e=(t=t.map((t=>""+t))).indexOf(""+this.value);return-1!=e&&e!=t.length-1?this.setValue(t[e+1]):this.setValue(t[0]),this}}class Ei extends ir{constructor(){super("br","br")}get isBr(){return!0}}class Ii extends ir{constructor(){super("hr","hr"),this.setAttr("role","none")}get isHr(){return!0}}class Ai extends ir{constructor(t){super("a","link"),Object.assign(this.cache,{defaultStyle:{color:"#0275d8",textDecoration:"none"},hoverStyle:{color:"#01447e",textDecoration:"underline"}}),this.setHref(t),this.style(this.cache.defaultStyle),this.onPtrEnter((()=>this.style(this.cache.hoverStyle))),this.onPtrLeave((()=>this.style(this.cache.defaultStyle)))}setHref(t){this.element.href=t}get isLink(){return!0}}const Ti=()=>new Ei,Ci=()=>new Ii,Si=(t=1)=>new Array(t).fill(new Ei),Mi=(t=1)=>new Array(t).fill(new Ii),Oi=(t,...e)=>new Ai(t).append(...e),ji=(t,...e)=>new _i(t).append(...e),Di=t=>new ki(t);var Ui=Object.freeze({__proto__:null,HTMLWrapper:pi,SVGWrapper:di,Suspense:gi,ZikoUIBr:Ei,ZikoUIHTMLWrapper:ui,ZikoUIHr:Ii,ZikoUIHtmlTag:_i,ZikoUILink:Ai,ZikoUISVGWrapper:mi,ZikoUISuspense:fi,ZikoUIXMLWrapper:ci,br:Ti,brs:Si,btn:Di,h:yi,hTags:wi,hr:Ci,hrs:Mi,html:ji,link:Oi,s:vi,sTags:xi});class Zi extends ir{constructor(t="File"){super("inputImage"),this._aux_element=Di(t).setTarget(this.target),this.element=document?.createElement("input"),this.element?.setAttribute("type","file"),this.element?.setAttribute("accept","image"),this._aux_element.onClick((()=>this.element.click())),this.element.onChange=this.handleImage.bind(this)}get isInputImage(){return!0}handleImage(t){const e=new FileReader,s=new Image;e.onload=function(t){s.src=t.target.result,console.log(s.src)},e.readAsDataURL(t.target.files[0]),this.img=s}get value(){return this.img}render(t=!0){return t?this.target.appendChild(this._aux_element.element):this.remove(),this}remove(){return this.target.children.length&&this.target.removeChild(this._aux_element.element),this}}const Ri=t=>new Zi(t);class Li extends ir{constructor(t,e,s,r){super("img","image"),this.value=t,"IMG"===t.nodeName?this.element.setAttribute("src",t.src):this.element?.setAttribute("src",t),"number"==typeof s&&(s+="%"),"number"==typeof r&&(r+="%"),this.setAttr("alt",e),this.style({border:"1px solid black",width:s,height:r})}get isImg(){return!0}updateSrc(t){return this.value=t,this.element.src=t,this}toggleSrc(...t){let e=(t=t.map((t=>""+t))).indexOf(""+this.value);return-1!=e&&e!=t.length-1?this.updateSrc(t[e+1]):this.updateSrc(t[0]),this}alt(t){return this.element.alt=t,this}}const Pi=(t,e,s,r)=>new Li(t,e,s,r);class zi extends ir{constructor(t,e){super("figure","figure"),this.img=t.width("100%").element,this.caption=document?.createElement("figcaption"),this.caption.append(e.element),this.element?.append(this.img),this.element?.append(this.caption)}get isFigure(){return!0}}const Fi=(t,e)=>new zi(t,e);class Ni extends ir{constructor(t,e){super(t,e),this.useControls()}get t(){return this.element.currentTime}useControls(t=!0){return this.element.controls=t,this}enableControls(){return this.element.controls=!0,this}disableControls(){return this.element.controls=!0,this}toggleControls(){return this.element.controls=!this.element.controls,this}play(){return this.element.play(),this}pause(){return this.element.pause(),this}seekTo(t){return this.element.currentTime=t,this}onPlay(){}onPause(){}}class Hi extends Ni{constructor(t="",e="100%",s="50vh"){super("video","video"),"VIDEO"===t.nodeName?this.element?.setAttribute("src",t.src):this.element?.setAttribute("src",t),"number"==typeof e&&(e+="%"),"number"==typeof s&&(s+="%"),this.style({width:e,height:s})}get isVideo(){return!0}usePoster(t=""){return this.element.poster=t,this}usePIP(t){return this.element.requestPictureInPicture(t),this}}const Bi=(t,e,s)=>new Hi(t,e,s);class Vi extends Ni{constructor(t){super("audio","audio"),this.element?.setAttribute("src",t),this.size("150px","30px")}get isAudio(){return!0}}const $i=t=>new Vi(t);var qi=Object.freeze({__proto__:null,ZikoUIAudio:Vi,ZikoUIFigure:zi,ZikoUIImage:Li,ZikoUIVideo:Hi,audio:$i,figure:Fi,image:Pi,video:Bi});class Wi extends Hi{constructor(){super(),this.element?.setAttribute("src",""),this.constraints={audio:!0,video:{width:1280,height:720}}}get isInputCamera(){return!0}start(){return navigator.mediaDevices.getUserMedia(this.constraints).then((t=>{this.element.srcObject=t,this.element.onloadedmetadata=()=>{this.element.play()}})).catch((function(t){console.log(t.name+": "+t.message)})),this}}const Yi=()=>new Wi;class Xi extends ir{constructor(){super(),this.element=document?.createElement("label")}get isLabel(){return!0}}class Qi extends ir{constructor(t=""){super(),this.element=document?.createElement("option"),t instanceof Object&&"value"in t?(this.setValue(t.value),this.setText(t?.text??t.value)):this.setValue(t)}setValue(t=""){return this.element.value=t,this}setText(t=""){return t&&(this.element.textContent=t),this}}let Ki=class extends ir{constructor(...t){super(),this.element=document?.createElement("datalist"),this.addOptions(...t).setId("ziko-datalist-id"+pt.string(10))}get isDatalist(){return!0}addOptions(...t){return t.map((t=>this.append(new Qi(t)))),this}};const Gi=(...t)=>new Ki(...t);class Ji extends ir{constructor(){super(),this.element=document?.createElement("select")}addOptions(...t){return t.map((t=>this.append(new Qi(t)))),this}get isSelect(){return!0}}const tn=()=>new Ji;class en extends ir{constructor(){super(),this.element=document?.createElement("textarea")}get value(){return this.element.textContent}get isTextArea(){return!0}}const sn=()=>new en;class rn extends ir{constructor(t="div",e="100%",s="100%"){super(t,"Flex"),this.direction="cols","number"==typeof e&&(e+="%"),"number"==typeof s&&(s+="%"),this.style({width:e,height:s}),this.style({display:"flex"})}get isFlex(){return!0}resp(t,e=!0){return this.wrap(e),this.element.clientWidth<t?this.vertical():this.horizontal(),this}setSpaceAround(){return this.style({justifyContent:"space-around"}),this}setSpaceBetween(){return this.style({justifyContent:"space-between"}),this}setBaseline(){return this.style({alignItems:"baseline"}),this}gap(t){return"row"===this.direction?this.style({columnGap:t}):"column"===this.direction&&this.style({rowGap:t}),this}wrap(t="wrap"){return this.style({flexWrap:"string"==typeof t?t:["no-wrap","wrap","wrap-reverse"][+t]}),this}_justifyContent(t="center"){return this.style({justifyContent:t}),this}vertical(t,e,s=1){return on.call(this,s),this.style({alignItems:"number"==typeof t?hn.call(this,t):t,justifyContent:"number"==typeof e?ln.call(this,e):e}),this}horizontal(t,e,s=1){return an.call(this,s),this.style({alignItems:"number"==typeof e?ln.call(this,e):e,justifyContent:"number"==typeof t?hn.call(this,t):t}),this}show(){return this.isHidden=!1,this.style({display:"flex"}),this}}const nn=(...t)=>{let e="div";return"string"==typeof t[0]&&(e=t[0],t.pop()),new rn(e).append(...t)};function on(t){return 1==t?this.style({flexDirection:"column"}):-1==t&&this.style({flexDirection:"column-reverse"}),this}function an(t){return 1==t?this.style({flexDirection:"row"}):-1==t&&this.style({flexDirection:"row-reverse"}),this}function hn(t){return"number"==typeof t&&(t=["flex-start","center","flex-end"][t+1]),t}function ln(t){return hn(-t)}var cn=Object.freeze({__proto__:null,Flex:nn,ZikoUIFlex:rn});class un extends rn{constructor(...t){super("form","Form"),this.append(...t),this.setMethod("POST"),this.setAction("/")}setAction(t="/"){return this.setAttr("action",t),this}setMethod(t="post"){return this.setAttr("method",t),this}get data(){let t=new FormData(this.element);return this.items.forEach((e=>{(e.isInput||e.isSelect||e.isTextarea)&&t.append(e.element.name,e.value)})),t}sendFormData(){return fetch(this.element.action,{method:this.element.method,body:this.data}).then((t=>t.json())).then((t=>console.log(t))).catch((t=>console.error("Error:",t))),this}getByName(t){return this.data.get(t)}}const mn=(...t)=>new un(...t);var pn=Object.freeze({__proto__:null,Form:mn,ZikoUIForm:un,ZikoUIInput:Fr,ZikoUIInputCheckbox:Qr,ZikoUIInputColor:qr,ZikoUIInputDatalist:Ki,ZikoUIInputDate:ii,ZikoUIInputDateTime:hi,ZikoUIInputEmail:ti,ZikoUIInputImage:Zi,ZikoUIInputNumber:Hr,ZikoUIInputOption:Qi,ZikoUIInputPassword:si,ZikoUIInputRadio:Gr,ZikoUIInputSearch:Yr,ZikoUIInputSlider:Vr,ZikoUIInputTime:oi,ZikoUILabel:Xi,ZikoUISelect:Ji,ZikoUITextArea:en,checkbox:Kr,datalist:Gi,input:Nr,inputCamera:Yi,inputColor:Wr,inputDate:ni,inputDateTime:li,inputEmail:ei,inputImage:Ri,inputNumber:Br,inputPassword:ri,inputTime:ai,radio:Jr,search:Xr,select:tn,slider:$r,textarea:sn});class dn extends ir{constructor(...t){super(),this.element=document?.createElement("Tr"),this.append(...t)}}class fn extends ir{constructor(...t){super(),this.element=document?.createElement("Td"),this.append(...t)}}class gn extends ir{constructor(...t){super(),this.element=document?.createElement("Thead"),this.append(...t)}}class bn extends ir{constructor(...t){super(),this.element=document?.createElement("Tbody"),this.append(...t)}}class yn extends ir{constructor(t){super(),this.element=document?.createElement("Caption"),this.append(t)}}const vn=(...t)=>(t=t.map((t=>(t instanceof ir||(t=pr(t)),t))),new fn(...t)),wn=t=>new yn(t),xn=t=>{var e=new Array(t.rows).fill(null).map((()=>((...t)=>new dn(...t))())),s=t.arr.map((t=>t.map((()=>null))));for(let r=0;r<s.length;r++)for(let i=0;i<s[0].length;i++)s[r][i]=vn(t.arr[r][i]),e[r].append(s[r][i]);return e};class _n extends ir{constructor(t,{caption:e=null,head:s=null,foot:r=null}={}){super("table","Table"),this.structure={caption:e,head:s,body:null,foot:r},t&&this.fromMatrix(t),e&&this.setCaption(e)}get isTable(){return!0}get caption(){return this.structure.caption}get header(){}get body(){}get footer(){}setCaption(t){return this.removeCaption(),this.structure.caption=wn(t),this.append(this.structure.caption),this}removeCaption(){return this.structure.caption&&this.removeItem(...this.items.filter((t=>t instanceof yn))),this.structure.caption=null,this}setHeader(...t){return this.tHead=((...t)=>(t=t.map((t=>(t instanceof ir||(t=vn(t)),t))),new gn(...UI)))(...t),this.append(this.tHead),this}removeHeader(){return this.removeItem(...this.items.filter((t=>t instanceof yn))),this}setFooter(t){return this.structure.caption=wn(t),this.append(this.structure.caption),this}removeFooter(){return this.removeItem(...this.items.filter((t=>t instanceof yn))),this}fromMatrix(t){return this.bodyMatrix=t instanceof Array?co(t):t,this.structure.body&&this.remove(this.structure.body),this.structure.body=((...t)=>new bn(...t))(),this.append(this.structure.body),this.structure.body.append(...xn(this.bodyMatrix)),this}transpose(){return this.fromMatrix(this.bodyMatrix.T),this}hstack(t){return t instanceof _n&&(t=t.bodyMatrix),this.fromMatrix(this.bodyMatrix.clone.hstack(t)),this}vstack(t){return t instanceof _n&&(t=t.bodyMatrix),this.fromMatrix(this.bodyMatrix.clone.vstack(t)),this}slice(t=0,e=0,s=this.bodyMatrix.rows-1,r=this.bodyMatrix.cols-1){return this.fromMatrix(this.bodyMatrix.slice(t,e,s,r)),this}sortByCols(t,e={type:"num",order:"asc"}){return this.fromMatrix(this.bodyMatrix.clone.sortTable(t,e)),this}sortByRows(t,e={type:"num",order:"asc"}){return this.fromMatrix(this.bodyMatrix.T.clone.sortTable(t,e).T),this}filterByRows(t){return this.fromMatrix(this.bodyMatrix.clone.filterByRows(t)),this}filterByCols(t){return this.fromMatrix(this.bodyMatrix.clone.filterByCols(t)),this}forEachRow(t){return this.structure.body.forEach(t),this}forEachItem(t){return this.structure.body.forEach((e=>e.forEach(t))),this}}const kn=(t,e)=>new _n(t,e);var En=Object.freeze({__proto__:null,Table:kn});class In extends ir{constructor(){super("main","Main")}get isMain(){return!0}}class An extends ir{constructor(){super("header","Header")}get isHeader(){return!0}}class Tn extends ir{constructor(){super("nav","Nav")}get isNav(){return!0}}class Cn extends ir{constructor(){super("section","Section"),this.style({position:"relative"})}get isSection(){return!0}}class Sn extends ir{constructor(){super("article","Article")}get isArticle(){return!0}}class Mn extends ir{constructor(){super("aside","Aside")}get isAside(){return!0}}class On extends ir{constructor(){super("footer","Footer"),this.element=document?.createElement("footer")}get isFooter(){return!0}}const jn=(...t)=>(new Cn).append(...t),Dn=(...t)=>(new Sn).append(...t),Un=(...t)=>(new In).append(...t),Zn=(...t)=>(new An).append(...t),Rn=(...t)=>(new On).append(...t),Ln=(...t)=>(new Tn).append(...t),Pn=(...t)=>(new Mn).append(...t);var zn=Object.freeze({__proto__:null,Article:Dn,Aside:Pn,Footer:Rn,Header:Zn,Main:Un,Nav:Ln,Section:jn,ZikoUIArticle:Sn,ZikoUIAside:Mn,ZikoUIFooter:On,ZikoUIHeader:An,ZikoUIMain:In,ZikoUINav:Tn,ZikoUISection:Cn});class Fn extends ir{constructor(t="div",e="50vw",s="50vh"){super(t,"Grid"),this.direction="cols","number"==typeof e&&(e+="%"),"number"==typeof s&&(s+="%"),this.style({border:"1px solid black",width:e,height:s}),this.style({display:"grid"})}get isGird(){return!0}columns(t){let e="";for(let s=0;s<t;s++)e=e.concat(" auto");return this.#f(e),this}#f(t="auto auto"){return this.style({gridTemplateColumns:t}),this}gap(t=10,e=t){return"number"==typeof t&&(t+="px"),"number"==typeof e&&(e+="px"),this.style({gridColumnGap:t,gridRowGap:e}),this}}const Nn=(...t)=>new Fn("div").append(...t);var Hn=Object.freeze({__proto__:null,Grid:Nn,ZikoUIGrid:Fn});const Bn=new Proxy({},{get(t,e){if("string"!=typeof e)return;let s=e.replaceAll("_","-").toLowerCase();switch(s){case"html":globalThis?.document?.createElement("html");case"head":case"style":case"link":case"meta":case"srcipt":case"body":return null;default:return new ir(s)}}}),Vn={...Or,...zr,...pn,...qi,...En,...zn,...Ui,...cn,...Hn,ZikoUIElement:ir},$n=t=>(new XMLSerializer).serializeToString(t),qn=t=>btoa($n(t)),Wn=t=>"data:image/svg+xml;base64,"+qn(t),Yn=(t,e=!0)=>Pi(Wn(t)).render(e),Xn=t=>JSON.stringify(k((t=>["number","string","boolean","bigint"].includes(typeof t)?String(t):t instanceof bo||t instanceof lo?t.toString():t instanceof Array?Kn(t):void 0),t),null," ").replace(/"([^"]+)":/g,"$1:").replace(/: "([^"]+)"/g,": $1"),Qn=t=>{if(!Array.isArray(t))return 0;let e=1;for(const s of t)if(Array.isArray(s)){const t=Qn(s);t+1>e&&(e=t+1)}return e},Kn=t=>{let e=0;return function t(s){let r=Qn(s),i=0;return s.some((t=>Array.isArray(t)))&&(e++,i=1),"["+s.map(((r,i)=>["number","string","boolean","bigint"].includes(typeof r)?String(r):r instanceof bo?r.toString():r instanceof Array?`\n${" ".repeat(e)}${t(r)}${i===s.length-1?"\n":""}`:r instanceof Object?Xn(r):void 0))+`${" ".repeat((r+e+1)*i)}]`}(t)},Gn=(t,e=0)=>{t=Jn(t);let s="";const r=" ".repeat(e);for(let i in t)if("object"==typeof t[i]){s+=`${r}${i} {\n`;const n=t[i];for(let t in n)"object"==typeof n[t]?s+=Gn({[t]:n[t]},e+1):s+=`${r} ${t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}: ${n[t]};\n`;s+=`${r}}\n`}return s};function Jn(t){return"object"!=typeof t||null===t?t:Object.keys(t).reduce(((e,s)=>(e[s.trim()]=Jn(t[s]),e)),Array.isArray(t)?[]:{})}var to=Object.freeze({__proto__:null,arr2str:Kn,csv2arr:kt,csv2json:At,csv2matrix:Et,csv2object:It,csv2sql:Tt,json2arr:Mt,json2css:Gn,json2csv:Ot,json2csvFile:jt,json2xml:Lt,json2xmlFile:Pt,json2yml:Zt,json2ymlFile:Rt,obj2str:Xn,svg2ascii:qn,svg2img:Yn,svg2imgUrl:Wn,svg2str:$n}),eo=Object.freeze({__proto__:null});const so={isDigit:/^\d+$/,isURL:/^(https?:\/\/)?([\w\-]+\.)+[\w\-]+(\/[\w\-./?%&=]*)?$/,isHexColor:/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/,isIPv4:/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,isMACAddress:/^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$/,isDate:/^\d{4}-\d{2}-\d{2}$/};class ro{constructor(t){this.string=t}isDigit(){return so.isDigit.test(this.string)}static isDigit(t){return new ro(t).isDigit()}isNumber(){return!isNaN(this.string)}static isNumber(t){return new ro(t).isNumber()}isUrl(){return so.isURL.test(this.string)}static isUrl(t){return new ro(t).isUrl()}isHexColor(){return so.isHexColor.test(this.string)}static isHexColor(t){return new ro(t).isHexColor()}isIPv4(){return so.isIPv4.test(this.string)}static isIPv4(t){return new ro(t).isIPv4()}isDate(){return so.isDate.test(this.string)}static isDate(t){return new ro(t).isDate()}isMACAddress(){return so.isMACAddress.test(this.string)}static isMACAddress(t){return new ro(t).isMACAddress()}isPascalCase(){if(0===this.string.length)return!1;return/^[A-Z][a-zA-Z0-9]*$/.test(this.string)}static isPascalCase(t){return new ro(t).isPascalCase()}isCamelCase(){if(0===this.string.length)return!1;return/^[a-z][a-zA-Z0-9]*$/.test(this.string)}static isCamelCase(t){return new ro(t).isCamelCase()}isHyphenCase(){return this.string.split("-").length>1}static isHyphenCase(t){return new ro(t).isHyphenCase()}isSnakeCase(){return this.string.split("_").length>1}static isSnakeCase(t){return new ro(t).isSnakeCase()}isPalindrome(){const t=this.string.toLocaleLowerCase();let e,s=t.length;for(e=0;e<s/2;e++)if(t[e]!=t[s-e-1])return!1;return!0}static isPalindrome(t){return new ro(t).isPalindrome()}static isAnagrams(t,e){return t=t.split("").sort(),e=e.split("").sort(),JSON.stringify(t)===JSON.stringify(e)}isIsogram(){return[...new Set(this.string.toLowerCase())].length===this.string.length}static isIsogram(t){return new ro(t).isIsogram()}static camel2hyphencase(t){return t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}static camel2snakecase(t){return t.replace(/[A-Z]/g,(t=>"_"+t.toLowerCase()))}static camel2pascalcase(t){return t.charAt(0).toUpperCase()+t.slice(1)}static camel2constantcase(t){return t.replace(/[A-Z]/g,(t=>"_"+t)).toUpperCase()}static pascal2snakecase(t){return t.replace(/([A-Z])/g,((t,e)=>e?"_"+t.toLowerCase():t.toLowerCase()))}static pascal2hyphencase(t){return t.replace(/([A-Z])/g,((t,e)=>e?"-"+t.toLowerCase():t.toLowerCase()))}static pascal2camelcase(t){return t.charAt(0).toLowerCase()+t.slice(1)}static pascal2constantcase(t){return t.replace(/([A-Z])/g,((t,e)=>e?"_"+t:t)).toUpperCase()}static snake2camelcase(t){return t.replace(/(_\w)/g,(t=>t[1].toUpperCase()))}static snake2hyphencase(t){return t.replace(/_/g,"-")}static snake2pascalcase(t){return t.split("_").map((t=>t.charAt(0).toUpperCase()+t.slice(1))).join("")}static snake2constantcase(t){return t.toUpperCase()}static hyphen2camelcase(t){return t.replace(/-([a-z])/g,(t=>t[1].toUpperCase()))}static hyphen2snakecase(t){return t.replace(/-/g,"_")}static hyphen2pascalcase(t){return t.split("-").map((t=>t.charAt(0).toUpperCase()+t.slice(1))).join("")}static hyphen2constantcase(t){return t.replace(/-/g,"_").toUpperCase()}static constant2camelcase(t){return t.toLowerCase().replace(/_([a-z])/g,(t=>t[1].toUpperCase()))}static constant2snakecase(t){return t.toLowerCase()}static constant2pascalcase(t){return t.toLowerCase().split("_").map((t=>t.charAt(0).toUpperCase()+t.slice(1))).join("")}static constant2hyphencase(t){return t.toLowerCase().replace(/_/g,"-")}}const io=t=>t.replace(/\s+/g," "),no=(t,e)=>t.split("").filter((t=>t==e)).length,oo=(t,e)=>t.split(" ").filter((t=>t==e)).length,ao=t=>new ro(t);const ho={..._t,...to,...eo,...Object.freeze({__proto__:null,Str:ro,count:no,countWords:oo,removeExtraSpace:io,str:ao})};class lo extends _{constructor(t,e,s=[]){if(super(),t instanceof lo)this.arr=t.arr,this.rows=t.rows,this.cols=t.cols;else{let r,i,n=[];if(arguments[0]instanceof Array)t=arguments[0].length,e=arguments[0][0].length,n=arguments[0];else for(r=0;r<t;r++)for(n.push([]),n[r].push(new Array(e)),i=0;i<e;i++)n[r][i]=s[r*e+i],null==s[r*e+i]&&(n[r][i]=0);this.rows=t,this.cols=e,this.arr=n}this._maintain()}toString(){return Kn(this.arr)}at(t=0,e=void 0){return t<0&&(t=this.rows+t),null==e?this.arr[t]:(e<0&&(e=this.cols+e),this.arr[t][e])}reshape(t,e){if(t*e==this.rows*this.cols)return new lo(t,e,this.arr.flat(1));console.error("Err")}static eye(t){let e=new lo(t,t);for(let s=0;s<t;s++)for(let r=0;r<t;r++)e.arr[s][r]=s===r?1:0;return e}get clone(){return new lo(this.rows,this.cols,this.arr.flat(1))}get size(){return this.rows*this.cols}get shape(){return[this.rows,this.cols]}get reel(){return new lo(this.cols,this.rows,this.arr.flat(1).reel)}get imag(){return new lo(this.cols,this.rows,this.arr.flat(1).imag)}_maintain(){for(let t=0;t<this.arr.length;t++)Object.assign(this,{[[t]]:this.arr[t]});return this}get(t=0,e=0){return-1==e?this.arr[t]:-1==t?this.arr.map((t=>t[e])):this.arr[t][e]}set(t=0,e=0,s){if(-1==e)return this.arr[t]=s;if(-1==t){for(let t=0;t<this.cols;t++)this.arr[t][e]=s[t]||0;return this.arr}return this.arr[t][e]=s}get isSquare(){return this.rows/this.cols==1}get isSym(){if(!this.isSquare)return!1;const t=this.T,e=this.clone;return 0==lo.sub(e,t).max&&0==lo.sub(e,t).min}get isAntiSym(){if(!this.isSquare)return!1;const t=this.T,e=this.clone;return 0==lo.add(e,t).max&&0==lo.add(e,t).min}get isDiag(){if(!this.isSquare)return!1;const t=this.T,e=this.clone,s=lo.mul(e,t),r=lo.dot(t,e);return 0==lo.sub(s,r).max&&0==lo.sub(s,r).min}get isOrtho(){return!!this.isSquare&&(this.isDiag&&(1==this.det||-1==this.det))}get isIdemp(){if(!this.isSquare)return!1;const t=this.clone,e=lo.dot(t,t);return 0==lo.sub(e,t).max&&0==lo.sub(e,t).min}get T(){let t=[];for(let e=0;e<this.arr[0].length;e++){t[e]=[];for(let s=0;s<this.arr.length;s++)t[e][s]=this.arr[s][e]}return new lo(this.cols,this.rows,t.flat(1))}get det(){if(!this.isSquare)return new Error("is not square matrix");if(1==this.rows)return this.arr[0][0];function t(t,e){var s=[];for(let e=0;e<t.length;e++)s.push(t[e].slice(0));s.splice(0,1);for(let t=0;t<s.length;t++)s[t].splice(e,1);return s}return function e(s){if(2==s.length)return s.flat(1).some((t=>t instanceof lo))?void console.warn("Tensors are not completely supported yet ..."):it.sub(it.mul(s[0][0],s[1][1]),it.mul(s[0][1],s[1][0]));for(var r=0,i=0;i<s.length;i++){const n=it.add(it.mul(So(-1,i),it.mul(s[0][i],e(t(s,i)))));r=it.add(r,n)}return r}(this.arr)}get inv(){if(!this.isSquare)return new Error("is not square matrix");if(0===this.det)return"determinat = 0 !!!";let t=function(t){if(t.length!==t[0].length)return;var e=0,s=0,r=0,i=t.length,n=0,o=[],a=[];for(e=0;e<i;e+=1)for(o[o.length]=[],a[a.length]=[],r=0;r<i;r+=1)o[e][r]=e==r?1:0,a[e][r]=t[e][r];for(e=0;e<i;e+=1){if(0==(n=a[e][e])){for(s=e+1;s<i;s+=1)if(0!=a[s][e]){for(r=0;r<i;r++)n=a[e][r],a[e][r]=a[s][r],a[s][r]=n,n=o[e][r],o[e][r]=o[s][r],o[s][r]=n;break}if(0==(n=a[e][e]))return}for(r=0;r<i;r++)a[e][r]=a[e][r]/n,o[e][r]=o[e][r]/n;for(s=0;s<i;s++)if(s!=e)for(n=a[s][e],r=0;r<i;r++)a[s][r]-=n*a[e][r],o[s][r]-=n*o[e][r]}return o}(this.arr);return new lo(this.rows,this.cols,t.flat(1))}static zeros(t,e){let s=new lo(t,e);for(let i=0;i<t;i++)for(var r=0;r<e;r++)s.arr[i][r]=0;return s}static ones(t,e){let s=new lo(t,e);for(let r=0;r<t;r++)for(let t=0;t<e;t++)s.arr[r][t]=1;return s}static nums(t,e,s){let r=new lo(t,e);for(let i=0;i<t;i++)for(let t=0;t<e;t++)r.arr[i][t]=s;return r}static get rand(){return{int:(t,e,s,r)=>{let i=new lo(t,e);for(let n=0;n<t;n++)for(let t=0;t<e;t++)i.arr[n][t]=pt.randInt(s,r);return i},bin:(t,e)=>{let s=new lo(t,e);for(let r=0;r<t;r++)for(let t=0;t<e;t++)s.arr[r][t]=pt.randBin;return s},hex:(t,e)=>{let s=new lo(t,e);for(let r=0;r<t;r++)for(let t=0;t<e;t++)s.arr[r][t]=pt.randHex;return s},choices:(t,e,s,r)=>{let i=new lo(t,e);for(let n=0;n<t;n++)for(let t=0;t<e;t++)i.arr[n][t]=pt.choice(s,r);return i},permutation:(t,e,s)=>{}}}static rands(t,e,s=1,r){let i=new lo(t,e);for(let n=0;n<t;n++)for(let t=0;t<e;t++)i.arr[n][t]=pt.rand(s,r);return i}map(t,e,s,r){return it.map(this,t,e,s,r)}lerp(t,e){return it.lerp(this,t,e)}norm(t,e){return it.norm(this,t,e)}clamp(t,e){return it.clamp(this,t,e)}static map(t,e,s,r,i){return it.map(t,e,s,r,i)}static lerp(t,e,s){return it.lerp(t,e,s)}static norm(t,e,s){return it.norm(t,e,s)}static clamp(t,e,s){return it.clamp(co,e,s)}toPrecision(t){for(let e=0;e<this.cols;e++)for(let s=0;s<this.rows;s++)this.arr[e][s]=+this.arr[e][s].toPrecision(t);return this}get toBin(){let t=this.arr.flat(1).toBin;return new lo(this.rows,this.cols,t)}get toOct(){let t=this.arr.flat(1).toOct;return new lo(this.rows,this.cols,t)}get toHex(){let t=this.arr.flat(1).toHex;return new lo(this.rows,this.cols,t)}max2min(){let t=this.arr.flat(1).max2min;return new lo(this.rows,this.cols,t)}min2max(){let t=this.arr.flat(1).min2max;return new lo(this.rows,this.cols,t)}sortRows(t=void 0){let e=this.arr.map((e=>e.sort(t))).flat(1);return new lo(this.rows,this.cols,e)}sortCols(t=void 0){let e=this.T.arr.map((e=>e.sort(t))).flat(1);return new lo(this.rows,this.cols,e).T}filterByRows(t){var e=this.arr.map((e=>e.map((e=>+(""+e).includes(t))))).map((t=>!!Logic.or(...t))),s=this.arr.filter(((t,s)=>!0===e[s]));return 0===s.length&&s.push([]),console.log(s),new lo(s)}filterByCols(t){return new lo(this.T.arr.filter((e=>e.includes(t))))}sortAll(t=void 0){let e=this.arr.flat(1).sort(t);return new lo(this.rows,this.cols,e)}count(t){return this.arr.flat(1).count(t)}toBase(t){let e=this.arr.flat(1).toBase(t);return new lo(this.rows,this.cols,e)}#g(t){if(this.rows!==t.rows)return;let e=this.arr;for(let s=0;s<this.rows;s++)for(let r=this.cols;r<this.cols+t.cols;r++)e[s][r]=t.arr[s][r-this.cols];return this.cols+=t.cols,new lo(this.rows,this.cols,e.flat(1))}hstack(...t){const e=[this,...t].reduce(((t,e)=>t.#g(e)));return Object.assign(this,e),this}static hstack(t,...e){return t.clone.hstack(...e)}#b(t){if(this.cols!==t.cols)return;let e=this.arr;for(let s=this.rows;s<this.rows+t.rows;s++){e[s]=[];for(let r=0;r<this.cols;r++)e[s][r]=t.arr[s-this.rows][r]}return this.rows+=t.rows,new lo(this.rows,this.cols,e.flat(1))}vstack(...t){const e=[this,...t].reduce(((t,e)=>t.#b(e)));return Object.assign(this,e),this}static vstack(t,...e){return t.clone.vstack(...e)}hqueue(...t){const e=[this,...t].reverse().reduce(((t,e)=>t.#g(e)));return Object.assign(this,e),this}vqueue(...t){const e=[this,...t].reverse().reduce(((t,e)=>t.#b(e)));return Object.assign(this,e),this}static hqueue(t,...e){return t.clone.hqueue(...e)}static vqueue(t,...e){return t.clone.vqueue(...e)}slice(t=0,e=0,s=this.rows-1,r=this.cols-1){let i=s-t,n=r-e,o=new Array(n);for(let s=0;s<i;s++){o[s]=[];for(let r=0;r<n;r++)o[s][r]=this.arr[s+t][r+e]}return new lo(i,n,o.flat(1))}static slice(t,e=0,s=0,r=this.rows-1,i=this.cols-1){return t.slice(e,s,r,i)}splice(t,e,s,...r){}getRows(t,e=t+1){return this.slice(t,0,e,this.cols)}getCols(t,e=t+1){return this.slice(0,t,this.rows,e)}static getRows(t,e,s=e+1){return t.slice(e,0,s,t.cols)}static getCols(t,e,s=e+1){return t.slice(0,e,t.rows,s)}add(...t){for(let s=0;s<t.length;s++){("number"==typeof t[s]||t[s]instanceof bo)&&(t[s]=lo.nums(this.rows,this.cols,t[s]));for(let r=0;r<this.rows;r++)for(var e=0;e<this.cols;e++)this.arr[r][e]=it.add(this.arr[r][e],t[s].arr[r][e])}return new lo(this.rows,this.cols,this.arr.flat(1))}sub(...t){for(let s=0;s<t.length;s++){"number"==typeof t[s]&&(t[s]=lo.nums(this.rows,this.cols,t[s]));for(let r=0;r<this.rows;r++)for(var e=0;e<this.cols;e++)this.arr[r][e]=it.sub(this.arr[r][e],t[s].arr[r][e])}return new lo(this.rows,this.cols,this.arr.flat(1))}static add(t,...e){return t.clone.add(...e)}static sub(t,...e){return t.clone.sub(...e)}mul(...t){for(let r=0;r<t.length;r++){"number"==typeof t[r]&&(t[r]=lo.nums(this.rows,this.cols,t[r]));for(var e=0;e<this.rows;e++)for(var s=0;s<this.cols;s++)this.arr[e][s]=it.mul(this.arr[e][s],t[r].arr[e][s])}return new lo(this.rows,this.cols,this.arr.flat(1))}div(...t){for(let s=0;s<t.length;s++){"number"==typeof t[s]&&(t[s]=lo.nums(this.rows,this.cols,t[s]));for(let r=0;r<this.rows;r++)for(var e=0;e<this.cols;e++)this.arr[r][e]=it.div(this.arr[r][e],t[s].arr[r][e])}return new lo(this.rows,this.cols,this.arr.flat(1))}static div(t,...e){return t.clone.div(...e)}static mul(t,...e){return t.clone.mul(...e)}modulo(...t){for(let s=0;s<t.length;s++){"number"==typeof t[s]&&(t[s]=lo.nums(this.rows,this.cols,t[s]));for(let r=0;r<this.rows;r++)for(var e=0;e<this.cols;e++)this.arr[r][e]=it.modulo(this.arr[r][e],t[s].arr[r][e])}return new lo(this.rows,this.cols,this.arr.flat(1))}static modulo(t,...e){return t.clone.modulo(...e)}dot(t){for(var e=[],s=0;s<this.arr.length;s++){e[s]=[];for(var r=0;r<t.arr[0].length;r++){e[s][r]=0;for(var i=0;i<this.arr[0].length;i++)e[s][r]=it.add(e[s][r],it.mul(this.arr[s][i],t.arr[i][r]))}}return new lo(this.arr.length,t.arr[0].length,e.flat(1))}static dot(t,e){return t.dot(e)}pow(t){let e=this.clone,s=this.clone;for(let r=0;r<t-1;r++)s=s.dot(e);return s}static pow(t,e){return t.clone.pow(e)}get somme(){let t=0;for(let e=0;e<this.rows;e++)for(let s=0;s<this.cols;s++)t+=this.arr[e][s];return t}get DoesItContainComplexNumbers(){return this.arr.flat(1/0).some((t=>t instanceof bo))}get min(){this.DoesItContainComplexNumbers&&console.error("Complex numbers are not comparable");let t=[];for(let e=0;e<this.rows;e++)t.push(Q(...this.arr[e]));return Q(...t)}get max(){this.DoesItContainComplexNumbers&&console.error("Complex numbers are not comparable");let t=[];for(let e=0;e<this.rows;e++)t.push(K(...this.arr[e]));return K(...t)}get minRows(){this.DoesItContainComplexNumbers&&console.error("Complex numbers are not comparable");let t=[];for(let e=0;e<this.rows;e++)t.push(Q(...this.arr[e]));return t}get maxRows(){this.DoesItContainComplexNumbers&&console.error("Complex numbers are not comparable");let t=[];for(let e=0;e<this.rows;e++)t.push(K(...this.arr[e]));return t}get minCols(){return this.DoesItContainComplexNumbers&&console.error("Complex numbers are not comparable"),this.T.minRows}get maxCols(){return this.DoesItContainComplexNumbers&&console.error("Complex numbers are not comparable"),this.T.maxRows}static fromVector(t){return new lo(t.length,1,t)}get toArray(){let t=[];for(let e=0;e<this.rows;e++)for(let s=0;s<this.cols;s++)t.push(this.arr[e][s]);return t}get print(){let t="[";for(let e=0;e<this.arr.length;e++)t+=(0!=e?" ":"")+` [${this.arr[e].map((t=>" "+t.toString()+" "))}],\n`;console.log(t.substring(0,t.length-2)+" ]"),document.write(t.substring(0,t.length-2)+" ]")}get table(){console.table(this.arr)}get serialize(){return JSON.stringify(this)}static deserialize(t){"string"==typeof t&&(t=JSON.parse(t));let e=new lo(t.rows,t.cols);return e.arr=t.arr,e}DecompositionLU(){const[t,e]=ft(this);return{L:t,U:e}}static DecompositionLU(...t){const e=t.map((t=>t.clone.LU()));return 1===e.length?e[0]:e}DecompositionQR(){const[t,e]=vt(this);return{Q:t,R:e}}static DecompositionQR(...t){const e=t.map((t=>t.clone.DecompositionQr()));return 1===e.length?e[0]:e}DecompositionCholesky(){return{L:wt(this)}}static DecompositionCholesky(...t){const e=t.map((t=>t.clone.DecompositionCholesky()));return 1===e.length?e[0]:e}get decomposition(){return{LU:()=>this.DecompositionLU(),QR:()=>this.DecompositionQR(),Cholesky:()=>this.DecompositionCholesky()}}static get decomposition(){return{LU:(...t)=>lo.LU(...t),QR:(...t)=>lo.QR(...t),CHOLESKY:(...t)=>lo.CHOLESKY(...t)}}toTable(){var t=new DocumentFragment,e=new Array(this.rows).fill(null).map((()=>document?.createElement("tr"))),s=this.arr.map((t=>t.map((()=>document?.createElement("td")))));for(let t=0;t<s.length;t++)for(let r=0;r<s[0].length;r++)s[t][r].innerHTML=this.arr[t][r],e[t].appendChild(s[t][r]);return e.map((e=>t.appendChild(e))),t}toGrid(t,e={}){let s=Grid();return s.append(...this.map(t).arr.flat(1).map((t=>t.style(e)))),s.Columns(this.cols),s}sortTable(t=0,{type:e="num",order:s="asc"}={}){var r=this.T.arr.map((t=>t.map(((t,e)=>Object.assign({},{x:t,y:e}))))),i=this.T.arr.map((t=>t.map(((t,e)=>Object.assign({},{x:t,y:e})))));"num"===e?"asc"===s?r[t].sort(((t,e)=>t.x-e.x)):"desc"===s?r[t].sort(((t,e)=>e.x-t.x)):"toggle"===s&&(r[t][0].x>r[t][1].x?r[t].sort(((t,e)=>e.x-t.x)):r[t].sort(((t,e)=>t.x-e.x))):"alpha"===e&&("asc"===s?r[t].sort(((t,e)=>(""+t.x).localeCompare(""+e.x))):"desc"===s&&r[t].sort(((t,e)=>(""+e.x).localeCompare(""+t.x)))),s=r[t].map((t=>t.y));for(let e=0;e<r.length;e++)e!==t&&r[e].map(((t,e)=>t.y=s[e]));for(let e=0;e<r.length;e++)e!==t&&i[e].map(((t,i)=>t.x=r[e][s[i]].x));i[t]=r[t];var n=i.map((t=>t.map((t=>t.x))));return new lo(n).T}}const co=(t,e,s)=>new lo(t,e,s),uo=(...t)=>new lo(2,2,t),mo=(...t)=>new lo(3,3,t),po=(...t)=>new lo(4,4,t);class fo{static resolve(t,e){return t.inv.dot(lo.fromVector(e)).arr.flat(1).map((t=>+t.toFixed(10)))}}var go=Object.freeze({__proto__:null,LinearSystem:fo,Matrix:lo,choleskyDecomposition:wt,luDecomposition:ft,matrix:co,matrix2:uo,matrix3:mo,matrix4:po,qrDecomposition:vt});class bo extends _{constructor(t=0,e=0){super(),t instanceof bo?(this.a=t.a,this.b=t.b):"object"==typeof t?"a"in e&&"b"in t?(this.a=t.a,this.b=t.b):"a"in e&&"z"in t?(this.a=t.a,this.b=Co(t.z**2-t.a**2)):"a"in e&&"phi"in t?(this.a=t.a,this.b=t.a*Zo(t.phi)):"b"in e&&"z"in t?(this.b=t.b,this.a=Co(t.z**2-t.b**2)):"b"in e&&"phi"in t?(this.b=e,this.a=t.b/Zo(t.phi)):"z"in e&&"phi"in t&&(this.a=t.z*Do(t.phi),this.a=t.z*Uo(t.phi)):"number"==typeof t&&"number"==typeof e&&(this.a=+t.toFixed(32),this.b=+e.toFixed(32))}toString(){let t="";return t=0!==this.a?this.b>=0?`${this.a}+${this.b}*i`:`${this.a}-${Math.abs(this.b)}*i`:this.b>=0?`${this.b}*i`:`-${Math.abs(this.b)}*i`,t}get clone(){return new bo(this.a,this.b)}get z(){return ia(this.a,this.b)}get phi(){return ta(this.b,this.a)}static Zero(){return new bo(0,0)}get conj(){return new bo(this.a,-this.b)}get inv(){return new bo(this.a/(So(this.a,2)+So(this.b,2)),-this.b/(So(this.a,2)+So(this.b,2)))}add(...t){for(let e=0;e<t.length;e++)"number"==typeof t[e]&&(t[e]=new bo(t[e],0));let e=t.map((t=>t.a)),s=t.map((t=>t.b));return this.a+=+Y(...e).toFixed(15),this.b+=+Y(...s).toFixed(15),this}sub(...t){for(let e=0;e<t.length;e++)"number"==typeof t[e]&&(t[e]=new bo(t[e],0));let e=t.map((t=>t.a)),s=t.map((t=>t.b));return this.a-=+Y(...e).toFixed(15),this.b-=+Y(...s).toFixed(15),this}mul(...t){for(let e=0;e<t.length;e++)"number"==typeof t[e]&&(t[e]=new bo(t[e],0));let e=+X(this.z,...t.map((t=>t.z))).toFixed(15),s=+Y(this.phi,...t.map((t=>t.phi))).toFixed(15);return this.a=+(e*Do(s).toFixed(15)).toFixed(14),this.b=+(e*Uo(s).toFixed(15)).toFixed(14),this}div(...t){for(let e=0;e<t.length;e++)"number"==typeof t[e]&&(t[e]=new bo(t[e],0));let e=+(this.z/X(...t.map((t=>t.z)))).toFixed(15),s=+(this.phi-Y(...t.map((t=>t.phi)))).toFixed(15);return this.a=+(e*Do(s).toFixed(15)).toFixed(15),this.b=+(e*Uo(s).toFixed(15)).toFixed(15),this}pow(t){if(Go(t)===t&&t>0){let e=+(this.z**t).toFixed(15),s=+(this.phi*t).toFixed(15);this.a=+(e*Do(s).toFixed(15)).toFixed(15),this.b=+(e*Uo(s).toFixed(15)).toFixed(15)}return this}static fromExpo(t,e){return new bo(+(t*Do(e)).toFixed(13),+(t*Uo(e)).toFixed(13))}get expo(){return[this.z,this.phi]}static add(t,...e){return t.clone.add(...e)}static sub(t,...e){return t.clone.sub(...e)}static mul(t,...e){return t.clone.mul(...e)}static div(t,...e){return t.clone.div(...e)}static pow(t,e){return t.clone.pow(e)}static xpowZ(t){return yo(t**this.a*Do(this.b*jo(t)),t**this.a*Uo(this.b*jo(t)))}sqrtn(t=2){return yo(Mo(this.z,t)*Do(this.phi/t),Mo(this.z,t)*Uo(this.phi/t))}get sqrt(){return this.sqrtn(2)}get log(){return yo(this.z,this.phi)}get cos(){return yo(Do(this.a)*Vo(this.b),Uo(this.a)*$o(this.b))}get sin(){return yo(Uo(this.a)*Vo(this.b),Do(this.a)*$o(this.b))}get tan(){const t=Do(2*this.a)+Vo(2*this.b);return yo(Uo(2*this.a)/t,$o(2*this.b)/t)}printInConsole(){let t=this.a+" + "+this.b+" * i";return console.log(t),t}print(){}UI(){return"<span>"+this.a+" + i * "+this.b+"</span>"}}const yo=(t,e)=>{if((t instanceof Array||ArrayBuffer.isView(t))&&(e instanceof Array||ArrayBuffer.isView(t)))return t.map(((s,r)=>yo(t[r],e[r])));if(t instanceof lo&&e instanceof lo){if(t.shape[0]!==e.shape[0]||t.shape[1]!==e.shape[1])return Error(0);const s=t.arr.map(((s,r)=>yo(t.arr[r],e.arr[r])));return new lo(t.rows,t.cols,...s)}return new bo(t,e)};var vo=Object.freeze({__proto__:null,Complex:bo,complex:yo});const wo=t=>{const e=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7];if(t<.5)return+(Math.PI/(Math.sin(Math.PI*t)*wo(1-t))).toFixed(10);t-=1;let s=e[0];for(let r=1;r<9;r++)s+=e[r]/(t+r);const r=t+7+.5;return+(Math.sqrt(2*Math.PI)*Math.pow(r,t+.5)*Math.exp(-r)*s).toFixed(10)},xo=(...t)=>k(wo,...t),_o=(t,e)=>{let s=0;for(let r=0;r<100;r++){s+=Math.pow(-1,r)*Math.pow(e/2,t+2*r)/(ea(r)*ea(t+r))}return s},ko=(t,e)=>{if("number"==typeof t){if("number"==typeof t)return _o(t,e);console.warn("Not supported yet")}else if(t instanceof Array){if("number"==typeof e)return k((t=>_o(t,e)),...t);if(e instanceof Array){const s=[];for(let r=0;r<t.length;r++)s.push(k((e=>_o(t[r],e)),...e));return s}}},Eo=(t,e)=>{let s=0;const r=s=>Math.pow(s,t-1)*Math.pow(1-s,e-1);s+=.5*(r(0)+r(1));for(let t=1;t<1e3;t++){s+=r(0+.001*t)}return.001*s},Io=(t,e)=>{if("number"==typeof t){if("number"==typeof t)return Eo(t,e);console.warn("Not supported yet")}else if(t instanceof Array){if("number"==typeof e)return k((t=>Eo(t,e)),...t);if(e instanceof Array){const s=[];for(let r=0;r<t.length;r++)s.push(k((e=>Eo(t[r],e)),...e));return s}}};var Ao=Object.freeze({__proto__:null,bessel:ko,beta:Io,gamma:xo});const To=(...t)=>k(Math.abs,...t),Co=(...t)=>k(Math.sqrt,...t),So=(t,e)=>{if("number"==typeof t)return"number"==typeof e?Math.pow(t,e):e instanceof bo?bo.fromExpo(t**e.a,e.b*jo(t)):k((e=>So(t,e)),...e);if(t instanceof bo)return"number"==typeof e?bo.fromExpo(t.z**e,t.phi*e):e instanceof bo?bo.fromExpo(t.z**e.a*Oo(-t.phi*e.b),jo(t.z)*e.b+e.a*t.phi):k((e=>So(t,e)),...e);if(t instanceof Array){if("number"==typeof e)return k((t=>So(t,e)),...t);if(e instanceof Array){const s=[];for(let r=0;r<t.length;r++)s.push(k((e=>So(t[r],e)),...e));return s}}},Mo=(t,e)=>{if("number"==typeof t)return"number"==typeof e?Math.pow(t,1/e):k((e=>Mo(t,e)),...e);if(t instanceof bo)return"number"==typeof e?bo.fromExpo(Mo(t.z,e),t.phi/e):k((e=>Mo(t,e)),...e);if(t instanceof Array){if("number"==typeof e)return k((t=>Mo(t,e)),...t);if(e instanceof Array){const s=[];for(let r=0;r<t.length;r++)s.push(k((e=>Mo(t[r],e)),...e));return s}}},Oo=(...t)=>k(Math.exp,...t),jo=(...t)=>k(Math.log,...t),Do=(...t)=>k(x.cos,...t),Uo=(...t)=>k(x.sin,...t),Zo=(...t)=>k(x.tan,...t),Ro=(...t)=>k(x.sec,...t),Lo=(...t)=>k(x.sinc,...t),Po=(...t)=>k(x.csc,...t),zo=(...t)=>k(x.cot,...t),Fo=(...t)=>k(x.acos,...t),No=(...t)=>k(x.asin,...t),Ho=(...t)=>k(x.atan,...t),Bo=(...t)=>k(x.acot,...t),Vo=(...t)=>k(x.cosh,...t),$o=(...t)=>k(x.sinh,...t),qo=(...t)=>k(x.tanh,...t),Wo=(...t)=>k(x.coth,...t),Yo=(...t)=>k(x.acosh,...t),Xo=(...t)=>k(x.asinh,...t),Qo=(...t)=>k(x.atanh,...t),Ko=(...t)=>k(Math.ceil,...t),Go=(...t)=>k(Math.floor,...t),Jo=(...t)=>k(Math.round,...t),ta=(t,e,s=!0)=>{if("number"==typeof t)return"number"==typeof e?s?Math.atan2(t,e):180*Math.atan2(t,e)/Math.PI:k((e=>ta(t,e,s)),...e);if(t instanceof Array){if("number"==typeof e)return k((t=>ta(t,e,s)),...t);if(e instanceof Array){const s=[];for(let r=0;r<t.length;r++)s.push(k((e=>So(t[r],e)),...e));return s}}},ea=(...t)=>k((t=>{let e,s=1;if(0==t)s=1;else if(t>0)for(e=1;e<=t;e++)s*=e;else s=NaN;return s}),...t),sa=(...t)=>k(Math.sign,...t),ra=(...t)=>k((t=>1/(1+Oo(-t))),...t),ia=(...t)=>t.every((t=>"number"==typeof t))?Math.hypot(...t):t.every((t=>t instanceof Array))?k(Math.hypot,...t):void 0;const na={...i,...Object.freeze({__proto__:null,abs:To,acos:Fo,acosh:Yo,acot:Bo,asin:No,asinh:Xo,atan:Ho,atan2:ta,atanh:Qo,bessel:ko,beta:Io,ceil:Ko,cos:Do,cosh:Vo,cot:zo,coth:Wo,csc:Po,e:Oo,fact:ea,floor:Go,gamma:xo,hypot:ia,ln:jo,max:K,min:Q,pow:So,round:Jo,sec:Ro,sig:ra,sign:sa,sin:Uo,sinc:Lo,sinh:$o,sqrt:Co,sqrtn:Mo,tan:Zo,tanh:qo}),...vo,...go,...dt,...nt,...mt,...Ao};class oa extends ir{constructor(t=360,e=300){super("svg","svg"),this.style({border:"1px black solid"}),this.size(t,e),this.view(-10,-10,10,10)}size(t,e){return this.setAttr({width:t,height:e}),this}view(t,e,s,r){let i=Math.abs(s-t),n=Math.abs(r-e);return this.setAttr("viewBox",[t,e,i,n].join(" ")),this.st.scaleY(-1),this}add(...t){for(let e=0;e<t.length;e++)this.element.append(t[e].element),this.items.push(t[e]);return this.maintain(),this}remove(...t){for(let e=0;e<t.length;e++)this.element?.removeChild(t[e].element),this.items=this.items.filter((e=>!t));return this.maintain(),this}mask(){}toString(){return(new XMLSerializer).serializeToString(this.element)}btoa(){return btoa(this.toString())}toImg(){return"data:image/svg+xml;base64,"+this.btoa()}toImg2(){return"data:image/svg+xml;charset=utf8,"+this.toString().replaceAll("<","%3C").replaceAll(">","%3E").replaceAll("#","%23").replaceAll('"',"'")}}const aa=(t,e)=>new oa(t,e);var ha=Object.freeze({__proto__:null,Svg:aa,ZikoUISvg:oa});class la extends ir{constructor(t,e){super("canvas","canvas"),this.ctx=this.element?.getContext("2d"),this.style({border:"1px red solid"}),this.transformMatrix=new lo([[1,0,0],[0,1,0],[0,0,1]]),this.axisMatrix=new lo([[-10,-10],[10,10]]),requestAnimationFrame((()=>this.resize(t,e)),0),this.on("sizeupdated",(()=>this.adjust()))}get Xmin(){return this.axisMatrix[0][0]}get Ymin(){return this.axisMatrix[0][1]}get Xmax(){return this.axisMatrix[1][0]}get Ymax(){return this.axisMatrix[1][1]}get ImageData(){return this.ctx.getImageData(0,0,c.Width,c.Height)}draw(t=!0){return t?(this.clear(),this.items.forEach((t=>{t.parent=this,t.draw(this.ctx)}))):(this.items.at(-1).parent=this,this.items.at(-1).draw(this.ctx)),this.maintain(),this}applyTransformMatrix(){return this.ctx.setTransform(this.transformMatrix[0][0],this.transformMatrix[1][0],this.transformMatrix[0][1],this.transformMatrix[1][1],this.transformMatrix[0][2],this.transformMatrix[1][2]),this}resize(t,e){return this.size(t,e),this.lineWidth(),this.view(this.axisMatrix[0][0],this.axisMatrix[0][1],this.axisMatrix[1][0],this.axisMatrix[1][1]),this.emit("sizeupdated"),this}adjust(){return this.element.width=this.element?.getBoundingClientRect().width,this.element.height=this.element?.getBoundingClientRect().height,this.view(this.axisMatrix[0][0],this.axisMatrix[0][1],this.axisMatrix[1][0],this.axisMatrix[1][1]),this}view(t,e,s,r){return this.transformMatrix[0][0]=this.width/(s-t),this.transformMatrix[1][1]=-this.height/(r-e),this.transformMatrix[0][2]=this.width/2,this.transformMatrix[1][2]=this.height/2,this.axisMatrix=new lo([[t,e],[s,r]]),this.applyTransformMatrix(),this.clear(),this.lineWidth(1),this.draw(),this}reset(){return this.ctx.setTransform(1,0,0,0,0,0),this}append(t){return this.items.push(t),this.draw(!1),this}background(t){this.ctx.fillStyle=t,this.ctx.setTransform(1,0,0,1,0,0),this.ctx.fillRect(0,0,this.width,this.height),this.applyTransformMatrix(),this.draw()}lineWidth(t){return this.ctx.lineWidth=t/this.transformMatrix[0][0],this}getImageData(t=0,e=0,s=this.width,r=this.height){return this.ctx.getImageData(t,e,s,r)}clear(){return this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.width,this.height),this.applyTransformMatrix(),this}clone(){console.log(this.width);const t=new la;return t.items=this.items,t.transformMatrix=this.transformMatrix,t.axisMatrix=this.axisMatrix,Object.assign(t.cache,{...this.cache}),this.size(this.element.style.width,this.element.style.width),this.applyTransformMatrix(),this.draw(),this.adjust(),t}toImage(){return this.img=document?.createElement("img"),this.img.src=this.element?.toDataURL("image/png"),this}toBlob(){this.element.toBlob((function(t){var e=document?.createElement("img"),s=URL.createObjectURL(t);e.onload=function(){URL.revokeObjectURL(s)},e.src=s,console.log(e)}))}zoomIn(){}zoomOut(){}undo(t){}redo(t){}stream(){}}const ca=(t,e)=>new la(t,e);const ua={...ha,...Object.freeze({__proto__:null,Canvas:ca,ZikoUICanvas:la})};class ma{constructor(t,e=!0){this.#i(),this.cache={Emitter:null},e&&this.useEventEmitter(),this.set(t)}#i(){return this.__FavIcon__=document.querySelector("link[rel*='icon']")||document?.createElement("link"),this.__FavIcon__.type="image/x-icon",this.__FavIcon__.rel="shortcut icon",this}set(t){return t!==this.__FavIcon__.href&&(this.__FavIcon__.href=t,this.cache.Emitter&&this.cache.Emitter.emit("ziko:favicon-changed")),this}get current(){return document.__FavIcon__.href}onChange(t){return this.cache.Emitter&&this.cache.Emitter.on("ziko:favicon-changed",t),this}useEventEmitter(){return this.cache.Emitter=Ms(),this}}class pa{constructor({viewport:t,charset:e,description:s,author:r,keywords:i}){this.document=globalThis?.document,this.meta={},this.init({viewport:t,charset:e,description:s,author:r,keywords:i})}init({viewport:t,charset:e,description:s,author:r,keywords:i}){t&&this.setViewport(t),e&&this.setCharset(e),s&&this.describe(s),r&&this.setAuthor(r),i&&this.setKeywords(i)}set(t,e){const s="charset"===(t=t.toLowerCase()),r=s?document.querySelector("meta[charset]"):document.querySelector(`meta[name=${t}]`);return this.meta=r??document?.createElement("meta"),s?this.meta.setAttribute("charset",e):(this.meta.setAttribute("name",t),this.meta.setAttribute("content",e)),r||this.document.head.append(this.meta),this}setCharset(t="utf-8"){return this.set("charset",t),this}describe(t){return this.set("description",t),this}setViewport(t="width=device-width, initial-scale=1.0"){return this.set("viewport",t),this}setKeywords(...t){return t=[...new Set(t)].join(", "),this.set("keywords",t),this}setAuthor(t){return this.set("author",t),this}}class da{constructor(t=document.title,e=!0){this.cache={Emitter:null},e&&this.useEventEmitter(),this.set(t)}useEventEmitter(){return this.cache.Emitter=Ms(),this}set(t){return t!==document.title&&(document.title=t,this.cache.Emitter&&this.cache.Emitter.emit("ziko:title-changed")),this}get current(){return document.title}onChange(t){return this.cache.Emitter&&this.cache.Emitter.on("ziko:title-changed",t),this}}class fa{constructor({title:t,lang:e,icon:s,meta:r,noscript:i}){this.html=globalThis?.document?.documentElement,this.head=globalThis?.document?.head,t&&((t,e)=>{new da(t,e)})(t),e&&this.setLang(e),s&&((t,e)=>{new ma(t,e)})(s),r&&(({viewport:t,charset:e,description:s,author:r,keywords:i})=>{new pa({viewport:t,charset:e,description:s,author:r,keywords:i})})(r),i&&this.setNoScript()}setLang(t){this.html.setAttribute("lang",t)}setNoScript(t){}}class ga{constructor({head:t=null,wrapper:e=null,target:s=null}){this.head=t,this.wrapper=e,this.target=s,this.init()}get isZikoApp(){return!0}init(){this.head&&this.setHead(this.head),this.wrapper&&this.setWrapper(this.wrapper),this.target&&this.setTarget(this.target),this.wrapper&&this.target&&this.wrapper.render(this.target)}setTarget(t){return t instanceof HTMLElement?this.target=t:"string"==typeof t&&(this.target=globalThis?.document?.querySelector(t)),this}setWrapper(t){return t?.isZikoUIElement?this.wrapper=t:"function"==typeof t&&(this.wrapper=t()),this}setHead(t){return this.head=t instanceof fa?t:(({title:t,lang:e,icon:s,meta:r,noscript:i})=>new fa({title:t,lang:e,icon:s,meta:r,noscript:i}))(t),this}}const ba=({head:t,wrapper:e,target:s})=>new ga({head:t,wrapper:e,target:s});var ya=Object.freeze({__proto__:null,App:ba,ZikoApp:ga});class va{constructor(t={}){this.cache={JsonStyle:t,isRenderd:!1},this.target=globalThis?.document?.head,this.element=document.createElement("style"),this.element.setAttribute("data-generator","zikojs"),this.write(),this.render()}get CssText(){return Gn(this.cache.JsonStyle)}render(){return this.target.append(this.element),this.cache.isRenderd=!0,this}unrender(){return this.target?.children?.length&&[...this.target?.children].includes(this.element)&&this.target.removeChild(this.element),this.cache.isRenderd=!1,this}write(){return this.element.textContent=this.CssText,this}style(t,e=!1){return e&&this.clear(),Object.assign(this.cache.JsonStyle,t),this.write(),this}clear(){return this.cache.JsonStyle={},this.write(),this}}const wa=t=>new va(t);var xa=Object.freeze({__proto__:null,ZikoJsonStyleSheet:va,jsonStyleSheet:wa});function _a(t){return/:\w+/.test(t)}class ka extends ga{constructor({head:t,wrapper:e,target:s,routes:r}){super({head:t,wrapper:e,target:s}),this.routes=new Map([["404",pr("Error 404")],...Object.entries(r)]),this.clear(),globalThis.onpopstate=this.render(location.pathname)}clear(){return[...this.routes].forEach((t=>{!_a(t[0])&&t[1]?.isZikoUIElement&&t[1].unrender()})),this}render(t){const[e,s]=[...this.routes].find((e=>function(t,e){const s=t.split("/"),r=e.split("/");if(s.length!==r.length)return!1;for(let t=0;t<s.length;t++){const e=s[t],i=r[t];if(!e.startsWith(":")&&e!==i)return!1}return!0}(e[0],t)));let r;if(_a(e)){const i=function(t,e){const s=t.split("/"),r=e.split("/"),i={};if(s.length!==r.length)return i;for(let t=0;t<s.length;t++){const e=s[t],n=r[t];if(e.startsWith(":"))i[e.slice(1)]=n;else if(e!==n)return{}}return i}(e,t);r=s.call(this,i)}else s?.isZikoUIElement&&s.render(this.wrapper),"function"==typeof s&&(r=s());return r?.isZikoUIElement&&r.render(this.wrapper),r instanceof Promise&&r.then((t=>t.render(this.wrapper))),globalThis.history.pushState({},"",t),this}}const Ea=({head:t,wrapper:e,target:s,routes:r})=>new ka({head:t,wrapper:e,target:s,routes:r});var Ia=Object.freeze({__proto__:null,SPA:Ea,ZikoSPA:ka});function Aa(t){Object.defineProperties(t,{QueryParams:{get:function(){return function(t){const e={};return t.replace(/[A-Z0-9]+?=([\w|:|\/\.]*)/gi,(t=>{const[s,r]=t.split("=");e[s]=r})),e}(globalThis.location.search.substring(1))},configurable:!1,enumerable:!0},HashParams:{get:function(){return globalThis.location.hash.substring(1).split("#")},configurable:!1,enumerable:!0}})}const Ta={__all__(){return Object.values(this).filter(Array.isArray).flat()},querySelectorAll(){return this.__all__().filter((t=>t))},getElementByIndex(t){return this.__all__().find((e=>e.ui_index===t))},getElementById:t=>null,getElementsByClass(){},getElementsByTagName(){}},Ca={map:new Map,index:0,increment:function(){return this.index++}},Sa=new Map,Ma={default:{target:null,render:!0,math:{mode:"deg"}},setDefault:function(t){const e=Object.keys(t),s=Object.values(t);for(let t=0;t<e.length;t++)this.default[e[t]]=s[t]},init:()=>{},renderingMode:"spa",isSSC:!1},Oa={ui_index:0,get_ui_index:function(){return this.ui_index++}};function ja(t,e="./src/pages",s=["js","ts"]){"/"===e.at(-1)&&(e=e.slice(0,-1));const r=t.replace(/\\/g,"/").replace(/\[(\w+)\]/g,"$1/:$1").split("/"),i=e.split("/"),n=r.indexOf(i[i.length-1]);if(-1!==n){const t=r.slice(n+1),e=t[t.length-1],i="index.js"===e||"index.ts"===e,o=s.some((t=>e===`.${t}`||e.endsWith(`.${t}`)));if(i)return"/"+(t.length>1?t.slice(0,-1).join("/"):"");if(o)return"/"+t.join("/").replace(/\.(js|ts)$/,"")}return""}const Da={...ya,...xa,...Ia,...Object.freeze({__proto__:null,__CACHE__:Oa,__Config__:Ma,__HYDRATION_MAP__:Sa,__HYDRATION__:Ca,__UI__:Ta})};[Da,na,Vn,Cs,ho,rr,ua].forEach((t=>Object.assign(t,{ExtractAll:()=>(t=>{const e=Object.keys(t);for(let s=0;s<e.length;s++){const r=e[s];["__ExtractAll__","__RemoveAll__","ExtractAll","RemoveAll"].includes(r)||(globalThis[r]=t[r])}})(t),RemoveAll:()=>(t=>{const e=Object.keys(t);for(let t=0;t<e.length;t++){const s=e[t];"__RemoveAll__"!==s&&delete globalThis[s]}})(t)})));const Ua={App:Da,Math:na,UI:Vn,Time:Cs,Data:ho,Reactivity:rr,Graphics:ua};globalThis.__Ziko__?console.warn("WARNING: Multiple instances of Ziko.js being imported."):(globalThis.__Ziko__={...Ua,__UI__:Ta,__HYDRATION__:Ca,__HYDRATION_MAP__:Sa,__Config__:Ma,__CACHE__:Oa,ExtractAll:function(){return Vn.ExtractAll(),na.ExtractAll(),Cs.ExtractAll(),rr.ExtractAll(),ua.ExtractAll(),ho.ExtractAll(),this},RemoveAll:function(){Vn.RemoveAll(),na.RemoveAll(),Cs.RemoveAll(),rr.RemoveAll(),ua.RemoveAll(),ho.RemoveAll()}},Aa(__Ziko__)),globalThis?.document&&document?.addEventListener("DOMContentLoaded",__Ziko__.__Config__.init()),t.App=ba,t.Article=Dn,t.Aside=Pn,t.Base=at,t.Canvas=ca,t.Combinaison=ct,t.Complex=bo,t.E=s,t.EPSILON=r,t.Ease=ys,t.FileBasedRouting=async function(t){const e=Object.keys(t),s=function(t){if(0===t.length)return"";const e=t.map((t=>t.split("/"))),s=Math.min(...e.map((t=>t.length)));let r=[];for(let t=0;t<s;t++){const s=e[0][t];if(!e.every((e=>e[t]===s||e[t].startsWith("["))))break;r.push(s)}return r.join("/")+(r.length?"/":"")}(e),r={};for(let i=0;i<e.length;i++){const n=await t[e[i]](),o=await n.default;Object.assign(r,{[ja(e[i],s)]:o})}return Ea({target:document.body,routes:{"/":()=>{},...r},wrapper:jn()})},t.Flex=nn,t.Footer=Rn,t.Form=mn,t.Grid=Nn,t.HTMLWrapper=pi,t.Header=Zn,t.LinearSystem=fo,t.Logic=ht,t.Main=Un,t.Matrix=lo,t.Nav=Ln,t.PI=e,t.Permutation=lt,t.Random=pt,t.SPA=Ea,t.SVGWrapper=di,t.Section=jn,t.Str=ro,t.Suspense=gi,t.Svg=aa,t.Table=kn,t.Utils=it,t.ZikoApp=ga,t.ZikoCustomEvent=qe,t.ZikoEvent=Bt,t.ZikoEventClick=qt,t.ZikoEventClipboard=je,t.ZikoEventHash=Be,t.ZikoEventInput=Fe,t.ZikoEventKey=ye,t.ZikoEventMouse=re,t.ZikoEventPointer=ee,t.ZikoEventSwipe=Ye,t.ZikoEventWheel=pe,t.ZikoHead=Ls,t.ZikoJsonStyleSheet=va,t.ZikoMutationObserver=Ge,t.ZikoSPA=ka,t.ZikoUIAbbrText=mr,t.ZikoUIArticle=Sn,t.ZikoUIAside=Mn,t.ZikoUIAudio=Vi,t.ZikoUIBlockQuote=xr,t.ZikoUIBr=Ei,t.ZikoUICanvas=la,t.ZikoUICodeText=ur,t.ZikoUIDefintion=hr,t.ZikoUIElement=ir,t.ZikoUIFigure=zi,t.ZikoUIFlex=rn,t.ZikoUIFooter=On,t.ZikoUIForm=un,t.ZikoUIGrid=Fn,t.ZikoUIHTMLWrapper=ui,t.ZikoUIHeader=An,t.ZikoUIHeading=Er,t.ZikoUIHr=Ii,t.ZikoUIHtmlTag=_i,t.ZikoUIImage=Li,t.ZikoUIInput=Fr,t.ZikoUIInputCheckbox=Qr,t.ZikoUIInputColor=qr,t.ZikoUIInputDatalist=Ki,t.ZikoUIInputDate=ii,t.ZikoUIInputDateTime=hi,t.ZikoUIInputEmail=ti,t.ZikoUIInputImage=Zi,t.ZikoUIInputNumber=Hr,t.ZikoUIInputOption=Qi,t.ZikoUIInputPassword=si,t.ZikoUIInputRadio=Gr,t.ZikoUIInputSearch=Yr,t.ZikoUIInputSlider=Vr,t.ZikoUIInputTime=oi,t.ZikoUILabel=Xi,t.ZikoUILink=Ai,t.ZikoUIMain=In,t.ZikoUINav=Tn,t.ZikoUIParagraphe=wr,t.ZikoUIQuote=ar,t.ZikoUISVGWrapper=mi,t.ZikoUISection=Cn,t.ZikoUISelect=Ji,t.ZikoUISubText=cr,t.ZikoUISupText=lr,t.ZikoUISuspense=fi,t.ZikoUISvg=oa,t.ZikoUIText=or,t.ZikoUITextArea=en,t.ZikoUIVideo=Hi,t.ZikoUIXMLWrapper=ci,t.ZikoUseRoot=tr,t.ZikoUseStyle=Qs,t.__CACHE__=Oa,t.__Config__=Ma,t.__HYDRATION_MAP__=Sa,t.__HYDRATION__=Ca,t.__UI__=Ta,t.abbrText=vr,t.abs=To,t.accum=G,t.acos=Fo,t.acosh=Yo,t.acot=Bo,t.add=S,t.arange=H,t.arr2str=Kn,t.asin=No,t.asinh=Xo,t.atan=Ho,t.atan2=ta,t.atanh=Qo,t.audio=$i,t.bessel=ko,t.beta=Io,t.blockQuote=kr,t.br=Ti,t.brs=Si,t.btn=Di,t.cartesianProduct=et,t.ceil=Ko,t.checkbox=Kr,t.choleskyDecomposition=wt,t.clamp=N,t.codeText=yr,t.combinaison=ut,t.complex=yo,t.cos=Do,t.cosh=Vo,t.cot=zo,t.coth=Wo,t.count=no,t.countWords=oo,t.csc=Po,t.csv2arr=kt,t.csv2json=At,t.csv2matrix=Et,t.csv2object=It,t.csv2sql=Tt,t.datalist=Gi,t.default=Ua,t.defineParamsGetter=Aa,t.deg2rad=q,t.dfnText=fr,t.div=j,t.e=Oo,t.fact=ea,t.figure=Fi,t.floor=Go,t.gamma=xo,t.geomspace=$,t.h=yi,t.h1=Ir,t.h2=Ar,t.h3=Tr,t.h4=Cr,t.h5=Sr,t.h6=Mr,t.hTags=wi,t.hr=Ci,t.hrs=Mi,t.html=ji,t.hypot=ia,t.image=Pi,t.inRange=J,t.input=Nr,t.inputCamera=Yi,t.inputColor=Wr,t.inputDate=ni,t.inputDateTime=li,t.inputEmail=ei,t.inputImage=Ri,t.inputNumber=Br,t.inputPassword=ri,t.inputTime=ai,t.isApproximatlyEqual=tt,t.json2arr=Mt,t.json2css=Gn,t.json2csv=Ot,t.json2csvFile=jt,t.json2xml=Lt,t.json2xmlFile=Pt,t.json2yml=Zt,t.json2ymlFile=Rt,t.jsonStyleSheet=wa,t.lerp=P,t.li=Rr,t.link=Oi,t.linspace=B,t.ln=jo,t.logspace=V,t.luDecomposition=ft,t.map=F,t.mapfun=k,t.matrix=co,t.matrix2=uo,t.matrix3=mo,t.matrix4=po,t.max=K,t.min=Q,t.modulo=D,t.mul=O,t.norm=L,t.nums=R,t.obj2str=Xn,t.ol=Lr,t.ones=Z,t.p=_r,t.pgcd=st,t.pow=So,t.powerSet=ot,t.ppcm=rt,t.preload=xt,t.prod=X,t.qrDecomposition=vt,t.quote=dr,t.rad2deg=W,t.radio=Jr,t.removeExtraSpace=io,t.round=Jo,t.s=vi,t.sTags=xi,t.search=Xr,t.sec=Ro,t.select=tn,t.sig=ra,t.sign=sa,t.sin=Uo,t.sinc=Lo,t.sinh=$o,t.slider=$r,t.sqrt=Co,t.sqrtn=Mo,t.str=ao,t.sub=M,t.subSet=null,t.subText=br,t.sum=Y,t.supText=gr,t.svg2ascii=qn,t.svg2img=Yn,t.svg2imgUrl=Wn,t.svg2str=$n,t.tags=Bn,t.tan=Zo,t.tanh=qo,t.text=pr,t.textarea=sn,t.timeTaken=Is,t.time_memory_Taken=xs,t.ul=Pr,t.useAnimation=(t,e=ys.Linear,s=50,r)=>new Ts(t,ys.Linear,50,r),t.useChannel=Fs,t.useClickEvent=Wt,t.useClipboardEvent=De,t.useCustomEvent=We,t.useDebounce=vs,t.useDragEvent=Ae,t.useDropEvent=Te,t.useEventEmitter=Hs,t.useFavIcon=js,t.useFocusEvent=Le,t.useFps=fs,t.useHashEvent=Ve,t.useHead=Ps,t.useInputEvent=Ne,t.useKeyEvent=ve,t.useLocaleStorage=Ys,t.useMediaQuery=Js,t.useMeta=Us,t.useMouseEvent=ue,t.usePointerEvent=se,t.useRoot=sr,t.useRootValue=er,t.useSessionStorage=Xs,t.useStyle=Ks,t.useSuccesifKeys=us,t.useSwipeEvent=Qe,t.useThread=Vs,t.useThrottle=ws,t.useTimeLoop=gs,t.useTitle=Rs,t.useType=ms,t.useWheelEvent=de,t.video=Bi,t.wait=Es,t.waitForUIElm=_s,t.waitForUIElmSync=ks,t.watch=Je,t.watchAttr=es,t.watchChildren=rs,t.watchIntersection=ns,t.watchScreen=ls,t.watchSize=as,t.zeros=U,Object.defineProperty(t,"__esModule",{value:!0})}));