solid-ui 2.4.26 → 2.4.27-2fde6df4

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.
@@ -0,0 +1,3 @@
1
+ /*! For license information please see solid-ui.min.js.LICENSE.txt */
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["solid-ui"]=t():e["solid-ui"]=t()}(self,(()=>(()=>{var e={3319:(e,t,n)=>{"use strict";var r=n(4836),i=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.AccessController=void 0;var o=r(n(4687)),a=r(n(7156)),s=r(n(6690)),c=r(n(9728)),u=r(n(8416)),l=n(3422),d=n(6022),p=n(5678),f=n(3723),h=v(n(5666)),m=v(n(4433));function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(g=function(e){return e?n:t})(e)}function v(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var n=g(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}var y=function(){function e(t,n,r,i,o,a,c,d,f,h,m,g,v){if((0,s.default)(this,e),this.subject=t,this.noun=n,this.context=r,this.statusElement=i,this.classes=o,this.targetIsProtected=a,this.targetDoc=c,this.targetACLDoc=d,this.defaultHolder=f,this.defaultACLDoc=h,this.prospectiveDefaultHolder=m,this.store=g,this.dom=v,(0,u.default)(this,"mainCombo",void 0),(0,u.default)(this,"defaultsCombo",void 0),(0,u.default)(this,"isContainer",void 0),(0,u.default)(this,"defaultsDiffer",void 0),(0,u.default)(this,"rootElement",void 0),(0,u.default)(this,"isUsingDefaults",void 0),this.rootElement=v.createElement("div"),this.rootElement.classList.add(o.aclGroupContent),this.isContainer="/"===c.uri.slice(-1),f&&h){this.isUsingDefaults=!0;var y=(0,l.adoptACLDefault)(this.targetDoc,d,f,h);this.mainCombo=new p.AccessGroups(c,d,this,y,{defaults:this.isContainer}),this.defaultsCombo=null,this.defaultsDiffer=!1}else this.isUsingDefaults=!1,this.mainCombo=new p.AccessGroups(c,d,this,g),this.defaultsCombo=new p.AccessGroups(c,d,this,g,{defaults:this.isContainer}),this.defaultsDiffer=!(0,l.sameACL)(this.mainCombo.aclMap,this.defaultsCombo.aclMap)}var t,n,r,i;return(0,c.default)(e,[{key:"isEditable",get:function(){return!this.isUsingDefaults}},{key:"render",value:function(){if(this.rootElement.innerHTML="",this.isUsingDefaults){if(this.renderStatus("The sharing for this ".concat(this.noun," is the default for folder ")),this.defaultHolder){var e=this.statusElement.appendChild(this.dom.createElement("a"));e.href=this.defaultHolder.uri,e.innerText=(0,f.shortNameForFolder)(this.defaultHolder)}}else!this.defaultsDiffer&&this.isContainer?this.renderStatus("This is also the default for things in this folder."):this.renderStatus("");return this.rootElement.appendChild(this.mainCombo.render()),this.defaultsCombo&&this.defaultsDiffer?(this.rootElement.appendChild(this.renderRemoveDefaultsController()),this.rootElement.appendChild(this.defaultsCombo.render())):this.isEditable&&this.isContainer&&this.rootElement.appendChild(this.renderAddDefaultsController()),!this.targetIsProtected&&this.isUsingDefaults?this.rootElement.appendChild(this.renderAddAclsController()):this.targetIsProtected||this.rootElement.appendChild(this.renderRemoveAclsController()),this.rootElement}},{key:"renderRemoveAclsController",value:function(){var e=this,t=this.dom.createElement("button");return t.innerText="Remove custom sharing settings for this ".concat(this.noun," -- just use default").concat(this.prospectiveDefaultHolder?" for ".concat(h.label(this.prospectiveDefaultHolder)):""),t.classList.add(this.classes.bigButton),t.addEventListener("click",(function(){return e.removeAcls().then((function(){return e.render()})).catch((function(t){return e.renderStatus(t)}))})),t}},{key:"renderAddAclsController",value:function(){var e=this,t=this.dom.createElement("button");return t.innerText="Set specific sharing for this ".concat(this.noun),t.classList.add(this.classes.bigButton),t.addEventListener("click",(function(){return e.addAcls().then((function(){return e.render()})).catch((function(t){return e.renderStatus(t)}))})),t}},{key:"renderAddDefaultsController",value:function(){var e=this,t=this.dom.createElement("div");t.classList.add(this.classes.defaultsController);var n=t.appendChild(this.dom.createElement("div"));n.innerText="Sharing for things within the folder currently tracks sharing for the folder.",n.classList.add(this.classes.defaultsControllerNotice);var r=t.appendChild(this.dom.createElement("button"));return r.innerText="Set the sharing of folder contents separately from the sharing for the folder",r.classList.add(this.classes.bigButton),r.addEventListener("click",(function(){return e.addDefaults().then((function(){return e.render()}))})),t}},{key:"renderRemoveDefaultsController",value:function(){var e=this,t=this.dom.createElement("div");t.classList.add(this.classes.defaultsController);var n=t.appendChild(this.dom.createElement("div"));n.innerText="Access to things within this folder:",n.classList.add(this.classes.defaultsControllerNotice);var r=t.appendChild(this.dom.createElement("button"));return r.innerText="Set default for folder contents to just track the sharing for the folder",r.classList.add(this.classes.bigButton),r.addEventListener("click",(function(){return e.removeDefaults().then((function(){return e.render()})).catch((function(t){return e.renderStatus(t)}))})),t}},{key:"renderTemporaryStatus",value:function(e){var t=this;this.statusElement.classList.add(this.classes.aclControlBoxStatusRevealed),this.statusElement.innerText=e,this.statusElement.classList.add(this.classes.temporaryStatusInit),setTimeout((function(){t.statusElement.classList.add(t.classes.temporaryStatusEnd)})),setTimeout((function(){t.statusElement.innerText=""}),5e3)}},{key:"renderStatus",value:function(e){this.statusElement.classList.toggle(this.classes.aclControlBoxStatusRevealed,!!e),this.statusElement.innerText=e}},{key:"addAcls",value:(i=(0,a.default)(o.default.mark((function e(){var t,n,r=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.defaultHolder&&this.defaultACLDoc){e.next=4;break}return t="Unable to find defaults to copy",m.error(t),e.abrupt("return",Promise.reject(t));case 4:return(0,l.adoptACLDefault)(this.targetDoc,this.targetACLDoc,this.defaultHolder,this.defaultACLDoc).statements.forEach((function(e){return r.store.add(e.subject,e.predicate,e.object,r.targetACLDoc)})),e.prev=6,e.next=9,this.store.fetcher.putBack(this.targetACLDoc);case 9:return this.isUsingDefaults=!1,e.abrupt("return",Promise.resolve());case 13:return e.prev=13,e.t0=e.catch(6),n=" Error writing back access control file! ".concat(e.t0),m.error(n),e.abrupt("return",Promise.reject(n));case 18:case"end":return e.stop()}}),e,this,[[6,13]])}))),function(){return i.apply(this,arguments)})},{key:"addDefaults",value:(r=(0,a.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.defaultsCombo=new p.AccessGroups(this.targetDoc,this.targetACLDoc,this,this.store,{defaults:!0}),this.defaultsDiffer=!0;case 2:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"removeAcls",value:(n=(0,a.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.store.fetcher.delete(this.targetACLDoc.uri,{});case 3:return this.isUsingDefaults=!0,e.prev=4,e.next=7,(0,l.getProspectiveHolder)(this.targetDoc.uri);case 7:this.prospectiveDefaultHolder=e.sent,e.next=13;break;case 10:e.prev=10,e.t0=e.catch(4),m.warn(e.t0);case 13:e.next=20;break;case 15:return e.prev=15,e.t1=e.catch(0),t="Error deleting access control file: ".concat(this.targetACLDoc,": ").concat(e.t1),m.error(t),e.abrupt("return",Promise.reject(t));case 20:case"end":return e.stop()}}),e,this,[[0,15],[4,10]])}))),function(){return n.apply(this,arguments)})},{key:"removeDefaults",value:(t=(0,a.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.defaultsCombo,e.prev=1,this.defaultsCombo=null,this.defaultsDiffer=!1,e.next=6,this.save();case 6:e.next=14;break;case 8:return e.prev=8,e.t0=e.catch(1),this.defaultsCombo=t,this.defaultsDiffer=!0,m.error(e.t0),e.abrupt("return",Promise.reject(e.t0));case 14:case"end":return e.stop()}}),e,this,[[1,8]])}))),function(){return t.apply(this,arguments)})},{key:"save",value:function(){var e=this,t=(0,d.graph)();this.isContainer?this.defaultsCombo&&this.defaultsDiffer?((0,l.makeACLGraphbyCombo)(t,this.targetDoc,this.mainCombo.byCombo,this.targetACLDoc,!0),(0,l.makeACLGraphbyCombo)(t,this.targetDoc,this.defaultsCombo.byCombo,this.targetACLDoc,!1,!0)):(0,l.makeACLGraphbyCombo)(t,this.targetDoc,this.mainCombo.byCombo,this.targetACLDoc,!0,!0):(0,l.makeACLGraphbyCombo)(t,this.targetDoc,this.mainCombo.byCombo,this.targetACLDoc,!0),t.fetcher=(0,d.fetcher)(t,{fetch:this.store.fetcher._fetch});var n=t.updater||new d.UpdateManager(t);return new Promise((function(r,i){n.put(e.targetACLDoc,t.statementsMatching(void 0,void 0,void 0,e.targetACLDoc),"text/turtle",(function(n,o,a){if(!o)return i(new Error("ACL file save failed: ".concat(a)));e.store.fetcher.unload(e.targetACLDoc),e.store.add(t.statements),e.store.fetcher.requested[e.targetACLDoc.uri]="done",e.mainCombo.store=e.store,e.defaultsCombo&&(e.defaultsCombo.store=e.store),e.defaultsDiffer=!!e.defaultsCombo&&!(0,l.sameACL)(e.mainCombo.aclMap,e.defaultsCombo.aclMap),m.log("ACL modification: success!"),r()}))}))}}]),e}();t.AccessController=y},5678:(e,t,n)=>{"use strict";var r=n(4836),i=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.AccessGroups=void 0;var o=r(n(4687)),a=r(n(7156)),s=r(n(7424)),c=r(n(6690)),u=r(n(9728)),l=r(n(8416)),d=n(6022),p=n(3422),f=y(n(2457)),h=y(n(6590)),m=n(1349),g=y(n(4433));function v(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(v=function(e){return e?n:t})(e)}function y(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var n=v(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}var b=h.acl,w={13:"Owners",9:"Owners (write locked)",5:"Editors",3:"Posters",2:"Submitters",1:"Viewers"},x={13:!0,5:!0,3:!0,2:!0,1:!0},_={13:"can read, write, and control sharing.",9:"can read and control sharing, currently write-locked.",5:"can read and change information",3:"can add new information, and read but not change existing information",2:"can add new information but not read any",1:"can read but not change information"},E=function(){function e(t,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};(0,c.default)(this,e),this.doc=t,this.aclDoc=n,this.controller=r,this.options=o,(0,l.default)(this,"defaults",void 0),(0,l.default)(this,"byCombo",void 0),(0,l.default)(this,"aclMap",void 0),(0,l.default)(this,"addAgentButton",void 0),(0,l.default)(this,"rootElement",void 0),(0,l.default)(this,"_store",void 0),this.defaults=o.defaults||!1,this._store=i,this.aclMap=(0,p.readACL)(t,n,i,this.defaults),this.byCombo=(0,p.ACLbyCombination)(this.aclMap),this.addAgentButton=new m.AddAgentButtons(this),this.rootElement=this.controller.dom.createElement("div"),this.rootElement.classList.add(this.controller.classes.accessGroupList)}var t,n,r,i;return(0,u.default)(e,[{key:"store",get:function(){return this._store},set:function(e){this._store=e,this.aclMap=(0,p.readACL)(this.doc,this.aclDoc,e,this.defaults),this.byCombo=(0,p.ACLbyCombination)(this.aclMap)}},{key:"render",value:function(){var e=this;return this.rootElement.innerHTML="",this.renderGroups().forEach((function(t){return e.rootElement.appendChild(t)})),this.controller.isEditable&&this.rootElement.appendChild(this.addAgentButton.render()),this.rootElement}},{key:"renderGroups",value:function(){for(var e=[],t=15;t>0;t--){var n=k(t);(this.controller.isEditable&&x[t]||this.byCombo[n])&&e.push(this.renderGroup(t,n))}return e}},{key:"renderGroup",value:function(e,t){var n=this,r=this.controller.dom.createElement("div");return r.classList.add(this.controller.classes.accessGroupListItem),f.makeDropTarget(r,(function(e){return n.handleDroppedUris(e,t).then((function(){return n.controller.render()})).catch((function(e){return n.controller.renderStatus(e)}))})),this.renderGroupElements(e,t).forEach((function(e){return r.appendChild(e)})),r}},{key:"renderGroupElements",value:function(e,t){var n=this,r=this.controller.dom.createElement("div");r.classList.add(this.controller.classes.group),r.classList.toggle(this.controller.classes["group-".concat(e)],this.controller.isEditable),r.innerText=w[e]||function(e){for(var t="",n=["Read","Append","Write","Control"],r=0;r<4;r++)e&1<<r&&(t+=n[r]);return t}(e);var i=this.controller.dom.createElement("div");i.classList.add(this.controller.classes.group),i.classList.toggle(this.controller.classes["group-".concat(e)],this.controller.isEditable);var o=i.appendChild(this.controller.dom.createElement("table"));(this.byCombo[t]||[]).map((function(e){var r=(0,s.default)(e,2),i=r[0],a=r[1];return n.renderAgent(o,t,i,a)})).forEach((function(e){return o.appendChild(e)}));var a=this.controller.dom.createElement("div");return a.classList.add(this.controller.classes.group),a.classList.toggle(this.controller.classes["group-".concat(e)],this.controller.isEditable),a.innerText=_[e]||"Unusual combination",[r,i,a]}},{key:"renderAgent",value:function(e,t,n,r){var i=this,o=f.personTR(this.controller.dom,b(n),(0,d.sym)(r),this.controller.isEditable?{deleteFunction:function(){return i.deleteAgent(t,n,r).then((function(){return e.removeChild(o)})).catch((function(e){return i.controller.renderStatus(e)}))}}:{});return o}},{key:"deleteAgent",value:(i=(0,a.default)(o.default.mark((function e(t,n,r){var i,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this.byCombo[t]||[],(a=i.find((function(e){var t=(0,s.default)(e,2),i=t[0],o=t[1];return i===n&&o===r})))&&i.splice(i.indexOf(a),1),e.next=5,this.controller.save();case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return i.apply(this,arguments)})},{key:"addNewURI",value:(r=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.handleDroppedUri(t,k(1));case 2:return e.next=4,this.controller.save();case 4:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"handleDroppedUris",value:(n=(0,a.default)(o.default.mark((function e(t,n){var r=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.all(t.map((function(e){return r.handleDroppedUri(e,n)})));case 3:return e.next=5,this.controller.save();case 5:e.next=10;break;case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",Promise.reject(e.t0));case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(e,t){return n.apply(this,arguments)})},{key:"handleDroppedUri",value:(t=(0,a.default)((function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return o.default.mark((function i(){var a,s,c,u,l,p;return o.default.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(a=S(e,n.store),s=(0,d.sym)(e),a||r){i.next=17;break}return g.log(" Not obvious: looking up dropped thing ".concat(s)),i.prev=4,i.next=7,null===(c=n._store)||void 0===c||null===(u=c.fetcher)||void 0===u?void 0:u.load(s.doc());case 7:i.next=14;break;case 9:return i.prev=9,i.t0=i.catch(4),l="Ignore error looking up dropped thing: ".concat(i.t0),g.error(l),i.abrupt("return",Promise.reject(new Error(l)));case 14:return i.abrupt("return",n.handleDroppedUri(e,t,!0));case 17:if(a){i.next=21;break}return p=" Error: Drop fails to drop appropriate thing! ".concat(e),g.error(p),i.abrupt("return",Promise.reject(new Error(p)));case 21:n.setACLCombo(t,e,a,n.controller.subject);case 22:case"end":return i.stop()}}),i,null,[[4,9]])}))()})),function(e,n){return t.apply(this,arguments)})},{key:"setACLCombo",value:function(e,t,n,r){e in this.byCombo||(this.byCombo[e]=[]),this.removeAgentFromCombos(t),this.byCombo[e].push([n.pred,n.obj.uri]),g.log("ACL: setting access to ".concat(r," by ").concat(n.pred,": ").concat(n.obj))}},{key:"removeAgentFromCombos",value:function(e){for(var t=0;t<16;t++){var n=this.byCombo[k(t)];if(n)for(var r=0;r<n.length;r++)for(;r<n.length&&n[r][1]===e;)n.splice(r,1)}}}]),e}();function k(e){for(var t=["Read","Append","Write","Control"],n=[],r=0;r<4;r++)e&1<<r&&n.push("http://www.w3.org/ns/auth/acl#"+t[r]);return n.sort(),n.join("\n")}function S(e,t){var n=(0,d.sym)(e),r=t.findTypeURIs(n);for(var i in r)g.log(" drop object type includes: "+i);if(e.startsWith("http")&&3===e.split("/").length)return{pred:"origin",obj:n};if(e.startsWith("http")&&4===e.split("/").length&&e.endsWith("/"))return g.log("Assuming final slash on dragged origin URI was unintended!"),{pred:"origin",obj:(0,d.sym)(e.slice(0,-1))};if(h.vcard("WebID").uri in r)return{pred:"agent",obj:n};if(h.vcard("Group").uri in r)return{pred:"agentGroup",obj:n};if(n.sameTerm(h.foaf("Agent"))||n.sameTerm(h.acl("AuthenticatedAgent"))||n.sameTerm(h.rdf("Resource"))||n.sameTerm(h.owl("Thing")))return{pred:"agentClass",obj:n};if(h.vcard("Individual").uri in r||h.foaf("Person").uri in r||h.foaf("Agent").uri in r){var o=t.any(n,h.foaf("preferredURI"));return o?{pred:"agent",obj:(0,d.sym)(o)}:{pred:"agent",obj:n}}return h.solid("AppProvider").uri in r?{pred:"origin",obj:n}:h.solid("AppProviderClass").uri in r?{pred:"originClass",obj:n}:(g.log(" Triage fails for "+e),null)}t.AccessGroups=E},3723:(e,t,n)=>{"use strict";var r=n(4836),i=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.ACLControlBox5=function(e,t,n,r){var i=t.dom,o=e.doc(),a=(0,d.getClasses)(i.head,p.styles).classes,s=i.createElement("div");s.classList.add(a.aclControlBoxContainer);var u=s.appendChild(i.createElement("h1"));u.textContent="Sharing for ".concat(n," ").concat(c.label(e)),u.classList.add(a.aclControlBoxHeader);var l=s.appendChild(i.createElement("div"));l.classList.add(a.aclControlBoxStatus);try{(function(e,t,n,r,i,o,a,s){return w.apply(this,arguments)})(o,r,e,n,t,a,i,l).then((function(e){return s.appendChild(e.render())}))}catch(e){l.innerText=e}return s},t.handleDrop=b,t.preventBrowserDropEvents=function(e){if((0,f.log)("preventBrowserDropEvents called."),void 0!==g){if(g[v])return;g[v]=!0}e.addEventListener("drop",b,!1),e.addEventListener("dragenter",y,!1),e.addEventListener("dragover",y,!1)},t.preventDrag=y,t.setGlobalWindow=function(e){g=e},t.shortNameForFolder=function(e){var t=e.uri;"/"===t.slice(-1)&&(t=t.slice(0,-1));var n=t.lastIndexOf("/");return n>=0&&(t=t.slice(n+1)),t||"/"};var o=r(n(4687)),a=r(n(7156)),s=m(n(6590)),c=m(n(5666)),u=n(3422),l=n(3319),d=n(1909),p=n(3755),f=n(4433);function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(h=function(e){return e?n:t})(e)}function m(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var n=h(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}var g=window,v=Symbol("prevent double triggering of drop event");function y(e){e.stopPropagation(),e.preventDefault()}function b(e){e.dataTransfer.files.length>0&&(g.confirm("Are you sure you want to drop this file here? (Cancel opens it in a new tab)")||(e.stopPropagation(),e.preventDefault(),(0,f.log)("@@@@ document-level DROP suppressed: "+e.dataTransfer.dropEffect)))}function w(){return w=(0,a.default)(o.default.mark((function e(t,n,r,i,s,c,d,p){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,h){return(0,u.getACLorDefault)(t,function(){var t=(0,a.default)(o.default.mark((function t(a,m,g,v,y,b){var w,k,S,C;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(C=function(e){return new l.AccessController(r,i,s,p,c,k,g,v,y,b,e,n,d)},a){t.next=3;break}return t.abrupt("return",h(new Error("Error reading ".concat(m?"":" default ","ACL. status ").concat(g,": ").concat(v))));case 3:if(w=x(g),(k=_(g,v,n)||E(g))||!w){t.next=16;break}return t.prev=6,t.next=9,(0,u.getProspectiveHolder)(w);case 9:return S=t.sent,t.abrupt("return",e(C(S)));case 13:t.prev=13,t.t0=t.catch(6),(0,f.warn)(t.t0);case 16:return t.abrupt("return",e(C()));case 17:case"end":return t.stop()}}),t,null,[[6,13]])})));return function(e,n,r,i,o,a){return t.apply(this,arguments)}}())})));case 1:case"end":return e.stop()}}),e)}))),w.apply(this,arguments)}function x(e){var t=e.uri.split("#")[0],n=t.slice(0,-1).lastIndexOf("/"),r=t.indexOf("//");return r>=0&&n<r+2||n<0?null:t.slice(0,n+1)}function _(e,t,n){return n.holds(e,s.rdf("type"),s.space("Storage"),t)}function E(e){return e.uri===e.site().uri}},3422:(e,t,n)=>{"use strict";var r=n(4836),i=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.ACLToString=function(e){return _(b(e))},t.ACLbyCombination=b,t.ACLunion=v,t.adoptACLDefault=function(e,t,n,r){var i=s.acl,o="/"===e.uri.slice(-1),a=h.each(void 0,i("default"),n,r).concat(h.each(void 0,i("defaultForNew"),n,r)).reduce((function(t,n){return t.concat(h.statementsMatching(n,s.rdf("type"),i("Authorization"),r)).concat(h.statementsMatching(n,i("agent"),void 0,r)).concat(h.statementsMatching(n,i("agentClass"),void 0,r)).concat(h.statementsMatching(n,i("agentGroup"),void 0,r)).concat(h.statementsMatching(n,i("origin"),void 0,r)).concat(h.statementsMatching(n,i("originClass"),void 0,r)).concat(h.statementsMatching(n,i("mode"),void 0,r)).concat((0,d.st)(n,i("accessTo"),e,r)).concat(o?(0,d.st)(n,i("default"),e,r):[])}),[]),c=(0,d.graph)();return a.forEach((function(e){return c.add(u(e.subject),u(e.predicate),u(e.object),(0,d.sym)(t.uri))})),c;function u(e){var n=r.uri.length;return(0,d.sym)(e.uri.slice(0,n)===r.uri?t.uri+e.uri.slice(n):e.uri)}},t.comboToString=_,t.fixIndividualACL=S,t.fixIndividualCardACL=function(e,t,n){var r=h.each(void 0,s.vcard("hasMember"),e);r?S(e,r,t,n):(t("This card is in no groups"),n(!0))},t.getACL=A,t.getACLorDefault=C,t.getProspectiveHolder=function(e){return T.apply(this,arguments)},t.loadUnionACL=y,t.makeACLGraph=w,t.makeACLGraphbyCombo=x,t.makeACLString=function(e,t,n){var r=(0,d.graph)();return w(r,e,t,n),(0,d.serialize)(n,r,n.uri,"text/turtle")||""},t.putACLObject=E,t.putACLbyCombo=k,t.readACL=m,t.sameACL=g,t.setACL=function(e,t,n){var r=h.any(e,c.ACL_LINK);if(!h.fetcher)throw new Error("Store has no fetcher");r?h.fetcher.webOperation("PUT",r.value,{data:t,contentType:"text/turtle"}).then((function(e){n(e.ok,e.error||"")})):h.fetcher.nowOrWhenFetched(e,void 0,(function(r,i){if(!r)return n(r,"Gettting headers for ACL: "+i);var o=h.any(e,c.ACL_LINK);if(o){if(!h.fetcher)throw new Error("Store has no fetcher");h.fetcher.webOperation("PUT",o.value,{data:t,contentType:"text/turtle"}).then((function(e){n(e.ok,e.error||"")}))}else n(!1,"No Link rel=ACL header for "+e)}))};var o=r(n(4687)),a=r(n(7156)),s=f(n(6590)),c=n(166),u=f(n(5666)),l=f(n(4433)),d=n(6022);function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(p=function(e){return e?n:t})(e)}function f(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var n=p(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}var h=c.solidLogicSingleton.store;function m(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=r?c(n,s):n.each(void 0,s.acl("accessTo"),e),o=s.acl,a={agent:{},agentClass:{},agentGroup:{},origin:{},originClass:{}};return Object.keys(a).forEach((function(e){i.forEach((function(t){n.each(t,o("mode")).forEach((function(r){n.each(t,o(e)).forEach((function(n){a[e][n.uri]=a[e][n.uri]||{},a[e][n.uri][r.uri]=t}))}))}))})),a;function c(t,n){return t.each(void 0,n.acl("default"),e).concat(t.each(void 0,n.acl("defaultForNew"),e))}}function g(e,t){var n=function(e,t){for(var n in{agent:!0,agentClass:!0,agentGroup:!0,origin:!0,originClass:!0})if(e[n])for(var r in e[n])for(var i in e[n][r])if(!t[n][r]||!t[n][r][i])return!1;return!0};return n(e,t)&&n(t,e)}function v(e){for(var t,n,r=e[0],i=function(i){["agent","agentClass","agentGroup","origin","originClass"].forEach((function(o){if((t=e[i])[o])for(n in t[o])for(var a in t[o][n])r[o][n]||(r[o][n]=[]),r[o][n][a]=!0}))},o=1;o<e.length;o++)i(o);return r}function y(e,t){var n=[];!function e(r){r.length?C(r.shift().doc(),(function(i,o,a,s,c,u){var l=!o;if(!i||!c||!u)return t(i,s);var d=l?m(c,u):m(a,s);n.push(d),e(r.slice(1))})):t(!0,v(n))}(e)}function b(e){var t={};return["agent","agentClass","agentGroup","origin","originClass"].forEach((function(n){for(var r in e[n]){var i=[];for(var o in e[n][r])i.push(o);i.sort();var a=i.join("\n");t[a]||(t[a]=[]),t[a].push([n,r])}})),t}function w(e,t,n,r){return x(e,t,b(n),r)}function x(e,t,n,r,i,o){var a=s.acl;for(var c in n){var u=n[c];if(u.length){var l=c.split("\n"),d=l.map((function(e){return e.split("#")[1]})).join("");o&&!i&&(d+="Default");var p=e.sym(r.uri+"#"+d);e.add(p,s.rdf("type"),a("Authorization"),r),i&&e.add(p,a("accessTo"),t,r),o&&e.add(p,a("default"),t,r);for(var f=0;f<l.length;f++)e.add(p,a("mode"),e.sym(l[f]),r);for(var h=0;h<u.length;h++){var m=u[h][0],g=u[h][1];e.add(p,a(m),e.sym(g),r)}}}}function _(e){var t="";for(var n in e){t+=n.split("\n").map((function(e){return e.split("#")[1][0]})).join("")+":";for(var r=e[n],i=0;i<r.length;i++){var o=r[i][0],a=(0,d.sym)(r[i][1]);t+="agent"===o?"@":"",t+=a.sameTerm(s.foaf("Agent"))?"*":u.label(a),i<r.length-1&&(t+=",")}t+=";"}return"{"+t.slice(0,-1)+"}"}function E(e,t,n,r,i){return k(e,t,b(n),r,i)}function k(e,t,n,r,i){var o,a=(0,d.graph)();x(a,t,n,r,!0),null===(o=e.updater)||void 0===o||o.put(r,a.statementsMatching(void 0,void 0,void 0,r),"text/turtle",(function(o,a,s){var c;a?(null===(c=e.fetcher)||void 0===c||c.unload(r),x(e,t,n,r,!0),e.fetcher.requested[r.uri]="done",i(a)):i(a,s)}))}function S(e,t,n,r){n=n||l.log;var i=e.doc();C(i,(function(o,a,s,c,l,d){if(!o||!l||!d)return r(!1,c);var p=a?m(s,c):m(l,d);y(t,(function(t,o){if(!t)return r(!1,o);g(o,p)?n("Nice - same ACL. no change "+u.label(e)+" "+i):(n("Group ACLs differ for "+u.label(e)+" "+i),E(h,s,o,c,r))}))}))}function C(e,t){A(e,(function(n,r,i,o){var a=s.acl;return n?n?404!==r?403===r?t(!1,!1,r,"(Sharing not available to you)".concat(o)):200!==r?t(!1,!1,r,"Error ".concat(r," accessing Access Control information for ").concat(e,": ").concat(o)):t(!0,!0,e,i):void function n(r){"/"===r.slice(-1)&&(r=r.slice(0,-1));var o=r.lastIndexOf("/");if(r.indexOf("/",r.indexOf("//")+2)>o)return t(!1,!0,404,"Found no ACL resource");r=r.slice(0,o+1);var s=(0,d.sym)(r);A(s,(function(o,c,u){if(!o)return t(!1,!0,c,"( No ACL pointer ".concat(r," ").concat(c,")").concat(u));if(403===c)return t(!1,!0,c,"( default ACL file FORBIDDEN. Stop.".concat(r,")"));if(404===c)return n(r);if(200!==c)return t(!1,!0,c,"Error status '".concat(c,"' searching for default for ").concat(s));if(!h.each(void 0,a("default"),h.sym(r),u).concat(h.each(void 0,a("defaultForNew"),h.sym(r),u)).length)return n(r);var l=h.sym(r);return t(!0,!1,e,i,l,u)}))}(e.uri):t(!1,!1,r,"Error accessing Access Control information for ".concat(e,") ").concat(o)):t(!1,!1,r,o)}))}function A(e,t){if(!h.fetcher)throw new Error("kb has no fetcher");h.fetcher.nowOrWhenFetched(e,void 0,(function(n,r){if(!n)return t(n,"Can't get headers to find ACL for ".concat(e,": ").concat(r));var i=h.any(e,c.ACL_LINK);if(i){if(!h.fetcher)throw new Error("kb has no fetcher");if(h.fetcher.nonexistent[i.value])return t(!0,404,i,"ACL file ".concat(i," does not exist."));h.fetcher.nowOrWhenFetched(i,void 0,(function(e,n,r){e?t(!0,200,i):t(!0,r.status,i,"Can't read Access Control File ".concat(i,": ").concat(n))}))}else t(!1,900,"No Link rel=ACL header for ".concat(e))}))}function T(){return(T=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){return C((0,d.sym)(t),(function(r,i,o,a,s){return r?e(i?o:s):n(new Error("Error loading ".concat(t)))}))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},1349:(e,t,n)=>{"use strict";var r=n(4836),i=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.AddAgentButtons=void 0;var o=r(n(4687)),a=r(n(7156)),s=r(n(6690)),c=r(n(9728)),u=r(n(8416)),l=v(n(4433)),d=n(1124),p=n(3210),f=v(n(6590)),h=v(n(5666)),m=v(n(2457));function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(g=function(e){return e?n:t})(e)}function v(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var n=g(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}var y=function(){function e(t){(0,s.default)(this,e),this.groupList=t,(0,u.default)(this,"rootElement",void 0),(0,u.default)(this,"barElement",void 0),(0,u.default)(this,"isExpanded",!1),this.rootElement=t.controller.dom.createElement("div"),this.barElement=t.controller.dom.createElement("div")}var t,n,r,i,g,v;return(0,c.default)(e,[{key:"render",value:function(){return this.rootElement.innerHTML="",this.rootElement.appendChild(this.renderAddButton()),this.rootElement.appendChild(this.barElement),this.rootElement}},{key:"renderAddButton",value:function(){var e=this;return m.button(this.groupList.controller.dom,"".concat(d.icons.iconBase,"noun_34653_green.svg"),"Add ...",(function(){e.toggleBar(),e.renderBar()}))}},{key:"renderBar",value:function(){this.barElement.innerHTML="",this.isExpanded&&(this.barElement.appendChild(this.renderPersonButton()),this.barElement.appendChild(this.renderGroupButton()),this.barElement.appendChild(this.renderPublicButton()),this.barElement.appendChild(this.renderAuthenticatedAgentButton()),this.barElement.appendChild(this.renderBotButton()),this.barElement.appendChild(this.renderAppsButton()))}},{key:"renderSimplifiedBar",value:function(e){var t=this;Array.from(this.barElement.children).filter((function(t){return t!==e})).forEach((function(e){return t.barElement.removeChild(e)}))}},{key:"renderPersonButton",value:function(){var e=this;return m.button(this.groupList.controller.dom,d.icons.iconBase+m.iconForClass["vcard:Individual"],"Add Person",(function(t){e.renderSimplifiedBar(t.target),e.renderNameForm(f.vcard("Individual"),"person").then((function(t){return e.addPerson(t)})).then((function(){return e.renderCleanup()})).catch((function(t){return e.groupList.controller.renderStatus(t)}))}))}},{key:"renderGroupButton",value:function(){var e=this;return m.button(this.groupList.controller.dom,d.icons.iconBase+m.iconForClass["vcard:Group"],"Add Group",(function(t){e.renderSimplifiedBar(t.target),e.renderNameForm(f.vcard("Group"),"group").then((function(t){return e.addGroup(t)})).then((function(){return e.renderCleanup()})).catch((function(t){return e.groupList.controller.renderStatus(t)}))}))}},{key:"renderNameForm",value:function(e,t){return m.askName(this.groupList.controller.dom,this.groupList.store,this.barElement,f.vcard("URI"),e,t)}},{key:"renderPublicButton",value:function(){var e=this;return m.button(this.groupList.controller.dom,d.icons.iconBase+m.iconForClass["foaf:Agent"],"Add Everyone",(function(){return e.addAgent(f.foaf("Agent").uri).then((function(){return e.groupList.controller.renderTemporaryStatus("Adding the general public to those who can read. Drag the globe to a different level to give them more access.")})).then((function(){return e.renderCleanup()}))}))}},{key:"renderAuthenticatedAgentButton",value:function(){var e=this;return m.button(this.groupList.controller.dom,"".concat(d.icons.iconBase,"noun_99101.svg"),"Anyone logged In",(function(){return e.addAgent(f.acl("AuthenticatedAgent").uri).then((function(){return e.groupList.controller.renderTemporaryStatus("Adding anyone logged in to those who can read. Drag the ID icon to a different level to give them more access.")})).then((function(){return e.renderCleanup()}))}))}},{key:"renderBotButton",value:function(){var e=this;return m.button(this.groupList.controller.dom,d.icons.iconBase+"noun_Robot_849764.svg","A Software Agent (bot)",(function(t){e.renderSimplifiedBar(t.target),e.renderNameForm(f.schema("Application"),"bot").then((function(t){return e.addBot(t)})).then((function(){return e.renderCleanup()}))}))}},{key:"renderAppsButton",value:function(){var e=this;return m.button(this.groupList.controller.dom,"".concat(d.icons.iconBase,"noun_15177.svg"),"A Web App (origin)",(function(t){e.renderSimplifiedBar(t.target);var n={div:e.barElement,dom:e.groupList.controller.dom},r=e.renderAppsTable(n).catch((function(t){return e.groupList.controller.renderStatus(t)}));e.renderAppsView();var i=e.renderNameForm(f.schema("WebApplication"),"webapp domain").then((function(t){return e.getOriginFromName(t)}));Promise.race([r,i]).then((function(t){t&&e.groupList.addNewURI(t)})).then((function(){return e.renderCleanup()}))}))}},{key:"renderAppsView",value:function(){var e=this,t=this.groupList.controller.context.session.paneRegistry.byName("trustedApplications");if(t){var n=t.render(null,this.groupList.controller.context);n.classList.add(this.groupList.controller.classes.trustedAppController);var r=m.cancelButton(this.groupList.controller.dom,(function(){return e.renderCleanup()}));r.classList.add(this.groupList.controller.classes.trustedAppCancelButton),n.insertBefore(r,n.firstChild),this.barElement.appendChild(n)}}},{key:"renderAppsTable",value:(v=(0,a.default)(o.default.mark((function e(t){var n,r,i=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,p.ensureLoadedProfile)(t);case 2:return n=this.groupList.store.each(t.me,f.acl("trustedApp")),r=n.flatMap((function(e){return i.groupList.store.each(e,f.acl("origin"))})),this.barElement.appendChild(this.groupList.controller.dom.createElement("p")).textContent="You have ".concat(r.length," selected web apps."),e.abrupt("return",new Promise((function(e,t){var r=i.barElement.appendChild(i.groupList.controller.dom.createElement("table"));r.classList.add(i.groupList.controller.classes.trustedAppAddApplicationsTable),n.forEach((function(n){var o=i.groupList.store.any(n,f.acl("origin"));o||t(new Error("Unable to pick app: ".concat(n.value)));var a=m.personTR(i.groupList.controller.dom,f.acl("origin"),o,{}),s=i.groupList.controller.dom.createElement("table"),c=s.appendChild(i.groupList.controller.dom.createElement("tr"));c.appendChild(i.groupList.controller.dom.createElement("td")).appendChild(a),c.appendChild(i.groupList.controller.dom.createElement("td")).textContent="Give access to ".concat(i.groupList.controller.noun," ").concat(h.label(i.groupList.controller.subject),"?"),c.appendChild(i.groupList.controller.dom.createElement("td")).appendChild(m.continueButton(i.groupList.controller.dom,(function(){return e(o.value)}))),r.appendChild(s)}))})));case 6:case"end":return e.stop()}}),e,this)}))),function(e){return v.apply(this,arguments)})},{key:"renderCleanup",value:function(){this.renderBar(),this.groupList.render()}},{key:"addPerson",value:(g=(0,a.default)(o.default.mark((function e(t){var n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return",this.toggleBar());case 2:if(n=/^https?:/i,t.match(n)){e.next=5;break}return e.abrupt("return",Promise.reject(new Error("Not a http URI")));case 5:return l.log("Adding to ACL person: ".concat(t)),e.next=8,this.groupList.addNewURI(t);case 8:this.toggleBar();case 9:case"end":return e.stop()}}),e,this)}))),function(e){return g.apply(this,arguments)})},{key:"addGroup",value:(i=(0,a.default)(o.default.mark((function e(t){var n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return",this.toggleBar());case 2:if(n=/^https?:/i,t.match(n)){e.next=5;break}return e.abrupt("return",Promise.reject(new Error("Not a http URI")));case 5:return l.log("Adding to ACL group: "+t),e.next=8,this.groupList.addNewURI(t);case 8:this.toggleBar();case 9:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"addAgent",value:(r=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.groupList.addNewURI(t);case 2:this.toggleBar();case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"addBot",value:(n=(0,a.default)(o.default.mark((function e(t){var n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return",this.toggleBar());case 2:if(n=/^https?:/i,t.match(n)){e.next=5;break}return e.abrupt("return",Promise.reject(new Error("Not a http URI")));case 5:return l.log("Adding to ACL bot: "+t),e.next=8,this.groupList.addNewURI(t);case 8:this.toggleBar();case 9:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"getOriginFromName",value:(t=(0,a.default)(o.default.mark((function e(t){var n,r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return",Promise.resolve());case 2:if(n=/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i,t.match(n)){e.next=5;break}return e.abrupt("return",Promise.reject(new Error("Not a domain name")));case 5:return r="https://"+t,l.log("Adding to ACL origin: "+r),this.toggleBar(),e.abrupt("return",r);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"toggleBar",value:function(){this.isExpanded=!this.isExpanded}}]),e}();t.AddAgentButtons=y},8123:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.aclControl=t.acl=void 0;var r=n(3422),i=n(3723),o={adoptACLDefault:r.adoptACLDefault,readACL:r.readACL,sameACL:r.sameACL,ACLunion:r.ACLunion,loadUnionACL:r.loadUnionACL,ACLbyCombination:r.ACLbyCombination,makeACLGraph:r.makeACLGraph,makeACLGraphbyCombo:r.makeACLGraphbyCombo,ACLToString:r.ACLToString,comboToString:r.comboToString,makeACLString:r.makeACLString,putACLObject:r.putACLObject,putACLbyCombo:r.putACLbyCombo,fixIndividualCardACL:r.fixIndividualCardACL,fixIndividualACL:r.fixIndividualACL,setACL:r.setACL,getACLorDefault:r.getACLorDefault,getACL:r.getACL};t.acl=o;var a={preventBrowserDropEvents:i.preventBrowserDropEvents,shortNameForFolder:i.shortNameForFolder,ACLControlBox5:i.ACLControlBox5};t.aclControl=a},3755:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.styles=void 0,t.styles={aclControlBoxContainer:{margin:"1em"},aclControlBoxHeader:{fontSize:"120%",margin:"0 0 1rem"},aclControlBoxStatus:{display:"none",margin:"1rem 0"},aclControlBoxStatusRevealed:{display:"block"},aclGroupContent:{maxWidth:650},accessGroupList:{display:"grid",gridTemplateColumns:"1fr",margin:"1em",width:"100%"},accessGroupListItem:{display:"grid",gridTemplateColumns:"100px auto 30%"},defaultsController:{display:"flex"},defaultsControllerNotice:{color:"#888",flexGrow:1,fontSize:"80%"},bigButton:{backgroundColor:"white",border:"0.1em solid #888",borderRadius:"0.3em",maxWidth:"50%",paddingBottom:"1em",paddingTop:"1em"},group:{color:"#888"},"group-1":{color:"green"},"group-2":{color:"#cc0"},"group-3":{color:"orange"},"group-5":{color:"red"},"group-9":{color:"blue"},"group-13":{color:"purple"},trustedAppAddApplicationsTable:{backgroundColor:"#eee"},trustedAppCancelButton:{float:"right"},trustedAppControllerI:{borderColor:"orange",borderRadius:"1em",borderWidth:"0.1em"},temporaryStatusInit:{background:"green"},temporaryStatusEnd:{background:"transparent",transition:"background 5s linear"}}},3060:(e,t,n)=>{"use strict";var r=n(4836),i=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.findBookmarkDocument=function(e){return T.apply(this,arguments)},t.renderBookmarksButton=function(e,t){return N.apply(this,arguments)},t.toggleBookmark=I;var o=r(n(4687)),a=r(n(7156)),s=b(n(4433)),c=n(1124),u=n(2843),l=b(n(6590)),d=b(n(4004)),p=b(n(6022)),f=b(n(2853)),h=b(n(5666)),m=b(n(2457)),g=n(166),v=n(3210);function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(y=function(e){return e?n:t})(e)}function b(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var n=y(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}var w={icons:c.icons,ns:l,media:u.media,pad:d,rdf:p,style:f,utils:h,widgets:m},x=w.rdf,_=x.Namespace("http://www.w3.org/2002/01/bookmark#"),E="noun_45961.svg",k=h.label,S=window.document||null;function C(e){return new Promise((function(t,n){g.store.fetcher.load(e).then((function(n){s.log("createIfNotExists doc exists, all good "+e),t(n)}),(function(r){404===r.response.status?(s.log("createIfNotExists doc does NOT exist, will create... "+e),g.store.fetcher.webOperation("PUT",e.uri,{data:"",contentType:"text/turtle"}).then((function(n){delete g.store.fetcher.requested[e.uri],s.log("createIfNotExists doc created ok "+e),t(n)}),(function(t){s.log("createIfNotExists doc FAILED: "+e+": "+t),n(t)}))):(s.log("createIfNotExists doc load error NOT 404: "+e+": "+r),n(r))}))}))}function A(e,t){return new Promise((function(n,r){g.store.updater.update(e,t,(function(e,t,i){t?n():r(new Error(i))}))}))}function T(){return(T=(0,a.default)(o.default.mark((function e(t){var n,r,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=_("Bookmark"),r="bookmarks.ttl",e.next=5,(0,v.findAppInstances)(t,n,!0);case 5:if(!(t.instances&&t.instances.length>0)){e.next=10;break}t.bookmarkDocument=t.instances[0],t.instances.length>1&&alert("More than one bookmark file! "+t.instances),e.next=28;break;case 10:if(!t.publicProfile){e.next=27;break}return i=x.sym(t.publicProfile.dir().uri+r),e.prev=12,s.log("Creating new bookmark file "+i),e.next=16,C(i);case 16:e.next=22;break;case 18:return e.prev=18,e.t0=e.catch(12),alert.error("Can't make fresh bookmark file:"+e.t0),e.abrupt("return",t);case 22:return e.next=24,(0,g.registerInTypeIndex)(i,t.index,n);case 24:t.bookmarkDocument=i,e.next=28;break;case 27:alert("You seem to have no bookmark file and not even a profile file.");case 28:return e.abrupt("return",t);case 29:case"end":return e.stop()}}),e,null,[[12,18]])})))).apply(this,arguments)}function O(e,t){return P.apply(this,arguments)}function P(){return(P=(0,a.default)(o.default.mark((function e(t,n){var r,i,a,s,c,u,d;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r="",i=g.authn.currentUser()){e.next=4;break}throw new Error("Must be logged on to add Bookmark");case 4:return a=g.store.any(n,l.foaf("maker")),r=k(a)+": "+g.store.anyValue(n,l.sioc("content")).slice(0,80),s=t.bookmarkDocument,c=w.widgets.newThing(s,r),u=[x.st(s,w.ns.dct("references"),c,s),x.st(c,w.ns.rdf("type"),_("Bookmark"),s),x.st(c,w.ns.dct("created"),new Date,s),x.st(c,_("recalls"),n,s),x.st(c,w.ns.foaf("maker"),i,s),x.st(c,w.ns.dct("title"),r,s)],e.prev=9,e.next=12,A([],u);case 12:e.next=19;break;case 14:return e.prev=14,e.t0=e.catch(9),d="Making bookmark: "+e.t0,alert.error(d),e.abrupt("return",null);case 19:return e.abrupt("return",c);case 20:case"end":return e.stop()}}),e,null,[[9,14]])})))).apply(this,arguments)}function I(e,t,n){return j.apply(this,arguments)}function j(){return(j=(0,a.default)(o.default.mark((function e(t,n,r){var i,a,c;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,g.store.fetcher.load(t.bookmarkDocument);case 2:if(!(i=g.store.each(null,_("recalls"),n,t.bookmarkDocument)).length){e.next=24;break}if(confirm("Delete bookmark on this?"+i.length)){e.next=6;break}return e.abrupt("return");case 6:a=0;case 7:if(!(a<i.length)){e.next=22;break}return e.prev=8,e.next=11,A(g.store.connectedStatements(i[a]),[]);case 11:r.style.backgroundColor="white",s.log("Bookmark deleted: "+i[a]),e.next=19;break;case 15:e.prev=15,e.t0=e.catch(8),s.error("Cant delete bookmark:"+e.t0),alert("Cant delete bookmark:"+e.t0);case 19:a++,e.next=7;break;case 22:e.next=29;break;case 24:return e.next=26,O(t,n);case 26:c=e.sent,r.style.backgroundColor="yellow",s.log("Bookmark added: "+c);case 29:case"end":return e.stop()}}),e,null,[[8,15]])})))).apply(this,arguments)}function N(){return N=(0,a.default)(o.default.mark((function e(t,n){var r,i,s;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=function(){return i=(0,a.default)(o.default.mark((function e(n){var r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,g.store.fetcher.load(t.bookmarkDocument);case 2:r=g.store.any(null,_("recalls"),n.target,t.bookmarkDocument),n.style=w.style.buttonStyle,r&&(n.style.backgroundColor="yellow");case 5:case"end":return e.stop()}}),e)}))),i.apply(this,arguments)},r=function(e){return i.apply(this,arguments)},!t.bookmarkDocument){e.next=8;break}return(s=w.widgets.button(S,w.icons.iconBase+E,k(_("Bookmark")),(function(){I(t,n,s)}))).target=n,e.next=7,r(s);case 7:return e.abrupt("return",s);case 8:case"end":return e.stop()}}),e)}))),N.apply(this,arguments)}},6712:(e,t,n)=>{"use strict";var r=n(4836),i=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.ChatChannel=void 0,t._createIfNotExists=function(e){return b.apply(this,arguments)},t.isDeleted=function(e){return d.store.holds(e,p.schema("dateDeleted"),null,e.doc())},t.isHidden=function(e){return this.isDeleted(e)||this.isReplaced(e)},t.isReplaced=function(e){return d.store.holds(e,p.dct("isReplacedBy"),null,e.doc())},t.mostRecentVersion=y,t.nick=function(e){var t=d.store.any(e,p.foaf("nick"));return t?""+t.value:""+h.label(e)},t.originalVersion=function(e){for(var t=e;t;)e=t,t=d.store.any(null,p.dct("isReplacedBy"),e,e.doc());return e};var o=r(n(4687)),a=r(n(7156)),s=r(n(6690)),c=r(n(9728)),u=g(n(4433)),l=n(3823),d=n(166),p=g(n(6590)),f=g(n(6022)),h=g(n(5666));function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(m=function(e){return e?n:t})(e)}function g(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var n=m(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}var v=function(){function e(t,n){(0,s.default)(this,e),this.channel=t,this.channelRoot=t.doc(),this.options=n,this.dateFolder=new l.DateFolder(this.channelRoot,"chat.ttl"),this.div=null}var t,n,r;return(0,c.default)(e,[{key:"createMessage",value:(r=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.updateMessage(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"updateMessage",value:(n=(0,a.default)((function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2?arguments[2]:void 0;return o.default.mark((function i(){var a,s,c,l,h,m,g,v;return o.default.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return a=[],s=new Date,c=""+s.getTime(),l=f.term(s),h=n?n.doc():t.dateFolder.leafDocumentFromDate(s),m=d.store.sym(h.uri+"#Msg"+c),g=d.authn.currentUser(),n?(a.push(f.st(y(n),p.dct("isReplacedBy"),m,h)),r&&a.push(f.st(m,p.schema("dateDeleted"),l,h))):a.push(f.st(t.channel,p.wf("message"),m,h)),a.push(f.st(m,p.sioc("content"),d.store.literal(e),h)),a.push(f.st(m,p.dct("created"),l,h)),g&&a.push(f.st(m,p.foaf("maker"),g,h)),i.prev=11,i.next=14,d.store.updater.update([],a);case 14:i.next=22;break;case 16:throw i.prev=16,i.t0=i.catch(11),v="Error saving chat message: "+i.t0,u.warn(v),alert(v),new Error(v);case 22:return i.abrupt("return",m);case 23:case"end":return i.stop()}}),i,null,[[11,16]])}))()})),function(e){return n.apply(this,arguments)})},{key:"deleteMessage",value:(t=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.updateMessage("(message deleted)",t,!0));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}();function y(e){for(var t=e;t;)e=t,t=d.store.any(e,p.dct("isReplacedBy"),null,e.doc());return e}function b(){return b=(0,a.default)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text/turtle",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return o.default.mark((function r(){var i;return o.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,d.store.fetcher.load(e);case 3:i=r.sent,r.next=26;break;case 6:if(r.prev=6,r.t0=r.catch(0),404!==r.t0.response.status){r.next=24;break}return u.log("createIfNotExists: doc does NOT exist, will create... "+e),r.prev=10,r.next=13,d.store.fetcher.webOperation("PUT",e.uri,{data:n,contentType:t});case 13:i=r.sent,r.next=20;break;case 16:throw r.prev=16,r.t1=r.catch(10),u.log("createIfNotExists doc FAILED: "+e+": "+r.t1),r.t1;case 20:return delete d.store.fetcher.requested[e.uri],r.abrupt("return",i);case 24:throw u.log("createIfNotExists doc load error NOT 404: "+e+": "+r.t0),r.t0;case 26:return r.abrupt("return",i);case 27:case"end":return r.stop()}}),r,null,[[0,6],[10,16]])}))()})),b.apply(this,arguments)}t.ChatChannel=v},3823:(e,t,n)=>{"use strict";var r=n(4836),i=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.DateFolder=void 0;var o=r(n(4687)),a=r(n(7156)),s=r(n(6690)),c=r(n(9728)),u=h(n(4433)),l=n(166),d=h(n(6590)),p=h(n(6022));function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}function h(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}var m=function(){function e(t,n,r){(0,s.default)(this,e),this.root=t,this.rootFolder=t.dir(),this.leafFileName=n||"index.ttl",this.membershipProperty=r||d.wf("leafObject")}var t,n;return(0,c.default)(e,[{key:"leafDocumentFromDate",value:function(e){var t=e.toISOString().split("T")[0].replace(/-/g,"/");return t=this.root.dir().uri+t+"/"+this.leafFileName,l.store.sym(t)}},{key:"dateFromLeafDocument",value:function(e){var t=this.rootFolder.uri.length,n=e.uri.slice(t,t+10).replace(/\//g,"-"),r=new Date(n);return u.log("Date for "+e+":"+r.toISOString()),r}},{key:"loadPrevious",value:(n=(0,a.default)(o.default.mark((function e(t,n){var r,i,s,c,p,f;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=function(){return s=(0,a.default)(o.default.mark((function e(t,s){var c,p,f,h,m,g,v,y,b,w;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return h=function(){return h=(0,a.default)(o.default.mark((function e(t){var i,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((t=t.filter(p)).sort(),n||t.reverse(),3===s){e.next=5;break}return e.abrupt("return",t.pop());case 5:if(!t.length){e.next=14;break}return i=t.pop(),a=l.store.sym(i.uri+r.leafFileName),e.next=10,l.store.fetcher.load(a);case 10:if(!(l.store.statementsMatching(null,d.dct("created"),null,a).length>0)){e.next=12;break}return e.abrupt("return",i);case 12:e.next=5;break;case 14:return e.abrupt("return",null);case 15:case"end":return e.stop()}}),e)}))),h.apply(this,arguments)},f=function(e){return h.apply(this,arguments)},p=function(e){var t=e.uri.slice(0,-1).split("/").slice(-1)[0];return!!"0123456789".includes(t[0])},c=function(e){return!(n?e.uri>=t.uri:e.uri<=t.uri)},m=t.dir(),e.prev=5,e.next=8,l.store.fetcher.load(m);case 8:return g=(g=l.store.each(m,d.ldp("contains"))).filter(c),e.next=12,f(g);case 12:if(!(v=e.sent)){e.next=15;break}return e.abrupt("return",v);case 15:e.next=25;break;case 17:if(e.prev=17,e.t0=e.catch(5),!e.t0.response||!e.t0.response.status||404!==e.t0.response.status){e.next=23;break}u.log("Error 404 for chat parent file "+m),e.next=25;break;case 23:throw u.log("*** Error NON 404 for chat parent file "+m),new Error("*** ".concat(e.t0.message," for chat folder ").concat(m));case 25:if(0!==s){e.next=27;break}return e.abrupt("return",null);case 27:return e.next=29,i(m,s-1);case 29:if(y=e.sent){e.next=32;break}return e.abrupt("return",null);case 32:return e.next=34,l.store.fetcher.load(y);case 34:return b=l.store.each(y,d.ldp("contains")),e.next=37,f(b);case 37:return w=e.sent,e.abrupt("return",w);case 39:case"end":return e.stop()}}),e,null,[[5,17]])}))),s.apply(this,arguments)},i=function(e,t){return s.apply(this,arguments)},r=this,c=this.leafDocumentFromDate(t).dir(),e.next=6,i(c,3);case 6:if(!(p=e.sent)){e.next=10;break}return f=l.store.sym(p.uri+this.leafFileName),e.abrupt("return",this.dateFromLeafDocument(f));case 10:return e.abrupt("return",null);case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"firstLeaf",value:(t=(0,a.default)(o.default.mark((function e(t){var n,r,i,s,c,l,f,h,m,g,v;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=function(){return(s=(0,a.default)(o.default.mark((function e(i){var a,s;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=function(e){var t=e.uri.slice(0,-1).split("/").slice(-1)[0];return!!"0123456789".includes(t[0])},u.log(" parent "+i),delete r.requested[i.uri],e.next=5,r.load(i,{force:!0});case 5:if(0!==(s=(s=n.each(i,d.ldp("contains"))).filter(a)).length){e.next=9;break}throw new Error(" @@@ No children to parent2 "+i);case 9:return s.sort(),t&&s.reverse(),e.abrupt("return",s[0]);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)},i=function(e){return s.apply(this,arguments)},n=p.graph(),r=new p.Fetcher(n),e.next=6,i(this.root.dir());case 6:return c=e.sent,e.next=9,i(c);case 9:return l=e.sent,e.next=12,i(l);case 12:return f=e.sent,h=p.sym(f.uri+"chat.ttl"),e.next=16,r.load(h);case 16:if(0!==(m=n.each(this.root,this.membershipProperty,null,h)).length){e.next=21;break}throw g=" INCONSISTENCY -- no chat leafObject in file "+h,u.trace(g),new Error(g);case 21:return(v=m.map((function(e){return[n.any(e,d.dct("created")),e]}))).sort(),t&&v.reverse(),u.log((t?"Latest":"Earliest")+" leafObject is "+v[0][1]),e.abrupt("return",v[0][1]);case 26:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}();t.DateFolder=m},1786:(e,t,n)=>{"use strict";var r=n(4836),i=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.desktopNotification=v,t.infiniteMessageArea=function(e,t,n,r){return b.apply(this,arguments)},t.insertMessageIntoTable=y;var o=r(n(4687)),a=r(n(7156)),s=g(n(6022)),c=n(166),u=g(n(4433)),l=n(1124),d=g(n(6590)),p=g(n(2457)),f=n(6712),h=n(1305);function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(m=function(e){return e?n:t})(e)}function g(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var n=m(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}function v(e){"Notification"in window?"granted"===Notification.permission?new Notification(e):"denied"!==Notification.permission&&Notification.requestPermission().then((function(t){"granted"===t&&new Notification(e)})):u.warn("This browser does no t support desktop notification")}function y(e,t,n,r,i,o){var a=(0,h.renderMessageRow)(e,n,r,i,o);i.selectedMessage&&i.selectedMessage.sameTerm(n)&&(a.style.backgroundColor="yellow",i.selectedElement=a,t.selectedElement=a);for(var s=!1,c=t.firstChild;c;c=c.nextSibling){var u=!0===i.newestfirst,l=a.AJAR_date;if(l>c.AJAR_date&&u||l<c.AJAR_date&&!u){t.insertBefore(a,c),s=!0;break}}s||t.appendChild(a)}function b(){return b=(0,a.default)(o.default.mark((function e(t,n,r,i){var m,g,b,w,x,_,E,k,S,C,A,T,O,P,I,j,N,F,R,L,D,M,U,B,H,q;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return j=function(){return(j=(0,a.default)(o.default.mark((function e(){var t,n,r,a,s,c,u,l;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=function(){i.selectedElement?i.selectedElement.scrollIntoView({block:"center"}):U.inputRow.scrollIntoView&&U.inputRow.scrollIntoView(N)},t=function(){u.selectedElement.scrollIntoView({block:"center"})},i.selectedMessage&&(a=i.selectedMessage.doc(),s=new Date,c=R.leafDocumentFromDate(s),r=c.sameTerm(a)),!i.selectedMessage||r){e.next=15;break}return l=R.dateFromLeafDocument(a),e.next=7,_(l,r);case 7:u=e.sent,L.appendChild(u),B.messageTable=u,H.messageTable=u,t(),setTimeout(t,1e3),e.next=19;break;case 15:return e.next=17,A();case 17:B.messageTable=U,H.messageTable=U;case 19:return e.next=21,O(null,n);case 21:L.addEventListener("scroll",O),i.solo&&document.body.addEventListener("scroll",O);case 23:case"end":return e.stop()}}),e)})))).apply(this,arguments)},I=function(){return j.apply(this,arguments)},P=function(){return(P=(0,a.default)(o.default.mark((function e(t,n){var r,a,s,c,l;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!q){e.next=2;break}return e.abrupt("return");case 2:q=!0,r=!n,a=150;case 5:if(!(L.scrollTop<a&&B.messageTable&&!B.messageTable.initial&&B.messageTable.extendBackwards)){e.next=21;break}if(0!==L.scrollHeight){e.next=10;break}return setTimeout(O,2e3),q=!1,e.abrupt("return");case 10:return c=L.scrollHeight-L.scrollTop,u.log("infinite scroll: adding above: top "+L.scrollTop),e.next=14,B.messageTable.extendBackwards();case 14:if(s=e.sent,r&&(L.scrollTop=L.scrollHeight-c),n&&n(),!s){e.next=19;break}return e.abrupt("break",21);case 19:e.next=5;break;case 21:if(!(i.selectedMessage&&L.scrollHeight-L.scrollTop-L.clientHeight<a&&H.messageTable&&!H.messageTable.final&&H.messageTable.extendForwards)){e.next=33;break}return l=L.scrollTop,u.log("infinite scroll: adding below: bottom: "+(L.scrollHeight-L.scrollTop-L.clientHeight)),e.next=26,H.messageTable.extendForwards();case 26:if(s=e.sent,r&&(L.scrollTop=l),n&&n(),!s){e.next=31;break}return e.abrupt("break",33);case 31:e.next=21;break;case 33:q=!1;case 34:case"end":return e.stop()}}),e)})))).apply(this,arguments)},O=function(e,t){return P.apply(this,arguments)},T=function(){return(T=(0,a.default)(o.default.mark((function e(){var t,n,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new Date,n=R.leafDocumentFromDate(t),e.next=4,_(t,!0);case 4:return i=e.sent,L.appendChild(i),L.refresh=(0,a.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,S(new Date);case 2:m(r,i),v(r);case 4:case"end":return e.stop()}}),e)}))),c.store.updater.addDownstreamChangeListener(n,L.refresh),U=i,H.messageTable=U,e.abrupt("return",i);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)},A=function(){return T.apply(this,arguments)},C=function(){return(C=(0,a.default)(o.default.mark((function e(){var t,n,r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((t=R.leafDocumentFromDate(new Date)).sameTerm(H.messageTable.chatDocument)){e.next=7;break}return U.inputRow&&(U.removeChild(U.inputRow),delete U.inputRow),n=H.messageTable.chatDocument,e.next=6,A();case 6:if(!c.store.holds(n,d.rdfs("seeAlso"),t,n)){r=[s.st(n,d.rdfs("seeAlso"),t,n)];try{c.store.updater.update([],r)}catch(e){alert("Unable to link old chat file to new one:"+e)}}case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)},S=function(){return C.apply(this,arguments)},k=function(e,n){var r,s;function u(){return f.apply(this,arguments)}function f(){return(f=(0,a.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b(!0);case 2:return(t=e.sent)?(r&&(r.firstChild.setAttribute("src",l.icons.iconBase+"noun_T-Block_1114655_000000.svg"),r.disabled=!0),k.initial=!0):k.extendedBack=!0,m(),e.abrupt("return",t);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function m(){if(r){var e=k.extendedBack?!N:N,t=k.initial?"noun_T-Block_1114655_000000.svg":function(e){return e?"noun_1369241.svg":"noun_1369237.svg"}(e);r.firstChild.setAttribute("src",l.icons.iconBase+t)}}function v(){return(v=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!k.extendedBack){e.next=6;break}x(!0,k),k.extendedBack=!1,m(),e.next=8;break;case 6:return e.next=8,u();case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function y(){return w.apply(this,arguments)}function w(){return(w=(0,a.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b(!1);case 2:return(t=e.sent)?(s.firstChild.setAttribute("src",l.icons.iconBase+"noun_T-Block_1114655_000000.svg"),s.disabled=!0,k.final=!0):k.extendedForwards=!0,_(),e.abrupt("return",t);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _(){var e=k.extendedForwards?!N:N,t=k.final?"noun_T-Block_1114657_000000.svg":function(e){return e?"noun_1369237.svg":"noun_1369241.svg"}(e);s.firstChild.setAttribute("src",l.icons.iconBase+t)}function E(){return(E=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!k.extendedForwards){e.next=6;break}x(!1,k),k.extendedForwards=!1,_(),e.next=9;break;case 6:return e.next=8,y();case 8:H.messageTable.scrollIntoView(N);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var k=t.createElement("table");k.extendBackwards=u,k.extendForwards=y,k.date=e;var S=R.leafDocumentFromDate(e);if(k.chatDocument=S,k.fresh=!1,k.setAttribute("style","width: 100%;"),n){k.final=!0,U=k,H.messageTable=k;var C=(0,h.renderMessageEditor)(F,k,M,i);N?k.insertBefore(C,k.firstChild):k.appendChild(C),k.inputRow=C}if(i.infinite){var A=t.createElement("tr"),T=A.appendChild(t.createElement("td")),O=N?"noun_1369241.svg":"noun_1369237.svg";r=p.button(t,l.icons.iconBase+O,"Previous messages ..."),T.style="width:3em; height:3em;",r.addEventListener("click",(function(e){return v.apply(this,arguments)}),!1),k.extendedBack=!1,T.appendChild(r),m();var P=A.appendChild(t.createElement("td"));P.style="text-align: center; vertical-align: middle; color: #888; font-style: italic;",P.textContent=p.shortDate(e.toISOString(),!0);var I=A.appendChild(t.createElement("td")),j=N?"noun_1369241.svg":"noun_1369237.svg";s=p.button(t,l.icons.iconBase+j,"Later messages ..."),I.appendChild(s),I.style="width:3em; height:3em;",s.addEventListener("click",(function(e){return E.apply(this,arguments)}),!1),k.extendedForward=!1,_(),k.extendedForwards=!1,N?k.appendChild(A):k.insertBefore(A,k.firstChild)}var L=c.store.statementsMatching(null,d.wf("message"),null,S);return!n&&L.length,L.forEach((function(e){g(e.object,k)})),k.fresh=!0,k.fresh=!1,k},E=function(){return(E=(0,a.default)(o.default.mark((function e(n,r){var i,a,s;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u.log(" createMessageTable for "+n),i=R.leafDocumentFromDate(n),e.prev=2,e.next=5,c.store.fetcher.load(i);case 5:e.next=19;break;case 7:if(e.prev=7,e.t0=e.catch(2),a=t.createElement("table"),s=a.appendChild(t.createElement("tr")),!e.t0.response||!e.t0.response.status||404!==e.t0.response.status){e.next=16;break}return u.log("Error 404 for chat file "+i),e.abrupt("return",k(n,r));case 16:u.log("*** Error NON 404 for chat file "+i),s.appendChild(p.errorMessageBlock(t,e.t0,"pink"));case 18:return e.abrupt("return",s);case 19:return e.abrupt("return",k(n,r));case 20:case"end":return e.stop()}}),e,null,[[2,7]])})))).apply(this,arguments)},_=function(e,t){return E.apply(this,arguments)},x=function(e,t){if(e?N:!N)for(;t.nextSibling;)L.removeChild(t.nextSibling);else for(;t.previousSibling;)L.removeChild(t.previousSibling);(e?B:H).messageTable=t},w=function(){return(w=(0,a.default)(o.default.mark((function e(t){var n,r,i,a,s,c;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=(n=t?B:H).messageTable.date,e.next=4,R.loadPrevious(r,t);case 4:if(r=e.sent,u.log("insertPreviousMessages: from ".concat(t?"backwards":"forwards"," loadPrevious: ").concat(r)),r||t||U){e.next=9;break}return e.next=9,A();case 9:if(r){e.next=11;break}return e.abrupt("return",!0);case 11:return i=!1,t||(a=R.leafDocumentFromDate(new Date),s=R.leafDocumentFromDate(r),i=s.sameTerm(a)),e.next=15,_(r,i);case 15:return c=e.sent,n.messageTable=c,(t?N:!N)?L.appendChild(c):L.insertBefore(c,L.firstChild),e.abrupt("return",i);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)},b=function(e){return w.apply(this,arguments)},g=function(e,t){var n=(0,f.mostRecentVersion)(e);(0,f.isDeleted)(n)&&!i.showDeletedMessages||y(F,t,e,t.fresh,i,M)},m=function(e,t){var n,r,i={};for(n=t.firstChild;n;n=n.nextSibling)n.AJAR_subject&&(i[n.AJAR_subject.uri]=!0);var o=c.store.statementsMatching(e,d.wf("message"),null,t.chatDocument).map((function(e){return e.object})),a={};for(o.forEach((function(e){a[e.uri]=!0,i[e.uri]||g(e,t)})),n=t.firstChild;n;)r=n.nextSibling,n.AJAR_subject&&!a[n.AJAR_subject.uri]&&t.removeChild(n),n=r;for(n=t.firstChild;n;n=n.nextSibling)n.AJAR_subject&&p.refreshTree(n)},(i=i||{}).authorDateOnLeft=!1,N="1"===i.newestFirst||!0===i.newestFirst,F=new f.ChatChannel(r,i),R=F.dateFolder,L=t.createElement("div"),F.div=L,D=L.appendChild(t.createElement("div")),M={dom:t,statusArea:D,div:D},B={messageTable:null},H={messageTable:null},q=!1,e.next=30,I();case 30:return e.abrupt("return",L);case 31:case"end":return e.stop()}}),e)}))),b.apply(this,arguments)}},1305:(e,t,n)=>{"use strict";var r=n(4836),i=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.creatorAndDate=I,t.creatorAndDateHorizontal=j,t.elementForImageURI=T,t.renderMessageEditor=N,t.renderMessageRow=function(e,t,n,r,i){var o="1"===r.colorizeByAuthor||!0===r.colorizeByAuthor,a=f.store.any(t,g.foaf("maker")),s=f.store.any(t,g.dct("created")),u=(0,l.mostRecentVersion)(t),d=f.store.any(u,g.sioc("content")),h=(0,l.originalVersion)(t),m=!t.sameTerm(h),y=f.store.the(h,g.dct("created"),null,h.doc()),b=S.createElement("tr");b.AJAR_date=y.value,b.AJAR_subject=t;var x=S.createElement("td");if(b.appendChild(x),r.authorDateOnLeft)I(x,a,w.shortDate(y.value),t);else{var _=S.createElement("img");_.setAttribute("style","max-height: 2.5em; max-width: 2.5em; border-radius: 0.5em; margin: auto;"),w.setImage(_,a),x.appendChild(_)}var E=w.shortDate(y.value);m&&(E+=" ... "+w.shortDate(s.value));var k=b.appendChild(S.createElement("td"));r.authorDateOnLeft||j(k,a,E,t);var A=d.value.trim(),O=null;if(/^https?:\/[^ <>]*$/i.test(A))if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(A)&&r.expandImagesInline){var P=T(A,r);k.appendChild(P)}else{var N=k.appendChild(S.createElement("a"));O=N.appendChild(S.createElement("p")),N.href=A,O.textContent=A,k.appendChild(N)}else O=S.createElement("p"),k.appendChild(O),O.textContent=A;if(O){var F=o?v.lightColorHash(a):function(e){return e?"#e8ffe8":"white"}(n);O.setAttribute("style",C+"background-color: "+F+";")}var R=(0,c.sentimentStripLinked)(t,t.doc());R.children.length&&(k.appendChild(S.createElement("br")),k.appendChild(R));var L=S.createElement("td");b.appendChild(L);var D=w.button(S,p.icons.iconBase+"noun_243787.svg","...");return L.appendChild(D),D.addEventListener("click",(function(n){if(b.toolTR)return b.parentNode.removeChild(b.toolTR),void delete b.toolTR;var r=S.createElement("tr"),o=(0,c.messageToolbar)(t,b,i,e);o.style="border: 0.05em solid #888; border-radius: 0 0 0.7em 0.7em; border-top: 0; height:3.5em; background-color: #fff;",b.nextSibling?b.parentElement.insertBefore(r,b.nextSibling):b.parentElement.appendChild(r),b.toolTR=r,r.appendChild(S.createElement("td"));var a=r.appendChild(S.createElement("td"));r.appendChild(S.createElement("td")),a.appendChild(o)})),b},t.switchToEditor=function(e,t,n,r){var i=e.parentNode,o=N(n,i,r,n.options,(0,l.mostRecentVersion)(t));i.insertBefore(o,e),o.originalRow=e,e.style.visibility="hidden"};var o=r(n(4687)),a=r(n(7156)),s=n(1786),c=n(6126),u=n(3060),l=n(6712),d=_(n(4433)),p=n(1124),f=n(166),h=n(3210),m=n(2843),g=_(n(6590)),v=_(n(4004)),y=_(n(2853)),b=_(n(5666)),w=_(n(2457));function x(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(x=function(e){return e?n:t})(e)}function _(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var n=x(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}function E(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var S=window.document,C=y.messageBodyStyle,A=b.label;function T(e,t){var n=S.createElement("img"),r="10";t.inlineImageHeightEms&&(r=(""+t.inlineImageHeightEms).trim()),n.setAttribute("style","max-height: "+r+"em; border-radius: 1em; margin: 0.7em;"),e&&n.setAttribute("src",e);var i=S.createElement("a");return i.setAttribute("href",e),i.setAttribute("target","images"),i.appendChild(n),w.makeDraggable(n,$rdf.sym(e)),i}var O=function(e,t){var n=S.createElement("a");return t&&t.uri&&(n.setAttribute("href",t.uri),n.addEventListener("click",w.openHrefInOutlineMode,!0),n.setAttribute("style","color: #3B5998; text-decoration: none; ")),n.textContent=e,n};function P(e){var t=f.store.any(e,g.foaf("nick"));return t?""+t.value:""+A(e)}function I(e,t,n,r){var i=e.appendChild(O(P(t),t));t.uri&&f.store.fetcher.nowOrWhenFetched(t.doc(),void 0,(function(e,n){i.textContent=P(t)})),e.appendChild(S.createElement("br")),e.appendChild(O(n,r))}function j(e,t,n,r){var i=e.appendChild(O(A(t),t));t.uri&&f.store.fetcher.nowOrWhenFetched(t.doc(),void 0,(function(e,n){i.textContent=P(t)}));var o=e.appendChild(O(n,r));o.style.fontSize="80%",o.style.marginLeft="1em",e.appendChild(S.createElement("br"))}function N(e,t,n,r,i){function c(e){return l.apply(this,arguments)}function l(){return(l=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b(O.value,!0);case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function b(e,t){return x.apply(this,arguments)}function x(){return(x=(0,a.default)(o.default.mark((function a(c,u){var l,p;return o.default.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return l=function(o,a){if((0,s.insertMessageIntoTable)(e,t,o,!1,r,n),i){var c=j.originalRow;c.parentNode?c.parentNode.removeChild(c):(d.warn("No parentNode on old message "+c.textContent),c.style.backgroundColor="#fee",c.style.visibility="hidden"),j.parentNode.removeChild(j)}else u&&(O.value="",O.setAttribute("style",C),O.disabled=!1,O.scrollIntoView(r.newestFirst),O.focus(),O.select())},u&&(O.setAttribute("style",C+"color: #bbb;"),O.disabled=!0),o.prev=2,o.next=5,e.updateMessage(c,i);case 5:p=o.sent,o.next=13;break;case 8:return o.prev=8,o.t0=o.catch(2),(n.statusArea||j).appendChild(w.errorMessageBlock(S,"Error writing message: "+o.t0)),o.abrupt("return");case 13:l(p,c);case 14:case"end":return o.stop()}}),a,null,[[2,8]])})))).apply(this,arguments)}function _(e){var n=t.chatDocument.dir().uri;w.uploadFiles(f.store.fetcher,e,n+"Files",n+"Pictures",function(){var e=(0,a.default)(o.default.mark((function e(t,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b(n);case 2:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}())}var k,A,T=function(){var e=(0,a.default)(o.default.mark((function e(t){var n,r,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=E(t),e.prev=1,n.s();case 3:if((r=n.n()).done){e.next=9;break}return i=r.value,e.next=7,b(i);case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),n.e(e.t0);case 14:return e.prev=14,n.f(),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[1,11,14,17]])})));return function(t){return e.apply(this,arguments)}}();i?(k=f.store.anyValue(i,g.dct("created"),null,i.doc()),A=p.icons.iconBase+"noun_1180158.svg"):(A=p.icons.iconBase+"noun_383448.svg",k="9999-01-01T00:00:00Z");var O,P,j=S.createElement("tr"),N=S.createElement("td"),F=S.createElement("td"),R=S.createElement("td");j.appendChild(N),j.appendChild(F),j.appendChild(R),j.AJAR_date=k;var L={div:F,dom:S};return(0,h.ensureLoggedIn)(L).then((function(t){!function(){function t(){return(t=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=3;break}return e.next=3,b(t.uri);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}if(r.menuHandler){var n=w.button(S,p.icons.iconBase+"noun_243787.svg","More");n.setAttribute("style",y.buttonStyle+"float: right;"),R.appendChild(n)}r.menuHandler;var s=f.authn.currentUser();if(I(N,s,"",null),O=S.createElement("textarea"),F.innerHTML="",F.appendChild(O),O.rows=3,i&&(O.value=f.store.anyValue(i,g.sioc("content"),null,i.doc())),O.setAttribute("style",C+"background-color: #eef;"),O.addEventListener("keydown",function(){var e=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("Enter"!==t.code){e.next=4;break}if(!(!t.shiftKey&&!r.shiftEnterSendsMessage||t.shiftKey&&r.shiftEnterSendsMessage)){e.next=4;break}return e.next=4,c(t);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),!1),w.makeDropTarget(O,T,_),R.innerHTML="",(P=w.button(S,A,"Send")).style.float="right",P.addEventListener("click",(function(e){return c()}),!1),R.appendChild(P),i){var u=R.appendChild(w.cancelButton(S));u.style.float="left",u.addEventListener("click",(function(e){return function(e){e.originalRow.style.visibility="visible",e.parentNode.removeChild(e)}(j)}),!1),R.appendChild(u)}var l=e.dateFolder.leafDocumentFromDate(new Date);F.appendChild(m.media.cameraButton(S,f.store,(function(){return $rdf.sym(l.dir().uri+"Image_"+Date.now()+".png")}),(function(e){return t.apply(this,arguments)}))),v.recordParticipation(e.channel,e.channel.doc())}(),Object.assign(t,n),(0,u.findBookmarkDocument)(t).then((function(e){}))})),j}},6126:(e,t,n)=>{"use strict";var r=n(4836),i=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.messageToolbar=function(e,t,n,r){function i(){return(i=(0,a.default)(o.default.mark((function i(){var a,s;return o.default.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(a=m.store.any(e,l.foaf("maker")),E){i.next=5;break}alert("You can't delete the message, you are not logged in."),i.next=22;break;case 5:if(!E.sameTerm(a)){i.next=21;break}return i.prev=6,i.next=9,r.deleteMessage(e);case 9:i.next=18;break;case 11:i.prev=11,i.t0=i.catch(6),s="Error deleting messaage "+i.t0,c.warn(s),alert(s),(n.statusArea||t.parentNode).appendChild(f.errorMessageBlock(w,s));case 18:t.parentNode.removeChild(t),i.next=22;break;case 21:alert("You can't delete the message, you are not logged in as the author, "+a);case 22:b();case 23:case"end":return i.stop()}}),i,null,[[6,11]])})))).apply(this,arguments)}function s(){return s=(0,a.default)(o.default.mark((function t(i){return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:E.value===m.store.any(e,l.foaf("maker")).value&&(b(),(0,v.switchToEditor)(i,e,r,n));case 1:case"end":return t.stop()}}),t)}))),s.apply(this,arguments)}var y=w.createElement("div");if((0,g.mostRecentVersion)(e).value===l.schema("dateDeleted").value)return y;function b(){y.parentElement.parentElement.removeChild(y.parentElement)}function x(e){return _.apply(this,arguments)}function _(){return(_=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,m.store.updater.update(m.store.connectedStatements(t),[]);case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var E=m.authn.currentUser();function k(e,n,r,i,s,c){function u(){g.style.backgroundColor=h?"yellow":"white"}var h,g=f.button(w,r,p.label(i),function(){var r=(0,a.default)(o.default.mark((function r(a){var p,g,y,b;return o.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!h){r.next=7;break}return r.next=3,x(h);case 3:h=null,u(),r.next=25;break;case 7:return h=f.newThing(s),p=[d.st(h,l.schema("agent"),e.me,s),d.st(h,l.rdf("type"),i,s),d.st(h,l.schema("target"),n,s)],r.next=11,m.store.updater.update([],p);case 11:if(u(),!c){r.next=25;break}g=!1,y=0;case 15:if(!(y<c.length)){r.next=24;break}if(!(b=v(c[y]))){r.next=21;break}return r.next=20,x(b);case 20:g=!0;case 21:y++,r.next=15;break;case 24:g&&f.refreshTree(t);case 25:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}());function v(t){var r=m.store.each(null,l.schema("agent"),e.me,s).filter((function(e){return m.store.holds(e,l.rdf("type"),t,s)})).filter((function(e){return m.store.holds(e,l.schema("target"),n,s)}));return r.length?r[0]:null}function y(){h=v(i),u()}return g.refresh=y,y(),g}if(E&&m.store.holds(e,l.foaf("maker"),E)&&(y.appendChild(f.deleteButtonWithCheck(w,y,"message",(function(){return i.apply(this,arguments)}))),y.appendChild(f.button(w,u.icons.iconBase+"noun_253504.svg","edit",(function(){return function(e){return s.apply(this,arguments)}(t)})))),(0,h.renderBookmarksButton)(n).then((function(e){e&&y.appendChild(e)})),(E=m.authn.currentUser())&&(0,g.mostRecentVersion)(e).value!==l.schema("dateDeleted").value){var S={me:E,dom:w,div:y};y.appendChild(k(S,e,u.icons.iconBase+"noun_1384132.svg",l.schema("AgreeAction"),e.doc(),[l.schema("DisagreeAction")])),y.appendChild(k(S,e,u.icons.iconBase+"noun_1384135.svg",l.schema("DisagreeAction"),e.doc(),[l.schema("AgreeAction")]))}var C=y.appendChild(f.cancelButton(w));return C.style.float="right",C.firstChild.style.opacity="0.3",C.addEventListener("click",b),y},t.sentimentStrip=function(e,t){var n=(0,g.mostRecentVersion)(e),r=(m.store.holds(n,l.schema("dateDeleted").value,null,n.doc())?m.store.each(null,l.schema("target"),e,t):[]).map((function(e){return m.store.any(e,l.rdf("type"),null,t)}));r.sort();var i=r.map((function(e){return x[e]||""}));return w.createTextNode(i.join(" "))},t.sentimentStripLinked=function(e,t){var n=w.createElement("span");function r(){n.innerHTML="";var r=((0,g.mostRecentVersion)(e).uri!==l.schema("dateDeleted").uri?m.store.each(null,l.schema("target"),e,t):[]).map((function(e){return[m.store.any(e,l.rdf("type"),null,t),m.store.any(e,l.schema("agent"),null,t)]}));r.sort(),r.forEach((function(e){var t,r=(0,s.default)(e,2),i=r[0],o=r[1];o?(t=w.createElement("a")).setAttribute("href",o.uri):t=w.createTextNode(""),t.textContent=x[i]||"*",n.appendChild(t)}))}return r(),n.refresh=r,n};var o=r(n(4687)),a=r(n(7156)),s=r(n(7424)),c=b(n(4433)),u=n(1124),l=b(n(6590)),d=b(n(6022)),p=b(n(5666)),f=b(n(2457)),h=n(3060),m=n(166),g=n(6712),v=n(1305);function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(y=function(e){return e?n:t})(e)}function b(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var n=y(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}var w=window.document,x={};x[l.schema("AgreeAction")]="👍",x[l.schema("DisagreeAction")]="👎",x[l.schema("EndorseAction")]="⭐️",x[l.schema("LikeAction")]="❤️"},4615:(e,t,n)=>{"use strict";var r=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.newThingUI=function(e,t,n){var r=e.dom,i=e.div;if(e.me&&!e.me.uri)throw new Error("newThingUI: Invalid userid: "+e.me);var d="padding: 0.7em; width: 2em; height: 2em;",p=i.appendChild(r.createElement("img")),h=!1;p.setAttribute("src",a.icons.iconBase+"noun_34653_green.svg"),p.setAttribute("style",d),p.setAttribute("title","Add another tool");var m=function(e){var t=i.appendChild(r.createElement("pre"));t.setAttribute("style","background-color: pink"),t.appendChild(r.createTextNode(e))};function g(e){for(var t=0;t<y.length;t++){var n=d+e;y[t].disabled&&(n+="opacity: 0.3;"),y[t].setAttribute("style",n)}}function v(e){h=!h,p.setAttribute("style",d+(h?"background-color: yellow;":"")),g(h?"":"display: none;")}p.addEventListener("click",v);var y=[],b=Object.values(n).filter((function(e){return e.mintNew})),w=b.reduce((function(e,t){return t.mintClass&&(e[t.mintClass.uri]=(e[t.mintClass.uri]||0)+1),e}),{});b.forEach((function(n){var i=e.div.appendChild(r.createElement("img"));i.setAttribute("src",n.icon);var a=n.mintClass?w[n.mintClass.uri]>1?"".concat(u.label(n.mintClass)," (using ").concat(n.name," pane)"):u.label(n.mintClass):n.name+" @@";i.setAttribute("title","Make new "+a),i.setAttribute("style",d+"display: none;"),y.push(i),i.disabled||i.addEventListener("click",(function(p){var h;!function(e){g("display: none;"),e.setAttribute("style",d+"background-color: yellow;")}(i),h={event:p,folder:e.folder||null,iconEle:i,pane:n,noun:a,noIndexHTML:!0,div:e.div,me:e.me,dom:e.dom,refreshTarget:e.refreshTarget},new Promise((function(n,i){var a;function d(n,a){(0,s.ensureLoadedProfile)(e).then((function(e){var s=Object.assign({newBase:a,folder:h.folder||void 0,workspace:n},h);for(var u in h)s[u]=h[u];o.log("newThingUI: Minting new ".concat(s.pane.name," at ").concat(s.newBase)),h.pane.mintNew(t,s).then((function(e){if(!e||!e.newInstance)throw new Error("Cannot mint new - missing newInstance");if(e.folder){var t=e.newInstance.uri.slice(e.folder.uri.length).includes("/");o.log(" new thing is packge? "+t),t?f.add(e.folder,c.ldp("contains"),f.sym(e.newBase),e.folder.doc()):f.add(e.folder,c.ldp("contains"),e.newInstance,e.folder.doc()),e.refreshTarget&&e.refreshTarget.refresh&&e.refreshTarget.refresh()}else{var n=h.div.appendChild(r.createElement("p"));n.setAttribute("style","font-size: 120%;"),n.innerHTML="Your <a target='_blank' href='"+e.newInstance.uri+"'><b>new "+h.noun+"</b></a> is ready to be set up. <br/><br/><a target='_blank' href='"+e.newInstance.uri+"'>Go to your new "+h.noun+".</a>"}v()})).catch((function(e){m(e),i(e)}))}),(function(e){m("Error logging on: "+e)}))}var p=h.pane;h.noun=p.mintClass?u.label(p.mintClass):p.name,h.appPathSegment=h.noun.slice(0,1).toUpperCase()+h.noun.slice(1),h.folder?l.askName(r,f,h.div,c.foaf("name"),null,h.noun).then((function(e){if(e){var t=h.folder.uri;t.endsWith("/")||(t+="/"),d(null,t=t+encodeURIComponent(e)+"/")}else v()})):(a=(0,s.selectWorkspace)(r,{noun:h.noun,appPathSegment:h.appPathSegment},d),h.div.appendChild(a))}))}))}))};var i=n(166),o=p(n(4433)),a=n(1124),s=n(3210),c=p(n(6590)),u=p(n(5666)),l=p(n(2457));function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}function p(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,n&&n.set(e,i),i}var f=i.solidLogicSingleton.store},9056:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.create=void 0;var r={newThingUI:n(4615).newThingUI};t.create=r},5438:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4433:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.error=function(){var e;(e=console).error.apply(e,arguments)},t.log=function(){var e;(e=console).log.apply(e,arguments)},t.trace=function(){var e;(e=console).trace.apply(e,arguments)},t.warn=function(){var e;(e=console).warn.apply(e,arguments)}},9459:(e,t,n)=>{"use strict";var r=n(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.createControllerInfoBlock=l,t.initFooter=function(e,t){return c.apply(this,arguments)},t.rebuildFooter=u;var i=r(n(4687)),o=r(n(7156)),a=n(166),s=n(2665);function c(){return(c=(0,o.default)(i.default.mark((function e(t,n){var r,o,c;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=document.getElementById("PageFooter")){e.next=3;break}return e.abrupt("return");case 3:return o=(0,s.getPod)(),e.next=6,(0,s.getPodOwner)(o,t);case 6:c=e.sent,u(r,t,o,c,n)(),a.authSession.onLogin(u(r,t,o,c,n)),a.authSession.onLogout(u(r,t,o,c,n));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function u(e,t,n,r,s){return(0,o.default)(i.default.mark((function o(){var c;return i.default.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return c=a.authn.currentUser(),e.innerHTML="",i.t0=e,i.next=5,l(t,c,n,r,s);case 5:i.t1=i.sent,i.t0.appendChild.call(i.t0,i.t1);case 7:case"end":return i.stop()}}),o)})))}function l(e,t,n,r,i){var o=document.createElement("div");if(!n||!r||t&&t.equals(r))return o;(0,s.addStyleClassToElement)(o,["footer-pod-info","footer"],"footer");var a=document.createElement("span");a.innerText="You're visiting ";var c=document.createElement("a");c.href=n.uri,c.innerText="the Pod";var u=document.createElement("span");u.innerText=" controlled by ";var l=document.createElement("a");l.href=r.uri,l.innerText=(0,s.getName)(e,r);var d=document.createElement("span");d.innerText=". For more info, check out ";var p=document.createElement("a");p.href=i&&i.solidProjectUrl?i.solidProjectUrl:"https://solidproject.org",p.innerText=i&&i.solidProjectName?i.solidProjectName:"solidproject.org";var f=document.createElement("span");return f.innerText=".",o.appendChild(a),o.appendChild(c),o.appendChild(u),o.appendChild(l),o.appendChild(d),o.appendChild(p),o.appendChild(f),o}},8154:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.styleMap=void 0,t.styleMap={footer:{borderTop:"solid 1px $divider-color",fontSize:"0.9em",padding:"0.5em 1.5em"}}},2864:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.emptyProfile=void 0,t.emptyProfile='\n<svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" viewBox="0 0 26 26" fill="none">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M13 25C19.6274 25 25 19.6274 25 13C25 6.37258 19.6274 1 13 1C6.37258 1 1 6.37258 1 13C1 19.6274 6.37258 25 13 25Z" fill="#D8D8D8" stroke="#8B8B8B"/>\n <mask id="mask0" mask-type="alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="26" height="26">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M13 25C19.6274 25 25 19.6274 25 13C25 6.37258 19.6274 1 13 1C6.37258 1 1 6.37258 1 13C1 19.6274 6.37258 25 13 25Z" fill="white" stroke="white"/>\n </mask>\n <g mask="url(#mask0)">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M17.0468 10.4586C17.0468 14.4979 15.4281 16.9214 12.9999 16.9214C10.5718 16.9214 8.95298 14.4979 8.95298 10.4586C8.95298 6.41931 12.9999 6.41931 12.9999 6.41931C12.9999 6.41931 17.0468 6.41931 17.0468 10.4586ZM4.09668 23.3842C6.52483 17.7293 12.9999 17.7293 12.9999 17.7293C12.9999 17.7293 19.475 17.7293 21.9031 23.3842C21.9031 23.3842 17.8481 25 12.9999 25C8.15169 25 4.09668 23.3842 4.09668 23.3842Z" fill="#8B8B8B"/>\n </g>\n</svg>'},1397:(e,t,n)=>{"use strict";var r=n(4836),i=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.createBanner=y,t.createHelpMenu=w,t.createLoginSignUpButtons=x,t.createUserMenu=k,t.createUserMenuButton=_,t.createUserMenuItem=C,t.createUserMenuLink=E,t.getProfileImg=A,t.initHeader=function(e,t,n){return g.apply(this,arguments)},t.rebuildHeader=v;var o=r(n(4687)),a=r(n(7156)),s=n(1568),c=n(166),u=n(3210),l=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(2457)),d=n(2864),p=n(2665);function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}var h=s.icons.iconBase+"noun_help.svg",m="https://solidproject.org/assets/img/solid-emblem.svg";function g(){return(g=(0,a.default)(o.default.mark((function e(t,n,r){var i,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=document.getElementById("PageHeader")){e.next=3;break}return e.abrupt("return");case 3:a=(0,p.getPod)(),v(i,t,a,n,r)(),c.authSession.onLogout(v(i,t,a,n,r)),c.authSession.onLogin(v(i,t,a,n,r));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function v(e,t,n,r,i){return(0,a.default)(o.default.mark((function a(){var s;return o.default.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return s=c.authn.currentUser(),e.innerHTML="",o.t0=e,o.next=5,y(t,n,s,r,i);case 5:o.t1=o.sent,o.t0.appendChild.call(o.t0,o.t1);case 7:case"end":return o.stop()}}),a)})))}function y(e,t,n,r,i){return b.apply(this,arguments)}function b(){return(b=(0,a.default)(o.default.mark((function e(t,n,r,i,a){var s,c,u,l,d,f;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((s=document.createElement("a")).href=n.uri,(0,p.addStyleClassToElement)(s,["header-banner__link"]),c=document.createElement("img"),a&&(c.src=a.logo?a.logo:m),(0,p.addStyleClassToElement)(c,["header-banner__icon"]),s.appendChild(c),!r){e.next=13;break}return e.next=10,k(t,r,i);case 10:e.t0=e.sent,e.next=14;break;case 13:e.t0=x();case 14:return u=e.t0,l=document.createElement("div"),(0,p.addStyleClassToElement)(l,["header-banner"]),l.appendChild(s),d=document.createElement("div"),(0,p.addStyleClassToElement)(d,["header-banner__right-menu"]),d.appendChild(u),a&&a.helpMenuList&&(f=w(a,a.helpMenuList),d.appendChild(f)),l.appendChild(d),e.abrupt("return",l);case 24:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function w(e,t){if(t){var n=document.createElement("ul");(0,p.addStyleClassToElement)(n,["header-user-menu__list"]),t.forEach((function(e){"url"==(e.url?"url":"onclick")?n.appendChild(C(E(e.label,e.url,e.target))):n.appendChild(C(_(e.label,e.onclick)))}));var r=document.createElement("nav");(0,p.addStyleClassToElement)(r,["header-user-menu__navigation-menu"]),r.setAttribute("aria-hidden","true"),r.appendChild(n);var i=document.createElement("div");(0,p.addStyleClassToElement)(i,["header-banner__user-menu"]),(0,p.addStyleClassToElement)(i,["header-user-menu"]),i.appendChild(r);var o=document.createElement("button");(0,p.addStyleClassToElement)(o,["header-user-menu__trigger"]),o.type="button";var a=document.createElement("img");a.src=e&&e.helpIcon?e.helpIcon:s.icons.iconBase+h,(0,p.addStyleClassToElement)(a,["header-banner__help-icon"]),i.appendChild(o),o.appendChild(a);var c=(0,p.throttle)((function(e){return T(e,o,r)}),50);o.addEventListener("click",c);var u=setTimeout((function(){return null}),0);return i.addEventListener("mouseover",(function(e){clearTimeout(u),c(e)})),i.addEventListener("mouseout",(function(e){u=setTimeout((function(){return c(e)}),200)})),i}}function x(){var e=document.createElement("div");return(0,p.addStyleClassToElement)(e,["header-banner__login"]),e.appendChild((0,u.loginStatusBox)(document,null,{})),e}function _(e,t){var n=document.createElement("button");return(0,p.addStyleClassToElement)(n,["header-user-menu__button"]),n.addEventListener("click",t),n.innerText=e,n}function E(e,t,n){var r=document.createElement("a");return(0,p.addStyleClassToElement)(r,["header-user-menu__link"]),r.href=t,r.innerText=e,n&&(r.target=n),r}function k(e,t,n){return S.apply(this,arguments)}function S(){return(S=(0,a.default)(o.default.mark((function e(t,n,r){var i,a,s,c,u,l,d,f;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(i=t.fetcher)){e.next=4;break}return e.next=4,i.load(n);case 4:return a=document.createElement("ul"),(0,p.addStyleClassToElement)(a,["header-user-menu__list"]),r&&r.forEach((function(e){"url"==(e.url?"url":"onclick")?a.appendChild(C(E(e.label,e.url,e.target))):a.appendChild(C(_(e.label,e.onclick)))})),s=document.createElement("nav"),(0,p.addStyleClassToElement)(s,["header-user-menu__navigation-menu"]),s.setAttribute("aria-hidden","true"),s.appendChild(a),c=document.createElement("button"),(0,p.addStyleClassToElement)(c,["header-user-menu__trigger"]),c.type="button","string"==typeof(u=A(0,n))?c.innerHTML=u:c.appendChild(u),l=document.createElement("div"),(0,p.addStyleClassToElement)(l,["header-banner__user-menu"]),(0,p.addStyleClassToElement)(l,["header-user-menu"]),l.appendChild(c),l.appendChild(s),d=(0,p.throttle)((function(e){return T(e,c,s)}),50),c.addEventListener("click",d),f=setTimeout((function(){return null}),0),l.addEventListener("mouseover",(function(e){clearTimeout(f),d(e)})),l.addEventListener("mouseout",(function(e){f=setTimeout((function(){return d(e)}),200)})),e.abrupt("return",l);case 27:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function C(e){var t=document.createElement("li");return(0,p.addStyleClassToElement)(t,["header-user-menu__list-item"]),t.appendChild(e),t}function A(e,t){var n=null;try{if(!(n=l.findImage(t)))return d.emptyProfile}catch(e){return d.emptyProfile}var r=document.createElement("div");return(0,p.addStyleClassToElement)(r,["header-user-menu__photo"]),r.style.backgroundImage="url(".concat(n,")"),r}function T(e,t,n){var r="true"===t.getAttribute("aria-expanded"),i="mouseover"===e.type,o="mouseout"===e.type;r&&i||!r&&o||(t.setAttribute("aria-expanded",(!r).toString()),n.setAttribute("aria-hidden",r.toString()))}},366:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.styleMap=void 0,t.styleMap={"header-user-menu":{},"header-user-menu__link":{background:"none",border:"0",color:"black",cursor:"pointer",display:"block",fontFamily:"Arial",fontSize:"1em",textAlign:"left",padding:"1em",width:"100%","&:focus, &:hover":{backgroundColor:"linear-gradient(to right, #7C4DFF 0%, #18A9E6 50%, #01C9EA 100%)"},a:{textDecoration:"none"}},"header-user-menu__trigger":{background:"none",border:"0",cursor:"pointer",width:"60px",height:"60px",img:{borderRadius:"50%",height:"56px",width:"56px"}},"header-user-menu__button":{background:"none",border:"0",color:"black",cursor:"pointer",display:"block",fontFamily:"Arial",fontSize:"1em",textAlign:"left",padding:"1em",width:"100%","&:focus, &:hover":{backgroundColor:"linear-gradient(to right, #7C4DFF 0%, #18A9E6 50%, #01C9EA 100%)"}},"header-user-menu__list":{listStyle:"none",margin:"0",padding:"0"},"header-user-menu__navigation-menu":{background:"white",border:"solid 1px #000000",borderRight:"0",position:"absolute",right:"0",top:"60px",width:"200px","z-index":"1","&[aria-hidden = true]":{display:"none"}},"header-user-menu__list-item":{borderBottom:"solid 1px #000000","&:last-child":{border:"0"}},"header-user-menu__photo":{borderRadius:"50%",backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"cover",height:"50px",width:"50px"},"header-banner":{boxShadow:"0px 1px 4px #000000",display:"flex",justifyContent:"space-between",padding:"0 1.5em",marginBottom:"4px"},"header-banner__link":{display:"block"},"header-banner__right-menu":{display:"flex"},"header-banner__login":{marginLeft:"auto",input:{margin:"0.75em 0 0.75em 0.5em !important",padding:"0.5em !important"}},"header-banner__user-menu":{borderLeft:"solid 1px #000000",marginLeft:"auto"},"header-banner__help-menu":{borderLeft:"solid 1px #000000",marginLeft:"auto"},"header-banner__icon":{backgroundSize:"65px 60px",height:"60px !important",width:"65px !important"},"header-banner__help-icon":{width:"28px !important"}}},1124:(e,t,n)=>{"use strict";e=n.nmd(e),Object.defineProperty(t,"__esModule",{value:!0}),t.originalIconBase=t.icons=t.iconBase=void 0;var r=n(4433),i="https://solidos.github.io/solid-ui/src",o=e.scriptURI?{iconBase:e.scriptURI.slice(0,e.scriptURI.lastIndexOf("/"))+"/icons/",originalIconBase:e.scriptURI.slice(0,e.scriptURI.lastIndexOf("/"))+"/originalIcons/"}:"undefined"!=typeof $SolidTestEnvironment&&$SolidTestEnvironment.iconBase?{iconBase:$SolidTestEnvironment.iconBase,originalIconBase:$SolidTestEnvironment.originalIconBase}:{iconBase:i+"/icons/",originalIconBase:i+"/originalIcons/"};t.icons=o,(0,r.log)(" icons.iconBase is set to : "+o.iconBase);var a=o.iconBase;t.iconBase=a;var s=o.originalIconBase;t.originalIconBase=s},1568:(e,t,n)=>{"use strict";var r=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"acl",{enumerable:!0,get:function(){return a.acl}}),Object.defineProperty(t,"aclControl",{enumerable:!0,get:function(){return a.aclControl}}),Object.defineProperty(t,"authn",{enumerable:!0,get:function(){return T.authn}}),Object.defineProperty(t,"create",{enumerable:!0,get:function(){return s.create}}),t.dom=t.createTypes=void 0,Object.defineProperty(t,"icons",{enumerable:!0,get:function(){return c.icons}}),Object.defineProperty(t,"infiniteMessageArea",{enumerable:!0,get:function(){return h.infiniteMessageArea}}),Object.defineProperty(t,"initFooter",{enumerable:!0,get:function(){return C.initFooter}}),Object.defineProperty(t,"initHeader",{enumerable:!0,get:function(){return S.initHeader}}),t.login=t.log=t.language=void 0,Object.defineProperty(t,"matrix",{enumerable:!0,get:function(){return d.matrix}}),Object.defineProperty(t,"media",{enumerable:!0,get:function(){return p.media}}),Object.defineProperty(t,"messageArea",{enumerable:!0,get:function(){return f.messageArea}}),t.rdf=t.preferences=t.participation=t.pad=t.ns=void 0,Object.defineProperty(t,"store",{enumerable:!0,get:function(){return T.store}}),t.style=void 0,Object.defineProperty(t,"table",{enumerable:!0,get:function(){return b.renderTableViewPane}}),t.utils=t.tabs=void 0,Object.defineProperty(t,"versionInfo",{enumerable:!0,get:function(){return k.versionInfo}}),t.widgets=void 0;var i=P(n(6022));t.rdf=i;var o=P(n(6590));t.ns=o;var a=n(8123),s=n(9056),c=n(1124),u=P(n(8214));t.language=u;var l=P(n(8853));t.log=l;var d=n(7740),p=n(2843),f=n(4440),h=n(1786),m=P(n(4004));t.pad=m;var g=P(n(8412));t.participation=g;var v=P(n(3489));t.preferences=v;var y=P(n(2853));t.style=y;var b=n(303),w=P(n(5084));t.tabs=w;var x=P(n(5666));t.utils=x;var _=P(n(3210));t.login=_;var E=P(n(2457));t.widgets=E;var k=n(7269),S=n(1397),C=n(9459),A=P(n(5438));t.createTypes=A;var T=n(166);function O(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(O=function(e){return e?n:t})(e)}function P(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=O(t);if(n&&n.has(e))return n.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,n&&n.set(e,i),i}var I=window?window.document:null;t.dom=I,"undefined"!=typeof window&&(window.UI={authn:T.authn,store:T.store,ns:o,rdf:i,acl:a.acl,aclControl:a.aclControl,create:s.create,createTypes:A,dom:I,icons:c.icons,language:u,log:l,login:_,matrix:d.matrix,media:p.media,messageArea:f.messageArea,infiniteMessageArea:h.infiniteMessageArea,pad:m,participation:g,preferences:v,style:y,table:b.renderTableViewPane,tabs:w,utils:x,widgets:E,versionInfo:k.versionInfo,initHeader:S.initHeader,initFooter:C.initFooter})},1909:(e,t,n)=>{"use strict";var r=n(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.getClasses=function(e,t){return s(e).createStyleSheet(t).attach()},t.getStylesheet=s;var i=n(8346),o=r(n(8121)),a=new Map;function s(e){var t=a.get(e);if(t)return t;var n=(0,i.create)({insertionPoint:e,plugins:(0,o.default)().plugins});return a.set(e,n),n}},8853:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.LogLevel=void 0,t.alert=function(e){a&&void 0!==a.alert?a.alert(e):c(e)},t.clear=function(){var e,t=null===(e=o)||void 0===e?void 0:e.getElementById("status");t&&(t.innerHTML="")},t.debug=u,t.dumpHTML=function(){var e,t;if(o){var n=r;r=63,u((null===(e=o)||void 0===e||null===(t=e.body)||void 0===t?void 0:t.innerHTML)||""),r=n}},t.error=function(e){s(e,1,"eror")},t.escapeForXML=l,t.info=function(e){s(e,16,"info")},t.logAscending=function(){i=!0},t.logDescending=function(){i=!1},t.msg=function(e){s(e)},t.setInternals=function(e,t){a=e,o=t},t.setLevel=function(e){r=63,u("Log level is now "+e),r=e},t.success=function(e){s(e,8,"good")},t.warn=c,t.LogLevel=n,function(e){e[e.Error=1]="Error",e[e.Warning=2]="Warning",e[e.Message=4]="Message",e[e.Success=8]="Success",e[e.Info=16]="Info",e[e.Debug=32]="Debug",e[e.All=63]="All"}(n||(t.LogLevel=n={}));var r=7,i=!1,o=document,a=window;function s(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"mesg";if(r&t)if(void 0!==o){var a=o.getElementById("status");if(!a)return;var s=o.createElement("span");s.setAttribute("class",n);var c=new Date;s.innerHTML="".concat(c.getHours(),":").concat(c.getMinutes(),":").concat(c.getSeconds()," [").concat(n,"] ").concat(l(e),"<br/>"),i?a.insertBefore(s,a.firstChild):a.appendChild(s)}else"undefined"!=typeof console&&console.log(e)}function c(e){s(e,2,"warn")}function u(e){s(e,32,"dbug")}function l(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}},3210:(e,t,n)=>{"use strict";var r=n(4836),i=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.ensureLoadedPreferences=P,t.ensureLoadedProfile=j,t.ensureLoggedIn=O,t.filterAvailablePanes=function(e){return V.apply(this,arguments)},t.findAppInstances=function(e,t,n){return F.apply(this,arguments)},t.getUserRoles=W,t.loginStatusBox=H,t.newAppInstance=function(e,t,n){var r=function(e,t){n(e,t)},i=e.createElement("div"),o=e.createElement("button");return o.setAttribute("type","button"),i.appendChild(o),o.innerHTML="Make new ".concat(t.noun),o.addEventListener("click",(function(n){i.appendChild(q(e,t,r))}),!1),i.appendChild(o),i},t.registrationControl=function(e,t,n){return L.apply(this,arguments)},t.registrationList=function(e,t){return M.apply(this,arguments)},t.renderScopeHeadingRow=D,t.renderSignInPopup=B,t.scopeLabel=R,t.selectWorkspace=q;var o=r(n(4687)),a=r(n(7156)),s=n(6022),c=n(166),u=v(n(4433)),l=n(8853),d=v(n(6590)),p=n(4412),f=n(2853),h=v(n(5666)),m=v(n(2457));function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(g=function(e){return e?n:t})(e)}function v(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var n=g(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}function y(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}c.solidLogicSingleton.store;var w=c.solidLogicSingleton.profile,x=w.loadPreferences,_=w.loadProfile,E=c.solidLogicSingleton.typeIndex,k=E.getScopedAppInstances,S=E.getRegistrations,C=E.loadAllTypeIndexes,A=E.getScopedAppsFromIndex,T=E.deleteTypeIndexRegistration;function O(e){var t=c.authn.currentUser();return t?(c.authn.saveUser(t,e),Promise.resolve(e)):new Promise((function(t){c.authn.checkUser().then((function(n){if(n)return u.log("logIn: Already logged in as ".concat(n)),t(e);if(!e.div||!e.dom)return t(e);var r=H(e.dom,(function(n){c.authn.saveUser(n,e),t(e)}));e.div.appendChild(r)}))}))}function P(e){return I.apply(this,arguments)}function I(){return(I=(0,a.default)(o.default.mark((function e(t){var n,r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.preferencesFile){e.next=3;break}return e.abrupt("return",Promise.resolve(t));case 3:return t.statusArea||t.div||null,e.prev=4,e.next=7,j(t);case 7:return t=e.sent,e.next=10,x(t.me);case 10:n=e.sent,t.preferencesFile=n,e.next=51;break;case 15:if(e.prev=15,e.t0=e.catch(4),!(e.t0 instanceof c.UnauthorizedError)){e.next=22;break}r="Ooops - you are not authenticated (properly logged in) to for me to read your preference file. Try loggin out and logging in?",(0,l.alert)(r),e.next=51;break;case 22:if(!(e.t0 instanceof c.CrossOriginForbiddenError)){e.next=28;break}return r="Unauthorized: Assuming preference file blocked for origin ".concat(window.location.origin),t.preferencesFileError=r,e.abrupt("return",t);case 28:if(!(e.t0 instanceof c.SameOriginForbiddenError)){e.next=34;break}return r="You are not authorized to read your preference file. This may be because you are using an untrusted web app.",u.warn(r),e.abrupt("return",t);case 34:if(!(e.t0 instanceof c.NotEditableError)){e.next=40;break}return r="You are not authorized to edit your preference file. This may be because you are using an untrusted web app.",u.warn(r),e.abrupt("return",t);case 40:if(!(e.t0 instanceof c.WebOperationError)){e.next=45;break}r="You are not authorized to edit your preference file. This may be because you are using an untrusted web app.",u.warn(r),e.next=51;break;case 45:if(!(e.t0 instanceof c.FetchError)){e.next=50;break}r="Strange: Error ".concat(e.t0.status," trying to read your preference file.").concat(e.t0.message),(0,l.alert)(r),e.next=51;break;case 50:throw new Error("(via loadPrefs) ".concat(e.t0));case 51:return e.abrupt("return",t);case 52:case"end":return e.stop()}}),e,null,[[4,15]])})))).apply(this,arguments)}function j(e){return N.apply(this,arguments)}function N(){return(N=(0,a.default)(o.default.mark((function e(t){var n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.publicProfile){e.next=2;break}return e.abrupt("return",t);case 2:return e.prev=2,e.next=5,O(t);case 5:if((n=e.sent).me){e.next=8;break}throw new Error("Could not log in");case 8:return e.next=10,_(n.me);case 10:t.publicProfile=e.sent,e.next=17;break;case 13:throw e.prev=13,e.t0=e.catch(2),t.div&&t.dom&&t.div.appendChild(m.errorMessageBlock(t.dom,e.t0.message)),new Error("Can't log in: ".concat(e.t0));case 17:return e.abrupt("return",t);case 18:case"end":return e.stop()}}),e,null,[[2,13]])})))).apply(this,arguments)}function F(){return(F=(0,a.default)(o.default.mark((function e(t,n,r){var i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.me){e.next=6;break}return e.next=3,k(n,t.me);case 3:e.t0=e.sent,e.next=7;break;case 6:e.t0=[];case 7:return i=e.t0,!0===r?i=i.filter((function(e){return"public"===e.scope.label})):!1===r&&(i=i.filter((function(e){return"private"===e.scope.label}))),t.instances=i.map((function(e){return e.instance})),e.abrupt("return",t);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function R(e,t){var n=e.me&&e.me.sameTerm(t.agent)?"":h.label(t.agent)+" ";return"".concat(n).concat(t.label)}function L(){return(L=(0,a.default)(o.default.mark((function e(t,n,r){var i,a,l,p,f,h,g,v,b,w,x,_;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=function(e){var n=i(e.index),r=R(t,e),o="".concat(r," link to this ").concat(t.noun);return m.buildCheckboxForm(t.dom,c.solidLogicSingleton.store,o,null,n,b,e.index)},i=function(e){var t=S(n,r),i=t.length?t[0]:m.newThing(e);return[(0,s.st)(i,d.solid("instance"),n,e),(0,s.st)(i,d.solid("forClass"),r,e)]},(l=t.dom)&&t.div){e.next=5;break}throw new Error("registrationControl: need dom and div");case 5:if(p=l.createElement("div"),t.div.appendChild(p),t.me=c.authn.currentUser(),f=t.me){e.next=12;break}return p.innerHTML='<p style="margin:2em;">(Log in to save a link to this)</p>',e.abrupt("return",t);case 12:return e.prev=12,e.next=15,C(f);case 15:h=e.sent,e.next=23;break;case 18:return e.prev=18,e.t0=e.catch(12),t.div&&t.preferencesFileError?(g="(Lists of stuff not available)",t.div.appendChild(l.createElement("p")).textContent=g):t.div&&(g="registrationControl: Type indexes not available: ".concat(e.t0),t.div.appendChild(m.errorMessageBlock(t.dom,e.t0))),u.log(g),e.abrupt("return",t);case 23:p.innerHTML="<table><tbody></tbody></table>",p.setAttribute("style","font-size: 120%; text-align: right; padding: 1em; border: solid gray 0.05em;"),v=p.children[0].children[0],b=new s.BlankNode,w=y(h);try{for(w.s();!(x=w.n()).done;)_=x.value,v.appendChild(l.createElement("tr")).appendChild(a(_))}catch(e){w.e(e)}finally{w.f()}return e.abrupt("return",t);case 30:case"end":return e.stop()}}),e,null,[[12,18]])})))).apply(this,arguments)}function D(e,t,n){var r=e.dom,i=R(e,n),o=r.createElement("tr"),a=o.appendChild(r.createElement("td"));a.setAttribute("colspan","3"),a.style.backgoundColor={private:"#fee",public:"#efe"}[n.label]||"white";var s=a.appendChild(r.createElement("h3"));return s.textContent=i+" links",s.style.textAlign="left",o}function M(){return M=(0,a.default)(o.default.mark((function e(t,n){var r,i,s,u,l,p,f,h,g,v,b,w,x,_;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.dom,i=t.div,s=r.createElement("div"),i.appendChild(s),t.me=c.authn.currentUser(),t.me){e.next=8;break}return s.innerHTML='<p style="margin:2em;">(Log in list your stuff)</p>',e.abrupt("return",t);case 8:return e.next=10,C(t.me);case 10:u=e.sent,s.innerHTML="<table><tbody></tbody></table>",s.setAttribute("style","font-size: 120%; text-align: right; padding: 1em; border: solid #eee 0.5em;"),l=s.firstChild,p=l.firstChild,f=y(u),e.prev=16,f.s();case 18:if((h=f.n()).done){e.next=44;break}return g=h.value,v=D(t,0,g),p.appendChild(v),e.next=24,A(g,n.type||null);case 24:0===(b=e.sent).length&&(v.style.display="none"),w=y(b),e.prev=27,_=o.default.mark((function e(){var t,n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=x.value,n=m.personTR(r,d.solid("instance"),t.instance,{deleteFunction:function(){var e=(0,a.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,T(t);case 2:p.removeChild(n);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()}),n.children[0].style.paddingLeft="3em",p.appendChild(n);case 4:case"end":return e.stop()}}),e)})),w.s();case 30:if((x=w.n()).done){e.next=34;break}return e.delegateYield(_(),"t0",32);case 32:e.next=30;break;case 34:e.next=39;break;case 36:e.prev=36,e.t1=e.catch(27),w.e(e.t1);case 39:return e.prev=39,w.f(),e.finish(39);case 42:e.next=18;break;case 44:e.next=49;break;case 46:e.prev=46,e.t2=e.catch(16),f.e(e.t2);case 49:return e.prev=49,f.f(),e.finish(49);case 52:return e.abrupt("return",t);case 53:case"end":return e.stop()}}),e,null,[[16,46,49,52],[27,36,39,42]])}))),M.apply(this,arguments)}function U(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=(n=n||{}).buttonStyle||"padding: 1em; border-radius:0.5em; font-size: 100%;",i=e.createElement("div"),o="SolidSignInOrSignUpBox";u.log("widgets.signInOrSignUpBox"),i.setUserCallback=t,i.setAttribute("class",o),i.style="display:flex;";var a=e.createElement("input");i.appendChild(a),a.setAttribute("type","button"),a.setAttribute("value","Log in"),a.setAttribute("style","".concat(r,"background-color: #eef;")),c.authSession.onLogin((function(){var t=c.authn.currentUser();if(t){var n=t.uri,r=e.getElementsByClassName(o);u.log("Logged in, ".concat(r.length," panels to be serviced"));for(var i=0;i<r.length;i++){var a=r[i];if(a.setUserCallback)try{a.setUserCallback(n);var s=a.parentNode;s&&s.removeChild(a)}catch(t){u.log("## Error satisfying login box: ".concat(t)),a.appendChild(m.errorMessageBlock(e,t))}}}})),a.addEventListener("click",(function(){var n=(0,c.offlineTestID)();if(n)return t(n.uri);B(e)}),!1);var s=e.createElement("input");return i.appendChild(s),s.setAttribute("type","button"),s.setAttribute("value","Sign Up for Solid"),s.setAttribute("style","".concat(r,"background-color: #efe;")),s.addEventListener("click",(function(e){(new p.Signup).signup().then((function(e){u.log("signInOrSignUpBox signed up "+e),t(e)}))}),!1),i}function B(e){var t=e.createElement("div");t.setAttribute("style","position: fixed; top: 0; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; align-items: center;"),e.body.appendChild(t);var n=e.createElement("div");n.setAttribute("style","\n background-color: white;\n box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.2);\n -webkit-box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.2);\n -moz-box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.2);\n -o-box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.2);\n border-radius: 4px;\n min-width: 400px;\n padding: 10px;\n z-index : 10;\n "),t.appendChild(n);var r=e.createElement("div");r.setAttribute("style","\n border-bottom: 1px solid #DDD;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n "),n.appendChild(r);var i=e.createElement("label");i.setAttribute("style","margin-right: 5px; font-weight: 800"),i.innerText="Select an identity provider";var s=e.createElement("button");s.innerHTML='<img src="https://solidos.github.io/solid-ui/src/icons/noun_1180156.svg" style="width: 2em; height: 2em;" title="Cancel">',s.setAttribute("style","background-color: transparent; border: none;"),s.addEventListener("click",(function(){t.remove()})),r.appendChild(i),r.appendChild(s);var u=function(){var e=(0,a.default)(o.default.mark((function e(t){var n,r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,(n=new URL(window.location.href).hash)&&window.localStorage.setItem("preLoginRedirectHash",n),window.localStorage.setItem("loginIssuer",t),(r=new URL(window.location.href)).hash="",e.next=8,c.authSession.login({redirectUrl:r.href,oidcIssuer:t});case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),(0,l.alert)(e.t0.message);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(t){return e.apply(this,arguments)}}(),d=e.createElement("div");d.setAttribute("style","\n border-bottom: 1px solid #DDD;\n display: flex;\n flex-direction: column;\n padding-top: 10px;\n ");var p=e.createElement("div");p.setAttribute("style","\n display: flex;\n flex-direction: row;\n ");var f=e.createElement("label");f.innerText="Enter the URL of your identity provider:",f.setAttribute("style","color: #888");var h=e.createElement("input");h.setAttribute("type","text"),h.setAttribute("style","margin-left: 0 !important; flex: 1; margin-right: 5px !important"),h.setAttribute("placeholder","https://example.com"),h.value=localStorage.getItem("loginIssuer")||"";var m=e.createElement("button");m.innerText="Go",m.setAttribute("style","margin-top: 12px; margin-bottom: 12px;"),m.addEventListener("click",(function(){u(h.value)})),d.appendChild(f),p.appendChild(h),p.appendChild(m),d.appendChild(p),n.appendChild(d);var g=e.createElement("div");g.setAttribute("style","\n display: flex;\n flex-direction: column;\n padding-top: 10px;\n ");var v=e.createElement("label");v.innerText="Or pick an identity provider from the list below:",v.setAttribute("style","color: #888"),g.appendChild(v),(0,c.getSuggestedIssuers)().forEach((function(t){var n=e.createElement("button");n.innerText=t.name,n.setAttribute("style","height: 38px; margin-top: 10px"),n.addEventListener("click",(function(){u(t.uri)})),g.appendChild(n)})),n.appendChild(g)}function H(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=(0,c.offlineTestID)(),i=e.createElement("div");function o(e){e&&(r=c.authn.saveUser(e),i.refresh(),t&&t(r.uri))}function a(e){var n=r;c.authSession.logout().then((function(){var e="Your WebID was ".concat(n,". It has been forgotten.");r=null;try{(0,l.alert)(e)}catch(t){window.alert(e)}i.refresh(),t&&t(null)}),(function(e){(0,l.alert)("Fail to log out:"+e)}))}function s(t,n){var r=n.buttonStyle||"padding: 1em; border-radius:0.5em; font-size: 100%;",i="WebID logout";if(t){var o=c.solidLogicSingleton.store.any(t,d.foaf("nick"))||c.solidLogicSingleton.store.any(t,d.foaf("name"));o&&(i="Logout "+o.value)}var s=e.createElement("input");return s.setAttribute("type","button"),s.setAttribute("value",i),s.setAttribute("style","".concat(r,"background-color: #eee;")),s.addEventListener("click",a,!1),s}function u(){r=c.authn.currentUser(),i.refresh()}return i.refresh=function(){var t=c.authSession.info;((r=t&&t.webId&&t.isLoggedIn?c.solidLogicSingleton.store.sym(t.webId):null)&&i.me!==r.uri||!r&&i.me)&&(m.clearElement(i),r?i.appendChild(s(r,n)):i.appendChild(U(e,o,n))),i.me=r?r.uri:null},i.refresh(),u(),c.authSession.onLogin(u),c.authSession.onLogout(u),i.me="99999",i.refresh(),i}function q(e,t,n){var r=t.noun,i=t.appPathSegment,l=(0,c.offlineTestID)(),p=e.createElement("div"),h={me:l,dom:e,div:p};function g(t,n){p.appendChild(m.errorMessageBlock(e,t,n))}function v(e){var t,n=c.solidLogicSingleton.store.any(e,d.space("uriPrefix"));"/"!==(t=n?n.value:e.uri.split("#")[0]).slice(-1)&&(u.log("".concat(i,": No / at end of uriPrefix ").concat(t)),t="".concat(t,"/"));var r=new Date;return t+"".concat(i,"/id").concat(r.getTime(),"/")}return P(h).then((function(t){function i(){return i=(0,a.default)(o.default.mark((function n(r){var i,a,u,l,p;return o.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=w.appendChild(e.createElement("tr")),(a=i.appendChild(e.createElement("td"))).setAttribute("colspan","3"),a.style.padding="0.5em",n.t0=encodeURI,n.next=7,m.askName(e,c.solidLogicSingleton.store,a,d.solid("URL"),d.space("Workspace"),"Workspace");case 7:if(n.t1=n.sent,u=(0,n.t0)(n.t1),l=m.newThing(t.preferencesFile),p=[(0,s.st)(t.me,d.space("workspace"),l,t.preferencesFile),(0,s.st)(l,d.space("uriPrefix"),u,t.preferencesFile)],c.solidLogicSingleton.store.updater){n.next=13;break}throw new Error("store has no updater");case 13:return n.next=15,c.solidLogicSingleton.store.updater.update([],p);case 15:case"end":return n.stop()}}),n)}))),i.apply(this,arguments)}var u=t.me,l=t.preferencesFile,h=null,y=c.solidLogicSingleton.store.each(u,d.space("workspace"),void 0,l),b=c.solidLogicSingleton.store.each(u,d.space("storage"));0===y.length&&b&&(g("You don't seem to have any workspaces. You have ".concat(b.length," storage spaces."),"white"),b.map((function(e){return y=y.concat(c.solidLogicSingleton.store.each(e,d.ldp("contains")))})).filter((function(e){return e.id?["public","private"].includes(e.id().toLowerCase()):""}))),1===y.length&&(g("Workspace used: ".concat(y[0].uri),"white"),h=v(y[0]));var w=e.createElement("table");w.setAttribute("style","border-collapse:separate; border-spacing: 0.5em;"),p.appendChild(w),p.appendChild(e.createElement("hr"));var x=p.appendChild(e.createElement("p"));x.style=f.commentStyle,x.textContent="Where would you like to store the data for the ".concat(r,"?\n Give the URL of the folder where you would like the data stored.\n It can be anywhere in solid world - this URI is just an idea.");var _=p.appendChild(e.createElement("input"));_.setAttribute("type","text"),_.style=f.textInputStyle,_.size=80,_.label="base URL",_.autocomplete="on",h&&(_.value=h),t.baseField=_,p.appendChild(e.createElement("br"));var E,k,S,C,A,T,O,P=p.appendChild(e.createElement("button"));P.style=f.buttonStyle,P.textContent="Start new ".concat(r," at this URI"),P.addEventListener("click",(function(e){var t=_.value.replace(" ","%20");"/"!==t.slice(-1)&&(t+="/"),n(null,t)})),y=y.filter((function(e){return!c.solidLogicSingleton.store.holds(e,d.rdf("type"),d.space("MasterWorkspace"))}));for(var I,j="height: 3em; margin: 1em; padding: 1em white; border-radius: 0.3em;",N="".concat(j,"border: 0px;"),F=0;F<y.length;F++){if(A=y[F],C=e.createElement("tr"),0===F&&((E=e.createElement("td")).setAttribute("rowspan","".concat(y.length)),E.textContent="Choose a workspace for this:",E.setAttribute("style","vertical-align:middle;"),C.appendChild(E)),k=e.createElement("td"),!(T=c.solidLogicSingleton.store.anyValue(A,d.ui("style")))){var R="#".concat((16777215&(I=A.uri,I.split("").reduce((function(e,t){return(e=(e<<5)-e+t.charCodeAt(0))&e}),0))|12632256).toString(16));T="color: black ; background-color: ".concat(R,";")}k.setAttribute("style",N+T),C.target=A.uri;var L=c.solidLogicSingleton.store.any(A,d.rdfs("label"));L||(L=A.uri.split("/").slice(-1)[0]||A.uri.split("/").slice(-2)[0]),k.textContent=L||"???",C.appendChild(k),0===F&&((S=e.createElement("td")).setAttribute("rowspan","".concat(y.length,"1")),S.setAttribute("style","width:50%;"),C.appendChild(S)),w.appendChild(C),O=(O=c.solidLogicSingleton.store.any(A,d.rdfs("comment")))?O.value:"Use this workspace",k.addEventListener("click",(function(t){S.textContent=O?O.value:"",S.setAttribute("style",N+T);var r=e.createElement("button");r.textContent="Continue";var i=v(A);_.value=i,r.addEventListener("click",(function(e){r.disabled=!0,n(A,i),r.textContent="----\x3e"}),!0),S.appendChild(r)}),!0)}var D=e.createElement("tr");(k=e.createElement("td")).setAttribute("style",j),k.textContent="+ Make a new workspace",k.addEventListener("click",(function(e){return i.apply(this,arguments)})),D.appendChild(k),w.appendChild(D)})).catch((function(e){p.appendChild(m.errorMessageBlock(h.dom,e))})),p}function W(){return K.apply(this,arguments)}function K(){return(K=(0,a.default)(o.default.mark((function e(){var t,n,r,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,P({});case 3:if(t=e.sent,n=t.me,r=t.preferencesFile,i=t.preferencesFileError,r&&!i){e.next=9;break}throw new Error(i);case 9:return e.abrupt("return",c.solidLogicSingleton.store.each(n,d.rdf("type"),null,r.doc()));case 12:e.prev=12,e.t0=e.catch(0),u.warn("Unable to fetch your preferences - this was the error: ",e.t0);case 15:return e.abrupt("return",[]);case 16:case"end":return e.stop()}}),e,null,[[0,12]])})))).apply(this,arguments)}function V(){return(V=(0,a.default)(o.default.mark((function e(t){var n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W();case 2:return n=e.sent,e.abrupt("return",t.filter((function(e){return J(e,n)})));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function J(e,t){return(e.audience||[]).reduce((function(e,n){return e&&!!t.find((function(e){return e.equals(n)}))}),!0)}c.authSession.onLogout((0,a.default)(o.default.mark((function e(){var t,n,r,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=window.localStorage.getItem("loginIssuer"))){e.next=19;break}return e.prev=2,(n=new URL(t)).pathname="/.well-known/openid-configuration",e.next=7,fetch(n.toString());case 7:if(200!==(r=e.sent).status){e.next=15;break}return e.next=11,r.json();case 11:if(!(i=e.sent)||!i.end_session_endpoint){e.next=15;break}return e.next=15,fetch(i.end_session_endpoint,{credentials:"include"});case 15:e.next=19;break;case 17:e.prev=17,e.t0=e.catch(2);case 19:window.location.reload();case 20:case"end":return e.stop()}}),e,null,[[2,17]])}))))},7740:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matrix=void 0;var r={matrixForQuery:n(4616).matrixForQuery};t.matrix=r},4616:(e,t,n)=>{"use strict";var r=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.matrixForQuery=function(e,t,n,r,a,s,u){var l=e.createElement("table"),d=e.createElement("tr");d.appendChild(e.createElement("td")).setAttribute("class","MatrixCorner"),l.appendChild(d),l.lastHeader=d;var p=[],f=[],h=function(e,t,n,r){for(;e.firstChild;)e.removeChild(e.firstChild);e.setAttribute("style",""),e.style.textAlign="center",s.cellFunction?s.cellFunction(e,t,n,r):(e.textContent=i.label(r),e.setAttribute("style","padding: 0.3em")),delete e.old},m=function(t){var n=t.toNT();if(f[n])return f[n];var r=e.createElement("tr"),a=r.appendChild(e.createElement("td"));a.setAttribute("style","padding: 0.3em;"),a.textContent=i.label(t),"NamedNode"===t.termType&&c.fetcher.nowOrWhenFetched(t.uri.split("#")[0],void 0,(function(e,n,r){e&&(a.textContent=i.label(t))}));for(var u=0;u<p.length;u++)h(r.appendChild(e.createElement("td")),o.fromNT(p[u]),t,null);r.dataValueNT=n,f[n]=r;for(var d=l.lastHeader.nextSibling;d;d=d.nextSibling)if(n>d.dataValueNT&&s&&s.yDecreasing||n<d.dataValueNT&&(!s||!s.yDecreasing))return l.insertBefore(r,d);return l.appendChild(r)},g=function(t){for(var n=t.toNT(),r=null,a=0;a<p.length;a++){if(p[a]===n)return a;if(n>p[a]&&s.xDecreasing||n<p[a]&&!s.xDecreasing){p=p.slice(0,a).concat([n]).concat(p.slice(a)),r=a;break}}null===r&&(r=p.length,p.push(n));for(var c=l.firstChild;c;c=c.nextSibling){var u=c.dataValueNT,d=e.createElement("td");if(d.style.textAlign="center",c===l.firstChild?d.textContent=i.label(t):h(d,t,o.fromNT(u),null),r===p.length-1)c.appendChild(d);else{for(var f=c.firstChild,m=0;m<r+1;m++)f=f.nextSibling;c.insertBefore(d,f)}}return r},v=function(){var e,t,n=[],r=[];if(s.set_y)for(var i=0;i<s.set_y.length;i++)r[s.set_y[i]]=!0;if(s.set_x)for(var a=0;a<s.set_x.length;a++)n[g(s.set_x[a])+1]=!0;for(var c=1;c<l.children.length;c++){e=l.children[c];for(var u=1;u<e.children.length;u++)if((t=e.children[u]).old){var d=o.fromNT(e.dataValueNT),m=o.fromNT(p[u-1]);h(t,m,d,null)}else r[e.dataValueNT]=!0,n[u]=!0}for(var v=0;v<l.children.length;v++)if(e=l.children[v],v>0&&!r[e.dataValueNT])delete f[e.dataValueNT],l.removeChild(e);else for(var y=e.children.length-1;y>0;y--){var b=e.children[y];n[y]||e.removeChild(b)}for(var w=[],x=0;x<p.length;x++)n[x+1]&&w.push(p[x]);p=w};l.refresh=function(){!function(){for(var e=1;e<l.children.length;e++)for(var t=l.children[e],n=1;n<t.children.length;n++)t.children[n].old=!0}(),c.query(t,y,void 0,v)};var y=function(e){var t=e[n.toString()],i=e[r.toString()],o=e[a.toString()],s=m(i),c=g(t),u=s.children[c+1];h(u,t,i,o)};if(s.set_y)for(var b=0;b<s.set_y.length;b++)m(s.set_y[b]);if(s.set_x)for(var w=0;w<s.set_x.length;w++)g(s.set_x[w]);return c.query(t,y,void 0,u),l};var i=s(n(5666)),o=s(n(6022));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(a=function(e){return e?n:t})(e)}function s(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=a(t);if(n&&n.has(e))return n.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var c=o?Object.getOwnPropertyDescriptor(e,s):null;c&&(c.get||c.set)?Object.defineProperty(i,s,c):i[s]=e[s]}return i.default=e,n&&n.set(e,i),i}var c=n(166).solidLogicSingleton.store},2843:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.media=void 0;var r=n(4083),i={cameraCaptureControl:r.cameraCaptureControl,cameraButton:r.cameraButton};t.media=i},4083:(e,t,n)=>{"use strict";var r=n(4836),i=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.cameraButton=function(e,t,n,r){var i,s=e.createElement("div"),c=u.button(e,p,"Take picture");function l(e){return d.apply(this,arguments)}function d(){return(d=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s.removeChild(i),s.appendChild(c),r(t);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return s.appendChild(c),c.addEventListener("click",(function(r){s.removeChild(c),i=m(e,t,n,l),s.appendChild(i)})),s},t.cameraCaptureControl=m;var o=r(n(4687)),a=r(n(7156)),s=d(n(4433)),c=n(1124),u=d(n(2457));function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}function d(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}var p=c.icons.iconBase+"noun_Camera_1618446_000000.svg",f=c.icons.iconBase+"noun_479395.svg",h="border-radius: 0.5em; margin: 0.8em; width: ".concat("640","; height:").concat("480",";");function m(e,t,n,r){var i,o,a,l,d=e.createElement("div"),p=d.appendChild(e.createElement("table")),m=p.appendChild(e.createElement("tr")).appendChild(e.createElement("td"));m.setAttribute("colspan","4");var g=p.appendChild(e.createElement("tr"));g.appendChild(e.createElement("td")).appendChild(u.cancelButton(e)).addEventListener("click",(function(e){_(),r(null)}));var v=g.appendChild(e.createElement("td")).appendChild(u.button(e,f,"Retake"));v.addEventListener("click",(function(e){m.removeChild(l),w()})),v.style.visibility="collapse";var y=g.appendChild(e.createElement("td")).appendChild(u.button(e,c.icons.iconBase+"noun_10636.svg","Snap"));y.addEventListener("click",(function(){(l=e.createElement("canvas")).setAttribute("width","640"),l.setAttribute("height","480"),l.setAttribute("style",h),m.appendChild(l),l.getContext("2d").drawImage(a,0,0,l.width,l.height),a.parentNode.removeChild(a),l.toBlob((function(e){var t="got blob type ".concat(e.type," size ").concat(e.size);s.log(t),i=n(),o=e,b.style.visibility="visible",v.style.visibility="visible",y.style.visibility="collapse"}),"image/png")})),y.style.visibility="collapse";var b=g.appendChild(e.createElement("td")).appendChild(u.continueButton(e));function w(){if((a=m.appendChild(e.createElement("video"))).setAttribute("controls","1"),a.setAttribute("autoplay","1"),a.setAttribute("style",h),!navigator.mediaDevices)throw new Error("navigator.mediaDevices not available");navigator.mediaDevices.getUserMedia(x).then((function(e){a.srcObject=e,y.style.visibility="visible",b.style.visibility="collapse",v.style.visibility="collapse"}))}b.addEventListener("click",(function(e){!function(e,n){var i=e.type;s.log("Putting "+e.size+" bytes of "+i+" to "+n),t.fetcher.webOperation("PUT",n.uri,{data:e,contentType:i}).then((function(e){s.log("ok saved "+n),_(),r(n)}),(function(e){_(),alert(e)}))}(o,i)})),b.style.visibility="collapse";var x={video:!0};function _(){a&&a.srcObject&&a.srcObject.getVideoTracks().forEach((function(e){return e.stop()}))}return w(),d}},4440:(e,t,n)=>{"use strict";var r=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.messageArea=function(e,t,n,r,i){t=t||a.solidLogicSingleton.store,r=r.doc();var s,u,d=h.ns,p=c.Namespace("http://www.w3.org/2005/01/wf/flow#"),f=c.Namespace("http://purl.org/dc/terms/"),m=!!(i=i||{}).newestFirst,g="white-space: pre-wrap; width: 90%; font-size:100%; border: 0.07em solid #eee; padding: .2em 0.5em; margin: 0.1em 1em 0.1em 1em;",v=e.createElement("div"),y=a.solidLogicSingleton.store.updater,b=function(t,n){var r=e.createElement("a");return n&&n.uri&&(r.setAttribute("href",n.uri),r.addEventListener("click",h.widgets.openHrefInOutlineMode,!0),r.setAttribute("style","color: #3B5998; text-decoration: none; ")),r.textContent=t,r},w=function(t,n){var r=e.createElement("pre");return r.setAttribute("style",n||"color: grey"),v.appendChild(r),r.appendChild(e.createTextNode(t)),r},x=function(e){w(e,"color: #800;")};function _(e){var t=a.solidLogicSingleton.store.any(e,h.ns.foaf("nick"));return t?""+t.value:""+l.label(e)}function E(t,n,r,i){var o=t.appendChild(b(_(n),n));n.uri&&a.solidLogicSingleton.store.fetcher.nowOrWhenFetched(n.doc(),void 0,(function(e,t){o.textContent=_(n)})),t.appendChild(e.createElement("br")),t.appendChild(b(r,i))}function k(e,n){var r,i,o={};for(r=n.firstChild;r;r=r.nextSibling)r.AJAR_subject&&(o[r.AJAR_subject.uri]=!0);var a=t.each(e,d.wf("message")),s={};for(a.forEach((function(e){s[e.uri]=!0,o[e.uri]||S(e)})),r=n.firstChild;r;)i=r.nextSibling,r.AJAR_subject&&!s[r.AJAR_subject.uri]&&n.removeChild(r),r=i}var S=function(e){var n={"?msg":e,"?creator":t.any(e,d.foaf("maker")),"?date":t.any(e,f("created")),"?content":t.any(e,d.sioc("content"))};C(n,!0)},C=function(r,i){var o=r["?creator"],a=r["?msg"],c=r["?date"],u=r["?content"],l=c.value,d=e.createElement("tr");d.AJAR_date=l,d.AJAR_subject=a;for(var p=!1,f=s.firstChild;f;f=f.nextSibling)if(l>f.AJAR_date&&m||l<f.AJAR_date&&!m){s.insertBefore(d,f),p=!0;break}p||s.appendChild(d);var v=e.createElement("td");d.appendChild(v),E(v,o,h.widgets.shortDate(l),a);var b=e.createElement("td");d.appendChild(b);var w=e.createElement("p");w.setAttribute("style",g+(i?"background-color: #e8ffe8;":"background-color: #white;")),b.appendChild(w),w.textContent=u.value;var _=e.createElement("td");d.appendChild(_);var S=e.createElement("button");_.appendChild(S),S.textContent="-",d.setAttribute("class","hoverControl"),S.setAttribute("class","hoverControlHide"),S.setAttribute("style","color: red;"),S.addEventListener("click",(function(r){_.removeChild(S);var i=e.createElement("button");i.textContent="cancel",_.appendChild(i).addEventListener("click",(function(e){_.removeChild(o),_.removeChild(i),_.appendChild(S)}),!1);var o=e.createElement("button");o.textContent="Delete message",_.appendChild(o).addEventListener("click",(function(e){_.removeChild(o),_.removeChild(i),function(e){var r=t.statementsMatching(e).concat(t.statementsMatching(void 0,void 0,e));y.update(r,[],(function(e,t,r){t?k(n,s):x("Cant delete messages:"+r)}))}(a)}),!1)}),!1)};(s=e.createElement("table")).fresh=!1,v.appendChild(s),s.setAttribute("style","width: 100%;");var A,T=function(){var i=e.createElement("tr"),a=e.createElement("td"),s=e.createElement("td"),l=e.createElement("td");i.appendChild(a),i.appendChild(s),i.appendChild(l),i.AJAR_date="9999-01-01T00:00:00Z";var p,m,v=function(){p.setAttribute("class","pendingedit"),p.disabled=!0;var o=[],a=new Date,s=""+a.getTime(),l=c.term(a),m=t.sym(r.uri+"#Msg"+s);o.push(new c.Statement(n,d.wf("message"),m,r)),o.push(new c.Statement(m,d.sioc("content"),t.literal(p.value),r)),o.push(new c.Statement(m,f("created"),l,r)),u&&o.push(new c.Statement(m,d.foaf("maker"),u,r)),y.update([],o,(function(n,r,o){if(r){var a={"?msg":m,"?content":t.literal(p.value),"?date":l,"?creator":u};C(a,!1),p.value="",p.setAttribute("class",""),p.disabled=!1}else i.appendChild(h.widgets.errorMessageBlock(e,"Error writing message: "+o))}))};i.appendChild(e.createElement("br"));var b={div:s,dom:e};return o.ensureLoggedIn(b).then((function(t){u=t.me,E(a,u,"",null),p=e.createElement("textarea"),s.innerHTML="",s.appendChild(p),p.rows=3,p.setAttribute("style",g+"background-color: #eef;"),p.addEventListener("keyup",(function(e){13===e.keyCode&&(e.altKey||v())}),!1),l.innerHTML="",(m=h.widgets.button(e,h.icons.iconBase+"noun_383448.svg","Send")).setAttribute("style",h.style.buttonStyle+"float: right;"),m.addEventListener("click",v,!1),l.appendChild(m)})),i}();if(m?s.insertBefore(T,s.firstChild):s.appendChild(T),i.query)A=i.query;else{A=new c.Query("Messages");var O={};["msg","date","creator","content"].forEach((function(e){A.vars.push(O[e]=c.variable(e))})),A.pat.add(n,p("message"),O.msg),A.pat.add(O.msg,d.dct("created"),O.date),A.pat.add(O.msg,d.foaf("maker"),O.creator),A.pat.add(O.msg,d.sioc("content"),O.content)}return t.query(A,C,void 0,(function(){s.fresh=!0})),v.refresh=function(){k(n,s)},v};var i=n(1124),o=f(n(3210)),a=n(166),s=f(n(6590)),c=f(n(6022)),u=f(n(2853)),l=f(n(5666)),d=f(n(2457));function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(p=function(e){return e?n:t})(e)}function f(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=p(t);if(n&&n.has(e))return n.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,n&&n.set(e,i),i}var h={icons:i.icons,ns:s,rdf:c,style:u,widgets:d}},6590:(e,t,n)=>{"use strict";var r=n(4836),i=n(8698),o=r(n(3180)),a=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var c=o?Object.getOwnPropertyDescriptor(e,a):null;c&&(c.get||c.set)?Object.defineProperty(r,a,c):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(6022));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}e.exports=(0,o.default)(a)},4004:(e,t,n)=>{"use strict";var r=n(4836),i=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.getChunks=g,t.lightColorHash=m,Object.defineProperty(t,"manageParticipation",{enumerable:!0,get:function(){return d.manageParticipation}}),t.notepad=function(e,t,n,r,i){var l=(i=i||{}).exists,d=e.createElement("table"),p=f;if(r&&!r.uri)throw new Error("UI.pad.notepad: Invalid userid");var h=f.updater,g=(0,a.Namespace)("http://www.w3.org/ns/pim/pad#");d.setAttribute("style","padding: 1em; overflow: auto; resize: horizontal; min-width: 40em;");var v=null,y=null;if(i.statusArea){var b=i.statusArea.appendChild(e.createElement("table")).appendChild(e.createElement("tr"));v=b.appendChild(e.createElement("td")),y=b.appendChild(e.createElement("td")),v&&v.setAttribute("style","width:50%"),y&&y.setAttribute("style","width:50%")}var w=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(0,u.log)(t),i.statusArea&&(n?v:y).appendChild((0,s.errorMessageBlock)(e,t,"pink"))},x=function(e){i.statusArea&&(i.statusArea.innerHTML="")},_=function(e,t,n){var r=e.subject;t=t||"";var i=p.any(r,o.dc("author"));!t&&i&&(t="color: "+(n?"#888":"black")+"; background-color: "+m(i)+";");var a=p.any(r,g("indent")),s=(a=a?a.value:0)>=0?"font-size: 100%; font-family: monospace; width: 100%; border: none; white-space: pre-wrap;text-indent: "+3*a+"em;":"font-family: sans-serif; font-weight: bold; border: none;"+["font-size: 110%; padding-top: 0.5em; padding-bottom: 0.5em; width: 100%;","font-size: 120%; padding-top: 1em; padding-bottom: 1em; width: 100%;","font-size: 150%; padding-top: 1em; padding-bottom: 1em; width: 100%;"][-1-a];e.setAttribute("style",s+t)},E=function(e){var r=e.subject;if(!r)throw new Error("No chunk for line to be deleted!");var i=p.any(void 0,g("next"),r),o=p.any(r,g("next"));if(i.sameTerm(n)&&o.sameTerm(n))(0,u.log)("You can't delete the only line.");else{var s=p.statementsMatching(r,void 0,void 0,t).concat(p.statementsMatching(void 0,void 0,r,t)),l=[(0,a.st)(i,g("next"),o,t)];if(r instanceof a.NamedNode){var d=r.uri.slice(-4);(0,u.log)("Deleting line "+d)}if(!h)throw new Error("have no updater");h.update(s,l,(function(t,n,i,o){if(n){var a=e.parentNode;if(a){var l=a.previousSibling;a.parentNode&&a.parentNode.removeChild(a),l&&l.firstChild&&l.firstChild.focus()}}else if(o&&409===o.status)_(e,"color: black; background-color: #ffd;"),e.state=0,(0,c.beep)(.5,512),setTimeout((function(){I()}),1e3);else{(0,u.log)(" removePart FAILED "+r+": "+i),(0,u.log)(" removePart was deleteing :'"+s),_(e,"color: black; background-color: #fdd;");var d=o?o.status:" [no response field] ";w("Error "+d+" saving changes: "+i.true)}}))}},k=function(e,n){e.addEventListener("keydown",(function(r){if(!h)throw new Error("no updater");var i,o;switch(r.keyCode){case 13:var s=r.shiftKey;if((0,u.log)("enter"),s?(o=p.any(void 0,g("next"),n),i="newlinesAfter"):(o=p.any(n,g("next")),i="newlinesBefore"),o[i]=o[i]||0,o[i]+=1,o[i]>1)return void(0,u.log)(" queueing newline queue = "+o[i]);(0,u.log)(" go ahead line before "+o[i]),C(e,s);break;case 8:if(0===e.value.length)switch((0,u.log)("Delete key line "+n.uri.slice(-4)+" state "+e.state),e.state){case 1:case 2:return void(e.state=4);case 3:case 4:return;case void 0:case 0:e.state=3,E(e),r.preventDefault();break;default:throw new Error("pad: Unexpected state "+e)}break;case 9:var c=r.shiftKey?-1:1;!function(e,n,r){var i=p.statementsMatching(n,g("indent")),o=i.length?Number(i[0].object.value):0;if(!(o+r<-3)){var s=o+r,c=(0,a.st)(n,g("indent"),s,t);if(!h)throw new Error("no updater");h.update(i,c,(function(n,r,i){r?_(e):((0,u.log)("Indent change FAILED '"+s+"' for "+t+": "+i),_(e,"color: black; background-color: #fdd;"),h.requestDownstreamAction(t,I))}))}}(e,n,c),r.preventDefault();break;case 27:(0,u.log)("escape"),h.requestDownstreamAction(t,I),r.preventDefault();break;case 38:e.parentNode.previousSibling&&(e.parentNode.previousSibling.firstChild.focus(),r.preventDefault());break;case 40:e.parentNode.nextSibling&&(e.parentNode.nextSibling.firstChild.focus(),r.preventDefault())}}));var r=function e(n){var r=n.subject;_(n,void 0,!0);var i,s=p.any(r,o.sioc("content")).value,l=[(0,a.st)(r,o.sioc("content"),s,t)];n.value&&(i=[(0,a.st)(r,o.sioc("content"),n.value,t)]);var d=n.value;if(n.lastSent&&s!==n.lastSent)throw new Error("Out of order, last sent expected '"+s+"' but found '"+n.lastSent+"'");if(n.lastSent=d,!h)throw new Error("no updater");h.update(l,i,(function(r,i,o,a){i?(x(),_(n),(0,u.log)(" Patch ok '"+s+"' -> '"+d+"' "),4===n.state?(n.state=3,E(n)):3===n.state||(2===n.state?(n.state=1,e(n)):n.state=0)):((0,u.log)(" patch FAILED "+a.status+" for '"+s+"' -> '"+d+"': "+o),409===a.status?(_(n,"color: black; background-color: #fdd;"),n.state=0,(0,c.beep)(.5,512),setTimeout((function(){h.requestDownstreamAction(t,I)}),1e3)):(_(n,"color: black; background-color: #fdd;"),n.state=0,w(" Error "+a.status+" sending data: "+o,!0),(0,c.beep)(1,128)))}))};e.addEventListener("input",(function(t){switch(_(e,void 0,!0),(0,u.log)("Input event state "+e.state+" value '"+e.value+"'"),e.state){case 3:case 4:case 2:return;case 1:return void(e.state=2);case 0:case void 0:e.state=1,r(e)}}))},S=function(t,n,i){var a=p.any(n,o.sioc("content"));a=a?a.value:"";var s=e.createElement("tr");i?d.insertBefore(s,t):t&&t.nextSibling?d.insertBefore(s,t.nextSibling):d.appendChild(s);var c=s.appendChild(e.createElement("input"));return c.subject=n,c.setAttribute("type","text"),c.value=a,r?(_(c,""),k(c,n)):(_(c,"color: #222; background-color: #fff"),(0,u.log)("Note can't add listeners - not logged in")),c},C=function e(i,c){var l,d,p,m,v,y=f,b=0,w=null;i?("input"!==i.tagName.toLowerCase()&&(0,u.log)("return pressed when current document is: "+i.tagName),l=i.subject,b=(b=y.any(l,g("indent")))?Number(b.value):0,c?(d=y.any(void 0,g("next"),l),p=l,m=d,w="newlinesAfter"):(d=l,p=y.any(l,g("next")),m=p,w="newlinesBefore"),v=i.parentNode):(d=n,p=n,v=void 0);var x=(0,s.newThing)(t),E=x.uri.slice(-4),k=[(0,a.st)(d,g("next"),p,t)],C=[(0,a.st)(d,g("next"),x,t),(0,a.st)(x,g("next"),p,t),(0,a.st)(x,o.dc("author"),r,t),(0,a.st)(x,o.sioc("content"),"",t)];if(b>0&&C.push((0,a.st)(x,g("indent"),b,t)),(0,u.log)(" Fresh chunk "+E+" proposed"),!h)throw new Error("no updater");h.update(k,C,(function(t,n,r,i){if(n){var o=S(v,x,c);_(o),o.focus(),w&&((0,u.log)(" Fresh chunk "+E+" updated, queue = "+m[w]),m[w]-=1,m[w]>0&&((0,u.log)(" Implementing queued newlines = "+p.newLinesBefore),e(o,c)))}else(0,u.log)(" ERROR writing new line "+E+": "+r)}))},A=function(){var e={},t=0;function r(e){w(e),t++}if(!p.the(n,g("next")))return r("No initial next pointer"),!1;for(var i,a=n;(i=p.the(a,g("next")))||r("No next pointer from "+a),!i.sameTerm(n);){a=i;var s=i.uri.split("#")[1];if(e[i.uri])return r("Loop!"),!1;e[i.uri]=!0;var c=p.each(i,g("next")).length;1!==c&&r("Should be 1 not "+c+" next pointer for "+s),(c=p.each(i,g("indent")).length)>1&&r("Should be 0 or 1 not "+c+" indent for "+s),1!==(c=p.each(i,o.sioc("content")).length)&&r("Should be 1 not "+c+" contents for "+s),1!==(c=p.each(i,o.dc("author")).length)&&r("Should be 1 not "+c+" author for "+s),p.statementsMatching(void 0,o.sioc("contents")).forEach((function(t){e[t.subject.value]||r("Loose chunk! "+t.subject.value)}))}return!t},T=function(){if(1!==p.each(n,g("next")).length){var e="Pad: Inconsistent data - NEXT pointers: "+p.each(n,g("next")).length;return(0,u.log)(e),void(i.statusArea&&(i.statusArea.textContent+=e))}for(var t,r=[],a=p.the(n,g("next"));!a.sameTerm(n);a=p.the(a,g("next")))for(var s=0;s<d.children.length;s++){var c=d.children[s];c.firstChild&&c.firstChild.subject.sameTerm(a)&&(r[a.uri]=c.firstChild)}for(var l=d.children.length-1;l>=0;l--)r[(t=d.children[l]).firstChild.subject.uri]||d.removeChild(t);t=d.firstChild;for(var f=p.the(n,g("next"));!f.sameTerm(n);f=p.the(f,g("next"))){var h=p.any(f,o.sioc("content")).value;if(t&&r[f.uri]){var m=t.firstChild;h!==m.value&&(m.value=h),_(m),m.state=0,delete m.lastSent,t=t.nextSibling}else S(t,f,!0)}},O=function e(t){if(t.refresh)t.refresh();else for(var n=0;n<t.children.length;n++)e(t.children[n])},P=!1,I=function(){if(P)(0,u.log)(" Already reloading - stop");else{P=!0;var e=1e3;!function n(){if((0,u.log)("try reload - timeout = "+e),!h)throw new Error("no updater");h.reload(h.store,t,(function(r,i,o){P=!1,r?((0,u.log)(" reloaded OK"),x(),A()?O(d):w("CONSITENCY CHECK FAILED")):0===o.status?(w("Network error refreshing the pad. Retrying in "+e/1e3),P=!0,e*=2,setTimeout(n,e)):w("Error "+o.status+"refreshing the pad:"+i+". Stopped. "+t)}))}()}};if(d.refresh=T,d.reloadAndSync=I,r||(0,u.log)("Warning: must be logged in for pad to be edited"),l)(0,u.log)("Existing pad."),A()?(T(),p.holds(n,g("next"),n)&&C()):(0,u.log)(d.textContent="Inconsistent data. Abort");else{(0,u.log)("No pad exists - making new one.");var j=[(0,a.st)(n,o.rdf("type"),g("Notepad"),t),(0,a.st)(n,o.dc("author"),r,t),(0,a.st)(n,o.dc("created"),new Date,t),(0,a.st)(n,g("next"),n,t)];if(!h)throw new Error("no updater");h.update([],j,(function(e,t,n){t?((0,u.log)("Initial pad created"),C()):w(n||"")}))}return d},t.notepadToHTML=function(e,t){var n=g(e,t),r="<html>\n <head>\n",i=t.anyValue(e,o.dct("title"));i&&(r+=" <title>".concat(v(i),"</title>\n")),r+=" </head>\n <body>\n";var a=0;function s(e){for(;a>e;a--)r+="</ul>\n"}return n.forEach((function(e){var n=t.anyJS(e,h("indent")),i=t.anyJS(e,o.sioc("content"));if(i){var c=v(i);if(n<0){s(0);var u=n>=-3?4+n:1;r+="\n<h".concat(u,">").concat(c,"</h").concat(u,">\n")}else n>0?(s(n),function(e){for(;a<e;a++)r+="<ul>\n"}(n),r+="<li>".concat(c,"</li>\n")):(s(n),r+="<p>".concat(c,"</p>\n"))}})),s(0),r+=" </body>\n</html>\n"},Object.defineProperty(t,"participationObject",{enumerable:!0,get:function(){return d.participationObject}}),Object.defineProperty(t,"recordParticipation",{enumerable:!0,get:function(){return d.recordParticipation}}),Object.defineProperty(t,"renderPartipants",{enumerable:!0,get:function(){return d.renderPartipants}}),t.xmlEncode=v;r(n(9728)),r(n(6690)),r(n(6115)),r(n(1655)),r(n(4993)),r(n(3808)),r(n(3496)),r(n(8416));var o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var n=p(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(6590)),a=n(6022),s=n(2457),c=n(5666),u=n(4433),l=n(166),d=n(8412);function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(p=function(e){return e?n:t})(e)}var f=l.solidLogicSingleton.store,h=(0,a.Namespace)("http://www.w3.org/ns/pim/pad#");function m(e){var t;return e&&e.uri?"#"+(16777215&(t=e.uri,t.split("").reduce((function(e,t){return(e=(e<<5)-e+t.charCodeAt(0))&e}),0))|12632256).toString(16):"#ffffff"}function g(e,t){for(var n=[],r=t.the(e,h("next"));!r.sameTerm(e);r=t.the(r,h("next")))n.push(r);return n}function v(e){return e.replace("&","&amp;").replace("<","&lt;").replace(">","&gt;")}HTMLElement,HTMLElement},8412:(e,t,n)=>{"use strict";var r=n(4836),i=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.manageParticipation=function(e,t,n,r,i,o){var a=e.createElement("table");t.appendChild(a),g(e,a,0,r,0,o);try{v(r,n,a)}catch(n){t.appendChild((0,c.errorMessageBlock)(e,"Error recording your partipation: "+n))}return a},t.participationObject=function(e,t,n){return new Promise((function(r,i){if(!n)throw new Error("No user id");var u=m.each(e,s.wf("participation")).filter((function(e){return m.holds(e,s.wf("participant"),n)}));if(u.length>1){var d,p=[],f=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}(e))){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(u);try{for(f.s();!(d=f.n()).done;){var g=d.value,v=m.anyValue(g,s.cal("dtstart"));v&&p.push([v,g])}}catch(e){f.e(e)}finally{f.f()}p.sort(),o.warn("Multiple particpation objects, picking earliest, in "+t),r(p[0][1])}if(u.length)r(u[0]);else{var y=(0,c.newThing)(t),b=[(0,a.st)(e,s.wf("participation"),y,t),(0,a.st)(y,s.wf("participant"),n,t),(0,a.st)(y,s.cal("dtstart"),new Date,t),(0,a.st)(y,s.ui("backgroundColor"),(0,l.lightColorHash)(n),t)];m.updater.update([],b,(function(e,t,n){t?r(y):i(new Error("Error recording your partipation: "+n))})),r(y)}}))},t.recordParticipation=v,t.renderPartipants=g;r(n(9728)),r(n(6690)),r(n(6115)),r(n(1655)),r(n(4993)),r(n(3808)),r(n(3496)),r(n(8416));var o=f(n(4433)),a=n(6022),s=f(n(6590)),c=n(2457),u=n(5666),l=n(4004),d=n(166);function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(p=function(e){return e?n:t})(e)}function f(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var n=p(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}HTMLTableElement;var m=d.solidLogicSingleton.store;function g(e,t,n,r,i,a){t.setAttribute("style","margin: 0.8em;");var l=function(n){var r,i=m.any(n,s.wf("participant"));if(!i)return(r=e.createElement("tr")).textContent="???",r;var o=m.anyValue(n,s.ui("backgroundColor"))||"white",u=e.createElement("div");u.setAttribute("style","height: 1.5em; width: 1.5em; margin: 0.3em; border 0.01em solid #888; background-color: "+o),r=(0,c.personTR)(e,null,i,a),t.appendChild(r);var l=e.createElement("td");return l.setAttribute("style","vertical-align: middle;"),l.appendChild(u),r.insertBefore(l,r.firstChild),r},d=function(){var e=m.each(r,s.wf("participation")).map((function(e){return(0,o.log)("in participants"),[m.anyValue(e,s.cal("dtstart"))||"9999-12-31",e]}));e.sort();var n=e.map((function(e){return e[1]}));(0,u.syncTableToArray)(t,n,l)};return t.refresh=d,d(),t}function v(e,t,n){var r=d.authn.currentUser();if(r){var i=m.each(e,s.wf("participation")).filter((function(e){return m.holds(e,s.wf("participant"),r)}));if(i.length>1)throw new Error("Multiple records of your participation");if(i.length)return i[0];if(!m.updater.editable(t))return o.log("Not recording participation, as no write acesss as "+r+" to "+t),null;var u=(0,c.newThing)(t),p=[(0,a.st)(e,s.wf("participation"),u,t),(0,a.st)(u,s.wf("participant"),r,t),(0,a.st)(u,s.cal("dtstart"),new Date,t),(0,a.st)(u,s.ui("backgroundColor"),(0,l.lightColorHash)(r),t)];return m.updater.update([],p,(function(e,t,r){if(!t)throw new Error("Error recording your partipation: "+r);n&&n.refresh&&n.refresh()})),u}}},3489:(e,t,n)=>{"use strict";var r=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.get=function(e){return h[e]},t.getPreferencesForClass=function(e,t,n,r){return new Promise((function(i,o){m(e,r).then((function(r){var a=r.sharedPreferences;if(r.me)u.participationObject(e,e.doc(),r.me).then((function(e){g(t,r).then((function(t){var r=[],o=t.personalDefaults;n.forEach((function(t){var n=f.any(e,t)||f.any(a,t)||f.any(o,t);n&&(r[t.uri]=v(n))})),i(r)}),o)}),o);else{var s=[];n.forEach((function(e){var t=f.any(a,e);t&&(s[e.uri]=v(t))})),i(s)}}))}))},t.recordPersonalDefaults=g,t.recordSharedPreferences=m,t.renderPreferencesForm=function(e,t,n,r){var i=r.dom.createElement("div");return u.participationObject(e,e.doc(),r.me).then((function(o){var a=r.dom;function s(e){i.appendChild(a.createElement("h5")).textContent=e}s("My view of this "+r.noun),l.appendForm(a,i,{},o,n,e.doc(),(function(e,t){e||l.complain(r,t)})),s("Everyone's view of this "+r.noun),m(e,r).then((function(r){var o=r.sharedPreferences;l.appendForm(a,i,{},o,n,e.doc(),(function(e,t){e||l.complain(r,t)})),s("My default view of any "+r.noun),g(t,r).then((function(e){l.appendForm(a,i,{},e.personalDefaults,n,e.preferencesFile,(function(t,n){t||l.complain(e,n)}))}),(function(e){l.complain(r,e)}))}))}),(function(e){i.appendChild(l.errorMessageBlock(r.dom,e))})),i},t.set=function(e,t){if("string"!=typeof t)throw a.log("Non-string value of preference "+e+": "+t),new Error("Non-string value of preference "+e+": "+t);this.value[e]=t},t.value=void 0;var i=p(n(6022)),o=n(166),a=p(n(4433)),s=n(3210),c=p(n(6590)),u=p(n(8412)),l=p(n(2457));function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}function p(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,n&&n.set(e,i),i}var f=o.store,h=[];function m(e,t){return new Promise((function(n,r){var o=f.any(e,c.ui("sharedPreferences"));if(o)t.sharedPreferences=o,n(t);else{var s=i.sym(e.doc().uri+"#SharedPreferences"),u=[i.st(e,c.ui("sharedPreferences"),s,e.doc())];a.log("Creating shared preferences "+s),f.updater.update([],u,(function(e,i,o){i?(t.sharedPreferences=s,n(t)):r(new Error("Error creating shared prefs: "+o))}))}}))}function g(e,t){return new Promise((function(n,r){(0,s.ensureLoadedPreferences)(t).then((function(t){if(t.preferencesFile){var o,s,u=f.each(null,c.solid("forClass"),e,t.preferencesFile),d=[];if(u.length){if(u.forEach((function(e){o=o||f.any(e,c.solid("personalDefaults"))})),o)return t.personalDefaults=o,void n(t);o=l.newThing(t.preferencesFile),s=u[0]}else s=l.newThing(t.preferencesFile),d=[i.st(s,c.rdf("type"),c.solid("TypeRegistration"),t.preferencesFile),i.st(s,c.solid("forClass"),e,t.preferencesFile)];o=l.newThing(t.preferencesFile),d.push(i.st(s,c.solid("personalDefaults"),o,t.preferencesFile)),f.updater.update([],d,(function(i,a,s){a?(t.personalDefaults=o,n(t)):r(new Error("Setting preferences for "+e+": "+s))}))}else a.log("Not doing private class preferences as no access to preferences file. "+t.preferencesFileError)}),(function(e){r(e)}))}))}function v(e){return e.datatype?e.datatype.equals(c.xsd("boolean"))?"1"===e.value:e.datatype.equals(c.xsd("dateTime"))||e.datatype.equals(c.xsd("date"))?new Date(e.value):e.datatype.equals(c.xsd("integer"))||e.datatype.equals(c.xsd("float"))||e.datatype.equals(c.xsd("decimal"))?Number(e.value):e.value:e}t.value=h},8677:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={authEndpoint:"",fallbackAuthEndpoint:"https://databox.me/",signupEndpoint:"https://solidproject.org/use-solid/",signupWindowHeight:600,signupWindowWidth:1024,key:"",cert:""}},4412:(e,t,n)=>{"use strict";var r=n(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.Signup=o;var i=r(n(8677));function o(e){this.config=e||i.default}o.prototype.listen=function(){return new Promise((function(e,t){var n=window.addEventListener?"addEventListener":"attachEvent";(0,window[n])("attachEvent"===n?"onmessage":"message",(function(n){var r=n.data;if("User:"===r.slice(0,5)){var i=r.slice(5,r.length);return i&&i.length>0&&"http"===i.slice(0,4)?e(i):t(i)}}),!0)}))},o.prototype.signup=function(e){e=e||this.config.signupEndpoint;var t=this.config.signupWindowWidth,n=this.config.signupWindowHeight,r=window.screen.width/2-(t/2+10),i=window.screen.height/2-(n/2+50),o=e+"?origin="+encodeURIComponent(window.location.origin),a="resizable,scrollbars,status,width="+t+",height="+n+",left="+r+",top="+i;window.open(o,"Solid signup",a);var s=this;return new Promise((function(e){s.listen().then((function(t){return e(t)}))}))}},2853:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.style=void 0;var n="#888888",r={checkboxStyle:"colour: black; font-size: 100%; padding-left: 0.5 em; padding-right: 0.5 em;",checkboxInputStyle:"font-size: 150%; height: 1.2em; width: 1.2em; background-color: #eef; border-radius:0.2em; margin: 0.1em",fieldLabelStyle:"color: #3B5998; text-decoration: none;",formSelectSTyle:"background-color: #eef; padding: 0.5em; border: .05em solid #88c; border-radius:0.2em; font-size: 100%; margin:0.4em;",textInputStyle:"background-color: #eef; padding: 0.5em; border: .05em solid #88c; border-radius:0.2em; font-size: 100%; margin:0.4em;",textInputStyleUneditable:"background-color: white; padding: 0.5em; border: .05em solid white; border-radius:0.2em; font-size: 100%; margin:0.4em;",textInputSize:20,buttonStyle:"background-color: #fff; padding: 0.7em; border: .01em solid white; border-radius:0.2em; font-size: 100%; margin: 0.3em;",commentStyle:"padding: 0.7em; border: none; font-size: 100%; white-space: pre-wrap;",iconStyle:"width: 3em; height: 3em; margin: 0.1em; border-radius: 1em;",smallButtonStyle:"margin: 0.2em; width: 1em; height:1em;",classIconStyle:"width: 3em; height: 3em; margin: 0.1em; border-radius: 0.2em; border: 0.1em solid green; padding: 0.2em; background-color: #efe;",confirmPopupStyle:"padding: 0.7em; border-radius: 0.2em; border: 0.1em solid orange; background-color: white; box-shadow: 0.5em 0.9em #888;",tabBorderRadius:"0.2em",messageBodyStyle:"white-space: pre-wrap; width: 99%; font-size:100%; border: 0.07em solid #eee; border-radius:0.2em; padding: .3em 0.5em; margin: 0.1em;",pendingeditModifier:"color: #bbb;",highlightColor:"#7C4DFF",personaBarStyle:"width: 100%; height: 4em; background-color: #eee; vertical-align: middle;",searchInputStyle:"border: 0.1em solid #444; border-radius: 0.2em; width: 100%; font-size: 100%; padding: 0.1em 0.6em; margin 0.2em;",autocompleteRowStyle:"border: 0.2em solid straw;",signInButtonStyle:"padding: 1em; border-radius:0.2em; font-size: 100%;",heading1Style:"font-size: 180%; font-weight: bold; color: #888888; padding: 0.5em; margin: 0.7em 0.0m;",heading2Style:"font-size: 130%; font-weight: bold; color: #888888; padding: 0.4em; margin: 0.7em 0.0em;",heading3Style:"font-size: 120%; font-weight: bold; color: #888888; padding: 0.3em; margin: 0.7em 0.0em;",heading4Style:"font-size: 110%; font-weight: bold; color: #888888; padding: 0.2em; margin: 0.7em 0.0em;",formBorderColor:n,formHeadingColor:"#888888",formHeadingStyle:"font-size: 110%; font-weight: bold; color: #888888; padding: 0.2em; margin: 0.7em 0.0em;",formTextInput:"font-size: 100%; margin: 0.1em; padding: 0.1em;",formGroupStyle:["padding-left: 0em; border: 0.0em solid ".concat(n,"; border-radius: 0.2em;"),"padding-left: 2em; border: 0.05em solid ".concat(n,"; border-radius: 0.2em;"),"padding-left: 2em; border: 0.1em solid ".concat(n,"; border-radius: 0.2em;"),"padding-left: 2em; border: 0.2em solid ".concat(n,"; border-radius: 0.2em;")],formFieldLabelStyle:"'color: ".concat("#3B5998","; text-decoration: none;'"),formFieldNameBoxWidth:"8em",formFieldNameBoxStyle:"padding: 0.3em; vertical-align: middle; width:".concat("8em",";"),textInputBackgroundColor:"#eef",textInputBackgroundColorUneditable:"#fff",textInputColor:"#000",textInputColorPending:"#888",multilineTextInputStyle:"font-size:100%; white-space: pre-wrap; background-color: #eef; border: 0.07em solid gray; padding: 1em 0.5em; margin: 1em 1em;",renderAsDivStyle:"display: flex; align-items: center; justify-content: space-between; height: 2.5em; padding: 1em;",imageDivStyle:"width:2.5em; padding:0.5em; height: 2.5em;",linkDivStyle:"width:2em; padding:0.5em; height: 4em;"};t.style=r,r.setStyle=function(e,t){e.style=r[t]},e.exports=r},4946:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.style=void 0;var n={multiselect__container:"\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n background-color: #fff;\n border-radius: 2px;\n -webkit-box-shadow: 0 1px 3px 0 #d1d1d2, 0 0 0 1px #d1d1d2;\n box-shadow: 0 1px 3px 0 #d1d1d2, 0 0 0 1px #d1d1d2;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n min-height: 36px;\n padding: 4px 8px 0 8px;\n position: relative;\n width: 354px;\n margin-bottom: 5px;\n font-size: 100%\n ",multiselect__wrapper:"\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n height: 100%;\n width: 100%;\n ",multiselect__clear_btn:"\n cursor: pointer;\n align-items: center;\n margin-bottom: 4px;\n margin-left: 4px;\n ",multiselect__options:"\n background-color: #f6f6f6;\n border-radius: 2px;\n left: 0;\n max-height: 0;\n overflow: hidden;\n position: absolute;\n top: calc(100% + 3px);\n z-index: 9999;\n width: 100%;\n opacity: 0;\n transition: max-height 0.1s ease;\n ",multiselect__options_visible:"\n background-color: #f6f6f6;\n border-radius: 2px;\n left: 0;\n max-height: 0;\n overflow: hidden;\n position: absolute;\n top: calc(100% + 3px);\n z-index: 9999;\n width: 100%;\n opacity: 0;\n transition: max-height 0.1s ease;\n max-height: 200px;\n -webkit-box-shadow: 0 1px 3px 0 #d1d1d2, 0 0 0 1px #d1d1d2;\n box-shadow: 0 1px 3px 0 #d1d1d2, 0 0 0 1px #d1d1d2;\n opacity: 1;\n transition: max-height 0.2s ease;\n ",multiselect__options_ul:"\n list-style: none;\n margin: 0;\n padding: 2px 0;\n max-height: 200px;\n overflow: auto;\n ",multiselect__options_ul_li:"\n cursor: pointer;\n padding: 4px 8px;\n ",multiselect__options_ul_li_hover:"\n background-color: #dedede;\n ",multiselect__options_ul_p_multiselect__options_no_results:"\n margin: 0;\n padding: 8px;\n text-align: center;\n ",multiselect__options_ul_p_multiselect__options_no_data:"\n margin: 0;\n padding: 8px;\n text-align: center;\n ",multiselect__options_ul_li_multiselect__options_selected:"\n background-color: #656565;\n color: #fff;\n ",multiselect__options_ul_li_multiselect__options_selected_hover:"\n background-color: #656565;\n ",multiselect__options_ul_li_arrow_selected:"\n border: 2px solid rgba(101, 101, 101, 0.5);\n ",multiselect__selected:"\n background-color: #656565;\n border-radius: 2px;\n color: #fff;\n margin-bottom: 4px;\n margin-right: 4px;\n padding: 4px 8px;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n ",multiselect__selected_multiselect__remove_btn:"\n cursor: pointer;\n display: flex;\n margin-left: 6px;\n ",multiselect__input:"\n border: none;\n -ms-flex-preferred-size: 40%;\n flex-basis: 40%;\n -webkit-box-flex: 1;\n -ms-flex-positive: 1;\n flex-grow: 1;\n height: 5px; \n margin-bottom: 4px;\n min-width: 40%;\n outline: none; \n "};t.style=n,n.setStyle=function(e,t){e.style=n[t]},e.exports=n},303:(e,t,n)=>{"use strict";var r=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.renderTableViewPane=function(e,t){var n,r,o,s,c=t.sourceDocument,d=t.tableClass,p=t.query,f=h.ns,m=a.store,g={},v={"http://www.w3.org/2002/07/owl#sameAs":!0,"http://www.w3.org/1999/02/22-rdf-syntax-ns#type":!0},y={"http://www.w3.org/2001/XMLSchema#decimal":!0,"http://www.w3.org/2001/XMLSchema#float":!0,"http://www.w3.org/2001/XMLSchema#double":!0,"http://www.w3.org/2001/XMLSchema#integer":!0,"http://www.w3.org/2001/XMLSchema#nonNegativeInteger":!0,"http://www.w3.org/2001/XMLSchema#positiveInteger":!0,"http://www.w3.org/2001/XMLSchema#nonPositiveInteger":!0,"http://www.w3.org/2001/XMLSchema#negativeInteger":!0,"http://www.w3.org/2001/XMLSchema#long":!0,"http://www.w3.org/2001/XMLSchema#int":!0,"http://www.w3.org/2001/XMLSchema#short":!0,"http://www.w3.org/2001/XMLSchema#byte":!0,"http://www.w3.org/2001/XMLSchema#unsignedLong":!0,"http://www.w3.org/2001/XMLSchema#unsignedInt":!0,"http://www.w3.org/2001/XMLSchema#unsignedShort":!0,"http://www.w3.org/2001/XMLSchema#unsignedByte":!0},b={"http://www.w3.org/2001/XMLSchema#dateTime":!0,"http://www.w3.org/2001/XMLSchema#date":!0},w={"http://xmlns.com/foaf/0.1/Image":!0,"http://purl.org/dc/terms/Image":!0},x=t.keyVariable||"?_row",_=0,E=null,k=null,S=e.createElement("div");S.className="tableViewPane",S.appendChild(function(){var t=e.createElement("table");t.setAttribute("class","toolbar");var n=e.createElement("tr");return o=e.createElement("td"),n.appendChild(o),s=e.createElement("td"),n.appendChild(s),t.appendChild(n),t}());var C,A=e.createElement("div");if(S.appendChild(A),S.refresh=function(){Q(C.query,C.logicalRows,C.columns,C)},p)C=te(p),A.appendChild(C);else{var T=function(){var e,t,n=function(){for(var e={},t=m.statementsMatching(void 0,h.ns.rdf("type"),d,c),n={},r=0;r<t.length;++r){var i=t[r].object;if("NamedNode"===i.termType){var o=L(e,i);i.uri in n||(n[i.uri]=[]),n[i.uri].push(t[r].subject),o.addUse()}}return[n,e]}();for(var r in e=n[0],t=n[1],e){var i=e[r];M(t[r],i)}return[new I(null),N(t)]}();n=T[0],r=T[1],d||o.appendChild(function(t,n){var r=e.createElement("div");r.appendChild(e.createTextNode("Select type: "));var i=e.createElement("select");for(var o in i.appendChild(F("All types","null")),n)i.appendChild(F(n[o].getLabel(),o));return i.addEventListener("click",(function(){O("null"===i.value?t:n[i.value])}),!1),r.appendChild(i),r}(n,r)),k=function(e){var t,n=-1,r=null;for(t in e){var i=e[t];i.useCount>n&&(r=i,n=i.useCount)}return r}(r),O(k||n)}return S;function O(t){P(s),s.appendChild(function(t){var n=e.createElement("div"),r=t.getUnusedColumns();if(r.sort((function(e,t){var n=e.sortKey(),r=t.sortKey();return(n>r)-(n<r)})),r.length>0){n.appendChild(e.createTextNode("Add column: "));var i=e.createElement("select");i.appendChild(F("","-1"));for(var o=0;o<r.length;++o){var a=r[o];i.appendChild(F(a.getLabel(),""+o))}n.appendChild(i),i.addEventListener("click",(function(){var e=Number(i.value);e>=0&&(t.addColumn(r[e]),O(t))}),!1)}return n}(t)),function(e,t){E&&(E.running=!1);var n=te(e,t);P(A),A.appendChild(n),E=e}(function(e){var t=new u.Query,n=m.variable(x.slice(1));return function(e,t){for(var n=t.getColumns(),r=0;r<n.length;++r){var i=m.variable("_col"+r);e.vars.push(i),n[r].setVariable(i)}}(t,e),function(e,t,n){var r=n.type;r||(r=m.variable("_any")),e.pat.add(t,h.ns.rdf("type"),r)}(t,n,e),function(e,t,n){for(var r=n.getColumns(),i=0;i<r.length;++i){var o=r[i],a=m.formula();a.add(t,o.predicate,o.getVariable()),e.pat.optional.push(a)}}(t,n,e),t}(t),t)}function P(e){for(;e.childNodes.length>0;)e.removeChild(e.childNodes[0])}function I(e){this.type=e,this.columns=null,this.allColumns=[],this.useCount=0,this.getAllColumns=function(){return this.allColumns},this.getColumns=function(){if(!this.columns){var e=this.getAllColumns();this.columns=e.slice(0,7)}return this.columns},this.getUnusedColumns=function(){for(var e=this.getAllColumns(),t=this.getColumns(),n=[],r=0;r<e.length;++r)-1===t.indexOf(e[r])&&n.push(e[r]);return n},this.addColumn=function(e){this.columns.push(e)},this.removeColumn=function(e){this.columns=this.columns.filter((function(t){return t!==e}))},this.getLabel=function(){return l.label(this.type)},this.addUse=function(){this.useCount+=1}}function j(){this.useCount=0,this.checkedAnyValues=!1,this.possiblyLiteral=!0,this.possiblyNumber=!0,this.constraints=[],this.checkValue=function(e){var t=e.termType;this.possiblyLiteral&&"Literal"!==t&&"NamedNode"!==t?(this.possiblyNumber=!1,this.possiblyLiteral=!1):this.possiblyNumber&&("Literal"!==t?this.possiblyNumber=!1:e.value.match(/^-?\d+(\.\d*)?$/)||(this.possiblyNumber=!1)),this.checkedAnyValues=!0},this.getVariable=function(){return this.variable},this.setVariable=function(e){this.variable=e},this.getKey=function(){return this.variable.toString()},this.addUse=function(){this.useCount+=1},this.getHints=function(){return t&&t.hints&&this.variable&&t.hints[this.variable.toNT()]?t.hints[this.variable.toNT()]:{}},this.getLabel=function(){return this.getHints().label?this.getHints().label:this.predicate?this.predicate.sameTerm(f.rdf("type"))&&this.superClass?l.label(this.superClass,!0):l.label(this.predicate):this.variable?this.variable.toString():"unlabeled column?"},this.setPredicate=function(e,t,n){t?(this.inverse=e,this.constraints=this.constraints.concat(m.each(e,h.ns.rdfs("domain"))),e.sameTerm(f.rdfs("subClassOf"))&&"NamedNode"===n.termType&&(this.superClass=n,this.alternatives=m.each(void 0,f.rdfs("subClassOf"),n))):(this.predicate=e,this.constraints=this.constraints.concat(m.each(e,h.ns.rdfs("range"))))},this.getConstraints=function(){return this.constraints},this.filterFunction=function(){return!0},this.sortKey=function(){return this.getLabel().toLowerCase()},this.isImageColumn=function(){for(var e=0;e<this.constraints.length;e++)if(this.constraints[e].uri in w)return!0;return!1}}function N(e,t){var n=[];for(var r in e){var i=e[r];t&&!t(r,i)||n.push(i)}return n}function F(t,n){var r=e.createElement("option");return r.setAttribute("value",n),r.appendChild(e.createTextNode(t)),r}function R(e,t){var n;return t.uri in e?n=e[t.uri]:((n=new j).setPredicate(t),e[t.uri]=n),n}function L(e,t){var n;return t.uri in e?n=e[t.uri]:(n=new I(t),e[t.uri]=n),n}function D(e,t){for(var n=m.statementsMatching(e,void 0,void 0,c),r={},i=0;i<n.length;++i){var o=n[i].predicate;if(!(o.uri in v)){var a=R(t,o);a.checkValue(n[i].object),r[o.uri]=a}}return r}function M(e,t){for(var n={},r=0;r<t.length;++r){var i=D(t[r],n);for(var o in i)i[o].addUse()}var a=N(n);!function(e){e.sort((function(e,t){return(e.useCount<t.useCount)-(e.useCount>t.useCount)}))}(a),e.allColumns=a}function U(t,n){var r=e.createElement("a");return r.appendChild(e.createTextNode("[x]")),r.addEventListener("click",(function(){t.removeColumn(n),O(t)}),!1),r}function B(e,t){for(var n=!0,r=0;r<t.length;++r){var i=t[r],o=i.getKey(),a=null;if(o in e.values&&(a=e.values[o][0]),!i.filterFunction(a)){n=!1;break}}e._htmlRow.style.display=n?"":"none"}function H(e,t){for(var n=0;n<e.length;++n)B(e[n],t)}function q(e,t,n){function r(e){return e?"Literal"===e.termType?e.value.toLowerCase():"NamedNode"===e.termType?l.label(e).toLowerCase():e.value.toLowerCase():""}!function(e,t,n,i){var o=t.getKey();if(e.sort((function(e,t){var n=null,a=null;o in e.values&&(n=e.values[o][0]),o in t.values&&(a=t.values[o][0]);var s,c,u,l=(s=a,c=r(n),u=r(s),c<u?-1:c>u?1:0);return i?-l:l})),e.length){for(var a=e[0]._htmlRow.parentNode,s=0;s<e.length;++s)a.removeChild(e[s]._htmlRow);for(var c=0;c<e.length;++c)a.appendChild(e[c]._htmlRow)}}(e,t,0,n)}function W(t,n,r){var i=e.createElement("div"),o=e.createElement("input");o.setAttribute("type","text"),o.style.width="70%",i.appendChild(o);var a=e.createElement("span");a.appendChild(e.createTextNode("▼")),a.addEventListener("click",(function(){q(t,r,!1)}),!1),i.appendChild(a);var s=e.createElement("span");s.appendChild(e.createTextNode("▲")),s.addEventListener("click",(function(){q(t,r,!0)}),!1),i.appendChild(s);var c=null;return r.filterFunction=function(e){return!c||!!e&&("Literal"===e.termType?e.value:"NamedNode"===e.termType?l.label(e):"").toLowerCase().indexOf(c)>=0},o.addEventListener("keyup",(function(){c=""!==o.value?o.value.toLowerCase():null,H(t,n)}),!1),i}function K(t,n,r,i){for(var o=e.createElement("div"),a=e.createElement("select"),s={},c=0;c<i.length;++c){var u=i[c];s[u.uri]=!0}var d=Z(r).initialSelection;d&&(s=d),a.setAttribute("multiple","true");for(var p=0;p<i.length;++p){var f=i[p],h=F(l.label(f),p);s[f.uri]&&(h.selected=!0),a.appendChild(h)}return o.appendChild(a),r.filterFunction=function(e){return!s||e&&s[e.uri]},a.addEventListener("click",(function(){s={};for(var e=a.options,r=0;r<e.length;r++){var o=e[r],c=Number(o.value);e[r].selected&&(s[i[c].uri]=!0)}H(t,n)}),!0),o}function V(t,n,r){var i=e.createElement("div"),o=e.createElement("input");o.setAttribute("type","text"),o.style.width="40px",i.appendChild(o);var a=e.createElement("input");a.setAttribute("type","text"),a.style.width="40px",i.appendChild(a);var s=null,c=null;function u(){s=""===o.value?null:Number(o.value),c=""===a.value?null:Number(a.value),H(t,n)}return r.filterFunction=function(e){return e&&(e=Number(e)),!(s&&(!e||e<s)||c&&(!e||e>c))},o.addEventListener("keyup",u,!1),a.addEventListener("keyup",u,!1),i}function J(e,t,n){if(n.superClass&&n.alternatives.length>0)return K(e,t,n,n.alternatives);for(var r,i=n.getConstraints(),o=0;o<i.length;o++){if(r=i[o],n.checkedAnyValues&&n.possiblyNumber||r.uri in y)return V(e,t,n);if("http://www.w3.org/2000/01/rdf-schema#Literal"===r.uri)return W(e,t,n);var a=m.each(r,h.ns.owl("oneOf"));if(a.length>0)return K(e,t,n,a.elements)}return function(e,t,n){return n.checkedAnyValues&&n.possiblyNumber?V(e,t,n):n.possiblyLiteral?W(e,t,n):null}(e,t,n)}function z(t,n,r){r=r||{};var o=e.createElement("a"),a=r.linkFunction;return o.setAttribute("href",t),o.appendChild(e.createTextNode(n)),a?o.addEventListener("click",(function(e){e.preventDefault(),e.stopPropagation();var t=l.getTarget(e).getAttribute("href");t||i.log("No href found \n"),a(t)}),!0):o.addEventListener("click",h.widgets.openHrefInOutlineMode,!0),o}function Z(e){return t&&t.hints&&e.variable&&t.hints[e.variable.toNT()]?t.hints[e.variable.toNT()]:{}}function $(t,n){var r=Z(n),i=r.cellFormat;if(!i){if("Literal"===t.termType){if(t.datatype){if(b[t.datatype.uri])return e.createTextNode(h.widgets.shortDate(t.value));if(y[t.datatype.uri]){var o=e.createElement("span");return o.textContent=t.value,o.setAttribute("style","text-align: right"),o}}return e.createTextNode(t.value)}if("NamedNode"===t.termType&&n.isImageColumn())return function(t){var n=e.createElement("img");return n.setAttribute("src",t.uri),n.style.height="40px",n}(t);if("NamedNode"===t.termType||"BlankNode"===t.termType)return function(e,t){var n=!1;return e.uri&&(n=e.uri.match(/^mailto:(.*)/)),z(e.uri,n?n[1]:l.label(e),t)}(t,r);if("Collection"===t.termType){var a=e.createElement("span");return a.appendChild(e.createTextNode("[")),t.elements.forEach((function(t){a.appendChild($(t,n)),a.appendChild(e.createTextNode(", "))})),a.removeChild(a.lastChild),a.appendChild(e.createTextNode("]")),a}return e.createTextNode("unknown termtype '"+t.termType+"'!")}if("shortDate"===i)return e.createTextNode(h.widgets.shortDate(t.value))}function G(e,t){var n,r=null;if("Literal"===e.termType)r="value";else{if("NamedNode"!==e.termType)return t.indexOf(e)>=0;r="uri"}for(n=0;n<t.length;++n)if(t[n].termType===e.termType&&t[n][r]===e[r])return!0;return!1}function X(e){if("uri"in e)return e.uri;if("_subject_id"in e)return e._subject_id;var t=""+_;return e._subject_id=t,++_,t}function Q(n,r,o,a){n.running=!0;var s=Date.now(),c=e.createElement("tr");a.appendChild(c),c.textContent="Loading ...";for(var u=0;u<r.length;u++)r[u].original=!0,r[u].originalValues||(r[u].originalValues=r[u].values),r[u].values={};m.query(n,(function(t){if(n.running){c.textContent+=".";var i,s=null,u=null;if(x in t&&(i=X(u=t[x]))in g&&(s=g[i]),!s){var l=e.createElement("tr");a.appendChild(l),s={_htmlRow:l,_subject:u,values:{}},r.push(s),u&&(g[i]=s)}delete s.original,function(t,n,r){var i,o=!1;for(i in r){var a=r[i];i in t.values||(t.values[i]=[]),G(a,t.values[i])||(t.values[i].push(a),o=!0)}o&&(P(t._htmlRow),function(t,n,r,i){var o=e.createElement("td");n._subject&&"uri"in n._subject&&o.appendChild(z(n._subject.uri,"→")),t.appendChild(o);for(var a=0;a<r.length;++a){var s=r[a],c=e.createElement("td"),u=void 0,l=s.getKey();if(l in n.values){var d=n.values[l],p=!1;n.originalValues&&n.originalValues[l]&&d.length!==n.originalValues[l].length&&(p=!0);for(var f=0;f<d.length;++f){var h=d[f];n.originalValues&&n.originalValues[l]&&n.originalValues[l].length>f&&(u=n.originalValues[l][f],h.toString()!==u.toString()&&(p=!0)),c.appendChild($(h,s)),f!==d.length-1&&c.appendChild(e.createTextNode(",\n")),p&&(c.style.background="#efe")}}t.appendChild(c)}n._htmlRow=t}(t._htmlRow,t,n)),B(t,n)}(s,o,t)}}),void 0,(function(){c&&c.parentNode&&c.parentNode.removeChild&&(c.parentNode.removeChild(c),c=null);var e=Date.now()-s;i.log("Query done: "+r.length+" rows, "+e+"ms");for(var n=r.length-1;n>=0;n--)if(r[n].original){i.log(" deleting row "+r[n]._subject);var a=r[n]._htmlRow;a.parentNode.removeChild(a),delete g[X(r[n]._subject)],r.splice(n,1)}if(t.sortBy){var u=function(e,t){for(var n in e){var r=e[n];if(r.variable.toNT()===t)return r}throw new Error("getColumnForVariable: no column for variable ".concat(t))}(o,t.sortBy);q(r,u,t.sortReverse)}t.onDone&&t.onDone(S)}))}function Y(e,t){h.log.debug(">> processing formula");for(var n=0;n<t.statements.length;++n){var r=t.statements[n];if("NamedNode"===r.predicate.termType&&"Variable"===r.object.termType){var i=r.object.toString();i in e&&e[i].setPredicate(r.predicate,!1,r.subject)}if("NamedNode"===r.predicate.termType&&"Variable"===r.subject.termType){var o=r.subject.toString();o in e&&e[o].setPredicate(r.predicate,!0,r.object)}}for(var a=0;a<t.optional.length;++a)h.log.debug("recurse to optional subformula "+a),Y(e,t.optional[a]);h.log.debug("<< finished processing formula")}function ee(e){for(var t=[],n={},r=0;r<e.vars.length;++r){var i=new j,o=e.vars[r];h.log.debug("column "+r+" : "+o),i.setVariable(o),n[o]=i,t.push(i)}return Y(n,e.pat),t}function te(t,n){var r;r=p?ee(t):n.getColumns();var i=[],o=e.createElement("table");return o.appendChild(function(t,n){var r=e.createElement("tr"),i=e.createElement("th");r.appendChild(i);for(var o=0;o<t.length;++o){var a=e.createElement("th"),s=t[o];a.appendChild(e.createTextNode(s.getLabel())),n&&a.appendChild(U(n,s)),r.appendChild(a)}return r}(r,n)),o.appendChild(function(t,n){var r=e.createElement("tr");r.className="selectors",r.appendChild(e.createElement("td"));for(var i=0;i<n.length;++i){var o=e.createElement("td"),a=J(t,n,n[i]);a&&o.appendChild(a),r.appendChild(o)}return r}(i,r)),o.logicalRows=i,o.columns=r,o.query=t,Q(t,i,r,o),o}};var i=f(n(4433)),o=n(1124),a=n(166),s=f(n(8853)),c=f(n(6590)),u=f(n(6022)),l=f(n(5666)),d=f(n(2457));function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(p=function(e){return e?n:t})(e)}function f(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=p(t);if(n&&n.has(e))return n.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,n&&n.set(e,i),i}var h={icons:o.icons,log:s,ns:c,utils:l,widgets:d}},5084:(e,t,n)=>{"use strict";var r=n(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.TabWidgetElement=void 0,t.tabWidget=function(e){var t=e.subject,n=e.dom||document,r=parseInt(e.orientation||"0"),o=e.backgroundColor||"#ddddcc",a=2&r,s=1&r,c=e.onClose,u=function(e){return function(e){for(var t=0,n=0;n<3;n++)t+=parseInt(e.slice(2*n+1,2*n+3),16);return t>384}(e)?[v(e,"#ffffff",.3),"#000000"]:[v(e,"#000000",.3),"#ffffff"]}(o),l=(0,i.default)(u,2),d=l[0],p=l[1],g="flex: 2; width: auto; height: 100%; border: 0.1em; border-style: solid; border-color: ".concat(d,"; padding: 1em;"),y=n.createElement("div");y.setAttribute("style","display: flex; height: 100%; width: 100%; flex-direction: "+(s?"row":"column")+(a?"-reverse;":";"));var b=y.appendChild(n.createElement("nav"));b.setAttribute("style","margin: 0;");var w=y.appendChild(n.createElement("main"));w.setAttribute("style","margin: 0; width:100%; height: 100%;");var x=b.appendChild(n.createElement("ul"));x.setAttribute("style","\n list-style-type: none;\n display: flex;\n height: 100%;\n width: 100%;\n margin: 0;\n padding: 0;\n flex-direction: ".concat(s?"column":"row","\n "));var _=w;y.tabContainer=x,y.bodyContainer=_;var E=["0.2em","0.2em","0","0"],k=E.concat(E).slice(r,r+4),S="border-radius: ".concat(k.join(" "),";"),C=["0.3em","0.3em","0","0.3em"],A=C.concat(C).slice(r,r+4),T="margin: ".concat(A.join(" "),";"),O="padding: ".concat(A.join(" "),";"),P=S+"position: relative; padding: 0.7em; max-width: 20em; color: ".concat(p,";"),I="".concat(P+T," opacity: 50%; background-color: ").concat(o,";"),j="".concat(P+T," background-color: ").concat(d,";"),N="height: 100%; width: 100%;",F=N+"display: none;";if(y.refresh=U,U(),!e.startEmpty&&x.children.length&&e.selectedTab){var R=Array.from(x.children).map((function(e){return e.firstChild})).find((function(t){return t.dataset.name===e.selectedTab})),L=e.selectedTab.uri,D=(Array.from(x.children).find((function(e){return e.subject&&e.subject.uri&&e.subject.uri===L}))||R||x.children[0]).firstChild;D&&D.click()}else e.startEmpty||x.children[0].firstChild.click();return y;function M(t){var r=n.createElement("li");r.setAttribute("style",I),r.subject=t;var i=r.appendChild(n.createElement("button"));if(i.setAttribute("style","background: none; border: none; font: inherit; cursor: pointer"),i.onclick=function(){if(B(),H(),r.setAttribute("style",j),r.bodyTR){r.bodyTR.setAttribute("style",N);var n=a(r);e.renderMain&&r.subject&&!1!==n.asSettings&&(n.innerHTML="loading item ..."+t,e.renderMain(n,r.subject),n.asSettings=!1)}},e.renderTabSettings&&r.subject){var o=n.createElement("button");o.textContent="...",o.setAttribute("style","position: absolute; right: 0; bottom: 0; width: 20%; background: none; color: inherit; border: none; padding: 0; font: inherit; cursor: pointer; outline: inherit;"),o.onclick=function(){if(B(),H(),r.setAttribute("style",j),r.bodyTR){r.bodyTR.setAttribute("style",N);var n=a(r);e.renderTabSettings&&r.subject&&!0!==n.asSettings&&(n.innerHTML="loading settings ..."+t,e.renderTabSettings(n,r.subject),n.asSettings=!0)}},r.appendChild(o)}return e.renderTab?e.renderTab(i,t):i.innerHTML=(0,h.label)(t),r;function a(e){var t,r=null===(t=e.bodyTR)||void 0===t?void 0:t.children[0];if(r)return r;var i=e.bodyTR.appendChild(n.createElement("main"));return i.setAttribute("style",g),i}}function U(){var r,i,o,a,s,u=e.items?e.items:!1!==e.ordered?m.store.the(t,e.predicate).elements:m.store.each(t,e.predicate),l=!1;for(a=0;a<x.children.length;a++)if(r=x.children[a],a>=u.length||r.subject&&!r.subject.sameTerm(u[a])){l=!0;break}if(l||u.length!==x.children.length){for(s=x.children.length-1;s>=0&&(r=x.children[s],o=s-x.children.length+u.length,!r.subject||r.subject.sameTerm(u[o]));s--);for(var d=u.slice(a,s-x.children.length+u.length+1);s>=a;)x.removeChild(x.children[a]),_.removeChild(_.children[a]),s-=1;for(i=0;i<d.length;i++){var p=M(d[i]),h=n.createElement("div");p.bodyTR=h,a===x.children.length?(x.appendChild(p),_.appendChild(h)):(x.insertBefore(p,x.children[a+i]),_.insertBefore(h,_.children[a+i]))}c&&function(e){if(e.dataset.onCloseSet){var t=e.querySelector(".unstyled");e.removeChild(t)}var r=n.createElement("li");r.classList.add("unstyled");var i=(0,f.cancelButton)(n,c);i.setAttribute("style",i.getAttribute("style")+O),r.appendChild(i),e.appendChild(r),e.dataset.onCloseSet="true"}(x)}}function B(){for(var e=0;e<x.children.length;e++){var t=x.children[e];t.classList.contains("unstyled")||t.setAttribute("style",I)}}function H(){for(var e=0;e<_.children.length;e++)_.children[e].setAttribute("style",F)}};var i=r(n(7424)),o=r(n(9728)),a=r(n(6690)),s=r(n(6115)),c=r(n(1655)),u=r(n(4993)),l=r(n(3808)),d=r(n(3496)),p=r(n(8416)),f=n(2457),h=n(5666),m=n(166);HTMLElement;var g=function(e){(0,c.default)(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=(0,l.default)(t);if(n){var i=(0,l.default)(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return(0,u.default)(this,e)});function i(){var e;(0,a.default)(this,i);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e=r.call.apply(r,[this].concat(n)),(0,p.default)((0,s.default)(e),"bodyContainer",void 0),(0,p.default)((0,s.default)(e),"refresh",void 0),(0,p.default)((0,s.default)(e),"tabContainer",void 0),e}return(0,o.default)(i)}((0,d.default)(HTMLElement));function v(e,t,n){for(var r,i,o="#",a="0123456789abcdef",s=0;s<3;s++){r=parseInt(e.slice(2*s+1,2*s+3),16),i=parseInt(t.slice(2*s+1,2*s+3),16);var c=parseInt((""+(r*(1-n)+i*n)).split(".")[0]),u=parseInt((""+c/16).split(".")[0]),l=parseInt((""+c%16).split(".")[0]);o+=a[u]+a[l]}return o}t.TabWidgetElement=g,HTMLElement},2665:(e,t,n)=>{"use strict";var r=n(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.addStyleClassToElement=function(e,t,n){t.forEach((function(t){var r=function(e,t){return t&&"footer"===t?l.styleMap[e]:u.styleMap[e]}(t,n),i=(0,d.getClasses)(document.head,(0,a.default)({},t,r)).classes;e.classList.add(i[t])}))},t.getName=function(e,t){return e.anyValue(t,c.ns.vcard("fn"),null,t.doc())||e.anyValue(t,c.ns.foaf("name"),null,t.doc())||t.uri},t.getPod=function(){return(0,s.sym)(document.location.origin).site()},t.getPodOwner=function(e,t){return p.apply(this,arguments)},t.throttle=function(e,t){var n,r,i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=null,s=0,c=function(){s=o.leading?Date.now():0,a=null,i=e.apply(n,r),a||(n=r=null)};return function(){var u=Date.now();s||o.leading||(s=u);var l=t-(u-s);return n=this,r=arguments,l<=0||l>t?(a&&(clearTimeout(a),a=null),s=u,i=e.apply(n,r),a||(n=r=null)):a||!1===o.trailing||(a=setTimeout(c,l)),i}};var i=r(n(4687)),o=r(n(7156)),a=r(n(8416)),s=n(6022),c=n(1568),u=n(366),l=n(8154),d=n(1909);function p(){return(p=(0,o.default)(i.default.mark((function e(t,n){var r,o,a,u;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,n.any(t,null,c.ns.ldp("Container"),t)){e.next=7;break}return e.next=4,n.fetcher.webOperation("GET",t.uri,n.fetcher.initFetchOptions(t.uri,{headers:{accept:"text/turtle"}}));case 4:r=e.sent,o=r.responseText,(0,s.parse)(o,n,t.uri,"text/turtle");case 7:e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(0),console.error("Error loading pod "+t+": "+e.t0),e.abrupt("return",null);case 13:if(n.holds(t,c.ns.rdf("type"),c.ns.space("Storage"),t)){e.next=16;break}return console.warn("Pod "+t+" does not declare itself as a space:Storage"),e.abrupt("return",null);case 16:if(!(a=n.any(t,c.ns.solid("owner"),null,t)||n.any(null,c.ns.space("storage"),t,t))){e.next=31;break}return e.prev=18,e.next=21,n.fetcher.load(a.doc());case 21:e.next=27;break;case 23:return e.prev=23,e.t1=e.catch(18),console.warn("Unable to load profile of pod owner "+a),e.abrupt("return",null);case 27:return n.holds(a,c.ns.space("storage"),t,a.doc())||console.warn("Pod owner ".concat(a," does NOT list pod ").concat(t," as their storage")),e.abrupt("return",a);case 31:return u=(0,s.sym)("".concat(t.uri,"profile/card#me")),e.prev=32,e.next=35,n.fetcher.load(u);case 35:e.next=41;break;case 37:return e.prev=37,e.t2=e.catch(32),console.error("Ooops. Guessed wrong pod owner webid {$guess} : can't load it."),e.abrupt("return",null);case 41:if(!n.holds(u,c.ns.space("storage"),t,u.doc())){e.next=44;break}return console.warn("Using guessed pod owner webid but it links back."),e.abrupt("return",u);case 44:return e.abrupt("return",null);case 45:case"end":return e.stop()}}),e,null,[[0,9],[18,23],[32,37]])})))).apply(this,arguments)}},5666:(e,t,n)=>{"use strict";var r=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.AJARImage=function(e,t,n,r){r||(r=document);var i=r.createElement("img");return i.setAttribute("src",e),i.addEventListener("copy",(function(e){e.clipboardData.setData("text/plain",""),e.clipboardData.setData("text/html",""),e.preventDefault()})),void 0!==n&&i.setAttribute("title",n),i},t.RDFComparePredicateObject=function(e,t){var n=e.predicate.compareTerm(t.predicate);return 0!==n?n:e.object.compareTerm(t.object)},t.RDFComparePredicateSubject=function(e,t){var n=e.predicate.compareTerm(t.predicate);return 0!==n?n:e.subject.compareTerm(t.subject)},t.addLoadEvent=function(e){var t=window.onload;"function"!=typeof window.onload?window.onload=e:window.onload=function(){t(),e()}},t.ancestor=function(e,t){var n;for(n=e;n;n=n.parentNode)try{if(n.tagName===t)return n}catch(e){return}},t.beep=function(){if(d){var e=new d;return function(t,n,r,i){t=+(t||.3),r=r||"sine","function"!=typeof i&&(i=function(){});var o=e.createOscillator();o.type=r,o.frequency.value=n||256,o.connect(e.destination),o.start(0),o.stop(t)}}},t.clearVariableNames=function(){f=0},t.emptyNode=function(e){for(var t=e.childNodes,n=t.length-1;n>=0;n--)e.removeChild(t[n]);return e},t.escapeForXML=v,t.findPos=m,t.genUuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},t.getAbout=h,t.getEyeFocus=function(e,t,n,r){r||(r=window);var i=m(e)[1],o=window.SolidAppContext||{},a=i-(o&&o.scroll||52)-r.scrollY;if(t)return n?void r.scrollBy(0,i+e.clientHeight-(r.scrollY+r.innerHeight)):void r.scrollBy(0,a);var s=r.setInterval((function(){r.scrollBy(0,a/10),10==++c&&r.clearInterval(s)}),50),c=0},t.getTarget=function(e){var t;return(e=e||window.event).target?t=e.target:e.srcElement&&(t=e.srcElement),3===t.nodeType&&(t=t.parentNode),t},t.getTerm=function(e){var t=e.parentNode,n=t?t.AJAR_statement:void 0;switch(n?e.className:""){case"pred":case"pred selected":return n.predicate;case"obj":case"obj selected":return t.AJAR_inverse?n.subject:n.object;case"":case"selected":return h(o.store,e);case"undetermined selected":return e.nextSibling?n.predicate:t.AJAR_inverse?n.subject:n.object}},t.hashColor=function(e){return"#"+(16777215&(t=e=e.uri||e,t.split("").reduce((function(e,t){return(e=(e<<5)-e+t.charCodeAt(0))&e}),0))|12632256).toString(16);var t},t.include=function(e,t){var n=e.createElement("script");return n.setAttribute("type","text/javascript"),n.setAttribute("src",t),n},Object.defineProperty(t,"label",{enumerable:!0,get:function(){return c.label}}),t.labelForXML=function(e){return v((0,c.label)(e))},t.labelWithOntology=function(e,t){var n=o.store.findTypeURIs(e);return n[p.ns.rdf("Predicate").uri]||n[p.ns.rdfs("Class").uri]?(0,c.label)(e,t)+" ("+g(e)+")":(0,c.label)(e,t)},t.newVariableName=function(){return"v"+f++},t.ontologyLabel=g,t.predParentOf=function(e){for(var t=e;;){if(t.getAttribute("predTR"))return t;if(!t.previousSibling||"TR"!==t.previousSibling.nodeName)return p.log.error("Could not find predParent"),e;t=t.previousSibling}},t.predicateLabel=y,t.predicateLabelForXML=function(e,t){return v(y(e,t))},t.shortName=function(e){var t=e;"#/".indexOf(t[t.length-1])>=0&&(t=t.slice(0,-1));var n,r=[];for(var i in this.prefixes)r[this.prefixes[i]]=i;var o,a=function(e){return"ns"!==e&&(n=e,!0)},s=t.lastIndexOf("#");for(s>=0&&(t=t.slice(s-1));;){var c=t.lastIndexOf("/");for(c>=0&&(t=t.slice(c+1)),o=0;o<t.length&&this.prefixchars.indexOf(t[o]);)o++;if((t=t.slice(0,o)).length<6&&a(t))return n;if(a(t.slice(0,3)))return n;if(a(t.slice(0,2)))return n;if(a(t.slice(0,4)))return n;if(a(t.slice(0,1)))return n;if(a(t.slice(0,5)))return n;for(o=0;;o++)if(a(t.slice(0,3)+o))return n}},t.stackString=function(e){var t,n=e+"\n";if(!e.stack)return n+"No stack available.\n";var r=e.stack.toString().split("\n"),i=[];for(t=0;t<r.length;t++){var o=r[t];if(o.indexOf("ecmaunit.js")>-1)break;"("===o.charAt(0)&&(o="function"+o);var a=o.split("@");i.push(a)}for(t=0;t<i.length;t++)n+=" "+i[t][1]+"\n "+i[t][0];return n},t.syncTableToArray=function(e,t,n){var r,i,o;for(o=0;o<e.children.length;o++)(i=e.children[o]).trashMe=!0;for(var a=0;a<t.length;a++){var s=t[a];for(r=!1,o=0;o<e.children.length;o++)if((i=e.children[o]).subject&&i.subject.sameTerm(s)){i.trashMe=!1,r=!0;break}if(!r){var c=n(s);if(a>=e.children.length)e.appendChild(c);else{var u=e.children[a];e.insertBefore(c,u)}c.subject=s}}for(o=0;o<e.children.length;o++)(i=e.children[o]).trashMe&&e.removeChild(i)},t.syncTableToArrayReOrdered=function(e,t,n){for(var r={},i=0;i<e.children.length;i++){var o=e.children[i];r[o.subject.toNT()]=o}for(var a=0;a<t.length;a++){var s=t[a];if(a>=e.children.length){var c=n(s);c.subject=s,e.appendChild(c)}else{var u=e.children[a];if(u.subject.sameTerm(s));else{var l=r[s.toNT()];if(l)e.removeChild(l),e.insertBefore(l,u);else{var d=n(s);u.before(d),d.subject=s}}}}for(;e.children.length>t.length;)e.removeChild(e.children[e.children.length-1])};var i=l(n(8853)),o=n(166),a=l(n(6590)),s=l(n(6022)),c=n(7762);function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}function l(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,n&&n.set(e,i),i}var d,p={log:i,ns:a,rdf:s},f=0;function h(e,t){var n,r;for(n=t;n&&1===n.nodeType;n=n.parentNode)if(r=n.getAttribute("about"))return e.fromNT(r);p.log.debug("getAbout: No about found")}function m(e){var t=e.ownerDocument.documentElement.getBoundingClientRect(),n=e.getBoundingClientRect();return[n.left-t.left,n.top-t.top]}function g(e){if(void 0===e.uri)return"??";var t,n=e.uri,r=[],i=n.lastIndexOf("#");if(i>=0)n=n.slice(0,i+1);else{if(!((i=n.lastIndexOf("/"))>=0))return e.uri+"?!";n=n.slice(0,i+1)}for(var o in p.ns)r[p.ns[o]]=o;try{return r[n]}catch(e){}for(n=n.slice(0,-1);n;){if(!((i=n.lastIndexOf("/"))>=0))return e.uri+"!?";if(t=n.slice(i+1),n=n.slice(0,i),"ns"!==t&&"0123456789".indexOf(t[0])<0)return t}}function v(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;")}function y(e,t){var n=(0,c.label)(e);if(t){var r=o.store.any(e,p.ns.owl("inverseOf"))||o.store.any(void 0,p.ns.owl("inverseOf"),e);return r?(0,c.label)(r):"type"===n?"...":"is "+n+" of"}return n}"undefined"!=typeof AudioContext?d=AudioContext:"undefined"!=typeof window&&(d=window.AudioContext||window.webkitAudioContext)},7762:(e,t,n)=>{"use strict";var r=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.label=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function n(e){return t?e.slice(0,1).toUpperCase()+e.slice(1):e}function r(e){var t="";"/"===e.slice(-1)&&(e=e.slice(0,-1));for(var r=0;r<e.length;r++)"_"!==e[r]&&"-"!==e[r]?(t+=e[r],r+1<e.length&&e[r].toUpperCase()!==e[r]&&e[r+1].toLowerCase()!==e[r+1]&&(t+=" ")):t+=" ";return"has "===t.slice(0,4)&&(t=t.slice(4)),n(t)}var i=l(e);if(i)return n(i.value);if("BlankNode"===e.termType)return"...";if("Collection"===e.termType)return"("+e.elements.length+")";var o=e.uri;if(void 0===o)return e.toString();try{o=o.split("/").map(decodeURIComponent).join("/")}catch(e){for(var a=o.length-3;a>0;a--)for(var s="0123456789abcefABCDEF";"%"===o[a]&&s.indexOf(o[a+1])>=0&&s.indexOf(o[a+2])>=0;)o=o.slice(0,a)+String.fromCharCode(parseInt(o.slice(a+1,a+3),16))+o.slice(a+3)}o=u(o,"/profile/card#me"),o=u(o,"#this");var c=(o=u(o,"#me")).indexOf("#");if(c>=0)return r(o.slice(c+1));var d=o.lastIndexOf("/",o.length-2);return d>=0&&d<e.uri.length?r(o.slice(d+1)):n(decodeURIComponent(e.uri))};var i=s(n(8853)),o=n(166);function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(a=function(e){return e?n:t})(e)}function s(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=a(t);if(n&&n.has(e))return n.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var c=o?Object.getOwnPropertyDescriptor(e,s):null;c&&(c.get||c.set)?Object.defineProperty(i,s,c):i[s]=e[s]}return i.default=e,n&&n.set(e,i),i}var c={log:i,ns:s(n(6590)),rdf:s(n(6022))};function u(e,t){var n=-1*t.length;return e.slice(n)===t?e.slice(0,n):e}function l(e){return o.store.any(e,c.ns.ui("label"))||o.store.any(e,c.ns.link("message"))||o.store.any(e,c.ns.vcard("fn"))||o.store.any(e,c.ns.foaf("name"))||o.store.any(e,c.ns.dct("title"))||o.store.any(e,c.ns.dc("title"))||o.store.any(e,c.ns.rss("title"))||o.store.any(e,c.ns.contact("fullName"))||o.store.any(e,o.store.sym("http://www.w3.org/2001/04/roadmap/org#name"))||o.store.any(e,c.ns.cal("summary"))||o.store.any(e,c.ns.foaf("nick"))||o.store.any(e,c.ns.as("name"))||o.store.any(e,c.ns.schema("name"))||o.store.any(e,c.ns.rdfs("label"))||o.store.any(e,o.store.sym("http://www.w3.org/2004/02/skos/core#prefLabel"))}},7269:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.versionInfo=void 0,t.versionInfo={buildTime:"2023-03-26T16:36:05Z",commit:"2fde6df4d1c2062cd3afe339185cfce0f63e8c96",npmInfo:{"solid-ui":"2.4.27",npm:"8.19.4",node:"16.19.1",v8:"9.4.146.26-node.24",uv:"1.43.0",zlib:"1.2.11",brotli:"1.0.9",ares:"1.18.1",modules:"93",nghttp2:"1.47.0",napi:"8",llhttp:"6.0.10",openssl:"1.1.1t+quic",cldr:"41.0",icu:"71.1",tz:"2022f",unicode:"14.0",ngtcp2:"0.8.1",nghttp3:"0.7.0"}}},6186:(e,t,n)=>{"use strict";var r=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.addStyleSheet=function(e,t){for(var n=e.querySelectorAll("link"),r=0;r<n.length;r++)if("stylesheet"===(n[r].getAttribute("rel")||"")&&(n[r].getAttribute("href")||"")===t)return;var i=e.createElement("link");i.setAttribute("rel","stylesheet"),i.setAttribute("type","text/css"),i.setAttribute("href",t),e.getElementsByTagName("head")[0].appendChild(i)},t.allClassURIs=function(){var e={};return p.store.statementsMatching(void 0,a.rdf("type"),void 0).forEach((function(t){t.object.value&&(e[t.object.value]=!0)})),p.store.statementsMatching(void 0,a.rdfs("subClassOf"),void 0).forEach((function(t){t.object.value&&(e[t.object.value]=!0),t.subject.value&&(e[t.subject.value]=!0)})),p.store.each(void 0,a.rdf("type"),a.rdfs("Class")).forEach((function(t){t.value&&(e[t.value]=!0)})),e},t.askName=function(e,t,n,r,i,o){return new Promise((function(t,c){var u=e.createElement("div");r=r||a.foaf("name");var l=(o=o||(i?f.label(i):" "))+" "+f.label(r)+": ";u.appendChild(e.createElement("p")).textContent=l;var d=e.createElement("input");function p(){u.parentNode.removeChild(u),t(d.value.trim())}d.setAttribute("type","text"),d.setAttribute("size","100"),d.setAttribute("maxLength","2048"),d.setAttribute("style",s.textInputStyle),d.select(),u.appendChild(d),n.appendChild(u),d.addEventListener("keyup",(function(e){13===e.keyCode&&p()}),!1),u.appendChild(e.createElement("br")),u.appendChild(R(e,(function(e){u.parentNode.removeChild(u),t(null)}))),u.appendChild(L(e,(function(e){p()}))),d.focus()}))},t.attachmentList=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=function(e){if(!x.updater)throw new Error("kb has no updater");x.updater.update((0,i.st)(t,y,e,m),[],(function(e,t,n,r){t?u():_(void 0,"Error deleting one: "+n)}))};function s(t){var n=t,r={noun:w};return g&&(r.deleteFunction=function(){o(n)}),D(e,y,t,r)}var u=function(){var e=x.each(t,y);e.sort(),f.syncTableToArray(A,e,s)};function l(e){var n=[];if(e.forEach((function(e){var r=(0,i.sym)(e);c.log("Dropped on attachemnt "+e),n.push((0,i.st)(t,y,r,m))})),!x.updater)throw new Error("kb has no updater");x.updater.update([],n,(function(e,t,n,r){t?u():_(void 0,"Error adding one: "+n)}))}function h(e){var n,o;(0,d.uploadFiles)(x.fetcher,e,null===(n=r.uploadFolder)||void 0===n?void 0:n.uri,null===(o=r.uploadFolder)||void 0===o?void 0:o.uri,(function(e,n){var r=[(0,i.st)(t,y,x.sym(n),m)];if(!x.updater)throw new Error("kb has no updater");x.updater.update([],r,(function(e,t,n,r){t?u():_(void 0,"Error adding link to uploaded file: "+n)}))}))}var m=r.doc||t.doc();void 0===r.modify&&(r.modify=!0);var g=r.modify,v=r.promptIcon||b+"noun_748003.svg",y=r.predicate||a.wf("attachment"),w=r.noun||"attachment",x=p.store,E=n.appendChild(e.createElement("table"));E.setAttribute("style","margin-top: 1em; margin-bottom: 1em;");var k=E.appendChild(e.createElement("tr")),S=k.appendChild(e.createElement("td")),C=k.appendChild(e.createElement("td")),A=C.appendChild(e.createElement("table"));if(A.appendChild(e.createElement("tr")),E.refresh=u,u(),g){var T=F(e,v,"Drop attachments here");S.appendChild(T);var O=r.uploadFolder?h:null;if((0,d.makeDropTarget)(T,l,O),(0,d.makeDropTarget)(S,l,O),r.uploadFolder){var P=K(e,h);S.appendChild(P)}}return E},t.button=F,t.cancelButton=R,t.clearElement=function(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e},t.complain=_,t.continueButton=L,t.createLinkDiv=B,t.createNameDiv=U,t.defaultAnnotationStore=function(e){if(void 0!==e.uri){var t=e.uri;if("http://"===t.slice(0,7)){var n=(t=t.slice(7)).indexOf("#");if(n>=0)t=t.slice(0,n);else{var r=t.lastIndexOf("/");if(r<0)return;t=t.slice(0,r)}return p.store.sym("http://tabulator.org/wiki/annnotation/"+t)}}},t.deleteButtonWithCheck=j,t.extractLogURI=function(e){var t=e.search(/logFile=/),n=e.search(/&rulesFile=/);return e.substring(t+8,n)},t.faviconOrDefault=I,t.fileUploadButtonDiv=K,t.findImage=T,t.findImageFromURI=A,t.formatDateTime=E,t.iconForClass=void 0,t.imagesOf=function(e,t){return t.each(e,a.sioc("avatar")).concat(t.each(e,a.foaf("img"))).concat(t.each(e,a.vcard("logo"))).concat(t.each(e,a.vcard("hasPhoto"))).concat(t.each(e,a.vcard("photo"))).concat(t.each(e,a.foaf("depiction")))},t.index=void 0,t.isAudio=function(e){return W(e,"audio")},t.isImage=W,t.isVideo=function(e){return W(e,"video")},t.linkButton=function(e,t){var n=e.createElement("button");return n.setAttribute("type","button"),n.textContent="Goto "+f.label(t),n.addEventListener("click",(function(n){e.outlineManager.GotoSubject(t,!0,void 0,!0,void 0)}),!0),n},t.openHrefInOutlineMode=function(e){e.preventDefault(),e.stopPropagation();var t=f.getTarget(e).getAttribute("href");if(!t)return c.log("openHrefInOutlineMode: No href found!\n");var n=window.document;n.outlineManager?n.outlineManager.GotoSubject(p.store.sym(t),!0,void 0,!0,void 0):window&&window.panes&&window.panes.getOutliner?window.panes.getOutliner().GotoSubject(p.store.sym(t),!0,void 0,!0,void 0):c.log("ERROR: Can't access outline manager in this config")},t.personTR=void 0,t.propertyTriage=function(e){var t={},n={},r={},i=0,o=0,s=0,c=e.predicateIndex;for(var l in c)"Literal"===c[l][0].object.termType?(n[l]=!0,o++):(r[l]=!0,i++);for(var d=e.each(void 0,a.rdf("type"),a.rdf("Property")),p=0;p<d.length;p++){var f=d[p].toNT();r[f]||n[f]||(n[f]=!0,r[f]=!0,s++)}return t.op=r,t.dp=n,(0,u.info)("propertyTriage: ".concat(i," non-lit, ").concat(o," literal. ").concat(s," unknown.")),t},t.refreshTree=function e(t){if(t.refresh)t.refresh();else for(var n=0;n<t.children.length;n++)e(t.children[n])},t.removeButton=function(e,t){var n=e.createElement("button");return n.setAttribute("type","button"),n.textContent="✕",n.addEventListener("click",(function(e){t.parentNode.removeChild(t)}),!0),n},t.renderAsDiv=function(e,t,n){var r=e.createElement("div");r.setAttribute("style",s.renderAsDivStyle);var i=(n=n||{}).image||I(e,t);return(0,m.createImageDiv)(e,r,i),U(e,r,n.title,t),B(e,r,t,n),n.clickable&&n.onClickFunction&&(0,m.addClickListenerToElement)(r,n.onClickFunction),n.wrapInATR?(0,m.wrapDivInATR)(e,r,t):r},t.renderAsRow=M,t.selectorPanel=function(e,t,n,r,i,o,a,s,c){return H(e.createElement("div"),e,t,n,r,i,o,a,s,c)},t.selectorPanelRefresh=H,t.setImage=P,t.setName=k,t.shortDate=function(e,t){if(!e)return"???";try{var n=(new Date).toISOString();return e.slice(0,10)!==n.slice(0,10)||t?e.slice(0,4)===n.slice(0,4)?["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][parseInt(e.slice(5,7),10)-1]+" "+parseInt(e.slice(8,10),10):e.slice(0,10):e.slice(11,16)}catch(e){return"shortdate:"+e}},t.shortTime=function(){return E(new Date,"{Hours}:{Minutes}:{Seconds}.{Milliseconds}")},t.timestamp=function(){return E(new Date,"{FullYear}-{Month}-{Date}T{Hours}:{Minutes}:{Seconds}.{Milliseconds}")};var i=n(6022),o=n(1124),a=y(n(6590)),s=y(n(2853)),c=y(n(4433)),u=n(8853),l=n(1909),d=n(3983),p=n(166),f=y(n(5666)),h=n(9449),m=n(398),g=n(1552);function v(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(v=function(e){return e?n:t})(e)}function y(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=v(t);if(n&&n.has(e))return n.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,n&&n.set(e,i),i}var b=o.icons.iconBase,w=b+"noun_1180156.svg",x=b+"noun_1180158.svg";function _(e,t){if(t){var n=function(e){var t=e&&e.statusArea||e&&e.div||null;if(t)return t;var n=e&&e.dom;if(n||"undefined"==typeof document||(n=document),n){var r=n.getElementsByTagName("body")[0];return t=n.createElement("div"),r.insertBefore(t,r.firstElementChild),e&&(e.statusArea=t),t}return null}(e);c.log("Complaint: "+t),n?n.appendChild((0,h.errorMessageBlock)(e&&e.dom||document,t)):alert(t)}}function E(e,t){return t.split("{").map((function(t){var n=t.split("}")[0];return t?("000"+(e["get"+n]()+({Month:1}[n]||0))).slice(-({Milliseconds:3,FullYear:4}[n]||2))+t.split("}")[1]:""})).join("")}function k(e,t){var n=p.store,r=function(e){var t=n.any(e,a.vcard("fn"))||n.any(e,a.foaf("name"))||n.any(e,a.vcard("organization-name"));return t?t.value:null},i=t.sameTerm(a.foaf("Agent"))?"Everyone":r(t);if(e.textContent=i||f.label(t),!i&&t.uri){if(!n.fetcher)throw new Error("kb has no fetcher");n.fetcher.nowOrWhenFetched(t.doc(),void 0,(function(n){e.textContent=r(t)||f.label(t)}))}}var S={"solid:AppProviderClass":"noun_144.svg","solid:AppProvider":"noun_15177.svg","solid:Pod":"noun_Cabinet_1434380.svg","vcard:Group":"noun_339237.svg","vcard:Organization":"noun_143899.svg","vcard:Individual":"noun_15059.svg","schema:Person":"noun_15059.svg","foaf:Person":"noun_15059.svg","foaf:Agent":"noun_98053.svg","acl:AuthenticatedAgent":"noun_99101.svg","prov:SoftwareAgent":"noun_Robot_849764.svg","vcard:AddressBook":"noun_15695.svg","trip:Trip":"noun_581629.svg","meeting:LongChat":"noun_1689339.svg","meeting:Meeting":"noun_66617.svg","meeting:Project":"noun_1036577.svg","ui:Form":"noun_122196.svg","rdfs:Class":"class-rectangle.svg","rdf:Property":"property-diamond.svg","owl:Ontology":"noun_classification_1479198.svg","wf:Tracker":"noun_122196.svg","wf:Task":"noun_17020_gray-tick.svg","wf:Open":"noun_17020_sans-tick.svg","wf:Closed":"noun_17020.svg"};function C(e){var t=e.uri.split("#")[0],n=t.indexOf("//");if(n<0)throw new Error("This URI does not have a web site part (origin)");var r=t.indexOf("/",n+2);return r<0?t.slice(0)+"/":t.slice(0,r+1)}function A(e){var t=b;return"string"!=typeof e&&e.uri?4!==e.uri.split("/").length||e.uri.split("/")[1]||e.uri.split("/")[3]?e.uri.startsWith("message:")||e.uri.startsWith("mid:")?t+"noun_480183.svg":e.uri.startsWith("mailto:")?t+"noun_567486.svg":e.uri.startsWith("https:")&&e.uri.indexOf("#")<0?C(e)+"favicon.ico":null:t+"noun_15177.svg":t+"noun_10636_grey.svg"}function T(e){var t=p.store,n=b;if(e.sameTerm(a.foaf("Agent"))||e.sameTerm(a.rdf("Resource")))return n+"noun_98053.svg";var r=t.any(e,a.sioc("avatar"))||t.any(e,a.foaf("img"))||t.any(e,a.vcard("logo"))||t.any(e,a.vcard("hasPhoto"))||t.any(e,a.vcard("photo"))||t.any(e,a.foaf("depiction"));return r?r.uri:null}function O(e,t,n){var r=p.store,i=T(t);if(i)return e.setAttribute("src",i),!0;var o=n[t.uri];if(o)return e.setAttribute("src",o),e.style=s.classIconStyle,!0;var a=A(t);if(a)return e.setAttribute("src",a),!0;var c=r.findTypeURIs(t);for(var u in c)if(n[u])return e.setAttribute("src",n[u]),!1;return e.setAttribute("src",b+"noun_10636_grey.svg"),!1}function P(e,t){var n=p.store,r={};for(var o in S){var s=o.split(":")[0],c=o.split(":")[1],u=a[s](c);r[u.uri]=i.uri.join(S[o],b)}if(!O(e,t,r)&&t.uri){if(!n.fetcher)throw new Error("kb has no fetcher");n.fetcher.nowOrWhenFetched(t.doc(),void 0,(function(n){n&&O(e,t,r)}))}}function I(e,t){var n=e.createElement("img");if(n.style=s.iconStyle,n.setAttribute("src",b+(function(e){if(!e.uri)return!1;var t=e.uri.split("/");return 3===t.length||4===t.length&&""===t[3]}(t)?"noun_15177.svg":"noun_681601.svg")),t.uri&&t.uri.startsWith("https:")&&t.uri.indexOf("#")<0){var r=e.createElement("object");return r.setAttribute("data",C(t)+"favicon.ico"),r.setAttribute("type","image/x-icon"),r.appendChild(n),r}return P(n,t),n}function j(e,t,n,r){var i=b+"noun_2188_red.svg",a=e.createElement("img");a.setAttribute("src",i),a.setAttribute("style",s.smallButtonStyle),a.style.float="right";var c="Remove this "+n;return a.title=c,a.classList.add("hoverControlHide"),a.addEventListener("click",(function(){var n=e.createElement("div");t.insertBefore(n,a),n.style.position="relative",n.appendChild(function(e,t,n,r){function i(){t.parentElement.removeChild(t)}function a(){i(),r()}var c=e.createElement("div");c.style=s.confirmPopupStyle,c.style.position="absolute",c.style.top="-1em",c.style.display="grid",c.style.gridTemplateColumns="auto auto";var u=e.createElement("div");u.style.gridColumn="1/2",u.style.gridRow="1";var l=e.createElement("div");l.style.gridColumn="1/2",l.style.gridRow="2";var d=R(e,i);c.appendChild(d),d.style.gridColumn="1",d.style.gridRow="2";var p=c.appendChild(e.createElement("button"));p.style=s.buttonStyle,p.style.gridRow="2",p.style.gridColumn="2",p.textContent="Cancel";var f=F(e,o.icons.iconBase+"noun_925021.svg","Delete it");c.appendChild(f),f.style.gridRow="1",f.style.gridColumn="1";var h=c.appendChild(e.createElement("button"));return h.style=s.buttonStyle,h.style.gridRow="1",h.style.gridColumn="2",h.textContent=n,c.appendChild(h),f.addEventListener("click",a),h.addEventListener("click",a),p.addEventListener("click",i),c}(e,n,c,r))})),t.classList.add("hoverControl"),t.appendChild(a),a.setAttribute("data-testid","deleteButtonWithCheck"),a}function N(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="Secondary"===e.buttonColor?"#01c9ea":"#7c4dff",n=t,r="#ffffff",i=t,o="Secondary"===e.buttonColor?"#37cde6":"#9f7dff",a=r;return e.needsBorder&&(r=t,i=t,o=t,a=n="#ffffff"),{"background-color":"".concat(n),color:"".concat(r),"font-family":"Raleway, Roboto, sans-serif","border-radius":"0.25em","border-color":"".concat(i),border:"1px solid",cursor:"pointer","font-size":".8em","text-decoration":"none",padding:"0.5em 4em",transition:"0.25s all ease-in-out",outline:"none","&:hover":{"background-color":"".concat(o),color:"".concat(a),transition:"0.25s all ease-in-out"}}}function F(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{buttonColor:"Primary",needsBorder:!1},o=e.createElement("button");if(o.setAttribute("type","button"),t){var a=o.appendChild(e.createElement("img"));a.setAttribute("src",t),a.setAttribute("style","width: 2em; height: 2em;"),a.title=n,o.setAttribute("style",s.buttonStyle)}else{o.textContent=n.toLocaleUpperCase();var c=N(i),u=(0,l.getClasses)(e.head,{textButton:c}),d=u.classes;o.classList.add(d.textButton)}return r&&o.addEventListener("click",r,!1),o}function R(e,t){var n=F(e,w,"Cancel",t);return n.firstChild&&(n.firstChild.style.opacity="0.3"),n}function L(e,t){return F(e,x,"Continue",t)}t.iconForClass=S;var D=M;function M(e,t,n,r){var i=e.createElement("tr");r=r||{};var o=i.appendChild(e.createElement("td")),a=i.appendChild(e.createElement("td")),s=i.appendChild(e.createElement("td")),c=r.image||I(e,n);return o.setAttribute("style","vertical-align: middle; width:2.5em; padding:0.5em; height: 2.5em;"),a.setAttribute("style","vertical-align: middle; text-align:left;"),s.setAttribute("style","vertical-align: middle; width:2em; padding:0.5em; height: 4em;"),o.appendChild(c),r.title?a.textContent=r.title:k(a,n),r.deleteFunction&&j(e,s,r.noun||"one",r.deleteFunction),n.uri&&(!1!==r.link&&(s.appendChild((0,g.linkIcon)(e,n)).classList.add("HoverControlHide"),s.appendChild(e.createElement("br"))),!1!==r.draggable&&(c.setAttribute("draggable","false"),(0,d.makeDraggable)(i,n))),i.subject=n,i}function U(e,t,n,r){var i=t.appendChild(e.createElement("div"));n?i.textContent=n:k(i,r)}function B(e,t,n,r){var i=t.appendChild(e.createElement("div"));i.setAttribute("style",s.linkDivStyle),r.deleteFunction&&j(e,i,r.noun||"one",r.deleteFunction),n.uri&&(!1!==r.link&&(0,g.createLinkForURI)(e,i,n),(0,d.makeDraggable)(t,n))}function H(e,t,n,r,i,o,a,s,c,u){var l="border: 0.1em solid #ddd; border-bottom: none; width: 95%; height: 2em; padding: 0.5em;",d=null;e.innerHTML="";for(var p=function(e,a){var p,f,h=function(){var e=o?n.each(void 0,i,a):n.each(a,i);y.setAttribute("class",0===e.length?"hideTillHover":""),f.setAttribute("src",s.connectIcon||b+"noun_25830.svg"),f.setAttribute("title",e.length?e.length:"attach")},m=q.twoLine.widgetForClass(r);(p=m(t,a)).setAttribute("style",l);var g=t.createElement("div");g.setAttribute("class","hideTillHover"),g.setAttribute("style","float:right; width:10%");var v=t.createElement("a");v.setAttribute("href",a.uri),v.setAttribute("style","float:right"),g.appendChild(v).textContent=">",e.appendChild(g);var y=t.createElement("div");return y.setAttribute("style",(o?"float:left;":"float:right;")+" width:30px;"),f=t.createElement("img"),h(),y.appendChild(f),e.appendChild(y),p.addEventListener("click",(function(e){d===p?(p.setAttribute("style",l),d=null):(d&&d.setAttribute("style",l),p.setAttribute("style",l+"background-color: #ccc; color:black;"),d=p),c(a,e,d===p),h()}),!1),f.addEventListener("click",(function(e){u(a,e,o,h)}),!1),e.appendChild(p),e},f=0;f<a.length;f++){var h=t.createElement("div");e.appendChild(h),p(h,a[f])}return e}t.personTR=D;var q={};function W(e,t){var n=t||"image",r=p.store.findTypeURIs(e),o=i.Util.mediaTypeClass(n+"/*").uri.split("*")[0];for(var a in r)if(a.startsWith(o))return!0;return{audio:"http://purl.org/dc/dcmitype/Sound",image:"http://purl.org/dc/dcmitype/Image",video:"http://purl.org/dc/dcmitype/MovingImage"}[n]in r}function K(e,t){var n=e.createElement("div"),r=n.appendChild(e.createElement("input"));r.setAttribute("type","file"),r.setAttribute("multiple","true"),r.addEventListener("change",(function(e){c.log("File drop event: ",e),e.files?t(e.files):e.target&&e.target.files?t(e.target.files):alert("Sorry no files .. internal error?")}),!1),r.style="display:none";var i=n.appendChild(F(e,b+"noun_Upload_76574_000000.svg","Upload files",(function(e){r.click()})));return(0,d.makeDropTarget)(i,null,t),n}t.index=q,t.index=q={line:{},twoLine:{"":function(e,t){var n=e.createElement("div");return n.textContent=f.label(t),n},"http://www.w3.org/2000/10/swap/pim/qif#Transaction":function(e,t){var n="",r=function(e){var r=p.store.any(t,a.qu(e));return r||(n+="@@ No value for "+e+"! "),r?f.escapeForXML(r.value):"?"},i=e.createElement("table");return i.innerHTML='\n <tr>\n <td colspan="2"> '.concat(r("payee"),"</td>\n < /tr>\n < tr >\n <td>").concat(r("date").slice(0,10),'</td>\n <td style = "text-align: right;">').concat(r("amount"),"</td>\n </tr>"),n&&(i.innerHTML='\n <tr>\n <td><a href="'.concat(f.escapeForXML(t.uri),'">').concat(f.escapeForXML(n),"</a></td>\n </tr>")),i},"http://www.w3.org/ns/pim/trip#Trip":function(e,t){var n=function(e){var n=p.store.any(t,e);return n?f.escapeForXML(n.value):"?"},r=e.createElement("table");return r.innerHTML='\n <tr>\n <td colspan="2">'.concat(n(a.dc("title")),'</td>\n </tr>\n <tr style="color: #777">\n <td>').concat(n(a.cal("dtstart")),"</td>\n <td>").concat(n(a.cal("dtend")),"</td>\n </tr>"),r},widgetForClass:function(e){var t=q.twoLine[e.uri],n=p.store;if(t)return t;var r=n.findSuperClassesNT(e);for(var i in r)if(t=q.twoLine[n.fromNT(i).uri])return t;return q.twoLine[""]}}}},1552:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLinkForURI=void 0,t.linkIcon=i;var r=n(1124);function i(e,t,n){var i=e.createElement("a");i.setAttribute("href",t.uri),t.uri.startsWith("http")&&i.setAttribute("target","_blank");var o=i.appendChild(e.createElement("img"));return o.setAttribute("src",n||r.originalIconBase+"go-to-this.png"),o.setAttribute("style","margin: 0.3em;"),i}t.createLinkForURI=function(e,t,n){var r=i(e,n);t.appendChild(r).classList.add("HoverControlHide"),t.appendChild(e.createElement("br"))}},3983:(e,t,n)=>{"use strict";var r=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.makeDraggable=function(e,t){e.setAttribute("draggable","true"),e.addEventListener("dragstart",(function(n){e.style.fontWeight="bold",n.dataTransfer.setData("text/uri-list",t.uri),n.dataTransfer.setData("text/plain",t.uri),n.dataTransfer.setData("text/html",e.outerHTML),i.log("Dragstart: "+e+" -> "+t+"de: "+n.dataTransfer.dropEffect)}),!1),e.addEventListener("drag",(function(e){e.preventDefault(),e.stopPropagation()}),!1),e.addEventListener("dragend",(function(n){e.style.fontWeight="normal",i.log("Dragend dropeffect: "+n.dataTransfer.dropEffect),i.log("Dragend: "+e+" -> "+t)}),!1)},t.makeDropTarget=function(e,t,n){var r=function(e){e.preventDefault(),e.dataTransfer.dropEffect="copy"},o=function(e){i.log("dragenter event dropEffect: "+e.dataTransfer.dropEffect),this.style&&(this.savedStyle||(this.savedStyle={},this.savedStyle.border=this.style.border,this.savedStyle.backgroundColor=this.style.backgroundColor,this.savedStyle.borderRadius=this.style.borderRadius),this.style.backgroundColor="#ccc",this.style.border="0.25em dashed black",this.style.borderRadius="0.3em"),e.dataTransfer.dropEffect="link",i.log("dragenter event dropEffect 2: "+e.dataTransfer.dropEffect)},a=function(e){i.log("dragleave event dropEffect: "+e.dataTransfer.dropEffect),this.savedStyle?(this.style.border=this.savedStyle.border,this.style.backgroundColor=this.savedStyle.backgroundColor,this.style.borderRadius=this.savedStyle.borderRadius):(this.style.backgroundColor="white",this.style.border="0em solid black")},s=function(e){e.preventDefault&&e.preventDefault(),i.log("Drop event. dropEffect: "+e.dataTransfer.dropEffect),i.log("Drop event. types: "+(e.dataTransfer.types?e.dataTransfer.types.join(", "):"NOPE"));var r,o=null;if(e.dataTransfer.types){for(var a=0;a<e.dataTransfer.types.length;a++){var s=e.dataTransfer.types[a];if("text/uri-list"===s)o=e.dataTransfer.getData(s).split("\n"),i.log("Dropped text/uri-list: "+o);else if("text/plain"===s)r=e.dataTransfer.getData(s);else if("Files"===s&&n){for(var c=e.dataTransfer.files,u=0;c[u];u++){var l=c[u];i.log("Filename: "+l.name+", type: "+(l.type||"n/a")+" size: "+l.size+" bytes, last modified: "+(l.lastModifiedDate?l.lastModifiedDate.toLocaleDateString():"n/a"))}n(c)}}null===o&&r&&"http"===r.slice(0,4)&&(o=r,i.log("Waring: Poor man's drop: using text for URI"))}else o=[e.dataTransfer.getData("Text")],i.log("WARNING non-standard drop event: "+o[0]);return i.log("Dropped URI list (2): "+o),o&&t(o),this.style.backgroundColor="white",!1};!function(e){e||i.log("@@@ addTargetListeners: ele "+e),e.addEventListener("dragover",r),e.addEventListener("dragenter",o),e.addEventListener("dragleave",a),e.addEventListener("drop",s)}(e)},t.uploadFiles=function(e,t,n,r,a){for(var s=0;t[s];s++){var c=t[s];i.log(" dropped: Filename: "+c.name+", type: "+(c.type||"n/a")+" size: "+c.size+" bytes, last modified: "+(c.lastModifiedDate?c.lastModifiedDate.toLocaleDateString():"n/a"));var u=new FileReader;u.onload=function(t){return function(s){var c=s.target.result,u="";i.log(" File read byteLength : "+c.byteLength);var l=t.type;if(t.type&&""!==t.type){var d=o.extension(t.type);d&&"false"!==d&&!t.name.endsWith("."+d)&&t.type!==o.lookup(t.name)&&(u="_."+d)}else if(!(l=o.lookup(t.name))){var p="Filename needs to have an extension which gives a type we know: "+t.name;throw i.log(p),alert(p),new Error(p)}var f=t.type.startsWith("image/")&&r||n,h=f+(f.endsWith("/")?"":"/")+encodeURIComponent(t.name)+u;e.webOperation("PUT",h,{data:c,contentType:l}).then((function(e){i.log(" Upload: put OK: "+h),a(t,h)}),(function(e){var t=" Upload: FAIL "+h+", Error: "+e;throw i.log(t),alert(t),new Error(t)}))}}(c),u.readAsArrayBuffer(c)}};var i=s(n(4433)),o=s(n(983));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(a=function(e){return e?n:t})(e)}function s(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=a(t);if(n&&n.has(e))return n.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var c=o?Object.getOwnPropertyDescriptor(e,s):null;c&&(c.get||c.set)?Object.defineProperty(i,s,c):i[s]=e[s]}return i.default=e,n&&n.set(e,i),i}},9449:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorMessageBlock=function(e,t,n,i){var o=e.createElement("div"),a=i||t instanceof Error?t:null;return a?(console.error("errorMessageBlock: ".concat(a," at: ").concat(a.stack||"??"),a),o.textContent=a.message):o.textContent=t,o.appendChild((0,r.cancelButton)(e,(function(){o.parentNode&&o.parentNode.removeChild(o)}))).style="width: 2em; height: 2em; align: right;",o.setAttribute("style","margin: 0.1em; padding: 0.5em; border: 0.05em solid gray; background-color: "+(n||"#fee")+"; color:black;"),o};var r=n(2457)},6206:(e,t,n)=>{"use strict";var r=n(4836),i=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.appendForm=j,Object.defineProperty(t,"basicField",{enumerable:!0,get:function(){return f.basicField}}),t.buildCheckboxForm=H,t.editFormButton=function(e,t,n,r,i){var o=e.createElement("button");return o.setAttribute("type","button"),o.innerHTML="Edit "+x.label(y.ui("Form")),o.addEventListener("click",(function(a){j(e,t,{},n,y.ui("FormForm"),r,i).setAttribute("style",y.ui("FormForm").sameTerm(n)?"background-color: #fee;":"background-color: #ffffe7;"),o.parentNode.removeChild(o)}),!0),o},Object.defineProperty(t,"field",{enumerable:!0,get:function(){return u.field}}),Object.defineProperty(t,"fieldFunction",{enumerable:!0,get:function(){return u.fieldFunction}}),Object.defineProperty(t,"fieldLabel",{enumerable:!0,get:function(){return f.fieldLabel}}),Object.defineProperty(t,"fieldParams",{enumerable:!0,get:function(){return c.fieldParams}}),Object.defineProperty(t,"fieldStore",{enumerable:!0,get:function(){return f.fieldStore}}),t.findClosest=N,t.formsFor=function(e){var t=w.store;v.debug("formsFor: subject="+e);var n,r=t.findTypeURIs(e);for(n in r)v.debug(" type: "+n);var i=t.bottomTypeURIs(r),o=[];for(var a in i)v.debug("candidatesFor: trying bottom type ="+a),o=(o=o.concat(N(t,a,y.ui("creationForm")))).concat(N(t,a,y.ui("annotationForm")));return o},t.makeDescription=D,t.makeSelectForCategory=U,t.makeSelectForChoice=W,t.makeSelectForClassifierOptions=M,t.makeSelectForNestedCategory=B,t.makeSelectForOptions=function(e,t,n,r,i,o,a,s){v.debug("Select list length now "+i.length);for(var c,u=0,l={},f=t.updater.editable(a.uri),h=0;h<i.length;h++){var g=i[h];g.uri||d.warn("makeSelectForOptions: option does not have an uri: ".concat(g,", with predicate: ").concat(r)),g.uri&&!(g.uri in l)&&(l[g.uri]=!0,u++)}if(0===u)return(0,p.errorMessageBlock)(e,"Can't do selector with no options, subject= "+n+" property = "+r+".");v.debug("makeSelectForOptions: dataDoc="+a);var w=function(){return c={},r.sameTerm(y.rdf("type"))?c=t.findTypeURIs(n):t.each(n,r,null,a).forEach((function(e){e.uri&&(c[e.uri]=!0)})),c};c=w();var _=e.createElement("select");for(var E in _.setAttribute("style",m.formSelectSTyle),_.currentURI=null,_.refresh=function(){c=w();for(var e=0;e<_.children.length;e++){var t=_.children[e];t.AJAR_uri&&(t.selected=t.AJAR_uri in c)}_.disabled=!1},l){var k=t.sym(E),S=e.createElement("option");o.disambiguate?S.appendChild(e.createTextNode(x.labelWithOntology(k,!0))):S.appendChild(e.createTextNode(x.label(k,!0)));var C=t.any(k,t.sym("http://www.w3.org/ns/ui#backgroundColor"));C&&S.setAttribute("style","background-color: "+C.value+"; "),S.AJAR_uri=E,E in c&&(S.setAttribute("selected","true"),_.currentURI=E),_.appendChild(S)}if(!_.currentURI){var A=e.createElement("option");A.appendChild(e.createTextNode(o.nullLabel)),_.insertBefore(A,_.firstChild),A.selected=!0}return f&&_.addEventListener("change",(function(i){_.disabled=!0;for(var o=[],u=[],l=function(e){t.holds(n,r,e,a)&&o.push(b.st(n,r,e,a))},d=0;d<_.options.length;d++){var f=_.options[d];f.AJAR_uri&&(f.selected&&!(f.AJAR_uri in c)&&u.push(b.st(n,r,t.sym(f.AJAR_uri),a)),!f.selected&&f.AJAR_uri in c&&l(t.sym(f.AJAR_uri)),f.selected&&(_.currentURI=f.AJAR_uri))}for(var h=_.subSelect;h&&h.currentURI;)l(t.sym(h.currentURI)),h=h.subSelect;for(h=_.superSelect;h&&h.currentURI;)l(t.sym(h.currentURI)),h=h.superSelect;v.info("selectForOptions: data doc = "+a),t.updater.update(o,u,(function(t,n,r){if(c=w(),!n)return _.parentNode.appendChild((0,p.errorMessageBlock)(e,"Error updating data in select: "+r));_.disabled=!1,s&&s(n,{widget:"select",event:"change"})}))}),!1),_},Object.defineProperty(t,"mostSpecificClassURI",{enumerable:!0,get:function(){return u.mostSpecificClassURI}}),t.newButton=function(e,t,n,r,i,o,a,s){var c=e.createElement("button");return c.setAttribute("type","button"),c.innerHTML="New "+x.label(i),c.addEventListener("click",(function(u){c.parentNode.appendChild(L(e,t,n,r,i,o,a,s))}),!1),c},t.newThing=q,t.promptForNew=L,t.propertiesForClass=function(e,t){var n=e.each(void 0,y.rdf("range"),t);[y.rdfs("comment"),y.dc("title"),y.foaf("name"),y.foaf("homepage")].forEach((function(e){n.push(e)}));var r=e.each(void 0,y.rdf("type"),t);r.length>60&&(r=r.slice(0,60));for(var i={},o=0;o<(r.length>60?60:r.length);o++)e.statementsMatching(r[o],void 0,void 0).forEach((function(e){i[e.predicate.uri]=!0}));n.forEach((function(e){i[e.uri]=!0}));var a=[];for(var s in i)a.push(e.sym(s));return a},Object.defineProperty(t,"renderNameValuePair",{enumerable:!0,get:function(){return f.renderNameValuePair}}),t.sortByLabel=R,t.sortBySequence=F;var o=r(n(4687)),a=r(n(7156)),s=S(n(6186)),c=n(4246),u=n(4816),l=n(9742),d=S(n(4433)),p=n(9449),f=n(4322),h=n(4179),m=S(n(2853)),g=n(1124),v=S(n(8853)),y=S(n(6590)),b=S(n(6022)),w=n(166),x=S(n(5666)),_=n(1989),E=S(n(2457));function k(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(k=function(e){return e?n:t})(e)}function S(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var n=k(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}function C(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return A(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?A(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var T=w.store;function O(e,t,n,r,i,o,a){for(var s=o.children,c=0;c<a.length;c++){var l=a[c];if((0,u.mostSpecificClassURI)(l)===y.ui("Options").uri){var p=(0,u.fieldFunction)(e,l)(e,null,t,n,l,r,i);d.log("Refreshing Options field by replacing it."),o.insertBefore(p,s[c]),o.removeChild(s[c+1])}}}function P(e,t,n,r,i,o,a,s){var c=y.ui,u=w.store,l=u.any(i,c("property"));if(!l){var d=(0,p.errorMessageBlock)(e,"No property to boolean field: "+i);return t&&t.appendChild(d),d}var h=u.any(i,c("label"));h||(h=x.label(l,!0)),o=(0,f.fieldStore)(r,l,o);var m=u.any(r,l);void 0===m&&(m=!1);var g=b.st(r,l,!0,o),v=H(e,u,h,b.st(r,l,!1,o),g,i,o,s);return t&&t.appendChild(v),v}function I(e,t,n,r,i,o,a){(0,u.fieldFunction)(e,i)(e,t,n,r,i,o,a)}function j(e,t,n,r,i,o,a){return(0,u.fieldFunction)(e,i)(e,t,n,r,i,o,a)}function N(e,t,n){for(var r=[e.sym(t)];r.length>0;){var i=r.shift(),o=e.each(i,n);if(v.debug("Lists for "+i+", "+n+": "+o.length),0!==o.length)return o;for(var a=e.each(i,y.rdfs("subClassOf")),s=0;s<a.length;s++)r.push(a[s]),v.debug("findClosest: add super: "+a[s])}return[]}function F(e){var t=e.map((function(e){return[T.any(e,y.ui("sequence"))||9999,e]}));return t.sort((function(e,t){return e[0]-t[0]})),t.map((function(e){return e[1]}))}function R(e){var t=e.map((function(e){return[x.label(e).toLowerCase(),e]}));return t.sort(),t.map((function(e){return e[1]}))}function L(e,t,n,r,i,o,a,c){var l=e.createElement("form");if(!o){var d=N(t,i.uri,y.ui("creationForm"));if(0===d.length){l.appendChild(e.createElement("p")).textContent="I am sorry, you need to provide information about a "+x.label(i)+" but I don't know enough information about those to ask you.";var p=l.appendChild(e.createElement("button"));return p.setAttribute("type","button"),p.setAttribute("style","float: right;"),p.innerHTML="Goto "+x.label(i),p.addEventListener("click",(function(t){e.outlineManager.GotoSubject(i,!0,void 0,!0,void 0)}),!1),l}v.debug("lists[0] is "+d[0]),o=d[0]}v.debug("form is "+o),l.setAttribute("style","border: 0.05em solid ".concat(m.formBorderColor,"; color: ").concat(m.formBorderColor)),l.innerHTML="<h3>New "+x.label(i)+"</h3>";var f=(0,u.fieldFunction)(e,o),h=q(a),g=!1;function w(e,t,n){return c(t,n)}v.info("paneUtils Object is "+h);var _=f(e,l,{},h,o,a,(function(o,u){if(!o)return c(o,u);var d=[];n&&!t.holds(n,r,h,a)&&d.push(b.st(n,r,h,a)),n&&!t.holds(h,y.rdf("type"),i,a)&&d.push(b.st(h,y.rdf("type"),i,a)),d.length?t.updater.update([],d,w):c(!0,u),g||(g=l.appendChild(s.linkButton(e,h)))}));return s.removeButton(e,_).setAttribute("style","float: right;"),l.AJAR_subject=h,l}function D(e,t,n,r,i,o){var a,s=e.createElement("div"),c=t.anyJS(n,r,null,i)||"",u=e.createElement("textarea");function l(c){a.disabled=!0,a.setAttribute("style","visibility: hidden; float: right;"),u.disabled=!0,u.style.color=m.textInputColorPending;var l=t.statementsMatching(n,r,null,i),d=b.st(n,r,u.value,i);t.updater.update(l,d,(function(t,n,r){n?(u.style.color=m.textInputColor,u.disabled=!1):s.appendChild((0,p.errorMessageBlock)(e,"Error (while saving change to "+i.uri+"): "+r)),o&&o(n,r)}))}return s.appendChild(u),u.rows=c?c.split("\n").length+2:2,u.cols=80,u.setAttribute("style",m.multilineTextInputStyle),null!==c?u.value=c:u.select(),s.refresh=function(){var e=t.any(n,r,null,i);e&&e.value!==u.value&&(u.value=e.value)},t.updater.editable(i.uri)?((a=E.continueButton(e,l)).disabled=!0,a.style.visibility="hidden",a.style.float="right",s.appendChild(a),u.addEventListener("keyup",(function(e){u.style.color="green",a&&(a.disabled=!1,a.style.visibility="")}),!0),u.addEventListener("change",l,!0)):(u.disabled=!0,u.style.backgroundColor=m.textInputBackgroundColorUneditable),s}function M(e,t,n,r,i,o,a,s){v.debug("Select list length now "+i.length);for(var c,l=0,f={},h=t.updater.editable(a.uri),g=0;g<i.length;g++){var w=i[g];w.uri||d.warn("makeSelectForClassifierOptions: option does not have an uri: ".concat(w,", with predicate: ").concat(r)),w.uri&&!(w.uri in f)&&(f[w.uri]=!0,l++)}if(0===l&&!o.mint)return(0,p.errorMessageBlock)(e,"Can't do selector with no options, subject= "+n+" property = "+r+".");v.debug("makeSelectForClassifierOptions: dataDoc="+a);var _=function(){return c={},r.sameTerm(y.rdf("type"))?c=t.findTypeURIs(n):t.each(n,r,null,a).forEach((function(e){c[e.uri]=!0})),c};c=_();var E=e.createElement("select");for(var k in E.setAttribute("style",m.formSelectSTyle),o.multiple&&E.setAttribute("multiple","true"),E.currentURI=null,E.refresh=function(){c=_();for(var e=0;e<E.children.length;e++){var t=E.children[e];t.AJAR_uri&&(t.selected=t.AJAR_uri in c)}E.disabled=!1},f){var S=t.sym(k),C=e.createElement("option");o.disambiguate?C.appendChild(e.createTextNode(x.labelWithOntology(S,!0))):C.appendChild(e.createTextNode(x.label(S,!0)));var A=t.any(S,t.sym("http://www.w3.org/ns/ui#backgroundColor"));A&&C.setAttribute("style","background-color: "+A.value+"; "),C.AJAR_uri=k,k in c&&(C.setAttribute("selected","true"),E.currentURI=k),E.appendChild(C)}if(h&&o.mint){var T=e.createElement("option");T.appendChild(e.createTextNode(o.mint)),T.AJAR_mint=!0,E.insertBefore(T,E.firstChild)}if(null==E.currentURI&&!o.multiple){var O=e.createElement("option");O.appendChild(e.createTextNode(o.nullLabel)),E.insertBefore(O,E.firstChild),O.selected=!0}return h&&E.addEventListener("change",(function(i){E.disabled=!0;for(var l,d=[],f=[],h=function(e){t.holds(n,r,e,a)&&d.push(b.st(n,r,e,a))},m=0;m<E.options.length;m++){var g=E.options[m];if(g.selected&&g.AJAR_mint){if(o.mintClass){var y=L(e,t,n,r,o.mintClass,null,a,(function(e,t){e||s(e,t,{change:"new"})}));E.parentNode.appendChild(y),l=y.AJAR_subject}else l=q(a);f.push(b.st(n,r,l,a)),o.mintStatementsFun&&(f=f.concat(o.mintStatementsFun(l)))}g.AJAR_uri&&(g.selected&&!(g.AJAR_uri in c)&&f.push(b.st(n,r,t.sym(g.AJAR_uri),a)),!g.selected&&g.AJAR_uri in c&&h(t.sym(g.AJAR_uri)),g.selected&&(E.currentURI=g.AJAR_uri))}for(var w=E.subSelect;w&&w.currentURI;)h(t.sym(w.currentURI)),w=w.subSelect;for(w=E.superSelect;w&&w.currentURI;)h(t.sym(w.currentURI)),w=w.superSelect;function x(e,t){s(e,{widget:"select",event:"new"})}v.info("makeSelectForClassifierOptions: data doc = "+a),t.updater.update(d,f,(function(t,n,r){if(c=_(),!n)return E.parentNode.appendChild((0,p.errorMessageBlock)(e,"Error updating data in select: "+r));E.disabled=!1,l&&(0,u.fieldFunction)(e,o.subForm)(e,E.parentNode,{},l,o.subForm,a,x),s&&s(n,{widget:"select",event:"change"})}))}),!1),E}function U(e,t,n,r,i,o){var a,s=t.any(r,y.owl("disjointUnionOf")),c=!1;return s?a=s.elements:(a=t.each(void 0,y.rdfs("subClassOf"),r),c=!0),v.debug("Select list length "+a.length),0===a.length?(0,p.errorMessageBlock)(e,"Can't do "+(c?"multiple ":"")+"selector with no subclasses of category: "+r):1===a.length?(0,p.errorMessageBlock)(e,"Can't do "+(c?"multiple ":"")+"selector with only 1 subclass of category: "+r+":"+a[1]):M(e,t,n,y.rdf("type"),a,{multiple:c,nullLabel:"* Select type *"},i,o)}function B(e,t,n,r,i,o){function a(){c&&(s.removeChild(c),c=null),u.currentURI&&t.any(t.sym(u.currentURI),y.owl("disjointUnionOf"))&&(c=B(e,t,n,t.sym(u.currentURI),i,o),u.subSelect=c.firstChild,u.subSelect.superSelect=u,s.appendChild(c))}var s=e.createElement("span"),c=null,u=U(e,t,n,r,i,(function(e,t){e&&a(),o(e,t)}));return s.appendChild(u),a(),s}function H(e,t,n,r,i,o,a,s){var c=e.createElement("div"),u=(0,f.renderNameValuePair)(e,t,c,o,n),l=t.updater.editable(a.uri),h=e.createElement("button"),g=h;function v(e){if(!e)return[];if(e.object)return e.why||(e.why=a),[e];if(e instanceof Array)return e;throw new Error("buildCheckboxForm: bad param "+e)}function b(e){return 0===e.filter((function(e){return!t.holds(e.subject,e.predicate,e.object,e.why)})).length}return h.style=m.checkboxInputStyle,u.appendChild(h),i=v(i),r=v(r),function(){var n=b(i),a=n;if(r.length){var u=b(r);if(n&&u)return c.appendChild(E.errorMessageBlock(e,"Inconsistent data in dataDoc!\n"+i+" and\n"+r)),c;if(!n&&!u){n=null;var l=t.any(o,y.ui("default"));a=l?"1"===l.value:!!s&&null}}h.state=n,h.textContent={true:"✓",false:s?"✕":" ",null:"-"}[a]}(),l?(h.addEventListener("click",(function(n){g.style.color="#bbb";var o=!0===h.state?i:!1===h.state?r:[];h.newState=null===h.state||!0!==h.state&&(!s||null);var a=!0===h.newState?i:!1===h.newState?r:[];d.log(" Deleting ".concat(o)),d.log(" Inserting ".concat(a)),t.updater.update(o,a,(function(n,r,i){r?(g.style.color="#000",h.state=h.newState,h.textContent={true:"✓",false:"✕",null:"-"}[h.state]):(o.why&&t.holds(o.subject,o.predicate,o.object,o.why)&&d.log(" @@@@@ weird if 409 - does hold statement"),g.style.color="#000",g.style.backgroundColor="#fee",c.appendChild((0,p.errorMessageBlock)(e,"Checkbox: Error updating dataDoc from ".concat(h.state," to ").concat(h.newState,":\n\n").concat(i))))}))}),!1),c):c}function q(e){var t=new Date;return b.sym(e.uri+"#id"+t.getTime())}function W(e,t,n,r,i,o,a,s,c,u,l){for(var d={},f=n.updater.editable(u.uri),h=0;h<o.length;h++){var g=o[h];g.uri&&!(g.uri in d)&&(d[g.uri]=!0)}if(0===Object.keys(d).length&&!c.mint)return(0,p.errorMessageBlock)(e,"Can't do selector with no options, subject= "+r+" property = "+i+".");v.debug("makeSelectForChoice: dataDoc="+u);var w,_,E=e.createElement("select");for(var k in E.setAttribute("style",m.formSelectSTyle),E.setAttribute("id","formSelect"),E.currentURI=null,d)E.appendChild(A(k));if(f&&c.mint){var S=e.createElement("option");S.appendChild(e.createTextNode(c.mint)),S.AJAR_mint=!0,E.insertBefore(S,E.firstChild)}function A(t){var r,i=e.createElement("option"),o=n.sym(t);r=c.disambiguate?x.labelWithOntology(o,!0):x.label(o,!0),i.appendChild(e.createTextNode(r)),i.setAttribute("value",t);var s=n.any(o,n.sym("http://www.w3.org/ns/ui#backgroundColor"));return s&&i.setAttribute("style","background-color: "+s.value+"; "),i.AJAR_uri=t,K(o.value,a)&&i.setAttribute("selected","true"),i}return 0===E.children.length&&E.insertBefore(((_=e.createElement("option")).appendChild(e.createTextNode((w="--- choice ---",i&&"BlankNode"!==i.termType&&(w="* Select for property: "+x.label(i)+" *"),r&&"BlankNode"!==r.termType&&(w="* Select for "+x.label(r,!0)+" *"),w))),_.disabled=!0,_.value=!0,_.hidden=!0,_.selected=!0,_),E.firstChild),E.update=function(t){a=t;var o,c,d=[],f=[],h=function(e){n.holds(r,i,e,u)||f.push(b.st(r,i,e,u)),s&&!n.holds(e,y.rdf("type"),n.sym(s),u)&&f.push(b.st(e,y.rdf("type"),n.sym(s),u))},m=n.each(r,i,null,u).map((function(e){return e.value})),g=C(m);try{for(g.s();!(o=g.n()).done;){var v=o.value;K(v,a)||(c=b.sym(v),n.holds(r,i,c,u)&&d.push(b.st(r,i,c,u)))}}catch(e){g.e(e)}finally{g.f()}var w,x=C(a);try{for(x.s();!(w=x.n()).done;){var _=w.value;_ in m||h(b.sym(_))}}catch(e){x.e(e)}finally{x.f()}n.updater.update(d,f,(function(t,n,r){if(!n)return E.parentNode.appendChild((0,p.errorMessageBlock)(e,"Error updating data in select: "+r));E.refresh(),l&&l(n,{widget:"select",event:"change"})}))},E.refresh=function(){E.disabled=!0;for(var o,d=[],f=0;f<E.options.length;f++){var h=E.options[f];if(h.selected&&h.AJAR_mint){if(c.mintClass){var m=L(e,n,r,i,s,c.subForm,u,(function(e,t){e||l(e,t,{change:"new"})}));E.parentNode.appendChild(m),o=m.AJAR_subject}else o=q(u);d.push(b.st(r,i,n.sym(o),u)),s&&d.push(b.st(o,y.rdf("type"),n.sym(s),u)),c.mintStatementsFun&&(d=d.concat(c.mintStatementsFun(o))),E.currentURI=o}h.AJAR_uri&&(h.selected&&K(h.AJAR_uri,a)&&(E.currentURI=h.AJAR_uri),K(h.AJAR_uri,a)||h.removeAttribute("selected"),K(h.AJAR_uri,a)&&h.setAttribute("selected","true"))}v.info("selectForOptions: data doc = "+u),E.currentURI&&c.subForm&&!c.multiSelect&&I(e,t,{},b.sym(E.currentURI),c.subForm,u,(function(r,i){r?(n.updater.update([],d,(function(n,r,i){r||t.appendChild((0,p.errorMessageBlock)(e,"Error updating select: "+i))})),l&&l(r,{widget:"select",event:"new"})):t.appendChild((0,p.errorMessageBlock)(e,"Error updating data in field of select: "+i))})),E.disabled=!1},f&&E.addEventListener("change",(function(e){t.removeChild(t.lastChild),E.refresh()}),!1),E}function K(e,t){var n;for(n=0;n<t.length;n++)if(t[n]===e)return!0;return!1}u.field[y.ui("AutocompleteField").uri]=h.autocompleteField,u.field[y.ui("Form").uri]=u.field[y.ui("Group").uri]=function(e,t,n,r,i,o,a){var s=e.createElement("div"),c=y.ui;if(t&&t.appendChild(s),i){var l=r.toNT()+"|"+i.toNT();if(n[l])return s.appendChild(e.createTextNode("Group: see above "+l)),s;var d={};for(var f in n)d[f]=1;d[l]=1;var h=i.doc?i.doc():null,g=T.any(i,c("weight"),null,h),v=g?Number(g.value):1;if(v>3||v<0)return s.appendChild((0,p.errorMessageBlock)(e,"Form Group weight ".concat(v," should be 0-3")));s.setAttribute("style",m.formGroupStyle[v]),s.style.display="flex",s.style.flexDirection="column",s.class="form-weight-"+v;var b,w=T.any(i,c("parts"),null,h);if(w?b=w.elements:(w=T.each(i,c("part"),null,h),b=F(w)),!w)return s.appendChild((0,p.errorMessageBlock)(e,"No parts to form! "));for(var x=0;x<b.length;x++){var _=b[x],E=(0,u.fieldFunction)(e,_);s.appendChild(E(e,null,d,r,_,o,(function(t,i){t&&i&&i.widget&&"select"===i.widget&&O(e,n,r,o,a,s,b),a(t,{widget:"group",change:i})})))}return s}},u.field[y.ui("Options").uri]=function(e,t,n,r,i,o,a){var s=w.store,c=e.createElement("div"),u=i.doc?i.doc():null,l=y.ui;t&&t.appendChild(c);var d=s.any(i,l("dependingOn"));d||(d=y.rdf("type"));var f,h=s.each(i,l("case"),null,u);h||c.appendChild((0,p.errorMessageBlock)(e,"No cases to Options form. ")),f=d.sameTerm(y.rdf("type"))?Object.keys(s.findTypeURIs(r)).map((function(e){return b.sym(e)})):s.each(r,d);for(var m=0;m<h.length;m++){for(var g=h[m],v=s.each(g,l("for"),null,u),x=!1,_=0;_<v.length;_++){var E,k=C(f);try{for(k.s();!(E=k.n()).done;){var S=E.value,A=v[_];(S.sameTerm(v)||S.termType===A.termType&&S.value===A.value)&&(x=!0)}}catch(e){k.e(e)}finally{k.f()}}if(x){var T=s.the(g,l("use"));if(!T)return c.appendChild((0,p.errorMessageBlock)(e,'No "use" part for case in form '+i)),c;j(e,c,n,r,T,o,a);break}}return c},u.field[y.ui("Multiple").uri]=function(e,t,n,r,i,c,l){function f(e){return e.map((function(e){return e.toString().slice(-7)})).join(", ")}function h(){return m.apply(this,arguments)}function m(){return(m=(0,a.default)(o.default.mark((function t(){var n,i,a;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=q(c),!P){t.next=8;break}return W(),L.elements.push(n),t.next=6,K();case 6:t.next=20;break;case 8:return i=j?[b.st(n,I,r,c)]:[b.st(r,I,n,c)],t.prev=9,t.next=12,k.updater.update([],i);case 12:t.next=19;break;case 14:t.prev=14,t.t0=t.catch(9),a="Error adding to unordered multiple: "+t.t0,C.appendChild((0,p.errorMessageBlock)(e,a)),d.error(a);case 19:J();case 20:case"end":return t.stop()}}),t,null,[[9,14]])})))).apply(this,arguments)}function _(t){function i(){return(i=(0,a.default)(o.default.mark((function n(){var i,a;return o.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!P){n.next=14;break}d.log("pre delete: "+f(L.elements)),i=0;case 3:if(!(i<L.elements.length)){n.next=12;break}if(!L.elements[i].sameTerm(t)){n.next=9;break}return L.elements.splice(i,1),n.next=8,K();case 8:return n.abrupt("return");case 9:i++,n.next=3;break;case 12:n.next=15;break;case 14:k.holds(r,I,t,c)&&(a=[b.st(r,I,t,c)],k.updater.update(a,[],(function(t,n,r){n?M.removeChild(y):M.appendChild((0,p.errorMessageBlock)(e,"Multiple: delete failed: "+r))})));case 15:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function h(e,t){return m.apply(this,arguments)}function m(){return(m=(0,a.default)(o.default.mark((function e(n,r){var i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:d.log("pre move: "+f(L.elements)),i=0;case 2:if(!(i<L.elements.length)){e.next=8;break}if(!L.elements[i].sameTerm(t)){e.next=5;break}return e.abrupt("break",8);case 5:i++,e.next=2;break;case 8:if(i===L.elements.length&&alert("list move: not found element for "+t),!r){e.next=16;break}if(0!==i){e.next=13;break}return alert("@@ boop - already at top -temp message"),e.abrupt("return");case 13:L.elements.splice(i-1,2,L.elements[i],L.elements[i-1]),e.next=20;break;case 16:if(i!==L.elements.length-1){e.next=19;break}return alert("@@ boop - already at bottom -temp message"),e.abrupt("return");case 19:L.elements.splice(i,2,L.elements[i+1],L.elements[i]);case 20:return e.next=22,K();case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)}v.debug("Multiple: render object: "+t);var y=(0,u.fieldFunction)(e,R)(e,null,n,t,R,c,(function(e,n){d.log("Item done callback for item ".concat(t.toString())),e||d.error(" Item done callback: Error: "+n),l(e,n)}));if(y.subject=t,k.updater.editable(c.uri)&&(s.deleteButtonWithCheck(e,y,N,(function(){return i.apply(this,arguments)})),P)){var w=e.createElement("div");w.style.display="grid",w.style.gridTemplateColumns="auto 3em",w.style.gridTemplateRows="50% 50%";var x=s.button(e,g.icons.iconBase+"noun_1369237.svg","Move Up",function(){var e=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",h(t,!0));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),_=s.button(e,g.icons.iconBase+"noun_1369241.svg","Move Down",function(){var e=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",h(t,!1));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),E=e.createElement("div");return E.appendChild(y),w.appendChild(E),w.appendChild(x),w.appendChild(_),x.style.gridColumn=2,_.style.gridColumn=2,x.style.gridRow=1,_.style.padding="0em",x.style.padding="0em",_.style.gridRow=2,E.style.gridColumn=1,E.style.gridRowStart="span 2",w}return y}var E=g.icons.iconBase+"noun_19460_green.svg",k=w.store,S=i.doc?i.doc():null,C=e.createElement("div"),A=C,T=y.ui;t&&t.appendChild(C);var O=k.any(i,T("ordered")),P=!!O&&b.Node.toJS(O),I=k.any(i,T("property")),j=k.anyJS(i,T("reverse"),null,S);if(!I)return C.appendChild((0,p.errorMessageBlock)(e,"No property to multiple: "+i)),A;var N=k.any(i,T("label"));N||(N=x.label(I));var F=k.any(i,T("min"));F=F?0+F.value:0;var R=k.any(i,T("part"));if(!R)return C.appendChild((0,p.errorMessageBlock)(e,"No part to multiple: "+i)),A;var L,D,M=C.appendChild(e.createElement("div"));if(M.style.display="flex",M.style.flexDirection="column",D=j?k.any(null,I,r,c):k.any(r,I,null,c),P?(L=j?k.any(null,I,r,c):k.any(r,I,null,c),D=L?L.elements:[]):(D=j?k.each(null,I,r,c):k.each(r,I,null,c),L=null),k.updater.editable(c.uri)){var U=C.appendChild(e.createElement("div"));U.style.padding="0.5em";var B=U.appendChild(e.createElement("img"));B.setAttribute("src",E),B.setAttribute("style","margin: 0.2em; width: 1.5em; height:1.5em"),B.title="Click to add another "+N;var H=e.createElement("span");H.textContent=(0===D.length?"Add another ":"Add ")+N,U.addEventListener("click",function(){var e=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,h();case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),!0),U.appendChild(H)}function W(){L||(L=new b.Collection,j?k.add(L,I,r,c):k.add(r,I,L,c))}function K(){return V.apply(this,arguments)}function V(){return(V=(0,a.default)(o.default.mark((function t(){return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return d.log("save list: "+f(L.elements)),W(),t.prev=2,t.next=5,k.fetcher.putBack(c);case 5:t.next=11;break;case 7:return t.prev=7,t.t0=t.catch(2),C.appendChild((0,p.errorMessageBlock)(e,"Error trying to put back a list: "+t.t0)),t.abrupt("return");case 11:J();case 12:case"end":return t.stop()}}),t,null,[[2,7]])})))).apply(this,arguments)}function J(){var e;if(P){var t=j?k.the(null,I,r,c):k.the(r,I,null,c);e=t?t.elements:[]}else(e=j?k.each(null,I,r,c):k.each(r,I,null,c)).sort();x.syncTableToArrayReOrdered(M,e,_)}function z(){return(z=(0,a.default)(o.default.mark((function e(){var t,n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((t=F-D.length)>0)){e.next=12;break}n=0;case 3:if(!(n<t)){e.next=10;break}return d.log("Adding extra: min "+F),e.next=7,h();case 7:n++,e.next=3;break;case 10:return e.next=12,K();case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return M.refresh=J,J(),function(){return z.apply(this,arguments)}().then((function(){d.log(" Multiple render: async stuff ok")}),(function(e){d.error(" Multiple render: async stuff fails. #### ",e)})),A},u.field[y.ui("PhoneField").uri]=f.basicField,u.field[y.ui("EmailField").uri]=f.basicField,u.field[y.ui("ColorField").uri]=f.basicField,u.field[y.ui("DateField").uri]=f.basicField,u.field[y.ui("DateTimeField").uri]=f.basicField,u.field[y.ui("TimeField").uri]=f.basicField,u.field[y.ui("NumericField").uri]=f.basicField,u.field[y.ui("IntegerField").uri]=f.basicField,u.field[y.ui("DecimalField").uri]=f.basicField,u.field[y.ui("FloatField").uri]=f.basicField,u.field[y.ui("TextField").uri]=f.basicField,u.field[y.ui("SingleLineTextField").uri]=f.basicField,u.field[y.ui("NamedNodeURIField").uri]=f.basicField,u.field[y.ui("MultiLineTextField").uri]=function(e,t,n,r,i,o,a){var s=y.ui,c=w.store,u=i.doc?i.doc():null,l=c.any(i,s("property"));if(!l)return(0,p.errorMessageBlock)(e,"No property to text field: "+i);var d=e.createElement("div");d.style.display="flex",d.style.flexDirection="row";var h=d.appendChild(e.createElement("div"));h.style.width=m.formFieldNameBoxWidth;var g=d.appendChild(e.createElement("div"));h.appendChild((0,f.fieldLabel)(e,l,i)),o=(0,f.fieldStore)(r,l,o);var v=c.anyJS(r,l,null,o)||"",b=c.updater.editable(o.uri),x=i&&c.anyJS(i,y.ui("suppressEmptyUneditable"),null,u);!b&&x&&""===v&&(d.style.display="none");var _=D(e,c,r,l,o,a);return g.appendChild(_),t&&t.appendChild(d),d},u.field[y.ui("BooleanField").uri]=function(e,t,n,r,i,o,a){return P(e,t,0,r,i,o,0,!1)},u.field[y.ui("TristateField").uri]=function(e,t,n,r,i,o,a){return P(e,t,0,r,i,o,0,!0)},u.field[y.ui("Classifier").uri]=function(e,t,n,r,i,o,a){var s=w.store,c=y.ui,u=s.any(i,c("category"));if(!u)return(0,p.errorMessageBlock)(e,"No category for classifier: "+i);v.debug("Classifier: dataDoc="+o);var l=B(e,s,r,u,o,(function(e,t){return a(e,t)}));return t&&t.appendChild(l),l},u.field[y.ui("Choice").uri]=function(e,t,n,r,i,o,a){var c,u=y.ui,l=w.store,d=i.doc?i.doc():null,h=e.createElement("div");h.setAttribute("class","choiceBox"),t&&t.appendChild(h);var m=e.createElement("div");m.setAttribute("class","formFieldName choiceBox-label"),h.appendChild(m);var g=e.createElement("div");g.setAttribute("class","formFieldValue choiceBox-selectBox"),h.appendChild(g);var v=l.any(i,u("property"));if(!v)return h.appendChild((0,p.errorMessageBlock)(e,"No property for Choice: "+i));m.appendChild((0,f.fieldLabel)(e,v,i));var x=l.any(i,u("from"));if(!x)return(0,p.errorMessageBlock)(e,"No 'from' for Choice: "+i);var E=l.any(i,u("use")),k={form:i,subForm:E,disambiguate:!1};l.any(i,u("canMintNew"))&&(k.mint="* Create new *");var S,C=l.any(i,u("multiselect"));return C&&(k.multiSelect=!0),g.refresh=function(){var t=l.each(r,v,null,o).map((function(e){return e.value})),n=function(){var e,t=[];for(var n in t=l.each(void 0,y.rdf("type"),x,d),function(e,t,n){var r,i,o,a,s,c,u,l,d,p,f,h={};h[t.toNT()]=!0;var m={},g=e.transitiveClosure(h,e.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0);for(var v in g){for(var y=0,b=(s=e.statementsMatching(null,e.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),e.fromNT(v),n)).length;y<b;y++)m[(p=s[y]).subject.toNT()]=p;for(var w=0,x=(c=e.each(null,e.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"),e.fromNT(v),n)).length;w<x;w++)for(a=c[w],o=0,r=(u=e.statementsMatching(null,a,null,n)).length;o<r;o++)m[(p=u[o]).subject.toNT()]=p;for(var _=0,E=(l=e.each(null,e.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"),e.fromNT(v),n)).length;_<E;_++)for(a=l[_],f=0,i=(d=e.statementsMatching(null,a,null,n)).length;f<i;f++)m[(p=d[f]).object.toNT()]=p}return m}(l,x,o))t.push(l.fromNT(n));if(x.sameTerm(y.rdfs("Class")))for(c in s.allClassURIs())t.push(l.sym(c));else if(x.sameTerm(y.rdf("Property"))){for(c in(e=s.propertyTriage(l)).op)t.push(l.fromNT(c));for(c in e.dp)t.push(l.fromNT(c));k.disambiguate=!0}else if(x.sameTerm(y.owl("ObjectProperty"))){for(c in(e=s.propertyTriage(l)).op)t.push(l.fromNT(c));k.disambiguate=!0}else if(x.sameTerm(y.owl("DatatypeProperty"))){for(c in(e=s.propertyTriage(l)).dp)t.push(l.fromNT(c));k.disambiguate=!0}return t}();if(n.push(t),n=R(n),S=W(e,g,l,r,v,n,t,x,k,o,a),g.innerHTML="",g.appendChild(S),C){var i=new _.IconicMultiSelect({placeholder:S.selected,select:S,container:g,textField:"textField",valueField:"valueField"});i.init(),i.subscribe((function(n){if("REMOVE_OPTION"===n.action&&(t=t.filter((function(e){return e!==n.value}))),"CLEAR_ALL_OPTIONS"===n.action&&(t=[]),"ADD_OPTION"===n.action)if((n.value+"").includes("Create new")){var i=q(o),s=[];s.push(b.st(r,v,l.sym(i),o)),x&&s.push(b.st(i,y.rdf("type"),l.sym(x),o)),E&&I(e,g,{},b.sym(i),E,o,(function(n,r){n?(l.updater.update([],s,(function(t,n,r){n||g.appendChild((0,p.errorMessageBlock)(e,"Error updating select: "+r))})),t.push(i),a&&a(n,{widget:"select",event:"new"})):g.appendChild((0,p.errorMessageBlock)(e,"Error updating data in field of select: "+r))}))}else t.push(n.value);S.update(t)}))}},g.refresh(),S&&S.refresh&&S.refresh(),h},u.field[y.ui("Comment").uri]=u.field[y.ui("Heading").uri]=function(e,t,n,r,i,o,a){var s=y.ui,d=w.store,p=d.any(i,s("contents"));p||(p="Error: No contents in comment field.");var f=i.doc?i.doc():null,h=(0,u.mostSpecificClassURI)(i),m=c.fieldParams[h]||{},g=e.createElement("div");t&&t.appendChild(g);var v=g.appendChild(e.createElement(m.element));v.textContent=p,(0,l.setFieldStyle)(v,i);var b=d.anyJS(i,y.ui("suppressIfUneditable"),null,f),x=d.updater.editable(o.uri);return b&&!x&&(g.style.display="none"),g}},611:(e,t,n)=>{"use strict";var r=n(4836),i=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.renderAutocompleteControl=function(e,t,n,r,i,o){return x.apply(this,arguments)};var o=r(n(4687)),a=r(n(7156)),s=h(n(6590)),c=n(1124),u=n(166),l=h(n(2457)),d=h(n(5666)),p=n(6674);function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}function h(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}function m(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var v="Solid ID",y=c.icons.iconBase+"noun_34653_green.svg",b=c.icons.iconBase+"noun_Search_875351.svg",w=c.icons.iconBase+"noun_253504.svg";function x(){return x=(0,a.default)(o.default.mark((function e(t,n,r,i,c,f){var h,g,x,_,E,k,S,C,A,T,O,P,I,j,N,F,R,L,D,M,U,B,H;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(D=function(){L?((0,p.setVisible)(R,!1),(0,p.setVisible)(P,!1),(0,p.setVisible)(I,!1)):((0,p.setVisible)(R,!0),(0,p.setVisible)(P,!1),(0,p.setVisible)(I,!1))},O=function(){return(O=(0,a.default)(o.default.mark((function e(t){var r,i,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=m(t),e.prev=1,r.s();case 3:if((i=r.n()).done){e.next=9;break}return a=i.value,e.next=7,c(n,a);case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),r.e(e.t0);case 14:return e.prev=14,r.f(),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[1,11,14,17]])})))).apply(this,arguments)},T=function(e){return O.apply(this,arguments)},A=function(){return(A=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!U){e.next=5;break}B.removeChild(U),U=void 0,e.next=7;break;case 5:return e.next=7,k();case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)},C=function(e){return A.apply(this,arguments)},S=function(){return(S=(0,a.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(U=t.createElement("div")).setAttribute("style","display: flex; flex-flow: wrap;"),e.t0=U,e.next=5,(0,p.renderAutoComplete)(t,i,M,h);case 5:e.t1=e.sent,e.t0.appendChild.call(e.t0,e.t1),U.appendChild(P),U.appendChild(I),U.appendChild(R),U.appendChild(j),B.appendChild(U);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)},k=function(){return S.apply(this,arguments)},E=function(){U&&(B.removeChild(U),U=void 0)},_=function(){return(_=(0,a.default)(o.default.mark((function e(r){var i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l.askName(t,u.store,B,s.vcard("url"),void 0,v);case 2:if(i=e.sent){e.next=5;break}return e.abrupt("return");case 5:return e.abrupt("return",c(n,i));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)},x=function(e){return _.apply(this,arguments)},g=function(){return(g=(0,a.default)(o.default.mark((function e(t,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i.permanent?((0,p.setVisible)(R,!0),(0,p.setVisible)(P,!1),(0,p.setVisible)(I,!1)):E(),e.abrupt("return",c(t,n));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)},h=function(e,t){return g.apply(this,arguments)},(P=l.continueButton(t)).setAttribute("data-testid","accept-button"),(I=l.cancelButton(t)).setAttribute("data-testid","cancel-button"),j=t.createElement("div"),N=i.targetClass?d.label(i.targetClass):"item",(F=l.deleteButtonWithCheck(t,j,N,f)).setAttribute("data-testid","delete-button"),(R=l.button(t,w,"Edit",(function(e){L=!L,D()}))).setAttribute("data-testid","edit-button"),L=!0,M={acceptButton:P,cancelButton:I,editButton:R,deleteButton:F},U=void 0,(B=t.createElement("div")).style.display="flex",B.style.flexDirection="row",!i.permanent&&!i.currentObject){e.next=31;break}return e.next=31,k();case 31:return r.editable&&(B.style.width="100%",r.manualURIEntry&&(H=B.appendChild(l.button(t,y,r.idNoun,x)),l.makeDropTarget(H,T,void 0)),!r.dbLookup||i.currentObject||i.permanent||B.appendChild(l.button(t,b,r.idNoun,C))),D(),e.abrupt("return",B);case 34:case"end":return e.stop()}}),e)}))),x.apply(this,arguments)}},4179:(e,t,n)=>{"use strict";var r=n(4836),i=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.autocompleteField=function(e,t,n,r,i,f,h){var m;function g(){return(g=(0,a.default)(o.default.mark((function t(n,i){var a,s,c,l,d;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i){t.next=2;break}throw new Error("autocompleteField: No name set.");case 2:if(!(a=y.the(r,E,null,f))){t.next=7;break}if(s=y.any(a,k,null,f),!(a.equals(n)&&s&&s.sameTerm(i))){t.next=7;break}return t.abrupt("return");case 7:return c=a?y.statementsMatching(r,E,a,f).concat(y.statementsMatching(a,k,null,f)):[],l=[(0,p.st)(r,E,n,f),(0,p.st)(n,k,i,f)],t.prev=9,t.next=12,null===(d=y.updater)||void 0===d?void 0:d.updateMany(c,l);case 12:t.next=19;break;case 14:return t.prev=14,t.t0=t.catch(9),h(!1,t.t0),w.appendChild(u.errorMessageBlock(e,"Autocomplete form data update error:"+t.t0,null,t.t0)),t.abrupt("return");case 19:h(!0,"");case 20:case"end":return t.stop()}}),t,null,[[9,14]])})))).apply(this,arguments)}function v(){return(v=(0,a.default)(o.default.mark((function t(n,i){var a,s,c,l,d;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=y.the(r,E,null,f)){t.next=5;break}return h(!1,"NO data to elete"),w.appendChild(u.errorMessageBlock(e,"Autocomplete delete: no old data!")),t.abrupt("return");case 5:return s=y.statementsMatching(r,E,a,f).concat(y.statementsMatching(a,k,null,f)),c=[],t.prev=7,t.next=10,null===(l=y.updater)||void 0===l?void 0:l.updateMany(s,c);case 10:t.next=18;break;case 12:return t.prev=12,t.t0=t.catch(7),d=new Error("Autocomplete form data delete error:"+t.t0),h(!1,t.t0),w.appendChild(u.errorMessageBlock(e,d,null,t.t0)),t.abrupt("return");case 18:h(!0,"");case 19:case"end":return t.stop()}}),t,null,[[7,12]])})))).apply(this,arguments)}if("NamedNode"!==r.termType)throw new Error("Sorry this field only works on NamedNode subjects (for editable)");var y=c.store,b=i.doc?i.doc():null,w=e.createElement("div");t&&t.appendChild(w);var x=e.createElement("div");x.setAttribute("class","formFieldName"),x.setAttribute("style",l.formFieldNameBoxStyle),w.appendChild(x);var _=e.createElement("div");_.setAttribute("class","formFieldValue"),w.appendChild(_);var E=y.any(i,s.ui("property"));if(!E)return w.appendChild(u.errorMessageBlock(e,"Error: No property given for autocomplete field: "+i));var k=y.any(i,s.ui("labelProperty"))||s.schema("name"),S=y.any(i,s.ui("dataSource"));if(!S)return w.appendChild(u.errorMessageBlock(e,"Error: No data source given for autocomplete field: "+i));var C={label:y.anyJS(S,s.schema("name"),null,S.doc()),logo:y.any(S,s.schema("logo"),null,S.doc())},A=y.any(i,s.ui("targetClass"),null,i.doc())||y.any(S,s.ui("targetClass"),null,S.doc());A&&(C.targetClass=A),C.objectURIBase=y.any(S,s.ui("objectURIBase"),null,S.doc())||void 0;var T=y.anyJS(S,s.ui("endpoint"),null,S.doc());if(T){if(C.endpoint=T,C.searchByNameQuery=y.anyJS(S,s.ui("searchByNameQuery"),null,S.doc()),!C.searchByNameQuery)return w.appendChild(u.errorMessageBlock(e,"Error: No searchByNameQuery given for endpoint data Source: "+i));C.insitituteDetailsQuery=y.anyJS(S,s.ui("insitituteDetailsQuery"),null,S.doc())}else{var O=y.anyJS(S,s.ui("searchByNameURI"));if(!O)return w.appendChild(u.errorMessageBlock(e,"Error: No searchByNameURI OR sparql endpoint given for dataSource: "+S));C.searchByNameURI=O}var P=y.anyJS(i,s.ui("suppressEmptyUneditable"),null,b),I=null===(m=y.updater)||void 0===m?void 0:m.editable(f.uri),j={permanent:!0,targetClass:C.targetClass,queryParams:C};j.size=y.anyJS(i,s.ui("size"),null,b)||void 0;var N=y.any(r,E,void 0,f);if(N)j.currentObject=N,j.currentName=y.any(j.currentObject,k,null,f);else if(N=y.any(i,s.ui("default")))j.currentObject=N,j.currentName=y.any(j.currentObject,k,null,f);else if(P&&!I)return w.style.display="none",w;x.appendChild(u.fieldLabel(e,E,i));var F={editable:I,dbLookup:!0};return(0,d.renderAutocompleteControl)(e,r,F,j,(function(e,t){return g.apply(this,arguments)}),(function(e,t){return v.apply(this,arguments)})).then((function(e){_.appendChild(e)}),(function(t){_.appendChild(u.errorMessageBlock(e,"Error rendering autocomplete ".concat(i,": ").concat(t),"#fee",t))})),w};var o=r(n(4687)),a=r(n(7156)),s=h(n(6590)),c=n(166),u=h(n(2457)),l=h(n(2853)),d=n(611),p=n(6022);function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}function h(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}},6674:(e,t,n)=>{"use strict";var r=n(4836),i=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.renderAutoComplete=function(e,t,n,r){return b.apply(this,arguments)},t.setVisible=y;var o=r(n(4687)),a=r(n(7156)),s=h(n(4433)),c=h(n(2853)),u=h(n(2457)),l=n(166),d=n(5454),p=n(8214);function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}function h(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}function m(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var v=20;function y(e,t){e.style.display=t?"":"none"}function b(){return b=(0,a.default)(o.default.mark((function e(t,n,r,i){var f,h,g,b,w,x,_,E,k,S,C,A,T,O,P,I,j,N,F,R,L,D,M,U,B,H,q,W,K,V,J,z,Z,$;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(N=function(){n.currentObject?(z.value=n.currentName?n.currentName.value:"??? wot no name for "+n.currentObject,q=n.currentName,U=n.currentName?n.currentName.value:void 0,W=n.currentObject):(z.value="",U=void 0,W=void 0),r.deleteButton&&y(r.deleteButton,!!n.currentObject),r.acceptButton&&y(r.acceptButton,!1),r.editButton&&y(r.editButton,!0),r.cancelButton&&y(r.cancelButton,!1),D=!1,S()},j=function(){return j=(0,a.default)(o.default.mark((function e(){var n,r,i,u,l,f,h,y,b;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=function(e,t){return t.name.value>e.name.value?1:t.name.name<e.name.value?-1:0},n=function(e){var n=t.createElement("tr");c.setStyle(n,"autocompleteRowStyle"),n.setAttribute("style","padding: 0.3em;"),n.style.color=M?"#080":"#088",n.textContent=e.name.value;var r=(0,d.bindingToTerm)(e.subject),i=(0,d.bindingToTerm)(e.name);return n.addEventListener("click",function(){var e=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s.log(" click row textContent: "+n.textContent),s.log(" click name: "+i.value),r&&i&&g(r,i);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),n},!D){e.next=5;break}return s.log('Ignoring "'.concat(z.value,'" because of lock ')),e.abrupt("return");case 5:return s.log('Setting lock at "'.concat(z.value,'"')),D=!0,e.next=9,(0,p.getPreferredLanguages)();case 9:if(i=e.sent,!((u=z.value.trim().toLowerCase()).length<4)){e.next=16;break}S(),B=v,e.next=31;break;case 16:if(M&&U&&u.startsWith(U)){e.next=21;break}return s.log(' Querying database at "'.concat(u,'" cf last "').concat(U,'".')),e.next=20,T(u,i);case 20:R=e.sent;case 21:l=P(u,R),L&&l.length<=40&&(B=l.length),M=L&&l.length<=B,s.log(' Filter:"'.concat(u,'" lastBindings: ').concat(R.length,", slimmed to ").concat(l.length,"; rows: ").concat(B,", Enough? ").concat(L,", All displayed? ").concat(M)),(f=l.slice(0,B)).sort(r),S(),h=m(f);try{for(h.s();!(y=h.n()).done;)b=y.value,K.appendChild(n(b))}catch(e){h.e(e)}finally{h.f()}1===l.length&&g((0,d.bindingToTerm)(l[0].subject),(0,d.bindingToTerm)(l[0].name));case 31:D=!1;case 32:case"end":return e.stop()}}),e)}))),j.apply(this,arguments)},I=function(){return j.apply(this,arguments)},P=function(e,t){return t.filter((function(t){return k(e,t.name.value)}))},O=function(){return(O=(0,a.default)(o.default.mark((function e(t,r){var i,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,d.queryPublicDataByName)(t,F,r||p.defaultPreferredLanguages,n.queryParams);case 3:i=e.sent,e.next=11;break;case 6:return e.prev=6,e.t0=e.catch(0),f("Error querying db of organizations: "+e.t0),D=!1,e.abrupt("return");case 11:return L=i.length<d.AUTOCOMPLETE_LIMIT,U=L?t:void 0,S(),a=(0,p.filterByLanguage)(i,r),e.abrupt("return",a);case 16:case"end":return e.stop()}}),e,null,[[0,6]])})))).apply(this,arguments)},T=function(e,t){return O.apply(this,arguments)},A=function(){return(A=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:y(r.cancelButton,!0),I();case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)},C=function(e){return A.apply(this,arguments)},S=function(){for(;K.children.length>1;)K.removeChild(K.lastChild)},k=function(e,t){for(var n=e.split(" "),r=0;r<n.length;r++){var i=n[r];if(t.toLowerCase().indexOf(i)<0)return!1}return!0},E=function(){return(E=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s.log("Auto complete: Canceled by user! "),n.permanent?N():H.parentNode&&H.parentNode.removeChild(H);case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)},_=function(e){return E.apply(this,arguments)},x=function(){return(x=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:q&&z.value===q.value&&h(W,q);case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)},w=function(e){return x.apply(this,arguments)},b=function(){return(b=(0,a.default)(o.default.mark((function e(t,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r.acceptButton){e.next=10;break}return r.acceptButton.disbaled=!1,y(r.acceptButton,!0),z.value=n.value,q=n,W=t,s.log("Auto complete: name: "+n),s.log("Auto complete: waiting for accept "+t),S(),e.abrupt("return");case 10:y(r.cancelButton,!0),h(t,n);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)},g=function(e,t){return b.apply(this,arguments)},h=function(e,t){s.log("Auto complete: finish! "+e),"Literal"===e.termType&&n.queryParams.objectURIBase&&(e=l.store.sym(n.queryParams.objectURIBase.value+e.value)),S(),i(e,t)},f=function(e){var n=K.appendChild(t.createElement("tr"));s.log(e);var r=new Error(e);n.appendChild(u.errorMessageBlock(t,r,"pink")),c.setStyle(n,"autocompleteRowStyle"),n.style.padding="1em"},F=n.targetClass){e.next=21;break}throw new Error("renderAutoComplete: missing targetClass");case 21:return r.acceptButton&&r.acceptButton.addEventListener("click",w,!1),r.cancelButton&&r.cancelButton.addEventListener("click",_,!1),L=!1,D=!1,M=!1,U=void 0,B=v,H=t.createElement("div"),q=void 0,W=void 0,(K=H.appendChild(t.createElement("table"))).setAttribute("data-testid","autocomplete-table"),K.setAttribute("style","max-width: 30em; margin: 0.5em;"),V=K.appendChild(t.createElement("tr")),c.setStyle(V,"autocompleteRowStyle"),J=V.appendChild(t.createElement("td")),(z=J.appendChild(t.createElement("input"))).setAttribute("type","text"),N(),Z=n.size||c.textInputSize||20,z.setAttribute("size",Z),z.setAttribute("data-testid","autocomplete-input"),$=c.textInputStyle||"border: 0.1em solid #444; border-radius: 0.5em; width: 100%; font-size: 100%; padding: 0.1em 0.6em",z.setAttribute("style",$),z.addEventListener("keyup",(function(e){13===e.keyCode&&w(e)}),!1),z.addEventListener("input",C),e.abrupt("return",H);case 48:case"end":return e.stop()}}),e)}))),b.apply(this,arguments)}},8214:(e,t,n)=>{"use strict";var r=n(4836),i=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.addDefaults=h,t.defaultPreferredLanguages=void 0,t.filterByLanguage=function(e,t){var n={};e.forEach((function(e){var t=e.subject.value;n[t]=n[t]||[],n[t].push(e)}));var r=t||f;r.reverse();var i=[];for(var o in n){var a=n[o].map((function(e){var t=e.name["xml:lang"];return[r.indexOf(t),e]}));a.sort(),a.reverse(),i.push(a[0][1])}return s.log(" Filter by language: ".concat(e.length," -> ").concat(i.length)),i},t.getPreferredLanguages=function(){return v.apply(this,arguments)},t.getPreferredLanguagesFor=m,t.languageCodeURIBase=void 0;var o=r(n(4687)),a=r(n(7156)),s=d(n(4433)),c=n(166),u=d(n(6590));function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}function d(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}var p="https://www.w3.org/ns/iana/language-code/";t.languageCodeURIBase=p;var f=["en","fr","de","it","ar"];function h(e){return e||(e=[]),e.concat(f.filter((function(t){return!e.includes(t)})))}function m(e){return g.apply(this,arguments)}function g(){return(g=(0,a.default)(o.default.mark((function e(t){var n,r,i,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.doc(),e.next=3,null===(n=c.store.fetcher)||void 0===n?void 0:n.load(r);case 3:if(i=c.store.any(t,u.schema("knowsLanguage"),null,r)){e.next=6;break}return e.abrupt("return",f);case 6:if(a=[],i.elements.forEach((function(e){var t=c.store.any(e,u.solid("publicId"),null,r);if(t)if(t.value.startsWith(p)){var n=t.value.slice(p.length);a.push(n)}else console.error("What should be a language code ".concat(t.value," does not start with ").concat(p));else console.warn("getPreferredLanguages: No publiID of language.")})),!(a.length>0)){e.next=11;break}return console.log(' User knows languages with codes: "'.concat(a.join(","),'"')),e.abrupt("return",h(a));case 11:return e.abrupt("return",null);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function v(){return(v=(0,a.default)(o.default.mark((function e(){var t,n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c.authn.currentUser();case 2:if(!(t=e.sent)){e.next=9;break}return e.next=6,m(t);case 6:if(!(n=e.sent)){e.next=9;break}return e.abrupt("return",n);case 9:if("undefined"==typeof navigator){e.next=14;break}if(!navigator.languages){e.next=12;break}return e.abrupt("return",h(navigator.languages.map((function(e){return e.split("-")[0]}))));case 12:if(!navigator.language){e.next=14;break}return e.abrupt("return",h([navigator.language.split("-")[0]]));case 14:return e.abrupt("return",f);case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}t.defaultPreferredLanguages=f},5454:(e,t,n)=>{"use strict";var r=n(4836),i=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.AUTOCOMPLETE_LIMIT=void 0,t.ESCOResultToBindings=k,t.bindingToTerm=function(e){var t=e.type.toLowerCase();if("uri"===t||"iri"===t)return c.store.sym(e.value);if("literal"===t)return e["xml:lang"]?new s.Literal(e.value,e["xml:lang"]):new s.Literal(e.value);throw new Error('bindingToTerm: Unexpected type "'.concat(e.type,'" in sparql binding}'))},t.fetcherOptionsJsonPublicData=t.escoParameters=t.dbpediaParameters=t.dbPediaTypeMap=void 0,t.getDbpediaDetails=D,t.getWikidataDetails=N,t.getWikidataDetailsOld=function(e,t,n){return R.apply(this,arguments)},t.getWikidataLocation=function(e,t,n){return L.apply(this,arguments)},t.instituteDetailsWikidataQuery=void 0,t.loadFromBindings=E,t.loadPublicDataThing=function(e,t,n){return j.apply(this,arguments)},t.queryESCODataByName=function(e,t,n){return S.apply(this,arguments)},t.queryPublicDataByName=function(e,t,n,r){return A.apply(this,arguments)},t.queryPublicDataConstruct=P,t.queryPublicDataSelect=T,t.wikidataParameters=t.wikidataOutgoingClassMap=t.wikidataIncomingClassMap=t.wikidataClasses=t.variableNameToPredicateMap=void 0;var o=r(n(4687)),a=r(n(7156)),s=n(6022),c=n(166),u=f(n(4433)),l=f(n(6590)),d=n(8214);function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(p=function(e){return e?n:t})(e)}function f(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var n=p(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}var h=200;t.AUTOCOMPLETE_LIMIT=h;var m=/\$\(subject\)/g;t.wikidataClasses={Corporation:"http://www.wikidata.org/entity/Q6881511",EducationalOrganization:"http://www.wikidata.org/entity/Q178706",GovernmentOrganization:"http://www.wikidata.org/entity/Q327333",MedicalOrganization:"http://www.wikidata.org/entity/Q4287745",MusicGroup:"http://www.wikidata.org/entity/Q32178211",NGO:"http://www.wikidata.org/entity/Q163740",Occupation:"http://www.wikidata.org/entity/Q28640",Project:"http://www.wikidata.org/entity/Q170584",ResearchOrganization:"http://www.wikidata.org/entity/Q31855",SportsOrganization:"http://www.wikidata.org/entity/Q4438121"};var g='prefix vcard: <http://www.w3.org/2006/vcard/ns#>\nCONSTRUCT\n{ wd:Q49108 vcard:fn ?itemLabel.\nwd:Q49108 rdf:type ?klass. ?klass rdfs:label ?klassLabel; rdfs:comment ?klassDescription .\nwd:Q49108 schema:logo ?logo;\n schema:image ?image;\n schema:logo ?sealImage;\n schema:subOrganization ?subsidiary .\n ?subsidiary rdfs:label ?subsidiaryLabel .\n ?supersidiary schema:subOrganization wd:Q49108 .\n ?supersidiary rdfs:label ?supersidiaryLabel .\n wd:Q49108 schema:location ?location .\n ?location schema:elevation ?elevation .\n ?location wdt:P131 ?region . ?region rdfs:label ?regionLabel .\n ?location wdt:P625 ?coordinates .\n ?location schema:country ?country . ?country rdfs:label ?countryLabel .\n}\nWHERE\n{ optional {wd:Q49108 rdfs:label ?itemLabel} .\n optional {wd:Q49108 wdt:P154 ?logo .}\n optional {wd:Q49108 wdt:P31 ?klass .}\n optional {wd:Q49108 wdt:P158 ?sealImage .}\n optional {wd:Q49108 wdt:P18 ?image .}\n\n optional { wd:Q49108 wdt:P355 ?subsidiary . }\n optional { ?supersidiary wdt:P355 wd:Q49108. }\n\n optional { wd:Q49108 wdt:P276 ?location .\n\n optional { ?location schema:eleveation ?elevation }\n optional { ?location wdt:P131 ?region }\n optional { ?location wdt:P625 ?coordinates }\n optional { ?location wdt:P17 ?country }\n }\n SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,en,de,it". }\n}';t.instituteDetailsWikidataQuery=g;var v={credentials:"omit",headers:new Headers({Accept:"application/json"})};t.fetcherOptionsJsonPublicData=v;var y={label:"ESCO",logo:c.store.sym("https://ec.europa.eu/esco/portal/static_resource2/images/logo/logo_en.gif"),searchByNameURI:"https://ec.europa.eu/esco/api/search?language=$(language)&type=occupation&text=$(name)"};t.escoParameters=y;var b={label:"DBPedia",logo:c.store.sym("https://upload.wikimedia.org/wikipedia/commons/thumb/7/73/DBpediaLogo.svg/263px-DBpediaLogo.svg.png"),searchByNameQuery:'select distinct ?subject, ?name where {\n ?subject a $(targetClass); rdfs:label ?name\n FILTER regex(?name, "$(name)", "i")\n } LIMIT $(limit)',endpoint:"https://dbpedia.org/sparql/"};t.dbpediaParameters=b,t.dbPediaTypeMap={AcademicInsitution:"http://umbel.org/umbel/rc/EducationalOrganization"},t.wikidataOutgoingClassMap={AcademicInsitution:"http://www.wikidata.org/entity/Q4671277",Enterprise:"http://www.wikidata.org/entity/Q6881511",Business:"http://www.wikidata.org/entity/Q4830453",NGO:"http://www.wikidata.org/entity/Q79913",CharitableOrganization:"http://www.wikidata.org/entity/Q708676",Insitute:"http://www.wikidata.org/entity/Q1664720"};var w={label:"WikiData",limit:3e3,logo:c.store.sym("https://www.wikimedia.org/static/images/project-logos/wikidatawiki.png"),endpoint:"https://query.wikidata.org/sparql",searchByNameQuery:'SELECT ?subject ?name\n WHERE {\n ?klass wdt:P279* $(targetClass) .\n ?subject wdt:P31 ?klass .\n ?subject rdfs:label ?name.\n FILTER regex(?name, "$(name)", "i")\n } LIMIT $(limit) ',insitituteDetailsQuery:'CONSTRUCT\n{ wd:Q49108 schema:name ?itemLabel;\n schema:logo ?logo;\n schema:logo ?sealImage;\n schema:subOrganization ?subsidiary .\n ?subsidiary schema:name ?subsidiaryLabel .\n}\nWHERE\n{\n wd:Q49108 # rdfs:label ?itemLabel ;\n wdt:P154 ?logo;\n wdt:P158 ?sealImage ;\n wdt:P355 ?subsidiary .\n # ?subsidiary rdfs:label ?subsidiaryLabel .\n\n SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE], fr". }\n}'};t.wikidataParameters=w;var x={"http://www.wikidata.org/entity/Q15936437":l.schema("CollegeOrUniversity"),"http://www.wikidata.org/entity/Q1664720":l.schema("EducationalOrganization"),"http://www.wikidata.org/entity/Q43229":l.schema("Organization"),"http://www.wikidata.org/entity/Q3918":l.schema("CollegeOrUniversity"),"http://www.wikidata.org/entity/Q170584":l.schema("Project"),"http://www.wikidata.org/entity/Q327333":l.schema("GovernmentOrganization"),"http://www.wikidata.org/entity/Q2221906":l.schema("Place"),"http://www.wikidata.org/entity/Q167037":l.schema("Corporation")};t.wikidataIncomingClassMap=x;var _={targetClass:l.rdf("type"),sealImage:l.schema("logo"),shortName:l.foaf("nick"),subsidiary:l.schema("subOrganization"),city:l.vcard("locality"),state:l.vcard("region"),country:l.vcard("country-name"),homepage:l.foaf("homepage"),lat:l.schema("latitude"),long:l.schema("longitude")};function E(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:_,o={};u.log("loadFromBindings: subject: ".concat(t)),u.log(" doc: ".concat(r)),n.forEach((function(e){for(var t in e){var n=e[t],r=JSON.stringify(n);o[t]=o[t]||new Set,o[t].add(r)}}));var a=function(n){var a=o[n];u.log(" results ".concat(n," -> ").concat(a)),a.forEach((function(o){var a,c=JSON.parse(o),d=c.type,p=c.value;if("uri"===d)a=e.sym(p);else{if("literal"!==d)throw new Error("loadFromBindings: unexpected type: ".concat(d));a=new s.Literal(p,c.language,c.datatype)}if("type"===n)x[p]?a=x[p]:u.warn("Unmapped Wikidata Class: "+p);else if("coordinates"===n){u.log(" @@@ hey a point: "+p);var f=/.*\(([-0-9.-]*) ([-0-9.-]*)\)/.exec(p);if(f){var h=l.xsd("float"),m=new s.Literal(f[1],null,h),g=new s.Literal(f[2],null,h);e.add(t,l.schema("longitude"),g,r),e.add(t,l.schema("latitude"),m,r)}else u.log("Bad coordinates syntax: "+p)}else{var v=i[n]||l.schema(n);e.add(t,v,a,r),u.log(" public data ".concat(v," ").concat(a,"."))}}))};for(var c in o)a(c)}function k(e){return e._embedded.results.map((function(e){return{name:{value:e.title,type:"literal"},subject:{type:"IRI",value:e.uri}}}))}function S(){return(S=(0,a.default)(o.default.mark((function e(t,n,r){var i,a,s,l,d,p;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.searchByNameURI){e.next=2;break}throw new Error("Missing queryTarget.searchByNameURI on queryESCODataByName");case 2:return a=r.limit||h,s=r.searchByNameURI.replace("$(name)",t).replace("$(limit)",""+a).replace("$(targetClass)",n.toNT()),u.log("Querying ESCO data - uri: "+s),e.next=7,null===(i=c.store.fetcher)||void 0===i?void 0:i.webOperation("GET",s,v);case 7:if(l=e.sent,d=(null==l?void 0:l.responseText)||"",u.log(" Query result text"+d.slice(0,500)+"..."),0!==d.length){e.next=12;break}throw new Error("Wot no text back from ESCO query "+s);case 12:return p=JSON.parse(d),u.log(" ESCO Query result JSON"+JSON.stringify(p,null,4).slice(0,500)+"..."),e.abrupt("return",k(p));case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function C(e){var t=e.indexOf("SPARQL-QUERY");if(t<0)return e;u.warn(" ### Fixing JSON with wikidata error code injection "+e.slice(t,t+200));var n=e.lastIndexOf("}, {");return e.slice(0,n)+" } ] } } "}function A(){return(A=(0,a.default)(o.default.mark((function e(t,n,r,i){var a,s,l,p,f,m,g,y,b,w,x;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=function(e){var r=i.limit||h;return e.replace("$(name)",t).replace("$(limit)",""+r).replace("$(language)",l).replace("$(targetClass)",n.toNT())},n){e.next=3;break}throw new Error("queryPublicDataByName: No class provided");case 3:return e.next=5,(0,d.getPreferredLanguages)();case 5:if(e.t0=e.sent,e.t0){e.next=8;break}e.t0=d.defaultPreferredLanguages;case 8:if(s=e.t0,l=s[0]||"en",!i.searchByNameQuery){e.next=16;break}return p=a(i.searchByNameQuery),u.log("Querying public data - sparql: "+p),e.abrupt("return",T(p,i));case 16:if(!i.searchByNameURI){e.next=46;break}return f=a(i.searchByNameURI),e.prev=18,e.next=21,null===(g=c.store.fetcher)||void 0===g?void 0:g.webOperation("GET",f,v);case 21:m=e.sent,e.next=27;break;case 24:throw e.prev=24,e.t1=e.catch(18),new Error("Exception when trying to fetch ".concat(f," \n ").concat(e.t1));case 27:if(y=m.responseText||"",200===m.status){e.next=30;break}throw new Error("HTTP error status ".concat(m.status," trying to fetch ").concat(f," "));case 30:if(u.log(" Query result text"+y.slice(0,500)+"..."),0!==y.length){e.next=33;break}throw new Error("queryPublicDataByName: No text back from public data query "+f);case 33:if(b=C(y),w=JSON.parse(b),u.log(" API Query result JSON"+JSON.stringify(w,null,4).slice(0,500)+"..."),!w._embedded){e.next=42;break}return u.log(" Looks like ESCO"),x=k(w),e.abrupt("return",x);case 42:throw alert("Code me: unrecognized API return format"),new Error("*** Need to add code to parse unrecognized API JSON return\n".concat(JSON.stringify(w,null,4)));case 44:e.next=47;break;case 46:throw new Error("Query source must have either rest API or SPARQL endpoint.");case 47:case"end":return e.stop()}}),e,null,[[18,24]])})))).apply(this,arguments)}function T(e,t){return O.apply(this,arguments)}function O(){return(O=(0,a.default)(o.default.mark((function e(t,n){var r,i,a,s,l,d,p,f,h,m;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.endpoint){e.next=2;break}throw new Error("Missing queryTarget.endpoint required for queryPublicDataSelect");case 2:return(i=new URL(n.endpoint)).searchParams.append("query",t),a=i.href,u.log(" queryPublicDataSelect uri: "+a),(s=new Headers).append("Accept","application/json"),l={credentials:"omit",headers:s},e.next=11,null===(r=c.store.fetcher)||void 0===r?void 0:r.webOperation("GET",a,l);case 11:if(d=e.sent,0!==(p=(null==d?void 0:d.responseText)||"").length){e.next=15;break}throw new Error("No text back from query "+a);case 15:return f=C(p),h=JSON.parse(f),u.log(" Query result JSON"+JSON.stringify(h,null,4).slice(0,100)+"..."),m=h.results.bindings,e.abrupt("return",m);case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function P(e,t,n){return I.apply(this,arguments)}function I(){return(I=(0,a.default)(o.default.mark((function e(t,n,r){var i,a,l,d,p,f,h,m;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u.log("queryPublicDataConstruct: sparql:",t),r.endpoint){e.next=3;break}throw new Error("Missing queryTarget.endpoint required for queryPublicDataConstruct");case 3:return(a=new URL(r.endpoint)).searchParams.append("query",t),l=a.href,u.log(" queryPublicDataConstruct uri: "+l),(d=new Headers).append("Accept","text/turtle"),p={credentials:"omit",headers:d},e.next=12,null===(i=c.store.fetcher)||void 0===i?void 0:i.webOperation("GET",l,p);case 12:if(f=e.sent,h=(null==f?void 0:f.responseText)||"No response text?",m=h.length>500?h.slice(0,200)+" ... "+h.slice(-200):h,u.log(" queryPublicDataConstruct result text:"+m),0!==h.length){e.next=18;break}throw new Error("queryPublicDataConstruct: No text back from construct query:"+l);case 18:(0,s.parse)(h,c.store,n.uri,"text/turtle");case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function j(){return(j=(0,a.default)(o.default.mark((function e(t,n,r){var i,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r.uri.startsWith("https://dbpedia.org/resource/")){e.next=4;break}return e.abrupt("return",D(t,n,r));case 4:if(!r.uri.match(/^https?:\/\/www\.wikidata\.org\/entity\/.*/)){e.next=9;break}return e.next=7,N(t,n,r);case 7:e.next=13;break;case 9:return i=r.uri.startsWith("http:")?t.sym("https:"+r.uri.slice(5)):r,(a=new Headers).append("Accept","text/turtle"),e.abrupt("return",t.fetcher.load(i,{credentials:"omit",headers:a}));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function N(e,t,n){return F.apply(this,arguments)}function F(){return(F=(0,a.default)(o.default.mark((function e(t,n,r){var i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=g.replace(/wd:Q49108/g,r.toNT()),e.next=4,P(i,r,w);case 4:u.log("getWikidataDetails: loaded.",r);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function R(){return(R=(0,a.default)(o.default.mark((function e(t,n,r){var i,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i='select distinct * where {\n optional { $(subject) wdt:P31 ?targetClass } # instance of\n optional { $(subject) wdt:P154 ?logo }\n optional { $(subject) wdt:P158 ?sealImage }\n# optional { $(subject) wdt:P159 ?headquartersLocation }\n\noptional { $(subject) wdt:P17 ?country }\noptional { $(subject) wdt:P18 ?image }\noptional { $(subject) wdt:P1813 ?shortName }\n\noptional { $(subject) wdt:P355 ?subsidiary }\n# SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,en,de,it" }\n}'.replace(m,r.toNT()),e.next=3,T(i,w);case 3:a=e.sent,E(t,r,a,r.doc());case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function L(){return(L=(0,a.default)(o.default.mark((function e(t,n,r){var i,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i='select distinct * where {\n\n $(subject) wdt:P276 ?location .\n\n optional { ?location wdt:P2044 ?elevation }\n optional { ?location wdt:P131 ?region }\n optional { ?location wdt:P625 ?coordinates }\noptional { ?location wdt:P17 ?country }\n\n# SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,en,de,it" }\n}'.replace(m,r.toNT()),u.log(" location query sparql:"+i),e.next=4,T(i,w);case 4:a=e.sent,u.log(" location query bindings:",a),E(t,r,a,r.doc());case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function D(e,t,n){return M.apply(this,arguments)}function M(){return(M=(0,a.default)(o.default.mark((function e(t,n,r){var i,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i="select distinct ?city, ?state, ?country, ?homepage, ?logo, ?lat, ?long, WHERE {\n OPTIONAL { <".concat(r,"> <http://dbpedia.org/ontology/city> ?city }\n OPTIONAL { ").concat(r," <http://dbpedia.org/ontology/state> ?state }\n OPTIONAL { ").concat(r," <http://dbpedia.org/ontology/country> ?country }\n OPTIONAL { ").concat(r," foaf:homepage ?homepage }\n OPTIONAL { ").concat(r," foaf:lat ?lat; foaf:long ?long }\n OPTIONAL { ").concat(r," <http://dbpedia.org/ontology/country> ?country }\n }"),e.next=3,T(i,b);case 3:a=e.sent,E(t,r,a,r.doc()),u.log("Finished getDbpediaDetails.");case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}t.variableNameToPredicateMap=_},4322:(e,t,n)=>{"use strict";var r=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.basicField=function(e,t,n,r,o,c,p){var m=f,v=o.doc?o.doc():null,y=e.createElement("div"),b=m.any(o,a.ui("property"));if(t&&t.appendChild(y),!b)return y.appendChild((0,u.errorMessageBlock)(e,"Error: No property given for text field: "+o));var w=h(e,m,y,o),x=m.anyJS(o,a.ui("suppressEmptyUneditable"),null,v),_=(0,l.mostSpecificClassURI)(o),E=d.fieldParams[_];void 0===E&&(E={style:""});var k=E.style||"",S=s.textInputStyle+k,C=e.createElement("input");C.style=S,w.appendChild(C),C.setAttribute("type",E.type?E.type:"text");var A=m.anyJS(o,a.ui("size"))||s.textInputSize||20;C.setAttribute("size",A);var T=m.any(o,a.ui("maxLength"));C.setAttribute("maxLength",T?""+T:"4096"),c=c||g(r,b,c);var O=m.any(r,b,void 0,c);if(O||(O=m.any(o,a.ui("default"))),O&&O.value&&E.uriPrefix?C.value=decodeURIComponent(O.value.replace(E.uriPrefix,"")).replace(/ /g,""):O&&(C.value=O.value||O.value||""),C.setAttribute("style",S),!m.updater)throw new Error("kb has no updater");return m.updater.editable(c.uri)?(C.addEventListener("keyup",(function(e){E.pattern&&C.setAttribute("style",S+(C.value.match(E.pattern)?"color: green;":"color: red;"))}),!0),C.addEventListener("change",(function(t){if(!E.pattern||C.value.match(E.pattern)){C.disabled=!0,C.setAttribute("style",S+"color: gray;");var n,o=m.statementsMatching(r,b);E.namedNode?n=m.sym(C.value):E.uriPrefix?(n=encodeURIComponent(C.value.replace(/ /g,"")),n=m.sym(E.uriPrefix+C.value)):n=E.dt?new i.Literal(C.value.trim(),void 0,a.xsd(E.dt)):new i.Literal(C.value);var s=o.map((function(e){return(0,i.st)(e.subject,e.predicate,n,e.why)}));0===s.length&&(s=[(0,i.st)(r,b,n,c)]),function e(t,n,r){var i=[];if(n.forEach((function(e){i.includes(e.why.uri)||i.push(e.why.uri)})),t.forEach((function(e){i.includes(e.why.uri)||i.push(e.why.uri)})),0===i.length)throw new Error("updateMany has no docs to patch");if(!m.updater)throw new Error("kb has no updater");if(1===i.length)return m.updater.update(t,n,r);var o=i.pop(),a=n.filter((function(e){return e.why.uri===o})),s=n.filter((function(e){return e.why.uri!==o})),c=t.filter((function(e){return e.why.uri===o})),u=t.filter((function(e){return e.why.uri!==o}));m.updater.update(c,a,(function(t,n,i){n?e(u,s,r):r(t,n,i)}))}(o,s,(function(t,n,r){n?(C.disabled=!1,C.setAttribute("style",S)):y.appendChild((0,u.errorMessageBlock)(e,r)),p(n,r)}))}}),!0),y):(C.readOnly=!0,C.style=s.textInputStyleUneditable+k,x&&""===C.value&&(y.style.display="none"),y)},t.fieldLabel=m,t.fieldStore=g,t.renderNameValuePair=h;var i=n(6022),o=n(166),a=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=p(t);if(n&&n.has(e))return n.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,n&&n.set(e,i),i}(n(6590)),s=n(2853),c=n(5666),u=n(9449),l=n(4816),d=n(4246);function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(p=function(e){return e?n:t})(e)}var f=o.solidLogicSingleton.store;function h(e,t,n,r,i){n.style.display="flex",n.style.flexDirection="row";var o=n.appendChild(e.createElement("div"));o.style.width=s.formFieldNameBoxWidth;var c=n.appendChild(e.createElement("div"));return o.setAttribute("class","formFieldName"),o.setAttribute("style",s.formFieldNameBoxStyle),c.setAttribute("class","formFieldValue"),i?o.appendChild(e.createTextNode(i)):t.any(r,a.ui("property"))?o.appendChild(m(e,t.any(r,a.ui("property")),r)):(c.appendChild((0,u.errorMessageBlock)(e,"No property or label given for form field: "+r)),o.appendChild(e.createTextNode("???"))),c}function m(e,t,n){var r=f.any(n,a.ui("label"));if(r||(r=(0,c.label)(t,!0)),void 0===t)return e.createTextNode("@@Internal error: undefined property");var i=e.createElement("a");return t.uri&&i.setAttribute("href",t.uri),i.setAttribute("style","color: #3B5998; text-decoration: none;"),i.textContent=r,i}function g(e,t,n){var r=f.statementsMatching(e,t);if(0===r.length)return n;if(!f.updater)throw new Error("Store has no updater");return r.length>0&&r[0].why.value&&f.updater.editable(r[0].why.value,f)?f.sym(r[0].why.value):n}},4816:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.field=void 0,t.fieldFunction=function(e,t){var n=c(t),r=s[n];return(0,i.debug)("paneUtils: Going to implement field "+t+" of type "+n),r||function(e,r){var i=(0,o.errorMessageBlock)(e,"No handler for field "+t+" of type "+n);return r&&r.appendChild(i),i}},t.mostSpecificClassURI=c;var r=n(166),i=n(8853),o=n(9449),a=r.solidLogicSingleton.store,s={};function c(e){var t=a,n=t.findTypeURIs(e),r=t.bottomTypeURIs(n),i=[];for(var o in r)i.push(o);return i[0]}t.field=s},4246:(e,t,n)=>{"use strict";var r=n(4836),i=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.fieldParams=void 0;var o,a=r(n(8416)),s=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(6590)),c=n(2853);function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}var l=(o={},(0,a.default)(o,s.ui("ColorField").uri,{size:9,type:"color",style:"height: 3em;",dt:"color",pattern:/^\s*#[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]([0-9a-f][0-9a-f])?\s*$/}),(0,a.default)(o,s.ui("DateField").uri,{size:20,type:"date",dt:"date",pattern:/^\s*[0-9][0-9][0-9][0-9](-[0-1]?[0-9]-[0-3]?[0-9])?Z?\s*$/}),(0,a.default)(o,s.ui("DateTimeField").uri,{size:20,type:"datetime-local",dt:"dateTime",pattern:/^\s*[0-9][0-9][0-9][0-9](-[0-1]?[0-9]-[0-3]?[0-9])?(T[0-2][0-9]:[0-5][0-9](:[0-5][0-9])?)?Z?\s*$/}),(0,a.default)(o,s.ui("TimeField").uri,{size:10,type:"time",dt:"time",pattern:/^\s*([0-2]?[0-9]:[0-5][0-9](:[0-5][0-9])?)\s*$/}),(0,a.default)(o,s.ui("IntegerField").uri,{size:12,style:"text-align: right;",dt:"integer",pattern:/^\s*-?[0-9]+\s*$/}),(0,a.default)(o,s.ui("DecimalField").uri,{size:12,style:"text-align: right;",dt:"decimal",pattern:/^\s*-?[0-9]*(\.[0-9]*)?\s*$/}),(0,a.default)(o,s.ui("FloatField").uri,{size:12,style:"text-align: right;",dt:"float",pattern:/^\s*-?[0-9]*(\.[0-9]*)?((e|E)-?[0-9]*)?\s*$/}),(0,a.default)(o,s.ui("SingleLineTextField").uri,{}),(0,a.default)(o,s.ui("NamedNodeURIField").uri,{namedNode:!0}),(0,a.default)(o,s.ui("TextField").uri,{}),(0,a.default)(o,s.ui("PhoneField").uri,{size:20,uriPrefix:"tel:",pattern:/^\+?[\d-]+[\d]*$/}),(0,a.default)(o,s.ui("EmailField").uri,{size:30,uriPrefix:"mailto:",pattern:/^\s*.*@.*\..*\s*$/}),(0,a.default)(o,s.ui("Group").uri,{style:c.formGroupStyle}),(0,a.default)(o,s.ui("Comment").uri,{element:"p",style:c.commentStyle}),(0,a.default)(o,s.ui("Heading").uri,{element:"h3",style:c.formHeadingStyle}),o);t.fieldParams=l},9742:(e,t,n)=>{"use strict";var r=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.setFieldStyle=function(e,t){var n=(0,s.mostSpecificClassURI)(t),r=a.fieldParams[n]||{},c=o.store.any(t,i.ui("style"));c?"Literal"===c.termType?c&&e.setAttribute("style",c.value):o.store.statementsMatching(c,null,null,t.doc()).forEach((function(t){if(t.predicate.uri&&t.predicate.uri.startsWith(u)){var n=t.predicate.uri.slice(u.length);try{e.style[n]=t.object.value}catch(r){console.warn("setFieldStyle: Error setting element style ".concat(n,' to "').concat(t.object.value,'"')),console.warn('setFieldStyle: ... Element tagName was "'.concat(e.tagName||"???",'"'))}}})):r.style&&e.setAttribute("style",r.style)};var i=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,n&&n.set(e,i),i}(n(6590)),o=n(166),a=n(4246),s=n(4816);function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}var u="https://www.w3.org/ns/css#"},2457:(e,t,n)=>{"use strict";var r=n(8698);Object.defineProperty(t,"__esModule",{value:!0});var i={publicData:!0};t.publicData=void 0;var o=n(6472);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))}));var a=n(3983);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===a[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}}))}));var s=n(6186);Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===s[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}}))}));var c=n(1552);Object.keys(c).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===c[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return c[e]}}))}));var u=n(9449);Object.keys(u).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===u[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return u[e]}}))}));var l=n(6206);Object.keys(l).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===l[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return l[e]}}))}));var d=n(611);Object.keys(d).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===d[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return d[e]}}))}));var p=n(6674);Object.keys(p).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===p[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return p[e]}}))}));var f=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=h(t);if(n&&n.has(e))return n.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(i,a,s):i[a]=e[a]}return i.default=e,n&&n.set(e,i),i}(n(5454));function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(h=function(e){return e?n:t})(e)}t.publicData=f},1989:(e,t,n)=>{"use strict";var r=n(4836),i=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.IconicMultiSelect=void 0;var o=r(n(861)),a=r(n(6690)),s=r(n(9728)),c=r(n(8416)),u=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}(n(4946));function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}var d=function(){function e(t){var n=t.data,r=t.itemTemplate,i=t.noData,o=t.noResults,s=t.placeholder,u=t.select,l=t.container,d=t.tagTemplate,p=t.textField,f=t.valueField;(0,a.default)(this,e),(0,c.default)(this,"_data",void 0),(0,c.default)(this,"_domElements",void 0),(0,c.default)(this,"_event",(function(){})),(0,c.default)(this,"_itemTemplate",void 0),(0,c.default)(this,"_multiselect",void 0),(0,c.default)(this,"_noData",void 0),(0,c.default)(this,"_noResults",void 0),(0,c.default)(this,"_options",[]),(0,c.default)(this,"_placeholder",void 0),(0,c.default)(this,"_select",void 0),(0,c.default)(this,"_selectContainer",void 0),(0,c.default)(this,"_selectedOptions",[]),(0,c.default)(this,"_tagTemplate",void 0),(0,c.default)(this,"_textField",void 0),(0,c.default)(this,"_valueField",void 0),(0,c.default)(this,"_cross",'\n <svg\n width="24"\n height="24"\n viewBox="0 0 24 24"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n d="M6.2253 4.81108C5.83477 4.42056 5.20161 4.42056 4.81108 4.81108C4.42056 5.20161 4.42056 5.83477 4.81108 6.2253L10.5858 12L4.81114 17.7747C4.42062 18.1652 4.42062 18.7984 4.81114 19.1889C5.20167 19.5794 5.83483 19.5794 6.22535 19.1889L12 13.4142L17.7747 19.1889C18.1652 19.5794 18.7984 19.5794 19.1889 19.1889C19.5794 18.7984 19.5794 18.1652 19.1889 17.7747L13.4142 12L19.189 6.2253C19.5795 5.83477 19.5795 5.20161 19.189 4.81108C18.7985 4.42056 18.1653 4.42056 17.7748 4.81108L12 10.5858L6.2253 4.81108Z"\n fill="currentColor"\n />\n </svg>\n '),this._data=null!=n?n:[],this._itemTemplate=null!=r?r:null,this._noData=null!=i?i:"No data found.",this._noResults=null!=o?o:"No results found.",this._placeholder=null!=s?s:"Select...",this._select=u,this._selectContainer=l,this._tagTemplate=null!=d?d:null,this._textField=null!=p?p:null,this._valueField=null!=f?f:null}return(0,s.default)(e,[{key:"init",value:function(){if(!this._select||"SELECT"!==this._select.nodeName)throw new Error("The selector '".concat(this._select,"' did not select any valid select tag."));if(this._itemTemplate&&0===this._data.length)throw new Error("itemTemplate must be initialized with data from the component settings");if(this._tagTemplate&&0===this._data.length)throw new Error("tagTemplate must be initialized with data from the component settings");this._options=this._data.length>0?this._getDataFromSettings():this._getDataFromSelectTag(),this._renderMultiselect(),this._renderOptionsList(),this._domElements={clear:this._multiselect.querySelector(".multiselect__clear-btn"),input:this._multiselect.querySelector(".multiselect__input"),optionsContainer:this._multiselect.querySelector(".multiselect__options"),optionsContainerList:this._multiselect.querySelector(".multiselect__options > ul"),options:{list:this._multiselect.querySelectorAll(".multiselect__options > ul > li"),find:function(e){for(var t=0;t<this.list.length;t++){var n=this.list[t];if(e(n))return n}},some:function(e){for(var t=0;t<this.list.length;t++)if(e(this.list[t],t))return!0;return!1}}},this._enableEventListenners(),this._initSelectedList()}},{key:"subscribe",value:function(e){if("function"!=typeof e)throw new Error("parameter in the subscribe method is not a function");this._event=e}},{key:"_addOptionToList",value:function(e,t){var n=this,r='<span class="multiselect__selected" style="'.concat(u.multiselect__selected,'" data-value="').concat(e.value,'">').concat(this._tagTemplate?this._processTemplate(this._tagTemplate,t):e.text,'<span class="multiselect__remove-btn" style="').concat(u.multiselect__remove_btn,'">').concat(this._cross,"</span></span>");this._domElements.input.insertAdjacentHTML("beforebegin",r),this._multiselect.querySelector('span[data-value="'.concat(e.value,'"]')).lastElementChild.addEventListener("click",(function(){var t=n._domElements.options.find((function(t){return t.dataset.value===e.value}));n._handleOption(t)}))}},{key:"_clearSelection",value:function(){for(var e=this,t=function(){var t=e._selectedOptions[n],r=e._domElements.options.find((function(e){return e.dataset.value===t.value}));r.classList.remove("multiselect__options--selected"),r.setAttribute("style",u.multiselect__options),e._removeOptionFromList(r.dataset.value)},n=0;n<this._selectedOptions.length;n++)t();this._selectedOptions=[],this._handleClearSelectionBtn(),this._handlePlaceholder(),this._dispatchEvent({action:"CLEAR_ALL_OPTIONS",selection:this._selectedOptions})}},{key:"_closeList",value:function(){this._domElements.input.value="",this._domElements.optionsContainer.classList.remove("visible"),this._domElements.optionsContainer.setAttribute("style",u.multiselect__options),this._filterOptions(""),this._removeAllArrowSelected()}},{key:"_dispatchEvent",value:function(e){this._event(e)}},{key:"_enableEventListenners",value:function(){var e=this;document.addEventListener("mouseup",(function(t){var n=t.target;e._multiselect.contains(n)||(e._filterOptions(""),e._closeList(),e._handlePlaceholder())})),this._domElements.clear.addEventListener("click",(function(){e._clearSelection()}));for(var t=0;t<this._domElements.options.list.length;t++)this._domElements.options.list[t].addEventListener("click",(function(t){var n=t.target;e._handleOption(n),e._closeList()}));this._domElements.input.addEventListener("focus",(function(){e._domElements.optionsContainer.classList.add("visible"),e._domElements.optionsContainer.setAttribute("style",u.multiselect__options_visible)})),this._domElements.input.addEventListener("input",(function(t){var n=t.target.value;e._domElements.options.list.length>0&&e._filterOptions(n)})),this._domElements.input.addEventListener("keydown",(function(t){e._handleArrows(t),e._handleBackspace(t),e._handleEnter(t)}))}},{key:"_filterOptions",value:function(e){var t=this,n=this._domElements.optionsContainer.classList.contains("visible"),r=e.toLowerCase();if(!n&&e.length>0&&(this._domElements.optionsContainer.classList.add("visible"),this._domElements.optionsContainer.setAttribute("style",u.multiselect__options_visible)),this._domElements.options.list.length>0){for(var i=0;i<this._domElements.options.list.length;i++){var o=this._domElements.options.list[i];(this._itemTemplate?this._data[i][this._textField]:o.textContent).toLowerCase().substring(0,r.length)===r?this._domElements.optionsContainerList.appendChild(o):o.parentNode&&o.parentNode.removeChild(o)}var a=this._domElements.options.some((function(e,n){return(t._itemTemplate?t._data[n][t._textField]:e.textContent).toLowerCase().substring(0,r.length)===r}));this._showNoResults(!a)}}},{key:"_generateId",value:function(e){for(var t="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=n.length,i=0;i<e;i++)t+=n.charAt(Math.floor(Math.random()*r));return t}},{key:"_getDataFromSelectTag",value:function(){for(var e=[],t=this._select.options,n=0;n<t.length;n++){var r=t[n];e.push({text:r.text,value:r.value,selected:r.hasAttribute("selected")})}return e}},{key:"_getDataFromSettings",value:function(){if(this._data.length>0&&this._valueField&&this._textField){var e="string"==typeof this._valueField,t="string"==typeof this._textField,n=[];if(!e||!t)throw new Error("textField and valueField must be of type string");for(var r=0;r<this._data.length;r++){var i=this._data[r];n.push({value:i[this._valueField],text:i[this._textField],selected:"boolean"==typeof i.selected&&i.selected})}return n}return null}},{key:"_handleArrows",value:function(e){if(40===e.keyCode||38===e.keyCode){e.preventDefault();var t=this._domElements.optionsContainer.classList.contains("visible"),n=this._multiselect.querySelector(".multiselect__options > ul");if(t){var r=this._multiselect.querySelector(".multiselect__options ul li.arrow-selected"),i={ArrowUp:"previous",Up:"previous",ArrowDown:"next",Down:"next"};if(!r)return n.firstElementChild.classList.add("arrow-selected"),n.firstElementChild.setAttribute("style",u.multiselect__options_ul_li_arrow_selected),void n.firstElementChild.scrollIntoView(!1);if(r.classList.remove("arrow-selected"),r.setAttribute("style",u.multiselect__options_ul_li),!(r=r[i[e.key]+"ElementSibling"]))return(r=n.children["next"===i[e.key]?0:n.children.length-1]).classList.add("arrow-selected"),r.setAttribute("style",u.multiselect__options_ul_li_arrow_selected),void this._scrollIntoView(n,r);r.classList.add("arrow-selected"),r.setAttribute("style",u.multiselect__options_ul_li_arrow_selected),this._scrollIntoView(n,r)}else this._domElements.optionsContainer.classList.add("visible"),this._domElements.optionsContainer.setAttribute("style",u.multiselect__options_visible),n.firstElementChild.classList.add("arrow-selected"),n.firstElementChild.setAttribute("style",u.multiselect__options_ul_li_arrow_selected),n.firstElementChild.scrollIntoView(!1)}}},{key:"_handleBackspace",value:function(e){if(8===e.keyCode&&""===e.target.value){var t=this._selectedOptions.length>0?this._selectedOptions[this._selectedOptions.length-1]:null;if(t){var n=this._multiselect.querySelector('li[data-value="'.concat(t.value,'"]'));this._handleOption(n),0===this._selectedOptions.length&&(this._domElements.optionsContainer.classList.remove("visible"),this._domElements.optionsContainer.setAttribute("style",u.multiselect__options))}}}},{key:"_handleClearSelectionBtn",value:function(){this._selectedOptions.length>0?this._domElements.clear.style.display="flex":this._domElements.clear.style.display="none"}},{key:"_handleEnter",value:function(e){if(13===e.keyCode){var t=this._multiselect.querySelector(".multiselect__options ul li.arrow-selected");t&&(this._handleOption(t),this._closeList())}}},{key:"_handleOption",value:function(e){for(var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=0;n<this._selectedOptions.length;n++){var r=this._selectedOptions[n];if(r.value===e.dataset.value)return e.classList.remove("multiselect__options--selected"),e.setAttribute("style",u.multiselect__options),this._selectedOptions.splice(n,1),this._removeOptionFromList(e.dataset.value),this._handleClearSelectionBtn(),this._handlePlaceholder(),t&&this._dispatchEvent({action:"REMOVE_OPTION",value:e.dataset.value,selection:this._selectedOptions})}for(var i=0;i<this._options.length;i++){var a=this._options[i];if(a.value===e.dataset.value)return e.classList.add("multiselect__options--selected"),e.setAttribute("style",u.multiselect__options_selected),this._selectedOptions=[].concat((0,o.default)(this._selectedOptions),[a]),this._addOptionToList(a,i),this._handleClearSelectionBtn(),this._handlePlaceholder(),t&&this._dispatchEvent({action:"ADD_OPTION",value:e.dataset.value,selection:this._selectedOptions})}}},{key:"_handlePlaceholder",value:function(){this._domElements.input.placeholder=this._placeholder}},{key:"_initSelectedList",value:function(){for(var e=this,t=!1,n=function(){var n=e._options[r];if(n.selected){t=!0;var i=e._domElements.options.find((function(e){return e.dataset.value===n.value}));i.classList.add("multiselect__options--selected"),i.setAttribute("style",u.multiselect__options_selected),e._selectedOptions=[].concat((0,o.default)(e._selectedOptions),[n]),e._addOptionToList(n,r)}},r=0;r<this._options.length;r++)n();t&&this._handleClearSelectionBtn(),this._handlePlaceholder()}},{key:"_processTemplate",value:function(e,t){for(var n=e,r=e.match(/\$\{(\w+)\}/g).map((function(e){return e.replace(/\$\{|\}/g,"")})),i=0;i<r.length;i++){var o,a=r[i];n=n.replace("${".concat(a,"}"),null!==(o=this._data[t][a])&&void 0!==o?o:"")}return n}},{key:"_removeAllArrowSelected",value:function(){var e="arrow-selected",t=this._domElements.options.find((function(t){return t.classList.contains(e)}));t&&t.classList.remove(e)&&t.setAttribute("style",u.multiselect__options_ul_li)}},{key:"_removeOptionFromList",value:function(e){var t=this._multiselect.querySelector('span[data-value="'.concat(e,'"]'));t&&t.parentNode&&t.parentNode.removeChild(t)}},{key:"_renderOptionsList",value:function(){var e=this,t='\n <div class="multiselect__options" style="'.concat(u.multiselect__options,'">\n <ul style="').concat(u.multiselect__options_ul,'">\n ').concat(this._options.length>0&&!this._itemTemplate?this._options.map((function(e){return'\n <li data-value="'.concat(e.value,'" style="').concat(u.multiselect__options_ul_li,'">').concat(e.text,"</li>\n ")})).join(""):"","\n\n ").concat(this._options.length>0&&this._itemTemplate?this._options.map((function(t,n){return'\n <li data-value="'.concat(t.value,'" style="').concat(u.multiselect__options_ul_li,'">').concat(e._processTemplate(e._itemTemplate,n),"</li>\n ")})).join(""):"","\n ").concat(this._showNoData(0===this._options.length),"\n </ul>\n </div>\n ");this._multiselect.insertAdjacentHTML("beforeend",t)}},{key:"_renderMultiselect",value:function(){this._select.style.display="none";var e="iconic-"+this._generateId(20);this._multiselect=document.createElement("div"),this._multiselect.setAttribute("id",e),this._multiselect.setAttribute("class","multiselect__container"),this._multiselect.setAttribute("style",u.multiselect__container);var t='\n <div class="multiselect__wrapper" style="'.concat(u.multiselect__wrapper,'">\n <input class="multiselect__input" style="').concat(u.multiselect__input,'" placeholder="').concat(this._placeholder,'" />\n </div>\n <span style="display: none;" class="multiselect__clear-btn" style="').concat(u.multiselect__clear_btn,'">').concat(this._cross,"</span>\n ");this._multiselect.innerHTML=t,this._selectContainer.appendChild(this._multiselect)}},{key:"_scrollIntoView",value:function(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect();n.top<r.bottom-t.offsetHeight||(e.scrollTop=t.clientHeight+(t.offsetTop-t.offsetHeight)),n.bottom>r.top+t.offsetHeight||(e.scrollTop=t.clientHeight+(t.offsetTop-t.offsetHeight)-(e.offsetHeight-(t.offsetHeight+(t.offsetHeight-t.clientHeight))))}},{key:"_showNoData",value:function(e){return e?'<p class="multiselect__options--no-data" style="'.concat(u.multiselect__options_ul_p_multiselect__options_no_data,'">').concat(this._noData,"</p>"):""}},{key:"_showNoResults",value:function(e){var t=this._multiselect.querySelector(".multiselect__options--no-results");if(e){var n='<p class="multiselect__options--no-results" style="'.concat(u.multiselect__options_ul_p_multiselect__options_no_results,'">').concat(this._noResults,"</p>");!t&&this._domElements.optionsContainerList.insertAdjacentHTML("beforeend",n)}else t&&t.parentNode&&t.parentNode.removeChild(t)}}]),e}();t.IconicMultiSelect=d},6472:(e,t,n)=>{"use strict";var r=n(4836),i=n(8698);Object.defineProperty(t,"__esModule",{value:!0}),t.Person=t.PeoplePicker=t.GroupPicker=t.GroupBuilder=t.Group=void 0;var o,a=r(n(9400)),s=r(n(6690)),c=r(n(9728)),u=r(n(5573)),l=r(n(1614)),d=y(n(6022)),p=y(n(4433)),f=n(3983),h=n(9449),m=n(1124),g=y(n(6590));function v(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(v=function(e){return e?n:t})(e)}function y(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var n=v(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}var b=n(166).solidLogicSingleton.store,w=function(){function e(t,n,r,i){(0,s.default)(this,e),this.options=i||{},this.element=t,this.typeIndex=n,this.groupPickedCb=r,this.selectedgroup=this.options.selectedgroup,this.onSelectGroup=this.onSelectGroup.bind(this)}return(0,c.default)(e,[{key:"render",value:function(){var e=this,t=document.createElement("div");if(t.style.maxWidth="350px",t.style.minHeight="200px",t.style.outline="1px solid black",t.style.display="flex",this.selectedgroup){t.style.flexDirection="column";var n=document.createElement("div");new _(n,this.selectedgroup).render();var r=document.createElement("button");r.textContent=(0,u.default)("Change group"),r.addEventListener("click",(function(t){e.selectedgroup=null,e.render()})),t.appendChild(n),t.appendChild(r)}else this.findAddressBook(this.typeIndex).then((function(n){var r=n.book,i=document.createElement("button");i.textContent=(0,u.default)("Pick an existing group"),i.style.margin="auto",i.addEventListener("click",(function(n){new x(t,r,e.onSelectGroup).render()}));var o=document.createElement("button");o.textContent=(0,u.default)("Create a new group"),o.style.margin="auto",o.addEventListener("click",(function(t){e.createNewGroup(r,e.options.defaultNewGroupName).then((function(t){var n=t.group;new E(e.element,r,n,e.onSelectGroup).render()})).catch((function(t){e.element.appendChild((0,h.errorMessageBlock)(document,(0,u.default)("Error creating a new group. (".concat(t,")"))))}))})),t.appendChild(i),t.appendChild(o),e.element.innerHTML="",e.element.appendChild(t)})).catch((function(t){e.element.appendChild((0,h.errorMessageBlock)(document,(0,u.default)("Could find your groups. (".concat(t,")"))))}));return this.element.innerHTML="",this.element.appendChild(t),this}},{key:"findAddressBook",value:function(e){return new Promise((function(t,n){b.fetcher.nowOrWhenFetched(e,(function(r,i){if(!r)return n(i);var o=b.any(null,g.solid("forClass"),g.vcard("AddressBook"));if(!o)return n(new Error("no address book registered in the solid type index "+e));var a=b.any(o,g.solid("instance"));if(!a)return n(new Error("incomplete address book registration"));b.fetcher.load(a).then((function(e){return t({book:a})})).catch((function(e){return n(new Error("Could not load address book "+e))}))}))}))}},{key:"createNewGroup",value:function(e,t){var n=A(e),r=n.groupIndex,i=n.groupContainer,o=d.sym("".concat(i.uri).concat(l.default.v4().slice(0,8),".ttl#this")),a=t||"Untitled Group",s=[o.doc(),r].map((function(t){var n=d.st(o,g.rdf("type"),g.vcard("Group"),t),i=d.st(o,g.vcard("fn"),a,o.doc(),t),s=d.st(e,g.vcard("includesGroup"),o,t),c=t.equals(r)?[n,i,s]:[n,i];return C(t.uri,{toIns:c}).then((function(){c.forEach((function(e){b.add(e)}))}))}));return Promise.all(s).then((function(){return{group:o}})).catch((function(e){throw p.log("Could not create new group. PATCH failed "+e),new Error("Couldn't create new group. PATCH failed for (".concat(e.xhr?e.xhr.responseURL:""," )"))}))}},{key:"onSelectGroup",value:function(e){this.selectedgroup=e,this.groupPickedCb(e),this.render()}}]),e}();t.PeoplePicker=w;var x=function(){function e(t,n,r){(0,s.default)(this,e),this.element=t,this.book=n,this.onSelectGroup=r}return(0,c.default)(e,[{key:"render",value:function(){var e=this;return this.loadGroups().then((function(t){var n=document.createElement("div");n.style.display="flex",n.style.flexDirection="column",t.forEach((function(t){var r=document.createElement("button");r.addEventListener("click",e.handleClickGroup(t)),new _(r,t).render(),n.appendChild(r)})),e.element.innerHTML="",e.element.appendChild(n)})).catch((function(t){e.element.appendChild((0,h.errorMessageBlock)(document,(0,u.default)("There was an error loading your groups. (".concat(t,")"))))})),this}},{key:"loadGroups",value:function(){var e=this;return new Promise((function(t,n){var r=A(e.book).groupIndex;b.fetcher.nowOrWhenFetched(r,(function(r,i){if(!r)return n(i);var o=b.each(e.book,g.vcard("includesGroup"));return t(o)}))}))}},{key:"handleClickGroup",value:function(e){var t=this;return function(n){t.onSelectGroup(e)}}}]),e}();t.GroupPicker=x;var _=function(){function e(t,n){(0,s.default)(this,e),this.element=t,this.group=n}return(0,c.default)(e,[{key:"render",value:function(){var e=document.createElement("div");return e.textContent=(0,u.default)(S(this.group,g.vcard("fn"),"[".concat(this.group.value,"]"))),this.element.innerHTML="",this.element.appendChild(e),this}}]),e}();t.Group=_;var E=function(){function e(t,n,r,i,o){(0,s.default)(this,e),this.element=t,this.book=n,this.group=r,this.onGroupChanged=function(e,t,n){o&&o(e,t,n)},this.groupChangedCb=o,this.doneBuildingCb=i}return(0,c.default)(e,[{key:"refresh",value:function(){}},{key:"render",value:function(){var e=this,t=document.createElement("div");t.style.maxWidth="350px",t.style.minHeight="200px",t.style.outline="1px solid black",t.style.display="flex",t.style.flexDirection="column",(0,f.makeDropTarget)(t,(function(t){t.forEach((function(t){e.add(t).catch((function(t){e.element.appendChild((0,h.errorMessageBlock)(document,(0,u.default)("Could not add the given WebId. (".concat(t,")"))))}))}))}));var n=document.createElement("input");n.type="text",n.value=S(this.group,g.vcard("fn"),"Untitled Group"),n.addEventListener("change",(function(t){e.setGroupName(t.target.value).catch((function(t){e.element.appendChild((0,h.errorMessageBlock)(document,"Error changing group name. (".concat(t,")")))}))}));var r=document.createElement("label");if(r.textContent=(0,u.default)("Group Name:"),r.appendChild(n),t.appendChild(r),b.any(this.group,g.vcard("hasMember")))b.match(this.group,g.vcard("hasMember")).forEach((function(n){var r=n.object,i=document.createElement("div");new k(i,r,e.handleRemove(r)).render(),t.appendChild(i)}));else{var i=document.createElement("p");i.textContent=(0,u.default)(o||(o=(0,a.default)(["\n To add someone to this group, drag and drop their WebID URL onto the box.\n "]))),t.appendChild(i)}var s=document.createElement("button");return s.textContent=(0,u.default)("Done"),s.addEventListener("click",(function(t){e.doneBuildingCb(e.group)})),t.appendChild(s),this.element.innerHTML="",this.element.appendChild(t),this}},{key:"add",value:function(e){var t=this;return new Promise((function(n,r){b.fetcher.nowOrWhenFetched(e,(function(i,o){if(!i)return t.onGroupChanged(o),r(o);var a=d.namedNode(e),s=b.any(a,g.rdf("type"));return s&&s.equals(g.foaf("Person"))?n(a):r(new Error("Only people supported right now. (tried to add something of type ".concat(s.value,")")))}))})).then((function(e){var n=d.st(t.group,g.vcard("hasMember"),e);return b.holdsStatement(n)?e:C(t.group.doc().uri,{toIns:[n]}).then((function(){n.why=t.group.doc(),b.add(n),t.onGroupChanged(null,"added",e),t.render()}))}))}},{key:"handleRemove",value:function(e){var t=this;return function(n){var r=d.st(t.group,g.vcard("hasMember"),e);return C(t.group.doc().uri,{toDel:[r]}).then((function(){return b.remove(r),t.onGroupChanged(null,"removed",e),t.render(),!0})).catch((function(t){var n=b.any(e,g.foaf("name")),r=n&&n.value?"Could not remove ".concat(n.value,". (").concat(t,")"):"Could not remove ".concat(e.value,". (").concat(t,")");throw new Error(r)}))}}},{key:"setGroupName",value:function(e){var t=this,n=A(this.book).groupIndex,r=[this.group.doc(),n].map((function(n){var r=b.match(t.group,g.vcard("fn"),null,n),i=d.st(t.group,g.vcard("fn"),d.literal(e));return C(n.value,{toDel:r,toIns:[i]}).then((function(e){b.removeStatements(r),i.why=n,b.add(i)}))}));return Promise.all(r)}}]),e}();t.GroupBuilder=E;var k=function(){function e(t,n,r){(0,s.default)(this,e),this.webIdNode=n,this.element=t,this.handleRemove=r}return(0,c.default)(e,[{key:"render",value:function(){var e=this,t=document.createElement("div");t.style.display="flex";var n=S(this.webIdNode,g.foaf("img"),m.iconBase+"noun_15059.svg"),r=document.createElement("img");r.src=(0,u.default)(n),r.width="50",r.height="50",r.style.margin="5px";var i=S(this.webIdNode,g.foaf("name"),"[".concat(this.webIdNode,"]")),o=document.createElement("span");o.innerHTML=(0,u.default)(i),o.style.flexGrow="1",o.style.margin="auto 0";var a=document.createElement("button");return a.textContent="Remove",a.addEventListener("click",(function(t){return e.handleRemove().catch((function(t){e.element.appendChild((0,h.errorMessageBlock)(document,(0,u.default)("".concat(t))))}))})),a.style.margin="5px",t.appendChild(r),t.appendChild(o),t.appendChild(a),this.element.innerHTML="",this.element.appendChild(t),this}}]),e}();function S(e,t,n){var r=b.any(e,t);return r?r.value:n}function C(e,t){var n=t.toDel,r=t.toIns;return new Promise((function(e,t){b.updater.update(n,r,(function(n,r,i){if(!r)return t(new Error("PATCH failed for resource <".concat(n,">: ").concat(i)));e()}))}))}function A(e){return{groupIndex:b.any(e,g.vcard("groupIndex")),groupContainer:b.sym(e.dir().uri+"Group/")}}t.Person=k},398:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wrapDivInATR=t.createImageDiv=t.addClickListenerToElement=void 0;var r=n(2853);t.wrapDivInATR=function(e,t,n){var r=e.createElement("tr");return r.appendChild(e.createElement("td")).appendChild(t),r.subject=n,r},t.addClickListenerToElement=function(e,t){e.addEventListener("click",t)},t.createImageDiv=function(e,t,n){var i=t.appendChild(e.createElement("div"));i.setAttribute("style",r.imageDivStyle),i.appendChild(n),n.setAttribute("draggable","false")}},6913:function(e,t,n){var r,i;void 0===(i="function"==typeof(r=function(){"use strict";function e(t,n,r,i){this.message=t,this.expected=n,this.found=r,this.location=i,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,e)}return function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}(e,Error),e.buildMessage=function(e,t){var n={literal:function(e){return'"'+i(e.text)+'"'},class:function(e){var t,n="";for(t=0;t<e.parts.length;t++)n+=e.parts[t]instanceof Array?o(e.parts[t][0])+"-"+o(e.parts[t][1]):o(e.parts[t]);return"["+(e.inverted?"^":"")+n+"]"},any:function(e){return"any character"},end:function(e){return"end of input"},other:function(e){return e.description}};function r(e){return e.charCodeAt(0).toString(16).toUpperCase()}function i(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+r(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+r(e)}))}function o(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+r(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+r(e)}))}return"Expected "+function(e){var t,r,i,o=new Array(e.length);for(t=0;t<e.length;t++)o[t]=(i=e[t],n[i.type](i));if(o.sort(),o.length>0){for(t=1,r=1;t<o.length;t++)o[t-1]!==o[t]&&(o[r]=o[t],r++);o.length=r}switch(o.length){case 1:return o[0];case 2:return o[0]+" or "+o[1];default:return o.slice(0,-1).join(", ")+", or "+o[o.length-1]}}(e)+" but "+function(e){return e?'"'+i(e)+'"':"end of input"}(t)+" found."},{SyntaxError:e,parse:function(t,r){r=void 0!==r?r:{};var i,o={},a={turtleDoc:Lt},s=Lt,c=".",u=It(".",!1),l=It("#",!1),d=/^[^\n]/,p=jt(["\n"],!0,!1),f=It("\n",!1),h=function(e){return e.join("")},m="@prefix",g=It("@prefix",!1),v=function(e,t){return un.addPrefix(""===e?"0":e,t),{}},y="@base",b=It("@base",!1),w=function(e){return un.addBase(e),{}},x=/^[Bb]/,_=jt(["B","b"],!1,!1),E=/^[Aa]/,k=jt(["A","a"],!1,!1),S=/^[Ss]/,C=jt(["S","s"],!1,!1),A=/^[Ee]/,T=jt(["E","e"],!1,!1),O=/^[Pp]/,P=jt(["P","p"],!1,!1),I=/^[Rr]/,j=jt(["R","r"],!1,!1),N=/^[Ff]/,F=jt(["F","f"],!1,!1),R=/^[Ii]/,L=jt(["I","i"],!1,!1),D=/^[Xx]/,M=jt(["X","x"],!1,!1),U=It(";",!1),B=function(e,t,n,r){var i={};return i[n]=r,i},H=function(e,t,n){return n},q=It(",",!1),W=function(e,t){return t},K=It("a",!1),V=It("[",!1),J=It("]",!1),z=It("(",!1),Z=It(")",!1),$="^^",G=It("^^",!1),X="true",Q=It("true",!1),Y="false",ee=It("false",!1),te=It("<",!1),ne=/^[^\0- <>"{}|\^`\\]/,re=jt([["\0"," "],"<",">",'"',"{","}","|","^","`","\\"],!0,!1),ie=It(">",!1),oe=":",ae=It(":",!1),se="_:",ce=It("_:",!1),ue=/^[0-9]/,le=jt([["0","9"]],!1,!1),de=It("@",!1),pe=/^[a-zA-Z]/,fe=jt([["a","z"],["A","Z"]],!1,!1),he="-",me=It("-",!1),ge=/^[a-zA-Z0-9]/,ve=jt([["a","z"],["A","Z"],["0","9"]],!1,!1),ye=function(e,t){return"-"+t.join("")},be=/^[+\-]/,we=jt(["+","-"],!1,!1),xe=/^[eE]/,_e=jt(["e","E"],!1,!1),Ee='"',ke=It('"',!1),Se=/^[^"\\\n\r]/,Ce=jt(['"',"\\","\n","\r"],!0,!1),Ae="'",Te=It("'",!1),Oe=/^[^'\\\n\r]/,Pe=jt(["'","\\","\n","\r"],!0,!1),Ie="'''",je=It("'''",!1),Ne=/^[^'\\]/,Fe=jt(["'","\\"],!0,!1),Re="''",Le=It("''",!1),De=function(e,t){return"''"+t.join("")},Me=function(e,t){return"'"+t.join("")},Ue=function(e,t){return e.join("")+t.join("")},Be='"""',He=It('"""',!1),qe=/^[^"\\]/,We=jt(['"',"\\"],!0,!1),Ke='""',Ve=It('""',!1),Je=function(e,t){return'""'+t.join("")},ze=function(e,t){return'"'+t.join("")},Ze=It("\\U",!1),$e=It("\\u",!1),Ge=It("\\t",!1),Xe=It("\\b",!1),Qe=It("\\n",!1),Ye=It("\\r",!1),et=It("\\f",!1),tt=It('\\"',!1),nt=It("\\'",!1),rt=It("\\\\",!1),it=/^[ \t\r\n]/,ot=jt([" ","\t","\r","\n"],!1,!1),at=/^[\uD800-\uDBFF]/,st=jt([["\ud800","\udbff"]],!1,!1),ct=/^[\uDC00-\uDFFF]/,ut=jt([["\udc00","\udfff"]],!1,!1),lt=/^[A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,dt=jt([["A","Z"],["a","z"],["À","Ö"],["Ø","ö"],["ø","˿"],["Ͱ","ͽ"],["Ϳ","῿"],["‌","‍"],["⁰","↏"],["Ⰰ","⿯"],["、","퟿"],["豈","﷏"],["ﷰ","�"]],!1,!1),pt=It("_",!1),ft=It("·",!1),ht=/^[\u0300-\u036F]/,mt=jt([["̀","ͯ"]],!1,!1),gt=/^[\u203F-\u2040]/,vt=jt([["‿","⁀"]],!1,!1),yt=function(e,t,n,r){return n.join("")+r.join("")},bt=It("%",!1),wt=/^[0-9A-Fa-f]/,xt=jt([["0","9"],["A","F"],["a","f"]],!1,!1),_t=It("\\",!1),Et=/^[_~.!$&'()*+,;=\/?#@%\-]/,kt=jt(["_","~",".","!","$","&","'","(",")","*","+",",",";","=","/","?","#","@","%","-"],!1,!1),St=0,Ct=0,At=[{line:1,column:1}],Tt=0,Ot=[];if("startRule"in r){if(!(r.startRule in a))throw new Error("Can't start parsing from rule \""+r.startRule+'".');s=a[r.startRule]}function Pt(t,n){throw function(t,n){return new e(t,null,null,n)}(t,n=void 0!==n?n:Ft(Ct,St))}function It(e,t){return{type:"literal",text:e,ignoreCase:t}}function jt(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function Nt(e){var n,r=At[e];if(r)return r;for(n=e-1;!At[n];)n--;for(r={line:(r=At[n]).line,column:r.column};n<e;)10===t.charCodeAt(n)?(r.line++,r.column=1):r.column++,n++;return At[e]=r,r}function Ft(e,t){var n=Nt(e),r=Nt(t);return{start:{offset:e,line:n.line,column:n.column},end:{offset:t,line:r.line,column:r.column}}}function Rt(e){St<Tt||(St>Tt&&(Tt=St,Ot=[]),Ot.push(e))}function Lt(){var e,t,n,r,i,a;for(e=St,t=[],n=Dt();n!==o;)t.push(n),n=Dt();if(t!==o){for(n=[],r=Mt();r!==o;)n.push(r),r=Mt();n!==o?(Ct=e,i=t,(a=un.toJSON())["@graph"]=[],i.filter((e=>Array.isArray(e))).forEach((e=>{e.forEach((e=>{a["@graph"].push(e)}))})),1===a["@graph"].length&&(Object.assign(a,a["@graph"][0]),delete a["@graph"]),e=t=a):(St=e,e=o)}else St=e,e=o;return e}function Dt(){var e,n,r,i;if((e=function(){var e;return(e=function(){var e,n,r,i,a,s,l,d,p;for(e=St,n=[],r=Mt();r!==o;)n.push(r),r=Mt();if(n!==o)if(t.substr(St,7)===m?(r=m,St+=7):(r=o,Rt(g)),r!==o){for(i=[],a=Mt();a!==o;)i.push(a),a=Mt();if(i!==o)if((a=Gt())!==o){for(s=[],l=Mt();l!==o;)s.push(l),l=Mt();if(s!==o)if((l=Zt())!==o){for(d=[],p=Mt();p!==o;)d.push(p),p=Mt();d!==o?(46===t.charCodeAt(St)?(p=c,St++):(p=o,Rt(u)),p!==o?(Ct=e,e=n=v(a,l)):(St=e,e=o)):(St=e,e=o)}else St=e,e=o;else St=e,e=o}else St=e,e=o;else St=e,e=o}else St=e,e=o;else St=e,e=o;return e}())===o&&(e=function(){var e,n,r,i,a,s,l;for(e=St,n=[],r=Mt();r!==o;)n.push(r),r=Mt();if(n!==o)if(t.substr(St,5)===y?(r=y,St+=5):(r=o,Rt(b)),r!==o){for(i=[],a=Mt();a!==o;)i.push(a),a=Mt();if(i!==o)if((a=Zt())!==o){for(s=[],l=Mt();l!==o;)s.push(l),l=Mt();s!==o?(46===t.charCodeAt(St)?(l=c,St++):(l=o,Rt(u)),l!==o?(Ct=e,e=n=w(a)):(St=e,e=o)):(St=e,e=o)}else St=e,e=o;else St=e,e=o}else St=e,e=o;else St=e,e=o;return e}())===o&&(e=function(){var e,n,r,i,a,s,c,u,l,d,p,f;for(e=St,n=[],r=Mt();r!==o;)n.push(r),r=Mt();if(n!==o)if(O.test(t.charAt(St))?(r=t.charAt(St),St++):(r=o,Rt(P)),r!==o)if(I.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(j)),i!==o)if(A.test(t.charAt(St))?(a=t.charAt(St),St++):(a=o,Rt(T)),a!==o)if(N.test(t.charAt(St))?(s=t.charAt(St),St++):(s=o,Rt(F)),s!==o)if(R.test(t.charAt(St))?(c=t.charAt(St),St++):(c=o,Rt(L)),c!==o)if(D.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(M)),u!==o){for(l=[],d=Mt();d!==o;)l.push(d),d=Mt();if(l!==o)if((d=Gt())!==o){for(p=[],f=Mt();f!==o;)p.push(f),f=Mt();p!==o&&(f=Zt())!==o?(Ct=e,e=n=v(d,f)):(St=e,e=o)}else St=e,e=o;else St=e,e=o}else St=e,e=o;else St=e,e=o;else St=e,e=o;else St=e,e=o;else St=e,e=o;else St=e,e=o;else St=e,e=o;return e}())===o&&(e=function(){var e,n,r,i,a,s,c,u;for(e=St,n=[],r=Mt();r!==o;)n.push(r),r=Mt();if(n!==o)if(x.test(t.charAt(St))?(r=t.charAt(St),St++):(r=o,Rt(_)),r!==o)if(E.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(k)),i!==o)if(S.test(t.charAt(St))?(a=t.charAt(St),St++):(a=o,Rt(C)),a!==o)if(A.test(t.charAt(St))?(s=t.charAt(St),St++):(s=o,Rt(T)),s!==o){for(c=[],u=Mt();u!==o;)c.push(u),u=Mt();c!==o&&(u=Zt())!==o?(Ct=e,e=n=w(u)):(St=e,e=o)}else St=e,e=o;else St=e,e=o;else St=e,e=o;else St=e,e=o;else St=e,e=o;return e}()),e}())===o)if(e=St,(n=function(){var e,t,n;return e=St,(t=function(){var e,t;return e=St,(t=Kt())!==o&&(Ct=e,n=t,t=ln(n,!0)),(e=t)===o&&(e=zt())===o&&(e=Jt()),e;var n}())!==o&&(n=Ut())!==o?(Ct=e,r=t,i=n,a={},"string"==typeof r&&"[]"!==r?a["@id"]=r:"object"==typeof r&&Object.assign(a,r),i&&Object.assign(a,i),e=t=[a]):(St=e,e=o),e===o&&(e=St,(t=Wt())!==o?((n=Ut())===o&&(n=null),n!==o?(Ct=e,e=t=function(e,t){var n={};return e&&Object.assign(n,e),t&&Object.assign(n,t),[n]}(t,n)):(St=e,e=o)):(St=e,e=o)),e;var r,i,a}())!==o){for(r=[],i=Mt();i!==o;)r.push(i),i=Mt();r!==o?(46===t.charCodeAt(St)?(i=c,St++):(i=o,Rt(u)),i!==o?(Ct=e,e=n):(St=e,e=o)):(St=e,e=o)}else St=e,e=o;return e}function Mt(){var e;return(e=function(){var e;return it.test(t.charAt(St))?(e=t.charAt(St),St++):(e=o,Rt(ot)),e}())===o&&(e=function(){var e,n,r,i;if(e=St,35===t.charCodeAt(St)?(n="#",St++):(n=o,Rt(l)),n!==o){for(r=[],d.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(p));i!==o;)r.push(i),d.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(p));r!==o?(10===t.charCodeAt(St)?(i="\n",St++):(i=o,Rt(f)),i!==o?(Ct=e,e=n=h(r)):(St=e,e=o)):(St=e,e=o)}else St=e,e=o;return e}()),e}function Ut(){var e,n,r,i,a,s,c,u,l,d,p,f,h,m;if(e=St,(n=Ht())!==o)if((r=Bt())!==o){for(i=[],a=St,s=[],c=Mt();c!==o;)s.push(c),c=Mt();for(s!==o?(59===t.charCodeAt(St)?(c=";",St++):(c=o,Rt(U)),c!==o?(u=St,(l=Ht())!==o&&(d=Bt())!==o?(Ct=u,u=l=B(0,0,l,d)):(St=u,u=o),u===o&&(u=null),u!==o?(Ct=a,a=s=H(0,0,u)):(St=a,a=o)):(St=a,a=o)):(St=a,a=o);a!==o;){for(i.push(a),a=St,s=[],c=Mt();c!==o;)s.push(c),c=Mt();s!==o?(59===t.charCodeAt(St)?(c=";",St++):(c=o,Rt(U)),c!==o?(u=St,(l=Ht())!==o&&(d=Bt())!==o?(Ct=u,u=l=B(0,0,l,d)):(St=u,u=o),u===o&&(u=null),u!==o?(Ct=a,a=s=H(0,0,u)):(St=a,a=o)):(St=a,a=o)):(St=a,a=o)}i!==o?(Ct=e,p=n,f=r,m={},(h=i).unshift(function(e,t){var n={};return n[e]=t,n}(p,f)),h.forEach((e=>{e&&Object.keys(e).forEach((t=>{e[t].forEach((e=>{"@type"===t&&void 0!==e["@id"]&&(e=e["@id"]),void 0===m[t]?m[t]=e:Array.isArray(m[t])?m[t].push(e):m[t]=[m[t],e]}))}))})),e=n=m):(St=e,e=o)}else St=e,e=o;else St=e,e=o;return e}function Bt(){var e,n,r,i,a,s,c,u,l;if(e=St,(n=qt())!==o){for(r=[],i=St,a=[],s=Mt();s!==o;)a.push(s),s=Mt();for(a!==o?(44===t.charCodeAt(St)?(s=",",St++):(s=o,Rt(q)),s!==o&&(c=qt())!==o?(Ct=i,i=a=W(0,c)):(St=i,i=o)):(St=i,i=o);i!==o;){for(r.push(i),i=St,a=[],s=Mt();s!==o;)a.push(s),s=Mt();a!==o?(44===t.charCodeAt(St)?(s=",",St++):(s=o,Rt(q)),s!==o&&(c=qt())!==o?(Ct=i,i=a=W(0,c)):(St=i,i=o)):(St=i,i=o)}r!==o?(Ct=e,u=n,(l=r).unshift(u),e=n=l):(St=e,e=o)}else St=e,e=o;return e}function Ht(){var e,n,r;if(e=St,(n=function(){var e,t,n;for(e=St,t=[],n=Mt();n!==o;)t.push(n),n=Mt();return t!==o&&(n=Jt())!==o?(Ct=e,e=t=n):(St=e,e=o),e}())!==o&&(Ct=e),(e=n)===o){for(e=St,n=[],r=Mt();r!==o;)n.push(r),r=Mt();n!==o?(97===t.charCodeAt(St)?(r="a",St++):(r=o,Rt(K)),r!==o?(Ct=e,e=n="@type"):(St=e,e=o)):(St=e,e=o)}return e}function qt(){var e,n;return(e=function(){var e;return(e=function(){var e,n,r,i,a,s,c;for(e=St,n=[],r=Mt();r!==o;)n.push(r),r=Mt();if(n!==o)if((r=Vt())!==o){for(i=[],a=Mt();a!==o;)i.push(a),a=Mt();i!==o&&(a=function(){var e,n,r,i,a,s,c,u;if(e=St,64===t.charCodeAt(St)?(n="@",St++):(n=o,Rt(de)),n!==o){if(r=[],pe.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(fe)),i!==o)for(;i!==o;)r.push(i),pe.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(fe));else r=o;if(r!==o){if(i=[],a=St,45===t.charCodeAt(St)?(s=he,St++):(s=o,Rt(me)),s!==o){if(c=[],ge.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(ve)),u!==o)for(;u!==o;)c.push(u),ge.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(ve));else c=o;c!==o?(Ct=a,a=s=ye(0,c)):(St=a,a=o)}else St=a,a=o;for(;a!==o;)if(i.push(a),a=St,45===t.charCodeAt(St)?(s=he,St++):(s=o,Rt(me)),s!==o){if(c=[],ge.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(ve)),u!==o)for(;u!==o;)c.push(u),ge.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(ve));else c=o;c!==o?(Ct=a,a=s=ye(0,c)):(St=a,a=o)}else St=a,a=o;i!==o?(Ct=e,l=i,e=n=r.join("")+l.join("")):(St=e,e=o)}else St=e,e=o}else St=e,e=o;var l;return e}())!==o?(Ct=e,e=n={"@value":r,"@language":a}):(St=e,e=o)}else St=e,e=o;else St=e,e=o;if(e===o){for(e=St,n=[],r=Mt();r!==o;)n.push(r),r=Mt();if(n!==o)if((r=Vt())!==o){for(i=[],a=Mt();a!==o;)i.push(a),a=Mt();if(i!==o)if(t.substr(St,2)===$?(a=$,St+=2):(a=o,Rt(G)),a!==o){for(s=[],c=Mt();c!==o;)s.push(c),c=Mt();s!==o&&(c=Jt())!==o?(Ct=e,e=n=function(e,t){if("http://www.w3.org/2001/XMLSchema#boolean"===t&&"true"===e)return!0;if("http://www.w3.org/2001/XMLSchema#boolean"===t&&"false"===e)return!1;if("http://www.w3.org/2001/XMLSchema#integer"===t)return parseInt(e);if("http://www.w3.org/2001/XMLSchema#double"===t)return parseFloat(e);const n=un.resolve(t,!0);if(n){const r=t.split(":")[0];if("http://www.w3.org/2001/XMLSchema#boolean"===n&&"true"===e)return un.decrement(r),!0;if("http://www.w3.org/2001/XMLSchema#boolean"===n&&"false"===e)return un.decrement(r),!1;if("http://www.w3.org/2001/XMLSchema#integer"===n)return un.decrement(r),parseInt(e);if("http://www.w3.org/2001/XMLSchema#double"===n)return un.decrement(r),parseFloat(e)}return{"@value":e,"@type":t}}(r,c)):(St=e,e=o)}else St=e,e=o;else St=e,e=o}else St=e,e=o;else St=e,e=o;if(e===o){for(e=St,n=[],r=Mt();r!==o;)n.push(r),r=Mt();n!==o&&(r=Vt())!==o?(Ct=e,e=n=r):(St=e,e=o)}}return e}())===o&&(e=function(){var e,n,r;for(e=St,n=[],r=Mt();r!==o;)n.push(r),r=Mt();return n!==o?((r=function(){var e,n,r,i,a,s,l,d,p;if(e=St,n=St,r=St,be.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(we)),i===o&&(i=null),i!==o){if(a=St,s=[],ue.test(t.charAt(St))?(l=t.charAt(St),St++):(l=o,Rt(le)),l!==o)for(;l!==o;)s.push(l),ue.test(t.charAt(St))?(l=t.charAt(St),St++):(l=o,Rt(le));else s=o;if(s!==o)if(46===t.charCodeAt(St)?(l=c,St++):(l=o,Rt(u)),l!==o){for(d=[],ue.test(t.charAt(St))?(p=t.charAt(St),St++):(p=o,Rt(le));p!==o;)d.push(p),ue.test(t.charAt(St))?(p=t.charAt(St),St++):(p=o,Rt(le));d!==o&&(p=Xt())!==o?a=s=[s,l,d,p]:(St=a,a=o)}else St=a,a=o;else St=a,a=o;if(a===o){if(a=St,46===t.charCodeAt(St)?(s=c,St++):(s=o,Rt(u)),s!==o){if(l=[],ue.test(t.charAt(St))?(d=t.charAt(St),St++):(d=o,Rt(le)),d!==o)for(;d!==o;)l.push(d),ue.test(t.charAt(St))?(d=t.charAt(St),St++):(d=o,Rt(le));else l=o;l!==o&&(d=Xt())!==o?a=s=[s,l,d]:(St=a,a=o)}else St=a,a=o;if(a===o){if(a=St,s=[],ue.test(t.charAt(St))?(l=t.charAt(St),St++):(l=o,Rt(le)),l!==o)for(;l!==o;)s.push(l),ue.test(t.charAt(St))?(l=t.charAt(St),St++):(l=o,Rt(le));else s=o;s!==o&&(l=Xt())!==o?a=s=[s,l]:(St=a,a=o)}}a!==o?r=i=[i,a]:(St=r,r=o)}else St=r,r=o;return(n=r!==o?t.substring(n,St):r)!==o&&(Ct=e,f=n,n={"@value":f,"@type":"http://www.w3.org/2001/XMLSchema#double"}),n;var f}())===o&&(r=function(){var e,n,r,i,a,s,l,d;if(e=St,n=St,r=St,be.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(we)),i===o&&(i=null),i!==o){for(a=[],ue.test(t.charAt(St))?(s=t.charAt(St),St++):(s=o,Rt(le));s!==o;)a.push(s),ue.test(t.charAt(St))?(s=t.charAt(St),St++):(s=o,Rt(le));if(a!==o)if(46===t.charCodeAt(St)?(s=c,St++):(s=o,Rt(u)),s!==o){if(l=[],ue.test(t.charAt(St))?(d=t.charAt(St),St++):(d=o,Rt(le)),d!==o)for(;d!==o;)l.push(d),ue.test(t.charAt(St))?(d=t.charAt(St),St++):(d=o,Rt(le));else l=o;l!==o?r=i=[i,a,s,l]:(St=r,r=o)}else St=r,r=o;else St=r,r=o}else St=r,r=o;return(n=r!==o?t.substring(n,St):r)!==o&&(Ct=e,p=n,n={"@value":p,"@type":"http://www.w3.org/2001/XMLSchema#decimal"}),n;var p}())===o&&(r=function(){var e,n,r,i,a,s;if(e=St,n=St,r=St,be.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(we)),i===o&&(i=null),i!==o){if(a=[],ue.test(t.charAt(St))?(s=t.charAt(St),St++):(s=o,Rt(le)),s!==o)for(;s!==o;)a.push(s),ue.test(t.charAt(St))?(s=t.charAt(St),St++):(s=o,Rt(le));else a=o;a!==o?r=i=[i,a]:(St=r,r=o)}else St=r,r=o;return(n=r!==o?t.substring(n,St):r)!==o&&(Ct=e,c=n,n=c.match(/^[0+][0-9]+$/)?{"@value":c,"@type":"http://www.w3.org/2001/XMLSchema#integer"}:parseInt(c)),n;var c}()),r!==o?(Ct=e,e=n=r):(St=e,e=o)):(St=e,e=o),e}())===o&&(e=function(){var e,n,r;for(e=St,n=[],r=Mt();r!==o;)n.push(r),r=Mt();if(n!==o?(t.substr(St,4)===X?(r=X,St+=4):(r=o,Rt(Q)),r!==o?(Ct=e,e=n=!0):(St=e,e=o)):(St=e,e=o),e===o){for(e=St,n=[],r=Mt();r!==o;)n.push(r),r=Mt();n!==o?(t.substr(St,5)===Y?(r=Y,St+=5):(r=o,Rt(ee)),r!==o?(Ct=e,e=n=!1):(St=e,e=o)):(St=e,e=o)}return e}()),e}())===o&&(e=St,(n=Kt())!==o&&(Ct=e,n=ln(n,!1)),(e=n)===o&&(e=St,(n=zt())!==o&&(Ct=e,n=function(e){return"[]"===e?{}:{"@id":e}}(n)),(e=n)===o&&(e=St,(n=Wt())!==o&&(Ct=e),(e=n)===o&&(e=St,(n=Jt())!==o&&(Ct=e,n=function(e){return{"@id":e}}(n)),e=n)))),e}function Wt(){var e,n,r,i,a,s;for(e=St,n=[],r=Mt();r!==o;)n.push(r),r=Mt();if(n!==o)if(91===t.charCodeAt(St)?(r="[",St++):(r=o,Rt(V)),r!==o)if((i=Ut())!==o){for(a=[],s=Mt();s!==o;)a.push(s),s=Mt();a!==o?(93===t.charCodeAt(St)?(s="]",St++):(s=o,Rt(J)),s!==o?(Ct=e,e=n=i):(St=e,e=o)):(St=e,e=o)}else St=e,e=o;else St=e,e=o;else St=e,e=o;return e}function Kt(){var e,n,r,i,a,s;for(e=St,n=[],r=Mt();r!==o;)n.push(r),r=Mt();if(n!==o)if(40===t.charCodeAt(St)?(r="(",St++):(r=o,Rt(z)),r!==o){for(i=[],a=qt();a!==o;)i.push(a),a=qt();if(i!==o){for(a=[],s=Mt();s!==o;)a.push(s),s=Mt();a!==o?(41===t.charCodeAt(St)?(s=")",St++):(s=o,Rt(Z)),s!==o?(Ct=e,e=n={"@list":i}):(St=e,e=o)):(St=e,e=o)}else St=e,e=o}else St=e,e=o;else St=e,e=o;return e}function Vt(){var e,n,r;for(e=St,n=[],r=Mt();r!==o;)n.push(r),r=Mt();return n!==o?((r=function(){var e,n,r,i,a,s,c,u;if(e=St,t.substr(St,3)===Ie?(n=Ie,St+=3):(n=o,Rt(je)),n!==o){for(r=[],Ne.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(Fe)),i===o&&(i=Yt())===o&&(i=Qt());i!==o;)r.push(i),Ne.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(Fe)),i===o&&(i=Yt())===o&&(i=Qt());if(r!==o){if(i=[],a=St,t.substr(St,2)===Re?(s=Re,St+=2):(s=o,Rt(Le)),s!==o){if(c=[],Ne.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(Fe)),u===o&&(u=Yt())===o&&(u=Qt()),u!==o)for(;u!==o;)c.push(u),Ne.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(Fe)),u===o&&(u=Yt())===o&&(u=Qt());else c=o;c!==o?(Ct=a,a=s=De(0,c)):(St=a,a=o)}else St=a,a=o;if(a===o)if(a=St,39===t.charCodeAt(St)?(s=Ae,St++):(s=o,Rt(Te)),s!==o){if(c=[],Ne.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(Fe)),u===o&&(u=Yt())===o&&(u=Qt()),u!==o)for(;u!==o;)c.push(u),Ne.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(Fe)),u===o&&(u=Yt())===o&&(u=Qt());else c=o;c!==o?(Ct=a,a=s=Me(0,c)):(St=a,a=o)}else St=a,a=o;for(;a!==o;){if(i.push(a),a=St,t.substr(St,2)===Re?(s=Re,St+=2):(s=o,Rt(Le)),s!==o){if(c=[],Ne.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(Fe)),u===o&&(u=Yt())===o&&(u=Qt()),u!==o)for(;u!==o;)c.push(u),Ne.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(Fe)),u===o&&(u=Yt())===o&&(u=Qt());else c=o;c!==o?(Ct=a,a=s=De(0,c)):(St=a,a=o)}else St=a,a=o;if(a===o)if(a=St,39===t.charCodeAt(St)?(s=Ae,St++):(s=o,Rt(Te)),s!==o){if(c=[],Ne.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(Fe)),u===o&&(u=Yt())===o&&(u=Qt()),u!==o)for(;u!==o;)c.push(u),Ne.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(Fe)),u===o&&(u=Yt())===o&&(u=Qt());else c=o;c!==o?(Ct=a,a=s=Me(0,c)):(St=a,a=o)}else St=a,a=o}i!==o?(t.substr(St,3)===Ie?(a=Ie,St+=3):(a=o,Rt(je)),a!==o?(Ct=e,e=n=Ue(r,i)):(St=e,e=o)):(St=e,e=o)}else St=e,e=o}else St=e,e=o;return e}())===o&&(r=function(){var e,n,r,i,a,s,c,u;if(e=St,t.substr(St,3)===Be?(n=Be,St+=3):(n=o,Rt(He)),n!==o){for(r=[],qe.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(We)),i===o&&(i=Yt())===o&&(i=Qt());i!==o;)r.push(i),qe.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(We)),i===o&&(i=Yt())===o&&(i=Qt());if(r!==o){if(i=[],a=St,t.substr(St,2)===Ke?(s=Ke,St+=2):(s=o,Rt(Ve)),s!==o){if(c=[],qe.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(We)),u===o&&(u=Yt())===o&&(u=Qt()),u!==o)for(;u!==o;)c.push(u),qe.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(We)),u===o&&(u=Yt())===o&&(u=Qt());else c=o;c!==o?(Ct=a,a=s=Je(0,c)):(St=a,a=o)}else St=a,a=o;if(a===o)if(a=St,34===t.charCodeAt(St)?(s=Ee,St++):(s=o,Rt(ke)),s!==o){if(c=[],qe.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(We)),u===o&&(u=Yt())===o&&(u=Qt()),u!==o)for(;u!==o;)c.push(u),qe.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(We)),u===o&&(u=Yt())===o&&(u=Qt());else c=o;c!==o?(Ct=a,a=s=ze(0,c)):(St=a,a=o)}else St=a,a=o;for(;a!==o;){if(i.push(a),a=St,t.substr(St,2)===Ke?(s=Ke,St+=2):(s=o,Rt(Ve)),s!==o){if(c=[],qe.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(We)),u===o&&(u=Yt())===o&&(u=Qt()),u!==o)for(;u!==o;)c.push(u),qe.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(We)),u===o&&(u=Yt())===o&&(u=Qt());else c=o;c!==o?(Ct=a,a=s=Je(0,c)):(St=a,a=o)}else St=a,a=o;if(a===o)if(a=St,34===t.charCodeAt(St)?(s=Ee,St++):(s=o,Rt(ke)),s!==o){if(c=[],qe.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(We)),u===o&&(u=Yt())===o&&(u=Qt()),u!==o)for(;u!==o;)c.push(u),qe.test(t.charAt(St))?(u=t.charAt(St),St++):(u=o,Rt(We)),u===o&&(u=Yt())===o&&(u=Qt());else c=o;c!==o?(Ct=a,a=s=ze(0,c)):(St=a,a=o)}else St=a,a=o}i!==o?(t.substr(St,3)===Be?(a=Be,St+=3):(a=o,Rt(He)),a!==o?(Ct=e,e=n=Ue(r,i)):(St=e,e=o)):(St=e,e=o)}else St=e,e=o}else St=e,e=o;return e}())===o&&(r=function(){var e,n,r,i;if(e=St,39===t.charCodeAt(St)?(n=Ae,St++):(n=o,Rt(Te)),n!==o){for(r=[],Oe.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(Pe)),i===o&&(i=Yt())===o&&(i=Qt());i!==o;)r.push(i),Oe.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(Pe)),i===o&&(i=Yt())===o&&(i=Qt());r!==o?(39===t.charCodeAt(St)?(i=Ae,St++):(i=o,Rt(Te)),i!==o?(Ct=e,e=n=h(r)):(St=e,e=o)):(St=e,e=o)}else St=e,e=o;return e}())===o&&(r=function(){var e,n,r,i;if(e=St,34===t.charCodeAt(St)?(n=Ee,St++):(n=o,Rt(ke)),n!==o){for(r=[],Se.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(Ce)),i===o&&(i=Yt())===o&&(i=Qt());i!==o;)r.push(i),Se.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(Ce)),i===o&&(i=Yt())===o&&(i=Qt());r!==o?(34===t.charCodeAt(St)?(i=Ee,St++):(i=o,Rt(ke)),i!==o?(Ct=e,e=n=h(r)):(St=e,e=o)):(St=e,e=o)}else St=e,e=o;return e}()),r!==o?(Ct=e,e=n=r):(St=e,e=o)):(St=e,e=o),e}function Jt(){var e,n,r;for(e=St,n=[],r=Mt();r!==o;)n.push(r),r=Mt();if(n!==o&&(r=Zt())!==o?(Ct=e,e=n=r):(St=e,e=o),e===o){for(e=St,n=[],r=Mt();r!==o;)n.push(r),r=Mt();n!==o&&(r=function(){var e,n;return(e=function(){var e,n,r;return e=St,(n=$t())!==o&&(r=function(){var e,n,r,i,a,s,l,d;if(e=St,(n=tn())===o&&(58===t.charCodeAt(St)?(n=oe,St++):(n=o,Rt(ae)),n===o&&(ue.test(t.charAt(St))?(n=t.charAt(St),St++):(n=o,Rt(le)),n===o&&(n=on()))),n!==o){for(r=[],(i=nn())===o&&(58===t.charCodeAt(St)?(i=oe,St++):(i=o,Rt(ae)),i===o&&(i=on()));i!==o;)r.push(i),(i=nn())===o&&(58===t.charCodeAt(St)?(i=oe,St++):(i=o,Rt(ae)),i===o&&(i=on()));if(r!==o){if(i=[],a=St,s=[],46===t.charCodeAt(St)?(l=c,St++):(l=o,Rt(u)),l!==o)for(;l!==o;)s.push(l),46===t.charCodeAt(St)?(l=c,St++):(l=o,Rt(u));else s=o;if(s!==o){if(l=[],(d=nn())===o&&(58===t.charCodeAt(St)?(d=oe,St++):(d=o,Rt(ae)),d===o&&(d=on())),d!==o)for(;d!==o;)l.push(d),(d=nn())===o&&(58===t.charCodeAt(St)?(d=oe,St++):(d=o,Rt(ae)),d===o&&(d=on()));else l=o;l!==o?(Ct=a,a=s=yt(0,0,s,l)):(St=a,a=o)}else St=a,a=o;for(;a!==o;){if(i.push(a),a=St,s=[],46===t.charCodeAt(St)?(l=c,St++):(l=o,Rt(u)),l!==o)for(;l!==o;)s.push(l),46===t.charCodeAt(St)?(l=c,St++):(l=o,Rt(u));else s=o;if(s!==o){if(l=[],(d=nn())===o&&(58===t.charCodeAt(St)?(d=oe,St++):(d=o,Rt(ae)),d===o&&(d=on())),d!==o)for(;d!==o;)l.push(d),(d=nn())===o&&(58===t.charCodeAt(St)?(d=oe,St++):(d=o,Rt(ae)),d===o&&(d=on()));else l=o;l!==o?(Ct=a,a=s=yt(0,0,s,l)):(St=a,a=o)}else St=a,a=o}i!==o?(Ct=e,p=i,e=n=n+r.join("")+p.join("")):(St=e,e=o)}else St=e,e=o}else St=e,e=o;var p;return e}())!==o?(Ct=e,i=n,a=r,un.increment(i),e=n=un.resolve(i+":"+a)):(St=e,e=o),e;var i,a}())===o&&(e=St,(n=$t())!==o&&(Ct=e,r=n,n=r+":"),e=n),e;var r}())!==o?(Ct=e,e=n=r):(St=e,e=o)}return e}function zt(){var e,n,r;for(e=St,n=[],r=Mt();r!==o;)n.push(r),r=Mt();if(n!==o&&(r=function(){var e,n,r,i,a,s,l,d,p,f;if(e=St,n=St,t.substr(St,2)===se?(r=se,St+=2):(r=o,Rt(ce)),r!==o)if((i=tn())===o&&(ue.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(le))),i!==o){for(a=[],s=nn();s!==o;)a.push(s),s=nn();if(a!==o){if(s=[],l=St,d=[],46===t.charCodeAt(St)?(p=c,St++):(p=o,Rt(u)),p!==o)for(;p!==o;)d.push(p),46===t.charCodeAt(St)?(p=c,St++):(p=o,Rt(u));else d=o;if(d!==o){if(p=[],(f=nn())!==o)for(;f!==o;)p.push(f),f=nn();else p=o;p!==o?l=d=[d,p]:(St=l,l=o)}else St=l,l=o;for(;l!==o;){if(s.push(l),l=St,d=[],46===t.charCodeAt(St)?(p=c,St++):(p=o,Rt(u)),p!==o)for(;p!==o;)d.push(p),46===t.charCodeAt(St)?(p=c,St++):(p=o,Rt(u));else d=o;if(d!==o){if(p=[],(f=nn())!==o)for(;f!==o;)p.push(f),f=nn();else p=o;p!==o?l=d=[d,p]:(St=l,l=o)}else St=l,l=o}s!==o?n=r=[r,i,a,s]:(St=n,n=o)}else St=n,n=o}else St=n,n=o;else St=n,n=o;return n!==o?t.substring(e,St):n}())!==o?(Ct=e,e=n=r):(St=e,e=o),e===o){for(e=St,n=[],r=Mt();r!==o;)n.push(r),r=Mt();n!==o&&(r=function(){var e,n,r,i;if(e=St,91===t.charCodeAt(St)?(n="[",St++):(n=o,Rt(V)),n!==o){for(r=[],i=Mt();i!==o;)r.push(i),i=Mt();r!==o?(93===t.charCodeAt(St)?(i="]",St++):(i=o,Rt(J)),i!==o?(Ct=e,e=n="[]"):(St=e,e=o)):(St=e,e=o)}else St=e,e=o;return e}())!==o?(Ct=e,e=n=r):(St=e,e=o)}return e}function Zt(){var e,n,r,i;if(e=St,60===t.charCodeAt(St)?(n="<",St++):(n=o,Rt(te)),n!==o){for(r=[],ne.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(re)),i===o&&(i=Qt());i!==o;)r.push(i),ne.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(re)),i===o&&(i=Qt());r!==o?(62===t.charCodeAt(St)?(i=">",St++):(i=o,Rt(ie)),i!==o?(Ct=e,e=n=function(e){const t=e.map((e=>65536<=e.codePointAt(0)&&e.codePointAt(0)<=983039?"a":1===e.length?e:6===e.length?String.fromCharCode("0x"+e.substring(2)):10===e.length?String.fromCodePoint("0x"+e.substring(2)):e)).join("");if(t.match(/^[^\u0000-\u0020<>"{}|^`\\]*$/)){var n=e.join("");try{return un.resolve(n)}catch(e){Pt("Invalid IRIREF "+n)}}else Pt("Invalid IRIREF "+e.join("")+" / "+t)}(r)):(St=e,e=o)):(St=e,e=o)}else St=e,e=o;return e}function $t(){var e,n,r,i;return e=St,(n=rn())===o&&(n=null),n!==o?(58===t.charCodeAt(St)?(r=oe,St++):(r=o,Rt(ae)),r!==o?(Ct=e,i=(i=n)||"0",!1===un.hasPrefix(i)&&Pt("undefined prefix "+i),e=n=i):(St=e,e=o)):(St=e,e=o),e}function Gt(){var e,n,r;return e=St,(n=rn())===o&&(n=null),n!==o?(58===t.charCodeAt(St)?(r=oe,St++):(r=o,Rt(ae)),r!==o?(Ct=e,e=n=n||""):(St=e,e=o)):(St=e,e=o),e}function Xt(){var e,n,r,i,a,s;if(e=St,n=St,xe.test(t.charAt(St))?(r=t.charAt(St),St++):(r=o,Rt(_e)),r!==o)if(be.test(t.charAt(St))?(i=t.charAt(St),St++):(i=o,Rt(we)),i===o&&(i=null),i!==o){if(a=[],ue.test(t.charAt(St))?(s=t.charAt(St),St++):(s=o,Rt(le)),s!==o)for(;s!==o;)a.push(s),ue.test(t.charAt(St))?(s=t.charAt(St),St++):(s=o,Rt(le));else a=o;a!==o?n=r=[r,i,a]:(St=n,n=o)}else St=n,n=o;else St=n,n=o;return n!==o?t.substring(e,St):n}function Qt(){var e,n,r,i,a,s,c,u,l,d,p,f;return e=St,"\\U"===t.substr(St,2)?(n="\\U",St+=2):(n=o,Rt(Ze)),n!==o?(r=St,(i=an())!==o&&(a=an())!==o&&(s=an())!==o&&(c=an())!==o&&(u=an())!==o&&(l=an())!==o&&(d=an())!==o&&(p=an())!==o?r=i=[i,a,s,c,u,l,d,p]:(St=r,r=o),r!==o?(Ct=e,f=r,e=n=String.fromCodePoint(parseInt(f.join(""),16))):(St=e,e=o)):(St=e,e=o),e===o&&(e=St,"\\u"===t.substr(St,2)?(n="\\u",St+=2):(n=o,Rt($e)),n!==o?(r=St,(i=an())!==o&&(a=an())!==o&&(s=an())!==o&&(c=an())!==o?r=i=[i,a,s,c]:(St=r,r=o),r!==o?(Ct=e,e=n=function(e){return String.fromCharCode(parseInt(e.join(""),16))}(r)):(St=e,e=o)):(St=e,e=o)),e}function Yt(){var e,n;return e=St,"\\t"===t.substr(St,2)?(n="\\t",St+=2):(n=o,Rt(Ge)),n!==o&&(Ct=e,n="\t"),(e=n)===o&&(e=St,"\\b"===t.substr(St,2)?(n="\\b",St+=2):(n=o,Rt(Xe)),n!==o&&(Ct=e,n="\b"),(e=n)===o&&(e=St,"\\n"===t.substr(St,2)?(n="\\n",St+=2):(n=o,Rt(Qe)),n!==o&&(Ct=e,n="\n"),(e=n)===o&&(e=St,"\\r"===t.substr(St,2)?(n="\\r",St+=2):(n=o,Rt(Ye)),n!==o&&(Ct=e,n="\r"),(e=n)===o&&(e=St,"\\f"===t.substr(St,2)?(n="\\f",St+=2):(n=o,Rt(et)),n!==o&&(Ct=e,n="\f"),(e=n)===o&&(e=St,'\\"'===t.substr(St,2)?(n='\\"',St+=2):(n=o,Rt(tt)),n!==o&&(Ct=e,n='"'),(e=n)===o&&(e=St,"\\'"===t.substr(St,2)?(n="\\'",St+=2):(n=o,Rt(nt)),n!==o&&(Ct=e,n="'"),(e=n)===o&&(e=St,"\\\\"===t.substr(St,2)?(n="\\\\",St+=2):(n=o,Rt(rt)),n!==o&&(Ct=e,n="\\"),e=n))))))),e}function en(){var e,n,r;return e=St,at.test(t.charAt(St))?(n=t.charAt(St),St++):(n=o,Rt(st)),n!==o?(ct.test(t.charAt(St))?(r=t.charAt(St),St++):(r=o,Rt(ut)),r!==o?(Ct=e,e=n=n+r):(St=e,e=o)):(St=e,e=o),e===o&&(lt.test(t.charAt(St))?(e=t.charAt(St),St++):(e=o,Rt(dt))),e}function tn(){var e;return(e=en())===o&&(95===t.charCodeAt(St)?(e="_",St++):(e=o,Rt(pt))),e}function nn(){var e;return(e=tn())===o&&(45===t.charCodeAt(St)?(e=he,St++):(e=o,Rt(me)),e===o&&(ue.test(t.charAt(St))?(e=t.charAt(St),St++):(e=o,Rt(le)),e===o&&(183===t.charCodeAt(St)?(e="·",St++):(e=o,Rt(ft)),e===o&&(ht.test(t.charAt(St))?(e=t.charAt(St),St++):(e=o,Rt(mt)),e===o&&(gt.test(t.charAt(St))?(e=t.charAt(St),St++):(e=o,Rt(vt))))))),e}function rn(){var e,n,r,i,a,s,l,d,p;if(e=St,n=St,(r=en())!==o){for(i=[],a=nn();a!==o;)i.push(a),a=nn();if(i!==o){if(a=[],s=St,l=[],46===t.charCodeAt(St)?(d=c,St++):(d=o,Rt(u)),d!==o)for(;d!==o;)l.push(d),46===t.charCodeAt(St)?(d=c,St++):(d=o,Rt(u));else l=o;if(l!==o){if(d=[],(p=nn())!==o)for(;p!==o;)d.push(p),p=nn();else d=o;d!==o?s=l=[l,d]:(St=s,s=o)}else St=s,s=o;for(;s!==o;){if(a.push(s),s=St,l=[],46===t.charCodeAt(St)?(d=c,St++):(d=o,Rt(u)),d!==o)for(;d!==o;)l.push(d),46===t.charCodeAt(St)?(d=c,St++):(d=o,Rt(u));else l=o;if(l!==o){if(d=[],(p=nn())!==o)for(;p!==o;)d.push(p),p=nn();else d=o;d!==o?s=l=[l,d]:(St=s,s=o)}else St=s,s=o}a!==o?n=r=[r,i,a]:(St=n,n=o)}else St=n,n=o}else St=n,n=o;return n!==o?t.substring(e,St):n}function on(){var e;return(e=function(){var e,n,r,i,a;return e=St,n=St,37===t.charCodeAt(St)?(r="%",St++):(r=o,Rt(bt)),r!==o&&(i=an())!==o&&(a=an())!==o?n=r=[r,i,a]:(St=n,n=o),n!==o?t.substring(e,St):n}())===o&&(e=function(){var e,n,r;return e=St,92===t.charCodeAt(St)?(n="\\",St++):(n=o,Rt(_t)),n!==o?(Et.test(t.charAt(St))?(r=t.charAt(St),St++):(r=o,Rt(kt)),r!==o?(Ct=e,e=n=r):(St=e,e=o)):(St=e,e=o),e}()),e}function an(){var e;return wt.test(t.charAt(St))?(e=t.charAt(St),St++):(e=o,Rt(xt)),e}var sn=new Function("try {return this===window;}catch(e){ return false;}")()?window.URL:n(8575).URL,cn=function(e){return e.match(/^[a-z](.*?):(.+?)/g)},un={base:[],data:{},addBase:function(e){if(0===un.base.length)return void un.base.push(e);const t=un.base[un.base.length-1];t!==e&&un.base.push(new sn(e,t).toString())},addPrefix:function(e,t){const n=un.data[e];void 0===n?un.data[e]=[{uri:t,count:0}]:n[n.length-1].uri!==t&&n.push({uri:t,count:0})},hasPrefix:function(e){return void 0!==this.data[e]},resolve:function(e,t){const n=Object.keys(un.data).find((t=>0===e.indexOf(t+":")));if(void 0!==n){const r=un.data[n];if(1===r.length&&!0!==t&&cn(r[0].uri))return e;const i=r[r.length-1].uri;return e.replace(n+":",i)}var i=0===un.base.length?r.baseIRI:un.base[un.base.length-1];return!i||e.match(/^(http:|https:|urn:|file:)/)?e:0===e.indexOf("//")&&i?i.split("//")[0]+e:new sn(e,i).toString()},increment:function(e){const t=un.data[e];void 0!==t&&t[t.length-1].count++},decrement:function(e){const t=un.data[e];void 0!==t&&t[t.length-1].count--},toJSON:function(){const e={};return un.base.length>0&&(void 0===e["@context"]&&(e["@context"]={}),e["@context"]["@base"]=un.base[0]),Object.keys(un.data).forEach((t=>{const n=un.data[t][0];"http://www.w3.org/2001/XMLSchema#"===n.uri&&n.count<1||cn(n.uri)&&(void 0===e["@context"]&&(e["@context"]={}),e["@context"][t]=n.uri)})),e}};function ln(e,t){if(void 0===e["@list"])return e;if(!t&&!e["@list"].find((e=>void 0!==e["@list"])))return e;if(0===e["@list"].length)return{"@id":"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"};var n={},r=null;return e["@list"].forEach((e=>{null===r?r=n:(r["http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"]={},r=r["http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"]),r["http://www.w3.org/1999/02/22-rdf-syntax-ns#first"]=ln(e,!0),r["http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"]={"@id":"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"}})),n}if((i=s())!==o&&St===t.length)return i;throw i!==o&&St<t.length&&Rt({type:"end"}),function(t,n,r){return new e(e.buildMessage(t,n),t,n,r)}(Ot,Tt<t.length?t.charAt(Tt):null,Tt<t.length?Ft(Tt,Tt+1):Ft(Tt,Tt))}}})?r.apply(t,[]):r)||(e.exports=i)},857:(e,t,n)=>{"use strict";n.r(t),n.d(t,{CordovaIFrameNavigator:()=>r.CordovaIFrameNavigator,CordovaPopupNavigator:()=>r.CordovaPopupNavigator,InMemoryWebStorage:()=>r.InMemoryWebStorage,Log:()=>r.Log,OidcClient:()=>r.OidcClient,SessionMonitor:()=>r.SessionMonitor,User:()=>r.User,UserManager:()=>r.UserManager,Version:()=>r.Version,WebStorageStateStore:()=>r.WebStorageStateStore,clearOidcPersistentStorage:()=>T,getBearerToken:()=>k,getDpopToken:()=>S,refresh:()=>C,registerClient:()=>x,removeOidcQueryParam:()=>A});var r=n(1478),i=n(4098),o=n(7289);const a={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let s;const c=new Uint8Array(16);function u(){if(!s&&(s="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!s))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return s(c)}const l=[];for(let e=0;e<256;++e)l.push((e+256).toString(16).slice(1));const d=function(e,t,n){if(a.randomUUID&&!t&&!e)return a.randomUUID();const r=(e=e||{}).random||(e.rng||u)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return(l[e[t+0]]+l[e[t+1]]+l[e[t+2]]+l[e[t+3]]+"-"+l[e[t+4]]+l[e[t+5]]+"-"+l[e[t+6]]+l[e[t+7]]+"-"+l[e[t+8]]+l[e[t+9]]+"-"+l[e[t+10]]+l[e[t+11]]+l[e[t+12]]+l[e[t+13]]+l[e[t+14]]+l[e[t+15]]).toLowerCase()}(r)},p=["ES256","RS256"],f=["openid","offline_access","webid"].join(" ");async function h(e,t,n,r){const a=await async function(e,t){const n=await(0,i.fetch)(e);if(200!==n.status)throw new Error(`Could not fetch JWKS for [${t}] at [${e}]: ${n.status} ${n.statusText}`);let r;try{r=(await n.json()).keys[0]}catch(n){throw new Error(`Malformed JWKS for [${t}] at [${e}]: ${n.message}`)}return r}(t,n);let s;try{const{payload:t}=await(0,o.jwtVerify)(e,await(0,o.importJWK)(a),{issuer:n,audience:r});s=t}catch(e){throw new Error(`Token verification failed: ${e.stack}`)}if("string"==typeof s.webid)return s.webid;if("string"!=typeof s.sub)throw new Error(`The token ${JSON.stringify(s)} is invalid: it has no 'webid' claim and no 'sub' claim.`);try{return new URL(s.sub),s.sub}catch(e){throw new Error(`The token has no 'webid' claim, and its 'sub' claim of [${s.sub}] is invalid as a URL - error [${e}].`)}}class m extends Error{constructor(e){super(e)}}class g extends Error{constructor(e){super(`[${e}] is not implemented`)}}class v extends Error{constructor(e){super(`Invalid response from OIDC provider: missing fields ${e}`),this.missingFields=e}}class y extends Error{constructor(e,t,n){super(e),this.error=t,this.errorDescription=n}}function b(e){const t=new URL(e);return new URL(t.pathname,t.origin).toString()}async function w(e,t,n){return new o.SignJWT({htu:b(e),htm:t.toUpperCase(),jti:d()}).setProtectedHeader({alg:p[0],jwk:n.publicKey,typ:"dpop+jwt"}).setIssuedAt().sign(n.privateKey,{})}async function x(e,t){var n;if(!t.registrationEndpoint)throw new Error("Dynamic Registration could not be completed because the issuer has no registration endpoint.");if(!Array.isArray(t.idTokenSigningAlgValuesSupported))throw new Error("The OIDC issuer discovery profile is missing the 'id_token_signing_alg_values_supported' value, which is mandatory.");const r=function(e,t){var n;return null!==(n=t.find((t=>e.includes(t))))&&void 0!==n?n:null}(t.idTokenSigningAlgValuesSupported,p),i={client_name:e.clientName,application_type:"web",redirect_uris:[null===(n=e.redirectUrl)||void 0===n?void 0:n.toString()],subject_type:"public",token_endpoint_auth_method:"client_secret_basic",id_token_signed_response_alg:r,grant_types:["authorization_code","refresh_token"]},o=await fetch(t.registrationEndpoint.toString(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(o.ok){const t=await o.json();return function(e,t){if(void 0===e.client_id)throw new Error(`Dynamic client registration failed: no client_id has been found on ${JSON.stringify(e)}`);if(t.redirectUrl&&(void 0===e.redirect_uris||e.redirect_uris[0]!==t.redirectUrl.toString()))throw new Error(`Dynamic client registration failed: the returned redirect URIs ${JSON.stringify(e.redirect_uris)} don't match the provided ${JSON.stringify([t.redirectUrl.toString()])}`)}(t,e),{clientId:t.client_id,clientSecret:t.client_secret,idTokenSignedResponseAlg:t.id_token_signed_response_alg,clientType:"dynamic"}}throw 400===o.status&&function(e,t){var n,r,i,o;if("invalid_redirect_uri"===e.error)throw new Error(`Dynamic client registration failed: the provided redirect uri [${null===(n=t.redirectUrl)||void 0===n?void 0:n.toString()}] is invalid - ${null!==(r=e.error_description)&&void 0!==r?r:""}`);if("invalid_client_metadata"===e.error)throw new Error(`Dynamic client registration failed: the provided client metadata ${JSON.stringify(t)} is invalid - ${null!==(i=e.error_description)&&void 0!==i?i:""}`);throw new Error(`Dynamic client registration failed: ${e.error} - ${null!==(o=e.error_description)&&void 0!==o?o:""}`)}(await o.json(),e),new Error(`Dynamic client registration failed: the server returned ${o.status} ${o.statusText} - ${await o.text()}`)}function _(e){return void 0!==e.error_description&&"string"==typeof e.error_description}function E(e,t){if(void 0!==(n=e).error&&"string"==typeof n.error)throw new y(`Token endpoint returned error [${e.error}]${_(e)?`: ${e.error_description}`:""}${function(e){return void 0!==e.error_uri&&"string"==typeof e.error_uri}(e)?` (see ${e.error_uri})`:""}`,e.error,_(e)?e.error_description:void 0);var n;if(!function(e){return void 0!==e.access_token&&"string"==typeof e.access_token}(e))throw new v(["access_token"]);if(!function(e){return void 0!==e.id_token&&"string"==typeof e.id_token}(e))throw new v(["id_token"]);if(!function(e){return void 0!==e.token_type&&"string"==typeof e.token_type}(e))throw new v(["token_type"]);if(!function(e){return void 0===e.expires_in||"number"==typeof e.expires_in}(e))throw new v(["expires_in"]);if(!t&&"bearer"!==e.token_type.toLowerCase())throw new Error(`Invalid token endpoint response: requested a [Bearer] token, but got a 'token_type' value of [${e.token_type}].`);return e}async function k(e){let t;try{const n=new r.OidcClient({response_mode:"query",loadUserInfo:!1});if(t=await n.processSigninResponse(e),void 0===n.settings.metadata)throw new Error("Cannot retrieve issuer metadata from client information in storage.");if(void 0===n.settings.metadata.jwks_uri)throw new Error("Missing some issuer metadata from client information in storage: 'jwks_uri' is undefined");if(void 0===n.settings.metadata.issuer)throw new Error("Missing some issuer metadata from client information in storage: 'issuer' is undefined");if(void 0===n.settings.client_id)throw new Error("Missing some client information in storage: 'client_id' is undefined");const i=await h(t.id_token,n.settings.metadata.jwks_uri,n.settings.metadata.issuer,n.settings.client_id);return{accessToken:t.access_token,idToken:t.id_token,webId:i,refreshToken:t.refresh_token}}catch(t){throw new Error(`Problem handling Auth Code Grant (Flow) redirect - URL [${e}]: ${t}`)}}async function S(e,t,n){return async function(e,t,n,r){!function(e,t){if(t.grantType&&(!e.grantTypesSupported||!e.grantTypesSupported.includes(t.grantType)))throw new Error(`The issuer [${e.issuer}] does not support the [${t.grantType}] grant`);if(!e.tokenEndpoint)throw new Error(`This issuer [${e.issuer}] does not have a token endpoint`)}(e,n);const i={"content-type":"application/x-www-form-urlencoded"};let a;r&&(a=await async function(){const{privateKey:e,publicKey:t}=await(0,o.generateKeyPair)(p[0]),n={privateKey:e,publicKey:await(0,o.exportJWK)(t)};return[n.publicKey.alg]=p,n}(),i.DPoP=await w(e.tokenEndpoint,"POST",a)),t.clientSecret&&(i.Authorization=`Basic ${btoa(`${t.clientId}:${t.clientSecret}`)}`);const s={grant_type:n.grantType,redirect_uri:n.redirectUrl,code:n.code,code_verifier:n.codeVerifier,client_id:t.clientId},c={method:"POST",headers:i,body:new URLSearchParams(s).toString()},u=await await fetch(e.tokenEndpoint,c),l=E(await u.json(),r),d=await h(l.id_token,e.jwksUri,e.issuer,t.clientId);return{accessToken:l.access_token,idToken:l.id_token,refreshToken:(f=l,void 0!==f.refresh_token&&"string"==typeof f.refresh_token?l.refresh_token:void 0),webId:d,dpopKey:a,expiresIn:l.expires_in};var f}(e,t,n,!0)}async function C(e,t,n,r){if(void 0===n.clientId)throw new Error("No client ID available when trying to refresh the access token.");const i={grant_type:"refresh_token",refresh_token:e,scope:f};let o={};void 0!==r&&(o={DPoP:await w(t.tokenEndpoint,"POST",r)});let a={};void 0!==n.clientSecret?a={Authorization:`Basic ${btoa(`${n.clientId}:${n.clientSecret}`)}`}:(e=>{try{return new URL(e),!0}catch(e){return!1}})(n.clientId)&&(i.client_id=n.clientId);const s=await fetch(t.tokenEndpoint,{method:"POST",body:new URLSearchParams(i).toString(),headers:{...o,...a,"Content-Type":"application/x-www-form-urlencoded"}});let c;try{c=await s.json()}catch(e){throw new Error(`The token endpoint of issuer ${t.issuer} returned a malformed response.`)}const u=E(c,void 0!==r),l=await h(u.id_token,t.jwksUri,t.issuer,n.clientId);return{accessToken:u.access_token,idToken:u.id_token,refreshToken:"string"==typeof u.refresh_token?u.refresh_token:void 0,webId:l,dpopKey:r,expiresIn:u.expires_in}}function A(e){const t=new URL(e);return t.searchParams.delete("code"),t.searchParams.delete("state"),t.hash="",e.includes(`${t.origin}/`)?t.href:`${t.origin}${t.href.substring(t.origin.length+1)}`}async function T(){const e=new r.OidcClient({response_mode:"query"});await e.clearStaleState(new r.WebStorageStateStore({}));const t=window.localStorage,n=[];for(let e=0;e<=t.length;e+=1){const r=t.key(e);r&&(r.match(/^oidc\..+$/)||r.match(/^solidClientAuthenticationUser:.+$/))&&n.push(r)}n.forEach((e=>t.removeItem(e)))}},1478:function(e){var t;t=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=22)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i={debug:function(){},info:function(){},warn:function(){},error:function(){}},o=void 0,a=void 0;(t.Log=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.reset=function(){a=3,o=i},e.debug=function(){if(a>=4){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];o.debug.apply(o,Array.from(t))}},e.info=function(){if(a>=3){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];o.info.apply(o,Array.from(t))}},e.warn=function(){if(a>=2){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];o.warn.apply(o,Array.from(t))}},e.error=function(){if(a>=1){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];o.error.apply(o,Array.from(t))}},r(e,null,[{key:"NONE",get:function(){return 0}},{key:"ERROR",get:function(){return 1}},{key:"WARN",get:function(){return 2}},{key:"INFO",get:function(){return 3}},{key:"DEBUG",get:function(){return 4}},{key:"level",get:function(){return a},set:function(e){if(!(0<=e&&e<=4))throw new Error("Invalid log level");a=e}},{key:"logger",get:function(){return o},set:function(e){if(!e.debug&&e.info&&(e.debug=e.info),!(e.debug&&e.info&&e.warn&&e.error))throw new Error("Invalid logger");o=e}}]),e}()).reset()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i={setInterval:function(e){function t(t,n){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e,t){return setInterval(e,t)})),clearInterval:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return clearInterval(e)}))},o=!1,a=null;t.Global=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e._testing=function(){o=!0},e.setXMLHttpRequest=function(e){a=e},r(e,null,[{key:"location",get:function(){if(!o)return location}},{key:"localStorage",get:function(){if(!o&&"undefined"!=typeof window)return localStorage}},{key:"sessionStorage",get:function(){if(!o&&"undefined"!=typeof window)return sessionStorage}},{key:"XMLHttpRequest",get:function(){if(!o&&"undefined"!=typeof window)return a||XMLHttpRequest}},{key:"timer",get:function(){if(!o)return i}}]),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MetadataService=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),o=n(7);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=".well-known/openid-configuration";t.MetadataService=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.JsonService;if(a(this,e),!t)throw i.Log.error("MetadataService: No settings passed to MetadataService"),new Error("settings");this._settings=t,this._jsonService=new n(["application/jwk-set+json"])}return e.prototype.resetSigningKeys=function(){this._settings=this._settings||{},this._settings.signingKeys=void 0},e.prototype.getMetadata=function(){var e=this;return this._settings.metadata?(i.Log.debug("MetadataService.getMetadata: Returning metadata from settings"),Promise.resolve(this._settings.metadata)):this.metadataUrl?(i.Log.debug("MetadataService.getMetadata: getting metadata from",this.metadataUrl),this._jsonService.getJson(this.metadataUrl).then((function(t){i.Log.debug("MetadataService.getMetadata: json received");var n=e._settings.metadataSeed||{};return e._settings.metadata=Object.assign({},n,t),e._settings.metadata}))):(i.Log.error("MetadataService.getMetadata: No authority or metadataUrl configured on settings"),Promise.reject(new Error("No authority or metadataUrl configured on settings")))},e.prototype.getIssuer=function(){return this._getMetadataProperty("issuer")},e.prototype.getAuthorizationEndpoint=function(){return this._getMetadataProperty("authorization_endpoint")},e.prototype.getUserInfoEndpoint=function(){return this._getMetadataProperty("userinfo_endpoint")},e.prototype.getTokenEndpoint=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._getMetadataProperty("token_endpoint",e)},e.prototype.getCheckSessionIframe=function(){return this._getMetadataProperty("check_session_iframe",!0)},e.prototype.getEndSessionEndpoint=function(){return this._getMetadataProperty("end_session_endpoint",!0)},e.prototype.getRevocationEndpoint=function(){return this._getMetadataProperty("revocation_endpoint",!0)},e.prototype.getKeysEndpoint=function(){return this._getMetadataProperty("jwks_uri",!0)},e.prototype._getMetadataProperty=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return i.Log.debug("MetadataService.getMetadataProperty for: "+e),this.getMetadata().then((function(n){if(i.Log.debug("MetadataService.getMetadataProperty: metadata recieved"),void 0===n[e]){if(!0===t)return void i.Log.warn("MetadataService.getMetadataProperty: Metadata does not contain optional property "+e);throw i.Log.error("MetadataService.getMetadataProperty: Metadata does not contain property "+e),new Error("Metadata does not contain property "+e)}return n[e]}))},e.prototype.getSigningKeys=function(){var e=this;return this._settings.signingKeys?(i.Log.debug("MetadataService.getSigningKeys: Returning signingKeys from settings"),Promise.resolve(this._settings.signingKeys)):this._getMetadataProperty("jwks_uri").then((function(t){return i.Log.debug("MetadataService.getSigningKeys: jwks_uri received",t),e._jsonService.getJson(t).then((function(t){if(i.Log.debug("MetadataService.getSigningKeys: key set received",t),!t.keys)throw i.Log.error("MetadataService.getSigningKeys: Missing keys on keyset"),new Error("Missing keys on keyset");return e._settings.signingKeys=t.keys,e._settings.signingKeys}))}))},r(e,[{key:"metadataUrl",get:function(){return this._metadataUrl||(this._settings.metadataUrl?this._metadataUrl=this._settings.metadataUrl:(this._metadataUrl=this._settings.authority,this._metadataUrl&&this._metadataUrl.indexOf(s)<0&&("/"!==this._metadataUrl[this._metadataUrl.length-1]&&(this._metadataUrl+="/"),this._metadataUrl+=s))),this._metadataUrl}}]),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UrlUtility=void 0;var r=n(0),i=n(1);t.UrlUtility=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.addQueryParam=function(e,t,n){return e.indexOf("?")<0&&(e+="?"),"?"!==e[e.length-1]&&(e+="&"),e+=encodeURIComponent(t),(e+="=")+encodeURIComponent(n)},e.parseUrlFragment=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.Global;"string"!=typeof e&&(e=n.location.href);var o=e.lastIndexOf(t);o>=0&&(e=e.substr(o+1)),"?"===t&&(o=e.indexOf("#"))>=0&&(e=e.substr(0,o));for(var a,s={},c=/([^&=]+)=([^&]*)/g,u=0;a=c.exec(e);)if(s[decodeURIComponent(a[1])]=decodeURIComponent(a[2].replace(/\+/g," ")),u++>50)return r.Log.error("UrlUtility.parseUrlFragment: response exceeded expected number of parameters",e),{error:"Response exceeded expected number of parameters"};for(var l in s)return s;return{}},e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JoseUtil=void 0;var r=n(26),i=function(e){return e&&e.__esModule?e:{default:e}}(n(33));t.JoseUtil=(0,i.default)({jws:r.jws,KeyUtil:r.KeyUtil,X509:r.X509,crypto:r.crypto,hextob64u:r.hextob64u,b64tohex:r.b64tohex,AllowedSigningAlgs:r.AllowedSigningAlgs})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OidcClientSettings=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),a=n(23),s=n(6),c=n(24),u=n(2);function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var d=".well-known/openid-configuration",p="id_token",f="openid",h="client_secret_post";t.OidcClientSettings=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.authority,i=t.metadataUrl,o=t.metadata,d=t.signingKeys,m=t.metadataSeed,g=t.client_id,v=t.client_secret,y=t.response_type,b=void 0===y?p:y,w=t.scope,x=void 0===w?f:w,_=t.redirect_uri,E=t.post_logout_redirect_uri,k=t.client_authentication,S=void 0===k?h:k,C=t.prompt,A=t.display,T=t.max_age,O=t.ui_locales,P=t.acr_values,I=t.resource,j=t.response_mode,N=t.filterProtocolClaims,F=void 0===N||N,R=t.loadUserInfo,L=void 0===R||R,D=t.staleStateAge,M=void 0===D?900:D,U=t.clockSkew,B=void 0===U?300:U,H=t.clockService,q=void 0===H?new a.ClockService:H,W=t.userInfoJwtIssuer,K=void 0===W?"OP":W,V=t.mergeClaims,J=void 0!==V&&V,z=t.stateStore,Z=void 0===z?new s.WebStorageStateStore:z,$=t.ResponseValidatorCtor,G=void 0===$?c.ResponseValidator:$,X=t.MetadataServiceCtor,Q=void 0===X?u.MetadataService:X,Y=t.extraQueryParams,ee=void 0===Y?{}:Y,te=t.extraTokenParams,ne=void 0===te?{}:te;l(this,e),this._authority=n,this._metadataUrl=i,this._metadata=o,this._metadataSeed=m,this._signingKeys=d,this._client_id=g,this._client_secret=v,this._response_type=b,this._scope=x,this._redirect_uri=_,this._post_logout_redirect_uri=E,this._client_authentication=S,this._prompt=C,this._display=A,this._max_age=T,this._ui_locales=O,this._acr_values=P,this._resource=I,this._response_mode=j,this._filterProtocolClaims=!!F,this._loadUserInfo=!!L,this._staleStateAge=M,this._clockSkew=B,this._clockService=q,this._userInfoJwtIssuer=K,this._mergeClaims=!!J,this._stateStore=Z,this._validator=new G(this),this._metadataService=new Q(this),this._extraQueryParams="object"===(void 0===ee?"undefined":r(ee))?ee:{},this._extraTokenParams="object"===(void 0===ne?"undefined":r(ne))?ne:{}}return e.prototype.getEpochTime=function(){return this._clockService.getEpochTime()},i(e,[{key:"client_id",get:function(){return this._client_id},set:function(e){if(this._client_id)throw o.Log.error("OidcClientSettings.set_client_id: client_id has already been assigned."),new Error("client_id has already been assigned.");this._client_id=e}},{key:"client_secret",get:function(){return this._client_secret}},{key:"response_type",get:function(){return this._response_type}},{key:"scope",get:function(){return this._scope}},{key:"redirect_uri",get:function(){return this._redirect_uri}},{key:"post_logout_redirect_uri",get:function(){return this._post_logout_redirect_uri}},{key:"client_authentication",get:function(){return this._client_authentication}},{key:"prompt",get:function(){return this._prompt}},{key:"display",get:function(){return this._display}},{key:"max_age",get:function(){return this._max_age}},{key:"ui_locales",get:function(){return this._ui_locales}},{key:"acr_values",get:function(){return this._acr_values}},{key:"resource",get:function(){return this._resource}},{key:"response_mode",get:function(){return this._response_mode}},{key:"authority",get:function(){return this._authority},set:function(e){if(this._authority)throw o.Log.error("OidcClientSettings.set_authority: authority has already been assigned."),new Error("authority has already been assigned.");this._authority=e}},{key:"metadataUrl",get:function(){return this._metadataUrl||(this._metadataUrl=this.authority,this._metadataUrl&&this._metadataUrl.indexOf(d)<0&&("/"!==this._metadataUrl[this._metadataUrl.length-1]&&(this._metadataUrl+="/"),this._metadataUrl+=d)),this._metadataUrl}},{key:"metadata",get:function(){return this._metadata},set:function(e){this._metadata=e}},{key:"metadataSeed",get:function(){return this._metadataSeed},set:function(e){this._metadataSeed=e}},{key:"signingKeys",get:function(){return this._signingKeys},set:function(e){this._signingKeys=e}},{key:"filterProtocolClaims",get:function(){return this._filterProtocolClaims}},{key:"loadUserInfo",get:function(){return this._loadUserInfo}},{key:"staleStateAge",get:function(){return this._staleStateAge}},{key:"clockSkew",get:function(){return this._clockSkew}},{key:"userInfoJwtIssuer",get:function(){return this._userInfoJwtIssuer}},{key:"mergeClaims",get:function(){return this._mergeClaims}},{key:"stateStore",get:function(){return this._stateStore}},{key:"validator",get:function(){return this._validator}},{key:"metadataService",get:function(){return this._metadataService}},{key:"extraQueryParams",get:function(){return this._extraQueryParams},set:function(e){"object"===(void 0===e?"undefined":r(e))?this._extraQueryParams=e:this._extraQueryParams={}}},{key:"extraTokenParams",get:function(){return this._extraTokenParams},set:function(e){"object"===(void 0===e?"undefined":r(e))?this._extraTokenParams=e:this._extraTokenParams={}}}]),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebStorageStateStore=void 0;var r=n(0),i=n(1);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.WebStorageStateStore=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.prefix,r=void 0===n?"oidc.":n,a=t.store,s=void 0===a?i.Global.localStorage:a;o(this,e),this._store=s,this._prefix=r}return e.prototype.set=function(e,t){return r.Log.debug("WebStorageStateStore.set",e),e=this._prefix+e,this._store.setItem(e,t),Promise.resolve()},e.prototype.get=function(e){r.Log.debug("WebStorageStateStore.get",e),e=this._prefix+e;var t=this._store.getItem(e);return Promise.resolve(t)},e.prototype.remove=function(e){r.Log.debug("WebStorageStateStore.remove",e),e=this._prefix+e;var t=this._store.getItem(e);return this._store.removeItem(e),Promise.resolve(t)},e.prototype.getAllKeys=function(){r.Log.debug("WebStorageStateStore.getAllKeys");for(var e=[],t=0;t<this._store.length;t++){var n=this._store.key(t);0===n.indexOf(this._prefix)&&e.push(n.substr(this._prefix.length))}return Promise.resolve(e)},e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JsonService=void 0;var r=n(0),i=n(1);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.JsonService=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.Global.XMLHttpRequest,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;o(this,e),t&&Array.isArray(t)?this._contentTypes=t.slice():this._contentTypes=[],this._contentTypes.push("application/json"),r&&this._contentTypes.push("application/jwt"),this._XMLHttpRequest=n,this._jwtHandler=r}return e.prototype.getJson=function(e,t){var n=this;if(!e)throw r.Log.error("JsonService.getJson: No url passed"),new Error("url");return r.Log.debug("JsonService.getJson, url: ",e),new Promise((function(i,o){var a=new n._XMLHttpRequest;a.open("GET",e);var s=n._contentTypes,c=n._jwtHandler;a.onload=function(){if(r.Log.debug("JsonService.getJson: HTTP response received, status",a.status),200===a.status){var t=a.getResponseHeader("Content-Type");if(t){var n=s.find((function(e){if(t.startsWith(e))return!0}));if("application/jwt"==n)return void c(a).then(i,o);if(n)try{return void i(JSON.parse(a.responseText))}catch(e){return r.Log.error("JsonService.getJson: Error parsing JSON response",e.message),void o(e)}}o(Error("Invalid response Content-Type: "+t+", from URL: "+e))}else o(Error(a.statusText+" ("+a.status+")"))},a.onerror=function(){r.Log.error("JsonService.getJson: network error"),o(Error("Network Error"))},t&&(r.Log.debug("JsonService.getJson: token passed, setting Authorization header"),a.setRequestHeader("Authorization","Bearer "+t)),a.send()}))},e.prototype.postForm=function(e,t,n){var i=this;if(!e)throw r.Log.error("JsonService.postForm: No url passed"),new Error("url");return r.Log.debug("JsonService.postForm, url: ",e),new Promise((function(o,a){var s=new i._XMLHttpRequest;s.open("POST",e);var c=i._contentTypes;s.onload=function(){if(r.Log.debug("JsonService.postForm: HTTP response received, status",s.status),200!==s.status){if(400===s.status&&(n=s.getResponseHeader("Content-Type"))&&c.find((function(e){if(n.startsWith(e))return!0})))try{var t=JSON.parse(s.responseText);if(t&&t.error)return r.Log.error("JsonService.postForm: Error from server: ",t.error),void a(new Error(t.error))}catch(e){return r.Log.error("JsonService.postForm: Error parsing JSON response",e.message),void a(e)}a(Error(s.statusText+" ("+s.status+")"))}else{var n;if((n=s.getResponseHeader("Content-Type"))&&c.find((function(e){if(n.startsWith(e))return!0})))try{return void o(JSON.parse(s.responseText))}catch(e){return r.Log.error("JsonService.postForm: Error parsing JSON response",e.message),void a(e)}a(Error("Invalid response Content-Type: "+n+", from URL: "+e))}},s.onerror=function(){r.Log.error("JsonService.postForm: network error"),a(Error("Network Error"))};var u="";for(var l in t){var d=t[l];d&&(u.length>0&&(u+="&"),u+=encodeURIComponent(l),u+="=",u+=encodeURIComponent(d))}s.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),void 0!==n&&s.setRequestHeader("Authorization","Basic "+btoa(n)),s.send(u)}))},e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SigninRequest=void 0;var r=n(0),i=n(3),o=n(13);t.SigninRequest=function(){function e(t){var n=t.url,a=t.client_id,s=t.redirect_uri,c=t.response_type,u=t.scope,l=t.authority,d=t.data,p=t.prompt,f=t.display,h=t.max_age,m=t.ui_locales,g=t.id_token_hint,v=t.login_hint,y=t.acr_values,b=t.resource,w=t.response_mode,x=t.request,_=t.request_uri,E=t.extraQueryParams,k=t.request_type,S=t.client_secret,C=t.extraTokenParams,A=t.skipUserInfo;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!n)throw r.Log.error("SigninRequest.ctor: No url passed"),new Error("url");if(!a)throw r.Log.error("SigninRequest.ctor: No client_id passed"),new Error("client_id");if(!s)throw r.Log.error("SigninRequest.ctor: No redirect_uri passed"),new Error("redirect_uri");if(!c)throw r.Log.error("SigninRequest.ctor: No response_type passed"),new Error("response_type");if(!u)throw r.Log.error("SigninRequest.ctor: No scope passed"),new Error("scope");if(!l)throw r.Log.error("SigninRequest.ctor: No authority passed"),new Error("authority");var T=e.isOidc(c),O=e.isCode(c);w||(w=e.isCode(c)?"query":null),this.state=new o.SigninState({nonce:T,data:d,client_id:a,authority:l,redirect_uri:s,code_verifier:O,request_type:k,response_mode:w,client_secret:S,scope:u,extraTokenParams:C,skipUserInfo:A}),n=i.UrlUtility.addQueryParam(n,"client_id",a),n=i.UrlUtility.addQueryParam(n,"redirect_uri",s),n=i.UrlUtility.addQueryParam(n,"response_type",c),n=i.UrlUtility.addQueryParam(n,"scope",u),n=i.UrlUtility.addQueryParam(n,"state",this.state.id),T&&(n=i.UrlUtility.addQueryParam(n,"nonce",this.state.nonce)),O&&(n=i.UrlUtility.addQueryParam(n,"code_challenge",this.state.code_challenge),n=i.UrlUtility.addQueryParam(n,"code_challenge_method","S256"));var P={prompt:p,display:f,max_age:h,ui_locales:m,id_token_hint:g,login_hint:v,acr_values:y,resource:b,request:x,request_uri:_,response_mode:w};for(var I in P)P[I]&&(n=i.UrlUtility.addQueryParam(n,I,P[I]));for(var j in E)n=i.UrlUtility.addQueryParam(n,j,E[j]);this.url=n}return e.isOidc=function(e){return!!e.split(/\s+/g).filter((function(e){return"id_token"===e}))[0]},e.isOAuth=function(e){return!!e.split(/\s+/g).filter((function(e){return"token"===e}))[0]},e.isCode=function(e){return!!e.split(/\s+/g).filter((function(e){return"code"===e}))[0]},e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.State=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),o=function(e){return e&&e.__esModule?e:{default:e}}(n(14));function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.State=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.id,r=t.data,i=t.created,s=t.request_type;a(this,e),this._id=n||(0,o.default)(),this._data=r,this._created="number"==typeof i&&i>0?i:parseInt(Date.now()/1e3),this._request_type=s}return e.prototype.toStorageString=function(){return i.Log.debug("State.toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type})},e.fromStorageString=function(t){return i.Log.debug("State.fromStorageString"),new e(JSON.parse(t))},e.clearStaleState=function(t,n){var r=Date.now()/1e3-n;return t.getAllKeys().then((function(n){i.Log.debug("State.clearStaleState: got keys",n);for(var o=[],a=function(a){var s=n[a];c=t.get(s).then((function(n){var o=!1;if(n)try{var a=e.fromStorageString(n);i.Log.debug("State.clearStaleState: got item from key: ",s,a.created),a.created<=r&&(o=!0)}catch(e){i.Log.error("State.clearStaleState: Error parsing state for key",s,e.message),o=!0}else i.Log.debug("State.clearStaleState: no item in storage for key: ",s),o=!0;if(o)return i.Log.debug("State.clearStaleState: removed item for key: ",s),t.remove(s)})),o.push(c)},s=0;s<n.length;s++){var c;a(s)}return i.Log.debug("State.clearStaleState: waiting on promise count:",o.length),Promise.all(o)}))},r(e,[{key:"id",get:function(){return this._id}},{key:"data",get:function(){return this._data}},{key:"created",get:function(){return this._created}},{key:"request_type",get:function(){return this._request_type}}]),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OidcClient=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),o=n(5),a=n(12),s=n(8),c=n(34),u=n(35),l=n(36),d=n(13),p=n(9);function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.OidcClient=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};f(this,e),t instanceof o.OidcClientSettings?this._settings=t:this._settings=new o.OidcClientSettings(t)}return e.prototype.createSigninRequest=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.response_type,r=t.scope,o=t.redirect_uri,a=t.data,c=t.state,u=t.prompt,l=t.display,d=t.max_age,p=t.ui_locales,f=t.id_token_hint,h=t.login_hint,m=t.acr_values,g=t.resource,v=t.request,y=t.request_uri,b=t.response_mode,w=t.extraQueryParams,x=t.extraTokenParams,_=t.request_type,E=t.skipUserInfo,k=arguments[1];i.Log.debug("OidcClient.createSigninRequest");var S=this._settings.client_id;n=n||this._settings.response_type,r=r||this._settings.scope,o=o||this._settings.redirect_uri,u=u||this._settings.prompt,l=l||this._settings.display,d=d||this._settings.max_age,p=p||this._settings.ui_locales,m=m||this._settings.acr_values,g=g||this._settings.resource,b=b||this._settings.response_mode,w=w||this._settings.extraQueryParams,x=x||this._settings.extraTokenParams;var C=this._settings.authority;return s.SigninRequest.isCode(n)&&"code"!==n?Promise.reject(new Error("OpenID Connect hybrid flow is not supported")):this._metadataService.getAuthorizationEndpoint().then((function(t){i.Log.debug("OidcClient.createSigninRequest: Received authorization endpoint",t);var A=new s.SigninRequest({url:t,client_id:S,redirect_uri:o,response_type:n,scope:r,data:a||c,authority:C,prompt:u,display:l,max_age:d,ui_locales:p,id_token_hint:f,login_hint:h,acr_values:m,resource:g,request:v,request_uri:y,extraQueryParams:w,extraTokenParams:x,request_type:_,response_mode:b,client_secret:e._settings.client_secret,skipUserInfo:E}),T=A.state;return(k=k||e._stateStore).set(T.id,T.toStorageString()).then((function(){return A}))}))},e.prototype.readSigninResponseState=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];i.Log.debug("OidcClient.readSigninResponseState");var r="query"===this._settings.response_mode||!this._settings.response_mode&&s.SigninRequest.isCode(this._settings.response_type),o=r?"?":"#",a=new c.SigninResponse(e,o);if(!a.state)return i.Log.error("OidcClient.readSigninResponseState: No state in response"),Promise.reject(new Error("No state in response"));t=t||this._stateStore;var u=n?t.remove.bind(t):t.get.bind(t);return u(a.state).then((function(e){if(!e)throw i.Log.error("OidcClient.readSigninResponseState: No matching state found in storage"),new Error("No matching state found in storage");return{state:d.SigninState.fromStorageString(e),response:a}}))},e.prototype.processSigninResponse=function(e,t){var n=this;return i.Log.debug("OidcClient.processSigninResponse"),this.readSigninResponseState(e,t,!0).then((function(e){var t=e.state,r=e.response;return i.Log.debug("OidcClient.processSigninResponse: Received state from storage; validating response"),n._validator.validateSigninResponse(t,r)}))},e.prototype.createSignoutRequest=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.id_token_hint,r=t.data,o=t.state,a=t.post_logout_redirect_uri,s=t.extraQueryParams,c=t.request_type,l=arguments[1];return i.Log.debug("OidcClient.createSignoutRequest"),a=a||this._settings.post_logout_redirect_uri,s=s||this._settings.extraQueryParams,this._metadataService.getEndSessionEndpoint().then((function(t){if(!t)throw i.Log.error("OidcClient.createSignoutRequest: No end session endpoint url returned"),new Error("no end session endpoint");i.Log.debug("OidcClient.createSignoutRequest: Received end session endpoint",t);var d=new u.SignoutRequest({url:t,id_token_hint:n,post_logout_redirect_uri:a,data:r||o,extraQueryParams:s,request_type:c}),p=d.state;return p&&(i.Log.debug("OidcClient.createSignoutRequest: Signout request has state to persist"),(l=l||e._stateStore).set(p.id,p.toStorageString())),d}))},e.prototype.readSignoutResponseState=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];i.Log.debug("OidcClient.readSignoutResponseState");var r=new l.SignoutResponse(e);if(!r.state)return i.Log.debug("OidcClient.readSignoutResponseState: No state in response"),r.error?(i.Log.warn("OidcClient.readSignoutResponseState: Response was error: ",r.error),Promise.reject(new a.ErrorResponse(r))):Promise.resolve({state:void 0,response:r});var o=r.state;t=t||this._stateStore;var s=n?t.remove.bind(t):t.get.bind(t);return s(o).then((function(e){if(!e)throw i.Log.error("OidcClient.readSignoutResponseState: No matching state found in storage"),new Error("No matching state found in storage");return{state:p.State.fromStorageString(e),response:r}}))},e.prototype.processSignoutResponse=function(e,t){var n=this;return i.Log.debug("OidcClient.processSignoutResponse"),this.readSignoutResponseState(e,t,!0).then((function(e){var t=e.state,r=e.response;return t?(i.Log.debug("OidcClient.processSignoutResponse: Received state from storage; validating response"),n._validator.validateSignoutResponse(t,r)):(i.Log.debug("OidcClient.processSignoutResponse: No state from storage; skipping validating response"),r)}))},e.prototype.clearStaleState=function(e){return i.Log.debug("OidcClient.clearStaleState"),e=e||this._stateStore,p.State.clearStaleState(e,this.settings.staleStateAge)},r(e,[{key:"_stateStore",get:function(){return this.settings.stateStore}},{key:"_validator",get:function(){return this.settings.validator}},{key:"_metadataService",get:function(){return this.settings.metadataService}},{key:"settings",get:function(){return this._settings}},{key:"metadataService",get:function(){return this._metadataService}}]),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenClient=void 0;var r=n(7),i=n(2),o=n(0);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.TokenClient=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.JsonService,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.MetadataService;if(a(this,e),!t)throw o.Log.error("TokenClient.ctor: No settings passed"),new Error("settings");this._settings=t,this._jsonService=new n,this._metadataService=new s(this._settings)}return e.prototype.exchangeCode=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).grant_type=t.grant_type||"authorization_code",t.client_id=t.client_id||this._settings.client_id,t.client_secret=t.client_secret||this._settings.client_secret,t.redirect_uri=t.redirect_uri||this._settings.redirect_uri;var n=void 0,r=t._client_authentication||this._settings._client_authentication;return delete t._client_authentication,t.code?t.redirect_uri?t.code_verifier?t.client_id?t.client_secret||"client_secret_basic"!=r?("client_secret_basic"==r&&(n=t.client_id+":"+t.client_secret,delete t.client_id,delete t.client_secret),this._metadataService.getTokenEndpoint(!1).then((function(r){return o.Log.debug("TokenClient.exchangeCode: Received token endpoint"),e._jsonService.postForm(r,t,n).then((function(e){return o.Log.debug("TokenClient.exchangeCode: response received"),e}))}))):(o.Log.error("TokenClient.exchangeCode: No client_secret passed"),Promise.reject(new Error("A client_secret is required"))):(o.Log.error("TokenClient.exchangeCode: No client_id passed"),Promise.reject(new Error("A client_id is required"))):(o.Log.error("TokenClient.exchangeCode: No code_verifier passed"),Promise.reject(new Error("A code_verifier is required"))):(o.Log.error("TokenClient.exchangeCode: No redirect_uri passed"),Promise.reject(new Error("A redirect_uri is required"))):(o.Log.error("TokenClient.exchangeCode: No code passed"),Promise.reject(new Error("A code is required")))},e.prototype.exchangeRefreshToken=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).grant_type=t.grant_type||"refresh_token",t.client_id=t.client_id||this._settings.client_id,t.client_secret=t.client_secret||this._settings.client_secret;var n=void 0,r=t._client_authentication||this._settings._client_authentication;return delete t._client_authentication,t.refresh_token?t.client_id?("client_secret_basic"==r&&(n=t.client_id+":"+t.client_secret,delete t.client_id,delete t.client_secret),this._metadataService.getTokenEndpoint(!1).then((function(r){return o.Log.debug("TokenClient.exchangeRefreshToken: Received token endpoint"),e._jsonService.postForm(r,t,n).then((function(e){return o.Log.debug("TokenClient.exchangeRefreshToken: response received"),e}))}))):(o.Log.error("TokenClient.exchangeRefreshToken: No client_id passed"),Promise.reject(new Error("A client_id is required"))):(o.Log.error("TokenClient.exchangeRefreshToken: No refresh_token passed"),Promise.reject(new Error("A refresh_token is required")))},e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorResponse=void 0;var r=n(0);function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}t.ErrorResponse=function(e){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=n.error,s=n.error_description,c=n.error_uri,u=n.state,l=n.session_state;if(i(this,t),!a)throw r.Log.error("No error passed to ErrorResponse"),new Error("error");var d=o(this,e.call(this,s||a));return d.name="ErrorResponse",d.error=a,d.error_description=s,d.error_uri=c,d.state=u,d.session_state=l,d}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(Error)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SigninState=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),o=n(9),a=n(4),s=function(e){return e&&e.__esModule?e:{default:e}}(n(14));function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}t.SigninState=function(e){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.nonce,i=n.authority,o=n.client_id,l=n.redirect_uri,d=n.code_verifier,p=n.response_mode,f=n.client_secret,h=n.scope,m=n.extraTokenParams,g=n.skipUserInfo;c(this,t);var v=u(this,e.call(this,arguments[0]));if(!0===r?v._nonce=(0,s.default)():r&&(v._nonce=r),!0===d?v._code_verifier=(0,s.default)()+(0,s.default)()+(0,s.default)():d&&(v._code_verifier=d),v.code_verifier){var y=a.JoseUtil.hashString(v.code_verifier,"SHA256");v._code_challenge=a.JoseUtil.hexToBase64Url(y)}return v._redirect_uri=l,v._authority=i,v._client_id=o,v._response_mode=p,v._client_secret=f,v._scope=h,v._extraTokenParams=m,v._skipUserInfo=g,v}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.toStorageString=function(){return i.Log.debug("SigninState.toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,nonce:this.nonce,code_verifier:this.code_verifier,redirect_uri:this.redirect_uri,authority:this.authority,client_id:this.client_id,response_mode:this.response_mode,client_secret:this.client_secret,scope:this.scope,extraTokenParams:this.extraTokenParams,skipUserInfo:this.skipUserInfo})},t.fromStorageString=function(e){return i.Log.debug("SigninState.fromStorageString"),new t(JSON.parse(e))},r(t,[{key:"nonce",get:function(){return this._nonce}},{key:"authority",get:function(){return this._authority}},{key:"client_id",get:function(){return this._client_id}},{key:"redirect_uri",get:function(){return this._redirect_uri}},{key:"code_verifier",get:function(){return this._code_verifier}},{key:"code_challenge",get:function(){return this._code_challenge}},{key:"response_mode",get:function(){return this._response_mode}},{key:"client_secret",get:function(){return this._client_secret}},{key:"scope",get:function(){return this._scope}},{key:"extraTokenParams",get:function(){return this._extraTokenParams}},{key:"skipUserInfo",get:function(){return this._skipUserInfo}}]),t}(o.State)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return("undefined"!=r&&null!==r&&void 0!==r.getRandomValues?i:o)().replace(/-/g,"")};var r="undefined"!=typeof window?window.crypto||window.msCrypto:null;function i(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(function(e){return(e^r.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)}))}function o(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(function(e){return(e^16*Math.random()>>e/4).toString(16)}))}e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.User=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0);t.User=function(){function e(t){var n=t.id_token,r=t.session_state,i=t.access_token,o=t.refresh_token,a=t.token_type,s=t.scope,c=t.profile,u=t.expires_at,l=t.state;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id_token=n,this.session_state=r,this.access_token=i,this.refresh_token=o,this.token_type=a,this.scope=s,this.profile=c,this.expires_at=u,this.state=l}return e.prototype.toStorageString=function(){return i.Log.debug("User.toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})},e.fromStorageString=function(t){return i.Log.debug("User.fromStorageString"),new e(JSON.parse(t))},r(e,[{key:"expires_in",get:function(){if(this.expires_at){var e=parseInt(Date.now()/1e3);return this.expires_at-e}},set:function(e){var t=parseInt(e);if("number"==typeof t&&t>0){var n=parseInt(Date.now()/1e3);this.expires_at=n+t}}},{key:"expired",get:function(){var e=this.expires_in;if(void 0!==e)return e<=0}},{key:"scopes",get:function(){return(this.scope||"").split(" ")}}]),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AccessTokenEvents=void 0;var r=n(0),i=n(46);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.AccessTokenEvents=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.accessTokenExpiringNotificationTime,r=void 0===n?60:n,a=t.accessTokenExpiringTimer,s=void 0===a?new i.Timer("Access token expiring"):a,c=t.accessTokenExpiredTimer,u=void 0===c?new i.Timer("Access token expired"):c;o(this,e),this._accessTokenExpiringNotificationTime=r,this._accessTokenExpiring=s,this._accessTokenExpired=u}return e.prototype.load=function(e){if(e.access_token&&void 0!==e.expires_in){var t=e.expires_in;if(r.Log.debug("AccessTokenEvents.load: access token present, remaining duration:",t),t>0){var n=t-this._accessTokenExpiringNotificationTime;n<=0&&(n=1),r.Log.debug("AccessTokenEvents.load: registering expiring timer in:",n),this._accessTokenExpiring.init(n)}else r.Log.debug("AccessTokenEvents.load: canceling existing expiring timer becase we're past expiration."),this._accessTokenExpiring.cancel();var i=t+1;r.Log.debug("AccessTokenEvents.load: registering expired timer in:",i),this._accessTokenExpired.init(i)}else this._accessTokenExpiring.cancel(),this._accessTokenExpired.cancel()},e.prototype.unload=function(){r.Log.debug("AccessTokenEvents.unload: canceling existing access token timers"),this._accessTokenExpiring.cancel(),this._accessTokenExpired.cancel()},e.prototype.addAccessTokenExpiring=function(e){this._accessTokenExpiring.addHandler(e)},e.prototype.removeAccessTokenExpiring=function(e){this._accessTokenExpiring.removeHandler(e)},e.prototype.addAccessTokenExpired=function(e){this._accessTokenExpired.addHandler(e)},e.prototype.removeAccessTokenExpired=function(e){this._accessTokenExpired.removeHandler(e)},e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Event=void 0;var r=n(0);t.Event=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._name=t,this._callbacks=[]}return e.prototype.addHandler=function(e){this._callbacks.push(e)},e.prototype.removeHandler=function(e){var t=this._callbacks.findIndex((function(t){return t===e}));t>=0&&this._callbacks.splice(t,1)},e.prototype.raise=function(){r.Log.debug("Event: Raising event: "+this._name);for(var e=0;e<this._callbacks.length;e++){var t;(t=this._callbacks)[e].apply(t,arguments)}},e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SessionMonitor=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),o=n(19),a=n(1);function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.SessionMonitor=function(){function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.CheckSessionIFrame,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.Global.timer;if(s(this,e),!t)throw i.Log.error("SessionMonitor.ctor: No user manager passed to SessionMonitor"),new Error("userManager");this._userManager=t,this._CheckSessionIFrameCtor=r,this._timer=c,this._userManager.events.addUserLoaded(this._start.bind(this)),this._userManager.events.addUserUnloaded(this._stop.bind(this)),Promise.resolve(this._userManager.getUser().then((function(e){e?n._start(e):n._settings.monitorAnonymousSession&&n._userManager.querySessionStatus().then((function(e){var t={session_state:e.session_state};e.sub&&e.sid&&(t.profile={sub:e.sub,sid:e.sid}),n._start(t)})).catch((function(e){i.Log.error("SessionMonitor ctor: error from querySessionStatus:",e.message)}))})).catch((function(e){i.Log.error("SessionMonitor ctor: error from getUser:",e.message)})))}return e.prototype._start=function(e){var t=this,n=e.session_state;n&&(e.profile?(this._sub=e.profile.sub,this._sid=e.profile.sid,i.Log.debug("SessionMonitor._start: session_state:",n,", sub:",this._sub)):(this._sub=void 0,this._sid=void 0,i.Log.debug("SessionMonitor._start: session_state:",n,", anonymous user")),this._checkSessionIFrame?this._checkSessionIFrame.start(n):this._metadataService.getCheckSessionIframe().then((function(e){if(e){i.Log.debug("SessionMonitor._start: Initializing check session iframe");var r=t._client_id,o=t._checkSessionInterval,a=t._stopCheckSessionOnError;t._checkSessionIFrame=new t._CheckSessionIFrameCtor(t._callback.bind(t),r,e,o,a),t._checkSessionIFrame.load().then((function(){t._checkSessionIFrame.start(n)}))}else i.Log.warn("SessionMonitor._start: No check session iframe found in the metadata")})).catch((function(e){i.Log.error("SessionMonitor._start: Error from getCheckSessionIframe:",e.message)})))},e.prototype._stop=function(){var e=this;if(this._sub=void 0,this._sid=void 0,this._checkSessionIFrame&&(i.Log.debug("SessionMonitor._stop"),this._checkSessionIFrame.stop()),this._settings.monitorAnonymousSession)var t=this._timer.setInterval((function(){e._timer.clearInterval(t),e._userManager.querySessionStatus().then((function(t){var n={session_state:t.session_state};t.sub&&t.sid&&(n.profile={sub:t.sub,sid:t.sid}),e._start(n)})).catch((function(e){i.Log.error("SessionMonitor: error from querySessionStatus:",e.message)}))}),1e3)},e.prototype._callback=function(){var e=this;this._userManager.querySessionStatus().then((function(t){var n=!0;t?t.sub===e._sub?(n=!1,e._checkSessionIFrame.start(t.session_state),t.sid===e._sid?i.Log.debug("SessionMonitor._callback: Same sub still logged in at OP, restarting check session iframe; session_state:",t.session_state):(i.Log.debug("SessionMonitor._callback: Same sub still logged in at OP, session state has changed, restarting check session iframe; session_state:",t.session_state),e._userManager.events._raiseUserSessionChanged())):i.Log.debug("SessionMonitor._callback: Different subject signed into OP:",t.sub):i.Log.debug("SessionMonitor._callback: Subject no longer signed into OP"),n&&(e._sub?(i.Log.debug("SessionMonitor._callback: SessionMonitor._callback; raising signed out event"),e._userManager.events._raiseUserSignedOut()):(i.Log.debug("SessionMonitor._callback: SessionMonitor._callback; raising signed in event"),e._userManager.events._raiseUserSignedIn()))})).catch((function(t){e._sub&&(i.Log.debug("SessionMonitor._callback: Error calling queryCurrentSigninSession; raising signed out event",t.message),e._userManager.events._raiseUserSignedOut())}))},r(e,[{key:"_settings",get:function(){return this._userManager.settings}},{key:"_metadataService",get:function(){return this._userManager.metadataService}},{key:"_client_id",get:function(){return this._settings.client_id}},{key:"_checkSessionInterval",get:function(){return this._settings.checkSessionInterval}},{key:"_stopCheckSessionOnError",get:function(){return this._settings.stopCheckSessionOnError}}]),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CheckSessionIFrame=void 0;var r=n(0);function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.CheckSessionIFrame=function(){function e(t,n,r,o){var a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];i(this,e),this._callback=t,this._client_id=n,this._url=r,this._interval=o||2e3,this._stopOnError=a;var s=r.indexOf("/",r.indexOf("//")+2);this._frame_origin=r.substr(0,s),this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="absolute",this._frame.style.display="none",this._frame.width=0,this._frame.height=0,this._frame.src=r}return e.prototype.load=function(){var e=this;return new Promise((function(t){e._frame.onload=function(){t()},window.document.body.appendChild(e._frame),e._boundMessageEvent=e._message.bind(e),window.addEventListener("message",e._boundMessageEvent,!1)}))},e.prototype._message=function(e){e.origin===this._frame_origin&&e.source===this._frame.contentWindow&&("error"===e.data?(r.Log.error("CheckSessionIFrame: error message from check session op iframe"),this._stopOnError&&this.stop()):"changed"===e.data?(r.Log.debug("CheckSessionIFrame: changed message from check session op iframe"),this.stop(),this._callback()):r.Log.debug("CheckSessionIFrame: "+e.data+" message from check session op iframe"))},e.prototype.start=function(e){var t=this;if(this._session_state!==e){r.Log.debug("CheckSessionIFrame.start"),this.stop(),this._session_state=e;var n=function(){t._frame.contentWindow.postMessage(t._client_id+" "+t._session_state,t._frame_origin)};n(),this._timer=window.setInterval(n,this._interval)}},e.prototype.stop=function(){this._session_state=null,this._timer&&(r.Log.debug("CheckSessionIFrame.stop"),window.clearInterval(this._timer),this._timer=null)},e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenRevocationClient=void 0;var r=n(0),i=n(2),o=n(1);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s="access_token",c="refresh_token";t.TokenRevocationClient=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.Global.XMLHttpRequest,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.MetadataService;if(a(this,e),!t)throw r.Log.error("TokenRevocationClient.ctor: No settings provided"),new Error("No settings provided.");this._settings=t,this._XMLHttpRequestCtor=n,this._metadataService=new s(this._settings)}return e.prototype.revoke=function(e,t){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"access_token";if(!e)throw r.Log.error("TokenRevocationClient.revoke: No token provided"),new Error("No token provided.");if(i!==s&&i!=c)throw r.Log.error("TokenRevocationClient.revoke: Invalid token type"),new Error("Invalid token type.");return this._metadataService.getRevocationEndpoint().then((function(o){if(o){r.Log.debug("TokenRevocationClient.revoke: Revoking "+i);var a=n._settings.client_id,s=n._settings.client_secret;return n._revoke(o,a,s,e,i)}if(t)throw r.Log.error("TokenRevocationClient.revoke: Revocation not supported"),new Error("Revocation not supported")}))},e.prototype._revoke=function(e,t,n,i,o){var a=this;return new Promise((function(s,c){var u=new a._XMLHttpRequestCtor;u.open("POST",e),u.onload=function(){r.Log.debug("TokenRevocationClient.revoke: HTTP response received, status",u.status),200===u.status?s():c(Error(u.statusText+" ("+u.status+")"))},u.onerror=function(){r.Log.debug("TokenRevocationClient.revoke: Network Error."),c("Network Error")};var l="client_id="+encodeURIComponent(t);n&&(l+="&client_secret="+encodeURIComponent(n)),l+="&token_type_hint="+encodeURIComponent(o),l+="&token="+encodeURIComponent(i),u.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),u.send(l)}))},e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CordovaPopupWindow=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0);t.CordovaPopupWindow=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._promise=new Promise((function(e,t){n._resolve=e,n._reject=t})),this.features=t.popupWindowFeatures||"location=no,toolbar=no,zoom=no",this.target=t.popupWindowTarget||"_blank",this.redirect_uri=t.startUrl,i.Log.debug("CordovaPopupWindow.ctor: redirect_uri: "+this.redirect_uri)}return e.prototype._isInAppBrowserInstalled=function(e){return["cordova-plugin-inappbrowser","cordova-plugin-inappbrowser.inappbrowser","org.apache.cordova.inappbrowser"].some((function(t){return e.hasOwnProperty(t)}))},e.prototype.navigate=function(e){if(e&&e.url){if(!window.cordova)return this._error("cordova is undefined");var t=window.cordova.require("cordova/plugin_list").metadata;if(!1===this._isInAppBrowserInstalled(t))return this._error("InAppBrowser plugin not found");this._popup=cordova.InAppBrowser.open(e.url,this.target,this.features),this._popup?(i.Log.debug("CordovaPopupWindow.navigate: popup successfully created"),this._exitCallbackEvent=this._exitCallback.bind(this),this._loadStartCallbackEvent=this._loadStartCallback.bind(this),this._popup.addEventListener("exit",this._exitCallbackEvent,!1),this._popup.addEventListener("loadstart",this._loadStartCallbackEvent,!1)):this._error("Error opening popup window")}else this._error("No url provided");return this.promise},e.prototype._loadStartCallback=function(e){0===e.url.indexOf(this.redirect_uri)&&this._success({url:e.url})},e.prototype._exitCallback=function(e){this._error(e)},e.prototype._success=function(e){this._cleanup(),i.Log.debug("CordovaPopupWindow: Successful response from cordova popup window"),this._resolve(e)},e.prototype._error=function(e){this._cleanup(),i.Log.error(e),this._reject(new Error(e))},e.prototype.close=function(){this._cleanup()},e.prototype._cleanup=function(){this._popup&&(i.Log.debug("CordovaPopupWindow: cleaning up popup"),this._popup.removeEventListener("exit",this._exitCallbackEvent,!1),this._popup.removeEventListener("loadstart",this._loadStartCallbackEvent,!1),this._popup.close()),this._popup=null},r(e,[{key:"promise",get:function(){return this._promise}}]),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(10),o=n(5),a=n(6),s=n(37),c=n(38),u=n(16),l=n(2),d=n(48),p=n(49),f=n(19),h=n(20),m=n(18),g=n(1),v=n(15),y=n(50);t.default={Version:y.Version,Log:r.Log,OidcClient:i.OidcClient,OidcClientSettings:o.OidcClientSettings,WebStorageStateStore:a.WebStorageStateStore,InMemoryWebStorage:s.InMemoryWebStorage,UserManager:c.UserManager,AccessTokenEvents:u.AccessTokenEvents,MetadataService:l.MetadataService,CordovaPopupNavigator:d.CordovaPopupNavigator,CordovaIFrameNavigator:p.CordovaIFrameNavigator,CheckSessionIFrame:f.CheckSessionIFrame,TokenRevocationClient:h.TokenRevocationClient,SessionMonitor:m.SessionMonitor,Global:g.Global,User:v.User},e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ClockService=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.prototype.getEpochTime=function(){return Promise.resolve(Date.now()/1e3|0)},e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResponseValidator=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=n(0),o=n(2),a=n(25),s=n(11),c=n(12),u=n(4);function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var d=["nonce","at_hash","iat","nbf","exp","aud","iss","c_hash"];t.ResponseValidator=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.MetadataService,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.UserInfoService,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:u.JoseUtil,d=arguments.length>4&&void 0!==arguments[4]?arguments[4]:s.TokenClient;if(l(this,e),!t)throw i.Log.error("ResponseValidator.ctor: No settings passed to ResponseValidator"),new Error("settings");this._settings=t,this._metadataService=new n(this._settings),this._userInfoService=new r(this._settings),this._joseUtil=c,this._tokenClient=new d(this._settings)}return e.prototype.validateSigninResponse=function(e,t){var n=this;return i.Log.debug("ResponseValidator.validateSigninResponse"),this._processSigninParams(e,t).then((function(t){return i.Log.debug("ResponseValidator.validateSigninResponse: state processed"),n._validateTokens(e,t).then((function(t){return i.Log.debug("ResponseValidator.validateSigninResponse: tokens validated"),n._processClaims(e,t).then((function(e){return i.Log.debug("ResponseValidator.validateSigninResponse: claims processed"),e}))}))}))},e.prototype.validateSignoutResponse=function(e,t){return e.id!==t.state?(i.Log.error("ResponseValidator.validateSignoutResponse: State does not match"),Promise.reject(new Error("State does not match"))):(i.Log.debug("ResponseValidator.validateSignoutResponse: state validated"),t.state=e.data,t.error?(i.Log.warn("ResponseValidator.validateSignoutResponse: Response was error",t.error),Promise.reject(new c.ErrorResponse(t))):Promise.resolve(t))},e.prototype._processSigninParams=function(e,t){if(e.id!==t.state)return i.Log.error("ResponseValidator._processSigninParams: State does not match"),Promise.reject(new Error("State does not match"));if(!e.client_id)return i.Log.error("ResponseValidator._processSigninParams: No client_id on state"),Promise.reject(new Error("No client_id on state"));if(!e.authority)return i.Log.error("ResponseValidator._processSigninParams: No authority on state"),Promise.reject(new Error("No authority on state"));if(this._settings.authority){if(this._settings.authority&&this._settings.authority!==e.authority)return i.Log.error("ResponseValidator._processSigninParams: authority mismatch on settings vs. signin state"),Promise.reject(new Error("authority mismatch on settings vs. signin state"))}else this._settings.authority=e.authority;if(this._settings.client_id){if(this._settings.client_id&&this._settings.client_id!==e.client_id)return i.Log.error("ResponseValidator._processSigninParams: client_id mismatch on settings vs. signin state"),Promise.reject(new Error("client_id mismatch on settings vs. signin state"))}else this._settings.client_id=e.client_id;return i.Log.debug("ResponseValidator._processSigninParams: state validated"),t.state=e.data,t.error?(i.Log.warn("ResponseValidator._processSigninParams: Response was error",t.error),Promise.reject(new c.ErrorResponse(t))):e.nonce&&!t.id_token?(i.Log.error("ResponseValidator._processSigninParams: Expecting id_token in response"),Promise.reject(new Error("No id_token in response"))):!e.nonce&&t.id_token?(i.Log.error("ResponseValidator._processSigninParams: Not expecting id_token in response"),Promise.reject(new Error("Unexpected id_token in response"))):e.code_verifier&&!t.code?(i.Log.error("ResponseValidator._processSigninParams: Expecting code in response"),Promise.reject(new Error("No code in response"))):!e.code_verifier&&t.code?(i.Log.error("ResponseValidator._processSigninParams: Not expecting code in response"),Promise.reject(new Error("Unexpected code in response"))):(t.scope||(t.scope=e.scope),Promise.resolve(t))},e.prototype._processClaims=function(e,t){var n=this;if(t.isOpenIdConnect){if(i.Log.debug("ResponseValidator._processClaims: response is OIDC, processing claims"),t.profile=this._filterProtocolClaims(t.profile),!0!==e.skipUserInfo&&this._settings.loadUserInfo&&t.access_token)return i.Log.debug("ResponseValidator._processClaims: loading user info"),this._userInfoService.getClaims(t.access_token).then((function(e){return i.Log.debug("ResponseValidator._processClaims: user info claims received from user info endpoint"),e.sub!==t.profile.sub?(i.Log.error("ResponseValidator._processClaims: sub from user info endpoint does not match sub in id_token"),Promise.reject(new Error("sub from user info endpoint does not match sub in id_token"))):(t.profile=n._mergeClaims(t.profile,e),i.Log.debug("ResponseValidator._processClaims: user info claims received, updated profile:",t.profile),t)}));i.Log.debug("ResponseValidator._processClaims: not loading user info")}else i.Log.debug("ResponseValidator._processClaims: response is not OIDC, not processing claims");return Promise.resolve(t)},e.prototype._mergeClaims=function(e,t){var n=Object.assign({},e);for(var i in t){var o=t[i];Array.isArray(o)||(o=[o]);for(var a=0;a<o.length;a++){var s=o[a];n[i]?Array.isArray(n[i])?n[i].indexOf(s)<0&&n[i].push(s):n[i]!==s&&("object"===(void 0===s?"undefined":r(s))&&this._settings.mergeClaims?n[i]=this._mergeClaims(n[i],s):n[i]=[n[i],s]):n[i]=s}}return n},e.prototype._filterProtocolClaims=function(e){i.Log.debug("ResponseValidator._filterProtocolClaims, incoming claims:",e);var t=Object.assign({},e);return this._settings._filterProtocolClaims?(d.forEach((function(e){delete t[e]})),i.Log.debug("ResponseValidator._filterProtocolClaims: protocol claims filtered",t)):i.Log.debug("ResponseValidator._filterProtocolClaims: protocol claims not filtered"),t},e.prototype._validateTokens=function(e,t){return t.code?(i.Log.debug("ResponseValidator._validateTokens: Validating code"),this._processCode(e,t)):t.id_token?t.access_token?(i.Log.debug("ResponseValidator._validateTokens: Validating id_token and access_token"),this._validateIdTokenAndAccessToken(e,t)):(i.Log.debug("ResponseValidator._validateTokens: Validating id_token"),this._validateIdToken(e,t)):(i.Log.debug("ResponseValidator._validateTokens: No code to process or id_token to validate"),Promise.resolve(t))},e.prototype._processCode=function(e,t){var n=this,o={client_id:e.client_id,client_secret:e.client_secret,code:t.code,redirect_uri:e.redirect_uri,code_verifier:e.code_verifier};return e.extraTokenParams&&"object"===r(e.extraTokenParams)&&Object.assign(o,e.extraTokenParams),this._tokenClient.exchangeCode(o).then((function(r){for(var o in r)t[o]=r[o];return t.id_token?(i.Log.debug("ResponseValidator._processCode: token response successful, processing id_token"),n._validateIdTokenAttributes(e,t)):(i.Log.debug("ResponseValidator._processCode: token response successful, returning response"),t)}))},e.prototype._validateIdTokenAttributes=function(e,t){var n=this;return this._metadataService.getIssuer().then((function(r){var o=e.client_id,a=n._settings.clockSkew;return i.Log.debug("ResponseValidator._validateIdTokenAttributes: Validaing JWT attributes; using clock skew (in seconds) of: ",a),n._settings.getEpochTime().then((function(s){return n._joseUtil.validateJwtAttributes(t.id_token,r,o,a,s).then((function(n){return e.nonce&&e.nonce!==n.nonce?(i.Log.error("ResponseValidator._validateIdTokenAttributes: Invalid nonce in id_token"),Promise.reject(new Error("Invalid nonce in id_token"))):n.sub?(t.profile=n,t):(i.Log.error("ResponseValidator._validateIdTokenAttributes: No sub present in id_token"),Promise.reject(new Error("No sub present in id_token")))}))}))}))},e.prototype._validateIdTokenAndAccessToken=function(e,t){var n=this;return this._validateIdToken(e,t).then((function(e){return n._validateAccessToken(e)}))},e.prototype._getSigningKeyForJwt=function(e){var t=this;return this._metadataService.getSigningKeys().then((function(n){var r=e.header.kid;if(!n)return i.Log.error("ResponseValidator._validateIdToken: No signing keys from metadata"),Promise.reject(new Error("No signing keys from metadata"));i.Log.debug("ResponseValidator._validateIdToken: Received signing keys");var o=void 0;if(r)o=n.filter((function(e){return e.kid===r}))[0];else{if((n=t._filterByAlg(n,e.header.alg)).length>1)return i.Log.error("ResponseValidator._validateIdToken: No kid found in id_token and more than one key found in metadata"),Promise.reject(new Error("No kid found in id_token and more than one key found in metadata"));o=n[0]}return Promise.resolve(o)}))},e.prototype._getSigningKeyForJwtWithSingleRetry=function(e){var t=this;return this._getSigningKeyForJwt(e).then((function(n){return n?Promise.resolve(n):(t._metadataService.resetSigningKeys(),t._getSigningKeyForJwt(e))}))},e.prototype._validateIdToken=function(e,t){var n=this;if(!e.nonce)return i.Log.error("ResponseValidator._validateIdToken: No nonce on state"),Promise.reject(new Error("No nonce on state"));var r=this._joseUtil.parseJwt(t.id_token);return r&&r.header&&r.payload?e.nonce!==r.payload.nonce?(i.Log.error("ResponseValidator._validateIdToken: Invalid nonce in id_token"),Promise.reject(new Error("Invalid nonce in id_token"))):this._metadataService.getIssuer().then((function(o){return i.Log.debug("ResponseValidator._validateIdToken: Received issuer"),n._getSigningKeyForJwtWithSingleRetry(r).then((function(a){if(!a)return i.Log.error("ResponseValidator._validateIdToken: No key matching kid or alg found in signing keys"),Promise.reject(new Error("No key matching kid or alg found in signing keys"));var s=e.client_id,c=n._settings.clockSkew;return i.Log.debug("ResponseValidator._validateIdToken: Validaing JWT; using clock skew (in seconds) of: ",c),n._joseUtil.validateJwt(t.id_token,a,o,s,c).then((function(){return i.Log.debug("ResponseValidator._validateIdToken: JWT validation successful"),r.payload.sub?(t.profile=r.payload,t):(i.Log.error("ResponseValidator._validateIdToken: No sub present in id_token"),Promise.reject(new Error("No sub present in id_token")))}))}))})):(i.Log.error("ResponseValidator._validateIdToken: Failed to parse id_token",r),Promise.reject(new Error("Failed to parse id_token")))},e.prototype._filterByAlg=function(e,t){var n=null;if(t.startsWith("RS"))n="RSA";else if(t.startsWith("PS"))n="PS";else{if(!t.startsWith("ES"))return i.Log.debug("ResponseValidator._filterByAlg: alg not supported: ",t),[];n="EC"}return i.Log.debug("ResponseValidator._filterByAlg: Looking for keys that match kty: ",n),e=e.filter((function(e){return e.kty===n})),i.Log.debug("ResponseValidator._filterByAlg: Number of keys that match kty: ",n,e.length),e},e.prototype._validateAccessToken=function(e){if(!e.profile)return i.Log.error("ResponseValidator._validateAccessToken: No profile loaded from id_token"),Promise.reject(new Error("No profile loaded from id_token"));if(!e.profile.at_hash)return i.Log.error("ResponseValidator._validateAccessToken: No at_hash in id_token"),Promise.reject(new Error("No at_hash in id_token"));if(!e.id_token)return i.Log.error("ResponseValidator._validateAccessToken: No id_token"),Promise.reject(new Error("No id_token"));var t=this._joseUtil.parseJwt(e.id_token);if(!t||!t.header)return i.Log.error("ResponseValidator._validateAccessToken: Failed to parse id_token",t),Promise.reject(new Error("Failed to parse id_token"));var n=t.header.alg;if(!n||5!==n.length)return i.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",n),Promise.reject(new Error("Unsupported alg: "+n));var r=n.substr(2,3);if(!r)return i.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",n,r),Promise.reject(new Error("Unsupported alg: "+n));if(256!==(r=parseInt(r))&&384!==r&&512!==r)return i.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",n,r),Promise.reject(new Error("Unsupported alg: "+n));var o="sha"+r,a=this._joseUtil.hashString(e.access_token,o);if(!a)return i.Log.error("ResponseValidator._validateAccessToken: access_token hash failed:",o),Promise.reject(new Error("Failed to validate at_hash"));var s=a.substr(0,a.length/2),c=this._joseUtil.hexToBase64Url(s);return c!==e.profile.at_hash?(i.Log.error("ResponseValidator._validateAccessToken: Failed to validate at_hash",c,e.profile.at_hash),Promise.reject(new Error("Failed to validate at_hash"))):(i.Log.debug("ResponseValidator._validateAccessToken: success"),Promise.resolve(e))},e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UserInfoService=void 0;var r=n(7),i=n(2),o=n(0),a=n(4);function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.UserInfoService=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.JsonService,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.MetadataService,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a.JoseUtil;if(s(this,e),!t)throw o.Log.error("UserInfoService.ctor: No settings passed"),new Error("settings");this._settings=t,this._jsonService=new n(void 0,void 0,this._getClaimsFromJwt.bind(this)),this._metadataService=new c(this._settings),this._joseUtil=u}return e.prototype.getClaims=function(e){var t=this;return e?this._metadataService.getUserInfoEndpoint().then((function(n){return o.Log.debug("UserInfoService.getClaims: received userinfo url",n),t._jsonService.getJson(n,e).then((function(e){return o.Log.debug("UserInfoService.getClaims: claims received",e),e}))})):(o.Log.error("UserInfoService.getClaims: No token passed"),Promise.reject(new Error("A token is required")))},e.prototype._getClaimsFromJwt=function e(t){var n=this;try{var r=this._joseUtil.parseJwt(t.responseText);if(!r||!r.header||!r.payload)return o.Log.error("UserInfoService._getClaimsFromJwt: Failed to parse JWT",r),Promise.reject(new Error("Failed to parse id_token"));var i=r.header.kid,a=void 0;switch(this._settings.userInfoJwtIssuer){case"OP":a=this._metadataService.getIssuer();break;case"ANY":a=Promise.resolve(r.payload.iss);break;default:a=Promise.resolve(this._settings.userInfoJwtIssuer)}return a.then((function(e){return o.Log.debug("UserInfoService._getClaimsFromJwt: Received issuer:"+e),n._metadataService.getSigningKeys().then((function(a){if(!a)return o.Log.error("UserInfoService._getClaimsFromJwt: No signing keys from metadata"),Promise.reject(new Error("No signing keys from metadata"));o.Log.debug("UserInfoService._getClaimsFromJwt: Received signing keys");var s=void 0;if(i)s=a.filter((function(e){return e.kid===i}))[0];else{if((a=n._filterByAlg(a,r.header.alg)).length>1)return o.Log.error("UserInfoService._getClaimsFromJwt: No kid found in id_token and more than one key found in metadata"),Promise.reject(new Error("No kid found in id_token and more than one key found in metadata"));s=a[0]}if(!s)return o.Log.error("UserInfoService._getClaimsFromJwt: No key matching kid or alg found in signing keys"),Promise.reject(new Error("No key matching kid or alg found in signing keys"));var c=n._settings.client_id,u=n._settings.clockSkew;return o.Log.debug("UserInfoService._getClaimsFromJwt: Validaing JWT; using clock skew (in seconds) of: ",u),n._joseUtil.validateJwt(t.responseText,s,e,c,u,void 0,!0).then((function(){return o.Log.debug("UserInfoService._getClaimsFromJwt: JWT validation successful"),r.payload}))}))}))}catch(e){return o.Log.error("UserInfoService._getClaimsFromJwt: Error parsing JWT response",e.message),void reject(e)}},e.prototype._filterByAlg=function(e,t){var n=null;if(t.startsWith("RS"))n="RSA";else if(t.startsWith("PS"))n="PS";else{if(!t.startsWith("ES"))return o.Log.debug("UserInfoService._filterByAlg: alg not supported: ",t),[];n="EC"}return o.Log.debug("UserInfoService._filterByAlg: Looking for keys that match kty: ",n),e=e.filter((function(e){return e.kty===n})),o.Log.debug("UserInfoService._filterByAlg: Number of keys that match kty: ",n,e.length),e},e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AllowedSigningAlgs=t.b64tohex=t.hextob64u=t.crypto=t.X509=t.KeyUtil=t.jws=void 0;var r=n(27);t.jws=r.jws,t.KeyUtil=r.KEYUTIL,t.X509=r.X509,t.crypto=r.crypto,t.hextob64u=r.hextob64u,t.b64tohex=r.b64tohex,t.AllowedSigningAlgs=["RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"]},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n,r,i,o,a,s,c,u,l,d,p,f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h={userAgent:!1},m={},g=g||(n=Math,i=(r={}).lib={},o=i.Base=function(){function e(){}return{extend:function(t){e.prototype=this;var n=new e;return t&&n.mixIn(t),n.hasOwnProperty("init")||(n.init=function(){n.$super.init.apply(this,arguments)}),n.init.prototype=n,n.$super=this,n},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),a=i.WordArray=o.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||c).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var o=0;o<i;o++){var a=n[o>>>2]>>>24-o%4*8&255;t[r+o>>>2]|=a<<24-(r+o)%4*8}else for(o=0;o<i;o+=4)t[r+o>>>2]=n[o>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,t=this.sigBytes;e[t>>>2]&=4294967295<<32-t%4*8,e.length=n.ceil(t/4)},clone:function(){var e=o.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r<e;r+=4)t.push(4294967296*n.random()|0);return new a.init(t,e)}}),s=r.enc={},c=s.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new a.init(n,t/2)}},u=s.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new a.init(n,t)}},l=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},d=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var t=this._data,r=t.words,i=t.sigBytes,o=this.blockSize,s=i/(4*o),c=(s=e?n.ceil(s):n.max((0|s)-this._minBufferSize,0))*o,u=n.min(4*c,i);if(c){for(var l=0;l<c;l+=o)this._doProcessBlock(r,l);var d=r.splice(0,c);t.sigBytes-=u}return new a.init(d,u)},clone:function(){var e=o.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),i.Hasher=d.extend({cfg:o.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new p.HMAC.init(e,n).finalize(t)}}}),p=r.algo={},r);!function(e){var t,n=(t=g).lib,r=n.Base,i=n.WordArray;(t=t.x64={}).Word=r.extend({init:function(e,t){this.high=e,this.low=t}}),t.WordArray=r.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,n=[],r=0;r<t;r++){var o=e[r];n.push(o.high),n.push(o.low)}return i.create(n,this.sigBytes)},clone:function(){for(var e=r.clone.call(this),t=e.words=this.words.slice(0),n=t.length,i=0;i<n;i++)t[i]=t[i].clone();return e}})}(),function(){var e=g,t=e.lib.WordArray;e.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp(),e=[];for(var i=0;i<n;i+=3)for(var o=(t[i>>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,a=0;4>a&&i+.75*a<n;a++)e.push(r.charAt(o>>>6*(3-a)&63));if(t=r.charAt(64))for(;e.length%4;)e.push(t);return e.join("")},parse:function(e){var n=e.length,r=this._map;(i=r.charAt(64))&&-1!=(i=e.indexOf(i))&&(n=i);for(var i=[],o=0,a=0;a<n;a++)if(a%4){var s=r.indexOf(e.charAt(a-1))<<a%4*2,c=r.indexOf(e.charAt(a))>>>6-a%4*2;i[o>>>2]|=(s|c)<<24-o%4*8,o++}return t.create(i,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(e){for(var t=g,n=(i=t.lib).WordArray,r=i.Hasher,i=t.algo,o=[],a=[],s=function(e){return 4294967296*(e-(0|e))|0},c=2,u=0;64>u;){var l;e:{l=c;for(var d=e.sqrt(l),p=2;p<=d;p++)if(!(l%p)){l=!1;break e}l=!0}l&&(8>u&&(o[u]=s(e.pow(c,.5))),a[u]=s(e.pow(c,1/3)),u++),c++}var f=[];i=i.SHA256=r.extend({_doReset:function(){this._hash=new n.init(o.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],s=n[3],c=n[4],u=n[5],l=n[6],d=n[7],p=0;64>p;p++){if(16>p)f[p]=0|e[t+p];else{var h=f[p-15],m=f[p-2];f[p]=((h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3)+f[p-7]+((m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10)+f[p-16]}h=d+((c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25))+(c&u^~c&l)+a[p]+f[p],m=((r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22))+(r&i^r&o^i&o),d=l,l=u,u=c,c=s+h|0,s=o,o=i,i=r,r=h+m|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+s|0,n[4]=n[4]+c|0,n[5]=n[5]+u|0,n[6]=n[6]+l|0,n[7]=n[7]+d|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=e.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}}),t.SHA256=r._createHelper(i),t.HmacSHA256=r._createHmacHelper(i)}(Math),function(){function e(){return r.create.apply(r,arguments)}for(var t=g,n=t.lib.Hasher,r=(o=t.x64).Word,i=o.WordArray,o=t.algo,a=[e(1116352408,3609767458),e(1899447441,602891725),e(3049323471,3964484399),e(3921009573,2173295548),e(961987163,4081628472),e(1508970993,3053834265),e(2453635748,2937671579),e(2870763221,3664609560),e(3624381080,2734883394),e(310598401,1164996542),e(607225278,1323610764),e(1426881987,3590304994),e(1925078388,4068182383),e(2162078206,991336113),e(2614888103,633803317),e(3248222580,3479774868),e(3835390401,2666613458),e(4022224774,944711139),e(264347078,2341262773),e(604807628,2007800933),e(770255983,1495990901),e(1249150122,1856431235),e(1555081692,3175218132),e(1996064986,2198950837),e(2554220882,3999719339),e(2821834349,766784016),e(2952996808,2566594879),e(3210313671,3203337956),e(3336571891,1034457026),e(3584528711,2466948901),e(113926993,3758326383),e(338241895,168717936),e(666307205,1188179964),e(773529912,1546045734),e(1294757372,1522805485),e(1396182291,2643833823),e(1695183700,2343527390),e(1986661051,1014477480),e(2177026350,1206759142),e(2456956037,344077627),e(2730485921,1290863460),e(2820302411,3158454273),e(3259730800,3505952657),e(3345764771,106217008),e(3516065817,3606008344),e(3600352804,1432725776),e(4094571909,1467031594),e(275423344,851169720),e(430227734,3100823752),e(506948616,1363258195),e(659060556,3750685593),e(883997877,3785050280),e(958139571,3318307427),e(1322822218,3812723403),e(1537002063,2003034995),e(1747873779,3602036899),e(1955562222,1575990012),e(2024104815,1125592928),e(2227730452,2716904306),e(2361852424,442776044),e(2428436474,593698344),e(2756734187,3733110249),e(3204031479,2999351573),e(3329325298,3815920427),e(3391569614,3928383900),e(3515267271,566280711),e(3940187606,3454069534),e(4118630271,4000239992),e(116418474,1914138554),e(174292421,2731055270),e(289380356,3203993006),e(460393269,320620315),e(685471733,587496836),e(852142971,1086792851),e(1017036298,365543100),e(1126000580,2618297676),e(1288033470,3409855158),e(1501505948,4234509866),e(1607167915,987167468),e(1816402316,1246189591)],s=[],c=0;80>c;c++)s[c]=e();o=o.SHA512=n.extend({_doReset:function(){this._hash=new i.init([new r.init(1779033703,4089235720),new r.init(3144134277,2227873595),new r.init(1013904242,4271175723),new r.init(2773480762,1595750129),new r.init(1359893119,2917565137),new r.init(2600822924,725511199),new r.init(528734635,4215389547),new r.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var n=(d=this._hash.words)[0],r=d[1],i=d[2],o=d[3],c=d[4],u=d[5],l=d[6],d=d[7],p=n.high,f=n.low,h=r.high,m=r.low,g=i.high,v=i.low,y=o.high,b=o.low,w=c.high,x=c.low,_=u.high,E=u.low,k=l.high,S=l.low,C=d.high,A=d.low,T=p,O=f,P=h,I=m,j=g,N=v,F=y,R=b,L=w,D=x,M=_,U=E,B=k,H=S,q=C,W=A,K=0;80>K;K++){var V=s[K];if(16>K)var J=V.high=0|e[t+2*K],z=V.low=0|e[t+2*K+1];else{J=((z=(J=s[K-15]).high)>>>1|(Z=J.low)<<31)^(z>>>8|Z<<24)^z>>>7;var Z=(Z>>>1|z<<31)^(Z>>>8|z<<24)^(Z>>>7|z<<25),$=((z=($=s[K-2]).high)>>>19|(G=$.low)<<13)^(z<<3|G>>>29)^z>>>6,G=(G>>>19|z<<13)^(G<<3|z>>>29)^(G>>>6|z<<26),X=(z=s[K-7]).high,Q=(Y=s[K-16]).high,Y=Y.low;J=(J=(J=J+X+((z=Z+z.low)>>>0<Z>>>0?1:0))+$+((z+=G)>>>0<G>>>0?1:0))+Q+((z+=Y)>>>0<Y>>>0?1:0),V.high=J,V.low=z}X=L&M^~L&B,Y=D&U^~D&H,V=T&P^T&j^P&j;var ee=O&I^O&N^I&N,te=(Z=(T>>>28|O<<4)^(T<<30|O>>>2)^(T<<25|O>>>7),$=(O>>>28|T<<4)^(O<<30|T>>>2)^(O<<25|T>>>7),(G=a[K]).high),ne=G.low;Q=q+((L>>>14|D<<18)^(L>>>18|D<<14)^(L<<23|D>>>9))+((G=W+((D>>>14|L<<18)^(D>>>18|L<<14)^(D<<23|L>>>9)))>>>0<W>>>0?1:0),q=B,W=H,B=M,H=U,M=L,U=D,L=F+(Q=(Q=(Q=Q+X+((G+=Y)>>>0<Y>>>0?1:0))+te+((G+=ne)>>>0<ne>>>0?1:0))+J+((G+=z)>>>0<z>>>0?1:0))+((D=R+G|0)>>>0<R>>>0?1:0)|0,F=j,R=N,j=P,N=I,P=T,I=O,T=Q+(V=Z+V+((z=$+ee)>>>0<$>>>0?1:0))+((O=G+z|0)>>>0<G>>>0?1:0)|0}f=n.low=f+O,n.high=p+T+(f>>>0<O>>>0?1:0),m=r.low=m+I,r.high=h+P+(m>>>0<I>>>0?1:0),v=i.low=v+N,i.high=g+j+(v>>>0<N>>>0?1:0),b=o.low=b+R,o.high=y+F+(b>>>0<R>>>0?1:0),x=c.low=x+D,c.high=w+L+(x>>>0<D>>>0?1:0),E=u.low=E+U,u.high=_+M+(E>>>0<U>>>0?1:0),S=l.low=S+H,l.high=k+B+(S>>>0<H>>>0?1:0),A=d.low=A+W,d.high=C+q+(A>>>0<W>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),t[31+(r+128>>>10<<5)]=n,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32}),t.SHA512=n._createHelper(o),t.HmacSHA512=n._createHmacHelper(o)}(),function(){var e=g,t=(i=e.x64).Word,n=i.WordArray,r=(i=e.algo).SHA512,i=i.SHA384=r.extend({_doReset:function(){this._hash=new n.init([new t.init(3418070365,3238371032),new t.init(1654270250,914150663),new t.init(2438529370,812702999),new t.init(355462360,4144912697),new t.init(1731405415,4290775857),new t.init(2394180231,1750603025),new t.init(3675008525,1694076839),new t.init(1203062813,3204075428)])},_doFinalize:function(){var e=r._doFinalize.call(this);return e.sigBytes-=16,e}});e.SHA384=r._createHelper(i),e.HmacSHA384=r._createHmacHelper(i)}();var v,y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function b(e){var t,n,r="";for(t=0;t+3<=e.length;t+=3)n=parseInt(e.substring(t,t+3),16),r+=y.charAt(n>>6)+y.charAt(63&n);for(t+1==e.length?(n=parseInt(e.substring(t,t+1),16),r+=y.charAt(n<<2)):t+2==e.length&&(n=parseInt(e.substring(t,t+2),16),r+=y.charAt(n>>2)+y.charAt((3&n)<<4));(3&r.length)>0;)r+="=";return r}function w(e){var t,n,r,i="",o=0;for(t=0;t<e.length&&"="!=e.charAt(t);++t)(r=y.indexOf(e.charAt(t)))<0||(0==o?(i+=A(r>>2),n=3&r,o=1):1==o?(i+=A(n<<2|r>>4),n=15&r,o=2):2==o?(i+=A(n),i+=A(r>>2),n=3&r,o=3):(i+=A(n<<2|r>>4),i+=A(15&r),o=0));return 1==o&&(i+=A(n<<2)),i}function x(e){var t,n=w(e),r=new Array;for(t=0;2*t<n.length;++t)r[t]=parseInt(n.substring(2*t,2*t+2),16);return r}function _(e,t,n){null!=e&&("number"==typeof e?this.fromNumber(e,t,n):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function E(){return new _(null)}"Microsoft Internet Explorer"==h.appName?(_.prototype.am=function(e,t,n,r,i,o){for(var a=32767&t,s=t>>15;--o>=0;){var c=32767&this[e],u=this[e++]>>15,l=s*c+u*a;i=((c=a*c+((32767&l)<<15)+n[r]+(1073741823&i))>>>30)+(l>>>15)+s*u+(i>>>30),n[r++]=1073741823&c}return i},v=30):"Netscape"!=h.appName?(_.prototype.am=function(e,t,n,r,i,o){for(;--o>=0;){var a=t*this[e++]+n[r]+i;i=Math.floor(a/67108864),n[r++]=67108863&a}return i},v=26):(_.prototype.am=function(e,t,n,r,i,o){for(var a=16383&t,s=t>>14;--o>=0;){var c=16383&this[e],u=this[e++]>>14,l=s*c+u*a;i=((c=a*c+((16383&l)<<14)+n[r]+i)>>28)+(l>>14)+s*u,n[r++]=268435455&c}return i},v=28),_.prototype.DB=v,_.prototype.DM=(1<<v)-1,_.prototype.DV=1<<v,_.prototype.FV=Math.pow(2,52),_.prototype.F1=52-v,_.prototype.F2=2*v-52;var k,S,C=new Array;for(k="0".charCodeAt(0),S=0;S<=9;++S)C[k++]=S;for(k="a".charCodeAt(0),S=10;S<36;++S)C[k++]=S;for(k="A".charCodeAt(0),S=10;S<36;++S)C[k++]=S;function A(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function T(e,t){var n=C[e.charCodeAt(t)];return null==n?-1:n}function O(e){var t=E();return t.fromInt(e),t}function P(e){var t,n=1;return 0!=(t=e>>>16)&&(e=t,n+=16),0!=(t=e>>8)&&(e=t,n+=8),0!=(t=e>>4)&&(e=t,n+=4),0!=(t=e>>2)&&(e=t,n+=2),0!=(t=e>>1)&&(e=t,n+=1),n}function I(e){this.m=e}function j(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function N(e,t){return e&t}function F(e,t){return e|t}function R(e,t){return e^t}function L(e,t){return e&~t}function D(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function M(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function U(){}function B(e){return e}function H(e){this.r2=E(),this.q3=E(),_.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}I.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},I.prototype.revert=function(e){return e},I.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},I.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},I.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},j.prototype.convert=function(e){var t=E();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(_.ZERO)>0&&this.m.subTo(t,t),t},j.prototype.revert=function(e){var t=E();return e.copyTo(t),this.reduce(t),t},j.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var n=32767&e[t],r=n*this.mpl+((n*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[n=t+this.m.t]+=this.m.am(0,r,e,t,0,this.m.t);e[n]>=e.DV;)e[n]-=e.DV,e[++n]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},j.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},j.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},_.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},_.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},_.prototype.fromString=function(e,t){var n;if(16==t)n=4;else if(8==t)n=3;else if(256==t)n=8;else if(2==t)n=1;else if(32==t)n=5;else{if(4!=t)return void this.fromRadix(e,t);n=2}this.t=0,this.s=0;for(var r=e.length,i=!1,o=0;--r>=0;){var a=8==n?255&e[r]:T(e,r);a<0?"-"==e.charAt(r)&&(i=!0):(i=!1,0==o?this[this.t++]=a:o+n>this.DB?(this[this.t-1]|=(a&(1<<this.DB-o)-1)<<o,this[this.t++]=a>>this.DB-o):this[this.t-1]|=a<<o,(o+=n)>=this.DB&&(o-=this.DB))}8==n&&0!=(128&e[0])&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),i&&_.ZERO.subTo(this,this)},_.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},_.prototype.dlShiftTo=function(e,t){var n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e,t.s=this.s},_.prototype.drShiftTo=function(e,t){for(var n=e;n<this.t;++n)t[n-e]=this[n];t.t=Math.max(this.t-e,0),t.s=this.s},_.prototype.lShiftTo=function(e,t){var n,r=e%this.DB,i=this.DB-r,o=(1<<i)-1,a=Math.floor(e/this.DB),s=this.s<<r&this.DM;for(n=this.t-1;n>=0;--n)t[n+a+1]=this[n]>>i|s,s=(this[n]&o)<<r;for(n=a-1;n>=0;--n)t[n]=0;t[a]=s,t.t=this.t+a+1,t.s=this.s,t.clamp()},_.prototype.rShiftTo=function(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t)t.t=0;else{var r=e%this.DB,i=this.DB-r,o=(1<<r)-1;t[0]=this[n]>>r;for(var a=n+1;a<this.t;++a)t[a-n-1]|=(this[a]&o)<<i,t[a-n]=this[a]>>r;r>0&&(t[this.t-n-1]|=(this.s&o)<<i),t.t=this.t-n,t.clamp()}},_.prototype.subTo=function(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n<i;)r+=this[n]-e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r-=e.s;n<this.t;)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r-=e[n],t[n++]=r&this.DM,r>>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t[n++]=this.DV+r:r>0&&(t[n++]=r),t.t=n,t.clamp()},_.prototype.multiplyTo=function(e,t){var n=this.abs(),r=e.abs(),i=n.t;for(t.t=i+r.t;--i>=0;)t[i]=0;for(i=0;i<r.t;++i)t[i+n.t]=n.am(0,r[i],t,i,0,n.t);t.s=0,t.clamp(),this.s!=e.s&&_.ZERO.subTo(t,t)},_.prototype.squareTo=function(e){for(var t=this.abs(),n=e.t=2*t.t;--n>=0;)e[n]=0;for(n=0;n<t.t-1;++n){var r=t.am(n,t[n],e,2*n,0,1);(e[n+t.t]+=t.am(n+1,2*t[n],e,2*n+1,r,t.t-n-1))>=t.DV&&(e[n+t.t]-=t.DV,e[n+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(n,t[n],e,2*n,0,1)),e.s=0,e.clamp()},_.prototype.divRemTo=function(e,t,n){var r=e.abs();if(!(r.t<=0)){var i=this.abs();if(i.t<r.t)return null!=t&&t.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=E());var o=E(),a=this.s,s=e.s,c=this.DB-P(r[r.t-1]);c>0?(r.lShiftTo(c,o),i.lShiftTo(c,n)):(r.copyTo(o),i.copyTo(n));var u=o.t,l=o[u-1];if(0!=l){var d=l*(1<<this.F1)+(u>1?o[u-2]>>this.F2:0),p=this.FV/d,f=(1<<this.F1)/d,h=1<<this.F2,m=n.t,g=m-u,v=null==t?E():t;for(o.dlShiftTo(g,v),n.compareTo(v)>=0&&(n[n.t++]=1,n.subTo(v,n)),_.ONE.dlShiftTo(u,v),v.subTo(o,o);o.t<u;)o[o.t++]=0;for(;--g>=0;){var y=n[--m]==l?this.DM:Math.floor(n[m]*p+(n[m-1]+h)*f);if((n[m]+=o.am(0,y,n,g,0,u))<y)for(o.dlShiftTo(g,v),n.subTo(v,n);n[m]<--y;)n.subTo(v,n)}null!=t&&(n.drShiftTo(u,t),a!=s&&_.ZERO.subTo(t,t)),n.t=u,n.clamp(),c>0&&n.rShiftTo(c,n),a<0&&_.ZERO.subTo(n,n)}}},_.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},_.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},_.prototype.exp=function(e,t){if(e>4294967295||e<1)return _.ONE;var n=E(),r=E(),i=t.convert(this),o=P(e)-1;for(i.copyTo(n);--o>=0;)if(t.sqrTo(n,r),(e&1<<o)>0)t.mulTo(r,i,n);else{var a=n;n=r,r=a}return t.revert(n)},_.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var n,r=(1<<t)-1,i=!1,o="",a=this.t,s=this.DB-a*this.DB%t;if(a-- >0)for(s<this.DB&&(n=this[a]>>s)>0&&(i=!0,o=A(n));a>=0;)s<t?(n=(this[a]&(1<<s)-1)<<t-s,n|=this[--a]>>(s+=this.DB-t)):(n=this[a]>>(s-=t)&r,s<=0&&(s+=this.DB,--a)),n>0&&(i=!0),i&&(o+=A(n));return i?o:"0"},_.prototype.negate=function(){var e=E();return _.ZERO.subTo(this,e),e},_.prototype.abs=function(){return this.s<0?this.negate():this},_.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var n=this.t;if(0!=(t=n-e.t))return this.s<0?-t:t;for(;--n>=0;)if(0!=(t=this[n]-e[n]))return t;return 0},_.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+P(this[this.t-1]^this.s&this.DM)},_.prototype.mod=function(e){var t=E();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(_.ZERO)>0&&e.subTo(t,t),t},_.prototype.modPowInt=function(e,t){var n;return n=e<256||t.isEven()?new I(t):new j(t),this.exp(e,n)},_.ZERO=O(0),_.ONE=O(1),U.prototype.convert=B,U.prototype.revert=B,U.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n)},U.prototype.sqrTo=function(e,t){e.squareTo(t)},H.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=E();return e.copyTo(t),this.reduce(t),t},H.prototype.revert=function(e){return e},H.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},H.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},H.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var q,W,K,V=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],J=(1<<26)/V[V.length-1];function z(){this.i=0,this.j=0,this.S=new Array}function Z(){!function(e){W[K++]^=255&e,W[K++]^=e>>8&255,W[K++]^=e>>16&255,W[K++]^=e>>24&255,K>=256&&(K-=256)}((new Date).getTime())}if(_.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},_.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),n=Math.pow(e,t),r=O(n),i=E(),o=E(),a="";for(this.divRemTo(r,i,o);i.signum()>0;)a=(n+o.intValue()).toString(e).substr(1)+a,i.divRemTo(r,i,o);return o.intValue().toString(e)+a},_.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var n=this.chunkSize(t),r=Math.pow(t,n),i=!1,o=0,a=0,s=0;s<e.length;++s){var c=T(e,s);c<0?"-"==e.charAt(s)&&0==this.signum()&&(i=!0):(a=t*a+c,++o>=n&&(this.dMultiply(r),this.dAddOffset(a,0),o=0,a=0))}o>0&&(this.dMultiply(Math.pow(t,o)),this.dAddOffset(a,0)),i&&_.ZERO.subTo(this,this)},_.prototype.fromNumber=function(e,t,n){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,n),this.testBit(e-1)||this.bitwiseTo(_.ONE.shiftLeft(e-1),F,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(_.ONE.shiftLeft(e-1),this);else{var r=new Array,i=7&e;r.length=1+(e>>3),t.nextBytes(r),i>0?r[0]&=(1<<i)-1:r[0]=0,this.fromString(r,256)}},_.prototype.bitwiseTo=function(e,t,n){var r,i,o=Math.min(e.t,this.t);for(r=0;r<o;++r)n[r]=t(this[r],e[r]);if(e.t<this.t){for(i=e.s&this.DM,r=o;r<this.t;++r)n[r]=t(this[r],i);n.t=this.t}else{for(i=this.s&this.DM,r=o;r<e.t;++r)n[r]=t(i,e[r]);n.t=e.t}n.s=t(this.s,e.s),n.clamp()},_.prototype.changeBit=function(e,t){var n=_.ONE.shiftLeft(e);return this.bitwiseTo(n,t,n),n},_.prototype.addTo=function(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n<i;)r+=this[n]+e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r+=e.s;n<this.t;)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r+=e[n],t[n++]=r&this.DM,r>>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t[n++]=r:r<-1&&(t[n++]=this.DV+r),t.t=n,t.clamp()},_.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},_.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},_.prototype.multiplyLowerTo=function(e,t,n){var r,i=Math.min(this.t+e.t,t);for(n.s=0,n.t=i;i>0;)n[--i]=0;for(r=n.t-this.t;i<r;++i)n[i+this.t]=this.am(0,e[i],n,i,0,this.t);for(r=Math.min(e.t,t);i<r;++i)this.am(0,e[i],n,i,0,t-i);n.clamp()},_.prototype.multiplyUpperTo=function(e,t,n){--t;var r=n.t=this.t+e.t-t;for(n.s=0;--r>=0;)n[r]=0;for(r=Math.max(t-this.t,0);r<e.t;++r)n[this.t+r-t]=this.am(t-r,e[r],n,0,0,this.t+r-t);n.clamp(),n.drShiftTo(1,n)},_.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,n=this.s<0?e-1:0;if(this.t>0)if(0==t)n=this[0]%e;else for(var r=this.t-1;r>=0;--r)n=(t*n+this[r])%e;return n},_.prototype.millerRabin=function(e){var t=this.subtract(_.ONE),n=t.getLowestSetBit();if(n<=0)return!1;var r=t.shiftRight(n);(e=e+1>>1)>V.length&&(e=V.length);for(var i=E(),o=0;o<e;++o){i.fromInt(V[Math.floor(Math.random()*V.length)]);var a=i.modPow(r,this);if(0!=a.compareTo(_.ONE)&&0!=a.compareTo(t)){for(var s=1;s++<n&&0!=a.compareTo(t);)if(0==(a=a.modPowInt(2,this)).compareTo(_.ONE))return!1;if(0!=a.compareTo(t))return!1}}return!0},_.prototype.clone=function(){var e=E();return this.copyTo(e),e},_.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},_.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},_.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},_.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},_.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var n,r=this.DB-e*this.DB%8,i=0;if(e-- >0)for(r<this.DB&&(n=this[e]>>r)!=(this.s&this.DM)>>r&&(t[i++]=n|this.s<<this.DB-r);e>=0;)r<8?(n=(this[e]&(1<<r)-1)<<8-r,n|=this[--e]>>(r+=this.DB-8)):(n=this[e]>>(r-=8)&255,r<=0&&(r+=this.DB,--e)),0!=(128&n)&&(n|=-256),0==i&&(128&this.s)!=(128&n)&&++i,(i>0||n!=this.s)&&(t[i++]=n);return t},_.prototype.equals=function(e){return 0==this.compareTo(e)},_.prototype.min=function(e){return this.compareTo(e)<0?this:e},_.prototype.max=function(e){return this.compareTo(e)>0?this:e},_.prototype.and=function(e){var t=E();return this.bitwiseTo(e,N,t),t},_.prototype.or=function(e){var t=E();return this.bitwiseTo(e,F,t),t},_.prototype.xor=function(e){var t=E();return this.bitwiseTo(e,R,t),t},_.prototype.andNot=function(e){var t=E();return this.bitwiseTo(e,L,t),t},_.prototype.not=function(){for(var e=E(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e},_.prototype.shiftLeft=function(e){var t=E();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},_.prototype.shiftRight=function(e){var t=E();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},_.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this[e])return e*this.DB+D(this[e]);return this.s<0?this.t*this.DB:-1},_.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,n=0;n<this.t;++n)e+=M(this[n]^t);return e},_.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this[t]&1<<e%this.DB)},_.prototype.setBit=function(e){return this.changeBit(e,F)},_.prototype.clearBit=function(e){return this.changeBit(e,L)},_.prototype.flipBit=function(e){return this.changeBit(e,R)},_.prototype.add=function(e){var t=E();return this.addTo(e,t),t},_.prototype.subtract=function(e){var t=E();return this.subTo(e,t),t},_.prototype.multiply=function(e){var t=E();return this.multiplyTo(e,t),t},_.prototype.divide=function(e){var t=E();return this.divRemTo(e,t,null),t},_.prototype.remainder=function(e){var t=E();return this.divRemTo(e,null,t),t},_.prototype.divideAndRemainder=function(e){var t=E(),n=E();return this.divRemTo(e,t,n),new Array(t,n)},_.prototype.modPow=function(e,t){var n,r,i=e.bitLength(),o=O(1);if(i<=0)return o;n=i<18?1:i<48?3:i<144?4:i<768?5:6,r=i<8?new I(t):t.isEven()?new H(t):new j(t);var a=new Array,s=3,c=n-1,u=(1<<n)-1;if(a[1]=r.convert(this),n>1){var l=E();for(r.sqrTo(a[1],l);s<=u;)a[s]=E(),r.mulTo(l,a[s-2],a[s]),s+=2}var d,p,f=e.t-1,h=!0,m=E();for(i=P(e[f])-1;f>=0;){for(i>=c?d=e[f]>>i-c&u:(d=(e[f]&(1<<i+1)-1)<<c-i,f>0&&(d|=e[f-1]>>this.DB+i-c)),s=n;0==(1&d);)d>>=1,--s;if((i-=s)<0&&(i+=this.DB,--f),h)a[d].copyTo(o),h=!1;else{for(;s>1;)r.sqrTo(o,m),r.sqrTo(m,o),s-=2;s>0?r.sqrTo(o,m):(p=o,o=m,m=p),r.mulTo(m,a[d],o)}for(;f>=0&&0==(e[f]&1<<i);)r.sqrTo(o,m),p=o,o=m,m=p,--i<0&&(i=this.DB-1,--f)}return r.revert(o)},_.prototype.modInverse=function(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return _.ZERO;for(var n=e.clone(),r=this.clone(),i=O(1),o=O(0),a=O(0),s=O(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),t?(i.isEven()&&o.isEven()||(i.addTo(this,i),o.subTo(e,o)),i.rShiftTo(1,i)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);for(;r.isEven();)r.rShiftTo(1,r),t?(a.isEven()&&s.isEven()||(a.addTo(this,a),s.subTo(e,s)),a.rShiftTo(1,a)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);n.compareTo(r)>=0?(n.subTo(r,n),t&&i.subTo(a,i),o.subTo(s,o)):(r.subTo(n,r),t&&a.subTo(i,a),s.subTo(o,s))}return 0!=r.compareTo(_.ONE)?_.ZERO:s.compareTo(e)>=0?s.subtract(e):s.signum()<0?(s.addTo(e,s),s.signum()<0?s.add(e):s):s},_.prototype.pow=function(e){return this.exp(e,new U)},_.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),n=e.s<0?e.negate():e.clone();if(t.compareTo(n)<0){var r=t;t=n,n=r}var i=t.getLowestSetBit(),o=n.getLowestSetBit();if(o<0)return t;for(i<o&&(o=i),o>0&&(t.rShiftTo(o,t),n.rShiftTo(o,n));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),t.compareTo(n)>=0?(t.subTo(n,t),t.rShiftTo(1,t)):(n.subTo(t,n),n.rShiftTo(1,n));return o>0&&n.lShiftTo(o,n),n},_.prototype.isProbablePrime=function(e){var t,n=this.abs();if(1==n.t&&n[0]<=V[V.length-1]){for(t=0;t<V.length;++t)if(n[0]==V[t])return!0;return!1}if(n.isEven())return!1;for(t=1;t<V.length;){for(var r=V[t],i=t+1;i<V.length&&r<J;)r*=V[i++];for(r=n.modInt(r);t<i;)if(r%V[t++]==0)return!1}return n.millerRabin(e)},_.prototype.square=function(){var e=E();return this.squareTo(e),e},z.prototype.init=function(e){var t,n,r;for(t=0;t<256;++t)this.S[t]=t;for(n=0,t=0;t<256;++t)n=n+this.S[t]+e[t%e.length]&255,r=this.S[t],this.S[t]=this.S[n],this.S[n]=r;this.i=0,this.j=0},z.prototype.next=function(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]},null==W){var $;if(W=new Array,K=0,void 0!==m&&(void 0!==m.crypto||void 0!==m.msCrypto)){var G=m.crypto||m.msCrypto;if(G.getRandomValues){var X=new Uint8Array(32);for(G.getRandomValues(X),$=0;$<32;++$)W[K++]=X[$]}else if("Netscape"==h.appName&&h.appVersion<"5"){var Q=m.crypto.random(32);for($=0;$<Q.length;++$)W[K++]=255&Q.charCodeAt($)}}for(;K<256;)$=Math.floor(65536*Math.random()),W[K++]=$>>>8,W[K++]=255&$;K=0,Z()}function Y(){if(null==q){for(Z(),(q=new z).init(W),K=0;K<W.length;++K)W[K]=0;K=0}return q.next()}function ee(){}function te(e,t){return new _(e,t)}function ne(e,t,n){for(var r="",i=0;r.length<t;)r+=n(String.fromCharCode.apply(String,e.concat([(4278190080&i)>>24,(16711680&i)>>16,(65280&i)>>8,255&i]))),i+=1;return r}function re(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}function ie(e,t){this.x=t,this.q=e}function oe(e,t,n,r){this.curve=e,this.x=t,this.y=n,this.z=null==r?_.ONE:r,this.zinv=null}function ae(e,t,n){this.q=e,this.a=this.fromBigInteger(t),this.b=this.fromBigInteger(n),this.infinity=new oe(this,null,null)}ee.prototype.nextBytes=function(e){var t;for(t=0;t<e.length;++t)e[t]=Y()},re.prototype.doPublic=function(e){return e.modPowInt(this.e,this.n)},re.prototype.setPublic=function(e,t){if(this.isPublic=!0,this.isPrivate=!1,"string"!=typeof e)this.n=e,this.e=t;else{if(!(null!=e&&null!=t&&e.length>0&&t.length>0))throw"Invalid RSA public key";this.n=te(e,16),this.e=parseInt(t,16)}},re.prototype.encrypt=function(e){var t=function(e,t){if(t<e.length+11)throw"Message too long for RSA";for(var n=new Array,r=e.length-1;r>=0&&t>0;){var i=e.charCodeAt(r--);i<128?n[--t]=i:i>127&&i<2048?(n[--t]=63&i|128,n[--t]=i>>6|192):(n[--t]=63&i|128,n[--t]=i>>6&63|128,n[--t]=i>>12|224)}n[--t]=0;for(var o=new ee,a=new Array;t>2;){for(a[0]=0;0==a[0];)o.nextBytes(a);n[--t]=a[0]}return n[--t]=2,n[--t]=0,new _(n)}(e,this.n.bitLength()+7>>3);if(null==t)return null;var n=this.doPublic(t);if(null==n)return null;var r=n.toString(16);return 0==(1&r.length)?r:"0"+r},re.prototype.encryptOAEP=function(e,t,n){var r=function(e,t,n,r){var i=ce.crypto.MessageDigest,o=ce.crypto.Util,a=null;if(n||(n="sha1"),"string"==typeof n&&(a=i.getCanonicalAlgName(n),r=i.getHashLength(a),n=function(e){return _e(o.hashHex(Ee(e),a))}),e.length+2*r+2>t)throw"Message too long for RSA";var s,c="";for(s=0;s<t-e.length-2*r-2;s+=1)c+="\0";var u=n("")+c+""+e,l=new Array(r);(new ee).nextBytes(l);var d=ne(l,u.length,n),p=[];for(s=0;s<u.length;s+=1)p[s]=u.charCodeAt(s)^d.charCodeAt(s);var f=ne(p,l.length,n),h=[0];for(s=0;s<l.length;s+=1)h[s+1]=l[s]^f.charCodeAt(s);return new _(h.concat(p))}(e,this.n.bitLength()+7>>3,t,n);if(null==r)return null;var i=this.doPublic(r);if(null==i)return null;var o=i.toString(16);return 0==(1&o.length)?o:"0"+o},re.prototype.type="RSA",ie.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.x.equals(e.x)},ie.prototype.toBigInteger=function(){return this.x},ie.prototype.negate=function(){return new ie(this.q,this.x.negate().mod(this.q))},ie.prototype.add=function(e){return new ie(this.q,this.x.add(e.toBigInteger()).mod(this.q))},ie.prototype.subtract=function(e){return new ie(this.q,this.x.subtract(e.toBigInteger()).mod(this.q))},ie.prototype.multiply=function(e){return new ie(this.q,this.x.multiply(e.toBigInteger()).mod(this.q))},ie.prototype.square=function(){return new ie(this.q,this.x.square().mod(this.q))},ie.prototype.divide=function(e){return new ie(this.q,this.x.multiply(e.toBigInteger().modInverse(this.q)).mod(this.q))},oe.prototype.getX=function(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))},oe.prototype.getY=function(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))},oe.prototype.equals=function(e){return e==this||(this.isInfinity()?e.isInfinity():e.isInfinity()?this.isInfinity():!!e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(_.ZERO)&&e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(_.ZERO))},oe.prototype.isInfinity=function(){return null==this.x&&null==this.y||this.z.equals(_.ZERO)&&!this.y.toBigInteger().equals(_.ZERO)},oe.prototype.negate=function(){return new oe(this.curve,this.x,this.y.negate(),this.z)},oe.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q),n=e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q);if(_.ZERO.equals(n))return _.ZERO.equals(t)?this.twice():this.curve.getInfinity();var r=new _("3"),i=this.x.toBigInteger(),o=this.y.toBigInteger(),a=(e.x.toBigInteger(),e.y.toBigInteger(),n.square()),s=a.multiply(n),c=i.multiply(a),u=t.square().multiply(this.z),l=u.subtract(c.shiftLeft(1)).multiply(e.z).subtract(s).multiply(n).mod(this.curve.q),d=c.multiply(r).multiply(t).subtract(o.multiply(s)).subtract(u.multiply(t)).multiply(e.z).add(t.multiply(s)).mod(this.curve.q),p=s.multiply(this.z).multiply(e.z).mod(this.curve.q);return new oe(this.curve,this.curve.fromBigInteger(l),this.curve.fromBigInteger(d),p)},oe.prototype.twice=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=new _("3"),t=this.x.toBigInteger(),n=this.y.toBigInteger(),r=n.multiply(this.z),i=r.multiply(n).mod(this.curve.q),o=this.curve.a.toBigInteger(),a=t.square().multiply(e);_.ZERO.equals(o)||(a=a.add(this.z.square().multiply(o)));var s=(a=a.mod(this.curve.q)).square().subtract(t.shiftLeft(3).multiply(i)).shiftLeft(1).multiply(r).mod(this.curve.q),c=a.multiply(e).multiply(t).subtract(i.shiftLeft(1)).shiftLeft(2).multiply(i).subtract(a.square().multiply(a)).mod(this.curve.q),u=r.square().multiply(r).shiftLeft(3).mod(this.curve.q);return new oe(this.curve,this.curve.fromBigInteger(s),this.curve.fromBigInteger(c),u)},oe.prototype.multiply=function(e){if(this.isInfinity())return this;if(0==e.signum())return this.curve.getInfinity();var t,n=e,r=n.multiply(new _("3")),i=this.negate(),o=this,a=this.curve.q.subtract(e),s=a.multiply(new _("3")),c=new oe(this.curve,this.x,this.y),u=c.negate();for(t=r.bitLength()-2;t>0;--t){o=o.twice();var l=r.testBit(t);l!=n.testBit(t)&&(o=o.add(l?this:i))}for(t=s.bitLength()-2;t>0;--t){c=c.twice();var d=s.testBit(t);d!=a.testBit(t)&&(c=c.add(d?c:u))}return o},oe.prototype.multiplyTwo=function(e,t,n){var r;r=e.bitLength()>n.bitLength()?e.bitLength()-1:n.bitLength()-1;for(var i=this.curve.getInfinity(),o=this.add(t);r>=0;)i=i.twice(),e.testBit(r)?i=n.testBit(r)?i.add(o):i.add(this):n.testBit(r)&&(i=i.add(t)),--r;return i},ae.prototype.getQ=function(){return this.q},ae.prototype.getA=function(){return this.a},ae.prototype.getB=function(){return this.b},ae.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.a.equals(e.a)&&this.b.equals(e.b)},ae.prototype.getInfinity=function(){return this.infinity},ae.prototype.fromBigInteger=function(e){return new ie(this.q,e)},ae.prototype.decodePointHex=function(e){switch(parseInt(e.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:default:return null;case 4:case 6:case 7:var t=(e.length-2)/2,n=e.substr(2,t),r=e.substr(t+2,t);return new oe(this,this.fromBigInteger(new _(n,16)),this.fromBigInteger(new _(r,16)))}},ie.prototype.getByteLength=function(){return Math.floor((this.toBigInteger().bitLength()+7)/8)},oe.prototype.getEncoded=function(e){var t=function(e,t){var n=e.toByteArrayUnsigned();if(t<n.length)n=n.slice(n.length-t);else for(;t>n.length;)n.unshift(0);return n},n=this.getX().toBigInteger(),r=this.getY().toBigInteger(),i=t(n,32);return e?r.isEven()?i.unshift(2):i.unshift(3):(i.unshift(4),i=i.concat(t(r,32))),i},oe.decodeFrom=function(e,t){t[0];var n=t.length-1,r=t.slice(1,1+n/2),i=t.slice(1+n/2,1+n);r.unshift(0),i.unshift(0);var o=new _(r),a=new _(i);return new oe(e,e.fromBigInteger(o),e.fromBigInteger(a))},oe.decodeFromHex=function(e,t){t.substr(0,2);var n=t.length-2,r=t.substr(2,n/2),i=t.substr(2+n/2,n/2),o=new _(r,16),a=new _(i,16);return new oe(e,e.fromBigInteger(o),e.fromBigInteger(a))},oe.prototype.add2D=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;if(this.x.equals(e.x))return this.y.equals(e.y)?this.twice():this.curve.getInfinity();var t=e.x.subtract(this.x),n=e.y.subtract(this.y).divide(t),r=n.square().subtract(this.x).subtract(e.x),i=n.multiply(this.x.subtract(r)).subtract(this.y);return new oe(this.curve,r,i)},oe.prototype.twice2D=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=this.curve.fromBigInteger(_.valueOf(2)),t=this.curve.fromBigInteger(_.valueOf(3)),n=this.x.square().multiply(t).add(this.curve.a).divide(this.y.multiply(e)),r=n.square().subtract(this.x.multiply(e)),i=n.multiply(this.x.subtract(r)).subtract(this.y);return new oe(this.curve,r,i)},oe.prototype.multiply2D=function(e){if(this.isInfinity())return this;if(0==e.signum())return this.curve.getInfinity();var t,n=e,r=n.multiply(new _("3")),i=this.negate(),o=this;for(t=r.bitLength()-2;t>0;--t){o=o.twice();var a=r.testBit(t);a!=n.testBit(t)&&(o=o.add2D(a?this:i))}return o},oe.prototype.isOnCurve=function(){var e=this.getX().toBigInteger(),t=this.getY().toBigInteger(),n=this.curve.getA().toBigInteger(),r=this.curve.getB().toBigInteger(),i=this.curve.getQ(),o=t.multiply(t).mod(i),a=e.multiply(e).multiply(e).add(n.multiply(e)).add(r).mod(i);return o.equals(a)},oe.prototype.toString=function(){return"("+this.getX().toBigInteger().toString()+","+this.getY().toBigInteger().toString()+")"},oe.prototype.validate=function(){var e=this.curve.getQ();if(this.isInfinity())throw new Error("Point is at infinity.");var t=this.getX().toBigInteger(),n=this.getY().toBigInteger();if(t.compareTo(_.ONE)<0||t.compareTo(e.subtract(_.ONE))>0)throw new Error("x coordinate out of bounds");if(n.compareTo(_.ONE)<0||n.compareTo(e.subtract(_.ONE))>0)throw new Error("y coordinate out of bounds");if(!this.isOnCurve())throw new Error("Point is not on the curve.");if(this.multiply(e).isInfinity())throw new Error("Point is not a scalar multiple of G.");return!0};var se=function(){var e=new RegExp('(?:false|true|null|[\\{\\}\\[\\]]|(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)|(?:"(?:[^\\0-\\x08\\x0a-\\x1f"\\\\]|\\\\(?:["/\\\\bfnrt]|u[0-9A-Fa-f]{4}))*"))',"g"),t=new RegExp("\\\\(?:([^u])|u(.{4}))","g"),n={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function r(e,t,r){return t?n[t]:String.fromCharCode(parseInt(r,16))}var i=new String(""),o=Object.hasOwnProperty;return function(n,a){var s,c,u=n.match(e),l=u[0],d=!1;"{"===l?s={}:"["===l?s=[]:(s=[],d=!0);for(var p=[s],h=1-d,m=u.length;h<m;++h){var g;switch((l=u[h]).charCodeAt(0)){default:(g=p[0])[c||g.length]=+l,c=void 0;break;case 34:if(-1!==(l=l.substring(1,l.length-1)).indexOf("\\")&&(l=l.replace(t,r)),g=p[0],!c){if(!(g instanceof Array)){c=l||i;break}c=g.length}g[c]=l,c=void 0;break;case 91:g=p[0],p.unshift(g[c||g.length]=[]),c=void 0;break;case 93:case 125:p.shift();break;case 102:(g=p[0])[c||g.length]=!1,c=void 0;break;case 110:(g=p[0])[c||g.length]=null,c=void 0;break;case 116:(g=p[0])[c||g.length]=!0,c=void 0;break;case 123:g=p[0],p.unshift(g[c||g.length]={}),c=void 0}}if(d){if(1!==p.length)throw new Error;s=s[0]}else if(p.length)throw new Error;return a&&(s=function e(t,n){var r=t[n];if(r&&"object"===(void 0===r?"undefined":f(r))){var i=null;for(var s in r)if(o.call(r,s)&&r!==t){var c=e(r,s);void 0!==c?r[s]=c:(i||(i=[]),i.push(s))}if(i)for(var u=i.length;--u>=0;)delete r[i[u]]}return a.call(t,n,r)}({"":s},"")),s}}();void 0!==ce&&ce||(t.KJUR=ce={}),void 0!==ce.asn1&&ce.asn1||(ce.asn1={}),ce.asn1.ASN1Util=new function(){this.integerToByteHex=function(e){var t=e.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(e){var t=e.toString(16);if("-"!=t.substr(0,1))t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var n=t.substr(1).length;n%2==1?n+=1:t.match(/^[0-7]/)||(n+=2);for(var r="",i=0;i<n;i++)r+="f";t=new _(r,16).xor(e).add(_.ONE).toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(e,t){return Ae(e,t)},this.newObject=function(e){var t=ce.asn1,n=t.ASN1Object,r=t.DERBoolean,i=t.DERInteger,o=t.DERBitString,a=t.DEROctetString,s=t.DERNull,c=t.DERObjectIdentifier,u=t.DEREnumerated,l=t.DERUTF8String,d=t.DERNumericString,p=t.DERPrintableString,f=t.DERTeletexString,h=t.DERIA5String,m=t.DERUTCTime,g=t.DERGeneralizedTime,v=t.DERVisibleString,y=t.DERBMPString,b=t.DERSequence,w=t.DERSet,x=t.DERTaggedObject,_=t.ASN1Util.newObject;if(e instanceof t.ASN1Object)return e;var E=Object.keys(e);if(1!=E.length)throw new Error("key of param shall be only one.");var k=E[0];if(-1==":asn1:bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:visstr:bmpstr:seq:set:tag:".indexOf(":"+k+":"))throw new Error("undefined key: "+k);if("bool"==k)return new r(e[k]);if("int"==k)return new i(e[k]);if("bitstr"==k)return new o(e[k]);if("octstr"==k)return new a(e[k]);if("null"==k)return new s(e[k]);if("oid"==k)return new c(e[k]);if("enum"==k)return new u(e[k]);if("utf8str"==k)return new l(e[k]);if("numstr"==k)return new d(e[k]);if("prnstr"==k)return new p(e[k]);if("telstr"==k)return new f(e[k]);if("ia5str"==k)return new h(e[k]);if("utctime"==k)return new m(e[k]);if("gentime"==k)return new g(e[k]);if("visstr"==k)return new v(e[k]);if("bmpstr"==k)return new y(e[k]);if("asn1"==k)return new n(e[k]);if("seq"==k){for(var S=e[k],C=[],A=0;A<S.length;A++){var T=_(S[A]);C.push(T)}return new b({array:C})}if("set"==k){for(S=e[k],C=[],A=0;A<S.length;A++)T=_(S[A]),C.push(T);return new w({array:C})}if("tag"==k){var O=e[k];if("[object Array]"===Object.prototype.toString.call(O)&&3==O.length){var P=_(O[2]);return new x({tag:O[0],explicit:O[1],obj:P})}return new x(O)}},this.jsonToASN1HEX=function(e){return this.newObject(e).getEncodedHex()}},ce.asn1.ASN1Util.oidHexToInt=function(e){for(var t="",n=parseInt(e.substr(0,2),16),r=(t=Math.floor(n/40)+"."+n%40,""),i=2;i<e.length;i+=2){var o=("00000000"+parseInt(e.substr(i,2),16).toString(2)).slice(-8);r+=o.substr(1,7),"0"==o.substr(0,1)&&(t=t+"."+new _(r,2).toString(10),r="")}return t},ce.asn1.ASN1Util.oidIntToHex=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},n=function(e){var n="",r=new _(e,10).toString(2),i=7-r.length%7;7==i&&(i=0);for(var o="",a=0;a<i;a++)o+="0";for(r=o+r,a=0;a<r.length-1;a+=7){var s=r.substr(a,7);a!=r.length-7&&(s="1"+s),n+=t(parseInt(s,2))}return n};if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var r="",i=e.split("."),o=40*parseInt(i[0])+parseInt(i[1]);r+=t(o),i.splice(0,2);for(var a=0;a<i.length;a++)r+=n(i[a]);return r},ce.asn1.ASN1Object=function(e){this.params=null,this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw new Error("this.hV is null or undefined");if(this.hV.length%2==1)throw new Error("value hex must be even length: n="+"".length+",v="+this.hV);var e=this.hV.length/2,t=e.toString(16);if(t.length%2==1&&(t="0"+t),e<128)return t;var n=t.length/2;if(n>15)throw"ASN.1 length too long to represent by 8x: n = "+e.toString(16);return(128+n).toString(16)+t},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""},this.setByParam=function(e){this.params=e},null!=e&&null!=e.tlv&&(this.hTLV=e.tlv,this.isModified=!1)},ce.asn1.DERAbstractString=function(e){ce.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=we(this.s).toLowerCase()},this.setStringHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e?this.setString(e):void 0!==e.str?this.setString(e.str):void 0!==e.hex&&this.setStringHex(e.hex))},He(ce.asn1.DERAbstractString,ce.asn1.ASN1Object),ce.asn1.DERAbstractTime=function(e){ce.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(e){var t=e.getTime()+6e4*e.getTimezoneOffset();return new Date(t)},this.formatDate=function(e,t,n){var r=this.zeroPadding,i=this.localDateToUTC(e),o=String(i.getFullYear());"utc"==t&&(o=o.substr(2,2));var a=o+r(String(i.getMonth()+1),2)+r(String(i.getDate()),2)+r(String(i.getHours()),2)+r(String(i.getMinutes()),2)+r(String(i.getSeconds()),2);if(!0===n){var s=i.getMilliseconds();if(0!=s){var c=r(String(s),3);a=a+"."+(c=c.replace(/[0]+$/,""))}}return a+"Z"},this.zeroPadding=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=me(e)},this.setByDateValue=function(e,t,n,r,i,o){var a=new Date(Date.UTC(e,t-1,n,r,i,o,0));this.setByDate(a)},this.getFreshValueHex=function(){return this.hV}},He(ce.asn1.DERAbstractTime,ce.asn1.ASN1Object),ce.asn1.DERAbstractStructured=function(e){ce.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array=e},this.appendASN1Object=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array.push(e)},this.asn1Array=new Array,void 0!==e&&void 0!==e.array&&(this.asn1Array=e.array)},He(ce.asn1.DERAbstractStructured,ce.asn1.ASN1Object),ce.asn1.DERBoolean=function(e){ce.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV=0==e?"010100":"0101ff"},He(ce.asn1.DERBoolean,ce.asn1.ASN1Object),ce.asn1.DERInteger=function(e){ce.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=ce.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new _(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.bigint?this.setByBigInteger(e.bigint):void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},He(ce.asn1.DERInteger,ce.asn1.ASN1Object),ce.asn1.DERBitString=function(e){if(void 0!==e&&void 0!==e.obj){var t=ce.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.getEncodedHex()}ce.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,t){if(e<0||7<e)throw"unused bits shall be from 0 to 7: u = "+e;var n="0"+e;this.hTLV=null,this.isModified=!0,this.hV=n+t},this.setByBinaryString=function(e){var t=8-(e=e.replace(/0+$/,"")).length%8;8==t&&(t=0);for(var n=0;n<=t;n++)e+="0";var r="";for(n=0;n<e.length-1;n+=8){var i=e.substr(n,8),o=parseInt(i,2).toString(16);1==o.length&&(o="0"+o),r+=o}this.hTLV=null,this.isModified=!0,this.hV="0"+t+r},this.setByBooleanArray=function(e){for(var t="",n=0;n<e.length;n++)1==e[n]?t+="1":t+="0";this.setByBinaryString(t)},this.newFalseArray=function(e){for(var t=new Array(e),n=0;n<e;n++)t[n]=!1;return t},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e&&e.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(e):void 0!==e.hex?this.setHexValueIncludingUnusedBits(e.hex):void 0!==e.bin?this.setByBinaryString(e.bin):void 0!==e.array&&this.setByBooleanArray(e.array))},He(ce.asn1.DERBitString,ce.asn1.ASN1Object),ce.asn1.DEROctetString=function(e){if(void 0!==e&&void 0!==e.obj){var t=ce.asn1.ASN1Util.newObject(e.obj);e.hex=t.getEncodedHex()}ce.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"},He(ce.asn1.DEROctetString,ce.asn1.DERAbstractString),ce.asn1.DERNull=function(){ce.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},He(ce.asn1.DERNull,ce.asn1.ASN1Object),ce.asn1.DERObjectIdentifier=function(e){ce.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueOidString=function(e){var t=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},n=function(e){var n="",r=parseInt(e,10).toString(2),i=7-r.length%7;7==i&&(i=0);for(var o="",a=0;a<i;a++)o+="0";for(r=o+r,a=0;a<r.length-1;a+=7){var s=r.substr(a,7);a!=r.length-7&&(s="1"+s),n+=t(parseInt(s,2))}return n};try{if(!e.match(/^[0-9.]+$/))return null;var r="",i=e.split("."),o=40*parseInt(i[0],10)+parseInt(i[1],10);r+=t(o),i.splice(0,2);for(var a=0;a<i.length;a++)r+=n(i[a]);return r}catch(e){return null}}(e);if(null==t)throw new Error("malformed oid string: "+e);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.setValueName=function(e){var t=ce.asn1.x509.OID.name2oid(e);if(""===t)throw new Error("DERObjectIdentifier oidName undefined: "+e);this.setValueOidString(t)},this.setValueNameOrOid=function(e){e.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(e):this.setValueName(e)},this.getFreshValueHex=function(){return this.hV},this.setByParam=function(e){"string"==typeof e?this.setValueNameOrOid(e):void 0!==e.oid?this.setValueNameOrOid(e.oid):void 0!==e.name?this.setValueNameOrOid(e.name):void 0!==e.hex&&this.setValueHex(e.hex)},void 0!==e&&this.setByParam(e)},He(ce.asn1.DERObjectIdentifier,ce.asn1.ASN1Object),ce.asn1.DEREnumerated=function(e){ce.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=ce.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new _(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},He(ce.asn1.DEREnumerated,ce.asn1.ASN1Object),ce.asn1.DERUTF8String=function(e){ce.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"},He(ce.asn1.DERUTF8String,ce.asn1.DERAbstractString),ce.asn1.DERNumericString=function(e){ce.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"},He(ce.asn1.DERNumericString,ce.asn1.DERAbstractString),ce.asn1.DERPrintableString=function(e){ce.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"},He(ce.asn1.DERPrintableString,ce.asn1.DERAbstractString),ce.asn1.DERTeletexString=function(e){ce.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"},He(ce.asn1.DERTeletexString,ce.asn1.DERAbstractString),ce.asn1.DERIA5String=function(e){ce.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"},He(ce.asn1.DERIA5String,ce.asn1.DERAbstractString),ce.asn1.DERVisibleString=function(e){ce.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="1a"},He(ce.asn1.DERVisibleString,ce.asn1.DERAbstractString),ce.asn1.DERBMPString=function(e){ce.asn1.DERBMPString.superclass.constructor.call(this,e),this.hT="1e"},He(ce.asn1.DERBMPString,ce.asn1.DERAbstractString),ce.asn1.DERUTCTime=function(e){ce.asn1.DERUTCTime.superclass.constructor.call(this,e),this.hT="17",this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"utc"),this.hV=me(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=me(this.s)),this.hV},void 0!==e&&(void 0!==e.str?this.setString(e.str):"string"==typeof e&&e.match(/^[0-9]{12}Z$/)?this.setString(e):void 0!==e.hex?this.setStringHex(e.hex):void 0!==e.date&&this.setByDate(e.date))},He(ce.asn1.DERUTCTime,ce.asn1.DERAbstractTime),ce.asn1.DERGeneralizedTime=function(e){ce.asn1.DERGeneralizedTime.superclass.constructor.call(this,e),this.hT="18",this.withMillis=!1,this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=me(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=me(this.s)),this.hV},void 0!==e&&(void 0!==e.str?this.setString(e.str):"string"==typeof e&&e.match(/^[0-9]{14}Z$/)?this.setString(e):void 0!==e.hex?this.setStringHex(e.hex):void 0!==e.date&&this.setByDate(e.date),!0===e.millis&&(this.withMillis=!0))},He(ce.asn1.DERGeneralizedTime,ce.asn1.DERAbstractTime),ce.asn1.DERSequence=function(e){ce.asn1.DERSequence.superclass.constructor.call(this,e),this.hT="30",this.getFreshValueHex=function(){for(var e="",t=0;t<this.asn1Array.length;t++)e+=this.asn1Array[t].getEncodedHex();return this.hV=e,this.hV}},He(ce.asn1.DERSequence,ce.asn1.DERAbstractStructured),ce.asn1.DERSet=function(e){ce.asn1.DERSet.superclass.constructor.call(this,e),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var e=new Array,t=0;t<this.asn1Array.length;t++){var n=this.asn1Array[t];e.push(n.getEncodedHex())}return 1==this.sortFlag&&e.sort(),this.hV=e.join(""),this.hV},void 0!==e&&void 0!==e.sortflag&&0==e.sortflag&&(this.sortFlag=!1)},He(ce.asn1.DERSet,ce.asn1.DERAbstractStructured),ce.asn1.DERTaggedObject=function(e){ce.asn1.DERTaggedObject.superclass.constructor.call(this);var t=ce.asn1;this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(e,t,n){this.hT=t,this.isExplicit=e,this.asn1Object=n,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=n.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,t),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},this.setByParam=function(e){null!=e.tag&&(this.hT=e.tag),null!=e.explicit&&(this.isExplicit=e.explicit),null!=e.tage&&(this.hT=e.tage,this.isExplicit=!0),null!=e.tagi&&(this.hT=e.tagi,this.isExplicit=!1),null!=e.obj&&(e.obj instanceof t.ASN1Object?(this.asn1Object=e.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)):"object"==f(e.obj)&&(this.asn1Object=t.ASN1Util.newObject(e.obj),this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},null!=e&&this.setByParam(e)},He(ce.asn1.DERTaggedObject,ce.asn1.ASN1Object);var ce,ue,le,de=new function(){};function pe(e){for(var t=new Array,n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}function fe(e){for(var t="",n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t}function he(e){for(var t="",n=0;n<e.length;n++){var r=e[n].toString(16);1==r.length&&(r="0"+r),t+=r}return t}function me(e){return he(pe(e))}function ge(e){return(e=(e=e.replace(/\=/g,"")).replace(/\+/g,"-")).replace(/\//g,"_")}function ve(e){return e.length%4==2?e+="==":e.length%4==3&&(e+="="),(e=e.replace(/-/g,"+")).replace(/_/g,"/")}function ye(e){return e.length%2==1&&(e="0"+e),ge(b(e))}function be(e){return w(ve(e))}function we(e){return Ie(De(e))}function xe(e){return decodeURIComponent(je(e))}function _e(e){for(var t="",n=0;n<e.length-1;n+=2)t+=String.fromCharCode(parseInt(e.substr(n,2),16));return t}function Ee(e){for(var t="",n=0;n<e.length;n++)t+=("0"+e.charCodeAt(n).toString(16)).slice(-2);return t}function ke(e){return b(e)}function Se(e){return ke(e).replace(/(.{64})/g,"$1\r\n").replace(/\r\n$/,"")}function Ce(e){return w(e.replace(/[^0-9A-Za-z\/+=]*/g,""))}function Ae(e,t){return"-----BEGIN "+t+"-----\r\n"+Se(e)+"\r\n-----END "+t+"-----\r\n"}function Te(e,t){if(-1==e.indexOf("-----BEGIN "))throw"can't find PEM header: "+t;return Ce(e=void 0!==t?(e=e.replace(new RegExp("^[^]*-----BEGIN "+t+"-----"),"")).replace(new RegExp("-----END "+t+"-----[^]*$"),""):(e=e.replace(/^[^]*-----BEGIN [^-]+-----/,"")).replace(/-----END [^-]+-----[^]*$/,""))}function Oe(e){var t,n,r,i,o,a,s,c,u,l,d;if(d=e.match(/^(\d{2}|\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(|\.\d+)Z$/))return c=d[1],t=parseInt(c),2===c.length&&(50<=t&&t<100?t=1900+t:0<=t&&t<50&&(t=2e3+t)),n=parseInt(d[2])-1,r=parseInt(d[3]),i=parseInt(d[4]),o=parseInt(d[5]),a=parseInt(d[6]),s=0,""!==(u=d[7])&&(l=(u.substr(1)+"00").substr(0,3),s=parseInt(l)),Date.UTC(t,n,r,i,o,a,s);throw"unsupported zulu format: "+e}function Pe(e){return~~(Oe(e)/1e3)}function Ie(e){return e.replace(/%/g,"")}function je(e){return e.replace(/(..)/g,"%$1")}function Ne(e){var t="malformed IPv6 address";if(!e.match(/^[0-9A-Fa-f:]+$/))throw t;var n=(e=e.toLowerCase()).split(":").length-1;if(n<2)throw t;var r=":".repeat(7-n+2),i=(e=e.replace("::",r)).split(":");if(8!=i.length)throw t;for(var o=0;o<8;o++)i[o]=("0000"+i[o]).slice(-4);return i.join("")}function Fe(e){if(!e.match(/^[0-9A-Fa-f]{32}$/))throw"malformed IPv6 address octet";for(var t=(e=e.toLowerCase()).match(/.{1,4}/g),n=0;n<8;n++)t[n]=t[n].replace(/^0+/,""),""==t[n]&&(t[n]="0");var r=(e=":"+t.join(":")+":").match(/:(0:){2,}/g);if(null===r)return e.slice(1,-1);var i="";for(n=0;n<r.length;n++)r[n].length>i.length&&(i=r[n]);return(e=e.replace(i,"::")).slice(1,-1)}function Re(e){var t="malformed hex value";if(!e.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw t;if(8!=e.length)return 32==e.length?Fe(e):e;try{return parseInt(e.substr(0,2),16)+"."+parseInt(e.substr(2,2),16)+"."+parseInt(e.substr(4,2),16)+"."+parseInt(e.substr(6,2),16)}catch(e){throw t}}function Le(e){return e.match(/.{4}/g).map((function(e){var t=parseInt(e.substr(0,2),16),n=parseInt(e.substr(2),16);if(0==t&n<128)return String.fromCharCode(n);if(t<8){var r=128|63&n;return xe((192|(7&t)<<3|(192&n)>>6).toString(16)+r.toString(16))}r=128|(15&t)<<2|(192&n)>>6;var i=128|63&n;return xe((224|(240&t)>>4).toString(16)+r.toString(16)+i.toString(16))})).join("")}function De(e){for(var t=encodeURIComponent(e),n="",r=0;r<t.length;r++)"%"==t[r]?(n+=t.substr(r,3),r+=2):n=n+"%"+me(t[r]);return n}function Me(e){return!(e.length%2!=0||!e.match(/^[0-9a-f]+$/)&&!e.match(/^[0-9A-F]+$/))}function Ue(e){return e.length%2==1?"0"+e:e.substr(0,1)>"7"?"00"+e:e}de.getLblen=function(e,t){if("8"!=e.substr(t+2,1))return 1;var n=parseInt(e.substr(t+3,1));return 0==n?-1:0<n&&n<10?n+1:-2},de.getL=function(e,t){var n=de.getLblen(e,t);return n<1?"":e.substr(t+2,2*n)},de.getVblen=function(e,t){var n;return""==(n=de.getL(e,t))?-1:("8"===n.substr(0,1)?new _(n.substr(2),16):new _(n,16)).intValue()},de.getVidx=function(e,t){var n=de.getLblen(e,t);return n<0?n:t+2*(n+1)},de.getV=function(e,t){var n=de.getVidx(e,t),r=de.getVblen(e,t);return e.substr(n,2*r)},de.getTLV=function(e,t){return e.substr(t,2)+de.getL(e,t)+de.getV(e,t)},de.getTLVblen=function(e,t){return 2+2*de.getLblen(e,t)+2*de.getVblen(e,t)},de.getNextSiblingIdx=function(e,t){return de.getVidx(e,t)+2*de.getVblen(e,t)},de.getChildIdx=function(e,t){var n,r,i,o=de,a=[];n=o.getVidx(e,t),r=2*o.getVblen(e,t),"03"==e.substr(t,2)&&(n+=2,r-=2),i=0;for(var s=n;i<=r;){var c=o.getTLVblen(e,s);if((i+=c)<=r&&a.push(s),s+=c,i>=r)break}return a},de.getNthChildIdx=function(e,t,n){return de.getChildIdx(e,t)[n]},de.getIdxbyList=function(e,t,n,r){var i,o,a=de;return 0==n.length?void 0!==r&&e.substr(t,2)!==r?-1:t:(i=n.shift())>=(o=a.getChildIdx(e,t)).length?-1:a.getIdxbyList(e,o[i],n,r)},de.getIdxbyListEx=function(e,t,n,r){var i,o,a=de;if(0==n.length)return void 0!==r&&e.substr(t,2)!==r?-1:t;i=n.shift(),o=a.getChildIdx(e,t);for(var s=0,c=0;c<o.length;c++){var u=e.substr(o[c],2);if("number"==typeof i&&!a.isContextTag(u)&&s==i||"string"==typeof i&&a.isContextTag(u,i))return a.getIdxbyListEx(e,o[c],n,r);a.isContextTag(u)||s++}return-1},de.getTLVbyList=function(e,t,n,r){var i=de,o=i.getIdxbyList(e,t,n,r);return-1==o||o>=e.length?null:i.getTLV(e,o)},de.getTLVbyListEx=function(e,t,n,r){var i=de,o=i.getIdxbyListEx(e,t,n,r);return-1==o?null:i.getTLV(e,o)},de.getVbyList=function(e,t,n,r,i){var o,a,s=de;return-1==(o=s.getIdxbyList(e,t,n,r))||o>=e.length?null:(a=s.getV(e,o),!0===i&&(a=a.substr(2)),a)},de.getVbyListEx=function(e,t,n,r,i){var o,a,s=de;return-1==(o=s.getIdxbyListEx(e,t,n,r))?null:(a=s.getV(e,o),"03"==e.substr(o,2)&&!1!==i&&(a=a.substr(2)),a)},de.getInt=function(e,t,n){null==n&&(n=-1);try{var r=e.substr(t,2);if("02"!=r&&"03"!=r)return n;var i=de.getV(e,t);return"02"==r?parseInt(i,16):function(e){try{var t=e.substr(0,2);if("00"==t)return parseInt(e.substr(2),16);var n=parseInt(t,16),r=e.substr(2),i=parseInt(r,16).toString(2);return"0"==i&&(i="00000000"),i=i.slice(0,0-n),parseInt(i,2)}catch(e){return-1}}(i)}catch(e){return n}},de.getOID=function(e,t,n){null==n&&(n=null);try{return"06"!=e.substr(t,2)?n:function(e){if(!Me(e))return null;try{var t=[],n=e.substr(0,2),r=parseInt(n,16);t[0]=new String(Math.floor(r/40)),t[1]=new String(r%40);for(var i=e.substr(2),o=[],a=0;a<i.length/2;a++)o.push(parseInt(i.substr(2*a,2),16));var s=[],c="";for(a=0;a<o.length;a++)128&o[a]?c+=Be((127&o[a]).toString(2),7):(c+=Be((127&o[a]).toString(2),7),s.push(new String(parseInt(c,2))),c="");var u=t.join(".");return s.length>0&&(u=u+"."+s.join(".")),u}catch(e){return null}}(de.getV(e,t))}catch(e){return n}},de.getOIDName=function(e,t,n){null==n&&(n=null);try{var r=de.getOID(e,t,n);if(r==n)return n;var i=ce.asn1.x509.OID.oid2name(r);return""==i?r:i}catch(e){return n}},de.getString=function(e,t,n){null==n&&(n=null);try{return _e(de.getV(e,t))}catch(e){return n}},de.hextooidstr=function(e){var t=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},n=[],r=e.substr(0,2),i=parseInt(r,16);n[0]=new String(Math.floor(i/40)),n[1]=new String(i%40);for(var o=e.substr(2),a=[],s=0;s<o.length/2;s++)a.push(parseInt(o.substr(2*s,2),16));var c=[],u="";for(s=0;s<a.length;s++)128&a[s]?u+=t((127&a[s]).toString(2),7):(u+=t((127&a[s]).toString(2),7),c.push(new String(parseInt(u,2))),u="");var l=n.join(".");return c.length>0&&(l=l+"."+c.join(".")),l},de.dump=function(e,t,n,r){var i=de,o=i.getV,a=i.dump,s=i.getChildIdx,c=e;e instanceof ce.asn1.ASN1Object&&(c=e.getEncodedHex());var u=function(e,t){return e.length<=2*t?e:e.substr(0,t)+"..(total "+e.length/2+"bytes).."+e.substr(e.length-t,t)};void 0===t&&(t={ommit_long_octet:32}),void 0===n&&(n=0),void 0===r&&(r="");var l,d=t.ommit_long_octet;if("01"==(l=c.substr(n,2)))return"00"==(p=o(c,n))?r+"BOOLEAN FALSE\n":r+"BOOLEAN TRUE\n";if("02"==l)return r+"INTEGER "+u(p=o(c,n),d)+"\n";if("03"==l){var p=o(c,n);return i.isASN1HEX(p.substr(2))?(x=r+"BITSTRING, encapsulates\n")+a(p.substr(2),t,0,r+" "):r+"BITSTRING "+u(p,d)+"\n"}if("04"==l)return p=o(c,n),i.isASN1HEX(p)?(x=r+"OCTETSTRING, encapsulates\n")+a(p,t,0,r+" "):r+"OCTETSTRING "+u(p,d)+"\n";if("05"==l)return r+"NULL\n";if("06"==l){var f=o(c,n),h=ce.asn1.ASN1Util.oidHexToInt(f),m=ce.asn1.x509.OID.oid2name(h),g=h.replace(/\./g," ");return""!=m?r+"ObjectIdentifier "+m+" ("+g+")\n":r+"ObjectIdentifier ("+g+")\n"}if("0a"==l)return r+"ENUMERATED "+parseInt(o(c,n))+"\n";if("0c"==l)return r+"UTF8String '"+xe(o(c,n))+"'\n";if("13"==l)return r+"PrintableString '"+xe(o(c,n))+"'\n";if("14"==l)return r+"TeletexString '"+xe(o(c,n))+"'\n";if("16"==l)return r+"IA5String '"+xe(o(c,n))+"'\n";if("17"==l)return r+"UTCTime "+xe(o(c,n))+"\n";if("18"==l)return r+"GeneralizedTime "+xe(o(c,n))+"\n";if("1a"==l)return r+"VisualString '"+xe(o(c,n))+"'\n";if("1e"==l)return r+"BMPString '"+Le(o(c,n))+"'\n";if("30"==l){if("3000"==c.substr(n,4))return r+"SEQUENCE {}\n";x=r+"SEQUENCE\n";var v=t;if((2==(w=s(c,n)).length||3==w.length)&&"06"==c.substr(w[0],2)&&"04"==c.substr(w[w.length-1],2)){m=i.oidname(o(c,w[0]));var y=JSON.parse(JSON.stringify(t));y.x509ExtName=m,v=y}for(var b=0;b<w.length;b++)x+=a(c,v,w[b],r+" ");return x}if("31"==l){x=r+"SET\n";var w=s(c,n);for(b=0;b<w.length;b++)x+=a(c,t,w[b],r+" ");return x}if(0!=(128&(l=parseInt(l,16)))){var x,_=31&l;if(0!=(32&l)){for(x=r+"["+_+"]\n",w=s(c,n),b=0;b<w.length;b++)x+=a(c,t,w[b],r+" ");return x}return p=o(c,n),de.isASN1HEX(p)?(x=r+"["+_+"]\n")+a(p,t,0,r+" "):(("68747470"==p.substr(0,8)||"subjectAltName"===t.x509ExtName&&2==_)&&(p=xe(p)),r+"["+_+"] "+p+"\n")}return r+"UNKNOWN("+l+") "+o(c,n)+"\n"},de.isContextTag=function(e,t){var n,r;e=e.toLowerCase();try{n=parseInt(e,16)}catch(e){return-1}if(void 0===t)return 128==(192&n);try{return null!=t.match(/^\[[0-9]+\]$/)&&!((r=parseInt(t.substr(1,t.length-1),10))>31)&&128==(192&n)&&(31&n)==r}catch(e){return!1}},de.isASN1HEX=function(e){var t=de;if(e.length%2==1)return!1;var n=t.getVblen(e,0),r=e.substr(0,2),i=t.getL(e,0);return e.length-r.length-i.length==2*n},de.checkStrictDER=function(e,t,n,r,i){var o=de;if(void 0===n){if("string"!=typeof e)throw new Error("not hex string");if(e=e.toLowerCase(),!ce.lang.String.isHex(e))throw new Error("not hex string");n=e.length,i=(r=e.length/2)<128?1:Math.ceil(r.toString(16))+1}if(o.getL(e,t).length>2*i)throw new Error("L of TLV too long: idx="+t);var a=o.getVblen(e,t);if(a>r)throw new Error("value of L too long than hex: idx="+t);var s=o.getTLV(e,t),c=s.length-2-o.getL(e,t).length;if(c!==2*a)throw new Error("V string length and L's value not the same:"+c+"/"+2*a);if(0===t&&e.length!=s.length)throw new Error("total length and TLV length unmatch:"+e.length+"!="+s.length);var u=e.substr(t,2);if("02"===u){var l=o.getVidx(e,t);if("00"==e.substr(l,2)&&e.charCodeAt(l+2)<56)throw new Error("not least zeros for DER INTEGER")}if(32&parseInt(u,16)){for(var d=o.getVblen(e,t),p=0,f=o.getChildIdx(e,t),h=0;h<f.length;h++)p+=o.getTLV(e,f[h]).length,o.checkStrictDER(e,f[h],n,r,i);if(2*d!=p)throw new Error("sum of children's TLV length and L unmatch: "+2*d+"!="+p)}},de.oidname=function(e){var t=ce.asn1;ce.lang.String.isHex(e)&&(e=t.ASN1Util.oidHexToInt(e));var n=t.x509.OID.oid2name(e);return""===n&&(n=e),n},void 0!==ce&&ce||(t.KJUR=ce={}),void 0!==ce.lang&&ce.lang||(ce.lang={}),ce.lang.String=function(){},"function"==typeof e?(t.utf8tob64u=ue=function(t){return ge(e.from(t,"utf8").toString("base64"))},t.b64utoutf8=le=function(t){return e.from(ve(t),"base64").toString("utf8")}):(t.utf8tob64u=ue=function(e){return ye(Ie(De(e)))},t.b64utoutf8=le=function(e){return decodeURIComponent(je(be(e)))}),ce.lang.String.isInteger=function(e){return!!e.match(/^[0-9]+$/)||!!e.match(/^-[0-9]+$/)},ce.lang.String.isHex=function(e){return Me(e)},ce.lang.String.isBase64=function(e){return!(!(e=e.replace(/\s+/g,"")).match(/^[0-9A-Za-z+\/]+={0,3}$/)||e.length%4!=0)},ce.lang.String.isBase64URL=function(e){return!e.match(/[+/=]/)&&(e=ve(e),ce.lang.String.isBase64(e))},ce.lang.String.isIntegerArray=function(e){return!!(e=e.replace(/\s+/g,"")).match(/^\[[0-9,]+\]$/)},ce.lang.String.isPrintable=function(e){return null!==e.match(/^[0-9A-Za-z '()+,-./:=?]*$/)},ce.lang.String.isIA5=function(e){return null!==e.match(/^[\x20-\x21\x23-\x7f]*$/)},ce.lang.String.isMail=function(e){return null!==e.match(/^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]{1,}\.[A-Za-z0-9]{1,}$/)};var Be=function(e,t,n){return null==n&&(n="0"),e.length>=t?e:new Array(t-e.length+1).join(n)+e};function He(e,t){var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.superclass=t.prototype,t.prototype.constructor==Object.prototype.constructor&&(t.prototype.constructor=t)}void 0!==ce&&ce||(t.KJUR=ce={}),void 0!==ce.crypto&&ce.crypto||(ce.crypto={}),ce.crypto.Util=new function(){this.DIGESTINFOHEAD={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},this.DEFAULTPROVIDER={md5:"cryptojs",sha1:"cryptojs",sha224:"cryptojs",sha256:"cryptojs",sha384:"cryptojs",sha512:"cryptojs",ripemd160:"cryptojs",hmacmd5:"cryptojs",hmacsha1:"cryptojs",hmacsha224:"cryptojs",hmacsha256:"cryptojs",hmacsha384:"cryptojs",hmacsha512:"cryptojs",hmacripemd160:"cryptojs",MD5withRSA:"cryptojs/jsrsa",SHA1withRSA:"cryptojs/jsrsa",SHA224withRSA:"cryptojs/jsrsa",SHA256withRSA:"cryptojs/jsrsa",SHA384withRSA:"cryptojs/jsrsa",SHA512withRSA:"cryptojs/jsrsa",RIPEMD160withRSA:"cryptojs/jsrsa",MD5withECDSA:"cryptojs/jsrsa",SHA1withECDSA:"cryptojs/jsrsa",SHA224withECDSA:"cryptojs/jsrsa",SHA256withECDSA:"cryptojs/jsrsa",SHA384withECDSA:"cryptojs/jsrsa",SHA512withECDSA:"cryptojs/jsrsa",RIPEMD160withECDSA:"cryptojs/jsrsa",SHA1withDSA:"cryptojs/jsrsa",SHA224withDSA:"cryptojs/jsrsa",SHA256withDSA:"cryptojs/jsrsa",MD5withRSAandMGF1:"cryptojs/jsrsa",SHAwithRSAandMGF1:"cryptojs/jsrsa",SHA1withRSAandMGF1:"cryptojs/jsrsa",SHA224withRSAandMGF1:"cryptojs/jsrsa",SHA256withRSAandMGF1:"cryptojs/jsrsa",SHA384withRSAandMGF1:"cryptojs/jsrsa",SHA512withRSAandMGF1:"cryptojs/jsrsa",RIPEMD160withRSAandMGF1:"cryptojs/jsrsa"},this.CRYPTOJSMESSAGEDIGESTNAME={md5:g.algo.MD5,sha1:g.algo.SHA1,sha224:g.algo.SHA224,sha256:g.algo.SHA256,sha384:g.algo.SHA384,sha512:g.algo.SHA512,ripemd160:g.algo.RIPEMD160},this.getDigestInfoHex=function(e,t){if(void 0===this.DIGESTINFOHEAD[t])throw"alg not supported in Util.DIGESTINFOHEAD: "+t;return this.DIGESTINFOHEAD[t]+e},this.getPaddedDigestInfoHex=function(e,t,n){var r=this.getDigestInfoHex(e,t),i=n/4;if(r.length+22>i)throw"key is too short for SigAlg: keylen="+n+","+t;for(var o="0001",a="00"+r,s="",c=i-o.length-a.length,u=0;u<c;u+=2)s+="ff";return o+s+a},this.hashString=function(e,t){return new ce.crypto.MessageDigest({alg:t}).digestString(e)},this.hashHex=function(e,t){return new ce.crypto.MessageDigest({alg:t}).digestHex(e)},this.sha1=function(e){return this.hashString(e,"sha1")},this.sha256=function(e){return this.hashString(e,"sha256")},this.sha256Hex=function(e){return this.hashHex(e,"sha256")},this.sha512=function(e){return this.hashString(e,"sha512")},this.sha512Hex=function(e){return this.hashHex(e,"sha512")},this.isKey=function(e){return e instanceof re||e instanceof ce.crypto.DSA||e instanceof ce.crypto.ECDSA}},ce.crypto.Util.md5=function(e){return new ce.crypto.MessageDigest({alg:"md5",prov:"cryptojs"}).digestString(e)},ce.crypto.Util.ripemd160=function(e){return new ce.crypto.MessageDigest({alg:"ripemd160",prov:"cryptojs"}).digestString(e)},ce.crypto.Util.SECURERANDOMGEN=new ee,ce.crypto.Util.getRandomHexOfNbytes=function(e){var t=new Array(e);return ce.crypto.Util.SECURERANDOMGEN.nextBytes(t),he(t)},ce.crypto.Util.getRandomBigIntegerOfNbytes=function(e){return new _(ce.crypto.Util.getRandomHexOfNbytes(e),16)},ce.crypto.Util.getRandomHexOfNbits=function(e){var t=e%8,n=new Array((e-t)/8+1);return ce.crypto.Util.SECURERANDOMGEN.nextBytes(n),n[0]=(255<<t&255^255)&n[0],he(n)},ce.crypto.Util.getRandomBigIntegerOfNbits=function(e){return new _(ce.crypto.Util.getRandomHexOfNbits(e),16)},ce.crypto.Util.getRandomBigIntegerZeroToMax=function(e){for(var t=e.bitLength();;){var n=ce.crypto.Util.getRandomBigIntegerOfNbits(t);if(-1!=e.compareTo(n))return n}},ce.crypto.Util.getRandomBigIntegerMinToMax=function(e,t){var n=e.compareTo(t);if(1==n)throw"biMin is greater than biMax";if(0==n)return e;var r=t.subtract(e);return ce.crypto.Util.getRandomBigIntegerZeroToMax(r).add(e)},ce.crypto.MessageDigest=function(e){this.setAlgAndProvider=function(e,t){if(null!==(e=ce.crypto.MessageDigest.getCanonicalAlgName(e))&&void 0===t&&(t=ce.crypto.Util.DEFAULTPROVIDER[e]),-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(e)&&"cryptojs"==t){try{this.md=ce.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[e].create()}catch(t){throw"setAlgAndProvider hash alg set fail alg="+e+"/"+t}this.updateString=function(e){this.md.update(e)},this.updateHex=function(e){var t=g.enc.Hex.parse(e);this.md.update(t)},this.digest=function(){return this.md.finalize().toString(g.enc.Hex)},this.digestString=function(e){return this.updateString(e),this.digest()},this.digestHex=function(e){return this.updateHex(e),this.digest()}}if(-1!=":sha256:".indexOf(e)&&"sjcl"==t){try{this.md=new sjcl.hash.sha256}catch(t){throw"setAlgAndProvider hash alg set fail alg="+e+"/"+t}this.updateString=function(e){this.md.update(e)},this.updateHex=function(e){var t=sjcl.codec.hex.toBits(e);this.md.update(t)},this.digest=function(){var e=this.md.finalize();return sjcl.codec.hex.fromBits(e)},this.digestString=function(e){return this.updateString(e),this.digest()},this.digestHex=function(e){return this.updateHex(e),this.digest()}}},this.updateString=function(e){throw"updateString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.updateHex=function(e){throw"updateHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digest=function(){throw"digest() not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestString=function(e){throw"digestString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestHex=function(e){throw"digestHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},void 0!==e&&void 0!==e.alg&&(this.algName=e.alg,void 0===e.prov&&(this.provName=ce.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))},ce.crypto.MessageDigest.getCanonicalAlgName=function(e){return"string"==typeof e&&(e=(e=e.toLowerCase()).replace(/-/,"")),e},ce.crypto.MessageDigest.getHashLength=function(e){var t=ce.crypto.MessageDigest,n=t.getCanonicalAlgName(e);if(void 0===t.HASHLENGTH[n])throw"not supported algorithm: "+e;return t.HASHLENGTH[n]},ce.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20},ce.crypto.Mac=function(e){this.setAlgAndProvider=function(e,t){if(null==(e=e.toLowerCase())&&(e="hmacsha1"),"hmac"!=(e=e.toLowerCase()).substr(0,4))throw"setAlgAndProvider unsupported HMAC alg: "+e;void 0===t&&(t=ce.crypto.Util.DEFAULTPROVIDER[e]),this.algProv=e+"/"+t;var n=e.substr(4);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(n)&&"cryptojs"==t){try{var r=ce.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[n];this.mac=g.algo.HMAC.create(r,this.pass)}catch(e){throw"setAlgAndProvider hash alg set fail hashAlg="+n+"/"+e}this.updateString=function(e){this.mac.update(e)},this.updateHex=function(e){var t=g.enc.Hex.parse(e);this.mac.update(t)},this.doFinal=function(){return this.mac.finalize().toString(g.enc.Hex)},this.doFinalString=function(e){return this.updateString(e),this.doFinal()},this.doFinalHex=function(e){return this.updateHex(e),this.doFinal()}}},this.updateString=function(e){throw"updateString(str) not supported for this alg/prov: "+this.algProv},this.updateHex=function(e){throw"updateHex(hex) not supported for this alg/prov: "+this.algProv},this.doFinal=function(){throw"digest() not supported for this alg/prov: "+this.algProv},this.doFinalString=function(e){throw"digestString(str) not supported for this alg/prov: "+this.algProv},this.doFinalHex=function(e){throw"digestHex(hex) not supported for this alg/prov: "+this.algProv},this.setPassword=function(e){if("string"==typeof e){var t=e;return e.length%2!=1&&e.match(/^[0-9A-Fa-f]+$/)||(t=Ee(e)),void(this.pass=g.enc.Hex.parse(t))}if("object"!=(void 0===e?"undefined":f(e)))throw"KJUR.crypto.Mac unsupported password type: "+e;if(t=null,void 0!==e.hex){if(e.hex.length%2!=0||!e.hex.match(/^[0-9A-Fa-f]+$/))throw"Mac: wrong hex password: "+e.hex;t=e.hex}if(void 0!==e.utf8&&(t=we(e.utf8)),void 0!==e.rstr&&(t=Ee(e.rstr)),void 0!==e.b64&&(t=w(e.b64)),void 0!==e.b64u&&(t=be(e.b64u)),null==t)throw"KJUR.crypto.Mac unsupported password type: "+e;this.pass=g.enc.Hex.parse(t)},void 0!==e&&(void 0!==e.pass&&this.setPassword(e.pass),void 0!==e.alg&&(this.algName=e.alg,void 0===e.prov&&(this.provName=ce.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName)))},ce.crypto.Signature=function(e){var t=null;if(this._setAlgNames=function(){var e=this.algName.match(/^(.+)with(.+)$/);e&&(this.mdAlgName=e[1].toLowerCase(),this.pubkeyAlgName=e[2].toLowerCase(),"rsaandmgf1"==this.pubkeyAlgName&&"sha"==this.mdAlgName&&(this.mdAlgName="sha1"))},this._zeroPaddingOfSignature=function(e,t){for(var n="",r=t/4-e.length,i=0;i<r;i++)n+="0";return n+e},this.setAlgAndProvider=function(e,t){if(this._setAlgNames(),"cryptojs/jsrsa"!=t)throw new Error("provider not supported: "+t);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)){try{this.md=new ce.crypto.MessageDigest({alg:this.mdAlgName})}catch(e){throw new Error("setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+e)}this.init=function(e,t){var n=null;try{n=void 0===t?qe.getKey(e):qe.getKey(e,t)}catch(e){throw"init failed:"+e}if(!0===n.isPrivate)this.prvKey=n,this.state="SIGN";else{if(!0!==n.isPublic)throw"init failed.:"+n;this.pubKey=n,this.state="VERIFY"}},this.updateString=function(e){this.md.updateString(e)},this.updateHex=function(e){this.md.updateHex(e)},this.sign=function(){if(this.sHashHex=this.md.digest(),void 0===this.prvKey&&void 0!==this.ecprvhex&&void 0!==this.eccurvename&&void 0!==ce.crypto.ECDSA&&(this.prvKey=new ce.crypto.ECDSA({curve:this.eccurvename,prv:this.ecprvhex})),this.prvKey instanceof re&&"rsaandmgf1"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHashPSS(this.sHashHex,this.mdAlgName,this.pssSaltLen);else if(this.prvKey instanceof re&&"rsa"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex,this.mdAlgName);else if(this.prvKey instanceof ce.crypto.ECDSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else{if(!(this.prvKey instanceof ce.crypto.DSA))throw"Signature: unsupported private key alg: "+this.pubkeyAlgName;this.hSign=this.prvKey.signWithMessageHash(this.sHashHex)}return this.hSign},this.signString=function(e){return this.updateString(e),this.sign()},this.signHex=function(e){return this.updateHex(e),this.sign()},this.verify=function(e){if(this.sHashHex=this.md.digest(),void 0===this.pubKey&&void 0!==this.ecpubhex&&void 0!==this.eccurvename&&void 0!==ce.crypto.ECDSA&&(this.pubKey=new ce.crypto.ECDSA({curve:this.eccurvename,pub:this.ecpubhex})),this.pubKey instanceof re&&"rsaandmgf1"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,e,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof re&&"rsa"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHash(this.sHashHex,e);if(void 0!==ce.crypto.ECDSA&&this.pubKey instanceof ce.crypto.ECDSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,e);if(void 0!==ce.crypto.DSA&&this.pubKey instanceof ce.crypto.DSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,e);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName}}},this.init=function(e,t){throw"init(key, pass) not supported for this alg:prov="+this.algProvName},this.updateString=function(e){throw"updateString(str) not supported for this alg:prov="+this.algProvName},this.updateHex=function(e){throw"updateHex(hex) not supported for this alg:prov="+this.algProvName},this.sign=function(){throw"sign() not supported for this alg:prov="+this.algProvName},this.signString=function(e){throw"digestString(str) not supported for this alg:prov="+this.algProvName},this.signHex=function(e){throw"digestHex(hex) not supported for this alg:prov="+this.algProvName},this.verify=function(e){throw"verify(hSigVal) not supported for this alg:prov="+this.algProvName},this.initParams=e,void 0!==e&&(void 0!==e.alg&&(this.algName=e.alg,void 0===e.prov?this.provName=ce.crypto.Util.DEFAULTPROVIDER[this.algName]:this.provName=e.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),void 0!==e.psssaltlen&&(this.pssSaltLen=e.psssaltlen),void 0!==e.prvkeypem)){if(void 0!==e.prvkeypas)throw"both prvkeypem and prvkeypas parameters not supported";try{t=qe.getKey(e.prvkeypem),this.init(t)}catch(e){throw"fatal error to load pem private key: "+e}}},ce.crypto.Cipher=function(e){},ce.crypto.Cipher.encrypt=function(e,t,n){if(t instanceof re&&t.isPublic){var r=ce.crypto.Cipher.getAlgByKeyAndName(t,n);if("RSA"===r)return t.encrypt(e);if("RSAOAEP"===r)return t.encryptOAEP(e,"sha1");var i=r.match(/^RSAOAEP(\d+)$/);if(null!==i)return t.encryptOAEP(e,"sha"+i[1]);throw"Cipher.encrypt: unsupported algorithm for RSAKey: "+n}throw"Cipher.encrypt: unsupported key or algorithm"},ce.crypto.Cipher.decrypt=function(e,t,n){if(t instanceof re&&t.isPrivate){var r=ce.crypto.Cipher.getAlgByKeyAndName(t,n);if("RSA"===r)return t.decrypt(e);if("RSAOAEP"===r)return t.decryptOAEP(e,"sha1");var i=r.match(/^RSAOAEP(\d+)$/);if(null!==i)return t.decryptOAEP(e,"sha"+i[1]);throw"Cipher.decrypt: unsupported algorithm for RSAKey: "+n}throw"Cipher.decrypt: unsupported key or algorithm"},ce.crypto.Cipher.getAlgByKeyAndName=function(e,t){if(e instanceof re){if(-1!=":RSA:RSAOAEP:RSAOAEP224:RSAOAEP256:RSAOAEP384:RSAOAEP512:".indexOf(t))return t;if(null==t)return"RSA";throw"getAlgByKeyAndName: not supported algorithm name for RSAKey: "+t}throw"getAlgByKeyAndName: not supported algorithm name: "+t},ce.crypto.OID=new function(){this.oidhex2name={"2a864886f70d010101":"rsaEncryption","2a8648ce3d0201":"ecPublicKey","2a8648ce380401":"dsa","2a8648ce3d030107":"secp256r1","2b8104001f":"secp192k1","2b81040021":"secp224r1","2b8104000a":"secp256k1","2b81040023":"secp521r1","2b81040022":"secp384r1","2a8648ce380403":"SHA1withDSA","608648016503040301":"SHA224withDSA","608648016503040302":"SHA256withDSA"}},void 0!==ce&&ce||(t.KJUR=ce={}),void 0!==ce.crypto&&ce.crypto||(ce.crypto={}),ce.crypto.ECDSA=function(e){var t=Error,n=_,r=oe,i=ce.crypto.ECDSA,o=ce.crypto.ECParameterDB,a=i.getName,s=de,c=s.getVbyListEx,u=s.isASN1HEX,l=new ee;this.type="EC",this.isPrivate=!1,this.isPublic=!1,this.getBigRandom=function(e){return new n(e.bitLength(),l).mod(e.subtract(n.ONE)).add(n.ONE)},this.setNamedCurve=function(e){this.ecparams=o.getByName(e),this.prvKeyHex=null,this.pubKeyHex=null,this.curveName=e},this.setPrivateKeyHex=function(e){this.isPrivate=!0,this.prvKeyHex=e},this.setPublicKeyHex=function(e){this.isPublic=!0,this.pubKeyHex=e},this.getPublicKeyXYHex=function(){var e=this.pubKeyHex;if("04"!==e.substr(0,2))throw"this method supports uncompressed format(04) only";var t=this.ecparams.keylen/4;if(e.length!==2+2*t)throw"malformed public key hex length";var n={};return n.x=e.substr(2,t),n.y=e.substr(2+t),n},this.getShortNISTPCurveName=function(){var e=this.curveName;return"secp256r1"===e||"NIST P-256"===e||"P-256"===e||"prime256v1"===e?"P-256":"secp384r1"===e||"NIST P-384"===e||"P-384"===e?"P-384":null},this.generateKeyPairHex=function(){var e=this.ecparams.n,t=this.getBigRandom(e),n=this.ecparams.G.multiply(t),r=n.getX().toBigInteger(),i=n.getY().toBigInteger(),o=this.ecparams.keylen/4,a=("0000000000"+t.toString(16)).slice(-o),s="04"+("0000000000"+r.toString(16)).slice(-o)+("0000000000"+i.toString(16)).slice(-o);return this.setPrivateKeyHex(a),this.setPublicKeyHex(s),{ecprvhex:a,ecpubhex:s}},this.signWithMessageHash=function(e){return this.signHex(e,this.prvKeyHex)},this.signHex=function(e,t){var r=new n(t,16),o=this.ecparams.n,a=new n(e.substring(0,this.ecparams.keylen/4),16);do{var s=this.getBigRandom(o),c=this.ecparams.G.multiply(s).getX().toBigInteger().mod(o)}while(c.compareTo(n.ZERO)<=0);var u=s.modInverse(o).multiply(a.add(r.multiply(c))).mod(o);return i.biRSSigToASN1Sig(c,u)},this.sign=function(e,t){var r=t,i=this.ecparams.n,o=n.fromByteArrayUnsigned(e);do{var a=this.getBigRandom(i),s=this.ecparams.G.multiply(a).getX().toBigInteger().mod(i)}while(s.compareTo(_.ZERO)<=0);var c=a.modInverse(i).multiply(o.add(r.multiply(s))).mod(i);return this.serializeSig(s,c)},this.verifyWithMessageHash=function(e,t){return this.verifyHex(e,t,this.pubKeyHex)},this.verifyHex=function(e,t,o){try{var a,s,c=i.parseSigHex(t);a=c.r,s=c.s;var u=r.decodeFromHex(this.ecparams.curve,o),l=new n(e.substring(0,this.ecparams.keylen/4),16);return this.verifyRaw(l,a,s,u)}catch(e){return!1}},this.verify=function(e,t,i){var o,a,s;if(Bitcoin.Util.isArray(t)){var c=this.parseSig(t);o=c.r,a=c.s}else{if("object"!==(void 0===t?"undefined":f(t))||!t.r||!t.s)throw"Invalid value for signature";o=t.r,a=t.s}if(i instanceof oe)s=i;else{if(!Bitcoin.Util.isArray(i))throw"Invalid format for pubkey value, must be byte array or ECPointFp";s=r.decodeFrom(this.ecparams.curve,i)}var u=n.fromByteArrayUnsigned(e);return this.verifyRaw(u,o,a,s)},this.verifyRaw=function(e,t,r,i){var o=this.ecparams.n,a=this.ecparams.G;if(t.compareTo(n.ONE)<0||t.compareTo(o)>=0)return!1;if(r.compareTo(n.ONE)<0||r.compareTo(o)>=0)return!1;var s=r.modInverse(o),c=e.multiply(s).mod(o),u=t.multiply(s).mod(o);return a.multiply(c).add(i.multiply(u)).getX().toBigInteger().mod(o).equals(t)},this.serializeSig=function(e,t){var n=e.toByteArraySigned(),r=t.toByteArraySigned(),i=[];return i.push(2),i.push(n.length),(i=i.concat(n)).push(2),i.push(r.length),(i=i.concat(r)).unshift(i.length),i.unshift(48),i},this.parseSig=function(e){var t;if(48!=e[0])throw new Error("Signature not a valid DERSequence");if(2!=e[t=2])throw new Error("First element in signature must be a DERInteger");var r=e.slice(t+2,t+2+e[t+1]);if(2!=e[t+=2+e[t+1]])throw new Error("Second element in signature must be a DERInteger");var i=e.slice(t+2,t+2+e[t+1]);return t+=2+e[t+1],{r:n.fromByteArrayUnsigned(r),s:n.fromByteArrayUnsigned(i)}},this.parseSigCompact=function(e){if(65!==e.length)throw"Signature has the wrong length";var t=e[0]-27;if(t<0||t>7)throw"Invalid signature type";var r=this.ecparams.n;return{r:n.fromByteArrayUnsigned(e.slice(1,33)).mod(r),s:n.fromByteArrayUnsigned(e.slice(33,65)).mod(r),i:t}},this.readPKCS5PrvKeyHex=function(e){if(!1===u(e))throw new Error("not ASN.1 hex string");var t,n,r;try{t=c(e,0,["[0]",0],"06"),n=c(e,0,[1],"04");try{r=c(e,0,["[1]",0],"03")}catch(e){}}catch(e){throw new Error("malformed PKCS#1/5 plain ECC private key")}if(this.curveName=a(t),void 0===this.curveName)throw"unsupported curve name";this.setNamedCurve(this.curveName),this.setPublicKeyHex(r),this.setPrivateKeyHex(n),this.isPublic=!1},this.readPKCS8PrvKeyHex=function(e){if(!1===u(e))throw new t("not ASN.1 hex string");var n,r,i;try{c(e,0,[1,0],"06"),n=c(e,0,[1,1],"06"),r=c(e,0,[2,0,1],"04");try{i=c(e,0,[2,0,"[1]",0],"03")}catch(e){}}catch(e){throw new t("malformed PKCS#8 plain ECC private key")}if(this.curveName=a(n),void 0===this.curveName)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(i),this.setPrivateKeyHex(r),this.isPublic=!1},this.readPKCS8PubKeyHex=function(e){if(!1===u(e))throw new t("not ASN.1 hex string");var n,r;try{c(e,0,[0,0],"06"),n=c(e,0,[0,1],"06"),r=c(e,0,[1],"03")}catch(e){throw new t("malformed PKCS#8 ECC public key")}if(this.curveName=a(n),null===this.curveName)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(r)},this.readCertPubKeyHex=function(e,n){if(!1===u(e))throw new t("not ASN.1 hex string");var r,i;try{r=c(e,0,[0,5,0,1],"06"),i=c(e,0,[0,5,1],"03")}catch(e){throw new t("malformed X.509 certificate ECC public key")}if(this.curveName=a(r),null===this.curveName)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(i)},void 0!==e&&void 0!==e.curve&&(this.curveName=e.curve),void 0===this.curveName&&(this.curveName="secp256r1"),this.setNamedCurve(this.curveName),void 0!==e&&(void 0!==e.prv&&this.setPrivateKeyHex(e.prv),void 0!==e.pub&&this.setPublicKeyHex(e.pub))},ce.crypto.ECDSA.parseSigHex=function(e){var t=ce.crypto.ECDSA.parseSigHexInHexRS(e);return{r:new _(t.r,16),s:new _(t.s,16)}},ce.crypto.ECDSA.parseSigHexInHexRS=function(e){var t=de,n=t.getChildIdx,r=t.getV;if(t.checkStrictDER(e,0),"30"!=e.substr(0,2))throw new Error("signature is not a ASN.1 sequence");var i=n(e,0);if(2!=i.length)throw new Error("signature shall have two elements");var o=i[0],a=i[1];if("02"!=e.substr(o,2))throw new Error("1st item not ASN.1 integer");if("02"!=e.substr(a,2))throw new Error("2nd item not ASN.1 integer");return{r:r(e,o),s:r(e,a)}},ce.crypto.ECDSA.asn1SigToConcatSig=function(e){var t=ce.crypto.ECDSA.parseSigHexInHexRS(e),n=t.r,r=t.s;if("00"==n.substr(0,2)&&n.length%32==2&&(n=n.substr(2)),"00"==r.substr(0,2)&&r.length%32==2&&(r=r.substr(2)),n.length%32==30&&(n="00"+n),r.length%32==30&&(r="00"+r),n.length%32!=0)throw"unknown ECDSA sig r length error";if(r.length%32!=0)throw"unknown ECDSA sig s length error";return n+r},ce.crypto.ECDSA.concatSigToASN1Sig=function(e){if(e.length/2*8%128!=0)throw"unknown ECDSA concatinated r-s sig length error";var t=e.substr(0,e.length/2),n=e.substr(e.length/2);return ce.crypto.ECDSA.hexRSSigToASN1Sig(t,n)},ce.crypto.ECDSA.hexRSSigToASN1Sig=function(e,t){var n=new _(e,16),r=new _(t,16);return ce.crypto.ECDSA.biRSSigToASN1Sig(n,r)},ce.crypto.ECDSA.biRSSigToASN1Sig=function(e,t){var n=ce.asn1,r=new n.DERInteger({bigint:e}),i=new n.DERInteger({bigint:t});return new n.DERSequence({array:[r,i]}).getEncodedHex()},ce.crypto.ECDSA.getName=function(e){return"2b8104001f"===e?"secp192k1":"2a8648ce3d030107"===e?"secp256r1":"2b8104000a"===e?"secp256k1":"2b81040021"===e?"secp224r1":"2b81040022"===e?"secp384r1":-1!=="|secp256r1|NIST P-256|P-256|prime256v1|".indexOf(e)?"secp256r1":-1!=="|secp256k1|".indexOf(e)?"secp256k1":-1!=="|secp224r1|NIST P-224|P-224|".indexOf(e)?"secp224r1":-1!=="|secp384r1|NIST P-384|P-384|".indexOf(e)?"secp384r1":null},void 0!==ce&&ce||(t.KJUR=ce={}),void 0!==ce.crypto&&ce.crypto||(ce.crypto={}),ce.crypto.ECParameterDB=new function(){var e={},t={};function n(e){return new _(e,16)}this.getByName=function(n){var r=n;if(void 0!==t[r]&&(r=t[n]),void 0!==e[r])return e[r];throw"unregistered EC curve name: "+r},this.regist=function(r,i,o,a,s,c,u,l,d,p,f,h){e[r]={};var m=n(o),g=n(a),v=n(s),y=n(c),b=n(u),w=new ae(m,g,v),x=w.decodePointHex("04"+l+d);e[r].name=r,e[r].keylen=i,e[r].curve=w,e[r].G=x,e[r].n=y,e[r].h=b,e[r].oid=f,e[r].info=h;for(var _=0;_<p.length;_++)t[p[_]]=r}},ce.crypto.ECParameterDB.regist("secp128r1",128,"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC","E87579C11079F43DD824993C2CEE5ED3","FFFFFFFE0000000075A30D1B9038A115","1","161FF7528B899B2D0C28607CA52C5B86","CF5AC8395BAFEB13C02DA292DDED7A83",[],"","secp128r1 : SECG curve over a 128 bit prime field"),ce.crypto.ECParameterDB.regist("secp160k1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73","0","7","0100000000000000000001B8FA16DFAB9ACA16B6B3","1","3B4C382CE37AA192A4019E763036F4F5DD4D7EBB","938CF935318FDCED6BC28286531733C3F03C4FEE",[],"","secp160k1 : SECG curve over a 160 bit prime field"),ce.crypto.ECParameterDB.regist("secp160r1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC","1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45","0100000000000000000001F4C8F927AED3CA752257","1","4A96B5688EF573284664698968C38BB913CBFC82","23A628553168947D59DCC912042351377AC5FB32",[],"","secp160r1 : SECG curve over a 160 bit prime field"),ce.crypto.ECParameterDB.regist("secp192k1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37","0","3","FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D","1","DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D","9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D",[]),ce.crypto.ECParameterDB.regist("secp192r1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC","64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1","FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831","1","188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012","07192B95FFC8DA78631011ED6B24CDD573F977A11E794811",[]),ce.crypto.ECParameterDB.regist("secp224r1",224,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE","B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4","FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D","1","B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21","BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34",[]),ce.crypto.ECParameterDB.regist("secp256k1",256,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F","0","7","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","1","79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798","483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8",[]),ce.crypto.ECParameterDB.regist("secp256r1",256,"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC","5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B","FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551","1","6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296","4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",["NIST P-256","P-256","prime256v1"]),ce.crypto.ECParameterDB.regist("secp384r1",384,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC","B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973","1","AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7","3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f",["NIST P-384","P-384"]),ce.crypto.ECParameterDB.regist("secp521r1",521,"1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC","051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409","1","C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66","011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650",["NIST P-521","P-521"]);var qe=function(){var e=function(e,n,r){return t(g.AES,e,n,r)},t=function(e,t,n,r){var i=g.enc.Hex.parse(t),o=g.enc.Hex.parse(n),a=g.enc.Hex.parse(r),s={};s.key=o,s.iv=a,s.ciphertext=i;var c=e.decrypt(s,o,{iv:a});return g.enc.Hex.stringify(c)},n=function(e,t,n){return r(g.AES,e,t,n)},r=function(e,t,n,r){var i=g.enc.Hex.parse(t),o=g.enc.Hex.parse(n),a=g.enc.Hex.parse(r),s=e.encrypt(i,o,{iv:a}),c=g.enc.Hex.parse(s.toString());return g.enc.Base64.stringify(c)},i={"AES-256-CBC":{proc:e,eproc:n,keylen:32,ivlen:16},"AES-192-CBC":{proc:e,eproc:n,keylen:24,ivlen:16},"AES-128-CBC":{proc:e,eproc:n,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:function(e,n,r){return t(g.TripleDES,e,n,r)},eproc:function(e,t,n){return r(g.TripleDES,e,t,n)},keylen:24,ivlen:8},"DES-CBC":{proc:function(e,n,r){return t(g.DES,e,n,r)},eproc:function(e,t,n){return r(g.DES,e,t,n)},keylen:8,ivlen:8}},o=function(e){var t={},n=e.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));n&&(t.cipher=n[1],t.ivsalt=n[2]);var r=e.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));r&&(t.type=r[1]);var i=-1,o=0;-1!=e.indexOf("\r\n\r\n")&&(i=e.indexOf("\r\n\r\n"),o=2),-1!=e.indexOf("\n\n")&&(i=e.indexOf("\n\n"),o=1);var a=e.indexOf("-----END");if(-1!=i&&-1!=a){var s=e.substring(i+2*o,a-o);s=s.replace(/\s+/g,""),t.data=s}return t},a=function(e,t,n){for(var r=n.substring(0,16),o=g.enc.Hex.parse(r),a=g.enc.Utf8.parse(t),s=i[e].keylen+i[e].ivlen,c="",u=null;;){var l=g.algo.MD5.create();if(null!=u&&l.update(u),l.update(a),l.update(o),u=l.finalize(),(c+=g.enc.Hex.stringify(u)).length>=2*s)break}var d={};return d.keyhex=c.substr(0,2*i[e].keylen),d.ivhex=c.substr(2*i[e].keylen,2*i[e].ivlen),d},s=function(e,t,n,r){var o=g.enc.Base64.parse(e),a=g.enc.Hex.stringify(o);return(0,i[t].proc)(a,n,r)};return{version:"1.0.0",parsePKCS5PEM:function(e){return o(e)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(e,t,n){return a(e,t,n)},decryptKeyB64:function(e,t,n,r){return s(e,t,n,r)},getDecryptedKeyHex:function(e,t){var n=o(e),r=(n.type,n.cipher),i=n.ivsalt,c=n.data,u=a(r,t,i).keyhex;return s(c,r,u,i)},getEncryptedPKCS5PEMFromPrvKeyHex:function(e,t,n,r,o){var s="";if(void 0!==r&&null!=r||(r="AES-256-CBC"),void 0===i[r])throw new Error("KEYUTIL unsupported algorithm: "+r);void 0!==o&&null!=o||(o=function(e){var t=g.lib.WordArray.random(e);return g.enc.Hex.stringify(t)}(i[r].ivlen).toUpperCase());var c=function(e,t,n,r){return(0,i[t].eproc)(e,n,r)}(t,r,a(r,n,o).keyhex,o);return s="-----BEGIN "+e+" PRIVATE KEY-----\r\n",s+="Proc-Type: 4,ENCRYPTED\r\n",s+="DEK-Info: "+r+","+o+"\r\n",s+="\r\n",(s+=c.replace(/(.{64})/g,"$1\r\n"))+"\r\n-----END "+e+" PRIVATE KEY-----\r\n"},parseHexOfEncryptedPKCS8:function(e){var t=de,n=t.getChildIdx,r=t.getV,i={},o=n(e,0);if(2!=o.length)throw new Error("malformed format: SEQUENCE(0).items != 2: "+o.length);i.ciphertext=r(e,o[1]);var a=n(e,o[0]);if(2!=a.length)throw new Error("malformed format: SEQUENCE(0.0).items != 2: "+a.length);if("2a864886f70d01050d"!=r(e,a[0]))throw new Error("this only supports pkcs5PBES2");var s=n(e,a[1]);if(2!=a.length)throw new Error("malformed format: SEQUENCE(0.0.1).items != 2: "+s.length);var c=n(e,s[1]);if(2!=c.length)throw new Error("malformed format: SEQUENCE(0.0.1.1).items != 2: "+c.length);if("2a864886f70d0307"!=r(e,c[0]))throw"this only supports TripleDES";i.encryptionSchemeAlg="TripleDES",i.encryptionSchemeIV=r(e,c[1]);var u=n(e,s[0]);if(2!=u.length)throw new Error("malformed format: SEQUENCE(0.0.1.0).items != 2: "+u.length);if("2a864886f70d01050c"!=r(e,u[0]))throw new Error("this only supports pkcs5PBKDF2");var l=n(e,u[1]);if(l.length<2)throw new Error("malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+l.length);i.pbkdf2Salt=r(e,l[0]);var d=r(e,l[1]);try{i.pbkdf2Iter=parseInt(d,16)}catch(e){throw new Error("malformed format pbkdf2Iter: "+d)}return i},getPBKDF2KeyHexFromParam:function(e,t){var n=g.enc.Hex.parse(e.pbkdf2Salt),r=e.pbkdf2Iter,i=g.PBKDF2(t,n,{keySize:6,iterations:r});return g.enc.Hex.stringify(i)},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(e,t){var n=Te(e,"ENCRYPTED PRIVATE KEY"),r=this.parseHexOfEncryptedPKCS8(n),i=qe.getPBKDF2KeyHexFromParam(r,t),o={};o.ciphertext=g.enc.Hex.parse(r.ciphertext);var a=g.enc.Hex.parse(i),s=g.enc.Hex.parse(r.encryptionSchemeIV),c=g.TripleDES.decrypt(o,a,{iv:s});return g.enc.Hex.stringify(c)},getKeyFromEncryptedPKCS8PEM:function(e,t){var n=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(e,t);return this.getKeyFromPlainPrivatePKCS8Hex(n)},parsePlainPrivatePKCS8Hex:function(e){var t=de,n=t.getChildIdx,r=t.getV,i={algparam:null};if("30"!=e.substr(0,2))throw new Error("malformed plain PKCS8 private key(code:001)");var o=n(e,0);if(o.length<3)throw new Error("malformed plain PKCS8 private key(code:002)");if("30"!=e.substr(o[1],2))throw new Error("malformed PKCS8 private key(code:003)");var a=n(e,o[1]);if(2!=a.length)throw new Error("malformed PKCS8 private key(code:004)");if("06"!=e.substr(a[0],2))throw new Error("malformed PKCS8 private key(code:005)");if(i.algoid=r(e,a[0]),"06"==e.substr(a[1],2)&&(i.algparam=r(e,a[1])),"04"!=e.substr(o[2],2))throw new Error("malformed PKCS8 private key(code:006)");return i.keyidx=t.getVidx(e,o[2]),i},getKeyFromPlainPrivatePKCS8PEM:function(e){var t=Te(e,"PRIVATE KEY");return this.getKeyFromPlainPrivatePKCS8Hex(t)},getKeyFromPlainPrivatePKCS8Hex:function(e){var t,n=this.parsePlainPrivatePKCS8Hex(e);if("2a864886f70d010101"==n.algoid)t=new re;else if("2a8648ce380401"==n.algoid)t=new ce.crypto.DSA;else{if("2a8648ce3d0201"!=n.algoid)throw new Error("unsupported private key algorithm");t=new ce.crypto.ECDSA}return t.readPKCS8PrvKeyHex(e),t},_getKeyFromPublicPKCS8Hex:function(e){var t,n=de.getVbyList(e,0,[0,0],"06");if("2a864886f70d010101"===n)t=new re;else if("2a8648ce380401"===n)t=new ce.crypto.DSA;else{if("2a8648ce3d0201"!==n)throw new Error("unsupported PKCS#8 public key hex");t=new ce.crypto.ECDSA}return t.readPKCS8PubKeyHex(e),t},parsePublicRawRSAKeyHex:function(e){var t=de,n=t.getChildIdx,r=t.getV,i={};if("30"!=e.substr(0,2))throw new Error("malformed RSA key(code:001)");var o=n(e,0);if(2!=o.length)throw new Error("malformed RSA key(code:002)");if("02"!=e.substr(o[0],2))throw new Error("malformed RSA key(code:003)");if(i.n=r(e,o[0]),"02"!=e.substr(o[1],2))throw new Error("malformed RSA key(code:004)");return i.e=r(e,o[1]),i},parsePublicPKCS8Hex:function(e){var t=de,n=t.getChildIdx,r=t.getV,i={algparam:null},o=n(e,0);if(2!=o.length)throw new Error("outer DERSequence shall have 2 elements: "+o.length);var a=o[0];if("30"!=e.substr(a,2))throw new Error("malformed PKCS8 public key(code:001)");var s=n(e,a);if(2!=s.length)throw new Error("malformed PKCS8 public key(code:002)");if("06"!=e.substr(s[0],2))throw new Error("malformed PKCS8 public key(code:003)");if(i.algoid=r(e,s[0]),"06"==e.substr(s[1],2)?i.algparam=r(e,s[1]):"30"==e.substr(s[1],2)&&(i.algparam={},i.algparam.p=t.getVbyList(e,s[1],[0],"02"),i.algparam.q=t.getVbyList(e,s[1],[1],"02"),i.algparam.g=t.getVbyList(e,s[1],[2],"02")),"03"!=e.substr(o[1],2))throw new Error("malformed PKCS8 public key(code:004)");return i.key=r(e,o[1]).substr(2),i}}}();function We(e,t){for(var n="",r=t/4-e.length,i=0;i<r;i++)n+="0";return n+e}function Ke(e,t,n){for(var r="",i=0;r.length<t;)r+=_e(n(Ee(e+String.fromCharCode.apply(String,[(4278190080&i)>>24,(16711680&i)>>16,(65280&i)>>8,255&i])))),i+=1;return r}function Ve(e){for(var t in ce.crypto.Util.DIGESTINFOHEAD){var n=ce.crypto.Util.DIGESTINFOHEAD[t],r=n.length;if(e.substring(0,r)==n)return[t,e.substring(r)]}return[]}function Je(e){var t,n=de,r=n.getChildIdx,i=n.getV,o=n.getTLV,a=n.getVbyList,s=n.getVbyListEx,c=n.getTLVbyList,u=n.getTLVbyListEx,l=n.getIdxbyList,d=n.getIdxbyListEx,p=n.getVidx,f=n.getInt,h=n.oidname,m=n.hextooidstr,g=Te;try{t=ce.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(e){}this.HEX2STAG={"0c":"utf8",13:"prn",16:"ia5","1a":"vis","1e":"bmp"},this.hex=null,this.version=0,this.foffset=0,this.aExtInfo=null,this.getVersion=function(){if(null===this.hex||0!==this.version)return this.version;var e=c(this.hex,0,[0,0]);if("a0"==e.substr(0,2)){var t=c(e,0,[0]),n=f(t,0);if(n<0||2<n)throw new Error("malformed version field");return this.version=n+1,this.version}return this.version=1,this.foffset=-1,1},this.getSerialNumberHex=function(){return s(this.hex,0,[0,0],"02")},this.getSignatureAlgorithmField=function(){var e=u(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(e)},this.getAlgorithmIdentifierName=function(e){for(var n in t)if(e===t[n])return n;return h(s(e,0,[0],"06"))},this.getIssuer=function(){return this.getX500Name(this.getIssuerHex())},this.getIssuerHex=function(){return c(this.hex,0,[0,3+this.foffset],"30")},this.getIssuerString=function(){return this.getIssuer().str},this.getSubject=function(){return this.getX500Name(this.getSubjectHex())},this.getSubjectHex=function(){return c(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){return this.getSubject().str},this.getNotBefore=function(){var e=a(this.hex,0,[0,4+this.foffset,0]);return e=e.replace(/(..)/g,"%$1"),decodeURIComponent(e)},this.getNotAfter=function(){var e=a(this.hex,0,[0,4+this.foffset,1]);return e=e.replace(/(..)/g,"%$1"),decodeURIComponent(e)},this.getPublicKeyHex=function(){return n.getTLVbyList(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyIdx=function(){return l(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var e=this.getPublicKeyIdx();return l(this.hex,e,[1,0],"30")},this.getPublicKey=function(){return qe.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var e=c(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(e)},this.getSignatureValueHex=function(){return a(this.hex,0,[2],"03",!0)},this.verifySignature=function(e){var t=this.getSignatureAlgorithmField(),n=this.getSignatureValueHex(),r=c(this.hex,0,[0],"30"),i=new ce.crypto.Signature({alg:t});return i.init(e),i.updateHex(r),i.verify(n)},this.parseExt=function(e){var t,o,s;if(void 0===e){if(s=this.hex,3!==this.version)return-1;t=l(s,0,[0,7,0],"30"),o=r(s,t)}else{s=Te(e);var c=l(s,0,[0,3,0,0],"06");if("2a864886f70d01090e"!=i(s,c))return void(this.aExtInfo=new Array);t=l(s,0,[0,3,0,1,0],"30"),o=r(s,t),this.hex=s}this.aExtInfo=new Array;for(var u=0;u<o.length;u++){var d={critical:!1},f=0;3===r(s,o[u]).length&&(d.critical=!0,f=1),d.oid=n.hextooidstr(a(s,o[u],[0],"06"));var h=l(s,o[u],[1+f]);d.vidx=p(s,h),this.aExtInfo.push(d)}},this.getExtInfo=function(e){var t=this.aExtInfo,n=e;if(e.match(/^[0-9.]+$/)||(n=ce.asn1.x509.OID.name2oid(e)),""!==n)for(var r=0;r<t.length;r++)if(t[r].oid===n)return t[r]},this.getExtBasicConstraints=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("basicConstraints");if(void 0===n)return;e=o(this.hex,n.vidx),t=n.critical}var r={extname:"basicConstraints"};if(t&&(r.critical=!0),"3000"===e)return r;if("30030101ff"===e)return r.cA=!0,r;if("30060101ff02"===e.substr(0,12)){var a=i(e,10),s=parseInt(a,16);return r.cA=!0,r.pathLen=s,r}throw new Error("hExtV parse error: "+e)},this.getExtKeyUsage=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("keyUsage");if(void 0===n)return;e=o(this.hex,n.vidx),t=n.critical}var r={extname:"keyUsage"};return t&&(r.critical=!0),r.names=this.getExtKeyUsageString(e).split(","),r},this.getExtKeyUsageBin=function(e){if(void 0===e){var t=this.getExtInfo("keyUsage");if(void 0===t)return"";e=o(this.hex,t.vidx)}if(8!=e.length&&10!=e.length)throw new Error("malformed key usage value: "+e);var n="000000000000000"+parseInt(e.substr(6),16).toString(2);return 8==e.length&&(n=n.slice(-8)),10==e.length&&(n=n.slice(-16)),""==(n=n.replace(/0+$/,""))&&(n="0"),n},this.getExtKeyUsageString=function(e){for(var t=this.getExtKeyUsageBin(e),n=new Array,r=0;r<t.length;r++)"1"==t.substr(r,1)&&n.push(Je.KEYUSAGE_NAME[r]);return n.join(",")},this.getExtSubjectKeyIdentifier=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("subjectKeyIdentifier");if(void 0===n)return;e=o(this.hex,n.vidx),t=n.critical}var r={extname:"subjectKeyIdentifier"};t&&(r.critical=!0);var a=i(e,0);return r.kid={hex:a},r},this.getExtAuthorityKeyIdentifier=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("authorityKeyIdentifier");if(void 0===n)return;e=o(this.hex,n.vidx),t=n.critical}var a={extname:"authorityKeyIdentifier"};t&&(a.critical=!0);for(var s=r(e,0),c=0;c<s.length;c++){var u=e.substr(s[c],2);if("80"===u&&(a.kid={hex:i(e,s[c])}),"a1"===u){var l=o(e,s[c]),d=this.getGeneralNames(l);a.issuer=d[0].dn}"82"===u&&(a.sn={hex:i(e,s[c])})}return a},this.getExtExtKeyUsage=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("extKeyUsage");if(void 0===n)return;e=o(this.hex,n.vidx),t=n.critical}var a={extname:"extKeyUsage",array:[]};t&&(a.critical=!0);for(var s=r(e,0),c=0;c<s.length;c++)a.array.push(h(i(e,s[c])));return a},this.getExtExtKeyUsageName=function(){var e=this.getExtInfo("extKeyUsage");if(void 0===e)return e;var t=new Array,n=o(this.hex,e.vidx);if(""===n)return t;for(var a=r(n,0),s=0;s<a.length;s++)t.push(h(i(n,a[s])));return t},this.getExtSubjectAltName=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("subjectAltName");if(void 0===n)return;e=o(this.hex,n.vidx),t=n.critical}var r={extname:"subjectAltName",array:[]};return t&&(r.critical=!0),r.array=this.getGeneralNames(e),r},this.getExtIssuerAltName=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("issuerAltName");if(void 0===n)return;e=o(this.hex,n.vidx),t=n.critical}var r={extname:"issuerAltName",array:[]};return t&&(r.critical=!0),r.array=this.getGeneralNames(e),r},this.getGeneralNames=function(e){for(var t=r(e,0),n=[],i=0;i<t.length;i++){var a=this.getGeneralName(o(e,t[i]));void 0!==a&&n.push(a)}return n},this.getGeneralName=function(e){var t=e.substr(0,2),n=i(e,0),r=_e(n);return"81"==t?{rfc822:r}:"82"==t?{dns:r}:"86"==t?{uri:r}:"87"==t?{ip:Re(n)}:"a4"==t?{dn:this.getX500Name(n)}:void 0},this.getExtSubjectAltName2=function(){var e,t,n,a=this.getExtInfo("subjectAltName");if(void 0===a)return a;for(var s=new Array,c=o(this.hex,a.vidx),u=r(c,0),l=0;l<u.length;l++)n=c.substr(u[l],2),e=i(c,u[l]),"81"===n&&(t=xe(e),s.push(["MAIL",t])),"82"===n&&(t=xe(e),s.push(["DNS",t])),"84"===n&&(t=Je.hex2dn(e,0),s.push(["DN",t])),"86"===n&&(t=xe(e),s.push(["URI",t])),"87"===n&&(t=Re(e),s.push(["IP",t]));return s},this.getExtCRLDistributionPoints=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("cRLDistributionPoints");if(void 0===n)return;e=o(this.hex,n.vidx),t=n.critical}var i={extname:"cRLDistributionPoints",array:[]};t&&(i.critical=!0);for(var a=r(e,0),s=0;s<a.length;s++){var c=o(e,a[s]);i.array.push(this.getDistributionPoint(c))}return i},this.getDistributionPoint=function(e){for(var t={},n=r(e,0),i=0;i<n.length;i++){var a=e.substr(n[i],2),s=o(e,n[i]);"a0"==a&&(t.dpname=this.getDistributionPointName(s))}return t},this.getDistributionPointName=function(e){for(var t={},n=r(e,0),i=0;i<n.length;i++){var a=e.substr(n[i],2),s=o(e,n[i]);"a0"==a&&(t.full=this.getGeneralNames(s))}return t},this.getExtCRLDistributionPointsURI=function(){var e=this.getExtInfo("cRLDistributionPoints");if(void 0===e)return e;for(var t=new Array,n=r(this.hex,e.vidx),i=0;i<n.length;i++)try{var o=xe(a(this.hex,n[i],[0,0,0],"86"));t.push(o)}catch(e){}return t},this.getExtAIAInfo=function(){var e=this.getExtInfo("authorityInfoAccess");if(void 0===e)return e;for(var t={ocsp:[],caissuer:[]},n=r(this.hex,e.vidx),i=0;i<n.length;i++){var o=a(this.hex,n[i],[0],"06"),s=a(this.hex,n[i],[1],"86");"2b06010505073001"===o&&t.ocsp.push(xe(s)),"2b06010505073002"===o&&t.caissuer.push(xe(s))}return t},this.getExtAuthorityInfoAccess=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("authorityInfoAccess");if(void 0===n)return;e=o(this.hex,n.vidx),t=n.critical}var i={extname:"authorityInfoAccess",array:[]};t&&(i.critical=!0);for(var c=r(e,0),u=0;u<c.length;u++){var l=s(e,c[u],[0],"06"),d=xe(a(e,c[u],[1],"86"));if("2b06010505073001"==l)i.array.push({ocsp:d});else{if("2b06010505073002"!=l)throw new Error("unknown method: "+l);i.array.push({caissuer:d})}}return i},this.getExtCertificatePolicies=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("certificatePolicies");if(void 0===n)return;e=o(this.hex,n.vidx),t=n.critical}var i={extname:"certificatePolicies",array:[]};t&&(i.critical=!0);for(var a=r(e,0),s=0;s<a.length;s++){var c=o(e,a[s]),u=this.getPolicyInformation(c);i.array.push(u)}return i},this.getPolicyInformation=function(e){var t={},n=a(e,0,[0],"06");t.policyoid=h(n);var i=d(e,0,[1],"30");if(-1!=i){t.array=[];for(var s=r(e,i),c=0;c<s.length;c++){var u=o(e,s[c]),l=this.getPolicyQualifierInfo(u);t.array.push(l)}}return t},this.getPolicyQualifierInfo=function(e){var t={},n=a(e,0,[0],"06");if("2b06010505070201"===n){var r=s(e,0,[1],"16");t.cps=_e(r)}else if("2b06010505070202"===n){var i=c(e,0,[1],"30");t.unotice=this.getUserNotice(i)}return t},this.getUserNotice=function(e){for(var t={},n=r(e,0),i=0;i<n.length;i++){var a=o(e,n[i]);"30"!=a.substr(0,2)&&(t.exptext=this.getDisplayText(a))}return t},this.getDisplayText=function(e){var t={};return t.type={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"}[e.substr(0,2)],t.str=_e(i(e,0)),t},this.getExtCRLNumber=function(e,t){var n={extname:"cRLNumber"};if(t&&(n.critical=!0),"02"==e.substr(0,2))return n.num={hex:i(e,0)},n;throw new Error("hExtV parse error: "+e)},this.getExtCRLReason=function(e,t){var n={extname:"cRLReason"};if(t&&(n.critical=!0),"0a"==e.substr(0,2))return n.code=parseInt(i(e,0),16),n;throw new Error("hExtV parse error: "+e)},this.getExtOcspNonce=function(e,t){var n={extname:"ocspNonce"};t&&(n.critical=!0);var r=i(e,0);return n.hex=r,n},this.getExtOcspNoCheck=function(e,t){var n={extname:"ocspNoCheck"};return t&&(n.critical=!0),n},this.getExtAdobeTimeStamp=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("adobeTimeStamp");if(void 0===n)return;e=o(this.hex,n.vidx),t=n.critical}var i={extname:"adobeTimeStamp"};t&&(i.critical=!0);var a=r(e,0);if(a.length>1){var s=o(e,a[1]),c=this.getGeneralName(s);null!=c.uri&&(i.uri=c.uri)}if(a.length>2){var u=o(e,a[2]);"0101ff"==u&&(i.reqauth=!0),"010100"==u&&(i.reqauth=!1)}return i},this.getX500NameRule=function(e){for(var t=null,n=[],r=0;r<e.length;r++)for(var i=e[r],o=0;o<i.length;o++)n.push(i[o]);for(r=0;r<n.length;r++){var a=n[r],s=a.ds,c=a.value,u=a.type;if("prn"!=s&&"utf8"!=s&&"ia5"!=s)return"mixed";if("ia5"==s){if("CN"!=u)return"mixed";if(ce.lang.String.isMail(c))continue;return"mixed"}if("C"==u){if("prn"==s)continue;return"mixed"}if(null==t)t=s;else if(t!==s)return"mixed"}return null==t?"prn":t},this.getX500Name=function(e){var t=this.getX500NameArray(e);return{array:t,str:this.dnarraytostr(t)}},this.getX500NameArray=function(e){for(var t=[],n=r(e,0),i=0;i<n.length;i++)t.push(this.getRDN(o(e,n[i])));return t},this.getRDN=function(e){for(var t=[],n=r(e,0),i=0;i<n.length;i++)t.push(this.getAttrTypeAndValue(o(e,n[i])));return t},this.getAttrTypeAndValue=function(e){var t={type:null,value:null,ds:null},n=r(e,0),i=a(e,n[0],[],"06"),o=a(e,n[1],[]),s=ce.asn1.ASN1Util.oidHexToInt(i);return t.type=ce.asn1.x509.OID.oid2atype(s),t.ds=this.HEX2STAG[e.substr(n[1],2)],"bmp"!=t.ds?t.value=xe(o):t.value=Le(o),t},this.readCertPEM=function(e){this.readCertHex(g(e))},this.readCertHex=function(e){this.hex=e,this.getVersion();try{l(this.hex,0,[0,7],"a3"),this.parseExt()}catch(e){}},this.getParam=function(){var e={};return e.version=this.getVersion(),e.serial={hex:this.getSerialNumberHex()},e.sigalg=this.getSignatureAlgorithmField(),e.issuer=this.getIssuer(),e.notbefore=this.getNotBefore(),e.notafter=this.getNotAfter(),e.subject=this.getSubject(),e.sbjpubkey=Ae(this.getPublicKeyHex(),"PUBLIC KEY"),this.aExtInfo.length>0&&(e.ext=this.getExtParamArray()),e.sighex=this.getSignatureValueHex(),e},this.getExtParamArray=function(e){null==e&&-1!=d(this.hex,0,[0,"[3]"])&&(e=u(this.hex,0,[0,"[3]",0],"30"));for(var t=[],n=r(e,0),i=0;i<n.length;i++){var a=o(e,n[i]),s=this.getExtParam(a);null!=s&&t.push(s)}return t},this.getExtParam=function(e){var t=r(e,0).length;if(2!=t&&3!=t)throw new Error("wrong number elements in Extension: "+t+" "+e);var n=m(a(e,0,[0],"06")),i=!1;3==t&&"0101ff"==c(e,0,[1])&&(i=!0);var o=c(e,0,[t-1,0]),s=void 0;if("2.5.29.14"==n?s=this.getExtSubjectKeyIdentifier(o,i):"2.5.29.15"==n?s=this.getExtKeyUsage(o,i):"2.5.29.17"==n?s=this.getExtSubjectAltName(o,i):"2.5.29.18"==n?s=this.getExtIssuerAltName(o,i):"2.5.29.19"==n?s=this.getExtBasicConstraints(o,i):"2.5.29.31"==n?s=this.getExtCRLDistributionPoints(o,i):"2.5.29.32"==n?s=this.getExtCertificatePolicies(o,i):"2.5.29.35"==n?s=this.getExtAuthorityKeyIdentifier(o,i):"2.5.29.37"==n?s=this.getExtExtKeyUsage(o,i):"1.3.6.1.5.5.7.1.1"==n?s=this.getExtAuthorityInfoAccess(o,i):"2.5.29.20"==n?s=this.getExtCRLNumber(o,i):"2.5.29.21"==n?s=this.getExtCRLReason(o,i):"1.3.6.1.5.5.7.48.1.2"==n?s=this.getExtOcspNonce(o,i):"1.3.6.1.5.5.7.48.1.5"==n?s=this.getExtOcspNoCheck(o,i):"1.2.840.113583.1.1.9.1"==n&&(s=this.getExtAdobeTimeStamp(o,i)),null!=s)return s;var u={extname:n,extn:o};return i&&(u.critical=!0),u},this.findExt=function(e,t){for(var n=0;n<e.length;n++)if(e[n].extname==t)return e[n];return null},this.updateExtCDPFullURI=function(e,t){var n=this.findExt(e,"cRLDistributionPoints");if(null!=n&&null!=n.array)for(var r=n.array,i=0;i<r.length;i++)if(null!=r[i].dpname&&null!=r[i].dpname.full)for(var o=r[i].dpname.full,a=0;a<o.length;a++){var s=o[i];null!=s.uri&&(s.uri=t)}},this.updateExtAIAOCSP=function(e,t){var n=this.findExt(e,"authorityInfoAccess");if(null!=n&&null!=n.array)for(var r=n.array,i=0;i<r.length;i++)null!=r[i].ocsp&&(r[i].ocsp=t)},this.updateExtAIACAIssuer=function(e,t){var n=this.findExt(e,"authorityInfoAccess");if(null!=n&&null!=n.array)for(var r=n.array,i=0;i<r.length;i++)null!=r[i].caissuer&&(r[i].caissuer=t)},this.dnarraytostr=function(e){return"/"+e.map((function(e){return function(e){return e.map((function(e){return function(e){return e.type+"="+e.value}(e).replace(/\+/,"\\+")})).join("+")}(e).replace(/\//,"\\/")})).join("/")},this.getInfo=function(){var e,t,n,r=function(e){return JSON.stringify(e.array).replace(/[\[\]\{\}\"]/g,"")},i=function(e){for(var t="",n=e.array,r=0;r<n.length;r++){var i=n[r];if(t+=" policy oid: "+i.policyoid+"\n",void 0!==i.array)for(var o=0;o<i.array.length;o++){var a=i.array[o];void 0!==a.cps&&(t+=" cps: "+a.cps+"\n")}}return t},o=function(e){for(var t="",n=e.array,r=0;r<n.length;r++){var i=n[r];try{void 0!==i.dpname.full[0].uri&&(t+=" "+i.dpname.full[0].uri+"\n")}catch(e){}try{void 0!==i.dname.full[0].dn.hex&&(t+=" "+Je.hex2dn(i.dpname.full[0].dn.hex)+"\n")}catch(e){}}return t},a=function(e){for(var t="",n=e.array,r=0;r<n.length;r++){var i=n[r];void 0!==i.caissuer&&(t+=" caissuer: "+i.caissuer+"\n"),void 0!==i.ocsp&&(t+=" ocsp: "+i.ocsp+"\n")}return t};if(e="Basic Fields\n",e+=" serial number: "+this.getSerialNumberHex()+"\n",e+=" signature algorithm: "+this.getSignatureAlgorithmField()+"\n",e+=" issuer: "+this.getIssuerString()+"\n",e+=" notBefore: "+this.getNotBefore()+"\n",e+=" notAfter: "+this.getNotAfter()+"\n",e+=" subject: "+this.getSubjectString()+"\n",e+=" subject public key info: \n",e+=" key algorithm: "+(t=this.getPublicKey()).type+"\n","RSA"===t.type&&(e+=" n="+Ue(t.n.toString(16)).substr(0,16)+"...\n",e+=" e="+Ue(t.e.toString(16))+"\n"),null!=(n=this.aExtInfo)){e+="X509v3 Extensions:\n";for(var s=0;s<n.length;s++){var c=n[s],u=ce.asn1.x509.OID.oid2name(c.oid);""===u&&(u=c.oid);var l="";if(!0===c.critical&&(l="CRITICAL"),e+=" "+u+" "+l+":\n","basicConstraints"===u){var d=this.getExtBasicConstraints();void 0===d.cA?e+=" {}\n":(e+=" cA=true",void 0!==d.pathLen&&(e+=", pathLen="+d.pathLen),e+="\n")}else if("keyUsage"===u)e+=" "+this.getExtKeyUsageString()+"\n";else if("subjectKeyIdentifier"===u)e+=" "+this.getExtSubjectKeyIdentifier().kid.hex+"\n";else if("authorityKeyIdentifier"===u){var p=this.getExtAuthorityKeyIdentifier();void 0!==p.kid&&(e+=" kid="+p.kid.hex+"\n")}else"extKeyUsage"===u?e+=" "+this.getExtExtKeyUsage().array.join(", ")+"\n":"subjectAltName"===u?e+=" "+r(this.getExtSubjectAltName())+"\n":"cRLDistributionPoints"===u?e+=o(this.getExtCRLDistributionPoints()):"authorityInfoAccess"===u?e+=a(this.getExtAuthorityInfoAccess()):"certificatePolicies"===u&&(e+=i(this.getExtCertificatePolicies()))}}return(e+="signature algorithm: "+this.getSignatureAlgorithmName()+"\n")+"signature: "+this.getSignatureValueHex().substr(0,16)+"...\n"},"string"==typeof e&&(-1!=e.indexOf("-----BEGIN")?this.readCertPEM(e):ce.lang.String.isHex(e)&&this.readCertHex(e))}qe.getKey=function(e,t,n){var r,i=(v=de).getChildIdx,o=(v.getV,v.getVbyList),a=ce.crypto,s=a.ECDSA,c=a.DSA,u=re,l=Te,d=qe;if(void 0!==u&&e instanceof u)return e;if(void 0!==s&&e instanceof s)return e;if(void 0!==c&&e instanceof c)return e;if(void 0!==e.curve&&void 0!==e.xy&&void 0===e.d)return new s({pub:e.xy,curve:e.curve});if(void 0!==e.curve&&void 0!==e.d)return new s({prv:e.d,curve:e.curve});if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0===e.d)return(O=new u).setPublic(e.n,e.e),O;if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0!==e.p&&void 0!==e.q&&void 0!==e.dp&&void 0!==e.dq&&void 0!==e.co&&void 0===e.qi)return(O=new u).setPrivateEx(e.n,e.e,e.d,e.p,e.q,e.dp,e.dq,e.co),O;if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0===e.p)return(O=new u).setPrivate(e.n,e.e,e.d),O;if(void 0!==e.p&&void 0!==e.q&&void 0!==e.g&&void 0!==e.y&&void 0===e.x)return(O=new c).setPublic(e.p,e.q,e.g,e.y),O;if(void 0!==e.p&&void 0!==e.q&&void 0!==e.g&&void 0!==e.y&&void 0!==e.x)return(O=new c).setPrivate(e.p,e.q,e.g,e.y,e.x),O;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0===e.d)return(O=new u).setPublic(be(e.n),be(e.e)),O;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0!==e.p&&void 0!==e.q&&void 0!==e.dp&&void 0!==e.dq&&void 0!==e.qi)return(O=new u).setPrivateEx(be(e.n),be(e.e),be(e.d),be(e.p),be(e.q),be(e.dp),be(e.dq),be(e.qi)),O;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d)return(O=new u).setPrivate(be(e.n),be(e.e),be(e.d)),O;if("EC"===e.kty&&void 0!==e.crv&&void 0!==e.x&&void 0!==e.y&&void 0===e.d){var p=(T=new s({curve:e.crv})).ecparams.keylen/4,f="04"+("0000000000"+be(e.x)).slice(-p)+("0000000000"+be(e.y)).slice(-p);return T.setPublicKeyHex(f),T}if("EC"===e.kty&&void 0!==e.crv&&void 0!==e.x&&void 0!==e.y&&void 0!==e.d){p=(T=new s({curve:e.crv})).ecparams.keylen/4,f="04"+("0000000000"+be(e.x)).slice(-p)+("0000000000"+be(e.y)).slice(-p);var h=("0000000000"+be(e.d)).slice(-p);return T.setPublicKeyHex(f),T.setPrivateKeyHex(h),T}if("pkcs5prv"===n){var m,g=e,v=de;if(9===(m=i(g,0)).length)(O=new u).readPKCS5PrvKeyHex(g);else if(6===m.length)(O=new c).readPKCS5PrvKeyHex(g);else{if(!(m.length>2&&"04"===g.substr(m[1],2)))throw new Error("unsupported PKCS#1/5 hexadecimal key");(O=new s).readPKCS5PrvKeyHex(g)}return O}if("pkcs8prv"===n)return d.getKeyFromPlainPrivatePKCS8Hex(e);if("pkcs8pub"===n)return d._getKeyFromPublicPKCS8Hex(e);if("x509pub"===n)return Je.getPublicKeyFromCertHex(e);if(-1!=e.indexOf("-END CERTIFICATE-",0)||-1!=e.indexOf("-END X509 CERTIFICATE-",0)||-1!=e.indexOf("-END TRUSTED CERTIFICATE-",0))return Je.getPublicKeyFromCertPEM(e);if(-1!=e.indexOf("-END PUBLIC KEY-")){var y=Te(e,"PUBLIC KEY");return d._getKeyFromPublicPKCS8Hex(y)}if(-1!=e.indexOf("-END RSA PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var b=l(e,"RSA PRIVATE KEY");return d.getKey(b,null,"pkcs5prv")}if(-1!=e.indexOf("-END DSA PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var w=o(r=l(e,"DSA PRIVATE KEY"),0,[1],"02"),x=o(r,0,[2],"02"),E=o(r,0,[3],"02"),k=o(r,0,[4],"02"),S=o(r,0,[5],"02");return(O=new c).setPrivate(new _(w,16),new _(x,16),new _(E,16),new _(k,16),new _(S,16)),O}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED"))return b=l(e,"EC PRIVATE KEY"),d.getKey(b,null,"pkcs5prv");if(-1!=e.indexOf("-END PRIVATE KEY-"))return d.getKeyFromPlainPrivatePKCS8PEM(e);if(-1!=e.indexOf("-END RSA PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var C=d.getDecryptedKeyHex(e,t),A=new re;return A.readPKCS5PrvKeyHex(C),A}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var T,O=o(r=d.getDecryptedKeyHex(e,t),0,[1],"04"),P=o(r,0,[2,0],"06"),I=o(r,0,[3,0],"03").substr(2);if(void 0===ce.crypto.OID.oidhex2name[P])throw new Error("undefined OID(hex) in KJUR.crypto.OID: "+P);return(T=new s({curve:ce.crypto.OID.oidhex2name[P]})).setPublicKeyHex(I),T.setPrivateKeyHex(O),T.isPublic=!1,T}if(-1!=e.indexOf("-END DSA PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED"))return w=o(r=d.getDecryptedKeyHex(e,t),0,[1],"02"),x=o(r,0,[2],"02"),E=o(r,0,[3],"02"),k=o(r,0,[4],"02"),S=o(r,0,[5],"02"),(O=new c).setPrivate(new _(w,16),new _(x,16),new _(E,16),new _(k,16),new _(S,16)),O;if(-1!=e.indexOf("-END ENCRYPTED PRIVATE KEY-"))return d.getKeyFromEncryptedPKCS8PEM(e,t);throw new Error("not supported argument")},qe.generateKeypair=function(e,t){if("RSA"==e){var n=t;(a=new re).generate(n,"10001"),a.isPrivate=!0,a.isPublic=!0;var r=new re,i=a.n.toString(16),o=a.e.toString(16);return r.setPublic(i,o),r.isPrivate=!1,r.isPublic=!0,(s={}).prvKeyObj=a,s.pubKeyObj=r,s}if("EC"==e){var a,s,c=t,u=new ce.crypto.ECDSA({curve:c}).generateKeyPairHex();return(a=new ce.crypto.ECDSA({curve:c})).setPublicKeyHex(u.ecpubhex),a.setPrivateKeyHex(u.ecprvhex),a.isPrivate=!0,a.isPublic=!1,(r=new ce.crypto.ECDSA({curve:c})).setPublicKeyHex(u.ecpubhex),r.isPrivate=!1,r.isPublic=!0,(s={}).prvKeyObj=a,s.pubKeyObj=r,s}throw new Error("unknown algorithm: "+e)},qe.getPEM=function(e,t,n,r,i,o){var a=ce,s=a.asn1,c=s.DERObjectIdentifier,u=s.DERInteger,l=s.ASN1Util.newObject,d=s.x509.SubjectPublicKeyInfo,p=a.crypto,f=p.DSA,h=p.ECDSA,m=re;function v(e){return l({seq:[{int:0},{int:{bigint:e.n}},{int:e.e},{int:{bigint:e.d}},{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.dmp1}},{int:{bigint:e.dmq1}},{int:{bigint:e.coeff}}]})}function y(e){return l({seq:[{int:1},{octstr:{hex:e.prvKeyHex}},{tag:["a0",!0,{oid:{name:e.curveName}}]},{tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]}]})}function b(e){return l({seq:[{int:0},{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}},{int:{bigint:e.y}},{int:{bigint:e.x}}]})}if((void 0!==m&&e instanceof m||void 0!==f&&e instanceof f||void 0!==h&&e instanceof h)&&1==e.isPublic&&(void 0===t||"PKCS8PUB"==t))return Ae(E=new d(e).getEncodedHex(),"PUBLIC KEY");if("PKCS1PRV"==t&&void 0!==m&&e instanceof m&&(void 0===n||null==n)&&1==e.isPrivate)return Ae(E=v(e).getEncodedHex(),"RSA PRIVATE KEY");if("PKCS1PRV"==t&&void 0!==h&&e instanceof h&&(void 0===n||null==n)&&1==e.isPrivate){var w=new c({name:e.curveName}).getEncodedHex(),x=y(e).getEncodedHex(),_="";return(_+=Ae(w,"EC PARAMETERS"))+Ae(x,"EC PRIVATE KEY")}if("PKCS1PRV"==t&&void 0!==f&&e instanceof f&&(void 0===n||null==n)&&1==e.isPrivate)return Ae(E=b(e).getEncodedHex(),"DSA PRIVATE KEY");if("PKCS5PRV"==t&&void 0!==m&&e instanceof m&&void 0!==n&&null!=n&&1==e.isPrivate){var E=v(e).getEncodedHex();return void 0===r&&(r="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",E,n,r,o)}if("PKCS5PRV"==t&&void 0!==h&&e instanceof h&&void 0!==n&&null!=n&&1==e.isPrivate)return E=y(e).getEncodedHex(),void 0===r&&(r="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",E,n,r,o);if("PKCS5PRV"==t&&void 0!==f&&e instanceof f&&void 0!==n&&null!=n&&1==e.isPrivate)return E=b(e).getEncodedHex(),void 0===r&&(r="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",E,n,r,o);var k=function(e,t){var n=S(e,t);return new l({seq:[{seq:[{oid:{name:"pkcs5PBES2"}},{seq:[{seq:[{oid:{name:"pkcs5PBKDF2"}},{seq:[{octstr:{hex:n.pbkdf2Salt}},{int:n.pbkdf2Iter}]}]},{seq:[{oid:{name:"des-EDE3-CBC"}},{octstr:{hex:n.encryptionSchemeIV}}]}]}]},{octstr:{hex:n.ciphertext}}]}).getEncodedHex()},S=function(e,t){var n=g.lib.WordArray.random(8),r=g.lib.WordArray.random(8),i=g.PBKDF2(t,n,{keySize:6,iterations:100}),o=g.enc.Hex.parse(e),a=g.TripleDES.encrypt(o,i,{iv:r})+"",s={};return s.ciphertext=a,s.pbkdf2Salt=g.enc.Hex.stringify(n),s.pbkdf2Iter=100,s.encryptionSchemeAlg="DES-EDE3-CBC",s.encryptionSchemeIV=g.enc.Hex.stringify(r),s};if("PKCS8PRV"==t&&null!=m&&e instanceof m&&1==e.isPrivate){var C=v(e).getEncodedHex();return E=l({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption"}},{null:!0}]},{octstr:{hex:C}}]}).getEncodedHex(),void 0===n||null==n?Ae(E,"PRIVATE KEY"):Ae(x=k(E,n),"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==t&&void 0!==h&&e instanceof h&&1==e.isPrivate)return C=new l({seq:[{int:1},{octstr:{hex:e.prvKeyHex}},{tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]}]}).getEncodedHex(),E=l({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:e.curveName}}]},{octstr:{hex:C}}]}).getEncodedHex(),void 0===n||null==n?Ae(E,"PRIVATE KEY"):Ae(x=k(E,n),"ENCRYPTED PRIVATE KEY");if("PKCS8PRV"==t&&void 0!==f&&e instanceof f&&1==e.isPrivate)return C=new u({bigint:e.x}).getEncodedHex(),E=l({seq:[{int:0},{seq:[{oid:{name:"dsa"}},{seq:[{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}}]}]},{octstr:{hex:C}}]}).getEncodedHex(),void 0===n||null==n?Ae(E,"PRIVATE KEY"):Ae(x=k(E,n),"ENCRYPTED PRIVATE KEY");throw new Error("unsupported object nor format")},qe.getKeyFromCSRPEM=function(e){var t=Te(e,"CERTIFICATE REQUEST");return qe.getKeyFromCSRHex(t)},qe.getKeyFromCSRHex=function(e){var t=qe.parseCSRHex(e);return qe.getKey(t.p8pubkeyhex,null,"pkcs8pub")},qe.parseCSRHex=function(e){var t=de,n=t.getChildIdx,r=t.getTLV,i={},o=e;if("30"!=o.substr(0,2))throw new Error("malformed CSR(code:001)");var a=n(o,0);if(a.length<1)throw new Error("malformed CSR(code:002)");if("30"!=o.substr(a[0],2))throw new Error("malformed CSR(code:003)");var s=n(o,a[0]);if(s.length<3)throw new Error("malformed CSR(code:004)");return i.p8pubkeyhex=r(o,s[2]),i},qe.getKeyID=function(e){var t=qe,n=de;"string"==typeof e&&-1!=e.indexOf("BEGIN ")&&(e=t.getKey(e));var r=Te(t.getPEM(e)),i=n.getIdxbyList(r,0,[1]),o=n.getV(r,i).substring(2);return ce.crypto.Util.hashHex(o,"sha1")},qe.getJWKFromKey=function(e){var t={};if(e instanceof re&&e.isPrivate)return t.kty="RSA",t.n=ye(e.n.toString(16)),t.e=ye(e.e.toString(16)),t.d=ye(e.d.toString(16)),t.p=ye(e.p.toString(16)),t.q=ye(e.q.toString(16)),t.dp=ye(e.dmp1.toString(16)),t.dq=ye(e.dmq1.toString(16)),t.qi=ye(e.coeff.toString(16)),t;if(e instanceof re&&e.isPublic)return t.kty="RSA",t.n=ye(e.n.toString(16)),t.e=ye(e.e.toString(16)),t;if(e instanceof ce.crypto.ECDSA&&e.isPrivate){if("P-256"!==(r=e.getShortNISTPCurveName())&&"P-384"!==r)throw new Error("unsupported curve name for JWT: "+r);var n=e.getPublicKeyXYHex();return t.kty="EC",t.crv=r,t.x=ye(n.x),t.y=ye(n.y),t.d=ye(e.prvKeyHex),t}if(e instanceof ce.crypto.ECDSA&&e.isPublic){var r;if("P-256"!==(r=e.getShortNISTPCurveName())&&"P-384"!==r)throw new Error("unsupported curve name for JWT: "+r);return n=e.getPublicKeyXYHex(),t.kty="EC",t.crv=r,t.x=ye(n.x),t.y=ye(n.y),t}throw new Error("not supported key object")},re.getPosArrayOfChildrenFromHex=function(e){return de.getChildIdx(e,0)},re.getHexValueArrayOfChildrenFromHex=function(e){var t,n=de.getV,r=n(e,(t=re.getPosArrayOfChildrenFromHex(e))[0]),i=n(e,t[1]),o=n(e,t[2]),a=n(e,t[3]),s=n(e,t[4]),c=n(e,t[5]),u=n(e,t[6]),l=n(e,t[7]),d=n(e,t[8]);return(t=new Array).push(r,i,o,a,s,c,u,l,d),t},re.prototype.readPrivateKeyFromPEMString=function(e){var t=Te(e),n=re.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8])},re.prototype.readPKCS5PrvKeyHex=function(e){var t=re.getHexValueArrayOfChildrenFromHex(e);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},re.prototype.readPKCS8PrvKeyHex=function(e){var t,n,r,i,o,a,s,c,u=de,l=u.getVbyListEx;if(!1===u.isASN1HEX(e))throw new Error("not ASN.1 hex string");try{t=l(e,0,[2,0,1],"02"),n=l(e,0,[2,0,2],"02"),r=l(e,0,[2,0,3],"02"),i=l(e,0,[2,0,4],"02"),o=l(e,0,[2,0,5],"02"),a=l(e,0,[2,0,6],"02"),s=l(e,0,[2,0,7],"02"),c=l(e,0,[2,0,8],"02")}catch(e){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(t,n,r,i,o,a,s,c)},re.prototype.readPKCS5PubKeyHex=function(e){var t=de,n=t.getV;if(!1===t.isASN1HEX(e))throw new Error("keyHex is not ASN.1 hex string");var r=t.getChildIdx(e,0);if(2!==r.length||"02"!==e.substr(r[0],2)||"02"!==e.substr(r[1],2))throw new Error("wrong hex for PKCS#5 public key");var i=n(e,r[0]),o=n(e,r[1]);this.setPublic(i,o)},re.prototype.readPKCS8PubKeyHex=function(e){var t=de;if(!1===t.isASN1HEX(e))throw new Error("not ASN.1 hex string");if("06092a864886f70d010101"!==t.getTLVbyListEx(e,0,[0,0]))throw new Error("not PKCS8 RSA public key");var n=t.getTLVbyListEx(e,0,[1,0]);this.readPKCS5PubKeyHex(n)},re.prototype.readCertPubKeyHex=function(e,t){var n,r;(n=new Je).readCertHex(e),r=n.getPublicKeyHex(),this.readPKCS8PubKeyHex(r)},new RegExp("[^0-9a-f]","gi"),re.prototype.sign=function(e,t){var n=function(e){return ce.crypto.Util.hashString(e,t)}(e);return this.signWithMessageHash(n,t)},re.prototype.signWithMessageHash=function(e,t){var n=te(ce.crypto.Util.getPaddedDigestInfoHex(e,t,this.n.bitLength()),16);return We(this.doPrivate(n).toString(16),this.n.bitLength())},re.prototype.signPSS=function(e,t,n){var r=function(e){return ce.crypto.Util.hashHex(e,t)}(Ee(e));return void 0===n&&(n=-1),this.signWithMessageHashPSS(r,t,n)},re.prototype.signWithMessageHashPSS=function(e,t,n){var r,i=_e(e),o=i.length,a=this.n.bitLength()-1,s=Math.ceil(a/8),c=function(e){return ce.crypto.Util.hashHex(e,t)};if(-1===n||void 0===n)n=o;else if(-2===n)n=s-o-2;else if(n<-2)throw new Error("invalid salt length");if(s<o+n+2)throw new Error("data too long");var u="";n>0&&(u=new Array(n),(new ee).nextBytes(u),u=String.fromCharCode.apply(String,u));var l=_e(c(Ee("\0\0\0\0\0\0\0\0"+i+u))),d=[];for(r=0;r<s-n-o-2;r+=1)d[r]=0;var p=String.fromCharCode.apply(String,d)+""+u,f=Ke(l,p.length,c),h=[];for(r=0;r<p.length;r+=1)h[r]=p.charCodeAt(r)^f.charCodeAt(r);var m=65280>>8*s-a&255;for(h[0]&=~m,r=0;r<o;r++)h.push(l.charCodeAt(r));return h.push(188),We(this.doPrivate(new _(h)).toString(16),this.n.bitLength())},re.prototype.verify=function(e,t){if(null==(t=t.toLowerCase()).match(/^[0-9a-f]+$/))return!1;var n=te(t,16),r=this.n.bitLength();if(n.bitLength()>r)return!1;var i=this.doPublic(n).toString(16);if(i.length+3!=r/4)return!1;var o=Ve(i.replace(/^1f+00/,""));if(0==o.length)return!1;var a=o[0];return o[1]==function(e){return ce.crypto.Util.hashString(e,a)}(e)},re.prototype.verifyWithMessageHash=function(e,t){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var n=te(t,16);if(n.bitLength()>this.n.bitLength())return 0;var r=Ve(this.doPublic(n).toString(16).replace(/^1f+00/,""));return 0!=r.length&&(r[0],r[1]==e)},re.prototype.verifyPSS=function(e,t,n,r){var i=function(e){return ce.crypto.Util.hashHex(e,n)}(Ee(e));return void 0===r&&(r=-1),this.verifyWithMessageHashPSS(i,t,n,r)},re.prototype.verifyWithMessageHashPSS=function(e,t,n,r){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var i,o=new _(t,16),a=function(e){return ce.crypto.Util.hashHex(e,n)},s=_e(e),c=s.length,u=this.n.bitLength()-1,l=Math.ceil(u/8);if(-1===r||void 0===r)r=c;else if(-2===r)r=l-c-2;else if(r<-2)throw new Error("invalid salt length");if(l<c+r+2)throw new Error("data too long");var d=this.doPublic(o).toByteArray();for(i=0;i<d.length;i+=1)d[i]&=255;for(;d.length<l;)d.unshift(0);if(188!==d[l-1])throw new Error("encoded message does not end in 0xbc");var p=(d=String.fromCharCode.apply(String,d)).substr(0,l-c-1),f=d.substr(p.length,c),h=65280>>8*l-u&255;if(0!=(p.charCodeAt(0)&h))throw new Error("bits beyond keysize not zero");var m=Ke(f,p.length,a),g=[];for(i=0;i<p.length;i+=1)g[i]=p.charCodeAt(i)^m.charCodeAt(i);g[0]&=~h;var v=l-c-r-2;for(i=0;i<v;i+=1)if(0!==g[i])throw new Error("leftmost octets not zero");if(1!==g[v])throw new Error("0x01 marker not found");return f===_e(a(Ee("\0\0\0\0\0\0\0\0"+s+String.fromCharCode.apply(String,g.slice(-r)))))},re.SALT_LEN_HLEN=-1,re.SALT_LEN_MAX=-2,re.SALT_LEN_RECOVER=-2,Je.hex2dn=function(e,t){void 0===t&&(t=0);var n=new Je;return de.getTLV(e,t),n.getX500Name(e).str},Je.hex2rdn=function(e,t){if(void 0===t&&(t=0),"31"!==e.substr(t,2))throw new Error("malformed RDN");for(var n=new Array,r=de.getChildIdx(e,t),i=0;i<r.length;i++)n.push(Je.hex2attrTypeValue(e,r[i]));return(n=n.map((function(e){return e.replace("+","\\+")}))).join("+")},Je.hex2attrTypeValue=function(e,t){var n=de,r=n.getV;if(void 0===t&&(t=0),"30"!==e.substr(t,2))throw new Error("malformed attribute type and value");var i=n.getChildIdx(e,t);2!==i.length||e.substr(i[0],2);var o=r(e,i[0]),a=ce.asn1.ASN1Util.oidHexToInt(o);return ce.asn1.x509.OID.oid2atype(a)+"="+_e(r(e,i[1]))},Je.getPublicKeyFromCertHex=function(e){var t=new Je;return t.readCertHex(e),t.getPublicKey()},Je.getPublicKeyFromCertPEM=function(e){var t=new Je;return t.readCertPEM(e),t.getPublicKey()},Je.getPublicKeyInfoPropOfCertPEM=function(e){var t,n,r=de.getVbyList,i={algparam:null};return(t=new Je).readCertPEM(e),n=t.getPublicKeyHex(),i.keyhex=r(n,0,[1],"03").substr(2),i.algoid=r(n,0,[0,0],"06"),"2a8648ce3d0201"===i.algoid&&(i.algparam=r(n,0,[0,1],"06")),i},Je.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"],void 0!==ce&&ce||(t.KJUR=ce={}),void 0!==ce.jws&&ce.jws||(ce.jws={}),ce.jws.JWS=function(){var e=ce.jws.JWS.isSafeJSONString;this.parseJWS=function(t,n){if(void 0===this.parsedJWS||!n&&void 0===this.parsedJWS.sigvalH){var r=t.match(/^([^.]+)\.([^.]+)\.([^.]+)$/);if(null==r)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";var i=r[1],o=r[2],a=r[3],s=i+"."+o;if(this.parsedJWS={},this.parsedJWS.headB64U=i,this.parsedJWS.payloadB64U=o,this.parsedJWS.sigvalB64U=a,this.parsedJWS.si=s,!n){var c=be(a),u=te(c,16);this.parsedJWS.sigvalH=c,this.parsedJWS.sigvalBI=u}var l=le(i),d=le(o);if(this.parsedJWS.headS=l,this.parsedJWS.payloadS=d,!e(l,this.parsedJWS,"headP"))throw"malformed JSON string for JWS Head: "+l}}},ce.jws.JWS.sign=function(e,t,n,r,i){var o,a,s,c=ce,u=c.jws.JWS,l=u.readSafeJSONString,d=u.isSafeJSONString,p=c.crypto,h=(p.ECDSA,p.Mac),m=p.Signature,g=JSON;if("string"!=typeof t&&"object"!=(void 0===t?"undefined":f(t)))throw"spHeader must be JSON string or object: "+t;if("object"==(void 0===t?"undefined":f(t))&&(a=t,o=g.stringify(a)),"string"==typeof t){if(!d(o=t))throw"JWS Head is not safe JSON string: "+o;a=l(o)}if(s=n,"object"==(void 0===n?"undefined":f(n))&&(s=g.stringify(n)),""!=e&&null!=e||void 0===a.alg||(e=a.alg),""!=e&&null!=e&&void 0===a.alg&&(a.alg=e,o=g.stringify(a)),e!==a.alg)throw"alg and sHeader.alg doesn't match: "+e+"!="+a.alg;var v=null;if(void 0===u.jwsalg2sigalg[e])throw"unsupported alg name: "+e;v=u.jwsalg2sigalg[e];var y=ue(o)+"."+ue(s),b="";if("Hmac"==v.substr(0,4)){if(void 0===r)throw"mac key shall be specified for HS* alg";var w=new h({alg:v,prov:"cryptojs",pass:r});w.updateString(y),b=w.doFinal()}else if(-1!=v.indexOf("withECDSA")){(_=new m({alg:v})).init(r,i),_.updateString(y);var x=_.sign();b=ce.crypto.ECDSA.asn1SigToConcatSig(x)}else{var _;"none"!=v&&((_=new m({alg:v})).init(r,i),_.updateString(y),b=_.sign())}return y+"."+ye(b)},ce.jws.JWS.verify=function(e,t,n){var r,i=ce,o=i.jws.JWS,a=o.readSafeJSONString,s=i.crypto,c=s.ECDSA,u=s.Mac,l=s.Signature;void 0!==f(re)&&(r=re);var d=e.split(".");if(3!==d.length)return!1;var p,h=d[0]+"."+d[1],m=be(d[2]),g=a(le(d[0])),v=null;if(void 0===g.alg)throw"algorithm not specified in header";if(p=(v=g.alg).substr(0,2),null!=n&&"[object Array]"===Object.prototype.toString.call(n)&&n.length>0&&-1==(":"+n.join(":")+":").indexOf(":"+v+":"))throw"algorithm '"+v+"' not accepted in the list";if("none"!=v&&null===t)throw"key shall be specified to verify.";if("string"==typeof t&&-1!=t.indexOf("-----BEGIN ")&&(t=qe.getKey(t)),!("RS"!=p&&"PS"!=p||t instanceof r))throw"key shall be a RSAKey obj for RS* and PS* algs";if("ES"==p&&!(t instanceof c))throw"key shall be a ECDSA obj for ES* algs";var y=null;if(void 0===o.jwsalg2sigalg[g.alg])throw"unsupported alg name: "+v;if("none"==(y=o.jwsalg2sigalg[v]))throw"not supported";if("Hmac"==y.substr(0,4)){if(void 0===t)throw"hexadecimal key shall be specified for HMAC";var b=new u({alg:y,pass:t});return b.updateString(h),m==b.doFinal()}if(-1!=y.indexOf("withECDSA")){var w,x=null;try{x=c.concatSigToASN1Sig(m)}catch(e){return!1}return(w=new l({alg:y})).init(t),w.updateString(h),w.verify(x)}return(w=new l({alg:y})).init(t),w.updateString(h),w.verify(m)},ce.jws.JWS.parse=function(e){var t,n,r,i=e.split("."),o={};if(2!=i.length&&3!=i.length)throw"malformed sJWS: wrong number of '.' splitted elements";return t=i[0],n=i[1],3==i.length&&(r=i[2]),o.headerObj=ce.jws.JWS.readSafeJSONString(le(t)),o.payloadObj=ce.jws.JWS.readSafeJSONString(le(n)),o.headerPP=JSON.stringify(o.headerObj,null," "),null==o.payloadObj?o.payloadPP=le(n):o.payloadPP=JSON.stringify(o.payloadObj,null," "),void 0!==r&&(o.sigHex=be(r)),o},ce.jws.JWS.verifyJWT=function(e,t,n){var r=ce.jws,i=r.JWS,o=i.readSafeJSONString,a=i.inArray,s=i.includedArray,c=e.split("."),u=c[0],l=c[1],d=(be(c[2]),o(le(u))),p=o(le(l));if(void 0===d.alg)return!1;if(void 0===n.alg)throw"acceptField.alg shall be specified";if(!a(d.alg,n.alg))return!1;if(void 0!==p.iss&&"object"===f(n.iss)&&!a(p.iss,n.iss))return!1;if(void 0!==p.sub&&"object"===f(n.sub)&&!a(p.sub,n.sub))return!1;if(void 0!==p.aud&&"object"===f(n.aud))if("string"==typeof p.aud){if(!a(p.aud,n.aud))return!1}else if("object"==f(p.aud)&&!s(p.aud,n.aud))return!1;var h=r.IntDate.getNow();return void 0!==n.verifyAt&&"number"==typeof n.verifyAt&&(h=n.verifyAt),void 0!==n.gracePeriod&&"number"==typeof n.gracePeriod||(n.gracePeriod=0),!(void 0!==p.exp&&"number"==typeof p.exp&&p.exp+n.gracePeriod<h||void 0!==p.nbf&&"number"==typeof p.nbf&&h<p.nbf-n.gracePeriod||void 0!==p.iat&&"number"==typeof p.iat&&h<p.iat-n.gracePeriod||void 0!==p.jti&&void 0!==n.jti&&p.jti!==n.jti||!i.verify(e,t,n.alg))},ce.jws.JWS.includedArray=function(e,t){var n=ce.jws.JWS.inArray;if(null===e)return!1;if("object"!==(void 0===e?"undefined":f(e)))return!1;if("number"!=typeof e.length)return!1;for(var r=0;r<e.length;r++)if(!n(e[r],t))return!1;return!0},ce.jws.JWS.inArray=function(e,t){if(null===t)return!1;if("object"!==(void 0===t?"undefined":f(t)))return!1;if("number"!=typeof t.length)return!1;for(var n=0;n<t.length;n++)if(t[n]==e)return!0;return!1},ce.jws.JWS.jwsalg2sigalg={HS256:"HmacSHA256",HS384:"HmacSHA384",HS512:"HmacSHA512",RS256:"SHA256withRSA",RS384:"SHA384withRSA",RS512:"SHA512withRSA",ES256:"SHA256withECDSA",ES384:"SHA384withECDSA",PS256:"SHA256withRSAandMGF1",PS384:"SHA384withRSAandMGF1",PS512:"SHA512withRSAandMGF1",none:"none"},ce.jws.JWS.isSafeJSONString=function(e,t,n){var r=null;try{return"object"!=(void 0===(r=se(e))?"undefined":f(r))||r.constructor===Array?0:(t&&(t[n]=r),1)}catch(e){return 0}},ce.jws.JWS.readSafeJSONString=function(e){var t=null;try{return"object"!=(void 0===(t=se(e))?"undefined":f(t))||t.constructor===Array?null:t}catch(e){return null}},ce.jws.JWS.getEncodedSignatureValueFromJWS=function(e){var t=e.match(/^[^.]+\.[^.]+\.([^.]+)$/);if(null==t)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";return t[1]},ce.jws.JWS.getJWKthumbprint=function(e){if("RSA"!==e.kty&&"EC"!==e.kty&&"oct"!==e.kty)throw"unsupported algorithm for JWK Thumprint";var t="{";if("RSA"===e.kty){if("string"!=typeof e.n||"string"!=typeof e.e)throw"wrong n and e value for RSA key";t+='"e":"'+e.e+'",',t+='"kty":"'+e.kty+'",',t+='"n":"'+e.n+'"}'}else if("EC"===e.kty){if("string"!=typeof e.crv||"string"!=typeof e.x||"string"!=typeof e.y)throw"wrong crv, x and y value for EC key";t+='"crv":"'+e.crv+'",',t+='"kty":"'+e.kty+'",',t+='"x":"'+e.x+'",',t+='"y":"'+e.y+'"}'}else if("oct"===e.kty){if("string"!=typeof e.k)throw"wrong k value for oct(symmetric) key";t+='"kty":"'+e.kty+'",',t+='"k":"'+e.k+'"}'}var n=Ee(t);return ye(ce.crypto.Util.hashHex(n,"sha256"))},ce.jws.IntDate={},ce.jws.IntDate.get=function(e){var t=ce.jws.IntDate,n=t.getNow,r=t.getZulu;if("now"==e)return n();if("now + 1hour"==e)return n()+3600;if("now + 1day"==e)return n()+86400;if("now + 1month"==e)return n()+2592e3;if("now + 1year"==e)return n()+31536e3;if(e.match(/Z$/))return r(e);if(e.match(/^[0-9]+$/))return parseInt(e);throw"unsupported format: "+e},ce.jws.IntDate.getZulu=function(e){return Pe(e)},ce.jws.IntDate.getNow=function(){return~~(new Date/1e3)},ce.jws.IntDate.intDate2UTCString=function(e){return new Date(1e3*e).toUTCString()},ce.jws.IntDate.intDate2Zulu=function(e){var t=new Date(1e3*e);return("0000"+t.getUTCFullYear()).slice(-4)+("00"+(t.getUTCMonth()+1)).slice(-2)+("00"+t.getUTCDate()).slice(-2)+("00"+t.getUTCHours()).slice(-2)+("00"+t.getUTCMinutes()).slice(-2)+("00"+t.getUTCSeconds()).slice(-2)+"Z"},t.SecureRandom=ee,t.rng_seed_time=Z,t.BigInteger=_,t.RSAKey=re;var ze=ce.crypto.EDSA;t.EDSA=ze;var Ze=ce.crypto.DSA;t.DSA=Ze;var $e=ce.crypto.Signature;t.Signature=$e;var Ge=ce.crypto.MessageDigest;t.MessageDigest=Ge;var Xe=ce.crypto.Mac;t.Mac=Xe;var Qe=ce.crypto.Cipher;t.Cipher=Qe,t.KEYUTIL=qe,t.ASN1HEX=de,t.X509=Je,t.CryptoJS=g,t.b64tohex=w,t.b64toBA=x,t.stoBA=pe,t.BAtos=fe,t.BAtohex=he,t.stohex=me,t.stob64=function(e){return b(me(e))},t.stob64u=function(e){return ge(b(me(e)))},t.b64utos=function(e){return fe(x(ve(e)))},t.b64tob64u=ge,t.b64utob64=ve,t.hex2b64=b,t.hextob64u=ye,t.b64utohex=be,t.utf8tob64u=ue,t.b64utoutf8=le,t.utf8tob64=function(e){return b(Ie(De(e)))},t.b64toutf8=function(e){return decodeURIComponent(je(w(e)))},t.utf8tohex=we,t.hextoutf8=xe,t.hextorstr=_e,t.rstrtohex=Ee,t.hextob64=ke,t.hextob64nl=Se,t.b64nltohex=Ce,t.hextopem=Ae,t.pemtohex=Te,t.hextoArrayBuffer=function(e){if(e.length%2!=0)throw"input is not even length";if(null==e.match(/^[0-9A-Fa-f]+$/))throw"input is not hexadecimal";for(var t=new ArrayBuffer(e.length/2),n=new DataView(t),r=0;r<e.length/2;r++)n.setUint8(r,parseInt(e.substr(2*r,2),16));return t},t.ArrayBuffertohex=function(e){for(var t="",n=new DataView(e),r=0;r<e.byteLength;r++)t+=("00"+n.getUint8(r).toString(16)).slice(-2);return t},t.zulutomsec=Oe,t.zulutosec=Pe,t.zulutodate=function(e){return new Date(Oe(e))},t.datetozulu=function(e,t,n){var r,i=e.getUTCFullYear();if(t){if(i<1950||2049<i)throw"not proper year for UTCTime: "+i;r=(""+i).slice(-2)}else r=("000"+i).slice(-4);if(r+=("0"+(e.getUTCMonth()+1)).slice(-2),r+=("0"+e.getUTCDate()).slice(-2),r+=("0"+e.getUTCHours()).slice(-2),r+=("0"+e.getUTCMinutes()).slice(-2),r+=("0"+e.getUTCSeconds()).slice(-2),n){var o=e.getUTCMilliseconds();0!==o&&(r+="."+(o=(o=("00"+o).slice(-3)).replace(/0+$/g,"")))}return r+"Z"},t.uricmptohex=Ie,t.hextouricmp=je,t.ipv6tohex=Ne,t.hextoipv6=Fe,t.hextoip=Re,t.iptohex=function(e){var t="malformed IP address";if(!(e=e.toLowerCase(e)).match(/^[0-9.]+$/)){if(e.match(/^[0-9a-f:]+$/)&&-1!==e.indexOf(":"))return Ne(e);throw t}var n=e.split(".");if(4!==n.length)throw t;var r="";try{for(var i=0;i<4;i++)r+=("0"+parseInt(n[i]).toString(16)).slice(-2);return r}catch(e){throw t}},t.encodeURIComponentAll=De,t.newline_toUnix=function(e){return e.replace(/\r\n/gm,"\n")},t.newline_toDos=function(e){return(e=e.replace(/\r\n/gm,"\n")).replace(/\n/gm,"\r\n")},t.hextoposhex=Ue,t.intarystrtohex=function(e){e=(e=(e=e.replace(/^\s*\[\s*/,"")).replace(/\s*\]\s*$/,"")).replace(/\s*/g,"");try{return e.split(/,/).map((function(e,t,n){var r=parseInt(e);if(r<0||255<r)throw"integer not in range 0-255";return("00"+r.toString(16)).slice(-2)})).join("")}catch(e){throw"malformed integer array string: "+e}},t.strdiffidx=function(e,t){var n=e.length;e.length>t.length&&(n=t.length);for(var r=0;r<n;r++)if(e.charCodeAt(r)!=t.charCodeAt(r))return r;return e.length!=t.length?n:-1},t.KJUR=ce;var Ye=ce.crypto;t.crypto=Ye;var et=ce.asn1;t.asn1=et;var tt=ce.jws;t.jws=tt;var nt=ce.lang;t.lang=nt}).call(this,n(28).Buffer)},function(e,t,n){"use strict";(function(e){var r=n(30),i=n(31),o=n(32);function a(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=c.prototype:(null===e&&(e=new c(t)),e.length=t),e}function c(e,t,n){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return d(this,e)}return u(this,e,t,n)}function u(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r),c.TYPED_ARRAY_SUPPORT?(e=t).__proto__=c.prototype:e=p(e,t),e}(e,t,n,r):"string"==typeof t?function(e,t,n){if("string"==typeof n&&""!==n||(n="utf8"),!c.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|h(t,n),i=(e=s(e,r)).write(t,n);return i!==r&&(e=e.slice(0,i)),e}(e,t,n):function(e,t){if(c.isBuffer(t)){var n=0|f(t.length);return 0===(e=s(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||function(e){return e!=e}(t.length)?s(e,0):p(e,t);if("Buffer"===t.type&&o(t.data))return p(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function d(e,t){if(l(t),e=s(e,t<0?0:0|f(t)),!c.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function p(e,t){var n=t.length<0?0:0|f(t.length);e=s(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function f(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function h(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return q(e).length;default:if(r)return H(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,n);case"utf8":case"utf-8":return C(this,t,n);case"ascii":return T(this,t,n);case"latin1":case"binary":return O(this,t,n);case"base64":return S(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function v(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,i);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,i){var o,a=1,s=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var l=-1;for(o=n;o<s;o++)if(u(e,o)===u(t,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===c)return l*a}else-1!==l&&(o-=o-l),l=-1}else for(n+c>s&&(n=s-c),o=n;o>=0;o--){for(var d=!0,p=0;p<c;p++)if(u(e,o+p)!==u(t,p)){d=!1;break}if(d)return o}return-1}function b(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[n+a]=s}return a}function w(e,t,n,r){return W(H(t,e.length-n),e,n,r)}function x(e,t,n,r){return W(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function _(e,t,n,r){return x(e,t,n,r)}function E(e,t,n,r){return W(q(t),e,n,r)}function k(e,t,n,r){return W(function(e,t){for(var n,r,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)r=(n=e.charCodeAt(a))>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function S(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function C(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o,a,s,c,u=e[i],l=null,d=u>239?4:u>223?3:u>191?2:1;if(i+d<=n)switch(d){case 1:u<128&&(l=u);break;case 2:128==(192&(o=e[i+1]))&&(c=(31&u)<<6|63&o)>127&&(l=c);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(c=(15&u)<<12|(63&o)<<6|63&a)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(c=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&c<1114112&&(l=c)}null===l?(l=65533,d=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=d}return function(e){var t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=A));return n}(r)}t.Buffer=c,t.SlowBuffer=function(e){return+e!=e&&(e=0),c.alloc(+e)},t.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=a(),c.poolSize=8192,c._augment=function(e){return e.__proto__=c.prototype,e},c.from=function(e,t,n){return u(null,e,t,n)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(e,t,n){return function(e,t,n,r){return l(t),t<=0?s(e,t):void 0!==n?"string"==typeof r?s(e,t).fill(n,r):s(e,t).fill(n):s(e,t)}(null,e,t,n)},c.allocUnsafe=function(e){return d(null,e)},c.allocUnsafeSlow=function(e){return d(null,e)},c.isBuffer=function(e){return!(null==e||!e._isBuffer)},c.compare=function(e,t){if(!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=c.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var a=e[n];if(!c.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i),i+=a.length}return r},c.byteLength=h,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},c.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},c.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},c.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?C(this,0,e):m.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},c.prototype.compare=function(e,t,n,r,i){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(r,i),l=e.slice(t,n),d=0;d<s;++d)if(u[d]!==l[d]){o=u[d],a=l[d];break}return o<a?-1:a<o?1:0},c.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},c.prototype.indexOf=function(e,t,n){return v(this,e,t,n,!0)},c.prototype.lastIndexOf=function(e,t,n){return v(this,e,t,n,!1)},c.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return x(this,e,t,n);case"latin1":case"binary":return _(this,e,t,n);case"base64":return E(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function T(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function O(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function P(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=t;o<n;++o)i+=B(e[o]);return i}function I(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function j(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,n,r,i,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function F(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i<o;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function R(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i<o;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function L(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function D(e,t,n,r,o){return o||L(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function M(e,t,n,r,o){return o||L(e,0,n,8),i.write(e,t,n,r,52,8),n+8}c.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),c.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=c.prototype;else{var i=t-e;n=new c(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+e]}return n},c.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||j(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},c.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||j(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},c.prototype.readUInt8=function(e,t){return t||j(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||j(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||j(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||j(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||j(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||j(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||j(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},c.prototype.readInt8=function(e,t){return t||j(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||j(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){t||j(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return t||j(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||j(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||j(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||j(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||j(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||j(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,n,r){e=+e,t|=0,n|=0,r||N(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},c.prototype.writeUIntBE=function(e,t,n,r){e=+e,t|=0,n|=0,r||N(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},c.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):F(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):F(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):R(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):R(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);N(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<n&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},c.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);N(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):F(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):F(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):R(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):R(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,n){return D(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return D(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return M(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return M(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,o=r-n;if(this===e&&n<t&&t<r)for(i=o-1;i>=0;--i)e[i+t]=this[i+n];else if(o<1e3||!c.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),t);return o},c.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!c.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o<n;++o)this[o]=e;else{var a=c.isBuffer(e)?e:H(new c(e,r).toString()),s=a.length;for(o=0;o<n-t;++o)this[o+t]=a[o%s]}return this};var U=/[^+\/0-9A-Za-z-_]/g;function B(e){return e<16?"0"+e.toString(16):e.toString(16)}function H(e,t){var n;t=t||1/0;for(var r=e.length,i=null,o=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function q(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(U,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function W(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(29))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";t.byteLength=function(e){var t=u(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=u(e),a=r[0],s=r[1],c=new o(function(e,t,n){return 3*(t+n)/4-n}(0,a,s)),l=0,d=s>0?a-4:a;for(n=0;n<d;n+=4)t=i[e.charCodeAt(n)]<<18|i[e.charCodeAt(n+1)]<<12|i[e.charCodeAt(n+2)]<<6|i[e.charCodeAt(n+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;return 2===s&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,c[l++]=255&t),1===s&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],a=16383,s=0,c=n-i;s<c;s+=a)o.push(l(e,s,s+a>c?c:s+a));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,c=a.length;s<c;++s)r[s]=a[s],i[a.charCodeAt(s)]=s;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,n){for(var i,o,a=[],s=t;s<n;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,c=(1<<s)-1,u=c>>1,l=-7,d=n?i-1:0,p=n?-1:1,f=e[t+d];for(d+=p,o=f&(1<<-l)-1,f>>=-l,l+=s;l>0;o=256*o+e[t+d],d+=p,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+e[t+d],d+=p,l-=8);if(0===o)o=1-u;else{if(o===c)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=u}return(f?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var a,s,c,u=8*o-i-1,l=(1<<u)-1,d=l>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,h=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+d>=1?p/c:p*Math.pow(2,1-d))*c>=2&&(a++,c/=2),a+d>=l?(s=0,a=l):a+d>=1?(s=(t*c-1)*Math.pow(2,i),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[n+f]=255&s,f+=h,s/=256,i-=8);for(a=a<<i|s,u+=i;u>0;e[n+f]=255&a,f+=h,a/=256,u-=8);e[n+f-h]|=128*m}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.jws,n=e.KeyUtil,i=e.X509,o=e.crypto,a=e.hextob64u,s=e.b64tohex,c=e.AllowedSigningAlgs;return function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.parseJwt=function e(n){r.Log.debug("JoseUtil.parseJwt");try{var i=t.JWS.parse(n);return{header:i.headerObj,payload:i.payloadObj}}catch(e){r.Log.error(e)}},e.validateJwt=function(t,o,a,c,u,l,d){r.Log.debug("JoseUtil.validateJwt");try{if("RSA"===o.kty)if(o.e&&o.n)o=n.getKey(o);else{if(!o.x5c||!o.x5c.length)return r.Log.error("JoseUtil.validateJwt: RSA key missing key material",o),Promise.reject(new Error("RSA key missing key material"));var p=s(o.x5c[0]);o=i.getPublicKeyFromCertHex(p)}else{if("EC"!==o.kty)return r.Log.error("JoseUtil.validateJwt: Unsupported key type",o&&o.kty),Promise.reject(new Error(o.kty));if(!(o.crv&&o.x&&o.y))return r.Log.error("JoseUtil.validateJwt: EC key missing key material",o),Promise.reject(new Error("EC key missing key material"));o=n.getKey(o)}return e._validateJwt(t,o,a,c,u,l,d)}catch(e){return r.Log.error(e&&e.message||e),Promise.reject("JWT validation failed")}},e.validateJwtAttributes=function(t,n,i,o,a,s){o||(o=0),a||(a=parseInt(Date.now()/1e3));var c=e.parseJwt(t).payload;if(!c.iss)return r.Log.error("JoseUtil._validateJwt: issuer was not provided"),Promise.reject(new Error("issuer was not provided"));if(c.iss!==n)return r.Log.error("JoseUtil._validateJwt: Invalid issuer in token",c.iss),Promise.reject(new Error("Invalid issuer in token: "+c.iss));if(!c.aud)return r.Log.error("JoseUtil._validateJwt: aud was not provided"),Promise.reject(new Error("aud was not provided"));if(!(c.aud===i||Array.isArray(c.aud)&&c.aud.indexOf(i)>=0))return r.Log.error("JoseUtil._validateJwt: Invalid audience in token",c.aud),Promise.reject(new Error("Invalid audience in token: "+c.aud));if(c.azp&&c.azp!==i)return r.Log.error("JoseUtil._validateJwt: Invalid azp in token",c.azp),Promise.reject(new Error("Invalid azp in token: "+c.azp));if(!s){var u=a+o,l=a-o;if(!c.iat)return r.Log.error("JoseUtil._validateJwt: iat was not provided"),Promise.reject(new Error("iat was not provided"));if(u<c.iat)return r.Log.error("JoseUtil._validateJwt: iat is in the future",c.iat),Promise.reject(new Error("iat is in the future: "+c.iat));if(c.nbf&&u<c.nbf)return r.Log.error("JoseUtil._validateJwt: nbf is in the future",c.nbf),Promise.reject(new Error("nbf is in the future: "+c.nbf));if(!c.exp)return r.Log.error("JoseUtil._validateJwt: exp was not provided"),Promise.reject(new Error("exp was not provided"));if(c.exp<l)return r.Log.error("JoseUtil._validateJwt: exp is in the past",c.exp),Promise.reject(new Error("exp is in the past:"+c.exp))}return Promise.resolve(c)},e._validateJwt=function(n,i,o,a,s,u,l){return e.validateJwtAttributes(n,o,a,s,u,l).then((function(e){try{return t.JWS.verify(n,i,c)?e:(r.Log.error("JoseUtil._validateJwt: signature validation failed"),Promise.reject(new Error("signature validation failed")))}catch(e){return r.Log.error(e&&e.message||e),Promise.reject(new Error("signature validation failed"))}}))},e.hashString=function e(t,n){try{return o.Util.hashString(t,n)}catch(e){r.Log.error(e)}},e.hexToBase64Url=function e(t){try{return a(t)}catch(e){r.Log.error(e)}},e}()};var r=n(0);e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SigninResponse=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(3);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.SigninResponse=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#";o(this,e);var r=i.UrlUtility.parseUrlFragment(t,n);this.error=r.error,this.error_description=r.error_description,this.error_uri=r.error_uri,this.code=r.code,this.state=r.state,this.id_token=r.id_token,this.session_state=r.session_state,this.access_token=r.access_token,this.token_type=r.token_type,this.scope=r.scope,this.profile=void 0,this.expires_in=r.expires_in}return r(e,[{key:"expires_in",get:function(){if(this.expires_at){var e=parseInt(Date.now()/1e3);return this.expires_at-e}},set:function(e){var t=parseInt(e);if("number"==typeof t&&t>0){var n=parseInt(Date.now()/1e3);this.expires_at=n+t}}},{key:"expired",get:function(){var e=this.expires_in;if(void 0!==e)return e<=0}},{key:"scopes",get:function(){return(this.scope||"").split(" ")}},{key:"isOpenIdConnect",get:function(){return this.scopes.indexOf("openid")>=0||!!this.id_token}}]),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SignoutRequest=void 0;var r=n(0),i=n(3),o=n(9);t.SignoutRequest=function e(t){var n=t.url,a=t.id_token_hint,s=t.post_logout_redirect_uri,c=t.data,u=t.extraQueryParams,l=t.request_type;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!n)throw r.Log.error("SignoutRequest.ctor: No url passed"),new Error("url");for(var d in a&&(n=i.UrlUtility.addQueryParam(n,"id_token_hint",a)),s&&(n=i.UrlUtility.addQueryParam(n,"post_logout_redirect_uri",s),c&&(this.state=new o.State({data:c,request_type:l}),n=i.UrlUtility.addQueryParam(n,"state",this.state.id))),u)n=i.UrlUtility.addQueryParam(n,d,u[d]);this.url=n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SignoutResponse=void 0;var r=n(3);t.SignoutResponse=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n=r.UrlUtility.parseUrlFragment(t,"?");this.error=n.error,this.error_description=n.error_description,this.error_uri=n.error_uri,this.state=n.state}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InMemoryWebStorage=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0);t.InMemoryWebStorage=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._data={}}return e.prototype.getItem=function(e){return i.Log.debug("InMemoryWebStorage.getItem",e),this._data[e]},e.prototype.setItem=function(e,t){i.Log.debug("InMemoryWebStorage.setItem",e),this._data[e]=t},e.prototype.removeItem=function(e){i.Log.debug("InMemoryWebStorage.removeItem",e),delete this._data[e]},e.prototype.key=function(e){return Object.getOwnPropertyNames(this._data)[e]},r(e,[{key:"length",get:function(){return Object.getOwnPropertyNames(this._data).length}}]),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UserManager=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),o=n(10),a=n(39),s=n(15),c=n(45),u=n(47),l=n(18),d=n(8),p=n(20),f=n(11),h=n(4);function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}t.UserManager=function(e){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.SilentRenewService,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.SessionMonitor,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:p.TokenRevocationClient,d=arguments.length>4&&void 0!==arguments[4]?arguments[4]:f.TokenClient,v=arguments.length>5&&void 0!==arguments[5]?arguments[5]:h.JoseUtil;m(this,t),n instanceof a.UserManagerSettings||(n=new a.UserManagerSettings(n));var y=g(this,e.call(this,n));return y._events=new c.UserManagerEvents(n),y._silentRenewService=new r(y),y.settings.automaticSilentRenew&&(i.Log.debug("UserManager.ctor: automaticSilentRenew is configured, setting up silent renew"),y.startSilentRenew()),y.settings.monitorSession&&(i.Log.debug("UserManager.ctor: monitorSession is configured, setting up session monitor"),y._sessionMonitor=new o(y)),y._tokenRevocationClient=new s(y._settings),y._tokenClient=new d(y._settings),y._joseUtil=v,y}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.getUser=function(){var e=this;return this._loadUser().then((function(t){return t?(i.Log.info("UserManager.getUser: user loaded"),e._events.load(t,!1),t):(i.Log.info("UserManager.getUser: user not found in storage"),null)}))},t.prototype.removeUser=function(){var e=this;return this.storeUser(null).then((function(){i.Log.info("UserManager.removeUser: user removed from storage"),e._events.unload()}))},t.prototype.signinRedirect=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).request_type="si:r";var t={useReplaceToNavigate:e.useReplaceToNavigate};return this._signinStart(e,this._redirectNavigator,t).then((function(){i.Log.info("UserManager.signinRedirect: successful")}))},t.prototype.signinRedirectCallback=function(e){return this._signinEnd(e||this._redirectNavigator.url).then((function(e){return e.profile&&e.profile.sub?i.Log.info("UserManager.signinRedirectCallback: successful, signed in sub: ",e.profile.sub):i.Log.info("UserManager.signinRedirectCallback: no sub"),e}))},t.prototype.signinPopup=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).request_type="si:p";var t=e.redirect_uri||this.settings.popup_redirect_uri||this.settings.redirect_uri;return t?(e.redirect_uri=t,e.display="popup",this._signin(e,this._popupNavigator,{startUrl:t,popupWindowFeatures:e.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:e.popupWindowTarget||this.settings.popupWindowTarget}).then((function(e){return e&&(e.profile&&e.profile.sub?i.Log.info("UserManager.signinPopup: signinPopup successful, signed in sub: ",e.profile.sub):i.Log.info("UserManager.signinPopup: no sub")),e}))):(i.Log.error("UserManager.signinPopup: No popup_redirect_uri or redirect_uri configured"),Promise.reject(new Error("No popup_redirect_uri or redirect_uri configured")))},t.prototype.signinPopupCallback=function(e){return this._signinCallback(e,this._popupNavigator).then((function(e){return e&&(e.profile&&e.profile.sub?i.Log.info("UserManager.signinPopupCallback: successful, signed in sub: ",e.profile.sub):i.Log.info("UserManager.signinPopupCallback: no sub")),e})).catch((function(e){i.Log.error(e.message)}))},t.prototype.signinSilent=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=Object.assign({},t),this._loadUser().then((function(n){return n&&n.refresh_token?(t.refresh_token=n.refresh_token,e._useRefreshToken(t)):(t.request_type="si:s",t.id_token_hint=t.id_token_hint||e.settings.includeIdTokenInSilentRenew&&n&&n.id_token,n&&e._settings.validateSubOnSilentRenew&&(i.Log.debug("UserManager.signinSilent, subject prior to silent renew: ",n.profile.sub),t.current_sub=n.profile.sub),e._signinSilentIframe(t))}))},t.prototype._useRefreshToken=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._tokenClient.exchangeRefreshToken(t).then((function(t){return t?t.access_token?e._loadUser().then((function(n){if(n){var r=Promise.resolve();return t.id_token&&(r=e._validateIdTokenFromTokenRefreshToken(n.profile,t.id_token)),r.then((function(){return i.Log.debug("UserManager._useRefreshToken: refresh token response success"),n.id_token=t.id_token||n.id_token,n.access_token=t.access_token,n.refresh_token=t.refresh_token||n.refresh_token,n.expires_in=t.expires_in,e.storeUser(n).then((function(){return e._events.load(n),n}))}))}return null})):(i.Log.error("UserManager._useRefreshToken: No access token returned from token endpoint"),Promise.reject("No access token returned from token endpoint")):(i.Log.error("UserManager._useRefreshToken: No response returned from token endpoint"),Promise.reject("No response returned from token endpoint"))}))},t.prototype._validateIdTokenFromTokenRefreshToken=function(e,t){var n=this;return this._metadataService.getIssuer().then((function(r){return n.settings.getEpochTime().then((function(o){return n._joseUtil.validateJwtAttributes(t,r,n._settings.client_id,n._settings.clockSkew,o).then((function(t){return t?t.sub!==e.sub?(i.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: sub in id_token does not match current sub"),Promise.reject(new Error("sub in id_token does not match current sub"))):t.auth_time&&t.auth_time!==e.auth_time?(i.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: auth_time in id_token does not match original auth_time"),Promise.reject(new Error("auth_time in id_token does not match original auth_time"))):t.azp&&t.azp!==e.azp?(i.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: azp in id_token does not match original azp"),Promise.reject(new Error("azp in id_token does not match original azp"))):!t.azp&&e.azp?(i.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: azp not in id_token, but present in original id_token"),Promise.reject(new Error("azp not in id_token, but present in original id_token"))):void 0:(i.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: Failed to validate id_token"),Promise.reject(new Error("Failed to validate id_token")))}))}))}))},t.prototype._signinSilentIframe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.redirect_uri||this.settings.silent_redirect_uri||this.settings.redirect_uri;return t?(e.redirect_uri=t,e.prompt=e.prompt||"none",this._signin(e,this._iframeNavigator,{startUrl:t,silentRequestTimeout:e.silentRequestTimeout||this.settings.silentRequestTimeout}).then((function(e){return e&&(e.profile&&e.profile.sub?i.Log.info("UserManager.signinSilent: successful, signed in sub: ",e.profile.sub):i.Log.info("UserManager.signinSilent: no sub")),e}))):(i.Log.error("UserManager.signinSilent: No silent_redirect_uri configured"),Promise.reject(new Error("No silent_redirect_uri configured")))},t.prototype.signinSilentCallback=function(e){return this._signinCallback(e,this._iframeNavigator).then((function(e){return e&&(e.profile&&e.profile.sub?i.Log.info("UserManager.signinSilentCallback: successful, signed in sub: ",e.profile.sub):i.Log.info("UserManager.signinSilentCallback: no sub")),e}))},t.prototype.signinCallback=function(e){var t=this;return this.readSigninResponseState(e).then((function(n){var r=n.state;return n.response,"si:r"===r.request_type?t.signinRedirectCallback(e):"si:p"===r.request_type?t.signinPopupCallback(e):"si:s"===r.request_type?t.signinSilentCallback(e):Promise.reject(new Error("invalid response_type in state"))}))},t.prototype.signoutCallback=function(e,t){var n=this;return this.readSignoutResponseState(e).then((function(r){var i=r.state,o=r.response;return i?"so:r"===i.request_type?n.signoutRedirectCallback(e):"so:p"===i.request_type?n.signoutPopupCallback(e,t):Promise.reject(new Error("invalid response_type in state")):o}))},t.prototype.querySessionStatus=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).request_type="si:s";var n=t.redirect_uri||this.settings.silent_redirect_uri||this.settings.redirect_uri;return n?(t.redirect_uri=n,t.prompt="none",t.response_type=t.response_type||this.settings.query_status_response_type,t.scope=t.scope||"openid",t.skipUserInfo=!0,this._signinStart(t,this._iframeNavigator,{startUrl:n,silentRequestTimeout:t.silentRequestTimeout||this.settings.silentRequestTimeout}).then((function(t){return e.processSigninResponse(t.url).then((function(e){if(i.Log.debug("UserManager.querySessionStatus: got signin response"),e.session_state&&e.profile.sub)return i.Log.info("UserManager.querySessionStatus: querySessionStatus success for sub: ",e.profile.sub),{session_state:e.session_state,sub:e.profile.sub,sid:e.profile.sid};i.Log.info("querySessionStatus successful, user not authenticated")})).catch((function(t){if(t.session_state&&e.settings.monitorAnonymousSession&&("login_required"==t.message||"consent_required"==t.message||"interaction_required"==t.message||"account_selection_required"==t.message))return i.Log.info("UserManager.querySessionStatus: querySessionStatus success for anonymous user"),{session_state:t.session_state};throw t}))}))):(i.Log.error("UserManager.querySessionStatus: No silent_redirect_uri configured"),Promise.reject(new Error("No silent_redirect_uri configured")))},t.prototype._signin=function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._signinStart(e,t,r).then((function(t){return n._signinEnd(t.url,e)}))},t.prototype._signinStart=function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.prepare(r).then((function(t){return i.Log.debug("UserManager._signinStart: got navigator window handle"),n.createSigninRequest(e).then((function(e){return i.Log.debug("UserManager._signinStart: got signin request"),r.url=e.url,r.id=e.state.id,t.navigate(r)})).catch((function(e){throw t.close&&(i.Log.debug("UserManager._signinStart: Error after preparing navigator, closing navigator window"),t.close()),e}))}))},t.prototype._signinEnd=function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.processSigninResponse(e).then((function(e){i.Log.debug("UserManager._signinEnd: got signin response");var r=new s.User(e);if(n.current_sub){if(n.current_sub!==r.profile.sub)return i.Log.debug("UserManager._signinEnd: current user does not match user returned from signin. sub from signin: ",r.profile.sub),Promise.reject(new Error("login_required"));i.Log.debug("UserManager._signinEnd: current user matches user returned from signin")}return t.storeUser(r).then((function(){return i.Log.debug("UserManager._signinEnd: user stored"),t._events.load(r),r}))}))},t.prototype._signinCallback=function(e,t){i.Log.debug("UserManager._signinCallback");var n="query"===this._settings.response_mode||!this._settings.response_mode&&d.SigninRequest.isCode(this._settings.response_type)?"?":"#";return t.callback(e,void 0,n)},t.prototype.signoutRedirect=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).request_type="so:r";var t=e.post_logout_redirect_uri||this.settings.post_logout_redirect_uri;t&&(e.post_logout_redirect_uri=t);var n={useReplaceToNavigate:e.useReplaceToNavigate};return this._signoutStart(e,this._redirectNavigator,n).then((function(){i.Log.info("UserManager.signoutRedirect: successful")}))},t.prototype.signoutRedirectCallback=function(e){return this._signoutEnd(e||this._redirectNavigator.url).then((function(e){return i.Log.info("UserManager.signoutRedirectCallback: successful"),e}))},t.prototype.signoutPopup=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).request_type="so:p";var t=e.post_logout_redirect_uri||this.settings.popup_post_logout_redirect_uri||this.settings.post_logout_redirect_uri;return e.post_logout_redirect_uri=t,e.display="popup",e.post_logout_redirect_uri&&(e.state=e.state||{}),this._signout(e,this._popupNavigator,{startUrl:t,popupWindowFeatures:e.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:e.popupWindowTarget||this.settings.popupWindowTarget}).then((function(){i.Log.info("UserManager.signoutPopup: successful")}))},t.prototype.signoutPopupCallback=function(e,t){return void 0===t&&"boolean"==typeof e&&(t=e,e=null),this._popupNavigator.callback(e,t,"?").then((function(){i.Log.info("UserManager.signoutPopupCallback: successful")}))},t.prototype._signout=function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._signoutStart(e,t,r).then((function(e){return n._signoutEnd(e.url)}))},t.prototype._signoutStart=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this,n=arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.prepare(r).then((function(n){return i.Log.debug("UserManager._signoutStart: got navigator window handle"),t._loadUser().then((function(o){return i.Log.debug("UserManager._signoutStart: loaded current user from storage"),(t._settings.revokeAccessTokenOnSignout?t._revokeInternal(o):Promise.resolve()).then((function(){var a=e.id_token_hint||o&&o.id_token;return a&&(i.Log.debug("UserManager._signoutStart: Setting id_token into signout request"),e.id_token_hint=a),t.removeUser().then((function(){return i.Log.debug("UserManager._signoutStart: user removed, creating signout request"),t.createSignoutRequest(e).then((function(e){return i.Log.debug("UserManager._signoutStart: got signout request"),r.url=e.url,e.state&&(r.id=e.state.id),n.navigate(r)}))}))}))})).catch((function(e){throw n.close&&(i.Log.debug("UserManager._signoutStart: Error after preparing navigator, closing navigator window"),n.close()),e}))}))},t.prototype._signoutEnd=function(e){return this.processSignoutResponse(e).then((function(e){return i.Log.debug("UserManager._signoutEnd: got signout response"),e}))},t.prototype.revokeAccessToken=function(){var e=this;return this._loadUser().then((function(t){return e._revokeInternal(t,!0).then((function(n){if(n)return i.Log.debug("UserManager.revokeAccessToken: removing token properties from user and re-storing"),t.access_token=null,t.refresh_token=null,t.expires_at=null,t.token_type=null,e.storeUser(t).then((function(){i.Log.debug("UserManager.revokeAccessToken: user stored"),e._events.load(t)}))}))})).then((function(){i.Log.info("UserManager.revokeAccessToken: access token revoked successfully")}))},t.prototype._revokeInternal=function(e,t){var n=this;if(e){var r=e.access_token,o=e.refresh_token;return this._revokeAccessTokenInternal(r,t).then((function(e){return n._revokeRefreshTokenInternal(o,t).then((function(t){return e||t||i.Log.debug("UserManager.revokeAccessToken: no need to revoke due to no token(s), or JWT format"),e||t}))}))}return Promise.resolve(!1)},t.prototype._revokeAccessTokenInternal=function(e,t){return!e||e.indexOf(".")>=0?Promise.resolve(!1):this._tokenRevocationClient.revoke(e,t).then((function(){return!0}))},t.prototype._revokeRefreshTokenInternal=function(e,t){return e?this._tokenRevocationClient.revoke(e,t,"refresh_token").then((function(){return!0})):Promise.resolve(!1)},t.prototype.startSilentRenew=function(){this._silentRenewService.start()},t.prototype.stopSilentRenew=function(){this._silentRenewService.stop()},t.prototype._loadUser=function(){return this._userStore.get(this._userStoreKey).then((function(e){return e?(i.Log.debug("UserManager._loadUser: user storageString loaded"),s.User.fromStorageString(e)):(i.Log.debug("UserManager._loadUser: no user storageString"),null)}))},t.prototype.storeUser=function(e){if(e){i.Log.debug("UserManager.storeUser: storing user");var t=e.toStorageString();return this._userStore.set(this._userStoreKey,t)}return i.Log.debug("storeUser.storeUser: removing user"),this._userStore.remove(this._userStoreKey)},r(t,[{key:"_redirectNavigator",get:function(){return this.settings.redirectNavigator}},{key:"_popupNavigator",get:function(){return this.settings.popupNavigator}},{key:"_iframeNavigator",get:function(){return this.settings.iframeNavigator}},{key:"_userStore",get:function(){return this.settings.userStore}},{key:"events",get:function(){return this._events}},{key:"_userStoreKey",get:function(){return"user:"+this.settings.authority+":"+this.settings.client_id}}]),t}(o.OidcClient)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UserManagerSettings=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=(n(0),n(5)),o=n(40),a=n(41),s=n(43),c=n(6),u=n(1),l=n(8);function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}t.UserManagerSettings=function(e){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.popup_redirect_uri,i=n.popup_post_logout_redirect_uri,f=n.popupWindowFeatures,h=n.popupWindowTarget,m=n.silent_redirect_uri,g=n.silentRequestTimeout,v=n.automaticSilentRenew,y=void 0!==v&&v,b=n.validateSubOnSilentRenew,w=void 0!==b&&b,x=n.includeIdTokenInSilentRenew,_=void 0===x||x,E=n.monitorSession,k=void 0===E||E,S=n.monitorAnonymousSession,C=void 0!==S&&S,A=n.checkSessionInterval,T=void 0===A?2e3:A,O=n.stopCheckSessionOnError,P=void 0===O||O,I=n.query_status_response_type,j=n.revokeAccessTokenOnSignout,N=void 0!==j&&j,F=n.accessTokenExpiringNotificationTime,R=void 0===F?60:F,L=n.redirectNavigator,D=void 0===L?new o.RedirectNavigator:L,M=n.popupNavigator,U=void 0===M?new a.PopupNavigator:M,B=n.iframeNavigator,H=void 0===B?new s.IFrameNavigator:B,q=n.userStore,W=void 0===q?new c.WebStorageStateStore({store:u.Global.sessionStorage}):q;d(this,t);var K=p(this,e.call(this,arguments[0]));return K._popup_redirect_uri=r,K._popup_post_logout_redirect_uri=i,K._popupWindowFeatures=f,K._popupWindowTarget=h,K._silent_redirect_uri=m,K._silentRequestTimeout=g,K._automaticSilentRenew=y,K._validateSubOnSilentRenew=w,K._includeIdTokenInSilentRenew=_,K._accessTokenExpiringNotificationTime=R,K._monitorSession=k,K._monitorAnonymousSession=C,K._checkSessionInterval=T,K._stopCheckSessionOnError=P,I?K._query_status_response_type=I:arguments[0]&&arguments[0].response_type?K._query_status_response_type=l.SigninRequest.isOidc(arguments[0].response_type)?"id_token":"code":K._query_status_response_type="id_token",K._revokeAccessTokenOnSignout=N,K._redirectNavigator=D,K._popupNavigator=U,K._iframeNavigator=H,K._userStore=W,K}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"popup_redirect_uri",get:function(){return this._popup_redirect_uri}},{key:"popup_post_logout_redirect_uri",get:function(){return this._popup_post_logout_redirect_uri}},{key:"popupWindowFeatures",get:function(){return this._popupWindowFeatures}},{key:"popupWindowTarget",get:function(){return this._popupWindowTarget}},{key:"silent_redirect_uri",get:function(){return this._silent_redirect_uri}},{key:"silentRequestTimeout",get:function(){return this._silentRequestTimeout}},{key:"automaticSilentRenew",get:function(){return this._automaticSilentRenew}},{key:"validateSubOnSilentRenew",get:function(){return this._validateSubOnSilentRenew}},{key:"includeIdTokenInSilentRenew",get:function(){return this._includeIdTokenInSilentRenew}},{key:"accessTokenExpiringNotificationTime",get:function(){return this._accessTokenExpiringNotificationTime}},{key:"monitorSession",get:function(){return this._monitorSession}},{key:"monitorAnonymousSession",get:function(){return this._monitorAnonymousSession}},{key:"checkSessionInterval",get:function(){return this._checkSessionInterval}},{key:"stopCheckSessionOnError",get:function(){return this._stopCheckSessionOnError}},{key:"query_status_response_type",get:function(){return this._query_status_response_type}},{key:"revokeAccessTokenOnSignout",get:function(){return this._revokeAccessTokenOnSignout}},{key:"redirectNavigator",get:function(){return this._redirectNavigator}},{key:"popupNavigator",get:function(){return this._popupNavigator}},{key:"iframeNavigator",get:function(){return this._iframeNavigator}},{key:"userStore",get:function(){return this._userStore}}]),t}(i.OidcClientSettings)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RedirectNavigator=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0);t.RedirectNavigator=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.prototype.prepare=function(){return Promise.resolve(this)},e.prototype.navigate=function(e){return e&&e.url?(e.useReplaceToNavigate?window.location.replace(e.url):window.location=e.url,Promise.resolve()):(i.Log.error("RedirectNavigator.navigate: No url provided"),Promise.reject(new Error("No url provided")))},r(e,[{key:"url",get:function(){return window.location.href}}]),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PopupNavigator=void 0;var r=n(0),i=n(42);t.PopupNavigator=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.prototype.prepare=function(e){var t=new i.PopupWindow(e);return Promise.resolve(t)},e.prototype.callback=function e(t,n,o){r.Log.debug("PopupNavigator.callback");try{return i.PopupWindow.notifyOpener(t,n,o),Promise.resolve()}catch(e){return Promise.reject(e)}},e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PopupWindow=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),o=n(3);t.PopupWindow=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._promise=new Promise((function(e,t){n._resolve=e,n._reject=t}));var r=t.popupWindowTarget||"_blank",o=t.popupWindowFeatures||"location=no,toolbar=no,width=500,height=500,left=100,top=100;";this._popup=window.open("",r,o),this._popup&&(i.Log.debug("PopupWindow.ctor: popup successfully created"),this._checkForPopupClosedTimer=window.setInterval(this._checkForPopupClosed.bind(this),500))}return e.prototype.navigate=function(e){return this._popup?e&&e.url?(i.Log.debug("PopupWindow.navigate: Setting URL in popup"),this._id=e.id,this._id&&(window["popupCallback_"+e.id]=this._callback.bind(this)),this._popup.focus(),this._popup.window.location=e.url):(this._error("PopupWindow.navigate: no url provided"),this._error("No url provided")):this._error("PopupWindow.navigate: Error opening popup window"),this.promise},e.prototype._success=function(e){i.Log.debug("PopupWindow.callback: Successful response from popup window"),this._cleanup(),this._resolve(e)},e.prototype._error=function(e){i.Log.error("PopupWindow.error: ",e),this._cleanup(),this._reject(new Error(e))},e.prototype.close=function(){this._cleanup(!1)},e.prototype._cleanup=function(e){i.Log.debug("PopupWindow.cleanup"),window.clearInterval(this._checkForPopupClosedTimer),this._checkForPopupClosedTimer=null,delete window["popupCallback_"+this._id],this._popup&&!e&&this._popup.close(),this._popup=null},e.prototype._checkForPopupClosed=function(){this._popup&&!this._popup.closed||this._error("Popup window closed")},e.prototype._callback=function(e,t){this._cleanup(t),e?(i.Log.debug("PopupWindow.callback success"),this._success({url:e})):(i.Log.debug("PopupWindow.callback: Invalid response from popup"),this._error("Invalid response from popup"))},e.notifyOpener=function(e,t,n){if(window.opener){if(e=e||window.location.href){var r=o.UrlUtility.parseUrlFragment(e,n);if(r.state){var a="popupCallback_"+r.state,s=window.opener[a];s?(i.Log.debug("PopupWindow.notifyOpener: passing url message to opener"),s(e,t)):i.Log.warn("PopupWindow.notifyOpener: no matching callback found on opener")}else i.Log.warn("PopupWindow.notifyOpener: no state found in response url")}}else i.Log.warn("PopupWindow.notifyOpener: no window.opener. Can't complete notification.")},r(e,[{key:"promise",get:function(){return this._promise}}]),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IFrameNavigator=void 0;var r=n(0),i=n(44);t.IFrameNavigator=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.prototype.prepare=function(e){var t=new i.IFrameWindow(e);return Promise.resolve(t)},e.prototype.callback=function e(t){r.Log.debug("IFrameNavigator.callback");try{return i.IFrameWindow.notifyParent(t),Promise.resolve()}catch(e){return Promise.reject(e)}},e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IFrameWindow=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0);t.IFrameWindow=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._promise=new Promise((function(e,t){n._resolve=e,n._reject=t})),this._boundMessageEvent=this._message.bind(this),window.addEventListener("message",this._boundMessageEvent,!1),this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="absolute",this._frame.width=0,this._frame.height=0,window.document.body.appendChild(this._frame)}return e.prototype.navigate=function(e){if(e&&e.url){var t=e.silentRequestTimeout||1e4;i.Log.debug("IFrameWindow.navigate: Using timeout of:",t),this._timer=window.setTimeout(this._timeout.bind(this),t),this._frame.src=e.url}else this._error("No url provided");return this.promise},e.prototype._success=function(e){this._cleanup(),i.Log.debug("IFrameWindow: Successful response from frame window"),this._resolve(e)},e.prototype._error=function(e){this._cleanup(),i.Log.error(e),this._reject(new Error(e))},e.prototype.close=function(){this._cleanup()},e.prototype._cleanup=function(){this._frame&&(i.Log.debug("IFrameWindow: cleanup"),window.removeEventListener("message",this._boundMessageEvent,!1),window.clearTimeout(this._timer),window.document.body.removeChild(this._frame),this._timer=null,this._frame=null,this._boundMessageEvent=null)},e.prototype._timeout=function(){i.Log.debug("IFrameWindow.timeout"),this._error("Frame window timed out")},e.prototype._message=function(e){if(i.Log.debug("IFrameWindow.message"),this._timer&&e.origin===this._origin&&e.source===this._frame.contentWindow&&"string"==typeof e.data&&(e.data.startsWith("http://")||e.data.startsWith("https://"))){var t=e.data;t?this._success({url:t}):this._error("Invalid response from frame")}},e.notifyParent=function(e){i.Log.debug("IFrameWindow.notifyParent"),(e=e||window.location.href)&&(i.Log.debug("IFrameWindow.notifyParent: posting url message to parent"),window.parent.postMessage(e,location.protocol+"//"+location.host))},r(e,[{key:"promise",get:function(){return this._promise}},{key:"_origin",get:function(){return location.protocol+"//"+location.host}}]),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UserManagerEvents=void 0;var r=n(0),i=n(16),o=n(17);t.UserManagerEvents=function(e){function t(n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n));return r._userLoaded=new o.Event("User loaded"),r._userUnloaded=new o.Event("User unloaded"),r._silentRenewError=new o.Event("Silent renew error"),r._userSignedIn=new o.Event("User signed in"),r._userSignedOut=new o.Event("User signed out"),r._userSessionChanged=new o.Event("User session changed"),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.load=function(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];r.Log.debug("UserManagerEvents.load"),e.prototype.load.call(this,t),n&&this._userLoaded.raise(t)},t.prototype.unload=function(){r.Log.debug("UserManagerEvents.unload"),e.prototype.unload.call(this),this._userUnloaded.raise()},t.prototype.addUserLoaded=function(e){this._userLoaded.addHandler(e)},t.prototype.removeUserLoaded=function(e){this._userLoaded.removeHandler(e)},t.prototype.addUserUnloaded=function(e){this._userUnloaded.addHandler(e)},t.prototype.removeUserUnloaded=function(e){this._userUnloaded.removeHandler(e)},t.prototype.addSilentRenewError=function(e){this._silentRenewError.addHandler(e)},t.prototype.removeSilentRenewError=function(e){this._silentRenewError.removeHandler(e)},t.prototype._raiseSilentRenewError=function(e){r.Log.debug("UserManagerEvents._raiseSilentRenewError",e.message),this._silentRenewError.raise(e)},t.prototype.addUserSignedIn=function(e){this._userSignedIn.addHandler(e)},t.prototype.removeUserSignedIn=function(e){this._userSignedIn.removeHandler(e)},t.prototype._raiseUserSignedIn=function(){r.Log.debug("UserManagerEvents._raiseUserSignedIn"),this._userSignedIn.raise()},t.prototype.addUserSignedOut=function(e){this._userSignedOut.addHandler(e)},t.prototype.removeUserSignedOut=function(e){this._userSignedOut.removeHandler(e)},t.prototype._raiseUserSignedOut=function(){r.Log.debug("UserManagerEvents._raiseUserSignedOut"),this._userSignedOut.raise()},t.prototype.addUserSessionChanged=function(e){this._userSessionChanged.addHandler(e)},t.prototype.removeUserSessionChanged=function(e){this._userSessionChanged.removeHandler(e)},t.prototype._raiseUserSessionChanged=function(){r.Log.debug("UserManagerEvents._raiseUserSessionChanged"),this._userSessionChanged.raise()},t}(i.AccessTokenEvents)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Timer=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),o=n(1),a=n(17);function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}t.Timer=function(e){function t(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.Global.timer,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;s(this,t);var a=c(this,e.call(this,n));return a._timer=r,a._nowFunc=i||function(){return Date.now()/1e3},a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.init=function(e){e<=0&&(e=1),e=parseInt(e);var t=this.now+e;if(this.expiration===t&&this._timerHandle)i.Log.debug("Timer.init timer "+this._name+" skipping initialization since already initialized for expiration:",this.expiration);else{this.cancel(),i.Log.debug("Timer.init timer "+this._name+" for duration:",e),this._expiration=t;var n=5;e<n&&(n=e),this._timerHandle=this._timer.setInterval(this._callback.bind(this),1e3*n)}},t.prototype.cancel=function(){this._timerHandle&&(i.Log.debug("Timer.cancel: ",this._name),this._timer.clearInterval(this._timerHandle),this._timerHandle=null)},t.prototype._callback=function(){var t=this._expiration-this.now;i.Log.debug("Timer.callback; "+this._name+" timer expires in:",t),this._expiration<=this.now&&(this.cancel(),e.prototype.raise.call(this))},r(t,[{key:"now",get:function(){return parseInt(this._nowFunc())}},{key:"expiration",get:function(){return this._expiration}}]),t}(a.Event)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SilentRenewService=void 0;var r=n(0);t.SilentRenewService=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._userManager=t}return e.prototype.start=function(){this._callback||(this._callback=this._tokenExpiring.bind(this),this._userManager.events.addAccessTokenExpiring(this._callback),this._userManager.getUser().then((function(e){})).catch((function(e){r.Log.error("SilentRenewService.start: Error from getUser:",e.message)})))},e.prototype.stop=function(){this._callback&&(this._userManager.events.removeAccessTokenExpiring(this._callback),delete this._callback)},e.prototype._tokenExpiring=function(){var e=this;this._userManager.signinSilent().then((function(e){r.Log.debug("SilentRenewService._tokenExpiring: Silent token renewal successful")}),(function(t){r.Log.error("SilentRenewService._tokenExpiring: Error from signinSilent:",t.message),e._userManager.events._raiseSilentRenewError(t)}))},e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CordovaPopupNavigator=void 0;var r=n(21);t.CordovaPopupNavigator=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.prototype.prepare=function(e){var t=new r.CordovaPopupWindow(e);return Promise.resolve(t)},e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CordovaIFrameNavigator=void 0;var r=n(21);t.CordovaIFrameNavigator=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.prototype.prepare=function(e){e.popupWindowFeatures="hidden=yes";var t=new r.CordovaPopupWindow(e);return Promise.resolve(t)},e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Version="1.11.6"}])},e.exports=t()},143:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(835),i=n(857),o=(e,t)=>window.fetch(e,t);t.default=class{constructor(e,t,n,a,s){this.loginHandler=e,this.redirectHandler=t,this.logoutHandler=n,this.sessionInfoManager=a,this.issuerConfigFetcher=s,this.login=async(e,t)=>{var n,o;await this.sessionInfoManager.clear(e.sessionId);const a=null!==(n=e.redirectUrl)&&void 0!==n?n:(0,i.removeOidcQueryParam)(window.location.href);if(!(0,r.isValidRedirectUrl)(a))throw new Error(`${a} is not a valid redirect URL, it is either a malformed IRI or it includes a hash fragment.`);await this.loginHandler.handle({...e,redirectUrl:a,clientName:null!==(o=e.clientName)&&void 0!==o?o:e.clientId,eventEmitter:t})},this.fetch=o,this.logout=async e=>{await this.logoutHandler.handle(e),this.fetch=o},this.getSessionInfo=async e=>this.sessionInfoManager.get(e),this.getAllSessionInfo=async()=>this.sessionInfoManager.getAll(),this.validateCurrentSession=async e=>{const t=await this.sessionInfoManager.get(e);return void 0===t||void 0===t.clientAppId||void 0===t.issuer?null:t},this.handleIncomingRedirect=async(e,t)=>{try{const n=await this.redirectHandler.handle(e,t);return this.fetch=n.fetch.bind(window),this.cleanUrlAfterRedirect(e),{isLoggedIn:n.isLoggedIn,webId:n.webId,sessionId:n.sessionId,expirationDate:n.expirationDate}}catch(n){return this.cleanUrlAfterRedirect(e),void t.emit(r.EVENTS.ERROR,"redirect",n)}}}cleanUrlAfterRedirect(e){const t=new URL(e);t.searchParams.delete("state"),t.searchParams.delete("code"),t.searchParams.delete("id_token"),t.searchParams.delete("access_token"),t.searchParams.delete("error"),t.searchParams.delete("error_description"),t.searchParams.delete("iss"),window.history.replaceState(null,"",t.toString())}}},3598:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Session=t.silentlyAuthenticate=void 0;const r=n(7187),i=n(835),o=n(3438),a=n(3537),s=n(3783);async function c(e,t,n){var r;const i=await t.validateCurrentSession(e);return null!==i&&(window.localStorage.setItem(s.KEY_CURRENT_URL,window.location.href),await t.login({sessionId:e,prompt:"none",oidcIssuer:i.issuer,redirectUrl:i.redirectUrl,clientId:i.clientAppId,clientSecret:i.clientAppSecret,tokenType:null!==(r=i.tokenType)&&void 0!==r?r:"DPoP"},n),!0)}t.silentlyAuthenticate=c;class u extends r.EventEmitter{constructor(e={},t){super(),this.tokenRequestInProgress=!1,this.login=async e=>{var t;return await this.clientAuthentication.login({sessionId:this.info.sessionId,...e,tokenType:null!==(t=e.tokenType)&&void 0!==t?t:"DPoP"},this),new Promise((()=>{}))},this.fetch=async(e,t)=>this.clientAuthentication.fetch(e,t),this.internalLogout=async e=>{window.localStorage.removeItem(s.KEY_CURRENT_SESSION),await this.clientAuthentication.logout(this.info.sessionId),this.info.isLoggedIn=!1,e&&this.emit(i.EVENTS.LOGOUT)},this.logout=async()=>this.internalLogout(!0),this.handleIncomingRedirect=async(e={})=>{var t;if(this.info.isLoggedIn)return this.info;if(this.tokenRequestInProgress)return;const n="string"==typeof e?{url:e}:e,r=null!==(t=n.url)&&void 0!==t?t:window.location.href;this.tokenRequestInProgress=!0;const o=await this.clientAuthentication.handleIncomingRedirect(r,this);if(function(e){return!!(null==e?void 0:e.isLoggedIn)}(o)){this.setSessionInfo(o);const e=window.localStorage.getItem(s.KEY_CURRENT_URL);null===e?this.emit(i.EVENTS.LOGIN):(window.localStorage.removeItem(s.KEY_CURRENT_URL),this.emit(i.EVENTS.SESSION_RESTORED,e))}else if(!0===n.restorePreviousSession){const e=window.localStorage.getItem(s.KEY_CURRENT_SESSION);if(null!==e&&await c(e,this.clientAuthentication,this))return new Promise((()=>{}))}return this.tokenRequestInProgress=!1,o},e.clientAuthentication?this.clientAuthentication=e.clientAuthentication:e.secureStorage&&e.insecureStorage?this.clientAuthentication=(0,a.getClientAuthenticationWithDependencies)({secureStorage:e.secureStorage,insecureStorage:e.insecureStorage}):this.clientAuthentication=(0,a.getClientAuthenticationWithDependencies)({}),e.sessionInfo?this.info={sessionId:e.sessionInfo.sessionId,isLoggedIn:!1,webId:e.sessionInfo.webId}:this.info={sessionId:null!=t?t:(0,o.v4)(),isLoggedIn:!1},this.on(i.EVENTS.LOGIN,(()=>window.localStorage.setItem(s.KEY_CURRENT_SESSION,this.info.sessionId))),this.on(i.EVENTS.SESSION_EXPIRED,(()=>this.internalLogout(!1))),this.on(i.EVENTS.ERROR,(()=>this.internalLogout(!1)))}onLogin(e){this.on(i.EVENTS.LOGIN,e)}onLogout(e){this.on(i.EVENTS.LOGOUT,e)}onError(e){this.on(i.EVENTS.ERROR,e)}onSessionRestore(e){this.on(i.EVENTS.SESSION_RESTORED,e)}onSessionExpiration(e){this.on(i.EVENTS.SESSION_EXPIRED,e)}setSessionInfo(e){this.info.isLoggedIn=e.isLoggedIn,this.info.webId=e.webId,this.info.sessionId=e.sessionId,this.info.expirationDate=e.expirationDate,this.on(i.EVENTS.SESSION_EXTENDED,(e=>{this.info.expirationDate=Date.now()+1e3*e}))}}t.Session=u},3783:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KEY_CURRENT_URL=t.KEY_CURRENT_SESSION=void 0;const r=n(835);t.KEY_CURRENT_SESSION=`${r.SOLID_CLIENT_AUTHN_KEY_PREFIX}currentSession`,t.KEY_CURRENT_URL=`${r.SOLID_CLIENT_AUTHN_KEY_PREFIX}currentUrl`},7814:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.onSessionRestore=t.onLogout=t.onLogin=t.handleIncomingRedirect=t.logout=t.login=t.fetch=t.getDefaultSession=void 0;const r=n(3598);let i;function o(){return void 0===i&&(i=new r.Session),i}t.getDefaultSession=o,t.fetch=(...e)=>o().fetch(...e),t.login=(...e)=>o().login(...e),t.logout=(...e)=>o().logout(...e),t.handleIncomingRedirect=(...e)=>o().handleIncomingRedirect(...e),t.onLogin=(...e)=>o().onLogin(...e),t.onLogout=(...e)=>o().onLogout(...e),t.onSessionRestore=(...e)=>o().onSessionRestore(...e)},3537:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getClientAuthenticationWithDependencies=void 0;const i=n(835),o=r(n(437)),a=r(n(143)),s=r(n(2018)),c=r(n(1590)),u=r(n(4377)),l=n(9582),d=r(n(2186)),p=n(3624),f=n(1272),h=r(n(2056)),m=r(n(5394)),g=r(n(2536)),v=r(n(7826)),y=n(7927),b=r(n(6066));t.getClientAuthenticationWithDependencies=function(e){const t=new i.InMemoryStorage,n=e.secureStorage||t,r=e.insecureStorage||new m.default,w=new o.default(n,r),x=new u.default(w),_=new v.default(w),E=new p.SessionInfoManager(w),k=new b.default(w,x,_),S=new s.default(w,new c.default(w,new g.default),x,_),C=new h.default([new y.ErrorOidcHandler,new f.AuthCodeRedirectHandler(w,E,x,_,k),new l.FallbackRedirectHandler]);return new a.default(S,C,new d.default(E),E,x)}},4305:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.InMemoryStorage=t.ConfigurationError=t.NotImplementedError=t.getClientAuthenticationWithDependencies=t.Session=void 0;var o=n(3598);Object.defineProperty(t,"Session",{enumerable:!0,get:function(){return o.Session}});var a=n(3537);Object.defineProperty(t,"getClientAuthenticationWithDependencies",{enumerable:!0,get:function(){return a.getClientAuthenticationWithDependencies}}),i(n(7814),t);var s=n(835);Object.defineProperty(t,"NotImplementedError",{enumerable:!0,get:function(){return s.NotImplementedError}}),Object.defineProperty(t,"ConfigurationError",{enumerable:!0,get:function(){return s.ConfigurationError}}),Object.defineProperty(t,"InMemoryStorage",{enumerable:!0,get:function(){return s.InMemoryStorage}})},2056:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(835);class i extends r.AggregateHandler{constructor(e){super(e)}}t.default=i},7826:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(857);t.default=class{constructor(e){this.storageUtility=e}async getClient(e,t){const[n,i]=await Promise.all([this.storageUtility.getForUser(e.sessionId,"clientId",{secure:!1}),this.storageUtility.getForUser(e.sessionId,"clientSecret",{secure:!1})]);if(n)return{clientId:n,clientSecret:i,clientType:"dynamic"};try{const n=await(0,r.registerClient)(e,t),i={clientId:n.clientId};return n.clientSecret&&(i.clientSecret=n.clientSecret),n.idTokenSignedResponseAlg&&(i.idTokenSignedResponseAlg=n.idTokenSignedResponseAlg),await this.storageUtility.setForUser(e.sessionId,i,{secure:!1}),n}catch(e){throw new Error(`Client registration failed: [${e}]`)}}}},4377:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WELL_KNOWN_OPENID_CONFIG=void 0;const r=n(835);t.WELL_KNOWN_OPENID_CONFIG=".well-known/openid-configuration";const i={issuer:{toKey:"issuer",convertToUrl:!0},authorization_endpoint:{toKey:"authorizationEndpoint",convertToUrl:!0},token_endpoint:{toKey:"tokenEndpoint",convertToUrl:!0},userinfo_endpoint:{toKey:"userinfoEndpoint",convertToUrl:!0},jwks_uri:{toKey:"jwksUri",convertToUrl:!0},registration_endpoint:{toKey:"registrationEndpoint",convertToUrl:!0},scopes_supported:{toKey:"scopesSupported"},response_types_supported:{toKey:"responseTypesSupported"},response_modes_supported:{toKey:"responseModesSupported"},grant_types_supported:{toKey:"grantTypesSupported"},acr_values_supported:{toKey:"acrValuesSupported"},subject_types_supported:{toKey:"subjectTypesSupported"},id_token_signing_alg_values_supported:{toKey:"idTokenSigningAlgValuesSupported"},id_token_encryption_alg_values_supported:{toKey:"idTokenEncryptionAlgValuesSupported"},id_token_encryption_enc_values_supported:{toKey:"idTokenEncryptionEncValuesSupported"},userinfo_signing_alg_values_supported:{toKey:"userinfoSigningAlgValuesSupported"},userinfo_encryption_alg_values_supported:{toKey:"userinfoEncryptionAlgValuesSupported"},userinfo_encryption_enc_values_supported:{toKey:"userinfoEncryptionEncValuesSupported"},request_object_signing_alg_values_supported:{toKey:"requestObjectSigningAlgValuesSupported"},request_object_encryption_alg_values_supported:{toKey:"requestObjectEncryptionAlgValuesSupported"},request_object_encryption_enc_values_supported:{toKey:"requestObjectEncryptionEncValuesSupported"},token_endpoint_auth_methods_supported:{toKey:"tokenEndpointAuthMethodsSupported"},token_endpoint_auth_signing_alg_values_supported:{toKey:"tokenEndpointAuthSigningAlgValuesSupported"},display_values_supported:{toKey:"displayValuesSupported"},claim_types_supported:{toKey:"claimTypesSupported"},claims_supported:{toKey:"claimsSupported"},service_documentation:{toKey:"serviceDocumentation"},claims_locales_supported:{toKey:"claimsLocalesSupported"},ui_locales_supported:{toKey:"uiLocalesSupported"},claims_parameter_supported:{toKey:"claimsParameterSupported"},request_parameter_supported:{toKey:"requestParameterSupported"},request_uri_parameter_supported:{toKey:"requestUriParameterSupported"},require_request_uri_registration:{toKey:"requireRequestUriRegistration"},op_policy_uri:{toKey:"opPolicyUri",convertToUrl:!0},op_tos_uri:{toKey:"opTosUri",convertToUrl:!0}};class o{constructor(e){this.storageUtility=e}static getLocalStorageKey(e){return`issuerConfig:${e}`}async fetchConfig(e){let n;const a=new URL(t.WELL_KNOWN_OPENID_CONFIG,e.endsWith("/")?e:`${e}/`).href,s=await window.fetch(a);try{n=function(e){const t={};return Object.keys(e).forEach((n=>{i[n]&&(t[i[n].toKey]=e[n])})),Array.isArray(t.scopesSupported)||(t.scopesSupported=["openid"]),t}(await s.json())}catch(t){throw new r.ConfigurationError(`[${e.toString()}] has an invalid configuration: ${t.message}`)}return await this.storageUtility.set(o.getLocalStorageKey(e),JSON.stringify(n)),n}}t.default=o},2018:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(835);function i(e){return"string"==typeof e.oidcIssuer}function o(e){return"string"==typeof e.redirectUrl}t.default=class{constructor(e,t,n,r){this.storageUtility=e,this.oidcHandler=t,this.issuerConfigFetcher=n,this.clientRegistrar=r}async canHandle(e){return i(e)&&o(e)}async handle(e){if(!i(e))throw new r.ConfigurationError(`OidcLoginHandler requires an OIDC issuer: missing property 'oidcIssuer' in ${JSON.stringify(e)}`);if(!o(e))throw new r.ConfigurationError(`OidcLoginHandler requires a redirect URL: missing property 'redirectUrl' in ${JSON.stringify(e)}`);const t=await this.issuerConfigFetcher.fetchConfig(e.oidcIssuer),n=await(0,r.handleRegistration)(e,t,this.storageUtility,this.clientRegistrar),a={issuer:t.issuer,dpop:"dpop"===e.tokenType.toLowerCase(),...e,issuerConfiguration:t,client:n};return this.oidcHandler.handle(a)}}},2536:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{redirect(e,t){t&&t.handleRedirect?t.handleRedirect(e):t&&t.redirectByReplacingState?window.history.replaceState({},"",e):window.location.href=e}}},1272:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AuthCodeRedirectHandler=void 0;const r=n(835),i=n(857);t.AuthCodeRedirectHandler=class{constructor(e,t,n,r,i){this.storageUtility=e,this.sessionInfoManager=t,this.issuerConfigFetcher=n,this.clientRegistrar=r,this.tokerRefresher=i}async canHandle(e){try{const t=new URL(e);return null!==t.searchParams.get("code")&&null!==t.searchParams.get("state")}catch(t){throw new Error(`[${e}] is not a valid URL, and cannot be used as a redirect URL: ${t}`)}}async handle(e,t){if(!await this.canHandle(e))throw new Error(`AuthCodeRedirectHandler cannot handle [${e}]: it is missing one of [code, state].`);const n=new URL(e),o=n.searchParams.get("state"),a=await this.storageUtility.getForUser(o,"sessionId",{errorIfNull:!0}),{issuerConfig:s,codeVerifier:c,redirectUrl:u,dpop:l}=await(0,r.loadOidcContextFromStorage)(a,this.storageUtility,this.issuerConfigFetcher),d=n.searchParams.get("iss");if("string"==typeof d&&d!==s.issuer)throw new Error(`The value of the iss parameter (${d}) does not match the issuer identifier of the authorization server (${s.issuer}). See [rfc9207](https://www.rfc-editor.org/rfc/rfc9207.html#section-2.3-3.1.1)`);if(void 0===c)throw new Error(`The code verifier for session ${a} is missing from storage.`);if(void 0===u)throw new Error(`The redirect URL for session ${a} is missing from storage.`);const p=await this.clientRegistrar.getClient({sessionId:a},s);let f;const h=Date.now();let m;l?(f=await(0,i.getDpopToken)(s,p,{grantType:"authorization_code",code:n.searchParams.get("code"),codeVerifier:c,redirectUrl:u}),window.localStorage.removeItem(`oidc.${o}`)):f=await(0,i.getBearerToken)(n.toString()),void 0!==f.refreshToken&&(m={sessionId:a,refreshToken:f.refreshToken,tokenRefresher:this.tokerRefresher});const g=await(0,r.buildAuthenticatedFetch)(fetch,f.accessToken,{dpopKey:f.dpopKey,refreshOptions:m,eventEmitter:t,expiresIn:f.expiresIn});await this.storageUtility.setForUser(a,{webId:f.webId,isLoggedIn:"true"},{secure:!0});const v=await this.sessionInfoManager.get(a);if(!v)throw new Error(`Could not retrieve session: [${a}].`);return Object.assign(v,{fetch:g,expirationDate:"number"==typeof f.expiresIn?h+1e3*f.expiresIn:null})}}},7927:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorOidcHandler=void 0;const r=n(835),i=n(3624);t.ErrorOidcHandler=class{async canHandle(e){try{return new URL(e).searchParams.has("error")}catch(t){throw new Error(`[${e}] is not a valid URL, and cannot be used as a redirect URL: ${t}`)}}async handle(e,t){if(void 0!==t){const n=new URL(e),i=n.searchParams.get("error"),o=n.searchParams.get("error_description");t.emit(r.EVENTS.ERROR,i,o)}return(0,i.getUnauthenticatedSession)()}}},9582:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FallbackRedirectHandler=void 0;const r=n(3624);t.FallbackRedirectHandler=class{async canHandle(e){try{return new URL(e),!0}catch(t){throw new Error(`[${e}] is not a valid URL, and cannot be used as a redirect URL: ${t}`)}}async handle(e){return(0,r.getUnauthenticatedSession)()}}},1590:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(835),i=n(857);t.default=class{constructor(e,t){this.storageUtility=e,this.redirector=t}async canHandle(e){return!!(e.issuerConfiguration.grantTypesSupported&&e.issuerConfiguration.grantTypesSupported.indexOf("authorization_code")>-1)}async handle(e){var t;const n={authority:e.issuer.toString(),client_id:e.client.clientId,client_secret:e.client.clientSecret,redirect_uri:e.redirectUrl.toString(),post_logout_redirect_uri:e.redirectUrl.toString(),response_type:"code",scope:r.DEFAULT_SCOPES,filterProtocolClaims:!0,loadUserInfo:!1,code_verifier:!0,prompt:null!==(t=e.prompt)&&void 0!==t?t:"consent"},o=new i.OidcClient(n),{redirector:a}=this,s=this.storageUtility;try{const t=await o.createSigninRequest();await Promise.all([s.setForUser(t.state._id,{sessionId:e.sessionId}),s.setForUser(e.sessionId,{codeVerifier:t.state._code_verifier,issuer:e.issuer.toString(),redirectUrl:e.redirectUrl,dpop:e.dpop?"true":"false"})]),a.redirect(t.url.toString(),{handleRedirect:e.handleRedirect})}catch(e){console.error(e)}}}},6066:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(835),i=n(857);t.default=class{constructor(e,t,n){this.storageUtility=e,this.issuerConfigFetcher=t,this.clientRegistrar=n}async refresh(e,t,n,o){const a=await(0,r.loadOidcContextFromStorage)(e,this.storageUtility,this.issuerConfigFetcher),s=await this.clientRegistrar.getClient({sessionId:e},a.issuerConfig);if(void 0===t)throw new Error(`Session [${e}] has no refresh token to allow it to refresh its access token.`);if(a.dpop&&void 0===n)throw new Error(`For session [${e}], the key bound to the DPoP access token must be provided to refresh said access token.`);const c=await(0,i.refresh)(t,a.issuerConfig,s,n);return void 0!==c.refreshToken&&(null==o||o.emit(r.EVENTS.NEW_REFRESH_TOKEN,c.refreshToken),await this.storageUtility.setForUser(e,{refreshToken:c.refreshToken})),c}}},2186:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{constructor(e){this.sessionInfoManager=e}async canHandle(){return!0}async handle(e){await this.sessionInfoManager.clear(e)}}},3624:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SessionInfoManager=t.clear=t.getUnauthenticatedSession=void 0;const r=n(835),i=n(3438),o=n(857);async function a(e,t){await Promise.all([t.deleteAllUserData(e,{secure:!1}),t.deleteAllUserData(e,{secure:!0}),t.delete("clientKey",{secure:!1})]),await(0,o.clearOidcPersistentStorage)()}t.getUnauthenticatedSession=function(){return{isLoggedIn:!1,sessionId:(0,i.v4)(),fetch}},t.clear=a,t.SessionInfoManager=class{constructor(e){this.storageUtility=e}update(e,t){throw new Error("Not Implemented")}async get(e){var t;const n=await this.storageUtility.getForUser(e,"isLoggedIn",{secure:!0}),i=await this.storageUtility.getForUser(e,"webId",{secure:!0}),o=await this.storageUtility.getForUser(e,"clientId",{secure:!1}),a=await this.storageUtility.getForUser(e,"clientSecret",{secure:!1}),s=await this.storageUtility.getForUser(e,"redirectUrl",{secure:!1}),c=await this.storageUtility.getForUser(e,"refreshToken",{secure:!0}),u=await this.storageUtility.getForUser(e,"issuer",{secure:!1}),l=null!==(t=await this.storageUtility.getForUser(e,"tokenType",{secure:!1}))&&void 0!==t?t:"DPoP";if(!(0,r.isSupportedTokenType)(l))throw new Error(`Tokens of type [${l}] are not supported.`);if(void 0!==o||void 0!==n||void 0!==i||void 0!==c)return{sessionId:e,webId:i,isLoggedIn:"true"===n,redirectUrl:s,refreshToken:c,issuer:u,clientAppId:o,clientAppSecret:a,tokenType:l}}async getAll(){throw new Error("Not implemented")}async clear(e){return a(e,this.storageUtility)}async register(e){throw new Error("Not implemented")}async getRegisteredSessionIdAll(){throw new Error("Not implemented")}async clearAll(){throw new Error("Not implemented")}}},5394:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{get storage(){return window.localStorage}async get(e){return this.storage.getItem(e)||void 0}async set(e,t){this.storage.setItem(e,t)}async delete(e){this.storage.removeItem(e)}}},437:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(835);class i extends r.StorageUtility{constructor(e,t){super(e,t)}}t.default=i},3438:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"NIL",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"v1",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"v3",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"v4",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"v5",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"validate",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return c.default}});var r=p(n(206)),i=p(n(6672)),o=p(n(1129)),a=p(n(6561)),s=p(n(6163)),c=p(n(2556)),u=p(n(7231)),l=p(n(3490)),d=p(n(8027));function p(e){return e&&e.__esModule?e:{default:e}}},1246:(e,t)=>{"use strict";function n(e){return 14+(e+64>>>9<<4)+1}function r(e,t){const n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function i(e,t,n,i,o,a){return r((s=r(r(t,e),r(i,a)))<<(c=o)|s>>>32-c,n);var s,c}function o(e,t,n,r,o,a,s){return i(t&n|~t&r,e,t,o,a,s)}function a(e,t,n,r,o,a,s){return i(t&r|n&~r,e,t,o,a,s)}function s(e,t,n,r,o,a,s){return i(t^n^r,e,t,o,a,s)}function c(e,t,n,r,o,a,s){return i(n^(t|~r),e,t,o,a,s)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=function(e){if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(let n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}return function(e){const t=[],n=32*e.length,r="0123456789abcdef";for(let i=0;i<n;i+=8){const n=e[i>>5]>>>i%32&255,o=parseInt(r.charAt(n>>>4&15)+r.charAt(15&n),16);t.push(o)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[n(t)-1]=t;let i=1732584193,u=-271733879,l=-1732584194,d=271733878;for(let t=0;t<e.length;t+=16){const n=i,p=u,f=l,h=d;i=o(i,u,l,d,e[t],7,-680876936),d=o(d,i,u,l,e[t+1],12,-389564586),l=o(l,d,i,u,e[t+2],17,606105819),u=o(u,l,d,i,e[t+3],22,-1044525330),i=o(i,u,l,d,e[t+4],7,-176418897),d=o(d,i,u,l,e[t+5],12,1200080426),l=o(l,d,i,u,e[t+6],17,-1473231341),u=o(u,l,d,i,e[t+7],22,-45705983),i=o(i,u,l,d,e[t+8],7,1770035416),d=o(d,i,u,l,e[t+9],12,-1958414417),l=o(l,d,i,u,e[t+10],17,-42063),u=o(u,l,d,i,e[t+11],22,-1990404162),i=o(i,u,l,d,e[t+12],7,1804603682),d=o(d,i,u,l,e[t+13],12,-40341101),l=o(l,d,i,u,e[t+14],17,-1502002290),u=o(u,l,d,i,e[t+15],22,1236535329),i=a(i,u,l,d,e[t+1],5,-165796510),d=a(d,i,u,l,e[t+6],9,-1069501632),l=a(l,d,i,u,e[t+11],14,643717713),u=a(u,l,d,i,e[t],20,-373897302),i=a(i,u,l,d,e[t+5],5,-701558691),d=a(d,i,u,l,e[t+10],9,38016083),l=a(l,d,i,u,e[t+15],14,-660478335),u=a(u,l,d,i,e[t+4],20,-405537848),i=a(i,u,l,d,e[t+9],5,568446438),d=a(d,i,u,l,e[t+14],9,-1019803690),l=a(l,d,i,u,e[t+3],14,-187363961),u=a(u,l,d,i,e[t+8],20,1163531501),i=a(i,u,l,d,e[t+13],5,-1444681467),d=a(d,i,u,l,e[t+2],9,-51403784),l=a(l,d,i,u,e[t+7],14,1735328473),u=a(u,l,d,i,e[t+12],20,-1926607734),i=s(i,u,l,d,e[t+5],4,-378558),d=s(d,i,u,l,e[t+8],11,-2022574463),l=s(l,d,i,u,e[t+11],16,1839030562),u=s(u,l,d,i,e[t+14],23,-35309556),i=s(i,u,l,d,e[t+1],4,-1530992060),d=s(d,i,u,l,e[t+4],11,1272893353),l=s(l,d,i,u,e[t+7],16,-155497632),u=s(u,l,d,i,e[t+10],23,-1094730640),i=s(i,u,l,d,e[t+13],4,681279174),d=s(d,i,u,l,e[t],11,-358537222),l=s(l,d,i,u,e[t+3],16,-722521979),u=s(u,l,d,i,e[t+6],23,76029189),i=s(i,u,l,d,e[t+9],4,-640364487),d=s(d,i,u,l,e[t+12],11,-421815835),l=s(l,d,i,u,e[t+15],16,530742520),u=s(u,l,d,i,e[t+2],23,-995338651),i=c(i,u,l,d,e[t],6,-198630844),d=c(d,i,u,l,e[t+7],10,1126891415),l=c(l,d,i,u,e[t+14],15,-1416354905),u=c(u,l,d,i,e[t+5],21,-57434055),i=c(i,u,l,d,e[t+12],6,1700485571),d=c(d,i,u,l,e[t+3],10,-1894986606),l=c(l,d,i,u,e[t+10],15,-1051523),u=c(u,l,d,i,e[t+1],21,-2054922799),i=c(i,u,l,d,e[t+8],6,1873313359),d=c(d,i,u,l,e[t+15],10,-30611744),l=c(l,d,i,u,e[t+6],15,-1560198380),u=c(u,l,d,i,e[t+13],21,1309151649),i=c(i,u,l,d,e[t+4],6,-145523070),d=c(d,i,u,l,e[t+11],10,-1120210379),l=c(l,d,i,u,e[t+2],15,718787259),u=c(u,l,d,i,e[t+9],21,-343485551),i=r(i,n),u=r(u,p),l=r(l,f),d=r(d,h)}return[i,u,l,d]}(function(e){if(0===e.length)return[];const t=8*e.length,r=new Uint32Array(n(t));for(let n=0;n<t;n+=8)r[n>>5]|=(255&e[n/8])<<n%32;return r}(e),8*e.length))}},2770:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};t.default=n},6163:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default="00000000-0000-0000-0000-000000000000"},8027:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(7231))&&r.__esModule?r:{default:r};t.default=function(e){if(!(0,i.default)(e))throw TypeError("Invalid UUID");let t;const n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n}},9094:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i},1617:(e,t)=>{"use strict";let n;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){if(!n&&(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!n))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(r)};const r=new Uint8Array(16)},9342:(e,t)=>{"use strict";function n(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:case 3:return t^n^r;case 2:return t&n^t&r^n&r}}function r(e,t){return e<<t|e>>>32-t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=function(e){const t=[1518500249,1859775393,2400959708,3395469782],i=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);const o=e.length/4+2,a=Math.ceil(o/16),s=new Array(a);for(let t=0;t<a;++t){const n=new Uint32Array(16);for(let r=0;r<16;++r)n[r]=e[64*t+4*r]<<24|e[64*t+4*r+1]<<16|e[64*t+4*r+2]<<8|e[64*t+4*r+3];s[t]=n}s[a-1][14]=8*(e.length-1)/Math.pow(2,32),s[a-1][14]=Math.floor(s[a-1][14]),s[a-1][15]=8*(e.length-1)&4294967295;for(let e=0;e<a;++e){const o=new Uint32Array(80);for(let t=0;t<16;++t)o[t]=s[e][t];for(let e=16;e<80;++e)o[e]=r(o[e-3]^o[e-8]^o[e-14]^o[e-16],1);let a=i[0],c=i[1],u=i[2],l=i[3],d=i[4];for(let e=0;e<80;++e){const i=Math.floor(e/20),s=r(a,5)+n(i,c,u,l)+d+t[i]+o[e]>>>0;d=l,l=u,u=r(c,30)>>>0,c=a,a=s}i[0]=i[0]+a>>>0,i[1]=i[1]+c>>>0,i[2]=i[2]+u>>>0,i[3]=i[3]+l>>>0,i[4]=i[4]+d>>>0}return[i[0]>>24&255,i[0]>>16&255,i[0]>>8&255,255&i[0],i[1]>>24&255,i[1]>>16&255,i[1]>>8&255,255&i[1],i[2]>>24&255,i[2]>>16&255,i[2]>>8&255,255&i[2],i[3]>>24&255,i[3]>>16&255,i[3]>>8&255,255&i[3],i[4]>>24&255,i[4]>>16&255,i[4]>>8&255,255&i[4]]}},3490:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.unsafeStringify=a;var r,i=(r=n(7231))&&r.__esModule?r:{default:r};const o=[];for(let e=0;e<256;++e)o.push((e+256).toString(16).slice(1));function a(e,t=0){return(o[e[t+0]]+o[e[t+1]]+o[e[t+2]]+o[e[t+3]]+"-"+o[e[t+4]]+o[e[t+5]]+"-"+o[e[t+6]]+o[e[t+7]]+"-"+o[e[t+8]]+o[e[t+9]]+"-"+o[e[t+10]]+o[e[t+11]]+o[e[t+12]]+o[e[t+13]]+o[e[t+14]]+o[e[t+15]]).toLowerCase()}t.default=function(e,t=0){const n=a(e,t);if(!(0,i.default)(n))throw TypeError("Stringified UUID is invalid");return n}},206:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(1617))&&r.__esModule?r:{default:r},o=n(3490);let a,s,c=0,u=0;t.default=function(e,t,n){let r=t&&n||0;const l=t||new Array(16);let d=(e=e||{}).node||a,p=void 0!==e.clockseq?e.clockseq:s;if(null==d||null==p){const t=e.random||(e.rng||i.default)();null==d&&(d=a=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==p&&(p=s=16383&(t[6]<<8|t[7]))}let f=void 0!==e.msecs?e.msecs:Date.now(),h=void 0!==e.nsecs?e.nsecs:u+1;const m=f-c+(h-u)/1e4;if(m<0&&void 0===e.clockseq&&(p=p+1&16383),(m<0||f>c)&&void 0===e.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");c=f,u=h,s=p,f+=122192928e5;const g=(1e4*(268435455&f)+h)%4294967296;l[r++]=g>>>24&255,l[r++]=g>>>16&255,l[r++]=g>>>8&255,l[r++]=255&g;const v=f/4294967296*1e4&268435455;l[r++]=v>>>8&255,l[r++]=255&v,l[r++]=v>>>24&15|16,l[r++]=v>>>16&255,l[r++]=p>>>8|128,l[r++]=255&p;for(let e=0;e<6;++e)l[r+e]=d[e];return t||(0,o.unsafeStringify)(l)}},6672:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(418)),i=o(n(1246));function o(e){return e&&e.__esModule?e:{default:e}}var a=(0,r.default)("v3",48,i.default);t.default=a},418:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.URL=t.DNS=void 0,t.default=function(e,t,n){function r(e,r,a,s){var c;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}(e)),"string"==typeof r&&(r=(0,o.default)(r)),16!==(null===(c=r)||void 0===c?void 0:c.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let u=new Uint8Array(16+e.length);if(u.set(r),u.set(e,r.length),u=n(u),u[6]=15&u[6]|t,u[8]=63&u[8]|128,a){s=s||0;for(let e=0;e<16;++e)a[s+e]=u[e];return a}return(0,i.unsafeStringify)(u)}try{r.name=e}catch(e){}return r.DNS=a,r.URL=s,r};var r,i=n(3490),o=(r=n(8027))&&r.__esModule?r:{default:r};const a="6ba7b810-9dad-11d1-80b4-00c04fd430c8";t.DNS=a;const s="6ba7b811-9dad-11d1-80b4-00c04fd430c8";t.URL=s},1129:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(2770)),i=a(n(1617)),o=n(3490);function a(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t,n){if(r.default.randomUUID&&!t&&!e)return r.default.randomUUID();const a=(e=e||{}).random||(e.rng||i.default)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=a[e];return t}return(0,o.unsafeStringify)(a)}},6561:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(418)),i=o(n(9342));function o(e){return e&&e.__esModule?e:{default:e}}var a=(0,r.default)("v5",80,i.default);t.default=a},7231:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(9094))&&r.__esModule?r:{default:r};t.default=function(e){return"string"==typeof e&&i.default.test(e)}},2556:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(7231))&&r.__esModule?r:{default:r};t.default=function(e){if(!(0,i.default)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}},835:(e,t,n)=>{"use strict";var r=n(4098),i=n(7289),o=n(5334);const a=["ES256","RS256"],s={ERROR:"error",LOGIN:"login",LOGOUT:"logout",NEW_REFRESH_TOKEN:"newRefreshToken",SESSION_EXPIRED:"sessionExpired",SESSION_EXTENDED:"sessionExtended",SESSION_RESTORED:"sessionRestore",TIMEOUT_SET:"timeoutSet"},c=["openid","offline_access","webid"].join(" ");async function u(e,t){const n=await r.fetch(e);if(200!==n.status)throw new Error(`Could not fetch JWKS for [${t}] at [${e}]: ${n.status} ${n.statusText}`);let i;try{i=(await n.json()).keys[0]}catch(n){throw new Error(`Malformed JWKS for [${t}] at [${e}]: ${n.message}`)}return i}function l(e){try{return new URL(e),!0}catch(e){return!1}}class d{constructor(e,t){this.secureStorage=e,this.insecureStorage=t}getKey(e){return`solidClientAuthenticationUser:${e}`}async getUserData(e,t){const n=await(t?this.secureStorage:this.insecureStorage).get(this.getKey(e));if(void 0===n)return{};try{return JSON.parse(n)}catch(r){throw new Error(`Data for user [${e}] in [${t?"secure":"unsecure"}] storage is corrupted - expected valid JSON, but got: ${n}`)}}async setUserData(e,t,n){await(n?this.secureStorage:this.insecureStorage).set(this.getKey(e),JSON.stringify(t))}async get(e,t){const n=await((null==t?void 0:t.secure)?this.secureStorage:this.insecureStorage).get(e);if(void 0===n&&(null==t?void 0:t.errorIfNull))throw new Error(`[${e}] is not stored`);return n}async set(e,t,n){return((null==n?void 0:n.secure)?this.secureStorage:this.insecureStorage).set(e,t)}async delete(e,t){return((null==t?void 0:t.secure)?this.secureStorage:this.insecureStorage).delete(e)}async getForUser(e,t,n){const r=await this.getUserData(e,null==n?void 0:n.secure);let i;if(r&&r[t]||(i=void 0),i=r[t],void 0===i&&(null==n?void 0:n.errorIfNull))throw new Error(`Field [${t}] for user [${e}] is not stored`);return i||void 0}async setForUser(e,t,n){let r;try{r=await this.getUserData(e,null==n?void 0:n.secure)}catch(e){r={}}await this.setUserData(e,{...r,...t},null==n?void 0:n.secure)}async deleteForUser(e,t,n){const r=await this.getUserData(e,null==n?void 0:n.secure);delete r[t],await this.setUserData(e,r,null==n?void 0:n.secure)}async deleteAllUserData(e,t){await((null==t?void 0:t.secure)?this.secureStorage:this.insecureStorage).delete(this.getKey(e))}}class p extends Error{constructor(e){super(e)}}class f extends Error{constructor(e){super(`[${e}] is not implemented`)}}class h extends Error{constructor(e){super(`Invalid response from OIDC provider: missing fields ${e}`),this.missingFields=e}}class m extends Error{constructor(e,t,n){super(e),this.error=t,this.errorDescription=n}}function g(e){const t=new URL(e);return new URL(t.pathname,t.origin).toString()}async function v(e,t,n){return new i.SignJWT({htu:g(e),htm:t.toUpperCase(),jti:o.v4()}).setProtectedHeader({alg:a[0],jwk:n.publicKey,typ:"dpop+jwt"}).setIssuedAt().sign(n.privateKey,{})}async function y(e,t,n,i,o){return e(n,await async function(e,t,n,i){if(void 0!==n)return async function(e,t,n,i){var o;const a=new r.Headers(null==i?void 0:i.headers);return a.set("Authorization",`DPoP ${t}`),a.set("DPoP",await v(e,null!==(o=null==i?void 0:i.method)&&void 0!==o?o:"get",n)),{...i,headers:a}}(e,t,n,i);const o=new r.Headers(null==i?void 0:i.headers);return o.set("Authorization",`Bearer ${t}`),{...i,headers:o}}(n.toString(),t,o,i))}const b=e=>void 0!==e?e-5>0?e-5:e:600,w="getResponse",x={get:async(e,t)=>w,set:async(e,t)=>{},delete:async e=>{},getForUser:async(e,t,n)=>w,setForUser:async(e,t,n)=>{},deleteForUser:async(e,t,n)=>{},deleteAllUserData:async(e,t)=>{}},_=e=>{const t=e;return{get:async e=>{if(void 0!==t[e])return"string"==typeof t[e]?t[e]:JSON.stringify(t[e])},set:async(e,n)=>{t[e]=n},delete:async e=>{delete t[e]}}};t.AggregateHandler=class{constructor(e){this.handleables=e}async getProperHandler(e){const t=await Promise.all(this.handleables.map((t=>t.canHandle(...e))));for(let e=0;e<t.length;e+=1)if(t[e])return this.handleables[e];return null}async canHandle(...e){return null!==await this.getProperHandler(e)}async handle(...e){const t=await this.getProperHandler(e);if(t)return t.handle(...e);throw new Error(`[${this.constructor.name}] cannot find a suitable handler for: ${e.map((e=>{try{return JSON.stringify(e)}catch(t){return e.toString()}})).join(", ")}`)}},t.ConfigurationError=p,t.DEFAULT_SCOPES=c,t.EVENTS=s,t.InMemoryStorage=class{constructor(){this.map={}}async get(e){return this.map[e]||void 0}async set(e,t){this.map[e]=t}async delete(e){delete this.map[e]}},t.InvalidResponseError=h,t.NotImplementedError=f,t.OidcProviderError=m,t.PREFERRED_SIGNING_ALG=a,t.REFRESH_BEFORE_EXPIRATION_SECONDS=5,t.SOLID_CLIENT_AUTHN_KEY_PREFIX="solidClientAuthn:",t.StorageUtility=d,t.StorageUtilityGetResponse=w,t.StorageUtilityMock=x,t.USER_SESSION_PREFIX="solidClientAuthenticationUser",t.buildAuthenticatedFetch=async function(e,t,n){var r;let i,o=t;const a=null==n?void 0:n.refreshOptions;if(void 0!==a){const e=async()=>{var t,r,c,u;try{const{accessToken:r,refreshToken:c,expiresIn:u}=await async function(e,t,n){var r;const i=await e.tokenRefresher.refresh(e.sessionId,e.refreshToken,t);return null==n||n.emit(s.SESSION_EXTENDED,null!==(r=i.expiresIn)&&void 0!==r?r:600),"string"==typeof i.refreshToken&&(null==n||n.emit(s.NEW_REFRESH_TOKEN,i.refreshToken)),{accessToken:i.accessToken,refreshToken:i.refreshToken,expiresIn:i.expiresIn}}(a,n.dpopKey,n.eventEmitter);o=r,void 0!==c&&(a.refreshToken=c),clearTimeout(i),i=setTimeout(e,1e3*b(u)),null===(t=n.eventEmitter)||void 0===t||t.emit(s.TIMEOUT_SET,i)}catch(e){e instanceof m&&(null===(r=null==n?void 0:n.eventEmitter)||void 0===r||r.emit(s.ERROR,e.error,e.errorDescription),null===(c=null==n?void 0:n.eventEmitter)||void 0===c||c.emit(s.SESSION_EXPIRED)),e instanceof h&&e.missingFields.includes("access_token")&&(null===(u=null==n?void 0:n.eventEmitter)||void 0===u||u.emit(s.SESSION_EXPIRED))}};i=setTimeout(e,1e3*b(n.expiresIn)),null===(r=n.eventEmitter)||void 0===r||r.emit(s.TIMEOUT_SET,i)}else if(void 0!==n&&void 0!==n.eventEmitter){const e=setTimeout((()=>{n.eventEmitter.emit(s.SESSION_EXPIRED)}),1e3*b(n.expiresIn));n.eventEmitter.emit(s.TIMEOUT_SET,e)}return async(t,r)=>{let i=await y(e,o,t,r,null==n?void 0:n.dpopKey);const a=!i.ok&&(s=i.status,![401,403].includes(s));var s;return i.ok||a||i.url!==t&&void 0!==(null==n?void 0:n.dpopKey)&&(i=await y(e,o,i.url,r,n.dpopKey)),i}},t.createDpopHeader=v,t.determineSigningAlg=function(e,t){var n;return null!==(n=t.find((t=>e.includes(t))))&&void 0!==n?n:null},t.fetchJwks=u,t.generateDpopKeyPair=async function(){const{privateKey:e,publicKey:t}=await i.generateKeyPair(a[0]),n={privateKey:e,publicKey:await i.exportJWK(t)};return[n.publicKey.alg]=a,n},t.getSessionIdFromOauthState=async function(e,t){return e.getForUser(t,"sessionId")},t.getWebidFromTokenPayload=async function(e,t,n,r){const o=await u(t,n);let a;try{const{payload:t}=await i.jwtVerify(e,await i.importJWK(o),{issuer:n,audience:r});a=t}catch(e){throw new Error(`Token verification failed: ${e.stack}`)}if("string"==typeof a.webid)return a.webid;if("string"!=typeof a.sub)throw new Error(`The token ${JSON.stringify(a)} is invalid: it has no 'webid' claim and no 'sub' claim.`);try{return new URL(a.sub),a.sub}catch(e){throw new Error(`The token has no 'webid' claim, and its 'sub' claim of [${a.sub}] is invalid as a URL - error [${e}].`)}},t.handleRegistration=async function(e,t,n,r){const i=function(e,t){return void 0===e.clientId||l(e.clientId)?t.scopesSupported.includes("webid")&&void 0!==e.clientId&&l(e.clientId)?"solid-oidc":"dynamic":"static"}(e,t);return"dynamic"===i?r.getClient({sessionId:e.sessionId,clientName:e.clientName,redirectUrl:e.redirectUrl},t):(await n.setForUser(e.sessionId,{clientId:e.clientId}),e.clientSecret&&await n.setForUser(e.sessionId,{clientSecret:e.clientSecret}),e.clientName&&await n.setForUser(e.sessionId,{clientName:e.clientName}),{clientId:e.clientId,clientSecret:e.clientSecret,clientName:e.clientName,clientType:i})},t.isSupportedTokenType=function(e){return"string"==typeof e&&["DPoP","Bearer"].includes(e)},t.isValidRedirectUrl=function(e){try{return""===new URL(e).hash}catch(e){return!1}},t.loadOidcContextFromStorage=async function(e,t,n){try{const[r,i,o,a]=await Promise.all([t.getForUser(e,"issuer",{errorIfNull:!0}),t.getForUser(e,"codeVerifier"),t.getForUser(e,"redirectUrl"),t.getForUser(e,"dpop",{errorIfNull:!0})]);return await t.deleteForUser(e,"codeVerifier"),{codeVerifier:i,redirectUrl:o,issuerConfig:await n.fetchConfig(r),dpop:"true"===a}}catch(t){throw new Error(`Failed to retrieve OIDC context from storage associated with session [${e}]: ${t}`)}},t.mockStorage=_,t.mockStorageUtility=(e,t=!1)=>t?new d(_(e),_({})):new d(_({}),_(e)),t.saveSessionInfoToStorage=async function(e,t,n,r,o,a,s){void 0!==o&&await e.setForUser(t,{refreshToken:o},{secure:a}),void 0!==n&&await e.setForUser(t,{webId:n},{secure:a}),void 0!==r&&await e.setForUser(t,{isLoggedIn:r},{secure:a}),void 0!==s&&await e.setForUser(t,{publicKey:JSON.stringify(s.publicKey),privateKey:JSON.stringify(await i.exportJWK(s.privateKey))},{secure:a})}},5334:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"NIL",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"v1",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"v3",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"v4",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"v5",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"validate",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return c.default}});var r=p(n(6024)),i=p(n(3167)),o=p(n(134)),a=p(n(689)),s=p(n(4277)),c=p(n(3136)),u=p(n(5377)),l=p(n(9028)),d=p(n(3480));function p(e){return e&&e.__esModule?e:{default:e}}},1814:(e,t)=>{"use strict";function n(e){return 14+(e+64>>>9<<4)+1}function r(e,t){const n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function i(e,t,n,i,o,a){return r((s=r(r(t,e),r(i,a)))<<(c=o)|s>>>32-c,n);var s,c}function o(e,t,n,r,o,a,s){return i(t&n|~t&r,e,t,o,a,s)}function a(e,t,n,r,o,a,s){return i(t&r|n&~r,e,t,o,a,s)}function s(e,t,n,r,o,a,s){return i(t^n^r,e,t,o,a,s)}function c(e,t,n,r,o,a,s){return i(n^(t|~r),e,t,o,a,s)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=function(e){if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(let n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}return function(e){const t=[],n=32*e.length,r="0123456789abcdef";for(let i=0;i<n;i+=8){const n=e[i>>5]>>>i%32&255,o=parseInt(r.charAt(n>>>4&15)+r.charAt(15&n),16);t.push(o)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[n(t)-1]=t;let i=1732584193,u=-271733879,l=-1732584194,d=271733878;for(let t=0;t<e.length;t+=16){const n=i,p=u,f=l,h=d;i=o(i,u,l,d,e[t],7,-680876936),d=o(d,i,u,l,e[t+1],12,-389564586),l=o(l,d,i,u,e[t+2],17,606105819),u=o(u,l,d,i,e[t+3],22,-1044525330),i=o(i,u,l,d,e[t+4],7,-176418897),d=o(d,i,u,l,e[t+5],12,1200080426),l=o(l,d,i,u,e[t+6],17,-1473231341),u=o(u,l,d,i,e[t+7],22,-45705983),i=o(i,u,l,d,e[t+8],7,1770035416),d=o(d,i,u,l,e[t+9],12,-1958414417),l=o(l,d,i,u,e[t+10],17,-42063),u=o(u,l,d,i,e[t+11],22,-1990404162),i=o(i,u,l,d,e[t+12],7,1804603682),d=o(d,i,u,l,e[t+13],12,-40341101),l=o(l,d,i,u,e[t+14],17,-1502002290),u=o(u,l,d,i,e[t+15],22,1236535329),i=a(i,u,l,d,e[t+1],5,-165796510),d=a(d,i,u,l,e[t+6],9,-1069501632),l=a(l,d,i,u,e[t+11],14,643717713),u=a(u,l,d,i,e[t],20,-373897302),i=a(i,u,l,d,e[t+5],5,-701558691),d=a(d,i,u,l,e[t+10],9,38016083),l=a(l,d,i,u,e[t+15],14,-660478335),u=a(u,l,d,i,e[t+4],20,-405537848),i=a(i,u,l,d,e[t+9],5,568446438),d=a(d,i,u,l,e[t+14],9,-1019803690),l=a(l,d,i,u,e[t+3],14,-187363961),u=a(u,l,d,i,e[t+8],20,1163531501),i=a(i,u,l,d,e[t+13],5,-1444681467),d=a(d,i,u,l,e[t+2],9,-51403784),l=a(l,d,i,u,e[t+7],14,1735328473),u=a(u,l,d,i,e[t+12],20,-1926607734),i=s(i,u,l,d,e[t+5],4,-378558),d=s(d,i,u,l,e[t+8],11,-2022574463),l=s(l,d,i,u,e[t+11],16,1839030562),u=s(u,l,d,i,e[t+14],23,-35309556),i=s(i,u,l,d,e[t+1],4,-1530992060),d=s(d,i,u,l,e[t+4],11,1272893353),l=s(l,d,i,u,e[t+7],16,-155497632),u=s(u,l,d,i,e[t+10],23,-1094730640),i=s(i,u,l,d,e[t+13],4,681279174),d=s(d,i,u,l,e[t],11,-358537222),l=s(l,d,i,u,e[t+3],16,-722521979),u=s(u,l,d,i,e[t+6],23,76029189),i=s(i,u,l,d,e[t+9],4,-640364487),d=s(d,i,u,l,e[t+12],11,-421815835),l=s(l,d,i,u,e[t+15],16,530742520),u=s(u,l,d,i,e[t+2],23,-995338651),i=c(i,u,l,d,e[t],6,-198630844),d=c(d,i,u,l,e[t+7],10,1126891415),l=c(l,d,i,u,e[t+14],15,-1416354905),u=c(u,l,d,i,e[t+5],21,-57434055),i=c(i,u,l,d,e[t+12],6,1700485571),d=c(d,i,u,l,e[t+3],10,-1894986606),l=c(l,d,i,u,e[t+10],15,-1051523),u=c(u,l,d,i,e[t+1],21,-2054922799),i=c(i,u,l,d,e[t+8],6,1873313359),d=c(d,i,u,l,e[t+15],10,-30611744),l=c(l,d,i,u,e[t+6],15,-1560198380),u=c(u,l,d,i,e[t+13],21,1309151649),i=c(i,u,l,d,e[t+4],6,-145523070),d=c(d,i,u,l,e[t+11],10,-1120210379),l=c(l,d,i,u,e[t+2],15,718787259),u=c(u,l,d,i,e[t+9],21,-343485551),i=r(i,n),u=r(u,p),l=r(l,f),d=r(d,h)}return[i,u,l,d]}(function(e){if(0===e.length)return[];const t=8*e.length,r=new Uint32Array(n(t));for(let n=0;n<t;n+=8)r[n>>5]|=(255&e[n/8])<<n%32;return r}(e),8*e.length))}},178:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};t.default=n},4277:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default="00000000-0000-0000-0000-000000000000"},3480:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(5377))&&r.__esModule?r:{default:r};t.default=function(e){if(!(0,i.default)(e))throw TypeError("Invalid UUID");let t;const n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n}},8399:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i},7353:(e,t)=>{"use strict";let n;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){if(!n&&(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!n))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(r)};const r=new Uint8Array(16)},4399:(e,t)=>{"use strict";function n(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:case 3:return t^n^r;case 2:return t&n^t&r^n&r}}function r(e,t){return e<<t|e>>>32-t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=function(e){const t=[1518500249,1859775393,2400959708,3395469782],i=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);const o=e.length/4+2,a=Math.ceil(o/16),s=new Array(a);for(let t=0;t<a;++t){const n=new Uint32Array(16);for(let r=0;r<16;++r)n[r]=e[64*t+4*r]<<24|e[64*t+4*r+1]<<16|e[64*t+4*r+2]<<8|e[64*t+4*r+3];s[t]=n}s[a-1][14]=8*(e.length-1)/Math.pow(2,32),s[a-1][14]=Math.floor(s[a-1][14]),s[a-1][15]=8*(e.length-1)&4294967295;for(let e=0;e<a;++e){const o=new Uint32Array(80);for(let t=0;t<16;++t)o[t]=s[e][t];for(let e=16;e<80;++e)o[e]=r(o[e-3]^o[e-8]^o[e-14]^o[e-16],1);let a=i[0],c=i[1],u=i[2],l=i[3],d=i[4];for(let e=0;e<80;++e){const i=Math.floor(e/20),s=r(a,5)+n(i,c,u,l)+d+t[i]+o[e]>>>0;d=l,l=u,u=r(c,30)>>>0,c=a,a=s}i[0]=i[0]+a>>>0,i[1]=i[1]+c>>>0,i[2]=i[2]+u>>>0,i[3]=i[3]+l>>>0,i[4]=i[4]+d>>>0}return[i[0]>>24&255,i[0]>>16&255,i[0]>>8&255,255&i[0],i[1]>>24&255,i[1]>>16&255,i[1]>>8&255,255&i[1],i[2]>>24&255,i[2]>>16&255,i[2]>>8&255,255&i[2],i[3]>>24&255,i[3]>>16&255,i[3]>>8&255,255&i[3],i[4]>>24&255,i[4]>>16&255,i[4]>>8&255,255&i[4]]}},9028:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.unsafeStringify=a;var r,i=(r=n(5377))&&r.__esModule?r:{default:r};const o=[];for(let e=0;e<256;++e)o.push((e+256).toString(16).slice(1));function a(e,t=0){return(o[e[t+0]]+o[e[t+1]]+o[e[t+2]]+o[e[t+3]]+"-"+o[e[t+4]]+o[e[t+5]]+"-"+o[e[t+6]]+o[e[t+7]]+"-"+o[e[t+8]]+o[e[t+9]]+"-"+o[e[t+10]]+o[e[t+11]]+o[e[t+12]]+o[e[t+13]]+o[e[t+14]]+o[e[t+15]]).toLowerCase()}t.default=function(e,t=0){const n=a(e,t);if(!(0,i.default)(n))throw TypeError("Stringified UUID is invalid");return n}},6024:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(7353))&&r.__esModule?r:{default:r},o=n(9028);let a,s,c=0,u=0;t.default=function(e,t,n){let r=t&&n||0;const l=t||new Array(16);let d=(e=e||{}).node||a,p=void 0!==e.clockseq?e.clockseq:s;if(null==d||null==p){const t=e.random||(e.rng||i.default)();null==d&&(d=a=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==p&&(p=s=16383&(t[6]<<8|t[7]))}let f=void 0!==e.msecs?e.msecs:Date.now(),h=void 0!==e.nsecs?e.nsecs:u+1;const m=f-c+(h-u)/1e4;if(m<0&&void 0===e.clockseq&&(p=p+1&16383),(m<0||f>c)&&void 0===e.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");c=f,u=h,s=p,f+=122192928e5;const g=(1e4*(268435455&f)+h)%4294967296;l[r++]=g>>>24&255,l[r++]=g>>>16&255,l[r++]=g>>>8&255,l[r++]=255&g;const v=f/4294967296*1e4&268435455;l[r++]=v>>>8&255,l[r++]=255&v,l[r++]=v>>>24&15|16,l[r++]=v>>>16&255,l[r++]=p>>>8|128,l[r++]=255&p;for(let e=0;e<6;++e)l[r+e]=d[e];return t||(0,o.unsafeStringify)(l)}},3167:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(8220)),i=o(n(1814));function o(e){return e&&e.__esModule?e:{default:e}}var a=(0,r.default)("v3",48,i.default);t.default=a},8220:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.URL=t.DNS=void 0,t.default=function(e,t,n){function r(e,r,a,s){var c;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}(e)),"string"==typeof r&&(r=(0,o.default)(r)),16!==(null===(c=r)||void 0===c?void 0:c.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let u=new Uint8Array(16+e.length);if(u.set(r),u.set(e,r.length),u=n(u),u[6]=15&u[6]|t,u[8]=63&u[8]|128,a){s=s||0;for(let e=0;e<16;++e)a[s+e]=u[e];return a}return(0,i.unsafeStringify)(u)}try{r.name=e}catch(e){}return r.DNS=a,r.URL=s,r};var r,i=n(9028),o=(r=n(3480))&&r.__esModule?r:{default:r};const a="6ba7b810-9dad-11d1-80b4-00c04fd430c8";t.DNS=a;const s="6ba7b811-9dad-11d1-80b4-00c04fd430c8";t.URL=s},134:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(178)),i=a(n(7353)),o=n(9028);function a(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t,n){if(r.default.randomUUID&&!t&&!e)return r.default.randomUUID();const a=(e=e||{}).random||(e.rng||i.default)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=a[e];return t}return(0,o.unsafeStringify)(a)}},689:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(8220)),i=o(n(4399));function o(e){return e&&e.__esModule?e:{default:e}}var a=(0,r.default)("v5",80,i.default);t.default=a},5377:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(8399))&&r.__esModule?r:{default:r};t.default=function(e){return"string"==typeof e&&i.default.test(e)}},3136:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(5377))&&r.__esModule?r:{default:r};t.default=function(e){if(!(0,i.default)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}},2167:(e,t)=>{"use strict";function n(e,t){return void 0===t&&(t=Object),t&&"function"==typeof t.freeze?t.freeze(e):e}var r=n({HTML:"text/html",isHTML:function(e){return e===r.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),i=n({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===i.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});t.assign=function(e,t){if(null===e||"object"!=typeof e)throw new TypeError("target is not an object");for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},t.find=function(e,t,n){if(void 0===n&&(n=Array.prototype),e&&"function"==typeof n.find)return n.find.call(e,t);for(var r=0;r<e.length;r++)if(Object.prototype.hasOwnProperty.call(e,r)){var i=e[r];if(t.call(void 0,i,r,e))return i}},t.freeze=n,t.MIME_TYPE=r,t.NAMESPACE=i},6129:(e,t,n)=>{var r=n(2167),i=n(1146),o=n(1045),a=n(6925),s=i.DOMImplementation,c=r.NAMESPACE,u=a.ParseError,l=a.XMLReader;function d(e){return e.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n")}function p(e){this.options=e||{locator:{}}}function f(){this.cdata=!1}function h(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function m(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function g(e,t,n){return"string"==typeof e?e.substr(t,n):e.length>=t+n||t?new java.lang.String(e,t,n)+"":e}function v(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}p.prototype.parseFromString=function(e,t){var n=this.options,r=new l,i=n.domBuilder||new f,a=n.errorHandler,s=n.locator,u=n.xmlns||{},p=/\/x?html?$/.test(t),h=p?o.HTML_ENTITIES:o.XML_ENTITIES;s&&i.setDocumentLocator(s),r.errorHandler=function(e,t,n){if(!e){if(t instanceof f)return t;e=t}var r={},i=e instanceof Function;function o(t){var o=e[t];!o&&i&&(o=2==e.length?function(n){e(t,n)}:e),r[t]=o&&function(e){o("[xmldom "+t+"]\t"+e+m(n))}||function(){}}return n=n||{},o("warning"),o("error"),o("fatalError"),r}(a,i,s),r.domBuilder=n.domBuilder||i,p&&(u[""]=c.HTML),u.xml=u.xml||c.XML;var g=n.normalizeLineEndings||d;return e&&"string"==typeof e?r.parse(g(e),u,h):r.errorHandler.error("invalid doc source"),i.doc},f.prototype={startDocument:function(){this.doc=(new s).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,n,r){var i=this.doc,o=i.createElementNS(e,n||t),a=r.length;v(this,o),this.currentElement=o,this.locator&&h(this.locator,o);for(var s=0;s<a;s++){e=r.getURI(s);var c=r.getValue(s),u=(n=r.getQName(s),i.createAttributeNS(e,n));this.locator&&h(r.getLocator(s),u),u.value=u.nodeValue=c,o.setAttributeNode(u)}},endElement:function(e,t,n){var r=this.currentElement;r.tagName,this.currentElement=r.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var n=this.doc.createProcessingInstruction(e,t);this.locator&&h(this.locator,n),v(this,n)},ignorableWhitespace:function(e,t,n){},characters:function(e,t,n){if(e=g.apply(this,arguments)){if(this.cdata)var r=this.doc.createCDATASection(e);else r=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(r):/^\s*$/.test(e)&&this.doc.appendChild(r),this.locator&&h(this.locator,r)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,n){e=g.apply(this,arguments);var r=this.doc.createComment(e);this.locator&&h(this.locator,r),v(this,r)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,n){var r=this.doc.implementation;if(r&&r.createDocumentType){var i=r.createDocumentType(e,t,n);this.locator&&h(this.locator,i),v(this,i),this.doc.doctype=i}},warning:function(e){console.warn("[xmldom warning]\t"+e,m(this.locator))},error:function(e){console.error("[xmldom error]\t"+e,m(this.locator))},fatalError:function(e){throw new u(e,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(e){f.prototype[e]=function(){return null}})),t.DOMParser=p},1146:(e,t,n)=>{var r=n(2167),i=r.find,o=r.NAMESPACE;function a(e){return""!==e}function s(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function c(e){if(!e)return[];var t=function(e){return e?e.split(/[\t\n\f\r ]+/).filter(a):[]}(e);return Object.keys(t.reduce(s,{}))}function u(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}function l(e,t){var n=e.prototype;if(!(n instanceof t)){function r(){}r.prototype=t.prototype,u(n,r=new r),e.prototype=n=r}n.constructor!=e&&("function"!=typeof e&&console.error("unknown Class:"+e),n.constructor=e)}var d={},p=d.ELEMENT_NODE=1,f=d.ATTRIBUTE_NODE=2,h=d.TEXT_NODE=3,m=d.CDATA_SECTION_NODE=4,g=d.ENTITY_REFERENCE_NODE=5,v=d.ENTITY_NODE=6,y=d.PROCESSING_INSTRUCTION_NODE=7,b=d.COMMENT_NODE=8,w=d.DOCUMENT_NODE=9,x=d.DOCUMENT_TYPE_NODE=10,_=d.DOCUMENT_FRAGMENT_NODE=11,E=d.NOTATION_NODE=12,k={},S={},C=(k.INDEX_SIZE_ERR=(S[1]="Index size error",1),k.DOMSTRING_SIZE_ERR=(S[2]="DOMString size error",2),k.HIERARCHY_REQUEST_ERR=(S[3]="Hierarchy request error",3)),A=(k.WRONG_DOCUMENT_ERR=(S[4]="Wrong document",4),k.INVALID_CHARACTER_ERR=(S[5]="Invalid character",5),k.NO_DATA_ALLOWED_ERR=(S[6]="No data allowed",6),k.NO_MODIFICATION_ALLOWED_ERR=(S[7]="No modification allowed",7),k.NOT_FOUND_ERR=(S[8]="Not found",8)),T=(k.NOT_SUPPORTED_ERR=(S[9]="Not supported",9),k.INUSE_ATTRIBUTE_ERR=(S[10]="Attribute in use",10));function O(e,t){if(t instanceof Error)var n=t;else n=this,Error.call(this,S[e]),this.message=S[e],Error.captureStackTrace&&Error.captureStackTrace(this,O);return n.code=e,t&&(this.message=this.message+": "+t),n}function P(){}function I(e,t){this._node=e,this._refresh=t,j(this)}function j(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!=t){var n=e._refresh(e._node);ye(e,"length",n.length),u(n,e),e._inc=t}}function N(){}function F(e,t){for(var n=e.length;n--;)if(e[n]===t)return n}function R(e,t,n,r){if(r?t[F(t,r)]=n:t[t.length++]=n,e){n.ownerElement=e;var i=e.ownerDocument;i&&(r&&q(i,e,r),function(e,t,n){e&&e._inc++,n.namespaceURI===o.XMLNS&&(t._nsMap[n.prefix?n.localName:""]=n.value)}(i,e,n))}}function L(e,t,n){var r=F(t,n);if(!(r>=0))throw new O(A,new Error(e.tagName+"@"+n));for(var i=t.length-1;r<i;)t[r]=t[++r];if(t.length=i,e){var o=e.ownerDocument;o&&(q(o,e,n),n.ownerElement=null)}}function D(){}function M(){}function U(e){return("<"==e?"&lt;":">"==e&&"&gt;")||"&"==e&&"&amp;"||'"'==e&&"&quot;"||"&#"+e.charCodeAt()+";"}function B(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(B(e,t))return!0}while(e=e.nextSibling)}function H(){this.ownerDocument=this}function q(e,t,n,r){e&&e._inc++,n.namespaceURI===o.XMLNS&&delete t._nsMap[n.prefix?n.localName:""]}function W(e,t,n){if(e&&e._inc){e._inc++;var r=t.childNodes;if(n)r[r.length++]=n;else{for(var i=t.firstChild,o=0;i;)r[o++]=i,i=i.nextSibling;r.length=o,delete r[r.length]}}}function K(e,t){var n=t.previousSibling,r=t.nextSibling;return n?n.nextSibling=r:e.firstChild=r,r?r.previousSibling=n:e.lastChild=n,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,W(e.ownerDocument,e),t}function V(e){return e&&e.nodeType===M.DOCUMENT_TYPE_NODE}function J(e){return e&&e.nodeType===M.ELEMENT_NODE}function z(e){return e&&e.nodeType===M.TEXT_NODE}function Z(e,t){var n=e.childNodes||[];if(i(n,J)||V(t))return!1;var r=i(n,V);return!(t&&r&&n.indexOf(r)>n.indexOf(t))}function $(e,t){var n=e.childNodes||[];if(i(n,(function(e){return J(e)&&e!==t})))return!1;var r=i(n,V);return!(t&&r&&n.indexOf(r)>n.indexOf(t))}function G(e,t,n){var r=e.childNodes||[],o=t.childNodes||[];if(t.nodeType===M.DOCUMENT_FRAGMENT_NODE){var a=o.filter(J);if(a.length>1||i(o,z))throw new O(C,"More than one element or text in fragment");if(1===a.length&&!Z(e,n))throw new O(C,"Element in fragment can not be inserted before doctype")}if(J(t)&&!Z(e,n))throw new O(C,"Only one element can be added and only after doctype");if(V(t)){if(i(r,V))throw new O(C,"Only one doctype is allowed");var s=i(r,J);if(n&&r.indexOf(s)<r.indexOf(n))throw new O(C,"Doctype can only be inserted before an element");if(!n&&s)throw new O(C,"Doctype can not be appended since element is present")}}function X(e,t,n){var r=e.childNodes||[],o=t.childNodes||[];if(t.nodeType===M.DOCUMENT_FRAGMENT_NODE){var a=o.filter(J);if(a.length>1||i(o,z))throw new O(C,"More than one element or text in fragment");if(1===a.length&&!$(e,n))throw new O(C,"Element in fragment can not be inserted before doctype")}if(J(t)&&!$(e,n))throw new O(C,"Only one element can be added and only after doctype");if(V(t)){if(i(r,(function(e){return V(e)&&e!==n})))throw new O(C,"Only one doctype is allowed");var s=i(r,J);if(n&&r.indexOf(s)<r.indexOf(n))throw new O(C,"Doctype can only be inserted before an element")}}function Q(e,t,n,r){(function(e,t,n){if(!function(e){return e&&(e.nodeType===M.DOCUMENT_NODE||e.nodeType===M.DOCUMENT_FRAGMENT_NODE||e.nodeType===M.ELEMENT_NODE)}(e))throw new O(C,"Unexpected parent node type "+e.nodeType);if(n&&n.parentNode!==e)throw new O(A,"child not in parent");if(!function(e){return e&&(J(e)||z(e)||V(e)||e.nodeType===M.DOCUMENT_FRAGMENT_NODE||e.nodeType===M.COMMENT_NODE||e.nodeType===M.PROCESSING_INSTRUCTION_NODE)}(t)||V(t)&&e.nodeType!==M.DOCUMENT_NODE)throw new O(C,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)})(e,t,n),e.nodeType===M.DOCUMENT_NODE&&(r||G)(e,t,n);var i=t.parentNode;if(i&&i.removeChild(t),t.nodeType===_){var o=t.firstChild;if(null==o)return t;var a=t.lastChild}else o=a=t;var s=n?n.previousSibling:e.lastChild;o.previousSibling=s,a.nextSibling=n,s?s.nextSibling=o:e.firstChild=o,null==n?e.lastChild=a:n.previousSibling=a;do{o.parentNode=e}while(o!==a&&(o=o.nextSibling));return W(e.ownerDocument||e,e),t.nodeType==_&&(t.firstChild=t.lastChild=null),t}function Y(){this._nsMap={}}function ee(){}function te(){}function ne(){}function re(){}function ie(){}function oe(){}function ae(){}function se(){}function ce(){}function ue(){}function le(){}function de(){}function pe(e,t){var n=[],r=9==this.nodeType&&this.documentElement||this,i=r.prefix,o=r.namespaceURI;if(o&&null==i&&null==(i=r.lookupPrefix(o)))var a=[{namespace:o,prefix:null}];return me(this,n,e,t,a),n.join("")}function fe(e,t,n){var r=e.prefix||"",i=e.namespaceURI;if(!i)return!1;if("xml"===r&&i===o.XML||i===o.XMLNS)return!1;for(var a=n.length;a--;){var s=n[a];if(s.prefix===r)return s.namespace!==i}return!0}function he(e,t,n){e.push(" ",t,'="',n.replace(/[<>&"\t\n\r]/g,U),'"')}function me(e,t,n,r,i){if(i||(i=[]),r){if(!(e=r(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case p:var a=e.attributes,s=a.length,c=e.firstChild,u=e.tagName,l=u;if(!(n=o.isHTML(e.namespaceURI)||n)&&!e.prefix&&e.namespaceURI){for(var d,v=0;v<a.length;v++)if("xmlns"===a.item(v).name){d=a.item(v).value;break}if(!d)for(var E=i.length-1;E>=0;E--)if(""===(k=i[E]).prefix&&k.namespace===e.namespaceURI){d=k.namespace;break}if(d!==e.namespaceURI)for(E=i.length-1;E>=0;E--){var k;if((k=i[E]).namespace===e.namespaceURI){k.prefix&&(l=k.prefix+":"+u);break}}}t.push("<",l);for(var S=0;S<s;S++)"xmlns"==(C=a.item(S)).prefix?i.push({prefix:C.localName,namespace:C.value}):"xmlns"==C.nodeName&&i.push({prefix:"",namespace:C.value});for(S=0;S<s;S++){var C,A,T;fe(C=a.item(S),0,i)&&(he(t,(A=C.prefix||"")?"xmlns:"+A:"xmlns",T=C.namespaceURI),i.push({prefix:A,namespace:T})),me(C,t,n,r,i)}if(u===l&&fe(e,0,i)&&(he(t,(A=e.prefix||"")?"xmlns:"+A:"xmlns",T=e.namespaceURI),i.push({prefix:A,namespace:T})),c||n&&!/^(?:meta|link|img|br|hr|input)$/i.test(u)){if(t.push(">"),n&&/^script$/i.test(u))for(;c;)c.data?t.push(c.data):me(c,t,n,r,i.slice()),c=c.nextSibling;else for(;c;)me(c,t,n,r,i.slice()),c=c.nextSibling;t.push("</",l,">")}else t.push("/>");return;case w:case _:for(c=e.firstChild;c;)me(c,t,n,r,i.slice()),c=c.nextSibling;return;case f:return he(t,e.name,e.value);case h:return t.push(e.data.replace(/[<&>]/g,U));case m:return t.push("<![CDATA[",e.data,"]]>");case b:return t.push("\x3c!--",e.data,"--\x3e");case x:var O=e.publicId,P=e.systemId;if(t.push("<!DOCTYPE ",e.name),O)t.push(" PUBLIC ",O),P&&"."!=P&&t.push(" ",P),t.push(">");else if(P&&"."!=P)t.push(" SYSTEM ",P,">");else{var I=e.internalSubset;I&&t.push(" [",I,"]"),t.push(">")}return;case y:return t.push("<?",e.target," ",e.data,"?>");case g:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function ge(e,t,n){var r;switch(t.nodeType){case p:(r=t.cloneNode(!1)).ownerDocument=e;case _:break;case f:n=!0}if(r||(r=t.cloneNode(!1)),r.ownerDocument=e,r.parentNode=null,n)for(var i=t.firstChild;i;)r.appendChild(ge(e,i,n)),i=i.nextSibling;return r}function ve(e,t,n){var r=new t.constructor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var o=t[i];"object"!=typeof o&&o!=r[i]&&(r[i]=o)}switch(t.childNodes&&(r.childNodes=new P),r.ownerDocument=e,r.nodeType){case p:var a=t.attributes,s=r.attributes=new N,c=a.length;s._ownerElement=r;for(var u=0;u<c;u++)r.setAttributeNode(ve(e,a.item(u),!0));break;case f:n=!0}if(n)for(var l=t.firstChild;l;)r.appendChild(ve(e,l,n)),l=l.nextSibling;return r}function ye(e,t,n){e[t]=n}k.INVALID_STATE_ERR=(S[11]="Invalid state",11),k.SYNTAX_ERR=(S[12]="Syntax error",12),k.INVALID_MODIFICATION_ERR=(S[13]="Invalid modification",13),k.NAMESPACE_ERR=(S[14]="Invalid namespace",14),k.INVALID_ACCESS_ERR=(S[15]="Invalid access",15),O.prototype=Error.prototype,u(k,O),P.prototype={length:0,item:function(e){return this[e]||null},toString:function(e,t){for(var n=[],r=0;r<this.length;r++)me(this[r],n,e,t);return n.join("")},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}},I.prototype.item=function(e){return j(this),this[e]},l(I,P),N.prototype={length:0,item:P.prototype.item,getNamedItem:function(e){for(var t=this.length;t--;){var n=this[t];if(n.nodeName==e)return n}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new O(T);var n=this.getNamedItem(e.nodeName);return R(this._ownerElement,this,e,n),n},setNamedItemNS:function(e){var t,n=e.ownerElement;if(n&&n!=this._ownerElement)throw new O(T);return t=this.getNamedItemNS(e.namespaceURI,e.localName),R(this._ownerElement,this,e,t),t},removeNamedItem:function(e){var t=this.getNamedItem(e);return L(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var n=this.getNamedItemNS(e,t);return L(this._ownerElement,this,n),n},getNamedItemNS:function(e,t){for(var n=this.length;n--;){var r=this[n];if(r.localName==t&&r.namespaceURI==e)return r}return null}},D.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,n){var r=new H;if(r.implementation=this,r.childNodes=new P,r.doctype=n||null,n&&r.appendChild(n),t){var i=r.createElementNS(e,t);r.appendChild(i)}return r},createDocumentType:function(e,t,n){var r=new oe;return r.name=e,r.nodeName=e,r.publicId=t||"",r.systemId=n||"",r}},M.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,t){return Q(this,e,t)},replaceChild:function(e,t){Q(this,e,t,X),t&&this.removeChild(t)},removeChild:function(e){return K(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return ve(this.ownerDocument||this,this,e)},normalize:function(){for(var e=this.firstChild;e;){var t=e.nextSibling;t&&t.nodeType==h&&e.nodeType==h?(this.removeChild(t),e.appendData(t.data)):(e.normalize(),e=t)}},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n)for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)&&n[r]===e)return r;t=t.nodeType==f?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&Object.prototype.hasOwnProperty.call(n,e))return n[e];t=t.nodeType==f?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},u(d,M),u(d,M.prototype),H.prototype={nodeName:"#document",nodeType:w,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==_){for(var n=e.firstChild;n;){var r=n.nextSibling;this.insertBefore(n,t),n=r}return e}return Q(this,e,t),e.ownerDocument=this,null===this.documentElement&&e.nodeType===p&&(this.documentElement=e),e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),K(this,e)},replaceChild:function(e,t){Q(this,e,t,X),e.ownerDocument=this,t&&this.removeChild(t),J(e)&&(this.documentElement=e)},importNode:function(e,t){return ge(this,e,t)},getElementById:function(e){var t=null;return B(this.documentElement,(function(n){if(n.nodeType==p&&n.getAttribute("id")==e)return t=n,!0})),t},getElementsByClassName:function(e){var t=c(e);return new I(this,(function(n){var r=[];return t.length>0&&B(n.documentElement,(function(i){if(i!==n&&i.nodeType===p){var o=i.getAttribute("class");if(o){var a=e===o;if(!a){var s=c(o);a=t.every((u=s,function(e){return u&&-1!==u.indexOf(e)}))}a&&r.push(i)}}var u})),r}))},createElement:function(e){var t=new Y;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new P,(t.attributes=new N)._ownerElement=t,t},createDocumentFragment:function(){var e=new ue;return e.ownerDocument=this,e.childNodes=new P,e},createTextNode:function(e){var t=new ne;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new re;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new ie;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new le;return n.ownerDocument=this,n.tagName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){var t=new ee;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new ce;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new Y,r=t.split(":"),i=n.attributes=new N;return n.childNodes=new P,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=t,i._ownerElement=n,n},createAttributeNS:function(e,t){var n=new ee,r=t.split(":");return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=t,n}},l(H,M),Y.prototype={nodeType:p,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var n=this.ownerDocument.createAttribute(e);n.value=n.nodeValue=""+t,this.setAttributeNode(n)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===_?this.insertBefore(e,null):function(e,t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=e,t.previousSibling=e.lastChild,t.nextSibling=null,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,e.lastChild=t,W(e.ownerDocument,e,t),t}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n&&n.value||""},setAttributeNS:function(e,t,n){var r=this.ownerDocument.createAttributeNS(e,t);r.value=r.nodeValue=""+n,this.setAttributeNode(r)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new I(this,(function(t){var n=[];return B(t,(function(r){r===t||r.nodeType!=p||"*"!==e&&r.tagName!=e||n.push(r)})),n}))},getElementsByTagNameNS:function(e,t){return new I(this,(function(n){var r=[];return B(n,(function(i){i===n||i.nodeType!==p||"*"!==e&&i.namespaceURI!==e||"*"!==t&&i.localName!=t||r.push(i)})),r}))}},H.prototype.getElementsByTagName=Y.prototype.getElementsByTagName,H.prototype.getElementsByTagNameNS=Y.prototype.getElementsByTagNameNS,l(Y,M),ee.prototype.nodeType=f,l(ee,M),te.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(S[C])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,n){n=this.data.substring(0,e)+n+this.data.substring(e+t),this.nodeValue=this.data=n,this.length=n.length}},l(te,M),ne.prototype={nodeName:"#text",nodeType:h,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var r=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}},l(ne,te),re.prototype={nodeName:"#comment",nodeType:b},l(re,te),ie.prototype={nodeName:"#cdata-section",nodeType:m},l(ie,te),oe.prototype.nodeType=x,l(oe,M),ae.prototype.nodeType=E,l(ae,M),se.prototype.nodeType=v,l(se,M),ce.prototype.nodeType=g,l(ce,M),ue.prototype.nodeName="#document-fragment",ue.prototype.nodeType=_,l(ue,M),le.prototype.nodeType=y,l(le,M),de.prototype.serializeToString=function(e,t,n){return pe.call(e,t,n)},M.prototype.toString=pe;try{if(Object.defineProperty){function be(e){switch(e.nodeType){case p:case _:var t=[];for(e=e.firstChild;e;)7!==e.nodeType&&8!==e.nodeType&&t.push(be(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}}Object.defineProperty(I.prototype,"length",{get:function(){return j(this),this.$$length}}),Object.defineProperty(M.prototype,"textContent",{get:function(){return be(this)},set:function(e){switch(this.nodeType){case p:case _:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),ye=function(e,t,n){e["$$"+t]=n}}}catch(we){}t.DocumentType=oe,t.DOMException=O,t.DOMImplementation=D,t.Element=Y,t.Node=M,t.NodeList=P,t.XMLSerializer=de},1045:(e,t,n)=>{var r=n(2167).freeze;t.XML_ENTITIES=r({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),t.HTML_ENTITIES=r({lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",times:"×",divide:"÷",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",euro:"€",trade:"™",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}),t.entityMap=t.HTML_ENTITIES},3969:(e,t,n)=>{var r=n(1146);r.DOMImplementation,r.XMLSerializer,t.DOMParser=n(6129).DOMParser},6925:(e,t,n)=>{var r=n(2167).NAMESPACE,i=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,o=new RegExp("[\\-\\.0-9"+i.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),a=new RegExp("^"+i.source+o.source+"*(?::"+i.source+o.source+"*)?$");function s(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,s)}function c(){}function u(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function l(e,t,n,i,o,a){function s(e,t,r){n.attributeNames.hasOwnProperty(e)&&a.fatalError("Attribute "+e+" redefined"),n.addValue(e,t.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,o),r)}for(var c,u=++t,l=0;;){var d=e.charAt(u);switch(d){case"=":if(1===l)c=e.slice(t,u),l=3;else{if(2!==l)throw new Error("attribute equal must after attrName");l=3}break;case"'":case'"':if(3===l||1===l){if(1===l&&(a.warning('attribute value must after "="'),c=e.slice(t,u)),t=u+1,!((u=e.indexOf(d,t))>0))throw new Error("attribute value no end '"+d+"' match");s(c,p=e.slice(t,u),t-1),l=5}else{if(4!=l)throw new Error('attribute value must after "="');s(c,p=e.slice(t,u),t),a.warning('attribute "'+c+'" missed start quot('+d+")!!"),t=u+1,l=5}break;case"/":switch(l){case 0:n.setTagName(e.slice(t,u));case 5:case 6:case 7:l=7,n.closed=!0;case 4:case 1:case 2:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return a.error("unexpected end of input"),0==l&&n.setTagName(e.slice(t,u)),u;case">":switch(l){case 0:n.setTagName(e.slice(t,u));case 5:case 6:case 7:break;case 4:case 1:"/"===(p=e.slice(t,u)).slice(-1)&&(n.closed=!0,p=p.slice(0,-1));case 2:2===l&&(p=c),4==l?(a.warning('attribute "'+p+'" missed quot(")!'),s(c,p,t)):(r.isHTML(i[""])&&p.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+p+'" missed value!! "'+p+'" instead!!'),s(p,p,t));break;case 3:throw new Error("attribute value missed!!")}return u;case"€":d=" ";default:if(d<=" ")switch(l){case 0:n.setTagName(e.slice(t,u)),l=6;break;case 1:c=e.slice(t,u),l=2;break;case 4:var p=e.slice(t,u);a.warning('attribute "'+p+'" missed quot(")!!'),s(c,p,t);case 5:l=6}else switch(l){case 2:n.tagName,r.isHTML(i[""])&&c.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+c+'" missed value!! "'+c+'" instead2!!'),s(c,c,t),t=u,l=1;break;case 5:a.warning('attribute space is required"'+c+'"!!');case 6:l=1,t=u;break;case 3:l=4,t=u;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}u++}}function d(e,t,n){for(var i=e.tagName,o=null,a=e.length;a--;){var s=e[a],c=s.qName,u=s.value;if((f=c.indexOf(":"))>0)var l=s.prefix=c.slice(0,f),d=c.slice(f+1),p="xmlns"===l&&d;else d=c,l=null,p="xmlns"===c&&"";s.localName=d,!1!==p&&(null==o&&(o={},h(n,n={})),n[p]=o[p]=u,s.uri=r.XMLNS,t.startPrefixMapping(p,u))}for(a=e.length;a--;)(l=(s=e[a]).prefix)&&("xml"===l&&(s.uri=r.XML),"xmlns"!==l&&(s.uri=n[l||""]));var f;(f=i.indexOf(":"))>0?(l=e.prefix=i.slice(0,f),d=e.localName=i.slice(f+1)):(l=null,d=e.localName=i);var m=e.uri=n[l||""];if(t.startElement(m,d,i,e),!e.closed)return e.currentNSMap=n,e.localNSMap=o,!0;if(t.endElement(m,d,i),o)for(l in o)Object.prototype.hasOwnProperty.call(o,l)&&t.endPrefixMapping(l)}function p(e,t,n,r,i){if(/^(?:script|textarea)$/i.test(n)){var o=e.indexOf("</"+n+">",t),a=e.substring(t+1,o);if(/[&<]/.test(a))return/^script$/i.test(n)?(i.characters(a,0,a.length),o):(a=a.replace(/&#?\w+;/g,r),i.characters(a,0,a.length),o)}return t+1}function f(e,t,n,r){var i=r[n];return null==i&&((i=e.lastIndexOf("</"+n+">"))<t&&(i=e.lastIndexOf("</"+n)),r[n]=i),i<t}function h(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}function m(e,t,n,r){if("-"===e.charAt(t+2))return"-"===e.charAt(t+3)?(i=e.indexOf("--\x3e",t+4))>t?(n.comment(e,t+4,i-t-4),i+3):(r.error("Unclosed comment"),-1):-1;if("CDATA["==e.substr(t+3,6)){var i=e.indexOf("]]>",t+9);return n.startCDATA(),n.characters(e,t+9,i-t-9),n.endCDATA(),i+3}var o=function(e,t){var n,r=[],i=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(i.lastIndex=t,i.exec(e);n=i.exec(e);)if(r.push(n),n[1])return r}(e,t),a=o.length;if(a>1&&/!doctype/i.test(o[0][0])){var s=o[1][0],c=!1,u=!1;a>3&&(/^public$/i.test(o[2][0])?(c=o[3][0],u=a>4&&o[4][0]):/^system$/i.test(o[2][0])&&(u=o[3][0]));var l=o[a-1];return n.startDTD(s,c,u),n.endDTD(),l.index+l[0].length}return-1}function g(e,t,n){var r=e.indexOf("?>",t);if(r){var i=e.substring(t,r).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return i?(i[0].length,n.processingInstruction(i[1],i[2]),r+2):-1}return-1}function v(){this.attributeNames={}}s.prototype=new Error,s.prototype.name=s.name,c.prototype={parse:function(e,t,n){var i=this.domBuilder;i.startDocument(),h(t,t={}),function(e,t,n,i,o){function a(e){var t=e.slice(1,-1);return Object.hasOwnProperty.call(n,t)?n[t]:"#"===t.charAt(0)?function(e){if(e>65535){var t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}(parseInt(t.substr(1).replace("x","0x"))):(o.error("entity not found:"+e),e)}function c(t){if(t>k){var n=e.substring(k,t).replace(/&#?\w+;/g,a);x&&h(k),i.characters(n,0,t-k),k=t}}function h(t,n){for(;t>=b&&(n=w.exec(e));)y=n.index,b=y+n[0].length,x.lineNumber++;x.columnNumber=t-y+1}for(var y=0,b=0,w=/.*(?:\r\n?|\n)|.*$/g,x=i.locator,_=[{currentNSMap:t}],E={},k=0;;){try{var S=e.indexOf("<",k);if(S<0){if(!e.substr(k).match(/^\s*$/)){var C=i.doc,A=C.createTextNode(e.substr(k));C.appendChild(A),i.currentElement=A}return}switch(S>k&&c(S),e.charAt(S+1)){case"/":var T=e.indexOf(">",S+3),O=e.substring(S+2,T).replace(/[ \t\n\r]+$/g,""),P=_.pop();T<0?(O=e.substring(S+2).replace(/[\s<].*/,""),o.error("end tag name: "+O+" is not complete:"+P.tagName),T=S+1+O.length):O.match(/\s</)&&(O=O.replace(/[\s<].*/,""),o.error("end tag name: "+O+" maybe not complete"),T=S+1+O.length);var I=P.localNSMap,j=P.tagName==O;if(j||P.tagName&&P.tagName.toLowerCase()==O.toLowerCase()){if(i.endElement(P.uri,P.localName,O),I)for(var N in I)Object.prototype.hasOwnProperty.call(I,N)&&i.endPrefixMapping(N);j||o.fatalError("end tag name: "+O+" is not match the current start tagName:"+P.tagName)}else _.push(P);T++;break;case"?":x&&h(S),T=g(e,S,i);break;case"!":x&&h(S),T=m(e,S,i,o);break;default:x&&h(S);var F=new v,R=_[_.length-1].currentNSMap,L=(T=l(e,S,F,R,a,o),F.length);if(!F.closed&&f(e,T,F.tagName,E)&&(F.closed=!0,n.nbsp||o.warning("unclosed xml attribute")),x&&L){for(var D=u(x,{}),M=0;M<L;M++){var U=F[M];h(U.offset),U.locator=u(x,{})}i.locator=D,d(F,i,R)&&_.push(F),i.locator=x}else d(F,i,R)&&_.push(F);r.isHTML(F.uri)&&!F.closed?T=p(e,T,F.tagName,a,i):T++}}catch(e){if(e instanceof s)throw e;o.error("element parse error: "+e),T=-1}T>k?k=T:c(Math.max(S,k)+1)}}(e,t,n,i,this.errorHandler),i.endDocument()}},v.prototype={setTagName:function(e){if(!a.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,n){if(!a.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:n}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},t.XMLReader=c,t.ParseError=s},5456:e=>{"use strict";e.exports=function e(t){return null===t||"object"!=typeof t||null!=t.toJSON?JSON.stringify(t):Array.isArray(t)?"["+t.reduce(((t,n,r)=>t+(0===r?"":",")+e(void 0===n||"symbol"==typeof n?null:n)),"")+"]":"{"+Object.keys(t).sort().reduce(((n,r,i)=>void 0===t[r]||"symbol"==typeof t[r]?n:n+(0===n.length?"":",")+e(r)+":"+e(t[r])),"")+"}"}},4098:function(e,t){var n="undefined"!=typeof self?self:this,r=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();!function(e){!function(t){var n="URLSearchParams"in e,r="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in e,a="ArrayBuffer"in e;if(a)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function u(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function d(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r&&(t[Symbol.iterator]=function(){return t}),t}function p(e){this.map={},e instanceof p?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function f(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function h(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function m(e){var t=new FileReader,n=h(t);return t.readAsArrayBuffer(e),n}function g(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():a&&i&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=g(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(e)||c(e))?this._bodyArrayBuffer=g(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=f(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?f(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(m)}),this.text=function(){var e,t,n,r=f(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,n=h(t=new FileReader),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}p.prototype.append=function(e,t){e=u(e),t=l(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},p.prototype.delete=function(e){delete this.map[u(e)]},p.prototype.get=function(e){return e=u(e),this.has(e)?this.map[e]:null},p.prototype.has=function(e){return this.map.hasOwnProperty(u(e))},p.prototype.set=function(e,t){this.map[u(e)]=l(t)},p.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},p.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),d(e)},p.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),d(e)},p.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),d(e)},r&&(p.prototype[Symbol.iterator]=p.prototype.entries);var y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(e,t){var n,r,i=(t=t||{}).body;if(e instanceof b){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new p(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new p(t.headers)),this.method=(r=(n=t.method||this.method||"GET").toUpperCase(),y.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function w(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function x(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new p(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},v.call(b.prototype),v.call(x.prototype),x.prototype.clone=function(){return new x(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},x.error=function(){var e=new x(null,{status:0,statusText:""});return e.type="error",e};var _=[301,302,303,307,308];x.redirect=function(e,t){if(-1===_.indexOf(t))throw new RangeError("Invalid status code");return new x(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function E(e,n){return new Promise((function(r,o){var a=new b(e,n);if(a.signal&&a.signal.aborted)return o(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function c(){s.abort()}s.onload=function(){var e,t,n={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new p,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}})),t)};n.url="responseURL"in s?s.responseURL:n.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;r(new x(i,n))},s.onerror=function(){o(new TypeError("Network request failed"))},s.ontimeout=function(){o(new TypeError("Network request failed"))},s.onabort=function(){o(new t.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&i&&(s.responseType="blob"),a.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),a.signal&&(a.signal.addEventListener("abort",c),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",c)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}E.polyfill=!0,e.fetch||(e.fetch=E,e.Headers=p,e.Request=b,e.Response=x),t.Headers=p,t.Request=b,t.Response=x,t.fetch=E,Object.defineProperty(t,"__esModule",{value:!0})}({})}(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},5573:e=>{"use strict";var t=/["'&<>]/;e.exports=function(e){var n,r=""+e,i=t.exec(r);if(!i)return r;var o="",a=0,s=0;for(a=i.index;a<r.length;a++){switch(r.charCodeAt(a)){case 34:n="&quot;";break;case 38:n="&amp;";break;case 39:n="&#39;";break;case 60:n="&lt;";break;case 62:n="&gt;";break;default:continue}s!==a&&(o+=r.substring(s,a)),s=a+1,o+=n}return s!==a?o+r.substring(s,a):o}},7187:e=>{"use strict";var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,o),r(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}m(e,t,o,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&m(e,"error",t,{once:!0})}(e,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function u(e,t,n,r){var i,o,a,u;if(s(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),a=o[t]),void 0===a)a=o[t]=n,++e._eventsCount;else if("function"==typeof a?a=o[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(i=c(e))>0&&a.length>i&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=a.length,u=l,console&&console.warn&&console.warn(u)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=l.bind(r);return i.listener=n,r.wrapFn=i,i}function p(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):h(i,i.length)}function f(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function h(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function m(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){r.once&&e.removeEventListener(t,i),n(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return c(this)},o.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)r(c,this,t);else{var u=c.length,l=h(c,u);for(n=0;n<u;++n)r(l[n],this,t)}return!0},o.prototype.addListener=function(e,t){return u(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return u(this,e,t,!0)},o.prototype.once=function(e,t){return s(t),this.on(e,d(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,d(this,e,t)),this},o.prototype.removeListener=function(e,t){var n,r,i,o,a;if(s(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return p(this,e,!0)},o.prototype.rawListeners=function(e){return p(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},3827:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};const i="object"===("undefined"==typeof window?"undefined":r(window))&&"object"===("undefined"==typeof document?"undefined":r(document))&&9===document.nodeType},8058:(e,t,n)=>{"use strict";const{isArray:r,isObject:i,isString:o}=n(832),{asArray:a}=n(1055),{prependBase:s}=n(2278),c=n(4093),u=n(6767);function l(e){throw new c("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:e})}function d({context:e,base:t}){if(!e)return;const n=e["@context"];if(o(n))e["@context"]=s(t,n);else if(r(n))for(let e=0;e<n.length;++e){const r=n[e];o(r)?n[e]=s(t,r):i(r)&&d({context:{"@context":r},base:t})}else if(i(n))for(const e in n)d({context:n[e],base:t})}e.exports=class{constructor({sharedCache:e}){this.perOpCache=new Map,this.sharedCache=e}async resolve({activeCtx:e,context:t,documentLoader:n,base:s,cycles:c=new Set}){t&&i(t)&&t["@context"]&&(t=t["@context"]),t=a(t);const d=[];for(const a of t){if(o(a)){let t=this._get(a);t||(t=await this._resolveRemoteContext({activeCtx:e,url:a,documentLoader:n,base:s,cycles:c})),r(t)?d.push(...t):d.push(t);continue}if(null===a){d.push(new u({document:null}));continue}i(a)||l(t);const p=JSON.stringify(a);let f=this._get(p);f||(f=new u({document:a}),this._cacheResolvedContext({key:p,resolved:f,tag:"static"})),d.push(f)}return d}_get(e){let t=this.perOpCache.get(e);if(!t){const n=this.sharedCache.get(e);n&&(t=n.get("static"),t&&this.perOpCache.set(e,t))}return t}_cacheResolvedContext({key:e,resolved:t,tag:n}){if(this.perOpCache.set(e,t),void 0!==n){let r=this.sharedCache.get(e);r||(r=new Map,this.sharedCache.set(e,r)),r.set(n,t)}return t}async _resolveRemoteContext({activeCtx:e,url:t,documentLoader:n,base:r,cycles:i}){t=s(r,t);const{context:o,remoteDoc:a}=await this._fetchContext({activeCtx:e,url:t,documentLoader:n,cycles:i});d({context:o,base:r=a.documentUrl||t});const c=await this.resolve({activeCtx:e,context:o,documentLoader:n,base:r,cycles:i});return this._cacheResolvedContext({key:t,resolved:c,tag:a.tag}),c}async _fetchContext({activeCtx:e,url:t,documentLoader:n,cycles:a}){if(a.size>10)throw new c("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"loading remote context failed":"context overflow",max:10});if(a.has(t))throw new c("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"recursive context inclusion":"context overflow",url:t});let s,u;a.add(t);try{u=await n(t),s=u.document||null,o(s)&&(s=JSON.parse(s))}catch(e){throw new c("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:t,cause:e})}if(!i(s))throw new c("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:t});return s="@context"in s?{"@context":s["@context"]}:{"@context":{}},u.contextUrl&&(r(s["@context"])||(s["@context"]=[s["@context"]]),s["@context"].push(u.contextUrl)),{context:s,remoteDoc:u}}}},4093:e=>{"use strict";e.exports=class extends Error{constructor(e="An unspecified JSON-LD error occurred.",t="jsonld.Error",n={}){super(e),this.name=t,this.message=e,this.details=n}}},731:e=>{"use strict";e.exports=e=>{class t{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(t,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(t.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:t}),t.compact=function(t,n){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):e.compact(t,n)},t.expand=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):e.expand(t)},t.flatten=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):e.flatten(t)},t}},9048:(e,t,n)=>{"use strict";e.exports=n(7055).NQuads},533:e=>{"use strict";e.exports=class{constructor(){this._requests={}}wrapLoader(e){const t=this;return t._loader=e,function(){return t.add.apply(t,arguments)}}async add(e){let t=this._requests[e];if(t)return Promise.resolve(t);t=this._requests[e]=this._loader(e);try{return await t}finally{delete this._requests[e]}}}},6767:(e,t,n)=>{"use strict";const r=n(9593);e.exports=class{constructor({document:e}){this.document=e,this.cache=new r({max:10})}getProcessed(e){return this.cache.get(e)}setProcessed(e,t){this.cache.set(e,t)}}},3251:(e,t,n)=>{"use strict";const r=n(4093),{isArray:i,isObject:o,isString:a,isUndefined:s}=n(832),{isList:c,isValue:u,isGraph:l,isSimpleGraph:d,isSubjectReference:p}=n(8463),{expandIri:f,getContextValue:h,isKeyword:m,process:g,processingMode:v}=n(4131),{removeBase:y,prependBase:b}=n(2278),{addValue:w,asArray:x,compareShortestLeast:_}=n(1055),E={};function k(e,t,n){if("@nest"!==f(e,t,{vocab:!0},n))throw new r("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}e.exports=E,E.compact=async({activeCtx:e,activeProperty:t=null,element:n,options:f={},compactionMap:y=(()=>{})})=>{if(i(n)){let r=[];for(let i=0;i<n.length;++i){let o=await E.compact({activeCtx:e,activeProperty:t,element:n[i],options:f,compactionMap:y});null===o&&(o=await y({unmappedValue:n[i],activeCtx:e,activeProperty:t,parent:n,index:i,options:f}),void 0===o)||r.push(o)}return f.compactArrays&&1===r.length&&0===(h(e,t,"@container")||[]).length&&(r=r[0]),r}const b=h(e,t,"@context");if(s(b)||(e=await g({activeCtx:e,localCtx:b,propagate:!0,overrideProtected:!0,options:f})),o(n)){if(f.link&&"@id"in n&&f.link.hasOwnProperty(n["@id"])){const e=f.link[n["@id"]];for(let t=0;t<e.length;++t)if(e[t].expanded===n)return e[t].compacted}if(u(n)||p(n)){const r=E.compactValue({activeCtx:e,activeProperty:t,value:n,options:f});return f.link&&p(n)&&(f.link.hasOwnProperty(n["@id"])||(f.link[n["@id"]]=[]),f.link[n["@id"]].push({expanded:n,compacted:r})),r}if(c(n)&&(h(e,t,"@container")||[]).includes("@list"))return E.compact({activeCtx:e,activeProperty:t,element:n["@list"],options:f,compactionMap:y});const b="@reverse"===t,_={},S=e;u(n)||p(n)||(e=e.revertToPreviousContext());const C=h(S,t,"@context");s(C)||(e=await g({activeCtx:e,localCtx:C,propagate:!0,overrideProtected:!0,options:f})),f.link&&"@id"in n&&(f.link.hasOwnProperty(n["@id"])||(f.link[n["@id"]]=[]),f.link[n["@id"]].push({expanded:n,compacted:_}));let A=n["@type"]||[];A.length>1&&(A=Array.from(A).sort());const T=e;for(const t of A){const n=E.compactIri({activeCtx:T,iri:t,relativeTo:{vocab:!0}}),r=h(S,n,"@context");s(r)||(e=await g({activeCtx:e,localCtx:r,options:f,propagate:!1}))}const O=Object.keys(n).sort();for(const s of O){const p=n[s];if("@id"!==s)if("@type"!==s)if("@reverse"!==s)if("@preserve"!==s)if("@index"!==s)if("@graph"!==s&&"@list"!==s&&"@included"!==s&&m(s)){const t=E.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});w(_,t,p)}else{if(!i(p))throw new r("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===p.length){const t=E.compactIri({activeCtx:e,iri:s,value:p,relativeTo:{vocab:!0},reverse:b}),n=e.mappings.has(t)?e.mappings.get(t)["@nest"]:null;let r=_;n&&(k(e,n,f),o(_[n])||(_[n]={}),r=_[n]),w(r,t,p,{propertyIsArray:!0})}for(const t of p){const n=E.compactIri({activeCtx:e,iri:s,value:t,relativeTo:{vocab:!0},reverse:b}),r=e.mappings.has(n)?e.mappings.get(n)["@nest"]:null;let p=_;r&&(k(e,r,f),o(_[r])||(_[r]={}),p=_[r]);const m=h(e,n,"@container")||[],g=l(t),v=c(t);let S;v?S=t["@list"]:g&&(S=t["@graph"]);let C=await E.compact({activeCtx:e,activeProperty:n,element:v||g?S:t,options:f,compactionMap:y});if(v){if(i(C)||(C=[C]),m.includes("@list")){w(p,n,C,{valueIsArray:!0,allowDuplicate:!0});continue}C={[E.compactIri({activeCtx:e,iri:"@list",relativeTo:{vocab:!0}})]:C},"@index"in t&&(C[E.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"])}if(g)if(m.includes("@graph")&&(m.includes("@id")||m.includes("@index")&&d(t))){let r;p.hasOwnProperty(n)?r=p[n]:p[n]=r={};const i=(m.includes("@id")?t["@id"]:t["@index"])||E.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}});w(r,i,C,{propertyIsArray:!f.compactArrays||m.includes("@set")})}else m.includes("@graph")&&d(t)?(i(C)&&C.length>1&&(C={"@included":C}),w(p,n,C,{propertyIsArray:!f.compactArrays||m.includes("@set")})):(i(C)&&1===C.length&&f.compactArrays&&(C=C[0]),C={[E.compactIri({activeCtx:e,iri:"@graph",relativeTo:{vocab:!0}})]:C},"@id"in t&&(C[E.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t["@id"]),"@index"in t&&(C[E.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"]),w(p,n,C,{propertyIsArray:!f.compactArrays||m.includes("@set")}));else if(m.includes("@language")||m.includes("@index")||m.includes("@id")||m.includes("@type")){let r,i;if(p.hasOwnProperty(n)?r=p[n]:p[n]=r={},m.includes("@language"))u(C)&&(C=C["@value"]),i=t["@language"];else if(m.includes("@index")){const r=h(e,n,"@index")||"@index",o=E.compactIri({activeCtx:e,iri:r,relativeTo:{vocab:!0}});if("@index"===r)i=t["@index"],delete C[o];else{let e;if([i,...e]=x(C[r]||[]),a(i))switch(e.length){case 0:delete C[r];break;case 1:C[r]=e[0];break;default:C[r]=e}else i=null}}else if(m.includes("@id")){const t=E.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}});i=C[t],delete C[t]}else if(m.includes("@type")){const r=E.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}});let o;switch([i,...o]=x(C[r]||[]),o.length){case 0:delete C[r];break;case 1:C[r]=o[0];break;default:C[r]=o}1===Object.keys(C).length&&"@id"in t&&(C=await E.compact({activeCtx:e,activeProperty:n,element:{"@id":t["@id"]},options:f,compactionMap:y}))}i||(i=E.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}})),w(r,i,C,{propertyIsArray:m.includes("@set")})}else{const e=!f.compactArrays||m.includes("@set")||m.includes("@list")||i(C)&&0===C.length||"@list"===s||"@graph"===s;w(p,n,C,{propertyIsArray:e})}}}else{if((h(e,t,"@container")||[]).includes("@index"))continue;const n=E.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});w(_,n,p)}else{const n=await E.compact({activeCtx:e,activeProperty:t,element:p,options:f,compactionMap:y});i(n)&&0===n.length||w(_,s,n)}else{const t=await E.compact({activeCtx:e,activeProperty:"@reverse",element:p,options:f,compactionMap:y});for(const n in t)if(e.mappings.has(n)&&e.mappings.get(n).reverse){const r=t[n],i=(h(e,n,"@container")||[]).includes("@set")||!f.compactArrays;w(_,n,r,{propertyIsArray:i}),delete t[n]}if(Object.keys(t).length>0){const n=E.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});w(_,n,t)}}else{let t=x(p).map((e=>E.compactIri({activeCtx:S,iri:e,relativeTo:{vocab:!0}})));1===t.length&&(t=t[0]);const n=E.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}}),r=(h(e,n,"@container")||[]).includes("@set")&&v(e,1.1)||i(t)&&0===p.length;w(_,n,t,{propertyIsArray:r})}else{let t=x(p).map((t=>E.compactIri({activeCtx:e,iri:t,relativeTo:{vocab:!1},base:f.base})));1===t.length&&(t=t[0]),_[E.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t}}return _}return n},E.compactIri=({activeCtx:e,iri:t,value:n=null,relativeTo:i={vocab:!1},reverse:a=!1,base:s=null})=>{if(null===t)return t;e.isPropertyTermScoped&&e.previousContext&&(e=e.previousContext);const d=e.getInverse();if(m(t)&&t in d&&"@none"in d[t]&&"@type"in d[t]["@none"]&&"@none"in d[t]["@none"]["@type"])return d[t]["@none"]["@type"]["@none"];if(i.vocab&&t in d){const r=e["@language"]||"@none",i=[];o(n)&&"@index"in n&&!("@graph"in n)&&i.push("@index","@index@set"),o(n)&&"@preserve"in n&&(n=n["@preserve"][0]),l(n)?("@index"in n&&i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n&&i.push("@graph@id","@graph@id@set"),i.push("@graph","@graph@set","@set"),"@index"in n||i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n||i.push("@graph@id","@graph@id@set")):o(n)&&!u(n)&&i.push("@id","@id@set","@type","@set@type");let s="@language",d="@null";if(a)s="@type",d="@reverse",i.push("@set");else if(c(n)){"@index"in n||i.push("@list");const e=n["@list"];if(0===e.length)s="@any",d="@none";else{let t=0===e.length?r:null,n=null;for(let r=0;r<e.length;++r){const i=e[r];let o="@none",a="@none";if(u(i)?"@direction"in i?o=`${(i["@language"]||"").toLowerCase()}_${i["@direction"]}`:"@language"in i?o=i["@language"].toLowerCase():"@type"in i?a=i["@type"]:o="@null":a="@id",null===t?t=o:o!==t&&u(i)&&(t="@none"),null===n?n=a:a!==n&&(n="@none"),"@none"===t&&"@none"===n)break}t=t||"@none",n=n||"@none","@none"!==n?(s="@type",d=n):d=t}}else{if(u(n))if("@language"in n&&!("@index"in n)){i.push("@language","@language@set"),d=n["@language"];const e=n["@direction"];e&&(d=`${d}_${e}`)}else"@direction"in n&&!("@index"in n)?d=`_${n["@direction"]}`:"@type"in n&&(s="@type",d=n["@type"]);else s="@type",d="@id";i.push("@set")}i.push("@none"),o(n)&&!("@index"in n)&&i.push("@index","@index@set"),u(n)&&1===Object.keys(n).length&&i.push("@language","@language@set");const p=function(e,t,n,r,i,a){null===a&&(a="@null");const s=[];if(("@id"===a||"@reverse"===a)&&o(n)&&"@id"in n){"@reverse"===a&&s.push("@reverse");const t=E.compactIri({activeCtx:e,iri:n["@id"],relativeTo:{vocab:!0}});e.mappings.has(t)&&e.mappings.get(t)&&e.mappings.get(t)["@id"]===n["@id"]?s.push.apply(s,["@vocab","@id"]):s.push.apply(s,["@id","@vocab"])}else{s.push(a);const e=s.find((e=>e.includes("_")));e&&s.push(e.replace(/^[^_]+_/,"_"))}s.push("@none");const c=e.inverse[t];for(const e of r){if(!(e in c))continue;const t=c[e][i];for(const e of s)if(e in t)return t[e]}return null}(e,t,n,i,s,d);if(null!==p)return p}if(i.vocab&&"@vocab"in e){const n=e["@vocab"];if(0===t.indexOf(n)&&t!==n){const r=t.substr(n.length);if(!e.mappings.has(r))return r}}let p=null;const f=[];let h=e.fastCurieMap;const g=t.length-1;for(let e=0;e<g&&t[e]in h;++e)h=h[t[e]],""in h&&f.push(h[""][0]);for(let r=f.length-1;r>=0;--r){const i=f[r],o=i.terms;for(const r of o){const o=r+":"+t.substr(i.iri.length);e.mappings.get(r)._prefix&&(!e.mappings.has(o)||null===n&&e.mappings.get(o)["@id"]===t)&&(null===p||_(o,p)<0)&&(p=o)}}if(null!==p)return p;for(const[n,i]of e.mappings)if(i&&i._prefix&&t.startsWith(n+":"))throw new r(`Absolute IRI "${t}" confused with prefix "${n}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:e});return i.vocab?t:"@base"in e?e["@base"]?y(b(s,e["@base"]),t):t:y(s,t)},E.compactValue=({activeCtx:e,activeProperty:t,value:n,options:r})=>{if(u(n)){const r=h(e,t,"@type"),i=h(e,t,"@language"),o=h(e,t,"@direction"),s=h(e,t,"@container")||[],c="@index"in n&&!s.includes("@index");if(!c&&"@none"!==r){if(n["@type"]===r)return n["@value"];if("@language"in n&&n["@language"]===i&&"@direction"in n&&n["@direction"]===o)return n["@value"];if("@language"in n&&n["@language"]===i)return n["@value"];if("@direction"in n&&n["@direction"]===o)return n["@value"]}const u=Object.keys(n).length,l=1===u||2===u&&"@index"in n&&!c,d="@language"in e,p=a(n["@value"]),f=e.mappings.has(t)&&null===e.mappings.get(t)["@language"];if(l&&"@none"!==r&&(!d||!p||f))return n["@value"];const m={};return c&&(m[E.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=n["@index"]),"@type"in n?m[E.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}})]=E.compactIri({activeCtx:e,iri:n["@type"],relativeTo:{vocab:!0}}):"@language"in n&&(m[E.compactIri({activeCtx:e,iri:"@language",relativeTo:{vocab:!0}})]=n["@language"]),"@direction"in n&&(m[E.compactIri({activeCtx:e,iri:"@direction",relativeTo:{vocab:!0}})]=n["@direction"]),m[E.compactIri({activeCtx:e,iri:"@value",relativeTo:{vocab:!0}})]=n["@value"],m}const i=f(e,t,{vocab:!0},r),o=h(e,t,"@type"),s=E.compactIri({activeCtx:e,iri:n["@id"],relativeTo:{vocab:"@vocab"===o},base:r.base});return"@id"===o||"@vocab"===o||"@graph"===i?s:{[E.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]:s}}},3770:e=>{"use strict";const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#",n="http://www.w3.org/2001/XMLSchema#";e.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:t,RDF_LIST:t+"List",RDF_FIRST:t+"first",RDF_REST:t+"rest",RDF_NIL:t+"nil",RDF_TYPE:t+"type",RDF_PLAIN_LITERAL:t+"PlainLiteral",RDF_XML_LITERAL:t+"XMLLiteral",RDF_JSON_LITERAL:t+"JSON",RDF_OBJECT:t+"object",RDF_LANGSTRING:t+"langString",XSD:n,XSD_BOOLEAN:n+"boolean",XSD_DOUBLE:n+"double",XSD_INTEGER:n+"integer",XSD_STRING:n+"string"}},4131:(e,t,n)=>{"use strict";const r=n(1055),i=n(4093),{isArray:o,isObject:a,isString:s,isUndefined:c}=n(832),{isAbsolute:u,isRelative:l,prependBase:d}=n(2278),{asArray:p,compareShortestLeast:f}=n(1055),h=new Map,m=/^@[a-zA-Z]+$/,g={};function v(e,t,n,r,i,o){if(null===t||!s(t)||g.isKeyword(t))return t;if(t.match(m))return null;if(r&&r.hasOwnProperty(t)&&!0!==i.get(t)&&g.createTermDefinition({activeCtx:e,localCtx:r,term:t,defined:i,options:o}),(n=n||{}).vocab){const n=e.mappings.get(t);if(null===n)return null;if(a(n)&&"@id"in n)return n["@id"]}const c=t.indexOf(":");if(c>0){const n=t.substr(0,c),a=t.substr(c+1);if("_"===n||0===a.indexOf("//"))return t;r&&r.hasOwnProperty(n)&&g.createTermDefinition({activeCtx:e,localCtx:r,term:n,defined:i,options:o});const s=e.mappings.get(n);if(s&&s._prefix)return s["@id"]+a;if(u(t))return t}if(n.vocab&&"@vocab"in e)return e["@vocab"]+t;if(n.base&&"@base"in e){if(e["@base"])return d(d(o.base,e["@base"]),t)}else if(n.base)return d(o.base,t);return t}function y(e,t){if(!e||"object"!=typeof e||!t||"object"!=typeof t)return e===t;const n=Array.isArray(e);if(n!==Array.isArray(t))return!1;if(n){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!y(e[n],t[n]))return!1;return!0}const r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(const n in e){let r=e[n],i=t[n];if("@container"===n&&Array.isArray(r)&&Array.isArray(i)&&(r=r.slice().sort(),i=i.slice().sort()),!y(r,i))return!1}return!0}e.exports=g,g.process=async({activeCtx:e,localCtx:t,options:n,propagate:c=!0,overrideProtected:f=!1,cycles:h=new Set})=>{if(a(t)&&"@context"in t&&o(t["@context"])&&(t=t["@context"]),0===p(t).length)return e;const m=await n.contextResolver.resolve({activeCtx:e,context:t,documentLoader:n.documentLoader,base:n.base});a(m[0].document)&&"boolean"==typeof m[0].document["@propagate"]&&(c=m[0].document["@propagate"]);let y=e;c||y.previousContext||(y=y.clone(),y.previousContext=e);for(const o of m){let{document:c}=o;if(e=y,null===c){if(!f&&0!==Object.keys(e.protected).length){const a=n&&n.protectedMode||"error";if("error"===a)throw new i("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});if("warn"===a){console.warn("WARNING: invalid context nullification");const t=o.getProcessed(e);if(t){y=e=t;continue}const i=e;y=e=g.getInitialContext(n).clone();for(const[t,n]of Object.entries(i.protected))n&&(e.mappings[t]=r.clone(i.mappings[t]));e.protected=r.clone(i.protected),o.setProcessed(i,y);continue}throw new i("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:t,protectedMode:a})}y=e=g.getInitialContext(n).clone();continue}const p=o.getProcessed(e);if(p){y=e=p;continue}if(a(c)&&"@context"in c&&(c=c["@context"]),!a(c))throw new i("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:c});y=y.clone();const m=new Map;if("@version"in c){if(1.1!==c["@version"])throw new i("Unsupported JSON-LD version: "+c["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:c});if(e.processingMode&&"json-ld-1.0"===e.processingMode)throw new i("@version: "+c["@version"]+" not compatible with "+e.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:c});y.processingMode="json-ld-1.1",y["@version"]=c["@version"],m.set("@version",!0)}if(y.processingMode=y.processingMode||e.processingMode,"@base"in c){let e=c["@base"];if(null===e||u(e));else{if(!l(e))throw new i('Invalid JSON-LD syntax; the value of "@base" in a @context must be an absolute IRI, a relative IRI, or null.',"jsonld.SyntaxError",{code:"invalid base IRI",context:c});e=d(y["@base"],e)}y["@base"]=e,m.set("@base",!0)}if("@vocab"in c){const e=c["@vocab"];if(null===e)delete y["@vocab"];else{if(!s(e))throw new i('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:c});if(!u(e)&&g.processingMode(y,1))throw new i('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:c});y["@vocab"]=v(y,e,{vocab:!0,base:!0},void 0,void 0,n)}m.set("@vocab",!0)}if("@language"in c){const e=c["@language"];if(null===e)delete y["@language"];else{if(!s(e))throw new i('Invalid JSON-LD syntax; the value of "@language" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid default language",context:c});y["@language"]=e.toLowerCase()}m.set("@language",!0)}if("@direction"in c){const t=c["@direction"];if("json-ld-1.0"===e.processingMode)throw new i("Invalid JSON-LD syntax; @direction not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context member",context:c});if(null===t)delete y["@direction"];else{if("ltr"!==t&&"rtl"!==t)throw new i('Invalid JSON-LD syntax; the value of "@direction" in a @context must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:c});y["@direction"]=t}m.set("@direction",!0)}if("@propagate"in c){const n=c["@propagate"];if("json-ld-1.0"===e.processingMode)throw new i("Invalid JSON-LD syntax; @propagate not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:c});if("boolean"!=typeof n)throw new i("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:t});m.set("@propagate",!0)}if("@import"in c){const r=c["@import"];if("json-ld-1.0"===e.processingMode)throw new i("Invalid JSON-LD syntax; @import not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:c});if(!s(r))throw new i("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:t});const o=await n.contextResolver.resolve({activeCtx:e,context:r,documentLoader:n.documentLoader,base:n.base});if(1!==o.length)throw new i("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:t});const a=o[0].getProcessed(e);if(a)c=a;else{const n=o[0].document;if("@import"in n)throw new i("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:t});for(const e in n)c.hasOwnProperty(e)||(c[e]=n[e]);o[0].setProcessed(e,c)}m.set("@import",!0)}m.set("@protected",c["@protected"]||!1);for(const e in c)if(g.createTermDefinition({activeCtx:y,localCtx:c,term:e,defined:m,options:n,overrideProtected:f}),a(c[e])&&"@context"in c[e]){const t=c[e]["@context"];let r=!0;if(s(t)){const e=d(n.base,t);h.has(e)?r=!1:h.add(e)}if(r)try{await g.process({activeCtx:y.clone(),localCtx:c[e]["@context"],overrideProtected:!0,options:n,cycles:h})}catch(t){throw new i("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:c[e]["@context"],term:e})}}o.setProcessed(e,y)}return y},g.createTermDefinition=({activeCtx:e,localCtx:t,term:n,defined:r,options:c,overrideProtected:l=!1})=>{if(r.has(n)){if(r.get(n))return;throw new i("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:t,term:n})}let d;if(r.set(n,!1),t.hasOwnProperty(n)&&(d=t[n]),"@type"===n&&a(d)&&"@set"===(d["@container"]||"@set")&&g.processingMode(e,1.1)){const e=["@container","@id","@protected"],r=Object.keys(d);if(0===r.length||r.some((t=>!e.includes(t))))throw new i("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:n})}else{if(g.isKeyword(n))throw new i("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:n});if(n.match(m))return void console.warn('WARNING: terms beginning with "@" are reserved for future use and ignored',{term:n});if(""===n)throw new i("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:t})}const p=e.mappings.get(n);e.mappings.has(n)&&e.mappings.delete(n);let f=!1;if((s(d)||null===d)&&(f=!0,d={"@id":d}),!a(d))throw new i("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:t});const h={};e.mappings.set(n,h),h.reverse=!1;const b=["@container","@id","@language","@reverse","@type"];g.processingMode(e,1.1)&&b.push("@context","@direction","@index","@nest","@prefix","@protected");for(const e in d)if(!b.includes(e))throw new i("Invalid JSON-LD syntax; a term definition must not contain "+e,"jsonld.SyntaxError",{code:"invalid term definition",context:t});const w=n.indexOf(":");if(h._termHasColon=w>0,"@reverse"in d){if("@id"in d)throw new i("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});if("@nest"in d)throw new i("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});const o=d["@reverse"];if(!s(o))throw new i("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(!g.isKeyword(o)&&o.match(m))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:o}),void(p?e.mappings.set(n,p):e.mappings.delete(n));const a=v(e,o,{vocab:!0,base:!1},t,r,c);if(!u(a))throw new i("Invalid JSON-LD syntax; a @context @reverse value must be an absolute IRI or a blank node identifier.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});h["@id"]=a,h.reverse=!0}else if("@id"in d){let o=d["@id"];if(o&&!s(o))throw new i("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(null===o)h["@id"]=null;else{if(!g.isKeyword(o)&&o.match(m))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:o}),void(p?e.mappings.set(n,p):e.mappings.delete(n));if(o!==n){if(o=v(e,o,{vocab:!0,base:!1},t,r,c),!u(o)&&!g.isKeyword(o))throw new i("Invalid JSON-LD syntax; a @context @id value must be an absolute IRI, a blank node identifier, or a keyword.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(n.match(/(?::[^:])|\//)&&v(e,n,{vocab:!0,base:!1},t,new Map(r).set(n,!0),c)!==o)throw new i("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});h["@id"]=o,h._prefix=f&&!h._termHasColon&&o.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in h))if(h._termHasColon){const i=n.substr(0,w);if(t.hasOwnProperty(i)&&g.createTermDefinition({activeCtx:e,localCtx:t,term:i,defined:r,options:c}),e.mappings.has(i)){const t=n.substr(w+1);h["@id"]=e.mappings.get(i)["@id"]+t}else h["@id"]=n}else if("@type"===n)h["@id"]=n;else{if(!("@vocab"in e))throw new i("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t,term:n});h["@id"]=e["@vocab"]+n}if((!0===d["@protected"]||!0===r.get("@protected")&&!1!==d["@protected"])&&(e.protected[n]=!0,h.protected=!0),r.set(n,!0),"@type"in d){let n=d["@type"];if(!s(n))throw new i("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if("@json"===n||"@none"===n){if(g.processingMode(e,1))throw new i(`Invalid JSON-LD syntax; an @context @type value must not be "${n}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else if("@id"!==n&&"@vocab"!==n){if(n=v(e,n,{vocab:!0,base:!1},t,r,c),!u(n))throw new i("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if(0===n.indexOf("_:"))throw new i("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}h["@type"]=n}if("@container"in d){const n=s(d["@container"])?[d["@container"]]:d["@container"]||[],r=["@list","@set","@index","@language"];let a=!0;const c=n.includes("@set");if(g.processingMode(e,1.1)){if(r.push("@graph","@id","@type"),n.includes("@list")){if(1!==n.length)throw new i("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else if(n.includes("@graph")){if(n.some((e=>"@graph"!==e&&"@id"!==e&&"@index"!==e&&"@set"!==e)))throw new i("Invalid JSON-LD syntax; @context @container with @graph must have no other values other than @id, @index, and @set","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else a&=n.length<=(c?2:1);if(n.includes("@type")&&(h["@type"]=h["@type"]||"@id",!["@id","@vocab"].includes(h["@type"])))throw new i("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else a&=!o(d["@container"]),a&=n.length<=1;if(a&=n.every((e=>r.includes(e))),a&=!(c&&n.includes("@list")),!a)throw new i("Invalid JSON-LD syntax; @context @container value must be one of the following: "+r.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:t});if(h.reverse&&!n.every((e=>["@index","@set"].includes(e))))throw new i("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});h["@container"]=n}if("@index"in d){if(!("@container"in d)||!h["@container"].includes("@index"))throw new i(`Invalid JSON-LD syntax; @index without @index in @container: "${d["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});if(!s(d["@index"])||0===d["@index"].indexOf("@"))throw new i(`Invalid JSON-LD syntax; @index must expand to an IRI: "${d["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});h["@index"]=d["@index"]}if("@context"in d&&(h["@context"]=d["@context"]),"@language"in d&&!("@type"in d)){let e=d["@language"];if(null!==e&&!s(e))throw new i("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:t});null!==e&&(e=e.toLowerCase()),h["@language"]=e}if("@prefix"in d){if(n.match(/:|\//))throw new i("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:t});if(g.isKeyword(h["@id"]))throw new i("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:t});if("boolean"!=typeof d["@prefix"])throw new i("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:t});h._prefix=!0===d["@prefix"]}if("@direction"in d){const e=d["@direction"];if(null!==e&&"ltr"!==e&&"rtl"!==e)throw new i('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:t});h["@direction"]=e}if("@nest"in d){const e=d["@nest"];if(!s(e)||"@nest"!==e&&0===e.indexOf("@"))throw new i("Invalid JSON-LD syntax; @context @nest value must be a string which is not a keyword other than @nest.","jsonld.SyntaxError",{code:"invalid @nest value",context:t});h["@nest"]=e}const x=h["@id"];if("@context"===x||"@preserve"===x)throw new i("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:t});if(p&&p.protected&&!l&&(e.protected[n]=!0,h.protected=!0,!y(p,h))){const e=c&&c.protectedMode||"error";if("error"===e)throw new i(`Invalid JSON-LD syntax; tried to redefine "${n}" which is a protected term.`,"jsonld.SyntaxError",{code:"protected term redefinition",context:t,term:n});if("warn"===e)return void console.warn("WARNING: protected term redefinition",{term:n});throw new i("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:t,term:n,protectedMode:e})}},g.expandIri=(e,t,n,r)=>v(e,t,n,void 0,void 0,r),g.getInitialContext=e=>{const t=JSON.stringify({processingMode:e.processingMode}),n=h.get(t);if(n)return n;const i={processingMode:e.processingMode,mappings:new Map,inverse:null,getInverse:function(){const e=this;if(e.inverse)return e.inverse;const t=e.inverse={},n=e.fastCurieMap={},r={},i=(e["@language"]||"@none").toLowerCase(),s=e["@direction"],c=e.mappings,u=[...c.keys()].sort(f);for(const e of u){const o=c.get(e);if(null===o)continue;let u=o["@container"]||"@none";if(u=[].concat(u).sort().join(""),null===o["@id"])continue;const l=p(o["@id"]);for(const c of l){let l=t[c];const d=g.isKeyword(c);if(l)d||o._termHasColon||r[c].push(e);else if(t[c]=l={},!d&&!o._termHasColon){r[c]=[e];const t={iri:c,terms:r[c]};c[0]in n?n[c[0]].push(t):n[c[0]]=[t]}if(l[u]||(l[u]={"@language":{},"@type":{},"@any":{}}),l=l[u],a(e,l["@any"],"@none"),o.reverse)a(e,l["@type"],"@reverse");else if("@none"===o["@type"])a(e,l["@any"],"@none"),a(e,l["@language"],"@none"),a(e,l["@type"],"@none");else if("@type"in o)a(e,l["@type"],o["@type"]);else if("@language"in o&&"@direction"in o){const t=o["@language"],n=o["@direction"];a(e,l["@language"],t&&n?`${t}_${n}`.toLowerCase():t?t.toLowerCase():n?`_${n}`:"@null")}else"@language"in o?a(e,l["@language"],(o["@language"]||"@null").toLowerCase()):"@direction"in o?o["@direction"]?a(e,l["@language"],`_${o["@direction"]}`):a(e,l["@language"],"@none"):s?(a(e,l["@language"],`_${s}`),a(e,l["@language"],"@none"),a(e,l["@type"],"@none")):(a(e,l["@language"],i),a(e,l["@language"],"@none"),a(e,l["@type"],"@none"))}}for(const e in n)o(n,e,1);return t},clone:function(){const e={};return e.mappings=r.clone(this.mappings),e.clone=this.clone,e.inverse=null,e.getInverse=this.getInverse,e.protected=r.clone(this.protected),this.previousContext&&(e.previousContext=this.previousContext.clone()),e.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(e["@base"]=this["@base"]),"@language"in this&&(e["@language"]=this["@language"]),"@vocab"in this&&(e["@vocab"]=this["@vocab"]),e},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===h.size&&h.clear(),h.set(t,i),i;function o(e,t,n){const r=e[t],i=e[t]={};let a,s;for(const e of r)a=e.iri,s=n>=a.length?"":a[n],s in i?i[s].push(e):i[s]=[e];for(const e in i)""!==e&&o(i,e,n+1)}function a(e,t,n){t.hasOwnProperty(n)||(t[n]=e)}},g.getContextValue=(e,t,n)=>{if(null===t){if("@context"===n)return;return null}if(e.mappings.has(t)){const r=e.mappings.get(t);if(c(n))return r;if(r.hasOwnProperty(n))return r[n]}return"@language"===n&&n in e||"@direction"===n&&n in e?e[n]:"@context"!==n?null:void 0},g.processingMode=(e,t)=>t.toString()>="1.1"?!e.processingMode||e.processingMode>="json-ld-"+t.toString():"json-ld-1.0"===e.processingMode,g.isKeyword=e=>{if(!s(e)||"@"!==e[0])return!1;switch(e){case"@base":case"@container":case"@context":case"@default":case"@direction":case"@embed":case"@explicit":case"@graph":case"@id":case"@included":case"@index":case"@json":case"@language":case"@list":case"@nest":case"@none":case"@omitDefault":case"@prefix":case"@preserve":case"@protected":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@version":case"@vocab":return!0}return!1}},8831:(e,t,n)=>{"use strict";const{parseLinkHeader:r,buildHeaders:i}=n(1055),{LINK_HEADER_CONTEXT:o}=n(3770),a=n(4093),s=n(533),{prependBase:c}=n(2278),u=/(^|(\r\n))link:/i;e.exports=({secure:e,headers:t={},xhr:n}={headers:{}})=>(t=i(t),(new s).wrapLoader((async function i(s){if(0!==s.indexOf("http:")&&0!==s.indexOf("https:"))throw new a('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:s});if(e&&0!==s.indexOf("https"))throw new a('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:s});let l;try{l=await function(e,t,n){const r=new(e=e||XMLHttpRequest);return new Promise(((e,i)=>{r.onload=()=>e(r),r.onerror=e=>i(e),r.open("GET",t,!0);for(const e in n)r.setRequestHeader(e,n[e]);r.send()}))}(n,s,t)}catch(e){throw new a("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:s,cause:e})}if(l.status>=400)throw new a("URL could not be dereferenced: "+l.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:s,httpStatusCode:l.status});let d={contextUrl:null,documentUrl:s,document:l.response},p=null;const f=l.getResponseHeader("Content-Type");let h;if(u.test(l.getAllResponseHeaders())&&(h=l.getResponseHeader("Link")),h&&"application/ld+json"!==f){const e=r(h),t=e[o];if(Array.isArray(t))throw new a("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:s});t&&(d.contextUrl=t.target),p=e.alternate,p&&"application/ld+json"==p.type&&!(f||"").match(/^application\/(\w*\+)?json$/)&&(d=await i(c(s,p.target)))}return d})))},2759:(e,t,n)=>{"use strict";const r=n(4093),{isArray:i,isObject:o,isEmptyObject:a,isString:s,isUndefined:c}=n(832),{isList:u,isValue:l,isGraph:d,isSubject:p}=n(8463),{expandIri:f,getContextValue:h,isKeyword:m,process:g,processingMode:v}=n(4131),{isAbsolute:y}=n(2278),{addValue:b,asArray:w,getValues:x,validateTypeValue:_}=n(1055),E={};e.exports=E;const k=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;async function S({activeCtx:e,activeProperty:t,expandedActiveProperty:n,element:d,expandedParent:x,options:C={},insideList:O,typeKey:P,typeScopedContext:I,expansionMap:j}){const N=Object.keys(d).sort(),F=[];let R;const L=d[P]&&"@json"===f(e,i(d[P])?d[P][0]:d[P],{vocab:!0},C);for(const S of N){let P,N=d[S];if("@context"===S)continue;let D=f(e,S,{vocab:!0},C);if((null===D||!y(D)&&!m(D))&&(D=j({unmappedProperty:S,activeCtx:e,activeProperty:t,parent:d,options:C,insideList:O,value:N,expandedParent:x}),void 0===D))continue;if(m(D)){if("@reverse"===n)throw new r("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:N});if(D in x&&"@included"!==D&&"@type"!==D)throw new r("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:D})}if("@id"===D){if(!s(N)){if(!C.isFrame)throw new r('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:N});if(o(N)){if(!a(N))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:N})}else{if(!i(N))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:N});if(!N.every((e=>s(e))))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:N})}}b(x,"@id",w(N).map((t=>s(t)?f(e,t,{base:!0},C):t)),{propertyIsArray:C.isFrame});continue}if("@type"===D){o(N)&&(N=Object.fromEntries(Object.entries(N).map((([e,t])=>[f(I,e,{vocab:!0}),w(t).map((e=>f(I,e,{base:!0,vocab:!0})))])))),_(N,C.isFrame),b(x,"@type",w(N).map((e=>s(e)?f(I,e,{base:!0,vocab:!0},C):e)),{propertyIsArray:C.isFrame});continue}if("@included"===D&&v(e,1.1)){const n=w(await E.expand({activeCtx:e,activeProperty:t,element:N,options:C,expansionMap:j}));if(!n.every((e=>p(e))))throw new r("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:N});b(x,"@included",n,{propertyIsArray:!0});continue}if("@graph"===D&&!o(N)&&!i(N))throw new r('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:N});if("@value"===D){R=N,L&&v(e,1.1)?x["@value"]=N:b(x,"@value",N,{propertyIsArray:C.isFrame});continue}if("@language"===D){if(null===N)continue;if(!s(N)&&!C.isFrame)throw new r('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:N});N=w(N).map((e=>s(e)?e.toLowerCase():e));for(const e of N)s(e)&&!e.match(k)&&console.warn(`@language must be valid BCP47: ${e}`);b(x,"@language",N,{propertyIsArray:C.isFrame});continue}if("@direction"===D){if(!s(N)&&!C.isFrame)throw new r('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:N});N=w(N);for(const e of N)if(s(e)&&"ltr"!==e&&"rtl"!==e)throw new r('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:N});b(x,"@direction",N,{propertyIsArray:C.isFrame});continue}if("@index"===D){if(!s(N))throw new r('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:N});b(x,"@index",N);continue}if("@reverse"===D){if(!o(N))throw new r('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:N});if(P=await E.expand({activeCtx:e,activeProperty:"@reverse",element:N,options:C,expansionMap:j}),"@reverse"in P)for(const e in P["@reverse"])b(x,e,P["@reverse"][e],{propertyIsArray:!0});let t=x["@reverse"]||null;for(const e in P){if("@reverse"===e)continue;null===t&&(t=x["@reverse"]={}),b(t,e,[],{propertyIsArray:!0});const n=P[e];for(let i=0;i<n.length;++i){const o=n[i];if(l(o)||u(o))throw new r('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:P});b(t,e,o,{propertyIsArray:!0})}}continue}if("@nest"===D){F.push(S);continue}let M=e;const U=h(e,S,"@context");c(U)||(M=await g({activeCtx:e,localCtx:U,propagate:!0,overrideProtected:!0,options:C}));const B=h(M,S,"@container")||[];if(B.includes("@language")&&o(N))P=A(M,N,h(M,S,"@direction"),C);else if(B.includes("@index")&&o(N)){const t=B.includes("@graph"),n=h(M,S,"@index")||"@index",r="@index"!==n&&f(e,n,{vocab:!0},C);P=await T({activeCtx:M,options:C,activeProperty:S,value:N,expansionMap:j,asGraph:t,indexKey:n,propertyIndex:r})}else if(B.includes("@id")&&o(N)){const e=B.includes("@graph");P=await T({activeCtx:M,options:C,activeProperty:S,value:N,expansionMap:j,asGraph:e,indexKey:"@id"})}else if(B.includes("@type")&&o(N))P=await T({activeCtx:M.revertToPreviousContext(),options:C,activeProperty:S,value:N,expansionMap:j,asGraph:!1,indexKey:"@type"});else{const r="@list"===D;if(r||"@set"===D){let e=t;r&&"@graph"===n&&(e=null),P=await E.expand({activeCtx:M,activeProperty:e,element:N,options:C,insideList:r,expansionMap:j})}else P="@json"===h(e,S,"@type")?{"@type":"@json","@value":N}:await E.expand({activeCtx:M,activeProperty:S,element:N,options:C,insideList:!1,expansionMap:j})}if(null!==P||"@value"===D||(P=j({unmappedValue:N,expandedProperty:D,activeCtx:M,activeProperty:t,parent:d,options:C,insideList:O,key:S,expandedParent:x}),void 0!==P))if("@list"!==D&&!u(P)&&B.includes("@list")&&(P={"@list":w(P)}),B.includes("@graph")&&!B.some((e=>"@id"===e||"@index"===e))&&(P=w(P).map((e=>({"@graph":w(e)})))),M.mappings.has(S)&&M.mappings.get(S).reverse){const e=x["@reverse"]=x["@reverse"]||{};P=w(P);for(let t=0;t<P.length;++t){const n=P[t];if(l(n)||u(n))throw new r('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:P});b(e,D,n,{propertyIsArray:!0})}}else b(x,D,P,{propertyIsArray:!0})}if("@value"in x)if("@json"===x["@type"]&&v(e,1.1));else if((o(R)||i(R))&&!C.isFrame)throw new r('Invalid JSON-LD syntax; "@value" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid value object value",value:R});for(const a of F){const s=i(d[a])?d[a]:[d[a]];for(const i of s){if(!o(i)||Object.keys(i).some((t=>"@value"===f(e,t,{vocab:!0},C))))throw new r("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:i});await S({activeCtx:e,activeProperty:t,expandedActiveProperty:n,element:i,expandedParent:x,options:C,insideList:O,typeScopedContext:I,typeKey:P,expansionMap:j})}}}function C({activeCtx:e,activeProperty:t,value:n,options:r}){if(null==n)return null;const i=f(e,t,{vocab:!0},r);if("@id"===i)return f(e,n,{base:!0},r);if("@type"===i)return f(e,n,{vocab:!0,base:!0},r);const o=h(e,t,"@type");if(("@id"===o||"@graph"===i)&&s(n))return{"@id":f(e,n,{base:!0},r)};if("@vocab"===o&&s(n))return{"@id":f(e,n,{vocab:!0,base:!0},r)};if(m(i))return n;const a={};if(o&&!["@id","@vocab","@none"].includes(o))a["@type"]=o;else if(s(n)){const n=h(e,t,"@language");null!==n&&(a["@language"]=n);const r=h(e,t,"@direction");null!==r&&(a["@direction"]=r)}return["boolean","number","string"].includes(typeof n)||(n=n.toString()),a["@value"]=n,a}function A(e,t,n,o){const a=[],c=Object.keys(t).sort();for(const u of c){const c=f(e,u,{vocab:!0},o);let l=t[u];i(l)||(l=[l]);for(const e of l){if(null===e)continue;if(!s(e))throw new r("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:t});const i={"@value":e};"@none"!==c&&(i["@language"]=u.toLowerCase()),n&&(i["@direction"]=n),a.push(i)}}return a}async function T({activeCtx:e,options:t,activeProperty:n,value:o,expansionMap:a,asGraph:s,indexKey:u,propertyIndex:p}){const m=[],v=Object.keys(o).sort(),y="@type"===u;for(let w of v){if(y){const n=h(e,w,"@context");c(n)||(e=await g({activeCtx:e,localCtx:n,propagate:!1,options:t}))}let v,x=o[w];i(x)||(x=[x]),x=await E.expand({activeCtx:e,activeProperty:n,element:x,options:t,insideList:!1,insideIndex:!0,expansionMap:a}),v=p?"@none"===w?"@none":C({activeCtx:e,activeProperty:u,value:w,options:t}):f(e,w,{vocab:!0},t),"@id"===u?w=f(e,w,{base:!0},t):y&&(w=v);for(let e of x){if(s&&!d(e)&&(e={"@graph":[e]}),"@type"===u)"@none"===v||(e["@type"]?e["@type"]=[w].concat(e["@type"]):e["@type"]=[w]);else{if(l(e)&&!["@language","@type","@index"].includes(u))throw new r(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${u}".`,"jsonld.SyntaxError",{code:"invalid value object",value:e});p?"@none"!==v&&b(e,p,v,{propertyIsArray:!0,prependValue:!0}):"@none"===v||u in e||(e[u]=w)}m.push(e)}}return m}E.expand=async({activeCtx:e,activeProperty:t=null,element:n,options:u={},insideList:l=!1,insideIndex:d=!1,typeScopedContext:p=null,expansionMap:m=(()=>{})})=>{if(null==n)return null;if("@default"===t&&(u=Object.assign({},u,{isFrame:!1})),!i(n)&&!o(n)){if(!l&&(null===t||"@graph"===f(e,t,{vocab:!0},u))){const r=await m({unmappedValue:n,activeCtx:e,activeProperty:t,options:u,insideList:l});return void 0===r?null:r}return C({activeCtx:e,activeProperty:t,value:n,options:u})}if(i(n)){let r=[];const o=h(e,t,"@container")||[];l=l||o.includes("@list");for(let o=0;o<n.length;++o){let a=await E.expand({activeCtx:e,activeProperty:t,element:n[o],options:u,expansionMap:m,insideIndex:d,typeScopedContext:p});l&&i(a)&&(a={"@list":a}),null===a&&(a=await m({unmappedValue:n[o],activeCtx:e,activeProperty:t,parent:n,index:o,options:u,expandedParent:r,insideList:l}),void 0===a)||(i(a)?r=r.concat(a):r.push(a))}return r}const b=f(e,t,{vocab:!0},u),_=h(e,t,"@context");p=p||(e.previousContext?e:null);let k=Object.keys(n).sort(),A=!d;if(A&&p&&k.length<=2&&!k.includes("@context"))for(const t of k){const n=f(p,t,{vocab:!0},u);if("@value"===n){A=!1,e=p;break}if("@id"===n&&1===k.length){A=!1;break}}A&&(e=e.revertToPreviousContext()),c(_)||(e=await g({activeCtx:e,localCtx:_,propagate:!0,overrideProtected:!0,options:u})),"@context"in n&&(e=await g({activeCtx:e,localCtx:n["@context"],options:u})),p=e;let T=null;for(const t of k)if("@type"===f(e,t,{vocab:!0},u)){T=T||t;const r=n[t],i=Array.isArray(r)?r.length>1?r.slice().sort():r:[r];for(const t of i){const n=h(p,t,"@context");c(n)||(e=await g({activeCtx:e,localCtx:n,options:u,propagate:!1}))}}let O={};await S({activeCtx:e,activeProperty:t,expandedActiveProperty:b,element:n,expandedParent:O,options:u,insideList:l,typeKey:T,typeScopedContext:p,expansionMap:m}),k=Object.keys(O);let P=k.length;if("@value"in O){if("@type"in O&&("@language"in O||"@direction"in O))throw new r('Invalid JSON-LD syntax; an element containing "@value" may not contain both "@type" and either "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:O});let i=P-1;if("@type"in O&&(i-=1),"@index"in O&&(i-=1),"@language"in O&&(i-=1),"@direction"in O&&(i-=1),0!==i)throw new r('Invalid JSON-LD syntax; an element containing "@value" may only have an "@index" property and either "@type" or either or both "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:O});const o=null===O["@value"]?[]:w(O["@value"]),c=x(O,"@type");if(v(e,1.1)&&c.includes("@json")&&1===c.length);else if(0===o.length){const r=await m({unmappedValue:O,activeCtx:e,activeProperty:t,element:n,options:u,insideList:l});O=void 0!==r?r:null}else{if(!o.every((e=>s(e)||a(e)))&&"@language"in O)throw new r("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:O});if(!c.every((e=>y(e)&&!(s(e)&&0===e.indexOf("_:"))||a(e))))throw new r('Invalid JSON-LD syntax; an element containing "@value" and "@type" must have an absolute IRI for the value of "@type".',"jsonld.SyntaxError",{code:"invalid typed value",element:O})}}else if("@type"in O&&!i(O["@type"]))O["@type"]=[O["@type"]];else if("@set"in O||"@list"in O){if(P>1&&(2!==P||!("@index"in O)))throw new r('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:O});"@set"in O&&(O=O["@set"],k=Object.keys(O),P=k.length)}else if(1===P&&"@language"in O){const r=await m(O,{unmappedValue:O,activeCtx:e,activeProperty:t,element:n,options:u,insideList:l});O=void 0!==r?r:null}if(o(O)&&!u.keepFreeFloatingNodes&&!l&&(null===t||"@graph"===b)&&(0===P||"@value"in O||"@list"in O||1===P&&"@id"in O)){const r=await m({unmappedValue:O,activeCtx:e,activeProperty:t,element:n,options:u,insideList:l});O=void 0!==r?r:null}return O}},1565:(e,t,n)=>{"use strict";const{isSubjectReference:r}=n(8463),{createMergedNodeMap:i}=n(2664),o={};e.exports=o,o.flatten=e=>{const t=i(e),n=[],o=Object.keys(t).sort();for(let e=0;e<o.length;++e){const i=t[o[e]];r(i)||n.push(i)}return n}},3859:(e,t,n)=>{"use strict";const{isKeyword:r}=n(4131),i=n(8463),o=n(832),a=n(1055),s=n(2278),c=n(4093),{createNodeMap:u,mergeNodeMapGraphs:l}=n(2664),d={};function p(e){const t={};for(const n in e)void 0!==e[n]&&(t["@"+n]=[e[n]]);return[t]}function f(e,t,n){for(let r=n.length-1;r>=0;--r){const i=n[r];if(i.graph===t&&i.subject["@id"]===e["@id"])return!0}return!1}function h(e,t,n){const r="@"+n;let i=r in e?e[r][0]:t[n];if("embed"===n)if(!0===i)i="@once";else if(!1===i)i="@never";else if("@always"!==i&&"@never"!==i&&"@link"!==i&&"@first"!==i&&"@last"!==i&&"@once"!==i)throw new c("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:e});return i}function m(e){if(!o.isArray(e)||1!==e.length||!o.isObject(e[0]))throw new c("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:e});if("@id"in e[0])for(const t of a.asArray(e[0]["@id"]))if(!o.isObject(t)&&!s.isAbsolute(t)||o.isString(t)&&0===t.indexOf("_:"))throw new c("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e});if("@type"in e[0])for(const t of a.asArray(e[0]["@type"]))if(!o.isObject(t)&&!s.isAbsolute(t)||o.isString(t)&&0===t.indexOf("_:"))throw new c("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e})}function g(e,t,n,s){let c=!0,u=!1;for(const l in n){let d=!1;const p=a.getValues(t,l),f=0===a.getValues(n,l).length;if("@id"===l){if(o.isEmptyObject(n["@id"][0]||{})?d=!0:n["@id"].length>=0&&(d=n["@id"].includes(p[0])),!s.requireAll)return d}else if("@type"===l){if(c=!1,f){if(p.length>0)return!1;d=!0}else if(1===n["@type"].length&&o.isEmptyObject(n["@type"][0]))d=p.length>0;else for(const e of n["@type"])d=!(!o.isObject(e)||!("@default"in e))||d||p.some((t=>t===e));if(!s.requireAll)return d}else{if(r(l))continue;{const t=a.getValues(n,l)[0];let r=!1;if(t&&(m([t]),r="@default"in t),c=!1,0===p.length&&r)continue;if(p.length>0&&f)return!1;if(void 0===t){if(p.length>0)return!1;d=!0}else if(i.isList(t)){const n=t["@list"][0];if(i.isList(p[0])){const t=p[0]["@list"];i.isValue(n)?d=t.some((e=>x(n,e))):(i.isSubject(n)||i.isSubjectReference(n))&&(d=t.some((t=>w(e,n,t,s))))}}else d=i.isValue(t)?p.some((e=>x(t,e))):i.isSubjectReference(t)?p.some((n=>w(e,t,n,s))):!!o.isObject(t)&&p.length>0}}if(!d&&s.requireAll)return!1;u=u||d}return c||u}function v(e,t){const n=e.uniqueEmbeds[e.graph],r=n[t],i=r.parent,s=r.property,c={"@id":t};if(o.isArray(i)){for(let e=0;e<i.length;++e)if(a.compareValues(i[e],c)){i[e]=c;break}}else{const e=o.isArray(i[s]);a.removeValue(i,s,c,{propertyIsArray:e}),a.addValue(i,s,c,{propertyIsArray:e})}const u=e=>{const t=Object.keys(n);for(const r of t)r in n&&o.isObject(n[r].parent)&&n[r].parent["@id"]===e&&(delete n[r],u(r))};u(t)}function y(e,t){if(o.isArray(e))return e.map((e=>y(e,t)));if(o.isObject(e)){if("@preserve"in e)return e["@preserve"][0];if(i.isValue(e))return e;if(i.isList(e))return e["@list"]=y(e["@list"],t),e;if("@id"in e){const n=e["@id"];if(t.link.hasOwnProperty(n)){const r=t.link[n].indexOf(e);if(-1!==r)return t.link[n][r];t.link[n].push(e)}else t.link[n]=[e]}for(const n in e)"@id"===n&&t.bnodesToClear.includes(e[n])?delete e["@id"]:e[n]=y(e[n],t)}return e}function b(e,t,n){o.isObject(e)?a.addValue(e,t,n,{propertyIsArray:!0}):e.push(n)}function w(e,t,n,r){if(!("@id"in n))return!1;const i=e.subjects[n["@id"]];return i&&g(e,i,t,r)}function x(e,t){const n=t["@value"],r=t["@type"],i=t["@language"],a=e["@value"]?o.isArray(e["@value"])?e["@value"]:[e["@value"]]:[],s=e["@type"]?o.isArray(e["@type"])?e["@type"]:[e["@type"]]:[],c=e["@language"]?o.isArray(e["@language"])?e["@language"]:[e["@language"]]:[];return 0===a.length&&0===s.length&&0===c.length||!(!a.includes(n)&&!o.isEmptyObject(a[0]))&&!!(!r&&0===s.length||s.includes(r)||r&&o.isEmptyObject(s[0]))&&!!(!i&&0===c.length||c.includes(i)||i&&o.isEmptyObject(c[0]))}e.exports=d,d.frameMergedOrDefault=(e,t,n)=>{const r={options:n,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},i=new a.IdentifierIssuer("_:b");u(e,r.graphMap,"@default",i),n.merged&&(r.graphMap["@merged"]=l(r.graphMap),r.graph="@merged"),r.subjects=r.graphMap[r.graph];const o=[];return d.frame(r,Object.keys(r.subjects).sort(),t,o),n.pruneBlankNodeIdentifiers&&(n.bnodesToClear=Object.keys(r.bnodeMap).filter((e=>1===r.bnodeMap[e].length))),n.link={},y(o,n)},d.frame=(e,t,n,s,u=null)=>{m(n),n=n[0];const l=e.options,y={embed:h(n,l,"embed"),explicit:h(n,l,"explicit"),requireAll:h(n,l,"requireAll")};e.link.hasOwnProperty(e.graph)||(e.link[e.graph]={});const w=e.link[e.graph],_=function(e,t,n,r){const i={};for(const o of t){const t=e.graphMap[e.graph][o];g(e,t,n,r)&&(i[o]=t)}return i}(e,t,n,y),E=Object.keys(_).sort();for(const m of E){const g=_[m];if(null===u?e.uniqueEmbeds={[e.graph]:{}}:e.uniqueEmbeds[e.graph]=e.uniqueEmbeds[e.graph]||{},"@link"===y.embed&&m in w){b(s,u,w[m]);continue}const E={"@id":m};if(0===m.indexOf("_:")&&a.addValue(e.bnodeMap,m,E,{propertyIsArray:!0}),w[m]=E,("@first"===y.embed||"@last"===y.embed)&&e.is11)throw new c("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:n});if(e.embedded||!e.uniqueEmbeds[e.graph].hasOwnProperty(m))if(!e.embedded||"@never"!==y.embed&&!f(g,e.graph,e.subjectStack))if(!e.embedded||"@first"!=y.embed&&"@once"!=y.embed||!e.uniqueEmbeds[e.graph].hasOwnProperty(m)){if("@last"===y.embed&&m in e.uniqueEmbeds[e.graph]&&v(e,m),e.uniqueEmbeds[e.graph][m]={parent:s,property:u},e.subjectStack.push({subject:g,graph:e.graph}),m in e.graphMap){let t=!1,r=null;"@graph"in n?(r=n["@graph"][0],t=!("@merged"===m||"@default"===m),o.isObject(r)||(r={})):(t="@merged"!==e.graph,r={}),t&&d.frame({...e,graph:m,embedded:!1},Object.keys(e.graphMap[m]).sort(),[r],E,"@graph")}"@included"in n&&d.frame({...e,embedded:!1},t,n["@included"],E,"@included");for(const t of Object.keys(g).sort())if(r(t)){if(E[t]=a.clone(g[t]),"@type"===t)for(const t of g["@type"])0===t.indexOf("_:")&&a.addValue(e.bnodeMap,t,E,{propertyIsArray:!0})}else if(!y.explicit||t in n)for(const r of g[t]){const o=t in n?n[t]:p(y);if(i.isList(r)){const o=n[t]&&n[t][0]&&n[t][0]["@list"]?n[t][0]["@list"]:p(y),s={"@list":[]};b(E,t,s);const c=r["@list"];for(const t of c)i.isSubjectReference(t)?d.frame({...e,embedded:!0},[t["@id"]],o,s,"@list"):b(s,"@list",a.clone(t))}else i.isSubjectReference(r)?d.frame({...e,embedded:!0},[r["@id"]],o,E,t):x(o[0],r)&&b(E,t,a.clone(r))}for(const e of Object.keys(n).sort()){if("@type"===e){if(!o.isObject(n[e][0])||!("@default"in n[e][0]))continue}else if(r(e))continue;const t=n[e][0]||{};if(!h(t,l,"omitDefault")&&!(e in E)){let n="@null";"@default"in t&&(n=a.clone(t["@default"])),o.isArray(n)||(n=[n]),E[e]=[{"@preserve":n}]}}for(const t of Object.keys(n["@reverse"]||{}).sort()){const r=n["@reverse"][t];for(const n of Object.keys(e.subjects))a.getValues(e.subjects[n],t).some((e=>e["@id"]===m))&&(E["@reverse"]=E["@reverse"]||{},a.addValue(E["@reverse"],t,[],{propertyIsArray:!0}),d.frame({...e,embedded:!0},[n],r,E["@reverse"][t],u))}b(s,u,E),e.subjectStack.pop()}else b(s,u,E);else b(s,u,E)}},d.cleanupNull=(e,t)=>{if(o.isArray(e))return e.map((e=>d.cleanupNull(e,t))).filter((e=>e));if("@null"===e)return null;if(o.isObject(e)){if("@id"in e){const n=e["@id"];if(t.link.hasOwnProperty(n)){const r=t.link[n].indexOf(e);if(-1!==r)return t.link[n][r];t.link[n].push(e)}else t.link[n]=[e]}for(const n in e)e[n]=d.cleanupNull(e[n],t)}return e}},5076:(e,t,n)=>{"use strict";const r=n(4093),i=n(8463),o=n(832),a=n(1055),{RDF_LIST:s,RDF_FIRST:c,RDF_REST:u,RDF_NIL:l,RDF_TYPE:d,RDF_JSON_LITERAL:p,XSD_BOOLEAN:f,XSD_DOUBLE:h,XSD_INTEGER:m,XSD_STRING:g}=n(3770),v=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,y={};function b(e,t,n){if(e.termType.endsWith("Node"))return{"@id":e.value};const i={"@value":e.value};if(e.language)i["@language"]=e.language;else{let a=e.datatype.value;if(a||(a=g),a===p){a="@json";try{i["@value"]=JSON.parse(i["@value"])}catch(e){throw new r("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:i["@value"],cause:e})}}if(t){if(a===f)"true"===i["@value"]?i["@value"]=!0:"false"===i["@value"]&&(i["@value"]=!1);else if(o.isNumeric(i["@value"]))if(a===m){const e=parseInt(i["@value"],10);e.toFixed(0)===i["@value"]&&(i["@value"]=e)}else a===h&&(i["@value"]=parseFloat(i["@value"]));[f,m,h,g].includes(a)||(i["@type"]=a)}else if("i18n-datatype"===n&&a.startsWith("https://www.w3.org/ns/i18n#")){const[,e,t]=a.split(/[#_]/);e.length>0&&(i["@language"]=e,e.match(v)||console.warn(`@language must be valid BCP47: ${e}`)),i["@direction"]=t}else a!==g&&(i["@type"]=a)}return i}e.exports=y,y.fromRDF=async(e,{useRdfType:t=!1,useNativeTypes:n=!1,rdfDirection:r=null})=>{const p={},f={"@default":p},h={};for(const i of e){const e="DefaultGraph"===i.graph.termType?"@default":i.graph.value;e in f||(f[e]={}),"@default"===e||e in p||(p[e]={"@id":e});const o=f[e],s=i.subject.value,c=i.predicate.value,u=i.object;s in o||(o[s]={"@id":s});const m=o[s],g=u.termType.endsWith("Node");if(g&&!(u.value in o)&&(o[u.value]={"@id":u.value}),c===d&&!t&&g){a.addValue(m,"@type",u.value,{propertyIsArray:!0});continue}const v=b(u,n,r);if(a.addValue(m,c,v,{propertyIsArray:!0}),g)if(u.value===l){const e=o[u.value];"usages"in e||(e.usages=[]),e.usages.push({node:m,property:c,value:v})}else u.value in h?h[u.value]=!1:h[u.value]={node:m,property:c,value:v}}for(const e in f){const t=f[e];if(!(l in t))continue;const n=t[l];if(n.usages){for(let e of n.usages){let n=e.node,r=e.property,a=e.value;const l=[],d=[];let p=Object.keys(n).length;for(;r===u&&o.isObject(h[n["@id"]])&&o.isArray(n[c])&&1===n[c].length&&o.isArray(n[u])&&1===n[u].length&&(3===p||4===p&&o.isArray(n["@type"])&&1===n["@type"].length&&n["@type"][0]===s)&&(l.push(n[c][0]),d.push(n["@id"]),e=h[n["@id"]],n=e.node,r=e.property,a=e.value,p=Object.keys(n).length,i.isBlankNode(n)););delete a["@id"],a["@list"]=l.reverse();for(const e of d)delete t[e]}delete n.usages}}const m=[],g=Object.keys(p).sort();for(const e of g){const t=p[e];if(e in f){const n=t["@graph"]=[],r=f[e],o=Object.keys(r).sort();for(const e of o){const t=r[e];i.isSubjectReference(t)||n.push(t)}}i.isSubjectReference(t)||m.push(t)}return m}},8463:(e,t,n)=>{"use strict";const r=n(832),i={};e.exports=i,i.isSubject=e=>!(!r.isObject(e)||"@value"in e||"@set"in e||"@list"in e)&&(Object.keys(e).length>1||!("@id"in e)),i.isSubjectReference=e=>r.isObject(e)&&1===Object.keys(e).length&&"@id"in e,i.isValue=e=>r.isObject(e)&&"@value"in e,i.isList=e=>r.isObject(e)&&"@list"in e,i.isGraph=e=>r.isObject(e)&&"@graph"in e&&1===Object.keys(e).filter((e=>"@id"!==e&&"@index"!==e)).length,i.isSimpleGraph=e=>i.isGraph(e)&&!("@id"in e),i.isBlankNode=e=>!!r.isObject(e)&&("@id"in e?0===e["@id"].indexOf("_:"):0===Object.keys(e).length||!("@value"in e||"@set"in e||"@list"in e))},6805:(e,t,n)=>{const r=n(7055),i=n(7222),o=n(1055),a=n(8058),s=o.IdentifierIssuer,c=n(4093),u=n(9593),l=n(9048),{expand:d}=n(2759),{flatten:p}=n(1565),{fromRDF:f}=n(5076),{toRDF:h}=n(9382),{frameMergedOrDefault:m,cleanupNull:g}=n(3859),{isArray:v,isObject:y,isString:b}=n(832),{isSubjectReference:w}=n(8463),{expandIri:x,getInitialContext:_,process:E,processingMode:k}=n(4131),{compact:S,compactIri:C}=n(3251),{createNodeMap:A,createMergedNodeMap:T,mergeNodeMaps:O}=n(2664),P=function(e){const t={},P=new u({max:100});function I(t,{documentLoader:n=e.documentLoader,...r}){return Object.assign({},{documentLoader:n},r,t)}return e.compact=async function(t,n,r){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===n)throw new c("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===t)return null;let i;(r=I(r,{base:b(t)?t:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new s("_:b"),contextResolver:new a({sharedCache:P})})).link&&(r.skipExpansion=!0),r.compactToRelative||delete r.base,i=r.skipExpansion?t:await e.expand(t,r);const u=await e.processContext(_(r),n,r);let l=await S({activeCtx:u,element:i,options:r,compactionMap:r.compactionMap});r.compactArrays&&!r.graph&&v(l)?1===l.length?l=l[0]:0===l.length&&(l={}):r.graph&&y(l)&&(l=[l]),y(n)&&"@context"in n&&(n=n["@context"]),n=o.clone(n),v(n)||(n=[n]);const d=n;n=[];for(let e=0;e<d.length;++e)(!y(d[e])||Object.keys(d[e]).length>0)&&n.push(d[e]);const p=n.length>0;if(1===n.length&&(n=n[0]),v(l)){const e=C({activeCtx:u,iri:"@graph",relativeTo:{vocab:!0}}),t=l;l={},p&&(l["@context"]=n),l[e]=t}else if(y(l)&&p){const e=l;l={"@context":n};for(const t in e)l[t]=e[t]}return l},e.expand=async function(t,n){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");!1===(n=I(n,{keepFreeFloatingNodes:!1,contextResolver:new a({sharedCache:P})})).expansionMap&&(n.expansionMap=void 0);const r={},i=[];if("expandContext"in n){const e=o.clone(n.expandContext);y(e)&&"@context"in e?r.expandContext=e:r.expandContext={"@context":e},i.push(r.expandContext)}let s;if(b(t)){const o=await e.get(t,n);s=o.documentUrl,r.input=o.document,o.contextUrl&&(r.remoteContext={"@context":o.contextUrl},i.push(r.remoteContext))}else r.input=o.clone(t);"base"in n||(n.base=s||"");let c=_(n);for(const e of i)c=await E({activeCtx:c,localCtx:e,options:n});let u=await d({activeCtx:c,element:r.input,options:n,expansionMap:n.expansionMap});return y(u)&&"@graph"in u&&1===Object.keys(u).length?u=u["@graph"]:null===u&&(u=[]),v(u)||(u=[u]),u},e.flatten=async function(t,n,r){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");n="function"==typeof n?null:n||null,r=I(r,{base:b(t)?t:"",contextResolver:new a({sharedCache:P})});const i=await e.expand(t,r),o=p(i);if(null===n)return o;r.graph=!0,r.skipExpansion=!0;const s=await e.compact(o,n,r);return s},e.frame=async function(t,n,r){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(r=I(r,{base:b(t)?t:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new a({sharedCache:P})}),b(n)){const t=await e.get(n,r);if(n=t.document,t.contextUrl){let e=n["@context"];e?v(e)?e.push(t.contextUrl):e=[e,t.contextUrl]:e=t.contextUrl,n["@context"]=e}}const i=n&&n["@context"]||{},o=await e.processContext(_(r),i,r);r.hasOwnProperty("omitGraph")||(r.omitGraph=k(o,1.1)),r.hasOwnProperty("pruneBlankNodeIdentifiers")||(r.pruneBlankNodeIdentifiers=k(o,1.1));const s=await e.expand(t,r),c={...r};c.isFrame=!0,c.keepFreeFloatingNodes=!0;const u=await e.expand(n,c),l=Object.keys(n).map((e=>x(o,e,{vocab:!0})));c.merged=!l.includes("@graph"),c.is11=k(o,1.1);const d=m(s,u,c);c.graph=!r.omitGraph,c.skipExpansion=!0,c.link={},c.framing=!0;let p=await e.compact(d,i,c);return c.link={},p=g(p,c),p},e.link=async function(t,n,r){const i={};return n&&(i["@context"]=n),i["@embed"]="@link",e.frame(t,i,r)},e.normalize=e.canonize=async function(t,n){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(n=I(n,{base:b(t)?t:"",algorithm:"URDNA2015",skipExpansion:!1,contextResolver:new a({sharedCache:P})}))){if("application/n-quads"!==n.inputFormat&&"application/nquads"!==n.inputFormat)throw new c("Unknown canonicalization input format.","jsonld.CanonizeError");const e=l.parse(t);return r.canonize(e,n)}const i={...n};delete i.format,i.produceGeneralizedRdf=!1;const o=await e.toRDF(t,i);return r.canonize(o,n)},e.fromRDF=async function(e,n){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");n=I(n,{format:b(e)?"application/n-quads":void 0});const{format:r}=n;let{rdfParser:i}=n;if(r){if(i=i||t[r],!i)throw new c("Unknown input format.","jsonld.UnknownFormat",{format:r})}else i=()=>e;const o=await i(e);return f(o,n)},e.toRDF=async function(t,n){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let r;r=(n=I(n,{base:b(t)?t:"",skipExpansion:!1,contextResolver:new a({sharedCache:P})})).skipExpansion?t:await e.expand(t,n);const i=h(r,n);if(n.format){if("application/n-quads"===n.format||"application/nquads"===n.format)return l.serialize(i);throw new c("Unknown output format.","jsonld.UnknownFormat",{format:n.format})}return i},e.createNodeMap=async function(t,n){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");n=I(n,{base:b(t)?t:"",contextResolver:new a({sharedCache:P})});const r=await e.expand(t,n);return T(r,n)},e.merge=async function(t,n,r){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!v(t))throw new TypeError('Could not merge, "docs" must be an array.');n="function"==typeof n?null:n||null,r=I(r,{contextResolver:new a({sharedCache:P})});const i=await Promise.all(t.map((t=>{const n={...r};return e.expand(t,n)})));let c=!0;"mergeNodes"in r&&(c=r.mergeNodes);const u=r.issuer||new s("_:b"),l={"@default":{}};for(let e=0;e<i.length;++e){const t=o.relabelBlankNodes(i[e],{issuer:new s("_:b"+e+"-")}),n=c||0===e?l:{"@default":{}};if(A(t,n,"@default",u),n!==l)for(const e in n){const t=n[e];if(!(e in l)){l[e]=t;continue}const r=l[e];for(const e in t)e in r||(r[e]=t[e])}}const d=O(l),p=[],f=Object.keys(d).sort();for(let e=0;e<f.length;++e){const t=d[f[e]];w(t)||p.push(t)}if(null===n)return p;r.graph=!0,r.skipExpansion=!0;const h=await e.compact(p,n,r);return h},Object.defineProperty(e,"documentLoader",{get:()=>e._documentLoader,set:t=>e._documentLoader=t}),e.documentLoader=async e=>{throw new c("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:e})},e.get=async function(t,n){let r;r="function"==typeof n.documentLoader?n.documentLoader:e.documentLoader;const i=await r(t);try{if(!i.document)throw new c("No remote document found at the given URL.","jsonld.NullRemoteDocument");b(i.document)&&(i.document=JSON.parse(i.document))}catch(e){throw new c("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:e,remoteDoc:i})}return i},e.processContext=async function(e,t,n){return n=I(n,{base:"",contextResolver:new a({sharedCache:P})}),null===t?_(n):(t=o.clone(t),y(t)&&"@context"in t||(t={"@context":t}),E({activeCtx:e,localCtx:t,options:n}))},e.getContextValue=n(4131).getContextValue,e.documentLoaders={},e.useDocumentLoader=function(t){if(!(t in e.documentLoaders))throw new c('Unknown document loader type: "'+t+'"',"jsonld.UnknownDocumentLoader",{type:t});e.documentLoader=e.documentLoaders[t].apply(e,Array.prototype.slice.call(arguments,1))},e.registerRDFParser=function(e,n){t[e]=n},e.unregisterRDFParser=function(e){delete t[e]},e.registerRDFParser("application/n-quads",l.parse),e.registerRDFParser("application/nquads",l.parse),e.url=n(2278),e.util=o,Object.assign(e,o),e.promises=e,e.RequestQueue=n(533),e.JsonLdProcessor=n(731)(e),i.setupGlobals(e),i.setupDocumentLoaders(e),e},I=function(){return P((function(){return I()}))};P(I),e.exports=I},2664:(e,t,n)=>{"use strict";const{isKeyword:r}=n(4131),i=n(8463),o=n(832),a=n(1055),s=n(4093),c={};e.exports=c,c.createMergedNodeMap=(e,t)=>{const n=(t=t||{}).issuer||new a.IdentifierIssuer("_:b"),r={"@default":{}};return c.createNodeMap(e,r,"@default",n),c.mergeNodeMaps(r)},c.createNodeMap=(e,t,n,u,l,d)=>{if(o.isArray(e)){for(const r of e)c.createNodeMap(r,t,n,u,void 0,d);return}if(!o.isObject(e))return void(d&&d.push(e));if(i.isValue(e)){if("@type"in e){let t=e["@type"];0===t.indexOf("_:")&&(e["@type"]=t=u.getId(t))}return void(d&&d.push(e))}if(d&&i.isList(e)){const r=[];return c.createNodeMap(e["@list"],t,n,u,l,r),void d.push({"@list":r})}if("@type"in e){const t=e["@type"];for(const e of t)0===e.indexOf("_:")&&u.getId(e)}o.isUndefined(l)&&(l=i.isBlankNode(e)?u.getId(e["@id"]):e["@id"]),d&&d.push({"@id":l});const p=t[n],f=p[l]=p[l]||{};f["@id"]=l;const h=Object.keys(e).sort();for(let o of h){if("@id"===o)continue;if("@reverse"===o){const r={"@id":l},o=e["@reverse"];for(const e in o){const s=o[e];for(const o of s){let s=o["@id"];i.isBlankNode(o)&&(s=u.getId(s)),c.createNodeMap(o,t,n,u,s),a.addValue(p[s],e,r,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===o){l in t||(t[l]={}),c.createNodeMap(e[o],t,l,u);continue}if("@included"===o){c.createNodeMap(e[o],t,n,u);continue}if("@type"!==o&&r(o)){if("@index"===o&&o in f&&(e[o]!==f[o]||e[o]["@id"]!==f[o]["@id"]))throw new s("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:f});f[o]=e[o];continue}const d=e[o];if(0===o.indexOf("_:")&&(o=u.getId(o)),0!==d.length)for(let e of d)if("@type"===o&&(e=0===e.indexOf("_:")?u.getId(e):e),i.isSubject(e)||i.isSubjectReference(e)){if("@id"in e&&!e["@id"])continue;const r=i.isBlankNode(e)?u.getId(e["@id"]):e["@id"];a.addValue(f,o,{"@id":r},{propertyIsArray:!0,allowDuplicate:!1}),c.createNodeMap(e,t,n,u,r)}else if(i.isValue(e))a.addValue(f,o,e,{propertyIsArray:!0,allowDuplicate:!1});else if(i.isList(e)){const r=[];c.createNodeMap(e["@list"],t,n,u,l,r),e={"@list":r},a.addValue(f,o,e,{propertyIsArray:!0,allowDuplicate:!1})}else c.createNodeMap(e,t,n,u,l),a.addValue(f,o,e,{propertyIsArray:!0,allowDuplicate:!1});else a.addValue(f,o,[],{propertyIsArray:!0})}},c.mergeNodeMapGraphs=e=>{const t={};for(const n of Object.keys(e).sort())for(const i of Object.keys(e[n]).sort()){const o=e[n][i];i in t||(t[i]={"@id":i});const s=t[i];for(const e of Object.keys(o).sort())if(r(e)&&"@type"!==e)s[e]=a.clone(o[e]);else for(const t of o[e])a.addValue(s,e,a.clone(t),{propertyIsArray:!0,allowDuplicate:!1})}return t},c.mergeNodeMaps=e=>{const t=e["@default"],n=Object.keys(e).sort();for(const r of n){if("@default"===r)continue;const n=e[r];let o=t[r];o?"@graph"in o||(o["@graph"]=[]):t[r]=o={"@id":r,"@graph":[]};const a=o["@graph"];for(const e of Object.keys(n).sort()){const t=n[e];i.isSubjectReference(t)||a.push(t)}}return t}},7222:(e,t,n)=>{"use strict";const r=n(8831),i={};e.exports=i,i.setupDocumentLoaders=function(e){"undefined"!=typeof XMLHttpRequest&&(e.documentLoaders.xhr=r,e.useDocumentLoader("xhr"))},i.setupGlobals=function(e){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:e.JsonLdProcessor})}},9382:(e,t,n)=>{"use strict";const{createNodeMap:r}=n(2664),{isKeyword:i}=n(4131),o=n(8463),a=n(5456),s=n(832),c=n(1055),{RDF_FIRST:u,RDF_REST:l,RDF_NIL:d,RDF_TYPE:p,RDF_JSON_LITERAL:f,RDF_LANGSTRING:h,XSD_BOOLEAN:m,XSD_DOUBLE:g,XSD_INTEGER:v,XSD_STRING:y}=n(3770),{isAbsolute:b}=n(2278),w={};function x(e,t,n,r,o){const a=Object.keys(t).sort();for(const s of a){const a=t[s],c=Object.keys(a).sort();for(let t of c){const c=a[t];if("@type"===t)t=p;else if(i(t))continue;for(const i of c){const a={termType:s.startsWith("_:")?"BlankNode":"NamedNode",value:s};if(!b(s))continue;const c={termType:t.startsWith("_:")?"BlankNode":"NamedNode",value:t};if(!b(t))continue;if("BlankNode"===c.termType&&!o.produceGeneralizedRdf)continue;const u=_(i,r,e,n,o.rdfDirection);u&&e.push({subject:a,predicate:c,object:u,graph:n})}}}}function _(e,t,n,r,i){const c={};if(o.isValue(e)){c.termType="Literal",c.value=void 0,c.datatype={termType:"NamedNode"};let t=e["@value"];const n=e["@type"]||null;if("@json"===n)c.value=a(t),c.datatype.value=f;else if(s.isBoolean(t))c.value=t.toString(),c.datatype.value=n||m;else if(s.isDouble(t)||n===g)s.isDouble(t)||(t=parseFloat(t)),c.value=t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),c.datatype.value=n||g;else if(s.isNumber(t))c.value=t.toFixed(0),c.datatype.value=n||v;else if("i18n-datatype"===i&&"@direction"in e){const n="https://www.w3.org/ns/i18n#"+(e["@language"]||"")+`_${e["@direction"]}`;c.datatype.value=n,c.value=t}else"@language"in e?(c.value=t,c.datatype.value=n||h,c.language=e["@language"]):(c.value=t,c.datatype.value=n||y)}else if(o.isList(e)){const o=function(e,t,n,r,i){const o={termType:"NamedNode",value:u},a={termType:"NamedNode",value:l},s={termType:"NamedNode",value:d},c=e.pop(),p=c?{termType:"BlankNode",value:t.getId()}:s;let f=p;for(const s of e){const e=_(s,t,n,r,i),c={termType:"BlankNode",value:t.getId()};n.push({subject:f,predicate:o,object:e,graph:r}),n.push({subject:f,predicate:a,object:c,graph:r}),f=c}if(c){const e=_(c,t,n,r,i);n.push({subject:f,predicate:o,object:e,graph:r}),n.push({subject:f,predicate:a,object:s,graph:r})}return p}(e["@list"],t,n,r,i);c.termType=o.termType,c.value=o.value}else{const t=s.isObject(e)?e["@id"]:e;c.termType=t.startsWith("_:")?"BlankNode":"NamedNode",c.value=t}return"NamedNode"!==c.termType||b(c.value)?c:null}e.exports=w,w.toRDF=(e,t)=>{const n=new c.IdentifierIssuer("_:b"),i={"@default":{}};r(e,i,"@default",n);const o=[],a=Object.keys(i).sort();for(const e of a){let r;if("@default"===e)r={termType:"DefaultGraph",value:""};else{if(!b(e))continue;r=e.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},r.value=e}x(o,i[e],r,n,t)}return o}},832:e=>{"use strict";const t={};e.exports=t,t.isArray=Array.isArray,t.isBoolean=e=>"boolean"==typeof e||"[object Boolean]"===Object.prototype.toString.call(e),t.isDouble=e=>t.isNumber(e)&&(-1!==String(e).indexOf(".")||Math.abs(e)>=1e21),t.isEmptyObject=e=>t.isObject(e)&&0===Object.keys(e).length,t.isNumber=e=>"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e),t.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),t.isObject=e=>"[object Object]"===Object.prototype.toString.call(e),t.isString=e=>"string"==typeof e||"[object String]"===Object.prototype.toString.call(e),t.isUndefined=e=>void 0===e},2278:(e,t,n)=>{"use strict";const r=n(832),i={};e.exports=i,i.parsers={simple:{keys:["href","scheme","authority","path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["href","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragment"],regex:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},i.parse=(e,t)=>{const n={},r=i.parsers[t||"full"],o=r.regex.exec(e);let a=r.keys.length;for(;a--;)n[r.keys[a]]=void 0===o[a]?null:o[a];return("https"===n.scheme&&"443"===n.port||"http"===n.scheme&&"80"===n.port)&&(n.href=n.href.replace(":"+n.port,""),n.authority=n.authority.replace(":"+n.port,""),n.port=null),n.normalizedPath=i.removeDotSegments(n.path),n},i.prependBase=(e,t)=>{if(null===e)return t;if(i.isAbsolute(t))return t;e&&!r.isString(e)||(e=i.parse(e||""));const n=i.parse(t),o={protocol:e.protocol||""};if(null!==n.authority)o.authority=n.authority,o.path=n.path,o.query=n.query;else if(o.authority=e.authority,""===n.path)o.path=e.path,null!==n.query?o.query=n.query:o.query=e.query;else{if(0===n.path.indexOf("/"))o.path=n.path;else{let t=e.path;t=t.substr(0,t.lastIndexOf("/")+1),(t.length>0||e.authority)&&"/"!==t.substr(-1)&&(t+="/"),t+=n.path,o.path=t}o.query=n.query}""!==n.path&&(o.path=i.removeDotSegments(o.path));let a=o.protocol;return null!==o.authority&&(a+="//"+o.authority),a+=o.path,null!==o.query&&(a+="?"+o.query),null!==n.fragment&&(a+="#"+n.fragment),""===a&&(a="./"),a},i.removeBase=(e,t)=>{if(null===e)return t;e&&!r.isString(e)||(e=i.parse(e||""));let n="";if(""!==e.href?n+=(e.protocol||"")+"//"+(e.authority||""):t.indexOf("//")&&(n+="//"),0!==t.indexOf(n))return t;const o=i.parse(t.substr(n.length)),a=e.normalizedPath.split("/"),s=o.normalizedPath.split("/"),c=o.fragment||o.query?0:1;for(;a.length>0&&s.length>c&&a[0]===s[0];)a.shift(),s.shift();let u="";if(a.length>0){a.pop();for(let e=0;e<a.length;++e)u+="../"}return u+=s.join("/"),null!==o.query&&(u+="?"+o.query),null!==o.fragment&&(u+="#"+o.fragment),""===u&&(u="./"),u},i.removeDotSegments=e=>{if(0===e.length)return"";const t=e.split("/"),n=[];for(;t.length>0;){const e=t.shift(),r=0===t.length;"."!==e?".."!==e?n.push(e):(n.pop(),r&&n.push("")):r&&n.push("")}return"/"===e[0]&&n.length>0&&""!==n[0]&&n.unshift(""),1===n.length&&""===n[0]?"/":n.join("/")};const o=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;i.isAbsolute=e=>r.isString(e)&&o.test(e),i.isRelative=e=>r.isString(e)},1055:(e,t,n)=>{"use strict";const r=n(8463),i=n(832),o=n(7055).IdentifierIssuer,a=n(4093),s=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,c=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,u=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,l="application/ld+json, application/json",d={};function p(e,t){if(i.isArray(t))for(let n=0;n<t.length;++n)t[n]=p(e,t[n]);else if(r.isList(t))t["@list"]=p(e,t["@list"]);else if(i.isObject(t)){r.isBlankNode(t)&&(t["@id"]=e.getId(t["@id"]));const n=Object.keys(t).sort();for(let r=0;r<n.length;++r){const i=n[r];"@id"!==i&&(t[i]=p(e,t[i]))}}return t}e.exports=d,d.IdentifierIssuer=o,d.clone=function(e){if(e&&"object"==typeof e){let t;if(i.isArray(e)){t=[];for(let n=0;n<e.length;++n)t[n]=d.clone(e[n])}else if(e instanceof Map){t=new Map;for(const[n,r]of e)t.set(n,d.clone(r))}else if(e instanceof Set){t=new Set;for(const n of e)t.add(d.clone(n))}else if(i.isObject(e)){t={};for(const n in e)t[n]=d.clone(e[n])}else t=e.toString();return t}return e},d.asArray=function(e){return Array.isArray(e)?e:[e]},d.buildHeaders=(e={})=>{if(Object.keys(e).some((e=>"accept"===e.toLowerCase())))throw new RangeError('Accept header may not be specified; only "'+l+'" is supported.');return Object.assign({Accept:l},e)},d.parseLinkHeader=e=>{const t={},n=e.match(s);for(let e=0;e<n.length;++e){let r=n[e].match(c);if(!r)continue;const i={target:r[1]},o=r[2];for(;r=u.exec(o);)i[r[1]]=void 0===r[2]?r[3]:r[2];const a=i.rel||"";Array.isArray(t[a])?t[a].push(i):t.hasOwnProperty(a)?t[a]=[t[a],i]:t[a]=i}return t},d.validateTypeValue=(e,t)=>{if(!(i.isString(e)||i.isArray(e)&&e.every((e=>i.isString(e))))){if(t&&i.isObject(e))switch(Object.keys(e).length){case 0:return;case 1:if("@default"in e&&d.asArray(e["@default"]).every((e=>i.isString(e))))return}throw new a('Invalid JSON-LD syntax; "@type" value must a string, an array of strings, an empty object, or a default object.',"jsonld.SyntaxError",{code:"invalid type value",value:e})}},d.hasProperty=(e,t)=>{if(e.hasOwnProperty(t)){const n=e[t];return!i.isArray(n)||n.length>0}return!1},d.hasValue=(e,t,n)=>{if(d.hasProperty(e,t)){let o=e[t];const a=r.isList(o);if(i.isArray(o)||a){a&&(o=o["@list"]);for(let e=0;e<o.length;++e)if(d.compareValues(n,o[e]))return!0}else if(!i.isArray(n))return d.compareValues(n,o)}return!1},d.addValue=(e,t,n,r)=>{if("propertyIsArray"in(r=r||{})||(r.propertyIsArray=!1),"valueIsArray"in r||(r.valueIsArray=!1),"allowDuplicate"in r||(r.allowDuplicate=!0),"prependValue"in r||(r.prependValue=!1),r.valueIsArray)e[t]=n;else if(i.isArray(n)){0===n.length&&r.propertyIsArray&&!e.hasOwnProperty(t)&&(e[t]=[]),r.prependValue&&(n=n.concat(e[t]),e[t]=[]);for(let i=0;i<n.length;++i)d.addValue(e,t,n[i],r)}else if(e.hasOwnProperty(t)){const o=!r.allowDuplicate&&d.hasValue(e,t,n);i.isArray(e[t])||o&&!r.propertyIsArray||(e[t]=[e[t]]),o||(r.prependValue?e[t].unshift(n):e[t].push(n))}else e[t]=r.propertyIsArray?[n]:n},d.getValues=(e,t)=>[].concat(e[t]||[]),d.removeProperty=(e,t)=>{delete e[t]},d.removeValue=(e,t,n,r)=>{"propertyIsArray"in(r=r||{})||(r.propertyIsArray=!1);const i=d.getValues(e,t).filter((e=>!d.compareValues(e,n)));0===i.length?d.removeProperty(e,t):1!==i.length||r.propertyIsArray?e[t]=i:e[t]=i[0]},d.relabelBlankNodes=(e,t)=>p((t=t||{}).issuer||new o("_:b"),e),d.compareValues=(e,t)=>e===t||!(!r.isValue(e)||!r.isValue(t)||e["@value"]!==t["@value"]||e["@type"]!==t["@type"]||e["@language"]!==t["@language"]||e["@index"]!==t["@index"])||!!(i.isObject(e)&&"@id"in e&&i.isObject(t)&&"@id"in t)&&e["@id"]===t["@id"],d.compareShortestLeast=(e,t)=>e.length<t.length?-1:t.length<e.length?1:e===t?0:e<t?-1:1},8121:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>Ze});var r=n(8346),i=Date.now(),o="fnValues"+i,a="fnStyle"+ ++i;var s=n(7121),c=function(e){return e&&e[s.Z]&&e===e[s.Z]()};var u=/;\n/,l=function(e){"string"==typeof e.style&&(e.style=function(e){for(var t={},n=e.split(u),r=0;r<n.length;r++){var i=(n[r]||"").trim();if(i){var o=i.indexOf(":");if(-1!==o){var a=i.substr(0,o).trim(),s=i.substr(o+1).trim();t[a]=s}}}return t}(e.style))};var d=n(7462),p="@global",f="@global ",h=function(){function e(e,t,n){for(var i in this.type="global",this.at=p,this.isProcessed=!1,this.key=e,this.options=n,this.rules=new r.RuleList((0,d.Z)({},n,{parent:this})),t)this.rules.add(i,t[i]);this.rules.process()}var t=e.prototype;return t.getRule=function(e){return this.rules.get(e)},t.addRule=function(e,t,n){var r=this.rules.add(e,t,n);return r&&this.options.jss.plugins.onProcessRule(r),r},t.replaceRule=function(e,t,n){var r=this.rules.replace(e,t,n);return r&&this.options.jss.plugins.onProcessRule(r),r},t.indexOf=function(e){return this.rules.indexOf(e)},t.toString=function(e){return this.rules.toString(e)},e}(),m=function(){function e(e,t,n){this.type="global",this.at=p,this.isProcessed=!1,this.key=e,this.options=n;var r=e.substr(f.length);this.rule=n.jss.createRule(r,t,(0,d.Z)({},n,{parent:this}))}return e.prototype.toString=function(e){return this.rule?this.rule.toString(e):""},e}(),g=/\s*,\s*/g;function v(e,t){for(var n=e.split(g),r="",i=0;i<n.length;i++)r+=t+" "+n[i].trim(),n[i+1]&&(r+=", ");return r}var y=function(e){return e&&"object"==typeof e&&!Array.isArray(e)},b="extendCurrValue"+Date.now();function w(e,t,n,r){return void 0===r&&(r={}),function(e,t,n,r){if("string"!=typeof e.extend)if(Array.isArray(e.extend))for(var i=0;i<e.extend.length;i++){var o=e.extend[i];w("string"==typeof o?(0,d.Z)({},e,{extend:o}):e.extend[i],t,n,r)}else for(var a in e.extend)"extend"!==a?y(e.extend[a])?(a in r||(r[a]={}),w(e.extend[a],t,n,r[a])):r[a]=e.extend[a]:w(e.extend.extend,t,n,r);else{if(!n)return;var s=n.getRule(e.extend);if(!s)return;if(s===t)return;var c=s.options.parent;c&&w(c.rules.raw[e.extend],t,n,r)}}(e,t,n,r),function(e,t,n,r){for(var i in e)"extend"!==i&&(y(r[i])&&y(e[i])?w(e[i],t,n,r[i]):y(e[i])?r[i]=w(e[i],t,n):r[i]=e[i])}(e,t,n,r),r}const x=function(){return{onProcessStyle:function(e,t,n){return"extend"in e?w(e,t,n):e},onChangeValue:function(e,t,n){if("extend"!==t)return e;if(null==e||!1===e){for(var r in n[b])n.prop(r,null);return n[b]=null,null}if("object"==typeof e){for(var i in e)n.prop(i,e[i]);n[b]=e}return null}}};var _=/\s*,\s*/g,E=/&/g,k=/\$([\w-]+)/g;const S=function(){function e(e,t){return function(n,r){var i=e.getRule(r)||t&&t.getRule(r);return i?i.selector:r}}function t(e,t){for(var n=t.split(_),r=e.split(_),i="",o=0;o<n.length;o++)for(var a=n[o],s=0;s<r.length;s++){var c=r[s];i&&(i+=", "),i+=-1!==c.indexOf("&")?c.replace(E,a):a+" "+c}return i}function n(e,t,n){if(n)return(0,d.Z)({},n,{index:n.index+1});var r=e.options.nestingLevel;r=void 0===r?1:r+1;var i=(0,d.Z)({},e.options,{nestingLevel:r,index:t.indexOf(e)+1});return delete i.name,i}return{onProcessStyle:function(r,i,o){if("style"!==i.type)return r;var a,s,c=i,u=c.options.parent;for(var l in r){var p=-1!==l.indexOf("&"),f="@"===l[0];if(p||f){if(a=n(c,u,a),p){var h=t(l,c.selector);s||(s=e(u,o)),h=h.replace(k,s);var m=c.key+"-"+l;"replaceRule"in u?u.replaceRule(m,r[l],(0,d.Z)({},a,{selector:h})):u.addRule(m,r[l],(0,d.Z)({},a,{selector:h}))}else f&&u.addRule(l,{},a).addRule(c.key,r[l],{selector:c.selector});delete r[l]}}return r}}};function C(e,t){if(!t)return!0;if(Array.isArray(t)){for(var n=0;n<t.length;n++)if(!C(e,t[n]))return!1;return!0}if(t.indexOf(" ")>-1)return C(e,t.split(" "));var r=e.options.parent;if("$"===t[0]){var i=r.getRule(t.substr(1));return!!i&&i!==e&&(r.classes[e.key]+=" "+r.classes[i.key],!0)}return r.classes[e.key]+=" "+t,!0}const A=function(){return{onProcessStyle:function(e,t){return"composes"in e?(C(t,e.composes),delete e.composes,e):e}}};var T=/[A-Z]/g,O=/^ms-/,P={};function I(e){return"-"+e.toLowerCase()}const j=function(e){if(P.hasOwnProperty(e))return P[e];var t=e.replace(T,I);return P[e]=O.test(t)?"-"+t:t};function N(e){var t={};for(var n in e)t[0===n.indexOf("--")?n:j(n)]=e[n];return e.fallbacks&&(Array.isArray(e.fallbacks)?t.fallbacks=e.fallbacks.map(N):t.fallbacks=N(e.fallbacks)),t}var F=r.hasCSSTOMSupport&&CSS?CSS.px:"px",R=r.hasCSSTOMSupport&&CSS?CSS.ms:"ms",L=r.hasCSSTOMSupport&&CSS?CSS.percent:"%";function D(e){var t=/(-[a-z])/g,n=function(e){return e[1].toUpperCase()},r={};for(var i in e)r[i]=e[i],r[i.replace(t,n)]=e[i];return r}var M=D({"animation-delay":R,"animation-duration":R,"background-position":F,"background-position-x":F,"background-position-y":F,"background-size":F,border:F,"border-bottom":F,"border-bottom-left-radius":F,"border-bottom-right-radius":F,"border-bottom-width":F,"border-left":F,"border-left-width":F,"border-radius":F,"border-right":F,"border-right-width":F,"border-top":F,"border-top-left-radius":F,"border-top-right-radius":F,"border-top-width":F,"border-width":F,"border-block":F,"border-block-end":F,"border-block-end-width":F,"border-block-start":F,"border-block-start-width":F,"border-block-width":F,"border-inline":F,"border-inline-end":F,"border-inline-end-width":F,"border-inline-start":F,"border-inline-start-width":F,"border-inline-width":F,"border-start-start-radius":F,"border-start-end-radius":F,"border-end-start-radius":F,"border-end-end-radius":F,margin:F,"margin-bottom":F,"margin-left":F,"margin-right":F,"margin-top":F,"margin-block":F,"margin-block-end":F,"margin-block-start":F,"margin-inline":F,"margin-inline-end":F,"margin-inline-start":F,padding:F,"padding-bottom":F,"padding-left":F,"padding-right":F,"padding-top":F,"padding-block":F,"padding-block-end":F,"padding-block-start":F,"padding-inline":F,"padding-inline-end":F,"padding-inline-start":F,"mask-position-x":F,"mask-position-y":F,"mask-size":F,height:F,width:F,"min-height":F,"max-height":F,"min-width":F,"max-width":F,bottom:F,left:F,top:F,right:F,inset:F,"inset-block":F,"inset-block-end":F,"inset-block-start":F,"inset-inline":F,"inset-inline-end":F,"inset-inline-start":F,"box-shadow":F,"text-shadow":F,"column-gap":F,"column-rule":F,"column-rule-width":F,"column-width":F,"font-size":F,"font-size-delta":F,"letter-spacing":F,"text-decoration-thickness":F,"text-indent":F,"text-stroke":F,"text-stroke-width":F,"word-spacing":F,motion:F,"motion-offset":F,outline:F,"outline-offset":F,"outline-width":F,perspective:F,"perspective-origin-x":L,"perspective-origin-y":L,"transform-origin":L,"transform-origin-x":L,"transform-origin-y":L,"transform-origin-z":L,"transition-delay":R,"transition-duration":R,"vertical-align":F,"flex-basis":F,"shape-margin":F,size:F,gap:F,grid:F,"grid-gap":F,"row-gap":F,"grid-row-gap":F,"grid-column-gap":F,"grid-template-rows":F,"grid-template-columns":F,"grid-auto-rows":F,"grid-auto-columns":F,"box-shadow-x":F,"box-shadow-y":F,"box-shadow-blur":F,"box-shadow-spread":F,"font-line-height":F,"text-shadow-x":F,"text-shadow-y":F,"text-shadow-blur":F});function U(e,t,n){if(null==t)return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)t[r]=U(e,t[r],n);else if("object"==typeof t)if("fallbacks"===e)for(var i in t)t[i]=U(i,t[i],n);else for(var o in t)t[o]=U(e+"-"+o,t[o],n);else if("number"==typeof t&&!1===isNaN(t)){var a=n[e]||M[e];return!a||0===t&&a===F?t.toString():"function"==typeof a?a(t).toString():""+t+a}return t}const B=function(e){void 0===e&&(e={});var t=D(e);return{onProcessStyle:function(e,n){if("style"!==n.type)return e;for(var r in e)e[r]=U(r,e[r],t);return e},onChangeValue:function(e,n){return U(n,e,t)}}};var H={"background-size":!0,"background-position":!0,border:!0,"border-bottom":!0,"border-left":!0,"border-top":!0,"border-right":!0,"border-radius":!0,"border-image":!0,"border-width":!0,"border-style":!0,"border-color":!0,"box-shadow":!0,flex:!0,margin:!0,padding:!0,outline:!0,"transform-origin":!0,transform:!0,transition:!0},q={position:!0,size:!0},W={padding:{top:0,right:0,bottom:0,left:0},margin:{top:0,right:0,bottom:0,left:0},background:{attachment:null,color:null,image:null,position:null,repeat:null},border:{width:null,style:null,color:null},"border-top":{width:null,style:null,color:null},"border-right":{width:null,style:null,color:null},"border-bottom":{width:null,style:null,color:null},"border-left":{width:null,style:null,color:null},outline:{width:null,style:null,color:null},"list-style":{type:null,position:null,image:null},transition:{property:null,duration:null,"timing-function":null,timingFunction:null,delay:null},animation:{name:null,duration:null,"timing-function":null,timingFunction:null,delay:null,"iteration-count":null,iterationCount:null,direction:null,"fill-mode":null,fillMode:null,"play-state":null,playState:null},"box-shadow":{x:0,y:0,blur:0,spread:0,color:null,inset:null},"text-shadow":{x:0,y:0,blur:null,color:null}},K={border:{radius:"border-radius",image:"border-image",width:"border-width",style:"border-style",color:"border-color"},"border-bottom":{width:"border-bottom-width",style:"border-bottom-style",color:"border-bottom-color"},"border-top":{width:"border-top-width",style:"border-top-style",color:"border-top-color"},"border-left":{width:"border-left-width",style:"border-left-style",color:"border-left-color"},"border-right":{width:"border-right-width",style:"border-right-style",color:"border-right-color"},background:{size:"background-size",image:"background-image"},font:{style:"font-style",variant:"font-variant",weight:"font-weight",stretch:"font-stretch",size:"font-size",family:"font-family",lineHeight:"line-height","line-height":"line-height"},flex:{grow:"flex-grow",basis:"flex-basis",direction:"flex-direction",wrap:"flex-wrap",flow:"flex-flow",shrink:"flex-shrink"},align:{self:"align-self",items:"align-items",content:"align-content"},grid:{"template-columns":"grid-template-columns",templateColumns:"grid-template-columns","template-rows":"grid-template-rows",templateRows:"grid-template-rows","template-areas":"grid-template-areas",templateAreas:"grid-template-areas",template:"grid-template","auto-columns":"grid-auto-columns",autoColumns:"grid-auto-columns","auto-rows":"grid-auto-rows",autoRows:"grid-auto-rows","auto-flow":"grid-auto-flow",autoFlow:"grid-auto-flow",row:"grid-row",column:"grid-column","row-start":"grid-row-start",rowStart:"grid-row-start","row-end":"grid-row-end",rowEnd:"grid-row-end","column-start":"grid-column-start",columnStart:"grid-column-start","column-end":"grid-column-end",columnEnd:"grid-column-end",area:"grid-area",gap:"grid-gap","row-gap":"grid-row-gap",rowGap:"grid-row-gap","column-gap":"grid-column-gap",columnGap:"grid-column-gap"}};function V(e,t,n,r){return null==n[t]?e:0===e.length?[]:Array.isArray(e[0])?V(e[0],t,n,r):"object"==typeof e[0]?function(e,t,n){return e.map((function(e){return J(e,t,n,!1,!0)}))}(e,t,r):[e]}function J(e,t,n,r,i){if(!W[t]&&!K[t])return[];var o=[];if(K[t]&&(e=function(e,t,n,r){for(var i in n){var o=n[i];if(void 0!==e[i]&&(r||!t.prop(o))){var a,s=z((a={},a[o]=e[i],a),t)[o];r?t.style.fallbacks[o]=s:t.style[o]=s}delete e[i]}return e}(e,n,K[t],r)),Object.keys(e).length)for(var a in W[t])e[a]?Array.isArray(e[a])?o.push(null===q[a]?e[a]:e[a].join(" ")):o.push(e[a]):null!=W[t][a]&&o.push(W[t][a]);return!o.length||i?o:[o]}function z(e,t,n){for(var r in e){var i=e[r];if(Array.isArray(i)){if(!Array.isArray(i[0])){if("fallbacks"===r){for(var o=0;o<e.fallbacks.length;o++)e.fallbacks[o]=z(e.fallbacks[o],t,!0);continue}e[r]=V(i,r,H,t),e[r].length||delete e[r]}}else if("object"==typeof i){if("fallbacks"===r){e.fallbacks=z(e.fallbacks,t,!0);continue}e[r]=J(i,r,t,n),e[r].length||delete e[r]}else""===e[r]&&delete e[r]}return e}var Z=n(3827);function $(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var G="",X="",Q="",Y="",ee=Z.Z&&"ontouchstart"in document.documentElement;if(Z.Z){var te={Moz:"-moz-",ms:"-ms-",O:"-o-",Webkit:"-webkit-"},ne=document.createElement("p").style;for(var re in te)if(re+"Transform"in ne){G=re,X=te[re];break}"Webkit"===G&&"msHyphens"in ne&&(G="ms",X=te.ms,Y="edge"),"Webkit"===G&&"-apple-trailing-word"in ne&&(Q="apple")}var ie=G,oe=X,ae=Q,se=Y,ce=ee,ue={noPrefill:["appearance"],supportedProperty:function(e){return"appearance"===e&&("ms"===ie?"-webkit-"+e:oe+e)}},le={noPrefill:["color-adjust"],supportedProperty:function(e){return"color-adjust"===e&&("Webkit"===ie?oe+"print-"+e:e)}},de=/[-\s]+(.)?/g;function pe(e,t){return t?t.toUpperCase():""}function fe(e){return e.replace(de,pe)}function he(e){return fe("-"+e)}var me,ge={noPrefill:["mask"],supportedProperty:function(e,t){if(!/^mask/.test(e))return!1;if("Webkit"===ie){var n="mask-image";if(fe(n)in t)return e;if(ie+he(n)in t)return oe+e}return e}},ve={noPrefill:["text-orientation"],supportedProperty:function(e){return"text-orientation"===e&&("apple"!==ae||ce?e:oe+e)}},ye={noPrefill:["transform"],supportedProperty:function(e,t,n){return"transform"===e&&(n.transform?e:oe+e)}},be={noPrefill:["transition"],supportedProperty:function(e,t,n){return"transition"===e&&(n.transition?e:oe+e)}},we={noPrefill:["writing-mode"],supportedProperty:function(e){return"writing-mode"===e&&("Webkit"===ie||"ms"===ie&&"edge"!==se?oe+e:e)}},xe={noPrefill:["user-select"],supportedProperty:function(e){return"user-select"===e&&("Moz"===ie||"ms"===ie||"apple"===ae?oe+e:e)}},_e={supportedProperty:function(e,t){return!!/^break-/.test(e)&&("Webkit"===ie?"WebkitColumn"+he(e)in t&&oe+"column-"+e:"Moz"===ie&&"page"+he(e)in t&&"page-"+e)}},Ee={supportedProperty:function(e,t){if(!/^(border|margin|padding)-inline/.test(e))return!1;if("Moz"===ie)return e;var n=e.replace("-inline","");return ie+he(n)in t&&oe+n}},ke={supportedProperty:function(e,t){return fe(e)in t&&e}},Se={supportedProperty:function(e,t){var n=he(e);return"-"===e[0]||"-"===e[0]&&"-"===e[1]?e:ie+n in t?oe+e:"Webkit"!==ie&&"Webkit"+n in t&&"-webkit-"+e}},Ce={supportedProperty:function(e){return"scroll-snap"===e.substring(0,11)&&("ms"===ie?""+oe+e:e)}},Ae={supportedProperty:function(e){return"overscroll-behavior"===e&&("ms"===ie?oe+"scroll-chaining":e)}},Te={"flex-grow":"flex-positive","flex-shrink":"flex-negative","flex-basis":"flex-preferred-size","justify-content":"flex-pack",order:"flex-order","align-items":"flex-align","align-content":"flex-line-pack"},Oe={supportedProperty:function(e,t){var n=Te[e];return!!n&&ie+he(n)in t&&oe+n}},Pe={flex:"box-flex","flex-grow":"box-flex","flex-direction":["box-orient","box-direction"],order:"box-ordinal-group","align-items":"box-align","flex-flow":["box-orient","box-direction"],"justify-content":"box-pack"},Ie=Object.keys(Pe),je=function(e){return oe+e},Ne={supportedProperty:function(e,t,n){var r=n.multiple;if(Ie.indexOf(e)>-1){var i=Pe[e];if(!Array.isArray(i))return ie+he(i)in t&&oe+i;if(!r)return!1;for(var o=0;o<i.length;o++)if(!(ie+he(i[0])in t))return!1;return i.map(je)}return!1}},Fe=[ue,le,ge,ve,ye,be,we,xe,_e,Ee,ke,Se,Ce,Ae,Oe,Ne],Re=Fe.filter((function(e){return e.supportedProperty})).map((function(e){return e.supportedProperty})),Le=Fe.filter((function(e){return e.noPrefill})).reduce((function(e,t){return e.push.apply(e,function(e){if(Array.isArray(e))return $(e)}(n=t.noPrefill)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||function(e,t){if(e){if("string"==typeof e)return $(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$(e,t):void 0}}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),e;var n}),[]),De={};if(Z.Z){me=document.createElement("p");var Me=window.getComputedStyle(document.documentElement,"");for(var Ue in Me)isNaN(Ue)||(De[Me[Ue]]=Me[Ue]);Le.forEach((function(e){return delete De[e]}))}function Be(e,t){if(void 0===t&&(t={}),!me)return e;if(null!=De[e])return De[e];"transition"!==e&&"transform"!==e||(t[e]=e in me.style);for(var n=0;n<Re.length&&(De[e]=Re[n](e,me.style,t),!De[e]);n++);try{me.style[e]=""}catch(e){return!1}return De[e]}var He,qe={},We={transition:1,"transition-property":1,"-webkit-transition":1,"-webkit-transition-property":1},Ke=/(^\s*[\w-]+)|, (\s*[\w-]+)(?![^()]*\))/g;function Ve(e,t,n){return"var"===t?"var":"all"===t?"all":"all"===n?", all":(t?Be(t):", "+Be(n))||t||n}function Je(e,t){var n=t;if(!He||"content"===e)return t;if("string"!=typeof n||!isNaN(parseInt(n,10)))return n;var r=e+n;if(null!=qe[r])return qe[r];try{He.style[e]=n}catch(e){return qe[r]=!1,!1}if(We[e])n=n.replace(Ke,Ve);else if(""===He.style[e]&&("-ms-flex"===(n=oe+n)&&(He.style[e]="-ms-flexbox"),He.style[e]=n,""===He.style[e]))return qe[r]=!1,!1;return He.style[e]="",qe[r]=n,qe[r]}Z.Z&&(He=document.createElement("p"));const ze=function(){function e(t){for(var n in t){var i=t[n];if("fallbacks"===n&&Array.isArray(i))t[n]=i.map(e);else{var o=!1,a=Be(n);a&&a!==n&&(o=!0);var s=!1,c=Je(a,(0,r.toCssValue)(i));c&&c!==i&&(s=!0),(o||s)&&(o&&delete t[n],t[a||n]=c||i)}}return t}return{onProcessRule:function(e){if("keyframes"===e.type){var t=e;t.at=function(e){return"-"===e[1]||"ms"===ie?e:"@"+oe+"keyframes"+e.substr(10)}(t.at)}},onProcessStyle:function(t,n){return"style"!==n.type?t:e(t)},onChangeValue:function(e,t){return Je(t,(0,r.toCssValue)(e))||e}}},Ze=function(e){return void 0===e&&(e={}),{plugins:[{onCreateRule:function(e,t,n){if("function"!=typeof t)return null;var i=(0,r.createRule)(e,{},n);return i[a]=t,i},onProcessStyle:function(e,t){if(o in t||a in t)return e;var n={};for(var r in e){var i=e[r];"function"==typeof i&&(delete e[r],n[r]=i)}return t[o]=n,e},onUpdate:function(e,t,n,r){var i=t,s=i[a];s&&(i.style=s(e)||{});var c=i[o];if(c)for(var u in c)i.prop(u,c[u](e),r)}},(n=e.observable,{onCreateRule:function(e,t,i){if(!c(t))return null;var o=t,a=(0,r.createRule)(e,{},i);return o.subscribe((function(e){for(var t in e)a.prop(t,e[t],n)})),a},onProcessRule:function(e){if(!e||"style"===e.type){var t=e,r=t.style,i=function(e){var i=r[e];if(!c(i))return"continue";delete r[e],i.subscribe({next:function(r){t.prop(e,r,n)}})};for(var o in r)i(o)}}}),{onProcessRule:l},{onCreateRule:function(e,t,n){if(!e)return null;if(e===p)return new h(e,t,n);if("@"===e[0]&&e.substr(0,f.length)===f)return new m(e,t,n);var r=n.parent;return r&&("global"===r.type||r.options.parent&&"global"===r.options.parent.type)&&(n.scoped=!1),n.selector||!1!==n.scoped||(n.selector=e),null},onProcessRule:function(e,t){"style"===e.type&&t&&(function(e,t){var n=e.options,r=e.style,i=r?r[p]:null;if(i){for(var o in i)t.addRule(o,i[o],(0,d.Z)({},n,{selector:v(o,e.selector)}));delete r[p]}}(e,t),function(e,t){var n=e.options,r=e.style;for(var i in r)if("@"===i[0]&&i.substr(0,p.length)===p){var o=v(i.substr(p.length),e.selector);t.addRule(o,r[i],(0,d.Z)({},n,{selector:o})),delete r[i]}}(e,t))}},x(),S(),A(),{onProcessStyle:function(e){if(Array.isArray(e)){for(var t=0;t<e.length;t++)e[t]=N(e[t]);return e}return N(e)},onChangeValue:function(e,t,n){if(0===t.indexOf("--"))return e;var r=j(t);return t===r?e:(n.prop(r,e),null)}},B(e.defaultUnit),{onProcessStyle:function(e,t){if(!e||"style"!==t.type)return e;if(Array.isArray(e)){for(var n=0;n<e.length;n++)e[n]=z(e[n],t);return e}return z(e,t)}},ze(),(t=function(e,t){return e.length===t.length?e>t?1:-1:e.length-t.length},{onProcessStyle:function(e,n){if("style"!==n.type)return e;for(var r={},i=Object.keys(e).sort(t),o=0;o<i.length;o++)r[i[o]]=e[i[o]];return r}})]};var t,n}},8346:(e,t,n)=>{"use strict";n.r(t),n.d(t,{RuleList:()=>Z,SheetsManager:()=>ge,SheetsRegistry:()=>X,create:()=>me,createGenerateId:()=>ne,createRule:()=>d,default:()=>be,getDynamicStyles:()=>ye,hasCSSTOMSupport:()=>ve,sheets:()=>Q,toCssValue:()=>f});var r=n(7462),i=n(3827);var o=n(3144),a=n(9611);function s(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,(0,a.Z)(e,t)}var c=n(7326),u={}.constructor;function l(e){if(null==e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(l);if(e.constructor!==u)return e;var t={};for(var n in e)t[n]=l(e[n]);return t}function d(e,t,n){void 0===e&&(e="unnamed");var r=n.jss,i=l(t);return r.plugins.onCreateRule(e,i,n)||(e[0],null)}var p=function(e,t){for(var n="",r=0;r<e.length&&"!important"!==e[r];r++)n&&(n+=t),n+=e[r];return n},f=function(e){if(!Array.isArray(e))return e;var t="";if(Array.isArray(e[0]))for(var n=0;n<e.length&&"!important"!==e[n];n++)t&&(t+=", "),t+=p(e[n]," ");else t=p(e,", ");return"!important"===e[e.length-1]&&(t+=" !important"),t};function h(e){return e&&!1===e.format?{linebreak:"",space:""}:{linebreak:"\n",space:" "}}function m(e,t){for(var n="",r=0;r<t;r++)n+=" ";return n+e}function g(e,t,n){void 0===n&&(n={});var r="";if(!t)return r;var i=n.indent,o=void 0===i?0:i,a=t.fallbacks;!1===n.format&&(o=-1/0);var s=h(n),c=s.linebreak,u=s.space;if(e&&o++,a)if(Array.isArray(a))for(var l=0;l<a.length;l++){var d=a[l];for(var p in d){var g=d[p];null!=g&&(r&&(r+=c),r+=m(p+":"+u+f(g)+";",o))}}else for(var v in a){var y=a[v];null!=y&&(r&&(r+=c),r+=m(v+":"+u+f(y)+";",o))}for(var b in t){var w=t[b];null!=w&&"fallbacks"!==b&&(r&&(r+=c),r+=m(b+":"+u+f(w)+";",o))}return(r||n.allowEmpty)&&e?(r&&(r=""+c+r+c),m(""+e+u+"{"+r,--o)+m("}",o)):r}var v=/([[\].#*$><+~=|^:(),"'`\s])/g,y="undefined"!=typeof CSS&&CSS.escape,b=function(e){return y?y(e):e.replace(v,"\\$1")},w=function(){function e(e,t,n){this.type="style",this.isProcessed=!1;var r=n.sheet,i=n.Renderer;this.key=e,this.options=n,this.style=t,r?this.renderer=r.renderer:i&&(this.renderer=new i)}return e.prototype.prop=function(e,t,n){if(void 0===t)return this.style[e];var r=!!n&&n.force;if(!r&&this.style[e]===t)return this;var i=t;n&&!1===n.process||(i=this.options.jss.plugins.onChangeValue(t,e,this));var o=null==i||!1===i,a=e in this.style;if(o&&!a&&!r)return this;var s=o&&a;if(s?delete this.style[e]:this.style[e]=i,this.renderable&&this.renderer)return s?this.renderer.removeProperty(this.renderable,e):this.renderer.setProperty(this.renderable,e,i),this;var c=this.options.sheet;return c&&c.attached,this},e}(),x=function(e){function t(t,n,r){var i;i=e.call(this,t,n,r)||this;var o=r.selector,a=r.scoped,s=r.sheet,u=r.generateId;return o?i.selectorText=o:!1!==a&&(i.id=u((0,c.Z)((0,c.Z)(i)),s),i.selectorText="."+b(i.id)),i}s(t,e);var n=t.prototype;return n.applyTo=function(e){var t=this.renderer;if(t){var n=this.toJSON();for(var r in n)t.setProperty(e,r,n[r])}return this},n.toJSON=function(){var e={};for(var t in this.style){var n=this.style[t];"object"!=typeof n?e[t]=n:Array.isArray(n)&&(e[t]=f(n))}return e},n.toString=function(e){var t=this.options.sheet,n=t&&t.options.link?(0,r.Z)({},e,{allowEmpty:!0}):e;return g(this.selectorText,this.style,n)},(0,o.Z)(t,[{key:"selector",set:function(e){if(e!==this.selectorText){this.selectorText=e;var t=this.renderer,n=this.renderable;n&&t&&(t.setSelector(n,e)||t.replaceRule(n,this))}},get:function(){return this.selectorText}}]),t}(w),_={onCreateRule:function(e,t,n){return"@"===e[0]||n.parent&&"keyframes"===n.parent.type?null:new x(e,t,n)}},E={indent:1,children:!0},k=/@([\w-]+)/,S=function(){function e(e,t,n){this.type="conditional",this.isProcessed=!1,this.key=e;var i=e.match(k);for(var o in this.at=i?i[1]:"unknown",this.query=n.name||"@"+this.at,this.options=n,this.rules=new Z((0,r.Z)({},n,{parent:this})),t)this.rules.add(o,t[o]);this.rules.process()}var t=e.prototype;return t.getRule=function(e){return this.rules.get(e)},t.indexOf=function(e){return this.rules.indexOf(e)},t.addRule=function(e,t,n){var r=this.rules.add(e,t,n);return r?(this.options.jss.plugins.onProcessRule(r),r):null},t.replaceRule=function(e,t,n){var r=this.rules.replace(e,t,n);return r&&this.options.jss.plugins.onProcessRule(r),r},t.toString=function(e){void 0===e&&(e=E);var t=h(e).linebreak;if(null==e.indent&&(e.indent=E.indent),null==e.children&&(e.children=E.children),!1===e.children)return this.query+" {}";var n=this.rules.toString(e);return n?this.query+" {"+t+n+t+"}":""},e}(),C=/@container|@media|@supports\s+/,A={onCreateRule:function(e,t,n){return C.test(e)?new S(e,t,n):null}},T={indent:1,children:!0},O=/@keyframes\s+([\w-]+)/,P=function(){function e(e,t,n){this.type="keyframes",this.at="@keyframes",this.isProcessed=!1;var i=e.match(O);i&&i[1]?this.name=i[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=n;var o=n.scoped,a=n.sheet,s=n.generateId;for(var c in this.id=!1===o?this.name:b(s(this,a)),this.rules=new Z((0,r.Z)({},n,{parent:this})),t)this.rules.add(c,t[c],(0,r.Z)({},n,{parent:this}));this.rules.process()}return e.prototype.toString=function(e){void 0===e&&(e=T);var t=h(e).linebreak;if(null==e.indent&&(e.indent=T.indent),null==e.children&&(e.children=T.children),!1===e.children)return this.at+" "+this.id+" {}";var n=this.rules.toString(e);return n&&(n=""+t+n+t),this.at+" "+this.id+" {"+n+"}"},e}(),I=/@keyframes\s+/,j=/\$([\w-]+)/g,N=function(e,t){return"string"==typeof e?e.replace(j,(function(e,n){return n in t?t[n]:e})):e},F=function(e,t,n){var r=e[t],i=N(r,n);i!==r&&(e[t]=i)},R={onCreateRule:function(e,t,n){return"string"==typeof e&&I.test(e)?new P(e,t,n):null},onProcessStyle:function(e,t,n){return"style"===t.type&&n?("animation-name"in e&&F(e,"animation-name",n.keyframes),"animation"in e&&F(e,"animation",n.keyframes),e):e},onChangeValue:function(e,t,n){var r=n.options.sheet;if(!r)return e;switch(t){case"animation":case"animation-name":return N(e,r.keyframes);default:return e}}},L=function(e){function t(){return e.apply(this,arguments)||this}return s(t,e),t.prototype.toString=function(e){var t=this.options.sheet,n=t&&t.options.link?(0,r.Z)({},e,{allowEmpty:!0}):e;return g(this.key,this.style,n)},t}(w),D={onCreateRule:function(e,t,n){return n.parent&&"keyframes"===n.parent.type?new L(e,t,n):null}},M=function(){function e(e,t,n){this.type="font-face",this.at="@font-face",this.isProcessed=!1,this.key=e,this.style=t,this.options=n}return e.prototype.toString=function(e){var t=h(e).linebreak;if(Array.isArray(this.style)){for(var n="",r=0;r<this.style.length;r++)n+=g(this.at,this.style[r]),this.style[r+1]&&(n+=t);return n}return g(this.at,this.style,e)},e}(),U=/@font-face/,B={onCreateRule:function(e,t,n){return U.test(e)?new M(e,t,n):null}},H=function(){function e(e,t,n){this.type="viewport",this.at="@viewport",this.isProcessed=!1,this.key=e,this.style=t,this.options=n}return e.prototype.toString=function(e){return g(this.key,this.style,e)},e}(),q={onCreateRule:function(e,t,n){return"@viewport"===e||"@-ms-viewport"===e?new H(e,t,n):null}},W=function(){function e(e,t,n){this.type="simple",this.isProcessed=!1,this.key=e,this.value=t,this.options=n}return e.prototype.toString=function(e){if(Array.isArray(this.value)){for(var t="",n=0;n<this.value.length;n++)t+=this.key+" "+this.value[n]+";",this.value[n+1]&&(t+="\n");return t}return this.key+" "+this.value+";"},e}(),K={"@charset":!0,"@import":!0,"@namespace":!0},V=[_,A,R,D,B,q,{onCreateRule:function(e,t,n){return e in K?new W(e,t,n):null}}],J={process:!0},z={force:!0,process:!0},Z=function(){function e(e){this.map={},this.raw={},this.index=[],this.counter=0,this.options=e,this.classes=e.classes,this.keyframes=e.keyframes}var t=e.prototype;return t.add=function(e,t,n){var i=this.options,o=i.parent,a=i.sheet,s=i.jss,c=i.Renderer,u=i.generateId,l=i.scoped,p=(0,r.Z)({classes:this.classes,parent:o,sheet:a,jss:s,Renderer:c,generateId:u,scoped:l,name:e,keyframes:this.keyframes,selector:void 0},n),f=e;e in this.raw&&(f=e+"-d"+this.counter++),this.raw[f]=t,f in this.classes&&(p.selector="."+b(this.classes[f]));var h=d(f,t,p);if(!h)return null;this.register(h);var m=void 0===p.index?this.index.length:p.index;return this.index.splice(m,0,h),h},t.replace=function(e,t,n){var i=this.get(e),o=this.index.indexOf(i);i&&this.remove(i);var a=n;return-1!==o&&(a=(0,r.Z)({},n,{index:o})),this.add(e,t,a)},t.get=function(e){return this.map[e]},t.remove=function(e){this.unregister(e),delete this.raw[e.key],this.index.splice(this.index.indexOf(e),1)},t.indexOf=function(e){return this.index.indexOf(e)},t.process=function(){var e=this.options.jss.plugins;this.index.slice(0).forEach(e.onProcessRule,e)},t.register=function(e){this.map[e.key]=e,e instanceof x?(this.map[e.selector]=e,e.id&&(this.classes[e.key]=e.id)):e instanceof P&&this.keyframes&&(this.keyframes[e.name]=e.id)},t.unregister=function(e){delete this.map[e.key],e instanceof x?(delete this.map[e.selector],delete this.classes[e.key]):e instanceof P&&delete this.keyframes[e.name]},t.update=function(){var e,t,n;if("string"==typeof(arguments.length<=0?void 0:arguments[0])?(e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],n=arguments.length<=2?void 0:arguments[2]):(t=arguments.length<=0?void 0:arguments[0],n=arguments.length<=1?void 0:arguments[1],e=null),e)this.updateOne(this.get(e),t,n);else for(var r=0;r<this.index.length;r++)this.updateOne(this.index[r],t,n)},t.updateOne=function(t,n,r){void 0===r&&(r=J);var i=this.options,o=i.jss.plugins,a=i.sheet;if(t.rules instanceof e)t.rules.update(n,r);else{var s=t.style;if(o.onUpdate(n,t,a,r),r.process&&s&&s!==t.style){for(var c in o.onProcessStyle(t.style,t,a),t.style){var u=t.style[c];u!==s[c]&&t.prop(c,u,z)}for(var l in s){var d=t.style[l],p=s[l];null==d&&d!==p&&t.prop(l,null,z)}}}},t.toString=function(e){for(var t="",n=this.options.sheet,r=!!n&&n.options.link,i=h(e).linebreak,o=0;o<this.index.length;o++){var a=this.index[o].toString(e);(a||r)&&(t&&(t+=i),t+=a)}return t},e}(),$=function(){function e(e,t){for(var n in this.attached=!1,this.deployed=!1,this.classes={},this.keyframes={},this.options=(0,r.Z)({},t,{sheet:this,parent:this,classes:this.classes,keyframes:this.keyframes}),t.Renderer&&(this.renderer=new t.Renderer(this)),this.rules=new Z(this.options),e)this.rules.add(n,e[n]);this.rules.process()}var t=e.prototype;return t.attach=function(){return this.attached||(this.renderer&&this.renderer.attach(),this.attached=!0,this.deployed||this.deploy()),this},t.detach=function(){return this.attached?(this.renderer&&this.renderer.detach(),this.attached=!1,this):this},t.addRule=function(e,t,n){var r=this.queue;this.attached&&!r&&(this.queue=[]);var i=this.rules.add(e,t,n);return i?(this.options.jss.plugins.onProcessRule(i),this.attached?this.deployed?(r?r.push(i):(this.insertRule(i),this.queue&&(this.queue.forEach(this.insertRule,this),this.queue=void 0)),i):i:(this.deployed=!1,i)):null},t.replaceRule=function(e,t,n){var r=this.rules.get(e);if(!r)return this.addRule(e,t,n);var i=this.rules.replace(e,t,n);return i&&this.options.jss.plugins.onProcessRule(i),this.attached?this.deployed?(this.renderer&&(i?r.renderable&&this.renderer.replaceRule(r.renderable,i):this.renderer.deleteRule(r)),i):i:(this.deployed=!1,i)},t.insertRule=function(e){this.renderer&&this.renderer.insertRule(e)},t.addRules=function(e,t){var n=[];for(var r in e){var i=this.addRule(r,e[r],t);i&&n.push(i)}return n},t.getRule=function(e){return this.rules.get(e)},t.deleteRule=function(e){var t="object"==typeof e?e:this.rules.get(e);return!(!t||this.attached&&!t.renderable)&&(this.rules.remove(t),!(this.attached&&t.renderable&&this.renderer)||this.renderer.deleteRule(t.renderable))},t.indexOf=function(e){return this.rules.indexOf(e)},t.deploy=function(){return this.renderer&&this.renderer.deploy(),this.deployed=!0,this},t.update=function(){var e;return(e=this.rules).update.apply(e,arguments),this},t.updateOne=function(e,t,n){return this.rules.updateOne(e,t,n),this},t.toString=function(e){return this.rules.toString(e)},e}(),G=function(){function e(){this.plugins={internal:[],external:[]},this.registry={}}var t=e.prototype;return t.onCreateRule=function(e,t,n){for(var r=0;r<this.registry.onCreateRule.length;r++){var i=this.registry.onCreateRule[r](e,t,n);if(i)return i}return null},t.onProcessRule=function(e){if(!e.isProcessed){for(var t=e.options.sheet,n=0;n<this.registry.onProcessRule.length;n++)this.registry.onProcessRule[n](e,t);e.style&&this.onProcessStyle(e.style,e,t),e.isProcessed=!0}},t.onProcessStyle=function(e,t,n){for(var r=0;r<this.registry.onProcessStyle.length;r++)t.style=this.registry.onProcessStyle[r](t.style,t,n)},t.onProcessSheet=function(e){for(var t=0;t<this.registry.onProcessSheet.length;t++)this.registry.onProcessSheet[t](e)},t.onUpdate=function(e,t,n,r){for(var i=0;i<this.registry.onUpdate.length;i++)this.registry.onUpdate[i](e,t,n,r)},t.onChangeValue=function(e,t,n){for(var r=e,i=0;i<this.registry.onChangeValue.length;i++)r=this.registry.onChangeValue[i](r,t,n);return r},t.use=function(e,t){void 0===t&&(t={queue:"external"});var n=this.plugins[t.queue];-1===n.indexOf(e)&&(n.push(e),this.registry=[].concat(this.plugins.external,this.plugins.internal).reduce((function(e,t){for(var n in t)n in e&&e[n].push(t[n]);return e}),{onCreateRule:[],onProcessRule:[],onProcessStyle:[],onProcessSheet:[],onChangeValue:[],onUpdate:[]}))},e}(),X=function(){function e(){this.registry=[]}var t=e.prototype;return t.add=function(e){var t=this.registry,n=e.options.index;if(-1===t.indexOf(e))if(0===t.length||n>=this.index)t.push(e);else for(var r=0;r<t.length;r++)if(t[r].options.index>n)return void t.splice(r,0,e)},t.reset=function(){this.registry=[]},t.remove=function(e){var t=this.registry.indexOf(e);this.registry.splice(t,1)},t.toString=function(e){for(var t=void 0===e?{}:e,n=t.attached,r=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(t,["attached"]),i=h(r).linebreak,o="",a=0;a<this.registry.length;a++){var s=this.registry[a];null!=n&&s.attached!==n||(o&&(o+=i),o+=s.toString(r))}return o},(0,o.Z)(e,[{key:"index",get:function(){return 0===this.registry.length?0:this.registry[this.registry.length-1].options.index}}]),e}(),Q=new X,Y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window&&window.Math===Math?window:"undefined"!=typeof self&&self.Math===Math?self:Function("return this")(),ee="2f1acc6c3a606b082e5eef5e54414ffb";null==Y[ee]&&(Y[ee]=0);var te=Y[ee]++,ne=function(e){void 0===e&&(e={});var t=0;return function(n,r){t+=1;var i="",o="";return r&&(r.options.classNamePrefix&&(o=r.options.classNamePrefix),null!=r.options.jss.id&&(i=String(r.options.jss.id))),e.minify?""+(o||"c")+te+i+t:o+n.key+"-"+te+(i?"-"+i:"")+"-"+t}},re=function(e){var t;return function(){return t||(t=e()),t}},ie=function(e,t){try{return e.attributeStyleMap?e.attributeStyleMap.get(t):e.style.getPropertyValue(t)}catch(e){return""}},oe=function(e,t,n){try{var r=n;if(Array.isArray(n)&&(r=f(n)),e.attributeStyleMap)e.attributeStyleMap.set(t,r);else{var i=r?r.indexOf("!important"):-1,o=i>-1?r.substr(0,i-1):r;e.style.setProperty(t,o,i>-1?"important":"")}}catch(e){return!1}return!0},ae=function(e,t){try{e.attributeStyleMap?e.attributeStyleMap.delete(t):e.style.removeProperty(t)}catch(e){}},se=function(e,t){return e.selectorText=t,e.selectorText===t},ce=re((function(){return document.querySelector("head")}));var ue=re((function(){var e=document.querySelector('meta[property="csp-nonce"]');return e?e.getAttribute("content"):null})),le=function(e,t,n){try{"insertRule"in e?e.insertRule(t,n):"appendRule"in e&&e.appendRule(t)}catch(e){return!1}return e.cssRules[n]},de=function(e,t){var n=e.cssRules.length;return void 0===t||t>n?n:t},pe=function(){function e(e){this.getPropertyValue=ie,this.setProperty=oe,this.removeProperty=ae,this.setSelector=se,this.hasInsertedRules=!1,this.cssRules=[],e&&Q.add(e),this.sheet=e;var t,n=this.sheet?this.sheet.options:{},r=n.media,i=n.meta,o=n.element;this.element=o||((t=document.createElement("style")).textContent="\n",t),this.element.setAttribute("data-jss",""),r&&this.element.setAttribute("media",r),i&&this.element.setAttribute("data-meta",i);var a=ue();a&&this.element.setAttribute("nonce",a)}var t=e.prototype;return t.attach=function(){if(!this.element.parentNode&&this.sheet){!function(e,t){var n=t.insertionPoint,r=function(e){var t=Q.registry;if(t.length>0){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.attached&&r.options.index>t.index&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if(n=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.attached&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e),n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}var r=e.insertionPoint;if(r&&"string"==typeof r){var i=function(e){for(var t=ce(),n=0;n<t.childNodes.length;n++){var r=t.childNodes[n];if(8===r.nodeType&&r.nodeValue.trim()===e)return r}return null}(r);if(i)return{parent:i.parentNode,node:i.nextSibling}}return!1}(t);if(!1!==r&&r.parent)r.parent.insertBefore(e,r.node);else if(n&&"number"==typeof n.nodeType){var i=n,o=i.parentNode;o&&o.insertBefore(e,i.nextSibling)}else ce().appendChild(e)}(this.element,this.sheet.options);var e=Boolean(this.sheet&&this.sheet.deployed);this.hasInsertedRules&&e&&(this.hasInsertedRules=!1,this.deploy())}},t.detach=function(){if(this.sheet){var e=this.element.parentNode;e&&e.removeChild(this.element),this.sheet.options.link&&(this.cssRules=[],this.element.textContent="\n")}},t.deploy=function(){var e=this.sheet;e&&(e.options.link?this.insertRules(e.rules):this.element.textContent="\n"+e.toString()+"\n")},t.insertRules=function(e,t){for(var n=0;n<e.index.length;n++)this.insertRule(e.index[n],n,t)},t.insertRule=function(e,t,n){if(void 0===n&&(n=this.element.sheet),e.rules){var r=e,i=n;if("conditional"===e.type||"keyframes"===e.type){var o=de(n,t);if(!1===(i=le(n,r.toString({children:!1}),o)))return!1;this.refCssRule(e,o,i)}return this.insertRules(r.rules,i),i}var a=e.toString();if(!a)return!1;var s=de(n,t),c=le(n,a,s);return!1!==c&&(this.hasInsertedRules=!0,this.refCssRule(e,s,c),c)},t.refCssRule=function(e,t,n){e.renderable=n,e.options.parent instanceof $&&this.cssRules.splice(t,0,n)},t.deleteRule=function(e){var t=this.element.sheet,n=this.indexOf(e);return-1!==n&&(t.deleteRule(n),this.cssRules.splice(n,1),!0)},t.indexOf=function(e){return this.cssRules.indexOf(e)},t.replaceRule=function(e,t){var n=this.indexOf(e);return-1!==n&&(this.element.sheet.deleteRule(n),this.cssRules.splice(n,1),this.insertRule(t,n))},t.getRules=function(){return this.element.sheet.cssRules},e}(),fe=0,he=function(){function e(e){this.id=fe++,this.version="10.10.0",this.plugins=new G,this.options={id:{minify:!1},createGenerateId:ne,Renderer:i.Z?pe:null,plugins:[]},this.generateId=ne({minify:!1});for(var t=0;t<V.length;t++)this.plugins.use(V[t],{queue:"internal"});this.setup(e)}var t=e.prototype;return t.setup=function(e){return void 0===e&&(e={}),e.createGenerateId&&(this.options.createGenerateId=e.createGenerateId),e.id&&(this.options.id=(0,r.Z)({},this.options.id,e.id)),(e.createGenerateId||e.id)&&(this.generateId=this.options.createGenerateId(this.options.id)),null!=e.insertionPoint&&(this.options.insertionPoint=e.insertionPoint),"Renderer"in e&&(this.options.Renderer=e.Renderer),e.plugins&&this.use.apply(this,e.plugins),this},t.createStyleSheet=function(e,t){void 0===t&&(t={});var n=t.index;"number"!=typeof n&&(n=0===Q.index?0:Q.index+1);var i=new $(e,(0,r.Z)({},t,{jss:this,generateId:t.generateId||this.generateId,insertionPoint:this.options.insertionPoint,Renderer:this.options.Renderer,index:n}));return this.plugins.onProcessSheet(i),i},t.removeStyleSheet=function(e){return e.detach(),Q.remove(e),this},t.createRule=function(e,t,n){if(void 0===t&&(t={}),void 0===n&&(n={}),"object"==typeof e)return this.createRule(void 0,e,t);var i=(0,r.Z)({},n,{name:e,jss:this,Renderer:this.options.Renderer});i.generateId||(i.generateId=this.generateId),i.classes||(i.classes={}),i.keyframes||(i.keyframes={});var o=d(e,t,i);return o&&this.plugins.onProcessRule(o),o},t.use=function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return n.forEach((function(t){e.plugins.use(t)})),this},e}(),me=function(e){return new he(e)},ge=function(){function e(){this.length=0,this.sheets=new WeakMap}var t=e.prototype;return t.get=function(e){var t=this.sheets.get(e);return t&&t.sheet},t.add=function(e,t){this.sheets.has(e)||(this.length++,this.sheets.set(e,{sheet:t,refs:0}))},t.manage=function(e){var t=this.sheets.get(e);if(t)return 0===t.refs&&t.sheet.attach(),t.refs++,t.sheet},t.unmanage=function(e){var t=this.sheets.get(e);t&&t.refs>0&&(t.refs--,0===t.refs&&t.sheet.detach())},(0,o.Z)(e,[{key:"size",get:function(){return this.length}}]),e}(),ve="object"==typeof CSS&&null!=CSS&&"number"in CSS;function ye(e){var t=null;for(var n in e){var r=e[n],i=typeof r;if("function"===i)t||(t={}),t[n]=r;else if("object"===i&&null!==r&&!Array.isArray(r)){var o=ye(r);o&&(t||(t={}),t[n]=o)}}return t}const be=me()},9593:(e,t,n)=>{"use strict";const r=n(4411),i=Symbol("max"),o=Symbol("length"),a=Symbol("lengthCalculator"),s=Symbol("allowStale"),c=Symbol("maxAge"),u=Symbol("dispose"),l=Symbol("noDisposeOnSet"),d=Symbol("lruList"),p=Symbol("cache"),f=Symbol("updateAgeOnGet"),h=()=>1,m=(e,t,n)=>{const r=e[p].get(t);if(r){const t=r.value;if(g(e,t)){if(y(e,r),!e[s])return}else n&&(e[f]&&(r.value.now=Date.now()),e[d].unshiftNode(r));return t.value}},g=(e,t)=>{if(!t||!t.maxAge&&!e[c])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[c]&&n>e[c]},v=e=>{if(e[o]>e[i])for(let t=e[d].tail;e[o]>e[i]&&null!==t;){const n=t.prev;y(e,t),t=n}},y=(e,t)=>{if(t){const n=t.value;e[u]&&e[u](n.key,n.value),e[o]-=n.length,e[p].delete(n.key),e[d].removeNode(t)}};class b{constructor(e,t,n,r,i){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=i||0}}const w=(e,t,n,r)=>{let i=n.value;g(e,i)&&(y(e,n),e[s]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[i]=e.max||1/0;const t=e.length||h;if(this[a]="function"!=typeof t?h:t,this[s]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[c]=e.maxAge||0,this[u]=e.dispose,this[l]=e.noDisposeOnSet||!1,this[f]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[i]=e||1/0,v(this)}get max(){return this[i]}set allowStale(e){this[s]=!!e}get allowStale(){return this[s]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[c]=e,v(this)}get maxAge(){return this[c]}set lengthCalculator(e){"function"!=typeof e&&(e=h),e!==this[a]&&(this[a]=e,this[o]=0,this[d].forEach((e=>{e.length=this[a](e.value,e.key),this[o]+=e.length}))),v(this)}get lengthCalculator(){return this[a]}get length(){return this[o]}get itemCount(){return this[d].length}rforEach(e,t){t=t||this;for(let n=this[d].tail;null!==n;){const r=n.prev;w(this,e,n,t),n=r}}forEach(e,t){t=t||this;for(let n=this[d].head;null!==n;){const r=n.next;w(this,e,n,t),n=r}}keys(){return this[d].toArray().map((e=>e.key))}values(){return this[d].toArray().map((e=>e.value))}reset(){this[u]&&this[d]&&this[d].length&&this[d].forEach((e=>this[u](e.key,e.value))),this[p]=new Map,this[d]=new r,this[o]=0}dump(){return this[d].map((e=>!g(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[d]}set(e,t,n){if((n=n||this[c])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");const r=n?Date.now():0,s=this[a](t,e);if(this[p].has(e)){if(s>this[i])return y(this,this[p].get(e)),!1;const a=this[p].get(e).value;return this[u]&&(this[l]||this[u](e,a.value)),a.now=r,a.maxAge=n,a.value=t,this[o]+=s-a.length,a.length=s,this.get(e),v(this),!0}const f=new b(e,t,s,r,n);return f.length>this[i]?(this[u]&&this[u](e,t),!1):(this[o]+=f.length,this[d].unshift(f),this[p].set(e,this[d].head),v(this),!0)}has(e){if(!this[p].has(e))return!1;const t=this[p].get(e).value;return!g(this,t)}get(e){return m(this,e,!0)}peek(e){return m(this,e,!1)}pop(){const e=this[d].tail;return e?(y(this,e),e.value):null}del(e){y(this,this[p].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const r=e[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{const e=i-t;e>0&&this.set(r.k,r.v,e)}}}prune(){this[p].forEach(((e,t)=>m(this,t,!1)))}}},5234:(e,t,n)=>{e.exports=n(3765)},983:(e,t,n)=>{"use strict";var r,i,o,a=n(5234),s=n(9421).extname,c=/^\s*([^;\s]*)(?:;|\s|$)/,u=/^text\//i;function l(e){if(!e||"string"!=typeof e)return!1;var t=c.exec(e),n=t&&a[t[1].toLowerCase()];return n&&n.charset?n.charset:!(!t||!u.test(t[1]))&&"UTF-8"}t.charset=l,t.charsets={lookup:l},t.contentType=function(e){if(!e||"string"!=typeof e)return!1;var n=-1===e.indexOf("/")?t.lookup(e):e;if(!n)return!1;if(-1===n.indexOf("charset")){var r=t.charset(n);r&&(n+="; charset="+r.toLowerCase())}return n},t.extension=function(e){if(!e||"string"!=typeof e)return!1;var n=c.exec(e),r=n&&t.extensions[n[1].toLowerCase()];return!(!r||!r.length)&&r[0]},t.extensions=Object.create(null),t.lookup=function(e){if(!e||"string"!=typeof e)return!1;var n=s("x."+e).toLowerCase().substr(1);return n&&t.types[n]||!1},t.types=Object.create(null),r=t.extensions,i=t.types,o=["nginx","apache",void 0,"iana"],Object.keys(a).forEach((function(e){var t=a[e],n=t.extensions;if(n&&n.length){r[e]=n;for(var s=0;s<n.length;s++){var c=n[s];if(i[c]){var u=o.indexOf(a[i[c]].source),l=o.indexOf(t.source);if("application/octet-stream"!==i[c]&&(u>l||u===l&&"application/"===i[c].substr(0,12)))continue}i[c]=e}}}))},2587:e=>{"use strict";function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,n,r,i){n=n||"&",r=r||"=";var o={};if("string"!=typeof e||0===e.length)return o;var a=/\+/g;e=e.split(n);var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.maxKeys);var c=e.length;s>0&&c>s&&(c=s);for(var u=0;u<c;++u){var l,d,p,f,h=e[u].replace(a,"%20"),m=h.indexOf(r);m>=0?(l=h.substr(0,m),d=h.substr(m+1)):(l=h,d=""),p=decodeURIComponent(l),f=decodeURIComponent(d),t(o,p)?Array.isArray(o[p])?o[p].push(f):o[p]=[o[p],f]:o[p]=f}return o}},2361:e=>{"use strict";var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,n,r,i){return n=n||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(i){var o=encodeURIComponent(t(i))+r;return Array.isArray(e[i])?e[i].map((function(e){return o+encodeURIComponent(t(e))})).join(n):o+encodeURIComponent(t(e[i]))})).join(n):i?encodeURIComponent(t(i))+r+encodeURIComponent(t(e)):""}},7673:(e,t,n)=>{"use strict";t.decode=t.parse=n(2587),t.encode=t.stringify=n(2361)},4375:(e,t,n)=>{let r;e.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:n.g):e=>(r||(r=Promise.resolve())).then(e).catch((e=>setTimeout((()=>{throw e}),0)))},7055:(e,t,n)=>{e.exports=n(9344)},2401:e=>{"use strict";e.exports=class e{constructor(e,t=new Map,n=0){this.prefix=e,this._existing=t,this.counter=n}clone(){const{prefix:t,_existing:n,counter:r}=this;return new e(t,new Map(n),r)}getId(e){const t=e&&this._existing.get(e);if(t)return t;const n=this.prefix+this.counter;return this.counter++,e&&this._existing.set(e,n),n}hasId(e){return this._existing.has(e)}getOldIds(){return[...this._existing.keys()]}}},5947:(e,t,n)=>{"use strict";n(4889);const r=self.crypto||self.msCrypto;e.exports=class{constructor(e){if(!r||!r.subtle)throw new Error("crypto.subtle not found.");if("sha256"===e)this.algorithm={name:"SHA-256"};else{if("sha1"!==e)throw new Error(`Unsupported algorithm "${e}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(e){this._content+=e}async digest(){const e=(new TextEncoder).encode(this._content),t=new Uint8Array(await r.subtle.digest(this.algorithm,e));let n="";for(let e=0;e<t.length;++e)n+=t[e].toString(16).padStart(2,"0");return n}}},9980:e=>{"use strict";const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",n="http://www.w3.org/2001/XMLSchema#string",r="NamedNode",i="BlankNode",o="Literal",a="DefaultGraph",s={};(()=>{const e="(?:<([^:]+:[^>]*)>)",t="A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_",n=t+"0-9-·̀-ͯ‿-⁀",r="(_:(?:["+t+"0-9])(?:(?:["+n+".])*(?:["+n+"]))?)",i="[ \\t]+",o="[ \\t]*",a="(?:"+e+"|"+r+")"+i,c=e+i,u="(?:"+e+"|"+r+'|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^'+e+")|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))"+o,l="(?:\\.|(?:(?:"+e+"|"+r+")"+o+"\\.))";s.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,s.empty=new RegExp("^"+o+"$"),s.quad=new RegExp("^"+o+a+c+u+l+o+"$")})(),e.exports=class e{static parse(e){const c=[],l={},d=e.split(s.eoln);let p=0;for(const e of d){if(p++,s.empty.test(e))continue;const d=e.match(s.quad);if(null===d)throw new Error("N-Quads parse error on line "+p+".");const m={subject:null,predicate:null,object:null,graph:null};if(void 0!==d[1]?m.subject={termType:r,value:d[1]}:m.subject={termType:i,value:d[2]},m.predicate={termType:r,value:d[3]},void 0!==d[4]?m.object={termType:r,value:d[4]}:void 0!==d[5]?m.object={termType:i,value:d[5]}:(m.object={termType:o,value:void 0,datatype:{termType:r}},void 0!==d[7]?m.object.datatype.value=d[7]:void 0!==d[8]?(m.object.datatype.value=t,m.object.language=d[8]):m.object.datatype.value=n,m.object.value=d[6].replace(u,(function(e,t,n,r){if(t)switch(t){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(n)return String.fromCharCode(parseInt(n,16));if(r)throw new Error("Unsupported U escape")}))),void 0!==d[9]?m.graph={termType:r,value:d[9]}:void 0!==d[10]?m.graph={termType:i,value:d[10]}:m.graph={termType:a,value:""},m.graph.value in l){let e=!0;const t=l[m.graph.value];for(const n of t)if(h=m,(f=n).subject.termType===h.subject.termType&&f.object.termType===h.object.termType&&f.subject.value===h.subject.value&&f.predicate.value===h.predicate.value&&f.object.value===h.object.value&&(f.object.termType!==o||f.object.datatype.termType===h.object.datatype.termType&&f.object.language===h.object.language&&f.object.datatype.value===h.object.datatype.value)){e=!1;break}e&&(t.push(m),c.push(m))}else l[m.graph.value]=[m],c.push(m)}var f,h;return c}static serialize(t){Array.isArray(t)||(t=e.legacyDatasetToQuads(t));const n=[];for(const r of t)n.push(e.serializeQuad(r));return n.sort().join("")}static serializeQuadComponents(e,o,a,s){let u="";return e.termType===r?u+=`<${e.value}>`:u+=`${e.value}`,u+=` <${o.value}> `,a.termType===r?u+=`<${a.value}>`:a.termType===i?u+=a.value:(u+=`"${function(e){return e.replace(c,(function(e){switch(e){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}}))}(a.value)}"`,a.datatype.value===t?a.language&&(u+=`@${a.language}`):a.datatype.value!==n&&(u+=`^^<${a.datatype.value}>`)),s.termType===r?u+=` <${s.value}>`:s.termType===i&&(u+=` ${s.value}`),u+=" .\n",u}static serializeQuad(t){return e.serializeQuadComponents(t.subject,t.predicate,t.object,t.graph)}static legacyDatasetToQuads(e){const s=[],c={"blank node":i,IRI:r,literal:o};for(const u in e)e[u].forEach((e=>{const l={};for(const i in e){const a=e[i],s={termType:c[a.type],value:a.value};s.termType===o&&(s.datatype={termType:r},"datatype"in a&&(s.datatype.value=a.datatype),"language"in a?("datatype"in a||(s.datatype.value=t),s.language=a.language):"datatype"in a||(s.datatype.value=n)),l[i]=s}l.graph="@default"===u?{termType:a,value:""}:{termType:u.startsWith("_:")?i:r,value:u},s.push(l)}));return s}};const c=/["\\\n\r]/g,u=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},8326:e=>{"use strict";e.exports=class{constructor(e){this.current=e.sort(),this.done=!1,this.dir=new Map;for(let t=0;t<e.length;++t)this.dir.set(e[t],!0)}hasNext(){return!this.done}next(){const{current:e,dir:t}=this,n=e.slice();let r=null,i=0;const o=e.length;for(let n=0;n<o;++n){const a=e[n],s=t.get(a);(null===r||a>r)&&(s&&n>0&&a>e[n-1]||!s&&n<o-1&&a>e[n+1])&&(r=a,i=n)}if(null===r)this.done=!0;else{const n=t.get(r)?i-1:i+1;e[i]=e[n],e[n]=r;for(const n of e)n>r&&t.set(n,!t.get(n))}return n}}},3445:(e,t,n)=>{"use strict";const r=n(2401),i=n(5947),o=n(8326),a=n(9980);function s(e,t){return e.hash<t.hash?-1:e.hash>t.hash?1:0}e.exports=class{constructor({createMessageDigest:e=(()=>new i("sha256")),maxDeepIterations:t=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new r("_:c14n"),this.createMessageDigest=e,this.maxDeepIterations=t,this.quads=null,this.deepIterations=null}async main(e){this.deepIterations=new Map,this.quads=e;for(const t of e)this._addBlankNodeQuadInfo({quad:t,component:t.subject}),this._addBlankNodeQuadInfo({quad:t,component:t.object}),this._addBlankNodeQuadInfo({quad:t,component:t.graph});const t=new Map,n=[...this.blankNodeInfo.keys()];let i=0;for(const e of n)++i%100==0&&await this._yield(),await this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});const o=[...t.keys()].sort(),c=[];for(const e of o){const n=t.get(e);if(n.length>1){c.push(n);continue}const r=n[0];this.canonicalIssuer.getId(r)}for(const e of c){const t=[];for(const n of e){if(this.canonicalIssuer.hasId(n))continue;const e=new r("_:b");e.getId(n);const i=await this.hashNDegreeQuads(n,e);t.push(i)}t.sort(s);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const u=[];for(const e of this.quads){const t=a.serializeQuadComponents(this._componentWithCanonicalId(e.subject),e.predicate,this._componentWithCanonicalId(e.object),this._componentWithCanonicalId(e.graph));u.push(t)}return u.sort(),u.join("")}async hashFirstDegreeQuads(e){const t=[],n=this.blankNodeInfo.get(e),r=n.quads;for(const n of r){const r={subject:null,predicate:n.predicate,object:null,graph:null};r.subject=this.modifyFirstDegreeComponent(e,n.subject,"subject"),r.object=this.modifyFirstDegreeComponent(e,n.object,"object"),r.graph=this.modifyFirstDegreeComponent(e,n.graph,"graph"),t.push(a.serializeQuad(r))}t.sort();const i=this.createMessageDigest();for(const e of t)i.update(e);return n.hash=await i.digest(),n.hash}async hashRelatedBlankNode(e,t,n,r){let i;i=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):n.hasId(e)?n.getId(e):this.blankNodeInfo.get(e).hash;const o=this.createMessageDigest();return o.update(r),"g"!==r&&o.update(this.getRelatedPredicate(t)),o.update(i),o.digest()}async hashNDegreeQuads(e,t){const n=this.deepIterations.get(e)||0;if(n>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(e,n+1);const r=this.createMessageDigest(),i=await this.createHashToRelated(e,t),a=[...i.keys()].sort();for(const e of a){r.update(e);let n,a="";const s=new o(i.get(e));let c=0;for(;s.hasNext();){const e=s.next();++c%3==0&&await this._yield();let r=t.clone(),i="";const o=[];let u=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?i+=this.canonicalIssuer.getId(t):(r.hasId(t)||o.push(t),i+=r.getId(t)),0!==a.length&&i>a){u=!0;break}if(!u){for(const e of o){const t=await this.hashNDegreeQuads(e,r);if(i+=r.getId(e),i+=`<${t.hash}>`,r=t.issuer,0!==a.length&&i>a){u=!0;break}}u||(0===a.length||i<a)&&(a=i,n=r)}}r.update(a),t=n}return{hash:await r.digest(),issuer:t}}modifyFirstDegreeComponent(e,t){return"BlankNode"!==t.termType?t:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return`<${e.predicate.value}>`}async createHashToRelated(e,t){const n=new Map,r=this.blankNodeInfo.get(e).quads;let i=0;for(const o of r)++i%100==0&&await this._yield(),await Promise.all([this._addRelatedBlankNodeHash({quad:o,component:o.subject,position:"s",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:o,component:o.object,position:"o",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:o,component:o.graph,position:"g",id:e,issuer:t,hashToRelated:n})]);return n}async _hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const n=await this.hashFirstDegreeQuads(e),r=t.get(n);r?r.push(e):t.set(n,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const n=t.value,r=this.blankNodeInfo.get(n);r?r.quads.add(e):this.blankNodeInfo.set(n,{quads:new Set([e]),hash:null})}async _addRelatedBlankNodeHash({quad:e,component:t,position:n,id:r,issuer:i,hashToRelated:o}){if("BlankNode"!==t.termType||t.value===r)return;const a=t.value,s=await this.hashRelatedBlankNode(a,e,i,n),c=o.get(s);c?c.push(a):o.set(s,[a])}_componentWithCanonicalId(e){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}async _yield(){return new Promise((e=>setImmediate(e)))}}},5643:(e,t,n)=>{"use strict";const r=n(2401),i=n(5947),o=n(8326),a=n(9980);function s(e,t){return e.hash<t.hash?-1:e.hash>t.hash?1:0}e.exports=class{constructor({createMessageDigest:e=(()=>new i("sha256")),maxDeepIterations:t=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new r("_:c14n"),this.createMessageDigest=e,this.maxDeepIterations=t,this.quads=null,this.deepIterations=null}main(e){this.deepIterations=new Map,this.quads=e;for(const t of e)this._addBlankNodeQuadInfo({quad:t,component:t.subject}),this._addBlankNodeQuadInfo({quad:t,component:t.object}),this._addBlankNodeQuadInfo({quad:t,component:t.graph});const t=new Map,n=[...this.blankNodeInfo.keys()];for(const e of n)this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});const i=[...t.keys()].sort(),o=[];for(const e of i){const n=t.get(e);if(n.length>1){o.push(n);continue}const r=n[0];this.canonicalIssuer.getId(r)}for(const e of o){const t=[];for(const n of e){if(this.canonicalIssuer.hasId(n))continue;const e=new r("_:b");e.getId(n);const i=this.hashNDegreeQuads(n,e);t.push(i)}t.sort(s);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const c=[];for(const e of this.quads){const t=a.serializeQuadComponents(this._componentWithCanonicalId({component:e.subject}),e.predicate,this._componentWithCanonicalId({component:e.object}),this._componentWithCanonicalId({component:e.graph}));c.push(t)}return c.sort(),c.join("")}hashFirstDegreeQuads(e){const t=[],n=this.blankNodeInfo.get(e),r=n.quads;for(const n of r){const r={subject:null,predicate:n.predicate,object:null,graph:null};r.subject=this.modifyFirstDegreeComponent(e,n.subject,"subject"),r.object=this.modifyFirstDegreeComponent(e,n.object,"object"),r.graph=this.modifyFirstDegreeComponent(e,n.graph,"graph"),t.push(a.serializeQuad(r))}t.sort();const i=this.createMessageDigest();for(const e of t)i.update(e);return n.hash=i.digest(),n.hash}hashRelatedBlankNode(e,t,n,r){let i;i=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):n.hasId(e)?n.getId(e):this.blankNodeInfo.get(e).hash;const o=this.createMessageDigest();return o.update(r),"g"!==r&&o.update(this.getRelatedPredicate(t)),o.update(i),o.digest()}hashNDegreeQuads(e,t){const n=this.deepIterations.get(e)||0;if(n>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(e,n+1);const r=this.createMessageDigest(),i=this.createHashToRelated(e,t),a=[...i.keys()].sort();for(const e of a){r.update(e);let n,a="";const s=new o(i.get(e));for(;s.hasNext();){const e=s.next();let r=t.clone(),i="";const o=[];let c=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?i+=this.canonicalIssuer.getId(t):(r.hasId(t)||o.push(t),i+=r.getId(t)),0!==a.length&&i>a){c=!0;break}if(!c){for(const e of o){const t=this.hashNDegreeQuads(e,r);if(i+=r.getId(e),i+=`<${t.hash}>`,r=t.issuer,0!==a.length&&i>a){c=!0;break}}c||(0===a.length||i<a)&&(a=i,n=r)}}r.update(a),t=n}return{hash:r.digest(),issuer:t}}modifyFirstDegreeComponent(e,t){return"BlankNode"!==t.termType?t:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return`<${e.predicate.value}>`}createHashToRelated(e,t){const n=new Map,r=this.blankNodeInfo.get(e).quads;for(const i of r)this._addRelatedBlankNodeHash({quad:i,component:i.subject,position:"s",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:i,component:i.object,position:"o",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:i,component:i.graph,position:"g",id:e,issuer:t,hashToRelated:n});return n}_hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const n=this.hashFirstDegreeQuads(e),r=t.get(n);r?r.push(e):t.set(n,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const n=t.value,r=this.blankNodeInfo.get(n);r?r.quads.add(e):this.blankNodeInfo.set(n,{quads:new Set([e]),hash:null})}_addRelatedBlankNodeHash({quad:e,component:t,position:n,id:r,issuer:i,hashToRelated:o}){if("BlankNode"!==t.termType||t.value===r)return;const a=t.value,s=this.hashRelatedBlankNode(a,e,i,n),c=o.get(s);c?c.push(a):o.set(s,[a])}_componentWithCanonicalId({component:e}){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}}},9201:(e,t,n)=>{"use strict";const r=n(5947),i=n(3445);e.exports=class extends i{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new r("sha1")}modifyFirstDegreeComponent(e,t,n){return"BlankNode"!==t.termType?t:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}async createHashToRelated(e,t){const n=new Map,r=this.blankNodeInfo.get(e).quads;let i=0;for(const o of r){let r,a;if("BlankNode"===o.subject.termType&&o.subject.value!==e)a=o.subject.value,r="p";else{if("BlankNode"!==o.object.termType||o.object.value===e)continue;a=o.object.value,r="r"}++i%100==0&&await this._yield();const s=await this.hashRelatedBlankNode(a,o,t,r),c=n.get(s);c?c.push(a):n.set(s,[a])}return n}}},7702:(e,t,n)=>{"use strict";const r=n(5947),i=n(5643);e.exports=class extends i{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new r("sha1")}modifyFirstDegreeComponent(e,t,n){return"BlankNode"!==t.termType?t:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}createHashToRelated(e,t){const n=new Map,r=this.blankNodeInfo.get(e).quads;for(const i of r){let r,o;if("BlankNode"===i.subject.termType&&i.subject.value!==e)o=i.subject.value,r="p";else{if("BlankNode"!==i.object.termType||i.object.value===e)continue;o=i.object.value,r="r"}const a=this.hashRelatedBlankNode(o,i,t,r),s=n.get(a);s?s.push(o):n.set(a,[o])}return n}}},9344:(e,t,n)=>{"use strict";const r=n(3445),i=n(9201),o=n(5643),a=n(7702);let s;try{s=n(7670)}catch(e){}t.NQuads=n(9980),t.IdentifierIssuer=n(2401),t._rdfCanonizeNative=function(e){return e&&(s=e),s},t.canonize=async function(e,n){if(Array.isArray(e)||(e=t.NQuads.legacyDatasetToQuads(e)),n.useNative){if(!s)throw new Error("rdf-canonize-native not available");if(n.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return new Promise(((t,r)=>s.canonize(e,n,((e,n)=>e?r(e):t(n)))))}if("URDNA2015"===n.algorithm)return new r(n).main(e);if("URGNA2012"===n.algorithm){if(n.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new i(n).main(e)}if(!("algorithm"in n))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+n.algorithm)},t._canonizeSync=function(e,n){if(Array.isArray(e)||(e=t.NQuads.legacyDatasetToQuads(e)),n.useNative){if(!s)throw new Error("rdf-canonize-native not available");if(n.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return s.canonizeSync(e,n)}if("URDNA2015"===n.algorithm)return new o(n).main(e);if("URGNA2012"===n.algorithm){if(n.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new a(n).main(e)}if(!("algorithm"in n))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+n.algorithm)}},1897:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={Literal:1,Collection:3,Graph:4,NamedNode:5,BlankNode:6,Variable:7}},6022:(e,t,n)=>{"use strict";n.r(t),n.d(t,{BlankNode:()=>f,Collection:()=>w,ConnectedStore:()=>On,DataFactory:()=>cn,Empty:()=>x,Fetcher:()=>Xt,Formula:()=>ee,IndexedFormula:()=>fe,Literal:()=>y,LiveStore:()=>Pn,N3Parser:()=>De,NamedNode:()=>m.Z,Namespace:()=>U,NextId:()=>Tn,Node:()=>te,Query:()=>re,RDFParser:()=>Pt,RDFaProcessor:()=>Tt,SPARQLToQuery:()=>en,Serializer:()=>V,Statement:()=>P,Store:()=>fe,UpdateManager:()=>rn,UpdatesSocket:()=>un,UpdatesVia:()=>ln,Util:()=>B,Variable:()=>F,blankNode:()=>wn,defaultGraph:()=>xn,fetcher:()=>hn,fromNT:()=>Cn,graph:()=>mn,isBlankNode:()=>g.B2,isCollection:()=>g.uZ,isGraph:()=>g.NA,isLiteral:()=>g.n_,isNamedNode:()=>g.NX,isPredicate:()=>g.lx,isQuad:()=>g.PY,isRDFObject:()=>g.lt,isRDFlibObject:()=>g.Uc,isRDFlibPredicate:()=>g.nq,isRDFlibSubject:()=>g.f,isStatement:()=>g.Yi,isStore:()=>g.Pv,isSubject:()=>g.zz,isTerm:()=>g.jt,isVariable:()=>g.cG,jsonParser:()=>Qt,lit:()=>gn,literal:()=>_n,log:()=>M.Z,namedNode:()=>yn,parse:()=>jt,quad:()=>En,queryToSPARQL:()=>Yt,serialize:()=>z,sparqlUpdateParser:()=>It,st:()=>vn,sym:()=>yn,term:()=>An,termValue:()=>Rt._,triple:()=>kn,uri:()=>I,variable:()=>bn});var r=n(3144),i=n(5671),o=n(7326),a=n(136),s=n(2963),c=n(1120),u=n(4942),l=n(1897),d=n(566),p=n(8946);var f=function(e){(0,a.Z)(f,e);var t,n,d=(t=f,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return(0,s.Z)(this,e)});function f(e){var t;return(0,i.Z)(this,f),t=d.call(this,f.getId(e)),(0,u.Z)((0,o.Z)(t),"termType",p.V1),(0,u.Z)((0,o.Z)(t),"classOrder",l.Z.BlankNode),(0,u.Z)((0,o.Z)(t),"isBlank",1),(0,u.Z)((0,o.Z)(t),"isVar",1),t}return(0,r.Z)(f,[{key:"id",get:function(){return this.value},set:function(e){this.value=e}},{key:"compareTerm",value:function(e){return this.classOrder<e.classOrder?-1:this.classOrder>e.classOrder?1:this.id<e.id?-1:this.id>e.id?1:0}},{key:"copy",value:function(e){var t=new f;return e.copyTo(this,t),t}},{key:"toCanonical",value:function(){return f.NTAnonymousNodePrefix+this.value}},{key:"toString",value:function(){return f.NTAnonymousNodePrefix+this.id}}],[{key:"getId",value:function(e){if(e){if("string"!=typeof e)throw new Error("Bad id argument to new blank node: "+e);if(e.includes("#")){var t=e.split("#");return t[t.length-1]}return e}return"n"+f.nextId++}}]),f}(d.Z);(0,u.Z)(f,"nextId",0),(0,u.Z)(f,"NTAnonymousNodePrefix","_:");var h=n(1002),m=n(8967),g=n(6680);const v={boolean:new m.Z("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:new m.Z("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:new m.Z("http://www.w3.org/2001/XMLSchema#decimal"),double:new m.Z("http://www.w3.org/2001/XMLSchema#double"),integer:new m.Z("http://www.w3.org/2001/XMLSchema#integer"),langString:new m.Z("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:new m.Z("http://www.w3.org/2001/XMLSchema#string")};var y=function(e){(0,a.Z)(f,e);var t,n,d=(t=f,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return(0,s.Z)(this,e)});function f(e,t,n){var r;return(0,i.Z)(this,f),r=d.call(this,e),(0,u.Z)((0,o.Z)(r),"termType",p.xH),(0,u.Z)((0,o.Z)(r),"classOrder",l.Z.Literal),(0,u.Z)((0,o.Z)(r),"datatype",v.string),(0,u.Z)((0,o.Z)(r),"isVar",0),(0,u.Z)((0,o.Z)(r),"language",""),t?(r.language=t,r.datatype=v.langString):r.datatype=n?m.Z.fromValue(n):v.string,r}return(0,r.Z)(f,[{key:"copy",value:function(){return new f(this.value,this.lang,this.datatype)}},{key:"equals",value:function(e){return!!e&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&(!this.datatype&&!e.datatype||this.datatype&&this.datatype.equals(e.datatype))}},{key:"lang",get:function(){return this.language},set:function(e){this.language=e||""}},{key:"toNT",value:function(){return f.toNT(this)}},{key:"toString",value:function(){return""+this.value}}],[{key:"toNT",value:function(e){if("number"==typeof e.value)return""+e.value;if("string"!=typeof e.value)throw new Error("Value of RDF literal is not string or number: "+e.value);var t=e.value;return t='"'+(t=(t=(t=(t=t.replace(/\\/g,"\\\\")).replace(/\"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r"))+'"',e.language?t+="@"+e.language:e.datatype.equals(v.string)||(t+="^^"+e.datatype.toCanonical()),t}},{key:"fromBoolean",value:function(e){return new f(e?"1":"0",null,v.boolean)}},{key:"fromDate",value:function(e){if(!(e instanceof Date))throw new TypeError("Invalid argument to Literal.fromDate()");var t=function(e){return(""+(100+e)).slice(1,3)};return new f(e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"Z",null,v.dateTime)}},{key:"fromNumber",value:function(e){if("number"!=typeof e)throw new TypeError("Invalid argument to Literal.fromNumber()");var t,n=e.toString();return t=n.indexOf("e")<0&&Math.abs(e)<=Number.MAX_SAFE_INTEGER?Number.isInteger(e)?v.integer:v.decimal:v.double,new f(n,null,t)}},{key:"fromValue",value:function(e){if((0,g.n_)(e))return e;switch((0,h.Z)(e)){case"object":if(e instanceof Date)return f.fromDate(e);case"boolean":return f.fromBoolean(e);case"number":return f.fromNumber(e);case"string":return new f(e)}throw new Error("Can't make literal from "+e+" of type "+(0,h.Z)(e))}}]),f}(d.Z);function b(e){return null==e||(0,g.jt)(e)?e:Array.isArray(e)?new w(e):y.fromValue(e)}var w=function(e){(0,a.Z)(h,e);var t,n,d=(t=h,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return(0,s.Z)(this,e)});function h(e){var t;return(0,i.Z)(this,h),t=d.call(this,(f.nextId++).toString()),(0,u.Z)((0,o.Z)(t),"termType",p.fb),(0,u.Z)((0,o.Z)(t),"classOrder",l.Z.Collection),(0,u.Z)((0,o.Z)(t),"closed",!1),(0,u.Z)((0,o.Z)(t),"compareTerm",f.prototype.compareTerm),(0,u.Z)((0,o.Z)(t),"elements",[]),(0,u.Z)((0,o.Z)(t),"isVar",0),e&&e.length>0&&e.forEach((function(e){t.elements.push(b(e))})),t}return(0,r.Z)(h,[{key:"id",get:function(){return this.value},set:function(e){this.value=e}},{key:"append",value:function(e){return this.elements.push(e)}},{key:"close",value:function(){return this.closed=!0,this.closed}},{key:"shift",value:function(){return this.elements.shift()}},{key:"substitute",value:function(e){return new h(this.elements.map((function(t){return t.substitute(e)})))}},{key:"toNT",value:function(){return h.toNT(this)}},{key:"toString",value:function(){return"("+this.elements.join(" ")+")"}},{key:"unshift",value:function(e){return this.elements.unshift(e)}}],[{key:"toNT",value:function(e){return f.NTAnonymousNodePrefix+e.id}}]),h}(d.Z);(0,u.Z)(w,"termType",p.fb);var x=function(e){(0,a.Z)(d,e);var t,n,l=(t=d,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return(0,s.Z)(this,e)});function d(){var e;return(0,i.Z)(this,d),e=l.call(this,""),(0,u.Z)((0,o.Z)(e),"termType",p.ls),e}return(0,r.Z)(d,[{key:"toString",value:function(){return"()"}}]),d}(d.Z);function _(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function E(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){_(o,r,i,a,s,"next",e)}function s(e){_(o,r,i,a,s,"throw",e)}a(void 0)}))}}var k=n(4687),S=n.n(k),C="chrome:theSession";new m.Z(C);var A=function(e){(0,a.Z)(d,e);var t,n,l=(t=d,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return(0,s.Z)(this,e)});function d(){var e;return(0,i.Z)(this,d),e=l.call(this,""),(0,u.Z)((0,o.Z)(e),"value",""),(0,u.Z)((0,o.Z)(e),"termType",p.NK),(0,u.Z)((0,o.Z)(e),"uri",C),e}return(0,r.Z)(d,[{key:"toCanonical",value:function(){return this.value}},{key:"toString",value:function(){return"DefaultGraph"}}]),d}(d.Z);function T(e){return!!e&&e.termType===p.NK}var O=new A,P=function(){function e(t,n,r,o){(0,i.Z)(this,e),(0,u.Z)(this,"subject",void 0),(0,u.Z)(this,"predicate",void 0),(0,u.Z)(this,"object",void 0),(0,u.Z)(this,"graph",void 0),this.subject=d.Z.fromValue(t),this.predicate=d.Z.fromValue(n),this.object=d.Z.fromValue(r),this.graph=null==o?O:d.Z.fromValue(o)}return(0,r.Z)(e,[{key:"why",get:function(){return this.graph},set:function(e){this.graph=e}},{key:"equals",value:function(e){return e.subject.equals(this.subject)&&e.predicate.equals(this.predicate)&&e.object.equals(this.object)&&e.graph.equals(this.graph)}},{key:"substitute",value:function(t){return new e(this.subject.substitute(t),this.predicate.substitute(t),this.object.substitute(t),T(this.graph)?this.graph:this.graph.substitute(t))}},{key:"toCanonical",value:function(){var e=[this.subject.toCanonical(),this.predicate.toCanonical(),this.object.toCanonical()];return this.graph&&this.graph.termType!==p.NK&&e.push(this.graph.toCanonical()),e.join(" ")+" ."}},{key:"toNT",value:function(){return[this.subject.toNT(),this.predicate.toNT(),this.object.toNT()].join(" ")+" ."}},{key:"toNQ",value:function(){return[this.subject.toNT(),this.predicate.toNT(),this.object.toNT(),T(this.graph)?"":this.graph.toNT()].join(" ")+" ."}},{key:"toString",value:function(){return this.toNT()}}]),e}(),I=n(1609);var j,N,F=function(e){(0,a.Z)(f,e);var t,n,d=(t=f,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return(0,s.Z)(this,e)});function f(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,i.Z)(this,f),e=d.call(this,t),(0,u.Z)((0,o.Z)(e),"termType",p.UH),(0,u.Z)((0,o.Z)(e),"base","varid:"),(0,u.Z)((0,o.Z)(e),"classOrder",l.Z.Variable),(0,u.Z)((0,o.Z)(e),"isVar",1),(0,u.Z)((0,o.Z)(e),"uri",void 0),e.base="varid:",e.uri=I.join(t,e.base),e}return(0,r.Z)(f,[{key:"equals",value:function(e){return!!e&&this.termType===e.termType&&this.value===e.value}},{key:"hashString",value:function(){return this.toString()}},{key:"substitute",value:function(e){var t;return null!=(t=e[this.toNT()])?t:this}},{key:"toString",value:function(){return f.toString(this)}}],[{key:"toString",value:function(e){return e.uri.slice(0,e.base.length)===e.base?"?".concat(e.uri.slice(e.base.length)):"?".concat(e.uri)}}]),f}(d.Z);!function(e){e.collections="COLLECTIONS",e.defaultGraphType="DEFAULT_GRAPH_TYPE",e.equalsMethod="EQUALS_METHOD",e.id="ID",e.identity="IDENTITY",e.reversibleId="REVERSIBLE_ID",e.variableType="VARIABLE_TYPE"}(j||(j={}));var R=new A,L={supports:(N={},(0,u.Z)(N,j.collections,!1),(0,u.Z)(N,j.defaultGraphType,!1),(0,u.Z)(N,j.equalsMethod,!0),(0,u.Z)(N,j.identity,!1),(0,u.Z)(N,j.id,!0),(0,u.Z)(N,j.reversibleId,!1),(0,u.Z)(N,j.variableType,!0),N),blankNode:function(e){return new f(e)},defaultGraph:function(){return R},equals:function(e,t){return e===t||!e||!t||((0,g.PY)(e)||(0,g.PY)(t)?!(!(0,g.PY)(e)||!(0,g.PY)(t))&&this.equals(e.subject,t.subject)&&this.equals(e.predicate,t.predicate)&&this.equals(e.object,t.object)&&this.equals(e.graph,t.graph):!(!(0,g.jt)(e)||!(0,g.jt)(t))&&this.id(e)===this.id(t))},id:function(e){if(!e)return"undefined";if((0,g.PY)(e))return this.quadToNQ(e);switch(e.termType){case p.NK:return"defaultGraph";case p.UH:return F.toString(e);default:var t=this.termToNQ(e);if(t)return t;throw new Error("Can't id term with type '".concat(e.termType,"'"))}},isQuad:function(e){return e instanceof P},literal:function(e,t){if("string"!=typeof e&&!t)return y.fromValue(e);var n="string"==typeof e?e:""+e;return"string"==typeof t?-1===t.indexOf(":")?new y(n,t):new y(n,null,this.namedNode(t)):new y(n,null,t)},namedNode:function(e){return new m.Z(e)},quad:function(e,t,n,r){return new P(e,t,n,r||R)},triple:function(e,t,n,r){return this.quad(e,t,n,r)},quadToNQ:function(e){return"".concat(this.termToNQ(e.subject)," ").concat(this.termToNQ(e.predicate)," ").concat(this.termToNQ(e.object)," ").concat(this.termToNQ(e.graph)," .")},termToNQ:function(e){var t=this;switch(e.termType){case p.V1:return"_:"+e.value;case p.NK:return"";case p.ls:return"<http://www.w3.org/1999/02/22-rdf-syntax-ns#nil>";case p.xH:return y.toNT(e);case p._A:case p.XM:return"<"+e.value+">";case p.fb:return"("+e.elements.map((function(e){return t.termToNQ(e)})).join(" ")+")";default:throw new Error("Can't serialize nonstandard term type (was '".concat(e.termType,"')"))}},toNQ:function(e){return this.isQuad(e)?this.quadToNQ(e):this.termToNQ(e)},variable:function(e){return new F(e)}};const D=L;var M=n(1369);function U(e,t){var n=t||{namedNode:function(e){return new m.Z(e)}};return function(t){return n.namedNode(e+(t||""))}}var B=n(1048);function H(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:D;return{boolean:e.namedNode("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:e.namedNode("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:e.namedNode("http://www.w3.org/2001/XMLSchema#decimal"),double:e.namedNode("http://www.w3.org/2001/XMLSchema#double"),integer:e.namedNode("http://www.w3.org/2001/XMLSchema#integer"),langString:e.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:e.namedNode("http://www.w3.org/2001/XMLSchema#string")}}H(D);var q=n(3180),W=n.n(q),K=n(6913);function V(e){return new J(e)}var J=function(){function e(t){(0,i.Z)(this,e),(0,u.Z)(this,"_notQNameChars","\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~"),(0,u.Z)(this,"_notNameChars",this._notQNameChars+":"),(0,u.Z)(this,"validPrefix",new RegExp(/^[a-zA-Z][a-zA-Z0-9]*$/)),(0,u.Z)(this,"forbidden1",new RegExp(/[\\"\b\f\r\v\t\n\u0080-\uffff]/gm)),(0,u.Z)(this,"forbidden3",new RegExp(/[\\"\b\f\r\v\u0080-\uffff]/gm)),this.flags="",this.base=null,this.prefixes=[],this.namespaces=[];var n=Object.keys(W()());for(var r in n){var o=W()()[n[r]](""),a=n[r];this.prefixes[o]=a,this.namespaces[a]=o}this.suggestPrefix("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.suggestPrefix("xml","reserved:reservedForFutureUse"),this.namespacesUsed=[],this.keywords=["a"],this.prefixchars="abcdefghijklmnopqustuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",this.incoming=null,this.formulas=[],this.store=t,this.rdfFactory=t.rdfFactory||D,this.xsd=H(this.rdfFactory)}return(0,r.Z)(e,[{key:"setBase",value:function(e){return this.base=e,this}},{key:"setFlags",value:function(e){return this.flags=e||"",this}},{key:"toStr",value:function(e){var t=e.toNT();return"Graph"===e.termType&&(this.formulas[t]=e),t}},{key:"fromStr",value:function(e){if("{"===e[0]){var t=this.formulas[e];return t||console.log("No formula object for "+e),t}return this.store.fromNT(e)}},{key:"setNamespaces",value:function(e){for(var t in e)this.setPrefix(t,e[t]);return this}},{key:"setPrefix",value:function(e,t){if("default"!==e.slice(0,7)&&"ns"!==e.slice(0,2)&&e&&t){for(var n in this.prefixes)this.prefixes[n]==e&&delete this.prefixes[n];this.prefixes[t]=e,this.namespaces[e]=t}}},{key:"suggestPrefix",value:function(e,t){"default"!==e.slice(0,7)&&"ns"!==e.slice(0,2)&&e&&t&&(e in this.namespaces||t in this.prefixes||(this.prefixes[t]=e,this.namespaces[e]=t))}},{key:"suggestNamespaces",value:function(e){for(var t in e)this.suggestPrefix(t,e[t]);return this}},{key:"checkIntegrity",value:function(){var e,t;for(e in this.namespaces)if(this.prefixes[this.namespaces[e]]!==e)throw new Error("Serializer integity error 1: "+e+", "+this.namespaces[e]+", "+this.prefixes[this.namespaces[e]]+"!");for(t in this.prefixes)if(this.namespaces[this.prefixes[t]]!==t)throw new Error("Serializer integity error 2: "+t+", "+this.prefixs[t]+", "+this.namespaces[this.prefixes[t]]+"!")}},{key:"makeUpPrefix",value:function(e){var t=e,n=function(t){return!!this.validPrefix.test(t)&&"ns"!==t&&!(t in this.namespaces)&&(this.prefixes[e]=t,this.namespaces[t]=e,t)}.bind(this);"#/".indexOf(t[t.length-1])>=0&&(t=t.slice(0,-1));var r=t.lastIndexOf("/");r>=0&&(t=t.slice(r+1));for(var i=0;i<t.length&&this.prefixchars.indexOf(t[i]);)i++;if((t=t.slice(0,i)).length<6&&n(t))return t;if(n(t.slice(0,3)))return t.slice(0,3);if(n(t.slice(0,2)))return t.slice(0,2);if(n(t.slice(0,4)))return t.slice(0,4);if(n(t.slice(0,1)))return t.slice(0,1);if(n(t.slice(0,5)))return t.slice(0,5);this.validPrefix.test(t)||(t="n");for(var o=0;;o++)if(n(t.slice(0,3)+o))return t.slice(0,3)+o}},{key:"rootSubjects",value:function(e){for(var t={},n={},r={},i=0;i<e.length;i++){var o=e[i],a=function(e){t.hasOwnProperty(e)||(t[e]=[]),t[e].push(o.subject)};[o.subject,o.predicate,o.object].map((function(e){"BlankNode"===e.termType?r[e.toNT()]=!0:"Collection"===e.termType&&e.elements.forEach((function(e){a(e)}))})),a(e[i].object);var s=n[this.toStr(o.subject)];s||(s=[]),s.push(o),n[this.toStr(o.subject)]=s}var c=[];for(var u in n)if(n.hasOwnProperty(u)){var l=this.fromStr(u);"BlankNode"===l.termType&&t[l]&&1===t[l].length||c.push(l)}this.incoming=t;for(var d={},p=0;p<c.length;p++)d[c[p].toNT()]=!0;return{roots:c,subjects:n,rootsHash:d,incoming:t}}},{key:"toN3",value:function(e){return this.statementsToN3(e.statements)}},{key:"explicitURI",value:function(e){return"<"+(e=this.flags.indexOf("r")<0&&this.base?I.refTo(this.base,e):this.flags.indexOf("u")>=0?function(e){for(var t,n="",r=0;r<e.length;r++)n+=(t=e.charCodeAt(r))>65535?"\\U"+("00000000"+t.toString(16)).slice(-8):t>126?"\\u"+("0000"+t.toString(16)).slice(-4):e[r];return n}(e):encodeURI(e))+">"}},{key:"statementsToNTriples",value:function(e){var t=e.slice();t.sort();for(var n="",r="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i=this,o=this.store,a=this.rdfFactory,s=function e(t){if("Collection"!==t.termType)return i.atomicTermToN3(t);for(var s=t.elements,c=o.sym(r+"nill"),u=s.length-1;u>=0;u--){var l=a.blankNode();n+=e(l)+" "+e(o.sym(r+"first"))+" "+e(s[u])+".\n",n+=e(l)+" "+e(o.sym(r+"rest"))+" "+e(c)+".\n",c=l}return i.atomicTermToN3(c)},c=0;c<t.length;c++){var u=t[c],l="";l+=s(u.subject)+" ",l+=s(u.predicate)+" ",l+=s(u.object)+" ",this.flags.indexOf("q")>=0&&(l+=s(u.why)+" "),n+=l+=".\n"}return n}},{key:"statementsToN3",value:function(t){var n=this.store,r={"http://www.w3.org/1999/02/22-rdf-syntax-ns#type":"aaa:00"};t.sort((function(e,t){return B.heavyCompareSPO(e,t,n,r)})),this.base&&!this.defaultNamespace&&(this.defaultNamespace=this.base+"#");var i={};this.flags.indexOf("s")<0&&(i["http://www.w3.org/2002/07/owl#sameAs"]="="),this.flags.indexOf("t")<0&&(i["http://www.w3.org/1999/02/22-rdf-syntax-ns#type"]="a"),this.flags.indexOf("i")<0&&(i["http://www.w3.org/2000/10/swap/log#implies"]="=>");var o=function(e){for(var t="",n=0;n<e;n++)t+=" ";return t},a=function e(t){for(var n="",r=0;r<t.length;r++){var i=t[r],o="string"==typeof i?i:e(i);if(0!==r){var a=n.slice(-1)||" ";","===o||";"===o||("."!==o||"0123456789.:".includes(a))&&(n+=" ")}n+=o}return n},s=function(e){for(var t=this.rootSubjects(e),n=t.roots,r=[],i=0;i<n.length;i++){var o=n[i];r.push(c(o,t))}return r}.bind(this);function c(e,t){return"BlankNode"!==e.termType||t.incoming[e]?[d(e,t)].concat([u(e,t)]).concat(["."]):l(e,t,!0).concat(["."])}var u=function(e,t){var n=[],r=null,o=t.subjects[this.toStr(e)]||[];if(void 0===o)throw new Error("Cant find statements for "+e);for(var a=[],s=0;s<o.length;s++){var c=o[s];c.predicate.uri===r?a.push(","):(r&&(n=n.concat([a]).concat([";"]),a=[]),n.push(i[c.predicate.uri]?i[c.predicate.uri]:d(c.predicate,t))),r=c.predicate.uri,a.push(l(c.object,t))}return n.concat([a])}.bind(this),l=function(e,t,n){return"BlankNode"!==e.termType||!n&&void 0!==t.rootsHash[e.toNT()]?d(e,t):t.subjects[this.toStr(e)]?["[",u(e,t),"]"]:"[]"}.bind(this);e.prototype.termToN3=d;var d=function(e,t){var n,r;switch(e.termType){case"Graph":return(r=(r=["{"]).concat(s(e.statements))).concat(["}"]);case"Collection":for(r=["("],n=0;n<e.elements.length;n++)r.push([l(e.elements[n],t)]);return r.push(")"),r;default:return this.atomicTermToN3(e)}}.bind(this),p=function(){var e="";for(var t in this.flags.indexOf("d")<0&&this.defaultNamespace&&(e+="@prefix : "+this.explicitURI(this.defaultNamespace)+".\n"),this.prefixes)this.prefixes.hasOwnProperty(t)&&this.namespacesUsed[t]&&(e+="@prefix "+this.prefixes[t]+": "+this.explicitURI(t)+".\n");return e+"\n"}.bind(this),f=s(t);return p()+function e(t,n){var r="",i=1e5;void 0===n&&(n=-1);for(var s=0;s<t.length;s++){var c=t[s];if("string"!=typeof c){var u=e(c,n+1);if(u.length<10*(80-4*n)&&u.indexOf('"""')<0){var l=a(c);l.length<80-4*n&&(c=l,u="")}u&&(i=1e4),r+=u}if("string"==typeof c){if(1===c.length&&"\n"===r.slice(-1)&&",.;".indexOf(c)>=0){r=r.slice(0,-1),"."==c&&"0123456789.:".includes(r.charAt(r.length-1))&&(r+=" ",i+=1),r+=c+"\n",i+=1;continue}if(i<4*n+4||i+c.length+1<80&&";.".indexOf(r[r.length-2])<0)r=r.slice(0,-1)+" "+c+"\n",i+=c.length+1;else{var d=o(4*n)+c;r+=d+"\n",i=d.length,n<0&&(r+="\n",i=1e5)}}}return r}(f)}},{key:"atomicTermToN3",value:function(e,t){switch(e.termType){case"BlankNode":case"Variable":return e.toNT();case"Literal":var n=e.value;if("string"!=typeof n)throw new TypeError("Value of RDF literal node must be a string");if(e.datatype&&this.flags.indexOf("x")<0)switch(e.datatype.uri){case"http://www.w3.org/2001/XMLSchema#integer":return n;case"http://www.w3.org/2001/XMLSchema#decimal":return n.indexOf(".")<0&&(n+=".0"),n;case"http://www.w3.org/2001/XMLSchema#double":var r=n.toLowerCase().indexOf("e")>0;return n.indexOf(".")<0&&!r&&(n+=".0"),r||(n+="e0"),n;case"http://www.w3.org/2001/XMLSchema#boolean":return"1"===e.value?"true":"false"}var i=this.stringToN3(e.value);return e.language?i+="@"+e.language:e.datatype.equals(this.xsd.string)||(i+="^^"+this.atomicTermToN3(e.datatype,t)),i;case"NamedNode":return this.symbolToN3(e);case"DefaultGraph":return"";default:throw new Error("Internal: atomicTermToN3 cannot handle "+e+" of termType: "+e.termType)}}},{key:"stringToN3",value:function(e,t){t||(t="e");var n,r,i,o,a,s="";for(e.length>20&&'"'!==e.slice(-1)&&t.indexOf("n")<0&&(e.indexOf("\n")>0||e.indexOf('"')>0)?(o='"""',a=this.forbidden3):(o='"',a=this.forbidden1),n=0;n<e.length&&(a.lastIndex=0,null!=a.exec(e.slice(n)));){r=n+a.lastIndex-1,s+=e.slice(n,r);var c=e[r];'"'===c&&'"""'===o&&'"""'!==e.slice(r,r+3)?s+=c:(i='\b\f\r\t\v\n\\"'.indexOf(c))>=0?s+="\\"+'bfrtvn\\"'[i]:t.indexOf("e")>=0?s+="\\u"+("000"+c.charCodeAt(0).toString(16).toLowerCase()).slice(-4):s+=c,n=r+1}return o+s+e.slice(n)+o}},{key:"symbolToN3",value:function(e){var t=e.uri,n=t.indexOf("#");if(n<0&&this.flags.indexOf("/")<0&&(n=t.lastIndexOf("/")),n>=0&&this.flags.indexOf("p")<0&&(0===t.indexOf("http")||0===t.indexOf("ws")||0===t.indexOf("file"))){for(var r=!0,i=n+1;i<t.length;i++)if(this._notNameChars.indexOf(t[i])>=0){r=!1;break}if(r){var o=t.slice(n+1),a=t.slice(0,n+1);if(this.defaultNamespace&&this.defaultNamespace===a&&this.flags.indexOf("d")<0)return this.flags.indexOf("k")>=0&&this.keyords.indexOf(o)<0?o:":"+o;var s=this.prefixes[a];if(s||(s=this.makeUpPrefix(a)),s)return this.namespacesUsed[a]=!0,s+":"+o}}return this.explicitURI(t)}},{key:"writeStore",value:function(e){var t=this.store,n=t.fetcher,r=n&&n.appNode,i=this.store.index[3];for(var o in i){var a=t.fromNT(o);r&&a.equals(r)||e("\n"+this.atomicTermToN3(a)+" "+this.atomicTermToN3(t.sym("http://www.w3.org/2000/10/swap/log#semantics"))+" { "+this.statementsToN3(t.statementsMatching(void 0,void 0,void 0,a))+" }.\n")}t.statementsMatching(void 0,t.sym("http://www.w3.org/2007/ont/link#requestedURI")).map((function(n){e("\n<"+n.object.value+"> log:metadata {\n");var r=t.statementsMatching(void 0,void 0,void 0,n.subject);e(this.statementsToN3(this.statementsToN3(r))),e("}.\n")}));var s=[];r&&s.push(r);var c=[];s.map((function(e){c=c.concat(t.statementsMatching(void 0,void 0,void 0,e))})),e(this.statementsToN3(c))}},{key:"statementsToXML",value:function(e){var t=[];t["http://www.w3.org/1999/02/22-rdf-syntax-ns#"]=!0;var n="http://www.w3.org/1999/02/22-rdf-syntax-ns#_",r=function(e){for(var t="",n=0;n<e;n++)t+=" ";return t},i=function e(t){for(var n="",r=0;r<t.length;r++){var i=t[r];n+="string"==typeof i?i:e(i)}return n},o=function(e){this.suggestPrefix("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#");for(var t=this.rootSubjects(e),n=t.roots,r=[],i=0;i<n.length;i++){var o=n[i];r.push(c(o,t))}return r}.bind(this);function a(e){return void 0===e?"@@@undefined@@@@":e.replace(/[&<"]/g,(function(e){switch(e[0]){case"&":return"&amp;";case"<":return"&lt;";case'"':return"&quot;"}}))}var s=function(e){return a(this.base?I.refTo(this.base,e.uri):e.uri)}.bind(this),c=function(e,t){var r,i,o,p,f=[],h=t.subjects[this.toStr(e)];if(void 0===h)return l(e,t);h.sort((function(e,t){var r=e.predicate.uri,i=t.predicate.uri;if(r.substring(0,n.length)===n||i.substring(0,n.length)===n)return r.localeCompare(i);var o=r.substring(n.length),a=i.substring(n.length),s=parseInt(o,10),c=parseInt(a,10);return isNaN(s)||isNaN(c)||s!==o||c!==a?r.localeCompare(i):s-c}));for(var m=0;m<h.length;m++)if("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"!==(o=h[m]).predicate.uri||r||"NamedNode"!==o.object.termType){if((p=o.predicate).uri.substr(0,n.length)===n){var g=p.uri.substr(n.length);g===parseInt(g,10).toString()&&(p=this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#li"))}switch(i=d(p),o.object.termType){case"BlankNode":f=1===t.incoming[o.object].length?f.concat(["<"+i+' rdf:parseType="Resource">',c(o.object,t),"</"+i+">"]):f.concat(["<"+i+' rdf:nodeID="'+o.object.toNT().slice(2)+'"/>']);break;case"NamedNode":f=f.concat(["<"+i+' rdf:resource="'+s(o.object)+'"/>']);break;case"Literal":f=f.concat(["<"+i+(o.object.datatype.equals(this.xsd.string)?"":' rdf:datatype="'+a(o.object.datatype.uri)+'"')+(o.object.language?' xml:lang="'+o.object.language+'"':"")+">"+a(o.object.value)+"</"+i+">"]);break;case"Collection":f=f.concat(["<"+i+' rdf:parseType="Collection">',u(o.object,t),"</"+i+">"]);break;default:throw new Error("Can't serialize object of type "+o.object.termType+" into XML")}}else r=o.object;var v=r?d(r):"rdf:Description",y="";return"BlankNode"===e.termType?t.incoming[e]&&1===t.incoming[e].length||(y=' rdf:nodeID="'+e.toNT().slice(2)+'"'):y=' rdf:about="'+s(e)+'"',["<"+v+y+">"].concat([f]).concat(["</"+v+">"])}.bind(this);function u(e,t){for(var n=[],r=0;r<e.elements.length;r++)n.push(c(e.elements[r],t));return n}var l=function(e,t){var n=[],r=t.subjects[this.toStr(e)];if(!r)return n;r.sort();for(var i=0;i<r.length;i++){var o=r[i];switch(o.object.termType){case"BlankNode":n=t.rootsHash[o.object.toNT()]?n.concat(["<"+d(o.predicate)+' rdf:nodeID="'+o.object.toNT().slice(2)+'">',"</"+d(o.predicate)+">"]):n.concat(["<"+d(o.predicate)+' rdf:parseType="Resource">',l(o.object,t),"</"+d(o.predicate)+">"]);break;case"NamedNode":n=n.concat(["<"+d(o.predicate)+' rdf:resource="'+s(o.object)+'"/>']);break;case"Literal":n=n.concat(["<"+d(o.predicate)+(o.object.datatype.equals(this.xsd.string)?"":' rdf:datatype="'+a(o.object.datatype.value)+'"')+(o.object.language?' xml:lang="'+o.object.language+'"':"")+">"+a(o.object.value)+"</"+d(o.predicate)+">"]);break;case"Collection":n=n.concat(["<"+d(o.predicate)+' rdf:parseType="Collection">',u(o.object,t),"</"+d(o.predicate)+">"]);break;default:throw new Error("Can't serialize object of type "+o.object.termType+" into XML")}}return n}.bind(this),d=function(e){var n=e.uri,r=n.indexOf("#");if(r<0&&this.flags.indexOf("/")<0&&(r=n.lastIndexOf("/")),r<0)throw new Error("Cannot make qname out of <"+n+">");for(var i=r+1;i<n.length;i++)if(this._notNameChars.indexOf(n[i])>=0)throw new Error('Invalid character "'+n[i]+'" cannot be in XML qname for URI: '+n);var o=n.slice(r+1),a=n.slice(0,r+1);if(this.defaultNamespace&&this.defaultNamespace===a&&this.flags.indexOf("d")<0)return o;var s=this.prefixes[a];return s||(s=this.makeUpPrefix(a)),t[a]=!0,s+":"+o}.bind(this),p=o(e),f="<rdf:RDF";for(var h in this.defaultNamespace&&(f+=' xmlns="'+a(this.defaultNamespace)+'"'),t)if(t.hasOwnProperty(h)){var m=this.base&&this.flags.includes("z")?I.refTo(this.base,h):h;f+="\n xmlns:"+this.prefixes[h]+'="'+a(m)+'"'}return function e(t,n){var o,a="",s=1e5;n||(n=0);for(var c=0;c<t.length;c++){var u=t[c];if("string"!=typeof u){var l=e(u,n+1);l.length<10*(80-4*n)&&l.indexOf('"""')<0&&(o=i(u)).length<80-4*n&&(u=" "+o,l=""),l&&(s=1e4),a+=l}"string"==typeof u&&(s<4*n+4?(a=a.slice(0,-1)+" "+u+"\n",s+=u.length+1):(a+=(o=r(4*n)+u)+"\n",s=o.length))}return a}([f+=">",p,"</rdf:RDF>"],-1)}},{key:"statementsToJsonld",value:function(e){var t=this.statementsToN3(e),n=K.parse(t);return JSON.stringify(n,null,2)}}]),e}();function z(e,t,n,r,i,o){n=n||(null==e?void 0:e.value);var a=o||{};r=r||p.z8;try{var s=V(t);a.flags&&s.setFlags(a.flags);var c=t.statementsMatching(void 0,void 0,void 0,e);switch("namespaces"in t&&s.suggestNamespaces(t.namespaces),a.namespaces&&s.setNamespaces(a.namespaces),s.setBase(n),r){case p.Is:return u(null,s.statementsToXML(c));case p.qS:case p.sZ:return u(null,s.statementsToN3(c));case p.z8:case p.Eo:return s.setFlags("si"),u(null,s.statementsToN3(c));case p.aV:return s.setFlags("deinprstux"),u(null,s.statementsToNTriples(c));case p.ui:return s.setFlags("si dr"),u(null,s.statementsToJsonld(c));case p.b4:case p.lL:return s.setFlags("deinprstux q"),u(null,s.statementsToNTriples(c));default:throw new Error("Serialize: Content-type "+r+" not supported for data write.")}}catch(e){if(i)return i(e,void 0);throw e}function u(e,t){return i?void i(e,t):t}}var Z=["blankNode","defaultGraph","literal","namedNode","quad","variable","supports"],$="http://www.w3.org/1999/02/22-rdf-syntax-ns#rest";function G(e,t,n){var r=[];return n.reduce((function(t,n,i,o){var a;return r.push(e.quad(t,e.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#first"),o[i])),i<o.length-1?(a=e.blankNode(),r.push(e.quad(t,e.namedNode($),a))):r.push(e.quad(t,e.namedNode($),e.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"))),a}),t),r}function X(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=e.length;for(n<0&&(n=r+n);n<r;n++)if(e[n]===t)return n;return-1}function Q(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Y(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ee=function(e){(0,a.Z)(h,e);var t,n,f=(t=h,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return(0,s.Z)(this,e)});function h(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};(0,i.Z)(this,h),(e=f.call(this,"")).statements=t,e.constraints=n,e.initBindings=r,e.optional=a,(0,u.Z)((0,o.Z)(e),"termType",p._A),(0,u.Z)((0,o.Z)(e),"classOrder",l.Z.Graph),(0,u.Z)((0,o.Z)(e),"fetcher",void 0),(0,u.Z)((0,o.Z)(e),"isVar",0),(0,u.Z)((0,o.Z)(e),"ns",U),(0,u.Z)((0,o.Z)(e),"rdfFactory",void 0),e.rdfFactory=s&&s.rdfFactory||D;var c,d=Q(Z);try{var m=function(){var t=c.value;e[t]=function(){var n;return(n=e.rdfFactory)[t].apply(n,arguments)}};for(d.s();!(c=d.n()).done;)m()}catch(e){d.e(e)}finally{d.f()}return e}return(0,r.Z)(h,[{key:"add",value:function(e,t,n,r){var i=this;return 1===arguments.length&&e.forEach((function(e){return i.add(e.subject,e.predicate,e.object,e.graph)})),this.statements.push(this.rdfFactory.quad(e,t,n,r))}},{key:"addStatement",value:function(e){return this.add(e)}},{key:"bnode",value:function(e){return this.rdfFactory.blankNode(e)}},{key:"addAll",value:function(e){var t=this;e.forEach((function(e){t.add(e.subject,e.predicate,e.object,e.graph)}))}},{key:"any",value:function(e,t,n,r){var i=this.anyStatementMatching(e,t,n,r);return null==i?null:null==e?i.subject:null==t?i.predicate:null==n?i.object:null}},{key:"anyValue",value:function(e,t,n,r){var i=this.any(e,t,n,r);return i?i.value:void 0}},{key:"anyJS",value:function(e,t,n,r){var i=this.any(e,t,n,r);return i?d.Z.toJS(i):void 0}},{key:"anyStatementMatching",value:function(e,t,n,r){var i=this.statementsMatching(e,t,n,r,!0);if(i&&0!==i.length)return i[0]}},{key:"id",value:function(e){return this.rdfFactory.id(e)}},{key:"statementsMatching",value:function(e,t,n,r,i){var o=this.statements.filter((function(i){return(!e||e.equals(i.subject))&&(!t||t.equals(i.predicate))&&(!n||n.equals(i.object))&&(!r||r.equals(i.graph))}));return i?0===o.length?[]:[o[0]]:o}},{key:"bottomTypeURIs",value:function(e){var t,n,r,i,o,a;for(var s in t=[],e)if(e.hasOwnProperty(s)){for(a=e[s],n=!0,r=0,i=(o=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),this.rdfFactory.namedNode(s))).length;r<i;r++)if(o[r].uri in e){n=!1;break}n&&(t[s]=a)}return t}},{key:"collection",value:function(){return new w}},{key:"each",value:function(e,t,n,r){var i=[],o=this.statementsMatching(e,t,n,r,!1);if(null==e)for(var a=0,s=o.length;a<s;a++)i.push(o[a].subject);else if(null==t)for(var c=0,u=o.length;c<u;c++)i.push(o[c].predicate);else if(null==n)for(var l=0,d=o.length;l<d;l++)i.push(o[l].object);else if(null==r)for(var p=0,f=o.length;p<f;p++)i.push(new m.Z(o[p].graph.value));return i}},{key:"equals",value:function(e){return!!e&&this.hashString()===e.hashString()}},{key:"findMembersNT",value:function(e){var t,n,r,i,o,a,s,c,u,l,d,p,f,h;for(var m in(p={})[e.toNT()]=!0,i={},a=this.transitiveClosure(p,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0))if(a.hasOwnProperty(m)){for(var g=0,v=(s=this.statementsMatching(void 0,this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),this.fromNT(m))).length;g<v;g++)i[(f=s[g]).subject.toNT()]=f;for(var y=0,b=(c=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"),this.fromNT(m))).length;y<b;y++)for(o=c[y],r=0,t=(u=this.statementsMatching(void 0,o)).length;r<t;r++)i[(f=u[r]).subject.toNT()]=f;for(var w=0,x=(l=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"),this.fromNT(m))).length;w<x;w++)for(o=l[w],h=0,n=(d=this.statementsMatching(void 0,o)).length;h<n;h++)i[(f=d[h]).object.toNT()]=f}return i}},{key:"findMemberURIs",value:function(e){return this.NTtoURI(this.findMembersNT(e))}},{key:"findSubClassesNT",value:function(e){var t={};return t[e.toNT()]=!0,this.transitiveClosure(t,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0)}},{key:"findSuperClassesNT",value:function(e){var t={};return t[e.toNT()]=!0,this.transitiveClosure(t,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}},{key:"findTypesNT",value:function(e){var t,n,r,i,o,a;a=[];for(var s=0,c=(t=this.statementsMatching(e,void 0,void 0)).length;s<c;s++)if("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"===(o=t[s]).predicate.uri)a[o.object.toNT()]=o;else for(var u=0,l=(n=this.each(o.predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"))).length;u<l;u++)a[n[u].toNT()]=o;for(var d=0,p=(r=this.statementsMatching(void 0,void 0,e)).length;d<p;d++){o=r[d];for(var f=0,h=(i=this.each(o.predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"))).length;f<h;f++)a[i[f].toNT()]=o}return this.transitiveClosure(a,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}},{key:"findTypeURIs",value:function(e){return this.NTtoURI(this.findTypesNT(e))}},{key:"connectedStatements",value:function(e,t,n){n=n||[];for(var r=[e],i={},o={},a=[],s=this,c=function(e){var c=function(e){"BlankNode"!==e.termType||i[e.value]||(i[e.value]=!0,r.push(e))},u=s.statementsMatching(null,null,e,t).concat(s.statementsMatching(e,null,null,t));u=u.filter((function(e){if(n[e.predicate.value])return!1;var t=e.toNT();return!o[t]&&(o[t]=!0,!0)})),u.forEach((function(e){c(e.subject),c(e.object)})),a=a.concat(u)};r.length;)c(r.shift());return a}},{key:"formula",value:function(e){return new h}},{key:"fromNT",value:function(e){var t,n,r;switch(e[0]){case"<":return this.sym(e.slice(1,-1));case'"':if(r=void 0,t=void 0,(n=e.lastIndexOf('"'))<e.length-1)if("@"===e[n+1])r=e.slice(n+2);else{if("^^"!==e.slice(n+1,n+3))throw new Error("Can't convert string from NT: "+e);t=this.fromNT(e.slice(n+3))}return e=(e=(e=(e=e.slice(1,n)).replace(/\\"/g,'"')).replace(/\\n/g,"\n")).replace(/\\\\/g,"\\"),this.rdfFactory.literal(e,r||t);case"_":return this.rdfFactory.blankNode(e.slice(2));case"?":return new F(e.slice(1))}throw new Error("Can't convert from NT: "+e)}},{key:"holds",value:function(e,t,n,r){var i;if(1===arguments.length){if(!e)return!0;if(e instanceof Array){for(i=0;i<e.length;i++)if(!this.holds(e[i]))return!1;return!0}if((0,g.Yi)(e))return this.holds(e.subject,e.predicate,e.object,e.graph);if(e.statements)return this.holds(e.statements)}var o=this.anyStatementMatching(e,t,n,r);return null!=o}},{key:"holdsStatement",value:function(e){return this.holds(e.subject,e.predicate,e.object,e.graph)}},{key:"list",value:function(e,t){if(t.rdfFactory.supports.COLLECTIONS){var n=t.rdfFactory.collection();return e.forEach((function(e){n.append(e)})),n}var r=t.rdfFactory.blankNode(),i=G(t.rdfFactory,r,e);return t.addAll(i),r}},{key:"NTtoURI",value:function(e){var t,n,r={};for(t in e)e.hasOwnProperty(t)&&(n=e[t],"<"===t[0]&&(r[t.slice(1,-1)]=n));return r}},{key:"serialize",value:function(e,t,n,r){return z(n,this,e,t,void 0,r)}},{key:"substitute",value:function(e){var t=this.statements.map((function(t){return t.substitute(e)})),n=new h;return n.addAll(t),n}},{key:"sym",value:function(e,t){if(t)throw new Error("This feature (kb.sym with 2 args) is removed. Do not assume prefix mappings.");return this.rdfFactory.namedNode(e)}},{key:"the",value:function(e,t,n,r){var i=this.any(e,t,n,r);return null==i&&M.Z.error("No value found for the() {"+e+" "+t+" "+n+"}."),i}},{key:"transitiveClosure",value:function(e,t,n){var r,i,o,a,s,c={};Object.assign(c,e);for(var u={};;){if(null==(s=function(){for(var e in c)if(c.hasOwnProperty(e))return e}()))return u;for(r=0,i=(a=n?this.each(void 0,t,this.fromNT(s)):this.each(this.fromNT(s),t)).length;r<i;r++)(o=a[r].toNT())in u||o in c||(c[o]=c[s]);u[s]=c[s],delete c[s]}}},{key:"topTypeURIs",value:function(e){var t,n,r,i,o,a,s;for(n in a=[],e)if(e.hasOwnProperty(n)){for(s=e[n],i=0,t=0,r=(o=this.each(this.rdfFactory.namedNode(n),this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"))).length;t<r;t++)if("http://www.w3.org/2000/01/rdf-schema#Resource"!==o[t].uri){i++;break}i||(a[n]=s)}return a["http://www.w3.org/2000/01/rdf-schema#Resource"]&&delete a["http://www.w3.org/2000/01/rdf-schema#Resource"],a["http://www.w3.org/2002/07/owl#Thing"]&&delete a["http://www.w3.org/2002/07/owl#Thing"],a}},{key:"toString",value:function(){return"{"+this.statements.join("\n")+"}"}},{key:"variable",value:function(e){return new F(e)}},{key:"whether",value:function(e,t,n,r){return this.statementsMatching(e,t,n,r,!1).length}}]),h}(d.Z);d.Z.fromValue=b;const te=d.Z;var ne={xsd:U("http://www.w3.org/2001/XMLSchema#")};d.Z.toJS=function(e){return(0,g.uZ)(e)?e.elements.map(d.Z.toJS):(0,g.n_)(e)?e.datatype.equals(ne.xsd("boolean"))?"1"===e.value||"true"===e.value:e.datatype.equals(ne.xsd("dateTime"))||e.datatype.equals(ne.xsd("date"))?new Date(e.value):e.datatype.equals(ne.xsd("integer"))||e.datatype.equals(ne.xsd("float"))||e.datatype.equals(ne.xsd("decimal"))?Number(e.value):e.value:e};var re=(0,r.Z)((function e(t,n){(0,i.Z)(this,e),this.pat=new fe,this.vars=[],this.name=t,this.id=n}));function ie(e,t,n,r){function i(e){var t,n="";for(t in e)e.hasOwnProperty(t)&&(n+=" "+t+" -> "+e[t]);return n}function o(e){var t,n="Bindings: ",r=e.length;for(t=0;t<r;t++)n+=i(e[t][0])+";\n\t";return n}function a(e,t,n,r){var i;if(e.length!==t.length)return[];if(!e.length)return[[[],null]];var o=function(e,t,n,r){var i=n[e];if(void 0===i){if(e.isVar){var o=[];return o[e]=t,[[o,null]]}i=e}if(!i.complexType)return r.redirections[i]&&(i=r.redirections[i]),r.redirections[t]&&(t=r.redirections[t]),i.equals(t)||i.uri&&i.uri===C?[[[],null]]:[];if(e instanceof Array)return t instanceof Array?a(e,t,n):[];throw new Error("query.js: oops - code not written yet")}(e[0],t[0],n,r);if(0===o.length)return o;var s,c,u,l,d,p,f,h=[],m=o.length;for(s=0;s<m;s++){for(d in f=[],c=o[s][0])c.hasOwnProperty(d)&&(f[d]=c[d]);for(d in n)n.hasOwnProperty(d)&&(f[d]=n[d]);for(l=(i=a(e.slice(1),t.slice(1),f,r)).length,u=0;u<l;u++){for(d in p=i[u][0],c)c.hasOwnProperty(d)&&(p[d]=c[d]);h.push([p,null])}}return h}function s(e,t){var n,r={};for(n in e)e.hasOwnProperty(n)&&(r[n]=e[n]);for(n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);return r}function c(e,t){return this.trunkBindings=t,this.originalCallback=e,this.branches=[],this}function u(e,t){return this.count=0,this.success=!1,this.done=!1,this.callback=e,this.onDone=t,this}c.prototype.checkAllDone=function(){var e;for(e=0;e<this.branches.length;e++)if(!this.branches[e].done)return;M.Z.debug("OPTIONAL BIDNINGS ALL DONE:"),this.doCallBacks(this.branches.length-1,this.trunkBindings)},c.prototype.doCallBacks=function(e,t){var n;if(e<0)return this.originalCallback(t);for(n=0;n<this.branches[e].results.length;n++)this.doCallBacks(e-1,s(t,this.branches[e].results[n]))},u.prototype.reportMatch=function(e){this.callback(e),this.success=!0},u.prototype.reportDone=function(){this.done=!0,M.Z.info("Mandatory query branch finished.***"),void 0!==this.onDone&&this.onDone()};var l=function(e){return this.count=0,this.done=!1,this.results=[],this.junction=e,e.branches.push(this),this};function d(e,t,n){var r,i,o,a,s,c;for(t.nvars=0,t.index=null,r=[t.subject,t.predicate,t.object,t.why],a=[e.subjectIndex,e.predicateIndex,e.objectIndex,e.whyIndex],o=0;o<4;o++){var u=r[o];if(u.uri&&u.uri===C);else if(u.isVar&&void 0===n[u])t.nvars++;else{if(void 0,u=void 0===(c=n[s=r[o]])?s:c,e.redirections[e.id(u)]&&(u=e.redirections[e.id(u)]),!(i=a[o][e.id(u)]))return t.index=[],!1;(null===t.index||t.index.length>i.length)&&(t.index=i)}}return null===t.index&&(t.index=e.statements),!0}function p(e,t){return e.nvars!==t.nvars?e.nvars-t.nvars:e.index.length-t.index.length}l.prototype.reportMatch=function(e){this.results.push(e)},l.prototype.reportDone=function(){M.Z.debug("Optional branch finished - results.length = "+this.results.length),0===this.results.length&&(this.results.push({}),M.Z.debug("Optional branch FAILED - that's OK.")),this.done=!0,this.junction.checkAllDone()};var f=function e(n,r,o,a,s,u,d){M.Z.debug("Match begins, Branch count now: "+d.count+" for "+d.pattern_debug);var p,f,h=r.statements;if(0===h.length){if(M.Z.debug("FOUND MATCH WITH BINDINGS:"+i(o)),0===r.optional.length)d.reportMatch(o);else{M.Z.debug("OPTIONAL: "+r.optional);var g,v=new c(t,o),y=[];for(g=0;g<r.optional.length;g++)y[g]=new l(v),y[g].pattern_debug=r.optional[g];for(g=0;g<r.optional.length;g++)y[g].count=y[g].count+1,e(n,r.optional[g],o,"",s,t,y[g])}return d.count--,void M.Z.debug("Match ends -- success , Branch count now: "+d.count+" for "+d.pattern_debug)}var b=h.length;if(s){var w=function(t,i){var c=t.uri.split("#")[0];s.nowOrWhenFetched(c,void 0,(function(i,c,l){i||console.log("Error following link to <"+t.uri+"> in query: "+c),e(n,r,o,a,s,u,d)}))};for(f=0;f<b;f++){if(p=h[f],void 0!==o[p.subject]&&o[p.subject].uri&&s&&"unrequested"===s.getState((0,I.docpart)(o[p.subject].uri)))return void w(o[p.subject]);if(void 0!==o[p.object]&&o[p.object].uri&&s&&"unrequested"===s.getState((0,I.docpart)(o[p.object].uri)))return void w(o[p.object])}}m(n,r,o,a,s,u,d)},h=function(e,t){var n,r,i=!0;for(n in e)e.hasOwnProperty(n)&&t[n]&&(r=t[n].test)&&!r(e[n])&&(i=!1);return i},m=function(e,t,n,r,s,c,u){var l,m,g,v,y,b,w,x=t.statements,_=x.length;for(l=0;l<_;l++)d(e,w=x[l],n);x.sort(p),w=x[0];var E,k=e.formula();k.optional=t.optional,k.constraints=t.constraints,k.statements=x.slice(1),M.Z.debug(r+"match2 searching "+w.index.length+" for "+w+"; bindings so far="+i(n));var S,C,A=w.index.length,T=0;for(E=0;E<A;E++)for(C=w.index[E],S=a([w.subject,w.predicate,w.object,w.why],[C.subject,C.predicate,C.object,C.why],n,e),M.Z.info(r+" From first: "+S.length+": "+o(S)),g=S.length,m=0;m<g;m++)if(y=[],b=S[m][0],h(b,t.constraints)){for(v in b)b.hasOwnProperty(v)&&(y[v]=b[v]);for(v in n)n.hasOwnProperty(v)&&(y[v]=n[v]);u.count++,T++,f(e,k,y,r+" ",s,c,u)}else M.Z.debug("Branch count CS: "+u.count);u.count--,0===T&&M.Z.debug("Match2 fails completely on "+w),M.Z.debug("Match2 ends, Branch count: "+u.count+" for "+u.pattern_debug),0===u.count&&(M.Z.debug("Branch finished."),u.reportDone())},g=this;M.Z.debug("Query on "+this.statements.length);var v=new u(t,r);v.count++,e.sync?f(g,e.pat,e.pat.initBindings,"",n,t,v):setTimeout((function(){f(g,e.pat,e.pat.initBindings,"",n,t,v)}),0)}function oe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ae(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(n),!0).forEach((function(t){(0,u.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function se(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ce(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ce(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ue="http://www.w3.org/2002/07/owl#";function le(e,t,n,r){var i=e.any(t,n,void 0);return!!i&&(e.equate(i,r),!0)}function de(e,t,n,r){var i=e.any(void 0,n,r);return!!i&&(e.equate(i,t),!0)}function pe(e,t,n,r,i){e.typeCallback&&e.typeCallback(e,r,i);var o=e.classActions[e.id(r)],a=!1;if(o)for(var s=0;s<o.length;s++)a=a||o[s](e,t,n,r,i);return a}var fe=function(e){(0,a.Z)(h,e);var t,n,d=(t=h,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return(0,s.Z)(this,e)});function h(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,i.Z)(this,h),t=d.call(this,void 0,void 0,void 0,void 0,n),(0,u.Z)((0,o.Z)(t),"updater",void 0),(0,u.Z)((0,o.Z)(t),"namespaces",void 0),(0,u.Z)((0,o.Z)(t),"classActions",void 0),(0,u.Z)((0,o.Z)(t),"propertyActions",void 0),(0,u.Z)((0,o.Z)(t),"redirections",void 0),(0,u.Z)((0,o.Z)(t),"aliases",void 0),(0,u.Z)((0,o.Z)(t),"HTTPRedirects",void 0),(0,u.Z)((0,o.Z)(t),"subjectIndex",void 0),(0,u.Z)((0,o.Z)(t),"predicateIndex",void 0),(0,u.Z)((0,o.Z)(t),"objectIndex",void 0),(0,u.Z)((0,o.Z)(t),"whyIndex",void 0),(0,u.Z)((0,o.Z)(t),"index",void 0),(0,u.Z)((0,o.Z)(t),"features",void 0),(0,u.Z)((0,o.Z)(t),"_universalVariables",void 0),(0,u.Z)((0,o.Z)(t),"_existentialVariables",void 0),(0,u.Z)((0,o.Z)(t),"rdfArrayRemove",void 0),(0,u.Z)((0,o.Z)(t),"dataCallbacks",void 0),t.propertyActions={},t.classActions={},t.redirections=[],t.aliases=[],t.HTTPRedirects=[],t.subjectIndex=[],t.predicateIndex=[],t.objectIndex=[],t.whyIndex=[],t.index=[t.subjectIndex,t.predicateIndex,t.objectIndex,t.whyIndex],t.namespaces={},t.features=e||[],t.rdfArrayRemove=n.rdfArrayRemove||B.RDFArrayRemove,n.dataCallback&&(t.dataCallbacks=[n.dataCallback]),t.initPropertyActions(t.features),t}return(0,r.Z)(h,[{key:"substitute",value:function(e){var t=this.statements.map((function(t){return t.substitute(e)})),n=new h;return n.add(t),n}},{key:"addDataCallback",value:function(e){this.dataCallbacks||(this.dataCallbacks=[]),this.dataCallbacks.push(e)}},{key:"applyPatch",value:function(e,t,n){var r,i=this,o=null;function a(a){if(e.delete){r=e.delete,o&&(r=r.substitute(o)),r=r.statements;var s=[],c=r.map((function(e){var n=i.statementsMatching(e.subject,e.predicate,e.object,t);return 0===n.length?(s.push(e),null):n[0]}));if(s.length)return n("Could not find to delete: "+s.join("\n or "));c.map((function(e){i.remove(e)}))}e.insert&&(r=e.insert,o&&(r=r.substitute(o)),(r=r.statements).map((function(e){e.graph=t,i.add(e.subject,e.predicate,e.object,e.graph)}))),a()}if(e.where){var s=new re("patch");s.pat=e.where,s.pat.statements.map((function(e){e.graph=yn(t.value)})),s.sync=!0;var c=[];i.query(s,(function(e){c.push(e)}),i.fetcher,(function(){return 0===c.length?n("No match found to be patched:"+e.where):c.length>1?n("Patch ambiguous. No patch done."):(o=c[0],void a(n))}))}else a(n)}},{key:"declareExistential",value:function(e){return this._existentialVariables||(this._existentialVariables=[]),this._existentialVariables.push(e),e}},{key:"initPropertyActions",value:function(e){this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"))]=[pe],X(e,"sameAs")>=0&&(this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode("".concat(ue,"sameAs")))]=[function(e,t,n,r,i){return e.equate(t,r),!0}]),X(e,"InverseFunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode("".concat(ue,"InverseFunctionalProperty")))]=[function(e,t,n,r,i){return e.newPropertyAction(t,de)}]),X(e,"FunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode("".concat(ue,"FunctionalProperty")))]=[function(e,t,n,r,i){return e.newPropertyAction(t,le)}])}},{key:"addStatement",value:function(e){return this.add(e.subject,e.predicate,e.object,e.graph),this.statements.length}},{key:"add",value:function(e,t,n,r){var i,o,a;if(1===arguments.length){if(e instanceof Array)for(i=0;i<e.length;i++)this.add(e[i]);else(0,g.PY)(e)?this.add(e.subject,e.predicate,e.object,e.graph):(0,g.Pv)(e)&&this.add(e.statements);return this}r||(r=this.fetcher?this.fetcher.appNode:this.rdfFactory.defaultGraph()),"string"==typeof e&&(e=this.rdfFactory.namedNode(e)),t=te.fromValue(t);var s=te.fromValue(n);if(r=te.fromValue(r),!(0,g.f)(e))throw new Error("Subject is not a subject type");if(!(0,g.nq)(t))throw new Error("Predicate ".concat(t," is not a predicate type"));if(!(0,g.Uc)(s))throw new Error("Object ".concat(s," is not an object type"));if(!(0,g.NA)(r))throw new Error("Why is not a graph type");this.predicateCallback&&this.predicateCallback(this,t,r);var c=this.id(this.canon(t)),u=!1;if(o=this.propertyActions[c])for(i=0;i<o.length;i++)u=u||o[i](this,e,t,s,r);if(this.holds(e,t,s,r))return null;var l=[this.id(this.canon(e)),c,this.id(this.canon(s)),this.id(this.canon(r))];for(a=this.rdfFactory.quad(e,t,s,r),i=0;i<4;i++){var d=this.index[i],p=l[i];d[p]||(d[p]=[]),d[p].push(a)}if(this.statements.push(a),this.dataCallbacks){var f,h=se(this.dataCallbacks);try{for(h.s();!(f=h.n()).done;){var m=f.value;m(a)}}catch(e){h.e(e)}finally{h.f()}}return a}},{key:"canon",value:function(e){if(!e)return e;var t=this.redirections[this.id(e)];if(t)return t;switch(e.termType){case p.V1:return new f(e.value);case p.fb:return e;case p.NK:return new A;case p.ls:case p._A:return e;case p.xH:return new y(e.value,e.language,e.datatype);case p.XM:return new m.Z(e.value);case p.UH:return new F(e.value);default:throw new Error("Term Type not recognized for canonization: ".concat(e.termType))}}},{key:"check",value:function(){this.checkStatementList(this.statements);for(var e=0;e<4;e++){var t=this.index[e];for(var n in t)t.hasOwnProperty(n)&&this.checkStatementList(t[n],e)}}},{key:"checkStatementList",value:function(e,t){void 0===t&&(t=0);for(var n,r=" found in "+["subject","predicate","object","why"][t]+" index.",i=0;i<e.length;i++){for(var o=[(n=e[i]).subject,n.predicate,n.object,n.graph],a=function(e,t){for(var n=0;n<e.length;n++)if(e[n].subject.equals(t.subject)&&e[n].predicate.equals(t.predicate)&&e[n].object.equals(t.object)&&e[n].why.equals(t.graph))return!0},s=0;s<4;s++){var c=this.canon(o[s]),u=this.id(c);this.index[s][u]&&a(this.index[s][u],n)}if(!a(this.statements,n))throw new Error("Statement list does not statement "+n+"@"+n.graph+r)}}},{key:"close",value:function(){return this}},{key:"compareTerms",value:function(e,t){return Object.prototype.hasOwnProperty.call(e,"compareTerm")?e.compareTerm(t):l.Z[e.termType]<l.Z[t.termType]?-1:l.Z[e.termType]>l.Z[t.termType]?1:e.value<t.value?-1:e.value>t.value?1:0}},{key:"copyTo",value:function(e,t,n){n||(n=[]);var r=this.statementsMatching(e);-1!==X(n,"two-direction")&&r.concat(this.statementsMatching(void 0,void 0,e));for(var i=0;i<r.length;i++){var o=r[i];switch(o.object.termType){case"NamedNode":this.add(t,o.predicate,o.object);break;case"Literal":case"BlankNode":case"Collection":this.add(t,o.predicate,o.object.copy(this))}-1!==X(n,"delete")&&this.remove(o)}}},{key:"equate",value:function(e,t){var n=this.canon(e),r=this.canon(t),i=this.compareTerms(n,r);return!i||(i<0?this.replaceWith(r,n):this.replaceWith(n,r))}},{key:"formula",value:function(e){return new h(e)}},{key:"length",get:function(){return this.statements.length}},{key:"match",value:function(e,t,n,r){return this.statementsMatching(te.fromValue(e),te.fromValue(t),te.fromValue(n),te.fromValue(r))}},{key:"mentionsURI",value:function(e){var t="<"+e+">";return!!this.subjectIndex[t]||!!this.objectIndex[t]||!!this.predicateIndex[t]}},{key:"newExistential",value:function(e){if(!e)return this.bnode();var t=this.sym(e);return this.declareExistential(t)}},{key:"newPropertyAction",value:function(e,t){var n=this.id(e);this.propertyActions[n]||(this.propertyActions[n]=[]),this.propertyActions[n].push(t);for(var r=this.statementsMatching(void 0,e,void 0),i=!1,o=0;o<r.length;o++)i=i||t(this,r[o].subject,e,r[o].object);return i}},{key:"newUniversal",value:function(e){var t=this.sym(e);return this._universalVariables||(this._universalVariables=[]),this._universalVariables.push(t),t}},{key:"variable",value:function(e){return new F(e)}},{key:"nextSymbol",value:function(e){for(var t=0;;t++){var n=e.value+"#n"+t;if(!this.mentionsURI(n))return this.sym(n)}}},{key:"query",value:function(e,t,n,r){return ie.call(this,e,t,n,r)}},{key:"querySync",value:function(e){var t=[],n=!1;if(e.sync=!0,ie.call(this,e,(function(e){t.push(e)}),null,(function(){n=!0})),!n)throw new Error("Sync query should have called done function");return t}},{key:"remove",value:function(e){if(e instanceof Array){for(var t=0;t<e.length;t++)this.remove(e[t]);return this}if((0,g.Pv)(e))return this.remove(e.statements);var n=this.statementsMatching(e.subject,e.predicate,e.object,e.graph);if(!n.length)throw new Error("Statement to be removed is not on store: "+e);return this.removeStatement(n[0]),this}},{key:"removeDocument",value:function(e){for(var t=this.statementsMatching(void 0,void 0,void 0,e).slice(),n=0;n<t.length;n++)this.removeStatement(t[n]);return this}},{key:"removeMany",value:function(e,t,n,r,i){for(var o=this.statementsMatching(e,t,n,r,!1),a=[],s=0;s<o.length;s++)a.push(o[s]);for(i&&(a=a.slice(0,i)),s=0;s<a.length;s++)this.remove(a[s])}},{key:"removeMatches",value:function(e,t,n,r){return this.removeMany(e,t,n,r),this}},{key:"removeStatement",value:function(e){for(var t=[e.subject,e.predicate,e.object,e.graph],n=0;n<4;n++){var r=this.canon(t[n]),i=this.id(r);this.index[n][i]&&this.rdfArrayRemove(this.index[n][i],e)}return this.rdfArrayRemove(this.statements,e),this}},{key:"removeStatements",value:function(e){for(var t=0;t<e.length;t++)this.remove(e[t]);return this}},{key:"replaceWith",value:function(e,t){for(var n=this.id(e),r=this.id(t),i=function(e){var t=e[n];if(t){var i=e[r];e[r]=i?t.concat(i):t,delete e[n]}},o=0;o<4;o++)i(this.index[o]);if(this.redirections[n]=t,e.value){if(this.aliases[r]||(this.aliases[r]=[]),this.aliases[r].push(e),this.aliases[n])for(o=0;o<this.aliases[n].length;o++)this.redirections[this.id(this.aliases[n][o])]=t,this.aliases[r].push(this.aliases[n][o]);this.add(t,this.sym("http://www.w3.org/2007/ont/link#uri"),e),this.fetcher&&this.fetcher.nowKnownAs(e,t)}return i(this.classActions),i(this.propertyActions),!0}},{key:"allAliases",value:function(e){var t=this.aliases[this.id(this.canon(e))]||[];return t.push(this.canon(e)),t}},{key:"sameThings",value:function(e,t){if(e.equals(t))return!0;var n=this.canon(e);if(!n)return!1;var r=this.canon(t);return!!r&&n.value===r.value}},{key:"setPrefixForURI",value:function(e,t){if(("tab"!==e||!this.namespaces.tab)&&"ns"!==e.slice(0,2)&&"default"!==e.slice(0,7)){for(var n in this.namespaces)this.namespaces[n]==t&&delete this.namespaces[n];this.namespaces[e]=t}}},{key:"statementsMatching",value:function(e,t,n,r,i){var o,a,s=[e,t,n,r],c=[],u=[],l=[],d=[];for(o=0;o<4;o++)c[o]=this.canon(te.fromValue(s[o])),c[o]?(d.push(o),u[o]=this.id(c[o])):l.push(o);if(0===d.length)return this.statements;if(1===d.length)return o=d[0],(a=this.index[o][u[o]])&&i&&a.length>1&&(a=a.slice(0,1)),a||[];var p,f,h=1e10;for(f=0;f<d.length;f++){if(o=d[f],!(a=this.index[o][u[o]]))return[];a.length<h&&(h=a.length,p=f)}for(var m=d[p],g=this.index[m][u[m]],v=d.slice(0,p).concat(d.slice(p+1)),y=[],b=["subject","predicate","object","why"],w=0;w<g.length;w++){var x=g[w];for(f=0;f<v.length;f++)if(o=v[f],!this.canon(x[b[o]]).equals(c[o])){x=null;break}if(null!=x&&(y.push(x),i))break}return y}},{key:"uris",value:function(e){var t=this.canon(e),n=this.aliases[this.id(t)];if(!t.value)return[];var r=[t.value];if(n)for(var i=0;i<n.length;i++)r.push(n[i].uri);return r}},{key:"serialize",value:function(e,t,n,r){var i,o=null!==(i=r)&&void 0!==i&&i.namespaces?ae(ae({},this.namespaces),r.namespaces):ae({},this.namespaces);return z(n,this,e,t,void 0,r=ae(ae({},r||{}),{},{namespaces:o}))}}],[{key:"defaultGraphURI",get:function(){return C}}]),h}(ee);function he(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return me(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?me(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function me(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}(0,u.Z)(fe,"handleRDFType",void 0),fe.handleRDFType=pe;var ge=U("http://www.w3.org/1999/02/22-rdf-syntax-ns#");function ve(e,t){function n(r,i,o){var a=e.statementsMatching(r,ge("rest"),null,t);if(1!==a.length)throw new Error("Bad list structure: no rest at ".concat(r));var s=e.statementsMatching(r,ge("first"),null,t);if(1!==s.length)throw new Error("Bad list structure: rest but ".concat(s.length," firsts at ").concat(r));var c=[s[0].object].concat(i),u=o.concat(a).concat(s),l=e.statementsMatching(null,ge("rest"),r,t);if(0===l.length){var d=new w(c);return e.remove(u),void function(e,t,n,r){var i,o=he(e.statementsMatching(n,null,null,r));try{for(o.s();!(i=o.n()).done;){var a=i.value,s=new P(t,a.predicate,a.object,r);e.remove(a),e.add(s)}}catch(e){o.e(e)}finally{o.f()}var c,u=he(e.statementsMatching(null,n,null,r));try{for(u.s();!(c=u.n()).done;){var l=c.value;e.remove(l),e.add(new P(l.subject,t,l.object,r))}}catch(e){u.e(e)}finally{u.f()}var d,p=he(e.statementsMatching(null,null,n,r));try{for(p.s();!(d=p.n()).done;){var f=d.value;e.remove(f),e.add(new P(f.subject,f.predicate,t,r))}}catch(e){p.e(e)}finally{p.f()}}(e,d,r,t)}if(1!==l.length)throw new Error("Bad list structure: ".concat(l.length," pres at ").concat(r));var p=l[0].subject;if("BlankNode"!==p.termType)throw new Error("Bad list element node ".concat(p," type: ").concat(p.termType," "));n(p,c,u)}!function(e,t){var n,r=ge("nil"),i=he(e.statementsMatching(r,null,null,t));try{for(i.s();!(n=i.n()).done;){var o=n.value;e.remove(o);var a=new w;e.add(new P(a,o.predicate,o.object,t))}}catch(e){i.e(e)}finally{i.f()}var s,c=he(e.statementsMatching(null,null,r,t));try{for(c.s();!(s=c.n()).done;){var u=s.value;if(!u.predicate.sameTerm(ge("rest"))){e.remove(u);var l=new w;e.add(new P(u.subject,u.predicate,l,t))}}}catch(e){c.e(e)}finally{c.f()}}(e,t),e.statementsMatching(null,ge("rest"),ge("nil"),t).forEach((function(e){if("BlankNode"!==e.subject.termType)throw new Error("Bad list element node ".concat(e.subject," type: ").concat(e.subject.termType," "));n(e.subject,[],[])}))}var ye="http://www.w3.org/2000/10/swap/log#",be=function(e){return e},we=function(e){return e},xe=function(e){if(e.length>0)throw"missing.js: oops nnonempty dict not imp";return[]},_e=function(e){return e.length},Ee=function(e,t,n){if(void 0===e.slice)throw"@@ mising.js: No .slice function for "+e+" of type "+(0,h.Z)(e);return void 0===n||null==n?e.slice(t):e.slice(t,n)},ke=Error("dummy error stop iteration"),Se=function(e){return this.last=0,this.li=e,this.next=function(){if(this.last==this.li.length)throw ke;return this.li[this.last++]},this},Ce=function(e,t){return e.indexOf(t)},Ae=function(e,t){if(!e){if(t)throw"python Assertion failed: "+t;throw"(python) Assertion failed."}};String.prototype.encode=function(e){if("utf-8"!=e)throw"UTF8_converter: can only do utf-8";return function(e){e=e.replace(/\r\n/g,"\n");for(var t="",n=0;n<e.length;n++){var r=e.charCodeAt(n);r<128?t+=String.fromCharCode(r):r>127&&r<2048?(t+=String.fromCharCode(r>>6|192),t+=String.fromCharCode(63&r|128)):(t+=String.fromCharCode(r>>12|224),t+=String.fromCharCode(r>>6&63|128),t+=String.fromCharCode(63&r|128))}return t}(this)},String.prototype.decode=function(e){if("utf-8"!=e)throw"UTF8_converter: can only do utf-8";return this};var Te=function(e,t){return I.join(t,e)},Oe="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil",Pe="http://www.w3.org/2002/07/owl#sameAs",Ie="\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~",je=Ie+":",Ne=new RegExp("^([-+]?[0-9]+)(\\.[0-9]+)?(e[-+]?[0-9]+)?","g"),Fe=new RegExp("^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9](T[0-9][0-9]:[0-9][0-9](:[0-9][0-9](\\.[0-9]*)?)?)?Z?"),Re=new RegExp('[\\\\\\r\\n\\"]',"g"),Le=new RegExp("^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*","g");const De=function(e,t,n,r,i,o,a,s){return new Ue(e,t,n,r,i,o,a,s)};var Me,Ue=function(){function e(t,n,r,o,a,s,c,u){(0,i.Z)(this,e),void 0===n&&(n=null),void 0===r&&(r=""),void 0===o&&(o=null),void 0===a&&(a=""),void 0===s&&(s=null),void 0===c&&(c=""),void 0===u&&(u=null),this._bindings=new xe([]),this._flags=c,""!=r&&(Ae(r.indexOf(":")>=0,"Document URI not absolute: "+r),this._bindings[""]=r+"#"),this._store=t,a&&t.setGenPrefix(a),this._thisDoc=r,this.source=t.sym(r),this.lines=0,this.statementCount=0,this.hasNil=!1,this.startOfLine=0,this.previousLine=0,this._genPrefix=a,this.keywords=new we(["a","this","bind","has","is","of","true","false"]),this.keywordsSet=0,this._anonymousNodes=new xe([]),this._variables=new xe([]),this._parentVariables=new xe([]),this._reason=u,this._reason2=null,this._baseURI=o||r||null,Ae(!this._baseURI||this._baseURI.indexOf(":")>=0),this._genPrefix||(this._thisDoc?this._genPrefix=this._thisDoc+"#_g":this._genPrefix=RDFSink_uniqueURI()),null==n?this._thisDoc?this._formula=t.formula(r+"#_formula"):this._formula=t.formula():this._formula=n,this._context=this._formula,this._parentContext=null}return(0,r.Z)(e,[{key:"here",value:function(e){return this._genPrefix+"_L"+this.lines+"C"+(e-this.startOfLine+1)}},{key:"formula",value:function(){return this._formula}},{key:"loadStream",value:function(e){return this.loadBuf(e.read())}},{key:"loadBuf",value:function(e){return this.startDoc(),this.feed(e),this.endDoc()}},{key:"feed",value:function(e){for(var t=e.decode("utf-8"),n=0;n>=0;){var r=this.skipSpace(t,n);if(r<0)return;if((n=this.directiveOrStatement(t,r))<0)throw Be(this._thisDoc,this.lines,t,r,"expected directive or statement")}}},{key:"directiveOrStatement",value:function(e,t){var n,r=this.skipSpace(e,t);return r<0?r:(n=this.directive(e,r))>=0||(n=this.statement(e,r))>=0?this.checkDot(e,n):n}},{key:"tok",value:function(e,t,n){if("@"==t.slice(n,n+1))n+=1;else if(X(this.keywords,e)<0)return-1;var r=n+_e(e);return t.slice(n,r)==e&&Ie.indexOf(t.charAt(r))>=0?r:-1}},{key:"directive",value:function(e,t){if((o=this.skipSpace(e,t))<0)return o;var n=new we([]);if((o=this.tok("bind",e,t))>0)throw Be(this._thisDoc,this.lines,e,t,"keyword bind is obsolete: use @prefix");if((o=this.tok("keywords",e,t))>0){if((t=this.commaSeparatedList(e,o,n,!1))<0)throw Be(this._thisDoc,this.lines,e,t,"'@keywords' needs comma separated list of words");return this.setKeywords(Ee(n,null,null)),t}if((o=this.tok("forAll",e,t))>0){if((t=this.commaSeparatedList(e,o,n,!0))<0)throw Be(this._thisDoc,this.lines,e,t,"Bad variable list after @forAll");var r=new Se(n);try{for(;;){var i=r.next();(X(this._variables,i)<0||X(this._parentVariables,i)>=0)&&(this._variables[i]=this._context.newUniversal(i))}}catch(e){if(e!=ke)throw e}return t}if((o=this.tok("forSome",e,t))>0){if((t=this.commaSeparatedList(e,o,n,this.uri_ref2))<0)throw Be(this._thisDoc,this.lines,e,t,"Bad variable list after @forSome");r=new Se(n);try{for(;;)i=r.next(),this._context.declareExistential(i)}catch(e){if(e!=ke)throw e}return t}if((o=this.tok("prefix",e,t))>=0){var o,a=new we([]);if((t=this.qname(e,o,a))<0)throw Be(this._thisDoc,this.lines,e,o,"expected qname after @prefix");if((o=this.uri_ref2(e,t,a))<0)throw Be(this._thisDoc,this.lines,e,t,"expected <uriref> after @prefix _qname_");var s=a[1].uri;return this._baseURI?s=Te(this._baseURI,s):Ae(s.indexOf(":")>=0,"With no base URI, cannot handle relative URI for NS"),Ae(s.indexOf(":")>=0),this._bindings[a[0][0]]=s,this.bind(a[0][0],function(e){return encodeURI(e)}(s)),o}if((o=this.tok("base",e,t))>=0){if(a=new we([]),(t=this.uri_ref2(e,o,a))<0)throw Be(this._thisDoc,this.lines,e,o,"expected <uri> after @base ");if(s=a[0].uri,!this._baseURI)throw Be(this._thisDoc,this.lines,e,o,"With no previous base URI, cannot use relative URI in @base <"+s+">");return s=Te(this._baseURI,s),Ae(s.indexOf(":")>=0),this._baseURI=s,t}return-1}},{key:"bind",value:function(e,t){""==e||this._store.setPrefixForURI(e,t)}},{key:"setKeywords",value:function(e){null==e?this.keywordsSet=0:(this.keywords=e,this.keywordsSet=1)}},{key:"startDoc",value:function(){}},{key:"endDoc",value:function(){return this.hasNil&&this._store.rdfFactory.supports.COLLECTIONS&&ve(this._store,this.source),this._formula}},{key:"makeStatement",value:function(e){e[0].add(e[2],e[1],e[3],this.source),(e[2].uri&&e[2].uri===Oe||e[3].uri&&e[3].uri===Oe)&&(this.hasNil=!0),this.statementCount+=1}},{key:"statement",value:function(e,t){var n=new we([]);if((t=this.object(e,t,n))<0)return t;var r=this.property_list(e,t,n[0]);if(r<0)throw Be(this._thisDoc,this.lines,e,t,"expected propertylist");return r}},{key:"subject",value:function(e,t,n){return this.item(e,t,n)}},{key:"verb",value:function(e,t,n){if((i=this.skipSpace(e,t))<0)return i;var r=new we([]);if((i=this.tok("has",e,t))>=0){if((t=this.prop(e,i,r))<0)throw Be(this._thisDoc,this.lines,e,i,"expected property after 'has'");return n.push(new be(["->",r[0]])),t}if((i=this.tok("is",e,t))>=0){if((t=this.prop(e,i,r))<0)throw Be(this._thisDoc,this.lines,e,i,"expected <property> after 'is'");if((i=this.skipSpace(e,t))<0)throw Be(this._thisDoc,this.lines,e,t,"End of file found, expected property after 'is'");var i;if(t=i,(i=this.tok("of",e,t))<0)throw Be(this._thisDoc,this.lines,e,t,"expected 'of' after 'is' <prop>");return n.push(new be(["<-",r[0]])),i}if((i=this.tok("a",e,t))>=0)return n.push(new be(["->",this._store.sym("http://www.w3.org/1999/02/22-rdf-syntax-ns#type")])),i;if("<="==e.slice(t,t+2))return n.push(new be(["<-",this._store.sym(ye+"implies")])),t+2;if("="==e.slice(t,t+1))return">"==e.slice(t+1,t+2)?(n.push(new be(["->",this._store.sym(ye+"implies")])),t+2):(n.push(new be(["->",this._store.sym(Pe)])),t+1);if(":="==e.slice(t,t+2))return n.push(new be(["->",ye+"becomes"])),t+2;if((i=this.prop(e,t,r))>=0)return n.push(new be(["->",r[0]])),i;if(">-"==e.slice(t,t+2)||"<-"==e.slice(t,t+2))throw Be(this._thisDoc,this.lines,e,i,">- ... -> syntax is obsolete.");return-1}},{key:"prop",value:function(e,t,n){return this.item(e,t,n)}},{key:"item",value:function(e,t,n){return this.path(e,t,n)}},{key:"blankNode",value:function(e){return this._context.bnode(e,this._reason2)}},{key:"path",value:function(e,t,n){if((o=this.nodeOrLiteral(e,t,n))<0)return o;for(;"!^.".indexOf(e.slice(o,o+1))>=0;){var r=e.slice(o,o+1);if("."==r){var i=e.slice(o+1,o+2);if(!i||je.indexOf(i)>=0&&":?<[{(".indexOf(i)<0)break}var o,a=n.pop(),s=this.blankNode(this.here(o));if((o=this.node(e,o+1,n))<0)throw Be(this._thisDoc,this.lines,e,o,"EOF found in middle of path syntax");var c=n.pop();"^"==r?this.makeStatement(new be([this._context,c,s,a])):this.makeStatement(new be([this._context,c,a,s])),n.push(s)}return o}},{key:"anonymousNode",value:function(e){if(t=this._anonymousNodes[e])return t;var t=this._store.bnode(e);return this._anonymousNodes[e]=t,t}},{key:"node",value:function(e,t,n,r){void 0===r&&(r=null);var i=r;if((l=this.skipSpace(e,t))<0)return l;t=l;var o=e.slice(t,t+1);if("["==o){var a=this.here(t);if((l=this.skipSpace(e,t+1))<0)throw Be(this._thisDoc,this.lines,e,t,"EOF after '['");if("="==e.slice(l,l+1)){t=l+1;var s=new we([]);if(!((l=this.objectList(e,t,s))>=0))throw Be(this._thisDoc,this.lines,e,t,"objectList expected after [= ");if(i=s[0],_e(s)>1){var c=new Se(s);try{for(;;){var u=c.next();this.makeStatement(new be([this._context,this._store.sym(Pe),i,u]))}}catch(e){if(e!=ke)throw e}}if((l=this.skipSpace(e,l))<0)throw Be(this._thisDoc,this.lines,e,t,"EOF when objectList expected after [ = ");if(";"==e.slice(l,l+1))var l=l+1}if(null==i&&(i=this.blankNode(a)),(t=this.property_list(e,l,i))<0)throw Be(this._thisDoc,this.lines,e,l,"property_list expected");if((l=this.skipSpace(e,t))<0)throw Be(this._thisDoc,this.lines,e,t,"EOF when ']' expected after [ <propertyList>");if("]"!=e.slice(l,l+1))throw Be(this._thisDoc,this.lines,e,l,"']' expected");return n.push(i),l+1}if("{"==o){if("$"==e.slice(t+1,t+2)){l=(t+=1)+1;for(var d=new we([]),p=!0;;){if((t=this.skipSpace(e,l))<0)throw Be(this._thisDoc,this.lines,e,t,"needed '$}', found end.");if("$}"==e.slice(t,t+2)){l=t+2;break}if(p)p=!1;else{if(","!=e.slice(t,t+1))throw Be(this._thisDoc,this.lines,e,t,"expected: ','");t+=1}var f=new we([]);if((l=this.item(e,t,f))<0)throw Be(this._thisDoc,this.lines,e,t,"expected item in set or '$}'");d.push(f[0])}return n.push(this._store.newSet(d,this._context)),l}l=t+1;var h=this._parentContext;this._parentContext=this._context;var m=this._anonymousNodes,g=this._parentVariables;this._parentVariables=this._variables,this._anonymousNodes=new xe([]),this._variables=this._variables.slice();var v=this._reason2;for(this._reason2=null,null==i&&(i=this._store.formula()),this._context=i;;){if((t=this.skipSpace(e,l))<0)throw Be(this._thisDoc,this.lines,e,t,"needed '}', found end.");if("}"==e.slice(t,t+1)){l=t+1;break}if((l=this.directiveOrStatement(e,t))<0)throw Be(this._thisDoc,this.lines,e,t,"expected statement or '}'")}return this._anonymousNodes=m,this._variables=this._parentVariables,this._parentVariables=g,this._context=this._parentContext,this._reason2=v,this._parentContext=h,n.push(i.close()),l}if("("==o){var y=this._store.list;for("$"==e.slice(t+1,t+2)&&(y=this._store.newSet,t+=1),l=t+1,d=new we([]);;){if((t=this.skipSpace(e,l))<0)throw Be(this._thisDoc,this.lines,e,t,"needed ')', found end.");if(")"==e.slice(t,t+1)){l=t+1;break}if(f=new we([]),(l=this.item(e,t,f))<0)throw Be(this._thisDoc,this.lines,e,t,"expected item in list or ')'");d.push(f[0])}return n.push(y(d,this._context)),l}if((l=this.tok("this",e,t))>=0)throw Be(this._thisDoc,this.lines,e,t,"Keyword 'this' was ancient N3. Now use @forSome and @forAll keywords.");return(l=this.tok("true",e,t))>=0?(n.push(!0),l):(l=this.tok("false",e,t))>=0?(n.push(!1),l):null==i&&(l=this.uri_ref2(e,t,n))>=0?l:-1}},{key:"property_list",value:function(e,t,n){for(;;){if((l=this.skipSpace(e,t))<0)throw Be(this._thisDoc,this.lines,e,t,"EOF found when expected verb in property list");if(":-"!=e.slice(l,l+2)){t=l;var r=new we([]);if((l=this.verb(e,t,r))<=0)return t;var i=new we([]);if((t=this.objectList(e,l,i))<0)throw Be(this._thisDoc,this.lines,e,l,"objectList expected");var o=new Se(i);try{for(;;){var a=o.next(),s=r[0],c=s[0],u=s[1];"->"==c?this.makeStatement(new be([this._context,u,n,a])):this.makeStatement(new be([this._context,u,a,n]))}}catch(e){if(e!=ke)throw e}if((l=this.skipSpace(e,t))<0)throw Be(this._thisDoc,this.lines,e,l,"EOF found in list of objects");if(";"!=e.slice(t,t+1))return t;t+=1}else{t=l+2;var l,d=new we([]);if((l=this.node(e,t,d,n))<0)throw Be(this._thisDoc,this.lines,e,t,"bad {} or () or [] node after :- ");t=l}}}},{key:"commaSeparatedList",value:function(e,t,n,r){if((i=this.skipSpace(e,t))<0)throw Be(this._thisDoc,this.lines,e,i,"EOF found expecting comma sep list");if("."==e.charAt(i))return t;if(r)var i=this.uri_ref2(e,i,n);else i=this.bareWord(e,i,n);if(i<0)return-1;for(;;){if((t=this.skipSpace(e,i))<0)return t;var o=e.slice(t,t+1);if(","!=o)return"."!=o?-1:t;if((i=r?this.uri_ref2(e,t+1,n):this.bareWord(e,t+1,n))<0)throw Be(this._thisDoc,this.lines,e,i,"bad list content")}}},{key:"objectList",value:function(e,t,n){if((t=this.object(e,t,n))<0)return-1;for(;;){var r=this.skipSpace(e,t);if(r<0)throw Be(this._thisDoc,this.lines,e,r,"EOF found after object");if(","!=e.slice(r,r+1))return r;if((t=this.object(e,r+1,n))<0)return t}}},{key:"checkDot",value:function(e,t){var n=this.skipSpace(e,t);if(n<0)return n;if("."==e.slice(n,n+1))return n+1;if("}"==e.slice(n,n+1))return n;if("]"==e.slice(n,n+1))return n;throw Be(this._thisDoc,this.lines,e,n,"expected '.' or '}' or ']' at end of statement")}},{key:"uri_ref2",value:function(e,t,n){var r=new we([]);if((p=this.qname(e,t,r))>=0){var i=r[0],o=i[0],a=i[1];if(null==o){Ae(0,"not used?");var s=this._baseURI+"#"}else if(!(s=this._bindings[o])){if("_"==o)return n.push(this.anonymousNode(a)),p;throw Be(this._thisDoc,this.lines,e,t,"Prefix "+o+" not bound.")}var c=this._store.sym(s+a);return X(this._variables,c)>=0?n.push(this._variables[c]):n.push(c),p}if((t=this.skipSpace(e,t))<0)return-1;if("?"==e.charAt(t)){var u=new we([]);return(p=this.variable(e,t,u))>0?(n.push(u[0]),p):-1}if("<"==e.charAt(t)){for(var l=t+=1;t<_e(e);){if(">"==e.charAt(t)){var d=e.slice(l,t);return this._baseURI?d=Te(this._baseURI,d):Ae(d.indexOf(":")>=0,"With no base URI, cannot deal with relative URIs"),"#"==e.slice(t-1,t)&&"#"!=Ee(d,-1,null)&&(d+="#"),c=this._store.sym(d),X(this._variables,c)>=0?n.push(this._variables[c]):n.push(c),t+1}t+=1}throw Be(this._thisDoc,this.lines,e,p,"unterminated URI reference")}if(this.keywordsSet){var p;if(u=new we([]),(p=this.bareWord(e,t,u))<0)return-1;if(X(this.keywords,u[0])>=0)throw Be(this._thisDoc,this.lines,e,t,'Keyword "'+u[0]+'" not allowed here.');return n.push(this._store.sym(this._bindings[""]+u[0])),p}return-1}},{key:"skipSpace",value:function(e,t){for(var n=t||0;n<e.length;n++){var r=e.charAt(n);if(" \n\r\t\f\v            ​\u2028\u2029 ".indexOf(r)<0){if("#"!==e.charAt(n))return n;for(;;n++){if(n===e.length)return-1;if("\n"===e.charAt(n)){this.lines=this.lines+1;break}}}else"\n"===e.charAt(n)&&(this.lines=this.lines+1)}return-1}},{key:"variable",value:function(e,t,n){if((r=this.skipSpace(e,t))<0)return-1;if("?"!=e.slice(r,r+1))return-1;var r;if(t=r+=1,"0123456789-".indexOf(e.charAt(r))>=0)throw Be(this._thisDoc,this.lines,e,r,"Varible name can't start with '"+e.charAt(r)+"s'");for(;t<_e(e)&&je.indexOf(e.charAt(t))<0;)t+=1;if(null==this._parentContext)throw Be(this._thisDoc,this.lines,e,r,"Can't use ?xxx syntax for variable in outermost level: "+e.slice(r-1,t));return n.push(this._store.variable(e.slice(r,t))),t}},{key:"bareWord",value:function(e,t,n){var r=this.skipSpace(e,t);if(r<0)return-1;var i=e.charAt(r);if("0123456789-".indexOf(i)>=0)return-1;if(je.indexOf(i)>=0)return-1;for(t=r;t<_e(e)&&je.indexOf(e.charAt(t))<0;)t+=1;return n.push(e.slice(r,t)),t}},{key:"qname",value:function(e,t,n){if((t=this.skipSpace(e,t))<0)return-1;var r=e.charAt(t);if("0123456789-+".indexOf(r)>=0)return-1;if(je.indexOf(r)<0){var i=r;for(t+=1;t<_e(e)&&(r=e.charAt(t),je.indexOf(r)<0);)i+=r,t+=1}else i="";if(t<_e(e)&&":"==e.charAt(t)){var o=i;for(t+=1,i="";t<_e(e)&&(r=e.charAt(t),je.indexOf(r)<0);)i+=r,t+=1;return n.push(new be([o,i])),t}return i&&this.keywordsSet&&X(this.keywords,i)<0?(n.push(new be(["",i])),t):-1}},{key:"object",value:function(e,t,n){if((a=this.subject(e,t,n))>=0)return a;if((a=this.skipSpace(e,t))<0)return-1;t=a;var r=null,i=e.charAt(t);if('"'==i||"'"==i){r=e.slice(t,t+3==i+i)?i+i+i:i,t+=_e(r);var o=this.strconst(e,t,r),a=o[0],s=o[1];return n.push(this._store.literal(s)),a}return-1}},{key:"nodeOrLiteral",value:function(e,t,n){if((c=this.node(e,t,n))>=0)return c;if((c=this.skipSpace(e,t))<0)return-1;t=c;var r=e.charAt(t);if("-+0987654321".indexOf(r)>=0){if(Fe.lastIndex=0,null!=(d=Fe.exec(e.slice(t))))c=t+(i=d[0]).length,i.indexOf("T")>=0?n.push(this._store.literal(i,this._store.sym("http://www.w3.org/2001/XMLSchema#dateTime"))):n.push(this._store.literal(i,this._store.sym("http://www.w3.org/2001/XMLSchema#date")));else{var i;if(Ne.lastIndex=0,null==(d=Ne.exec(e.slice(t))))throw Be(this._thisDoc,this.lines,e,t,"Bad number or date syntax");c=t+Ne.lastIndex,(i=e.slice(t,c)).indexOf("e")>=0?n.push(this._store.literal(parseFloat(i),this._store.sym("http://www.w3.org/2001/XMLSchema#double"))):e.slice(t,c).indexOf(".")>=0?n.push(this._store.literal(parseFloat(i),this._store.sym("http://www.w3.org/2001/XMLSchema#decimal"))):n.push(this._store.literal(parseInt(i),this._store.sym("http://www.w3.org/2001/XMLSchema#integer")))}return c}if('"'==e.charAt(t)){if('"""'==e.slice(t,t+3))var o='"""';else o='"';t+=_e(o);var a=null,s=this.strconst(e,t,o),c=s[0],u=s[1],l=null;if("@"==e.slice(c,c+1)){var d;if(Le.lastIndex=0,null==(d=Le.exec(e.slice(c+1))))throw Be(this._thisDoc,startline,e,t,"Bad language code syntax on string literal, after @");t=Le.lastIndex+c+1,l=e.slice(c+1,t),c=t}if("^^"==e.slice(c,c+2)){var p=new we([]);c=this.uri_ref2(e,c+2,p),a=p[0]}return n.push(this._store.literal(u,l||a)),c}return-1}},{key:"strconst",value:function(e,t,n){for(var r=t,i="",o=this.lines;r<_e(e);){if(t=r+_e(n),e.slice(r,t)==n)return new be([t,i]);if('"'!=e.charAt(r)){if(Re.lastIndex=0,!Re.exec(e.slice(r)))throw Be(this._thisDoc,o,e,r,"Closing quote missing in string at ^ in "+e.slice(r-20,r)+"^"+e.slice(r,r+20));if(t=r+Re.lastIndex-1,i+=e.slice(r,t),'"'!=(c=e.charAt(t)))if("\r"!=c){if("\n"==c){if('"'==n)throw Be(this._thisDoc,o,e,t,"newline found in string literal");this.lines=this.lines+1,i+=c,r=t+1,this.previousLine=this.startOfLine,this.startOfLine=r}else if("\\"==c){if(r=t+1,!(c=e.slice(r,r+1)))throw Be(this._thisDoc,o,e,t,"unterminated string literal (2)");var a=Ce('abfrtvn\\"',c);if(a>=0)i+='a\b\f\r\t\v\n\\"'.charAt(a),r+=1;else if("u"==c)r=(s=this.uEscape(e,r+1,o))[0],i+=c=s[1];else{if("U"!=c)throw Be(this._thisDoc,this.lines,e,t,"bad escape");var s,c;r=(s=this.UEscape(e,r+1,o))[0],i+=c=s[1]}}}else r=t+1;else r=t}else i=i+'"',r=r+1}throw Be(this._thisDoc,this.lines,e,t,"unterminated string literal")}},{key:"uEscape",value:function(e,t,n){for(var r=t,i=0,o=0;i<4;){var a=e.slice(r,r+1).toLowerCase();if(r+=1,""==a)throw Be(this._thisDoc,n,e,t,"unterminated string literal(3)");var s=Ce("0123456789abcdef",a);if(s<0)throw Be(this._thisDoc,n,e,t,"bad string literal hex escape");o=16*o+s,i+=1}var c=String.fromCharCode(o);return new be([r,c])}},{key:"UEscape",value:function(e,t,n){for(var r=t,i=0,o="\\U";i<8;){var a=e.slice(r,r+1).toLowerCase();if(r+=1,""==a)throw Be(this._thisDoc,n,e,t,"unterminated string literal(3)");if(Ce("0123456789abcdef",a)<0)throw Be(this._thisDoc,n,e,t,"bad string literal hex escape");o+=a,i+=1}var s,c=(s="0x"+Ee(o,2,10)-0,String.fromCharCode(s));return new be([r,c])}}]),e}();function Be(e,t,n,r,i){var o=t+1,a="Line "+o+" of <"+e+">: Bad syntax: "+i+'\nat: "'+n.slice(r,r+30)+'"',s=new SyntaxError(a,e,o);return s.lineNo=o,s.characterInFile=r,s.syntaxProblem=i,s}function He(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function qe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?He(Object(n),!0).forEach((function(t){(0,u.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):He(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var We=qe(qe({},D),{},{supports:(Me={},(0,u.Z)(Me,j.collections,!0),(0,u.Z)(Me,j.defaultGraphType,!1),(0,u.Z)(Me,j.equalsMethod,!0),(0,u.Z)(Me,j.identity,!1),(0,u.Z)(Me,j.id,!0),(0,u.Z)(Me,j.reversibleId,!1),(0,u.Z)(Me,j.variableType,!0),Me),collection:function(e){return new w(e)},id:function(e){var t=this;return(0,g.uZ)(e)?"( ".concat(e.elements.map((function(e){return t.id(e)})).join(", ")," )"):(0,g.cG)(e)?F.toString(e):D.id(e)},termToNQ:function(e){return e.termType===p.fb?w.toNT(e):D.termToNQ(e)}});const Ke=We;var Ve=n(6805),Je=n.n(Ve);function ze(e,t){return"string"==typeof t?e.rdfFactory.literal(t):Object.prototype.hasOwnProperty.call(t,"@list")?!0===e.rdfFactory.supports.COLLECTIONS?function(e,t){if(!Array.isArray(t))throw new TypeError("Object must be an array");return e.rdfFactory.collection(t.map((function(t){return ze(e,t)})))}(e,t["@list"]):function(e,t){var n=t["@id"]?$e(e,t):e.rdfFactory.blankNode(),r=t["@list"].map((function(t){return ze(e,t)})),i=G(e.rdfFactory,n,r);return e.addAll(i),n}(e,t):Object.prototype.hasOwnProperty.call(t,"@id")?$e(e,t):Object.prototype.hasOwnProperty.call(t,"@language")?e.rdfFactory.literal(t["@value"],t["@language"]):Object.prototype.hasOwnProperty.call(t,"@type")?e.rdfFactory.literal(t["@value"],e.rdfFactory.namedNode(t["@type"])):Object.prototype.hasOwnProperty.call(t,"@value")?e.rdfFactory.literal(t["@value"]):e.rdfFactory.literal(t)}function Ze(e,t,n,r){var i=n&&Object.prototype.hasOwnProperty.call(n,"termType")?n.value:n;return Je().flatten(JSON.parse(e),null,{base:i}).then((function(e){return e.reduce((function(e,r){return t=Ge(t,n,r)}),t)})).then(r).catch(r)}function $e(e,t){return t["@id"].startsWith("_:")?e.rdfFactory.blankNode(t["@id"].substring(2)):e.rdfFactory.namedNode(t["@id"])}function Ge(e,t,n){for(var r=n["@id"]?$e(e,n):e.rdfFactory.blankNode(),i=0,o=Object.keys(n);i<o.length;i++){var a=o[i];if("@id"!==a){if("@graph"==a)for(var s=r,c=n[a],u=0;u<c.length;u++)e=Ge(e,s,c[u]);var l=n[a];if(Array.isArray(l))for(var d=0;d<l.length;d++)e.addStatement(Xe(e,r,a,l[d],t));else e.addStatement(Xe(e,r,a,l,t))}}return e}function Xe(e,t,n,r,i){var o,a;return"@type"===n?(o=e.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),a=e.rdfFactory.namedNode(r)):(o=e.rdfFactory.namedNode(n),a=ze(e,r)),e.rdfFactory.quad(t,o,a,e.rdfFactory.namedNode(i))}const Qe="http://www.w3.org/1999/02/22-rdf-syntax-ns#",Ye="http://www.w3.org/2001/XMLSchema#",et="http://www.w3.org/2000/10/swap/",tt={xsd:{decimal:`${Ye}decimal`,boolean:`${Ye}boolean`,double:`${Ye}double`,integer:`${Ye}integer`,string:`${Ye}string`},rdf:{type:`${Qe}type`,nil:`${Qe}nil`,first:`${Qe}first`,rest:`${Qe}rest`,langString:`${Qe}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${et}reify#forSome`,forAll:`${et}reify#forAll`},log:{implies:`${et}log#implies`}};var nt=n(4375),rt=n.n(nt);const{xsd:it}=tt,ot=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,at={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},st=/[\x00-\x20<>\\"\{\}\|\^\`]/,ct={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},ut=/$0^/;class lt{constructor(e){if(this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i,this._prefix=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,this._prefixed=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?:[ \t]+|(?=\.?[,;!\^\s#()\[\]\{\}"'<>]))/,this._variable=/^\?(?:(?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=[.,;!\^\s#()\[\]\{\}"'<>])/,this._blank=/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:\s#()\[\]\{\}"'<>]))/,this._number=/^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<>])/,this._boolean=/^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<>])/,this._keyword=/^@[a-z]+(?=[\s#<:])/i,this._sparqlKeyword=/^(?:PREFIX|BASE|GRAPH)(?=[\s#<])/i,this._shortPredicates=/^a(?=[\s#()\[\]\{\}"'<>])/,this._newline=/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,this._comment=/#([^\n\r]*)/,this._whitespace=/^[ \t]+/,this._endOfFile=/^(?:#[^\n\r]*)?$/,e=e||{},this._lineMode=!!e.lineMode){this._n3Mode=!1;for(const e in this)!(e in ct)&&this[e]instanceof RegExp&&(this[e]=ut)}else this._n3Mode=!1!==e.n3;this._comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,t){let n=this._input,r=n.length;for(;;){let e,a;for(;e=this._newline.exec(n);)this._comments&&(a=this._comment.exec(e[0]))&&i("comment",a[1],"",this._line,e[0].length),n=n.substr(e[0].length,n.length),r=n.length,this._line++;if(!e&&(e=this._whitespace.exec(n))&&(n=n.substr(e[0].length,n.length)),this._endOfFile.test(n))return t&&(this._comments&&(a=this._comment.exec(n))&&i("comment",a[1],"",this._line,n.length),n=null,i("eof","","",this._line,0)),this._input=n;const s=this._line,c=n[0];let u="",l="",d="",p=null,f=0,h=!1;switch(c){case"^":if(n.length<3)break;if("^"!==n[1]){this._n3Mode&&(f=1,u="^");break}if(this._previousMarker="^^",n=n.substr(2),"<"!==n[0]){h=!0;break}case"<":if(p=this._unescapedIri.exec(n))u="IRI",l=p[1];else if(p=this._iri.exec(n)){if(l=this._unescape(p[1]),null===l||st.test(l))return o(this);u="IRI"}else n.length>1&&"<"===n[1]?(u="<<",f=2):this._n3Mode&&n.length>1&&"="===n[1]&&(u="inverse",f=2,l=">");break;case">":n.length>1&&">"===n[1]&&(u=">>",f=2);break;case"_":((p=this._blank.exec(n))||t&&(p=this._blank.exec(`${n} `)))&&(u="blank",d="_",l=p[1]);break;case'"':if(p=this._simpleQuotedString.exec(n))l=p[1];else if(({value:l,matchLength:f}=this._parseLiteral(n)),null===l)return o(this);null===p&&0===f||(u="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(p=this._simpleApostropheString.exec(n))l=p[1];else if(({value:l,matchLength:f}=this._parseLiteral(n)),null===l)return o(this);null===p&&0===f||(u="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(p=this._variable.exec(n))&&(u="var",l=p[0]);break;case"@":"literal"===this._previousMarker&&(p=this._langcode.exec(n))?(u="langcode",l=p[1]):(p=this._keyword.exec(n))&&(u=p[0]);break;case".":if(1===n.length?t:n[1]<"0"||n[1]>"9"){u=".",f=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(p=this._number.exec(n)||t&&(p=this._number.exec(`${n} `)))&&(u="literal",l=p[0],d="string"==typeof p[1]?it.double:"string"==typeof p[2]?it.decimal:it.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(p=this._sparqlKeyword.exec(n))?u=p[0].toUpperCase():h=!0;break;case"f":case"t":(p=this._boolean.exec(n))?(u="literal",l=p[0],d=it.boolean):h=!0;break;case"a":(p=this._shortPredicates.exec(n))?(u="abbreviation",l="a"):h=!0;break;case"=":this._n3Mode&&n.length>1&&(u="abbreviation",">"!==n[1]?(f=1,l="="):(f=2,l=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(f=1,u=c);break;default:h=!0}if(h&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(p=this._prefix.exec(n))?((p=this._prefixed.exec(n))||t&&(p=this._prefixed.exec(`${n} `)))&&(u="prefixed",d=p[1]||"",l=this._unescape(p[2])):(u="prefix",l=p[1]||"")),"^^"===this._previousMarker)switch(u){case"prefixed":u="type";break;case"IRI":u="typeIRI";break;default:u=""}if(!u)return t||!/^'''|^"""/.test(n)&&/\n|\r/.test(n)?o(this):this._input=n;const m=f||p[0].length,g=i(u,l,d,s,m);this.previousToken=g,this._previousMarker=u,n=n.substr(m,n.length)}function i(t,i,o,a,s){const c=n?r-n.length:r,u={type:t,value:i,prefix:o,line:a,start:c,end:c+s};return e(null,u),u}function o(t){e(t._syntaxError(/^\S*/.exec(n)[0]))}}_unescape(e){let t=!1;const n=e.replace(ot,((e,n,r,i)=>{if("string"==typeof n)return String.fromCharCode(Number.parseInt(n,16));if("string"==typeof r){let e=Number.parseInt(r,16);return e<=65535?String.fromCharCode(Number.parseInt(r,16)):String.fromCharCode(55296+((e-=65536)>>10),56320+(1023&e))}return i in at?at[i]:(t=!0,"")}));return t?null:n}_parseLiteral(e){if(e.length>=3){const t=e.match(/^(?:"""|"|'''|'|)/)[0],n=t.length;let r=Math.max(this._literalClosingPos,n);for(;(r=e.indexOf(t,r))>0;){let t=0;for(;"\\"===e[r-t-1];)t++;if(t%2==0){const t=e.substring(n,r),i=t.split(/\r\n|\r|\n/).length-1,o=r+n;if(1===n&&0!==i||3===n&&this._lineMode)break;return this._line+=i,{value:this._unescape(t),matchLength:o}}r++}this._literalClosingPos=e.length-n+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;const t=new Error(`Unexpected "${e}" on line ${this._line}.`);return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}_readStartingBom(e){return e.startsWith("\ufeff")?e.substr(1):e}tokenize(e,t){if(this._line=1,"string"==typeof e){if(this._input=this._readStartingBom(e),"function"!=typeof t){const e=[];let t;if(this._tokenizeToEnd(((n,r)=>n?t=n:e.push(r)),!0),t)throw t;return e}rt()((()=>this._tokenizeToEnd(t,!0)))}else this._pendingBuffer=null,"function"==typeof e.setEncoding&&e.setEncoding("utf8"),e.on("data",(e=>{null!==this._input&&0!==e.length&&(this._pendingBuffer&&(e=Buffer.concat([this._pendingBuffer,e]),this._pendingBuffer=null),128&e[e.length-1]?this._pendingBuffer=e:(void 0===this._input?this._input=this._readStartingBom("string"==typeof e?e:e.toString()):this._input+=e,this._tokenizeToEnd(t,!1)))})),e.on("end",(()=>{"string"==typeof this._input&&this._tokenizeToEnd(t,!0)})),e.on("error",t)}}const{rdf:dt,xsd:pt}=tt;let ft,ht=0;const mt={namedNode:function(e){return new vt(e)},blankNode:function(e){return new bt(e||"n3-"+ht++)},variable:function(e){return new wt(e)},literal:function(e,t){if("string"==typeof t)return new yt(`"${e}"@${t.toLowerCase()}`);let n=t?t.value:"";return""===n&&("boolean"==typeof e?n=pt.boolean:"number"==typeof e&&(Number.isFinite(e)?n=Number.isInteger(e)?pt.integer:pt.double:(n=pt.double,Number.isNaN(e)||(e=e>0?"INF":"-INF")))),""===n||n===pt.string?new yt(`"${e}"`):new yt(`"${e}"^^${n}`)},defaultGraph:function(){return ft},quad:_t,triple:_t};class gt{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof gt?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}class vt extends gt{get termType(){return"NamedNode"}}class yt extends gt{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const e=this.id;let t=e.lastIndexOf('"')+1;return t<e.length&&"@"===e[t++]?e.substr(t).toLowerCase():""}get datatype(){return new vt(this.datatypeString)}get datatypeString(){const e=this.id,t=e.lastIndexOf('"')+1,n=t<e.length?e[t]:"";return"^"===n?e.substr(t+2):"@"!==n?pt.string:dt.langString}equals(e){return e instanceof yt?this.id===e.id:!!e&&!!e.datatype&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&this.datatype.value===e.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}}class bt extends gt{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}}class wt extends gt{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}}ft=new class extends gt{constructor(){return super(""),ft||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}};class xt extends gt{constructor(e,t,n,r){super(""),this._subject=e,this._predicate=t,this._object=n,this._graph=r||ft}get termType(){return"Quad"}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}get graph(){return this._graph}toJSON(){return{termType:this.termType,subject:this._subject.toJSON(),predicate:this._predicate.toJSON(),object:this._object.toJSON(),graph:this._graph.toJSON()}}equals(e){return!!e&&this._subject.equals(e.subject)&&this._predicate.equals(e.predicate)&&this._object.equals(e.object)&&this._graph.equals(e.graph)}}function _t(e,t,n,r){return new xt(e,t,n,r)}let Et=0;class kt{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&Ct(this,e.factory);const t="string"==typeof e.format?e.format.match(/\w*$/)[0].toLowerCase():"",n=/turtle/.test(t),r=/trig/.test(t),i=/triple/.test(t),o=/quad/.test(t),a=this._n3Mode=/n3/.test(t),s=i||o;(this._supportsNamedGraphs=!(n||a))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(n||r||i||a),this._supportsRDFStar=""===t||/star|\*$/.test(t),s&&(this._resolveRelativeIRI=e=>null),this._blankNodePrefix="string"!=typeof e.blankNodePrefix?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new lt({lineMode:s,n3:a}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){Et=0}_setBase(e){if(e){const t=e.indexOf("#");t>=0&&(e=e.substr(0,t)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}else this._base="",this._basePath=""}_saveContext(e,t,n,r,i){const o=this._n3Mode;this._contextStack.push({type:e,subject:n,predicate:r,object:i,graph:t,inverse:!!o&&this._inversePredicate,blankPrefix:o?this._prefixes._:"",quantified:o?this._quantified:null}),o&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.id.substr(2)}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(e,t){const n=this._contextStack.pop();if(!n||n.type!==e)return this._error(`Unexpected ${t.type}`,t);this._subject=n.subject,this._predicate=n.predicate,this._object=n.object,this._graph=n.graph,this._n3Mode&&(this._inversePredicate=n.inverse,this._prefixes._=n.blankPrefix,this._quantified=n.quantified)}_readInTopContext(e){switch(e.type){case"eof":return null!==this._graph?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}_readEntity(e,t){let n;switch(e.type){case"IRI":case"typeIRI":const t=this._resolveIRI(e.value);if(null===t)return this._error("Invalid IRI",e);n=this._namedNode(t);break;case"type":case"prefixed":const r=this._prefixes[e.prefix];if(void 0===r)return this._error(`Undefined prefix "${e.prefix}:"`,e);n=this._namedNode(r+e.value);break;case"blank":n=this._blankNode(this._prefixes[e.prefix]+e.value);break;case"var":n=this._variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!t&&this._n3Mode&&n.id in this._quantified&&(n=this._quantified[n.id]),n}_readSubject(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(0===e.prefix.length)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._literal(e.value,this._namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._subject=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){const t=e.type;switch(t){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${t}`,e):(this._subject=null,"]"===t?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",e);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if(void 0===(this._predicate=this._readEntity(e)))return}return this._readObject}_readObject(e){switch(e.type){case"literal":if(0===e.prefix.length)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._literal(e.value,this._namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._object=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(e){return"{"===e.type?this._readGraph(e):this._readPredicate(e)}_readGraph(e){return"{"!==e.type?this._error(`Expected graph but got ${e.type}`,e):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(e){return"]"===e.type?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))}_readBlankNodeTail(e){if("]"!==e.type)return this._readBlankNodePunctuation(e);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const t=null===this._predicate;return this._restoreContext("blank",e),null!==this._object?this._getContextEndReader():null!==this._predicate?this._readObject:t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){let t=null,n=null,r=this._readListItem;const i=this._subject,o=this._contextStack,a=o[o.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,n=this._blankNode(),this.RDF_FIRST,this._subject=t=this._blankNode()),r=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,n=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",e),0!==o.length&&"list"===o[o.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(r=this._readPredicate,this._subject===this.RDF_NIL)return r}else if(r=this._getContextEndReader(),this._object===this.RDF_NIL)return r;n=this.RDF_NIL;break;case"literal":0===e.prefix.length?(this._literalValue=e.value,r=this._readListItemDataTypeOrLang):(t=this._literal(e.value,this._namedNode(e.prefix)),r=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);default:if(void 0===(t=this._readEntity(e)))return}if(null===n&&(this._subject=n=this._blankNode()),null===i?null===a.predicate?a.subject=n:a.object=n:this._emit(i,this.RDF_REST,n,this._graph),null!==t){if(this._n3Mode&&("IRI"===e.type||"prefixed"===e.type))return this._saveContext("item",this._graph,n,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(n,this.RDF_FIRST,t,this._graph)}return r}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e){let t=this._literal(this._literalValue);switch(e.type){case"type":case"typeIRI":const n=this._readEntity(e);if(void 0===n)return;t=this._literal(this._literalValue,n),e=null;break;case"langcode":t=this._literal(this._literalValue,e.value),e=null}return{token:e,literal:t}}_completeSubjectLiteral(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(e,t){const n=this._completeLiteral(e);if(n)return this._object=n.literal,t&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===n.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(n.token))}_readFormulaTail(e){return"}"!==e.type?this._readPunctuation(e):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",e),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let t,n=this._graph;const r=this._subject,i=this._inversePredicate;switch(e.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,t=this._contextStack.length?this._readSubject:this._readInTopContext,i&&(this._inversePredicate=!1);break;case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(n=this._readEntity(e))){t=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(null!==r){const e=this._predicate,t=this._object;i?this._emit(t,e,r,n):this._emit(r,e,t,n)}return t}_readBlankNodePunctuation(e){let t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}_readQuadPunctuation(e){return"."!==e.type?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return"prefix"!==e.type?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if("IRI"!==e.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);const t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}_readBaseIRI(e){const t="IRI"===e.type&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_readNamedGraphLabel(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}_readNamedGraphBlankLabel(e){return"]"!==e.type?this._error("Invalid graph label",e):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):"."!==e.type?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){let t;switch(e.type){case"IRI":case"prefixed":if(void 0!==(t=this._readEntity(e,!0)))break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,t,this.QUANTIFIERS_GRAPH)):this._quantified[t.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(e){return","===e.type?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}_getPathReader(e){return this._afterPath=e,this._readPath}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const t=this._contextStack,n=t.length&&t[t.length-1];if(n&&"item"===n.type){const t=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,t,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let t,n;const r=this._blankNode();if(void 0!==(n=this._readEntity(e)))return null===this._predicate?(t=this._subject,this._subject=r):(t=this._object,this._object=r),this._emit(t,n,r,this._graph),this._readPath}_readBackwardPath(e){const t=this._blankNode();let n,r;if(void 0!==(n=this._readEntity(e)))return null===this._predicate?(r=this._subject,this._subject=t):(r=this._object,this._object=t),this._emit(t,n,r,this._graph),this._readPath}_readRDFStarTailOrGraph(e){return">>"!==e.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(e))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,e):this._readRDFStarTail(e)}_readRDFStarTail(e){if(">>"!==e.type)return this._error(`Expected >> but got ${e.type}`,e);const t=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",e),null===this._subject?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}_getContextEndReader(){const e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(e,t,n,r){this._callback(null,this._quad(e,t,n,r||this.DEFAULTGRAPH))}_error(e,t){const n=new Error(`${e} on line ${t.line}.`);n.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(n),this._callback=St}_resolveIRI(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}_resolveRelativeIRI(e){if(!e.length)return this._base;switch(e[0]){case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return("/"===e[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;const t=e.length;let n="",r=-1,i=-1,o=0,a="/";for(;r<t;){switch(a){case":":if(i<0&&"/"===e[++r]&&"/"===e[++r])for(;(i=r+1)<t&&"/"!==e[i];)r=i;break;case"?":case"#":r=t;break;case"/":if("."===e[r+1])switch(a=e[1+ ++r],a){case"/":n+=e.substring(o,r-1),o=r+1;break;case void 0:case"?":case"#":return n+e.substring(o,r)+e.substr(r+1);case".":if(a=e[1+ ++r],void 0===a||"/"===a||"?"===a||"#"===a){if(n+=e.substring(o,r-2),(o=n.lastIndexOf("/"))>=i&&(n=n.substr(0,o)),"/"!==a)return`${n}/${e.substr(r+1)}`;o=r+1}}}a=e[++r]}return n+e.substring(o)}parse(e,t,n){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${Et++}_`,this._prefixCallback=n||St,this._inversePredicate=!1,this._quantified=Object.create(null),!t){const t=[];let n;if(this._callback=(e,r)=>{e?n=e:r&&t.push(r)},this._lexer.tokenize(e).every((e=>this._readCallback=this._readCallback(e))),n)throw n;return t}this._callback=t,this._lexer.tokenize(e,((e,t)=>{null!==e?(this._callback(e),this._callback=St):this._readCallback&&(this._readCallback=this._readCallback(t))}))}}function St(){}function Ct(e,t){const n=t.namedNode;e._namedNode=n,e._blankNode=t.blankNode,e._literal=t.literal,e._variable=t.variable,e._quad=t.quad,e.DEFAULTGRAPH=t.defaultGraph(),e.RDF_FIRST=n(tt.rdf.first),e.RDF_REST=n(tt.rdf.rest),e.RDF_NIL=n(tt.rdf.nil),e.N3_FORALL=n(tt.r.forAll),e.N3_FORSOME=n(tt.r.forSome),e.ABBREVIATIONS={a:n(tt.rdf.type),"=":n(tt.owl.sameAs),">":n(tt.log.implies)},e.QUANTIFIERS_GRAPH=n("urn:n3:quantifiers")}if(Ct(kt.prototype,mt),void 0===At)var At={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12};var Tt=function(){function e(t,n){(0,i.Z)(this,e),this.options=n||{},this.kb=t,this.target=n.target||{graph:{subjects:{},prefixes:{},terms:{}}},this.blankNodes=[],this.htmlOptions={selfClosing:"br img input area base basefont col colgroup source wbr isindex link meta param hr"},this.theOne="_:"+(new Date).getTime(),this.language=null,this.vocabulary=null,this.blankCounter=0,this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"}],this.inXHTMLMode=!1,this.absURIRE=/[\w\_\-]+:\S+/,this.finishedHandlers=[],this.init()}return(0,r.Z)(e,[{key:"addTriple",value:function(e,t,n,r){var i,o,a,s;i=void 0===t?D.namedNode(this.options.base):this.toRDFNodeObject(t),a=this.toRDFNodeObject(n),o=this.toRDFNodeObject(r),s=D.namedNode(this.options.base),this.kb.add(i,a,o,s)}},{key:"ancestorPath",value:function(e){for(var t="";e&&e.nodeType!==At.DOCUMENT_NODE;)t="/"+e.localName+t,e=e.parentNode;return t}},{key:"copyMappings",value:function(e){var t={};for(var n in e)t[n]=e[n];return t}},{key:"copyProperties",value:function(){}},{key:"deriveDateTimeType",value:function(t){for(var n=0;n<e.dateTimeTypes.length;n++){var r=e.dateTimeTypes[n].pattern.exec(t);if(r&&r[0].length===t.length)return e.dateTimeTypes[n].type}return null}},{key:"init",value:function(){}},{key:"newBlankNode",value:function(){return this.blankCounter++,"_:"+this.blankCounter}},{key:"newSubjectOrigin",value:function(e,t){}},{key:"parseCURIE",value:function(t,n,r){var i,o=t.indexOf(":");if(o>=0){var a=t.substring(0,o);if(""===a)return(i=n[""])?i+t.substring(o+1):null;if("_"===a)return"_:"+t.substring(o+1);if(e.NCNAME.test(a)&&(i=n[a]))return i+t.substring(o+1)}return null}},{key:"parseCURIEOrURI",value:function(e,t,n){return this.parseCURIE(e,t,n)||this.resolveAndNormalize(n,e)}},{key:"parsePredicate",value:function(e,t,n,r,i,o){if(""===e)return null;var a=this.parseTermOrCURIEOrAbsURI(e,t,o?null:n,r,i);return a&&0===a.indexOf("_:")?null:a}},{key:"parsePrefixMappings",value:function(e,t){for(var n=this.tokenize(e),r=null,i=0;i<n.length;i++)":"===n[i][n[i].length-1]?r=n[i].substring(0,n[i].length-1):r&&(t[r]=this.options.base?I.join(n[i],this.options.base):n[i],r=null)}},{key:"parseSafeCURIEOrCURIEOrURI",value:function(e,t,n){return"["===(e=this.trim(e)).charAt(0)&&"]"===e.charAt(e.length-1)?0===(e=(e=e.substring(1,e.length-1)).trim(e)).length?null:"_:"===e?this.theOne:this.parseCURIE(e,t,n):this.parseCURIEOrURI(e,t,n)}},{key:"parseTermOrCURIEOrAbsURI",value:function(e,t,n,r,i){e=this.trim(e);var o=this.parseCURIE(e,r,i);if(o)return o;if(n){if(t&&!this.absURIRE.exec(e))return t+e;var a=n[e];if(a)return a;if(a=n[e.toLowerCase()])return a}return this.absURIRE.exec(e)?this.resolveAndNormalize(i,e):null}},{key:"parseTermOrCURIEOrURI",value:function(e,t,n,r,i){e=this.trim(e);var o=this.parseCURIE(e,r,i);if(o)return o;var a=n[e];return a||((a=n[e.toLowerCase()])?a:t&&!this.absURIRE.exec(e)?t+e:this.resolveAndNormalize(i,e))}},{key:"parseURI",value:function(e){return e}},{key:"process",value:function(t,n){var r;n=n||{},t.nodeType===At.DOCUMENT_NODE?(t.baseURI&&!n.baseURI&&(n.baseURI=t.baseURI),r=t.baseURI,(t=t.documentElement).baseURI||(t.baseURI=r),this.setContext(t)):t.parentNode.nodeType===At.DOCUMENT_NODE&&this.setContext(t);var i=[],o=function(e){if(!e&&n&&n.baseURI)return n.baseURI;var t=e.indexOf("#");return t>=0&&(e=e.substring(0,t)),n&&n.baseURIMap&&(e=n.baseURIMap(e)),e};for(i.push({current:t,context:this.push(null,o(t.baseURI))});i.length>0;){var a=i.shift();if(a.parent){if(a.context.parent&&a.context.parent.listMapping===a.listMapping)continue;for(var s in a.listMapping){var c=a.listMapping[s];if(0!==c.length){for(var u=[],l=0;l<c.length;l++)u.push(this.newBlankNode());for(var d=0;d<u.length;d++)this.addTriple(a.parent,u[d],"http://www.w3.org/1999/02/22-rdf-syntax-ns#first",c[d]),this.addTriple(a.parent,u[d],"http://www.w3.org/1999/02/22-rdf-syntax-ns#rest",{type:e.objectURI,value:d+1<u.length?u[d+1]:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"});this.addTriple(a.parent,a.subject,s,{type:e.objectURI,value:u[0]})}else this.addTriple(a.parent,a.subject,s,{type:e.objectURI,value:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"})}}else{var p=a.current,f=a.context,h=!1,m=null,g=null,v=null,y=f.prefixes,b=!1,w=[],x=f.listMapping,_=!f.parent,E=f.language,k=f.vocabulary;r=this.parseURI(o(p.baseURI)),p.item=null;var S=p.getAttributeNode("vocab");if(S){var C=this.trim(S.value);if(C.length>0){k=C;var A=r.spec;this.addTriple(p,A,"http://www.w3.org/ns/rdfa#usesVocabulary",{type:e.objectURI,value:k})}else k=this.vocabulary}for(var T=0;T<p.attributes.length;T++){var O=p.attributes[T];if("x"===O.nodeName.charAt(0)&&0===O.nodeName.indexOf("xmlns:")){b||(y=this.copyMappings(y),b=!0);var P=O.nodeName.substring(6),j=e.trim(O.value);y[P]=this.options.base?I.join(j,this.options.base):j}}var N=p.getAttributeNode("prefix");N&&(b||(y=this.copyMappings(y),b=!0),this.parsePrefixMappings(N.value,y));for(var F=null,R=0;!F&&R<this.langAttributes.length;R++)F=p.getAttributeNodeNS(this.langAttributes[R].namespaceURI,this.langAttributes[R].localName);if(F){var L=e.trim(F.value);E=L.length>0?L:null}var D,M,U=p.getAttributeNode("rel"),B=p.getAttributeNode("rev"),H=p.getAttributeNode("typeof"),q=p.getAttributeNode("property"),W=p.getAttributeNode("datatype"),K=this.inHTMLMode?p.getAttributeNode("datetime"):null,V=p.getAttributeNode("content"),J=p.getAttributeNode("about"),z=p.getAttributeNode("src"),Z=p.getAttributeNode("resource"),$=p.getAttributeNode("href"),G=p.getAttributeNode("inlist"),X=[];if(U){M=this.tokenize(U.value);for(var Q=0;Q<M.length;Q++)(D=this.parsePredicate(M[Q],k,f.terms,y,r,this.inHTMLMode&&null!==q))&&X.push(D)}var Y=[];if(B){M=this.tokenize(B.value);for(var ee=0;ee<M.length;ee++)(D=this.parsePredicate(M[ee],k,f.terms,y,r,this.inHTMLMode&&q))&&Y.push(D)}if(this.inHTMLMode&&(U||B)&&q&&(0===X.length&&(U=null),0===Y.length&&(B=null)),U||B?(J&&(m=this.parseSafeCURIEOrCURIEOrURI(J.value,y,r)),H&&(v=m),m||(p.parentNode.nodeType===At.DOCUMENT_NODE?m=o(p.baseURI):f.parentObject&&(m=o(p.parentNode.baseURI)===f.parentObject?o(p.baseURI):f.parentObject)),Z&&(g=this.parseSafeCURIEOrCURIEOrURI(Z.value,y,r)),g||($?g=this.resolveAndNormalize(r,encodeURI($.value)):z?g=this.resolveAndNormalize(r,encodeURI(z.value)):!H||J||this.inXHTMLMode&&("head"===p.localName||"body"===p.localName)||(g=this.newBlankNode())),!H||J||!this.inXHTMLMode||"head"!==p.localName&&"body"!==p.localName?H&&!J&&(v=g):v=m):!q||V||W?(J&&(m=this.parseSafeCURIEOrCURIEOrURI(J.value,y,r)),!m&&Z&&(m=this.parseSafeCURIEOrCURIEOrURI(Z.value,y,r)),!m&&$&&(m=this.resolveAndNormalize(r,encodeURI($.value))),!m&&z&&(m=this.resolveAndNormalize(r,encodeURI(z.value))),m||(p.parentNode.nodeType===At.DOCUMENT_NODE?m=o(p.baseURI):!this.inXHTMLMode&&!this.inHTMLMode||"head"!==p.localName&&"body"!==p.localName?H?m=this.newBlankNode():f.parentObject&&(m=o(p.parentNode.baseURI)===f.parentObject?o(p.baseURI):f.parentObject,q||(h=!0)):m=o(p.parentNode.baseURI)===f.parentObject?o(p.baseURI):f.parentObject),H&&(v=m)):(J&&(m=this.parseSafeCURIEOrCURIEOrURI(J.value,y,r),H&&(v=m)),m||p.parentNode.nodeType!==At.DOCUMENT_NODE?!m&&f.parentObject&&(m=o(p.parentNode.baseURI)===f.parentObject?o(p.baseURI):f.parentObject):(m=o(p.baseURI),H&&(v=m)),H&&!v&&(Z&&(v=this.parseSafeCURIEOrCURIEOrURI(Z.value,y,r)),!v&&$&&(v=this.resolveAndNormalize(r,encodeURI($.value))),!v&&z&&(v=this.resolveAndNormalize(r,encodeURI(z.value))),v||!this.inXHTMLMode&&!this.inHTMLMode||"head"!==p.localName&&"body"!==p.localName||(v=m),v||(v=this.newBlankNode()),g=v)),m&&(J||Z||v)){var te=m;H&&!J&&!Z&&g&&(te=g),this.newSubjectOrigin(p,te)}if(v){M=this.tokenize(H.value);for(var ne=0;ne<M.length;ne++){var re=this.parseTermOrCURIEOrAbsURI(M[ne],k,f.terms,y,r);re&&this.addTriple(p,v,e.typeURI,{type:e.objectURI,value:re})}}if(m&&m!==f.parentObject&&(x={},_=!0),g){if(U&&G)for(var ie=0;ie<X.length;ie++){var oe=x[X[ie]];oe||(oe=[],x[X[ie]]=oe),oe.push({type:e.objectURI,value:g})}else if(U)for(var ae=0;ae<X.length;ae++)this.addTriple(p,m,X[ae],{type:e.objectURI,value:g});if(B)for(var se=0;se<Y.length;se++)this.addTriple(p,g,Y[se],{type:e.objectURI,value:m})}else{if(m&&!g&&(U||B)&&(g=this.newBlankNode()),U&&G)for(var ce=0;ce<X.length;ce++){var ue=x[X[ce]];ue||(ue=[],x[D]=ue),w.push({predicate:X[ce],list:ue})}else if(U)for(var le=0;le<X.length;le++)w.push({predicate:X[le],forward:!0});if(B)for(var de=0;de<Y.length;de++)w.push({predicate:Y[de],forward:!1})}if(q){var pe=null,fe=null;W?(pe=""===W.value?e.PlainLiteralURI:this.parseTermOrCURIEOrAbsURI(W.value,k,f.terms,y,r),fe=K&&!V?K.value:pe===e.XMLLiteralURI||pe===e.HTMLLiteralURI?null:V?V.value:p.textContent):V?(pe=e.PlainLiteralURI,fe=V.value):K?(fe=K.value,(pe=e.deriveDateTimeType(fe))||(pe=e.PlainLiteralURI)):U||B||(Z&&(fe=this.parseSafeCURIEOrCURIEOrURI(Z.value,y,r)),!fe&&$?fe=this.resolveAndNormalize(r,encodeURI($.value)):!fe&&z&&(fe=this.resolveAndNormalize(r,encodeURI(z.value))),fe&&(pe=e.objectURI)),pe||(H&&!J?(pe=e.objectURI,fe=v):(fe=p.textContent,this.inHTMLMode&&"time"===p.localName&&(pe=e.deriveDateTimeType(fe)),pe||(pe=e.PlainLiteralURI))),M=this.tokenize(q.value);for(var he=0;he<M.length;he++){var me=this.parsePredicate(M[he],k,f.terms,y,r);if(me)if(G){var ge=x[me];ge||(ge=[],x[me]=ge),ge.push(pe===e.XMLLiteralURI||pe===e.HTMLLiteralURI?{type:pe,value:p.childNodes}:{type:pe||e.PlainLiteralURI,value:fe,language:E})}else pe===e.XMLLiteralURI||pe===e.HTMLLiteralURI?this.addTriple(p,m,me,{type:pe,value:p.childNodes}):this.addTriple(p,m,me,{type:pe||e.PlainLiteralURI,value:fe,language:E})}}if(m&&!h)for(var ve=0;ve<f.incomplete.length;ve++)f.incomplete[ve].list?f.incomplete[ve].list.push({type:e.objectURI,value:m}):f.incomplete[ve].forward?this.addTriple(p,f.subject,f.incomplete[ve].predicate,{type:e.objectURI,value:m}):this.addTriple(p,m,f.incomplete[ve].predicate,{type:e.objectURI,value:f.subject});var ye=null,be=m;h?((ye=this.push(f,f.subject)).parentObject=o(p.parentNode.baseURI)===f.parentObject?o(p.baseURI):f.parentObject,ye.incomplete=f.incomplete,ye.language=E,ye.prefixes=y,ye.vocabulary=k):((ye=this.push(f,m)).parentObject=g||m||f.subject,ye.prefixes=y,ye.incomplete=w,g&&(be=g,x={},_=!0),ye.listMapping=x,ye.language=E,ye.vocabulary=k),_&&i.unshift({parent:p,context:f,subject:be,listMapping:x});for(var we=p.lastChild;we;we=we.previousSibling)we.nodeType===At.ELEMENT_NODE&&i.unshift({current:we,context:ye})}}this.inHTMLMode&&this.copyProperties();for(var xe=0;xe<this.finishedHandlers.length;xe++)this.finishedHandlers[xe](t)}},{key:"push",value:function(e,t){return{parent:e,subject:t||(e?e.subject:null),parentObject:null,incomplete:[],listMapping:e?e.listMapping:{},language:e?e.language:this.language,prefixes:e?e.prefixes:this.target.graph.prefixes,terms:e?e.terms:this.target.graph.terms,vocabulary:e?e.vocabulary:this.vocabulary}}},{key:"resolveAndNormalize",value:function(e,t){return I.join(t,e)}},{key:"setContext",value:function(e){"html"===e.localName&&"XHTML+RDFa 1.1"===e.getAttribute("version")?this.setXHTMLContext():"html"===e.localName||"http://www.w3.org/1999/xhtml"===e.namespaceURI?"undefined"!=typeof document&&document.doctype?"-//W3C//DTD XHTML+RDFa 1.0//EN"===document.doctype.publicId&&"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"===document.doctype.systemId?(console.log("WARNING: RDF 1.0 is not supported. Defaulting to HTML5 mode."),this.setHTMLContext()):"-//W3C//DTD XHTML+RDFa 1.1//EN"===document.doctype.publicId&&"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd"===document.doctype.systemId?this.setXHTMLContext():this.setHTMLContext():this.setHTMLContext():this.setXMLContext()}},{key:"setHTMLContext",value:function(){this.setInitialContext(),this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"},{namespaceURI:null,localName:"lang"}],this.inXHTMLMode=!1,this.inHTMLMode=!0}},{key:"setInitialContext",value:function(){this.vocabulary=null,this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"}]}},{key:"setXHTMLContext",value:function(){this.setInitialContext(),this.inXHTMLMode=!0,this.inHTMLMode=!1,this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"},{namespaceURI:null,localName:"lang"}],this.target.graph.terms.alternate="http://www.w3.org/1999/xhtml/vocab#alternate",this.target.graph.terms.appendix="http://www.w3.org/1999/xhtml/vocab#appendix",this.target.graph.terms.bookmark="http://www.w3.org/1999/xhtml/vocab#bookmark",this.target.graph.terms.cite="http://www.w3.org/1999/xhtml/vocab#cite",this.target.graph.terms.chapter="http://www.w3.org/1999/xhtml/vocab#chapter",this.target.graph.terms.contents="http://www.w3.org/1999/xhtml/vocab#contents",this.target.graph.terms.copyright="http://www.w3.org/1999/xhtml/vocab#copyright",this.target.graph.terms.first="http://www.w3.org/1999/xhtml/vocab#first",this.target.graph.terms.glossary="http://www.w3.org/1999/xhtml/vocab#glossary",this.target.graph.terms.help="http://www.w3.org/1999/xhtml/vocab#help",this.target.graph.terms.icon="http://www.w3.org/1999/xhtml/vocab#icon",this.target.graph.terms.index="http://www.w3.org/1999/xhtml/vocab#index",this.target.graph.terms.last="http://www.w3.org/1999/xhtml/vocab#last",this.target.graph.terms.license="http://www.w3.org/1999/xhtml/vocab#license",this.target.graph.terms.meta="http://www.w3.org/1999/xhtml/vocab#meta",this.target.graph.terms.next="http://www.w3.org/1999/xhtml/vocab#next",this.target.graph.terms.prev="http://www.w3.org/1999/xhtml/vocab#prev",this.target.graph.terms.previous="http://www.w3.org/1999/xhtml/vocab#previous",this.target.graph.terms.section="http://www.w3.org/1999/xhtml/vocab#section",this.target.graph.terms.stylesheet="http://www.w3.org/1999/xhtml/vocab#stylesheet",this.target.graph.terms.subsection="http://www.w3.org/1999/xhtml/vocab#subsection",this.target.graph.terms.start="http://www.w3.org/1999/xhtml/vocab#start",this.target.graph.terms.top="http://www.w3.org/1999/xhtml/vocab#top",this.target.graph.terms.up="http://www.w3.org/1999/xhtml/vocab#up",this.target.graph.terms.p3pv1="http://www.w3.org/1999/xhtml/vocab#p3pv1",this.target.graph.terms.related="http://www.w3.org/1999/xhtml/vocab#related",this.target.graph.terms.role="http://www.w3.org/1999/xhtml/vocab#role",this.target.graph.terms.transformation="http://www.w3.org/1999/xhtml/vocab#transformation"}},{key:"setXMLContext",value:function(){this.setInitialContext(),this.inXHTMLMode=!1,this.inHTMLMode=!1}},{key:"tokenize",value:function(e){return this.trim(e).split(/\s+/)}},{key:"toRDFNodeObject",value:function(t){var n=this;if(void 0!==t){if("string"==typeof t)return"_:"===t.substring(0,2)?(void 0===this.blankNodes[t.substring(2)]&&(this.blankNodes[t.substring(2)]=new f(t.substring(2))),this.blankNodes[t.substring(2)]):D.namedNode(t);switch(t.type){case e.objectURI:return"_:"===t.value.substring(0,2)?(void 0===this.blankNodes[t.value.substring(2)]&&(this.blankNodes[t.value.substring(2)]=new f(t.value.substring(2))),this.blankNodes[t.value.substring(2)]):D.namedNode(t.value);case e.PlainLiteralURI:return new y(t.value,t.language||"");case e.XMLLiteralURI:case e.HTMLLiteralURI:var r="";return Object.keys(t.value).forEach((function(e){r+=B.domToString(t.value[e],n.htmlOptions)})),new y(r,"",new m.Z(t.type));default:return new y(t.value,"",new m.Z(t.type))}}}},{key:"trim",value:function(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}}],[{key:"parseRDFaDOM",value:function(t,n,r){var i=new e(n,{base:r});t.baseURI||(t.baseURI=r),i.process(t,{baseURI:r})}},{key:"tokenize",value:function(e){return this.trim(e).split(/\s+/)}},{key:"trim",value:function(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}}]),e}();Tt.XMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral",Tt.HTMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML",Tt.PlainLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral",Tt.objectURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#object",Tt.typeURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",Tt.nameChar="[-A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�က0-F.0-9·̀-ͯ‿-⁀]",Tt.nameStartChar="[A-Za-zÀ-ÖØ-öø-ÿĀ-ıĴ-ľŁ-ňŊ-žƀ-ǃǍ-ǰǴ-ǵǺ-ȗɐ-ʨʻ-ˁΆΈ-ΊΌΎ-ΡΣ-ώϐ-ϖϚϜϞϠϢ-ϳЁ-ЌЎ-яё-ќў-ҁҐ-ӄӇ-ӈӋ-ӌӐ-ӫӮ-ӵӸ-ӹԱ-Ֆՙա-ֆא-תװ-ײء-غف-يٱ-ڷں-ھۀ-ێې-ۓەۥ-ۦअ-हऽक़-ॡঅ-ঌএ-ঐও-নপ-রলশ-হড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઋઍએ-ઑઓ-નપ-રલ-ળવ-હઽૠଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଶ-ହଽଡ଼-ଢ଼ୟ-ୡஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-வஷ-ஹఅ-ఌఎ-ఐఒ-నప-ళవ-హౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹൠ-ൡก-ฮะา-ำเ-ๅກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ຮະາ-ຳຽເ-ໄཀ-ཇཉ-ཀྵႠ-Ⴥა-ჶᄀᄂ-ᄃᄅ-ᄇᄉᄋ-ᄌᄎ-ᄒᄼᄾᅀᅌᅎᅐᅔ-ᅕᅙᅟ-ᅡᅣᅥᅧᅩᅭ-ᅮᅲ-ᅳᅵᆞᆨᆫᆮ-ᆯᆷ-ᆸᆺᆼ-ᇂᇫᇰᇹḀ-ẛẠ-ỹἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼΩK-Å℮ↀ-ↂぁ-ゔァ-ヺㄅ-ㄬ가-힣一-龥〇〡-〩_]",Tt.NCNAME=new RegExp("^"+Tt.nameStartChar+Tt.nameChar+"*$"),Tt.dateTimeTypes=[{pattern:/-?P(?:[0-9]+Y)?(?:[0-9]+M)?(?:[0-9]+D)?(?:T(?:[0-9]+H)?(?:[0-9]+M)?(?:[0-9]+(?:\.[0-9]+)?S)?)?/,type:"http://www.w3.org/2001/XMLSchema#duration"},{pattern:/-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]-[0-9][0-9]T(?:[0-1][0-9]|2[0-4]):[0-5][0-9]:[0-5][0-9](?:\.[0-9]+)?(?:Z|[+\-][0-9][0-9]:[0-9][0-9])?/,type:"http://www.w3.org/2001/XMLSchema#dateTime"},{pattern:/-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]-[0-9][0-9](?:Z|[+\-][0-9][0-9]:[0-9][0-9])?/,type:"http://www.w3.org/2001/XMLSchema#date"},{pattern:/(?:[0-1][0-9]|2[0-4]):[0-5][0-9]:[0-5][0-9](?:\.[0-9]+)?(?:Z|[+\-][0-9][0-9]:[0-9][0-9])?/,type:"http://www.w3.org/2001/XMLSchema#time"},{pattern:/-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]/,type:"http://www.w3.org/2001/XMLSchema#gYearMonth"},{pattern:/-?[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9]/,type:"http://www.w3.org/2001/XMLSchema#gYear"}];var Ot=Tt.parseRDFaDOM,Pt=function(){function e(t){(0,i.Z)(this,e),this.store=t,this.bnodes={},this.why=null,this.reify=!1}return(0,r.Z)(e,[{key:"frameFactory",value:function(t,n,r){return{NODE:1,ARC:2,parent:n,parser:t,store:t.store,element:r,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,t){t=I.join(t,this.base),this.node=this.store.sym(t),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 t=this.store.sym(I.join("#"+this.parent.rdfid,this.base));this.store.add(t,this.store.sym(e.ns.RDF+"type"),this.store.sym(e.ns.RDF+"Statement"),this.parser.why),this.store.add(t,this.store.sym(e.ns.RDF+"subject"),this.parent.parent.node,this.parser.why),this.store.add(t,this.store.sym(e.ns.RDF+"predicate"),this.parent.node,this.parser.why),this.store.add(t,this.store.sym(e.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(t){t===e.ns.RDF+"li"&&(t=e.ns.RDF+"_"+this.parent.listIndex,this.parent.listIndex++),this.addSymbol(this.ARC,t)},addLiteral:function(t){this.parent.datatype&&this.parent.datatype!==e.ns.RDF+"langString"?this.node=this.store.literal(t,this.store.sym(this.parent.datatype)):this.node=this.store.literal(t,this.lang),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()}}}},{key:"getAttributeNodeNS",value:function(e,t,n){var r=null;if(e.getAttributeNodeNS)r=e.getAttributeNodeNS(t,n);else for(var i,o=e.attributes,a=0;a<o.length;++a)if((i=o[a]).namespaceURI===t&&(i.prefix?i.prefix+":"+n:n)===i.nodeName){r=i;break}return r}},{key:"parse",value:function(t,n,r){var i,o=t.childNodes;if(this.cleanParser(),t.nodeType===e.nodeType.DOCUMENT){for(var a=0;a<o.length;a++)if(o[a].nodeType===e.nodeType.ELEMENT){i=o[a];break}}else{if(t.nodeType!==e.nodeType.ELEMENT)throw new Error("RDFParser: can't find root in "+n+". Halting. ");i=t}this.why=r;var s=this.frameFactory(this);return this.base=n,s.base=n,s.lang=null,this.parseDOM(this.buildFrame(s,i)),!0}},{key:"parseDOM",value:function(t){for(var n,r=function(e){var t="";if(null==e.namespaceURI)throw new Error("RDF/XML syntax error: No namespace for "+e.localName+" in "+this.base);return e.namespaceURI&&(t+=e.namespaceURI),e.localName?t+=e.localName:e.nodeName&&(e.nodeName.indexOf(":")>=0?t+=e.nodeName.split(":")[1]:t+=e.nodeName),t}.bind(this),i=!0;t.parent;){var o=t.element,a=o.attributes;if(o.nodeType===e.nodeType.TEXT||o.nodeType===e.nodeType.CDATA_SECTION)t.parent.nodeType===t.NODE&&(t.addArc(e.ns.RDF+"value"),t=this.buildFrame(t)),t.addLiteral(o.nodeValue);else if(r(o)!==e.ns.RDF+"RDF")if(t.parent&&t.parent.collection&&(t.addCollectionArc(),(t=this.buildFrame(t,t.element)).parent.element=null),t.parent&&t.parent.nodeType&&t.parent.nodeType!==t.ARC){t.addArc(r(o)),this.reify&&(n=this.getAttributeNodeNS(o,e.ns.RDF,"ID"))&&(t.rdfid=n.nodeValue,o.removeAttributeNode(n));var s=this.getAttributeNodeNS(o,e.ns.RDF,"parseType"),c=this.getAttributeNodeNS(o,e.ns.RDF,"datatype");if(c&&(t.datatype=c.nodeValue,o.removeAttributeNode(c)),s){var u=s.nodeValue;"Literal"===u?(t.datatype=e.ns.RDF+"XMLLiteral",(t=this.buildFrame(t)).addLiteral(o.childNodes),i=!1):"Resource"===u?((t=this.buildFrame(t,t.element)).parent.element=null,t.addBNode()):"Collection"===u&&((t=this.buildFrame(t,t.element)).parent.element=null,t.addCollection()),o.removeAttributeNode(s)}if(0!==a.length){var l=this.getAttributeNodeNS(o,e.ns.RDF,"resource"),d=this.getAttributeNodeNS(o,e.ns.RDF,"nodeID");t=this.buildFrame(t),l?(t.addNode(l.nodeValue),o.removeAttributeNode(l)):d?(t.addBNode(d.nodeValue),o.removeAttributeNode(d)):t.addBNode();for(var p=a.length-1;p>=0;p--){var f=this.buildFrame(t);f.addArc(r(a[p])),r(a[p])===e.ns.RDF+"type"?this.buildFrame(f).addNode(a[p].nodeValue):this.buildFrame(f).addLiteral(a[p].nodeValue)}}else 0===o.childNodes.length&&this.buildFrame(t).addLiteral("")}else{var h=this.getAttributeNodeNS(o,e.ns.RDF,"about");if(n=this.getAttributeNodeNS(o,e.ns.RDF,"ID"),h&&n)throw new Error("RDFParser: "+o.nodeName+" has both rdf:id and rdf:about. Halting. Only one of these properties may be specified on a node.");if(!h&&n)t.addNode("#"+n.nodeValue),o.removeAttributeNode(n);else if(null==h&&null==n){var m=this.getAttributeNodeNS(o,e.ns.RDF,"nodeID");m?(t.addBNode(m.nodeValue),o.removeAttributeNode(m)):t.addBNode()}else t.addNode(h.nodeValue),o.removeAttributeNode(h);var g=this.getAttributeNodeNS(o,e.ns.RDF,"type");e.ns.RDF+"Description"!==r(o)&&(g={nodeValue:r(o)}),null!=g&&(this.store.add(t.node,this.store.sym(e.ns.RDF+"type"),this.store.sym(I.join(g.nodeValue,t.base)),this.why),g.nodeName&&o.removeAttributeNode(g));for(var v=a.length-1;v>=0;v--)this.store.add(t.node,this.store.sym(r(a[v])),this.store.literal(a[v].nodeValue,t.lang),this.why)}for(o=t.element;t.parent;){for(var y=t;null==o;)o=(t=t.parent).element;var b=o.childNodes&&o.childNodes[t.lastChild];if(b&&i){if((b.nodeType===e.nodeType.ELEMENT||b.nodeType===e.nodeType.TEXT||b.nodeType===e.nodeType.CDATA_SECTION)&&(b.nodeType!==e.nodeType.TEXT&&b.nodeType!==e.nodeType.CDATA_SECTION||1===o.childNodes.length)){t.lastChild++,t=this.buildFrame(y,o.childNodes[t.lastChild-1]);break}t.lastChild++}else{if(t.terminateFrame(),!(t=t.parent))break;o=t.element,i=!0}}}}},{key:"cleanParser",value:function(){this.bnodes={},this.why=null}},{key:"buildFrame",value:function(t,n){var r=this.frameFactory(this,t,n);if(t&&(r.base=t.base,r.lang=t.lang),!n||n.nodeType===e.nodeType.TEXT||n.nodeType===e.nodeType.CDATA_SECTION)return r;var i=n.attributes,o=n.getAttributeNode("xml:base");null!=o&&(r.base=o.nodeValue,n.removeAttribute("xml:base"));var a=n.getAttributeNode("xml:lang");null!=a&&(r.lang=a.nodeValue,n.removeAttribute("xml:lang"));for(var s=i.length-1;s>=0;s--)if("xml"===i[s].nodeName.substr(0,3)){if("xmlns:"===i[s].name.slice(0,6)){var c=i[s].nodeValue;this.base&&(c=I.join(c,this.base)),this.store.setPrefixForURI(i[s].name.slice(6),c)}n.removeAttributeNode(i[s])}return r}}]),e}();function It(e,t,n){var r,i,o,a=["INSERT","DELETE","WHERE"],s=U("http://www.w3.org/ns/pim/patch#"),c=De(t,t,n,n,null,null,"",null),u={},l=function(e,t,n,r,i){return"Line "+(t+1)+" of <"+e+">: Bad syntax:\n "+i+'\n at: "'+n.slice(r,r+30)+'"'};r=0;var d=t.sym(n+"#query");for(u.query=d;;){if((i=c.skipSpace(e,r))<0)return u;if(";"===e[i]){if((r=c.skipSpace(e,i+1))<0)return u;i=r}var p=!1;for(o=0;o<a.length;o++){var f=a[o];if(e.slice(i,i+f.length)===f){if((r=c.skipSpace(e,i+f.length))<0)throw l(c._thisDoc,c.lines,e,i+f.length,"found EOF, needed {...} after "+f);if(("INSERT"===f||"DELETE"===f)&&"DATA"===e.slice(r,r+4)){if((i=c.skipSpace(e,r+4))<0)throw l(c._thisDoc,c.lines,e,r+4,"needed {...} after INSERT DATA "+f);r=i}var h=[];if((i=c.node(e,r,h))<0)throw l(c._thisDoc,c.lines,e,r,"bad syntax or EOF in {...} after "+f);u[f.toLowerCase()]=h[0],t.add(d,s(f.toLowerCase()),h[0]),p=!0,r=i}}if(!p&&"@prefix"===e.slice(i,i+7)){if((r=c.directive(e,i))<0)throw l(c._thisDoc,c.lines,e,r,"bad syntax or EOF after @prefix ");r=c.checkDot(e,r),p=!0}if(!p)throw l(c._thisDoc,c.lines,e,i,"Unknown syntax at start of statememt: '"+e.slice(i).slice(0,20)+"'")}}function jt(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"text/turtle",i=arguments.length>4?arguments[4]:void 0;r=(r=r||p.z8).split(";")[0];try{if(r===p.qS||r===p.z8){var o=De(t,t,n,n,null,null,"",null);o.loadBuf(e),c()}else if(r===p.Is){var a=new Pt(t);a.parse(B.parseXML(e),n,t.sym(n)),c()}else if(r===p.D7)Ot(B.parseXML(e,{contentType:p.D7}),t,n),c();else if(r===p.us)Ot(B.parseXML(e,{contentType:p.us}),t,n),c();else if(r===p.oW||r===p.xm)It(e,t,n),c();else if(r===p.ui)Ze(e,t,n,c);else{if(r!==p.b4&&r!==p.lL)throw void 0===r?new Error("contentType is undefined"):new Error("Don't know how to parse "+r+" yet");var s=new kt({factory:Ke});l(null,e)}}catch(e){u(e)}function c(){i&&i(null,t)}function u(e){if(r!==p.ui||r!==p.b4||r!==p.lL){if(!i){var o=new Error(e+" while trying to parse <"+n+"> as "+r);throw o.cause=e,o}i(e,t)}}function l(e,n){e&&i(e,t);try{s.parse(n,d)}catch(e){i(e,t)}}function d(e,n){n?t.add(n.subject,n.predicate,n.object,n.graph):i(e,t)}jt.handled={"text/n3":!0,"text/turtle":!0,"application/rdf+xml":!0,"application/xhtml+xml":!0,"text/html":!0,"application/sparql-update":!0,"application/sparql-update-single-match":!0,"application/ld+json":!0,"application/nquads":!0,"application/n-quads":!0}}(0,u.Z)(Pt,"ns",{RDF:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",RDFS:"http://www.w3.org/2000/01/rdf-schema#"}),(0,u.Z)(Pt,"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});var Nt=n(4098),Ft=n.n(Nt),Rt=n(8918);function Lt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,c.Z)(e);if(t){var i=(0,c.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}var Dt={"text/n3":!0,"text/turtle":!0,"application/rdf+xml":!0,"application/xhtml+xml":!0,"text/html":!0,"application/ld+json":!0},Mt={rdf:p.Is,owl:p.Is,n3:"text/n3",ttl:"text/turtle",nt:"text/n3",acl:"text/n3",html:"text/html",xml:"text/xml"},Ut=function(e){return{link:U("http://www.w3.org/2007/ont/link#",e),http:U("http://www.w3.org/2007/ont/http#",e),httph:U("http://www.w3.org/2007/ont/httph#",e),rdf:U("http://www.w3.org/1999/02/22-rdf-syntax-ns#",e),rdfs:U("http://www.w3.org/2000/01/rdf-schema#",e),dc:U("http://purl.org/dc/elements/1.1/",e),ldp:U("http://www.w3.org/ns/ldp#",e)}},Bt=Ut(),Ht=(0,r.Z)((function e(t,n){(0,i.Z)(this,e),(0,u.Z)(this,"response",void 0),(0,u.Z)(this,"dom",void 0),this.response=t,this.dom=n}));(0,u.Z)(Ht,"pattern",void 0);var qt=function(e){(0,a.Z)(n,e);var t=Lt(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n,[{key:"parse",value:function(e,t,n){var r=e.store;if(this.dom||(this.dom=B.parseXML(t)),"parsererror"===this.dom.documentElement.nodeName)return e.failFetch(n,"Badly formed XML in "+n.resource.value,"parse_error");var i=new Pt(r);try{i.parse(this.dom,n.original.value,n.original)}catch(t){return e.failFetch(n,"Syntax error parsing RDF/XML! "+t,"parse_error")}return n.noMeta||r.add(n.original,Bt.rdf("type"),Bt.link("RDFDocument"),e.appNode),e.doneFetch(n,this.response)}}],[{key:"toString",value:function(){return"RDFXMLHandler"}},{key:"register",value:function(e){e.mediatypes[p.Is]={q:.9}}}]),n}(Ht);qt.pattern=new RegExp("application/rdf\\+xml");var Wt=function(e){(0,a.Z)(n,e);var t=Lt(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n,[{key:"parse",value:function(e,t,n){var r,i;this.dom||(this.dom=B.parseXML(t));var o=e.store,a=this.dom.getElementsByTagName("title");a.length>0&&o.add(n.resource,Bt.dc("title"),o.rdfFactory.literal(a[0].textContent),n.resource);for(var s=this.dom.getElementsByTagName("link"),c=s.length-1;c>=0;c--)i=!1,(r=s[c].getAttribute("rel"))||(r=s[c].getAttribute("rev"),i=!0),r&&e.linkData(n.original,r,s[c].getAttribute("href"),n.resource,i);for(var u=this.dom.getElementsByTagName("script"),l=0;l<u.length;l++){var d=u[l].getAttribute("type");Dt[d]&&(jt(u[l].textContent,o,n.original.value,d),jt(u[l].textContent,o,n.original.value,d))}if(n.noMeta||o.add(n.resource,Bt.rdf("type"),Bt.link("WebPage"),e.appNode),!n.noRDFa&&Ot)try{Ot(this.dom,o,n.original.value)}catch(t){var p="Error trying to parse "+n.resource+" as RDFa:\n"+t+":\n"+t.stack;return e.failFetch(n,p,"parse_error")}return e.doneFetch(n,this.response)}}],[{key:"toString",value:function(){return"XHTMLHandler"}},{key:"register",value:function(e){e.mediatypes[p.D7]={}}}]),n}(Ht);Wt.pattern=new RegExp("application/xhtml");var Kt=function(e){(0,a.Z)(n,e);var t=Lt(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n,[{key:"parse",value:function(e,t,r){for(var i=B.parseXML(t),o=0;o<i.childNodes.length;o++){var a=i.childNodes[o];if(n.isElement(a)){var s=a.namespaceURI;if(s&&s===s.rdf)return e.addStatus(r.req,"Has XML root element in the RDF namespace, so assume RDF/XML."),new qt(this.response,i).parse(e,t,r);break}}if(i.doctype&&"html"===i.doctype.name&&i.doctype.publicId.match(/^-\/\/W3C\/\/DTD XHTML/)&&i.doctype.systemId.match(/http:\/\/www.w3.org\/TR\/xhtml/))return e.addStatus(r.req,"Has XHTML DOCTYPE. Switching to XHTML Handler.\n"),new Wt(this.response,i).parse(e,t,r);var c=i.getElementsByTagName("html")[0];if(c){var u=c.getAttribute("xmlns");if(u&&u.match(/^http:\/\/www.w3.org\/1999\/xhtml/))return e.addStatus(r.req,"Has a default namespace for XHTML. Switching to XHTMLHandler.\n"),new Wt(this.response,i).parse(e,t,r)}return e.failFetch(r,"Unsupported dialect of XML: not RDF or XHTML namespace, etc.\n"+t.slice(0,80),901)}}],[{key:"toString",value:function(){return"XMLHandler"}},{key:"register",value:function(e){e.mediatypes["text/xml"]={q:.5},e.mediatypes["application/xml"]={q:.5}}},{key:"isElement",value:function(e){return e.nodeType===Node.ELEMENT_NODE}}]),n}(Ht);Kt.pattern=new RegExp("(text|application)/(.*)xml");var Vt=function(e){(0,a.Z)(n,e);var t=Lt(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n,[{key:"parse",value:function(e,t,n){var r=e.store;if(Gt(t))return e.addStatus(n.req,"Has an XML declaration. We'll assume it's XHTML as the content-type was text/html.\n"),new Wt(this.response).parse(e,t,n);if(function(e){var t=e.indexOf("<!DOCTYPE html"),n=e.indexOf(">");return!(-1===t||-1===n||t>n)&&-1!==e.substr(t,n-t).indexOf("XHTML")}(t))return e.addStatus(n.req,"Has XHTML DOCTYPE. Switching to XHTMLHandler.\n"),new Wt(this.response).parse(e,t,n);if(function(e){return!!e.match(/[^(<html)]*<html\s+[^<]*xmlns=['"]http:\/\/www.w3.org\/1999\/xhtml["'][^<]*>/)}(t))return e.addStatus(n.req,"Has default namespace for XHTML, so switching to XHTMLHandler.\n"),new Wt(this.response).parse(e,t,n);var i=new RegExp("<title>([\\s\\S]+?)</title>","im").exec(t);return i&&r.add(n.resource,Bt.dc("title"),r.rdfFactory.literal(i[1]),n.resource),r.add(n.resource,Bt.rdf("type"),Bt.link("WebPage"),e.appNode),e.addStatus(n.req,"non-XML HTML document, not parsed for data."),e.doneFetch(n,this.response)}}],[{key:"toString",value:function(){return"HTMLHandler"}},{key:"register",value:function(e){e.mediatypes["text/html"]={q:.9}}}]),n}(Ht);Vt.pattern=new RegExp("text/html");var Jt=function(e){(0,a.Z)(n,e);var t=Lt(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n,[{key:"parse",value:function(e,t,n,r){var i=e.store;return new Promise((function(o,a){try{Ze(t,i,n.original.value,(function(){o(e.doneFetch(n,r))}))}catch(t){var s="Error trying to parse "+n.resource+" as JSON-LD:\n"+t;o(e.failFetch(n,s,"parse_error",r))}}))}}],[{key:"toString",value:function(){return"JsonLdHandler"}},{key:"register",value:function(e){e.mediatypes["application/ld+json"]={q:.9}}}]),n}(Ht);Jt.pattern=/application\/ld\+json/;var zt=function(e){(0,a.Z)(n,e);var t=Lt(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n,[{key:"parse",value:function(e,t,n){return Gt(t)?(e.addStatus(n.req,"Warning: "+n.resource+" has an XML declaration. We'll assume it's XML but its content-type wasn't XML.\n"),new Kt(this.response).parse(e,t,n)):t.slice(0,500).match(/xmlns:/)?(e.addStatus(n.req,"May have an XML namespace. We'll assume it's XML but its content-type wasn't XML.\n"),new Kt(this.response).parse(e,t,n)):(e.addStatus(n.req,"Plain text document, no known RDF semantics."),e.doneFetch(n,this.response))}}],[{key:"toString",value:function(){return"TextHandler"}},{key:"register",value:function(e){e.mediatypes["text/plain"]={q:.5}}}]),n}(Ht);zt.pattern=new RegExp("text/plain");var Zt=function(e){(0,a.Z)(n,e);var t=Lt(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n,[{key:"parse",value:function(e,t,n,r){var i=e.store,o=De(i,i,n.original.value,n.original.value,null,null,"",null);try{o.loadBuf(t)}catch(t){var a="Error trying to parse "+n.resource+" as Notation3:\n"+t;return e.failFetch(n,a,"parse_error",r)}return e.addStatus(n.req,"N3 parsed: "+o.statementCount+" triples in "+o.lines+" lines."),e.store.add(n.original,Bt.rdf("type"),Bt.link("RDFDocument"),e.appNode),e.doneFetch(n,this.response)}}],[{key:"toString",value:function(){return"N3Handler"}},{key:"register",value:function(e){e.mediatypes["text/n3"]={q:"1.0"},e.mediatypes["text/turtle"]={q:1}}}]),n}(Ht);Zt.pattern=new RegExp("(application|text)/(x-)?(rdf\\+)?(n3|turtle)");var $t={RDFXMLHandler:qt,XHTMLHandler:Wt,XMLHandler:Kt,HTMLHandler:Vt,TextHandler:zt,N3Handler:Zt,JsonLdHandler:Jt};function Gt(e){return!!e.match(/\s*<\?xml\s+version\s*=[^<>]+\?>/)}var Xt=function(){function e(t){var r=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((0,i.Z)(this,e),(0,u.Z)(this,"store",void 0),(0,u.Z)(this,"timeout",void 0),(0,u.Z)(this,"_fetch",void 0),(0,u.Z)(this,"mediatypes",void 0),(0,u.Z)(this,"appNode",void 0),(0,u.Z)(this,"requested",void 0),(0,u.Z)(this,"timeouts",void 0),(0,u.Z)(this,"redirectedTo",void 0),(0,u.Z)(this,"fetchQueue",void 0),(0,u.Z)(this,"fetchCallbacks",void 0),(0,u.Z)(this,"nonexistent",void 0),(0,u.Z)(this,"lookedUp",void 0),(0,u.Z)(this,"handlers",void 0),(0,u.Z)(this,"ns",void 0),(0,u.Z)(this,"fireCallbacks",void 0),this.store=t||new fe,this.ns=Ut(this.store.rdfFactory),this.timeout=o.timeout||3e4,this._fetch=o.fetch||void 0!==n.g&&(n.g.solidFetcher||n.g.solidFetch)||"undefined"!=typeof window&&(window.solidFetcher||window.solidFetch)||Ft(),!this._fetch)throw new Error("No _fetch function available for Fetcher");this.appNode=this.store.rdfFactory.blankNode(),this.store.fetcher=this,this.requested={},this.timeouts={},this.redirectedTo={},this.fetchQueue={},this.fetchCallbacks={},this.nonexistent={},this.lookedUp={},this.handlers=[],this.mediatypes={"image/*":{q:.9},"*/*":{q:.1}},B.callbackify(this,["request","fail","refresh","retract","done"]),Object.keys(o.handlers||$t).map((function(e){return r.addHandler($t[e])}))}var t,o;return(0,r.Z)(e,[{key:"load",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(n=Object.assign({},n),e instanceof Array)return Promise.all(e.map((function(e){return t.load(e,Object.assign({},n))})));var r=e,i=(0,Rt._)(r);i=i.split("#")[0],n=this.initFetchOptions(i,n);var o=this.initFetchOptions(i,n);return this.pendingFetchPromise(i,o.baseURI,o)}},{key:"pendingFetchPromise",value:(o=E(S().mark((function e(t,n,r){var i,o=this;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=!r.force,!e.t0){e.next=5;break}return e.next=4,this.fetchQueue[n];case 4:e.t0=e.sent;case 5:if(!e.t0){e.next=9;break}i=this.fetchQueue[n],e.next=12;break;case 9:i=Promise.race([this.setRequestTimeout(t,r),this.fetchUri(t,r)]),this.fetchQueue[n]=i,this.cleanupFetchRequest(n,void 0,this.timeout);case 12:return e.abrupt("return",i.then((function(e){return t in o.timeouts&&(o.timeouts[t].forEach(clearTimeout),delete o.timeouts[t]),e})));case 13:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return o.apply(this,arguments)})},{key:"cleanupFetchRequest",value:function(e,t,n){var r=this;void 0!==t&&console.warn("_options is deprecated"),this.timeouts[e]=(this.timeouts[e]||[]).concat(setTimeout((function(){r.isPending(e)||delete r.fetchQueue[e]}),n))}},{key:"initFetchOptions",value:function(t,n){var r=this.store;!n.method||"GET"===n.method.toUpperCase()||(n.force=!0),n.resource=r.rdfFactory.namedNode(t),n.baseURI=n.baseURI||t,n.original=r.rdfFactory.namedNode(n.baseURI),n.req=r.bnode(),n.headers=n.headers||new Nt.Headers,n.contentType&&(n.headers["content-type"]=n.contentType),n.force&&(n.cache="no-cache");var i=this.acceptString();n.headers.accept=i;var o=e.offlineOverride(t);n.requestedURI=o,e.setCredentials(o,n);var a=e.proxyIfNecessary(o);return o!==a&&(n.proxyUsed=!0),n.actualProxyURI=a,n}},{key:"fetchUri",value:function(t,n){var r=this;if(!t)return Promise.reject(new Error("Cannot fetch an empty uri"));if(e.unsupportedProtocol(t))return this.failFetch(n,"fetcher: Unsupported protocol","unsupported_protocol");var i=this.getState(t);if(n.force)delete this.nonexistent[t];else{if("fetched"===i)return Promise.resolve(this.doneFetch(n,{status:200,ok:!0,statusText:"Already loaded into quadstore."}));if("failed"===i&&404===this.requested[t]){var o="Previously failed: "+this.requested[t],a={url:t,status:this.requested[t],statusText:o,responseText:o,headers:new Nt.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return this.failFetch(n,o,this.requested[t],a)}}this.fireCallbacks("request",[t]),this.requested[t]=!0,n.noMeta||this.saveRequestMetadata(t,n);var s=n.actualProxyURI;return this._fetch(s,n).then((function(e){return r.handleResponse(e,t,n)}),(function(e){var i={url:s,status:999,statusText:(e.name||"network failure")+": "+(e.errno||e.code||e.type),responseText:e.message,headers:new Nt.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return r.handleError(i,t,n)}))}},{key:"nowOrWhenFetched",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=(0,Rt._)(e);"function"==typeof t?n=t:void 0===t||((0,g.NX)(t)?r.referringTerm=t:r=t),this.load(i,r).then((function(e){if(n)if(e)if(e.ok)n(!0,"OK",e);else{var t="HTTP error: Status "+e.status+" ("+e.statusText+")";e.responseText&&(t+=" "+e.responseText),n(!1,t,e)}else n(!1,"@@ nowOrWhenFetched: no response object!")}),(function(e){var t=e.message||e.statusText;t="Failed to load <"+i+"> "+t,e.response&&e.response.status&&(t+=" status: "+e.response.status),n(!1,t,e.response)}))}},{key:"addStatus",value:function(e,t){var n=new Date;t="["+n.getHours()+":"+n.getMinutes()+":"+n.getSeconds()+"."+n.getMilliseconds()+"] "+t;var r=this.store,i=r.the(e,this.ns.link("status"));(0,g.uZ)(i)?i.append(r.rdfFactory.literal(t)):M.Z.warn("web.js: No list to add to: "+i+","+t)}},{key:"failFetch",value:function(e,t,n,r){this.addStatus(e.req,t),e.noMeta||this.store.add(e.original,this.ns.link("error"),this.store.rdfFactory.literal(t));var i=(e.method||"GET").toUpperCase();("GET"===i||"HEAD"===i)&&(e.resource.equals(e.original),this.requested[I.docpart(e.original.value)]=n,this.fireCallbacks("fail",[e.original.value,t]));var o=new Error("Fetcher: "+t);return o.status=n,o.statusText=t,o.response=r,Promise.reject(o)}},{key:"linkData",value:function(e,t,n,r,i){if(n){var o,a=this.store,s=a.rdfFactory.namedNode(I.join(n,e.value));if("alternate"===t||"seeAlso"===t||"meta"===t||"describedby"===t){if(s.value===e.value)return;o=this.ns.rdfs("seeAlso")}else o="type"===t?a.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"):a.rdfFactory.namedNode(I.join(encodeURIComponent(t),"http://www.iana.org/assignments/link-relations/"));i?a.add(s,o,e,r):a.add(e,o,s,r)}}},{key:"parseLinkHeader",value:function(e,t,n){if(e){var r=/[^\(\)<>@,;:"\/\[\]\?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*"))/g,i=e.match(/<[^>]*>\s*(\s*;\s*[^()<>@,;:"/[\]?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*")))*(,|$)/g);if(null!=i)for(var o=0;o<i.length;o++){var a=i[o].split(">"),s=a[0].substring(1),c=a[1].match(r);if(null==c)return;for(var u=0;u<c.length;u++){var l=c[u].split("=")[1].replace(/["']/g,"");this.linkData(t,l,s,n)}}}}},{key:"doneFetch",value:function(e,t){return this.addStatus(e.req,"Done."),this.requested[e.original.value]="done",this.fireCallbacks("done",[e.original.value]),t.req=e.req,t}},{key:"nowKnownAs",value:function(e,t){this.lookedUp[e.value]?this.lookedUp[t.value]||this.lookUpThing(t,e):this.lookedUp[t.value]&&(this.lookedUp[e.value]||this.lookUpThing(e,t))}},{key:"putBack",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,Rt._)(e),i=new m.Z(r).doc();return n.contentType=n["content-type"]||n["Content-Type"]||n.contentType||p.z8,"application/ld+json"===n.contentType?new Promise((function(r,o){z(i,t.store,i.uri,n.contentType,(function(i,a){i?o(i):(n.data=a,t.webOperation("PUT",e,n).then((function(e){return r(e)})).catch((function(e){return o(e)})))}))})):(n.data=z(i,this.store,i.value,n.contentType),this.webOperation("PUT",r,n))}},{key:"webCopy",value:function(e,t,n){var r=this;return this.webOperation("GET",e).then((function(e){return r.webOperation("PUT",t,{data:e.responseText,contentType:n})}))}},{key:"delete",value:function(e,t){var n=this;return this.webOperation("DELETE",e,t).then((function(t){return n.requested[e]=404,n.nonexistent[e]=!0,n.unload(n.store.rdfFactory.namedNode(e)),t}))}},{key:"createIfNotExists",value:(t=E(S().mark((function e(t){var n,r,i,o,a=arguments;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:p.z8,r=a.length>2&&void 0!==a[2]?a[2]:"",i=this,e.prev=3,e.next=6,i.load(t);case 6:o=e.sent,e.next=26;break;case 9:if(e.prev=9,e.t0=e.catch(3),404!==e.t0.response.status){e.next=25;break}return e.prev=12,e.next=15,i.webOperation("PUT",t.value,{data:r,contentType:n});case 15:o=e.sent,e.next=21;break;case 18:throw e.prev=18,e.t1=e.catch(12),e.t1;case 21:return delete i.requested[t.value],e.abrupt("return",o);case 25:throw e.t0;case 26:return e.abrupt("return",o);case 27:case"end":return e.stop()}}),e,this,[[3,9],[12,18]])}))),function(e){return t.apply(this,arguments)})},{key:"createContainer",value:function(e,t,n){var r={"content-type":p.z8,link:this.ns.ldp("BasicContainer")+'; rel="type"'};t&&(r.slug=t);var i={headers:r};return n&&(i.body=n),this.webOperation("POST",e,i)}},{key:"invalidateCache",value:function(e){var t=(0,Rt._)(e),n=this;if(n.fetchQueue&&n.fetchQueue[t]&&(n.fetchQueue[t].PromiseStatus,delete n.fetchQueue[t]),n.requested[t]&&"done"!==n.requested[t]&&"failed"!==n.requested[t]&&404!==n.requested[t]){var r="Rdflib: fetcher: Destructive operation on <".concat(n.requested[t],"> file being fetched! ")+t;console.error(r)}else delete n.requested[t],delete n.nonexistent[t]}},{key:"webOperation",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=(0,Rt._)(n);r.method=t,r.body=r.data||r.body,r.force=!0;var o=this;if(r.body&&!r.contentType)throw new Error("Web operation sending data must have a defined contentType.");return r.contentType&&(r.headers=r.headers||{},r.headers["content-type"]=r.contentType),e.setCredentials(i,r),new Promise((function(e,n){o._fetch(i,r).then((function(r){if(r.ok)"PUT"!==t&&"PATCH"!==t&&"POST"!==t&&"DELETE"!==t||o.invalidateCache(i),r.text?r.text().then((function(t){r.responseText=t,e(r)})):e(r);else{var a="Web error: "+r.status;r.statusText&&(a+=" ("+r.statusText+")"),a+=" on "+t+" of <"+i+">",r.responseText&&(a+=": "+r.responseText);var s=new Error(a);s.response=r,n(s)}}),(function(e){n(new Error("Fetch error for "+t+" of <"+i+">:"+e))}))}))}},{key:"lookUpThing",value:function(e,t){var n=this,r=this.store.uris(e);return(r=r.map((function(e){return I.docpart(e)}))).forEach((function(e){n.lookedUp[e]=!0})),this.load(r,{referringTerm:t})}},{key:"getHeader",value:function(e,t){for(var n=this.store,r=e.value,i=n.each(void 0,this.ns.link("requestedURI"),n.rdfFactory.literal(r)),o=0;o<i.length;o++){var a=i[o];if(void 0!==a){var s=n.any(a,this.ns.link("response"));if(void 0!==s&&n.anyValue(s,this.ns.http("status"))&&n.anyValue(s,this.ns.http("status")).startsWith("2")){var c=n.each(s,this.ns.httph(t.toLowerCase()));return c.length?c.map((function(e){return e.value})):[]}}}}},{key:"saveRequestMetadata",value:function(e,t){var n=t.req,r=this.store,i=t.referringTerm;this.addStatus(t.req,"Accept: "+t.headers.accept),(0,g.NX)(i)&&r.add(r.rdfFactory.namedNode(e),this.ns.link("requestedBy"),i,this.appNode),t.original&&t.original.value!==e&&r.add(n,this.ns.link("orginalURI"),r.rdfFactory.literal(t.original.value),this.appNode);var o=new Date,a="["+o.getHours()+":"+o.getMinutes()+":"+o.getSeconds()+"] ";r.add(n,this.ns.rdfs("label"),r.rdfFactory.literal(a+" Request for "+e),this.appNode),r.add(n,this.ns.link("requestedURI"),r.rdfFactory.literal(e),this.appNode),r.add(n,this.ns.link("status"),r.collection(),this.appNode)}},{key:"saveResponseMetadata",value:function(e,t){var n=this,r=this.store,i=r.bnode();return r.add(t.req,this.ns.link("response"),i,i),r.add(i,this.ns.http("status"),r.rdfFactory.literal(e.status),i),r.add(i,this.ns.http("statusText"),r.rdfFactory.literal(e.statusText),i),e.headers.forEach((function(e,o){r.add(i,n.ns.httph(o),n.store.rdfFactory.literal(e),i),"content-type"===o&&r.add(t.resource,n.ns.rdf("type"),r.rdfFactory.namedNode(B.mediaTypeClass(e).value),i)})),i}},{key:"objectRefresh",value:function(e){var t=this.store.uris(e);if(void 0!==t)for(var n=0;n<t.length;n++)this.refresh(this.store.rdfFactory.namedNode(I.docpart(t[n])))}},{key:"refresh",value:function(e,t){this.fireCallbacks("refresh",arguments),this.nowOrWhenFetched(e,{force:!0,clearPreviousData:!0},t)}},{key:"refreshIfExpired",value:function(e,t){var n=this.getHeader(e,"Expires");!n||new Date(n[0]).getTime()<=(new Date).getTime()?this.refresh(e,t):t(!0,"Not expired",{})}},{key:"retract",value:function(e){this.store.removeMany(void 0,void 0,void 0,e),e.value&&delete this.requested[I.docpart(e.value)],this.fireCallbacks("retract",arguments)}},{key:"getState",value:function(e){return void 0===this.requested[e]?"unrequested":!0===this.requested[e]?"requested":"done"===this.requested[e]?"fetched":"redirected"===this.requested[e]?this.getState(this.redirectedTo[e]):"failed"}},{key:"isPending",value:function(e){return!0===this.requested[e]}},{key:"unload",value:function(e){this.store.removeDocument(e),delete this.requested[e.value]}},{key:"addHandler",value:function(e){this.handlers.push(e),e.register(this)}},{key:"retryNoCredentials",value:function(e,t){t.retriedWithNoCredentials=!0,delete this.requested[e],delete this.fetchQueue[e];var n=Object.assign({},t,{credentials:"omit"});return this.addStatus(t.req,"Abort: Will retry with credentials SUPPRESSED to see if that helps"),this.load(e,n)}},{key:"isCrossSite",value:function(e){if("undefined"==typeof document||!document.location)return!1;var t=I.hostpart,n=""+document.location;return(t(n)&&t(e)&&t(n))!==t(e)}},{key:"handleError",value:function(t,n,r){if(this.isCrossSite(n)){if(r.credentials&&"include"===r.credentials&&!r.retriedWithNoCredentials)return this.retryNoCredentials(n,r);var i=e.crossSiteProxy(n);if(i&&!r.proxyUsed)return this.redirectToProxy(i,r)}var o;return t instanceof Error?o="Fetch error: "+t.message:(o=t.statusText,t.responseText&&(o+=" ".concat(t.responseText))),this.failFetch(r,o,t.status||998,t)}},{key:"addType",value:function(e,t,n,r){var i=t;if(r){var o=n.any(i,this.ns.link("requestedURI"));o&&o.value!==r&&n.add(n.rdfFactory.namedNode(r),this.ns.rdf("type"),e,this.appNode)}for(;;){var a=n.any(i,this.ns.link("requestedURI"));if(a&&a.value&&n.add(n.rdfFactory.namedNode(a.value),this.ns.rdf("type"),e,this.appNode),!(i=n.any(void 0,n.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#redirectedRequest"),i)))break;var s=n.any(i,n.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#response"));if(!s)break;var c=n.any(s,n.rdfFactory.namedNode("http://www.w3.org/2007/ont/http#status"));if(!c)break;if("301"!==c&&"302"!==c)break}}},{key:"handleResponse",value:function(e,t,n){var r=this,i=this.store,o=e.headers,a=n.req,s=this.saveResponseMetadata(e,n),c=this.normalizedContentType(n,o)||"",u=o.get("content-location");if(0===e.status)return this.handleError(e,t,n);if(e.status>=400)return 404===e.status&&(this.nonexistent[n.original.value]=!0,this.nonexistent[t]=!0),this.saveErrorResponse(e,s).then((function(){var t=n.resource+" "+e.statusText;return r.failFetch(n,t,e.status,e)}));var l=null,d=null;if(u&&(d=I.join(u,t))!==t&&(l=d),200===e.status){this.addType(this.ns.link("Document"),a,i,t),l&&this.addType(this.ns.link("Document"),a,i,l),n.clearPreviousData&&i.removeDocument(n.resource);var p=c.includes("image/")||c.includes("application/pdf");c&&p&&(this.addType(i.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),a,i,t),l&&this.addType(i.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),a,i,l))}if(u){if(!n.force&&l&&"done"===this.requested[d])return this.doneFetch(n,e);this.requested[d]=!0}this.parseLinkHeader(o.get("link"),n.original,a);var f=this.handlerForContentType(c,e);return f?e.text().then((function(t){return e.responseText=t,f.parse(r,t,n,e)})):(this.addStatus(a,"Fetch over. No data handled."),this.doneFetch(n,e))}},{key:"saveErrorResponse",value:function(e,t){var n=this,r=this.store;return e.text().then((function(e){e.length>10&&r.add(t,n.ns.http("content"),r.rdfFactory.literal(e),t)}))}},{key:"handlerForContentType",value:function(e,t){if(!e)return null;var n=this.handlers.find((function(t){return e.match(t.pattern)}));return n?new n(t):null}},{key:"guessContentType",value:function(e){return Mt[e.split(".").pop()]}},{key:"normalizedContentType",value:function(e,t){if(e.forceContentType)return e.forceContentType;var n=t.get("content-type");if(!n||n.includes("application/octet-stream")){var r=this.guessContentType(e.resource.value);if(r)return r}var i=I.protocol(e.resource.value);return!n&&["file","chrome"].includes(i)?"text/xml":n}},{key:"redirectToProxy",value:function(e,t){var n=this;this.addStatus(t.req,"BLOCKED -> Cross-site Proxy to <"+e+">"),t.proxyUsed=!0;var r=this.store,i=t.req;t.noMeta||(r.add(i,this.ns.link("redirectedTo"),r.rdfFactory.namedNode(e),i),this.addStatus(i,"redirected to new request")),this.requested[t.resource.value]="redirected",this.redirectedTo[t.resource.value]=e;var o=Object.assign({},t);return o.baseURI=t.resource.value,this.fetchUri(e,o).then((function(e){return o.noMeta||r.add(i,n.ns.link("redirectedRequest"),o.req,n.appNode),e}))}},{key:"setRequestTimeout",value:function(e,t){var n=this;return new Promise((function(r){n.timeouts[e]=(n.timeouts[e]||[]).concat(setTimeout((function(){!n.isPending(e)||t.retriedWithNoCredentials||t.proxyUsed||r(n.failFetch(t,"Request to ".concat(e," timed out"),"timeout"))}),n.timeout))}))}},{key:"addFetchCallback",value:function(e,t){this.fetchCallbacks[e]?this.fetchCallbacks[e].push(t):this.fetchCallbacks[e]=[t]}},{key:"acceptString",value:function(){var e="";for(var t in this.mediatypes)for(var n in""!==e&&(e+=", "),e+=t,this.mediatypes[t])e+=";"+n+"="+this.mediatypes[t][n];return e}}],[{key:"crossSiteProxy",value:function(t){return e.crossSiteProxyTemplate?e.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(t)):void 0}},{key:"offlineOverride",value:function(e){var t,n=e;return"undefined"!=typeof window&&window.panes&&(t=window.panes.UI)&&t.preferences&&t.preferences.get("offlineModeUsingLocalhost")&&"http://"===n.slice(0,7)&&"localhost/"!==n.slice(7,17)&&(n="http://localhost/"+n.slice(7),M.Z.warn("Localhost kludge for offline use: actually getting <"+n+">")),n}},{key:"proxyIfNecessary",value:function(t){var n;if("undefined"!=typeof window&&window.panes&&(n=window.panes.UI)&&n.isExtension)return t;if("undefined"!=typeof $SolidTestEnvironment&&$SolidTestEnvironment.localSiteMap){var r=function e(t,n){var r=n[t.shift()];return r?"string"==typeof r?r+t.join("/"):t?e(t,r):null:null}(t.split("/").slice(2),$SolidTestEnvironment.localSiteMap);if(r)return r}return e.crossSiteProxyTemplate&&"undefined"!=typeof document&&document.location&&"https:"===(""+document.location).slice(0,6)&&"http:"===t.slice(0,5)?e.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(t)):t}},{key:"unsupportedProtocol",value:function(e){var t=I.protocol(e);return"tel"===t||"mailto"===t||"urn"===t}},{key:"setCredentials",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};void 0===t.credentials&&(void 0!==t.withCredentials?t.credentials=t.withCredentials?"include":"omit":t.credentials="include")}}]),e}();(0,u.Z)(Xt,"HANDLERS",void 0),(0,u.Z)(Xt,"CONTENT_TYPE_BY_EXT",void 0),(0,u.Z)(Xt,"crossSiteProxyTemplate",void 0),Xt.HANDLERS=$t,Xt.CONTENT_TYPE_BY_EXT=Mt;const Qt={parseJSON:function(e,t,n){var r,i,o,a={},s=n.sym(t);for(var c in e){0===c.indexOf("_:")?a[c]?r=a[c]:(r=n.bnode(c),a[c]=r):r=n.sym(c);var u=e[c];for(var l in u){var d=u[l];for(var p in i=n.sym(l),d){var f=d[p];if("uri"===f.type)o=n.sym(f.value),n.add(r,i,o,s);else if("BlankNode"===f.type)a[f.value]?o=a[f.value]:(o=n.bnode(f.value),a[f.value]=o),n.add(r,i,o,s);else{if("Literal"!==f.type)throw new Error("error: unexpected termtype: "+p.type);o=f.datatype?n.literal(f.value,void 0,n.sym(f.datatype)):f.lang?n.literal(f.value,f.lang):n.literal(f.value),n.add(r,i,o,s)}}}}}};function Yt(e){var t=0;function n(e){var t="",n=e.statements;for(var r in n)M.Z.debug("Found statement: "+n),t+=a()+n[r]+"\n";return t}function r(e){var t="";for(var n in e.constraints){var r=e.constraints[n];t+=a()+"FILTER ( "+r.describe(n)+" ) \n"}return t}function i(e){for(var o="",s=0;s<e.optional.length;s++)M.Z.debug("Found optional query"),o+=a()+"OPTIONAL { \n",t++,o+=n(e.optional[s]),o+=r(e.optional[s]),o+=i(e.optional[s]),t--,o+=a()+"}\n";return o}function o(e){var o=a()+"WHERE \n{ \n";return t++,o+=n(e),o+=r(e),o+=i(e),t--,o+"}"}function a(){for(var e="",n=0;n<t;n++)e+=" ";return e}return function(e){return function(e){for(var t=a()+"SELECT ",n=0;n<e.vars.length;n++)t+=e.vars[n]+" ";return t+"\n"}(e)+o(e.pat)}(e)}function en(e,t,n){var r=[];function i(e){if(r[e])return r[e];var t=n.variable(e);return r[e]=t,t}function o(e){return"string"==typeof e&&e.match(/[^ \n\t]/)}function a(e){return"string"==typeof e&&e.match(/^[\?\$]/)}function s(e){return"string"==typeof e?e.replace(/^&lt;/,"<").replace(/&gt;$/,">"):e}function c(e){return"string"==typeof e&&e.match(/^<[^>]*>$/)}function u(e){return"string"==typeof e&&(e.match(/^_:/)||e.match(/^$/))}function l(e){return"string"==typeof e&&e.match(/:$/)}function d(e){return"string"==typeof e&&e.match(/^:|^[^_][^:]*:/)}function p(e){return e.split(":")[0]}function f(e){return e.split(":")[1]}function h(e){return c(e)?e.slice(1,e.length-1):e}function m(e){var t=-1===e.indexOf("'")?null:e.indexOf("'"),r=-1===e.indexOf('"')?null:e.indexOf('"');if(!t&&!r){var i=new Array(1);return i[0]=e,i}var o,a,s=new Array(2);if(!t||r&&r<t)o='"',a=r;else{if(r&&!(t&&t<r))return M.Z.error("SQARQL QUERY OOPS!"),s;o="'",a=t}s[0]=e.slice(0,a);var c,u=e.slice(a+1).indexOf(o);return-1===u?(M.Z.error("SPARQL parsing error: no matching parentheses in literal "+e),e):(e.slice(u+a+2).match(/^\^\^/)?(c=e.slice(u+a+2).indexOf(" "),s[1]=n.literal(e.slice(a+1,a+1+u),n.sym(h(e.slice(a+4+u,a+2+u+c)))),s=s.concat(m(e.slice(u+a+3+c)))):e.slice(u+a+2).match(/^@/)?(c=e.slice(u+a+2).indexOf(" "),s[1]=n.literal(e.slice(a+1,a+1+u),e.slice(a+3+u,a+2+u+c),null),s=s.concat(m(e.slice(u+a+2+c)))):(s[1]=n.literal(e.slice(a+1,a+1+u)),M.Z.info("Literal found: "+s[1]),s=s.concat(m(e.slice(u+a+2)))),s)}function g(e){e=e.replace(/\(/g," ( ").replace(/\)/g," ) ").replace(/</g," <").replace(/>/g,"> ").replace(/{/g," { ").replace(/}/g," } ").replace(/[\t\n\r]/g," ").replace(/; /g," ; ").replace(/\. /g," . ").replace(/, /g," , "),M.Z.info("New str into spaceDelimit: \n"+e);var t=[],n=e.split(" ");for(var r in n)o(n[r])&&(t=t.concat(n[r]));return t}function v(e,t){for(var n=0;n<t.length;n++)if("string"==typeof t[n]&&t[n].toLowerCase()===e.toLowerCase())return n;return null}function y(e,t){for(var n=[],r=0;r<t.length;r++)"string"==typeof t[r]&&t[r].toLowerCase()===e.toLowerCase()&&n.push(r);return n}function b(e,t,n){M.Z.info("Looking for a close bracket of type "+n+" in "+e);for(var r=0,i=0;i<e.length;i++)if(e[i]===t&&r++,e[i]===n&&r--,r<0)return i;return M.Z.error("Statement had no close parenthesis in SPARQL query"),0}function w(e){return this.describe=function(t){return t+" = "+e.toNT()},this.test=function(t){return e.equals(t)},this}function x(e){this.describe=function(t){return"REGEXP( '"+e+"' , "+t+" )"},this.test=function(t){var n=new RegExp(e);return!!t.value&&n.test(t.value)}}function _(e,t){3!==e.length||"Variable"!==e[0].termType||"NamedNode"!==e[2].termType&&"Literal"!==e[2].termType?6===e.length&&"string"==typeof e[0]&&"regexp"===e[0].toLowerCase()&&"("===e[1]&&")"===e[5]&&","===e[3]&&"Variable"===e[4].termType&&"Literal"===e[2].termType&&(M.Z.debug("Constraint added: "+e),t.constraints[e[4]]=new x(e[2].value)):"="===e[1]||">"===e[1]||"<"===e[1]?(M.Z.debug("Constraint added: "+e),t.constraints[e[0]]=new w(e[2])):M.Z.warn("I don't know how to handle the constraint: "+e)}function E(e,t){M.Z.debug("Optional query: "+e+" not yet implemented.");var r=n.formula();k(e,r),t.optional.push(r)}function k(e,t){var r,o,l=function(e){for(var t=[],r=0;r<e.length;r++)"string"==typeof e[r]?(e[r]=s(e[r]),a(e[r])?t[r]=i(e[r].slice(1)):u(e[r])?(M.Z.info(e[r]+" was identified as a bnode."),t[r]=n.bnode()):c(e[r])?(M.Z.info(e[r]+" was identified as a symbol."),t[r]=n.sym(h(e[r]))):d(e[r])?(M.Z.info(e[r]+" was identified as a prefixed symbol"),A[p(e[r])]?t[r]=n.sym(e[r]=A[p(e[r])]+f(e[r])):(M.Z.error("SPARQL error: "+e[r]+" with prefix "+p(e[r])+" does not have a correct prefix entry."),t[r]=e[r])):t[r]=e[r]):t[r]=e[r];return t}(e);for(M.Z.debug("WHERE: "+l);v("OPTIONAL",l);)o=v("OPTIONAL",l),M.Z.debug("OPT: "+o+" "+l[o]+" in "+l),"{"!==l[o+1]&&M.Z.warn("Bad optional opening bracket in word "+o),-1===(r=b(l.slice(o+2),"{","}"))?M.Z.error("No matching bracket in word "+o):(E(l.slice(o+2,o+2+r),t),o=v("OPTIONAL",l),r=b(l.slice(o+2),"{","}"),l.splice(o,r+3));for(M.Z.debug("WHERE after optionals: "+l);v("FILTER",l);){var m=v("FILTER",l);"("!==l[m+1]&&M.Z.warn("Bad filter opening bracket in word "+m),-1===(r=b(l.slice(m+2),"(",")"))?M.Z.error("No matching bracket in word "+m):(_(l.slice(m+2,m+2+r),t),m=v("FILTER",l),r=b(l.slice(m+2),"(",")"),l.splice(m,r+3))}M.Z.debug("WHERE after filters and optionals: "+l),function(e,t){var n=new Array(1);n[0]=-1;for(var r=n.concat(y(".",e)),i=[],o=0;o<r.length-1;o++)i[o]=e.slice(r[o]+1,r[o+1]);for(o in i){M.Z.info("s+p+o "+o+" = "+i[o]);var a=i[o][0];i[o].splice(0,1);var s=n.concat(y(";",i[o]));s.push(i[o].length);for(var c=[],u=0;u<s.length-1;u++)c[u]=i[o].slice(s[u]+1,s[u+1]);for(o in c){M.Z.info("p+o "+o+" = "+i[o]);var l=c[o][0];c[o].splice(0,1);var d=n.concat(y(",",c[o]));d.push(c[o].length);var p=[];for(u=0;u<d.length-1;u++)p[u]=c[o].slice(d[u]+1,d[u+1]);for(o in p){var f=p[o][0];M.Z.info("Subj="+a+" Pred="+l+" Obj="+f),t.add(a,l,f)}}}}(l,t)}M.Z.info("SPARQL input: \n"+e);var S=new re,C=function(e){var t=m(e),n=[];for(var r in t)n="string"==typeof t[r]?n.concat(g(t[r])):n.concat(t[r]);return n=function(e){for(var t=e,n=0;n<t.length;n++)if("a"===t[n]&&(t[n]="<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>"),"is"===t[n]&&"of"===t[n+2]){t.splice(n,1),t.splice(n+1,1);var r=t[n-1];t[n-1]=t[n+1],t[n+1]=r}return t}(n),M.Z.info("SPARQL Tokens: "+n),n}(e),A=function(e){var t=y("PREFIX",e),n=[];for(var r in t){var i=e[t[r]+1],o=e[t[r]+2];if(l(i))if(c(o)){M.Z.info("Prefix found: "+i+" -> "+o);var a=p(i),s=h(o);n[a]=s}else M.Z.error("Invalid SPARQL symbol: "+o);else M.Z.error("Invalid SPARQL prefix: "+i)}return n}(C);A.rdf||(A.rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"),A.rdfs||(A.rdfs="http://www.w3.org/2000/01/rdf-schema#");var T=v("SELECT",C),O=v("WHERE",C);if(T<0||O<0||T>O)return M.Z.error("Invalid or nonexistent SELECT and WHERE tags in SPARQL query"),!1;if(function(e,t){for(var n in M.Z.info("SPARQL vars: "+e),e)if(a(e[n])){M.Z.info("Added "+e[n]+" to query variables from SPARQL");var r=i(e[n].slice(1));t.vars.push(r),r.label=e[n].slice(1)}else M.Z.warn("Incorrect SPARQL variable in SELECT: "+e[n])}(C.slice(T+1,O),S),k(C.slice(O+2,C.length-1),S.pat),t)return S;for(var P in S.pat.statements){var I=S.pat.statements[P];"NamedNode"===I.subject.termType&&n.fetcher&&n.fetcher.lookUpThing(I.subject,"sparql:"+I.subject),"NamedNode"===I.object.termType&&n.fetcher&&n.fetcher.lookUpThing(I.object,"sparql:"+I.object)}return S}function tn(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return nn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?nn(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function nn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var rn=function(){function e(t){if((0,i.Z)(this,e),(0,u.Z)(this,"store",void 0),(0,u.Z)(this,"ifps",void 0),(0,u.Z)(this,"fps",void 0),(0,u.Z)(this,"patchControl",void 0),(0,u.Z)(this,"ns",void 0),(t=t||new fe).updater)throw new Error("You can't have two UpdateManagers for the same store");t.fetcher||(t.fetcher=new Xt(t)),this.store=t,t.updater=this,this.ifps={},this.fps={},this.ns={},this.ns.link=U("http://www.w3.org/2007/ont/link#"),this.ns.http=U("http://www.w3.org/2007/ont/http#"),this.ns.httph=U("http://www.w3.org/2007/ont/httph#"),this.ns.ldp=U("http://www.w3.org/ns/ldp#"),this.ns.rdf=U("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.ns.rdfs=U("http://www.w3.org/2000/01/rdf-schema#"),this.ns.rdf=U("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.ns.owl=U("http://www.w3.org/2002/07/owl#"),this.patchControl=[]}return(0,r.Z)(e,[{key:"patchControlFor",value:function(e){return this.patchControl[e.value]||(this.patchControl[e.value]=[]),this.patchControl[e.value]}},{key:"isHttpUri",value:function(e){return"http"===e.slice(0,4)}},{key:"editable",value:function(e,t){if(!e)return!1;if(t||(t=this.store),e=(0,Rt._)(e),!this.isHttpUri(e)&&t.holds(this.store.rdfFactory.namedNode(e),this.store.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),this.store.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#MachineEditableDocument")))return"LOCALFILE";for(var n,r,i=!1,o=t.each(void 0,this.ns.link("requestedURI"),(0,I.docpart)(e)),a=0;a<o.length;a++)if(void 0!==(n=o[a])){var s=t.any(n,this.ns.link("response"));if(void 0!==n){var c=t.anyValue(s,this.ns.httph("wac-allow"));if(c){var u,l=tn(c.split(","));try{for(l.s();!(u=l.n()).done;){var d=u.value.split("=");if(d[0].includes("user")&&!d[1].includes("write")&&!d[1].includes("append"))return!1}}catch(e){l.e(e)}finally{l.f()}}var p=t.each(s,this.ns.httph("accept-patch"));if(p.length)for(var f=0;f<p.length;f++){if((r=p[f].value.trim()).indexOf("application/sparql-update")>=0)return"SPARQL";if(r.indexOf("application/sparql-update-single-match")>=0)return"SPARQL"}var h=t.each(s,this.ns.httph("ms-author-via"));if(h.length)for(var m=0;m<h.length;m++){if((r=h[m].value.trim()).indexOf("SPARQL")>=0)return"SPARQL";if(r.indexOf("DAV")>=0)return"DAV"}if(!this.isHttpUri(e))return!!c&&"LOCALFILE";var g=t.each(s,this.ns.http("status"));if(g.length)for(var v=0;v<g.length;v++)200!==g[v]&&404!==g[v]||(i=!0)}}if(0===o.length);else if(i)return!1}},{key:"anonymize",value:function(e){return"_:"===e.toNT().substr(0,2)&&this.mentioned(e)?"?"+e.toNT().substr(2):e.toNT()}},{key:"anonymizeNT",value:function(e){return this.anonymize(e.subject)+" "+this.anonymize(e.predicate)+" "+this.anonymize(e.object)+" ."}},{key:"nTriples",value:function(e){return"".concat(e.subject.toNT()," ").concat(e.predicate.toNT()," ").concat(e.object.toNT()," .")}},{key:"statementBnodes",value:function(e){return[e.subject,e.predicate,e.object].filter((function(e){return(0,g.B2)(e)}))}},{key:"statementArrayBnodes",value:function(e){for(var t=[],n=0;n<e.length;n++)t=t.concat(this.statementBnodes(e[n]));t.sort();for(var r=[],i=0;i<t.length;i++)0!==i&&t[i].equals(t[i-1])||r.push(t[i]);return r}},{key:"cacheIfps",value:function(){this.ifps={};for(var e=this.store.each(void 0,this.ns.rdf("type"),this.ns.owl("InverseFunctionalProperty")),t=0;t<e.length;t++)this.ifps[e[t].value]=!0;this.fps={},e=this.store.each(void 0,this.ns.rdf("type"),this.ns.owl("FunctionalProperty"));for(var n=0;n<e.length;n++)this.fps[e[n].value]=!0}},{key:"bnodeContext2",value:function(e,t,n){for(var r,i,o=this.store.statementsMatching(void 0,void 0,e,t),a=0;a<o.length;a++)if(this.fps[o[a].predicate.value]){if(!(r=o[a].subject).isBlank)return[o[a]];if(n&&(i=this.bnodeContext2(r,t,n-1)))return i.concat([o[a]])}o=this.store.statementsMatching(e,void 0,void 0,t);for(var s=0;s<o.length;s++)if(this.ifps[o[s].predicate.value]){if(!(r=o[s].object).isBlank)return[o[s]];if(n&&(i=this.bnodeContext2(r,t,n-1)))return i.concat([o[s]])}return null}},{key:"bnodeContext1",value:function(e,t){for(var n=0;n<3;n++){var r=this.bnodeContext2(e,t,n);if(null!==r)return r}return this.store.connectedStatements(e,t)}},{key:"mentioned",value:function(e){return 0!==this.store.statementsMatching(e,null,null,null).length||0!==this.store.statementsMatching(null,e).length||0!==this.store.statementsMatching(null,null,e).length}},{key:"bnodeContext",value:function(e,t){var n=[];if(e.length){this.cacheIfps();for(var r=0;r<e.length;r++){var i=e[r];this.mentioned(i)&&(n=n.concat(this.bnodeContext1(i,t)))}}return n}},{key:"statementContext",value:function(e){var t=this.statementBnodes(e);return this.bnodeContext(t,e.graph)}},{key:"contextWhere",value:function(e){var t=this;return e&&0!==e.length?"WHERE { "+e.map((function(e){return t.anonymizeNT(e)})).join("\n")+" }\n":""}},{key:"fire",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Promise.resolve().then((function(){if(!e)throw new Error("No URI given for remote editing operation: "+t);return i.noMeta=!0,i.contentType="application/sparql-update",i.body=t,r.store.fetcher.webOperation("PATCH",e,i)})).then((function(r){if(!r.ok){var i="UpdateManager: update failed for <"+e+"> status="+r.status+", "+r.statusText+"\n for query: "+t;throw new Error(i)}n(e,r.ok,r.responseText,r)})).catch((function(t){n(e,!1,t.message,t)}))}},{key:"update_statement",value:function(e){if(!e||e.graph){var t=this,n=this.statementContext(e);return{statement:e?[e.subject,e.predicate,e.object,e.graph]:void 0,statementNT:e?this.anonymizeNT(e):void 0,where:t.contextWhere(n),set_object:function(e,n){var r=this.where;r+="DELETE DATA { "+this.statementNT+" } ;\n",r+="INSERT DATA { "+this.anonymize(this.statement[0])+" "+this.anonymize(this.statement[1])+" "+this.anonymize(e)+" . }\n",t.fire(this.statement[3].value,r,n)}}}}},{key:"insert_statement",value:function(e,t){var n=e instanceof Array?e[0]:e,r=this.contextWhere(this.statementContext(n));if(e instanceof Array){for(var i="",o=0;o<e.length;o++)i+=e[o]+"\n";r+="INSERT DATA { "+i+" }\n"}else r+="INSERT DATA { "+this.anonymize(e.subject)+" "+this.anonymize(e.predicate)+" "+this.anonymize(e.object)+" . }\n";this.fire(n.graph.value,r,t)}},{key:"delete_statement",value:function(e,t){var n=e instanceof Array?e[0]:e,r=this.contextWhere(this.statementContext(n));if(e instanceof Array){for(var i="",o=0;o<e.length;o++)i+=e[o]+"\n";r+="DELETE DATA { "+i+" }\n"}else r+="DELETE DATA { "+this.anonymize(e.subject)+" "+this.anonymize(e.predicate)+" "+this.anonymize(e.object)+" . }\n";this.fire(n.graph.value,r,t)}},{key:"requestDownstreamAction",value:function(e,t){var n=this.patchControlFor(e);if(n.pendingUpstream)if(n.downstreamAction){if(""+n.downstreamAction!=""+t)throw new Error("Can't wait for > 1 different downstream actions")}else n.downstreamAction=t;else t(e)}},{key:"clearUpstreamCount",value:function(e){this.patchControlFor(e).upstreamCount=0}},{key:"getUpdatesVia",value:function(e){var t=this.store.fetcher.getHeader(e,"updates-via");return t&&t.length?t[0].trim():null}},{key:"addDownstreamChangeListener",value:function(e,t){var n=this,r=this.patchControlFor(e);r.downstreamChangeListeners||(r.downstreamChangeListeners=[]),r.downstreamChangeListeners.push(t),this.setRefreshHandler(e,(function(e){n.reloadAndSync(e)}))}},{key:"reloadAndSync",value:function(e){var t=this.patchControlFor(e),n=this;if(t.reloading)t.outOfDate=!0;else{t.reloading=!0;var r=1e3;!function i(){n.reload(n.store,e,(function(e,n,o){if(e){if(t.downstreamChangeListeners)for(var a=0;a<t.downstreamChangeListeners.length;a++)t.downstreamChangeListeners[a]();t.reloading=!1,t.outOfDate&&(t.outOfDate=!1,i())}else t.reloading=!1,0===o.status&&(t.reloading=!0,setTimeout(i,r*=2))}))}()}}},{key:"setRefreshHandler",value:function(e,t){var n=this.getUpdatesVia(e),r=t,i=this,o=this,a=1500,s=0;if(!n)return!1;var c=(n=(0,I.join)(n,e.value)).replace(/^http:/,"ws:").replace(/^https:/,"wss:");return function t(){var n;if("undefined"!=typeof WebSocket)n=new WebSocket(c);else{if("undefined"==typeof window||!window.WebSocket)return;n=window.WebSocket(c)}n.onopen=function(){a=1500,this.send("sub "+e.value),s&&o.requestDownstreamAction(e,r)};var u=i.patchControlFor(e);u.upstreamCount=0,n.onerror=function(e){},n.onclose=function(e){a*=2,s+=1,setTimeout((function(){t()}),a)},n.onmessage=function(t){if(t.data&&"pub"===t.data.slice(0,3)){if("upstreamCount"in u&&(u.upstreamCount-=1,u.upstreamCount>=0))return;u.upstreamCount=0,i.requestDownstreamAction(e,r)}}}(),!0}},{key:"updateMany",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=e.concat(t).map((function(e){return e.why})),r=this,i=[];n.forEach((function(e){i.find((function(t){return t.equals(e)}))||i.push(e)}));var o=i.map((function(n){return r.update(e.filter((function(e){return e.why.equals(n)})),t.filter((function(e){return e.why.equals(n)})))}));return o.length,Promise.all(o)}},{key:"update",value:function(e,t,n,r){var i=this,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(!n){var a=this;return new Promise((function(n,i){a.update(e,t,(function(e,t,r){t?n():i(new Error(r))}),r,o)}))}try{var s=this.store,c=e?(0,g.Pv)(e)?e.statements:e instanceof Array?e:[e]:[],u=t?(0,g.Pv)(t)?t.statements:t instanceof Array?t:[t]:[];if(!(c instanceof Array))throw new Error("Type Error "+(0,h.Z)(c)+": "+c);if(!(u instanceof Array))throw new Error("Type Error "+(0,h.Z)(u)+": "+u);if(0===c.length&&0===u.length)return n(null,!0);var l=c.length?c[0].graph:u[0].graph;if(!l){var d="Error patching: statement does not specify which document to patch:"+c[0]+", "+u[0];throw new Error(d)}if("NamedNode"!==l.termType){var p="Error patching: document not a NamedNode:"+c[0]+", "+u[0];throw new Error(p)}var f=this.patchControlFor(l),m=Date.now(),v=["subject","predicate","object","why"],y=["insert","delete"],b={delete:c,insert:u};y.map((function(e){b[e].map((function(e){if(!l.equals(e.graph))throw new Error("update: destination "+l+" inconsistent with delete quad "+e.graph);v.map((function(t){if(void 0===e[t])throw new Error("update: undefined "+t+" of statement.")}))}))}));var w=this.editable(l.value,s);if(!1===w)throw new Error("Update: Can't make changes in uneditable "+l);if(void 0===w){if(r)throw new Error("Update: Loaded "+l+"but stil can't figure out what editing protcol it supports.");return void this.store.fetcher.load(l).then((function(r){i.update(e,t,n,!0,o)}),(function(r){if(404!==r.response.status)throw new Error("Update: Can't get updatability status ".concat(l," before patching: ").concat(r));i.update(e,t,n,!0,o)}))}if(w.indexOf("SPARQL")>=0){var x=[];c.length&&(x=this.statementArrayBnodes(c)),u.length&&(x=x.concat(this.statementArrayBnodes(u)));var _=this.bnodeContext(x,l),E=this.contextWhere(_),k="";if(E.length){if(c.length){k+="DELETE { ";for(var S=0;S<c.length;S++)k+=this.anonymizeNT(c[S])+"\n";k+=" }\n"}if(u.length){k+="INSERT { ";for(var C=0;C<u.length;C++)k+=this.anonymizeNT(u[C])+"\n";k+=" }\n"}k+=E}else{if(c.length){k+="DELETE DATA { ";for(var A=0;A<c.length;A++)k+=this.anonymizeNT(c[A])+"\n";k+=" } \n"}if(u.length){c.length&&(k+=" ; "),k+="INSERT DATA { ";for(var T=0;T<u.length;T++)k+=this.nTriples(u[T])+"\n";k+=" }\n"}}f.pendingUpstream=f.pendingUpstream?f.pendingUpstream+1:1,"upstreamCount"in f&&(f.upstreamCount+=1),this.fire(l.value,k,(function(e,t,r,i){if(i.elapsedTimeMs=Date.now()-m,t){try{s.remove(c)}catch(e){t=!1,r="Remote Ok BUT error deleting "+c.length+" from store!!! "+e}for(var o=0;o<u.length;o++)s.add(u[o].subject,u[o].predicate,u[o].object,l)}if(n(e,t,r,i),f.pendingUpstream-=1,0===f.pendingUpstream&&f.downstreamAction){var a=f.downstreamAction;delete f.downstreamAction,a(l)}}),o)}else if(w.indexOf("DAV")>=0)this.updateDav(l,c,u,n,o);else{if(!(w.indexOf("LOCALFILE")>=0))throw new Error("Unhandled edit method: '"+w+"' for "+l);try{this.updateLocalFile(l,c,u,n,o)}catch(e){n(l.value,!1,"Exception trying to write back file <"+l.value+">\n")}}}catch(e){n(void 0,!1,"Exception in update: "+e+"\n"+B.stackString(e))}}},{key:"updateDav",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=this.store,a=o.any(e,this.ns.link("request"));if(!a)throw new Error("No record of our HTTP GET request for document: "+e);var s=o.any(a,this.ns.link("response"));if(!s)return null;for(var c=o.the(s,this.ns.httph("content-type")).value,u=o.statementsMatching(void 0,void 0,void 0,e).slice(),l=0;l<t.length;l++)B.RDFArrayRemove(u,t[l]);for(var d=0;d<n.length;d++)u.push(n[d]);var p,f=this.serialize(e.value,u,c),h=o.the(s,this.ns.httph("content-location"));return h&&(p=(0,I.join)(h.value,p)),i.contentType=c,i.noMeta=!0,i.body=f,o.fetcher.webOperation("PUT",p,i).then((function(i){if(!i.ok)throw new Error(i.error);for(var a=0;a<t.length;a++)o.remove(t[a]);for(var s=0;s<n.length;s++)o.add(n[s].subject,n[s].predicate,n[s].object,e);r(e.value,i.ok,i.responseText,i)})).catch((function(t){r(e.value,!1,t.message,t)}))}},{key:"updateLocalFile",value:function(e,t,n,r){for(var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=this.store,a=o.statementsMatching(void 0,void 0,void 0,e).slice(),s=0;s<t.length;s++)B.RDFArrayRemove(a,t[s]);for(var c=0;c<n.length;c++)a.push(n[c]);var u=e.value.lastIndexOf(".");if(u<1)throw new Error("Rewriting file: No filename extension: "+e.value);var l=e.value.slice(u+1),d=Xt.CONTENT_TYPE_BY_EXT[l];if(!d)throw new Error("File extension ."+l+" not supported for data write");i.body=this.serialize(e.value,a,d),i.contentType=d,o.fetcher.webOperation("PUT",e.value,i).then((function(i){if(!i.ok)return r(e.value,!1,i.error);for(var a=0;a<t.length;a++)o.remove(t[a]);for(var s=0;s<n.length;s++)o.add(n[s].subject,n[s].predicate,n[s].object,e);r(e.value,!0,"")}))}},{key:"serialize",value:function(e,t,n){var r,i=this.store;if("string"==typeof t)return t;var o=V(i);switch(o.suggestNamespaces(i.namespaces),o.setBase(e),n){case"text/xml":case"application/rdf+xml":r=o.statementsToXML(t);break;case"text/n3":case"text/turtle":case"application/x-turtle":case"application/n3":r=o.statementsToN3(t);break;default:throw new Error("Content-type "+n+" not supported for data serialization")}return r}},{key:"put",value:function(e,t,n,r){var i,o=this,a=this.store;return Promise.resolve().then((function(){return i=o.serialize(e.value,t,n),a.fetcher.webOperation("PUT",e.value,{contentType:n,body:i})})).then((function(n){if(!n.ok)return r(e.value,n.ok,n.error,n);delete a.fetcher.nonexistent[e.value],delete a.fetcher.requested[e.value],"string"!=typeof t&&t.map((function(e){a.addStatement(e)})),r(e.value,n.ok,"",n)})).catch((function(t){r(e.value,!1,t.message)}))}},{key:"reload",value:function(e,t,n){var r=Date.now();e.fetcher.nowOrWhenFetched(t.value,{force:!0,noMeta:!0,clearPreviousData:!0},(function(e,i,o){if(e)if(o.onErrorWasCalled||200!==o.status)n(!1,"Non-HTTP error reloading data: "+i,o);else{var a=Date.now()-r;t.reloadTimeTotal||(t.reloadTimeTotal=0),t.reloadTimeCount||(t.reloadTimeCount=0),t.reloadTimeTotal+=a,t.reloadTimeCount+=1,n(!0)}else n(!1,"Error reloading data: "+i,o)}))}}]),e}();function on(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function an(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?on(Object(n),!0).forEach((function(t){(0,u.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):on(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var sn=an(an({},Ke),{},{fetcher:function(e,t){return new Xt(e,t)},graph:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return new fe(e,t||{rdfFactory:Ke})},lit:function(e,t,n){return this.literal(""+e,t||n)},st:function(e,t,n,r){return this.quad(e,t,n,r)}});const cn=sn;var un=function(){function e(t,n){(0,i.Z)(this,e),this.parent=t,this.via=n,this.connected=!1,this.pending={},this.subscribed={},this.socket={};try{this.socket=new WebSocket(n),this.socket.onopen=this.onOpen,this.socket.onclose=this.onClose,this.socket.onmessage=this.onMessage,this.socket.onerror=this.onError}catch(e){this.onError(e)}}return(0,r.Z)(e,[{key:"_decode",value:function(e){var t,n,r,i,o,a,s;for(n in i={},o=function(){var n,r,i,o;for(o=[],n=0,r=(i=e.split("&")).length;n<r;n++)t=i[n],o.push(t.split("="));return o}())t=o[n],s=(a=[decodeURIComponent(t[0]),decodeURIComponent(t[1])])[1],null==i[r=a[0]]&&(i[r]=[]),i[r].push(s);return i}},{key:"_send",value:function(e,t,n){var r,i;return i=[e,t,n].join(" "),"function"==typeof(r=this.socket).send?r.send(i):void 0}},{key:"_subscribe",value:function(e){return this._send("sub",e,""),this.subscribed[e]=!0,this.subscribed[e]}},{key:"onClose",value:function(e){var t;for(t in this.connected=!1,this.subscribed)this.pending[t]=!0;return this.subscribed={},this.subscribed}},{key:"onError",value:function(e){throw new Error("onError"+e)}},{key:"onMessage",value:function(e){var t,n;return"ping"===(n=e.data.split(" "))[0]?"function"==typeof(t=this.socket).send?t.send("pong "+n.slice(1).join(" ")):void 0:"pub"===n[0]?this.parent.onUpdate(n[1],this._decode(n[2])):void 0}},{key:"onOpen",value:function(e){var t,n;for(n in this.connected=!0,t=[],this.pending)delete this.pending[n],t.push(this._subscribe(n));return t}},{key:"subscribe",value:function(e){return this.connected?this._subscribe(e):(this.pending[e]=!0,this.pending[e])}}]),e}(),ln=function(){function e(t){(0,i.Z)(this,e),this.fetcher=t,this.graph={},this.via={},this.fetcher.addCallback("headers",this.onHeaders)}return(0,r.Z)(e,[{key:"onHeaders",value:function(e){var t,n,r;return null==e.headers||"undefined"==typeof WebSocket||null===WebSocket||(t=e.headers.etag,r=e.headers["updates-via"],n=e.uri,t&&r&&(this.graph[n]={etag:t,via:r},this.register(r,n))),!0}},{key:"onUpdate",value:function(e,t){return this.fetcher.refresh(cn.namedNode(e))}},{key:"register",value:function(e,t){return null==this.via[e]&&(this.via[e]=new un(this,e)),this.via[e].subscribe(t)}}]),e}();function dn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,c.Z)(e);if(t){var i=(0,c.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}var pn={};for(var fn in cn)"function"==typeof cn[fn]&&(pn[fn]=cn[fn].bind(cn));var hn=pn.fetcher,mn=pn.graph,gn=pn.lit,vn=pn.st,yn=pn.namedNode,bn=pn.variable,wn=pn.blankNode,xn=pn.defaultGraph,_n=pn.literal,En=pn.quad,kn=pn.triple,Sn=new ee,Cn=function(e){return Sn.fromNT(e)},An=te.fromValue,Tn=f.nextId,On=function(e){(0,a.Z)(n,e);var t=dn(n);function n(e){var r;return(0,i.Z)(this,n),r=t.call(this,e),(0,u.Z)((0,o.Z)(r),"fetcher",void 0),r.fetcher=new Xt((0,o.Z)(r),{}),r}return(0,r.Z)(n)}(fe),Pn=function(e){(0,a.Z)(n,e);var t=dn(n);function n(e){var r;return(0,i.Z)(this,n),r=t.call(this,e),(0,u.Z)((0,o.Z)(r),"updater",void 0),r.updater=new rn((0,o.Z)(r)),r}return(0,r.Z)(n)}(On)},1369:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={debug:function(e){},warn:function(e){},info:function(e){},error:function(e){},success:function(e){},msg:function(e){}}},8967:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var r=n(5671),i=n(3144),o=n(7326),a=n(136),s=n(2963),c=n(1120),u=n(4942),l=n(1897),d=n(566),p=n(8946),f=n(8918),h=n(6680);var m=function(e){(0,a.Z)(m,e);var t,n,d=(t=m,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return(0,s.Z)(this,e)});function m(e){var t;if((0,r.Z)(this,m),t=d.call(this,(0,f._)(e)),(0,u.Z)((0,o.Z)(t),"termType",p.XM),(0,u.Z)((0,o.Z)(t),"classOrder",l.Z.NamedNode),!t.value)throw new Error("Missing IRI for NamedNode");if(!t.value.includes(":"))throw new Error('NamedNode IRI "'+e+'" must be absolute.');if(t.value.includes(" "))throw new Error('Error: NamedNode IRI "'+e+'" must not contain unencoded spaces.');return t}return(0,i.Z)(m,[{key:"dir",value:function(){var e=this.value.split("#")[0],t=e.slice(0,-1).lastIndexOf("/"),n=e.indexOf("//");return n>=0&&t<n+2||t<0?null:new m(e.slice(0,t+1))}},{key:"site",value:function(){var e=this.value.split("#")[0],t=e.indexOf("//");if(t<0)throw new Error("This URI does not have a web site part (origin)");var n=e.indexOf("/",t+2);return new m(n<0?e.slice(0)+"/":e.slice(0,n+1))}},{key:"doc",value:function(){return this.value.indexOf("#")<0?this:new m(this.value.split("#")[0])}},{key:"toString",value:function(){return"<"+this.value+">"}},{key:"id",value:function(){return this.value.split("#")[1]}},{key:"uri",get:function(){return this.value},set:function(e){this.value=e}}],[{key:"fromValue",value:function(e){return null==e||(0,h.jt)(e)?e:new m(e)}}]),m}(d.Z)},566:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(5671),i=n(3144),o=n(4942),a=function(){function e(t){(0,r.Z)(this,e),(0,o.Z)(this,"termType",void 0),(0,o.Z)(this,"classOrder",void 0),(0,o.Z)(this,"value",void 0),this.value=t}return(0,i.Z)(e,[{key:"substitute",value:function(e){return this}},{key:"compareTerm",value:function(e){return this.classOrder<e.classOrder?-1:this.classOrder>e.classOrder?1:this.value<e.value?-1:this.value>e.value?1:0}},{key:"equals",value:function(e){return!!e&&this.termType===e.termType&&this.value===e.value}},{key:"hashString",value:function(){return this.toCanonical()}},{key:"sameTerm",value:function(e){return this.equals(e)}},{key:"toCanonical",value:function(){return this.toNT()}},{key:"toNT",value:function(){return this.toString()}},{key:"toNQ",value:function(){return this.toNT()}},{key:"toString",value:function(){throw new Error("Node.toString() is abstract - see the subclasses instead")}}]),e}();(0,o.Z)(a,"fromValue",void 0),(0,o.Z)(a,"toJS",void 0)},8946:(e,t,n)=>{"use strict";n.d(t,{D7:()=>E,Eo:()=>_,Is:()=>y,NK:()=>s,UH:()=>a,V1:()=>i,XM:()=>r,_A:()=>l,aV:()=>v,b4:()=>g,fb:()=>c,lL:()=>m,ls:()=>u,oW:()=>b,qS:()=>f,sZ:()=>h,ui:()=>p,us:()=>d,xH:()=>o,xm:()=>w,z8:()=>x});var r="NamedNode",i="BlankNode",o="Literal",a="Variable",s="DefaultGraph",c="Collection",u="Empty",l="Graph",d="text/html",p="application/ld+json",f="text/n3",h="application/n3",m="application/nquads",g="application/n-quads",v="application/n-triples",y="application/rdf+xml",b="application/sparql-update",w="application/sparql-update-single-match",x="text/turtle",_="application/x-turtle",E="application/xhtml+xml"},1609:(e,t,n)=>{"use strict";n.r(t),n.d(t,{docpart:()=>o,document:()=>a,hostpart:()=>s,join:()=>c,protocol:()=>u,refTo:()=>l});var r=n(8967),i=i||console.log;function o(e){var t;return(t=e.indexOf("#"))<0?e:e.slice(0,t)}function a(e){return new r.Z(o(e))}function s(e){var t=/[^\/]*\/\/([^\/]*)\//.exec(e);return t?t[1]:""}function c(e,t){var n,r,o,a,s,c=t.indexOf("#");if(c>0&&(t=t.slice(0,c)),0===e.length)return t;if(0===e.indexOf("#"))return t+e;if(e.indexOf(":")>=0)return e;if(n=t.indexOf(":"),0===t.length)return e;if(n<0)return i("Invalid base: "+t+" in join with given: "+e),e;if(r=t.slice(0,+n+1||9e9),0===e.indexOf("//"))return r+e;if(t.indexOf("//",n)===n+1){if((o=t.indexOf("/",n+3))<0)return t.length-n-3>0?t+"/"+e:r+e}else if((o=t.indexOf("/",n+1))<0)return t.length-n-1>0?t+"/"+e:r+e;if(0===e.indexOf("/"))return t.slice(0,o)+e;if((a=(s=t.slice(o)).lastIndexOf("/"))<0)return r+e;for(a>=0&&a<s.length-1&&(s=s.slice(0,+a+1||9e9)),s+=e;s.match(/[^\/]*\/\.\.\//);)s=s.replace(/[^\/]*\/\.\.\//,"");return s=(s=s.replace(/\.\//g,"")).replace(/\/\.$/,"/"),t.slice(0,o)+s}function u(e){var t=e.indexOf(":");return t<0?null:e.slice(0,t)}function l(e,t){var n,r,i,o,a,s,c,u,l,d,p,f,h=new RegExp("^[-_a-zA-Z0-9.]+:(//[^/]*)?/[^/]*$");if(!e)return t;if(e===t)return"";for(n=c=0,o=t.length;c<o&&t[n]===e[n];n=++c);if(e.slice(0,n).match(h)&&((r=t.indexOf("//"))<0&&(r=-2),i=t.indexOf("/",r+2),"/"!==t[i+1]&&"/"!==e[i+1]&&t.slice(0,i)===e.slice(0,i)))return t.slice(i);if("#"===t[n]&&e.length===n)return t.slice(n);for(;n>0&&"/"!==t[n-1];)n--;if(n<3)return t;if(e.indexOf("//",n-2)>0||t.indexOf("//",n-2)>0)return t;if(e.indexOf(":",n)>0)return t;for(s=0,u=0,a=(d=e.slice(n)).length;u<a;u++)"/"===d[u]&&s++;if(0===s&&n<t.length&&"#"===t[n])return"./"+t.slice(n);if(0===s&&n===t.length)return"./";if(f="",s>0)for(l=1,p=s;p>=1?l<=p:l>=p;p>=1?++l:--l)f+="../";return f+t.slice(n)}},1048:(e,t,n)=>{"use strict";n.r(t),n.d(t,{DOMParserFactory:()=>d,RDFArrayRemove:()=>b,callbackify:()=>l,domToString:()=>p,dtstamp:()=>h,dumpNode:()=>f,heavyCompare:()=>m,heavyCompareSPO:()=>g,linkRelationProperty:()=>u,log:()=>r.Z,mediaTypeClass:()=>c,output:()=>v,parseXML:()=>y,stackString:()=>x,string:()=>s,string_startswith:()=>w,uri:()=>i});var r=n(1369),i=n(1609),o=n(8967),a=n(3969);e=n.hmd(e);var s={template:function(e,t){for(var n=e.split("%s"),r="",i=0;i<t.length;i++)t[i]+="",r+=n[i]+t[i];return r+n.slice(t.length).join()}};function c(e){return e=e.split(";")[0].trim(),new o.Z("http://www.w3.org/ns/iana/media-types/"+e+"#Resource")}function u(e){return new o.Z("http://www.w3.org/ns/iana/link-relations/relation#"+e.trim())}function l(e,t){e.callbacks={};for(var n=t.length-1;n>=0;n--)e.callbacks[t[n]]=[];e.addHook=function(t){e.callbacks[t]||(e.callbacks[t]=[])},e.addCallback=function(t,n){e.callbacks[t].push(n)},e.removeCallback=function(t,n){for(var r=0;r<e.callbacks[t].length;r++)if(e.callbacks[t][r].name===n)return e.callbacks[t].splice(r,1),!0;return!1},e.insertCallback=function(t,n){e.callbacks[t].unshift(n)},e.fireCallbacks=function(t,n){var r,i,o=[],a=[],s=e.callbacks[t].length;for(r=s-1;r>=0;r--)(i=e.callbacks[t][r])&&i.apply(e,n)&&o.push(i);for(r=o.length-1;r>=0;r--)a.push(o[r]);for(r=s;r<e.callbacks[t].length;r++)a.push(e.callbacks[t][r]);e.callbacks[t]=a}}function d(){return window.DOMParser?new a.DOMParser:!!window.ActiveXObject&&new ActiveXObject("Microsoft.XMLDOM")}function p(e,t){var n=[];(t=t||{})&&t.selfClosing&&t.selfClosing.split(" ").forEach((function(e){n[e]=!0}));var r=[];return t&&t.skipAttributes&&t.skipAttributes.split(" ").forEach((function(e){r[e]=!0})),f(e,t,n,r)}function f(e,t,n,r){var i,o="",a=[!1];if(void 0===e.nodeType)return o;if(1===e.nodeType){if(e.hasAttribute("class")&&t&&t.classWithChildText&&e.matches(t.classWithChildText.class))o+=e.querySelector(t.classWithChildText.element).textContent;else if(!(t&&t.skipNodeWithClass&&e.matches("."+t.skipNodeWithClass))){var s=e.nodeName.toLowerCase();o+="<"+s;var c=[];for(i=e.attributes.length-1;i>=0;i--){var u=e.attributes[i];if(!(r&&r.length>0&&r[u.name]||/^\d+$/.test(u.name))){if("class"===u.name&&t&&t.replaceClassItemWith&&u.value.split(" ").indexOf(t.replaceClassItemWith.source)>-1){var l=new RegExp(t.replaceClassItemWith.source,"g");u.value=u.value.replace(l,t.replaceClassItemWith.target).trim()}"class"===u.name&&t&&t.skipClassWithValue&&t.skipClassWithValue===u.value||c.push(u.name+"='"+u.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&quot;")+"'")}}if(c.length>0&&(t&&t.sortAttributes&&c.sort((function(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())})),o+=" "+c.join(" ")),n&&n.ename)o+=" />";else{for(o+=">",o+="html"===s?"\n ":"",a.push("style"===s||"script"===s),i=0;i<e.childNodes.length;i++)o+=f(e.childNodes[i]);a.pop(),o+="body"===s?"</"+s+">\n":"</"+s+">"}}}else if(8===e.nodeType)o+="\x3c!--"+e.nodeValue+"--\x3e";else if(3===e.nodeType||4===e.nodeType){var d=e.nodeValue.replace(/\n+$/,"");o+=a[a.length-1]?d:d.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}else console.log("Warning; Cannot handle serialising nodes of type: "+e.nodeType),console.log(e);return o}function h(){var e=new Date,t=e.getYear()+1900,n=e.getMonth()+1,r=e.getDate(),i=e.getUTCHours(),o=e.getUTCMinutes(),a=e.getSeconds();return n<10&&(n="0"+n),r<10&&(r="0"+r),i<10&&(i="0"+i),o<10&&(o="0"+o),a<10&&(a="0"+a),t+"-"+n+"-"+r+"T"+i+":"+o+":"+a+"Z"}function m(e,t,n,r){var i=function(e){return"BlankNode"===e.termType?null:e},o=function(e){var t=n.statementsMatching(e).map((function(e){return i(e.subject)+" "+i(e.predicate)+" "+i(e.object)})).concat(n.statementsMatching(void 0,void 0,e).map((function(e){return i(e.subject)+" "+i(e.predicate)+" "+i(e.object)})));return t.sort(),t.join("\n")},a=Object.prototype.hasOwnProperty.call(n,"compareTerms")?n.compareTerms(e,t):e.compareTerm(t);return"BlankNode"===e.termType&&"BlankNode"===t.termType?0===a?0:o(e)>o(t)?1:o(e)<o(t)?-1:a:r&&e.uri&&t.uri?(r[e.uri]||e.uri).localeCompare(r[t.uri]||t.uri):a}function g(e,t,n,r){return m(e.subject,t.subject,n,r)||m(e.predicate,t.predicate,n,r)||m(e.object,t.object,n,r)}function v(e){var t=document.createElement("div");t.textContent=e,document.body.appendChild(t)}function y(t,n){return n=n||{},e&&e.exports?(new a.DOMParser).parseFromString(t,n.contentType||"application/xhtml+xml"):("undefined"!=typeof window&&window.DOMParser?new window.DOMParser:new a.DOMParser).parseFromString(t,"application/xml")}function b(e,t){for(var n=0;n<e.length;n++)if(e[n].subject.equals(t.subject)&&e[n].predicate.equals(t.predicate)&&e[n].object.equals(t.object)&&e[n].why.equals(t.why))return void e.splice(n,1);throw new Error("RDFArrayRemove: Array did not contain "+t+" "+t.why)}function w(e,t){return e.slice(0,t.length)===t}function x(e){var t=e+"\n";if(!e.stack)return t+"No stack available.\n";for(var n=e.stack.toString().split("\n"),r=[],i=0;i<n.length;i++){var o=n[i];if(o.indexOf("ecmaunit.js")>-1)break;"("==o.charAt(0)&&(o="function"+o);var a=o.split("@");r.push(a)}for(i=0;i<r.length;i++)t+=" "+r[i][1]+"\n "+r[i][0];return t}},8918:(e,t,n)=>{"use strict";function r(e){return"string"==typeof e?e:e.value}n.d(t,{_:()=>r})},6680:(e,t,n)=>{"use strict";n.d(t,{B2:()=>g,NA:()=>w,NX:()=>m,PY:()=>h,Pv:()=>a,Uc:()=>c,Yi:()=>o,cG:()=>d,f:()=>u,jt:()=>p,lt:()=>b,lx:()=>y,n_:()=>f,nq:()=>l,uZ:()=>s,zz:()=>v});var r=n(1002),i=n(8946);function o(e){return"object"===(0,r.Z)(e)&&null!==e&&"subject"in e}function a(e){return"object"===(0,r.Z)(e)&&null!==e&&"statements"in e}function s(e){return p(e)&&e.termType===i.fb}function c(e){return e&&Object.prototype.hasOwnProperty.call(e,"termType")&&(e.termType===i.XM||e.termType===i.UH||e.termType===i.V1||e.termType===i.fb||e.termType===i.xH||e.termType===i._A)}function u(e){return e&&Object.prototype.hasOwnProperty.call(e,"termType")&&(e.termType===i.XM||e.termType===i.UH||e.termType===i.V1||e.termType===i.fb||e.termType===i.xH||e.termType===i._A)}function l(e){return p(e)&&(e.termType===i.XM||e.termType===i.V1||e.termType===i.UH)}function d(e){return p(e)&&e.termType===i.UH}function p(e){return"object"===(0,r.Z)(e)&&null!==e&&"termType"in e}function f(e){return e.termType===i.xH}function h(e){return"object"===(0,r.Z)(e)&&null!==e&&"subject"in e&&"predicate"in e&&"object"in e}function m(e){return p(e)&&"NamedNode"===e.termType}function g(e){return p(e)&&"termType"in e&&"BlankNode"===e.termType}function v(e){return p(e)&&(e.termType===i.XM||e.termType===i.UH||e.termType===i.V1)}function y(e){return p(e)&&(e.termType===i.XM||e.termType===i.UH)}function b(e){return p(e)&&(e.termType===i.XM||e.termType===i.UH||e.termType===i.V1||e.termType===i.xH)}function w(e){return p(e)&&(e.termType===i.XM||e.termType===i.UH||e.termType===i.V1||e.termType===i.NK)}},4889:function(e,t,n){!function(e,t){"use strict";if(!e.setImmediate){var n,r,i,o,a,s=1,c={},u=!1,l=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?n=function(e){process.nextTick((function(){f(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(o="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&f(+t.data.slice(o.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),n=function(t){e.postMessage(o+t,"*")}):e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){f(e.data)},n=function(e){i.port2.postMessage(e)}):l&&"onreadystatechange"in l.createElement("script")?(r=l.documentElement,n=function(e){var t=l.createElement("script");t.onreadystatechange=function(){f(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):n=function(e){setTimeout(f,0,e)},d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];var i={callback:e,args:t};return c[s]=i,n(s),s++},d.clearImmediate=p}function p(e){delete c[e]}function f(e){if(u)setTimeout(f,0,e);else{var t=c[e];if(t){u=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{p(e),u=!1}}}}}("undefined"==typeof self?void 0===n.g?this:n.g:self)},3119:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.createAclLogic=t.ACL_LINK=void 0;var o=n(6022),a=n(563);t.ACL_LINK=(0,o.sym)("http://www.iana.org/assignments/link-relations/acl"),t.createAclLogic=function(e){var n=a.ns;function s(e,t,r,i){void 0===i&&(i={});var a=i.public||[],s=(0,o.graph)(),c=(0,o.Namespace)("http://www.w3.org/ns/auth/acl#"),u=s.sym("".concat(r,"#a1")),l=s.sym(r),d=s.sym(e);if(s.add(u,n.rdf("type"),c("Authorization"),l),s.add(u,c("accessTo"),d,l),i.defaultForNew&&s.add(u,c("default"),d,l),s.add(u,c("agent"),t,l),s.add(u,c("mode"),c("Read"),l),s.add(u,c("mode"),c("Write"),l),s.add(u,c("mode"),c("Control"),l),a.length){u=s.sym("".concat(r,"#a2")),s.add(u,n.rdf("type"),c("Authorization"),l),s.add(u,c("accessTo"),d,l),s.add(u,c("agentClass"),n.foaf("Agent"),l);for(var p=0;p<a.length;p++)s.add(u,c("mode"),c(a[p]),l)}return(0,o.serialize)(l,s,r)}return{findAclDocUrl:function(n){return r(this,void 0,void 0,(function(){var r;return i(this,(function(i){switch(i.label){case 0:return[4,e.fetcher.load(n)];case 1:if(i.sent(),!(r=e.any(n,t.ACL_LINK)))throw new Error("No ACL link discovered for ".concat(n));return[2,r.value]}}))}))},setACLUserPublic:function(n,r,i){var o=e.any(e.sym(n),t.ACL_LINK);return Promise.resolve().then((function(){return o||function(n){var r=e.fetcher;if(!r)throw new Error("Cannot fetch ACL rel, store has no fetcher");return r.load(n).then((function(r){if(!r.ok)throw new Error("fetchACLRel: While loading:"+r.error);var i=e.any(e.sym(n),t.ACL_LINK);if(!i)throw new Error("fetchACLRel: No Link rel=ACL header for "+n);return i}))}(n).catch((function(e){throw new Error("Error fetching rel=ACL header for ".concat(n,": ").concat(e))}))})).then((function(t){var o=s(n,r,t.uri,i);if(!e.fetcher)throw new Error("Cannot PUT this, store has no fetcher");return e.fetcher.webOperation("PUT",t.uri,{data:o,contentType:"text/turtle"}).then((function(e){if(!e.ok)throw new Error("Error writing ACL text: "+e.error);return t}))}))},genACLText:s}}},2165:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.authSession=void 0;var r=n(4305);t.authSession=new r.Session({clientAuthentication:(0,r.getClientAuthenticationWithDependencies)({})},"mySession")},3804:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.SolidAuthnLogic=void 0;var c=n(6022),u=n(8865),l=o(n(3581)),d=function(){function e(e){this.session=e}return Object.defineProperty(e.prototype,"authSession",{get:function(){return this.session},enumerable:!1,configurable:!0}),e.prototype.currentUser=function(){var e=(0,u.appContext)();return e.viewingNoAuthPage?(0,c.sym)(e.webId):this&&this.session&&this.session.info&&this.session.info.webId&&this.session.info.isLoggedIn?(0,c.sym)(this.session.info.webId):(0,u.offlineTestID)()},e.prototype.checkUser=function(e){return a(this,void 0,void 0,(function(){var t,n,r,i,o,a;return s(this,(function(s){switch(s.label){case 0:return(t=new URL(window.location.href).hash)&&window.localStorage.setItem("preLoginRedirectHash",t),this.session.onSessionRestore((function(e){document.location.toString()!==e&&history.replaceState(null,"",e)})),(n=new URL(window.location.href)).hash="",[4,this.session.handleIncomingRedirect({restorePreviousSession:!0,url:n.href})];case 1:return s.sent(),(r=window.localStorage.getItem("preLoginRedirectHash"))&&((i=new URL(window.location.href)).hash!==r&&(history.pushState?history.pushState(null,document.title,r):location.hash=r,i.hash=r),window.localStorage.setItem("preLoginRedirectHash","")),(o=(0,u.offlineTestID)())||((a=this.webIdFromSession(this.session.info))&&(o=this.saveUser(a)),o&&l.log("(Logged in as ".concat(o," by authentication)"))),[2,Promise.resolve(e?e(o):o)]}}))}))},e.prototype.saveUser=function(e,t){var n;if(e){n="string"==typeof e?e:e.uri;var r=(0,c.namedNode)(n);return t&&(t.me=r),r}return null},e.prototype.webIdFromSession=function(e){return(null==e?void 0:e.webId)&&e.isLoggedIn?e.webId:null},e}();t.SolidAuthnLogic=d},8865:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.offlineTestID=t.appContext=void 0;var a=n(6022),s=o(n(3581));t.appContext=function(){var e=window.SolidAppContext;if(e||(e={}),e.viewingNoAuthPage=!1,e.noAuth&&window.document&&window.document.location.href.startsWith(e.noAuth)){e.viewingNoAuthPage=!0;var t=new URLSearchParams(window.document.location.search);if(t){var n=e.viewedPage=t.get("uri")||null;if(n&&!(n=decodeURI(n)).startsWith(e.noAuth)){var r=n.split(/\//);e.idp=r[0]+"//"+r[2],e.viewingNoAuthPage=!1}}}return e},t.offlineTestID=function(){var e=window.$SolidTestEnvironment;if(void 0!==e&&e.username)return s.log("Assuming the user is "+e.username),(0,a.sym)(e.username);if("undefined"!=typeof document&&document.location&&"http://localhost"===(""+document.location).slice(0,16)){var t=document.getElementById("appTarget");if(!t)return null;var n=t.getAttribute("testID");return n?(s.log("Assuming user is "+n),(0,a.sym)(n)):null}return null}},6833:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.createChatLogic=void 0;var a=n(6022),s=n(563),c=n(9690),u="index.ttl#this";t.createChatLogic=function(e,t){var n=s.ns;function l(t,n,r){return i(this,void 0,void 0,(function(){var i,s;return o(this,(function(o){switch(o.label){case 0:return[4,e.fetcher.load(t)];case 1:if(o.sent(),!(i=e.any(t,new a.NamedNode("http://www.iana.org/assignments/link-relations/acl"))))throw new Error("Chat ACL doc not found!");return s="\n @prefix acl: <http://www.w3.org/ns/auth/acl#>.\n <#owner>\n a acl:Authorization;\n acl:agent <".concat(n.value,">;\n acl:accessTo <.>;\n acl:default <.>;\n acl:mode\n acl:Read, acl:Write, acl:Control.\n <#invitee>\n a acl:Authorization;\n acl:agent <").concat(r.value,">;\n acl:accessTo <.>;\n acl:default <.>;\n acl:mode\n acl:Read, acl:Append.\n "),[4,e.fetcher.webOperation("PUT",i.value,{data:s,contentType:"text/turtle"})];case 2:return o.sent(),[2]}}))}))}function d(t,r){return i(this,void 0,void 0,(function(){var i,s,u;return o(this,(function(o){switch(o.label){case 0:if(!(i=e.any(r,n.solid("privateTypeIndex"))))throw new Error("Private type index not found!");return[4,e.fetcher.load(i)];case 1:return o.sent(),s=(0,c.newThing)(i),u=[(0,a.st)(s,n.rdf("type"),n.solid("TypeRegistration"),i.doc()),(0,a.st)(s,n.solid("forClass"),n.meeting("LongChat"),i.doc()),(0,a.st)(s,n.solid("instance"),t,i.doc())],[4,new Promise((function(t,n){e.updater.update([],u,(function(e,r,i){r?t(null):n(new Error(i))}))}))];case 2:return o.sent(),[2]}}))}))}function p(n){return i(this,void 0,void 0,(function(){var r,i,s,u;return o(this,(function(o){switch(o.label){case 0:return[4,t.loadMe()];case 1:return r=o.sent(),[4,t.getPodRoot(r)];case 2:i=o.sent(),s=(0,c.determineChatContainer)(n,i),u=!0,o.label=3;case 3:return o.trys.push([3,5,,6]),[4,e.fetcher.load(new a.NamedNode(s.value+"index.ttl#this"))];case 4:return o.sent(),[3,6];case 5:return o.sent(),u=!1,[3,6];case 6:return[2,{me:r,chatContainer:s,exists:u}]}}))}))}function f(e,t){return i(this,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return[4,h({me:t,newBase:e.value})];case 1:return[2,n.sent().newInstance]}}))}))}function h(t){var i=e,o=i.updater;if(t.me&&!t.me.uri)throw new Error("chat mintNew: Invalid userid "+t.me);var s=t.newInstance=t.newInstance||i.sym(t.newBase+u),c=s.doc();return i.add(s,n.rdf("type"),n.meeting("LongChat"),c),i.add(s,n.dc("title"),"Chat channel",c),i.add(s,n.dc("created"),(0,a.term)(new Date(Date.now())),c),t.me&&i.add(s,n.dc("author"),t.me,c),new Promise((function(e,n){null==o||o.put(c,i.statementsMatching(void 0,void 0,void 0,c),"text/turtle",(function(i,o,a){o?e(r(r({},t),{newInstance:s})):n(new Error("FAILED to save new chat channel at: "+i+" : "+a))}))}))}function m(t,r){var a;return i(this,void 0,void 0,(function(){var i,s,c;return o(this,(function(o){switch(o.label){case 0:return[4,e.fetcher.load(t.doc())];case 1:if(o.sent(),!(i=e.any(t,n.ldp("inbox"),void 0,t.doc())))throw new Error("Invitee inbox not found! ".concat(t.value));return s="\n <> a <http://www.w3.org/ns/pim/meeting#LongChatInvite> ;\n ".concat(n.rdf("seeAlso")," <").concat(r.value,"> .\n "),[4,null===(a=e.fetcher)||void 0===a?void 0:a.webOperation("POST",i.value,{data:s,contentType:"text/turtle"})];case 2:if(!(null==(c=o.sent())?void 0:c.headers.get("location")))throw new Error("Invite sending returned a ".concat(null==c?void 0:c.status));return[2]}}))}))}return{setAcl:l,addToPrivateTypeIndex:d,findChat:p,createChatThing:f,getChat:function(e,t){return void 0===t&&(t=!0),i(this,void 0,void 0,(function(){var n,r,i,s;return o(this,(function(o){switch(o.label){case 0:return[4,p(e)];case 1:return n=o.sent(),r=n.me,i=n.chatContainer,n.exists?[2,new a.NamedNode(i.value+u)]:t?[4,f(i,r)]:[3,6];case 2:return s=o.sent(),[4,m(e,s)];case 3:return o.sent(),[4,l(i,r,e)];case 4:return o.sent(),[4,d(s,r)];case 5:return o.sent(),[2,s];case 6:return[2,null]}}))}))},sendInvite:m,mintNew:h}}},9674:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.createInboxLogic=void 0;var o=n(9690);t.createInboxLogic=function(e,t,n,a,s){return{createInboxFor:function(e,o){return r(this,void 0,void 0,(function(){var r,s,c;return i(this,(function(i){switch(i.label){case 0:return[4,t.loadMe()];case 1:return r=i.sent(),[4,t.getPodRoot(r)];case 2:return s=i.sent(),c="".concat(s.value,"p2p-inboxes/").concat(encodeURIComponent(o),"/"),[4,a.createContainer(c)];case 3:return i.sent(),[4,n.setSinglePeerAccess({ownerWebId:r.value,peerWebId:e,accessToModes:"acl:Append",target:c})];case 4:return i.sent(),[2,c]}}))}))},getNewMessages:function(e){return r(this,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return e?[3,2]:[4,t.loadMe()];case 1:e=r.sent(),r.label=2;case 2:return[4,t.getMainInbox(e)];case 3:return n=r.sent(),[4,a.getContainerMembers(n)];case 4:return[2,r.sent().filter((function(e){return!a.isContainer(e)}))]}}))}))},markAsRead:function(t,n){return r(this,void 0,void 0,(function(){var r,a,s,c;return i(this,(function(i){switch(i.label){case 0:return[4,e.fetcher._fetch(t)];case 1:if(200!==(r=i.sent()).status)throw new Error("Not OK! ".concat(t));return a=(0,o.getArchiveUrl)(t,n),c={method:"PUT"},[4,r.text()];case 2:return c.body=i.sent(),c.headers=[["Content-Type",r.headers.get("Content-Type")||"application/octet-stream"]],s=c,[4,e.fetcher._fetch(a,s)];case 3:return"2"!==i.sent().status.toString()[0]?[3,5]:[4,e.fetcher._fetch(t,{method:"DELETE"})];case 4:i.sent(),i.label=5;case 5:return[2]}}))}))}}}},166:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.authSession=t.authn=t.store=t.solidLogicSingleton=t.WebOperationError=t.NotEditableError=t.FetchError=t.NotFoundError=t.SameOriginForbiddenError=t.CrossOriginForbiddenError=t.UnauthorizedError=t.getSuggestedIssuers=t.appContext=t.offlineTestID=t.ACL_LINK=void 0;var r=n(720);Object.defineProperty(t,"solidLogicSingleton",{enumerable:!0,get:function(){return r.solidLogicSingleton}});var i=r.solidLogicSingleton.authn;t.authn=i;var o=r.solidLogicSingleton.authn.authSession;t.authSession=o;var a=r.solidLogicSingleton.store;t.store=a;var s=n(3119);Object.defineProperty(t,"ACL_LINK",{enumerable:!0,get:function(){return s.ACL_LINK}});var c=n(8865);Object.defineProperty(t,"offlineTestID",{enumerable:!0,get:function(){return c.offlineTestID}}),Object.defineProperty(t,"appContext",{enumerable:!0,get:function(){return c.appContext}});var u=n(1896);Object.defineProperty(t,"getSuggestedIssuers",{enumerable:!0,get:function(){return u.getSuggestedIssuers}});var l=n(7611);Object.defineProperty(t,"UnauthorizedError",{enumerable:!0,get:function(){return l.UnauthorizedError}}),Object.defineProperty(t,"CrossOriginForbiddenError",{enumerable:!0,get:function(){return l.CrossOriginForbiddenError}}),Object.defineProperty(t,"SameOriginForbiddenError",{enumerable:!0,get:function(){return l.SameOriginForbiddenError}}),Object.defineProperty(t,"NotFoundError",{enumerable:!0,get:function(){return l.NotFoundError}}),Object.defineProperty(t,"FetchError",{enumerable:!0,get:function(){return l.FetchError}}),Object.defineProperty(t,"NotEditableError",{enumerable:!0,get:function(){return l.NotEditableError}}),Object.defineProperty(t,"WebOperationError",{enumerable:!0,get:function(){return l.WebOperationError}})},1896:function(e,t){"use strict";var n=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.getSuggestedIssuers=void 0;var r=[{name:"Solid Community",uri:"https://solidcommunity.net"},{name:"Solid Web",uri:"https://solidweb.org"},{name:"Inrupt.net",uri:"https://inrupt.net"},{name:"pod.Inrupt.com",uri:"https://login.inrupt.com"}];t.getSuggestedIssuers=function(){var e=n([],r,!0),t=new URL(location.href),i=t.host,o=t.origin,a=e.map((function(e){var t=e.uri;return new URL(t).host}));return a.includes(i)||a.some((function(e){return n=e,(r=(t=i).length-n.length-1)>0&&"."===t[r]&&t.endsWith(n);var t,n,r}))||e.unshift({name:i,uri:o}),e}},7611:function(e,t){"use strict";var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.FetchError=t.WebOperationError=t.NotEditableError=t.NotFoundError=t.SameOriginForbiddenError=t.CrossOriginForbiddenError=t.UnauthorizedError=void 0;var i=function(e){function t(t){var n=this.constructor,r=e.call(this,t)||this;return Object.setPrototypeOf(r,n.prototype),r.name=n.name,r}return r(t,e),t}(Error),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(i);t.UnauthorizedError=o;var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(i);t.CrossOriginForbiddenError=a;var s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(i);t.SameOriginForbiddenError=s;var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(i);t.NotFoundError=c;var u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(i);t.NotEditableError=u;var l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(i);t.WebOperationError=l;var d=function(e){function t(t,n){var r=e.call(this,n)||this;return r.status=t,r}return r(t,e),t}(i);t.FetchError=d},6947:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.createSolidLogic=void 0;var a=o(n(6022)),s=n(3119),c=n(3804),u=n(6833),l=n(9674),d=n(6659),p=n(6609),f=n(7947),h=n(7721),m=o(n(3581));t.createSolidLogic=function(e,t){m.log("SolidLogic: Unique instance created. There should only be one of these.");var n=a.graph();a.fetcher(n,{fetch:e.fetch}),n.updater=new a.UpdateManager(n),n.features=[];var r=new c.SolidAuthnLogic(t),i=(0,s.createAclLogic)(n),o=(0,f.createContainerLogic)(n),g=(0,h.createUtilityLogic)(n,i,o),v=(0,d.createProfileLogic)(n,r,g),y=(0,u.createChatLogic)(n,v),b=(0,l.createInboxLogic)(n,v,g,o,i),w=(0,p.createTypeIndexLogic)(n,r,v,g);return m.log("SolidAuthnLogic initialized"),{store:n,authn:r,acl:i,inbox:b,chat:y,profile:v,typeIndex:w,load:function(e){return n.fetcher.load(e)},updatePromise:function(e,t){return void 0===t&&(t=[]),new Promise((function(r,i){n.updater.update(e,t,(function(e,t,n){t?r():i(new Error(n))}))}))},clearStore:function(){n.statements.slice().forEach(n.remove.bind(n))}}}},720:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.solidLogicSingleton=void 0;var c=o(n(3581)),u=n(2165),l=(0,n(6947).createSolidLogic)({fetch:function(e,t){return a(void 0,void 0,void 0,(function(){var n;return s(this,(function(r){return n=t&&t.credentials&&"omit"==t.credentials,u.authSession.info.webId&&!n?[2,u.authSession.fetch(e,t)]:[2,window.fetch(e,t)]}))}))}},u.authSession);t.solidLogicSingleton=l,c.log("Unique quadstore initialized.")},6659:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.createProfileLogic=void 0;var c=n(7611),u=o(n(3581)),l=n(563),d=n(9690);t.createProfileLogic=function(e,t,n){var r=l.ns;function i(t){return a(this,void 0,void 0,(function(){var i,a,l,p,f,h;return s(this,(function(s){switch(s.label){case 0:return[4,o(t)];case 1:s.sent(),i=(0,d.suggestPreferencesFile)(t),s.label=2;case 2:return s.trys.push([2,4,,5]),[4,n.followOrCreateLink(t,r.space("preferencesFile"),i,t.doc())];case 3:return a=s.sent(),[3,5];case 4:if(l=s.sent(),p="User ".concat(t," has no pointer in profile to preferences file."),u.warn(p),l instanceof c.NotEditableError)throw l;if(l instanceof c.WebOperationError)throw l;if(l instanceof c.UnauthorizedError)throw l;if(l instanceof c.CrossOriginForbiddenError)throw l;if(l instanceof c.SameOriginForbiddenError)throw l;if(l instanceof c.FetchError)throw l;throw l;case 5:return s.trys.push([5,7,,8]),[4,e.fetcher.load(a)];case 6:return s.sent(),[3,8];case 7:if(f=s.sent(),h="Unable to load preference of user ".concat(t,": ").concat(f),u.warn(h),401===f.response.status)throw new c.UnauthorizedError;if(403===f.response.status){if((0,d.differentOrigin)(a))throw new c.CrossOriginForbiddenError;throw new c.SameOriginForbiddenError}throw new Error(h);case 8:return[2,a]}}))}))}function o(t){return a(this,void 0,void 0,(function(){var n;return s(this,(function(r){switch(r.label){case 0:if(!t)throw new Error("loadProfile: no user given.");r.label=1;case 1:return r.trys.push([1,3,,4]),[4,e.fetcher.load(t.doc())];case 2:return r.sent(),[3,4];case 3:throw n=r.sent(),new Error("Unable to load profile of user ".concat(t,": ").concat(n));case 4:return[2,t.doc()]}}))}))}function p(t){return e.any(t,r.space("storage"),void 0,t.doc())}return{loadMe:function(){return a(this,void 0,void 0,(function(){var n;return s(this,(function(r){switch(r.label){case 0:if(null===(n=t.currentUser()))throw new Error("Current user not found! Not logged in?");return[4,e.fetcher.load(n.doc())];case 1:return r.sent(),[2,n]}}))}))},getPodRoot:function(e){var t=p(e);if(!t)throw new Error("User pod root not found!");return t},getMainInbox:function(t){return a(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return[4,e.fetcher.load(t)];case 1:if(i.sent(),!(n=e.any(t,r.ldp("inbox"),void 0,t.doc())))throw new Error("User main inbox not found!");return[2,n]}}))}))},findStorage:p,loadPreferences:i,loadProfile:o,silencedLoadPreferences:function(e){return a(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,i(e)];case 1:return[2,t.sent()];case 2:return t.sent(),[2,void 0];case 3:return[2]}}))}))}}}},6609:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.createTypeIndexLogic=void 0;var c=n(6022),u=o(n(3581)),l=n(563),d=n(9690);t.createTypeIndexLogic=function(e,t,n,r){var i=l.ns;function o(t){return a(this,void 0,void 0,(function(){var o,a,c,l,d,p,f,h,v,y,b,w,x;return s(this,(function(s){switch(s.label){case 0:if(!t)throw new Error("loadTypeIndexesFor: No user given");return[4,n.loadProfile(t)];case 1:o=s.sent(),a=m(t),s.label=2;case 2:return s.trys.push([2,4,,5]),[4,r.followOrCreateLink(t,i.solid("publicTypeIndex"),a,o)];case 3:return c=s.sent(),[3,5];case 4:return s.sent(),y="User ".concat(t," has no pointer in profile to publicTypeIndex file."),u.warn(y),[3,5];case 5:l=c?[{label:"public",index:c,agent:t}]:[],s.label=6;case 6:return s.trys.push([6,8,,9]),[4,n.silencedLoadPreferences(t)];case 7:return d=s.sent(),[3,9];case 8:return s.sent(),d=null,[3,9];case 9:if(!d)return[3,15];f=g(d),h=void 0,s.label=10;case 10:return s.trys.push([10,13,,14]),(v=e.any(t,i.solid("privateTypeIndex"),void 0,o))?[3,12]:[4,r.followOrCreateLink(t,i.solid("privateTypeIndex"),f,d)];case 11:v=s.sent(),s.label=12;case 12:return h=v,[3,14];case 13:return s.sent(),y="User ".concat(t," has no pointer in preference file to privateTypeIndex file."),u.warn(y),[3,14];case 14:return p=h?[{label:"private",index:h,agent:t}]:[],[3,16];case 15:p=[],s.label=16;case 16:if(0===(b=l.concat(p)).length)return[2,b];w=b.map((function(e){return e.index})),s.label=17;case 17:return s.trys.push([17,19,,20]),[4,e.fetcher.load(w)];case 18:return s.sent(),[3,20];case 19:return x=s.sent(),u.warn("Problems loading type index: ",x),[3,20];case 20:return[2,b]}}))}))}function p(t){return a(this,void 0,void 0,(function(){var r,a,c,l,d,p,f,h,m;return s(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,n.silencedLoadPreferences(t)];case 1:return r=s.sent(),[3,3];case 2:return s.sent(),a="User ".concat(t," has no pointer in profile to preferences file."),u.warn(a),[3,3];case 3:if(!r)return[3,8];c=e.each(t,i.solid("community"),void 0,r).concat(e.each(t,i.solid("community"),void 0,t.doc())),l=[],d=0,p=c,s.label=4;case 4:return d<p.length?(f=p[d],m=(h=l).concat,[4,o(f)]):[3,7];case 5:l=m.apply(h,[s.sent()]),s.label=6;case 6:return d++,[3,4];case 7:return[2,l];case 8:return[2,[]]}}))}))}function f(e){return a(this,void 0,void 0,(function(){var t,n;return s(this,(function(r){switch(r.label){case 0:return[4,o(e)];case 1:return n=(t=r.sent()).concat,[4,p(e)];case 2:return[2,n.apply(t,[r.sent().flat()])]}}))}))}function h(e,t){return a(this,void 0,void 0,(function(){var n,r,i,o,a;return s(this,(function(s){switch(s.label){case 0:return[4,f(t)];case 1:n=s.sent(),r=[],i=0,o=n,s.label=2;case 2:return i<o.length?[4,v(o[i],e)]:[3,5];case 3:a=s.sent(),r=r.concat(a),s.label=4;case 4:return i++,[3,2];case 5:return[2,r]}}))}))}function m(e){var t;return(0,c.sym)((null===(t=e.doc().dir())||void 0===t?void 0:t.uri)+"publicTypeIndex.ttl")}function g(e){var t;return(0,c.sym)((null===(t=e.doc().dir())||void 0===t?void 0:t.uri)+"privateTypeIndex.ttl")}function v(t,n){return a(this,void 0,void 0,(function(){var r,o,a,u,l,d,p,f,h,m,g,v,y,b;return s(this,(function(s){switch(s.label){case 0:r=t.index,o=[],a=e.statementsMatching(null,i.solid("instance"),null,r).concat(e.statementsMatching(null,i.solid("instanceContainer"),null,r)).map((function(e){return e.subject})),u=0,l=a,s.label=1;case 1:if(!(u<l.length))return[3,6];if(d=l[u],p=e.any(d,i.solid("forClass"),null,r),n&&!p.sameTerm(n))return[3,5];for(f=e.each(d,i.solid("instance"),null,r),h=0,m=f;h<m.length;h++)b=m[h],o.push({instance:b,type:p,scope:t});g=e.each(d,i.solid("instanceContainer"),null,r),v=0,y=g,s.label=2;case 2:return v<y.length?(b=y[v],[4,e.fetcher.load(b)]):[3,5];case 3:s.sent(),o.push({instance:(0,c.sym)(b.value),type:p,scope:t}),s.label=4;case 4:return v++,[3,2];case 5:return u++,[3,1];case 6:return[2,o]}}))}))}return{registerInTypeIndex:function(t,n,r){return a(this,void 0,void 0,(function(){var o,a,u,l;return s(this,(function(s){switch(s.label){case 0:o=(0,d.newThing)(n),a=[(0,c.st)(o,i.rdf("type"),i.solid("TypeRegistration"),n),(0,c.st)(o,i.solid("forClass"),r,n),(0,c.st)(o,i.solid("instance"),t,n)],s.label=1;case 1:return s.trys.push([1,3,,4]),[4,e.updater.update([],a)];case 2:return s.sent(),[3,4];case 3:return u=s.sent(),l="Unable to register ".concat(t," in index ").concat(n,": ").concat(u),console.warn(l),[2,null];case 4:return[2,o]}}))}))},getRegistrations:function(t,n){return e.each(void 0,i.solid("instance"),t).filter((function(t){return e.holds(t,i.solid("forClass"),n)}))},loadTypeIndexesFor:o,loadCommunityTypeIndexes:p,loadAllTypeIndexes:f,getScopedAppInstances:h,getAppInstances:function(e){return a(this,void 0,void 0,(function(){var n;return s(this,(function(r){switch(r.label){case 0:if(!(n=t.currentUser()))throw new Error("getAppInstances: Must be logged in to find apps.");return[4,h(e,n)];case 1:return[2,r.sent().map((function(e){return e.instance}))]}}))}))},suggestPublicTypeIndex:m,suggestPrivateTypeIndex:g,deleteTypeIndexRegistration:function(t){return a(this,void 0,void 0,(function(){var n,r;return s(this,(function(o){switch(o.label){case 0:if(!(n=e.the(null,i.solid("instance"),t.instance,t.scope.index)))throw new Error("deleteTypeIndexRegistration: No registration found for ".concat(t.instance));return r=e.statementsMatching(n,null,null,t.scope.index),[4,e.updater.update(r,[])];case 1:return o.sent(),[2]}}))}))},getScopedAppsFromIndex:v}}},7947:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.createContainerLogic=void 0;var o=n(6022);t.createContainerLogic=function(e){function t(t){return e.statementsMatching(t,(0,o.sym)("http://www.w3.org/ns/ldp#contains"),void 0).map((function(e){return e.object}))}function n(e){var t=e.value;return"/"===t.charAt(t.length-1)}return{isContainer:n,createContainer:function(t){return r(this,void 0,void 0,(function(){var r;return i(this,(function(i){switch(i.label){case 0:if(!n((0,o.sym)(t)))throw new Error("Not a container URL ".concat(t));return[4,e.fetcher._fetch(t,{method:"PUT",headers:{"Content-Type":"text/turtle","If-None-Match":"*",Link:'<http://www.w3.org/ns/ldp#BasicContainer>; rel="type"'},body:" "})];case 1:if("2"!==(r=i.sent()).status.toString()[0])throw new Error("Not OK: got ".concat(r.status," response while creating container at ").concat(t));return[2]}}))}))},getContainerElements:t,getContainerMembers:function(n){return r(this,void 0,void 0,(function(){return i(this,(function(r){switch(r.label){case 0:return[4,e.fetcher.load(n)];case 1:return r.sent(),[2,t(n)]}}))}))}}}},3581:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.trace=t.error=t.warn=t.log=void 0,t.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];console.log.apply(console,e)},t.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];console.warn.apply(console,e)},t.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];console.error.apply(console,e)},t.trace=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];console.trace.apply(console,e)}},563:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ns=void 0;var s=a(n(3180)),c=o(n(6022));t.ns=(0,s.default)(c)},7721:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.createUtilityLogic=void 0;var c=n(6022),u=n(7611),l=o(n(3581)),d=n(9690);t.createUtilityLogic=function(e,t,n){function r(t){return a(this,void 0,void 0,(function(){var n,r,i,o;return s(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,10]),[4,e.fetcher.load(t)];case 1:return n=a.sent(),[3,10];case 2:if(404!==(r=a.sent()).response.status)return[3,8];a.label=3;case 3:return a.trys.push([3,5,,6]),[4,e.fetcher.webOperation("PUT",t,{data:"",contentType:"text/turtle"})];case 4:return a.sent(),[3,6];case 5:throw i=a.sent(),o="createIfNotExists: PUT FAILED: "+t+": "+i,new u.WebOperationError(o);case 6:return[4,e.fetcher.load(t)];case 7:return a.sent(),[3,9];case 8:if(401===r.response.status)throw new u.UnauthorizedError;if(403===r.response.status){if((0,d.differentOrigin)(t))throw new u.CrossOriginForbiddenError;throw new u.SameOriginForbiddenError}throw o="createIfNotExists doc load error NOT 404: "+t+": "+r,new u.FetchError(r.status,r.message+o);case 9:return[3,10];case 10:return[2,n]}}))}))}return{recursiveDelete:function r(i){return a(this,void 0,void 0,(function(){var o,a,c;return s(this,(function(s){switch(s.label){case 0:return s.trys.push([0,6,,7]),n.isContainer(i)?[4,t.findAclDocUrl(i)]:[3,5];case 1:return o=s.sent(),[4,e.fetcher._fetch(o,{method:"DELETE"})];case 2:return s.sent(),[4,n.getContainerMembers(i)];case 3:return a=s.sent(),[4,Promise.all(a.map((function(e){return r(e)})))];case 4:s.sent(),s.label=5;case 5:return c=i.value,[2,e.fetcher._fetch(c,{method:"DELETE"})];case 6:return s.sent(),[3,7];case 7:return[2]}}))}))},setSinglePeerAccess:function(n){return a(this,void 0,void 0,(function(){var r,i;return s(this,(function(o){switch(o.label){case 0:return r=["@prefix acl: <http://www.w3.org/ns/auth/acl#>.","","<#alice> a acl:Authorization;\n acl:agent <".concat(n.ownerWebId,">;")," acl:accessTo <".concat(n.target,">;")," acl:default <".concat(n.target,">;")," acl:mode acl:Read, acl:Write, acl:Control.",""].join("\n"),n.accessToModes&&(r+=["<#bobAccessTo> a acl:Authorization;"," acl:agent <".concat(n.peerWebId,">;")," acl:accessTo <".concat(n.target,">;")," acl:mode ".concat(n.accessToModes,"."),""].join("\n")),n.defaultModes&&(r+=["<#bobDefault> a acl:Authorization;"," acl:agent <".concat(n.peerWebId,">;")," acl:default <".concat(n.target,">;")," acl:mode ".concat(n.defaultModes,"."),""].join("\n")),[4,t.findAclDocUrl((0,c.sym)(n.target))];case 1:return i=o.sent(),[2,e.fetcher._fetch(i,{method:"PUT",body:r,headers:[["Content-Type","text/turtle"]]})]}}))}))},createEmptyRdfDoc:function(t,n){return a(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,e.fetcher.webOperation("PUT",t.uri,{data:"# ".concat(new Date," ").concat(n,"\n "),contentType:"text/turtle"})];case 1:return r.sent(),[2]}}))}))},followOrCreateLink:function(t,n,i,o){return a(this,void 0,void 0,(function(){var a,d,p,f;return s(this,(function(s){switch(s.label){case 0:return[4,e.fetcher.load(o)];case 1:if(s.sent(),a=e.any(t,n,null,o))return[2,a];if(!e.updater.editable(o))throw p="followOrCreateLink: cannot edit ".concat(o.value),l.warn(p),new u.NotEditableError(p);s.label=2;case 2:return s.trys.push([2,4,,5]),[4,e.updater.update([],[(0,c.st)(t,n,i,o)])];case 3:return s.sent(),[3,5];case 4:throw d=s.sent(),p="followOrCreateLink: Error making link in ".concat(o," to ").concat(i,": ").concat(d),l.warn(p),new u.WebOperationError(d);case 5:return s.trys.push([5,7,,8]),[4,r(i)];case 6:return s.sent(),[3,8];case 7:throw f=s.sent(),l.warn("followOrCreateLink: Error loading or saving new linked document: ".concat(i,": ").concat(f)),f;case 8:return[2,i]}}))}))},loadOrCreateIfNotExists:r}}},9690:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.determineChatContainer=t.suggestPreferencesFile=t.differentOrigin=t.getArchiveUrl=t.uniqueNodes=t.newThing=void 0;var r=n(6022);t.newThing=function(e){return(0,r.sym)(e.uri+"#id"+Date.now())},t.uniqueNodes=function(e){var t=e.map((function(e){return e.uri})),n=new Set(t);return Array.from(n).map((function(e){return new r.NamedNode(e)}))},t.getArchiveUrl=function(e,t){var n=t.getUTCFullYear(),r=("0"+(t.getUTCMonth()+1)).slice(-2),i=("0"+t.getUTCDate()).slice(-2),o=e.split("/"),a=o[o.length-1];return new URL("./archive/".concat(n,"/").concat(r,"/").concat(i,"/").concat(a),e).toString()},t.differentOrigin=function(e){return!e||"".concat(window.location.origin,"/")!==new URL(e.value).origin},t.suggestPreferencesFile=function(e){var t=e.uri.replace("/profile/","/").replace("/public/","/").split("/").slice(0,-1).join("/")+"/Settings/Preferences.ttl";return(0,r.sym)(t)},t.determineChatContainer=function(e,t){var n=new URL("IndividualChats/".concat(new URL(e.value).host,"/"),t.value).toString();return new r.NamedNode(n)}},3180:e=>{const t={acl:"http://www.w3.org/ns/auth/acl#",arg:"http://www.w3.org/ns/pim/arg#",as:"https://www.w3.org/ns/activitystreams#",cal:"http://www.w3.org/2002/12/cal/ical#",cert:"http://www.w3.org/ns/auth/cert#",contact:"http://www.w3.org/2000/10/swap/pim/contact#",dc:"http://purl.org/dc/elements/1.1/",dct:"http://purl.org/dc/terms/",doap:"http://usefulinc.com/ns/doap#",foaf:"http://xmlns.com/foaf/0.1/",geo:"http://www.w3.org/2003/01/geo/wgs84_pos#",gpx:"http://www.w3.org/ns/pim/gpx#",http:"http://www.w3.org/2007/ont/http#",httph:"http://www.w3.org/2007/ont/httph#",icalTZ:"http://www.w3.org/2002/12/cal/icaltzd#",ldp:"http://www.w3.org/ns/ldp#",link:"http://www.w3.org/2007/ont/link#",log:"http://www.w3.org/2000/10/swap/log#",meeting:"http://www.w3.org/ns/pim/meeting#",mo:"http://purl.org/ontology/mo/",org:"http://www.w3.org/ns/org#",owl:"http://www.w3.org/2002/07/owl#",pad:"http://www.w3.org/ns/pim/pad#",patch:"http://www.w3.org/ns/pim/patch#",prov:"http://www.w3.org/ns/prov#",qu:"http://www.w3.org/2000/10/swap/pim/qif#",trip:"http://www.w3.org/ns/pim/trip#",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",rss:"http://purl.org/rss/1.0/",sched:"http://www.w3.org/ns/pim/schedule#",schema:"http://schema.org/",sioc:"http://rdfs.org/sioc/ns#",solid:"http://www.w3.org/ns/solid/terms#",space:"http://www.w3.org/ns/pim/space#",stat:"http://www.w3.org/ns/posix/stat#",tab:"http://www.w3.org/2007/ont/link#",tabont:"http://www.w3.org/2007/ont/link#",ui:"http://www.w3.org/ns/ui#",vcard:"http://www.w3.org/2006/vcard/ns#",wf:"http://www.w3.org/2005/01/wf/flow#",xsd:"http://www.w3.org/2001/XMLSchema#",cco:"http://www.ontologyrepository.com/CommonCoreOntologies/"};e.exports=function(e={namedNode:e=>e}){const n={};for(const r in t){const i=t[r];n[r]=function(t=""){return e.namedNode(i+t)}}return n}},7121:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r}),e=n.hmd(e);const r=function(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}("undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:e)},2511:function(e,t,n){var r;e=n.nmd(e),function(i){t&&t.nodeType,e&&e.nodeType;var o="object"==typeof n.g&&n.g;o.global!==o&&o.window!==o&&o.self;var a,s=2147483647,c=36,u=/^xn--/,l=/[^\x20-\x7E]/,d=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,h=String.fromCharCode;function m(e){throw RangeError(p[e])}function g(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function v(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+g((e=e.replace(d,".")).split("."),t).join(".")}function y(e){for(var t,n,r=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(n=e.charCodeAt(i++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),i--):r.push(t);return r}function b(e){return g(e,(function(e){var t="";return e>65535&&(t+=h((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+h(e)})).join("")}function w(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function x(e,t,n){var r=0;for(e=n?f(e/700):e>>1,e+=f(e/t);e>455;r+=c)e=f(e/35);return f(r+36*e/(e+38))}function _(e){var t,n,r,i,o,a,u,l,d,p,h,g=[],v=e.length,y=0,w=128,_=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&m("not-basic"),g.push(e.charCodeAt(r));for(i=n>0?n+1:0;i<v;){for(o=y,a=1,u=c;i>=v&&m("invalid-input"),((l=(h=e.charCodeAt(i++))-48<10?h-22:h-65<26?h-65:h-97<26?h-97:c)>=c||l>f((s-y)/a))&&m("overflow"),y+=l*a,!(l<(d=u<=_?1:u>=_+26?26:u-_));u+=c)a>f(s/(p=c-d))&&m("overflow"),a*=p;_=x(y-o,t=g.length+1,0==o),f(y/t)>s-w&&m("overflow"),w+=f(y/t),y%=t,g.splice(y++,0,w)}return b(g)}function E(e){var t,n,r,i,o,a,u,l,d,p,g,v,b,_,E,k=[];for(v=(e=y(e)).length,t=128,n=0,o=72,a=0;a<v;++a)(g=e[a])<128&&k.push(h(g));for(r=i=k.length,i&&k.push("-");r<v;){for(u=s,a=0;a<v;++a)(g=e[a])>=t&&g<u&&(u=g);for(u-t>f((s-n)/(b=r+1))&&m("overflow"),n+=(u-t)*b,t=u,a=0;a<v;++a)if((g=e[a])<t&&++n>s&&m("overflow"),g==t){for(l=n,d=c;!(l<(p=d<=o?1:d>=o+26?26:d-o));d+=c)E=l-p,_=c-p,k.push(h(w(p+E%_,0))),l=f(E/_);k.push(h(w(l,0))),o=x(n,b,r==i),n=0,++r}++n,++t}return k.join("")}a={version:"1.3.2",ucs2:{decode:y,encode:b},decode:_,encode:E,toASCII:function(e){return v(e,(function(e){return l.test(e)?"xn--"+E(e):e}))},toUnicode:function(e){return v(e,(function(e){return u.test(e)?_(e.slice(4).toLowerCase()):e}))}},void 0===(r=function(){return a}.call(t,n,t,e))||(e.exports=r)}()},8575:(e,t,n)=>{"use strict";var r=n(2511),i=n(2502);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(u),d=["%","/","?",";","#"].concat(l),p=["/","?","#"],f=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=n(7673);o.prototype.parse=function(e,t,n){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),s=-1!==o&&o<e.indexOf("#")?"?":"#",u=e.split(s);u[0]=u[0].replace(/\\/g,"/");var b=e=u.join(s);if(b=b.trim(),!n&&1===e.split("#").length){var w=c.exec(b);if(w)return this.path=b,this.href=b,this.pathname=w[1],w[2]?(this.search=w[2],this.query=t?y.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var x=a.exec(b);if(x){var _=(x=x[0]).toLowerCase();this.protocol=_,b=b.substr(x.length)}if(n||x||b.match(/^\/\/[^@\/]+@[^@\/]+/)){var E="//"===b.substr(0,2);!E||x&&g[x]||(b=b.substr(2),this.slashes=!0)}if(!g[x]&&(E||x&&!v[x])){for(var k,S,C=-1,A=0;A<p.length;A++)-1!==(T=b.indexOf(p[A]))&&(-1===C||T<C)&&(C=T);for(-1!==(S=-1===C?b.lastIndexOf("@"):b.lastIndexOf("@",C))&&(k=b.slice(0,S),b=b.slice(S+1),this.auth=decodeURIComponent(k)),C=-1,A=0;A<d.length;A++){var T;-1!==(T=b.indexOf(d[A]))&&(-1===C||T<C)&&(C=T)}-1===C&&(C=b.length),this.host=b.slice(0,C),b=b.slice(C),this.parseHost(),this.hostname=this.hostname||"";var O="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!O)for(var P=this.hostname.split(/\./),I=(A=0,P.length);A<I;A++){var j=P[A];if(j&&!j.match(f)){for(var N="",F=0,R=j.length;F<R;F++)j.charCodeAt(F)>127?N+="x":N+=j[F];if(!N.match(f)){var L=P.slice(0,A),D=P.slice(A+1),M=j.match(h);M&&(L.push(M[1]),D.unshift(M[2])),D.length&&(b="/"+D.join(".")+b),this.hostname=L.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),O||(this.hostname=r.toASCII(this.hostname));var U=this.port?":"+this.port:"",B=this.hostname||"";this.host=B+U,this.href+=this.host,O&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!m[_])for(A=0,I=l.length;A<I;A++){var H=l[A];if(-1!==b.indexOf(H)){var q=encodeURIComponent(H);q===H&&(q=escape(H)),b=b.split(H).join(q)}}var W=b.indexOf("#");-1!==W&&(this.hash=b.substr(W),b=b.slice(0,W));var K=b.indexOf("?");if(-1!==K?(this.search=b.substr(K),this.query=b.substr(K+1),t&&(this.query=y.parse(this.query)),b=b.slice(0,K)):t&&(this.search="",this.query={}),b&&(this.pathname=b),v[_]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){U=this.pathname||"";var V=this.search||"";this.path=U+V}return this.href=this.format(),this},o.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",o=!1,a="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(a=y.stringify(this.query));var s=this.search||a&&"?"+a||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||v[t])&&!1!==o?(o="//"+(o||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):o||(o=""),r&&"#"!==r.charAt(0)&&(r="#"+r),s&&"?"!==s.charAt(0)&&(s="?"+s),t+o+(n=n.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(s=s.replace("#","%23"))+r},o.prototype.resolve=function(e){return this.resolveObject(function(e,t,n){if(e&&i.isObject(e)&&e instanceof o)return e;var r=new o;return r.parse(e,t,n),r}(e,!1,!0)).format()},o.prototype.resolveObject=function(e){if(i.isString(e)){var t=new o;t.parse(e,!1,!0),e=t}for(var n=new o,r=Object.keys(this),a=0;a<r.length;a++){var s=r[a];n[s]=this[s]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var c=Object.keys(e),u=0;u<c.length;u++){var l=c[u];"protocol"!==l&&(n[l]=e[l])}return v[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!v[e.protocol]){for(var d=Object.keys(e),p=0;p<d.length;p++){var f=d[p];n[f]=e[f]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||g[e.protocol])n.pathname=e.pathname;else{for(var h=(e.pathname||"").split("/");h.length&&!(e.host=h.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==h[0]&&h.unshift(""),h.length<2&&h.unshift(""),n.pathname=h.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var m=n.pathname||"",y=n.search||"";n.path=m+y}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var b=n.pathname&&"/"===n.pathname.charAt(0),w=e.host||e.pathname&&"/"===e.pathname.charAt(0),x=w||b||n.host&&e.pathname,_=x,E=n.pathname&&n.pathname.split("/")||[],k=(h=e.pathname&&e.pathname.split("/")||[],n.protocol&&!v[n.protocol]);if(k&&(n.hostname="",n.port=null,n.host&&(""===E[0]?E[0]=n.host:E.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===h[0]?h[0]=e.host:h.unshift(e.host)),e.host=null),x=x&&(""===h[0]||""===E[0])),w)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,E=h;else if(h.length)E||(E=[]),E.pop(),E=E.concat(h),n.search=e.search,n.query=e.query;else if(!i.isNullOrUndefined(e.search))return k&&(n.hostname=n.host=E.shift(),(O=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=O.shift(),n.host=n.hostname=O.shift())),n.search=e.search,n.query=e.query,i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!E.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var S=E.slice(-1)[0],C=(n.host||e.host||E.length>1)&&("."===S||".."===S)||""===S,A=0,T=E.length;T>=0;T--)"."===(S=E[T])?E.splice(T,1):".."===S?(E.splice(T,1),A++):A&&(E.splice(T,1),A--);if(!x&&!_)for(;A--;A)E.unshift("..");!x||""===E[0]||E[0]&&"/"===E[0].charAt(0)||E.unshift(""),C&&"/"!==E.join("/").substr(-1)&&E.push("");var O,P=""===E[0]||E[0]&&"/"===E[0].charAt(0);return k&&(n.hostname=n.host=P?"":E.length?E.shift():"",(O=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=O.shift(),n.host=n.hostname=O.shift())),(x=x||n.host&&E.length)&&!P&&E.unshift(""),E.length?n.pathname=E.join("/"):(n.pathname=null,n.path=null),i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},o.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},2502:e=>{"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},1614:(e,t,n)=>{"use strict";var r;n.r(t),n.d(t,{NIL:()=>P,parse:()=>g,stringify:()=>l,v1:()=>m,v3:()=>S,v4:()=>C,v5:()=>O,validate:()=>s,version:()=>I});var i=new Uint8Array(16);function o(){if(!r&&!(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(i)}const a=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,s=function(e){return"string"==typeof e&&a.test(e)};for(var c=[],u=0;u<256;++u)c.push((u+256).toString(16).substr(1));const l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(c[e[t+0]]+c[e[t+1]]+c[e[t+2]]+c[e[t+3]]+"-"+c[e[t+4]]+c[e[t+5]]+"-"+c[e[t+6]]+c[e[t+7]]+"-"+c[e[t+8]]+c[e[t+9]]+"-"+c[e[t+10]]+c[e[t+11]]+c[e[t+12]]+c[e[t+13]]+c[e[t+14]]+c[e[t+15]]).toLowerCase();if(!s(n))throw TypeError("Stringified UUID is invalid");return n};var d,p,f=0,h=0;const m=function(e,t,n){var r=t&&n||0,i=t||new Array(16),a=(e=e||{}).node||d,s=void 0!==e.clockseq?e.clockseq:p;if(null==a||null==s){var c=e.random||(e.rng||o)();null==a&&(a=d=[1|c[0],c[1],c[2],c[3],c[4],c[5]]),null==s&&(s=p=16383&(c[6]<<8|c[7]))}var u=void 0!==e.msecs?e.msecs:Date.now(),m=void 0!==e.nsecs?e.nsecs:h+1,g=u-f+(m-h)/1e4;if(g<0&&void 0===e.clockseq&&(s=s+1&16383),(g<0||u>f)&&void 0===e.nsecs&&(m=0),m>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");f=u,h=m,p=s;var v=(1e4*(268435455&(u+=122192928e5))+m)%4294967296;i[r++]=v>>>24&255,i[r++]=v>>>16&255,i[r++]=v>>>8&255,i[r++]=255&v;var y=u/4294967296*1e4&268435455;i[r++]=y>>>8&255,i[r++]=255&y,i[r++]=y>>>24&15|16,i[r++]=y>>>16&255,i[r++]=s>>>8|128,i[r++]=255&s;for(var b=0;b<6;++b)i[r+b]=a[b];return t||l(i)},g=function(e){if(!s(e))throw TypeError("Invalid UUID");var t,n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n};function v(e,t,n){function r(e,r,i,o){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}(e)),"string"==typeof r&&(r=g(r)),16!==r.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var a=new Uint8Array(16+e.length);if(a.set(r),a.set(e,r.length),(a=n(a))[6]=15&a[6]|t,a[8]=63&a[8]|128,i){o=o||0;for(var s=0;s<16;++s)i[o+s]=a[s];return i}return l(a)}try{r.name=e}catch(e){}return r.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",r.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",r}function y(e){return 14+(e+64>>>9<<4)+1}function b(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function w(e,t,n,r,i,o){return b((a=b(b(t,e),b(r,o)))<<(s=i)|a>>>32-s,n);var a,s}function x(e,t,n,r,i,o,a){return w(t&n|~t&r,e,t,i,o,a)}function _(e,t,n,r,i,o,a){return w(t&r|n&~r,e,t,i,o,a)}function E(e,t,n,r,i,o,a){return w(t^n^r,e,t,i,o,a)}function k(e,t,n,r,i,o,a){return w(n^(t|~r),e,t,i,o,a)}const S=v("v3",48,(function(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}return function(e){for(var t=[],n=32*e.length,r="0123456789abcdef",i=0;i<n;i+=8){var o=e[i>>5]>>>i%32&255,a=parseInt(r.charAt(o>>>4&15)+r.charAt(15&o),16);t.push(a)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[y(t)-1]=t;for(var n=1732584193,r=-271733879,i=-1732584194,o=271733878,a=0;a<e.length;a+=16){var s=n,c=r,u=i,l=o;n=x(n,r,i,o,e[a],7,-680876936),o=x(o,n,r,i,e[a+1],12,-389564586),i=x(i,o,n,r,e[a+2],17,606105819),r=x(r,i,o,n,e[a+3],22,-1044525330),n=x(n,r,i,o,e[a+4],7,-176418897),o=x(o,n,r,i,e[a+5],12,1200080426),i=x(i,o,n,r,e[a+6],17,-1473231341),r=x(r,i,o,n,e[a+7],22,-45705983),n=x(n,r,i,o,e[a+8],7,1770035416),o=x(o,n,r,i,e[a+9],12,-1958414417),i=x(i,o,n,r,e[a+10],17,-42063),r=x(r,i,o,n,e[a+11],22,-1990404162),n=x(n,r,i,o,e[a+12],7,1804603682),o=x(o,n,r,i,e[a+13],12,-40341101),i=x(i,o,n,r,e[a+14],17,-1502002290),n=_(n,r=x(r,i,o,n,e[a+15],22,1236535329),i,o,e[a+1],5,-165796510),o=_(o,n,r,i,e[a+6],9,-1069501632),i=_(i,o,n,r,e[a+11],14,643717713),r=_(r,i,o,n,e[a],20,-373897302),n=_(n,r,i,o,e[a+5],5,-701558691),o=_(o,n,r,i,e[a+10],9,38016083),i=_(i,o,n,r,e[a+15],14,-660478335),r=_(r,i,o,n,e[a+4],20,-405537848),n=_(n,r,i,o,e[a+9],5,568446438),o=_(o,n,r,i,e[a+14],9,-1019803690),i=_(i,o,n,r,e[a+3],14,-187363961),r=_(r,i,o,n,e[a+8],20,1163531501),n=_(n,r,i,o,e[a+13],5,-1444681467),o=_(o,n,r,i,e[a+2],9,-51403784),i=_(i,o,n,r,e[a+7],14,1735328473),n=E(n,r=_(r,i,o,n,e[a+12],20,-1926607734),i,o,e[a+5],4,-378558),o=E(o,n,r,i,e[a+8],11,-2022574463),i=E(i,o,n,r,e[a+11],16,1839030562),r=E(r,i,o,n,e[a+14],23,-35309556),n=E(n,r,i,o,e[a+1],4,-1530992060),o=E(o,n,r,i,e[a+4],11,1272893353),i=E(i,o,n,r,e[a+7],16,-155497632),r=E(r,i,o,n,e[a+10],23,-1094730640),n=E(n,r,i,o,e[a+13],4,681279174),o=E(o,n,r,i,e[a],11,-358537222),i=E(i,o,n,r,e[a+3],16,-722521979),r=E(r,i,o,n,e[a+6],23,76029189),n=E(n,r,i,o,e[a+9],4,-640364487),o=E(o,n,r,i,e[a+12],11,-421815835),i=E(i,o,n,r,e[a+15],16,530742520),n=k(n,r=E(r,i,o,n,e[a+2],23,-995338651),i,o,e[a],6,-198630844),o=k(o,n,r,i,e[a+7],10,1126891415),i=k(i,o,n,r,e[a+14],15,-1416354905),r=k(r,i,o,n,e[a+5],21,-57434055),n=k(n,r,i,o,e[a+12],6,1700485571),o=k(o,n,r,i,e[a+3],10,-1894986606),i=k(i,o,n,r,e[a+10],15,-1051523),r=k(r,i,o,n,e[a+1],21,-2054922799),n=k(n,r,i,o,e[a+8],6,1873313359),o=k(o,n,r,i,e[a+15],10,-30611744),i=k(i,o,n,r,e[a+6],15,-1560198380),r=k(r,i,o,n,e[a+13],21,1309151649),n=k(n,r,i,o,e[a+4],6,-145523070),o=k(o,n,r,i,e[a+11],10,-1120210379),i=k(i,o,n,r,e[a+2],15,718787259),r=k(r,i,o,n,e[a+9],21,-343485551),n=b(n,s),r=b(r,c),i=b(i,u),o=b(o,l)}return[n,r,i,o]}(function(e){if(0===e.length)return[];for(var t=8*e.length,n=new Uint32Array(y(t)),r=0;r<t;r+=8)n[r>>5]|=(255&e[r/8])<<r%32;return n}(e),8*e.length))})),C=function(e,t,n){var r=(e=e||{}).random||(e.rng||o)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var i=0;i<16;++i)t[n+i]=r[i];return t}return l(r)};function A(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:case 3:return t^n^r;case 2:return t&n^t&r^n&r}}function T(e,t){return e<<t|e>>>32-t}const O=v("v5",80,(function(e){var t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){var r=unescape(encodeURIComponent(e));e=[];for(var i=0;i<r.length;++i)e.push(r.charCodeAt(i))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var o=e.length/4+2,a=Math.ceil(o/16),s=new Array(a),c=0;c<a;++c){for(var u=new Uint32Array(16),l=0;l<16;++l)u[l]=e[64*c+4*l]<<24|e[64*c+4*l+1]<<16|e[64*c+4*l+2]<<8|e[64*c+4*l+3];s[c]=u}s[a-1][14]=8*(e.length-1)/Math.pow(2,32),s[a-1][14]=Math.floor(s[a-1][14]),s[a-1][15]=8*(e.length-1)&4294967295;for(var d=0;d<a;++d){for(var p=new Uint32Array(80),f=0;f<16;++f)p[f]=s[d][f];for(var h=16;h<80;++h)p[h]=T(p[h-3]^p[h-8]^p[h-14]^p[h-16],1);for(var m=n[0],g=n[1],v=n[2],y=n[3],b=n[4],w=0;w<80;++w){var x=Math.floor(w/20),_=T(m,5)+A(x,g,v,y)+b+t[x]+p[w]>>>0;b=y,y=v,v=T(g,30)>>>0,g=m,m=_}n[0]=n[0]+m>>>0,n[1]=n[1]+g>>>0,n[2]=n[2]+v>>>0,n[3]=n[3]+y>>>0,n[4]=n[4]+b>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]})),P="00000000-0000-0000-0000-000000000000",I=function(e){if(!s(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}},9602:e=>{"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},4411:(e,t,n)=>{"use strict";function r(e){var t=this;if(t instanceof r||(t=new r),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var n=0,i=arguments.length;n<i;n++)t.push(arguments[n]);return t}function i(e,t,n){var r=t===e.head?new s(n,null,t,e):new s(n,t,t.next,e);return null===r.next&&(e.tail=r),null===r.prev&&(e.head=r),e.length++,r}function o(e,t){e.tail=new s(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function a(e,t){e.head=new s(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function s(e,t,n,r){if(!(this instanceof s))return new s(e,t,n,r);this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}e.exports=r,r.Node=s,r.create=r,r.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t},r.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},r.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},r.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)o(this,arguments[e]);return this.length},r.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)a(this,arguments[e]);return this.length},r.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},r.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},r.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,r=0;null!==n;r++)e.call(t,n.value,r,this),n=n.next},r.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,r=this.length-1;null!==n;r--)e.call(t,n.value,r,this),n=n.prev},r.prototype.get=function(e){for(var t=0,n=this.head;null!==n&&t<e;t++)n=n.next;if(t===e&&null!==n)return n.value},r.prototype.getReverse=function(e){for(var t=0,n=this.tail;null!==n&&t<e;t++)n=n.prev;if(t===e&&null!==n)return n.value},r.prototype.map=function(e,t){t=t||this;for(var n=new r,i=this.head;null!==i;)n.push(e.call(t,i.value,this)),i=i.next;return n},r.prototype.mapReverse=function(e,t){t=t||this;for(var n=new r,i=this.tail;null!==i;)n.push(e.call(t,i.value,this)),i=i.prev;return n},r.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=e(n,r.value,i),r=r.next;return n},r.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=e(n,r.value,i),r=r.prev;return n},r.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},r.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},r.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new r;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=0,o=this.head;null!==o&&i<e;i++)o=o.next;for(;null!==o&&i<t;i++,o=o.next)n.push(o.value);return n},r.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new r;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=this.length,o=this.tail;null!==o&&i>t;i--)o=o.prev;for(;null!==o&&i>e;i--,o=o.prev)n.push(o.value);return n},r.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,o=this.head;null!==o&&r<e;r++)o=o.next;var a=[];for(r=0;o&&r<t;r++)a.push(o.value),o=this.removeNode(o);for(null===o&&(o=this.tail),o!==this.head&&o!==this.tail&&(o=o.prev),r=0;r<n.length;r++)o=i(this,o,n[r]);return a},r.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;null!==n;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this};try{n(9602)(r)}catch(e){}},9421:()=>{},7670:()=>{},3897:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.__esModule=!0,e.exports.default=e.exports},5372:e=>{e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},3405:(e,t,n)=>{var r=n(3897);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.__esModule=!0,e.exports.default=e.exports},6115:e=>{e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},7156:e=>{function t(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}e.exports=function(e){return function(){var n=this,r=arguments;return new Promise((function(i,o){var a=e.apply(n,r);function s(e){t(a,i,o,s,c,"next",e)}function c(e){t(a,i,o,s,c,"throw",e)}s(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},6690:e=>{e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},3515:(e,t,n)=>{var r=n(6015),i=n(9617);function o(t,n,a){return i()?(e.exports=o=Reflect.construct.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=o=function(e,t,n){var i=[null];i.push.apply(i,t);var o=new(Function.bind.apply(e,i));return n&&r(o,n.prototype),o},e.exports.__esModule=!0,e.exports.default=e.exports),o.apply(null,arguments)}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},9728:(e,t,n)=>{var r=n(4062);function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}e.exports=function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},8416:(e,t,n)=>{var r=n(4062);e.exports=function(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},3808:e=>{function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},1655:(e,t,n)=>{var r=n(6015);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},4836:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},6035:e=>{e.exports=function(e){return-1!==Function.toString.call(e).indexOf("[native code]")},e.exports.__esModule=!0,e.exports.default=e.exports},9617:e=>{e.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}},e.exports.__esModule=!0,e.exports.default=e.exports},9498:e=>{e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},8872:e=>{e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}},e.exports.__esModule=!0,e.exports.default=e.exports},2218:e=>{e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},2281:e=>{e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},4993:(e,t,n)=>{var r=n(8698).default,i=n(6115);e.exports=function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return i(e)},e.exports.__esModule=!0,e.exports.default=e.exports},7061:(e,t,n)=>{var r=n(8698).default;function i(){"use strict";e.exports=i=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},n=Object.prototype,o=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},c=s.iterator||"@@iterator",u=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function d(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,n){return e[t]=n}}function p(e,t,n,r){var i=t&&t.prototype instanceof m?t:m,o=Object.create(i.prototype),s=new T(r||[]);return a(o,"_invoke",{value:k(e,n,s)}),o}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var h={};function m(){}function g(){}function v(){}var y={};d(y,c,(function(){return this}));var b=Object.getPrototypeOf,w=b&&b(b(O([])));w&&w!==n&&o.call(w,c)&&(y=w);var x=v.prototype=m.prototype=Object.create(y);function _(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function n(i,a,s,c){var u=f(e[i],e,a);if("throw"!==u.type){var l=u.arg,d=l.value;return d&&"object"==r(d)&&o.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,s,c)}),(function(e){n("throw",e,s,c)})):t.resolve(d).then((function(e){l.value=e,s(l)}),(function(e){return n("throw",e,s,c)}))}c(u.arg)}var i;a(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}})}function k(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=S(a,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=f(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===h)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}function S(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var i=f(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function O(e){if(e){var t=e[c];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(o.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:P}}function P(){return{value:void 0,done:!0}}return g.prototype=v,a(x,"constructor",{value:v,configurable:!0}),a(v,"constructor",{value:g,configurable:!0}),g.displayName=d(v,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,d(e,l,"GeneratorFunction")),e.prototype=Object.create(x),e},t.awrap=function(e){return{__await:e}},_(E.prototype),d(E.prototype,u,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new E(p(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},_(x),d(x,l,"Generator"),d(x,c,(function(){return this})),d(x,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=O,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(A),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),c=o.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),A(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;A(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:O(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},6015:e=>{function t(n,r){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},7424:(e,t,n)=>{var r=n(5372),i=n(8872),o=n(6116),a=n(2218);e.exports=function(e,t){return r(e)||i(e,t)||o(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},9400:e=>{e.exports=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))},e.exports.__esModule=!0,e.exports.default=e.exports},861:(e,t,n)=>{var r=n(3405),i=n(9498),o=n(6116),a=n(2281);e.exports=function(e){return r(e)||i(e)||o(e)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},5036:(e,t,n)=>{var r=n(8698).default;e.exports=function(e,t){if("object"!==r(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},4062:(e,t,n)=>{var r=n(8698).default,i=n(5036);e.exports=function(e){var t=i(e,"string");return"symbol"===r(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},8698:e=>{function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},6116:(e,t,n)=>{var r=n(3897);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},3496:(e,t,n)=>{var r=n(3808),i=n(6015),o=n(6035),a=n(3515);function s(t){var n="function"==typeof Map?new Map:void 0;return e.exports=s=function(e){if(null===e||!o(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return a(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),i(t,e)},e.exports.__esModule=!0,e.exports.default=e.exports,s(t)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports},4687:(e,t,n)=>{var r=n(7061)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},7326:(e,t,n)=>{"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,{Z:()=>r})},5671:(e,t,n)=>{"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,{Z:()=>r})},3144:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(9142);function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(0,r.Z)(i.key),i)}}function o(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}},4942:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(9142);function i(e,t,n){return(t=(0,r.Z)(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},7462:(e,t,n)=>{"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}n.d(t,{Z:()=>r})},1120:(e,t,n)=>{"use strict";function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}n.d(t,{Z:()=>r})},136:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(9611);function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&(0,r.Z)(e,t)}},2963:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(1002),i=n(7326);function o(e,t){if(t&&("object"===(0,r.Z)(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return(0,i.Z)(e)}},9611:(e,t,n)=>{"use strict";function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}n.d(t,{Z:()=>r})},9142:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(1002);function i(e){var t=function(e,t){if("object"!==(0,r.Z)(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!==(0,r.Z)(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===(0,r.Z)(t)?t:String(t)}},1002:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{Z:()=>r})},7289:(e,t,n)=>{"use strict";n.r(t),n.d(t,{CompactEncrypt:()=>et,CompactSign:()=>nt,EmbeddedJWK:()=>dt,EncryptJWT:()=>st,FlattenedEncrypt:()=>Ue,FlattenedSign:()=>tt,GeneralEncrypt:()=>He,GeneralSign:()=>it,SignJWT:()=>at,UnsecuredJWT:()=>bt,base64url:()=>i,calculateJwkThumbprint:()=>ut,calculateJwkThumbprintUri:()=>lt,compactDecrypt:()=>je,compactVerify:()=>Ve,createLocalJWKSet:()=>gt,createRemoteJWKSet:()=>yt,decodeJwt:()=>Et,decodeProtectedHeader:()=>_t,errors:()=>r,exportJWK:()=>Le,exportPKCS8:()=>Re,exportSPKI:()=>Fe,flattenedDecrypt:()=>Ie,flattenedVerify:()=>Ke,generalDecrypt:()=>Ne,generalVerify:()=>Je,generateKeyPair:()=>St,generateSecret:()=>Ct,importJWK:()=>Ce,importPKCS8:()=>Se,importSPKI:()=>Ee,importX509:()=>ke,jwtDecrypt:()=>Ye,jwtVerify:()=>Qe});var r={};n.r(r),n.d(r,{JOSEAlgNotAllowed:()=>E,JOSEError:()=>w,JOSENotSupported:()=>k,JWEDecryptionFailed:()=>S,JWEInvalid:()=>C,JWKInvalid:()=>O,JWKSInvalid:()=>P,JWKSMultipleMatchingKeys:()=>j,JWKSNoMatchingKey:()=>I,JWKSTimeout:()=>N,JWSInvalid:()=>A,JWSSignatureVerificationFailed:()=>F,JWTClaimValidationFailed:()=>x,JWTExpired:()=>_,JWTInvalid:()=>T});var i={};n.r(i),n.d(i,{decode:()=>xt,encode:()=>wt});const o=crypto,a=e=>e instanceof CryptoKey,s=async(e,t)=>{const n=`SHA-${e.slice(-3)}`;return new Uint8Array(await o.subtle.digest(n,t))},c=new TextEncoder,u=new TextDecoder,l=2**32;function d(...e){const t=e.reduce(((e,{length:t})=>e+t),0),n=new Uint8Array(t);let r=0;return e.forEach((e=>{n.set(e,r),r+=e.length})),n}function p(e,t,n){if(t<0||t>=l)throw new RangeError(`value must be >= 0 and <= 4294967295. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,255&t],n)}function f(e){const t=Math.floor(e/l),n=e%l,r=new Uint8Array(8);return p(r,t,0),p(r,n,4),r}function h(e){const t=new Uint8Array(4);return p(t,e),t}function m(e){return d(h(e.length),e)}const g=e=>{let t=e;"string"==typeof t&&(t=c.encode(t));const n=[];for(let e=0;e<t.length;e+=32768)n.push(String.fromCharCode.apply(null,t.subarray(e,e+32768)));return btoa(n.join(""))},v=e=>g(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),y=e=>{const t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n},b=e=>{let t=e;t instanceof Uint8Array&&(t=u.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return y(t)}catch(e){throw new TypeError("The input to be decoded is not correctly encoded.")}};class w extends Error{static get code(){return"ERR_JOSE_GENERIC"}constructor(e){var t;super(e),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,null===(t=Error.captureStackTrace)||void 0===t||t.call(Error,this,this.constructor)}}class x extends w{static get code(){return"ERR_JWT_CLAIM_VALIDATION_FAILED"}constructor(e,t="unspecified",n="unspecified"){super(e),this.code="ERR_JWT_CLAIM_VALIDATION_FAILED",this.claim=t,this.reason=n}}class _ extends w{static get code(){return"ERR_JWT_EXPIRED"}constructor(e,t="unspecified",n="unspecified"){super(e),this.code="ERR_JWT_EXPIRED",this.claim=t,this.reason=n}}class E extends w{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}static get code(){return"ERR_JOSE_ALG_NOT_ALLOWED"}}class k extends w{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}static get code(){return"ERR_JOSE_NOT_SUPPORTED"}}class S extends w{constructor(){super(...arguments),this.code="ERR_JWE_DECRYPTION_FAILED",this.message="decryption operation failed"}static get code(){return"ERR_JWE_DECRYPTION_FAILED"}}class C extends w{constructor(){super(...arguments),this.code="ERR_JWE_INVALID"}static get code(){return"ERR_JWE_INVALID"}}class A extends w{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}static get code(){return"ERR_JWS_INVALID"}}class T extends w{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}static get code(){return"ERR_JWT_INVALID"}}class O extends w{constructor(){super(...arguments),this.code="ERR_JWK_INVALID"}static get code(){return"ERR_JWK_INVALID"}}class P extends w{constructor(){super(...arguments),this.code="ERR_JWKS_INVALID"}static get code(){return"ERR_JWKS_INVALID"}}class I extends w{constructor(){super(...arguments),this.code="ERR_JWKS_NO_MATCHING_KEY",this.message="no applicable key found in the JSON Web Key Set"}static get code(){return"ERR_JWKS_NO_MATCHING_KEY"}}class j extends w{constructor(){super(...arguments),this.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS",this.message="multiple matching keys found in the JSON Web Key Set"}static get code(){return"ERR_JWKS_MULTIPLE_MATCHING_KEYS"}}Symbol.asyncIterator;class N extends w{constructor(){super(...arguments),this.code="ERR_JWKS_TIMEOUT",this.message="request timed out"}static get code(){return"ERR_JWKS_TIMEOUT"}}class F extends w{constructor(){super(...arguments),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED",this.message="signature verification failed"}static get code(){return"ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}}const R=o.getRandomValues.bind(o);function L(e){switch(e){case"A128GCM":case"A128GCMKW":case"A192GCM":case"A192GCMKW":case"A256GCM":case"A256GCMKW":return 96;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return 128;default:throw new k(`Unsupported JWE Algorithm: ${e}`)}}const D=e=>R(new Uint8Array(L(e)>>3)),M=(e,t)=>{if(t.length<<3!==L(e))throw new C("Invalid Initialization Vector length")},U=(e,t)=>{const n=e.byteLength<<3;if(n!==t)throw new C(`Invalid Content Encryption Key length. Expected ${t} bits, got ${n} bits`)};function B(){return"undefined"!=typeof WebSocketPair||"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"undefined"!=typeof EdgeRuntime&&"vercel"===EdgeRuntime}function H(e,t="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function q(e,t){return e.name===t}function W(e){return parseInt(e.name.slice(4),10)}function K(e,t){if(t.length&&!t.some((t=>e.usages.includes(t)))){let e="CryptoKey does not support this operation, its usages must include ";if(t.length>2){const n=t.pop();e+=`one of ${t.join(", ")}, or ${n}.`}else 2===t.length?e+=`one of ${t[0]} or ${t[1]}.`:e+=`${t[0]}.`;throw new TypeError(e)}}function V(e,t,...n){switch(t){case"A128GCM":case"A192GCM":case"A256GCM":{if(!q(e.algorithm,"AES-GCM"))throw H("AES-GCM");const n=parseInt(t.slice(1,4),10);if(e.algorithm.length!==n)throw H(n,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!q(e.algorithm,"AES-KW"))throw H("AES-KW");const n=parseInt(t.slice(1,4),10);if(e.algorithm.length!==n)throw H(n,"algorithm.length");break}case"ECDH":switch(e.algorithm.name){case"ECDH":case"X25519":case"X448":break;default:throw H("ECDH, X25519, or X448")}break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!q(e.algorithm,"PBKDF2"))throw H("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!q(e.algorithm,"RSA-OAEP"))throw H("RSA-OAEP");const n=parseInt(t.slice(9),10)||1;if(W(e.algorithm.hash)!==n)throw H(`SHA-${n}`,"algorithm.hash");break}default:throw new TypeError("CryptoKey does not support this operation")}K(e,n)}function J(e,t,...n){if(n.length>2){const t=n.pop();e+=`one of type ${n.join(", ")}, or ${t}.`}else 2===n.length?e+=`one of type ${n[0]} or ${n[1]}.`:e+=`of type ${n[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor&&t.constructor.name&&(e+=` Received an instance of ${t.constructor.name}`),e}const z=(e,...t)=>J("Key must be ",e,...t);function Z(e,t,...n){return J(`Key for the ${e} algorithm must be `,t,...n)}const $=e=>a(e),G=["CryptoKey"],X=async(e,t,n,r,i,s)=>{if(!(a(t)||t instanceof Uint8Array))throw new TypeError(z(t,...G,"Uint8Array"));switch(M(e,r),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return t instanceof Uint8Array&&U(t,parseInt(e.slice(-3),10)),async function(e,t,n,r,i,a){if(!(t instanceof Uint8Array))throw new TypeError(z(t,"Uint8Array"));const s=parseInt(e.slice(1,4),10),c=await o.subtle.importKey("raw",t.subarray(s>>3),"AES-CBC",!1,["decrypt"]),u=await o.subtle.importKey("raw",t.subarray(0,s>>3),{hash:"SHA-"+(s<<1),name:"HMAC"},!1,["sign"]),l=d(a,r,n,f(a.length<<3)),p=new Uint8Array((await o.subtle.sign("HMAC",u,l)).slice(0,s>>3));let h,m;try{h=((e,t)=>{if(!(e instanceof Uint8Array))throw new TypeError("First argument must be a buffer");if(!(t instanceof Uint8Array))throw new TypeError("Second argument must be a buffer");if(e.length!==t.length)throw new TypeError("Input buffers must have the same length");const n=e.length;let r=0,i=-1;for(;++i<n;)r|=e[i]^t[i];return 0===r})(i,p)}catch(e){}if(!h)throw new S;try{m=new Uint8Array(await o.subtle.decrypt({iv:r,name:"AES-CBC"},c,n))}catch(e){}if(!m)throw new S;return m}(e,t,n,r,i,s);case"A128GCM":case"A192GCM":case"A256GCM":return t instanceof Uint8Array&&U(t,parseInt(e.slice(1,4),10)),async function(e,t,n,r,i,a){let s;t instanceof Uint8Array?s=await o.subtle.importKey("raw",t,"AES-GCM",!1,["decrypt"]):(V(t,e,"decrypt"),s=t);try{return new Uint8Array(await o.subtle.decrypt({additionalData:a,iv:r,name:"AES-GCM",tagLength:128},s,d(n,i)))}catch(e){throw new S}}(e,t,n,r,i,s);default:throw new k("Unsupported JWE Content Encryption Algorithm")}},Q=async()=>{throw new k('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime. You need to use the `inflateRaw` decrypt option to provide Inflate Raw implementation.')},Y=async()=>{throw new k('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime. You need to use the `deflateRaw` encrypt option to provide Deflate Raw implementation.')},ee=(...e)=>{const t=e.filter(Boolean);if(0===t.length||1===t.length)return!0;let n;for(const e of t){const t=Object.keys(e);if(n&&0!==n.size)for(const e of t){if(n.has(e))return!1;n.add(e)}else n=new Set(t)}return!0};function te(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let n=e;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n}const ne=[{hash:"SHA-256",name:"HMAC"},!0,["sign"]];function re(e,t){if(e.algorithm.length!==parseInt(t.slice(1,4),10))throw new TypeError(`Invalid key size for alg: ${t}`)}function ie(e,t,n){if(a(e))return V(e,t,n),e;if(e instanceof Uint8Array)return o.subtle.importKey("raw",e,"AES-KW",!0,[n]);throw new TypeError(z(e,...G,"Uint8Array"))}const oe=async(e,t,n)=>{const r=await ie(t,e,"wrapKey");re(r,e);const i=await o.subtle.importKey("raw",n,...ne);return new Uint8Array(await o.subtle.wrapKey("raw",i,r,"AES-KW"))},ae=async(e,t,n)=>{const r=await ie(t,e,"unwrapKey");re(r,e);const i=await o.subtle.unwrapKey("raw",n,r,"AES-KW",...ne);return new Uint8Array(await o.subtle.exportKey("raw",i))};async function se(e,t,n,r,i=new Uint8Array(0),u=new Uint8Array(0)){if(!a(e))throw new TypeError(z(e,...G));if(V(e,"ECDH"),!a(t))throw new TypeError(z(t,...G));V(t,"ECDH","deriveBits");const l=d(m(c.encode(n)),m(i),m(u),h(r));let p;return p="X25519"===e.algorithm.name?256:"X448"===e.algorithm.name?448:Math.ceil(parseInt(e.algorithm.namedCurve.substr(-3),10)/8)<<3,async function(e,t,n){const r=Math.ceil((t>>3)/32),i=new Uint8Array(32*r);for(let t=0;t<r;t++){const r=new Uint8Array(4+e.length+n.length);r.set(h(t+1)),r.set(e,4),r.set(n,4+e.length),i.set(await s("sha256",r),32*t)}return i.slice(0,t>>3)}(new Uint8Array(await o.subtle.deriveBits({name:e.algorithm.name,public:e},t,p)),r,l)}function ce(e){if(!a(e))throw new TypeError(z(e,...G));return["P-256","P-384","P-521"].includes(e.algorithm.namedCurve)||"X25519"===e.algorithm.name||"X448"===e.algorithm.name}async function ue(e,t,n,r){!function(e){if(!(e instanceof Uint8Array)||e.length<8)throw new C("PBES2 Salt Input must be 8 or more octets")}(e);const i=function(e,t){return d(c.encode(e),new Uint8Array([0]),t)}(t,e),s=parseInt(t.slice(13,16),10),u={hash:`SHA-${t.slice(8,11)}`,iterations:n,name:"PBKDF2",salt:i},l={length:s,name:"AES-KW"},p=await function(e,t){if(e instanceof Uint8Array)return o.subtle.importKey("raw",e,"PBKDF2",!1,["deriveBits"]);if(a(e))return V(e,t,"deriveBits","deriveKey"),e;throw new TypeError(z(e,...G,"Uint8Array"))}(r,t);if(p.usages.includes("deriveBits"))return new Uint8Array(await o.subtle.deriveBits(u,p,s));if(p.usages.includes("deriveKey"))return o.subtle.deriveKey(u,p,l,!1,["wrapKey","unwrapKey"]);throw new TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"')}function le(e){switch(e){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new k(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}const de=(e,t)=>{if(e.startsWith("RS")||e.startsWith("PS")){const{modulusLength:n}=t.algorithm;if("number"!=typeof n||n<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}};function pe(e){switch(e){case"A128GCM":return 128;case"A192GCM":return 192;case"A256GCM":case"A128CBC-HS256":return 256;case"A192CBC-HS384":return 384;case"A256CBC-HS512":return 512;default:throw new k(`Unsupported JWE Algorithm: ${e}`)}}const fe=e=>R(new Uint8Array(pe(e)>>3)),he=(e,t)=>`-----BEGIN ${t}-----\n${(e.match(/.{1,64}/g)||[]).join("\n")}\n-----END ${t}-----`,me=async(e,t,n)=>{if(!a(n))throw new TypeError(z(n,...G));if(!n.extractable)throw new TypeError("CryptoKey is not extractable");if(n.type!==e)throw new TypeError(`key is not a ${e} key`);return he(g(new Uint8Array(await o.subtle.exportKey(t,n))),`${e.toUpperCase()} KEY`)},ge=(e,t,n=0)=>{0===n&&(t.unshift(t.length),t.unshift(6));let r=e.indexOf(t[0],n);if(-1===r)return!1;const i=e.subarray(r,r+t.length);return i.length===t.length&&(i.every(((e,n)=>e===t[n]))||ge(e,t,r+1))},ve=e=>{switch(!0){case ge(e,[42,134,72,206,61,3,1,7]):return"P-256";case ge(e,[43,129,4,0,34]):return"P-384";case ge(e,[43,129,4,0,35]):return"P-521";case ge(e,[43,101,110]):return"X25519";case ge(e,[43,101,111]):return"X448";case ge(e,[43,101,112]):return"Ed25519";case ge(e,[43,101,113]):return"Ed448";default:throw new k("Invalid or unsupported EC Key Curve or OKP Key Sub Type")}},ye=async(e,t,n,r,i)=>{var a,s;let c,u;const l=new Uint8Array(atob(n.replace(e,"")).split("").map((e=>e.charCodeAt(0)))),d="spki"===t;switch(r){case"PS256":case"PS384":case"PS512":c={name:"RSA-PSS",hash:`SHA-${r.slice(-3)}`},u=d?["verify"]:["sign"];break;case"RS256":case"RS384":case"RS512":c={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${r.slice(-3)}`},u=d?["verify"]:["sign"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":c={name:"RSA-OAEP",hash:`SHA-${parseInt(r.slice(-3),10)||1}`},u=d?["encrypt","wrapKey"]:["decrypt","unwrapKey"];break;case"ES256":c={name:"ECDSA",namedCurve:"P-256"},u=d?["verify"]:["sign"];break;case"ES384":c={name:"ECDSA",namedCurve:"P-384"},u=d?["verify"]:["sign"];break;case"ES512":c={name:"ECDSA",namedCurve:"P-521"},u=d?["verify"]:["sign"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{const e=ve(l);c=e.startsWith("P-")?{name:"ECDH",namedCurve:e}:{name:e},u=d?[]:["deriveBits"];break}case"EdDSA":c={name:ve(l)},u=d?["verify"]:["sign"];break;default:throw new k('Invalid or unsupported "alg" (Algorithm) value')}try{return await o.subtle.importKey(t,l,c,null!==(a=null==i?void 0:i.extractable)&&void 0!==a&&a,u)}catch(e){if("Ed25519"===c.name&&"NotSupportedError"===(null==e?void 0:e.name)&&B())return c={name:"NODE-ED25519",namedCurve:"NODE-ED25519"},await o.subtle.importKey(t,l,c,null!==(s=null==i?void 0:i.extractable)&&void 0!==s&&s,u);throw e}},be=(e,t,n)=>ye(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g,"spki",e,t,n);function we(e){let t=[],n=0;for(;n<e.length;){let r=xe(e.subarray(n));t.push(r),n+=r.byteLength}return t}function xe(e){let t=0,n=31&e[0];if(t++,31===n){for(n=0;e[t]>=128;)n=128*n+e[t]-128,t++;n=128*n+e[t]-128,t++}let r=0;if(e[t]<128)r=e[t],t++;else{if(128===r){for(r=0;0!==e[t+r]||0!==e[t+r+1];){if(r>e.byteLength)throw new TypeError("invalid indefinite form length");r++}const n=t+r+2;return{byteLength:n,contents:e.subarray(t,t+r),raw:e.subarray(0,n)}}{let n=127&e[t];t++,r=0;for(let i=0;i<n;i++)r=256*r+e[t],t++}}const i=t+r;return{byteLength:i,contents:e.subarray(t,i),raw:e.subarray(0,i)}}const _e=async e=>{var t,n;if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:r,keyUsages:i}=function(e){let t,n;switch(e.kty){case"oct":switch(e.alg){case"HS256":case"HS384":case"HS512":t={name:"HMAC",hash:`SHA-${e.alg.slice(-3)}`},n=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":throw new k(`${e.alg} keys cannot be imported as CryptoKey instances`);case"A128GCM":case"A192GCM":case"A256GCM":case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":t={name:"AES-GCM"},n=["encrypt","decrypt"];break;case"A128KW":case"A192KW":case"A256KW":t={name:"AES-KW"},n=["wrapKey","unwrapKey"];break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":t={name:"PBKDF2"},n=["deriveBits"];break;default:throw new k('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},n=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},n=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},n=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new k('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},n=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},n=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},n=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},n=e.d?["deriveBits"]:[];break;default:throw new k('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"OKP":switch(e.alg){case"EdDSA":t={name:e.crv},n=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},n=e.d?["deriveBits"]:[];break;default:throw new k('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new k('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:n}}(e),a=[r,null!==(t=e.ext)&&void 0!==t&&t,null!==(n=e.key_ops)&&void 0!==n?n:i];if("PBKDF2"===r.name)return o.subtle.importKey("raw",b(e.k),...a);const s={...e};delete s.alg,delete s.use;try{return await o.subtle.importKey("jwk",s,...a)}catch(e){if("Ed25519"===r.name&&"NotSupportedError"===(null==e?void 0:e.name)&&B())return a[0]={name:"NODE-ED25519",namedCurve:"NODE-ED25519"},await o.subtle.importKey("jwk",s,...a);throw e}};async function Ee(e,t,n){if("string"!=typeof e||0!==e.indexOf("-----BEGIN PUBLIC KEY-----"))throw new TypeError('"spki" must be SPKI formatted string');return be(e,t,n)}async function ke(e,t,n){if("string"!=typeof e||0!==e.indexOf("-----BEGIN CERTIFICATE-----"))throw new TypeError('"x509" must be X.509 formatted string');return((e,t,n)=>{let r;try{r=function(e){const t=e.replace(/(?:-----(?:BEGIN|END) CERTIFICATE-----|\s)/g,""),n=y(t);return he(function(e){const t=we(we(xe(e).contents)[0].contents);return g(t[160===t[0].raw[0]?6:5].raw)}(n),"PUBLIC KEY")}(e)}catch(e){throw new TypeError("failed to parse the X.509 certificate",{cause:e})}return be(r,t,n)})(e,t,n)}async function Se(e,t,n){if("string"!=typeof e||0!==e.indexOf("-----BEGIN PRIVATE KEY-----"))throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return((e,t,n)=>ye(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,"pkcs8",e,t,n))(e,t,n)}async function Ce(e,t,n){var r;if(!te(e))throw new TypeError("JWK must be an object");switch(t||(t=e.alg),e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return null!=n||(n=!0!==e.ext),n?_e({...e,alg:t,ext:null!==(r=e.ext)&&void 0!==r&&r}):b(e.k);case"RSA":if(void 0!==e.oth)throw new k('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return _e({...e,alg:t});default:throw new k('Unsupported "kty" (Key Type) Parameter value')}}const Ae=(e,t,n)=>{e.startsWith("HS")||"dir"===e||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e)?((e,t)=>{if(!(t instanceof Uint8Array)){if(!$(t))throw new TypeError(Z(e,t,...G,"Uint8Array"));if("secret"!==t.type)throw new TypeError(`${G.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}})(e,t):((e,t,n)=>{if(!$(t))throw new TypeError(Z(e,t,...G));if("secret"===t.type)throw new TypeError(`${G.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===n&&"public"===t.type)throw new TypeError(`${G.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===n&&"public"===t.type)throw new TypeError(`${G.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&"verify"===n&&"private"===t.type)throw new TypeError(`${G.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&"encrypt"===n&&"private"===t.type)throw new TypeError(`${G.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)})(e,t,n)},Te=async(e,t,n,r,i)=>{if(!(a(n)||n instanceof Uint8Array))throw new TypeError(z(n,...G,"Uint8Array"));switch(M(e,r),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return n instanceof Uint8Array&&U(n,parseInt(e.slice(-3),10)),async function(e,t,n,r,i){if(!(n instanceof Uint8Array))throw new TypeError(z(n,"Uint8Array"));const a=parseInt(e.slice(1,4),10),s=await o.subtle.importKey("raw",n.subarray(a>>3),"AES-CBC",!1,["encrypt"]),c=await o.subtle.importKey("raw",n.subarray(0,a>>3),{hash:"SHA-"+(a<<1),name:"HMAC"},!1,["sign"]),u=new Uint8Array(await o.subtle.encrypt({iv:r,name:"AES-CBC"},s,t)),l=d(i,r,u,f(i.length<<3));return{ciphertext:u,tag:new Uint8Array((await o.subtle.sign("HMAC",c,l)).slice(0,a>>3))}}(e,t,n,r,i);case"A128GCM":case"A192GCM":case"A256GCM":return n instanceof Uint8Array&&U(n,parseInt(e.slice(1,4),10)),async function(e,t,n,r,i){let a;n instanceof Uint8Array?a=await o.subtle.importKey("raw",n,"AES-GCM",!1,["encrypt"]):(V(n,e,"encrypt"),a=n);const s=new Uint8Array(await o.subtle.encrypt({additionalData:i,iv:r,name:"AES-GCM",tagLength:128},a,t)),c=s.slice(-16);return{ciphertext:s.slice(0,-16),tag:c}}(e,t,n,r,i);default:throw new k("Unsupported JWE Content Encryption Algorithm")}},Oe=function(e,t,n,r,i){if(void 0!==i.crit&&void 0===r.crit)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!r||void 0===r.crit)return new Set;if(!Array.isArray(r.crit)||0===r.crit.length||r.crit.some((e=>"string"!=typeof e||0===e.length)))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let o;o=void 0!==n?new Map([...Object.entries(n),...t.entries()]):t;for(const t of r.crit){if(!o.has(t))throw new k(`Extension Header Parameter "${t}" is not recognized`);if(void 0===i[t])throw new e(`Extension Header Parameter "${t}" is missing`);if(o.get(t)&&void 0===r[t])throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return new Set(r.crit)},Pe=(e,t)=>{if(void 0!==t&&(!Array.isArray(t)||t.some((e=>"string"!=typeof e))))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)};async function Ie(e,t,n){var r;if(!te(e))throw new C("Flattened JWE must be an object");if(void 0===e.protected&&void 0===e.header&&void 0===e.unprotected)throw new C("JOSE Header missing");if("string"!=typeof e.iv)throw new C("JWE Initialization Vector missing or incorrect type");if("string"!=typeof e.ciphertext)throw new C("JWE Ciphertext missing or incorrect type");if("string"!=typeof e.tag)throw new C("JWE Authentication Tag missing or incorrect type");if(void 0!==e.protected&&"string"!=typeof e.protected)throw new C("JWE Protected Header incorrect type");if(void 0!==e.encrypted_key&&"string"!=typeof e.encrypted_key)throw new C("JWE Encrypted Key incorrect type");if(void 0!==e.aad&&"string"!=typeof e.aad)throw new C("JWE AAD incorrect type");if(void 0!==e.header&&!te(e.header))throw new C("JWE Shared Unprotected Header incorrect type");if(void 0!==e.unprotected&&!te(e.unprotected))throw new C("JWE Per-Recipient Unprotected Header incorrect type");let i;if(e.protected)try{const t=b(e.protected);i=JSON.parse(u.decode(t))}catch(e){throw new C("JWE Protected Header is invalid")}if(!ee(i,e.header,e.unprotected))throw new C("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");const s={...i,...e.header,...e.unprotected};if(Oe(C,new Map,null==n?void 0:n.crit,i,s),void 0!==s.zip){if(!i||!i.zip)throw new C('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==s.zip)throw new k('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:l,enc:p}=s;if("string"!=typeof l||!l)throw new C("missing JWE Algorithm (alg) in JWE Header");if("string"!=typeof p||!p)throw new C("missing JWE Encryption Algorithm (enc) in JWE Header");const f=n&&Pe("keyManagementAlgorithms",n.keyManagementAlgorithms),h=n&&Pe("contentEncryptionAlgorithms",n.contentEncryptionAlgorithms);if(f&&!f.has(l))throw new E('"alg" (Algorithm) Header Parameter not allowed');if(h&&!h.has(p))throw new E('"enc" (Encryption Algorithm) Header Parameter not allowed');let m;void 0!==e.encrypted_key&&(m=b(e.encrypted_key));let g,v=!1;"function"==typeof t&&(t=await t(i,e),v=!0);try{g=await async function(e,t,n,r,i){switch(Ae(e,t,"decrypt"),e){case"dir":if(void 0!==n)throw new C("Encountered unexpected JWE Encrypted Key");return t;case"ECDH-ES":if(void 0!==n)throw new C("Encountered unexpected JWE Encrypted Key");case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!te(r.epk))throw new C('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');if(!ce(t))throw new k("ECDH with the provided key is not allowed or not supported by your javascript runtime");const i=await Ce(r.epk,e);let o,a;if(void 0!==r.apu){if("string"!=typeof r.apu)throw new C('JOSE Header "apu" (Agreement PartyUInfo) invalid');o=b(r.apu)}if(void 0!==r.apv){if("string"!=typeof r.apv)throw new C('JOSE Header "apv" (Agreement PartyVInfo) invalid');a=b(r.apv)}const s=await se(i,t,"ECDH-ES"===e?r.enc:e,"ECDH-ES"===e?pe(r.enc):parseInt(e.slice(-5,-2),10),o,a);if("ECDH-ES"===e)return s;if(void 0===n)throw new C("JWE Encrypted Key missing");return ae(e.slice(-6),s,n)}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":if(void 0===n)throw new C("JWE Encrypted Key missing");return(async(e,t,n)=>{if(!a(t))throw new TypeError(z(t,...G));if(V(t,e,"decrypt","unwrapKey"),de(e,t),t.usages.includes("decrypt"))return new Uint8Array(await o.subtle.decrypt(le(e),t,n));if(t.usages.includes("unwrapKey")){const r=await o.subtle.unwrapKey("raw",n,t,le(e),...ne);return new Uint8Array(await o.subtle.exportKey("raw",r))}throw new TypeError('RSA-OAEP key "usages" must include "decrypt" or "unwrapKey" for this operation')})(e,t,n);case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{if(void 0===n)throw new C("JWE Encrypted Key missing");if("number"!=typeof r.p2c)throw new C('JOSE Header "p2c" (PBES2 Count) missing or invalid');const o=(null==i?void 0:i.maxPBES2Count)||1e4;if(r.p2c>o)throw new C('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');if("string"!=typeof r.p2s)throw new C('JOSE Header "p2s" (PBES2 Salt) missing or invalid');return(async(e,t,n,r,i)=>{const o=await ue(i,e,r,t);return ae(e.slice(-6),o,n)})(e,t,n,r.p2c,b(r.p2s))}case"A128KW":case"A192KW":case"A256KW":if(void 0===n)throw new C("JWE Encrypted Key missing");return ae(e,t,n);case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":if(void 0===n)throw new C("JWE Encrypted Key missing");if("string"!=typeof r.iv)throw new C('JOSE Header "iv" (Initialization Vector) missing or invalid');if("string"!=typeof r.tag)throw new C('JOSE Header "tag" (Authentication Tag) missing or invalid');return async function(e,t,n,r,i){const o=e.slice(0,7);return X(o,t,n,r,i,new Uint8Array(0))}(e,t,n,b(r.iv),b(r.tag));default:throw new k('Invalid or unsupported "alg" (JWE Algorithm) header value')}}(l,t,m,s,n)}catch(e){if(e instanceof TypeError||e instanceof C||e instanceof k)throw e;g=fe(p)}const y=b(e.iv),w=b(e.tag),x=c.encode(null!==(r=e.protected)&&void 0!==r?r:"");let _;_=void 0!==e.aad?d(x,c.encode("."),c.encode(e.aad)):x;let S=await X(p,g,b(e.ciphertext),y,w,_);"DEF"===s.zip&&(S=await((null==n?void 0:n.inflateRaw)||Q)(S));const A={plaintext:S};return void 0!==e.protected&&(A.protectedHeader=i),void 0!==e.aad&&(A.additionalAuthenticatedData=b(e.aad)),void 0!==e.unprotected&&(A.sharedUnprotectedHeader=e.unprotected),void 0!==e.header&&(A.unprotectedHeader=e.header),v?{...A,key:t}:A}async function je(e,t,n){if(e instanceof Uint8Array&&(e=u.decode(e)),"string"!=typeof e)throw new C("Compact JWE must be a string or Uint8Array");const{0:r,1:i,2:o,3:a,4:s,length:c}=e.split(".");if(5!==c)throw new C("Invalid Compact JWE");const l=await Ie({ciphertext:a,iv:o||void 0,protected:r||void 0,tag:s||void 0,encrypted_key:i||void 0},t,n),d={plaintext:l.plaintext,protectedHeader:l.protectedHeader};return"function"==typeof t?{...d,key:l.key}:d}async function Ne(e,t,n){if(!te(e))throw new C("General JWE must be an object");if(!Array.isArray(e.recipients)||!e.recipients.every(te))throw new C("JWE Recipients missing or incorrect type");if(!e.recipients.length)throw new C("JWE Recipients has no members");for(const r of e.recipients)try{return await Ie({aad:e.aad,ciphertext:e.ciphertext,encrypted_key:r.encrypted_key,header:r.header,iv:e.iv,protected:e.protected,tag:e.tag,unprotected:e.unprotected},t,n)}catch(e){}throw new S}async function Fe(e){return(e=>me("public","spki",e))(e)}async function Re(e){return(e=>me("private","pkcs8",e))(e)}async function Le(e){return(async e=>{if(e instanceof Uint8Array)return{kty:"oct",k:v(e)};if(!a(e))throw new TypeError(z(e,...G,"Uint8Array"));if(!e.extractable)throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");const{ext:t,key_ops:n,alg:r,use:i,...s}=await o.subtle.exportKey("jwk",e);return s})(e)}const De=async function(e,t,n,r,i={}){let s,c,u;switch(Ae(e,n,"encrypt"),e){case"dir":u=n;break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!ce(n))throw new k("ECDH with the provided key is not allowed or not supported by your javascript runtime");const{apu:l,apv:d}=i;let{epk:p}=i;p||(p=(await async function(e){if(!a(e))throw new TypeError(z(e,...G));return o.subtle.generateKey(e.algorithm,!0,["deriveBits"])}(n)).privateKey);const{x:f,y:h,crv:m,kty:g}=await Le(p),y=await se(n,p,"ECDH-ES"===e?t:e,"ECDH-ES"===e?pe(t):parseInt(e.slice(-5,-2),10),l,d);if(c={epk:{x:f,crv:m,kty:g}},"EC"===g&&(c.epk.y=h),l&&(c.apu=v(l)),d&&(c.apv=v(d)),"ECDH-ES"===e){u=y;break}u=r||fe(t);const b=e.slice(-6);s=await oe(b,y,u);break}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":u=r||fe(t),s=await(async(e,t,n)=>{if(!a(t))throw new TypeError(z(t,...G));if(V(t,e,"encrypt","wrapKey"),de(e,t),t.usages.includes("encrypt"))return new Uint8Array(await o.subtle.encrypt(le(e),t,n));if(t.usages.includes("wrapKey")){const r=await o.subtle.importKey("raw",n,...ne);return new Uint8Array(await o.subtle.wrapKey("raw",r,t,le(e)))}throw new TypeError('RSA-OAEP key "usages" must include "encrypt" or "wrapKey" for this operation')})(e,n,u);break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{u=r||fe(t);const{p2c:o,p2s:a}=i;({encryptedKey:s,...c}=await(async(e,t,n,r=2048,i=R(new Uint8Array(16)))=>{const o=await ue(i,e,r,t);return{encryptedKey:await oe(e.slice(-6),o,n),p2c:r,p2s:v(i)}})(e,n,u,o,a));break}case"A128KW":case"A192KW":case"A256KW":u=r||fe(t),s=await oe(e,n,u);break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{u=r||fe(t);const{iv:o}=i;({encryptedKey:s,...c}=await async function(e,t,n,r){const i=e.slice(0,7);r||(r=D(i));const{ciphertext:o,tag:a}=await Te(i,n,t,r,new Uint8Array(0));return{encryptedKey:o,iv:v(r),tag:v(a)}}(e,n,u,o));break}default:throw new k('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek:u,encryptedKey:s,parameters:c}},Me=Symbol();class Ue{constructor(e){if(!(e instanceof Uint8Array))throw new TypeError("plaintext must be an instance of Uint8Array");this._plaintext=e}setKeyManagementParameters(e){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=e,this}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setSharedUnprotectedHeader(e){if(this._sharedUnprotectedHeader)throw new TypeError("setSharedUnprotectedHeader can only be called once");return this._sharedUnprotectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}setAdditionalAuthenticatedData(e){return this._aad=e,this}setContentEncryptionKey(e){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=e,this}setInitializationVector(e){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=e,this}async encrypt(e,t){if(!this._protectedHeader&&!this._unprotectedHeader&&!this._sharedUnprotectedHeader)throw new C("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!ee(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new C("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const n={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if(Oe(C,new Map,null==t?void 0:t.crit,this._protectedHeader,n),void 0!==n.zip){if(!this._protectedHeader||!this._protectedHeader.zip)throw new C('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==n.zip)throw new k('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:r,enc:i}=n;if("string"!=typeof r||!r)throw new C('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("string"!=typeof i||!i)throw new C('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');let o,a,s,l,p,f,h;if("dir"===r){if(this._cek)throw new TypeError("setContentEncryptionKey cannot be called when using Direct Encryption")}else if("ECDH-ES"===r&&this._cek)throw new TypeError("setContentEncryptionKey cannot be called when using Direct Key Agreement");{let n;({cek:a,encryptedKey:o,parameters:n}=await De(r,i,e,this._cek,this._keyManagementParameters)),n&&(t&&Me in t?this._unprotectedHeader?this._unprotectedHeader={...this._unprotectedHeader,...n}:this.setUnprotectedHeader(n):this._protectedHeader?this._protectedHeader={...this._protectedHeader,...n}:this.setProtectedHeader(n))}if(this._iv||(this._iv=D(i)),l=this._protectedHeader?c.encode(v(JSON.stringify(this._protectedHeader))):c.encode(""),this._aad?(p=v(this._aad),s=d(l,c.encode("."),c.encode(p))):s=l,"DEF"===n.zip){const e=await((null==t?void 0:t.deflateRaw)||Y)(this._plaintext);({ciphertext:f,tag:h}=await Te(i,e,a,this._iv,s))}else({ciphertext:f,tag:h}=await Te(i,this._plaintext,a,this._iv,s));const m={ciphertext:v(f),iv:v(this._iv),tag:v(h)};return o&&(m.encrypted_key=v(o)),p&&(m.aad=p),this._protectedHeader&&(m.protected=u.decode(l)),this._sharedUnprotectedHeader&&(m.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(m.header=this._unprotectedHeader),m}}class Be{constructor(e,t,n){this.parent=e,this.key=t,this.options=n}setUnprotectedHeader(e){if(this.unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this.unprotectedHeader=e,this}addRecipient(...e){return this.parent.addRecipient(...e)}encrypt(...e){return this.parent.encrypt(...e)}done(){return this.parent}}class He{constructor(e){this._recipients=[],this._plaintext=e}addRecipient(e,t){const n=new Be(this,e,{crit:null==t?void 0:t.crit});return this._recipients.push(n),n}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setSharedUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setSharedUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}setAdditionalAuthenticatedData(e){return this._aad=e,this}async encrypt(e){var t,n,r;if(!this._recipients.length)throw new C("at least one recipient must be added");if(e={deflateRaw:null==e?void 0:e.deflateRaw},1===this._recipients.length){const[t]=this._recipients,n=await new Ue(this._plaintext).setAdditionalAuthenticatedData(this._aad).setProtectedHeader(this._protectedHeader).setSharedUnprotectedHeader(this._unprotectedHeader).setUnprotectedHeader(t.unprotectedHeader).encrypt(t.key,{...t.options,...e});let r={ciphertext:n.ciphertext,iv:n.iv,recipients:[{}],tag:n.tag};return n.aad&&(r.aad=n.aad),n.protected&&(r.protected=n.protected),n.unprotected&&(r.unprotected=n.unprotected),n.encrypted_key&&(r.recipients[0].encrypted_key=n.encrypted_key),n.header&&(r.recipients[0].header=n.header),r}let i;for(let e=0;e<this._recipients.length;e++){const t=this._recipients[e];if(!ee(this._protectedHeader,this._unprotectedHeader,t.unprotectedHeader))throw new C("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const n={...this._protectedHeader,...this._unprotectedHeader,...t.unprotectedHeader},{alg:r}=n;if("string"!=typeof r||!r)throw new C('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("dir"===r||"ECDH-ES"===r)throw new C('"dir" and "ECDH-ES" alg may only be used with a single recipient');if("string"!=typeof n.enc||!n.enc)throw new C('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');if(i){if(i!==n.enc)throw new C('JWE "enc" (Encryption Algorithm) Header Parameter must be the same for all recipients')}else i=n.enc;if(Oe(C,new Map,t.options.crit,this._protectedHeader,n),!(void 0===n.zip||this._protectedHeader&&this._protectedHeader.zip))throw new C('JWE "zip" (Compression Algorithm) Header MUST be integrity protected')}const o=fe(i);let a={ciphertext:"",iv:"",recipients:[],tag:""};for(let s=0;s<this._recipients.length;s++){const c=this._recipients[s],u={};a.recipients.push(u);const l={...this._protectedHeader,...this._unprotectedHeader,...c.unprotectedHeader}.alg.startsWith("PBES2")?2048+s:void 0;if(0===s){const t=await new Ue(this._plaintext).setAdditionalAuthenticatedData(this._aad).setContentEncryptionKey(o).setProtectedHeader(this._protectedHeader).setSharedUnprotectedHeader(this._unprotectedHeader).setUnprotectedHeader(c.unprotectedHeader).setKeyManagementParameters({p2c:l}).encrypt(c.key,{...c.options,...e,[Me]:!0});a.ciphertext=t.ciphertext,a.iv=t.iv,a.tag=t.tag,t.aad&&(a.aad=t.aad),t.protected&&(a.protected=t.protected),t.unprotected&&(a.unprotected=t.unprotected),u.encrypted_key=t.encrypted_key,t.header&&(u.header=t.header);continue}const{encryptedKey:d,parameters:p}=await De((null===(t=c.unprotectedHeader)||void 0===t?void 0:t.alg)||(null===(n=this._protectedHeader)||void 0===n?void 0:n.alg)||(null===(r=this._unprotectedHeader)||void 0===r?void 0:r.alg),i,c.key,o,{p2c:l});u.encrypted_key=v(d),(c.unprotectedHeader||p)&&(u.header={...c.unprotectedHeader,...p})}return a}}function qe(e,t){const n=`SHA-${e.slice(-3)}`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:n,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:n,name:"RSA-PSS",saltLength:e.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:n,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:n,name:"ECDSA",namedCurve:t.namedCurve};case"EdDSA":return B()&&"NODE-ED25519"===t.name?{name:"NODE-ED25519",namedCurve:"NODE-ED25519"}:{name:t.name};default:throw new k(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}function We(e,t,n){if(a(t))return function(e,t,...n){switch(t){case"HS256":case"HS384":case"HS512":{if(!q(e.algorithm,"HMAC"))throw H("HMAC");const n=parseInt(t.slice(2),10);if(W(e.algorithm.hash)!==n)throw H(`SHA-${n}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!q(e.algorithm,"RSASSA-PKCS1-v1_5"))throw H("RSASSA-PKCS1-v1_5");const n=parseInt(t.slice(2),10);if(W(e.algorithm.hash)!==n)throw H(`SHA-${n}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!q(e.algorithm,"RSA-PSS"))throw H("RSA-PSS");const n=parseInt(t.slice(2),10);if(W(e.algorithm.hash)!==n)throw H(`SHA-${n}`,"algorithm.hash");break}case"EdDSA":if("Ed25519"!==e.algorithm.name&&"Ed448"!==e.algorithm.name){if(B()){if(q(e.algorithm,"NODE-ED25519"))break;throw H("Ed25519, Ed448, or NODE-ED25519")}throw H("Ed25519 or Ed448")}break;case"ES256":case"ES384":case"ES512":{if(!q(e.algorithm,"ECDSA"))throw H("ECDSA");const n=function(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}(t);if(e.algorithm.namedCurve!==n)throw H(n,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}K(e,n)}(t,e,n),t;if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(z(t,...G));return o.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[n])}throw new TypeError(z(t,...G,"Uint8Array"))}async function Ke(e,t,n){var r;if(!te(e))throw new A("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new A('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new A("JWS Protected Header incorrect type");if(void 0===e.payload)throw new A("JWS Payload missing");if("string"!=typeof e.signature)throw new A("JWS Signature missing or incorrect type");if(void 0!==e.header&&!te(e.header))throw new A("JWS Unprotected Header incorrect type");let i={};if(e.protected)try{const t=b(e.protected);i=JSON.parse(u.decode(t))}catch(e){throw new A("JWS Protected Header is invalid")}if(!ee(i,e.header))throw new A("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const a={...i,...e.header};let s=!0;if(Oe(A,new Map([["b64",!0]]),null==n?void 0:n.crit,i,a).has("b64")&&(s=i.b64,"boolean"!=typeof s))throw new A('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:l}=a;if("string"!=typeof l||!l)throw new A('JWS "alg" (Algorithm) Header Parameter missing or invalid');const p=n&&Pe("algorithms",n.algorithms);if(p&&!p.has(l))throw new E('"alg" (Algorithm) Header Parameter not allowed');if(s){if("string"!=typeof e.payload)throw new A("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new A("JWS Payload must be a string or an Uint8Array instance");let f=!1;"function"==typeof t&&(t=await t(i,e),f=!0),Ae(l,t,"verify");const h=d(c.encode(null!==(r=e.protected)&&void 0!==r?r:""),c.encode("."),"string"==typeof e.payload?c.encode(e.payload):e.payload),m=b(e.signature);if(!await(async(e,t,n,r)=>{const i=await We(e,t,"verify");de(e,i);const a=qe(e,i.algorithm);try{return await o.subtle.verify(a,i,n,r)}catch(e){return!1}})(l,t,m,h))throw new F;let g;g=s?b(e.payload):"string"==typeof e.payload?c.encode(e.payload):e.payload;const v={payload:g};return void 0!==e.protected&&(v.protectedHeader=i),void 0!==e.header&&(v.unprotectedHeader=e.header),f?{...v,key:t}:v}async function Ve(e,t,n){if(e instanceof Uint8Array&&(e=u.decode(e)),"string"!=typeof e)throw new A("Compact JWS must be a string or Uint8Array");const{0:r,1:i,2:o,length:a}=e.split(".");if(3!==a)throw new A("Invalid Compact JWS");const s=await Ke({payload:i,protected:r,signature:o},t,n),c={payload:s.payload,protectedHeader:s.protectedHeader};return"function"==typeof t?{...c,key:s.key}:c}async function Je(e,t,n){if(!te(e))throw new A("General JWS must be an object");if(!Array.isArray(e.signatures)||!e.signatures.every(te))throw new A("JWS Signatures missing or incorrect type");for(const r of e.signatures)try{return await Ke({header:r.header,payload:e.payload,protected:r.protected,signature:r.signature},t,n)}catch(e){}throw new F}const ze=e=>Math.floor(e.getTime()/1e3),Ze=/^(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)$/i,$e=e=>{const t=Ze.exec(e);if(!t)throw new TypeError("Invalid time period format");const n=parseFloat(t[1]);switch(t[2].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":return Math.round(n);case"minute":case"minutes":case"min":case"mins":case"m":return Math.round(60*n);case"hour":case"hours":case"hr":case"hrs":case"h":return Math.round(3600*n);case"day":case"days":case"d":return Math.round(86400*n);case"week":case"weeks":case"w":return Math.round(604800*n);default:return Math.round(31557600*n)}},Ge=e=>e.toLowerCase().replace(/^application\//,""),Xe=(e,t,n={})=>{const{typ:r}=n;if(r&&("string"!=typeof e.typ||Ge(e.typ)!==Ge(r)))throw new x('unexpected "typ" JWT header value',"typ","check_failed");let i;try{i=JSON.parse(u.decode(t))}catch(e){}if(!te(i))throw new T("JWT Claims Set must be a top-level JSON object");const{issuer:o}=n;if(o&&!(Array.isArray(o)?o:[o]).includes(i.iss))throw new x('unexpected "iss" claim value',"iss","check_failed");const{subject:a}=n;if(a&&i.sub!==a)throw new x('unexpected "sub" claim value',"sub","check_failed");const{audience:s}=n;if(s&&(l="string"==typeof s?[s]:s,!("string"==typeof(c=i.aud)?l.includes(c):Array.isArray(c)&&l.some(Set.prototype.has.bind(new Set(c))))))throw new x('unexpected "aud" claim value',"aud","check_failed");var c,l;let d;switch(typeof n.clockTolerance){case"string":d=$e(n.clockTolerance);break;case"number":d=n.clockTolerance;break;case"undefined":d=0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:p}=n,f=ze(p||new Date);if((void 0!==i.iat||n.maxTokenAge)&&"number"!=typeof i.iat)throw new x('"iat" claim must be a number',"iat","invalid");if(void 0!==i.nbf){if("number"!=typeof i.nbf)throw new x('"nbf" claim must be a number',"nbf","invalid");if(i.nbf>f+d)throw new x('"nbf" claim timestamp check failed',"nbf","check_failed")}if(void 0!==i.exp){if("number"!=typeof i.exp)throw new x('"exp" claim must be a number',"exp","invalid");if(i.exp<=f-d)throw new _('"exp" claim timestamp check failed',"exp","check_failed")}if(n.maxTokenAge){const e=f-i.iat;if(e-d>("number"==typeof n.maxTokenAge?n.maxTokenAge:$e(n.maxTokenAge)))throw new _('"iat" claim timestamp check failed (too far in the past)',"iat","check_failed");if(e<0-d)throw new x('"iat" claim timestamp check failed (it should be in the past)',"iat","check_failed")}return i};async function Qe(e,t,n){var r;const i=await Ve(e,t,n);if((null===(r=i.protectedHeader.crit)||void 0===r?void 0:r.includes("b64"))&&!1===i.protectedHeader.b64)throw new T("JWTs MUST NOT use unencoded payload");const o={payload:Xe(i.protectedHeader,i.payload,n),protectedHeader:i.protectedHeader};return"function"==typeof t?{...o,key:i.key}:o}async function Ye(e,t,n){const r=await je(e,t,n),i=Xe(r.protectedHeader,r.plaintext,n),{protectedHeader:o}=r;if(void 0!==o.iss&&o.iss!==i.iss)throw new x('replicated "iss" claim header parameter mismatch',"iss","mismatch");if(void 0!==o.sub&&o.sub!==i.sub)throw new x('replicated "sub" claim header parameter mismatch',"sub","mismatch");if(void 0!==o.aud&&JSON.stringify(o.aud)!==JSON.stringify(i.aud))throw new x('replicated "aud" claim header parameter mismatch',"aud","mismatch");const a={payload:i,protectedHeader:o};return"function"==typeof t?{...a,key:r.key}:a}class et{constructor(e){this._flattened=new Ue(e)}setContentEncryptionKey(e){return this._flattened.setContentEncryptionKey(e),this}setInitializationVector(e){return this._flattened.setInitializationVector(e),this}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}setKeyManagementParameters(e){return this._flattened.setKeyManagementParameters(e),this}async encrypt(e,t){const n=await this._flattened.encrypt(e,t);return[n.protected,n.encrypted_key,n.iv,n.ciphertext,n.tag].join(".")}}class tt{constructor(e){if(!(e instanceof Uint8Array))throw new TypeError("payload must be an instance of Uint8Array");this._payload=e}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}async sign(e,t){if(!this._protectedHeader&&!this._unprotectedHeader)throw new A("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!ee(this._protectedHeader,this._unprotectedHeader))throw new A("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const n={...this._protectedHeader,...this._unprotectedHeader};let r=!0;if(Oe(A,new Map([["b64",!0]]),null==t?void 0:t.crit,this._protectedHeader,n).has("b64")&&(r=this._protectedHeader.b64,"boolean"!=typeof r))throw new A('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:i}=n;if("string"!=typeof i||!i)throw new A('JWS "alg" (Algorithm) Header Parameter missing or invalid');Ae(i,e,"sign");let a,s=this._payload;r&&(s=c.encode(v(s))),a=this._protectedHeader?c.encode(v(JSON.stringify(this._protectedHeader))):c.encode("");const l=d(a,c.encode("."),s),p=await(async(e,t,n)=>{const r=await We(e,t,"sign");de(e,r);const i=await o.subtle.sign(qe(e,r.algorithm),r,n);return new Uint8Array(i)})(i,e,l),f={signature:v(p),payload:""};return r&&(f.payload=u.decode(s)),this._unprotectedHeader&&(f.header=this._unprotectedHeader),this._protectedHeader&&(f.protected=u.decode(a)),f}}class nt{constructor(e){this._flattened=new tt(e)}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}async sign(e,t){const n=await this._flattened.sign(e,t);if(void 0===n.payload)throw new TypeError("use the flattened module for creating JWS with b64: false");return`${n.protected}.${n.payload}.${n.signature}`}}class rt{constructor(e,t,n){this.parent=e,this.key=t,this.options=n}setProtectedHeader(e){if(this.protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this.protectedHeader=e,this}setUnprotectedHeader(e){if(this.unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this.unprotectedHeader=e,this}addSignature(...e){return this.parent.addSignature(...e)}sign(...e){return this.parent.sign(...e)}done(){return this.parent}}class it{constructor(e){this._signatures=[],this._payload=e}addSignature(e,t){const n=new rt(this,e,t);return this._signatures.push(n),n}async sign(){if(!this._signatures.length)throw new A("at least one signature must be added");const e={signatures:[],payload:""};for(let t=0;t<this._signatures.length;t++){const n=this._signatures[t],r=new tt(this._payload);r.setProtectedHeader(n.protectedHeader),r.setUnprotectedHeader(n.unprotectedHeader);const{payload:i,...o}=await r.sign(n.key,n.options);if(0===t)e.payload=i;else if(e.payload!==i)throw new A("inconsistent use of JWS Unencoded Payload Option (RFC7797)");e.signatures.push(o)}return e}}class ot{constructor(e){if(!te(e))throw new TypeError("JWT Claims Set MUST be an object");this._payload=e}setIssuer(e){return this._payload={...this._payload,iss:e},this}setSubject(e){return this._payload={...this._payload,sub:e},this}setAudience(e){return this._payload={...this._payload,aud:e},this}setJti(e){return this._payload={...this._payload,jti:e},this}setNotBefore(e){return this._payload="number"==typeof e?{...this._payload,nbf:e}:{...this._payload,nbf:ze(new Date)+$e(e)},this}setExpirationTime(e){return this._payload="number"==typeof e?{...this._payload,exp:e}:{...this._payload,exp:ze(new Date)+$e(e)},this}setIssuedAt(e){return this._payload=void 0===e?{...this._payload,iat:ze(new Date)}:{...this._payload,iat:e},this}}class at extends ot{setProtectedHeader(e){return this._protectedHeader=e,this}async sign(e,t){var n;const r=new nt(c.encode(JSON.stringify(this._payload)));if(r.setProtectedHeader(this._protectedHeader),Array.isArray(null===(n=this._protectedHeader)||void 0===n?void 0:n.crit)&&this._protectedHeader.crit.includes("b64")&&!1===this._protectedHeader.b64)throw new T("JWTs MUST NOT use unencoded payload");return r.sign(e,t)}}class st extends ot{setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setKeyManagementParameters(e){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=e,this}setContentEncryptionKey(e){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=e,this}setInitializationVector(e){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=e,this}replicateIssuerAsHeader(){return this._replicateIssuerAsHeader=!0,this}replicateSubjectAsHeader(){return this._replicateSubjectAsHeader=!0,this}replicateAudienceAsHeader(){return this._replicateAudienceAsHeader=!0,this}async encrypt(e,t){const n=new et(c.encode(JSON.stringify(this._payload)));return this._replicateIssuerAsHeader&&(this._protectedHeader={...this._protectedHeader,iss:this._payload.iss}),this._replicateSubjectAsHeader&&(this._protectedHeader={...this._protectedHeader,sub:this._payload.sub}),this._replicateAudienceAsHeader&&(this._protectedHeader={...this._protectedHeader,aud:this._payload.aud}),n.setProtectedHeader(this._protectedHeader),this._iv&&n.setInitializationVector(this._iv),this._cek&&n.setContentEncryptionKey(this._cek),this._keyManagementParameters&&n.setKeyManagementParameters(this._keyManagementParameters),n.encrypt(e,t)}}const ct=(e,t)=>{if("string"!=typeof e||!e)throw new O(`${t} missing or invalid`)};async function ut(e,t){if(!te(e))throw new TypeError("JWK must be an object");if(null!=t||(t="sha256"),"sha256"!==t&&"sha384"!==t&&"sha512"!==t)throw new TypeError('digestAlgorithm must one of "sha256", "sha384", or "sha512"');let n;switch(e.kty){case"EC":ct(e.crv,'"crv" (Curve) Parameter'),ct(e.x,'"x" (X Coordinate) Parameter'),ct(e.y,'"y" (Y Coordinate) Parameter'),n={crv:e.crv,kty:e.kty,x:e.x,y:e.y};break;case"OKP":ct(e.crv,'"crv" (Subtype of Key Pair) Parameter'),ct(e.x,'"x" (Public Key) Parameter'),n={crv:e.crv,kty:e.kty,x:e.x};break;case"RSA":ct(e.e,'"e" (Exponent) Parameter'),ct(e.n,'"n" (Modulus) Parameter'),n={e:e.e,kty:e.kty,n:e.n};break;case"oct":ct(e.k,'"k" (Key Value) Parameter'),n={k:e.k,kty:e.kty};break;default:throw new k('"kty" (Key Type) Parameter missing or unsupported')}const r=c.encode(JSON.stringify(n));return v(await s(t,r))}async function lt(e,t){null!=t||(t="sha256");const n=await ut(e,t);return`urn:ietf:params:oauth:jwk-thumbprint:sha-${t.slice(-3)}:${n}`}async function dt(e,t){const n={...e,...null==t?void 0:t.header};if(!te(n.jwk))throw new A('"jwk" (JSON Web Key) Header Parameter must be a JSON object');const r=await Ce({...n.jwk,ext:!0},n.alg,!0);if(r instanceof Uint8Array||"public"!==r.type)throw new A('"jwk" (JSON Web Key) Header Parameter must be a public key');return r}function pt(e){return e&&"object"==typeof e&&Array.isArray(e.keys)&&e.keys.every(ft)}function ft(e){return te(e)}class ht{constructor(e){if(this._cached=new WeakMap,!pt(e))throw new P("JSON Web Key Set malformed");var t;this._jwks=(t=e,"function"==typeof structuredClone?structuredClone(t):JSON.parse(JSON.stringify(t)))}async getKey(e,t){const{alg:n,kid:r}={...e,...null==t?void 0:t.header},i=function(e){switch("string"==typeof e&&e.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";default:throw new k('Unsupported "alg" value for a JSON Web Key Set')}}(n),o=this._jwks.keys.filter((e=>{let t=i===e.kty;if(t&&"string"==typeof r&&(t=r===e.kid),t&&"string"==typeof e.alg&&(t=n===e.alg),t&&"string"==typeof e.use&&(t="sig"===e.use),t&&Array.isArray(e.key_ops)&&(t=e.key_ops.includes("verify")),t&&"EdDSA"===n&&(t="Ed25519"===e.crv||"Ed448"===e.crv),t)switch(n){case"ES256":t="P-256"===e.crv;break;case"ES256K":t="secp256k1"===e.crv;break;case"ES384":t="P-384"===e.crv;break;case"ES512":t="P-521"===e.crv}return t})),{0:a,length:s}=o;if(0===s)throw new I;if(1!==s){const e=new j,{_cached:t}=this;throw e[Symbol.asyncIterator]=async function*(){for(const e of o)try{yield await mt(t,e,n)}catch(e){continue}},e}return mt(this._cached,a,n)}}async function mt(e,t,n){const r=e.get(t)||e.set(t,{}).get(t);if(void 0===r[n]){const e=await Ce({...t,ext:!0},n);if(e instanceof Uint8Array||"public"!==e.type)throw new P("JSON Web Key Set members must be public keys");r[n]=e}return r[n]}function gt(e){const t=new ht(e);return async function(e,n){return t.getKey(e,n)}}class vt extends ht{constructor(e,t){if(super({keys:[]}),this._jwks=void 0,!(e instanceof URL))throw new TypeError("url must be an instance of URL");this._url=new URL(e.href),this._options={agent:null==t?void 0:t.agent,headers:null==t?void 0:t.headers},this._timeoutDuration="number"==typeof(null==t?void 0:t.timeoutDuration)?null==t?void 0:t.timeoutDuration:5e3,this._cooldownDuration="number"==typeof(null==t?void 0:t.cooldownDuration)?null==t?void 0:t.cooldownDuration:3e4,this._cacheMaxAge="number"==typeof(null==t?void 0:t.cacheMaxAge)?null==t?void 0:t.cacheMaxAge:6e5}coolingDown(){return"number"==typeof this._jwksTimestamp&&Date.now()<this._jwksTimestamp+this._cooldownDuration}fresh(){return"number"==typeof this._jwksTimestamp&&Date.now()<this._jwksTimestamp+this._cacheMaxAge}async getKey(e,t){this._jwks&&this.fresh()||await this.reload();try{return await super.getKey(e,t)}catch(n){if(n instanceof I&&!1===this.coolingDown())return await this.reload(),super.getKey(e,t);throw n}}async reload(){this._pendingFetch&&B()&&(this._pendingFetch=void 0),this._pendingFetch||(this._pendingFetch=(async(e,t,n)=>{let r,i,o=!1;"function"==typeof AbortController&&(r=new AbortController,i=setTimeout((()=>{o=!0,r.abort()}),t));const a=await fetch(e.href,{signal:r?r.signal:void 0,redirect:"manual",headers:n.headers}).catch((e=>{if(o)throw new N;throw e}));if(void 0!==i&&clearTimeout(i),200!==a.status)throw new w("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await a.json()}catch(e){throw new w("Failed to parse the JSON Web Key Set HTTP response as JSON")}})(this._url,this._timeoutDuration,this._options).then((e=>{if(!pt(e))throw new P("JSON Web Key Set malformed");this._jwks={keys:e.keys},this._jwksTimestamp=Date.now(),this._pendingFetch=void 0})).catch((e=>{throw this._pendingFetch=void 0,e}))),await this._pendingFetch}}function yt(e,t){const n=new vt(e,t);return async function(e,t){return n.getKey(e,t)}}class bt extends ot{encode(){return`${v(JSON.stringify({alg:"none"}))}.${v(JSON.stringify(this._payload))}.`}static decode(e,t){if("string"!=typeof e)throw new T("Unsecured JWT must be a string");const{0:n,1:r,2:i,length:o}=e.split(".");if(3!==o||""!==i)throw new T("Invalid Unsecured JWT");let a;try{if(a=JSON.parse(u.decode(b(n))),"none"!==a.alg)throw new Error}catch(e){throw new T("Invalid Unsecured JWT")}return{payload:Xe(a,b(r),t),header:a}}}const wt=v,xt=b;function _t(e){let t;if("string"==typeof e){const n=e.split(".");3!==n.length&&5!==n.length||([t]=n)}else if("object"==typeof e&&e){if(!("protected"in e))throw new TypeError("Token does not contain a Protected Header");t=e.protected}try{if("string"!=typeof t||!t)throw new Error;const e=JSON.parse(u.decode(xt(t)));if(!te(e))throw new Error;return e}catch(e){throw new TypeError("Invalid Token or Protected Header formatting")}}function Et(e){if("string"!=typeof e)throw new T("JWTs must use Compact JWS serialization, JWT must be a string");const{1:t,length:n}=e.split(".");if(5===n)throw new T("Only JWTs using Compact JWS serialization can be decoded");if(3!==n)throw new T("Invalid JWT");if(!t)throw new T("JWTs must contain a payload");let r,i;try{r=xt(t)}catch(e){throw new T("Failed to parse the base64url encoded payload")}try{i=JSON.parse(u.decode(r))}catch(e){throw new T("Failed to parse the decoded payload as JSON")}if(!te(i))throw new T("Invalid JWT Claims Set");return i}function kt(e){var t;const n=null!==(t=null==e?void 0:e.modulusLength)&&void 0!==t?t:2048;if("number"!=typeof n||n<2048)throw new k("Invalid or unsupported modulusLength option provided, 2048 bits or larger keys must be used");return n}async function St(e,t){return async function(e,t){var n,r,i,a;let s,c;switch(e){case"PS256":case"PS384":case"PS512":s={name:"RSA-PSS",hash:`SHA-${e.slice(-3)}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:kt(t)},c=["sign","verify"];break;case"RS256":case"RS384":case"RS512":s={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.slice(-3)}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:kt(t)},c=["sign","verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":s={name:"RSA-OAEP",hash:`SHA-${parseInt(e.slice(-3),10)||1}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:kt(t)},c=["decrypt","unwrapKey","encrypt","wrapKey"];break;case"ES256":s={name:"ECDSA",namedCurve:"P-256"},c=["sign","verify"];break;case"ES384":s={name:"ECDSA",namedCurve:"P-384"},c=["sign","verify"];break;case"ES512":s={name:"ECDSA",namedCurve:"P-521"},c=["sign","verify"];break;case"EdDSA":c=["sign","verify"];const i=null!==(n=null==t?void 0:t.crv)&&void 0!==n?n:"Ed25519";switch(i){case"Ed25519":case"Ed448":s={name:i};break;default:throw new k("Invalid or unsupported crv option provided")}break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{c=["deriveKey","deriveBits"];const e=null!==(r=null==t?void 0:t.crv)&&void 0!==r?r:"P-256";switch(e){case"P-256":case"P-384":case"P-521":s={name:"ECDH",namedCurve:e};break;case"X25519":case"X448":s={name:e};break;default:throw new k("Invalid or unsupported crv option provided, supported values are P-256, P-384, P-521, X25519, and X448")}break}default:throw new k('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}try{return await o.subtle.generateKey(s,null!==(i=null==t?void 0:t.extractable)&&void 0!==i&&i,c)}catch(e){if("Ed25519"===s.name&&"NotSupportedError"===(null==e?void 0:e.name)&&B())return s={name:"NODE-ED25519",namedCurve:"NODE-ED25519"},await o.subtle.generateKey(s,null!==(a=null==t?void 0:t.extractable)&&void 0!==a&&a,c);throw e}}(e,t)}async function Ct(e,t){return async function(e,t){var n;let r,i,a;switch(e){case"HS256":case"HS384":case"HS512":r=parseInt(e.slice(-3),10),i={name:"HMAC",hash:`SHA-${r}`,length:r},a=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return r=parseInt(e.slice(-3),10),R(new Uint8Array(r>>3));case"A128KW":case"A192KW":case"A256KW":r=parseInt(e.slice(1,4),10),i={name:"AES-KW",length:r},a=["wrapKey","unwrapKey"];break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":case"A128GCM":case"A192GCM":case"A256GCM":r=parseInt(e.slice(1,4),10),i={name:"AES-GCM",length:r},a=["encrypt","decrypt"];break;default:throw new k('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}return o.subtle.generateKey(i,null!==(n=null==t?void 0:t.extractable)&&void 0!==n&&n,a)}(e,t)}},3765:e=>{"use strict";e.exports=JSON.parse('{"application/1d-interleaved-parityfec":{"source":"iana"},"application/3gpdash-qoe-report+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/3gpp-ims+xml":{"source":"iana","compressible":true},"application/3gpphal+json":{"source":"iana","compressible":true},"application/3gpphalforms+json":{"source":"iana","compressible":true},"application/a2l":{"source":"iana"},"application/ace+cbor":{"source":"iana"},"application/activemessage":{"source":"iana"},"application/activity+json":{"source":"iana","compressible":true},"application/alto-costmap+json":{"source":"iana","compressible":true},"application/alto-costmapfilter+json":{"source":"iana","compressible":true},"application/alto-directory+json":{"source":"iana","compressible":true},"application/alto-endpointcost+json":{"source":"iana","compressible":true},"application/alto-endpointcostparams+json":{"source":"iana","compressible":true},"application/alto-endpointprop+json":{"source":"iana","compressible":true},"application/alto-endpointpropparams+json":{"source":"iana","compressible":true},"application/alto-error+json":{"source":"iana","compressible":true},"application/alto-networkmap+json":{"source":"iana","compressible":true},"application/alto-networkmapfilter+json":{"source":"iana","compressible":true},"application/alto-updatestreamcontrol+json":{"source":"iana","compressible":true},"application/alto-updatestreamparams+json":{"source":"iana","compressible":true},"application/aml":{"source":"iana"},"application/andrew-inset":{"source":"iana","extensions":["ez"]},"application/applefile":{"source":"iana"},"application/applixware":{"source":"apache","extensions":["aw"]},"application/at+jwt":{"source":"iana"},"application/atf":{"source":"iana"},"application/atfx":{"source":"iana"},"application/atom+xml":{"source":"iana","compressible":true,"extensions":["atom"]},"application/atomcat+xml":{"source":"iana","compressible":true,"extensions":["atomcat"]},"application/atomdeleted+xml":{"source":"iana","compressible":true,"extensions":["atomdeleted"]},"application/atomicmail":{"source":"iana"},"application/atomsvc+xml":{"source":"iana","compressible":true,"extensions":["atomsvc"]},"application/atsc-dwd+xml":{"source":"iana","compressible":true,"extensions":["dwd"]},"application/atsc-dynamic-event-message":{"source":"iana"},"application/atsc-held+xml":{"source":"iana","compressible":true,"extensions":["held"]},"application/atsc-rdt+json":{"source":"iana","compressible":true},"application/atsc-rsat+xml":{"source":"iana","compressible":true,"extensions":["rsat"]},"application/atxml":{"source":"iana"},"application/auth-policy+xml":{"source":"iana","compressible":true},"application/bacnet-xdd+zip":{"source":"iana","compressible":false},"application/batch-smtp":{"source":"iana"},"application/bdoc":{"compressible":false,"extensions":["bdoc"]},"application/beep+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/calendar+json":{"source":"iana","compressible":true},"application/calendar+xml":{"source":"iana","compressible":true,"extensions":["xcs"]},"application/call-completion":{"source":"iana"},"application/cals-1840":{"source":"iana"},"application/captive+json":{"source":"iana","compressible":true},"application/cbor":{"source":"iana"},"application/cbor-seq":{"source":"iana"},"application/cccex":{"source":"iana"},"application/ccmp+xml":{"source":"iana","compressible":true},"application/ccxml+xml":{"source":"iana","compressible":true,"extensions":["ccxml"]},"application/cdfx+xml":{"source":"iana","compressible":true,"extensions":["cdfx"]},"application/cdmi-capability":{"source":"iana","extensions":["cdmia"]},"application/cdmi-container":{"source":"iana","extensions":["cdmic"]},"application/cdmi-domain":{"source":"iana","extensions":["cdmid"]},"application/cdmi-object":{"source":"iana","extensions":["cdmio"]},"application/cdmi-queue":{"source":"iana","extensions":["cdmiq"]},"application/cdni":{"source":"iana"},"application/cea":{"source":"iana"},"application/cea-2018+xml":{"source":"iana","compressible":true},"application/cellml+xml":{"source":"iana","compressible":true},"application/cfw":{"source":"iana"},"application/city+json":{"source":"iana","compressible":true},"application/clr":{"source":"iana"},"application/clue+xml":{"source":"iana","compressible":true},"application/clue_info+xml":{"source":"iana","compressible":true},"application/cms":{"source":"iana"},"application/cnrp+xml":{"source":"iana","compressible":true},"application/coap-group+json":{"source":"iana","compressible":true},"application/coap-payload":{"source":"iana"},"application/commonground":{"source":"iana"},"application/conference-info+xml":{"source":"iana","compressible":true},"application/cose":{"source":"iana"},"application/cose-key":{"source":"iana"},"application/cose-key-set":{"source":"iana"},"application/cpl+xml":{"source":"iana","compressible":true,"extensions":["cpl"]},"application/csrattrs":{"source":"iana"},"application/csta+xml":{"source":"iana","compressible":true},"application/cstadata+xml":{"source":"iana","compressible":true},"application/csvm+json":{"source":"iana","compressible":true},"application/cu-seeme":{"source":"apache","extensions":["cu"]},"application/cwt":{"source":"iana"},"application/cybercash":{"source":"iana"},"application/dart":{"compressible":true},"application/dash+xml":{"source":"iana","compressible":true,"extensions":["mpd"]},"application/dash-patch+xml":{"source":"iana","compressible":true,"extensions":["mpp"]},"application/dashdelta":{"source":"iana"},"application/davmount+xml":{"source":"iana","compressible":true,"extensions":["davmount"]},"application/dca-rft":{"source":"iana"},"application/dcd":{"source":"iana"},"application/dec-dx":{"source":"iana"},"application/dialog-info+xml":{"source":"iana","compressible":true},"application/dicom":{"source":"iana"},"application/dicom+json":{"source":"iana","compressible":true},"application/dicom+xml":{"source":"iana","compressible":true},"application/dii":{"source":"iana"},"application/dit":{"source":"iana"},"application/dns":{"source":"iana"},"application/dns+json":{"source":"iana","compressible":true},"application/dns-message":{"source":"iana"},"application/docbook+xml":{"source":"apache","compressible":true,"extensions":["dbk"]},"application/dots+cbor":{"source":"iana"},"application/dskpp+xml":{"source":"iana","compressible":true},"application/dssc+der":{"source":"iana","extensions":["dssc"]},"application/dssc+xml":{"source":"iana","compressible":true,"extensions":["xdssc"]},"application/dvcs":{"source":"iana"},"application/ecmascript":{"source":"iana","compressible":true,"extensions":["es","ecma"]},"application/edi-consent":{"source":"iana"},"application/edi-x12":{"source":"iana","compressible":false},"application/edifact":{"source":"iana","compressible":false},"application/efi":{"source":"iana"},"application/elm+json":{"source":"iana","charset":"UTF-8","compressible":true},"application/elm+xml":{"source":"iana","compressible":true},"application/emergencycalldata.cap+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/emergencycalldata.comment+xml":{"source":"iana","compressible":true},"application/emergencycalldata.control+xml":{"source":"iana","compressible":true},"application/emergencycalldata.deviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.ecall.msd":{"source":"iana"},"application/emergencycalldata.providerinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.serviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.subscriberinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.veds+xml":{"source":"iana","compressible":true},"application/emma+xml":{"source":"iana","compressible":true,"extensions":["emma"]},"application/emotionml+xml":{"source":"iana","compressible":true,"extensions":["emotionml"]},"application/encaprtp":{"source":"iana"},"application/epp+xml":{"source":"iana","compressible":true},"application/epub+zip":{"source":"iana","compressible":false,"extensions":["epub"]},"application/eshop":{"source":"iana"},"application/exi":{"source":"iana","extensions":["exi"]},"application/expect-ct-report+json":{"source":"iana","compressible":true},"application/express":{"source":"iana","extensions":["exp"]},"application/fastinfoset":{"source":"iana"},"application/fastsoap":{"source":"iana"},"application/fdt+xml":{"source":"iana","compressible":true,"extensions":["fdt"]},"application/fhir+json":{"source":"iana","charset":"UTF-8","compressible":true},"application/fhir+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/fido.trusted-apps+json":{"compressible":true},"application/fits":{"source":"iana"},"application/flexfec":{"source":"iana"},"application/font-sfnt":{"source":"iana"},"application/font-tdpfr":{"source":"iana","extensions":["pfr"]},"application/font-woff":{"source":"iana","compressible":false},"application/framework-attributes+xml":{"source":"iana","compressible":true},"application/geo+json":{"source":"iana","compressible":true,"extensions":["geojson"]},"application/geo+json-seq":{"source":"iana"},"application/geopackage+sqlite3":{"source":"iana"},"application/geoxacml+xml":{"source":"iana","compressible":true},"application/gltf-buffer":{"source":"iana"},"application/gml+xml":{"source":"iana","compressible":true,"extensions":["gml"]},"application/gpx+xml":{"source":"apache","compressible":true,"extensions":["gpx"]},"application/gxf":{"source":"apache","extensions":["gxf"]},"application/gzip":{"source":"iana","compressible":false,"extensions":["gz"]},"application/h224":{"source":"iana"},"application/held+xml":{"source":"iana","compressible":true},"application/hjson":{"extensions":["hjson"]},"application/http":{"source":"iana"},"application/hyperstudio":{"source":"iana","extensions":["stk"]},"application/ibe-key-request+xml":{"source":"iana","compressible":true},"application/ibe-pkg-reply+xml":{"source":"iana","compressible":true},"application/ibe-pp-data":{"source":"iana"},"application/iges":{"source":"iana"},"application/im-iscomposing+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/index":{"source":"iana"},"application/index.cmd":{"source":"iana"},"application/index.obj":{"source":"iana"},"application/index.response":{"source":"iana"},"application/index.vnd":{"source":"iana"},"application/inkml+xml":{"source":"iana","compressible":true,"extensions":["ink","inkml"]},"application/iotp":{"source":"iana"},"application/ipfix":{"source":"iana","extensions":["ipfix"]},"application/ipp":{"source":"iana"},"application/isup":{"source":"iana"},"application/its+xml":{"source":"iana","compressible":true,"extensions":["its"]},"application/java-archive":{"source":"apache","compressible":false,"extensions":["jar","war","ear"]},"application/java-serialized-object":{"source":"apache","compressible":false,"extensions":["ser"]},"application/java-vm":{"source":"apache","compressible":false,"extensions":["class"]},"application/javascript":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["js","mjs"]},"application/jf2feed+json":{"source":"iana","compressible":true},"application/jose":{"source":"iana"},"application/jose+json":{"source":"iana","compressible":true},"application/jrd+json":{"source":"iana","compressible":true},"application/jscalendar+json":{"source":"iana","compressible":true},"application/json":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["json","map"]},"application/json-patch+json":{"source":"iana","compressible":true},"application/json-seq":{"source":"iana"},"application/json5":{"extensions":["json5"]},"application/jsonml+json":{"source":"apache","compressible":true,"extensions":["jsonml"]},"application/jwk+json":{"source":"iana","compressible":true},"application/jwk-set+json":{"source":"iana","compressible":true},"application/jwt":{"source":"iana"},"application/kpml-request+xml":{"source":"iana","compressible":true},"application/kpml-response+xml":{"source":"iana","compressible":true},"application/ld+json":{"source":"iana","compressible":true,"extensions":["jsonld"]},"application/lgr+xml":{"source":"iana","compressible":true,"extensions":["lgr"]},"application/link-format":{"source":"iana"},"application/load-control+xml":{"source":"iana","compressible":true},"application/lost+xml":{"source":"iana","compressible":true,"extensions":["lostxml"]},"application/lostsync+xml":{"source":"iana","compressible":true},"application/lpf+zip":{"source":"iana","compressible":false},"application/lxf":{"source":"iana"},"application/mac-binhex40":{"source":"iana","extensions":["hqx"]},"application/mac-compactpro":{"source":"apache","extensions":["cpt"]},"application/macwriteii":{"source":"iana"},"application/mads+xml":{"source":"iana","compressible":true,"extensions":["mads"]},"application/manifest+json":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["webmanifest"]},"application/marc":{"source":"iana","extensions":["mrc"]},"application/marcxml+xml":{"source":"iana","compressible":true,"extensions":["mrcx"]},"application/mathematica":{"source":"iana","extensions":["ma","nb","mb"]},"application/mathml+xml":{"source":"iana","compressible":true,"extensions":["mathml"]},"application/mathml-content+xml":{"source":"iana","compressible":true},"application/mathml-presentation+xml":{"source":"iana","compressible":true},"application/mbms-associated-procedure-description+xml":{"source":"iana","compressible":true},"application/mbms-deregister+xml":{"source":"iana","compressible":true},"application/mbms-envelope+xml":{"source":"iana","compressible":true},"application/mbms-msk+xml":{"source":"iana","compressible":true},"application/mbms-msk-response+xml":{"source":"iana","compressible":true},"application/mbms-protection-description+xml":{"source":"iana","compressible":true},"application/mbms-reception-report+xml":{"source":"iana","compressible":true},"application/mbms-register+xml":{"source":"iana","compressible":true},"application/mbms-register-response+xml":{"source":"iana","compressible":true},"application/mbms-schedule+xml":{"source":"iana","compressible":true},"application/mbms-user-service-description+xml":{"source":"iana","compressible":true},"application/mbox":{"source":"iana","extensions":["mbox"]},"application/media-policy-dataset+xml":{"source":"iana","compressible":true,"extensions":["mpf"]},"application/media_control+xml":{"source":"iana","compressible":true},"application/mediaservercontrol+xml":{"source":"iana","compressible":true,"extensions":["mscml"]},"application/merge-patch+json":{"source":"iana","compressible":true},"application/metalink+xml":{"source":"apache","compressible":true,"extensions":["metalink"]},"application/metalink4+xml":{"source":"iana","compressible":true,"extensions":["meta4"]},"application/mets+xml":{"source":"iana","compressible":true,"extensions":["mets"]},"application/mf4":{"source":"iana"},"application/mikey":{"source":"iana"},"application/mipc":{"source":"iana"},"application/missing-blocks+cbor-seq":{"source":"iana"},"application/mmt-aei+xml":{"source":"iana","compressible":true,"extensions":["maei"]},"application/mmt-usd+xml":{"source":"iana","compressible":true,"extensions":["musd"]},"application/mods+xml":{"source":"iana","compressible":true,"extensions":["mods"]},"application/moss-keys":{"source":"iana"},"application/moss-signature":{"source":"iana"},"application/mosskey-data":{"source":"iana"},"application/mosskey-request":{"source":"iana"},"application/mp21":{"source":"iana","extensions":["m21","mp21"]},"application/mp4":{"source":"iana","extensions":["mp4s","m4p"]},"application/mpeg4-generic":{"source":"iana"},"application/mpeg4-iod":{"source":"iana"},"application/mpeg4-iod-xmt":{"source":"iana"},"application/mrb-consumer+xml":{"source":"iana","compressible":true},"application/mrb-publish+xml":{"source":"iana","compressible":true},"application/msc-ivr+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/msc-mixer+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/msword":{"source":"iana","compressible":false,"extensions":["doc","dot"]},"application/mud+json":{"source":"iana","compressible":true},"application/multipart-core":{"source":"iana"},"application/mxf":{"source":"iana","extensions":["mxf"]},"application/n-quads":{"source":"iana","extensions":["nq"]},"application/n-triples":{"source":"iana","extensions":["nt"]},"application/nasdata":{"source":"iana"},"application/news-checkgroups":{"source":"iana","charset":"US-ASCII"},"application/news-groupinfo":{"source":"iana","charset":"US-ASCII"},"application/news-transmission":{"source":"iana"},"application/nlsml+xml":{"source":"iana","compressible":true},"application/node":{"source":"iana","extensions":["cjs"]},"application/nss":{"source":"iana"},"application/oauth-authz-req+jwt":{"source":"iana"},"application/oblivious-dns-message":{"source":"iana"},"application/ocsp-request":{"source":"iana"},"application/ocsp-response":{"source":"iana"},"application/octet-stream":{"source":"iana","compressible":false,"extensions":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{"source":"iana","extensions":["oda"]},"application/odm+xml":{"source":"iana","compressible":true},"application/odx":{"source":"iana"},"application/oebps-package+xml":{"source":"iana","compressible":true,"extensions":["opf"]},"application/ogg":{"source":"iana","compressible":false,"extensions":["ogx"]},"application/omdoc+xml":{"source":"apache","compressible":true,"extensions":["omdoc"]},"application/onenote":{"source":"apache","extensions":["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{"source":"iana","compressible":true},"application/oscore":{"source":"iana"},"application/oxps":{"source":"iana","extensions":["oxps"]},"application/p21":{"source":"iana"},"application/p21+zip":{"source":"iana","compressible":false},"application/p2p-overlay+xml":{"source":"iana","compressible":true,"extensions":["relo"]},"application/parityfec":{"source":"iana"},"application/passport":{"source":"iana"},"application/patch-ops-error+xml":{"source":"iana","compressible":true,"extensions":["xer"]},"application/pdf":{"source":"iana","compressible":false,"extensions":["pdf"]},"application/pdx":{"source":"iana"},"application/pem-certificate-chain":{"source":"iana"},"application/pgp-encrypted":{"source":"iana","compressible":false,"extensions":["pgp"]},"application/pgp-keys":{"source":"iana","extensions":["asc"]},"application/pgp-signature":{"source":"iana","extensions":["asc","sig"]},"application/pics-rules":{"source":"apache","extensions":["prf"]},"application/pidf+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/pidf-diff+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/pkcs10":{"source":"iana","extensions":["p10"]},"application/pkcs12":{"source":"iana"},"application/pkcs7-mime":{"source":"iana","extensions":["p7m","p7c"]},"application/pkcs7-signature":{"source":"iana","extensions":["p7s"]},"application/pkcs8":{"source":"iana","extensions":["p8"]},"application/pkcs8-encrypted":{"source":"iana"},"application/pkix-attr-cert":{"source":"iana","extensions":["ac"]},"application/pkix-cert":{"source":"iana","extensions":["cer"]},"application/pkix-crl":{"source":"iana","extensions":["crl"]},"application/pkix-pkipath":{"source":"iana","extensions":["pkipath"]},"application/pkixcmp":{"source":"iana","extensions":["pki"]},"application/pls+xml":{"source":"iana","compressible":true,"extensions":["pls"]},"application/poc-settings+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/postscript":{"source":"iana","compressible":true,"extensions":["ai","eps","ps"]},"application/ppsp-tracker+json":{"source":"iana","compressible":true},"application/problem+json":{"source":"iana","compressible":true},"application/problem+xml":{"source":"iana","compressible":true},"application/provenance+xml":{"source":"iana","compressible":true,"extensions":["provx"]},"application/prs.alvestrand.titrax-sheet":{"source":"iana"},"application/prs.cww":{"source":"iana","extensions":["cww"]},"application/prs.cyn":{"source":"iana","charset":"7-BIT"},"application/prs.hpub+zip":{"source":"iana","compressible":false},"application/prs.nprend":{"source":"iana"},"application/prs.plucker":{"source":"iana"},"application/prs.rdf-xml-crypt":{"source":"iana"},"application/prs.xsf+xml":{"source":"iana","compressible":true},"application/pskc+xml":{"source":"iana","compressible":true,"extensions":["pskcxml"]},"application/pvd+json":{"source":"iana","compressible":true},"application/qsig":{"source":"iana"},"application/raml+yaml":{"compressible":true,"extensions":["raml"]},"application/raptorfec":{"source":"iana"},"application/rdap+json":{"source":"iana","compressible":true},"application/rdf+xml":{"source":"iana","compressible":true,"extensions":["rdf","owl"]},"application/reginfo+xml":{"source":"iana","compressible":true,"extensions":["rif"]},"application/relax-ng-compact-syntax":{"source":"iana","extensions":["rnc"]},"application/remote-printing":{"source":"iana"},"application/reputon+json":{"source":"iana","compressible":true},"application/resource-lists+xml":{"source":"iana","compressible":true,"extensions":["rl"]},"application/resource-lists-diff+xml":{"source":"iana","compressible":true,"extensions":["rld"]},"application/rfc+xml":{"source":"iana","compressible":true},"application/riscos":{"source":"iana"},"application/rlmi+xml":{"source":"iana","compressible":true},"application/rls-services+xml":{"source":"iana","compressible":true,"extensions":["rs"]},"application/route-apd+xml":{"source":"iana","compressible":true,"extensions":["rapd"]},"application/route-s-tsid+xml":{"source":"iana","compressible":true,"extensions":["sls"]},"application/route-usd+xml":{"source":"iana","compressible":true,"extensions":["rusd"]},"application/rpki-ghostbusters":{"source":"iana","extensions":["gbr"]},"application/rpki-manifest":{"source":"iana","extensions":["mft"]},"application/rpki-publication":{"source":"iana"},"application/rpki-roa":{"source":"iana","extensions":["roa"]},"application/rpki-updown":{"source":"iana"},"application/rsd+xml":{"source":"apache","compressible":true,"extensions":["rsd"]},"application/rss+xml":{"source":"apache","compressible":true,"extensions":["rss"]},"application/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"application/rtploopback":{"source":"iana"},"application/rtx":{"source":"iana"},"application/samlassertion+xml":{"source":"iana","compressible":true},"application/samlmetadata+xml":{"source":"iana","compressible":true},"application/sarif+json":{"source":"iana","compressible":true},"application/sarif-external-properties+json":{"source":"iana","compressible":true},"application/sbe":{"source":"iana"},"application/sbml+xml":{"source":"iana","compressible":true,"extensions":["sbml"]},"application/scaip+xml":{"source":"iana","compressible":true},"application/scim+json":{"source":"iana","compressible":true},"application/scvp-cv-request":{"source":"iana","extensions":["scq"]},"application/scvp-cv-response":{"source":"iana","extensions":["scs"]},"application/scvp-vp-request":{"source":"iana","extensions":["spq"]},"application/scvp-vp-response":{"source":"iana","extensions":["spp"]},"application/sdp":{"source":"iana","extensions":["sdp"]},"application/secevent+jwt":{"source":"iana"},"application/senml+cbor":{"source":"iana"},"application/senml+json":{"source":"iana","compressible":true},"application/senml+xml":{"source":"iana","compressible":true,"extensions":["senmlx"]},"application/senml-etch+cbor":{"source":"iana"},"application/senml-etch+json":{"source":"iana","compressible":true},"application/senml-exi":{"source":"iana"},"application/sensml+cbor":{"source":"iana"},"application/sensml+json":{"source":"iana","compressible":true},"application/sensml+xml":{"source":"iana","compressible":true,"extensions":["sensmlx"]},"application/sensml-exi":{"source":"iana"},"application/sep+xml":{"source":"iana","compressible":true},"application/sep-exi":{"source":"iana"},"application/session-info":{"source":"iana"},"application/set-payment":{"source":"iana"},"application/set-payment-initiation":{"source":"iana","extensions":["setpay"]},"application/set-registration":{"source":"iana"},"application/set-registration-initiation":{"source":"iana","extensions":["setreg"]},"application/sgml":{"source":"iana"},"application/sgml-open-catalog":{"source":"iana"},"application/shf+xml":{"source":"iana","compressible":true,"extensions":["shf"]},"application/sieve":{"source":"iana","extensions":["siv","sieve"]},"application/simple-filter+xml":{"source":"iana","compressible":true},"application/simple-message-summary":{"source":"iana"},"application/simplesymbolcontainer":{"source":"iana"},"application/sipc":{"source":"iana"},"application/slate":{"source":"iana"},"application/smil":{"source":"iana"},"application/smil+xml":{"source":"iana","compressible":true,"extensions":["smi","smil"]},"application/smpte336m":{"source":"iana"},"application/soap+fastinfoset":{"source":"iana"},"application/soap+xml":{"source":"iana","compressible":true},"application/sparql-query":{"source":"iana","extensions":["rq"]},"application/sparql-results+xml":{"source":"iana","compressible":true,"extensions":["srx"]},"application/spdx+json":{"source":"iana","compressible":true},"application/spirits-event+xml":{"source":"iana","compressible":true},"application/sql":{"source":"iana"},"application/srgs":{"source":"iana","extensions":["gram"]},"application/srgs+xml":{"source":"iana","compressible":true,"extensions":["grxml"]},"application/sru+xml":{"source":"iana","compressible":true,"extensions":["sru"]},"application/ssdl+xml":{"source":"apache","compressible":true,"extensions":["ssdl"]},"application/ssml+xml":{"source":"iana","compressible":true,"extensions":["ssml"]},"application/stix+json":{"source":"iana","compressible":true},"application/swid+xml":{"source":"iana","compressible":true,"extensions":["swidtag"]},"application/tamp-apex-update":{"source":"iana"},"application/tamp-apex-update-confirm":{"source":"iana"},"application/tamp-community-update":{"source":"iana"},"application/tamp-community-update-confirm":{"source":"iana"},"application/tamp-error":{"source":"iana"},"application/tamp-sequence-adjust":{"source":"iana"},"application/tamp-sequence-adjust-confirm":{"source":"iana"},"application/tamp-status-query":{"source":"iana"},"application/tamp-status-response":{"source":"iana"},"application/tamp-update":{"source":"iana"},"application/tamp-update-confirm":{"source":"iana"},"application/tar":{"compressible":true},"application/taxii+json":{"source":"iana","compressible":true},"application/td+json":{"source":"iana","compressible":true},"application/tei+xml":{"source":"iana","compressible":true,"extensions":["tei","teicorpus"]},"application/tetra_isi":{"source":"iana"},"application/thraud+xml":{"source":"iana","compressible":true,"extensions":["tfi"]},"application/timestamp-query":{"source":"iana"},"application/timestamp-reply":{"source":"iana"},"application/timestamped-data":{"source":"iana","extensions":["tsd"]},"application/tlsrpt+gzip":{"source":"iana"},"application/tlsrpt+json":{"source":"iana","compressible":true},"application/tnauthlist":{"source":"iana"},"application/token-introspection+jwt":{"source":"iana"},"application/toml":{"compressible":true,"extensions":["toml"]},"application/trickle-ice-sdpfrag":{"source":"iana"},"application/trig":{"source":"iana","extensions":["trig"]},"application/ttml+xml":{"source":"iana","compressible":true,"extensions":["ttml"]},"application/tve-trigger":{"source":"iana"},"application/tzif":{"source":"iana"},"application/tzif-leap":{"source":"iana"},"application/ubjson":{"compressible":false,"extensions":["ubj"]},"application/ulpfec":{"source":"iana"},"application/urc-grpsheet+xml":{"source":"iana","compressible":true},"application/urc-ressheet+xml":{"source":"iana","compressible":true,"extensions":["rsheet"]},"application/urc-targetdesc+xml":{"source":"iana","compressible":true,"extensions":["td"]},"application/urc-uisocketdesc+xml":{"source":"iana","compressible":true},"application/vcard+json":{"source":"iana","compressible":true},"application/vcard+xml":{"source":"iana","compressible":true},"application/vemmi":{"source":"iana"},"application/vividence.scriptfile":{"source":"apache"},"application/vnd.1000minds.decision-model+xml":{"source":"iana","compressible":true,"extensions":["1km"]},"application/vnd.3gpp-prose+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-prose-pc3ch+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-v2x-local-service-information":{"source":"iana"},"application/vnd.3gpp.5gnas":{"source":"iana"},"application/vnd.3gpp.access-transfer-events+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.bsf+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.gmop+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.gtpc":{"source":"iana"},"application/vnd.3gpp.interworking-data":{"source":"iana"},"application/vnd.3gpp.lpp":{"source":"iana"},"application/vnd.3gpp.mc-signalling-ear":{"source":"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-payload":{"source":"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-signalling":{"source":"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-floor-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-signed+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-ue-init-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-transmission-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mid-call+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.ngap":{"source":"iana"},"application/vnd.3gpp.pfcp":{"source":"iana"},"application/vnd.3gpp.pic-bw-large":{"source":"iana","extensions":["plb"]},"application/vnd.3gpp.pic-bw-small":{"source":"iana","extensions":["psb"]},"application/vnd.3gpp.pic-bw-var":{"source":"iana","extensions":["pvb"]},"application/vnd.3gpp.s1ap":{"source":"iana"},"application/vnd.3gpp.sms":{"source":"iana"},"application/vnd.3gpp.sms+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-ext+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.state-and-event-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.ussd+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.bcmcsinfo+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.sms":{"source":"iana"},"application/vnd.3gpp2.tcap":{"source":"iana","extensions":["tcap"]},"application/vnd.3lightssoftware.imagescal":{"source":"iana"},"application/vnd.3m.post-it-notes":{"source":"iana","extensions":["pwn"]},"application/vnd.accpac.simply.aso":{"source":"iana","extensions":["aso"]},"application/vnd.accpac.simply.imp":{"source":"iana","extensions":["imp"]},"application/vnd.acucobol":{"source":"iana","extensions":["acu"]},"application/vnd.acucorp":{"source":"iana","extensions":["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{"source":"apache","compressible":false,"extensions":["air"]},"application/vnd.adobe.flash.movie":{"source":"iana"},"application/vnd.adobe.formscentral.fcdt":{"source":"iana","extensions":["fcdt"]},"application/vnd.adobe.fxp":{"source":"iana","extensions":["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{"source":"iana"},"application/vnd.adobe.xdp+xml":{"source":"iana","compressible":true,"extensions":["xdp"]},"application/vnd.adobe.xfdf":{"source":"iana","extensions":["xfdf"]},"application/vnd.aether.imp":{"source":"iana"},"application/vnd.afpc.afplinedata":{"source":"iana"},"application/vnd.afpc.afplinedata-pagedef":{"source":"iana"},"application/vnd.afpc.cmoca-cmresource":{"source":"iana"},"application/vnd.afpc.foca-charset":{"source":"iana"},"application/vnd.afpc.foca-codedfont":{"source":"iana"},"application/vnd.afpc.foca-codepage":{"source":"iana"},"application/vnd.afpc.modca":{"source":"iana"},"application/vnd.afpc.modca-cmtable":{"source":"iana"},"application/vnd.afpc.modca-formdef":{"source":"iana"},"application/vnd.afpc.modca-mediummap":{"source":"iana"},"application/vnd.afpc.modca-objectcontainer":{"source":"iana"},"application/vnd.afpc.modca-overlay":{"source":"iana"},"application/vnd.afpc.modca-pagesegment":{"source":"iana"},"application/vnd.age":{"source":"iana","extensions":["age"]},"application/vnd.ah-barcode":{"source":"iana"},"application/vnd.ahead.space":{"source":"iana","extensions":["ahead"]},"application/vnd.airzip.filesecure.azf":{"source":"iana","extensions":["azf"]},"application/vnd.airzip.filesecure.azs":{"source":"iana","extensions":["azs"]},"application/vnd.amadeus+json":{"source":"iana","compressible":true},"application/vnd.amazon.ebook":{"source":"apache","extensions":["azw"]},"application/vnd.amazon.mobi8-ebook":{"source":"iana"},"application/vnd.americandynamics.acc":{"source":"iana","extensions":["acc"]},"application/vnd.amiga.ami":{"source":"iana","extensions":["ami"]},"application/vnd.amundsen.maze+xml":{"source":"iana","compressible":true},"application/vnd.android.ota":{"source":"iana"},"application/vnd.android.package-archive":{"source":"apache","compressible":false,"extensions":["apk"]},"application/vnd.anki":{"source":"iana"},"application/vnd.anser-web-certificate-issue-initiation":{"source":"iana","extensions":["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{"source":"apache","extensions":["fti"]},"application/vnd.antix.game-component":{"source":"iana","extensions":["atx"]},"application/vnd.apache.arrow.file":{"source":"iana"},"application/vnd.apache.arrow.stream":{"source":"iana"},"application/vnd.apache.thrift.binary":{"source":"iana"},"application/vnd.apache.thrift.compact":{"source":"iana"},"application/vnd.apache.thrift.json":{"source":"iana"},"application/vnd.api+json":{"source":"iana","compressible":true},"application/vnd.aplextor.warrp+json":{"source":"iana","compressible":true},"application/vnd.apothekende.reservation+json":{"source":"iana","compressible":true},"application/vnd.apple.installer+xml":{"source":"iana","compressible":true,"extensions":["mpkg"]},"application/vnd.apple.keynote":{"source":"iana","extensions":["key"]},"application/vnd.apple.mpegurl":{"source":"iana","extensions":["m3u8"]},"application/vnd.apple.numbers":{"source":"iana","extensions":["numbers"]},"application/vnd.apple.pages":{"source":"iana","extensions":["pages"]},"application/vnd.apple.pkpass":{"compressible":false,"extensions":["pkpass"]},"application/vnd.arastra.swi":{"source":"iana"},"application/vnd.aristanetworks.swi":{"source":"iana","extensions":["swi"]},"application/vnd.artisan+json":{"source":"iana","compressible":true},"application/vnd.artsquare":{"source":"iana"},"application/vnd.astraea-software.iota":{"source":"iana","extensions":["iota"]},"application/vnd.audiograph":{"source":"iana","extensions":["aep"]},"application/vnd.autopackage":{"source":"iana"},"application/vnd.avalon+json":{"source":"iana","compressible":true},"application/vnd.avistar+xml":{"source":"iana","compressible":true},"application/vnd.balsamiq.bmml+xml":{"source":"iana","compressible":true,"extensions":["bmml"]},"application/vnd.balsamiq.bmpr":{"source":"iana"},"application/vnd.banana-accounting":{"source":"iana"},"application/vnd.bbf.usp.error":{"source":"iana"},"application/vnd.bbf.usp.msg":{"source":"iana"},"application/vnd.bbf.usp.msg+json":{"source":"iana","compressible":true},"application/vnd.bekitzur-stech+json":{"source":"iana","compressible":true},"application/vnd.bint.med-content":{"source":"iana"},"application/vnd.biopax.rdf+xml":{"source":"iana","compressible":true},"application/vnd.blink-idb-value-wrapper":{"source":"iana"},"application/vnd.blueice.multipass":{"source":"iana","extensions":["mpm"]},"application/vnd.bluetooth.ep.oob":{"source":"iana"},"application/vnd.bluetooth.le.oob":{"source":"iana"},"application/vnd.bmi":{"source":"iana","extensions":["bmi"]},"application/vnd.bpf":{"source":"iana"},"application/vnd.bpf3":{"source":"iana"},"application/vnd.businessobjects":{"source":"iana","extensions":["rep"]},"application/vnd.byu.uapi+json":{"source":"iana","compressible":true},"application/vnd.cab-jscript":{"source":"iana"},"application/vnd.canon-cpdl":{"source":"iana"},"application/vnd.canon-lips":{"source":"iana"},"application/vnd.capasystems-pg+json":{"source":"iana","compressible":true},"application/vnd.cendio.thinlinc.clientconf":{"source":"iana"},"application/vnd.century-systems.tcp_stream":{"source":"iana"},"application/vnd.chemdraw+xml":{"source":"iana","compressible":true,"extensions":["cdxml"]},"application/vnd.chess-pgn":{"source":"iana"},"application/vnd.chipnuts.karaoke-mmd":{"source":"iana","extensions":["mmd"]},"application/vnd.ciedi":{"source":"iana"},"application/vnd.cinderella":{"source":"iana","extensions":["cdy"]},"application/vnd.cirpack.isdn-ext":{"source":"iana"},"application/vnd.citationstyles.style+xml":{"source":"iana","compressible":true,"extensions":["csl"]},"application/vnd.claymore":{"source":"iana","extensions":["cla"]},"application/vnd.cloanto.rp9":{"source":"iana","extensions":["rp9"]},"application/vnd.clonk.c4group":{"source":"iana","extensions":["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{"source":"iana","extensions":["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{"source":"iana","extensions":["c11amz"]},"application/vnd.coffeescript":{"source":"iana"},"application/vnd.collabio.xodocuments.document":{"source":"iana"},"application/vnd.collabio.xodocuments.document-template":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation-template":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{"source":"iana"},"application/vnd.collection+json":{"source":"iana","compressible":true},"application/vnd.collection.doc+json":{"source":"iana","compressible":true},"application/vnd.collection.next+json":{"source":"iana","compressible":true},"application/vnd.comicbook+zip":{"source":"iana","compressible":false},"application/vnd.comicbook-rar":{"source":"iana"},"application/vnd.commerce-battelle":{"source":"iana"},"application/vnd.commonspace":{"source":"iana","extensions":["csp"]},"application/vnd.contact.cmsg":{"source":"iana","extensions":["cdbcmsg"]},"application/vnd.coreos.ignition+json":{"source":"iana","compressible":true},"application/vnd.cosmocaller":{"source":"iana","extensions":["cmc"]},"application/vnd.crick.clicker":{"source":"iana","extensions":["clkx"]},"application/vnd.crick.clicker.keyboard":{"source":"iana","extensions":["clkk"]},"application/vnd.crick.clicker.palette":{"source":"iana","extensions":["clkp"]},"application/vnd.crick.clicker.template":{"source":"iana","extensions":["clkt"]},"application/vnd.crick.clicker.wordbank":{"source":"iana","extensions":["clkw"]},"application/vnd.criticaltools.wbs+xml":{"source":"iana","compressible":true,"extensions":["wbs"]},"application/vnd.cryptii.pipe+json":{"source":"iana","compressible":true},"application/vnd.crypto-shade-file":{"source":"iana"},"application/vnd.cryptomator.encrypted":{"source":"iana"},"application/vnd.cryptomator.vault":{"source":"iana"},"application/vnd.ctc-posml":{"source":"iana","extensions":["pml"]},"application/vnd.ctct.ws+xml":{"source":"iana","compressible":true},"application/vnd.cups-pdf":{"source":"iana"},"application/vnd.cups-postscript":{"source":"iana"},"application/vnd.cups-ppd":{"source":"iana","extensions":["ppd"]},"application/vnd.cups-raster":{"source":"iana"},"application/vnd.cups-raw":{"source":"iana"},"application/vnd.curl":{"source":"iana"},"application/vnd.curl.car":{"source":"apache","extensions":["car"]},"application/vnd.curl.pcurl":{"source":"apache","extensions":["pcurl"]},"application/vnd.cyan.dean.root+xml":{"source":"iana","compressible":true},"application/vnd.cybank":{"source":"iana"},"application/vnd.cyclonedx+json":{"source":"iana","compressible":true},"application/vnd.cyclonedx+xml":{"source":"iana","compressible":true},"application/vnd.d2l.coursepackage1p0+zip":{"source":"iana","compressible":false},"application/vnd.d3m-dataset":{"source":"iana"},"application/vnd.d3m-problem":{"source":"iana"},"application/vnd.dart":{"source":"iana","compressible":true,"extensions":["dart"]},"application/vnd.data-vision.rdz":{"source":"iana","extensions":["rdz"]},"application/vnd.datapackage+json":{"source":"iana","compressible":true},"application/vnd.dataresource+json":{"source":"iana","compressible":true},"application/vnd.dbf":{"source":"iana","extensions":["dbf"]},"application/vnd.debian.binary-package":{"source":"iana"},"application/vnd.dece.data":{"source":"iana","extensions":["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{"source":"iana","compressible":true,"extensions":["uvt","uvvt"]},"application/vnd.dece.unspecified":{"source":"iana","extensions":["uvx","uvvx"]},"application/vnd.dece.zip":{"source":"iana","extensions":["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{"source":"iana","extensions":["fe_launch"]},"application/vnd.desmume.movie":{"source":"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{"source":"iana"},"application/vnd.dm.delegation+xml":{"source":"iana","compressible":true},"application/vnd.dna":{"source":"iana","extensions":["dna"]},"application/vnd.document+json":{"source":"iana","compressible":true},"application/vnd.dolby.mlp":{"source":"apache","extensions":["mlp"]},"application/vnd.dolby.mobile.1":{"source":"iana"},"application/vnd.dolby.mobile.2":{"source":"iana"},"application/vnd.doremir.scorecloud-binary-document":{"source":"iana"},"application/vnd.dpgraph":{"source":"iana","extensions":["dpg"]},"application/vnd.dreamfactory":{"source":"iana","extensions":["dfac"]},"application/vnd.drive+json":{"source":"iana","compressible":true},"application/vnd.ds-keypoint":{"source":"apache","extensions":["kpxx"]},"application/vnd.dtg.local":{"source":"iana"},"application/vnd.dtg.local.flash":{"source":"iana"},"application/vnd.dtg.local.html":{"source":"iana"},"application/vnd.dvb.ait":{"source":"iana","extensions":["ait"]},"application/vnd.dvb.dvbisl+xml":{"source":"iana","compressible":true},"application/vnd.dvb.dvbj":{"source":"iana"},"application/vnd.dvb.esgcontainer":{"source":"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess2":{"source":"iana"},"application/vnd.dvb.ipdcesgpdd":{"source":"iana"},"application/vnd.dvb.ipdcroaming":{"source":"iana"},"application/vnd.dvb.iptv.alfec-base":{"source":"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{"source":"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-container+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-generic+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-msglist+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-request+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-response+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-init+xml":{"source":"iana","compressible":true},"application/vnd.dvb.pfr":{"source":"iana"},"application/vnd.dvb.service":{"source":"iana","extensions":["svc"]},"application/vnd.dxr":{"source":"iana"},"application/vnd.dynageo":{"source":"iana","extensions":["geo"]},"application/vnd.dzr":{"source":"iana"},"application/vnd.easykaraoke.cdgdownload":{"source":"iana"},"application/vnd.ecdis-update":{"source":"iana"},"application/vnd.ecip.rlp":{"source":"iana"},"application/vnd.eclipse.ditto+json":{"source":"iana","compressible":true},"application/vnd.ecowin.chart":{"source":"iana","extensions":["mag"]},"application/vnd.ecowin.filerequest":{"source":"iana"},"application/vnd.ecowin.fileupdate":{"source":"iana"},"application/vnd.ecowin.series":{"source":"iana"},"application/vnd.ecowin.seriesrequest":{"source":"iana"},"application/vnd.ecowin.seriesupdate":{"source":"iana"},"application/vnd.efi.img":{"source":"iana"},"application/vnd.efi.iso":{"source":"iana"},"application/vnd.emclient.accessrequest+xml":{"source":"iana","compressible":true},"application/vnd.enliven":{"source":"iana","extensions":["nml"]},"application/vnd.enphase.envoy":{"source":"iana"},"application/vnd.eprints.data+xml":{"source":"iana","compressible":true},"application/vnd.epson.esf":{"source":"iana","extensions":["esf"]},"application/vnd.epson.msf":{"source":"iana","extensions":["msf"]},"application/vnd.epson.quickanime":{"source":"iana","extensions":["qam"]},"application/vnd.epson.salt":{"source":"iana","extensions":["slt"]},"application/vnd.epson.ssf":{"source":"iana","extensions":["ssf"]},"application/vnd.ericsson.quickcall":{"source":"iana"},"application/vnd.espass-espass+zip":{"source":"iana","compressible":false},"application/vnd.eszigno3+xml":{"source":"iana","compressible":true,"extensions":["es3","et3"]},"application/vnd.etsi.aoc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.asic-e+zip":{"source":"iana","compressible":false},"application/vnd.etsi.asic-s+zip":{"source":"iana","compressible":false},"application/vnd.etsi.cug+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvcommand+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-bc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-cod+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-npvr+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvservice+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsync+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvueprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mcid+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mheg5":{"source":"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{"source":"iana","compressible":true},"application/vnd.etsi.pstn+xml":{"source":"iana","compressible":true},"application/vnd.etsi.sci+xml":{"source":"iana","compressible":true},"application/vnd.etsi.simservs+xml":{"source":"iana","compressible":true},"application/vnd.etsi.timestamp-token":{"source":"iana"},"application/vnd.etsi.tsl+xml":{"source":"iana","compressible":true},"application/vnd.etsi.tsl.der":{"source":"iana"},"application/vnd.eu.kasparian.car+json":{"source":"iana","compressible":true},"application/vnd.eudora.data":{"source":"iana"},"application/vnd.evolv.ecig.profile":{"source":"iana"},"application/vnd.evolv.ecig.settings":{"source":"iana"},"application/vnd.evolv.ecig.theme":{"source":"iana"},"application/vnd.exstream-empower+zip":{"source":"iana","compressible":false},"application/vnd.exstream-package":{"source":"iana"},"application/vnd.ezpix-album":{"source":"iana","extensions":["ez2"]},"application/vnd.ezpix-package":{"source":"iana","extensions":["ez3"]},"application/vnd.f-secure.mobile":{"source":"iana"},"application/vnd.familysearch.gedcom+zip":{"source":"iana","compressible":false},"application/vnd.fastcopy-disk-image":{"source":"iana"},"application/vnd.fdf":{"source":"iana","extensions":["fdf"]},"application/vnd.fdsn.mseed":{"source":"iana","extensions":["mseed"]},"application/vnd.fdsn.seed":{"source":"iana","extensions":["seed","dataless"]},"application/vnd.ffsns":{"source":"iana"},"application/vnd.ficlab.flb+zip":{"source":"iana","compressible":false},"application/vnd.filmit.zfc":{"source":"iana"},"application/vnd.fints":{"source":"iana"},"application/vnd.firemonkeys.cloudcell":{"source":"iana"},"application/vnd.flographit":{"source":"iana","extensions":["gph"]},"application/vnd.fluxtime.clip":{"source":"iana","extensions":["ftc"]},"application/vnd.font-fontforge-sfd":{"source":"iana"},"application/vnd.framemaker":{"source":"iana","extensions":["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{"source":"iana","extensions":["fnc"]},"application/vnd.frogans.ltf":{"source":"iana","extensions":["ltf"]},"application/vnd.fsc.weblaunch":{"source":"iana","extensions":["fsc"]},"application/vnd.fujifilm.fb.docuworks":{"source":"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{"source":"iana"},"application/vnd.fujifilm.fb.docuworks.container":{"source":"iana"},"application/vnd.fujifilm.fb.jfi+xml":{"source":"iana","compressible":true},"application/vnd.fujitsu.oasys":{"source":"iana","extensions":["oas"]},"application/vnd.fujitsu.oasys2":{"source":"iana","extensions":["oa2"]},"application/vnd.fujitsu.oasys3":{"source":"iana","extensions":["oa3"]},"application/vnd.fujitsu.oasysgp":{"source":"iana","extensions":["fg5"]},"application/vnd.fujitsu.oasysprs":{"source":"iana","extensions":["bh2"]},"application/vnd.fujixerox.art-ex":{"source":"iana"},"application/vnd.fujixerox.art4":{"source":"iana"},"application/vnd.fujixerox.ddd":{"source":"iana","extensions":["ddd"]},"application/vnd.fujixerox.docuworks":{"source":"iana","extensions":["xdw"]},"application/vnd.fujixerox.docuworks.binder":{"source":"iana","extensions":["xbd"]},"application/vnd.fujixerox.docuworks.container":{"source":"iana"},"application/vnd.fujixerox.hbpl":{"source":"iana"},"application/vnd.fut-misnet":{"source":"iana"},"application/vnd.futoin+cbor":{"source":"iana"},"application/vnd.futoin+json":{"source":"iana","compressible":true},"application/vnd.fuzzysheet":{"source":"iana","extensions":["fzs"]},"application/vnd.genomatix.tuxedo":{"source":"iana","extensions":["txd"]},"application/vnd.gentics.grd+json":{"source":"iana","compressible":true},"application/vnd.geo+json":{"source":"iana","compressible":true},"application/vnd.geocube+xml":{"source":"iana","compressible":true},"application/vnd.geogebra.file":{"source":"iana","extensions":["ggb"]},"application/vnd.geogebra.slides":{"source":"iana"},"application/vnd.geogebra.tool":{"source":"iana","extensions":["ggt"]},"application/vnd.geometry-explorer":{"source":"iana","extensions":["gex","gre"]},"application/vnd.geonext":{"source":"iana","extensions":["gxt"]},"application/vnd.geoplan":{"source":"iana","extensions":["g2w"]},"application/vnd.geospace":{"source":"iana","extensions":["g3w"]},"application/vnd.gerber":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt-response":{"source":"iana"},"application/vnd.gmx":{"source":"iana","extensions":["gmx"]},"application/vnd.google-apps.document":{"compressible":false,"extensions":["gdoc"]},"application/vnd.google-apps.presentation":{"compressible":false,"extensions":["gslides"]},"application/vnd.google-apps.spreadsheet":{"compressible":false,"extensions":["gsheet"]},"application/vnd.google-earth.kml+xml":{"source":"iana","compressible":true,"extensions":["kml"]},"application/vnd.google-earth.kmz":{"source":"iana","compressible":false,"extensions":["kmz"]},"application/vnd.gov.sk.e-form+xml":{"source":"iana","compressible":true},"application/vnd.gov.sk.e-form+zip":{"source":"iana","compressible":false},"application/vnd.gov.sk.xmldatacontainer+xml":{"source":"iana","compressible":true},"application/vnd.grafeq":{"source":"iana","extensions":["gqf","gqs"]},"application/vnd.gridmp":{"source":"iana"},"application/vnd.groove-account":{"source":"iana","extensions":["gac"]},"application/vnd.groove-help":{"source":"iana","extensions":["ghf"]},"application/vnd.groove-identity-message":{"source":"iana","extensions":["gim"]},"application/vnd.groove-injector":{"source":"iana","extensions":["grv"]},"application/vnd.groove-tool-message":{"source":"iana","extensions":["gtm"]},"application/vnd.groove-tool-template":{"source":"iana","extensions":["tpl"]},"application/vnd.groove-vcard":{"source":"iana","extensions":["vcg"]},"application/vnd.hal+json":{"source":"iana","compressible":true},"application/vnd.hal+xml":{"source":"iana","compressible":true,"extensions":["hal"]},"application/vnd.handheld-entertainment+xml":{"source":"iana","compressible":true,"extensions":["zmm"]},"application/vnd.hbci":{"source":"iana","extensions":["hbci"]},"application/vnd.hc+json":{"source":"iana","compressible":true},"application/vnd.hcl-bireports":{"source":"iana"},"application/vnd.hdt":{"source":"iana"},"application/vnd.heroku+json":{"source":"iana","compressible":true},"application/vnd.hhe.lesson-player":{"source":"iana","extensions":["les"]},"application/vnd.hl7cda+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.hl7v2+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.hp-hpgl":{"source":"iana","extensions":["hpgl"]},"application/vnd.hp-hpid":{"source":"iana","extensions":["hpid"]},"application/vnd.hp-hps":{"source":"iana","extensions":["hps"]},"application/vnd.hp-jlyt":{"source":"iana","extensions":["jlt"]},"application/vnd.hp-pcl":{"source":"iana","extensions":["pcl"]},"application/vnd.hp-pclxl":{"source":"iana","extensions":["pclxl"]},"application/vnd.httphone":{"source":"iana"},"application/vnd.hydrostatix.sof-data":{"source":"iana","extensions":["sfd-hdstx"]},"application/vnd.hyper+json":{"source":"iana","compressible":true},"application/vnd.hyper-item+json":{"source":"iana","compressible":true},"application/vnd.hyperdrive+json":{"source":"iana","compressible":true},"application/vnd.hzn-3d-crossword":{"source":"iana"},"application/vnd.ibm.afplinedata":{"source":"iana"},"application/vnd.ibm.electronic-media":{"source":"iana"},"application/vnd.ibm.minipay":{"source":"iana","extensions":["mpy"]},"application/vnd.ibm.modcap":{"source":"iana","extensions":["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{"source":"iana","extensions":["irm"]},"application/vnd.ibm.secure-container":{"source":"iana","extensions":["sc"]},"application/vnd.iccprofile":{"source":"iana","extensions":["icc","icm"]},"application/vnd.ieee.1905":{"source":"iana"},"application/vnd.igloader":{"source":"iana","extensions":["igl"]},"application/vnd.imagemeter.folder+zip":{"source":"iana","compressible":false},"application/vnd.imagemeter.image+zip":{"source":"iana","compressible":false},"application/vnd.immervision-ivp":{"source":"iana","extensions":["ivp"]},"application/vnd.immervision-ivu":{"source":"iana","extensions":["ivu"]},"application/vnd.ims.imsccv1p1":{"source":"iana"},"application/vnd.ims.imsccv1p2":{"source":"iana"},"application/vnd.ims.imsccv1p3":{"source":"iana"},"application/vnd.ims.lis.v2.result+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy.id+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings.simple+json":{"source":"iana","compressible":true},"application/vnd.informedcontrol.rms+xml":{"source":"iana","compressible":true},"application/vnd.informix-visionary":{"source":"iana"},"application/vnd.infotech.project":{"source":"iana"},"application/vnd.infotech.project+xml":{"source":"iana","compressible":true},"application/vnd.innopath.wamp.notification":{"source":"iana"},"application/vnd.insors.igm":{"source":"iana","extensions":["igm"]},"application/vnd.intercon.formnet":{"source":"iana","extensions":["xpw","xpx"]},"application/vnd.intergeo":{"source":"iana","extensions":["i2g"]},"application/vnd.intertrust.digibox":{"source":"iana"},"application/vnd.intertrust.nncp":{"source":"iana"},"application/vnd.intu.qbo":{"source":"iana","extensions":["qbo"]},"application/vnd.intu.qfx":{"source":"iana","extensions":["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.conceptitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.knowledgeitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsmessage+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.packageitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.planningitem+xml":{"source":"iana","compressible":true},"application/vnd.ipunplugged.rcprofile":{"source":"iana","extensions":["rcprofile"]},"application/vnd.irepository.package+xml":{"source":"iana","compressible":true,"extensions":["irp"]},"application/vnd.is-xpr":{"source":"iana","extensions":["xpr"]},"application/vnd.isac.fcs":{"source":"iana","extensions":["fcs"]},"application/vnd.iso11783-10+zip":{"source":"iana","compressible":false},"application/vnd.jam":{"source":"iana","extensions":["jam"]},"application/vnd.japannet-directory-service":{"source":"iana"},"application/vnd.japannet-jpnstore-wakeup":{"source":"iana"},"application/vnd.japannet-payment-wakeup":{"source":"iana"},"application/vnd.japannet-registration":{"source":"iana"},"application/vnd.japannet-registration-wakeup":{"source":"iana"},"application/vnd.japannet-setstore-wakeup":{"source":"iana"},"application/vnd.japannet-verification":{"source":"iana"},"application/vnd.japannet-verification-wakeup":{"source":"iana"},"application/vnd.jcp.javame.midlet-rms":{"source":"iana","extensions":["rms"]},"application/vnd.jisp":{"source":"iana","extensions":["jisp"]},"application/vnd.joost.joda-archive":{"source":"iana","extensions":["joda"]},"application/vnd.jsk.isdn-ngn":{"source":"iana"},"application/vnd.kahootz":{"source":"iana","extensions":["ktz","ktr"]},"application/vnd.kde.karbon":{"source":"iana","extensions":["karbon"]},"application/vnd.kde.kchart":{"source":"iana","extensions":["chrt"]},"application/vnd.kde.kformula":{"source":"iana","extensions":["kfo"]},"application/vnd.kde.kivio":{"source":"iana","extensions":["flw"]},"application/vnd.kde.kontour":{"source":"iana","extensions":["kon"]},"application/vnd.kde.kpresenter":{"source":"iana","extensions":["kpr","kpt"]},"application/vnd.kde.kspread":{"source":"iana","extensions":["ksp"]},"application/vnd.kde.kword":{"source":"iana","extensions":["kwd","kwt"]},"application/vnd.kenameaapp":{"source":"iana","extensions":["htke"]},"application/vnd.kidspiration":{"source":"iana","extensions":["kia"]},"application/vnd.kinar":{"source":"iana","extensions":["kne","knp"]},"application/vnd.koan":{"source":"iana","extensions":["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{"source":"iana","extensions":["sse"]},"application/vnd.las":{"source":"iana"},"application/vnd.las.las+json":{"source":"iana","compressible":true},"application/vnd.las.las+xml":{"source":"iana","compressible":true,"extensions":["lasxml"]},"application/vnd.laszip":{"source":"iana"},"application/vnd.leap+json":{"source":"iana","compressible":true},"application/vnd.liberty-request+xml":{"source":"iana","compressible":true},"application/vnd.llamagraphics.life-balance.desktop":{"source":"iana","extensions":["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{"source":"iana","compressible":true,"extensions":["lbe"]},"application/vnd.logipipe.circuit+zip":{"source":"iana","compressible":false},"application/vnd.loom":{"source":"iana"},"application/vnd.lotus-1-2-3":{"source":"iana","extensions":["123"]},"application/vnd.lotus-approach":{"source":"iana","extensions":["apr"]},"application/vnd.lotus-freelance":{"source":"iana","extensions":["pre"]},"application/vnd.lotus-notes":{"source":"iana","extensions":["nsf"]},"application/vnd.lotus-organizer":{"source":"iana","extensions":["org"]},"application/vnd.lotus-screencam":{"source":"iana","extensions":["scm"]},"application/vnd.lotus-wordpro":{"source":"iana","extensions":["lwp"]},"application/vnd.macports.portpkg":{"source":"iana","extensions":["portpkg"]},"application/vnd.mapbox-vector-tile":{"source":"iana","extensions":["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.conftoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.license+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.mdcf":{"source":"iana"},"application/vnd.mason+json":{"source":"iana","compressible":true},"application/vnd.maxar.archive.3tz+zip":{"source":"iana","compressible":false},"application/vnd.maxmind.maxmind-db":{"source":"iana"},"application/vnd.mcd":{"source":"iana","extensions":["mcd"]},"application/vnd.medcalcdata":{"source":"iana","extensions":["mc1"]},"application/vnd.mediastation.cdkey":{"source":"iana","extensions":["cdkey"]},"application/vnd.meridian-slingshot":{"source":"iana"},"application/vnd.mfer":{"source":"iana","extensions":["mwf"]},"application/vnd.mfmp":{"source":"iana","extensions":["mfm"]},"application/vnd.micro+json":{"source":"iana","compressible":true},"application/vnd.micrografx.flo":{"source":"iana","extensions":["flo"]},"application/vnd.micrografx.igx":{"source":"iana","extensions":["igx"]},"application/vnd.microsoft.portable-executable":{"source":"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{"source":"iana"},"application/vnd.miele+json":{"source":"iana","compressible":true},"application/vnd.mif":{"source":"iana","extensions":["mif"]},"application/vnd.minisoft-hp3000-save":{"source":"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{"source":"iana"},"application/vnd.mobius.daf":{"source":"iana","extensions":["daf"]},"application/vnd.mobius.dis":{"source":"iana","extensions":["dis"]},"application/vnd.mobius.mbk":{"source":"iana","extensions":["mbk"]},"application/vnd.mobius.mqy":{"source":"iana","extensions":["mqy"]},"application/vnd.mobius.msl":{"source":"iana","extensions":["msl"]},"application/vnd.mobius.plc":{"source":"iana","extensions":["plc"]},"application/vnd.mobius.txf":{"source":"iana","extensions":["txf"]},"application/vnd.mophun.application":{"source":"iana","extensions":["mpn"]},"application/vnd.mophun.certificate":{"source":"iana","extensions":["mpc"]},"application/vnd.motorola.flexsuite":{"source":"iana"},"application/vnd.motorola.flexsuite.adsi":{"source":"iana"},"application/vnd.motorola.flexsuite.fis":{"source":"iana"},"application/vnd.motorola.flexsuite.gotap":{"source":"iana"},"application/vnd.motorola.flexsuite.kmr":{"source":"iana"},"application/vnd.motorola.flexsuite.ttc":{"source":"iana"},"application/vnd.motorola.flexsuite.wem":{"source":"iana"},"application/vnd.motorola.iprm":{"source":"iana"},"application/vnd.mozilla.xul+xml":{"source":"iana","compressible":true,"extensions":["xul"]},"application/vnd.ms-3mfdocument":{"source":"iana"},"application/vnd.ms-artgalry":{"source":"iana","extensions":["cil"]},"application/vnd.ms-asf":{"source":"iana"},"application/vnd.ms-cab-compressed":{"source":"iana","extensions":["cab"]},"application/vnd.ms-color.iccprofile":{"source":"apache"},"application/vnd.ms-excel":{"source":"iana","compressible":false,"extensions":["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{"source":"iana","extensions":["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{"source":"iana","extensions":["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{"source":"iana","extensions":["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{"source":"iana","extensions":["xltm"]},"application/vnd.ms-fontobject":{"source":"iana","compressible":true,"extensions":["eot"]},"application/vnd.ms-htmlhelp":{"source":"iana","extensions":["chm"]},"application/vnd.ms-ims":{"source":"iana","extensions":["ims"]},"application/vnd.ms-lrm":{"source":"iana","extensions":["lrm"]},"application/vnd.ms-office.activex+xml":{"source":"iana","compressible":true},"application/vnd.ms-officetheme":{"source":"iana","extensions":["thmx"]},"application/vnd.ms-opentype":{"source":"apache","compressible":true},"application/vnd.ms-outlook":{"compressible":false,"extensions":["msg"]},"application/vnd.ms-package.obfuscated-opentype":{"source":"apache"},"application/vnd.ms-pki.seccat":{"source":"apache","extensions":["cat"]},"application/vnd.ms-pki.stl":{"source":"apache","extensions":["stl"]},"application/vnd.ms-playready.initiator+xml":{"source":"iana","compressible":true},"application/vnd.ms-powerpoint":{"source":"iana","compressible":false,"extensions":["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{"source":"iana","extensions":["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{"source":"iana","extensions":["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{"source":"iana","extensions":["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{"source":"iana","extensions":["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{"source":"iana","extensions":["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{"source":"iana","compressible":true},"application/vnd.ms-printing.printticket+xml":{"source":"apache","compressible":true},"application/vnd.ms-printschematicket+xml":{"source":"iana","compressible":true},"application/vnd.ms-project":{"source":"iana","extensions":["mpp","mpt"]},"application/vnd.ms-tnef":{"source":"iana"},"application/vnd.ms-windows.devicepairing":{"source":"iana"},"application/vnd.ms-windows.nwprinting.oob":{"source":"iana"},"application/vnd.ms-windows.printerpairing":{"source":"iana"},"application/vnd.ms-windows.wsd.oob":{"source":"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.lic-resp":{"source":"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.meter-resp":{"source":"iana"},"application/vnd.ms-word.document.macroenabled.12":{"source":"iana","extensions":["docm"]},"application/vnd.ms-word.template.macroenabled.12":{"source":"iana","extensions":["dotm"]},"application/vnd.ms-works":{"source":"iana","extensions":["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{"source":"iana","extensions":["wpl"]},"application/vnd.ms-xpsdocument":{"source":"iana","compressible":false,"extensions":["xps"]},"application/vnd.msa-disk-image":{"source":"iana"},"application/vnd.mseq":{"source":"iana","extensions":["mseq"]},"application/vnd.msign":{"source":"iana"},"application/vnd.multiad.creator":{"source":"iana"},"application/vnd.multiad.creator.cif":{"source":"iana"},"application/vnd.music-niff":{"source":"iana"},"application/vnd.musician":{"source":"iana","extensions":["mus"]},"application/vnd.muvee.style":{"source":"iana","extensions":["msty"]},"application/vnd.mynfc":{"source":"iana","extensions":["taglet"]},"application/vnd.nacamar.ybrid+json":{"source":"iana","compressible":true},"application/vnd.ncd.control":{"source":"iana"},"application/vnd.ncd.reference":{"source":"iana"},"application/vnd.nearst.inv+json":{"source":"iana","compressible":true},"application/vnd.nebumind.line":{"source":"iana"},"application/vnd.nervana":{"source":"iana"},"application/vnd.netfpx":{"source":"iana"},"application/vnd.neurolanguage.nlu":{"source":"iana","extensions":["nlu"]},"application/vnd.nimn":{"source":"iana"},"application/vnd.nintendo.nitro.rom":{"source":"iana"},"application/vnd.nintendo.snes.rom":{"source":"iana"},"application/vnd.nitf":{"source":"iana","extensions":["ntf","nitf"]},"application/vnd.noblenet-directory":{"source":"iana","extensions":["nnd"]},"application/vnd.noblenet-sealer":{"source":"iana","extensions":["nns"]},"application/vnd.noblenet-web":{"source":"iana","extensions":["nnw"]},"application/vnd.nokia.catalogs":{"source":"iana"},"application/vnd.nokia.conml+wbxml":{"source":"iana"},"application/vnd.nokia.conml+xml":{"source":"iana","compressible":true},"application/vnd.nokia.iptv.config+xml":{"source":"iana","compressible":true},"application/vnd.nokia.isds-radio-presets":{"source":"iana"},"application/vnd.nokia.landmark+wbxml":{"source":"iana"},"application/vnd.nokia.landmark+xml":{"source":"iana","compressible":true},"application/vnd.nokia.landmarkcollection+xml":{"source":"iana","compressible":true},"application/vnd.nokia.n-gage.ac+xml":{"source":"iana","compressible":true,"extensions":["ac"]},"application/vnd.nokia.n-gage.data":{"source":"iana","extensions":["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{"source":"iana","extensions":["n-gage"]},"application/vnd.nokia.ncd":{"source":"iana"},"application/vnd.nokia.pcd+wbxml":{"source":"iana"},"application/vnd.nokia.pcd+xml":{"source":"iana","compressible":true},"application/vnd.nokia.radio-preset":{"source":"iana","extensions":["rpst"]},"application/vnd.nokia.radio-presets":{"source":"iana","extensions":["rpss"]},"application/vnd.novadigm.edm":{"source":"iana","extensions":["edm"]},"application/vnd.novadigm.edx":{"source":"iana","extensions":["edx"]},"application/vnd.novadigm.ext":{"source":"iana","extensions":["ext"]},"application/vnd.ntt-local.content-share":{"source":"iana"},"application/vnd.ntt-local.file-transfer":{"source":"iana"},"application/vnd.ntt-local.ogw_remote-access":{"source":"iana"},"application/vnd.ntt-local.sip-ta_remote":{"source":"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{"source":"iana"},"application/vnd.oasis.opendocument.chart":{"source":"iana","extensions":["odc"]},"application/vnd.oasis.opendocument.chart-template":{"source":"iana","extensions":["otc"]},"application/vnd.oasis.opendocument.database":{"source":"iana","extensions":["odb"]},"application/vnd.oasis.opendocument.formula":{"source":"iana","extensions":["odf"]},"application/vnd.oasis.opendocument.formula-template":{"source":"iana","extensions":["odft"]},"application/vnd.oasis.opendocument.graphics":{"source":"iana","compressible":false,"extensions":["odg"]},"application/vnd.oasis.opendocument.graphics-template":{"source":"iana","extensions":["otg"]},"application/vnd.oasis.opendocument.image":{"source":"iana","extensions":["odi"]},"application/vnd.oasis.opendocument.image-template":{"source":"iana","extensions":["oti"]},"application/vnd.oasis.opendocument.presentation":{"source":"iana","compressible":false,"extensions":["odp"]},"application/vnd.oasis.opendocument.presentation-template":{"source":"iana","extensions":["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{"source":"iana","compressible":false,"extensions":["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{"source":"iana","extensions":["ots"]},"application/vnd.oasis.opendocument.text":{"source":"iana","compressible":false,"extensions":["odt"]},"application/vnd.oasis.opendocument.text-master":{"source":"iana","extensions":["odm"]},"application/vnd.oasis.opendocument.text-template":{"source":"iana","extensions":["ott"]},"application/vnd.oasis.opendocument.text-web":{"source":"iana","extensions":["oth"]},"application/vnd.obn":{"source":"iana"},"application/vnd.ocf+cbor":{"source":"iana"},"application/vnd.oci.image.manifest.v1+json":{"source":"iana","compressible":true},"application/vnd.oftn.l10n+json":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessdownload+xml":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessstreaming+xml":{"source":"iana","compressible":true},"application/vnd.oipf.cspg-hexbinary":{"source":"iana"},"application/vnd.oipf.dae.svg+xml":{"source":"iana","compressible":true},"application/vnd.oipf.dae.xhtml+xml":{"source":"iana","compressible":true},"application/vnd.oipf.mippvcontrolmessage+xml":{"source":"iana","compressible":true},"application/vnd.oipf.pae.gem":{"source":"iana"},"application/vnd.oipf.spdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.oipf.spdlist+xml":{"source":"iana","compressible":true},"application/vnd.oipf.ueprofile+xml":{"source":"iana","compressible":true},"application/vnd.oipf.userprofile+xml":{"source":"iana","compressible":true},"application/vnd.olpc-sugar":{"source":"iana","extensions":["xo"]},"application/vnd.oma-scws-config":{"source":"iana"},"application/vnd.oma-scws-http-request":{"source":"iana"},"application/vnd.oma-scws-http-response":{"source":"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.drm-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.imd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.ltkm":{"source":"iana"},"application/vnd.oma.bcast.notification+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.provisioningtrigger":{"source":"iana"},"application/vnd.oma.bcast.sgboot":{"source":"iana"},"application/vnd.oma.bcast.sgdd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sgdu":{"source":"iana"},"application/vnd.oma.bcast.simple-symbol-container":{"source":"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sprov+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.stkm":{"source":"iana"},"application/vnd.oma.cab-address-book+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-feature-handler+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-pcc+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-subs-invite+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-user-prefs+xml":{"source":"iana","compressible":true},"application/vnd.oma.dcd":{"source":"iana"},"application/vnd.oma.dcdc":{"source":"iana"},"application/vnd.oma.dd2+xml":{"source":"iana","compressible":true,"extensions":["dd2"]},"application/vnd.oma.drm.risd+xml":{"source":"iana","compressible":true},"application/vnd.oma.group-usage-list+xml":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+cbor":{"source":"iana"},"application/vnd.oma.lwm2m+json":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+tlv":{"source":"iana"},"application/vnd.oma.pal+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.detailed-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.final-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.groups+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.invocation-descriptor+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.optimized-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.push":{"source":"iana"},"application/vnd.oma.scidm.messages+xml":{"source":"iana","compressible":true},"application/vnd.oma.xcap-directory+xml":{"source":"iana","compressible":true},"application/vnd.omads-email+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omads-file+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omads-folder+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omaloc-supl-init":{"source":"iana"},"application/vnd.onepager":{"source":"iana"},"application/vnd.onepagertamp":{"source":"iana"},"application/vnd.onepagertamx":{"source":"iana"},"application/vnd.onepagertat":{"source":"iana"},"application/vnd.onepagertatp":{"source":"iana"},"application/vnd.onepagertatx":{"source":"iana"},"application/vnd.openblox.game+xml":{"source":"iana","compressible":true,"extensions":["obgx"]},"application/vnd.openblox.game-binary":{"source":"iana"},"application/vnd.openeye.oeb":{"source":"iana"},"application/vnd.openofficeorg.extension":{"source":"apache","extensions":["oxt"]},"application/vnd.openstreetmap.data+xml":{"source":"iana","compressible":true,"extensions":["osm"]},"application/vnd.opentimestamps.ots":{"source":"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawing+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{"source":"iana","compressible":false,"extensions":["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slide":{"source":"iana","extensions":["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{"source":"iana","extensions":["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.template":{"source":"iana","extensions":["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"source":"iana","compressible":false,"extensions":["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{"source":"iana","extensions":["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.theme+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.vmldrawing":{"source":"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"source":"iana","compressible":false,"extensions":["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{"source":"iana","extensions":["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.core-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.relationships+xml":{"source":"iana","compressible":true},"application/vnd.oracle.resource+json":{"source":"iana","compressible":true},"application/vnd.orange.indata":{"source":"iana"},"application/vnd.osa.netdeploy":{"source":"iana"},"application/vnd.osgeo.mapguide.package":{"source":"iana","extensions":["mgp"]},"application/vnd.osgi.bundle":{"source":"iana"},"application/vnd.osgi.dp":{"source":"iana","extensions":["dp"]},"application/vnd.osgi.subsystem":{"source":"iana","extensions":["esa"]},"application/vnd.otps.ct-kip+xml":{"source":"iana","compressible":true},"application/vnd.oxli.countgraph":{"source":"iana"},"application/vnd.pagerduty+json":{"source":"iana","compressible":true},"application/vnd.palm":{"source":"iana","extensions":["pdb","pqa","oprc"]},"application/vnd.panoply":{"source":"iana"},"application/vnd.paos.xml":{"source":"iana"},"application/vnd.patentdive":{"source":"iana"},"application/vnd.patientecommsdoc":{"source":"iana"},"application/vnd.pawaafile":{"source":"iana","extensions":["paw"]},"application/vnd.pcos":{"source":"iana"},"application/vnd.pg.format":{"source":"iana","extensions":["str"]},"application/vnd.pg.osasli":{"source":"iana","extensions":["ei6"]},"application/vnd.piaccess.application-licence":{"source":"iana"},"application/vnd.picsel":{"source":"iana","extensions":["efif"]},"application/vnd.pmi.widget":{"source":"iana","extensions":["wg"]},"application/vnd.poc.group-advertisement+xml":{"source":"iana","compressible":true},"application/vnd.pocketlearn":{"source":"iana","extensions":["plf"]},"application/vnd.powerbuilder6":{"source":"iana","extensions":["pbd"]},"application/vnd.powerbuilder6-s":{"source":"iana"},"application/vnd.powerbuilder7":{"source":"iana"},"application/vnd.powerbuilder7-s":{"source":"iana"},"application/vnd.powerbuilder75":{"source":"iana"},"application/vnd.powerbuilder75-s":{"source":"iana"},"application/vnd.preminet":{"source":"iana"},"application/vnd.previewsystems.box":{"source":"iana","extensions":["box"]},"application/vnd.proteus.magazine":{"source":"iana","extensions":["mgz"]},"application/vnd.psfs":{"source":"iana"},"application/vnd.publishare-delta-tree":{"source":"iana","extensions":["qps"]},"application/vnd.pvi.ptid1":{"source":"iana","extensions":["ptid"]},"application/vnd.pwg-multiplexed":{"source":"iana"},"application/vnd.pwg-xhtml-print+xml":{"source":"iana","compressible":true},"application/vnd.qualcomm.brew-app-res":{"source":"iana"},"application/vnd.quarantainenet":{"source":"iana"},"application/vnd.quark.quarkxpress":{"source":"iana","extensions":["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{"source":"iana"},"application/vnd.radisys.moml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conn+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-stream+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-base+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-detect+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-group+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-speech+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-transform+xml":{"source":"iana","compressible":true},"application/vnd.rainstor.data":{"source":"iana"},"application/vnd.rapid":{"source":"iana"},"application/vnd.rar":{"source":"iana","extensions":["rar"]},"application/vnd.realvnc.bed":{"source":"iana","extensions":["bed"]},"application/vnd.recordare.musicxml":{"source":"iana","extensions":["mxl"]},"application/vnd.recordare.musicxml+xml":{"source":"iana","compressible":true,"extensions":["musicxml"]},"application/vnd.renlearn.rlprint":{"source":"iana"},"application/vnd.resilient.logic":{"source":"iana"},"application/vnd.restful+json":{"source":"iana","compressible":true},"application/vnd.rig.cryptonote":{"source":"iana","extensions":["cryptonote"]},"application/vnd.rim.cod":{"source":"apache","extensions":["cod"]},"application/vnd.rn-realmedia":{"source":"apache","extensions":["rm"]},"application/vnd.rn-realmedia-vbr":{"source":"apache","extensions":["rmvb"]},"application/vnd.route66.link66+xml":{"source":"iana","compressible":true,"extensions":["link66"]},"application/vnd.rs-274x":{"source":"iana"},"application/vnd.ruckus.download":{"source":"iana"},"application/vnd.s3sms":{"source":"iana"},"application/vnd.sailingtracker.track":{"source":"iana","extensions":["st"]},"application/vnd.sar":{"source":"iana"},"application/vnd.sbm.cid":{"source":"iana"},"application/vnd.sbm.mid2":{"source":"iana"},"application/vnd.scribus":{"source":"iana"},"application/vnd.sealed.3df":{"source":"iana"},"application/vnd.sealed.csf":{"source":"iana"},"application/vnd.sealed.doc":{"source":"iana"},"application/vnd.sealed.eml":{"source":"iana"},"application/vnd.sealed.mht":{"source":"iana"},"application/vnd.sealed.net":{"source":"iana"},"application/vnd.sealed.ppt":{"source":"iana"},"application/vnd.sealed.tiff":{"source":"iana"},"application/vnd.sealed.xls":{"source":"iana"},"application/vnd.sealedmedia.softseal.html":{"source":"iana"},"application/vnd.sealedmedia.softseal.pdf":{"source":"iana"},"application/vnd.seemail":{"source":"iana","extensions":["see"]},"application/vnd.seis+json":{"source":"iana","compressible":true},"application/vnd.sema":{"source":"iana","extensions":["sema"]},"application/vnd.semd":{"source":"iana","extensions":["semd"]},"application/vnd.semf":{"source":"iana","extensions":["semf"]},"application/vnd.shade-save-file":{"source":"iana"},"application/vnd.shana.informed.formdata":{"source":"iana","extensions":["ifm"]},"application/vnd.shana.informed.formtemplate":{"source":"iana","extensions":["itp"]},"application/vnd.shana.informed.interchange":{"source":"iana","extensions":["iif"]},"application/vnd.shana.informed.package":{"source":"iana","extensions":["ipk"]},"application/vnd.shootproof+json":{"source":"iana","compressible":true},"application/vnd.shopkick+json":{"source":"iana","compressible":true},"application/vnd.shp":{"source":"iana"},"application/vnd.shx":{"source":"iana"},"application/vnd.sigrok.session":{"source":"iana"},"application/vnd.simtech-mindmapper":{"source":"iana","extensions":["twd","twds"]},"application/vnd.siren+json":{"source":"iana","compressible":true},"application/vnd.smaf":{"source":"iana","extensions":["mmf"]},"application/vnd.smart.notebook":{"source":"iana"},"application/vnd.smart.teacher":{"source":"iana","extensions":["teacher"]},"application/vnd.snesdev-page-table":{"source":"iana"},"application/vnd.software602.filler.form+xml":{"source":"iana","compressible":true,"extensions":["fo"]},"application/vnd.software602.filler.form-xml-zip":{"source":"iana"},"application/vnd.solent.sdkm+xml":{"source":"iana","compressible":true,"extensions":["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{"source":"iana","extensions":["dxp"]},"application/vnd.spotfire.sfs":{"source":"iana","extensions":["sfs"]},"application/vnd.sqlite3":{"source":"iana"},"application/vnd.sss-cod":{"source":"iana"},"application/vnd.sss-dtf":{"source":"iana"},"application/vnd.sss-ntf":{"source":"iana"},"application/vnd.stardivision.calc":{"source":"apache","extensions":["sdc"]},"application/vnd.stardivision.draw":{"source":"apache","extensions":["sda"]},"application/vnd.stardivision.impress":{"source":"apache","extensions":["sdd"]},"application/vnd.stardivision.math":{"source":"apache","extensions":["smf"]},"application/vnd.stardivision.writer":{"source":"apache","extensions":["sdw","vor"]},"application/vnd.stardivision.writer-global":{"source":"apache","extensions":["sgl"]},"application/vnd.stepmania.package":{"source":"iana","extensions":["smzip"]},"application/vnd.stepmania.stepchart":{"source":"iana","extensions":["sm"]},"application/vnd.street-stream":{"source":"iana"},"application/vnd.sun.wadl+xml":{"source":"iana","compressible":true,"extensions":["wadl"]},"application/vnd.sun.xml.calc":{"source":"apache","extensions":["sxc"]},"application/vnd.sun.xml.calc.template":{"source":"apache","extensions":["stc"]},"application/vnd.sun.xml.draw":{"source":"apache","extensions":["sxd"]},"application/vnd.sun.xml.draw.template":{"source":"apache","extensions":["std"]},"application/vnd.sun.xml.impress":{"source":"apache","extensions":["sxi"]},"application/vnd.sun.xml.impress.template":{"source":"apache","extensions":["sti"]},"application/vnd.sun.xml.math":{"source":"apache","extensions":["sxm"]},"application/vnd.sun.xml.writer":{"source":"apache","extensions":["sxw"]},"application/vnd.sun.xml.writer.global":{"source":"apache","extensions":["sxg"]},"application/vnd.sun.xml.writer.template":{"source":"apache","extensions":["stw"]},"application/vnd.sus-calendar":{"source":"iana","extensions":["sus","susp"]},"application/vnd.svd":{"source":"iana","extensions":["svd"]},"application/vnd.swiftview-ics":{"source":"iana"},"application/vnd.sycle+xml":{"source":"iana","compressible":true},"application/vnd.syft+json":{"source":"iana","compressible":true},"application/vnd.symbian.install":{"source":"apache","extensions":["sis","sisx"]},"application/vnd.syncml+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["xsm"]},"application/vnd.syncml.dm+wbxml":{"source":"iana","charset":"UTF-8","extensions":["bdm"]},"application/vnd.syncml.dm+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["xdm"]},"application/vnd.syncml.dm.notification":{"source":"iana"},"application/vnd.syncml.dmddf+wbxml":{"source":"iana"},"application/vnd.syncml.dmddf+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{"source":"iana"},"application/vnd.syncml.dmtnds+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.syncml.ds.notification":{"source":"iana"},"application/vnd.tableschema+json":{"source":"iana","compressible":true},"application/vnd.tao.intent-module-archive":{"source":"iana","extensions":["tao"]},"application/vnd.tcpdump.pcap":{"source":"iana","extensions":["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{"source":"iana","compressible":true},"application/vnd.tmd.mediaflex.api+xml":{"source":"iana","compressible":true},"application/vnd.tml":{"source":"iana"},"application/vnd.tmobile-livetv":{"source":"iana","extensions":["tmo"]},"application/vnd.tri.onesource":{"source":"iana"},"application/vnd.trid.tpt":{"source":"iana","extensions":["tpt"]},"application/vnd.triscape.mxs":{"source":"iana","extensions":["mxs"]},"application/vnd.trueapp":{"source":"iana","extensions":["tra"]},"application/vnd.truedoc":{"source":"iana"},"application/vnd.ubisoft.webplayer":{"source":"iana"},"application/vnd.ufdl":{"source":"iana","extensions":["ufd","ufdl"]},"application/vnd.uiq.theme":{"source":"iana","extensions":["utz"]},"application/vnd.umajin":{"source":"iana","extensions":["umj"]},"application/vnd.unity":{"source":"iana","extensions":["unityweb"]},"application/vnd.uoml+xml":{"source":"iana","compressible":true,"extensions":["uoml"]},"application/vnd.uplanet.alert":{"source":"iana"},"application/vnd.uplanet.alert-wbxml":{"source":"iana"},"application/vnd.uplanet.bearer-choice":{"source":"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{"source":"iana"},"application/vnd.uplanet.cacheop":{"source":"iana"},"application/vnd.uplanet.cacheop-wbxml":{"source":"iana"},"application/vnd.uplanet.channel":{"source":"iana"},"application/vnd.uplanet.channel-wbxml":{"source":"iana"},"application/vnd.uplanet.list":{"source":"iana"},"application/vnd.uplanet.list-wbxml":{"source":"iana"},"application/vnd.uplanet.listcmd":{"source":"iana"},"application/vnd.uplanet.listcmd-wbxml":{"source":"iana"},"application/vnd.uplanet.signal":{"source":"iana"},"application/vnd.uri-map":{"source":"iana"},"application/vnd.valve.source.material":{"source":"iana"},"application/vnd.vcx":{"source":"iana","extensions":["vcx"]},"application/vnd.vd-study":{"source":"iana"},"application/vnd.vectorworks":{"source":"iana"},"application/vnd.vel+json":{"source":"iana","compressible":true},"application/vnd.verimatrix.vcas":{"source":"iana"},"application/vnd.veritone.aion+json":{"source":"iana","compressible":true},"application/vnd.veryant.thin":{"source":"iana"},"application/vnd.ves.encrypted":{"source":"iana"},"application/vnd.vidsoft.vidconference":{"source":"iana"},"application/vnd.visio":{"source":"iana","extensions":["vsd","vst","vss","vsw"]},"application/vnd.visionary":{"source":"iana","extensions":["vis"]},"application/vnd.vividence.scriptfile":{"source":"iana"},"application/vnd.vsf":{"source":"iana","extensions":["vsf"]},"application/vnd.wap.sic":{"source":"iana"},"application/vnd.wap.slc":{"source":"iana"},"application/vnd.wap.wbxml":{"source":"iana","charset":"UTF-8","extensions":["wbxml"]},"application/vnd.wap.wmlc":{"source":"iana","extensions":["wmlc"]},"application/vnd.wap.wmlscriptc":{"source":"iana","extensions":["wmlsc"]},"application/vnd.webturbo":{"source":"iana","extensions":["wtb"]},"application/vnd.wfa.dpp":{"source":"iana"},"application/vnd.wfa.p2p":{"source":"iana"},"application/vnd.wfa.wsc":{"source":"iana"},"application/vnd.windows.devicepairing":{"source":"iana"},"application/vnd.wmc":{"source":"iana"},"application/vnd.wmf.bootstrap":{"source":"iana"},"application/vnd.wolfram.mathematica":{"source":"iana"},"application/vnd.wolfram.mathematica.package":{"source":"iana"},"application/vnd.wolfram.player":{"source":"iana","extensions":["nbp"]},"application/vnd.wordperfect":{"source":"iana","extensions":["wpd"]},"application/vnd.wqd":{"source":"iana","extensions":["wqd"]},"application/vnd.wrq-hp3000-labelled":{"source":"iana"},"application/vnd.wt.stf":{"source":"iana","extensions":["stf"]},"application/vnd.wv.csp+wbxml":{"source":"iana"},"application/vnd.wv.csp+xml":{"source":"iana","compressible":true},"application/vnd.wv.ssp+xml":{"source":"iana","compressible":true},"application/vnd.xacml+json":{"source":"iana","compressible":true},"application/vnd.xara":{"source":"iana","extensions":["xar"]},"application/vnd.xfdl":{"source":"iana","extensions":["xfdl"]},"application/vnd.xfdl.webform":{"source":"iana"},"application/vnd.xmi+xml":{"source":"iana","compressible":true},"application/vnd.xmpie.cpkg":{"source":"iana"},"application/vnd.xmpie.dpkg":{"source":"iana"},"application/vnd.xmpie.plan":{"source":"iana"},"application/vnd.xmpie.ppkg":{"source":"iana"},"application/vnd.xmpie.xlim":{"source":"iana"},"application/vnd.yamaha.hv-dic":{"source":"iana","extensions":["hvd"]},"application/vnd.yamaha.hv-script":{"source":"iana","extensions":["hvs"]},"application/vnd.yamaha.hv-voice":{"source":"iana","extensions":["hvp"]},"application/vnd.yamaha.openscoreformat":{"source":"iana","extensions":["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{"source":"iana","compressible":true,"extensions":["osfpvg"]},"application/vnd.yamaha.remote-setup":{"source":"iana"},"application/vnd.yamaha.smaf-audio":{"source":"iana","extensions":["saf"]},"application/vnd.yamaha.smaf-phrase":{"source":"iana","extensions":["spf"]},"application/vnd.yamaha.through-ngn":{"source":"iana"},"application/vnd.yamaha.tunnel-udpencap":{"source":"iana"},"application/vnd.yaoweme":{"source":"iana"},"application/vnd.yellowriver-custom-menu":{"source":"iana","extensions":["cmp"]},"application/vnd.youtube.yt":{"source":"iana"},"application/vnd.zul":{"source":"iana","extensions":["zir","zirz"]},"application/vnd.zzazz.deck+xml":{"source":"iana","compressible":true,"extensions":["zaz"]},"application/voicexml+xml":{"source":"iana","compressible":true,"extensions":["vxml"]},"application/voucher-cms+json":{"source":"iana","compressible":true},"application/vq-rtcpxr":{"source":"iana"},"application/wasm":{"source":"iana","compressible":true,"extensions":["wasm"]},"application/watcherinfo+xml":{"source":"iana","compressible":true,"extensions":["wif"]},"application/webpush-options+json":{"source":"iana","compressible":true},"application/whoispp-query":{"source":"iana"},"application/whoispp-response":{"source":"iana"},"application/widget":{"source":"iana","extensions":["wgt"]},"application/winhlp":{"source":"apache","extensions":["hlp"]},"application/wita":{"source":"iana"},"application/wordperfect5.1":{"source":"iana"},"application/wsdl+xml":{"source":"iana","compressible":true,"extensions":["wsdl"]},"application/wspolicy+xml":{"source":"iana","compressible":true,"extensions":["wspolicy"]},"application/x-7z-compressed":{"source":"apache","compressible":false,"extensions":["7z"]},"application/x-abiword":{"source":"apache","extensions":["abw"]},"application/x-ace-compressed":{"source":"apache","extensions":["ace"]},"application/x-amf":{"source":"apache"},"application/x-apple-diskimage":{"source":"apache","extensions":["dmg"]},"application/x-arj":{"compressible":false,"extensions":["arj"]},"application/x-authorware-bin":{"source":"apache","extensions":["aab","x32","u32","vox"]},"application/x-authorware-map":{"source":"apache","extensions":["aam"]},"application/x-authorware-seg":{"source":"apache","extensions":["aas"]},"application/x-bcpio":{"source":"apache","extensions":["bcpio"]},"application/x-bdoc":{"compressible":false,"extensions":["bdoc"]},"application/x-bittorrent":{"source":"apache","extensions":["torrent"]},"application/x-blorb":{"source":"apache","extensions":["blb","blorb"]},"application/x-bzip":{"source":"apache","compressible":false,"extensions":["bz"]},"application/x-bzip2":{"source":"apache","compressible":false,"extensions":["bz2","boz"]},"application/x-cbr":{"source":"apache","extensions":["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{"source":"apache","extensions":["vcd"]},"application/x-cfs-compressed":{"source":"apache","extensions":["cfs"]},"application/x-chat":{"source":"apache","extensions":["chat"]},"application/x-chess-pgn":{"source":"apache","extensions":["pgn"]},"application/x-chrome-extension":{"extensions":["crx"]},"application/x-cocoa":{"source":"nginx","extensions":["cco"]},"application/x-compress":{"source":"apache"},"application/x-conference":{"source":"apache","extensions":["nsc"]},"application/x-cpio":{"source":"apache","extensions":["cpio"]},"application/x-csh":{"source":"apache","extensions":["csh"]},"application/x-deb":{"compressible":false},"application/x-debian-package":{"source":"apache","extensions":["deb","udeb"]},"application/x-dgc-compressed":{"source":"apache","extensions":["dgc"]},"application/x-director":{"source":"apache","extensions":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{"source":"apache","extensions":["wad"]},"application/x-dtbncx+xml":{"source":"apache","compressible":true,"extensions":["ncx"]},"application/x-dtbook+xml":{"source":"apache","compressible":true,"extensions":["dtb"]},"application/x-dtbresource+xml":{"source":"apache","compressible":true,"extensions":["res"]},"application/x-dvi":{"source":"apache","compressible":false,"extensions":["dvi"]},"application/x-envoy":{"source":"apache","extensions":["evy"]},"application/x-eva":{"source":"apache","extensions":["eva"]},"application/x-font-bdf":{"source":"apache","extensions":["bdf"]},"application/x-font-dos":{"source":"apache"},"application/x-font-framemaker":{"source":"apache"},"application/x-font-ghostscript":{"source":"apache","extensions":["gsf"]},"application/x-font-libgrx":{"source":"apache"},"application/x-font-linux-psf":{"source":"apache","extensions":["psf"]},"application/x-font-pcf":{"source":"apache","extensions":["pcf"]},"application/x-font-snf":{"source":"apache","extensions":["snf"]},"application/x-font-speedo":{"source":"apache"},"application/x-font-sunos-news":{"source":"apache"},"application/x-font-type1":{"source":"apache","extensions":["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{"source":"apache"},"application/x-freearc":{"source":"apache","extensions":["arc"]},"application/x-futuresplash":{"source":"apache","extensions":["spl"]},"application/x-gca-compressed":{"source":"apache","extensions":["gca"]},"application/x-glulx":{"source":"apache","extensions":["ulx"]},"application/x-gnumeric":{"source":"apache","extensions":["gnumeric"]},"application/x-gramps-xml":{"source":"apache","extensions":["gramps"]},"application/x-gtar":{"source":"apache","extensions":["gtar"]},"application/x-gzip":{"source":"apache"},"application/x-hdf":{"source":"apache","extensions":["hdf"]},"application/x-httpd-php":{"compressible":true,"extensions":["php"]},"application/x-install-instructions":{"source":"apache","extensions":["install"]},"application/x-iso9660-image":{"source":"apache","extensions":["iso"]},"application/x-iwork-keynote-sffkey":{"extensions":["key"]},"application/x-iwork-numbers-sffnumbers":{"extensions":["numbers"]},"application/x-iwork-pages-sffpages":{"extensions":["pages"]},"application/x-java-archive-diff":{"source":"nginx","extensions":["jardiff"]},"application/x-java-jnlp-file":{"source":"apache","compressible":false,"extensions":["jnlp"]},"application/x-javascript":{"compressible":true},"application/x-keepass2":{"extensions":["kdbx"]},"application/x-latex":{"source":"apache","compressible":false,"extensions":["latex"]},"application/x-lua-bytecode":{"extensions":["luac"]},"application/x-lzh-compressed":{"source":"apache","extensions":["lzh","lha"]},"application/x-makeself":{"source":"nginx","extensions":["run"]},"application/x-mie":{"source":"apache","extensions":["mie"]},"application/x-mobipocket-ebook":{"source":"apache","extensions":["prc","mobi"]},"application/x-mpegurl":{"compressible":false},"application/x-ms-application":{"source":"apache","extensions":["application"]},"application/x-ms-shortcut":{"source":"apache","extensions":["lnk"]},"application/x-ms-wmd":{"source":"apache","extensions":["wmd"]},"application/x-ms-wmz":{"source":"apache","extensions":["wmz"]},"application/x-ms-xbap":{"source":"apache","extensions":["xbap"]},"application/x-msaccess":{"source":"apache","extensions":["mdb"]},"application/x-msbinder":{"source":"apache","extensions":["obd"]},"application/x-mscardfile":{"source":"apache","extensions":["crd"]},"application/x-msclip":{"source":"apache","extensions":["clp"]},"application/x-msdos-program":{"extensions":["exe"]},"application/x-msdownload":{"source":"apache","extensions":["exe","dll","com","bat","msi"]},"application/x-msmediaview":{"source":"apache","extensions":["mvb","m13","m14"]},"application/x-msmetafile":{"source":"apache","extensions":["wmf","wmz","emf","emz"]},"application/x-msmoney":{"source":"apache","extensions":["mny"]},"application/x-mspublisher":{"source":"apache","extensions":["pub"]},"application/x-msschedule":{"source":"apache","extensions":["scd"]},"application/x-msterminal":{"source":"apache","extensions":["trm"]},"application/x-mswrite":{"source":"apache","extensions":["wri"]},"application/x-netcdf":{"source":"apache","extensions":["nc","cdf"]},"application/x-ns-proxy-autoconfig":{"compressible":true,"extensions":["pac"]},"application/x-nzb":{"source":"apache","extensions":["nzb"]},"application/x-perl":{"source":"nginx","extensions":["pl","pm"]},"application/x-pilot":{"source":"nginx","extensions":["prc","pdb"]},"application/x-pkcs12":{"source":"apache","compressible":false,"extensions":["p12","pfx"]},"application/x-pkcs7-certificates":{"source":"apache","extensions":["p7b","spc"]},"application/x-pkcs7-certreqresp":{"source":"apache","extensions":["p7r"]},"application/x-pki-message":{"source":"iana"},"application/x-rar-compressed":{"source":"apache","compressible":false,"extensions":["rar"]},"application/x-redhat-package-manager":{"source":"nginx","extensions":["rpm"]},"application/x-research-info-systems":{"source":"apache","extensions":["ris"]},"application/x-sea":{"source":"nginx","extensions":["sea"]},"application/x-sh":{"source":"apache","compressible":true,"extensions":["sh"]},"application/x-shar":{"source":"apache","extensions":["shar"]},"application/x-shockwave-flash":{"source":"apache","compressible":false,"extensions":["swf"]},"application/x-silverlight-app":{"source":"apache","extensions":["xap"]},"application/x-sql":{"source":"apache","extensions":["sql"]},"application/x-stuffit":{"source":"apache","compressible":false,"extensions":["sit"]},"application/x-stuffitx":{"source":"apache","extensions":["sitx"]},"application/x-subrip":{"source":"apache","extensions":["srt"]},"application/x-sv4cpio":{"source":"apache","extensions":["sv4cpio"]},"application/x-sv4crc":{"source":"apache","extensions":["sv4crc"]},"application/x-t3vm-image":{"source":"apache","extensions":["t3"]},"application/x-tads":{"source":"apache","extensions":["gam"]},"application/x-tar":{"source":"apache","compressible":true,"extensions":["tar"]},"application/x-tcl":{"source":"apache","extensions":["tcl","tk"]},"application/x-tex":{"source":"apache","extensions":["tex"]},"application/x-tex-tfm":{"source":"apache","extensions":["tfm"]},"application/x-texinfo":{"source":"apache","extensions":["texinfo","texi"]},"application/x-tgif":{"source":"apache","extensions":["obj"]},"application/x-ustar":{"source":"apache","extensions":["ustar"]},"application/x-virtualbox-hdd":{"compressible":true,"extensions":["hdd"]},"application/x-virtualbox-ova":{"compressible":true,"extensions":["ova"]},"application/x-virtualbox-ovf":{"compressible":true,"extensions":["ovf"]},"application/x-virtualbox-vbox":{"compressible":true,"extensions":["vbox"]},"application/x-virtualbox-vbox-extpack":{"compressible":false,"extensions":["vbox-extpack"]},"application/x-virtualbox-vdi":{"compressible":true,"extensions":["vdi"]},"application/x-virtualbox-vhd":{"compressible":true,"extensions":["vhd"]},"application/x-virtualbox-vmdk":{"compressible":true,"extensions":["vmdk"]},"application/x-wais-source":{"source":"apache","extensions":["src"]},"application/x-web-app-manifest+json":{"compressible":true,"extensions":["webapp"]},"application/x-www-form-urlencoded":{"source":"iana","compressible":true},"application/x-x509-ca-cert":{"source":"iana","extensions":["der","crt","pem"]},"application/x-x509-ca-ra-cert":{"source":"iana"},"application/x-x509-next-ca-cert":{"source":"iana"},"application/x-xfig":{"source":"apache","extensions":["fig"]},"application/x-xliff+xml":{"source":"apache","compressible":true,"extensions":["xlf"]},"application/x-xpinstall":{"source":"apache","compressible":false,"extensions":["xpi"]},"application/x-xz":{"source":"apache","extensions":["xz"]},"application/x-zmachine":{"source":"apache","extensions":["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{"source":"iana"},"application/xacml+xml":{"source":"iana","compressible":true},"application/xaml+xml":{"source":"apache","compressible":true,"extensions":["xaml"]},"application/xcap-att+xml":{"source":"iana","compressible":true,"extensions":["xav"]},"application/xcap-caps+xml":{"source":"iana","compressible":true,"extensions":["xca"]},"application/xcap-diff+xml":{"source":"iana","compressible":true,"extensions":["xdf"]},"application/xcap-el+xml":{"source":"iana","compressible":true,"extensions":["xel"]},"application/xcap-error+xml":{"source":"iana","compressible":true},"application/xcap-ns+xml":{"source":"iana","compressible":true,"extensions":["xns"]},"application/xcon-conference-info+xml":{"source":"iana","compressible":true},"application/xcon-conference-info-diff+xml":{"source":"iana","compressible":true},"application/xenc+xml":{"source":"iana","compressible":true,"extensions":["xenc"]},"application/xhtml+xml":{"source":"iana","compressible":true,"extensions":["xhtml","xht"]},"application/xhtml-voice+xml":{"source":"apache","compressible":true},"application/xliff+xml":{"source":"iana","compressible":true,"extensions":["xlf"]},"application/xml":{"source":"iana","compressible":true,"extensions":["xml","xsl","xsd","rng"]},"application/xml-dtd":{"source":"iana","compressible":true,"extensions":["dtd"]},"application/xml-external-parsed-entity":{"source":"iana"},"application/xml-patch+xml":{"source":"iana","compressible":true},"application/xmpp+xml":{"source":"iana","compressible":true},"application/xop+xml":{"source":"iana","compressible":true,"extensions":["xop"]},"application/xproc+xml":{"source":"apache","compressible":true,"extensions":["xpl"]},"application/xslt+xml":{"source":"iana","compressible":true,"extensions":["xsl","xslt"]},"application/xspf+xml":{"source":"apache","compressible":true,"extensions":["xspf"]},"application/xv+xml":{"source":"iana","compressible":true,"extensions":["mxml","xhvml","xvml","xvm"]},"application/yang":{"source":"iana","extensions":["yang"]},"application/yang-data+json":{"source":"iana","compressible":true},"application/yang-data+xml":{"source":"iana","compressible":true},"application/yang-patch+json":{"source":"iana","compressible":true},"application/yang-patch+xml":{"source":"iana","compressible":true},"application/yin+xml":{"source":"iana","compressible":true,"extensions":["yin"]},"application/zip":{"source":"iana","compressible":false,"extensions":["zip"]},"application/zlib":{"source":"iana"},"application/zstd":{"source":"iana"},"audio/1d-interleaved-parityfec":{"source":"iana"},"audio/32kadpcm":{"source":"iana"},"audio/3gpp":{"source":"iana","compressible":false,"extensions":["3gpp"]},"audio/3gpp2":{"source":"iana"},"audio/aac":{"source":"iana"},"audio/ac3":{"source":"iana"},"audio/adpcm":{"source":"apache","extensions":["adp"]},"audio/amr":{"source":"iana","extensions":["amr"]},"audio/amr-wb":{"source":"iana"},"audio/amr-wb+":{"source":"iana"},"audio/aptx":{"source":"iana"},"audio/asc":{"source":"iana"},"audio/atrac-advanced-lossless":{"source":"iana"},"audio/atrac-x":{"source":"iana"},"audio/atrac3":{"source":"iana"},"audio/basic":{"source":"iana","compressible":false,"extensions":["au","snd"]},"audio/bv16":{"source":"iana"},"audio/bv32":{"source":"iana"},"audio/clearmode":{"source":"iana"},"audio/cn":{"source":"iana"},"audio/dat12":{"source":"iana"},"audio/dls":{"source":"iana"},"audio/dsr-es201108":{"source":"iana"},"audio/dsr-es202050":{"source":"iana"},"audio/dsr-es202211":{"source":"iana"},"audio/dsr-es202212":{"source":"iana"},"audio/dv":{"source":"iana"},"audio/dvi4":{"source":"iana"},"audio/eac3":{"source":"iana"},"audio/encaprtp":{"source":"iana"},"audio/evrc":{"source":"iana"},"audio/evrc-qcp":{"source":"iana"},"audio/evrc0":{"source":"iana"},"audio/evrc1":{"source":"iana"},"audio/evrcb":{"source":"iana"},"audio/evrcb0":{"source":"iana"},"audio/evrcb1":{"source":"iana"},"audio/evrcnw":{"source":"iana"},"audio/evrcnw0":{"source":"iana"},"audio/evrcnw1":{"source":"iana"},"audio/evrcwb":{"source":"iana"},"audio/evrcwb0":{"source":"iana"},"audio/evrcwb1":{"source":"iana"},"audio/evs":{"source":"iana"},"audio/flexfec":{"source":"iana"},"audio/fwdred":{"source":"iana"},"audio/g711-0":{"source":"iana"},"audio/g719":{"source":"iana"},"audio/g722":{"source":"iana"},"audio/g7221":{"source":"iana"},"audio/g723":{"source":"iana"},"audio/g726-16":{"source":"iana"},"audio/g726-24":{"source":"iana"},"audio/g726-32":{"source":"iana"},"audio/g726-40":{"source":"iana"},"audio/g728":{"source":"iana"},"audio/g729":{"source":"iana"},"audio/g7291":{"source":"iana"},"audio/g729d":{"source":"iana"},"audio/g729e":{"source":"iana"},"audio/gsm":{"source":"iana"},"audio/gsm-efr":{"source":"iana"},"audio/gsm-hr-08":{"source":"iana"},"audio/ilbc":{"source":"iana"},"audio/ip-mr_v2.5":{"source":"iana"},"audio/isac":{"source":"apache"},"audio/l16":{"source":"iana"},"audio/l20":{"source":"iana"},"audio/l24":{"source":"iana","compressible":false},"audio/l8":{"source":"iana"},"audio/lpc":{"source":"iana"},"audio/melp":{"source":"iana"},"audio/melp1200":{"source":"iana"},"audio/melp2400":{"source":"iana"},"audio/melp600":{"source":"iana"},"audio/mhas":{"source":"iana"},"audio/midi":{"source":"apache","extensions":["mid","midi","kar","rmi"]},"audio/mobile-xmf":{"source":"iana","extensions":["mxmf"]},"audio/mp3":{"compressible":false,"extensions":["mp3"]},"audio/mp4":{"source":"iana","compressible":false,"extensions":["m4a","mp4a"]},"audio/mp4a-latm":{"source":"iana"},"audio/mpa":{"source":"iana"},"audio/mpa-robust":{"source":"iana"},"audio/mpeg":{"source":"iana","compressible":false,"extensions":["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{"source":"iana"},"audio/musepack":{"source":"apache"},"audio/ogg":{"source":"iana","compressible":false,"extensions":["oga","ogg","spx","opus"]},"audio/opus":{"source":"iana"},"audio/parityfec":{"source":"iana"},"audio/pcma":{"source":"iana"},"audio/pcma-wb":{"source":"iana"},"audio/pcmu":{"source":"iana"},"audio/pcmu-wb":{"source":"iana"},"audio/prs.sid":{"source":"iana"},"audio/qcelp":{"source":"iana"},"audio/raptorfec":{"source":"iana"},"audio/red":{"source":"iana"},"audio/rtp-enc-aescm128":{"source":"iana"},"audio/rtp-midi":{"source":"iana"},"audio/rtploopback":{"source":"iana"},"audio/rtx":{"source":"iana"},"audio/s3m":{"source":"apache","extensions":["s3m"]},"audio/scip":{"source":"iana"},"audio/silk":{"source":"apache","extensions":["sil"]},"audio/smv":{"source":"iana"},"audio/smv-qcp":{"source":"iana"},"audio/smv0":{"source":"iana"},"audio/sofa":{"source":"iana"},"audio/sp-midi":{"source":"iana"},"audio/speex":{"source":"iana"},"audio/t140c":{"source":"iana"},"audio/t38":{"source":"iana"},"audio/telephone-event":{"source":"iana"},"audio/tetra_acelp":{"source":"iana"},"audio/tetra_acelp_bb":{"source":"iana"},"audio/tone":{"source":"iana"},"audio/tsvcis":{"source":"iana"},"audio/uemclip":{"source":"iana"},"audio/ulpfec":{"source":"iana"},"audio/usac":{"source":"iana"},"audio/vdvi":{"source":"iana"},"audio/vmr-wb":{"source":"iana"},"audio/vnd.3gpp.iufp":{"source":"iana"},"audio/vnd.4sb":{"source":"iana"},"audio/vnd.audiokoz":{"source":"iana"},"audio/vnd.celp":{"source":"iana"},"audio/vnd.cisco.nse":{"source":"iana"},"audio/vnd.cmles.radio-events":{"source":"iana"},"audio/vnd.cns.anp1":{"source":"iana"},"audio/vnd.cns.inf1":{"source":"iana"},"audio/vnd.dece.audio":{"source":"iana","extensions":["uva","uvva"]},"audio/vnd.digital-winds":{"source":"iana","extensions":["eol"]},"audio/vnd.dlna.adts":{"source":"iana"},"audio/vnd.dolby.heaac.1":{"source":"iana"},"audio/vnd.dolby.heaac.2":{"source":"iana"},"audio/vnd.dolby.mlp":{"source":"iana"},"audio/vnd.dolby.mps":{"source":"iana"},"audio/vnd.dolby.pl2":{"source":"iana"},"audio/vnd.dolby.pl2x":{"source":"iana"},"audio/vnd.dolby.pl2z":{"source":"iana"},"audio/vnd.dolby.pulse.1":{"source":"iana"},"audio/vnd.dra":{"source":"iana","extensions":["dra"]},"audio/vnd.dts":{"source":"iana","extensions":["dts"]},"audio/vnd.dts.hd":{"source":"iana","extensions":["dtshd"]},"audio/vnd.dts.uhd":{"source":"iana"},"audio/vnd.dvb.file":{"source":"iana"},"audio/vnd.everad.plj":{"source":"iana"},"audio/vnd.hns.audio":{"source":"iana"},"audio/vnd.lucent.voice":{"source":"iana","extensions":["lvp"]},"audio/vnd.ms-playready.media.pya":{"source":"iana","extensions":["pya"]},"audio/vnd.nokia.mobile-xmf":{"source":"iana"},"audio/vnd.nortel.vbk":{"source":"iana"},"audio/vnd.nuera.ecelp4800":{"source":"iana","extensions":["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{"source":"iana","extensions":["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{"source":"iana","extensions":["ecelp9600"]},"audio/vnd.octel.sbc":{"source":"iana"},"audio/vnd.presonus.multitrack":{"source":"iana"},"audio/vnd.qcelp":{"source":"iana"},"audio/vnd.rhetorex.32kadpcm":{"source":"iana"},"audio/vnd.rip":{"source":"iana","extensions":["rip"]},"audio/vnd.rn-realaudio":{"compressible":false},"audio/vnd.sealedmedia.softseal.mpeg":{"source":"iana"},"audio/vnd.vmx.cvsd":{"source":"iana"},"audio/vnd.wave":{"compressible":false},"audio/vorbis":{"source":"iana","compressible":false},"audio/vorbis-config":{"source":"iana"},"audio/wav":{"compressible":false,"extensions":["wav"]},"audio/wave":{"compressible":false,"extensions":["wav"]},"audio/webm":{"source":"apache","compressible":false,"extensions":["weba"]},"audio/x-aac":{"source":"apache","compressible":false,"extensions":["aac"]},"audio/x-aiff":{"source":"apache","extensions":["aif","aiff","aifc"]},"audio/x-caf":{"source":"apache","compressible":false,"extensions":["caf"]},"audio/x-flac":{"source":"apache","extensions":["flac"]},"audio/x-m4a":{"source":"nginx","extensions":["m4a"]},"audio/x-matroska":{"source":"apache","extensions":["mka"]},"audio/x-mpegurl":{"source":"apache","extensions":["m3u"]},"audio/x-ms-wax":{"source":"apache","extensions":["wax"]},"audio/x-ms-wma":{"source":"apache","extensions":["wma"]},"audio/x-pn-realaudio":{"source":"apache","extensions":["ram","ra"]},"audio/x-pn-realaudio-plugin":{"source":"apache","extensions":["rmp"]},"audio/x-realaudio":{"source":"nginx","extensions":["ra"]},"audio/x-tta":{"source":"apache"},"audio/x-wav":{"source":"apache","extensions":["wav"]},"audio/xm":{"source":"apache","extensions":["xm"]},"chemical/x-cdx":{"source":"apache","extensions":["cdx"]},"chemical/x-cif":{"source":"apache","extensions":["cif"]},"chemical/x-cmdf":{"source":"apache","extensions":["cmdf"]},"chemical/x-cml":{"source":"apache","extensions":["cml"]},"chemical/x-csml":{"source":"apache","extensions":["csml"]},"chemical/x-pdb":{"source":"apache"},"chemical/x-xyz":{"source":"apache","extensions":["xyz"]},"font/collection":{"source":"iana","extensions":["ttc"]},"font/otf":{"source":"iana","compressible":true,"extensions":["otf"]},"font/sfnt":{"source":"iana"},"font/ttf":{"source":"iana","compressible":true,"extensions":["ttf"]},"font/woff":{"source":"iana","extensions":["woff"]},"font/woff2":{"source":"iana","extensions":["woff2"]},"image/aces":{"source":"iana","extensions":["exr"]},"image/apng":{"compressible":false,"extensions":["apng"]},"image/avci":{"source":"iana","extensions":["avci"]},"image/avcs":{"source":"iana","extensions":["avcs"]},"image/avif":{"source":"iana","compressible":false,"extensions":["avif"]},"image/bmp":{"source":"iana","compressible":true,"extensions":["bmp"]},"image/cgm":{"source":"iana","extensions":["cgm"]},"image/dicom-rle":{"source":"iana","extensions":["drle"]},"image/emf":{"source":"iana","extensions":["emf"]},"image/fits":{"source":"iana","extensions":["fits"]},"image/g3fax":{"source":"iana","extensions":["g3"]},"image/gif":{"source":"iana","compressible":false,"extensions":["gif"]},"image/heic":{"source":"iana","extensions":["heic"]},"image/heic-sequence":{"source":"iana","extensions":["heics"]},"image/heif":{"source":"iana","extensions":["heif"]},"image/heif-sequence":{"source":"iana","extensions":["heifs"]},"image/hej2k":{"source":"iana","extensions":["hej2"]},"image/hsj2":{"source":"iana","extensions":["hsj2"]},"image/ief":{"source":"iana","extensions":["ief"]},"image/jls":{"source":"iana","extensions":["jls"]},"image/jp2":{"source":"iana","compressible":false,"extensions":["jp2","jpg2"]},"image/jpeg":{"source":"iana","compressible":false,"extensions":["jpeg","jpg","jpe"]},"image/jph":{"source":"iana","extensions":["jph"]},"image/jphc":{"source":"iana","extensions":["jhc"]},"image/jpm":{"source":"iana","compressible":false,"extensions":["jpm"]},"image/jpx":{"source":"iana","compressible":false,"extensions":["jpx","jpf"]},"image/jxr":{"source":"iana","extensions":["jxr"]},"image/jxra":{"source":"iana","extensions":["jxra"]},"image/jxrs":{"source":"iana","extensions":["jxrs"]},"image/jxs":{"source":"iana","extensions":["jxs"]},"image/jxsc":{"source":"iana","extensions":["jxsc"]},"image/jxsi":{"source":"iana","extensions":["jxsi"]},"image/jxss":{"source":"iana","extensions":["jxss"]},"image/ktx":{"source":"iana","extensions":["ktx"]},"image/ktx2":{"source":"iana","extensions":["ktx2"]},"image/naplps":{"source":"iana"},"image/pjpeg":{"compressible":false},"image/png":{"source":"iana","compressible":false,"extensions":["png"]},"image/prs.btif":{"source":"iana","extensions":["btif"]},"image/prs.pti":{"source":"iana","extensions":["pti"]},"image/pwg-raster":{"source":"iana"},"image/sgi":{"source":"apache","extensions":["sgi"]},"image/svg+xml":{"source":"iana","compressible":true,"extensions":["svg","svgz"]},"image/t38":{"source":"iana","extensions":["t38"]},"image/tiff":{"source":"iana","compressible":false,"extensions":["tif","tiff"]},"image/tiff-fx":{"source":"iana","extensions":["tfx"]},"image/vnd.adobe.photoshop":{"source":"iana","compressible":true,"extensions":["psd"]},"image/vnd.airzip.accelerator.azv":{"source":"iana","extensions":["azv"]},"image/vnd.cns.inf2":{"source":"iana"},"image/vnd.dece.graphic":{"source":"iana","extensions":["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{"source":"iana","extensions":["djvu","djv"]},"image/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"image/vnd.dwg":{"source":"iana","extensions":["dwg"]},"image/vnd.dxf":{"source":"iana","extensions":["dxf"]},"image/vnd.fastbidsheet":{"source":"iana","extensions":["fbs"]},"image/vnd.fpx":{"source":"iana","extensions":["fpx"]},"image/vnd.fst":{"source":"iana","extensions":["fst"]},"image/vnd.fujixerox.edmics-mmr":{"source":"iana","extensions":["mmr"]},"image/vnd.fujixerox.edmics-rlc":{"source":"iana","extensions":["rlc"]},"image/vnd.globalgraphics.pgb":{"source":"iana"},"image/vnd.microsoft.icon":{"source":"iana","compressible":true,"extensions":["ico"]},"image/vnd.mix":{"source":"iana"},"image/vnd.mozilla.apng":{"source":"iana"},"image/vnd.ms-dds":{"compressible":true,"extensions":["dds"]},"image/vnd.ms-modi":{"source":"iana","extensions":["mdi"]},"image/vnd.ms-photo":{"source":"apache","extensions":["wdp"]},"image/vnd.net-fpx":{"source":"iana","extensions":["npx"]},"image/vnd.pco.b16":{"source":"iana","extensions":["b16"]},"image/vnd.radiance":{"source":"iana"},"image/vnd.sealed.png":{"source":"iana"},"image/vnd.sealedmedia.softseal.gif":{"source":"iana"},"image/vnd.sealedmedia.softseal.jpg":{"source":"iana"},"image/vnd.svf":{"source":"iana"},"image/vnd.tencent.tap":{"source":"iana","extensions":["tap"]},"image/vnd.valve.source.texture":{"source":"iana","extensions":["vtf"]},"image/vnd.wap.wbmp":{"source":"iana","extensions":["wbmp"]},"image/vnd.xiff":{"source":"iana","extensions":["xif"]},"image/vnd.zbrush.pcx":{"source":"iana","extensions":["pcx"]},"image/webp":{"source":"apache","extensions":["webp"]},"image/wmf":{"source":"iana","extensions":["wmf"]},"image/x-3ds":{"source":"apache","extensions":["3ds"]},"image/x-cmu-raster":{"source":"apache","extensions":["ras"]},"image/x-cmx":{"source":"apache","extensions":["cmx"]},"image/x-freehand":{"source":"apache","extensions":["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{"source":"apache","compressible":true,"extensions":["ico"]},"image/x-jng":{"source":"nginx","extensions":["jng"]},"image/x-mrsid-image":{"source":"apache","extensions":["sid"]},"image/x-ms-bmp":{"source":"nginx","compressible":true,"extensions":["bmp"]},"image/x-pcx":{"source":"apache","extensions":["pcx"]},"image/x-pict":{"source":"apache","extensions":["pic","pct"]},"image/x-portable-anymap":{"source":"apache","extensions":["pnm"]},"image/x-portable-bitmap":{"source":"apache","extensions":["pbm"]},"image/x-portable-graymap":{"source":"apache","extensions":["pgm"]},"image/x-portable-pixmap":{"source":"apache","extensions":["ppm"]},"image/x-rgb":{"source":"apache","extensions":["rgb"]},"image/x-tga":{"source":"apache","extensions":["tga"]},"image/x-xbitmap":{"source":"apache","extensions":["xbm"]},"image/x-xcf":{"compressible":false},"image/x-xpixmap":{"source":"apache","extensions":["xpm"]},"image/x-xwindowdump":{"source":"apache","extensions":["xwd"]},"message/cpim":{"source":"iana"},"message/delivery-status":{"source":"iana"},"message/disposition-notification":{"source":"iana","extensions":["disposition-notification"]},"message/external-body":{"source":"iana"},"message/feedback-report":{"source":"iana"},"message/global":{"source":"iana","extensions":["u8msg"]},"message/global-delivery-status":{"source":"iana","extensions":["u8dsn"]},"message/global-disposition-notification":{"source":"iana","extensions":["u8mdn"]},"message/global-headers":{"source":"iana","extensions":["u8hdr"]},"message/http":{"source":"iana","compressible":false},"message/imdn+xml":{"source":"iana","compressible":true},"message/news":{"source":"iana"},"message/partial":{"source":"iana","compressible":false},"message/rfc822":{"source":"iana","compressible":true,"extensions":["eml","mime"]},"message/s-http":{"source":"iana"},"message/sip":{"source":"iana"},"message/sipfrag":{"source":"iana"},"message/tracking-status":{"source":"iana"},"message/vnd.si.simp":{"source":"iana"},"message/vnd.wfa.wsc":{"source":"iana","extensions":["wsc"]},"model/3mf":{"source":"iana","extensions":["3mf"]},"model/e57":{"source":"iana"},"model/gltf+json":{"source":"iana","compressible":true,"extensions":["gltf"]},"model/gltf-binary":{"source":"iana","compressible":true,"extensions":["glb"]},"model/iges":{"source":"iana","compressible":false,"extensions":["igs","iges"]},"model/mesh":{"source":"iana","compressible":false,"extensions":["msh","mesh","silo"]},"model/mtl":{"source":"iana","extensions":["mtl"]},"model/obj":{"source":"iana","extensions":["obj"]},"model/step":{"source":"iana"},"model/step+xml":{"source":"iana","compressible":true,"extensions":["stpx"]},"model/step+zip":{"source":"iana","compressible":false,"extensions":["stpz"]},"model/step-xml+zip":{"source":"iana","compressible":false,"extensions":["stpxz"]},"model/stl":{"source":"iana","extensions":["stl"]},"model/vnd.collada+xml":{"source":"iana","compressible":true,"extensions":["dae"]},"model/vnd.dwf":{"source":"iana","extensions":["dwf"]},"model/vnd.flatland.3dml":{"source":"iana"},"model/vnd.gdl":{"source":"iana","extensions":["gdl"]},"model/vnd.gs-gdl":{"source":"apache"},"model/vnd.gs.gdl":{"source":"iana"},"model/vnd.gtw":{"source":"iana","extensions":["gtw"]},"model/vnd.moml+xml":{"source":"iana","compressible":true},"model/vnd.mts":{"source":"iana","extensions":["mts"]},"model/vnd.opengex":{"source":"iana","extensions":["ogex"]},"model/vnd.parasolid.transmit.binary":{"source":"iana","extensions":["x_b"]},"model/vnd.parasolid.transmit.text":{"source":"iana","extensions":["x_t"]},"model/vnd.pytha.pyox":{"source":"iana"},"model/vnd.rosette.annotated-data-model":{"source":"iana"},"model/vnd.sap.vds":{"source":"iana","extensions":["vds"]},"model/vnd.usdz+zip":{"source":"iana","compressible":false,"extensions":["usdz"]},"model/vnd.valve.source.compiled-map":{"source":"iana","extensions":["bsp"]},"model/vnd.vtu":{"source":"iana","extensions":["vtu"]},"model/vrml":{"source":"iana","compressible":false,"extensions":["wrl","vrml"]},"model/x3d+binary":{"source":"apache","compressible":false,"extensions":["x3db","x3dbz"]},"model/x3d+fastinfoset":{"source":"iana","extensions":["x3db"]},"model/x3d+vrml":{"source":"apache","compressible":false,"extensions":["x3dv","x3dvz"]},"model/x3d+xml":{"source":"iana","compressible":true,"extensions":["x3d","x3dz"]},"model/x3d-vrml":{"source":"iana","extensions":["x3dv"]},"multipart/alternative":{"source":"iana","compressible":false},"multipart/appledouble":{"source":"iana"},"multipart/byteranges":{"source":"iana"},"multipart/digest":{"source":"iana"},"multipart/encrypted":{"source":"iana","compressible":false},"multipart/form-data":{"source":"iana","compressible":false},"multipart/header-set":{"source":"iana"},"multipart/mixed":{"source":"iana"},"multipart/multilingual":{"source":"iana"},"multipart/parallel":{"source":"iana"},"multipart/related":{"source":"iana","compressible":false},"multipart/report":{"source":"iana"},"multipart/signed":{"source":"iana","compressible":false},"multipart/vnd.bint.med-plus":{"source":"iana"},"multipart/voice-message":{"source":"iana"},"multipart/x-mixed-replace":{"source":"iana"},"text/1d-interleaved-parityfec":{"source":"iana"},"text/cache-manifest":{"source":"iana","compressible":true,"extensions":["appcache","manifest"]},"text/calendar":{"source":"iana","extensions":["ics","ifb"]},"text/calender":{"compressible":true},"text/cmd":{"compressible":true},"text/coffeescript":{"extensions":["coffee","litcoffee"]},"text/cql":{"source":"iana"},"text/cql-expression":{"source":"iana"},"text/cql-identifier":{"source":"iana"},"text/css":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["css"]},"text/csv":{"source":"iana","compressible":true,"extensions":["csv"]},"text/csv-schema":{"source":"iana"},"text/directory":{"source":"iana"},"text/dns":{"source":"iana"},"text/ecmascript":{"source":"iana"},"text/encaprtp":{"source":"iana"},"text/enriched":{"source":"iana"},"text/fhirpath":{"source":"iana"},"text/flexfec":{"source":"iana"},"text/fwdred":{"source":"iana"},"text/gff3":{"source":"iana"},"text/grammar-ref-list":{"source":"iana"},"text/html":{"source":"iana","compressible":true,"extensions":["html","htm","shtml"]},"text/jade":{"extensions":["jade"]},"text/javascript":{"source":"iana","compressible":true},"text/jcr-cnd":{"source":"iana"},"text/jsx":{"compressible":true,"extensions":["jsx"]},"text/less":{"compressible":true,"extensions":["less"]},"text/markdown":{"source":"iana","compressible":true,"extensions":["markdown","md"]},"text/mathml":{"source":"nginx","extensions":["mml"]},"text/mdx":{"compressible":true,"extensions":["mdx"]},"text/mizar":{"source":"iana"},"text/n3":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["n3"]},"text/parameters":{"source":"iana","charset":"UTF-8"},"text/parityfec":{"source":"iana"},"text/plain":{"source":"iana","compressible":true,"extensions":["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{"source":"iana","charset":"UTF-8"},"text/prs.fallenstein.rst":{"source":"iana"},"text/prs.lines.tag":{"source":"iana","extensions":["dsc"]},"text/prs.prop.logic":{"source":"iana"},"text/raptorfec":{"source":"iana"},"text/red":{"source":"iana"},"text/rfc822-headers":{"source":"iana"},"text/richtext":{"source":"iana","compressible":true,"extensions":["rtx"]},"text/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"text/rtp-enc-aescm128":{"source":"iana"},"text/rtploopback":{"source":"iana"},"text/rtx":{"source":"iana"},"text/sgml":{"source":"iana","extensions":["sgml","sgm"]},"text/shaclc":{"source":"iana"},"text/shex":{"source":"iana","extensions":["shex"]},"text/slim":{"extensions":["slim","slm"]},"text/spdx":{"source":"iana","extensions":["spdx"]},"text/strings":{"source":"iana"},"text/stylus":{"extensions":["stylus","styl"]},"text/t140":{"source":"iana"},"text/tab-separated-values":{"source":"iana","compressible":true,"extensions":["tsv"]},"text/troff":{"source":"iana","extensions":["t","tr","roff","man","me","ms"]},"text/turtle":{"source":"iana","charset":"UTF-8","extensions":["ttl"]},"text/ulpfec":{"source":"iana"},"text/uri-list":{"source":"iana","compressible":true,"extensions":["uri","uris","urls"]},"text/vcard":{"source":"iana","compressible":true,"extensions":["vcard"]},"text/vnd.a":{"source":"iana"},"text/vnd.abc":{"source":"iana"},"text/vnd.ascii-art":{"source":"iana"},"text/vnd.curl":{"source":"iana","extensions":["curl"]},"text/vnd.curl.dcurl":{"source":"apache","extensions":["dcurl"]},"text/vnd.curl.mcurl":{"source":"apache","extensions":["mcurl"]},"text/vnd.curl.scurl":{"source":"apache","extensions":["scurl"]},"text/vnd.debian.copyright":{"source":"iana","charset":"UTF-8"},"text/vnd.dmclientscript":{"source":"iana"},"text/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"text/vnd.esmertec.theme-descriptor":{"source":"iana","charset":"UTF-8"},"text/vnd.familysearch.gedcom":{"source":"iana","extensions":["ged"]},"text/vnd.ficlab.flt":{"source":"iana"},"text/vnd.fly":{"source":"iana","extensions":["fly"]},"text/vnd.fmi.flexstor":{"source":"iana","extensions":["flx"]},"text/vnd.gml":{"source":"iana"},"text/vnd.graphviz":{"source":"iana","extensions":["gv"]},"text/vnd.hans":{"source":"iana"},"text/vnd.hgl":{"source":"iana"},"text/vnd.in3d.3dml":{"source":"iana","extensions":["3dml"]},"text/vnd.in3d.spot":{"source":"iana","extensions":["spot"]},"text/vnd.iptc.newsml":{"source":"iana"},"text/vnd.iptc.nitf":{"source":"iana"},"text/vnd.latex-z":{"source":"iana"},"text/vnd.motorola.reflex":{"source":"iana"},"text/vnd.ms-mediapackage":{"source":"iana"},"text/vnd.net2phone.commcenter.command":{"source":"iana"},"text/vnd.radisys.msml-basic-layout":{"source":"iana"},"text/vnd.senx.warpscript":{"source":"iana"},"text/vnd.si.uricatalogue":{"source":"iana"},"text/vnd.sosi":{"source":"iana"},"text/vnd.sun.j2me.app-descriptor":{"source":"iana","charset":"UTF-8","extensions":["jad"]},"text/vnd.trolltech.linguist":{"source":"iana","charset":"UTF-8"},"text/vnd.wap.si":{"source":"iana"},"text/vnd.wap.sl":{"source":"iana"},"text/vnd.wap.wml":{"source":"iana","extensions":["wml"]},"text/vnd.wap.wmlscript":{"source":"iana","extensions":["wmls"]},"text/vtt":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["vtt"]},"text/x-asm":{"source":"apache","extensions":["s","asm"]},"text/x-c":{"source":"apache","extensions":["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{"source":"nginx","extensions":["htc"]},"text/x-fortran":{"source":"apache","extensions":["f","for","f77","f90"]},"text/x-gwt-rpc":{"compressible":true},"text/x-handlebars-template":{"extensions":["hbs"]},"text/x-java-source":{"source":"apache","extensions":["java"]},"text/x-jquery-tmpl":{"compressible":true},"text/x-lua":{"extensions":["lua"]},"text/x-markdown":{"compressible":true,"extensions":["mkd"]},"text/x-nfo":{"source":"apache","extensions":["nfo"]},"text/x-opml":{"source":"apache","extensions":["opml"]},"text/x-org":{"compressible":true,"extensions":["org"]},"text/x-pascal":{"source":"apache","extensions":["p","pas"]},"text/x-processing":{"compressible":true,"extensions":["pde"]},"text/x-sass":{"extensions":["sass"]},"text/x-scss":{"extensions":["scss"]},"text/x-setext":{"source":"apache","extensions":["etx"]},"text/x-sfv":{"source":"apache","extensions":["sfv"]},"text/x-suse-ymp":{"compressible":true,"extensions":["ymp"]},"text/x-uuencode":{"source":"apache","extensions":["uu"]},"text/x-vcalendar":{"source":"apache","extensions":["vcs"]},"text/x-vcard":{"source":"apache","extensions":["vcf"]},"text/xml":{"source":"iana","compressible":true,"extensions":["xml"]},"text/xml-external-parsed-entity":{"source":"iana"},"text/yaml":{"compressible":true,"extensions":["yaml","yml"]},"video/1d-interleaved-parityfec":{"source":"iana"},"video/3gpp":{"source":"iana","extensions":["3gp","3gpp"]},"video/3gpp-tt":{"source":"iana"},"video/3gpp2":{"source":"iana","extensions":["3g2"]},"video/av1":{"source":"iana"},"video/bmpeg":{"source":"iana"},"video/bt656":{"source":"iana"},"video/celb":{"source":"iana"},"video/dv":{"source":"iana"},"video/encaprtp":{"source":"iana"},"video/ffv1":{"source":"iana"},"video/flexfec":{"source":"iana"},"video/h261":{"source":"iana","extensions":["h261"]},"video/h263":{"source":"iana","extensions":["h263"]},"video/h263-1998":{"source":"iana"},"video/h263-2000":{"source":"iana"},"video/h264":{"source":"iana","extensions":["h264"]},"video/h264-rcdo":{"source":"iana"},"video/h264-svc":{"source":"iana"},"video/h265":{"source":"iana"},"video/iso.segment":{"source":"iana","extensions":["m4s"]},"video/jpeg":{"source":"iana","extensions":["jpgv"]},"video/jpeg2000":{"source":"iana"},"video/jpm":{"source":"apache","extensions":["jpm","jpgm"]},"video/jxsv":{"source":"iana"},"video/mj2":{"source":"iana","extensions":["mj2","mjp2"]},"video/mp1s":{"source":"iana"},"video/mp2p":{"source":"iana"},"video/mp2t":{"source":"iana","extensions":["ts"]},"video/mp4":{"source":"iana","compressible":false,"extensions":["mp4","mp4v","mpg4"]},"video/mp4v-es":{"source":"iana"},"video/mpeg":{"source":"iana","compressible":false,"extensions":["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{"source":"iana"},"video/mpv":{"source":"iana"},"video/nv":{"source":"iana"},"video/ogg":{"source":"iana","compressible":false,"extensions":["ogv"]},"video/parityfec":{"source":"iana"},"video/pointer":{"source":"iana"},"video/quicktime":{"source":"iana","compressible":false,"extensions":["qt","mov"]},"video/raptorfec":{"source":"iana"},"video/raw":{"source":"iana"},"video/rtp-enc-aescm128":{"source":"iana"},"video/rtploopback":{"source":"iana"},"video/rtx":{"source":"iana"},"video/scip":{"source":"iana"},"video/smpte291":{"source":"iana"},"video/smpte292m":{"source":"iana"},"video/ulpfec":{"source":"iana"},"video/vc1":{"source":"iana"},"video/vc2":{"source":"iana"},"video/vnd.cctv":{"source":"iana"},"video/vnd.dece.hd":{"source":"iana","extensions":["uvh","uvvh"]},"video/vnd.dece.mobile":{"source":"iana","extensions":["uvm","uvvm"]},"video/vnd.dece.mp4":{"source":"iana"},"video/vnd.dece.pd":{"source":"iana","extensions":["uvp","uvvp"]},"video/vnd.dece.sd":{"source":"iana","extensions":["uvs","uvvs"]},"video/vnd.dece.video":{"source":"iana","extensions":["uvv","uvvv"]},"video/vnd.directv.mpeg":{"source":"iana"},"video/vnd.directv.mpeg-tts":{"source":"iana"},"video/vnd.dlna.mpeg-tts":{"source":"iana"},"video/vnd.dvb.file":{"source":"iana","extensions":["dvb"]},"video/vnd.fvt":{"source":"iana","extensions":["fvt"]},"video/vnd.hns.video":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.ttsavc":{"source":"iana"},"video/vnd.iptvforum.ttsmpeg2":{"source":"iana"},"video/vnd.motorola.video":{"source":"iana"},"video/vnd.motorola.videop":{"source":"iana"},"video/vnd.mpegurl":{"source":"iana","extensions":["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{"source":"iana","extensions":["pyv"]},"video/vnd.nokia.interleaved-multimedia":{"source":"iana"},"video/vnd.nokia.mp4vr":{"source":"iana"},"video/vnd.nokia.videovoip":{"source":"iana"},"video/vnd.objectvideo":{"source":"iana"},"video/vnd.radgamettools.bink":{"source":"iana"},"video/vnd.radgamettools.smacker":{"source":"iana"},"video/vnd.sealed.mpeg1":{"source":"iana"},"video/vnd.sealed.mpeg4":{"source":"iana"},"video/vnd.sealed.swf":{"source":"iana"},"video/vnd.sealedmedia.softseal.mov":{"source":"iana"},"video/vnd.uvvu.mp4":{"source":"iana","extensions":["uvu","uvvu"]},"video/vnd.vivo":{"source":"iana","extensions":["viv"]},"video/vnd.youtube.yt":{"source":"iana"},"video/vp8":{"source":"iana"},"video/vp9":{"source":"iana"},"video/webm":{"source":"apache","compressible":false,"extensions":["webm"]},"video/x-f4v":{"source":"apache","extensions":["f4v"]},"video/x-fli":{"source":"apache","extensions":["fli"]},"video/x-flv":{"source":"apache","compressible":false,"extensions":["flv"]},"video/x-m4v":{"source":"apache","extensions":["m4v"]},"video/x-matroska":{"source":"apache","compressible":false,"extensions":["mkv","mk3d","mks"]},"video/x-mng":{"source":"apache","extensions":["mng"]},"video/x-ms-asf":{"source":"apache","extensions":["asf","asx"]},"video/x-ms-vob":{"source":"apache","extensions":["vob"]},"video/x-ms-wm":{"source":"apache","extensions":["wm"]},"video/x-ms-wmv":{"source":"apache","compressible":false,"extensions":["wmv"]},"video/x-ms-wmx":{"source":"apache","extensions":["wmx"]},"video/x-ms-wvx":{"source":"apache","extensions":["wvx"]},"video/x-msvideo":{"source":"apache","extensions":["avi"]},"video/x-sgi-movie":{"source":"apache","extensions":["movie"]},"video/x-smv":{"source":"apache","extensions":["smv"]},"x-conference/x-cooltalk":{"source":"apache","extensions":["ice"]},"x-shader/x-fragment":{"compressible":true},"x-shader/x-vertex":{"compressible":true}}')}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}return n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n(1568)})()));
3
+ //# sourceMappingURL=solid-ui.min.js.map