homebridge-config-ui-x 5.3.1-beta.15 → 5.3.1-beta.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -0
- package/package.json +1 -1
- package/public/assets/accessory-icons/air-quality-sensor.svg +2 -1
- package/public/assets/accessory-icons/carbon-dioxide-sensor.svg +3 -0
- package/public/assets/accessory-icons/carbon-monoxide-sensor.svg +3 -0
- package/public/assets/accessory-icons/contact-sensor.svg +2 -2
- package/public/assets/accessory-icons/garage-door.svg +120 -0
- package/public/assets/accessory-icons/smoke-sensor.svg +3 -0
- package/public/{chunk-S7D4ALZN.js → chunk-2HQZ67OQ.js} +1 -1
- package/public/{chunk-AP57MUJO.js → chunk-2VLWZW76.js} +1 -1
- package/public/{chunk-LFBT3E6Q.js → chunk-32ZXAGTI.js} +1 -1
- package/public/{chunk-CJ4T7VFK.js → chunk-35KWOJ3W.js} +1 -1
- package/public/{chunk-NRGEB7MD.js → chunk-442J5F4H.js} +1 -1
- package/public/{chunk-RHCMG64A.js → chunk-4IO5CZNO.js} +1 -1
- package/public/{chunk-SFXWGUGH.js → chunk-4VQJ355N.js} +1 -1
- package/public/{chunk-5PUEZYSG.js → chunk-537TVBUE.js} +1 -1
- package/public/{chunk-VPU5FNT3.js → chunk-5SOYD2TJ.js} +1 -1
- package/public/{chunk-IHIPOL26.js → chunk-6YEG5VPB.js} +1 -1
- package/public/{chunk-TZ2WZNLU.js → chunk-7DBU6OVW.js} +1 -1
- package/public/{chunk-JF6I7OIQ.js → chunk-7KPMJHKC.js} +1 -1
- package/public/{chunk-VBU6Z36K.js → chunk-7KROOKME.js} +1 -1
- package/public/{chunk-XA56MJNX.js → chunk-7L6U3WIU.js} +1 -1
- package/public/{chunk-H337OZRD.js → chunk-AGG2PKOU.js} +1 -1
- package/public/{chunk-IMT3YYMD.js → chunk-BICPFHAC.js} +1 -1
- package/public/chunk-CL6K52WA.js +12 -0
- package/public/{chunk-2FTHA637.js → chunk-CWQ6ZSGE.js} +1 -1
- package/public/{chunk-4NVQQKF6.js → chunk-EFJZBYAC.js} +1 -1
- package/public/{chunk-DND7NHG6.js → chunk-EQKWLHLX.js} +1 -1
- package/public/{chunk-RPRM66DV.js → chunk-FLJ5YMEV.js} +1 -1
- package/public/{chunk-MG7TXSFH.js → chunk-GH4LZN3L.js} +1 -1
- package/public/{chunk-5XG7VQ47.js → chunk-GRJ4HL6F.js} +1 -1
- package/public/{chunk-DATDVPQA.js → chunk-GXDPED2U.js} +1 -1
- package/public/{chunk-TMXVEYOG.js → chunk-H7TDJHPU.js} +1 -1
- package/public/chunk-HCP4JDTX.js +1 -0
- package/public/{chunk-DGI355UK.js → chunk-HCUQAURZ.js} +1 -1
- package/public/chunk-ISU57GOB.js +1 -0
- package/public/{chunk-VAHQPEOP.js → chunk-JB2PIVXO.js} +1 -1
- package/public/{chunk-6H2RHMWN.js → chunk-JC5OT3ST.js} +1 -1
- package/public/{chunk-52HUK4K5.js → chunk-JDNZXCQR.js} +1 -1
- package/public/chunk-K66NVBDK.js +1 -0
- package/public/{chunk-5UXLX3K4.js → chunk-KAW657JE.js} +1 -1
- package/public/{chunk-S7KGSAAG.js → chunk-KEFI2IZS.js} +1 -1
- package/public/{chunk-XKRAUXJ4.js → chunk-KMNE5IJ4.js} +1 -1
- package/public/{chunk-SAJVBPRK.js → chunk-KR2T7G6K.js} +1 -1
- package/public/{chunk-S7AIVWKK.js → chunk-L6QEXIU2.js} +1 -1
- package/public/{chunk-4P3GBDMH.js → chunk-LYR2NCNY.js} +1 -1
- package/public/{chunk-QOAVPCUF.js → chunk-MB2UKSBU.js} +2 -2
- package/public/{chunk-2PNFNDVN.js → chunk-MHDGVAPB.js} +1 -1
- package/public/{chunk-6KMF4546.js → chunk-MRC6X5IO.js} +1 -1
- package/public/{chunk-EU7EG2IC.js → chunk-NFLNMOK2.js} +1 -1
- package/public/{chunk-4TPABB7T.js → chunk-NUAVF2CP.js} +1 -1
- package/public/chunk-O42H2QJE.js +1 -0
- package/public/{chunk-PN6SJAGM.js → chunk-Q4FKXY4S.js} +1 -1
- package/public/{chunk-TIGGJ65T.js → chunk-Q52SIQ5R.js} +1 -1
- package/public/{chunk-72Q5GCW2.js → chunk-QCYOHZYJ.js} +1 -1
- package/public/{chunk-25NXLXGL.js → chunk-QIW6M5VR.js} +1 -1
- package/public/{chunk-RMIHKJRQ.js → chunk-RBN4GCZA.js} +1 -1
- package/public/{chunk-AKD24HZC.js → chunk-RCWSDUTV.js} +1 -1
- package/public/{chunk-4MP3BG4E.js → chunk-RE5B22WQ.js} +1 -1
- package/public/{chunk-O4DNLPYF.js → chunk-RORN44IG.js} +1 -1
- package/public/{chunk-PBZQ6HRX.js → chunk-SGAEKK5P.js} +1 -1
- package/public/{chunk-3BSXYWZV.js → chunk-SPOOD5LQ.js} +1 -1
- package/public/{chunk-MJK6N6PA.js → chunk-SXLEIQ7L.js} +1 -1
- package/public/chunk-TIL3AXXZ.js +4 -0
- package/public/{chunk-VJDU4IQH.js → chunk-TQJBTE7A.js} +1 -1
- package/public/{chunk-XSDSGMTL.js → chunk-TW53ZKXP.js} +1 -1
- package/public/{chunk-KKMV35EJ.js → chunk-U3S5RZBK.js} +1 -1
- package/public/{chunk-UKEZ5GGN.js → chunk-UDZCOX6Z.js} +1 -1
- package/public/{chunk-6PNBMQBJ.js → chunk-V7F547CW.js} +1 -1
- package/public/{chunk-MVTK2RVI.js → chunk-VHHOM6NL.js} +1 -1
- package/public/{chunk-Z4C74VQT.js → chunk-W7HZZAPO.js} +1 -1
- package/public/{chunk-RJOGO4M5.js → chunk-WBXDUV2S.js} +1 -1
- package/public/{chunk-IUFQ2X3U.js → chunk-WE4RINXU.js} +1 -1
- package/public/{chunk-3FDQVVZK.js → chunk-XIGIXTNY.js} +2 -2
- package/public/{chunk-ACG6TSOL.js → chunk-YHOGISBN.js} +1 -1
- package/public/{chunk-QUMMVCVT.js → chunk-YNZKJLHO.js} +1 -1
- package/public/{chunk-6O7GVMNE.js → chunk-YOZ33RLE.js} +1 -1
- package/public/index.html +2 -2
- package/public/main-J26RTW73.js +1 -0
- package/public/{styles-LG2MDN7O.css → styles-LBFCTVXE.css} +1 -1
- package/public/chunk-32CFMQSA.js +0 -12
- package/public/chunk-CPAHENLQ.js +0 -1
- package/public/chunk-LMTRNI7E.js +0 -1
- package/public/chunk-SZRUPTEV.js +0 -1
- package/public/chunk-WEVBEUAJ.js +0 -4
- package/public/chunk-ZPNLQRCK.js +0 -1
- package/public/main-CPSE6QMR.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Mp}from"./chunk-TMXVEYOG.js";import{a as tl,c as Ep,d as Pp,e as Fn,f as oi,g as Xx}from"./chunk-JF6I7OIQ.js";import{a as Cp}from"./chunk-MG7TXSFH.js";import{a as $p}from"./chunk-AKD24HZC.js";import{a as kp}from"./chunk-IUFQ2X3U.js";import{a as wp,b as Ip,c as Sp}from"./chunk-H337OZRD.js";import{a as xr}from"./chunk-IMT3YYMD.js";import{a as Tp}from"./chunk-UKEZ5GGN.js";import{a as pa,b as ha}from"./chunk-RPRM66DV.js";import{a as fa,b as ma}from"./chunk-S7AIVWKK.js";import{a as xp}from"./chunk-5UXLX3K4.js";import{a as aa,b as sa,c as la,d as ua,e as ca,f as da,g as Nn,m as je,n as et,o as gp,p as _p,q as yp,r as bp,s as vp,t as Ai}from"./chunk-MJK6N6PA.js";import{A as Cr,a as lp,b as Di,c as On,e as bt,f as up,h as cp,i as dp,j as pp,k as fp,l as Ni,m as mp,o as Fi,r as Dn,s as sn,t as ln,y as hp,z as Gt}from"./chunk-VPU5FNT3.js";import{a as ji}from"./chunk-4MP3BG4E.js";import{d as ri}from"./chunk-25NXLXGL.js";import{b as Be}from"./chunk-DND7NHG6.js";import{k as we,m as qi,n as ve}from"./chunk-AP57MUJO.js";import{a as xe,b as Ve}from"./chunk-CPAHENLQ.js";import{e as sp}from"./chunk-RJOGO4M5.js";import{$a as Yd,Ac as np,Bc as rp,Ca as Pi,Cc as Te,D as Wd,Da as Xd,Dc as Kt,Ec as on,Fa as Tn,Fc as At,Gc as Mn,Hb as G,Hc as w,Ib as E,Ic as S,Jb as P,Jc as Ue,Lb as dt,M as En,Mb as pt,Nb as ft,Ob as b,Pb as f,Qb as m,Qc as mt,Rb as $,Rc as z,Sb as ea,Sc as Oi,Tb as ta,Ub as ia,Uc as op,Vb as ep,Wb as tp,Xa as he,Z as Ys,_b as H,a as X,aa as vr,ab as d,b as $e,bc as j,cc as na,dc as _,e as g,fa as Kd,fb as Qo,g as Me,ga as Tt,gb as fi,h as K,ha as Pn,hc as Qs,ib as tn,ic as Zs,id as qt,ja as Gd,jc as el,jd as an,k as Ld,ka as Jd,kc as Ti,kd as ht,la as k,lc as ki,mb as Q,mc as ip,n as Pt,nb as kn,nc as Wt,o as Xs,ob as nn,oc as Mi,pb as Qd,pc as Y,q as Ud,qc as C,ra as A,rc as U,rd as oa,sa as q,sb as ue,sc as B,tc as rn,ub as Zd,uc as ra,v as zd,vb as Zo,w as le,x as Hd,xc as Oe,yc as De,za as Yo,zc as Ne,zd as ap}from"./chunk-WEVBEUAJ.js";var Sr=g(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.regexpCode=be.getEsmExportName=be.getProperty=be.safeStringify=be.stringify=be.strConcat=be.addCodeArg=be.str=be._=be.nil=be._Code=be.Name=be.IDENTIFIER=be._CodeOrName=void 0;var wr=class{};be._CodeOrName=wr;be.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var un=class extends wr{constructor(i){if(super(),!be.IDENTIFIER.test(i))throw new Error("CodeGen: name must be a valid identifier");this.str=i}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};be.Name=un;var jt=class extends wr{constructor(i){super(),this._items=typeof i=="string"?[i]:i}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let i=this._items[0];return i===""||i==='""'}get str(){var i;return(i=this._str)!==null&&i!==void 0?i:this._str=this._items.reduce((t,n)=>`${t}${n}`,"")}get names(){var i;return(i=this._names)!==null&&i!==void 0?i:this._names=this._items.reduce((t,n)=>(n instanceof un&&(t[n.str]=(t[n.str]||0)+1),t),{})}};be._Code=jt;be.nil=new jt("");function Op(e,...i){let t=[e[0]],n=0;for(;n<i.length;)nl(t,i[n]),t.push(e[++n]);return new jt(t)}be._=Op;var il=new jt("+");function Dp(e,...i){let t=[Ir(e[0])],n=0;for(;n<i.length;)t.push(il),nl(t,i[n]),t.push(il,Ir(e[++n]));return Yx(t),new jt(t)}be.str=Dp;function nl(e,i){i instanceof jt?e.push(...i._items):i instanceof un?e.push(i):e.push(ew(i))}be.addCodeArg=nl;function Yx(e){let i=1;for(;i<e.length-1;){if(e[i]===il){let t=Qx(e[i-1],e[i+1]);if(t!==void 0){e.splice(i-1,3,t);continue}e[i++]="+"}i++}}function Qx(e,i){if(i==='""')return e;if(e==='""')return i;if(typeof e=="string")return i instanceof un||e[e.length-1]!=='"'?void 0:typeof i!="string"?`${e.slice(0,-1)}${i}"`:i[0]==='"'?e.slice(0,-1)+i.slice(1):void 0;if(typeof i=="string"&&i[0]==='"'&&!(e instanceof un))return`"${e}${i.slice(1)}`}function Zx(e,i){return i.emptyStr()?e:e.emptyStr()?i:Dp`${e}${i}`}be.strConcat=Zx;function ew(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Ir(Array.isArray(e)?e.join(","):e)}function tw(e){return new jt(Ir(e))}be.stringify=tw;function Ir(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}be.safeStringify=Ir;function iw(e){return typeof e=="string"&&be.IDENTIFIER.test(e)?new jt(`.${e}`):Op`[${e}]`}be.getProperty=iw;function nw(e){if(typeof e=="string"&&be.IDENTIFIER.test(e))return new jt(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}be.getEsmExportName=nw;function rw(e){return new jt(e.toString())}be.regexpCode=rw});var al=g(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.ValueScope=Ct.ValueScopeName=Ct.Scope=Ct.varKinds=Ct.UsedValueState=void 0;var vt=Sr(),rl=class extends Error{constructor(i){super(`CodeGen: "code" for ${i} not defined`),this.value=i.value}},ga=function(e){return e[e.Started=0]="Started",e[e.Completed=1]="Completed",e}(ga||(Ct.UsedValueState=ga={}));Ct.varKinds={const:new vt.Name("const"),let:new vt.Name("let"),var:new vt.Name("var")};var _a=class{constructor({prefixes:i,parent:t}={}){this._names={},this._prefixes=i,this._parent=t}toName(i){return i instanceof vt.Name?i:this.name(i)}name(i){return new vt.Name(this._newName(i))}_newName(i){let t=this._names[i]||this._nameGroup(i);return`${i}${t.index++}`}_nameGroup(i){var t,n;if(!((n=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||n===void 0)&&n.has(i)||this._prefixes&&!this._prefixes.has(i))throw new Error(`CodeGen: prefix "${i}" is not allowed in this scope`);return this._names[i]={prefix:i,index:0}}};Ct.Scope=_a;var ya=class extends vt.Name{constructor(i,t){super(t),this.prefix=i}setValue(i,{property:t,itemIndex:n}){this.value=i,this.scopePath=(0,vt._)`.${new vt.Name(t)}[${n}]`}};Ct.ValueScopeName=ya;var ow=(0,vt._)`\n`,ol=class extends _a{constructor(i){super(i),this._values={},this._scope=i.scope,this.opts=$e(X({},i),{_n:i.lines?ow:vt.nil})}get(){return this._scope}name(i){return new ya(i,this._newName(i))}value(i,t){var n;if(t.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let r=this.toName(i),{prefix:o}=r,a=(n=t.key)!==null&&n!==void 0?n:t.ref,s=this._values[o];if(s){let c=s.get(a);if(c)return c}else s=this._values[o]=new Map;s.set(a,r);let l=this._scope[o]||(this._scope[o]=[]),u=l.length;return l[u]=t.ref,r.setValue(t,{property:o,itemIndex:u}),r}getValue(i,t){let n=this._values[i];if(n)return n.get(t)}scopeRefs(i,t=this._values){return this._reduceValues(t,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,vt._)`${i}${n.scopePath}`})}scopeCode(i=this._values,t,n){return this._reduceValues(i,r=>{if(r.value===void 0)throw new Error(`CodeGen: name "${r}" has no value`);return r.value.code},t,n)}_reduceValues(i,t,n={},r){let o=vt.nil;for(let a in i){let s=i[a];if(!s)continue;let l=n[a]=n[a]||new Map;s.forEach(u=>{if(l.has(u))return;l.set(u,ga.Started);let c=t(u);if(c){let p=this.opts.es5?Ct.varKinds.var:Ct.varKinds.const;o=(0,vt._)`${o}${p} ${u} = ${c};${this.opts._n}`}else if(c=r?.(u))o=(0,vt._)`${o}${c}${this.opts._n}`;else throw new rl(u);l.set(u,ga.Completed)})}return o}};Ct.ValueScope=ol});var ee=g(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.or=ce.and=ce.not=ce.CodeGen=ce.operators=ce.varKinds=ce.ValueScopeName=ce.ValueScope=ce.Scope=ce.Name=ce.regexpCode=ce.stringify=ce.getProperty=ce.nil=ce.strConcat=ce.str=ce._=void 0;var ge=Sr(),Jt=al(),Vi=Sr();Object.defineProperty(ce,"_",{enumerable:!0,get:function(){return Vi._}});Object.defineProperty(ce,"str",{enumerable:!0,get:function(){return Vi.str}});Object.defineProperty(ce,"strConcat",{enumerable:!0,get:function(){return Vi.strConcat}});Object.defineProperty(ce,"nil",{enumerable:!0,get:function(){return Vi.nil}});Object.defineProperty(ce,"getProperty",{enumerable:!0,get:function(){return Vi.getProperty}});Object.defineProperty(ce,"stringify",{enumerable:!0,get:function(){return Vi.stringify}});Object.defineProperty(ce,"regexpCode",{enumerable:!0,get:function(){return Vi.regexpCode}});Object.defineProperty(ce,"Name",{enumerable:!0,get:function(){return Vi.Name}});var wa=al();Object.defineProperty(ce,"Scope",{enumerable:!0,get:function(){return wa.Scope}});Object.defineProperty(ce,"ValueScope",{enumerable:!0,get:function(){return wa.ValueScope}});Object.defineProperty(ce,"ValueScopeName",{enumerable:!0,get:function(){return wa.ValueScopeName}});Object.defineProperty(ce,"varKinds",{enumerable:!0,get:function(){return wa.varKinds}});ce.operators={GT:new ge._Code(">"),GTE:new ge._Code(">="),LT:new ge._Code("<"),LTE:new ge._Code("<="),EQ:new ge._Code("==="),NEQ:new ge._Code("!=="),NOT:new ge._Code("!"),OR:new ge._Code("||"),AND:new ge._Code("&&"),ADD:new ge._Code("+")};var mi=class{optimizeNodes(){return this}optimizeNames(i,t){return this}},sl=class extends mi{constructor(i,t,n){super(),this.varKind=i,this.name=t,this.rhs=n}render({es5:i,_n:t}){let n=i?Jt.varKinds.var:this.varKind,r=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${r};`+t}optimizeNames(i,t){if(i[this.name.str])return this.rhs&&(this.rhs=An(this.rhs,i,t)),this}get names(){return this.rhs instanceof ge._CodeOrName?this.rhs.names:{}}},va=class extends mi{constructor(i,t,n){super(),this.lhs=i,this.rhs=t,this.sideEffects=n}render({_n:i}){return`${this.lhs} = ${this.rhs};`+i}optimizeNames(i,t){if(!(this.lhs instanceof ge.Name&&!i[this.lhs.str]&&!this.sideEffects))return this.rhs=An(this.rhs,i,t),this}get names(){let i=this.lhs instanceof ge.Name?{}:X({},this.lhs.names);return xa(i,this.rhs)}},ll=class extends va{constructor(i,t,n,r){super(i,n,r),this.op=t}render({_n:i}){return`${this.lhs} ${this.op}= ${this.rhs};`+i}},ul=class extends mi{constructor(i){super(),this.label=i,this.names={}}render({_n:i}){return`${this.label}:`+i}},cl=class extends mi{constructor(i){super(),this.label=i,this.names={}}render({_n:i}){return`break${this.label?` ${this.label}`:""};`+i}},dl=class extends mi{constructor(i){super(),this.error=i}render({_n:i}){return`throw ${this.error};`+i}get names(){return this.error.names}},pl=class extends mi{constructor(i){super(),this.code=i}render({_n:i}){return`${this.code};`+i}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(i,t){return this.code=An(this.code,i,t),this}get names(){return this.code instanceof ge._CodeOrName?this.code.names:{}}},$r=class extends mi{constructor(i=[]){super(),this.nodes=i}render(i){return this.nodes.reduce((t,n)=>t+n.render(i),"")}optimizeNodes(){let{nodes:i}=this,t=i.length;for(;t--;){let n=i[t].optimizeNodes();Array.isArray(n)?i.splice(t,1,...n):n?i[t]=n:i.splice(t,1)}return i.length>0?this:void 0}optimizeNames(i,t){let{nodes:n}=this,r=n.length;for(;r--;){let o=n[r];o.optimizeNames(i,t)||(aw(i,o.names),n.splice(r,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((i,t)=>cn(i,t.names),{})}},hi=class extends $r{render(i){return"{"+i._n+super.render(i)+"}"+i._n}},fl=class extends $r{},ml=(()=>{class e extends hi{}return e.kind="else",e})(),ba=(()=>{class e extends hi{constructor(t,n){super(n),this.condition=t}render(t){let n=`if(${this.condition})`+super.render(t);return this.else&&(n+="else "+this.else.render(t)),n}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let n=this.else;if(n){let r=n.optimizeNodes();n=this.else=Array.isArray(r)?new ml(r):r}if(n)return t===!1?n instanceof e?n:n.nodes:this.nodes.length?this:new e(jp(t),n instanceof e?[n]:n.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,n){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(t,n),!!(super.optimizeNames(t,n)||this.else))return this.condition=An(this.condition,t,n),this}get names(){let t=super.names;return xa(t,this.condition),this.else&&cn(t,this.else.names),t}}return e.kind="if",e})(),Ia=(()=>{class e extends hi{}return e.kind="for",e})(),hl=class extends Ia{constructor(i){super(),this.iteration=i}render(i){return`for(${this.iteration})`+super.render(i)}optimizeNames(i,t){if(super.optimizeNames(i,t))return this.iteration=An(this.iteration,i,t),this}get names(){return cn(super.names,this.iteration.names)}},gl=class extends Ia{constructor(i,t,n,r){super(),this.varKind=i,this.name=t,this.from=n,this.to=r}render(i){let t=i.es5?Jt.varKinds.var:this.varKind,{name:n,from:r,to:o}=this;return`for(${t} ${n}=${r}; ${n}<${o}; ${n}++)`+super.render(i)}get names(){let i=xa(super.names,this.from);return xa(i,this.to)}},Ca=class extends Ia{constructor(i,t,n,r){super(),this.loop=i,this.varKind=t,this.name=n,this.iterable=r}render(i){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(i)}optimizeNames(i,t){if(super.optimizeNames(i,t))return this.iterable=An(this.iterable,i,t),this}get names(){return cn(super.names,this.iterable.names)}},Np=(()=>{class e extends hi{constructor(t,n,r){super(),this.name=t,this.args=n,this.async=r}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}}return e.kind="func",e})(),Fp=(()=>{class e extends $r{render(t){return"return "+super.render(t)}}return e.kind="return",e})(),_l=class extends hi{render(i){let t="try"+super.render(i);return this.catch&&(t+=this.catch.render(i)),this.finally&&(t+=this.finally.render(i)),t}optimizeNodes(){var i,t;return super.optimizeNodes(),(i=this.catch)===null||i===void 0||i.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(i,t){var n,r;return super.optimizeNames(i,t),(n=this.catch)===null||n===void 0||n.optimizeNames(i,t),(r=this.finally)===null||r===void 0||r.optimizeNames(i,t),this}get names(){let i=super.names;return this.catch&&cn(i,this.catch.names),this.finally&&cn(i,this.finally.names),i}},Ap=(()=>{class e extends hi{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}}return e.kind="catch",e})(),qp=(()=>{class e extends hi{render(t){return"finally"+super.render(t)}}return e.kind="finally",e})(),yl=class{constructor(i,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts=$e(X({},t),{_n:t.lines?`
|
|
1
|
+
import{a as Mp}from"./chunk-H7TDJHPU.js";import{a as tl,c as Ep,d as Pp,e as Fn,f as oi,g as Xx}from"./chunk-7KPMJHKC.js";import{a as Cp}from"./chunk-GH4LZN3L.js";import{a as $p}from"./chunk-RCWSDUTV.js";import{a as kp}from"./chunk-WE4RINXU.js";import{a as wp,b as Ip,c as Sp}from"./chunk-AGG2PKOU.js";import{a as xr}from"./chunk-BICPFHAC.js";import{a as Tp}from"./chunk-UDZCOX6Z.js";import{a as pa,b as ha}from"./chunk-FLJ5YMEV.js";import{a as fa,b as ma}from"./chunk-L6QEXIU2.js";import{a as xp}from"./chunk-KAW657JE.js";import{a as aa,b as sa,c as la,d as ua,e as ca,f as da,g as Nn,m as je,n as et,o as gp,p as _p,q as yp,r as bp,s as vp,t as Ai}from"./chunk-SXLEIQ7L.js";import{A as Cr,a as lp,b as Di,c as On,e as bt,f as up,h as cp,i as dp,j as pp,k as fp,l as Ni,m as mp,o as Fi,r as Dn,s as sn,t as ln,y as hp,z as Gt}from"./chunk-5SOYD2TJ.js";import{a as ji}from"./chunk-RE5B22WQ.js";import{d as ri}from"./chunk-QIW6M5VR.js";import{b as Be}from"./chunk-EQKWLHLX.js";import{k as we,m as qi,n as ve}from"./chunk-2VLWZW76.js";import{a as xe,b as Ve}from"./chunk-HCP4JDTX.js";import{e as sp}from"./chunk-WBXDUV2S.js";import{$a as Yd,Ac as np,Ad as ap,Bc as rp,Ca as Pi,Cc as Te,D as Wd,Da as Xd,Dc as Kt,Ec as on,Fa as Tn,Fc as At,Gc as Mn,Hb as G,Ib as E,Ic as w,Jb as P,Jc as S,Kc as Ue,Lb as dt,M as En,Mb as pt,Nb as ft,Ob as b,Pb as f,Qb as m,Rb as $,Rc as mt,Sb as ea,Sc as z,Tb as ta,Tc as Oi,Ub as ia,Vb as ep,Vc as op,Wb as tp,Xa as he,Z as Ys,_b as H,a as X,aa as vr,ab as d,b as $e,bc as j,cc as na,dc as _,e as g,fa as Kd,fb as Qo,g as Me,ga as Tt,gb as fi,h as K,ha as Pn,hc as Qs,ib as tn,ic as Zs,ja as Gd,jc as el,jd as qt,k as Ld,ka as Jd,kc as Ti,kd as an,la as k,lc as ki,ld as ht,mb as Q,mc as ip,n as Pt,nb as kn,nc as Wt,o as Xs,ob as nn,oc as Mi,pb as Qd,pc as Y,q as Ud,qc as C,ra as A,rc as U,sa as q,sb as ue,sc as B,sd as oa,tc as rn,ub as Zd,uc as ra,v as zd,vb as Zo,w as le,x as Hd,xc as Oe,yc as De,za as Yo,zc as Ne}from"./chunk-TIL3AXXZ.js";var Sr=g(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.regexpCode=be.getEsmExportName=be.getProperty=be.safeStringify=be.stringify=be.strConcat=be.addCodeArg=be.str=be._=be.nil=be._Code=be.Name=be.IDENTIFIER=be._CodeOrName=void 0;var wr=class{};be._CodeOrName=wr;be.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var un=class extends wr{constructor(i){if(super(),!be.IDENTIFIER.test(i))throw new Error("CodeGen: name must be a valid identifier");this.str=i}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};be.Name=un;var jt=class extends wr{constructor(i){super(),this._items=typeof i=="string"?[i]:i}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let i=this._items[0];return i===""||i==='""'}get str(){var i;return(i=this._str)!==null&&i!==void 0?i:this._str=this._items.reduce((t,n)=>`${t}${n}`,"")}get names(){var i;return(i=this._names)!==null&&i!==void 0?i:this._names=this._items.reduce((t,n)=>(n instanceof un&&(t[n.str]=(t[n.str]||0)+1),t),{})}};be._Code=jt;be.nil=new jt("");function Op(e,...i){let t=[e[0]],n=0;for(;n<i.length;)nl(t,i[n]),t.push(e[++n]);return new jt(t)}be._=Op;var il=new jt("+");function Dp(e,...i){let t=[Ir(e[0])],n=0;for(;n<i.length;)t.push(il),nl(t,i[n]),t.push(il,Ir(e[++n]));return Yx(t),new jt(t)}be.str=Dp;function nl(e,i){i instanceof jt?e.push(...i._items):i instanceof un?e.push(i):e.push(ew(i))}be.addCodeArg=nl;function Yx(e){let i=1;for(;i<e.length-1;){if(e[i]===il){let t=Qx(e[i-1],e[i+1]);if(t!==void 0){e.splice(i-1,3,t);continue}e[i++]="+"}i++}}function Qx(e,i){if(i==='""')return e;if(e==='""')return i;if(typeof e=="string")return i instanceof un||e[e.length-1]!=='"'?void 0:typeof i!="string"?`${e.slice(0,-1)}${i}"`:i[0]==='"'?e.slice(0,-1)+i.slice(1):void 0;if(typeof i=="string"&&i[0]==='"'&&!(e instanceof un))return`"${e}${i.slice(1)}`}function Zx(e,i){return i.emptyStr()?e:e.emptyStr()?i:Dp`${e}${i}`}be.strConcat=Zx;function ew(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Ir(Array.isArray(e)?e.join(","):e)}function tw(e){return new jt(Ir(e))}be.stringify=tw;function Ir(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}be.safeStringify=Ir;function iw(e){return typeof e=="string"&&be.IDENTIFIER.test(e)?new jt(`.${e}`):Op`[${e}]`}be.getProperty=iw;function nw(e){if(typeof e=="string"&&be.IDENTIFIER.test(e))return new jt(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}be.getEsmExportName=nw;function rw(e){return new jt(e.toString())}be.regexpCode=rw});var al=g(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.ValueScope=Ct.ValueScopeName=Ct.Scope=Ct.varKinds=Ct.UsedValueState=void 0;var vt=Sr(),rl=class extends Error{constructor(i){super(`CodeGen: "code" for ${i} not defined`),this.value=i.value}},ga=function(e){return e[e.Started=0]="Started",e[e.Completed=1]="Completed",e}(ga||(Ct.UsedValueState=ga={}));Ct.varKinds={const:new vt.Name("const"),let:new vt.Name("let"),var:new vt.Name("var")};var _a=class{constructor({prefixes:i,parent:t}={}){this._names={},this._prefixes=i,this._parent=t}toName(i){return i instanceof vt.Name?i:this.name(i)}name(i){return new vt.Name(this._newName(i))}_newName(i){let t=this._names[i]||this._nameGroup(i);return`${i}${t.index++}`}_nameGroup(i){var t,n;if(!((n=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||n===void 0)&&n.has(i)||this._prefixes&&!this._prefixes.has(i))throw new Error(`CodeGen: prefix "${i}" is not allowed in this scope`);return this._names[i]={prefix:i,index:0}}};Ct.Scope=_a;var ya=class extends vt.Name{constructor(i,t){super(t),this.prefix=i}setValue(i,{property:t,itemIndex:n}){this.value=i,this.scopePath=(0,vt._)`.${new vt.Name(t)}[${n}]`}};Ct.ValueScopeName=ya;var ow=(0,vt._)`\n`,ol=class extends _a{constructor(i){super(i),this._values={},this._scope=i.scope,this.opts=$e(X({},i),{_n:i.lines?ow:vt.nil})}get(){return this._scope}name(i){return new ya(i,this._newName(i))}value(i,t){var n;if(t.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let r=this.toName(i),{prefix:o}=r,a=(n=t.key)!==null&&n!==void 0?n:t.ref,s=this._values[o];if(s){let c=s.get(a);if(c)return c}else s=this._values[o]=new Map;s.set(a,r);let l=this._scope[o]||(this._scope[o]=[]),u=l.length;return l[u]=t.ref,r.setValue(t,{property:o,itemIndex:u}),r}getValue(i,t){let n=this._values[i];if(n)return n.get(t)}scopeRefs(i,t=this._values){return this._reduceValues(t,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,vt._)`${i}${n.scopePath}`})}scopeCode(i=this._values,t,n){return this._reduceValues(i,r=>{if(r.value===void 0)throw new Error(`CodeGen: name "${r}" has no value`);return r.value.code},t,n)}_reduceValues(i,t,n={},r){let o=vt.nil;for(let a in i){let s=i[a];if(!s)continue;let l=n[a]=n[a]||new Map;s.forEach(u=>{if(l.has(u))return;l.set(u,ga.Started);let c=t(u);if(c){let p=this.opts.es5?Ct.varKinds.var:Ct.varKinds.const;o=(0,vt._)`${o}${p} ${u} = ${c};${this.opts._n}`}else if(c=r?.(u))o=(0,vt._)`${o}${c}${this.opts._n}`;else throw new rl(u);l.set(u,ga.Completed)})}return o}};Ct.ValueScope=ol});var ee=g(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.or=ce.and=ce.not=ce.CodeGen=ce.operators=ce.varKinds=ce.ValueScopeName=ce.ValueScope=ce.Scope=ce.Name=ce.regexpCode=ce.stringify=ce.getProperty=ce.nil=ce.strConcat=ce.str=ce._=void 0;var ge=Sr(),Jt=al(),Vi=Sr();Object.defineProperty(ce,"_",{enumerable:!0,get:function(){return Vi._}});Object.defineProperty(ce,"str",{enumerable:!0,get:function(){return Vi.str}});Object.defineProperty(ce,"strConcat",{enumerable:!0,get:function(){return Vi.strConcat}});Object.defineProperty(ce,"nil",{enumerable:!0,get:function(){return Vi.nil}});Object.defineProperty(ce,"getProperty",{enumerable:!0,get:function(){return Vi.getProperty}});Object.defineProperty(ce,"stringify",{enumerable:!0,get:function(){return Vi.stringify}});Object.defineProperty(ce,"regexpCode",{enumerable:!0,get:function(){return Vi.regexpCode}});Object.defineProperty(ce,"Name",{enumerable:!0,get:function(){return Vi.Name}});var wa=al();Object.defineProperty(ce,"Scope",{enumerable:!0,get:function(){return wa.Scope}});Object.defineProperty(ce,"ValueScope",{enumerable:!0,get:function(){return wa.ValueScope}});Object.defineProperty(ce,"ValueScopeName",{enumerable:!0,get:function(){return wa.ValueScopeName}});Object.defineProperty(ce,"varKinds",{enumerable:!0,get:function(){return wa.varKinds}});ce.operators={GT:new ge._Code(">"),GTE:new ge._Code(">="),LT:new ge._Code("<"),LTE:new ge._Code("<="),EQ:new ge._Code("==="),NEQ:new ge._Code("!=="),NOT:new ge._Code("!"),OR:new ge._Code("||"),AND:new ge._Code("&&"),ADD:new ge._Code("+")};var mi=class{optimizeNodes(){return this}optimizeNames(i,t){return this}},sl=class extends mi{constructor(i,t,n){super(),this.varKind=i,this.name=t,this.rhs=n}render({es5:i,_n:t}){let n=i?Jt.varKinds.var:this.varKind,r=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${r};`+t}optimizeNames(i,t){if(i[this.name.str])return this.rhs&&(this.rhs=An(this.rhs,i,t)),this}get names(){return this.rhs instanceof ge._CodeOrName?this.rhs.names:{}}},va=class extends mi{constructor(i,t,n){super(),this.lhs=i,this.rhs=t,this.sideEffects=n}render({_n:i}){return`${this.lhs} = ${this.rhs};`+i}optimizeNames(i,t){if(!(this.lhs instanceof ge.Name&&!i[this.lhs.str]&&!this.sideEffects))return this.rhs=An(this.rhs,i,t),this}get names(){let i=this.lhs instanceof ge.Name?{}:X({},this.lhs.names);return xa(i,this.rhs)}},ll=class extends va{constructor(i,t,n,r){super(i,n,r),this.op=t}render({_n:i}){return`${this.lhs} ${this.op}= ${this.rhs};`+i}},ul=class extends mi{constructor(i){super(),this.label=i,this.names={}}render({_n:i}){return`${this.label}:`+i}},cl=class extends mi{constructor(i){super(),this.label=i,this.names={}}render({_n:i}){return`break${this.label?` ${this.label}`:""};`+i}},dl=class extends mi{constructor(i){super(),this.error=i}render({_n:i}){return`throw ${this.error};`+i}get names(){return this.error.names}},pl=class extends mi{constructor(i){super(),this.code=i}render({_n:i}){return`${this.code};`+i}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(i,t){return this.code=An(this.code,i,t),this}get names(){return this.code instanceof ge._CodeOrName?this.code.names:{}}},$r=class extends mi{constructor(i=[]){super(),this.nodes=i}render(i){return this.nodes.reduce((t,n)=>t+n.render(i),"")}optimizeNodes(){let{nodes:i}=this,t=i.length;for(;t--;){let n=i[t].optimizeNodes();Array.isArray(n)?i.splice(t,1,...n):n?i[t]=n:i.splice(t,1)}return i.length>0?this:void 0}optimizeNames(i,t){let{nodes:n}=this,r=n.length;for(;r--;){let o=n[r];o.optimizeNames(i,t)||(aw(i,o.names),n.splice(r,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((i,t)=>cn(i,t.names),{})}},hi=class extends $r{render(i){return"{"+i._n+super.render(i)+"}"+i._n}},fl=class extends $r{},ml=(()=>{class e extends hi{}return e.kind="else",e})(),ba=(()=>{class e extends hi{constructor(t,n){super(n),this.condition=t}render(t){let n=`if(${this.condition})`+super.render(t);return this.else&&(n+="else "+this.else.render(t)),n}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let n=this.else;if(n){let r=n.optimizeNodes();n=this.else=Array.isArray(r)?new ml(r):r}if(n)return t===!1?n instanceof e?n:n.nodes:this.nodes.length?this:new e(jp(t),n instanceof e?[n]:n.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,n){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(t,n),!!(super.optimizeNames(t,n)||this.else))return this.condition=An(this.condition,t,n),this}get names(){let t=super.names;return xa(t,this.condition),this.else&&cn(t,this.else.names),t}}return e.kind="if",e})(),Ia=(()=>{class e extends hi{}return e.kind="for",e})(),hl=class extends Ia{constructor(i){super(),this.iteration=i}render(i){return`for(${this.iteration})`+super.render(i)}optimizeNames(i,t){if(super.optimizeNames(i,t))return this.iteration=An(this.iteration,i,t),this}get names(){return cn(super.names,this.iteration.names)}},gl=class extends Ia{constructor(i,t,n,r){super(),this.varKind=i,this.name=t,this.from=n,this.to=r}render(i){let t=i.es5?Jt.varKinds.var:this.varKind,{name:n,from:r,to:o}=this;return`for(${t} ${n}=${r}; ${n}<${o}; ${n}++)`+super.render(i)}get names(){let i=xa(super.names,this.from);return xa(i,this.to)}},Ca=class extends Ia{constructor(i,t,n,r){super(),this.loop=i,this.varKind=t,this.name=n,this.iterable=r}render(i){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(i)}optimizeNames(i,t){if(super.optimizeNames(i,t))return this.iterable=An(this.iterable,i,t),this}get names(){return cn(super.names,this.iterable.names)}},Np=(()=>{class e extends hi{constructor(t,n,r){super(),this.name=t,this.args=n,this.async=r}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}}return e.kind="func",e})(),Fp=(()=>{class e extends $r{render(t){return"return "+super.render(t)}}return e.kind="return",e})(),_l=class extends hi{render(i){let t="try"+super.render(i);return this.catch&&(t+=this.catch.render(i)),this.finally&&(t+=this.finally.render(i)),t}optimizeNodes(){var i,t;return super.optimizeNodes(),(i=this.catch)===null||i===void 0||i.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(i,t){var n,r;return super.optimizeNames(i,t),(n=this.catch)===null||n===void 0||n.optimizeNames(i,t),(r=this.finally)===null||r===void 0||r.optimizeNames(i,t),this}get names(){let i=super.names;return this.catch&&cn(i,this.catch.names),this.finally&&cn(i,this.finally.names),i}},Ap=(()=>{class e extends hi{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}}return e.kind="catch",e})(),qp=(()=>{class e extends hi{render(t){return"finally"+super.render(t)}}return e.kind="finally",e})(),yl=class{constructor(i,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts=$e(X({},t),{_n:t.lines?`
|
|
2
2
|
`:""}),this._extScope=i,this._scope=new Jt.Scope({parent:i}),this._nodes=[new fl]}toString(){return this._root.render(this.opts)}name(i){return this._scope.name(i)}scopeName(i){return this._extScope.name(i)}scopeValue(i,t){let n=this._extScope.value(i,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(i,t){return this._extScope.getValue(i,t)}scopeRefs(i){return this._extScope.scopeRefs(i,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(i,t,n,r){let o=this._scope.toName(t);return n!==void 0&&r&&(this._constants[o.str]=n),this._leafNode(new sl(i,o,n)),o}const(i,t,n){return this._def(Jt.varKinds.const,i,t,n)}let(i,t,n){return this._def(Jt.varKinds.let,i,t,n)}var(i,t,n){return this._def(Jt.varKinds.var,i,t,n)}assign(i,t,n){return this._leafNode(new va(i,t,n))}add(i,t){return this._leafNode(new ll(i,ce.operators.ADD,t))}code(i){return typeof i=="function"?i():i!==ge.nil&&this._leafNode(new pl(i)),this}object(...i){let t=["{"];for(let[n,r]of i)t.length>1&&t.push(","),t.push(n),(n!==r||this.opts.es5)&&(t.push(":"),(0,ge.addCodeArg)(t,r));return t.push("}"),new ge._Code(t)}if(i,t,n){if(this._blockNode(new ba(i)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(i){return this._elseNode(new ba(i))}else(){return this._elseNode(new ml)}endIf(){return this._endBlockNode(ba,ml)}_for(i,t){return this._blockNode(i),t&&this.code(t).endFor(),this}for(i,t){return this._for(new hl(i),t)}forRange(i,t,n,r,o=this.opts.es5?Jt.varKinds.var:Jt.varKinds.let){let a=this._scope.toName(i);return this._for(new gl(o,a,t,n),()=>r(a))}forOf(i,t,n,r=Jt.varKinds.const){let o=this._scope.toName(i);if(this.opts.es5){let a=t instanceof ge.Name?t:this.var("_arr",t);return this.forRange("_i",0,(0,ge._)`${a}.length`,s=>{this.var(o,(0,ge._)`${a}[${s}]`),n(o)})}return this._for(new Ca("of",r,o,t),()=>n(o))}forIn(i,t,n,r=this.opts.es5?Jt.varKinds.var:Jt.varKinds.const){if(this.opts.ownProperties)return this.forOf(i,(0,ge._)`Object.keys(${t})`,n);let o=this._scope.toName(i);return this._for(new Ca("in",r,o,t),()=>n(o))}endFor(){return this._endBlockNode(Ia)}label(i){return this._leafNode(new ul(i))}break(i){return this._leafNode(new cl(i))}return(i){let t=new Fp;if(this._blockNode(t),this.code(i),t.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Fp)}try(i,t,n){if(!t&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let r=new _l;if(this._blockNode(r),this.code(i),t){let o=this.name("e");this._currNode=r.catch=new Ap(o),t(o)}return n&&(this._currNode=r.finally=new qp,this.code(n)),this._endBlockNode(Ap,qp)}throw(i){return this._leafNode(new dl(i))}block(i,t){return this._blockStarts.push(this._nodes.length),i&&this.code(i).endBlock(t),this}endBlock(i){let t=this._blockStarts.pop();if(t===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-t;if(n<0||i!==void 0&&n!==i)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${i} expected`);return this._nodes.length=t,this}func(i,t=ge.nil,n,r){return this._blockNode(new Np(i,t,n)),r&&this.code(r).endFunc(),this}endFunc(){return this._endBlockNode(Np)}optimize(i=1){for(;i-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(i){return this._currNode.nodes.push(i),this}_blockNode(i){this._currNode.nodes.push(i),this._nodes.push(i)}_endBlockNode(i,t){let n=this._currNode;if(n instanceof i||t&&n instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${i.kind}/${t.kind}`:i.kind}"`)}_elseNode(i){let t=this._currNode;if(!(t instanceof ba))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=i,this}get _root(){return this._nodes[0]}get _currNode(){let i=this._nodes;return i[i.length-1]}set _currNode(i){let t=this._nodes;t[t.length-1]=i}};ce.CodeGen=yl;function cn(e,i){for(let t in i)e[t]=(e[t]||0)+(i[t]||0);return e}function xa(e,i){return i instanceof ge._CodeOrName?cn(e,i.names):e}function An(e,i,t){if(e instanceof ge.Name)return n(e);if(!r(e))return e;return new ge._Code(e._items.reduce((o,a)=>(a instanceof ge.Name&&(a=n(a)),a instanceof ge._Code?o.push(...a._items):o.push(a),o),[]));function n(o){let a=t[o.str];return a===void 0||i[o.str]!==1?o:(delete i[o.str],a)}function r(o){return o instanceof ge._Code&&o._items.some(a=>a instanceof ge.Name&&i[a.str]===1&&t[a.str]!==void 0)}}function aw(e,i){for(let t in i)e[t]=(e[t]||0)-(i[t]||0)}function jp(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,ge._)`!${bl(e)}`}ce.not=jp;var sw=Vp(ce.operators.AND);function lw(...e){return e.reduce(sw)}ce.and=lw;var uw=Vp(ce.operators.OR);function cw(...e){return e.reduce(uw)}ce.or=cw;function Vp(e){return(i,t)=>i===ge.nil?t:t===ge.nil?i:(0,ge._)`${bl(i)} ${e} ${bl(t)}`}function bl(e){return e instanceof ge.Name?e:(0,ge._)`(${e})`}});var pe=g(de=>{"use strict";Object.defineProperty(de,"__esModule",{value:!0});de.checkStrictMode=de.getErrorPath=de.Type=de.useFunc=de.setEvaluated=de.evaluatedPropsToName=de.mergeEvaluated=de.eachItem=de.unescapeJsonPointer=de.escapeJsonPointer=de.escapeFragment=de.unescapeFragment=de.schemaRefOrVal=de.schemaHasRulesButRef=de.schemaHasRules=de.checkUnknownRules=de.alwaysValidSchema=de.toHash=void 0;var Ee=ee(),dw=Sr();function pw(e){let i={};for(let t of e)i[t]=!0;return i}de.toHash=pw;function fw(e,i){return typeof i=="boolean"?i:Object.keys(i).length===0?!0:(Lp(e,i),!Up(i,e.self.RULES.all))}de.alwaysValidSchema=fw;function Lp(e,i=e.schema){let{opts:t,self:n}=e;if(!t.strictSchema||typeof i=="boolean")return;let r=n.RULES.keywords;for(let o in i)r[o]||Wp(e,`unknown keyword: "${o}"`)}de.checkUnknownRules=Lp;function Up(e,i){if(typeof e=="boolean")return!e;for(let t in e)if(i[t])return!0;return!1}de.schemaHasRules=Up;function mw(e,i){if(typeof e=="boolean")return!e;for(let t in e)if(t!=="$ref"&&i.all[t])return!0;return!1}de.schemaHasRulesButRef=mw;function hw({topSchemaRef:e,schemaPath:i},t,n,r){if(!r){if(typeof t=="number"||typeof t=="boolean")return t;if(typeof t=="string")return(0,Ee._)`${t}`}return(0,Ee._)`${e}${i}${(0,Ee.getProperty)(n)}`}de.schemaRefOrVal=hw;function gw(e){return zp(decodeURIComponent(e))}de.unescapeFragment=gw;function _w(e){return encodeURIComponent(Cl(e))}de.escapeFragment=_w;function Cl(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}de.escapeJsonPointer=Cl;function zp(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}de.unescapeJsonPointer=zp;function yw(e,i){if(Array.isArray(e))for(let t of e)i(t);else i(e)}de.eachItem=yw;function Bp({mergeNames:e,mergeToName:i,mergeValues:t,resultToName:n}){return(r,o,a,s)=>{let l=a===void 0?o:a instanceof Ee.Name?(o instanceof Ee.Name?e(r,o,a):i(r,o,a),a):o instanceof Ee.Name?(i(r,a,o),o):t(o,a);return s===Ee.Name&&!(l instanceof Ee.Name)?n(r,l):l}}de.mergeEvaluated={props:Bp({mergeNames:(e,i,t)=>e.if((0,Ee._)`${t} !== true && ${i} !== undefined`,()=>{e.if((0,Ee._)`${i} === true`,()=>e.assign(t,!0),()=>e.assign(t,(0,Ee._)`${t} || {}`).code((0,Ee._)`Object.assign(${t}, ${i})`))}),mergeToName:(e,i,t)=>e.if((0,Ee._)`${t} !== true`,()=>{i===!0?e.assign(t,!0):(e.assign(t,(0,Ee._)`${t} || {}`),xl(e,t,i))}),mergeValues:(e,i)=>e===!0?!0:X(X({},e),i),resultToName:Hp}),items:Bp({mergeNames:(e,i,t)=>e.if((0,Ee._)`${t} !== true && ${i} !== undefined`,()=>e.assign(t,(0,Ee._)`${i} === true ? true : ${t} > ${i} ? ${t} : ${i}`)),mergeToName:(e,i,t)=>e.if((0,Ee._)`${t} !== true`,()=>e.assign(t,i===!0?!0:(0,Ee._)`${t} > ${i} ? ${t} : ${i}`)),mergeValues:(e,i)=>e===!0?!0:Math.max(e,i),resultToName:(e,i)=>e.var("items",i)})};function Hp(e,i){if(i===!0)return e.var("props",!0);let t=e.var("props",(0,Ee._)`{}`);return i!==void 0&&xl(e,t,i),t}de.evaluatedPropsToName=Hp;function xl(e,i,t){Object.keys(t).forEach(n=>e.assign((0,Ee._)`${i}${(0,Ee.getProperty)(n)}`,!0))}de.setEvaluated=xl;var Rp={};function bw(e,i){return e.scopeValue("func",{ref:i,code:Rp[i.code]||(Rp[i.code]=new dw._Code(i.code))})}de.useFunc=bw;var vl=function(e){return e[e.Num=0]="Num",e[e.Str=1]="Str",e}(vl||(de.Type=vl={}));function vw(e,i,t){if(e instanceof Ee.Name){let n=i===vl.Num;return t?n?(0,Ee._)`"[" + ${e} + "]"`:(0,Ee._)`"['" + ${e} + "']"`:n?(0,Ee._)`"/" + ${e}`:(0,Ee._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return t?(0,Ee.getProperty)(e).toString():"/"+Cl(e)}de.getErrorPath=vw;function Wp(e,i,t=e.opts.strictSchema){if(t){if(i=`strict mode: ${i}`,t===!0)throw new Error(i);e.self.logger.warn(i)}}de.checkStrictMode=Wp});var Vt=g(wl=>{"use strict";Object.defineProperty(wl,"__esModule",{value:!0});var ot=ee(),Cw={data:new ot.Name("data"),valCxt:new ot.Name("valCxt"),instancePath:new ot.Name("instancePath"),parentData:new ot.Name("parentData"),parentDataProperty:new ot.Name("parentDataProperty"),rootData:new ot.Name("rootData"),dynamicAnchors:new ot.Name("dynamicAnchors"),vErrors:new ot.Name("vErrors"),errors:new ot.Name("errors"),this:new ot.Name("this"),self:new ot.Name("self"),scope:new ot.Name("scope"),json:new ot.Name("json"),jsonPos:new ot.Name("jsonPos"),jsonLen:new ot.Name("jsonLen"),jsonPart:new ot.Name("jsonPart")};wl.default=Cw});var Er=g(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.extendErrors=at.resetErrorsCount=at.reportExtraError=at.reportError=at.keyword$DataError=at.keywordError=void 0;var ye=ee(),Sa=pe(),gt=Vt();at.keywordError={message:({keyword:e})=>(0,ye.str)`must pass "${e}" keyword validation`};at.keyword$DataError={message:({keyword:e,schemaType:i})=>i?(0,ye.str)`"${e}" keyword must be ${i} ($data)`:(0,ye.str)`"${e}" keyword is invalid ($data)`};function xw(e,i=at.keywordError,t,n){let{it:r}=e,{gen:o,compositeRule:a,allErrors:s}=r,l=Jp(e,i,t);n??(a||s)?Kp(o,l):Gp(r,(0,ye._)`[${l}]`)}at.reportError=xw;function ww(e,i=at.keywordError,t){let{it:n}=e,{gen:r,compositeRule:o,allErrors:a}=n,s=Jp(e,i,t);Kp(r,s),o||a||Gp(n,gt.default.vErrors)}at.reportExtraError=ww;function Iw(e,i){e.assign(gt.default.errors,i),e.if((0,ye._)`${gt.default.vErrors} !== null`,()=>e.if(i,()=>e.assign((0,ye._)`${gt.default.vErrors}.length`,i),()=>e.assign(gt.default.vErrors,null)))}at.resetErrorsCount=Iw;function Sw({gen:e,keyword:i,schemaValue:t,data:n,errsCount:r,it:o}){if(r===void 0)throw new Error("ajv implementation error");let a=e.name("err");e.forRange("i",r,gt.default.errors,s=>{e.const(a,(0,ye._)`${gt.default.vErrors}[${s}]`),e.if((0,ye._)`${a}.instancePath === undefined`,()=>e.assign((0,ye._)`${a}.instancePath`,(0,ye.strConcat)(gt.default.instancePath,o.errorPath))),e.assign((0,ye._)`${a}.schemaPath`,(0,ye.str)`${o.errSchemaPath}/${i}`),o.opts.verbose&&(e.assign((0,ye._)`${a}.schema`,t),e.assign((0,ye._)`${a}.data`,n))})}at.extendErrors=Sw;function Kp(e,i){let t=e.const("err",i);e.if((0,ye._)`${gt.default.vErrors} === null`,()=>e.assign(gt.default.vErrors,(0,ye._)`[${t}]`),(0,ye._)`${gt.default.vErrors}.push(${t})`),e.code((0,ye._)`${gt.default.errors}++`)}function Gp(e,i){let{gen:t,validateName:n,schemaEnv:r}=e;r.$async?t.throw((0,ye._)`new ${e.ValidationError}(${i})`):(t.assign((0,ye._)`${n}.errors`,i),t.return(!1))}var dn={keyword:new ye.Name("keyword"),schemaPath:new ye.Name("schemaPath"),params:new ye.Name("params"),propertyName:new ye.Name("propertyName"),message:new ye.Name("message"),schema:new ye.Name("schema"),parentSchema:new ye.Name("parentSchema")};function Jp(e,i,t){let{createErrors:n}=e.it;return n===!1?(0,ye._)`{}`:$w(e,i,t)}function $w(e,i,t={}){let{gen:n,it:r}=e,o=[Ew(r,t),Pw(e,t)];return Tw(e,i,o),n.object(...o)}function Ew({errorPath:e},{instancePath:i}){let t=i?(0,ye.str)`${e}${(0,Sa.getErrorPath)(i,Sa.Type.Str)}`:e;return[gt.default.instancePath,(0,ye.strConcat)(gt.default.instancePath,t)]}function Pw({keyword:e,it:{errSchemaPath:i}},{schemaPath:t,parentSchema:n}){let r=n?i:(0,ye.str)`${i}/${e}`;return t&&(r=(0,ye.str)`${r}${(0,Sa.getErrorPath)(t,Sa.Type.Str)}`),[dn.schemaPath,r]}function Tw(e,{params:i,message:t},n){let{keyword:r,data:o,schemaValue:a,it:s}=e,{opts:l,propertyName:u,topSchemaRef:c,schemaPath:p}=s;n.push([dn.keyword,r],[dn.params,typeof i=="function"?i(e):i||(0,ye._)`{}`]),l.messages&&n.push([dn.message,typeof t=="function"?t(e):t]),l.verbose&&n.push([dn.schema,a],[dn.parentSchema,(0,ye._)`${c}${p}`],[gt.default.data,o]),u&&n.push([dn.propertyName,u])}});var Yp=g(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.boolOrEmptySchema=qn.topBoolOrEmptySchema=void 0;var kw=Er(),Mw=ee(),Ow=Vt(),Dw={message:"boolean schema is false"};function Nw(e){let{gen:i,schema:t,validateName:n}=e;t===!1?Xp(e,!1):typeof t=="object"&&t.$async===!0?i.return(Ow.default.data):(i.assign((0,Mw._)`${n}.errors`,null),i.return(!0))}qn.topBoolOrEmptySchema=Nw;function Fw(e,i){let{gen:t,schema:n}=e;n===!1?(t.var(i,!1),Xp(e)):t.var(i,!0)}qn.boolOrEmptySchema=Fw;function Xp(e,i){let{gen:t,data:n}=e,r={gen:t,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,kw.reportError)(r,Dw,void 0,i)}});var Il=g(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.getRules=jn.isJSONType=void 0;var Aw=["string","number","integer","boolean","null","object","array"],qw=new Set(Aw);function jw(e){return typeof e=="string"&&qw.has(e)}jn.isJSONType=jw;function Vw(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:$e(X({},e),{integer:!0,boolean:!0,null:!0}),rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}jn.getRules=Vw});var Sl=g(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.shouldUseRule=Bi.shouldUseGroup=Bi.schemaHasRulesForType=void 0;function Bw({schema:e,self:i},t){let n=i.RULES.types[t];return n&&n!==!0&&Qp(e,n)}Bi.schemaHasRulesForType=Bw;function Qp(e,i){return i.rules.some(t=>Zp(e,t))}Bi.shouldUseGroup=Qp;function Zp(e,i){var t;return e[i.keyword]!==void 0||((t=i.definition.implements)===null||t===void 0?void 0:t.some(n=>e[n]!==void 0))}Bi.shouldUseRule=Zp});var Pr=g(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.reportTypeError=st.checkDataTypes=st.checkDataType=st.coerceAndCheckDataType=st.getJSONTypes=st.getSchemaTypes=st.DataType=void 0;var Rw=Il(),Lw=Sl(),Uw=Er(),ae=ee(),ef=pe(),Vn=function(e){return e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong",e}(Vn||(st.DataType=Vn={}));function zw(e){let i=tf(e.type);if(i.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!i.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&i.push("null")}return i}st.getSchemaTypes=zw;function tf(e){let i=Array.isArray(e)?e:e?[e]:[];if(i.every(Rw.isJSONType))return i;throw new Error("type must be JSONType or JSONType[]: "+i.join(","))}st.getJSONTypes=tf;function Hw(e,i){let{gen:t,data:n,opts:r}=e,o=Ww(i,r.coerceTypes),a=i.length>0&&!(o.length===0&&i.length===1&&(0,Lw.schemaHasRulesForType)(e,i[0]));if(a){let s=El(i,n,r.strictNumbers,Vn.Wrong);t.if(s,()=>{o.length?Kw(e,i,o):Pl(e)})}return a}st.coerceAndCheckDataType=Hw;var nf=new Set(["string","number","integer","boolean","null"]);function Ww(e,i){return i?e.filter(t=>nf.has(t)||i==="array"&&t==="array"):[]}function Kw(e,i,t){let{gen:n,data:r,opts:o}=e,a=n.let("dataType",(0,ae._)`typeof ${r}`),s=n.let("coerced",(0,ae._)`undefined`);o.coerceTypes==="array"&&n.if((0,ae._)`${a} == 'object' && Array.isArray(${r}) && ${r}.length == 1`,()=>n.assign(r,(0,ae._)`${r}[0]`).assign(a,(0,ae._)`typeof ${r}`).if(El(i,r,o.strictNumbers),()=>n.assign(s,r))),n.if((0,ae._)`${s} !== undefined`);for(let u of t)(nf.has(u)||u==="array"&&o.coerceTypes==="array")&&l(u);n.else(),Pl(e),n.endIf(),n.if((0,ae._)`${s} !== undefined`,()=>{n.assign(r,s),Gw(e,s)});function l(u){switch(u){case"string":n.elseIf((0,ae._)`${a} == "number" || ${a} == "boolean"`).assign(s,(0,ae._)`"" + ${r}`).elseIf((0,ae._)`${r} === null`).assign(s,(0,ae._)`""`);return;case"number":n.elseIf((0,ae._)`${a} == "boolean" || ${r} === null
|
|
3
3
|
|| (${a} == "string" && ${r} && ${r} == +${r})`).assign(s,(0,ae._)`+${r}`);return;case"integer":n.elseIf((0,ae._)`${a} === "boolean" || ${r} === null
|
|
4
4
|
|| (${a} === "string" && ${r} && ${r} == +${r} && !(${r} % 1))`).assign(s,(0,ae._)`+${r}`);return;case"boolean":n.elseIf((0,ae._)`${r} === "false" || ${r} === 0 || ${r} === null`).assign(s,!1).elseIf((0,ae._)`${r} === "true" || ${r} === 1`).assign(s,!0);return;case"null":n.elseIf((0,ae._)`${r} === "" || ${r} === 0 || ${r} === false`),n.assign(s,null);return;case"array":n.elseIf((0,ae._)`${a} === "string" || ${a} === "number"
|
|
@@ -9,7 +9,7 @@ import{a as Mp}from"./chunk-TMXVEYOG.js";import{a as tl,c as Ep,d as Pp,e as Fn,
|
|
|
9
9
|
Should be: [ [ object1, pointer1 ], [ object 2, pointer2 ], etc... ]`);return}return r}if(zt(n)){for(let[a,s]of n){if(a===null||!this.isJsonPointer(s))continue;let l=o?this.getCopy(a,s):this.get(a,s);if(l)return l}return r}return console.error(`getFirst error: Input not in correct format.
|
|
10
10
|
Should be: [ [ object1, pointer1 ], [ object 2, pointer2 ], etc... ]`),r}}static getFirstCopy(n,r=null){return this.getFirst(n,r,!0)}static set(n,r,o,a=!1){let s=this.parse(r);if(s!==null&&s.length){let l=n;for(let c=0;c<s.length-1;++c){let p=s[c];p==="-"&&D(l)&&(p=l.length),zt(l)&&l.has(p)?l=l.get(p):(T(l,p)||(l[p]=s[c+1].match(/^(\d+|-)$/)?[]:{}),l=l[p])}let u=s[s.length-1];return D(l)&&u==="-"?l.push(o):a&&D(l)&&!isNaN(+u)?l.splice(u,0,o):zt(l)?l.set(u,o):l[u]=o,n}return console.error(`set error: Invalid JSON Pointer: ${r}`),n}static setCopy(n,r,o,a=!1){let s=this.parse(r);if(s!==null){let l=Rs(n),u=l;for(let p=0;p<s.length-1;++p){let h=s[p];h==="-"&&D(u)&&(h=u.length),zt(u)&&u.has(h)?(u.set(h,Rs(u.get(h))),u=u.get(h)):(T(u,h)||(u[h]=s[p+1].match(/^(\d+|-)$/)?[]:{}),u[h]=Rs(u[h]),u=u[h])}let c=s[s.length-1];return D(u)&&c==="-"?u.push(o):a&&D(u)&&!isNaN(+c)?u.splice(c,0,o):zt(u)?u.set(c,o):u[c]=o,l}return console.error(`setCopy error: Invalid JSON Pointer: ${r}`),n}static insert(n,r,o){return this.set(n,r,o,!0)}static insertCopy(n,r,o){return this.setCopy(n,r,o,!0)}static remove(n,r){let o=this.parse(r);if(o!==null&&o.length){let a=o.pop(),s=this.get(n,o);return D(s)?(a==="-"&&(a=s.length-1),s.splice(a,1)):V(s)&&delete s[a],n}return console.error(`remove error: Invalid JSON Pointer: ${r}`),n}static has(n,r){return this.get(n,r,0,null,!0)}static dict(n){let r={};return this.forEachDeep(n,(o,a)=>{typeof o!="object"&&(r[a]=o)}),r}static forEachDeep(n,r=l=>l,o=!1,a="",s=n){if(typeof r!="function"){console.error("forEachDeep error: Iterator is not a function:",r);return}if(o||r(n,a,s),V(n)||D(n))for(let l of Object.keys(n)){let u=a+"/"+this.escape(l);this.forEachDeep(n[l],r,o,u,s)}o&&r(n,a,s)}static forEachDeepCopy(n,r=l=>l,o=!1,a="",s=n){if(typeof r!="function")return console.error("forEachDeepCopy error: Iterator is not a function:",r),null;if(V(n)||D(n)){let l=D(n)?[...n]:X({},n);o||(l=r(l,a,s));for(let u of Object.keys(l)){let c=a+"/"+this.escape(u);l[u]=this.forEachDeepCopy(l[u],r,o,c,s)}return o&&(l=r(l,a,s)),l}else return r(n,a,s)}static escape(n){return n.toString().replace(/~/g,"~0").replace(/\//g,"~1")}static unescape(n){return n.toString().replace(/~1/g,"/").replace(/~0/g,"~")}static parse(n,r=!1){if(!this.isJsonPointer(n))return r&&console.error(`parse error: Invalid JSON Pointer: ${n}`),null;if(D(n))return n;if(typeof n=="string")return n[0]==="#"&&(n=n.slice(1)),n===""||n==="/"?[]:n.slice(1).split("/").map(this.unescape)}static compile(n,r="",o=!1){if(n==="#")return"";if(!this.isJsonPointer(n))return o&&console.error(`compile error: Invalid JSON Pointer: ${n}`),null;if(D(n))return n.length===0?"":"/"+n.map(a=>a===""?r:this.escape(a)).join("/");if(typeof n=="string")return n[0]==="#"&&(n=n.slice(1)),n}static toKey(n,r=!1){let o=this.parse(n,r);return o===null?null:o.length?o[o.length-1]:""}static isJsonPointer(n){if(D(n))return n.every(r=>typeof r=="string");if(Pe(n)){if(n===""||n==="#")return!0;if(n[0]==="/"||n.slice(0,2)==="#/")return!/(~[^01]|~$)/g.test(n)}return!1}static isSubPointer(n,r,o=!1,a=!1){if(!this.isJsonPointer(n)||!this.isJsonPointer(r)){if(a){let s="";this.isJsonPointer(n)||(s+=` 1: ${n}`),this.isJsonPointer(r)||(s+=` 2: ${r}`),console.error(`isSubPointer error: Invalid JSON Pointer ${s}`)}return}return n=this.compile(n,"",a),r=this.compile(r,"",a),n===r?o:`${n}/`===r.slice(0,n.length+1)}static toIndexedPointer(n,r,o=null){if(this.isJsonPointer(n)&&D(r)){let a=this.compile(n);if(zt(o)){let s=0;return a.replace(/\/\-(?=\/|$)/g,(l,u)=>o.has(a.slice(0,u))?"/"+r[s++]:l)}else{for(let s of r)a=a.replace("/-","/"+s);return a}}this.isJsonPointer(n)||console.error(`toIndexedPointer error: Invalid JSON Pointer: ${n}`),D(r)||console.error(`toIndexedPointer error: Invalid indexArray: ${r}`)}static toGenericPointer(n,r=new Map){if(this.isJsonPointer(n)&&zt(r)){let o=this.parse(n);for(let a=1;a<o.length;a++){let s=this.compile(o.slice(0,a));r.has(s)&&r.get(s)<=+o[a]&&(o[a]="-")}return this.compile(o)}this.isJsonPointer(n)||console.error(`toGenericPointer error: invalid JSON Pointer: ${n}`),zt(r)||console.error(`toGenericPointer error: invalid arrayMap: ${r}`)}static toControlPointer(n,r,o=!1){let a=this.parse(n),s=[],l=r;if(a!==null){for(let u of a)if(T(l,"controls")&&(s.push("controls"),l=l.controls),D(l)&&u==="-")s.push((l.length-1).toString()),l=l[l.length-1];else if(T(l,u))s.push(u),l=l[u];else if(o){console.error(`toControlPointer error: Unable to find "${u}" item in FormGroup.`),console.error(n),console.error(r);return}else s.push(u),l={controls:{}};return this.compile(s)}console.error(`toControlPointer error: Invalid JSON Pointer: ${n}`)}static toSchemaPointer(n,r){if(this.isJsonPointer(n)&&typeof r=="object"){let o=this.parse(n);if(!o.length)return"";let a=o.shift();if(r.type==="object"||r.properties||r.additionalProperties){if((r.properties||{})[a])return`/properties/${this.escape(a)}`+this.toSchemaPointer(o,r.properties[a]);if(r.additionalProperties)return"/additionalProperties"+this.toSchemaPointer(o,r.additionalProperties)}if((r.type==="array"||r.items)&&(He(a)||a==="-"||a==="")){let s=a==="-"||a===""?0:+a;if(D(r.items)){if(s<r.items.length)return"/items/"+s+this.toSchemaPointer(o,r.items[s]);if(r.additionalItems)return"/additionalItems"+this.toSchemaPointer(o,r.additionalItems)}else{if(V(r.items))return"/items"+this.toSchemaPointer(o,r.items);if(V(r.additionalItems))return"/additionalItems"+this.toSchemaPointer(o,r.additionalItems)}}return console.error(`toSchemaPointer error: Data pointer ${n} not compatible with schema ${r}`),null}return this.isJsonPointer(n)||console.error(`toSchemaPointer error: Invalid JSON Pointer: ${n}`),typeof r!="object"&&console.error(`toSchemaPointer error: Invalid JSON Schema: ${r}`),null}static toDataPointer(n,r,o=!1){if(this.isJsonPointer(n)&&typeof r=="object"&&this.has(r,n)){let a=this.parse(n);if(!a.length)return"";let s=a.shift();if(s==="properties"||s==="items"&&D(r.items)){let l=a.shift(),u=this.toDataPointer(a,r[s][l]);return u===null?null:"/"+l+u}else if(s==="additionalItems"||s==="items"&&V(r.items)){let l=this.toDataPointer(a,r[s]);return l===null?null:"/-"+l}else if(["allOf","anyOf","oneOf"].includes(s)){let l=a.shift();return this.toDataPointer(a,r[s][l])}else{if(s==="not")return this.toDataPointer(a,r[s]);["contains","definitions","dependencies","additionalItems","additionalProperties","patternProperties","propertyNames"].includes(s)&&o&&console.error("toDataPointer error: Ambiguous location")}return""}return o&&(this.isJsonPointer(n)||console.error(`toDataPointer error: Invalid JSON Pointer: ${n}`),typeof r!="object"&&console.error(`toDataPointer error: Invalid JSON Schema: ${r}`),typeof r!="object"&&console.error(`toDataPointer error: Pointer ${n} invalid for Schema: ${r}`)),null}static parseObjectPath(n){if(D(n))return n;if(this.isJsonPointer(n))return this.parse(n);if(typeof n=="string"){let r=0,o=[];for(;r<n.length;){let a=n.indexOf(".",r),s=n.indexOf("[",r);if(a===-1&&s===-1)o.push(n.slice(r)),r=n.length;else if(a!==-1&&(a<s||s===-1))o.push(n.slice(r,a)),r=a+1;else{s>r&&(o.push(n.slice(r,s)),r=s);let l=n.charAt(s+1);if(l==='"'||l==="'"){let u=n.indexOf(l+"]",s);for(;u!==-1&&n.charAt(u-1)==="\\";)u=n.indexOf(l+"]",u+2);u===-1&&(u=n.length),o.push(n.slice(r+2,u).replace(new RegExp("\\"+l,"g"),l)),r=u+2}else{let u=n.indexOf("]",s);u===-1&&(u=n.length),o.push(n.slice(r+1,u)),r=u+1}n.charAt(r)==="."&&r++}}return o}console.error("parseObjectPath error: Input object path must be a string.")}};i.\u0275fac=function(r){return new(r||i)},i.\u0275prov=Tt({token:i,factory:i.\u0275fac});let e=i;return e})(),PR={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^[0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s][0-2]\d:[0-5]\d(?::[0-5]\d)?(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,uri:/^(?:[a-z][a-z0-9+-.]*)(?::|\/)\/?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/\/)?[^\s]*$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,color:/^\s*(#(?:[\da-f]{3}){1,2}|rgb\((?:\d{1,3},\s*){2}\d{1,3}\)|rgba\((?:\d{1,3},\s*){3}\d*\.?\d+\)|hsl\(\d{1,3}(?:,\s*\d{1,3}%){2}\)|hsla\(\d{1,3}(?:,\s*\d{1,3}%){2},\s*\d*\.?\d+\))\s*$/gi,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$|^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,regex:function(e){if(/[^\\]\\Z/.test(e))return!1;try{return!0}catch{return!1}}},Ko=class e{static required(i){switch(i===void 0&&(i=!0),i){case!0:return(t,n=!1)=>n||Z(t.value)?null:{required:!0};case!1:return e.nullValidator;default:return Z(i.value)?null:{required:!0}}}static type(i){return Z(i)?(t,n=!1)=>{if(oe(t.value))return null;let r=t.value,o=D(i)?i.some(a=>ex(r,a)):ex(r,i);return Le(o,n)?null:{type:{requiredType:i,currentValue:r}}}:e.nullValidator}static enum(i){return D(i)?(t,n=!1)=>{if(oe(t.value))return null;let r=t.value,o=(s,l)=>s===l||He(s)&&+l==+s||ni(s,"strict")&&Qi(l,"boolean")===s||s===null&&!Z(l)||(0,ii.default)(s,l),a=D(r)?r.every(s=>i.some(l=>o(l,s))):i.some(s=>o(s,r));return Le(a,n)?null:{enum:{allowedValues:i,currentValue:r}}}:e.nullValidator}static const(i){return Z(i)?(t,n=!1)=>{if(oe(t.value))return null;let r=t.value,a=((s,l)=>s===l||He(s)&&+l==+s||ni(s,"strict")&&Qi(l,"boolean")===s||s===null&&!Z(l))(i,r);return Le(a,n)?null:{const:{requiredValue:i,currentValue:r}}}:e.nullValidator}static minLength(i){return Z(i)?(t,n=!1)=>{if(oe(t.value))return null;let r=Pe(t.value)?t.value.length:0,o=r>=i;return Le(o,n)?null:{minLength:{minimumLength:i,currentLength:r}}}:e.nullValidator}static maxLength(i){return Z(i)?(t,n=!1)=>{let r=Pe(t.value)?t.value.length:0,o=r<=i;return Le(o,n)?null:{maxLength:{maximumLength:i,currentLength:r}}}:e.nullValidator}static pattern(i,t=!1){return Z(i)?(n,r=!1)=>{if(oe(n.value))return null;let o,a;typeof i=="string"?(a=t?`^${i}$`:i,o=new RegExp(a)):(a=i.toString(),o=i);let s=n.value,l=Pe(s)?o.test(s):!1;return Le(l,r)?null:{pattern:{requiredPattern:a,currentValue:s}}}:e.nullValidator}static format(i){return Z(i)?(t,n=!1)=>{if(oe(t.value))return null;let r,o=t.value;if(Pe(o)){let a=PR[i];typeof a=="object"?r=a.test(o):typeof a=="function"?r=a(o):(console.error(`format validator error: "${i}" is not a recognized format.`),r=!0)}else r=["date","time","date-time"].includes(i)&&Object.prototype.toString.call(o)==="[object Date]";return Le(r,n)?null:{format:{requiredFormat:i,currentValue:o}}}:e.nullValidator}static minimum(i){return Z(i)?(t,n=!1)=>{if(oe(t.value))return null;let r=t.value,o=!He(r)||r>=i;return Le(o,n)?null:{minimum:{minimumValue:i,currentValue:r}}}:e.nullValidator}static exclusiveMinimum(i){return Z(i)?(t,n=!1)=>{if(oe(t.value))return null;let r=t.value,o=!He(r)||+r<i;return Le(o,n)?null:{exclusiveMinimum:{exclusiveMinimumValue:i,currentValue:r}}}:e.nullValidator}static maximum(i){return Z(i)?(t,n=!1)=>{if(oe(t.value))return null;let r=t.value,o=!He(r)||+r<=i;return Le(o,n)?null:{maximum:{maximumValue:i,currentValue:r}}}:e.nullValidator}static exclusiveMaximum(i){return Z(i)?(t,n=!1)=>{if(oe(t.value))return null;let r=t.value,o=!He(r)||+r<i;return Le(o,n)?null:{exclusiveMaximum:{exclusiveMaximumValue:i,currentValue:r}}}:e.nullValidator}static multipleOf(i){return Z(i)?(t,n=!1)=>{if(oe(t.value))return null;let r=t.value,o=He(r)&&r%i===0;return Le(o,n)?null:{multipleOf:{multipleOfValue:i,currentValue:r}}}:e.nullValidator}static minProperties(i){return Z(i)?(t,n=!1)=>{if(oe(t.value))return null;let r=Object.keys(t.value).length||0,o=r>=i;return Le(o,n)?null:{minProperties:{minimumProperties:i,currentProperties:r}}}:e.nullValidator}static maxProperties(i){return Z(i)?(t,n=!1)=>{let r=Object.keys(t.value).length||0,o=r<=i;return Le(o,n)?null:{maxProperties:{maximumProperties:i,currentProperties:r}}}:e.nullValidator}static dependencies(i){return mr(i)!=="object"||oe(i)?e.nullValidator:(t,n=!1)=>{if(oe(t.value))return null;let r=wi(xd(i,(o,a)=>{if(!Z(t.value[a]))return null;let s={},l,u={};mr(i[a])==="array"?l=i[a]:mr(i[a])==="object"&&(l=i[a].required||[],u=i[a].properties||{});for(let c of l)Le(!Z(t.value[c]),n)&&(s[c]={required:!0});return s=wi(s,xd(u,(c,p)=>{let h=wi(xd(c,(v,y)=>{let x=null;if(v==="maximum"||v==="minimum"){let I=!!c["exclusiveM"+v.slice(1)];x=e[v](y,I)}else typeof e[v]=="function"&&(x=e[v](y));return Ce(x)?x(t.value[p]):null}));return oe(h)?null:{[p]:h}})),oe(s)?null:{[a]:s}}));return oe(r)?null:r}}static minItems(i){return Z(i)?(t,n=!1)=>{if(oe(t.value))return null;let r=D(t.value)?t.value.length:0,o=r>=i;return Le(o,n)?null:{minItems:{minimumItems:i,currentItems:r}}}:e.nullValidator}static maxItems(i){return Z(i)?(t,n=!1)=>{let r=D(t.value)?t.value.length:0,o=r<=i;return Le(o,n)?null:{maxItems:{maximumItems:i,currentItems:r}}}:e.nullValidator}static uniqueItems(i=!0){return i?(t,n=!1)=>{if(oe(t.value))return null;let r=t.value.slice().sort(),o=[];for(let s=1;s<r.length;s++)r[s-1]===r[s]&&o.includes(r[s])&&o.push(r[s]);let a=!o.length;return Le(a,n)?null:{uniqueItems:{duplicateItems:o}}}:e.nullValidator}static contains(i=!0){return i?(t,n=!1)=>{if(oe(t.value)||!D(t.value))return null;let r=t.value;return Le(!0,n)?null:{contains:{requiredItem:i,currentItems:r}}}:e.nullValidator}static nullValidator(i){return null}static composeAnyOf(i){if(!i)return null;let t=i.filter(Ce);return t.length===0?null:(n,r=!1)=>{let o=Ho(n,t,r).filter(Ce),a=i.length>o.length;return Le(a,r)?null:wi(...o,{anyOf:!r})}}static composeOneOf(i){if(!i)return null;let t=i.filter(Ce);return t.length===0?null:(n,r=!1)=>{let o=Ho(n,t),s=i.length-o.filter(Ce).length===1;if(Le(s,r))return null;let l=Ho(n,t,r);return wi(...o,...l,{oneOf:!r})}}static composeAllOf(i){if(!i)return null;let t=i.filter(Ce);return t.length===0?null:(n,r=!1)=>{let o=Cd(Ho(n,t,r));return Le(o===null,r)?null:wi(o,{allOf:!r})}}static composeNot(i){return i?(t,n=!1)=>{if(oe(t.value))return null;let r=i(t,!n);return Le(r===null,n)?null:wi(r,{not:!n})}:null}static compose(i){if(!i)return null;let t=i.filter(Ce);return t.length===0?null:(n,r=!1)=>Cd(Ho(n,t,r))}static composeAsync(i){if(!i)return null;let t=i.filter(Ce);return t.length===0?null:n=>{let r=gR(n,t).map(xR);return Hd.call(Wd(r),Cd)}}static min(i){return Z(i)?t=>{if(oe(t.value)||oe(i))return null;let n=parseFloat(t.value),r=t.value;return isNaN(n)||n>=i?null:{min:{min:i,actual:r}}}:e.nullValidator}static max(i){return Z(i)?t=>{if(oe(t.value)||oe(i))return null;let n=parseFloat(t.value),r=t.value;return isNaN(n)||n<=i?null:{max:{max:i,actual:r}}}:e.nullValidator}static requiredTrue(i){return i?i.value===!0?null:{required:!0}:e.nullValidator}static email(i){return i?/^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(\.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/.test(i.value)?null:{email:!0}:e.nullValidator}};function Dt(...e){if(e=e.filter(t=>!oe(t)),e.some(t=>!V(t)))return null;let i={};for(let t of e)for(let n of Object.keys(t)){let r=i[n],o=t[n];if(!T(i,n)||(0,ii.default)(r,o))i[n]=o;else switch(n){case"allOf":if(D(r)&&D(o))i.allOf=Dt(...r,...o);else return{allOf:[...e]};break;case"additionalItems":case"additionalProperties":case"contains":case"propertyNames":if(V(r)&&V(o))i[n]=Dt(r,o);else if(n==="additionalProperties"&&(r===!1||o===!1))i.combinedSchema=!1;else return{allOf:[...e]};break;case"anyOf":case"oneOf":case"enum":if(D(r)&&D(o)){if(i[n]=r.filter(a=>o.findIndex(s=>(0,ii.default)(a,s))>-1),!i[n].length)return{allOf:[...e]}}else return{allOf:[...e]};break;case"definitions":if(V(r)&&V(o)){let a=X({},r);for(let s of Object.keys(o))if(!T(a,s)||(0,ii.default)(a[s],o[s]))a[s]=o[s];else return{allOf:[...e]};i.definitions=a}else return{allOf:[...e]};break;case"dependencies":if(V(r)&&V(o)){let a=X({},r);for(let s of Object.keys(o))if(!T(a,s)||(0,ii.default)(a[s],o[s]))a[s]=o[s];else if(D(o[s])&&D(a[s]))a[s]=js(...a[s],...o[s]);else if((D(o[s])||V(o[s]))&&(D(a[s])||V(a[s]))){let l=D(i.required)?i.required:[],u=D(a[s])?{required:js(...l,a[s])}:a[s],c=D(o[s])?{required:js(...l,o[s])}:o[s];a[s]=Dt(u,c)}else return{allOf:[...e]};i.dependencies=a}else return{allOf:[...e]};break;case"items":if(D(r)&&D(o)){if(i.items=r.filter(a=>o.findIndex(s=>(0,ii.default)(a,s))>-1),!i.items.length)return{allOf:[...e]}}else if(V(r)&&V(o))i.items=Dt(r,o);else if(D(r)&&V(o))i.items=r.map(a=>Dt(a,o));else if(V(r)&&D(o))i.items=o.map(a=>Dt(a,r));else return{allOf:[...e]};break;case"multipleOf":if(He(r)&&He(o)){let a=(l,u)=>u?a(u,l%u):l,s=(l,u)=>l*u/a(l,u);i.multipleOf=s(r,o)}else return{allOf:[...e]};break;case"maximum":case"exclusiveMaximum":case"maxLength":case"maxItems":case"maxProperties":if(He(r)&&He(o))i[n]=Math.min(r,o);else return{allOf:[...e]};break;case"minimum":case"exclusiveMinimum":case"minLength":case"minItems":case"minProperties":if(He(r)&&He(o))i[n]=Math.max(r,o);else return{allOf:[...e]};break;case"not":if(V(r)&&V(o)){let a=[r,o].reduce((s,l)=>D(l.anyOf)&&Object.keys(l).length===1?[...s,...l.anyOf]:[...s,l],[]);i.not={anyOf:a}}else return{allOf:[...e]};break;case"patternProperties":if(V(r)&&V(o)){let a=X({},r);for(let s of Object.keys(o))if(!T(a,s)||(0,ii.default)(a[s],o[s]))a[s]=o[s];else if(V(o[s])&&V(a[s]))a[s]=Dt(a[s],o[s]);else return{allOf:[...e]};i.patternProperties=a}else return{allOf:[...e]};break;case"properties":if(V(r)&&V(o)){let a=X({},r);T(o,"additionalProperties")&&Object.keys(r).filter(s=>!Object.keys(o).includes(s)).forEach(s=>{o.additionalProperties===!1?delete a[s]:V(o.additionalProperties)&&(a[s]=Dt(a[s],o.additionalProperties))});for(let s of Object.keys(o))if((0,ii.default)(a[s],o[s])||!T(a,s)&&!T(a,"additionalProperties"))a[s]=o[s];else if(!T(a,s)&&T(a,"additionalProperties"))V(a.additionalProperties)&&(a[s]=Dt(a.additionalProperties,o[s]));else if(V(o[s])&&V(a[s]))a[s]=Dt(a[s],o[s]);else return{allOf:[...e]};i.properties=a}else return{allOf:[...e]};break;case"required":if(D(r)&&D(o))i.required=js(...r,...o);else if(typeof o=="boolean"&&typeof r=="boolean")i.required=!!r||!!o;else return{allOf:[...e]};break;case"$schema":case"$id":case"id":break;case"title":case"description":case"$comment":i[n]=o;break;case"type":if((D(o)||Pe(o))&&(D(r)||Pe(r))){let a=ER(r,o);if(!a.length)return{allOf:[...e]};i.type=a.length>1?a:a[0]}else return{allOf:[...e]};break;case"uniqueItems":i.uniqueItems=!!r||!!o;break;default:return{allOf:[...e]}}}return i}function Sd(e,i=!1,t=!0){let n={},r=a=>{let s=mr(a,"strict");return{integer:"number",null:"string"}[s]||s},o=a=>Sd(a,i,!1);if(t&&(n.$schema="http://json-schema.org/draft-06/schema#"),n.type=r(e),n.type==="object"){n.properties={},i&&(n.required=[]);for(let a of Object.keys(e))n.properties[a]=o(e[a]),i&&n.required.push(a)}else n.type==="array"&&(n.items=e.map(o),new Set(e.map(r)).size===1&&(n.items=n.items.reduce((a,s)=>X(X({},a),s),{})),i&&(n.minItems=1));return n}function TR(e,i,t="schema"){let n=N.parse(i);if(n===null)return console.error(`getFromSchema error: Invalid JSON Pointer: ${i}`),null;let r=e,o=[],a=n.length;t.slice(0,6)==="parent"&&n.length--;for(let s=0;s<a;++s){let l=r,u=n[s],c=!1;if(typeof r!="object")return console.error(`getFromSchema error: Unable to find "${u}" key in schema.`),console.error(e),console.error(i),null;if(r.type==="array"&&(!isNaN(u)||u==="-")?(T(r,"items")&&(V(r.items)?(c=!0,r=r.items,o.push("items")):D(r.items)&&!isNaN(u)&&r.items.length>=+u&&(c=!0,r=r.items[+u],o.push("items",u))),!c&&V(r.additionalItems)?(c=!0,r=r.additionalItems,o.push("additionalItems")):r.additionalItems!==!1&&(c=!0,r={},o.push("additionalItems"))):r.type==="object"&&(V(r.properties)&&T(r.properties,u)?(c=!0,r=r.properties[u],o.push("properties",u)):V(r.additionalProperties)?(c=!0,r=r.additionalProperties,o.push("additionalProperties")):r.additionalProperties!==!1&&(c=!0,r={},o.push("additionalProperties"))),!c){console.error(`getFromSchema error: Unable to find "${u}" item in schema.`),console.error(e),console.error(i);return}}return t.slice(-7)==="Pointer"?o:r}function ct(e,i,t=new Map){if(!e)return"";let n=N.toGenericPointer(N.compile(e),t);if(n.indexOf("/")===-1)return n;let r=!0;for(;r;)r=!1,i.forEach((o,a)=>{if(N.isSubPointer(o,a))for(;N.isSubPointer(a,n,!0);)n=N.toGenericPointer(o+n.slice(a.length),t),r=!0});return n}function $d(e,i=null){let t=N.getFirst([[e,"/x-schema-form/type"],[e,"/x-schema-form/widget/component"],[e,"/x-schema-form/widget"],[e,"/widget/component"],[e,"/widget"]]);if(Pe(t))return Ed(t,e,i);let n=e.type;if(n){if(D(n)&&(n=Ze("object",n)&&T(e,"properties")?"object":Ze("array",n)&&T(e,"items")||Ze("array",n)&&T(e,"additionalItems")?"array":Ze("string",n)?"string":Ze("number",n)?"number":Ze("integer",n)?"integer":Ze("boolean",n)?"boolean":"unknown"),n==="boolean")return"checkbox";if(n==="object"){if(T(e,"properties")||T(e,"additionalProperties"))return"section";if(T(e,"$ref"))return"$ref"}if(n==="array"){let r=N.getFirst([[e,"/items"],[e,"/additionalItems"]])||{};return T(r,"enum")&&e.maxItems!==1?Ed("checkboxes",e,i):"array"}if(n==="null")return"none";if(N.has(i,"/options/titleMap")||T(e,"enum")||Pd(e,null,!0))return"select";if(n==="number"||n==="integer")return(n==="integer"||T(e,"multipleOf"))&&T(e,"maximum")&&T(e,"minimum")?"range":n;if(n==="string")return{color:"color",date:"date","date-time":"datetime-local",email:"email",uri:"url"}[e.format]||"text"}return T(e,"$ref")?"$ref":D(e.oneOf)||D(e.anyOf)?"one-of":(console.error(`getInputType error: Unable to determine input type for ${n}`),console.error("schema",e),i&&console.error("layoutNode",i),"none")}function Ed(e,i,t=null){return!Pe(e)||e.slice(0,8)!=="checkbox"&&e.slice(0,5)!=="radio"?e:N.getFirst([[t,"/inline"],[t,"/options/inline"],[i,"/inline"],[i,"/x-schema-form/inline"],[i,"/x-schema-form/options/inline"],[i,"/x-schema-form/widget/inline"],[i,"/x-schema-form/widget/component/inline"],[i,"/x-schema-form/widget/component/options/inline"],[i,"/widget/inline"],[i,"/widget/component/inline"],[i,"/widget/component/options/inline"]])===!0?e.slice(0,5)==="radio"?"radios-inline":"checkboxes-inline":e}function Ls(e,i){if(!V(e))return console.error("isInputRequired error: Input schema must be an object."),!1;let t=N.parse(i);if(D(t)){if(!t.length)return e.required===!0;let n=t.pop(),r=t[t.length-1];["properties","additionalProperties","patternProperties","items","additionalItems"].includes(r)&&t.pop();let o=N.get(e,t)||{};if(D(o.required))return o.required.includes(n);if(o.type==="array")return T(o,"minItems")&&He(n)&&+o.minItems>+n}return!1}function Wo(e,i,t){if(!V(e)||!V(e.options))return;let n={},r=o=>o.slice(0,3).toLowerCase()==="ui:"?o.slice(3):o;if(tx(n,t.formOptions.defaultWidgetOptions,[],r),[[N.get(i,"/ui:widget/options"),[]],[N.get(i,"/ui:widget"),[]],[i,["additionalProperties","additionalItems","properties","items","required","type","x-schema-form","$ref"]],[N.get(i,"/x-schema-form/options"),[]],[N.get(i,"/x-schema-form"),["items","options"]],[e,["_id","$ref","arrayItem","arrayItemType","dataPointer","dataType","items","key","name","options","recursiveReference","type","widget"]],[e.options,[]]].forEach(([o,a])=>tx(n,o,a,r)),!T(n,"titleMap")){let o=null;o=Pd(i,n.flatList),o&&(n.titleMap=o),!T(n,"titleMap")&&!T(n,"enum")&&T(i,"items")&&(N.has(i,"/items/titleMap")?n.titleMap=i.items.titleMap:N.has(i,"/items/enum")?(n.enum=i.items.enum,!T(n,"enumNames")&&N.has(i,"/items/enumNames")&&(n.enumNames=i.items.enumNames)):N.has(i,"/items/oneOf")&&(o=Pd(i.items,n.flatList),o&&(n.titleMap=o)))}i.type==="integer"&&!Z(n.multipleOf)&&(n.multipleOf=1),N.has(n,"/autocomplete/source")?n.typeahead=n.autocomplete:N.has(n,"/tagsinput/source")?n.typeahead=n.tagsinput:N.has(n,"/tagsinput/typeahead/source")&&(n.typeahead=n.tagsinput.typeahead),e.options=n}function Pd(e={},i=null,t=!1){let n=null,r=e.oneOf||e.anyOf||null;if(D(r)&&r.every(o=>o.title)){if(r.every(o=>D(o.enum)&&o.enum.length===1)){if(t)return!0;n=r.map(o=>({name:o.title,value:o.enum[0]}))}else if(r.every(o=>o.const)){if(t)return!0;n=r.map(o=>({name:o.title,value:o.const}))}if(i!==!1&&(n||[]).filter(o=>((o||{}).name||"").indexOf(": ")).length>1){let o=n.map(a=>{let[s,l]=a.name.split(/: (.+)/);return s&&l?$e(X({},a),{group:s,name:l}):a});(i===!0||o.some((a,s)=>s&&T(a,"group")&&a.group===o[s-1].group))&&(n=o)}}return t?!1:n}function kR(e){if(!V(e))return null;let i={};if(T(e,"type"))switch(e.type){case"string":$t(["pattern","format","minLength","maxLength"],t=>{T(e,t)&&(i[t]=[e[t]])});break;case"number":case"integer":$t(["Minimum","Maximum"],t=>{let n="exclusive"+t,r=t.toLowerCase();if(T(e,r)){let o=T(e,n)&&e[n]===!0;i[r]=[e[r],o]}}),$t(["multipleOf","type"],t=>{T(e,t)&&(i[t]=[e[t]])});break;case"object":$t(["minProperties","maxProperties","dependencies"],t=>{T(e,t)&&(i[t]=[e[t]])});break;case"array":$t(["minItems","maxItems","uniqueItems"],t=>{T(e,t)&&(i[t]=[e[t]])});break}return T(e,"enum")&&(i.enum=[e.enum]),i}function MR(e,i,t,n,r){if(!V(e)){console.error("resolveSchemaReferences error: schema must be an object.");return}let o=new Set,a=new Set,s=new Map,l=new Map,u={};N.forEachDeep(e,(h,v)=>{if(T(h,"$ref")&&Pe(h.$ref)){let y=N.compile(h.$ref);o.add(y),a.add(v+"~~"+y),s.set(v,y)}}),o.forEach(h=>u[h]=Us(e,h));let c=!0;for(;c;)c=!1,Array.from(s).forEach(([h,v])=>Array.from(s).filter(([y,x])=>N.isSubPointer(v,y,!0)&&!N.isSubPointer(x,v,!0)&&!a.has(h+y.slice(v.length)+"~~"+x)).forEach(([y,x])=>{a.add(h+y.slice(v.length)+"~~"+x),c=!0}));Array.from(a).map(h=>h.split("~~")).filter(([h,v])=>N.isSubPointer(v,h)).forEach(([h,v])=>l.set(h,v)),Array.from(s).filter(([h,v])=>Array.from(l.keys()).every(y=>!N.isSubPointer(h,y,!0))).forEach(([h,v])=>Array.from(l).filter(([y,x])=>!l.has(h+y.slice(v.length))&&N.isSubPointer(v,y,!0)&&!N.isSubPointer(v,h,!0)).forEach(([y,x])=>l.set(h+y.slice(v.length),h+x.slice(v.length))));let p=X({},e);return delete p.definitions,p=Us(p,"",u,l),N.forEachDeep(p,(h,v)=>{if(Pe(h.$ref)){let y=N.compile(h.$ref);N.isSubPointer(y,v,!0)||(y=ct(v,l),N.set(p,v,{$ref:`#${y}`})),T(i,"refPointer")||(i[y]=y.length?Us(p,y,i,l):p),t.has(v)||t.set(v,y);let x=N.toDataPointer(v,p);if(!n.has(x)){let I=N.toDataPointer(y,p);n.set(x,I)}}if(h.type==="array"&&(T(h,"items")||T(h,"additionalItems"))){let y=N.toDataPointer(v,p);if(!r.has(y)){let x=D(h.items)?h.items.length:0;r.set(y,x)}}},!0),p}function Us(e,i,t=null,n=null,r=[]){if(!t||!n)return N.getCopy(e,i);typeof i!="string"&&(i=N.compile(i)),r=[...r,i];let o=null;if(i==="")o=(0,me.default)(e);else{let a=ct(i,n);a!==i&&(r=[...r,a]),o=N.getFirstCopy([[t,[a]],[e,i],[e,a]])}return N.forEachDeepCopy(o,(a,s)=>{if(V(a)){if(Pe(a.$ref)){let l=N.compile(a.$ref);if(l.length&&r.every(u=>!N.isSubPointer(l,u,!0))){let u=Us(e,l,t,n,r);if(Object.keys(a).length===1)return u;{let c=X({},a);return delete c.$ref,Dt(u,c)}}}if(D(a.allOf))return OR(a);if(a.type==="array"&&D(a.required))return DR(a)}return a},!0,i)}function OR(e){if(!V(e)||!D(e.allOf))return e;let i=Dt(...e.allOf);if(Object.keys(e).length>1){let t=X({},e);delete t.allOf,i=Dt(i,t)}return i}function DR(e){if(e.type==="array"&&D(e.required)){let i=T(e.items,"properties")?"items":T(e.additionalItems,"properties")?"additionalItems":null;i&&!T(e[i],"required")&&(T(e[i],"additionalProperties")||e.required.every(t=>T(e[i].properties,t)))&&(e=(0,me.default)(e),e[i].required=e.required,delete e.required)}return e}function pr(e,i={}){let t=i.draft||null,n=i.changed||!1;if(typeof e!="object")return e;if(typeof e.map=="function")return[...e.map(a=>pr(a,{changed:n,draft:t}))];let r=X({},e),o=["array","boolean","integer","null","number","object","string"];if(typeof r.$schema=="string"&&/http\:\/\/json\-schema\.org\/draft\-0\d\/schema\#/.test(r.$schema)&&(t=r.$schema[30]),r.contentEncoding&&(r.media={binaryEncoding:r.contentEncoding},delete r.contentEncoding,n=!0),typeof r.extends=="object"&&(r.allOf=typeof r.extends.map=="function"?r.extends.map(a=>pr(a,{changed:n,draft:t})):[pr(r.extends,{changed:n,draft:t})],delete r.extends,n=!0),r.disallow&&(typeof r.disallow=="string"?r.not={type:r.disallow}:typeof r.disallow.map=="function"&&(r.not={anyOf:r.disallow.map(a=>typeof a=="object"?a:{type:a})}),delete r.disallow,n=!0),typeof r.dependencies=="object"&&Object.keys(r.dependencies).some(a=>typeof r.dependencies[a]=="string")&&(r.dependencies=X({},r.dependencies),Object.keys(r.dependencies).filter(a=>typeof r.dependencies[a]=="string").forEach(a=>r.dependencies[a]=[r.dependencies[a]]),n=!0),typeof r.maxDecimal=="number"&&(r.multipleOf=1/Math.pow(10,r.maxDecimal),delete r.divisibleBy,n=!0,(!t||t===2)&&(t=1)),typeof r.divisibleBy=="number"&&(r.multipleOf=r.divisibleBy,delete r.divisibleBy,n=!0),typeof r.minimum=="number"&&r.minimumCanEqual===!1?(r.exclusiveMinimum=r.minimum,delete r.minimum,n=!0,t||(t=2)):typeof r.minimumCanEqual=="boolean"&&(delete r.minimumCanEqual,n=!0,t||(t=2)),typeof r.minimum=="number"&&r.exclusiveMinimum===!0?(r.exclusiveMinimum=r.minimum,delete r.minimum,n=!0):typeof r.exclusiveMinimum=="boolean"&&(delete r.exclusiveMinimum,n=!0),typeof r.maximum=="number"&&r.maximumCanEqual===!1?(r.exclusiveMaximum=r.maximum,delete r.maximum,n=!0,t||(t=2)):typeof r.maximumCanEqual=="boolean"&&(delete r.maximumCanEqual,n=!0,t||(t=2)),typeof r.maximum=="number"&&r.exclusiveMaximum===!0?(r.exclusiveMaximum=r.maximum,delete r.maximum,n=!0):typeof r.exclusiveMaximum=="boolean"&&(delete r.exclusiveMaximum,n=!0),typeof r.properties=="object"){let a=X({},r.properties),s=Array.isArray(r.required)?new Set(r.required):new Set;if((t===1||t===2||Object.keys(a).some(l=>a[l].optional===!0))&&(Object.keys(a).filter(l=>a[l].optional!==!0).forEach(l=>s.add(l)),n=!0,t||(t=2)),Object.keys(a).some(l=>a[l].required===!0)&&(Object.keys(a).filter(l=>a[l].required===!0).forEach(l=>s.add(l)),n=!0),s.size&&(r.required=Array.from(s)),Object.keys(a).some(l=>a[l].requires)){let l=typeof r.dependencies=="object"?X({},r.dependencies):{};Object.keys(a).filter(u=>a[u].requires).forEach(u=>l[u]=typeof a[u].requires=="string"?[a[u].requires]:a[u].requires),r.dependencies=l,n=!0,t||(t=2)}r.properties=a}if(typeof r.optional=="boolean"&&(delete r.optional,n=!0,t||(t=2)),r.requires&&delete r.requires,typeof r.required=="boolean"&&delete r.required,typeof r.id=="string"&&!r.$id&&(r.id.slice(-1)==="#"&&(r.id=r.id.slice(0,-1)),r.$id=r.id+"-CONVERTED-TO-DRAFT-06#",delete r.id,n=!0),r.type&&(typeof r.type.every=="function"?!r.type.every(a=>o.includes(a)):!o.includes(r.type))&&(n=!0),typeof r.$schema=="string"&&/http\:\/\/json\-schema\.org\/draft\-0[1-4]\/schema\#/.test(r.$schema))r.$schema="http://json-schema.org/draft-06/schema#",n=!0;else if(n&&typeof r.$schema=="string"){let a="Converted to draft 6 from "+r.$schema;typeof r.description=="string"&&r.description.length?r.description+=`
|
|
11
11
|
`+a:r.description=a,delete r.$schema}if(r.type&&(typeof r.type.every=="function"?!r.type.every(a=>o.includes(a)):!o.includes(r.type)))if(r.type.length===1&&(r.type=r.type[0]),typeof r.type=="string")r.type==="any"?r.type=o:delete r.type;else if(typeof r.type=="object"){if(typeof r.type.every=="function")if(r.type.every(a=>typeof a=="string"))r.type=r.type.some(a=>a==="any")?r.type=o:r.type.filter(a=>o.includes(a));else if(r.type.length>1){let a=["additionalItems","items","maxItems","minItems","uniqueItems","contains"],s=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum"],l=["maxProperties","minProperties","required","additionalProperties","properties","patternProperties","dependencies","propertyNames"],u=["maxLength","minLength","pattern","format"],c={array:[...s,...l,...u],integer:[...a,...l,...u],number:[...a,...l,...u],object:[...a,...s,...u],string:[...a,...s,...l],all:[...a,...s,...l,...u]},p=[];for(let h of r.type){let v=typeof h=="string"?{type:h}:X({},h);Object.keys(r).filter(y=>!v.hasOwnProperty(y)&&![...c[v.type]||c.all,"type","default"].includes(y)).forEach(y=>v[y]=r[y]),p.push(v)}r=r.hasOwnProperty("default")?{anyOf:p,default:r.default}:{anyOf:p}}else{let a=r.type;delete r.type,Object.assign(r,a)}}else delete r.type;return Object.keys(r).filter(a=>typeof r[a]=="object").forEach(a=>{if(["definitions","dependencies","properties","patternProperties"].includes(a)&&typeof r[a].map!="function"){let s={};Object.keys(r[a]).forEach(l=>s[l]=pr(r[a][l],{changed:n,draft:t})),r[a]=s}else["items","additionalItems","additionalProperties","allOf","anyOf","oneOf","not"].includes(a)?r[a]=pr(r[a],{changed:n,draft:t}):r[a]=(0,me.default)(r[a])}),r}function Yi(e,i=null,t=!0,n="",r="",o=""){let a=N.get(e.schema,n);t?!Ce(i)&&(e.formOptions.setSchemaDefaults===!0||e.formOptions.setSchemaDefaults==="auto"&&oe(e.formValues))&&(i=N.get(e.schema,n+"/default")):i=null;let s=N.get(a,"/type"),l=(T(a,"properties")||T(a,"additionalProperties"))&&s==="object"?"FormGroup":(T(a,"items")||T(a,"additionalItems"))&&s==="array"?"FormArray":!s&&T(a,"$ref")?"$ref":"FormControl",u=ct(r,e.dataRecursiveRefMap,e.arrayMap);e.dataMap.has(u)||e.dataMap.set(u,new Map);let c=e.dataMap.get(u);c.has("schemaType")||(c.set("schemaPointer",n),c.set("schemaType",a.type),a.format&&(c.set("schemaFormat",a.format),a.type||c.set("schemaType","string")),l&&(c.set("templatePointer",o),c.set("templateType",l)));let p,h=kR(a);switch(l){case"FormGroup":if(p={},T(a,"ui:order")||T(a,"properties")){let R=a["ui:order"]||Object.keys(a.properties);if(R.includes("*")&&!T(a.properties,"*")){let F=Object.keys(a.properties).filter(se=>!R.includes(se));for(let se=R.length-1;se>=0;se--)R[se]==="*"&&R.splice(se,1,...F)}R.filter(F=>T(a.properties,F)||T(a,"additionalProperties")).forEach(F=>p[F]=Yi(e,N.get(i,[F]),t,n+(T(a.properties,F)?"/properties/"+F:"/additionalProperties"),r+"/"+F,o+"/controls/"+F)),e.formOptions.fieldsRequired=NR(a,p)}return{controlType:l,controls:p,validators:h};case"FormArray":p=[];let v=Math.max(a.minItems||0,c.get("minItems")||0),y=Math.min(a.maxItems||1e3,c.get("maxItems")||1e3),x=null;if(D(a.items)){let R=c.get("tupleItems")||(D(a.items)?Math.min(a.items.length,y):0);for(let F=0;F<R;F++)if(F<v)p.push(Yi(e,D(i)?i[F]:i,t,n+"/items/"+F,r+"/"+F,o+"/controls/"+F));else{let se=ct(n+"/items/"+F,e.schemaRecursiveRefMap),Se=ct(u+"/"+F,e.dataRecursiveRefMap,e.arrayMap),Et=Se!==u+"/"+F;T(e.templateRefLibrary,Se)||(e.templateRefLibrary[Se]=null,e.templateRefLibrary[Se]=Yi(e,null,t,se,Se,o+"/controls/"+F)),p.push(D(i)?Yi(e,i[F],t,n+"/items/"+F,r+"/"+F,o+"/controls/"+F):Et?null:(0,me.default)(e.templateRefLibrary[Se]))}a.items.length<y&&V(a.additionalItems)&&(x=n+"/additionalItems")}else x=n+"/items";if(x){let R=ct(x,e.schemaRecursiveRefMap),F=ct(u+"/-",e.dataRecursiveRefMap,e.arrayMap),se=F!==u+"/-";T(e.templateRefLibrary,F)||(e.templateRefLibrary[F]=null,e.templateRefLibrary[F]=Yi(e,null,t,R,F,o+"/controls/-"));let Se=c;if(!se||T(h,"required")){let Et=Math.min(Math.max(se?0:Se.get("tupleItems")+Se.get("listItems")||0,D(i)?i.length:0),y);for(let Ge=p.length;Ge<Et;Ge++)p.push(D(i)?Yi(e,i[Ge],t,R,r+"/-",o+"/controls/-"):se?null:(0,me.default)(e.templateRefLibrary[F]))}}return{controlType:l,controls:p,validators:h};case"$ref":let I=N.compile(a.$ref),M=N.toDataPointer(I,a),O=ct(M,e.dataRecursiveRefMap,e.arrayMap);if(O&&!T(e.templateRefLibrary,O)){e.templateRefLibrary[O]=null;let R=Yi(e,t,t,I);R?e.templateRefLibrary[O]=R:delete e.templateRefLibrary[O]}return null;case"FormControl":let L={value:t&&_R(i)?i:null,disabled:c.get("disabled")||!1};return{controlType:l,value:L,validators:h};default:return null}}function Go(e){let i=[],t=null;if(T(e,"validators")&&($t(e.validators,(n,r)=>{typeof Ko[r]=="function"&&i.push(Ko[r].apply(null,n))}),i.length&&Ze(e.controlType,["FormGroup","FormArray"])&&(t=i.length>1?Ko.compose(i):i[0])),T(e,"controlType"))switch(e.controlType){case"FormGroup":let n={};return $t(e.controls,(r,o)=>{let a=Go(r);a&&(n[o]=a)}),new cp(n,t);case"FormArray":return new hp((0,nx.default)((0,rx.default)(e.controls,r=>Go(r))),t);case"FormControl":return new fp(e.value,i)}return null}function NR(e,i){let t=!1;if(T(e,"required")&&!oe(e.required)){t=!0;let n=D(e.required)?e.required:[e.required];n=$t(n,r=>N.set(i,"/"+r+"/validators/required",[]))}return t}function FR(e,i,t,n,r=!1,o=!1){if(e===null||typeof e!="object")return e;let a=D(e)?[]:{};return N.forEachDeep(e,(s,l)=>{if(r&&D(s))N.set(a,l,[]);else if(r&&V(s)&&!hr(s))N.set(a,l,{});else{let u=N.has(i,[l,"schemaType"])?l:ct(l,t,n);if(N.has(i,[u,"schemaType"])){let c=i.get(u).get("schemaType");if(c==="null")N.set(a,l,null);else if((Z(s)||r)&&Ze(c,["string","integer","number","boolean"])){let p=o||s===null&&r?bR(s,c):Qi(s,c);(Ce(p)||r)&&N.set(a,l,p)}}else(typeof s!="object"||hr(s)||s===null&&r)&&(console.error(`formatFormData error: Schema type not found for form value at ${u}`),console.error("dataMap",i),console.error("recursiveRefMap",t),console.error("genericPointer",u))}}),a}function Vs(e,i,t=!1){if(!V(e)||!N.isJsonPointer(i)){if(!N.isJsonPointer(i)){if(typeof i=="string"){let o=e.get(i);if(o)return o}console.error(`getControl error: Invalid JSON Pointer: ${i}`)}return V(e)||console.error(`getControl error: Invalid formGroup: ${e}`),null}let n=N.parse(i);if(t&&(n=n.slice(0,-1)),typeof e.get=="function"&&n.every(o=>o.indexOf(".")===-1)){let o=e.get(n.join("."));if(o)return o}let r=e;for(let o of n)if(T(r,"controls")&&(r=r.controls),D(r)&&o==="-")r=r[r.length-1];else if(T(r,o))r=r[o];else{console.error(`getControl error: Unable to find "${o}" item in FormGroup.`),console.error(i),console.error(e);return}return r}function AR(e,i){let t=!N.get(e,"/formOptions/addSubmit"),n=lx(e.layout,(r,o,a)=>{let s={_id:(0,Ii.default)(),options:{}};if(V(r))Object.assign(s,r),Object.keys(s).filter(u=>!Ze(u,["_id","$ref","arrayItem","arrayItemType","dataPointer","dataType","items","key","name","options","recursiveReference","type","widget"])).forEach(u=>{s.options[u]=s[u],delete s[u]}),!T(s,"type")&&Pe(s.widget)&&(s.type=s.widget,delete s.widget),T(s.options,"title")||T(s.options,"legend")&&(s.options.title=s.options.legend,delete s.options.legend),T(s.options,"validationMessages")||(T(s.options,"errorMessages")?(s.options.validationMessages=s.options.errorMessages,delete s.options.errorMessages):T(s.options,"validationMessage")&&(typeof s.options.validationMessage=="string"?s.options.validationMessages=s.options.validationMessage:(s.options.validationMessages={},Object.keys(s.options.validationMessage).forEach(u=>{let c=u+"",p=c==="0"?"type":c==="1"?"enum":c==="100"?"multipleOf":c==="101"?"minimum":c==="102"?"exclusiveMinimum":c==="103"?"maximum":c==="104"?"exclusiveMaximum":c==="200"?"minLength":c==="201"?"maxLength":c==="202"?"pattern":c==="300"?"minProperties":c==="301"?"maxProperties":c==="302"?"required":c==="304"?"dependencies":c==="400"?"minItems":c==="401"?"maxItems":c==="402"?"uniqueItems":c==="500"?"format":c+"";s.options.validationMessages[p]=s.options.validationMessage[u]})),delete s.options.validationMessage));else if(N.isJsonPointer(r))s.dataPointer=r;else if(Pe(r))s.key=r;else return console.error("buildLayout error: Form layout element not recognized:"),console.error(r),null;let l=null;if(!T(s,"dataPointer")){if(T(s,"key"))s.dataPointer=s.key==="*"?s.key:N.compile(N.parseObjectPath(s.key),"-"),delete s.key;else if(T(s,"type")&&s.type.slice(-5)==="array"){let u=p=>{if(!(p===null||typeof p!="object")){if(T(p,"dataPointer"))return p.dataPointer;if(D(p.items))for(let h of p.items){if(T(h,"dataPointer")&&h.dataPointer.indexOf("/-")!==-1)return h.dataPointer;if(T(h,"items")){let v=u(h);if(v)return v}}}},c=u(s);c&&(s.dataPointer=c.slice(0,c.lastIndexOf("/-")))}}if(T(s,"dataPointer")){if(s.dataPointer==="*")return Sn(e,i,e.formValues);let u=N.get(e.formValues,s.dataPointer.replace(/\/-/g,"/1"));s.dataPointer=N.toGenericPointer(s.dataPointer,e.arrayMap);let c=N.toKey(s.dataPointer);!s.name&&Pe(c)&&c!=="-"&&(s.name=c);let p=ct(s.dataPointer,e.dataRecursiveRefMap,e.arrayMap),h=!p.length||p!==s.dataPointer,v;e.dataMap.has(p)||e.dataMap.set(p,new Map);let y=e.dataMap.get(p);if(y.has("schemaPointer")?v=y.get("schemaPointer"):(v=N.toSchemaPointer(p,e.schema),y.set("schemaPointer",v)),y.set("disabled",!!s.options.disabled),l=N.get(e.schema,v),l){if(!T(s,"type"))s.type=$d(l,s);else if(i.hasWidget(s.type))s.type=Ed(s.type,l,s);else{let x=s.type;s.type=$d(l,s),console.error(`error: widget type "${x}" not found in library. Replacing with "${s.type}".`)}l.type==="object"&&D(l.required)&&y.set("required",l.required),s.dataType=l.type||(T(l,"$ref")?"$ref":null),Wo(s,l,e),s.type==="checkboxes"&&T(l,"items")?Wo(s,l.items,e):s.dataType==="array"&&(s.options.maxItems=Math.min(l.maxItems||1e3,s.options.maxItems||1e3),s.options.minItems=Math.max(l.minItems||0,s.options.minItems||0),s.options.listItems=Math.max(s.options.listItems||0,D(u)?u.length:0),s.options.tupleItems=D(l.items)?l.items.length:0,s.options.maxItems<s.options.tupleItems?(s.options.tupleItems=s.options.maxItems,s.options.listItems=0):s.options.maxItems<s.options.tupleItems+s.options.listItems?s.options.listItems=s.options.maxItems-s.options.tupleItems:s.options.minItems>s.options.tupleItems+s.options.listItems&&(s.options.listItems=s.options.minItems-s.options.tupleItems),y.has("maxItems")||(y.set("maxItems",s.options.maxItems),y.set("minItems",s.options.minItems),y.set("tupleItems",s.options.tupleItems),y.set("listItems",s.options.listItems)),e.arrayMap.has(p)||e.arrayMap.set(p,s.options.tupleItems)),Ls(e.schema,v)&&(s.options.required=!0,e.fieldsRequired=!0)}else Wo(s,{},e);if(!s.options.title&&!/^\d+$/.test(s.name)&&(s.options.title=Si(s.name)),T(s.options,"copyValueTo")&&(typeof s.options.copyValueTo=="string"&&(s.options.copyValueTo=[s.options.copyValueTo]),D(s.options.copyValueTo)&&(s.options.copyValueTo=s.options.copyValueTo.map(x=>N.compile(N.parseObjectPath(x),"-")))),s.widget=i.getWidget(s.type),y.set("inputType",s.type),y.set("widget",s.widget),s.dataType==="array"&&(T(s,"items")||T(s,"additionalItems"))){let x=ct(s.dataPointer+"/-",e.dataRecursiveRefMap,e.arrayMap);if(e.dataMap.has(x)||e.dataMap.set(x,new Map),e.dataMap.get(x).set("inputType","section"),s.items.length>1){let I=[];for(let M=s.items.length-1;M>=0;M--){let O=s.items[M];if(T(O,"dataPointer")&&O.dataPointer.slice(0,x.length)===x){let L=s.items.splice(M,1)[0];L.dataPointer=s.dataPointer+"/-"+L.dataPointer.slice(x.length),I.unshift(L)}else O.arrayItem=!0,O.arrayItemType="list",O.removable=s.options.removable!==!1}I.length&&s.items.push({_id:(0,Ii.default)(),arrayItem:!0,arrayItemType:s.options.tupleItems>s.items.length?"tuple":"list",items:I,options:{removable:s.options.removable!==!1},dataPointer:s.dataPointer+"/-",type:"section",widget:i.getWidget("section")})}else s.items[0].arrayItem=!0,s.items[0].dataPointer||(s.items[0].dataPointer=N.toGenericPointer(x,e.arrayMap)),N.has(s,"/items/0/options/removable")||(s.items[0].options.removable=!0),s.options.orderable===!1&&(s.items[0].options.orderable=!1),s.items[0].arrayItemType=s.options.tupleItems?"tuple":"list";if(D(s.items)){let I=s.items.filter(M=>M.type!=="$ref").length-s.options.tupleItems;I>s.options.listItems&&(s.options.listItems=I,y.set("listItems",I))}if(T(e.layoutRefLibrary,x)||(e.layoutRefLibrary[x]=(0,me.default)(s.items[s.items.length-1]),h&&(e.layoutRefLibrary[x].recursiveReference=!0),$t(e.layoutRefLibrary[x],(I,M)=>{T(I,"_id")&&(I._id=null),h&&T(I,"dataPointer")&&(I.dataPointer=I.dataPointer.slice(x.length))},"top-down")),!s.recursiveReference||s.options.required){let I=Math.min(Math.max(s.options.tupleItems+s.options.listItems,D(u)?u.length:0),s.options.maxItems);for(let M=s.items.length;M<I;M++)s.items.push(Hs({$ref:x,dataPointer:s.dataPointer,recursiveReference:s.recursiveReference},e,i))}if(s.options.addable!==!1&&s.options.minItems<s.options.maxItems&&(s.items[s.items.length-1]||{}).type!=="$ref"){let I="Add";if(s.options.title)/^add\b/i.test(s.options.title)?I=s.options.title:I+=" "+s.options.title;else if(s.name&&!/^\d+$/.test(s.name))/^add\b/i.test(s.name)?I+=" "+Si(s.name):I=Si(s.name);else{let M=TR(e.schema,s.dataPointer,"parentSchema");if(T(M,"title"))I+=" to "+M.title;else{let O=N.parse(s.dataPointer);I+=" to "+Si(O[O.length-2])}}s.items.push({_id:(0,Ii.default)(),arrayItem:!0,arrayItemType:"list",dataPointer:s.dataPointer+"/-",options:{listItems:s.options.listItems,maxItems:s.options.maxItems,minItems:s.options.minItems,removable:!1,title:I,tupleItems:s.options.tupleItems},recursiveReference:h,type:"$ref",widget:i.getWidget("$ref"),$ref:x}),Pe(N.get(s,"/style/add"))&&(s.items[s.items.length-1].options.fieldStyle=s.style.add,delete s.style.add,oe(s.style)&&delete s.style)}}else s.arrayItem=!1}else if(T(s,"type")||T(s,"items")){let u=N.get(e.layout,a,0,-2).type;T(s,"type")||(s.type=Ze(u,["tabs","tabarray"])?"tab":"array"),s.arrayItem=u==="array",s.widget=i.getWidget(s.type),Wo(s,{},e)}return s.type==="submit"&&(t=!0),s});if(e.hasRootReference){let r=(0,me.default)(n);r[r.length-1].type==="submit"&&r.pop(),e.layoutRefLibrary[""]={_id:null,dataPointer:"",dataType:"object",items:r,name:"",options:(0,me.default)(e.formOptions.defaultWidgetOptions),recursiveReference:!0,required:!1,type:"section",widget:i.getWidget("section")}}return t||n.push({_id:(0,Ii.default)(),options:{title:"Submit"},type:"submit",widget:i.getWidget("submit")}),n}function qR(e,i){let t=AR(e,i);if(e.formValues){let n=jR({builtLayout:t,formData:e.formValues})}return t}function jR(e){let{builtLayout:i,formData:t}=e,n={},r=function(u,c,p){if((0,Bs.default)(u)){p&&p(u,c),u.forEach((h,v)=>{p&&p(h,c+"/"+v),r(h,c+"/"+v,p)});return}if((0,ox.default)(u)){p&&p(u,c),Object.keys(u).forEach(h=>{p&&p(u[h],c+"/"+h),r(u[h],c+"/"+h,p)});return}};r(t,"",(u,c)=>{(0,Bs.default)(u)&&(n[c]=n[c]||u.length)});let o=u=>{let{data:c,dataPointer:p,indexArray:h}=u,v=0,y=p.substring(1).split("/").map((I,M)=>I=="-"&&h[v]!=null?h[v++]:I).join("/");return y="/"+y,n[y]},a=u=>{let c={type:"section",recursiveReference:!1,items:[]};return(0,me.default)(u)},s=u=>{let{builtLayout:c,indices:p,parentDataPointer:h,indexPos:v}=u;if(p=p||[],v=v??(v=-1),(0,Bs.default)(c)){c.forEach((x,I)=>{s({builtLayout:x,indices:p,indexPos:v,parentDataPointer:h})});return}let y=["array"];if(c.items&&y.indexOf(c.dataType)>=0&&c.dataPointer&&!c.recursiveReference){let x=o({data:t,dataPointer:c.dataPointer,indexArray:p}),I=c.items.length;if(c.items.forEach(M=>{M.type&&M.type=="$ref"&&I--}),I=Math.max(I,0),I<x){let M=x-I;I==0&&c.items[0].recursiveReference&&(M=0);for(let O=0;O<M;O++){let R=c.items[0].type&&c.items[0].type=="$ref"?a(c.items[0]):(0,me.default)(c.items[0]);R._id=(0,Ii.default)("new_"),c.items.unshift(R)}c.options.listItems&&(c.options.listItems=x)}p[c.dataPointer]=p[c.dataPointer]||-1,v++,c.items.forEach((M,O)=>{p[v]=O,s({builtLayout:M,indices:p,parentDataPointer:c.dataPointer,indexPos:v})}),v--}else c.items&&c.items.forEach((x,I)=>{s({builtLayout:x,indices:p,parentDataPointer:h,indexPos:v})})};return s({builtLayout:i}),i}function Sn(e,i,t=null,n="",r="",o=!1,a=null,s=null,l=!1,u=""){let c=N.get(e.schema,n);if(!T(c,"type")&&!T(c,"$ref")&&!T(c,"x-schema-form"))return null;let p=$d(c);!Ce(t)&&(e.formOptions.setSchemaDefaults===!0||e.formOptions.setSchemaDefaults==="auto"&&oe(e.formValues))&&(t=N.get(e.schema,n+"/default"));let h={_id:l?null:(0,Ii.default)(),arrayItem:o,dataPointer:N.toGenericPointer(r,e.arrayMap),dataType:c.type||(T(c,"$ref")?"$ref":null),options:{},required:Ls(e.schema,n),type:p,widget:i.getWidget(p)},v=N.toKey(h.dataPointer);v!=="-"&&(h.name=v),h.arrayItem&&(h.arrayItemType=a,h.options.removable=s!==!1);let y=ct(u+r,e.dataRecursiveRefMap,e.arrayMap),x=!y.length||y!==u+r;e.dataMap.has(y)||e.dataMap.set(y,new Map);let I=e.dataMap.get(y);if(I.has("inputType")||(I.set("schemaPointer",n),I.set("inputType",h.type),I.set("widget",h.widget),I.set("disabled",!!h.options.disabled)),Wo(h,c,e),!h.options.title&&h.name&&!/^\d+$/.test(h.name)&&(h.options.title=Si(h.name)),h.dataType==="object"){if(D(c.required)&&!I.has("required")&&I.set("required",c.required),V(c.properties)){let M=[],O=c["ui:order"]||Object.keys(c.properties);if(O.includes("*")&&!T(c.properties,"*")){let L=Object.keys(c.properties).filter(R=>!O.includes(R));for(let R=O.length-1;R>=0;R--)O[R]==="*"&&O.splice(R,1,...L)}O.filter(L=>T(c.properties,L)||T(c,"additionalProperties")).forEach(L=>{let R=T(c.properties,L)?"/properties/"+L:"/additionalProperties",F=Sn(e,i,V(t)?t[L]:null,n+R,r+"/"+L,!1,null,null,l,u);F&&(Ls(c,"/"+L)&&(F.options.required=!0,e.fieldsRequired=!0),M.push(F))}),r===""&&!l?h=M:h.items=M}}else if(h.dataType==="array"){h.items=[],h.options.maxItems=Math.min(c.maxItems||1e3,h.options.maxItems||1e3),h.options.minItems=Math.max(c.minItems||0,h.options.minItems||0),!h.options.minItems&&Ls(e.schema,n)&&(h.options.minItems=1),T(h.options,"listItems")||(h.options.listItems=1),h.options.tupleItems=D(c.items)?c.items.length:0,h.options.maxItems<=h.options.tupleItems?(h.options.tupleItems=h.options.maxItems,h.options.listItems=0):h.options.maxItems<h.options.tupleItems+h.options.listItems?h.options.listItems=h.options.maxItems-h.options.tupleItems:h.options.minItems>h.options.tupleItems+h.options.listItems&&(h.options.listItems=h.options.minItems-h.options.tupleItems),I.has("maxItems")||(I.set("maxItems",h.options.maxItems),I.set("minItems",h.options.minItems),I.set("tupleItems",h.options.tupleItems),I.set("listItems",h.options.listItems)),e.arrayMap.has(y)||e.arrayMap.set(y,h.options.tupleItems),s=h.options.removable!==!1;let M=null;if(D(c.items)){h.items=[];for(let O=0;O<h.options.tupleItems;O++){let L,R=ct(y+"/"+O,e.dataRecursiveRefMap,e.arrayMap),F=!R.length||R!==y+"/"+O;s&&O>=h.options.minItems?(T(e.layoutRefLibrary,R)||(e.layoutRefLibrary[R]=null,e.layoutRefLibrary[R]=Sn(e,i,D(t)?t[O]:null,n+"/items/"+O,F?"":r+"/"+O,!0,"tuple",!0,!0,F?r+"/"+O:""),F&&(e.layoutRefLibrary[R].recursiveReference=!0)),L=Hs({$ref:R,dataPointer:r+"/"+O,recursiveReference:F},e,i,D(t)?t[O]:null)):L=Sn(e,i,D(t)?t[O]:null,n+"/items/"+O,r+"/"+O,!0,"tuple",!1,l,u),L&&h.items.push(L)}V(c.additionalItems)&&(M=n+"/additionalItems")}else V(c.items)&&(M=n+"/items");if(M){let O=ct(y+"/-",e.dataRecursiveRefMap,e.arrayMap),L=!O.length||O!==y+"/-",R=ct(M,e.schemaRecursiveRefMap,e.arrayMap);if(O.length&&!T(e.layoutRefLibrary,O)&&(e.layoutRefLibrary[O]=null,e.layoutRefLibrary[O]=Sn(e,i,null,R,L?"":r+"/-",!0,"list",s,!0,L?r+"/-":""),L&&(e.layoutRefLibrary[O].recursiveReference=!0)),!L||h.options.required){let F=Math.min(Math.max(L?0:h.options.tupleItems+h.options.listItems,D(t)?t.length:0),h.options.maxItems);if(h.items.length<F)for(let se=h.items.length;se<F;se++)h.items.push(Hs({$ref:O,dataPointer:r+"/-",recursiveReference:L},e,i,D(t)?t[se]:null))}if(h.options.addable!==!1&&h.options.minItems<h.options.maxItems&&(h.items[h.items.length-1]||{}).type!=="$ref"){let F=((e.layoutRefLibrary[O]||{}).options||{}).title,se=F?"Add ":"Add to ";F||(F=c.title||Si(N.toKey(r))),/^add\b/i.test(F)||(F=se+F),h.items.push({_id:(0,Ii.default)(),arrayItem:!0,arrayItemType:"list",dataPointer:h.dataPointer+"/-",options:{listItems:h.options.listItems,maxItems:h.options.maxItems,minItems:h.options.minItems,removable:!1,title:F,tupleItems:h.options.tupleItems},recursiveReference:L,type:"$ref",widget:i.getWidget("$ref"),$ref:O})}}}else if(h.dataType==="$ref"){let M=N.compile(c.$ref),O=N.toDataPointer(M,e.schema),L="";if(h.options.add)L=h.options.add;else if(h.name&&!/^\d+$/.test(h.name))L=(/^add\b/i.test(h.name)?"":"Add ")+Si(h.name);else{let R=N.get(e.schema,n,0,-1);if(T(R,"title"))L="Add to "+R.title;else{let F=N.parse(h.dataPointer);L="Add to "+Si(F[F.length-2])}}if(Object.assign(h,{recursiveReference:!0,widget:i.getWidget("$ref"),$ref:O}),Object.assign(h.options,{removable:!1,title:L}),He(N.get(e.schema,n,0,-1).maxItems)&&(h.options.maxItems=N.get(e.schema,n,0,-1).maxItems),O.length)if(T(e.layoutRefLibrary,O))e.layoutRefLibrary[O].recursiveReference||(e.layoutRefLibrary[O].recursiveReference=!0);else{e.layoutRefLibrary[O]=null;let R=Sn(e,i,null,M,"",h.arrayItem,h.arrayItemType,!0,!0,r);R?(R.recursiveReference=!0,e.layoutRefLibrary[O]=R):delete e.layoutRefLibrary[O]}}return h}function lx(e,i,t="",n=e){let r=0,o=[];return $t(e,(a,s)=>{let l=+s+r,u=t+"/"+l,c=Rs(a),p=[];V(a)&&(T(a,"tabs")&&(a.items=a.tabs,delete a.tabs),T(a,"items")&&(p=D(a.items)?a.items:[a.items])),p.length&&(c.items=lx(p,i,u+"/items",n)),c=i(c,l,u,n),Ce(c)?(D(c)&&(r+=c.length-1),o=o.concat(c)):r--}),o}function Hs(e,i,t=null,n=null){if(e.recursiveReference&&t){let r=(0,me.default)(e);return r.options||(r.options={}),Object.assign(r,{recursiveReference:!0,widget:t.getWidget("$ref")}),Object.assign(r.options,{removable:!1,title:"Add "+r.$ref}),r}else{let r=i.layoutRefLibrary[e.$ref];return Ce(n)?r=Sn(i,t,n,N.toSchemaPointer(e.$ref,i.schema),e.$ref,r.arrayItem,r.arrayItemType,r.options.removable,!1):(r=(0,me.default)(r),N.forEachDeep(r,(o,a)=>{T(o,"_id")&&(o._id=(0,Ii.default)()),e.recursiveReference&&T(o,"dataPointer")&&(o.dataPointer=e.dataPointer+o.dataPointer)})),r}}function Od(e,i,t=!0,n=!0){let r=[],o=!1;if(e)if(D(e))if(i){for(let a of Object.keys(e))if(V(e[a])){let s=e[a].value;if(i.includes(s)){let l=e[a].name;r.push({name:l,value:s}),s==null&&(o=!0)}}else if(Pe(e[a])&&a<i.length){let s=e[a],l=i[a];r.push({name:s,value:l}),l==null&&(o=!0)}}else r=e,t||(o=!!r.filter(a=>a.value===void 0||a.value===null).length);else if(i)for(let a of Object.keys(i)){let s=i[a];if(T(e,s)){let l=e[s];r.push({name:l,value:s}),s==null&&(o=!0)}}else for(let a of Object.keys(e)){let s=e[a];r.push({name:s,value:a}),a==null&&(o=!0)}else if(i)for(let a of Object.keys(i)){let s=i[a],l=i[a];r.push({name:s,value:l}),l==null&&(o=!0)}else r=[{name:"True",value:!0},{name:"False",value:!1}];return r.some(a=>T(a,"group"))&&(o=!1,n?r=r.reduce((a,s)=>(T(s,"group")?(D(s.items)&&(a=[...a,...s.items.map(l=>$e(X({},l),{name:`${s.group}: ${l.name}`}))],s.items.some(l=>l.value===void 0||l.value===null)&&(o=!0)),T(s,"name")&&T(s,"value")&&(s.name=`${s.group}: ${s.name}`,delete s.group,a.push(s),(s.value===void 0||s.value===null)&&(o=!0))):(a.push(s),(s.value===void 0||s.value===null)&&(o=!0)),a),[]):r=r.reduce((a,s)=>(T(s,"group")?(s.group!==(a[a.length-1]||{}).group&&a.push({group:s.group,items:s.items||[]}),T(s,"name")&&T(s,"value")&&(a[a.length-1].items.push({name:s.name,value:s.value}),(s.value===void 0||s.value===null)&&(o=!0))):(a.push(s),(s.value===void 0||s.value===null)&&(o=!0)),a),[])),!t&&!o&&r.unshift({name:"<em>None</em>",value:null}),r}var Ke=(()=>{let i=class i{setDraggableState(n){this.draggableStateSubject.next(n)}setSortableOptions(n){this.sortableOptionsSubject.next(n)}constructor(){this.JsonFormCompatibility=!1,this.ReactJsonSchemaFormCompatibility=!1,this.AngularSchemaFormCompatibility=!1,this.tpldata={},this.ajvOptions={allErrors:!0,validateFormats:!1,strict:!1},this.ajv=(0,ax.default)(new ix.default(this.ajvOptions),["uniqueItemProperties"]),this.validateFormData=null,this.formValues={},this.data={},this.schema={},this.layout=[],this.formGroupTemplate={},this.formGroup=null,this.framework=null,this.validData=null,this.isValid=null,this.ajvErrors=null,this.validationErrors=null,this.dataErrors=new Map,this.formValueSubscription=null,this.dataChanges=new Pt,this.isValidChanges=new Pt,this.validationErrorChanges=new Pt,this.arrayMap=new Map,this.dataMap=new Map,this.dataRecursiveRefMap=new Map,this.schemaRecursiveRefMap=new Map,this.schemaRefLibrary={},this.layoutRefLibrary={"":null},this.templateRefLibrary={},this.hasRootReference=!1,this.language="en-US",this.defaultFormOptions={autocomplete:!0,addSubmit:"auto",debug:!1,disableInvalidSubmit:!0,formDisabled:!1,formReadonly:!1,fieldsRequired:!1,framework:"no-framework",loadExternalAssets:!1,pristine:{errors:!0,success:!0},supressPropertyTitles:!1,setSchemaDefaults:"auto",setLayoutDefaults:"auto",validateOnRender:"auto",widgets:{},defaultWidgetOptions:{listItems:1,addable:!0,orderable:!0,removable:!0,enableErrorState:!0,enableSuccessState:!0,feedback:!1,feedbackOnRender:!1,notitle:!1,disabled:!1,readonly:!1,returnEmptyFields:!0,validationMessages:{}}},this.draggableStateSubject=new Xs(!0),this.draggableState$=this.draggableStateSubject.asObservable(),this.sortableOptionsSubject=new Xs({disabled:!1}),this.sortableOptions$=this.sortableOptionsSubject.asObservable(),this.setLanguage(this.language),this.ajv.addMetaSchema(jh),this.ajv.addMetaSchema(Vh)}ngOnDestroy(){this.fcValueChangesSubs?.unsubscribe(),this.fcStatusChangesSubs?.unsubscribe(),this.formValueSubscription?.unsubscribe(),this.fcValueChangesSubs=null,this.fcStatusChangesSubs=null,this.formValueSubscription=null}setLanguage(n="en-US"){this.language=n;let r={de:uR,en:cR,es:dR,fr:pR,it:fR,pt:mR,zh:hR},o=n.slice(0,2),a=r[o];this.defaultFormOptions.defaultWidgetOptions.validationMessages=(0,me.default)(a)}getData(){return this.data}getSchema(){return this.schema}getLayout(){return this.layout}resetAllValues(){this.JsonFormCompatibility=!1,this.ReactJsonSchemaFormCompatibility=!1,this.AngularSchemaFormCompatibility=!1,this.tpldata={},this.validateFormData=null,this.formValues={},this.schema={},this.layout=[],this.formGroupTemplate={},this.formGroup=null,this.framework=null,this.data={},this.validData=null,this.isValid=null,this.validationErrors=null,this.arrayMap=new Map,this.dataMap=new Map,this.dataRecursiveRefMap=new Map,this.schemaRecursiveRefMap=new Map,this.layoutRefLibrary={},this.schemaRefLibrary={},this.templateRefLibrary={},this.formOptions=(0,me.default)(this.defaultFormOptions)}buildRemoteError(n){$t(n,(r,o)=>{if(o in this.formGroup.controls)for(let a of r){let s={};s[a.code]=a.message,this.formGroup.get(o).setErrors(s,{emitEvent:!0})}})}validateData(n,r=!0){this.data=FR(n,this.dataMap,this.dataRecursiveRefMap,this.arrayMap,this.formOptions.returnEmptyFields),this.isValid=this.validateFormData(this.data),this.validData=this.isValid?this.data:null;let o=a=>{let s={};return(a||[]).forEach(l=>{let u=l.instancePath||"ROOT";s[u]||(s[u]=[]),s[u].push(l.message)}),s};this.ajvErrors=this.validateFormData.errors,this.validationErrors=o(this.validateFormData.errors),r&&(this.dataChanges.next(this.data),this.isValidChanges.next(this.isValid),this.validationErrorChanges.next(this.ajvErrors))}buildFormGroupTemplate(n=null,r=!0){this.formGroupTemplate=Yi(this,n,r)}buildFormGroup(){this.formGroup=Go(this.formGroupTemplate),this.formGroup&&(this.compileAjvSchema(),this.validateData(this.formGroup.value),this.formValueSubscription&&this.formValueSubscription.unsubscribe(),this.formValueSubscription=this.formGroup.valueChanges.subscribe(n=>this.validateData(n)))}buildLayout(n){this.layout=qR(this,n)}setOptions(n){if(V(n)){let r=(0,me.default)(n);V(r.defaultOptions)&&(Object.assign(this.formOptions.defaultWidgetOptions,r.defaultOptions),delete r.defaultOptions),V(r.defaultWidgetOptions)&&(Object.assign(this.formOptions.defaultWidgetOptions,r.defaultWidgetOptions),delete r.defaultWidgetOptions),Object.assign(this.formOptions,r);let o=this.formOptions.defaultWidgetOptions;["ErrorState","SuccessState"].filter(a=>T(o,"disable"+a)).forEach(a=>{o["enable"+a]=!o["disable"+a],delete o["disable"+a]})}}compileAjvSchema(){this.validateFormData||(Array.isArray(this.schema.properties["ui:order"])&&(this.schema["ui:order"]=this.schema.properties["ui:order"],delete this.schema.properties["ui:order"]),this.ajv.removeSchema(this.schema),this.validateFormData=this.ajv.compile(this.schema))}buildSchemaFromData(n,r=!1){if(n)return Sd(n,r);this.schema=Sd(this.formValues,r)}buildSchemaFromLayout(n){if(n)return void 0;this.schema=(this.layout,void 0)}setTpldata(n={}){this.tpldata=n}parseText(n="",r={},o={},a=null){return!n||!/{{.+?}}/.test(n)?n:n.replace(/{{(.+?)}}/g,(...s)=>this.parseExpression(s[1],r,o,a,this.tpldata))}parseExpression(n="",r={},o={},a=null,s=null){if(typeof n!="string")return"";let l=typeof a=="number"?a+1+"":a||"";if(n=n.trim(),(n[0]==="'"||n[0]==='"')&&n[0]===n[n.length-1]&&n.slice(1,n.length-1).indexOf(n[0])===-1)return n.slice(1,n.length-1);if(n==="idx"||n==="$index")return l;if(n==="value"&&!T(o,"value"))return r;if(['"',"'"," ","||","&&","+"].every(u=>n.indexOf(u)===-1)){let u=N.parseObjectPath(n);return u[0]==="value"&&N.has(r,u.slice(1))?N.get(r,u.slice(1)):u[0]==="values"&&N.has(o,u.slice(1))?N.get(o,u.slice(1)):u[0]==="tpldata"&&N.has(s,u.slice(1))?N.get(s,u.slice(1)):N.has(o,u)?N.get(o,u):""}return n.indexOf("[idx]")>-1&&(n=n.replace(/\[idx\]/g,l)),n.indexOf("[$index]")>-1&&(n=n.replace(/\[$index\]/g,l)),n.indexOf("||")>-1?n.split("||").reduce((u,c)=>u||this.parseExpression(c,r,o,a,s),""):n.indexOf("&&")>-1?n.split("&&").reduce((u,c)=>u&&this.parseExpression(c,r,o,a,s)," ").trim():n.indexOf("+")>-1?n.split("+").map(u=>this.parseExpression(u,r,o,a,s)).join(""):""}setArrayItemTitle(n={},r=null,o=null){let a={layoutNode:()=>V(n.layoutNode)?n.layoutNode:n.layoutNode(),dataIndex:()=>V(n.dataIndex)?n.dataIndex:n.dataIndex()},s=a.layoutNode();if(s.options.buttonText)return s.options.buttonText;let l=this.getFormControlValue(a),u=(s.type||"").slice(-5)==="array"&&D(l),c=N.getFirst(u&&r.type!=="$ref"?[[r,"/options/legend"],[r,"/options/title"],[s,"/options/title"],[s,"/options/legend"]]:[[r,"/options/title"],[r,"/options/legend"],[s,"/options/title"],[s,"/options/legend"]]);if(!c)return c;let p=D(l)&&o<l.length?l[o]:l;return this.parseText(c,p,l,o)}setItemTitle(n){return!n.options.title&&/^(\d+|-)$/.test(n.layoutNode().name)?null:this.parseText(n.options.title||sx(n.layoutNode().name),this.getFormControlValue(n),(this.getFormControlGroup(n)||{}).value,n.dataIndex()[n.dataIndex().length-1])}evaluateCondition(n,r){let o=r&&r[r.length-1],a=!0;if(Z((n.options||{}).condition)){if(typeof n.options.condition=="string"){let s=n.options.condition;Z(o)&&(s=s.replace("[arrayIndex]",`[${o}]`)),s=N.parseObjectPath(s),a=!!N.get(this.data,s),!a&&s[0]==="model"&&(a=!!N.get({model:this.data},s))}else if(typeof n.options.condition=="function")a=n.options.condition(this.data);else if(typeof n.options.condition.functionBody=="string")try{a=new Function("model","arrayIndices",n.options.condition.functionBody)(this.data,r)}catch{a=!0,console.error("condition functionBody errored out on evaluation: "+n.options.condition.functionBody)}}return a}initializeControl(n,r=!0){if(!V(n))return!1;if(oe(n.options)&&(n.options=oe((n.layoutNode()||{}).options)?(0,me.default)(this.formOptions):n.layoutNode().options),n.formControl=this.getFormControl(n),n.boundControl=r&&!!n.formControl,n.formControl)n.controlName=this.getFormControlName(n),n.controlValue=n.formControl.value,n.controlDisabled=n.formControl.disabled,n.options.errorMessage=n.formControl.status==="VALID"?null:this.formatErrors(n.formControl.errors,n.options.validationMessages),n.options.showErrors=this.formOptions.validateOnRender===!0||this.formOptions.validateOnRender==="auto"&&Z(n.controlValue),this.fcStatusChangesSubs=n.formControl.statusChanges.subscribe(o=>n.options.errorMessage=o==="VALID"?null:this.formatErrors(n.formControl.errors,n.options.validationMessages)),this.fcValueChangesSubs=n.formControl.valueChanges.subscribe(o=>{(0,ii.default)(n.controlValue,o)||(n.controlValue=o)});else{n.controlName=n.layoutNode().name,n.controlValue=n.layoutNode().value||null;let o=this.getDataPointer(n);r&&o&&console.error(`warning: control "${o}" is not bound to the Angular FormGroup.`)}return n.boundControl}formatErrors(n,r={}){if(oe(n))return null;V(r)||(r={});let o=l=>l[0].toUpperCase()+(l.slice(1)||"").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/_/g," "),a=l=>typeof l=="object"?Object.keys(l).map(u=>l[u]===!0?o(u):l[u]===!1?"Not "+o(u):o(u)+": "+a(l[u])).join(", "):o(l.toString()),s=[];return Object.keys(n).filter(l=>l!=="required"||Object.keys(n).length===1).map(l=>typeof r=="string"?r:typeof r[l]=="function"?r[l](n[l]):typeof r[l]=="string"?/{{.+?}}/.test(r[l])?Object.keys(n[l]).reduce((u,c)=>u.replace(new RegExp("{{"+c+"}}","g"),n[l][c]),r[l]):r[l]:o(l)+" Error: "+a(n[l])).join("<br>")}updateValue(n,r){if(n.controlValue=r,n.boundControl&&(n.formControl.setValue(r),n.formControl.markAsDirty()),n.layoutNode().value=r,D(n.options.copyValueTo))for(let o of n.options.copyValueTo){let a=Vs(this.formGroup,o);V(a)&&typeof a.setValue=="function"&&(a.setValue(r),a.markAsDirty())}}updateArrayCheckboxList(n,r){let o=this.getFormControl(n);for(;o.value.length;)o.removeAt(0);let a=ct(n.layoutNode().dataPointer+"/-",this.dataRecursiveRefMap,this.arrayMap);for(let s of r)if(s.checked){let l=Go(this.templateRefLibrary[a]);l.setValue(s.value),o.push(l)}o.markAsDirty()}getFormControl(n){return!n||!n.layoutNode||!Ce(n.layoutNode().dataPointer)||n.layoutNode().type==="$ref"?null:Vs(this.formGroup,this.getDataPointer(n))}getFormControlValue(n){if(!n||!n.layoutNode||!Ce(n.layoutNode().dataPointer)||n.layoutNode().type==="$ref")return null;let r=Vs(this.formGroup,this.getDataPointer(n));return r?r.value:null}getFormControlGroup(n){return!n||!n.layoutNode||!Ce(n.layoutNode().dataPointer)?null:Vs(this.formGroup,this.getDataPointer(n),!0)}getFormControlName(n){return!n||!n.layoutNode||!Ce(n.layoutNode().dataPointer)||!Z(n.dataIndex())?null:N.toKey(this.getDataPointer(n))}getLayoutArray(n){return N.get(this.layout,this.getLayoutPointer(n),0,-1)}getParentNode(n){return N.get(this.layout,this.getLayoutPointer(n),0,-2)}getDataPointer(n){return!n||!n.layoutNode||!Ce(n.layoutNode().dataPointer)||!Z(n.dataIndex())?null:N.toIndexedPointer(n.layoutNode().dataPointer,n.dataIndex(),this.arrayMap)}getLayoutPointer(n){return Z(n.layoutIndex())?"/"+n.layoutIndex().join("/items/"):null}isControlBound(n){if(!n||!n.layoutNode||!Ce(n.layoutNode().dataPointer)||!Z(n.dataIndex()))return!1;let r=this.getFormControlGroup(n),o=this.getFormControlName(n);return r?T(r.controls,o):!1}addItem(n,r){if(!n||!n.layoutNode||!Ce(n.layoutNode().$ref)||!Z(n.dataIndex())||!Z(n.layoutIndex()))return!1;let o=Go(this.templateRefLibrary[n.layoutNode().$ref]);n.layoutNode().arrayItem?this.getFormControlGroup(n).push(o):this.getFormControlGroup(n).addControl(r||this.getFormControlName(n),o);let a=Hs(n.layoutNode(),this);return a.arrayItem=n.layoutNode().arrayItem,n.layoutNode().arrayItemType?a.arrayItemType=n.layoutNode().arrayItemType:delete a.arrayItemType,r&&(a.name=r,a.dataPointer+="/"+N.escape(r),a.options.title=Si(r)),N.insert(this.layout,this.getLayoutPointer(n),a),!0}moveArrayItem(n,r,o,a=!0){if(!n||!n.layoutNode||!Ce(n.layoutNode().dataPointer)||!Z(n.dataIndex())||!Z(n.layoutIndex())||!Ce(r)||!Ce(o)||r===o)return!1;let s=this.getFormControlGroup(n),l=s.at(r);if(s.removeAt(r),s.insert(o,l),s.updateValueAndValidity(),a){let u=this.getLayoutArray(n);u.splice(o,0,u.splice(r,1)[0])}return!0}removeItem(n){return!n||!n.layoutNode||!Ce(n.layoutNode().dataPointer)||!Z(n.dataIndex())||!Z(n.layoutIndex())?!1:(n.layoutNode().arrayItem?this.getFormControlGroup(n).removeAt(n.dataIndex()[n.dataIndex().length-1]):this.getFormControlGroup(n).removeControl(this.getFormControlName(n)),N.remove(this.layout,this.getLayoutPointer(n)),!0)}};i.\u0275fac=function(r){return new(r||i)},i.\u0275prov=Tt({token:i,factory:i.\u0275fac});let e=i;return e})(),ux=(()=>{let i=class i{constructor(){this.jsf=k(Ke),this.newComponent=null,this.layoutNode=z(void 0),this.layoutIndex=z(void 0),this.dataIndex=z(void 0),this.widgetContainer=Oi("widgetContainer",{read:tn})}ngOnInit(){this.updateComponent()}ngOnChanges(){this.updateComponent()}updateComponent(){let n=this.widgetContainer();if(n&&!this.newComponent&&(this.layoutNode()||{}).widget&&(this.newComponent=n.createComponent(this.layoutNode().widget)),this.newComponent)for(let r of["layoutNode","layoutIndex","dataIndex"])this.newComponent.instance[r]=this[r]}};i.\u0275fac=function(r){return new(r||i)},i.\u0275cmp=Q({type:i,selectors:[["select-widget-widget"]],viewQuery:function(r,o){r&1&&Ti(o.widgetContainer,kd,5,tn),r&2&&ki()},inputs:{layoutNode:[1,"layoutNode"],layoutIndex:[1,"layoutIndex"],dataIndex:[1,"dataIndex"]},standalone:!1,features:[Pi],decls:2,vars:0,consts:[["widgetContainer",""]],template:function(r,o){r&1&&$(0,"div",null,0)},encapsulation:2});let e=i;return e})(),VR=(()=>{let i=class i{constructor(){this.layoutNode=z(void 0),this.layoutIndex=z(void 0),this.dataIndex=z(void 0)}};i.\u0275fac=function(r){return new(r||i)},i.\u0275cmp=Q({type:i,selectors:[["no-framework"]],inputs:{layoutNode:[1,"layoutNode"],layoutIndex:[1,"layoutIndex"],dataIndex:[1,"dataIndex"]},standalone:!1,decls:1,vars:3,consts:[[3,"dataIndex","layoutIndex","layoutNode"]],template:function(r,o){r&1&&$(0,"select-widget-widget",0),r&2&&b("dataIndex",o.dataIndex())("layoutIndex",o.layoutIndex())("layoutNode",o.layoutNode())},dependencies:[ux],encapsulation:2});let e=i;return e})(),BR=(()=>{let i=class i extends Md{constructor(){super(...arguments),this.name="no-framework",this.text="None (plain HTML)",this.framework=VR}};i.\u0275fac=(()=>{let n;return function(o){return(n||(n=Xd(i)))(o||i)}})(),i.\u0275prov=Tt({token:i,factory:i.\u0275fac});let e=i;return e})(),cx=(()=>{let i=class i{constructor(n,r){this.renderer=n,this.elementRef=r}ngOnChanges(n){if(n.attributes)for(let r in this.attributes){let o=this.attributes[r];o?this.renderer.setAttribute(this.elementRef.nativeElement,r,o):this.renderer.removeAttribute(this.elementRef.nativeElement,r)}}};i.\u0275fac=function(r){return new(r||i)(fi(Qo),fi(Tn))},i.\u0275dir=nn({type:i,selectors:[["","attributes",""]],inputs:{attributes:"attributes"},standalone:!1,features:[Pi]});let e=i;return e})(),RR=(()=>{let i=class i{constructor(){this.jsf=k(Ke),this.layoutNode=z(void 0),this.layoutIndex=z(void 0),this.dataIndex=z(void 0)}ngOnInit(){this.options=this.layoutNode().options||{}}get showAddButton(){return!this.layoutNode().arrayItem||this.layoutIndex()[this.layoutIndex().length-1]<this.options.maxItems}addItem(n){n.preventDefault(),this.jsf.addItem(this)}get buttonText(){let n={dataIndex:this.dataIndex().slice(0,-1),layoutIndex:this.layoutIndex().slice(0,-1),layoutNode:this.jsf.getParentNode(this)};return n.layoutNode.add||this.jsf.setArrayItemTitle(n,this.layoutNode(),this.itemCount)}};i.\u0275fac=function(r){return new(r||i)},i.\u0275cmp=Q({type:i,selectors:[["add-reference-widget"]],inputs:{layoutNode:[1,"layoutNode"],layoutIndex:[1,"layoutIndex"],dataIndex:[1,"dataIndex"]},standalone:!1,decls:1,vars:1,consts:[[3,"class","disabled","click",4,"ngIf"],[3,"click","disabled"],[3,"class",4,"ngIf"],[3,"innerHTML",4,"ngIf"],[3,"innerHTML"]],template:function(r,o){r&1&&ue(0,sB,3,5,"button",0),r&2&&b("ngIf",o.showAddButton)},dependencies:[ht],encapsulation:2});let e=i;return e})(),LR=(()=>{let i=class i{constructor(){this.jsf=k(Ke),this.controlDisabled=!1,this.boundControl=!1,this.layoutNode=z(void 0),this.layoutIndex=z(void 0),this.dataIndex=z(void 0)}ngOnInit(){this.options=this.layoutNode().options||{},this.jsf.initializeControl(this)}updateValue(n){typeof this.options.onClick=="function"?this.options.onClick(n):this.jsf.updateValue(this,n.target.value)}};i.\u0275fac=function(r){return new(r||i)},i.\u0275cmp=Q({type:i,selectors:[["button-widget"]],inputs:{layoutNode:[1,"layoutNode"],layoutIndex:[1,"layoutIndex"],dataIndex:[1,"dataIndex"]},standalone:!1,decls:3,vars:11,consts:[[3,"click","disabled","name","type","value"],[3,"class","innerHTML",4,"ngIf"],[3,"innerHTML"]],template:function(r,o){if(r&1&&(f(0,"div")(1,"button",0),j("click",function(s){return o.updateValue(s)}),ue(2,lB,1,3,"span",1),m()()),r&2){let a,s;Y((o.options==null?null:o.options.htmlClass)||""),d(),Y((o.options==null?null:o.options.fieldHtmlClass)||""),b("disabled",o.controlDisabled)("name",o.controlName)("type",(a=o.layoutNode())==null?null:a.type)("value",o.controlValue),G("readonly",o.options!=null&&o.options.readonly?"readonly":null)("aria-describedby","control"+((s=o.layoutNode())==null?null:s._id)+"Status"),d(),b("ngIf",(o.options==null?null:o.options.icon)||(o.options==null?null:o.options.title))}},dependencies:[ht],encapsulation:2});let e=i;return e})(),UR=(()=>{let i=class i{constructor(){this.jsf=k(Ke),this.controlDisabled=!1,this.boundControl=!1,this.trueValue=!0,this.falseValue=!1,this.layoutNode=z(void 0),this.layoutIndex=z(void 0),this.dataIndex=z(void 0)}ngOnInit(){this.options=this.layoutNode().options||{},this.jsf.initializeControl(this),(this.controlValue===null||this.controlValue===void 0)&&(this.controlValue=this.options.title)}updateValue(n){n.preventDefault(),this.jsf.updateValue(this,n.target.checked?this.trueValue:this.falseValue)}get isChecked(){return this.jsf.getFormControlValue(this)===this.trueValue}};i.\u0275fac=function(r){return new(r||i)},i.\u0275cmp=Q({type:i,selectors:[["checkbox-widget"]],inputs:{layoutNode:[1,"layoutNode"],layoutIndex:[1,"layoutIndex"],dataIndex:[1,"dataIndex"]},standalone:!1,decls:5,vars:6,consts:[["type","checkbox",3,"formControl","class","id","name","readonly",4,"ngIf"],["type","checkbox",3,"checked","class","disabled","id","name","readonly","value","change",4,"ngIf"],[3,"display","innerHTML",4,"ngIf"],[1,"hb-uix-slider","hb-uix-round"],["type","checkbox",3,"formControl","id","name","readonly"],["type","checkbox",3,"change","checked","disabled","id","name","readonly","value"],[3,"innerHTML"]],template:function(r,o){if(r&1&&(f(0,"label"),ue(1,uB,1,7,"input",0)(2,cB,1,9,"input",1)(3,dB,1,3,"span",2),$(4,"span",3),m()),r&2){let a;Y((o.options==null?null:o.options.itemLabelHtmlClass)||" hb-uix-switch"),G("for","control"+((a=o.layoutNode())==null?null:a._id)),d(),b("ngIf",o.boundControl),d(),b("ngIf",!o.boundControl),d(),b("ngIf",o.options==null?null:o.options.title)}},dependencies:[ht,Di,bt,Fi],encapsulation:2});let e=i;return e})(),zR=(()=>{let i=class i{constructor(){this.jsf=k(Ke),this.controlDisabled=!1,this.boundControl=!1,this.checkboxList=[],this.layoutNode=z(void 0),this.layoutIndex=z(void 0),this.dataIndex=z(void 0)}ngOnInit(){this.options=this.layoutNode().options||{};let n=this.layoutNode();if(this.layoutOrientation=n.type==="checkboxes-inline"||n.type==="checkboxbuttons"?"horizontal":"vertical",this.jsf.initializeControl(this),this.checkboxList=Od(this.options.titleMap||this.options.enumNames,this.options.enum,!0),this.boundControl){let r=this.jsf.getFormControl(this);this.checkboxList.forEach(o=>o.checked=r.value.includes(o.value))}}updateValue(n){for(let r of this.checkboxList)n.target.value===r.value&&(r.checked=n.target.checked);this.boundControl&&this.jsf.updateArrayCheckboxList(this,this.checkboxList)}};i.\u0275fac=function(r){return new(r||i)},i.\u0275cmp=Q({type:i,selectors:[["checkboxes-widget"]],inputs:{layoutNode:[1,"layoutNode"],layoutIndex:[1,"layoutIndex"],dataIndex:[1,"dataIndex"]},standalone:!1,decls:3,vars:3,consts:[[3,"class","display","innerHTML",4,"ngIf"],[3,"class",4,"ngIf"],[4,"ngIf"],[3,"innerHTML"],[3,"class",4,"ngFor","ngForOf"],["type","checkbox",3,"change","checked","disabled","id","name","readonly","value"],[1,"hb-uix-slider","hb-uix-round"]],template:function(r,o){r&1&&ue(0,pB,1,5,"label",0)(1,mB,2,3,"div",1)(2,gB,2,1,"div",2),r&2&&(b("ngIf",o.options==null?null:o.options.title),d(),b("ngIf",o.layoutOrientation==="horizontal"),d(),b("ngIf",o.layoutOrientation==="vertical"))},dependencies:[an,ht],encapsulation:2});let e=i;return e})(),HR=(()=>{let i=class i{constructor(){this.jsf=k(Ke),this.controlDisabled=!1,this.boundControl=!1,this.layoutNode=z(void 0),this.layoutIndex=z(void 0),this.dataIndex=z(void 0)}ngOnInit(){this.options=this.layoutNode().options||{},this.jsf.initializeControl(this)}updateValue(n){this.jsf.updateValue(this,n.target.value)}};i.\u0275fac=function(r){return new(r||i)},i.\u0275cmp=Q({type:i,selectors:[["file-widget"]],inputs:{layoutNode:[1,"layoutNode"],layoutIndex:[1,"layoutIndex"],dataIndex:[1,"dataIndex"]},standalone:!1,decls:0,vars:0,template:function(r,o){},encapsulation:2});let e=i;return e})();var WR=(()=>{let i=class i{constructor(){this.jsf=k(Ke),this.controlDisabled=!1,this.boundControl=!1,this.autoCompleteList=[],this.layoutNode=z(void 0),this.layoutIndex=z(void 0),this.dataIndex=z(void 0)}get inputAttributes(){return this.options?.["x-inputAttributes"]}ngOnInit(){this.options=this.layoutNode().options||{},this.jsf.initializeControl(this)}updateValue(n){this.jsf.updateValue(this,n.target.value)}};i.\u0275fac=function(r){return new(r||i)},i.\u0275cmp=Q({type:i,selectors:[["input-widget"]],inputs:{layoutNode:[1,"layoutNode"],layoutIndex:[1,"layoutIndex"],dataIndex:[1,"dataIndex"]},standalone:!1,decls:5,vars:6,consts:[[1,"sortable-filter"],[3,"class","display","innerHTML",4,"ngIf"],[3,"formControl","class","id","name","readonly","type","attributes",4,"ngIf"],[3,"class","disabled","id","name","readonly","type","value","attributes","input",4,"ngIf"],[3,"id",4,"ngIf"],[3,"innerHTML"],[3,"formControl","id","name","readonly","type","attributes"],[3,"input","disabled","id","name","readonly","type","value","attributes"],[3,"id"],[3,"value",4,"ngFor","ngForOf"],[3,"value"]],template:function(r,o){r&1&&(f(0,"div",0),ue(1,_B,1,6,"label",1)(2,yB,1,15,"input",2)(3,bB,1,16,"input",3)(4,CB,2,2,"datalist",4),m()),r&2&&(Y((o.options==null?null:o.options.htmlClass)||""),d(),b("ngIf",o.options==null?null:o.options.title),d(),b("ngIf",o.boundControl),d(),b("ngIf",!o.boundControl),d(),b("ngIf",o.options==null||o.options.typeahead==null?null:o.options.typeahead.source))},dependencies:[an,ht,sn,ln,On,bt,Fi,cx],encapsulation:2});let e=i;return e})(),KR=(()=>{let i=class i{constructor(){this.jsf=k(Ke),this.message=null,this.layoutNode=z(void 0),this.layoutIndex=z(void 0),this.dataIndex=z(void 0)}ngOnInit(){this.options=this.layoutNode().options||{},this.message=this.options.help||this.options.helpvalue||this.options.msg||this.options.message}};i.\u0275fac=function(r){return new(r||i)},i.\u0275cmp=Q({type:i,selectors:[["message-widget"]],inputs:{layoutNode:[1,"layoutNode"],layoutIndex:[1,"layoutIndex"],dataIndex:[1,"dataIndex"]},standalone:!1,decls:1,vars:1,consts:[[3,"class","innerHTML",4,"ngIf"],[3,"innerHTML"]],template:function(r,o){r&1&&ue(0,xB,1,3,"span",0),r&2&&b("ngIf",o.message)},dependencies:[ht],encapsulation:2});let e=i;return e})(),GR=(()=>{let i=class i{constructor(){this.layoutNode=z(void 0),this.layoutIndex=z(void 0),this.dataIndex=z(void 0)}};i.\u0275fac=function(r){return new(r||i)},i.\u0275cmp=Q({type:i,selectors:[["none-widget"]],inputs:{layoutNode:[1,"layoutNode"],layoutIndex:[1,"layoutIndex"],dataIndex:[1,"dataIndex"]},standalone:!1,decls:0,vars:0,template:function(r,o){},encapsulation:2});let e=i;return e})(),JR=(()=>{let i=class i{constructor(){this.jsf=k(Ke),this.controlDisabled=!1,this.boundControl=!1,this.allowNegative=!0,this.allowDecimal=!0,this.allowExponents=!1,this.lastValidNumber="",this.layoutNode=z(void 0),this.layoutIndex=z(void 0),this.dataIndex=z(void 0)}get inputAttributes(){return this.options?.["x-inputAttributes"]}ngOnInit(){this.options=this.layoutNode().options||{},this.jsf.initializeControl(this),this.layoutNode().dataType==="integer"&&(this.allowDecimal=!1)}updateValue(n){this.jsf.updateValue(this,n.target.value)}};i.\u0275fac=function(r){return new(r||i)},i.\u0275cmp=Q({type:i,selectors:[["number-widget"]],viewQuery:function(r,o){if(r&1&&(Qs(wB,5),Qs(IB,5)),r&2){let a;Zs(a=el())&&(o.inputControl=a.first),Zs(a=el())&&(o.div=a.first)}},inputs:{layoutNode:[1,"layoutNode"],layoutIndex:[1,"layoutIndex"],dataIndex:[1,"dataIndex"]},standalone:!1,decls:6,vars:6,consts:[["divElt",""],["inputControl",""],[1,"sortable-filter"],[3,"class","display","innerHTML",4,"ngIf"],[3,"formControl","class","id","name","readonly","title","type","attributes",4,"ngIf"],[3,"class","disabled","id","name","readonly","title","type","value","attributes","input",4,"ngIf"],[3,"innerHTML",4,"ngIf"],[3,"innerHTML"],[3,"formControl","id","name","readonly","title","type","attributes"],[3,"input","disabled","id","name","readonly","title","type","value","attributes"]],template:function(r,o){if(r&1&&(f(0,"div",2,0),ue(2,SB,1,6,"label",3)(3,$B,2,16,"input",4)(4,EB,2,17,"input",5)(5,PB,1,1,"span",6),m()),r&2){let a;Y((o.options==null?null:o.options.htmlClass)||""),d(2),b("ngIf",o.options==null?null:o.options.title),d(),b("ngIf",o.boundControl),d(),b("ngIf",!o.boundControl),d(),b("ngIf",((a=o.layoutNode())==null?null:a.type)==="range")}},dependencies:[ht,On,bt,Fi,cx],encapsulation:2});let e=i;return e})(),XR=(()=>{let i=class i{constructor(){this.jsf=k(Ke),this.controlDisabled=!1,this.boundControl=!1,this.layoutNode=z(void 0),this.layoutIndex=z(void 0),this.dataIndex=z(void 0)}ngOnInit(){this.options=this.layoutNode().options||{},this.jsf.initializeControl(this)}updateValue(n){this.jsf.updateValue(this,n.target.value)}};i.\u0275fac=function(r){return new(r||i)},i.\u0275cmp=Q({type:i,selectors:[["one-of-widget"]],inputs:{layoutNode:[1,"layoutNode"],layoutIndex:[1,"layoutIndex"],dataIndex:[1,"dataIndex"]},standalone:!1,decls:0,vars:0,template:function(r,o){},encapsulation:2});let e=i;return e})(),YR=(()=>{let i=class i{constructor(){this.jsf=k(Ke),this.controlDisabled=!1,this.boundControl=!1,this.layoutOrientation="vertical",this.radiosList=[],this.layoutNode=z(void 0),this.layoutIndex=z(void 0),this.dataIndex=z(void 0)}ngOnInit(){this.options=this.layoutNode().options||{};let n=this.layoutNode();(n.type==="radios-inline"||n.type==="radiobuttons")&&(this.layoutOrientation="horizontal"),this.radiosList=Od(this.options.titleMap||this.options.enumNames,this.options.enum,!0),this.jsf.initializeControl(this)}updateValue(n){this.jsf.updateValue(this,n.target.value)}};i.\u0275fac=function(r){return new(r||i)},i.\u0275cmp=Q({type:i,selectors:[["radios-widget"]],inputs:{layoutNode:[1,"layoutNode"],layoutIndex:[1,"layoutIndex"],dataIndex:[1,"dataIndex"]},standalone:!1,decls:3,vars:3,consts:[[3,"class","display","innerHTML",4,"ngIf"],[3,"class",4,"ngIf"],[4,"ngIf"],[3,"innerHTML"],[3,"class",4,"ngFor","ngForOf"],["type","radio",3,"change","checked","disabled","id","name","value"]],template:function(r,o){r&1&&ue(0,TB,1,6,"label",0)(1,MB,2,3,"div",1)(2,DB,2,1,"div",2),r&2&&(b("ngIf",o.options==null?null:o.options.title),d(),b("ngIf",o.layoutOrientation==="horizontal"),d(),b("ngIf",o.layoutOrientation!=="horizontal"))},dependencies:[an,ht],encapsulation:2});let e=i;return e})(),Dd=(()=>{let i=class i{constructor(){this.jsf=k(Ke),this.newComponent=null,this.layoutNode=z(void 0),this.layoutIndex=z(void 0),this.dataIndex=z(void 0),this.widgetContainer=Oi("widgetContainer",{read:tn})}ngOnInit(){this.updateComponent()}ngOnChanges(){this.updateComponent()}updateComponent(){let n=this.widgetContainer();if(n&&!this.newComponent&&this.jsf.framework&&(this.newComponent=n.createComponent(this.jsf.framework)),this.newComponent)for(let r of["layoutNode","layoutIndex","dataIndex"])this.newComponent.instance[r]=this[r]}};i.\u0275fac=function(r){return new(r||i)},i.\u0275cmp=Q({type:i,selectors:[["select-framework-widget"]],viewQuery:function(r,o){r&1&&Ti(o.widgetContainer,kd,5,tn),r&2&&ki()},inputs:{layoutNode:[1,"layoutNode"],layoutIndex:[1,"layoutIndex"],dataIndex:[1,"dataIndex"]},standalone:!1,features:[Pi],decls:2,vars:0,consts:[["widgetContainer",""]],template:function(r,o){r&1&&$(0,"div",null,0)},encapsulation:2});let e=i;return e})(),QR=(()=>{let i=class i{constructor(){this.elementRef=k(Tn),this.jsf=k(Ke),this.ngZone=k(Zo),this.overParentElement=!1,this.overChildElement=!1,this.orderable=z(void 0),this.layoutNode=z(void 0),this.layoutIndex=z(void 0),this.dataIndex=z(void 0)}ngOnInit(){let n=this.layoutIndex();this.orderable()&&this.layoutNode()&&n&&this.dataIndex()&&(this.element=this.elementRef.nativeElement,this.element.draggable=!0,this.arrayLayoutIndex="move:"+n.slice(0,-1).toString(),this.ngZone.runOutsideAngular(()=>{this.element.addEventListener("dragstart",r=>{r.dataTransfer.effectAllowed="move",r.dataTransfer.setData("text","");let o=this.dataIndex()[this.dataIndex().length-1];sessionStorage.setItem(this.arrayLayoutIndex,o+"")}),this.element.addEventListener("dragover",r=>(r.preventDefault&&r.preventDefault(),r.dataTransfer.dropEffect="move",!1)),this.element.addEventListener("dragenter",r=>{if(this.overParentElement)return this.overChildElement=!0;this.overParentElement=!0;let o=sessionStorage.getItem(this.arrayLayoutIndex);o!==null&&(this.dataIndex()[this.dataIndex().length-1]<+o?this.element.classList.add("drag-target-top"):this.dataIndex()[this.dataIndex().length-1]>+o&&this.element.classList.add("drag-target-bottom"))}),this.element.addEventListener("dragleave",r=>{this.overChildElement?this.overChildElement=!1:this.overParentElement&&(this.overParentElement=!1);let o=sessionStorage.getItem(this.arrayLayoutIndex);!this.overParentElement&&!this.overChildElement&&o!==null&&(this.element.classList.remove("drag-target-top"),this.element.classList.remove("drag-target-bottom"))}),this.element.addEventListener("drop",r=>{this.element.classList.remove("drag-target-top"),this.element.classList.remove("drag-target-bottom");let o=sessionStorage.getItem(this.arrayLayoutIndex),a=this.dataIndex()[this.dataIndex().length-1];return o!==null&&+o!==a&&this.jsf.moveArrayItem(this,+o,a),sessionStorage.removeItem(this.arrayLayoutIndex),!1})}),this.draggableStateSubscription=this.jsf.draggableState$.subscribe(r=>{this.element.draggable=r}))}ngOnDestroy(){this.draggableStateSubscription&&this.draggableStateSubscription.unsubscribe()}};i.\u0275fac=function(r){return new(r||i)},i.\u0275dir=nn({type:i,selectors:[["","orderable",""]],inputs:{orderable:[1,"orderable"],layoutNode:[1,"layoutNode"],layoutIndex:[1,"layoutIndex"],dataIndex:[1,"dataIndex"]},standalone:!1});let e=i;return e})(),Nd=(()=>{let i=class i{constructor(){this.jsf=k(Ke),this.dataIndex=z(void 0),this.layoutIndex=z(void 0),this.layout=z(void 0),this.isOrderable=z(void 0),this.isFlexItem=z(!1),this.sortableConfig={filter:".sortable-filter",preventOnFilter:!1,delay:1e3,delayOnTouchOnly:!0,onEnd:n=>{n.newIndex;let r=n.oldIndex,o=n.newIndex,a=this.layout()[o],s=a?.arrayItem?(this.dataIndex()||[]).concat(o):this.dataIndex()||[],l=(this.layoutIndex()||[]).concat(o),u={dataIndex:()=>s,layoutIndex:()=>l,layoutNode:()=>a};this.jsf.moveArrayItem(u,n.oldIndex,n.newIndex,!1)}}}sortableInit(n){this.sortableObj=n}isDraggable(n){let r=n.arrayItem&&n.type!=="$ref"&&n.arrayItemType==="list"&&this.isOrderable()!==!1;return this.sortableObj,r}getFlexAttribute(n,r){let o=["flex-grow","flex-shrink","flex-basis"].indexOf(r);return((n.options||{}).flex||"").split(/\s+/)[o]||(n.options||{})[r]||["1","1","auto"][o]}showWidget(n){return this.jsf.evaluateCondition(n,this.dataIndex())}ngOnInit(){this.sortableOptionsSubscription=this.jsf.sortableOptions$.subscribe(n=>{this.sortableObj&&Object.keys(n).forEach(r=>{let o=n[r];this.sortableObj.option(r,o)})})}ngOnDestroy(){this.sortableOptionsSubscription&&this.sortableOptionsSubscription.unsubscribe()}};i.\u0275fac=function(r){return new(r||i)},i.\u0275cmp=Q({type:i,selectors:[["root-widget"]],inputs:{dataIndex:[1,"dataIndex"],layoutIndex:[1,"layoutIndex"],layout:[1,"layout"],isOrderable:[1,"isOrderable"],isFlexItem:[1,"isFlexItem"]},standalone:!1,decls:3,vars:5,consts:[["sortableContainter",""],[3,"init","nxtSortablejs","config"],[3,"form-flex-item","align-self","flex-basis","flex-grow","flex-shrink","order","sortable-filter",4,"ngFor","ngForOf"],[3,"dataIndex","layoutIndex","layoutNode","orderable"],[3,"dataIndex","layoutIndex","layoutNode",4,"ngIf"],[3,"dataIndex","layoutIndex","layoutNode"]],template:function(r,o){if(r&1){let a=H();f(0,"div",1,0),j("init",function(l){return A(a),q(o.sortableInit(l))}),ue(2,FB,3,26,"div",2),m()}r&2&&(Mi("flex-inherit",!0),b("nxtSortablejs",o.layout())("config",o.sortableConfig),d(2),b("ngForOf",o.layout()))},dependencies:[an,ht,Qv,Dd,QR],styles:["[draggable=true][_ngcontent-%COMP%]{transition:all .15s cubic-bezier(.4,0,.2,1)}[draggable=true][_ngcontent-%COMP%]:hover{cursor:move;box-shadow:2px 2px 4px #0003;position:relative;z-index:10;margin:-1px 1px 1px -1px}[draggable=true].drag-target-top[_ngcontent-%COMP%]{box-shadow:0 -2px #000;position:relative;z-index:20}[draggable=true].drag-target-bottom[_ngcontent-%COMP%]{box-shadow:0 2px #000;position:relative;z-index:20}.flex-inherit[_ngcontent-%COMP%]{display:inherit;flex-flow:inherit;flex-wrap:inherit;flex-direction:inherit;width:100%}"]});let e=i;return e})(),ZR=(()=>{let i=class i{constructor(){this.jsf=k(Ke),this.expanded=!0,this.layoutNode=z(void 0),this.layoutIndex=z(void 0),this.dataIndex=z(void 0)}get sectionTitle(){return this.options.notitle?null:this.jsf.setItemTitle(this)}ngOnInit(){switch(this.jsf.initializeControl(this),this.options=this.layoutNode().options||{},this.expanded=typeof this.options.expanded=="boolean"?this.options.expanded:!this.options.expandable,this.layoutNode().type){case"fieldset":case"array":case"tab":case"advancedfieldset":case"authfieldset":case"optionfieldset":case"selectfieldset":this.containerType="fieldset";break;default:this.containerType="div";break}}toggleExpanded(){this.options.expandable&&(this.expanded=!this.expanded)}getFlexAttribute(n){let r=this.layoutNode().type==="flex"||!!this.options.displayFlex||this.options.display==="flex";if(n!=="flex"&&!r)return null;switch(n){case"is-flex":return r;case"display":return r?"flex":"initial";case"flex-direction":case"flex-wrap":let o=["flex-direction","flex-wrap"].indexOf(n);return(this.options["flex-flow"]||"").split(/\s+/)[o]||this.options[n]||["column","nowrap"][o];case"justify-content":case"align-items":case"align-content":return this.options[n]}}};i.\u0275fac=function(r){return new(r||i)},i.\u0275cmp=Q({type:i,selectors:[["section-widget"]],inputs:{layoutNode:[1,"layoutNode"],layoutIndex:[1,"layoutIndex"],dataIndex:[1,"dataIndex"]},standalone:!1,decls:2,vars:2,consts:[[3,"class","expandable","expanded",4,"ngIf"],[3,"class","expandable","expanded","disabled",4,"ngIf"],["class","legend",3,"class","innerHTML","click",4,"ngIf"],[3,"dataIndex","layout","layoutIndex","isFlexItem","isOrderable"],[1,"legend",3,"click","innerHTML"],[3,"disabled"],[4,"ngIf"],["class","help-block",3,"class","innerHTML",4,"ngIf"],[1,"help-block",3,"innerHTML"]],template:function(r,o){r&1&&ue(0,qB,3,28,"div",0)(1,UB,5,31,"fieldset",1),r&2&&(b("ngIf",o.containerType==="div"),d(),b("ngIf",o.containerType==="fieldset"))},dependencies:[ht,Nd],styles:[".legend[_ngcontent-%COMP%]{font-weight:700}.expandable[_ngcontent-%COMP%] > legend[_ngcontent-%COMP%], .expandable[_ngcontent-%COMP%] > label[_ngcontent-%COMP%], .expanded[_ngcontent-%COMP%] > legend[_ngcontent-%COMP%], .expanded[_ngcontent-%COMP%] > label[_ngcontent-%COMP%]{cursor:pointer;}.expandable[_ngcontent-%COMP%] > legend[_ngcontent-%COMP%]:before, .expandable[_ngcontent-%COMP%] > label[_ngcontent-%COMP%]:before{font-weight:900;font-family:'Font Awesome 7 Free';content:'\\f054';padding-right:.3em;}.expanded[_ngcontent-%COMP%] > legend[_ngcontent-%COMP%]:before, .expanded[_ngcontent-%COMP%] > label[_ngcontent-%COMP%]:before{font-weight:900;font-family:'Font Awesome 7 Free';content:'\\f078';padding-right:.2em;}"]});let e=i;return e})(),e4=(()=>{let i=class i{constructor(){this.jsf=k(Ke),this.controlDisabled=!1,this.boundControl=!1,this.selectList=[],this.isArray=D,this.layoutNode=z(void 0),this.layoutIndex=z(void 0),this.dataIndex=z(void 0)}ngOnInit(){this.options=this.layoutNode().options||{},this.selectList=Od(this.options.titleMap||this.options.enumNames,this.options.enum,!!this.options.required,!!this.options.flatList),this.jsf.initializeControl(this),this.valueChanges=this.formControl.valueChanges.subscribe(n=>{n==="null"&&this.formControl.setValue(null)})}ngOnDestroy(){this.valueChanges&&this.valueChanges.unsubscribe()}updateValue(n){this.jsf.updateValue(this,n.target.value)}};i.\u0275fac=function(r){return new(r||i)},i.\u0275cmp=Q({type:i,selectors:[["select-widget"]],inputs:{layoutNode:[1,"layoutNode"],layoutIndex:[1,"layoutIndex"],dataIndex:[1,"dataIndex"]},standalone:!1,decls:4,vars:5,consts:[[3,"class","display","innerHTML",4,"ngIf"],[3,"formControl","class","id","name",4,"ngIf"],[3,"class","disabled","id","name","change",4,"ngIf"],[3,"innerHTML"],[3,"formControl","id","name"],["ngFor","",3,"ngForOf"],[3,"value",4,"ngIf"],[3,"label",4,"ngIf"],[3,"value"],[3,"label"],[3,"value",4,"ngFor","ngForOf"],[3,"change","disabled","id","name"],[3,"selected","value",4,"ngIf"],[3,"selected","value"]],template:function(r,o){r&1&&(f(0,"div"),ue(1,zB,1,6,"label",0)(2,JB,2,9,"select",1)(3,eR,2,9,"select",2),m()),r&2&&(Y((o.options==null?null:o.options.htmlClass)||""),d(),b("ngIf",o.options==null?null:o.options.title),d(),b("ngIf",o.boundControl),d(),b("ngIf",!o.boundControl))},dependencies:[an,ht,sn,ln,Dn,bt,Fi],encapsulation:2});let e=i;return e})(),t4=(()=>{let i=class i{constructor(){this.jsf=k(Ke),this.controlDisabled=!1,this.boundControl=!1,this.layoutNode=z(void 0),this.layoutIndex=z(void 0),this.dataIndex=z(void 0)}ngOnDestroy(){this.isValidChangesSubs?.unsubscribe(),this.isValidChangesSubs=null}ngOnInit(){this.options=this.layoutNode().options||{},this.jsf.initializeControl(this),T(this.options,"disabled")?this.controlDisabled=this.options.disabled:this.jsf.formOptions.disableInvalidSubmit&&(this.controlDisabled=!this.jsf.isValid,this.isValidChangesSubs=this.jsf.isValidChanges.subscribe(n=>this.controlDisabled=!n)),(this.controlValue===null||this.controlValue===void 0)&&(this.controlValue=this.options.title)}updateValue(n){typeof this.options.onClick=="function"?this.options.onClick(n):this.jsf.updateValue(this,n.target.value)}};i.\u0275fac=function(r){return new(r||i)},i.\u0275cmp=Q({type:i,selectors:[["submit-widget"]],inputs:{layoutNode:[1,"layoutNode"],layoutIndex:[1,"layoutIndex"],dataIndex:[1,"dataIndex"]},standalone:!1,decls:2,vars:12,consts:[[3,"click","disabled","id","name","type","value"]],template:function(r,o){if(r&1&&(f(0,"div")(1,"input",0),j("click",function(s){return o.updateValue(s)}),m()()),r&2){let a,s,l;Y((o.options==null?null:o.options.htmlClass)||""),d(),Y((o.options==null?null:o.options.fieldHtmlClass)||""),b("disabled",o.controlDisabled)("id","control"+((a=o.layoutNode())==null?null:a._id))("name",o.controlName)("type",(s=o.layoutNode())==null?null:s.type)("value",o.controlValue),G("aria-describedby","control"+((l=o.layoutNode())==null?null:l._id)+"Status")("readonly",o.options!=null&&o.options.readonly?"readonly":null)("required",o.options==null?null:o.options.required)}},encapsulation:2});let e=i;return e})();var i4=(()=>{let i=class i{constructor(){this.jsf=k(Ke),this.selectedItem=0,this.showAddTab=!0,this.layoutNode=z(void 0),this.layoutIndex=z(void 0),this.dataIndex=z(void 0)}ngOnInit(){this.options=this.layoutNode().options||{},this.itemCount=this.layoutNode().items.length-1,this.updateControl()}select(n){let r=this.layoutNode();r.items[n].type==="$ref"&&(this.itemCount=r.items.length,this.jsf.addItem({layoutNode:Yo(r.items[n]),layoutIndex:Yo(this.layoutIndex().concat(n)),dataIndex:Yo(this.dataIndex().concat(n))}),this.updateControl()),this.selectedItem=n}updateControl(){let n=this.layoutNode().items[this.layoutNode().items.length-1];n.type==="$ref"&&this.itemCount>=(n.options.maxItems||1e3)&&(this.showAddTab=!1)}setTabTitle(n,r){return this.jsf.setArrayItemTitle(this,n,r)}};i.\u0275fac=function(r){return new(r||i)},i.\u0275cmp=Q({type:i,selectors:[["tabs-widget"]],inputs:{layoutNode:[1,"layoutNode"],layoutIndex:[1,"layoutIndex"],dataIndex:[1,"dataIndex"]},standalone:!1,decls:3,vars:4,consts:[["role","presentation","data-tabs","",3,"class",4,"ngFor","ngForOf"],[3,"class",4,"ngFor","ngForOf"],["role","presentation","data-tabs",""],[3,"class","innerHTML","click",4,"ngIf"],[3,"click","innerHTML"],[3,"class","dataIndex","layoutIndex","layoutNode",4,"ngIf"],[3,"dataIndex","layoutIndex","layoutNode"]],template:function(r,o){if(r&1&&(f(0,"ul"),ue(1,iR,2,3,"li",0),m(),ue(2,rR,2,3,"div",1)),r&2){let a,s;Y((o.options==null?null:o.options.labelHtmlClass)||""),d(),b("ngForOf",(a=o.layoutNode())==null?null:a.items),d(),b("ngForOf",(s=o.layoutNode())==null?null:s.items)}},dependencies:[an,ht,Dd],styles:["a[_ngcontent-%COMP%]{cursor:pointer}"]});let e=i;return e})(),n4=(()=>{let i=class i{constructor(){this.jsf=k(Ke),this.newComponent=null,this.layoutNode=z(void 0),this.layoutIndex=z(void 0),this.dataIndex=z(void 0),this.widgetContainer=Oi("widgetContainer",{read:tn})}ngOnInit(){this.updateComponent()}ngOnChanges(){this.updateComponent()}updateComponent(){let n=this.layoutNode(),r=this.widgetContainer();if(r&&!this.newComponent&&n.options.template&&(this.newComponent=r.createComponent(n.options.template)),this.newComponent)for(let o of["layoutNode","layoutIndex","dataIndex"])this.newComponent.instance[o]=this[o]}};i.\u0275fac=function(r){return new(r||i)},i.\u0275cmp=Q({type:i,selectors:[["template-widget"]],viewQuery:function(r,o){r&1&&Ti(o.widgetContainer,kd,5,tn),r&2&&ki()},inputs:{layoutNode:[1,"layoutNode"],layoutIndex:[1,"layoutIndex"],dataIndex:[1,"dataIndex"]},standalone:!1,features:[Pi],decls:2,vars:0,consts:[["widgetContainer",""]],template:function(r,o){r&1&&$(0,"div",null,0)},encapsulation:2});let e=i;return e})(),r4=(()=>{let i=class i{constructor(){this.jsf=k(Ke),this.controlDisabled=!1,this.boundControl=!1,this.layoutNode=z(void 0),this.layoutIndex=z(void 0),this.dataIndex=z(void 0)}ngOnInit(){this.options=this.layoutNode().options||{},this.jsf.initializeControl(this)}updateValue(n){this.jsf.updateValue(this,n.target.value)}};i.\u0275fac=function(r){return new(r||i)},i.\u0275cmp=Q({type:i,selectors:[["textarea-widget"]],inputs:{layoutNode:[1,"layoutNode"],layoutIndex:[1,"layoutIndex"],dataIndex:[1,"dataIndex"]},standalone:!1,decls:4,vars:5,consts:[[3,"class","display","innerHTML",4,"ngIf"],[3,"formControl","class","id","name",4,"ngIf"],[3,"class","disabled","id","name","value","input",4,"ngIf"],[3,"innerHTML"],[3,"formControl","id","name"],[3,"input","disabled","id","name","value"]],template:function(r,o){r&1&&(f(0,"div"),ue(1,oR,1,6,"label",0)(2,aR,1,12,"textarea",1)(3,sR,2,14,"textarea",2),m()),r&2&&(Y((o.options==null?null:o.options.htmlClass)||""),d(),b("ngIf",o.options==null?null:o.options.title),d(),b("ngIf",o.boundControl),d(),b("ngIf",!o.boundControl))},dependencies:[ht,On,bt,Fi],encapsulation:2});let e=i;return e})(),dx=(()=>{let i=class i{constructor(){this.defaultWidget="text",this.widgetLibrary={none:GR,root:Nd,"select-framework":Dd,"select-widget":ux,$ref:RR,email:"text",integer:"number",number:JR,password:"text",search:"text",tel:"text",text:WR,url:"text",color:"text",date:"text",datetime:"text","datetime-local":"text",month:"text",range:"number",time:"text",week:"text",checkbox:UR,file:HR,hidden:"text",image:"text",radio:"radios",reset:"submit",submit:t4,button:LR,select:e4,textarea:r4,checkboxes:zR,"checkboxes-inline":"checkboxes",checkboxbuttons:"checkboxes",radios:YR,"radios-inline":"radios",radiobuttons:"radios",section:ZR,div:"section",fieldset:"section",flex:"section","one-of":XR,array:"section",tabarray:"tabs",tab:"section",tabs:i4,message:KR,help:"message",msg:"message",html:"message",template:n4,advancedfieldset:"section",authfieldset:"section",optionfieldset:"one-of",selectfieldset:"one-of",conditional:"section",actions:"section",tagsinput:"section",updown:"number","date-time":"datetime-local","alt-datetime":"datetime-local","alt-date":"date",wizard:"section",textline:"text"},this.registeredWidgets={},this.frameworkWidgets={},this.activeWidgets={},this.setActiveWidgets()}setActiveWidgets(){this.activeWidgets=Object.assign({},this.widgetLibrary,this.frameworkWidgets,this.registeredWidgets);for(let n of Object.keys(this.activeWidgets)){let r=this.activeWidgets[n];if(typeof r=="string"){let o=[];for(;typeof r=="string"&&!o.includes(r);)o.push(r),r=this.activeWidgets[r];typeof r!="string"&&(this.activeWidgets[n]=r)}}return!0}setDefaultWidget(n){return this.hasWidget(n)?(this.defaultWidget=n,!0):!1}hasWidget(n,r="activeWidgets"){return!n||typeof n!="string"?!1:T(this[r],n)}hasDefaultWidget(n){return this.hasWidget(n,"widgetLibrary")}registerWidget(n,r){return!n||!r||typeof n!="string"?!1:(this.registeredWidgets[n]=r,this.setActiveWidgets())}unRegisterWidget(n){return T(this.registeredWidgets,n)?(delete this.registeredWidgets[n],this.setActiveWidgets()):!1}unRegisterAllWidgets(n=!0){return this.registeredWidgets={},n&&(this.frameworkWidgets={}),this.setActiveWidgets()}registerFrameworkWidgets(n){return(n===null||typeof n!="object")&&(n={}),this.frameworkWidgets=n,this.setActiveWidgets()}unRegisterFrameworkWidgets(){return Object.keys(this.frameworkWidgets).length?(this.frameworkWidgets={},this.setActiveWidgets()):!1}getWidget(n,r="activeWidgets"){return this.hasWidget(n,r)?this[r][n]:this.hasWidget(this.defaultWidget,r)?this[r][this.defaultWidget]:null}getAllWidgets(){return{widgetLibrary:this.widgetLibrary,registeredWidgets:this.registeredWidgets,frameworkWidgets:this.frameworkWidgets,activeWidgets:this.activeWidgets}}};i.\u0275fac=function(r){return new(r||i)},i.\u0275prov=Tt({token:i,factory:i.\u0275fac,providedIn:"root"});let e=i;return e})();var Td=(()=>{let i=class i{};i.\u0275fac=function(r){return new(r||i)},i.\u0275mod=kn({type:i}),i.\u0275inj=Pn({imports:[oa,Gt,Cr,Zv.forRoot({filter:".sortable-filter",preventOnFilter:!1})]});let e=i;return e})(),o4=(()=>{let i=class i{};i.\u0275fac=function(r){return new(r||i)},i.\u0275mod=kn({type:i}),i.\u0275inj=Pn({providers:[{provide:Md,useClass:BR,multi:!0}],imports:[oa,Td]});let e=i;return e})(),a4=(()=>{let i=class i{constructor(n){this.frameworks=n,this.widgetLibrary=k(dx),this.http=k(sp),this.activeFramework=null,this.loadExternalAssets=!1,this.frameworkLibrary={},this.frameworks.forEach(r=>this.frameworkLibrary[r.name]=r),this.defaultFramework=this.frameworks[0].name,this.activeFrameworkName=this.defaultFramework,this.activeFrameworkNameSubject=new Pt,this.activeFrameworkName$=this.activeFrameworkNameSubject.asObservable(),this.setFramework(this.defaultFramework)}setLoadExternalAssets(n=!0){this.loadExternalAssets=!!n}setFramework(n=this.defaultFramework,r=this.loadExternalAssets){return this.activeFramework=typeof n=="string"&&this.hasFramework(n)?this.frameworkLibrary[n]:typeof n=="object"&&T(n,"framework")?n:this.frameworkLibrary[this.defaultFramework],this.activeFramework.name!=this.activeFrameworkName&&(this.activeFrameworkName=this.activeFramework.name,this.activeFrameworkNameSubject.next(this.activeFrameworkName)),this.registerFrameworkWidgets(this.activeFramework)}registerFrameworkWidgets(n){return T(n,"widgets")?this.widgetLibrary.registerFrameworkWidgets(n.widgets):this.widgetLibrary.unRegisterFrameworkWidgets()}hasFramework(n){return T(this.frameworkLibrary,n)}getFramework(){return this.activeFramework||this.setFramework("default",!0),this.activeFramework.framework}getFrameworkList(){return this.frameworks.map(n=>({name:n.name,text:n.text}))}getFrameworkWidgets(){return this.activeFramework.widgets||{}}getFrameworkStylesheets(n=this.loadExternalAssets){return n&&this.activeFramework.stylesheets||[]}getFrameworkScripts(n=this.loadExternalAssets){return n&&this.activeFramework.scripts||[]}getFrameworkConfig(n){return(n||this.activeFramework).config}getFrameworkAssetConfig(n,r=!0){let a=`assets/${(n||this.activeFramework).name}/cssframework`,s=`${a}/assets.json`,l=this.http.get(s,{responseType:"text"});return zd(l).then(u=>{let c=JSON.parse(u);return r&&(c.stylesheets=c.stylesheets.map(p=>{let h=["/","//","http:","https:"],v=!1;return h.forEach(y=>{v=v||p.indexOf(y)==0}),v?p:`${a}/${p}`}),c.scripts=c.scripts.map(p=>`${a}/${p}`)),c})}getFrameworkThemes(){let n=this.getFrameworkConfig(),r;return n&&(r=n?.widgetstyles?.__themes__||[]),r}requestThemeChange(n,r=!1,o){let a=o||this.activeFramework;if(a.requestThemeChange){if(r){let l=this.getFrameworkThemes().filter(u=>u.name==n);if(!l||l.length==0)return!1}return a.requestThemeChange(n),!0}}getActiveTheme(n){let r=n||this.activeFramework;if(r.getActiveTheme)return r.getActiveTheme()}registerTheme(n,r){let o=r||this.activeFramework;if(o.registerTheme)return o.registerTheme(n)}unregisterTheme(n,r){let o=r||this.activeFramework;if(o.registerTheme)return o.unregisterTheme(n)}};i.\u0275fac=function(r){return new(r||i)(Jd(Md))},i.\u0275prov=Tt({token:i,factory:i.\u0275fac,providedIn:"root"});let e=i;return e})(),s4={provide:lp,useExisting:Kd(()=>Jo),multi:!0},Jo=(()=>{let i=class i{constructor(){this.changeDetector=k(op),this.frameworkLibrary=k(a4),this.widgetLibrary=k(dx),this.jsf=k(Ke),this.unsubscribeOnActivateForm$=new Pt,this.formValueSubscription=null,this.formInitialized=!1,this.objectWrap=!1,this.previousInputs={schema:null,layout:null,data:null,options:null,framework:null,widgets:null,form:null,model:null,JSONSchema:null,UISchema:null,formData:null,loadExternalAssets:null,debug:null},this.schema=z(void 0),this.layout=z(void 0),this.data=z(void 0),this.options=z(void 0),this.framework=z(void 0),this.widgets=z(void 0),this.form=z(void 0),this.model=z(void 0),this.JSONSchema=z(void 0),this.UISchema=z(void 0),this.formData=z(void 0),this.ngModel=z(void 0),this.language=z(void 0),this.loadExternalAssets=z(void 0),this.debug=z(void 0),this.theme=z(void 0),this.onChanges=mt(),this.onSubmit=mt(),this.isValid=mt(),this.validationErrors=mt(),this.formSchema=mt(),this.formLayout=mt(),this.dataChange=mt(),this.modelChange=mt(),this.formDataChange=mt(),this.ngModelChange=mt()}get value(){return this.objectWrap?this.jsf.data[1]:this.jsf.data}set value(n){this.setFormValues(n,!1)}ngOnDestroy(){this.dataChangesSubs?.unsubscribe(),this.statusChangesSubs?.unsubscribe(),this.isValidChangesSubs?.unsubscribe(),this.validationErrorChangesSubs?.unsubscribe(),this.dataChangesSubs=null,this.statusChangesSubs=null,this.isValidChangesSubs=null,this.validationErrorChangesSubs=null}getInputValue(n){return typeof this[n]=="function"?this[n]():this[n]}resetScriptsAndStyleSheets(){document.querySelectorAll(".ajsf").forEach(n=>n.remove())}loadScripts(n){(n||this.frameworkLibrary.getFrameworkScripts()).map(o=>{let a=document.createElement("script");a.src=o,a.type="text/javascript",a.async=!0,a.setAttribute("class","ajsf"),document.getElementsByTagName("head")[0].appendChild(a)})}loadStyleSheets(n){(n||this.frameworkLibrary.getFrameworkStylesheets()).map(o=>{let a=document.createElement("link");a.rel="stylesheet",a.href=o,a.setAttribute("class","ajsf"),document.getElementsByTagName("head")[0].appendChild(a)})}loadAssets(){this.frameworkLibrary.getFrameworkAssetConfig().then(n=>{this.resetScriptsAndStyleSheets(),this.loadScripts(n.scripts),this.loadStyleSheets(n.stylesheets)}).catch(n=>{console.log(n),this.resetScriptsAndStyleSheets(),this.loadScripts(),this.loadStyleSheets()})}ngOnInit(){this.updateForm(),this.loadAssets()}ngOnChanges(n){this.updateForm(),n.framework&&!n.framework.isFirstChange()&&n.framework.previousValue!==n.framework.currentValue&&this.loadAssets()}writeValue(n){this.setFormValues(n,!1),this.formValuesInput||(this.formValuesInput="ngModel")}registerOnChange(n){this.onChange=n}registerOnTouched(n){this.onTouched=n}setDisabledState(n){this.jsf.formOptions.formDisabled!==!!n&&(this.jsf.formOptions.formDisabled=!!n,this.initializeForm())}updateForm(){let n,r=this.language();if(!this.formInitialized||!this.formValuesInput||r&&r!==this.jsf.language)this.initializeForm();else{r&&r!==this.jsf.language&&this.jsf.setLanguage(r);let o=Object.keys(this.previousInputs).filter(l=>this.previousInputs[l]!==this.getInputValue(l)),a=!0;if(o.length===1&&o[0]==="form"&&this.formValuesInput.startsWith("form.")&&(o=Object.keys(this.previousInputs.form||{}).filter(l=>!(0,ii.default)(this.previousInputs.form[l],this.form()[l])).map(l=>`form.${l}`),a=!1),o.length===1&&o[0]===this.formValuesInput)if(this.formValuesInput.indexOf(".")===-1)n=this.getInputValue(this.formValuesInput),this.setFormValues(n,a);else{let[l,u]=this.formValuesInput.split(".");n=this.getInputValue(l)[u],this.setFormValues(n,a)}else o.length&&(this.initializeForm(n),this.onChange&&this.onChange(this.jsf.formValues),this.onTouched&&this.onTouched(this.jsf.formValues));let s=this.theme();s&&s!==this.frameworkLibrary.getActiveTheme()?.name&&this.frameworkLibrary.requestThemeChange(s),Object.keys(this.previousInputs).filter(l=>this.previousInputs[l]!==this.getInputValue(l)).forEach(l=>this.previousInputs[l]=this.getInputValue(l))}}setFormValues(n,r=!0){if(n){let o=this.objectWrap?n[1]:n;this.jsf.formGroup?r&&this.jsf.formGroup.reset({},{emitEvent:!1}):(this.jsf.formValues=n,this.activateForm()),this.jsf.formGroup&&this.jsf.formGroup.patchValue(o,{emitEvent:!1}),this.onChange&&this.onChange(o),this.onTouched&&this.onTouched(o)}else this.jsf.formGroup.reset()}submitForm(){let n=this.jsf.validData;this.onSubmit.emit(this.objectWrap?n[1]:n)}initializeForm(n){if(this.schema()||this.layout()||this.data()||this.form()||this.model()||this.JSONSchema()||this.UISchema()||this.formData()||this.ngModel()||this.jsf.data){if(this.jsf.resetAllValues(),this.initializeOptions(),this.initializeSchema(),this.initializeLayout(),this.initializeData(),n&&(this.jsf.formValues=n),this.activateForm(),this.debug()||this.jsf.formOptions.debug){let r=[];this.debugOutput=r.map(o=>JSON.stringify(o,null,2)).join(`
|
|
12
|
-
`)}this.formInitialized=!0}}initializeOptions(){let n=this.language();n&&n!==this.jsf.language&&this.jsf.setLanguage(n),this.jsf.setOptions({debug:!!this.debug()});let r=this.loadExternalAssets()||!1,o=this.framework()||"default",a=this.options();V(a)&&(this.jsf.setOptions(a),r=a.loadExternalAssets||r,o=a.framework||o);let s=this.form();V(s)&&V(s.options)&&(this.jsf.setOptions(s.options),r=s.options.loadExternalAssets||r,o=s.options.framework||o);let l=this.widgets();if(V(l)&&this.jsf.setOptions({widgets:l}),this.frameworkLibrary.setLoadExternalAssets(r),this.frameworkLibrary.setFramework(o),this.jsf.framework=this.frameworkLibrary.getFramework(),V(this.jsf.formOptions.widgets))for(let c of Object.keys(this.jsf.formOptions.widgets))this.widgetLibrary.registerWidget(c,this.jsf.formOptions.widgets[c]);V(s)&&V(s.tpldata)&&this.jsf.setTpldata(s.tpldata);let u=this.theme();u&&this.frameworkLibrary.requestThemeChange(u)}initializeSchema(){let n=this.form(),r=this.schema(),o=this.JSONSchema();V(r)?(this.jsf.AngularSchemaFormCompatibility=!0,this.jsf.schema=(0,me.default)(r)):T(n,"schema")&&V(n.schema)?this.jsf.schema=(0,me.default)(n.schema):V(o)?(this.jsf.ReactJsonSchemaFormCompatibility=!0,this.jsf.schema=(0,me.default)(o)):T(n,"JSONSchema")&&V(n.JSONSchema)?(this.jsf.ReactJsonSchemaFormCompatibility=!0,this.jsf.schema=(0,me.default)(n.JSONSchema)):T(n,"properties")&&V(n.properties)?this.jsf.schema=(0,me.default)(n):V(n),oe(this.jsf.schema)||(Ze("object",this.jsf.schema.type)&&(this.jsf.schema.type="object"),T(this.jsf.schema,"type")&&this.jsf.schema.type!=="object"?(this.jsf.schema={type:"object",properties:{1:this.jsf.schema}},this.objectWrap=!0):T(this.jsf.schema,"type")||(V(this.jsf.schema.properties)||V(this.jsf.schema.patternProperties)||V(this.jsf.schema.additionalProperties)?this.jsf.schema.type="object":(this.jsf.JsonFormCompatibility=!0,this.jsf.schema={type:"object",properties:this.jsf.schema})),this.jsf.schema=pr(this.jsf.schema),this.jsf.compileAjvSchema(),this.jsf.schema=MR(this.jsf.schema,this.jsf.schemaRefLibrary,this.jsf.schemaRecursiveRefMap,this.jsf.dataRecursiveRefMap,this.jsf.arrayMap),T(this.jsf.schemaRefLibrary,"")&&(this.jsf.hasRootReference=!0))}initializeData(){let n=this.form(),r=this.data(),o=this.model(),a=this.ngModel();Z(r)?(this.jsf.formValues=(0,me.default)(r),this.formValuesInput="data"):Z(o)?(this.jsf.AngularSchemaFormCompatibility=!0,this.jsf.formValues=(0,me.default)(o),this.formValuesInput="model"):Z(a)?(this.jsf.AngularSchemaFormCompatibility=!0,this.jsf.formValues=(0,me.default)(a),this.formValuesInput="ngModel"):V(n)&&Z(n.value)?(this.jsf.JsonFormCompatibility=!0,this.jsf.formValues=(0,me.default)(n.value),this.formValuesInput="form.value"):V(n)&&Z(n.data)?(this.jsf.formValues=(0,me.default)(n.data),this.formValuesInput="form.data"):Z(this.formData())?(this.jsf.ReactJsonSchemaFormCompatibility=!0,this.formValuesInput="formData"):T(n,"formData")&&Z(n.formData)?(this.jsf.ReactJsonSchemaFormCompatibility=!0,this.jsf.formValues=(0,me.default)(n.formData),this.formValuesInput="form.formData"):this.formValuesInput="data"}initializeLayout(){let n=u=>((V(u)||D(u))&&$t(u,(c,p)=>{T(c,"options")&&V(c.options)&&(c.titleMap=c.options,delete c.options)},"top-down"),u),r=this.form(),o=this.layout();D(o)?this.jsf.layout=(0,me.default)(o):D(r)?(this.jsf.AngularSchemaFormCompatibility=!0,this.jsf.layout=(0,me.default)(r)):r&&D(r.form)?(this.jsf.JsonFormCompatibility=!0,this.jsf.layout=n((0,me.default)(r.form))):r&&D(r.layout)?this.jsf.layout=(0,me.default)(r.layout):this.jsf.layout=["*"];let a=null,s=this.form(),l=this.UISchema();V(l)?(this.jsf.ReactJsonSchemaFormCompatibility=!0,a=(0,me.default)(l)):T(s,"UISchema")?(this.jsf.ReactJsonSchemaFormCompatibility=!0,a=(0,me.default)(s.UISchema)):T(s,"uiSchema")?(this.jsf.ReactJsonSchemaFormCompatibility=!0,a=(0,me.default)(s.uiSchema)):T(s,"customFormItems")&&(this.jsf.JsonFormCompatibility=!0,a=n((0,me.default)(s.customFormItems))),a&&N.forEachDeep(a,(u,c)=>{let p=c.replace(/\//g,"/properties/").replace(/\/properties\/items\/properties\//g,"/items/properties/").replace(/\/properties\/titleMap\/properties\//g,"/titleMap/properties/");if(Z(u)&&Z(c)){let h=N.toKey(c),v=(N.parse(p)||[]).slice(0,-2),y;h.toLowerCase()==="ui:order"?y=[...v,"ui:order"]:(h.slice(0,3).toLowerCase()==="ui:"&&(h=h.slice(3)),y=[...v,"x-schema-form",h]),N.has(this.jsf.schema,v)&&!N.has(this.jsf.schema,y)&&N.set(this.jsf.schema,y,u)}})}activateForm(){if(this.unsubscribeOnActivateForm$.next(),oe(this.jsf.schema)&&(oe(this.jsf.formValues)||this.jsf.buildSchemaFromData()),oe(this.jsf.schema)||(this.jsf.compileAjvSchema(),this.jsf.buildLayout(this.widgetLibrary),this.jsf.buildFormGroupTemplate(this.jsf.formValues),this.jsf.buildFormGroup()),this.jsf.formGroup){!oe(this.jsf.formValues)&&this.jsf.formOptions.setSchemaDefaults!==!0&&this.jsf.formOptions.setLayoutDefaults!==!0&&this.setFormValues(this.jsf.formValues),this.dataChangesSubs=this.jsf.dataChanges.pipe(vr(this.unsubscribeOnActivateForm$)).subscribe(r=>{this.onChanges.emit(this.objectWrap?r[1]:r),this.formValuesInput&&this.formValuesInput.indexOf(".")===-1&&this[`${this.formValuesInput}Change`].emit(this.objectWrap?r[1]:r)}),this.statusChangesSubs=this.jsf.formGroup.statusChanges.pipe(vr(this.unsubscribeOnActivateForm$)).subscribe(()=>this.changeDetector.markForCheck()),this.isValidChangesSubs=this.jsf.isValidChanges.pipe(vr(this.unsubscribeOnActivateForm$)).subscribe(r=>this.isValid.emit(r)),this.validationErrorChangesSubs=this.jsf.validationErrorChanges.pipe(vr(this.unsubscribeOnActivateForm$)).subscribe(r=>this.validationErrors.emit(r)),this.formSchema.emit(this.jsf.schema),this.formLayout.emit(this.jsf.layout),this.onChanges.emit(this.objectWrap?this.jsf.data[1]:this.jsf.data);let n=N.get(this.jsf,"/formOptions/validateOnRender");if(n){let r=o=>{(n===!0||Z(o.value))&&o.markAsTouched(),Object.keys(o.controls||{}).forEach(a=>r(o.controls[a]))};r(this.jsf.formGroup),this.isValid.emit(this.jsf.isValid),this.validationErrors.emit(this.jsf.ajvErrors)}}}};i.\u0275fac=function(r){return new(r||i)},i.\u0275cmp=Q({type:i,selectors:[["json-schema-form"]],inputs:{schema:[1,"schema"],layout:[1,"layout"],data:[1,"data"],options:[1,"options"],framework:[1,"framework"],widgets:[1,"widgets"],form:[1,"form"],model:[1,"model"],JSONSchema:[1,"JSONSchema"],UISchema:[1,"UISchema"],formData:[1,"formData"],ngModel:[1,"ngModel"],language:[1,"language"],loadExternalAssets:[1,"loadExternalAssets"],debug:[1,"debug"],theme:[1,"theme"],value:"value"},outputs:{onChanges:"onChanges",onSubmit:"onSubmit",isValid:"isValid",validationErrors:"validationErrors",formSchema:"formSchema",formLayout:"formLayout",dataChange:"dataChange",modelChange:"modelChange",formDataChange:"formDataChange",ngModelChange:"ngModelChange"},standalone:!1,features:[rp([Ke,s4]),Pi],decls:3,vars:3,consts:[[1,"json-schema-form",3,"ngSubmit","autocomplete"],[3,"layout"],[4,"ngIf"]],template:function(r,o){r&1&&(f(0,"form",0),j("ngSubmit",function(){return o.submitForm()}),$(1,"root-widget",1),m(),ue(2,lR,4,1,"div",2)),r&2&&(b("autocomplete",!(o.jsf==null||o.jsf.formOptions==null)&&o.jsf.formOptions.autocomplete?"on":"off"),d(),b("layout",o.jsf==null?null:o.jsf.layout),d(),b("ngIf",o.debug()||(o.jsf==null||o.jsf.formOptions==null?null:o.jsf.formOptions.debug)))},dependencies:[ht,mp,up,dp,Nd],encapsulation:2,changeDetection:0});let e=i;return e})(),px=(()=>{let i=class i{};i.\u0275fac=function(r){return new(r||i)},i.\u0275mod=kn({type:i}),i.\u0275inj=Pn({imports:[oa,Gt,Cr,Td,o4,Td]});let e=i;return e})();var fx=(()=>{class e{jsonSchemaForm=k(Jo,{host:!0,self:!0,optional:!0});jsfPatch=!1;constructor(){let t=this.jsonSchemaForm,n=t.jsf.buildLayout.bind(t.jsf);t.jsf.buildLayout=r=>{if(n(r),t.jsf.formValues&&this.jsfPatch)return this.fixNestedArrayLayout(t.jsf.layout,t.jsf.formValues)}}fixNestedArrayLayout(t,n){return this.fixArray(t,n,""),t}fixArray(t,n,r){if(Array.isArray(t)){let o=t.filter(l=>l.name!=="_bridge"),a=o.filter(l=>l.items&&Array.isArray(l.items)).flatMap(l=>l.items).filter(l=>l.dataType==="array"||l.arrayItem);o.concat(a).filter(l=>l.dataType==="array"||l.arrayItem).forEach(l=>{this.fixNestedArray(l,n,r)})}else this.fixNestedArray(t,n,r)}fixNestedArray(t,n,r){if(t.items&&Array.isArray(t.items)){let o=t.items.find(a=>a.type==="$ref");if(o){let a=t.items.filter(u=>u.type==="section"||u.type==="div"),s=a.length>0?a.reduce((u,c)=>u.id>c.id?u:c):this.getItemTemplateFromRef(o),l=this.getDataFromPointer(n,o.dataPointer.replace(r,""));if(l===null)return;if(Array.isArray(l)){for(;t.items.length-1<l.length;){let u=tl(s);u._id=Pp("new_"),t.items.unshift(u)}l.forEach((u,c)=>{this.fixArray(t.items[c],u,o.dataPointer)})}else this.fixArray(t.items,n,o.dataPointer)}else this.fixArray(t.items,n,r);t.items.filter(a=>a.items&&Array.isArray(a.items)).forEach(a=>{this.fixArray(a.items,n,r)})}}getDataFromPointer(t,n){let r=t;return n.substring(1).split(/\//).filter(o=>o!=="-").forEach(o=>{try{r=r[o]}catch{r=null}}),r}getItemTemplateFromRef(t){let n={type:"section",items:[]},r=tl(t);return Ep(r,n),r}static \u0275fac=function(n){return new(n||e)};static \u0275dir=nn({type:e,selectors:[["","jsfPatch",""]],inputs:{jsfPatch:"jsfPatch"}})}return e})();function u4(e,i){if(e&1){let t=H();f(0,"json-schema-form",1),j("onChanges",function(r){A(t);let o=_();return q(o.onChanges(r))})("isValid",function(r){A(t);let o=_();return q(o.validChange(r))})("validationErrors",function(r){A(t);let o=_();return q(o.validationErrors(r))}),m()}if(e&2){let t=_();b("jsfPatch",t.configSchema.fixArrays)("options",t.jsonFormOptions)("schema",t.configSchema.schema)("UISchema",t.configSchema.uiSchema)("layout",t.configSchema.layout)("form",t.configSchema.form)("data",t.currentData)("language",t.language)}}var Ks=(()=>{class e{$settings=k(Be);availableLanguages=["de","en","es","fr","it","pt","zh"];configSchema;data;dataChange=mt();dataChanged=mt();isValid=mt();currentData;language="en";jsonFormOptions={addSubmit:!1,loadExternalAssets:!1,returnEmptyFields:!1,setSchemaDefaults:!0,autocomplete:!1};ngOnInit(){let t=this.$settings.env.lang.split("-")[0];this.availableLanguages.includes(t)&&(this.language=t),this.currentData=this.data}onChanges(t){this.dataChange.emit(t),this.dataChanged.emit(t)}validChange(t){this.isValid.emit(t)}validationErrors(t){t&&t.forEach(n=>console.error(n.instancePath,n.message))}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=Q({type:e,selectors:[["app-schema-form"]],inputs:{configSchema:"configSchema",data:"data"},outputs:{dataChange:"dataChange",dataChanged:"dataChanged",isValid:"isValid"},decls:2,vars:1,consts:[["framework","bootstrap-5",1,"ng-bs5-validate",3,"jsfPatch","options","schema","UISchema","layout","form","data","language"],["framework","bootstrap-5",1,"ng-bs5-validate",3,"onChanges","isValid","validationErrors","jsfPatch","options","schema","UISchema","layout","form","data","language"]],template:function(n,r){n&1&&(ep(0),E(1,u4,1,8,"json-schema-form",0),tp()),n&2&&(d(),P(r.configSchema.schema?1:-1))},dependencies:[px,Jo,fx],encapsulation:2})}return e})();var c4=["custompluginui"];function d4(e,i){e&1&&(f(0,"div",6),$(1,"i",18),m())}function p4(e,i){if(e&1){let t=H();f(0,"div",8)(1,"app-schema-form",19),Ne("dataChange",function(r){A(t);let o=_();return De(o.pluginConfig[0],r)||(o.pluginConfig[0]=r),q(r)}),j("dataChanged",function(r){A(t);let o=_();return q(o.schemaFormUpdatedSubject.next(r))})("isValid",function(r){A(t);let o=_();return q(o.onIsValid(r))}),m()()}if(e&2){let t=_();d(),b("configSchema",t.schema),Oe("data",t.pluginConfig[0])}}function f4(e,i){if(e&1){let t=H();f(0,"button",23),j("click",function(){A(t);let r=_(2);return q(r.formActionSubject.next("cancel"))}),C(1),m()}if(e&2){let t=_(2);d(),U(t.formCancelButtonLabel)}}function m4(e,i){if(e&1){let t=H();f(0,"button",24),j("click",function(){A(t);let r=_(2);return q(r.formActionSubject.next("submit"))}),C(1),m()}if(e&2){let t=_(2);b("disabled",!t.formValid),d(),B(" ",t.formSubmitButtonLabel," ")}}function h4(e,i){if(e&1){let t=H();f(0,"div",8)(1,"app-schema-form",19),Ne("dataChange",function(r){A(t);let o=_();return De(o.formData,r)||(o.formData=r),q(r)}),j("dataChanged",function(r){A(t);let o=_();return q(o.formUpdatedSubject.next(r))})("isValid",function(r){A(t);let o=_();return q(o.formValidEvent(r))}),m(),f(2,"div",20),E(3,f4,2,1,"button",21),E(4,m4,2,2,"button",22),m()()}if(e&2){let t=_();d(),b("configSchema",t.formSchema),Oe("data",t.formData),d(2),P(t.formCancelButtonLabel?3:-1),d(),P(t.formSubmitButtonLabel?4:-1)}}function g4(e,i){e&1&&(f(0,"div",9),$(1,"i",18),m())}function _4(e,i){if(e&1&&($(0,"i",15),w(1,"translate")),e&2){let t=_();b("ngClass",t.formIsValid?"fa-circle-check green-text":t.strictValidation?"fa-circle-exclamation red-text":"fa-circle-exclamation orange-text")("ngbTooltip",S(1,3,t.formIsValid?"form.label_valid":t.strictValidation?"form.label_invalid_strict":"form.label_invalid"))("openDelay",150)}}function y4(e,i){e&1&&(C(0),w(1,"translate")),e&2&&B(" ",S(1,1,"form.button_save")," ")}function b4(e,i){e&1&&$(0,"i",17)}var mx=(()=>{class e{$activeModal=k(je);$api=k(ve);$modal=k(et);$plugin=k(en);$settings=k(Be);$toastr=k(we);$translate=k(xe);$ws=k(ji);customPluginUiElementTarget=Oi("custompluginui");plugin;schema;pluginConfig;pluginAlias;pluginType;loading=!0;saveInProgress=!1;pluginSpinner=!1;saveButtonDisabled=!1;uiLoaded=!1;showSchemaForm=!1;schemaFormUpdatedSubject=new Pt;formId;formSchema;formData;formSubmitButtonLabel;formCancelButtonLabel;formValid=!0;formUpdatedSubject=new Pt;formActionSubject=new Pt;childBridges=[];isFirstSave=!1;formIsValid=!0;strictValidation=!1;io;basePath;iframe;schemaFormRecentlyUpdated=!1;schemaFormRecentlyRefreshed=!1;schemaFormRefreshSubject=new Pt;ngOnInit(){this.io=this.$ws.connectToNamespace("plugins/settings-ui"),this.pluginAlias=this.schema.pluginAlias,this.pluginType=this.schema.pluginType,this.strictValidation=this.schema.strictValidation,this.pluginConfig.length===0&&(this.isFirstSave=!0),this.io.connected?(this.io.socket.emit("start",this.plugin.name),setTimeout(()=>{this.io.connected.subscribe(()=>{this.io.socket.emit("start",this.plugin.name)})},1e3)):this.io.connected.subscribe(()=>{this.io.socket.emit("start",this.plugin.name)}),this.io.socket.on("response",t=>{t.action="response",this.iframe.contentWindow.postMessage(t,qi.api.origin)}),this.io.socket.on("stream",t=>{t.action="stream",this.iframe.contentWindow.postMessage(t,qi.api.origin)}),this.io.socket.on("ready",()=>{this.loading=!1,this.loadUi()}),this.schemaFormRefreshSubject.pipe(En(250)).subscribe(this.schemaFormRefresh.bind(this)),this.schemaFormUpdatedSubject.pipe(En(250),Ys(1)).subscribe(this.schemaFormUpdated.bind(this)),this.formUpdatedSubject.pipe(En(100),Ys(1)).subscribe(this.formUpdated.bind(this)),this.formActionSubject.subscribe(this.formActionEvent.bind(this)),this.basePath=`/plugins/settings-ui/${encodeURIComponent(this.plugin.name)}`,window.addEventListener("message",this.handleMessage,!1)}onIsValid(t){this.formIsValid=t}formValidEvent(t){this.formValid=t}savePluginConfig(t=!1){return K(this,null,function*(){this.saveInProgress=!0;try{let n=yield le(this.$api.post(`/config-editor/plugin/${encodeURIComponent(this.plugin.name)}`,this.pluginConfig));if(this.saveInProgress=!1,t){if(this.isFirstSave&&this.$settings.env.recommendChildBridges&&n[0]?.platform){this.$activeModal.close(),this.$plugin.bridgeSettings(this.plugin,!0);return}if(!["homebridge","homebridge-config-ui-x"].includes(this.plugin.name)&&(yield this.getChildBridges(),this.childBridges.length>0)){this.$activeModal.close();let r=this.$modal.open(Fn,{size:"lg",backdrop:"static"});r.componentInstance.bridges=this.childBridges.map(o=>({name:o.name,username:o.username}));return}this.$activeModal.close(),this.$modal.open(oi,{size:"lg",backdrop:"static"})}}catch(n){this.saveInProgress=!1,console.error(n),this.$toastr.error(this.$translate.instant("config.failed_to_save_config"),this.$translate.instant("toast.title_error"))}})}dismissModal(){this.$activeModal.dismiss("Dismiss")}ngOnDestroy(){window.removeEventListener("message",this.handleMessage),this.io.end(),this.schemaFormRefreshSubject.complete(),this.schemaFormUpdatedSubject.complete(),this.formUpdatedSubject.complete()}loadUi(){this.iframe=this.customPluginUiElementTarget().nativeElement,this.iframe.src=`${qi.api.base+this.basePath}/index.html?origin=${encodeURIComponent(location.origin)}&v=${encodeURIComponent(this.plugin.installedVersion)}`}handleMessage=t=>{if(t.origin===qi.api.origin||t.origin===window.origin)switch(t.data.action){case"loaded":this.injectDefaultStyles(t),this.confirmReady(t);break;case"request":{this.handleRequest(t);break}case"scrollHeight":this.setiFrameHeight(t),this.uiLoaded=!0;break;case"config.get":{this.requestResponse(t,this.getConfigBlocks());break}case"config.save":{this.requestResponse(t,this.savePluginConfig());break}case"config.update":{this.handleUpdateConfig(t,t.data.pluginConfig);break}case"config.schema":{this.requestResponse(t,this.schema);break}case"cachedAccessories.get":{this.handleGetCachedAccessories(t);break}case"schema.show":{this.formEnd(),this.showSchemaForm=!0;break}case"schema.hide":{this.showSchemaForm=!1;break}case"form.create":{this.showSchemaForm=!1,this.formCreate(t.data.formId,t.data.schema,t.data.data,t.data.submitButton,t.data.cancelButton);break}case"form.end":{this.formEnd();break}case"user.lightingMode":{this.requestResponse(t,this.$settings.actualLightingMode);break}case"i18n.lang":{this.requestResponse(t,this.$translate.currentLang);break}case"i18n.translations":{this.requestResponse(t,this.$translate.store.translations[this.$translate.currentLang]);break}case"close":{this.$activeModal.close();break}case"toast.success":this.$toastr.success(t.data.message,t.data.title);break;case"toast.error":this.$toastr.error(t.data.message,t.data.title);break;case"toast.warning":this.$toastr.warning(t.data.message,t.data.title);break;case"toast.info":this.$toastr.info(t.data.message,t.data.title);break;case"spinner.show":this.pluginSpinner=!0;break;case"spinner.hide":this.pluginSpinner=!1;break;case"button.save.disabled":this.saveButtonDisabled=!0;break;case"button.save.enabled":this.saveButtonDisabled=!1;break;default:console.log(t)}};confirmReady(t){t.source.postMessage({action:"ready"},t.origin)}setiFrameHeight(t){this.iframe.style.height=`${t.data.scrollHeight+10}px`}handleRequest(t){this.io.socket.emit("request",t.data)}handleUpdateConfig(t,n){if(this.schemaFormRefreshSubject.next(void 0),!Array.isArray(n))return this.$toastr.error(this.$translate.instant("plugins.config.must_be_array"),this.$translate.instant("toast.title_error")),this.requestResponse(t,{message:this.$translate.instant("plugins.config.must_be_array")},!1);for(let r of n)if(typeof r!="object"||Array.isArray(r))return this.$toastr.error(this.$translate.instant("plugins.config.must_be_array_objects"),this.$translate.instant("toast.title_error")),this.requestResponse(t,{message:this.$translate.instant("plugins.config.must_be_array_objects")},!1);return this.updateConfigBlocks(n),this.requestResponse(t,this.getConfigBlocks())}requestResponse(t,n,r=!0){t.source.postMessage({action:"response",requestId:t.data.requestId,success:r,data:n},t.origin)}injectDefaultStyles(t){return K(this,null,function*(){let n=Array.from(window.document.body.classList).find(l=>l.startsWith("config-ui-x-")),r=window.document.body.classList.contains("dark-mode");t.source.postMessage({action:"body-class",class:n},t.origin),t.source.postMessage({action:"body-class",class:"modal-content"},t.origin),r&&t.source.postMessage({action:"body-class",class:"dark-mode"},t.origin);let o=Array.from(document.querySelectorAll("link"));for(let l of o)if(l.getAttribute("rel")==="stylesheet"){let u=l.getAttribute("href"),c=document.baseURI+(u.startsWith("/")?u.substring(1):u);t.source.postMessage({action:"link-element",href:c,rel:"stylesheet"},t.origin)}let a=Array.from(document.querySelectorAll("style"));for(let l of a)t.source.postMessage({action:"inline-style",style:l.innerHTML},t.origin);let s=`
|
|
12
|
+
`)}this.formInitialized=!0}}initializeOptions(){let n=this.language();n&&n!==this.jsf.language&&this.jsf.setLanguage(n),this.jsf.setOptions({debug:!!this.debug()});let r=this.loadExternalAssets()||!1,o=this.framework()||"default",a=this.options();V(a)&&(this.jsf.setOptions(a),r=a.loadExternalAssets||r,o=a.framework||o);let s=this.form();V(s)&&V(s.options)&&(this.jsf.setOptions(s.options),r=s.options.loadExternalAssets||r,o=s.options.framework||o);let l=this.widgets();if(V(l)&&this.jsf.setOptions({widgets:l}),this.frameworkLibrary.setLoadExternalAssets(r),this.frameworkLibrary.setFramework(o),this.jsf.framework=this.frameworkLibrary.getFramework(),V(this.jsf.formOptions.widgets))for(let c of Object.keys(this.jsf.formOptions.widgets))this.widgetLibrary.registerWidget(c,this.jsf.formOptions.widgets[c]);V(s)&&V(s.tpldata)&&this.jsf.setTpldata(s.tpldata);let u=this.theme();u&&this.frameworkLibrary.requestThemeChange(u)}initializeSchema(){let n=this.form(),r=this.schema(),o=this.JSONSchema();V(r)?(this.jsf.AngularSchemaFormCompatibility=!0,this.jsf.schema=(0,me.default)(r)):T(n,"schema")&&V(n.schema)?this.jsf.schema=(0,me.default)(n.schema):V(o)?(this.jsf.ReactJsonSchemaFormCompatibility=!0,this.jsf.schema=(0,me.default)(o)):T(n,"JSONSchema")&&V(n.JSONSchema)?(this.jsf.ReactJsonSchemaFormCompatibility=!0,this.jsf.schema=(0,me.default)(n.JSONSchema)):T(n,"properties")&&V(n.properties)?this.jsf.schema=(0,me.default)(n):V(n),oe(this.jsf.schema)||(Ze("object",this.jsf.schema.type)&&(this.jsf.schema.type="object"),T(this.jsf.schema,"type")&&this.jsf.schema.type!=="object"?(this.jsf.schema={type:"object",properties:{1:this.jsf.schema}},this.objectWrap=!0):T(this.jsf.schema,"type")||(V(this.jsf.schema.properties)||V(this.jsf.schema.patternProperties)||V(this.jsf.schema.additionalProperties)?this.jsf.schema.type="object":(this.jsf.JsonFormCompatibility=!0,this.jsf.schema={type:"object",properties:this.jsf.schema})),this.jsf.schema=pr(this.jsf.schema),this.jsf.compileAjvSchema(),this.jsf.schema=MR(this.jsf.schema,this.jsf.schemaRefLibrary,this.jsf.schemaRecursiveRefMap,this.jsf.dataRecursiveRefMap,this.jsf.arrayMap),T(this.jsf.schemaRefLibrary,"")&&(this.jsf.hasRootReference=!0))}initializeData(){let n=this.form(),r=this.data(),o=this.model(),a=this.ngModel();Z(r)?(this.jsf.formValues=(0,me.default)(r),this.formValuesInput="data"):Z(o)?(this.jsf.AngularSchemaFormCompatibility=!0,this.jsf.formValues=(0,me.default)(o),this.formValuesInput="model"):Z(a)?(this.jsf.AngularSchemaFormCompatibility=!0,this.jsf.formValues=(0,me.default)(a),this.formValuesInput="ngModel"):V(n)&&Z(n.value)?(this.jsf.JsonFormCompatibility=!0,this.jsf.formValues=(0,me.default)(n.value),this.formValuesInput="form.value"):V(n)&&Z(n.data)?(this.jsf.formValues=(0,me.default)(n.data),this.formValuesInput="form.data"):Z(this.formData())?(this.jsf.ReactJsonSchemaFormCompatibility=!0,this.formValuesInput="formData"):T(n,"formData")&&Z(n.formData)?(this.jsf.ReactJsonSchemaFormCompatibility=!0,this.jsf.formValues=(0,me.default)(n.formData),this.formValuesInput="form.formData"):this.formValuesInput="data"}initializeLayout(){let n=u=>((V(u)||D(u))&&$t(u,(c,p)=>{T(c,"options")&&V(c.options)&&(c.titleMap=c.options,delete c.options)},"top-down"),u),r=this.form(),o=this.layout();D(o)?this.jsf.layout=(0,me.default)(o):D(r)?(this.jsf.AngularSchemaFormCompatibility=!0,this.jsf.layout=(0,me.default)(r)):r&&D(r.form)?(this.jsf.JsonFormCompatibility=!0,this.jsf.layout=n((0,me.default)(r.form))):r&&D(r.layout)?this.jsf.layout=(0,me.default)(r.layout):this.jsf.layout=["*"];let a=null,s=this.form(),l=this.UISchema();V(l)?(this.jsf.ReactJsonSchemaFormCompatibility=!0,a=(0,me.default)(l)):T(s,"UISchema")?(this.jsf.ReactJsonSchemaFormCompatibility=!0,a=(0,me.default)(s.UISchema)):T(s,"uiSchema")?(this.jsf.ReactJsonSchemaFormCompatibility=!0,a=(0,me.default)(s.uiSchema)):T(s,"customFormItems")&&(this.jsf.JsonFormCompatibility=!0,a=n((0,me.default)(s.customFormItems))),a&&N.forEachDeep(a,(u,c)=>{let p=c.replace(/\//g,"/properties/").replace(/\/properties\/items\/properties\//g,"/items/properties/").replace(/\/properties\/titleMap\/properties\//g,"/titleMap/properties/");if(Z(u)&&Z(c)){let h=N.toKey(c),v=(N.parse(p)||[]).slice(0,-2),y;h.toLowerCase()==="ui:order"?y=[...v,"ui:order"]:(h.slice(0,3).toLowerCase()==="ui:"&&(h=h.slice(3)),y=[...v,"x-schema-form",h]),N.has(this.jsf.schema,v)&&!N.has(this.jsf.schema,y)&&N.set(this.jsf.schema,y,u)}})}activateForm(){if(this.unsubscribeOnActivateForm$.next(),oe(this.jsf.schema)&&(oe(this.jsf.formValues)||this.jsf.buildSchemaFromData()),oe(this.jsf.schema)||(this.jsf.compileAjvSchema(),this.jsf.buildLayout(this.widgetLibrary),this.jsf.buildFormGroupTemplate(this.jsf.formValues),this.jsf.buildFormGroup()),this.jsf.formGroup){!oe(this.jsf.formValues)&&this.jsf.formOptions.setSchemaDefaults!==!0&&this.jsf.formOptions.setLayoutDefaults!==!0&&this.setFormValues(this.jsf.formValues),this.dataChangesSubs=this.jsf.dataChanges.pipe(vr(this.unsubscribeOnActivateForm$)).subscribe(r=>{this.onChanges.emit(this.objectWrap?r[1]:r),this.formValuesInput&&this.formValuesInput.indexOf(".")===-1&&this[`${this.formValuesInput}Change`].emit(this.objectWrap?r[1]:r)}),this.statusChangesSubs=this.jsf.formGroup.statusChanges.pipe(vr(this.unsubscribeOnActivateForm$)).subscribe(()=>this.changeDetector.markForCheck()),this.isValidChangesSubs=this.jsf.isValidChanges.pipe(vr(this.unsubscribeOnActivateForm$)).subscribe(r=>this.isValid.emit(r)),this.validationErrorChangesSubs=this.jsf.validationErrorChanges.pipe(vr(this.unsubscribeOnActivateForm$)).subscribe(r=>this.validationErrors.emit(r)),this.formSchema.emit(this.jsf.schema),this.formLayout.emit(this.jsf.layout),this.onChanges.emit(this.objectWrap?this.jsf.data[1]:this.jsf.data);let n=N.get(this.jsf,"/formOptions/validateOnRender");if(n){let r=o=>{(n===!0||Z(o.value))&&o.markAsTouched(),Object.keys(o.controls||{}).forEach(a=>r(o.controls[a]))};r(this.jsf.formGroup),this.isValid.emit(this.jsf.isValid),this.validationErrors.emit(this.jsf.ajvErrors)}}}};i.\u0275fac=function(r){return new(r||i)},i.\u0275cmp=Q({type:i,selectors:[["json-schema-form"]],inputs:{schema:[1,"schema"],layout:[1,"layout"],data:[1,"data"],options:[1,"options"],framework:[1,"framework"],widgets:[1,"widgets"],form:[1,"form"],model:[1,"model"],JSONSchema:[1,"JSONSchema"],UISchema:[1,"UISchema"],formData:[1,"formData"],ngModel:[1,"ngModel"],language:[1,"language"],loadExternalAssets:[1,"loadExternalAssets"],debug:[1,"debug"],theme:[1,"theme"],value:"value"},outputs:{onChanges:"onChanges",onSubmit:"onSubmit",isValid:"isValid",validationErrors:"validationErrors",formSchema:"formSchema",formLayout:"formLayout",dataChange:"dataChange",modelChange:"modelChange",formDataChange:"formDataChange",ngModelChange:"ngModelChange"},standalone:!1,features:[rp([Ke,s4]),Pi],decls:3,vars:3,consts:[[1,"json-schema-form",3,"ngSubmit","autocomplete"],[3,"layout"],[4,"ngIf"]],template:function(r,o){r&1&&(f(0,"form",0),j("ngSubmit",function(){return o.submitForm()}),$(1,"root-widget",1),m(),ue(2,lR,4,1,"div",2)),r&2&&(b("autocomplete",!(o.jsf==null||o.jsf.formOptions==null)&&o.jsf.formOptions.autocomplete?"on":"off"),d(),b("layout",o.jsf==null?null:o.jsf.layout),d(),b("ngIf",o.debug()||(o.jsf==null||o.jsf.formOptions==null?null:o.jsf.formOptions.debug)))},dependencies:[ht,mp,up,dp,Nd],encapsulation:2,changeDetection:0});let e=i;return e})(),px=(()=>{let i=class i{};i.\u0275fac=function(r){return new(r||i)},i.\u0275mod=kn({type:i}),i.\u0275inj=Pn({imports:[oa,Gt,Cr,Td,o4,Td]});let e=i;return e})();var fx=(()=>{class e{jsonSchemaForm=k(Jo,{host:!0,self:!0,optional:!0});jsfPatch=!1;constructor(){let t=this.jsonSchemaForm,n=t.jsf.buildLayout.bind(t.jsf);t.jsf.buildLayout=r=>{if(n(r),t.jsf.formValues&&this.jsfPatch)return this.fixNestedArrayLayout(t.jsf.layout,t.jsf.formValues)}}fixNestedArrayLayout(t,n){return this.fixArray(t,n,""),t}fixArray(t,n,r){if(Array.isArray(t)){let o=t.filter(l=>l.name!=="_bridge"),a=o.filter(l=>l.items&&Array.isArray(l.items)).flatMap(l=>l.items).filter(l=>l.dataType==="array"||l.arrayItem);o.concat(a).filter(l=>l.dataType==="array"||l.arrayItem).forEach(l=>{this.fixNestedArray(l,n,r)})}else this.fixNestedArray(t,n,r)}fixNestedArray(t,n,r){if(t.items&&Array.isArray(t.items)){let o=t.items.find(a=>a.type==="$ref");if(o){let a=t.items.filter(u=>u.type==="section"||u.type==="div"),s=a.length>0?a.reduce((u,c)=>u.id>c.id?u:c):this.getItemTemplateFromRef(o),l=this.getDataFromPointer(n,o.dataPointer.replace(r,""));if(l===null)return;if(Array.isArray(l)){for(;t.items.length-1<l.length;){let u=tl(s);u._id=Pp("new_"),t.items.unshift(u)}l.forEach((u,c)=>{this.fixArray(t.items[c],u,o.dataPointer)})}else this.fixArray(t.items,n,o.dataPointer)}else this.fixArray(t.items,n,r);t.items.filter(a=>a.items&&Array.isArray(a.items)).forEach(a=>{this.fixArray(a.items,n,r)})}}getDataFromPointer(t,n){let r=t;return n.substring(1).split(/\//).filter(o=>o!=="-").forEach(o=>{try{r=r[o]}catch{r=null}}),r}getItemTemplateFromRef(t){let n={type:"section",items:[]},r=tl(t);return Ep(r,n),r}static \u0275fac=function(n){return new(n||e)};static \u0275dir=nn({type:e,selectors:[["","jsfPatch",""]],inputs:{jsfPatch:"jsfPatch"}})}return e})();function u4(e,i){if(e&1){let t=H();f(0,"json-schema-form",1),j("onChanges",function(r){A(t);let o=_();return q(o.onChanges(r))})("isValid",function(r){A(t);let o=_();return q(o.validChange(r))})("validationErrors",function(r){A(t);let o=_();return q(o.validationErrors(r))}),m()}if(e&2){let t=_();b("jsfPatch",t.configSchema.fixArrays)("options",t.jsonFormOptions)("schema",t.configSchema.schema)("UISchema",t.configSchema.uiSchema)("layout",t.configSchema.layout)("form",t.configSchema.form)("data",t.currentData)("language",t.language)}}var Ks=(()=>{class e{$settings=k(Be);availableLanguages=["de","en","es","fr","it","pt","zh"];configSchema;data;dataChange=mt();dataChanged=mt();isValid=mt();currentData;language="en";jsonFormOptions={addSubmit:!1,loadExternalAssets:!1,returnEmptyFields:!1,setSchemaDefaults:!0,autocomplete:!1};ngOnInit(){let t=this.$settings.env.lang.split("-")[0];this.availableLanguages.includes(t)&&(this.language=t),this.currentData=this.data}onChanges(t){this.dataChange.emit(t),this.dataChanged.emit(t)}validChange(t){this.isValid.emit(t)}validationErrors(t){t&&t.forEach(n=>console.error(n.instancePath,n.message))}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=Q({type:e,selectors:[["app-schema-form"]],inputs:{configSchema:"configSchema",data:"data"},outputs:{dataChange:"dataChange",dataChanged:"dataChanged",isValid:"isValid"},decls:2,vars:1,consts:[["framework","bootstrap-5",1,"ng-bs5-validate",3,"jsfPatch","options","schema","UISchema","layout","form","data","language"],["framework","bootstrap-5",1,"ng-bs5-validate",3,"onChanges","isValid","validationErrors","jsfPatch","options","schema","UISchema","layout","form","data","language"]],template:function(n,r){n&1&&(ep(0),E(1,u4,1,8,"json-schema-form",0),tp()),n&2&&(d(),P(r.configSchema.schema?1:-1))},dependencies:[px,Jo,fx],encapsulation:2})}return e})();var c4=["custompluginui"];function d4(e,i){e&1&&(f(0,"div",6),$(1,"i",18),m())}function p4(e,i){if(e&1){let t=H();f(0,"div",8)(1,"app-schema-form",19),Ne("dataChange",function(r){A(t);let o=_();return De(o.pluginConfig[0],r)||(o.pluginConfig[0]=r),q(r)}),j("dataChanged",function(r){A(t);let o=_();return q(o.schemaFormUpdatedSubject.next(r))})("isValid",function(r){A(t);let o=_();return q(o.onIsValid(r))}),m()()}if(e&2){let t=_();d(),b("configSchema",t.schema),Oe("data",t.pluginConfig[0])}}function f4(e,i){if(e&1){let t=H();f(0,"button",23),j("click",function(){A(t);let r=_(2);return q(r.formActionSubject.next("cancel"))}),C(1),m()}if(e&2){let t=_(2);d(),U(t.formCancelButtonLabel)}}function m4(e,i){if(e&1){let t=H();f(0,"button",24),j("click",function(){A(t);let r=_(2);return q(r.formActionSubject.next("submit"))}),C(1),m()}if(e&2){let t=_(2);b("disabled",!t.formValid),d(),B(" ",t.formSubmitButtonLabel," ")}}function h4(e,i){if(e&1){let t=H();f(0,"div",8)(1,"app-schema-form",19),Ne("dataChange",function(r){A(t);let o=_();return De(o.formData,r)||(o.formData=r),q(r)}),j("dataChanged",function(r){A(t);let o=_();return q(o.formUpdatedSubject.next(r))})("isValid",function(r){A(t);let o=_();return q(o.formValidEvent(r))}),m(),f(2,"div",20),E(3,f4,2,1,"button",21),E(4,m4,2,2,"button",22),m()()}if(e&2){let t=_();d(),b("configSchema",t.formSchema),Oe("data",t.formData),d(2),P(t.formCancelButtonLabel?3:-1),d(),P(t.formSubmitButtonLabel?4:-1)}}function g4(e,i){e&1&&(f(0,"div",9),$(1,"i",18),m())}function _4(e,i){if(e&1&&($(0,"i",15),w(1,"translate")),e&2){let t=_();b("ngClass",t.formIsValid?"fa-circle-check green-text":t.strictValidation?"fa-circle-exclamation red-text":"fa-circle-exclamation orange-text")("ngbTooltip",S(1,3,t.formIsValid?"form.label_valid":t.strictValidation?"form.label_invalid_strict":"form.label_invalid"))("openDelay",150)}}function y4(e,i){e&1&&(C(0),w(1,"translate")),e&2&&B(" ",S(1,1,"form.button_save")," ")}function b4(e,i){e&1&&$(0,"i",17)}var mx=(()=>{class e{$activeModal=k(je);$api=k(ve);$modal=k(et);$plugin=k(en);$settings=k(Be);$toastr=k(we);$translate=k(xe);$ws=k(ji);customPluginUiElementTarget=Oi("custompluginui");plugin;schema;pluginConfig;pluginAlias;pluginType;loading=!0;saveInProgress=!1;pluginSpinner=!1;saveButtonDisabled=!1;uiLoaded=!1;showSchemaForm=!1;schemaFormUpdatedSubject=new Pt;formId;formSchema;formData;formSubmitButtonLabel;formCancelButtonLabel;formValid=!0;formUpdatedSubject=new Pt;formActionSubject=new Pt;childBridges=[];isFirstSave=!1;formIsValid=!0;strictValidation=!1;io;basePath;iframe;schemaFormRecentlyUpdated=!1;schemaFormRecentlyRefreshed=!1;schemaFormRefreshSubject=new Pt;ngOnInit(){this.io=this.$ws.connectToNamespace("plugins/settings-ui"),this.pluginAlias=this.schema.pluginAlias,this.pluginType=this.schema.pluginType,this.strictValidation=this.schema.strictValidation,this.pluginConfig.length===0&&(this.isFirstSave=!0),this.io.connected?(this.io.socket.emit("start",this.plugin.name),setTimeout(()=>{this.io.connected.subscribe(()=>{this.io.socket.emit("start",this.plugin.name)})},1e3)):this.io.connected.subscribe(()=>{this.io.socket.emit("start",this.plugin.name)}),this.io.socket.on("response",t=>{t.action="response",this.iframe.contentWindow.postMessage(t,qi.api.origin)}),this.io.socket.on("stream",t=>{t.action="stream",this.iframe.contentWindow.postMessage(t,qi.api.origin)}),this.io.socket.on("ready",()=>{this.loading=!1,this.loadUi()}),this.schemaFormRefreshSubject.pipe(En(250)).subscribe(this.schemaFormRefresh.bind(this)),this.schemaFormUpdatedSubject.pipe(En(250),Ys(1)).subscribe(this.schemaFormUpdated.bind(this)),this.formUpdatedSubject.pipe(En(100),Ys(1)).subscribe(this.formUpdated.bind(this)),this.formActionSubject.subscribe(this.formActionEvent.bind(this)),this.basePath=`/plugins/settings-ui/${encodeURIComponent(this.plugin.name)}`,window.addEventListener("message",this.handleMessage,!1)}onIsValid(t){this.formIsValid=t}formValidEvent(t){this.formValid=t}savePluginConfig(t=!1){return K(this,null,function*(){this.saveInProgress=!0;try{let n=yield le(this.$api.post(`/config-editor/plugin/${encodeURIComponent(this.plugin.name)}`,this.pluginConfig));if(this.saveInProgress=!1,t){if(this.isFirstSave&&this.$settings.env.recommendChildBridges&&n[0]?.platform){this.$activeModal.close(),this.$plugin.bridgeSettings(this.plugin,!0);return}if(!["homebridge","homebridge-config-ui-x"].includes(this.plugin.name)&&(yield this.getChildBridges(),this.childBridges.length>0)){this.$activeModal.close();let r=this.$modal.open(Fn,{size:"lg",backdrop:"static"});r.componentInstance.bridges=this.childBridges.map(o=>({name:o.name,username:o.username}));return}this.$activeModal.close(),this.$modal.open(oi,{size:"lg",backdrop:"static"})}}catch(n){this.saveInProgress=!1,console.error(n),this.$toastr.error(this.$translate.instant("config.failed_to_save_config"),this.$translate.instant("toast.title_error"))}})}dismissModal(){this.$activeModal.dismiss("Dismiss")}ngOnDestroy(){window.removeEventListener("message",this.handleMessage),this.io.end(),this.schemaFormRefreshSubject.complete(),this.schemaFormUpdatedSubject.complete(),this.formUpdatedSubject.complete()}loadUi(){this.iframe=this.customPluginUiElementTarget().nativeElement,this.iframe.src=`${qi.api.base+this.basePath}/index.html?origin=${encodeURIComponent(location.origin)}&v=${encodeURIComponent(this.plugin.installedVersion)}`}handleMessage=t=>{if(t.origin===qi.api.origin||t.origin===window.origin)switch(t.data.action){case"loaded":this.injectDefaultStyles(t),this.confirmReady(t);break;case"request":{this.handleRequest(t);break}case"scrollHeight":this.setiFrameHeight(t),this.uiLoaded=!0;break;case"config.get":{this.requestResponse(t,this.getConfigBlocks());break}case"config.save":{this.requestResponse(t,this.savePluginConfig());break}case"config.update":{this.handleUpdateConfig(t,t.data.pluginConfig);break}case"config.schema":{this.requestResponse(t,this.schema);break}case"cachedAccessories.get":{this.handleGetCachedAccessories(t);break}case"schema.show":{this.formEnd(),this.showSchemaForm=!0;break}case"schema.hide":{this.showSchemaForm=!1;break}case"form.create":{this.showSchemaForm=!1,this.formCreate(t.data.formId,t.data.schema,t.data.data,t.data.submitButton,t.data.cancelButton);break}case"form.end":{this.formEnd();break}case"user.lightingMode":{this.requestResponse(t,this.$settings.actualLightingMode);break}case"i18n.lang":{this.requestResponse(t,this.$translate.getCurrentLang());break}case"i18n.translations":{this.requestResponse(t,this.$translate.instant(t.data.key,t.data.params));break}case"close":{this.$activeModal.close();break}case"toast.success":this.$toastr.success(t.data.message,t.data.title);break;case"toast.error":this.$toastr.error(t.data.message,t.data.title);break;case"toast.warning":this.$toastr.warning(t.data.message,t.data.title);break;case"toast.info":this.$toastr.info(t.data.message,t.data.title);break;case"spinner.show":this.pluginSpinner=!0;break;case"spinner.hide":this.pluginSpinner=!1;break;case"button.save.disabled":this.saveButtonDisabled=!0;break;case"button.save.enabled":this.saveButtonDisabled=!1;break;default:console.log(t)}};confirmReady(t){t.source.postMessage({action:"ready"},t.origin)}setiFrameHeight(t){this.iframe.style.height=`${t.data.scrollHeight+10}px`}handleRequest(t){this.io.socket.emit("request",t.data)}handleUpdateConfig(t,n){if(this.schemaFormRefreshSubject.next(void 0),!Array.isArray(n))return this.$toastr.error(this.$translate.instant("plugins.config.must_be_array"),this.$translate.instant("toast.title_error")),this.requestResponse(t,{message:this.$translate.instant("plugins.config.must_be_array")},!1);for(let r of n)if(typeof r!="object"||Array.isArray(r))return this.$toastr.error(this.$translate.instant("plugins.config.must_be_array_objects"),this.$translate.instant("toast.title_error")),this.requestResponse(t,{message:this.$translate.instant("plugins.config.must_be_array_objects")},!1);return this.updateConfigBlocks(n),this.requestResponse(t,this.getConfigBlocks())}requestResponse(t,n,r=!0){t.source.postMessage({action:"response",requestId:t.data.requestId,success:r,data:n},t.origin)}injectDefaultStyles(t){return K(this,null,function*(){let n=Array.from(window.document.body.classList).find(l=>l.startsWith("config-ui-x-")),r=window.document.body.classList.contains("dark-mode");t.source.postMessage({action:"body-class",class:n},t.origin),t.source.postMessage({action:"body-class",class:"modal-content"},t.origin),r&&t.source.postMessage({action:"body-class",class:"dark-mode"},t.origin);let o=Array.from(document.querySelectorAll("link"));for(let l of o)if(l.getAttribute("rel")==="stylesheet"){let u=l.getAttribute("href"),c=document.baseURI+(u.startsWith("/")?u.substring(1):u);t.source.postMessage({action:"link-element",href:c,rel:"stylesheet"},t.origin)}let a=Array.from(document.querySelectorAll("style"));for(let l of a)t.source.postMessage({action:"inline-style",style:l.innerHTML},t.origin);let s=`
|
|
13
13
|
body {
|
|
14
14
|
height: unset !important;
|
|
15
15
|
background-color: ${r?"#242424":"#FFFFFF"} !important;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as _,b as D}from"./chunk-
|
|
1
|
+
import{a as _,b as D}from"./chunk-EQKWLHLX.js";import{m as c,n as S}from"./chunk-2VLWZW76.js";import{f as x}from"./chunk-WBXDUV2S.js";import{C as v,g as O,ga as h,h as a,ha as E,ja as y,ka as l,la as f,nb as I,r as p,va as j,w as d,x as T,z as w}from"./chunk-TIL3AXXZ.js";var g=new y("JWT_OPTIONS"),m=(()=>{class r{constructor(e=null){this.tokenGetter=e&&e.tokenGetter||function(){}}urlBase64Decode(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:{t+="==";break}case 3:{t+="=";break}default:throw new Error("Illegal base64url string!")}return this.b64DecodeUnicode(t)}b64decode(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o="";if(e=String(e).replace(/=+$/,""),e.length%4===1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(let i=0,s,n,b=0;n=e.charAt(b++);~n&&(s=i%4?s*64+n:n,i++%4)?o+=String.fromCharCode(255&s>>(-2*i&6)):0)n=t.indexOf(n);return o}b64DecodeUnicode(e){return decodeURIComponent(Array.prototype.map.call(this.b64decode(e),t=>"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)).join(""))}decodeToken(e=this.tokenGetter()){return e instanceof Promise?e.then(t=>this._decodeToken(t)):this._decodeToken(e)}_decodeToken(e){if(!e||e==="")return null;let t=e.split(".");if(t.length!==3)throw new Error("The inspected token doesn't appear to be a JWT. Check to make sure it has three parts and see https://jwt.io for more.");let o=this.urlBase64Decode(t[1]);if(!o)throw new Error("Cannot decode the token.");return JSON.parse(o)}getTokenExpirationDate(e=this.tokenGetter()){return e instanceof Promise?e.then(t=>this._getTokenExpirationDate(t)):this._getTokenExpirationDate(e)}_getTokenExpirationDate(e){let t;if(t=this.decodeToken(e),!t||!t.hasOwnProperty("exp"))return null;let o=new Date(0);return o.setUTCSeconds(t.exp),o}isTokenExpired(e=this.tokenGetter(),t){return e instanceof Promise?e.then(o=>this._isTokenExpired(o,t)):this._isTokenExpired(e,t)}_isTokenExpired(e,t){if(!e||e==="")return!0;let o=this.getTokenExpirationDate(e);return t=t||0,o===null?!1:!(o.valueOf()>new Date().valueOf()+t*1e3)}getAuthScheme(e,t){return typeof e=="function"?e(t):e}}return r.\u0275fac=function(e){return new(e||r)(l(g))},r.\u0275prov=h({token:r,factory:r.\u0275fac}),r})(),$=r=>r instanceof Promise?v(()=>r):p(r),R=(()=>{class r{constructor(e,t,o){this.jwtHelper=t,this.document=o,this.standardPorts=["80","443"],this.tokenGetter=e.tokenGetter,this.headerName=e.headerName||"Authorization",this.authScheme=e.authScheme||e.authScheme===""?e.authScheme:"Bearer ",this.allowedDomains=e.allowedDomains||[],this.disallowedRoutes=e.disallowedRoutes||[],this.throwNoTokenError=e.throwNoTokenError||!1,this.skipWhenExpired=e.skipWhenExpired}isAllowedDomain(e){let t=new URL(e.url,this.document.location.origin);if(t.host===this.document.location.host)return!0;let o=`${t.hostname}${t.port&&!this.standardPorts.includes(t.port)?":"+t.port:""}`;return this.allowedDomains.findIndex(i=>typeof i=="string"?i===o:i instanceof RegExp?i.test(o):!1)>-1}isDisallowedRoute(e){let t=new URL(e.url,this.document.location.origin);return this.disallowedRoutes.findIndex(o=>{if(typeof o=="string"){let i=new URL(o,this.document.location.origin);return i.hostname===t.hostname&&i.pathname===t.pathname}return o instanceof RegExp?o.test(e.url):!1})>-1}handleInterception(e,t,o){let i=this.jwtHelper.getAuthScheme(this.authScheme,t);if(!e&&this.throwNoTokenError)throw new Error("Could not get token from tokenGetter function.");let s=p(!1);return this.skipWhenExpired&&(s=e?$(this.jwtHelper.isTokenExpired(e)):p(!0)),e?s.pipe(T(n=>n&&this.skipWhenExpired?t.clone():t.clone({setHeaders:{[this.headerName]:`${i}${e}`}})),w(n=>o.handle(n))):o.handle(t)}intercept(e,t){if(!this.isAllowedDomain(e)||this.isDisallowedRoute(e))return t.handle(e);let o=this.tokenGetter(e);return $(o).pipe(w(i=>this.handleInterception(i,e,t)))}}return r.\u0275fac=function(e){return new(e||r)(l(g),l(m),l(j))},r.\u0275prov=h({token:r,factory:r.\u0275fac}),r})(),F=(()=>{class r{constructor(e){if(e)throw new Error("JwtModule is already loaded. It should only be imported in your application's main module.")}static forRoot(e){return{ngModule:r,providers:[{provide:x,useClass:R,multi:!0},e.jwtOptionsProvider||{provide:g,useValue:e.config},m]}}}return r.\u0275fac=function(e){return new(e||r)(l(r,12))},r.\u0275mod=I({type:r}),r.\u0275inj=E({}),r})();var k=O(_(),1);var q=(()=>{class r{$api=f(S);$jwtHelper=f(m);$settings=f(D);token;user={};logoutTimer;constructor(){this.loadToken()}login(e){return a(this,null,function*(){let t=yield d(this.$api.post("/auth/login",e));if(!this.validateToken(t.access_token))throw new Error("Invalid username or password.");window.localStorage.setItem(c.jwt.tokenKey,t.access_token),yield this.$settings.getAppSettings()})}noauth(){return a(this,null,function*(){let e=yield d(this.$api.post("/auth/noauth",{}));if(this.validateToken(e.access_token))window.localStorage.setItem(c.jwt.tokenKey,e.access_token),yield this.$settings.getAppSettings();else throw new Error("Invalid username or password.")})}logout(){this.user=null,this.token=null,window.localStorage.removeItem(c.jwt.tokenKey),window.location.reload()}loadToken(){return a(this,null,function*(){this.$settings.settingsLoaded||(yield d(this.$settings.onSettingsLoaded));let e=window.localStorage.getItem(c.jwt.tokenKey);e&&this.validateToken(e)})}checkToken(){return a(this,null,function*(){try{return yield d(this.$api.get("/auth/check"))}catch(e){e.status===401&&(console.error("Current token is not valid"),this.logout())}})}isLoggedIn(){return this.$settings.env.instanceId!==this.user.instanceId?(console.error("Token does not match instance"),!1):this.user&&this.token&&!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)}validateToken(e){try{return this.$jwtHelper.isTokenExpired(e,this.$settings.serverTimeOffset)&&this.logout(),this.user=this.$jwtHelper.decodeToken(e),this.token=e,this.setLogoutTimer(),!0}catch{return window.localStorage.removeItem(c.jwt.tokenKey),this.token=null,!1}}setLogoutTimer(){if(clearTimeout(this.logoutTimer),!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)){let t=(0,k.default)(this.$jwtHelper.getTokenExpirationDate(this.token)).diff((0,k.default)().add(this.$settings.serverTimeOffset,"s"),"millisecond");t<=2147483647&&(this.logoutTimer=setTimeout(()=>a(this,null,function*(){this.$settings.formAuth===!1?(yield this.noauth(),window.location.reload()):this.logout()}),t))}}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac})}return r})();export{F as a,q as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as f,g as s}from"./chunk-
|
|
1
|
+
import{d as f,g as s}from"./chunk-QIW6M5VR.js";import{k as u,n as d}from"./chunk-2VLWZW76.js";import{a as l}from"./chunk-HCP4JDTX.js";import"./chunk-WBXDUV2S.js";import{ga as m,h as p,ha as i,la as e,nb as a,w as c}from"./chunk-TIL3AXXZ.js";var n=(()=>{class t{$api=e(d);$router=e(f);$toastr=e(u);$translate=e(l);resolve(){return p(this,null,function*(){try{return yield c(this.$api.get("/platform-tools/docker/startup-script"))}catch(r){console.error(r),this.$toastr.error(r.message,this.$translate.instant("toast.title_error")),this.$router.navigate(["/"])}})}static \u0275fac=function(o){return new(o||t)};static \u0275prov=m({token:t,factory:t.\u0275fac})}return t})();var S=[{path:"",redirectTo:"/",pathMatch:"full"},{path:"startup-script",loadComponent:()=>import("./chunk-TW53ZKXP.js").then(t=>t.StartupScriptComponent),resolve:{startupScript:n}},{path:"restart-container",loadComponent:()=>import("./chunk-HCUQAURZ.js").then(t=>t.ContainerRestartComponent)}],v=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275mod=a({type:t});static \u0275inj=i({imports:[s.forChild(S),s]})}return t})();var T=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275mod=a({type:t});static \u0275inj=i({providers:[n],imports:[v]})}return t})();export{T as DockerModule};
|