@mxtommy/kip 4.0.5 → 4.0.6-beta.2

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.
@@ -0,0 +1,2 @@
1
+ var ca=Object.create;var Ut=Object.defineProperty;var ua=Object.getOwnPropertyDescriptor;var la=Object.getOwnPropertyNames;var fa=Object.getPrototypeOf,ha=Object.prototype.hasOwnProperty;var u=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var va=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of la(r))!ha.call(e,o)&&o!==t&&Ut(e,o,{get:()=>r[o],enumerable:!(n=ua(r,o))||n.enumerable});return e};var da=(e,r,t)=>(t=e!=null?ca(fa(e)):{},va(r||!e||!e.__esModule?Ut(t,"default",{value:e,enumerable:!0}):t,e));var oe=u((Pr,$t)=>{"use strict";var Ae=function(e){return e&&e.Math===Math&&e};$t.exports=Ae(typeof globalThis=="object"&&globalThis)||Ae(typeof window=="object"&&window)||Ae(typeof self=="object"&&self)||Ae(typeof global=="object"&&global)||Ae(typeof Pr=="object"&&Pr)||(function(){return this})()||Function("return this")()});var zt=u((_v,Vt)=>{"use strict";Vt.exports=!1});var Xe=u((Tv,Yt)=>{"use strict";var Wt=oe(),pa=Object.defineProperty;Yt.exports=function(e,r){try{pa(Wt,e,{value:r,configurable:!0,writable:!0})}catch{Wt[e]=r}return r}});var Je=u((Ev,Jt)=>{"use strict";var ya=zt(),_a=oe(),Ta=Xe(),Kt="__core-js_shared__",Xt=Jt.exports=_a[Kt]||Ta(Kt,{});(Xt.versions||(Xt.versions=[])).push({version:"3.46.0",mode:ya?"pure":"global",copyright:"\xA9 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)",license:"https://github.com/zloirock/core-js/blob/v3.46.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var wr=u((gv,en)=>{"use strict";var Qt=Je();en.exports=function(e,r){return Qt[e]||(Qt[e]=r||{})}});var J=u((bv,rn)=>{"use strict";rn.exports=function(e){try{return!!e()}catch{return!0}}});var Ze=u((mv,tn)=>{"use strict";var Ea=J();tn.exports=!Ea(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")})});var ie=u((Ov,sn)=>{"use strict";var nn=Ze(),on=Function.prototype,Sr=on.call,ga=nn&&on.bind.bind(Sr,Sr);sn.exports=nn?ga:function(e){return function(){return Sr.apply(e,arguments)}}});var Rr=u((qv,an)=>{"use strict";an.exports=function(e){return e==null}});var Qe=u((kv,cn)=>{"use strict";var ba=Rr(),ma=TypeError;cn.exports=function(e){if(ba(e))throw new ma("Can't call method on "+e);return e}});var Cr=u((Pv,un)=>{"use strict";var Oa=Qe(),qa=Object;un.exports=function(e){return qa(Oa(e))}});var ce=u((wv,ln)=>{"use strict";var ka=ie(),Pa=Cr(),wa=ka({}.hasOwnProperty);ln.exports=Object.hasOwn||function(r,t){return wa(Pa(r),t)}});var Dr=u((Sv,fn)=>{"use strict";var Sa=ie(),Ra=0,Ca=Math.random(),Da=Sa(1.1.toString);fn.exports=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Da(++Ra+Ca,36)}});var pn=u((Rv,dn)=>{"use strict";var Ia=oe(),hn=Ia.navigator,vn=hn&&hn.userAgent;dn.exports=vn?String(vn):""});var mn=u((Cv,bn)=>{"use strict";var gn=oe(),Ir=pn(),yn=gn.process,_n=gn.Deno,Tn=yn&&yn.versions||_n&&_n.version,En=Tn&&Tn.v8,ve,er;En&&(ve=En.split("."),er=ve[0]>0&&ve[0]<4?1:+(ve[0]+ve[1]));!er&&Ir&&(ve=Ir.match(/Edge\/(\d+)/),(!ve||ve[1]>=74)&&(ve=Ir.match(/Chrome\/(\d+)/),ve&&(er=+ve[1])));bn.exports=er});var jr=u((Dv,qn)=>{"use strict";var On=mn(),ja=J(),Na=oe(),xa=Na.String;qn.exports=!!Object.getOwnPropertySymbols&&!ja(function(){var e=Symbol("symbol detection");return!xa(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&On&&On<41})});var Nr=u((Iv,kn)=>{"use strict";var Ma=jr();kn.exports=Ma&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Fe=u((jv,wn)=>{"use strict";var La=oe(),Aa=wr(),Pn=ce(),Za=Dr(),Fa=jr(),Ga=Nr(),Ne=La.Symbol,xr=Aa("wks"),Ba=Ga?Ne.for||Ne:Ne&&Ne.withoutSetter||Za;wn.exports=function(e){return Pn(xr,e)||(xr[e]=Fa&&Pn(Ne,e)?Ne[e]:Ba("Symbol."+e)),xr[e]}});var rr=u((Nv,Rn)=>{"use strict";var Ha=Fe(),Ua=Ha("toStringTag"),Sn={};Sn[Ua]="z";Rn.exports=String(Sn)==="[object z]"});var se=u((xv,Cn)=>{"use strict";var Mr=typeof document=="object"&&document.all;Cn.exports=typeof Mr>"u"&&Mr!==void 0?function(e){return typeof e=="function"||e===Mr}:function(e){return typeof e=="function"}});var de=u((Mv,Dn)=>{"use strict";var $a=J();Dn.exports=!$a(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var ae=u((Lv,In)=>{"use strict";var Va=se();In.exports=function(e){return typeof e=="object"?e!==null:Va(e)}});var Ar=u((Av,Nn)=>{"use strict";var za=oe(),jn=ae(),Lr=za.document,Wa=jn(Lr)&&jn(Lr.createElement);Nn.exports=function(e){return Wa?Lr.createElement(e):{}}});var Zr=u((Zv,xn)=>{"use strict";var Ya=de(),Ka=J(),Xa=Ar();xn.exports=!Ya&&!Ka(function(){return Object.defineProperty(Xa("div"),"a",{get:function(){return 7}}).a!==7})});var Fr=u((Fv,Mn)=>{"use strict";var Ja=de(),Qa=J();Mn.exports=Ja&&Qa(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var re=u((Gv,Ln)=>{"use strict";var ec=ae(),rc=String,tc=TypeError;Ln.exports=function(e){if(ec(e))return e;throw new tc(rc(e)+" is not an object")}});var xe=u((Bv,An)=>{"use strict";var nc=Ze(),tr=Function.prototype.call;An.exports=nc?tr.bind(tr):function(){return tr.apply(tr,arguments)}});var Re=u((Hv,Zn)=>{"use strict";var Gr=oe(),oc=se(),ic=function(e){return oc(e)?e:void 0};Zn.exports=function(e,r){return arguments.length<2?ic(Gr[e]):Gr[e]&&Gr[e][r]}});var Gn=u((Uv,Fn)=>{"use strict";var sc=ie();Fn.exports=sc({}.isPrototypeOf)});var Br=u(($v,Bn)=>{"use strict";var ac=Re(),cc=se(),uc=Gn(),lc=Nr(),fc=Object;Bn.exports=lc?function(e){return typeof e=="symbol"}:function(e){var r=ac("Symbol");return cc(r)&&uc(r.prototype,fc(e))}});var Hr=u((Vv,Hn)=>{"use strict";var hc=String;Hn.exports=function(e){try{return hc(e)}catch{return"Object"}}});var Ge=u((zv,Un)=>{"use strict";var vc=se(),dc=Hr(),pc=TypeError;Un.exports=function(e){if(vc(e))return e;throw new pc(dc(e)+" is not a function")}});var Vn=u((Wv,$n)=>{"use strict";var yc=Ge(),_c=Rr();$n.exports=function(e,r){var t=e[r];return _c(t)?void 0:yc(t)}});var Wn=u((Yv,zn)=>{"use strict";var Ur=xe(),$r=se(),Vr=ae(),Tc=TypeError;zn.exports=function(e,r){var t,n;if(r==="string"&&$r(t=e.toString)&&!Vr(n=Ur(t,e))||$r(t=e.valueOf)&&!Vr(n=Ur(t,e))||r!=="string"&&$r(t=e.toString)&&!Vr(n=Ur(t,e)))return n;throw new Tc("Can't convert object to primitive value")}});var Jn=u((Kv,Xn)=>{"use strict";var Ec=xe(),Yn=ae(),Kn=Br(),gc=Vn(),bc=Wn(),mc=Fe(),Oc=TypeError,qc=mc("toPrimitive");Xn.exports=function(e,r){if(!Yn(e)||Kn(e))return e;var t=gc(e,qc),n;if(t){if(r===void 0&&(r="default"),n=Ec(t,e,r),!Yn(n)||Kn(n))return n;throw new Oc("Can't convert object to primitive value")}return r===void 0&&(r="number"),bc(e,r)}});var nr=u((Xv,Qn)=>{"use strict";var kc=Jn(),Pc=Br();Qn.exports=function(e){var r=kc(e,"string");return Pc(r)?r:r+""}});var Se=u(ro=>{"use strict";var wc=de(),Sc=Zr(),Rc=Fr(),or=re(),eo=nr(),Cc=TypeError,zr=Object.defineProperty,Dc=Object.getOwnPropertyDescriptor,Wr="enumerable",Yr="configurable",Kr="writable";ro.f=wc?Rc?function(r,t,n){if(or(r),t=eo(t),or(n),typeof r=="function"&&t==="prototype"&&"value"in n&&Kr in n&&!n[Kr]){var o=Dc(r,t);o&&o[Kr]&&(r[t]=n.value,n={configurable:Yr in n?n[Yr]:o[Yr],enumerable:Wr in n?n[Wr]:o[Wr],writable:!1})}return zr(r,t,n)}:zr:function(r,t,n){if(or(r),t=eo(t),or(n),Sc)try{return zr(r,t,n)}catch{}if("get"in n||"set"in n)throw new Cc("Accessors not supported");return"value"in n&&(r[t]=n.value),r}});var oo=u((Qv,no)=>{"use strict";var Xr=de(),Ic=ce(),to=Function.prototype,jc=Xr&&Object.getOwnPropertyDescriptor,Jr=Ic(to,"name"),Nc=Jr&&(function(){}).name==="something",xc=Jr&&(!Xr||Xr&&jc(to,"name").configurable);no.exports={EXISTS:Jr,PROPER:Nc,CONFIGURABLE:xc}});var et=u((ed,io)=>{"use strict";var Mc=ie(),Lc=se(),Qr=Je(),Ac=Mc(Function.toString);Lc(Qr.inspectSource)||(Qr.inspectSource=function(e){return Ac(e)});io.exports=Qr.inspectSource});var co=u((rd,ao)=>{"use strict";var Zc=oe(),Fc=se(),so=Zc.WeakMap;ao.exports=Fc(so)&&/native code/.test(String(so))});var ir=u((td,uo)=>{"use strict";uo.exports=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}}});var rt=u((nd,lo)=>{"use strict";var Gc=de(),Bc=Se(),Hc=ir();lo.exports=Gc?function(e,r,t){return Bc.f(e,r,Hc(1,t))}:function(e,r,t){return e[r]=t,e}});var sr=u((od,ho)=>{"use strict";var Uc=wr(),$c=Dr(),fo=Uc("keys");ho.exports=function(e){return fo[e]||(fo[e]=$c(e))}});var ar=u((id,vo)=>{"use strict";vo.exports={}});var To=u((sd,_o)=>{"use strict";var Vc=co(),yo=oe(),zc=ae(),Wc=rt(),tt=ce(),nt=Je(),Yc=sr(),Kc=ar(),po="Object already initialized",ot=yo.TypeError,Xc=yo.WeakMap,cr,Be,ur,Jc=function(e){return ur(e)?Be(e):cr(e,{})},Qc=function(e){return function(r){var t;if(!zc(r)||(t=Be(r)).type!==e)throw new ot("Incompatible receiver, "+e+" required");return t}};Vc||nt.state?(pe=nt.state||(nt.state=new Xc),pe.get=pe.get,pe.has=pe.has,pe.set=pe.set,cr=function(e,r){if(pe.has(e))throw new ot(po);return r.facade=e,pe.set(e,r),r},Be=function(e){return pe.get(e)||{}},ur=function(e){return pe.has(e)}):(Ce=Yc("state"),Kc[Ce]=!0,cr=function(e,r){if(tt(e,Ce))throw new ot(po);return r.facade=e,Wc(e,Ce,r),r},Be=function(e){return tt(e,Ce)?e[Ce]:{}},ur=function(e){return tt(e,Ce)});var pe,Ce;_o.exports={set:cr,get:Be,has:ur,enforce:Jc,getterFor:Qc}});var mo=u((ad,bo)=>{"use strict";var st=ie(),eu=J(),ru=se(),lr=ce(),it=de(),tu=oo().CONFIGURABLE,nu=et(),go=To(),ou=go.enforce,iu=go.get,Eo=String,fr=Object.defineProperty,su=st("".slice),au=st("".replace),cu=st([].join),uu=it&&!eu(function(){return fr(function(){},"length",{value:8}).length!==8}),lu=String(String).split("String"),fu=bo.exports=function(e,r,t){su(Eo(r),0,7)==="Symbol("&&(r="["+au(Eo(r),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),t&&t.getter&&(r="get "+r),t&&t.setter&&(r="set "+r),(!lr(e,"name")||tu&&e.name!==r)&&(it?fr(e,"name",{value:r,configurable:!0}):e.name=r),uu&&t&&lr(t,"arity")&&e.length!==t.arity&&fr(e,"length",{value:t.arity});try{t&&lr(t,"constructor")&&t.constructor?it&&fr(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch{}var n=ou(e);return lr(n,"source")||(n.source=cu(lu,typeof r=="string"?r:"")),e};Function.prototype.toString=fu(function(){return ru(this)&&iu(this).source||nu(this)},"toString")});var at=u((cd,Oo)=>{"use strict";var hu=se(),vu=Se(),du=mo(),pu=Xe();Oo.exports=function(e,r,t,n){n||(n={});var o=n.enumerable,c=n.name!==void 0?n.name:r;if(hu(t)&&du(t,c,n),n.global)o?e[r]=t:pu(r,t);else{try{n.unsafe?e[r]&&(o=!0):delete e[r]}catch{}o?e[r]=t:vu.f(e,r,{value:t,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e}});var hr=u((ud,ko)=>{"use strict";var qo=ie(),yu=qo({}.toString),_u=qo("".slice);ko.exports=function(e){return _u(yu(e),8,-1)}});var ct=u((ld,Po)=>{"use strict";var Tu=rr(),Eu=se(),vr=hr(),gu=Fe(),bu=gu("toStringTag"),mu=Object,Ou=vr((function(){return arguments})())==="Arguments",qu=function(e,r){try{return e[r]}catch{}};Po.exports=Tu?vr:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=qu(r=mu(e),bu))=="string"?t:Ou?vr(r):(n=vr(r))==="Object"&&Eu(r.callee)?"Arguments":n}});var So=u((fd,wo)=>{"use strict";var ku=rr(),Pu=ct();wo.exports=ku?{}.toString:function(){return"[object "+Pu(this)+"]"}});var Ro=u(()=>{"use strict";var wu=rr(),Su=at(),Ru=So();wu||Su(Object.prototype,"toString",Ru,{unsafe:!0})});var jo=u(Io=>{"use strict";var Co={}.propertyIsEnumerable,Do=Object.getOwnPropertyDescriptor,Cu=Do&&!Co.call({1:2},1);Io.f=Cu?function(r){var t=Do(this,r);return!!t&&t.enumerable}:Co});var xo=u((pd,No)=>{"use strict";var Du=ie(),Iu=J(),ju=hr(),ut=Object,Nu=Du("".split);No.exports=Iu(function(){return!ut("z").propertyIsEnumerable(0)})?function(e){return ju(e)==="String"?Nu(e,""):ut(e)}:ut});var He=u((yd,Mo)=>{"use strict";var xu=xo(),Mu=Qe();Mo.exports=function(e){return xu(Mu(e))}});var De=u(Ao=>{"use strict";var Lu=de(),Au=xe(),Zu=jo(),Fu=ir(),Gu=He(),Bu=nr(),Hu=ce(),Uu=Zr(),Lo=Object.getOwnPropertyDescriptor;Ao.f=Lu?Lo:function(r,t){if(r=Gu(r),t=Bu(t),Uu)try{return Lo(r,t)}catch{}if(Hu(r,t))return Fu(!Au(Zu.f,r,t),r[t])}});var Fo=u((Td,Zo)=>{"use strict";var $u=Math.ceil,Vu=Math.floor;Zo.exports=Math.trunc||function(r){var t=+r;return(t>0?Vu:$u)(t)}});var lt=u((Ed,Go)=>{"use strict";var zu=Fo();Go.exports=function(e){var r=+e;return r!==r||r===0?0:zu(r)}});var Ho=u((gd,Bo)=>{"use strict";var Wu=lt(),Yu=Math.max,Ku=Math.min;Bo.exports=function(e,r){var t=Wu(e);return t<0?Yu(t+r,0):Ku(t,r)}});var $o=u((bd,Uo)=>{"use strict";var Xu=lt(),Ju=Math.min;Uo.exports=function(e){var r=Xu(e);return r>0?Ju(r,9007199254740991):0}});var zo=u((md,Vo)=>{"use strict";var Qu=$o();Vo.exports=function(e){return Qu(e.length)}});var Ko=u((Od,Yo)=>{"use strict";var el=He(),rl=Ho(),tl=zo(),Wo=function(e){return function(r,t,n){var o=el(r),c=tl(o);if(c===0)return!e&&-1;var f=rl(n,c),l;if(e&&t!==t){for(;c>f;)if(l=o[f++],l!==l)return!0}else for(;c>f;f++)if((e||f in o)&&o[f]===t)return e||f||0;return!e&&-1}};Yo.exports={includes:Wo(!0),indexOf:Wo(!1)}});var ht=u((qd,Jo)=>{"use strict";var nl=ie(),ft=ce(),ol=He(),il=Ko().indexOf,sl=ar(),Xo=nl([].push);Jo.exports=function(e,r){var t=ol(e),n=0,o=[],c;for(c in t)!ft(sl,c)&&ft(t,c)&&Xo(o,c);for(;r.length>n;)ft(t,c=r[n++])&&(~il(o,c)||Xo(o,c));return o}});var dr=u((kd,Qo)=>{"use strict";Qo.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var ri=u(ei=>{"use strict";var al=ht(),cl=dr(),ul=cl.concat("length","prototype");ei.f=Object.getOwnPropertyNames||function(r){return al(r,ul)}});var ni=u(ti=>{"use strict";ti.f=Object.getOwnPropertySymbols});var vt=u((Sd,oi)=>{"use strict";var ll=Re(),fl=ie(),hl=ri(),vl=ni(),dl=re(),pl=fl([].concat);oi.exports=ll("Reflect","ownKeys")||function(r){var t=hl.f(dl(r)),n=vl.f;return n?pl(t,n(r)):t}});var ai=u((Rd,si)=>{"use strict";var ii=ce(),yl=vt(),_l=De(),Tl=Se();si.exports=function(e,r,t){for(var n=yl(r),o=Tl.f,c=_l.f,f=0;f<n.length;f++){var l=n[f];!ii(e,l)&&!(t&&ii(t,l))&&o(e,l,c(r,l))}}});var ui=u((Cd,ci)=>{"use strict";var El=J(),gl=se(),bl=/#|\.prototype\./,Ue=function(e,r){var t=Ol[ml(e)];return t===kl?!0:t===ql?!1:gl(r)?El(r):!!r},ml=Ue.normalize=function(e){return String(e).replace(bl,".").toLowerCase()},Ol=Ue.data={},ql=Ue.NATIVE="N",kl=Ue.POLYFILL="P";ci.exports=Ue});var ne=u((Dd,li)=>{"use strict";var pr=oe(),Pl=De().f,wl=rt(),Sl=at(),Rl=Xe(),Cl=ai(),Dl=ui();li.exports=function(e,r){var t=e.target,n=e.global,o=e.stat,c,f,l,_,q,y;if(n?f=pr:o?f=pr[t]||Rl(t,{}):f=pr[t]&&pr[t].prototype,f)for(l in r){if(q=r[l],e.dontCallGetSet?(y=Pl(f,l),_=y&&y.value):_=f[l],c=Dl(n?l:t+(o?".":"#")+l,e.forced),!c&&_!==void 0){if(typeof q==typeof _)continue;Cl(q,_)}(e.sham||_&&_.sham)&&wl(q,"sham",!0),Sl(f,l,q,e)}}});var dt=u((Id,di)=>{"use strict";var Il=Ze(),vi=Function.prototype,fi=vi.apply,hi=vi.call;di.exports=typeof Reflect=="object"&&Reflect.apply||(Il?hi.bind(fi):function(){return hi.apply(fi,arguments)})});var pi=u(()=>{"use strict";var jl=ne(),Nl=dt(),xl=Ge(),Ml=re(),Ll=J(),Al=!Ll(function(){Reflect.apply(function(){})});jl({target:"Reflect",stat:!0,forced:Al},{apply:function(r,t,n){return Nl(xl(r),t,Ml(n))}})});var _i=u((xd,yi)=>{"use strict";var Zl=ie();yi.exports=Zl([].slice)});var mi=u((Md,bi)=>{"use strict";var Ei=ie(),Fl=Ge(),Gl=ae(),Bl=ce(),Ti=_i(),Hl=Ze(),gi=Function,Ul=Ei([].concat),$l=Ei([].join),pt={},Vl=function(e,r,t){if(!Bl(pt,r)){for(var n=[],o=0;o<r;o++)n[o]="a["+o+"]";pt[r]=gi("C,a","return new C("+$l(n,",")+")")}return pt[r](e,t)};bi.exports=Hl?gi.bind:function(r){var t=Fl(this),n=t.prototype,o=Ti(arguments,1),c=function(){var l=Ul(o,Ti(arguments));return this instanceof c?Vl(t,l.length,l):t.apply(r,l)};return Gl(n)&&(c.prototype=n),c}});var Si=u((Ld,wi)=>{"use strict";var zl=ie(),Wl=J(),Oi=se(),Yl=ct(),Kl=Re(),Xl=et(),qi=function(){},ki=Kl("Reflect","construct"),yt=/^\s*(?:class|function)\b/,Jl=zl(yt.exec),Ql=!yt.test(qi),$e=function(r){if(!Oi(r))return!1;try{return ki(qi,[],r),!0}catch{return!1}},Pi=function(r){if(!Oi(r))return!1;switch(Yl(r)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Ql||!!Jl(yt,Xl(r))}catch{return!0}};Pi.sham=!0;wi.exports=!ki||Wl(function(){var e;return $e($e.call)||!$e(Object)||!$e(function(){e=!0})||e})?Pi:$e});var Ci=u((Ad,Ri)=>{"use strict";var ef=Si(),rf=Hr(),tf=TypeError;Ri.exports=function(e){if(ef(e))return e;throw new tf(rf(e)+" is not a constructor")}});var Ii=u((Zd,Di)=>{"use strict";var nf=ht(),of=dr();Di.exports=Object.keys||function(r){return nf(r,of)}});var Ni=u(ji=>{"use strict";var sf=de(),af=Fr(),cf=Se(),uf=re(),lf=He(),ff=Ii();ji.f=sf&&!af?Object.defineProperties:function(r,t){uf(r);for(var n=lf(t),o=ff(t),c=o.length,f=0,l;c>f;)cf.f(r,l=o[f++],n[l]);return r}});var Mi=u((Gd,xi)=>{"use strict";var hf=Re();xi.exports=hf("document","documentElement")});var Ui=u((Bd,Hi)=>{"use strict";var vf=re(),df=Ni(),Li=dr(),pf=ar(),yf=Mi(),_f=Ar(),Tf=sr(),Ai=">",Zi="<",Tt="prototype",Et="script",Gi=Tf("IE_PROTO"),_t=function(){},Bi=function(e){return Zi+Et+Ai+e+Zi+"/"+Et+Ai},Fi=function(e){e.write(Bi("")),e.close();var r=e.parentWindow.Object;return e=null,r},Ef=function(){var e=_f("iframe"),r="java"+Et+":",t;return e.style.display="none",yf.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(Bi("document.F=Object")),t.close(),t.F},yr,_r=function(){try{yr=new ActiveXObject("htmlfile")}catch{}_r=typeof document<"u"?document.domain&&yr?Fi(yr):Ef():Fi(yr);for(var e=Li.length;e--;)delete _r[Tt][Li[e]];return _r()};pf[Gi]=!0;Hi.exports=Object.create||function(r,t){var n;return r!==null?(_t[Tt]=vf(r),n=new _t,_t[Tt]=null,n[Gi]=r):n=_r(),t===void 0?n:df.f(n,t)}});var Xi=u(()=>{"use strict";var gf=ne(),bf=Re(),gt=dt(),mf=mi(),$i=Ci(),Of=re(),Vi=ae(),qf=Ui(),Wi=J(),bt=bf("Reflect","construct"),kf=Object.prototype,Pf=[].push,Yi=Wi(function(){function e(){}return!(bt(function(){},[],e)instanceof e)}),Ki=!Wi(function(){bt(function(){})}),zi=Yi||Ki;gf({target:"Reflect",stat:!0,forced:zi,sham:zi},{construct:function(r,t){$i(r),Of(t);var n=arguments.length<3?r:$i(arguments[2]);if(Ki&&!Yi)return bt(r,t,n);if(r===n){switch(t.length){case 0:return new r;case 1:return new r(t[0]);case 2:return new r(t[0],t[1]);case 3:return new r(t[0],t[1],t[2]);case 4:return new r(t[0],t[1],t[2],t[3])}var o=[null];return gt(Pf,o,t),new(gt(mf,r,o))}var c=n.prototype,f=qf(Vi(c)?c:kf),l=gt(r,f,t);return Vi(l)?l:f}})});var es=u(()=>{"use strict";var wf=ne(),Sf=de(),Ji=re(),Rf=nr(),Qi=Se(),Cf=J(),Df=Cf(function(){Reflect.defineProperty(Qi.f({},1,{value:1}),1,{value:2})});wf({target:"Reflect",stat:!0,forced:Df,sham:!Sf},{defineProperty:function(r,t,n){Ji(r);var o=Rf(t);Ji(n);try{return Qi.f(r,o,n),!0}catch{return!1}}})});var rs=u(()=>{"use strict";var If=ne(),jf=re(),Nf=De().f;If({target:"Reflect",stat:!0},{deleteProperty:function(r,t){var n=Nf(jf(r),t);return n&&!n.configurable?!1:delete r[t]}})});var mt=u((Yd,ns)=>{"use strict";var ts=ce();ns.exports=function(e){return e!==void 0&&(ts(e,"value")||ts(e,"writable"))}});var Ot=u((Kd,os)=>{"use strict";var xf=J();os.exports=!xf(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})});var Tr=u((Xd,ss)=>{"use strict";var Mf=ce(),Lf=se(),Af=Cr(),Zf=sr(),Ff=Ot(),is=Zf("IE_PROTO"),qt=Object,Gf=qt.prototype;ss.exports=Ff?qt.getPrototypeOf:function(e){var r=Af(e);if(Mf(r,is))return r[is];var t=r.constructor;return Lf(t)&&r instanceof t?t.prototype:r instanceof qt?Gf:null}});var cs=u(()=>{"use strict";var Bf=ne(),Hf=xe(),Uf=ae(),$f=re(),Vf=mt(),zf=De(),Wf=Tr();function as(e,r){var t=arguments.length<3?e:arguments[2],n,o;if($f(e)===t)return e[r];if(n=zf.f(e,r),n)return Vf(n)?n.value:n.get===void 0?void 0:Hf(n.get,t);if(Uf(o=Wf(e)))return as(o,r,t)}Bf({target:"Reflect",stat:!0},{get:as})});var us=u(()=>{"use strict";var Yf=ne(),Kf=de(),Xf=re(),Jf=De();Yf({target:"Reflect",stat:!0,sham:!Kf},{getOwnPropertyDescriptor:function(r,t){return Jf.f(Xf(r),t)}})});var ls=u(()=>{"use strict";var Qf=ne(),eh=re(),rh=Tr(),th=Ot();Qf({target:"Reflect",stat:!0,sham:!th},{getPrototypeOf:function(r){return rh(eh(r))}})});var fs=u(()=>{"use strict";var nh=ne();nh({target:"Reflect",stat:!0},{has:function(r,t){return t in r}})});var vs=u((sp,hs)=>{"use strict";var oh=J();hs.exports=oh(function(){if(typeof ArrayBuffer=="function"){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}})});var ys=u((ap,ps)=>{"use strict";var ih=J(),sh=ae(),ah=hr(),ds=vs(),Er=Object.isExtensible,ch=ih(function(){Er(1)});ps.exports=ch||ds?function(r){return!sh(r)||ds&&ah(r)==="ArrayBuffer"?!1:Er?Er(r):!0}:Er});var _s=u(()=>{"use strict";var uh=ne(),lh=re(),fh=ys();uh({target:"Reflect",stat:!0},{isExtensible:function(r){return lh(r),fh(r)}})});var Ts=u(()=>{"use strict";var hh=ne(),vh=vt();hh({target:"Reflect",stat:!0},{ownKeys:vh})});var gs=u((hp,Es)=>{"use strict";var dh=J();Es.exports=!dh(function(){return Object.isExtensible(Object.preventExtensions({}))})});var bs=u(()=>{"use strict";var ph=ne(),yh=Re(),_h=re(),Th=gs();ph({target:"Reflect",stat:!0,sham:!Th},{preventExtensions:function(r){_h(r);try{var t=yh("Object","preventExtensions");return t&&t(r),!0}catch{return!1}}})});var Ps=u(()=>{"use strict";var Eh=ne(),gh=xe(),bh=re(),ms=ae(),mh=mt(),Oh=J(),kt=Se(),Os=De(),qh=Tr(),qs=ir();function ks(e,r,t){var n=arguments.length<4?e:arguments[3],o=Os.f(bh(e),r),c,f,l;if(!o){if(ms(f=qh(e)))return ks(f,r,t,n);o=qs(0)}if(mh(o)){if(o.writable===!1||!ms(n))return!1;if(c=Os.f(n,r)){if(c.get||c.set||c.writable===!1)return!1;c.value=t,kt.f(n,r,c)}else kt.f(n,r,qs(0,t))}else{if(l=o.set,l===void 0)return!1;gh(l,n,t)}return!0}var kh=Oh(function(){var e=function(){},r=kt.f(new e,"a",{configurable:!0});return Reflect.set(e.prototype,"a",1,r)!==!1});Eh({target:"Reflect",stat:!0,forced:kh},{set:ks})});var Ss=u((_p,ws)=>{"use strict";var Ph=ae();ws.exports=function(e){return Ph(e)||e===null}});var Pt=u((Tp,Rs)=>{"use strict";var wh=Ss(),Sh=String,Rh=TypeError;Rs.exports=function(e){if(wh(e))return e;throw new Rh("Can't set "+Sh(e)+" as a prototype")}});var Ds=u((Ep,Cs)=>{"use strict";var Ch=ie(),Dh=Ge();Cs.exports=function(e,r,t){try{return Ch(Dh(Object.getOwnPropertyDescriptor(e,r)[t]))}catch{}}});var js=u((gp,Is)=>{"use strict";var Ih=Ds(),jh=ae(),Nh=Qe(),xh=Pt();Is.exports=Object.setPrototypeOf||("__proto__"in{}?(function(){var e=!1,r={},t;try{t=Ih(Object.prototype,"__proto__","set"),t(r,[]),e=r instanceof Array}catch{}return function(o,c){return Nh(o),xh(c),jh(o)&&(e?t(o,c):o.__proto__=c),o}})():void 0)});var xs=u(()=>{"use strict";var Mh=ne(),Lh=re(),Ah=Pt(),Ns=js();Ns&&Mh({target:"Reflect",stat:!0},{setPrototypeOf:function(r,t){Lh(r),Ah(t);try{return Ns(r,t),!0}catch{return!1}}})});var As=u((Op,Ls)=>{"use strict";var Zh=Se().f,Fh=ce(),Gh=Fe(),Ms=Gh("toStringTag");Ls.exports=function(e,r,t){e&&!t&&(e=e.prototype),e&&!Fh(e,Ms)&&Zh(e,Ms,{configurable:!0,value:r})}});var Zs=u(()=>{"use strict";var Bh=ne(),Hh=oe(),Uh=As();Bh({global:!0},{Reflect:{}});Uh(Hh.Reflect,"Reflect",!0)});var Gs=u((Pp,Fs)=>{"use strict";var $h=oe();Fs.exports=$h});var Hs=u((wp,Bs)=>{"use strict";Ro();pi();Xi();es();rs();cs();us();ls();fs();_s();Ts();bs();Ps();xs();Zs();var Vh=Gs();Bs.exports=Vh.Reflect});var Sp=da(Hs());var Ee=globalThis;function ue(e){return(Ee.__Zone_symbol_prefix||"__zone_symbol__")+e}function zh(){let e=Ee.performance;function r(I){e&&e.mark&&e.mark(I)}function t(I,T){e&&e.measure&&e.measure(I,T)}r("Zone");let n=(()=>{class I{static __symbol__=ue;static assertZonePatched(){if(Ee.Promise!==D.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")}static get root(){let i=I.current;for(;i.parent;)i=i.parent;return i}static get current(){return k.zone}static get currentTask(){return C}static __load_patch(i,s,b=!1){if(D.hasOwnProperty(i)){let P=Ee[ue("forceDuplicateZoneCheck")]===!0;if(!b&&P)throw Error("Already loaded patch: "+i)}else if(!Ee["__Zone_disable_"+i]){let P="Zone:"+i;r(P),D[i]=s(Ee,I,S),t(P,P)}}get parent(){return this._parent}get name(){return this._name}_parent;_name;_properties;_zoneDelegate;constructor(i,s){this._parent=i,this._name=s?s.name||"unnamed":"<root>",this._properties=s&&s.properties||{},this._zoneDelegate=new c(this,this._parent&&this._parent._zoneDelegate,s)}get(i){let s=this.getZoneWith(i);if(s)return s._properties[i]}getZoneWith(i){let s=this;for(;s;){if(s._properties.hasOwnProperty(i))return s;s=s._parent}return null}fork(i){if(!i)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,i)}wrap(i,s){if(typeof i!="function")throw new Error("Expecting function got: "+i);let b=this._zoneDelegate.intercept(this,i,s),P=this;return function(){return P.runGuarded(b,this,arguments,s)}}run(i,s,b,P){k={parent:k,zone:this};try{return this._zoneDelegate.invoke(this,i,s,b,P)}finally{k=k.parent}}runGuarded(i,s=null,b,P){k={parent:k,zone:this};try{try{return this._zoneDelegate.invoke(this,i,s,b,P)}catch(W){if(this._zoneDelegate.handleError(this,W))throw W}}finally{k=k.parent}}runTask(i,s,b){if(i.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(i.zone||ee).name+"; Execution: "+this.name+")");let P=i,{type:W,data:{isPeriodic:L=!1,isRefreshable:Pe=!1}={}}=i;if(i.state===Y&&(W===V||W===E))return;let ge=i.state!=A;ge&&P._transitionTo(A,p);let be=C;C=P,k={parent:k,zone:this};try{W==E&&i.data&&!L&&!Pe&&(i.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,P,s,b)}catch(fe){if(this._zoneDelegate.handleError(this,fe))throw fe}}finally{let fe=i.state;if(fe!==Y&&fe!==K)if(W==V||L||Pe&&fe===m)ge&&P._transitionTo(p,A,m);else{let d=P._zoneDelegates;this._updateTaskCount(P,-1),ge&&P._transitionTo(Y,A,Y),Pe&&(P._zoneDelegates=d)}k=k.parent,C=be}}scheduleTask(i){if(i.zone&&i.zone!==this){let b=this;for(;b;){if(b===i.zone)throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${i.zone.name}`);b=b.parent}}i._transitionTo(m,Y);let s=[];i._zoneDelegates=s,i._zone=this;try{i=this._zoneDelegate.scheduleTask(this,i)}catch(b){throw i._transitionTo(K,m,Y),this._zoneDelegate.handleError(this,b),b}return i._zoneDelegates===s&&this._updateTaskCount(i,1),i.state==m&&i._transitionTo(p,m),i}scheduleMicroTask(i,s,b,P){return this.scheduleTask(new f(B,i,s,b,P,void 0))}scheduleMacroTask(i,s,b,P,W){return this.scheduleTask(new f(E,i,s,b,P,W))}scheduleEventTask(i,s,b,P,W){return this.scheduleTask(new f(V,i,s,b,P,W))}cancelTask(i){if(i.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(i.zone||ee).name+"; Execution: "+this.name+")");if(!(i.state!==p&&i.state!==A)){i._transitionTo(G,p,A);try{this._zoneDelegate.cancelTask(this,i)}catch(s){throw i._transitionTo(K,G),this._zoneDelegate.handleError(this,s),s}return this._updateTaskCount(i,-1),i._transitionTo(Y,G),i.runCount=-1,i}}_updateTaskCount(i,s){let b=i._zoneDelegates;s==-1&&(i._zoneDelegates=null);for(let P=0;P<b.length;P++)b[P]._updateTaskCount(i.type,s)}}return I})(),o={name:"",onHasTask:(I,T,i,s)=>I.hasTask(i,s),onScheduleTask:(I,T,i,s)=>I.scheduleTask(i,s),onInvokeTask:(I,T,i,s,b,P)=>I.invokeTask(i,s,b,P),onCancelTask:(I,T,i,s)=>I.cancelTask(i,s)};class c{get zone(){return this._zone}_zone;_taskCounts={microTask:0,macroTask:0,eventTask:0};_parentDelegate;_forkDlgt;_forkZS;_forkCurrZone;_interceptDlgt;_interceptZS;_interceptCurrZone;_invokeDlgt;_invokeZS;_invokeCurrZone;_handleErrorDlgt;_handleErrorZS;_handleErrorCurrZone;_scheduleTaskDlgt;_scheduleTaskZS;_scheduleTaskCurrZone;_invokeTaskDlgt;_invokeTaskZS;_invokeTaskCurrZone;_cancelTaskDlgt;_cancelTaskZS;_cancelTaskCurrZone;_hasTaskDlgt;_hasTaskDlgtOwner;_hasTaskZS;_hasTaskCurrZone;constructor(T,i,s){this._zone=T,this._parentDelegate=i,this._forkZS=s&&(s&&s.onFork?s:i._forkZS),this._forkDlgt=s&&(s.onFork?i:i._forkDlgt),this._forkCurrZone=s&&(s.onFork?this._zone:i._forkCurrZone),this._interceptZS=s&&(s.onIntercept?s:i._interceptZS),this._interceptDlgt=s&&(s.onIntercept?i:i._interceptDlgt),this._interceptCurrZone=s&&(s.onIntercept?this._zone:i._interceptCurrZone),this._invokeZS=s&&(s.onInvoke?s:i._invokeZS),this._invokeDlgt=s&&(s.onInvoke?i:i._invokeDlgt),this._invokeCurrZone=s&&(s.onInvoke?this._zone:i._invokeCurrZone),this._handleErrorZS=s&&(s.onHandleError?s:i._handleErrorZS),this._handleErrorDlgt=s&&(s.onHandleError?i:i._handleErrorDlgt),this._handleErrorCurrZone=s&&(s.onHandleError?this._zone:i._handleErrorCurrZone),this._scheduleTaskZS=s&&(s.onScheduleTask?s:i._scheduleTaskZS),this._scheduleTaskDlgt=s&&(s.onScheduleTask?i:i._scheduleTaskDlgt),this._scheduleTaskCurrZone=s&&(s.onScheduleTask?this._zone:i._scheduleTaskCurrZone),this._invokeTaskZS=s&&(s.onInvokeTask?s:i._invokeTaskZS),this._invokeTaskDlgt=s&&(s.onInvokeTask?i:i._invokeTaskDlgt),this._invokeTaskCurrZone=s&&(s.onInvokeTask?this._zone:i._invokeTaskCurrZone),this._cancelTaskZS=s&&(s.onCancelTask?s:i._cancelTaskZS),this._cancelTaskDlgt=s&&(s.onCancelTask?i:i._cancelTaskDlgt),this._cancelTaskCurrZone=s&&(s.onCancelTask?this._zone:i._cancelTaskCurrZone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;let b=s&&s.onHasTask,P=i&&i._hasTaskZS;(b||P)&&(this._hasTaskZS=b?s:o,this._hasTaskDlgt=i,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=this._zone,s.onScheduleTask||(this._scheduleTaskZS=o,this._scheduleTaskDlgt=i,this._scheduleTaskCurrZone=this._zone),s.onInvokeTask||(this._invokeTaskZS=o,this._invokeTaskDlgt=i,this._invokeTaskCurrZone=this._zone),s.onCancelTask||(this._cancelTaskZS=o,this._cancelTaskDlgt=i,this._cancelTaskCurrZone=this._zone))}fork(T,i){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,T,i):new n(T,i)}intercept(T,i,s){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,T,i,s):i}invoke(T,i,s,b,P){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,T,i,s,b,P):i.apply(s,b)}handleError(T,i){return this._handleErrorZS?this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,T,i):!0}scheduleTask(T,i){let s=i;if(this._scheduleTaskZS)this._hasTaskZS&&s._zoneDelegates.push(this._hasTaskDlgtOwner),s=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,T,i),s||(s=i);else if(i.scheduleFn)i.scheduleFn(i);else if(i.type==B)$(i);else throw new Error("Task is missing scheduleFn.");return s}invokeTask(T,i,s,b){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,T,i,s,b):i.callback.apply(s,b)}cancelTask(T,i){let s;if(this._cancelTaskZS)s=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,T,i);else{if(!i.cancelFn)throw Error("Task is not cancelable");s=i.cancelFn(i)}return s}hasTask(T,i){try{this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,T,i)}catch(s){this.handleError(T,s)}}_updateTaskCount(T,i){let s=this._taskCounts,b=s[T],P=s[T]=b+i;if(P<0)throw new Error("More tasks executed then were scheduled.");if(b==0||P==0){let W={microTask:s.microTask>0,macroTask:s.macroTask>0,eventTask:s.eventTask>0,change:T};this.hasTask(this._zone,W)}}}class f{type;source;invoke;callback;data;scheduleFn;cancelFn;_zone=null;runCount=0;_zoneDelegates=null;_state="notScheduled";constructor(T,i,s,b,P,W){if(this.type=T,this.source=i,this.data=b,this.scheduleFn=P,this.cancelFn=W,!s)throw new Error("callback is not defined");this.callback=s;let L=this;T===V&&b&&b.useG?this.invoke=f.invokeTask:this.invoke=function(){return f.invokeTask.call(Ee,L,this,arguments)}}static invokeTask(T,i,s){T||(T=this),te++;try{return T.runCount++,T.zone.runTask(T,i,s)}finally{te==1&&Q(),te--}}get zone(){return this._zone}get state(){return this._state}cancelScheduleRequest(){this._transitionTo(Y,m)}_transitionTo(T,i,s){if(this._state===i||this._state===s)this._state=T,T==Y&&(this._zoneDelegates=null);else throw new Error(`${this.type} '${this.source}': can not transition to '${T}', expecting state '${i}'${s?" or '"+s+"'":""}, was '${this._state}'.`)}toString(){return this.data&&typeof this.data.handleId<"u"?this.data.handleId.toString():Object.prototype.toString.call(this)}toJSON(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}}}let l=ue("setTimeout"),_=ue("Promise"),q=ue("then"),y=[],w=!1,M;function F(I){if(M||Ee[_]&&(M=Ee[_].resolve(0)),M){let T=M[q];T||(T=M.then),T.call(M,I)}else Ee[l](I,0)}function $(I){te===0&&y.length===0&&F(Q),I&&y.push(I)}function Q(){if(!w){for(w=!0;y.length;){let I=y;y=[];for(let T=0;T<I.length;T++){let i=I[T];try{i.zone.runTask(i,null,null)}catch(s){S.onUnhandledError(s)}}}S.microtaskDrainDone(),w=!1}}let ee={name:"NO ZONE"},Y="notScheduled",m="scheduling",p="scheduled",A="running",G="canceling",K="unknown",B="microTask",E="macroTask",V="eventTask",D={},S={symbol:ue,currentZoneFrame:()=>k,onUnhandledError:z,microtaskDrainDone:z,scheduleMicroTask:$,showUncaughtError:()=>!n[ue("ignoreConsoleErrorUncaughtError")],patchEventTarget:()=>[],patchOnProperties:z,patchMethod:()=>z,bindArguments:()=>[],patchThen:()=>z,patchMacroTask:()=>z,patchEventPrototype:()=>z,isIEOrEdge:()=>!1,getGlobalObjects:()=>{},ObjectDefineProperty:()=>z,ObjectGetOwnPropertyDescriptor:()=>{},ObjectCreate:()=>{},ArraySlice:()=>[],patchClass:()=>z,wrapWithCurrentZone:()=>z,filterProperties:()=>[],attachOriginToPatched:()=>z,_redefineProperty:()=>z,patchCallbacks:()=>z,nativeScheduleMicroTask:F},k={parent:null,zone:new n(null,null)},C=null,te=0;function z(){}return t("Zone","Zone"),n}function Wh(){let e=globalThis,r=e[ue("forceDuplicateZoneCheck")]===!0;if(e.Zone&&(r||typeof e.Zone.__symbol__!="function"))throw new Error("Zone already loaded.");return e.Zone??=zh(),e.Zone}var ze=Object.getOwnPropertyDescriptor,Dt=Object.defineProperty,It=Object.getPrototypeOf,Yh=Object.create,Kh=Array.prototype.slice,jt="addEventListener",Nt="removeEventListener",wt=ue(jt),St=ue(Nt),me="true",Oe="false",We=ue("");function xt(e,r){return Zone.current.wrap(e,r)}function Mt(e,r,t,n,o){return Zone.current.scheduleMacroTask(e,r,t,n,o)}var Z=ue,mr=typeof window<"u",Ye=mr?window:void 0,X=mr&&Ye||globalThis,Xh="removeAttribute";function Lt(e,r){for(let t=e.length-1;t>=0;t--)typeof e[t]=="function"&&(e[t]=xt(e[t],r+"_"+t));return e}function Jh(e,r){let t=e.constructor.name;for(let n=0;n<r.length;n++){let o=r[n],c=e[o];if(c){let f=ze(e,o);if(!Ks(f))continue;e[o]=(l=>{let _=function(){return l.apply(this,Lt(arguments,t+"."+o))};return ke(_,l),_})(c)}}}function Ks(e){return e?e.writable===!1?!1:!(typeof e.get=="function"&&typeof e.set>"u"):!0}var Xs=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,Or=!("nw"in X)&&typeof X.process<"u"&&X.process.toString()==="[object process]",At=!Or&&!Xs&&!!(mr&&Ye.HTMLElement),Js=typeof X.process<"u"&&X.process.toString()==="[object process]"&&!Xs&&!!(mr&&Ye.HTMLElement),br={},Qh=Z("enable_beforeunload"),Us=function(e){if(e=e||X.event,!e)return;let r=br[e.type];r||(r=br[e.type]=Z("ON_PROPERTY"+e.type));let t=this||e.target||X,n=t[r],o;if(At&&t===Ye&&e.type==="error"){let c=e;o=n&&n.call(this,c.message,c.filename,c.lineno,c.colno,c.error),o===!0&&e.preventDefault()}else o=n&&n.apply(this,arguments),e.type==="beforeunload"&&X[Qh]&&typeof o=="string"?e.returnValue=o:o!=null&&!o&&e.preventDefault();return o};function $s(e,r,t){let n=ze(e,r);if(!n&&t&&ze(t,r)&&(n={enumerable:!0,configurable:!0}),!n||!n.configurable)return;let o=Z("on"+r+"patched");if(e.hasOwnProperty(o)&&e[o])return;delete n.writable,delete n.value;let c=n.get,f=n.set,l=r.slice(2),_=br[l];_||(_=br[l]=Z("ON_PROPERTY"+l)),n.set=function(q){let y=this;if(!y&&e===X&&(y=X),!y)return;typeof y[_]=="function"&&y.removeEventListener(l,Us),f?.call(y,null),y[_]=q,typeof q=="function"&&y.addEventListener(l,Us,!1)},n.get=function(){let q=this;if(!q&&e===X&&(q=X),!q)return null;let y=q[_];if(y)return y;if(c){let w=c.call(this);if(w)return n.set.call(this,w),typeof q[Xh]=="function"&&q.removeAttribute(r),w}return null},Dt(e,r,n),e[o]=!0}function Qs(e,r,t){if(r)for(let n=0;n<r.length;n++)$s(e,"on"+r[n],t);else{let n=[];for(let o in e)o.slice(0,2)=="on"&&n.push(o);for(let o=0;o<n.length;o++)$s(e,n[o],t)}}var ye=Z("originalInstance");function Ve(e){let r=X[e];if(!r)return;X[Z(e)]=r,X[e]=function(){let o=Lt(arguments,e);switch(o.length){case 0:this[ye]=new r;break;case 1:this[ye]=new r(o[0]);break;case 2:this[ye]=new r(o[0],o[1]);break;case 3:this[ye]=new r(o[0],o[1],o[2]);break;case 4:this[ye]=new r(o[0],o[1],o[2],o[3]);break;default:throw new Error("Arg list too long.")}},ke(X[e],r);let t=new r(function(){}),n;for(n in t)e==="XMLHttpRequest"&&n==="responseBlob"||(function(o){typeof t[o]=="function"?X[e].prototype[o]=function(){return this[ye][o].apply(this[ye],arguments)}:Dt(X[e].prototype,o,{set:function(c){typeof c=="function"?(this[ye][o]=xt(c,e+"."+o),ke(this[ye][o],c)):this[ye][o]=c},get:function(){return this[ye][o]}})})(n);for(n in r)n!=="prototype"&&r.hasOwnProperty(n)&&(X[e][n]=r[n])}function qe(e,r,t){let n=e;for(;n&&!n.hasOwnProperty(r);)n=It(n);!n&&e[r]&&(n=e);let o=Z(r),c=null;if(n&&(!(c=n[o])||!n.hasOwnProperty(o))){c=n[o]=n[r];let f=n&&ze(n,r);if(Ks(f)){let l=t(c,o,r);n[r]=function(){return l(this,arguments)},ke(n[r],c)}}return c}function ev(e,r,t){let n=null;function o(c){let f=c.data;return f.args[f.cbIdx]=function(){c.invoke.apply(this,arguments)},n.apply(f.target,f.args),c}n=qe(e,r,c=>function(f,l){let _=t(f,l);return _.cbIdx>=0&&typeof l[_.cbIdx]=="function"?Mt(_.name,l[_.cbIdx],_,o):c.apply(f,l)})}function ke(e,r){e[Z("OriginalDelegate")]=r}var Vs=!1,Rt=!1;function rv(){if(Vs)return Rt;Vs=!0;try{let e=Ye.navigator.userAgent;(e.indexOf("MSIE ")!==-1||e.indexOf("Trident/")!==-1||e.indexOf("Edge/")!==-1)&&(Rt=!0)}catch{}return Rt}function zs(e){return typeof e=="function"}function Ws(e){return typeof e=="number"}var tv={useG:!0},le={},ea={},ra=new RegExp("^"+We+"(\\w+)(true|false)$"),ta=Z("propagationStopped");function na(e,r){let t=(r?r(e):e)+Oe,n=(r?r(e):e)+me,o=We+t,c=We+n;le[e]={},le[e][Oe]=o,le[e][me]=c}function nv(e,r,t,n){let o=n&&n.add||jt,c=n&&n.rm||Nt,f=n&&n.listeners||"eventListeners",l=n&&n.rmAll||"removeAllListeners",_=Z(o),q="."+o+":",y="prependListener",w="."+y+":",M=function(m,p,A){if(m.isRemoved)return;let G=m.callback;typeof G=="object"&&G.handleEvent&&(m.callback=E=>G.handleEvent(E),m.originalDelegate=G);let K;try{m.invoke(m,p,[A])}catch(E){K=E}let B=m.options;if(B&&typeof B=="object"&&B.once){let E=m.originalDelegate?m.originalDelegate:m.callback;p[c].call(p,A.type,E,B)}return K};function F(m,p,A){if(p=p||e.event,!p)return;let G=m||p.target||e,K=G[le[p.type][A?me:Oe]];if(K){let B=[];if(K.length===1){let E=M(K[0],G,p);E&&B.push(E)}else{let E=K.slice();for(let V=0;V<E.length&&!(p&&p[ta]===!0);V++){let D=M(E[V],G,p);D&&B.push(D)}}if(B.length===1)throw B[0];for(let E=0;E<B.length;E++){let V=B[E];r.nativeScheduleMicroTask(()=>{throw V})}}}let $=function(m){return F(this,m,!1)},Q=function(m){return F(this,m,!0)};function ee(m,p){if(!m)return!1;let A=!0;p&&p.useG!==void 0&&(A=p.useG);let G=p&&p.vh,K=!0;p&&p.chkDup!==void 0&&(K=p.chkDup);let B=!1;p&&p.rt!==void 0&&(B=p.rt);let E=m;for(;E&&!E.hasOwnProperty(o);)E=It(E);if(!E&&m[o]&&(E=m),!E||E[_])return!1;let V=p&&p.eventNameToString,D={},S=E[_]=E[o],k=E[Z(c)]=E[c],C=E[Z(f)]=E[f],te=E[Z(l)]=E[l],z;p&&p.prepend&&(z=E[Z(p.prepend)]=E[p.prepend]);function I(a,v){return v?typeof a=="boolean"?{capture:a,passive:!0}:a?typeof a=="object"&&a.passive!==!1?{...a,passive:!0}:a:{passive:!0}:a}let T=function(a){if(!D.isExisting)return S.call(D.target,D.eventName,D.capture?Q:$,D.options)},i=function(a){if(!a.isRemoved){let v=le[a.eventName],O;v&&(O=v[a.capture?me:Oe]);let R=O&&a.target[O];if(R){for(let g=0;g<R.length;g++)if(R[g]===a){R.splice(g,1),a.isRemoved=!0,a.removeAbortListener&&(a.removeAbortListener(),a.removeAbortListener=null),R.length===0&&(a.allRemoved=!0,a.target[O]=null);break}}}if(a.allRemoved)return k.call(a.target,a.eventName,a.capture?Q:$,a.options)},s=function(a){return S.call(D.target,D.eventName,a.invoke,D.options)},b=function(a){return z.call(D.target,D.eventName,a.invoke,D.options)},P=function(a){return k.call(a.target,a.eventName,a.invoke,a.options)},W=A?T:s,L=A?i:P,Pe=function(a,v){let O=typeof v;return O==="function"&&a.callback===v||O==="object"&&a.originalDelegate===v},ge=p?.diff||Pe,be=Zone[Z("UNPATCHED_EVENTS")],fe=e[Z("PASSIVE_EVENTS")];function d(a){if(typeof a=="object"&&a!==null){let v={...a};return a.signal&&(v.signal=a.signal),v}return a}let h=function(a,v,O,R,g=!1,j=!1){return function(){let N=this||e,x=arguments[0];p&&p.transferEventName&&(x=p.transferEventName(x));let H=arguments[1];if(!H)return a.apply(this,arguments);if(Or&&x==="uncaughtException")return a.apply(this,arguments);let U=!1;if(typeof H!="function"){if(!H.handleEvent)return a.apply(this,arguments);U=!0}if(G&&!G(a,H,N,arguments))return;let we=!!fe&&fe.indexOf(x)!==-1,_e=d(I(arguments[2],we)),Ie=_e?.signal;if(Ie?.aborted)return;if(be){for(let Te=0;Te<be.length;Te++)if(x===be[Te])return we?a.call(N,x,H,_e):a.apply(this,arguments)}let qr=_e?typeof _e=="boolean"?!0:_e.capture:!1,Zt=_e&&typeof _e=="object"?_e.once:!1,aa=Zone.current,kr=le[x];kr||(na(x,V),kr=le[x]);let Ft=kr[qr?me:Oe],je=N[Ft],Gt=!1;if(je){if(Gt=!0,K){for(let Te=0;Te<je.length;Te++)if(ge(je[Te],H))return}}else je=N[Ft]=[];let Ke,Bt=N.constructor.name,Ht=ea[Bt];Ht&&(Ke=Ht[x]),Ke||(Ke=Bt+v+(V?V(x):x)),D.options=_e,Zt&&(D.options.once=!1),D.target=N,D.capture=qr,D.eventName=x,D.isExisting=Gt;let Le=A?tv:void 0;Le&&(Le.taskData=D),Ie&&(D.options.signal=void 0);let he=aa.scheduleEventTask(Ke,H,Le,O,R);if(Ie){D.options.signal=Ie;let Te=()=>he.zone.cancelTask(he);a.call(Ie,"abort",Te,{once:!0}),he.removeAbortListener=()=>Ie.removeEventListener("abort",Te)}if(D.target=null,Le&&(Le.taskData=null),Zt&&(D.options.once=!0),typeof he.options!="boolean"&&(he.options=_e),he.target=N,he.capture=qr,he.eventName=x,U&&(he.originalDelegate=H),j?je.unshift(he):je.push(he),g)return N}};return E[o]=h(S,q,W,L,B),z&&(E[y]=h(z,w,b,L,B,!0)),E[c]=function(){let a=this||e,v=arguments[0];p&&p.transferEventName&&(v=p.transferEventName(v));let O=arguments[2],R=O?typeof O=="boolean"?!0:O.capture:!1,g=arguments[1];if(!g)return k.apply(this,arguments);if(G&&!G(k,g,a,arguments))return;let j=le[v],N;j&&(N=j[R?me:Oe]);let x=N&&a[N];if(x)for(let H=0;H<x.length;H++){let U=x[H];if(ge(U,g)){if(x.splice(H,1),U.isRemoved=!0,x.length===0&&(U.allRemoved=!0,a[N]=null,!R&&typeof v=="string")){let we=We+"ON_PROPERTY"+v;a[we]=null}return U.zone.cancelTask(U),B?a:void 0}}return k.apply(this,arguments)},E[f]=function(){let a=this||e,v=arguments[0];p&&p.transferEventName&&(v=p.transferEventName(v));let O=[],R=oa(a,V?V(v):v);for(let g=0;g<R.length;g++){let j=R[g],N=j.originalDelegate?j.originalDelegate:j.callback;O.push(N)}return O},E[l]=function(){let a=this||e,v=arguments[0];if(v){p&&p.transferEventName&&(v=p.transferEventName(v));let O=le[v];if(O){let R=O[Oe],g=O[me],j=a[R],N=a[g];if(j){let x=j.slice();for(let H=0;H<x.length;H++){let U=x[H],we=U.originalDelegate?U.originalDelegate:U.callback;this[c].call(this,v,we,U.options)}}if(N){let x=N.slice();for(let H=0;H<x.length;H++){let U=x[H],we=U.originalDelegate?U.originalDelegate:U.callback;this[c].call(this,v,we,U.options)}}}}else{let O=Object.keys(a);for(let R=0;R<O.length;R++){let g=O[R],j=ra.exec(g),N=j&&j[1];N&&N!=="removeListener"&&this[l].call(this,N)}this[l].call(this,"removeListener")}if(B)return this},ke(E[o],S),ke(E[c],k),te&&ke(E[l],te),C&&ke(E[f],C),!0}let Y=[];for(let m=0;m<t.length;m++)Y[m]=ee(t[m],n);return Y}function oa(e,r){if(!r){let c=[];for(let f in e){let l=ra.exec(f),_=l&&l[1];if(_&&(!r||_===r)){let q=e[f];if(q)for(let y=0;y<q.length;y++)c.push(q[y])}}return c}let t=le[r];t||(na(r),t=le[r]);let n=e[t[Oe]],o=e[t[me]];return n?o?n.concat(o):n.slice():o?o.slice():[]}function ov(e,r){let t=e.Event;t&&t.prototype&&r.patchMethod(t.prototype,"stopImmediatePropagation",n=>function(o,c){o[ta]=!0,n&&n.apply(o,c)})}function iv(e,r){r.patchMethod(e,"queueMicrotask",t=>function(n,o){Zone.current.scheduleMicroTask("queueMicrotask",o[0])})}var gr=Z("zoneTask");function Me(e,r,t,n){let o=null,c=null;r+=n,t+=n;let f={};function l(q){let y=q.data;y.args[0]=function(){return q.invoke.apply(this,arguments)};let w=o.apply(e,y.args);return Ws(w)?y.handleId=w:(y.handle=w,y.isRefreshable=zs(w.refresh)),q}function _(q){let{handle:y,handleId:w}=q.data;return c.call(e,y??w)}o=qe(e,r,q=>function(y,w){if(zs(w[0])){let M={isRefreshable:!1,isPeriodic:n==="Interval",delay:n==="Timeout"||n==="Interval"?w[1]||0:void 0,args:w},F=w[0];w[0]=function(){try{return F.apply(this,arguments)}finally{let{handle:A,handleId:G,isPeriodic:K,isRefreshable:B}=M;!K&&!B&&(G?delete f[G]:A&&(A[gr]=null))}};let $=Mt(r,w[0],M,l,_);if(!$)return $;let{handleId:Q,handle:ee,isRefreshable:Y,isPeriodic:m}=$.data;if(Q)f[Q]=$;else if(ee&&(ee[gr]=$,Y&&!m)){let p=ee.refresh;ee.refresh=function(){let{zone:A,state:G}=$;return G==="notScheduled"?($._state="scheduled",A._updateTaskCount($,1)):G==="running"&&($._state="scheduling"),p.call(this)}}return ee??Q??$}else return q.apply(e,w)}),c=qe(e,t,q=>function(y,w){let M=w[0],F;Ws(M)?(F=f[M],delete f[M]):(F=M?.[gr],F?M[gr]=null:F=M),F?.type?F.cancelFn&&F.zone.cancelTask(F):q.apply(e,w)})}function sv(e,r){let{isBrowser:t,isMix:n}=r.getGlobalObjects();if(!t&&!n||!e.customElements||!("customElements"in e))return;let o=["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback","formAssociatedCallback","formDisabledCallback","formResetCallback","formStateRestoreCallback"];r.patchCallbacks(r,e.customElements,"customElements","define",o)}function av(e,r){if(Zone[r.symbol("patchEventTarget")])return;let{eventNames:t,zoneSymbolEventNames:n,TRUE_STR:o,FALSE_STR:c,ZONE_SYMBOL_PREFIX:f}=r.getGlobalObjects();for(let _=0;_<t.length;_++){let q=t[_],y=q+c,w=q+o,M=f+y,F=f+w;n[q]={},n[q][c]=M,n[q][o]=F}let l=e.EventTarget;if(!(!l||!l.prototype))return r.patchEventTarget(e,r,[l&&l.prototype]),!0}function cv(e,r){r.patchEventPrototype(e,r)}function ia(e,r,t){if(!t||t.length===0)return r;let n=t.filter(c=>c.target===e);if(n.length===0)return r;let o=n[0].ignoreProperties;return r.filter(c=>o.indexOf(c)===-1)}function Ys(e,r,t,n){if(!e)return;let o=ia(e,r,t);Qs(e,o,n)}function Ct(e){return Object.getOwnPropertyNames(e).filter(r=>r.startsWith("on")&&r.length>2).map(r=>r.substring(2))}function uv(e,r){if(Or&&!Js||Zone[e.symbol("patchEvents")])return;let t=r.__Zone_ignore_on_properties,n=[];if(At){let o=window;n=n.concat(["Document","SVGElement","Element","HTMLElement","HTMLBodyElement","HTMLMediaElement","HTMLFrameSetElement","HTMLFrameElement","HTMLIFrameElement","HTMLMarqueeElement","Worker"]);let c=[];Ys(o,Ct(o),t&&t.concat(c),It(o))}n=n.concat(["XMLHttpRequest","XMLHttpRequestEventTarget","IDBIndex","IDBRequest","IDBOpenDBRequest","IDBDatabase","IDBTransaction","IDBCursor","WebSocket"]);for(let o=0;o<n.length;o++){let c=r[n[o]];c?.prototype&&Ys(c.prototype,Ct(c.prototype),t)}}function lv(e){e.__load_patch("legacy",r=>{let t=r[e.__symbol__("legacyPatch")];t&&t()}),e.__load_patch("timers",r=>{let n="clear";Me(r,"set",n,"Timeout"),Me(r,"set",n,"Interval"),Me(r,"set",n,"Immediate")}),e.__load_patch("requestAnimationFrame",r=>{Me(r,"request","cancel","AnimationFrame"),Me(r,"mozRequest","mozCancel","AnimationFrame"),Me(r,"webkitRequest","webkitCancel","AnimationFrame")}),e.__load_patch("blocking",(r,t)=>{let n=["alert","prompt","confirm"];for(let o=0;o<n.length;o++){let c=n[o];qe(r,c,(f,l,_)=>function(q,y){return t.current.run(f,r,y,_)})}}),e.__load_patch("EventTarget",(r,t,n)=>{cv(r,n),av(r,n);let o=r.XMLHttpRequestEventTarget;o&&o.prototype&&n.patchEventTarget(r,n,[o.prototype])}),e.__load_patch("MutationObserver",(r,t,n)=>{Ve("MutationObserver"),Ve("WebKitMutationObserver")}),e.__load_patch("IntersectionObserver",(r,t,n)=>{Ve("IntersectionObserver")}),e.__load_patch("FileReader",(r,t,n)=>{Ve("FileReader")}),e.__load_patch("on_property",(r,t,n)=>{uv(n,r)}),e.__load_patch("customElements",(r,t,n)=>{sv(r,n)}),e.__load_patch("XHR",(r,t)=>{q(r);let n=Z("xhrTask"),o=Z("xhrSync"),c=Z("xhrListener"),f=Z("xhrScheduled"),l=Z("xhrURL"),_=Z("xhrErrorBeforeScheduled");function q(y){let w=y.XMLHttpRequest;if(!w)return;let M=w.prototype;function F(S){return S[n]}let $=M[wt],Q=M[St];if(!$){let S=y.XMLHttpRequestEventTarget;if(S){let k=S.prototype;$=k[wt],Q=k[St]}}let ee="readystatechange",Y="scheduled";function m(S){let k=S.data,C=k.target;C[f]=!1,C[_]=!1;let te=C[c];$||($=C[wt],Q=C[St]),te&&Q.call(C,ee,te);let z=C[c]=()=>{if(C.readyState===C.DONE)if(!k.aborted&&C[f]&&S.state===Y){let T=C[t.__symbol__("loadfalse")];if(C.status!==0&&T&&T.length>0){let i=S.invoke;S.invoke=function(){let s=C[t.__symbol__("loadfalse")];for(let b=0;b<s.length;b++)s[b]===S&&s.splice(b,1);!k.aborted&&S.state===Y&&i.call(S)},T.push(S)}else S.invoke()}else!k.aborted&&C[f]===!1&&(C[_]=!0)};return $.call(C,ee,z),C[n]||(C[n]=S),V.apply(C,k.args),C[f]=!0,S}function p(){}function A(S){let k=S.data;return k.aborted=!0,D.apply(k.target,k.args)}let G=qe(M,"open",()=>function(S,k){return S[o]=k[2]==!1,S[l]=k[1],G.apply(S,k)}),K="XMLHttpRequest.send",B=Z("fetchTaskAborting"),E=Z("fetchTaskScheduling"),V=qe(M,"send",()=>function(S,k){if(t.current[E]===!0||S[o])return V.apply(S,k);{let C={target:S,url:S[l],isPeriodic:!1,args:k,aborted:!1},te=Mt(K,p,C,m,A);S&&S[_]===!0&&!C.aborted&&te.state===Y&&te.invoke()}}),D=qe(M,"abort",()=>function(S,k){let C=F(S);if(C&&typeof C.type=="string"){if(C.cancelFn==null||C.data&&C.data.aborted)return;C.zone.cancelTask(C)}else if(t.current[B]===!0)return D.apply(S,k)})}}),e.__load_patch("geolocation",r=>{r.navigator&&r.navigator.geolocation&&Jh(r.navigator.geolocation,["getCurrentPosition","watchPosition"])}),e.__load_patch("PromiseRejectionEvent",(r,t)=>{function n(o){return function(c){oa(r,o).forEach(l=>{let _=r.PromiseRejectionEvent;if(_){let q=new _(o,{promise:c.promise,reason:c.rejection});l.invoke(q)}})}}r.PromiseRejectionEvent&&(t[Z("unhandledPromiseRejectionHandler")]=n("unhandledrejection"),t[Z("rejectionHandledHandler")]=n("rejectionhandled"))}),e.__load_patch("queueMicrotask",(r,t,n)=>{iv(r,n)})}function fv(e){e.__load_patch("ZoneAwarePromise",(r,t,n)=>{let o=Object.getOwnPropertyDescriptor,c=Object.defineProperty;function f(d){if(d&&d.toString===Object.prototype.toString){let h=d.constructor&&d.constructor.name;return(h||"")+": "+JSON.stringify(d)}return d?d.toString():Object.prototype.toString.call(d)}let l=n.symbol,_=[],q=r[l("DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION")]!==!1,y=l("Promise"),w=l("then"),M="__creationTrace__";n.onUnhandledError=d=>{if(n.showUncaughtError()){let h=d&&d.rejection;h?console.error("Unhandled Promise rejection:",h instanceof Error?h.message:h,"; Zone:",d.zone.name,"; Task:",d.task&&d.task.source,"; Value:",h,h instanceof Error?h.stack:void 0):console.error(d)}},n.microtaskDrainDone=()=>{for(;_.length;){let d=_.shift();try{d.zone.runGuarded(()=>{throw d.throwOriginal?d.rejection:d})}catch(h){$(h)}}};let F=l("unhandledPromiseRejectionHandler");function $(d){n.onUnhandledError(d);try{let h=t[F];typeof h=="function"&&h.call(this,d)}catch{}}function Q(d){return d&&typeof d.then=="function"}function ee(d){return d}function Y(d){return L.reject(d)}let m=l("state"),p=l("value"),A=l("finally"),G=l("parentPromiseValue"),K=l("parentPromiseState"),B="Promise.then",E=null,V=!0,D=!1,S=0;function k(d,h){return a=>{try{I(d,h,a)}catch(v){I(d,!1,v)}}}let C=function(){let d=!1;return function(a){return function(){d||(d=!0,a.apply(null,arguments))}}},te="Promise resolved with itself",z=l("currentTaskTrace");function I(d,h,a){let v=C();if(d===a)throw new TypeError(te);if(d[m]===E){let O=null;try{(typeof a=="object"||typeof a=="function")&&(O=a&&a.then)}catch(R){return v(()=>{I(d,!1,R)})(),d}if(h!==D&&a instanceof L&&a.hasOwnProperty(m)&&a.hasOwnProperty(p)&&a[m]!==E)i(a),I(d,a[m],a[p]);else if(h!==D&&typeof O=="function")try{O.call(a,v(k(d,h)),v(k(d,!1)))}catch(R){v(()=>{I(d,!1,R)})()}else{d[m]=h;let R=d[p];if(d[p]=a,d[A]===A&&h===V&&(d[m]=d[K],d[p]=d[G]),h===D&&a instanceof Error){let g=t.currentTask&&t.currentTask.data&&t.currentTask.data[M];g&&c(a,z,{configurable:!0,enumerable:!1,writable:!0,value:g})}for(let g=0;g<R.length;)s(d,R[g++],R[g++],R[g++],R[g++]);if(R.length==0&&h==D){d[m]=S;let g=a;try{throw new Error("Uncaught (in promise): "+f(a)+(a&&a.stack?`
2
+ `+a.stack:""))}catch(j){g=j}q&&(g.throwOriginal=!0),g.rejection=a,g.promise=d,g.zone=t.current,g.task=t.currentTask,_.push(g),n.scheduleMicroTask()}}}return d}let T=l("rejectionHandledHandler");function i(d){if(d[m]===S){try{let h=t[T];h&&typeof h=="function"&&h.call(this,{rejection:d[p],promise:d})}catch{}d[m]=D;for(let h=0;h<_.length;h++)d===_[h].promise&&_.splice(h,1)}}function s(d,h,a,v,O){i(d);let R=d[m],g=R?typeof v=="function"?v:ee:typeof O=="function"?O:Y;h.scheduleMicroTask(B,()=>{try{let j=d[p],N=!!a&&A===a[A];N&&(a[G]=j,a[K]=R);let x=h.run(g,void 0,N&&g!==Y&&g!==ee?[]:[j]);I(a,!0,x)}catch(j){I(a,!1,j)}},a)}let b="function ZoneAwarePromise() { [native code] }",P=function(){},W=r.AggregateError;class L{static toString(){return b}static resolve(h){return h instanceof L?h:I(new this(null),V,h)}static reject(h){return I(new this(null),D,h)}static withResolvers(){let h={};return h.promise=new L((a,v)=>{h.resolve=a,h.reject=v}),h}static any(h){if(!h||typeof h[Symbol.iterator]!="function")return Promise.reject(new W([],"All promises were rejected"));let a=[],v=0;try{for(let g of h)v++,a.push(L.resolve(g))}catch{return Promise.reject(new W([],"All promises were rejected"))}if(v===0)return Promise.reject(new W([],"All promises were rejected"));let O=!1,R=[];return new L((g,j)=>{for(let N=0;N<a.length;N++)a[N].then(x=>{O||(O=!0,g(x))},x=>{R.push(x),v--,v===0&&(O=!0,j(new W(R,"All promises were rejected")))})})}static race(h){let a,v,O=new this((j,N)=>{a=j,v=N});function R(j){a(j)}function g(j){v(j)}for(let j of h)Q(j)||(j=this.resolve(j)),j.then(R,g);return O}static all(h){return L.allWithCallback(h)}static allSettled(h){return(this&&this.prototype instanceof L?this:L).allWithCallback(h,{thenCallback:v=>({status:"fulfilled",value:v}),errorCallback:v=>({status:"rejected",reason:v})})}static allWithCallback(h,a){let v,O,R=new this((x,H)=>{v=x,O=H}),g=2,j=0,N=[];for(let x of h){Q(x)||(x=this.resolve(x));let H=j;try{x.then(U=>{N[H]=a?a.thenCallback(U):U,g--,g===0&&v(N)},U=>{a?(N[H]=a.errorCallback(U),g--,g===0&&v(N)):O(U)})}catch(U){O(U)}g++,j++}return g-=2,g===0&&v(N),R}constructor(h){let a=this;if(!(a instanceof L))throw new Error("Must be an instanceof Promise.");a[m]=E,a[p]=[];try{let v=C();h&&h(v(k(a,V)),v(k(a,D)))}catch(v){I(a,!1,v)}}get[Symbol.toStringTag](){return"Promise"}get[Symbol.species](){return L}then(h,a){let v=this.constructor?.[Symbol.species];(!v||typeof v!="function")&&(v=this.constructor||L);let O=new v(P),R=t.current;return this[m]==E?this[p].push(R,O,h,a):s(this,R,O,h,a),O}catch(h){return this.then(null,h)}finally(h){let a=this.constructor?.[Symbol.species];(!a||typeof a!="function")&&(a=L);let v=new a(P);v[A]=A;let O=t.current;return this[m]==E?this[p].push(O,v,h,h):s(this,O,v,h,h),v}}L.resolve=L.resolve,L.reject=L.reject,L.race=L.race,L.all=L.all;let Pe=r[y]=r.Promise;r.Promise=L;let ge=l("thenPatched");function be(d){let h=d.prototype,a=o(h,"then");if(a&&(a.writable===!1||!a.configurable))return;let v=h.then;h[w]=v,d.prototype.then=function(O,R){return new L((j,N)=>{v.call(this,j,N)}).then(O,R)},d[ge]=!0}n.patchThen=be;function fe(d){return function(h,a){let v=d.apply(h,a);if(v instanceof L)return v;let O=v.constructor;return O[ge]||be(O),v}}return Pe&&(be(Pe),qe(r,"fetch",d=>fe(d))),Promise[t.__symbol__("uncaughtPromiseErrors")]=_,L})}function hv(e){e.__load_patch("toString",r=>{let t=Function.prototype.toString,n=Z("OriginalDelegate"),o=Z("Promise"),c=Z("Error"),f=function(){if(typeof this=="function"){let y=this[n];if(y)return typeof y=="function"?t.call(y):Object.prototype.toString.call(y);if(this===Promise){let w=r[o];if(w)return t.call(w)}if(this===Error){let w=r[c];if(w)return t.call(w)}}return t.call(this)};f[n]=t,Function.prototype.toString=f;let l=Object.prototype.toString,_="[object Promise]";Object.prototype.toString=function(){return typeof Promise=="function"&&this instanceof Promise?_:l.call(this)}})}function vv(e,r,t,n,o){let c=Zone.__symbol__(n);if(r[c])return;let f=r[c]=r[n];r[n]=function(l,_,q){return _&&_.prototype&&o.forEach(function(y){let w=`${t}.${n}::`+y,M=_.prototype;try{if(M.hasOwnProperty(y)){let F=e.ObjectGetOwnPropertyDescriptor(M,y);F&&F.value?(F.value=e.wrapWithCurrentZone(F.value,w),e._redefineProperty(_.prototype,y,F)):M[y]&&(M[y]=e.wrapWithCurrentZone(M[y],w))}else M[y]&&(M[y]=e.wrapWithCurrentZone(M[y],w))}catch{}}),f.call(r,l,_,q)},e.attachOriginToPatched(r[n],f)}function dv(e){e.__load_patch("util",(r,t,n)=>{let o=Ct(r);n.patchOnProperties=Qs,n.patchMethod=qe,n.bindArguments=Lt,n.patchMacroTask=ev;let c=t.__symbol__("BLACK_LISTED_EVENTS"),f=t.__symbol__("UNPATCHED_EVENTS");r[f]&&(r[c]=r[f]),r[c]&&(t[c]=t[f]=r[c]),n.patchEventPrototype=ov,n.patchEventTarget=nv,n.isIEOrEdge=rv,n.ObjectDefineProperty=Dt,n.ObjectGetOwnPropertyDescriptor=ze,n.ObjectCreate=Yh,n.ArraySlice=Kh,n.patchClass=Ve,n.wrapWithCurrentZone=xt,n.filterProperties=ia,n.attachOriginToPatched=ke,n._redefineProperty=Object.defineProperty,n.patchCallbacks=vv,n.getGlobalObjects=()=>({globalSources:ea,zoneSymbolEventNames:le,eventNames:o,isBrowser:At,isMix:Js,isNode:Or,TRUE_STR:me,FALSE_STR:Oe,ZONE_SYMBOL_PREFIX:We,ADD_EVENT_LISTENER_STR:jt,REMOVE_EVENT_LISTENER_STR:Nt})})}function pv(e){fv(e),hv(e),dv(e)}var sa=Wh();pv(sa);lv(sa);window.process={env:{DEBUG:void 0}};
@@ -1 +0,0 @@
1
- import{d as D}from"./chunk-QLTN6G6E.js";import{a as f,d as I,e as S,m as b}from"./chunk-XDPHEQEO.js";import{$c as E,Ic as A,Nc as P,Oc as m,Sc as M,Wc as j,a as g,b as v,c as C,ca as u,cc as p,ec as h,f as R,ga as a,j as w,l as y,pa as N,ra as l,t as _}from"./chunk-OB3QLUH6.js";var T=[{id:null,name:"Dashboard 1",icon:"dashboard-dashboard",configuration:[{w:24,h:24,id:"d1d58e6f-f8b4-4a72-9597-7f92aa6776fc",selector:"widget-host2",input:{widgetProperties:{type:"widget-tutorial",uuid:"d1d58e6f-f8b4-4a72-9597-7f92aa6776fc"}},x:0,y:0}],collapseSplitShell:!1}];var x=(()=>{class i{_settings=a(b);_router=a(j);dashboards=l([],{equal:S});activeDashboard=l(0);_widgetAction=new y(null);widgetAction$=this._widgetAction.asObservable();isDashboardStatic=l(!0);layoutEditSaved=l(0);layoutEditCanceled=l(0);constructor(){let e=this._settings.getDashboardConfig();if(!e||e.length===0){console.warn("[Dashboard Service] No dashboards found in settings, creating blank dashboard");let t=T.map(r=>v(g({},r),{id:f.create()}));this.dashboards.set([...t])}else this.dashboards.set(this._settings.getDashboardConfig());h(()=>{let t=this.dashboards();this._settings.saveDashboards(t)})}toggleStaticDashboard(){this.isDashboardStatic.set(!this.isDashboardStatic())}add(e,t,r,s){let n=0;return this.dashboards.update(o=>{let c=[...o,{id:f.create(),name:e,icon:r??"dashboard-dashboard",configuration:t,collapseSplitShell:s??!1}];return n=c.length-1,c}),n}update(e,t,r,s){this.dashboards.update(n=>n.map((o,c)=>c===e?v(g({},o),{name:t,icon:r??"dashboard-dashboard",collapseSplitShell:s??!1}):o))}delete(e){this.dashboards.update(t=>t.filter((r,s)=>s!==e)),this.dashboards().length===0?(this.add("Dashboard "+(this.dashboards().length+1),[]),this.activeDashboard.set(0)):this.activeDashboard()>this.dashboards().length-1&&this.activeDashboard.set(this.dashboards().length-1)}duplicate(e,t,r,s){if(e<0||e>=this.dashboards().length)return console.error(`[Dashboard Service] Invalid itemIndex: ${e}`),-1;let n=this.dashboards()[e],o=I(n);o.id=f.create(),o.name=t,o.icon=r||"dashboard-dashboard",o.collapseSplitShell=s??!1,Array.isArray(o.configuration)?o.configuration.forEach(d=>{d&&d.input?.widgetProperties?(d.id=f.create(),d.input.widgetProperties.uuid=d.id):console.error("Dashboard Service] Widget configuration is missing required properties:",d)}):(console.error("Dashboard Service] Dashboard configuration is not an array:",o.configuration),o.configuration=[]);let c=-1;return this.dashboards.update(d=>{let k=[...d,o];return c=k.length-1,k}),c}updateConfiguration(e,t){this.dashboards.update(r=>r.map((s,n)=>n===e?S(s.configuration,t)?s:v(g({},s),{configuration:t}):s))}previousDashboard(){this.activeDashboard()+1>this.dashboards().length-1?this.activeDashboard.set(0):this.activeDashboard.set(this.activeDashboard()+1)}nextDashboard(){this.activeDashboard()-1<0?this.activeDashboard.set(this.dashboards().length-1):this.activeDashboard.set(this.activeDashboard()-1)}setActiveDashboard(e){e!==this.activeDashboard()&&(e>=0&&e<this.dashboards().length?this.activeDashboard.set(e):console.error(`[Dashboard Service] Invalid dashboard ID: ${e}`))}navigateToActive(){this._router.navigate(["/dashboard",this.activeDashboard()])}navigateTo(e){e>=0&&e<this.dashboards().length?this._router.navigate(["/dashboard",e]):console.error(`[Dashboard Service] Invalid dashboard ID: ${e}`)}navigateToNextDashboard(){let e=null;this.activeDashboard()-1<0?e=this.dashboards().length-1:e=this.activeDashboard()-1,this._router.navigate(["/dashboard",e])}navigateToPreviousDashboard(){let e=null;this.activeDashboard()+1>=this.dashboards().length?e=0:e=this.activeDashboard()+1,this._router.navigate(["/dashboard",e])}deleteWidget(e){this._widgetAction.next({id:e,operation:"delete"})}duplicateWidget(e){this._widgetAction.next({id:e,operation:"duplicate"})}setStaticDashboard(e){this.isDashboardStatic.set(e)}notifyLayoutEditSaved(){this.layoutEditSaved.update(e=>e+1)}notifyLayoutEditCanceled(){this.layoutEditCanceled.update(e=>e+1)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=u({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var $={name:"@mxtommy/kip",version:"4.0.5",description:"An advanced and versatile marine instrumentation package to display Signal K data.",license:"MIT",author:{name:"Thomas St.Pierre, David Godin"},contributors:[{name:"David Godin",email:"godind@hotmail.com"},{name:"Thomas St.Pierre",email:"thomas@samoht.ca"}],homepage:"https://github.com/mxtommy/Kip",bugs:"https://github.com/mxtommy/Kip/issues",repository:{type:"git",url:"git+https://github.com/mxtommy/Kip.git"},keywords:["signalk-webapp","signalk-category-instruments","signalk-category-notifications","signalk-node-server-plugin","signal k","signalk","instruments","dashboard","marine","nmea"],signalk:{appIcon:"assets/icon-72x72.png",displayName:"KIP Instrument MFD"},main:"plugin/index.js","signalk-plugin-enabled-by-default":!0,scripts:{test:"ng test",lint:"ng lint",dev:"ng serve --configuration=dev --serve-path=/@mxtommy/kip/","build:plugin":"tsc -p ./kip-plugin/tsconfig.plugin.json","build:dev":"ng build --configuration=dev","build:prod":"ng build --configuration=production","build:all":"npm run build:plugin && npm run build:prod",e2e:"ng e2e","generate:widget":"npx schematics ./tools/schematics/collection.json:create-host2-widget --dry-run=false"},schematics:"tools/schematics/collection.json",devDependencies:{"@angular-devkit/schematics-cli":"^20.1.6","@angular-devkit/build-angular":"^20.1.6","@angular/animations":"20.1.7","@angular/build":"^20.1.6","@angular/cdk":"20.1.6","@angular/cli":"^20.1.6","@angular/common":"20.1.7","@angular/compiler":"20.1.7","@angular/compiler-cli":"20.1.7","@angular/core":"20.1.7","@angular/forms":"20.1.7","@angular/language-service":"20.1.7","@angular/material":"20.1.6","@angular/platform-browser":"20.1.7","@angular/platform-browser-dynamic":"20.1.7","@angular/router":"20.1.7","@godind/ng-canvas-gauges":"^6.2.1","@robloche/chartjs-plugin-streaming":"^3.1.0","@types/canvas-gauges":"^2.1.8","@types/howler":"^2.2.10","@types/jasmine":"~3.6.0","@types/jasminewd2":"^2.0.9","@types/js-quantities":"^1.6.6","@types/lodash-es":"^4.17.9","@types/node":"^24.1.0","@zakj/no-sleep":"^0.13.5","angular-eslint":"20.1.1","chart.js":"^4.4.9","chartjs-adapter-date-fns":"^3.0.0","chartjs-plugin-annotation":"^3.0.1",codelyzer:"^6.0.0","compare-versions":"^6.1.1","core-js":"^3.13.1","date-fns":"^2.30.0",eslint:"^9.29.0",gridstack:"^12.3.3",howler:"^2.2.4","jasmine-core":"~4.0.1","jasmine-spec-reporter":"~5.0.0","js-quantities":"^1.8.0",karma:"^6.4.4","karma-chrome-launcher":"~3.1.0","karma-cli":"~2.0.0","karma-coverage-istanbul-reporter":"^3.0.3","karma-jasmine":"~4.0.0","karma-jasmine-html-reporter":"^1.6.0","lodash-es":"^4.17.21","ng-packagr":"^20.0.1","ngx-markdown":"^20.0.0",prismjs:"^1.30.0",clipboard:"^2.0.11","ngx-resize-observer":"^3.1.0",protractor:"~7.0.0","pwa-asset-generator":"^8.1.1",rxjs:"^7.8.2",sass:"^1.49.9",screenfull:"^6.0.2",steelseries:"^2.0.9","ts-node":"^10.9.2",tslib:"^2.6.2",typescript:"^5.8.3","zone.js":"^0.15.1"},dependencies:{"@signalk/server-api":"^2.7.2"}};var L=(()=>{class i{_http=a(A);_settings=a(b);_dashboard=a(x);_data=a(D);_destroyRef=a(N);_displayName=m(this._settings.getInstanceNameAsO());_isRemoteControl=m(this._settings.getIsRemoteControlAsO());PLUGIN_URL=this._settings.signalkUrl.url+"/plugins/kip";KIP_UUID=this._settings.KipUUID;ACTIVE_SCREEN_PATH=`self.displays.${this.KIP_UUID}.activeScreen`;previousIsRemoteControl=!1;isRemoteScreenIdxCleared=!0;constructor(){let e=this.setActiveDashboard(this.KIP_UUID,null).then(()=>{console.log("[Remote Dashboards] Startup: cleared stale activeScreen (unconditional)")}).catch(t=>{console.warn("[Remote Dashboards] Startup: failed to clear stale activeScreen",t)});h(()=>{let t=this._isRemoteControl();if(!t&&!this.previousIsRemoteControl)return;let r=this._displayName(),s=this._dashboard.dashboards();p(()=>{this.previousIsRemoteControl=t;let n;if(!t)n=null;else{let o=s.map(k=>{var V=k,{configuration:c}=V,d=C(V,["configuration"]);return d});n={displayName:r,screens:o},this.isRemoteScreenIdxCleared=!1}this.shareScreens(this.KIP_UUID,n).then(()=>{console.log("[Remote Dashboards] Screen configuration shared")}).catch(o=>{console.error("[Remote Dashboards] Error sharing screen configuration:",o)})})}),h(()=>{let t=this._isRemoteControl(),r=this._dashboard.activeDashboard();p(()=>{t?this.setActiveDashboard(this.KIP_UUID,r).then(()=>{}).catch(s=>{console.error("[Remote Dashboards] Error sharing active dashboard:",s)}):this.isRemoteScreenIdxCleared||(this.setActiveDashboard(this.KIP_UUID,null).then(()=>{console.log("[Remote Dashboards] Disabled: Cleared active dashboard on server")}).catch(s=>{console.error("[Remote Dashboards] Error clearing active dashboard on server:",s)}),this.isRemoteScreenIdxCleared=!0)})}),e.finally(()=>this.setupRemoteControlListener())}setupRemoteControlListener(){this._settings.getIsRemoteControlAsO().pipe(P(this._destroyRef)).subscribe(e=>{e?this._data.subscribePath(this.ACTIVE_SCREEN_PATH,"default").pipe(P(this._destroyRef)).subscribe(t=>{if(t.data.value==null)return;let r=Number(t.data.value);!isNaN(r)&&r>=0&&r<this._dashboard.dashboards().length&&this._dashboard.activeDashboard()!==r&&(console.log(`[Remote Dashboards] Setting active dashboard to ${r} from remote update`),this._dashboard.navigateTo(r))}):this._data.unsubscribePath(this.ACTIVE_SCREEN_PATH)})}setActiveDashboard(e,t){return R(this,null,function*(){let r=t===null?null:{screenIdx:t};return _(this._http.put(`${this.PLUGIN_URL}/displays/${e}/activeScreen`,r))})}shareScreens(e,t){let r=t===null?null:g({},t);return _(this._http.put(`${this.PLUGIN_URL}/displays/${e}`,r))}static \u0275fac=function(t){return new(t||i)};static \u0275prov=u({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var De=(()=>{class i{MODE_PATH="self.environment.mode";configurableThemeColors=[{label:"Contrast",value:"contrast"},{label:"Blue",value:"blue"},{label:"Green",value:"green"},{label:"Orange",value:"orange"},{label:"Yellow",value:"yellow"},{label:"Pink",value:"pink"},{label:"Purple",value:"purple"},{label:"Grey",value:"grey"}];snackbarAppNotifications=new w;cssThemeColorRoles$=new y(null);_cssThemeColorRoles=null;_settings=a(b);_data=a(D);_iconRegistry=a(E);_sanitizer=a(M);_remote=a(L);isNightMode=l(!1);_useAutoNightMode=m(this._settings.getAutoNightModeAsO(),{requireSync:!0});_theme=m(this._settings.getThemeNameAsO(),{requireSync:!0});_redNightMode=m(this._settings.getRedNightModeAsO(),{requireSync:!0});_environmentMode=m(this._data.subscribePath(this.MODE_PATH,"default"));previousEnvironmentMode=null;appVersion=l($.version);browserVersion=l("Unknown");osVersion=l("Unknown");constructor(){this._iconRegistry.addSvgIconSet(this._sanitizer.bypassSecurityTrustResourceUrl("assets/svg/icons.svg")),h(()=>{this._theme()==="light-theme"?document.body.classList.toggle("light-theme",this._theme()==="light-theme"):document.body.classList.remove("light-theme")}),h(()=>{let e=this._environmentMode().data.value;p(()=>{this.previousEnvironmentMode!==e&&(this.previousEnvironmentMode=e,this._useAutoNightMode()&&(this.isNightMode.set(e==="night"),this.toggleDayNightMode()))})}),h(()=>{let e=this._redNightMode();p(()=>{e?this.toggleDayNightMode():this.toggleDayNightMode()})}),this.readThemeCssRoleVariables(),this._cssThemeColorRoles=this.cssThemeColorRoles$.getValue(),this.browserVersion.set(this.getBrowserVersion()),this.osVersion.set(this.getOSVersion()),console.log("*********** KIP Version Information ***********"),console.log(`** App Version: ${this.appVersion()}`),console.log(`** Browser Version: ${this.browserVersion()}`),console.log(`** OS Version: ${this.osVersion()}`),console.log("***********************************************")}sendSnackbarNotification(e,t=1e4,r=!1,s="Dismiss"){this.snackbarAppNotifications.next({message:e,duration:t,silent:r,action:s})}getSnackbarAppNotifications(){return this.snackbarAppNotifications.asObservable()}readThemeCssRoleVariables(){let e=document.body,t=getComputedStyle(e),r={background:t.getPropertyValue("--mat-sys-background").trim(),cardColor:t.getPropertyValue("--kip-widget-card-background-color").trim(),blue:t.getPropertyValue("--kip-blue-color").trim(),blueDim:t.getPropertyValue("--kip-blue-dim-color").trim(),blueDimmer:t.getPropertyValue("--kip-blue-dimmer-color").trim(),green:t.getPropertyValue("--kip-green-color").trim(),greenDim:t.getPropertyValue("--kip-green-dim-color").trim(),greenDimmer:t.getPropertyValue("--kip-green-dimmer-color").trim(),grey:t.getPropertyValue("--kip-grey-color").trim(),greyDim:t.getPropertyValue("--kip-grey-dim-color").trim(),greyDimmer:t.getPropertyValue("--kip-grey-dimmer-color").trim(),orange:t.getPropertyValue("--kip-orange-color").trim(),orangeDim:t.getPropertyValue("--kip-orange-dim-color").trim(),orangeDimmer:t.getPropertyValue("--kip-orange-dimmer-color").trim(),pink:t.getPropertyValue("--kip-pink-color").trim(),pinkDim:t.getPropertyValue("--kip-pink-dim-color").trim(),pinkDimmer:t.getPropertyValue("--kip-pink-dimmer-color").trim(),purple:t.getPropertyValue("--kip-purple-color").trim(),purpleDim:t.getPropertyValue("--kip-purple-dim-color").trim(),purpleDimmer:t.getPropertyValue("--kip-purple-dimmer-color").trim(),contrast:t.getPropertyValue("--kip-contrast-color").trim(),contrastDim:t.getPropertyValue("--kip-contrast-dim-color").trim(),contrastDimmer:t.getPropertyValue("--kip-contrast-dimmer-color").trim(),yellow:t.getPropertyValue("--kip-yellow-color").trim(),yellowDim:t.getPropertyValue("--kip-yellow-dim-color").trim(),yellowDimmer:t.getPropertyValue("--kip-yellow-dimmer-color").trim(),port:t.getPropertyValue("--kip-port-color").trim(),starboard:t.getPropertyValue("--kip-starboard-color").trim(),zoneNominal:t.getPropertyValue("--kip-zone-nominal-color").trim(),zoneAlert:t.getPropertyValue("--kip-zone-alert-color").trim(),zoneWarn:t.getPropertyValue("--kip-zone-warn-color").trim(),zoneAlarm:t.getPropertyValue("--kip-zone-alarm-color").trim(),zoneEmergency:t.getPropertyValue("--kip-zone-emergency-color").trim()};this.cssThemeColorRoles$.next(r)}get cssThemeColors(){return this._cssThemeColorRoles}setBrightness(e,t=!1){let r=document.body;r.style.setProperty("--kip-nightModeBrightness",`${e}`);let s=t?" sepia(0.5) hue-rotate(-30deg)":"";r.style.setProperty("--kip-nightModeFilters",s)}toggleDayNightMode(){this.isNightMode()?this._redNightMode()?(document.body.classList.toggle("night-theme",!0),this.setBrightness(1,!1)):(this.setBrightness(this._settings.getNightModeBrightness(),!0),document.body.classList.remove("night-theme"),this._theme()==="light-theme"?document.body.classList.toggle("light-theme",this._theme()==="light-theme"):document.body.classList.remove("light-theme")):(document.body.classList.remove("night-theme"),this._theme()==="light-theme"&&document.body.classList.toggle("light-theme",this._theme()==="light-theme"),this.setBrightness(1,!1)),this.readThemeCssRoleVariables(),this._cssThemeColorRoles=this.cssThemeColorRoles$.getValue()}getBrowserVersion(){let e=navigator.userAgent,t="Unknown";return e.includes("Edg")?t=`Edge ${e.match(/Edg\/(\d+)/)?.[1]}`:e.includes("Chrome")&&!e.includes("Edg")&&!e.includes("Chromium")?t=`Chrome ${e.match(/Chrome\/(\d+)/)?.[1]}`:e.includes("Chromium")?t=`Chromium ${e.match(/Chromium\/(\d+)/)?.[1]}`:e.includes("Firefox")?t=`Firefox ${e.match(/Firefox\/(\d+)/)?.[1]}`:e.includes("Safari")&&!e.includes("Chrome")&&!e.includes("Chromium")?t=`Safari ${e.match(/Version\/(\d+)/)?.[1]}`:(e.includes("Opera")||e.includes("OPR"))&&(t=`Opera ${e.match(/(Opera|OPR)\/(\d+)/)?.[2]}`),t}getOSVersion(){let e=navigator.platform,t=navigator.userAgent;return e.startsWith("Mac")?"macOS":e.startsWith("Win")?"Windows":/Linux/.test(e)?t.includes("ARM")||t.includes("aarch64")||t.includes("Raspberry")||e.includes("armv7l")||e.includes("armv8l")?"Raspberry Pi":"Linux":"Unknown OS"}static \u0275fac=function(t){return new(t||i)};static \u0275prov=u({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();export{x as a,De as b};
@@ -1,3 +0,0 @@
1
- import{a as dt,b as be,c as gt,d as ft,f as pt,k as ve,m as mt,n as we,o as Ce,p as xe,q as Ee,r as De}from"./chunk-OFUYGORI.js";import{a as _e,b as ye,d as Re,e as ke,g as ze,h as Se}from"./chunk-RYHOAWDD.js";import{a as lt,b as ut}from"./chunk-IM2WDWW4.js";import{a as Ht,d as rt}from"./chunk-XDPHEQEO.js";import{Ab as G,Bb as U,Da as Ut,Db as te,Ea as Rt,Eb as ee,Fa as H,Gb as at,Gd as ht,Hd as ct,Ja as kt,Kb as b,La as Q,Lb as ie,Mb as se,Nc as Ot,Oa as M,Oc as ce,Sa as Vt,Sb as re,Ta as jt,Tb as oe,Ua as qt,Ub as ne,Uc as ue,Va as Yt,Wa as S,Wc as ge,Xd as fe,Yd as pe,_d as me,a as m,b as w,bb as K,bc as St,ca as Wt,cb as J,cc as it,dc as ae,ec as st,fb as $t,ga as v,gb as Xt,hb as N,ib as _,ja as R,jb as y,jc as Tt,ka as k,kb as Qt,kc as de,lb as Z,mb as tt,nb as Kt,pa as Ft,qb as Jt,ra as Gt,rb as A,tb as T,tc as le,vb as L,wa as X,wb as zt,xb as nt,yb as Zt,zb as et,zc as he}from"./chunk-OB3QLUH6.js";function Te(a,r,t,e,i){let s=(...o)=>(console.warn("gridstack.js: Function `"+t+"` is deprecated in "+i+" and has been replaced with `"+e+"`. It will be **removed** in a future release"),r.apply(a,o));return s.prototype=r.prototype,s}var h=class a{static getElements(r,t=document){if(typeof r=="string"){let e="getElementById"in t?t:void 0;if(e&&!isNaN(+r[0])){let s=e.getElementById(r);return s?[s]:[]}let i=t.querySelectorAll(r);return!i.length&&r[0]!=="."&&r[0]!=="#"&&(i=t.querySelectorAll("."+r),i.length||(i=t.querySelectorAll("#"+r))),Array.from(i)}return[r]}static getElement(r,t=document){if(typeof r=="string"){let e="getElementById"in t?t:void 0;if(!r.length)return null;if(e&&r[0]==="#")return e.getElementById(r.substring(1));if(r[0]==="#"||r[0]==="."||r[0]==="[")return t.querySelector(r);if(e&&!isNaN(+r[0]))return e.getElementById(r);let i=t.querySelector(r);return e&&!i&&(i=e.getElementById(r)),i||(i=t.querySelector("."+r)),i}return r}static lazyLoad(r){return r.lazyLoad||r.grid?.opts?.lazyLoad&&r.lazyLoad!==!1}static createDiv(r,t){let e=document.createElement("div");return r.forEach(i=>{i&&e.classList.add(i)}),t?.appendChild(e),e}static shouldSizeToContent(r,t=!1){return r?.grid&&(t?r.sizeToContent===!0||r.grid.opts.sizeToContent===!0&&r.sizeToContent===void 0:!!r.sizeToContent||r.grid.opts.sizeToContent&&r.sizeToContent!==!1)}static isIntercepted(r,t){return!(r.y>=t.y+t.h||r.y+r.h<=t.y||r.x+r.w<=t.x||r.x>=t.x+t.w)}static isTouching(r,t){return a.isIntercepted(r,{x:t.x-.5,y:t.y-.5,w:t.w+1,h:t.h+1})}static areaIntercept(r,t){let e=r.x>t.x?r.x:t.x,i=r.x+r.w<t.x+t.w?r.x+r.w:t.x+t.w;if(i<=e)return 0;let s=r.y>t.y?r.y:t.y,o=r.y+r.h<t.y+t.h?r.y+r.h:t.y+t.h;return o<=s?0:(i-e)*(o-s)}static area(r){return r.w*r.h}static sort(r,t=1){return r.sort((i,s)=>{let o=t*((i.y??1e4)-(s.y??1e4));return o===0?t*((i.x??1e4)-(s.x??1e4)):o})}static find(r,t){return t?r.find(e=>e.id===t):void 0}static toBool(r){return typeof r=="boolean"?r:typeof r=="string"?(r=r.toLowerCase(),!(r===""||r==="no"||r==="false"||r==="0")):!!r}static toNumber(r){return r===null||r.length===0?void 0:Number(r)}static parseHeight(r){let t,e="px";if(typeof r=="string")if(r==="auto"||r==="")t=0;else{let i=r.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!i)throw new Error(`Invalid height val = ${r}`);e=i[2]||"px",t=parseFloat(i[1])}else t=r;return{h:t,unit:e}}static defaults(r,...t){return t.forEach(e=>{for(let i in e){if(!e.hasOwnProperty(i))return;r[i]===null||r[i]===void 0?r[i]=e[i]:typeof e[i]=="object"&&typeof r[i]=="object"&&a.defaults(r[i],e[i])}}),r}static same(r,t){if(typeof r!="object")return r==t;if(typeof r!=typeof t||Object.keys(r).length!==Object.keys(t).length)return!1;for(let e in r)if(r[e]!==t[e])return!1;return!0}static copyPos(r,t,e=!1){return t.x!==void 0&&(r.x=t.x),t.y!==void 0&&(r.y=t.y),t.w!==void 0&&(r.w=t.w),t.h!==void 0&&(r.h=t.h),e&&(t.minW&&(r.minW=t.minW),t.minH&&(r.minH=t.minH),t.maxW&&(r.maxW=t.maxW),t.maxH&&(r.maxH=t.maxH)),r}static samePos(r,t){return r&&t&&r.x===t.x&&r.y===t.y&&(r.w||1)===(t.w||1)&&(r.h||1)===(t.h||1)}static sanitizeMinMax(r){r.minW||delete r.minW,r.minH||delete r.minH,r.maxW||delete r.maxW,r.maxH||delete r.maxH}static removeInternalAndSame(r,t){if(!(typeof r!="object"||typeof t!="object"))for(let e in r){let i=r[e],s=t[e];e[0]==="_"||i===s?delete r[e]:i&&typeof i=="object"&&s!==void 0&&(a.removeInternalAndSame(i,s),Object.keys(i).length||delete r[e])}}static removeInternalForSave(r,t=!0){for(let e in r)(e[0]==="_"||r[e]===null||r[e]===void 0)&&delete r[e];delete r.grid,t&&delete r.el,r.autoPosition||delete r.autoPosition,r.noResize||delete r.noResize,r.noMove||delete r.noMove,r.locked||delete r.locked,(r.w===1||r.w===r.minW)&&delete r.w,(r.h===1||r.h===r.minH)&&delete r.h}static throttle(r,t){let e=!1;return(...i)=>{e||(e=!0,setTimeout(()=>{r(...i),e=!1},t))}}static removePositioningStyles(r){let t=r.style;t.position&&t.removeProperty("position"),t.left&&t.removeProperty("left"),t.top&&t.removeProperty("top"),t.width&&t.removeProperty("width"),t.height&&t.removeProperty("height")}static getScrollElement(r){if(!r)return document.scrollingElement||document.documentElement;let t=getComputedStyle(r);return/(auto|scroll)/.test(t.overflow+t.overflowY)?r:a.getScrollElement(r.parentElement)}static updateScrollPosition(r,t,e){let i=a.getScrollElement(r);if(!i)return;let s=r.getBoundingClientRect(),o=i.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight,d=s.bottom-Math.min(o.bottom,n),u=s.top-Math.max(o.top,0),c=i.scrollTop;u<0&&e<0?r.offsetHeight>o.height?i.scrollTop+=e:i.scrollTop+=Math.abs(u)>Math.abs(e)?e:u:d>0&&e>0&&(r.offsetHeight>o.height?i.scrollTop+=e:i.scrollTop+=d>e?e:d),t.top+=i.scrollTop-c}static updateScrollResize(r,t,e){let i=a.getScrollElement(t),s=i.clientHeight,o=i===a.getScrollElement()?0:i.getBoundingClientRect().top,n=r.clientY-o,d=n<e,u=n>s-e;d?i.scrollBy({behavior:"smooth",top:n-e}):u&&i.scrollBy({behavior:"smooth",top:e-(s-n)})}static clone(r){return r==null||typeof r!="object"?r:r instanceof Array?[...r]:m({},r)}static cloneDeep(r){let t=["parentGrid","el","grid","subGrid","engine"],e=a.clone(r);for(let i in e)e.hasOwnProperty(i)&&typeof e[i]=="object"&&i.substring(0,2)!=="__"&&!t.find(s=>s===i)&&(e[i]=a.cloneDeep(r[i]));return e}static cloneNode(r){let t=r.cloneNode(!0);return t.removeAttribute("id"),t}static appendTo(r,t){let e;typeof t=="string"?e=a.getElement(t):e=t,e&&e.appendChild(r)}static addElStyles(r,t){if(t instanceof Object)for(let e in t)t.hasOwnProperty(e)&&(Array.isArray(t[e])?t[e].forEach(i=>{r.style[e]=i}):r.style[e]=t[e])}static initEvent(r,t){let e={type:t.type},i={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:t.target?t.target:r.target};return["altKey","ctrlKey","metaKey","shiftKey"].forEach(s=>e[s]=r[s]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(s=>e[s]=r[s]),m(m({},e),i)}static simulateMouseEvent(r,t,e){let i=r,s=new MouseEvent(t,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:r.screenX,screenY:r.screenY,clientX:r.clientX,clientY:r.clientY,ctrlKey:i.ctrlKey??!1,altKey:i.altKey??!1,shiftKey:i.shiftKey??!1,metaKey:i.metaKey??!1,button:0,relatedTarget:r.target});(e||r.target).dispatchEvent(s)}static getValuesFromTransformedElement(r){let t=document.createElement("div");a.addElStyles(t,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),r.appendChild(t);let e=t.getBoundingClientRect();return r.removeChild(t),t.remove(),{xScale:1/e.width,yScale:1/e.height,xOffset:e.left,yOffset:e.top}}static swap(r,t,e){if(!r)return;let i=r[t];r[t]=r[e],r[e]=i}static canBeRotated(r){return!(!r||r.w===r.h||r.locked||r.noResize||r.grid?.opts.disableResize||r.minW&&r.minW===r.maxW||r.minH&&r.minH===r.maxH)}};var Mt=(()=>{class a{constructor(t={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=t.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),this.maxRow=t.maxRow,this._float=t.float,this.nodes=t.nodes||[],this.onChange=t.onChange}batchUpdate(t=!0,e=!0){return!!this.batchMode===t?this:(this.batchMode=t,t?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,e&&this._packNodes(),this._notify()),this)}_useEntireRowArea(t,e){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!t._moving||t._skipDown||e.y<=t.y)}_fixCollisions(t,e=t,i,s={}){if(this.sortNodes(-1),i=i||this.collide(t,e),!i)return!1;if(t._moving&&!s.nested&&!this.float&&this.swap(t,i))return!0;let o=e;!this._loading&&this._useEntireRowArea(t,e)&&(o={x:0,w:this.column,y:e.y,h:e.h},i=this.collide(t,o,s.skip));let n=!1,d={nested:!0,pack:!1},u=0;for(;i=i||this.collide(t,o,s.skip);){if(u++>this.nodes.length*2)throw new Error("Infinite collide check");let c;if(i.locked||this._loading||t._moving&&!t._skipDown&&e.y>t.y&&!this.float&&(!this.collide(i,w(m({},i),{y:t.y}),t)||!this.collide(i,w(m({},i),{y:e.y-i.h}),t))){t._skipDown=t._skipDown||e.y>t.y;let l=m(w(m({},e),{y:i.y+i.h}),d);c=this._loading&&h.samePos(t,l)?!0:this.moveNode(t,l),(i.locked||this._loading)&&c?h.copyPos(e,t):!i.locked&&c&&s.pack&&(this._packNodes(),e.y=i.y+i.h,h.copyPos(t,e)),n=n||c}else c=this.moveNode(i,m(w(m({},i),{y:e.y+e.h,skip:t}),d));if(!c)return n;i=void 0}return n}collide(t,e=t,i){let s=t._id,o=i?._id;return this.nodes.find(n=>n._id!==s&&n._id!==o&&h.isIntercepted(n,e))}collideAll(t,e=t,i){let s=t._id,o=i?._id;return this.nodes.filter(n=>n._id!==s&&n._id!==o&&h.isIntercepted(n,e))}directionCollideCoverage(t,e,i){if(!e.rect||!t._rect)return;let s=t._rect,o=m({},e.rect);o.y>s.y?(o.h+=o.y-s.y,o.y=s.y):o.h+=s.y-o.y,o.x>s.x?(o.w+=o.x-s.x,o.x=s.x):o.w+=s.x-o.x;let n,d=.5;for(let u of i){if(u.locked||!u._rect)break;let c=u._rect,l=Number.MAX_VALUE,g=Number.MAX_VALUE;s.y<c.y?l=(o.y+o.h-c.y)/c.h:s.y+s.h>c.y+c.h&&(l=(c.y+c.h-o.y)/c.h),s.x<c.x?g=(o.x+o.w-c.x)/c.w:s.x+s.w>c.x+c.w&&(g=(c.x+c.w-o.x)/c.w);let p=Math.min(g,l);p>d&&(d=p,n=u)}return e.collide=n,n}cacheRects(t,e,i,s,o,n){return this.nodes.forEach(d=>d._rect={y:d.y*e+i,x:d.x*t+n,w:d.w*t-n-s,h:d.h*e-i-o}),this}swap(t,e){if(!e||e.locked||!t||t.locked)return!1;function i(){let o=e.x,n=e.y;return e.x=t.x,e.y=t.y,t.h!=e.h?(t.x=o,t.y=e.y+e.h):t.w!=e.w?(t.x=e.x+e.w,t.y=n):(t.x=o,t.y=n),t._dirty=e._dirty=!0,!0}let s;if(t.w===e.w&&t.h===e.h&&(t.x===e.x||t.y===e.y)&&(s=h.isTouching(t,e)))return i();if(s!==!1){if(t.w===e.w&&t.x===e.x&&(s||(s=h.isTouching(t,e)))){if(e.y<t.y){let o=t;t=e,e=o}return i()}if(s!==!1){if(t.h===e.h&&t.y===e.y&&(s||(s=h.isTouching(t,e)))){if(e.x<t.x){let o=t;t=e,e=o}return i()}return!1}}}isAreaEmpty(t,e,i,s){let o={x:t||0,y:e||0,w:i||1,h:s||1};return!this.collide(o)}compact(t="compact",e=!0){if(this.nodes.length===0)return this;e&&this.sortNodes();let i=this.batchMode;i||this.batchUpdate();let s=this._inColumnResize;s||(this._inColumnResize=!0);let o=this.nodes;return this.nodes=[],o.forEach((n,d,u)=>{let c;n.locked||(n.autoPosition=!0,t==="list"&&d&&(c=u[d-1])),this.addNode(n,!1,c)}),s||delete this._inColumnResize,i||this.batchUpdate(!1),this}set float(t){this._float!==t&&(this._float=t||!1,t||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(t=1){return this.nodes=h.sort(this.nodes,t),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(t=>{if(t._updating||t._orig===void 0||t.y===t._orig.y)return;let e=t.y;for(;e>t._orig.y;)--e,this.collide(t,{x:t.x,y:e,w:t.w,h:t.h})||(t._dirty=!0,t.y=e)}):this.nodes.forEach((t,e)=>{if(!t.locked)for(;t.y>0;){let i=e===0?0:t.y-1;if(!(e===0||!this.collide(t,{x:t.x,y:i,w:t.w,h:t.h})))break;t._dirty=t.y!==i,t.y=i}}),this)}prepareNode(t,e){t._id=t._id??a._idSeq++;let i=t.id;if(i){let o=1;for(;this.nodes.find(n=>n.id===t.id&&n!==t);)t.id=i+"_"+o++}(t.x===void 0||t.y===void 0||t.x===null||t.y===null)&&(t.autoPosition=!0);let s={x:0,y:0,w:1,h:1};return h.defaults(t,s),t.autoPosition||delete t.autoPosition,t.noResize||delete t.noResize,t.noMove||delete t.noMove,h.sanitizeMinMax(t),typeof t.x=="string"&&(t.x=Number(t.x)),typeof t.y=="string"&&(t.y=Number(t.y)),typeof t.w=="string"&&(t.w=Number(t.w)),typeof t.h=="string"&&(t.h=Number(t.h)),isNaN(t.x)&&(t.x=s.x,t.autoPosition=!0),isNaN(t.y)&&(t.y=s.y,t.autoPosition=!0),isNaN(t.w)&&(t.w=s.w),isNaN(t.h)&&(t.h=s.h),this.nodeBoundFix(t,e),t}nodeBoundFix(t,e){let i=t._orig||h.copyPos({},t);if(t.maxW&&(t.w=Math.min(t.w||1,t.maxW)),t.maxH&&(t.h=Math.min(t.h||1,t.maxH)),t.minW&&(t.w=Math.max(t.w||1,t.minW)),t.minH&&(t.h=Math.max(t.h||1,t.minH)),(t.x||0)+(t.w||1)>this.column&&this.column<this.defaultColumn&&!this._inColumnResize&&!this.skipCacheUpdate&&t._id!=null&&this.findCacheLayout(t,this.defaultColumn)===-1){let o=m({},t);o.autoPosition||o.x===void 0?(delete o.x,delete o.y):o.x=Math.min(this.defaultColumn-1,o.x),o.w=Math.min(this.defaultColumn,o.w||1),this.cacheOneLayout(o,this.defaultColumn)}return t.w>this.column?t.w=this.column:t.w<1&&(t.w=1),this.maxRow&&t.h>this.maxRow?t.h=this.maxRow:t.h<1&&(t.h=1),t.x<0&&(t.x=0),t.y<0&&(t.y=0),t.x+t.w>this.column&&(e?t.w=this.column-t.x:t.x=this.column-t.w),this.maxRow&&t.y+t.h>this.maxRow&&(e?t.h=this.maxRow-t.y:t.y=this.maxRow-t.h),h.samePos(t,i)||(t._dirty=!0),this}getDirtyNodes(t){return t?this.nodes.filter(e=>e._dirty&&!h.samePos(e,e._orig)):this.nodes.filter(e=>e._dirty)}_notify(t){if(this.batchMode||!this.onChange)return this;let e=(t||[]).concat(this.getDirtyNodes());return this.onChange(e),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(t=>{delete t._dirty,delete t._lastTried}),this)}saveInitial(){return this.nodes.forEach(t=>{t._orig=h.copyPos({},t),delete t._dirty}),this._hasLocked=this.nodes.some(t=>t.locked),this}restoreInitial(){return this.nodes.forEach(t=>{!t._orig||h.samePos(t,t._orig)||(h.copyPos(t,t._orig),t._dirty=!0)}),this._notify(),this}findEmptyPosition(t,e=this.nodes,i=this.column,s){let o=s?s.y*i+(s.x+s.w):0,n=!1;for(let d=o;!n;++d){let u=d%i,c=Math.floor(d/i);if(u+t.w>i)continue;let l={x:u,y:c,w:t.w,h:t.h};e.find(g=>h.isIntercepted(l,g))||((t.x!==u||t.y!==c)&&(t._dirty=!0),t.x=u,t.y=c,delete t.autoPosition,n=!0)}return n}addNode(t,e=!1,i){let s=this.nodes.find(n=>n._id===t._id);if(s)return s;this._inColumnResize?this.nodeBoundFix(t):this.prepareNode(t),delete t._temporaryRemoved,delete t._removeDOM;let o;return t.autoPosition&&this.findEmptyPosition(t,this.nodes,this.column,i)&&(delete t.autoPosition,o=!0),this.nodes.push(t),e&&this.addedNodes.push(t),o||this._fixCollisions(t),this.batchMode||this._packNodes()._notify(),t}removeNode(t,e=!0,i=!1){return this.nodes.find(s=>s._id===t._id)?(i&&this.removedNodes.push(t),e&&(t._removeDOM=!0),this.nodes=this.nodes.filter(s=>s._id!==t._id),t._isAboutToRemove||this._packNodes(),this._notify([t]),this):this}removeAll(t=!0,e=!0){if(delete this._layouts,!this.nodes.length)return this;t&&this.nodes.forEach(s=>s._removeDOM=!0);let i=this.nodes;return this.removedNodes=e?i:[],this.nodes=[],this._notify(i)}moveNodeCheck(t,e){if(!this.changedPosConstrain(t,e))return!1;if(e.pack=!0,!this.maxRow)return this.moveNode(t,e);let i,s=new a({column:this.column,float:this.float,nodes:this.nodes.map(n=>n._id===t._id?(i=m({},n),i):m({},n))});if(!i)return!1;let o=s.moveNode(i,e)&&s.getRow()<=Math.max(this.getRow(),this.maxRow);if(!o&&!e.resizing&&e.collide){let n=e.collide.el.gridstackNode;if(this.swap(t,n))return this._notify(),!0}return o?(s.nodes.filter(n=>n._dirty).forEach(n=>{let d=this.nodes.find(u=>u._id===n._id);d&&(h.copyPos(d,n),d._dirty=!0)}),this._notify(),!0):!1}willItFit(t){if(delete t._willFitPos,!this.maxRow)return!0;let e=new a({column:this.column,float:this.float,nodes:this.nodes.map(s=>m({},s))}),i=m({},t);return this.cleanupNode(i),delete i.el,delete i._id,delete i.content,delete i.grid,e.addNode(i),e.getRow()<=this.maxRow?(t._willFitPos=h.copyPos({},i),!0):!1}changedPosConstrain(t,e){return e.w=e.w||t.w,e.h=e.h||t.h,t.x!==e.x||t.y!==e.y?!0:(t.maxW&&(e.w=Math.min(e.w,t.maxW)),t.maxH&&(e.h=Math.min(e.h,t.maxH)),t.minW&&(e.w=Math.max(e.w,t.minW)),t.minH&&(e.h=Math.max(e.h,t.minH)),t.w!==e.w||t.h!==e.h)}moveNode(t,e){if(!t||!e)return!1;let i;e.pack===void 0&&!this.batchMode&&(i=e.pack=!0),typeof e.x!="number"&&(e.x=t.x),typeof e.y!="number"&&(e.y=t.y),typeof e.w!="number"&&(e.w=t.w),typeof e.h!="number"&&(e.h=t.h);let s=t.w!==e.w||t.h!==e.h,o=h.copyPos({},t,!0);if(h.copyPos(o,e),this.nodeBoundFix(o,s),h.copyPos(e,o),!e.forceCollide&&h.samePos(t,e))return!1;let n=h.copyPos({},t),d=this.collideAll(t,o,e.skip),u=!0;if(d.length){let c=t._moving&&!e.nested,l=c?this.directionCollideCoverage(t,e,d):d[0];if(c&&l&&t.grid?.opts?.subGridDynamic&&!t.grid._isTemp){let g=h.areaIntercept(e.rect,l._rect),p=h.area(e.rect),C=h.area(l._rect);g/(p<C?p:C)>.8&&(l.grid.makeSubGrid(l.el,void 0,t),l=void 0)}l?u=!this._fixCollisions(t,o,l,e):(u=!1,i&&delete e.pack)}return u&&!h.samePos(t,o)&&(t._dirty=!0,h.copyPos(t,o)),e.pack&&this._packNodes()._notify(),!h.samePos(t,n)}getRow(){return this.nodes.reduce((t,e)=>Math.max(t,e.y+e.h),0)}beginUpdate(t){return t._updating||(t._updating=!0,delete t._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){let t=this.nodes.find(e=>e._updating);return t&&(delete t._updating,delete t._skipDown),this}save(t=!0,e,i){let s=this._layouts?.length||0,o;s&&(i?i!==this.column&&(o=this._layouts[i]):this.column!==s-1&&(o=this._layouts[s-1]));let n=[];return this.sortNodes(),this.nodes.forEach(d=>{let u=o?.find(l=>l._id===d._id),c=m(m({},d),u||{});h.removeInternalForSave(c,!t),e&&e(d,c),n.push(c)}),n}layoutsNodesChange(t){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((e,i)=>{if(!e||i===this.column)return this;if(i<this.column)this._layouts[i]=void 0;else{let s=i/this.column;t.forEach(o=>{if(!o._orig)return;let n=e.find(d=>d._id===o._id);n&&(n.y>=0&&o.y!==o._orig.y&&(n.y+=o.y-o._orig.y),o.x!==o._orig.x&&(n.x=Math.round(o.x*s)),o.w!==o._orig.w&&(n.w=Math.round(o.w*s)))})}}),this)}columnChanged(t,e,i="moveScale"){if(!this.nodes.length||!e||t===e)return this;let s=i==="compact"||i==="list";s&&this.sortNodes(1),e<t&&this.cacheLayout(this.nodes,t),this.batchUpdate();let o=[],n=s?this.nodes:h.sort(this.nodes,-1);if(e>t&&this._layouts){let d=this._layouts[e]||[],u=this._layouts.length-1;!d.length&&t!==u&&this._layouts[u]?.length&&(t=u,this._layouts[u].forEach(c=>{let l=n.find(g=>g._id===c._id);l&&(!s&&!c.autoPosition&&(l.x=c.x??l.x,l.y=c.y??l.y),l.w=c.w??l.w,(c.x==null||c.y===void 0)&&(l.autoPosition=!0))})),d.forEach(c=>{let l=n.findIndex(g=>g._id===c._id);if(l!==-1){let g=n[l];if(s){g.w=c.w;return}(c.autoPosition||isNaN(c.x)||isNaN(c.y))&&this.findEmptyPosition(c,o),c.autoPosition||(g.x=c.x??g.x,g.y=c.y??g.y,g.w=c.w??g.w,o.push(g)),n.splice(l,1)}})}if(s)this.compact(i,!1);else{if(n.length)if(typeof i=="function")i(e,t,o,n);else{let d=s||i==="none"?1:e/t,u=i==="move"||i==="moveScale",c=i==="scale"||i==="moveScale";n.forEach(l=>{l.x=e===1?0:u?Math.round(l.x*d):Math.min(l.x,e-1),l.w=e===1||t===1?1:c?Math.round(l.w*d)||1:Math.min(l.w,e),o.push(l)}),n=[]}o=h.sort(o,-1),this._inColumnResize=!0,this.nodes=[],o.forEach(d=>{this.addNode(d,!1),delete d._orig})}return this.nodes.forEach(d=>delete d._orig),this.batchUpdate(!1,!s),delete this._inColumnResize,this}cacheLayout(t,e,i=!1){let s=[];return t.forEach((o,n)=>{if(o._id===void 0){let d=o.id?this.nodes.find(u=>u.id===o.id):void 0;o._id=d?._id??a._idSeq++}s[n]={x:o.x,y:o.y,w:o.w,_id:o._id}}),this._layouts=i?[]:this._layouts||[],this._layouts[e]=s,this}cacheOneLayout(t,e){t._id=t._id??a._idSeq++;let i={x:t.x,y:t.y,w:t.w,_id:t._id};(t.autoPosition||t.x===void 0)&&(delete i.x,delete i.y,t.autoPosition&&(i.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[e]=this._layouts[e]||[];let s=this.findCacheLayout(t,e);return s===-1?this._layouts[e].push(i):this._layouts[e][s]=i,this}findCacheLayout(t,e){return this._layouts?.[e]?.findIndex(i=>i._id===t._id)??-1}removeNodeFromLayoutCache(t){if(this._layouts)for(let e=0;e<this._layouts.length;e++){let i=this.findCacheLayout(t,e);i!==-1&&this._layouts[e].splice(i,1)}}cleanupNode(t){for(let e in t)e[0]==="_"&&e!=="_id"&&delete t[e];return this}}return a._idSeq=0,a})();var z={alwaysShowResizeHandle:"mobile",animate:!0,auto:!0,cellHeight:"auto",cellHeightThrottle:100,cellHeightUnit:"px",column:12,draggable:{handle:".grid-stack-item-content",appendTo:"body",scroll:!0},handle:".grid-stack-item-content",itemClass:"grid-stack-item",margin:10,marginUnit:"px",maxRow:0,minRow:0,placeholderClass:"grid-stack-placeholder",placeholderText:"",removableOptions:{accept:"grid-stack-item",decline:"grid-stack-non-removable"},resizable:{handles:"se"},rtl:"auto"};var f=class{};var x=typeof window<"u"&&typeof document<"u"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0),O=class{};function _t(a,r){a.touches.length>1||(a.cancelable&&a.preventDefault(),h.simulateMouseEvent(a.changedTouches[0],r))}function He(a,r){a.cancelable&&a.preventDefault(),h.simulateMouseEvent(a,r)}function V(a){O.touchHandled||(O.touchHandled=!0,_t(a,"mousedown"))}function j(a){O.touchHandled&&_t(a,"mousemove")}function q(a){if(!O.touchHandled)return;O.pointerLeaveTimeout&&(window.clearTimeout(O.pointerLeaveTimeout),delete O.pointerLeaveTimeout);let r=!!f.dragElement;_t(a,"mouseup"),r||_t(a,"click"),O.touchHandled=!1}function Y(a){a.pointerType!=="mouse"&&a.target.releasePointerCapture(a.pointerId)}function Nt(a){f.dragElement&&a.pointerType!=="mouse"&&He(a,"mouseenter")}function Pt(a){f.dragElement&&a.pointerType!=="mouse"&&(O.pointerLeaveTimeout=window.setTimeout(()=>{delete O.pointerLeaveTimeout,He(a,"mouseleave")},10))}var Oe=(()=>{class a{constructor(t,e,i){this.host=t,this.dir=e,this.option=i,this.moving=!1,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this._init()}_init(){let t=this.el=document.createElement("div");return t.classList.add("ui-resizable-handle"),t.classList.add(`${a.prefix}${this.dir}`),t.style.zIndex="100",t.style.userSelect="none",this.host.appendChild(this.el),this.el.addEventListener("mousedown",this._mouseDown),x&&(this.el.addEventListener("touchstart",V),this.el.addEventListener("pointerdown",Y)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),x&&(this.el.removeEventListener("touchstart",V),this.el.removeEventListener("pointerdown",Y)),this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(t){this.mouseDownEvent=t,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),x&&(this.el.addEventListener("touchmove",j),this.el.addEventListener("touchend",q)),t.stopPropagation(),t.preventDefault()}_mouseMove(t){let e=this.mouseDownEvent;this.moving?this._triggerEvent("move",t):Math.abs(t.x-e.x)+Math.abs(t.y-e.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",t),document.addEventListener("keydown",this._keyEvent)),t.stopPropagation()}_mouseUp(t){this.moving&&(this._triggerEvent("stop",t),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),x&&(this.el.removeEventListener("touchmove",j),this.el.removeEventListener("touchend",q)),delete this.moving,delete this.mouseDownEvent,t.stopPropagation(),t.preventDefault()}_keyEvent(t){t.key==="Escape"&&(this.host.gridstackNode?.grid?.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(t,e){return this.option[t]&&this.option[t](e),this}}return a.prefix="ui-resizable-",a})();var B=class{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(r,t){this._eventRegister[r]=t}off(r){delete this._eventRegister[r]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(r,t){if(!this.disabled&&this._eventRegister&&this._eventRegister[r])return this._eventRegister[r](t)}};var Me=(()=>{class a extends B{constructor(t,e={}){super(),this.el=t,this.option=e,this.rectScale={x:1,y:1},this._ui=()=>{let s=this.el.parentElement.getBoundingClientRect(),o={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},n=this.temporalRect||o;return{position:{left:(n.left-s.left)*this.rectScale.x,top:(n.top-s.top)*this.rectScale.y},size:{width:n.width*this.rectScale.x,height:n.height*this.rectScale.y}}},this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(this.option.autoHide),this._setupHandlers()}on(t,e){super.on(t,e)}off(t){super.off(t)}enable(){super.enable(),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),delete this.el,super.destroy()}updateOption(t){let e=t.handles&&t.handles!==this.option.handles,i=t.autoHide&&t.autoHide!==this.option.autoHide;return Object.keys(t).forEach(s=>this.option[s]=t[s]),e&&(this._removeHandlers(),this._setupHandlers()),i&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(t){return t?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),f.overResizeElement===this&&delete f.overResizeElement),this}_mouseOver(t){f.overResizeElement||f.dragElement||(f.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(t){f.overResizeElement===this&&(delete f.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(t=>t.trim()).map(t=>new Oe(this.el,t,{start:e=>{this._resizeStart(e)},stop:e=>{this._resizeStop(e)},move:e=>{this._resizing(e,t)}})),this}_resizeStart(t){this.sizeToContent=h.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=h.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=t,this._setupHelper(),this._applyChange();let e=h.initEvent(t,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(e,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",e),this}_resizing(t,e){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(t,e),this._applyChange();let i=h.initEvent(t,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(i,this._ui()),this.triggerEvent("resize",i),this}_resizeStop(t){let e=h.initEvent(t,{type:"resizestop",target:this.el});return this._cleanHelper(),this.option.stop&&this.option.stop(e),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",e),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=a._originStyleProp.map(i=>this.el.style[i]),this.parentOriginStylePosition=this.el.parentElement.style.position;let t=this.el.parentElement,e=h.getValuesFromTransformedElement(t);return this.rectScale={x:e.xScale,y:e.yScale},getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return a._originStyleProp.forEach((t,e)=>{this.el.style[t]=this.elOriginStyleVal[e]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(t,e){let i=this.startEvent,s={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},o=t.clientX-i.clientX,n=this.sizeToContent?0:t.clientY-i.clientY,d,u;e.indexOf("e")>-1?s.width+=o:e.indexOf("w")>-1&&(s.width-=o,s.left+=o,d=!0),e.indexOf("s")>-1?s.height+=n:e.indexOf("n")>-1&&(s.height-=n,s.top+=n,u=!0);let c=this._constrainSize(s.width,s.height,d,u);return Math.round(s.width)!==Math.round(c.width)&&(e.indexOf("w")>-1&&(s.left+=s.width-c.width),s.width=c.width),Math.round(s.height)!==Math.round(c.height)&&(e.indexOf("n")>-1&&(s.top+=s.height-c.height),s.height=c.height),s}_constrainSize(t,e,i,s){let o=this.option,n=(i?o.maxWidthMoveLeft:o.maxWidth)||Number.MAX_SAFE_INTEGER,d=o.minWidth/this.rectScale.x||t,u=(s?o.maxHeightMoveUp:o.maxHeight)||Number.MAX_SAFE_INTEGER,c=o.minHeight/this.rectScale.y||e,l=Math.min(n,Math.max(d,t)),g=Math.min(u,Math.max(c,e));return{width:l,height:g}}_applyChange(){let t={left:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){let e=this.el.parentElement,{left:i,top:s}=e.getBoundingClientRect();t={left:i,top:s,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(e=>{let i=this.temporalRect[e],s=e==="width"||e==="left"?this.rectScale.x:e==="height"||e==="top"?this.rectScale.y:1;this.el.style[e]=(i-t[e])*s+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(t=>t.destroy()),delete this.handlers,this}}return a._originStyleProp=["width","height","position","left","top","opacity","zIndex"],a})();var Ue='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle',Ne=(()=>{class a extends B{constructor(t,e={}){super(),this.el=t,this.option=e,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0};let i=e?.handle?.substring(1),s=t.gridstackNode;this.dragEls=!i||t.classList.contains(i)?[t]:s?.subGrid?[t.querySelector(e.handle)||t]:Array.from(t.querySelectorAll(e.handle)),this.dragEls.length===0&&(this.dragEls=[t]),this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this.enable()}on(t,e){super.on(t,e)}off(t){super.off(t)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(t=>{t.addEventListener("mousedown",this._mouseDown),x&&(t.addEventListener("touchstart",V),t.addEventListener("pointerdown",Y))}),this.el.classList.remove("ui-draggable-disabled"))}disable(t=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(e=>{e.removeEventListener("mousedown",this._mouseDown),x&&(e.removeEventListener("touchstart",V),e.removeEventListener("pointerdown",Y))}),t||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.mouseDownEvent&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.helper,delete this.option,super.destroy()}updateOption(t){return Object.keys(t).forEach(e=>this.option[e]=t[e]),this}_mouseDown(t){if(!f.mouseHandled)return t.button!==0||!this.dragEls.find(e=>e===t.target)&&t.target.closest(Ue)||this.option.cancel&&t.target.closest(this.option.cancel)||(this.mouseDownEvent=t,delete this.dragging,delete f.dragElement,delete f.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),x&&(t.currentTarget.addEventListener("touchmove",j),t.currentTarget.addEventListener("touchend",q)),t.preventDefault(),document.activeElement&&document.activeElement.blur(),f.mouseHandled=!0),!0}_callDrag(t){if(!this.dragging)return;let e=h.initEvent(t,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(e,this.ui()),this.triggerEvent("drag",e)}_mouseMove(t){let e=this.mouseDownEvent;if(this.lastDrag=t,this.dragging)if(this._dragFollow(t),f.pauseDrag){let i=Number.isInteger(f.pauseDrag)?f.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(t),i)}else this._callDrag(t);else if(Math.abs(t.x-e.x)+Math.abs(t.y-e.y)>3){this.dragging=!0,f.dragElement=this;let i=this.el.gridstackNode?.grid;i?f.dropElement=i.el.ddElement.ddDroppable:delete f.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=h.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(t,this.el,this.helperContainment),this._setupHelperStyle(t);let s=h.initEvent(t,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(s,this.ui()),this.triggerEvent("dragstart",s),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(t){if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),x&&t.currentTarget&&(t.currentTarget.removeEventListener("touchmove",j,!0),t.currentTarget.removeEventListener("touchend",q,!0)),this.dragging){delete this.dragging,delete this.el.gridstackNode?._origRotate,document.removeEventListener("keydown",this._keyEvent),f.dropElement?.el===this.el.parentElement&&delete f.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();let e=h.initEvent(t,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(e),this.triggerEvent("dragstop",e),f.dropElement&&f.dropElement.drop(t)}delete this.helper,delete this.mouseDownEvent,delete f.dragElement,delete f.dropElement,delete f.mouseHandled,t.preventDefault()}_keyEvent(t){let e=this.el.gridstackNode,i=e?.grid||f.dropElement?.el?.gridstack;if(t.key==="Escape")e&&e._origRotate&&(e._orig=e._origRotate,delete e._origRotate),i?.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if(e&&i&&(t.key==="r"||t.key==="R")){if(!h.canBeRotated(e))return;e._origRotate=e._origRotate||m({},e._orig),delete e._moving,i.setAnimation(!1).rotate(e.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetLeft}).setAnimation(),e._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,e.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",h.swap(e._orig,"w","h"),delete e._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let t=this.el;return typeof this.option.helper=="function"?t=this.option.helper(this.el):this.option.helper==="clone"&&(t=h.cloneNode(this.el)),t.parentElement||h.appendTo(t,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=a.originStyleProp.map(e=>this.el.style[e]),t}_setupHelperStyle(t){this.helper.classList.add("ui-draggable-dragging"),this.el.gridstackNode?.grid?.el.classList.add("grid-stack-dragging");let e=this.helper.style;return e.pointerEvents="none",e.width=this.dragOffset.width+"px",e.height=this.dragOffset.height+"px",e.willChange="left, top",e.position="fixed",this._dragFollow(t),e.transition="none",setTimeout(()=>{this.helper&&(e.transition=null)},0),this}_removeHelperStyle(){if(this.helper.classList.remove("ui-draggable-dragging"),this.el.gridstackNode?.grid?.el.classList.remove("grid-stack-dragging"),!this.helper?.gridstackNode?._isAboutToRemove&&this.dragElementOriginStyle){let e=this.helper,i=this.dragElementOriginStyle.transition||null;e.style.transition=this.dragElementOriginStyle.transition="none",a.originStyleProp.forEach(s=>e.style[s]=this.dragElementOriginStyle[s]||null),setTimeout(()=>e.style.transition=i,50)}return delete this.dragElementOriginStyle,this}_dragFollow(t){let e={left:0,top:0},i=this.helper.style,s=this.dragOffset;i.left=(t.clientX+s.offsetLeft-e.left)*this.dragTransform.xScale+"px",i.top=(t.clientY+s.offsetTop-e.top)*this.dragTransform.yScale+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,this.helper.style.position!=="fixed"&&(this.parentOriginStylePosition=this.helperContainment.style.position,getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(t,e,i){let s=0,o=0;i&&(s=this.dragTransform.xOffset,o=this.dragTransform.yOffset);let n=e.getBoundingClientRect();return{left:n.left,top:n.top,offsetLeft:-t.clientX+n.left-s,offsetTop:-t.clientY+n.top-o,width:n.width*this.dragTransform.xScale,height:n.height*this.dragTransform.yScale}}ui(){let e=this.el.parentElement.getBoundingClientRect(),i=this.helper.getBoundingClientRect();return{position:{top:(i.top-e.top)*this.dragTransform.yScale,left:(i.left-e.left)*this.dragTransform.xScale}}}}return a.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","top","minWidth","willChange"],a})();var yt=class extends B{constructor(r,t={}){super(),this.el=r,this.option=t,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(r,t){super.on(r,t)}off(r){super.off(r)}enable(){this.disabled!==!1&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("mouseenter",this._mouseEnter),this.el.addEventListener("mouseleave",this._mouseLeave),x&&(this.el.addEventListener("pointerenter",Nt),this.el.addEventListener("pointerleave",Pt)))}disable(r=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),r||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),x&&(this.el.removeEventListener("pointerenter",Nt),this.el.removeEventListener("pointerleave",Pt)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(r){return Object.keys(r).forEach(t=>this.option[t]=r[t]),this._setupAccept(),this}_mouseEnter(r){if(!f.dragElement||!this._canDrop(f.dragElement.el))return;r.preventDefault(),r.stopPropagation(),f.dropElement&&f.dropElement!==this&&f.dropElement._mouseLeave(r,!0),f.dropElement=this;let t=h.initEvent(r,{target:this.el,type:"dropover"});this.option.over&&this.option.over(t,this._ui(f.dragElement)),this.triggerEvent("dropover",t),this.el.classList.add("ui-droppable-over")}_mouseLeave(r,t=!1){if(!f.dragElement||f.dropElement!==this)return;r.preventDefault(),r.stopPropagation();let e=h.initEvent(r,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(e,this._ui(f.dragElement)),this.triggerEvent("dropout",e),f.dropElement===this&&(delete f.dropElement,!t)){let i,s=this.el.parentElement;for(;!i&&s;)i=s.ddElement?.ddDroppable,s=s.parentElement;i&&i._mouseEnter(r)}}drop(r){r.preventDefault();let t=h.initEvent(r,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(t,this._ui(f.dragElement)),this.triggerEvent("drop",t)}_canDrop(r){return r&&(!this.accept||this.accept(r))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=r=>r.classList.contains(this.option.accept)||r.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(r){return m({draggable:r.el},r.ui())}};var bt=class a{static init(r){return r.ddElement||(r.ddElement=new a(r)),r.ddElement}constructor(r){this.el=r}on(r,t){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(r)>-1?this.ddDraggable.on(r,t):this.ddDroppable&&["drop","dropover","dropout"].indexOf(r)>-1?this.ddDroppable.on(r,t):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(r)>-1&&this.ddResizable.on(r,t),this}off(r){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(r)>-1?this.ddDraggable.off(r):this.ddDroppable&&["drop","dropover","dropout"].indexOf(r)>-1?this.ddDroppable.off(r):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(r)>-1&&this.ddResizable.off(r),this}setupDraggable(r){return this.ddDraggable?this.ddDraggable.updateOption(r):this.ddDraggable=new Ne(this.el,r),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(r){return this.ddResizable?this.ddResizable.updateOption(r):this.ddResizable=new Me(this.el,r),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(r){return this.ddDroppable?this.ddDroppable.updateOption(r):this.ddDroppable=new yt(this.el,r),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}};var vt=class{resizable(r,t,e,i){return this._getDDElements(r,t).forEach(s=>{if(t==="disable"||t==="enable")s.ddResizable&&s.ddResizable[t]();else if(t==="destroy")s.ddResizable&&s.cleanResizable();else if(t==="option")s.setupResizable({[e]:i});else{let n=s.el.gridstackNode.grid,d=s.el.getAttribute("gs-resize-handles")||n.opts.resizable.handles||"e,s,se";d==="all"&&(d="n,e,s,w,se,sw,ne,nw");let u=!n.opts.alwaysShowResizeHandle;s.setupResizable(w(m({},n.opts.resizable),{handles:d,autoHide:u,start:t.start,stop:t.stop,resize:t.resize}))}}),this}draggable(r,t,e,i){return this._getDDElements(r,t).forEach(s=>{if(t==="disable"||t==="enable")s.ddDraggable&&s.ddDraggable[t]();else if(t==="destroy")s.ddDraggable&&s.cleanDraggable();else if(t==="option")s.setupDraggable({[e]:i});else{let o=s.el.gridstackNode.grid;s.setupDraggable(w(m({},o.opts.draggable),{start:t.start,stop:t.stop,drag:t.drag}))}}),this}dragIn(r,t){return this._getDDElements(r).forEach(e=>e.setupDraggable(t)),this}droppable(r,t,e,i){return typeof t.accept=="function"&&!t._accept&&(t._accept=t.accept,t.accept=s=>t._accept(s)),this._getDDElements(r,t).forEach(s=>{t==="disable"||t==="enable"?s.ddDroppable&&s.ddDroppable[t]():t==="destroy"?s.ddDroppable&&s.cleanDroppable():t==="option"?s.setupDroppable({[e]:i}):s.setupDroppable(t)}),this}isDroppable(r){return!!(r?.ddElement?.ddDroppable&&!r.ddElement.ddDroppable.disabled)}isDraggable(r){return!!(r?.ddElement?.ddDraggable&&!r.ddElement.ddDraggable.disabled)}isResizable(r){return!!(r?.ddElement?.ddResizable&&!r.ddElement.ddResizable.disabled)}on(r,t,e){return this._getDDElements(r).forEach(i=>i.on(t,s=>{e(s,f.dragElement?f.dragElement.el:s.target,f.dragElement?f.dragElement.helper:null)})),this}off(r,t){return this._getDDElements(r).forEach(e=>e.off(t)),this}_getDDElements(r,t){let e=r.gridstack||t!=="destroy"&&t!=="disable",i=h.getElements(r);return i.length?i.map(o=>o.ddElement||(e?bt.init(o):null)).filter(o=>o):[]}};var E=new vt,I=(()=>{class a{static init(t={},e=".grid-stack"){if(typeof document>"u")return null;let i=a.getGridElement(e);return i?(i.gridstack||(i.gridstack=new a(i,h.cloneDeep(t))),i.gridstack):(console.error(typeof e=="string"?'GridStack.initAll() no grid was found with selector "'+e+`" - element missing or wrong selector ?
2
- Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`:"GridStack.init() no grid element was passed."),null)}static initAll(t={},e=".grid-stack"){let i=[];return typeof document>"u"||(a.getGridElements(e).forEach(s=>{s.gridstack||(s.gridstack=new a(s,h.cloneDeep(t))),i.push(s.gridstack)}),i.length===0&&console.error('GridStack.initAll() no grid was found with selector "'+e+`" - element missing or wrong selector ?
3
- Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),i}static addGrid(t,e={}){if(!t)return null;let i=t;if(i.gridstack){let n=i.gridstack;return e&&(n.opts=m(m({},n.opts),e)),e.children!==void 0&&n.load(e.children),n}return(!t.classList.contains("grid-stack")||a.addRemoveCB)&&(a.addRemoveCB?i=a.addRemoveCB(t,e,!0,!0):i=h.createDiv(["grid-stack",e.class],t)),a.init(e,i)}static registerEngine(t){a.engineClass=t}get placeholder(){if(!this._placeholder){this._placeholder=h.createDiv([this.opts.placeholderClass,z.itemClass,this.opts.itemClass]);let t=h.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(t.textContent=this.opts.placeholderText)}return this._placeholder}constructor(t,e={}){this.el=t,this.opts=e,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},t.gridstack=this,this.opts=e=e||{},t.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),e.row&&(e.minRow=e.maxRow=e.row,delete e.row);let i=h.toNumber(t.getAttribute("gs-row"));e.column==="auto"&&delete e.column,e.alwaysShowResizeHandle!==void 0&&(e._alwaysShowResizeHandle=e.alwaysShowResizeHandle);let s=e.columnOpts;if(s){let c=s.breakpoints;!s.columnWidth&&!c?.length?delete e.columnOpts:(s.columnMax=s.columnMax||12,c?.length>1&&c.sort((l,g)=>(g.w||0)-(l.w||0)))}let o=w(m({},h.cloneDeep(z)),{column:h.toNumber(t.getAttribute("gs-column"))||z.column,minRow:i||h.toNumber(t.getAttribute("gs-min-row"))||z.minRow,maxRow:i||h.toNumber(t.getAttribute("gs-max-row"))||z.maxRow,staticGrid:h.toBool(t.getAttribute("gs-static"))||z.staticGrid,sizeToContent:h.toBool(t.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(e.handleClass?"."+e.handleClass:e.handle?e.handle:"")||z.draggable.handle},removableOptions:{accept:e.itemClass||z.removableOptions.accept,decline:z.removableOptions.decline}});t.getAttribute("gs-animate")&&(o.animate=h.toBool(t.getAttribute("gs-animate"))),e=h.defaults(e,o),this._initMargin(),this.checkDynamicColumn(),this._updateColumnVar(e),e.rtl==="auto"&&(e.rtl=t.style.direction==="rtl"),e.rtl&&this.el.classList.add("grid-stack-rtl");let d=this.el.closest("."+z.itemClass)?.gridstackNode;if(d&&(d.subGrid=this,this.parentGridNode=d,this.el.classList.add("grid-stack-nested"),d.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=e.cellHeight==="auto",this._isAutoCellHeight||e.cellHeight==="initial")this.cellHeight(void 0);else{typeof e.cellHeight=="number"&&e.cellHeightUnit&&e.cellHeightUnit!==z.cellHeightUnit&&(e.cellHeight=e.cellHeight+e.cellHeightUnit,delete e.cellHeightUnit);let c=e.cellHeight;delete e.cellHeight,this.cellHeight(c)}e.alwaysShowResizeHandle==="mobile"&&(e.alwaysShowResizeHandle=x),this._setStaticClass();let u=e.engineClass||a.engineClass||Mt;if(this.engine=new u({column:this.getColumn(),float:e.float,maxRow:e.maxRow,onChange:c=>{c.forEach(l=>{let g=l.el;g&&(l._removeDOM?(g&&g.remove(),delete l._removeDOM):this._writePosAttr(g,l))}),this._updateContainerHeight()}}),e.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(c=>this._prepareElement(c)),delete this.engine._loading,this.batchUpdate(!1)),e.children){let c=e.children;delete e.children,c.length&&this.load(c)}this.setAnimation(),e.subGridDynamic&&!f.pauseDrag&&(f.pauseDrag=!0),e.draggable?.pause!==void 0&&(f.pauseDrag=e.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}_updateColumnVar(t=this.opts){this.el.classList.add("gs-"+t.column),typeof t.column=="number"&&this.el.style.setProperty("--gs-column-width",`${100/t.column}%`)}addWidget(t){if(!t)return;if(typeof t=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(t.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(t);let e,i=t;if(i.grid=this,i.el?e=i.el:a.addRemoveCB?e=a.addRemoveCB(this.el,t,!0,!1):e=this.createWidgetDivs(i),!e)return;if(i=e.gridstackNode,i&&e.parentElement===this.el&&this.engine.nodes.find(o=>o._id===i._id))return e;let s=this._readAttr(e);return h.defaults(t,s),this.engine.prepareNode(t),this.el.appendChild(e),this.makeWidget(e,t),e}createWidgetDivs(t){let e=h.createDiv(["grid-stack-item",this.opts.itemClass]),i=h.createDiv(["grid-stack-item-content"],e);return h.lazyLoad(t)?t.visibleObservable||(t.visibleObservable=new IntersectionObserver(([s])=>{s.isIntersecting&&(t.visibleObservable?.disconnect(),delete t.visibleObservable,a.renderCB(i,t),t.grid?.prepareDragDrop(t.el))}),window.setTimeout(()=>t.visibleObservable?.observe(e))):a.renderCB(i,t),e}makeSubGrid(t,e,i,s=!0){let o=t.gridstackNode;if(o||(o=this.makeWidget(t).gridstackNode),o.subGrid?.el)return o.subGrid;let n,d=this;for(;d&&!n;)n=d.opts?.subGridOpts,d=d.parentGridNode?.grid;e=h.cloneDeep(m(m(w(m({},this.opts),{id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0}),n||{}),e||o.subGridOpts||{})),o.subGridOpts=e;let u;e.column==="auto"&&(u=!0,e.column=Math.max(o.w||1,i?.w||1),delete e.columnOpts);let c=o.el.querySelector(".grid-stack-item-content"),l,g;if(s&&(this._removeDD(o.el),g=w(m({},o),{x:0,y:0}),h.removeInternalForSave(g),delete g.subGridOpts,o.content&&(g.content=o.content,delete o.content),a.addRemoveCB?l=a.addRemoveCB(this.el,g,!0,!1):(l=h.createDiv(["grid-stack-item"]),l.appendChild(c),c=h.createDiv(["grid-stack-item-content"],o.el)),this.prepareDragDrop(o.el)),i){let C=u?e.column:o.w,D=o.h+i.h,P=o.el.style;P.transition="none",this.update(o.el,{w:C,h:D}),setTimeout(()=>P.transition=null)}let p=o.subGrid=a.addGrid(c,e);return i?._moving&&(p._isTemp=!0),u&&(p._autoColumn=!0),s&&p.makeWidget(l,g),i&&(i._moving?window.setTimeout(()=>h.simulateMouseEvent(i._event,"mouseenter",p.el),0):p.makeWidget(o.el,o)),this.resizeToContentCheck(!1,o),p}removeAsSubGrid(t){let e=this.parentGridNode?.grid;e&&(e.batchUpdate(),e.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(i=>{i.x+=this.parentGridNode.x,i.y+=this.parentGridNode.y,e.makeWidget(i.el,i)}),e.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,t&&window.setTimeout(()=>h.simulateMouseEvent(t._event,"mouseenter",e.el),0))}save(t=!0,e=!1,i=a.saveCB,s){let o=this.engine.save(t,i,s);if(o.forEach(n=>{if(t&&n.el&&!n.subGrid&&!i){let d=n.el.querySelector(".grid-stack-item-content");n.content=d?.innerHTML,n.content||delete n.content}else if(!t&&!i&&delete n.content,n.subGrid?.el){let d=n.w||n.subGrid.getColumn(),u=n.subGrid.save(t,e,i,d);n.subGridOpts=e?u:{children:u},delete n.subGrid}delete n.el}),e){let n=h.cloneDeep(this.opts);n.marginBottom===n.marginTop&&n.marginRight===n.marginLeft&&n.marginTop===n.marginRight&&(n.margin=n.marginTop,delete n.marginTop,delete n.marginRight,delete n.marginBottom,delete n.marginLeft),n.rtl===(this.el.style.direction==="rtl")&&(n.rtl="auto"),this._isAutoCellHeight&&(n.cellHeight="auto"),this._autoColumn&&(n.column="auto");let d=n._alwaysShowResizeHandle;return delete n._alwaysShowResizeHandle,d!==void 0?n.alwaysShowResizeHandle=d:delete n.alwaysShowResizeHandle,h.removeInternalAndSame(n,z),n.children=o,n}return o}load(t,e=a.addRemoveCB||!0){t=h.cloneDeep(t);let i=this.getColumn();t.forEach(l=>{l.w=l.w||l.minW||1,l.h=l.h||l.minH||1}),t=h.sort(t),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let s=0;t.forEach(l=>{s=Math.max(s,(l.x||0)+l.w)}),s>this.engine.defaultColumn&&(this.engine.defaultColumn=s),s>i&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=t,this.engine.columnChanged(s,i,this.responseLayout),t=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(t,s,!0));let o=a.addRemoveCB;typeof e=="function"&&(a.addRemoveCB=e);let n=[];this.batchUpdate();let d=!this.engine.nodes.length,u=d&&this.opts.animate;u&&this.setAnimation(!1),!d&&e&&[...this.engine.nodes].forEach(g=>{if(!g.id)return;h.find(t,g.id)||(a.addRemoveCB&&a.addRemoveCB(this.el,g,!1,!1),n.push(g),this.removeWidget(g.el,!0,!1))}),this.engine._loading=!0;let c=[];return this.engine.nodes=this.engine.nodes.filter(l=>h.find(t,l.id)?(c.push(l),!1):!0),t.forEach(l=>{let g=h.find(c,l.id);if(g){if(h.shouldSizeToContent(g)&&(l.h=g.h),this.engine.nodeBoundFix(l),(l.autoPosition||l.x===void 0||l.y===void 0)&&(l.w=l.w||g.w,l.h=l.h||g.h,this.engine.findEmptyPosition(l)),this.engine.nodes.push(g),h.samePos(g,l)&&this.engine.nodes.length>1&&(this.moveNode(g,w(m({},l),{forceCollide:!0})),h.copyPos(l,g)),this.update(g.el,l),l.subGridOpts?.children){let p=g.el.querySelector(".grid-stack");p&&p.gridstack&&p.gridstack.load(l.subGridOpts.children)}}else e&&this.addWidget(l)}),delete this.engine._loading,this.engine.removedNodes=n,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,o?a.addRemoveCB=o:delete a.addRemoveCB,u&&this.setAnimation(!0,!0),this}batchUpdate(t=!0){return this.engine.batchUpdate(t),t||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(t=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!t||!this.opts.cellHeightUnit||this.opts.cellHeightUnit==="px"))return this.opts.cellHeight;if(this.opts.cellHeightUnit==="rem")return this.opts.cellHeight*parseFloat(getComputedStyle(document.documentElement).fontSize);if(this.opts.cellHeightUnit==="em")return this.opts.cellHeight*parseFloat(getComputedStyle(this.el).fontSize);if(this.opts.cellHeightUnit==="cm")return this.opts.cellHeight*(96/2.54);if(this.opts.cellHeightUnit==="mm")return this.opts.cellHeight*(96/2.54)/10;let e=this.el.querySelector("."+this.opts.itemClass);if(e){let s=h.toNumber(e.getAttribute("gs-h"))||1;return Math.round(e.offsetHeight/s)}let i=parseInt(this.el.getAttribute("gs-current-row"));return i?Math.round(this.el.getBoundingClientRect().height/i):this.opts.cellHeight}cellHeight(t){if(t!==void 0&&this._isAutoCellHeight!==(t==="auto")&&(this._isAutoCellHeight=t==="auto",this._updateResizeEvent()),(t==="initial"||t==="auto")&&(t=void 0),t===void 0){let i=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;t=this.cellWidth()+i}let e=h.parseHeight(t);return this.opts.cellHeightUnit===e.unit&&this.opts.cellHeight===e.h?this:(this.opts.cellHeightUnit=e.unit,this.opts.cellHeight=e.h,this.el.style.setProperty("--gs-cell-height",`${this.opts.cellHeight}${this.opts.cellHeightUnit}`),this._updateContainerHeight(),this.resizeToContentCheck(),this)}cellWidth(){return this._widthOrContainer()/this.getColumn()}_widthOrContainer(t=!1){return t&&this.opts.columnOpts?.breakpointForWindow?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){let t=this.opts.columnOpts;if(!t||!t.columnWidth&&!t.breakpoints?.length)return!1;let e=this.getColumn(),i=e,s=this._widthOrContainer(!0);if(t.columnWidth)i=Math.min(Math.round(s/t.columnWidth)||1,t.columnMax);else{i=t.columnMax;let o=0;for(;o<t.breakpoints.length&&s<=t.breakpoints[o].w;)i=t.breakpoints[o++].c||e}if(i!==e){let o=t.breakpoints?.find(n=>n.c===i);return this.column(i,o?.layout||t.layout),!0}return!1}compact(t="compact",e=!0){return this.engine.compact(t,e),this._triggerChangeEvent(),this}column(t,e="moveScale"){if(!t||t<1||this.opts.column===t)return this;let i=this.getColumn();return this.opts.column=t,this.engine?(this.engine.column=t,this.el.classList.remove("gs-"+i),this._updateColumnVar(),this.engine.columnChanged(i,t,e),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):(this.responseLayout=e,this)}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(t=>t.matches("."+this.opts.itemClass)&&!t.matches("."+this.opts.placeholderClass))}isIgnoreChangeCB(){return this._ignoreLayoutsNodeChange}destroy(t=!0){if(this.el)return this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),t?this.el.parentNode.removeChild(this.el):(this.removeAll(t),this.el.removeAttribute("gs-current-row")),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,delete this.opts,delete this._placeholder?.gridstackNode,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}float(t){return this.opts.float!==t&&(this.opts.float=this.engine.float=t,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(t,e=!1){let i=this.el.getBoundingClientRect(),s;e?s={top:i.top+document.documentElement.scrollTop,left:i.left}:s={top:this.el.offsetTop,left:this.el.offsetLeft};let o=t.left-s.left,n=t.top-s.top,d=i.width/this.getColumn(),u=i.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(o/d),y:Math.floor(n/u)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(t,e,i,s){return this.engine.isAreaEmpty(t,e,i,s)}makeWidget(t,e){let i=a.getElement(t);if(!i||i.gridstackNode)return i;i.parentElement||this.el.appendChild(i),this._prepareElement(i,!0,e);let s=i.gridstackNode;this._updateContainerHeight(),s.subGridOpts&&this.makeSubGrid(i,s.subGridOpts,void 0,!1);let o;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(o=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),o&&delete this._ignoreLayoutsNodeChange,i}on(t,e){return t.indexOf(" ")!==-1?(t.split(" ").forEach(s=>this.on(s,e)),this):(t==="change"||t==="added"||t==="removed"||t==="enable"||t==="disable"?(t==="enable"||t==="disable"?this._gsEventHandler[t]=s=>e(s):this._gsEventHandler[t]=s=>{s.detail&&e(s,s.detail)},this.el.addEventListener(t,this._gsEventHandler[t])):t==="drag"||t==="dragstart"||t==="dragstop"||t==="resizestart"||t==="resize"||t==="resizestop"||t==="dropped"||t==="resizecontent"?this._gsEventHandler[t]=e:console.error("GridStack.on("+t+") event not supported"),this)}off(t){return t.indexOf(" ")!==-1?(t.split(" ").forEach(i=>this.off(i)),this):((t==="change"||t==="added"||t==="removed"||t==="enable"||t==="disable")&&this._gsEventHandler[t]&&this.el.removeEventListener(t,this._gsEventHandler[t]),delete this._gsEventHandler[t],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(t=>this.off(t)),this}removeWidget(t,e=!0,i=!0){return t?(a.getElements(t).forEach(s=>{if(s.parentElement&&s.parentElement!==this.el)return;let o=s.gridstackNode;o||(o=this.engine.nodes.find(n=>s===n.el)),o&&(e&&a.addRemoveCB&&a.addRemoveCB(this.el,o,!1,!1),delete s.gridstackNode,this._removeDD(s),this.engine.removeNode(o,e,i),e&&s.parentElement&&s.remove())}),i&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(t=!0,e=!0){return this.engine.nodes.forEach(i=>{t&&a.addRemoveCB&&a.addRemoveCB(this.el,i,!1,!1),delete i.el.gridstackNode,this.opts.staticGrid||this._removeDD(i.el)}),this.engine.removeAll(t,e),e&&this._triggerRemoveEvent(),this}setAnimation(t=this.opts.animate,e){return e?setTimeout(()=>{this.opts&&this.setAnimation(t)}):t?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this.opts.animate=t,this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(t,e=!0,i=!0){return!!this.opts.staticGrid===t?this:(t?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(s=>{this.prepareDragDrop(s.el),s.subGrid&&i&&s.subGrid.setStatic(t,e,i)}),e&&this._setStaticClass(),this)}updateOptions(t){let e=this.opts;return t===e?this:(t.acceptWidgets!==void 0&&(e.acceptWidgets=t.acceptWidgets,this._setupAcceptWidget()),t.animate!==void 0&&this.setAnimation(t.animate),t.cellHeight&&this.cellHeight(t.cellHeight),t.class!==void 0&&t.class!==e.class&&(e.class&&this.el.classList.remove(e.class),t.class&&this.el.classList.add(t.class)),t.columnOpts?(this.opts.columnOpts=t.columnOpts,this.checkDynamicColumn()):t.columnOpts===null&&this.opts.columnOpts?(delete this.opts.columnOpts,this._updateResizeEvent()):typeof t.column=="number"&&this.column(t.column),t.margin!==void 0&&this.margin(t.margin),t.staticGrid!==void 0&&this.setStatic(t.staticGrid),t.disableDrag!==void 0&&!t.staticGrid&&this.enableMove(!t.disableDrag),t.disableResize!==void 0&&!t.staticGrid&&this.enableResize(!t.disableResize),t.float!==void 0&&this.float(t.float),t.row!==void 0?(e.minRow=e.maxRow=e.row=t.row,this._updateContainerHeight()):(t.minRow!==void 0&&(e.minRow=t.minRow,this._updateContainerHeight()),t.maxRow!==void 0&&(e.maxRow=t.maxRow)),t.children?.length&&this.load(t.children),this)}update(t,e){return a.getElements(t).forEach(i=>{let s=i?.gridstackNode;if(!s)return;let o=m(m({},h.copyPos({},s)),h.cloneDeep(e));this.engine.nodeBoundFix(o),delete o.autoPosition;let n=["x","y","w","h"],d;if(n.some(l=>o[l]!==void 0&&o[l]!==s[l])&&(d={},n.forEach(l=>{d[l]=o[l]!==void 0?o[l]:s[l],delete o[l]})),!d&&(o.minW||o.minH||o.maxW||o.maxH)&&(d={}),o.content!==void 0){let l=i.querySelector(".grid-stack-item-content");l&&l.textContent!==o.content&&(s.content=o.content,a.renderCB(l,o),s.subGrid?.el&&(l.appendChild(s.subGrid.el),s.subGrid._updateContainerHeight())),delete o.content}let u=!1,c=!1;for(let l in o)l[0]!=="_"&&s[l]!==o[l]&&(s[l]=o[l],u=!0,c=c||!this.opts.staticGrid&&(l==="noResize"||l==="noMove"||l==="locked"));if(h.sanitizeMinMax(s),d){let l=d.w!==void 0&&d.w!==s.w;this.moveNode(s,d),l&&s.subGrid?s.subGrid.onResize(this.hasAnimationCSS()?s.w:void 0):this.resizeToContentCheck(l,s),delete s._orig}(d||u)&&this._writeAttr(i,s),c&&this.prepareDragDrop(s.el),a.updateCB&&a.updateCB(s)}),this}moveNode(t,e){let i=t._updating;i||this.engine.cleanNodes().beginUpdate(t),this.engine.moveNode(t,e),this._updateContainerHeight(),i||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(t){if(!t||(t.classList.remove("size-to-content-max"),!t.clientHeight))return;let e=t.gridstackNode;if(!e)return;let i=e.grid;if(!i||t.parentElement!==i.el)return;let s=i.getCellHeight(!0);if(!s)return;let o=e.h?e.h*s:t.clientHeight,n;if(e.resizeToContentParent&&(n=t.querySelector(e.resizeToContentParent)),n||(n=t.querySelector(a.resizeToContentParent)),!n)return;let d=t.clientHeight-n.clientHeight,u=e.h?e.h*s-d:n.clientHeight,c;if(e.subGrid){c=e.subGrid.getRow()*e.subGrid.getCellHeight(!0);let p=e.subGrid.el.getBoundingClientRect(),C=t.getBoundingClientRect();c+=p.top-C.top}else{if(e.subGridOpts?.children?.length)return;{let p=n.firstElementChild;if(!p){console.error(`Error: GridStack.resizeToContent() widget id:${e.id} '${a.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}c=p.getBoundingClientRect().height||u}}if(u===c)return;o+=c-u;let l=Math.ceil(o/s),g=Number.isInteger(e.sizeToContent)?e.sizeToContent:0;g&&l>g&&(l=g,t.classList.add("size-to-content-max")),e.minH&&l<e.minH?l=e.minH:e.maxH&&l>e.maxH&&(l=e.maxH),l!==e.h&&(i._ignoreLayoutsNodeChange=!0,i.moveNode(e,{h:l}),delete i._ignoreLayoutsNodeChange)}resizeToContentCBCheck(t){a.resizeToContentCB?a.resizeToContentCB(t):this.resizeToContent(t)}rotate(t,e){return a.getElements(t).forEach(i=>{let s=i.gridstackNode;if(!h.canBeRotated(s))return;let o={w:s.h,h:s.w,minH:s.minW,minW:s.minH,maxH:s.maxW,maxW:s.maxH};if(e){let d=e.left>0?Math.floor(e.left/this.cellWidth()):0,u=e.top>0?Math.floor(e.top/this.opts.cellHeight):0;o.x=s.x+d-(s.h-(u+1)),o.y=s.y+u-d}Object.keys(o).forEach(d=>{o[d]===void 0&&delete o[d]});let n=s._orig;this.update(i,o),s._orig=n}),this}margin(t){if(!(typeof t=="string"&&t.split(" ").length>1)){let i=h.parseHeight(t);if(this.opts.marginUnit===i.unit&&this.opts.margin===i.h)return}return this.opts.margin=t,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this}getMargin(){return this.opts.margin}willItFit(t){if(arguments.length>1){console.warn("gridstack.ts: `willItFit(x,y,w,h,autoPosition)` is deprecated. Use `willItFit({x, y,...})`. It will be removed soon");let e=arguments,i=0,s={x:e[i++],y:e[i++],w:e[i++],h:e[i++],autoPosition:e[i++]};return this.willItFit(s)}return this.engine.willItFit(t)}_triggerChangeEvent(){if(this.engine.batchMode)return this;let t=this.engine.getDirtyNodes(!0);return t&&t.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(t),this._triggerEvent("change",t)),this.engine.saveInitial(),this}_triggerAddEvent(){if(this.engine.batchMode)return this;if(this.engine.addedNodes?.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(e=>{delete e._dirty});let t=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",t)}return this}_triggerRemoveEvent(){if(this.engine.batchMode)return this;if(this.engine.removedNodes?.length){let t=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",t)}return this}_triggerEvent(t,e){let i=e?new CustomEvent(t,{bubbles:!1,detail:e}):new Event(t),s=this;for(;s.parentGridNode;)s=s.parentGridNode.grid;return s.el.dispatchEvent(i),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;let t=this.parentGridNode,e=this.getRow()+this._extraDragRow,i=this.opts.cellHeight,s=this.opts.cellHeightUnit;if(!i)return this;if(!t&&!this.opts.minRow){let o=h.parseHeight(getComputedStyle(this.el).minHeight);if(o.h>0&&o.unit===s){let n=Math.floor(o.h/i);e<n&&(e=n)}}return this.el.setAttribute("gs-current-row",String(e)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),e&&(this.el.style[t?"minHeight":"height"]=e*i+s),t&&h.shouldSizeToContent(t)&&t.grid.resizeToContentCBCheck(t.el),this}_prepareElement(t,e=!1,i){i=i||this._readAttr(t),t.gridstackNode=i,i.el=t,i.grid=this,i=this.engine.addNode(i,e),this._writeAttr(t,i),t.classList.add(z.itemClass,this.opts.itemClass);let s=h.shouldSizeToContent(i);return s?t.classList.add("size-to-content"):t.classList.remove("size-to-content"),s&&this.resizeToContentCheck(!1,i),h.lazyLoad(i)||this.prepareDragDrop(i.el),this}_writePosAttr(t,e){return(!e._moving&&!e._resizing||this._placeholder===t)&&(t.style.top=e.y?e.y===1?"var(--gs-cell-height)":`calc(${e.y} * var(--gs-cell-height))`:null,t.style.left=e.x?e.x===1?"var(--gs-column-width)":`calc(${e.x} * var(--gs-column-width))`:null,t.style.width=e.w>1?`calc(${e.w} * var(--gs-column-width))`:null,t.style.height=e.h>1?`calc(${e.h} * var(--gs-cell-height))`:null),e.x>0?t.setAttribute("gs-x",String(e.x)):t.removeAttribute("gs-x"),e.y>0?t.setAttribute("gs-y",String(e.y)):t.removeAttribute("gs-y"),e.w>1?t.setAttribute("gs-w",String(e.w)):t.removeAttribute("gs-w"),e.h>1?t.setAttribute("gs-h",String(e.h)):t.removeAttribute("gs-h"),this}_writeAttr(t,e){if(!e)return this;this._writePosAttr(t,e);let i={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(let s in i)e[s]?t.setAttribute(i[s],String(e[s])):t.removeAttribute(i[s]);return this}_readAttr(t,e=!0){let i={};i.x=h.toNumber(t.getAttribute("gs-x")),i.y=h.toNumber(t.getAttribute("gs-y")),i.w=h.toNumber(t.getAttribute("gs-w")),i.h=h.toNumber(t.getAttribute("gs-h")),i.autoPosition=h.toBool(t.getAttribute("gs-auto-position")),i.noResize=h.toBool(t.getAttribute("gs-no-resize")),i.noMove=h.toBool(t.getAttribute("gs-no-move")),i.locked=h.toBool(t.getAttribute("gs-locked"));let s=t.getAttribute("gs-size-to-content");s&&(s==="true"||s==="false"?i.sizeToContent=h.toBool(s):i.sizeToContent=parseInt(s,10)),i.id=t.getAttribute("gs-id"),i.maxW=h.toNumber(t.getAttribute("gs-max-w")),i.minW=h.toNumber(t.getAttribute("gs-min-w")),i.maxH=h.toNumber(t.getAttribute("gs-max-h")),i.minH=h.toNumber(t.getAttribute("gs-min-h")),e&&(i.w===1&&t.removeAttribute("gs-w"),i.h===1&&t.removeAttribute("gs-h"),i.maxW&&t.removeAttribute("gs-max-w"),i.minW&&t.removeAttribute("gs-min-w"),i.maxH&&t.removeAttribute("gs-max-h"),i.minH&&t.removeAttribute("gs-min-h"));for(let o in i){if(!i.hasOwnProperty(o))return;!i[o]&&i[o]!==0&&o!=="sizeToContent"&&delete i[o]}return i}_setStaticClass(){let t=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...t),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...t),this.el.removeAttribute("gs-static")),this}onResize(t=this.el?.clientWidth){if(!t||this.prevWidth===t)return;this.prevWidth=t,this.batchUpdate();let e=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),e=!0):e=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(i=>{i.subGrid&&i.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(e),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(t=!1,e=void 0){if(this.engine){if(t&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,e),this.animationDelay);if(e)h.shouldSizeToContent(e)&&this.resizeToContentCBCheck(e.el);else if(this.engine.nodes.some(i=>h.shouldSizeToContent(i))){let i=[...this.engine.nodes];this.batchUpdate(),i.forEach(s=>{h.shouldSizeToContent(s)&&this.resizeToContentCBCheck(s.el)}),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(!1),this._ignoreLayoutsNodeChange=!1}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,e?[e]:this.engine.nodes)}}_updateResizeEvent(t=!1){let e=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(i=>i.sizeToContent));return!t&&e&&!this.resizeObserver?(this._sizeThrottle=h.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(t||!e)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(t=".grid-stack-item"){return h.getElement(t)}static getElements(t=".grid-stack-item"){return h.getElements(t)}static getGridElement(t){return a.getElement(t)}static getGridElements(t){return h.getElements(t)}_initMargin(){let t,e=0,i=[];typeof this.opts.margin=="string"&&(i=this.opts.margin.split(" ")),i.length===2?(this.opts.marginTop=this.opts.marginBottom=i[0],this.opts.marginLeft=this.opts.marginRight=i[1]):i.length===4?(this.opts.marginTop=i[0],this.opts.marginRight=i[1],this.opts.marginBottom=i[2],this.opts.marginLeft=i[3]):(t=h.parseHeight(this.opts.margin),this.opts.marginUnit=t.unit,e=this.opts.margin=t.h),["marginTop","marginRight","marginBottom","marginLeft"].forEach(n=>{this.opts[n]===void 0?this.opts[n]=e:(t=h.parseHeight(this.opts[n]),this.opts[n]=t.h,delete this.opts.margin)}),this.opts.marginUnit=t.unit,this.opts.marginTop===this.opts.marginBottom&&this.opts.marginLeft===this.opts.marginRight&&this.opts.marginTop===this.opts.marginRight&&(this.opts.margin=this.opts.marginTop);let o=this.el.style;return o.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),o.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),o.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),o.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return E}static setupDragIn(t,e,i,s=document){e?.pause!==void 0&&(f.pauseDrag=e.pause),e=m({appendTo:"body",helper:"clone"},e||{}),(typeof t=="string"?h.getElements(t,s):t).forEach((n,d)=>{E.isDraggable(n)||E.dragIn(n,e),i?.[d]&&(n.gridstackNode=i[d])})}movable(t,e){return this.opts.staticGrid?this:(a.getElements(t).forEach(i=>{let s=i.gridstackNode;s&&(e?delete s.noMove:s.noMove=!0,this.prepareDragDrop(s.el))}),this)}resizable(t,e){return this.opts.staticGrid?this:(a.getElements(t).forEach(i=>{let s=i.gridstackNode;s&&(e?delete s.noResize:s.noResize=!0,this.prepareDragDrop(s.el))}),this)}disable(t=!0){if(!this.opts.staticGrid)return this.enableMove(!1,t),this.enableResize(!1,t),this._triggerEvent("disable"),this}enable(t=!0){if(!this.opts.staticGrid)return this.enableMove(!0,t),this.enableResize(!0,t),this._triggerEvent("enable"),this}enableMove(t,e=!0){return this.opts.staticGrid?this:(t?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(i=>{this.prepareDragDrop(i.el),i.subGrid&&e&&i.subGrid.enableMove(t,e)}),this)}enableResize(t,e=!0){return this.opts.staticGrid?this:(t?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(i=>{this.prepareDragDrop(i.el),i.subGrid&&e&&i.subGrid.enableResize(t,e)}),this)}cancelDrag(){let t=this._placeholder?.gridstackNode;t&&(t._isExternal?(t._isAboutToRemove=!0,this.engine.removeNode(t)):t._isAboutToRemove&&a._itemRemoving(t.el,!1),this.engine.restoreInitial())}_removeDD(t){return E.draggable(t,"destroy").resizable(t,"destroy"),t.gridstackNode&&delete t.gridstackNode._initDD,delete t.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return E.droppable(this.el,"destroy"),this;let t,e,i=(s,o,n)=>{n=n||o;let d=n.gridstackNode;if(!d)return;if(!d.grid?.el){n.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;let p=n.getBoundingClientRect();n.style.left=p.x+(this.dragTransform.xScale-1)*(s.clientX-p.x)/this.dragTransform.xScale+"px",n.style.top=p.y+(this.dragTransform.yScale-1)*(s.clientY-p.y)/this.dragTransform.yScale+"px",n.style.transformOrigin="0px 0px"}let{top:u,left:c}=n.getBoundingClientRect(),l=this.el.getBoundingClientRect();c-=l.left,u-=l.top;let g={position:{top:u*this.dragTransform.xScale,left:c*this.dragTransform.yScale}};if(d._temporaryRemoved){if(d.x=Math.max(0,Math.round(c/e)),d.y=Math.max(0,Math.round(u/t)),delete d.autoPosition,this.engine.nodeBoundFix(d),!this.engine.willItFit(d)){if(d.autoPosition=!0,!this.engine.willItFit(d)){E.off(o,"drag");return}d._willFitPos&&(h.copyPos(d,d._willFitPos),delete d._willFitPos)}this._onStartMoving(n,s,g,d,e,t)}else this._dragOrResize(n,s,g,d,e,t)};return E.droppable(this.el,{accept:s=>{let o=s.gridstackNode||this._readAttr(s,!1);if(o?.grid===this)return!0;if(!this.opts.acceptWidgets)return!1;let n=!0;if(typeof this.opts.acceptWidgets=="function")n=this.opts.acceptWidgets(s);else{let d=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;n=s.matches(d)}if(n&&o&&this.opts.maxRow){let d={w:o.w,h:o.h,minW:o.minW,minH:o.minH};n=this.engine.willItFit(d)}return n}}).on(this.el,"dropover",(s,o,n)=>{let d=n?.gridstackNode||o.gridstackNode;if(d?.grid===this&&!d._temporaryRemoved)return!1;if(d?._sidebarOrig&&(d.w=d._sidebarOrig.w,d.h=d._sidebarOrig.h),d?.grid&&d.grid!==this&&!d._temporaryRemoved&&d.grid._leave(o,n),n=n||o,e=this.cellWidth(),t=this.getCellHeight(!0),!d){let l=n.getAttribute("data-gs-widget")||n.getAttribute("gridstacknode");if(l){try{d=JSON.parse(l)}catch{console.error("Gridstack dropover: Bad JSON format: ",l)}n.removeAttribute("data-gs-widget"),n.removeAttribute("gridstacknode")}d||(d=this._readAttr(n)),d._sidebarOrig={w:d.w,h:d.h}}d.grid||(d.el||(d=m({},d)),d._isExternal=!0,n.gridstackNode=d);let u=d.w||Math.round(n.offsetWidth/e)||1,c=d.h||Math.round(n.offsetHeight/t)||1;return d.grid&&d.grid!==this?(o._gridstackNodeOrig||(o._gridstackNodeOrig=d),o.gridstackNode=d=w(m({},d),{w:u,h:c,grid:this}),delete d.x,delete d.y,this.engine.cleanupNode(d).nodeBoundFix(d),d._initDD=d._isExternal=d._temporaryRemoved=!0):(d.w=u,d.h=c,d._temporaryRemoved=!0),a._itemRemoving(d.el,!1),E.on(o,"drag",i),i(s,o,n),!1}).on(this.el,"dropout",(s,o,n)=>{let d=n?.gridstackNode||o.gridstackNode;return d&&(!d.grid||d.grid===this)&&(this._leave(o,n),this._isTemp&&this.removeAsSubGrid(d)),!1}).on(this.el,"drop",(s,o,n)=>{let d=n?.gridstackNode||o.gridstackNode;if(d?.grid===this&&!d._isExternal)return!1;let u=!!this.placeholder.parentElement,c=o!==n;this.placeholder.remove(),delete this.placeholder.gridstackNode,u&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));let l=o._gridstackNodeOrig;if(delete o._gridstackNodeOrig,u&&l?.grid&&l.grid!==this){let p=l.grid;p.engine.removeNodeFromLayoutCache(l),p.engine.removedNodes.push(l),p._triggerRemoveEvent()._triggerChangeEvent(),p.parentGridNode&&!p.engine.nodes.length&&p.opts.subGridDynamic&&p.removeAsSubGrid()}if(!d||(u&&(this.engine.cleanupNode(d),d.grid=this),delete d.grid?._isTemp,E.off(o,"drag"),n!==o?(n.remove(),o=n):o.remove(),this._removeDD(o),!u))return!1;let g=d.subGrid?.el?.gridstack;return h.copyPos(d,this._readAttr(this.placeholder)),h.removePositioningStyles(o),c&&(d.content||d.subGridOpts||a.addRemoveCB)?(delete d.el,o=this.addWidget(d)):(this._prepareElement(o,!0,d),this.el.appendChild(o),this.resizeToContentCheck(!1,d),g&&(g.parentGridNode=d),this._updateContainerHeight()),this.engine.addedNodes.push(d),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped(w(m({},s),{type:"dropped"}),l&&l.grid?l:void 0,d),!1}),this}static _itemRemoving(t,e){if(!t)return;let i=t?t.gridstackNode:void 0;!i?.grid||t.classList.contains(i.grid.opts.removableOptions.decline)||(e?i._isAboutToRemove=!0:delete i._isAboutToRemove,e?t.classList.add("grid-stack-item-removing"):t.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;let t=document.querySelector(this.opts.removable);return t?(!this.opts.staticGrid&&!E.isDroppable(t)&&E.droppable(t,this.opts.removableOptions).on(t,"dropover",(e,i)=>a._itemRemoving(i,!0)).on(t,"dropout",(e,i)=>a._itemRemoving(i,!1)),this):this}prepareDragDrop(t,e=!1){let i=t?.gridstackNode;if(!i)return;let s=i.noMove||this.opts.disableDrag,o=i.noResize||this.opts.disableResize,n=this.opts.staticGrid||s&&o;if((e||n)&&(i._initDD&&(this._removeDD(t),delete i._initDD),n&&t.classList.add("ui-draggable-disabled","ui-resizable-disabled"),!e))return this;if(!i._initDD){let d,u,c=(p,C)=>{this.triggerEvent(p,p.target),d=this.cellWidth(),u=this.getCellHeight(!0),this._onStartMoving(t,p,C,i,d,u)},l=(p,C)=>{this._dragOrResize(t,p,C,i,d,u)},g=p=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete i._moving,delete i._resizing,delete i._event,delete i._lastTried;let C=i.w!==i._orig.w,D=p.target;if(!(!D.gridstackNode||D.gridstackNode.grid!==this)){if(i.el=D,i._isAboutToRemove){let P=t.gridstackNode.grid;P._gsEventHandler[p.type]&&P._gsEventHandler[p.type](p,D),P.engine.nodes.push(i),P.removeWidget(t,!0,!0)}else h.removePositioningStyles(D),i._temporaryRemoved?(this._writePosAttr(D,i),this.engine.addNode(i)):this._writePosAttr(D,i),this.triggerEvent(p,D);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),p.type==="resizestop"&&(Number.isInteger(i.sizeToContent)&&(i.sizeToContent=i.h),this.resizeToContentCheck(C,i))}};E.draggable(t,{start:c,stop:g,drag:l}).resizable(t,{start:c,stop:g,resize:l}),i._initDD=!0}return E.draggable(t,s?"disable":"enable").resizable(t,o?"disable":"enable"),this}_onStartMoving(t,e,i,s,o,n){if(this.engine.cleanNodes().beginUpdate(s),this._writePosAttr(this.placeholder,s),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=s,s.grid?.el)this.dragTransform=h.getValuesFromTransformedElement(t);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){let d=this.placeholder.closest(".grid-stack");this.dragTransform=h.getValuesFromTransformedElement(d)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(s.el=this.placeholder,s._lastUiPosition=i.position,s._prevYPix=i.position.top,s._moving=e.type==="dragstart",s._resizing=e.type==="resizestart",delete s._lastTried,e.type==="dropover"&&s._temporaryRemoved&&(this.engine.addNode(s),s._moving=!0),this.engine.cacheRects(o,n,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),e.type==="resizestart"){let d=this.getColumn()-s.x,u=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-s.y;E.resizable(t,"option","minWidth",o*Math.min(s.minW||1,d)).resizable(t,"option","minHeight",n*Math.min(s.minH||1,u)).resizable(t,"option","maxWidth",o*Math.min(s.maxW||Number.MAX_SAFE_INTEGER,d)).resizable(t,"option","maxWidthMoveLeft",o*Math.min(s.maxW||Number.MAX_SAFE_INTEGER,s.x+s.w)).resizable(t,"option","maxHeight",n*Math.min(s.maxH||Number.MAX_SAFE_INTEGER,u)).resizable(t,"option","maxHeightMoveUp",n*Math.min(s.maxH||Number.MAX_SAFE_INTEGER,s.y+s.h))}}_dragOrResize(t,e,i,s,o,n){let d=m({},s._orig),u,c=this.opts.marginLeft,l=this.opts.marginRight,g=this.opts.marginTop,p=this.opts.marginBottom,C=Math.round(n*.1),D=Math.round(o*.1);if(c=Math.min(c,D),l=Math.min(l,D),g=Math.min(g,C),p=Math.min(p,C),e.type==="drag"){if(s._temporaryRemoved)return;let F=i.position.top-s._prevYPix;s._prevYPix=i.position.top,this.opts.draggable.scroll!==!1&&h.updateScrollPosition(t,i.position,F);let xt=i.position.left+(i.position.left>s._lastUiPosition.left?-l:c),Fe=i.position.top+(i.position.top>s._lastUiPosition.top?-p:g);d.x=Math.round(xt/o),d.y=Math.round(Fe/n);let Ge=this._extraDragRow;if(this.engine.collide(s,d)){let Et=this.getRow(),Dt=Math.max(0,d.y+s.h-Et);this.opts.maxRow&&Et+Dt>this.opts.maxRow&&(Dt=Math.max(0,this.opts.maxRow-Et)),this._extraDragRow=Dt}else this._extraDragRow=0;if(this._extraDragRow!==Ge&&this._updateContainerHeight(),s.x===d.x&&s.y===d.y)return}else if(e.type==="resize"){if(d.x<0||(h.updateScrollResize(e,t,n),d.w=Math.round((i.size.width-c)/o),d.h=Math.round((i.size.height-g)/n),s.w===d.w&&s.h===d.h)||s._lastTried&&s._lastTried.w===d.w&&s._lastTried.h===d.h)return;let F=i.position.left+c,xt=i.position.top+g;d.x=Math.round(F/o),d.y=Math.round(xt/n),u=!0}s._event=e,s._lastTried=d;let P={x:i.position.left+c,y:i.position.top+g,w:(i.size?i.size.width:s.w*o)-c-l,h:(i.size?i.size.height:s.h*n)-g-p};if(this.engine.moveNodeCheck(s,w(m({},d),{cellWidth:o,cellHeight:n,rect:P,resizing:u}))){s._lastUiPosition=i.position,this.engine.cacheRects(o,n,g,l,p,c),delete s._skipDown,u&&s.subGrid&&s.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();let F=e.target;s._sidebarOrig||this._writePosAttr(F,s),this.triggerEvent(e,F)}}triggerEvent(t,e){let i=this;for(;i.parentGridNode;)i=i.parentGridNode.grid;i._gsEventHandler[t.type]&&i._gsEventHandler[t.type](t,e)}_leave(t,e){e=e||t;let i=e.gridstackNode;if(!i||(e.style.transform=e.style.transformOrigin=null,E.off(t,"drag"),i._temporaryRemoved))return;i._temporaryRemoved=!0,this.engine.removeNode(i),i.el=i._isExternal&&e?e:t;let s=i._sidebarOrig;i._isExternal&&this.engine.cleanupNode(i),i._sidebarOrig=s,this.opts.removable===!0&&a._itemRemoving(t,!0),t._gridstackNodeOrig?(t.gridstackNode=t._gridstackNodeOrig,delete t._gridstackNodeOrig):i._isExternal&&this.engine.restoreInitial()}commit(){return Te(this,this.batchUpdate(!1),"commit","batchUpdate","5.2"),this}}return a.renderCB=(r,t)=>{r&&t?.content&&(r.textContent=t.content)},a.resizeToContentParent=".grid-stack-item-content",a.Utils=h,a.Engine=Mt,a.GDRev="12.3.2",a})();var Pe=["container"],Ve=["*"];function je(a,r){}var qe=["*",[["","empty-content",""]]],Ye=["*","[empty-content]"];function $e(a,r){a&1&&nt(0,1,["*ngIf","isEmpty"])}function Xe(a,r){}var Le=(()=>{class a{serialize(){}deserialize(t){this.widgetItem=t,t&&t.input&&Object.assign(this,t.input)}}return a.\u0275fac=function(t){return new(t||a)},a.\u0275prov=Wt({token:a,factory:a.\u0275fac}),a})(),Ae=(()=>{class a{constructor(t){this.elementRef=t,this.el._gridItemComp=this}set options(t){let e=this.el.gridstackNode?.grid;e?e.update(this.el,t):this._options=w(m({},t),{el:this.el})}get options(){return this.el.gridstackNode||this._options||{el:this.el}}get el(){return this.elementRef.nativeElement}clearOptions(){delete this._options}ngOnDestroy(){this.clearOptions(),delete this.childWidget,delete this.el._gridItemComp,delete this.container,delete this.ref}}return a.\u0275fac=function(t){return new(t||a)(kt(X))},a.\u0275cmp=M({type:a,selectors:[["gridstack-item"]],viewQuery:function(t,e){if(t&1&&et(Pe,7,Q),t&2){let i;G(i=U())&&(e.container=i.first)}},inputs:{options:"options"},ngContentSelectors:Ve,decls:5,vars:1,consts:[["container",""],[1,"grid-stack-item-content"]],template:function(t,e){t&1&&(zt(),Z(0,"div",1),Yt(1,je,0,0,"ng-template",null,0,St),nt(3),b(4),tt()),t&2&&(H(4),se(" ",e.options.content," "))},styles:["[_nghost-%COMP%]{display:block}"]}),a})(),ot=(()=>{class a{constructor(t){this.elementRef=t,this.addedCB=new S,this.changeCB=new S,this.disableCB=new S,this.dragCB=new S,this.dragStartCB=new S,this.dragStopCB=new S,this.droppedCB=new S,this.enableCB=new S,this.removedCB=new S,this.resizeCB=new S,this.resizeStartCB=new S,this.resizeStopCB=new S,I.addRemoveCB||(I.addRemoveCB=Qe),I.saveCB||(I.saveCB=Ke),I.updateCB||(I.updateCB=Je),this.el._gridComp=this}set options(t){this._grid?this._grid.updateOptions(t):this._options=t}get options(){return this._grid?.opts||this._options||{}}get el(){return this.elementRef.nativeElement}get grid(){return this._grid}static addComponentToSelectorType(t){t.forEach(e=>a.selectorToType[a.getSelector(e)]=e)}static getSelector(t){return le(t).selector}ngOnInit(){this.loaded=!!this.options?.children?.length,this._grid=I.init(this._options,this.el),delete this._options,this.checkEmpty()}ngAfterContentInit(){this._sub=this.gridstackItems?.changes.subscribe(()=>this.updateAll()),this.loaded||this.updateAll(),this.hookEvents(this.grid)}ngOnDestroy(){this.unhookEvents(this._grid),this._sub?.unsubscribe(),this._grid?.destroy(),delete this._grid,delete this.el._gridComp,delete this.container,delete this.ref}updateAll(){if(!this.grid)return;let t=[];this.gridstackItems?.forEach(e=>{t.push(e.options),e.clearOptions()}),this.grid.load(t)}checkEmpty(){this.grid&&(this.isEmpty=!this.grid.engine.nodes.length)}hookEvents(t){t&&(t.parentGridNode||t.on("added",(e,i)=>{(i[0].grid?.el._gridComp||this).checkEmpty(),this.addedCB.emit({event:e,nodes:i})}).on("change",(e,i)=>this.changeCB.emit({event:e,nodes:i})).on("disable",e=>this.disableCB.emit({event:e})).on("drag",(e,i)=>this.dragCB.emit({event:e,el:i})).on("dragstart",(e,i)=>this.dragStartCB.emit({event:e,el:i})).on("dragstop",(e,i)=>this.dragStopCB.emit({event:e,el:i})).on("dropped",(e,i,s)=>this.droppedCB.emit({event:e,previousNode:i,newNode:s})).on("enable",e=>this.enableCB.emit({event:e})).on("removed",(e,i)=>{(i[0].grid?.el._gridComp||this).checkEmpty(),this.removedCB.emit({event:e,nodes:i})}).on("resize",(e,i)=>this.resizeCB.emit({event:e,el:i})).on("resizestart",(e,i)=>this.resizeStartCB.emit({event:e,el:i})).on("resizestop",(e,i)=>this.resizeStopCB.emit({event:e,el:i})))}unhookEvents(t){t&&(t.parentGridNode||t.off("added change disable drag dragstart dragstop dropped enable removed resize resizestart resizestop"))}}return a.selectorToType={},a.\u0275fac=function(t){return new(t||a)(kt(X))},a.\u0275cmp=M({type:a,selectors:[["gridstack"]],contentQueries:function(t,e,i){if(t&1&&Zt(i,Ae,4),t&2){let s;G(s=U())&&(e.gridstackItems=s)}},viewQuery:function(t,e){if(t&1&&et(Pe,7,Q),t&2){let i;G(i=U())&&(e.container=i.first)}},inputs:{options:"options",isEmpty:"isEmpty"},outputs:{addedCB:"addedCB",changeCB:"changeCB",disableCB:"disableCB",dragCB:"dragCB",dragStartCB:"dragStartCB",dragStopCB:"dragStopCB",droppedCB:"droppedCB",enableCB:"enableCB",removedCB:"removedCB",resizeCB:"resizeCB",resizeStartCB:"resizeStartCB",resizeStopCB:"resizeStopCB"},ngContentSelectors:Ye,decls:4,vars:1,consts:[["container",""],[4,"ngIf"]],template:function(t,e){t&1&&(zt(qe),qt(0,$e,1,0,"ng-content",1)(1,Xe,0,0,"ng-template",null,0,St),nt(3)),t&2&&N("ngIf",e.isEmpty)},dependencies:[he],styles:["[_nghost-%COMP%]{display:block}"]}),a})();function Qe(a,r,t,e){if(t){if(!a)return;if(e){let i=a.parentElement?._gridItemComp;if(!i)return;let o=(i.childWidget?.container||i.container)?.createComponent(ot),n=o?.instance;return n?(n.ref=o,n.options=r,n.el):void 0}else{let s=a._gridComp?.container?.createComponent(Ae),o=s?.instance;if(!o)return;o.ref=s;let n=r.selector,d=n?ot.selectorToType[n]:void 0;if(d){let u=()=>{let l=o.container?.createComponent(d)?.instance;l&&typeof l.serialize=="function"&&typeof l.deserialize=="function"&&(o.childWidget=l,l.deserialize(r))};r.lazyLoad||r.grid?.opts?.lazyLoad&&r.lazyLoad!==!1?r.visibleObservable||(r.visibleObservable=new IntersectionObserver(([l])=>{l.isIntersecting&&(r.visibleObservable?.disconnect(),delete r.visibleObservable,u())}),window.setTimeout(()=>r.visibleObservable?.observe(o.el))):u()}return o.el}}else if(e){let i=r.el?._gridComp;i?.ref?i.ref.destroy():i?.ngOnDestroy()}else{let i=r.el?._gridItemComp;i?.ref?i.ref.destroy():i?.ngOnDestroy()}}function Ke(a,r){let t=a.el?._gridItemComp;if(t){let i=t.childWidget?.serialize();i&&(r.input=i);return}let e=a.el?._gridComp}function Je(a){let r=a,t=a.el?._gridItemComp;t?.childWidget&&r.input&&t.childWidget.deserialize(r)}var W=(function(a){return a[a.State=0]="State",a[a.Transition=1]="Transition",a[a.Sequence=2]="Sequence",a[a.Group=3]="Group",a[a.Animate=4]="Animate",a[a.Keyframes=5]="Keyframes",a[a.Style=6]="Style",a[a.Trigger=7]="Trigger",a[a.Reference=8]="Reference",a[a.AnimateChild=9]="AnimateChild",a[a.AnimateRef=10]="AnimateRef",a[a.Query=11]="Query",a[a.Stagger=12]="Stagger",a})(W||{}),Ze="*";function Bt(a,r){return{type:W.Trigger,name:a,definitions:r,options:{}}}function Ct(a,r=null){return{type:W.Animate,styles:r,timings:a}}function Ss(a,r=null){return{type:W.Sequence,steps:a,options:r}}function $(a){return{type:W.Style,styles:a,offset:null}}function It(a,r,t=null){return{type:W.Transition,expr:a,animation:r,options:t}}var Lt=class{_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_originalOnDoneFns=[];_originalOnStartFns=[];_started=!1;_destroyed=!1;_finished=!1;_position=0;parentPlayer=null;totalTime;constructor(r=0,t=0){this.totalTime=r+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(r=>r()),this._onDoneFns=[])}onStart(r){this._originalOnStartFns.push(r),this._onStartFns.push(r)}onDone(r){this._originalOnDoneFns.push(r),this._onDoneFns.push(r)}onDestroy(r){this._onDestroyFns.push(r)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(r=>r()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(r=>r()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(r){this._position=this.totalTime?r*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(r){let t=r=="start"?this._onStartFns:this._onDoneFns;t.forEach(e=>e()),t.length=0}},At=class{_onDoneFns=[];_onStartFns=[];_finished=!1;_started=!1;_destroyed=!1;_onDestroyFns=[];parentPlayer=null;totalTime=0;players;constructor(r){this.players=r;let t=0,e=0,i=0,s=this.players.length;s==0?queueMicrotask(()=>this._onFinish()):this.players.forEach(o=>{o.onDone(()=>{++t==s&&this._onFinish()}),o.onDestroy(()=>{++e==s&&this._onDestroy()}),o.onStart(()=>{++i==s&&this._onStart()})}),this.totalTime=this.players.reduce((o,n)=>Math.max(o,n.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(r=>r()),this._onDoneFns=[])}init(){this.players.forEach(r=>r.init())}onStart(r){this._onStartFns.push(r)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(r=>r()),this._onStartFns=[])}onDone(r){this._onDoneFns.push(r)}onDestroy(r){this._onDestroyFns.push(r)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(r=>r.play())}pause(){this.players.forEach(r=>r.pause())}restart(){this.players.forEach(r=>r.restart())}finish(){this._onFinish(),this.players.forEach(r=>r.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(r=>r.destroy()),this._onDestroyFns.forEach(r=>r()),this._onDestroyFns=[])}reset(){this.players.forEach(r=>r.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(r){let t=r*this.totalTime;this.players.forEach(e=>{let i=e.totalTime?Math.min(1,t/e.totalTime):1;e.setPosition(i)})}getPosition(){let r=this.players.reduce((t,e)=>t===null||e.totalTime>t.totalTime?e:t,null);return r!=null?r.getPosition():0}beforeDestroy(){this.players.forEach(r=>{r.beforeDestroy&&r.beforeDestroy()})}triggerCallback(r){let t=r=="start"?this._onStartFns:this._onDoneFns;t.forEach(e=>e()),t.length=0}},ti="!";var ei=(a,r)=>r.id;function ii(a,r){if(a&1&&Kt(0,"div",4),a&2){let t=r.$index;L();let e=ne(0);at("background-color",e===t?"var(--mat-sys-on-surface)":"var(--mat-sys-inverse-on-surface)")}}var Be=(()=>{class a{activePage=Tt();dashboards=Tt();static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["dashboard-scroller"]],inputs:{activePage:[1,"activePage"],dashboards:[1,"dashboards"]},decls:7,vars:4,consts:[[1,"page-scroll-title","page-scroll-container"],[1,"page-label"],[1,"page-scroll-page-number","page-scroll-container"],[1,"page-marker",3,"background-color"],[1,"page-marker"]],template:function(e,i){if(e&1&&(re(0),Z(1,"div",0)(2,"span",1),b(3),tt()(),Z(4,"div",2),$t(5,ii,1,2,"div",3,ei),tt()),e&2){let s=i.dashboards(),o=oe(i.activePage());H(),N("@fadeInOut",o),H(2),ie(s[o].name),H(),N("@fadeInOut",o),H(),Xt(s)}},styles:["[_nghost-%COMP%]{pointer-events:none}.page-scroll-title[_ngcontent-%COMP%]{position:absolute;top:50%;right:54px;transform:translateY(-50%);z-index:100;cursor:default;text-align:center;padding:10px;color:var(--mat-sys-inverse-surface)}.page-scroll-page-number[_ngcontent-%COMP%]{position:absolute;top:50%;right:15px;transform:translateY(-50%);z-index:100;cursor:default;display:grid;padding:0}.page-scroll-container[_ngcontent-%COMP%]{opacity:0;background-color:var(--mat-sys-tertiary-fixed-dim);border-radius:10px;border:1px solid var(--mat-sys-inverse-surface)}.page-label[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface);text-shadow:1px 1px 0 var(--mat-sys-outline),-1px 1px 0 var(--mat-sys-outline),-1px -1px 0 var(--mat-sys-outline),1px -1px 0 var(--mat-sys-outline);font-size:x-large}.page-marker[_ngcontent-%COMP%]{height:20px;width:20px;margin:4px;border-radius:50%;border:1px solid var(--mat-sys-outline)}"],data:{animation:[Bt("fadeInOut",[It(":increment, :decrement",[$({opacity:0}),Ct(100,$({opacity:1})),$({opacity:1}),Ct("250ms 1000ms",$({opacity:0}))])])]}})}return a})();function ri(a,r){if(a&1){let t=A();_(0,"button",0),T("click",function(){R(t);let i=L();return k(i.clickAction("cancel"))}),_(1,"mat-icon",1),b(2,"close"),y(),_(3,"span"),b(4,"Close"),y()()}}var Ie=(()=>{class a{_bottomSheetRef=v(xe);data=v(Ce);showCancel=!!(this.data&&this.data.showCancel);clickAction(t){this._bottomSheetRef.dismiss(t)}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["widget-host-bottom-sheet"]],decls:12,vars:1,consts:[["mat-list-item","",3,"click"],["matListItemIcon",""],["mat-list-item",""]],template:function(e,i){e&1&&(_(0,"mat-action-list")(1,"button",0),T("click",function(){return i.clickAction("duplicate")}),_(2,"mat-icon",1),b(3,"content_copy"),y(),_(4,"span"),b(5,"Duplicate"),y()(),_(6,"button",0),T("click",function(){return i.clickAction("delete")}),_(7,"mat-icon",1),b(8,"delete_forever"),y(),_(9,"span"),b(10,"Delete"),y()(),K(11,ri,5,0,"button",2),y()),e&2&&(H(11),J(i.showCancel?11:-1))},dependencies:[Se,ke,ze,Re,ct,ht],encapsulation:2})}return a})();var oi=["childOutlet"],We=(()=>{class a extends Le{widgetProperties;outlet;_dialog=v(mt);_dashboard=v(lt);_bottomSheet=v(Ee);_streams=v(ft,{optional:!0});_meta=v(pt,{optional:!0});_runtime=v(gt,{optional:!0});_widgetService=v(ve);_app=v(ut);theme=ce(this._app.cssThemeColorRoles$,{requireSync:!0});childRef;compType;_hasInitialized=!1;_sheetOpen=!1;_optionsOpen=!1;isDebugEnabled(){try{return typeof localStorage<"u"&&localStorage.getItem("kip:gesturesDebug")==="1"}catch{return!1}}debug(...t){this.isDebugEnabled()&&console.debug("[Host2]",...t)}constructor(){super(),st(()=>{let t=this.theme();this.childRef&&it(()=>{this.childRef.setInput("theme",t)})}),st(()=>{let t=this._dashboard.layoutEditCanceled();!this._hasInitialized||!t||it(()=>{this.reinitFromSavedConfig()})})}ngOnInit(){let t=this.widgetProperties.type;if(!t)return;this.compType=this._widgetService.getComponentType(t);let e=this.getDefaultConfig();this._runtime?.initialize?.(e,this.widgetProperties.config);let i=this._runtime?.options();i&&(this.widgetProperties.config=i),this._streams?.applyStreamsConfigDiff?.(i),this._meta?.applyMetaConfigDiff?.(i),this.outlet&&this.compType&&(this.childRef=this.outlet.createComponent(this.compType),this.childRef.setInput("id",this.widgetProperties.uuid),this.childRef.setInput("type",this.widgetProperties.type),this.childRef.setInput("theme",this.theme())),this._hasInitialized=!0}serialize(){let t=this._runtime?.options();return t?this.widgetProperties.config=t:this.widgetProperties.config||(this.widgetProperties.config={}),{widgetProperties:this.widgetProperties}}applyRuntimeConfig(t){t&&this._runtime?.setRuntimeConfig?.(t);let e=this._runtime.options();e&&(this.widgetProperties.config=e),this._streams?.applyStreamsConfigDiff?.(e),this._meta?.applyMetaConfigDiff?.(e)}reinitFromSavedConfig(){try{let t=this.getSavedConfigForSelf(),e=this.getDefaultConfig();this._runtime?.initialize?.(e,rt(t));let i=this._runtime?.options();i&&(this.widgetProperties.config=i),this._streams?.applyStreamsConfigDiff?.(i),this._meta?.applyMetaConfigDiff?.(i)}catch{}}getSavedConfigForSelf(){try{let t=this._dashboard.dashboards(),e=this._dashboard.activeDashboard(),o=(t?.[e]?.configuration??[]).find(n=>n?.id===this.widgetProperties.uuid);return o?.input?.widgetProperties?.config??o?.widgetProperties?.config??void 0}catch{return}}getDefaultConfig(){let t=this.compType&&this.compType.DEFAULT_CONFIG;if(!t&&this.compType&&this.outlet){let e=this.outlet.createComponent(this.compType);t=e.instance.defaultConfig,e.destroy()}return t}openWidgetOptions(t){if(t.stopPropagation(),this.debug("openWidgetOptions invoked",{widgetId:this.widgetProperties?.uuid,static:this._dashboard.isDashboardStatic()}),!this._dashboard.isDashboardStatic()){if(this._optionsOpen){this.debug("options already open; ignoring");return}if(this._optionsOpen=!0,!this.widgetProperties)return;this._dialog.openWidgetOptions({title:"Widget Options",config:this.widgetProperties.config,confirmBtnText:"Save",cancelBtnText:"Cancel"}).afterClosed().subscribe(e=>{this._optionsOpen=!1,e&&(this.debug("options saved",{widgetId:this.widgetProperties?.uuid}),this.applyRuntimeConfig(e))})}}openBottomSheet(t){if(t.stopPropagation(),this.debug("openBottomSheet invoked",{widgetId:this.widgetProperties?.uuid,static:this._dashboard.isDashboardStatic()}),!this._dashboard.isDashboardStatic()){if(this._sheetOpen){this.debug("sheet already open; ignoring");return}this._sheetOpen=!0;let e=typeof navigator<"u"&&/Linux/.test(navigator.platform)&&/Firefox/.test(navigator.userAgent);this._bottomSheet.open(Ie,e?{disableClose:!0,data:{showCancel:!0}}:{}).afterDismissed().subscribe(s=>{switch(this._sheetOpen=!1,this.debug("bottom sheet dismissed",{widgetId:this.widgetProperties?.uuid,action:s}),s){case"delete":this._dashboard.deleteWidget(this.widgetProperties.uuid);break;case"duplicate":this._dashboard.duplicateWidget(this.widgetProperties.uuid);break;default:break}})}}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["widget-host2"]],viewQuery:function(e,i){if(e&1&&et(oi,7,Q),e&2){let s;G(s=U())&&(i.outlet=s.first)}},inputs:{widgetProperties:"widgetProperties"},features:[jt([ft,pt,gt]),Vt],decls:3,vars:3,consts:[["childOutlet",""],["kipGestures","","appearance","raised",1,"widget-container","kip-widget-card-colors",3,"doubletap","press","mode"]],template:function(e,i){if(e&1){let s=A();_(0,"mat-card",1),T("doubletap",function(n){return R(s),k(i.openWidgetOptions(n))})("press",function(n){return R(s),k(i.openBottomSheet(n))}),Jt(1,null,0),y()}e&2&&(at("border",i._dashboard.isDashboardStatic()?"1px dashed transparent":"1px dashed var(--mat-sys-outline)"),N("mode","press"))},dependencies:[ye,_e,De,dt],styles:["[_nghost-%COMP%]{width:100%;height:100%;display:block;overflow:hidden}.widget-container[_ngcontent-%COMP%]{display:block;width:100%;height:100%;margin:0;padding:0}.kip-widget-card-colors[_ngcontent-%COMP%]{background-color:var(--kip-widget-card-background-color)}"],changeDetection:0})}return a})();var ni=["grid"];function ai(a,r){a&1&&(_(0,"p",9)(1,"strong"),b(2,"Long press/click and hold anywhere"),y(),b(3," to add widgets"),y(),_(4,"mat-icon",10),b(5,"touch_app"),y())}function di(a,r){if(a&1){let t=A();_(0,"p",9),b(1,"This empty dashboard is ready to be customized."),y(),_(2,"button",11),T("click",function(){R(t);let i=L();return k(i.editDashboard())}),_(3,"mat-icon"),b(4,"lock_open"),y(),b(5," Unlock and Customize "),y()}}function li(a,r){if(a&1){let t=A();_(0,"div",7)(1,"button",12),T("click",function(){R(t);let i=L();return k(i.cancelLayoutChanges())}),_(2,"mat-icon"),b(3,"close"),y()(),_(4,"button",13),T("click",function(){R(t);let i=L();return k(i.saveLayoutChanges())}),_(5,"mat-icon"),b(6,"done"),y()()()}}function hi(a,r){if(a&1&&Qt(0,"dashboard-scroller",8),a&2){let t=L();N("activePage",t.dashboard.activeDashboard())("dashboards",t.dashboard.dashboards())}}var Wr=(()=>{class a{activatedRoute=v(ue);_app=v(ut);_dialog=v(mt);dashboard=v(lt);_destroyRef=v(Ft);_uiEvent=v(we);_dataset=v(be);_router=v(ge);_hostEl=v(X);isDashboardStatic=ae(()=>this.dashboard.isDashboardStatic());_gridstack=de.required("grid");_previousIsStaticState=!0;_suppressDrag=!1;gridOptions=Gt({column:24,margin:4,minRow:24,maxRow:24,float:!0,acceptWidgets:!1,resizable:{handles:"all"}});_boundHandleKeyDown=this.handleKeyDown.bind(this);_resizeObserver;_pendingResizeRaf=null;_lastContainerHeight=0;_lastCellHeight=0;_hasLoadedInitialDashboard=!1;constructor(){ot.addComponentToSelectorType([We]),st(()=>{let t=this.dashboard.isDashboardStatic();it(()=>{if(this._previousIsStaticState!==t){this._previousIsStaticState=t;try{this._gridstack().grid.setStatic(t)}catch{}}})})}ngAfterViewInit(){this._gridstack().grid?.setStatic(this._previousIsStaticState),this.resizeGridColumns(),this.setupResizeObserver(),this._uiEvent.addHotkeyListener(this._boundHandleKeyDown,{ctrlKey:!0,keys:["arrowdown","arrowup"]});try{let t=this._gridstack().grid;t&&typeof t.on=="function"&&(t.on("dragstart",()=>{this._uiEvent.isDragging.set(!0)}),t.on("dragstop",()=>{setTimeout(()=>this._uiEvent.isDragging.set(!1),0)}),t.on("resizestart",()=>{this._uiEvent.isDragging.set(!0)}),t.on("resizestop",()=>{setTimeout(()=>this._uiEvent.isDragging.set(!1),0)}))}catch{}this.dashboard.widgetAction$.pipe(Ot(this._destroyRef)).subscribe(t=>{t&&this._gridstack().grid.getGridItems().forEach(e=>{if(e.gridstackNode.id===t.id)switch(t.operation){case"delete":this.deleteWidget(e);break;case"duplicate":this.duplicateWidget(e);break;default:break}})}),this.activatedRoute.params.pipe(Ot(this._destroyRef)).subscribe(t=>{let e=t.id,i=Number(e);if(!(e!==void 0&&e!==""&&!isNaN(i))||i<0||i>=this.dashboard.dashboards().length)return;let o=this.dashboard.activeDashboard();(!this._hasLoadedInitialDashboard||i!==o)&&(i!==o&&this.dashboard.setActiveDashboard(i),this.loadDashboard(i),this._hasLoadedInitialDashboard=!0)})}setupResizeObserver(){if(this._resizeObserver)return;let t=this._hostEl.nativeElement;try{this._resizeObserver=new ResizeObserver(()=>{this._pendingResizeRaf===null&&(this._pendingResizeRaf=requestAnimationFrame(()=>{this._pendingResizeRaf=null,this.resizeGridColumns()}))}),this._resizeObserver.observe(t)}catch{}}handleKeyDown(t){t==="arrowdown"?this.previousDashboard():t==="arrowup"&&this.nextDashboard()}resizeGridColumns(){try{let e=this._gridstack().grid;if(!e)return;let i=e,s=this._hostEl.nativeElement.clientHeight||window.innerHeight;if(s===this._lastContainerHeight&&this._lastCellHeight>0)return;let o=i.getRow?i.getRow():0;if(o>0&&i.cellHeight){let n=Number(o)||0,d=n>0?s/n:1;if(d=Math.max(1,Math.round(d*100)/100),this._lastCellHeight===d&&this._lastContainerHeight===s)return;i.cellHeight(d),i.batchUpdate&&i.commit&&(i.batchUpdate(),i.commit()),this._lastContainerHeight=s,this._lastCellHeight=d}}catch{}}loadDashboard(t){let e=rt(this.dashboard.dashboards()[t]),i=this._gridstack();if(!i?.grid){queueMicrotask(()=>this.loadDashboard(t));return}i.grid.batchUpdate(),i.grid.load(e.configuration),i.grid.commit()}saveDashboard(){let t=this._gridstack().grid.save(!1,!1)||null;this.dashboard.updateConfiguration(this.dashboard.activeDashboard(),t)}saveLayoutChanges(){this.dashboard.setStaticDashboard(!0),this.saveDashboard(),this.dashboard.notifyLayoutEditSaved()}cancelLayoutChanges(){this.loadDashboard(this.dashboard.activeDashboard()),this.dashboard.setStaticDashboard(!0),this.dashboard.notifyLayoutEditCanceled()}_addDialogOpen=!1;addNewWidget(t){if(!this.dashboard.isDashboardStatic()&&t.detail!==void 0){if(this._addDialogOpen)return;let e=t.detail||{},i=e.center?.x??e.x??0,s=e.center?.y??e.y??0,o=this._gridstack().grid.getCellFromPixel({left:i,top:s});this._gridstack().grid.isAreaEmpty(o.x,o.y,1,2)&&(this._gridstack().grid.willItFit({x:o.x,y:o.y,w:4,h:6})?(this._addDialogOpen=!0,this._dialog.openFrameDialog({title:"Add Widget",component:"select-widget"},!0).subscribe({next:d=>{if(!d||typeof d!="object")return;let u=Ht.create(),c=d,l={x:o.x,y:o.y,w:c.defaultWidth,h:c.defaultHeight,minW:c.minWidth,minH:c.minHeight,id:u,selector:"widget-host2",input:{widgetProperties:{type:c.selector,uuid:u}}};this._gridstack().grid.addWidget(l)},complete:()=>{this._addDialogOpen=!1}})):this._app.sendSnackbarNotification("Error Adding Widget: Not enough space at the selected location. Please reorganize the dashboard to free up space or choose a larger empty area.",0))}}cancelPointerSequence(){if(!this._suppressDrag){this._suppressDrag=!0;try{this._gridstack().grid.setStatic(!0)}catch{}["pointerup","mouseup","touchend"].forEach(t=>{document.dispatchEvent(new Event(t,{bubbles:!0}))})}}onPointerRelease(){if(this._suppressDrag&&(this._suppressDrag=!1,!this.dashboard.isDashboardStatic()))try{this._gridstack().grid.setStatic(!1)}catch{}}duplicateWidget(t){let e=Ht.create(),i=t.gridstackNode,s={w:i.w,h:i.h,id:e,selector:i.selector,input:{widgetProperties:{type:i.input.widgetProperties.type,uuid:e,config:rt(i.input.widgetProperties.config)}}},o=this._gridstack();o.grid.willItFit(s)?o.grid.addWidget(s):(s.h=2,s.w=1,o.grid.willItFit(s)?o.grid.addWidget(s):this._app.sendSnackbarNotification("Duplication failed: Insufficient space on the dashboard. Please reorganize to free up space.",0))}deleteWidget(t){let e=t.gridstackNode;switch(this._gridstack().grid.removeWidget(t),e.selector){case"widget-numeric-chart":case"widget-windtrends-chart":{(this._dataset.list()?.filter(o=>o.uuid===e.id||o.uuid?.startsWith(`${e.id}-`))||[]).forEach(o=>this._dataset.remove(o.uuid));break}}}nextDashboard(){this.dashboard.isDashboardStatic()&&this.dashboard.navigateToNextDashboard()}previousDashboard(){this.dashboard.isDashboardStatic()&&this.dashboard.navigateToPreviousDashboard()}editDashboard(){this.dashboard.isDashboardStatic.set(!1)}navigateToHelp(){this._router.navigate(["/help"])}ngOnDestroy(){let t=this._gridstack();if(t?.grid&&t.grid.destroy(!0),this._resizeObserver){try{this._resizeObserver.disconnect()}catch{}this._resizeObserver=void 0}this._pendingResizeRaf!==null&&(cancelAnimationFrame(this._pendingResizeRaf),this._pendingResizeRaf=null),this._uiEvent.removeHotkeyListener(this._boundHandleKeyDown)}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["dashboard"]],viewQuery:function(e,i){e&1&&te(i._gridstack,ni,5),e&2&&ee()},hostBindings:function(e,i){e&1&&T("mouseup",function(){return i.onPointerRelease()},Rt)("touchend",function(){return i.onPointerRelease()},Rt)},decls:16,vars:5,consts:[["grid",""],["kipGestures","",3,"swipeup","swipedown","press","resize","mode","enableDoubleTap","options"],["empty-content","",1,"dashboard-empty-state-container"],[1,"dashboard-empty-state-action"],[1,"empty-state-icon"],[1,"empty-state-help"],["mat-button","",1,"empty-state-help-button",3,"click"],[1,"edit-layout-close-icon"],[3,"activePage","dashboards"],[1,"empty-state-text"],[1,"touch-icon"],["mat-flat-button","",1,"empty-state-button",3,"click"],["mat-fab","",1,"cancel",2,"margin-right","10px",3,"click"],["mat-fab","",1,"save",3,"click"]],template:function(e,i){if(e&1){let s=A();_(0,"gridstack",1,0),T("swipeup",function(){return R(s),k(i.previousDashboard())})("swipedown",function(){return R(s),k(i.nextDashboard())})("press",function(n){return R(s),k(i.addNewWidget(n))})("resize",function(){return R(s),k(i.resizeGridColumns())},Ut),_(2,"div",2)(3,"div",3)(4,"mat-icon",4),b(5,"dashboard"),y(),K(6,ai,6,0)(7,di,6,0),y(),_(8,"div")(9,"div",5)(10,"button",6),T("click",function(){return R(s),k(i.navigateToHelp())}),_(11,"mat-icon"),b(12,"help"),y(),b(13," Get Help "),y()()()()(),K(14,li,7,0,"div",7)(15,hi,1,2,"dashboard-scroller",8)}e&2&&(N("mode","dashboard")("enableDoubleTap",!1)("options",i.gridOptions()),H(6),J(i.dashboard.isDashboardStatic()?7:6),H(8),J(i.dashboard.isDashboardStatic()?15:14))},dependencies:[ot,Be,ct,ht,me,fe,pe,dt],styles:["[_nghost-%COMP%]{display:flex;flex-direction:row;flex-wrap:nowrap;height:100%;width:100%;overflow:hidden}.grid-stack[_ngcontent-%COMP%]{width:100%;height:100%;box-sizing:border-box;position:relative}.edit-layout-close-icon[_ngcontent-%COMP%]{position:absolute;bottom:20px;right:20px;cursor:pointer;z-index:100}.cancel[_ngcontent-%COMP%]{--mat-fab-container-color: var(--mat-sys-primary);--mat-fab-foreground-color: var(--mat-sys-background)}.save[_ngcontent-%COMP%]{--mat-fab-container-color: var(--mat-sys-primary-fixed);--mat-fab-foreground-color: var(--mat-sys-background)}.dashboard-empty-state-container[_ngcontent-%COMP%]{position:absolute;inset:0;display:flex;flex-direction:column;flex-wrap:nowrap;align-items:center;justify-content:space-around;padding:1.5rem;text-align:center;box-sizing:border-box;overflow:hidden;pointer-events:auto}@media (orientation: landscape) and (max-height: 420px){.dashboard-empty-state-container[_ngcontent-%COMP%]{padding:.75rem}.empty-state-icon[_ngcontent-%COMP%]{font-size:3.25rem;width:3.25rem;height:3.25rem}}.dashboard-empty-state-action[_ngcontent-%COMP%]{max-width:500px;color:var(--mat-sys-outline-variant)}.dashboard-empty-state-action[_ngcontent-%COMP%] .touch-icon[_ngcontent-%COMP%]{font-size:2rem;width:2rem;height:2rem;color:var(--mat-sys-outline-variant);margin-top:.5rem;animation:_ngcontent-%COMP%_bounce 2s infinite}.empty-state-icon[_ngcontent-%COMP%]{font-size:4rem;width:4rem;height:4rem;color:var(--mat-sys-outline-variant);margin-bottom:1rem}.empty-state-button[_ngcontent-%COMP%]{--mat-button-filled-label-text-color: var(--kip-widget-card-background-color);--mat-button-filled-container-color: var(--mat-sys-outline-variant);--mat-button-filled-hover-state-layer-opacity: .7;--mat-button-filled-state-layer-color: var(--mat-sys-primary-fixed-dim)}.empty-state-help-button[_ngcontent-%COMP%]{--mat-button-text-label-text-color: var(--mat-sys-outline-variant);--mat-button-text-hover-state-layer-opacity: .7;--mat-button-text-state-layer-color: var(--mat-sys-primary-fixed-dim)}.empty-state-text[_ngcontent-%COMP%]{color:var(--mat-sys-outline-variant);font-style:italic}@keyframes _ngcontent-%COMP%_bounce{0%,20%,50%,80%,to{transform:translateY(0)}40%{transform:translateY(-10px)}60%{transform:translateY(-5px)}}"]})}return a})();export{W as a,Ze as b,Ss as c,$ as d,Lt as e,At as f,ti as g,Wr as h};