@ws-ui/shared 0.3.11 → 0.3.12

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
@@ -203,5 +203,5 @@ function print() { __p += __j.call(arguments, '') }
203
203
  ${a}`}function Vg(e){return/^\/\/%attributes.*(?:\r\n|\n)?/g.test(e)}function Xg(e){return e.replace(/^\/\/%attributes.*(?:\r\n|\n)?/g,"")}const dI=()=>Kc.uuid().replaceAll("-","").toUpperCase(),Ot="/rest/$designer",fa="/rest/$designer-ext";function pI(...e){return t=>{if(e.length===0)return t;const r={...t};return e.forEach(i=>{typeof r[i]=="string"&&(r[i]=new Date(r[i]))}),r}}class Ic extends Error{constructor(t,r,i){super(),this.url=t,this.response=r,this.data=i}log(){console.error("Error while sending the request",this)}}async function Ye(e,t){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 s=await r.json();a=new Ic(e,r,s)}catch{a=new Ic(e,r)}throw a.log(),a}return await r.json()}var dt={},Mc=dt.ValidationError=function(t,r,i,a,s,l){if(Array.isArray(a)?(this.path=a,this.property=a.reduce(function(d,p){return d+Jg(p)},"instance")):a!==void 0&&(this.property=a),t&&(this.message=t),i){var c=i.$id||i.id;this.schema=c||i}r!==void 0&&(this.instance=r),this.name=s,this.argument=l,this.stack=this.toString()};Mc.prototype.toString=function(){return this.property+" "+this.message};var nu=dt.ValidatorResult=function(t,r,i,a){this.instance=t,this.schema=r,this.options=i,this.path=a.path,this.propertyPath=a.propertyPath,this.errors=[],this.throwError=i&&i.throwError,this.throwFirst=i&&i.throwFirst,this.throwAll=i&&i.throwAll,this.disableFormat=i&&i.disableFormat===!0};nu.prototype.addError=function(t){var r;if(typeof t=="string")r=new Mc(t,this.instance,this.schema,this.path);else{if(!t)throw new Error("Missing error detail");if(!t.message)throw new Error("Missing error message");if(!t.name)throw new Error("Missing validator type");r=new Mc(t.message,this.instance,this.schema,this.path,t.name,t.argument)}if(this.errors.push(r),this.throwFirst)throw new Ai(this);if(this.throwError)throw r;return r};nu.prototype.importErrors=function(t){typeof t=="string"||t&&t.validatorType?this.addError(t):t&&t.errors&&(this.errors=this.errors.concat(t.errors))};function hI(e,t){return t+": "+e.toString()+`
204
204
  `}nu.prototype.toString=function(t){return this.errors.map(hI).join("")};Object.defineProperty(nu.prototype,"valid",{get:function(){return!this.errors.length}});dt.ValidatorResultError=Ai;function Ai(e){typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Ai),this.instance=e.instance,this.schema=e.schema,this.options=e.options,this.errors=e.errors}Ai.prototype=new Error;Ai.prototype.constructor=Ai;Ai.prototype.name="Validation Error";var Ov=dt.SchemaError=function e(t,r){this.message=t,this.schema=r,Error.call(this,t),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,e)};Ov.prototype=Object.create(Error.prototype,{constructor:{value:Ov,enumerable:!1},name:{value:"SchemaError",enumerable:!1}});var Fc=dt.SchemaContext=function(t,r,i,a,s){this.schema=t,this.options=r,Array.isArray(i)?(this.path=i,this.propertyPath=i.reduce(function(l,c){return l+Jg(c)},"instance")):this.propertyPath=i,this.base=a,this.schemas=s};Fc.prototype.resolve=function(t){return(()=>Qg(this.base,t))()};Fc.prototype.makeChild=function(t,r){var i=r===void 0?this.path:this.path.concat([r]),a=t.$id||t.id;let s=(()=>Qg(this.base,a||""))();var l=new Fc(t,this.options,i,s,Object.create(this.schemas));return a&&!l.schemas[s]&&(l.schemas[s]=t),l};var qr=dt.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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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(e){return typeof e=="string"&&parseFloat(e)===parseInt(e,10)&&!isNaN(e)},regex:function(e){var t=!0;try{new RegExp(e)}catch{t=!1}return t},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]+$/};qr.regexp=qr.regex;qr.pattern=qr.regex;qr.ipv4=qr["ip-address"];dt.isFormat=function(t,r,i){if(typeof t=="string"&&qr[r]!==void 0){if(qr[r]instanceof RegExp)return qr[r].test(t);if(typeof qr[r]=="function")return qr[r](t)}else if(i&&i.customFormats&&typeof i.customFormats[r]=="function")return i.customFormats[r](t);return!0};var Jg=dt.makeSuffix=function(t){return t=t.toString(),!t.match(/[.\s\[\]]/)&&!t.match(/^[\d]/)?"."+t:t.match(/^\d+$/)?"["+t+"]":"["+JSON.stringify(t)+"]"};dt.deepCompareStrict=function e(t,r){if(typeof t!=typeof r)return!1;if(Array.isArray(t))return!Array.isArray(r)||t.length!==r.length?!1:t.every(function(s,l){return e(t[l],r[l])});if(typeof t=="object"){if(!t||!r)return t===r;var i=Object.keys(t),a=Object.keys(r);return i.length!==a.length?!1:i.every(function(s){return e(t[s],r[s])})}return t===r};function vI(e,t,r,i){typeof r=="object"?t[i]=vf(e[i],r):e.indexOf(r)===-1&&t.push(r)}function mI(e,t,r){t[r]=e[r]}function gI(e,t,r,i){typeof t[i]!="object"||!t[i]?r[i]=t[i]:e[i]?r[i]=vf(e[i],t[i]):r[i]=t[i]}function vf(e,t){var r=Array.isArray(t),i=r&&[]||{};return r?(e=e||[],i=i.concat(e),t.forEach(vI.bind(null,e,i))):(e&&typeof e=="object"&&Object.keys(e).forEach(mI.bind(null,e,i)),Object.keys(t).forEach(gI.bind(null,e,t,i))),i}dt.deepMerge=vf;dt.objectGetPath=function(t,r){for(var i=r.split("/").slice(1),a;typeof(a=i.shift())=="string";){var s=decodeURIComponent(a.replace(/~0/,"~").replace(/~1/g,"/"));if(!(s in t))return;t=t[s]}return t};function yI(e){return"/"+encodeURIComponent(e).replace(/~/g,"%7E")}dt.encodePath=function(t){return t.map(yI).join("")};dt.getDecimalPlaces=function(t){var r=0;if(isNaN(t))return r;typeof t!="number"&&(t=Number(t));var i=t.toString().split("e");if(i.length===2){if(i[1][0]!=="-")return r;r=Number(i[1].slice(1))}var a=i[0].split(".");return a.length===2&&(r+=a[1].length),r};dt.isSchema=function(t){return typeof t=="object"&&t||typeof t=="boolean"};var Qg=dt.resolveUrl=function(t,r){const i=new URL(r,new URL(t,"resolve://"));if(i.protocol==="resolve:"){const{pathname:a,search:s,hash:l}=i;return a+s+l}return i.toString()},mr=dt,We=mr.ValidatorResult,Zn=mr.SchemaError,mf={};mf.ignoreProperties={id:!0,default:!0,description:!0,title:!0,additionalItems:!0,then:!0,else:!0,$schema:!0,$ref:!0,extends:!0};var Ue=mf.validators={};Ue.type=function(t,r,i,a){if(t===void 0)return null;var s=new We(t,r,i,a),l=Array.isArray(r.type)?r.type:[r.type];if(!l.some(this.testType.bind(this,t,r,i,a))){var c=l.map(function(d){if(d){var p=d.$id||d.id;return p?"<"+p+">":d+""}});s.addError({name:"type",argument:c,message:"is not of a type(s) "+c})}return s};function gf(e,t,r,i,a){var s=t.throwError,l=t.throwAll;t.throwError=!1,t.throwAll=!1;var c=this.validateSchema(e,a,t,r);return t.throwError=s,t.throwAll=l,!c.valid&&i instanceof Function&&i(c),c.valid}Ue.anyOf=function(t,r,i,a){if(t===void 0)return null;var s=new We(t,r,i,a),l=new We(t,r,i,a);if(!Array.isArray(r.anyOf))throw new Zn("anyOf must be an array");if(!r.anyOf.some(gf.bind(this,t,i,a,function(d){l.importErrors(d)}))){var c=r.anyOf.map(function(d,p){var h=d.$id||d.id;return h?"<"+h+">":d.title&&JSON.stringify(d.title)||d.$ref&&"<"+d.$ref+">"||"[subschema "+p+"]"});i.nestedErrors&&s.importErrors(l),s.addError({name:"anyOf",argument:c,message:"is not any of "+c.join(",")})}return s};Ue.allOf=function(t,r,i,a){if(t===void 0)return null;if(!Array.isArray(r.allOf))throw new Zn("allOf must be an array");var s=new We(t,r,i,a),l=this;return r.allOf.forEach(function(c,d){var p=l.validateSchema(t,c,i,a);if(!p.valid){var h=c.$id||c.id,w=h||c.title&&JSON.stringify(c.title)||c.$ref&&"<"+c.$ref+">"||"[subschema "+d+"]";s.addError({name:"allOf",argument:{id:w,length:p.errors.length,valid:p},message:"does not match allOf schema "+w+" with "+p.errors.length+" error[s]:"}),s.importErrors(p)}}),s};Ue.oneOf=function(t,r,i,a){if(t===void 0)return null;if(!Array.isArray(r.oneOf))throw new Zn("oneOf must be an array");var s=new We(t,r,i,a),l=new We(t,r,i,a),c=r.oneOf.filter(gf.bind(this,t,i,a,function(p){l.importErrors(p)})).length,d=r.oneOf.map(function(p,h){var w=p.$id||p.id;return w||p.title&&JSON.stringify(p.title)||p.$ref&&"<"+p.$ref+">"||"[subschema "+h+"]"});return c!==1&&(i.nestedErrors&&s.importErrors(l),s.addError({name:"oneOf",argument:d,message:"is not exactly one from "+d.join(",")})),s};Ue.if=function(t,r,i,a){if(t===void 0)return null;if(!mr.isSchema(r.if))throw new Error('Expected "if" keyword to be a schema');var s=gf.call(this,t,i,a,null,r.if),l=new We(t,r,i,a),c;if(s){if(r.then===void 0)return;if(!mr.isSchema(r.then))throw new Error('Expected "then" keyword to be a schema');c=this.validateSchema(t,r.then,i,a.makeChild(r.then)),l.importErrors(c)}else{if(r.else===void 0)return;if(!mr.isSchema(r.else))throw new Error('Expected "else" keyword to be a schema');c=this.validateSchema(t,r.else,i,a.makeChild(r.else)),l.importErrors(c)}return l};function yf(e,t){if(Object.hasOwnProperty.call(e,t))return e[t];if(t in e){for(;e=Object.getPrototypeOf(e);)if(Object.propertyIsEnumerable.call(e,t))return e[t]}}Ue.propertyNames=function(t,r,i,a){if(this.types.object(t)){var s=new We(t,r,i,a),l=r.propertyNames!==void 0?r.propertyNames:{};if(!mr.isSchema(l))throw new Zn('Expected "propertyNames" to be a schema (object or boolean)');for(var c in t)if(yf(t,c)!==void 0){var d=this.validateSchema(c,l,i,a.makeChild(l));s.importErrors(d)}return s}};Ue.properties=function(t,r,i,a){if(this.types.object(t)){var s=new We(t,r,i,a),l=r.properties||{};for(var c in l){var d=l[c];if(d!==void 0){if(d===null)throw new Zn('Unexpected null, expected schema in "properties"');typeof i.preValidateProperty=="function"&&i.preValidateProperty(t,c,d,i,a);var p=yf(t,c),h=this.validateSchema(p,d,i,a.makeChild(d,c));h.instance!==s.instance[c]&&(s.instance[c]=h.instance),s.importErrors(h)}}return s}};function e0(e,t,r,i,a,s){if(this.types.object(e)&&!(t.properties&&t.properties[a]!==void 0))if(t.additionalProperties===!1)s.addError({name:"additionalProperties",argument:a,message:"is not allowed to have the additional property "+JSON.stringify(a)});else{var l=t.additionalProperties||{};typeof r.preValidateProperty=="function"&&r.preValidateProperty(e,a,l,r,i);var c=this.validateSchema(e[a],l,r,i.makeChild(l,a));c.instance!==s.instance[a]&&(s.instance[a]=c.instance),s.importErrors(c)}}Ue.patternProperties=function(t,r,i,a){if(this.types.object(t)){var s=new We(t,r,i,a),l=r.patternProperties||{};for(var c in t){var d=!0;for(var p in l){var h=l[p];if(h!==void 0){if(h===null)throw new Zn('Unexpected null, expected schema in "patternProperties"');try{var w=new RegExp(p,"u")}catch{w=new RegExp(p)}if(w.test(c)){d=!1,typeof i.preValidateProperty=="function"&&i.preValidateProperty(t,c,h,i,a);var S=this.validateSchema(t[c],h,i,a.makeChild(h,c));S.instance!==s.instance[c]&&(s.instance[c]=S.instance),s.importErrors(S)}}}d&&e0.call(this,t,r,i,a,c,s)}return s}};Ue.additionalProperties=function(t,r,i,a){if(this.types.object(t)){if(r.patternProperties)return null;var s=new We(t,r,i,a);for(var l in t)e0.call(this,t,r,i,a,l,s);return s}};Ue.minProperties=function(t,r,i,a){if(this.types.object(t)){var s=new We(t,r,i,a),l=Object.keys(t);return l.length>=r.minProperties||s.addError({name:"minProperties",argument:r.minProperties,message:"does not meet minimum property length of "+r.minProperties}),s}};Ue.maxProperties=function(t,r,i,a){if(this.types.object(t)){var s=new We(t,r,i,a),l=Object.keys(t);return l.length<=r.maxProperties||s.addError({name:"maxProperties",argument:r.maxProperties,message:"does not meet maximum property length of "+r.maxProperties}),s}};Ue.items=function(t,r,i,a){var s=this;if(this.types.array(t)&&r.items!==void 0){var l=new We(t,r,i,a);return t.every(function(c,d){if(Array.isArray(r.items))var p=r.items[d]===void 0?r.additionalItems:r.items[d];else var p=r.items;if(p===void 0)return!0;if(p===!1)return l.addError({name:"items",message:"additionalItems not permitted"}),!1;var h=s.validateSchema(c,p,i,a.makeChild(p,d));return h.instance!==l.instance[d]&&(l.instance[d]=h.instance),l.importErrors(h),!0}),l}};Ue.contains=function(t,r,i,a){var s=this;if(this.types.array(t)&&r.contains!==void 0){if(!mr.isSchema(r.contains))throw new Error('Expected "contains" keyword to be a schema');var l=new We(t,r,i,a),c=t.some(function(d,p){var h=s.validateSchema(d,r.contains,i,a.makeChild(r.contains,p));return h.errors.length===0});return c===!1&&l.addError({name:"contains",argument:r.contains,message:"must contain an item matching given schema"}),l}};Ue.minimum=function(t,r,i,a){if(this.types.number(t)){var s=new We(t,r,i,a);return r.exclusiveMinimum&&r.exclusiveMinimum===!0?t>r.minimum||s.addError({name:"minimum",argument:r.minimum,message:"must be greater than "+r.minimum}):t>=r.minimum||s.addError({name:"minimum",argument:r.minimum,message:"must be greater than or equal to "+r.minimum}),s}};Ue.maximum=function(t,r,i,a){if(this.types.number(t)){var s=new We(t,r,i,a);return r.exclusiveMaximum&&r.exclusiveMaximum===!0?t<r.maximum||s.addError({name:"maximum",argument:r.maximum,message:"must be less than "+r.maximum}):t<=r.maximum||s.addError({name:"maximum",argument:r.maximum,message:"must be less than or equal to "+r.maximum}),s}};Ue.exclusiveMinimum=function(t,r,i,a){if(typeof r.exclusiveMinimum!="boolean"&&this.types.number(t)){var s=new We(t,r,i,a),l=t>r.exclusiveMinimum;return l||s.addError({name:"exclusiveMinimum",argument:r.exclusiveMinimum,message:"must be strictly greater than "+r.exclusiveMinimum}),s}};Ue.exclusiveMaximum=function(t,r,i,a){if(typeof r.exclusiveMaximum!="boolean"&&this.types.number(t)){var s=new We(t,r,i,a),l=t<r.exclusiveMaximum;return l||s.addError({name:"exclusiveMaximum",argument:r.exclusiveMaximum,message:"must be strictly less than "+r.exclusiveMaximum}),s}};var t0=function(t,r,i,a,s,l){if(this.types.number(t)){var c=r[s];if(c==0)throw new Zn(s+" cannot be zero");var d=new We(t,r,i,a),p=mr.getDecimalPlaces(t),h=mr.getDecimalPlaces(c),w=Math.max(p,h),S=Math.pow(10,w);return Math.round(t*S)%Math.round(c*S)!==0&&d.addError({name:s,argument:c,message:l+JSON.stringify(c)}),d}};Ue.multipleOf=function(t,r,i,a){return t0.call(this,t,r,i,a,"multipleOf","is not a multiple of (divisible by) ")};Ue.divisibleBy=function(t,r,i,a){return t0.call(this,t,r,i,a,"divisibleBy","is not divisible by (multiple of) ")};Ue.required=function(t,r,i,a){var s=new We(t,r,i,a);return t===void 0&&r.required===!0?s.addError({name:"required",message:"is required"}):this.types.object(t)&&Array.isArray(r.required)&&r.required.forEach(function(l){yf(t,l)===void 0&&s.addError({name:"required",argument:l,message:"requires property "+JSON.stringify(l)})}),s};Ue.pattern=function(t,r,i,a){if(this.types.string(t)){var s=new We(t,r,i,a),l=r.pattern;try{var c=new RegExp(l,"u")}catch{c=new RegExp(l)}return t.match(c)||s.addError({name:"pattern",argument:r.pattern,message:"does not match pattern "+JSON.stringify(r.pattern.toString())}),s}};Ue.format=function(t,r,i,a){if(t!==void 0){var s=new We(t,r,i,a);return!s.disableFormat&&!mr.isFormat(t,r.format,this)&&s.addError({name:"format",argument:r.format,message:"does not conform to the "+JSON.stringify(r.format)+" format"}),s}};Ue.minLength=function(t,r,i,a){if(this.types.string(t)){var s=new We(t,r,i,a),l=t.match(/[\uDC00-\uDFFF]/g),c=t.length-(l?l.length:0);return c>=r.minLength||s.addError({name:"minLength",argument:r.minLength,message:"does not meet minimum length of "+r.minLength}),s}};Ue.maxLength=function(t,r,i,a){if(this.types.string(t)){var s=new We(t,r,i,a),l=t.match(/[\uDC00-\uDFFF]/g),c=t.length-(l?l.length:0);return c<=r.maxLength||s.addError({name:"maxLength",argument:r.maxLength,message:"does not meet maximum length of "+r.maxLength}),s}};Ue.minItems=function(t,r,i,a){if(this.types.array(t)){var s=new We(t,r,i,a);return t.length>=r.minItems||s.addError({name:"minItems",argument:r.minItems,message:"does not meet minimum length of "+r.minItems}),s}};Ue.maxItems=function(t,r,i,a){if(this.types.array(t)){var s=new We(t,r,i,a);return t.length<=r.maxItems||s.addError({name:"maxItems",argument:r.maxItems,message:"does not meet maximum length of "+r.maxItems}),s}};function wI(e,t,r){var i,a=r.length;for(i=t+1,a;i<a;i++)if(mr.deepCompareStrict(e,r[i]))return!1;return!0}Ue.uniqueItems=function(t,r,i,a){if(r.uniqueItems===!0&&this.types.array(t)){var s=new We(t,r,i,a);return t.every(wI)||s.addError({name:"uniqueItems",message:"contains duplicate item"}),s}};Ue.dependencies=function(t,r,i,a){if(this.types.object(t)){var s=new We(t,r,i,a);for(var l in r.dependencies)if(t[l]!==void 0){var c=r.dependencies[l],d=a.makeChild(c,l);if(typeof c=="string"&&(c=[c]),Array.isArray(c))c.forEach(function(h){t[h]===void 0&&s.addError({name:"dependencies",argument:d.propertyPath,message:"property "+h+" not found, required by "+d.propertyPath})});else{var p=this.validateSchema(t,c,i,d);s.instance!==p.instance&&(s.instance=p.instance),p&&p.errors.length&&(s.addError({name:"dependencies",argument:d.propertyPath,message:"does not meet dependency required by "+d.propertyPath}),s.importErrors(p))}}return s}};Ue.enum=function(t,r,i,a){if(t===void 0)return null;if(!Array.isArray(r.enum))throw new Zn("enum expects an array",r);var s=new We(t,r,i,a);return r.enum.some(mr.deepCompareStrict.bind(null,t))||s.addError({name:"enum",argument:r.enum,message:"is not one of enum values: "+r.enum.map(String).join(",")}),s};Ue.const=function(t,r,i,a){if(t===void 0)return null;var s=new We(t,r,i,a);return mr.deepCompareStrict(r.const,t)||s.addError({name:"const",argument:r.const,message:"does not exactly match expected constant: "+r.const}),s};Ue.not=Ue.disallow=function(t,r,i,a){var s=this;if(t===void 0)return null;var l=new We(t,r,i,a),c=r.not||r.disallow;return c?(Array.isArray(c)||(c=[c]),c.forEach(function(d){if(s.testType(t,r,i,a,d)){var p=d&&(d.$id||d.id),h=p||d;l.addError({name:"not",argument:h,message:"is of prohibited type "+h})}}),l):null};var bI=mf,wf={},ic=dt;wf.SchemaScanResult=r0;function r0(e,t){this.id=e,this.ref=t}wf.scan=function(t,r){function i(d,p){if(!p||typeof p!="object")return;if(p.$ref){let v=ic.resolveUrl(d,p.$ref);c[v]=c[v]?c[v]+1:0;return}var h=p.$id||p.id;let w=ic.resolveUrl(d,h);var S=h?w:d;if(S){if(S.indexOf("#")<0&&(S+="#"),l[S]){if(!ic.deepCompareStrict(l[S],p))throw new Error("Schema <"+S+"> already exists with different definition");return l[S]}l[S]=p,S[S.length-1]=="#"&&(l[S.substring(0,S.length-1)]=p)}a(S+"/items",Array.isArray(p.items)?p.items:[p.items]),a(S+"/extends",Array.isArray(p.extends)?p.extends:[p.extends]),i(S+"/additionalItems",p.additionalItems),s(S+"/properties",p.properties),i(S+"/additionalProperties",p.additionalProperties),s(S+"/definitions",p.definitions),s(S+"/patternProperties",p.patternProperties),s(S+"/dependencies",p.dependencies),a(S+"/disallow",p.disallow),a(S+"/allOf",p.allOf),a(S+"/anyOf",p.anyOf),a(S+"/oneOf",p.oneOf),i(S+"/not",p.not)}function a(d,p){if(Array.isArray(p))for(var h=0;h<p.length;h++)i(d+"/"+h,p[h])}function s(d,p){if(!(!p||typeof p!="object"))for(var h in p)i(d+"/"+h,p[h])}var l={},c={};return i(t,r),new r0(l,c)};var n0=bI,Gn=dt,i0=wf.scan,o0=Gn.ValidatorResult,SI=Gn.ValidatorResultError,Vo=Gn.SchemaError,a0=Gn.SchemaContext,EI="/",Pt=function e(){this.customFormats=Object.create(e.prototype.customFormats),this.schemas={},this.unresolvedRefs=[],this.types=Object.create(sn),this.attributes=Object.create(n0.validators)};Pt.prototype.customFormats={};Pt.prototype.schemas=null;Pt.prototype.types=null;Pt.prototype.attributes=null;Pt.prototype.unresolvedRefs=null;Pt.prototype.addSchema=function(t,r){var i=this;if(!t)return null;var a=i0(r||EI,t),s=r||t.$id||t.id;for(var l in a.id)this.schemas[l]=a.id[l];for(var l in a.ref)this.unresolvedRefs.push(l);return this.unresolvedRefs=this.unresolvedRefs.filter(function(c){return typeof i.schemas[c]>"u"}),this.schemas[s]};Pt.prototype.addSubSchemaArray=function(t,r){if(Array.isArray(r))for(var i=0;i<r.length;i++)this.addSubSchema(t,r[i])};Pt.prototype.addSubSchemaObject=function(t,r){if(!(!r||typeof r!="object"))for(var i in r)this.addSubSchema(t,r[i])};Pt.prototype.setSchemas=function(t){this.schemas=t};Pt.prototype.getSchema=function(t){return this.schemas[t]};Pt.prototype.validate=function(t,r,i,a){if(typeof r!="boolean"&&typeof r!="object"||r===null)throw new Vo("Expected `schema` to be an object or boolean");i||(i={});var s=r.$id||r.id;let l=Gn.resolveUrl(i.base,s||"");if(!a){a=new a0(r,i,[],l,Object.create(this.schemas)),a.schemas[l]||(a.schemas[l]=r);var c=i0(l,r);for(var d in c.id){var p=c.id[d];a.schemas[d]=p}}if(i.required&&t===void 0){var h=new o0(t,r,i,a);return h.addError("is required, but is undefined"),h}var h=this.validateSchema(t,r,i,a);if(h){if(i.throwAll&&h.errors.length)throw new SI(h)}else throw new Error("Result undefined");return h};function s0(e){var t=typeof e=="string"?e:e.$ref;return typeof t=="string"?t:!1}Pt.prototype.validateSchema=function(t,r,i,a){var s=new o0(t,r,i,a);if(typeof r=="boolean")r===!0?r={}:r===!1&&(r={type:[]});else if(!r)throw new Error("schema is undefined");if(r.extends)if(Array.isArray(r.extends)){var l={schema:r,ctx:a};r.extends.forEach(this.schemaTraverser.bind(this,l)),r=l.schema,l.schema=null,l.ctx=null,l=null}else r=Gn.deepMerge(r,this.superResolve(r.extends,a));var c=s0(r);if(c){var d=this.resolve(r,c,a),p=new a0(d.subschema,i,a.path,d.switchSchema,a.schemas);return this.validateSchema(t,d.subschema,i,p)}var h=i&&i.skipAttributes||[];for(var w in r)if(!n0.ignoreProperties[w]&&h.indexOf(w)<0){var S=null,v=this.attributes[w];if(v)S=v.call(this,t,r,i,a);else if(i.allowUnknownAttributes===!1)throw new Vo("Unsupported attribute: "+w,r);S&&s.importErrors(S)}if(typeof i.rewrite=="function"){var _=i.rewrite.call(this,t,r,i,a);s.instance=_}return s};Pt.prototype.schemaTraverser=function(t,r){t.schema=Gn.deepMerge(t.schema,this.superResolve(r,t.ctx))};Pt.prototype.superResolve=function(t,r){var i=s0(t);return i?this.resolve(t,i,r).subschema:t};Pt.prototype.resolve=function(t,r,i){if(r=i.resolve(r),i.schemas[r])return{subschema:i.schemas[r],switchSchema:r};let s=new URL(r,"thismessage::/").hash;var l=s&&s.length&&r.substr(0,r.length-s.length);if(!l||!i.schemas[l])throw new Vo("no such schema <"+r+">",t);var c=Gn.objectGetPath(i.schemas[l],s.substr(1));if(c===void 0)throw new Vo("no such schema "+s+" located in <"+l+">",t);return{subschema:c,switchSchema:r}};Pt.prototype.testType=function(t,r,i,a,s){if(s!==void 0){if(s===null)throw new Vo('Unexpected null in "type" keyword');if(typeof this.types[s]=="function")return this.types[s].call(this,t);if(s&&typeof s=="object"){var l=this.validateSchema(t,s,i,a);return l===void 0||!(l&&l.errors.length)}return!0}};var sn=Pt.prototype.types={};sn.string=function(t){return typeof t=="string"};sn.number=function(t){return typeof t=="number"&&isFinite(t)};sn.integer=function(t){return typeof t=="number"&&t%1===0};sn.boolean=function(t){return typeof t=="boolean"};sn.array=function(t){return Array.isArray(t)};sn.null=function(t){return t===null};sn.date=function(t){return t instanceof Date};sn.any=function(t){return!0};sn.object=function(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof Date)};var _I=Pt,u0;u0=_I;dt.ValidatorResult;dt.ValidatorResultError;dt.ValidationError;dt.SchemaError;var xI=l0;function l0(e,t,r){e instanceof RegExp&&(e=Av(e,r)),t instanceof RegExp&&(t=Av(t,r));var i=c0(e,t,r);return i&&{start:i[0],end:i[1],pre:r.slice(0,i[0]),body:r.slice(i[0]+e.length,i[1]),post:r.slice(i[1]+t.length)}}function Av(e,t){var r=t.match(e);return r?r[0]:null}l0.range=c0;function c0(e,t,r){var i,a,s,l,c,d=r.indexOf(e),p=r.indexOf(t,d+1),h=d;if(d>=0&&p>0){if(e===t)return[d,p];for(i=[],s=r.length;h>=0&&!c;)h==d?(i.push(h),d=r.indexOf(e,h+1)):i.length==1?c=[i.pop(),p]:(a=i.pop(),a<s&&(s=a,l=p),p=r.indexOf(t,h+1)),h=d<p&&d>=0?d:p;i.length&&(c=[s,l])}return c}var f0=xI,OI=RI,d0="\0SLASH"+Math.random()+"\0",p0="\0OPEN"+Math.random()+"\0",bf="\0CLOSE"+Math.random()+"\0",h0="\0COMMA"+Math.random()+"\0",v0="\0PERIOD"+Math.random()+"\0";function oc(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function AI(e){return e.split("\\\\").join(d0).split("\\{").join(p0).split("\\}").join(bf).split("\\,").join(h0).split("\\.").join(v0)}function TI(e){return e.split(d0).join("\\").split(p0).join("{").split(bf).join("}").split(h0).join(",").split(v0).join(".")}function m0(e){if(!e)return[""];var t=[],r=f0("{","}",e);if(!r)return e.split(",");var i=r.pre,a=r.body,s=r.post,l=i.split(",");l[l.length-1]+="{"+a+"}";var c=m0(s);return s.length&&(l[l.length-1]+=c.shift(),l.push.apply(l,c)),t.push.apply(t,l),t}function RI(e){return e?(e.substr(0,2)==="{}"&&(e="\\{\\}"+e.substr(2)),Do(AI(e),!0).map(TI)):[]}function CI(e){return"{"+e+"}"}function PI(e){return/^-?0\d/.test(e)}function II(e,t){return e<=t}function MI(e,t){return e>=t}function Do(e,t){var r=[],i=f0("{","}",e);if(!i)return[e];var a=i.pre,s=i.post.length?Do(i.post,!1):[""];if(/\$$/.test(i.pre))for(var l=0;l<s.length;l++){var c=a+"{"+i.body+"}"+s[l];r.push(c)}else{var d=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),p=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),h=d||p,w=i.body.indexOf(",")>=0;if(!h&&!w)return i.post.match(/,.*\}/)?(e=i.pre+"{"+i.body+bf+i.post,Do(e)):[e];var S;if(h)S=i.body.split(/\.\./);else if(S=m0(i.body),S.length===1&&(S=Do(S[0],!1).map(CI),S.length===1))return s.map(function(ee){return i.pre+S[0]+ee});var v;if(h){var _=oc(S[0]),g=oc(S[1]),x=Math.max(S[0].length,S[1].length),C=S.length==3?Math.abs(oc(S[2])):1,P=II,T=g<_;T&&(C*=-1,P=MI);var $=S.some(PI);v=[];for(var A=_;P(A,g);A+=C){var D;if(p)D=String.fromCharCode(A),D==="\\"&&(D="");else if(D=String(A),$){var H=x-D.length;if(H>0){var j=new Array(H+1).join("0");A<0?D="-"+j+D.slice(1):D=j+D}}v.push(D)}}else{v=[];for(var V=0;V<S.length;V++)v.push.apply(v,Do(S[V],!1))}for(var V=0;V<v.length;V++)for(var l=0;l<s.length;l++){var c=a+v[V]+s[l];(!t||h||c)&&r.push(c)}}return r}const FI=$c(OI),LI=1024*64,Ns=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>LI)throw new TypeError("pattern is too long")},$I={"[: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]},Lo=e=>e.replace(/[[\]\\-]/g,"\\$&"),DI=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Tv=e=>e.join(""),kI=(e,t)=>{const r=t;if(e.charAt(r)!=="[")throw new Error("not in a brace expression");const i=[],a=[];let s=r+1,l=!1,c=!1,d=!1,p=!1,h=r,w="";e:for(;s<e.length;){const g=e.charAt(s);if((g==="!"||g==="^")&&s===r+1){p=!0,s++;continue}if(g==="]"&&l&&!d){h=s+1;break}if(l=!0,g==="\\"&&!d){d=!0,s++;continue}if(g==="["&&!d){for(const[x,[C,P,T]]of Object.entries($I))if(e.startsWith(x,s)){if(w)return["$.",!1,e.length-r,!0];s+=x.length,T?a.push(C):i.push(C),c=c||P;continue e}}if(d=!1,w){g>w?i.push(Lo(w)+"-"+Lo(g)):g===w&&i.push(Lo(g)),w="",s++;continue}if(e.startsWith("-]",s+1)){i.push(Lo(g+"-")),s+=2;continue}if(e.startsWith("-",s+1)){w=g,s+=2;continue}i.push(Lo(g)),s++}if(h<s)return["",!1,0,!1];if(!i.length&&!a.length)return["$.",!1,e.length-r,!0];if(a.length===0&&i.length===1&&/^\\?.$/.test(i[0])&&!p){const g=i[0].length===2?i[0].slice(-1):i[0];return[DI(g),!1,h-r,!1]}const S="["+(p?"^":"")+Tv(i)+"]",v="["+(p?"":"^")+Tv(a)+"]";return[i.length&&a.length?"("+S+"|"+v+")":i.length?S:v,c,h-r,!0]},ko=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),NI=new Set(["!","?","+","*","@"]),Rv=e=>NI.has(e),jI="(?!(?:^|/)\\.\\.?(?:$|/))",ys="(?!\\.)",WI=new Set(["[","."]),UI=new Set(["..","."]),HI=new Set("().*{}+?[]^$\\!"),BI=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Sf="[^/]",Cv=Sf+"*?",Pv=Sf+"+?";var xt,Rt,Sn,it,bt,Wn,wi,Un,Xr,bi,Xo,Ws,g0,no,As,Jo,Lc,Us,y0;const Zt=class Zt{constructor(t,r,i={}){Wt(this,Ws);Wt(this,Jo);wt(this,"type");Wt(this,xt,void 0);Wt(this,Rt,void 0);Wt(this,Sn,!1);Wt(this,it,[]);Wt(this,bt,void 0);Wt(this,Wn,void 0);Wt(this,wi,void 0);Wt(this,Un,!1);Wt(this,Xr,void 0);Wt(this,bi,void 0);Wt(this,Xo,!1);this.type=t,t&&gt(this,Rt,!0),gt(this,bt,r),gt(this,xt,X(this,bt)?X(X(this,bt),xt):this),gt(this,Xr,X(this,xt)===this?i:X(X(this,xt),Xr)),gt(this,wi,X(this,xt)===this?[]:X(X(this,xt),wi)),t==="!"&&!X(X(this,xt),Un)&&X(this,wi).push(this),gt(this,Wn,X(this,bt)?X(X(this,bt),it).length:0)}get hasMagic(){if(X(this,Rt)!==void 0)return X(this,Rt);for(const t of X(this,it))if(typeof t!="string"&&(t.type||t.hasMagic))return gt(this,Rt,!0);return X(this,Rt)}toString(){return X(this,bi)!==void 0?X(this,bi):this.type?gt(this,bi,this.type+"("+X(this,it).map(t=>String(t)).join("|")+")"):gt(this,bi,X(this,it).map(t=>String(t)).join(""))}push(...t){for(const r of t)if(r!==""){if(typeof r!="string"&&!(r instanceof Zt&&X(r,bt)===this))throw new Error("invalid part: "+r);X(this,it).push(r)}}toJSON(){var r;const t=this.type===null?X(this,it).slice().map(i=>typeof i=="string"?i:i.toJSON()):[this.type,...X(this,it).map(i=>i.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===X(this,xt)||X(X(this,xt),Un)&&((r=X(this,bt))==null?void 0:r.type)==="!")&&t.push({}),t}isStart(){var r;if(X(this,xt)===this)return!0;if(!((r=X(this,bt))!=null&&r.isStart()))return!1;if(X(this,Wn)===0)return!0;const t=X(this,bt);for(let i=0;i<X(this,Wn);i++){const a=X(t,it)[i];if(!(a instanceof Zt&&a.type==="!"))return!1}return!0}isEnd(){var r,i,a;if(X(this,xt)===this||((r=X(this,bt))==null?void 0:r.type)==="!")return!0;if(!((i=X(this,bt))!=null&&i.isEnd()))return!1;if(!this.type)return(a=X(this,bt))==null?void 0:a.isEnd();const t=X(this,bt)?X(X(this,bt),it).length:0;return X(this,Wn)===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){const r=new Zt(this.type,t);for(const i of X(this,it))r.copyIn(i);return r}static fromGlob(t,r={}){var a;const i=new Zt(null,void 0,r);return $n(a=Zt,no,As).call(a,t,i,0,r),i}toMMPattern(){if(this!==X(this,xt))return X(this,xt).toMMPattern();const t=this.toString(),[r,i,a,s]=this.toRegExpSource();if(!(a||X(this,Rt)||X(this,Xr).nocase&&!X(this,Xr).nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return i;const c=(X(this,Xr).nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${r}$`,c),{_src:r,_glob:t})}get options(){return X(this,Xr)}toRegExpSource(t){var d;const r=t??!!X(this,Xr).dot;if(X(this,xt)===this&&$n(this,Ws,g0).call(this),!this.type){const p=this.isStart()&&this.isEnd(),h=X(this,it).map(_=>{var T;const[g,x,C,P]=typeof _=="string"?$n(T=Zt,Us,y0).call(T,_,X(this,Rt),p):_.toRegExpSource(t);return gt(this,Rt,X(this,Rt)||C),gt(this,Sn,X(this,Sn)||P),g}).join("");let w="";if(this.isStart()&&typeof X(this,it)[0]=="string"&&!(X(this,it).length===1&&UI.has(X(this,it)[0]))){const g=WI,x=r&&g.has(h.charAt(0))||h.startsWith("\\.")&&g.has(h.charAt(2))||h.startsWith("\\.\\.")&&g.has(h.charAt(4)),C=!r&&!t&&g.has(h.charAt(0));w=x?jI:C?ys:""}let S="";return this.isEnd()&&X(X(this,xt),Un)&&((d=X(this,bt))==null?void 0:d.type)==="!"&&(S="(?:$|\\/)"),[w+h+S,ko(h),gt(this,Rt,!!X(this,Rt)),X(this,Sn)]}const i=this.type==="*"||this.type==="+",a=this.type==="!"?"(?:(?!(?:":"(?:";let s=$n(this,Jo,Lc).call(this,r);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){const p=this.toString();return gt(this,it,[p]),this.type=null,gt(this,Rt,void 0),[p,ko(this.toString()),!1,!1]}let l=!i||t||r||!ys?"":$n(this,Jo,Lc).call(this,!0);l===s&&(l=""),l&&(s=`(?:${s})(?:${l})*?`);let c="";if(this.type==="!"&&X(this,Xo))c=(this.isStart()&&!r?ys:"")+Pv;else{const p=this.type==="!"?"))"+(this.isStart()&&!r&&!t?ys:"")+Cv+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&l?")":this.type==="*"&&l?")?":`)${this.type}`;c=a+s+p}return[c,ko(s),gt(this,Rt,!!X(this,Rt)),X(this,Sn)]}};xt=new WeakMap,Rt=new WeakMap,Sn=new WeakMap,it=new WeakMap,bt=new WeakMap,Wn=new WeakMap,wi=new WeakMap,Un=new WeakMap,Xr=new WeakMap,bi=new WeakMap,Xo=new WeakMap,Ws=new WeakSet,g0=function(){if(this!==X(this,xt))throw new Error("should only call on root");if(X(this,Un))return this;this.toString(),gt(this,Un,!0);let t;for(;t=X(this,wi).pop();){if(t.type!=="!")continue;let r=t,i=X(r,bt);for(;i;){for(let a=X(r,Wn)+1;!i.type&&a<X(i,it).length;a++)for(const s of X(t,it)){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(X(i,it)[a])}r=i,i=X(r,bt)}}return this},no=new WeakSet,As=function(t,r,i,a){var v,_;let s=!1,l=!1,c=-1,d=!1;if(r.type===null){let g=i,x="";for(;g<t.length;){const C=t.charAt(g++);if(s||C==="\\"){s=!s,x+=C;continue}if(l){g===c+1?(C==="^"||C==="!")&&(d=!0):C==="]"&&!(g===c+2&&d)&&(l=!1),x+=C;continue}else if(C==="["){l=!0,c=g,d=!1,x+=C;continue}if(!a.noext&&Rv(C)&&t.charAt(g)==="("){r.push(x),x="";const P=new Zt(C,r);g=$n(v=Zt,no,As).call(v,t,P,g,a),r.push(P);continue}x+=C}return r.push(x),g}let p=i+1,h=new Zt(null,r);const w=[];let S="";for(;p<t.length;){const g=t.charAt(p++);if(s||g==="\\"){s=!s,S+=g;continue}if(l){p===c+1?(g==="^"||g==="!")&&(d=!0):g==="]"&&!(p===c+2&&d)&&(l=!1),S+=g;continue}else if(g==="["){l=!0,c=p,d=!1,S+=g;continue}if(Rv(g)&&t.charAt(p)==="("){h.push(S),S="";const x=new Zt(g,h);h.push(x),p=$n(_=Zt,no,As).call(_,t,x,p,a);continue}if(g==="|"){h.push(S),S="",w.push(h),h=new Zt(null,r);continue}if(g===")")return S===""&&X(r,it).length===0&&gt(r,Xo,!0),h.push(S),S="",r.push(...w,h),p;S+=g}return r.type=null,gt(r,Rt,void 0),gt(r,it,[t.substring(i-1)]),p},Jo=new WeakSet,Lc=function(t){return X(this,it).map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");const[i,a,s,l]=r.toRegExpSource(t);return gt(this,Sn,X(this,Sn)||l),i}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")},Us=new WeakSet,y0=function(t,r,i=!1){let a=!1,s="",l=!1;for(let c=0;c<t.length;c++){const d=t.charAt(c);if(a){a=!1,s+=(HI.has(d)?"\\":"")+d;continue}if(d==="\\"){c===t.length-1?s+="\\\\":a=!0;continue}if(d==="["){const[p,h,w,S]=kI(t,c);if(w){s+=p,l=l||h,c+=w-1,r=r||S;continue}}if(d==="*"){i&&t==="*"?s+=Pv:s+=Cv,r=!0;continue}if(d==="?"){s+=Sf,r=!0;continue}s+=BI(d)}return[s,ko(t),!!r,l]},Wt(Zt,no),Wt(Zt,Us);let js=Zt;const zI=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&"),Kt=(e,t,r={})=>(Ns(t),!r.nocomment&&t.charAt(0)==="#"?!1:new iu(t,r).match(e)),qI=/^\*+([^+@!?\*\[\(]*)$/,ZI=e=>t=>!t.startsWith(".")&&t.endsWith(e),GI=e=>t=>t.endsWith(e),KI=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),YI=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),VI=/^\*+\.\*+$/,XI=e=>!e.startsWith(".")&&e.includes("."),JI=e=>e!=="."&&e!==".."&&e.includes("."),QI=/^\.\*+$/,eM=e=>e!=="."&&e!==".."&&e.startsWith("."),tM=/^\*+$/,rM=e=>e.length!==0&&!e.startsWith("."),nM=e=>e.length!==0&&e!=="."&&e!=="..",iM=/^\?+([^+@!?\*\[\(]*)?$/,oM=([e,t=""])=>{const r=w0([e]);return t?(t=t.toLowerCase(),i=>r(i)&&i.toLowerCase().endsWith(t)):r},aM=([e,t=""])=>{const r=b0([e]);return t?(t=t.toLowerCase(),i=>r(i)&&i.toLowerCase().endsWith(t)):r},sM=([e,t=""])=>{const r=b0([e]);return t?i=>r(i)&&i.endsWith(t):r},uM=([e,t=""])=>{const r=w0([e]);return t?i=>r(i)&&i.endsWith(t):r},w0=([e])=>{const t=e.length;return r=>r.length===t&&!r.startsWith(".")},b0=([e])=>{const t=e.length;return r=>r.length===t&&r!=="."&&r!==".."},S0=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Iv={win32:{sep:"\\"},posix:{sep:"/"}},lM=S0==="win32"?Iv.win32.sep:Iv.posix.sep;Kt.sep=lM;const Cr=Symbol("globstar **");Kt.GLOBSTAR=Cr;const cM="[^/]",fM=cM+"*?",dM="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",pM="(?:(?!(?:\\/|^)\\.).)*?",hM=(e,t={})=>r=>Kt(r,e,t);Kt.filter=hM;const Rr=(e,t={})=>Object.assign({},e,t),vM=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return Kt;const t=Kt;return Object.assign((i,a,s={})=>t(i,a,Rr(e,s)),{Minimatch:class extends t.Minimatch{constructor(a,s={}){super(a,Rr(e,s))}static defaults(a){return t.defaults(Rr(e,a)).Minimatch}},AST:class extends t.AST{constructor(a,s,l={}){super(a,s,Rr(e,l))}static fromGlob(a,s={}){return t.AST.fromGlob(a,Rr(e,s))}},unescape:(i,a={})=>t.unescape(i,Rr(e,a)),escape:(i,a={})=>t.escape(i,Rr(e,a)),filter:(i,a={})=>t.filter(i,Rr(e,a)),defaults:i=>t.defaults(Rr(e,i)),makeRe:(i,a={})=>t.makeRe(i,Rr(e,a)),braceExpand:(i,a={})=>t.braceExpand(i,Rr(e,a)),match:(i,a,s={})=>t.match(i,a,Rr(e,s)),sep:t.sep,GLOBSTAR:Cr})};Kt.defaults=vM;const E0=(e,t={})=>(Ns(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:FI(e));Kt.braceExpand=E0;const mM=(e,t={})=>new iu(e,t).makeRe();Kt.makeRe=mM;const gM=(e,t,r={})=>{const i=new iu(t,r);return e=e.filter(a=>i.match(a)),i.options.nonull&&!e.length&&e.push(t),e};Kt.match=gM;const Mv=/[?*]|[+@!]\(.*?\)|\[|\]/,yM=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class iu{constructor(t,r={}){wt(this,"options");wt(this,"set");wt(this,"pattern");wt(this,"windowsPathsNoEscape");wt(this,"nonegate");wt(this,"negate");wt(this,"comment");wt(this,"empty");wt(this,"preserveMultipleSlashes");wt(this,"partial");wt(this,"globSet");wt(this,"globParts");wt(this,"nocase");wt(this,"isWindows");wt(this,"platform");wt(this,"windowsNoMagicRoot");wt(this,"regexp");Ns(t),r=r||{},this.options=r,this.pattern=t,this.platform=r.platform||S0,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=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);const i=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let a=this.globParts.map((s,l,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){const d=s[0]===""&&s[1]===""&&(s[2]==="?"||!Mv.test(s[2]))&&!Mv.test(s[3]),p=/^[a-z]:/i.test(s[0]);if(d)return[...s.slice(0,4),...s.slice(4).map(h=>this.parse(h))];if(p)return[s[0],...s.slice(1).map(h=>this.parse(h))]}return s.map(d=>this.parse(d))});if(this.debug(this.pattern,a),this.set=a.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){const l=this.set[s];l[0]===""&&l[1]===""&&this.globParts[s][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 i=0;i<t.length;i++)for(let a=0;a<t[i].length;a++)t[i][a]==="**"&&(t[i][a]="*");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 i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let a=i;for(;r[a+1]==="**";)a++;a!==i&&r.splice(i,a-i)}return r})}levelOneOptimize(t){return t.map(r=>(r=r.reduce((i,a)=>{const s=i[i.length-1];return a==="**"&&s==="**"?i:a===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(i.pop(),i):(i.push(a),i)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let a=1;a<t.length-1;a++){const s=t[a];a===1&&s===""&&t[0]===""||(s==="."||s==="")&&(r=!0,t.splice(a,1),a--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(r=!0,t.pop())}let i=0;for(;(i=t.indexOf("..",i+1))!==-1;){const a=t[i-1];a&&a!=="."&&a!==".."&&a!=="**"&&(r=!0,t.splice(i-1,2),i-=2)}}while(r);return t.length===0?[""]:t}firstPhasePreProcess(t){let r=!1;do{r=!1;for(let i of t){let a=-1;for(;(a=i.indexOf("**",a+1))!==-1;){let l=a;for(;i[l+1]==="**";)l++;l>a&&i.splice(a+1,l-a);let c=i[a+1];const d=i[a+2],p=i[a+3];if(c!==".."||!d||d==="."||d===".."||!p||p==="."||p==="..")continue;r=!0,i.splice(a,1);const h=i.slice(0);h[a]="**",t.push(h),a--}if(!this.preserveMultipleSlashes){for(let l=1;l<i.length-1;l++){const c=i[l];l===1&&c===""&&i[0]===""||(c==="."||c==="")&&(r=!0,i.splice(l,1),l--)}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(r=!0,i.pop())}let s=0;for(;(s=i.indexOf("..",s+1))!==-1;){const l=i[s-1];if(l&&l!=="."&&l!==".."&&l!=="**"){r=!0;const d=s===1&&i[s+1]==="**"?["."]:[];i.splice(s-1,2,...d),i.length===0&&i.push(""),s-=2}}}}while(r);return t}secondPhasePreProcess(t){for(let r=0;r<t.length-1;r++)for(let i=r+1;i<t.length;i++){const a=this.partsMatch(t[r],t[i],!this.preserveMultipleSlashes);if(a){t[r]=[],t[i]=a;break}}return t.filter(r=>r.length)}partsMatch(t,r,i=!1){let a=0,s=0,l=[],c="";for(;a<t.length&&s<r.length;)if(t[a]===r[s])l.push(c==="b"?r[s]:t[a]),a++,s++;else if(i&&t[a]==="**"&&r[s]===t[a+1])l.push(t[a]),a++;else if(i&&r[s]==="**"&&t[a]===r[s+1])l.push(r[s]),s++;else if(t[a]==="*"&&r[s]&&(this.options.dot||!r[s].startsWith("."))&&r[s]!=="**"){if(c==="b")return!1;c="a",l.push(t[a]),a++,s++}else if(r[s]==="*"&&t[a]&&(this.options.dot||!t[a].startsWith("."))&&t[a]!=="**"){if(c==="a")return!1;c="b",l.push(r[s]),a++,s++}else return!1;return t.length===r.length&&l}parseNegate(){if(this.nonegate)return;const t=this.pattern;let r=!1,i=0;for(let a=0;a<t.length&&t.charAt(a)==="!";a++)r=!r,i++;i&&(this.pattern=t.slice(i)),this.negate=r}matchOne(t,r,i=!1){const a=this.options;if(this.isWindows){const g=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),x=!g&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),C=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),P=!C&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),T=x?3:g?0:void 0,$=P?3:C?0:void 0;if(typeof T=="number"&&typeof $=="number"){const[A,D]=[t[T],r[$]];A.toLowerCase()===D.toLowerCase()&&(r[$]=A,$>T?r=r.slice($):T>$&&(t=t.slice(T)))}}const{optimizationLevel:s=1}=this.options;s>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:r}),this.debug("matchOne",t.length,r.length);for(var l=0,c=0,d=t.length,p=r.length;l<d&&c<p;l++,c++){this.debug("matchOne loop");var h=r[c],w=t[l];if(this.debug(r,h,w),h===!1)return!1;if(h===Cr){this.debug("GLOBSTAR",[r,h,w]);var S=l,v=c+1;if(v===p){for(this.debug("** at the end");l<d;l++)if(t[l]==="."||t[l]===".."||!a.dot&&t[l].charAt(0)===".")return!1;return!0}for(;S<d;){var _=t[S];if(this.debug(`
205
205
  globstar while`,t,S,r,v,_),this.matchOne(t.slice(S),r.slice(v),i))return this.debug("globstar found match!",S,d,_),!0;if(_==="."||_===".."||!a.dot&&_.charAt(0)==="."){this.debug("dot detected!",t,S,r,v);break}this.debug("globstar swallow a segment, and continue"),S++}return!!(i&&(this.debug(`
206
- >>> no match, partial?`,t,S,r,v),S===d))}let g;if(typeof h=="string"?(g=w===h,this.debug("string match",h,w,g)):(g=h.test(w),this.debug("pattern match",h,w,g)),!g)return!1}if(l===d&&c===p)return!0;if(l===d)return i;if(c===p)return l===d-1&&t[l]==="";throw new Error("wtf?")}braceExpand(){return E0(this.pattern,this.options)}parse(t){Ns(t);const r=this.options;if(t==="**")return Cr;if(t==="")return"";let i,a=null;(i=t.match(tM))?a=r.dot?nM:rM:(i=t.match(qI))?a=(r.nocase?r.dot?YI:KI:r.dot?GI:ZI)(i[1]):(i=t.match(iM))?a=(r.nocase?r.dot?aM:oM:r.dot?sM:uM)(i):(i=t.match(VI))?a=r.dot?JI:XI:(i=t.match(QI))&&(a=eM);const s=js.fromGlob(t,this.options).toMMPattern();return a&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:a}),s}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,i=r.noglobstar?fM:r.dot?dM:pM,a=new Set(r.nocase?["i"]:[]);let s=t.map(d=>{const p=d.map(h=>{if(h instanceof RegExp)for(const w of h.flags.split(""))a.add(w);return typeof h=="string"?yM(h):h===Cr?Cr:h._src});return p.forEach((h,w)=>{const S=p[w+1],v=p[w-1];h!==Cr||v===Cr||(v===void 0?S!==void 0&&S!==Cr?p[w+1]="(?:\\/|"+i+"\\/)?"+S:p[w]=i:S===void 0?p[w-1]=v+"(?:\\/|"+i+")?":S!==Cr&&(p[w-1]=v+"(?:\\/|\\/"+i+"\\/)"+S,p[w+1]=Cr))}),p.filter(h=>h!==Cr).join("/")}).join("|");const[l,c]=t.length>1?["(?:",")"]:["",""];s="^"+l+s+c+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...a].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 i=this.options;this.isWindows&&(t=t.split("\\").join("/"));const a=this.slashSplit(t);this.debug(this.pattern,"split",a);const s=this.set;this.debug(this.pattern,"set",s);let l=a[a.length-1];if(!l)for(let c=a.length-2;!l&&c>=0;c--)l=a[c];for(let c=0;c<s.length;c++){const d=s[c];let p=a;if(i.matchBase&&d.length===1&&(p=[l]),this.matchOne(p,d,r))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(t){return Kt.defaults(t).Minimatch}}Kt.AST=js;Kt.Minimatch=iu;Kt.escape=zI;Kt.unescape=ko;const Ef="/$shared",wM={"**/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"]}},"**/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"}},"**/*.json":{parser:"json",content:{}}};function _0(e){const t=Object.entries(wM).find(([r])=>Kt(e,r));return t==null?void 0:t[1]}function _f(e){var i;const t=(i=_0(e))==null?void 0:i.content;if(!t)return;const r=e.replace(`${Ef}/`,"Shared/");xf({name:r,content:t,asText:typeof t=="string"})}function ou({path:e,createIfNotExists:t=!1}){const r=`${Ef}/${e}`;return Ye(`${r}?t=${Date.now()}`,{method:"GET",headers:new Headers({"Content-Type":"application/json"})}).then(i=>{const a=_0(e);let s=i;if(!a)return s;if(typeof s=="string")try{switch(a.parser){case"json":s=JSON.parse(s);break;default:break}}catch{throw new Error("Cannot parse")}if(a.schema&&!new u0().validate(s,a.schema).valid)throw new Error("Invalid Schema");return s}).catch(i=>{if(bM(i)&&t){const a=SM(i,e);Pg.next({message:a,kind:"warning"}),_f(r)}throw i})}function bM(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 SM(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 EM(e){return Ye(fa,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function _M(e){return Ye(fa,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}const x0=()=>{const{host:e,protocol:t}=window.location,r=t==="https:";return{projectOpened:!1,remoteDebuggerMode:pf.DISABLED,baseUrl:"",qodly:!0,urls:{renderer:"/$lib/renderer/",debugger:`ws${r?"s":""}://${e}/remoteDebugger`,lsp:`ws${r?"s":""}://${e}/LSP`},isRestActive:!0}};async function xM(){const{hostname:e,host:t,protocol:r}=window.location,i=r==="https:";try{const a=await Ye(Ot,{method:"POST",body:JSON.stringify({verb:Ii.GET_APP_SETTINGS}),headers:new Headers({"Content-Type":"application/json"})}),s=(()=>{if(a.rendererPath)return a.rendererPath;const l=`http://${e}:${a.webServerHTTPPort}`,c=`https://${e}:${a.webServerHTTPSPort}`;return a.webServerHTTPPort&&a.webServerHTTPSPort?i?c:l:a.webServerHTTPPort?l:c})();return{projectOpened:a.webServerHTTPSPort>0||a.webServerHTTPPort>0,remoteDebuggerMode:a.remoteDebuggerMode,baseUrl:s,qodly:typeof a.qodly>"u"?!0:a.qodly,urls:{renderer:a.rendererPath||`${s}/$lib/renderer/`,debugger:`ws${i?"s":""}://${t}/remoteDebugger`,lsp:`ws${i?"s":""}://${t}/LSP`},isRestActive:a.isRESTActive}}catch(a){return console.error(a),x0()}}async function O0(e){return await Ye(Ot,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}async function OM(...e){return(await Promise.all(e.map(i=>O0({root:i,verb:Ii.GET_FOLDER})))).map(({children:i})=>i.map(({name:a,date:s,type:l})=>({name:a,type:l,date:s,path:`${l}/${a}`}))).flat()}function AM(e,t={}){const{sanitize:r=!0}=t;return Ye(`/rest/$getWebForm/${e}`,{method:"GET"}).then(i=>{if(!(i!=null&&i.components)||!r)return i;const a=new Map;return{...i,components:St.entries(i.components).map(([s,l])=>{const c=s,{resolvedName:d}=l.type;if(d==="WebformLoader"){const p=Kc.generate();a.set(s,p),s=p}return[s,l,c]}).reduce((s,[l,c,d])=>{var p;return c.nodes&&(c.nodes=c.nodes.map(h=>a.get(h)||h)),c.linkedNodes&&(c.linkedNodes=St.entries(c.linkedNodes).reduce((h,[w,S])=>({...h,[w]:a.get(S)||S}),{})),(p=c.props)!=null&&p.events&&(c.props.events=c.props.events.map(h=>(h.type==="navigation"&&h.loader&&(h.loader=a.get(h.loader)||h.loader),h))),{...s,[l]:{...c,props:{...c.props,__originalID:d}}}},{})}})}function TM(e){return Ye(Ot,{method:"POST",headers:new Headers({"Content-Type":"application/json"}),body:JSON.stringify(e)}).then(t=>({...t,content:[Pr.METHOD,Pr.CLASS].includes(t.type)?ru(t.content):t.content}))}function RM(e){return e.type==="folder"?Ye(fa,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})}):Ye(Ot,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}async function CM(e){return e.type==="folder"?(await Ye(fa,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})).deleted:(await Ye(Ot,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})).deleted}function PM(e){return Ye(Ot,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function IM(e){return Ye(Ot,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}async function MM(e){return(await Ye(Ot,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})).deleted}async function FM(...e){return await Ye(Ot,{method:"POST",body:JSON.stringify({verb:Ii.GET_FILES_INFO,files:e}),headers:new Headers({"Content-Type":"application/json"})})}async function LM(e){const t=await Ye("/api/login",{method:"POST",body:JSON.stringify({accessKey:e}),headers:new Headers({"Content-Type":"application/json"})});return t.isLogged&&t.success}async function $M(){return await Ye("/rest/$catalog/$all?$metadata=full",{method:"GET",headers:new Headers({"Content-Type":"application/json"})})}async function DM({name:e,path:t="",root:r="root",asText:i=!1}){return Ye(Ot,{method:"POST",body:JSON.stringify({verb:"getFileContent",root:r,path:t,name:e,asText:i}),headers:new Headers({"Content-Type":"application/json"})})}async function kM(e={}){try{return await ou({path:"shared_datasources.json",...e})}catch{return{}}}async function NM(e={}){try{return await ou({path:"shared_css.json",...e})}catch{return{classes:[]}}}async function jM(e={}){try{return await ou({path:"saved_conditions.json",...e})}catch{return{conditions:[]}}}async function WM(){try{return await Ye("/rest/$info/privileges",{method:"GET",headers:new Headers({"Content-Type":"application/json"})})}catch{return{privileges:[]}}}async function UM(){try{return await(await fetch(`monaco_theme.json?t=${Date.now()}`)).json()}catch{return null}}const HM=Wg(),BM=async e=>{const t={verb:Ii.SET_FILE_CONTENT,asText:!1,name:"shared_datasources.json",path:"",root:"shared",content:e};return HM(async()=>(await Ye(Ot,{method:"POST",body:JSON.stringify(t),headers:new Headers({"Content-Type":"application/json"})}),e))},xf=async e=>{const t=await Ye(Ot,{method:"POST",body:JSON.stringify({...e,verb:Ii.SET_FILE_CONTENT,root:df.ROOT}),headers:new Headers({"Content-Type":"application/json"})}),r=Ng(`${e.path||"Sources"}/${e.name}`);return{...t,type:r,size:0}},zM=async e=>await xf({name:"crafted_components.json",path:zn.WEBFORMS,content:e});function qM(e){return Ye(Ot,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function ZM(e){return Ye(Ot,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function GM(e){return Ye(Ot,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function KM(e){return Ye(Ot,{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)?ru(t.content):t.content}).catch(t=>{var r,i;throw((i=(r=t.data)==null?void 0:r.__ERROR[0])==null?void 0:i.errCode)===1839&&_f(e.path),t})}function YM(e){return Ye(Ot,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function VM(e){const t=new RegExp(/^\((.+)(?=\))/gi).exec(e);return t!==null?t[1]:""}function XM(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 JM(e){const t=VM(e).split(/[;,]/g).filter(Boolean).map(a=>{const s=a.split(":")[0].trim(),l=a.split(":")[1].trim();return{name:s,type:l}}),r=XM(e),i=r?{name:r.split(":")[0].trim(),type:r.split(":")[1].trim()}:{name:"result",type:"Variable"};return{params:t,result:i}}async function QM(e,t){const i=e.split(".").pop();try{const a=await Ye(Ot,{method:"POST",body:JSON.stringify({verb:"getFunctionContent",className:t,functionName:i}),headers:new Headers({"Content-Type":"application/json"})});a.content=ru(a.content);const{params:s,result:l}=JM(a.parameters);return{...a,params:s,returns:l}}catch(a){return console.error(a),{className:t,functionName:i,filePath:e,content:"",params:[]}}}var A0=(e=>(e.STUDIO_LOADED="UA-1-0",e.WELCOME_TOUR_INIT="UA-1-3",e.WELCOME_TOUR_END="UA-1-4",e))(A0||{});function eF(e,t){fetch("/api/v1/activity",{body:JSON.stringify({AID:e,...t}),headers:{"Content-Type":"application/json"},method:"POST"}).catch(r=>{})}function tF(e){window.pagesense=window.pagesense||[],window.pagesense.push(["trackEvent",e])}var T0=(e=>(e.LOCAL="local",e.SHARED="shared",e.THEME="theme",e))(T0||{}),R0=(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))(R0||{}),C0=(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))(C0||{});const rF={transparent:{backgroundColor:"transparent"},black:{backgroundColor:"#4a4a4a",color:"white",padding:"3px 5px",borderRadius:5},grey:{backgroundColor:"#e8e8e8",color:"#262626",padding:"3px 5px",borderRadius:5}},nF={Code:{key:"editors:code",config:{language:"4d",theme:"fd-dark"}},WebForm:{key:"editors:webforms"}};exports.API_PREFIX=Ot;exports.AppLoader=zP;exports.ControlledSwitch=hg;exports.DATASOURCE_THEMES=rF;exports.DatasourcesActions=Cg;exports.DebuggerActions=Fg;exports.DesignerRequestVerb=Ii;exports.Dialog=aO;exports.DialogBody=Zv;exports.EActivity=A0;exports.EDITOR=nF;exports.EIDENTIFIERS=R0;exports.ERROR_CODES=C0;exports.EWebFormStyleClassScope=T0;exports.EXT_API_PREFIX=fa;exports.FileFolderType=Pr;exports.FolderRootPath=zn;exports.FolderRootType=df;exports.HTTPError=Ic;exports.HTTP_HANDLERS_PATH=kg;exports.IPreemptive=Yo;exports.IPublished=Kg;exports.IPublishedRestScope=hf;exports.IdentityProvider=m2;exports.Incase=JA;exports.IndentLines=Sm;exports.LogoSVG=vg;exports.LspActions=Mg;exports.MAX_FILE_NAME_LENGTH=cf;exports.MODEL_TAB_PATH=j2;exports.Modal=ZP;exports.ModalCloseReason=eo;exports.ModalColor=_i;exports.ModalIcons=Ac;exports.ModalType=lf;exports.Mutex=jg;exports.NameError=ff;exports.Overlay=qv;exports.Portal=Lv;exports.PublishOptions=lI;exports.ROLES_TAB_PATH=$g;exports.RemoteDebuggerMode=pf;exports.SETTINGS_TAB_PATH=Dg;exports.SHARED_API_PREFIX=Ef;exports.Switcher=Em;exports.TabEventsActions=Ig;exports.Tip=ZC;exports.TipsProvider=zC;exports.Toast=yA;exports.Tooltip=HP;exports.Tree=XA;exports.TreeIcon=mm;exports.TreeNode=Yc;exports.WebformActions=Rg;exports._isArrayDatasource=oI;exports._isObjectDatasource=aI;exports.addAttributesToContent=fI;exports.addFolder=PM;exports.by=Ug;exports.byId=z2;exports.byPath=q2;exports.checkUpdates=EM;exports.createFolder=qM;exports.datasourcesSubject=M2;exports.debuggerSubject=D2;exports.dropFile=CM;exports.dropFolder=MM;exports.exists=Z2;exports.extractWebformName=U2;exports.generateUUID=dI;exports.getAppSettings=xM;exports.getCatalog=$M;exports.getDatasourceId=G2;exports.getDefaultAppSettings=x0;exports.getFile=TM;exports.getFileContent=DM;exports.getFileExtentionFromType=W2;exports.getFilesInfo=FM;exports.getFolder=O0;exports.getFolders=OM;exports.getFunctionContent=QM;exports.getMonacoTheme=UM;exports.getNodeInfo=KM;exports.getSavedConditions=jM;exports.getSharedCSS=NM;exports.getSharedDatasources=kM;exports.getSharedResource=ou;exports.getTypeFromExtension=Ng;exports.getUserPrivileges=WM;exports.getWebForm=AM;exports.hasAttributesString=Vg;exports.http=Ye;exports.installUpdates=_M;exports.isArrayDatasource=qg;exports.isDataClassMethod=X2;exports.isDataStoreMethod=V2;exports.isDateDatasource=sI;exports.isEntity=nI;exports.isEntityDatasource=eI;exports.isEntityMethod=J2;exports.isEntitySelection=iI;exports.isEntitySelectionDatasource=tI;exports.isEntitySelectionMethod=Q2;exports.isObjectAttribute=K2;exports.isObjectDatasource=Zg;exports.isRelatedAttribute=Y2;exports.isRelatedEntitiesAttribute=Bg;exports.isRelatedEntityAttribute=zg;exports.isScalarDatasource=Gg;exports.isSimpleAttribute=Hg;exports.isSimpleDatasource=rI;exports.loadDS=uI;exports.log=eF;exports.login=LM;exports.lspSubject=$2;exports.moveItem=GM;exports.outBy=H2;exports.outById=B2;exports.parseAttributes=cI;exports.queue=Wg;exports.removeAttributesString=Xg;exports.removeItem=ZM;exports.renameFile=RM;exports.renameFolder=IM;exports.sanitizeContent=ru;exports.saveContent=YM;exports.setCraftedComponents=zM;exports.setFileContent=xf;exports.setSharedSources=BM;exports.stringifyAttributes=Yg;exports.tabEventsSubject=L2;exports.toastSubject=Pg;exports.trackEvent=tF;exports.transformDates=pI;exports.tryCreateSharedResource=_f;exports.useDidMountEffect=YP;exports.useDoubleClick=b2;exports.useFeatureFlags=v2;exports.useForwardedRef=h2;exports.useHotkeys=c2;exports.useIdentity=g2;exports.useOutsideClick=f2;exports.usePrevious=d2;exports.useStateObject=y2;exports.useStateRef=p2;exports.useTip=rg;exports.validateName=Lg;exports.validateServerSide=k2;exports.validateValue=N2;exports.webformSubject=F2;
206
+ >>> no match, partial?`,t,S,r,v),S===d))}let g;if(typeof h=="string"?(g=w===h,this.debug("string match",h,w,g)):(g=h.test(w),this.debug("pattern match",h,w,g)),!g)return!1}if(l===d&&c===p)return!0;if(l===d)return i;if(c===p)return l===d-1&&t[l]==="";throw new Error("wtf?")}braceExpand(){return E0(this.pattern,this.options)}parse(t){Ns(t);const r=this.options;if(t==="**")return Cr;if(t==="")return"";let i,a=null;(i=t.match(tM))?a=r.dot?nM:rM:(i=t.match(qI))?a=(r.nocase?r.dot?YI:KI:r.dot?GI:ZI)(i[1]):(i=t.match(iM))?a=(r.nocase?r.dot?aM:oM:r.dot?sM:uM)(i):(i=t.match(VI))?a=r.dot?JI:XI:(i=t.match(QI))&&(a=eM);const s=js.fromGlob(t,this.options).toMMPattern();return a&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:a}),s}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,i=r.noglobstar?fM:r.dot?dM:pM,a=new Set(r.nocase?["i"]:[]);let s=t.map(d=>{const p=d.map(h=>{if(h instanceof RegExp)for(const w of h.flags.split(""))a.add(w);return typeof h=="string"?yM(h):h===Cr?Cr:h._src});return p.forEach((h,w)=>{const S=p[w+1],v=p[w-1];h!==Cr||v===Cr||(v===void 0?S!==void 0&&S!==Cr?p[w+1]="(?:\\/|"+i+"\\/)?"+S:p[w]=i:S===void 0?p[w-1]=v+"(?:\\/|"+i+")?":S!==Cr&&(p[w-1]=v+"(?:\\/|\\/"+i+"\\/)"+S,p[w+1]=Cr))}),p.filter(h=>h!==Cr).join("/")}).join("|");const[l,c]=t.length>1?["(?:",")"]:["",""];s="^"+l+s+c+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...a].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 i=this.options;this.isWindows&&(t=t.split("\\").join("/"));const a=this.slashSplit(t);this.debug(this.pattern,"split",a);const s=this.set;this.debug(this.pattern,"set",s);let l=a[a.length-1];if(!l)for(let c=a.length-2;!l&&c>=0;c--)l=a[c];for(let c=0;c<s.length;c++){const d=s[c];let p=a;if(i.matchBase&&d.length===1&&(p=[l]),this.matchOne(p,d,r))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(t){return Kt.defaults(t).Minimatch}}Kt.AST=js;Kt.Minimatch=iu;Kt.escape=zI;Kt.unescape=ko;const Ef="/$shared",wM={"**/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"]}},"**/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"}},"**/*.json":{parser:"json",content:{}}};function _0(e){const t=Object.entries(wM).find(([r])=>Kt(e,r));return t==null?void 0:t[1]}function _f(e){var i;const t=(i=_0(e))==null?void 0:i.content;if(!t)return;const r=e.replace(`${Ef}/`,"Shared/");xf({name:r,content:t,asText:typeof t=="string"})}function ou({path:e,createIfNotExists:t=!1}){const r=`${Ef}/${e}`;return Ye(`${r}?t=${Date.now()}`,{method:"GET",headers:new Headers({"Content-Type":"application/json"})}).then(i=>{const a=_0(e);let s=i;if(!a)return s;if(typeof s=="string")try{switch(a.parser){case"json":s=JSON.parse(s);break;default:break}}catch{throw new Error("Cannot parse")}if(a.schema&&!new u0().validate(s,a.schema).valid)throw new Error("Invalid Schema");return s}).catch(i=>{if(bM(i)&&t){const a=SM(i,e);Pg.next({message:a,kind:"warning"}),_f(r)}throw i})}function bM(e){var t,r;return((t=e==null?void 0:e.response)==null?void 0:t.status)===404&&((r=e.response.headers.get("Content-Type"))==null?void 0:r.startsWith("application/json"))||(e==null?void 0:e.message)==="Invalid Schema"||(e==null?void 0:e.message)==="Cannot parse"||(e==null?void 0:e.name)==="SyntaxError"}function SM(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 EM(e){return Ye(fa,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function _M(e){return Ye(fa,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}const x0=()=>{const{host:e,protocol:t}=window.location,r=t==="https:";return{projectOpened:!1,remoteDebuggerMode:pf.DISABLED,baseUrl:"",qodly:!0,urls:{renderer:"/$lib/renderer/",debugger:`ws${r?"s":""}://${e}/remoteDebugger`,lsp:`ws${r?"s":""}://${e}/LSP`},isRestActive:!0}};async function xM(){const{hostname:e,host:t,protocol:r}=window.location,i=r==="https:";try{const a=await Ye(Ot,{method:"POST",body:JSON.stringify({verb:Ii.GET_APP_SETTINGS}),headers:new Headers({"Content-Type":"application/json"})}),s=(()=>{if(a.rendererPath)return a.rendererPath;const l=`http://${e}:${a.webServerHTTPPort}`,c=`https://${e}:${a.webServerHTTPSPort}`;return a.webServerHTTPPort&&a.webServerHTTPSPort?i?c:l:a.webServerHTTPPort?l:c})();return{projectOpened:a.webServerHTTPSPort>0||a.webServerHTTPPort>0,remoteDebuggerMode:a.remoteDebuggerMode,baseUrl:s,qodly:typeof a.qodly>"u"?!0:a.qodly,urls:{renderer:a.rendererPath||`${s}/$lib/renderer/`,debugger:`ws${i?"s":""}://${t}/remoteDebugger`,lsp:`ws${i?"s":""}://${t}/LSP`},isRestActive:a.isRESTActive}}catch(a){return console.error(a),x0()}}async function O0(e){return await Ye(Ot,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}async function OM(...e){return(await Promise.all(e.map(i=>O0({root:i,verb:Ii.GET_FOLDER})))).map(({children:i})=>i.map(({name:a,date:s,type:l})=>({name:a,type:l,date:s,path:`${l}/${a}`}))).flat()}function AM(e,t={}){const{sanitize:r=!0}=t;return Ye(`/rest/$getWebForm/${e}`,{method:"GET"}).then(i=>{if(!(i!=null&&i.components)||!r)return i;const a=new Map;return{...i,components:St.entries(i.components).map(([s,l])=>{const c=s,{resolvedName:d}=l.type;if(d==="WebformLoader"){const p=Kc.generate();a.set(s,p),s=p}return[s,l,c]}).reduce((s,[l,c,d])=>{var p;return c.nodes&&(c.nodes=c.nodes.map(h=>a.get(h)||h)),c.linkedNodes&&(c.linkedNodes=St.entries(c.linkedNodes).reduce((h,[w,S])=>({...h,[w]:a.get(S)||S}),{})),(p=c.props)!=null&&p.events&&(c.props.events=c.props.events.map(h=>(h.type==="navigation"&&h.loader&&(h.loader=a.get(h.loader)||h.loader),h))),{...s,[l]:{...c,props:{...c.props,__originalID:d}}}},{})}})}function TM(e){return Ye(Ot,{method:"POST",headers:new Headers({"Content-Type":"application/json"}),body:JSON.stringify(e)}).then(t=>({...t,content:[Pr.METHOD,Pr.CLASS].includes(t.type)?ru(t.content):t.content}))}function RM(e){return e.type==="folder"?Ye(fa,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})}):Ye(Ot,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}async function CM(e){return e.type==="folder"?(await Ye(fa,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})).deleted:(await Ye(Ot,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})).deleted}function PM(e){return Ye(Ot,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function IM(e){return Ye(Ot,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}async function MM(e){return(await Ye(Ot,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})).deleted}async function FM(...e){return await Ye(Ot,{method:"POST",body:JSON.stringify({verb:Ii.GET_FILES_INFO,files:e}),headers:new Headers({"Content-Type":"application/json"})})}async function LM(e){const t=await Ye("/api/login",{method:"POST",body:JSON.stringify({accessKey:e}),headers:new Headers({"Content-Type":"application/json"})});return t.isLogged&&t.success}async function $M(){return await Ye("/rest/$catalog/$all?$metadata=full",{method:"GET",headers:new Headers({"Content-Type":"application/json"})})}async function DM({name:e,path:t="",root:r="root",asText:i=!1}){return Ye(Ot,{method:"POST",body:JSON.stringify({verb:"getFileContent",root:r,path:t,name:e,asText:i}),headers:new Headers({"Content-Type":"application/json"})})}async function kM(e={}){try{return await ou({path:"shared_datasources.json",...e})}catch{return{}}}async function NM(e={}){try{return await ou({path:"shared_css.json",...e})}catch{return{classes:[]}}}async function jM(e={}){try{return await ou({path:"saved_conditions.json",...e})}catch{return{conditions:[]}}}async function WM(){try{return await Ye("/rest/$info/privileges",{method:"GET",headers:new Headers({"Content-Type":"application/json"})})}catch{return{privileges:[]}}}async function UM(){try{return await(await fetch(`monaco_theme.json?t=${Date.now()}`)).json()}catch{return null}}const HM=Wg(),BM=async e=>{const t={verb:Ii.SET_FILE_CONTENT,asText:!1,name:"shared_datasources.json",path:"",root:"shared",content:e};return HM(async()=>(await Ye(Ot,{method:"POST",body:JSON.stringify(t),headers:new Headers({"Content-Type":"application/json"})}),e))},xf=async e=>{const t=await Ye(Ot,{method:"POST",body:JSON.stringify({...e,verb:Ii.SET_FILE_CONTENT,root:df.ROOT}),headers:new Headers({"Content-Type":"application/json"})}),r=Ng(`${e.path||"Sources"}/${e.name}`);return{...t,type:r,size:0}},zM=async e=>await xf({name:"crafted_components.json",path:zn.WEBFORMS,content:e});function qM(e){return Ye(Ot,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function ZM(e){return Ye(Ot,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function GM(e){return Ye(Ot,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function KM(e){return Ye(Ot,{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)?ru(t.content):t.content}).catch(t=>{var r,i;throw((i=(r=t.data)==null?void 0:r.__ERROR[0])==null?void 0:i.errCode)===1839&&_f(e.path),t})}function YM(e){return Ye(Ot,{method:"POST",body:JSON.stringify(e),headers:new Headers({"Content-Type":"application/json"})})}function VM(e){const t=new RegExp(/^\((.+)(?=\))/gi).exec(e);return t!==null?t[1]:""}function XM(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 JM(e){const t=VM(e).split(/[;,]/g).filter(Boolean).map(a=>{const s=a.split(":")[0].trim(),l=a.split(":")[1].trim();return{name:s,type:l}}),r=XM(e),i=r?{name:r.split(":")[0].trim(),type:r.split(":")[1].trim()}:{name:"result",type:"Variable"};return{params:t,result:i}}async function QM(e,t){const i=e.split(".").pop();try{const a=await Ye(Ot,{method:"POST",body:JSON.stringify({verb:"getFunctionContent",className:t,functionName:i}),headers:new Headers({"Content-Type":"application/json"})});a.content=ru(a.content);const{params:s,result:l}=JM(a.parameters);return{...a,params:s,returns:l}}catch(a){return console.error(a),{className:t,functionName:i,filePath:e,content:"",params:[]}}}var A0=(e=>(e.STUDIO_LOADED="UA-1-0",e.WELCOME_TOUR_INIT="UA-1-3",e.WELCOME_TOUR_END="UA-1-4",e))(A0||{});function eF(e,t){fetch("/api/v1/activity",{body:JSON.stringify({AID:e,...t}),headers:{"Content-Type":"application/json"},method:"POST"}).catch(r=>{})}function tF(e){window.pagesense=window.pagesense||[],window.pagesense.push(["trackEvent",e])}var T0=(e=>(e.LOCAL="local",e.SHARED="shared",e.THEME="theme",e))(T0||{}),R0=(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))(R0||{}),C0=(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))(C0||{});const rF={transparent:{backgroundColor:"transparent"},black:{backgroundColor:"#4a4a4a",color:"white",padding:"3px 5px",borderRadius:5},grey:{backgroundColor:"#e8e8e8",color:"#262626",padding:"3px 5px",borderRadius:5}},nF={Code:{key:"editors:code",config:{language:"4d",theme:"fd-dark"}},WebForm:{key:"editors:webforms"}};exports.API_PREFIX=Ot;exports.AppLoader=zP;exports.ControlledSwitch=hg;exports.DATASOURCE_THEMES=rF;exports.DatasourcesActions=Cg;exports.DebuggerActions=Fg;exports.DesignerRequestVerb=Ii;exports.Dialog=aO;exports.DialogBody=Zv;exports.EActivity=A0;exports.EDITOR=nF;exports.EIDENTIFIERS=R0;exports.ERROR_CODES=C0;exports.EWebFormStyleClassScope=T0;exports.EXT_API_PREFIX=fa;exports.FileFolderType=Pr;exports.FolderRootPath=zn;exports.FolderRootType=df;exports.HTTPError=Ic;exports.HTTP_HANDLERS_PATH=kg;exports.IPreemptive=Yo;exports.IPublished=Kg;exports.IPublishedRestScope=hf;exports.IdentityProvider=m2;exports.Incase=JA;exports.IndentLines=Sm;exports.LogoSVG=vg;exports.LspActions=Mg;exports.MAX_FILE_NAME_LENGTH=cf;exports.MODEL_TAB_PATH=j2;exports.Modal=ZP;exports.ModalCloseReason=eo;exports.ModalColor=_i;exports.ModalIcons=Ac;exports.ModalType=lf;exports.Mutex=jg;exports.NameError=ff;exports.Overlay=qv;exports.Portal=Lv;exports.PublishOptions=lI;exports.ROLES_TAB_PATH=$g;exports.RemoteDebuggerMode=pf;exports.SETTINGS_TAB_PATH=Dg;exports.SHARED_API_PREFIX=Ef;exports.Switcher=Em;exports.TabEventsActions=Ig;exports.Tip=ZC;exports.TipsProvider=zC;exports.Toast=yA;exports.Tooltip=HP;exports.Tree=XA;exports.TreeIcon=mm;exports.TreeNode=Yc;exports.WebformActions=Rg;exports._isArrayDatasource=oI;exports._isObjectDatasource=aI;exports.addAttributesToContent=fI;exports.addFolder=PM;exports.by=Ug;exports.byId=z2;exports.byPath=q2;exports.checkUpdates=EM;exports.createFolder=qM;exports.datasourcesSubject=M2;exports.debuggerSubject=D2;exports.dropFile=CM;exports.dropFolder=MM;exports.exists=Z2;exports.extractWebformName=U2;exports.generateUUID=dI;exports.getAppSettings=xM;exports.getCatalog=$M;exports.getDatasourceId=G2;exports.getDefaultAppSettings=x0;exports.getFile=TM;exports.getFileContent=DM;exports.getFileExtentionFromType=W2;exports.getFilesInfo=FM;exports.getFolder=O0;exports.getFolders=OM;exports.getFunctionContent=QM;exports.getMonacoTheme=UM;exports.getNodeInfo=KM;exports.getSavedConditions=jM;exports.getSharedCSS=NM;exports.getSharedDatasources=kM;exports.getSharedResource=ou;exports.getTypeFromExtension=Ng;exports.getUserPrivileges=WM;exports.getWebForm=AM;exports.hasAttributesString=Vg;exports.http=Ye;exports.installUpdates=_M;exports.isArrayDatasource=qg;exports.isDataClassMethod=X2;exports.isDataStoreMethod=V2;exports.isDateDatasource=sI;exports.isEntity=nI;exports.isEntityDatasource=eI;exports.isEntityMethod=J2;exports.isEntitySelection=iI;exports.isEntitySelectionDatasource=tI;exports.isEntitySelectionMethod=Q2;exports.isObjectAttribute=K2;exports.isObjectDatasource=Zg;exports.isRelatedAttribute=Y2;exports.isRelatedEntitiesAttribute=Bg;exports.isRelatedEntityAttribute=zg;exports.isScalarDatasource=Gg;exports.isSimpleAttribute=Hg;exports.isSimpleDatasource=rI;exports.loadDS=uI;exports.log=eF;exports.login=LM;exports.lspSubject=$2;exports.moveItem=GM;exports.outBy=H2;exports.outById=B2;exports.parseAttributes=cI;exports.queue=Wg;exports.removeAttributesString=Xg;exports.removeItem=ZM;exports.renameFile=RM;exports.renameFolder=IM;exports.sanitizeContent=ru;exports.saveContent=YM;exports.setCraftedComponents=zM;exports.setFileContent=xf;exports.setSharedSources=BM;exports.stringifyAttributes=Yg;exports.tabEventsSubject=L2;exports.toastSubject=Pg;exports.trackEvent=tF;exports.transformDates=pI;exports.tryCreateSharedResource=_f;exports.useDidMountEffect=YP;exports.useDoubleClick=b2;exports.useFeatureFlags=v2;exports.useForwardedRef=h2;exports.useHotkeys=c2;exports.useIdentity=g2;exports.useOutsideClick=f2;exports.usePrevious=d2;exports.useStateObject=y2;exports.useStateRef=p2;exports.useTip=rg;exports.validateName=Lg;exports.validateServerSide=k2;exports.validateValue=N2;exports.webformSubject=F2;
207
207
  //# sourceMappingURL=index.cjs.js.map