@entryscape/rdforms 10.10.0 → 10.10.1

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.
@@ -277,4 +277,4 @@ e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月
277
277
  * @author Feross Aboukhadijeh <https://feross.org>
278
278
  * @license MIT
279
279
  */
280
- e.exports=function(e){return null!=e&&(t(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&t(e.slice(0,0))}(e)||!!e._isBuffer)}},function(e,a){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,a,t){var d={"./af":17,"./af.js":17,"./ar":18,"./ar-dz":19,"./ar-dz.js":19,"./ar-kw":20,"./ar-kw.js":20,"./ar-ly":21,"./ar-ly.js":21,"./ar-ma":22,"./ar-ma.js":22,"./ar-sa":23,"./ar-sa.js":23,"./ar-tn":24,"./ar-tn.js":24,"./ar.js":18,"./az":25,"./az.js":25,"./be":26,"./be.js":26,"./bg":27,"./bg.js":27,"./bm":28,"./bm.js":28,"./bn":29,"./bn-bd":30,"./bn-bd.js":30,"./bn.js":29,"./bo":31,"./bo.js":31,"./br":32,"./br.js":32,"./bs":33,"./bs.js":33,"./ca":34,"./ca.js":34,"./cs":35,"./cs.js":35,"./cv":36,"./cv.js":36,"./cy":37,"./cy.js":37,"./da":38,"./da.js":38,"./de":39,"./de-at":40,"./de-at.js":40,"./de-ch":41,"./de-ch.js":41,"./de.js":39,"./dv":42,"./dv.js":42,"./el":43,"./el.js":43,"./en-au":44,"./en-au.js":44,"./en-ca":45,"./en-ca.js":45,"./en-gb":46,"./en-gb.js":46,"./en-ie":47,"./en-ie.js":47,"./en-il":48,"./en-il.js":48,"./en-in":49,"./en-in.js":49,"./en-nz":50,"./en-nz.js":50,"./en-sg":51,"./en-sg.js":51,"./eo":52,"./eo.js":52,"./es":53,"./es-do":54,"./es-do.js":54,"./es-mx":55,"./es-mx.js":55,"./es-us":56,"./es-us.js":56,"./es.js":53,"./et":57,"./et.js":57,"./eu":58,"./eu.js":58,"./fa":59,"./fa.js":59,"./fi":60,"./fi.js":60,"./fil":61,"./fil.js":61,"./fo":62,"./fo.js":62,"./fr":63,"./fr-ca":64,"./fr-ca.js":64,"./fr-ch":65,"./fr-ch.js":65,"./fr.js":63,"./fy":66,"./fy.js":66,"./ga":67,"./ga.js":67,"./gd":68,"./gd.js":68,"./gl":69,"./gl.js":69,"./gom-deva":70,"./gom-deva.js":70,"./gom-latn":71,"./gom-latn.js":71,"./gu":72,"./gu.js":72,"./he":73,"./he.js":73,"./hi":74,"./hi.js":74,"./hr":75,"./hr.js":75,"./hu":76,"./hu.js":76,"./hy-am":77,"./hy-am.js":77,"./id":78,"./id.js":78,"./is":79,"./is.js":79,"./it":80,"./it-ch":81,"./it-ch.js":81,"./it.js":80,"./ja":82,"./ja.js":82,"./jv":83,"./jv.js":83,"./ka":84,"./ka.js":84,"./kk":85,"./kk.js":85,"./km":86,"./km.js":86,"./kn":87,"./kn.js":87,"./ko":88,"./ko.js":88,"./ku":89,"./ku.js":89,"./ky":90,"./ky.js":90,"./lb":91,"./lb.js":91,"./lo":92,"./lo.js":92,"./lt":93,"./lt.js":93,"./lv":94,"./lv.js":94,"./me":95,"./me.js":95,"./mi":96,"./mi.js":96,"./mk":97,"./mk.js":97,"./ml":98,"./ml.js":98,"./mn":99,"./mn.js":99,"./mr":100,"./mr.js":100,"./ms":101,"./ms-my":102,"./ms-my.js":102,"./ms.js":101,"./mt":103,"./mt.js":103,"./my":104,"./my.js":104,"./nb":105,"./nb.js":105,"./ne":106,"./ne.js":106,"./nl":107,"./nl-be":108,"./nl-be.js":108,"./nl.js":107,"./nn":109,"./nn.js":109,"./oc-lnc":110,"./oc-lnc.js":110,"./pa-in":111,"./pa-in.js":111,"./pl":112,"./pl.js":112,"./pt":113,"./pt-br":114,"./pt-br.js":114,"./pt.js":113,"./ro":115,"./ro.js":115,"./ru":116,"./ru.js":116,"./sd":117,"./sd.js":117,"./se":118,"./se.js":118,"./si":119,"./si.js":119,"./sk":120,"./sk.js":120,"./sl":121,"./sl.js":121,"./sq":122,"./sq.js":122,"./sr":123,"./sr-cyrl":124,"./sr-cyrl.js":124,"./sr.js":123,"./ss":125,"./ss.js":125,"./sv":126,"./sv.js":126,"./sw":127,"./sw.js":127,"./ta":128,"./ta.js":128,"./te":129,"./te.js":129,"./tet":130,"./tet.js":130,"./tg":131,"./tg.js":131,"./th":132,"./th.js":132,"./tk":133,"./tk.js":133,"./tl-ph":134,"./tl-ph.js":134,"./tlh":135,"./tlh.js":135,"./tr":136,"./tr.js":136,"./tzl":137,"./tzl.js":137,"./tzm":138,"./tzm-latn":139,"./tzm-latn.js":139,"./tzm.js":138,"./ug-cn":140,"./ug-cn.js":140,"./uk":141,"./uk.js":141,"./ur":142,"./ur.js":142,"./uz":143,"./uz-latn":144,"./uz-latn.js":144,"./uz.js":143,"./vi":145,"./vi.js":145,"./x-pseudo":146,"./x-pseudo.js":146,"./yo":147,"./yo.js":147,"./zh-cn":148,"./zh-cn.js":148,"./zh-hk":149,"./zh-hk.js":149,"./zh-mo":150,"./zh-mo.js":150,"./zh-tw":151,"./zh-tw.js":151};function i(e){var a=s(e);return t(a)}function s(e){if(!t.o(d,e)){var a=new Error("Cannot find module '"+e+"'");throw a.code="MODULE_NOT_FOUND",a}return d[e]}i.keys=function(){return Object.keys(d)},i.resolve=s,e.exports=i,i.id=170},function(e,a,t){"use strict";t.r(a),t.d(a,"ItemStore",(function(){return ii})),t.d(a,"bundleLoader",(function(){return ri})),t.d(a,"utils",(function(){return Kt})),t.d(a,"system",(function(){return Gt})),t.d(a,"engine",(function(){return di})),t.d(a,"validate",(function(){return vi})),"__rdfjson_namespaces"in globalThis||(globalThis.__rdfjson_namespaces={ical:"http://www.w3.org/2002/12/cal/ical#",vcard:"http://www.w3.org/2006/vcard/ns#",dcterms:"http://purl.org/dc/terms/",skos:"http://www.w3.org/2004/02/skos/core#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",owl:"http://www.w3.org/2002/07/owl#",vs:"http://www.w3.org/2003/06/sw-vocab-status/ns#",foaf:"http://xmlns.com/foaf/0.1/",wot:"http://xmlns.com/wot/0.1/",dc:"http://purl.org/dc/elements/1.1/",xsd:"http://www.w3.org/2001/XMLSchema#",dcat:"http://www.w3.org/ns/dcat#",org:"http://www.w3.org/ns/org#",gn:"http://www.geonames.org/ontology#",locn:"http://www.w3.org/ns/locn#",schema:"http://schema.org/",ex:"http://example.com/",gsp:"http://www.opengis.net/ont/geosparql#",odrs:"http://schema.theodi.org/odrs#"});const{__rdfjson_namespaces:d}=globalThis;let i=0;const n=(e,a,t)=>(d[e]||(d[e]=a),{abbrev:e,ns:a,localname:t,full:a+t,pretty:`${e}:${t}`}),r=e=>{const a=Object.keys(d).find(a=>0===e.indexOf(d[a]));if(a)return n(a,d[a],e.substring(d[a].length));let t=e.lastIndexOf("/");const s=e.lastIndexOf("#");return s>t&&(t=s),i+=1,n("ns"+i,e.substring(0,t+1),e.substring(t+1))};var p=e=>r(e).pretty,o=e=>{const a=e.split(":");return 2===a.length&&d.hasOwnProperty(a[0])?d[a[0]]+a[1]:e},l=(e,a)=>{"string"==typeof e?d[e]=a:"object"==typeof e&&Object.keys(e).forEach(a=>{d[a]=e[a]})},m=t(153),u=t.n(m);const _=e=>void 0!==e&&(null===e||"object"==typeof e||Array.isArray(e)||"function"==typeof e),h=e=>"string"==typeof e||e instanceof String,c=(e,a,t)=>{0===e[a][t].length&&(delete e[a][t],0===Object.keys(e[a]).length&&delete e[a])},f=e=>{if(!_(e[0]))throw new Error("Graph is not a object.");if(!h(e[1]))throw new Error("Subject is not a string.");if(!h(e[2]))throw new Error("Predicate is not a string.");if(!_(e[3]))throw new Error("Object is not a object.");if(void 0===e[3].type)throw new Error("Object has no type attribute, must be one of 'uri', 'literal', or 'bnode'");if(void 0===e[3].value)throw new Error("Object has no value attribute corresponding to the lexical value of the object.")},y=(e,a)=>e===a||null==e&&e===a||(h(e)?h(a)?e===a:e===a.value:h(a)?e.value===a:e.type===a.type&&e.value===a.value&&e.lang===a.lang&&e.datatype===a.datatype),v=e=>{const a={type:e.type,value:e.value};return null!=e.ng&&(a.ng=e.ng),null!=e.lang&&(a.lang=e.lang),null!=e.datatype&&(a.datatype=e.datatype),a};var M={isObject:_,isString:h,isFunction:e=>"[object Function]"===Object.prototype.toString.call(e),statementEquals:(e,a)=>e.s===a.s&&e.p===a.p&&y(e.o,a.o),add:(e,a,t,d,i)=>{if(f([e,a,t,d]),void 0===e[a])return e[a]={},e[a][t]=[d],d;if(void 0===e[a][t])return e[a][t]=[d],d;let s;const n=e[a][t];if(!i)for(s=n.length-1;s>=0;s--)if(y(d,n[s]))return n[s];return n.push(d),d},remove:(e,a,t,d)=>{if(f([e,a,t,d]),void 0===e[a]||void 0===e[a][t])return;let i;const s=e[a][t];for(i=s.length-1;i>=0;i--)if(y(d,s[i])){const d=s[i];return s.splice(i,1),c(e,a,t),d}},contains:(e,a,t,d)=>{if(f([e,a,t,d]),void 0===e[a]||void 0===e[a][t])return;let i;const s=e[a][t];for(i=s.length-1;i>=0;i--)if(y(d,s[i]))return s[i]},cleanup:c,checkForWrongArgs:f,objectEquals:y,findDirectOrRDFValue:(e,a,t)=>{const d=e.find(a,t);if(d.length>0)return"bnode"!==d[0].getType()?d[0].getValue():e.findFirstValue(d[0].getValue(),"http://www.w3.org/1999/02/22-rdf-syntax-ns#value")},clone:(e,a=!0)=>{const t={};return Object.keys(e).forEach(d=>{const i=e[d];t[d]={},Object.keys(i).forEach(e=>{const s=i[e];if(1===s.length)t[d][e]=[v(s[0])];else if(a){const a=[],s=new Set;t[d][e]=a,i[e].forEach(e=>{const t=v(e),d=(e=>`${e.value}${e.type}${e.lang||""}${e.datatype||""}${e.ng||""}`)(t);s.has(d)||(s.add(d),a.push(t))})}else{const a=[];t[d][e]=a,i[e].forEach(e=>{a.push(v(e))})}})}),t}};class g{constructor(e,a,t,d,i){this._graph=e,this._s=a,this._p=t,this._o=d,this._o._statement=this,this._asserted=i}getGraph(){return this._graph}setAsserted(e,a=!1){e!==this._asserted&&(e?this._graph.add(this,void 0,void 0,this._silentValue,a):this._graph.remove(this,this._silentValue),this._asserted=e)}isAsserted(){return this._asserted}getSubject(){return this._s}isSubjectBlank(){return!0!==this._sIsBlank&&!1!==this._sIsBlank&&(this._sIsBlank=0===this._s.indexOf("_:")),this._sIsBlank}isObjectBlank(){return"bnode"===this.getType()}setSubject(e){this._silentValue=!1;const a=o(e);this._asserted?(this._graph.remove(this),this._s=a,this._graph.add(this),delete this._sIsBlank):this._s=a}getPredicate(){return this._p}setPredicate(e){this._silentValue=!1;const a=o(e);this._asserted?(this._graph.remove(this),this._p=a,this._graph.add(this)):this._p=a}getNamedGraph(){return this._o.ng}setNamedGraph(e){this._o.ng=e}getObject(){return this._o}getCleanObject(){const e=this._o,a={value:e.value,type:e.type};return this._o.ng&&(a.ng=e.ng),e.lang&&(a.lang=e.lang),this._o.datatype&&(a.datatype=e.datatype),a}getType(){return this._o.type}setType(e){throw new Error("Changing the type of an object is not supported, create a new statement instead.")}getValue(){return this._o.value}setValue(e,a=!1){this._silentValue=!0===a,e!==this._o.value&&(this._o.value=e,this.isAsserted()&&!0!==a&&this._graph.setChanged())}getLanguage(){return this._o.lang}setLanguage(e,a){if(this._silentValue=!0===a,"literal"!==this._o.type)throw new Error("Cannot set the language for a resource, has to be a literal");this._o.lang!==e&&(this._o.lang=e,this.isAsserted()&&!0!==a&&this._graph.setChanged())}getDatatype(){return this._o.datatype}setDatatype(e,a){if(this._silentValue=!0===a,"literal"!==this._o.type||null!=this._o.lang)throw new Error("Cannot set the datatype for a resource, has to be a literal");this._o.datatype!==e&&(this._o.datatype=e,this.isAsserted()&&!0!==a&&this._graph.setChanged())}}var w=t(13),L=t.n(w);var Y=(e,a)=>{const t=[],d=new Set((a||[]).map(e=>o(e))),i=[],s={},n=e=>{let a=e.getValue();return e.getLanguage()&&(a+="@"+e.getLanguage()),e.getDatatype()&&(a+="^^"+e.getDatatype()),a},r=(e,a)=>{const t=s[e]||{rels:[]};s[e]=t,t.rels.push(a)};return e.find().forEach(e=>{const a=e.getSubject(),s=e.getPredicate();if(d.has(s))return;const p="bnode"===e.getType(),o=e.isSubjectBlank();if(o||p)return i.push(e),o&&r(e.getSubject(),p?s:s+n(e)),void("bnode"===e.getType()&&r(e.getValue(),o?s:a+s));t.push(a+s+n(e))}),Object.values(s).forEach(e=>{e.rels.sort(),e.hash=L()(e.rels.join(""))}),i.forEach(e=>{const a=[];a.push(e.isSubjectBlank()?s[e.getSubject()].hash:e.getSubject()),a.push(e.getPredicate()),a.push("bnode"===e.getType()?s[e.getValue()].hash:n(e)),t.push(a.join(""))}),t.sort(),L()(t.join(""))};const D=e=>0===e.length?e:[e[0]],b=(e,a,t)=>({object(d){for(let i=0;i<a.length;i++){let s;if(t)s=a[i].getSubject();else{const e=a[i].getType();if("uri"===e||"bnode"===e)continue;s=a[i].getValue()}const n=e.find(s,d);n.length>0&&b(e,[n[0]])}return b(e,[])},objects(d){let i,s=[];if(!0===t)for(i=0;i<a.length;i++)s=s.concat(e.find(a[i].getSubject(),d));else for(i=0;i<a.length;i++){const t=a[i].getType();"uri"!==t&&"bnode"!==t||(s=s.concat(e.find(a[i].getValue(),d)))}return b(e,s)},constr(d,i){let s=i;M.isString(s)&&(s={type:"uri",value:s});const n=[];for(let i=0;i<a.length;i++){const r=t?a[i].getSubject():a[i].getValue();e.find(r,d,s).length>0&&n.push(a[i])}return b(e,n,t)},each(d,i){if(!0===t)for(let s=0;s<a.length;s++){const n="_:"===a[s].getSubject().substring(0,2)?"bnode":"uri";null!=i&&i!==n||d(b(e,a[s],t))}else for(let i=0;i<a.length;i++)d(b(e,a[i],t))},statements:()=>a,nodes(e){const d=[];if(!0===t)for(let t=0;t<a.length;t++){const i="_:"===a[t].getSubject().substring(0,2)?"bnode":"uri";null!=e&&e!==i||d.push({type:i,value:a[t].getSubject()})}else for(let t=0;t<a.length;t++)null!=e&&e!==a[t].getType()||d.push(a[t].getObject());return d},values(e){const d=[];if(!0===t)for(let t=0;t<a.length;t++){const i="_:"===a[t].getSubject().substring(0,2)?"bnode":"uri";null!=e&&e!==i||d.push(a[t].getSubject())}else for(let t=0;t<a.length;t++)null!=e&&e!==a[t].getType()||d.push(a[t].getValue());return d},firstValue(e){if(!0===t)for(let t=0;t<a.length;t++){const d="_:"===a[t].getSubject().substring(0,2)?"bnode":"uri";if(null==e||e===d)return a[t].getSubject()}else for(let t=0;t<a.length;t++)if(null==e||e===a[t].getType())return a[t].getValue()}});class T{constructor(e=null,a){this._graph=e||{},this._bnodes={},this._bnodesIndexed=!1,!1!==a&&this.validate(),this._changed=!1}isEmpty(){return!Object.keys(this._graph).find(e=>{const a=this._graph[e];return Object.keys(a).find(e=>a[e].find(e=>null==e._statement||e._statement.isAsserted()))})}onChange(){}setChanged(e){this._changed=!(!0!==e&&null!=e),this._changed&&this.onChange()}isChanged(){return this._changed}addAll(e,a){const t={};let d;const i=e.find();for(let e=0;e<i.length;e++){const s=i[e];let n=s.getSubject(),r=s.getPredicate();const p=s.getCleanObject();a&&(p.ng=a),0===n.indexOf("_:")&&(d=t[n]||this._newBNode(),t[n]=d,n=d),0===r.indexOf("_:")&&(d=t[r]||this._newBNode(),t[r]=d,r=d),"bnode"===p.type&&(d=t[p.value]||this._newBNode(),t[p.value]=d,p.value=d),this.add(n,r,p)}}add(e,a=null,t=null,d=!1,i){if(e instanceof g){const a=e.getPredicate(),t=e.getObject(),s=e.getSubject();this._trackBNodes(s,a,t);const n=this._graphObject(t),r=M.add(this._graph,s,a,n,i);return!0!==d&&this.setChanged(),this._get(s,a,r,!0)}return this.create(e,a,t,!0,d,i)}addL(e,a,t,d){const i={type:"literal",value:t};return"string"==typeof d&&(i.lang=d),this.create(e,a,i,!0)}addD(e,a,t,d){const i={type:"literal",value:t};return"string"==typeof d&&(i.datatype=o(d)),this.create(e,a,i,!0)}create(e=null,a=null,t=null,d=!0,i=!1,s=!1){let n=e,r=a,p=t;if(n=null==n?this._newBNode():o(n),r=null==r?this._newBNode():o(r),null==p?p={type:"bnode",value:this._newBNode()}:M.isString(p)?p={type:"uri",value:o(p)}:"object"!=typeof p||Array.isArray(p)?p={type:"uri",value:""+p}:(p={type:p.type,value:p.value,lang:p.lang,datatype:p.datatype,ng:p.ng},"uri"===p.type&&null!=p.value&&(p.value=o(p.value)),p.datatype&&(p.datatype=o(p.datatype))),!1!==d){const e=M.add(this._graph,n,r,p,s);return!0!==i&&this.setChanged(),this._getOrCreate(n,r,e,!0)}return new g(this,n,r,p,!1)}findAndRemove(e,a,t,d=!1){const i=this.find(e,a,t);for(let e=0;e<i.length;e++)this.remove(i[e],d)}remove(e,a=!1){const t=e.getSubject(),d=e.getPredicate(),i=e.getObject();this._trackBNodes(t,d,i),null!=M.remove(this._graph,t,d,i)&&!0!==a&&this.setChanged()}find(e,a,t){let d=e,i=a,s=t;if("string"==typeof d&&(d=o(d)),"string"==typeof i&&(i=o(i)),"object"==typeof s&&null!==s&&"uri"===s.type?s.value=o(s.value):"string"==typeof s&&(s={type:"uri",value:o(s)}),null==s)return null==i?null==d?this._find():this._findS(d):null==d?this._findP(i):this._findSP(d,i);if(null==i)return null==d?this._findO(s):this._findSO(d,s);if(null==d)return this._findPO(i,s);const n=this._get(d,i,M.contains(this._graph,d,i,s),!0);return null==n?[]:[n]}findFirstValue(e,a){const t=this.find(e,a);if(t.length>0)return t[0].getValue()}projection(e,a,t){const d={};return Object.keys(a).forEach(i=>{const s=a[i],n=Array.isArray(s)?this.findPath(e,s):this.find(e,s);if(n.length>0)switch("*"===i[0]?d[i.substr(1)]=n.map(e=>e.getValue()):d[i]=n[0].getValue(),t||"none"){case"statement":d["*"+i]=n;break;case"objects":d["*"+i]=n.map(e=>e.getCleanObject());break;case"values":d["*"+i]=n.map(e=>e.getValue())}}),d}subjects(e,a){return b(this,this.find(null,e,a),!0)}subject(e,a){return b(this,D(this.find(null,e,a)),!0)}objects(e,a){return b(this,this.find(e,a,null))}object(e,a){return b(this,D(this.find(e,a,null)))}findPath(e,a){return a.slice(1).reduce((e,a)=>e.objects(a),this.objects(e,a[0])).statements()}addList(e){return this._addList(e,"add")}addListL(e,a){return this._addList(e,"addL",a)}addListD(e,a){return this._addList(e,"addD",a)}_addList(e,a,t){let d;if(Array.isArray(e)&&0!==e.length){d=this._newBNode();let i=d;const s=e.length-1;e.forEach((e,d)=>{this[a](i,"rdf:first",e,t),d!==s?i=this.add(i,"rdf:rest").getValue():this.add(i,"rdf:rest","rdf:nil")})}else d=o("rdf:nil");return d}removeList(e){let a=!1,t="object"==typeof e?e.value:e;try{const e=o("rdf:nil");for(a=t===e;t!==e&&null!=t;){const e=this.findFirstValue(t,"rdf:rest");this.findAndRemove(t),t=e,a=null!=t}}catch(e){return console.warn("Invalid list for object: "+t),!1}return a}getList(e){let a="object"==typeof e?e.value:o(e);const t=[];try{const e=o("rdf:nil");for(;a!==e&&null!=a;)t.push(this.find(a,"rdf:first")[0].getObject()),a=this.findFirstValue(a,"rdf:rest")}catch(e){console.warn("Invalid list for object: "+a)}return t}findFirstListAsValues(e,a){return this.getList(this.findFirstValue(e,a)).map(e=>e.value)}findAndRemoveLists(e,a){let t=!1;return this.find(e,a).forEach(e=>{this.removeList(e.getValue())&&(this.remove(e),t=!0)}),t}exportRDFJSON(e=!0){this._graph;return M.clone(this._graph,e)}replaceSubject(e,a){return this.replaceURI(e,a)}replaceURI(e,a){const t=this._graph;if(t.hasOwnProperty(e)){if(t.hasOwnProperty(a))throw new Error("Cannot replace subject with target URI since it already exists.");t[a]=t[e],delete t[e]}return this.forEach((t,d,i)=>{"uri"===i.type&&i.value===e&&(i.value=a),t===a&&i._statement&&(i._statement._s=a)}),this}replaceBlankWithURI(e,a){const t=this._graph;if(t.hasOwnProperty(e)){if(t.hasOwnProperty(a))throw new Error("Cannot replace subject with target URI since it already exists.");t[a]=t[e],delete t[e],this.forEach((t,d,i)=>{"bnode"===i.type&&i.value===e&&(i.value=a,i.type="uri"),t===a&&i._statement&&(i._statement._s=a)})}return delete this._bnodes[e],this}clone(){return new T(this.exportRDFJSON(!1))}findProperties(e){return Object.keys(this._graph[e]||{})}validate(){if(this.report=this._validate(),!this.report.valid)throw this.report;return this.report}registerBNode(e){this._bnodes[e]=!0}forEach(e){const a=this._graph;Object.keys(a).forEach(t=>{const d=a[t];Object.keys(d).forEach(a=>{d[a].forEach(d=>{e(t,a,d)})})})}map(e){const a=[];return this.forEach(t=>{a.push(e(t))}),a}equals(e,a){return Y(this,a)===Y(e,a)}size(){let e=0;return Object.values(this._graph).forEach(a=>{Object.values(a).forEach(a=>{e+=a.length})}),e}_get(e,a,t,d){if(null!=t)return this._getOrCreate(e,a,t,d)}_getOrCreate(e,a,t,d){return null==t._statement&&(t._statement=new g(this,e,a,t,d)),t._statement}_graphObject(e){return null==e._statement||e._statement._graph===this?e:{type:e.type,value:e.value,lang:e.lang,datatype:e.datatype}}_findSP(e,a){return null==this._graph[e]||null==this._graph[e][a]?[]:this._graph[e][a].map(t=>this._get(e,a,t,!0))}_findS(e){const a=this._graph[e],t=Object.keys(a||{}).map(a=>this._findSP(e,a));return Array.prototype.concat.apply([],t)}_find(){const e=[];return this.forEach((a,t,d)=>{e.push(this._get(a,t,d,!0))}),e}_findP(e){const a=[];return this.forEach((t,d,i)=>{e===d&&a.push(this._get(t,d,i,!0))}),a}_findO(e){const a=[];return this.forEach((t,d,i)=>{M.objectEquals(e,i)&&a.push(this._get(t,d,i,!0))}),a}_findSO(e,a){const t=[];return this.forEach((d,i,s)=>{e===d&&M.objectEquals(a,s)&&t.push(this._get(d,i,s,!0))}),t}_findPO(e,a){const t=[];return this.forEach((d,i,s)=>{e===i&&M.objectEquals(a,s)&&t.push(this._get(d,i,s,!0))}),t}_validate(){const e=this._graph,a={valid:!0,errors:[],nr:0};return Object.keys(e).forEach(t=>{const d=e[t];M.isObject(d)?Object.keys(d).forEach(e=>{const i=d[e];Array.isArray(i)?i.forEach((d,i)=>{M.isObject(d)?null!=d.type?M.isString(d.value)?a.nr+=1:(a.errors.push({s:t,p:e,oindex:i+1,message:`Object ${i+1} in object array must have the 'value' attribute pointing to a string.`}),a.valid=!1):(a.errors.push({s:t,p:e,oindex:i+1,message:`Object ${i+1} in object array lacks the attribute type, must be either 'literal', 'resource' or 'bnode'.`}),a.valid=!1):(a.errors.push({s:t,p:e,oindex:i+1,message:`Element ${i+1} in object array is not an object.`}),a.valid=!1)}):(a.errors.push({s:t,p:e,message:"Predicate must point to an array of objects."}),a.valid=!1)}):(a.errors.push({s:t,message:"Subject must point to an object."}),a.valid=!1)}),a}_newBNode(){let e,a,t;for(this._indexBNodes(),e=1;e<20;e++)for(a=1;a<=e;a++)if(t="_:"+Math.floor(Math.random()*(Math.pow(10,e)+1)),!0!==this._bnodes[t])return this._bnodes[t]=!0,t;throw new Error("Failed creating a new blank node, increadible unprobable...")}_indexBNodes(){if(this._bnodesIndexed)return;const e=this._graph;Object.keys(e).forEach(a=>{0===a.indexOf("_:")&&(this._bnodes[a]=!0);const t=e[a];Object.keys(t).forEach(e=>{0===e.indexOf("_:")&&(this._bnodes[e]=!0),t[e].forEach(e=>{"bnode"===e.type&&(this._bnodes[e.value]=!0)})})}),this._bnodesIndexed=!0}_trackBNodes(e,a,t){0===e.indexOf("_:")&&(this._bnodes[e]=!0),0===a.indexOf("_:")&&(this._bnodes[a]=!0),"bnode"===t.type&&(this._bnodes[t.value]=!0)}}const k=(e,a)=>{var t=a.indexOf("#");if(t>0&&(a=a.slice(0,t)),0==e.length)return a;if(0==e.indexOf("#"))return a+e;if(e.indexOf(":")>=0)return e;var d=a.indexOf(":");if(d<0)return console.log("Invalid base URL "+a),e;var i,s=a.slice(0,d+1);if(0==e.indexOf("//"))return s+e;if(a.indexOf("//",d)==d+1){if((i=a.indexOf("/",d+3))<0)return a.length-d-3>0?a+"/"+e:s+e}else if((i=a.indexOf("/",d+1))<0)return a.length-d-1>0?a+"/"+e:s+e;if(0==e.indexOf("/"))return a.slice(0,i)+e;var n=a.slice(i),r=n.lastIndexOf("/");if(r<0)return s+e;for(r>=0&&r<n.length-1&&(n=n.slice(0,r+1)),n+=e;n.match(/[^\/]*\/\.\.\//);)n=n.replace(/[^\/]*\/\.\.\//,"");return n=n.replace(/\.\//g,""),a.slice(0,i)+n};var S;S=function(e){S.ns={RDF:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",RDFS:"http://www.w3.org/2000/01/rdf-schema#"},S.nodeType={ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12},this.frameFactory=function(e,a,t){return{NODE:1,ARC:2,parent:a,parser:e,store:e.store,element:t,lastChild:0,base:null,lang:null,node:null,nodeType:null,listIndex:1,rdfid:null,datatype:null,collection:!1,terminateFrame:function(){this.collection&&this.node.close()},addSymbol:function(e,a){a=k(a,this.base),this.node=this.store.sym(a),this.nodeType=e},loadTriple:function(){if(this.parent.parent.collection?this.parent.parent.node.append(this.node):this.store.add(this.parent.parent.node,this.parent.node,this.node,this.parser.why),null!=this.parent.rdfid){var e=this.store.sym(k("#"+this.parent.rdfid,this.base));this.store.add(e,this.store.sym(S.ns.RDF+"type"),this.store.sym(S.ns.RDF+"Statement"),this.parser.why),this.store.add(e,this.store.sym(S.ns.RDF+"subject"),this.parent.parent.node,this.parser.why),this.store.add(e,this.store.sym(S.ns.RDF+"predicate"),this.parent.node,this.parser.why),this.store.add(e,this.store.sym(S.ns.RDF+"object"),this.node,this.parser.why)}},isTripleToLoad:function(){return null!=this.parent&&null!=this.parent.parent&&this.nodeType==this.NODE&&this.parent.nodeType==this.ARC&&this.parent.parent.nodeType==this.NODE},addNode:function(e){this.addSymbol(this.NODE,e),this.isTripleToLoad()&&this.loadTriple()},addCollection:function(){this.nodeType=this.NODE,this.node=this.store.collection(),this.collection=!0,this.isTripleToLoad()&&this.loadTriple()},addCollectionArc:function(){this.nodeType=this.ARC},addBNode:function(e){null!=e?null!=this.parser.bnodes[e]?this.node=this.parser.bnodes[e]:this.node=this.parser.bnodes[e]=this.store.bnode():this.node=this.store.bnode(),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()},addArc:function(e){e==S.ns.RDF+"li"&&(e=S.ns.RDF+"_"+this.parent.listIndex++),this.addSymbol(this.ARC,e)},addLiteral:function(e){this.parent.datatype?this.node=this.store.literal(e,"",this.store.sym(this.parent.datatype)):this.node=this.store.literal(e,this.lang),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()}}},this.store=e,this.bnodes={},this.why=null,this.reify=!1,this.parse=function(e,a,t){var d,i=e.childNodes;if(this.cleanParser(),e.nodeType==S.nodeType.DOCUMENT){for(var s=0;s<i.length;s++)if(i[s].nodeType==S.nodeType.ELEMENT){d=i[s];break}}else{if(e.nodeType!=S.nodeType.ELEMENT)throw new Error("RDFParser: can't find root in "+a+". Halting. ");d=e}this.why=t;var n=this.frameFactory(this);return n.base=a,n.lang="",this.parseDOM(this.buildFrame(n,d)),!0},this.parseDOM=function(e){for(var a=function(e){return e.namespaceURI+e.localName},t=!0;e.parent;){var d,i,s=e.element,n=s.attributes;if(s.nodeType==S.nodeType.TEXT||s.nodeType==S.nodeType.CDATA_SECTION)e.addLiteral(s.nodeValue);else if(a(s)!=S.ns.RDF+"RDF")if(e.parent&&e.parent.collection&&(e.addCollectionArc(),(e=this.buildFrame(e,e.element)).parent.element=null),e.parent&&e.parent.nodeType&&e.parent.nodeType!=e.ARC){e.addArc(a(s)),this.reify&&(d=s.getAttributeNodeNS(S.ns.RDF,"ID"))&&(e.rdfid=d.nodeValue,s.removeAttributeNode(d));var r=s.getAttributeNodeNS(S.ns.RDF,"parseType"),p=s.getAttributeNodeNS(S.ns.RDF,"datatype");if(p&&(e.datatype=p.nodeValue,s.removeAttributeNode(p)),r){var o=r.nodeValue;"Literal"==o?(e.datatype=S.ns.RDF+"XMLLiteral",(e=this.buildFrame(e)).addLiteral(s),t=!1):"Resource"==o?((e=this.buildFrame(e,e.element)).parent.element=null,e.addBNode()):"Collection"==o&&((e=this.buildFrame(e,e.element)).parent.element=null,e.addCollection()),s.removeAttributeNode(r)}if(0!=n.length){var l=s.getAttributeNodeNS(S.ns.RDF,"resource");for(i=s.getAttributeNodeNS(S.ns.RDF,"nodeID"),e=this.buildFrame(e),l?(e.addNode(l.nodeValue),s.removeAttributeNode(l)):i?(e.addBNode(i.nodeValue),s.removeAttributeNode(i)):e.addBNode(),h=n.length-1;h>=0;h--){var m=this.buildFrame(e);m.addArc(a(n[h])),a(n[h])==S.ns.RDF+"type"?this.buildFrame(m).addNode(n[h].nodeValue):this.buildFrame(m).addLiteral(n[h].nodeValue)}}else 0==s.childNodes.length&&this.buildFrame(e).addLiteral("")}else{var u=s.getAttributeNodeNS(S.ns.RDF,"about");if(d=s.getAttributeNodeNS(S.ns.RDF,"ID"),u&&d)throw new Error("RDFParser: "+s.nodeName+" has both rdf:id and rdf:about. Halting. Only one of these properties may be specified on a node.");null==u&&d?(e.addNode("#"+d.nodeValue),s.removeAttributeNode(d)):null==u&&null==d?(i=s.getAttributeNodeNS(S.ns.RDF,"nodeID"))?(e.addBNode(i.nodeValue),s.removeAttributeNode(i)):e.addBNode():(e.addNode(u.nodeValue),s.removeAttributeNode(u));var _=s.getAttributeNodeNS(S.ns.RDF,"type");S.ns.RDF+"Description"!=a(s)&&(_={nodeValue:a(s)}),null!=_&&(this.store.add(e.node,this.store.sym(S.ns.RDF+"type"),this.store.sym(k(_.nodeValue,e.base)),this.why),_.nodeName&&s.removeAttributeNode(_));for(var h=n.length-1;h>=0;h--)this.store.add(e.node,this.store.sym(a(n[h])),this.store.literal(n[h].nodeValue,e.lang),this.why)}for(s=e.element;e.parent;){for(var c=e;null==s;)s=(e=e.parent).element;var f=s.childNodes,y=null!=f?f[e.lastChild]:null;if(null!=y&&t){if((y.nodeType==S.nodeType.ELEMENT||y.nodeType==S.nodeType.TEXT||y.nodeType==S.nodeType.CDATA_SECTION)&&(y.nodeType!=S.nodeType.TEXT&&y.nodeType!=S.nodeType.CDATA_SECTION||1==s.childNodes.length)){e.lastChild++,e=this.buildFrame(c,s.childNodes[e.lastChild-1]);break}e.lastChild++}else{if(e.terminateFrame(),!(e=e.parent))break;s=e.element,t=!0}}}},this.cleanParser=function(){this.bnodes={},this.why=null},this.buildFrame=function(e,a){var t=this.frameFactory(this,e,a);if(e&&(t.base=e.base,t.lang=e.lang),null==a||a.nodeType==S.nodeType.TEXT||a.nodeType==S.nodeType.CDATA_SECTION)return t;var d=a.attributes,i=a.getAttributeNode("xml:base");null!=i&&(t.base=i.nodeValue,a.removeAttribute("xml:base"));var s=a.getAttributeNode("xml:lang");null!=s&&(t.lang=s.nodeValue,a.removeAttribute("xml:lang"));for(var n=d.length-1;n>=0;n--)"xml"==d[n].nodeName.substr(0,3)&&a.removeAttributeNode(d[n]);return t}};const j=e=>"object"==typeof e?e:"string"==typeof e?new P(e):void(void 0!==e&&alert(`Can't make term from ${e} of type ${typeof e}`)),N=function(){return this};N.prototype.termType="empty",N.prototype.toString=function(){return""},N.prototype.toNT=function(){return""};const x=function(){return"<"+this.uri+">"},O=function(e){return this.uri=e,this};O.prototype.termType="symbol",O.prototype.toString=x,O.prototype.toNT=x;let H=0;const E=function(){return this.id=H++,this};E.prototype.termType="bnode",E.prototype.toNT=function(){return"_:n"+this.id},E.prototype.toString=E.prototype.toNT;const P=function(e,a,t){return this.value=e,this.lang=a,this.datatype=t,this};P.prototype.termType="literal",P.prototype.toNT=function(){const e=this.value;if("string"!=typeof e)throw Error("Value of RDF literal is not string: "+e);return e=e.replace(/\\/g,"\\\\"),e=e.replace(/"/g,'\\"'),e='"'+e+'"',this.datatype&&(e=e+"^^"+this.datatype),this.lang&&(e=e+"@"+this.lang),e},P.prototype.toString=function(){return this.value};const A=function(){this.id=H++,this.elements=[],this.closed=!1};A.prototype.termType="collection",A.prototype.toNT=function(){return"_:n"+this.id},A.prototype.toString=A.prototype.toNT,A.prototype.append=function(e){this.elements.push(e)},A.prototype.close=function(){this.closed=!0};const V=function(){return this.subject.toNT()+" "+this.predicate.toNT()+" "+this.object.toNT()+" ."},C=function(e,a,t,d){return this.subject=j(e),this.predicate=j(a),this.object=j(t),void 0!==d&&(this.why=d),this};C.prototype.toNT=V,C.prototype.toString=V;const F=function(){return this.statements=[],this.constraints=[],this.initBindings=[],this.optional=[],this},R=function(){return"{\n"+this.statements.join("\n")+"}"};F.prototype.termType="formula",F.prototype.toNT=R,F.prototype.toString=R,F.prototype.add=function(e,a,t,d){this.statements.push(new C(e,a,t,d))},F.prototype.sym=function(e,a){return null!=a&&(e=this.namespaces[e]+a),new O(e)},F.prototype.literal=function(e,a,t){return new P(e.toString(),a,t)},F.prototype.bnode=function(){return new E},F.prototype.formula=function(){return new F},F.prototype.collection=function(){return new A};const I=function(e){return this.uri=k(e,"varid:"),this};I.prototype.termType="variable",I.prototype.toNT=function(){return"varid:"==this.uri.slice(0,"varid:".length)?"?"+this.uri.slice("varid:".length):"?"+this.uri},I.prototype.toString=I.prototype.toNT,I.prototype.classOrder=7,F.prototype.variable=function(e){return new I(e)},I.prototype.hashString=I.prototype.toNT,F.prototype.fromNT=function(e){const a=e.length,t=e.slice(0,1);if("<"===t)return this.sym(e.slice(1,a-1));if("_"===t){const a=new E;return a.id=parseInt(e.slice(3)),H--,a}alert(`Can't yet convert from NT: '${e}', ${e[0]}`)};let W,B;Error;if("undefined"==typeof window||void 0===window.DOMParser&&"undefined"==typeof ActiveXObject){W=e=>(new XMLSerializer).serializeToString(e);const e=u.a.DOMParser;B=a=>(new e).parseFromString(a,"text/xml")}else W=e=>e.xml,B=e=>{let a;try{if(window.DOMParser){a=(new DOMParser).parseFromString(e,"text/xml")}else a=new ActiveXObject("Microsoft.XMLDOM"),a.async="false",a.loadXML(e)}catch(e){a=null}if(!a||!a.documentElement||a.getElementsByTagName("parsererror").length)throw new Error("Could not parse text as xml");return a};const z={rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",owl:"http://www.w3.org/2002/07/owl#"},U={rdftype:z.rdf+"type",rdfssco:z.rdfs+"subClassOf",rdfsdomain:z.rdfs+"domain",rdfsrange:z.rdfs+"range",rdfsspo:z.rdfs+"subPropertyOf",rdfsClass:z.rdfs+"Class",owlClass:z.owl+"Class",owlObjectProperty:z.owl+"ObjectProperty",owlDatatypeProperty:z.owl+"DatatypeProperty",rdfProperty:z.rdf+"Property"},J=(e,a,t)=>{const d={};let i=!1;const s=e.find(a,t);for(let e=0;e<s.length;e++){const a=s[e];"literal"===a.getType()&&(d[a.getLanguage()||""]=a.getValue()||"",i=!0)}if(i)return null==d.en&&null!=d[""]&&(d.en=d[""],delete d[""]),d},G=e=>{const a=[],t={};for(let d=0;d<e.length;d++){const i=e[d];t[i]||(a.push(i),t[i]=!0)}return a},$=class{constructor(e,a){this._uri=e,this._parents=[],this._children=[],this._graph=a}getURI(){return this._uri}getLabel(){const e=this.getLabels();if(null!=e.en)return e.en;const a=Object.objects(e);return a.length>0?a[0]:""}getLabels(){return null==this._labels&&(this._labels=J(this._graph,this._uri,z.rdfs+"label"),null==this._labels&&(this._labels={en:this._uri.substr(this._uri.lastIndexOf("/")+1)})),this._labels}getComment(){const e=this.getComments();return null!=e?null!=e.en?e.en:Object.objects(e)[0]:""}getComments(){return null==this._comments&&(this._comments=J(this._graph,this._uri,z.rdfs+"comment")),this._comments}addParent(e){this._parents.push(e),e._children.push(this)}getDirectParents(){return this._parents}getParents(){if(this._parentLock)return[];if(this._parentLock=!0,null==this._allParents){this._allParents=[];for(let e=0;e<this._parents.length;e++)this._allParents=this._allParents.concat(this._parents[e].getParents()),this._allParents.push(this._parents[e])}return delete this._parentLock,this._allParents}getChildren(){if(this._childLock)return[];if(this._childLock=!0,null==this._allChildren){this._allChildren=[];for(let e=0;e<this._children.length;e++)this._allChildren=this._allChildren.concat(this._children[e].getChildren()),this._allChildren.push(this._children[e])}return delete this._childLock,this._allChildren}setRange(e){null==this._range&&(this._range=[]),this._range.push(e)}setDomain(e){null==this._domain&&(this._domain=[]),this._domain.push(e),e.setDomainOf(this)}getRange(){if(null==this._allRange){this._allRange=this._range||[];for(let e=0;e<this._parents.length;e++)this._allRange=this._allRange.concat(this._parents[e].getRange());this._allRange=G(this._allRange)}return this._allRange}getDomain(){if(null==this._allDomain){this._allDomain=this._domain||[];for(let e=0;e<this._parents.length;e++)this._allDomain=this._allDomain.concat(this._parents[e].getDomain());this._allDomain=G(this._allDomain)}return this._allDomain}setDomainOf(e){null==this._domainOf&&(this._domainOf=[]),this._domainOf.push(e)}getDomainOf(){return this._domainOf}getAllDomainOf(){if(this._domainOfLock)return[];if(this._domainOfLock=!0,null==this._allDomainOf){const e=this._domainOf||[];this._allDomainOf=this._domainOf||[];for(let a=0;a<e.length;a++)this._allDomainOf=this._allDomainOf.concat(e[a].getChildren());for(let e=0;e<this._parents.length;e++)this._allDomainOf=this._allDomainOf.concat(this._parents[e].getAllDomainOf())}return delete this._domainOfLock,this._allDomainOf}},q=function(e,a,t,d){for(let i=0;i<t.length;i++){const s=t[i],n=s.getSubject();let r=e[n];if(r||(r=new $(n,s.getGraph()),e[n]=r,a.push(r)),d){const t=s.getValue();let d=e[t];d||(d=new $(t,s.getGraph()),e[t]=d,a.push(d)),r.addParent(d)}}},K=class{constructor(){this._cidx={},this._carr=[],this._pidx={},this._parr=[]}addGraph(e){q(this._cidx,this._carr,e.find(null,U.rdftype,U.rdfsClass)),q(this._cidx,this._carr,e.find(null,U.rdftype,U.owlClass)),q(this._cidx,this._carr,e.find(null,U.rdfssco,null),!0),q(this._pidx,this._parr,e.find(null,U.rdftype,U.rdfProperty)),q(this._pidx,this._parr,e.find(null,U.rdfsspo,null),!0),q(this._pidx,this._parr,e.find(null,U.rdftype,U.owlDatatypeProperty)),q(this._pidx,this._parr,e.find(null,U.rdftype,U.owlObjectProperty)),function(e,a,t){let d,i,s,n=e.find(null,U.rdfsdomain,null);for(let e=0;e<n.length;e++)s=n[e],d=a[s.getSubject()],i=t[s.getValue()],null!=d&&null!=i&&d.setDomain(i);n=e.find(null,U.rdfsrange,null);for(let e=0;e<n.length;e++)s=n[e],d=a[s.getSubject()],i=s.getValue(),null!=d&&null!=i&&d.setRange(i)}(e,this._pidx,this._cidx)}addThing(){const e="http://www.w3.org/2002/07/owl#Thing";let a=this._cidx[e],t=!1;a||(a=new $(e,new T),this._cidx[e]=a,this._carr.push(a),t=!0);for(let e=0;e<this._carr.length;e++){const d=this._carr[e];(t&&d!==a||-1===d.getParents().indexOf(a)&&d!==a)&&d.addParent(a)}}getClasses(){return this._carr}getProperties(){return this._parr}isClass(e){return null!=this._cidx[e]}isProperty(e){return null!=this._pidx[e]}getClass(e){return this._cidx[e]}getProperty(e){return this._pidx[e]}static getInstances(e){const a=[],t=[e].concat(e.getChildren());for(let e=0;e<t.length;e++){const d=t[e],i=d.getGraph.find(null,U.rdftype,d.getURI());for(let e=0;e<i.length;e++)a.push(i[e].getSubject())}return a}};K.prototype.ns=z,K.prototype.terms=U,K.global=new K;var Z=t(0),X=t.n(Z);var Q=function(){this.__data__=[],this.size=0};var ee=function(e,a){return e===a||e!=e&&a!=a};var ae=function(e,a){for(var t=e.length;t--;)if(ee(e[t][0],a))return t;return-1},te=Array.prototype.splice;var de=function(e){var a=this.__data__,t=ae(a,e);return!(t<0)&&(t==a.length-1?a.pop():te.call(a,t,1),--this.size,!0)};var ie=function(e){var a=this.__data__,t=ae(a,e);return t<0?void 0:a[t][1]};var se=function(e){return ae(this.__data__,e)>-1};var ne=function(e,a){var t=this.__data__,d=ae(t,e);return d<0?(++this.size,t.push([e,a])):t[d][1]=a,this};function re(e){var a=-1,t=null==e?0:e.length;for(this.clear();++a<t;){var d=e[a];this.set(d[0],d[1])}}re.prototype.clear=Q,re.prototype.delete=de,re.prototype.get=ie,re.prototype.has=se,re.prototype.set=ne;var pe=re;var oe=function(){this.__data__=new pe,this.size=0};var le=function(e){var a=this.__data__,t=a.delete(e);return this.size=a.size,t};var me=function(e){return this.__data__.get(e)};var ue=function(e){return this.__data__.has(e)},_e=t(1),he=_e.a.Symbol,ce=Object.prototype,fe=ce.hasOwnProperty,ye=ce.toString,ve=he?he.toStringTag:void 0;var Me=function(e){var a=fe.call(e,ve),t=e[ve];try{e[ve]=void 0;var d=!0}catch(e){}var i=ye.call(e);return d&&(a?e[ve]=t:delete e[ve]),i},ge=Object.prototype.toString;var we=function(e){return ge.call(e)},Le=he?he.toStringTag:void 0;var Ye=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Le&&Le in Object(e)?Me(e):we(e)};var De=function(e){var a=typeof e;return null!=e&&("object"==a||"function"==a)};var be,Te=function(e){if(!De(e))return!1;var a=Ye(e);return"[object Function]"==a||"[object GeneratorFunction]"==a||"[object AsyncFunction]"==a||"[object Proxy]"==a},ke=_e.a["__core-js_shared__"],Se=(be=/[^.]+$/.exec(ke&&ke.keys&&ke.keys.IE_PROTO||""))?"Symbol(src)_1."+be:"";var je=function(e){return!!Se&&Se in e},Ne=Function.prototype.toString;var xe=function(e){if(null!=e){try{return Ne.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Oe=/^\[object .+?Constructor\]$/,He=Function.prototype,Ee=Object.prototype,Pe=He.toString,Ae=Ee.hasOwnProperty,Ve=RegExp("^"+Pe.call(Ae).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Ce=function(e){return!(!De(e)||je(e))&&(Te(e)?Ve:Oe).test(xe(e))};var Fe=function(e,a){return null==e?void 0:e[a]};var Re=function(e,a){var t=Fe(e,a);return Ce(t)?t:void 0},Ie=Re(_e.a,"Map"),We=Re(Object,"create");var Be=function(){this.__data__=We?We(null):{},this.size=0};var ze=function(e){var a=this.has(e)&&delete this.__data__[e];return this.size-=a?1:0,a},Ue=Object.prototype.hasOwnProperty;var Je=function(e){var a=this.__data__;if(We){var t=a[e];return"__lodash_hash_undefined__"===t?void 0:t}return Ue.call(a,e)?a[e]:void 0},Ge=Object.prototype.hasOwnProperty;var $e=function(e){var a=this.__data__;return We?void 0!==a[e]:Ge.call(a,e)};var qe=function(e,a){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=We&&void 0===a?"__lodash_hash_undefined__":a,this};function Ke(e){var a=-1,t=null==e?0:e.length;for(this.clear();++a<t;){var d=e[a];this.set(d[0],d[1])}}Ke.prototype.clear=Be,Ke.prototype.delete=ze,Ke.prototype.get=Je,Ke.prototype.has=$e,Ke.prototype.set=qe;var Ze=Ke;var Xe=function(){this.size=0,this.__data__={hash:new Ze,map:new(Ie||pe),string:new Ze}};var Qe=function(e){var a=typeof e;return"string"==a||"number"==a||"symbol"==a||"boolean"==a?"__proto__"!==e:null===e};var ea=function(e,a){var t=e.__data__;return Qe(a)?t["string"==typeof a?"string":"hash"]:t.map};var aa=function(e){var a=ea(this,e).delete(e);return this.size-=a?1:0,a};var ta=function(e){return ea(this,e).get(e)};var da=function(e){return ea(this,e).has(e)};var ia=function(e,a){var t=ea(this,e),d=t.size;return t.set(e,a),this.size+=t.size==d?0:1,this};function sa(e){var a=-1,t=null==e?0:e.length;for(this.clear();++a<t;){var d=e[a];this.set(d[0],d[1])}}sa.prototype.clear=Xe,sa.prototype.delete=aa,sa.prototype.get=ta,sa.prototype.has=da,sa.prototype.set=ia;var na=sa;var ra=function(e,a){var t=this.__data__;if(t instanceof pe){var d=t.__data__;if(!Ie||d.length<199)return d.push([e,a]),this.size=++t.size,this;t=this.__data__=new na(d)}return t.set(e,a),this.size=t.size,this};function pa(e){var a=this.__data__=new pe(e);this.size=a.size}pa.prototype.clear=oe,pa.prototype.delete=le,pa.prototype.get=me,pa.prototype.has=ue,pa.prototype.set=ra;var oa=pa;var la=function(e,a){for(var t=-1,d=null==e?0:e.length;++t<d&&!1!==a(e[t],t,e););return e},ma=function(){try{var e=Re(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var ua=function(e,a,t){"__proto__"==a&&ma?ma(e,a,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[a]=t},_a=Object.prototype.hasOwnProperty;var ha=function(e,a,t){var d=e[a];_a.call(e,a)&&ee(d,t)&&(void 0!==t||a in e)||ua(e,a,t)};var ca=function(e,a,t,d){var i=!t;t||(t={});for(var s=-1,n=a.length;++s<n;){var r=a[s],p=d?d(t[r],e[r],r,t,e):void 0;void 0===p&&(p=e[r]),i?ua(t,r,p):ha(t,r,p)}return t};var fa=function(e,a){for(var t=-1,d=Array(e);++t<e;)d[t]=a(t);return d};var ya=function(e){return null!=e&&"object"==typeof e};var va=function(e){return ya(e)&&"[object Arguments]"==Ye(e)},Ma=Object.prototype,ga=Ma.hasOwnProperty,wa=Ma.propertyIsEnumerable,La=va(function(){return arguments}())?va:function(e){return ya(e)&&ga.call(e,"callee")&&!wa.call(e,"callee")},Ya=Array.isArray,Da=t(6),ba=/^(?:0|[1-9]\d*)$/;var Ta=function(e,a){var t=typeof e;return!!(a=null==a?9007199254740991:a)&&("number"==t||"symbol"!=t&&ba.test(e))&&e>-1&&e%1==0&&e<a};var ka=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Sa={};Sa["[object Float32Array]"]=Sa["[object Float64Array]"]=Sa["[object Int8Array]"]=Sa["[object Int16Array]"]=Sa["[object Int32Array]"]=Sa["[object Uint8Array]"]=Sa["[object Uint8ClampedArray]"]=Sa["[object Uint16Array]"]=Sa["[object Uint32Array]"]=!0,Sa["[object Arguments]"]=Sa["[object Array]"]=Sa["[object ArrayBuffer]"]=Sa["[object Boolean]"]=Sa["[object DataView]"]=Sa["[object Date]"]=Sa["[object Error]"]=Sa["[object Function]"]=Sa["[object Map]"]=Sa["[object Number]"]=Sa["[object Object]"]=Sa["[object RegExp]"]=Sa["[object Set]"]=Sa["[object String]"]=Sa["[object WeakMap]"]=!1;var ja=function(e){return ya(e)&&ka(e.length)&&!!Sa[Ye(e)]};var Na=function(e){return function(a){return e(a)}},xa=t(4),Oa=xa.a&&xa.a.isTypedArray,Ha=Oa?Na(Oa):ja,Ea=Object.prototype.hasOwnProperty;var Pa=function(e,a){var t=Ya(e),d=!t&&La(e),i=!t&&!d&&Object(Da.a)(e),s=!t&&!d&&!i&&Ha(e),n=t||d||i||s,r=n?fa(e.length,String):[],p=r.length;for(var o in e)!a&&!Ea.call(e,o)||n&&("length"==o||i&&("offset"==o||"parent"==o)||s&&("buffer"==o||"byteLength"==o||"byteOffset"==o)||Ta(o,p))||r.push(o);return r},Aa=Object.prototype;var Va=function(e){var a=e&&e.constructor;return e===("function"==typeof a&&a.prototype||Aa)};var Ca=function(e,a){return function(t){return e(a(t))}},Fa=Ca(Object.keys,Object),Ra=Object.prototype.hasOwnProperty;var Ia=function(e){if(!Va(e))return Fa(e);var a=[];for(var t in Object(e))Ra.call(e,t)&&"constructor"!=t&&a.push(t);return a};var Wa=function(e){return null!=e&&ka(e.length)&&!Te(e)};var Ba=function(e){return Wa(e)?Pa(e):Ia(e)};var za=function(e,a){return e&&ca(a,Ba(a),e)};var Ua=function(e){var a=[];if(null!=e)for(var t in Object(e))a.push(t);return a},Ja=Object.prototype.hasOwnProperty;var Ga=function(e){if(!De(e))return Ua(e);var a=Va(e),t=[];for(var d in e)("constructor"!=d||!a&&Ja.call(e,d))&&t.push(d);return t};var $a=function(e){return Wa(e)?Pa(e,!0):Ga(e)};var qa=function(e,a){return e&&ca(a,$a(a),e)},Ka=t(155);var Za=function(e,a){var t=-1,d=e.length;for(a||(a=Array(d));++t<d;)a[t]=e[t];return a};var Xa=function(e,a){for(var t=-1,d=null==e?0:e.length,i=0,s=[];++t<d;){var n=e[t];a(n,t,e)&&(s[i++]=n)}return s};var Qa=function(){return[]},et=Object.prototype.propertyIsEnumerable,at=Object.getOwnPropertySymbols,tt=at?function(e){return null==e?[]:(e=Object(e),Xa(at(e),(function(a){return et.call(e,a)})))}:Qa;var dt=function(e,a){return ca(e,tt(e),a)};var it=function(e,a){for(var t=-1,d=a.length,i=e.length;++t<d;)e[i+t]=a[t];return e},st=Ca(Object.getPrototypeOf,Object),nt=Object.getOwnPropertySymbols?function(e){for(var a=[];e;)it(a,tt(e)),e=st(e);return a}:Qa;var rt=function(e,a){return ca(e,nt(e),a)};var pt=function(e,a,t){var d=a(e);return Ya(e)?d:it(d,t(e))};var ot=function(e){return pt(e,Ba,tt)};var lt=function(e){return pt(e,$a,nt)},mt=Re(_e.a,"DataView"),ut=Re(_e.a,"Promise"),_t=Re(_e.a,"Set"),ht=Re(_e.a,"WeakMap"),ct=xe(mt),ft=xe(Ie),yt=xe(ut),vt=xe(_t),Mt=xe(ht),gt=Ye;(mt&&"[object DataView]"!=gt(new mt(new ArrayBuffer(1)))||Ie&&"[object Map]"!=gt(new Ie)||ut&&"[object Promise]"!=gt(ut.resolve())||_t&&"[object Set]"!=gt(new _t)||ht&&"[object WeakMap]"!=gt(new ht))&&(gt=function(e){var a=Ye(e),t="[object Object]"==a?e.constructor:void 0,d=t?xe(t):"";if(d)switch(d){case ct:return"[object DataView]";case ft:return"[object Map]";case yt:return"[object Promise]";case vt:return"[object Set]";case Mt:return"[object WeakMap]"}return a});var wt=gt,Lt=Object.prototype.hasOwnProperty;var Yt=function(e){var a=e.length,t=new e.constructor(a);return a&&"string"==typeof e[0]&&Lt.call(e,"index")&&(t.index=e.index,t.input=e.input),t},Dt=_e.a.Uint8Array;var bt=function(e){var a=new e.constructor(e.byteLength);return new Dt(a).set(new Dt(e)),a};var Tt=function(e,a){var t=a?bt(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.byteLength)},kt=/\w*$/;var St=function(e){var a=new e.constructor(e.source,kt.exec(e));return a.lastIndex=e.lastIndex,a},jt=he?he.prototype:void 0,Nt=jt?jt.valueOf:void 0;var xt=function(e){return Nt?Object(Nt.call(e)):{}};var Ot=function(e,a){var t=a?bt(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)};var Ht=function(e,a,t){var d=e.constructor;switch(a){case"[object ArrayBuffer]":return bt(e);case"[object Boolean]":case"[object Date]":return new d(+e);case"[object DataView]":return Tt(e,t);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Ot(e,t);case"[object Map]":return new d;case"[object Number]":case"[object String]":return new d(e);case"[object RegExp]":return St(e);case"[object Set]":return new d;case"[object Symbol]":return xt(e)}},Et=Object.create,Pt=function(){function e(){}return function(a){if(!De(a))return{};if(Et)return Et(a);e.prototype=a;var t=new e;return e.prototype=void 0,t}}();var At=function(e){return"function"!=typeof e.constructor||Va(e)?{}:Pt(st(e))};var Vt=function(e){return ya(e)&&"[object Map]"==wt(e)},Ct=xa.a&&xa.a.isMap,Ft=Ct?Na(Ct):Vt;var Rt=function(e){return ya(e)&&"[object Set]"==wt(e)},It=xa.a&&xa.a.isSet,Wt=It?Na(It):Rt,Bt={};Bt["[object Arguments]"]=Bt["[object Array]"]=Bt["[object ArrayBuffer]"]=Bt["[object DataView]"]=Bt["[object Boolean]"]=Bt["[object Date]"]=Bt["[object Float32Array]"]=Bt["[object Float64Array]"]=Bt["[object Int8Array]"]=Bt["[object Int16Array]"]=Bt["[object Int32Array]"]=Bt["[object Map]"]=Bt["[object Number]"]=Bt["[object Object]"]=Bt["[object RegExp]"]=Bt["[object Set]"]=Bt["[object String]"]=Bt["[object Symbol]"]=Bt["[object Uint8Array]"]=Bt["[object Uint8ClampedArray]"]=Bt["[object Uint16Array]"]=Bt["[object Uint32Array]"]=!0,Bt["[object Error]"]=Bt["[object Function]"]=Bt["[object WeakMap]"]=!1;var zt=function e(a,t,d,i,s,n){var r,p=1&t,o=2&t,l=4&t;if(d&&(r=s?d(a,i,s,n):d(a)),void 0!==r)return r;if(!De(a))return a;var m=Ya(a);if(m){if(r=Yt(a),!p)return Za(a,r)}else{var u=wt(a),_="[object Function]"==u||"[object GeneratorFunction]"==u;if(Object(Da.a)(a))return Object(Ka.a)(a,p);if("[object Object]"==u||"[object Arguments]"==u||_&&!s){if(r=o||_?{}:At(a),!p)return o?rt(a,qa(r,a)):dt(a,za(r,a))}else{if(!Bt[u])return s?a:{};r=Ht(a,u,p)}}n||(n=new oa);var h=n.get(a);if(h)return h;n.set(a,r),Wt(a)?a.forEach((function(i){r.add(e(i,t,d,i,a,n))})):Ft(a)&&a.forEach((function(i,s){r.set(s,e(i,t,d,s,a,n))}));var c=m?void 0:(l?o?lt:ot:o?$a:Ba)(a);return la(c||a,(function(i,s){c&&(i=a[s=i]),ha(r,s,e(i,t,d,s,a,n))})),r};var Ut=function(e){return zt(e,5)};const Jt=(e,a,t,d)=>{if("URI"===e.getNodetype()||"RESOURCE"===e.getNodetype()){let t=Kt.getLocalizedMap(d,a,e.getURIValueLabelProperties());if(!t){const e=a.lastIndexOf("#"),d=a.lastIndexOf("/");t=e>0||d>0?{"":decodeURIComponent(a.substring(1+(e>d?e:d)))}:{"":a}}return{value:a,label:t}}return{value:a,label:a}};var Gt={hasDnDSupport:e=>!1,addDnD:(e,a,t)=>({}),attachExternalLinkBehaviour:()=>!1,attachLinkBehaviour:(e,a)=>!1,openChoiceSelector:(e,a)=>{alert('This alert is a placeholder for a search dialog that should be provided as part of the integration of RDForms into a wider system.\nSimply override the methods "getChoices" and "openChoiceSelector" in the system module.'),a({value:"http://example.com/choice1",label:{en:"First choice",sv:"Första valet"}})},getChoice:(e,a,t,d)=>Jt(e,a,0,d),getFallbackChoice:Jt,labelProperties:["http://www.w3.org/2000/01/rdf-schema#label","http://purl.org/dc/terms/title","http://purl.org/dc/elements/1.1/title","http://www.w3.org/2004/02/skos/core#prefLabel","http://xmlns.com/foaf/0.1/name","http://xmlns.com/foaf/name"],createURI:(e,a)=>{const t=a.getChildrenRootUri(),d=t.lastIndexOf("#"),i=-1===d?t+"#":t.substring(0,d+1),s=a.getGraph()._graph;for(;;){const e=i+("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4);if(null==s[e])return e}}};const $t=e=>{const a=X.a.locale();if(null==e)return{precision:"none"};if("string"==typeof e)return{value:e,precision:"nolang",lang:""};if(e.hasOwnProperty(a))return{value:e[a],precision:"exact",lang:a};if(a.indexOf("_")>-1&&e.hasOwnProperty(a.substr(0,2)))return{value:e[a.substr(0,2)],precision:"coarsen",lang:a.substr(0,2)};if(e.hasOwnProperty("en"))return{value:e.en,precision:"default",lang:"en"};if(e.hasOwnProperty(""))return{value:e[""],precision:"nolang",lang:""};const t=Object.keys(e);return t.length>0?{value:e[t[0]],precision:"any",lang:t[0]}:{precision:"none"}},qt=(e,a,t)=>{const d=e.find(a,t);if(d.length>0){const e={};for(let a=0;a<d.length;a++)e[d[a].getLanguage()||""]=d[a].getValue();return e}};var Kt={getLocalizedValue:$t,getLocalizedMap:(e,a,t)=>{let d,i=a,s=t;e.getItem?(d=e.getGraph(),i=e.getValue(),s=e.getItem().getURIValueLabelProperties()):d=e,null!=s&&0!==s.length||(s=Gt.labelProperties);for(let e=0;e<s.length;e++){const a=s[e];if(Array.isArray(a)){const e=[];for(let t=0;t<a.length;t++){const s=qt(d,i,a[t]);s&&e.push($t(s).value)}if(e.length>0)return{"":e.join(" ")}}else{const e=qt(d,i,a);if(e)return e}}},cloneArrayWithLabels:(e,a)=>{const t=[];for(let a=0;a<e.length;a++){const d=e[a],i=$t(d.label),s={value:d.value,label:i.value||d.value||""};!0===d.top&&(s.top=!0),null!=d.children&&(s.children=Ut(d.children)),!1===d.selectable?s.selectable=!1:s.selectable=!0,t.push(s)}return!0!==a&&t.sort((e,a)=>e.label>a.label?1:-1),t},extractGist:(e,a)=>{let t=a;if(t){-1===t.indexOf("$1")&&(t+="$1");const a=(""+t).replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1").replace("\\$1","(.*)"),d=new RegExp(a).exec(e);if(null!=d)return d[1]}return e},findFirstValue:(e,a,t,d)=>{const i=e.findFirstValueBinding(e.match(a,t,d),!1);if(i)return i.getChoice?$t(i.getChoice().label).value:i.getGist()},generateUUID:()=>{let e=(new Date).getTime();return"undefined"!=typeof performance&&"function"==typeof performance.now&&(e+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,a=>{const t=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===a?t:3&t|8).toString(16)})}};let Zt=0;const Xt=(e,a,t)=>{null==t||""===t||Array.isArray(t)&&0===t.length?delete e[a]:e[a]=t};class Qt{constructor({source:e={},bundle:a,itemStore:t}){this._itemStore=t,this._source=e,this._bundle=a,Zt+=1,this._internalId=Zt,this._styles=["heading","invisible","invisibleGroup","stars","commentOn","multiline","horizontalRadioButtons","verticalRadioButtons","horizontalCheckBoxes","verticalCheckBoxes","nonEditable","expandable","compact","nonCompact","dropDown","table","firstcolumnfixedtable","tree","externalLink","internalLink","noLink","image","label","tooltip","strictmatch","relaxedDatatypeMatch","viewAllTranslations","filterTranslations","email","atLeastOneChild","atMostOneChild","exactlyOneChild","noLabelInPresent","autoInitDate","autoUpdateDate","autoUUID","autoValue","showURI","showLink","showValue","showDescriptionInPresent","showDescriptionInEdit","textAsChoice","preserveOrderOfChoices","linkWithLabel","deprecated","inline","truncate","noTruncate"],this._getLocalizedValue=Kt.getLocalizedValue}getId(){const e=this.getSource(!0);return e.id||e["@id"]}setId(e){Xt(this.getSource(!0),"id",e),delete s["@id"]}getType(e){const a=this.getSource(e);return a.type||a["@type"]}setType(e){Xt(this.getSource(!0),"type",e),delete s["@type"],this.refreshExtends()}getExtends(){return this.getSource(!0).extends||""}refreshExtends(){this.isExtention&&this.setExtends(this.getExtends())}setExtends(e){const a=this.getSource(!0),t=this._itemStore.getItem(e);this._source=null==t?a:this._itemStore.createExtendedSource(t.getSource(),a),""===e||null==e?delete a.extends:a.extends=e}isExtention(){return null!=this.getExtends()}_getText(e,a,t){const d=this.getSource(t);return a?Kt.getLocalizedValue(d[e]):Kt.getLocalizedValue(d[e]).value}_setText(e,a,t){const d=this.getSource(!0);d[e]=this._setLangHash(d[e],a,t),this.refreshExtends()}_setTextMap(e,a){Xt(this.getSource(!0),e,a),this.refreshExtends()}getLabel(e,a){return this._getText("label",e,a)}setLabel(e,a){this._setText("label",e,a)}getLabelMap(e){return this.getSource(e).label}setLabelMap(e){this._setTextMap("label",e)}getEditLabel(e,a){return this._getText("editlabel",e,a)}setEditLabel(e,a){this._setText("editlabel",e,a)}getEditLabelMap(e){return this.getSource(e).editlabel}setEditLabelMap(e){this._setTextMap("editlabel",e)}getDescription(e,a){return this._getText("description",e,a)}setDescription(e,a){this._setText("description",e,a)}getDescriptionMap(e){return this.getSource(e).description}setDescriptionMap(e){this._setTextMap("description",e)}getEditDescription(e,a){return this._getText("editdescription",e,a)}setEditDescription(e,a){this._setText("editdescription",e,a)}getEditDescriptionMap(e){return this.getSource(e).editdescription}setEditDescriptionMap(e){this._setTextMap("editdescription",e)}getHelp(e,a){return this._getText("help",e,a)}setHelp(e,a){this._setText("help",e,a)}getHelpMap(e){return this.getSource(e).help}setHelpMap(e){this._setTextMap("help",e)}getPlaceholder(e,a){return this._getText("placeholder",e,a)}setPlaceholder(e,a){this._setText("placeholder",e,a)}getPlaceholderMap(e){return this.getSource(e).placeholder}setPlaceholderMap(e){this._setTextMap("placeholder",e)}getPurpose(e,a){return this._getText("purpose",e,a)}setPurpose(e,a){this._setText("purpose",e,a)}getPurposeMap(e){return this.getSource(e).purpose}setPurposeMap(e){this._setTextMap("purpose",e)}getSpecification(e,a){return this._getText("specification",e,a)}setSpecification(e,a){this._setText("specification",e,a)}getSpecificationMap(e){return this.getSource(e).specification}setSpecificationMap(e){this._setTextMap("specification",e)}getProperty(e){let a=null;const t=this.getSource(e);return t&&(a=t.property,null!=a&&""!==a&&(a=o(a))),a}setProperty(e){Xt(this.getSource(!0),"property",e),this.refreshExtends()}getURIValueLabelProperties(e){const a=this.getSource(e).uriValueLabelProperties;return null!=a?a.map(e=>o(e)):a}setURIValueLabelProperties(e){Xt(this.getSource(!0),"uriValueLabelProperties",e),this.refreshExtends()}getConstraints(e){const a=this.getSource(e).constraints;if(null!=a){const e={};return Object.keys(a).forEach(t=>{const d=a[t];Array.isArray(d)?e[o(t)]=d.map(e=>o(e)):e[o(t)]=o(d)}),e}return a}setConstraints(e){Xt(this.getSource(!0),"constraints",e),this.refreshExtends()}getDeps(e){const a=this.getSource(e).deps;return null!=a?a.map(e=>"*"!==e&&".."!==e?o(e):e):a}setDeps(e){Xt(this.getSource(!0),"deps",e),this.refreshExtends()}getDatatype(e){const a=this.getSource(e).datatype;return null!=a&&""!==a?Array.isArray(a)?a.map(e=>o(e)):o(a):a}setDatatype(e){Xt(this.getSource(!0),"datatype",e),this.refreshExtends()}getPattern(e){return this.getSource(e).pattern}setPattern(e){Xt(this.getSource(!0),"pattern",e),this.refreshExtends()}getLanguage(e){return this.getSource(e).language}setLanguage(e){Xt(this.getSource(!0),"language",e),this.refreshExtends()}getMember(e){return this.getSource(e).member}setMember(e){Xt(this.getSource(!0),"member",e),this.refreshExtends()}getNodetype(e){const a=this.getSource(e);return a.nodetype||a.nodeType}setNodetype(e){Xt(this.getSource(!0),"nodetype",e),this.refreshExtends()}getValue(e){return this.getSource(e).value}setValue(e){Xt(this.getSource(!0),"value",e),this.refreshExtends()}getValueTemplate(e){return this.getSource(e).valueTemplate}setValueTemplate(e){Xt(this.getSource(!0),"valueTemplate",e),this.refreshExtends()}getCardinality(e){if(!this.getProperty()&&"text"===this.getType())return{min:1,max:1};const a=this.getSource(e);return a&&"cardinality"in a?a.cardinality:this.getProperty()?{}:{max:1}}setCardinality(e){Xt(this.getSource(!0),"cardinality",e),this.refreshExtends()}isEnabled(e){const a=this.getSource(e);return null==a.enabled||a.enabled}setEnabled(e){const a=this.getSource(!0);e?delete a.enabled:a.enabled=e,this.refreshExtends()}getClasses(e){const a=this.getSource(e);return a&&"cls"in a?a.cls:[]}setClasses(e){Xt(this.getSource(!0),"cls",e),this.refreshExtends()}hasClass(e,a){const t=this.getSource(a);return!!this.hasStyle(e,a)||null!=t.cls&&t.cls.some(a=>a.toLowerCase()===e.toLowerCase())}getAvailableStyles(){return this._styles}getStyles(e){return this.getSource(e).styles||[]}setStyles(e){Xt(this.getSource(!0),"styles",e),this.refreshExtends()}hasStyle(e,a){const t=this.getSource(a);return!(!t||!("styles"in t))&&t.styles.some(a=>a.toLowerCase()===e.toLowerCase())}getSource(e){if(!0===e)return this._source._extendedSource||this._source;if(!1===e){const e=this._itemStore.getItem(this.getExtends());return null==e?this._source:e.getSource()}return this._source}getBundle(){return this._bundle}toStringShort(){return`'${this.getLabel()}'${this.getId()?` (ID: '${this.getId()}')`:""}`}toString(){const e=[];return this.getId()&&e.push(`ID: '${this.getId()}'`),e.push(`TYPE: '${this.getType()}'`),this.getProperty()&&e.push(`PROPERTY: '${this.getProperty()}'`),this.getExtends()&&e.push(`EXTENDS: '${this.getExtends()}'`),`'${this.getLabel()}' (${e.join(", ")})`}_setLangHash(e,a,t){const d=e||{};if("string"==typeof a)"string"==typeof t?d[t]=a:d[""]=a;else if("object"==typeof a&&null!==a)return a;return d}}class ed extends Qt{constructor(e){super(e),this._children=e.children,null!=this._source.content&&(this._source.items=this._source.content,delete this._source.content),this._forceChildrenClones=!1,this._parent=null}getChildren(e){const a=e&&this.isExtention();let t=a?this._ochildren:this._children;var d;return null==t&&(t=this._itemStore.getChildren(this,a),!0===this.getSource().automatic&&this._itemStore.automaticSortAllowed&&((d=t).forEach(e=>{e.__label=(e.getLabel()||"").toLowerCase()}),d.sort((e,a)=>null!=e._source.priority?null!=a._source.priority?e._source.priority>a._source.priority?-1:e._source.priority<a._source.priority?1:0:e._source.priority>0?-1:1:null!=a._source.priority?a._source.priority>0?1:-1:e.__label>a.__label?1:e.__label<a.__label?-1:0)),this[`_${a?"o":""}children`]=t),t}originalChildrenChanged(){this.isExtention()&&delete this._children}setExtends(e){super.setExtends(e),delete this._children,delete this._ochildren}getNodetype(){return super.getNodetype()||"RESOURCE"}}class ad extends ed{getChildren(e){if(null==this._delegatedChildren){const a=()=>({min:1,max:1,pref:1}),t=super.getChildren(e)||[];this._delegatedChildren=t.map(e=>{const t=Object.create(e);return t.getCardinality=a,t})}return this._delegatedChildren}getPropertyItem(){return this.getChildren()[0]}getObjectItem(){return this.getChildren()[1]}}class td extends Qt{getLabelProperties(e){return this.getSource(e).labelProperties}}const dd=e=>{null!=e&&e.forEach(e=>{e.value=o(e.value)})};class id extends Qt{constructor(e){super(e),this._ontologyStore=e.ontologyStore}getChoices(e){return this.getStaticChoices(e)||this.getDynamicChoices(e)||[]}hasChoices(e){const a=this.getSource(e);return null!=a.ontologyUrl||null!=a.choices}hasStaticChoices(e){return null!=this.getSource(e).choices}getStaticChoices(e){const a=this.getSource(e);if(a.choices){const t=-1===this.getNodetype().indexOf("LITERAL");e&&this.isExtention()?this._origStaticIsSorted||(t&&dd(a.choices),this._origStaticIsSorted=!0):this._staticIsSorted||(t&&dd(a.choices),this._staticIsSorted=!0)}return a.choices}setStaticChoices(e){const a=this.getSource(!0);a.choices!==e&&(null!=e&&(this._origStaticIsSorted=!0),a.choices=e,this.refreshExtends())}setExtends(e){super.setExtends(e),delete this._staticIsSorted,delete this._origStaticIsSorted}getDynamicChoices(e){if(null==this._dynamicChoices){if(null==e)return this._dynamicChoices=this._ontologyStore.getChoices(this),this._dynamicChoices;this._ontologyStore.getChoices(this,a=>{this._dynamicChoices=a,null==this._dynamicChoices&&(console.log("Failed lookup of choices for "+this.getLabel()),console.log("OntologyUrl is: "+this._source.ontologyUrl)),e(this._dynamicChoices)})}else{if(null==e)return this._dynamicChoices;e(this._dynamicChoices)}}getOntologyUrl(e){const a=this.getSource(e).ontologyUrl;return null!=a&&""!==a?o(a):a}setOntologyUrl(e){const a=this.getSource(!0);null==e||""===e?delete a.ontologyUrl:a.ontologyUrl=e,this.refreshExtends()}getLabelProperties(e){return this.getSource(e).labelProperties||["http://www.w3.org/2000/01/rdf-schema#label"]}getParentProperty(e){const a=this.getSource(e).parentProperty;return null!=a&&""!==a?o(a):a}setParentProperty(e){const a=this.getSource(!0);null==e||""===e?delete a.parentProperty:a.parentProperty=e,this.refreshExtends()}getHierarchyProperty(e){const a=this.getSource(e).hierarchyProperty;return null!=a&&""!==a?o(a):a}setHierarchyProperty(e){const a=this.getSource(!0);null==e||""===e?delete a.hierarchyProperty:a.hierarchyProperty=e,this.refreshExtends()}isParentPropertyInverted(e){return!0===this.getSource(e).isParentPropertyInverted}setParentPropertyInverted(e){const a=this.getSource(!0);!0===e?a.isParentPropertyInverted=!0:delete a.isParentPropertyInverted,this.refreshExtends()}isHierarchyPropertyInverted(e){return!0===this.getSource(e).isHierarchyPropertyInverted}setHierarchyPropertyInverted(e){const a=this.getSource(!0);e?a.isHierarchyPropertyInverted=!0:delete a.isHierarchyPropertyInverted,this.refreshExtends()}}var sd=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};var nd=function(e){return this.__data__.has(e)};function rd(e){var a=-1,t=null==e?0:e.length;for(this.__data__=new na;++a<t;)this.add(e[a])}rd.prototype.add=rd.prototype.push=sd,rd.prototype.has=nd;var pd=rd;var od=function(e,a){for(var t=-1,d=null==e?0:e.length;++t<d;)if(a(e[t],t,e))return!0;return!1};var ld=function(e,a){return e.has(a)};var md=function(e,a,t,d,i,s){var n=1&t,r=e.length,p=a.length;if(r!=p&&!(n&&p>r))return!1;var o=s.get(e),l=s.get(a);if(o&&l)return o==a&&l==e;var m=-1,u=!0,_=2&t?new pd:void 0;for(s.set(e,a),s.set(a,e);++m<r;){var h=e[m],c=a[m];if(d)var f=n?d(c,h,m,a,e,s):d(h,c,m,e,a,s);if(void 0!==f){if(f)continue;u=!1;break}if(_){if(!od(a,(function(e,a){if(!ld(_,a)&&(h===e||i(h,e,t,d,s)))return _.push(a)}))){u=!1;break}}else if(h!==c&&!i(h,c,t,d,s)){u=!1;break}}return s.delete(e),s.delete(a),u};var ud=function(e){var a=-1,t=Array(e.size);return e.forEach((function(e,d){t[++a]=[d,e]})),t};var _d=function(e){var a=-1,t=Array(e.size);return e.forEach((function(e){t[++a]=e})),t},hd=he?he.prototype:void 0,cd=hd?hd.valueOf:void 0;var fd=function(e,a,t,d,i,s,n){switch(t){case"[object DataView]":if(e.byteLength!=a.byteLength||e.byteOffset!=a.byteOffset)return!1;e=e.buffer,a=a.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=a.byteLength||!s(new Dt(e),new Dt(a)));case"[object Boolean]":case"[object Date]":case"[object Number]":return ee(+e,+a);case"[object Error]":return e.name==a.name&&e.message==a.message;case"[object RegExp]":case"[object String]":return e==a+"";case"[object Map]":var r=ud;case"[object Set]":var p=1&d;if(r||(r=_d),e.size!=a.size&&!p)return!1;var o=n.get(e);if(o)return o==a;d|=2,n.set(e,a);var l=md(r(e),r(a),d,i,s,n);return n.delete(e),l;case"[object Symbol]":if(cd)return cd.call(e)==cd.call(a)}return!1},yd=Object.prototype.hasOwnProperty;var vd=function(e,a,t,d,i,s){var n=1&t,r=ot(e),p=r.length;if(p!=ot(a).length&&!n)return!1;for(var o=p;o--;){var l=r[o];if(!(n?l in a:yd.call(a,l)))return!1}var m=s.get(e),u=s.get(a);if(m&&u)return m==a&&u==e;var _=!0;s.set(e,a),s.set(a,e);for(var h=n;++o<p;){var c=e[l=r[o]],f=a[l];if(d)var y=n?d(f,c,l,a,e,s):d(c,f,l,e,a,s);if(!(void 0===y?c===f||i(c,f,t,d,s):y)){_=!1;break}h||(h="constructor"==l)}if(_&&!h){var v=e.constructor,M=a.constructor;v==M||!("constructor"in e)||!("constructor"in a)||"function"==typeof v&&v instanceof v&&"function"==typeof M&&M instanceof M||(_=!1)}return s.delete(e),s.delete(a),_},Md=Object.prototype.hasOwnProperty;var gd=function(e,a,t,d,i,s){var n=Ya(e),r=Ya(a),p=n?"[object Array]":wt(e),o=r?"[object Array]":wt(a),l="[object Object]"==(p="[object Arguments]"==p?"[object Object]":p),m="[object Object]"==(o="[object Arguments]"==o?"[object Object]":o),u=p==o;if(u&&Object(Da.a)(e)){if(!Object(Da.a)(a))return!1;n=!0,l=!1}if(u&&!l)return s||(s=new oa),n||Ha(e)?md(e,a,t,d,i,s):fd(e,a,p,t,d,i,s);if(!(1&t)){var _=l&&Md.call(e,"__wrapped__"),h=m&&Md.call(a,"__wrapped__");if(_||h){var c=_?e.value():e,f=h?a.value():a;return s||(s=new oa),i(c,f,t,d,s)}}return!!u&&(s||(s=new oa),vd(e,a,t,d,i,s))};var wd=function e(a,t,d,i,s){return a===t||(null==a||null==t||!ya(a)&&!ya(t)?a!=a&&t!=t:gd(a,t,d,i,e,s))};var Ld=function(e,a){return wd(e,a)};class Yd{constructor(){this._registry={}}importRegistry(e){Object.assign(this._registry,e)}getChoices(e,a){const t=this._findChoices(e);if(null==t);else{if(null==a)return t;a(t)}}_findChoices(e){const a=this._registry[e.getOntologyUrl()];if(null!=a)for(let t=0;t<a.length;t++){const d=a[t];if(Ld(d.constraints,e.getConstraints())&&e.getParentProperty()===d.parentProperty&&e.getHierarchyProperty()===d.hierarchyProperty&&e.isParentPropertyInverted()===(d.isParentPropertyInverted||!1)&&e.isHierarchyPropertyInverted()===(d.isHierarchyPropertyInverted||!1))return d.choices}}_constructLoadUrl(e){const a=[];if(a.push("constr="+encodeURIComponent(JSON.stringify(e.getConstraints()))),null!=e.getParentProperty()){const t=!0===e.isParentPropertyInverted()?"ipp=":"pp=";a.push(t+encodeURIComponent(e.getParentProperty()))}if(null!=e.getHierarchyProperty()){const t=!0===e.isHierarchyPropertyInverted()?"ihp=":"hp=";a.push(t+encodeURIComponent(e.getHierarchyProperty()))}return`${e.getOntologyUrl()}?${a.join("&")}`}}let Dd=0;class bd{constructor({itemStore:e,source:a,path:t,readOnly:d=!1}){this._itemStore=e,this._source=a,this._path=t,this._readOnly=d,this._items=[],Dd+=1,this._id="_bundle_"+Dd,this._root=null,this._modified=!1}getInternalId(){return this._id}getSource(){return this._source}setRoot(e){return this._source.root=e,e}getRoot(){if(this._source.root)return this._itemStore.getItem(this._source.root)}getItemStore(){return this._itemStore}getPath(){return this._path}getItems(){return this._items}addItem(e){this._items.push(e)}removeItem(e){this._items.splice(this._items.indexOf(e),1)}isModified(){return this._modified}setModified(e){this._modified=e}isReadOnly(){return this._readOnly||null==this._path}}let Td=0;class kd{constructor({item:e,statement:a,graph:t,matchingCode:d}){this._item=e,this._statement=a,this._graph=t,this._ancestorValid=!0,this._cardinalityTracker=null,this._hash="b_"+Td,this._matchingCode=d||"correct",Td+=1}getGraph(){return this._graph||(this._statement?this._graph=this._statement.getGraph():this._parent&&(this._graph=this._parent.getGraph())),this._graph}isReadOnly(){if(!("_readOnly"in this)){const e=this.getParent();e&&e._readOnly?this._readyOnly=!0:this._readOnly=!(!this._statement||!this._statement.getNamedGraph())}return this._readOnly}remove(){}setSubject(e){}getValue(){}setValue(e,a){}getGist(){return Kt.extractGist(this.getValue(),this.getItem().getValueTemplate())}setGist(e,a){let t=e,d=this.getItem().getValueTemplate();d&&t.length>0&&(-1===d.indexOf("$1")&&(d+="$1"),t=d.replace("$1",t)),this.setValue(t,a)}getCardinalityTracker(){return this._cardinalityTracker}setCardinalityTracker(e){this._cardinalityTracker=e}getItem(){return this._item}getStatement(){return this._statement}getParent(){return this._parent}setParent(e){this._parent=e}isValid(){}getMatchingCode(){return this._matchingCode}setMatchingCode(e){this._matchingCode=e}setAncestorValid(e){this._ancestorValid=e,this.updateAssertions()}updateAssertions(){}getHash(){return this._hash}addListener(e){this._listeners||(this._listeners=[]),this._listeners.push(e)}removeListener(e){if(this._listeners){const a=this._listeners.indexOf(e);-1!==a&&this._listeners.splice(a,1)}}bindingChange(e){if(this._listeners)for(let a=0;a<this._listeners.length;a++)this._listeners[a](e);this._parent&&this._parent.bindingChange(e),this._cardinalityTracker&&this._cardinalityTracker.touch()}_isValidObjectValue(e){let a=e;if("string"!=typeof a&&null!==a)throw new Error("In a binding every object value need to be a string!");const t=this._item.getPattern();return t?(a=Kt.extractGist(a,this.getItem().getValueTemplate()),null!=a&&""!==a&&new RegExp(`^${t}$`).test(a)):null!=a&&""!==a}_isValidPredicateValue(e){if("string"!=typeof e&&null!==e)throw new Error("In a binding every predicate need to be a string!");return null!=e&&""!==e}}class Sd extends kd{constructor(e){super(e),this._validObject=!0,this._validPredicate=!0,this._excludeFromTreeValidityCheck=!1,this._statement&&(this._validPredicate=this._isValidPredicateValue(this._statement.getPredicate(),!0),this._validObject=this._isValidObjectValue(this._statement.getValue()))}getValue(){return this._statement.getValue()}setValue(e,a){const t="string"==typeof e?e.trim():e,d=this._validObject;this._isValidObjectValue(t)?(this._statement.setValue(t,a),this._validObject=!0,!0===d||!0!==this._validPredicate||this._excludeFromTreeValidityCheck||this._parent.oneChildValidityChanged(!0)):(""!==t&&null!==t||this._statement.setValue("",a),this._validObject=!1,!1!==d&&!0===this._validPredicate&&this._parent.oneChildValidityChanged(!1)),this.updateAssertions()}setSubject(e){this._statement.setSubject(e)}getPredicate(){return this._statement.getPredicate()}setPredicate(e){const a=this._validPredicate;this._isValidPredicateValue(e)?(this._statement.setPredicate(e),this._validPredicate=!0,!0!==a&&!0===this._validObject&&this._parent.oneChildValidityChanged(!0)):(this._validPredicate=!1,!1!==a&&!0===this._validObject&&this._parent.oneChildValidityChanged(!1)),this.updateAssertions()}getLanguage(){return this._statement.getLanguage()}setLanguage(e,a){this._statement.setLanguage(e,a),a||this.bindingChange(this)}getDatatype(){return this._statement.getDatatype()}setDatatype(e){this._statement.setDatatype(o(e)),this.updateAssertions()}setExcludeFromTreeValidityCheck(e){this._excludeFromTreeValidityCheck=e}remove(){this.setValue(null),this._parent.removeChildBinding(this),super.remove(arguments)}updateAssertions(){const e=this._ancestorValid&&this._validObject&&this._validPredicate;this._statement.setAsserted(e,!0),this.bindingChange(this)}isValid(){return this._validObject&&this._validPredicate&&!this._excludeFromTreeValidityCheck}}var jd={UNKNOWN:"unknown",OK:"correct",TOO_FEW_VALUES:"few",TOO_FEW_VALUES_MIN:"min",TOO_FEW_VALUES_PREF:"pref",TOO_MANY_VALUES:"many",AT_MOST_ONE_CHILD:"atmostonechild",AT_LEAST_ONE_CHILD:"atleastonechild",EXACTLY_ONE_CHILD:"exactlyonechild",WRONG_VALUE:"value",WRONG_PATTERN:"pattern",WRONG_NODETYPE:"nodetype",WRONG_DATATYPE:"datatype",MISSING_LANGUAGE:"language",MISSING_CONSTRAINTS:"constraints"};const Nd="http://www.w3.org/2000/01/rdf-schema#seeAlso";class xd extends Sd{constructor({choice:e,item:a,statement:t,matchingCode:d}){super({choice:e,item:a,statement:t,matchingCode:d}),this._choice=e,this._validPredicate=null!=a.getProperty()}static get seeAlso(){return Nd}setChoice(e,a){this._choice=e,null==e?this.setValue(null,null,a):this.getValue()!==e.value&&this.setValue(e.value,e,a),e&&e.mismatch?this.setMatchingCode(jd.WRONG_VALUE):e&&e.mismatch||this.getMatchingCode()!==jd.WRONG_VALUE||this.setMatchingCode(jd.OK)}getChoice(){return this._choice}setValue(e,a,t){const d=this.getValue();super.setValue(e,a,t);const i=this._statement.getGraph();if(i.findAndRemove(d,"http://www.w3.org/2000/01/rdf-schema#label",void 0,t),i.findAndRemove(d,Nd,void 0,t),null!=e&&null!=a&&(a.seeAlso&&a.inlineSeeAlso&&i.create(e,Nd,a.seeAlso,!0,t),!0===a.inlineLabel)){const d=a.label||{};Object.keys(d).forEach(a=>i.create(e,"http://www.w3.org/2000/01/rdf-schema#label",{value:d[a],lang:a,type:"literal"},!0,t))}}}class Od{constructor(e){this._listener=[],this._limits=e.getCardinality()||{},this._counter=0,this._depsOk=!0,this._listeners=[],this._code=0}addListener(e){return this._listeners.push(e),e}removeListener(e){this._listeners.splice(this._listeners.indexOf(e),1)}cardinalityChanged(){this._listeners.forEach(e=>e())}getCardinality(){return this._counter}isMax(){return null!=this._limits.max&&this._counter>=this._limits.max}isMin(){return null!=this._limits.min&&this._counter<=this._limits.min}isFine(){return this._fine}isDepsOk(){return this._depsOk}getCode(){return this._code}setCode(e){this._code!==e&&(this._code=e,this.cardinalityChanged())}setDepsOk(e){this._depsOk!==e&&(this._code=jd.UNKNOWN,this._depsOk=e,this.cardinalityChanged())}increment(){this._counter+=1,this._code=jd.UNKNOWN,this._checkCounter()}decrement(){this._counter-=1,this._code=jd.UNKNOWN,this._checkCounter()}getCounter(){return this._counter}checkCardinality(){this._checkCounter()}touch(){this._code=jd.UNKNOWN,this.cardinalityChanged()}_checkCounter(){null!=this._limits.max&&this._counter===this._limits.max?this._fine=!0:null!=this._limits.max&&this._counter>this._limits.max?this._fine=!1:null!=this._limits.min&&this._counter===this._limits.min?this._fine=!0:null!=this._limits.min&&this._counter<this._limits.min&&(this._fine=!1),this.cardinalityChanged()}}class Hd extends kd{constructor(e){super(e);const{constraints:a=[],childrenRootUri:t=null}=e;this._constraints=a,this._childBindings=this._item.getChildren().map(()=>[]),this._rootUri=t,this._validPredicate=!0,this._validObject=!0,this._statement&&(this._validPredicate=this._isValidPredicateValue(this._statement.getPredicate()),this._validObject=this._isValidObjectValue(this._statement.getValue(),this._statement.getType())),this._cachedChildBindings=null}getValue(){return this.getChildrenRootUri()}oneChildValidityChanged(e){return e!==this._oneValidChild&&(!(!e&&(delete this._oneValidChild,this.isValid()))&&(this._oneValidChild=e,this._notifyValidityChange(e&&this._validPredicate&&this._validObject),this._validPredicate&&this._validObject))}setSubject(e){this._statement?this._statement.setSubject(e):this.getChildBindings().forEach(a=>a.setSubject(e))}getChildrenRootUri(){return this._statement?this._statement.getValue():null!=this._rootUri?this._rootUri:null!=this._parent?this._parent.getChildrenRootUri():void 0}addChildBinding(e){this.addChildBindings([e])}addChildBindings(e){if(this._cachedChildBindings=null,!Array.isArray(e)||0===e.length)return;const a=e[0].getItem(),t=this._item.getChildren();for(let d=t.length;d>=0;d--)if(a===t[d]){const t=this._childBindings[d].length>0?this._childBindings[d][0].getCardinalityTracker():new Od(a);this._childBindings[d]=this._childBindings[d].concat(e),e.forEach(e=>{e.setParent(this),e.setCardinalityTracker(t),t.increment()},this);break}}removeChildBinding(e){this._cachedChildBindings=null;const a=this._item.getChildren();for(let t=a.length;t>=0;t--)if(e.getItem()===a[t]){this._childBindings[t].splice(this._childBindings[t].indexOf(e),1),delete e._parent,e.getCardinalityTracker().decrement();break}this.oneChildValidityChanged(),this.bindingChange(e)}getChildBindingsFor(e){const a=this._item.getChildren();for(let t=a.length;t>=0;t--)if(e===a[t])return this._childBindings[t]}getItemGroupedChildBindings(){return this._childBindings}getChildBindings(){return null==this._cachedChildBindings&&(this._childBindings&&this._childBindings.length>0?this._cachedChildBindings=[].concat(...this._childBindings):this._cachedChildBindings=[]),this._cachedChildBindings}setPredicate(e){const a=this._validPredicate;this._isValidPredicateValue(e)?(this._statement.setPredicate(e),this._validPredicate=!0,!0!==a&&this._validObject&&("URI"===this.getItem().getNodetype()||this._oneValidChild)&&this._notifyValidityChange(!0)):(this._validPredicate=!1,!1!==a&&this._validObject&&("URI"===this.getItem().getNodetype()||this._oneValidChild)&&this._notifyValidityChange(!1)),this.updateAssertions()}getValue(){return this._statement&&this._statement.isObjectBlank()?"":this._statement&&this._statement.getValue()}setValue(e){if("URI"!==this.getItem().getNodetype()||!this._statement)throw new Error("Cannot change the value of a group unless its nodetype is URI and also that it corresponds to a statement");const a=this._validObject;this._isValidObjectValue(e,"uri")?(this._validObject=!0,this._statement._o.type="uri",this._statement.setValue(e),this._constraints.forEach(a=>a.setSubject(e)),this.getChildBindings().forEach(a=>a.setSubject(e)),!a&&this._validPredicate&&this._notifyValidityChange(!0)):(this._validObject=!1,a&&this._validPredicate&&this._notifyValidityChange(!1))}getPredicate(){return this._statement?this._statement.getPredicate():void 0}remove(){this._oneValidChild=!1,this.setAncestorValid(!1),null!=this._parent&&this._parent.removeChildBinding(this),super.remove(arguments)}_isValid(){return"URI"===this.getItem().getNodetype()?this._validObject&&this._validPredicate:this._oneValidChild&&this._validPredicate&&this._validObject}isValid(){return null==this._oneValidChild&&(this._oneValidChild=this._forceOneValidChildCheck()),this._isValid()}setAncestorValid(e){this._ancestorValid=e,this.updateAssertions(),this._childBindings.forEach(a=>a.forEach(a=>a.setAncestorValid(e&&this._isValid()),this),this)}updateAssertions(){null==this._oneValidChild&&this.isValid();const e=this._ancestorValid&&this._isValid();null!=this._statement&&this._statement.setAsserted(e),this._constraints.forEach(a=>a.setAsserted(e)),this.getChildBindings().forEach(e=>e.updateAssertions())}_forceOneValidChildCheck(){return this._childBindings.some(e=>e.some(e=>e.isValid()))}_notifyValidityChange(e){this._parent&&this._parent.oneChildValidityChanged(e)||(this.updateAssertions(),this._childBindings.forEach(a=>a.forEach(a=>a.setAncestorValid(e))))}_isValidObjectValue(e,a){return("URI"!==this.getItem().getNodetype()||"uri"===a)&&super._isValidObjectValue(e)}}class Ed extends xd{constructor(e){super(e),this._objectBinding=e.objectBinding}remove(){}setValue(e){this._objectBinding.setPredicate(e)}getValue(){return this._objectBinding.getPredicate()}isValid(){return!1}updateAssertions(){}}class Pd extends Hd{constructor(e){super(e);const{statement:a,constraints:t}=e;this._statement=void 0,this._validPredicate=!0,this._constraints=[];const d=this._item.getChildren(),i=d[1];let s;s=i instanceof ed?new Hd({item:i,statement:a,constraints:t}):i instanceof id?new xd({item:i,statement:a}):new Sd({item:i,statement:a});const n=new Ed({item:d[0],objectBinding:s});this.addChildBinding(n),this.addChildBinding(s)}getPredicateBinding(){return this._childBindings[0][0]}getObjectBinding(){return this._childBindings[1][0]}getGraph(){return this.getObjectBinding().getGraph()}}class Ad extends Sd{getValue(){return this._parent.getValue()}setValue(e){return this._parent.setValue(e)}getGist(){return this._parent.getGist()}setGist(e,a){return this._parent.setGist(e,a)}setSubject(e){}getPredicate(){return this._parent.getPredicate()}remove(){this._parent.removeChildBinding(this),super.remove(arguments)}updateAssertions(){}isValid(){return!0}}let Vd,Cd,Fd,Rd,Id,Wd=!1;const Bd=(e,a,t)=>{const d=new Hd({item:t,childrenRootUri:a,graph:e});return Vd(d),Wd=!0,Vd(d),Wd=!1,Cd(d),d},zd=(e,a,t,d)=>{const i=e.findProperties(a),s=[],n={};if(null!=d){const e=a=>{null!=a.getProperty()?n[a.getProperty()]=!0:a instanceof ed&&a.getChildren().forEach(e)},a=a=>{null!=a&&(e(a),s.push(a))};d.forEach(e=>{let d=t.getItem(e);null!=d?d instanceof ed&&null==d.getProperty()?d.getChildren().forEach(a):a(d):(d=t.getItemByProperty(e),d?a(d):console.warn(`Warning, when autodetecting a template: Required item '${e}' is neither an id for a loaded item or a property for a loaded item, ignoring.`))})}return i.forEach(e=>{if(n[e])return;const a=t.getItemByProperty(e);null!=a&&s.push(a)},void 0),t.createTemplateFromChildren(s)},Ud=e=>Array.isArray(e.getDatatype())?e.getDatatype()[0]:e.getDatatype(),Jd=(e,a,t)=>a instanceof td?((e,a)=>{if(!a.getProperty()){const t=new Ad({item:a,statement:null,matchingCode:jd.OK});return e.addChildBinding(t),t}const t=e.getGraph(),d=a.getNodetype(),i={value:"",type:"literal"};"URI"===d?i.type="uri":"DATATYPE_LITERAL"===d&&(i.datatype=Ud(a));const s=a.getValue();if(null!=s&&0===e.getChildBindingsFor(a).length){i.value=s;const e=a.getLanguage();null!=e&&(i.lang=e)}const n=t.create(e.getChildrenRootUri(),a.getProperty(),i,!1),r=new Sd({item:a,statement:n});return e.addChildBinding(r),r})(e,a):a instanceof ad?((e,a)=>{let t,d;const i=a.getChildren()[1],s=e.getGraph();i instanceof ed?(t=s.create(e.getChildrenRootUri(),"",null,!1),d=Id(s,t.getSubject(),i)):t=i instanceof id?s.create(e.getChildrenRootUri(),"",{type:"uri",value:""},!1):s.create(e.getChildrenRootUri(),"",{type:"literal",value:""},!1);const n=new Pd({item:a,statement:t,constraints:d});return e.addChildBinding(n),i instanceof ed&&i.getChildren().forEach(e=>{Jd(n.getObjectBinding(),e)}),n})(e,a):a instanceof ed?((e,a,t)=>{let d,i;if(void 0!==a.getProperty()){const t=e.getGraph();d=(a.getNodetype(),t.create(e.getChildrenRootUri(),a.getProperty(),null,!1)),i=Id(t,d.getValue(),a)}const s=new Hd({item:a,statement:d,constraints:i});e.addChildBinding(s);const n=a._source["@id"];if(n){if(t[n])return s;t[n]=!0}return s})(e,a,t||{}):a instanceof id?((e,a)=>{const t=e.getGraph(),d=a.getNodetype(),i={type:"literal",value:""};"DATATYPE_LITERAL"===d?i.datatype=Ud(a):"RESOURCE"!==d&&"URI"!==d||(i.type="uri");const s=t.create(e.getChildrenRootUri(),a.getProperty(),i,!1),n=new xd({item:a,statement:s});e.addChildBinding(n);const r=a.getValue(),p=n.getCardinalityTracker();return null!=r&&1===p.getCounter()&&n.setChoice(Zd(a,r,t),!0),n})(e,a):void 0;let Gd,$d,qd,Kd,Zd,Xd;Vd=e=>{Wd&&e.getChildBindings().forEach(e=>{"group"===e.getItem().getType()&&Vd(e)}),e.getItem().getChildren().forEach(a=>{Wd?void 0!==a.getProperty()&&Gd(e,a):Gd(e,a)})};Gd=(e,a)=>{a instanceof id?((e,a)=>{if(null==a.getProperty())return;const t=[];e.getGraph().find(e.getChildrenRootUri(),a.getProperty()).forEach(e=>{if(Fd(e)){const d=$d(a,e),i=qd(a,e),s=Kd(a,e);if(d&&i&&s||Wd){const n=Zd(a,e.getValue(),e.getGraph());if(void 0!==n){Rd(e);let r=d?jd.OK:jd.WRONG_NODETYPE;i?s?n.mismatch&&(r=jd.WRONG_VALUE):r=jd.WRONG_PATTERN:r=jd.WRONG_DATATYPE,t.push(new xd({item:a,statement:e,choice:n,matchingCode:r}))}}}}),t.length>0&&e.addChildBindings(t)})(e,a):a instanceof ad?((e,a)=>{const t=a.getPropertyItem(),d=a.getObjectItem(),i=e.getGraph();let s,n,r,p;const o=[];i.find(e.getChildrenRootUri()).forEach(e=>{Fd(e)&&$d(d,e)&&Kd(d,e)&&(r=Zd(t,e.getPredicate(),e.getGraph()),void 0!==r&&(n=null,d instanceof ed?(s=Xd(i,e.getValue(),d),void 0!==s&&(Rd(e),n=new Pd({item:a,statement:e,constraints:s}),Vd(n.getObjectBinding()))):d instanceof id?(p=Zd(d,e.getValue(),e.getGraph()),void 0!==p&&(Rd(e),n=new Pd({item:a,statement:e}),n.getObjectBinding().setChoice(p))):(Rd(e),n=new Pd({item:a,statement:e})),null!==n&&(n.getPredicateBinding().setChoice(r),o.push(n))))}),o.length>0&&e.addChildBindings(o)})(e,a):a instanceof ed?((e,a)=>{let t,d,i,s;const n=e.getGraph();void 0!==a.getProperty()?(t=n.find(e.getChildrenRootUri(),a.getProperty()),t.length>0&&(d=[],t.forEach(e=>{if(Fd(e)){const t=Kd(a,e),r=$d(a,e);if((t&&r||Wd)&&(i=Xd(n,e.getValue(),a),void 0!==i||Wd)){let n=r?jd.OK:jd.WRONG_NODETYPE;t?void 0===i&&(n=jd.MISSING_CONSTRAINTS):n=jd.WRONG_PATTERN,Rd(e),s=new Hd({item:a,statement:e,constraints:i,matchingCode:n}),d.push(s),n===jd.OK&&Vd(s)}}}),e.addChildBindings(d))):(s=new Hd({item:a}),e.addChildBindings([s]),Vd(s))})(e,a):a instanceof td&&((e,a)=>{const t=[];null==a.getProperty()?t.push(new Ad({item:a,statement:null,matchingCode:jd.OK})):e.getGraph().find(e.getChildrenRootUri(),a.getProperty()).forEach(e=>{if(Fd(e)&&Kd(a,e)){const d=$d(a,e),i=qd(a,e);if(d&&(i||a.hasStyle("relaxedDatatypeMatch"))||Wd){Rd(e);let s=d?jd.OK:jd.WRONG_NODETYPE;i||(s=jd.WRONG_DATATYPE),t.push(new Sd({item:a,statement:e,matchingCode:s}))}}}),t.length>0&&e.addChildBindings(t)})(e,a)},$d=(e,a)=>{const t=a.getType();switch(e.getNodetype()){case"LITERAL":case"ONLY_LITERAL":case"PLAIN_LITERAL":case"LANGUAGE_LITERAL":case"DATATYPE_LITERAL":return"literal"===t;case"RESOURCE":return"uri"===t||"bnode"===t;case"URI":return"uri"===t;case"BLANK":return"bnode"===t}return!1},qd=(e,a)=>{const t="DATATYPE_LITERAL"===e.getNodetype()&&e.getDatatype()||null;return null==t||(Array.isArray(t)?-1!==t.indexOf(a.getDatatype()):a.getDatatype()===t)},Kd=(e,a)=>{const t=e.getPattern(),d=Kt.extractGist(a.getValue(),e.getValueTemplate());if(void 0!==t)try{return new RegExp(`^${t}$`).test(d)}catch(e){return!0}return!0},Xd=(e,a,t)=>{let d;const i=t.getConstraints(),s=[],n=(t,i)=>{if(d=e.find(a,t,{type:"uri",value:i}),1!==d.length)return!1;s.push(d[0])};if("object"==typeof i&&null!==i){const e=Object.keys(i);for(let a=0;a<e.length;a++){const t=e[a],d=i[t];if(d instanceof Array){let e=!0;if(d.forEach(a=>{!1!==n(t,a)&&(e=!1)}),e)return}else if(!1===n(t,d))return}return s}return[]},Id=(e,a,t)=>{const d=[],i=t.getConstraints();return"object"==typeof i&&null!==i&&Object.keys(i).forEach(t=>{const s=i[t];Array.isArray(s)?d.push(e.create(a,t,{type:"uri",value:s[0]},!1)):d.push(e.create(a,t,{type:"uri",value:s},!1))}),d},Zd=(e,a,t)=>{let d,i;if(e.hasChoices()){for(i=e.getChoices(),d=0;d<i.length;d++)if(i[d].value===a)return i[d];if(!e.hasStyle("strictmatch")||Wd)return{value:a,label:{"":a},mismatch:!0}}else{let d=Kt.getLocalizedMap(t,a,e.getLabelProperties());null==d&&Wd&&(d={"":a,mismatch:!0});const i=t.findFirstValue(a,xd.seeAlso);if(null!=d){const e={label:d,value:a};return i&&(e.seeAlso=i),e}if(null!=Gt.getChoice)return Gt.getChoice(e,a,i,t)}},Rd=e=>{e._dibbs=!0},Fd=e=>!0!==e._dibbs,Cd=e=>{let a,t,d;const i=e.getItemGroupedChildBindings()||[];for(a=0;a<i.length;a++)for(d=i[a],t=0;t<d.length;t++){const e=d[t];e._statement&&delete e._statement._dibbs,(e instanceof Hd||e instanceof Pd)&&Cd(e)}};const Qd=(e,a)=>{if(e instanceof Sd)return e;const t=e.getItemGroupedChildBindings(),d=X.a.locale();for(let i=0;i<t.length;i++){const s=t[i],n=e.getItem().getChildren()[i];if(0!==s.length){if(!(n instanceof td))return Qd(s[0]);if("LANGUAGE_LITERAL"===n.getNodetype()){const e={firstValue:s[0]};for(let a=0;a<s.length;a++){const t=s[a].getLanguage();null==t?e.emptyLanguageValue=s[a]:t===d?e.perfectLocaleLanguageValue=s[a]:t.substring(0,1)===d.substring(0,1)?e.localeLanguageValue=s[a]:-1!==t.indexOf("en")?e.defaultLanguageValue=s[a]:e.anyLanguageValue=s[a]}return e.perfectLocaleLanguageValue||e.localeLanguageValue||e.defaultLanguageValue||e.anyLanguageValue||e.firstValue}return s[0]}if(a){const a=Jd(e,n,{});return a instanceof Sd?(a.setLanguage(d),a):Qd(a,!0)}}},ei=(e,a)=>{const t="/"===a[0]?a.slice(1):a,d=e.getItemGroupedChildBindings(),i=t[0];for(let e=0;e<d.length;e++){const a=d[e];let s;for(let e=0;e<a.length;e++){let d=a[e],n=d.getItem();if(n instanceof id&&void 0===n.getProperty()&&i===n.getId()&&2===t.length&&t[1]===d.getValue())return d;if(d.isValid()){if("propertygroup"===n.getType())d=d.getObjectBinding(),n=d.getItem();else if(void 0===n.getProperty()&&(s=ei(d,t),s))return s;if("*"===i||i===d.getPredicate())if("group"===n.getType()){if(s=ei(d,t.slice(1)),s)return s}else if(1===t.length||"*"===t[1]||t[1]===d.getValue())return d}}}},ai=(e,a)=>{const t=a[0];let d=e;if("/"===t){for(;d.getParent();)d=d.getParent();return d}if(".."===t){for(let e=0;e<a.length;e++){if(".."!==a[e]||!d.getParent())return d;d=d.getParent()}return d}return e},ti=(e,a,t)=>{const d=a.getCardinality();return t&&"group"===a.getType()||(null!=d?d.min>0?e.mandatory+=1:d.pref>0?e.recommended+=1:e.optional+=1:e.optional+=1),"group"===a.getType()&&a.getChildren().forEach(a=>ti(e,a)),e};var di={detectLevel:e=>{if(e.mandatory>0){if(0===e.recommended&&0===e.optional)return"mandatory";if(0===e.optional)return"mixed_mandatory_recommended";if(0===e.recommended)return"mixed_mandatory_optional"}else{if(e.recommended>0)return 0===e.optional?"recommended":"mixed_recommended_optional";if(0===e.recommended&&e.recommended>0&&0===e.optional)return"optional"}return"mixed_all"},levelProfile:e=>{const a=ti({mandatory:0,recommended:0,optional:0},e,!0);return a.itemCount=a.mandatory+a.recommended+a.optional,a},findFirstValueBinding:Qd,create:Jd,constructTemplate:zd,findPopularChoice:(e,a)=>{const t=e.getId(),d={},i={};e.getChoices().forEach(e=>{d[e.value]=0,i[e.value]=e});a.getChildBindings().forEach(e=>{const a=e.getItem().getDeps();if(a&&(a[0]===t||"/"===a[0]&&a[1]===t)){const e="/"===a[0]?a[2]:a[1],t=d[e];void 0!==t&&(d[e]=t+1)}});let s,n=0;return Object.keys(d).forEach(e=>{(!s||d[e]>n)&&(s=e,n=d[e])}),i[s]},match:(e,a,t)=>{const d=new Hd({item:t,childrenRootUri:a,graph:e});return Vd(d),Cd(d),d},fuzzyMatch:Bd,matchPathBelowBinding:ei,findBindingRelativeToParentBinding:ai,CODES:jd};class ii{constructor(e){this.automaticSortAllowed=!0,this.ignoreMissingItems=!0,this._bundles=[],this._registry={},this._registryByProperty={},this._ontologyStore=e||new Yd}getTemplate(e){return this.getItem(e)}getChildren(e,a){if(null==e)return[];const t=e.getSource(!0),d=t.content||t.items||[];if(a)return this._createItems(d,e._forceChildrenClones,e.getBundle());const i=this.getItem(t.extends);return i?i.getChildren().concat(e.getChildren(!0)):e.getChildren(!0)}getItem(e){if(null!=e)return this._registry[e]}getItems(){return Object.keys(this._registry).map(e=>this._registry[e])}renameItem(e,a){if(this._registry[a])throw new Error(`Cannot rename to ${a} since an item with that id already exists.`);if(""===a||null===a)throw new Error("Cannot give an item an empty string or null as id.");const t=this._registry[e];t&&(delete this._registry[e],this._registry[a]=t,t.setId(a));const d=t=>{const i=t.content;if(i)for(let t=0;t<i.length;t++){const s=i[t];s.id!==e&&s["@id"]!==e||(s.id=a,delete s["@id"]),s.content&&d(s)}},i=this.getItems();for(let e=0;e<i.length;e++){const a=i[e];a instanceof ed&&d(a._source)}}getItemIds(){return Object.keys(this._registry)}getItemByProperty(e){return this._registryByProperty[e]}detectTemplate(e,a,t){return zd(e,a,this,t)}registerBundle(e){e.itemStore=this;const a=new bd(e);this._bundles.push(a),e.source&&e.source.namespaces&&l(e.source.namespaces);const t=e.source.templates||e.source.auxilliary;return t instanceof Array&&this._createItems(t,!1,a),"object"==typeof e.source.cachedChoices&&this._ontologyStore.importRegistry(e.source.cachedChoices),a}getBundles(){return this._bundles}createTemplate(e){return this.registerBundle({source:e}).getRoot()}createTemplateFromChildren(e){const a=(e||[]).map(e=>"string"==typeof e?this.getItem(e):e);return new ed({source:{},children:a,itemStore:this})}setPriorities(e){this.priorities=e}createExtendedSource(e,a){const t=Object.assign(Object.assign({},e),a);return t._extendedSource=a,t.extends=null,delete t.children,t}createItem(e,a,t,d){let i;const s=e.id||e["@id"],n=e.type||e["@type"];if(e.extends){const a=this._registry[e.extends];if(null==a&&!this.ignoreMissingItems)throw new Error("Cannot find item to extend with id: "+e.extends);if(a){const t=this.createExtendedSource(a.getSource(),e);return this.createItem(t,!1,!1,d)}}if(null!=n){switch(n){case"text":i=new td({source:e,itemStore:this,bundle:d});break;case"choice":i=new id({source:e,itemStore:this,ontologyStore:this._ontologyStore,bundle:d});break;case"group":i=new ed({source:e,children:null,itemStore:this,bundle:d});break;case"propertygroup":i=new ad({source:e,children:null,itemStore:this,bundle:d})}return!0!==t&&(null!=e.property&&(this._registryByProperty[e.property]=i,this.priorities&&null!=this.priorities[e.property]&&(i.priority=this.priorities[e.property])),null!=s&&null==this._registry[s]&&(this._registry[s]=i,null!=d&&d.addItem(i))),i}if(null==s)throw new Error("Cannot create subitem, `type` for creating new or `id` for referencing external are required.");if(null==this._registry[s])throw new Error("Cannot find referenced subitem using identifier: "+s);if(!0===a||Object.keys(e).find(e=>"id"!==e&&"@id"!==e)){const a=Object.assign(Object.assign({},this._registry[s]._source),e);return this.createItem(a,!1,!0)}return this._registry[s]}removeItem(e,a){const t=e.getBundle();null!=t&&t.removeItem(e),null!=e.getId()&&delete this._registry[e.getId()];const d=e.getProperty();null!=d&&this._registryByProperty[d]===e&&delete this._registryByProperty[d]}_createItems(e,a,t){return e.map((d,i)=>{const s="string"==typeof d?e[i]={id:d}:d;return this.createItem(s,a,!1,t)})}}const si=(e,a,t)=>{const d=`Fetching template bundle ${t} failed.`;if(e===a-1)throw Error(d+" Cannot recover from this, please fix.");console.log(d+" Will try to fetch from a fallback option.")},ni=e=>e.map(e=>e instanceof Array?(async e=>{const a=e.length;let t,d;for(let i=0;i<a;i++){try{t=await fetch(e[i])}catch(a){throw Error("A network error ocurred while trying to fetch bundle "+e[i])}if(t&&t.ok)try{const a=t.headers.has("content-type")&&t.headers.get("content-type");if(a&&a.includes("application/json")){d=await t.json();break}throw new Error(`Failed fetching template ${e[i]}. Expected a JSON file and got ${a}`)}catch(t){si(i,a,e[i])}else si(i,a,e[i])}return d})(e):Promise.resolve(e));var ri=async(e,a=[],t=(()=>{}))=>{0===a.length&&t&&t([]);const d=ni(a),i=((e,a=[])=>a.map(a=>e.registerBundle({source:a})))(e,await Promise.all(d));return t(i),i};const pi=(e,a)=>{let t=a;return null==t?t={errors:[],warnings:[],deprecated:[]}:(t.errors=t.errors||[],t.warnings=t.warnings||[],t.deprecated=t.deprecated||[]),ui(e,t,!0)},oi=e=>{let a=0;for(let t=0;t<e.length;t++)e[t].isValid()&&(a+=1);return a},li=(e,a)=>{if(e.length>0){e[0].getCardinalityTracker().setCode(a)}},mi=(e,a)=>{if(a.hasStyle("deprecated"))return!0;const t=a.getDeps();if(t){const a=ai(e,t);if(!ei(a,t))return!0}return!1},ui=(e,a,t)=>{if(e.getMatchingCode()!==jd.OK)return;const d=e.getItem();if(!0===t||e.isValid()||null==d.getProperty()||d.hasStyle("atLeastOneChild")||d.hasStyle("exactlyOneChild")){const t=d.getChildren();if(d.hasStyle("disjoint")||d.hasStyle("atMostOneChild")||d.hasStyle("atLeastOneChild")||d.hasStyle("exactlyOneChild")){const i=e.getChildBindings(),s=oi(i);let n;s>1&&(d.hasStyle("disjoint")||d.hasStyle("atMostOneChild"))?n=jd.AT_MOST_ONE_CHILD:1!==s&&d.hasStyle("exactlyOneChild")?n=jd.EXACTLY_ONE_CHILD:0===s&&d.hasStyle("atLeastOneChild")&&(n=jd.AT_LEAST_ONE_CHILD),n&&(li([e],n),t.length>0&&a.errors.push({parentBinding:e,item:t[0],code:n}))}else e.getItemGroupedChildBindings().forEach((d,i)=>{const s=t[i];if(!mi(e,s)&&null!=s.getProperty()){const t=oi(d),i=s.getCardinality();null!=i.min&&i.min>t?(a.errors.push({parentBinding:e,item:s,code:jd.TOO_FEW_VALUES_MIN}),li(d,jd.TOO_FEW_VALUES_MIN)):null!=i.pref&&i.pref>t&&a.warnings.push({parentBinding:e,item:s,code:jd.TOO_FEW_VALUES_PREF}),null!=i.max&&i.max<t&&(a.errors.push({parentBinding:e,item:s,code:jd.TOO_MANY_VALUES}),li(d,jd.TOO_MANY_VALUES))}},void 0);e.getChildBindings().forEach(t=>{const d=t.getItem();t.getMatchingCode()!==jd.OK&&a.errors.push({parentBinding:t,item:d,code:t.getMatchingCode()}),d.hasStyle("deprecated")&&a.deprecated.push(t),mi(e,d)||"group"===d.getType()&&ui(t,a)})}return a},_i=(e,a)=>e.find(null,"rdf:type",a).map(e=>e.getSubject()),hi=(e,a,t)=>{let d=e;for(;;){const e=d.getChildrenRootUri?d.getChildrenRootUri():d.getParent().getChildrenRootUri();if(e===a)return!0;if(t[e])return!1;d=d.getParent()}},ci=(e,a)=>{let t=e;const d=[];for(null!=a.getProperty()&&t.getItem()!==a&&d.push(p(a.getProperty()));null!=t.getItem().getProperty()&&d.push(p(t.getItem().getProperty())),null!=t.getParent();)t=t.getParent();return d.reverse(),d.join(" > ")},fi=e=>{const{errors:a,warnings:t,deprecated:d}=e;e.errors=a.map(e=>({path:ci(e.parentBinding,e.item),code:e.code})),e.warnings=t.map(e=>({path:ci(e.parentBinding,e.item),code:e.code})),e.deprecated=d.map(e=>(e=>`${ci(e.getParent(),e.getItem())} > ${e.getValue()}`)(e))},yi=(e,a,t,d)=>{const i=Bd(a,e,t),s=pi(i);return((e,a,t)=>{const{errors:d,warnings:i,deprecated:s}=e;e.errors=d.filter(e=>hi(e.parentBinding,a,t)),e.warnings=i.filter(e=>hi(e.parentBinding,a,t)),e.deprecated=s.filter(e=>hi(e,a,t))})(s,e,d||{}),fi(s),s};var vi={graphReport:(e,a,t=[])=>{const d={},i={};let s,n;const r={errors:0,warnings:0,deprecated:0,resources:[]};Object.keys(a).forEach(a=>{const t=_i(e,a);d[a]=t,t.forEach(e=>{i[e]=!0})}),Object.keys(d).forEach(t=>{s=a[t],d[t].forEach(a=>{n=yi(a,e,s,i),n.uri=a,n.type=t,n.template=s.getId(),r.resources.push(n),r.errors+=n.errors.length,r.warnings+=n.warnings.length,r.deprecated+=n.deprecated.length})});const p=[];return t.forEach(e=>{0===d[e].length&&p.push(e)}),p.length>0&&(r.mandatoryError=p,r.errors+=p.length),r},bindingReport:pi};global.fetch=t(157).default}]);
280
+ e.exports=function(e){return null!=e&&(t(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&t(e.slice(0,0))}(e)||!!e._isBuffer)}},function(e,a){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,a,t){var d={"./af":17,"./af.js":17,"./ar":18,"./ar-dz":19,"./ar-dz.js":19,"./ar-kw":20,"./ar-kw.js":20,"./ar-ly":21,"./ar-ly.js":21,"./ar-ma":22,"./ar-ma.js":22,"./ar-sa":23,"./ar-sa.js":23,"./ar-tn":24,"./ar-tn.js":24,"./ar.js":18,"./az":25,"./az.js":25,"./be":26,"./be.js":26,"./bg":27,"./bg.js":27,"./bm":28,"./bm.js":28,"./bn":29,"./bn-bd":30,"./bn-bd.js":30,"./bn.js":29,"./bo":31,"./bo.js":31,"./br":32,"./br.js":32,"./bs":33,"./bs.js":33,"./ca":34,"./ca.js":34,"./cs":35,"./cs.js":35,"./cv":36,"./cv.js":36,"./cy":37,"./cy.js":37,"./da":38,"./da.js":38,"./de":39,"./de-at":40,"./de-at.js":40,"./de-ch":41,"./de-ch.js":41,"./de.js":39,"./dv":42,"./dv.js":42,"./el":43,"./el.js":43,"./en-au":44,"./en-au.js":44,"./en-ca":45,"./en-ca.js":45,"./en-gb":46,"./en-gb.js":46,"./en-ie":47,"./en-ie.js":47,"./en-il":48,"./en-il.js":48,"./en-in":49,"./en-in.js":49,"./en-nz":50,"./en-nz.js":50,"./en-sg":51,"./en-sg.js":51,"./eo":52,"./eo.js":52,"./es":53,"./es-do":54,"./es-do.js":54,"./es-mx":55,"./es-mx.js":55,"./es-us":56,"./es-us.js":56,"./es.js":53,"./et":57,"./et.js":57,"./eu":58,"./eu.js":58,"./fa":59,"./fa.js":59,"./fi":60,"./fi.js":60,"./fil":61,"./fil.js":61,"./fo":62,"./fo.js":62,"./fr":63,"./fr-ca":64,"./fr-ca.js":64,"./fr-ch":65,"./fr-ch.js":65,"./fr.js":63,"./fy":66,"./fy.js":66,"./ga":67,"./ga.js":67,"./gd":68,"./gd.js":68,"./gl":69,"./gl.js":69,"./gom-deva":70,"./gom-deva.js":70,"./gom-latn":71,"./gom-latn.js":71,"./gu":72,"./gu.js":72,"./he":73,"./he.js":73,"./hi":74,"./hi.js":74,"./hr":75,"./hr.js":75,"./hu":76,"./hu.js":76,"./hy-am":77,"./hy-am.js":77,"./id":78,"./id.js":78,"./is":79,"./is.js":79,"./it":80,"./it-ch":81,"./it-ch.js":81,"./it.js":80,"./ja":82,"./ja.js":82,"./jv":83,"./jv.js":83,"./ka":84,"./ka.js":84,"./kk":85,"./kk.js":85,"./km":86,"./km.js":86,"./kn":87,"./kn.js":87,"./ko":88,"./ko.js":88,"./ku":89,"./ku.js":89,"./ky":90,"./ky.js":90,"./lb":91,"./lb.js":91,"./lo":92,"./lo.js":92,"./lt":93,"./lt.js":93,"./lv":94,"./lv.js":94,"./me":95,"./me.js":95,"./mi":96,"./mi.js":96,"./mk":97,"./mk.js":97,"./ml":98,"./ml.js":98,"./mn":99,"./mn.js":99,"./mr":100,"./mr.js":100,"./ms":101,"./ms-my":102,"./ms-my.js":102,"./ms.js":101,"./mt":103,"./mt.js":103,"./my":104,"./my.js":104,"./nb":105,"./nb.js":105,"./ne":106,"./ne.js":106,"./nl":107,"./nl-be":108,"./nl-be.js":108,"./nl.js":107,"./nn":109,"./nn.js":109,"./oc-lnc":110,"./oc-lnc.js":110,"./pa-in":111,"./pa-in.js":111,"./pl":112,"./pl.js":112,"./pt":113,"./pt-br":114,"./pt-br.js":114,"./pt.js":113,"./ro":115,"./ro.js":115,"./ru":116,"./ru.js":116,"./sd":117,"./sd.js":117,"./se":118,"./se.js":118,"./si":119,"./si.js":119,"./sk":120,"./sk.js":120,"./sl":121,"./sl.js":121,"./sq":122,"./sq.js":122,"./sr":123,"./sr-cyrl":124,"./sr-cyrl.js":124,"./sr.js":123,"./ss":125,"./ss.js":125,"./sv":126,"./sv.js":126,"./sw":127,"./sw.js":127,"./ta":128,"./ta.js":128,"./te":129,"./te.js":129,"./tet":130,"./tet.js":130,"./tg":131,"./tg.js":131,"./th":132,"./th.js":132,"./tk":133,"./tk.js":133,"./tl-ph":134,"./tl-ph.js":134,"./tlh":135,"./tlh.js":135,"./tr":136,"./tr.js":136,"./tzl":137,"./tzl.js":137,"./tzm":138,"./tzm-latn":139,"./tzm-latn.js":139,"./tzm.js":138,"./ug-cn":140,"./ug-cn.js":140,"./uk":141,"./uk.js":141,"./ur":142,"./ur.js":142,"./uz":143,"./uz-latn":144,"./uz-latn.js":144,"./uz.js":143,"./vi":145,"./vi.js":145,"./x-pseudo":146,"./x-pseudo.js":146,"./yo":147,"./yo.js":147,"./zh-cn":148,"./zh-cn.js":148,"./zh-hk":149,"./zh-hk.js":149,"./zh-mo":150,"./zh-mo.js":150,"./zh-tw":151,"./zh-tw.js":151};function i(e){var a=s(e);return t(a)}function s(e){if(!t.o(d,e)){var a=new Error("Cannot find module '"+e+"'");throw a.code="MODULE_NOT_FOUND",a}return d[e]}i.keys=function(){return Object.keys(d)},i.resolve=s,e.exports=i,i.id=170},function(e,a,t){"use strict";t.r(a),t.d(a,"ItemStore",(function(){return ii})),t.d(a,"bundleLoader",(function(){return ri})),t.d(a,"utils",(function(){return Kt})),t.d(a,"system",(function(){return Gt})),t.d(a,"engine",(function(){return di})),t.d(a,"validate",(function(){return vi})),"__rdfjson_namespaces"in globalThis||(globalThis.__rdfjson_namespaces={ical:"http://www.w3.org/2002/12/cal/ical#",vcard:"http://www.w3.org/2006/vcard/ns#",dcterms:"http://purl.org/dc/terms/",skos:"http://www.w3.org/2004/02/skos/core#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",owl:"http://www.w3.org/2002/07/owl#",vs:"http://www.w3.org/2003/06/sw-vocab-status/ns#",foaf:"http://xmlns.com/foaf/0.1/",wot:"http://xmlns.com/wot/0.1/",dc:"http://purl.org/dc/elements/1.1/",xsd:"http://www.w3.org/2001/XMLSchema#",dcat:"http://www.w3.org/ns/dcat#",org:"http://www.w3.org/ns/org#",gn:"http://www.geonames.org/ontology#",locn:"http://www.w3.org/ns/locn#",schema:"http://schema.org/",ex:"http://example.com/",gsp:"http://www.opengis.net/ont/geosparql#",odrs:"http://schema.theodi.org/odrs#"});const{__rdfjson_namespaces:d}=globalThis;let i=0;const n=(e,a,t)=>(d[e]||(d[e]=a),{abbrev:e,ns:a,localname:t,full:a+t,pretty:`${e}:${t}`}),r=e=>{const a=Object.keys(d).find(a=>0===e.indexOf(d[a]));if(a)return n(a,d[a],e.substring(d[a].length));let t=e.lastIndexOf("/");const s=e.lastIndexOf("#");return s>t&&(t=s),i+=1,n("ns"+i,e.substring(0,t+1),e.substring(t+1))};var p=e=>r(e).pretty,o=e=>{const a=e.split(":");return 2===a.length&&d.hasOwnProperty(a[0])?d[a[0]]+a[1]:e},l=(e,a)=>{"string"==typeof e?d[e]=a:"object"==typeof e&&Object.keys(e).forEach(a=>{d[a]=e[a]})},m=t(153),u=t.n(m);const _=e=>void 0!==e&&(null===e||"object"==typeof e||Array.isArray(e)||"function"==typeof e),h=e=>"string"==typeof e||e instanceof String,c=(e,a,t)=>{0===e[a][t].length&&(delete e[a][t],0===Object.keys(e[a]).length&&delete e[a])},f=e=>{if(!_(e[0]))throw new Error("Graph is not a object.");if(!h(e[1]))throw new Error("Subject is not a string.");if(!h(e[2]))throw new Error("Predicate is not a string.");if(!_(e[3]))throw new Error("Object is not a object.");if(void 0===e[3].type)throw new Error("Object has no type attribute, must be one of 'uri', 'literal', or 'bnode'");if(void 0===e[3].value)throw new Error("Object has no value attribute corresponding to the lexical value of the object.")},y=(e,a)=>e===a||null==e&&e===a||(h(e)?h(a)?e===a:e===a.value:h(a)?e.value===a:e.type===a.type&&e.value===a.value&&e.lang===a.lang&&e.datatype===a.datatype),v=e=>{const a={type:e.type,value:e.value};return null!=e.ng&&(a.ng=e.ng),null!=e.lang&&(a.lang=e.lang),null!=e.datatype&&(a.datatype=e.datatype),a};var M={isObject:_,isString:h,isFunction:e=>"[object Function]"===Object.prototype.toString.call(e),statementEquals:(e,a)=>e.s===a.s&&e.p===a.p&&y(e.o,a.o),add:(e,a,t,d,i)=>{if(f([e,a,t,d]),void 0===e[a])return e[a]={},e[a][t]=[d],d;if(void 0===e[a][t])return e[a][t]=[d],d;let s;const n=e[a][t];if(!i)for(s=n.length-1;s>=0;s--)if(y(d,n[s]))return n[s];return n.push(d),d},remove:(e,a,t,d)=>{if(f([e,a,t,d]),void 0===e[a]||void 0===e[a][t])return;let i;const s=e[a][t];for(i=s.length-1;i>=0;i--)if(y(d,s[i])){const d=s[i];return s.splice(i,1),c(e,a,t),d}},contains:(e,a,t,d)=>{if(f([e,a,t,d]),void 0===e[a]||void 0===e[a][t])return;let i;const s=e[a][t];for(i=s.length-1;i>=0;i--)if(y(d,s[i]))return s[i]},cleanup:c,checkForWrongArgs:f,objectEquals:y,findDirectOrRDFValue:(e,a,t)=>{const d=e.find(a,t);if(d.length>0)return"bnode"!==d[0].getType()?d[0].getValue():e.findFirstValue(d[0].getValue(),"http://www.w3.org/1999/02/22-rdf-syntax-ns#value")},clone:(e,a=!0)=>{const t={};return Object.keys(e).forEach(d=>{const i=e[d];t[d]={},Object.keys(i).forEach(e=>{const s=i[e];if(1===s.length)t[d][e]=[v(s[0])];else if(a){const a=[],s=new Set;t[d][e]=a,i[e].forEach(e=>{const t=v(e),d=(e=>`${e.value}${e.type}${e.lang||""}${e.datatype||""}${e.ng||""}`)(t);s.has(d)||(s.add(d),a.push(t))})}else{const a=[];t[d][e]=a,i[e].forEach(e=>{a.push(v(e))})}})}),t}};class g{constructor(e,a,t,d,i){this._graph=e,this._s=a,this._p=t,this._o=d,this._o._statement=this,this._asserted=i}getGraph(){return this._graph}setAsserted(e,a=!1){e!==this._asserted&&(e?this._graph.add(this,void 0,void 0,this._silentValue,a):this._graph.remove(this,this._silentValue),this._asserted=e)}isAsserted(){return this._asserted}getSubject(){return this._s}isSubjectBlank(){return!0!==this._sIsBlank&&!1!==this._sIsBlank&&(this._sIsBlank=0===this._s.indexOf("_:")),this._sIsBlank}isObjectBlank(){return"bnode"===this.getType()}setSubject(e){this._silentValue=!1;const a=o(e);this._asserted?(this._graph.remove(this),this._s=a,this._graph.add(this),delete this._sIsBlank):this._s=a}getPredicate(){return this._p}setPredicate(e){this._silentValue=!1;const a=o(e);this._asserted?(this._graph.remove(this),this._p=a,this._graph.add(this)):this._p=a}getNamedGraph(){return this._o.ng}setNamedGraph(e){this._o.ng=e}getObject(){return this._o}getCleanObject(){const e=this._o,a={value:e.value,type:e.type};return this._o.ng&&(a.ng=e.ng),e.lang&&(a.lang=e.lang),this._o.datatype&&(a.datatype=e.datatype),a}getType(){return this._o.type}setType(e){throw new Error("Changing the type of an object is not supported, create a new statement instead.")}getValue(){return this._o.value}setValue(e,a=!1){this._silentValue=!0===a,e!==this._o.value&&(this._o.value=e,this.isAsserted()&&!0!==a&&this._graph.setChanged())}getLanguage(){return this._o.lang}setLanguage(e,a){if(this._silentValue=!0===a,"literal"!==this._o.type)throw new Error("Cannot set the language for a resource, has to be a literal");this._o.lang!==e&&(this._o.lang=e,this.isAsserted()&&!0!==a&&this._graph.setChanged())}getDatatype(){return this._o.datatype}setDatatype(e,a){if(this._silentValue=!0===a,"literal"!==this._o.type||null!=this._o.lang)throw new Error("Cannot set the datatype for a resource, has to be a literal");this._o.datatype!==e&&(this._o.datatype=e,this.isAsserted()&&!0!==a&&this._graph.setChanged())}}var w=t(13),L=t.n(w);var Y=(e,a)=>{const t=[],d=new Set((a||[]).map(e=>o(e))),i=[],s={},n=e=>{let a=e.getValue();return e.getLanguage()&&(a+="@"+e.getLanguage()),e.getDatatype()&&(a+="^^"+e.getDatatype()),a},r=(e,a)=>{const t=s[e]||{rels:[]};s[e]=t,t.rels.push(a)};return e.find().forEach(e=>{const a=e.getSubject(),s=e.getPredicate();if(d.has(s))return;const p="bnode"===e.getType(),o=e.isSubjectBlank();if(o||p)return i.push(e),o&&r(e.getSubject(),p?s:s+n(e)),void("bnode"===e.getType()&&r(e.getValue(),o?s:a+s));t.push(a+s+n(e))}),Object.values(s).forEach(e=>{e.rels.sort(),e.hash=L()(e.rels.join(""))}),i.forEach(e=>{const a=[];a.push(e.isSubjectBlank()?s[e.getSubject()].hash:e.getSubject()),a.push(e.getPredicate()),a.push("bnode"===e.getType()?s[e.getValue()].hash:n(e)),t.push(a.join(""))}),t.sort(),L()(t.join(""))};const D=e=>0===e.length?e:[e[0]],b=(e,a,t)=>({object(d){for(let i=0;i<a.length;i++){let s;if(t)s=a[i].getSubject();else{const e=a[i].getType();if("uri"===e||"bnode"===e)continue;s=a[i].getValue()}const n=e.find(s,d);n.length>0&&b(e,[n[0]])}return b(e,[])},objects(d){let i,s=[];if(!0===t)for(i=0;i<a.length;i++)s=s.concat(e.find(a[i].getSubject(),d));else for(i=0;i<a.length;i++){const t=a[i].getType();"uri"!==t&&"bnode"!==t||(s=s.concat(e.find(a[i].getValue(),d)))}return b(e,s)},constr(d,i){let s=i;M.isString(s)&&(s={type:"uri",value:s});const n=[];for(let i=0;i<a.length;i++){const r=t?a[i].getSubject():a[i].getValue();e.find(r,d,s).length>0&&n.push(a[i])}return b(e,n,t)},each(d,i){if(!0===t)for(let s=0;s<a.length;s++){const n="_:"===a[s].getSubject().substring(0,2)?"bnode":"uri";null!=i&&i!==n||d(b(e,a[s],t))}else for(let i=0;i<a.length;i++)d(b(e,a[i],t))},statements:()=>a,nodes(e){const d=[];if(!0===t)for(let t=0;t<a.length;t++){const i="_:"===a[t].getSubject().substring(0,2)?"bnode":"uri";null!=e&&e!==i||d.push({type:i,value:a[t].getSubject()})}else for(let t=0;t<a.length;t++)null!=e&&e!==a[t].getType()||d.push(a[t].getObject());return d},values(e){const d=[];if(!0===t)for(let t=0;t<a.length;t++){const i="_:"===a[t].getSubject().substring(0,2)?"bnode":"uri";null!=e&&e!==i||d.push(a[t].getSubject())}else for(let t=0;t<a.length;t++)null!=e&&e!==a[t].getType()||d.push(a[t].getValue());return d},firstValue(e){if(!0===t)for(let t=0;t<a.length;t++){const d="_:"===a[t].getSubject().substring(0,2)?"bnode":"uri";if(null==e||e===d)return a[t].getSubject()}else for(let t=0;t<a.length;t++)if(null==e||e===a[t].getType())return a[t].getValue()}});class T{constructor(e=null,a){this._graph=e||{},this._bnodes={},this._bnodesIndexed=!1,!1!==a&&this.validate(),this._changed=!1}isEmpty(){return!Object.keys(this._graph).find(e=>{const a=this._graph[e];return Object.keys(a).find(e=>a[e].find(e=>null==e._statement||e._statement.isAsserted()))})}onChange(){}setChanged(e){this._changed=!(!0!==e&&null!=e),this._changed&&this.onChange()}isChanged(){return this._changed}addAll(e,a){const t={};let d;const i=e.find();for(let e=0;e<i.length;e++){const s=i[e];let n=s.getSubject(),r=s.getPredicate();const p=s.getCleanObject();a&&(p.ng=a),0===n.indexOf("_:")&&(d=t[n]||this._newBNode(),t[n]=d,n=d),0===r.indexOf("_:")&&(d=t[r]||this._newBNode(),t[r]=d,r=d),"bnode"===p.type&&(d=t[p.value]||this._newBNode(),t[p.value]=d,p.value=d),this.add(n,r,p)}}add(e,a=null,t=null,d=!1,i){if(e instanceof g){const a=e.getPredicate(),t=e.getObject(),s=e.getSubject();this._trackBNodes(s,a,t);const n=this._graphObject(t),r=M.add(this._graph,s,a,n,i);return!0!==d&&this.setChanged(),this._get(s,a,r,!0)}return this.create(e,a,t,!0,d,i)}addL(e,a,t,d){const i={type:"literal",value:t};return"string"==typeof d&&(i.lang=d),this.create(e,a,i,!0)}addD(e,a,t,d){const i={type:"literal",value:t};return"string"==typeof d&&(i.datatype=o(d)),this.create(e,a,i,!0)}create(e=null,a=null,t=null,d=!0,i=!1,s=!1){let n=e,r=a,p=t;if(n=null==n?this._newBNode():o(n),r=null==r?this._newBNode():o(r),null==p?p={type:"bnode",value:this._newBNode()}:M.isString(p)?p={type:"uri",value:o(p)}:"object"!=typeof p||Array.isArray(p)?p={type:"uri",value:""+p}:(p={type:p.type,value:p.value,lang:p.lang,datatype:p.datatype,ng:p.ng},"uri"===p.type&&null!=p.value&&(p.value=o(p.value)),p.datatype&&(p.datatype=o(p.datatype))),!1!==d){const e=M.add(this._graph,n,r,p,s);return!0!==i&&this.setChanged(),this._getOrCreate(n,r,e,!0)}return new g(this,n,r,p,!1)}findAndRemove(e,a,t,d=!1){const i=this.find(e,a,t);for(let e=0;e<i.length;e++)this.remove(i[e],d)}remove(e,a=!1){const t=e.getSubject(),d=e.getPredicate(),i=e.getObject();this._trackBNodes(t,d,i),null!=M.remove(this._graph,t,d,i)&&!0!==a&&this.setChanged()}find(e,a,t){let d=e,i=a,s=t;if("string"==typeof d&&(d=o(d)),"string"==typeof i&&(i=o(i)),"object"==typeof s&&null!==s&&"uri"===s.type?s.value=o(s.value):"string"==typeof s&&(s={type:"uri",value:o(s)}),null==s)return null==i?null==d?this._find():this._findS(d):null==d?this._findP(i):this._findSP(d,i);if(null==i)return null==d?this._findO(s):this._findSO(d,s);if(null==d)return this._findPO(i,s);const n=this._get(d,i,M.contains(this._graph,d,i,s),!0);return null==n?[]:[n]}findFirstValue(e,a){const t=this.find(e,a);if(t.length>0)return t[0].getValue()}projection(e,a,t){const d={};return Object.keys(a).forEach(i=>{const s=a[i],n=Array.isArray(s)?this.findPath(e,s):this.find(e,s);if(n.length>0)switch("*"===i[0]?d[i.substr(1)]=n.map(e=>e.getValue()):d[i]=n[0].getValue(),t||"none"){case"statement":d["*"+i]=n;break;case"objects":d["*"+i]=n.map(e=>e.getCleanObject());break;case"values":d["*"+i]=n.map(e=>e.getValue())}}),d}subjects(e,a){return b(this,this.find(null,e,a),!0)}subject(e,a){return b(this,D(this.find(null,e,a)),!0)}objects(e,a){return b(this,this.find(e,a,null))}object(e,a){return b(this,D(this.find(e,a,null)))}findPath(e,a){return a.slice(1).reduce((e,a)=>e.objects(a),this.objects(e,a[0])).statements()}addList(e){return this._addList(e,"add")}addListL(e,a){return this._addList(e,"addL",a)}addListD(e,a){return this._addList(e,"addD",a)}_addList(e,a,t){let d;if(Array.isArray(e)&&0!==e.length){d=this._newBNode();let i=d;const s=e.length-1;e.forEach((e,d)=>{this[a](i,"rdf:first",e,t),d!==s?i=this.add(i,"rdf:rest").getValue():this.add(i,"rdf:rest","rdf:nil")})}else d=o("rdf:nil");return d}removeList(e){let a=!1,t="object"==typeof e?e.value:e;try{const e=o("rdf:nil");for(a=t===e;t!==e&&null!=t;){const e=this.findFirstValue(t,"rdf:rest");this.findAndRemove(t),t=e,a=null!=t}}catch(e){return console.warn("Invalid list for object: "+t),!1}return a}getList(e){let a="object"==typeof e?e.value:o(e);const t=[];try{const e=o("rdf:nil");for(;a!==e&&null!=a;)t.push(this.find(a,"rdf:first")[0].getObject()),a=this.findFirstValue(a,"rdf:rest")}catch(e){console.warn("Invalid list for object: "+a)}return t}findFirstListAsValues(e,a){return this.getList(this.findFirstValue(e,a)).map(e=>e.value)}findAndRemoveLists(e,a){let t=!1;return this.find(e,a).forEach(e=>{this.removeList(e.getValue())&&(this.remove(e),t=!0)}),t}exportRDFJSON(e=!0){this._graph;return M.clone(this._graph,e)}replaceSubject(e,a){return this.replaceURI(e,a)}replaceURI(e,a){const t=this._graph;if(t.hasOwnProperty(e)){if(t.hasOwnProperty(a))throw new Error("Cannot replace subject with target URI since it already exists.");t[a]=t[e],delete t[e]}return this.forEach((t,d,i)=>{"uri"===i.type&&i.value===e&&(i.value=a),t===a&&i._statement&&(i._statement._s=a)}),this}replaceBlankWithURI(e,a){const t=this._graph;if(t.hasOwnProperty(e)){if(t.hasOwnProperty(a))throw new Error("Cannot replace subject with target URI since it already exists.");t[a]=t[e],delete t[e],this.forEach((t,d,i)=>{"bnode"===i.type&&i.value===e&&(i.value=a,i.type="uri"),t===a&&i._statement&&(i._statement._s=a)})}return delete this._bnodes[e],this}clone(){return new T(this.exportRDFJSON(!1))}findProperties(e){return Object.keys(this._graph[e]||{})}validate(){if(this.report=this._validate(),!this.report.valid)throw this.report;return this.report}registerBNode(e){this._bnodes[e]=!0}forEach(e){const a=this._graph;Object.keys(a).forEach(t=>{const d=a[t];Object.keys(d).forEach(a=>{d[a].forEach(d=>{e(t,a,d)})})})}map(e){const a=[];return this.forEach(t=>{a.push(e(t))}),a}equals(e,a){return Y(this,a)===Y(e,a)}size(){let e=0;return Object.values(this._graph).forEach(a=>{Object.values(a).forEach(a=>{e+=a.length})}),e}_get(e,a,t,d){if(null!=t)return this._getOrCreate(e,a,t,d)}_getOrCreate(e,a,t,d){return null==t._statement&&(t._statement=new g(this,e,a,t,d)),t._statement}_graphObject(e){return null==e._statement||e._statement._graph===this?e:{type:e.type,value:e.value,lang:e.lang,datatype:e.datatype}}_findSP(e,a){return null==this._graph[e]||null==this._graph[e][a]?[]:this._graph[e][a].map(t=>this._get(e,a,t,!0))}_findS(e){const a=this._graph[e],t=Object.keys(a||{}).map(a=>this._findSP(e,a));return Array.prototype.concat.apply([],t)}_find(){const e=[];return this.forEach((a,t,d)=>{e.push(this._get(a,t,d,!0))}),e}_findP(e){const a=[];return this.forEach((t,d,i)=>{e===d&&a.push(this._get(t,d,i,!0))}),a}_findO(e){const a=[];return this.forEach((t,d,i)=>{M.objectEquals(e,i)&&a.push(this._get(t,d,i,!0))}),a}_findSO(e,a){const t=[];return this.forEach((d,i,s)=>{e===d&&M.objectEquals(a,s)&&t.push(this._get(d,i,s,!0))}),t}_findPO(e,a){const t=[];return this.forEach((d,i,s)=>{e===i&&M.objectEquals(a,s)&&t.push(this._get(d,i,s,!0))}),t}_validate(){const e=this._graph,a={valid:!0,errors:[],nr:0};return Object.keys(e).forEach(t=>{const d=e[t];M.isObject(d)?Object.keys(d).forEach(e=>{const i=d[e];Array.isArray(i)?i.forEach((d,i)=>{M.isObject(d)?null!=d.type?M.isString(d.value)?a.nr+=1:(a.errors.push({s:t,p:e,oindex:i+1,message:`Object ${i+1} in object array must have the 'value' attribute pointing to a string.`}),a.valid=!1):(a.errors.push({s:t,p:e,oindex:i+1,message:`Object ${i+1} in object array lacks the attribute type, must be either 'literal', 'resource' or 'bnode'.`}),a.valid=!1):(a.errors.push({s:t,p:e,oindex:i+1,message:`Element ${i+1} in object array is not an object.`}),a.valid=!1)}):(a.errors.push({s:t,p:e,message:"Predicate must point to an array of objects."}),a.valid=!1)}):(a.errors.push({s:t,message:"Subject must point to an object."}),a.valid=!1)}),a}_newBNode(){let e,a,t;for(this._indexBNodes(),e=1;e<20;e++)for(a=1;a<=e;a++)if(t="_:"+Math.floor(Math.random()*(Math.pow(10,e)+1)),!0!==this._bnodes[t])return this._bnodes[t]=!0,t;throw new Error("Failed creating a new blank node, increadible unprobable...")}_indexBNodes(){if(this._bnodesIndexed)return;const e=this._graph;Object.keys(e).forEach(a=>{0===a.indexOf("_:")&&(this._bnodes[a]=!0);const t=e[a];Object.keys(t).forEach(e=>{0===e.indexOf("_:")&&(this._bnodes[e]=!0),t[e].forEach(e=>{"bnode"===e.type&&(this._bnodes[e.value]=!0)})})}),this._bnodesIndexed=!0}_trackBNodes(e,a,t){0===e.indexOf("_:")&&(this._bnodes[e]=!0),0===a.indexOf("_:")&&(this._bnodes[a]=!0),"bnode"===t.type&&(this._bnodes[t.value]=!0)}}const k=(e,a)=>{var t=a.indexOf("#");if(t>0&&(a=a.slice(0,t)),0==e.length)return a;if(0==e.indexOf("#"))return a+e;if(e.indexOf(":")>=0)return e;var d=a.indexOf(":");if(d<0)return console.log("Invalid base URL "+a),e;var i,s=a.slice(0,d+1);if(0==e.indexOf("//"))return s+e;if(a.indexOf("//",d)==d+1){if((i=a.indexOf("/",d+3))<0)return a.length-d-3>0?a+"/"+e:s+e}else if((i=a.indexOf("/",d+1))<0)return a.length-d-1>0?a+"/"+e:s+e;if(0==e.indexOf("/"))return a.slice(0,i)+e;var n=a.slice(i),r=n.lastIndexOf("/");if(r<0)return s+e;for(r>=0&&r<n.length-1&&(n=n.slice(0,r+1)),n+=e;n.match(/[^\/]*\/\.\.\//);)n=n.replace(/[^\/]*\/\.\.\//,"");return n=n.replace(/\.\//g,""),a.slice(0,i)+n};var S;S=function(e){S.ns={RDF:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",RDFS:"http://www.w3.org/2000/01/rdf-schema#"},S.nodeType={ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12},this.frameFactory=function(e,a,t){return{NODE:1,ARC:2,parent:a,parser:e,store:e.store,element:t,lastChild:0,base:null,lang:null,node:null,nodeType:null,listIndex:1,rdfid:null,datatype:null,collection:!1,terminateFrame:function(){this.collection&&this.node.close()},addSymbol:function(e,a){a=k(a,this.base),this.node=this.store.sym(a),this.nodeType=e},loadTriple:function(){if(this.parent.parent.collection?this.parent.parent.node.append(this.node):this.store.add(this.parent.parent.node,this.parent.node,this.node,this.parser.why),null!=this.parent.rdfid){var e=this.store.sym(k("#"+this.parent.rdfid,this.base));this.store.add(e,this.store.sym(S.ns.RDF+"type"),this.store.sym(S.ns.RDF+"Statement"),this.parser.why),this.store.add(e,this.store.sym(S.ns.RDF+"subject"),this.parent.parent.node,this.parser.why),this.store.add(e,this.store.sym(S.ns.RDF+"predicate"),this.parent.node,this.parser.why),this.store.add(e,this.store.sym(S.ns.RDF+"object"),this.node,this.parser.why)}},isTripleToLoad:function(){return null!=this.parent&&null!=this.parent.parent&&this.nodeType==this.NODE&&this.parent.nodeType==this.ARC&&this.parent.parent.nodeType==this.NODE},addNode:function(e){this.addSymbol(this.NODE,e),this.isTripleToLoad()&&this.loadTriple()},addCollection:function(){this.nodeType=this.NODE,this.node=this.store.collection(),this.collection=!0,this.isTripleToLoad()&&this.loadTriple()},addCollectionArc:function(){this.nodeType=this.ARC},addBNode:function(e){null!=e?null!=this.parser.bnodes[e]?this.node=this.parser.bnodes[e]:this.node=this.parser.bnodes[e]=this.store.bnode():this.node=this.store.bnode(),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()},addArc:function(e){e==S.ns.RDF+"li"&&(e=S.ns.RDF+"_"+this.parent.listIndex++),this.addSymbol(this.ARC,e)},addLiteral:function(e){this.parent.datatype?this.node=this.store.literal(e,"",this.store.sym(this.parent.datatype)):this.node=this.store.literal(e,this.lang),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()}}},this.store=e,this.bnodes={},this.why=null,this.reify=!1,this.parse=function(e,a,t){var d,i=e.childNodes;if(this.cleanParser(),e.nodeType==S.nodeType.DOCUMENT){for(var s=0;s<i.length;s++)if(i[s].nodeType==S.nodeType.ELEMENT){d=i[s];break}}else{if(e.nodeType!=S.nodeType.ELEMENT)throw new Error("RDFParser: can't find root in "+a+". Halting. ");d=e}this.why=t;var n=this.frameFactory(this);return n.base=a,n.lang="",this.parseDOM(this.buildFrame(n,d)),!0},this.parseDOM=function(e){for(var a=function(e){return e.namespaceURI+e.localName},t=!0;e.parent;){var d,i,s=e.element,n=s.attributes;if(s.nodeType==S.nodeType.TEXT||s.nodeType==S.nodeType.CDATA_SECTION)e.addLiteral(s.nodeValue);else if(a(s)!=S.ns.RDF+"RDF")if(e.parent&&e.parent.collection&&(e.addCollectionArc(),(e=this.buildFrame(e,e.element)).parent.element=null),e.parent&&e.parent.nodeType&&e.parent.nodeType!=e.ARC){e.addArc(a(s)),this.reify&&(d=s.getAttributeNodeNS(S.ns.RDF,"ID"))&&(e.rdfid=d.nodeValue,s.removeAttributeNode(d));var r=s.getAttributeNodeNS(S.ns.RDF,"parseType"),p=s.getAttributeNodeNS(S.ns.RDF,"datatype");if(p&&(e.datatype=p.nodeValue,s.removeAttributeNode(p)),r){var o=r.nodeValue;"Literal"==o?(e.datatype=S.ns.RDF+"XMLLiteral",(e=this.buildFrame(e)).addLiteral(s),t=!1):"Resource"==o?((e=this.buildFrame(e,e.element)).parent.element=null,e.addBNode()):"Collection"==o&&((e=this.buildFrame(e,e.element)).parent.element=null,e.addCollection()),s.removeAttributeNode(r)}if(0!=n.length){var l=s.getAttributeNodeNS(S.ns.RDF,"resource");for(i=s.getAttributeNodeNS(S.ns.RDF,"nodeID"),e=this.buildFrame(e),l?(e.addNode(l.nodeValue),s.removeAttributeNode(l)):i?(e.addBNode(i.nodeValue),s.removeAttributeNode(i)):e.addBNode(),h=n.length-1;h>=0;h--){var m=this.buildFrame(e);m.addArc(a(n[h])),a(n[h])==S.ns.RDF+"type"?this.buildFrame(m).addNode(n[h].nodeValue):this.buildFrame(m).addLiteral(n[h].nodeValue)}}else 0==s.childNodes.length&&this.buildFrame(e).addLiteral("")}else{var u=s.getAttributeNodeNS(S.ns.RDF,"about");if(d=s.getAttributeNodeNS(S.ns.RDF,"ID"),u&&d)throw new Error("RDFParser: "+s.nodeName+" has both rdf:id and rdf:about. Halting. Only one of these properties may be specified on a node.");null==u&&d?(e.addNode("#"+d.nodeValue),s.removeAttributeNode(d)):null==u&&null==d?(i=s.getAttributeNodeNS(S.ns.RDF,"nodeID"))?(e.addBNode(i.nodeValue),s.removeAttributeNode(i)):e.addBNode():(e.addNode(u.nodeValue),s.removeAttributeNode(u));var _=s.getAttributeNodeNS(S.ns.RDF,"type");S.ns.RDF+"Description"!=a(s)&&(_={nodeValue:a(s)}),null!=_&&(this.store.add(e.node,this.store.sym(S.ns.RDF+"type"),this.store.sym(k(_.nodeValue,e.base)),this.why),_.nodeName&&s.removeAttributeNode(_));for(var h=n.length-1;h>=0;h--)this.store.add(e.node,this.store.sym(a(n[h])),this.store.literal(n[h].nodeValue,e.lang),this.why)}for(s=e.element;e.parent;){for(var c=e;null==s;)s=(e=e.parent).element;var f=s.childNodes,y=null!=f?f[e.lastChild]:null;if(null!=y&&t){if((y.nodeType==S.nodeType.ELEMENT||y.nodeType==S.nodeType.TEXT||y.nodeType==S.nodeType.CDATA_SECTION)&&(y.nodeType!=S.nodeType.TEXT&&y.nodeType!=S.nodeType.CDATA_SECTION||1==s.childNodes.length)){e.lastChild++,e=this.buildFrame(c,s.childNodes[e.lastChild-1]);break}e.lastChild++}else{if(e.terminateFrame(),!(e=e.parent))break;s=e.element,t=!0}}}},this.cleanParser=function(){this.bnodes={},this.why=null},this.buildFrame=function(e,a){var t=this.frameFactory(this,e,a);if(e&&(t.base=e.base,t.lang=e.lang),null==a||a.nodeType==S.nodeType.TEXT||a.nodeType==S.nodeType.CDATA_SECTION)return t;var d=a.attributes,i=a.getAttributeNode("xml:base");null!=i&&(t.base=i.nodeValue,a.removeAttribute("xml:base"));var s=a.getAttributeNode("xml:lang");null!=s&&(t.lang=s.nodeValue,a.removeAttribute("xml:lang"));for(var n=d.length-1;n>=0;n--)"xml"==d[n].nodeName.substr(0,3)&&a.removeAttributeNode(d[n]);return t}};const j=e=>"object"==typeof e?e:"string"==typeof e?new P(e):void(void 0!==e&&alert(`Can't make term from ${e} of type ${typeof e}`)),N=function(){return this};N.prototype.termType="empty",N.prototype.toString=function(){return""},N.prototype.toNT=function(){return""};const x=function(){return"<"+this.uri+">"},O=function(e){return this.uri=e,this};O.prototype.termType="symbol",O.prototype.toString=x,O.prototype.toNT=x;let H=0;const E=function(){return this.id=H++,this};E.prototype.termType="bnode",E.prototype.toNT=function(){return"_:n"+this.id},E.prototype.toString=E.prototype.toNT;const P=function(e,a,t){return this.value=e,this.lang=a,this.datatype=t,this};P.prototype.termType="literal",P.prototype.toNT=function(){const e=this.value;if("string"!=typeof e)throw Error("Value of RDF literal is not string: "+e);return e=e.replace(/\\/g,"\\\\"),e=e.replace(/"/g,'\\"'),e='"'+e+'"',this.datatype&&(e=e+"^^"+this.datatype),this.lang&&(e=e+"@"+this.lang),e},P.prototype.toString=function(){return this.value};const A=function(){this.id=H++,this.elements=[],this.closed=!1};A.prototype.termType="collection",A.prototype.toNT=function(){return"_:n"+this.id},A.prototype.toString=A.prototype.toNT,A.prototype.append=function(e){this.elements.push(e)},A.prototype.close=function(){this.closed=!0};const V=function(){return this.subject.toNT()+" "+this.predicate.toNT()+" "+this.object.toNT()+" ."},C=function(e,a,t,d){return this.subject=j(e),this.predicate=j(a),this.object=j(t),void 0!==d&&(this.why=d),this};C.prototype.toNT=V,C.prototype.toString=V;const F=function(){return this.statements=[],this.constraints=[],this.initBindings=[],this.optional=[],this},R=function(){return"{\n"+this.statements.join("\n")+"}"};F.prototype.termType="formula",F.prototype.toNT=R,F.prototype.toString=R,F.prototype.add=function(e,a,t,d){this.statements.push(new C(e,a,t,d))},F.prototype.sym=function(e,a){return null!=a&&(e=this.namespaces[e]+a),new O(e)},F.prototype.literal=function(e,a,t){return new P(e.toString(),a,t)},F.prototype.bnode=function(){return new E},F.prototype.formula=function(){return new F},F.prototype.collection=function(){return new A};const I=function(e){return this.uri=k(e,"varid:"),this};I.prototype.termType="variable",I.prototype.toNT=function(){return"varid:"==this.uri.slice(0,"varid:".length)?"?"+this.uri.slice("varid:".length):"?"+this.uri},I.prototype.toString=I.prototype.toNT,I.prototype.classOrder=7,F.prototype.variable=function(e){return new I(e)},I.prototype.hashString=I.prototype.toNT,F.prototype.fromNT=function(e){const a=e.length,t=e.slice(0,1);if("<"===t)return this.sym(e.slice(1,a-1));if("_"===t){const a=new E;return a.id=parseInt(e.slice(3)),H--,a}alert(`Can't yet convert from NT: '${e}', ${e[0]}`)};let W,B;Error;if("undefined"==typeof window||void 0===window.DOMParser&&"undefined"==typeof ActiveXObject){W=e=>(new XMLSerializer).serializeToString(e);const e=u.a.DOMParser;B=a=>(new e).parseFromString(a,"text/xml")}else W=e=>e.xml,B=e=>{let a;try{if(window.DOMParser){a=(new DOMParser).parseFromString(e,"text/xml")}else a=new ActiveXObject("Microsoft.XMLDOM"),a.async="false",a.loadXML(e)}catch(e){a=null}if(!a||!a.documentElement||a.getElementsByTagName("parsererror").length)throw new Error("Could not parse text as xml");return a};const z={rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",owl:"http://www.w3.org/2002/07/owl#"},U={rdftype:z.rdf+"type",rdfssco:z.rdfs+"subClassOf",rdfsdomain:z.rdfs+"domain",rdfsrange:z.rdfs+"range",rdfsspo:z.rdfs+"subPropertyOf",rdfsClass:z.rdfs+"Class",owlClass:z.owl+"Class",owlObjectProperty:z.owl+"ObjectProperty",owlDatatypeProperty:z.owl+"DatatypeProperty",rdfProperty:z.rdf+"Property"},J=(e,a,t)=>{const d={};let i=!1;const s=e.find(a,t);for(let e=0;e<s.length;e++){const a=s[e];"literal"===a.getType()&&(d[a.getLanguage()||""]=a.getValue()||"",i=!0)}if(i)return null==d.en&&null!=d[""]&&(d.en=d[""],delete d[""]),d},G=e=>{const a=[],t={};for(let d=0;d<e.length;d++){const i=e[d];t[i]||(a.push(i),t[i]=!0)}return a},$=class{constructor(e,a){this._uri=e,this._parents=[],this._children=[],this._graph=a}getURI(){return this._uri}getLabel(){const e=this.getLabels();if(null!=e.en)return e.en;const a=Object.objects(e);return a.length>0?a[0]:""}getLabels(){return null==this._labels&&(this._labels=J(this._graph,this._uri,z.rdfs+"label"),null==this._labels&&(this._labels={en:this._uri.substr(this._uri.lastIndexOf("/")+1)})),this._labels}getComment(){const e=this.getComments();return null!=e?null!=e.en?e.en:Object.objects(e)[0]:""}getComments(){return null==this._comments&&(this._comments=J(this._graph,this._uri,z.rdfs+"comment")),this._comments}addParent(e){this._parents.push(e),e._children.push(this)}getDirectParents(){return this._parents}getParents(){if(this._parentLock)return[];if(this._parentLock=!0,null==this._allParents){this._allParents=[];for(let e=0;e<this._parents.length;e++)this._allParents=this._allParents.concat(this._parents[e].getParents()),this._allParents.push(this._parents[e])}return delete this._parentLock,this._allParents}getChildren(){if(this._childLock)return[];if(this._childLock=!0,null==this._allChildren){this._allChildren=[];for(let e=0;e<this._children.length;e++)this._allChildren=this._allChildren.concat(this._children[e].getChildren()),this._allChildren.push(this._children[e])}return delete this._childLock,this._allChildren}setRange(e){null==this._range&&(this._range=[]),this._range.push(e)}setDomain(e){null==this._domain&&(this._domain=[]),this._domain.push(e),e.setDomainOf(this)}getRange(){if(null==this._allRange){this._allRange=this._range||[];for(let e=0;e<this._parents.length;e++)this._allRange=this._allRange.concat(this._parents[e].getRange());this._allRange=G(this._allRange)}return this._allRange}getDomain(){if(null==this._allDomain){this._allDomain=this._domain||[];for(let e=0;e<this._parents.length;e++)this._allDomain=this._allDomain.concat(this._parents[e].getDomain());this._allDomain=G(this._allDomain)}return this._allDomain}setDomainOf(e){null==this._domainOf&&(this._domainOf=[]),this._domainOf.push(e)}getDomainOf(){return this._domainOf}getAllDomainOf(){if(this._domainOfLock)return[];if(this._domainOfLock=!0,null==this._allDomainOf){const e=this._domainOf||[];this._allDomainOf=this._domainOf||[];for(let a=0;a<e.length;a++)this._allDomainOf=this._allDomainOf.concat(e[a].getChildren());for(let e=0;e<this._parents.length;e++)this._allDomainOf=this._allDomainOf.concat(this._parents[e].getAllDomainOf())}return delete this._domainOfLock,this._allDomainOf}},q=function(e,a,t,d){for(let i=0;i<t.length;i++){const s=t[i],n=s.getSubject();let r=e[n];if(r||(r=new $(n,s.getGraph()),e[n]=r,a.push(r)),d){const t=s.getValue();let d=e[t];d||(d=new $(t,s.getGraph()),e[t]=d,a.push(d)),r.addParent(d)}}},K=class{constructor(){this._cidx={},this._carr=[],this._pidx={},this._parr=[]}addGraph(e){q(this._cidx,this._carr,e.find(null,U.rdftype,U.rdfsClass)),q(this._cidx,this._carr,e.find(null,U.rdftype,U.owlClass)),q(this._cidx,this._carr,e.find(null,U.rdfssco,null),!0),q(this._pidx,this._parr,e.find(null,U.rdftype,U.rdfProperty)),q(this._pidx,this._parr,e.find(null,U.rdfsspo,null),!0),q(this._pidx,this._parr,e.find(null,U.rdftype,U.owlDatatypeProperty)),q(this._pidx,this._parr,e.find(null,U.rdftype,U.owlObjectProperty)),function(e,a,t){let d,i,s,n=e.find(null,U.rdfsdomain,null);for(let e=0;e<n.length;e++)s=n[e],d=a[s.getSubject()],i=t[s.getValue()],null!=d&&null!=i&&d.setDomain(i);n=e.find(null,U.rdfsrange,null);for(let e=0;e<n.length;e++)s=n[e],d=a[s.getSubject()],i=s.getValue(),null!=d&&null!=i&&d.setRange(i)}(e,this._pidx,this._cidx)}addThing(){const e="http://www.w3.org/2002/07/owl#Thing";let a=this._cidx[e],t=!1;a||(a=new $(e,new T),this._cidx[e]=a,this._carr.push(a),t=!0);for(let e=0;e<this._carr.length;e++){const d=this._carr[e];(t&&d!==a||-1===d.getParents().indexOf(a)&&d!==a)&&d.addParent(a)}}getClasses(){return this._carr}getProperties(){return this._parr}isClass(e){return null!=this._cidx[e]}isProperty(e){return null!=this._pidx[e]}getClass(e){return this._cidx[e]}getProperty(e){return this._pidx[e]}static getInstances(e){const a=[],t=[e].concat(e.getChildren());for(let e=0;e<t.length;e++){const d=t[e],i=d.getGraph.find(null,U.rdftype,d.getURI());for(let e=0;e<i.length;e++)a.push(i[e].getSubject())}return a}};K.prototype.ns=z,K.prototype.terms=U,K.global=new K;var Z=t(0),X=t.n(Z);var Q=function(){this.__data__=[],this.size=0};var ee=function(e,a){return e===a||e!=e&&a!=a};var ae=function(e,a){for(var t=e.length;t--;)if(ee(e[t][0],a))return t;return-1},te=Array.prototype.splice;var de=function(e){var a=this.__data__,t=ae(a,e);return!(t<0)&&(t==a.length-1?a.pop():te.call(a,t,1),--this.size,!0)};var ie=function(e){var a=this.__data__,t=ae(a,e);return t<0?void 0:a[t][1]};var se=function(e){return ae(this.__data__,e)>-1};var ne=function(e,a){var t=this.__data__,d=ae(t,e);return d<0?(++this.size,t.push([e,a])):t[d][1]=a,this};function re(e){var a=-1,t=null==e?0:e.length;for(this.clear();++a<t;){var d=e[a];this.set(d[0],d[1])}}re.prototype.clear=Q,re.prototype.delete=de,re.prototype.get=ie,re.prototype.has=se,re.prototype.set=ne;var pe=re;var oe=function(){this.__data__=new pe,this.size=0};var le=function(e){var a=this.__data__,t=a.delete(e);return this.size=a.size,t};var me=function(e){return this.__data__.get(e)};var ue=function(e){return this.__data__.has(e)},_e=t(1),he=_e.a.Symbol,ce=Object.prototype,fe=ce.hasOwnProperty,ye=ce.toString,ve=he?he.toStringTag:void 0;var Me=function(e){var a=fe.call(e,ve),t=e[ve];try{e[ve]=void 0;var d=!0}catch(e){}var i=ye.call(e);return d&&(a?e[ve]=t:delete e[ve]),i},ge=Object.prototype.toString;var we=function(e){return ge.call(e)},Le=he?he.toStringTag:void 0;var Ye=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Le&&Le in Object(e)?Me(e):we(e)};var De=function(e){var a=typeof e;return null!=e&&("object"==a||"function"==a)};var be,Te=function(e){if(!De(e))return!1;var a=Ye(e);return"[object Function]"==a||"[object GeneratorFunction]"==a||"[object AsyncFunction]"==a||"[object Proxy]"==a},ke=_e.a["__core-js_shared__"],Se=(be=/[^.]+$/.exec(ke&&ke.keys&&ke.keys.IE_PROTO||""))?"Symbol(src)_1."+be:"";var je=function(e){return!!Se&&Se in e},Ne=Function.prototype.toString;var xe=function(e){if(null!=e){try{return Ne.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Oe=/^\[object .+?Constructor\]$/,He=Function.prototype,Ee=Object.prototype,Pe=He.toString,Ae=Ee.hasOwnProperty,Ve=RegExp("^"+Pe.call(Ae).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Ce=function(e){return!(!De(e)||je(e))&&(Te(e)?Ve:Oe).test(xe(e))};var Fe=function(e,a){return null==e?void 0:e[a]};var Re=function(e,a){var t=Fe(e,a);return Ce(t)?t:void 0},Ie=Re(_e.a,"Map"),We=Re(Object,"create");var Be=function(){this.__data__=We?We(null):{},this.size=0};var ze=function(e){var a=this.has(e)&&delete this.__data__[e];return this.size-=a?1:0,a},Ue=Object.prototype.hasOwnProperty;var Je=function(e){var a=this.__data__;if(We){var t=a[e];return"__lodash_hash_undefined__"===t?void 0:t}return Ue.call(a,e)?a[e]:void 0},Ge=Object.prototype.hasOwnProperty;var $e=function(e){var a=this.__data__;return We?void 0!==a[e]:Ge.call(a,e)};var qe=function(e,a){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=We&&void 0===a?"__lodash_hash_undefined__":a,this};function Ke(e){var a=-1,t=null==e?0:e.length;for(this.clear();++a<t;){var d=e[a];this.set(d[0],d[1])}}Ke.prototype.clear=Be,Ke.prototype.delete=ze,Ke.prototype.get=Je,Ke.prototype.has=$e,Ke.prototype.set=qe;var Ze=Ke;var Xe=function(){this.size=0,this.__data__={hash:new Ze,map:new(Ie||pe),string:new Ze}};var Qe=function(e){var a=typeof e;return"string"==a||"number"==a||"symbol"==a||"boolean"==a?"__proto__"!==e:null===e};var ea=function(e,a){var t=e.__data__;return Qe(a)?t["string"==typeof a?"string":"hash"]:t.map};var aa=function(e){var a=ea(this,e).delete(e);return this.size-=a?1:0,a};var ta=function(e){return ea(this,e).get(e)};var da=function(e){return ea(this,e).has(e)};var ia=function(e,a){var t=ea(this,e),d=t.size;return t.set(e,a),this.size+=t.size==d?0:1,this};function sa(e){var a=-1,t=null==e?0:e.length;for(this.clear();++a<t;){var d=e[a];this.set(d[0],d[1])}}sa.prototype.clear=Xe,sa.prototype.delete=aa,sa.prototype.get=ta,sa.prototype.has=da,sa.prototype.set=ia;var na=sa;var ra=function(e,a){var t=this.__data__;if(t instanceof pe){var d=t.__data__;if(!Ie||d.length<199)return d.push([e,a]),this.size=++t.size,this;t=this.__data__=new na(d)}return t.set(e,a),this.size=t.size,this};function pa(e){var a=this.__data__=new pe(e);this.size=a.size}pa.prototype.clear=oe,pa.prototype.delete=le,pa.prototype.get=me,pa.prototype.has=ue,pa.prototype.set=ra;var oa=pa;var la=function(e,a){for(var t=-1,d=null==e?0:e.length;++t<d&&!1!==a(e[t],t,e););return e},ma=function(){try{var e=Re(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var ua=function(e,a,t){"__proto__"==a&&ma?ma(e,a,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[a]=t},_a=Object.prototype.hasOwnProperty;var ha=function(e,a,t){var d=e[a];_a.call(e,a)&&ee(d,t)&&(void 0!==t||a in e)||ua(e,a,t)};var ca=function(e,a,t,d){var i=!t;t||(t={});for(var s=-1,n=a.length;++s<n;){var r=a[s],p=d?d(t[r],e[r],r,t,e):void 0;void 0===p&&(p=e[r]),i?ua(t,r,p):ha(t,r,p)}return t};var fa=function(e,a){for(var t=-1,d=Array(e);++t<e;)d[t]=a(t);return d};var ya=function(e){return null!=e&&"object"==typeof e};var va=function(e){return ya(e)&&"[object Arguments]"==Ye(e)},Ma=Object.prototype,ga=Ma.hasOwnProperty,wa=Ma.propertyIsEnumerable,La=va(function(){return arguments}())?va:function(e){return ya(e)&&ga.call(e,"callee")&&!wa.call(e,"callee")},Ya=Array.isArray,Da=t(6),ba=/^(?:0|[1-9]\d*)$/;var Ta=function(e,a){var t=typeof e;return!!(a=null==a?9007199254740991:a)&&("number"==t||"symbol"!=t&&ba.test(e))&&e>-1&&e%1==0&&e<a};var ka=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Sa={};Sa["[object Float32Array]"]=Sa["[object Float64Array]"]=Sa["[object Int8Array]"]=Sa["[object Int16Array]"]=Sa["[object Int32Array]"]=Sa["[object Uint8Array]"]=Sa["[object Uint8ClampedArray]"]=Sa["[object Uint16Array]"]=Sa["[object Uint32Array]"]=!0,Sa["[object Arguments]"]=Sa["[object Array]"]=Sa["[object ArrayBuffer]"]=Sa["[object Boolean]"]=Sa["[object DataView]"]=Sa["[object Date]"]=Sa["[object Error]"]=Sa["[object Function]"]=Sa["[object Map]"]=Sa["[object Number]"]=Sa["[object Object]"]=Sa["[object RegExp]"]=Sa["[object Set]"]=Sa["[object String]"]=Sa["[object WeakMap]"]=!1;var ja=function(e){return ya(e)&&ka(e.length)&&!!Sa[Ye(e)]};var Na=function(e){return function(a){return e(a)}},xa=t(4),Oa=xa.a&&xa.a.isTypedArray,Ha=Oa?Na(Oa):ja,Ea=Object.prototype.hasOwnProperty;var Pa=function(e,a){var t=Ya(e),d=!t&&La(e),i=!t&&!d&&Object(Da.a)(e),s=!t&&!d&&!i&&Ha(e),n=t||d||i||s,r=n?fa(e.length,String):[],p=r.length;for(var o in e)!a&&!Ea.call(e,o)||n&&("length"==o||i&&("offset"==o||"parent"==o)||s&&("buffer"==o||"byteLength"==o||"byteOffset"==o)||Ta(o,p))||r.push(o);return r},Aa=Object.prototype;var Va=function(e){var a=e&&e.constructor;return e===("function"==typeof a&&a.prototype||Aa)};var Ca=function(e,a){return function(t){return e(a(t))}},Fa=Ca(Object.keys,Object),Ra=Object.prototype.hasOwnProperty;var Ia=function(e){if(!Va(e))return Fa(e);var a=[];for(var t in Object(e))Ra.call(e,t)&&"constructor"!=t&&a.push(t);return a};var Wa=function(e){return null!=e&&ka(e.length)&&!Te(e)};var Ba=function(e){return Wa(e)?Pa(e):Ia(e)};var za=function(e,a){return e&&ca(a,Ba(a),e)};var Ua=function(e){var a=[];if(null!=e)for(var t in Object(e))a.push(t);return a},Ja=Object.prototype.hasOwnProperty;var Ga=function(e){if(!De(e))return Ua(e);var a=Va(e),t=[];for(var d in e)("constructor"!=d||!a&&Ja.call(e,d))&&t.push(d);return t};var $a=function(e){return Wa(e)?Pa(e,!0):Ga(e)};var qa=function(e,a){return e&&ca(a,$a(a),e)},Ka=t(155);var Za=function(e,a){var t=-1,d=e.length;for(a||(a=Array(d));++t<d;)a[t]=e[t];return a};var Xa=function(e,a){for(var t=-1,d=null==e?0:e.length,i=0,s=[];++t<d;){var n=e[t];a(n,t,e)&&(s[i++]=n)}return s};var Qa=function(){return[]},et=Object.prototype.propertyIsEnumerable,at=Object.getOwnPropertySymbols,tt=at?function(e){return null==e?[]:(e=Object(e),Xa(at(e),(function(a){return et.call(e,a)})))}:Qa;var dt=function(e,a){return ca(e,tt(e),a)};var it=function(e,a){for(var t=-1,d=a.length,i=e.length;++t<d;)e[i+t]=a[t];return e},st=Ca(Object.getPrototypeOf,Object),nt=Object.getOwnPropertySymbols?function(e){for(var a=[];e;)it(a,tt(e)),e=st(e);return a}:Qa;var rt=function(e,a){return ca(e,nt(e),a)};var pt=function(e,a,t){var d=a(e);return Ya(e)?d:it(d,t(e))};var ot=function(e){return pt(e,Ba,tt)};var lt=function(e){return pt(e,$a,nt)},mt=Re(_e.a,"DataView"),ut=Re(_e.a,"Promise"),_t=Re(_e.a,"Set"),ht=Re(_e.a,"WeakMap"),ct=xe(mt),ft=xe(Ie),yt=xe(ut),vt=xe(_t),Mt=xe(ht),gt=Ye;(mt&&"[object DataView]"!=gt(new mt(new ArrayBuffer(1)))||Ie&&"[object Map]"!=gt(new Ie)||ut&&"[object Promise]"!=gt(ut.resolve())||_t&&"[object Set]"!=gt(new _t)||ht&&"[object WeakMap]"!=gt(new ht))&&(gt=function(e){var a=Ye(e),t="[object Object]"==a?e.constructor:void 0,d=t?xe(t):"";if(d)switch(d){case ct:return"[object DataView]";case ft:return"[object Map]";case yt:return"[object Promise]";case vt:return"[object Set]";case Mt:return"[object WeakMap]"}return a});var wt=gt,Lt=Object.prototype.hasOwnProperty;var Yt=function(e){var a=e.length,t=new e.constructor(a);return a&&"string"==typeof e[0]&&Lt.call(e,"index")&&(t.index=e.index,t.input=e.input),t},Dt=_e.a.Uint8Array;var bt=function(e){var a=new e.constructor(e.byteLength);return new Dt(a).set(new Dt(e)),a};var Tt=function(e,a){var t=a?bt(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.byteLength)},kt=/\w*$/;var St=function(e){var a=new e.constructor(e.source,kt.exec(e));return a.lastIndex=e.lastIndex,a},jt=he?he.prototype:void 0,Nt=jt?jt.valueOf:void 0;var xt=function(e){return Nt?Object(Nt.call(e)):{}};var Ot=function(e,a){var t=a?bt(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)};var Ht=function(e,a,t){var d=e.constructor;switch(a){case"[object ArrayBuffer]":return bt(e);case"[object Boolean]":case"[object Date]":return new d(+e);case"[object DataView]":return Tt(e,t);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Ot(e,t);case"[object Map]":return new d;case"[object Number]":case"[object String]":return new d(e);case"[object RegExp]":return St(e);case"[object Set]":return new d;case"[object Symbol]":return xt(e)}},Et=Object.create,Pt=function(){function e(){}return function(a){if(!De(a))return{};if(Et)return Et(a);e.prototype=a;var t=new e;return e.prototype=void 0,t}}();var At=function(e){return"function"!=typeof e.constructor||Va(e)?{}:Pt(st(e))};var Vt=function(e){return ya(e)&&"[object Map]"==wt(e)},Ct=xa.a&&xa.a.isMap,Ft=Ct?Na(Ct):Vt;var Rt=function(e){return ya(e)&&"[object Set]"==wt(e)},It=xa.a&&xa.a.isSet,Wt=It?Na(It):Rt,Bt={};Bt["[object Arguments]"]=Bt["[object Array]"]=Bt["[object ArrayBuffer]"]=Bt["[object DataView]"]=Bt["[object Boolean]"]=Bt["[object Date]"]=Bt["[object Float32Array]"]=Bt["[object Float64Array]"]=Bt["[object Int8Array]"]=Bt["[object Int16Array]"]=Bt["[object Int32Array]"]=Bt["[object Map]"]=Bt["[object Number]"]=Bt["[object Object]"]=Bt["[object RegExp]"]=Bt["[object Set]"]=Bt["[object String]"]=Bt["[object Symbol]"]=Bt["[object Uint8Array]"]=Bt["[object Uint8ClampedArray]"]=Bt["[object Uint16Array]"]=Bt["[object Uint32Array]"]=!0,Bt["[object Error]"]=Bt["[object Function]"]=Bt["[object WeakMap]"]=!1;var zt=function e(a,t,d,i,s,n){var r,p=1&t,o=2&t,l=4&t;if(d&&(r=s?d(a,i,s,n):d(a)),void 0!==r)return r;if(!De(a))return a;var m=Ya(a);if(m){if(r=Yt(a),!p)return Za(a,r)}else{var u=wt(a),_="[object Function]"==u||"[object GeneratorFunction]"==u;if(Object(Da.a)(a))return Object(Ka.a)(a,p);if("[object Object]"==u||"[object Arguments]"==u||_&&!s){if(r=o||_?{}:At(a),!p)return o?rt(a,qa(r,a)):dt(a,za(r,a))}else{if(!Bt[u])return s?a:{};r=Ht(a,u,p)}}n||(n=new oa);var h=n.get(a);if(h)return h;n.set(a,r),Wt(a)?a.forEach((function(i){r.add(e(i,t,d,i,a,n))})):Ft(a)&&a.forEach((function(i,s){r.set(s,e(i,t,d,s,a,n))}));var c=m?void 0:(l?o?lt:ot:o?$a:Ba)(a);return la(c||a,(function(i,s){c&&(i=a[s=i]),ha(r,s,e(i,t,d,s,a,n))})),r};var Ut=function(e){return zt(e,5)};const Jt=(e,a,t,d)=>{if("URI"===e.getNodetype()||"RESOURCE"===e.getNodetype()){let t=Kt.getLocalizedMap(d,a,e.getURIValueLabelProperties());if(!t){const e=a.lastIndexOf("#"),d=a.lastIndexOf("/");t=e>0||d>0?{"":decodeURIComponent(a.substring(1+(e>d?e:d)))}:{"":a}}return{value:a,label:t}}return{value:a,label:a}};var Gt={hasDnDSupport:e=>!1,addDnD:(e,a,t)=>({}),attachExternalLinkBehaviour:()=>!1,attachLinkBehaviour:(e,a)=>!1,openChoiceSelector:(e,a)=>{alert('This alert is a placeholder for a search dialog that should be provided as part of the integration of RDForms into a wider system.\nSimply override the methods "getChoices" and "openChoiceSelector" in the system module.'),a({value:"http://example.com/choice1",label:{en:"First choice",sv:"Första valet"}})},getChoice:(e,a,t,d)=>Jt(e,a,0,d),getFallbackChoice:Jt,labelProperties:["http://www.w3.org/2000/01/rdf-schema#label","http://purl.org/dc/terms/title","http://purl.org/dc/elements/1.1/title","http://www.w3.org/2004/02/skos/core#prefLabel","http://xmlns.com/foaf/0.1/name","http://xmlns.com/foaf/name"],createURI:(e,a)=>{const t=a.getChildrenRootUri(),d=t.lastIndexOf("#"),i=-1===d?t+"#":t.substring(0,d+1),s=a.getGraph()._graph;for(;;){const e=i+("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4);if(null==s[e])return e}}};const $t=e=>{const a=X.a.locale();if(null==e)return{precision:"none"};if("string"==typeof e)return{value:e,precision:"nolang",lang:""};if(e.hasOwnProperty(a))return{value:e[a],precision:"exact",lang:a};if(a.indexOf("_")>-1&&e.hasOwnProperty(a.substr(0,2)))return{value:e[a.substr(0,2)],precision:"coarsen",lang:a.substr(0,2)};if(e.hasOwnProperty("en"))return{value:e.en,precision:"default",lang:"en"};if(e.hasOwnProperty(""))return{value:e[""],precision:"nolang",lang:""};const t=Object.keys(e);return t.length>0?{value:e[t[0]],precision:"any",lang:t[0]}:{precision:"none"}},qt=(e,a,t)=>{const d=e.find(a,t);if(d.length>0){const e={};for(let a=0;a<d.length;a++)e[d[a].getLanguage()||""]=d[a].getValue();return e}};var Kt={getLocalizedValue:$t,getLocalizedMap:(e,a,t)=>{let d,i=a,s=t;e.getItem?(d=e.getGraph(),i=e.getValue(),s=e.getItem().getURIValueLabelProperties()):d=e,null!=s&&0!==s.length||(s=Gt.labelProperties);for(let e=0;e<s.length;e++){const a=s[e];if(Array.isArray(a)){const e=[];for(let t=0;t<a.length;t++){const s=qt(d,i,a[t]);s&&e.push($t(s).value)}if(e.length>0)return{"":e.join(" ")}}else{const e=qt(d,i,a);if(e)return e}}},cloneArrayWithLabels:(e,a)=>{const t=[];for(let a=0;a<e.length;a++){const d=e[a],i=$t(d.label),s={value:d.value,label:i.value||d.value||""};!0===d.top&&(s.top=!0),null!=d.children&&(s.children=Ut(d.children)),!1===d.selectable?s.selectable=!1:s.selectable=!0,t.push(s)}return!0!==a&&t.sort((e,a)=>e.label>a.label?1:-1),t},extractGist:(e,a)=>{let t=a;if(t){-1===t.indexOf("$1")&&(t+="$1");const a=(""+t).replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1").replace("\\$1","(.*)"),d=new RegExp(a).exec(e);if(null!=d)return d[1]}return e},findFirstValue:(e,a,t,d)=>{const i=e.findFirstValueBinding(e.match(a,t,d),!1);if(i)return i.getChoice?$t(i.getChoice().label).value:i.getGist()},generateUUID:()=>{let e=(new Date).getTime();return"undefined"!=typeof performance&&"function"==typeof performance.now&&(e+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,a=>{const t=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===a?t:3&t|8).toString(16)})}};let Zt=0;const Xt=(e,a,t)=>{null==t||""===t||Array.isArray(t)&&0===t.length?delete e[a]:e[a]=t};class Qt{constructor({source:e={},bundle:a,itemStore:t}){this._itemStore=t,this._source=e,this._bundle=a,Zt+=1,this._internalId=Zt,this._styles=["heading","invisible","invisibleGroup","stars","commentOn","multiline","horizontalRadioButtons","verticalRadioButtons","horizontalCheckBoxes","verticalCheckBoxes","nonEditable","expandable","compact","nonCompact","dropDown","table","firstcolumnfixedtable","tree","externalLink","internalLink","noLink","image","label","tooltip","strictmatch","relaxedDatatypeMatch","viewAllTranslations","filterTranslations","email","atLeastOneChild","atMostOneChild","exactlyOneChild","noLabelInPresent","autoInitDate","autoUpdateDate","autoUUID","autoValue","showURI","showLink","showValue","showDescriptionInPresent","showDescriptionInEdit","textAsChoice","preserveOrderOfChoices","linkWithLabel","deprecated","inline","truncate","noTruncate","card","cardInPresent","cardInEdit"],this._getLocalizedValue=Kt.getLocalizedValue}getId(){const e=this.getSource(!0);return e.id||e["@id"]}setId(e){Xt(this.getSource(!0),"id",e),delete s["@id"]}getType(e){const a=this.getSource(e);return a.type||a["@type"]}setType(e){Xt(this.getSource(!0),"type",e),delete s["@type"],this.refreshExtends()}getExtends(){return this.getSource(!0).extends||""}refreshExtends(){this.isExtention&&this.setExtends(this.getExtends())}setExtends(e){const a=this.getSource(!0),t=this._itemStore.getItem(e);this._source=null==t?a:this._itemStore.createExtendedSource(t.getSource(),a),""===e||null==e?delete a.extends:a.extends=e}isExtention(){return null!=this.getExtends()}_getText(e,a,t){const d=this.getSource(t);return a?Kt.getLocalizedValue(d[e]):Kt.getLocalizedValue(d[e]).value}_setText(e,a,t){const d=this.getSource(!0);d[e]=this._setLangHash(d[e],a,t),this.refreshExtends()}_setTextMap(e,a){Xt(this.getSource(!0),e,a),this.refreshExtends()}getLabel(e,a){return this._getText("label",e,a)}setLabel(e,a){this._setText("label",e,a)}getLabelMap(e){return this.getSource(e).label}setLabelMap(e){this._setTextMap("label",e)}getEditLabel(e,a){return this._getText("editlabel",e,a)}setEditLabel(e,a){this._setText("editlabel",e,a)}getEditLabelMap(e){return this.getSource(e).editlabel}setEditLabelMap(e){this._setTextMap("editlabel",e)}getDescription(e,a){return this._getText("description",e,a)}setDescription(e,a){this._setText("description",e,a)}getDescriptionMap(e){return this.getSource(e).description}setDescriptionMap(e){this._setTextMap("description",e)}getEditDescription(e,a){return this._getText("editdescription",e,a)}setEditDescription(e,a){this._setText("editdescription",e,a)}getEditDescriptionMap(e){return this.getSource(e).editdescription}setEditDescriptionMap(e){this._setTextMap("editdescription",e)}getHelp(e,a){return this._getText("help",e,a)}setHelp(e,a){this._setText("help",e,a)}getHelpMap(e){return this.getSource(e).help}setHelpMap(e){this._setTextMap("help",e)}getPlaceholder(e,a){return this._getText("placeholder",e,a)}setPlaceholder(e,a){this._setText("placeholder",e,a)}getPlaceholderMap(e){return this.getSource(e).placeholder}setPlaceholderMap(e){this._setTextMap("placeholder",e)}getPurpose(e,a){return this._getText("purpose",e,a)}setPurpose(e,a){this._setText("purpose",e,a)}getPurposeMap(e){return this.getSource(e).purpose}setPurposeMap(e){this._setTextMap("purpose",e)}getSpecification(e,a){return this._getText("specification",e,a)}setSpecification(e,a){this._setText("specification",e,a)}getSpecificationMap(e){return this.getSource(e).specification}setSpecificationMap(e){this._setTextMap("specification",e)}getProperty(e){let a=null;const t=this.getSource(e);return t&&(a=t.property,null!=a&&""!==a&&(a=o(a))),a}setProperty(e){Xt(this.getSource(!0),"property",e),this.refreshExtends()}getURIValueLabelProperties(e){const a=this.getSource(e).uriValueLabelProperties;return null!=a?a.map(e=>o(e)):a}setURIValueLabelProperties(e){Xt(this.getSource(!0),"uriValueLabelProperties",e),this.refreshExtends()}getConstraints(e){const a=this.getSource(e).constraints;if(null!=a){const e={};return Object.keys(a).forEach(t=>{const d=a[t];Array.isArray(d)?e[o(t)]=d.map(e=>o(e)):e[o(t)]=o(d)}),e}return a}setConstraints(e){Xt(this.getSource(!0),"constraints",e),this.refreshExtends()}getDeps(e){const a=this.getSource(e).deps;return null!=a?a.map(e=>"*"!==e&&".."!==e?o(e):e):a}setDeps(e){Xt(this.getSource(!0),"deps",e),this.refreshExtends()}getDatatype(e){const a=this.getSource(e).datatype;return null!=a&&""!==a?Array.isArray(a)?a.map(e=>o(e)):o(a):a}setDatatype(e){Xt(this.getSource(!0),"datatype",e),this.refreshExtends()}getPattern(e){return this.getSource(e).pattern}setPattern(e){Xt(this.getSource(!0),"pattern",e),this.refreshExtends()}getLanguage(e){return this.getSource(e).language}setLanguage(e){Xt(this.getSource(!0),"language",e),this.refreshExtends()}getMember(e){return this.getSource(e).member}setMember(e){Xt(this.getSource(!0),"member",e),this.refreshExtends()}getNodetype(e){const a=this.getSource(e);return a.nodetype||a.nodeType}setNodetype(e){Xt(this.getSource(!0),"nodetype",e),this.refreshExtends()}getValue(e){return this.getSource(e).value}setValue(e){Xt(this.getSource(!0),"value",e),this.refreshExtends()}getValueTemplate(e){return this.getSource(e).valueTemplate}setValueTemplate(e){Xt(this.getSource(!0),"valueTemplate",e),this.refreshExtends()}getCardinality(e){if(!this.getProperty()&&"text"===this.getType())return{min:1,max:1};const a=this.getSource(e);return a&&"cardinality"in a?a.cardinality:this.getProperty()?{}:{max:1}}setCardinality(e){Xt(this.getSource(!0),"cardinality",e),this.refreshExtends()}isEnabled(e){const a=this.getSource(e);return null==a.enabled||a.enabled}setEnabled(e){const a=this.getSource(!0);e?delete a.enabled:a.enabled=e,this.refreshExtends()}getClasses(e){const a=this.getSource(e);return a&&"cls"in a?a.cls:[]}setClasses(e){Xt(this.getSource(!0),"cls",e),this.refreshExtends()}hasClass(e,a){const t=this.getSource(a);return!!this.hasStyle(e,a)||null!=t.cls&&t.cls.some(a=>a.toLowerCase()===e.toLowerCase())}getAvailableStyles(){return this._styles}getStyles(e){return this.getSource(e).styles||[]}setStyles(e){Xt(this.getSource(!0),"styles",e),this.refreshExtends()}hasStyle(e,a){const t=this.getSource(a);return!(!t||!("styles"in t))&&t.styles.some(a=>a.toLowerCase()===e.toLowerCase())}getSource(e){if(!0===e)return this._source._extendedSource||this._source;if(!1===e){const e=this._itemStore.getItem(this.getExtends());return null==e?this._source:e.getSource()}return this._source}getBundle(){return this._bundle}toStringShort(){return`'${this.getLabel()}'${this.getId()?` (ID: '${this.getId()}')`:""}`}toString(){const e=[];return this.getId()&&e.push(`ID: '${this.getId()}'`),e.push(`TYPE: '${this.getType()}'`),this.getProperty()&&e.push(`PROPERTY: '${this.getProperty()}'`),this.getExtends()&&e.push(`EXTENDS: '${this.getExtends()}'`),`'${this.getLabel()}' (${e.join(", ")})`}_setLangHash(e,a,t){const d=e||{};if("string"==typeof a)"string"==typeof t?d[t]=a:d[""]=a;else if("object"==typeof a&&null!==a)return a;return d}}class ed extends Qt{constructor(e){super(e),this._children=e.children,null!=this._source.content&&(this._source.items=this._source.content,delete this._source.content),this._forceChildrenClones=!1,this._parent=null}getChildren(e){const a=e&&this.isExtention();let t=a?this._ochildren:this._children;var d;return null==t&&(t=this._itemStore.getChildren(this,a),!0===this.getSource().automatic&&this._itemStore.automaticSortAllowed&&((d=t).forEach(e=>{e.__label=(e.getLabel()||"").toLowerCase()}),d.sort((e,a)=>null!=e._source.priority?null!=a._source.priority?e._source.priority>a._source.priority?-1:e._source.priority<a._source.priority?1:0:e._source.priority>0?-1:1:null!=a._source.priority?a._source.priority>0?1:-1:e.__label>a.__label?1:e.__label<a.__label?-1:0)),this[`_${a?"o":""}children`]=t),t}originalChildrenChanged(){this.isExtention()&&delete this._children}setExtends(e){super.setExtends(e),delete this._children,delete this._ochildren}getNodetype(){return super.getNodetype()||"RESOURCE"}}class ad extends ed{getChildren(e){if(null==this._delegatedChildren){const a=()=>({min:1,max:1,pref:1}),t=super.getChildren(e)||[];this._delegatedChildren=t.map(e=>{const t=Object.create(e);return t.getCardinality=a,t})}return this._delegatedChildren}getPropertyItem(){return this.getChildren()[0]}getObjectItem(){return this.getChildren()[1]}}class td extends Qt{getLabelProperties(e){return this.getSource(e).labelProperties}}const dd=e=>{null!=e&&e.forEach(e=>{e.value=o(e.value)})};class id extends Qt{constructor(e){super(e),this._ontologyStore=e.ontologyStore}getChoices(e){return this.getStaticChoices(e)||this.getDynamicChoices(e)||[]}hasChoices(e){const a=this.getSource(e);return null!=a.ontologyUrl||null!=a.choices}hasStaticChoices(e){return null!=this.getSource(e).choices}getStaticChoices(e){const a=this.getSource(e);if(a.choices){const t=-1===this.getNodetype().indexOf("LITERAL");e&&this.isExtention()?this._origStaticIsSorted||(t&&dd(a.choices),this._origStaticIsSorted=!0):this._staticIsSorted||(t&&dd(a.choices),this._staticIsSorted=!0)}return a.choices}setStaticChoices(e){const a=this.getSource(!0);a.choices!==e&&(null!=e&&(this._origStaticIsSorted=!0),a.choices=e,this.refreshExtends())}setExtends(e){super.setExtends(e),delete this._staticIsSorted,delete this._origStaticIsSorted}getDynamicChoices(e){if(null==this._dynamicChoices){if(null==e)return this._dynamicChoices=this._ontologyStore.getChoices(this),this._dynamicChoices;this._ontologyStore.getChoices(this,a=>{this._dynamicChoices=a,null==this._dynamicChoices&&(console.log("Failed lookup of choices for "+this.getLabel()),console.log("OntologyUrl is: "+this._source.ontologyUrl)),e(this._dynamicChoices)})}else{if(null==e)return this._dynamicChoices;e(this._dynamicChoices)}}getOntologyUrl(e){const a=this.getSource(e).ontologyUrl;return null!=a&&""!==a?o(a):a}setOntologyUrl(e){const a=this.getSource(!0);null==e||""===e?delete a.ontologyUrl:a.ontologyUrl=e,this.refreshExtends()}getLabelProperties(e){return this.getSource(e).labelProperties||["http://www.w3.org/2000/01/rdf-schema#label"]}getParentProperty(e){const a=this.getSource(e).parentProperty;return null!=a&&""!==a?o(a):a}setParentProperty(e){const a=this.getSource(!0);null==e||""===e?delete a.parentProperty:a.parentProperty=e,this.refreshExtends()}getHierarchyProperty(e){const a=this.getSource(e).hierarchyProperty;return null!=a&&""!==a?o(a):a}setHierarchyProperty(e){const a=this.getSource(!0);null==e||""===e?delete a.hierarchyProperty:a.hierarchyProperty=e,this.refreshExtends()}isParentPropertyInverted(e){return!0===this.getSource(e).isParentPropertyInverted}setParentPropertyInverted(e){const a=this.getSource(!0);!0===e?a.isParentPropertyInverted=!0:delete a.isParentPropertyInverted,this.refreshExtends()}isHierarchyPropertyInverted(e){return!0===this.getSource(e).isHierarchyPropertyInverted}setHierarchyPropertyInverted(e){const a=this.getSource(!0);e?a.isHierarchyPropertyInverted=!0:delete a.isHierarchyPropertyInverted,this.refreshExtends()}}var sd=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};var nd=function(e){return this.__data__.has(e)};function rd(e){var a=-1,t=null==e?0:e.length;for(this.__data__=new na;++a<t;)this.add(e[a])}rd.prototype.add=rd.prototype.push=sd,rd.prototype.has=nd;var pd=rd;var od=function(e,a){for(var t=-1,d=null==e?0:e.length;++t<d;)if(a(e[t],t,e))return!0;return!1};var ld=function(e,a){return e.has(a)};var md=function(e,a,t,d,i,s){var n=1&t,r=e.length,p=a.length;if(r!=p&&!(n&&p>r))return!1;var o=s.get(e),l=s.get(a);if(o&&l)return o==a&&l==e;var m=-1,u=!0,_=2&t?new pd:void 0;for(s.set(e,a),s.set(a,e);++m<r;){var h=e[m],c=a[m];if(d)var f=n?d(c,h,m,a,e,s):d(h,c,m,e,a,s);if(void 0!==f){if(f)continue;u=!1;break}if(_){if(!od(a,(function(e,a){if(!ld(_,a)&&(h===e||i(h,e,t,d,s)))return _.push(a)}))){u=!1;break}}else if(h!==c&&!i(h,c,t,d,s)){u=!1;break}}return s.delete(e),s.delete(a),u};var ud=function(e){var a=-1,t=Array(e.size);return e.forEach((function(e,d){t[++a]=[d,e]})),t};var _d=function(e){var a=-1,t=Array(e.size);return e.forEach((function(e){t[++a]=e})),t},hd=he?he.prototype:void 0,cd=hd?hd.valueOf:void 0;var fd=function(e,a,t,d,i,s,n){switch(t){case"[object DataView]":if(e.byteLength!=a.byteLength||e.byteOffset!=a.byteOffset)return!1;e=e.buffer,a=a.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=a.byteLength||!s(new Dt(e),new Dt(a)));case"[object Boolean]":case"[object Date]":case"[object Number]":return ee(+e,+a);case"[object Error]":return e.name==a.name&&e.message==a.message;case"[object RegExp]":case"[object String]":return e==a+"";case"[object Map]":var r=ud;case"[object Set]":var p=1&d;if(r||(r=_d),e.size!=a.size&&!p)return!1;var o=n.get(e);if(o)return o==a;d|=2,n.set(e,a);var l=md(r(e),r(a),d,i,s,n);return n.delete(e),l;case"[object Symbol]":if(cd)return cd.call(e)==cd.call(a)}return!1},yd=Object.prototype.hasOwnProperty;var vd=function(e,a,t,d,i,s){var n=1&t,r=ot(e),p=r.length;if(p!=ot(a).length&&!n)return!1;for(var o=p;o--;){var l=r[o];if(!(n?l in a:yd.call(a,l)))return!1}var m=s.get(e),u=s.get(a);if(m&&u)return m==a&&u==e;var _=!0;s.set(e,a),s.set(a,e);for(var h=n;++o<p;){var c=e[l=r[o]],f=a[l];if(d)var y=n?d(f,c,l,a,e,s):d(c,f,l,e,a,s);if(!(void 0===y?c===f||i(c,f,t,d,s):y)){_=!1;break}h||(h="constructor"==l)}if(_&&!h){var v=e.constructor,M=a.constructor;v==M||!("constructor"in e)||!("constructor"in a)||"function"==typeof v&&v instanceof v&&"function"==typeof M&&M instanceof M||(_=!1)}return s.delete(e),s.delete(a),_},Md=Object.prototype.hasOwnProperty;var gd=function(e,a,t,d,i,s){var n=Ya(e),r=Ya(a),p=n?"[object Array]":wt(e),o=r?"[object Array]":wt(a),l="[object Object]"==(p="[object Arguments]"==p?"[object Object]":p),m="[object Object]"==(o="[object Arguments]"==o?"[object Object]":o),u=p==o;if(u&&Object(Da.a)(e)){if(!Object(Da.a)(a))return!1;n=!0,l=!1}if(u&&!l)return s||(s=new oa),n||Ha(e)?md(e,a,t,d,i,s):fd(e,a,p,t,d,i,s);if(!(1&t)){var _=l&&Md.call(e,"__wrapped__"),h=m&&Md.call(a,"__wrapped__");if(_||h){var c=_?e.value():e,f=h?a.value():a;return s||(s=new oa),i(c,f,t,d,s)}}return!!u&&(s||(s=new oa),vd(e,a,t,d,i,s))};var wd=function e(a,t,d,i,s){return a===t||(null==a||null==t||!ya(a)&&!ya(t)?a!=a&&t!=t:gd(a,t,d,i,e,s))};var Ld=function(e,a){return wd(e,a)};class Yd{constructor(){this._registry={}}importRegistry(e){Object.assign(this._registry,e)}getChoices(e,a){const t=this._findChoices(e);if(null==t);else{if(null==a)return t;a(t)}}_findChoices(e){const a=this._registry[e.getOntologyUrl()];if(null!=a)for(let t=0;t<a.length;t++){const d=a[t];if(Ld(d.constraints,e.getConstraints())&&e.getParentProperty()===d.parentProperty&&e.getHierarchyProperty()===d.hierarchyProperty&&e.isParentPropertyInverted()===(d.isParentPropertyInverted||!1)&&e.isHierarchyPropertyInverted()===(d.isHierarchyPropertyInverted||!1))return d.choices}}_constructLoadUrl(e){const a=[];if(a.push("constr="+encodeURIComponent(JSON.stringify(e.getConstraints()))),null!=e.getParentProperty()){const t=!0===e.isParentPropertyInverted()?"ipp=":"pp=";a.push(t+encodeURIComponent(e.getParentProperty()))}if(null!=e.getHierarchyProperty()){const t=!0===e.isHierarchyPropertyInverted()?"ihp=":"hp=";a.push(t+encodeURIComponent(e.getHierarchyProperty()))}return`${e.getOntologyUrl()}?${a.join("&")}`}}let Dd=0;class bd{constructor({itemStore:e,source:a,path:t,readOnly:d=!1}){this._itemStore=e,this._source=a,this._path=t,this._readOnly=d,this._items=[],Dd+=1,this._id="_bundle_"+Dd,this._root=null,this._modified=!1}getInternalId(){return this._id}getSource(){return this._source}setRoot(e){return this._source.root=e,e}getRoot(){if(this._source.root)return this._itemStore.getItem(this._source.root)}getItemStore(){return this._itemStore}getPath(){return this._path}getItems(){return this._items}addItem(e){this._items.push(e)}removeItem(e){this._items.splice(this._items.indexOf(e),1)}isModified(){return this._modified}setModified(e){this._modified=e}isReadOnly(){return this._readOnly||null==this._path}}let Td=0;class kd{constructor({item:e,statement:a,graph:t,matchingCode:d}){this._item=e,this._statement=a,this._graph=t,this._ancestorValid=!0,this._cardinalityTracker=null,this._hash="b_"+Td,this._matchingCode=d||"correct",Td+=1}getGraph(){return this._graph||(this._statement?this._graph=this._statement.getGraph():this._parent&&(this._graph=this._parent.getGraph())),this._graph}isReadOnly(){if(!("_readOnly"in this)){const e=this.getParent();e&&e._readOnly?this._readyOnly=!0:this._readOnly=!(!this._statement||!this._statement.getNamedGraph())}return this._readOnly}remove(){}setSubject(e){}getValue(){}setValue(e,a){}getGist(){return Kt.extractGist(this.getValue(),this.getItem().getValueTemplate())}setGist(e,a){let t=e,d=this.getItem().getValueTemplate();d&&t.length>0&&(-1===d.indexOf("$1")&&(d+="$1"),t=d.replace("$1",t)),this.setValue(t,a)}getCardinalityTracker(){return this._cardinalityTracker}setCardinalityTracker(e){this._cardinalityTracker=e}getItem(){return this._item}getStatement(){return this._statement}getParent(){return this._parent}setParent(e){this._parent=e}isValid(){}getMatchingCode(){return this._matchingCode}setMatchingCode(e){this._matchingCode=e}setAncestorValid(e){this._ancestorValid=e,this.updateAssertions()}updateAssertions(){}getHash(){return this._hash}addListener(e){this._listeners||(this._listeners=[]),this._listeners.push(e)}removeListener(e){if(this._listeners){const a=this._listeners.indexOf(e);-1!==a&&this._listeners.splice(a,1)}}bindingChange(e){if(this._listeners)for(let a=0;a<this._listeners.length;a++)this._listeners[a](e);this._parent&&this._parent.bindingChange(e),this._cardinalityTracker&&this._cardinalityTracker.touch()}_isValidObjectValue(e){let a=e;if("string"!=typeof a&&null!==a)throw new Error("In a binding every object value need to be a string!");const t=this._item.getPattern();return t?(a=Kt.extractGist(a,this.getItem().getValueTemplate()),null!=a&&""!==a&&new RegExp(`^${t}$`).test(a)):null!=a&&""!==a}_isValidPredicateValue(e){if("string"!=typeof e&&null!==e)throw new Error("In a binding every predicate need to be a string!");return null!=e&&""!==e}}class Sd extends kd{constructor(e){super(e),this._validObject=!0,this._validPredicate=!0,this._excludeFromTreeValidityCheck=!1,this._statement&&(this._validPredicate=this._isValidPredicateValue(this._statement.getPredicate(),!0),this._validObject=this._isValidObjectValue(this._statement.getValue()))}getValue(){return this._statement.getValue()}setValue(e,a){const t="string"==typeof e?e.trim():e,d=this._validObject;this._isValidObjectValue(t)?(this._statement.setValue(t,a),this._validObject=!0,!0===d||!0!==this._validPredicate||this._excludeFromTreeValidityCheck||this._parent.oneChildValidityChanged(!0)):(""!==t&&null!==t||this._statement.setValue("",a),this._validObject=!1,!1!==d&&!0===this._validPredicate&&this._parent.oneChildValidityChanged(!1)),this.updateAssertions()}setSubject(e){this._statement.setSubject(e)}getPredicate(){return this._statement.getPredicate()}setPredicate(e){const a=this._validPredicate;this._isValidPredicateValue(e)?(this._statement.setPredicate(e),this._validPredicate=!0,!0!==a&&!0===this._validObject&&this._parent.oneChildValidityChanged(!0)):(this._validPredicate=!1,!1!==a&&!0===this._validObject&&this._parent.oneChildValidityChanged(!1)),this.updateAssertions()}getLanguage(){return this._statement.getLanguage()}setLanguage(e,a){this._statement.setLanguage(e,a),a||this.bindingChange(this)}getDatatype(){return this._statement.getDatatype()}setDatatype(e){this._statement.setDatatype(o(e)),this.updateAssertions()}setExcludeFromTreeValidityCheck(e){this._excludeFromTreeValidityCheck=e}remove(){this.setValue(null),this._parent.removeChildBinding(this),super.remove(arguments)}updateAssertions(){const e=this._ancestorValid&&this._validObject&&this._validPredicate;this._statement.setAsserted(e,!0),this.bindingChange(this)}isValid(){return this._validObject&&this._validPredicate&&!this._excludeFromTreeValidityCheck}}var jd={UNKNOWN:"unknown",OK:"correct",TOO_FEW_VALUES:"few",TOO_FEW_VALUES_MIN:"min",TOO_FEW_VALUES_PREF:"pref",TOO_MANY_VALUES:"many",AT_MOST_ONE_CHILD:"atmostonechild",AT_LEAST_ONE_CHILD:"atleastonechild",EXACTLY_ONE_CHILD:"exactlyonechild",WRONG_VALUE:"value",WRONG_PATTERN:"pattern",WRONG_NODETYPE:"nodetype",WRONG_DATATYPE:"datatype",MISSING_LANGUAGE:"language",MISSING_CONSTRAINTS:"constraints"};const Nd="http://www.w3.org/2000/01/rdf-schema#seeAlso";class xd extends Sd{constructor({choice:e,item:a,statement:t,matchingCode:d}){super({choice:e,item:a,statement:t,matchingCode:d}),this._choice=e,this._validPredicate=null!=a.getProperty()}static get seeAlso(){return Nd}setChoice(e,a){this._choice=e,null==e?this.setValue(null,null,a):this.getValue()!==e.value&&this.setValue(e.value,e,a),e&&e.mismatch?this.setMatchingCode(jd.WRONG_VALUE):e&&e.mismatch||this.getMatchingCode()!==jd.WRONG_VALUE||this.setMatchingCode(jd.OK)}getChoice(){return this._choice}setValue(e,a,t){const d=this.getValue();super.setValue(e,a,t);const i=this._statement.getGraph();if(i.findAndRemove(d,"http://www.w3.org/2000/01/rdf-schema#label",void 0,t),i.findAndRemove(d,Nd,void 0,t),null!=e&&null!=a&&(a.seeAlso&&a.inlineSeeAlso&&i.create(e,Nd,a.seeAlso,!0,t),!0===a.inlineLabel)){const d=a.label||{};Object.keys(d).forEach(a=>i.create(e,"http://www.w3.org/2000/01/rdf-schema#label",{value:d[a],lang:a,type:"literal"},!0,t))}}}class Od{constructor(e){this._listener=[],this._limits=e.getCardinality()||{},this._counter=0,this._depsOk=!0,this._listeners=[],this._code=0}addListener(e){return this._listeners.push(e),e}removeListener(e){this._listeners.splice(this._listeners.indexOf(e),1)}cardinalityChanged(){this._listeners.forEach(e=>e())}getCardinality(){return this._counter}isMax(){return null!=this._limits.max&&this._counter>=this._limits.max}isMin(){return null!=this._limits.min&&this._counter<=this._limits.min}isFine(){return this._fine}isDepsOk(){return this._depsOk}getCode(){return this._code}setCode(e){this._code!==e&&(this._code=e,this.cardinalityChanged())}setDepsOk(e){this._depsOk!==e&&(this._code=jd.UNKNOWN,this._depsOk=e,this.cardinalityChanged())}increment(){this._counter+=1,this._code=jd.UNKNOWN,this._checkCounter()}decrement(){this._counter-=1,this._code=jd.UNKNOWN,this._checkCounter()}getCounter(){return this._counter}checkCardinality(){this._checkCounter()}touch(){this._code=jd.UNKNOWN,this.cardinalityChanged()}_checkCounter(){null!=this._limits.max&&this._counter===this._limits.max?this._fine=!0:null!=this._limits.max&&this._counter>this._limits.max?this._fine=!1:null!=this._limits.min&&this._counter===this._limits.min?this._fine=!0:null!=this._limits.min&&this._counter<this._limits.min&&(this._fine=!1),this.cardinalityChanged()}}class Hd extends kd{constructor(e){super(e);const{constraints:a=[],childrenRootUri:t=null}=e;this._constraints=a,this._childBindings=this._item.getChildren().map(()=>[]),this._rootUri=t,this._validPredicate=!0,this._validObject=!0,this._statement&&(this._validPredicate=this._isValidPredicateValue(this._statement.getPredicate()),this._validObject=this._isValidObjectValue(this._statement.getValue(),this._statement.getType())),this._cachedChildBindings=null}getValue(){return this.getChildrenRootUri()}oneChildValidityChanged(e){return e!==this._oneValidChild&&(!(!e&&(delete this._oneValidChild,this.isValid()))&&(this._oneValidChild=e,this._notifyValidityChange(e&&this._validPredicate&&this._validObject),this._validPredicate&&this._validObject))}setSubject(e){this._statement?this._statement.setSubject(e):this.getChildBindings().forEach(a=>a.setSubject(e))}getChildrenRootUri(){return this._statement?this._statement.getValue():null!=this._rootUri?this._rootUri:null!=this._parent?this._parent.getChildrenRootUri():void 0}addChildBinding(e){this.addChildBindings([e])}addChildBindings(e){if(this._cachedChildBindings=null,!Array.isArray(e)||0===e.length)return;const a=e[0].getItem(),t=this._item.getChildren();for(let d=t.length;d>=0;d--)if(a===t[d]){const t=this._childBindings[d].length>0?this._childBindings[d][0].getCardinalityTracker():new Od(a);this._childBindings[d]=this._childBindings[d].concat(e),e.forEach(e=>{e.setParent(this),e.setCardinalityTracker(t),t.increment()},this);break}}removeChildBinding(e){this._cachedChildBindings=null;const a=this._item.getChildren();for(let t=a.length;t>=0;t--)if(e.getItem()===a[t]){this._childBindings[t].splice(this._childBindings[t].indexOf(e),1),delete e._parent,e.getCardinalityTracker().decrement();break}this.oneChildValidityChanged(),this.bindingChange(e)}getChildBindingsFor(e){const a=this._item.getChildren();for(let t=a.length;t>=0;t--)if(e===a[t])return this._childBindings[t]}getItemGroupedChildBindings(){return this._childBindings}getChildBindings(){return null==this._cachedChildBindings&&(this._childBindings&&this._childBindings.length>0?this._cachedChildBindings=[].concat(...this._childBindings):this._cachedChildBindings=[]),this._cachedChildBindings}setPredicate(e){const a=this._validPredicate;this._isValidPredicateValue(e)?(this._statement.setPredicate(e),this._validPredicate=!0,!0!==a&&this._validObject&&("URI"===this.getItem().getNodetype()||this._oneValidChild)&&this._notifyValidityChange(!0)):(this._validPredicate=!1,!1!==a&&this._validObject&&("URI"===this.getItem().getNodetype()||this._oneValidChild)&&this._notifyValidityChange(!1)),this.updateAssertions()}getValue(){return this._statement&&this._statement.isObjectBlank()?"":this._statement&&this._statement.getValue()}setValue(e){if("URI"!==this.getItem().getNodetype()||!this._statement)throw new Error("Cannot change the value of a group unless its nodetype is URI and also that it corresponds to a statement");const a=this._validObject;this._isValidObjectValue(e,"uri")?(this._validObject=!0,this._statement._o.type="uri",this._statement.setValue(e),this._constraints.forEach(a=>a.setSubject(e)),this.getChildBindings().forEach(a=>a.setSubject(e)),!a&&this._validPredicate&&this._notifyValidityChange(!0)):(this._validObject=!1,a&&this._validPredicate&&this._notifyValidityChange(!1))}getPredicate(){return this._statement?this._statement.getPredicate():void 0}remove(){this._oneValidChild=!1,this.setAncestorValid(!1),null!=this._parent&&this._parent.removeChildBinding(this),super.remove(arguments)}_isValid(){return"URI"===this.getItem().getNodetype()?this._validObject&&this._validPredicate:this._oneValidChild&&this._validPredicate&&this._validObject}isValid(){return null==this._oneValidChild&&(this._oneValidChild=this._forceOneValidChildCheck()),this._isValid()}setAncestorValid(e){this._ancestorValid=e,this.updateAssertions(),this._childBindings.forEach(a=>a.forEach(a=>a.setAncestorValid(e&&this._isValid()),this),this)}updateAssertions(){null==this._oneValidChild&&this.isValid();const e=this._ancestorValid&&this._isValid();null!=this._statement&&this._statement.setAsserted(e),this._constraints.forEach(a=>a.setAsserted(e)),this.getChildBindings().forEach(e=>e.updateAssertions())}_forceOneValidChildCheck(){return this._childBindings.some(e=>e.some(e=>e.isValid()))}_notifyValidityChange(e){this._parent&&this._parent.oneChildValidityChanged(e)||(this.updateAssertions(),this._childBindings.forEach(a=>a.forEach(a=>a.setAncestorValid(e))))}_isValidObjectValue(e,a){return("URI"!==this.getItem().getNodetype()||"uri"===a)&&super._isValidObjectValue(e)}}class Ed extends xd{constructor(e){super(e),this._objectBinding=e.objectBinding}remove(){}setValue(e){this._objectBinding.setPredicate(e)}getValue(){return this._objectBinding.getPredicate()}isValid(){return!1}updateAssertions(){}}class Pd extends Hd{constructor(e){super(e);const{statement:a,constraints:t}=e;this._statement=void 0,this._validPredicate=!0,this._constraints=[];const d=this._item.getChildren(),i=d[1];let s;s=i instanceof ed?new Hd({item:i,statement:a,constraints:t}):i instanceof id?new xd({item:i,statement:a}):new Sd({item:i,statement:a});const n=new Ed({item:d[0],objectBinding:s});this.addChildBinding(n),this.addChildBinding(s)}getPredicateBinding(){return this._childBindings[0][0]}getObjectBinding(){return this._childBindings[1][0]}getGraph(){return this.getObjectBinding().getGraph()}}class Ad extends Sd{getValue(){return this._parent.getValue()}setValue(e){return this._parent.setValue(e)}getGist(){return this._parent.getGist()}setGist(e,a){return this._parent.setGist(e,a)}setSubject(e){}getPredicate(){return this._parent.getPredicate()}remove(){this._parent.removeChildBinding(this),super.remove(arguments)}updateAssertions(){}isValid(){return!0}}let Vd,Cd,Fd,Rd,Id,Wd=!1;const Bd=(e,a,t)=>{const d=new Hd({item:t,childrenRootUri:a,graph:e});return Vd(d),Wd=!0,Vd(d),Wd=!1,Cd(d),d},zd=(e,a,t,d)=>{const i=e.findProperties(a),s=[],n={};if(null!=d){const e=a=>{null!=a.getProperty()?n[a.getProperty()]=!0:a instanceof ed&&a.getChildren().forEach(e)},a=a=>{null!=a&&(e(a),s.push(a))};d.forEach(e=>{let d=t.getItem(e);null!=d?d instanceof ed&&null==d.getProperty()?d.getChildren().forEach(a):a(d):(d=t.getItemByProperty(e),d?a(d):console.warn(`Warning, when autodetecting a template: Required item '${e}' is neither an id for a loaded item or a property for a loaded item, ignoring.`))})}return i.forEach(e=>{if(n[e])return;const a=t.getItemByProperty(e);null!=a&&s.push(a)},void 0),t.createTemplateFromChildren(s)},Ud=e=>Array.isArray(e.getDatatype())?e.getDatatype()[0]:e.getDatatype(),Jd=(e,a,t)=>a instanceof td?((e,a)=>{if(!a.getProperty()){const t=new Ad({item:a,statement:null,matchingCode:jd.OK});return e.addChildBinding(t),t}const t=e.getGraph(),d=a.getNodetype(),i={value:"",type:"literal"};"URI"===d?i.type="uri":"DATATYPE_LITERAL"===d&&(i.datatype=Ud(a));const s=a.getValue();if(null!=s&&0===e.getChildBindingsFor(a).length){i.value=s;const e=a.getLanguage();null!=e&&(i.lang=e)}const n=t.create(e.getChildrenRootUri(),a.getProperty(),i,!1),r=new Sd({item:a,statement:n});return e.addChildBinding(r),r})(e,a):a instanceof ad?((e,a)=>{let t,d;const i=a.getChildren()[1],s=e.getGraph();i instanceof ed?(t=s.create(e.getChildrenRootUri(),"",null,!1),d=Id(s,t.getSubject(),i)):t=i instanceof id?s.create(e.getChildrenRootUri(),"",{type:"uri",value:""},!1):s.create(e.getChildrenRootUri(),"",{type:"literal",value:""},!1);const n=new Pd({item:a,statement:t,constraints:d});return e.addChildBinding(n),i instanceof ed&&i.getChildren().forEach(e=>{Jd(n.getObjectBinding(),e)}),n})(e,a):a instanceof ed?((e,a,t)=>{let d,i;if(void 0!==a.getProperty()){const t=e.getGraph();d=(a.getNodetype(),t.create(e.getChildrenRootUri(),a.getProperty(),null,!1)),i=Id(t,d.getValue(),a)}const s=new Hd({item:a,statement:d,constraints:i});e.addChildBinding(s);const n=a._source["@id"];if(n){if(t[n])return s;t[n]=!0}return s})(e,a,t||{}):a instanceof id?((e,a)=>{const t=e.getGraph(),d=a.getNodetype(),i={type:"literal",value:""};"DATATYPE_LITERAL"===d?i.datatype=Ud(a):"RESOURCE"!==d&&"URI"!==d||(i.type="uri");const s=t.create(e.getChildrenRootUri(),a.getProperty(),i,!1),n=new xd({item:a,statement:s});e.addChildBinding(n);const r=a.getValue(),p=n.getCardinalityTracker();return null!=r&&1===p.getCounter()&&n.setChoice(Zd(a,r,t),!0),n})(e,a):void 0;let Gd,$d,qd,Kd,Zd,Xd;Vd=e=>{Wd&&e.getChildBindings().forEach(e=>{"group"===e.getItem().getType()&&Vd(e)}),e.getItem().getChildren().forEach(a=>{Wd?void 0!==a.getProperty()&&Gd(e,a):Gd(e,a)})};Gd=(e,a)=>{a instanceof id?((e,a)=>{if(null==a.getProperty())return;const t=[];e.getGraph().find(e.getChildrenRootUri(),a.getProperty()).forEach(e=>{if(Fd(e)){const d=$d(a,e),i=qd(a,e),s=Kd(a,e);if(d&&i&&s||Wd){const n=Zd(a,e.getValue(),e.getGraph());if(void 0!==n){Rd(e);let r=d?jd.OK:jd.WRONG_NODETYPE;i?s?n.mismatch&&(r=jd.WRONG_VALUE):r=jd.WRONG_PATTERN:r=jd.WRONG_DATATYPE,t.push(new xd({item:a,statement:e,choice:n,matchingCode:r}))}}}}),t.length>0&&e.addChildBindings(t)})(e,a):a instanceof ad?((e,a)=>{const t=a.getPropertyItem(),d=a.getObjectItem(),i=e.getGraph();let s,n,r,p;const o=[];i.find(e.getChildrenRootUri()).forEach(e=>{Fd(e)&&$d(d,e)&&Kd(d,e)&&(r=Zd(t,e.getPredicate(),e.getGraph()),void 0!==r&&(n=null,d instanceof ed?(s=Xd(i,e.getValue(),d),void 0!==s&&(Rd(e),n=new Pd({item:a,statement:e,constraints:s}),Vd(n.getObjectBinding()))):d instanceof id?(p=Zd(d,e.getValue(),e.getGraph()),void 0!==p&&(Rd(e),n=new Pd({item:a,statement:e}),n.getObjectBinding().setChoice(p))):(Rd(e),n=new Pd({item:a,statement:e})),null!==n&&(n.getPredicateBinding().setChoice(r),o.push(n))))}),o.length>0&&e.addChildBindings(o)})(e,a):a instanceof ed?((e,a)=>{let t,d,i,s;const n=e.getGraph();void 0!==a.getProperty()?(t=n.find(e.getChildrenRootUri(),a.getProperty()),t.length>0&&(d=[],t.forEach(e=>{if(Fd(e)){const t=Kd(a,e),r=$d(a,e);if((t&&r||Wd)&&(i=Xd(n,e.getValue(),a),void 0!==i||Wd)){let n=r?jd.OK:jd.WRONG_NODETYPE;t?void 0===i&&(n=jd.MISSING_CONSTRAINTS):n=jd.WRONG_PATTERN,Rd(e),s=new Hd({item:a,statement:e,constraints:i,matchingCode:n}),d.push(s),n===jd.OK&&Vd(s)}}}),e.addChildBindings(d))):(s=new Hd({item:a}),e.addChildBindings([s]),Vd(s))})(e,a):a instanceof td&&((e,a)=>{const t=[];null==a.getProperty()?t.push(new Ad({item:a,statement:null,matchingCode:jd.OK})):e.getGraph().find(e.getChildrenRootUri(),a.getProperty()).forEach(e=>{if(Fd(e)&&Kd(a,e)){const d=$d(a,e),i=qd(a,e);if(d&&(i||a.hasStyle("relaxedDatatypeMatch"))||Wd){Rd(e);let s=d?jd.OK:jd.WRONG_NODETYPE;i||(s=jd.WRONG_DATATYPE),t.push(new Sd({item:a,statement:e,matchingCode:s}))}}}),t.length>0&&e.addChildBindings(t)})(e,a)},$d=(e,a)=>{const t=a.getType();switch(e.getNodetype()){case"LITERAL":case"ONLY_LITERAL":case"PLAIN_LITERAL":case"LANGUAGE_LITERAL":case"DATATYPE_LITERAL":return"literal"===t;case"RESOURCE":return"uri"===t||"bnode"===t;case"URI":return"uri"===t;case"BLANK":return"bnode"===t}return!1},qd=(e,a)=>{const t="DATATYPE_LITERAL"===e.getNodetype()&&e.getDatatype()||null;return null==t||(Array.isArray(t)?-1!==t.indexOf(a.getDatatype()):a.getDatatype()===t)},Kd=(e,a)=>{const t=e.getPattern(),d=Kt.extractGist(a.getValue(),e.getValueTemplate());if(void 0!==t)try{return new RegExp(`^${t}$`).test(d)}catch(e){return!0}return!0},Xd=(e,a,t)=>{let d;const i=t.getConstraints(),s=[],n=(t,i)=>{if(d=e.find(a,t,{type:"uri",value:i}),1!==d.length)return!1;s.push(d[0])};if("object"==typeof i&&null!==i){const e=Object.keys(i);for(let a=0;a<e.length;a++){const t=e[a],d=i[t];if(d instanceof Array){let e=!0;if(d.forEach(a=>{!1!==n(t,a)&&(e=!1)}),e)return}else if(!1===n(t,d))return}return s}return[]},Id=(e,a,t)=>{const d=[],i=t.getConstraints();return"object"==typeof i&&null!==i&&Object.keys(i).forEach(t=>{const s=i[t];Array.isArray(s)?d.push(e.create(a,t,{type:"uri",value:s[0]},!1)):d.push(e.create(a,t,{type:"uri",value:s},!1))}),d},Zd=(e,a,t)=>{let d,i;if(e.hasChoices()){for(i=e.getChoices(),d=0;d<i.length;d++)if(i[d].value===a)return i[d];if(!e.hasStyle("strictmatch")||Wd)return{value:a,label:{"":a},mismatch:!0}}else{let d=Kt.getLocalizedMap(t,a,e.getLabelProperties());null==d&&Wd&&(d={"":a,mismatch:!0});const i=t.findFirstValue(a,xd.seeAlso);if(null!=d){const e={label:d,value:a};return i&&(e.seeAlso=i),e}if(null!=Gt.getChoice)return Gt.getChoice(e,a,i,t)}},Rd=e=>{e._dibbs=!0},Fd=e=>!0!==e._dibbs,Cd=e=>{let a,t,d;const i=e.getItemGroupedChildBindings()||[];for(a=0;a<i.length;a++)for(d=i[a],t=0;t<d.length;t++){const e=d[t];e._statement&&delete e._statement._dibbs,(e instanceof Hd||e instanceof Pd)&&Cd(e)}};const Qd=(e,a)=>{if(e instanceof Sd)return e;const t=e.getItemGroupedChildBindings(),d=X.a.locale();for(let i=0;i<t.length;i++){const s=t[i],n=e.getItem().getChildren()[i];if(0!==s.length){if(!(n instanceof td))return Qd(s[0]);if("LANGUAGE_LITERAL"===n.getNodetype()){const e={firstValue:s[0]};for(let a=0;a<s.length;a++){const t=s[a].getLanguage();null==t?e.emptyLanguageValue=s[a]:t===d?e.perfectLocaleLanguageValue=s[a]:t.substring(0,1)===d.substring(0,1)?e.localeLanguageValue=s[a]:-1!==t.indexOf("en")?e.defaultLanguageValue=s[a]:e.anyLanguageValue=s[a]}return e.perfectLocaleLanguageValue||e.localeLanguageValue||e.defaultLanguageValue||e.anyLanguageValue||e.firstValue}return s[0]}if(a){const a=Jd(e,n,{});return a instanceof Sd?(a.setLanguage(d),a):Qd(a,!0)}}},ei=(e,a)=>{const t="/"===a[0]?a.slice(1):a,d=e.getItemGroupedChildBindings(),i=t[0];for(let e=0;e<d.length;e++){const a=d[e];let s;for(let e=0;e<a.length;e++){let d=a[e],n=d.getItem();if(n instanceof id&&void 0===n.getProperty()&&i===n.getId()&&2===t.length&&t[1]===d.getValue())return d;if(d.isValid()){if("propertygroup"===n.getType())d=d.getObjectBinding(),n=d.getItem();else if(void 0===n.getProperty()&&(s=ei(d,t),s))return s;if("*"===i||i===d.getPredicate())if("group"===n.getType()){if(s=ei(d,t.slice(1)),s)return s}else if(1===t.length||"*"===t[1]||t[1]===d.getValue())return d}}}},ai=(e,a)=>{const t=a[0];let d=e;if("/"===t){for(;d.getParent();)d=d.getParent();return d}if(".."===t){for(let e=0;e<a.length;e++){if(".."!==a[e]||!d.getParent())return d;d=d.getParent()}return d}return e},ti=(e,a,t)=>{const d=a.getCardinality();return t&&"group"===a.getType()||(null!=d?d.min>0?e.mandatory+=1:d.pref>0?e.recommended+=1:e.optional+=1:e.optional+=1),"group"===a.getType()&&a.getChildren().forEach(a=>ti(e,a)),e};var di={detectLevel:e=>{if(e.mandatory>0){if(0===e.recommended&&0===e.optional)return"mandatory";if(0===e.optional)return"mixed_mandatory_recommended";if(0===e.recommended)return"mixed_mandatory_optional"}else{if(e.recommended>0)return 0===e.optional?"recommended":"mixed_recommended_optional";if(0===e.recommended&&e.recommended>0&&0===e.optional)return"optional"}return"mixed_all"},levelProfile:e=>{const a=ti({mandatory:0,recommended:0,optional:0},e,!0);return a.itemCount=a.mandatory+a.recommended+a.optional,a},findFirstValueBinding:Qd,create:Jd,constructTemplate:zd,findPopularChoice:(e,a)=>{const t=e.getId(),d={},i={};e.getChoices().forEach(e=>{d[e.value]=0,i[e.value]=e});a.getChildBindings().forEach(e=>{const a=e.getItem().getDeps();if(a&&(a[0]===t||"/"===a[0]&&a[1]===t)){const e="/"===a[0]?a[2]:a[1],t=d[e];void 0!==t&&(d[e]=t+1)}});let s,n=0;return Object.keys(d).forEach(e=>{(!s||d[e]>n)&&(s=e,n=d[e])}),i[s]},match:(e,a,t)=>{const d=new Hd({item:t,childrenRootUri:a,graph:e});return Vd(d),Cd(d),d},fuzzyMatch:Bd,matchPathBelowBinding:ei,findBindingRelativeToParentBinding:ai,CODES:jd};class ii{constructor(e){this.automaticSortAllowed=!0,this.ignoreMissingItems=!0,this._bundles=[],this._registry={},this._registryByProperty={},this._ontologyStore=e||new Yd}getTemplate(e){return this.getItem(e)}getChildren(e,a){if(null==e)return[];const t=e.getSource(!0),d=t.content||t.items||[];if(a)return this._createItems(d,e._forceChildrenClones,e.getBundle());const i=this.getItem(t.extends);return i?i.getChildren().concat(e.getChildren(!0)):e.getChildren(!0)}getItem(e){if(null!=e)return this._registry[e]}getItems(){return Object.keys(this._registry).map(e=>this._registry[e])}renameItem(e,a){if(this._registry[a])throw new Error(`Cannot rename to ${a} since an item with that id already exists.`);if(""===a||null===a)throw new Error("Cannot give an item an empty string or null as id.");const t=this._registry[e];t&&(delete this._registry[e],this._registry[a]=t,t.setId(a));const d=t=>{const i=t.content;if(i)for(let t=0;t<i.length;t++){const s=i[t];s.id!==e&&s["@id"]!==e||(s.id=a,delete s["@id"]),s.content&&d(s)}},i=this.getItems();for(let e=0;e<i.length;e++){const a=i[e];a instanceof ed&&d(a._source)}}getItemIds(){return Object.keys(this._registry)}getItemByProperty(e){return this._registryByProperty[e]}detectTemplate(e,a,t){return zd(e,a,this,t)}registerBundle(e){e.itemStore=this;const a=new bd(e);this._bundles.push(a),e.source&&e.source.namespaces&&l(e.source.namespaces);const t=e.source.templates||e.source.auxilliary;return t instanceof Array&&this._createItems(t,!1,a),"object"==typeof e.source.cachedChoices&&this._ontologyStore.importRegistry(e.source.cachedChoices),a}getBundles(){return this._bundles}createTemplate(e){return this.registerBundle({source:e}).getRoot()}createTemplateFromChildren(e){const a=(e||[]).map(e=>"string"==typeof e?this.getItem(e):e);return new ed({source:{},children:a,itemStore:this})}setPriorities(e){this.priorities=e}createExtendedSource(e,a){const t=Object.assign(Object.assign({},e),a);return t._extendedSource=a,t.extends=null,delete t.children,t}createItem(e,a,t,d){let i;const s=e.id||e["@id"],n=e.type||e["@type"];if(e.extends){const a=this._registry[e.extends];if(null==a&&!this.ignoreMissingItems)throw new Error("Cannot find item to extend with id: "+e.extends);if(a){const t=this.createExtendedSource(a.getSource(),e);return this.createItem(t,!1,!1,d)}}if(null!=n){switch(n){case"text":i=new td({source:e,itemStore:this,bundle:d});break;case"choice":i=new id({source:e,itemStore:this,ontologyStore:this._ontologyStore,bundle:d});break;case"group":i=new ed({source:e,children:null,itemStore:this,bundle:d});break;case"propertygroup":i=new ad({source:e,children:null,itemStore:this,bundle:d})}return!0!==t&&(null!=e.property&&(this._registryByProperty[e.property]=i,this.priorities&&null!=this.priorities[e.property]&&(i.priority=this.priorities[e.property])),null!=s&&null==this._registry[s]&&(this._registry[s]=i,null!=d&&d.addItem(i))),i}if(null==s)throw new Error("Cannot create subitem, `type` for creating new or `id` for referencing external are required.");if(null==this._registry[s])throw new Error("Cannot find referenced subitem using identifier: "+s);if(!0===a||Object.keys(e).find(e=>"id"!==e&&"@id"!==e)){const a=Object.assign(Object.assign({},this._registry[s]._source),e);return this.createItem(a,!1,!0)}return this._registry[s]}removeItem(e,a){const t=e.getBundle();null!=t&&t.removeItem(e),null!=e.getId()&&delete this._registry[e.getId()];const d=e.getProperty();null!=d&&this._registryByProperty[d]===e&&delete this._registryByProperty[d]}_createItems(e,a,t){return e.map((d,i)=>{const s="string"==typeof d?e[i]={id:d}:d;return this.createItem(s,a,!1,t)})}}const si=(e,a,t)=>{const d=`Fetching template bundle ${t} failed.`;if(e===a-1)throw Error(d+" Cannot recover from this, please fix.");console.log(d+" Will try to fetch from a fallback option.")},ni=e=>e.map(e=>e instanceof Array?(async e=>{const a=e.length;let t,d;for(let i=0;i<a;i++){try{t=await fetch(e[i])}catch(a){throw Error("A network error ocurred while trying to fetch bundle "+e[i])}if(t&&t.ok)try{const a=t.headers.has("content-type")&&t.headers.get("content-type");if(a&&a.includes("application/json")){d=await t.json();break}throw new Error(`Failed fetching template ${e[i]}. Expected a JSON file and got ${a}`)}catch(t){si(i,a,e[i])}else si(i,a,e[i])}return d})(e):Promise.resolve(e));var ri=async(e,a=[],t=(()=>{}))=>{0===a.length&&t&&t([]);const d=ni(a),i=((e,a=[])=>a.map(a=>e.registerBundle({source:a})))(e,await Promise.all(d));return t(i),i};const pi=(e,a)=>{let t=a;return null==t?t={errors:[],warnings:[],deprecated:[]}:(t.errors=t.errors||[],t.warnings=t.warnings||[],t.deprecated=t.deprecated||[]),ui(e,t,!0)},oi=e=>{let a=0;for(let t=0;t<e.length;t++)e[t].isValid()&&(a+=1);return a},li=(e,a)=>{if(e.length>0){e[0].getCardinalityTracker().setCode(a)}},mi=(e,a)=>{if(a.hasStyle("deprecated"))return!0;const t=a.getDeps();if(t){const a=ai(e,t);if(!ei(a,t))return!0}return!1},ui=(e,a,t)=>{if(e.getMatchingCode()!==jd.OK)return;const d=e.getItem();if(!0===t||e.isValid()||null==d.getProperty()||d.hasStyle("atLeastOneChild")||d.hasStyle("exactlyOneChild")){const t=d.getChildren();if(d.hasStyle("disjoint")||d.hasStyle("atMostOneChild")||d.hasStyle("atLeastOneChild")||d.hasStyle("exactlyOneChild")){const i=e.getChildBindings(),s=oi(i);let n;s>1&&(d.hasStyle("disjoint")||d.hasStyle("atMostOneChild"))?n=jd.AT_MOST_ONE_CHILD:1!==s&&d.hasStyle("exactlyOneChild")?n=jd.EXACTLY_ONE_CHILD:0===s&&d.hasStyle("atLeastOneChild")&&(n=jd.AT_LEAST_ONE_CHILD),n&&(li([e],n),t.length>0&&a.errors.push({parentBinding:e,item:t[0],code:n}))}else e.getItemGroupedChildBindings().forEach((d,i)=>{const s=t[i];if(!mi(e,s)&&null!=s.getProperty()){const t=oi(d),i=s.getCardinality();null!=i.min&&i.min>t?(a.errors.push({parentBinding:e,item:s,code:jd.TOO_FEW_VALUES_MIN}),li(d,jd.TOO_FEW_VALUES_MIN)):null!=i.pref&&i.pref>t&&a.warnings.push({parentBinding:e,item:s,code:jd.TOO_FEW_VALUES_PREF}),null!=i.max&&i.max<t&&(a.errors.push({parentBinding:e,item:s,code:jd.TOO_MANY_VALUES}),li(d,jd.TOO_MANY_VALUES))}},void 0);e.getChildBindings().forEach(t=>{const d=t.getItem();t.getMatchingCode()!==jd.OK&&a.errors.push({parentBinding:t,item:d,code:t.getMatchingCode()}),d.hasStyle("deprecated")&&a.deprecated.push(t),mi(e,d)||"group"===d.getType()&&ui(t,a)})}return a},_i=(e,a)=>e.find(null,"rdf:type",a).map(e=>e.getSubject()),hi=(e,a,t)=>{let d=e;for(;;){const e=d.getChildrenRootUri?d.getChildrenRootUri():d.getParent().getChildrenRootUri();if(e===a)return!0;if(t[e])return!1;d=d.getParent()}},ci=(e,a)=>{let t=e;const d=[];for(null!=a.getProperty()&&t.getItem()!==a&&d.push(p(a.getProperty()));null!=t.getItem().getProperty()&&d.push(p(t.getItem().getProperty())),null!=t.getParent();)t=t.getParent();return d.reverse(),d.join(" > ")},fi=e=>{const{errors:a,warnings:t,deprecated:d}=e;e.errors=a.map(e=>({path:ci(e.parentBinding,e.item),code:e.code})),e.warnings=t.map(e=>({path:ci(e.parentBinding,e.item),code:e.code})),e.deprecated=d.map(e=>(e=>`${ci(e.getParent(),e.getItem())} > ${e.getValue()}`)(e))},yi=(e,a,t,d)=>{const i=Bd(a,e,t),s=pi(i);return((e,a,t)=>{const{errors:d,warnings:i,deprecated:s}=e;e.errors=d.filter(e=>hi(e.parentBinding,a,t)),e.warnings=i.filter(e=>hi(e.parentBinding,a,t)),e.deprecated=s.filter(e=>hi(e,a,t))})(s,e,d||{}),fi(s),s};var vi={graphReport:(e,a,t=[])=>{const d={},i={};let s,n;const r={errors:0,warnings:0,deprecated:0,resources:[]};Object.keys(a).forEach(a=>{const t=_i(e,a);d[a]=t,t.forEach(e=>{i[e]=!0})}),Object.keys(d).forEach(t=>{s=a[t],d[t].forEach(a=>{n=yi(a,e,s,i),n.uri=a,n.type=t,n.template=s.getId(),r.resources.push(n),r.errors+=n.errors.length,r.warnings+=n.warnings.length,r.deprecated+=n.deprecated.length})});const p=[];return t.forEach(e=>{0===d[e].length&&p.push(e)}),p.length>0&&(r.mandatoryError=p,r.errors+=p.length),r},bindingReport:pi};global.fetch=t(157).default}]);