@abi-software/simulationvuer 3.0.18 → 3.0.19

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.
@@ -79911,8 +79911,16 @@ const Ppe = {
79911
79911
  */
79912
79912
  addExternalData(e, t, r) {
79913
79913
  var n;
79914
- return (n = this.$refs.opencorRef) != null && n.addExternalData ? this.$refs.opencorRef.addExternalData(e, t, r) : Promise.reject(
79915
- new Error("SimulationVuer: OpenCOR instance is not available.")
79914
+ if (!((n = this.$refs.opencorRef) != null && n.addExternalData)) {
79915
+ console.warn(
79916
+ "SimulationVuer: addExternalData: OpenCOR instance is not available."
79917
+ );
79918
+ return;
79919
+ }
79920
+ return this.$refs.opencorRef.addExternalData(
79921
+ e,
79922
+ t,
79923
+ r
79916
79924
  );
79917
79925
  },
79918
79926
  /**
@@ -79995,8 +80003,8 @@ const Ppe = {
79995
80003
  ownerId: n.ownerId,
79996
80004
  data: a
79997
80005
  }
79998
- }), this.$emit("simulationData", e);
79999
- });
80006
+ });
80007
+ }), this.$emit("simulationData", e);
80000
80008
  },
80001
80009
  /**
80002
80010
  * @public
@@ -80393,7 +80401,7 @@ function rme(e, t, r, n, i, o) {
80393
80401
  [d, e.showUserMessage]
80394
80402
  ]);
80395
80403
  }
80396
- const ame = /* @__PURE__ */ cS(Ppe, [["render", rme], ["__scopeId", "data-v-6216d784"]]);
80404
+ const ame = /* @__PURE__ */ cS(Ppe, [["render", rme], ["__scopeId", "data-v-00c5efaf"]]);
80397
80405
  export {
80398
80406
  ame as SimulationVuer
80399
80407
  };
@@ -4791,5 +4791,5 @@ ${Et}`,life:Bo}),Ae==null||Ae.fileIssue(Se),i("file",{type:"issue",filePath:Se,i
4791
4791
  ${er(kt(Ze))}`,life:Bo}),Ae==null||Ae.fileIssue(Se),i("file",{type:"issue",filePath:Se,issues:[er(kt(Ze))]}),null}finally{fe&&(--N.value,k.value=N.value>0)}},xe=he=>{Ne(he).then(async pe=>{var Ge,we;if(pe){if(pe.alreadyOpen){await((Ge=o.value)==null?void 0:Ge.selectFile(pe.filePath));return}pe.file&&await((we=o.value)==null?void 0:we.openFile(pe.file))}})},ue=he=>{he.map(pe=>Ne(pe)).reduce(async(pe,Ge)=>{var Se,fe;await pe;let we=await Ge;if(we){if(we.alreadyOpen){await((Se=o.value)==null?void 0:Se.selectFile(we.filePath,!0));return}we.file&&await((fe=o.value)==null?void 0:fe.openFile(we.file,!0))}},Promise.resolve())},oe=he=>{let pe=he.target;pe.files&&ue(Array.from(pe.files)),pe.value=""},ye=ie.ref(0),Ve=()=>{!P.value||n.omex||++ye.value},et=he=>{var Ge;if(!ye.value)return;ye.value=0;let pe=(Ge=he.dataTransfer)==null?void 0:Ge.files;pe&&ue(Array.from(pe))},Ke=()=>{ye.value&&--ye.value};Ae==null||Ae.onOpen(he=>{xe(he)});let Ye=()=>{var he;n.omex||((he=v.value)==null||he.click())},I=ie.ref(!1);Ae==null||Ae.onOpenRemote(()=>{I.value=!0});let X=()=>{n.omex||(I.value=!0)},me=he=>{xe(he)};Ae==null||Ae.onOpenSampleLorenz(()=>{Be()});let Be=()=>{n.omex||xe("https://github.com/opencor/webapp/raw/refs/heads/main/tests/models/ui/lorenz.omex")};Ae==null||Ae.onClose(()=>{He()});let He=()=>{var he;n.omex||((he=o.value)==null||he.closeCurrentFile())};Ae==null||Ae.onCloseAll(()=>{tt()});let tt=()=>{var he;n.omex||((he=o.value)==null||he.closeAllFiles())},Ee=ie.ref(!1);Ae==null||Ae.onResetAll(()=>{Ee.value=!0});let ke=()=>{Ae==null||Ae.resetAll()};Ae==null||Ae.onSelect(he=>{var pe;(pe=o.value)==null||pe.selectFile(he)}),ie.onMounted(()=>{var pe;let he=(pe=g.value)==null?void 0:pe.$el;setTimeout(()=>{D()},69),setTimeout(()=>{let Ge=document.getElementById(z.value);Ge&&he&&Ge.parentElement!==he&&he.appendChild(Ge)},69)});let qe=null;return ie.onMounted(()=>{M.value&&ie.nextTick(()=>{var Ge,we;let he=(Ge=y.value)==null?void 0:Ge.$el,pe=(we=g.value)==null?void 0:we.$el;he&&pe&&(qe=ane(he,pe,"--main-menu-height"))})}),ie.onBeforeUnmount(()=>{qe&&(qe=(qe(),null))}),n.omex?ie.watch(x,he=>{!he&&n.omex&&xe(n.omex)}):ie.onMounted(()=>{setTimeout(()=>{Ae?Ae.checkForUpdates(!0):ie.watch(x,he=>{if(!he&&window.location.search){let pe=window.location.search.substring(1);window.location.hash&&(pe+=window.location.hash),window.history.replaceState({},document.title,window.location.pathname),pe.startsWith(RC)?V(pe.slice(RC.length)):ne({severity:"error",summary:"Handling an action",detail:`${pe}
4792
4792
 
4793
4793
  The action could not be handled.`,life:Bo})}})},69)}),(he,pe)=>{let Ge=GC,we=qC,Se=Rc,fe=L$,Pe=T$,Ze=x$,vt=y$,Et=v$,ge=p$,De=i$,Fe=WX,Ce=xX;return a.openBlock(),a.createBlock(Bde,{ref_key:"safeBlockUiRef",ref:g,class:a.normalizeClass(["opencor",a.unref(M)?"with-main-menu":""]),blocked:a.unref(R),onClick:D,onFocus:D,onFocusin:D,onKeydown:D,onMousedown:D},{default:a.withCtx(()=>[a.createVNode(Ge,{id:a.unref(z),class:a.normalizeClass(a.unref(A)?"visible":"invisible"),group:a.unref(z),"pt:root:style":{position:"absolute"}},null,8,["id","class","group"]),a.withDirectives(a.createVNode(we,null,null,512),[[a.vShow,a.unref(O)]]),a.unref(w).length?(a.openBlock(),a.createBlock(Se,{key:0,class:"m-4",style:{height:"calc(100% - 2rem)"},issues:a.unref(w)},null,8,["issues"])):(a.openBlock(),a.createElementBlock("div",{key:1,class:"h-full flex flex-col",onDragenter:Ve,onDragover:pe[16]||(pe[16]=a.withModifiers(()=>{},["prevent"])),onDrop:a.withModifiers(et,["prevent"]),onDragleave:Ke},[a.createElementVNode("input",{ref_key:"filesRef",ref:v,type:"file",multiple:"",style:{display:"none"},onChange:oe},null,544),a.createVNode(a.Transition,{"enter-active-class":"transition-opacity duration-200","leave-active-class":"transition-opacity duration-200","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:a.withCtx(()=>[a.unref(ye)?(a.openBlock(),a.createBlock(fe,{key:0})):a.createCommentVNode("",!0)]),_:1}),a.unref(M)?(a.openBlock(),a.createBlock(Hde,{key:0,ref_key:"mainMenuRef",ref:y,isActive:a.unref(A),uiEnabled:a.unref(P),hasFiles:a.unref(J),onAbout:L,onOpen:Ye,onOpenRemote:X,onOpenSampleLorenz:Be,onClose:He,onCloseAll:tt,onSettings:W,onUpdateAvailable:ce},null,8,["isActive","uiEnabled","hasFiles"])):a.createCommentVNode("",!0),a.createVNode(Sde,{ref_key:"contentsRef",ref:o,class:"grow min-h-0",isActive:a.unref(A),uiEnabled:a.unref(P),simulationOnly:!!he.omex,onError:G,onFileClosed:m,onFileOpened:p,onSimulationData:f},null,8,["isActive","uiEnabled","simulationOnly"]),a.withDirectives(a.createVNode(Pe,{message:"Initialising OpenCOR...",progress:lS.value},null,8,["progress"]),[[a.vShow,a.unref(x)]]),a.unref(k)?(a.openBlock(),a.createBlock(Pe,{key:1,message:"Loading model..."})):a.createCommentVNode("",!0),a.withDirectives(a.createVNode(Pe,{message:"Loading external data..."},null,512),[[a.vShow,a.unref(E)]]),a.withDirectives(a.createVNode(Pe,{message:a.unref(U),progress:a.unref(K)},null,8,["message","progress"]),[[a.vShow,a.unref(j)]]),a.createVNode(Ze,{visible:a.unref(ae),"onUpdate:visible":pe[0]||(pe[0]=Oe=>a.isRef(ae)?ae.value=Oe:null),title:a.unref($),message:a.unref(le),onOk:de},null,8,["visible","title","message"]),a.createVNode(vt,{visible:a.unref(ve),"onUpdate:visible":pe[1]||(pe[1]=Oe=>a.isRef(ve)?ve.value=Oe:null),title:"Check for Updates...",question:"Version "+a.unref(Re)+" is available. Do you want to download it and install it?",onYes:Le,onNo:pe[2]||(pe[2]=Oe=>ve.value=!1)},null,8,["visible","question"]),a.createVNode(Et,{visible:a.unref(Te),"onUpdate:visible":pe[3]||(pe[3]=Oe=>a.isRef(Te)?Te.value=Oe:null),percent:a.unref(Ie)},null,8,["visible","percent"]),a.createVNode(Ze,{visible:a.unref(_e),"onUpdate:visible":pe[4]||(pe[4]=Oe=>a.isRef(_e)?_e.value=Oe:null),title:"Check for Updates...",message:"No updates are available at this time.",onOk:pe[5]||(pe[5]=Oe=>_e.value=!1)},null,8,["visible"]),a.createVNode(ge,{visible:a.unref(I),"onUpdate:visible":pe[6]||(pe[6]=Oe=>a.isRef(I)?I.value=Oe:null),onOpenRemote:me,onClose:pe[7]||(pe[7]=Oe=>I.value=!1)},null,8,["visible"]),a.createVNode(De,{visible:a.unref(H),"onUpdate:visible":pe[8]||(pe[8]=Oe=>a.isRef(H)?H.value=Oe:null),onClose:pe[9]||(pe[9]=Oe=>H.value=!1)},null,8,["visible"]),a.createVNode(vt,{visible:a.unref(Ee),"onUpdate:visible":pe[10]||(pe[10]=Oe=>a.isRef(Ee)?Ee.value=Oe:null),title:"Reset All...",question:"You are about to reset all of your settings. Do you want to proceed?",severity:"danger",onYes:ke,onNo:pe[11]||(pe[11]=Oe=>Ee.value=!1)},null,8,["visible"]),a.createVNode(Fe,{visible:a.unref(te),"onUpdate:visible":pe[12]||(pe[12]=Oe=>a.isRef(te)?te.value=Oe:null),onClose:pe[13]||(pe[13]=Oe=>te.value=!1)},null,8,["visible"]),a.createVNode(Ce,{visible:a.unref(ee),"onUpdate:visible":pe[14]||(pe[14]=Oe=>a.isRef(ee)?ee.value=Oe:null),onClose:pe[15]||(pe[15]=Oe=>ee.value=!1)},null,8,["visible"])],32))]),_:1},8,["class","blocked"])}}}),[["__scopeId","data-v-eff67c3c"]]),ar={},Lm=ar.ValidationError=function(t,r,n,i,o,s){if(Array.isArray(i)?(this.path=i,this.property=i.reduce(function(c,l){return c+t4(l)},"instance")):i!==void 0&&(this.property=i),t&&(this.message=t),n){var u=n.$id||n.id;this.schema=u||n}r!==void 0&&(this.instance=r),this.name=o,this.argument=s,this.stack=this.toString()};Lm.prototype.toString=function(){return this.property+" "+this.message};var Xc=ar.ValidatorResult=function(t,r,n,i){this.instance=t,this.schema=r,this.options=n,this.path=i.path,this.propertyPath=i.propertyPath,this.errors=[],this.throwError=n&&n.throwError,this.throwFirst=n&&n.throwFirst,this.throwAll=n&&n.throwAll,this.disableFormat=n&&n.disableFormat===!0};Xc.prototype.addError=function(t){var r;if(typeof t=="string")r=new Lm(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 Lm(t.message,this.instance,this.schema,this.path,t.name,t.argument)}if(this.errors.push(r),this.throwFirst)throw new _a(this);if(this.throwError)throw r;return r},Xc.prototype.importErrors=function(t){typeof t=="string"||t&&t.validatorType?this.addError(t):t&&t.errors&&(this.errors=this.errors.concat(t.errors))};function Gde(e,t){return t+": "+e.toString()+`
4794
- `}Xc.prototype.toString=function(t){return this.errors.map(Gde).join("")},Object.defineProperty(Xc.prototype,"valid",{get:function(){return!this.errors.length}}),ar.ValidatorResultError=_a;function _a(e){typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,_a),this.instance=e.instance,this.schema=e.schema,this.options=e.options,this.errors=e.errors}_a.prototype=new Error,_a.prototype.constructor=_a,_a.prototype.name="Validation Error";var e4=ar.SchemaError=function e(t,r){this.message=t,this.schema=r,Error.call(this,t),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,e)};e4.prototype=Object.create(Error.prototype,{constructor:{value:e4,enumerable:!1},name:{value:"SchemaError",enumerable:!1}});var Vm=ar.SchemaContext=function(t,r,n,i,o){this.schema=t,this.options=r,Array.isArray(n)?(this.path=n,this.propertyPath=n.reduce(function(s,u){return s+t4(u)},"instance")):this.propertyPath=n,this.base=i,this.schemas=o};Vm.prototype.resolve=function(t){return r4(this.base,t)},Vm.prototype.makeChild=function(t,r){var n=r===void 0?this.path:this.path.concat([r]),i=t.$id||t.id;let o=r4(this.base,i||"");var s=new Vm(t,this.options,n,o,Object.create(this.schemas));return i&&!s.schemas[o]&&(s.schemas[o]=t),s};var jn=ar.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]?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[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(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]+$/};jn.regexp=jn.regex,jn.pattern=jn.regex,jn.ipv4=jn["ip-address"],ar.isFormat=function(t,r,n){if(typeof t=="string"&&jn[r]!==void 0){if(jn[r]instanceof RegExp)return jn[r].test(t);if(typeof jn[r]=="function")return jn[r](t)}else if(n&&n.customFormats&&typeof n.customFormats[r]=="function")return n.customFormats[r](t);return!0};var t4=ar.makeSuffix=function(t){return t=t.toString(),!t.match(/[.\s\[\]]/)&&!t.match(/^[\d]/)?"."+t:t.match(/^\d+$/)?"["+t+"]":"["+JSON.stringify(t)+"]"};ar.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(o,s){return e(t[s],r[s])});if(typeof t=="object"){if(!t||!r)return t===r;var n=Object.keys(t),i=Object.keys(r);return n.length!==i.length?!1:n.every(function(o){return e(t[o],r[o])})}return t===r};function Kde(e,t,r,n){typeof r=="object"?t[n]=_m(e[n],r):e.indexOf(r)===-1&&t.push(r)}function Jde(e,t,r){t[r]=e[r]}function Yde(e,t,r,n){typeof t[n]!="object"||!t[n]?r[n]=t[n]:e[n]?r[n]=_m(e[n],t[n]):r[n]=t[n]}function _m(e,t){var r=Array.isArray(t),n=r&&[]||{};return r?(e=e||[],n=n.concat(e),t.forEach(Kde.bind(null,e,n))):(e&&typeof e=="object"&&Object.keys(e).forEach(Jde.bind(null,e,n)),Object.keys(t).forEach(Yde.bind(null,e,t,n))),n}ar.deepMerge=_m,ar.objectGetPath=function(t,r){for(var n=r.split("/").slice(1),i;typeof(i=n.shift())=="string";){var o=decodeURIComponent(i.replace(/~0/,"~").replace(/~1/g,"/"));if(!(o in t))return;t=t[o]}return t};function Xde(e){return"/"+encodeURIComponent(e).replace(/~/g,"%7E")}ar.encodePath=function(t){return t.map(Xde).join("")},ar.getDecimalPlaces=function(t){var r=0;if(isNaN(t))return r;typeof t!="number"&&(t=Number(t));var n=t.toString().split("e");if(n.length===2){if(n[1][0]!=="-")return r;r=Number(n[1].slice(1))}var i=n[0].split(".");return i.length===2&&(r+=i[1].length),r},ar.isSchema=function(t){return typeof t=="object"&&t||typeof t=="boolean"};var r4=ar.resolveUrl=function(t,r){const n=new URL(r,new URL(t,"resolve://"));if(n.protocol==="resolve:"){const{pathname:i,search:o,hash:s}=n;return i+o+s}return n.toString()},an=ar,At=an.ValidatorResult,na=an.SchemaError,zm={};zm.ignoreProperties={id:!0,default:!0,description:!0,title:!0,additionalItems:!0,then:!0,else:!0,$schema:!0,$ref:!0,extends:!0};var Tt=zm.validators={};Tt.type=function(t,r,n,i){if(t===void 0)return null;var o=new At(t,r,n,i),s=Array.isArray(r.type)?r.type:[r.type];if(!s.some(this.testType.bind(this,t,r,n,i))){var u=s.map(function(c){if(c){var l=c.$id||c.id;return l?"<"+l+">":c+""}});o.addError({name:"type",argument:u,message:"is not of a type(s) "+u})}return o};function Um(e,t,r,n,i){var o=t.throwError,s=t.throwAll;t.throwError=!1,t.throwAll=!1;var u=this.validateSchema(e,i,t,r);return t.throwError=o,t.throwAll=s,!u.valid&&n instanceof Function&&n(u),u.valid}Tt.anyOf=function(t,r,n,i){if(t===void 0)return null;var o=new At(t,r,n,i),s=new At(t,r,n,i);if(!Array.isArray(r.anyOf))throw new na("anyOf must be an array");if(!r.anyOf.some(Um.bind(this,t,n,i,function(c){s.importErrors(c)}))){var u=r.anyOf.map(function(c,l){var d=c.$id||c.id;return d?"<"+d+">":c.title&&JSON.stringify(c.title)||c.$ref&&"<"+c.$ref+">"||"[subschema "+l+"]"});n.nestedErrors&&o.importErrors(s),o.addError({name:"anyOf",argument:u,message:"is not any of "+u.join(",")})}return o},Tt.allOf=function(t,r,n,i){if(t===void 0)return null;if(!Array.isArray(r.allOf))throw new na("allOf must be an array");var o=new At(t,r,n,i),s=this;return r.allOf.forEach(function(u,c){var l=s.validateSchema(t,u,n,i);if(!l.valid){var d=u.$id||u.id,f=d||u.title&&JSON.stringify(u.title)||u.$ref&&"<"+u.$ref+">"||"[subschema "+c+"]";o.addError({name:"allOf",argument:{id:f,length:l.errors.length,valid:l},message:"does not match allOf schema "+f+" with "+l.errors.length+" error[s]:"}),o.importErrors(l)}}),o},Tt.oneOf=function(t,r,n,i){if(t===void 0)return null;if(!Array.isArray(r.oneOf))throw new na("oneOf must be an array");var o=new At(t,r,n,i),s=new At(t,r,n,i),u=r.oneOf.filter(Um.bind(this,t,n,i,function(l){s.importErrors(l)})).length,c=r.oneOf.map(function(l,d){var f=l.$id||l.id;return f||l.title&&JSON.stringify(l.title)||l.$ref&&"<"+l.$ref+">"||"[subschema "+d+"]"});return u!==1&&(n.nestedErrors&&o.importErrors(s),o.addError({name:"oneOf",argument:c,message:"is not exactly one from "+c.join(",")})),o},Tt.if=function(t,r,n,i){if(t===void 0)return null;if(!an.isSchema(r.if))throw new Error('Expected "if" keyword to be a schema');var o=Um.call(this,t,n,i,null,r.if),s=new At(t,r,n,i),u;if(o){if(r.then===void 0)return;if(!an.isSchema(r.then))throw new Error('Expected "then" keyword to be a schema');u=this.validateSchema(t,r.then,n,i.makeChild(r.then)),s.importErrors(u)}else{if(r.else===void 0)return;if(!an.isSchema(r.else))throw new Error('Expected "else" keyword to be a schema');u=this.validateSchema(t,r.else,n,i.makeChild(r.else)),s.importErrors(u)}return s};function jm(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]}}Tt.propertyNames=function(t,r,n,i){if(this.types.object(t)){var o=new At(t,r,n,i),s=r.propertyNames!==void 0?r.propertyNames:{};if(!an.isSchema(s))throw new na('Expected "propertyNames" to be a schema (object or boolean)');for(var u in t)if(jm(t,u)!==void 0){var c=this.validateSchema(u,s,n,i.makeChild(s));o.importErrors(c)}return o}},Tt.properties=function(t,r,n,i){if(this.types.object(t)){var o=new At(t,r,n,i),s=r.properties||{};for(var u in s){var c=s[u];if(c!==void 0){if(c===null)throw new na('Unexpected null, expected schema in "properties"');typeof n.preValidateProperty=="function"&&n.preValidateProperty(t,u,c,n,i);var l=jm(t,u),d=this.validateSchema(l,c,n,i.makeChild(c,u));d.instance!==o.instance[u]&&(o.instance[u]=d.instance),o.importErrors(d)}}return o}};function n4(e,t,r,n,i,o){if(this.types.object(e)&&!(t.properties&&t.properties[i]!==void 0))if(t.additionalProperties===!1)o.addError({name:"additionalProperties",argument:i,message:"is not allowed to have the additional property "+JSON.stringify(i)});else{var s=t.additionalProperties||{};typeof r.preValidateProperty=="function"&&r.preValidateProperty(e,i,s,r,n);var u=this.validateSchema(e[i],s,r,n.makeChild(s,i));u.instance!==o.instance[i]&&(o.instance[i]=u.instance),o.importErrors(u)}}Tt.patternProperties=function(t,r,n,i){if(this.types.object(t)){var o=new At(t,r,n,i),s=r.patternProperties||{};for(var u in t){var c=!0;for(var l in s){var d=s[l];if(d!==void 0){if(d===null)throw new na('Unexpected null, expected schema in "patternProperties"');try{var f=new RegExp(l,"u")}catch{f=new RegExp(l)}if(f.test(u)){c=!1,typeof n.preValidateProperty=="function"&&n.preValidateProperty(t,u,d,n,i);var p=this.validateSchema(t[u],d,n,i.makeChild(d,u));p.instance!==o.instance[u]&&(o.instance[u]=p.instance),o.importErrors(p)}}}c&&n4.call(this,t,r,n,i,u,o)}return o}},Tt.additionalProperties=function(t,r,n,i){if(this.types.object(t)){if(r.patternProperties)return null;var o=new At(t,r,n,i);for(var s in t)n4.call(this,t,r,n,i,s,o);return o}},Tt.minProperties=function(t,r,n,i){if(this.types.object(t)){var o=new At(t,r,n,i),s=Object.keys(t);return s.length>=r.minProperties||o.addError({name:"minProperties",argument:r.minProperties,message:"does not meet minimum property length of "+r.minProperties}),o}},Tt.maxProperties=function(t,r,n,i){if(this.types.object(t)){var o=new At(t,r,n,i),s=Object.keys(t);return s.length<=r.maxProperties||o.addError({name:"maxProperties",argument:r.maxProperties,message:"does not meet maximum property length of "+r.maxProperties}),o}},Tt.items=function(t,r,n,i){var o=this;if(this.types.array(t)&&r.items!==void 0){var s=new At(t,r,n,i);return t.every(function(u,c){if(Array.isArray(r.items))var l=r.items[c]===void 0?r.additionalItems:r.items[c];else var l=r.items;if(l===void 0)return!0;if(l===!1)return s.addError({name:"items",message:"additionalItems not permitted"}),!1;var d=o.validateSchema(u,l,n,i.makeChild(l,c));return d.instance!==s.instance[c]&&(s.instance[c]=d.instance),s.importErrors(d),!0}),s}},Tt.contains=function(t,r,n,i){var o=this;if(this.types.array(t)&&r.contains!==void 0){if(!an.isSchema(r.contains))throw new Error('Expected "contains" keyword to be a schema');var s=new At(t,r,n,i),u=t.some(function(c,l){var d=o.validateSchema(c,r.contains,n,i.makeChild(r.contains,l));return d.errors.length===0});return u===!1&&s.addError({name:"contains",argument:r.contains,message:"must contain an item matching given schema"}),s}},Tt.minimum=function(t,r,n,i){if(this.types.number(t)){var o=new At(t,r,n,i);return r.exclusiveMinimum&&r.exclusiveMinimum===!0?t>r.minimum||o.addError({name:"minimum",argument:r.minimum,message:"must be greater than "+r.minimum}):t>=r.minimum||o.addError({name:"minimum",argument:r.minimum,message:"must be greater than or equal to "+r.minimum}),o}},Tt.maximum=function(t,r,n,i){if(this.types.number(t)){var o=new At(t,r,n,i);return r.exclusiveMaximum&&r.exclusiveMaximum===!0?t<r.maximum||o.addError({name:"maximum",argument:r.maximum,message:"must be less than "+r.maximum}):t<=r.maximum||o.addError({name:"maximum",argument:r.maximum,message:"must be less than or equal to "+r.maximum}),o}},Tt.exclusiveMinimum=function(t,r,n,i){if(typeof r.exclusiveMinimum!="boolean"&&this.types.number(t)){var o=new At(t,r,n,i),s=t>r.exclusiveMinimum;return s||o.addError({name:"exclusiveMinimum",argument:r.exclusiveMinimum,message:"must be strictly greater than "+r.exclusiveMinimum}),o}},Tt.exclusiveMaximum=function(t,r,n,i){if(typeof r.exclusiveMaximum!="boolean"&&this.types.number(t)){var o=new At(t,r,n,i),s=t<r.exclusiveMaximum;return s||o.addError({name:"exclusiveMaximum",argument:r.exclusiveMaximum,message:"must be strictly less than "+r.exclusiveMaximum}),o}};var o4=function(t,r,n,i,o,s){if(this.types.number(t)){var u=r[o];if(u==0)throw new na(o+" cannot be zero");var c=new At(t,r,n,i),l=an.getDecimalPlaces(t),d=an.getDecimalPlaces(u),f=Math.max(l,d),p=Math.pow(10,f);return Math.round(t*p)%Math.round(u*p)!==0&&c.addError({name:o,argument:u,message:s+JSON.stringify(u)}),c}};Tt.multipleOf=function(t,r,n,i){return o4.call(this,t,r,n,i,"multipleOf","is not a multiple of (divisible by) ")},Tt.divisibleBy=function(t,r,n,i){return o4.call(this,t,r,n,i,"divisibleBy","is not divisible by (multiple of) ")},Tt.required=function(t,r,n,i){var o=new At(t,r,n,i);return t===void 0&&r.required===!0?o.addError({name:"required",message:"is required"}):this.types.object(t)&&Array.isArray(r.required)&&r.required.forEach(function(s){jm(t,s)===void 0&&o.addError({name:"required",argument:s,message:"requires property "+JSON.stringify(s)})}),o},Tt.pattern=function(t,r,n,i){if(this.types.string(t)){var o=new At(t,r,n,i),s=r.pattern;try{var u=new RegExp(s,"u")}catch{u=new RegExp(s)}return t.match(u)||o.addError({name:"pattern",argument:r.pattern,message:"does not match pattern "+JSON.stringify(r.pattern.toString())}),o}},Tt.format=function(t,r,n,i){if(t!==void 0){var o=new At(t,r,n,i);return!o.disableFormat&&!an.isFormat(t,r.format,this)&&o.addError({name:"format",argument:r.format,message:"does not conform to the "+JSON.stringify(r.format)+" format"}),o}},Tt.minLength=function(t,r,n,i){if(this.types.string(t)){var o=new At(t,r,n,i),s=t.match(/[\uDC00-\uDFFF]/g),u=t.length-(s?s.length:0);return u>=r.minLength||o.addError({name:"minLength",argument:r.minLength,message:"does not meet minimum length of "+r.minLength}),o}},Tt.maxLength=function(t,r,n,i){if(this.types.string(t)){var o=new At(t,r,n,i),s=t.match(/[\uDC00-\uDFFF]/g),u=t.length-(s?s.length:0);return u<=r.maxLength||o.addError({name:"maxLength",argument:r.maxLength,message:"does not meet maximum length of "+r.maxLength}),o}},Tt.minItems=function(t,r,n,i){if(this.types.array(t)){var o=new At(t,r,n,i);return t.length>=r.minItems||o.addError({name:"minItems",argument:r.minItems,message:"does not meet minimum length of "+r.minItems}),o}},Tt.maxItems=function(t,r,n,i){if(this.types.array(t)){var o=new At(t,r,n,i);return t.length<=r.maxItems||o.addError({name:"maxItems",argument:r.maxItems,message:"does not meet maximum length of "+r.maxItems}),o}};function $de(e,t,r){var n,i=r.length;for(n=t+1,i;n<i;n++)if(an.deepCompareStrict(e,r[n]))return!1;return!0}Tt.uniqueItems=function(t,r,n,i){if(r.uniqueItems===!0&&this.types.array(t)){var o=new At(t,r,n,i);return t.every($de)||o.addError({name:"uniqueItems",message:"contains duplicate item"}),o}},Tt.dependencies=function(t,r,n,i){if(this.types.object(t)){var o=new At(t,r,n,i);for(var s in r.dependencies)if(t[s]!==void 0){var u=r.dependencies[s],c=i.makeChild(u,s);if(typeof u=="string"&&(u=[u]),Array.isArray(u))u.forEach(function(d){t[d]===void 0&&o.addError({name:"dependencies",argument:c.propertyPath,message:"property "+d+" not found, required by "+c.propertyPath})});else{var l=this.validateSchema(t,u,n,c);o.instance!==l.instance&&(o.instance=l.instance),l&&l.errors.length&&(o.addError({name:"dependencies",argument:c.propertyPath,message:"does not meet dependency required by "+c.propertyPath}),o.importErrors(l))}}return o}},Tt.enum=function(t,r,n,i){if(t===void 0)return null;if(!Array.isArray(r.enum))throw new na("enum expects an array",r);var o=new At(t,r,n,i);return r.enum.some(an.deepCompareStrict.bind(null,t))||o.addError({name:"enum",argument:r.enum,message:"is not one of enum values: "+r.enum.map(String).join(",")}),o},Tt.const=function(t,r,n,i){if(t===void 0)return null;var o=new At(t,r,n,i);return an.deepCompareStrict(r.const,t)||o.addError({name:"const",argument:r.const,message:"does not exactly match expected constant: "+r.const}),o},Tt.not=Tt.disallow=function(t,r,n,i){var o=this;if(t===void 0)return null;var s=new At(t,r,n,i),u=r.not||r.disallow;return u?(Array.isArray(u)||(u=[u]),u.forEach(function(c){if(o.testType(t,r,n,i,c)){var l=c&&(c.$id||c.id),d=l||c;s.addError({name:"not",argument:d,message:"is of prohibited type "+d})}}),s):null};var efe=zm,Qm={},qm=ar;Qm.SchemaScanResult=a4;function a4(e,t){this.id=e,this.ref=t}Qm.scan=function(t,r){function n(c,l){if(!l||typeof l!="object")return;if(l.$ref){let m=qm.resolveUrl(c,l.$ref);u[m]=u[m]?u[m]+1:0;return}var d=l.$id||l.id;let f=qm.resolveUrl(c,d);var p=d?f:c;if(p){if(p.indexOf("#")<0&&(p+="#"),s[p]){if(!qm.deepCompareStrict(s[p],l))throw new Error("Schema <"+p+"> already exists with different definition");return s[p]}s[p]=l,p[p.length-1]=="#"&&(s[p.substring(0,p.length-1)]=l)}i(p+"/items",Array.isArray(l.items)?l.items:[l.items]),i(p+"/extends",Array.isArray(l.extends)?l.extends:[l.extends]),n(p+"/additionalItems",l.additionalItems),o(p+"/properties",l.properties),n(p+"/additionalProperties",l.additionalProperties),o(p+"/definitions",l.definitions),o(p+"/patternProperties",l.patternProperties),o(p+"/dependencies",l.dependencies),i(p+"/disallow",l.disallow),i(p+"/allOf",l.allOf),i(p+"/anyOf",l.anyOf),i(p+"/oneOf",l.oneOf),n(p+"/not",l.not)}function i(c,l){if(Array.isArray(l))for(var d=0;d<l.length;d++)n(c+"/"+d,l[d])}function o(c,l){if(!(!l||typeof l!="object"))for(var d in l)n(c+"/"+d,l[d])}var s={},u={};return n(t,r),new a4(s,u)};var i4=efe,oa=ar,s4=Qm.scan,l4=oa.ValidatorResult,tfe=oa.ValidatorResultError,Ml=oa.SchemaError,u4=oa.SchemaContext,rfe="/",Br=function e(){this.customFormats=Object.create(e.prototype.customFormats),this.schemas={},this.unresolvedRefs=[],this.types=Object.create(oo),this.attributes=Object.create(i4.validators)};Br.prototype.customFormats={},Br.prototype.schemas=null,Br.prototype.types=null,Br.prototype.attributes=null,Br.prototype.unresolvedRefs=null,Br.prototype.addSchema=function(t,r){var n=this;if(!t)return null;var i=s4(r||rfe,t),o=r||t.$id||t.id;for(var s in i.id)this.schemas[s]=i.id[s];for(var s in i.ref)this.unresolvedRefs.push(s);return this.unresolvedRefs=this.unresolvedRefs.filter(function(u){return typeof n.schemas[u]>"u"}),this.schemas[o]},Br.prototype.addSubSchemaArray=function(t,r){if(Array.isArray(r))for(var n=0;n<r.length;n++)this.addSubSchema(t,r[n])},Br.prototype.addSubSchemaObject=function(t,r){if(!(!r||typeof r!="object"))for(var n in r)this.addSubSchema(t,r[n])},Br.prototype.setSchemas=function(t){this.schemas=t},Br.prototype.getSchema=function(t){return this.schemas[t]},Br.prototype.validate=function(t,r,n,i){if(typeof r!="boolean"&&typeof r!="object"||r===null)throw new Ml("Expected `schema` to be an object or boolean");n||(n={});var o=r.$id||r.id;let s=oa.resolveUrl(n.base,o||"");if(!i){i=new u4(r,n,[],s,Object.create(this.schemas)),i.schemas[s]||(i.schemas[s]=r);var u=s4(s,r);for(var c in u.id){var l=u.id[c];i.schemas[c]=l}}if(n.required&&t===void 0){var d=new l4(t,r,n,i);return d.addError("is required, but is undefined"),d}var d=this.validateSchema(t,r,n,i);if(d){if(n.throwAll&&d.errors.length)throw new tfe(d)}else throw new Error("Result undefined");return d};function c4(e){var t=typeof e=="string"?e:e.$ref;return typeof t=="string"?t:!1}Br.prototype.validateSchema=function(t,r,n,i){var o=new l4(t,r,n,i);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 s={schema:r,ctx:i};r.extends.forEach(this.schemaTraverser.bind(this,s)),r=s.schema,s.schema=null,s.ctx=null,s=null}else r=oa.deepMerge(r,this.superResolve(r.extends,i));var u=c4(r);if(u){var c=this.resolve(r,u,i),l=new u4(c.subschema,n,i.path,c.switchSchema,i.schemas);return this.validateSchema(t,c.subschema,n,l)}var d=n&&n.skipAttributes||[];for(var f in r)if(!i4.ignoreProperties[f]&&d.indexOf(f)<0){var p=null,m=this.attributes[f];if(m)p=m.call(this,t,r,n,i);else if(n.allowUnknownAttributes===!1)throw new Ml("Unsupported attribute: "+f,r);p&&o.importErrors(p)}if(typeof n.rewrite=="function"){var h=n.rewrite.call(this,t,r,n,i);o.instance=h}return o},Br.prototype.schemaTraverser=function(t,r){t.schema=oa.deepMerge(t.schema,this.superResolve(r,t.ctx))},Br.prototype.superResolve=function(t,r){var n=c4(t);return n?this.resolve(t,n,r).subschema:t},Br.prototype.resolve=function(t,r,n){if(r=n.resolve(r),n.schemas[r])return{subschema:n.schemas[r],switchSchema:r};let o=new URL(r,"thismessage::/").hash;var s=o&&o.length&&r.substr(0,r.length-o.length);if(!s||!n.schemas[s])throw new Ml("no such schema <"+r+">",t);var u=oa.objectGetPath(n.schemas[s],o.substr(1));if(u===void 0)throw new Ml("no such schema "+o+" located in <"+s+">",t);return{subschema:u,switchSchema:r}},Br.prototype.testType=function(t,r,n,i,o){if(o!==void 0){if(o===null)throw new Ml('Unexpected null in "type" keyword');if(typeof this.types[o]=="function")return this.types[o].call(this,t);if(o&&typeof o=="object"){var s=this.validateSchema(t,o,n,i);return s===void 0||!(s&&s.errors.length)}return!0}};var oo=Br.prototype.types={};oo.string=function(t){return typeof t=="string"},oo.number=function(t){return typeof t=="number"&&isFinite(t)},oo.integer=function(t){return typeof t=="number"&&t%1===0},oo.boolean=function(t){return typeof t=="boolean"},oo.array=function(t){return Array.isArray(t)},oo.null=function(t){return t===null},oo.date=function(t){return t instanceof Date},oo.any=function(t){return!0},oo.object=function(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof Date)};var nfe=Br,d4;d4=nfe,ar.ValidatorResult,ar.ValidatorResultError,ar.ValidationError,ar.SchemaError;function ofe(e){const t=new d4,r={additionalProperties:!1,properties:{input:{items:{oneOf:[{additionalProperties:!1,properties:{defaultValue:{required:!0,type:"number"},id:{type:"string"},name:{required:!0,type:"string"},possibleValues:{items:{additionalProperties:!1,properties:{name:{required:!0,type:"string"},value:{required:!0,type:"number"}},type:"object"},minItems:1,required:!0,type:"array"},visible:{type:"string"}}},{additionalProperties:!1,properties:{defaultValue:{required:!0,type:"number"},id:{type:"string"},maximumValue:{required:!0,type:"number"},minimumValue:{required:!0,type:"number"},name:{required:!0,type:"string"},stepValue:{type:"number"},visible:{type:"string"}}}],type:"object"},minItems:1,required:!0,type:"array"},output:{additionalProperties:!1,minItems:1,properties:{data:{items:{additionalProperties:!1,properties:{id:{required:!0,type:"string"},name:{required:!0,type:"string"}},type:"object"},minItems:1,required:!0,type:"array"},plots:{items:{additionalProperties:!1,properties:{xAxisTitle:{required:!0,type:"string"},xValue:{required:!0,type:"string"},yAxisTitle:{required:!0,type:"string"},yValue:{required:!0,type:"string"}},type:"object"},maxItems:9,minItems:1,required:!0,type:"array"}},required:!0,type:"object"},parameters:{items:{additionalProperties:!1,properties:{name:{required:!0,type:"string"},value:{required:!0,type:"string"}},type:"object"},type:"array"},simulation:{additionalProperties:!1,properties:{opencor:{additionalProperties:!1,properties:{endingPoint:{type:"number"},pointInterval:{type:"number"},resource:{required:!0,type:"string"}},type:"object"},solvers:{items:{additionalProperties:!1,properties:{if:{type:"string"},input:{additionalProperties:!1,properties:{name:{required:!0,type:"string"},value:{required:!0,type:"string"}},type:"object"},name:{required:!0,type:"string"},version:{required:!0,type:"string"}},type:"object"},minItems:1,required:!0,type:"array"}},required:!0,type:"object"}},type:"object"},n=t.validate(e,r,{nestedErrors:!0});if(!n.valid)return console.warn(`SimulationVuer: JSON: ${n.toString()}`),!1;const i={};if(!e.input.every(d=>{if(d.id!==void 0){if(d.id==="")return console.warn("SimulationVuer: JSON: the input id must not be empty."),!1;if(i[d.id]!==void 0)return console.warn(`SimulationVuer: JSON: the input id must be unique (${d.id} is used more than once).`),!1;i[d.id]=!0}if(d.name==="")return console.warn("SimulationVuer: JSON: the input name must not be empty."),!1;if(d.possibleValues!==void 0){if(!d.possibleValues.every(m=>m.name===""?(console.warn("SimulationVuer: JSON: an input possible value must not be empty."),!1):!0))return!1;const f=d.possibleValues.map(m=>m.value),p={};if(!f.every(m=>p[m]!==void 0?(console.warn(`SimulationVuer: JSON: an input possible value must have a unique value (${m} is used more than once).`),!1):(p[m]=!0,!0)))return!1;if(!f.includes(d.defaultValue))return console.warn(`SimulationVuer: JSON: the input default value (${d.defaultValue}) must be one of the possible values (${f.join(", ")}).`),!1}if(d.minimumValue!==void 0&&d.maximumValue!==void 0){if(d.minimumValue>=d.maximumValue)return console.warn(`SimulationVuer: JSON: the input minimum value (${d.minimumValue}) must be lower than the maximum value (${d.maximumValue}).`),!1;if(d.defaultValue<d.minimumValue||d.defaultValue>d.maximumValue)return console.warn(`SimulationVuer: JSON: the input default value (${d.defaultValue}) must be greater or equal than the minimum value (${d.minimumValue}) and lower or equal than the maximum value (${d.maximumValue}).`),!1;const f=d.maximumValue-d.minimumValue;if(d.stepValue!==void 0){if(d.stepValue<=0||d.stepValue>f)return console.warn(`SimulationVuer: JSON: the input step value (${d.stepValue}) must be greater than zero and lower or equal than the range value (${f}).`),!1;if(!Number.isInteger(f/d.stepValue))return console.warn(`SimulationVuer: JSON: the input step value (${d.stepValue}) must be a factor of the range value (${f}).`),!1}else if(!Number.isInteger(f))return console.warn(`SimulationVuer: JSON: the (default) input step value (1) must be a factor of the range value (${f}).`),!1}return d.visible!==void 0&&d.visible===""?(console.warn("SimulationVuer: JSON: the input visible must not be empty."),!1):!0}))return!1;const s={};if(!e.output.data.every(d=>{if(d.id!==void 0){if(d.id==="")return console.warn("SimulationVuer: JSON: the output data id must not be empty."),!1;if(s[d.id]!==void 0)return console.warn(`SimulationVuer: JSON: the output data id must be unique (${d.id} is used more than once).`),!1;s[d.id]=!0}return d.name===""?(console.warn("SimulationVuer: JSON: the output data name must not be empty."),!1):!0})||!e.output.plots.every(d=>d.xAxisTitle===""?(console.warn("SimulationVuer: JSON: the output plot X axis title must not be empty."),!1):d.xValue===""?(console.warn("SimulationVuer: JSON: the output plot X value must not be empty."),!1):d.yAxisTitle===""?(console.warn("SimulationVuer: JSON: the output plot Y axis title must not be empty."),!1):d.yValue===""?(console.warn("SimulationVuer: JSON: the output plot Y value must not be empty."),!1):!0)||e.parameters!==void 0&&!e.parameters.every(f=>f.name===""?(console.warn("SimulationVuer: JSON: the parameter name must not be empty."),!1):f.value===""?(console.warn("SimulationVuer: JSON: the parameter value must not be empty."),!1):!0))return!1;let l=!1;if(!e.simulation.solvers.every(d=>{if(d.if!==void 0&&d.if==="")return console.warn("SimulationVuer: JSON: a simulation solver if must not be empty."),!1;if(d.input!==void 0){if(d.input.name==="")return console.warn("SimulationVuer: JSON: a simulation solver input name must not be empty."),!1;if(d.input.value==="")return console.warn("SimulationVuer: JSON: a simulation solver input value must not be empty."),!1}return d.name===""?(console.warn("SimulationVuer: JSON: a simulation solver name must not be empty."),!1):(l=l||d.name===B2,d.version===""?(console.warn("SimulationVuer: JSON: a simulation solver version must not be empty."),!1):!0)}))return!1;if(l&&e.simulation.opencor===void 0)return console.warn("SimulationVuer: JSON: the simulation solver for OpenCOR is specified so simulation OpenCOR settings must also be specified."),!1;if(e.simulation.opencor!==void 0){if(e.simulation.opencor.resource==="")return console.warn("SimulationVuer: JSON: the simulation OpenCOR resource must not be empty."),!1;if(e.simulation.opencor.endingPoint!==void 0)if(e.simulation.opencor.pointInterval!==void 0){if(e.simulation.opencor.endingPoint<=0)return console.warn(`SimulationVuer: JSON: the simulation OpenCOR ending point (${e.simulation.opencor.endingPoint}) must be greater than zero.`),!1;if(e.simulation.opencor.pointInterval<=0)return console.warn(`SimulationVuer: JSON: the simulation OpenCOR point interval (${e.simulation.opencor.pointInterval}) must be greater than zero.`),!1}else return console.warn("SimulationVuer: JSON: a simulation OpenCOR ending point is specified so a simulation OpenCOR point interval must also be specified."),!1;else if(e.simulation.opencor.pointInterval!==void 0)return console.warn("SimulationVuer: JSON: a simulation OpenCOR point interval is specified so a simulation OpenCOR ending point must also be specified."),!1}return!0}const f4="https://models.physiomeproject.org/",afe=fp(E2,{}),aa=Object.freeze({DATASET_ID:"dataset_id",DATASET_URL:"dataset_url",PMR_PATH:"pmr_path",RAW_COMBINE_ARCHIVE:"raw_combine_archive"});function ife(e){try{const t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"}catch{return!1}}const sfe={name:"SimulationVuer",components:{PlotVuer:Ua.PlotVuer,SimulationVuerInput:T2,ElButton:mv,ElDivider:vv,OpenCOR:Zde},props:{apiLocation:{required:!0,type:String},id:{required:!0,type:[Number,String,Uint8Array]}},data:function(){let e;if(typeof this.id=="number"?e=aa.DATASET_ID:this.id instanceof Uint8Array?e=aa.RAW_COMBINE_ARCHIVE:ife(this.id)?e=aa.DATASET_URL:e=aa.PMR_PATH,e===aa.DATASET_ID){const t=new XMLHttpRequest;t.open("GET",`${this.apiLocation}/sim/dataset/${this.id}`),t.onreadystatechange=()=>{if(t.readyState===4&&t.status===200){const r=JSON.parse(t.responseText);this.name=r.name,this.uuid=r.study!==void 0?r.study.uuid:void 0}},t.send()}return{errorMessage:"",errorStatus:null,fileManager:void 0,hasFinalisedUi:!1,hasValidSimulationUiInfo:!1,idType:e,instance:void 0,isMounted:!1,isSimulationValid:!0,layout:[],model:void 0,name:null,opencorBasedSimulation:!0,opencorOmexFile:null,output:void 0,perfectScollbarOptions:{suppressScrollX:!0},showUserMessage:!1,simulationResults:{},simulationResultsId:{},simulationUiInfo:{},solver:void 0,userMessage:"",ui:null,uuid:null,activeSubscriptions:[]}},methods:{addDataSubscription(e){var c,l,d,f;if(!e||typeof e!="object"){console.warn("SimulationVuer: addDataSubscription: subscription must be an object.");return}const t="nz.ac.auckland.simulation-data-request",r=0;if(e.id!==t){console.warn(`SimulationVuer: addDataSubscription: invalid ID (expected '${t}' but got '${e.id}').`);return}if(typeof e.version!="string"){console.warn(`SimulationVuer: addDataSubscription: missing or non-string version ('${e.version}').`);return}const n=e.version.split(".");if(n.length<1||!/^[0-9]+$/.test(n[0])){console.warn(`SimulationVuer: addDataSubscription: malformed version ('${e.version}').`);return}const i=parseInt(n[0],10);if(Number.isNaN(i)){console.warn(`SimulationVuer: addDataSubscription: could not parse the major version from ('${e.version}')`);return}if(i!==r){console.warn(`SimulationVuer: addDataSubscription: version mismatch (expected v${r}.y.z but got v${e.version}).`);return}const o=e.payload||{},s=[];if(o.windowId==null&&s.push("windowId"),o.ownerId==null&&s.push("ownerId"),o.component||s.push("component"),o.variable||s.push("variable"),s.length){console.warn(`SimulationVuer: addDataSubscription: payload missing fields: ${s.join(", ")}.`);return}this.activeSubscriptions.push(o);const u=[];(c=e.payload)!=null&&c.withVOI&&u.push("VOI"),u.push(`${(l=e.payload)==null?void 0:l.component}/${(d=e.payload)==null?void 0:d.variable}`),(f=this.$refs.opencorRef)==null||f.trackSimulationData(u)},addExternalData(e,t,r){var n;return(n=this.$refs.opencorRef)!=null&&n.addExternalData?this.$refs.opencorRef.addExternalData(e,t,r):Promise.reject(new Error("SimulationVuer: OpenCOR instance is not available."))},removeDataSubscription(e){var i;const t=this.activeSubscriptions.find(o=>o.windowId===e);if(!t){console.warn(`SimulationVuer: removeDataSubscription: no active subscription found for id ${e}.`);return}const r=this.activeSubscriptions.some(o=>o.windowId!==e&&o.withVOI),n=this.activeSubscriptions.some(o=>o.windowId!==e&&o.component===t.component&&o.variable===t.variable);if(!r||!n){const o=[];t.withVOI&&!r&&o.push("VOI"),n||o.push(`${t.component}/${t.variable}`),o.length&&((i=this.$refs.opencorRef)==null||i.untrackSimulationData(o))}this.activeSubscriptions=this.activeSubscriptions.filter(o=>o.windowId!==e)},onExternalData(e){this.$emit("externalData",e)},onFile(e){this.$emit("file",e)},onSimulationData(e){const t=e.simulationData||{};let r;this.activeSubscriptions.forEach(n=>{const i=`${n.component}/${n.variable}`,o=t[i];if(o==null){console.warn(`SimulationVuer: onSimulationData: no data for ${i}.`);return}const s={y:o.data,title:`${n.component}.${n.variable} (${o.unit})`};if(n.withVOI)if(t.VOI==null){console.warn("SimulationVuer: onSimulationData: no data for VOI.");return}else r??(r=t.VOI),s.x=r;this.$emit("data-notification",{id:"nz.ac.auckland.simulation-data-response",version:"0.1.0",payload:{windowId:n.windowId,ownerId:n.ownerId,data:s}}),this.$emit("simulationData",e)})},plotMetadata(e){return{version:"1.1.0",type:"plot",attrs:{style:"timeseries",layout:this.layout[e]}}},buildSimulationUi(e){if(this.simulationUiInfo=e,this.hasValidSimulationUiInfo=ofe(this.simulationUiInfo),!this.hasValidSimulationUiInfo){this.errorMessage="the simulation.json file is malformed";return}if(this.simulationUiInfo.simulation.solvers.forEach(r=>{(r.if===void 0||pp(this,r.if))&&(this.solver=r)}),this.solver===void 0){this.hasValidSimulationUiInfo=!1,this.errorMessage="no solver name and/or solver version specified";return}this.opencorBasedSimulation=this.solver.name===B2,this.simulationUiInfo.output.data.forEach(r=>{this.simulationResultsId[r.id]=r.name});let t=-1;this.simulationUiInfo.output.plots.forEach(r=>{++t,this.layout[t]={paper_bgcolor:"rgba(0, 0, 0, 0)",plot_bgcolor:"rgba(0, 0, 0, 0)",autosize:!0,margin:{t:25,l:55,r:25,b:30,pad:4},loading:!1,options:{responsive:!0,scrollZoom:!0},dragmode:"pan",xaxis:{title:{text:r.xAxisTitle,font:{size:10}}},yaxis:{title:{text:r.yAxisTitle,font:{size:10}}}}}),this.$nextTick(()=>{M2(this)})},openUrl(e){const t=document.createElement("a");t.href=e,t.target="_blank",t.rel="noopener noreferrer",t.style.display="none",document.body.appendChild(t),t.click(),document.body.removeChild(t)},runOnOsparc(){this.openUrl(`https://osparc.io/study/${this.uuid}`)},viewDataset(){this.openUrl(`https://sparc.science/datasets/${this.id}?type=dataset`)},viewWorkspace(){const e=f4+this.id;this.openUrl(e.substring(0,e.lastIndexOf("/")))},parametersData(){const e={};return this.simulationUiInfo.parameters.forEach(t=>{e[t.name]=pp(this,t.value)}),e},outputData(){return this.output===void 0&&this.simulationUiInfo.output.data!==void 0&&(this.output=[],this.simulationUiInfo.output.data.forEach(e=>{this.output.push(e.name)})),this.output},retrieveRequest(){const e={solver:this.solver};if(this.opencorBasedSimulation){e.opencor={model_url:this.simulationUiInfo.simulation.opencor.resource,json_config:{}},this.simulationUiInfo.simulation.opencor.endingPoint!==void 0&&this.simulationUiInfo.simulation.opencor.pointInterval!==void 0&&(e.opencor.json_config.simulation={"Ending point":this.simulationUiInfo.simulation.opencor.endingPoint,"Point interval":this.simulationUiInfo.simulation.opencor.pointInterval}),e.opencor.json_config.parameters=this.parametersData();const t=this.outputData();t!==void 0&&(e.opencor.json_config.output=t)}else e.osparc={},e.osparc.job_inputs=this.parametersData();return e},processSimulationResults(e){if(typeof e=="string"){const n=/[ \t]+/g,i=e.trim().split(`
4795
- `),o=i[0].trim().split(n).length;e={};for(let u=0;u<o;++u)e[u]=[];let s=-1;i.forEach(u=>{++s;let c=-1;u.trim().split(n).forEach(d=>{e[++c][s]=Number(d)})})}const t=new afe.parser;Object.keys(this.simulationResultsId).forEach(n=>{t.set(n,e[this.simulationResultsId[n]])});let r=-1;this.simulationUiInfo.output.plots.forEach(n=>{this.simulationResults[++r]=[{x:t.evaluate(n.xValue),y:t.evaluate(n.yValue),type:"scatter"}]})},showHttpIssue(e){this.isSimulationValid=!1,this.showUserMessage=!1,this.errorMessage=e.statusText.toLowerCase(),this.errorStatus=e.status},checkSimulation(e){const t=new XMLHttpRequest;t.open("POST",`${this.apiLocation}/check_simulation`),t.setRequestHeader("Content-type","application/json"),t.onreadystatechange=()=>{if(t.readyState===4)if(t.status===200){let r=JSON.parse(t.responseText);if(this.isSimulationValid=r.status==="ok",this.isSimulationValid)if(r.results!==void 0)this.showUserMessage=!1,this.processSimulationResults(r.results);else{let n=this;setTimeout(()=>{n.checkSimulation(e)},1e3)}else this.showUserMessage=!1,this.errorMessage=r.description,this.errorStatus=null}else this.showHttpIssue(t)},t.send(JSON.stringify(e))},startSimulation(){this.userMessage="Loading simulation results...",this.showUserMessage=!0,this.$nextTick(()=>{this.simulationResults={};const e=new XMLHttpRequest;e.open("POST",`${this.apiLocation}/start_simulation`),e.setRequestHeader("Content-type","application/json"),e.onreadystatechange=()=>{if(e.readyState===4)if(e.status===200){let t=JSON.parse(e.responseText);this.isSimulationValid=t.status==="ok",this.isSimulationValid?this.checkSimulation(t.data):(this.showUserMessage=!1,this.errorMessage=t.description,this.errorStatus=null)}else this.showHttpIssue(e)},e.send(JSON.stringify(this.retrieveRequest()))})}},created:function(){this.idType===aa.DATASET_ID?(this.userMessage="Retrieving UI information...",this.showUserMessage=!0,this.$nextTick(()=>{const e=new XMLHttpRequest;e.open("GET",`${this.apiLocation}/simulation_ui_file/${this.id}`),e.onreadystatechange=()=>{e.readyState===4&&(this.showUserMessage=!1,e.status===200?this.$nextTick(()=>{this.buildSimulationUi(JSON.parse(e.responseText))}):(this.errorMessage="the simulation dataset could not be retrieved",this.errorStatus=null))},e.send()})):this.idType===aa.DATASET_URL?this.opencorOmexFile=this.id:this.idType===aa.PMR_PATH?this.opencorOmexFile=`${f4}${this.id}`:this.opencorOmexFile=this.id},mounted:function(){this.isMounted=!0,M2(this)}},lfe=["element-loading-text"],ufe={key:0,class:"container"},cfe={key:0,class:"default error"},dfe={key:1,class:"main"},ffe={class:"default name"},pfe={class:"input scrollbar"},mfe={class:"buttons-container"},hfe={class:"primary-button"},gfe={key:0,class:"secondary-button"},vfe={class:"secondary-button"},bfe={key:1,class:"default note"},yfe={class:"main-right",ref:"output"},wfe={class:"main-right"},xfe={class:"default error"},Cfe={key:0},Sfe=["href"],Nfe={key:1,class:"opencor"};function kfe(e,t,r,n,i,o){const s=vv,u=T2,c=mv,l=a.resolveComponent("PlotVuer"),d=a.resolveComponent("OpenCOR"),f=RA;return a.withDirectives((a.openBlock(),a.createElementBlock("div",{class:"simulation-vuer","element-loading-text":e.userMessage},[e.opencorOmexFile===null?(a.openBlock(),a.createElementBlock("div",ufe,[!e.hasValidSimulationUiInfo&&!e.showUserMessage?(a.openBlock(),a.createElementBlock("p",cfe,[t[6]||(t[6]=a.createElementVNode("span",{class:"error"},"Error:",-1)),a.createTextVNode(" "+a.toDisplayString(e.errorMessage)+". ",1)])):a.createCommentVNode("",!0),e.hasValidSimulationUiInfo?(a.openBlock(),a.createElementBlock("div",dfe,[a.createElementVNode("div",{class:a.normalizeClass(["main-left",{"with-buttons":e.uuid}])},[a.createElementVNode("p",ffe,a.toDisplayString(e.name),1),a.createVNode(s),t[10]||(t[10]=a.createElementVNode("p",{class:"default input-parameters"},"Input parameters",-1)),a.createElementVNode("div",pfe,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.simulationUiInfo.input,(p,m)=>(a.openBlock(),a.createBlock(u,{ref_for:!0,ref:"simInput",defaultValue:p.defaultValue,key:`input-${m}`,name:p.name,maximumValue:p.maximumValue,minimumValue:p.minimumValue,possibleValues:p.possibleValues,stepValue:p.stepValue},null,8,["defaultValue","name","maximumValue","minimumValue","possibleValues","stepValue"]))),128))]),a.createElementVNode("div",mfe,[a.createElementVNode("div",hfe,[a.createVNode(c,{type:"primary",size:"small",onClick:t[0]||(t[0]=p=>o.startSimulation())},{default:a.withCtx(()=>[...t[7]||(t[7]=[a.createTextVNode("Run Simulation",-1)])]),_:1})]),e.uuid?(a.openBlock(),a.createElementBlock("div",gfe,[a.createVNode(c,{size:"small",onClick:t[1]||(t[1]=p=>o.runOnOsparc())},{default:a.withCtx(()=>[...t[8]||(t[8]=[a.createTextVNode("Run on oSPARC",-1)])]),_:1})])):a.createCommentVNode("",!0),a.createElementVNode("div",vfe,[a.createVNode(c,{size:"small",onClick:t[2]||(t[2]=p=>o.viewDataset())},{default:a.withCtx(()=>[...t[9]||(t[9]=[a.createTextVNode("View Dataset",-1)])]),_:1})]),e.uuid?(a.openBlock(),a.createElementBlock("p",bfe," Additional parameters are available on oSPARC ")):a.createCommentVNode("",!0)])],2),a.withDirectives(a.createElementVNode("div",yfe,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.simulationUiInfo.output.plots,(p,m)=>(a.openBlock(),a.createBlock(l,{key:`output-${m}`,metadata:o.plotMetadata(m),"data-source":{data:e.simulationResults[m]},plotLayout:e.layout[m],plotType:"plotly-only",selectorUi:!1},null,8,["metadata","data-source","plotLayout"]))),128))],512),[[a.vShow,e.isSimulationValid]]),a.withDirectives(a.createElementVNode("div",wfe,[a.createElementVNode("p",xfe,[t[13]||(t[13]=a.createElementVNode("span",{class:"error"},"Error:",-1)),a.createTextVNode(" "+a.toDisplayString(e.errorMessage)+" ",1),e.errorStatus?(a.openBlock(),a.createElementBlock("span",Cfe,[t[11]||(t[11]=a.createTextVNode(" (",-1)),a.createElementVNode("a",{href:`https://httpstatuses.com/${e.errorStatus}`,target:"_blank",rel:"noopener noreferrer"},a.toDisplayString(e.errorStatus),9,Sfe),t[12]||(t[12]=a.createTextVNode(") ",-1))])):a.createCommentVNode("",!0),t[14]||(t[14]=a.createTextVNode(". ",-1))])],512),[[a.vShow,!e.isSimulationValid]])])):a.createCommentVNode("",!0)])):(a.openBlock(),a.createElementBlock("div",Nfe,[a.createVNode(d,{ref:"opencorRef",omex:e.opencorOmexFile,theme:"light",onExternalData:t[3]||(t[3]=p=>o.onExternalData(p)),onFile:t[4]||(t[4]=p=>o.onFile(p)),onSimulationData:t[5]||(t[5]=p=>o.onSimulationData(p))},null,8,["omex"])]))],8,lfe)),[[f,e.showUserMessage]])}const Efe=A2(sfe,[["render",kfe],["__scopeId","data-v-6216d784"]]);nr.SimulationVuer=Efe,Object.defineProperty(nr,Symbol.toStringTag,{value:"Module"})});
4794
+ `}Xc.prototype.toString=function(t){return this.errors.map(Gde).join("")},Object.defineProperty(Xc.prototype,"valid",{get:function(){return!this.errors.length}}),ar.ValidatorResultError=_a;function _a(e){typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,_a),this.instance=e.instance,this.schema=e.schema,this.options=e.options,this.errors=e.errors}_a.prototype=new Error,_a.prototype.constructor=_a,_a.prototype.name="Validation Error";var e4=ar.SchemaError=function e(t,r){this.message=t,this.schema=r,Error.call(this,t),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,e)};e4.prototype=Object.create(Error.prototype,{constructor:{value:e4,enumerable:!1},name:{value:"SchemaError",enumerable:!1}});var Vm=ar.SchemaContext=function(t,r,n,i,o){this.schema=t,this.options=r,Array.isArray(n)?(this.path=n,this.propertyPath=n.reduce(function(s,u){return s+t4(u)},"instance")):this.propertyPath=n,this.base=i,this.schemas=o};Vm.prototype.resolve=function(t){return r4(this.base,t)},Vm.prototype.makeChild=function(t,r){var n=r===void 0?this.path:this.path.concat([r]),i=t.$id||t.id;let o=r4(this.base,i||"");var s=new Vm(t,this.options,n,o,Object.create(this.schemas));return i&&!s.schemas[o]&&(s.schemas[o]=t),s};var jn=ar.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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\])?)?|[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(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]+$/};jn.regexp=jn.regex,jn.pattern=jn.regex,jn.ipv4=jn["ip-address"],ar.isFormat=function(t,r,n){if(typeof t=="string"&&jn[r]!==void 0){if(jn[r]instanceof RegExp)return jn[r].test(t);if(typeof jn[r]=="function")return jn[r](t)}else if(n&&n.customFormats&&typeof n.customFormats[r]=="function")return n.customFormats[r](t);return!0};var t4=ar.makeSuffix=function(t){return t=t.toString(),!t.match(/[.\s\[\]]/)&&!t.match(/^[\d]/)?"."+t:t.match(/^\d+$/)?"["+t+"]":"["+JSON.stringify(t)+"]"};ar.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(o,s){return e(t[s],r[s])});if(typeof t=="object"){if(!t||!r)return t===r;var n=Object.keys(t),i=Object.keys(r);return n.length!==i.length?!1:n.every(function(o){return e(t[o],r[o])})}return t===r};function Kde(e,t,r,n){typeof r=="object"?t[n]=_m(e[n],r):e.indexOf(r)===-1&&t.push(r)}function Jde(e,t,r){t[r]=e[r]}function Yde(e,t,r,n){typeof t[n]!="object"||!t[n]?r[n]=t[n]:e[n]?r[n]=_m(e[n],t[n]):r[n]=t[n]}function _m(e,t){var r=Array.isArray(t),n=r&&[]||{};return r?(e=e||[],n=n.concat(e),t.forEach(Kde.bind(null,e,n))):(e&&typeof e=="object"&&Object.keys(e).forEach(Jde.bind(null,e,n)),Object.keys(t).forEach(Yde.bind(null,e,t,n))),n}ar.deepMerge=_m,ar.objectGetPath=function(t,r){for(var n=r.split("/").slice(1),i;typeof(i=n.shift())=="string";){var o=decodeURIComponent(i.replace(/~0/,"~").replace(/~1/g,"/"));if(!(o in t))return;t=t[o]}return t};function Xde(e){return"/"+encodeURIComponent(e).replace(/~/g,"%7E")}ar.encodePath=function(t){return t.map(Xde).join("")},ar.getDecimalPlaces=function(t){var r=0;if(isNaN(t))return r;typeof t!="number"&&(t=Number(t));var n=t.toString().split("e");if(n.length===2){if(n[1][0]!=="-")return r;r=Number(n[1].slice(1))}var i=n[0].split(".");return i.length===2&&(r+=i[1].length),r},ar.isSchema=function(t){return typeof t=="object"&&t||typeof t=="boolean"};var r4=ar.resolveUrl=function(t,r){const n=new URL(r,new URL(t,"resolve://"));if(n.protocol==="resolve:"){const{pathname:i,search:o,hash:s}=n;return i+o+s}return n.toString()},an=ar,At=an.ValidatorResult,na=an.SchemaError,zm={};zm.ignoreProperties={id:!0,default:!0,description:!0,title:!0,additionalItems:!0,then:!0,else:!0,$schema:!0,$ref:!0,extends:!0};var Tt=zm.validators={};Tt.type=function(t,r,n,i){if(t===void 0)return null;var o=new At(t,r,n,i),s=Array.isArray(r.type)?r.type:[r.type];if(!s.some(this.testType.bind(this,t,r,n,i))){var u=s.map(function(c){if(c){var l=c.$id||c.id;return l?"<"+l+">":c+""}});o.addError({name:"type",argument:u,message:"is not of a type(s) "+u})}return o};function Um(e,t,r,n,i){var o=t.throwError,s=t.throwAll;t.throwError=!1,t.throwAll=!1;var u=this.validateSchema(e,i,t,r);return t.throwError=o,t.throwAll=s,!u.valid&&n instanceof Function&&n(u),u.valid}Tt.anyOf=function(t,r,n,i){if(t===void 0)return null;var o=new At(t,r,n,i),s=new At(t,r,n,i);if(!Array.isArray(r.anyOf))throw new na("anyOf must be an array");if(!r.anyOf.some(Um.bind(this,t,n,i,function(c){s.importErrors(c)}))){var u=r.anyOf.map(function(c,l){var d=c.$id||c.id;return d?"<"+d+">":c.title&&JSON.stringify(c.title)||c.$ref&&"<"+c.$ref+">"||"[subschema "+l+"]"});n.nestedErrors&&o.importErrors(s),o.addError({name:"anyOf",argument:u,message:"is not any of "+u.join(",")})}return o},Tt.allOf=function(t,r,n,i){if(t===void 0)return null;if(!Array.isArray(r.allOf))throw new na("allOf must be an array");var o=new At(t,r,n,i),s=this;return r.allOf.forEach(function(u,c){var l=s.validateSchema(t,u,n,i);if(!l.valid){var d=u.$id||u.id,f=d||u.title&&JSON.stringify(u.title)||u.$ref&&"<"+u.$ref+">"||"[subschema "+c+"]";o.addError({name:"allOf",argument:{id:f,length:l.errors.length,valid:l},message:"does not match allOf schema "+f+" with "+l.errors.length+" error[s]:"}),o.importErrors(l)}}),o},Tt.oneOf=function(t,r,n,i){if(t===void 0)return null;if(!Array.isArray(r.oneOf))throw new na("oneOf must be an array");var o=new At(t,r,n,i),s=new At(t,r,n,i),u=r.oneOf.filter(Um.bind(this,t,n,i,function(l){s.importErrors(l)})).length,c=r.oneOf.map(function(l,d){var f=l.$id||l.id;return f||l.title&&JSON.stringify(l.title)||l.$ref&&"<"+l.$ref+">"||"[subschema "+d+"]"});return u!==1&&(n.nestedErrors&&o.importErrors(s),o.addError({name:"oneOf",argument:c,message:"is not exactly one from "+c.join(",")})),o},Tt.if=function(t,r,n,i){if(t===void 0)return null;if(!an.isSchema(r.if))throw new Error('Expected "if" keyword to be a schema');var o=Um.call(this,t,n,i,null,r.if),s=new At(t,r,n,i),u;if(o){if(r.then===void 0)return;if(!an.isSchema(r.then))throw new Error('Expected "then" keyword to be a schema');u=this.validateSchema(t,r.then,n,i.makeChild(r.then)),s.importErrors(u)}else{if(r.else===void 0)return;if(!an.isSchema(r.else))throw new Error('Expected "else" keyword to be a schema');u=this.validateSchema(t,r.else,n,i.makeChild(r.else)),s.importErrors(u)}return s};function jm(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]}}Tt.propertyNames=function(t,r,n,i){if(this.types.object(t)){var o=new At(t,r,n,i),s=r.propertyNames!==void 0?r.propertyNames:{};if(!an.isSchema(s))throw new na('Expected "propertyNames" to be a schema (object or boolean)');for(var u in t)if(jm(t,u)!==void 0){var c=this.validateSchema(u,s,n,i.makeChild(s));o.importErrors(c)}return o}},Tt.properties=function(t,r,n,i){if(this.types.object(t)){var o=new At(t,r,n,i),s=r.properties||{};for(var u in s){var c=s[u];if(c!==void 0){if(c===null)throw new na('Unexpected null, expected schema in "properties"');typeof n.preValidateProperty=="function"&&n.preValidateProperty(t,u,c,n,i);var l=jm(t,u),d=this.validateSchema(l,c,n,i.makeChild(c,u));d.instance!==o.instance[u]&&(o.instance[u]=d.instance),o.importErrors(d)}}return o}};function n4(e,t,r,n,i,o){if(this.types.object(e)&&!(t.properties&&t.properties[i]!==void 0))if(t.additionalProperties===!1)o.addError({name:"additionalProperties",argument:i,message:"is not allowed to have the additional property "+JSON.stringify(i)});else{var s=t.additionalProperties||{};typeof r.preValidateProperty=="function"&&r.preValidateProperty(e,i,s,r,n);var u=this.validateSchema(e[i],s,r,n.makeChild(s,i));u.instance!==o.instance[i]&&(o.instance[i]=u.instance),o.importErrors(u)}}Tt.patternProperties=function(t,r,n,i){if(this.types.object(t)){var o=new At(t,r,n,i),s=r.patternProperties||{};for(var u in t){var c=!0;for(var l in s){var d=s[l];if(d!==void 0){if(d===null)throw new na('Unexpected null, expected schema in "patternProperties"');try{var f=new RegExp(l,"u")}catch{f=new RegExp(l)}if(f.test(u)){c=!1,typeof n.preValidateProperty=="function"&&n.preValidateProperty(t,u,d,n,i);var p=this.validateSchema(t[u],d,n,i.makeChild(d,u));p.instance!==o.instance[u]&&(o.instance[u]=p.instance),o.importErrors(p)}}}c&&n4.call(this,t,r,n,i,u,o)}return o}},Tt.additionalProperties=function(t,r,n,i){if(this.types.object(t)){if(r.patternProperties)return null;var o=new At(t,r,n,i);for(var s in t)n4.call(this,t,r,n,i,s,o);return o}},Tt.minProperties=function(t,r,n,i){if(this.types.object(t)){var o=new At(t,r,n,i),s=Object.keys(t);return s.length>=r.minProperties||o.addError({name:"minProperties",argument:r.minProperties,message:"does not meet minimum property length of "+r.minProperties}),o}},Tt.maxProperties=function(t,r,n,i){if(this.types.object(t)){var o=new At(t,r,n,i),s=Object.keys(t);return s.length<=r.maxProperties||o.addError({name:"maxProperties",argument:r.maxProperties,message:"does not meet maximum property length of "+r.maxProperties}),o}},Tt.items=function(t,r,n,i){var o=this;if(this.types.array(t)&&r.items!==void 0){var s=new At(t,r,n,i);return t.every(function(u,c){if(Array.isArray(r.items))var l=r.items[c]===void 0?r.additionalItems:r.items[c];else var l=r.items;if(l===void 0)return!0;if(l===!1)return s.addError({name:"items",message:"additionalItems not permitted"}),!1;var d=o.validateSchema(u,l,n,i.makeChild(l,c));return d.instance!==s.instance[c]&&(s.instance[c]=d.instance),s.importErrors(d),!0}),s}},Tt.contains=function(t,r,n,i){var o=this;if(this.types.array(t)&&r.contains!==void 0){if(!an.isSchema(r.contains))throw new Error('Expected "contains" keyword to be a schema');var s=new At(t,r,n,i),u=t.some(function(c,l){var d=o.validateSchema(c,r.contains,n,i.makeChild(r.contains,l));return d.errors.length===0});return u===!1&&s.addError({name:"contains",argument:r.contains,message:"must contain an item matching given schema"}),s}},Tt.minimum=function(t,r,n,i){if(this.types.number(t)){var o=new At(t,r,n,i);return r.exclusiveMinimum&&r.exclusiveMinimum===!0?t>r.minimum||o.addError({name:"minimum",argument:r.minimum,message:"must be greater than "+r.minimum}):t>=r.minimum||o.addError({name:"minimum",argument:r.minimum,message:"must be greater than or equal to "+r.minimum}),o}},Tt.maximum=function(t,r,n,i){if(this.types.number(t)){var o=new At(t,r,n,i);return r.exclusiveMaximum&&r.exclusiveMaximum===!0?t<r.maximum||o.addError({name:"maximum",argument:r.maximum,message:"must be less than "+r.maximum}):t<=r.maximum||o.addError({name:"maximum",argument:r.maximum,message:"must be less than or equal to "+r.maximum}),o}},Tt.exclusiveMinimum=function(t,r,n,i){if(typeof r.exclusiveMinimum!="boolean"&&this.types.number(t)){var o=new At(t,r,n,i),s=t>r.exclusiveMinimum;return s||o.addError({name:"exclusiveMinimum",argument:r.exclusiveMinimum,message:"must be strictly greater than "+r.exclusiveMinimum}),o}},Tt.exclusiveMaximum=function(t,r,n,i){if(typeof r.exclusiveMaximum!="boolean"&&this.types.number(t)){var o=new At(t,r,n,i),s=t<r.exclusiveMaximum;return s||o.addError({name:"exclusiveMaximum",argument:r.exclusiveMaximum,message:"must be strictly less than "+r.exclusiveMaximum}),o}};var o4=function(t,r,n,i,o,s){if(this.types.number(t)){var u=r[o];if(u==0)throw new na(o+" cannot be zero");var c=new At(t,r,n,i),l=an.getDecimalPlaces(t),d=an.getDecimalPlaces(u),f=Math.max(l,d),p=Math.pow(10,f);return Math.round(t*p)%Math.round(u*p)!==0&&c.addError({name:o,argument:u,message:s+JSON.stringify(u)}),c}};Tt.multipleOf=function(t,r,n,i){return o4.call(this,t,r,n,i,"multipleOf","is not a multiple of (divisible by) ")},Tt.divisibleBy=function(t,r,n,i){return o4.call(this,t,r,n,i,"divisibleBy","is not divisible by (multiple of) ")},Tt.required=function(t,r,n,i){var o=new At(t,r,n,i);return t===void 0&&r.required===!0?o.addError({name:"required",message:"is required"}):this.types.object(t)&&Array.isArray(r.required)&&r.required.forEach(function(s){jm(t,s)===void 0&&o.addError({name:"required",argument:s,message:"requires property "+JSON.stringify(s)})}),o},Tt.pattern=function(t,r,n,i){if(this.types.string(t)){var o=new At(t,r,n,i),s=r.pattern;try{var u=new RegExp(s,"u")}catch{u=new RegExp(s)}return t.match(u)||o.addError({name:"pattern",argument:r.pattern,message:"does not match pattern "+JSON.stringify(r.pattern.toString())}),o}},Tt.format=function(t,r,n,i){if(t!==void 0){var o=new At(t,r,n,i);return!o.disableFormat&&!an.isFormat(t,r.format,this)&&o.addError({name:"format",argument:r.format,message:"does not conform to the "+JSON.stringify(r.format)+" format"}),o}},Tt.minLength=function(t,r,n,i){if(this.types.string(t)){var o=new At(t,r,n,i),s=t.match(/[\uDC00-\uDFFF]/g),u=t.length-(s?s.length:0);return u>=r.minLength||o.addError({name:"minLength",argument:r.minLength,message:"does not meet minimum length of "+r.minLength}),o}},Tt.maxLength=function(t,r,n,i){if(this.types.string(t)){var o=new At(t,r,n,i),s=t.match(/[\uDC00-\uDFFF]/g),u=t.length-(s?s.length:0);return u<=r.maxLength||o.addError({name:"maxLength",argument:r.maxLength,message:"does not meet maximum length of "+r.maxLength}),o}},Tt.minItems=function(t,r,n,i){if(this.types.array(t)){var o=new At(t,r,n,i);return t.length>=r.minItems||o.addError({name:"minItems",argument:r.minItems,message:"does not meet minimum length of "+r.minItems}),o}},Tt.maxItems=function(t,r,n,i){if(this.types.array(t)){var o=new At(t,r,n,i);return t.length<=r.maxItems||o.addError({name:"maxItems",argument:r.maxItems,message:"does not meet maximum length of "+r.maxItems}),o}};function $de(e,t,r){var n,i=r.length;for(n=t+1,i;n<i;n++)if(an.deepCompareStrict(e,r[n]))return!1;return!0}Tt.uniqueItems=function(t,r,n,i){if(r.uniqueItems===!0&&this.types.array(t)){var o=new At(t,r,n,i);return t.every($de)||o.addError({name:"uniqueItems",message:"contains duplicate item"}),o}},Tt.dependencies=function(t,r,n,i){if(this.types.object(t)){var o=new At(t,r,n,i);for(var s in r.dependencies)if(t[s]!==void 0){var u=r.dependencies[s],c=i.makeChild(u,s);if(typeof u=="string"&&(u=[u]),Array.isArray(u))u.forEach(function(d){t[d]===void 0&&o.addError({name:"dependencies",argument:c.propertyPath,message:"property "+d+" not found, required by "+c.propertyPath})});else{var l=this.validateSchema(t,u,n,c);o.instance!==l.instance&&(o.instance=l.instance),l&&l.errors.length&&(o.addError({name:"dependencies",argument:c.propertyPath,message:"does not meet dependency required by "+c.propertyPath}),o.importErrors(l))}}return o}},Tt.enum=function(t,r,n,i){if(t===void 0)return null;if(!Array.isArray(r.enum))throw new na("enum expects an array",r);var o=new At(t,r,n,i);return r.enum.some(an.deepCompareStrict.bind(null,t))||o.addError({name:"enum",argument:r.enum,message:"is not one of enum values: "+r.enum.map(String).join(",")}),o},Tt.const=function(t,r,n,i){if(t===void 0)return null;var o=new At(t,r,n,i);return an.deepCompareStrict(r.const,t)||o.addError({name:"const",argument:r.const,message:"does not exactly match expected constant: "+r.const}),o},Tt.not=Tt.disallow=function(t,r,n,i){var o=this;if(t===void 0)return null;var s=new At(t,r,n,i),u=r.not||r.disallow;return u?(Array.isArray(u)||(u=[u]),u.forEach(function(c){if(o.testType(t,r,n,i,c)){var l=c&&(c.$id||c.id),d=l||c;s.addError({name:"not",argument:d,message:"is of prohibited type "+d})}}),s):null};var efe=zm,Qm={},qm=ar;Qm.SchemaScanResult=a4;function a4(e,t){this.id=e,this.ref=t}Qm.scan=function(t,r){function n(c,l){if(!l||typeof l!="object")return;if(l.$ref){let m=qm.resolveUrl(c,l.$ref);u[m]=u[m]?u[m]+1:0;return}var d=l.$id||l.id;let f=qm.resolveUrl(c,d);var p=d?f:c;if(p){if(p.indexOf("#")<0&&(p+="#"),s[p]){if(!qm.deepCompareStrict(s[p],l))throw new Error("Schema <"+p+"> already exists with different definition");return s[p]}s[p]=l,p[p.length-1]=="#"&&(s[p.substring(0,p.length-1)]=l)}i(p+"/items",Array.isArray(l.items)?l.items:[l.items]),i(p+"/extends",Array.isArray(l.extends)?l.extends:[l.extends]),n(p+"/additionalItems",l.additionalItems),o(p+"/properties",l.properties),n(p+"/additionalProperties",l.additionalProperties),o(p+"/definitions",l.definitions),o(p+"/patternProperties",l.patternProperties),o(p+"/dependencies",l.dependencies),i(p+"/disallow",l.disallow),i(p+"/allOf",l.allOf),i(p+"/anyOf",l.anyOf),i(p+"/oneOf",l.oneOf),n(p+"/not",l.not)}function i(c,l){if(Array.isArray(l))for(var d=0;d<l.length;d++)n(c+"/"+d,l[d])}function o(c,l){if(!(!l||typeof l!="object"))for(var d in l)n(c+"/"+d,l[d])}var s={},u={};return n(t,r),new a4(s,u)};var i4=efe,oa=ar,s4=Qm.scan,l4=oa.ValidatorResult,tfe=oa.ValidatorResultError,Ml=oa.SchemaError,u4=oa.SchemaContext,rfe="/",Br=function e(){this.customFormats=Object.create(e.prototype.customFormats),this.schemas={},this.unresolvedRefs=[],this.types=Object.create(oo),this.attributes=Object.create(i4.validators)};Br.prototype.customFormats={},Br.prototype.schemas=null,Br.prototype.types=null,Br.prototype.attributes=null,Br.prototype.unresolvedRefs=null,Br.prototype.addSchema=function(t,r){var n=this;if(!t)return null;var i=s4(r||rfe,t),o=r||t.$id||t.id;for(var s in i.id)this.schemas[s]=i.id[s];for(var s in i.ref)this.unresolvedRefs.push(s);return this.unresolvedRefs=this.unresolvedRefs.filter(function(u){return typeof n.schemas[u]>"u"}),this.schemas[o]},Br.prototype.addSubSchemaArray=function(t,r){if(Array.isArray(r))for(var n=0;n<r.length;n++)this.addSubSchema(t,r[n])},Br.prototype.addSubSchemaObject=function(t,r){if(!(!r||typeof r!="object"))for(var n in r)this.addSubSchema(t,r[n])},Br.prototype.setSchemas=function(t){this.schemas=t},Br.prototype.getSchema=function(t){return this.schemas[t]},Br.prototype.validate=function(t,r,n,i){if(typeof r!="boolean"&&typeof r!="object"||r===null)throw new Ml("Expected `schema` to be an object or boolean");n||(n={});var o=r.$id||r.id;let s=oa.resolveUrl(n.base,o||"");if(!i){i=new u4(r,n,[],s,Object.create(this.schemas)),i.schemas[s]||(i.schemas[s]=r);var u=s4(s,r);for(var c in u.id){var l=u.id[c];i.schemas[c]=l}}if(n.required&&t===void 0){var d=new l4(t,r,n,i);return d.addError("is required, but is undefined"),d}var d=this.validateSchema(t,r,n,i);if(d){if(n.throwAll&&d.errors.length)throw new tfe(d)}else throw new Error("Result undefined");return d};function c4(e){var t=typeof e=="string"?e:e.$ref;return typeof t=="string"?t:!1}Br.prototype.validateSchema=function(t,r,n,i){var o=new l4(t,r,n,i);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 s={schema:r,ctx:i};r.extends.forEach(this.schemaTraverser.bind(this,s)),r=s.schema,s.schema=null,s.ctx=null,s=null}else r=oa.deepMerge(r,this.superResolve(r.extends,i));var u=c4(r);if(u){var c=this.resolve(r,u,i),l=new u4(c.subschema,n,i.path,c.switchSchema,i.schemas);return this.validateSchema(t,c.subschema,n,l)}var d=n&&n.skipAttributes||[];for(var f in r)if(!i4.ignoreProperties[f]&&d.indexOf(f)<0){var p=null,m=this.attributes[f];if(m)p=m.call(this,t,r,n,i);else if(n.allowUnknownAttributes===!1)throw new Ml("Unsupported attribute: "+f,r);p&&o.importErrors(p)}if(typeof n.rewrite=="function"){var h=n.rewrite.call(this,t,r,n,i);o.instance=h}return o},Br.prototype.schemaTraverser=function(t,r){t.schema=oa.deepMerge(t.schema,this.superResolve(r,t.ctx))},Br.prototype.superResolve=function(t,r){var n=c4(t);return n?this.resolve(t,n,r).subschema:t},Br.prototype.resolve=function(t,r,n){if(r=n.resolve(r),n.schemas[r])return{subschema:n.schemas[r],switchSchema:r};let o=new URL(r,"thismessage::/").hash;var s=o&&o.length&&r.substr(0,r.length-o.length);if(!s||!n.schemas[s])throw new Ml("no such schema <"+r+">",t);var u=oa.objectGetPath(n.schemas[s],o.substr(1));if(u===void 0)throw new Ml("no such schema "+o+" located in <"+s+">",t);return{subschema:u,switchSchema:r}},Br.prototype.testType=function(t,r,n,i,o){if(o!==void 0){if(o===null)throw new Ml('Unexpected null in "type" keyword');if(typeof this.types[o]=="function")return this.types[o].call(this,t);if(o&&typeof o=="object"){var s=this.validateSchema(t,o,n,i);return s===void 0||!(s&&s.errors.length)}return!0}};var oo=Br.prototype.types={};oo.string=function(t){return typeof t=="string"},oo.number=function(t){return typeof t=="number"&&isFinite(t)},oo.integer=function(t){return typeof t=="number"&&t%1===0},oo.boolean=function(t){return typeof t=="boolean"},oo.array=function(t){return Array.isArray(t)},oo.null=function(t){return t===null},oo.date=function(t){return t instanceof Date},oo.any=function(t){return!0},oo.object=function(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof Date)};var nfe=Br,d4;d4=nfe,ar.ValidatorResult,ar.ValidatorResultError,ar.ValidationError,ar.SchemaError;function ofe(e){const t=new d4,r={additionalProperties:!1,properties:{input:{items:{oneOf:[{additionalProperties:!1,properties:{defaultValue:{required:!0,type:"number"},id:{type:"string"},name:{required:!0,type:"string"},possibleValues:{items:{additionalProperties:!1,properties:{name:{required:!0,type:"string"},value:{required:!0,type:"number"}},type:"object"},minItems:1,required:!0,type:"array"},visible:{type:"string"}}},{additionalProperties:!1,properties:{defaultValue:{required:!0,type:"number"},id:{type:"string"},maximumValue:{required:!0,type:"number"},minimumValue:{required:!0,type:"number"},name:{required:!0,type:"string"},stepValue:{type:"number"},visible:{type:"string"}}}],type:"object"},minItems:1,required:!0,type:"array"},output:{additionalProperties:!1,minItems:1,properties:{data:{items:{additionalProperties:!1,properties:{id:{required:!0,type:"string"},name:{required:!0,type:"string"}},type:"object"},minItems:1,required:!0,type:"array"},plots:{items:{additionalProperties:!1,properties:{xAxisTitle:{required:!0,type:"string"},xValue:{required:!0,type:"string"},yAxisTitle:{required:!0,type:"string"},yValue:{required:!0,type:"string"}},type:"object"},maxItems:9,minItems:1,required:!0,type:"array"}},required:!0,type:"object"},parameters:{items:{additionalProperties:!1,properties:{name:{required:!0,type:"string"},value:{required:!0,type:"string"}},type:"object"},type:"array"},simulation:{additionalProperties:!1,properties:{opencor:{additionalProperties:!1,properties:{endingPoint:{type:"number"},pointInterval:{type:"number"},resource:{required:!0,type:"string"}},type:"object"},solvers:{items:{additionalProperties:!1,properties:{if:{type:"string"},input:{additionalProperties:!1,properties:{name:{required:!0,type:"string"},value:{required:!0,type:"string"}},type:"object"},name:{required:!0,type:"string"},version:{required:!0,type:"string"}},type:"object"},minItems:1,required:!0,type:"array"}},required:!0,type:"object"}},type:"object"},n=t.validate(e,r,{nestedErrors:!0});if(!n.valid)return console.warn(`SimulationVuer: JSON: ${n.toString()}`),!1;const i={};if(!e.input.every(d=>{if(d.id!==void 0){if(d.id==="")return console.warn("SimulationVuer: JSON: the input id must not be empty."),!1;if(i[d.id]!==void 0)return console.warn(`SimulationVuer: JSON: the input id must be unique (${d.id} is used more than once).`),!1;i[d.id]=!0}if(d.name==="")return console.warn("SimulationVuer: JSON: the input name must not be empty."),!1;if(d.possibleValues!==void 0){if(!d.possibleValues.every(m=>m.name===""?(console.warn("SimulationVuer: JSON: an input possible value must not be empty."),!1):!0))return!1;const f=d.possibleValues.map(m=>m.value),p={};if(!f.every(m=>p[m]!==void 0?(console.warn(`SimulationVuer: JSON: an input possible value must have a unique value (${m} is used more than once).`),!1):(p[m]=!0,!0)))return!1;if(!f.includes(d.defaultValue))return console.warn(`SimulationVuer: JSON: the input default value (${d.defaultValue}) must be one of the possible values (${f.join(", ")}).`),!1}if(d.minimumValue!==void 0&&d.maximumValue!==void 0){if(d.minimumValue>=d.maximumValue)return console.warn(`SimulationVuer: JSON: the input minimum value (${d.minimumValue}) must be lower than the maximum value (${d.maximumValue}).`),!1;if(d.defaultValue<d.minimumValue||d.defaultValue>d.maximumValue)return console.warn(`SimulationVuer: JSON: the input default value (${d.defaultValue}) must be greater or equal than the minimum value (${d.minimumValue}) and lower or equal than the maximum value (${d.maximumValue}).`),!1;const f=d.maximumValue-d.minimumValue;if(d.stepValue!==void 0){if(d.stepValue<=0||d.stepValue>f)return console.warn(`SimulationVuer: JSON: the input step value (${d.stepValue}) must be greater than zero and lower or equal than the range value (${f}).`),!1;if(!Number.isInteger(f/d.stepValue))return console.warn(`SimulationVuer: JSON: the input step value (${d.stepValue}) must be a factor of the range value (${f}).`),!1}else if(!Number.isInteger(f))return console.warn(`SimulationVuer: JSON: the (default) input step value (1) must be a factor of the range value (${f}).`),!1}return d.visible!==void 0&&d.visible===""?(console.warn("SimulationVuer: JSON: the input visible must not be empty."),!1):!0}))return!1;const s={};if(!e.output.data.every(d=>{if(d.id!==void 0){if(d.id==="")return console.warn("SimulationVuer: JSON: the output data id must not be empty."),!1;if(s[d.id]!==void 0)return console.warn(`SimulationVuer: JSON: the output data id must be unique (${d.id} is used more than once).`),!1;s[d.id]=!0}return d.name===""?(console.warn("SimulationVuer: JSON: the output data name must not be empty."),!1):!0})||!e.output.plots.every(d=>d.xAxisTitle===""?(console.warn("SimulationVuer: JSON: the output plot X axis title must not be empty."),!1):d.xValue===""?(console.warn("SimulationVuer: JSON: the output plot X value must not be empty."),!1):d.yAxisTitle===""?(console.warn("SimulationVuer: JSON: the output plot Y axis title must not be empty."),!1):d.yValue===""?(console.warn("SimulationVuer: JSON: the output plot Y value must not be empty."),!1):!0)||e.parameters!==void 0&&!e.parameters.every(f=>f.name===""?(console.warn("SimulationVuer: JSON: the parameter name must not be empty."),!1):f.value===""?(console.warn("SimulationVuer: JSON: the parameter value must not be empty."),!1):!0))return!1;let l=!1;if(!e.simulation.solvers.every(d=>{if(d.if!==void 0&&d.if==="")return console.warn("SimulationVuer: JSON: a simulation solver if must not be empty."),!1;if(d.input!==void 0){if(d.input.name==="")return console.warn("SimulationVuer: JSON: a simulation solver input name must not be empty."),!1;if(d.input.value==="")return console.warn("SimulationVuer: JSON: a simulation solver input value must not be empty."),!1}return d.name===""?(console.warn("SimulationVuer: JSON: a simulation solver name must not be empty."),!1):(l=l||d.name===B2,d.version===""?(console.warn("SimulationVuer: JSON: a simulation solver version must not be empty."),!1):!0)}))return!1;if(l&&e.simulation.opencor===void 0)return console.warn("SimulationVuer: JSON: the simulation solver for OpenCOR is specified so simulation OpenCOR settings must also be specified."),!1;if(e.simulation.opencor!==void 0){if(e.simulation.opencor.resource==="")return console.warn("SimulationVuer: JSON: the simulation OpenCOR resource must not be empty."),!1;if(e.simulation.opencor.endingPoint!==void 0)if(e.simulation.opencor.pointInterval!==void 0){if(e.simulation.opencor.endingPoint<=0)return console.warn(`SimulationVuer: JSON: the simulation OpenCOR ending point (${e.simulation.opencor.endingPoint}) must be greater than zero.`),!1;if(e.simulation.opencor.pointInterval<=0)return console.warn(`SimulationVuer: JSON: the simulation OpenCOR point interval (${e.simulation.opencor.pointInterval}) must be greater than zero.`),!1}else return console.warn("SimulationVuer: JSON: a simulation OpenCOR ending point is specified so a simulation OpenCOR point interval must also be specified."),!1;else if(e.simulation.opencor.pointInterval!==void 0)return console.warn("SimulationVuer: JSON: a simulation OpenCOR point interval is specified so a simulation OpenCOR ending point must also be specified."),!1}return!0}const f4="https://models.physiomeproject.org/",afe=fp(E2,{}),aa=Object.freeze({DATASET_ID:"dataset_id",DATASET_URL:"dataset_url",PMR_PATH:"pmr_path",RAW_COMBINE_ARCHIVE:"raw_combine_archive"});function ife(e){try{const t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"}catch{return!1}}const sfe={name:"SimulationVuer",components:{PlotVuer:Ua.PlotVuer,SimulationVuerInput:T2,ElButton:mv,ElDivider:vv,OpenCOR:Zde},props:{apiLocation:{required:!0,type:String},id:{required:!0,type:[Number,String,Uint8Array]}},data:function(){let e;if(typeof this.id=="number"?e=aa.DATASET_ID:this.id instanceof Uint8Array?e=aa.RAW_COMBINE_ARCHIVE:ife(this.id)?e=aa.DATASET_URL:e=aa.PMR_PATH,e===aa.DATASET_ID){const t=new XMLHttpRequest;t.open("GET",`${this.apiLocation}/sim/dataset/${this.id}`),t.onreadystatechange=()=>{if(t.readyState===4&&t.status===200){const r=JSON.parse(t.responseText);this.name=r.name,this.uuid=r.study!==void 0?r.study.uuid:void 0}},t.send()}return{errorMessage:"",errorStatus:null,fileManager:void 0,hasFinalisedUi:!1,hasValidSimulationUiInfo:!1,idType:e,instance:void 0,isMounted:!1,isSimulationValid:!0,layout:[],model:void 0,name:null,opencorBasedSimulation:!0,opencorOmexFile:null,output:void 0,perfectScollbarOptions:{suppressScrollX:!0},showUserMessage:!1,simulationResults:{},simulationResultsId:{},simulationUiInfo:{},solver:void 0,userMessage:"",ui:null,uuid:null,activeSubscriptions:[]}},methods:{addDataSubscription(e){var c,l,d,f;if(!e||typeof e!="object"){console.warn("SimulationVuer: addDataSubscription: subscription must be an object.");return}const t="nz.ac.auckland.simulation-data-request",r=0;if(e.id!==t){console.warn(`SimulationVuer: addDataSubscription: invalid ID (expected '${t}' but got '${e.id}').`);return}if(typeof e.version!="string"){console.warn(`SimulationVuer: addDataSubscription: missing or non-string version ('${e.version}').`);return}const n=e.version.split(".");if(n.length<1||!/^[0-9]+$/.test(n[0])){console.warn(`SimulationVuer: addDataSubscription: malformed version ('${e.version}').`);return}const i=parseInt(n[0],10);if(Number.isNaN(i)){console.warn(`SimulationVuer: addDataSubscription: could not parse the major version from ('${e.version}')`);return}if(i!==r){console.warn(`SimulationVuer: addDataSubscription: version mismatch (expected v${r}.y.z but got v${e.version}).`);return}const o=e.payload||{},s=[];if(o.windowId==null&&s.push("windowId"),o.ownerId==null&&s.push("ownerId"),o.component||s.push("component"),o.variable||s.push("variable"),s.length){console.warn(`SimulationVuer: addDataSubscription: payload missing fields: ${s.join(", ")}.`);return}this.activeSubscriptions.push(o);const u=[];(c=e.payload)!=null&&c.withVOI&&u.push("VOI"),u.push(`${(l=e.payload)==null?void 0:l.component}/${(d=e.payload)==null?void 0:d.variable}`),(f=this.$refs.opencorRef)==null||f.trackSimulationData(u)},addExternalData(e,t,r){var n;if(!((n=this.$refs.opencorRef)!=null&&n.addExternalData)){console.warn("SimulationVuer: addExternalData: OpenCOR instance is not available.");return}return this.$refs.opencorRef.addExternalData(e,t,r)},removeDataSubscription(e){var i;const t=this.activeSubscriptions.find(o=>o.windowId===e);if(!t){console.warn(`SimulationVuer: removeDataSubscription: no active subscription found for id ${e}.`);return}const r=this.activeSubscriptions.some(o=>o.windowId!==e&&o.withVOI),n=this.activeSubscriptions.some(o=>o.windowId!==e&&o.component===t.component&&o.variable===t.variable);if(!r||!n){const o=[];t.withVOI&&!r&&o.push("VOI"),n||o.push(`${t.component}/${t.variable}`),o.length&&((i=this.$refs.opencorRef)==null||i.untrackSimulationData(o))}this.activeSubscriptions=this.activeSubscriptions.filter(o=>o.windowId!==e)},onExternalData(e){this.$emit("externalData",e)},onFile(e){this.$emit("file",e)},onSimulationData(e){const t=e.simulationData||{};let r;this.activeSubscriptions.forEach(n=>{const i=`${n.component}/${n.variable}`,o=t[i];if(o==null){console.warn(`SimulationVuer: onSimulationData: no data for ${i}.`);return}const s={y:o.data,title:`${n.component}.${n.variable} (${o.unit})`};if(n.withVOI)if(t.VOI==null){console.warn("SimulationVuer: onSimulationData: no data for VOI.");return}else r??(r=t.VOI),s.x=r;this.$emit("data-notification",{id:"nz.ac.auckland.simulation-data-response",version:"0.1.0",payload:{windowId:n.windowId,ownerId:n.ownerId,data:s}})}),this.$emit("simulationData",e)},plotMetadata(e){return{version:"1.1.0",type:"plot",attrs:{style:"timeseries",layout:this.layout[e]}}},buildSimulationUi(e){if(this.simulationUiInfo=e,this.hasValidSimulationUiInfo=ofe(this.simulationUiInfo),!this.hasValidSimulationUiInfo){this.errorMessage="the simulation.json file is malformed";return}if(this.simulationUiInfo.simulation.solvers.forEach(r=>{(r.if===void 0||pp(this,r.if))&&(this.solver=r)}),this.solver===void 0){this.hasValidSimulationUiInfo=!1,this.errorMessage="no solver name and/or solver version specified";return}this.opencorBasedSimulation=this.solver.name===B2,this.simulationUiInfo.output.data.forEach(r=>{this.simulationResultsId[r.id]=r.name});let t=-1;this.simulationUiInfo.output.plots.forEach(r=>{++t,this.layout[t]={paper_bgcolor:"rgba(0, 0, 0, 0)",plot_bgcolor:"rgba(0, 0, 0, 0)",autosize:!0,margin:{t:25,l:55,r:25,b:30,pad:4},loading:!1,options:{responsive:!0,scrollZoom:!0},dragmode:"pan",xaxis:{title:{text:r.xAxisTitle,font:{size:10}}},yaxis:{title:{text:r.yAxisTitle,font:{size:10}}}}}),this.$nextTick(()=>{M2(this)})},openUrl(e){const t=document.createElement("a");t.href=e,t.target="_blank",t.rel="noopener noreferrer",t.style.display="none",document.body.appendChild(t),t.click(),document.body.removeChild(t)},runOnOsparc(){this.openUrl(`https://osparc.io/study/${this.uuid}`)},viewDataset(){this.openUrl(`https://sparc.science/datasets/${this.id}?type=dataset`)},viewWorkspace(){const e=f4+this.id;this.openUrl(e.substring(0,e.lastIndexOf("/")))},parametersData(){const e={};return this.simulationUiInfo.parameters.forEach(t=>{e[t.name]=pp(this,t.value)}),e},outputData(){return this.output===void 0&&this.simulationUiInfo.output.data!==void 0&&(this.output=[],this.simulationUiInfo.output.data.forEach(e=>{this.output.push(e.name)})),this.output},retrieveRequest(){const e={solver:this.solver};if(this.opencorBasedSimulation){e.opencor={model_url:this.simulationUiInfo.simulation.opencor.resource,json_config:{}},this.simulationUiInfo.simulation.opencor.endingPoint!==void 0&&this.simulationUiInfo.simulation.opencor.pointInterval!==void 0&&(e.opencor.json_config.simulation={"Ending point":this.simulationUiInfo.simulation.opencor.endingPoint,"Point interval":this.simulationUiInfo.simulation.opencor.pointInterval}),e.opencor.json_config.parameters=this.parametersData();const t=this.outputData();t!==void 0&&(e.opencor.json_config.output=t)}else e.osparc={},e.osparc.job_inputs=this.parametersData();return e},processSimulationResults(e){if(typeof e=="string"){const n=/[ \t]+/g,i=e.trim().split(`
4795
+ `),o=i[0].trim().split(n).length;e={};for(let u=0;u<o;++u)e[u]=[];let s=-1;i.forEach(u=>{++s;let c=-1;u.trim().split(n).forEach(d=>{e[++c][s]=Number(d)})})}const t=new afe.parser;Object.keys(this.simulationResultsId).forEach(n=>{t.set(n,e[this.simulationResultsId[n]])});let r=-1;this.simulationUiInfo.output.plots.forEach(n=>{this.simulationResults[++r]=[{x:t.evaluate(n.xValue),y:t.evaluate(n.yValue),type:"scatter"}]})},showHttpIssue(e){this.isSimulationValid=!1,this.showUserMessage=!1,this.errorMessage=e.statusText.toLowerCase(),this.errorStatus=e.status},checkSimulation(e){const t=new XMLHttpRequest;t.open("POST",`${this.apiLocation}/check_simulation`),t.setRequestHeader("Content-type","application/json"),t.onreadystatechange=()=>{if(t.readyState===4)if(t.status===200){let r=JSON.parse(t.responseText);if(this.isSimulationValid=r.status==="ok",this.isSimulationValid)if(r.results!==void 0)this.showUserMessage=!1,this.processSimulationResults(r.results);else{let n=this;setTimeout(()=>{n.checkSimulation(e)},1e3)}else this.showUserMessage=!1,this.errorMessage=r.description,this.errorStatus=null}else this.showHttpIssue(t)},t.send(JSON.stringify(e))},startSimulation(){this.userMessage="Loading simulation results...",this.showUserMessage=!0,this.$nextTick(()=>{this.simulationResults={};const e=new XMLHttpRequest;e.open("POST",`${this.apiLocation}/start_simulation`),e.setRequestHeader("Content-type","application/json"),e.onreadystatechange=()=>{if(e.readyState===4)if(e.status===200){let t=JSON.parse(e.responseText);this.isSimulationValid=t.status==="ok",this.isSimulationValid?this.checkSimulation(t.data):(this.showUserMessage=!1,this.errorMessage=t.description,this.errorStatus=null)}else this.showHttpIssue(e)},e.send(JSON.stringify(this.retrieveRequest()))})}},created:function(){this.idType===aa.DATASET_ID?(this.userMessage="Retrieving UI information...",this.showUserMessage=!0,this.$nextTick(()=>{const e=new XMLHttpRequest;e.open("GET",`${this.apiLocation}/simulation_ui_file/${this.id}`),e.onreadystatechange=()=>{e.readyState===4&&(this.showUserMessage=!1,e.status===200?this.$nextTick(()=>{this.buildSimulationUi(JSON.parse(e.responseText))}):(this.errorMessage="the simulation dataset could not be retrieved",this.errorStatus=null))},e.send()})):this.idType===aa.DATASET_URL?this.opencorOmexFile=this.id:this.idType===aa.PMR_PATH?this.opencorOmexFile=`${f4}${this.id}`:this.opencorOmexFile=this.id},mounted:function(){this.isMounted=!0,M2(this)}},lfe=["element-loading-text"],ufe={key:0,class:"container"},cfe={key:0,class:"default error"},dfe={key:1,class:"main"},ffe={class:"default name"},pfe={class:"input scrollbar"},mfe={class:"buttons-container"},hfe={class:"primary-button"},gfe={key:0,class:"secondary-button"},vfe={class:"secondary-button"},bfe={key:1,class:"default note"},yfe={class:"main-right",ref:"output"},wfe={class:"main-right"},xfe={class:"default error"},Cfe={key:0},Sfe=["href"],Nfe={key:1,class:"opencor"};function kfe(e,t,r,n,i,o){const s=vv,u=T2,c=mv,l=a.resolveComponent("PlotVuer"),d=a.resolveComponent("OpenCOR"),f=RA;return a.withDirectives((a.openBlock(),a.createElementBlock("div",{class:"simulation-vuer","element-loading-text":e.userMessage},[e.opencorOmexFile===null?(a.openBlock(),a.createElementBlock("div",ufe,[!e.hasValidSimulationUiInfo&&!e.showUserMessage?(a.openBlock(),a.createElementBlock("p",cfe,[t[6]||(t[6]=a.createElementVNode("span",{class:"error"},"Error:",-1)),a.createTextVNode(" "+a.toDisplayString(e.errorMessage)+". ",1)])):a.createCommentVNode("",!0),e.hasValidSimulationUiInfo?(a.openBlock(),a.createElementBlock("div",dfe,[a.createElementVNode("div",{class:a.normalizeClass(["main-left",{"with-buttons":e.uuid}])},[a.createElementVNode("p",ffe,a.toDisplayString(e.name),1),a.createVNode(s),t[10]||(t[10]=a.createElementVNode("p",{class:"default input-parameters"},"Input parameters",-1)),a.createElementVNode("div",pfe,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.simulationUiInfo.input,(p,m)=>(a.openBlock(),a.createBlock(u,{ref_for:!0,ref:"simInput",defaultValue:p.defaultValue,key:`input-${m}`,name:p.name,maximumValue:p.maximumValue,minimumValue:p.minimumValue,possibleValues:p.possibleValues,stepValue:p.stepValue},null,8,["defaultValue","name","maximumValue","minimumValue","possibleValues","stepValue"]))),128))]),a.createElementVNode("div",mfe,[a.createElementVNode("div",hfe,[a.createVNode(c,{type:"primary",size:"small",onClick:t[0]||(t[0]=p=>o.startSimulation())},{default:a.withCtx(()=>[...t[7]||(t[7]=[a.createTextVNode("Run Simulation",-1)])]),_:1})]),e.uuid?(a.openBlock(),a.createElementBlock("div",gfe,[a.createVNode(c,{size:"small",onClick:t[1]||(t[1]=p=>o.runOnOsparc())},{default:a.withCtx(()=>[...t[8]||(t[8]=[a.createTextVNode("Run on oSPARC",-1)])]),_:1})])):a.createCommentVNode("",!0),a.createElementVNode("div",vfe,[a.createVNode(c,{size:"small",onClick:t[2]||(t[2]=p=>o.viewDataset())},{default:a.withCtx(()=>[...t[9]||(t[9]=[a.createTextVNode("View Dataset",-1)])]),_:1})]),e.uuid?(a.openBlock(),a.createElementBlock("p",bfe," Additional parameters are available on oSPARC ")):a.createCommentVNode("",!0)])],2),a.withDirectives(a.createElementVNode("div",yfe,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.simulationUiInfo.output.plots,(p,m)=>(a.openBlock(),a.createBlock(l,{key:`output-${m}`,metadata:o.plotMetadata(m),"data-source":{data:e.simulationResults[m]},plotLayout:e.layout[m],plotType:"plotly-only",selectorUi:!1},null,8,["metadata","data-source","plotLayout"]))),128))],512),[[a.vShow,e.isSimulationValid]]),a.withDirectives(a.createElementVNode("div",wfe,[a.createElementVNode("p",xfe,[t[13]||(t[13]=a.createElementVNode("span",{class:"error"},"Error:",-1)),a.createTextVNode(" "+a.toDisplayString(e.errorMessage)+" ",1),e.errorStatus?(a.openBlock(),a.createElementBlock("span",Cfe,[t[11]||(t[11]=a.createTextVNode(" (",-1)),a.createElementVNode("a",{href:`https://httpstatuses.com/${e.errorStatus}`,target:"_blank",rel:"noopener noreferrer"},a.toDisplayString(e.errorStatus),9,Sfe),t[12]||(t[12]=a.createTextVNode(") ",-1))])):a.createCommentVNode("",!0),t[14]||(t[14]=a.createTextVNode(". ",-1))])],512),[[a.vShow,!e.isSimulationValid]])])):a.createCommentVNode("",!0)])):(a.openBlock(),a.createElementBlock("div",Nfe,[a.createVNode(d,{ref:"opencorRef",omex:e.opencorOmexFile,theme:"light",onExternalData:t[3]||(t[3]=p=>o.onExternalData(p)),onFile:t[4]||(t[4]=p=>o.onFile(p)),onSimulationData:t[5]||(t[5]=p=>o.onSimulationData(p))},null,8,["omex"])]))],8,lfe)),[[f,e.showUserMessage]])}const Efe=A2(sfe,[["render",kfe],["__scopeId","data-v-00c5efaf"]]);nr.SimulationVuer=Efe,Object.defineProperty(nr,Symbol.toStringTag,{value:"Module"})});