@ws-ui/shared 1.10.4-rc1 → 1.10.4-rc2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -252,5 +252,5 @@ Valid keys: `+JSON.stringify(Object.keys(z),null," "));var Y=xe(oe,de,J,se,ae+"
252
252
  ${o}`}function d1(e){return/^\/\/%attributes.*(?:\r\n|\n)?/g.test(e)}function p1(e){return e.replace(/^\/\/%attributes.*(?:\r\n|\n)?/g,"")}const u3=()=>yi.uuid().replaceAll("-","").toUpperCase(),c3=e=>e.toLowerCase().replace(/[^a-z0-9]/g,"_").replace(/_{2,}/g,"_").replace(/^_|_$/g,"");var Ve=(e=>(e.DATACLASS="dataclass",e.METHOD="method",e.ATTRIBUTE="attribute",e.DATASTORE="datastore",e.SINGLETON="singleton",e.SINGLETON_METHOD="singletonMethod",e))(Ve||{}),nt=(e=>(e.DS_METHOD="dsMethod",e.DATACLASS_METHOD="dataclassMethod",e.ENTITY_METHOD="entityMethod",e.ENTITY_SEL_METHOD="entityselMethod",e))(nt||{});const f3=[Ve.DATASTORE,Ve.DATACLASS,Ve.ATTRIBUTE,Ve.SINGLETON_METHOD,Ve.SINGLETON,Ve.METHOD,nt.DS_METHOD,nt.DATACLASS_METHOD,nt.ENTITY_METHOD,nt.ENTITY_SEL_METHOD],E0=e=>[nt.DS_METHOD,nt.ENTITY_METHOD,nt.DATACLASS_METHOD].includes(e)?Ve.METHOD:e,Ul="guest",Ap=[{key:"read",label:"Read",canApplyTo:[Ve.DATASTORE,Ve.DATACLASS,Ve.ATTRIBUTE]},{key:"create",label:"Create",canApplyTo:[Ve.DATASTORE,Ve.DATACLASS,Ve.ATTRIBUTE]},{key:"update",label:"Update",canApplyTo:[Ve.DATASTORE,Ve.DATACLASS,Ve.ATTRIBUTE]},{key:"drop",label:"Delete",canApplyTo:[Ve.DATASTORE,Ve.DATACLASS,Ve.ATTRIBUTE]},{key:"execute",label:"Execute",canApplyTo:[Ve.DATASTORE,Ve.DATACLASS,Ve.METHOD,nt.DS_METHOD,nt.DATACLASS_METHOD,nt.ENTITY_METHOD,nt.ENTITY_SEL_METHOD,Ve.SINGLETON,Ve.SINGLETON_METHOD]},{key:"promote",label:"Promote",canApplyTo:[Ve.METHOD,nt.DS_METHOD,nt.DATACLASS_METHOD,nt.ENTITY_METHOD,nt.ENTITY_SEL_METHOD,Ve.SINGLETON_METHOD]}];function Or(e,...t){return Array.from(new Set([...e,...t]))}function h1(e){const t={},r=new Map;e.forEach(c=>{const d=c.id||yi.generate();t[d]={...c,id:d,parents:[],includes:Or(c.includes||[]),resources:[]},r.set(c.privilege,d)}),Object.entries(t).forEach(([c,d])=>{const p=d.includes.map(h=>{const g=r.get(h);return g?(t[g].parents=Or(t[g].parents,g),g):""}).filter(Boolean);t[c]={...d,includes:p}});const n=g1(t),o=new Set;function a(c){o.add(c.id),c.includes=c.includes.filter(d=>!o.has(d))}if(n.forEach(a),n.forEach(c=>c.parents=[]),n.forEach(c=>{c.includes.forEach(d=>t[d].parents.push(c.id))}),Object.values(t).find(({privilege:c})=>c===Ul))return t;const u=yi.generate();return{[u]:{id:u,privilege:Ul,includes:[],parents:[],resources:[]},...t}}function g1(e){return Object.values(e).sort((t,r)=>t.parents.length-r.parents.length)}function gu(e,t){const r=t[e];let n=[];return r&&r.parents.forEach(o=>{n=Or(n,...gu(o,t),o)}),n}function Vl(e,t){const r=t[e];let n=[];return r&&r.includes.forEach(o=>{n=Or(n,...Vl(o,t),o)}),n}function d3(e,t){const r=t[e];if(!r)return[];const n=[e,...gu(e,t),...r.includes];return Object.keys(t).filter(o=>!n.includes(o))}function p3(e,t){return t[e]?Object.keys(t).reduce((n,o)=>o===e?n:{...n,[o]:{...t[o],parents:t[o].parents.filter(a=>a!==e),includes:t[o].includes.filter(a=>a!==e)}},{}):t}function h3(e,t,r){const n=r[e],o=r[t];return!n||!o?r:{...r,[e]:{...r[e],includes:Or(n.includes,t)},[t]:{...r[t],parents:Or(o.parents,e)}}}function g3(e,t,r){const n=r[e],o=r[t];return!n||!o?r:{...r,[e]:{...r[e],includes:r[e].includes.filter(a=>a!==t)},[t]:{...r[t],parents:r[t].parents.filter(a=>a!==e)}}}function v3(e,t){pu(e),Object.entries(t).forEach(([,{privilege:n}])=>{if(e.toLowerCase()===n.toLowerCase())throw new Error(`There's already a Privilege with the name ${e}`)});const r=yi.generate();return{[r]:{id:r,privilege:e,includes:[],parents:[],resources:[]},...t}}function m3(e,t,r){if(!e)throw new Error("Please enter a name");if(!r[t])throw new Error("Invalid privilege");return Object.entries(r).forEach(([,{privilege:n,id:o}])=>{if(e.toLowerCase()===n.toLowerCase()&&t!==o)throw new Error(`There's already a Privilege with the name ${e}`)}),{...r,[t]:{...r[t],privilege:e}}}function b3(e,t){return e.map(r=>wn(r,t))}function wn(e,t){return t[e]?t[e]:null}function v1({applyTo:e,type:t,...r}){return Object.entries(r).reduce((n,[o,a])=>{const l=Ye.find(Ap,["key",o]);return!l||!l.canApplyTo.includes(t)||(typeof a=="string"?a.split(","):a).forEach(c=>{n[c]=Or(n[c]||[],o)}),n},{})}const k0=(e,t=!1)=>["read","create","update","delete"].includes(e.toLowerCase())?`All ${t?"dataclasses and ":""}attributes have the '${e.toLowerCase()}' permission`:e.toLowerCase()==="execute"?`All functions defined ${t?"through the model (DataStore, Dataclasses, Entity selections, Entities) have the execute permission":"on this Dataclass, Entity selection class, Entity class have the execute permission"}`:`All ${t?"dataclasses, ":""}attributes and functions have the '${e.toLowerCase()}' permission`;function Tp(e){return{permissions:Ap.filter(({canApplyTo:t})=>t.includes(e.type)).map(({key:t,label:r})=>{const n={name:t,from:[]};switch(e.type){case Ve.DATASTORE:return{...n,info:k0(r,!0)};case Ve.DATACLASS:return{...n,info:k0(r)};default:return n}}),resource:e.applyTo,type:e.type}}function m1(e,t){const r=b1(t),n={};return e.filter(({type:o})=>f3.includes(o)).forEach(o=>{const a=v1(o);Object.entries(a).forEach(([l,u])=>{var p;const c=(p=r[l])==null?void 0:p.id;if(!c)return;n[c]=n[c]||{...t[c]};let d=Ye.find(n[c].resources,{resource:o.applyTo,type:o.type});d||(d=Tp(o),n[c].resources.push(d)),d.permissions=d.permissions.map(h=>({...h,checked:h.checked||u.includes(h.name)}))})}),{...t,...n}}function b1(e){return Object.values(e).reduce((t,r)=>({...t,[r.privilege]:r}),{})}function y3(e){var r;if(!e)throw new Error("Invalid roles data");const t=h1(e.privileges||[]);return{forceLogin:(e==null?void 0:e.forceLogin)||!1,restrictedByDefault:(e==null?void 0:e.restrictedByDefault)||!1,privileges:m1(((r=e==null?void 0:e.permissions)==null?void 0:r.allowed)||[],t),roles:((e==null?void 0:e.roles)||[]).map(({id:n=yi.generate(),role:o,privileges:a=[]})=>({id:n,role:o,privileges:Or(a).map(l=>{var u;return(u=Object.values(t).find(({privilege:c})=>c===l))==null?void 0:u.id}).filter(Boolean)})).reduce((n,o)=>({...n,[o.id]:{...o}}),{})}}function w3(e){const t=Object.values(e.privileges).filter(({includes:n})=>n.length===0).map(({id:n})=>n),r=[...t,...t.map(n=>gu(n,e.privileges).reverse())].flat().filter((n,o,a)=>a.indexOf(n)===o).map(n=>e.privileges[n]);return{forceLogin:e.forceLogin||!1,restrictedByDefault:e.restrictedByDefault||!1,permissions:{allowed:Object.values(e.privileges).reduce((n,o)=>(o.resources.forEach(({permissions:a,resource:l,type:u})=>{let c=Ye.find(n,{applyTo:l,type:E0(u)});c||(c={applyTo:l,type:E0(u)},n.push(c)),a.forEach(({name:d,checked:p})=>{p&&c&&(c[d]=c[d]||[],c[d].push(o.privilege))})}),n),[])},privileges:r.filter(({privilege:n})=>n!==Ul).map(({id:n,includes:o,privilege:a})=>({id:n,privilege:a,includes:o.map(l=>e.privileges[l].privilege)})),roles:Object.values(e.roles).map(n=>({...n,privileges:n.privileges.map(o=>{var a;return(a=e.privileges[o])==null?void 0:a.privilege}).filter(Boolean)}))}}function x3(e,t){const r=t[e],n={children:[],links:[],parents:[],selected:e};if(!r)return n;function o(u,c,d=[]){const p=u.reduce((h,g)=>[...h,...t[g][c]],[]);return p.length===0?d:(d.push(p),o(p,c,d))}function a(u){const c=[],d=[];for(let p=u.length-1;p>=0;p-=1){const h=u[p].filter(g=>c.includes(g)?!1:(c.push(g),!0));h.length>0&&d.unshift(Or(h))}return d}function l(u,c){const d=[];return u.reduce((p,h)=>(h.forEach(g=>{t[g][c==="parents"?"includes":"parents"].forEach(S=>{d.includes(S)&&p.push(c==="parents"?{source:g,target:S}:{source:S,target:g})}),d.push(g)}),p),[])}return n.children=o([e],"includes"),n.children=a(n.children),n.parents=o([e],"parents"),n.parents=a(n.parents),n.links=[...l([[e],...n.parents],"parents"),...l([[e],...n.children],"includes")],n}function S3(e,t,r){const n=wn(e,r);if(!n||Ye.find(n.resources,{resource:t.applyTo,type:t.type}))return r;const o={...n,resources:[...n.resources,Tp(t)]};return{...r,[e]:o}}function _3(e,t,r){const n=wn(e,r);if(!n)return r;const o={...n,resources:n.resources.filter(({resource:a,type:l})=>a!==t.applyTo||l!==t.type)};return{...r,[e]:o}}function E3(e,t){const r=Object.entries(e).map(([n,o])=>{const a=wn(n,t);if(!a)return{[n]:t[n]};const l={...a,resources:a.resources.filter(({resource:u,type:c})=>!o.some(d=>d.applyTo===u&&d.type===c))};return{[n]:l}}).reduce((n,o)=>({...n,...o}),{});return{...t,...r}}function k3(e,t){const r=wn(e,t);if(!r)return t;const n={...r,resources:r.resources.filter(o=>o.permissions.some(a=>a.from.length)).map(o=>({...o,permissions:o.permissions.map(a=>({...a,checked:!1}))}))};return{...t,[e]:n}}function O3(e,t,r,n){const o=wn(e,n);if(!o)return n;const l=Ye.find(o.resources,{type:t.type,resource:t.resource})?{...o,resources:o.resources.map(u=>u.type===t.type&&u.resource===t.resource?{...u,permissions:t.permissions.map(c=>c.name===r.name?{...c,checked:!c.checked,from:[]}:c)}:u)}:{...o,resources:[...o.resources,{...t,permissions:t.permissions.map(u=>({...u,checked:r.name===u.name,from:[]}))}]};return{...n,[e]:l}}function A3(e,t){var c;const r=y1(e,t)||[],n=((c=wn(e,t))==null?void 0:c.resources)||[],l=([...r,...n].filter(({type:d})=>[nt.DS_METHOD,nt.DATACLASS_METHOD,nt.ENTITY_METHOD,nt.ENTITY_SEL_METHOD].includes(d))||[]).map(({resource:d})=>d);return Object.entries(t).reduce((d,[p,{resources:h}])=>(h.filter(({resource:g,type:y})=>[nt.DS_METHOD,nt.DATACLASS_METHOD,nt.ENTITY_METHOD,nt.ENTITY_SEL_METHOD].includes(y)&&l.includes(g)).forEach(({permissions:g,resource:y})=>{var v;((v=g.find(({name:b})=>b==="promote"))==null?void 0:v.checked)&&(d[y]=Or(d[y]||[],p))}),d),{})}function y1(e,t){var l;const r=wn(e,t);if(!r)return[];const n=(l=Object.values(t).find(u=>u.privilege===Ul))==null?void 0:l.id;return(n&&n!==e?Or(Vl(e,t),n):Vl(e,t)).reduce((u,c)=>(t[c].resources.forEach(p=>{if(p.permissions.filter(({checked:y,name:S})=>y&&S!=="promote").length===0)return;const g=Ye.find(u,{type:p.type,resource:p.resource});if(!g){u.push({...p,permissions:p.permissions.map(y=>({...y,from:y.checked?[c]:[],checked:!1}))});return}g.permissions=g.permissions.map((y,S)=>{let{from:v=[]}=y;return p.permissions[S].checked&&!v.includes(c)&&(v=[...v,c]),{...y,from:v,checked:y.checked}})}),u),Ye.clone(r.resources.map(u=>({...u,permissions:u.permissions.map(({checked:c,...d})=>({...d,checked:!!c}))}))))}const T3=(e,t,r)=>{const n={id:e,role:t,privileges:[]};return{...r,[n.id]:n}},R3=(e,t)=>t[e]?Object.values(t).reduce((r,n)=>e===n.id||n.role===""?r:{...r,[n.id]:n},{}):t,C3=(e,t)=>{if(pu(e.role),Object.values(t).find(n=>n.role===e.role))throw new Error(`a role with the name ${e.role} already exists`);return Object.values(t).reduce((n,o)=>e.id===o.id?{...n,[e.id]:e}:{...n,[o.id]:o},{})},yt="/rest/$designer",Fa="/rest/$designer-ext";function P3(...e){return t=>{if(e.length===0)return t;const r={...t};return e.forEach(n=>{typeof r[n]=="string"&&(r[n]=new Date(r[n]))}),r}}class xd extends Error{constructor(t,r,n){super(),this.url=t,this.response=r,this.data=n}log(){console.error("Error while sending the request",this)}}async function qe(e,t){var o;Bl.next({action:Ta.REQUEST_SENT});const r=await window.fetch(e,t);if(/401/.test(r.status.toString())&&(window.location.href="/login.html?redirect=studio"),/^[45]/.test(r.status.toString())){let a;try{const l=await r.json();((o=l==null?void 0:l.__ERROR)==null?void 0:o.some(c=>c.errCode===1651))&&Bl.next({action:Ta.EVENT_EMITED,payload:{eventName:"onsessionexpired"}}),a=new xd(e,r,l)}catch{a=new xd(e,r)}throw a.log(),a}return await r.json()}function I3(e){return Bl.next({action:Ta.REQUEST_SENT}),e}var Hr={},Ct={},O0;function pi(){if(O0)return Ct;O0=1;var e=Ct.ValidationError=function(v,b,m,w,x,k){if(Array.isArray(w)?(this.path=w,this.property=w.reduce(function(R,F){return R+u(F)},"instance")):w!==void 0&&(this.property=w),v&&(this.message=v),m){var E=m.$id||m.id;this.schema=E||m}b!==void 0&&(this.instance=b),this.name=x,this.argument=k,this.stack=this.toString()};e.prototype.toString=function(){return this.property+" "+this.message};var t=Ct.ValidatorResult=function(v,b,m,w){this.instance=v,this.schema=b,this.options=m,this.path=w.path,this.propertyPath=w.propertyPath,this.errors=[],this.throwError=m&&m.throwError,this.throwFirst=m&&m.throwFirst,this.throwAll=m&&m.throwAll,this.disableFormat=m&&m.disableFormat===!0};t.prototype.addError=function(v){var b;if(typeof v=="string")b=new e(v,this.instance,this.schema,this.path);else{if(!v)throw new Error("Missing error detail");if(!v.message)throw new Error("Missing error message");if(!v.name)throw new Error("Missing validator type");b=new e(v.message,this.instance,this.schema,this.path,v.name,v.argument)}if(this.errors.push(b),this.throwFirst)throw new n(this);if(this.throwError)throw b;return b},t.prototype.importErrors=function(v){typeof v=="string"||v&&v.validatorType?this.addError(v):v&&v.errors&&(this.errors=this.errors.concat(v.errors))};function r(S,v){return v+": "+S.toString()+`
253
253
  `}t.prototype.toString=function(v){return this.errors.map(r).join("")},Object.defineProperty(t.prototype,"valid",{get:function(){return!this.errors.length}}),Ct.ValidatorResultError=n;function n(S){typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,n),this.instance=S.instance,this.schema=S.schema,this.options=S.options,this.errors=S.errors}n.prototype=new Error,n.prototype.constructor=n,n.prototype.name="Validation Error";var o=Ct.SchemaError=function S(v,b){this.message=v,this.schema=b,Error.call(this,v),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,S)};o.prototype=Object.create(Error.prototype,{constructor:{value:o,enumerable:!1},name:{value:"SchemaError",enumerable:!1}});var a=Ct.SchemaContext=function(v,b,m,w,x){this.schema=v,this.options=b,Array.isArray(m)?(this.path=m,this.propertyPath=m.reduce(function(k,E){return k+u(E)},"instance")):this.propertyPath=m,this.base=w,this.schemas=x};a.prototype.resolve=function(v){return y(this.base,v)},a.prototype.makeChild=function(v,b){var m=b===void 0?this.path:this.path.concat([b]),w=v.$id||v.id;let x=y(this.base,w||"");var k=new a(v,this.options,m,x,Object.create(this.schemas));return w&&!k.schemas[x]&&(k.schemas[x]=v),k};var l=Ct.FORMAT_REGEXPS={"date-time":/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])[tT ](2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])(\.\d+)?([zZ]|[+-]([0-5][0-9]):(60|[0-5][0-9]))$/,date:/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])$/,time:/^(2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])$/,duration:/P(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S)|\d+(D|M(\d+D)?|Y(\d+M(\d+D)?)?)(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S))?|\d+W)/i,email:/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[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]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/,"idn-email":/^("(?:[!#-\[\]-\u{10FFFF}]|\\[\t -\u{10FFFF}])*"|[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*)@([!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*|\[[!-Z\^-\u{10FFFF}]*\])$/u,"ip-address":/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,ipv6:/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-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-Fa-f]{1,4}:){5}(((:[0-9A-Fa-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-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-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-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-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-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-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-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-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-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-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*$/,uri:/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,"uri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/,iri:/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,"iri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~-\u{10FFFF}]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~-\u{10FFFF}])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/u,uuid:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i,"uri-template":/(%[0-9a-f]{2}|[!#$&(-;=?@\[\]_a-z~]|\{[!#&+,./;=?@|]?(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?(,(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?)*\})*/iu,"json-pointer":/^(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*$/iu,"relative-json-pointer":/^\d+(#|(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*)$/iu,hostname:/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"host-name":/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"utc-millisec":function(S){return typeof S=="string"&&parseFloat(S)===parseInt(S,10)&&!isNaN(S)},regex:function(S){var v=!0;try{new RegExp(S)}catch{v=!1}return v},style:/[\r\n\t ]*[^\r\n\t ][^:]*:[\r\n\t ]*[^\r\n\t ;]*[\r\n\t ]*;?/,color:/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,phone:/^\+(?:[0-9] ?){6,14}[0-9]$/,alpha:/^[a-zA-Z]+$/,alphanumeric:/^[a-zA-Z0-9]+$/};l.regexp=l.regex,l.pattern=l.regex,l.ipv4=l["ip-address"],Ct.isFormat=function(v,b,m){if(typeof v=="string"&&l[b]!==void 0){if(l[b]instanceof RegExp)return l[b].test(v);if(typeof l[b]=="function")return l[b](v)}else if(m&&m.customFormats&&typeof m.customFormats[b]=="function")return m.customFormats[b](v);return!0};var u=Ct.makeSuffix=function(v){return v=v.toString(),!v.match(/[.\s\[\]]/)&&!v.match(/^[\d]/)?"."+v:v.match(/^\d+$/)?"["+v+"]":"["+JSON.stringify(v)+"]"};Ct.deepCompareStrict=function S(v,b){if(typeof v!=typeof b)return!1;if(Array.isArray(v))return!Array.isArray(b)||v.length!==b.length?!1:v.every(function(x,k){return S(v[k],b[k])});if(typeof v=="object"){if(!v||!b)return v===b;var m=Object.keys(v),w=Object.keys(b);return m.length!==w.length?!1:m.every(function(x){return S(v[x],b[x])})}return v===b};function c(S,v,b,m){typeof b=="object"?v[m]=h(S[m],b):S.indexOf(b)===-1&&v.push(b)}function d(S,v,b){v[b]=S[b]}function p(S,v,b,m){typeof v[m]!="object"||!v[m]?b[m]=v[m]:S[m]?b[m]=h(S[m],v[m]):b[m]=v[m]}function h(S,v){var b=Array.isArray(v),m=b&&[]||{};return b?(S=S||[],m=m.concat(S),v.forEach(c.bind(null,S,m))):(S&&typeof S=="object"&&Object.keys(S).forEach(d.bind(null,S,m)),Object.keys(v).forEach(p.bind(null,S,v,m))),m}Ct.deepMerge=h,Ct.objectGetPath=function(v,b){for(var m=b.split("/").slice(1),w;typeof(w=m.shift())=="string";){var x=decodeURIComponent(w.replace(/~0/,"~").replace(/~1/g,"/"));if(!(x in v))return;v=v[x]}return v};function g(S){return"/"+encodeURIComponent(S).replace(/~/g,"%7E")}Ct.encodePath=function(v){return v.map(g).join("")},Ct.getDecimalPlaces=function(v){var b=0;if(isNaN(v))return b;typeof v!="number"&&(v=Number(v));var m=v.toString().split("e");if(m.length===2){if(m[1][0]!=="-")return b;b=Number(m[1].slice(1))}var w=m[0].split(".");return w.length===2&&(b+=w[1].length),b},Ct.isSchema=function(v){return typeof v=="object"&&v||typeof v=="boolean"};var y=Ct.resolveUrl=function(v,b){const m=new URL(b,new URL(v,"resolve://"));if(m.protocol==="resolve:"){const{pathname:w,search:x,hash:k}=m;return w+x+k}return m.toString()};return Ct}var Wf,A0;function N3(){if(A0)return Wf;A0=1;var e=pi(),t=e.ValidatorResult,r=e.SchemaError,n={};n.ignoreProperties={id:!0,default:!0,description:!0,title:!0,additionalItems:!0,then:!0,else:!0,$schema:!0,$ref:!0,extends:!0};var o=n.validators={};o.type=function(h,g,y,S){if(h===void 0)return null;var v=new t(h,g,y,S),b=Array.isArray(g.type)?g.type:[g.type];if(!b.some(this.testType.bind(this,h,g,y,S))){var m=b.map(function(w){if(w){var x=w.$id||w.id;return x?"<"+x+">":w+""}});v.addError({name:"type",argument:m,message:"is not of a type(s) "+m})}return v};function a(p,h,g,y,S){var v=h.throwError,b=h.throwAll;h.throwError=!1,h.throwAll=!1;var m=this.validateSchema(p,S,h,g);return h.throwError=v,h.throwAll=b,!m.valid&&y instanceof Function&&y(m),m.valid}o.anyOf=function(h,g,y,S){if(h===void 0)return null;var v=new t(h,g,y,S),b=new t(h,g,y,S);if(!Array.isArray(g.anyOf))throw new r("anyOf must be an array");if(!g.anyOf.some(a.bind(this,h,y,S,function(w){b.importErrors(w)}))){var m=g.anyOf.map(function(w,x){var k=w.$id||w.id;return k?"<"+k+">":w.title&&JSON.stringify(w.title)||w.$ref&&"<"+w.$ref+">"||"[subschema "+x+"]"});y.nestedErrors&&v.importErrors(b),v.addError({name:"anyOf",argument:m,message:"is not any of "+m.join(",")})}return v},o.allOf=function(h,g,y,S){if(h===void 0)return null;if(!Array.isArray(g.allOf))throw new r("allOf must be an array");var v=new t(h,g,y,S),b=this;return g.allOf.forEach(function(m,w){var x=b.validateSchema(h,m,y,S);if(!x.valid){var k=m.$id||m.id,E=k||m.title&&JSON.stringify(m.title)||m.$ref&&"<"+m.$ref+">"||"[subschema "+w+"]";v.addError({name:"allOf",argument:{id:E,length:x.errors.length,valid:x},message:"does not match allOf schema "+E+" with "+x.errors.length+" error[s]:"}),v.importErrors(x)}}),v},o.oneOf=function(h,g,y,S){if(h===void 0)return null;if(!Array.isArray(g.oneOf))throw new r("oneOf must be an array");var v=new t(h,g,y,S),b=new t(h,g,y,S),m=g.oneOf.filter(a.bind(this,h,y,S,function(x){b.importErrors(x)})).length,w=g.oneOf.map(function(x,k){var E=x.$id||x.id;return E||x.title&&JSON.stringify(x.title)||x.$ref&&"<"+x.$ref+">"||"[subschema "+k+"]"});return m!==1&&(y.nestedErrors&&v.importErrors(b),v.addError({name:"oneOf",argument:w,message:"is not exactly one from "+w.join(",")})),v},o.if=function(h,g,y,S){if(h===void 0)return null;if(!e.isSchema(g.if))throw new Error('Expected "if" keyword to be a schema');var v=a.call(this,h,y,S,null,g.if),b=new t(h,g,y,S),m;if(v){if(g.then===void 0)return;if(!e.isSchema(g.then))throw new Error('Expected "then" keyword to be a schema');m=this.validateSchema(h,g.then,y,S.makeChild(g.then)),b.importErrors(m)}else{if(g.else===void 0)return;if(!e.isSchema(g.else))throw new Error('Expected "else" keyword to be a schema');m=this.validateSchema(h,g.else,y,S.makeChild(g.else)),b.importErrors(m)}return b};function l(p,h){if(Object.hasOwnProperty.call(p,h))return p[h];if(h in p){for(;p=Object.getPrototypeOf(p);)if(Object.propertyIsEnumerable.call(p,h))return p[h]}}o.propertyNames=function(h,g,y,S){if(this.types.object(h)){var v=new t(h,g,y,S),b=g.propertyNames!==void 0?g.propertyNames:{};if(!e.isSchema(b))throw new r('Expected "propertyNames" to be a schema (object or boolean)');for(var m in h)if(l(h,m)!==void 0){var w=this.validateSchema(m,b,y,S.makeChild(b));v.importErrors(w)}return v}},o.properties=function(h,g,y,S){if(this.types.object(h)){var v=new t(h,g,y,S),b=g.properties||{};for(var m in b){var w=b[m];if(w!==void 0){if(w===null)throw new r('Unexpected null, expected schema in "properties"');typeof y.preValidateProperty=="function"&&y.preValidateProperty(h,m,w,y,S);var x=l(h,m),k=this.validateSchema(x,w,y,S.makeChild(w,m));k.instance!==v.instance[m]&&(v.instance[m]=k.instance),v.importErrors(k)}}return v}};function u(p,h,g,y,S,v){if(this.types.object(p)&&!(h.properties&&h.properties[S]!==void 0))if(h.additionalProperties===!1)v.addError({name:"additionalProperties",argument:S,message:"is not allowed to have the additional property "+JSON.stringify(S)});else{var b=h.additionalProperties||{};typeof g.preValidateProperty=="function"&&g.preValidateProperty(p,S,b,g,y);var m=this.validateSchema(p[S],b,g,y.makeChild(b,S));m.instance!==v.instance[S]&&(v.instance[S]=m.instance),v.importErrors(m)}}o.patternProperties=function(h,g,y,S){if(this.types.object(h)){var v=new t(h,g,y,S),b=g.patternProperties||{};for(var m in h){var w=!0;for(var x in b){var k=b[x];if(k!==void 0){if(k===null)throw new r('Unexpected null, expected schema in "patternProperties"');try{var E=new RegExp(x,"u")}catch{E=new RegExp(x)}if(E.test(m)){w=!1,typeof y.preValidateProperty=="function"&&y.preValidateProperty(h,m,k,y,S);var R=this.validateSchema(h[m],k,y,S.makeChild(k,m));R.instance!==v.instance[m]&&(v.instance[m]=R.instance),v.importErrors(R)}}}w&&u.call(this,h,g,y,S,m,v)}return v}},o.additionalProperties=function(h,g,y,S){if(this.types.object(h)){if(g.patternProperties)return null;var v=new t(h,g,y,S);for(var b in h)u.call(this,h,g,y,S,b,v);return v}},o.minProperties=function(h,g,y,S){if(this.types.object(h)){var v=new t(h,g,y,S),b=Object.keys(h);return b.length>=g.minProperties||v.addError({name:"minProperties",argument:g.minProperties,message:"does not meet minimum property length of "+g.minProperties}),v}},o.maxProperties=function(h,g,y,S){if(this.types.object(h)){var v=new t(h,g,y,S),b=Object.keys(h);return b.length<=g.maxProperties||v.addError({name:"maxProperties",argument:g.maxProperties,message:"does not meet maximum property length of "+g.maxProperties}),v}},o.items=function(h,g,y,S){var v=this;if(this.types.array(h)&&g.items!==void 0){var b=new t(h,g,y,S);return h.every(function(m,w){if(Array.isArray(g.items))var x=g.items[w]===void 0?g.additionalItems:g.items[w];else var x=g.items;if(x===void 0)return!0;if(x===!1)return b.addError({name:"items",message:"additionalItems not permitted"}),!1;var k=v.validateSchema(m,x,y,S.makeChild(x,w));return k.instance!==b.instance[w]&&(b.instance[w]=k.instance),b.importErrors(k),!0}),b}},o.contains=function(h,g,y,S){var v=this;if(this.types.array(h)&&g.contains!==void 0){if(!e.isSchema(g.contains))throw new Error('Expected "contains" keyword to be a schema');var b=new t(h,g,y,S),m=h.some(function(w,x){var k=v.validateSchema(w,g.contains,y,S.makeChild(g.contains,x));return k.errors.length===0});return m===!1&&b.addError({name:"contains",argument:g.contains,message:"must contain an item matching given schema"}),b}},o.minimum=function(h,g,y,S){if(this.types.number(h)){var v=new t(h,g,y,S);return g.exclusiveMinimum&&g.exclusiveMinimum===!0?h>g.minimum||v.addError({name:"minimum",argument:g.minimum,message:"must be greater than "+g.minimum}):h>=g.minimum||v.addError({name:"minimum",argument:g.minimum,message:"must be greater than or equal to "+g.minimum}),v}},o.maximum=function(h,g,y,S){if(this.types.number(h)){var v=new t(h,g,y,S);return g.exclusiveMaximum&&g.exclusiveMaximum===!0?h<g.maximum||v.addError({name:"maximum",argument:g.maximum,message:"must be less than "+g.maximum}):h<=g.maximum||v.addError({name:"maximum",argument:g.maximum,message:"must be less than or equal to "+g.maximum}),v}},o.exclusiveMinimum=function(h,g,y,S){if(typeof g.exclusiveMinimum!="boolean"&&this.types.number(h)){var v=new t(h,g,y,S),b=h>g.exclusiveMinimum;return b||v.addError({name:"exclusiveMinimum",argument:g.exclusiveMinimum,message:"must be strictly greater than "+g.exclusiveMinimum}),v}},o.exclusiveMaximum=function(h,g,y,S){if(typeof g.exclusiveMaximum!="boolean"&&this.types.number(h)){var v=new t(h,g,y,S),b=h<g.exclusiveMaximum;return b||v.addError({name:"exclusiveMaximum",argument:g.exclusiveMaximum,message:"must be strictly less than "+g.exclusiveMaximum}),v}};var c=function(h,g,y,S,v,b){if(this.types.number(h)){var m=g[v];if(m==0)throw new r(v+" cannot be zero");var w=new t(h,g,y,S),x=e.getDecimalPlaces(h),k=e.getDecimalPlaces(m),E=Math.max(x,k),R=Math.pow(10,E);return Math.round(h*R)%Math.round(m*R)!==0&&w.addError({name:v,argument:m,message:b+JSON.stringify(m)}),w}};o.multipleOf=function(h,g,y,S){return c.call(this,h,g,y,S,"multipleOf","is not a multiple of (divisible by) ")},o.divisibleBy=function(h,g,y,S){return c.call(this,h,g,y,S,"divisibleBy","is not divisible by (multiple of) ")},o.required=function(h,g,y,S){var v=new t(h,g,y,S);return h===void 0&&g.required===!0?v.addError({name:"required",message:"is required"}):this.types.object(h)&&Array.isArray(g.required)&&g.required.forEach(function(b){l(h,b)===void 0&&v.addError({name:"required",argument:b,message:"requires property "+JSON.stringify(b)})}),v},o.pattern=function(h,g,y,S){if(this.types.string(h)){var v=new t(h,g,y,S),b=g.pattern;try{var m=new RegExp(b,"u")}catch{m=new RegExp(b)}return h.match(m)||v.addError({name:"pattern",argument:g.pattern,message:"does not match pattern "+JSON.stringify(g.pattern.toString())}),v}},o.format=function(h,g,y,S){if(h!==void 0){var v=new t(h,g,y,S);return!v.disableFormat&&!e.isFormat(h,g.format,this)&&v.addError({name:"format",argument:g.format,message:"does not conform to the "+JSON.stringify(g.format)+" format"}),v}},o.minLength=function(h,g,y,S){if(this.types.string(h)){var v=new t(h,g,y,S),b=h.match(/[\uDC00-\uDFFF]/g),m=h.length-(b?b.length:0);return m>=g.minLength||v.addError({name:"minLength",argument:g.minLength,message:"does not meet minimum length of "+g.minLength}),v}},o.maxLength=function(h,g,y,S){if(this.types.string(h)){var v=new t(h,g,y,S),b=h.match(/[\uDC00-\uDFFF]/g),m=h.length-(b?b.length:0);return m<=g.maxLength||v.addError({name:"maxLength",argument:g.maxLength,message:"does not meet maximum length of "+g.maxLength}),v}},o.minItems=function(h,g,y,S){if(this.types.array(h)){var v=new t(h,g,y,S);return h.length>=g.minItems||v.addError({name:"minItems",argument:g.minItems,message:"does not meet minimum length of "+g.minItems}),v}},o.maxItems=function(h,g,y,S){if(this.types.array(h)){var v=new t(h,g,y,S);return h.length<=g.maxItems||v.addError({name:"maxItems",argument:g.maxItems,message:"does not meet maximum length of "+g.maxItems}),v}};function d(p,h,g){var y,S=g.length;for(y=h+1,S;y<S;y++)if(e.deepCompareStrict(p,g[y]))return!1;return!0}return o.uniqueItems=function(h,g,y,S){if(g.uniqueItems===!0&&this.types.array(h)){var v=new t(h,g,y,S);return h.every(d)||v.addError({name:"uniqueItems",message:"contains duplicate item"}),v}},o.dependencies=function(h,g,y,S){if(this.types.object(h)){var v=new t(h,g,y,S);for(var b in g.dependencies)if(h[b]!==void 0){var m=g.dependencies[b],w=S.makeChild(m,b);if(typeof m=="string"&&(m=[m]),Array.isArray(m))m.forEach(function(k){h[k]===void 0&&v.addError({name:"dependencies",argument:w.propertyPath,message:"property "+k+" not found, required by "+w.propertyPath})});else{var x=this.validateSchema(h,m,y,w);v.instance!==x.instance&&(v.instance=x.instance),x&&x.errors.length&&(v.addError({name:"dependencies",argument:w.propertyPath,message:"does not meet dependency required by "+w.propertyPath}),v.importErrors(x))}}return v}},o.enum=function(h,g,y,S){if(h===void 0)return null;if(!Array.isArray(g.enum))throw new r("enum expects an array",g);var v=new t(h,g,y,S);return g.enum.some(e.deepCompareStrict.bind(null,h))||v.addError({name:"enum",argument:g.enum,message:"is not one of enum values: "+g.enum.map(String).join(",")}),v},o.const=function(h,g,y,S){if(h===void 0)return null;var v=new t(h,g,y,S);return e.deepCompareStrict(g.const,h)||v.addError({name:"const",argument:g.const,message:"does not exactly match expected constant: "+g.const}),v},o.not=o.disallow=function(h,g,y,S){var v=this;if(h===void 0)return null;var b=new t(h,g,y,S),m=g.not||g.disallow;return m?(Array.isArray(m)||(m=[m]),m.forEach(function(w){if(v.testType(h,g,y,S,w)){var x=w&&(w.$id||w.id),k=x||w;b.addError({name:"not",argument:k,message:"is of prohibited type "+k})}}),b):null},Wf=n,Wf}var ul={},T0;function Sd(){if(T0)return ul;T0=1;var e=pi();ul.SchemaScanResult=t;function t(r,n){this.id=r,this.ref=n}return ul.scan=function(n,o){function a(p,h){if(!h||typeof h!="object")return;if(h.$ref){let v=e.resolveUrl(p,h.$ref);d[v]=d[v]?d[v]+1:0;return}var g=h.$id||h.id;let y=e.resolveUrl(p,g);var S=g?y:p;if(S){if(S.indexOf("#")<0&&(S+="#"),c[S]){if(!e.deepCompareStrict(c[S],h))throw new Error("Schema <"+S+"> already exists with different definition");return c[S]}c[S]=h,S[S.length-1]=="#"&&(c[S.substring(0,S.length-1)]=h)}l(S+"/items",Array.isArray(h.items)?h.items:[h.items]),l(S+"/extends",Array.isArray(h.extends)?h.extends:[h.extends]),a(S+"/additionalItems",h.additionalItems),u(S+"/properties",h.properties),a(S+"/additionalProperties",h.additionalProperties),u(S+"/definitions",h.definitions),u(S+"/patternProperties",h.patternProperties),u(S+"/dependencies",h.dependencies),l(S+"/disallow",h.disallow),l(S+"/allOf",h.allOf),l(S+"/anyOf",h.anyOf),l(S+"/oneOf",h.oneOf),a(S+"/not",h.not)}function l(p,h){if(Array.isArray(h))for(var g=0;g<h.length;g++)a(p+"/"+g,h[g])}function u(p,h){if(!(!h||typeof h!="object"))for(var g in h)a(p+"/"+g,h[g])}var c={},d={};return a(n,o),new t(c,d)},ul}var Bf,R0;function M3(){if(R0)return Bf;R0=1;var e=N3(),t=pi(),r=Sd().scan,n=t.ValidatorResult,o=t.ValidatorResultError,a=t.SchemaError,l=t.SchemaContext,u="/",c=function h(){this.customFormats=Object.create(h.prototype.customFormats),this.schemas={},this.unresolvedRefs=[],this.types=Object.create(p),this.attributes=Object.create(e.validators)};c.prototype.customFormats={},c.prototype.schemas=null,c.prototype.types=null,c.prototype.attributes=null,c.prototype.unresolvedRefs=null,c.prototype.addSchema=function(g,y){var S=this;if(!g)return null;var v=r(y||u,g),b=y||g.$id||g.id;for(var m in v.id)this.schemas[m]=v.id[m];for(var m in v.ref)this.unresolvedRefs.push(m);return this.unresolvedRefs=this.unresolvedRefs.filter(function(w){return typeof S.schemas[w]>"u"}),this.schemas[b]},c.prototype.addSubSchemaArray=function(g,y){if(Array.isArray(y))for(var S=0;S<y.length;S++)this.addSubSchema(g,y[S])},c.prototype.addSubSchemaObject=function(g,y){if(!(!y||typeof y!="object"))for(var S in y)this.addSubSchema(g,y[S])},c.prototype.setSchemas=function(g){this.schemas=g},c.prototype.getSchema=function(g){return this.schemas[g]},c.prototype.validate=function(g,y,S,v){if(typeof y!="boolean"&&typeof y!="object"||y===null)throw new a("Expected `schema` to be an object or boolean");S||(S={});var b=y.$id||y.id;let m=t.resolveUrl(S.base,b||"");if(!v){v=new l(y,S,[],m,Object.create(this.schemas)),v.schemas[m]||(v.schemas[m]=y);var w=r(m,y);for(var x in w.id){var k=w.id[x];v.schemas[x]=k}}if(S.required&&g===void 0){var E=new n(g,y,S,v);return E.addError("is required, but is undefined"),E}var E=this.validateSchema(g,y,S,v);if(E){if(S.throwAll&&E.errors.length)throw new o(E)}else throw new Error("Result undefined");return E};function d(h){var g=typeof h=="string"?h:h.$ref;return typeof g=="string"?g:!1}c.prototype.validateSchema=function(g,y,S,v){var b=new n(g,y,S,v);if(typeof y=="boolean")y===!0?y={}:y===!1&&(y={type:[]});else if(!y)throw new Error("schema is undefined");if(y.extends)if(Array.isArray(y.extends)){var m={schema:y,ctx:v};y.extends.forEach(this.schemaTraverser.bind(this,m)),y=m.schema,m.schema=null,m.ctx=null,m=null}else y=t.deepMerge(y,this.superResolve(y.extends,v));var w=d(y);if(w){var x=this.resolve(y,w,v),k=new l(x.subschema,S,v.path,x.switchSchema,v.schemas);return this.validateSchema(g,x.subschema,S,k)}var E=S&&S.skipAttributes||[];for(var R in y)if(!e.ignoreProperties[R]&&E.indexOf(R)<0){var F=null,A=this.attributes[R];if(A)F=A.call(this,g,y,S,v);else if(S.allowUnknownAttributes===!1)throw new a("Unsupported attribute: "+R,y);F&&b.importErrors(F)}if(typeof S.rewrite=="function"){var P=S.rewrite.call(this,g,y,S,v);b.instance=P}return b},c.prototype.schemaTraverser=function(g,y){g.schema=t.deepMerge(g.schema,this.superResolve(y,g.ctx))},c.prototype.superResolve=function(g,y){var S=d(g);return S?this.resolve(g,S,y).subschema:g},c.prototype.resolve=function(g,y,S){if(y=S.resolve(y),S.schemas[y])return{subschema:S.schemas[y],switchSchema:y};let b=new URL(y,"thismessage::/").hash;var m=b&&b.length&&y.substr(0,y.length-b.length);if(!m||!S.schemas[m])throw new a("no such schema <"+y+">",g);var w=t.objectGetPath(S.schemas[m],b.substr(1));if(w===void 0)throw new a("no such schema "+b+" located in <"+m+">",g);return{subschema:w,switchSchema:y}},c.prototype.testType=function(g,y,S,v,b){if(b!==void 0){if(b===null)throw new a('Unexpected null in "type" keyword');if(typeof this.types[b]=="function")return this.types[b].call(this,g);if(b&&typeof b=="object"){var m=this.validateSchema(g,b,S,v);return m===void 0||!(m&&m.errors.length)}return!0}};var p=c.prototype.types={};return p.string=function(g){return typeof g=="string"},p.number=function(g){return typeof g=="number"&&isFinite(g)},p.integer=function(g){return typeof g=="number"&&g%1===0},p.boolean=function(g){return typeof g=="boolean"},p.array=function(g){return Array.isArray(g)},p.null=function(g){return g===null},p.date=function(g){return g instanceof Date},p.any=function(g){return!0},p.object=function(g){return g&&typeof g=="object"&&!Array.isArray(g)&&!(g instanceof Date)},Bf=c,Bf}var C0;function D3(){if(C0)return Hr;C0=1;var e=Hr.Validator=M3();return Hr.ValidatorResult=pi().ValidatorResult,Hr.ValidatorResultError=pi().ValidatorResultError,Hr.ValidationError=pi().ValidationError,Hr.SchemaError=pi().SchemaError,Hr.SchemaScanResult=Sd().SchemaScanResult,Hr.scan=Sd().scan,Hr.validate=function(t,r,n){var o=new e;return o.validate(t,r,n)},Hr}var $3=D3();const w1=(e,t,r)=>{const n=e instanceof RegExp?P0(e,r):e,o=t instanceof RegExp?P0(t,r):t,a=n!==null&&o!=null&&L3(n,o,r);return a&&{start:a[0],end:a[1],pre:r.slice(0,a[0]),body:r.slice(a[0]+n.length,a[1]),post:r.slice(a[1]+o.length)}},P0=(e,t)=>{const r=t.match(e);return r?r[0]:null},L3=(e,t,r)=>{let n,o,a,l,u,c=r.indexOf(e),d=r.indexOf(t,c+1),p=c;if(c>=0&&d>0){if(e===t)return[c,d];for(n=[],a=r.length;p>=0&&!u;){if(p===c)n.push(p),c=r.indexOf(e,p+1);else if(n.length===1){const h=n.pop();h!==void 0&&(u=[h,d])}else o=n.pop(),o!==void 0&&o<a&&(a=o,l=d),d=r.indexOf(t,p+1);p=c<d&&c>=0?c:d}n.length&&l!==void 0&&(u=[a,l])}return u},x1="\0SLASH"+Math.random()+"\0",S1="\0OPEN"+Math.random()+"\0",Rp="\0CLOSE"+Math.random()+"\0",_1="\0COMMA"+Math.random()+"\0",E1="\0PERIOD"+Math.random()+"\0",z3=new RegExp(x1,"g"),j3=new RegExp(S1,"g"),F3=new RegExp(Rp,"g"),H3=new RegExp(_1,"g"),W3=new RegExp(E1,"g"),B3=/\\\\/g,U3=/\\{/g,V3=/\\}/g,q3=/\\,/g,G3=/\\./g;function Uf(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function Z3(e){return e.replace(B3,x1).replace(U3,S1).replace(V3,Rp).replace(q3,_1).replace(G3,E1)}function K3(e){return e.replace(z3,"\\").replace(j3,"{").replace(F3,"}").replace(H3,",").replace(W3,".")}function k1(e){if(!e)return[""];const t=[],r=w1("{","}",e);if(!r)return e.split(",");const{pre:n,body:o,post:a}=r,l=n.split(",");l[l.length-1]+="{"+o+"}";const u=k1(a);return a.length&&(l[l.length-1]+=u.shift(),l.push.apply(l,u)),t.push.apply(t,l),t}function Y3(e){return e?(e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),fa(Z3(e),!0).map(K3)):[]}function X3(e){return"{"+e+"}"}function J3(e){return/^-?0\d/.test(e)}function Q3(e,t){return e<=t}function ej(e,t){return e>=t}function fa(e,t){const r=[],n=w1("{","}",e);if(!n)return[e];const o=n.pre,a=n.post.length?fa(n.post,!1):[""];if(/\$$/.test(n.pre))for(let l=0;l<a.length;l++){const u=o+"{"+n.body+"}"+a[l];r.push(u)}else{const l=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),c=l||u,d=n.body.indexOf(",")>=0;if(!c&&!d)return n.post.match(/,(?!,).*\}/)?(e=n.pre+"{"+n.body+Rp+n.post,fa(e)):[e];let p;if(c)p=n.body.split(/\.\./);else if(p=k1(n.body),p.length===1&&p[0]!==void 0&&(p=fa(p[0],!1).map(X3),p.length===1))return a.map(g=>n.pre+p[0]+g);let h;if(c&&p[0]!==void 0&&p[1]!==void 0){const g=Uf(p[0]),y=Uf(p[1]),S=Math.max(p[0].length,p[1].length);let v=p.length===3&&p[2]!==void 0?Math.abs(Uf(p[2])):1,b=Q3;y<g&&(v*=-1,b=ej);const w=p.some(J3);h=[];for(let x=g;b(x,y);x+=v){let k;if(u)k=String.fromCharCode(x),k==="\\"&&(k="");else if(k=String(x),w){const E=S-k.length;if(E>0){const R=new Array(E+1).join("0");x<0?k="-"+R+k.slice(1):k=R+k}}h.push(k)}}else{h=[];for(let g=0;g<p.length;g++)h.push.apply(h,fa(p[g],!1))}for(let g=0;g<h.length;g++)for(let y=0;y<a.length;y++){const S=o+h[g]+a[y];(!t||c||S)&&r.push(S)}}return r}const tj=1024*64,ql=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>tj)throw new TypeError("pattern is too long")},rj={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},oa=e=>e.replace(/[[\]\\-]/g,"\\$&"),nj=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),I0=e=>e.join(""),ij=(e,t)=>{const r=t;if(e.charAt(r)!=="[")throw new Error("not in a brace expression");const n=[],o=[];let a=r+1,l=!1,u=!1,c=!1,d=!1,p=r,h="";e:for(;a<e.length;){const v=e.charAt(a);if((v==="!"||v==="^")&&a===r+1){d=!0,a++;continue}if(v==="]"&&l&&!c){p=a+1;break}if(l=!0,v==="\\"&&!c){c=!0,a++;continue}if(v==="["&&!c){for(const[b,[m,w,x]]of Object.entries(rj))if(e.startsWith(b,a)){if(h)return["$.",!1,e.length-r,!0];a+=b.length,x?o.push(m):n.push(m),u=u||w;continue e}}if(c=!1,h){v>h?n.push(oa(h)+"-"+oa(v)):v===h&&n.push(oa(v)),h="",a++;continue}if(e.startsWith("-]",a+1)){n.push(oa(v+"-")),a+=2;continue}if(e.startsWith("-",a+1)){h=v,a+=2;continue}n.push(oa(v)),a++}if(p<a)return["",!1,0,!1];if(!n.length&&!o.length)return["$.",!1,e.length-r,!0];if(o.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!d){const v=n[0].length===2?n[0].slice(-1):n[0];return[nj(v),!1,p-r,!1]}const g="["+(d?"^":"")+I0(n)+"]",y="["+(d?"":"^")+I0(o)+"]";return[n.length&&o.length?"("+g+"|"+y+")":n.length?g:y,u,p-r,!0]},da=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),oj=new Set(["!","?","+","*","@"]),N0=e=>oj.has(e),aj="(?!(?:^|/)\\.\\.?(?:$|/))",cl="(?!\\.)",sj=new Set(["[","."]),lj=new Set(["..","."]),uj=new Set("().*{}+?[]^$\\!"),cj=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Cp="[^/]",M0=Cp+"*?",D0=Cp+"+?";var _t,kt,vn,ot,mt,Hn,hi,Wn,Ur,gi,Pa,_i,O1,Vn,Ol,_d,A1;const Bt=class Bt{constructor(t,r,n={}){$t(this,_i);ke(this,"type");$t(this,_t);$t(this,kt);$t(this,vn,!1);$t(this,ot,[]);$t(this,mt);$t(this,Hn);$t(this,hi);$t(this,Wn,!1);$t(this,Ur);$t(this,gi);$t(this,Pa,!1);this.type=t,t&&ft(this,kt,!0),ft(this,mt,r),ft(this,_t,fe(this,mt)?fe(fe(this,mt),_t):this),ft(this,Ur,fe(this,_t)===this?n:fe(fe(this,_t),Ur)),ft(this,hi,fe(this,_t)===this?[]:fe(fe(this,_t),hi)),t==="!"&&!fe(fe(this,_t),Wn)&&fe(this,hi).push(this),ft(this,Hn,fe(this,mt)?fe(fe(this,mt),ot).length:0)}get hasMagic(){if(fe(this,kt)!==void 0)return fe(this,kt);for(const t of fe(this,ot))if(typeof t!="string"&&(t.type||t.hasMagic))return ft(this,kt,!0);return fe(this,kt)}toString(){return fe(this,gi)!==void 0?fe(this,gi):this.type?ft(this,gi,this.type+"("+fe(this,ot).map(t=>String(t)).join("|")+")"):ft(this,gi,fe(this,ot).map(t=>String(t)).join(""))}push(...t){for(const r of t)if(r!==""){if(typeof r!="string"&&!(r instanceof Bt&&fe(r,mt)===this))throw new Error("invalid part: "+r);fe(this,ot).push(r)}}toJSON(){var r;const t=this.type===null?fe(this,ot).slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...fe(this,ot).map(n=>n.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===fe(this,_t)||fe(fe(this,_t),Wn)&&((r=fe(this,mt))==null?void 0:r.type)==="!")&&t.push({}),t}isStart(){var r;if(fe(this,_t)===this)return!0;if(!((r=fe(this,mt))!=null&&r.isStart()))return!1;if(fe(this,Hn)===0)return!0;const t=fe(this,mt);for(let n=0;n<fe(this,Hn);n++){const o=fe(t,ot)[n];if(!(o instanceof Bt&&o.type==="!"))return!1}return!0}isEnd(){var r,n,o;if(fe(this,_t)===this||((r=fe(this,mt))==null?void 0:r.type)==="!")return!0;if(!((n=fe(this,mt))!=null&&n.isEnd()))return!1;if(!this.type)return(o=fe(this,mt))==null?void 0:o.isEnd();const t=fe(this,mt)?fe(fe(this,mt),ot).length:0;return fe(this,Hn)===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){const r=new Bt(this.type,t);for(const n of fe(this,ot))r.copyIn(n);return r}static fromGlob(t,r={}){var o;const n=new Bt(null,void 0,r);return Fe(o=Bt,Vn,Ol).call(o,t,n,0,r),n}toMMPattern(){if(this!==fe(this,_t))return fe(this,_t).toMMPattern();const t=this.toString(),[r,n,o,a]=this.toRegExpSource();if(!(o||fe(this,kt)||fe(this,Ur).nocase&&!fe(this,Ur).nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return n;const u=(fe(this,Ur).nocase?"i":"")+(a?"u":"");return Object.assign(new RegExp(`^${r}$`,u),{_src:r,_glob:t})}get options(){return fe(this,Ur)}toRegExpSource(t){var c;const r=t??!!fe(this,Ur).dot;if(fe(this,_t)===this&&Fe(this,_i,O1).call(this),!this.type){const d=this.isStart()&&this.isEnd(),p=fe(this,ot).map(S=>{var x;const[v,b,m,w]=typeof S=="string"?Fe(x=Bt,Vn,A1).call(x,S,fe(this,kt),d):S.toRegExpSource(t);return ft(this,kt,fe(this,kt)||m),ft(this,vn,fe(this,vn)||w),v}).join("");let h="";if(this.isStart()&&typeof fe(this,ot)[0]=="string"&&!(fe(this,ot).length===1&&lj.has(fe(this,ot)[0]))){const v=sj,b=r&&v.has(p.charAt(0))||p.startsWith("\\.")&&v.has(p.charAt(2))||p.startsWith("\\.\\.")&&v.has(p.charAt(4)),m=!r&&!t&&v.has(p.charAt(0));h=b?aj:m?cl:""}let g="";return this.isEnd()&&fe(fe(this,_t),Wn)&&((c=fe(this,mt))==null?void 0:c.type)==="!"&&(g="(?:$|\\/)"),[h+p+g,da(p),ft(this,kt,!!fe(this,kt)),fe(this,vn)]}const n=this.type==="*"||this.type==="+",o=this.type==="!"?"(?:(?!(?:":"(?:";let a=Fe(this,_i,_d).call(this,r);if(this.isStart()&&this.isEnd()&&!a&&this.type!=="!"){const d=this.toString();return ft(this,ot,[d]),this.type=null,ft(this,kt,void 0),[d,da(this.toString()),!1,!1]}let l=!n||t||r||!cl?"":Fe(this,_i,_d).call(this,!0);l===a&&(l=""),l&&(a=`(?:${a})(?:${l})*?`);let u="";if(this.type==="!"&&fe(this,Pa))u=(this.isStart()&&!r?cl:"")+D0;else{const d=this.type==="!"?"))"+(this.isStart()&&!r&&!t?cl:"")+M0+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&l?")":this.type==="*"&&l?")?":`)${this.type}`;u=o+a+d}return[u,da(a),ft(this,kt,!!fe(this,kt)),fe(this,vn)]}};_t=new WeakMap,kt=new WeakMap,vn=new WeakMap,ot=new WeakMap,mt=new WeakMap,Hn=new WeakMap,hi=new WeakMap,Wn=new WeakMap,Ur=new WeakMap,gi=new WeakMap,Pa=new WeakMap,_i=new WeakSet,O1=function(){if(this!==fe(this,_t))throw new Error("should only call on root");if(fe(this,Wn))return this;this.toString(),ft(this,Wn,!0);let t;for(;t=fe(this,hi).pop();){if(t.type!=="!")continue;let r=t,n=fe(r,mt);for(;n;){for(let o=fe(r,Hn)+1;!n.type&&o<fe(n,ot).length;o++)for(const a of fe(t,ot)){if(typeof a=="string")throw new Error("string part in extglob AST??");a.copyIn(fe(n,ot)[o])}r=n,n=fe(r,mt)}}return this},Vn=new WeakSet,Ol=function(t,r,n,o){var y,S;let a=!1,l=!1,u=-1,c=!1;if(r.type===null){let v=n,b="";for(;v<t.length;){const m=t.charAt(v++);if(a||m==="\\"){a=!a,b+=m;continue}if(l){v===u+1?(m==="^"||m==="!")&&(c=!0):m==="]"&&!(v===u+2&&c)&&(l=!1),b+=m;continue}else if(m==="["){l=!0,u=v,c=!1,b+=m;continue}if(!o.noext&&N0(m)&&t.charAt(v)==="("){r.push(b),b="";const w=new Bt(m,r);v=Fe(y=Bt,Vn,Ol).call(y,t,w,v,o),r.push(w);continue}b+=m}return r.push(b),v}let d=n+1,p=new Bt(null,r);const h=[];let g="";for(;d<t.length;){const v=t.charAt(d++);if(a||v==="\\"){a=!a,g+=v;continue}if(l){d===u+1?(v==="^"||v==="!")&&(c=!0):v==="]"&&!(d===u+2&&c)&&(l=!1),g+=v;continue}else if(v==="["){l=!0,u=d,c=!1,g+=v;continue}if(N0(v)&&t.charAt(d)==="("){p.push(g),g="";const b=new Bt(v,p);p.push(b),d=Fe(S=Bt,Vn,Ol).call(S,t,b,d,o);continue}if(v==="|"){p.push(g),g="",h.push(p),p=new Bt(null,r);continue}if(v===")")return g===""&&fe(r,ot).length===0&&ft(r,Pa,!0),p.push(g),g="",r.push(...h,p),d;g+=v}return r.type=null,ft(r,kt,void 0),ft(r,ot,[t.substring(n-1)]),d},_d=function(t){return fe(this,ot).map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");const[n,o,a,l]=r.toRegExpSource(t);return ft(this,vn,fe(this,vn)||l),n}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")},A1=function(t,r,n=!1){let o=!1,a="",l=!1;for(let u=0;u<t.length;u++){const c=t.charAt(u);if(o){o=!1,a+=(uj.has(c)?"\\":"")+c;continue}if(c==="\\"){u===t.length-1?a+="\\\\":o=!0;continue}if(c==="["){const[d,p,h,g]=ij(t,u);if(h){a+=d,l=l||p,u+=h-1,r=r||g;continue}}if(c==="*"){n&&t==="*"?a+=D0:a+=M0,r=!0;continue}if(c==="?"){a+=Cp,r=!0;continue}a+=cj(c)}return[a,da(t),!!r,l]},$t(Bt,Vn);let Gl=Bt;const fj=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&"),zt=(e,t,r={})=>(ql(t),!r.nocomment&&t.charAt(0)==="#"?!1:new vu(t,r).match(e)),dj=/^\*+([^+@!?\*\[\(]*)$/,pj=e=>t=>!t.startsWith(".")&&t.endsWith(e),hj=e=>t=>t.endsWith(e),gj=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),vj=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),mj=/^\*+\.\*+$/,bj=e=>!e.startsWith(".")&&e.includes("."),yj=e=>e!=="."&&e!==".."&&e.includes("."),wj=/^\.\*+$/,xj=e=>e!=="."&&e!==".."&&e.startsWith("."),Sj=/^\*+$/,_j=e=>e.length!==0&&!e.startsWith("."),Ej=e=>e.length!==0&&e!=="."&&e!=="..",kj=/^\?+([^+@!?\*\[\(]*)?$/,Oj=([e,t=""])=>{const r=T1([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},Aj=([e,t=""])=>{const r=R1([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},Tj=([e,t=""])=>{const r=R1([e]);return t?n=>r(n)&&n.endsWith(t):r},Rj=([e,t=""])=>{const r=T1([e]);return t?n=>r(n)&&n.endsWith(t):r},T1=([e])=>{const t=e.length;return r=>r.length===t&&!r.startsWith(".")},R1=([e])=>{const t=e.length;return r=>r.length===t&&r!=="."&&r!==".."},C1=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",$0={win32:{sep:"\\"},posix:{sep:"/"}},Cj=C1==="win32"?$0.win32.sep:$0.posix.sep;zt.sep=Cj;const wr=Symbol("globstar **");zt.GLOBSTAR=wr;const Pj="[^/]",Ij=Pj+"*?",Nj="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Mj="(?:(?!(?:\\/|^)\\.).)*?",Dj=(e,t={})=>r=>zt(r,e,t);zt.filter=Dj;const yr=(e,t={})=>Object.assign({},e,t),$j=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return zt;const t=zt;return Object.assign((n,o,a={})=>t(n,o,yr(e,a)),{Minimatch:class extends t.Minimatch{constructor(o,a={}){super(o,yr(e,a))}static defaults(o){return t.defaults(yr(e,o)).Minimatch}},AST:class extends t.AST{constructor(o,a,l={}){super(o,a,yr(e,l))}static fromGlob(o,a={}){return t.AST.fromGlob(o,yr(e,a))}},unescape:(n,o={})=>t.unescape(n,yr(e,o)),escape:(n,o={})=>t.escape(n,yr(e,o)),filter:(n,o={})=>t.filter(n,yr(e,o)),defaults:n=>t.defaults(yr(e,n)),makeRe:(n,o={})=>t.makeRe(n,yr(e,o)),braceExpand:(n,o={})=>t.braceExpand(n,yr(e,o)),match:(n,o,a={})=>t.match(n,o,yr(e,a)),sep:t.sep,GLOBSTAR:wr})};zt.defaults=$j;const P1=(e,t={})=>(ql(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:Y3(e));zt.braceExpand=P1;const Lj=(e,t={})=>new vu(e,t).makeRe();zt.makeRe=Lj;const zj=(e,t,r={})=>{const n=new vu(t,r);return e=e.filter(o=>n.match(o)),n.options.nonull&&!e.length&&e.push(t),e};zt.match=zj;const L0=/[?*]|[+@!]\(.*?\)|\[|\]/,jj=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class vu{constructor(t,r={}){ke(this,"options");ke(this,"set");ke(this,"pattern");ke(this,"windowsPathsNoEscape");ke(this,"nonegate");ke(this,"negate");ke(this,"comment");ke(this,"empty");ke(this,"preserveMultipleSlashes");ke(this,"partial");ke(this,"globSet");ke(this,"globParts");ke(this,"nocase");ke(this,"isWindows");ke(this,"platform");ke(this,"windowsNoMagicRoot");ke(this,"regexp");ql(t),r=r||{},this.options=r,this.pattern=t,this.platform=r.platform||C1,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const t of this.set)for(const r of t)if(typeof r!="string")return!0;return!1}debug(...t){}make(){const t=this.pattern,r=this.options;if(!r.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...a)=>console.error(...a)),this.debug(this.pattern,this.globSet);const n=this.globSet.map(a=>this.slashSplit(a));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let o=this.globParts.map((a,l,u)=>{if(this.isWindows&&this.windowsNoMagicRoot){const c=a[0]===""&&a[1]===""&&(a[2]==="?"||!L0.test(a[2]))&&!L0.test(a[3]),d=/^[a-z]:/i.test(a[0]);if(c)return[...a.slice(0,4),...a.slice(4).map(p=>this.parse(p))];if(d)return[a[0],...a.slice(1).map(p=>this.parse(p))]}return a.map(c=>this.parse(c))});if(this.debug(this.pattern,o),this.set=o.filter(a=>a.indexOf(!1)===-1),this.isWindows)for(let a=0;a<this.set.length;a++){const l=this.set[a];l[0]===""&&l[1]===""&&this.globParts[a][2]==="?"&&typeof l[3]=="string"&&/^[a-z]:$/i.test(l[3])&&(l[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let n=0;n<t.length;n++)for(let o=0;o<t[n].length;o++)t[n][o]==="**"&&(t[n][o]="*");const{optimizationLevel:r=1}=this.options;return r>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):r>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(r=>{let n=-1;for(;(n=r.indexOf("**",n+1))!==-1;){let o=n;for(;r[o+1]==="**";)o++;o!==n&&r.splice(n,o-n)}return r})}levelOneOptimize(t){return t.map(r=>(r=r.reduce((n,o)=>{const a=n[n.length-1];return o==="**"&&a==="**"?n:o===".."&&a&&a!==".."&&a!=="."&&a!=="**"?(n.pop(),n):(n.push(o),n)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let o=1;o<t.length-1;o++){const a=t[o];o===1&&a===""&&t[0]===""||(a==="."||a==="")&&(r=!0,t.splice(o,1),o--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(r=!0,t.pop())}let n=0;for(;(n=t.indexOf("..",n+1))!==-1;){const o=t[n-1];o&&o!=="."&&o!==".."&&o!=="**"&&(r=!0,t.splice(n-1,2),n-=2)}}while(r);return t.length===0?[""]:t}firstPhasePreProcess(t){let r=!1;do{r=!1;for(let n of t){let o=-1;for(;(o=n.indexOf("**",o+1))!==-1;){let l=o;for(;n[l+1]==="**";)l++;l>o&&n.splice(o+1,l-o);let u=n[o+1];const c=n[o+2],d=n[o+3];if(u!==".."||!c||c==="."||c===".."||!d||d==="."||d==="..")continue;r=!0,n.splice(o,1);const p=n.slice(0);p[o]="**",t.push(p),o--}if(!this.preserveMultipleSlashes){for(let l=1;l<n.length-1;l++){const u=n[l];l===1&&u===""&&n[0]===""||(u==="."||u==="")&&(r=!0,n.splice(l,1),l--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(r=!0,n.pop())}let a=0;for(;(a=n.indexOf("..",a+1))!==-1;){const l=n[a-1];if(l&&l!=="."&&l!==".."&&l!=="**"){r=!0;const c=a===1&&n[a+1]==="**"?["."]:[];n.splice(a-1,2,...c),n.length===0&&n.push(""),a-=2}}}}while(r);return t}secondPhasePreProcess(t){for(let r=0;r<t.length-1;r++)for(let n=r+1;n<t.length;n++){const o=this.partsMatch(t[r],t[n],!this.preserveMultipleSlashes);if(o){t[r]=[],t[n]=o;break}}return t.filter(r=>r.length)}partsMatch(t,r,n=!1){let o=0,a=0,l=[],u="";for(;o<t.length&&a<r.length;)if(t[o]===r[a])l.push(u==="b"?r[a]:t[o]),o++,a++;else if(n&&t[o]==="**"&&r[a]===t[o+1])l.push(t[o]),o++;else if(n&&r[a]==="**"&&t[o]===r[a+1])l.push(r[a]),a++;else if(t[o]==="*"&&r[a]&&(this.options.dot||!r[a].startsWith("."))&&r[a]!=="**"){if(u==="b")return!1;u="a",l.push(t[o]),o++,a++}else if(r[a]==="*"&&t[o]&&(this.options.dot||!t[o].startsWith("."))&&t[o]!=="**"){if(u==="a")return!1;u="b",l.push(r[a]),o++,a++}else return!1;return t.length===r.length&&l}parseNegate(){if(this.nonegate)return;const t=this.pattern;let r=!1,n=0;for(let o=0;o<t.length&&t.charAt(o)==="!";o++)r=!r,n++;n&&(this.pattern=t.slice(n)),this.negate=r}matchOne(t,r,n=!1){const o=this.options;if(this.isWindows){const v=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),b=!v&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),m=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),w=!m&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),x=b?3:v?0:void 0,k=w?3:m?0:void 0;if(typeof x=="number"&&typeof k=="number"){const[E,R]=[t[x],r[k]];E.toLowerCase()===R.toLowerCase()&&(r[k]=E,k>x?r=r.slice(k):x>k&&(t=t.slice(x)))}}const{optimizationLevel:a=1}=this.options;a>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:r}),this.debug("matchOne",t.length,r.length);for(var l=0,u=0,c=t.length,d=r.length;l<c&&u<d;l++,u++){this.debug("matchOne loop");var p=r[u],h=t[l];if(this.debug(r,p,h),p===!1)return!1;if(p===wr){this.debug("GLOBSTAR",[r,p,h]);var g=l,y=u+1;if(y===d){for(this.debug("** at the end");l<c;l++)if(t[l]==="."||t[l]===".."||!o.dot&&t[l].charAt(0)===".")return!1;return!0}for(;g<c;){var S=t[g];if(this.debug(`
254
254
  globstar while`,t,g,r,y,S),this.matchOne(t.slice(g),r.slice(y),n))return this.debug("globstar found match!",g,c,S),!0;if(S==="."||S===".."||!o.dot&&S.charAt(0)==="."){this.debug("dot detected!",t,g,r,y);break}this.debug("globstar swallow a segment, and continue"),g++}return!!(n&&(this.debug(`
255
- >>> no match, partial?`,t,g,r,y),g===c))}let v;if(typeof p=="string"?(v=h===p,this.debug("string match",p,h,v)):(v=p.test(h),this.debug("pattern match",p,h,v)),!v)return!1}if(l===c&&u===d)return!0;if(l===c)return n;if(u===d)return l===c-1&&t[l]==="";throw new Error("wtf?")}braceExpand(){return P1(this.pattern,this.options)}parse(t){ql(t);const r=this.options;if(t==="**")return wr;if(t==="")return"";let n,o=null;(n=t.match(Sj))?o=r.dot?Ej:_j:(n=t.match(dj))?o=(r.nocase?r.dot?vj:gj:r.dot?hj:pj)(n[1]):(n=t.match(kj))?o=(r.nocase?r.dot?Aj:Oj:r.dot?Tj:Rj)(n):(n=t.match(mj))?o=r.dot?yj:bj:(n=t.match(wj))&&(o=xj);const a=Gl.fromGlob(t,this.options).toMMPattern();return o&&typeof a=="object"&&Reflect.defineProperty(a,"test",{value:o}),a}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const r=this.options,n=r.noglobstar?Ij:r.dot?Nj:Mj,o=new Set(r.nocase?["i"]:[]);let a=t.map(c=>{const d=c.map(p=>{if(p instanceof RegExp)for(const h of p.flags.split(""))o.add(h);return typeof p=="string"?jj(p):p===wr?wr:p._src});return d.forEach((p,h)=>{const g=d[h+1],y=d[h-1];p!==wr||y===wr||(y===void 0?g!==void 0&&g!==wr?d[h+1]="(?:\\/|"+n+"\\/)?"+g:d[h]=n:g===void 0?d[h-1]=y+"(?:\\/|"+n+")?":g!==wr&&(d[h-1]=y+"(?:\\/|\\/"+n+"\\/)"+g,d[h+1]=wr))}),d.filter(p=>p!==wr).join("/")}).join("|");const[l,u]=t.length>1?["(?:",")"]:["",""];a="^"+l+a+u+"$",this.negate&&(a="^(?!"+a+").+$");try{this.regexp=new RegExp(a,[...o].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,r=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&r)return!0;const n=this.options;this.isWindows&&(t=t.split("\\").join("/"));const o=this.slashSplit(t);this.debug(this.pattern,"split",o);const a=this.set;this.debug(this.pattern,"set",a);let l=o[o.length-1];if(!l)for(let u=o.length-2;!l&&u>=0;u--)l=o[u];for(let u=0;u<a.length;u++){const c=a[u];let d=o;if(n.matchBase&&c.length===1&&(d=[l]),this.matchOne(d,c,r))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(t){return zt.defaults(t).Minimatch}}zt.AST=Gl;zt.Minimatch=vu;zt.escape=fj;zt.unescape=da;const Ca="/$shared",Fj={"**/saved_conditions.json":{parser:"json",content:{conditions:[]},schema:{type:"object",properties:{conditions:{type:"array",items:{type:"object"}}},required:["conditions"]}},"**/shared_datasources.json":{parser:"json",content:{},schema:{type:"object",additionalProperties:!0,patternProperties:{"^.*$":{type:"array"}}}},"**/shared_css.json":{parser:"json",content:{classes:[]},schema:{type:"object",properties:{classes:{type:"array",items:{type:"object"}}},required:["classes"]}},"**/shared_app_events.json":{parser:"json",content:[]},"**/CustomComponents/manifest.json":{parser:"json",content:[],schema:{type:"array",items:{type:"object"}}},"**/crafted_components.json":{parser:"json",content:[],schema:{type:"array"}},"**/HTTPHandlers.json":{parser:"json",content:[],schema:{type:"array"}},"**/i18n.json":{parser:"json",content:{keys:{},userLang:{primary:"",supported:[]}},schema:{type:"object",properties:{keys:{type:"object"},userLang:{type:"object",properties:{primary:{type:"string"},supported:{type:"array",items:{type:"string"}}},required:["primary","supported"]}},required:["keys","userLang"]}},"**/*.json":{parser:"json",content:{}}};function I1(e){const t=Object.entries(Fj).find(([r])=>zt(e,r));return t==null?void 0:t[1]}function mu(e){var n;const t=(n=I1(e))==null?void 0:n.content;if(!t)return;const r=e.replace(`${Ca}/`,"Shared/");Pp({name:r,content:t,asText:typeof t=="string"})}async function Hj(){const e=["CustomComponents/manifest.json","shared_app_events.json","shared_css.json","saved_conditions.json","i18n.json"];for(const t of e)try{await qe(`${Ca}/${t}?t=${Date.now()}`,{method:"GET",headers:new Headers({"Content-Type":"application/json"})})}catch(r){N1(r)&&mu(`${Ca}/${t}`)}}function Ha({path:e,createIfNotExists:t=!1}){const r=`${Ca}/${e}`;return qe(`${r}?t=${Date.now()}`,{method:"GET",headers:new Headers({"Content-Type":"application/json"})}).then(n=>{const o=I1(e);let a=n;if(!o)return a;if(typeof a=="string")try{switch(o.parser){case"json":a=JSON.parse(a);break;default:break}}catch{throw new Error("Cannot parse")}if(o.schema&&!new $3.Validator().validate(a,o.schema).valid)throw new Error("Invalid Schema");return a}).catch(n=>{if(N1(n)&&t){const o=Wj(n,e);Zx.next({message:o,kind:"warning"}),mu(r)}throw n})}function N1(e){var t;return((t=e==null?void 0:e.response)==null?void 0:t.status)===404||(e==null?void 0:e.message)==="Invalid Schema"||(e==null?void 0:e.message)==="Cannot parse"||(e==null?void 0:e.name)==="SyntaxError"}function Wj(e,t){var r;switch(!0){case((e==null?void 0:e.message)==="Cannot parse "||(e==null?void 0:e.name)==="SyntaxError"):return`Cannot parse file '${t}', resetting...`;case(e==null?void 0:e.message)==="Invalid Schema":return`File '${t}' is corrupt, resetting...`;case((r=e==null?void 0:e.response)==null?void 0:r.status)===404:return`File '${t}' not found, creating...`;default:return e==null?void 0:e.message}}function Bj(e){return qe(Fa,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function Uj(e){return qe(Fa,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}const M1=()=>{const{host:e,protocol:t}=window.location,r=t==="https:";return{projectOpened:!1,remoteDebuggerMode:_p.DISABLED,baseUrl:"",qodly:!0,urls:{renderer:"/$lib/renderer/",debugger:`ws${r?"s":""}://${e}/remoteDebugger`,lsp:`ws${r?"s":""}://${e}/LSP`},isRestActive:!0}};async function Vj(){const{hostname:e,host:t,protocol:r}=window.location,n=r==="https:";try{const o=await qe(yt,{method:"POST",body:JSON.stringify({verb:Kn.GET_APP_SETTINGS}),headers:new Headers({"Content-Type":"application/json"})}),a=(()=>{if(o.rendererPath)return o.rendererPath;const l=`http://${e}:${o.webServerHTTPPort}`,u=`https://${e}:${o.webServerHTTPSPort}`;return o.webServerHTTPPort&&o.webServerHTTPSPort?n?u:l:o.webServerHTTPPort?l:u})();return{projectOpened:o.webServerHTTPSPort>0||o.webServerHTTPPort>0,remoteDebuggerMode:o.remoteDebuggerMode,baseUrl:a,qodly:typeof o.qodly>"u"?!0:o.qodly,urls:{renderer:o.rendererPath||`${a}/$lib/renderer/`,debugger:`ws${n?"s":""}://${t}/remoteDebugger`,lsp:`ws${n?"s":""}://${t}/LSP`},isRestActive:o.isRESTActive}}catch(o){return console.error(o),M1()}}async function D1(e){return await qe(yt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}async function qj(...e){return(await Promise.all(e.map(n=>D1({root:n,verb:Kn.GET_FOLDER})))).map(({children:n})=>n.map(({name:o,date:a,type:l})=>({name:o,type:l,date:a,path:`${l}/${o}`}))).flat()}function Gj(e,t={}){const{sanitize:r=!0}=t;return qe(`/rest/$getWebForm/${e}`,{method:"GET"}).then(n=>{if(!(n!=null&&n.components)||!r)return n;const o=new Map;return{...n,components:Ye.entries(n.components).map(([a,l])=>{const u=a,{resolvedName:c}=l.type;if(c==="WebformLoader"){const d=yi.generate();o.set(a,d),a=d}return[a,l,u]}).reduce((a,[l,u,c])=>{var d;return u.nodes&&(u.nodes=u.nodes.map(p=>o.get(p)||p)),u.linkedNodes&&(u.linkedNodes=Ye.entries(u.linkedNodes).reduce((p,[h,g])=>({...p,[h]:o.get(g)||g}),{})),(d=u.props)!=null&&d.events&&(u.props.events=u.props.events.map(p=>(p.type==="navigation"&&p.loader&&(p.loader=o.get(p.loader)||p.loader),p))),{...a,[l]:{...u,props:{...u.props,__originalID:c}}}},{})}})}function Zj(e){return qe(yt,{method:"POST",headers:new Headers({"Content-Type":"application/json"}),body:JSON.stringify(e)}).then(t=>({...t,content:[Ot.METHOD,Ot.CLASS].includes(t.type)?hu(t.content):t.content}))}function Kj(e){return e.type==="folder"?qe(Fa,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})}):qe(yt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}async function Yj(e){return e.type==="folder"?(await qe(Fa,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})).deleted:(await qe(yt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})).deleted}function Xj(e){return qe(yt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function Jj(e){return qe(yt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}async function Qj(e){return(await qe(yt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})).deleted}async function eF(...e){return await qe(yt,{method:"POST",body:JSON.stringify({verb:Kn.GET_FILES_INFO,files:e}),headers:new Headers({"Content-Type":"application/json"})})}async function tF(e){const t=await qe("/api/login",{method:"POST",body:JSON.stringify({accessKey:e}),headers:new Headers({"Content-Type":"application/json"})});return t.isLogged&&t.success}async function rF(){return await qe("/rest/$catalog/$all?$metadata=full",{method:"GET",headers:new Headers({"Content-Type":"application/json"})})}async function nF(e){try{const t=process.env.NODE_ENV==="development"?"/i18n/languages.json":`/$lib/${e?"studio":"renderer"}/i18n/languages.json`,n=await(await fetch(t)).text(),{supported:o}=JSON.parse(n);return o}catch{return[]}}async function iF({name:e,path:t="",root:r="root",asText:n=!1}){return qe(yt,{method:"POST",body:JSON.stringify({verb:"getFileContent",root:r,path:t,name:e,asText:n}),headers:new Headers({"Content-Type":"application/json"})})}async function oF(e={}){try{return await Ha({path:"shared_datasources.json",...e})}catch{return{}}}async function aF(e={}){try{return await Ha({path:"shared_app_events.json",...e})}catch{return[]}}async function sF(e={}){try{return await Ha({path:"shared_css.json",...e})}catch{return{classes:[]}}}async function lF(e={}){try{return await Ha({path:"saved_conditions.json",...e})}catch{return{conditions:[]}}}async function uF(){try{return await qe("/rest/$info/privileges",{method:"GET",headers:new Headers({"Content-Type":"application/json"})})}catch{return{privileges:[]}}}async function cF(){try{return await(await fetch(`monaco_theme.json?t=${Date.now()}`)).json()}catch{return null}}const fF=kp(),dF=async e=>{const t={verb:Kn.SET_FILE_CONTENT,asText:!1,name:"shared_datasources.json",path:"",root:"shared",content:e};return fF(async()=>(await qe(yt,{method:"POST",body:JSON.stringify(t),headers:new Headers({"Content-Type":"application/json"})}),e))},pF=kp(),hF=async e=>{const t={verb:Kn.SET_FILE_CONTENT,asText:!1,name:"shared_app_events.json",path:"",root:"shared",content:e};return pF(async()=>(await qe(yt,{method:"POST",body:JSON.stringify(t),headers:new Headers({"Content-Type":"application/json"})}),e))},Pp=async e=>{const t=await qe(yt,{method:"POST",body:JSON.stringify({...e,verb:Kn.SET_FILE_CONTENT,root:Sp.ROOT}),headers:new Headers({"Content-Type":"application/json"})}),r=Ep(`${e.path||"Sources"}/${e.name}`);return{...t,type:r,size:0}},gF=async e=>await Pp({name:"crafted_components.json",path:Un.WEBFORMS,content:e});function vF(e){return qe(yt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function mF(e){return qe(yt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function bF(e){return qe(yt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function yF(e){return qe(yt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})}).then(t=>Array.isArray(t)?t:{...t,content:["4dm","4qm","4qs"].includes(t.ext)?hu(t.content):t.content}).catch(t=>{var r,n;throw((n=(r=t.data)==null?void 0:r.__ERROR[0])==null?void 0:n.errCode)===1839&&mu(e.path),t})}function wF(e){return qe(yt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function xF(e){const t=new RegExp(/^\((.+)(?=\))/gi).exec(e);return t!==null?t[1]:""}function SF(e){const t=new RegExp(/(->)(.*)/gi).exec(e);if(t!==null)return t[0].replace("->","");const r=/:([^)]*)$/.exec(e);return r!==null?`result : ${r[1].trim()}`:""}function _F(e){const t=xF(e).split(/[;,]/g).filter(Boolean).map(o=>{const a=o.split(":")[0].trim(),l=o.split(":")[1].trim();return{name:a,type:l}}),r=SF(e),n=r?{name:r.split(":")[0].trim(),type:r.split(":")[1].trim()}:{name:"result",type:"Variable"};return{params:t,result:n}}async function EF(e,t){const n=e.split(".").pop();try{const o=await qe(yt,{method:"POST",body:JSON.stringify({verb:"getFunctionContent",className:t,functionName:n}),headers:new Headers({"Content-Type":"application/json"})});o.content=hu(o.content);const{params:a,result:l}=_F(o.parameters);return{...o,params:a,returns:l}}catch(o){return console.error(o),{className:t,functionName:n,filePath:e,content:"",params:[]}}}var $1=(e=>(e.STUDIO_LOADED="UA-1-0",e.WELCOME_TOUR_INIT="UA-1-3",e.WELCOME_TOUR_END="UA-1-4",e))($1||{});function kF(e,t){fetch("/api/v1/activity",{body:JSON.stringify({AID:e,...t}),headers:{"Content-Type":"application/json"},method:"POST"}).catch(r=>{})}function OF(e){window.pagesense=window.pagesense||[],window.pagesense.push(["trackEvent",e])}var L1=(e=>(e.LOCAL="local",e.SHARED="shared",e.THEME="theme",e))(L1||{}),z1=(e=>(e[e.METHOD=1]="METHOD",e[e.CLASS=10]="CLASS",e))(z1||{}),j1=(e=>(e.WelCome="WelCome",e.ActionPanel="ActionPanel",e.SideBar="SideBar",e.Settings="Settings",e.Main="Main",e.Explorer="Explorer",e.Header="Header",e.ComponentList="ComponentList",e))(j1||{}),F1=(e=>(e[e.FILE_NOT_FOUND=1839]="FILE_NOT_FOUND",e[e.JSON_MALFORMED=554]="JSON_MALFORMED",e[e.JSON_MALFORMED_AT_LINE=550]="JSON_MALFORMED_AT_LINE",e))(F1||{});const AF={transparent:{backgroundColor:"transparent"},black:{backgroundColor:"#4a4a4a",color:"white",padding:"3px 5px",borderRadius:5},grey:{backgroundColor:"#e8e8e8",color:"#262626",padding:"3px 5px",borderRadius:5}},TF={Code:{key:"editors:code",config:{language:"4d",theme:"fd-dark"}},WebForm:{key:"editors:webforms"}};exports.API_PREFIX=yt;exports.AppLoader=JM;exports.BaseCheckboxIcon=Px;exports.Checkbox=A5;exports.ControlledSwitch=cw;exports.DATASOURCE_THEMES=AF;exports.DatasourcesActions=Gx;exports.DebuggerActions=Xx;exports.DefaultCheckboxIcon=Ix;exports.DesignerRequestVerb=Kn;exports.Dialog=NC;exports.DialogBody=Q0;exports.EActivity=$1;exports.EDITOR=TF;exports.EIDENTIFIERS=j1;exports.EPermissionType=Ve;exports.ERROR_CODES=F1;exports.ESubPermissionType=nt;exports.EWebFormStyleClassScope=L1;exports.EXT_API_PREFIX=Fa;exports.FileFolderType=Ot;exports.FloatingTooltip=k5;exports.FolderRootPath=Un;exports.FolderRootType=Sp;exports.HTTPError=xd;exports.HTTP_HANDLERS_TAB_PATH=e1;exports.IPreemptive=Ra;exports.IPublished=c1;exports.IPublishedRestScope=Op;exports.IdentityProvider=q5;exports.Incase=gl;exports.IndentLines=py;exports.LOCALIZATION_TAB_PATH=t1;exports.LogoSVG=Ew;exports.LspActions=Yx;exports.MAX_FILE_NAME_LENGTH=wp;exports.MODEL_TAB_PATH=Mz;exports.Modal=rD;exports.ModalCloseReason=Zi;exports.ModalColor=mi;exports.ModalIcons=sd;exports.ModalType=tp;exports.Mutex=r1;exports.NameError=xp;exports.Overlay=J0;exports.PANEL_EXPANDED_HEIGHT=El;exports.PANEL_INITIAL_HEIGHT=ci;exports.PERMISSIONS=Ap;exports.Panel=O5;exports.Portal=F0;exports.PublishOptions=a3;exports.ROLES_TAB_PATH=Jx;exports.RemoteDebuggerMode=_p;exports.SETTINGS_TAB_PATH=Qx;exports.SHARED_API_PREFIX=Ca;exports.SourceCodeDescriptor=z1;exports.Switcher=hy;exports.TabEventsActions=Kx;exports.Tip=Jy;exports.TipsProvider=a2;exports.Toast=FP;exports.Tooltip=YM;exports.Tree=iI;exports.TreeIcon=uy;exports.TreeNode=Nd;exports.WebformActions=qx;exports.WebformEventsActions=Ta;exports.ZoomComponent=f5;exports.ZoomLevel=Rx;exports._isArrayDatasource=t3;exports._isObjectDatasource=r3;exports.actionsToPrivs=v1;exports.addAttributesToContent=l3;exports.addFolder=Xj;exports.addPermission=S3;exports.addPrivilegeIn=h3;exports.allowed=d3;exports.by=n1;exports.byId=Fz;exports.byPath=Hz;exports.callServerSideParser=I3;exports.checkUpdates=Bj;exports.children=Vl;exports.createFolder=vF;exports.createPrivilege=v3;exports.createRole=T3;exports.datasourcesSubject=Ez;exports.debuggerSubject=Tz;exports.dropFile=Yj;exports.dropFolder=Qj;exports.exists=Wz;exports.extractWebformName=Lz;exports.generateUUID=u3;exports.getAppSettings=Vj;exports.getCatalog=rF;exports.getDatasourceId=Bz;exports.getDefaultAppSettings=M1;exports.getDictByName=b1;exports.getFile=Zj;exports.getFileContent=iF;exports.getFileExtentionFromType=$z;exports.getFilenameAndTypeFromPath=Dz;exports.getFilesInfo=eF;exports.getFolder=D1;exports.getFolders=qj;exports.getFunctionContent=EF;exports.getGraphData=x3;exports.getInheritedResources=y1;exports.getMonacoTheme=cF;exports.getNodeInfo=yF;exports.getPrivilegeById=wn;exports.getPromotions=A3;exports.getResourceFromType=Tp;exports.getSavedConditions=lF;exports.getSharedAppEvents=aF;exports.getSharedCSS=sF;exports.getSharedDatasources=oF;exports.getSharedResource=Ha;exports.getSupportedLanguages=nF;exports.getTypeFromExtension=Ep;exports.getUserPrivileges=uF;exports.getWebForm=Gj;exports.hasAttributesString=d1;exports.http=qe;exports.i18nSubject=Cz;exports.initializeDefaultProjectFiles=Hj;exports.installUpdates=Uj;exports.isArrayDatasource=s1;exports.isDataClassMethod=Gz;exports.isDataStoreMethod=qz;exports.isDateDatasource=n3;exports.isEntity=Qz;exports.isEntityDatasource=Yz;exports.isEntityMethod=Zz;exports.isEntitySelection=e3;exports.isEntitySelectionDatasource=Xz;exports.isEntitySelectionMethod=Kz;exports.isObjectAttribute=Uz;exports.isObjectDatasource=l1;exports.isRelatedAttribute=Vz;exports.isRelatedEntitiesAttribute=o1;exports.isRelatedEntityAttribute=a1;exports.isScalarDatasource=u1;exports.isSimpleAttribute=i1;exports.isSimpleDatasource=Jz;exports.loadDS=i3;exports.loadI18n=o3;exports.log=kF;exports.login=tF;exports.lspSubject=Az;exports.moveItem=bF;exports.outBy=zz;exports.outById=jz;exports.parents=gu;exports.parseAttributes=s3;exports.populateShallow=b3;exports.queue=kp;exports.removeAttributesString=p1;exports.removeItem=mF;exports.removeMultiplePermissions=E3;exports.removePermission=_3;exports.removePrivilege=p3;exports.removePrivilegeFrom=g3;exports.removeRole=R3;exports.renameFile=Kj;exports.renameFolder=Jj;exports.renamePrivilege=m3;exports.resetResources=k3;exports.sanitize=y3;exports.sanitizeContent=hu;exports.sanitizeNameCY=c3;exports.sanitizePermissions=m1;exports.sanitizePrivileges=h1;exports.saveContent=wF;exports.saveRole=C3;exports.setCraftedComponents=gF;exports.setFileContent=Pp;exports.setSharedAppEvents=hF;exports.setSharedSources=dF;exports.sortPrivileges=g1;exports.stringifyAttributes=f1;exports.tabEventsSubject=Oz;exports.tasksManagerSubject=Rz;exports.toAPI=w3;exports.toastSubject=Zx;exports.togglePermission=O3;exports.trackEvent=OF;exports.transformDates=P3;exports.tryCreateSharedResource=mu;exports.uniquePush=Or;exports.useDidMountEffect=T5;exports.useDoubleClick=Y5;exports.useEnhancedState=fz;exports.useFeatureFlags=V5;exports.useForwardedRef=U5;exports.useHotkeys=F5;exports.useIdentity=G5;exports.useOutsideClick=H5;exports.usePrevious=W5;exports.useStateObject=Z5;exports.useStateRef=B5;exports.useTip=Xy;exports.validateName=pu;exports.validateServerSide=Pz;exports.validateValue=Iz;exports.webformEventsSubject=Bl;exports.webformSubject=kz;
255
+ >>> no match, partial?`,t,g,r,y),g===c))}let v;if(typeof p=="string"?(v=h===p,this.debug("string match",p,h,v)):(v=p.test(h),this.debug("pattern match",p,h,v)),!v)return!1}if(l===c&&u===d)return!0;if(l===c)return n;if(u===d)return l===c-1&&t[l]==="";throw new Error("wtf?")}braceExpand(){return P1(this.pattern,this.options)}parse(t){ql(t);const r=this.options;if(t==="**")return wr;if(t==="")return"";let n,o=null;(n=t.match(Sj))?o=r.dot?Ej:_j:(n=t.match(dj))?o=(r.nocase?r.dot?vj:gj:r.dot?hj:pj)(n[1]):(n=t.match(kj))?o=(r.nocase?r.dot?Aj:Oj:r.dot?Tj:Rj)(n):(n=t.match(mj))?o=r.dot?yj:bj:(n=t.match(wj))&&(o=xj);const a=Gl.fromGlob(t,this.options).toMMPattern();return o&&typeof a=="object"&&Reflect.defineProperty(a,"test",{value:o}),a}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const r=this.options,n=r.noglobstar?Ij:r.dot?Nj:Mj,o=new Set(r.nocase?["i"]:[]);let a=t.map(c=>{const d=c.map(p=>{if(p instanceof RegExp)for(const h of p.flags.split(""))o.add(h);return typeof p=="string"?jj(p):p===wr?wr:p._src});return d.forEach((p,h)=>{const g=d[h+1],y=d[h-1];p!==wr||y===wr||(y===void 0?g!==void 0&&g!==wr?d[h+1]="(?:\\/|"+n+"\\/)?"+g:d[h]=n:g===void 0?d[h-1]=y+"(?:\\/|"+n+")?":g!==wr&&(d[h-1]=y+"(?:\\/|\\/"+n+"\\/)"+g,d[h+1]=wr))}),d.filter(p=>p!==wr).join("/")}).join("|");const[l,u]=t.length>1?["(?:",")"]:["",""];a="^"+l+a+u+"$",this.negate&&(a="^(?!"+a+").+$");try{this.regexp=new RegExp(a,[...o].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,r=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&r)return!0;const n=this.options;this.isWindows&&(t=t.split("\\").join("/"));const o=this.slashSplit(t);this.debug(this.pattern,"split",o);const a=this.set;this.debug(this.pattern,"set",a);let l=o[o.length-1];if(!l)for(let u=o.length-2;!l&&u>=0;u--)l=o[u];for(let u=0;u<a.length;u++){const c=a[u];let d=o;if(n.matchBase&&c.length===1&&(d=[l]),this.matchOne(d,c,r))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(t){return zt.defaults(t).Minimatch}}zt.AST=Gl;zt.Minimatch=vu;zt.escape=fj;zt.unescape=da;const Ca="/$shared",Fj={"**/saved_conditions.json":{parser:"json",content:{conditions:[]},schema:{type:"object",properties:{conditions:{type:"array",items:{type:"object"}}},required:["conditions"]}},"**/shared_datasources.json":{parser:"json",content:{},schema:{type:"object",additionalProperties:!0,patternProperties:{"^.*$":{type:"array"}}}},"**/shared_css.json":{parser:"json",content:{classes:[]},schema:{type:"object",properties:{classes:{type:"array",items:{type:"object"}}},required:["classes"]}},"**/shared_app_events.json":{parser:"json",content:[]},"**/CustomComponents/manifest.json":{parser:"json",content:[],schema:{type:"array",items:{type:"object"}}},"**/crafted_components.json":{parser:"json",content:[],schema:{type:"array"}},"**/HTTPHandlers.json":{parser:"json",content:[],schema:{type:"array"}},"**/i18n.json":{parser:"json",content:{keys:{},userLang:{primary:"",supported:[]}},schema:{type:"object",properties:{keys:{type:"object"},userLang:{type:"object",properties:{primary:{type:"string"},supported:{type:"array",items:{type:"string"}}},required:["primary","supported"]}},required:["keys","userLang"]}},"**/*.json":{parser:"json",content:{}}};function I1(e){const t=Object.entries(Fj).find(([r])=>zt(e,r));return t==null?void 0:t[1]}function mu(e){var n;const t=(n=I1(e))==null?void 0:n.content;if(!t)return;const r=e.replace(`${Ca}/`,"Shared/");Pp({name:r,content:t,asText:typeof t=="string"})}async function Hj(){const e=["CustomComponents/manifest.json","shared_app_events.json","shared_css.json","saved_conditions.json","i18n.json"];for(const t of e)try{await qe(`${Ca}/${t}?t=${Date.now()}`,{method:"GET",headers:new Headers({"Content-Type":"application/json"})})}catch(r){N1(r)&&mu(`${Ca}/${t}`)}}function Ha({path:e,createIfNotExists:t=!1}){const r=`${Ca}/${e}`;return qe(`${r}?t=${Date.now()}`,{method:"GET",headers:new Headers({"Content-Type":"application/json"})}).then(n=>{const o=I1(e);let a=n;if(!o)return a;if(typeof a=="string")try{switch(o.parser){case"json":a=JSON.parse(a);break;default:break}}catch{throw new Error("Cannot parse")}if(o.schema&&!new $3.Validator().validate(a,o.schema).valid)throw new Error("Invalid Schema");return a}).catch(n=>{if(N1(n)&&t){const o=Wj(n,e);Zx.next({message:o,kind:"warning"}),mu(r)}throw n})}function N1(e){var t;return((t=e==null?void 0:e.response)==null?void 0:t.status)===404||(e==null?void 0:e.message)==="Invalid Schema"||(e==null?void 0:e.message)==="Cannot parse"||(e==null?void 0:e.name)==="SyntaxError"}function Wj(e,t){var r;switch(!0){case((e==null?void 0:e.message)==="Cannot parse "||(e==null?void 0:e.name)==="SyntaxError"):return`Cannot parse file '${t}', resetting...`;case(e==null?void 0:e.message)==="Invalid Schema":return`File '${t}' is corrupt, resetting...`;case((r=e==null?void 0:e.response)==null?void 0:r.status)===404:return`File '${t}' not found, creating...`;default:return e==null?void 0:e.message}}function Bj(e){return qe(Fa,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function Uj(e){return qe(Fa,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}const M1=()=>{const{host:e,protocol:t}=window.location,r=t==="https:";return{projectOpened:!1,remoteDebuggerMode:_p.DISABLED,baseUrl:"",qodly:!0,urls:{renderer:"/$lib/renderer/",debugger:`ws${r?"s":""}://${e}/remoteDebugger`,lsp:`ws${r?"s":""}://${e}/LSP`},isRestActive:!0}};async function Vj(){const{hostname:e,host:t,protocol:r}=window.location,n=r==="https:";try{const o=await qe(yt,{method:"POST",body:JSON.stringify({verb:Kn.GET_APP_SETTINGS}),headers:new Headers({"Content-Type":"application/json"})}),a=(()=>{if(o.rendererPath)return o.rendererPath;const l=`http://${e}:${o.webServerHTTPPort}`,u=`https://${e}:${o.webServerHTTPSPort}`;return o.webServerHTTPPort&&o.webServerHTTPSPort?n?u:l:o.webServerHTTPPort?l:u})();return{projectOpened:o.webServerHTTPSPort>0||o.webServerHTTPPort>0,remoteDebuggerMode:o.remoteDebuggerMode,baseUrl:a,qodly:typeof o.qodly>"u"?!0:o.qodly,urls:{renderer:o.rendererPath||`${a}/$lib/renderer/`,debugger:`ws${n?"s":""}://${t}/remoteDebugger`,lsp:`ws${n?"s":""}://${t}/LSP`},isRestActive:o.isRESTActive}}catch(o){return console.error(o),M1()}}async function D1(e){return await qe(yt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}async function qj(...e){return(await Promise.all(e.map(n=>D1({root:n,verb:Kn.GET_FOLDER})))).map(({children:n})=>n.map(({name:o,date:a,type:l})=>({name:o,type:l,date:a,path:`${l}/${o}`}))).flat()}function Gj(e,t={}){const{sanitize:r=!0}=t;return qe(`/rest/$getWebForm/${e}`,{method:"GET"}).then(n=>{if(!(n!=null&&n.components)||!r)return n;const o=new Map;return{...n,components:Ye.entries(n.components).map(([a,l])=>{const u=a,{resolvedName:c}=l.type;if(c==="WebformLoader"){const d=yi.generate();o.set(a,d),a=d}return[a,l,u]}).reduce((a,[l,u,c])=>{var d;return u.nodes&&(u.nodes=u.nodes.map(p=>o.get(p)||p)),u.linkedNodes&&(u.linkedNodes=Ye.entries(u.linkedNodes).reduce((p,[h,g])=>({...p,[h]:o.get(g)||g}),{})),(d=u.props)!=null&&d.events&&(u.props.events=u.props.events.map(p=>(p.type==="navigation"&&p.loader&&(p.loader=o.get(p.loader)||p.loader),p))),{...a,[l]:{...u,props:{...u.props,__originalID:c}}}},{})}})}function Zj(e){return qe(yt,{method:"POST",headers:new Headers({"Content-Type":"application/json"}),body:JSON.stringify(e)}).then(t=>({...t,content:[Ot.METHOD,Ot.CLASS].includes(t.type)?hu(t.content):t.content}))}function Kj(e){return e.type==="folder"?qe(Fa,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})}):qe(yt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}async function Yj(e){return e.type==="folder"?(await qe(Fa,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})).deleted:(await qe(yt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})).deleted}function Xj(e){return qe(yt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function Jj(e){return qe(yt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}async function Qj(e){return(await qe(yt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})).deleted}async function eF(...e){return await qe(yt,{method:"POST",body:JSON.stringify({verb:Kn.GET_FILES_INFO,files:e}),headers:new Headers({"Content-Type":"application/json"})})}async function tF(e){const t=await qe("/api/login",{method:"POST",body:JSON.stringify({accessKey:e}),headers:new Headers({"Content-Type":"application/json"})});return t.isLogged&&t.success}async function rF(){return await qe("/rest/$catalog/$all?$metadata=full",{method:"GET",headers:new Headers({"Content-Type":"application/json"})})}async function nF(e){try{const t=process.env.NODE_ENV==="development"?"/i18n/languages.json":`/$lib/${e?"studio":"renderer"}/i18n/languages.json`,n=await(await fetch(t)).text(),{supported:o}=JSON.parse(n);return o}catch{return[]}}async function iF({name:e,path:t="",root:r="root",asText:n=!1}){return qe(yt,{method:"POST",body:JSON.stringify({verb:"getFileContent",root:r,path:t,name:e,asText:n}),headers:new Headers({"Content-Type":"application/json"})})}async function oF(e={}){try{return await Ha({path:"shared_datasources.json",...e})}catch{return{}}}async function aF(e={}){try{return await Ha({path:"shared_app_events.json",...e})}catch{return[]}}async function sF(e={}){try{return await Ha({path:"shared_css.json",...e})}catch{return{classes:[]}}}async function lF(e={}){try{return await Ha({path:"saved_conditions.json",...e})}catch{return{conditions:[]}}}async function uF(){try{return await qe("/rest/$info/privileges",{method:"GET",headers:new Headers({"Content-Type":"application/json"})})}catch{return{privileges:[]}}}async function cF(){try{return await(await fetch(`monaco_theme.json?t=${Date.now()}`)).json()}catch{return null}}const fF=kp(),dF=async e=>{const t={verb:Kn.SET_FILE_CONTENT,asText:!1,name:"shared_datasources.json",path:"",root:"shared",content:e};return fF(async()=>(await qe(yt,{method:"POST",body:JSON.stringify(t),headers:new Headers({"Content-Type":"application/json"})}),e))},pF=kp(),hF=async e=>{const t={verb:Kn.SET_FILE_CONTENT,asText:!1,name:"shared_app_events.json",path:"",root:"shared",content:e};return pF(async()=>(await qe(yt,{method:"POST",body:JSON.stringify(t),headers:new Headers({"Content-Type":"application/json"})}),e))},Pp=async e=>{const t=await qe(yt,{method:"POST",body:JSON.stringify({...e,verb:Kn.SET_FILE_CONTENT,root:Sp.ROOT}),headers:new Headers({"Content-Type":"application/json"})}),r=Ep(`${e.path||"Sources"}/${e.name}`);return{...t,type:r,size:0}},gF=async e=>await Pp({name:"crafted_components.json",path:Un.WEBFORMS,content:e});function vF(e){return qe(yt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function mF(e){return qe(yt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function bF(e){return qe(yt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function yF(e){return qe(yt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})}).then(t=>Array.isArray(t)?t:{...t,content:["4dm","4qm","4qs"].includes(t.ext)?hu(t.content):t.content}).catch(t=>{var r,n;throw((n=(r=t.data)==null?void 0:r.__ERROR[0])==null?void 0:n.errCode)===1839&&mu(e.path),t})}function wF(e){return qe(yt,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function xF(e){const t=new RegExp(/^\((.+)(?=\))/gi).exec(e);return t!==null?t[1]:""}function SF(e){const t=new RegExp(/(->)(.*)/gi).exec(e);if(t!==null)return t[0].replace("->","");const r=/:([^)]*)$/.exec(e);return r!==null?`result : ${r[1].trim()}`:""}function _F(e){const t=xF(e).split(/[;,]/g).filter(Boolean).map(o=>{const a=o.split(":")[0].trim(),l=o.split(":")[1].trim();return{name:a,type:l}}),r=SF(e),n=r?{name:r.split(":")[0].trim(),type:r.split(":")[1].trim()}:{name:"result",type:"Variable"};return{params:t,result:n}}async function EF(e,t){const n=e.split(".").pop();try{const o=await qe(yt,{method:"POST",body:JSON.stringify({verb:"getFunctionContent",className:t,functionName:n}),headers:new Headers({"Content-Type":"application/json"})});o.content=hu(o.content);const{params:a,result:l}=_F(o.parameters);return{...o,params:a,returns:l}}catch(o){return console.error(o),{className:t,functionName:n,filePath:e,content:"",params:[]}}}var $1=(e=>(e.STUDIO_LOADED="UA-1-0",e.WELCOME_TOUR_INIT="UA-1-3",e.WELCOME_TOUR_END="UA-1-4",e))($1||{});function kF(e,t){fetch("/api/v1/activity",{body:JSON.stringify({AID:e,...t}),headers:{"Content-Type":"application/json"},method:"POST"}).catch(r=>{})}function OF(e){window.pagesense=window.pagesense||[],window.pagesense.push(["trackEvent",e])}var L1=(e=>(e.LOCAL="local",e.SHARED="shared",e.THEME="theme",e))(L1||{}),z1=(e=>(e[e.METHOD=1]="METHOD",e[e.CLASS=10]="CLASS",e))(z1||{}),j1=(e=>(e.WelCome="WelCome",e.ActionPanel="ActionPanel",e.SideBar="SideBar",e.Settings="Settings",e.Main="Main",e.Explorer="Explorer",e.Header="Header",e.ComponentList="ComponentList",e))(j1||{}),F1=(e=>(e[e.FILE_NOT_FOUND=1839]="FILE_NOT_FOUND",e[e.JSON_MALFORMED=554]="JSON_MALFORMED",e[e.JSON_MALFORMED_AT_LINE=550]="JSON_MALFORMED_AT_LINE",e))(F1||{});const AF={transparent:{backgroundColor:"transparent"},black:{backgroundColor:"#4a4a4a",color:"white",padding:"3px 5px",borderRadius:5},grey:{backgroundColor:"#e8e8e8",color:"#262626",padding:"3px 5px",borderRadius:5}},TF={Code:{key:"editors:code",config:{language:"4d",theme:"fd-dark"}},WebForm:{key:"editors:webforms"}};exports.API_PREFIX=yt;exports.AppLoader=JM;exports.BaseCheckboxIcon=Px;exports.Checkbox=A5;exports.ControlledSwitch=cw;exports.DATASOURCE_THEMES=AF;exports.DatasourcesActions=Gx;exports.DebuggerActions=Xx;exports.DefaultCheckboxIcon=Ix;exports.DesignerRequestVerb=Kn;exports.Dialog=NC;exports.DialogBody=Q0;exports.EActivity=$1;exports.EDITOR=TF;exports.EIDENTIFIERS=j1;exports.EPermissionType=Ve;exports.ERROR_CODES=F1;exports.ESubPermissionType=nt;exports.EWebFormStyleClassScope=L1;exports.EXT_API_PREFIX=Fa;exports.FileFolderType=Ot;exports.FloatingTooltip=k5;exports.FolderRootPath=Un;exports.FolderRootType=Sp;exports.HTTPError=xd;exports.HTTP_HANDLERS_TAB_PATH=e1;exports.IPreemptive=Ra;exports.IPublished=c1;exports.IPublishedRestScope=Op;exports.IdentityProvider=q5;exports.Incase=gl;exports.IndentLines=py;exports.LOCALIZATION_TAB_PATH=t1;exports.LogoSVG=Ew;exports.LspActions=Yx;exports.MAX_FILE_NAME_LENGTH=wp;exports.MODEL_TAB_PATH=Mz;exports.Modal=rD;exports.ModalCloseReason=Zi;exports.ModalColor=mi;exports.ModalIcons=sd;exports.ModalType=tp;exports.Mutex=r1;exports.NameError=xp;exports.Overlay=J0;exports.PANEL_EXPANDED_HEIGHT=El;exports.PANEL_INITIAL_HEIGHT=ci;exports.PERMISSIONS=Ap;exports.Panel=O5;exports.Portal=F0;exports.PublishOptions=a3;exports.ROLES_TAB_PATH=Jx;exports.RemoteDebuggerMode=_p;exports.SETTINGS_TAB_PATH=Qx;exports.SHARED_API_PREFIX=Ca;exports.SourceCodeDescriptor=z1;exports.Switcher=hy;exports.TabEventsActions=Kx;exports.Tip=Jy;exports.TipsProvider=a2;exports.Toast=FP;exports.Tooltip=YM;exports.Tree=iI;exports.TreeIcon=uy;exports.TreeNode=Nd;exports.WebformActions=qx;exports.WebformEventsActions=Ta;exports.ZoomComponent=f5;exports.ZoomLevel=Rx;exports._isArrayDatasource=t3;exports._isObjectDatasource=r3;exports.actionsToPrivs=v1;exports.addAttributesToContent=l3;exports.addFolder=Xj;exports.addPermission=S3;exports.addPrivilegeIn=h3;exports.allowed=d3;exports.by=n1;exports.byId=Fz;exports.byPath=Hz;exports.callServerSideParser=I3;exports.checkUpdates=Bj;exports.children=Vl;exports.createFolder=vF;exports.createPrivilege=v3;exports.createRole=T3;exports.datasourcesSubject=Ez;exports.debuggerSubject=Tz;exports.dropFile=Yj;exports.dropFolder=Qj;exports.exists=Wz;exports.extractWebformName=Lz;exports.generateUUID=u3;exports.getAppSettings=Vj;exports.getCatalog=rF;exports.getDatasourceId=Bz;exports.getDefaultAppSettings=M1;exports.getDictByName=b1;exports.getFile=Zj;exports.getFileContent=iF;exports.getFileExtentionFromType=$z;exports.getFilenameAndTypeFromPath=Dz;exports.getFilesInfo=eF;exports.getFolder=D1;exports.getFolders=qj;exports.getFunctionContent=EF;exports.getGraphData=x3;exports.getInheritedResources=y1;exports.getMonacoTheme=cF;exports.getNodeInfo=yF;exports.getPrivilegeById=wn;exports.getPromotions=A3;exports.getResourceFromType=Tp;exports.getSavedConditions=lF;exports.getSharedAppEvents=aF;exports.getSharedCSS=sF;exports.getSharedDatasources=oF;exports.getSharedResource=Ha;exports.getSupportedLanguages=nF;exports.getTypeFromExtension=Ep;exports.getUserPrivileges=uF;exports.getWebForm=Gj;exports.hasAttributesString=d1;exports.http=qe;exports.i18nSubject=Cz;exports.initializeDefaultProjectFiles=Hj;exports.installUpdates=Uj;exports.isArrayDatasource=s1;exports.isDataClassMethod=Gz;exports.isDataStoreMethod=qz;exports.isDateDatasource=n3;exports.isEntity=Qz;exports.isEntityDatasource=Yz;exports.isEntityMethod=Zz;exports.isEntitySelection=e3;exports.isEntitySelectionDatasource=Xz;exports.isEntitySelectionMethod=Kz;exports.isObjectAttribute=Uz;exports.isObjectDatasource=l1;exports.isRelatedAttribute=Vz;exports.isRelatedEntitiesAttribute=o1;exports.isRelatedEntityAttribute=a1;exports.isScalarDatasource=u1;exports.isSimpleAttribute=i1;exports.isSimpleDatasource=Jz;exports.loadDS=i3;exports.loadI18n=o3;exports.log=kF;exports.login=tF;exports.lspSubject=Az;exports.moveItem=bF;exports.outBy=zz;exports.outById=jz;exports.parents=gu;exports.parseAttributes=s3;exports.populateShallow=b3;exports.queue=kp;exports.removeAttributesString=p1;exports.removeItem=mF;exports.removeMultiplePermissions=E3;exports.removePermission=_3;exports.removePrivilege=p3;exports.removePrivilegeFrom=g3;exports.removeRole=R3;exports.renameFile=Kj;exports.renameFolder=Jj;exports.renamePrivilege=m3;exports.resetResources=k3;exports.rolesToAPI=w3;exports.sanitizeContent=hu;exports.sanitizeNameCY=c3;exports.sanitizePermissions=m1;exports.sanitizePrivileges=h1;exports.sanitizeRoles=y3;exports.saveContent=wF;exports.saveRole=C3;exports.setCraftedComponents=gF;exports.setFileContent=Pp;exports.setSharedAppEvents=hF;exports.setSharedSources=dF;exports.sortPrivileges=g1;exports.stringifyAttributes=f1;exports.tabEventsSubject=Oz;exports.tasksManagerSubject=Rz;exports.toastSubject=Zx;exports.togglePermission=O3;exports.trackEvent=OF;exports.transformDates=P3;exports.tryCreateSharedResource=mu;exports.uniquePush=Or;exports.useDidMountEffect=T5;exports.useDoubleClick=Y5;exports.useEnhancedState=fz;exports.useFeatureFlags=V5;exports.useForwardedRef=U5;exports.useHotkeys=F5;exports.useIdentity=G5;exports.useOutsideClick=H5;exports.usePrevious=W5;exports.useStateObject=Z5;exports.useStateRef=B5;exports.useTip=Xy;exports.validateName=pu;exports.validateServerSide=Pz;exports.validateValue=Iz;exports.webformEventsSubject=Bl;exports.webformSubject=kz;
256
256
  //# sourceMappingURL=index.cjs.js.map