@pod-os/elements 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/BrokenFile-b01d72da.js +226 -0
- package/dist/cjs/ResourceAware-f1aac952.js +7 -0
- package/dist/cjs/elements.cjs.js +1 -1
- package/dist/{esm/ion-app_48.entry.js → cjs/index-74c56a41.js} +8 -4122
- package/dist/cjs/ion-app_25.cjs.entry.js +3043 -0
- package/dist/cjs/ion-badge_7.cjs.entry.js +258 -0
- package/dist/cjs/ion-item-divider_3.cjs.entry.js +109 -0
- package/dist/cjs/ion-item_3.cjs.entry.js +367 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/pos-app-document-viewer.cjs.entry.js +28 -0
- package/dist/cjs/pos-app-generic.cjs.entry.js +16 -0
- package/dist/cjs/pos-app-image-viewer.cjs.entry.js +29 -0
- package/dist/cjs/pos-app-rdf-document.cjs.entry.js +16 -0
- package/dist/cjs/pos-description_2.cjs.entry.js +40 -0
- package/dist/cjs/pos-document.cjs.entry.js +67 -0
- package/dist/cjs/pos-relations_2.cjs.entry.js +45 -0
- package/dist/cjs/pos-subjects.cjs.entry.js +28 -0
- package/dist/collection/apps/{pos-app-pdf-viewer/pos-app-pdf-viewer.js → pos-app-document-viewer/pos-app-document-viewer.js} +3 -3
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/{pos-pdf/pos-pdf.css → pos-document/pos-document.css} +0 -0
- package/dist/collection/components/{pos-pdf/pos-pdf.js → pos-document/pos-document.js} +4 -4
- package/dist/collection/components/pos-type-router/pos-type-router.js +3 -12
- package/dist/collection/components/pos-type-router/selectAppForTypes.js +24 -0
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.js +2 -2
- package/dist/components/pos-app-browser.js +46 -184
- package/dist/components/pos-app-document-viewer.d.ts +11 -0
- package/dist/components/{pos-app-pdf-viewer2.js → pos-app-document-viewer.js} +50 -47
- package/dist/components/pos-app-generic.js +192 -1
- package/dist/components/pos-app-image-viewer.js +160 -1
- package/dist/components/pos-app-rdf-document.js +168 -1
- package/dist/components/{pos-pdf.d.ts → pos-document.d.ts} +4 -4
- package/dist/components/pos-document.js +6 -0
- package/dist/components/{pos-pdf2.js → pos-document2.js} +8 -8
- package/dist/components/pos-router2.js +18 -180
- package/dist/components/pos-type-router2.js +28 -217
- package/dist/elements/elements.esm.js +1 -1
- package/dist/elements/{p-145ab600.entry.js → p-0ed0e3ba.entry.js} +1 -1
- package/dist/elements/{p-5808c505.js → p-12407693.js} +1 -1
- package/dist/elements/p-1688668c.entry.js +1 -0
- package/dist/elements/{p-85d6f579.entry.js → p-16afe2d7.entry.js} +1 -1
- package/dist/elements/{p-f4b358b2.entry.js → p-1a9cdd0b.entry.js} +1 -1
- package/dist/elements/{p-8ed61030.entry.js → p-21a6c0d5.entry.js} +1 -1
- package/dist/elements/{p-1e3bbab1.entry.js → p-24fffcb6.entry.js} +1 -1
- package/dist/elements/p-2ca5f7f2.entry.js +5 -0
- package/dist/elements/{p-7fc32e8d.entry.js → p-2eced374.entry.js} +1 -1
- package/dist/elements/p-301096a8.entry.js +1 -0
- package/dist/elements/{p-2a9a9bb1.entry.js → p-35faa0fa.entry.js} +1 -1
- package/dist/elements/{p-f851b91a.js → p-37c43290.js} +2 -2
- package/dist/elements/p-3f0dec28.entry.js +1 -0
- package/dist/elements/p-410c567f.entry.js +1 -0
- package/dist/elements/p-417ecc9e.js +1 -0
- package/dist/elements/p-43717c61.js +1 -0
- package/dist/elements/{p-b57b6dfe.entry.js → p-573e7d6e.entry.js} +1 -1
- package/dist/elements/{p-ec8c13e0.entry.js → p-59680588.entry.js} +1 -1
- package/dist/elements/p-5fe41c08.entry.js +1 -0
- package/dist/elements/p-68110709.entry.js +1 -0
- package/dist/elements/{p-29c0f03f.js → p-6ed079a5.js} +2 -2
- package/dist/elements/p-709fd743.entry.js +1 -0
- package/dist/elements/p-73648481.entry.js +1 -0
- package/dist/elements/p-784b06b3.entry.js +1 -0
- package/dist/elements/p-84cc1417.entry.js +1 -0
- package/dist/elements/p-8596ddbc.js +4 -0
- package/dist/elements/{p-b0d8c4f0.entry.js → p-8c0124df.entry.js} +1 -1
- package/dist/elements/{p-020dee35.entry.js → p-a48e16ba.entry.js} +1 -1
- package/dist/elements/p-ab11bb11.js +4 -0
- package/dist/elements/{p-8a24508e.entry.js → p-ae87571c.entry.js} +1 -1
- package/dist/elements/p-b2acbe46.entry.js +1 -0
- package/dist/elements/p-babdb154.entry.js +9 -0
- package/dist/elements/{p-9c719139.js → p-bb128f00.js} +1 -1
- package/dist/elements/{p-fe753f07.entry.js → p-c442a411.entry.js} +1 -1
- package/dist/elements/{p-b36873af.entry.js → p-c4d119d2.entry.js} +1 -1
- package/dist/elements/p-eea7ce93.js +116 -0
- package/dist/elements/p-f72edc68.entry.js +1 -0
- package/dist/elements/{p-6987a85b.entry.js → p-ffb33569.entry.js} +1 -1
- package/dist/esm/BrokenFile-e1e68cb6.js +223 -0
- package/dist/esm/ResourceAware-845001bb.js +5 -0
- package/dist/esm/{data-62c81c24.js → data-2c0eab05.js} +1 -1
- package/dist/esm/elements.js +1 -1
- package/dist/esm/{index-ebf7f059.js → index-38d8370e.js} +1 -1
- package/dist/esm/{index-1f3d8582.js → index-47f5cd9a.js} +1 -1
- package/dist/{cjs/ion-app_48.cjs.entry.js → esm/index-5c6f4d9d.js} +6 -4174
- package/dist/esm/{index-65ecd543.js → index-753825bf.js} +1 -1
- package/dist/esm/{input-shims-8a389148.js → input-shims-167ef062.js} +2 -2
- package/dist/esm/ion-accordion.entry.js +1 -1
- package/dist/esm/ion-app_25.entry.js +3015 -0
- package/dist/esm/ion-back-button.entry.js +1 -1
- package/dist/esm/ion-badge_7.entry.js +248 -0
- package/dist/esm/ion-breadcrumb.entry.js +1 -1
- package/dist/esm/ion-datetime-button.entry.js +2 -2
- package/dist/esm/ion-datetime.entry.js +3 -3
- package/dist/esm/ion-fab-button.entry.js +1 -1
- package/dist/esm/ion-infinite-scroll.entry.js +2 -2
- package/dist/esm/ion-input.entry.js +1 -1
- package/dist/esm/ion-item-divider_3.entry.js +103 -0
- package/dist/esm/ion-item-sliding.entry.js +2 -2
- package/dist/esm/ion-item_3.entry.js +361 -0
- package/dist/esm/ion-menu-button.entry.js +1 -1
- package/dist/esm/ion-modal.entry.js +2 -2
- package/dist/esm/ion-range.entry.js +2 -2
- package/dist/esm/ion-refresher-content.entry.js +1 -1
- package/dist/esm/ion-refresher.entry.js +2 -2
- package/dist/esm/ion-reorder-group.entry.js +2 -2
- package/dist/esm/ion-reorder.entry.js +1 -1
- package/dist/esm/ion-toggle.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pos-app-document-viewer.entry.js +24 -0
- package/dist/esm/pos-app-generic.entry.js +12 -0
- package/dist/esm/pos-app-image-viewer.entry.js +25 -0
- package/dist/esm/pos-app-rdf-document.entry.js +12 -0
- package/dist/esm/pos-description_2.entry.js +35 -0
- package/dist/esm/pos-document.entry.js +63 -0
- package/dist/esm/pos-relations_2.entry.js +40 -0
- package/dist/esm/pos-subjects.entry.js +24 -0
- package/dist/esm/{status-tap-33623c88.js → status-tap-ce25f9e5.js} +2 -2
- package/dist/types/apps/{pos-app-pdf-viewer/pos-app-pdf-viewer.d.ts → pos-app-document-viewer/pos-app-document-viewer.d.ts} +1 -1
- package/dist/types/components/{pos-pdf/pos-pdf.d.ts → pos-document/pos-document.d.ts} +1 -1
- package/dist/types/components/pos-type-router/selectAppForTypes.d.ts +8 -0
- package/dist/types/components.d.ts +40 -40
- package/package.json +1 -1
- package/dist/components/pos-app-generic2.js +0 -194
- package/dist/components/pos-app-image-viewer2.js +0 -162
- package/dist/components/pos-app-pdf-viewer.d.ts +0 -11
- package/dist/components/pos-app-pdf-viewer.js +0 -6
- package/dist/components/pos-app-rdf-document2.js +0 -170
- package/dist/components/pos-pdf.js +0 -6
- package/dist/elements/p-10cae467.js +0 -4
- package/dist/elements/p-19e4a688.js +0 -4
- package/dist/elements/p-5f811ad7.entry.js +0 -1
- package/dist/elements/p-7a79a3cd.entry.js +0 -128
- package/dist/elements/p-b9a87655.entry.js +0 -1
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import{r as t,h as e,H as i,c as n,d as r,f as o,e as s,w as a,i as c,j as l}from"./p-cab74d27.js";import{g as u,c as h,a as d}from"./p-d0c3f4ee.js";import{c as f,o as p,h as v}from"./p-0991c811.js";import{h as g,i as m,a as w,c as b,b as y,r as x,d as k}from"./p-1afc4eb4.js";import{p as E,a as S}from"./p-9c719139.js";import{i as F}from"./p-278ca4c9.js";import{f as A,p as _,g as j}from"./p-29c0f03f.js";import{c as C}from"./p-8112afea.js";import{c as R,a as I,b as T,d as O,s as P,e as N}from"./p-5808c505.js";import"./p-c84205a3.js";const D=class{constructor(e){t(this,e)}componentDidLoad(){U((async()=>{const t=d(window,"hybrid");if(h.getBoolean("_testing")||import("./p-36d4c9a8.js").then((t=>t.startTapClick(h))),h.getBoolean("statusTap",t)&&import("./p-10cae467.js").then((t=>t.startStatusTap())),h.getBoolean("inputShims",M())){const t=d(window,"ios")?"ios":"android";import("./p-19e4a688.js").then((e=>e.startInputShims(h,t)))}const e=await import("./p-9ca37332.js");h.getBoolean("hardwareBackButton",t)?e.startHardwareBackButton():e.blockHardwareBackButton(),"undefined"!=typeof window&&import("./p-dcc6b03c.js").then((t=>t.startKeyboardAssist(window))),import("./p-1beaf6bf.js").then((t=>this.focusVisible=t.startFocusVisible()))}))}async setFocus(t){this.focusVisible&&this.focusVisible.setFocus(t)}render(){const t=u(this);return e(i,{class:{[t]:!0,"ion-page":!0,"force-statusbar-padding":h.getBoolean("_forceStatusbarPadding")}})}get el(){return n(this)}},M=()=>!(!d(window,"ios")||!d(window,"mobile"))||!(!d(window,"android")||!d(window,"mobileweb")),U=t=>{"requestIdleCallback"in window?window.requestIdleCallback(t):setTimeout(t,32)};D.style="html.plt-mobile ion-app{user-select:none}html.plt-mobile ion-app [contenteditable]{user-select:text}ion-app.force-statusbar-padding{--ion-safe-area-top:20px}";const L=class{constructor(e){t(this,e)}render(){const t=u(this);return e(i,{class:f(this.color,{[t]:!0})},e("slot",null))}};L.style={ios:":host{--background:var(--ion-color-primary, #3880ff);--color:var(--ion-color-primary-contrast, #fff);--padding-top:3px;--padding-end:8px;--padding-bottom:3px;--padding-start:8px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:inline-block;min-width:10px;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);font-size:13px;font-weight:bold;line-height:1;text-align:center;white-space:nowrap;contain:content;vertical-align:baseline}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}:host(.ion-color){background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(:empty){display:none}:host{border-radius:10px}",md:":host{--background:var(--ion-color-primary, #3880ff);--color:var(--ion-color-primary-contrast, #fff);--padding-top:3px;--padding-end:8px;--padding-bottom:3px;--padding-start:8px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:inline-block;min-width:10px;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);font-size:13px;font-weight:bold;line-height:1;text-align:center;white-space:nowrap;contain:content;vertical-align:baseline}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}:host(.ion-color){background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(:empty){display:none}:host{--padding-top:3px;--padding-end:4px;--padding-bottom:4px;--padding-start:4px;border-radius:4px}"};const B=class{constructor(e){t(this,e),this.ionFocus=r(this,"ionFocus",7),this.ionBlur=r(this,"ionBlur",7),this.inItem=!1,this.inListHeader=!1,this.inToolbar=!1,this.inheritedAttributes={},this.buttonType="button",this.disabled=!1,this.routerDirection="forward",this.strong=!1,this.type="button",this.handleClick=t=>{const{el:e}=this;if("button"===this.type)p(this.href,t,this.routerDirection,this.routerAnimation);else if(g(e)){let i=this.findForm();const{form:n}=this;if(!i&&void 0!==n)return void E("string"==typeof n?`Form with selector: "#${n}" could not be found. Verify that the id is correct and the form is rendered in the DOM.`:'The provided "form" element is invalid. Verify that the form is a HTMLFormElement and rendered in the DOM.',e);if(i||(i=e.closest("form")),i){t.preventDefault();const e=document.createElement("button");e.type=this.type,e.style.display="none",i.appendChild(e),e.click(),e.remove()}}},this.onFocus=()=>{this.ionFocus.emit()},this.onBlur=()=>{this.ionBlur.emit()}}componentWillLoad(){this.inToolbar=!!this.el.closest("ion-buttons"),this.inListHeader=!!this.el.closest("ion-list-header"),this.inItem=!!this.el.closest("ion-item")||!!this.el.closest("ion-item-divider"),this.inheritedAttributes=m(this.el)}get hasIconOnly(){return!!this.el.querySelector('[slot="icon-only"]')}get rippleType(){return(void 0===this.fill||"clear"===this.fill)&&this.hasIconOnly&&this.inToolbar?"unbounded":"bounded"}findForm(){const{form:t}=this;if(t instanceof HTMLFormElement)return t;if("string"==typeof t){const e=document.getElementById(t);if(e instanceof HTMLFormElement)return e}return null}render(){const t=u(this),{buttonType:n,type:r,disabled:o,rel:s,target:a,size:c,href:l,color:h,expand:d,hasIconOnly:p,shape:g,strong:m,inheritedAttributes:w}=this,b=void 0===c&&this.inItem?"small":c,y=void 0===l?"button":"a",x="button"===y?{type:r}:{download:this.download,href:l,rel:s,target:a};let k=this.fill;return null==k&&(k=this.inToolbar||this.inListHeader?"clear":"solid"),e(i,{onClick:this.handleClick,"aria-disabled":o?"true":null,class:f(h,{[t]:!0,[n]:!0,[`${n}-${d}`]:void 0!==d,[`${n}-${b}`]:void 0!==b,[`${n}-${g}`]:void 0!==g,[`${n}-${k}`]:!0,[`${n}-strong`]:m,"in-toolbar":v("ion-toolbar",this.el),"in-toolbar-color":v("ion-toolbar[color]",this.el),"button-has-icon-only":p,"button-disabled":o,"ion-activatable":!0,"ion-focusable":!0})},e(y,Object.assign({},x,{class:"button-native",part:"native",disabled:o,onFocus:this.onFocus,onBlur:this.onBlur},w),e("span",{class:"button-inner"},e("slot",{name:"icon-only"}),e("slot",{name:"start"}),e("slot",null),e("slot",{name:"end"})),"md"===t&&e("ion-ripple-effect",{type:this.rippleType})))}get el(){return n(this)}};B.style={ios:':host{--overflow:hidden;--ripple-color:currentColor;--border-width:initial;--border-color:initial;--border-style:initial;--color-activated:var(--color);--color-focused:var(--color);--color-hover:var(--color);--box-shadow:none;display:inline-block;width:auto;color:var(--color);font-family:var(--ion-font-family, inherit);text-align:center;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;user-select:none;vertical-align:top;vertical-align:-webkit-baseline-middle;font-kerning:none}:host(.button-disabled){cursor:default;opacity:0.5;pointer-events:none}:host(.button-solid){--background:var(--ion-color-primary, #3880ff);--color:var(--ion-color-primary-contrast, #fff)}:host(.button-outline){--border-color:var(--ion-color-primary, #3880ff);--background:transparent;--color:var(--ion-color-primary, #3880ff)}:host(.button-clear){--border-width:0;--background:transparent;--color:var(--ion-color-primary, #3880ff)}:host(.button-block){display:block}:host(.button-block) .button-native{margin-left:0;margin-right:0;display:block;width:100%;clear:both;contain:content}:host(.button-block) .button-native::after{clear:both}:host(.button-full){display:block}:host(.button-full) .button-native{margin-left:0;margin-right:0;display:block;width:100%;contain:content}:host(.button-full:not(.button-round)) .button-native{border-radius:0;border-right-width:0;border-left-width:0}.button-native{border-radius:var(--border-radius);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:block;position:relative;width:100%;height:100%;transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:var(--background);line-height:1;box-shadow:var(--box-shadow);contain:layout style;cursor:pointer;opacity:var(--opacity);overflow:var(--overflow);z-index:0;box-sizing:border-box;appearance:none}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.button-native{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.button-native::-moz-focus-inner{border:0}.button-inner{display:flex;position:relative;flex-flow:row nowrap;flex-shrink:0;align-items:center;justify-content:center;width:100%;height:100%;z-index:1}::slotted(ion-icon){font-size:1.4em;pointer-events:none}::slotted(ion-icon[slot=start]){margin-left:-0.3em;margin-right:0.3em;margin-top:0;margin-bottom:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon[slot=start]){margin-left:unset;margin-right:unset;-webkit-margin-start:-0.3em;margin-inline-start:-0.3em;-webkit-margin-end:0.3em;margin-inline-end:0.3em}}::slotted(ion-icon[slot=end]){margin-left:0.3em;margin-right:-0.2em;margin-top:0;margin-bottom:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon[slot=end]){margin-left:unset;margin-right:unset;-webkit-margin-start:0.3em;margin-inline-start:0.3em;-webkit-margin-end:-0.2em;margin-inline-end:-0.2em}}::slotted(ion-icon[slot=icon-only]){font-size:1.8em}ion-ripple-effect{color:var(--ripple-color)}.button-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0}:host(.ion-activated){color:var(--color-activated)}:host(.ion-activated) .button-native::after{background:var(--background-activated);opacity:var(--background-activated-opacity)}:host(.ion-focused){color:var(--color-focused)}:host(.ion-focused) .button-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}@media (any-hover: hover){:host(:hover){color:var(--color-hover)}:host(:hover) .button-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}}:host(.button-solid.ion-color) .button-native{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.button-outline.ion-color) .button-native{border-color:var(--ion-color-base);background:transparent;color:var(--ion-color-base)}:host(.button-clear.ion-color) .button-native{background:transparent;color:var(--ion-color-base)}:host(.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native{color:var(--ion-toolbar-color, var(--color))}:host(.button-outline.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native{border-color:var(--ion-toolbar-color, var(--color, var(--border-color)))}:host(.button-solid.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native{background:var(--ion-toolbar-color, var(--background));color:var(--ion-toolbar-background, var(--color))}:host{--border-radius:10px;--padding-top:0;--padding-bottom:0;--padding-start:1em;--padding-end:1em;--transition:background-color, opacity 100ms linear;margin-left:2px;margin-right:2px;margin-top:4px;margin-bottom:4px;height:2.8em;font-size:16px;font-weight:500;letter-spacing:-0.03em}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{margin-left:unset;margin-right:unset;-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:2px;margin-inline-end:2px}}:host(.button-solid){--background-activated:var(--ion-color-primary-shade, #3171e0);--background-focused:var(--ion-color-primary-shade, #3171e0);--background-hover:var(--ion-color-primary-tint, #4c8dff);--background-activated-opacity:1;--background-focused-opacity:1;--background-hover-opacity:1}:host(.button-outline){--border-radius:10px;--border-width:1px;--border-style:solid;--background-activated:var(--ion-color-primary, #3880ff);--background-focused:var(--ion-color-primary, #3880ff);--background-hover:transparent;--background-focused-opacity:.1;--color-activated:var(--ion-color-primary-contrast, #fff)}:host(.button-clear){--background-activated:transparent;--background-focused:var(--ion-color-primary, #3880ff);--background-hover:transparent;--background-focused-opacity:.1;font-size:17px;font-weight:normal;letter-spacing:0}:host(.button-large){--border-radius:12px;--padding-top:0;--padding-start:1em;--padding-end:1em;--padding-bottom:0;height:2.8em;font-size:20px}:host(.button-small){--border-radius:6px;--padding-top:0;--padding-start:0.9em;--padding-end:0.9em;--padding-bottom:0;height:2.1em;font-size:13px}:host(.button-round){--border-radius:64px;--padding-top:0;--padding-start:26px;--padding-end:26px;--padding-bottom:0}:host(.button-strong){font-weight:600}:host(.button-clear.ion-activated){opacity:0.4}:host(.button-outline.ion-activated.ion-color) .button-native{color:var(--ion-color-contrast)}:host(.button-outline.ion-activated.ion-color) .button-native::after{background:var(--ion-color-base)}:host(.button-solid.ion-color.ion-activated) .button-native::after{background:var(--ion-color-shade)}:host(.button-outline.ion-focused.ion-color) .button-native,:host(.button-clear.ion-focused.ion-color) .button-native{color:var(--ion-color-base)}:host(.button-outline.ion-focused.ion-color) .button-native::after,:host(.button-clear.ion-focused.ion-color) .button-native::after{background:var(--ion-color-base)}:host(.button-solid.ion-color.ion-focused) .button-native::after{background:var(--ion-color-shade)}@media (any-hover: hover){:host(.button-clear:hover),:host(.button-outline:hover){opacity:0.6}:host(.button-clear.ion-color:hover) .button-native,:host(.button-outline.ion-color:hover) .button-native{color:var(--ion-color-base)}:host(.button-clear.ion-color:hover) .button-native::after,:host(.button-outline.ion-color:hover) .button-native::after{background:transparent}:host(.button-solid.ion-color:hover) .button-native::after{background:var(--ion-color-tint)}:host(:hover.button-solid.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native::after{background:#fff;opacity:0.1}}',md:':host{--overflow:hidden;--ripple-color:currentColor;--border-width:initial;--border-color:initial;--border-style:initial;--color-activated:var(--color);--color-focused:var(--color);--color-hover:var(--color);--box-shadow:none;display:inline-block;width:auto;color:var(--color);font-family:var(--ion-font-family, inherit);text-align:center;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;user-select:none;vertical-align:top;vertical-align:-webkit-baseline-middle;font-kerning:none}:host(.button-disabled){cursor:default;opacity:0.5;pointer-events:none}:host(.button-solid){--background:var(--ion-color-primary, #3880ff);--color:var(--ion-color-primary-contrast, #fff)}:host(.button-outline){--border-color:var(--ion-color-primary, #3880ff);--background:transparent;--color:var(--ion-color-primary, #3880ff)}:host(.button-clear){--border-width:0;--background:transparent;--color:var(--ion-color-primary, #3880ff)}:host(.button-block){display:block}:host(.button-block) .button-native{margin-left:0;margin-right:0;display:block;width:100%;clear:both;contain:content}:host(.button-block) .button-native::after{clear:both}:host(.button-full){display:block}:host(.button-full) .button-native{margin-left:0;margin-right:0;display:block;width:100%;contain:content}:host(.button-full:not(.button-round)) .button-native{border-radius:0;border-right-width:0;border-left-width:0}.button-native{border-radius:var(--border-radius);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:block;position:relative;width:100%;height:100%;transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:var(--background);line-height:1;box-shadow:var(--box-shadow);contain:layout style;cursor:pointer;opacity:var(--opacity);overflow:var(--overflow);z-index:0;box-sizing:border-box;appearance:none}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.button-native{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.button-native::-moz-focus-inner{border:0}.button-inner{display:flex;position:relative;flex-flow:row nowrap;flex-shrink:0;align-items:center;justify-content:center;width:100%;height:100%;z-index:1}::slotted(ion-icon){font-size:1.4em;pointer-events:none}::slotted(ion-icon[slot=start]){margin-left:-0.3em;margin-right:0.3em;margin-top:0;margin-bottom:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon[slot=start]){margin-left:unset;margin-right:unset;-webkit-margin-start:-0.3em;margin-inline-start:-0.3em;-webkit-margin-end:0.3em;margin-inline-end:0.3em}}::slotted(ion-icon[slot=end]){margin-left:0.3em;margin-right:-0.2em;margin-top:0;margin-bottom:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon[slot=end]){margin-left:unset;margin-right:unset;-webkit-margin-start:0.3em;margin-inline-start:0.3em;-webkit-margin-end:-0.2em;margin-inline-end:-0.2em}}::slotted(ion-icon[slot=icon-only]){font-size:1.8em}ion-ripple-effect{color:var(--ripple-color)}.button-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0}:host(.ion-activated){color:var(--color-activated)}:host(.ion-activated) .button-native::after{background:var(--background-activated);opacity:var(--background-activated-opacity)}:host(.ion-focused){color:var(--color-focused)}:host(.ion-focused) .button-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}@media (any-hover: hover){:host(:hover){color:var(--color-hover)}:host(:hover) .button-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}}:host(.button-solid.ion-color) .button-native{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.button-outline.ion-color) .button-native{border-color:var(--ion-color-base);background:transparent;color:var(--ion-color-base)}:host(.button-clear.ion-color) .button-native{background:transparent;color:var(--ion-color-base)}:host(.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native{color:var(--ion-toolbar-color, var(--color))}:host(.button-outline.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native{border-color:var(--ion-toolbar-color, var(--color, var(--border-color)))}:host(.button-solid.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native{background:var(--ion-toolbar-color, var(--background));color:var(--ion-toolbar-background, var(--color))}:host{--border-radius:4px;--padding-top:0;--padding-bottom:0;--padding-start:1.1em;--padding-end:1.1em;--transition:box-shadow 280ms cubic-bezier(.4, 0, .2, 1),\n background-color 15ms linear,\n color 15ms linear;margin-left:2px;margin-right:2px;margin-top:4px;margin-bottom:4px;height:36px;font-size:14px;font-weight:500;letter-spacing:0.06em;text-transform:uppercase}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{margin-left:unset;margin-right:unset;-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:2px;margin-inline-end:2px}}:host(.button-solid){--background-activated:transparent;--background-hover:var(--ion-color-primary-contrast, #fff);--background-focused:var(--ion-color-primary-contrast, #fff);--background-activated-opacity:0;--background-focused-opacity:.24;--background-hover-opacity:.08;--box-shadow:0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12)}:host(.button-solid.ion-activated){--box-shadow:0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12)}:host(.button-outline){--border-width:2px;--border-style:solid;--box-shadow:none;--background-activated:transparent;--background-focused:var(--ion-color-primary, #3880ff);--background-hover:var(--ion-color-primary, #3880ff);--background-activated-opacity:0;--background-focused-opacity:.12;--background-hover-opacity:.04}:host(.button-outline.ion-activated.ion-color) .button-native{background:transparent}:host(.button-clear){--background-activated:transparent;--background-focused:var(--ion-color-primary, #3880ff);--background-hover:var(--ion-color-primary, #3880ff);--background-activated-opacity:0;--background-focused-opacity:.12;--background-hover-opacity:.04}:host(.button-round){--border-radius:64px;--padding-top:0;--padding-start:26px;--padding-end:26px;--padding-bottom:0}:host(.button-large){--padding-top:0;--padding-start:1em;--padding-end:1em;--padding-bottom:0;height:2.8em;font-size:20px}:host(.button-small){--padding-top:0;--padding-start:0.9em;--padding-end:0.9em;--padding-bottom:0;height:2.1em;font-size:13px}:host(.button-strong){font-weight:bold}::slotted(ion-icon[slot=icon-only]){padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}:host(.button-solid.ion-color.ion-focused) .button-native::after{background:var(--ion-color-contrast)}:host(.button-clear.ion-color.ion-focused) .button-native::after,:host(.button-outline.ion-color.ion-focused) .button-native::after{background:var(--ion-color-base)}@media (any-hover: hover){:host(.button-solid.ion-color:hover) .button-native::after{background:var(--ion-color-contrast)}:host(.button-clear.ion-color:hover) .button-native::after,:host(.button-outline.ion-color:hover) .button-native::after{background:var(--ion-color-base)}}'};const J=class{constructor(e){t(this,e),this.inheritedAriaAttributes={},this.button=!1,this.type="button",this.disabled=!1,this.routerDirection="forward"}componentWillLoad(){this.inheritedAriaAttributes=w(this.el,["aria-label"])}isClickable(){return void 0!==this.href||this.button}renderCard(t){const i=this.isClickable();if(!i)return[e("slot",null)];const{href:n,routerAnimation:r,routerDirection:o,inheritedAriaAttributes:s}=this,a=i?void 0===n?"button":"a":"div";return e(a,Object.assign({},"button"===a?{type:this.type}:{download:this.download,href:this.href,rel:this.rel,target:this.target},s,{class:"card-native",part:"native",disabled:this.disabled,onClick:t=>p(n,t,o,r)}),e("slot",null),i&&"md"===t&&e("ion-ripple-effect",null))}render(){const t=u(this);return e(i,{class:f(this.color,{[t]:!0,"card-disabled":this.disabled,"ion-activatable":this.isClickable()})},this.renderCard(t))}get el(){return n(this)}};J.style={ios:":host{--ion-safe-area-left:0px;--ion-safe-area-right:0px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:block;position:relative;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);overflow:hidden}:host(.ion-color){background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.card-disabled){cursor:default;opacity:0.3;pointer-events:none}.card-native{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;width:100%;min-height:var(--min-height);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:inherit}.card-native::-moz-focus-inner{border:0}button,a{cursor:pointer;user-select:none;-webkit-user-drag:none}ion-ripple-effect{color:var(--ripple-color)}:host{--background:var(--ion-card-background, var(--ion-item-background, var(--ion-background-color, #fff)));--color:var(--ion-card-color, var(--ion-item-color, var(--ion-color-step-600, #666666)));margin-left:16px;margin-right:16px;margin-top:24px;margin-bottom:24px;border-radius:8px;transition:transform 500ms cubic-bezier(0.12, 0.72, 0.29, 1);font-size:14px;box-shadow:0 4px 16px rgba(0, 0, 0, 0.12)}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{margin-left:unset;margin-right:unset;-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:16px;margin-inline-end:16px}}:host(.ion-activated){transform:scale3d(0.97, 0.97, 1)}",md:":host{--ion-safe-area-left:0px;--ion-safe-area-right:0px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:block;position:relative;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);overflow:hidden}:host(.ion-color){background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.card-disabled){cursor:default;opacity:0.3;pointer-events:none}.card-native{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;width:100%;min-height:var(--min-height);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:inherit}.card-native::-moz-focus-inner{border:0}button,a{cursor:pointer;user-select:none;-webkit-user-drag:none}ion-ripple-effect{color:var(--ripple-color)}:host{--background:var(--ion-card-background, var(--ion-item-background, var(--ion-background-color, #fff)));--color:var(--ion-card-color, var(--ion-item-color, var(--ion-color-step-550, #737373)));margin-left:10px;margin-right:10px;margin-top:10px;margin-bottom:10px;border-radius:4px;font-size:14px;box-shadow:0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12)}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{margin-left:unset;margin-right:unset;-webkit-margin-start:10px;margin-inline-start:10px;-webkit-margin-end:10px;margin-inline-end:10px}}"};const $=class{constructor(e){t(this,e)}render(){const t=u(this);return e(i,{class:{[t]:!0,[`card-content-${t}`]:!0}})}};$.style={ios:"ion-card-content{display:block;position:relative}.card-content-ios{padding-left:20px;padding-right:20px;padding-top:20px;padding-bottom:20px;font-size:16px;line-height:1.4}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.card-content-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:20px;padding-inline-end:20px}}.card-content-ios h1{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:24px;font-weight:normal}.card-content-ios h2{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:16px;font-weight:normal}.card-content-ios h3,.card-content-ios h4,.card-content-ios h5,.card-content-ios h6{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:14px;font-weight:normal}.card-content-ios p{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:14px}ion-card-header+.card-content-ios{padding-top:0}",md:"ion-card-content{display:block;position:relative}.card-content-md{padding-left:16px;padding-right:16px;padding-top:13px;padding-bottom:13px;font-size:14px;line-height:1.5}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.card-content-md{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}.card-content-md h1{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:24px;font-weight:normal}.card-content-md h2{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:16px;font-weight:normal}.card-content-md h3,.card-content-md h4,.card-content-md h5,.card-content-md h6{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:14px;font-weight:normal}.card-content-md p{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:14px;font-weight:normal;line-height:1.5}ion-card-header+.card-content-md{padding-top:0}"};const z=class{constructor(e){t(this,e),this.translucent=!1}render(){const t=u(this);return e(i,{class:f(this.color,{"card-header-translucent":this.translucent,"ion-inherit-color":!0,[t]:!0})},e("slot",null))}};z.style={ios:":host{--background:transparent;--color:inherit;display:block;position:relative;background:var(--background);color:var(--color)}:host(.ion-color){background:var(--ion-color-base);color:var(--ion-color-contrast)}:host{padding-left:20px;padding-right:20px;padding-top:20px;padding-bottom:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:20px;padding-inline-end:20px}}@supports (backdrop-filter: blur(0)){:host(.card-header-translucent){background-color:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.9);backdrop-filter:saturate(180%) blur(30px)}}",md:":host{--background:transparent;--color:inherit;display:block;position:relative;background:var(--background);color:var(--color)}:host(.ion-color){background:var(--ion-color-base);color:var(--ion-color-contrast)}:host{padding-left:16px;padding-right:16px;padding-top:16px;padding-bottom:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}::slotted(ion-card-title:not(:first-child)),::slotted(ion-card-subtitle:not(:first-child)){margin-top:8px}"};const H=class{constructor(e){t(this,e)}render(){const t=u(this);return e(i,{role:"heading","aria-level":"2",class:f(this.color,{"ion-inherit-color":!0,[t]:!0})},e("slot",null))}};H.style={ios:":host{display:block;position:relative;color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}:host{--color:var(--ion-text-color, #000);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;font-size:28px;font-weight:700;line-height:1.2}",md:":host{display:block;position:relative;color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}:host{--color:var(--ion-color-step-850, #262626);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;font-size:20px;font-weight:500;line-height:1.2}"};
|
|
2
|
-
/*!
|
|
3
|
-
* (C) Ionic http://ionicframework.com - MIT License
|
|
4
|
-
*/
|
|
5
|
-
const K={xs:"(min-width: 0px)",sm:"(min-width: 576px)",md:"(min-width: 768px)",lg:"(min-width: 992px)",xl:"(min-width: 1200px)"},W=t=>void 0===t||""===t||!!window.matchMedia&&window.matchMedia(K[t]).matches,q="undefined"!=typeof window?window:void 0,V=q&&!!(q.CSS&&q.CSS.supports&&q.CSS.supports("--a: 0")),G=["","xs","sm","md","lg","xl"],X=class{constructor(e){t(this,e)}onResize(){o(this)}getColumns(t){let e;for(const i of G){const n=W(i),r=this[t+i.charAt(0).toUpperCase()+i.slice(1)];n&&void 0!==r&&(e=r)}return e}calculateSize(){const t=this.getColumns("size");if(!t||""===t)return;const e="auto"===t?"auto":V?`calc(calc(${t} / var(--ion-grid-columns, 12)) * 100%)`:t/12*100+"%";return{flex:`0 0 ${e}`,width:`${e}`,"max-width":`${e}`}}calculatePosition(t,e){const i=this.getColumns(t);if(i)return{[e]:V?`calc(calc(${i} / var(--ion-grid-columns, 12)) * 100%)`:i>0&&i<12?i/12*100+"%":"auto"}}calculateOffset(t){return this.calculatePosition("offset",t?"margin-right":"margin-left")}calculatePull(t){return this.calculatePosition("pull",t?"left":"right")}calculatePush(t){return this.calculatePosition("push",t?"right":"left")}render(){const t="rtl"===document.dir,n=u(this);return e(i,{class:{[n]:!0},style:Object.assign(Object.assign(Object.assign(Object.assign({},this.calculateOffset(t)),this.calculatePull(t)),this.calculatePush(t)),this.calculateSize())},e("slot",null))}};X.style=":host{padding-left:var(--ion-grid-column-padding-xs, var(--ion-grid-column-padding, 5px));padding-right:var(--ion-grid-column-padding-xs, var(--ion-grid-column-padding, 5px));padding-top:var(--ion-grid-column-padding-xs, var(--ion-grid-column-padding, 5px));padding-bottom:var(--ion-grid-column-padding-xs, var(--ion-grid-column-padding, 5px));margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;box-sizing:border-box;position:relative;flex-basis:0;flex-grow:1;width:100%;max-width:100%;min-height:1px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-column-padding-xs, var(--ion-grid-column-padding, 5px));padding-inline-start:var(--ion-grid-column-padding-xs, var(--ion-grid-column-padding, 5px));-webkit-padding-end:var(--ion-grid-column-padding-xs, var(--ion-grid-column-padding, 5px));padding-inline-end:var(--ion-grid-column-padding-xs, var(--ion-grid-column-padding, 5px))}}@media (min-width: 576px){:host{padding-left:var(--ion-grid-column-padding-sm, var(--ion-grid-column-padding, 5px));padding-right:var(--ion-grid-column-padding-sm, var(--ion-grid-column-padding, 5px));padding-top:var(--ion-grid-column-padding-sm, var(--ion-grid-column-padding, 5px));padding-bottom:var(--ion-grid-column-padding-sm, var(--ion-grid-column-padding, 5px))}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-column-padding-sm, var(--ion-grid-column-padding, 5px));padding-inline-start:var(--ion-grid-column-padding-sm, var(--ion-grid-column-padding, 5px));-webkit-padding-end:var(--ion-grid-column-padding-sm, var(--ion-grid-column-padding, 5px));padding-inline-end:var(--ion-grid-column-padding-sm, var(--ion-grid-column-padding, 5px))}}}@media (min-width: 768px){:host{padding-left:var(--ion-grid-column-padding-md, var(--ion-grid-column-padding, 5px));padding-right:var(--ion-grid-column-padding-md, var(--ion-grid-column-padding, 5px));padding-top:var(--ion-grid-column-padding-md, var(--ion-grid-column-padding, 5px));padding-bottom:var(--ion-grid-column-padding-md, var(--ion-grid-column-padding, 5px))}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-column-padding-md, var(--ion-grid-column-padding, 5px));padding-inline-start:var(--ion-grid-column-padding-md, var(--ion-grid-column-padding, 5px));-webkit-padding-end:var(--ion-grid-column-padding-md, var(--ion-grid-column-padding, 5px));padding-inline-end:var(--ion-grid-column-padding-md, var(--ion-grid-column-padding, 5px))}}}@media (min-width: 992px){:host{padding-left:var(--ion-grid-column-padding-lg, var(--ion-grid-column-padding, 5px));padding-right:var(--ion-grid-column-padding-lg, var(--ion-grid-column-padding, 5px));padding-top:var(--ion-grid-column-padding-lg, var(--ion-grid-column-padding, 5px));padding-bottom:var(--ion-grid-column-padding-lg, var(--ion-grid-column-padding, 5px))}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-column-padding-lg, var(--ion-grid-column-padding, 5px));padding-inline-start:var(--ion-grid-column-padding-lg, var(--ion-grid-column-padding, 5px));-webkit-padding-end:var(--ion-grid-column-padding-lg, var(--ion-grid-column-padding, 5px));padding-inline-end:var(--ion-grid-column-padding-lg, var(--ion-grid-column-padding, 5px))}}}@media (min-width: 1200px){:host{padding-left:var(--ion-grid-column-padding-xl, var(--ion-grid-column-padding, 5px));padding-right:var(--ion-grid-column-padding-xl, var(--ion-grid-column-padding, 5px));padding-top:var(--ion-grid-column-padding-xl, var(--ion-grid-column-padding, 5px));padding-bottom:var(--ion-grid-column-padding-xl, var(--ion-grid-column-padding, 5px))}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-column-padding-xl, var(--ion-grid-column-padding, 5px));padding-inline-start:var(--ion-grid-column-padding-xl, var(--ion-grid-column-padding, 5px));-webkit-padding-end:var(--ion-grid-column-padding-xl, var(--ion-grid-column-padding, 5px));padding-inline-end:var(--ion-grid-column-padding-xl, var(--ion-grid-column-padding, 5px))}}}";const Y=class{constructor(e){t(this,e),this.ionScrollStart=r(this,"ionScrollStart",7),this.ionScroll=r(this,"ionScroll",7),this.ionScrollEnd=r(this,"ionScrollEnd",7),this.isScrolling=!1,this.lastScroll=0,this.queued=!1,this.cTop=-1,this.cBottom=-1,this.isMainContent=!0,this.detail={scrollTop:0,scrollLeft:0,type:"scroll",event:void 0,startX:0,startY:0,startTime:0,currentX:0,currentY:0,velocityX:0,velocityY:0,deltaX:0,deltaY:0,currentTime:0,data:void 0,isScrolling:!0},this.fullscreen=!1,this.scrollX=!1,this.scrollY=!0,this.scrollEvents=!1}connectedCallback(){this.isMainContent=null===this.el.closest("ion-menu, ion-popover, ion-modal")}disconnectedCallback(){this.onScrollEnd()}onAppLoad(){this.resize()}shouldForceOverscroll(){const{forceOverscroll:t}=this,e=u(this);return void 0===t?"ios"===e&&d("ios"):t}resize(){this.fullscreen?s((()=>this.readDimensions())):0===this.cTop&&0===this.cBottom||(this.cTop=this.cBottom=0,o(this))}readDimensions(){const t=Z(this.el),e=Math.max(this.el.offsetTop,0),i=Math.max(t.offsetHeight-e-this.el.offsetHeight,0);(e!==this.cTop||i!==this.cBottom)&&(this.cTop=e,this.cBottom=i,o(this))}onScroll(t){const e=Date.now(),i=!this.isScrolling;this.lastScroll=e,i&&this.onScrollStart(),!this.queued&&this.scrollEvents&&(this.queued=!0,s((e=>{this.queued=!1,this.detail.event=t,Q(this.detail,this.scrollEl,e,i),this.ionScroll.emit(this.detail)})))}async getScrollElement(){return this.scrollEl||await new Promise((t=>b(this.el,t))),Promise.resolve(this.scrollEl)}async getBackgroundElement(){return this.backgroundContentEl||await new Promise((t=>b(this.el,t))),Promise.resolve(this.backgroundContentEl)}scrollToTop(t=0){return this.scrollToPoint(void 0,0,t)}async scrollToBottom(t=0){const e=await this.getScrollElement();return this.scrollToPoint(void 0,e.scrollHeight-e.clientHeight,t)}async scrollByPoint(t,e,i){const n=await this.getScrollElement();return this.scrollToPoint(t+n.scrollLeft,e+n.scrollTop,i)}async scrollToPoint(t,e,i=0){const n=await this.getScrollElement();if(i<32)return null!=e&&(n.scrollTop=e),void(null!=t&&(n.scrollLeft=t));let r,o=0;const s=new Promise((t=>r=t)),a=n.scrollTop,c=n.scrollLeft,l=null!=e?e-a:0,u=null!=t?t-c:0,h=t=>{const e=Math.min(1,(t-o)/i)-1,s=Math.pow(e,3)+1;0!==l&&(n.scrollTop=Math.floor(s*l+a)),0!==u&&(n.scrollLeft=Math.floor(s*u+c)),s<1?requestAnimationFrame(h):r()};return requestAnimationFrame((t=>{o=t,h(t)})),s}onScrollStart(){this.isScrolling=!0,this.ionScrollStart.emit({isScrolling:!0}),this.watchDog&&clearInterval(this.watchDog),this.watchDog=setInterval((()=>{this.lastScroll<Date.now()-120&&this.onScrollEnd()}),100)}onScrollEnd(){clearInterval(this.watchDog),this.watchDog=null,this.isScrolling&&(this.isScrolling=!1,this.ionScrollEnd.emit({isScrolling:!1}))}render(){const{isMainContent:t,scrollX:n,scrollY:r,el:o}=this,s=F(o)?"rtl":"ltr",a=u(this),c=this.shouldForceOverscroll(),l="ios"===a,h=t?"main":"div";return this.resize(),e(i,{class:f(this.color,{[a]:!0,"content-sizing":v("ion-popover",this.el),overscroll:c,[`content-${s}`]:!0}),style:{"--offset-top":`${this.cTop}px`,"--offset-bottom":`${this.cBottom}px`}},e("div",{ref:t=>this.backgroundContentEl=t,id:"background-content",part:"background"}),e(h,{class:{"inner-scroll":!0,"scroll-x":n,"scroll-y":r,overscroll:(n||r)&&c},ref:t=>this.scrollEl=t,onScroll:this.scrollEvents?t=>this.onScroll(t):void 0,part:"scroll"},e("slot",null)),l?e("div",{class:"transition-effect"},e("div",{class:"transition-cover"}),e("div",{class:"transition-shadow"})):null,e("slot",{name:"fixed"}))}get el(){return n(this)}},Z=t=>{const e=t.closest("ion-tabs");if(e)return e;return t.closest("ion-app, ion-page, .ion-page, page-inner, .popover-content")||(t=>{var e;return t.parentElement?t.parentElement:(null===(e=t.parentNode)||void 0===e?void 0:e.host)?t.parentNode.host:null})(t)},Q=(t,e,i,n)=>{const r=t.currentX,o=t.currentY,s=e.scrollLeft,a=e.scrollTop,c=i-t.currentTime;if(n&&(t.startTime=i,t.startX=s,t.startY=a,t.velocityX=t.velocityY=0),t.currentTime=i,t.currentX=t.scrollLeft=s,t.currentY=t.scrollTop=a,t.deltaX=s-t.startX,t.deltaY=a-t.startY,c>0&&c<100){const e=(a-o)/c;t.velocityX=(s-r)/c*.7+.3*t.velocityX,t.velocityY=.7*e+.3*t.velocityY}};Y.style=':host{--background:var(--ion-background-color, #fff);--color:var(--ion-text-color, #000);--padding-top:0px;--padding-bottom:0px;--padding-start:0px;--padding-end:0px;--keyboard-offset:0px;--offset-top:0px;--offset-bottom:0px;--overflow:auto;display:block;position:relative;flex:1;width:100%;height:100%;margin:0 !important;padding:0 !important;font-family:var(--ion-font-family, inherit);contain:size style}:host(.ion-color) .inner-scroll{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.outer-content){--background:var(--ion-color-step-50, #f2f2f2)}#background-content{left:0px;right:0px;top:calc(var(--offset-top) * -1);bottom:calc(var(--offset-bottom) * -1);position:absolute;background:var(--background)}.inner-scroll{left:0px;right:0px;top:calc(var(--offset-top) * -1);bottom:calc(var(--offset-bottom) * -1);padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:calc(var(--padding-top) + var(--offset-top));padding-bottom:calc(var(--padding-bottom) + var(--keyboard-offset) + var(--offset-bottom));position:absolute;color:var(--color);box-sizing:border-box;overflow:hidden;touch-action:pan-x pan-y pinch-zoom}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.inner-scroll{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.scroll-y,.scroll-x{-webkit-overflow-scrolling:touch;z-index:0;will-change:scroll-position}.scroll-y{overflow-y:var(--overflow);overscroll-behavior-y:contain}.scroll-x{overflow-x:var(--overflow);overscroll-behavior-x:contain}.overscroll::before,.overscroll::after{position:absolute;width:1px;height:1px;content:""}.overscroll::before{bottom:-1px}.overscroll::after{top:-1px}:host(.content-sizing){display:flex;flex-direction:column;min-height:0;contain:none}:host(.content-sizing) .inner-scroll{position:relative;top:0;bottom:0;margin-top:calc(var(--offset-top) * -1);margin-bottom:calc(var(--offset-bottom) * -1)}.transition-effect{display:none;position:absolute;width:100%;height:100vh;opacity:0;pointer-events:none}:host(.content-ltr) .transition-effect{left:-100%;}:host(.content-rtl) .transition-effect{right:-100%;}.transition-cover{position:absolute;right:0;width:100%;height:100%;background:black;opacity:0.1}.transition-shadow{display:block;position:absolute;width:10px;height:100%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAgCAYAAAAIXrg4AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MTE3MDgzRkQ5QTkyMTFFOUEwNzQ5MkJFREE1NUY2MjQiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MTE3MDgzRkU5QTkyMTFFOUEwNzQ5MkJFREE1NUY2MjQiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDoxMTcwODNGQjlBOTIxMUU5QTA3NDkyQkVEQTU1RjYyNCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDoxMTcwODNGQzlBOTIxMUU5QTA3NDkyQkVEQTU1RjYyNCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PmePEuQAAABNSURBVHjaYvz//z8DIxAwMDAwATGMhmFmPDQuOSZks0AMmoJBaQHjkPfB0Lfg/2gQjVow+HPy/yHvg9GiYjQfjMbBqAWjFgy/4hogwADYqwdzxy5BuwAAAABJRU5ErkJggg==);background-repeat:repeat-y;background-size:10px 16px}:host(.content-ltr) .transition-shadow{right:0;}:host(.content-rtl) .transition-shadow{left:0;transform:scaleX(-1)}::slotted([slot=fixed]){position:absolute;transform:translateZ(0)}';
|
|
6
|
-
/*!
|
|
7
|
-
* (C) Ionic http://ionicframework.com - MIT License
|
|
8
|
-
*/
|
|
9
|
-
const tt=(t,e)=>{s((()=>{const i=y(0,1-(t.scrollTop-(t.scrollHeight-t.clientHeight-10))/10,1);a((()=>{e.style.setProperty("--opacity-scale",i.toString())}))}))},et=class{constructor(e){t(this,e),this.keyboardCtrl=null,this.keyboardVisible=!1,this.translucent=!1,this.checkCollapsibleFooter=()=>{if("ios"!==u(this))return;const{collapse:t}=this,e="fade"===t;if(this.destroyCollapsibleFooter(),e){const t=this.el.closest("ion-app,ion-page,.ion-page,page-inner"),e=t?A(t):null;if(!e)return void _(this.el);this.setupFadeFooter(e)}},this.setupFadeFooter=async t=>{const e=this.scrollEl=await j(t);this.contentScrollCallback=()=>{tt(e,this.el)},e.addEventListener("scroll",this.contentScrollCallback),tt(e,this.el)}}componentDidLoad(){this.checkCollapsibleFooter()}componentDidUpdate(){this.checkCollapsibleFooter()}connectedCallback(){this.keyboardCtrl=C((t=>{this.keyboardVisible=t}))}disconnectedCallback(){this.keyboardCtrl&&this.keyboardCtrl.destroy()}destroyCollapsibleFooter(){this.scrollEl&&this.contentScrollCallback&&(this.scrollEl.removeEventListener("scroll",this.contentScrollCallback),this.contentScrollCallback=void 0)}render(){const{translucent:t,collapse:n}=this,r=u(this),o=this.el.closest("ion-tabs"),s=null==o?void 0:o.querySelector(":scope > ion-tab-bar");return e(i,{role:"contentinfo",class:{[r]:!0,[`footer-${r}`]:!0,"footer-translucent":t,[`footer-translucent-${r}`]:t,"footer-toolbar-padding":!(this.keyboardVisible||s&&"bottom"===s.slot),[`footer-collapse-${n}`]:void 0!==n}},"ios"===r&&t&&e("div",{class:"footer-background"}),e("slot",null))}get el(){return n(this)}};et.style={ios:"ion-footer{display:block;position:relative;order:1;width:100%;z-index:10}ion-footer.footer-toolbar-padding ion-toolbar:last-of-type{padding-bottom:var(--ion-safe-area-bottom, 0)}.footer-ios ion-toolbar:first-of-type{--border-width:0.55px 0 0}@supports (backdrop-filter: blur(0)){.footer-background{left:0;right:0;top:0;bottom:0;position:absolute;backdrop-filter:saturate(180%) blur(20px)}.footer-translucent-ios ion-toolbar{--opacity:.8}}.footer-ios.ion-no-border ion-toolbar:first-of-type{--border-width:0}.footer-collapse-fade ion-toolbar{--opacity-scale:inherit}",md:'ion-footer{display:block;position:relative;order:1;width:100%;z-index:10}ion-footer.footer-toolbar-padding ion-toolbar:last-of-type{padding-bottom:var(--ion-safe-area-bottom, 0)}.footer-md::before{left:0;top:-2px;bottom:auto;background-position:left 0 top 0;position:absolute;width:100%;height:2px;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAHBAMAAADzDtBxAAAAD1BMVEUAAAAAAAAAAAAAAAAAAABPDueNAAAABXRSTlMUCS0gBIh/TXEAAAAaSURBVAjXYxCEAgY4UIICBmMogMsgFLtAAQCNSwXZKOdPxgAAAABJRU5ErkJggg==");background-repeat:repeat-x;content:""}[dir=rtl] .footer-md::before,:host-context([dir=rtl]) .footer-md::before{left:unset;right:unset;right:0}[dir=rtl] .footer-md::before,:host-context([dir=rtl]) .footer-md::before{background-position:right 0 top 0}.footer-md.ion-no-border::before{display:none}'};const it=class{constructor(e){t(this,e),this.fixed=!1}render(){const t=u(this);return e(i,{class:{[t]:!0,"grid-fixed":this.fixed}},e("slot",null))}};it.style=":host{padding-left:var(--ion-grid-padding-xs, var(--ion-grid-padding, 5px));padding-right:var(--ion-grid-padding-xs, var(--ion-grid-padding, 5px));padding-top:var(--ion-grid-padding-xs, var(--ion-grid-padding, 5px));padding-bottom:var(--ion-grid-padding-xs, var(--ion-grid-padding, 5px));margin-left:auto;margin-right:auto;display:block;flex:1}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-padding-xs, var(--ion-grid-padding, 5px));padding-inline-start:var(--ion-grid-padding-xs, var(--ion-grid-padding, 5px));-webkit-padding-end:var(--ion-grid-padding-xs, var(--ion-grid-padding, 5px));padding-inline-end:var(--ion-grid-padding-xs, var(--ion-grid-padding, 5px))}}@media (min-width: 576px){:host{padding-left:var(--ion-grid-padding-sm, var(--ion-grid-padding, 5px));padding-right:var(--ion-grid-padding-sm, var(--ion-grid-padding, 5px));padding-top:var(--ion-grid-padding-sm, var(--ion-grid-padding, 5px));padding-bottom:var(--ion-grid-padding-sm, var(--ion-grid-padding, 5px))}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-padding-sm, var(--ion-grid-padding, 5px));padding-inline-start:var(--ion-grid-padding-sm, var(--ion-grid-padding, 5px));-webkit-padding-end:var(--ion-grid-padding-sm, var(--ion-grid-padding, 5px));padding-inline-end:var(--ion-grid-padding-sm, var(--ion-grid-padding, 5px))}}}@media (min-width: 768px){:host{padding-left:var(--ion-grid-padding-md, var(--ion-grid-padding, 5px));padding-right:var(--ion-grid-padding-md, var(--ion-grid-padding, 5px));padding-top:var(--ion-grid-padding-md, var(--ion-grid-padding, 5px));padding-bottom:var(--ion-grid-padding-md, var(--ion-grid-padding, 5px))}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-padding-md, var(--ion-grid-padding, 5px));padding-inline-start:var(--ion-grid-padding-md, var(--ion-grid-padding, 5px));-webkit-padding-end:var(--ion-grid-padding-md, var(--ion-grid-padding, 5px));padding-inline-end:var(--ion-grid-padding-md, var(--ion-grid-padding, 5px))}}}@media (min-width: 992px){:host{padding-left:var(--ion-grid-padding-lg, var(--ion-grid-padding, 5px));padding-right:var(--ion-grid-padding-lg, var(--ion-grid-padding, 5px));padding-top:var(--ion-grid-padding-lg, var(--ion-grid-padding, 5px));padding-bottom:var(--ion-grid-padding-lg, var(--ion-grid-padding, 5px))}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-padding-lg, var(--ion-grid-padding, 5px));padding-inline-start:var(--ion-grid-padding-lg, var(--ion-grid-padding, 5px));-webkit-padding-end:var(--ion-grid-padding-lg, var(--ion-grid-padding, 5px));padding-inline-end:var(--ion-grid-padding-lg, var(--ion-grid-padding, 5px))}}}@media (min-width: 1200px){:host{padding-left:var(--ion-grid-padding-xl, var(--ion-grid-padding, 5px));padding-right:var(--ion-grid-padding-xl, var(--ion-grid-padding, 5px));padding-top:var(--ion-grid-padding-xl, var(--ion-grid-padding, 5px));padding-bottom:var(--ion-grid-padding-xl, var(--ion-grid-padding, 5px))}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-padding-xl, var(--ion-grid-padding, 5px));padding-inline-start:var(--ion-grid-padding-xl, var(--ion-grid-padding, 5px));-webkit-padding-end:var(--ion-grid-padding-xl, var(--ion-grid-padding, 5px));padding-inline-end:var(--ion-grid-padding-xl, var(--ion-grid-padding, 5px))}}}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}:host(.grid-fixed){width:var(--ion-grid-width-xs, var(--ion-grid-width, 100%));max-width:100%}@media (min-width: 576px){:host(.grid-fixed){width:var(--ion-grid-width-sm, var(--ion-grid-width, 540px))}}@media (min-width: 768px){:host(.grid-fixed){width:var(--ion-grid-width-md, var(--ion-grid-width, 720px))}}@media (min-width: 992px){:host(.grid-fixed){width:var(--ion-grid-width-lg, var(--ion-grid-width, 960px))}}@media (min-width: 1200px){:host(.grid-fixed){width:var(--ion-grid-width-xl, var(--ion-grid-width, 1140px))}}:host(.ion-no-padding){--ion-grid-column-padding:0;--ion-grid-column-padding-xs:0;--ion-grid-column-padding-sm:0;--ion-grid-column-padding-md:0;--ion-grid-column-padding-lg:0;--ion-grid-column-padding-xl:0}";
|
|
10
|
-
/*!
|
|
11
|
-
* (C) Ionic http://ionicframework.com - MIT License
|
|
12
|
-
*/
|
|
13
|
-
const nt=t=>{const e=document.querySelector(`${t}.ion-cloned-element`);if(null!==e)return e;const i=document.createElement(t);return i.classList.add("ion-cloned-element"),i.style.setProperty("display","none"),document.body.appendChild(i),i},rt=t=>{if(!t)return;const e=t.querySelectorAll("ion-toolbar");return{el:t,toolbars:Array.from(e).map((t=>{const e=t.querySelector("ion-title");return{el:t,background:t.shadowRoot.querySelector(".toolbar-background"),ionTitleEl:e,innerTitleEl:e?e.shadowRoot.querySelector(".toolbar-title"):null,ionButtonsEl:Array.from(t.querySelectorAll("ion-buttons"))}}))}},ot=(t,e)=>{"fade"!==t.collapse&&(void 0===e?t.style.removeProperty("--opacity-scale"):t.style.setProperty("--opacity-scale",e.toString()))},st=(t,e=!0)=>{const i=t.el;e?(i.classList.remove("header-collapse-condense-inactive"),i.removeAttribute("aria-hidden")):(i.classList.add("header-collapse-condense-inactive"),i.setAttribute("aria-hidden","true"))},at=(t,e,i)=>{s((()=>{const n=t.scrollTop,r=e.clientHeight,o=i?i.clientHeight:0;if(null!==i&&n<o)return e.style.setProperty("--opacity-scale","0"),void t.style.setProperty("clip-path",`inset(${r}px 0px 0px 0px)`);const s=y(0,(n-o)/10,1);a((()=>{t.style.removeProperty("clip-path"),e.style.setProperty("--opacity-scale",s.toString())}))}))},ct=class{constructor(e){t(this,e),this.inheritedAttributes={},this.translucent=!1,this.setupFadeHeader=async(t,e)=>{const i=this.scrollEl=await j(t);this.contentScrollCallback=()=>{at(this.scrollEl,this.el,e)},i.addEventListener("scroll",this.contentScrollCallback),at(this.scrollEl,this.el,e)}}componentWillLoad(){this.inheritedAttributes=m(this.el)}componentDidLoad(){this.checkCollapsibleHeader()}componentDidUpdate(){this.checkCollapsibleHeader()}disconnectedCallback(){this.destroyCollapsibleHeader()}async checkCollapsibleHeader(){if("ios"!==u(this))return;const{collapse:t}=this,e="condense"===t,i="fade"===t;if(this.destroyCollapsibleHeader(),e){const t=this.el.closest("ion-app,ion-page,.ion-page,page-inner"),e=t?A(t):null;a((()=>{nt("ion-title").size="large",nt("ion-back-button")})),await this.setupCondenseHeader(e,t)}else if(i){const t=this.el.closest("ion-app,ion-page,.ion-page,page-inner"),e=t?A(t):null;if(!e)return void _(this.el);const i=e.querySelector('ion-header[collapse="condense"]');await this.setupFadeHeader(e,i)}}destroyCollapsibleHeader(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=void 0),this.scrollEl&&this.contentScrollCallback&&(this.scrollEl.removeEventListener("scroll",this.contentScrollCallback),this.contentScrollCallback=void 0),this.collapsibleMainHeader&&(this.collapsibleMainHeader.classList.remove("header-collapse-main"),this.collapsibleMainHeader=void 0)}async setupCondenseHeader(t,e){if(!t||!e)return void _(this.el);if("undefined"==typeof IntersectionObserver)return;this.scrollEl=await j(t);const i=e.querySelectorAll("ion-header");if(this.collapsibleMainHeader=Array.from(i).find((t=>"condense"!==t.collapse)),!this.collapsibleMainHeader)return;const n=rt(this.collapsibleMainHeader),r=rt(this.el);n&&r&&(st(n,!1),ot(n.el,0),this.intersectionObserver=new IntersectionObserver((t=>{((t,e,i,n)=>{a((()=>{const r=n.scrollTop;((t,e,i)=>{if(!t[0].isIntersecting)return;const n=t[0].intersectionRatio>.9||i<=0?0:100*(1-t[0].intersectionRatio)/75;ot(e.el,1===n?void 0:n)})(t,e,r);const o=t[0],s=o.intersectionRect,a=s.width*s.height,c=0===a&&0==o.rootBounds.width*o.rootBounds.height,l=Math.abs(s.left-o.boundingClientRect.left),u=Math.abs(s.right-o.boundingClientRect.right);c||a>0&&(l>=5||u>=5)||(o.isIntersecting?(st(e,!1),st(i)):(0===s.x&&0===s.y||0!==s.width&&0!==s.height)&&r>0&&(st(e),st(i,!1),ot(e.el)))}))})(t,n,r,this.scrollEl)}),{root:t,threshold:[.25,.3,.4,.5,.6,.7,.8,.9,1]}),this.intersectionObserver.observe(r.toolbars[r.toolbars.length-1].el),this.contentScrollCallback=()=>{((t,e,i)=>{s((()=>{const n=y(1,1+-t.scrollTop/500,1.1);null===i.querySelector("ion-refresher.refresher-native")&&a((()=>{((t=[],e=1,i=!1)=>{t.forEach((t=>{const n=t.ionTitleEl,r=t.innerTitleEl;n&&"large"===n.size&&(r.style.transition=i?"all 0.2s ease-in-out":"",r.style.transform=`scale3d(${e}, ${e}, 1)`)}))})(e.toolbars,n)}))}))})(this.scrollEl,r,t)},this.scrollEl.addEventListener("scroll",this.contentScrollCallback),a((()=>{void 0!==this.collapsibleMainHeader&&this.collapsibleMainHeader.classList.add("header-collapse-main")})))}render(){const{translucent:t,inheritedAttributes:n}=this,r=u(this),o=this.collapse||"none",s=v("ion-menu",this.el)?"none":"banner";return e(i,Object.assign({role:s,class:{[r]:!0,[`header-${r}`]:!0,"header-translucent":this.translucent,[`header-collapse-${o}`]:!0,[`header-translucent-${r}`]:this.translucent}},n),"ios"===r&&t&&e("div",{class:"header-background"}),e("slot",null))}get el(){return n(this)}};let lt;ct.style={ios:"ion-header{display:block;position:relative;order:-1;width:100%;z-index:10}ion-header ion-toolbar:first-of-type{padding-top:var(--ion-safe-area-top, 0)}.header-ios ion-toolbar:last-of-type{--border-width:0 0 0.55px}@supports (backdrop-filter: blur(0)){.header-background{left:0;right:0;top:0;bottom:0;position:absolute;backdrop-filter:saturate(180%) blur(20px)}.header-translucent-ios ion-toolbar{--opacity:.8}.header-collapse-condense-inactive .header-background{backdrop-filter:blur(20px)}}.header-ios.ion-no-border ion-toolbar:last-of-type{--border-width:0}.header-collapse-fade ion-toolbar{--opacity-scale:inherit}.header-collapse-condense{z-index:9}.header-collapse-condense ion-toolbar{position:sticky;top:0}.header-collapse-condense ion-toolbar:first-of-type{padding-top:7px;z-index:1}.header-collapse-condense ion-toolbar{--background:var(--ion-background-color, #fff);z-index:0}.header-collapse-condense ion-toolbar:last-of-type{--border-width:0px}.header-collapse-condense ion-toolbar ion-searchbar{height:48px;padding-top:0px;padding-bottom:13px}.header-collapse-main{--opacity-scale:1}.header-collapse-main ion-toolbar{--opacity-scale:inherit}.header-collapse-main ion-toolbar.in-toolbar ion-title,.header-collapse-main ion-toolbar.in-toolbar ion-buttons{transition:all 0.2s ease-in-out}.header-collapse-condense-inactive:not(.header-collapse-condense) ion-toolbar.in-toolbar ion-title,.header-collapse-condense-inactive:not(.header-collapse-condense) ion-toolbar.in-toolbar ion-buttons.buttons-collapse{opacity:0;pointer-events:none}.header-collapse-condense-inactive.header-collapse-condense ion-toolbar.in-toolbar ion-title,.header-collapse-condense-inactive.header-collapse-condense ion-toolbar.in-toolbar ion-buttons.buttons-collapse{visibility:hidden}",md:'ion-header{display:block;position:relative;order:-1;width:100%;z-index:10}ion-header ion-toolbar:first-of-type{padding-top:var(--ion-safe-area-top, 0)}.header-md::after{left:0;bottom:-5px;background-position:left 0 top -2px;position:absolute;width:100%;height:5px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAHBAMAAADzDtBxAAAAD1BMVEUAAAAAAAAAAAAAAAAAAABPDueNAAAABXRSTlMUCS0gBIh/TXEAAAAaSURBVAjXYxCEAgY4UIICBmMogMsgFLtAAQCNSwXZKOdPxgAAAABJRU5ErkJggg==);background-repeat:repeat-x;content:""}[dir=rtl] .header-md::after,:host-context([dir=rtl]) .header-md::after{left:unset;right:unset;right:0}[dir=rtl] .header-md::after,:host-context([dir=rtl]) .header-md::after{background-position:right 0 top -2px}.header-collapse-condense{display:none}.header-md.ion-no-border::after{display:none}'};const ut=(t,e,i,n,r)=>(i="ios"===(i&&pt(i))?"ios":"md",n&&"ios"===i?t=pt(n):r&&"md"===i?t=pt(r):(t||!e||dt(e)||(t=e),ft(t)&&(t=pt(t))),ft(t)&&""!==t.trim()?""!==t.replace(/[a-z]|-|\d/gi,"")?null:t:null),ht=t=>ft(t)&&(t=t.trim(),dt(t))?t:null,dt=t=>t.length>0&&/(\/|\.)/.test(t),ft=t=>"string"==typeof t,pt=t=>t.toLowerCase(),vt=t=>{if(1===t.nodeType){if("script"===t.nodeName.toLowerCase())return!1;for(let e=0;e<t.attributes.length;e++){const i=t.attributes[e].name;if(ft(i)&&0===i.toLowerCase().indexOf("on"))return!1}for(let e=0;e<t.childNodes.length;e++)if(!vt(t.childNodes[e]))return!1}return!0},gt=new Map,mt=new Map;let wt;const bt=class{constructor(e){t(this,e),this.iconName=null,this.inheritedAttributes={},this.isVisible=!1,this.mode=yt(),this.lazy=!1,this.sanitize=!0,this.hasAriaHidden=()=>{const{el:t}=this;return t.hasAttribute("aria-hidden")&&"true"===t.getAttribute("aria-hidden")}}componentWillLoad(){this.inheritedAttributes=((t,e=[])=>{const i={};return e.forEach((e=>{t.hasAttribute(e)&&(null!==t.getAttribute(e)&&(i[e]=t.getAttribute(e)),t.removeAttribute(e))})),i})(this.el,["aria-label"])}connectedCallback(){this.waitUntilVisible(this.el,"50px",(()=>{this.isVisible=!0,this.loadIcon()}))}disconnectedCallback(){this.io&&(this.io.disconnect(),this.io=void 0)}waitUntilVisible(t,e,i){if(this.lazy&&"undefined"!=typeof window&&window.IntersectionObserver){const n=this.io=new window.IntersectionObserver((t=>{t[0].isIntersecting&&(n.disconnect(),this.io=void 0,i())}),{rootMargin:e});n.observe(t)}else i()}loadIcon(){if(this.isVisible){wt||(wt=new DOMParser);const t=(t=>{let e=ht(t.src);if(e)return e;if(e=ut(t.name,t.icon,t.mode,t.ios,t.md),e)return(t=>{const e=(()=>{if("undefined"==typeof window)return new Map;if(!lt){const t=window;t.Ionicons=t.Ionicons||{},lt=t.Ionicons.map=t.Ionicons.map||new Map}return lt})().get(t);return e||c(`svg/${t}.svg`)})(e);if(t.icon){if(e=ht(t.icon),e)return e;if(e=ht(t.icon[t.mode]),e)return e}return null})(this);if(t)if(gt.has(t))this.svgContent=gt.get(t);else if(t.startsWith("data:")){const e=wt.parseFromString(t,"text/html").body.querySelector("svg");this.svgContent=null!==e?e.outerHTML:""}else((t,e)=>{let i=mt.get(t);if(!i){if("undefined"==typeof fetch||"undefined"==typeof document)return gt.set(t,""),Promise.resolve();i=fetch(t).then((i=>{if(i.ok)return i.text().then((i=>{i&&!1!==e&&(i=(t=>{const e=document.createElement("div");e.innerHTML=t;for(let t=e.childNodes.length-1;t>=0;t--)"svg"!==e.childNodes[t].nodeName.toLowerCase()&&e.removeChild(e.childNodes[t]);const i=e.firstElementChild;if(i&&"svg"===i.nodeName.toLowerCase()){const t=i.getAttribute("class")||"";if(i.setAttribute("class",(t+" s-ion-icon").trim()),vt(i))return e.innerHTML}return""})(i)),gt.set(t,i||"")}));gt.set(t,"")})),mt.set(t,i)}return i})(t,this.sanitize).then((()=>this.svgContent=gt.get(t)))}const t=this.iconName=ut(this.name,this.icon,this.mode,this.ios,this.md);t&&(this.ariaLabel=t.replace(/\-/g," "))}render(){const{iconName:t,ariaLabel:n,el:r,inheritedAttributes:o}=this,s=this.mode||"md",a=this.flipRtl||t&&(t.indexOf("arrow")>-1||t.indexOf("chevron")>-1)&&!1!==this.flipRtl;return e(i,Object.assign({"aria-label":void 0===n||this.hasAriaHidden()?null:n,role:"img",class:Object.assign(Object.assign({[s]:!0},xt(this.color)),{[`icon-${this.size}`]:!!this.size,"flip-rtl":!!a&&(c=r,c&&""!==c.dir?"rtl"===c.dir.toLowerCase():"rtl"===(null===document||void 0===document?void 0:document.dir.toLowerCase()))})},o),e("div",this.svgContent?{class:"icon-inner",innerHTML:this.svgContent}:{class:"icon-inner"}));var c}static get assetsDirs(){return["svg"]}get el(){return n(this)}static get watchers(){return{name:["loadIcon"],src:["loadIcon"],icon:["loadIcon"]}}},yt=()=>"undefined"!=typeof document&&document.documentElement.getAttribute("mode")||"md",xt=t=>t?{"ion-color":!0,[`ion-color-${t}`]:!0}:null;bt.style=":host{display:inline-block;width:1em;height:1em;contain:strict;fill:currentColor;box-sizing:content-box !important}:host .ionicon{stroke:currentColor}.ionicon-fill-none{fill:none}.ionicon-stroke-width{stroke-width:32px;stroke-width:var(--ionicon-stroke-width, 32px)}.icon-inner,.ionicon,svg{display:block;height:100%;width:100%}:host(.flip-rtl) .icon-inner{transform:scaleX(-1)}:host(.icon-small){font-size:18px !important}:host(.icon-large){font-size:32px !important}:host(.ion-color){color:var(--ion-color-base) !important}:host(.ion-color-primary){--ion-color-base:var(--ion-color-primary, #3880ff)}:host(.ion-color-secondary){--ion-color-base:var(--ion-color-secondary, #0cd1e8)}:host(.ion-color-tertiary){--ion-color-base:var(--ion-color-tertiary, #f4a942)}:host(.ion-color-success){--ion-color-base:var(--ion-color-success, #10dc60)}:host(.ion-color-warning){--ion-color-base:var(--ion-color-warning, #ffce00)}:host(.ion-color-danger){--ion-color-base:var(--ion-color-danger, #f14141)}:host(.ion-color-light){--ion-color-base:var(--ion-color-light, #f4f5f8)}:host(.ion-color-medium){--ion-color-base:var(--ion-color-medium, #989aa2)}:host(.ion-color-dark){--ion-color-base:var(--ion-color-dark, #222428)}";const kt=class{constructor(e){t(this,e),this.labelColorStyles={},this.itemStyles=new Map,this.inheritedAriaAttributes={},this.multipleInputs=!1,this.focusable=!0,this.button=!1,this.detailIcon=R,this.disabled=!1,this.counter=!1,this.routerDirection="forward",this.type="button"}counterFormatterChanged(){this.updateCounterOutput(this.getFirstInput())}handleIonChange(t){this.counter&&t.target===this.getFirstInput()&&this.updateCounterOutput(t.target)}labelColorChanged(t){const{color:e}=this;void 0===e&&(this.labelColorStyles=t.detail)}itemStyle(t){t.stopPropagation();const e=t.target.tagName,i=t.detail,n={},r=this.itemStyles.get(e)||{};let s=!1;Object.keys(i).forEach((t=>{if(i[t]){const e=`item-${t}`;r[e]||(s=!0),n[e]=!0}})),s||Object.keys(n).length===Object.keys(r).length||(s=!0),s&&(this.itemStyles.set(e,n),o(this))}connectedCallback(){this.counter&&this.updateCounterOutput(this.getFirstInput()),this.hasStartEl()}componentDidUpdate(){const t=this.getFirstInput();void 0===t||this.clickListener||(this.clickListener=e=>this.delegateFocus(e,t),this.el.addEventListener("click",this.clickListener))}disconnectedCallback(){void 0!==this.getFirstInput()&&this.clickListener&&(this.el.removeEventListener("click",this.clickListener),this.clickListener=void 0)}componentDidLoad(){x((()=>{this.inheritedAriaAttributes=w(this.el,["aria-label"]),this.setMultipleInputs(),this.focusable=this.isFocusable()}))}setMultipleInputs(){const t=this.el.querySelectorAll("ion-checkbox, ion-datetime, ion-select, ion-radio"),e=this.el.querySelectorAll("ion-input, ion-range, ion-searchbar, ion-segment, ion-textarea, ion-toggle"),i=this.el.querySelectorAll("ion-anchor, ion-button, a, button");this.multipleInputs=t.length+e.length>1||t.length+i.length>1||t.length>0&&this.isClickable()}hasCover(){return 1===this.el.querySelectorAll("ion-checkbox, ion-datetime, ion-select, ion-radio").length&&!this.multipleInputs}isClickable(){return void 0!==this.href||this.button}canActivate(){return this.isClickable()||this.hasCover()}isFocusable(){const t=this.el.querySelector(".ion-focusable");return this.canActivate()||null!==t}getFirstInput(){return this.el.querySelectorAll("ion-input, ion-textarea")[0]}delegateFocus(t,e){const i="ION-ITEM"===t.target.tagName;let n=!1;document.activeElement&&(n=e.querySelector("input, textarea")===document.activeElement),!i||!n&&this.multipleInputs||(e.fireFocusEvents=!1,e.setBlur(),e.setFocus(),x((()=>{e.fireFocusEvents=!0})))}updateCounterOutput(t){var e,i;const{counter:n,counterFormatter:r,defaultCounterFormatter:o}=this;if(n&&!this.multipleInputs&&void 0!==(null==t?void 0:t.maxlength)){const n=null!==(i=null===(e=null==t?void 0:t.value)||void 0===e?void 0:e.toString().length)&&void 0!==i?i:0;if(void 0===r)this.counterString=o(n,t.maxlength);else try{this.counterString=r(n,t.maxlength)}catch(e){S("Exception in provided `counterFormatter`.",e),this.counterString=o(n,t.maxlength)}}}defaultCounterFormatter(t,e){return`${t} / ${e}`}hasStartEl(){null!==this.el.querySelector('[slot="start"]')&&this.el.classList.add("item-has-start-slot")}render(){const{counterString:t,detail:n,detailIcon:r,download:o,fill:s,labelColorStyles:a,lines:c,disabled:l,href:h,rel:d,shape:g,target:m,routerAnimation:w,routerDirection:b,inheritedAriaAttributes:y}=this,x={},k=u(this),E=this.isClickable(),S=this.canActivate(),F=E?void 0===h?"button":"a":"div",A="button"===F?{type:this.type}:{download:o,href:h,rel:d,target:m},_=E?{onClick:t=>{p(h,t,b,w)}}:{},j=void 0!==n?n:"ios"===k&&E;this.itemStyles.forEach((t=>{Object.assign(x,t)}));const C=l||x["item-interactive-disabled"]?"true":null,I=s||"none",T=v("ion-list",this.el);return e(i,{"aria-disabled":C,class:Object.assign(Object.assign(Object.assign({},x),a),f(this.color,{item:!0,[k]:!0,[`item-lines-${c}`]:void 0!==c,[`item-fill-${I}`]:!0,[`item-shape-${g}`]:void 0!==g,"item-disabled":l,"in-list":T,"item-multiple-inputs":this.multipleInputs,"ion-activatable":S,"ion-focusable":this.focusable,"item-rtl":"rtl"===document.dir})),role:T?"listitem":null},e(F,Object.assign({},A,y,{class:"item-native",part:"native",disabled:l},_),e("slot",{name:"start"}),e("div",{class:"item-inner"},e("div",{class:"input-wrapper"},e("slot",null)),e("slot",{name:"end"}),j&&e("ion-icon",{icon:r,lazy:!1,class:"item-detail-icon",part:"detail-icon","aria-hidden":"true","flip-rtl":r===R}),e("div",{class:"item-inner-highlight"})),S&&"md"===k&&e("ion-ripple-effect",null),e("div",{class:"item-highlight"})),e("div",{class:"item-bottom"},e("slot",{name:"error"}),e("slot",{name:"helper"}),t&&e("ion-note",{class:"item-counter"},t)))}static get delegatesFocus(){return!0}get el(){return n(this)}static get watchers(){return{counterFormatter:["counterFormatterChanged"]}}};kt.style={ios:':host{--border-radius:0px;--border-width:0px;--border-style:solid;--padding-top:0px;--padding-bottom:0px;--padding-end:0px;--padding-start:0px;--inner-border-width:0px;--inner-padding-top:0px;--inner-padding-bottom:0px;--inner-padding-start:0px;--inner-padding-end:0px;--inner-box-shadow:none;--show-full-highlight:0;--show-inset-highlight:0;--detail-icon-color:initial;--detail-icon-font-size:20px;--detail-icon-opacity:0.25;--color-activated:var(--color);--color-focused:var(--color);--color-hover:var(--color);--ripple-color:currentColor;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:block;position:relative;align-items:center;justify-content:space-between;outline:none;color:var(--color);font-family:var(--ion-font-family, inherit);text-align:initial;text-decoration:none;overflow:hidden;box-sizing:border-box}:host(.ion-color:not(.item-fill-solid):not(.item-fill-outline)) .item-native{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.ion-color:not(.item-fill-solid):not(.item-fill-outline)) .item-native,:host(.ion-color:not(.item-fill-solid):not(.item-fill-outline)) .item-inner{border-color:var(--ion-color-shade)}:host(.ion-activated) .item-native{color:var(--color-activated)}:host(.ion-activated) .item-native::after{background:var(--background-activated);opacity:var(--background-activated-opacity)}:host(.ion-color.ion-activated) .item-native{color:var(--ion-color-contrast)}:host(.ion-focused) .item-native{color:var(--color-focused)}:host(.ion-focused) .item-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}:host(.ion-color.ion-focused) .item-native{color:var(--ion-color-contrast)}:host(.ion-color.ion-focused) .item-native::after{background:var(--ion-color-contrast)}@media (any-hover: hover){:host(.ion-activatable:not(.ion-focused):hover) .item-native{color:var(--color-hover)}:host(.ion-activatable:not(.ion-focused):hover) .item-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}:host(.ion-color.ion-activatable:not(.ion-focused):hover) .item-native{color:var(--ion-color-contrast)}:host(.ion-color.ion-activatable:not(.ion-focused):hover) .item-native::after{background:var(--ion-color-contrast)}}:host(.item-interactive-disabled:not(.item-multiple-inputs)){cursor:default;pointer-events:none}:host(.item-disabled){cursor:default;opacity:0.3;pointer-events:none}.item-native{border-radius:var(--border-radius);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:flex;position:relative;align-items:inherit;justify-content:inherit;width:100%;min-height:var(--min-height);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:var(--background);overflow:inherit;box-sizing:border-box;z-index:1}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.item-native{padding-left:unset;padding-right:unset;-webkit-padding-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-inline-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.item-native::-moz-focus-inner{border:0}.item-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0;transition:var(--transition);z-index:-1}button,a{cursor:pointer;user-select:none;-webkit-user-drag:none}.item-inner{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--inner-padding-start);padding-right:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-top:var(--inner-padding-top);padding-bottom:var(--inner-padding-bottom);display:flex;position:relative;flex:1;flex-direction:inherit;align-items:inherit;align-self:stretch;min-height:inherit;border-width:var(--inner-border-width);border-style:var(--border-style);border-color:var(--border-color);box-shadow:var(--inner-box-shadow);overflow:inherit;box-sizing:border-box}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.item-inner{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--inner-padding-start);padding-inline-start:var(--inner-padding-start);-webkit-padding-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-inline-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end))}}.item-bottom{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-right:var(--inner-padding-end);padding-top:0;padding-bottom:0;display:flex;justify-content:space-between}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.item-bottom{padding-left:unset;padding-right:unset;-webkit-padding-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-inline-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));-webkit-padding-end:var(--inner-padding-end);padding-inline-end:var(--inner-padding-end)}}.item-detail-icon{color:var(--detail-icon-color);font-size:var(--detail-icon-font-size);opacity:var(--detail-icon-opacity)}::slotted(ion-icon){font-size:1.6em}::slotted(ion-button){--margin-top:0;--margin-bottom:0;--margin-start:0;--margin-end:0;z-index:1}::slotted(ion-label:not([slot=end])){flex:1}:host(.item-input){align-items:center}.input-wrapper{display:flex;flex:1;flex-direction:inherit;align-items:inherit;align-self:stretch;text-overflow:ellipsis;overflow:inherit;box-sizing:border-box}:host(.item-label-stacked),:host(.item-label-floating){align-items:start}:host(.item-label-stacked) .input-wrapper,:host(.item-label-floating) .input-wrapper{flex:1;flex-direction:column}.item-highlight,.item-inner-highlight{left:0;right:0;top:0;bottom:0;border-radius:inherit;position:absolute;width:100%;height:100%;transform:scaleX(0);transition:transform 200ms, border-bottom-width 200ms;z-index:2;box-sizing:border-box;pointer-events:none}:host(.item-interactive.ion-focused),:host(.item-interactive.item-has-focus),:host(.item-interactive.ion-touched.ion-invalid){--full-highlight-height:calc(var(--highlight-height) * var(--show-full-highlight));--inset-highlight-height:calc(var(--highlight-height) * var(--show-inset-highlight))}:host(.ion-focused) .item-highlight,:host(.ion-focused) .item-inner-highlight,:host(.item-has-focus) .item-highlight,:host(.item-has-focus) .item-inner-highlight{transform:scaleX(1);border-style:var(--border-style);border-color:var(--highlight-background)}:host(.ion-focused) .item-highlight,:host(.item-has-focus) .item-highlight{border-width:var(--full-highlight-height);opacity:var(--show-full-highlight)}:host(.ion-focused) .item-inner-highlight,:host(.item-has-focus) .item-inner-highlight{border-bottom-width:var(--inset-highlight-height);opacity:var(--show-inset-highlight)}:host(.ion-focused.item-fill-solid) .item-highlight,:host(.item-has-focus.item-fill-solid) .item-highlight{border-width:calc(var(--full-highlight-height) - 1px)}:host(.ion-focused) .item-inner-highlight,:host(.ion-focused:not(.item-fill-outline)) .item-highlight,:host(.item-has-focus) .item-inner-highlight,:host(.item-has-focus:not(.item-fill-outline)) .item-highlight{border-top:none;border-right:none;border-left:none}:host(.item-interactive.ion-focused),:host(.item-interactive.item-has-focus){--highlight-background:var(--highlight-color-focused)}:host(.item-interactive.ion-valid){--highlight-background:var(--highlight-color-valid)}:host(.item-interactive.ion-invalid){--highlight-background:var(--highlight-color-invalid)}:host(.item-interactive.ion-invalid) ::slotted([slot=helper]){display:none}::slotted([slot=error]){display:none;color:var(--highlight-color-invalid)}:host(.item-interactive.ion-invalid) ::slotted([slot=error]){display:block}:host(:not(.item-label)) ::slotted(ion-select){--padding-start:0;max-width:none}:host(.item-label-stacked) ::slotted(ion-select),:host(.item-label-floating) ::slotted(ion-select){--padding-top:8px;--padding-bottom:8px;--padding-start:0;align-self:stretch;width:100%;max-width:100%}:host(:not(.item-label)) ::slotted(ion-datetime){--padding-start:0}:host(.item-label-stacked) ::slotted(ion-datetime),:host(.item-label-floating) ::slotted(ion-datetime){--padding-start:0;width:100%}:host(.item-multiple-inputs) ::slotted(ion-checkbox),:host(.item-multiple-inputs) ::slotted(ion-datetime),:host(.item-multiple-inputs) ::slotted(ion-radio),:host(.item-multiple-inputs) ::slotted(ion-select){position:relative}:host(.item-textarea){align-items:stretch}::slotted(ion-reorder[slot]){margin-top:0;margin-bottom:0}ion-ripple-effect{color:var(--ripple-color)}:host(.item-fill-solid) ::slotted([slot=start]),:host(.item-fill-solid) ::slotted([slot=end]),:host(.item-fill-outline) ::slotted([slot=start]),:host(.item-fill-outline) ::slotted([slot=end]){align-self:center}::slotted([slot=helper]),::slotted([slot=error]),.item-counter{padding-top:5px;font-size:12px;z-index:1}.item-counter{margin-left:auto;color:var(--ion-color-step-550, #737373);white-space:nowrap;padding-inline-start:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.item-counter{margin-left:unset;-webkit-margin-start:auto;margin-inline-start:auto}}@media (prefers-reduced-motion: reduce){.item-highlight,.item-inner-highlight{transition:none}}:host{--min-height:44px;--transition:background-color 200ms linear, opacity 200ms linear;--padding-start:20px;--inner-padding-end:10px;--inner-border-width:0px 0px 0.55px 0px;--background:var(--ion-item-background, var(--ion-background-color, #fff));--background-activated:#000;--background-focused:#000;--background-hover:currentColor;--background-activated-opacity:.12;--background-focused-opacity:.15;--background-hover-opacity:.04;--border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-250, #c8c7cc)));--color:var(--ion-item-color, var(--ion-text-color, #000));--highlight-height:0px;--highlight-color-focused:var(--ion-color-primary, #3880ff);--highlight-color-valid:var(--ion-color-success, #2dd36f);--highlight-color-invalid:var(--ion-color-danger, #eb445a);--bottom-padding-start:0px;font-size:17px}:host(.ion-activated){--transition:none}:host(.ion-color.ion-focused) .item-native::after{background:#000;opacity:0.15}:host(.ion-color.ion-activated) .item-native::after{background:#000;opacity:0.12}:host(.item-interactive){--show-full-highlight:0;--show-inset-highlight:1}:host(.item-lines-full){--border-width:0px 0px 0.55px 0px;--show-full-highlight:1;--show-inset-highlight:0}:host(.item-lines-inset){--inner-border-width:0px 0px 0.55px 0px;--show-full-highlight:0;--show-inset-highlight:1}:host(.item-lines-inset),:host(.item-lines-none){--border-width:0px;--show-full-highlight:0}:host(.item-lines-full),:host(.item-lines-none){--inner-border-width:0px;--show-inset-highlight:0}.item-highlight,.item-inner-highlight{transition:none}:host(.item-has-focus) .item-inner-highlight,:host(.item-has-focus) .item-highlight{border-top:none;border-right:none;border-left:none}::slotted([slot=start]){margin-left:0;margin-right:20px;margin-top:2px;margin-bottom:2px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted([slot=start]){margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:20px;margin-inline-end:20px}}::slotted([slot=end]){margin-left:10px;margin-right:10px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted([slot=end]){margin-left:unset;margin-right:unset;-webkit-margin-start:10px;margin-inline-start:10px;-webkit-margin-end:10px;margin-inline-end:10px}}::slotted(ion-icon[slot=start]),::slotted(ion-icon[slot=end]){margin-top:7px;margin-bottom:7px}::slotted(ion-toggle[slot=start]),::slotted(ion-toggle[slot=end]){margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}:host(.item-label-stacked) ::slotted([slot=end]),:host(.item-label-floating) ::slotted([slot=end]){margin-top:7px;margin-bottom:7px}::slotted(.button-small){--padding-top:0px;--padding-bottom:0px;--padding-start:.5em;--padding-end:.5em;height:24px;font-size:13px}::slotted(ion-avatar){width:36px;height:36px}::slotted(ion-thumbnail){width:56px;height:56px}::slotted(ion-avatar[slot=end]),::slotted(ion-thumbnail[slot=end]){margin-left:10px;margin-right:10px;margin-top:10px;margin-bottom:10px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-avatar[slot=end]),::slotted(ion-thumbnail[slot=end]){margin-left:unset;margin-right:unset;-webkit-margin-start:10px;margin-inline-start:10px;-webkit-margin-end:10px;margin-inline-end:10px}}:host(.item-radio) ::slotted(ion-label),:host(.item-toggle) ::slotted(ion-label){margin-left:0px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.item-radio) ::slotted(ion-label),:host(.item-toggle) ::slotted(ion-label){margin-left:unset;-webkit-margin-start:0px;margin-inline-start:0px}}::slotted(ion-label){margin-left:0;margin-right:8px;margin-top:10px;margin-bottom:10px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-label){margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:8px;margin-inline-end:8px}}:host(.item-label-floating),:host(.item-label-stacked){--min-height:68px}:host(.item-label-stacked) ::slotted(ion-select),:host(.item-label-floating) ::slotted(ion-select){--padding-top:8px;--padding-bottom:8px;--padding-start:0px}:host(.item-label-fixed) ::slotted(ion-select),:host(.item-label-fixed) ::slotted(ion-datetime){--padding-start:0}',md:':host{--border-radius:0px;--border-width:0px;--border-style:solid;--padding-top:0px;--padding-bottom:0px;--padding-end:0px;--padding-start:0px;--inner-border-width:0px;--inner-padding-top:0px;--inner-padding-bottom:0px;--inner-padding-start:0px;--inner-padding-end:0px;--inner-box-shadow:none;--show-full-highlight:0;--show-inset-highlight:0;--detail-icon-color:initial;--detail-icon-font-size:20px;--detail-icon-opacity:0.25;--color-activated:var(--color);--color-focused:var(--color);--color-hover:var(--color);--ripple-color:currentColor;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:block;position:relative;align-items:center;justify-content:space-between;outline:none;color:var(--color);font-family:var(--ion-font-family, inherit);text-align:initial;text-decoration:none;overflow:hidden;box-sizing:border-box}:host(.ion-color:not(.item-fill-solid):not(.item-fill-outline)) .item-native{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.ion-color:not(.item-fill-solid):not(.item-fill-outline)) .item-native,:host(.ion-color:not(.item-fill-solid):not(.item-fill-outline)) .item-inner{border-color:var(--ion-color-shade)}:host(.ion-activated) .item-native{color:var(--color-activated)}:host(.ion-activated) .item-native::after{background:var(--background-activated);opacity:var(--background-activated-opacity)}:host(.ion-color.ion-activated) .item-native{color:var(--ion-color-contrast)}:host(.ion-focused) .item-native{color:var(--color-focused)}:host(.ion-focused) .item-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}:host(.ion-color.ion-focused) .item-native{color:var(--ion-color-contrast)}:host(.ion-color.ion-focused) .item-native::after{background:var(--ion-color-contrast)}@media (any-hover: hover){:host(.ion-activatable:not(.ion-focused):hover) .item-native{color:var(--color-hover)}:host(.ion-activatable:not(.ion-focused):hover) .item-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}:host(.ion-color.ion-activatable:not(.ion-focused):hover) .item-native{color:var(--ion-color-contrast)}:host(.ion-color.ion-activatable:not(.ion-focused):hover) .item-native::after{background:var(--ion-color-contrast)}}:host(.item-interactive-disabled:not(.item-multiple-inputs)){cursor:default;pointer-events:none}:host(.item-disabled){cursor:default;opacity:0.3;pointer-events:none}.item-native{border-radius:var(--border-radius);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:flex;position:relative;align-items:inherit;justify-content:inherit;width:100%;min-height:var(--min-height);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:var(--background);overflow:inherit;box-sizing:border-box;z-index:1}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.item-native{padding-left:unset;padding-right:unset;-webkit-padding-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-inline-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.item-native::-moz-focus-inner{border:0}.item-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0;transition:var(--transition);z-index:-1}button,a{cursor:pointer;user-select:none;-webkit-user-drag:none}.item-inner{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--inner-padding-start);padding-right:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-top:var(--inner-padding-top);padding-bottom:var(--inner-padding-bottom);display:flex;position:relative;flex:1;flex-direction:inherit;align-items:inherit;align-self:stretch;min-height:inherit;border-width:var(--inner-border-width);border-style:var(--border-style);border-color:var(--border-color);box-shadow:var(--inner-box-shadow);overflow:inherit;box-sizing:border-box}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.item-inner{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--inner-padding-start);padding-inline-start:var(--inner-padding-start);-webkit-padding-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-inline-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end))}}.item-bottom{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-right:var(--inner-padding-end);padding-top:0;padding-bottom:0;display:flex;justify-content:space-between}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.item-bottom{padding-left:unset;padding-right:unset;-webkit-padding-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-inline-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));-webkit-padding-end:var(--inner-padding-end);padding-inline-end:var(--inner-padding-end)}}.item-detail-icon{color:var(--detail-icon-color);font-size:var(--detail-icon-font-size);opacity:var(--detail-icon-opacity)}::slotted(ion-icon){font-size:1.6em}::slotted(ion-button){--margin-top:0;--margin-bottom:0;--margin-start:0;--margin-end:0;z-index:1}::slotted(ion-label:not([slot=end])){flex:1}:host(.item-input){align-items:center}.input-wrapper{display:flex;flex:1;flex-direction:inherit;align-items:inherit;align-self:stretch;text-overflow:ellipsis;overflow:inherit;box-sizing:border-box}:host(.item-label-stacked),:host(.item-label-floating){align-items:start}:host(.item-label-stacked) .input-wrapper,:host(.item-label-floating) .input-wrapper{flex:1;flex-direction:column}.item-highlight,.item-inner-highlight{left:0;right:0;top:0;bottom:0;border-radius:inherit;position:absolute;width:100%;height:100%;transform:scaleX(0);transition:transform 200ms, border-bottom-width 200ms;z-index:2;box-sizing:border-box;pointer-events:none}:host(.item-interactive.ion-focused),:host(.item-interactive.item-has-focus),:host(.item-interactive.ion-touched.ion-invalid){--full-highlight-height:calc(var(--highlight-height) * var(--show-full-highlight));--inset-highlight-height:calc(var(--highlight-height) * var(--show-inset-highlight))}:host(.ion-focused) .item-highlight,:host(.ion-focused) .item-inner-highlight,:host(.item-has-focus) .item-highlight,:host(.item-has-focus) .item-inner-highlight{transform:scaleX(1);border-style:var(--border-style);border-color:var(--highlight-background)}:host(.ion-focused) .item-highlight,:host(.item-has-focus) .item-highlight{border-width:var(--full-highlight-height);opacity:var(--show-full-highlight)}:host(.ion-focused) .item-inner-highlight,:host(.item-has-focus) .item-inner-highlight{border-bottom-width:var(--inset-highlight-height);opacity:var(--show-inset-highlight)}:host(.ion-focused.item-fill-solid) .item-highlight,:host(.item-has-focus.item-fill-solid) .item-highlight{border-width:calc(var(--full-highlight-height) - 1px)}:host(.ion-focused) .item-inner-highlight,:host(.ion-focused:not(.item-fill-outline)) .item-highlight,:host(.item-has-focus) .item-inner-highlight,:host(.item-has-focus:not(.item-fill-outline)) .item-highlight{border-top:none;border-right:none;border-left:none}:host(.item-interactive.ion-focused),:host(.item-interactive.item-has-focus){--highlight-background:var(--highlight-color-focused)}:host(.item-interactive.ion-valid){--highlight-background:var(--highlight-color-valid)}:host(.item-interactive.ion-invalid){--highlight-background:var(--highlight-color-invalid)}:host(.item-interactive.ion-invalid) ::slotted([slot=helper]){display:none}::slotted([slot=error]){display:none;color:var(--highlight-color-invalid)}:host(.item-interactive.ion-invalid) ::slotted([slot=error]){display:block}:host(:not(.item-label)) ::slotted(ion-select){--padding-start:0;max-width:none}:host(.item-label-stacked) ::slotted(ion-select),:host(.item-label-floating) ::slotted(ion-select){--padding-top:8px;--padding-bottom:8px;--padding-start:0;align-self:stretch;width:100%;max-width:100%}:host(:not(.item-label)) ::slotted(ion-datetime){--padding-start:0}:host(.item-label-stacked) ::slotted(ion-datetime),:host(.item-label-floating) ::slotted(ion-datetime){--padding-start:0;width:100%}:host(.item-multiple-inputs) ::slotted(ion-checkbox),:host(.item-multiple-inputs) ::slotted(ion-datetime),:host(.item-multiple-inputs) ::slotted(ion-radio),:host(.item-multiple-inputs) ::slotted(ion-select){position:relative}:host(.item-textarea){align-items:stretch}::slotted(ion-reorder[slot]){margin-top:0;margin-bottom:0}ion-ripple-effect{color:var(--ripple-color)}:host(.item-fill-solid) ::slotted([slot=start]),:host(.item-fill-solid) ::slotted([slot=end]),:host(.item-fill-outline) ::slotted([slot=start]),:host(.item-fill-outline) ::slotted([slot=end]){align-self:center}::slotted([slot=helper]),::slotted([slot=error]),.item-counter{padding-top:5px;font-size:12px;z-index:1}.item-counter{margin-left:auto;color:var(--ion-color-step-550, #737373);white-space:nowrap;padding-inline-start:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.item-counter{margin-left:unset;-webkit-margin-start:auto;margin-inline-start:auto}}@media (prefers-reduced-motion: reduce){.item-highlight,.item-inner-highlight{transition:none}}:host{--min-height:48px;--background:var(--ion-item-background, var(--ion-background-color, #fff));--background-activated:transparent;--background-focused:currentColor;--background-hover:currentColor;--background-activated-opacity:0;--background-focused-opacity:.12;--background-hover-opacity:.04;--border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.13))));--color:var(--ion-item-color, var(--ion-text-color, #000));--transition:opacity 15ms linear, background-color 15ms linear;--padding-start:16px;--inner-padding-end:16px;--inner-border-width:0 0 1px 0;--highlight-height:1px;--highlight-color-focused:var(--ion-color-primary, #3880ff);--highlight-color-valid:var(--ion-color-success, #2dd36f);--highlight-color-invalid:var(--ion-color-danger, #eb445a);font-size:16px;font-weight:normal;text-transform:none}:host(.item-fill-outline){--highlight-height:2px}:host(.item-fill-none.item-interactive.ion-focus) .item-highlight,:host(.item-fill-none.item-interactive.item-has-focus) .item-highlight,:host(.item-fill-none.item-interactive.ion-touched.ion-invalid) .item-highlight{transform:scaleX(1);border-width:0 0 var(--full-highlight-height) 0;border-style:var(--border-style);border-color:var(--highlight-background)}:host(.item-fill-none.item-interactive.ion-focus) .item-native,:host(.item-fill-none.item-interactive.item-has-focus) .item-native,:host(.item-fill-none.item-interactive.ion-touched.ion-invalid) .item-native{border-bottom-color:var(--highlight-background)}:host(.item-fill-outline.item-interactive.ion-focus) .item-highlight,:host(.item-fill-outline.item-interactive.item-has-focus) .item-highlight{transform:scaleX(1)}:host(.item-fill-outline.item-interactive.ion-focus) .item-highlight,:host(.item-fill-outline.item-interactive.item-has-focus) .item-highlight,:host(.item-fill-outline.item-interactive.ion-touched.ion-invalid) .item-highlight{border-width:var(--full-highlight-height);border-style:var(--border-style);border-color:var(--highlight-background)}:host(.item-fill-outline.item-interactive.ion-touched.ion-invalid) .item-native{border-color:var(--highlight-background)}:host(.item-fill-solid.item-interactive.ion-focus) .item-highlight,:host(.item-fill-solid.item-interactive.item-has-focus) .item-highlight,:host(.item-fill-solid.item-interactive.ion-touched.ion-invalid) .item-highlight{transform:scaleX(1);border-width:0 0 var(--full-highlight-height) 0;border-style:var(--border-style);border-color:var(--highlight-background)}:host(.item-fill-solid.item-interactive.ion-focus) .item-native,:host(.item-fill-solid.item-interactive.item-has-focus) .item-native,:host(.item-fill-solid.item-interactive.ion-touched.ion-invalid) .item-native{border-bottom-color:var(--highlight-background)}:host(.ion-color.ion-activated) .item-native::after{background:transparent}:host(.item-has-focus) .item-native{caret-color:var(--highlight-background)}:host(.item-interactive){--border-width:0 0 1px 0;--inner-border-width:0;--show-full-highlight:1;--show-inset-highlight:0}:host(.item-lines-full){--border-width:0 0 1px 0;--show-full-highlight:1;--show-inset-highlight:0}:host(.item-lines-inset){--inner-border-width:0 0 1px 0;--show-full-highlight:0;--show-inset-highlight:1}:host(.item-lines-inset),:host(.item-lines-none){--border-width:0;--show-full-highlight:0}:host(.item-lines-full),:host(.item-lines-none){--inner-border-width:0;--show-inset-highlight:0}:host(.item-fill-outline) .item-highlight{--position-offset:calc(-1 * var(--border-width));left:var(--position-offset);top:var(--position-offset);width:calc(100% + 2 * var(--border-width));height:calc(100% + 2 * var(--border-width));transition:none}:host-context([dir=rtl]):host(.item-fill-outline) .item-highlight,:host-context([dir=rtl]).item-fill-outline .item-highlight{left:unset;right:unset;right:var(--position-offset)}:host(.item-fill-outline.ion-focused) .item-native,:host(.item-fill-outline.item-has-focus) .item-native{border-color:transparent}:host(.item-multi-line) ::slotted([slot=start]),:host(.item-multi-line) ::slotted([slot=end]){margin-top:16px;margin-bottom:16px;align-self:flex-start}::slotted([slot=start]){margin-right:32px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted([slot=start]){margin-right:unset;-webkit-margin-end:32px;margin-inline-end:32px}}::slotted([slot=end]){margin-left:32px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted([slot=end]){margin-left:unset;-webkit-margin-start:32px;margin-inline-start:32px}}:host(.item-fill-solid) ::slotted([slot=start]),:host(.item-fill-solid) ::slotted([slot=end]),:host(.item-fill-outline) ::slotted([slot=start]),:host(.item-fill-outline) ::slotted([slot=end]){align-self:center}::slotted(ion-icon){color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.54);font-size:24px}:host(.ion-color:not(.item-fill-solid):not(.item-fill-outline)) ::slotted(ion-icon){color:var(--ion-color-contrast)}::slotted(ion-icon[slot]){margin-top:12px;margin-bottom:12px}::slotted(ion-icon[slot=start]){margin-right:32px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon[slot=start]){margin-right:unset;-webkit-margin-end:32px;margin-inline-end:32px}}::slotted(ion-icon[slot=end]){margin-left:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon[slot=end]){margin-left:unset;-webkit-margin-start:16px;margin-inline-start:16px}}:host(.item-fill-solid) ::slotted(ion-icon[slot=start]),:host(.item-fill-outline) ::slotted(ion-icon[slot=start]){margin-right:8px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.item-fill-solid) ::slotted(ion-icon[slot=start]),:host(.item-fill-outline) ::slotted(ion-icon[slot=start]){margin-right:unset;-webkit-margin-end:8px;margin-inline-end:8px}}::slotted(ion-toggle[slot=start]),::slotted(ion-toggle[slot=end]){margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}::slotted(ion-note){margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;align-self:flex-start;font-size:11px}::slotted(ion-note[slot]:not([slot=helper]):not([slot=error])){padding-left:0;padding-right:0;padding-top:18px;padding-bottom:10px}::slotted(ion-note[slot=start]){padding-right:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-note[slot=start]){padding-right:unset;-webkit-padding-end:16px;padding-inline-end:16px}}::slotted(ion-note[slot=end]){padding-left:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-note[slot=end]){padding-left:unset;-webkit-padding-start:16px;padding-inline-start:16px}}::slotted(ion-avatar){width:40px;height:40px}::slotted(ion-thumbnail){width:56px;height:56px}::slotted(ion-avatar),::slotted(ion-thumbnail){margin-top:8px;margin-bottom:8px}::slotted(ion-avatar[slot=start]),::slotted(ion-thumbnail[slot=start]){margin-right:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-avatar[slot=start]),::slotted(ion-thumbnail[slot=start]){margin-right:unset;-webkit-margin-end:16px;margin-inline-end:16px}}::slotted(ion-avatar[slot=end]),::slotted(ion-thumbnail[slot=end]){margin-left:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-avatar[slot=end]),::slotted(ion-thumbnail[slot=end]){margin-left:unset;-webkit-margin-start:16px;margin-inline-start:16px}}::slotted(ion-label){margin-left:0;margin-right:0;margin-top:10px;margin-bottom:10px}:host(.item-label-stacked) ::slotted([slot=end]),:host(.item-label-floating) ::slotted([slot=end]){margin-top:7px;margin-bottom:7px}:host(.item-label-fixed) ::slotted(ion-select),:host(.item-label-fixed) ::slotted(ion-datetime){--padding-start:8px}:host(.item-toggle) ::slotted(ion-label),:host(.item-radio) ::slotted(ion-label){margin-left:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.item-toggle) ::slotted(ion-label),:host(.item-radio) ::slotted(ion-label){margin-left:unset;-webkit-margin-start:0;margin-inline-start:0}}::slotted(.button-small){--padding-top:0;--padding-bottom:0;--padding-start:.6em;--padding-end:.6em;height:25px;font-size:12px}:host(.item-label-floating),:host(.item-label-stacked){--min-height:55px}:host(.item-label-stacked) ::slotted(ion-select),:host(.item-label-floating) ::slotted(ion-select){--padding-top:8px;--padding-bottom:8px;--padding-start:0}:host(.ion-focused:not(.ion-color)) ::slotted(.label-stacked),:host(.ion-focused:not(.ion-color)) ::slotted(.label-floating),:host(.item-has-focus:not(.ion-color)) ::slotted(.label-stacked),:host(.item-has-focus:not(.ion-color)) ::slotted(.label-floating){color:var(--ion-color-primary, #3880ff)}:host(.ion-color){--highlight-color-focused:var(--ion-color-contrast)}:host(.item-label-color){--highlight-color-focused:var(--ion-color-base)}:host(.item-fill-solid.ion-color),:host(.item-fill-outline.ion-color){--highlight-color-focused:var(--ion-color-base)}:host(.item-fill-solid){--background:var(--ion-color-step-50, #f2f2f2);--background-hover:var(--ion-color-step-100, #e6e6e6);--background-focused:var(--ion-color-step-150, #d9d9d9);--border-width:0 0 1px 0;--inner-border-width:0;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}:host-context([dir=rtl]):host(.item-fill-solid),:host-context([dir=rtl]).item-fill-solid{border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}:host(.item-fill-solid) .item-native{--border-color:var(--ion-color-step-500, gray)}:host(.item-fill-solid.ion-focused) .item-native,:host(.item-fill-solid.item-has-focus) .item-native{--background:var(--background-focused)}:host(.item-fill-solid.item-shape-round){border-top-left-radius:16px;border-top-right-radius:16px;border-bottom-right-radius:0;border-bottom-left-radius:0}:host-context([dir=rtl]):host(.item-fill-solid.item-shape-round),:host-context([dir=rtl]).item-fill-solid.item-shape-round{border-top-left-radius:16px;border-top-right-radius:16px;border-bottom-right-radius:0;border-bottom-left-radius:0}@media (any-hover: hover){:host(.item-fill-solid:hover) .item-native{--background:var(--background-hover);--border-color:var(--ion-color-step-750, #404040)}}:host(.item-fill-outline){--ripple-color:transparent;--background-focused:transparent;--background-hover:transparent;--border-color:var(--ion-color-step-500, gray);--border-width:1px;border:none;overflow:visible}:host(.item-fill-outline) .item-native{--native-padding-left:16px;border-radius:4px}:host(.item-fill-outline.item-shape-round) .item-native{--inner-padding-start:16px;border-radius:28px}:host(.item-fill-outline.item-shape-round) .item-bottom{padding-left:32px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.item-fill-outline.item-shape-round) .item-bottom{padding-left:unset;-webkit-padding-start:32px;padding-inline-start:32px}}:host(.item-fill-outline.item-label-floating.ion-focused) .item-native ::slotted(ion-input:not(:first-child)),:host(.item-fill-outline.item-label-floating.ion-focused) .item-native ::slotted(ion-textarea:not(:first-child)),:host(.item-fill-outline.item-label-floating.item-has-focus) .item-native ::slotted(ion-input:not(:first-child)),:host(.item-fill-outline.item-label-floating.item-has-focus) .item-native ::slotted(ion-textarea:not(:first-child)),:host(.item-fill-outline.item-label-floating.item-has-value) .item-native ::slotted(ion-input:not(:first-child)),:host(.item-fill-outline.item-label-floating.item-has-value) .item-native ::slotted(ion-textarea:not(:first-child)){transform:translateY(-14px)}@media (any-hover: hover){:host(.item-fill-outline:hover) .item-native{--border-color:var(--ion-color-step-750, #404040)}}.item-counter{letter-spacing:0.0333333333em}'};const Et=class{constructor(e){t(this,e),this.sticky=!1}render(){const t=u(this);return e(i,{class:f(this.color,{[t]:!0,"item-divider-sticky":this.sticky,item:!0})},e("slot",{name:"start"}),e("div",{class:"item-divider-inner"},e("div",{class:"item-divider-wrapper"},e("slot",null)),e("slot",{name:"end"})))}get el(){return n(this)}};Et.style={ios:":host{--padding-top:0px;--padding-end:0px;--padding-bottom:0px;--padding-start:0px;--inner-padding-top:0px;--inner-padding-end:0px;--inner-padding-bottom:0px;--inner-padding-start:0px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:flex;align-items:center;justify-content:space-between;width:100%;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);overflow:hidden;z-index:100;box-sizing:border-box}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-inline-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}:host(.ion-color){background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.item-divider-sticky){position:sticky;top:0}.item-divider-inner{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--inner-padding-start);padding-right:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-top:var(--inner-padding-top);padding-bottom:var(--inner-padding-bottom);display:flex;flex:1;flex-direction:inherit;align-items:inherit;align-self:stretch;min-height:inherit;border:0;overflow:hidden}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.item-divider-inner{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--inner-padding-start);padding-inline-start:var(--inner-padding-start);-webkit-padding-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-inline-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end))}}.item-divider-wrapper{display:flex;flex:1;flex-direction:inherit;align-items:inherit;align-self:stretch;text-overflow:ellipsis;overflow:hidden}:host{--background:var(--ion-color-step-100, #e6e6e6);--color:var(--ion-color-step-850, #262626);--padding-start:20px;--inner-padding-end:10px;border-radius:0;position:relative;min-height:28px;font-size:17px;font-weight:600}:host([slot=start]){margin-left:0;margin-right:20px;margin-top:2px;margin-bottom:2px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host([slot=start]){margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:20px;margin-inline-end:20px}}:host([slot=end]){margin-left:10px;margin-right:10px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host([slot=end]){margin-left:unset;margin-right:unset;-webkit-margin-start:10px;margin-inline-start:10px;-webkit-margin-end:10px;margin-inline-end:10px}}::slotted(ion-icon[slot=start]),::slotted(ion-icon[slot=end]){margin-top:7px;margin-bottom:7px}::slotted(h1){margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:24px;font-weight:normal}::slotted(h2){margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:17px;font-weight:normal}::slotted(h3),::slotted(h4),::slotted(h5),::slotted(h6){margin-left:0;margin-right:0;margin-top:0;margin-bottom:3px;font-size:14px;font-weight:normal;line-height:normal}::slotted(p){margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.4);font-size:14px;line-height:normal;text-overflow:inherit;overflow:inherit}::slotted(h2:last-child) ::slotted(h3:last-child),::slotted(h4:last-child),::slotted(h5:last-child),::slotted(h6:last-child),::slotted(p:last-child){margin-bottom:0}",md:":host{--padding-top:0px;--padding-end:0px;--padding-bottom:0px;--padding-start:0px;--inner-padding-top:0px;--inner-padding-end:0px;--inner-padding-bottom:0px;--inner-padding-start:0px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:flex;align-items:center;justify-content:space-between;width:100%;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);overflow:hidden;z-index:100;box-sizing:border-box}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-inline-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}:host(.ion-color){background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.item-divider-sticky){position:sticky;top:0}.item-divider-inner{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--inner-padding-start);padding-right:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-top:var(--inner-padding-top);padding-bottom:var(--inner-padding-bottom);display:flex;flex:1;flex-direction:inherit;align-items:inherit;align-self:stretch;min-height:inherit;border:0;overflow:hidden}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.item-divider-inner{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--inner-padding-start);padding-inline-start:var(--inner-padding-start);-webkit-padding-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-inline-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end))}}.item-divider-wrapper{display:flex;flex:1;flex-direction:inherit;align-items:inherit;align-self:stretch;text-overflow:ellipsis;overflow:hidden}:host{--background:var(--ion-background-color, #fff);--color:var(--ion-color-step-400, #999999);--padding-start:16px;--inner-padding-end:0;min-height:30px;border-bottom:1px solid var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.13))));font-size:14px}::slotted([slot=start]){margin-right:32px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted([slot=start]){margin-right:unset;-webkit-margin-end:32px;margin-inline-end:32px}}::slotted([slot=end]){margin-left:32px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted([slot=end]){margin-left:unset;-webkit-margin-start:32px;margin-inline-start:32px}}::slotted(ion-label){margin-left:0;margin-right:0;margin-top:13px;margin-bottom:10px}::slotted(ion-icon){color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.54);font-size:24px}:host(.ion-color) ::slotted(ion-icon){color:var(--ion-color-contrast)}::slotted(ion-icon[slot]){margin-top:12px;margin-bottom:12px}::slotted(ion-icon[slot=start]){margin-right:32px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon[slot=start]){margin-right:unset;-webkit-margin-end:32px;margin-inline-end:32px}}::slotted(ion-icon[slot=end]){margin-left:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon[slot=end]){margin-left:unset;-webkit-margin-start:16px;margin-inline-start:16px}}::slotted(ion-note){margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;align-self:flex-start;font-size:11px}::slotted(ion-note[slot]){padding-left:0;padding-right:0;padding-top:18px;padding-bottom:10px}::slotted(ion-note[slot=start]){padding-right:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-note[slot=start]){padding-right:unset;-webkit-padding-end:16px;padding-inline-end:16px}}::slotted(ion-note[slot=end]){padding-left:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-note[slot=end]){padding-left:unset;-webkit-padding-start:16px;padding-inline-start:16px}}::slotted(ion-avatar){width:40px;height:40px}::slotted(ion-thumbnail){width:56px;height:56px}::slotted(ion-avatar),::slotted(ion-thumbnail){margin-top:8px;margin-bottom:8px}::slotted(ion-avatar[slot=start]),::slotted(ion-thumbnail[slot=start]){margin-right:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-avatar[slot=start]),::slotted(ion-thumbnail[slot=start]){margin-right:unset;-webkit-margin-end:16px;margin-inline-end:16px}}::slotted(ion-avatar[slot=end]),::slotted(ion-thumbnail[slot=end]){margin-left:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-avatar[slot=end]),::slotted(ion-thumbnail[slot=end]){margin-left:unset;-webkit-margin-start:16px;margin-inline-start:16px}}::slotted(h1){margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:24px;font-weight:normal}::slotted(h2){margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:16px;font-weight:normal}::slotted(h3,h4,h5,h6){margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:14px;font-weight:normal;line-height:normal}::slotted(p){margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;color:var(--ion-color-step-600, #666666);font-size:14px;line-height:normal;text-overflow:inherit;overflow:inherit}"};const St=class{constructor(e){t(this,e)}render(){const t=u(this);return e(i,{role:"group",class:{[t]:!0,[`item-group-${t}`]:!0,item:!0}})}};St.style={ios:"ion-item-group{display:block}",md:"ion-item-group{display:block}"};const Ft=class{constructor(e){t(this,e),this.ionColor=r(this,"ionColor",7),this.ionStyle=r(this,"ionStyle",7),this.inRange=!1,this.noAnimate=!1}componentWillLoad(){this.inRange=!!this.el.closest("ion-range"),this.noAnimate="floating"===this.position,this.emitStyle(),this.emitColor()}componentDidLoad(){this.noAnimate&&setTimeout((()=>{this.noAnimate=!1}),1e3)}colorChanged(){this.emitColor()}positionChanged(){this.emitStyle()}emitColor(){const{color:t}=this;this.ionColor.emit({"item-label-color":void 0!==t,[`ion-color-${t}`]:void 0!==t})}emitStyle(){const{inRange:t,position:e}=this;t||this.ionStyle.emit({label:!0,[`label-${e}`]:void 0!==e})}render(){const t=this.position,n=u(this);return e(i,{class:f(this.color,{[n]:!0,"in-item-color":v("ion-item.ion-color",this.el),[`label-${t}`]:void 0!==t,"label-no-animate":this.noAnimate,"label-rtl":"rtl"===document.dir})})}get el(){return n(this)}static get watchers(){return{color:["colorChanged"],position:["positionChanged"]}}};Ft.style={ios:".item.sc-ion-label-ios-h,.item .sc-ion-label-ios-h{--color:initial;display:block;color:var(--color);font-family:var(--ion-font-family, inherit);font-size:inherit;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;box-sizing:border-box}.ion-color.sc-ion-label-ios-h{color:var(--ion-color-base)}.ion-text-wrap.sc-ion-label-ios-h,[text-wrap].sc-ion-label-ios-h{white-space:normal}.item-interactive-disabled.sc-ion-label-ios-h:not(.item-multiple-inputs),.item-interactive-disabled:not(.item-multiple-inputs) .sc-ion-label-ios-h{cursor:default;opacity:0.3;pointer-events:none}.item-input.sc-ion-label-ios-h,.item-input .sc-ion-label-ios-h{flex:initial;max-width:200px;pointer-events:none}.item-textarea.sc-ion-label-ios-h,.item-textarea .sc-ion-label-ios-h{align-self:baseline}.label-fixed.sc-ion-label-ios-h{flex:0 0 100px;width:100px;min-width:100px;max-width:200px}.label-stacked.sc-ion-label-ios-h,.label-floating.sc-ion-label-ios-h{margin-bottom:0;align-self:stretch;width:auto;max-width:100%}.label-no-animate.label-floating.sc-ion-label-ios-h{transition:none}.sc-ion-label-ios-s h1,.sc-ion-label-ios-s h2,.sc-ion-label-ios-s h3,.sc-ion-label-ios-s h4,.sc-ion-label-ios-s h5,.sc-ion-label-ios-s h6{text-overflow:inherit;overflow:inherit}.ion-text-wrap.sc-ion-label-ios-h,[text-wrap].sc-ion-label-ios-h{font-size:14px;line-height:1.5}.label-stacked.sc-ion-label-ios-h{margin-bottom:4px;font-size:14px}.label-floating.sc-ion-label-ios-h{margin-bottom:0;transform:translate(0, 29px);transform-origin:left top;transition:transform 150ms ease-in-out}[dir=rtl].sc-ion-label-ios-h -no-combinator.label-floating.sc-ion-label-ios-h,[dir=rtl] .sc-ion-label-ios-h -no-combinator.label-floating.sc-ion-label-ios-h,[dir=rtl].label-floating.sc-ion-label-ios-h,[dir=rtl] .label-floating.sc-ion-label-ios-h{transform-origin:right top}.item-textarea.label-floating.sc-ion-label-ios-h,.item-textarea .label-floating.sc-ion-label-ios-h{transform:translate(0, 28px)}.item-has-focus.label-floating.sc-ion-label-ios-h,.item-has-focus .label-floating.sc-ion-label-ios-h,.item-has-placeholder.sc-ion-label-ios-h:not(.item-input).label-floating,.item-has-placeholder:not(.item-input) .label-floating.sc-ion-label-ios-h,.item-has-value.label-floating.sc-ion-label-ios-h,.item-has-value .label-floating.sc-ion-label-ios-h{transform:scale(0.82)}.sc-ion-label-ios-s h1{margin-left:0;margin-right:0;margin-top:3px;margin-bottom:2px;font-size:22px;font-weight:normal}.sc-ion-label-ios-s h2{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:17px;font-weight:normal}.sc-ion-label-ios-s h3,.sc-ion-label-ios-s h4,.sc-ion-label-ios-s h5,.sc-ion-label-ios-s h6{margin-left:0;margin-right:0;margin-top:0;margin-bottom:3px;font-size:14px;font-weight:normal;line-height:normal}.sc-ion-label-ios-s p{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:14px;line-height:normal;text-overflow:inherit;overflow:inherit}.sc-ion-label-ios-s>p{color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.4)}.sc-ion-label-ios-h.in-item-color.sc-ion-label-ios-s>p{color:inherit}.sc-ion-label-ios-s h2:last-child,.sc-ion-label-ios-s h3:last-child,.sc-ion-label-ios-s h4:last-child,.sc-ion-label-ios-s h5:last-child,.sc-ion-label-ios-s h6:last-child,.sc-ion-label-ios-s p:last-child{margin-bottom:0}",md:'.item.sc-ion-label-md-h,.item .sc-ion-label-md-h{--color:initial;display:block;color:var(--color);font-family:var(--ion-font-family, inherit);font-size:inherit;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;box-sizing:border-box}.ion-color.sc-ion-label-md-h{color:var(--ion-color-base)}.ion-text-wrap.sc-ion-label-md-h,[text-wrap].sc-ion-label-md-h{white-space:normal}.item-interactive-disabled.sc-ion-label-md-h:not(.item-multiple-inputs),.item-interactive-disabled:not(.item-multiple-inputs) .sc-ion-label-md-h{cursor:default;opacity:0.3;pointer-events:none}.item-input.sc-ion-label-md-h,.item-input .sc-ion-label-md-h{flex:initial;max-width:200px;pointer-events:none}.item-textarea.sc-ion-label-md-h,.item-textarea .sc-ion-label-md-h{align-self:baseline}.label-fixed.sc-ion-label-md-h{flex:0 0 100px;width:100px;min-width:100px;max-width:200px}.label-stacked.sc-ion-label-md-h,.label-floating.sc-ion-label-md-h{margin-bottom:0;align-self:stretch;width:auto;max-width:100%}.label-no-animate.label-floating.sc-ion-label-md-h{transition:none}.sc-ion-label-md-s h1,.sc-ion-label-md-s h2,.sc-ion-label-md-s h3,.sc-ion-label-md-s h4,.sc-ion-label-md-s h5,.sc-ion-label-md-s h6{text-overflow:inherit;overflow:inherit}.ion-text-wrap.sc-ion-label-md-h,[text-wrap].sc-ion-label-md-h{line-height:1.5}.label-stacked.sc-ion-label-md-h,.label-floating.sc-ion-label-md-h{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;transform-origin:top left}.label-stacked.label-rtl.sc-ion-label-md-h,.label-floating.label-rtl.sc-ion-label-md-h{transform-origin:top right}.label-stacked.sc-ion-label-md-h{transform:translateY(50%) scale(0.75);transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1)}.label-floating.sc-ion-label-md-h{transform:translateY(96%);transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1), transform 150ms cubic-bezier(0.4, 0, 0.2, 1)}.ion-focused.label-floating.sc-ion-label-md-h,.ion-focused .label-floating.sc-ion-label-md-h,.item-has-focus.label-floating.sc-ion-label-md-h,.item-has-focus .label-floating.sc-ion-label-md-h,.item-has-placeholder.sc-ion-label-md-h:not(.item-input).label-floating,.item-has-placeholder:not(.item-input) .label-floating.sc-ion-label-md-h,.item-has-value.label-floating.sc-ion-label-md-h,.item-has-value .label-floating.sc-ion-label-md-h{transform:translateY(50%) scale(0.75)}.item-fill-outline.ion-focused.label-floating.sc-ion-label-md-h,.item-fill-outline.ion-focused .label-floating.sc-ion-label-md-h,.item-fill-outline.item-has-focus.label-floating.sc-ion-label-md-h,.item-fill-outline.item-has-focus .label-floating.sc-ion-label-md-h,.item-fill-outline.item-has-placeholder.sc-ion-label-md-h:not(.item-input).label-floating,.item-fill-outline.item-has-placeholder:not(.item-input) .label-floating.sc-ion-label-md-h,.item-fill-outline.item-has-value.label-floating.sc-ion-label-md-h,.item-fill-outline.item-has-value .label-floating.sc-ion-label-md-h{transform:translateY(-6px) scale(0.75);position:relative;max-width:min-content;background-color:var(--ion-item-background, var(--ion-background-color, #fff));overflow:visible;z-index:3}.item-fill-outline.ion-focused.label-floating.sc-ion-label-md-h::before,.item-fill-outline.ion-focused .label-floating.sc-ion-label-md-h::before,.item-fill-outline.ion-focused.label-floating.sc-ion-label-md-h::after,.item-fill-outline.ion-focused .label-floating.sc-ion-label-md-h::after,.item-fill-outline.item-has-focus.label-floating.sc-ion-label-md-h::before,.item-fill-outline.item-has-focus .label-floating.sc-ion-label-md-h::before,.item-fill-outline.item-has-focus.label-floating.sc-ion-label-md-h::after,.item-fill-outline.item-has-focus .label-floating.sc-ion-label-md-h::after,.item-fill-outline.item-has-placeholder.sc-ion-label-md-h:not(.item-input).label-floating::before,.item-fill-outline.item-has-placeholder:not(.item-input) .label-floating.sc-ion-label-md-h::before,.item-fill-outline.item-has-placeholder.sc-ion-label-md-h:not(.item-input).label-floating::after,.item-fill-outline.item-has-placeholder:not(.item-input) .label-floating.sc-ion-label-md-h::after,.item-fill-outline.item-has-value.label-floating.sc-ion-label-md-h::before,.item-fill-outline.item-has-value .label-floating.sc-ion-label-md-h::before,.item-fill-outline.item-has-value.label-floating.sc-ion-label-md-h::after,.item-fill-outline.item-has-value .label-floating.sc-ion-label-md-h::after{position:absolute;width:4px;height:100%;background-color:var(--ion-item-background, var(--ion-background-color, #fff));content:""}.item-fill-outline.ion-focused.label-floating.sc-ion-label-md-h::before,.item-fill-outline.ion-focused .label-floating.sc-ion-label-md-h::before,.item-fill-outline.item-has-focus.label-floating.sc-ion-label-md-h::before,.item-fill-outline.item-has-focus .label-floating.sc-ion-label-md-h::before,.item-fill-outline.item-has-placeholder.sc-ion-label-md-h:not(.item-input).label-floating::before,.item-fill-outline.item-has-placeholder:not(.item-input) .label-floating.sc-ion-label-md-h::before,.item-fill-outline.item-has-value.label-floating.sc-ion-label-md-h::before,.item-fill-outline.item-has-value .label-floating.sc-ion-label-md-h::before{left:calc(-1 * 4px)}.item-fill-outline.ion-focused.label-floating.sc-ion-label-md-h::after,.item-fill-outline.ion-focused .label-floating.sc-ion-label-md-h::after,.item-fill-outline.item-has-focus.label-floating.sc-ion-label-md-h::after,.item-fill-outline.item-has-focus .label-floating.sc-ion-label-md-h::after,.item-fill-outline.item-has-placeholder.sc-ion-label-md-h:not(.item-input).label-floating::after,.item-fill-outline.item-has-placeholder:not(.item-input) .label-floating.sc-ion-label-md-h::after,.item-fill-outline.item-has-value.label-floating.sc-ion-label-md-h::after,.item-fill-outline.item-has-value .label-floating.sc-ion-label-md-h::after{right:calc(-1 * 4px)}.item-fill-outline.ion-focused.item-has-start-slot.label-floating.sc-ion-label-md-h,.item-fill-outline.ion-focused.item-has-start-slot .label-floating.sc-ion-label-md-h,.item-fill-outline.item-has-focus.item-has-start-slot.label-floating.sc-ion-label-md-h,.item-fill-outline.item-has-focus.item-has-start-slot .label-floating.sc-ion-label-md-h,.item-fill-outline.item-has-placeholder.sc-ion-label-md-h:not(.item-input).item-has-start-slot.label-floating,.item-fill-outline.item-has-placeholder:not(.item-input).item-has-start-slot .label-floating.sc-ion-label-md-h,.item-fill-outline.item-has-value.item-has-start-slot.label-floating.sc-ion-label-md-h,.item-fill-outline.item-has-value.item-has-start-slot .label-floating.sc-ion-label-md-h{transform:translateX(-32px) translateY(-6px) scale(0.75)}.item-fill-outline.ion-focused.item-has-start-slot.label-floating.label-rtl.sc-ion-label-md-h,.item-fill-outline.ion-focused.item-has-start-slot .label-floating.label-rtl.sc-ion-label-md-h,.item-fill-outline.item-has-focus.item-has-start-slot.label-floating.label-rtl.sc-ion-label-md-h,.item-fill-outline.item-has-focus.item-has-start-slot .label-floating.label-rtl.sc-ion-label-md-h,.item-fill-outline.item-has-placeholder.sc-ion-label-md-h:not(.item-input).item-has-start-slot.label-floating.label-rtl,.item-fill-outline.item-has-placeholder:not(.item-input).item-has-start-slot .label-floating.label-rtl.sc-ion-label-md-h,.item-fill-outline.item-has-value.item-has-start-slot.label-floating.label-rtl.sc-ion-label-md-h,.item-fill-outline.item-has-value.item-has-start-slot .label-floating.label-rtl.sc-ion-label-md-h{transform:translateX(calc(-1 * -32px)) translateY(-6px) scale(0.75)}.ion-focused.label-stacked.sc-ion-label-md-h:not(.ion-color),.ion-focused .label-stacked.sc-ion-label-md-h:not(.ion-color),.ion-focused.label-floating.sc-ion-label-md-h:not(.ion-color),.ion-focused .label-floating.sc-ion-label-md-h:not(.ion-color),.item-has-focus.label-stacked.sc-ion-label-md-h:not(.ion-color),.item-has-focus .label-stacked.sc-ion-label-md-h:not(.ion-color),.item-has-focus.label-floating.sc-ion-label-md-h:not(.ion-color),.item-has-focus .label-floating.sc-ion-label-md-h:not(.ion-color){color:var(--ion-color-primary, #3880ff)}.ion-focused.ion-color.label-stacked.sc-ion-label-md-h:not(.ion-color),.ion-focused.ion-color .label-stacked.sc-ion-label-md-h:not(.ion-color),.ion-focused.ion-color.label-floating.sc-ion-label-md-h:not(.ion-color),.ion-focused.ion-color .label-floating.sc-ion-label-md-h:not(.ion-color),.item-has-focus.ion-color.label-stacked.sc-ion-label-md-h:not(.ion-color),.item-has-focus.ion-color .label-stacked.sc-ion-label-md-h:not(.ion-color),.item-has-focus.ion-color.label-floating.sc-ion-label-md-h:not(.ion-color),.item-has-focus.ion-color .label-floating.sc-ion-label-md-h:not(.ion-color){color:var(--ion-color-contrast)}.item-fill-solid.ion-focused.ion-color.label-stacked.sc-ion-label-md-h:not(.ion-color),.item-fill-solid.ion-focused.ion-color .label-stacked.sc-ion-label-md-h:not(.ion-color),.item-fill-solid.ion-focused.ion-color.label-floating.sc-ion-label-md-h:not(.ion-color),.item-fill-solid.ion-focused.ion-color .label-floating.sc-ion-label-md-h:not(.ion-color),.item-fill-outline.ion-focused.ion-color.label-stacked.sc-ion-label-md-h:not(.ion-color),.item-fill-outline.ion-focused.ion-color .label-stacked.sc-ion-label-md-h:not(.ion-color),.item-fill-outline.ion-focused.ion-color.label-floating.sc-ion-label-md-h:not(.ion-color),.item-fill-outline.ion-focused.ion-color .label-floating.sc-ion-label-md-h:not(.ion-color),.item-fill-solid.item-has-focus.ion-color.label-stacked.sc-ion-label-md-h:not(.ion-color),.item-fill-solid.item-has-focus.ion-color .label-stacked.sc-ion-label-md-h:not(.ion-color),.item-fill-solid.item-has-focus.ion-color.label-floating.sc-ion-label-md-h:not(.ion-color),.item-fill-solid.item-has-focus.ion-color .label-floating.sc-ion-label-md-h:not(.ion-color),.item-fill-outline.item-has-focus.ion-color.label-stacked.sc-ion-label-md-h:not(.ion-color),.item-fill-outline.item-has-focus.ion-color .label-stacked.sc-ion-label-md-h:not(.ion-color),.item-fill-outline.item-has-focus.ion-color.label-floating.sc-ion-label-md-h:not(.ion-color),.item-fill-outline.item-has-focus.ion-color .label-floating.sc-ion-label-md-h:not(.ion-color){color:var(--ion-color-base)}.ion-invalid.ion-touched.label-stacked.sc-ion-label-md-h:not(.ion-color),.ion-invalid.ion-touched .label-stacked.sc-ion-label-md-h:not(.ion-color),.ion-invalid.ion-touched.label-floating.sc-ion-label-md-h:not(.ion-color),.ion-invalid.ion-touched .label-floating.sc-ion-label-md-h:not(.ion-color){color:var(--highlight-color-invalid)}.sc-ion-label-md-s h1{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:24px;font-weight:normal}.sc-ion-label-md-s h2{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:16px;font-weight:normal}.sc-ion-label-md-s h3,.sc-ion-label-md-s h4,.sc-ion-label-md-s h5,.sc-ion-label-md-s h6{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:14px;font-weight:normal;line-height:normal}.sc-ion-label-md-s p{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:14px;line-height:20px;text-overflow:inherit;overflow:inherit}.sc-ion-label-md-s>p{color:var(--ion-color-step-600, #666666)}.sc-ion-label-md-h.in-item-color.sc-ion-label-md-s>p{color:inherit}'};const At=class{constructor(e){t(this,e),this.inset=!1}async closeSlidingItems(){const t=this.el.querySelector("ion-item-sliding");return!!(null==t?void 0:t.closeOpened)&&t.closeOpened()}render(){const t=u(this),{lines:n,inset:r}=this;return e(i,{role:"list",class:{[t]:!0,[`list-${t}`]:!0,"list-inset":r,[`list-lines-${n}`]:void 0!==n,[`list-${t}-lines-${n}`]:void 0!==n}})}get el(){return n(this)}};At.style={ios:"ion-list{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:block;contain:content;list-style-type:none}ion-list.list-inset{transform:translateZ(0);overflow:hidden}.list-ios{background:var(--ion-item-background, var(--ion-background-color, #fff))}.list-ios.list-inset{margin-left:16px;margin-right:16px;margin-top:16px;margin-bottom:16px;border-radius:10px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.list-ios.list-inset{margin-left:unset;margin-right:unset;-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:16px;margin-inline-end:16px}}.list-ios.list-inset ion-item{--border-width:0 0 1px 0;--inner-border-width:0}.list-ios.list-inset ion-item:last-child{--border-width:0;--inner-border-width:0}.list-ios.list-inset+ion-list.list-inset{margin-top:0}.list-ios-lines-none .item{--border-width:0;--inner-border-width:0}.list-ios-lines-full .item,.list-ios .item-lines-full{--border-width:0 0 0.55px 0}.list-ios-lines-full .item{--inner-border-width:0}.list-ios-lines-inset .item,.list-ios .item-lines-inset{--inner-border-width:0 0 0.55px 0}.list-ios .item-lines-inset{--border-width:0}.list-ios .item-lines-full{--inner-border-width:0}.list-ios .item-lines-none{--border-width:0;--inner-border-width:0}ion-card .list-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}",md:"ion-list{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:block;contain:content;list-style-type:none}ion-list.list-inset{transform:translateZ(0);overflow:hidden}.list-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:8px;padding-bottom:8px;background:var(--ion-item-background, var(--ion-background-color, #fff))}.list-md>.input:last-child::after{left:0}[dir=rtl] .list-md>.input:last-child::after,:host-context([dir=rtl]) .list-md>.input:last-child::after{left:unset;right:unset;right:0}.list-md.list-inset{margin-left:16px;margin-right:16px;margin-top:16px;margin-bottom:16px;border-radius:2px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.list-md.list-inset{margin-left:unset;margin-right:unset;-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:16px;margin-inline-end:16px}}.list-md.list-inset ion-item:first-child{--border-radius:2px 2px 0 0}.list-md.list-inset ion-item:last-child{--border-radius:0 0 2px, 2px;--border-width:0;--inner-border-width:0}.list-md.list-inset .item-interactive{--padding-start:0;--padding-end:0}.list-md.list-inset+ion-list.list-inset{margin-top:0}.list-md-lines-none .item{--border-width:0;--inner-border-width:0}.list-md-lines-full .item,.list-md .item-lines-full{--border-width:0 0 1px 0}.list-md-lines-full .item{--inner-border-width:0}.list-md-lines-inset .item,.list-md .item-lines-inset{--inner-border-width:0 0 1px 0}.list-md .item-lines-inset{--border-width:0}.list-md .item-lines-full{--inner-border-width:0}.list-md .item-lines-none{--border-width:0;--inner-border-width:0}ion-card .list-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}"};const _t=class{constructor(e){t(this,e)}render(){const t=u(this);return e(i,{class:f(this.color,{[t]:!0})},e("slot",null))}};_t.style={ios:":host{color:var(--color);font-family:var(--ion-font-family, inherit);box-sizing:border-box}:host(.ion-color){color:var(--ion-color-base)}:host{--color:var(--ion-color-step-350, #a6a6a6)}",md:":host{color:var(--color);font-family:var(--ion-font-family, inherit);box-sizing:border-box}:host(.ion-color){color:var(--ion-color-base)}:host{--color:var(--ion-color-step-600, #666666);font-size:14px}"};const jt=class{constructor(e){t(this,e),this.type="determinate",this.reversed=!1,this.value=0,this.buffer=1}render(){const{color:t,type:n,reversed:r,value:o,buffer:s}=this,a=h.getBoolean("_testing"),c=u(this);return e(i,{role:"progressbar","aria-valuenow":"determinate"===n?o:null,"aria-valuemin":"0","aria-valuemax":"1",class:f(t,{[c]:!0,[`progress-bar-${n}`]:!0,"progress-paused":a,"progress-bar-reversed":"rtl"===document.dir?!r:r})},"indeterminate"===n?Ct():Rt(o,s))}},Ct=()=>e("div",{part:"track",class:"progress-buffer-bar"},e("div",{class:"indeterminate-bar-primary"},e("span",{part:"progress",class:"progress-indeterminate"})),e("div",{class:"indeterminate-bar-secondary"},e("span",{part:"progress",class:"progress-indeterminate"}))),Rt=(t,i)=>{const n=y(0,t,1),r=y(0,i,1);return[e("div",{part:"progress",class:"progress",style:{transform:`scaleX(${n})`}}),e("div",{class:{"buffer-circles-container":!0,"ion-hide":1===r},style:{transform:`translateX(${100*r}%)`}},e("div",{class:"buffer-circles-container",style:{transform:`translateX(-${100*r}%)`}},e("div",{part:"stream",class:"buffer-circles"}))),e("div",{part:"track",class:"progress-buffer-bar",style:{transform:`scaleX(${r})`}})]};jt.style={ios:":host{--background:rgba(var(--ion-color-primary-rgb, 56, 128, 255), 0.3);--progress-background:var(--ion-color-primary, #3880ff);--buffer-background:var(--background);display:block;position:relative;width:100%;contain:strict;direction:ltr;overflow:hidden}.progress,.progress-indeterminate,.indeterminate-bar-primary,.indeterminate-bar-secondary,.progress-buffer-bar{left:0;right:0;top:0;bottom:0;position:absolute;width:100%;height:100%}.buffer-circles-container,.buffer-circles{left:0;right:0;top:0;bottom:0;position:absolute}.buffer-circles{right:-10px;left:-10px;}.progress,.progress-buffer-bar,.buffer-circles-container{transform-origin:left top;transition:transform 150ms linear}.progress,.progress-indeterminate{background:var(--progress-background);z-index:2}.progress-buffer-bar{background:var(--buffer-background);z-index:1}.buffer-circles-container{overflow:hidden}.indeterminate-bar-primary{top:0;right:0;bottom:0;left:-145.166611%;animation:primary-indeterminate-translate 2s infinite linear}.indeterminate-bar-primary .progress-indeterminate{animation:primary-indeterminate-scale 2s infinite linear;animation-play-state:inherit}.indeterminate-bar-secondary{top:0;right:0;bottom:0;left:-54.888891%;animation:secondary-indeterminate-translate 2s infinite linear}.indeterminate-bar-secondary .progress-indeterminate{animation:secondary-indeterminate-scale 2s infinite linear;animation-play-state:inherit}.buffer-circles{background-image:radial-gradient(ellipse at center, var(--buffer-background) 0%, var(--buffer-background) 30%, transparent 30%);background-repeat:repeat-x;background-position:5px center;background-size:10px 10px;z-index:0;animation:buffering 450ms infinite linear}:host(.progress-bar-reversed){transform:scaleX(-1)}:host(.progress-paused) .indeterminate-bar-secondary,:host(.progress-paused) .indeterminate-bar-primary,:host(.progress-paused) .buffer-circles{animation-play-state:paused}:host(.ion-color) .progress-buffer-bar{background:rgba(var(--ion-color-base-rgb), 0.3)}:host(.ion-color) .buffer-circles{background-image:radial-gradient(ellipse at center, rgba(var(--ion-color-base-rgb), 0.3) 0%, rgba(var(--ion-color-base-rgb), 0.3) 30%, transparent 30%)}:host(.ion-color) .progress,:host(.ion-color) .progress-indeterminate{background:var(--ion-color-base)}@keyframes primary-indeterminate-translate{0%{transform:translateX(0)}20%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(0)}59.15%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(83.67142%)}100%{transform:translateX(200.611057%)}}@keyframes primary-indeterminate-scale{0%{transform:scaleX(0.08)}36.65%{animation-timing-function:cubic-bezier(0.334731, 0.12482, 0.785844, 1);transform:scaleX(0.08)}69.15%{animation-timing-function:cubic-bezier(0.06, 0.11, 0.6, 1);transform:scaleX(0.661479)}100%{transform:scaleX(0.08)}}@keyframes secondary-indeterminate-translate{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);transform:translateX(0)}25%{animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);transform:translateX(37.651913%)}48.35%{animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);transform:translateX(84.386165%)}100%{transform:translateX(160.277782%)}}@keyframes secondary-indeterminate-scale{0%{animation-timing-function:cubic-bezier(0.205028, 0.057051, 0.57661, 0.453971);transform:scaleX(0.08)}19.15%{animation-timing-function:cubic-bezier(0.152313, 0.196432, 0.648374, 1.004315);transform:scaleX(0.457104)}44.15%{animation-timing-function:cubic-bezier(0.257759, -0.003163, 0.211762, 1.38179);transform:scaleX(0.72796)}100%{transform:scaleX(0.08)}}@keyframes buffering{to{transform:translateX(-10px)}}:host{height:3px}",md:":host{--background:rgba(var(--ion-color-primary-rgb, 56, 128, 255), 0.3);--progress-background:var(--ion-color-primary, #3880ff);--buffer-background:var(--background);display:block;position:relative;width:100%;contain:strict;direction:ltr;overflow:hidden}.progress,.progress-indeterminate,.indeterminate-bar-primary,.indeterminate-bar-secondary,.progress-buffer-bar{left:0;right:0;top:0;bottom:0;position:absolute;width:100%;height:100%}.buffer-circles-container,.buffer-circles{left:0;right:0;top:0;bottom:0;position:absolute}.buffer-circles{right:-10px;left:-10px;}.progress,.progress-buffer-bar,.buffer-circles-container{transform-origin:left top;transition:transform 150ms linear}.progress,.progress-indeterminate{background:var(--progress-background);z-index:2}.progress-buffer-bar{background:var(--buffer-background);z-index:1}.buffer-circles-container{overflow:hidden}.indeterminate-bar-primary{top:0;right:0;bottom:0;left:-145.166611%;animation:primary-indeterminate-translate 2s infinite linear}.indeterminate-bar-primary .progress-indeterminate{animation:primary-indeterminate-scale 2s infinite linear;animation-play-state:inherit}.indeterminate-bar-secondary{top:0;right:0;bottom:0;left:-54.888891%;animation:secondary-indeterminate-translate 2s infinite linear}.indeterminate-bar-secondary .progress-indeterminate{animation:secondary-indeterminate-scale 2s infinite linear;animation-play-state:inherit}.buffer-circles{background-image:radial-gradient(ellipse at center, var(--buffer-background) 0%, var(--buffer-background) 30%, transparent 30%);background-repeat:repeat-x;background-position:5px center;background-size:10px 10px;z-index:0;animation:buffering 450ms infinite linear}:host(.progress-bar-reversed){transform:scaleX(-1)}:host(.progress-paused) .indeterminate-bar-secondary,:host(.progress-paused) .indeterminate-bar-primary,:host(.progress-paused) .buffer-circles{animation-play-state:paused}:host(.ion-color) .progress-buffer-bar{background:rgba(var(--ion-color-base-rgb), 0.3)}:host(.ion-color) .buffer-circles{background-image:radial-gradient(ellipse at center, rgba(var(--ion-color-base-rgb), 0.3) 0%, rgba(var(--ion-color-base-rgb), 0.3) 30%, transparent 30%)}:host(.ion-color) .progress,:host(.ion-color) .progress-indeterminate{background:var(--ion-color-base)}@keyframes primary-indeterminate-translate{0%{transform:translateX(0)}20%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(0)}59.15%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(83.67142%)}100%{transform:translateX(200.611057%)}}@keyframes primary-indeterminate-scale{0%{transform:scaleX(0.08)}36.65%{animation-timing-function:cubic-bezier(0.334731, 0.12482, 0.785844, 1);transform:scaleX(0.08)}69.15%{animation-timing-function:cubic-bezier(0.06, 0.11, 0.6, 1);transform:scaleX(0.661479)}100%{transform:scaleX(0.08)}}@keyframes secondary-indeterminate-translate{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);transform:translateX(0)}25%{animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);transform:translateX(37.651913%)}48.35%{animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);transform:translateX(84.386165%)}100%{transform:translateX(160.277782%)}}@keyframes secondary-indeterminate-scale{0%{animation-timing-function:cubic-bezier(0.205028, 0.057051, 0.57661, 0.453971);transform:scaleX(0.08)}19.15%{animation-timing-function:cubic-bezier(0.152313, 0.196432, 0.648374, 1.004315);transform:scaleX(0.457104)}44.15%{animation-timing-function:cubic-bezier(0.257759, -0.003163, 0.211762, 1.38179);transform:scaleX(0.72796)}100%{transform:scaleX(0.08)}}@keyframes buffering{to{transform:translateX(-10px)}}:host{height:4px}"};const It=class{constructor(e){t(this,e),this.type="bounded"}async addRipple(t,e){return new Promise((i=>{s((()=>{const n=this.el.getBoundingClientRect(),r=n.width,o=n.height,s=Math.sqrt(r*r+o*o),c=Math.max(o,r),l=this.unbounded?c:s+Ot,u=Math.floor(c*Pt),h=l/u;let d=t-n.left,f=e-n.top;this.unbounded&&(d=.5*r,f=.5*o);const p=d-.5*u,v=f-.5*u,g=.5*r-d,m=.5*o-f;a((()=>{const t=document.createElement("div");t.classList.add("ripple-effect");const e=t.style;e.top=v+"px",e.left=p+"px",e.width=e.height=u+"px",e.setProperty("--final-scale",`${h}`),e.setProperty("--translate-end",`${g}px, ${m}px`),(this.el.shadowRoot||this.el).appendChild(t),setTimeout((()=>{i((()=>{Tt(t)}))}),325)}))}))}))}get unbounded(){return"unbounded"===this.type}render(){const t=u(this);return e(i,{role:"presentation",class:{[t]:!0,unbounded:this.unbounded}})}get el(){return n(this)}},Tt=t=>{t.classList.add("fade-out"),setTimeout((()=>{t.remove()}),200)},Ot=10,Pt=.5;It.style=":host{left:0;right:0;top:0;bottom:0;position:absolute;contain:strict;pointer-events:none}:host(.unbounded){contain:layout size style}.ripple-effect{border-radius:50%;position:absolute;background-color:currentColor;color:inherit;contain:strict;opacity:0;animation:225ms rippleAnimation forwards, 75ms fadeInAnimation forwards;will-change:transform, opacity;pointer-events:none}.fade-out{transform:translate(var(--translate-end)) scale(var(--final-scale, 1));animation:150ms fadeOutAnimation forwards}@keyframes rippleAnimation{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:scale(1)}to{transform:translate(var(--translate-end)) scale(var(--final-scale, 1))}}@keyframes fadeInAnimation{from{animation-timing-function:linear;opacity:0}to{opacity:0.16}}@keyframes fadeOutAnimation{from{animation-timing-function:linear;opacity:0.16}to{opacity:0}}";const Nt=class{constructor(e){t(this,e)}render(){return e(i,{class:u(this)},e("slot",null))}};Nt.style=":host{display:flex;flex-wrap:wrap}";const Dt=class{constructor(e){t(this,e),this.ionInput=r(this,"ionInput",7),this.ionChange=r(this,"ionChange",7),this.ionCancel=r(this,"ionCancel",7),this.ionClear=r(this,"ionClear",7),this.ionBlur=r(this,"ionBlur",7),this.ionFocus=r(this,"ionFocus",7),this.ionStyle=r(this,"ionStyle",7),this.isCancelVisible=!1,this.shouldAlignLeft=!0,this.focused=!1,this.noAnimate=!0,this.animated=!1,this.autocomplete="off",this.autocorrect="off",this.cancelButtonIcon=h.get("backButtonIcon",I),this.cancelButtonText="Cancel",this.debounce=250,this.disabled=!1,this.placeholder="Search",this.showCancelButton="never",this.showClearButton="always",this.spellcheck=!1,this.type="search",this.value="",this.onClearInput=t=>{this.ionClear.emit(),setTimeout((()=>{""!==this.getValue()&&(this.value="",this.ionInput.emit(),t&&!this.focused&&this.setFocus())}),64)},this.onCancelSearchbar=t=>{t&&(t.preventDefault(),t.stopPropagation()),this.ionCancel.emit(),this.onClearInput(),this.nativeInput&&this.nativeInput.blur()},this.onInput=t=>{const e=t.target;e&&(this.value=e.value),this.ionInput.emit(t)},this.onBlur=()=>{this.focused=!1,this.ionBlur.emit(),this.positionElements()},this.onFocus=()=>{this.focused=!0,this.ionFocus.emit(),this.positionElements()}}debounceChanged(){this.ionChange=k(this.ionChange,this.debounce)}valueChanged(){const t=this.nativeInput,e=this.getValue();t&&t.value!==e&&(t.value=e),this.ionChange.emit({value:e})}showCancelButtonChanged(){requestAnimationFrame((()=>{this.positionElements(),o(this)}))}connectedCallback(){this.emitStyle()}componentDidLoad(){this.positionElements(),this.debounceChanged(),setTimeout((()=>{this.noAnimate=!1}),300)}emitStyle(){this.ionStyle.emit({searchbar:!0})}async setFocus(){this.nativeInput&&this.nativeInput.focus()}getInputElement(){return Promise.resolve(this.nativeInput)}positionElements(){const t=this.getValue(),e=this.shouldAlignLeft,i=u(this),n=!this.animated||""!==t.trim()||!!this.focused;this.shouldAlignLeft=n,"ios"===i&&(e!==n&&this.positionPlaceholder(),this.animated&&this.positionCancelButton())}positionPlaceholder(){const t=this.nativeInput;if(!t)return;const e=F(this.el),i=(this.el.shadowRoot||this.el).querySelector(".searchbar-search-icon");if(this.shouldAlignLeft)t.removeAttribute("style"),i.removeAttribute("style");else{const n=document,r=n.createElement("span");r.innerText=this.placeholder||"",n.body.appendChild(r),x((()=>{const n=r.offsetWidth;r.remove();const o="calc(50% - "+n/2+"px)",s="calc(50% - "+(n/2+30)+"px)";e?(t.style.paddingRight=o,i.style.marginRight=s):(t.style.paddingLeft=o,i.style.marginLeft=s)}))}}positionCancelButton(){const t=F(this.el),e=(this.el.shadowRoot||this.el).querySelector(".searchbar-cancel-button"),i=this.shouldShowCancelButton();if(null!==e&&i!==this.isCancelVisible){const n=e.style;if(this.isCancelVisible=i,i)t?n.marginLeft="0":n.marginRight="0";else{const i=e.offsetWidth;i>0&&(t?n.marginLeft=-i+"px":n.marginRight=-i+"px")}}}getValue(){return this.value||""}hasValue(){return""!==this.getValue()}shouldShowCancelButton(){return!("never"===this.showCancelButton||"focus"===this.showCancelButton&&!this.focused)}shouldShowClearButton(){return!("never"===this.showClearButton||"focus"===this.showClearButton&&!this.focused)}render(){const{cancelButtonText:t}=this,n=this.animated&&h.getBoolean("animated",!0),r=u(this),o=this.clearIcon||("ios"===r?T:O),s=this.searchIcon||("ios"===r?P:N),a=this.shouldShowCancelButton(),c="never"!==this.showCancelButton&&e("button",{"aria-label":t,"aria-hidden":a?void 0:"true",type:"button",tabIndex:"ios"!==r||a?void 0:-1,onMouseDown:this.onCancelSearchbar,onTouchStart:this.onCancelSearchbar,class:"searchbar-cancel-button"},e("div",{"aria-hidden":"true"},"md"===r?e("ion-icon",{"aria-hidden":"true",mode:r,icon:this.cancelButtonIcon,lazy:!1}):t));return e(i,{role:"search","aria-disabled":this.disabled?"true":null,class:f(this.color,{[r]:!0,"searchbar-animated":n,"searchbar-disabled":this.disabled,"searchbar-no-animate":n&&this.noAnimate,"searchbar-has-value":this.hasValue(),"searchbar-left-aligned":this.shouldAlignLeft,"searchbar-has-focus":this.focused,"searchbar-should-show-clear":this.shouldShowClearButton(),"searchbar-should-show-cancel":this.shouldShowCancelButton()})},e("div",{class:"searchbar-input-container"},e("input",{"aria-label":"search text",disabled:this.disabled,ref:t=>this.nativeInput=t,class:"searchbar-input",inputMode:this.inputmode,enterKeyHint:this.enterkeyhint,onInput:this.onInput,onBlur:this.onBlur,onFocus:this.onFocus,placeholder:this.placeholder,type:this.type,value:this.getValue(),autoComplete:this.autocomplete,autoCorrect:this.autocorrect,spellcheck:this.spellcheck}),"md"===r&&c,e("ion-icon",{"aria-hidden":"true",mode:r,icon:s,lazy:!1,class:"searchbar-search-icon"}),e("button",{"aria-label":"reset",type:"button","no-blur":!0,class:"searchbar-clear-button",onPointerDown:t=>{t.preventDefault()},onClick:()=>this.onClearInput(!0)},e("ion-icon",{"aria-hidden":"true",mode:r,icon:o,lazy:!1,class:"searchbar-clear-icon"}))),"ios"===r&&c)}get el(){return n(this)}static get watchers(){return{debounce:["debounceChanged"],value:["valueChanged"],showCancelButton:["showCancelButtonChanged"]}}};Dt.style={ios:".sc-ion-searchbar-ios-h{--placeholder-color:initial;--placeholder-font-style:initial;--placeholder-font-weight:initial;--placeholder-opacity:.5;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;align-items:center;width:100%;color:var(--color);font-family:var(--ion-font-family, inherit);box-sizing:border-box}.ion-color.sc-ion-searchbar-ios-h{color:var(--ion-color-contrast)}.ion-color.sc-ion-searchbar-ios-h .searchbar-input.sc-ion-searchbar-ios{background:var(--ion-color-base)}.ion-color.sc-ion-searchbar-ios-h .searchbar-clear-button.sc-ion-searchbar-ios,.ion-color.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios,.ion-color.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios{color:inherit}.searchbar-search-icon.sc-ion-searchbar-ios{color:var(--icon-color);pointer-events:none}.searchbar-input-container.sc-ion-searchbar-ios{display:block;position:relative;flex-shrink:1;width:100%}.searchbar-input.sc-ion-searchbar-ios{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;border-radius:var(--border-radius);display:block;width:100%;border:0;outline:none;background:var(--background);font-family:inherit;box-shadow:var(--box-shadow);box-sizing:border-box;appearance:none}.searchbar-input.sc-ion-searchbar-ios::placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-ios::-webkit-search-cancel-button,.searchbar-input.sc-ion-searchbar-ios::-ms-clear{display:none}.searchbar-cancel-button.sc-ion-searchbar-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:none;height:100%;border:0;outline:none;color:var(--cancel-button-color);cursor:pointer;appearance:none}.searchbar-cancel-button.sc-ion-searchbar-ios>div.sc-ion-searchbar-ios{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.searchbar-clear-button.sc-ion-searchbar-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:none;min-height:0;outline:none;color:var(--clear-button-color);appearance:none}.searchbar-clear-button.sc-ion-searchbar-ios:focus{opacity:0.5}.searchbar-has-value.searchbar-should-show-clear.sc-ion-searchbar-ios-h .searchbar-clear-button.sc-ion-searchbar-ios{display:block}.searchbar-disabled.sc-ion-searchbar-ios-h{cursor:default;opacity:0.4;pointer-events:none}.sc-ion-searchbar-ios-h{--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.07);--border-radius:10px;--box-shadow:none;--cancel-button-color:var(--ion-color-primary, #3880ff);--clear-button-color:var(--ion-color-step-600, #666666);--color:var(--ion-text-color, #000);--icon-color:var(--ion-color-step-600, #666666);padding-left:12px;padding-right:12px;padding-top:12px;padding-bottom:12px;height:60px;contain:strict}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.sc-ion-searchbar-ios-h{padding-left:unset;padding-right:unset;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px}}.searchbar-input-container.sc-ion-searchbar-ios{height:36px}.searchbar-search-icon.sc-ion-searchbar-ios{margin-left:calc(50% - 60px);left:5px;top:0;position:absolute;width:22px;height:100%;contain:strict}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.searchbar-search-icon.sc-ion-searchbar-ios{margin-left:unset;-webkit-margin-start:calc(50% - 60px);margin-inline-start:calc(50% - 60px)}}[dir=rtl].sc-ion-searchbar-ios .searchbar-search-icon.sc-ion-searchbar-ios,[dir=rtl].sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios,[dir=rtl] .sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios{left:unset;right:unset;right:5px}.searchbar-input.sc-ion-searchbar-ios{padding-left:28px;padding-right:28px;padding-top:0;padding-bottom:0;height:100%;font-size:17px;font-weight:400;contain:strict}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.searchbar-input.sc-ion-searchbar-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:28px;padding-inline-start:28px;-webkit-padding-end:28px;padding-inline-end:28px}}.searchbar-clear-button.sc-ion-searchbar-ios{right:0;top:0;background-position:center;position:absolute;width:30px;height:100%;border:0;background-color:transparent}[dir=rtl].sc-ion-searchbar-ios .searchbar-clear-button.sc-ion-searchbar-ios,[dir=rtl].sc-ion-searchbar-ios-h .searchbar-clear-button.sc-ion-searchbar-ios,[dir=rtl] .sc-ion-searchbar-ios-h .searchbar-clear-button.sc-ion-searchbar-ios{left:unset;right:unset;left:0}.searchbar-clear-icon.sc-ion-searchbar-ios{width:18px;height:100%}.searchbar-cancel-button.sc-ion-searchbar-ios{padding-left:8px;padding-right:0;padding-top:0;padding-bottom:0;flex-shrink:0;background-color:transparent;font-size:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.searchbar-cancel-button.sc-ion-searchbar-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:0;padding-inline-end:0}}.searchbar-left-aligned.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios{margin-left:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.searchbar-left-aligned.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios{margin-left:unset;-webkit-margin-start:0;margin-inline-start:0}}.searchbar-left-aligned.sc-ion-searchbar-ios-h .searchbar-input.sc-ion-searchbar-ios{padding-left:30px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.searchbar-left-aligned.sc-ion-searchbar-ios-h .searchbar-input.sc-ion-searchbar-ios{padding-left:unset;-webkit-padding-start:30px;padding-inline-start:30px}}.searchbar-has-focus.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios,.searchbar-should-show-cancel.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios,.searchbar-animated.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios{display:block}.searchbar-animated.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios,.searchbar-animated.sc-ion-searchbar-ios-h .searchbar-input.sc-ion-searchbar-ios{transition:all 300ms ease}.searchbar-animated.searchbar-has-focus.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios,.searchbar-animated.searchbar-should-show-cancel.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios{opacity:1;pointer-events:auto}.searchbar-animated.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios{margin-right:-100%;transform:translate3d(0, 0, 0);transition:all 300ms ease;opacity:0;pointer-events:none}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.searchbar-animated.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios{margin-right:unset;-webkit-margin-end:-100%;margin-inline-end:-100%}}.searchbar-no-animate.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios,.searchbar-no-animate.sc-ion-searchbar-ios-h .searchbar-input.sc-ion-searchbar-ios,.searchbar-no-animate.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios{transition-duration:0ms}.ion-color.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios{color:var(--ion-color-base)}@media (any-hover: hover){.ion-color.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios:hover{color:var(--ion-color-tint)}}ion-toolbar.sc-ion-searchbar-ios-h,ion-toolbar .sc-ion-searchbar-ios-h{padding-top:1px;padding-bottom:15px;height:52px}ion-toolbar.ion-color.sc-ion-searchbar-ios-h:not(.ion-color),ion-toolbar.ion-color .sc-ion-searchbar-ios-h:not(.ion-color){color:inherit}ion-toolbar.ion-color.sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-cancel-button.sc-ion-searchbar-ios,ion-toolbar.ion-color .sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-cancel-button.sc-ion-searchbar-ios{color:currentColor}ion-toolbar.ion-color.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios,ion-toolbar.ion-color .sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios{color:currentColor;opacity:0.5}ion-toolbar.ion-color.sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-input.sc-ion-searchbar-ios,ion-toolbar.ion-color .sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-input.sc-ion-searchbar-ios{background:rgba(var(--ion-color-contrast-rgb), 0.07);color:currentColor}ion-toolbar.ion-color.sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-clear-button.sc-ion-searchbar-ios,ion-toolbar.ion-color .sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-clear-button.sc-ion-searchbar-ios{color:currentColor;opacity:0.5}",md:".sc-ion-searchbar-md-h{--placeholder-color:initial;--placeholder-font-style:initial;--placeholder-font-weight:initial;--placeholder-opacity:.5;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;align-items:center;width:100%;color:var(--color);font-family:var(--ion-font-family, inherit);box-sizing:border-box}.ion-color.sc-ion-searchbar-md-h{color:var(--ion-color-contrast)}.ion-color.sc-ion-searchbar-md-h .searchbar-input.sc-ion-searchbar-md{background:var(--ion-color-base)}.ion-color.sc-ion-searchbar-md-h .searchbar-clear-button.sc-ion-searchbar-md,.ion-color.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md,.ion-color.sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md{color:inherit}.searchbar-search-icon.sc-ion-searchbar-md{color:var(--icon-color);pointer-events:none}.searchbar-input-container.sc-ion-searchbar-md{display:block;position:relative;flex-shrink:1;width:100%}.searchbar-input.sc-ion-searchbar-md{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;border-radius:var(--border-radius);display:block;width:100%;border:0;outline:none;background:var(--background);font-family:inherit;box-shadow:var(--box-shadow);box-sizing:border-box;appearance:none}.searchbar-input.sc-ion-searchbar-md::placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-md::-webkit-search-cancel-button,.searchbar-input.sc-ion-searchbar-md::-ms-clear{display:none}.searchbar-cancel-button.sc-ion-searchbar-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:none;height:100%;border:0;outline:none;color:var(--cancel-button-color);cursor:pointer;appearance:none}.searchbar-cancel-button.sc-ion-searchbar-md>div.sc-ion-searchbar-md{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.searchbar-clear-button.sc-ion-searchbar-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:none;min-height:0;outline:none;color:var(--clear-button-color);appearance:none}.searchbar-clear-button.sc-ion-searchbar-md:focus{opacity:0.5}.searchbar-has-value.searchbar-should-show-clear.sc-ion-searchbar-md-h .searchbar-clear-button.sc-ion-searchbar-md{display:block}.searchbar-disabled.sc-ion-searchbar-md-h{cursor:default;opacity:0.4;pointer-events:none}.sc-ion-searchbar-md-h{--background:var(--ion-background-color, #fff);--border-radius:2px;--box-shadow:0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12);--cancel-button-color:var(--ion-color-step-900, #1a1a1a);--clear-button-color:initial;--color:var(--ion-color-step-850, #262626);--icon-color:var(--ion-color-step-600, #666666);padding-left:8px;padding-right:8px;padding-top:8px;padding-bottom:8px;background:inherit}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.sc-ion-searchbar-md-h{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px}}.searchbar-search-icon.sc-ion-searchbar-md{left:16px;top:11px;width:21px;height:21px}[dir=rtl].sc-ion-searchbar-md .searchbar-search-icon.sc-ion-searchbar-md,[dir=rtl].sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md,[dir=rtl] .sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md{left:unset;right:unset;right:16px}.searchbar-cancel-button.sc-ion-searchbar-md{left:5px;top:0;background-color:transparent;font-size:1.6em}[dir=rtl].sc-ion-searchbar-md .searchbar-cancel-button.sc-ion-searchbar-md,[dir=rtl].sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md,[dir=rtl] .sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md{left:unset;right:unset;right:5px}.searchbar-search-icon.sc-ion-searchbar-md,.searchbar-cancel-button.sc-ion-searchbar-md{position:absolute}.searchbar-search-icon.ion-activated.sc-ion-searchbar-md,.searchbar-cancel-button.ion-activated.sc-ion-searchbar-md{background-color:transparent}.searchbar-input.sc-ion-searchbar-md{padding-left:55px;padding-right:55px;padding-top:6px;padding-bottom:6px;background-position:left 8px center;height:auto;font-size:16px;font-weight:400;line-height:30px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.searchbar-input.sc-ion-searchbar-md{padding-left:unset;padding-right:unset;-webkit-padding-start:55px;padding-inline-start:55px;-webkit-padding-end:55px;padding-inline-end:55px}}[dir=rtl].sc-ion-searchbar-md .searchbar-input.sc-ion-searchbar-md,[dir=rtl].sc-ion-searchbar-md-h .searchbar-input.sc-ion-searchbar-md,[dir=rtl] .sc-ion-searchbar-md-h .searchbar-input.sc-ion-searchbar-md{background-position:right 8px center}.searchbar-clear-button.sc-ion-searchbar-md{right:13px;top:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;position:absolute;height:100%;border:0;background-color:transparent}[dir=rtl].sc-ion-searchbar-md .searchbar-clear-button.sc-ion-searchbar-md,[dir=rtl].sc-ion-searchbar-md-h .searchbar-clear-button.sc-ion-searchbar-md,[dir=rtl] .sc-ion-searchbar-md-h .searchbar-clear-button.sc-ion-searchbar-md{left:unset;right:unset;left:13px}.searchbar-clear-button.ion-activated.sc-ion-searchbar-md{background-color:transparent}.searchbar-clear-icon.sc-ion-searchbar-md{width:22px;height:100%}.searchbar-has-focus.sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md{display:block}.searchbar-has-focus.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md,.searchbar-should-show-cancel.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md{display:block}.searchbar-has-focus.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md+.searchbar-search-icon.sc-ion-searchbar-md,.searchbar-should-show-cancel.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md+.searchbar-search-icon.sc-ion-searchbar-md{display:none}ion-toolbar.sc-ion-searchbar-md-h,ion-toolbar .sc-ion-searchbar-md-h{padding-left:7px;padding-right:7px;padding-top:3px;padding-bottom:3px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){ion-toolbar.sc-ion-searchbar-md-h,ion-toolbar .sc-ion-searchbar-md-h{padding-left:unset;padding-right:unset;-webkit-padding-start:7px;padding-inline-start:7px;-webkit-padding-end:7px;padding-inline-end:7px}}"};const Mt=class{constructor(e){t(this,e),this.animated=!1}render(){const t=this.animated&&h.getBoolean("animated",!0),n=v("ion-avatar",this.el)||v("ion-thumbnail",this.el),r=u(this);return e(i,{class:{[r]:!0,"skeleton-text-animated":t,"in-media":n}},e("span",null," "))}get el(){return n(this)}};Mt.style=":host{--background:rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.065);border-radius:var(--border-radius, inherit);display:block;width:100%;height:inherit;margin-top:4px;margin-bottom:4px;background:var(--background);line-height:10px;user-select:none;pointer-events:none}span{display:inline-block}:host(.in-media){margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;height:100%}:host(.skeleton-text-animated){position:relative;background:linear-gradient(to right, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.065) 8%, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.135) 18%, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.065) 33%);background-size:800px 104px;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:infinite;animation-name:shimmer;animation-timing-function:linear}@keyframes shimmer{0%{background-position:-400px 0}100%{background-position:400px 0}}";const Ut=class{constructor(e){t(this,e),this.ionStyle=r(this,"ionStyle",7)}sizeChanged(){this.emitStyle()}connectedCallback(){this.emitStyle()}emitStyle(){const t=this.getSize();this.ionStyle.emit({[`title-${t}`]:!0})}getSize(){return void 0!==this.size?this.size:"default"}render(){const t=u(this),n=this.getSize();return e(i,{class:f(this.color,{[t]:!0,[`title-${n}`]:!0,"title-rtl":"rtl"===document.dir})},e("div",{class:"toolbar-title"},e("slot",null)))}get el(){return n(this)}static get watchers(){return{size:["sizeChanged"]}}};Ut.style={ios:":host{--color:initial;display:flex;flex:1;align-items:center;transform:translateZ(0);color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}.toolbar-title{display:block;width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;pointer-events:auto}:host(.title-small) .toolbar-title{white-space:normal}:host{left:0;top:0;padding-left:90px;padding-right:90px;padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);position:absolute;width:100%;height:100%;transform:translateZ(0);font-size:17px;font-weight:600;text-align:center;box-sizing:border-box;pointer-events:none}:host-context([dir=rtl]){left:unset;right:unset;right:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:90px;padding-inline-start:90px;-webkit-padding-end:90px;padding-inline-end:90px}}:host(.title-small){padding-left:9px;padding-right:9px;padding-top:6px;padding-bottom:16px;position:relative;font-size:13px;font-weight:normal}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.title-small){padding-left:unset;padding-right:unset;-webkit-padding-start:9px;padding-inline-start:9px;-webkit-padding-end:9px;padding-inline-end:9px}}:host(.title-large){padding-left:16px;padding-right:16px;padding-top:0;padding-bottom:0;transform-origin:left center;bottom:0;align-items:flex-end;min-width:100%;padding-bottom:6px;font-size:34px;font-weight:700;text-align:start}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.title-large){padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}:host(.title-large.title-rtl){transform-origin:right center}:host(.title-large.ion-cloned-element){--color:var(--ion-text-color, #000)}:host(.title-large) .toolbar-title{transform-origin:inherit}:host-context([dir=rtl]):host(.title-large) .toolbar-title,:host-context([dir=rtl]).title-large .toolbar-title{transform-origin:calc(100% - inherit)}",md:":host{--color:initial;display:flex;flex:1;align-items:center;transform:translateZ(0);color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}.toolbar-title{display:block;width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;pointer-events:auto}:host(.title-small) .toolbar-title{white-space:normal}:host{padding-left:20px;padding-right:20px;padding-top:0;padding-bottom:0;font-size:20px;font-weight:500;letter-spacing:0.0125em}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:20px;padding-inline-end:20px}}:host(.title-small){width:100%;height:100%;font-size:15px;font-weight:normal}"};const Lt=class{constructor(e){t(this,e),this.childrenStyles=new Map}componentWillLoad(){const t=Array.from(this.el.querySelectorAll("ion-buttons")),e=t.find((t=>"start"===t.slot));e&&e.classList.add("buttons-first-slot");const i=t.reverse(),n=i.find((t=>"end"===t.slot))||i.find((t=>"primary"===t.slot))||i.find((t=>"secondary"===t.slot));n&&n.classList.add("buttons-last-slot")}childrenStyle(t){t.stopPropagation();const e=t.target.tagName,i=t.detail,n={},r=this.childrenStyles.get(e)||{};let s=!1;Object.keys(i).forEach((t=>{const e=`toolbar-${t}`,o=i[t];o!==r[e]&&(s=!0),o&&(n[e]=!0)})),s&&(this.childrenStyles.set(e,n),o(this))}render(){const t=u(this),n={};return this.childrenStyles.forEach((t=>{Object.assign(n,t)})),e(i,{class:Object.assign(Object.assign({},n),f(this.color,{[t]:!0,"in-toolbar":v("ion-toolbar",this.el)}))},e("div",{class:"toolbar-background"}),e("div",{class:"toolbar-container"},e("slot",{name:"start"}),e("slot",{name:"secondary"}),e("div",{class:"toolbar-content"},e("slot",null)),e("slot",{name:"primary"}),e("slot",{name:"end"})))}get el(){return n(this)}};Lt.style={ios:":host{--border-width:0;--border-style:solid;--opacity:1;--opacity-scale:1;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;padding-left:var(--ion-safe-area-left);padding-right:var(--ion-safe-area-right);display:block;position:relative;width:100%;color:var(--color);font-family:var(--ion-font-family, inherit);contain:content;z-index:10;box-sizing:border-box}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-safe-area-left);padding-inline-start:var(--ion-safe-area-left);-webkit-padding-end:var(--ion-safe-area-right);padding-inline-end:var(--ion-safe-area-right)}}:host(.ion-color){color:var(--ion-color-contrast)}:host(.ion-color) .toolbar-background{background:var(--ion-color-base)}.toolbar-container{padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:flex;position:relative;flex-direction:row;align-items:center;justify-content:space-between;width:100%;min-height:var(--min-height);contain:content;overflow:hidden;z-index:10;box-sizing:border-box}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.toolbar-container{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.toolbar-background{left:0;right:0;top:0;bottom:0;position:absolute;transform:translateZ(0);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);contain:strict;opacity:calc(var(--opacity) * var(--opacity-scale));z-index:-1;pointer-events:none}::slotted(ion-progress-bar){left:0;right:0;bottom:0;position:absolute}:host{--background:var(--ion-toolbar-background, var(--ion-color-step-50, #f7f7f7));--color:var(--ion-toolbar-color, var(--ion-text-color, #000));--border-color:var(--ion-toolbar-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.2))));--padding-top:3px;--padding-bottom:3px;--padding-start:4px;--padding-end:4px;--min-height:44px}.toolbar-content{flex:1;order:4;min-width:0}:host(.toolbar-segment) .toolbar-content{display:inline-flex}:host(.toolbar-searchbar) .toolbar-container{padding-top:0;padding-bottom:0}:host(.toolbar-searchbar) ::slotted(*){align-self:start}:host(.toolbar-searchbar) ::slotted(ion-chip){margin-top:3px}:host(.toolbar-searchbar) ::slotted(ion-back-button){height:38px}::slotted(ion-buttons){min-height:38px}::slotted([slot=start]){order:2}::slotted([slot=secondary]){order:3}::slotted([slot=primary]){order:5;text-align:end}::slotted([slot=end]){order:6;text-align:end}:host(.toolbar-title-large) .toolbar-container{flex-wrap:wrap;align-items:flex-start}:host(.toolbar-title-large) .toolbar-content ion-title{flex:1;order:8;min-width:100%}",md:":host{--border-width:0;--border-style:solid;--opacity:1;--opacity-scale:1;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;padding-left:var(--ion-safe-area-left);padding-right:var(--ion-safe-area-right);display:block;position:relative;width:100%;color:var(--color);font-family:var(--ion-font-family, inherit);contain:content;z-index:10;box-sizing:border-box}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-safe-area-left);padding-inline-start:var(--ion-safe-area-left);-webkit-padding-end:var(--ion-safe-area-right);padding-inline-end:var(--ion-safe-area-right)}}:host(.ion-color){color:var(--ion-color-contrast)}:host(.ion-color) .toolbar-background{background:var(--ion-color-base)}.toolbar-container{padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:flex;position:relative;flex-direction:row;align-items:center;justify-content:space-between;width:100%;min-height:var(--min-height);contain:content;overflow:hidden;z-index:10;box-sizing:border-box}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.toolbar-container{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.toolbar-background{left:0;right:0;top:0;bottom:0;position:absolute;transform:translateZ(0);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);contain:strict;opacity:calc(var(--opacity) * var(--opacity-scale));z-index:-1;pointer-events:none}::slotted(ion-progress-bar){left:0;right:0;bottom:0;position:absolute}:host{--background:var(--ion-toolbar-background, var(--ion-background-color, #fff));--color:var(--ion-toolbar-color, var(--ion-text-color, #424242));--border-color:var(--ion-toolbar-border-color, var(--ion-border-color, var(--ion-color-step-150, #c1c4cd)));--padding-top:0;--padding-bottom:0;--padding-start:0;--padding-end:0;--min-height:56px}.toolbar-content{flex:1;order:3;min-width:0;max-width:100%}::slotted(.buttons-first-slot){margin-left:4px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(.buttons-first-slot){margin-left:unset;-webkit-margin-start:4px;margin-inline-start:4px}}::slotted(.buttons-last-slot){margin-right:4px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(.buttons-last-slot){margin-right:unset;-webkit-margin-end:4px;margin-inline-end:4px}}::slotted([slot=start]){order:2}::slotted([slot=secondary]){order:4}::slotted([slot=primary]){order:5;text-align:end}::slotted([slot=end]){order:6;text-align:end}"};const Bt=t=>!("isConnected"in t)||t.isConnected,Jt=(()=>{let t;return(...e)=>{t&&clearTimeout(t),t=setTimeout((()=>{t=0,(t=>{for(let e of t.keys())t.set(e,t.get(e).filter(Bt))})(...e)}),2e3)}})(),$t=t=>"function"==typeof t?t():t,zt=(()=>{const t=((t,e=((t,e)=>t!==e))=>{const i=$t(t);let n=new Map(Object.entries(null!=i?i:{}));const r={dispose:[],get:[],set:[],reset:[]},o=()=>{var e;n=new Map(Object.entries(null!==(e=$t(t))&&void 0!==e?e:{})),r.reset.forEach((t=>t()))},s=t=>(r.get.forEach((e=>e(t))),n.get(t)),a=(t,i)=>{const o=n.get(t);e(i,o,t)&&(n.set(t,i),r.set.forEach((e=>e(t,i,o))))},c="undefined"==typeof Proxy?{}:new Proxy(i,{get:(t,e)=>s(e),ownKeys:()=>Array.from(n.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(t,e)=>n.has(e),set:(t,e,i)=>(a(e,i),!0)}),l=(t,e)=>(r[t].push(e),()=>{((t,e)=>{const i=t.indexOf(e);i>=0&&(t[i]=t[t.length-1],t.length--)})(r[t],e)});return{state:c,get:s,set:a,on:l,onChange:(e,i)=>{const n=l("set",((t,n)=>{t===e&&i(n)})),r=l("reset",(()=>i($t(t)[e])));return()=>{n(),r()}},use:(...t)=>{const e=t.reduce(((t,e)=>(e.set&&t.push(l("set",e.set)),e.get&&t.push(l("get",e.get)),e.reset&&t.push(l("reset",e.reset)),e.dispose&&t.push(l("dispose",e.dispose)),t)),[]);return()=>e.forEach((t=>t()))},dispose:()=>{r.dispose.forEach((t=>t())),o()},reset:o,forceUpdate:t=>{const e=n.get(t);r.set.forEach((i=>i(t,e,e)))}}})({getIdpUrl:()=>prompt("Please enter your Identity Provider URL","http://localhost:3000"),isLoggedIn:!1,webId:""},void 0);return t.use((()=>{if("function"!=typeof l)return{};const t=new Map;return{dispose:()=>t.clear(),get:e=>{const i=l();i&&((t,e,i)=>{const n=t.get(e);n?n.includes(i)||n.push(i):t.set(e,[i])})(t,e,i)},set:e=>{const i=t.get(e);i&&t.set(e,i.filter(o)),Jt(t)},reset:()=>{t.forEach((t=>t.forEach(o))),Jt(t)}}})()),t})();var Ht,Kt,Wt,qt,Vt,Gt,Xt=Object.create,Yt=Object.defineProperty,Zt=Object.defineProperties,Qt=Object.getOwnPropertyDescriptor,te=Object.getOwnPropertyDescriptors,ee=Object.getOwnPropertyNames,ie=Object.getOwnPropertySymbols,ne=Object.getPrototypeOf,re=Object.prototype.hasOwnProperty,oe=Object.prototype.propertyIsEnumerable,se=(t,e,i)=>e in t?Yt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,ae=(t,e)=>{for(var i in e||={})re.call(e,i)&&se(t,i,e[i]);if(ie)for(var i of ie(e))oe.call(e,i)&&se(t,i,e[i]);return t},ce=(t,e)=>Zt(t,te(e)),le=(t,e)=>function(){return t&&(e=(0,t[ee(t)[0]])(t=0)),e},ue=(t,e)=>function(){return e||(0,t[ee(t)[0]])((e={exports:{}}).exports,e),e.exports},he=(t,e)=>{for(var i in e)Yt(t,i,{get:e[i],enumerable:!0})},de=(t,e,i,n)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let r of ee(e))re.call(t,r)||r===i||Yt(t,r,{get:()=>e[r],enumerable:!(n=Qt(e,r))||n.enumerable});return t},fe=(t,e,i)=>(i=null!=t?Xt(ne(t)):{},de(!e&&t&&t.__esModule?i:Yt(i,"default",{value:t,enumerable:!0}),t)),pe=(t,e,i)=>new Promise(((n,r)=>{var o=t=>{try{a(i.next(t))}catch(t){r(t)}},s=t=>{try{a(i.throw(t))}catch(t){r(t)}},a=t=>t.done?n(t.value):Promise.resolve(t.value).then(o,s);a((i=i.apply(t,e)).next())})),ve=ue({"../node_modules/events/events.js"(t,e){var i,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(t,e,i){return Function.prototype.apply.call(t,e,i)};i=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(t,e){return new Promise((function(i,n){function r(i){t.removeListener(e,o),n(i)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",r),i([].slice.call(arguments))}g(t,e,o,{once:!0}),"error"!==e&&function(t,e){"function"==typeof t.on&&g(t,"error",e,{once:!0})}(t,r)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function c(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function l(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function u(t,e,i,n){var r,o,s;if(c(i),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,i.listener?i.listener:i),o=t._events),s=o[e]),void 0===s)s=o[e]=i,++t._eventsCount;else if("function"==typeof s?s=o[e]=n?[i,s]:[s,i]:n?s.unshift(i):s.push(i),(r=l(t))>0&&s.length>r&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,console&&console.warn&&console.warn(a)}return t}function h(){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(t,e,i){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},r=h.bind(n);return r.listener=i,n.wrapFn=r,r}function f(t,e,i){var n=t._events;if(void 0===n)return[];var r=n[e];return void 0===r?[]:"function"==typeof r?i?[r.listener||r]:[r]:i?function(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}(r):v(r,r.length)}function p(t){var e=this._events;if(void 0!==e){var i=e[t];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function v(t,e){for(var i=new Array(e),n=0;n<e;++n)i[n]=t[n];return i}function g(t,e,i,n){if("function"==typeof t.on)n.once?t.once(e,i):t.on(e,i);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function r(o){n.once&&t.removeEventListener(e,r),i(o)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");a=t}}),s.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},s.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},s.prototype.getMaxListeners=function(){return l(this)},s.prototype.emit=function(t){for(var e=[],i=1;i<arguments.length;i++)e.push(arguments[i]);var n="error"===t,o=this._events;if(void 0!==o)n=n&&void 0===o.error;else if(!n)return!1;if(n){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[t];if(void 0===c)return!1;if("function"==typeof c)r(c,this,e);else{var l=c.length,u=v(c,l);for(i=0;i<l;++i)r(u[i],this,e)}return!0},s.prototype.on=s.prototype.addListener=function(t,e){return u(this,t,e,!1)},s.prototype.prependListener=function(t,e){return u(this,t,e,!0)},s.prototype.once=function(t,e){return c(e),this.on(t,d(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){return c(e),this.prependListener(t,d(this,t,e)),this},s.prototype.off=s.prototype.removeListener=function(t,e){var i,n,r,o,s;if(c(e),void 0===(n=this._events))return this;if(void 0===(i=n[t]))return this;if(i===e||i.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,i.listener||e));else if("function"!=typeof i){for(r=-1,o=i.length-1;o>=0;o--)if(i[o]===e||i[o].listener===e){s=i[o].listener,r=o;break}if(r<0)return this;0===r?i.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(i,r),1===i.length&&(n[t]=i[0]),void 0!==n.removeListener&&this.emit("removeListener",t,s||e)}return this},s.prototype.removeAllListeners=function(t){var e,i,n;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete i[t]),this;if(0===arguments.length){var r,o=Object.keys(i);for(n=0;n<o.length;++n)"removeListener"!==(r=o[n])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=i[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},s.prototype.listeners=function(t){return f(this,t,!0)},s.prototype.rawListeners=function(t){return f(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}}}),ge=ue({"../node_modules/cross-fetch/dist/browser-ponyfill.js"(t,e){var i,n="undefined"!=typeof self?self:t,r=function(){function t(){this.fetch=!1,this.DOMException=n.DOMException}return t.prototype=n,new t}();i=r,function(t){var e="URLSearchParams"in i,n="Symbol"in i&&"iterator"in Symbol,r="FileReader"in i&&"Blob"in i&&function(){try{return new Blob,!0}catch(t){return!1}}(),o="FormData"in i,s="ArrayBuffer"in i;if(s)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(t){return t&&a.indexOf(Object.prototype.toString.call(t))>-1};function l(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function u(t){return"string"!=typeof t&&(t=String(t)),t}function h(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return n&&(e[Symbol.iterator]=function(){return e}),e}function d(t){this.map={},t instanceof d?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function f(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function p(t){return new Promise((function(e,i){t.onload=function(){e(t.result)},t.onerror=function(){i(t.error)}}))}function v(t){var e=new FileReader,i=p(e);return e.readAsArrayBuffer(t),i}function g(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(t){var i;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:r&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:e&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():s&&r&&(i=t)&&DataView.prototype.isPrototypeOf(i)?(this._bodyArrayBuffer=g(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(t)||c(t))?this._bodyArrayBuffer=g(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):e&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r&&(this.blob=function(){var t=f(this);if(t)return t;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(v)}),this.text=function(){var t,e,i,n=f(this);if(n)return n;if(this._bodyBlob)return t=this._bodyBlob,i=p(e=new FileReader),e.readAsText(t),i;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),i=new Array(e.length),n=0;n<e.length;n++)i[n]=String.fromCharCode(e[n]);return i.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(y)}),this.json=function(){return this.text().then(JSON.parse)},this}d.prototype.append=function(t,e){t=l(t),e=u(e);var i=this.map[t];this.map[t]=i?i+", "+e:e},d.prototype.delete=function(t){delete this.map[l(t)]},d.prototype.get=function(t){return t=l(t),this.has(t)?this.map[t]:null},d.prototype.has=function(t){return this.map.hasOwnProperty(l(t))},d.prototype.set=function(t,e){this.map[l(t)]=u(e)},d.prototype.forEach=function(t,e){for(var i in this.map)this.map.hasOwnProperty(i)&&t.call(e,this.map[i],i,this)},d.prototype.keys=function(){var t=[];return this.forEach((function(e,i){t.push(i)})),h(t)},d.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),h(t)},d.prototype.entries=function(){var t=[];return this.forEach((function(e,i){t.push([i,e])})),h(t)},n&&(d.prototype[Symbol.iterator]=d.prototype.entries);var w=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(t,e){var i,n,r=(e=e||{}).body;if(t instanceof b){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new d(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,r||null==t._bodyInit||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new d(e.headers)),this.method=(n=(i=e.method||this.method||"GET").toUpperCase(),w.indexOf(n)>-1?n:i),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function y(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var i=t.split("="),n=i.shift().replace(/\+/g," "),r=i.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(r))}})),e}function x(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new d(e.headers),this.url=e.url||"",this._initBody(t)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},m.call(b.prototype),m.call(x.prototype),x.prototype.clone=function(){return new x(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},x.error=function(){var t=new x(null,{status:0,statusText:""});return t.type="error",t};var k=[301,302,303,307,308];x.redirect=function(t,e){if(-1===k.indexOf(e))throw new RangeError("Invalid status code");return new x(null,{status:e,headers:{location:t}})},t.DOMException=i.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(t,e){this.message=t,this.name=e;var i=Error(t);this.stack=i.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function E(e,i){return new Promise((function(n,o){var s=new b(e,i);if(s.signal&&s.signal.aborted)return o(new t.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function c(){a.abort()}a.onload=function(){var t,e,i={status:a.status,statusText:a.statusText,headers:(t=a.getAllResponseHeaders()||"",e=new d,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var i=t.split(":"),n=i.shift().trim();if(n){var r=i.join(":").trim();e.append(n,r)}})),e)};i.url="responseURL"in a?a.responseURL:i.headers.get("X-Request-URL"),n(new x("response"in a?a.response:a.responseText,i))},a.onerror=function(){o(new TypeError("Network request failed"))},a.ontimeout=function(){o(new TypeError("Network request failed"))},a.onabort=function(){o(new t.DOMException("Aborted","AbortError"))},a.open(s.method,s.url,!0),"include"===s.credentials?a.withCredentials=!0:"omit"===s.credentials&&(a.withCredentials=!1),"responseType"in a&&r&&(a.responseType="blob"),s.headers.forEach((function(t,e){a.setRequestHeader(e,t)})),s.signal&&(s.signal.addEventListener("abort",c),a.onreadystatechange=function(){4===a.readyState&&s.signal.removeEventListener("abort",c)}),a.send(void 0===s._bodyInit?null:s._bodyInit)}))}E.polyfill=!0,i.fetch||(i.fetch=E,i.Headers=d,i.Request=b,i.Response=x),t.Headers=d,t.Request=b,t.Response=x,t.fetch=E,Object.defineProperty(t,"__esModule",{value:!0})}({}),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var o=r;(t=o.fetch).default=o.fetch,t.fetch=o.fetch,t.Headers=o.Headers,t.Request=o.Request,t.Response=o.Response,e.exports=t}}),me=le({"../node_modules/jose/dist/browser/runtime/webcrypto.js"(){Ht=crypto,Kt=t=>t instanceof CryptoKey}}),we=le({"../node_modules/jose/dist/browser/runtime/digest.js"(){me(),Wt=async(t,e)=>{const i=`SHA-${t.slice(-3)}`;return new Uint8Array(await Ht.subtle.digest(i,e))}}});function be(...t){const e=t.reduce(((t,{length:e})=>t+e),0),i=new Uint8Array(e);let n=0;return t.forEach((t=>{i.set(t,n),n+=t.length})),i}function ye(t,e,i){if(e<0||e>=Gt)throw new RangeError(`value must be >= 0 and <= ${Gt-1}. Received ${e}`);t.set([e>>>24,e>>>16,e>>>8,255&e],i)}function xe(t){const e=Math.floor(t/Gt),i=t%Gt,n=new Uint8Array(8);return ye(n,e,0),ye(n,i,4),n}function ke(t){const e=new Uint8Array(4);return ye(e,t),e}function Ee(t){return be(ke(t.length),t)}var Se,Fe,Ae,_e,je,Ce,Re,Ie,Te,Oe,Pe,Ne,De,Me,Ue,Le,Be,Je,$e,ze=le({"../node_modules/jose/dist/browser/lib/buffer_utils.js"(){we(),qt=new TextEncoder,Vt=new TextDecoder,Gt=2**32}}),He=le({"../node_modules/jose/dist/browser/runtime/base64url.js"(){ze(),Se=t=>{let e=t;"string"==typeof e&&(e=qt.encode(e));const i=[];for(let t=0;t<e.length;t+=32768)i.push(String.fromCharCode.apply(null,e.subarray(t,t+32768)));return btoa(i.join(""))},Fe=t=>Se(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),Ae=t=>{const e=atob(t),i=new Uint8Array(e.length);for(let t=0;t<e.length;t++)i[t]=e.charCodeAt(t);return i},_e=t=>{let e=t;e instanceof Uint8Array&&(e=Vt.decode(e)),e=e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return Ae(e)}catch(t){throw new TypeError("The input to be decoded is not correctly encoded.")}}}}),Ke={};he(Ke,{JOSEAlgNotAllowed:()=>Ie,JOSEError:()=>je,JOSENotSupported:()=>Te,JWEDecryptionFailed:()=>Oe,JWEInvalid:()=>Pe,JWKInvalid:()=>Me,JWKSInvalid:()=>Ue,JWKSMultipleMatchingKeys:()=>Be,JWKSNoMatchingKey:()=>Le,JWKSTimeout:()=>Je,JWSInvalid:()=>Ne,JWSSignatureVerificationFailed:()=>$e,JWTClaimValidationFailed:()=>Ce,JWTExpired:()=>Re,JWTInvalid:()=>De});var We,qe,Ve=le({"../node_modules/jose/dist/browser/util/errors.js"(){je=class extends Error{static get code(){return"ERR_JOSE_GENERIC"}constructor(t){var e;super(t),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,null===(e=Error.captureStackTrace)||void 0===e||e.call(Error,this,this.constructor)}},Ce=class extends je{static get code(){return"ERR_JWT_CLAIM_VALIDATION_FAILED"}constructor(t,e="unspecified",i="unspecified"){super(t),this.code="ERR_JWT_CLAIM_VALIDATION_FAILED",this.claim=e,this.reason=i}},Re=class extends je{static get code(){return"ERR_JWT_EXPIRED"}constructor(t,e="unspecified",i="unspecified"){super(t),this.code="ERR_JWT_EXPIRED",this.claim=e,this.reason=i}},Ie=class extends je{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}static get code(){return"ERR_JOSE_ALG_NOT_ALLOWED"}},Te=class extends je{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}static get code(){return"ERR_JOSE_NOT_SUPPORTED"}},Oe=class extends je{constructor(){super(...arguments),this.code="ERR_JWE_DECRYPTION_FAILED",this.message="decryption operation failed"}static get code(){return"ERR_JWE_DECRYPTION_FAILED"}},Pe=class extends je{constructor(){super(...arguments),this.code="ERR_JWE_INVALID"}static get code(){return"ERR_JWE_INVALID"}},Ne=class extends je{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}static get code(){return"ERR_JWS_INVALID"}},De=class extends je{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}static get code(){return"ERR_JWT_INVALID"}},Me=class extends je{constructor(){super(...arguments),this.code="ERR_JWK_INVALID"}static get code(){return"ERR_JWK_INVALID"}},Ue=class extends je{constructor(){super(...arguments),this.code="ERR_JWKS_INVALID"}static get code(){return"ERR_JWKS_INVALID"}},Le=class extends je{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"}},Be=class extends je{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"}},Je=class extends je{constructor(){super(...arguments),this.code="ERR_JWKS_TIMEOUT",this.message="request timed out"}static get code(){return"ERR_JWKS_TIMEOUT"}},$e=class extends je{constructor(){super(...arguments),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED",this.message="signature verification failed"}static get code(){return"ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}}}}),Ge=le({"../node_modules/jose/dist/browser/runtime/random.js"(){me(),We=Ht.getRandomValues.bind(Ht)}});function Xe(t){switch(t){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 Te(`Unsupported JWE Algorithm: ${t}`)}}var Ye,Ze,Qe,ti=le({"../node_modules/jose/dist/browser/lib/iv.js"(){Ve(),Ge(),qe=t=>We(new Uint8Array(Xe(t)>>3))}}),ei=le({"../node_modules/jose/dist/browser/lib/check_iv_length.js"(){Ve(),ti(),Ye=(t,e)=>{if(e.length<<3!==Xe(t))throw new Pe("Invalid Initialization Vector length")}}}),ii=le({"../node_modules/jose/dist/browser/runtime/check_cek_length.js"(){Ve(),Ze=(t,e)=>{const i=t.byteLength<<3;if(i!==e)throw new Pe(`Invalid Content Encryption Key length. Expected ${e} bits, got ${i} bits`)}}}),ni=le({"../node_modules/jose/dist/browser/runtime/timing_safe_equal.js"(){Qe=(t,e)=>{if(!(t instanceof Uint8Array))throw new TypeError("First argument must be a buffer");if(!(e instanceof Uint8Array))throw new TypeError("Second argument must be a buffer");if(t.length!==e.length)throw new TypeError("Input buffers must have the same length");const i=t.length;let n=0,r=-1;for(;++r<i;)n|=t[r]^e[r];return 0===n}}});function ri(){return"undefined"!=typeof WebSocketPair||"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"undefined"!=typeof EdgeRuntime&&"vercel"===EdgeRuntime}var oi=le({"../node_modules/jose/dist/browser/runtime/env.js"(){}});function si(t,e="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${e} must be ${t}`)}function ai(t,e){return t.name===e}function ci(t){return parseInt(t.name.slice(4),10)}function li(t,e){if(e.length&&!e.some((e=>t.usages.includes(e)))){let t="CryptoKey does not support this operation, its usages must include ";if(e.length>2){const i=e.pop();t+=`one of ${e.join(", ")}, or ${i}.`}else t+=2===e.length?`one of ${e[0]} or ${e[1]}.`:`${e[0]}.`;throw new TypeError(t)}}function ui(t,e,...i){switch(e){case"A128GCM":case"A192GCM":case"A256GCM":{if(!ai(t.algorithm,"AES-GCM"))throw si("AES-GCM");const i=parseInt(e.slice(1,4),10);if(t.algorithm.length!==i)throw si(i,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!ai(t.algorithm,"AES-KW"))throw si("AES-KW");const i=parseInt(e.slice(1,4),10);if(t.algorithm.length!==i)throw si(i,"algorithm.length");break}case"ECDH":switch(t.algorithm.name){case"ECDH":case"X25519":case"X448":break;default:throw si("ECDH, X25519, or X448")}break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!ai(t.algorithm,"PBKDF2"))throw si("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!ai(t.algorithm,"RSA-OAEP"))throw si("RSA-OAEP");const i=parseInt(e.slice(9),10)||1;if(ci(t.algorithm.hash)!==i)throw si(`SHA-${i}`,"algorithm.hash");break}default:throw new TypeError("CryptoKey does not support this operation")}li(t,i)}var hi,di=le({"../node_modules/jose/dist/browser/lib/crypto_key.js"(){oi()}});function fi(t,e,...i){if(i.length>2){const e=i.pop();t+=`one of type ${i.join(", ")}, or ${e}.`}else t+=2===i.length?`one of type ${i[0]} or ${i[1]}.`:`of type ${i[0]}.`;return null==e?t+=` Received ${e}`:"function"==typeof e&&e.name?t+=` Received function ${e.name}`:"object"==typeof e&&null!=e&&e.constructor&&e.constructor.name&&(t+=` Received an instance of ${e.constructor.name}`),t}function pi(t,e,...i){return fi(`Key for the ${t} algorithm must be `,e,...i)}var vi,gi,mi,wi,bi,yi,xi=le({"../node_modules/jose/dist/browser/lib/invalid_key_input.js"(){hi=(t,...e)=>fi("Key must be ",t,...e)}}),ki=le({"../node_modules/jose/dist/browser/runtime/is_key_like.js"(){me(),vi=t=>Kt(t),gi=["CryptoKey"]}}),Ei=le({"../node_modules/jose/dist/browser/runtime/decrypt.js"(){ze(),ei(),ii(),ni(),Ve(),me(),di(),xi(),ki(),mi=async(t,e,i,n,r,o)=>{if(!(Kt(e)||e instanceof Uint8Array))throw new TypeError(hi(e,...gi,"Uint8Array"));switch(Ye(t,n),t){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return e instanceof Uint8Array&&Ze(e,parseInt(t.slice(-3),10)),async function(t,e,i,n,r,o){if(!(e instanceof Uint8Array))throw new TypeError(hi(e,"Uint8Array"));const s=parseInt(t.slice(1,4),10),a=await Ht.subtle.importKey("raw",e.subarray(s>>3),"AES-CBC",!1,["decrypt"]),c=await Ht.subtle.importKey("raw",e.subarray(0,s>>3),{hash:"SHA-"+(s<<1),name:"HMAC"},!1,["sign"]),l=be(o,n,i,xe(o.length<<3)),u=new Uint8Array((await Ht.subtle.sign("HMAC",c,l)).slice(0,s>>3));let h,d;try{h=Qe(r,u)}catch(t){}if(!h)throw new Oe;try{d=new Uint8Array(await Ht.subtle.decrypt({iv:n,name:"AES-CBC"},a,i))}catch(t){}if(!d)throw new Oe;return d}(t,e,i,n,r,o);case"A128GCM":case"A192GCM":case"A256GCM":return e instanceof Uint8Array&&Ze(e,parseInt(t.slice(1,4),10)),async function(t,e,i,n,r,o){let s;e instanceof Uint8Array?s=await Ht.subtle.importKey("raw",e,"AES-GCM",!1,["decrypt"]):(ui(e,t,"decrypt"),s=e);try{return new Uint8Array(await Ht.subtle.decrypt({additionalData:o,iv:n,name:"AES-GCM",tagLength:128},s,be(i,r)))}catch(t){throw new Oe}}(t,e,i,n,r,o);default:throw new Te("Unsupported JWE Content Encryption Algorithm")}}}}),Si=le({"../node_modules/jose/dist/browser/runtime/zlib.js"(){Ve(),wi=async()=>{throw new Te('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.')},bi=async()=>{throw new Te('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.')}}}),Fi=le({"../node_modules/jose/dist/browser/lib/is_disjoint.js"(){yi=(...t)=>{const e=t.filter(Boolean);if(0===e.length||1===e.length)return!0;let i;for(const t of e){const e=Object.keys(t);if(i&&0!==i.size)for(const t of e){if(i.has(t))return!1;i.add(t)}else i=new Set(e)}return!0}}});function Ai(t){if("object"!=typeof(e=t)||null===e||"[object Object]"!==Object.prototype.toString.call(t))return!1;var e;if(null===Object.getPrototypeOf(t))return!0;let i=t;for(;null!==Object.getPrototypeOf(i);)i=Object.getPrototypeOf(i);return Object.getPrototypeOf(t)===i}var _i,ji,Ci,Ri=le({"../node_modules/jose/dist/browser/lib/is_object.js"(){}}),Ii=le({"../node_modules/jose/dist/browser/runtime/bogus.js"(){_i=[{hash:"SHA-256",name:"HMAC"},!0,["sign"]]}});function Ti(t,e){if(t.algorithm.length!==parseInt(e.slice(1,4),10))throw new TypeError(`Invalid key size for alg: ${e}`)}function Oi(t,e,i){if(Kt(t))return ui(t,e,i),t;if(t instanceof Uint8Array)return Ht.subtle.importKey("raw",t,"AES-KW",!0,[i]);throw new TypeError(hi(t,...gi,"Uint8Array"))}var Pi=le({"../node_modules/jose/dist/browser/runtime/aeskw.js"(){Ii(),me(),di(),xi(),ki(),ji=async(t,e,i)=>{const n=await Oi(e,t,"wrapKey");Ti(n,t);const r=await Ht.subtle.importKey("raw",i,..._i);return new Uint8Array(await Ht.subtle.wrapKey("raw",r,n,"AES-KW"))},Ci=async(t,e,i)=>{const n=await Oi(e,t,"unwrapKey");Ti(n,t);const r=await Ht.subtle.unwrapKey("raw",i,n,"AES-KW",..._i);return new Uint8Array(await Ht.subtle.exportKey("raw",r))}}});async function Ni(t,e,i,n,r=new Uint8Array(0),o=new Uint8Array(0)){if(!Kt(t))throw new TypeError(hi(t,...gi));if(ui(t,"ECDH"),!Kt(e))throw new TypeError(hi(e,...gi));ui(e,"ECDH","deriveBits");const s=be(Ee(qt.encode(i)),Ee(r),Ee(o),ke(n));let a;return a="X25519"===t.algorithm.name?256:"X448"===t.algorithm.name?448:Math.ceil(parseInt(t.algorithm.namedCurve.substr(-3),10)/8)<<3,async function(t,e,i){const n=Math.ceil((e>>3)/32),r=new Uint8Array(32*n);for(let e=0;e<n;e++){const n=new Uint8Array(4+t.length+i.length);n.set(ke(e+1)),n.set(t,4),n.set(i,4+t.length),r.set(await Wt("sha256",n),32*e)}return r.slice(0,e>>3)}(new Uint8Array(await Ht.subtle.deriveBits({name:t.algorithm.name,public:t},e,a)),n,s)}function Di(t){if(!Kt(t))throw new TypeError(hi(t,...gi));return["P-256","P-384","P-521"].includes(t.algorithm.namedCurve)||"X25519"===t.algorithm.name||"X448"===t.algorithm.name}var Mi,Ui,Li=le({"../node_modules/jose/dist/browser/runtime/ecdhes.js"(){ze(),me(),di(),xi(),ki()}}),Bi=le({"../node_modules/jose/dist/browser/lib/check_p2s.js"(){Ve()}});async function Ji(t,e,i,n){!function(t){if(!(t instanceof Uint8Array)||t.length<8)throw new Pe("PBES2 Salt Input must be 8 or more octets")}(t);const r=function(t,e){return be(qt.encode(t),new Uint8Array([0]),e)}(e,t),o=parseInt(e.slice(13,16),10),s={hash:`SHA-${e.slice(8,11)}`,iterations:i,name:"PBKDF2",salt:r},a={length:o,name:"AES-KW"},c=await function(t,e){if(t instanceof Uint8Array)return Ht.subtle.importKey("raw",t,"PBKDF2",!1,["deriveBits"]);if(Kt(t))return ui(t,e,"deriveBits","deriveKey"),t;throw new TypeError(hi(t,...gi,"Uint8Array"))}(n,e);if(c.usages.includes("deriveBits"))return new Uint8Array(await Ht.subtle.deriveBits(s,c,o));if(c.usages.includes("deriveKey"))return Ht.subtle.deriveKey(s,c,a,!1,["wrapKey","unwrapKey"]);throw new TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"')}var $i=le({"../node_modules/jose/dist/browser/runtime/pbes2kw.js"(){Ge(),ze(),He(),Pi(),Bi(),me(),di(),xi(),ki(),Mi=async(t,e,i,n=2048,r=We(new Uint8Array(16)))=>{const o=await Ji(r,t,n,e);return{encryptedKey:await ji(t.slice(-6),o,i),p2c:n,p2s:Fe(r)}},Ui=async(t,e,i,n,r)=>{const o=await Ji(r,t,n,e);return Ci(t.slice(-6),o,i)}}});function zi(t){switch(t){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new Te(`alg ${t} is not supported either by JOSE or your javascript runtime`)}}var Hi,Ki,Wi,qi,Vi=le({"../node_modules/jose/dist/browser/runtime/subtle_rsaes.js"(){Ve()}}),Gi=le({"../node_modules/jose/dist/browser/runtime/check_key_length.js"(){Hi=(t,e)=>{if(t.startsWith("RS")||t.startsWith("PS")){const{modulusLength:i}=e.algorithm;if("number"!=typeof i||i<2048)throw new TypeError(`${t} requires key modulusLength to be 2048 bits or larger`)}}}}),Xi=le({"../node_modules/jose/dist/browser/runtime/rsaes.js"(){Vi(),Ii(),me(),di(),Gi(),xi(),ki(),Ki=async(t,e,i)=>{if(!Kt(e))throw new TypeError(hi(e,...gi));if(ui(e,t,"encrypt","wrapKey"),Hi(t,e),e.usages.includes("encrypt"))return new Uint8Array(await Ht.subtle.encrypt(zi(t),e,i));if(e.usages.includes("wrapKey")){const n=await Ht.subtle.importKey("raw",i,..._i);return new Uint8Array(await Ht.subtle.wrapKey("raw",n,e,zi(t)))}throw new TypeError('RSA-OAEP key "usages" must include "encrypt" or "wrapKey" for this operation')},Wi=async(t,e,i)=>{if(!Kt(e))throw new TypeError(hi(e,...gi));if(ui(e,t,"decrypt","unwrapKey"),Hi(t,e),e.usages.includes("decrypt"))return new Uint8Array(await Ht.subtle.decrypt(zi(t),e,i));if(e.usages.includes("unwrapKey")){const n=await Ht.subtle.unwrapKey("raw",i,e,zi(t),..._i);return new Uint8Array(await Ht.subtle.exportKey("raw",n))}throw new TypeError('RSA-OAEP key "usages" must include "decrypt" or "unwrapKey" for this operation')}}});function Yi(t){switch(t){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 Te(`Unsupported JWE Algorithm: ${t}`)}}var Zi,Qi,tn,en,nn,rn,on,sn,an,cn,ln=le({"../node_modules/jose/dist/browser/lib/cek.js"(){Ve(),Ge(),qi=t=>We(new Uint8Array(Yi(t)>>3))}}),un=le({"../node_modules/jose/dist/browser/lib/format_pem.js"(){Zi=(t,e)=>`-----BEGIN ${e}-----\n${(t.match(/.{1,64}/g)||[]).join("\n")}\n-----END ${e}-----`}}),hn=le({"../node_modules/jose/dist/browser/runtime/asn1.js"(){oi(),me(),xi(),He(),un(),Ve(),ki(),Qi=async(t,e,i)=>{if(!Kt(i))throw new TypeError(hi(i,...gi));if(!i.extractable)throw new TypeError("CryptoKey is not extractable");if(i.type!==t)throw new TypeError(`key is not a ${t} key`);return Zi(Se(new Uint8Array(await Ht.subtle.exportKey(e,i))),`${t.toUpperCase()} KEY`)},tn=t=>Qi("public","spki",t),en=t=>Qi("private","pkcs8",t),nn=(t,e,i=0)=>{0===i&&(e.unshift(e.length),e.unshift(6));let n=t.indexOf(e[0],i);if(-1===n)return!1;const r=t.subarray(n,n+e.length);return r.length===e.length&&(r.every(((t,i)=>t===e[i]))||nn(t,e,n+1))},rn=t=>{switch(!0){case nn(t,[42,134,72,206,61,3,1,7]):return"P-256";case nn(t,[43,129,4,0,34]):return"P-384";case nn(t,[43,129,4,0,35]):return"P-521";case nn(t,[43,101,110]):return"X25519";case nn(t,[43,101,111]):return"X448";case nn(t,[43,101,112]):return"Ed25519";case nn(t,[43,101,113]):return"Ed448";default:throw new Te("Invalid or unsupported EC Key Curve or OKP Key Sub Type")}},on=async(t,e,i,n,r)=>{var o;let s,a;const c=new Uint8Array(atob(i.replace(t,"")).split("").map((t=>t.charCodeAt(0)))),l="spki"===e;switch(n){case"PS256":case"PS384":case"PS512":s={name:"RSA-PSS",hash:`SHA-${n.slice(-3)}`},a=l?["verify"]:["sign"];break;case"RS256":case"RS384":case"RS512":s={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${n.slice(-3)}`},a=l?["verify"]:["sign"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":s={name:"RSA-OAEP",hash:`SHA-${parseInt(n.slice(-3),10)||1}`},a=l?["encrypt","wrapKey"]:["decrypt","unwrapKey"];break;case"ES256":s={name:"ECDSA",namedCurve:"P-256"},a=l?["verify"]:["sign"];break;case"ES384":s={name:"ECDSA",namedCurve:"P-384"},a=l?["verify"]:["sign"];break;case"ES512":s={name:"ECDSA",namedCurve:"P-521"},a=l?["verify"]:["sign"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{const t=rn(c);s=t.startsWith("P-")?{name:"ECDH",namedCurve:t}:{name:t},a=l?[]:["deriveBits"];break}case ri()&&"EdDSA":{const t=rn(c).toUpperCase();s={name:`NODE-${t}`,namedCurve:`NODE-${t}`},a=l?["verify"]:["sign"];break}case"EdDSA":s={name:rn(c)},a=l?["verify"]:["sign"];break;default:throw new Te('Invalid or unsupported "alg" (Algorithm) value')}return Ht.subtle.importKey(e,c,s,null!==(o=null==r?void 0:r.extractable)&&void 0!==o&&o,a)},sn=(t,e,i)=>on(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,"pkcs8",t,e,i),an=(t,e,i)=>on(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g,"spki",t,e,i)}}),dn=le({"../node_modules/jose/dist/browser/runtime/jwk_to_key.js"(){oi(),me(),Ve(),He(),cn=async t=>{var e,i;const{algorithm:n,keyUsages:r}=function(t){let e,i;switch(t.kty){case"oct":switch(t.alg){case"HS256":case"HS384":case"HS512":e={name:"HMAC",hash:`SHA-${t.alg.slice(-3)}`},i=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":throw new Te(`${t.alg} keys cannot be imported as CryptoKey instances`);case"A128GCM":case"A192GCM":case"A256GCM":case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":e={name:"AES-GCM"},i=["encrypt","decrypt"];break;case"A128KW":case"A192KW":case"A256KW":e={name:"AES-KW"},i=["wrapKey","unwrapKey"];break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":e={name:"PBKDF2"},i=["deriveBits"];break;default:throw new Te('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"RSA":switch(t.alg){case"PS256":case"PS384":case"PS512":e={name:"RSA-PSS",hash:`SHA-${t.alg.slice(-3)}`},i=t.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":e={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${t.alg.slice(-3)}`},i=t.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":e={name:"RSA-OAEP",hash:`SHA-${parseInt(t.alg.slice(-3),10)||1}`},i=t.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new Te('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(t.alg){case"ES256":e={name:"ECDSA",namedCurve:"P-256"},i=t.d?["sign"]:["verify"];break;case"ES384":e={name:"ECDSA",namedCurve:"P-384"},i=t.d?["sign"]:["verify"];break;case"ES512":e={name:"ECDSA",namedCurve:"P-521"},i=t.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":e={name:"ECDH",namedCurve:t.crv},i=t.d?["deriveBits"]:[];break;default:throw new Te('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case ri()&&"OKP":if("EdDSA"!==t.alg)throw new Te('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');if("Ed25519"!==t.crv)throw new Te('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');e={name:"NODE-ED25519",namedCurve:"NODE-ED25519"},i=t.d?["sign"]:["verify"];break;case"OKP":switch(t.alg){case"EdDSA":e={name:t.crv},i=t.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":e={name:t.crv},i=t.d?["deriveBits"]:[];break;default:throw new Te('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new Te('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:e,keyUsages:i}}(t),o=[n,null!==(e=t.ext)&&void 0!==e&&e,null!==(i=t.key_ops)&&void 0!==i?i:r];if("PBKDF2"===n.name)return Ht.subtle.importKey("raw",_e(t.k),...o);const s={...t};return delete s.alg,delete s.use,Ht.subtle.importKey("jwk",s,...o)}}});function fn(t){let e=[],i=0;for(;i<t.length;){let n=pn(t.subarray(i));e.push(n),i+=n.byteLength}return e}function pn(t){let e=0,i=31&t[0];if(e++,31===i){for(i=0;t[e]>=128;)i=128*i+t[e]-128,e++;i=128*i+t[e]-128,e++}let n=0;if(t[e]<128)n=t[e],e++;else{if(128===n){for(n=0;0!==t[e+n]||0!==t[e+n+1];){if(n>t.byteLength)throw new TypeError("invalid indefinite form length");n++}const i=e+n+2;return{byteLength:i,contents:t.subarray(e,e+n),raw:t.subarray(0,i)}}{let i=127&t[e];e++,n=0;for(let r=0;r<i;r++)n=256*n+t[e],e++}}const r=e+n;return{byteLength:r,contents:t.subarray(e,r),raw:t.subarray(0,r)}}async function vn(t,e,i){if("string"!=typeof t||0!==t.indexOf("-----BEGIN PUBLIC KEY-----"))throw new TypeError('"spki" must be SPKI formatted string');return an(t,e,i)}async function gn(t,e,i){if("string"!=typeof t||0!==t.indexOf("-----BEGIN CERTIFICATE-----"))throw new TypeError('"x509" must be X.509 formatted string');let n;try{n=function(t){const e=t.replace(/(?:-----(?:BEGIN|END) CERTIFICATE-----|\s)/g,""),i=Ae(e);return Zi(function(t){const e=fn(fn(pn(t).contents)[0].contents);return Se(e[160===e[0].raw[0]?6:5].raw)}(i),"PUBLIC KEY")}(t)}catch(t){throw new TypeError("failed to parse the X.509 certificate",{cause:t})}return an(n,e,i)}async function mn(t,e,i){if("string"!=typeof t||0!==t.indexOf("-----BEGIN PRIVATE KEY-----"))throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return sn(t,e,i)}async function wn(t,e,i){var n;if(!Ai(t))throw new TypeError("JWK must be an object");if(e||(e=t.alg),"string"!=typeof e||!e)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');switch(t.kty){case"oct":if("string"!=typeof t.k||!t.k)throw new TypeError('missing "k" (Key Value) Parameter value');return null!=i||(i=!0!==t.ext),i?cn({...t,alg:e,ext:null!==(n=t.ext)&&void 0!==n&&n}):_e(t.k);case"RSA":if(void 0!==t.oth)throw new Te('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return cn({...t,alg:e});default:throw new Te('Unsupported "kty" (Key Type) Parameter value')}}var bn,yn,xn,kn,En,Sn=le({"../node_modules/jose/dist/browser/key/import.js"(){He(),hn(),hn(),dn(),Ve(),un(),Ri()}}),Fn=le({"../node_modules/jose/dist/browser/lib/check_key_type.js"(){xi(),ki(),bn=(t,e)=>{if(!(e instanceof Uint8Array)){if(!vi(e))throw new TypeError(pi(t,e,...gi,"Uint8Array"));if("secret"!==e.type)throw new TypeError(`${gi.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}},yn=(t,e,i)=>{if(!vi(e))throw new TypeError(pi(t,e,...gi));if("secret"===e.type)throw new TypeError(`${gi.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===i&&"public"===e.type)throw new TypeError(`${gi.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===i&&"public"===e.type)throw new TypeError(`${gi.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(e.algorithm&&"verify"===i&&"private"===e.type)throw new TypeError(`${gi.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(e.algorithm&&"encrypt"===i&&"private"===e.type)throw new TypeError(`${gi.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)},xn=(t,e,i)=>{t.startsWith("HS")||"dir"===t||t.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(t)?bn(t,e):yn(t,e,i)}}}),An=le({"../node_modules/jose/dist/browser/runtime/encrypt.js"(){ze(),ei(),ii(),me(),di(),xi(),Ve(),ki(),kn=async(t,e,i,n,r)=>{if(!(Kt(i)||i instanceof Uint8Array))throw new TypeError(hi(i,...gi,"Uint8Array"));switch(Ye(t,n),t){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return i instanceof Uint8Array&&Ze(i,parseInt(t.slice(-3),10)),async function(t,e,i,n,r){if(!(i instanceof Uint8Array))throw new TypeError(hi(i,"Uint8Array"));const o=parseInt(t.slice(1,4),10),s=await Ht.subtle.importKey("raw",i.subarray(o>>3),"AES-CBC",!1,["encrypt"]),a=await Ht.subtle.importKey("raw",i.subarray(0,o>>3),{hash:"SHA-"+(o<<1),name:"HMAC"},!1,["sign"]),c=new Uint8Array(await Ht.subtle.encrypt({iv:n,name:"AES-CBC"},s,e)),l=be(r,n,c,xe(r.length<<3));return{ciphertext:c,tag:new Uint8Array((await Ht.subtle.sign("HMAC",a,l)).slice(0,o>>3))}}(t,e,i,n,r);case"A128GCM":case"A192GCM":case"A256GCM":return i instanceof Uint8Array&&Ze(i,parseInt(t.slice(1,4),10)),async function(t,e,i,n,r){let o;i instanceof Uint8Array?o=await Ht.subtle.importKey("raw",i,"AES-GCM",!1,["encrypt"]):(ui(i,t,"encrypt"),o=i);const s=new Uint8Array(await Ht.subtle.encrypt({additionalData:r,iv:n,name:"AES-GCM",tagLength:128},o,e)),a=s.slice(-16);return{ciphertext:s.slice(0,-16),tag:a}}(t,e,i,n,r);default:throw new Te("Unsupported JWE Content Encryption Algorithm")}}}}),_n=le({"../node_modules/jose/dist/browser/lib/aesgcmkw.js"(){An(),Ei(),ti(),He()}});async function jn(t,e,i,n,r){switch(xn(t,e,"decrypt"),t){case"dir":if(void 0!==i)throw new Pe("Encountered unexpected JWE Encrypted Key");return e;case"ECDH-ES":if(void 0!==i)throw new Pe("Encountered unexpected JWE Encrypted Key");case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!Ai(n.epk))throw new Pe('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');if(!Di(e))throw new Te("ECDH with the provided key is not allowed or not supported by your javascript runtime");const r=await wn(n.epk,t);let o,s;if(void 0!==n.apu){if("string"!=typeof n.apu)throw new Pe('JOSE Header "apu" (Agreement PartyUInfo) invalid');o=_e(n.apu)}if(void 0!==n.apv){if("string"!=typeof n.apv)throw new Pe('JOSE Header "apv" (Agreement PartyVInfo) invalid');s=_e(n.apv)}const a=await Ni(r,e,"ECDH-ES"===t?n.enc:t,"ECDH-ES"===t?Yi(n.enc):parseInt(t.slice(-5,-2),10),o,s);if("ECDH-ES"===t)return a;if(void 0===i)throw new Pe("JWE Encrypted Key missing");return Ci(t.slice(-6),a,i)}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":if(void 0===i)throw new Pe("JWE Encrypted Key missing");return Wi(t,e,i);case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(void 0===i)throw new Pe("JWE Encrypted Key missing");if("number"!=typeof n.p2c)throw new Pe('JOSE Header "p2c" (PBES2 Count) missing or invalid');if(n.p2c>((null==r?void 0:r.maxPBES2Count)||1e4))throw new Pe('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');if("string"!=typeof n.p2s)throw new Pe('JOSE Header "p2s" (PBES2 Salt) missing or invalid');return Ui(t,e,i,n.p2c,_e(n.p2s));case"A128KW":case"A192KW":case"A256KW":if(void 0===i)throw new Pe("JWE Encrypted Key missing");return Ci(t,e,i);case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":if(void 0===i)throw new Pe("JWE Encrypted Key missing");if("string"!=typeof n.iv)throw new Pe('JOSE Header "iv" (Initialization Vector) missing or invalid');if("string"!=typeof n.tag)throw new Pe('JOSE Header "tag" (Authentication Tag) missing or invalid');return async function(t,e,i,n,r){const o=t.slice(0,7);return mi(o,e,i,n,r,new Uint8Array(0))}(t,e,i,_e(n.iv),_e(n.tag));default:throw new Te('Invalid or unsupported "alg" (JWE Algorithm) header value')}}var Cn,Rn=le({"../node_modules/jose/dist/browser/lib/decrypt_key_management.js"(){Pi(),Li(),$i(),Xi(),He(),Ve(),ln(),Sn(),Fn(),Ri(),_n(),En=jn}});function In(t,e,i,n,r){if(void 0!==r.crit&&void 0===n.crit)throw new t('"crit" (Critical) Header Parameter MUST be integrity protected');if(!n||void 0===n.crit)return new Set;if(!Array.isArray(n.crit)||0===n.crit.length||n.crit.some((t=>"string"!=typeof t||0===t.length)))throw new t('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let o;o=void 0!==i?new Map([...Object.entries(i),...e.entries()]):e;for(const e of n.crit){if(!o.has(e))throw new Te(`Extension Header Parameter "${e}" is not recognized`);if(void 0===r[e])throw new t(`Extension Header Parameter "${e}" is missing`);if(o.get(e)&&void 0===n[e])throw new t(`Extension Header Parameter "${e}" MUST be integrity protected`)}return new Set(n.crit)}var Tn,On=le({"../node_modules/jose/dist/browser/lib/validate_crit.js"(){Ve(),Cn=In}}),Pn=le({"../node_modules/jose/dist/browser/lib/validate_algorithms.js"(){Tn=(t,e)=>{if(void 0!==e&&(!Array.isArray(e)||e.some((t=>"string"!=typeof t))))throw new TypeError(`"${t}" option must be an array of strings`);if(e)return new Set(e)}}});async function Nn(t,e,i){var n;if(!Ai(t))throw new Pe("Flattened JWE must be an object");if(void 0===t.protected&&void 0===t.header&&void 0===t.unprotected)throw new Pe("JOSE Header missing");if("string"!=typeof t.iv)throw new Pe("JWE Initialization Vector missing or incorrect type");if("string"!=typeof t.ciphertext)throw new Pe("JWE Ciphertext missing or incorrect type");if("string"!=typeof t.tag)throw new Pe("JWE Authentication Tag missing or incorrect type");if(void 0!==t.protected&&"string"!=typeof t.protected)throw new Pe("JWE Protected Header incorrect type");if(void 0!==t.encrypted_key&&"string"!=typeof t.encrypted_key)throw new Pe("JWE Encrypted Key incorrect type");if(void 0!==t.aad&&"string"!=typeof t.aad)throw new Pe("JWE AAD incorrect type");if(void 0!==t.header&&!Ai(t.header))throw new Pe("JWE Shared Unprotected Header incorrect type");if(void 0!==t.unprotected&&!Ai(t.unprotected))throw new Pe("JWE Per-Recipient Unprotected Header incorrect type");let r;if(t.protected)try{const e=_e(t.protected);r=JSON.parse(Vt.decode(e))}catch(t){throw new Pe("JWE Protected Header is invalid")}if(!yi(r,t.header,t.unprotected))throw new Pe("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");const o={...r,...t.header,...t.unprotected};if(Cn(Pe,new Map,null==i?void 0:i.crit,r,o),void 0!==o.zip){if(!r||!r.zip)throw new Pe('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==o.zip)throw new Te('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:s,enc:a}=o;if("string"!=typeof s||!s)throw new Pe("missing JWE Algorithm (alg) in JWE Header");if("string"!=typeof a||!a)throw new Pe("missing JWE Encryption Algorithm (enc) in JWE Header");const c=i&&Tn("keyManagementAlgorithms",i.keyManagementAlgorithms),l=i&&Tn("contentEncryptionAlgorithms",i.contentEncryptionAlgorithms);if(c&&!c.has(s))throw new Ie('"alg" (Algorithm) Header Parameter not allowed');if(l&&!l.has(a))throw new Ie('"enc" (Encryption Algorithm) Header Parameter not allowed');let u;void 0!==t.encrypted_key&&(u=_e(t.encrypted_key));let h,d=!1;"function"==typeof e&&(e=await e(r,t),d=!0);try{h=await En(s,e,u,o,i)}catch(t){if(t instanceof TypeError||t instanceof Pe||t instanceof Te)throw t;h=qi(a)}const f=_e(t.iv),p=_e(t.tag),v=qt.encode(null!==(n=t.protected)&&void 0!==n?n:"");let g;g=void 0!==t.aad?be(v,qt.encode("."),qt.encode(t.aad)):v;let m=await mi(a,h,_e(t.ciphertext),f,p,g);"DEF"===o.zip&&(m=await((null==i?void 0:i.inflateRaw)||wi)(m));const w={plaintext:m};return void 0!==t.protected&&(w.protectedHeader=r),void 0!==t.aad&&(w.additionalAuthenticatedData=_e(t.aad)),void 0!==t.unprotected&&(w.sharedUnprotectedHeader=t.unprotected),void 0!==t.header&&(w.unprotectedHeader=t.header),d?{...w,key:e}:w}var Dn=le({"../node_modules/jose/dist/browser/jwe/flattened/decrypt.js"(){He(),Ei(),Si(),Ve(),Fi(),Ri(),Rn(),ze(),ln(),On(),Pn()}});async function Mn(t,e,i){if(t instanceof Uint8Array&&(t=Vt.decode(t)),"string"!=typeof t)throw new Pe("Compact JWE must be a string or Uint8Array");const{0:n,1:r,2:o,3:s,4:a,length:c}=t.split(".");if(5!==c)throw new Pe("Invalid Compact JWE");const l=await Nn({ciphertext:s,iv:o||void 0,protected:n||void 0,tag:a||void 0,encrypted_key:r||void 0},e,i),u={plaintext:l.plaintext,protectedHeader:l.protectedHeader};return"function"==typeof e?{...u,key:l.key}:u}var Un=le({"../node_modules/jose/dist/browser/jwe/compact/decrypt.js"(){Dn(),Ve(),ze()}});async function Ln(t,e,i){if(!Ai(t))throw new Pe("General JWE must be an object");if(!Array.isArray(t.recipients)||!t.recipients.every(Ai))throw new Pe("JWE Recipients missing or incorrect type");if(!t.recipients.length)throw new Pe("JWE Recipients has no members");for(const n of t.recipients)try{return await Nn({aad:t.aad,ciphertext:t.ciphertext,encrypted_key:n.encrypted_key,header:n.header,iv:t.iv,protected:t.protected,tag:t.tag,unprotected:t.unprotected},e,i)}catch(t){}throw new Oe}var Bn,Jn=le({"../node_modules/jose/dist/browser/jwe/general/decrypt.js"(){Dn(),Ve(),Ri()}}),$n=le({"../node_modules/jose/dist/browser/runtime/key_to_jwk.js"(){me(),xi(),He(),ki(),Bn=async t=>{if(t instanceof Uint8Array)return{kty:"oct",k:Fe(t)};if(!Kt(t))throw new TypeError(hi(t,...gi,"Uint8Array"));if(!t.extractable)throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");const{ext:e,key_ops:i,alg:n,use:r,...o}=await Ht.subtle.exportKey("jwk",t);return o}}});async function zn(t){return tn(t)}async function Hn(t){return en(t)}async function Kn(t){return Bn(t)}var Wn,qn=le({"../node_modules/jose/dist/browser/key/export.js"(){hn(),hn(),$n()}});async function Vn(t,e,i,n,r={}){let o,s,a;switch(xn(t,i,"encrypt"),t){case"dir":a=i;break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!Di(i))throw new Te("ECDH with the provided key is not allowed or not supported by your javascript runtime");const{apu:c,apv:l}=r;let{epk:u}=r;u||(u=(await async function(t){if(!Kt(t))throw new TypeError(hi(t,...gi));return Ht.subtle.generateKey(t.algorithm,!0,["deriveBits"])}(i)).privateKey);const{x:h,y:d,crv:f,kty:p}=await Kn(u),v=await Ni(i,u,"ECDH-ES"===t?e:t,"ECDH-ES"===t?Yi(e):parseInt(t.slice(-5,-2),10),c,l);if(s={epk:{x:h,crv:f,kty:p}},"EC"===p&&(s.epk.y=d),c&&(s.apu=Fe(c)),l&&(s.apv=Fe(l)),"ECDH-ES"===t){a=v;break}a=n||qi(e);const g=t.slice(-6);o=await ji(g,v,a);break}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":a=n||qi(e),o=await Ki(t,i,a);break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{a=n||qi(e);const{p2c:c,p2s:l}=r;({encryptedKey:o,...s}=await Mi(t,i,a,c,l));break}case"A128KW":case"A192KW":case"A256KW":a=n||qi(e),o=await ji(t,i,a);break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{a=n||qi(e);const{iv:c}=r;({encryptedKey:o,...s}=await async function(t,e,i,n){const r=t.slice(0,7);n||(n=qe(r));const{ciphertext:o,tag:s}=await kn(r,i,e,n,new Uint8Array(0));return{encryptedKey:o,iv:Fe(n),tag:Fe(s)}}(t,i,a,c));break}default:throw new Te('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek:a,encryptedKey:o,parameters:s}}var Gn,Xn,Yn,Zn,Qn=le({"../node_modules/jose/dist/browser/lib/encrypt_key_management.js"(){Pi(),Li(),$i(),Xi(),He(),ln(),Ve(),qn(),Fn(),_n(),Wn=Vn}}),tr=le({"../node_modules/jose/dist/browser/jwe/flattened/encrypt.js"(){He(),An(),Si(),ti(),Qn(),Ve(),Fi(),ze(),On(),Gn=Symbol(),Xn=class{constructor(t){if(!(t instanceof Uint8Array))throw new TypeError("plaintext must be an instance of Uint8Array");this._plaintext=t}setKeyManagementParameters(t){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=t,this}setProtectedHeader(t){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=t,this}setSharedUnprotectedHeader(t){if(this._sharedUnprotectedHeader)throw new TypeError("setSharedUnprotectedHeader can only be called once");return this._sharedUnprotectedHeader=t,this}setUnprotectedHeader(t){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=t,this}setAdditionalAuthenticatedData(t){return this._aad=t,this}setContentEncryptionKey(t){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=t,this}setInitializationVector(t){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=t,this}async encrypt(t,e){if(!this._protectedHeader&&!this._unprotectedHeader&&!this._sharedUnprotectedHeader)throw new Pe("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!yi(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new Pe("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const i={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if(Cn(Pe,new Map,null==e?void 0:e.crit,this._protectedHeader,i),void 0!==i.zip){if(!this._protectedHeader||!this._protectedHeader.zip)throw new Pe('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==i.zip)throw new Te('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:n,enc:r}=i;if("string"!=typeof n||!n)throw new Pe('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("string"!=typeof r||!r)throw new Pe('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');let o,s,a,c,l,u,h;if("dir"===n){if(this._cek)throw new TypeError("setContentEncryptionKey cannot be called when using Direct Encryption")}else if("ECDH-ES"===n&&this._cek)throw new TypeError("setContentEncryptionKey cannot be called when using Direct Key Agreement");{let i;({cek:s,encryptedKey:o,parameters:i}=await Wn(n,r,t,this._cek,this._keyManagementParameters)),i&&(e&&Gn in e?this._unprotectedHeader?this._unprotectedHeader={...this._unprotectedHeader,...i}:this.setUnprotectedHeader(i):this._protectedHeader?this._protectedHeader={...this._protectedHeader,...i}:this.setProtectedHeader(i))}if(this._iv||(this._iv=qe(r)),c=qt.encode(this._protectedHeader?Fe(JSON.stringify(this._protectedHeader)):""),this._aad?(l=Fe(this._aad),a=be(c,qt.encode("."),qt.encode(l))):a=c,"DEF"===i.zip){const t=await((null==e?void 0:e.deflateRaw)||bi)(this._plaintext);({ciphertext:u,tag:h}=await kn(r,t,s,this._iv,a))}else({ciphertext:u,tag:h}=await kn(r,this._plaintext,s,this._iv,a));const d={ciphertext:Fe(u),iv:Fe(this._iv),tag:Fe(h)};return o&&(d.encrypted_key=Fe(o)),l&&(d.aad=l),this._protectedHeader&&(d.protected=Vt.decode(c)),this._sharedUnprotectedHeader&&(d.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(d.header=this._unprotectedHeader),d}}}}),er=le({"../node_modules/jose/dist/browser/jwe/general/encrypt.js"(){tr(),Ve(),ln(),Fi(),Qn(),He(),On(),Yn=class{constructor(t,e,i){this.parent=t,this.key=e,this.options=i}setUnprotectedHeader(t){if(this.unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this.unprotectedHeader=t,this}addRecipient(...t){return this.parent.addRecipient(...t)}encrypt(...t){return this.parent.encrypt(...t)}done(){return this.parent}},Zn=class{constructor(t){this._recipients=[],this._plaintext=t}addRecipient(t,e){const i=new Yn(this,t,{crit:null==e?void 0:e.crit});return this._recipients.push(i),i}setProtectedHeader(t){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=t,this}setSharedUnprotectedHeader(t){if(this._unprotectedHeader)throw new TypeError("setSharedUnprotectedHeader can only be called once");return this._unprotectedHeader=t,this}setAdditionalAuthenticatedData(t){return this._aad=t,this}async encrypt(t){var e,i,n;if(!this._recipients.length)throw new Pe("at least one recipient must be added");if(t={deflateRaw:null==t?void 0:t.deflateRaw},1===this._recipients.length){const[e]=this._recipients,i=await new Xn(this._plaintext).setAdditionalAuthenticatedData(this._aad).setProtectedHeader(this._protectedHeader).setSharedUnprotectedHeader(this._unprotectedHeader).setUnprotectedHeader(e.unprotectedHeader).encrypt(e.key,{...e.options,...t});let n={ciphertext:i.ciphertext,iv:i.iv,recipients:[{}],tag:i.tag};return i.aad&&(n.aad=i.aad),i.protected&&(n.protected=i.protected),i.unprotected&&(n.unprotected=i.unprotected),i.encrypted_key&&(n.recipients[0].encrypted_key=i.encrypted_key),i.header&&(n.recipients[0].header=i.header),n}let r;for(let t=0;t<this._recipients.length;t++){const e=this._recipients[t];if(!yi(this._protectedHeader,this._unprotectedHeader,e.unprotectedHeader))throw new Pe("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const i={...this._protectedHeader,...this._unprotectedHeader,...e.unprotectedHeader},{alg:n}=i;if("string"!=typeof n||!n)throw new Pe('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("dir"===n||"ECDH-ES"===n)throw new Pe('"dir" and "ECDH-ES" alg may only be used with a single recipient');if("string"!=typeof i.enc||!i.enc)throw new Pe('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');if(r){if(r!==i.enc)throw new Pe('JWE "enc" (Encryption Algorithm) Header Parameter must be the same for all recipients')}else r=i.enc;if(Cn(Pe,new Map,e.options.crit,this._protectedHeader,i),!(void 0===i.zip||this._protectedHeader&&this._protectedHeader.zip))throw new Pe('JWE "zip" (Compression Algorithm) Header MUST be integrity protected')}const o=qi(r);let s={ciphertext:"",iv:"",recipients:[],tag:""};for(let a=0;a<this._recipients.length;a++){const c=this._recipients[a],l={};s.recipients.push(l);const u={...this._protectedHeader,...this._unprotectedHeader,...c.unprotectedHeader}.alg.startsWith("PBES2")?2048+a:void 0;if(0===a){const e=await new Xn(this._plaintext).setAdditionalAuthenticatedData(this._aad).setContentEncryptionKey(o).setProtectedHeader(this._protectedHeader).setSharedUnprotectedHeader(this._unprotectedHeader).setUnprotectedHeader(c.unprotectedHeader).setKeyManagementParameters({p2c:u}).encrypt(c.key,{...c.options,...t,[Gn]:!0});s.ciphertext=e.ciphertext,s.iv=e.iv,s.tag=e.tag,e.aad&&(s.aad=e.aad),e.protected&&(s.protected=e.protected),e.unprotected&&(s.unprotected=e.unprotected),l.encrypted_key=e.encrypted_key,e.header&&(l.header=e.header);continue}const{encryptedKey:h,parameters:d}=await Wn((null===(e=c.unprotectedHeader)||void 0===e?void 0:e.alg)||(null===(i=this._protectedHeader)||void 0===i?void 0:i.alg)||(null===(n=this._unprotectedHeader)||void 0===n?void 0:n.alg),r,c.key,o,{p2c:u});l.encrypted_key=Fe(h),(c.unprotectedHeader||d)&&(l.header={...c.unprotectedHeader,...d})}return s}}}});function ir(t,e){const i=`SHA-${t.slice(-3)}`;switch(t){case"HS256":case"HS384":case"HS512":return{hash:i,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:i,name:"RSA-PSS",saltLength:t.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:i,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:i,name:"ECDSA",namedCurve:e.namedCurve};case ri()&&"EdDSA":const{namedCurve:n}=e;return{name:n,namedCurve:n};case"EdDSA":return{name:e.name};default:throw new Te(`alg ${t} is not supported either by JOSE or your javascript runtime`)}}var nr=le({"../node_modules/jose/dist/browser/runtime/subtle_dsa.js"(){oi(),Ve()}});function rr(t,e,i){if(Kt(e))return function(t,e,...i){switch(e){case"HS256":case"HS384":case"HS512":{if(!ai(t.algorithm,"HMAC"))throw si("HMAC");const i=parseInt(e.slice(2),10);if(ci(t.algorithm.hash)!==i)throw si(`SHA-${i}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!ai(t.algorithm,"RSASSA-PKCS1-v1_5"))throw si("RSASSA-PKCS1-v1_5");const i=parseInt(e.slice(2),10);if(ci(t.algorithm.hash)!==i)throw si(`SHA-${i}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!ai(t.algorithm,"RSA-PSS"))throw si("RSA-PSS");const i=parseInt(e.slice(2),10);if(ci(t.algorithm.hash)!==i)throw si(`SHA-${i}`,"algorithm.hash");break}case ri()&&"EdDSA":if(!ai(t.algorithm,"NODE-ED25519"))throw si("NODE-ED25519");break;case"EdDSA":if("Ed25519"!==t.algorithm.name&&"Ed448"!==t.algorithm.name)throw si("Ed25519 or Ed448");break;case"ES256":case"ES384":case"ES512":{if(!ai(t.algorithm,"ECDSA"))throw si("ECDSA");const i=function(t){switch(t){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}(e);if(t.algorithm.namedCurve!==i)throw si(i,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}li(t,i)}(e,t,i),e;if(e instanceof Uint8Array){if(!t.startsWith("HS"))throw new TypeError(hi(e,...gi));return Ht.subtle.importKey("raw",e,{hash:`SHA-${t.slice(-3)}`,name:"HMAC"},!1,[i])}throw new TypeError(hi(e,...gi,"Uint8Array"))}var or,sr=le({"../node_modules/jose/dist/browser/runtime/get_sign_verify_key.js"(){me(),di(),xi(),ki()}}),ar=le({"../node_modules/jose/dist/browser/runtime/verify.js"(){nr(),me(),Gi(),sr(),or=async(t,e,i,n)=>{const r=await rr(t,e,"verify");Hi(t,r);const o=ir(t,r.algorithm);try{return await Ht.subtle.verify(o,r,i,n)}catch(t){return!1}}}});async function cr(t,e,i){var n;if(!Ai(t))throw new Ne("Flattened JWS must be an object");if(void 0===t.protected&&void 0===t.header)throw new Ne('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==t.protected&&"string"!=typeof t.protected)throw new Ne("JWS Protected Header incorrect type");if(void 0===t.payload)throw new Ne("JWS Payload missing");if("string"!=typeof t.signature)throw new Ne("JWS Signature missing or incorrect type");if(void 0!==t.header&&!Ai(t.header))throw new Ne("JWS Unprotected Header incorrect type");let r={};if(t.protected)try{const e=_e(t.protected);r=JSON.parse(Vt.decode(e))}catch(t){throw new Ne("JWS Protected Header is invalid")}if(!yi(r,t.header))throw new Ne("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const o={...r,...t.header};let s=!0;if(Cn(Ne,new Map([["b64",!0]]),null==i?void 0:i.crit,r,o).has("b64")&&(s=r.b64,"boolean"!=typeof s))throw new Ne('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:a}=o;if("string"!=typeof a||!a)throw new Ne('JWS "alg" (Algorithm) Header Parameter missing or invalid');const c=i&&Tn("algorithms",i.algorithms);if(c&&!c.has(a))throw new Ie('"alg" (Algorithm) Header Parameter not allowed');if(s){if("string"!=typeof t.payload)throw new Ne("JWS Payload must be a string")}else if("string"!=typeof t.payload&&!(t.payload instanceof Uint8Array))throw new Ne("JWS Payload must be a string or an Uint8Array instance");let l=!1;"function"==typeof e&&(e=await e(r,t),l=!0),xn(a,e,"verify");const u=be(qt.encode(null!==(n=t.protected)&&void 0!==n?n:""),qt.encode("."),"string"==typeof t.payload?qt.encode(t.payload):t.payload),h=_e(t.signature);if(!await or(a,e,h,u))throw new $e;let d;d=s?_e(t.payload):"string"==typeof t.payload?qt.encode(t.payload):t.payload;const f={payload:d};return void 0!==t.protected&&(f.protectedHeader=r),void 0!==t.header&&(f.unprotectedHeader=t.header),l?{...f,key:e}:f}var lr=le({"../node_modules/jose/dist/browser/jws/flattened/verify.js"(){He(),ar(),Ve(),ze(),Fi(),Ri(),Fn(),On(),Pn()}});async function ur(t,e,i){if(t instanceof Uint8Array&&(t=Vt.decode(t)),"string"!=typeof t)throw new Ne("Compact JWS must be a string or Uint8Array");const{0:n,1:r,2:o,length:s}=t.split(".");if(3!==s)throw new Ne("Invalid Compact JWS");const a=await cr({payload:r,protected:n,signature:o},e,i),c={payload:a.payload,protectedHeader:a.protectedHeader};return"function"==typeof e?{...c,key:a.key}:c}var hr=le({"../node_modules/jose/dist/browser/jws/compact/verify.js"(){lr(),Ve(),ze()}});async function dr(t,e,i){if(!Ai(t))throw new Ne("General JWS must be an object");if(!Array.isArray(t.signatures)||!t.signatures.every(Ai))throw new Ne("JWS Signatures missing or incorrect type");for(const n of t.signatures)try{return await cr({header:n.header,payload:t.payload,protected:n.protected,signature:n.signature},e,i)}catch(t){}throw new $e}var fr,pr,vr,gr,mr,wr,br=le({"../node_modules/jose/dist/browser/jws/general/verify.js"(){lr(),Ve(),Ri()}}),yr=le({"../node_modules/jose/dist/browser/lib/epoch.js"(){fr=t=>Math.floor(t.getTime()/1e3)}}),xr=le({"../node_modules/jose/dist/browser/lib/secs.js"(){86400,pr=/^(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)$/i,vr=t=>{const e=pr.exec(t);if(!e)throw new TypeError("Invalid time period format");const i=parseFloat(e[1]);switch(e[2].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":return Math.round(i);case"minute":case"minutes":case"min":case"mins":case"m":return Math.round(60*i);case"hour":case"hours":case"hr":case"hrs":case"h":return Math.round(3600*i);case"day":case"days":case"d":return Math.round(86400*i);case"week":case"weeks":case"w":return Math.round(604800*i);default:return Math.round(31557600*i)}}}}),kr=le({"../node_modules/jose/dist/browser/lib/jwt_claims_set.js"(){Ve(),ze(),yr(),xr(),Ri(),gr=t=>t.toLowerCase().replace(/^application\//,""),mr=(t,e)=>"string"==typeof t?e.includes(t):!!Array.isArray(t)&&e.some(Set.prototype.has.bind(new Set(t))),wr=(t,e,i={})=>{const{typ:n}=i;if(n&&("string"!=typeof t.typ||gr(t.typ)!==gr(n)))throw new Ce('unexpected "typ" JWT header value',"typ","check_failed");let r;try{r=JSON.parse(Vt.decode(e))}catch(t){}if(!Ai(r))throw new De("JWT Claims Set must be a top-level JSON object");const{issuer:o}=i;if(o&&!(Array.isArray(o)?o:[o]).includes(r.iss))throw new Ce('unexpected "iss" claim value',"iss","check_failed");const{subject:s}=i;if(s&&r.sub!==s)throw new Ce('unexpected "sub" claim value',"sub","check_failed");const{audience:a}=i;if(a&&!mr(r.aud,"string"==typeof a?[a]:a))throw new Ce('unexpected "aud" claim value',"aud","check_failed");let c;switch(typeof i.clockTolerance){case"string":c=vr(i.clockTolerance);break;case"number":c=i.clockTolerance;break;case"undefined":c=0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:l}=i,u=fr(l||new Date);if((void 0!==r.iat||i.maxTokenAge)&&"number"!=typeof r.iat)throw new Ce('"iat" claim must be a number',"iat","invalid");if(void 0!==r.nbf){if("number"!=typeof r.nbf)throw new Ce('"nbf" claim must be a number',"nbf","invalid");if(r.nbf>u+c)throw new Ce('"nbf" claim timestamp check failed',"nbf","check_failed")}if(void 0!==r.exp){if("number"!=typeof r.exp)throw new Ce('"exp" claim must be a number',"exp","invalid");if(r.exp<=u-c)throw new Re('"exp" claim timestamp check failed',"exp","check_failed")}if(i.maxTokenAge){const t=u-r.iat;if(t-c>("number"==typeof i.maxTokenAge?i.maxTokenAge:vr(i.maxTokenAge)))throw new Re('"iat" claim timestamp check failed (too far in the past)',"iat","check_failed");if(t<0-c)throw new Ce('"iat" claim timestamp check failed (it should be in the past)',"iat","check_failed")}return r}}});async function Er(t,e,i){var n;const r=await ur(t,e,i);if((null===(n=r.protectedHeader.crit)||void 0===n?void 0:n.includes("b64"))&&!1===r.protectedHeader.b64)throw new De("JWTs MUST NOT use unencoded payload");const o={payload:wr(r.protectedHeader,r.payload,i),protectedHeader:r.protectedHeader};return"function"==typeof e?{...o,key:r.key}:o}var Sr=le({"../node_modules/jose/dist/browser/jwt/verify.js"(){hr(),kr(),Ve()}});async function Fr(t,e,i){const n=await Mn(t,e,i),r=wr(n.protectedHeader,n.plaintext,i),{protectedHeader:o}=n;if(void 0!==o.iss&&o.iss!==r.iss)throw new Ce('replicated "iss" claim header parameter mismatch',"iss","mismatch");if(void 0!==o.sub&&o.sub!==r.sub)throw new Ce('replicated "sub" claim header parameter mismatch',"sub","mismatch");if(void 0!==o.aud&&JSON.stringify(o.aud)!==JSON.stringify(r.aud))throw new Ce('replicated "aud" claim header parameter mismatch',"aud","mismatch");const s={payload:r,protectedHeader:o};return"function"==typeof e?{...s,key:n.key}:s}var Ar,_r,jr,Cr,Rr,Ir,Tr,Or,Pr,Nr,Dr=le({"../node_modules/jose/dist/browser/jwt/decrypt.js"(){Un(),kr(),Ve()}}),Mr=le({"../node_modules/jose/dist/browser/jwe/compact/encrypt.js"(){tr(),Ar=class{constructor(t){this._flattened=new Xn(t)}setContentEncryptionKey(t){return this._flattened.setContentEncryptionKey(t),this}setInitializationVector(t){return this._flattened.setInitializationVector(t),this}setProtectedHeader(t){return this._flattened.setProtectedHeader(t),this}setKeyManagementParameters(t){return this._flattened.setKeyManagementParameters(t),this}async encrypt(t,e){const i=await this._flattened.encrypt(t,e);return[i.protected,i.encrypted_key,i.iv,i.ciphertext,i.tag].join(".")}}}}),Ur=le({"../node_modules/jose/dist/browser/runtime/sign.js"(){nr(),me(),Gi(),sr(),_r=async(t,e,i)=>{const n=await rr(t,e,"sign");Hi(t,n);const r=await Ht.subtle.sign(ir(t,n.algorithm),n,i);return new Uint8Array(r)}}}),Lr=le({"../node_modules/jose/dist/browser/jws/flattened/sign.js"(){He(),Ur(),Fi(),Ve(),ze(),Fn(),On(),jr=class{constructor(t){if(!(t instanceof Uint8Array))throw new TypeError("payload must be an instance of Uint8Array");this._payload=t}setProtectedHeader(t){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=t,this}setUnprotectedHeader(t){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=t,this}async sign(t,e){if(!this._protectedHeader&&!this._unprotectedHeader)throw new Ne("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!yi(this._protectedHeader,this._unprotectedHeader))throw new Ne("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const i={...this._protectedHeader,...this._unprotectedHeader};let n=!0;if(Cn(Ne,new Map([["b64",!0]]),null==e?void 0:e.crit,this._protectedHeader,i).has("b64")&&(n=this._protectedHeader.b64,"boolean"!=typeof n))throw new Ne('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:r}=i;if("string"!=typeof r||!r)throw new Ne('JWS "alg" (Algorithm) Header Parameter missing or invalid');xn(r,t,"sign");let o,s=this._payload;n&&(s=qt.encode(Fe(s))),o=qt.encode(this._protectedHeader?Fe(JSON.stringify(this._protectedHeader)):"");const a=be(o,qt.encode("."),s),c=await _r(r,t,a),l={signature:Fe(c),payload:""};return n&&(l.payload=Vt.decode(s)),this._unprotectedHeader&&(l.header=this._unprotectedHeader),this._protectedHeader&&(l.protected=Vt.decode(o)),l}}}}),Br=le({"../node_modules/jose/dist/browser/jws/compact/sign.js"(){Lr(),Cr=class{constructor(t){this._flattened=new jr(t)}setProtectedHeader(t){return this._flattened.setProtectedHeader(t),this}async sign(t,e){const i=await this._flattened.sign(t,e);if(void 0===i.payload)throw new TypeError("use the flattened module for creating JWS with b64: false");return`${i.protected}.${i.payload}.${i.signature}`}}}}),Jr=le({"../node_modules/jose/dist/browser/jws/general/sign.js"(){Lr(),Ve(),Rr=class{constructor(t,e,i){this.parent=t,this.key=e,this.options=i}setProtectedHeader(t){if(this.protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this.protectedHeader=t,this}setUnprotectedHeader(t){if(this.unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this.unprotectedHeader=t,this}addSignature(...t){return this.parent.addSignature(...t)}sign(...t){return this.parent.sign(...t)}done(){return this.parent}},Ir=class{constructor(t){this._signatures=[],this._payload=t}addSignature(t,e){const i=new Rr(this,t,e);return this._signatures.push(i),i}async sign(){if(!this._signatures.length)throw new Ne("at least one signature must be added");const t={signatures:[],payload:""};for(let e=0;e<this._signatures.length;e++){const i=this._signatures[e],n=new jr(this._payload);n.setProtectedHeader(i.protectedHeader),n.setUnprotectedHeader(i.unprotectedHeader);const{payload:r,...o}=await n.sign(i.key,i.options);if(0===e)t.payload=r;else if(t.payload!==r)throw new Ne("inconsistent use of JWS Unencoded Payload Option (RFC7797)");t.signatures.push(o)}return t}}}}),$r=le({"../node_modules/jose/dist/browser/jwt/produce.js"(){yr(),Ri(),xr(),Tr=class{constructor(t){if(!Ai(t))throw new TypeError("JWT Claims Set MUST be an object");this._payload=t}setIssuer(t){return this._payload={...this._payload,iss:t},this}setSubject(t){return this._payload={...this._payload,sub:t},this}setAudience(t){return this._payload={...this._payload,aud:t},this}setJti(t){return this._payload={...this._payload,jti:t},this}setNotBefore(t){return this._payload="number"==typeof t?{...this._payload,nbf:t}:{...this._payload,nbf:fr(new Date)+vr(t)},this}setExpirationTime(t){return this._payload="number"==typeof t?{...this._payload,exp:t}:{...this._payload,exp:fr(new Date)+vr(t)},this}setIssuedAt(t){return this._payload=void 0===t?{...this._payload,iat:fr(new Date)}:{...this._payload,iat:t},this}}}}),zr=le({"../node_modules/jose/dist/browser/jwt/sign.js"(){Br(),Ve(),ze(),$r(),Or=class extends Tr{setProtectedHeader(t){return this._protectedHeader=t,this}async sign(t,e){var i;const n=new Cr(qt.encode(JSON.stringify(this._payload)));if(n.setProtectedHeader(this._protectedHeader),Array.isArray(null===(i=this._protectedHeader)||void 0===i?void 0:i.crit)&&this._protectedHeader.crit.includes("b64")&&!1===this._protectedHeader.b64)throw new De("JWTs MUST NOT use unencoded payload");return n.sign(t,e)}}}}),Hr=le({"../node_modules/jose/dist/browser/jwt/encrypt.js"(){Mr(),ze(),$r(),Pr=class extends Tr{setProtectedHeader(t){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=t,this}setKeyManagementParameters(t){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=t,this}setContentEncryptionKey(t){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=t,this}setInitializationVector(t){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=t,this}replicateIssuerAsHeader(){return this._replicateIssuerAsHeader=!0,this}replicateSubjectAsHeader(){return this._replicateSubjectAsHeader=!0,this}replicateAudienceAsHeader(){return this._replicateAudienceAsHeader=!0,this}async encrypt(t,e){const i=new Ar(qt.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}),i.setProtectedHeader(this._protectedHeader),this._iv&&i.setInitializationVector(this._iv),this._cek&&i.setContentEncryptionKey(this._cek),this._keyManagementParameters&&i.setKeyManagementParameters(this._keyManagementParameters),i.encrypt(t,e)}}}});async function Kr(t,e){if(!Ai(t))throw new TypeError("JWK must be an object");if(null!=e||(e="sha256"),"sha256"!==e&&"sha384"!==e&&"sha512"!==e)throw new TypeError('digestAlgorithm must one of "sha256", "sha384", or "sha512"');let i;switch(t.kty){case"EC":Nr(t.crv,'"crv" (Curve) Parameter'),Nr(t.x,'"x" (X Coordinate) Parameter'),Nr(t.y,'"y" (Y Coordinate) Parameter'),i={crv:t.crv,kty:t.kty,x:t.x,y:t.y};break;case"OKP":Nr(t.crv,'"crv" (Subtype of Key Pair) Parameter'),Nr(t.x,'"x" (Public Key) Parameter'),i={crv:t.crv,kty:t.kty,x:t.x};break;case"RSA":Nr(t.e,'"e" (Exponent) Parameter'),Nr(t.n,'"n" (Modulus) Parameter'),i={e:t.e,kty:t.kty,n:t.n};break;case"oct":Nr(t.k,'"k" (Key Value) Parameter'),i={k:t.k,kty:t.kty};break;default:throw new Te('"kty" (Key Type) Parameter missing or unsupported')}const n=qt.encode(JSON.stringify(i));return Fe(await Wt(e,n))}async function Wr(t,e){null!=e||(e="sha256");const i=await Kr(t,e);return`urn:ietf:params:oauth:jwk-thumbprint:sha-${e.slice(-3)}:${i}`}var qr=le({"../node_modules/jose/dist/browser/jwk/thumbprint.js"(){we(),He(),Ve(),ze(),Ri(),Nr=(t,e)=>{if("string"!=typeof t||!t)throw new Me(`${e} missing or invalid`)}}});async function Vr(t,e){const i={...t,...e.header};if(!Ai(i.jwk))throw new Ne('"jwk" (JSON Web Key) Header Parameter must be a JSON object');const n=await wn({...i.jwk,ext:!0},i.alg,!0);if(n instanceof Uint8Array||"public"!==n.type)throw new Ne('"jwk" (JSON Web Key) Header Parameter must be a public key');return n}var Gr,Xr=le({"../node_modules/jose/dist/browser/jwk/embedded.js"(){Sn(),Ri(),Ve()}});function Yr(t){return t&&"object"==typeof t&&Array.isArray(t.keys)&&t.keys.every(Zr)}function Zr(t){return Ai(t)}function Qr(t){return Gr.prototype.getKey.bind(new Gr(t))}var to,eo,io=le({"../node_modules/jose/dist/browser/jwks/local.js"(){Sn(),Ve(),Ri(),Gr=class{constructor(t){if(this._cached=new WeakMap,!Yr(t))throw new Ue("JSON Web Key Set malformed");var e;this._jwks=(e=t,"function"==typeof structuredClone?structuredClone(e):JSON.parse(JSON.stringify(e)))}async getKey(t,e){const{alg:i,kid:n}={...t,...e.header},r=function(t){switch("string"==typeof t&&t.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";default:throw new Te('Unsupported "alg" value for a JSON Web Key Set')}}(i),o=this._jwks.keys.filter((t=>{let e=r===t.kty;if(e&&"string"==typeof n&&(e=n===t.kid),e&&"string"==typeof t.alg&&(e=i===t.alg),e&&"string"==typeof t.use&&(e="sig"===t.use),e&&Array.isArray(t.key_ops)&&(e=t.key_ops.includes("verify")),e&&"EdDSA"===i&&(e="Ed25519"===t.crv||"Ed448"===t.crv),e)switch(i){case"ES256":e="P-256"===t.crv;break;case"ES256K":e="secp256k1"===t.crv;break;case"ES384":e="P-384"===t.crv;break;case"ES512":e="P-521"===t.crv}return e})),{0:s,length:a}=o;if(0===a)throw new Le;if(1!==a)throw new Be;const c=this._cached.get(s)||this._cached.set(s,{}).get(s);if(void 0===c[i]){const t=await wn({...s,ext:!0},i);if(t instanceof Uint8Array||"public"!==t.type)throw new Ue("JSON Web Key Set members must be public keys");c[i]=t}return c[i]}}}}),no=le({"../node_modules/jose/dist/browser/runtime/fetch_jwks.js"(){Ve(),to=async(t,e,i)=>{let n,r,o=!1;"function"==typeof AbortController&&(n=new AbortController,r=setTimeout((()=>{o=!0,n.abort()}),e));const s=await fetch(t.href,{signal:n?n.signal:void 0,redirect:"manual",headers:i.headers}).catch((t=>{if(o)throw new Je;throw t}));if(void 0!==r&&clearTimeout(r),200!==s.status)throw new je("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await s.json()}catch(t){throw new je("Failed to parse the JSON Web Key Set HTTP response as JSON")}}}});function ro(t,e){return eo.prototype.getKey.bind(new eo(t,e))}var oo,so,ao,co=le({"../node_modules/jose/dist/browser/jwks/remote.js"(){no(),oi(),Ve(),io(),eo=class extends Gr{constructor(t,e){if(super({keys:[]}),this._jwks=void 0,!(t instanceof URL))throw new TypeError("url must be an instance of URL");this._url=new URL(t.href),this._options={agent:null==e?void 0:e.agent,headers:null==e?void 0:e.headers},this._timeoutDuration="number"==typeof(null==e?void 0:e.timeoutDuration)?null==e?void 0:e.timeoutDuration:5e3,this._cooldownDuration="number"==typeof(null==e?void 0:e.cooldownDuration)?null==e?void 0:e.cooldownDuration:3e4,this._cacheMaxAge="number"==typeof(null==e?void 0:e.cacheMaxAge)?null==e?void 0:e.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(t,e){this._jwks&&this.fresh()||await this.reload();try{return await super.getKey(t,e)}catch(i){if(i instanceof Le&&!1===this.coolingDown())return await this.reload(),super.getKey(t,e);throw i}}async reload(){if(this._pendingFetch&&ri())return new Promise((t=>{const e=()=>{void 0===this._pendingFetch?t():setTimeout(e,5)};e()}));this._pendingFetch||(this._pendingFetch=to(this._url,this._timeoutDuration,this._options).then((t=>{if(!Yr(t))throw new Ue("JSON Web Key Set malformed");this._jwks={keys:t.keys},this._jwksTimestamp=Date.now(),this._pendingFetch=void 0})).catch((t=>{throw this._pendingFetch=void 0,t}))),await this._pendingFetch}}}}),lo=le({"../node_modules/jose/dist/browser/jwt/unsecured.js"(){He(),ze(),Ve(),kr(),$r(),oo=class extends Tr{encode(){return`${Fe(JSON.stringify({alg:"none"}))}.${Fe(JSON.stringify(this._payload))}.`}static decode(t,e){if("string"!=typeof t)throw new De("Unsecured JWT must be a string");const{0:i,1:n,2:r,length:o}=t.split(".");if(3!==o||""!==r)throw new De("Invalid Unsecured JWT");let s;try{if(s=JSON.parse(Vt.decode(_e(i))),"none"!==s.alg)throw new Error}catch(t){throw new De("Invalid Unsecured JWT")}return{payload:wr(s,_e(n),e),header:s}}}}}),uo={};he(uo,{decode:()=>ao,encode:()=>so});var ho=le({"../node_modules/jose/dist/browser/util/base64url.js"(){He(),so=Fe,ao=_e}});function fo(t){let e;if("string"==typeof t){const i=t.split(".");3!==i.length&&5!==i.length||([e]=i)}else if("object"==typeof t&&t){if(!("protected"in t))throw new TypeError("Token does not contain a Protected Header");e=t.protected}try{if("string"!=typeof e||!e)throw new Error;const t=JSON.parse(Vt.decode(ao(e)));if(!Ai(t))throw new Error;return t}catch(t){throw new TypeError("Invalid Token or Protected Header formatting")}}var po=le({"../node_modules/jose/dist/browser/util/decode_protected_header.js"(){ho(),ze(),Ri()}});function vo(t){if("string"!=typeof t)throw new De("JWTs must use Compact JWS serialization, JWT must be a string");const{1:e,length:i}=t.split(".");if(5===i)throw new De("Only JWTs using Compact JWS serialization can be decoded");if(3!==i)throw new De("Invalid JWT");if(!e)throw new De("JWTs must contain a payload");let n,r;try{n=ao(e)}catch(t){throw new De("Failed to parse the base64url encoded payload")}try{r=JSON.parse(Vt.decode(n))}catch(t){throw new De("Failed to parse the decoded payload as JSON")}if(!Ai(r))throw new De("Invalid JWT Claims Set");return r}var go=le({"../node_modules/jose/dist/browser/util/decode_jwt.js"(){ho(),ze(),Ri(),Ve()}});function mo(t){var e;const i=null!==(e=null==t?void 0:t.modulusLength)&&void 0!==e?e:2048;if("number"!=typeof i||i<2048)throw new Te("Invalid or unsupported modulusLength option provided, 2048 bits or larger keys must be used");return i}var wo=le({"../node_modules/jose/dist/browser/runtime/generate.js"(){oi(),me(),Ve(),Ge()}});async function bo(t,e){return async function(t,e){var i,n,r;let o,s;switch(t){case"PS256":case"PS384":case"PS512":o={name:"RSA-PSS",hash:`SHA-${t.slice(-3)}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:mo(e)},s=["sign","verify"];break;case"RS256":case"RS384":case"RS512":o={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${t.slice(-3)}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:mo(e)},s=["sign","verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":o={name:"RSA-OAEP",hash:`SHA-${parseInt(t.slice(-3),10)||1}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:mo(e)},s=["decrypt","unwrapKey","encrypt","wrapKey"];break;case"ES256":o={name:"ECDSA",namedCurve:"P-256"},s=["sign","verify"];break;case"ES384":o={name:"ECDSA",namedCurve:"P-384"},s=["sign","verify"];break;case"ES512":o={name:"ECDSA",namedCurve:"P-521"},s=["sign","verify"];break;case ri()&&"EdDSA":switch(null==e?void 0:e.crv){case void 0:case"Ed25519":o={name:"NODE-ED25519",namedCurve:"NODE-ED25519"},s=["sign","verify"];break;default:throw new Te("Invalid or unsupported crv option provided")}break;case"EdDSA":s=["sign","verify"];const r=null!==(i=null==e?void 0:e.crv)&&void 0!==i?i:"Ed25519";switch(r){case"Ed25519":case"Ed448":o={name:r};break;default:throw new Te("Invalid or unsupported crv option provided")}break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{s=["deriveKey","deriveBits"];const t=null!==(n=null==e?void 0:e.crv)&&void 0!==n?n:"P-256";switch(t){case"P-256":case"P-384":case"P-521":o={name:"ECDH",namedCurve:t};break;case"X25519":case"X448":o={name:t};break;default:throw new Te("Invalid or unsupported crv option provided, supported values are P-256, P-384, P-521, X25519, and X448")}break}default:throw new Te('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}return Ht.subtle.generateKey(o,null!==(r=null==e?void 0:e.extractable)&&void 0!==r&&r,s)}(t,e)}var yo=le({"../node_modules/jose/dist/browser/key/generate_key_pair.js"(){wo()}});async function xo(t,e){return async function(t,e){var i;let n,r,o;switch(t){case"HS256":case"HS384":case"HS512":n=parseInt(t.slice(-3),10),r={name:"HMAC",hash:`SHA-${n}`,length:n},o=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return n=parseInt(t.slice(-3),10),We(new Uint8Array(n>>3));case"A128KW":case"A192KW":case"A256KW":n=parseInt(t.slice(1,4),10),r={name:"AES-KW",length:n},o=["wrapKey","unwrapKey"];break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":case"A128GCM":case"A192GCM":case"A256GCM":n=parseInt(t.slice(1,4),10),r={name:"AES-GCM",length:n},o=["encrypt","decrypt"];break;default:throw new Te('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}return Ht.subtle.generateKey(r,null!==(i=null==e?void 0:e.extractable)&&void 0!==i&&i,o)}(t,e)}var ko=le({"../node_modules/jose/dist/browser/key/generate_secret.js"(){wo()}}),Eo={};he(Eo,{CompactEncrypt:()=>Ar,CompactSign:()=>Cr,EmbeddedJWK:()=>Vr,EncryptJWT:()=>Pr,FlattenedEncrypt:()=>Xn,FlattenedSign:()=>jr,GeneralEncrypt:()=>Zn,GeneralSign:()=>Ir,SignJWT:()=>Or,UnsecuredJWT:()=>oo,base64url:()=>uo,calculateJwkThumbprint:()=>Kr,calculateJwkThumbprintUri:()=>Wr,compactDecrypt:()=>Mn,compactVerify:()=>ur,createLocalJWKSet:()=>Qr,createRemoteJWKSet:()=>ro,decodeJwt:()=>vo,decodeProtectedHeader:()=>fo,errors:()=>Ke,exportJWK:()=>Kn,exportPKCS8:()=>Hn,exportSPKI:()=>zn,flattenedDecrypt:()=>Nn,flattenedVerify:()=>cr,generalDecrypt:()=>Ln,generalVerify:()=>dr,generateKeyPair:()=>bo,generateSecret:()=>xo,importJWK:()=>wn,importPKCS8:()=>mn,importSPKI:()=>vn,importX509:()=>gn,jwtDecrypt:()=>Fr,jwtVerify:()=>Er});var So=le({"../node_modules/jose/dist/browser/index.js"(){Un(),Dn(),Jn(),er(),hr(),lr(),br(),Sr(),Dr(),Mr(),tr(),Br(),Lr(),Jr(),zr(),Hr(),qr(),Xr(),io(),co(),lo(),qn(),Sn(),po(),go(),Ve(),yo(),ko(),ho()}}),Fo=ue({"../node_modules/uuid/dist/commonjs-browser/rng.js"(t){var e;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){if(!e&&!(e="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return e(i)};var i=new Uint8Array(16)}}),Ao=ue({"../node_modules/uuid/dist/commonjs-browser/regex.js"(t){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}}),_o=ue({"../node_modules/uuid/dist/commonjs-browser/validate.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,i=(e=Ao())&&e.__esModule?e:{default:e};t.default=function(t){return"string"==typeof t&&i.default.test(t)}}}),jo=ue({"../node_modules/uuid/dist/commonjs-browser/stringify.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.unsafeStringify=r;var e,i=(e=_o())&&e.__esModule?e:{default:e},n=[];for(let t=0;t<256;++t)n.push((t+256).toString(16).slice(1));function r(t,e=0){return(n[t[e+0]]+n[t[e+1]]+n[t[e+2]]+n[t[e+3]]+"-"+n[t[e+4]]+n[t[e+5]]+"-"+n[t[e+6]]+n[t[e+7]]+"-"+n[t[e+8]]+n[t[e+9]]+"-"+n[t[e+10]]+n[t[e+11]]+n[t[e+12]]+n[t[e+13]]+n[t[e+14]]+n[t[e+15]]).toLowerCase()}t.default=function(t,e=0){const n=r(t,e);if(!(0,i.default)(n))throw TypeError("Stringified UUID is invalid");return n}}}),Co=ue({"../node_modules/uuid/dist/commonjs-browser/v1.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,i,n,r=(e=Fo())&&e.__esModule?e:{default:e},o=jo(),s=0,a=0;t.default=function(t,e,c){let l=e&&c||0;const u=e||new Array(16);let h=(t=t||{}).node||i,d=void 0!==t.clockseq?t.clockseq:n;if(null==h||null==d){const e=t.random||(t.rng||r.default)();null==h&&(h=i=[1|e[0],e[1],e[2],e[3],e[4],e[5]]),null==d&&(d=n=16383&(e[6]<<8|e[7]))}let f=void 0!==t.msecs?t.msecs:Date.now(),p=void 0!==t.nsecs?t.nsecs:a+1;const v=f-s+(p-a)/1e4;if(v<0&&void 0===t.clockseq&&(d=d+1&16383),(v<0||f>s)&&void 0===t.nsecs&&(p=0),p>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");s=f,a=p,n=d,f+=122192928e5;const g=(1e4*(268435455&f)+p)%4294967296;u[l++]=g>>>24&255,u[l++]=g>>>16&255,u[l++]=g>>>8&255,u[l++]=255&g;const m=f/4294967296*1e4&268435455;u[l++]=m>>>8&255,u[l++]=255&m,u[l++]=m>>>24&15|16,u[l++]=m>>>16&255,u[l++]=d>>>8|128,u[l++]=255&d;for(let t=0;t<6;++t)u[l+t]=h[t];return e||(0,o.unsafeStringify)(u)}}}),Ro=ue({"../node_modules/uuid/dist/commonjs-browser/parse.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,i=(e=_o())&&e.__esModule?e:{default:e};t.default=function(t){if(!(0,i.default)(t))throw TypeError("Invalid UUID");let e;const n=new Uint8Array(16);return n[0]=(e=parseInt(t.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=255&e,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=255&e,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=255&e,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=255&e,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=255&e,n}}}),Io=ue({"../node_modules/uuid/dist/commonjs-browser/v35.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.URL=t.DNS=void 0,t.default=function(t,e,s){function a(t,r,o,a){var c;if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));const e=[];for(let i=0;i<t.length;++i)e.push(t.charCodeAt(i));return e}(t)),"string"==typeof r&&(r=(0,n.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 l=new Uint8Array(16+t.length);if(l.set(r),l.set(t,r.length),l=s(l),l[6]=15&l[6]|e,l[8]=63&l[8]|128,o){a=a||0;for(let t=0;t<16;++t)o[a+t]=l[t];return o}return(0,i.unsafeStringify)(l)}try{a.name=t}catch(t){}return a.DNS=r,a.URL=o,a};var e,i=jo(),n=(e=Ro())&&e.__esModule?e:{default:e},r="6ba7b810-9dad-11d1-80b4-00c04fd430c8";t.DNS=r;var o="6ba7b811-9dad-11d1-80b4-00c04fd430c8";t.URL=o}}),To=ue({"../node_modules/uuid/dist/commonjs-browser/md5.js"(t){function e(t){return 14+(t+64>>>9<<4)+1}function i(t,e){const i=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(i>>16)<<16|65535&i}function n(t,e,n,r,o,s){return i((a=i(i(e,t),i(r,s)))<<(c=o)|a>>>32-c,n);var a,c}function r(t,e,i,r,o,s,a){return n(e&i|~e&r,t,e,o,s,a)}function o(t,e,i,r,o,s,a){return n(e&r|i&~r,t,e,o,s,a)}function s(t,e,i,r,o,s,a){return n(e^i^r,t,e,o,s,a)}function a(t,e,i,r,o,s,a){return n(i^(e|~r),t,e,o,s,a)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=function(t){if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(let i=0;i<e.length;++i)t[i]=e.charCodeAt(i)}return function(t){const e=[],i=32*t.length,n="0123456789abcdef";for(let r=0;r<i;r+=8){const i=t[r>>5]>>>r%32&255,o=parseInt(n.charAt(i>>>4&15)+n.charAt(15&i),16);e.push(o)}return e}(function(t,n){t[n>>5]|=128<<n%32,t[e(n)-1]=n;let c=1732584193,l=-271733879,u=-1732584194,h=271733878;for(let e=0;e<t.length;e+=16){const n=c,d=l,f=u,p=h;c=r(c,l,u,h,t[e],7,-680876936),h=r(h,c,l,u,t[e+1],12,-389564586),u=r(u,h,c,l,t[e+2],17,606105819),l=r(l,u,h,c,t[e+3],22,-1044525330),c=r(c,l,u,h,t[e+4],7,-176418897),h=r(h,c,l,u,t[e+5],12,1200080426),u=r(u,h,c,l,t[e+6],17,-1473231341),l=r(l,u,h,c,t[e+7],22,-45705983),c=r(c,l,u,h,t[e+8],7,1770035416),h=r(h,c,l,u,t[e+9],12,-1958414417),u=r(u,h,c,l,t[e+10],17,-42063),l=r(l,u,h,c,t[e+11],22,-1990404162),c=r(c,l,u,h,t[e+12],7,1804603682),h=r(h,c,l,u,t[e+13],12,-40341101),u=r(u,h,c,l,t[e+14],17,-1502002290),l=r(l,u,h,c,t[e+15],22,1236535329),c=o(c,l,u,h,t[e+1],5,-165796510),h=o(h,c,l,u,t[e+6],9,-1069501632),u=o(u,h,c,l,t[e+11],14,643717713),l=o(l,u,h,c,t[e],20,-373897302),c=o(c,l,u,h,t[e+5],5,-701558691),h=o(h,c,l,u,t[e+10],9,38016083),u=o(u,h,c,l,t[e+15],14,-660478335),l=o(l,u,h,c,t[e+4],20,-405537848),c=o(c,l,u,h,t[e+9],5,568446438),h=o(h,c,l,u,t[e+14],9,-1019803690),u=o(u,h,c,l,t[e+3],14,-187363961),l=o(l,u,h,c,t[e+8],20,1163531501),c=o(c,l,u,h,t[e+13],5,-1444681467),h=o(h,c,l,u,t[e+2],9,-51403784),u=o(u,h,c,l,t[e+7],14,1735328473),l=o(l,u,h,c,t[e+12],20,-1926607734),c=s(c,l,u,h,t[e+5],4,-378558),h=s(h,c,l,u,t[e+8],11,-2022574463),u=s(u,h,c,l,t[e+11],16,1839030562),l=s(l,u,h,c,t[e+14],23,-35309556),c=s(c,l,u,h,t[e+1],4,-1530992060),h=s(h,c,l,u,t[e+4],11,1272893353),u=s(u,h,c,l,t[e+7],16,-155497632),l=s(l,u,h,c,t[e+10],23,-1094730640),c=s(c,l,u,h,t[e+13],4,681279174),h=s(h,c,l,u,t[e],11,-358537222),u=s(u,h,c,l,t[e+3],16,-722521979),l=s(l,u,h,c,t[e+6],23,76029189),c=s(c,l,u,h,t[e+9],4,-640364487),h=s(h,c,l,u,t[e+12],11,-421815835),u=s(u,h,c,l,t[e+15],16,530742520),l=s(l,u,h,c,t[e+2],23,-995338651),c=a(c,l,u,h,t[e],6,-198630844),h=a(h,c,l,u,t[e+7],10,1126891415),u=a(u,h,c,l,t[e+14],15,-1416354905),l=a(l,u,h,c,t[e+5],21,-57434055),c=a(c,l,u,h,t[e+12],6,1700485571),h=a(h,c,l,u,t[e+3],10,-1894986606),u=a(u,h,c,l,t[e+10],15,-1051523),l=a(l,u,h,c,t[e+1],21,-2054922799),c=a(c,l,u,h,t[e+8],6,1873313359),h=a(h,c,l,u,t[e+15],10,-30611744),u=a(u,h,c,l,t[e+6],15,-1560198380),l=a(l,u,h,c,t[e+13],21,1309151649),c=a(c,l,u,h,t[e+4],6,-145523070),h=a(h,c,l,u,t[e+11],10,-1120210379),u=a(u,h,c,l,t[e+2],15,718787259),l=a(l,u,h,c,t[e+9],21,-343485551),c=i(c,n),l=i(l,d),u=i(u,f),h=i(h,p)}return[c,l,u,h]}(function(t){if(0===t.length)return[];const i=8*t.length,n=new Uint32Array(e(i));for(let e=0;e<i;e+=8)n[e>>5]|=(255&t[e/8])<<e%32;return n}(t),8*t.length))}}}),Oo=ue({"../node_modules/uuid/dist/commonjs-browser/v3.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(Io()),i=n(To());function n(t){return t&&t.__esModule?t:{default:t}}var r=(0,e.default)("v3",48,i.default);t.default=r}}),Po=ue({"../node_modules/uuid/dist/commonjs-browser/native.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e="undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);t.default={randomUUID:e}}}),No=ue({"../node_modules/uuid/dist/commonjs-browser/v4.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=r(Po()),i=r(Fo()),n=jo();function r(t){return t&&t.__esModule?t:{default:t}}t.default=function(t,r,o){if(e.default.randomUUID&&!r&&!t)return e.default.randomUUID();const s=(t=t||{}).random||(t.rng||i.default)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,r){o=o||0;for(let t=0;t<16;++t)r[o+t]=s[t];return r}return(0,n.unsafeStringify)(s)}}}),Do=ue({"../node_modules/uuid/dist/commonjs-browser/sha1.js"(t){function e(t,e,i,n){switch(t){case 0:return e&i^~e&n;case 1:case 3:return e^i^n;case 2:return e&i^e&n^i&n}}function i(t,e){return t<<e|t>>>32-e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=function(t){const n=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=[];for(let i=0;i<e.length;++i)t.push(e.charCodeAt(i))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);const o=Math.ceil((t.length/4+2)/16),s=new Array(o);for(let e=0;e<o;++e){const i=new Uint32Array(16);for(let n=0;n<16;++n)i[n]=t[64*e+4*n]<<24|t[64*e+4*n+1]<<16|t[64*e+4*n+2]<<8|t[64*e+4*n+3];s[e]=i}s[o-1][14]=8*(t.length-1)/Math.pow(2,32),s[o-1][14]=Math.floor(s[o-1][14]),s[o-1][15]=8*(t.length-1)&4294967295;for(let t=0;t<o;++t){const o=new Uint32Array(80);for(let e=0;e<16;++e)o[e]=s[t][e];for(let t=16;t<80;++t)o[t]=i(o[t-3]^o[t-8]^o[t-14]^o[t-16],1);let a=r[0],c=r[1],l=r[2],u=r[3],h=r[4];for(let t=0;t<80;++t){const r=Math.floor(t/20),s=i(a,5)+e(r,c,l,u)+h+n[r]+o[t]>>>0;h=u,u=l,l=i(c,30)>>>0,c=a,a=s}r[0]=r[0]+a>>>0,r[1]=r[1]+c>>>0,r[2]=r[2]+l>>>0,r[3]=r[3]+u>>>0,r[4]=r[4]+h>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]}}}),Mo=ue({"../node_modules/uuid/dist/commonjs-browser/v5.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(Io()),i=n(Do());function n(t){return t&&t.__esModule?t:{default:t}}var r=(0,e.default)("v5",80,i.default);t.default=r}}),Uo=ue({"../node_modules/uuid/dist/commonjs-browser/nil.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default="00000000-0000-0000-0000-000000000000"}}),Lo=ue({"../node_modules/uuid/dist/commonjs-browser/version.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,i=(e=_o())&&e.__esModule?e:{default:e};t.default=function(t){if(!(0,i.default)(t))throw TypeError("Invalid UUID");return parseInt(t.slice(14,15),16)}}}),Bo=ue({"../node_modules/uuid/dist/commonjs-browser/index.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"NIL",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"v1",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(t,"v3",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"v4",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"v5",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"validate",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return s.default}});var e=u(Co()),i=u(Oo()),n=u(No()),r=u(Mo()),o=u(Uo()),s=u(Lo()),a=u(_o()),c=u(jo()),l=u(Ro());function u(t){return t&&t.__esModule?t:{default:t}}}}),Jo=ue({"../node_modules/@inrupt/solid-client-authn-core/dist/index.js"(t){var e,i=ge(),n=(So(),e=Eo,de(Yt({},"__esModule",{value:!0}),e)),r=Bo(),o=["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"},a=["openid","offline_access","webid"].join(" ");async function c(t,e){const n=await i.fetch(t);if(200!==n.status)throw new Error(`Could not fetch JWKS for [${e}] at [${t}]: ${n.status} ${n.statusText}`);let r;try{r=(await n.json()).keys[0]}catch(i){throw new Error(`Malformed JWKS for [${e}] at [${t}]: ${i.message}`)}return r}function l(t){try{return new URL(t),!0}catch(t){return!1}}var u=class{constructor(t,e){this.secureStorage=t,this.insecureStorage=e}getKey(t){return`solidClientAuthenticationUser:${t}`}async getUserData(t,e){const i=await(e?this.secureStorage:this.insecureStorage).get(this.getKey(t));if(void 0===i)return{};try{return JSON.parse(i)}catch(n){throw new Error(`Data for user [${t}] in [${e?"secure":"unsecure"}] storage is corrupted - expected valid JSON, but got: ${i}`)}}async setUserData(t,e,i){await(i?this.secureStorage:this.insecureStorage).set(this.getKey(t),JSON.stringify(e))}async get(t,e){const i=await((null==e?void 0:e.secure)?this.secureStorage:this.insecureStorage).get(t);if(void 0===i&&(null==e?void 0:e.errorIfNull))throw new Error(`[${t}] is not stored`);return i}async set(t,e,i){return((null==i?void 0:i.secure)?this.secureStorage:this.insecureStorage).set(t,e)}async delete(t,e){return((null==e?void 0:e.secure)?this.secureStorage:this.insecureStorage).delete(t)}async getForUser(t,e,i){const n=await this.getUserData(t,null==i?void 0:i.secure);let r;if(n&&n[e]||(r=void 0),r=n[e],void 0===r&&(null==i?void 0:i.errorIfNull))throw new Error(`Field [${e}] for user [${t}] is not stored`);return r||void 0}async setForUser(t,e,i){let n;try{n=await this.getUserData(t,null==i?void 0:i.secure)}catch(t){n={}}await this.setUserData(t,{...n,...e},null==i?void 0:i.secure)}async deleteForUser(t,e,i){const n=await this.getUserData(t,null==i?void 0:i.secure);delete n[e],await this.setUserData(t,n,null==i?void 0:i.secure)}async deleteAllUserData(t,e){await((null==e?void 0:e.secure)?this.secureStorage:this.insecureStorage).delete(this.getKey(t))}},h=class extends Error{constructor(t){super(t)}},d=class extends Error{constructor(t){super(`[${t}] is not implemented`)}},f=class extends Error{constructor(t){super(`Invalid response from OIDC provider: missing fields ${t}`),this.missingFields=t}},p=class extends Error{constructor(t,e,i){super(t),this.error=e,this.errorDescription=i}};function v(t){const e=new URL(t);return new URL(e.pathname,e.origin).toString()}async function g(t,e,i){return new n.SignJWT({htu:v(t),htm:e.toUpperCase(),jti:r.v4()}).setProtectedHeader({alg:o[0],jwk:i.publicKey,typ:"dpop+jwt"}).setIssuedAt().sign(i.privateKey,{})}async function m(t,e,n,r,o){return t(n,await async function(t,e,n,r){if(void 0!==n)return async function(t,e,n,r){var o;const s=new i.Headers(null==r?void 0:r.headers);return s.set("Authorization",`DPoP ${e}`),s.set("DPoP",await g(t,null!==(o=null==r?void 0:r.method)&&void 0!==o?o:"get",n)),{...r,headers:s}}(t,e,n,r);const o=new i.Headers(null==r?void 0:r.headers);return o.set("Authorization",`Bearer ${e}`),{...r,headers:o}}(n.toString(),e,o,r))}var w=t=>void 0!==t?t-5>0?t-5:t:600,b="getResponse",y={get:async()=>b,set:async()=>{},delete:async()=>{},getForUser:async()=>b,setForUser:async()=>{},deleteForUser:async()=>{},deleteAllUserData:async()=>{}},x=t=>{const e=t;return{get:async t=>{if(void 0!==e[t])return"string"==typeof e[t]?e[t]:JSON.stringify(e[t])},set:async(t,i)=>{e[t]=i},delete:async t=>{delete e[t]}}};t.AggregateHandler=class{constructor(t){this.handleables=t}async getProperHandler(t){const e=await Promise.all(this.handleables.map((e=>e.canHandle(...t))));for(let t=0;t<e.length;t+=1)if(e[t])return this.handleables[t];return null}async canHandle(...t){return null!==await this.getProperHandler(t)}async handle(...t){const e=await this.getProperHandler(t);if(e)return e.handle(...t);throw new Error(`[${this.constructor.name}] cannot find a suitable handler for: ${t.map((t=>{try{return JSON.stringify(t)}catch(e){return t.toString()}})).join(", ")}`)}},t.ConfigurationError=h,t.DEFAULT_SCOPES=a,t.EVENTS=s,t.InMemoryStorage=class{constructor(){this.map={}}async get(t){return this.map[t]||void 0}async set(t,e){this.map[t]=e}async delete(t){delete this.map[t]}},t.InvalidResponseError=f,t.NotImplementedError=d,t.OidcProviderError=p,t.PREFERRED_SIGNING_ALG=o,t.REFRESH_BEFORE_EXPIRATION_SECONDS=5,t.SOLID_CLIENT_AUTHN_KEY_PREFIX="solidClientAuthn:",t.StorageUtility=u,t.StorageUtilityGetResponse=b,t.StorageUtilityMock=y,t.USER_SESSION_PREFIX="solidClientAuthenticationUser",t.buildAuthenticatedFetch=async function(t,e,i){var n;let r,o=e;const a=null==i?void 0:i.refreshOptions;if(void 0!==a){const t=async()=>{var e,n,c,l;try{const{accessToken:n,refreshToken:c,expiresIn:l}=await async function(t,e,i){var n;const r=await t.tokenRefresher.refresh(t.sessionId,t.refreshToken,e);return null==i||i.emit(s.SESSION_EXTENDED,null!==(n=r.expiresIn)&&void 0!==n?n:600),"string"==typeof r.refreshToken&&(null==i||i.emit(s.NEW_REFRESH_TOKEN,r.refreshToken)),{accessToken:r.accessToken,refreshToken:r.refreshToken,expiresIn:r.expiresIn}}(a,i.dpopKey,i.eventEmitter);o=n,void 0!==c&&(a.refreshToken=c),clearTimeout(r),r=setTimeout(t,1e3*w(l)),null===(e=i.eventEmitter)||void 0===e||e.emit(s.TIMEOUT_SET,r)}catch(t){t instanceof p&&(null===(n=null==i?void 0:i.eventEmitter)||void 0===n||n.emit(s.ERROR,t.error,t.errorDescription),null===(c=null==i?void 0:i.eventEmitter)||void 0===c||c.emit(s.SESSION_EXPIRED)),t instanceof f&&t.missingFields.includes("access_token")&&(null===(l=null==i?void 0:i.eventEmitter)||void 0===l||l.emit(s.SESSION_EXPIRED))}};r=setTimeout(t,1e3*w(i.expiresIn)),null===(n=i.eventEmitter)||void 0===n||n.emit(s.TIMEOUT_SET,r)}else if(void 0!==i&&void 0!==i.eventEmitter){const t=setTimeout((()=>{i.eventEmitter.emit(s.SESSION_EXPIRED)}),1e3*w(i.expiresIn));i.eventEmitter.emit(s.TIMEOUT_SET,t)}return async(e,n)=>{let r=await m(t,o,e,n,null==i?void 0:i.dpopKey);const s=!r.ok&&![401,403].includes(r.status);return r.ok||s||r.url!==e&&void 0!==(null==i?void 0:i.dpopKey)&&(r=await m(t,o,r.url,n,i.dpopKey)),r}},t.createDpopHeader=g,t.determineSigningAlg=function(t,e){var i;return null!==(i=e.find((e=>t.includes(e))))&&void 0!==i?i:null},t.fetchJwks=c,t.generateDpopKeyPair=async function(){const{privateKey:t,publicKey:e}=await n.generateKeyPair(o[0]),i={privateKey:t,publicKey:await n.exportJWK(e)};return[i.publicKey.alg]=o,i},t.getSessionIdFromOauthState=async function(t,e){return t.getForUser(e,"sessionId")},t.getWebidFromTokenPayload=async function(t,e,i,r){const o=await c(e,i);let s;try{const{payload:e}=await n.jwtVerify(t,await n.importJWK(o),{issuer:i,audience:r});s=e}catch(t){throw new Error(`Token verification failed: ${t.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(t){throw new Error(`The token has no 'webid' claim, and its 'sub' claim of [${s.sub}] is invalid as a URL - error [${t}].`)}},t.handleRegistration=async function(t,e,i,n){const r=function(t,e){return void 0===t.clientId||l(t.clientId)?e.scopesSupported.includes("webid")&&void 0!==t.clientId&&l(t.clientId)?"solid-oidc":"dynamic":"static"}(t,e);return"dynamic"===r?n.getClient({sessionId:t.sessionId,clientName:t.clientName,redirectUrl:t.redirectUrl},e):(await i.setForUser(t.sessionId,{clientId:t.clientId}),t.clientSecret&&await i.setForUser(t.sessionId,{clientSecret:t.clientSecret}),t.clientName&&await i.setForUser(t.sessionId,{clientName:t.clientName}),{clientId:t.clientId,clientSecret:t.clientSecret,clientName:t.clientName,clientType:r})},t.isSupportedTokenType=function(t){return"string"==typeof t&&["DPoP","Bearer"].includes(t)},t.loadOidcContextFromStorage=async function(t,e,i){try{const[n,r,o,s]=await Promise.all([e.getForUser(t,"issuer",{errorIfNull:!0}),e.getForUser(t,"codeVerifier"),e.getForUser(t,"redirectUrl"),e.getForUser(t,"dpop",{errorIfNull:!0})]);return await e.deleteForUser(t,"codeVerifier"),{codeVerifier:r,redirectUrl:o,issuerConfig:await i.fetchConfig(n),dpop:"true"===s}}catch(e){throw new Error(`Failed to retrieve OIDC context from storage associated with session [${t}]: ${e}`)}},t.mockStorage=x,t.mockStorageUtility=(t,e=!1)=>e?new u(x(t),x({})):new u(x({}),x(t)),t.saveSessionInfoToStorage=async function(t,e,i,r,o,s,a){void 0!==o&&await t.setForUser(e,{refreshToken:o},{secure:s}),void 0!==i&&await t.setForUser(e,{webId:i},{secure:s}),void 0!==r&&await t.setForUser(e,{isLoggedIn:r},{secure:s}),void 0!==a&&await t.setForUser(e,{publicKey:JSON.stringify(a.publicKey),privateKey:JSON.stringify(await n.exportJWK(a.privateKey))},{secure:s})}}}),$o=ue({"../node_modules/@inrupt/solid-client-authn-browser/dist/storage/StorageUtility.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Jo();t.default=class extends e.StorageUtility{constructor(t,e){super(t,e)}}}}),zo=ue({"../node_modules/@inrupt/oidc-client/lib/oidc-client.min.js"(t,e){!function(i,n){if("object"==typeof t&&"object"==typeof e)e.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var r=n();for(var o in r)("object"==typeof t?t:i)[o]=r[o]}}(t,(function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=22)}([function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),n={debug:function(){},info:function(){},warn:function(){},error:function(){}},r=void 0,o=void 0;(e.Log=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.reset=function(){o=3,r=n},t.debug=function(){if(o>=4){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];r.debug.apply(r,Array.from(e))}},t.info=function(){if(o>=3){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];r.info.apply(r,Array.from(e))}},t.warn=function(){if(o>=2){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];r.warn.apply(r,Array.from(e))}},t.error=function(){if(o>=1){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];r.error.apply(r,Array.from(e))}},i(t,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 o},set:function(t){if(!(0<=t&&t<=4))throw new Error("Invalid log level");o=t}},{key:"logger",get:function(){return r},set:function(t){if(!t.debug&&t.info&&(t.debug=t.info),!(t.debug&&t.info&&t.warn&&t.error))throw new Error("Invalid logger");r=t}}]),t}()).reset()},function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),n={setInterval:function(t){function e(e,i){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t,e){return setInterval(t,e)})),clearInterval:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){return clearInterval(t)}))},r=!1,o=null;e.Global=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t._testing=function(){r=!0},t.setXMLHttpRequest=function(t){o=t},i(t,null,[{key:"location",get:function(){if(!r)return location}},{key:"localStorage",get:function(){if(!r&&"undefined"!=typeof window)return localStorage}},{key:"sessionStorage",get:function(){if(!r&&"undefined"!=typeof window)return sessionStorage}},{key:"XMLHttpRequest",get:function(){if(!r&&"undefined"!=typeof window)return o||XMLHttpRequest}},{key:"timer",get:function(){if(!r)return n}}]),t}()},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.MetadataService=void 0;var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),r=i(0),o=i(7);function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var a=".well-known/openid-configuration";e.MetadataService=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.JsonService;if(s(this,t),!e)throw r.Log.error("MetadataService: No settings passed to MetadataService"),new Error("settings");this._settings=e,this._jsonService=new i(["application/jwk-set+json"])}return t.prototype.resetSigningKeys=function(){this._settings=this._settings||{},this._settings.signingKeys=void 0},t.prototype.getMetadata=function(){var t=this;return this._settings.metadata?(r.Log.debug("MetadataService.getMetadata: Returning metadata from settings"),Promise.resolve(this._settings.metadata)):this.metadataUrl?(r.Log.debug("MetadataService.getMetadata: getting metadata from",this.metadataUrl),this._jsonService.getJson(this.metadataUrl).then((function(e){return r.Log.debug("MetadataService.getMetadata: json received"),t._settings.metadata=Object.assign({},t._settings.metadataSeed||{},e),t._settings.metadata}))):(r.Log.error("MetadataService.getMetadata: No authority or metadataUrl configured on settings"),Promise.reject(new Error("No authority or metadataUrl configured on settings")))},t.prototype.getIssuer=function(){return this._getMetadataProperty("issuer")},t.prototype.getAuthorizationEndpoint=function(){return this._getMetadataProperty("authorization_endpoint")},t.prototype.getUserInfoEndpoint=function(){return this._getMetadataProperty("userinfo_endpoint")},t.prototype.getTokenEndpoint=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._getMetadataProperty("token_endpoint",t)},t.prototype.getCheckSessionIframe=function(){return this._getMetadataProperty("check_session_iframe",!0)},t.prototype.getEndSessionEndpoint=function(){return this._getMetadataProperty("end_session_endpoint",!0)},t.prototype.getRevocationEndpoint=function(){return this._getMetadataProperty("revocation_endpoint",!0)},t.prototype.getKeysEndpoint=function(){return this._getMetadataProperty("jwks_uri",!0)},t.prototype._getMetadataProperty=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return r.Log.debug("MetadataService.getMetadataProperty for: "+t),this.getMetadata().then((function(i){if(r.Log.debug("MetadataService.getMetadataProperty: metadata recieved"),void 0===i[t]){if(!0===e)return void r.Log.warn("MetadataService.getMetadataProperty: Metadata does not contain optional property "+t);throw r.Log.error("MetadataService.getMetadataProperty: Metadata does not contain property "+t),new Error("Metadata does not contain property "+t)}return i[t]}))},t.prototype.getSigningKeys=function(){var t=this;return this._settings.signingKeys?(r.Log.debug("MetadataService.getSigningKeys: Returning signingKeys from settings"),Promise.resolve(this._settings.signingKeys)):this._getMetadataProperty("jwks_uri").then((function(e){return r.Log.debug("MetadataService.getSigningKeys: jwks_uri received",e),t._jsonService.getJson(e).then((function(e){if(r.Log.debug("MetadataService.getSigningKeys: key set received",e),!e.keys)throw r.Log.error("MetadataService.getSigningKeys: Missing keys on keyset"),new Error("Missing keys on keyset");return t._settings.signingKeys=e.keys,t._settings.signingKeys}))}))},n(t,[{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(a)<0&&("/"!==this._metadataUrl[this._metadataUrl.length-1]&&(this._metadataUrl+="/"),this._metadataUrl+=a))),this._metadataUrl}}]),t}()},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.UrlUtility=void 0;var n=i(0),r=i(1);e.UrlUtility=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.addQueryParam=function(t,e,i){return t.indexOf("?")<0&&(t+="?"),"?"!==t[t.length-1]&&(t+="&"),t+=encodeURIComponent(e),(t+="=")+encodeURIComponent(i)},t.parseUrlFragment=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.Global;"string"!=typeof t&&(t=i.location.href);var o=t.lastIndexOf(e);o>=0&&(t=t.substr(o+1)),"?"===e&&(o=t.indexOf("#"))>=0&&(t=t.substr(0,o));for(var s,a={},c=/([^&=]+)=([^&]*)/g,l=0;s=c.exec(t);)if(a[decodeURIComponent(s[1])]=decodeURIComponent(s[2].replace(/\+/g," ")),l++>50)return n.Log.error("UrlUtility.parseUrlFragment: response exceeded expected number of parameters",t),{error:"Response exceeded expected number of parameters"};for(var u in a)return a;return{}},t}()},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.JoseUtil=void 0;var n,r=i(26),o=(n=i(33))&&n.__esModule?n:{default:n};e.JoseUtil=(0,o.default)({jws:r.jws,KeyUtil:r.KeyUtil,X509:r.X509,crypto:r.crypto,hextob64u:r.hextob64u,b64tohex:r.b64tohex,AllowedSigningAlgs:r.AllowedSigningAlgs})},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.OidcClientSettings=void 0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),o=i(0),s=i(23),a=i(6),c=i(24),l=i(2);function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var h=".well-known/openid-configuration",d="id_token",f="openid",p="client_secret_post";e.OidcClientSettings=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.authority,r=e.metadataUrl,o=e.metadata,h=e.signingKeys,v=e.metadataSeed,g=e.client_id,m=e.client_secret,w=e.response_type,b=void 0===w?d:w,y=e.scope,x=void 0===y?f:y,k=e.redirect_uri,E=e.post_logout_redirect_uri,S=e.client_authentication,F=void 0===S?p:S,A=e.prompt,_=e.display,j=e.max_age,C=e.ui_locales,R=e.acr_values,I=e.resource,T=e.response_mode,O=e.filterProtocolClaims,P=void 0===O||O,N=e.loadUserInfo,D=void 0===N||N,M=e.staleStateAge,U=void 0===M?900:M,L=e.clockSkew,B=void 0===L?300:L,J=e.clockService,$=void 0===J?new s.ClockService:J,z=e.userInfoJwtIssuer,H=void 0===z?"OP":z,K=e.mergeClaims,W=void 0!==K&&K,q=e.stateStore,V=void 0===q?new a.WebStorageStateStore:q,G=e.ResponseValidatorCtor,X=void 0===G?c.ResponseValidator:G,Y=e.MetadataServiceCtor,Z=void 0===Y?l.MetadataService:Y,Q=e.extraQueryParams,tt=void 0===Q?{}:Q,et=e.extraTokenParams,it=void 0===et?{}:et;u(this,t),this._authority=i,this._metadataUrl=r,this._metadata=o,this._metadataSeed=v,this._signingKeys=h,this._client_id=g,this._client_secret=m,this._response_type=b,this._scope=x,this._redirect_uri=k,this._post_logout_redirect_uri=E,this._client_authentication=F,this._prompt=A,this._display=_,this._max_age=j,this._ui_locales=C,this._acr_values=R,this._resource=I,this._response_mode=T,this._filterProtocolClaims=!!P,this._loadUserInfo=!!D,this._staleStateAge=U,this._clockSkew=B,this._clockService=$,this._userInfoJwtIssuer=H,this._mergeClaims=!!W,this._stateStore=V,this._validator=new X(this),this._metadataService=new Z(this),this._extraQueryParams="object"===(void 0===tt?"undefined":n(tt))?tt:{},this._extraTokenParams="object"===(void 0===it?"undefined":n(it))?it:{}}return t.prototype.getEpochTime=function(){return this._clockService.getEpochTime()},r(t,[{key:"client_id",get:function(){return this._client_id},set:function(t){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=t}},{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(t){if(this._authority)throw o.Log.error("OidcClientSettings.set_authority: authority has already been assigned."),new Error("authority has already been assigned.");this._authority=t}},{key:"metadataUrl",get:function(){return this._metadataUrl||(this._metadataUrl=this.authority,this._metadataUrl&&this._metadataUrl.indexOf(h)<0&&("/"!==this._metadataUrl[this._metadataUrl.length-1]&&(this._metadataUrl+="/"),this._metadataUrl+=h)),this._metadataUrl}},{key:"metadata",get:function(){return this._metadata},set:function(t){this._metadata=t}},{key:"metadataSeed",get:function(){return this._metadataSeed},set:function(t){this._metadataSeed=t}},{key:"signingKeys",get:function(){return this._signingKeys},set:function(t){this._signingKeys=t}},{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(t){this._extraQueryParams="object"===(void 0===t?"undefined":n(t))?t:{}}},{key:"extraTokenParams",get:function(){return this._extraTokenParams},set:function(t){this._extraTokenParams="object"===(void 0===t?"undefined":n(t))?t:{}}}]),t}()},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.WebStorageStateStore=void 0;var n=i(0),r=i(1);function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.WebStorageStateStore=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.prefix,n=void 0===i?"oidc.":i,s=e.store,a=void 0===s?r.Global.localStorage:s;o(this,t),this._store=a,this._prefix=n}return t.prototype.set=function(t,e){return n.Log.debug("WebStorageStateStore.set",t),this._store.setItem(t=this._prefix+t,e),Promise.resolve()},t.prototype.get=function(t){n.Log.debug("WebStorageStateStore.get",t);var e=this._store.getItem(t=this._prefix+t);return Promise.resolve(e)},t.prototype.remove=function(t){n.Log.debug("WebStorageStateStore.remove",t);var e=this._store.getItem(t=this._prefix+t);return this._store.removeItem(t),Promise.resolve(e)},t.prototype.getAllKeys=function(){n.Log.debug("WebStorageStateStore.getAllKeys");for(var t=[],e=0;e<this._store.length;e++){var i=this._store.key(e);0===i.indexOf(this._prefix)&&t.push(i.substr(this._prefix.length))}return Promise.resolve(t)},t}()},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.JsonService=void 0;var n=i(0),r=i(1);function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.JsonService=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.Global.XMLHttpRequest,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;o(this,t),this._contentTypes=e&&Array.isArray(e)?e.slice():[],this._contentTypes.push("application/json"),n&&this._contentTypes.push("application/jwt"),this._XMLHttpRequest=i,this._jwtHandler=n}return t.prototype.getJson=function(t,e){var i=this;if(!t)throw n.Log.error("JsonService.getJson: No url passed"),new Error("url");return n.Log.debug("JsonService.getJson, url: ",t),new Promise((function(r,o){var s=new i._XMLHttpRequest;s.open("GET",t);var a=i._contentTypes,c=i._jwtHandler;s.onload=function(){if(n.Log.debug("JsonService.getJson: HTTP response received, status",s.status),200===s.status){var e=s.getResponseHeader("Content-Type");if(e){var i=a.find((function(t){if(e.startsWith(t))return!0}));if("application/jwt"==i)return void c(s).then(r,o);if(i)try{return void r(JSON.parse(s.responseText))}catch(t){return n.Log.error("JsonService.getJson: Error parsing JSON response",t.message),void o(t)}}o(Error("Invalid response Content-Type: "+e+", from URL: "+t))}else o(Error(s.statusText+" ("+s.status+")"))},s.onerror=function(){n.Log.error("JsonService.getJson: network error"),o(Error("Network Error"))},e&&(n.Log.debug("JsonService.getJson: token passed, setting Authorization header"),s.setRequestHeader("Authorization","Bearer "+e)),s.send()}))},t.prototype.postForm=function(t,e,i){var r=this;if(!t)throw n.Log.error("JsonService.postForm: No url passed"),new Error("url");return n.Log.debug("JsonService.postForm, url: ",t),new Promise((function(o,s){var a=new r._XMLHttpRequest;a.open("POST",t);var c=r._contentTypes;a.onload=function(){if(n.Log.debug("JsonService.postForm: HTTP response received, status",a.status),200!==a.status){if(400===a.status&&(i=a.getResponseHeader("Content-Type"))&&c.find((function(t){if(i.startsWith(t))return!0})))try{var e=JSON.parse(a.responseText);if(e&&e.error)return n.Log.error("JsonService.postForm: Error from server: ",e.error),void s(new Error(e.error))}catch(t){return n.Log.error("JsonService.postForm: Error parsing JSON response",t.message),void s(t)}s(Error(a.statusText+" ("+a.status+")"))}else{var i;if((i=a.getResponseHeader("Content-Type"))&&c.find((function(t){if(i.startsWith(t))return!0})))try{return void o(JSON.parse(a.responseText))}catch(t){return n.Log.error("JsonService.postForm: Error parsing JSON response",t.message),void s(t)}s(Error("Invalid response Content-Type: "+i+", from URL: "+t))}},a.onerror=function(){n.Log.error("JsonService.postForm: network error"),s(Error("Network Error"))};var l="";for(var u in e){var h=e[u];h&&(l.length>0&&(l+="&"),l+=encodeURIComponent(u),l+="=",l+=encodeURIComponent(h))}a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),void 0!==i&&a.setRequestHeader("Authorization","Basic "+btoa(i)),a.send(l)}))},t}()},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.SigninRequest=void 0;var n=i(0),r=i(3),o=i(13);e.SigninRequest=function(){function t(e){var i=e.url,s=e.client_id,a=e.redirect_uri,c=e.response_type,l=e.scope,u=e.authority,h=e.data,d=e.prompt,f=e.display,p=e.max_age,v=e.ui_locales,g=e.id_token_hint,m=e.login_hint,w=e.acr_values,b=e.resource,y=e.response_mode,x=e.request,k=e.request_uri,E=e.extraQueryParams,S=e.request_type,F=e.client_secret,A=e.extraTokenParams,_=e.skipUserInfo;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!i)throw n.Log.error("SigninRequest.ctor: No url passed"),new Error("url");if(!s)throw n.Log.error("SigninRequest.ctor: No client_id passed"),new Error("client_id");if(!a)throw n.Log.error("SigninRequest.ctor: No redirect_uri passed"),new Error("redirect_uri");if(!c)throw n.Log.error("SigninRequest.ctor: No response_type passed"),new Error("response_type");if(!l)throw n.Log.error("SigninRequest.ctor: No scope passed"),new Error("scope");if(!u)throw n.Log.error("SigninRequest.ctor: No authority passed"),new Error("authority");var j=t.isOidc(c),C=t.isCode(c);y||(y=t.isCode(c)?"query":null),this.state=new o.SigninState({nonce:j,data:h,client_id:s,authority:u,redirect_uri:a,code_verifier:C,request_type:S,response_mode:y,client_secret:F,scope:l,extraTokenParams:A,skipUserInfo:_}),i=r.UrlUtility.addQueryParam(i,"client_id",s),i=r.UrlUtility.addQueryParam(i,"redirect_uri",a),i=r.UrlUtility.addQueryParam(i,"response_type",c),i=r.UrlUtility.addQueryParam(i,"scope",l),i=r.UrlUtility.addQueryParam(i,"state",this.state.id),j&&(i=r.UrlUtility.addQueryParam(i,"nonce",this.state.nonce)),C&&(i=r.UrlUtility.addQueryParam(i,"code_challenge",this.state.code_challenge),i=r.UrlUtility.addQueryParam(i,"code_challenge_method","S256"));var R={prompt:d,display:f,max_age:p,ui_locales:v,id_token_hint:g,login_hint:m,acr_values:w,resource:b,request:x,request_uri:k,response_mode:y};for(var I in R)R[I]&&(i=r.UrlUtility.addQueryParam(i,I,R[I]));for(var T in E)i=r.UrlUtility.addQueryParam(i,T,E[T]);this.url=i}return t.isOidc=function(t){return!!t.split(/\s+/g).filter((function(t){return"id_token"===t}))[0]},t.isOAuth=function(t){return!!t.split(/\s+/g).filter((function(t){return"token"===t}))[0]},t.isCode=function(t){return!!t.split(/\s+/g).filter((function(t){return"code"===t}))[0]},t}()},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.State=void 0;var n,r=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),o=i(0),s=(n=i(14))&&n.__esModule?n:{default:n};function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.State=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.id,n=e.data,r=e.created,o=e.request_type;a(this,t),this._id=i||(0,s.default)(),this._data=n,this._created="number"==typeof r&&r>0?r:parseInt(Date.now()/1e3),this._request_type=o}return t.prototype.toStorageString=function(){return o.Log.debug("State.toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type})},t.fromStorageString=function(e){return o.Log.debug("State.fromStorageString"),new t(JSON.parse(e))},t.clearStaleState=function(e,i){var n=Date.now()/1e3-i;return e.getAllKeys().then((function(i){o.Log.debug("State.clearStaleState: got keys",i);for(var r=[],s=function(s){var a=i[s];c=e.get(a).then((function(i){var r=!1;if(i)try{var s=t.fromStorageString(i);o.Log.debug("State.clearStaleState: got item from key: ",a,s.created),s.created<=n&&(r=!0)}catch(t){o.Log.error("State.clearStaleState: Error parsing state for key",a,t.message),r=!0}else o.Log.debug("State.clearStaleState: no item in storage for key: ",a),r=!0;if(r)return o.Log.debug("State.clearStaleState: removed item for key: ",a),e.remove(a)})),r.push(c)},a=0;a<i.length;a++){var c;s(a)}return o.Log.debug("State.clearStaleState: waiting on promise count:",r.length),Promise.all(r)}))},r(t,[{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}}]),t}()},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.OidcClient=void 0;var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),r=i(0),o=i(5),s=i(12),a=i(8),c=i(34),l=i(35),u=i(36),h=i(13),d=i(9);function f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.OidcClient=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};f(this,t),this._settings=e instanceof o.OidcClientSettings?e:new o.OidcClientSettings(e)}return t.prototype.createSigninRequest=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.response_type,n=e.scope,o=e.redirect_uri,s=e.data,c=e.state,l=e.prompt,u=e.display,h=e.max_age,d=e.ui_locales,f=e.id_token_hint,p=e.login_hint,v=e.acr_values,g=e.resource,m=e.request,w=e.request_uri,b=e.response_mode,y=e.extraQueryParams,x=e.extraTokenParams,k=e.request_type,E=e.skipUserInfo,S=arguments[1];r.Log.debug("OidcClient.createSigninRequest");var F=this._settings.client_id;n=n||this._settings.scope,o=o||this._settings.redirect_uri,l=l||this._settings.prompt,u=u||this._settings.display,h=h||this._settings.max_age,d=d||this._settings.ui_locales,v=v||this._settings.acr_values,g=g||this._settings.resource,b=b||this._settings.response_mode,y=y||this._settings.extraQueryParams,x=x||this._settings.extraTokenParams;var A=this._settings.authority;return a.SigninRequest.isCode(i=i||this._settings.response_type)&&"code"!==i?Promise.reject(new Error("OpenID Connect hybrid flow is not supported")):this._metadataService.getAuthorizationEndpoint().then((function(e){r.Log.debug("OidcClient.createSigninRequest: Received authorization endpoint",e);var _=new a.SigninRequest({url:e,client_id:F,redirect_uri:o,response_type:i,scope:n,data:s||c,authority:A,prompt:l,display:u,max_age:h,ui_locales:d,id_token_hint:f,login_hint:p,acr_values:v,resource:g,request:m,request_uri:w,extraQueryParams:y,extraTokenParams:x,request_type:k,response_mode:b,client_secret:t._settings.client_secret,skipUserInfo:E}),j=_.state;return(S=S||t._stateStore).set(j.id,j.toStorageString()).then((function(){return _}))}))},t.prototype.readSigninResponseState=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];r.Log.debug("OidcClient.readSigninResponseState");var n="query"===this._settings.response_mode||!this._settings.response_mode&&a.SigninRequest.isCode(this._settings.response_type),o=n?"?":"#",s=new c.SigninResponse(t,o);if(!s.state)return r.Log.error("OidcClient.readSigninResponseState: No state in response"),Promise.reject(new Error("No state in response"));e=e||this._stateStore;var l=i?e.remove.bind(e):e.get.bind(e);return l(s.state).then((function(t){if(!t)throw r.Log.error("OidcClient.readSigninResponseState: No matching state found in storage"),new Error("No matching state found in storage");return{state:h.SigninState.fromStorageString(t),response:s}}))},t.prototype.processSigninResponse=function(t,e){var i=this;return r.Log.debug("OidcClient.processSigninResponse"),this.readSigninResponseState(t,e,!0).then((function(t){var e=t.state,n=t.response;return r.Log.debug("OidcClient.processSigninResponse: Received state from storage; validating response"),i._validator.validateSigninResponse(e,n)}))},t.prototype.createSignoutRequest=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.id_token_hint,n=e.data,o=e.state,s=e.post_logout_redirect_uri,a=e.extraQueryParams,c=e.request_type,u=arguments[1];return r.Log.debug("OidcClient.createSignoutRequest"),s=s||this._settings.post_logout_redirect_uri,a=a||this._settings.extraQueryParams,this._metadataService.getEndSessionEndpoint().then((function(e){if(!e)throw r.Log.error("OidcClient.createSignoutRequest: No end session endpoint url returned"),new Error("no end session endpoint");r.Log.debug("OidcClient.createSignoutRequest: Received end session endpoint",e);var h=new l.SignoutRequest({url:e,id_token_hint:i,post_logout_redirect_uri:s,data:n||o,extraQueryParams:a,request_type:c}),d=h.state;return d&&(r.Log.debug("OidcClient.createSignoutRequest: Signout request has state to persist"),(u=u||t._stateStore).set(d.id,d.toStorageString())),h}))},t.prototype.readSignoutResponseState=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];r.Log.debug("OidcClient.readSignoutResponseState");var n=new u.SignoutResponse(t);if(!n.state)return r.Log.debug("OidcClient.readSignoutResponseState: No state in response"),n.error?(r.Log.warn("OidcClient.readSignoutResponseState: Response was error: ",n.error),Promise.reject(new s.ErrorResponse(n))):Promise.resolve({state:void 0,response:n});var o=n.state;e=e||this._stateStore;var a=i?e.remove.bind(e):e.get.bind(e);return a(o).then((function(t){if(!t)throw r.Log.error("OidcClient.readSignoutResponseState: No matching state found in storage"),new Error("No matching state found in storage");return{state:d.State.fromStorageString(t),response:n}}))},t.prototype.processSignoutResponse=function(t,e){var i=this;return r.Log.debug("OidcClient.processSignoutResponse"),this.readSignoutResponseState(t,e,!0).then((function(t){var e=t.state,n=t.response;return e?(r.Log.debug("OidcClient.processSignoutResponse: Received state from storage; validating response"),i._validator.validateSignoutResponse(e,n)):(r.Log.debug("OidcClient.processSignoutResponse: No state from storage; skipping validating response"),n)}))},t.prototype.clearStaleState=function(t){return r.Log.debug("OidcClient.clearStaleState"),d.State.clearStaleState(t=t||this._stateStore,this.settings.staleStateAge)},n(t,[{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}}]),t}()},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.TokenClient=void 0;var n=i(7),r=i(2),o=i(0);function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.TokenClient=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.JsonService,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.MetadataService;if(s(this,t),!e)throw o.Log.error("TokenClient.ctor: No settings passed"),new Error("settings");this._settings=e,this._jsonService=new i,this._metadataService=new a(this._settings)}return t.prototype.exchangeCode=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).grant_type=e.grant_type||"authorization_code",e.client_id=e.client_id||this._settings.client_id,e.client_secret=e.client_secret||this._settings.client_secret,e.redirect_uri=e.redirect_uri||this._settings.redirect_uri;var i=void 0,n=e._client_authentication||this._settings._client_authentication;return delete e._client_authentication,e.code?e.redirect_uri?e.code_verifier?e.client_id?e.client_secret||"client_secret_basic"!=n?("client_secret_basic"==n&&(i=e.client_id+":"+e.client_secret,delete e.client_id,delete e.client_secret),this._metadataService.getTokenEndpoint(!1).then((function(n){return o.Log.debug("TokenClient.exchangeCode: Received token endpoint"),t._jsonService.postForm(n,e,i).then((function(t){return o.Log.debug("TokenClient.exchangeCode: response received"),t}))}))):(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")))},t.prototype.exchangeRefreshToken=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).grant_type=e.grant_type||"refresh_token",e.client_id=e.client_id||this._settings.client_id,e.client_secret=e.client_secret||this._settings.client_secret;var i=void 0,n=e._client_authentication||this._settings._client_authentication;return delete e._client_authentication,e.refresh_token?e.client_id?("client_secret_basic"==n&&(i=e.client_id+":"+e.client_secret,delete e.client_id,delete e.client_secret),this._metadataService.getTokenEndpoint(!1).then((function(n){return o.Log.debug("TokenClient.exchangeRefreshToken: Received token endpoint"),t._jsonService.postForm(n,e,i).then((function(t){return o.Log.debug("TokenClient.exchangeRefreshToken: response received"),t}))}))):(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")))},t}()},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.ErrorResponse=void 0;var n=i(0);function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}e.ErrorResponse=function(t){function e(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=i.error,a=i.error_description,c=i.error_uri,l=i.state,u=i.session_state;if(r(this,e),!s)throw n.Log.error("No error passed to ErrorResponse"),new Error("error");var h=o(this,t.call(this,a||s));return h.name="ErrorResponse",h.error=s,h.error_description=a,h.error_uri=c,h.state=l,h.session_state=u,h}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e}(Error)},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.SigninState=void 0;var n,r=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),o=i(0),s=i(9),a=i(4),c=(n=i(14))&&n.__esModule?n:{default:n};function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}e.SigninState=function(t){function e(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=i.nonce,r=i.authority,o=i.client_id,s=i.redirect_uri,h=i.code_verifier,d=i.response_mode,f=i.client_secret,p=i.scope,v=i.extraTokenParams,g=i.skipUserInfo;l(this,e);var m=u(this,t.call(this,arguments[0]));if(!0===n?m._nonce=(0,c.default)():n&&(m._nonce=n),!0===h?m._code_verifier=(0,c.default)()+(0,c.default)()+(0,c.default)():h&&(m._code_verifier=h),m.code_verifier){var w=a.JoseUtil.hashString(m.code_verifier,"SHA256");m._code_challenge=a.JoseUtil.hexToBase64Url(w)}return m._redirect_uri=s,m._authority=r,m._client_id=o,m._response_mode=d,m._client_secret=f,m._scope=p,m._extraTokenParams=v,m._skipUserInfo=g,m}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.toStorageString=function(){return o.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})},e.fromStorageString=function(t){return o.Log.debug("SigninState.fromStorageString"),new e(JSON.parse(t))},r(e,[{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}}]),e}(s.State)},function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){return("undefined"!=i&&null!==i&&void 0!==i.getRandomValues?n:r)().replace(/-/g,"")};var i="undefined"!=typeof window?window.crypto||window.msCrypto:null;function n(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(function(t){return(t^i.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16)}))}function r(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(function(t){return(t^16*Math.random()>>t/4).toString(16)}))}t.exports=e.default},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.User=void 0;var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),r=i(0);e.User=function(){function t(e){var i=e.id_token,n=e.session_state,r=e.access_token,o=e.refresh_token,s=e.token_type,a=e.scope,c=e.profile,l=e.expires_at,u=e.state;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.id_token=i,this.session_state=n,this.access_token=r,this.refresh_token=o,this.token_type=s,this.scope=a,this.profile=c,this.expires_at=l,this.state=u}return t.prototype.toStorageString=function(){return r.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})},t.fromStorageString=function(e){return r.Log.debug("User.fromStorageString"),new t(JSON.parse(e))},n(t,[{key:"expires_in",get:function(){if(this.expires_at){var t=parseInt(Date.now()/1e3);return this.expires_at-t}},set:function(t){var e=parseInt(t);if("number"==typeof e&&e>0){var i=parseInt(Date.now()/1e3);this.expires_at=i+e}}},{key:"expired",get:function(){var t=this.expires_in;if(void 0!==t)return t<=0}},{key:"scopes",get:function(){return(this.scope||"").split(" ")}}]),t}()},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.AccessTokenEvents=void 0;var n=i(0),r=i(46);function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.AccessTokenEvents=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.accessTokenExpiringNotificationTime,n=void 0===i?60:i,s=e.accessTokenExpiringTimer,a=void 0===s?new r.Timer("Access token expiring"):s,c=e.accessTokenExpiredTimer,l=void 0===c?new r.Timer("Access token expired"):c;o(this,t),this._accessTokenExpiringNotificationTime=n,this._accessTokenExpiring=a,this._accessTokenExpired=l}return t.prototype.load=function(t){if(t.access_token&&void 0!==t.expires_in){var e=t.expires_in;if(n.Log.debug("AccessTokenEvents.load: access token present, remaining duration:",e),e>0){var i=e-this._accessTokenExpiringNotificationTime;i<=0&&(i=1),n.Log.debug("AccessTokenEvents.load: registering expiring timer in:",i),this._accessTokenExpiring.init(i)}else n.Log.debug("AccessTokenEvents.load: canceling existing expiring timer becase we're past expiration."),this._accessTokenExpiring.cancel();var r=e+1;n.Log.debug("AccessTokenEvents.load: registering expired timer in:",r),this._accessTokenExpired.init(r)}else this._accessTokenExpiring.cancel(),this._accessTokenExpired.cancel()},t.prototype.unload=function(){n.Log.debug("AccessTokenEvents.unload: canceling existing access token timers"),this._accessTokenExpiring.cancel(),this._accessTokenExpired.cancel()},t.prototype.addAccessTokenExpiring=function(t){this._accessTokenExpiring.addHandler(t)},t.prototype.removeAccessTokenExpiring=function(t){this._accessTokenExpiring.removeHandler(t)},t.prototype.addAccessTokenExpired=function(t){this._accessTokenExpired.addHandler(t)},t.prototype.removeAccessTokenExpired=function(t){this._accessTokenExpired.removeHandler(t)},t}()},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.Event=void 0;var n=i(0);e.Event=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._name=e,this._callbacks=[]}return t.prototype.addHandler=function(t){this._callbacks.push(t)},t.prototype.removeHandler=function(t){var e=this._callbacks.findIndex((function(e){return e===t}));e>=0&&this._callbacks.splice(e,1)},t.prototype.raise=function(){n.Log.debug("Event: Raising event: "+this._name);for(var t=0;t<this._callbacks.length;t++){var e;(e=this._callbacks)[t].apply(e,arguments)}},t}()},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.SessionMonitor=void 0;var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),r=i(0),o=i(19),s=i(1);function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.SessionMonitor=function(){function t(e){var i=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.CheckSessionIFrame,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.Global.timer;if(a(this,t),!e)throw r.Log.error("SessionMonitor.ctor: No user manager passed to SessionMonitor"),new Error("userManager");this._userManager=e,this._CheckSessionIFrameCtor=n,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(t){t?i._start(t):i._settings.monitorAnonymousSession&&i._userManager.querySessionStatus().then((function(t){var e={session_state:t.session_state};t.sub&&t.sid&&(e.profile={sub:t.sub,sid:t.sid}),i._start(e)})).catch((function(t){r.Log.error("SessionMonitor ctor: error from querySessionStatus:",t.message)}))})).catch((function(t){r.Log.error("SessionMonitor ctor: error from getUser:",t.message)})))}return t.prototype._start=function(t){var e=this,i=t.session_state;i&&(t.profile?(this._sub=t.profile.sub,this._sid=t.profile.sid,r.Log.debug("SessionMonitor._start: session_state:",i,", sub:",this._sub)):(this._sub=void 0,this._sid=void 0,r.Log.debug("SessionMonitor._start: session_state:",i,", anonymous user")),this._checkSessionIFrame?this._checkSessionIFrame.start(i):this._metadataService.getCheckSessionIframe().then((function(t){if(t){r.Log.debug("SessionMonitor._start: Initializing check session iframe");var n=e._client_id,o=e._checkSessionInterval,s=e._stopCheckSessionOnError;e._checkSessionIFrame=new e._CheckSessionIFrameCtor(e._callback.bind(e),n,t,o,s),e._checkSessionIFrame.load().then((function(){e._checkSessionIFrame.start(i)}))}else r.Log.warn("SessionMonitor._start: No check session iframe found in the metadata")})).catch((function(t){r.Log.error("SessionMonitor._start: Error from getCheckSessionIframe:",t.message)})))},t.prototype._stop=function(){var t=this;if(this._sub=void 0,this._sid=void 0,this._checkSessionIFrame&&(r.Log.debug("SessionMonitor._stop"),this._checkSessionIFrame.stop()),this._settings.monitorAnonymousSession)var e=this._timer.setInterval((function(){t._timer.clearInterval(e),t._userManager.querySessionStatus().then((function(e){var i={session_state:e.session_state};e.sub&&e.sid&&(i.profile={sub:e.sub,sid:e.sid}),t._start(i)})).catch((function(t){r.Log.error("SessionMonitor: error from querySessionStatus:",t.message)}))}),1e3)},t.prototype._callback=function(){var t=this;this._userManager.querySessionStatus().then((function(e){var i=!0;e?e.sub===t._sub?(i=!1,t._checkSessionIFrame.start(e.session_state),e.sid===t._sid?r.Log.debug("SessionMonitor._callback: Same sub still logged in at OP, restarting check session iframe; session_state:",e.session_state):(r.Log.debug("SessionMonitor._callback: Same sub still logged in at OP, session state has changed, restarting check session iframe; session_state:",e.session_state),t._userManager.events._raiseUserSessionChanged())):r.Log.debug("SessionMonitor._callback: Different subject signed into OP:",e.sub):r.Log.debug("SessionMonitor._callback: Subject no longer signed into OP"),i&&(t._sub?(r.Log.debug("SessionMonitor._callback: SessionMonitor._callback; raising signed out event"),t._userManager.events._raiseUserSignedOut()):(r.Log.debug("SessionMonitor._callback: SessionMonitor._callback; raising signed in event"),t._userManager.events._raiseUserSignedIn()))})).catch((function(e){t._sub&&(r.Log.debug("SessionMonitor._callback: Error calling queryCurrentSigninSession; raising signed out event",e.message),t._userManager.events._raiseUserSignedOut())}))},n(t,[{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}}]),t}()},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.CheckSessionIFrame=void 0;var n=i(0);function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.CheckSessionIFrame=function(){function t(e,i,n,o){var s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];r(this,t),this._callback=e,this._client_id=i,this._url=n,this._interval=o||2e3,this._stopOnError=s;var a=n.indexOf("/",n.indexOf("//")+2);this._frame_origin=n.substr(0,a),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=n}return t.prototype.load=function(){var t=this;return new Promise((function(e){t._frame.onload=function(){e()},window.document.body.appendChild(t._frame),t._boundMessageEvent=t._message.bind(t),window.addEventListener("message",t._boundMessageEvent,!1)}))},t.prototype._message=function(t){t.origin===this._frame_origin&&t.source===this._frame.contentWindow&&("error"===t.data?(n.Log.error("CheckSessionIFrame: error message from check session op iframe"),this._stopOnError&&this.stop()):"changed"===t.data?(n.Log.debug("CheckSessionIFrame: changed message from check session op iframe"),this.stop(),this._callback()):n.Log.debug("CheckSessionIFrame: "+t.data+" message from check session op iframe"))},t.prototype.start=function(t){var e=this;if(this._session_state!==t){n.Log.debug("CheckSessionIFrame.start"),this.stop(),this._session_state=t;var i=function(){e._frame.contentWindow.postMessage(e._client_id+" "+e._session_state,e._frame_origin)};i(),this._timer=window.setInterval(i,this._interval)}},t.prototype.stop=function(){this._session_state=null,this._timer&&(n.Log.debug("CheckSessionIFrame.stop"),window.clearInterval(this._timer),this._timer=null)},t}()},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.TokenRevocationClient=void 0;var n=i(0),r=i(2),o=i(1);function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var a="access_token",c="refresh_token";e.TokenRevocationClient=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.Global.XMLHttpRequest,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.MetadataService;if(s(this,t),!e)throw n.Log.error("TokenRevocationClient.ctor: No settings provided"),new Error("No settings provided.");this._settings=e,this._XMLHttpRequestCtor=i,this._metadataService=new a(this._settings)}return t.prototype.revoke=function(t,e){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"access_token";if(!t)throw n.Log.error("TokenRevocationClient.revoke: No token provided"),new Error("No token provided.");if(r!==a&&r!=c)throw n.Log.error("TokenRevocationClient.revoke: Invalid token type"),new Error("Invalid token type.");return this._metadataService.getRevocationEndpoint().then((function(o){if(o)return n.Log.debug("TokenRevocationClient.revoke: Revoking "+r),i._revoke(o,i._settings.client_id,i._settings.client_secret,t,r);if(e)throw n.Log.error("TokenRevocationClient.revoke: Revocation not supported"),new Error("Revocation not supported")}))},t.prototype._revoke=function(t,e,i,r,o){var s=this;return new Promise((function(a,c){var l=new s._XMLHttpRequestCtor;l.open("POST",t),l.onload=function(){n.Log.debug("TokenRevocationClient.revoke: HTTP response received, status",l.status),200===l.status?a():c(Error(l.statusText+" ("+l.status+")"))},l.onerror=function(){n.Log.debug("TokenRevocationClient.revoke: Network Error."),c("Network Error")};var u="client_id="+encodeURIComponent(e);i&&(u+="&client_secret="+encodeURIComponent(i)),u+="&token_type_hint="+encodeURIComponent(o),u+="&token="+encodeURIComponent(r),l.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),l.send(u)}))},t}()},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.CordovaPopupWindow=void 0;var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),r=i(0);e.CordovaPopupWindow=function(){function t(e){var i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._promise=new Promise((function(t,e){i._resolve=t,i._reject=e})),this.features=e.popupWindowFeatures||"location=no,toolbar=no,zoom=no",this.target=e.popupWindowTarget||"_blank",this.redirect_uri=e.startUrl,r.Log.debug("CordovaPopupWindow.ctor: redirect_uri: "+this.redirect_uri)}return t.prototype._isInAppBrowserInstalled=function(t){return["cordova-plugin-inappbrowser","cordova-plugin-inappbrowser.inappbrowser","org.apache.cordova.inappbrowser"].some((function(e){return t.hasOwnProperty(e)}))},t.prototype.navigate=function(t){if(t&&t.url){if(!window.cordova)return this._error("cordova is undefined");var e=window.cordova.require("cordova/plugin_list").metadata;if(!1===this._isInAppBrowserInstalled(e))return this._error("InAppBrowser plugin not found");this._popup=cordova.InAppBrowser.open(t.url,this.target,this.features),this._popup?(r.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},t.prototype._loadStartCallback=function(t){0===t.url.indexOf(this.redirect_uri)&&this._success({url:t.url})},t.prototype._exitCallback=function(t){this._error(t)},t.prototype._success=function(t){this._cleanup(),r.Log.debug("CordovaPopupWindow: Successful response from cordova popup window"),this._resolve(t)},t.prototype._error=function(t){this._cleanup(),r.Log.error(t),this._reject(new Error(t))},t.prototype.close=function(){this._cleanup()},t.prototype._cleanup=function(){this._popup&&(r.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},n(t,[{key:"promise",get:function(){return this._promise}}]),t}()},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),r=i(10),o=i(5),s=i(6),a=i(37),c=i(38),l=i(16),u=i(2),h=i(48),d=i(49),f=i(19),p=i(20),v=i(18),g=i(1),m=i(15),w=i(50);e.default={Version:w.Version,Log:n.Log,OidcClient:r.OidcClient,OidcClientSettings:o.OidcClientSettings,WebStorageStateStore:s.WebStorageStateStore,InMemoryWebStorage:a.InMemoryWebStorage,UserManager:c.UserManager,AccessTokenEvents:l.AccessTokenEvents,MetadataService:u.MetadataService,CordovaPopupNavigator:h.CordovaPopupNavigator,CordovaIFrameNavigator:d.CordovaIFrameNavigator,CheckSessionIFrame:f.CheckSessionIFrame,TokenRevocationClient:p.TokenRevocationClient,SessionMonitor:v.SessionMonitor,Global:g.Global,User:m.User},t.exports=e.default},function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ClockService=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.prototype.getEpochTime=function(){return Promise.resolve(Date.now()/1e3|0)},t}()},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.ResponseValidator=void 0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=i(0),o=i(2),s=i(25),a=i(11),c=i(12),l=i(4);function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var h=["nonce","at_hash","iat","nbf","exp","aud","iss","c_hash"];e.ResponseValidator=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.MetadataService,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.UserInfoService,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.JoseUtil,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:a.TokenClient;if(u(this,t),!e)throw r.Log.error("ResponseValidator.ctor: No settings passed to ResponseValidator"),new Error("settings");this._settings=e,this._metadataService=new i(this._settings),this._userInfoService=new n(this._settings),this._joseUtil=c,this._tokenClient=new h(this._settings)}return t.prototype.validateSigninResponse=function(t,e){var i=this;return r.Log.debug("ResponseValidator.validateSigninResponse"),this._processSigninParams(t,e).then((function(e){return r.Log.debug("ResponseValidator.validateSigninResponse: state processed"),i._validateTokens(t,e).then((function(e){return r.Log.debug("ResponseValidator.validateSigninResponse: tokens validated"),i._processClaims(t,e).then((function(t){return r.Log.debug("ResponseValidator.validateSigninResponse: claims processed"),t}))}))}))},t.prototype.validateSignoutResponse=function(t,e){return t.id!==e.state?(r.Log.error("ResponseValidator.validateSignoutResponse: State does not match"),Promise.reject(new Error("State does not match"))):(r.Log.debug("ResponseValidator.validateSignoutResponse: state validated"),e.state=t.data,e.error?(r.Log.warn("ResponseValidator.validateSignoutResponse: Response was error",e.error),Promise.reject(new c.ErrorResponse(e))):Promise.resolve(e))},t.prototype._processSigninParams=function(t,e){if(t.id!==e.state)return r.Log.error("ResponseValidator._processSigninParams: State does not match"),Promise.reject(new Error("State does not match"));if(!t.client_id)return r.Log.error("ResponseValidator._processSigninParams: No client_id on state"),Promise.reject(new Error("No client_id on state"));if(!t.authority)return r.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!==t.authority)return r.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=t.authority;if(this._settings.client_id){if(this._settings.client_id&&this._settings.client_id!==t.client_id)return r.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=t.client_id;return r.Log.debug("ResponseValidator._processSigninParams: state validated"),e.state=t.data,e.error?(r.Log.warn("ResponseValidator._processSigninParams: Response was error",e.error),Promise.reject(new c.ErrorResponse(e))):t.nonce&&!e.id_token?(r.Log.error("ResponseValidator._processSigninParams: Expecting id_token in response"),Promise.reject(new Error("No id_token in response"))):!t.nonce&&e.id_token?(r.Log.error("ResponseValidator._processSigninParams: Not expecting id_token in response"),Promise.reject(new Error("Unexpected id_token in response"))):t.code_verifier&&!e.code?(r.Log.error("ResponseValidator._processSigninParams: Expecting code in response"),Promise.reject(new Error("No code in response"))):!t.code_verifier&&e.code?(r.Log.error("ResponseValidator._processSigninParams: Not expecting code in response"),Promise.reject(new Error("Unexpected code in response"))):(e.scope||(e.scope=t.scope),Promise.resolve(e))},t.prototype._processClaims=function(t,e){var i=this;if(e.isOpenIdConnect){if(r.Log.debug("ResponseValidator._processClaims: response is OIDC, processing claims"),e.profile=this._filterProtocolClaims(e.profile),!0!==t.skipUserInfo&&this._settings.loadUserInfo&&e.access_token)return r.Log.debug("ResponseValidator._processClaims: loading user info"),this._userInfoService.getClaims(e.access_token).then((function(t){return r.Log.debug("ResponseValidator._processClaims: user info claims received from user info endpoint"),t.sub!==e.profile.sub?(r.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"))):(e.profile=i._mergeClaims(e.profile,t),r.Log.debug("ResponseValidator._processClaims: user info claims received, updated profile:",e.profile),e)}));r.Log.debug("ResponseValidator._processClaims: not loading user info")}else r.Log.debug("ResponseValidator._processClaims: response is not OIDC, not processing claims");return Promise.resolve(e)},t.prototype._mergeClaims=function(t,e){var i=Object.assign({},t);for(var r in e){var o=e[r];Array.isArray(o)||(o=[o]);for(var s=0;s<o.length;s++){var a=o[s];i[r]?Array.isArray(i[r])?i[r].indexOf(a)<0&&i[r].push(a):i[r]!==a&&(i[r]="object"===(void 0===a?"undefined":n(a))&&this._settings.mergeClaims?this._mergeClaims(i[r],a):[i[r],a]):i[r]=a}}return i},t.prototype._filterProtocolClaims=function(t){r.Log.debug("ResponseValidator._filterProtocolClaims, incoming claims:",t);var e=Object.assign({},t);return this._settings._filterProtocolClaims?(h.forEach((function(t){delete e[t]})),r.Log.debug("ResponseValidator._filterProtocolClaims: protocol claims filtered",e)):r.Log.debug("ResponseValidator._filterProtocolClaims: protocol claims not filtered"),e},t.prototype._validateTokens=function(t,e){return e.code?(r.Log.debug("ResponseValidator._validateTokens: Validating code"),this._processCode(t,e)):e.id_token?e.access_token?(r.Log.debug("ResponseValidator._validateTokens: Validating id_token and access_token"),this._validateIdTokenAndAccessToken(t,e)):(r.Log.debug("ResponseValidator._validateTokens: Validating id_token"),this._validateIdToken(t,e)):(r.Log.debug("ResponseValidator._validateTokens: No code to process or id_token to validate"),Promise.resolve(e))},t.prototype._processCode=function(t,e){var i=this,o={client_id:t.client_id,client_secret:t.client_secret,code:e.code,redirect_uri:t.redirect_uri,code_verifier:t.code_verifier};return t.extraTokenParams&&"object"===n(t.extraTokenParams)&&Object.assign(o,t.extraTokenParams),this._tokenClient.exchangeCode(o).then((function(n){for(var o in n)e[o]=n[o];return e.id_token?(r.Log.debug("ResponseValidator._processCode: token response successful, processing id_token"),i._validateIdTokenAttributes(t,e)):(r.Log.debug("ResponseValidator._processCode: token response successful, returning response"),e)}))},t.prototype._validateIdTokenAttributes=function(t,e){var i=this;return this._metadataService.getIssuer().then((function(n){var o=t.client_id,s=i._settings.clockSkew;return r.Log.debug("ResponseValidator._validateIdTokenAttributes: Validaing JWT attributes; using clock skew (in seconds) of: ",s),i._settings.getEpochTime().then((function(a){return i._joseUtil.validateJwtAttributes(e.id_token,n,o,s,a).then((function(i){return t.nonce&&t.nonce!==i.nonce?(r.Log.error("ResponseValidator._validateIdTokenAttributes: Invalid nonce in id_token"),Promise.reject(new Error("Invalid nonce in id_token"))):i.sub?(e.profile=i,e):(r.Log.error("ResponseValidator._validateIdTokenAttributes: No sub present in id_token"),Promise.reject(new Error("No sub present in id_token")))}))}))}))},t.prototype._validateIdTokenAndAccessToken=function(t,e){var i=this;return this._validateIdToken(t,e).then((function(t){return i._validateAccessToken(t)}))},t.prototype._getSigningKeyForJwt=function(t){var e=this;return this._metadataService.getSigningKeys().then((function(i){var n=t.header.kid;if(!i)return r.Log.error("ResponseValidator._validateIdToken: No signing keys from metadata"),Promise.reject(new Error("No signing keys from metadata"));r.Log.debug("ResponseValidator._validateIdToken: Received signing keys");var o=void 0;if(n)o=i.filter((function(t){return t.kid===n}))[0];else{if((i=e._filterByAlg(i,t.header.alg)).length>1)return r.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=i[0]}return Promise.resolve(o)}))},t.prototype._getSigningKeyForJwtWithSingleRetry=function(t){var e=this;return this._getSigningKeyForJwt(t).then((function(i){return i?Promise.resolve(i):(e._metadataService.resetSigningKeys(),e._getSigningKeyForJwt(t))}))},t.prototype._validateIdToken=function(t,e){var i=this;if(!t.nonce)return r.Log.error("ResponseValidator._validateIdToken: No nonce on state"),Promise.reject(new Error("No nonce on state"));var n=this._joseUtil.parseJwt(e.id_token);return n&&n.header&&n.payload?t.nonce!==n.payload.nonce?(r.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 r.Log.debug("ResponseValidator._validateIdToken: Received issuer"),i._getSigningKeyForJwtWithSingleRetry(n).then((function(s){if(!s)return r.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 a=t.client_id,c=i._settings.clockSkew;return r.Log.debug("ResponseValidator._validateIdToken: Validaing JWT; using clock skew (in seconds) of: ",c),i._joseUtil.validateJwt(e.id_token,s,o,a,c).then((function(){return r.Log.debug("ResponseValidator._validateIdToken: JWT validation successful"),n.payload.sub?(e.profile=n.payload,e):(r.Log.error("ResponseValidator._validateIdToken: No sub present in id_token"),Promise.reject(new Error("No sub present in id_token")))}))}))})):(r.Log.error("ResponseValidator._validateIdToken: Failed to parse id_token",n),Promise.reject(new Error("Failed to parse id_token")))},t.prototype._filterByAlg=function(t,e){var i=null;if(e.startsWith("RS"))i="RSA";else if(e.startsWith("PS"))i="PS";else{if(!e.startsWith("ES"))return r.Log.debug("ResponseValidator._filterByAlg: alg not supported: ",e),[];i="EC"}return r.Log.debug("ResponseValidator._filterByAlg: Looking for keys that match kty: ",i),t=t.filter((function(t){return t.kty===i})),r.Log.debug("ResponseValidator._filterByAlg: Number of keys that match kty: ",i,t.length),t},t.prototype._validateAccessToken=function(t){if(!t.profile)return r.Log.error("ResponseValidator._validateAccessToken: No profile loaded from id_token"),Promise.reject(new Error("No profile loaded from id_token"));if(!t.profile.at_hash)return r.Log.error("ResponseValidator._validateAccessToken: No at_hash in id_token"),Promise.reject(new Error("No at_hash in id_token"));if(!t.id_token)return r.Log.error("ResponseValidator._validateAccessToken: No id_token"),Promise.reject(new Error("No id_token"));var e=this._joseUtil.parseJwt(t.id_token);if(!e||!e.header)return r.Log.error("ResponseValidator._validateAccessToken: Failed to parse id_token",e),Promise.reject(new Error("Failed to parse id_token"));var i=e.header.alg;if(!i||5!==i.length)return r.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",i),Promise.reject(new Error("Unsupported alg: "+i));var n=i.substr(2,3);if(!n)return r.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",i,n),Promise.reject(new Error("Unsupported alg: "+i));if(256!==(n=parseInt(n))&&384!==n&&512!==n)return r.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",i,n),Promise.reject(new Error("Unsupported alg: "+i));var o="sha"+n,s=this._joseUtil.hashString(t.access_token,o);if(!s)return r.Log.error("ResponseValidator._validateAccessToken: access_token hash failed:",o),Promise.reject(new Error("Failed to validate at_hash"));var a=s.substr(0,s.length/2),c=this._joseUtil.hexToBase64Url(a);return c!==t.profile.at_hash?(r.Log.error("ResponseValidator._validateAccessToken: Failed to validate at_hash",c,t.profile.at_hash),Promise.reject(new Error("Failed to validate at_hash"))):(r.Log.debug("ResponseValidator._validateAccessToken: success"),Promise.resolve(t))},t}()},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.UserInfoService=void 0;var n=i(7),r=i(2),o=i(0),s=i(4);function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.UserInfoService=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.JsonService,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.MetadataService,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:s.JoseUtil;if(a(this,t),!e)throw o.Log.error("UserInfoService.ctor: No settings passed"),new Error("settings");this._settings=e,this._jsonService=new i(void 0,void 0,this._getClaimsFromJwt.bind(this)),this._metadataService=new c(this._settings),this._joseUtil=l}return t.prototype.getClaims=function(t){var e=this;return t?this._metadataService.getUserInfoEndpoint().then((function(i){return o.Log.debug("UserInfoService.getClaims: received userinfo url",i),e._jsonService.getJson(i,t).then((function(t){return o.Log.debug("UserInfoService.getClaims: claims received",t),t}))})):(o.Log.error("UserInfoService.getClaims: No token passed"),Promise.reject(new Error("A token is required")))},t.prototype._getClaimsFromJwt=function(t){var e=this;try{var i=this._joseUtil.parseJwt(t.responseText);if(!i||!i.header||!i.payload)return o.Log.error("UserInfoService._getClaimsFromJwt: Failed to parse JWT",i),Promise.reject(new Error("Failed to parse id_token"));var n=i.header.kid,r=void 0;switch(this._settings.userInfoJwtIssuer){case"OP":r=this._metadataService.getIssuer();break;case"ANY":r=Promise.resolve(i.payload.iss);break;default:r=Promise.resolve(this._settings.userInfoJwtIssuer)}return r.then((function(r){return o.Log.debug("UserInfoService._getClaimsFromJwt: Received issuer:"+r),e._metadataService.getSigningKeys().then((function(s){if(!s)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 a=void 0;if(n)a=s.filter((function(t){return t.kid===n}))[0];else{if((s=e._filterByAlg(s,i.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"));a=s[0]}if(!a)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=e._settings.client_id,l=e._settings.clockSkew;return o.Log.debug("UserInfoService._getClaimsFromJwt: Validaing JWT; using clock skew (in seconds) of: ",l),e._joseUtil.validateJwt(t.responseText,a,r,c,l,void 0,!0).then((function(){return o.Log.debug("UserInfoService._getClaimsFromJwt: JWT validation successful"),i.payload}))}))}))}catch(t){return o.Log.error("UserInfoService._getClaimsFromJwt: Error parsing JWT response",t.message),void reject(t)}},t.prototype._filterByAlg=function(t,e){var i=null;if(e.startsWith("RS"))i="RSA";else if(e.startsWith("PS"))i="PS";else{if(!e.startsWith("ES"))return o.Log.debug("UserInfoService._filterByAlg: alg not supported: ",e),[];i="EC"}return o.Log.debug("UserInfoService._filterByAlg: Looking for keys that match kty: ",i),t=t.filter((function(t){return t.kty===i})),o.Log.debug("UserInfoService._filterByAlg: Number of keys that match kty: ",i,t.length),t},t}()},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.AllowedSigningAlgs=e.b64tohex=e.hextob64u=e.crypto=e.X509=e.KeyUtil=e.jws=void 0;var n=i(27);e.jws=n.jws,e.KeyUtil=n.KEYUTIL,e.X509=n.X509,e.crypto=n.crypto,e.hextob64u=n.hextob64u,e.b64tohex=n.b64tohex,e.AllowedSigningAlgs=["RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"]},function(t,e,i){(function(t){Object.defineProperty(e,"__esModule",{value:!0});var i,n,r,o,s,a,c,l,u,h,d,f,p,v,g,m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},w={},b=b||(i=Math,r=(n={}).lib={},o=r.Base=function(){function t(){}return{extend:function(e){t.prototype=this;var i=new t;return e&&i.mixIn(e),i.hasOwnProperty("init")||(i.init=function(){i.$super.init.apply(this,arguments)}),i.init.prototype=i,i.$super=this,i},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),s=r.WordArray=o.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||c).stringify(this)},concat:function(t){var e=this.words,i=t.words,n=this.sigBytes,r=t.sigBytes;if(this.clamp(),n%4)for(var o=0;o<r;o++)e[n+o>>>2]|=(i[o>>>2]>>>24-o%4*8&255)<<24-(n+o)%4*8;else for(o=0;o<r;o+=4)e[n+o>>>2]=i[o>>>2];return this.sigBytes+=r,this},clamp:function(){var t=this.words,e=this.sigBytes;t[e>>>2]&=4294967295<<32-e%4*8,t.length=i.ceil(e/4)},clone:function(){var t=o.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],n=0;n<t;n+=4)e.push(4294967296*i.random()|0);return new s.init(e,t)}}),a=n.enc={},c=a.Hex={stringify:function(t){for(var e=t.words,i=t.sigBytes,n=[],r=0;r<i;r++){var o=e[r>>>2]>>>24-r%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,i=[],n=0;n<e;n+=2)i[n>>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new s.init(i,e/2)}},l=a.Latin1={stringify:function(t){for(var e=t.words,i=t.sigBytes,n=[],r=0;r<i;r++)n.push(String.fromCharCode(e[r>>>2]>>>24-r%4*8&255));return n.join("")},parse:function(t){for(var e=t.length,i=[],n=0;n<e;n++)i[n>>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new s.init(i,e)}},u=a.Utf8={stringify:function(t){try{return decodeURIComponent(escape(l.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return l.parse(unescape(encodeURIComponent(t)))}},h=r.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=u.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(t){var e=this._data,n=e.words,r=e.sigBytes,o=this.blockSize,a=r/(4*o),c=(a=t?i.ceil(a):i.max((0|a)-this._minBufferSize,0))*o,l=i.min(4*c,r);if(c){for(var u=0;u<c;u+=o)this._doProcessBlock(n,u);var h=n.splice(0,c);e.sigBytes-=l}return new s.init(h,l)},clone:function(){var t=o.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),r.Hasher=h.extend({cfg:o.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){h.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,i){return new t.init(i).finalize(e)}},_createHmacHelper:function(t){return function(e,i){return new d.HMAC.init(t,i).finalize(e)}}}),d=n.algo={},n);p=(f=b).lib,v=p.Base,g=p.WordArray,(f=f.x64={}).Word=v.extend({init:function(t,e){this.high=t,this.low=e}}),f.WordArray=v.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:8*t.length},toX32:function(){for(var t=this.words,e=t.length,i=[],n=0;n<e;n++){var r=t[n];i.push(r.high),i.push(r.low)}return g.create(i,this.sigBytes)},clone:function(){for(var t=v.clone.call(this),e=t.words=this.words.slice(0),i=e.length,n=0;n<i;n++)e[n]=e[n].clone();return t}}),function(){var t=b.lib.WordArray;b.enc.Base64={stringify:function(t){var e=t.words,i=t.sigBytes,n=this._map;t.clamp(),t=[];for(var r=0;r<i;r+=3)for(var o=(e[r>>>2]>>>24-r%4*8&255)<<16|(e[r+1>>>2]>>>24-(r+1)%4*8&255)<<8|e[r+2>>>2]>>>24-(r+2)%4*8&255,s=0;4>s&&r+.75*s<i;s++)t.push(n.charAt(o>>>6*(3-s)&63));if(e=n.charAt(64))for(;t.length%4;)t.push(e);return t.join("")},parse:function(e){var i=e.length,n=this._map;(r=n.charAt(64))&&-1!=(r=e.indexOf(r))&&(i=r);for(var r=[],o=0,s=0;s<i;s++)if(s%4){var a=n.indexOf(e.charAt(s-1))<<s%4*2,c=n.indexOf(e.charAt(s))>>>6-s%4*2;r[o>>>2]|=(a|c)<<24-o%4*8,o++}return t.create(r,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(t){for(var e=b,i=(r=e.lib).WordArray,n=r.Hasher,r=e.algo,o=[],s=[],a=function(t){return 4294967296*(t-(0|t))|0},c=2,l=0;64>l;){var u;t:{for(var h=t.sqrt(u=c),d=2;d<=h;d++)if(!(u%d)){u=!1;break t}u=!0}u&&(8>l&&(o[l]=a(t.pow(c,.5))),s[l]=a(t.pow(c,1/3)),l++),c++}var f=[];r=r.SHA256=n.extend({_doReset:function(){this._hash=new i.init(o.slice(0))},_doProcessBlock:function(t,e){for(var i=this._hash.words,n=i[0],r=i[1],o=i[2],a=i[3],c=i[4],l=i[5],u=i[6],h=i[7],d=0;64>d;d++){if(16>d)f[d]=0|t[e+d];else{var p=f[d-15],v=f[d-2];f[d]=((p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3)+f[d-7]+((v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10)+f[d-16]}p=h+((c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25))+(c&l^~c&u)+s[d]+f[d],v=((n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22))+(n&r^n&o^r&o),h=u,u=l,l=c,c=a+p|0,a=o,o=r,r=n,n=p+v|0}i[0]=i[0]+n|0,i[1]=i[1]+r|0,i[2]=i[2]+o|0,i[3]=i[3]+a|0,i[4]=i[4]+c|0,i[5]=i[5]+l|0,i[6]=i[6]+u|0,i[7]=i[7]+h|0},_doFinalize:function(){var e=this._data,i=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return i[r>>>5]|=128<<24-r%32,i[14+(r+64>>>9<<4)]=t.floor(n/4294967296),i[15+(r+64>>>9<<4)]=n,e.sigBytes=4*i.length,this._process(),this._hash},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t}}),e.SHA256=n._createHelper(r),e.HmacSHA256=n._createHmacHelper(r)}(Math),function(){function t(){return n.create.apply(n,arguments)}for(var e=b,i=e.lib.Hasher,n=(o=e.x64).Word,r=o.WordArray,o=e.algo,s=[t(1116352408,3609767458),t(1899447441,602891725),t(3049323471,3964484399),t(3921009573,2173295548),t(961987163,4081628472),t(1508970993,3053834265),t(2453635748,2937671579),t(2870763221,3664609560),t(3624381080,2734883394),t(310598401,1164996542),t(607225278,1323610764),t(1426881987,3590304994),t(1925078388,4068182383),t(2162078206,991336113),t(2614888103,633803317),t(3248222580,3479774868),t(3835390401,2666613458),t(4022224774,944711139),t(264347078,2341262773),t(604807628,2007800933),t(770255983,1495990901),t(1249150122,1856431235),t(1555081692,3175218132),t(1996064986,2198950837),t(2554220882,3999719339),t(2821834349,766784016),t(2952996808,2566594879),t(3210313671,3203337956),t(3336571891,1034457026),t(3584528711,2466948901),t(113926993,3758326383),t(338241895,168717936),t(666307205,1188179964),t(773529912,1546045734),t(1294757372,1522805485),t(1396182291,2643833823),t(1695183700,2343527390),t(1986661051,1014477480),t(2177026350,1206759142),t(2456956037,344077627),t(2730485921,1290863460),t(2820302411,3158454273),t(3259730800,3505952657),t(3345764771,106217008),t(3516065817,3606008344),t(3600352804,1432725776),t(4094571909,1467031594),t(275423344,851169720),t(430227734,3100823752),t(506948616,1363258195),t(659060556,3750685593),t(883997877,3785050280),t(958139571,3318307427),t(1322822218,3812723403),t(1537002063,2003034995),t(1747873779,3602036899),t(1955562222,1575990012),t(2024104815,1125592928),t(2227730452,2716904306),t(2361852424,442776044),t(2428436474,593698344),t(2756734187,3733110249),t(3204031479,2999351573),t(3329325298,3815920427),t(3391569614,3928383900),t(3515267271,566280711),t(3940187606,3454069534),t(4118630271,4000239992),t(116418474,1914138554),t(174292421,2731055270),t(289380356,3203993006),t(460393269,320620315),t(685471733,587496836),t(852142971,1086792851),t(1017036298,365543100),t(1126000580,2618297676),t(1288033470,3409855158),t(1501505948,4234509866),t(1607167915,987167468),t(1816402316,1246189591)],a=[],c=0;80>c;c++)a[c]=t();o=o.SHA512=i.extend({_doReset:function(){this._hash=new r.init([new n.init(1779033703,4089235720),new n.init(3144134277,2227873595),new n.init(1013904242,4271175723),new n.init(2773480762,1595750129),new n.init(1359893119,2917565137),new n.init(2600822924,725511199),new n.init(528734635,4215389547),new n.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var i=(h=this._hash.words)[0],n=h[1],r=h[2],o=h[3],c=h[4],l=h[5],u=h[6],h=h[7],d=i.high,f=i.low,p=n.high,v=n.low,g=r.high,m=r.low,w=o.high,b=o.low,y=c.high,x=c.low,k=l.high,E=l.low,S=u.high,F=u.low,A=h.high,_=h.low,j=d,C=f,R=p,I=v,T=g,O=m,P=w,N=b,D=y,M=x,U=k,L=E,B=S,J=F,$=A,z=_,H=0;80>H;H++){var K=a[H];if(16>H)var W=K.high=0|t[e+2*H],q=K.low=0|t[e+2*H+1];else{W=((q=(W=a[H-15]).high)>>>1|(V=W.low)<<31)^(q>>>8|V<<24)^q>>>7;var V=(V>>>1|q<<31)^(V>>>8|q<<24)^(V>>>7|q<<25),G=((q=(G=a[H-2]).high)>>>19|(X=G.low)<<13)^(q<<3|X>>>29)^q>>>6,X=(X>>>19|q<<13)^(X<<3|q>>>29)^(X>>>6|q<<26),Y=(q=a[H-7]).high,Z=(Q=a[H-16]).high,Q=Q.low;W=(W=(W=W+Y+((q=V+q.low)>>>0<V>>>0?1:0))+G+((q+=X)>>>0<X>>>0?1:0))+Z+((q+=Q)>>>0<Q>>>0?1:0),K.high=W,K.low=q}Y=D&U^~D&B,Q=M&L^~M&J,K=j&R^j&T^R&T;var tt=C&I^C&O^I&O,et=(V=(j>>>28|C<<4)^(j<<30|C>>>2)^(j<<25|C>>>7),G=(C>>>28|j<<4)^(C<<30|j>>>2)^(C<<25|j>>>7),(X=s[H]).high),it=X.low;Z=$+((D>>>14|M<<18)^(D>>>18|M<<14)^(D<<23|M>>>9))+((X=z+((M>>>14|D<<18)^(M>>>18|D<<14)^(M<<23|D>>>9)))>>>0<z>>>0?1:0),$=B,z=J,B=U,J=L,U=D,L=M,D=P+(Z=(Z=(Z=Z+Y+((X+=Q)>>>0<Q>>>0?1:0))+et+((X+=it)>>>0<it>>>0?1:0))+W+((X+=q)>>>0<q>>>0?1:0))+((M=N+X|0)>>>0<N>>>0?1:0)|0,P=T,N=O,T=R,O=I,R=j,I=C,j=Z+(K=V+K+((q=G+tt)>>>0<G>>>0?1:0))+((C=X+q|0)>>>0<X>>>0?1:0)|0}f=i.low=f+C,i.high=d+j+(f>>>0<C>>>0?1:0),v=n.low=v+I,n.high=p+R+(v>>>0<I>>>0?1:0),m=r.low=m+O,r.high=g+T+(m>>>0<O>>>0?1:0),b=o.low=b+N,o.high=w+P+(b>>>0<N>>>0?1:0),x=c.low=x+M,c.high=y+D+(x>>>0<M>>>0?1:0),E=l.low=E+L,l.high=k+U+(E>>>0<L>>>0?1:0),F=u.low=F+J,u.high=S+B+(F>>>0<J>>>0?1:0),_=h.low=_+z,h.high=A+$+(_>>>0<z>>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,i=8*this._nDataBytes,n=8*t.sigBytes;return e[n>>>5]|=128<<24-n%32,e[30+(n+128>>>10<<5)]=Math.floor(i/4294967296),e[31+(n+128>>>10<<5)]=i,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=i.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32}),e.SHA512=i._createHelper(o),e.HmacSHA512=i._createHmacHelper(o)}(),function(){var t=b,e=(r=t.x64).Word,i=r.WordArray,n=(r=t.algo).SHA512,r=r.SHA384=n.extend({_doReset:function(){this._hash=new i.init([new e.init(3418070365,3238371032),new e.init(1654270250,914150663),new e.init(2438529370,812702999),new e.init(355462360,4144912697),new e.init(1731405415,4290775857),new e.init(2394180231,1750603025),new e.init(3675008525,1694076839),new e.init(1203062813,3204075428)])},_doFinalize:function(){var t=n._doFinalize.call(this);return t.sigBytes-=16,t}});t.SHA384=n._createHelper(r),t.HmacSHA384=n._createHmacHelper(r)}();var y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function x(t){var e,i,n="";for(e=0;e+3<=t.length;e+=3)i=parseInt(t.substring(e,e+3),16),n+=y.charAt(i>>6)+y.charAt(63&i);for(e+1==t.length?(i=parseInt(t.substring(e,e+1),16),n+=y.charAt(i<<2)):e+2==t.length&&(i=parseInt(t.substring(e,e+2),16),n+=y.charAt(i>>2)+y.charAt((3&i)<<4));(3&n.length)>0;)n+="=";return n}function k(t){var e,i,n,r="",o=0;for(e=0;e<t.length&&"="!=t.charAt(e);++e)(n=y.indexOf(t.charAt(e)))<0||(0==o?(r+=C(n>>2),i=3&n,o=1):1==o?(r+=C(i<<2|n>>4),i=15&n,o=2):2==o?(r+=C(i),r+=C(n>>2),i=3&n,o=3):(r+=C(i<<2|n>>4),r+=C(15&n),o=0));return 1==o&&(r+=C(i<<2)),r}function E(t){var e,i=k(t),n=new Array;for(e=0;2*e<i.length;++e)n[e]=parseInt(i.substring(2*e,2*e+2),16);return n}function S(t,e,i){null!=t&&("number"==typeof t?this.fromNumber(t,e,i):this.fromString(t,null==e&&"string"!=typeof t?256:e))}function F(){return new S(null)}S.prototype.am=function(t,e,i,n,r,o){for(;--o>=0;){var s=e*this[t++]+i[n]+r;r=Math.floor(s/67108864),i[n++]=67108863&s}return r},S.prototype.DB=26,S.prototype.DM=67108863,S.prototype.DV=1<<26,S.prototype.FV=Math.pow(2,52),S.prototype.F1=26,S.prototype.F2=0;var A,_,j=new Array;for(A="0".charCodeAt(0),_=0;_<=9;++_)j[A++]=_;for(A="a".charCodeAt(0),_=10;_<36;++_)j[A++]=_;for(A="A".charCodeAt(0),_=10;_<36;++_)j[A++]=_;function C(t){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(t)}function R(t,e){var i=j[t.charCodeAt(e)];return null==i?-1:i}function I(t){var e=F();return e.fromInt(t),e}function T(t){var e,i=1;return 0!=(e=t>>>16)&&(t=e,i+=16),0!=(e=t>>8)&&(t=e,i+=8),0!=(e=t>>4)&&(t=e,i+=4),0!=(e=t>>2)&&(t=e,i+=2),0!=(e=t>>1)&&(t=e,i+=1),i}function O(t){this.m=t}function P(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function N(t,e){return t&e}function D(t,e){return t|e}function M(t,e){return t^e}function U(t,e){return t&~e}function L(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function B(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function J(){}function $(t){return t}function z(t){this.r2=F(),this.q3=F(),S.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}O.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},O.prototype.revert=function(t){return t},O.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},O.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i),this.reduce(i)},O.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},P.prototype.convert=function(t){var e=F();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(S.ZERO)>0&&this.m.subTo(e,e),e},P.prototype.revert=function(t){var e=F();return t.copyTo(e),this.reduce(e),e},P.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var i=32767&t[e],n=i*this.mpl+((i*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(t[i=e+this.m.t]+=this.m.am(0,n,t,e,0,this.m.t);t[i]>=t.DV;)t[i]-=t.DV,t[++i]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},P.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i),this.reduce(i)},P.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},S.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},S.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},S.prototype.fromString=function(t,e){var i;if(16==e)i=4;else if(8==e)i=3;else if(256==e)i=8;else if(2==e)i=1;else if(32==e)i=5;else{if(4!=e)return void this.fromRadix(t,e);i=2}this.t=0,this.s=0;for(var n=t.length,r=!1,o=0;--n>=0;){var s=8==i?255&t[n]:R(t,n);s<0?"-"==t.charAt(n)&&(r=!0):(r=!1,0==o?this[this.t++]=s:o+i>this.DB?(this[this.t-1]|=(s&(1<<this.DB-o)-1)<<o,this[this.t++]=s>>this.DB-o):this[this.t-1]|=s<<o,(o+=i)>=this.DB&&(o-=this.DB))}8==i&&0!=(128&t[0])&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),r&&S.ZERO.subTo(this,this)},S.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},S.prototype.dlShiftTo=function(t,e){var i;for(i=this.t-1;i>=0;--i)e[i+t]=this[i];for(i=t-1;i>=0;--i)e[i]=0;e.t=this.t+t,e.s=this.s},S.prototype.drShiftTo=function(t,e){for(var i=t;i<this.t;++i)e[i-t]=this[i];e.t=Math.max(this.t-t,0),e.s=this.s},S.prototype.lShiftTo=function(t,e){var i,n=t%this.DB,r=this.DB-n,o=(1<<r)-1,s=Math.floor(t/this.DB),a=this.s<<n&this.DM;for(i=this.t-1;i>=0;--i)e[i+s+1]=this[i]>>r|a,a=(this[i]&o)<<n;for(i=s-1;i>=0;--i)e[i]=0;e[s]=a,e.t=this.t+s+1,e.s=this.s,e.clamp()},S.prototype.rShiftTo=function(t,e){e.s=this.s;var i=Math.floor(t/this.DB);if(i>=this.t)e.t=0;else{var n=t%this.DB,r=this.DB-n,o=(1<<n)-1;e[0]=this[i]>>n;for(var s=i+1;s<this.t;++s)e[s-i-1]|=(this[s]&o)<<r,e[s-i]=this[s]>>n;n>0&&(e[this.t-i-1]|=(this.s&o)<<r),e.t=this.t-i,e.clamp()}},S.prototype.subTo=function(t,e){for(var i=0,n=0,r=Math.min(t.t,this.t);i<r;)n+=this[i]-t[i],e[i++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;i<this.t;)n+=this[i],e[i++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;i<t.t;)n-=t[i],e[i++]=n&this.DM,n>>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e[i++]=this.DV+n:n>0&&(e[i++]=n),e.t=i,e.clamp()},S.prototype.multiplyTo=function(t,e){var i=this.abs(),n=t.abs(),r=i.t;for(e.t=r+n.t;--r>=0;)e[r]=0;for(r=0;r<n.t;++r)e[r+i.t]=i.am(0,n[r],e,r,0,i.t);e.s=0,e.clamp(),this.s!=t.s&&S.ZERO.subTo(e,e)},S.prototype.squareTo=function(t){for(var e=this.abs(),i=t.t=2*e.t;--i>=0;)t[i]=0;for(i=0;i<e.t-1;++i){var n=e.am(i,e[i],t,2*i,0,1);(t[i+e.t]+=e.am(i+1,2*e[i],t,2*i+1,n,e.t-i-1))>=e.DV&&(t[i+e.t]-=e.DV,t[i+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(i,e[i],t,2*i,0,1)),t.s=0,t.clamp()},S.prototype.divRemTo=function(t,e,i){var n=t.abs();if(!(n.t<=0)){var r=this.abs();if(r.t<n.t)return null!=e&&e.fromInt(0),void(null!=i&&this.copyTo(i));null==i&&(i=F());var o=F(),s=this.s,a=t.s,c=this.DB-T(n[n.t-1]);c>0?(n.lShiftTo(c,o),r.lShiftTo(c,i)):(n.copyTo(o),r.copyTo(i));var l=o.t,u=o[l-1];if(0!=u){var h=u*(1<<this.F1)+(l>1?o[l-2]>>this.F2:0),d=this.FV/h,f=(1<<this.F1)/h,p=1<<this.F2,v=i.t,g=v-l,m=null==e?F():e;for(o.dlShiftTo(g,m),i.compareTo(m)>=0&&(i[i.t++]=1,i.subTo(m,i)),S.ONE.dlShiftTo(l,m),m.subTo(o,o);o.t<l;)o[o.t++]=0;for(;--g>=0;){var w=i[--v]==u?this.DM:Math.floor(i[v]*d+(i[v-1]+p)*f);if((i[v]+=o.am(0,w,i,g,0,l))<w)for(o.dlShiftTo(g,m),i.subTo(m,i);i[v]<--w;)i.subTo(m,i)}null!=e&&(i.drShiftTo(l,e),s!=a&&S.ZERO.subTo(e,e)),i.t=l,i.clamp(),c>0&&i.rShiftTo(c,i),s<0&&S.ZERO.subTo(i,i)}}},S.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},S.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},S.prototype.exp=function(t,e){if(t>4294967295||t<1)return S.ONE;var i=F(),n=F(),r=e.convert(this),o=T(t)-1;for(r.copyTo(i);--o>=0;)if(e.sqrTo(i,n),(t&1<<o)>0)e.mulTo(n,r,i);else{var s=i;i=n,n=s}return e.revert(i)},S.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var i,n=(1<<e)-1,r=!1,o="",s=this.t,a=this.DB-s*this.DB%e;if(s-- >0)for(a<this.DB&&(i=this[s]>>a)>0&&(r=!0,o=C(i));s>=0;)a<e?(i=(this[s]&(1<<a)-1)<<e-a,i|=this[--s]>>(a+=this.DB-e)):(i=this[s]>>(a-=e)&n,a<=0&&(a+=this.DB,--s)),i>0&&(r=!0),r&&(o+=C(i));return r?o:"0"},S.prototype.negate=function(){var t=F();return S.ZERO.subTo(this,t),t},S.prototype.abs=function(){return this.s<0?this.negate():this},S.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var i=this.t;if(0!=(e=i-t.t))return this.s<0?-e:e;for(;--i>=0;)if(0!=(e=this[i]-t[i]))return e;return 0},S.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+T(this[this.t-1]^this.s&this.DM)},S.prototype.mod=function(t){var e=F();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(S.ZERO)>0&&t.subTo(e,e),e},S.prototype.modPowInt=function(t,e){var i;return i=t<256||e.isEven()?new O(e):new P(e),this.exp(t,i)},S.ZERO=I(0),S.ONE=I(1),J.prototype.convert=$,J.prototype.revert=$,J.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i)},J.prototype.sqrTo=function(t,e){t.squareTo(e)},z.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=F();return t.copyTo(e),this.reduce(e),e},z.prototype.revert=function(t){return t},z.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},z.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i),this.reduce(i)},z.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var H,K,W,q=[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],V=(1<<26)/q[q.length-1];function G(){this.i=0,this.j=0,this.S=new Array}function X(){!function(t){K[W++]^=255&t,K[W++]^=t>>8&255,K[W++]^=t>>16&255,K[W++]^=t>>24&255,W>=256&&(W-=256)}((new Date).getTime())}if(S.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},S.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),i=Math.pow(t,e),n=I(i),r=F(),o=F(),s="";for(this.divRemTo(n,r,o);r.signum()>0;)s=(i+o.intValue()).toString(t).substr(1)+s,r.divRemTo(n,r,o);return o.intValue().toString(t)+s},S.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var i=this.chunkSize(e),n=Math.pow(e,i),r=!1,o=0,s=0,a=0;a<t.length;++a){var c=R(t,a);c<0?"-"==t.charAt(a)&&0==this.signum()&&(r=!0):(s=e*s+c,++o>=i&&(this.dMultiply(n),this.dAddOffset(s,0),o=0,s=0))}o>0&&(this.dMultiply(Math.pow(e,o)),this.dAddOffset(s,0)),r&&S.ZERO.subTo(this,this)},S.prototype.fromNumber=function(t,e,i){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,i),this.testBit(t-1)||this.bitwiseTo(S.ONE.shiftLeft(t-1),D,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(S.ONE.shiftLeft(t-1),this);else{var n=new Array,r=7&t;n.length=1+(t>>3),e.nextBytes(n),r>0?n[0]&=(1<<r)-1:n[0]=0,this.fromString(n,256)}},S.prototype.bitwiseTo=function(t,e,i){var n,r,o=Math.min(t.t,this.t);for(n=0;n<o;++n)i[n]=e(this[n],t[n]);if(t.t<this.t){for(r=t.s&this.DM,n=o;n<this.t;++n)i[n]=e(this[n],r);i.t=this.t}else{for(r=this.s&this.DM,n=o;n<t.t;++n)i[n]=e(r,t[n]);i.t=t.t}i.s=e(this.s,t.s),i.clamp()},S.prototype.changeBit=function(t,e){var i=S.ONE.shiftLeft(t);return this.bitwiseTo(i,e,i),i},S.prototype.addTo=function(t,e){for(var i=0,n=0,r=Math.min(t.t,this.t);i<r;)n+=this[i]+t[i],e[i++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n+=t.s;i<this.t;)n+=this[i],e[i++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;i<t.t;)n+=t[i],e[i++]=n&this.DM,n>>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e[i++]=n:n<-1&&(e[i++]=this.DV+n),e.t=i,e.clamp()},S.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},S.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},S.prototype.multiplyLowerTo=function(t,e,i){var n,r=Math.min(this.t+t.t,e);for(i.s=0,i.t=r;r>0;)i[--r]=0;for(n=i.t-this.t;r<n;++r)i[r+this.t]=this.am(0,t[r],i,r,0,this.t);for(n=Math.min(t.t,e);r<n;++r)this.am(0,t[r],i,r,0,e-r);i.clamp()},S.prototype.multiplyUpperTo=function(t,e,i){--e;var n=i.t=this.t+t.t-e;for(i.s=0;--n>=0;)i[n]=0;for(n=Math.max(e-this.t,0);n<t.t;++n)i[this.t+n-e]=this.am(e-n,t[n],i,0,0,this.t+n-e);i.clamp(),i.drShiftTo(1,i)},S.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,i=this.s<0?t-1:0;if(this.t>0)if(0==e)i=this[0]%t;else for(var n=this.t-1;n>=0;--n)i=(e*i+this[n])%t;return i},S.prototype.millerRabin=function(t){var e=this.subtract(S.ONE),i=e.getLowestSetBit();if(i<=0)return!1;var n=e.shiftRight(i);(t=t+1>>1)>q.length&&(t=q.length);for(var r=F(),o=0;o<t;++o){r.fromInt(q[Math.floor(Math.random()*q.length)]);var s=r.modPow(n,this);if(0!=s.compareTo(S.ONE)&&0!=s.compareTo(e)){for(var a=1;a++<i&&0!=s.compareTo(e);)if(0==(s=s.modPowInt(2,this)).compareTo(S.ONE))return!1;if(0!=s.compareTo(e))return!1}}return!0},S.prototype.clone=
|
|
14
|
-
/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
|
|
15
|
-
*/
|
|
16
|
-
function(){var t=F();return this.copyTo(t),t},S.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]},S.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},S.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},S.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},S.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var i,n=this.DB-t*this.DB%8,r=0;if(t-- >0)for(n<this.DB&&(i=this[t]>>n)!=(this.s&this.DM)>>n&&(e[r++]=i|this.s<<this.DB-n);t>=0;)n<8?(i=(this[t]&(1<<n)-1)<<8-n,i|=this[--t]>>(n+=this.DB-8)):(i=this[t]>>(n-=8)&255,n<=0&&(n+=this.DB,--t)),0!=(128&i)&&(i|=-256),0==r&&(128&this.s)!=(128&i)&&++r,(r>0||i!=this.s)&&(e[r++]=i);return e},S.prototype.equals=function(t){return 0==this.compareTo(t)},S.prototype.min=function(t){return this.compareTo(t)<0?this:t},S.prototype.max=function(t){return this.compareTo(t)>0?this:t},S.prototype.and=function(t){var e=F();return this.bitwiseTo(t,N,e),e},S.prototype.or=function(t){var e=F();return this.bitwiseTo(t,D,e),e},S.prototype.xor=function(t){var e=F();return this.bitwiseTo(t,M,e),e},S.prototype.andNot=function(t){var e=F();return this.bitwiseTo(t,U,e),e},S.prototype.not=function(){for(var t=F(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t},S.prototype.shiftLeft=function(t){var e=F();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},S.prototype.shiftRight=function(t){var e=F();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},S.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+L(this[t]);return this.s<0?this.t*this.DB:-1},S.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,i=0;i<this.t;++i)t+=B(this[i]^e);return t},S.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this[e]&1<<t%this.DB)},S.prototype.setBit=function(t){return this.changeBit(t,D)},S.prototype.clearBit=function(t){return this.changeBit(t,U)},S.prototype.flipBit=function(t){return this.changeBit(t,M)},S.prototype.add=function(t){var e=F();return this.addTo(t,e),e},S.prototype.subtract=function(t){var e=F();return this.subTo(t,e),e},S.prototype.multiply=function(t){var e=F();return this.multiplyTo(t,e),e},S.prototype.divide=function(t){var e=F();return this.divRemTo(t,e,null),e},S.prototype.remainder=function(t){var e=F();return this.divRemTo(t,null,e),e},S.prototype.divideAndRemainder=function(t){var e=F(),i=F();return this.divRemTo(t,e,i),new Array(e,i)},S.prototype.modPow=function(t,e){var i,n,r=t.bitLength(),o=I(1);if(r<=0)return o;i=r<18?1:r<48?3:r<144?4:r<768?5:6,n=r<8?new O(e):e.isEven()?new z(e):new P(e);var s=new Array,a=3,c=i-1,l=(1<<i)-1;if(s[1]=n.convert(this),i>1){var u=F();for(n.sqrTo(s[1],u);a<=l;)s[a]=F(),n.mulTo(u,s[a-2],s[a]),a+=2}var h,d,f=t.t-1,p=!0,v=F();for(r=T(t[f])-1;f>=0;){for(r>=c?h=t[f]>>r-c&l:(h=(t[f]&(1<<r+1)-1)<<c-r,f>0&&(h|=t[f-1]>>this.DB+r-c)),a=i;0==(1&h);)h>>=1,--a;if((r-=a)<0&&(r+=this.DB,--f),p)s[h].copyTo(o),p=!1;else{for(;a>1;)n.sqrTo(o,v),n.sqrTo(v,o),a-=2;a>0?n.sqrTo(o,v):(d=o,o=v,v=d),n.mulTo(v,s[h],o)}for(;f>=0&&0==(t[f]&1<<r);)n.sqrTo(o,v),d=o,o=v,v=d,--r<0&&(r=this.DB-1,--f)}return n.revert(o)},S.prototype.modInverse=function(t){var e=t.isEven();if(this.isEven()&&e||0==t.signum())return S.ZERO;for(var i=t.clone(),n=this.clone(),r=I(1),o=I(0),s=I(0),a=I(1);0!=i.signum();){for(;i.isEven();)i.rShiftTo(1,i),e?(r.isEven()&&o.isEven()||(r.addTo(this,r),o.subTo(t,o)),r.rShiftTo(1,r)):o.isEven()||o.subTo(t,o),o.rShiftTo(1,o);for(;n.isEven();)n.rShiftTo(1,n),e?(s.isEven()&&a.isEven()||(s.addTo(this,s),a.subTo(t,a)),s.rShiftTo(1,s)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);i.compareTo(n)>=0?(i.subTo(n,i),e&&r.subTo(s,r),o.subTo(a,o)):(n.subTo(i,n),e&&s.subTo(r,s),a.subTo(o,a))}return 0!=n.compareTo(S.ONE)?S.ZERO:a.compareTo(t)>=0?a.subtract(t):a.signum()<0?(a.addTo(t,a),a.signum()<0?a.add(t):a):a},S.prototype.pow=function(t){return this.exp(t,new J)},S.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),i=t.s<0?t.negate():t.clone();if(e.compareTo(i)<0){var n=e;e=i,i=n}var r=e.getLowestSetBit(),o=i.getLowestSetBit();if(o<0)return e;for(r<o&&(o=r),o>0&&(e.rShiftTo(o,e),i.rShiftTo(o,i));e.signum()>0;)(r=e.getLowestSetBit())>0&&e.rShiftTo(r,e),(r=i.getLowestSetBit())>0&&i.rShiftTo(r,i),e.compareTo(i)>=0?(e.subTo(i,e),e.rShiftTo(1,e)):(i.subTo(e,i),i.rShiftTo(1,i));return o>0&&i.lShiftTo(o,i),i},S.prototype.isProbablePrime=function(t){var e,i=this.abs();if(1==i.t&&i[0]<=q[q.length-1]){for(e=0;e<q.length;++e)if(i[0]==q[e])return!0;return!1}if(i.isEven())return!1;for(e=1;e<q.length;){for(var n=q[e],r=e+1;r<q.length&&n<V;)n*=q[r++];for(n=i.modInt(n);e<r;)if(n%q[e++]==0)return!1}return i.millerRabin(t)},S.prototype.square=function(){var t=F();return this.squareTo(t),t},G.prototype.init=function(t){var e,i,n;for(e=0;e<256;++e)this.S[e]=e;for(i=0,e=0;e<256;++e)n=this.S[e],this.S[e]=this.S[i=i+this.S[e]+t[e%t.length]&255],this.S[i]=n;this.i=0,this.j=0},G.prototype.next=function(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]},null==K){var Y;if(K=new Array,W=0,void 0!==w&&void 0!==w.msCrypto){var Z=w.msCrypto;if(Z.getRandomValues){var Q=new Uint8Array(32);for(Z.getRandomValues(Q),Y=0;Y<32;++Y)K[W++]=Q[Y]}}for(;W<256;)Y=Math.floor(65536*Math.random()),K[W++]=Y>>>8,K[W++]=255&Y;W=0,X()}function tt(){if(null==H){for(X(),(H=new G).init(K),W=0;W<K.length;++W)K[W]=0;W=0}return H.next()}function et(){}function it(t,e){return new S(t,e)}function nt(t,e,i){for(var n="",r=0;n.length<e;)n+=i(String.fromCharCode.apply(String,t.concat([(4278190080&r)>>24,(16711680&r)>>16,(65280&r)>>8,255&r]))),r+=1;return n}function rt(){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 ot(t,e){this.x=e,this.q=t}function st(t,e,i,n){this.curve=t,this.x=e,this.y=i,this.z=null==n?S.ONE:n,this.zinv=null}function at(t,e,i){this.q=t,this.a=this.fromBigInteger(e),this.b=this.fromBigInteger(i),this.infinity=new st(this,null,null)}et.prototype.nextBytes=function(t){var e;for(e=0;e<t.length;++e)t[e]=tt()},rt.prototype.doPublic=function(t){return t.modPowInt(this.e,this.n)},rt.prototype.setPublic=function(t,e){if(this.isPublic=!0,this.isPrivate=!1,"string"!=typeof t)this.n=t,this.e=e;else{if(!(null!=t&&null!=e&&t.length>0&&e.length>0))throw"Invalid RSA public key";this.n=it(t,16),this.e=parseInt(e,16)}},rt.prototype.encrypt=function(t){var e=function(t,e){if(e<t.length+11)throw"Message too long for RSA";for(var i=new Array,n=t.length-1;n>=0&&e>0;){var r=t.charCodeAt(n--);r<128?i[--e]=r:r>127&&r<2048?(i[--e]=63&r|128,i[--e]=r>>6|192):(i[--e]=63&r|128,i[--e]=r>>6&63|128,i[--e]=r>>12|224)}i[--e]=0;for(var o=new et,s=new Array;e>2;){for(s[0]=0;0==s[0];)o.nextBytes(s);i[--e]=s[0]}return i[--e]=2,i[--e]=0,new S(i)}(t,this.n.bitLength()+7>>3);if(null==e)return null;var i=this.doPublic(e);if(null==i)return null;var n=i.toString(16);return 0==(1&n.length)?n:"0"+n},rt.prototype.encryptOAEP=function(t,e,i){var n=function(t,e,i,n){var r=lt.crypto.MessageDigest,o=lt.crypto.Util,s=null;if(i||(i="sha1"),"string"==typeof i&&(s=r.getCanonicalAlgName(i),n=r.getHashLength(s),i=function(t){return Et(o.hashHex(St(t),s))}),t.length+2*n+2>e)throw"Message too long for RSA";var a,c="";for(a=0;a<e-t.length-2*n-2;a+=1)c+="\0";var l=i("")+c+""+t,u=new Array(n);(new et).nextBytes(u);var h=nt(u,l.length,i),d=[];for(a=0;a<l.length;a+=1)d[a]=l.charCodeAt(a)^h.charCodeAt(a);var f=nt(d,u.length,i),p=[0];for(a=0;a<u.length;a+=1)p[a+1]=u[a]^f.charCodeAt(a);return new S(p.concat(d))}(t,this.n.bitLength()+7>>3,e,i);if(null==n)return null;var r=this.doPublic(n);if(null==r)return null;var o=r.toString(16);return 0==(1&o.length)?o:"0"+o},rt.prototype.type="RSA",ot.prototype.equals=function(t){return t==this||this.q.equals(t.q)&&this.x.equals(t.x)},ot.prototype.toBigInteger=function(){return this.x},ot.prototype.negate=function(){return new ot(this.q,this.x.negate().mod(this.q))},ot.prototype.add=function(t){return new ot(this.q,this.x.add(t.toBigInteger()).mod(this.q))},ot.prototype.subtract=function(t){return new ot(this.q,this.x.subtract(t.toBigInteger()).mod(this.q))},ot.prototype.multiply=function(t){return new ot(this.q,this.x.multiply(t.toBigInteger()).mod(this.q))},ot.prototype.square=function(){return new ot(this.q,this.x.square().mod(this.q))},ot.prototype.divide=function(t){return new ot(this.q,this.x.multiply(t.toBigInteger().modInverse(this.q)).mod(this.q))},st.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))},st.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))},st.prototype.equals=function(t){return t==this||(this.isInfinity()?t.isInfinity():t.isInfinity()?this.isInfinity():!!t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.q).equals(S.ZERO)&&t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.q).equals(S.ZERO))},st.prototype.isInfinity=function(){return null==this.x&&null==this.y||this.z.equals(S.ZERO)&&!this.y.toBigInteger().equals(S.ZERO)},st.prototype.negate=function(){return new st(this.curve,this.x,this.y.negate(),this.z)},st.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.q),i=t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.q);if(S.ZERO.equals(i))return S.ZERO.equals(e)?this.twice():this.curve.getInfinity();var n=new S("3"),r=this.x.toBigInteger(),o=this.y.toBigInteger(),s=(t.x.toBigInteger(),t.y.toBigInteger(),i.square()),a=s.multiply(i),c=r.multiply(s),l=e.square().multiply(this.z),u=l.subtract(c.shiftLeft(1)).multiply(t.z).subtract(a).multiply(i).mod(this.curve.q),h=c.multiply(n).multiply(e).subtract(o.multiply(a)).subtract(l.multiply(e)).multiply(t.z).add(e.multiply(a)).mod(this.curve.q),d=a.multiply(this.z).multiply(t.z).mod(this.curve.q);return new st(this.curve,this.curve.fromBigInteger(u),this.curve.fromBigInteger(h),d)},st.prototype.twice=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var t=new S("3"),e=this.x.toBigInteger(),i=this.y.toBigInteger(),n=i.multiply(this.z),r=n.multiply(i).mod(this.curve.q),o=this.curve.a.toBigInteger(),s=e.square().multiply(t);S.ZERO.equals(o)||(s=s.add(this.z.square().multiply(o)));var a=(s=s.mod(this.curve.q)).square().subtract(e.shiftLeft(3).multiply(r)).shiftLeft(1).multiply(n).mod(this.curve.q),c=s.multiply(t).multiply(e).subtract(r.shiftLeft(1)).shiftLeft(2).multiply(r).subtract(s.square().multiply(s)).mod(this.curve.q),l=n.square().multiply(n).shiftLeft(3).mod(this.curve.q);return new st(this.curve,this.curve.fromBigInteger(a),this.curve.fromBigInteger(c),l)},st.prototype.multiply=function(t){if(this.isInfinity())return this;if(0==t.signum())return this.curve.getInfinity();var e,i=t,n=i.multiply(new S("3")),r=this.negate(),o=this,s=this.curve.q.subtract(t),a=s.multiply(new S("3")),c=new st(this.curve,this.x,this.y),l=c.negate();for(e=n.bitLength()-2;e>0;--e){o=o.twice();var u=n.testBit(e);u!=i.testBit(e)&&(o=o.add(u?this:r))}for(e=a.bitLength()-2;e>0;--e){c=c.twice();var h=a.testBit(e);h!=s.testBit(e)&&(c=c.add(h?c:l))}return o},st.prototype.multiplyTwo=function(t,e,i){var n;n=t.bitLength()>i.bitLength()?t.bitLength()-1:i.bitLength()-1;for(var r=this.curve.getInfinity(),o=this.add(e);n>=0;)r=r.twice(),t.testBit(n)?r=i.testBit(n)?r.add(o):r.add(this):i.testBit(n)&&(r=r.add(e)),--n;return r},at.prototype.getQ=function(){return this.q},at.prototype.getA=function(){return this.a},at.prototype.getB=function(){return this.b},at.prototype.equals=function(t){return t==this||this.q.equals(t.q)&&this.a.equals(t.a)&&this.b.equals(t.b)},at.prototype.getInfinity=function(){return this.infinity},at.prototype.fromBigInteger=function(t){return new ot(this.q,t)},at.prototype.decodePointHex=function(t){switch(parseInt(t.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:default:return null;case 4:case 6:case 7:var e=(t.length-2)/2,i=t.substr(2,e),n=t.substr(e+2,e);return new st(this,this.fromBigInteger(new S(i,16)),this.fromBigInteger(new S(n,16)))}},
|
|
17
|
-
/*! (c) Stefan Thomas | https://github.com/bitcoinjs/bitcoinjs-lib
|
|
18
|
-
*/
|
|
19
|
-
ot.prototype.getByteLength=function(){return Math.floor((this.toBigInteger().bitLength()+7)/8)},st.prototype.getEncoded=function(t){var e=function(t,e){var i=t.toByteArrayUnsigned();if(e<i.length)i=i.slice(i.length-e);else for(;e>i.length;)i.unshift(0);return i},i=this.getX().toBigInteger(),n=this.getY().toBigInteger(),r=e(i,32);return t?n.isEven()?r.unshift(2):r.unshift(3):(r.unshift(4),r=r.concat(e(n,32))),r},st.decodeFrom=function(t,e){var i=e.length-1,n=e.slice(1,1+i/2),r=e.slice(1+i/2,1+i);n.unshift(0),r.unshift(0);var o=new S(n),s=new S(r);return new st(t,t.fromBigInteger(o),t.fromBigInteger(s))},st.decodeFromHex=function(t,e){e.substr(0,2);var i=e.length-2,n=e.substr(2,i/2),r=e.substr(2+i/2,i/2),o=new S(n,16),s=new S(r,16);return new st(t,t.fromBigInteger(o),t.fromBigInteger(s))},st.prototype.add2D=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;if(this.x.equals(t.x))return this.y.equals(t.y)?this.twice():this.curve.getInfinity();var e=t.x.subtract(this.x),i=t.y.subtract(this.y).divide(e),n=i.square().subtract(this.x).subtract(t.x),r=i.multiply(this.x.subtract(n)).subtract(this.y);return new st(this.curve,n,r)},st.prototype.twice2D=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var t=this.curve.fromBigInteger(S.valueOf(2)),e=this.curve.fromBigInteger(S.valueOf(3)),i=this.x.square().multiply(e).add(this.curve.a).divide(this.y.multiply(t)),n=i.square().subtract(this.x.multiply(t)),r=i.multiply(this.x.subtract(n)).subtract(this.y);return new st(this.curve,n,r)},st.prototype.multiply2D=function(t){if(this.isInfinity())return this;if(0==t.signum())return this.curve.getInfinity();var e,i=t,n=i.multiply(new S("3")),r=this.negate(),o=this;for(e=n.bitLength()-2;e>0;--e){o=o.twice();var s=n.testBit(e);s!=i.testBit(e)&&(o=o.add2D(s?this:r))}return o},st.prototype.isOnCurve=function(){var t=this.getX().toBigInteger(),e=this.getY().toBigInteger(),i=this.curve.getA().toBigInteger(),n=this.curve.getB().toBigInteger(),r=this.curve.getQ(),o=e.multiply(e).mod(r),s=t.multiply(t).multiply(t).add(i.multiply(t)).add(n).mod(r);return o.equals(s)},st.prototype.toString=function(){return"("+this.getX().toBigInteger().toString()+","+this.getY().toBigInteger().toString()+")"},st.prototype.validate=function(){var t=this.curve.getQ();if(this.isInfinity())throw new Error("Point is at infinity.");var e=this.getX().toBigInteger(),i=this.getY().toBigInteger();if(e.compareTo(S.ONE)<0||e.compareTo(t.subtract(S.ONE))>0)throw new Error("x coordinate out of bounds");if(i.compareTo(S.ONE)<0||i.compareTo(t.subtract(S.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(t).isInfinity())throw new Error("Point is not a scalar multiple of G.");return!0};var ct=function(){var t=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"),e=new RegExp("\\\\(?:([^u])|u(.{4}))","g"),i={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function n(t,e,n){return e?i[e]:String.fromCharCode(parseInt(n,16))}var r=new String(""),o=Object.hasOwnProperty;return function(i,s){var a,c,l=i.match(t),u=l[0],h=!1;"{"===u?a={}:"["===u?a=[]:(a=[],h=!0);for(var d=[a],f=1-h,p=l.length;f<p;++f){var v;switch((u=l[f]).charCodeAt(0)){default:(v=d[0])[c||v.length]=+u,c=void 0;break;case 34:if(-1!==(u=u.substring(1,u.length-1)).indexOf("\\")&&(u=u.replace(e,n)),v=d[0],!c){if(!(v instanceof Array)){c=u||r;break}c=v.length}v[c]=u,c=void 0;break;case 91:d.unshift((v=d[0])[c||v.length]=[]),c=void 0;break;case 93:case 125:d.shift();break;case 102:(v=d[0])[c||v.length]=!1,c=void 0;break;case 110:(v=d[0])[c||v.length]=null,c=void 0;break;case 116:(v=d[0])[c||v.length]=!0,c=void 0;break;case 123:d.unshift((v=d[0])[c||v.length]={}),c=void 0}}if(h){if(1!==d.length)throw new Error;a=a[0]}else if(d.length)throw new Error;return s&&(a=function t(e,i){var n=e[i];if(n&&"object"===(void 0===n?"undefined":m(n))){var r=null;for(var a in n)if(o.call(n,a)&&n!==e){var c=t(n,a);void 0!==c?n[a]=c:(r||(r=[]),r.push(a))}if(r)for(var l=r.length;--l>=0;)delete n[r[l]]}return s.call(e,i,n)}({"":a},"")),a}}();void 0!==lt&<||(e.KJUR=lt={}),void 0!==lt.asn1&<.asn1||(lt.asn1={}),lt.asn1.ASN1Util=new function(){this.integerToByteHex=function(t){var e=t.toString(16);return e.length%2==1&&(e="0"+e),e},this.bigIntToMinTwosComplementsHex=function(t){var e=t.toString(16);if("-"!=e.substr(0,1))e.length%2==1?e="0"+e:e.match(/^[0-7]/)||(e="00"+e);else{var i=e.substr(1).length;i%2==1?i+=1:e.match(/^[0-7]/)||(i+=2);for(var n="",r=0;r<i;r++)n+="f";e=new S(n,16).xor(t).add(S.ONE).toString(16).replace(/^-/,"")}return e},this.getPEMStringFromHex=function(t,e){return jt(t,e)},this.newObject=function(t){var e=lt.asn1,i=e.ASN1Object,n=e.DERBoolean,r=e.DERInteger,o=e.DERBitString,s=e.DEROctetString,a=e.DERNull,c=e.DERObjectIdentifier,l=e.DEREnumerated,u=e.DERUTF8String,h=e.DERNumericString,d=e.DERPrintableString,f=e.DERTeletexString,p=e.DERIA5String,v=e.DERUTCTime,g=e.DERGeneralizedTime,m=e.DERVisibleString,w=e.DERBMPString,b=e.DERSequence,y=e.DERSet,x=e.DERTaggedObject,k=e.ASN1Util.newObject;if(t instanceof e.ASN1Object)return t;var E=Object.keys(t);if(1!=E.length)throw new Error("key of param shall be only one.");var S=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(":"+S+":"))throw new Error("undefined key: "+S);if("bool"==S)return new n(t[S]);if("int"==S)return new r(t[S]);if("bitstr"==S)return new o(t[S]);if("octstr"==S)return new s(t[S]);if("null"==S)return new a(t[S]);if("oid"==S)return new c(t[S]);if("enum"==S)return new l(t[S]);if("utf8str"==S)return new u(t[S]);if("numstr"==S)return new h(t[S]);if("prnstr"==S)return new d(t[S]);if("telstr"==S)return new f(t[S]);if("ia5str"==S)return new p(t[S]);if("utctime"==S)return new v(t[S]);if("gentime"==S)return new g(t[S]);if("visstr"==S)return new m(t[S]);if("bmpstr"==S)return new w(t[S]);if("asn1"==S)return new i(t[S]);if("seq"==S){for(var F=t[S],A=[],_=0;_<F.length;_++){var j=k(F[_]);A.push(j)}return new b({array:A})}if("set"==S){for(F=t[S],A=[],_=0;_<F.length;_++)j=k(F[_]),A.push(j);return new y({array:A})}if("tag"==S){var C=t[S];if("[object Array]"===Object.prototype.toString.call(C)&&3==C.length){var R=k(C[2]);return new x({tag:C[0],explicit:C[1],obj:R})}return new x(C)}},this.jsonToASN1HEX=function(t){return this.newObject(t).getEncodedHex()}},lt.asn1.ASN1Util.oidHexToInt=function(t){for(var e="",i=parseInt(t.substr(0,2),16),n=(e=Math.floor(i/40)+"."+i%40,""),r=2;r<t.length;r+=2){var o=("00000000"+parseInt(t.substr(r,2),16).toString(2)).slice(-8);n+=o.substr(1,7),"0"==o.substr(0,1)&&(e=e+"."+new S(n,2).toString(10),n="")}return e},lt.asn1.ASN1Util.oidIntToHex=function(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},i=function(t){var i="",n=new S(t,10).toString(2),r=7-n.length%7;7==r&&(r=0);for(var o="",s=0;s<r;s++)o+="0";for(n=o+n,s=0;s<n.length-1;s+=7){var a=n.substr(s,7);s!=n.length-7&&(a="1"+a),i+=e(parseInt(a,2))}return i};if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;var n="",r=t.split("."),o=40*parseInt(r[0])+parseInt(r[1]);n+=e(o),r.splice(0,2);for(var s=0;s<r.length;s++)n+=i(r[s]);return n},lt.asn1.ASN1Object=function(t){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 t=this.hV.length/2,e=t.toString(16);if(e.length%2==1&&(e="0"+e),t<128)return e;var i=e.length/2;if(i>15)throw"ASN.1 length too long to represent by 8x: n = "+t.toString(16);return(128+i).toString(16)+e},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(t){this.params=t},null!=t&&null!=t.tlv&&(this.hTLV=t.tlv,this.isModified=!1)},lt.asn1.DERAbstractString=function(t){lt.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=xt(this.s).toLowerCase()},this.setStringHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t?this.setString(t):void 0!==t.str?this.setString(t.str):void 0!==t.hex&&this.setStringHex(t.hex))},$t(lt.asn1.DERAbstractString,lt.asn1.ASN1Object),lt.asn1.DERAbstractTime=function(){lt.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(t){var e=t.getTime()+6e4*t.getTimezoneOffset();return new Date(e)},this.formatDate=function(t,e,i){var n=this.zeroPadding,r=this.localDateToUTC(t),o=String(r.getFullYear());"utc"==e&&(o=o.substr(2,2));var s=o+n(String(r.getMonth()+1),2)+n(String(r.getDate()),2)+n(String(r.getHours()),2)+n(String(r.getMinutes()),2)+n(String(r.getSeconds()),2);if(!0===i){var a=r.getMilliseconds();if(0!=a){var c=n(String(a),3);s=s+"."+(c=c.replace(/[0]+$/,""))}}return s+"Z"},this.zeroPadding=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=gt(t)},this.setByDateValue=function(t,e,i,n,r,o){var s=new Date(Date.UTC(t,e-1,i,n,r,o,0));this.setByDate(s)},this.getFreshValueHex=function(){return this.hV}},$t(lt.asn1.DERAbstractTime,lt.asn1.ASN1Object),lt.asn1.DERAbstractStructured=function(t){lt.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array=t},this.appendASN1Object=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array.push(t)},this.asn1Array=new Array,void 0!==t&&void 0!==t.array&&(this.asn1Array=t.array)},$t(lt.asn1.DERAbstractStructured,lt.asn1.ASN1Object),lt.asn1.DERBoolean=function(t){lt.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV=0==t?"010100":"0101ff"},$t(lt.asn1.DERBoolean,lt.asn1.ASN1Object),lt.asn1.DERInteger=function(t){lt.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=lt.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new S(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.bigint?this.setByBigInteger(t.bigint):void 0!==t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):void 0!==t.hex&&this.setValueHex(t.hex))},$t(lt.asn1.DERInteger,lt.asn1.ASN1Object),lt.asn1.DERBitString=function(t){if(void 0!==t&&void 0!==t.obj){var e=lt.asn1.ASN1Util.newObject(t.obj);t.hex="00"+e.getEncodedHex()}lt.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(t){this.hTLV=null,this.isModified=!0,this.hV=t},this.setUnusedBitsAndHexValue=function(t,e){if(t<0||7<t)throw"unused bits shall be from 0 to 7: u = "+t;var i="0"+t;this.hTLV=null,this.isModified=!0,this.hV=i+e},this.setByBinaryString=function(t){var e=8-(t=t.replace(/0+$/,"")).length%8;8==e&&(e=0);for(var i=0;i<=e;i++)t+="0";var n="";for(i=0;i<t.length-1;i+=8){var r=t.substr(i,8),o=parseInt(r,2).toString(16);1==o.length&&(o="0"+o),n+=o}this.hTLV=null,this.isModified=!0,this.hV="0"+e+n},this.setByBooleanArray=function(t){for(var e="",i=0;i<t.length;i++)e+=1==t[i]?"1":"0";this.setByBinaryString(e)},this.newFalseArray=function(t){for(var e=new Array(t),i=0;i<t;i++)e[i]=!1;return e},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t&&t.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(t):void 0!==t.hex?this.setHexValueIncludingUnusedBits(t.hex):void 0!==t.bin?this.setByBinaryString(t.bin):void 0!==t.array&&this.setByBooleanArray(t.array))},$t(lt.asn1.DERBitString,lt.asn1.ASN1Object),lt.asn1.DEROctetString=function(t){if(void 0!==t&&void 0!==t.obj){var e=lt.asn1.ASN1Util.newObject(t.obj);t.hex=e.getEncodedHex()}lt.asn1.DEROctetString.superclass.constructor.call(this,t),this.hT="04"},$t(lt.asn1.DEROctetString,lt.asn1.DERAbstractString),lt.asn1.DERNull=function(){lt.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},$t(lt.asn1.DERNull,lt.asn1.ASN1Object),lt.asn1.DERObjectIdentifier=function(t){lt.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.setValueOidString=function(t){var e=function(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},i=function(t){var i="",n=parseInt(t,10).toString(2),r=7-n.length%7;7==r&&(r=0);for(var o="",s=0;s<r;s++)o+="0";for(n=o+n,s=0;s<n.length-1;s+=7){var a=n.substr(s,7);s!=n.length-7&&(a="1"+a),i+=e(parseInt(a,2))}return i};try{if(!t.match(/^[0-9.]+$/))return null;var n="",r=t.split("."),o=40*parseInt(r[0],10)+parseInt(r[1],10);n+=e(o),r.splice(0,2);for(var s=0;s<r.length;s++)n+=i(r[s]);return n}catch(t){return null}}(t);if(null==e)throw new Error("malformed oid string: "+t);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueName=function(t){var e=lt.asn1.x509.OID.name2oid(t);if(""===e)throw new Error("DERObjectIdentifier oidName undefined: "+t);this.setValueOidString(e)},this.setValueNameOrOid=function(t){t.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(t):this.setValueName(t)},this.getFreshValueHex=function(){return this.hV},this.setByParam=function(t){"string"==typeof t?this.setValueNameOrOid(t):void 0!==t.oid?this.setValueNameOrOid(t.oid):void 0!==t.name?this.setValueNameOrOid(t.name):void 0!==t.hex&&this.setValueHex(t.hex)},void 0!==t&&this.setByParam(t)},$t(lt.asn1.DERObjectIdentifier,lt.asn1.ASN1Object),lt.asn1.DEREnumerated=function(t){lt.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=lt.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new S(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):void 0!==t.hex&&this.setValueHex(t.hex))},$t(lt.asn1.DEREnumerated,lt.asn1.ASN1Object),lt.asn1.DERUTF8String=function(t){lt.asn1.DERUTF8String.superclass.constructor.call(this,t),this.hT="0c"},$t(lt.asn1.DERUTF8String,lt.asn1.DERAbstractString),lt.asn1.DERNumericString=function(t){lt.asn1.DERNumericString.superclass.constructor.call(this,t),this.hT="12"},$t(lt.asn1.DERNumericString,lt.asn1.DERAbstractString),lt.asn1.DERPrintableString=function(t){lt.asn1.DERPrintableString.superclass.constructor.call(this,t),this.hT="13"},$t(lt.asn1.DERPrintableString,lt.asn1.DERAbstractString),lt.asn1.DERTeletexString=function(t){lt.asn1.DERTeletexString.superclass.constructor.call(this,t),this.hT="14"},$t(lt.asn1.DERTeletexString,lt.asn1.DERAbstractString),lt.asn1.DERIA5String=function(t){lt.asn1.DERIA5String.superclass.constructor.call(this,t),this.hT="16"},$t(lt.asn1.DERIA5String,lt.asn1.DERAbstractString),lt.asn1.DERVisibleString=function(t){lt.asn1.DERIA5String.superclass.constructor.call(this,t),this.hT="1a"},$t(lt.asn1.DERVisibleString,lt.asn1.DERAbstractString),lt.asn1.DERBMPString=function(t){lt.asn1.DERBMPString.superclass.constructor.call(this,t),this.hT="1e"},$t(lt.asn1.DERBMPString,lt.asn1.DERAbstractString),lt.asn1.DERUTCTime=function(t){lt.asn1.DERUTCTime.superclass.constructor.call(this,t),this.hT="17",this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"utc"),this.hV=gt(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=gt(this.s)),this.hV},void 0!==t&&(void 0!==t.str?this.setString(t.str):"string"==typeof t&&t.match(/^[0-9]{12}Z$/)?this.setString(t):void 0!==t.hex?this.setStringHex(t.hex):void 0!==t.date&&this.setByDate(t.date))},$t(lt.asn1.DERUTCTime,lt.asn1.DERAbstractTime),lt.asn1.DERGeneralizedTime=function(t){lt.asn1.DERGeneralizedTime.superclass.constructor.call(this,t),this.hT="18",this.withMillis=!1,this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=gt(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=gt(this.s)),this.hV},void 0!==t&&(void 0!==t.str?this.setString(t.str):"string"==typeof t&&t.match(/^[0-9]{14}Z$/)?this.setString(t):void 0!==t.hex?this.setStringHex(t.hex):void 0!==t.date&&this.setByDate(t.date),!0===t.millis&&(this.withMillis=!0))},$t(lt.asn1.DERGeneralizedTime,lt.asn1.DERAbstractTime),lt.asn1.DERSequence=function(t){lt.asn1.DERSequence.superclass.constructor.call(this,t),this.hT="30",this.getFreshValueHex=function(){for(var t="",e=0;e<this.asn1Array.length;e++)t+=this.asn1Array[e].getEncodedHex();return this.hV=t,this.hV}},$t(lt.asn1.DERSequence,lt.asn1.DERAbstractStructured),lt.asn1.DERSet=function(t){lt.asn1.DERSet.superclass.constructor.call(this,t),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var t=new Array,e=0;e<this.asn1Array.length;e++)t.push(this.asn1Array[e].getEncodedHex());return 1==this.sortFlag&&t.sort(),this.hV=t.join(""),this.hV},void 0!==t&&void 0!==t.sortflag&&0==t.sortflag&&(this.sortFlag=!1)},$t(lt.asn1.DERSet,lt.asn1.DERAbstractStructured),lt.asn1.DERTaggedObject=function(t){lt.asn1.DERTaggedObject.superclass.constructor.call(this);var e=lt.asn1;this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(t,e,i){this.hT=e,this.isExplicit=t,this.asn1Object=i,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=i.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,e),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},this.setByParam=function(t){null!=t.tag&&(this.hT=t.tag),null!=t.explicit&&(this.isExplicit=t.explicit),null!=t.tage&&(this.hT=t.tage,this.isExplicit=!0),null!=t.tagi&&(this.hT=t.tagi,this.isExplicit=!1),null!=t.obj&&(t.obj instanceof e.ASN1Object?(this.asn1Object=t.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)):"object"==m(t.obj)&&(this.asn1Object=e.ASN1Util.newObject(t.obj),this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},null!=t&&this.setByParam(t)},$t(lt.asn1.DERTaggedObject,lt.asn1.ASN1Object);var lt,ut,ht,dt=new function(){};function ft(t){for(var e=new Array,i=0;i<t.length;i++)e[i]=t.charCodeAt(i);return e}function pt(t){for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return e}function vt(t){for(var e="",i=0;i<t.length;i++){var n=t[i].toString(16);1==n.length&&(n="0"+n),e+=n}return e}function gt(t){return vt(ft(t))}function mt(t){return(t=(t=t.replace(/\=/g,"")).replace(/\+/g,"-")).replace(/\//g,"_")}function wt(t){return t.length%4==2?t+="==":t.length%4==3&&(t+="="),(t=t.replace(/-/g,"+")).replace(/_/g,"/")}function bt(t){return t.length%2==1&&(t="0"+t),mt(x(t))}function yt(t){return k(wt(t))}function xt(t){return Tt(Ut(t))}function kt(t){return decodeURIComponent(Ot(t))}function Et(t){for(var e="",i=0;i<t.length-1;i+=2)e+=String.fromCharCode(parseInt(t.substr(i,2),16));return e}function St(t){for(var e="",i=0;i<t.length;i++)e+=("0"+t.charCodeAt(i).toString(16)).slice(-2);return e}function Ft(t){return x(t)}function At(t){return Ft(t).replace(/(.{64})/g,"$1\r\n").replace(/\r\n$/,"")}function _t(t){return k(t.replace(/[^0-9A-Za-z\/+=]*/g,""))}function jt(t,e){return"-----BEGIN "+e+"-----\r\n"+At(t)+"\r\n-----END "+e+"-----\r\n"}function Ct(t,e){if(-1==t.indexOf("-----BEGIN "))throw"can't find PEM header: "+e;return _t(t=void 0!==e?(t=t.replace(new RegExp("^[^]*-----BEGIN "+e+"-----"),"")).replace(new RegExp("-----END "+e+"-----[^]*$"),""):(t=t.replace(/^[^]*-----BEGIN [^-]+-----/,"")).replace(/-----END [^-]+-----[^]*$/,""))}function Rt(t){var e,i,n,r,o,s,a,c,l,u,h;if(h=t.match(/^(\d{2}|\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(|\.\d+)Z$/))return c=h[1],e=parseInt(c),2===c.length&&(50<=e&&e<100?e=1900+e:0<=e&&e<50&&(e=2e3+e)),i=parseInt(h[2])-1,n=parseInt(h[3]),r=parseInt(h[4]),o=parseInt(h[5]),s=parseInt(h[6]),a=0,""!==(l=h[7])&&(u=(l.substr(1)+"00").substr(0,3),a=parseInt(u)),Date.UTC(e,i,n,r,o,s,a);throw"unsupported zulu format: "+t}function It(t){return~~(Rt(t)/1e3)}function Tt(t){return t.replace(/%/g,"")}function Ot(t){return t.replace(/(..)/g,"%$1")}function Pt(t){var e="malformed IPv6 address";if(!t.match(/^[0-9A-Fa-f:]+$/))throw e;var i=(t=t.toLowerCase()).split(":").length-1;if(i<2)throw e;var n=":".repeat(7-i+2),r=(t=t.replace("::",n)).split(":");if(8!=r.length)throw e;for(var o=0;o<8;o++)r[o]=("0000"+r[o]).slice(-4);return r.join("")}function Nt(t){if(!t.match(/^[0-9A-Fa-f]{32}$/))throw"malformed IPv6 address octet";for(var e=(t=t.toLowerCase()).match(/.{1,4}/g),i=0;i<8;i++)e[i]=e[i].replace(/^0+/,""),""==e[i]&&(e[i]="0");var n=(t=":"+e.join(":")+":").match(/:(0:){2,}/g);if(null===n)return t.slice(1,-1);var r="";for(i=0;i<n.length;i++)n[i].length>r.length&&(r=n[i]);return(t=t.replace(r,"::")).slice(1,-1)}function Dt(t){var e="malformed hex value";if(!t.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw e;if(8!=t.length)return 32==t.length?Nt(t):t;try{return parseInt(t.substr(0,2),16)+"."+parseInt(t.substr(2,2),16)+"."+parseInt(t.substr(4,2),16)+"."+parseInt(t.substr(6,2),16)}catch(t){throw e}}function Mt(t){return t.match(/.{4}/g).map((function(t){var e=parseInt(t.substr(0,2),16),i=parseInt(t.substr(2),16);if(0==e&i<128)return String.fromCharCode(i);if(e<8){var n=128|63&i;return kt((192|(7&e)<<3|(192&i)>>6).toString(16)+n.toString(16))}n=128|(15&e)<<2|(192&i)>>6;var r=128|63&i;return kt((224|(240&e)>>4).toString(16)+n.toString(16)+r.toString(16))})).join("")}function Ut(t){for(var e=encodeURIComponent(t),i="",n=0;n<e.length;n++)"%"==e[n]?(i+=e.substr(n,3),n+=2):i=i+"%"+gt(e[n]);return i}function Lt(t){return!(t.length%2!=0||!t.match(/^[0-9a-f]+$/)&&!t.match(/^[0-9A-F]+$/))}function Bt(t){return t.length%2==1?"0"+t:t.substr(0,1)>"7"?"00"+t:t}dt.getLblen=function(t,e){if("8"!=t.substr(e+2,1))return 1;var i=parseInt(t.substr(e+3,1));return 0==i?-1:0<i&&i<10?i+1:-2},dt.getL=function(t,e){var i=dt.getLblen(t,e);return i<1?"":t.substr(e+2,2*i)},dt.getVblen=function(t,e){var i;return""==(i=dt.getL(t,e))?-1:("8"===i.substr(0,1)?new S(i.substr(2),16):new S(i,16)).intValue()},dt.getVidx=function(t,e){var i=dt.getLblen(t,e);return i<0?i:e+2*(i+1)},dt.getV=function(t,e){var i=dt.getVidx(t,e),n=dt.getVblen(t,e);return t.substr(i,2*n)},dt.getTLV=function(t,e){return t.substr(e,2)+dt.getL(t,e)+dt.getV(t,e)},dt.getTLVblen=function(t,e){return 2+2*dt.getLblen(t,e)+2*dt.getVblen(t,e)},dt.getNextSiblingIdx=function(t,e){return dt.getVidx(t,e)+2*dt.getVblen(t,e)},dt.getChildIdx=function(t,e){var i,n,r,o=dt,s=[];i=o.getVidx(t,e),n=2*o.getVblen(t,e),"03"==t.substr(e,2)&&(i+=2,n-=2),r=0;for(var a=i;r<=n;){var c=o.getTLVblen(t,a);if((r+=c)<=n&&s.push(a),a+=c,r>=n)break}return s},dt.getNthChildIdx=function(t,e,i){return dt.getChildIdx(t,e)[i]},dt.getIdxbyList=function(t,e,i,n){var r,o,s=dt;return 0==i.length?void 0!==n&&t.substr(e,2)!==n?-1:e:(r=i.shift())>=(o=s.getChildIdx(t,e)).length?-1:s.getIdxbyList(t,o[r],i,n)},dt.getIdxbyListEx=function(t,e,i,n){var r,o,s=dt;if(0==i.length)return void 0!==n&&t.substr(e,2)!==n?-1:e;r=i.shift(),o=s.getChildIdx(t,e);for(var a=0,c=0;c<o.length;c++){var l=t.substr(o[c],2);if("number"==typeof r&&!s.isContextTag(l)&&a==r||"string"==typeof r&&s.isContextTag(l,r))return s.getIdxbyListEx(t,o[c],i,n);s.isContextTag(l)||a++}return-1},dt.getTLVbyList=function(t,e,i,n){var r=dt,o=r.getIdxbyList(t,e,i,n);return-1==o||o>=t.length?null:r.getTLV(t,o)},dt.getTLVbyListEx=function(t,e,i,n){var r=dt,o=r.getIdxbyListEx(t,e,i,n);return-1==o?null:r.getTLV(t,o)},dt.getVbyList=function(t,e,i,n,r){var o,s,a=dt;return-1==(o=a.getIdxbyList(t,e,i,n))||o>=t.length?null:(s=a.getV(t,o),!0===r&&(s=s.substr(2)),s)},dt.getVbyListEx=function(t,e,i,n,r){var o,s,a=dt;return-1==(o=a.getIdxbyListEx(t,e,i,n))?null:(s=a.getV(t,o),"03"==t.substr(o,2)&&!1!==r&&(s=s.substr(2)),s)},dt.getInt=function(t,e,i){null==i&&(i=-1);try{var n=t.substr(e,2);if("02"!=n&&"03"!=n)return i;var r=dt.getV(t,e);return"02"==n?parseInt(r,16):function(t){try{var e=t.substr(0,2);if("00"==e)return parseInt(t.substr(2),16);var i=parseInt(e,16),n=t.substr(2),r=parseInt(n,16).toString(2);return"0"==r&&(r="00000000"),r=r.slice(0,0-i),parseInt(r,2)}catch(t){return-1}}(r)}catch(t){return i}},dt.getOID=function(t,e,i){null==i&&(i=null);try{return"06"!=t.substr(e,2)?i:function(t){if(!Lt(t))return null;try{var e=[],i=t.substr(0,2),n=parseInt(i,16);e[0]=new String(Math.floor(n/40)),e[1]=new String(n%40);for(var r=t.substr(2),o=[],s=0;s<r.length/2;s++)o.push(parseInt(r.substr(2*s,2),16));var a=[],c="";for(s=0;s<o.length;s++)128&o[s]?c+=Jt((127&o[s]).toString(2),7):(c+=Jt((127&o[s]).toString(2),7),a.push(new String(parseInt(c,2))),c="");var l=e.join(".");return a.length>0&&(l=l+"."+a.join(".")),l}catch(t){return null}}(dt.getV(t,e))}catch(t){return i}},dt.getOIDName=function(t,e,i){null==i&&(i=null);try{var n=dt.getOID(t,e,i);if(n==i)return i;var r=lt.asn1.x509.OID.oid2name(n);return""==r?n:r}catch(t){return i}},dt.getString=function(t,e,i){null==i&&(i=null);try{return Et(dt.getV(t,e))}catch(t){return i}},dt.hextooidstr=function(t){var e=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},i=[],n=t.substr(0,2),r=parseInt(n,16);i[0]=new String(Math.floor(r/40)),i[1]=new String(r%40);for(var o=t.substr(2),s=[],a=0;a<o.length/2;a++)s.push(parseInt(o.substr(2*a,2),16));var c=[],l="";for(a=0;a<s.length;a++)128&s[a]?l+=e((127&s[a]).toString(2),7):(l+=e((127&s[a]).toString(2),7),c.push(new String(parseInt(l,2))),l="");var u=i.join(".");return c.length>0&&(u=u+"."+c.join(".")),u},dt.dump=function(t,e,i,n){var r=dt,o=r.getV,s=r.dump,a=r.getChildIdx,c=t;t instanceof lt.asn1.ASN1Object&&(c=t.getEncodedHex());var l=function(t,e){return t.length<=2*e?t:t.substr(0,e)+"..(total "+t.length/2+"bytes).."+t.substr(t.length-e,e)};void 0===e&&(e={ommit_long_octet:32}),void 0===i&&(i=0),void 0===n&&(n="");var u,h=e.ommit_long_octet;if("01"==(u=c.substr(i,2)))return"00"==(d=o(c,i))?n+"BOOLEAN FALSE\n":n+"BOOLEAN TRUE\n";if("02"==u)return n+"INTEGER "+l(d=o(c,i),h)+"\n";if("03"==u){var d=o(c,i);return r.isASN1HEX(d.substr(2))?(x=n+"BITSTRING, encapsulates\n")+s(d.substr(2),e,0,n+" "):n+"BITSTRING "+l(d,h)+"\n"}if("04"==u)return d=o(c,i),r.isASN1HEX(d)?(x=n+"OCTETSTRING, encapsulates\n")+s(d,e,0,n+" "):n+"OCTETSTRING "+l(d,h)+"\n";if("05"==u)return n+"NULL\n";if("06"==u){var f=o(c,i),p=lt.asn1.ASN1Util.oidHexToInt(f),v=lt.asn1.x509.OID.oid2name(p),g=p.replace(/\./g," ");return""!=v?n+"ObjectIdentifier "+v+" ("+g+")\n":n+"ObjectIdentifier ("+g+")\n"}if("0a"==u)return n+"ENUMERATED "+parseInt(o(c,i))+"\n";if("0c"==u)return n+"UTF8String '"+kt(o(c,i))+"'\n";if("13"==u)return n+"PrintableString '"+kt(o(c,i))+"'\n";if("14"==u)return n+"TeletexString '"+kt(o(c,i))+"'\n";if("16"==u)return n+"IA5String '"+kt(o(c,i))+"'\n";if("17"==u)return n+"UTCTime "+kt(o(c,i))+"\n";if("18"==u)return n+"GeneralizedTime "+kt(o(c,i))+"\n";if("1a"==u)return n+"VisualString '"+kt(o(c,i))+"'\n";if("1e"==u)return n+"BMPString '"+Mt(o(c,i))+"'\n";if("30"==u){if("3000"==c.substr(i,4))return n+"SEQUENCE {}\n";x=n+"SEQUENCE\n";var m=e;if((2==(y=a(c,i)).length||3==y.length)&&"06"==c.substr(y[0],2)&&"04"==c.substr(y[y.length-1],2)){v=r.oidname(o(c,y[0]));var w=JSON.parse(JSON.stringify(e));w.x509ExtName=v,m=w}for(var b=0;b<y.length;b++)x+=s(c,m,y[b],n+" ");return x}if("31"==u){x=n+"SET\n";var y=a(c,i);for(b=0;b<y.length;b++)x+=s(c,e,y[b],n+" ");return x}if(0!=(128&(u=parseInt(u,16)))){var x,k=31&u;if(0!=(32&u)){for(x=n+"["+k+"]\n",y=a(c,i),b=0;b<y.length;b++)x+=s(c,e,y[b],n+" ");return x}return d=o(c,i),dt.isASN1HEX(d)?(x=n+"["+k+"]\n")+s(d,e,0,n+" "):(("68747470"==d.substr(0,8)||"subjectAltName"===e.x509ExtName&&2==k)&&(d=kt(d)),n+"["+k+"] "+d+"\n")}return n+"UNKNOWN("+u+") "+o(c,i)+"\n"},dt.isContextTag=function(t,e){var i,n;t=t.toLowerCase();try{i=parseInt(t,16)}catch(t){return-1}if(void 0===e)return 128==(192&i);try{return null!=e.match(/^\[[0-9]+\]$/)&&!((n=parseInt(e.substr(1,e.length-1),10))>31)&&128==(192&i)&&(31&i)==n}catch(t){return!1}},dt.isASN1HEX=function(t){var e=dt;if(t.length%2==1)return!1;var i=e.getVblen(t,0),n=t.substr(0,2),r=e.getL(t,0);return t.length-n.length-r.length==2*i},dt.checkStrictDER=function(t,e,i,n,r){var o=dt;if(void 0===i){if("string"!=typeof t)throw new Error("not hex string");if(t=t.toLowerCase(),!lt.lang.String.isHex(t))throw new Error("not hex string");i=t.length,r=(n=t.length/2)<128?1:Math.ceil(n.toString(16))+1}if(o.getL(t,e).length>2*r)throw new Error("L of TLV too long: idx="+e);var s=o.getVblen(t,e);if(s>n)throw new Error("value of L too long than hex: idx="+e);var a=o.getTLV(t,e),c=a.length-2-o.getL(t,e).length;if(c!==2*s)throw new Error("V string length and L's value not the same:"+c+"/"+2*s);if(0===e&&t.length!=a.length)throw new Error("total length and TLV length unmatch:"+t.length+"!="+a.length);var l=t.substr(e,2);if("02"===l){var u=o.getVidx(t,e);if("00"==t.substr(u,2)&&t.charCodeAt(u+2)<56)throw new Error("not least zeros for DER INTEGER")}if(32&parseInt(l,16)){for(var h=o.getVblen(t,e),d=0,f=o.getChildIdx(t,e),p=0;p<f.length;p++)d+=o.getTLV(t,f[p]).length,o.checkStrictDER(t,f[p],i,n,r);if(2*h!=d)throw new Error("sum of children's TLV length and L unmatch: "+2*h+"!="+d)}},dt.oidname=function(t){var e=lt.asn1;lt.lang.String.isHex(t)&&(t=e.ASN1Util.oidHexToInt(t));var i=e.x509.OID.oid2name(t);return""===i&&(i=t),i},void 0!==lt&<||(e.KJUR=lt={}),void 0!==lt.lang&<.lang||(lt.lang={}),lt.lang.String=function(){},"function"==typeof t?(e.utf8tob64u=ut=function(e){return mt(t.from(e,"utf8").toString("base64"))},e.b64utoutf8=ht=function(e){return t.from(wt(e),"base64").toString("utf8")}):(e.utf8tob64u=ut=function(t){return bt(Tt(Ut(t)))},e.b64utoutf8=ht=function(t){return decodeURIComponent(Ot(yt(t)))}),lt.lang.String.isInteger=function(t){return!!t.match(/^[0-9]+$/)||!!t.match(/^-[0-9]+$/)},lt.lang.String.isHex=function(t){return Lt(t)},lt.lang.String.isBase64=function(t){return!(!(t=t.replace(/\s+/g,"")).match(/^[0-9A-Za-z+\/]+={0,3}$/)||t.length%4!=0)},lt.lang.String.isBase64URL=function(t){return!t.match(/[+/=]/)&&(t=wt(t),lt.lang.String.isBase64(t))},lt.lang.String.isIntegerArray=function(t){return!!(t=t.replace(/\s+/g,"")).match(/^\[[0-9,]+\]$/)},lt.lang.String.isPrintable=function(t){return null!==t.match(/^[0-9A-Za-z '()+,-./:=?]*$/)},lt.lang.String.isIA5=function(t){return null!==t.match(/^[\x20-\x21\x23-\x7f]*$/)},lt.lang.String.isMail=function(t){return null!==t.match(/^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]{1,}\.[A-Za-z0-9]{1,}$/)};var Jt=function(t,e,i){return null==i&&(i="0"),t.length>=e?t:new Array(e-t.length+1).join(i)+t};function $t(t,e){var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t,t.superclass=e.prototype,e.prototype.constructor==Object.prototype.constructor&&(e.prototype.constructor=e)}void 0!==lt&<||(e.KJUR=lt={}),void 0!==lt.crypto&<.crypto||(lt.crypto={}),lt.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:b.algo.MD5,sha1:b.algo.SHA1,sha224:b.algo.SHA224,sha256:b.algo.SHA256,sha384:b.algo.SHA384,sha512:b.algo.SHA512,ripemd160:b.algo.RIPEMD160},this.getDigestInfoHex=function(t,e){if(void 0===this.DIGESTINFOHEAD[e])throw"alg not supported in Util.DIGESTINFOHEAD: "+e;return this.DIGESTINFOHEAD[e]+t},this.getPaddedDigestInfoHex=function(t,e,i){var n=this.getDigestInfoHex(t,e),r=i/4;if(n.length+22>r)throw"key is too short for SigAlg: keylen="+i+","+e;for(var o="0001",s="00"+n,a="",c=r-o.length-s.length,l=0;l<c;l+=2)a+="ff";return o+a+s},this.hashString=function(t,e){return new lt.crypto.MessageDigest({alg:e}).digestString(t)},this.hashHex=function(t,e){return new lt.crypto.MessageDigest({alg:e}).digestHex(t)},this.sha1=function(t){return this.hashString(t,"sha1")},this.sha256=function(t){return this.hashString(t,"sha256")},this.sha256Hex=function(t){return this.hashHex(t,"sha256")},this.sha512=function(t){return this.hashString(t,"sha512")},this.sha512Hex=function(t){return this.hashHex(t,"sha512")},this.isKey=function(t){return t instanceof rt||t instanceof lt.crypto.DSA||t instanceof lt.crypto.ECDSA}},lt.crypto.Util.md5=function(t){return new lt.crypto.MessageDigest({alg:"md5",prov:"cryptojs"}).digestString(t)},lt.crypto.Util.ripemd160=function(t){return new lt.crypto.MessageDigest({alg:"ripemd160",prov:"cryptojs"}).digestString(t)},lt.crypto.Util.SECURERANDOMGEN=new et,lt.crypto.Util.getRandomHexOfNbytes=function(t){var e=new Array(t);return lt.crypto.Util.SECURERANDOMGEN.nextBytes(e),vt(e)},lt.crypto.Util.getRandomBigIntegerOfNbytes=function(t){return new S(lt.crypto.Util.getRandomHexOfNbytes(t),16)},lt.crypto.Util.getRandomHexOfNbits=function(t){var e=t%8,i=new Array((t-e)/8+1);return lt.crypto.Util.SECURERANDOMGEN.nextBytes(i),i[0]=(255<<e&255^255)&i[0],vt(i)},lt.crypto.Util.getRandomBigIntegerOfNbits=function(t){return new S(lt.crypto.Util.getRandomHexOfNbits(t),16)},lt.crypto.Util.getRandomBigIntegerZeroToMax=function(t){for(var e=t.bitLength();;){var i=lt.crypto.Util.getRandomBigIntegerOfNbits(e);if(-1!=t.compareTo(i))return i}},lt.crypto.Util.getRandomBigIntegerMinToMax=function(t,e){var i=t.compareTo(e);if(1==i)throw"biMin is greater than biMax";if(0==i)return t;var n=e.subtract(t);return lt.crypto.Util.getRandomBigIntegerZeroToMax(n).add(t)},lt.crypto.MessageDigest=function(t){this.setAlgAndProvider=function(t,e){if(null!==(t=lt.crypto.MessageDigest.getCanonicalAlgName(t))&&void 0===e&&(e=lt.crypto.Util.DEFAULTPROVIDER[t]),-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(t)&&"cryptojs"==e){try{this.md=lt.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[t].create()}catch(e){throw"setAlgAndProvider hash alg set fail alg="+t+"/"+e}this.updateString=function(t){this.md.update(t)},this.updateHex=function(t){var e=b.enc.Hex.parse(t);this.md.update(e)},this.digest=function(){return this.md.finalize().toString(b.enc.Hex)},this.digestString=function(t){return this.updateString(t),this.digest()},this.digestHex=function(t){return this.updateHex(t),this.digest()}}if(-1!=":sha256:".indexOf(t)&&"sjcl"==e){try{this.md=new sjcl.hash.sha256}catch(e){throw"setAlgAndProvider hash alg set fail alg="+t+"/"+e}this.updateString=function(t){this.md.update(t)},this.updateHex=function(t){var e=sjcl.codec.hex.toBits(t);this.md.update(e)},this.digest=function(){var t=this.md.finalize();return sjcl.codec.hex.fromBits(t)},this.digestString=function(t){return this.updateString(t),this.digest()},this.digestHex=function(t){return this.updateHex(t),this.digest()}}},this.updateString=function(){throw"updateString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.updateHex=function(){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(){throw"digestString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestHex=function(){throw"digestHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},void 0!==t&&void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov&&(this.provName=lt.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))},lt.crypto.MessageDigest.getCanonicalAlgName=function(t){return"string"==typeof t&&(t=(t=t.toLowerCase()).replace(/-/,"")),t},lt.crypto.MessageDigest.getHashLength=function(t){var e=lt.crypto.MessageDigest,i=e.getCanonicalAlgName(t);if(void 0===e.HASHLENGTH[i])throw"not supported algorithm: "+t;return e.HASHLENGTH[i]},lt.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20},lt.crypto.Mac=function(t){this.setAlgAndProvider=function(t,e){if(null==(t=t.toLowerCase())&&(t="hmacsha1"),"hmac"!=(t=t.toLowerCase()).substr(0,4))throw"setAlgAndProvider unsupported HMAC alg: "+t;void 0===e&&(e=lt.crypto.Util.DEFAULTPROVIDER[t]),this.algProv=t+"/"+e;var i=t.substr(4);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(i)&&"cryptojs"==e){try{this.mac=b.algo.HMAC.create(lt.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[i],this.pass)}catch(t){throw"setAlgAndProvider hash alg set fail hashAlg="+i+"/"+t}this.updateString=function(t){this.mac.update(t)},this.updateHex=function(t){var e=b.enc.Hex.parse(t);this.mac.update(e)},this.doFinal=function(){return this.mac.finalize().toString(b.enc.Hex)},this.doFinalString=function(t){return this.updateString(t),this.doFinal()},this.doFinalHex=function(t){return this.updateHex(t),this.doFinal()}}},this.updateString=function(){throw"updateString(str) not supported for this alg/prov: "+this.algProv},this.updateHex=function(){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(){throw"digestString(str) not supported for this alg/prov: "+this.algProv},this.doFinalHex=function(){throw"digestHex(hex) not supported for this alg/prov: "+this.algProv},this.setPassword=function(t){if("string"==typeof t){var e=t;return t.length%2!=1&&t.match(/^[0-9A-Fa-f]+$/)||(e=St(t)),void(this.pass=b.enc.Hex.parse(e))}if("object"!=(void 0===t?"undefined":m(t)))throw"KJUR.crypto.Mac unsupported password type: "+t;if(e=null,void 0!==t.hex){if(t.hex.length%2!=0||!t.hex.match(/^[0-9A-Fa-f]+$/))throw"Mac: wrong hex password: "+t.hex;e=t.hex}if(void 0!==t.utf8&&(e=xt(t.utf8)),void 0!==t.rstr&&(e=St(t.rstr)),void 0!==t.b64&&(e=k(t.b64)),void 0!==t.b64u&&(e=yt(t.b64u)),null==e)throw"KJUR.crypto.Mac unsupported password type: "+t;this.pass=b.enc.Hex.parse(e)},void 0!==t&&(void 0!==t.pass&&this.setPassword(t.pass),void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov&&(this.provName=lt.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName)))},lt.crypto.Signature=function(t){var e=null;if(this._setAlgNames=function(){var t=this.algName.match(/^(.+)with(.+)$/);t&&(this.mdAlgName=t[1].toLowerCase(),this.pubkeyAlgName=t[2].toLowerCase(),"rsaandmgf1"==this.pubkeyAlgName&&"sha"==this.mdAlgName&&(this.mdAlgName="sha1"))},this._zeroPaddingOfSignature=function(t,e){for(var i="",n=e/4-t.length,r=0;r<n;r++)i+="0";return i+t},this.setAlgAndProvider=function(t,e){if(this._setAlgNames(),"cryptojs/jsrsa"!=e)throw new Error("provider not supported: "+e);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)){try{this.md=new lt.crypto.MessageDigest({alg:this.mdAlgName})}catch(t){throw new Error("setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+t)}this.init=function(t,e){var i=null;try{i=void 0===e?zt.getKey(t):zt.getKey(t,e)}catch(t){throw"init failed:"+t}if(!0===i.isPrivate)this.prvKey=i,this.state="SIGN";else{if(!0!==i.isPublic)throw"init failed.:"+i;this.pubKey=i,this.state="VERIFY"}},this.updateString=function(t){this.md.updateString(t)},this.updateHex=function(t){this.md.updateHex(t)},this.sign=function(){if(this.sHashHex=this.md.digest(),void 0===this.prvKey&&void 0!==this.ecprvhex&&void 0!==this.eccurvename&&void 0!==lt.crypto.ECDSA&&(this.prvKey=new lt.crypto.ECDSA({curve:this.eccurvename,prv:this.ecprvhex})),this.prvKey instanceof rt&&"rsaandmgf1"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHashPSS(this.sHashHex,this.mdAlgName,this.pssSaltLen);else if(this.prvKey instanceof rt&&"rsa"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex,this.mdAlgName);else if(this.prvKey instanceof lt.crypto.ECDSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else{if(!(this.prvKey instanceof lt.crypto.DSA))throw"Signature: unsupported private key alg: "+this.pubkeyAlgName;this.hSign=this.prvKey.signWithMessageHash(this.sHashHex)}return this.hSign},this.signString=function(t){return this.updateString(t),this.sign()},this.signHex=function(t){return this.updateHex(t),this.sign()},this.verify=function(t){if(this.sHashHex=this.md.digest(),void 0===this.pubKey&&void 0!==this.ecpubhex&&void 0!==this.eccurvename&&void 0!==lt.crypto.ECDSA&&(this.pubKey=new lt.crypto.ECDSA({curve:this.eccurvename,pub:this.ecpubhex})),this.pubKey instanceof rt&&"rsaandmgf1"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,t,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof rt&&"rsa"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);if(void 0!==lt.crypto.ECDSA&&this.pubKey instanceof lt.crypto.ECDSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);if(void 0!==lt.crypto.DSA&&this.pubKey instanceof lt.crypto.DSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName}}},this.init=function(){throw"init(key, pass) not supported for this alg:prov="+this.algProvName},this.updateString=function(){throw"updateString(str) not supported for this alg:prov="+this.algProvName},this.updateHex=function(){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(){throw"digestString(str) not supported for this alg:prov="+this.algProvName},this.signHex=function(){throw"digestHex(hex) not supported for this alg:prov="+this.algProvName},this.verify=function(){throw"verify(hSigVal) not supported for this alg:prov="+this.algProvName},this.initParams=t,void 0!==t&&(void 0!==t.alg&&(this.algName=t.alg,this.provName=void 0===t.prov?lt.crypto.Util.DEFAULTPROVIDER[this.algName]:t.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),void 0!==t.psssaltlen&&(this.pssSaltLen=t.psssaltlen),void 0!==t.prvkeypem)){if(void 0!==t.prvkeypas)throw"both prvkeypem and prvkeypas parameters not supported";try{e=zt.getKey(t.prvkeypem),this.init(e)}catch(t){throw"fatal error to load pem private key: "+t}}},lt.crypto.Cipher=function(){},lt.crypto.Cipher.encrypt=function(t,e,i){if(e instanceof rt&&e.isPublic){var n=lt.crypto.Cipher.getAlgByKeyAndName(e,i);if("RSA"===n)return e.encrypt(t);if("RSAOAEP"===n)return e.encryptOAEP(t,"sha1");var r=n.match(/^RSAOAEP(\d+)$/);if(null!==r)return e.encryptOAEP(t,"sha"+r[1]);throw"Cipher.encrypt: unsupported algorithm for RSAKey: "+i}throw"Cipher.encrypt: unsupported key or algorithm"},lt.crypto.Cipher.decrypt=function(t,e,i){if(e instanceof rt&&e.isPrivate){var n=lt.crypto.Cipher.getAlgByKeyAndName(e,i);if("RSA"===n)return e.decrypt(t);if("RSAOAEP"===n)return e.decryptOAEP(t,"sha1");var r=n.match(/^RSAOAEP(\d+)$/);if(null!==r)return e.decryptOAEP(t,"sha"+r[1]);throw"Cipher.decrypt: unsupported algorithm for RSAKey: "+i}throw"Cipher.decrypt: unsupported key or algorithm"},lt.crypto.Cipher.getAlgByKeyAndName=function(t,e){if(t instanceof rt){if(-1!=":RSA:RSAOAEP:RSAOAEP224:RSAOAEP256:RSAOAEP384:RSAOAEP512:".indexOf(e))return e;if(null==e)return"RSA";throw"getAlgByKeyAndName: not supported algorithm name for RSAKey: "+e}throw"getAlgByKeyAndName: not supported algorithm name: "+e},lt.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!==lt&<||(e.KJUR=lt={}),void 0!==lt.crypto&<.crypto||(lt.crypto={}),lt.crypto.ECDSA=function(t){var e=Error,i=S,n=st,r=lt.crypto.ECDSA,o=lt.crypto.ECParameterDB,s=r.getName,a=dt.getVbyListEx,c=dt.isASN1HEX,l=new et;this.type="EC",this.isPrivate=!1,this.isPublic=!1,this.getBigRandom=function(t){return new i(t.bitLength(),l).mod(t.subtract(i.ONE)).add(i.ONE)},this.setNamedCurve=function(t){this.ecparams=o.getByName(t),this.prvKeyHex=null,this.pubKeyHex=null,this.curveName=t},this.setPrivateKeyHex=function(t){this.isPrivate=!0,this.prvKeyHex=t},this.setPublicKeyHex=function(t){this.isPublic=!0,this.pubKeyHex=t},this.getPublicKeyXYHex=function(){var t=this.pubKeyHex;if("04"!==t.substr(0,2))throw"this method supports uncompressed format(04) only";var e=this.ecparams.keylen/4;if(t.length!==2+2*e)throw"malformed public key hex length";var i={};return i.x=t.substr(2,e),i.y=t.substr(2+e),i},this.getShortNISTPCurveName=function(){var t=this.curveName;return"secp256r1"===t||"NIST P-256"===t||"P-256"===t||"prime256v1"===t?"P-256":"secp384r1"===t||"NIST P-384"===t||"P-384"===t?"P-384":null},this.generateKeyPairHex=function(){var t=this.getBigRandom(this.ecparams.n),e=this.ecparams.G.multiply(t),i=e.getX().toBigInteger(),n=e.getY().toBigInteger(),r=this.ecparams.keylen/4,o=("0000000000"+t.toString(16)).slice(-r),s="04"+("0000000000"+i.toString(16)).slice(-r)+("0000000000"+n.toString(16)).slice(-r);return this.setPrivateKeyHex(o),this.setPublicKeyHex(s),{ecprvhex:o,ecpubhex:s}},this.signWithMessageHash=function(t){return this.signHex(t,this.prvKeyHex)},this.signHex=function(t,e){var n=new i(e,16),o=this.ecparams.n,s=new i(t.substring(0,this.ecparams.keylen/4),16);do{var a=this.getBigRandom(o),c=this.ecparams.G.multiply(a).getX().toBigInteger().mod(o)}while(c.compareTo(i.ZERO)<=0);var l=a.modInverse(o).multiply(s.add(n.multiply(c))).mod(o);return r.biRSSigToASN1Sig(c,l)},this.sign=function(t,e){var n=e,r=this.ecparams.n,o=i.fromByteArrayUnsigned(t);do{var s=this.getBigRandom(r),a=this.ecparams.G.multiply(s).getX().toBigInteger().mod(r)}while(a.compareTo(S.ZERO)<=0);var c=s.modInverse(r).multiply(o.add(n.multiply(a))).mod(r);return this.serializeSig(a,c)},this.verifyWithMessageHash=function(t,e){return this.verifyHex(t,e,this.pubKeyHex)},this.verifyHex=function(t,e,o){try{var s,a,c=r.parseSigHex(e);s=c.r,a=c.s;var l=n.decodeFromHex(this.ecparams.curve,o),u=new i(t.substring(0,this.ecparams.keylen/4),16);return this.verifyRaw(u,s,a,l)}catch(t){return!1}},this.verify=function(t,e,r){var o,s,a;if(Bitcoin.Util.isArray(e)){var c=this.parseSig(e);o=c.r,s=c.s}else{if("object"!==(void 0===e?"undefined":m(e))||!e.r||!e.s)throw"Invalid value for signature";o=e.r,s=e.s}if(r instanceof st)a=r;else{if(!Bitcoin.Util.isArray(r))throw"Invalid format for pubkey value, must be byte array or ECPointFp";a=n.decodeFrom(this.ecparams.curve,r)}var l=i.fromByteArrayUnsigned(t);return this.verifyRaw(l,o,s,a)},this.verifyRaw=function(t,e,n,r){var o=this.ecparams.n,s=this.ecparams.G;if(e.compareTo(i.ONE)<0||e.compareTo(o)>=0)return!1;if(n.compareTo(i.ONE)<0||n.compareTo(o)>=0)return!1;var a=n.modInverse(o),c=t.multiply(a).mod(o),l=e.multiply(a).mod(o);return s.multiply(c).add(r.multiply(l)).getX().toBigInteger().mod(o).equals(e)},this.serializeSig=function(t,e){var i=t.toByteArraySigned(),n=e.toByteArraySigned(),r=[];return r.push(2),r.push(i.length),(r=r.concat(i)).push(2),r.push(n.length),(r=r.concat(n)).unshift(r.length),r.unshift(48),r},this.parseSig=function(t){var e;if(48!=t[0])throw new Error("Signature not a valid DERSequence");if(2!=t[e=2])throw new Error("First element in signature must be a DERInteger");var n=t.slice(e+2,e+2+t[e+1]);if(2!=t[e+=2+t[e+1]])throw new Error("Second element in signature must be a DERInteger");var r=t.slice(e+2,e+2+t[e+1]);return e+=2+t[e+1],{r:i.fromByteArrayUnsigned(n),s:i.fromByteArrayUnsigned(r)}},this.parseSigCompact=function(t){if(65!==t.length)throw"Signature has the wrong length";var e=t[0]-27;if(e<0||e>7)throw"Invalid signature type";var n=this.ecparams.n;return{r:i.fromByteArrayUnsigned(t.slice(1,33)).mod(n),s:i.fromByteArrayUnsigned(t.slice(33,65)).mod(n),i:e}},this.readPKCS5PrvKeyHex=function(t){if(!1===c(t))throw new Error("not ASN.1 hex string");var e,i,n;try{e=a(t,0,["[0]",0],"06"),i=a(t,0,[1],"04");try{n=a(t,0,["[1]",0],"03")}catch(t){}}catch(t){throw new Error("malformed PKCS#1/5 plain ECC private key")}if(this.curveName=s(e),void 0===this.curveName)throw"unsupported curve name";this.setNamedCurve(this.curveName),this.setPublicKeyHex(n),this.setPrivateKeyHex(i),this.isPublic=!1},this.readPKCS8PrvKeyHex=function(t){if(!1===c(t))throw new e("not ASN.1 hex string");var i,n,r;try{a(t,0,[1,0],"06"),i=a(t,0,[1,1],"06"),n=a(t,0,[2,0,1],"04");try{r=a(t,0,[2,0,"[1]",0],"03")}catch(t){}}catch(t){throw new e("malformed PKCS#8 plain ECC private key")}if(this.curveName=s(i),void 0===this.curveName)throw new e("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(r),this.setPrivateKeyHex(n),this.isPublic=!1},this.readPKCS8PubKeyHex=function(t){if(!1===c(t))throw new e("not ASN.1 hex string");var i,n;try{a(t,0,[0,0],"06"),i=a(t,0,[0,1],"06"),n=a(t,0,[1],"03")}catch(t){throw new e("malformed PKCS#8 ECC public key")}if(this.curveName=s(i),null===this.curveName)throw new e("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(n)},this.readCertPubKeyHex=function(t){if(!1===c(t))throw new e("not ASN.1 hex string");var i,n;try{i=a(t,0,[0,5,0,1],"06"),n=a(t,0,[0,5,1],"03")}catch(t){throw new e("malformed X.509 certificate ECC public key")}if(this.curveName=s(i),null===this.curveName)throw new e("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(n)},void 0!==t&&void 0!==t.curve&&(this.curveName=t.curve),void 0===this.curveName&&(this.curveName="secp256r1"),this.setNamedCurve(this.curveName),void 0!==t&&(void 0!==t.prv&&this.setPrivateKeyHex(t.prv),void 0!==t.pub&&this.setPublicKeyHex(t.pub))},lt.crypto.ECDSA.parseSigHex=function(t){var e=lt.crypto.ECDSA.parseSigHexInHexRS(t);return{r:new S(e.r,16),s:new S(e.s,16)}},lt.crypto.ECDSA.parseSigHexInHexRS=function(t){var e=dt.getChildIdx,i=dt.getV;if(dt.checkStrictDER(t,0),"30"!=t.substr(0,2))throw new Error("signature is not a ASN.1 sequence");var n=e(t,0);if(2!=n.length)throw new Error("signature shall have two elements");var r=n[0],o=n[1];if("02"!=t.substr(r,2))throw new Error("1st item not ASN.1 integer");if("02"!=t.substr(o,2))throw new Error("2nd item not ASN.1 integer");return{r:i(t,r),s:i(t,o)}},lt.crypto.ECDSA.asn1SigToConcatSig=function(t){var e=lt.crypto.ECDSA.parseSigHexInHexRS(t),i=e.r,n=e.s;if("00"==i.substr(0,2)&&i.length%32==2&&(i=i.substr(2)),"00"==n.substr(0,2)&&n.length%32==2&&(n=n.substr(2)),i.length%32==30&&(i="00"+i),n.length%32==30&&(n="00"+n),i.length%32!=0)throw"unknown ECDSA sig r length error";if(n.length%32!=0)throw"unknown ECDSA sig s length error";return i+n},lt.crypto.ECDSA.concatSigToASN1Sig=function(t){if(t.length/2*8%128!=0)throw"unknown ECDSA concatinated r-s sig length error";var e=t.substr(0,t.length/2),i=t.substr(t.length/2);return lt.crypto.ECDSA.hexRSSigToASN1Sig(e,i)},lt.crypto.ECDSA.hexRSSigToASN1Sig=function(t,e){var i=new S(t,16),n=new S(e,16);return lt.crypto.ECDSA.biRSSigToASN1Sig(i,n)},lt.crypto.ECDSA.biRSSigToASN1Sig=function(t,e){var i=lt.asn1,n=new i.DERInteger({bigint:t}),r=new i.DERInteger({bigint:e});return new i.DERSequence({array:[n,r]}).getEncodedHex()},lt.crypto.ECDSA.getName=function(t){return"2b8104001f"===t?"secp192k1":"2a8648ce3d030107"===t?"secp256r1":"2b8104000a"===t?"secp256k1":"2b81040021"===t?"secp224r1":"2b81040022"===t?"secp384r1":-1!=="|secp256r1|NIST P-256|P-256|prime256v1|".indexOf(t)?"secp256r1":-1!=="|secp256k1|".indexOf(t)?"secp256k1":-1!=="|secp224r1|NIST P-224|P-224|".indexOf(t)?"secp224r1":-1!=="|secp384r1|NIST P-384|P-384|".indexOf(t)?"secp384r1":null},void 0!==lt&<||(e.KJUR=lt={}),void 0!==lt.crypto&<.crypto||(lt.crypto={}),lt.crypto.ECParameterDB=new function(){var t={},e={};function i(t){return new S(t,16)}this.getByName=function(i){var n=i;if(void 0!==e[n]&&(n=e[i]),void 0!==t[n])return t[n];throw"unregistered EC curve name: "+n},this.regist=function(n,r,o,s,a,c,l,u,h,d,f,p){t[n]={};var v=i(o),g=i(s),m=i(a),w=i(c),b=i(l),y=new at(v,g,m),x=y.decodePointHex("04"+u+h);t[n].name=n,t[n].keylen=r,t[n].curve=y,t[n].G=x,t[n].n=w,t[n].h=b,t[n].oid=f,t[n].info=p;for(var k=0;k<d.length;k++)e[d[k]]=n}},lt.crypto.ECParameterDB.regist("secp128r1",128,"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC","E87579C11079F43DD824993C2CEE5ED3","FFFFFFFE0000000075A30D1B9038A115","1","161FF7528B899B2D0C28607CA52C5B86","CF5AC8395BAFEB13C02DA292DDED7A83",[],"","secp128r1 : SECG curve over a 128 bit prime field"),lt.crypto.ECParameterDB.regist("secp160k1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73","0","7","0100000000000000000001B8FA16DFAB9ACA16B6B3","1","3B4C382CE37AA192A4019E763036F4F5DD4D7EBB","938CF935318FDCED6BC28286531733C3F03C4FEE",[],"","secp160k1 : SECG curve over a 160 bit prime field"),lt.crypto.ECParameterDB.regist("secp160r1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC","1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45","0100000000000000000001F4C8F927AED3CA752257","1","4A96B5688EF573284664698968C38BB913CBFC82","23A628553168947D59DCC912042351377AC5FB32",[],"","secp160r1 : SECG curve over a 160 bit prime field"),lt.crypto.ECParameterDB.regist("secp192k1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37","0","3","FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D","1","DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D","9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D",[]),lt.crypto.ECParameterDB.regist("secp192r1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC","64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1","FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831","1","188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012","07192B95FFC8DA78631011ED6B24CDD573F977A11E794811",[]),lt.crypto.ECParameterDB.regist("secp224r1",224,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE","B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4","FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D","1","B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21","BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34",[]),lt.crypto.ECParameterDB.regist("secp256k1",256,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F","0","7","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","1","79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798","483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8",[]),lt.crypto.ECParameterDB.regist("secp256r1",256,"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC","5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B","FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551","1","6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296","4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",["NIST P-256","P-256","prime256v1"]),lt.crypto.ECParameterDB.regist("secp384r1",384,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC","B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973","1","AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7","3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f",["NIST P-384","P-384"]),lt.crypto.ECParameterDB.regist("secp521r1",521,"1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC","051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409","1","C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66","011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650",["NIST P-521","P-521"]);var zt=function(){var t=function(t,i,n){return e(b.AES,t,i,n)},e=function(t,e,i,n){var r=b.enc.Hex.parse(e),o=b.enc.Hex.parse(i),s=b.enc.Hex.parse(n),a={};a.key=o,a.iv=s,a.ciphertext=r;var c=t.decrypt(a,o,{iv:s});return b.enc.Hex.stringify(c)},i=function(t,e,i){return n(b.AES,t,e,i)},n=function(t,e,i,n){var r=b.enc.Hex.parse(e),o=b.enc.Hex.parse(i),s=b.enc.Hex.parse(n),a=t.encrypt(r,o,{iv:s}),c=b.enc.Hex.parse(a.toString());return b.enc.Base64.stringify(c)},r={"AES-256-CBC":{proc:t,eproc:i,keylen:32,ivlen:16},"AES-192-CBC":{proc:t,eproc:i,keylen:24,ivlen:16},"AES-128-CBC":{proc:t,eproc:i,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:function(t,i,n){return e(b.TripleDES,t,i,n)},eproc:function(t,e,i){return n(b.TripleDES,t,e,i)},keylen:24,ivlen:8},"DES-CBC":{proc:function(t,i,n){return e(b.DES,t,i,n)},eproc:function(t,e,i){return n(b.DES,t,e,i)},keylen:8,ivlen:8}},o=function(t){var e={},i=t.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));i&&(e.cipher=i[1],e.ivsalt=i[2]);var n=t.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));n&&(e.type=n[1]);var r=-1,o=0;-1!=t.indexOf("\r\n\r\n")&&(r=t.indexOf("\r\n\r\n"),o=2),-1!=t.indexOf("\n\n")&&(r=t.indexOf("\n\n"),o=1);var s=t.indexOf("-----END");if(-1!=r&&-1!=s){var a=t.substring(r+2*o,s-o);a=a.replace(/\s+/g,""),e.data=a}return e},s=function(t,e,i){for(var n=i.substring(0,16),o=b.enc.Hex.parse(n),s=b.enc.Utf8.parse(e),a=r[t].keylen+r[t].ivlen,c="",l=null;;){var u=b.algo.MD5.create();if(null!=l&&u.update(l),u.update(s),u.update(o),l=u.finalize(),(c+=b.enc.Hex.stringify(l)).length>=2*a)break}var h={};return h.keyhex=c.substr(0,2*r[t].keylen),h.ivhex=c.substr(2*r[t].keylen,2*r[t].ivlen),h},a=function(t,e,i,n){var o=b.enc.Base64.parse(t),s=b.enc.Hex.stringify(o);return(0,r[e].proc)(s,i,n)};return{version:"1.0.0",parsePKCS5PEM:function(t){return o(t)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(t,e,i){return s(t,e,i)},decryptKeyB64:function(t,e,i,n){return a(t,e,i,n)},getDecryptedKeyHex:function(t,e){var i=o(t),n=i.cipher,r=i.ivsalt,c=i.data,l=s(n,e,r).keyhex;return a(c,n,l,r)},getEncryptedPKCS5PEMFromPrvKeyHex:function(t,e,i,n,o){var a,c,l="";if(void 0!==n&&null!=n||(n="AES-256-CBC"),void 0===r[n])throw new Error("KEYUTIL unsupported algorithm: "+n);void 0!==o&&null!=o||(o=(a=r[n].ivlen,c=b.lib.WordArray.random(a),b.enc.Hex.stringify(c)).toUpperCase());var u=function(t,e,i,n){return(0,r[e].eproc)(t,i,n)}(e,n,s(n,i,o).keyhex,o);return l="-----BEGIN "+t+" PRIVATE KEY-----\r\n",l+="Proc-Type: 4,ENCRYPTED\r\n",l+="DEK-Info: "+n+","+o+"\r\n",l+="\r\n",(l+=u.replace(/(.{64})/g,"$1\r\n"))+"\r\n-----END "+t+" PRIVATE KEY-----\r\n"},parseHexOfEncryptedPKCS8:function(t){var e=dt.getChildIdx,i=dt.getV,n={},r=e(t,0);if(2!=r.length)throw new Error("malformed format: SEQUENCE(0).items != 2: "+r.length);n.ciphertext=i(t,r[1]);var o=e(t,r[0]);if(2!=o.length)throw new Error("malformed format: SEQUENCE(0.0).items != 2: "+o.length);if("2a864886f70d01050d"!=i(t,o[0]))throw new Error("this only supports pkcs5PBES2");var s=e(t,o[1]);if(2!=o.length)throw new Error("malformed format: SEQUENCE(0.0.1).items != 2: "+s.length);var a=e(t,s[1]);if(2!=a.length)throw new Error("malformed format: SEQUENCE(0.0.1.1).items != 2: "+a.length);if("2a864886f70d0307"!=i(t,a[0]))throw"this only supports TripleDES";n.encryptionSchemeAlg="TripleDES",n.encryptionSchemeIV=i(t,a[1]);var c=e(t,s[0]);if(2!=c.length)throw new Error("malformed format: SEQUENCE(0.0.1.0).items != 2: "+c.length);if("2a864886f70d01050c"!=i(t,c[0]))throw new Error("this only supports pkcs5PBKDF2");var l=e(t,c[1]);if(l.length<2)throw new Error("malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+l.length);n.pbkdf2Salt=i(t,l[0]);var u=i(t,l[1]);try{n.pbkdf2Iter=parseInt(u,16)}catch(t){throw new Error("malformed format pbkdf2Iter: "+u)}return n},getPBKDF2KeyHexFromParam:function(t,e){var i=b.enc.Hex.parse(t.pbkdf2Salt),n=b.PBKDF2(e,i,{keySize:6,iterations:t.pbkdf2Iter});return b.enc.Hex.stringify(n)},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(t,e){var i=Ct(t,"ENCRYPTED PRIVATE KEY"),n=this.parseHexOfEncryptedPKCS8(i),r=zt.getPBKDF2KeyHexFromParam(n,e),o={};o.ciphertext=b.enc.Hex.parse(n.ciphertext);var s=b.enc.Hex.parse(r),a=b.enc.Hex.parse(n.encryptionSchemeIV),c=b.TripleDES.decrypt(o,s,{iv:a});return b.enc.Hex.stringify(c)},getKeyFromEncryptedPKCS8PEM:function(t,e){var i=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(t,e);return this.getKeyFromPlainPrivatePKCS8Hex(i)},parsePlainPrivatePKCS8Hex:function(t){var e=dt,i=e.getChildIdx,n=e.getV,r={algparam:null};if("30"!=t.substr(0,2))throw new Error("malformed plain PKCS8 private key(code:001)");var o=i(t,0);if(o.length<3)throw new Error("malformed plain PKCS8 private key(code:002)");if("30"!=t.substr(o[1],2))throw new Error("malformed PKCS8 private key(code:003)");var s=i(t,o[1]);if(2!=s.length)throw new Error("malformed PKCS8 private key(code:004)");if("06"!=t.substr(s[0],2))throw new Error("malformed PKCS8 private key(code:005)");if(r.algoid=n(t,s[0]),"06"==t.substr(s[1],2)&&(r.algparam=n(t,s[1])),"04"!=t.substr(o[2],2))throw new Error("malformed PKCS8 private key(code:006)");return r.keyidx=e.getVidx(t,o[2]),r},getKeyFromPlainPrivatePKCS8PEM:function(t){var e=Ct(t,"PRIVATE KEY");return this.getKeyFromPlainPrivatePKCS8Hex(e)},getKeyFromPlainPrivatePKCS8Hex:function(t){var e,i=this.parsePlainPrivatePKCS8Hex(t);if("2a864886f70d010101"==i.algoid)e=new rt;else if("2a8648ce380401"==i.algoid)e=new lt.crypto.DSA;else{if("2a8648ce3d0201"!=i.algoid)throw new Error("unsupported private key algorithm");e=new lt.crypto.ECDSA}return e.readPKCS8PrvKeyHex(t),e},_getKeyFromPublicPKCS8Hex:function(t){var e,i=dt.getVbyList(t,0,[0,0],"06");if("2a864886f70d010101"===i)e=new rt;else if("2a8648ce380401"===i)e=new lt.crypto.DSA;else{if("2a8648ce3d0201"!==i)throw new Error("unsupported PKCS#8 public key hex");e=new lt.crypto.ECDSA}return e.readPKCS8PubKeyHex(t),e},parsePublicRawRSAKeyHex:function(t){var e=dt.getChildIdx,i=dt.getV,n={};if("30"!=t.substr(0,2))throw new Error("malformed RSA key(code:001)");var r=e(t,0);if(2!=r.length)throw new Error("malformed RSA key(code:002)");if("02"!=t.substr(r[0],2))throw new Error("malformed RSA key(code:003)");if(n.n=i(t,r[0]),"02"!=t.substr(r[1],2))throw new Error("malformed RSA key(code:004)");return n.e=i(t,r[1]),n},parsePublicPKCS8Hex:function(t){var e=dt,i=e.getChildIdx,n=e.getV,r={algparam:null},o=i(t,0);if(2!=o.length)throw new Error("outer DERSequence shall have 2 elements: "+o.length);var s=o[0];if("30"!=t.substr(s,2))throw new Error("malformed PKCS8 public key(code:001)");var a=i(t,s);if(2!=a.length)throw new Error("malformed PKCS8 public key(code:002)");if("06"!=t.substr(a[0],2))throw new Error("malformed PKCS8 public key(code:003)");if(r.algoid=n(t,a[0]),"06"==t.substr(a[1],2)?r.algparam=n(t,a[1]):"30"==t.substr(a[1],2)&&(r.algparam={},r.algparam.p=e.getVbyList(t,a[1],[0],"02"),r.algparam.q=e.getVbyList(t,a[1],[1],"02"),r.algparam.g=e.getVbyList(t,a[1],[2],"02")),"03"!=t.substr(o[1],2))throw new Error("malformed PKCS8 public key(code:004)");return r.key=n(t,o[1]).substr(2),r}}}();function Ht(t,e){for(var i="",n=e/4-t.length,r=0;r<n;r++)i+="0";return i+t}function Kt(t,e,i){for(var n="",r=0;n.length<e;)n+=Et(i(St(t+String.fromCharCode.apply(String,[(4278190080&r)>>24,(16711680&r)>>16,(65280&r)>>8,255&r])))),r+=1;return n}function Wt(t){for(var e in lt.crypto.Util.DIGESTINFOHEAD){var i=lt.crypto.Util.DIGESTINFOHEAD[e],n=i.length;if(t.substring(0,n)==i)return[e,t.substring(n)]}return[]}function qt(t){var e,i=dt,n=i.getChildIdx,r=i.getV,o=i.getTLV,s=i.getVbyList,a=i.getVbyListEx,c=i.getTLVbyList,l=i.getTLVbyListEx,u=i.getIdxbyList,h=i.getIdxbyListEx,d=i.getVidx,f=i.getInt,p=i.oidname,v=i.hextooidstr,g=Ct;try{e=lt.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(t){}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 t=c(this.hex,0,[0,0]);if("a0"==t.substr(0,2)){var e=c(t,0,[0]),i=f(e,0);if(i<0||2<i)throw new Error("malformed version field");return this.version=i+1,this.version}return this.version=1,this.foffset=-1,1},this.getSerialNumberHex=function(){return a(this.hex,0,[0,0],"02")},this.getSignatureAlgorithmField=function(){var t=l(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(t)},this.getAlgorithmIdentifierName=function(t){for(var i in e)if(t===e[i])return i;return p(a(t,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 t=s(this.hex,0,[0,4+this.foffset,0]);return t=t.replace(/(..)/g,"%$1"),decodeURIComponent(t)},this.getNotAfter=function(){var t=s(this.hex,0,[0,4+this.foffset,1]);return t=t.replace(/(..)/g,"%$1"),decodeURIComponent(t)},this.getPublicKeyHex=function(){return i.getTLVbyList(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyIdx=function(){return u(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var t=this.getPublicKeyIdx();return u(this.hex,t,[1,0],"30")},this.getPublicKey=function(){return zt.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var t=c(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(t)},this.getSignatureValueHex=function(){return s(this.hex,0,[2],"03",!0)},this.verifySignature=function(t){var e=this.getSignatureAlgorithmField(),i=this.getSignatureValueHex(),n=c(this.hex,0,[0],"30"),r=new lt.crypto.Signature({alg:e});return r.init(t),r.updateHex(n),r.verify(i)},this.parseExt=function(t){var e,o,a;if(void 0===t){if(3!==this.version)return-1;e=u(a=this.hex,0,[0,7,0],"30"),o=n(a,e)}else{a=Ct(t);var c=u(a,0,[0,3,0,0],"06");if("2a864886f70d01090e"!=r(a,c))return void(this.aExtInfo=new Array);e=u(a,0,[0,3,0,1,0],"30"),o=n(a,e),this.hex=a}this.aExtInfo=new Array;for(var l=0;l<o.length;l++){var h={critical:!1},f=0;3===n(a,o[l]).length&&(h.critical=!0,f=1),h.oid=i.hextooidstr(s(a,o[l],[0],"06"));var p=u(a,o[l],[1+f]);h.vidx=d(a,p),this.aExtInfo.push(h)}},this.getExtInfo=function(t){var e=this.aExtInfo,i=t;if(t.match(/^[0-9.]+$/)||(i=lt.asn1.x509.OID.name2oid(t)),""!==i)for(var n=0;n<e.length;n++)if(e[n].oid===i)return e[n]},this.getExtBasicConstraints=function(t,e){if(void 0===t&&void 0===e){var i=this.getExtInfo("basicConstraints");if(void 0===i)return;t=o(this.hex,i.vidx),e=i.critical}var n={extname:"basicConstraints"};if(e&&(n.critical=!0),"3000"===t)return n;if("30030101ff"===t)return n.cA=!0,n;if("30060101ff02"===t.substr(0,12)){var s=r(t,10),a=parseInt(s,16);return n.cA=!0,n.pathLen=a,n}throw new Error("hExtV parse error: "+t)},this.getExtKeyUsage=function(t,e){if(void 0===t&&void 0===e){var i=this.getExtInfo("keyUsage");if(void 0===i)return;t=o(this.hex,i.vidx),e=i.critical}var n={extname:"keyUsage"};return e&&(n.critical=!0),n.names=this.getExtKeyUsageString(t).split(","),n},this.getExtKeyUsageBin=function(t){if(void 0===t){var e=this.getExtInfo("keyUsage");if(void 0===e)return"";t=o(this.hex,e.vidx)}if(8!=t.length&&10!=t.length)throw new Error("malformed key usage value: "+t);var i="000000000000000"+parseInt(t.substr(6),16).toString(2);return 8==t.length&&(i=i.slice(-8)),10==t.length&&(i=i.slice(-16)),""==(i=i.replace(/0+$/,""))&&(i="0"),i},this.getExtKeyUsageString=function(t){for(var e=this.getExtKeyUsageBin(t),i=new Array,n=0;n<e.length;n++)"1"==e.substr(n,1)&&i.push(qt.KEYUSAGE_NAME[n]);return i.join(",")},this.getExtSubjectKeyIdentifier=function(t,e){if(void 0===t&&void 0===e){var i=this.getExtInfo("subjectKeyIdentifier");if(void 0===i)return;t=o(this.hex,i.vidx),e=i.critical}var n={extname:"subjectKeyIdentifier"};e&&(n.critical=!0);var s=r(t,0);return n.kid={hex:s},n},this.getExtAuthorityKeyIdentifier=function(t,e){if(void 0===t&&void 0===e){var i=this.getExtInfo("authorityKeyIdentifier");if(void 0===i)return;t=o(this.hex,i.vidx),e=i.critical}var s={extname:"authorityKeyIdentifier"};e&&(s.critical=!0);for(var a=n(t,0),c=0;c<a.length;c++){var l=t.substr(a[c],2);if("80"===l&&(s.kid={hex:r(t,a[c])}),"a1"===l){var u=o(t,a[c]),h=this.getGeneralNames(u);s.issuer=h[0].dn}"82"===l&&(s.sn={hex:r(t,a[c])})}return s},this.getExtExtKeyUsage=function(t,e){if(void 0===t&&void 0===e){var i=this.getExtInfo("extKeyUsage");if(void 0===i)return;t=o(this.hex,i.vidx),e=i.critical}var s={extname:"extKeyUsage",array:[]};e&&(s.critical=!0);for(var a=n(t,0),c=0;c<a.length;c++)s.array.push(p(r(t,a[c])));return s},this.getExtExtKeyUsageName=function(){var t=this.getExtInfo("extKeyUsage");if(void 0===t)return t;var e=new Array,i=o(this.hex,t.vidx);if(""===i)return e;for(var s=n(i,0),a=0;a<s.length;a++)e.push(p(r(i,s[a])));return e},this.getExtSubjectAltName=function(t,e){if(void 0===t&&void 0===e){var i=this.getExtInfo("subjectAltName");if(void 0===i)return;t=o(this.hex,i.vidx),e=i.critical}var n={extname:"subjectAltName",array:[]};return e&&(n.critical=!0),n.array=this.getGeneralNames(t),n},this.getExtIssuerAltName=function(t,e){if(void 0===t&&void 0===e){var i=this.getExtInfo("issuerAltName");if(void 0===i)return;t=o(this.hex,i.vidx),e=i.critical}var n={extname:"issuerAltName",array:[]};return e&&(n.critical=!0),n.array=this.getGeneralNames(t),n},this.getGeneralNames=function(t){for(var e=n(t,0),i=[],r=0;r<e.length;r++){var s=this.getGeneralName(o(t,e[r]));void 0!==s&&i.push(s)}return i},this.getGeneralName=function(t){var e=t.substr(0,2),i=r(t,0),n=Et(i);return"81"==e?{rfc822:n}:"82"==e?{dns:n}:"86"==e?{uri:n}:"87"==e?{ip:Dt(i)}:"a4"==e?{dn:this.getX500Name(i)}:void 0},this.getExtSubjectAltName2=function(){var t,e,i,s=this.getExtInfo("subjectAltName");if(void 0===s)return s;for(var a=new Array,c=o(this.hex,s.vidx),l=n(c,0),u=0;u<l.length;u++)i=c.substr(l[u],2),t=r(c,l[u]),"81"===i&&(e=kt(t),a.push(["MAIL",e])),"82"===i&&(e=kt(t),a.push(["DNS",e])),"84"===i&&(e=qt.hex2dn(t,0),a.push(["DN",e])),"86"===i&&(e=kt(t),a.push(["URI",e])),"87"===i&&(e=Dt(t),a.push(["IP",e]));return a},this.getExtCRLDistributionPoints=function(t,e){if(void 0===t&&void 0===e){var i=this.getExtInfo("cRLDistributionPoints");if(void 0===i)return;t=o(this.hex,i.vidx),e=i.critical}var r={extname:"cRLDistributionPoints",array:[]};e&&(r.critical=!0);for(var s=n(t,0),a=0;a<s.length;a++){var c=o(t,s[a]);r.array.push(this.getDistributionPoint(c))}return r},this.getDistributionPoint=function(t){for(var e={},i=n(t,0),r=0;r<i.length;r++){var s=t.substr(i[r],2),a=o(t,i[r]);"a0"==s&&(e.dpname=this.getDistributionPointName(a))}return e},this.getDistributionPointName=function(t){for(var e={},i=n(t,0),r=0;r<i.length;r++){var s=t.substr(i[r],2),a=o(t,i[r]);"a0"==s&&(e.full=this.getGeneralNames(a))}return e},this.getExtCRLDistributionPointsURI=function(){var t=this.getExtInfo("cRLDistributionPoints");if(void 0===t)return t;for(var e=new Array,i=n(this.hex,t.vidx),r=0;r<i.length;r++)try{var o=kt(s(this.hex,i[r],[0,0,0],"86"));e.push(o)}catch(t){}return e},this.getExtAIAInfo=function(){var t=this.getExtInfo("authorityInfoAccess");if(void 0===t)return t;for(var e={ocsp:[],caissuer:[]},i=n(this.hex,t.vidx),r=0;r<i.length;r++){var o=s(this.hex,i[r],[0],"06"),a=s(this.hex,i[r],[1],"86");"2b06010505073001"===o&&e.ocsp.push(kt(a)),"2b06010505073002"===o&&e.caissuer.push(kt(a))}return e},this.getExtAuthorityInfoAccess=function(t,e){if(void 0===t&&void 0===e){var i=this.getExtInfo("authorityInfoAccess");if(void 0===i)return;t=o(this.hex,i.vidx),e=i.critical}var r={extname:"authorityInfoAccess",array:[]};e&&(r.critical=!0);for(var c=n(t,0),l=0;l<c.length;l++){var u=a(t,c[l],[0],"06"),h=kt(s(t,c[l],[1],"86"));if("2b06010505073001"==u)r.array.push({ocsp:h});else{if("2b06010505073002"!=u)throw new Error("unknown method: "+u);r.array.push({caissuer:h})}}return r},this.getExtCertificatePolicies=function(t,e){if(void 0===t&&void 0===e){var i=this.getExtInfo("certificatePolicies");if(void 0===i)return;t=o(this.hex,i.vidx),e=i.critical}var r={extname:"certificatePolicies",array:[]};e&&(r.critical=!0);for(var s=n(t,0),a=0;a<s.length;a++){var c=o(t,s[a]),l=this.getPolicyInformation(c);r.array.push(l)}return r},this.getPolicyInformation=function(t){var e={},i=s(t,0,[0],"06");e.policyoid=p(i);var r=h(t,0,[1],"30");if(-1!=r){e.array=[];for(var a=n(t,r),c=0;c<a.length;c++){var l=o(t,a[c]),u=this.getPolicyQualifierInfo(l);e.array.push(u)}}return e},this.getPolicyQualifierInfo=function(t){var e={},i=s(t,0,[0],"06");if("2b06010505070201"===i){var n=a(t,0,[1],"16");e.cps=Et(n)}else if("2b06010505070202"===i){var r=c(t,0,[1],"30");e.unotice=this.getUserNotice(r)}return e},this.getUserNotice=function(t){for(var e={},i=n(t,0),r=0;r<i.length;r++){var s=o(t,i[r]);"30"!=s.substr(0,2)&&(e.exptext=this.getDisplayText(s))}return e},this.getDisplayText=function(t){var e={};return e.type={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"}[t.substr(0,2)],e.str=Et(r(t,0)),e},this.getExtCRLNumber=function(t,e){var i={extname:"cRLNumber"};if(e&&(i.critical=!0),"02"==t.substr(0,2))return i.num={hex:r(t,0)},i;throw new Error("hExtV parse error: "+t)},this.getExtCRLReason=function(t,e){var i={extname:"cRLReason"};if(e&&(i.critical=!0),"0a"==t.substr(0,2))return i.code=parseInt(r(t,0),16),i;throw new Error("hExtV parse error: "+t)},this.getExtOcspNonce=function(t,e){var i={extname:"ocspNonce"};e&&(i.critical=!0);var n=r(t,0);return i.hex=n,i},this.getExtOcspNoCheck=function(t,e){var i={extname:"ocspNoCheck"};return e&&(i.critical=!0),i},this.getExtAdobeTimeStamp=function(t,e){if(void 0===t&&void 0===e){var i=this.getExtInfo("adobeTimeStamp");if(void 0===i)return;t=o(this.hex,i.vidx),e=i.critical}var r={extname:"adobeTimeStamp"};e&&(r.critical=!0);var s=n(t,0);if(s.length>1){var a=o(t,s[1]),c=this.getGeneralName(a);null!=c.uri&&(r.uri=c.uri)}if(s.length>2){var l=o(t,s[2]);"0101ff"==l&&(r.reqauth=!0),"010100"==l&&(r.reqauth=!1)}return r},this.getX500NameRule=function(t){for(var e=null,i=[],n=0;n<t.length;n++)for(var r=t[n],o=0;o<r.length;o++)i.push(r[o]);for(n=0;n<i.length;n++){var s=i[n],a=s.ds,c=s.type;if("prn"!=a&&"utf8"!=a&&"ia5"!=a)return"mixed";if("ia5"==a){if("CN"!=c)return"mixed";if(lt.lang.String.isMail(s.value))continue;return"mixed"}if("C"==c){if("prn"==a)continue;return"mixed"}if(null==e)e=a;else if(e!==a)return"mixed"}return null==e?"prn":e},this.getX500Name=function(t){var e=this.getX500NameArray(t);return{array:e,str:this.dnarraytostr(e)}},this.getX500NameArray=function(t){for(var e=[],i=n(t,0),r=0;r<i.length;r++)e.push(this.getRDN(o(t,i[r])));return e},this.getRDN=function(t){for(var e=[],i=n(t,0),r=0;r<i.length;r++)e.push(this.getAttrTypeAndValue(o(t,i[r])));return e},this.getAttrTypeAndValue=function(t){var e={type:null,value:null,ds:null},i=n(t,0),r=s(t,i[0],[],"06"),o=s(t,i[1],[]),a=lt.asn1.ASN1Util.oidHexToInt(r);return e.type=lt.asn1.x509.OID.oid2atype(a),e.ds=this.HEX2STAG[t.substr(i[1],2)],e.value="bmp"!=e.ds?kt(o):Mt(o),e},this.readCertPEM=function(t){this.readCertHex(g(t))},this.readCertHex=function(t){this.hex=t,this.getVersion();try{u(this.hex,0,[0,7],"a3"),this.parseExt()}catch(t){}},this.getParam=function(){var t={};return t.version=this.getVersion(),t.serial={hex:this.getSerialNumberHex()},t.sigalg=this.getSignatureAlgorithmField(),t.issuer=this.getIssuer(),t.notbefore=this.getNotBefore(),t.notafter=this.getNotAfter(),t.subject=this.getSubject(),t.sbjpubkey=jt(this.getPublicKeyHex(),"PUBLIC KEY"),this.aExtInfo.length>0&&(t.ext=this.getExtParamArray()),t.sighex=this.getSignatureValueHex(),t},this.getExtParamArray=function(t){null==t&&-1!=h(this.hex,0,[0,"[3]"])&&(t=l(this.hex,0,[0,"[3]",0],"30"));for(var e=[],i=n(t,0),r=0;r<i.length;r++){var s=o(t,i[r]),a=this.getExtParam(s);null!=a&&e.push(a)}return e},this.getExtParam=function(t){var e=n(t,0).length;if(2!=e&&3!=e)throw new Error("wrong number elements in Extension: "+e+" "+t);var i=v(s(t,0,[0],"06")),r=!1;3==e&&"0101ff"==c(t,0,[1])&&(r=!0);var o=c(t,0,[e-1,0]),a=void 0;if("2.5.29.14"==i?a=this.getExtSubjectKeyIdentifier(o,r):"2.5.29.15"==i?a=this.getExtKeyUsage(o,r):"2.5.29.17"==i?a=this.getExtSubjectAltName(o,r):"2.5.29.18"==i?a=this.getExtIssuerAltName(o,r):"2.5.29.19"==i?a=this.getExtBasicConstraints(o,r):"2.5.29.31"==i?a=this.getExtCRLDistributionPoints(o,r):"2.5.29.32"==i?a=this.getExtCertificatePolicies(o,r):"2.5.29.35"==i?a=this.getExtAuthorityKeyIdentifier(o,r):"2.5.29.37"==i?a=this.getExtExtKeyUsage(o,r):"1.3.6.1.5.5.7.1.1"==i?a=this.getExtAuthorityInfoAccess(o,r):"2.5.29.20"==i?a=this.getExtCRLNumber(o,r):"2.5.29.21"==i?a=this.getExtCRLReason(o,r):"1.3.6.1.5.5.7.48.1.2"==i?a=this.getExtOcspNonce(o,r):"1.3.6.1.5.5.7.48.1.5"==i?a=this.getExtOcspNoCheck(o,r):"1.2.840.113583.1.1.9.1"==i&&(a=this.getExtAdobeTimeStamp(o,r)),null!=a)return a;var l={extname:i,extn:o};return r&&(l.critical=!0),l},this.findExt=function(t,e){for(var i=0;i<t.length;i++)if(t[i].extname==e)return t[i];return null},this.updateExtCDPFullURI=function(t,e){var i=this.findExt(t,"cRLDistributionPoints");if(null!=i&&null!=i.array)for(var n=i.array,r=0;r<n.length;r++)if(null!=n[r].dpname&&null!=n[r].dpname.full)for(var o=n[r].dpname.full,s=0;s<o.length;s++){var a=o[r];null!=a.uri&&(a.uri=e)}},this.updateExtAIAOCSP=function(t,e){var i=this.findExt(t,"authorityInfoAccess");if(null!=i&&null!=i.array)for(var n=i.array,r=0;r<n.length;r++)null!=n[r].ocsp&&(n[r].ocsp=e)},this.updateExtAIACAIssuer=function(t,e){var i=this.findExt(t,"authorityInfoAccess");if(null!=i&&null!=i.array)for(var n=i.array,r=0;r<n.length;r++)null!=n[r].caissuer&&(n[r].caissuer=e)},this.dnarraytostr=function(t){return"/"+t.map((function(t){return(e=t,e.map((function(t){return(e=t,e.type+"="+e.value).replace(/\+/,"\\+");var e})).join("+")).replace(/\//,"\\/");var e})).join("/")},this.getInfo=function(){var t,e,i,n,r=function(t){for(var e="",i=t.array,n=0;n<i.length;n++){var r=i[n];if(e+=" policy oid: "+r.policyoid+"\n",void 0!==r.array)for(var o=0;o<r.array.length;o++){var s=r.array[o];void 0!==s.cps&&(e+=" cps: "+s.cps+"\n")}}return e},o=function(t){for(var e="",i=t.array,n=0;n<i.length;n++){var r=i[n];try{void 0!==r.dpname.full[0].uri&&(e+=" "+r.dpname.full[0].uri+"\n")}catch(t){}try{void 0!==r.dname.full[0].dn.hex&&(e+=" "+qt.hex2dn(r.dpname.full[0].dn.hex)+"\n")}catch(t){}}return e},s=function(t){for(var e="",i=t.array,n=0;n<i.length;n++){var r=i[n];void 0!==r.caissuer&&(e+=" caissuer: "+r.caissuer+"\n"),void 0!==r.ocsp&&(e+=" ocsp: "+r.ocsp+"\n")}return e};if(t="Basic Fields\n",t+=" serial number: "+this.getSerialNumberHex()+"\n",t+=" signature algorithm: "+this.getSignatureAlgorithmField()+"\n",t+=" issuer: "+this.getIssuerString()+"\n",t+=" notBefore: "+this.getNotBefore()+"\n",t+=" notAfter: "+this.getNotAfter()+"\n",t+=" subject: "+this.getSubjectString()+"\n",t+=" subject public key info: \n",t+=" key algorithm: "+(e=this.getPublicKey()).type+"\n","RSA"===e.type&&(t+=" n="+Bt(e.n.toString(16)).substr(0,16)+"...\n",t+=" e="+Bt(e.e.toString(16))+"\n"),null!=(i=this.aExtInfo)){t+="X509v3 Extensions:\n";for(var a=0;a<i.length;a++){var c=i[a],l=lt.asn1.x509.OID.oid2name(c.oid);""===l&&(l=c.oid);var u="";if(!0===c.critical&&(u="CRITICAL"),t+=" "+l+" "+u+":\n","basicConstraints"===l){var h=this.getExtBasicConstraints();void 0===h.cA?t+=" {}\n":(t+=" cA=true",void 0!==h.pathLen&&(t+=", pathLen="+h.pathLen),t+="\n")}else if("keyUsage"===l)t+=" "+this.getExtKeyUsageString()+"\n";else if("subjectKeyIdentifier"===l)t+=" "+this.getExtSubjectKeyIdentifier().kid.hex+"\n";else if("authorityKeyIdentifier"===l){var d=this.getExtAuthorityKeyIdentifier();void 0!==d.kid&&(t+=" kid="+d.kid.hex+"\n")}else"extKeyUsage"===l?t+=" "+this.getExtExtKeyUsage().array.join(", ")+"\n":"subjectAltName"===l?t+=" "+(n=this.getExtSubjectAltName(),JSON.stringify(n.array).replace(/[\[\]\{\}\"]/g,"")+"\n"):"cRLDistributionPoints"===l?t+=o(this.getExtCRLDistributionPoints()):"authorityInfoAccess"===l?t+=s(this.getExtAuthorityInfoAccess()):"certificatePolicies"===l&&(t+=r(this.getExtCertificatePolicies()))}}return(t+="signature algorithm: "+this.getSignatureAlgorithmName()+"\n")+"signature: "+this.getSignatureValueHex().substr(0,16)+"...\n"},"string"==typeof t&&(-1!=t.indexOf("-----BEGIN")?this.readCertPEM(t):lt.lang.String.isHex(t)&&this.readCertHex(t))}zt.getKey=function(t,e,i){var n,r=(m=dt).getChildIdx,o=m.getVbyList,s=lt.crypto,a=s.ECDSA,c=s.DSA,l=rt,u=Ct,h=zt;if(void 0!==l&&t instanceof l)return t;if(void 0!==a&&t instanceof a)return t;if(void 0!==c&&t instanceof c)return t;if(void 0!==t.curve&&void 0!==t.xy&&void 0===t.d)return new a({pub:t.xy,curve:t.curve});if(void 0!==t.curve&&void 0!==t.d)return new a({prv:t.d,curve:t.curve});if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0===t.d)return(C=new l).setPublic(t.n,t.e),C;if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0!==t.p&&void 0!==t.q&&void 0!==t.dp&&void 0!==t.dq&&void 0!==t.co&&void 0===t.qi)return(C=new l).setPrivateEx(t.n,t.e,t.d,t.p,t.q,t.dp,t.dq,t.co),C;if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0===t.p)return(C=new l).setPrivate(t.n,t.e,t.d),C;if(void 0!==t.p&&void 0!==t.q&&void 0!==t.g&&void 0!==t.y&&void 0===t.x)return(C=new c).setPublic(t.p,t.q,t.g,t.y),C;if(void 0!==t.p&&void 0!==t.q&&void 0!==t.g&&void 0!==t.y&&void 0!==t.x)return(C=new c).setPrivate(t.p,t.q,t.g,t.y,t.x),C;if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0===t.d)return(C=new l).setPublic(yt(t.n),yt(t.e)),C;if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0!==t.p&&void 0!==t.q&&void 0!==t.dp&&void 0!==t.dq&&void 0!==t.qi)return(C=new l).setPrivateEx(yt(t.n),yt(t.e),yt(t.d),yt(t.p),yt(t.q),yt(t.dp),yt(t.dq),yt(t.qi)),C;if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d)return(C=new l).setPrivate(yt(t.n),yt(t.e),yt(t.d)),C;if("EC"===t.kty&&void 0!==t.crv&&void 0!==t.x&&void 0!==t.y&&void 0===t.d){var d=(j=new a({curve:t.crv})).ecparams.keylen/4,f="04"+("0000000000"+yt(t.x)).slice(-d)+("0000000000"+yt(t.y)).slice(-d);return j.setPublicKeyHex(f),j}if("EC"===t.kty&&void 0!==t.crv&&void 0!==t.x&&void 0!==t.y&&void 0!==t.d){d=(j=new a({curve:t.crv})).ecparams.keylen/4,f="04"+("0000000000"+yt(t.x)).slice(-d)+("0000000000"+yt(t.y)).slice(-d);var p=("0000000000"+yt(t.d)).slice(-d);return j.setPublicKeyHex(f),j.setPrivateKeyHex(p),j}if("pkcs5prv"===i){var v,g=t,m=dt;if(9===(v=r(g,0)).length)(C=new l).readPKCS5PrvKeyHex(g);else if(6===v.length)(C=new c).readPKCS5PrvKeyHex(g);else{if(!(v.length>2&&"04"===g.substr(v[1],2)))throw new Error("unsupported PKCS#1/5 hexadecimal key");(C=new a).readPKCS5PrvKeyHex(g)}return C}if("pkcs8prv"===i)return h.getKeyFromPlainPrivatePKCS8Hex(t);if("pkcs8pub"===i)return h._getKeyFromPublicPKCS8Hex(t);if("x509pub"===i)return qt.getPublicKeyFromCertHex(t);if(-1!=t.indexOf("-END CERTIFICATE-",0)||-1!=t.indexOf("-END X509 CERTIFICATE-",0)||-1!=t.indexOf("-END TRUSTED CERTIFICATE-",0))return qt.getPublicKeyFromCertPEM(t);if(-1!=t.indexOf("-END PUBLIC KEY-")){var w=Ct(t,"PUBLIC KEY");return h._getKeyFromPublicPKCS8Hex(w)}if(-1!=t.indexOf("-END RSA PRIVATE KEY-")&&-1==t.indexOf("4,ENCRYPTED")){var b=u(t,"RSA PRIVATE KEY");return h.getKey(b,null,"pkcs5prv")}if(-1!=t.indexOf("-END DSA PRIVATE KEY-")&&-1==t.indexOf("4,ENCRYPTED")){var y=o(n=u(t,"DSA PRIVATE KEY"),0,[1],"02"),x=o(n,0,[2],"02"),k=o(n,0,[3],"02"),E=o(n,0,[4],"02"),F=o(n,0,[5],"02");return(C=new c).setPrivate(new S(y,16),new S(x,16),new S(k,16),new S(E,16),new S(F,16)),C}if(-1!=t.indexOf("-END EC PRIVATE KEY-")&&-1==t.indexOf("4,ENCRYPTED"))return b=u(t,"EC PRIVATE KEY"),h.getKey(b,null,"pkcs5prv");if(-1!=t.indexOf("-END PRIVATE KEY-"))return h.getKeyFromPlainPrivatePKCS8PEM(t);if(-1!=t.indexOf("-END RSA PRIVATE KEY-")&&-1!=t.indexOf("4,ENCRYPTED")){var A=h.getDecryptedKeyHex(t,e),_=new rt;return _.readPKCS5PrvKeyHex(A),_}if(-1!=t.indexOf("-END EC PRIVATE KEY-")&&-1!=t.indexOf("4,ENCRYPTED")){var j,C=o(n=h.getDecryptedKeyHex(t,e),0,[1],"04"),R=o(n,0,[2,0],"06"),I=o(n,0,[3,0],"03").substr(2);if(void 0===lt.crypto.OID.oidhex2name[R])throw new Error("undefined OID(hex) in KJUR.crypto.OID: "+R);return(j=new a({curve:lt.crypto.OID.oidhex2name[R]})).setPublicKeyHex(I),j.setPrivateKeyHex(C),j.isPublic=!1,j}if(-1!=t.indexOf("-END DSA PRIVATE KEY-")&&-1!=t.indexOf("4,ENCRYPTED"))return y=o(n=h.getDecryptedKeyHex(t,e),0,[1],"02"),x=o(n,0,[2],"02"),k=o(n,0,[3],"02"),E=o(n,0,[4],"02"),F=o(n,0,[5],"02"),(C=new c).setPrivate(new S(y,16),new S(x,16),new S(k,16),new S(E,16),new S(F,16)),C;if(-1!=t.indexOf("-END ENCRYPTED PRIVATE KEY-"))return h.getKeyFromEncryptedPKCS8PEM(t,e);throw new Error("not supported argument")},zt.generateKeypair=function(t,e){if("RSA"==t){var i=e;(s=new rt).generate(i,"10001"),s.isPrivate=!0,s.isPublic=!0;var n=new rt,r=s.n.toString(16),o=s.e.toString(16);return n.setPublic(r,o),n.isPrivate=!1,n.isPublic=!0,(a={}).prvKeyObj=s,a.pubKeyObj=n,a}if("EC"==t){var s,a,c=e,l=new lt.crypto.ECDSA({curve:c}).generateKeyPairHex();return(s=new lt.crypto.ECDSA({curve:c})).setPublicKeyHex(l.ecpubhex),s.setPrivateKeyHex(l.ecprvhex),s.isPrivate=!0,s.isPublic=!1,(n=new lt.crypto.ECDSA({curve:c})).setPublicKeyHex(l.ecpubhex),n.isPrivate=!1,n.isPublic=!0,(a={}).prvKeyObj=s,a.pubKeyObj=n,a}throw new Error("unknown algorithm: "+t)},zt.getPEM=function(t,e,i,n,r,o){var s=lt.asn1,a=s.DERObjectIdentifier,c=s.DERInteger,l=s.ASN1Util.newObject,u=lt.crypto,h=u.DSA,d=u.ECDSA,f=rt;function p(t){return l({seq:[{int:0},{int:{bigint:t.n}},{int:t.e},{int:{bigint:t.d}},{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.dmp1}},{int:{bigint:t.dmq1}},{int:{bigint:t.coeff}}]})}function v(t){return l({seq:[{int:1},{octstr:{hex:t.prvKeyHex}},{tag:["a0",!0,{oid:{name:t.curveName}}]},{tag:["a1",!0,{bitstr:{hex:"00"+t.pubKeyHex}}]}]})}function g(t){return l({seq:[{int:0},{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.g}},{int:{bigint:t.y}},{int:{bigint:t.x}}]})}if((void 0!==f&&t instanceof f||void 0!==h&&t instanceof h||void 0!==d&&t instanceof d)&&1==t.isPublic&&(void 0===e||"PKCS8PUB"==e))return jt(x=new(0,s.x509.SubjectPublicKeyInfo)(t).getEncodedHex(),"PUBLIC KEY");if("PKCS1PRV"==e&&void 0!==f&&t instanceof f&&(void 0===i||null==i)&&1==t.isPrivate)return jt(x=p(t).getEncodedHex(),"RSA PRIVATE KEY");if("PKCS1PRV"==e&&void 0!==d&&t instanceof d&&(void 0===i||null==i)&&1==t.isPrivate){var m=new a({name:t.curveName}).getEncodedHex(),w=v(t).getEncodedHex(),y="";return(y+=jt(m,"EC PARAMETERS"))+jt(w,"EC PRIVATE KEY")}if("PKCS1PRV"==e&&void 0!==h&&t instanceof h&&(void 0===i||null==i)&&1==t.isPrivate)return jt(x=g(t).getEncodedHex(),"DSA PRIVATE KEY");if("PKCS5PRV"==e&&void 0!==f&&t instanceof f&&void 0!==i&&null!=i&&1==t.isPrivate){var x=p(t).getEncodedHex();return void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",x,i,n,o)}if("PKCS5PRV"==e&&void 0!==d&&t instanceof d&&void 0!==i&&null!=i&&1==t.isPrivate)return x=v(t).getEncodedHex(),void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",x,i,n,o);if("PKCS5PRV"==e&&void 0!==h&&t instanceof h&&void 0!==i&&null!=i&&1==t.isPrivate)return x=g(t).getEncodedHex(),void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",x,i,n,o);var k=function(t,e){var i=E(t,e);return new l({seq:[{seq:[{oid:{name:"pkcs5PBES2"}},{seq:[{seq:[{oid:{name:"pkcs5PBKDF2"}},{seq:[{octstr:{hex:i.pbkdf2Salt}},{int:i.pbkdf2Iter}]}]},{seq:[{oid:{name:"des-EDE3-CBC"}},{octstr:{hex:i.encryptionSchemeIV}}]}]}]},{octstr:{hex:i.ciphertext}}]}).getEncodedHex()},E=function(t,e){var i=b.lib.WordArray.random(8),n=b.lib.WordArray.random(8),r=b.PBKDF2(e,i,{keySize:6,iterations:100}),o=b.enc.Hex.parse(t),s=b.TripleDES.encrypt(o,r,{iv:n})+"",a={};return a.ciphertext=s,a.pbkdf2Salt=b.enc.Hex.stringify(i),a.pbkdf2Iter=100,a.encryptionSchemeAlg="DES-EDE3-CBC",a.encryptionSchemeIV=b.enc.Hex.stringify(n),a};if("PKCS8PRV"==e&&null!=f&&t instanceof f&&1==t.isPrivate){var S=p(t).getEncodedHex();return x=l({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption"}},{null:!0}]},{octstr:{hex:S}}]}).getEncodedHex(),void 0===i||null==i?jt(x,"PRIVATE KEY"):jt(w=k(x,i),"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==e&&void 0!==d&&t instanceof d&&1==t.isPrivate)return S=new l({seq:[{int:1},{octstr:{hex:t.prvKeyHex}},{tag:["a1",!0,{bitstr:{hex:"00"+t.pubKeyHex}}]}]}).getEncodedHex(),x=l({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:t.curveName}}]},{octstr:{hex:S}}]}).getEncodedHex(),void 0===i||null==i?jt(x,"PRIVATE KEY"):jt(w=k(x,i),"ENCRYPTED PRIVATE KEY");if("PKCS8PRV"==e&&void 0!==h&&t instanceof h&&1==t.isPrivate)return S=new c({bigint:t.x}).getEncodedHex(),x=l({seq:[{int:0},{seq:[{oid:{name:"dsa"}},{seq:[{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.g}}]}]},{octstr:{hex:S}}]}).getEncodedHex(),void 0===i||null==i?jt(x,"PRIVATE KEY"):jt(w=k(x,i),"ENCRYPTED PRIVATE KEY");throw new Error("unsupported object nor format")},zt.getKeyFromCSRPEM=function(t){var e=Ct(t,"CERTIFICATE REQUEST");return zt.getKeyFromCSRHex(e)},zt.getKeyFromCSRHex=function(t){var e=zt.parseCSRHex(t);return zt.getKey(e.p8pubkeyhex,null,"pkcs8pub")},zt.parseCSRHex=function(t){var e=dt.getChildIdx,i=dt.getTLV,n={},r=t;if("30"!=r.substr(0,2))throw new Error("malformed CSR(code:001)");var o=e(r,0);if(o.length<1)throw new Error("malformed CSR(code:002)");if("30"!=r.substr(o[0],2))throw new Error("malformed CSR(code:003)");var s=e(r,o[0]);if(s.length<3)throw new Error("malformed CSR(code:004)");return n.p8pubkeyhex=i(r,s[2]),n},zt.getKeyID=function(t){var e=zt,i=dt;"string"==typeof t&&-1!=t.indexOf("BEGIN ")&&(t=e.getKey(t));var n=Ct(e.getPEM(t)),r=i.getIdxbyList(n,0,[1]),o=i.getV(n,r).substring(2);return lt.crypto.Util.hashHex(o,"sha1")},zt.getJWKFromKey=function(t){var e={};if(t instanceof rt&&t.isPrivate)return e.kty="RSA",e.n=bt(t.n.toString(16)),e.e=bt(t.e.toString(16)),e.d=bt(t.d.toString(16)),e.p=bt(t.p.toString(16)),e.q=bt(t.q.toString(16)),e.dp=bt(t.dmp1.toString(16)),e.dq=bt(t.dmq1.toString(16)),e.qi=bt(t.coeff.toString(16)),e;if(t instanceof rt&&t.isPublic)return e.kty="RSA",e.n=bt(t.n.toString(16)),e.e=bt(t.e.toString(16)),e;if(t instanceof lt.crypto.ECDSA&&t.isPrivate){if("P-256"!==(n=t.getShortNISTPCurveName())&&"P-384"!==n)throw new Error("unsupported curve name for JWT: "+n);var i=t.getPublicKeyXYHex();return e.kty="EC",e.crv=n,e.x=bt(i.x),e.y=bt(i.y),e.d=bt(t.prvKeyHex),e}if(t instanceof lt.crypto.ECDSA&&t.isPublic){var n;if("P-256"!==(n=t.getShortNISTPCurveName())&&"P-384"!==n)throw new Error("unsupported curve name for JWT: "+n);return i=t.getPublicKeyXYHex(),e.kty="EC",e.crv=n,e.x=bt(i.x),e.y=bt(i.y),e}throw new Error("not supported key object")},rt.getPosArrayOfChildrenFromHex=function(t){return dt.getChildIdx(t,0)},rt.getHexValueArrayOfChildrenFromHex=function(t){var e,i=dt.getV,n=i(t,(e=rt.getPosArrayOfChildrenFromHex(t))[0]),r=i(t,e[1]),o=i(t,e[2]),s=i(t,e[3]),a=i(t,e[4]),c=i(t,e[5]),l=i(t,e[6]),u=i(t,e[7]),h=i(t,e[8]);return(e=new Array).push(n,r,o,s,a,c,l,u,h),e},rt.prototype.readPrivateKeyFromPEMString=function(t){var e=Ct(t),i=rt.getHexValueArrayOfChildrenFromHex(e);this.setPrivateEx(i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8])},rt.prototype.readPKCS5PrvKeyHex=function(t){var e=rt.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},rt.prototype.readPKCS8PrvKeyHex=function(t){var e,i,n,r,o,s,a,c,l=dt.getVbyListEx;if(!1===dt.isASN1HEX(t))throw new Error("not ASN.1 hex string");try{e=l(t,0,[2,0,1],"02"),i=l(t,0,[2,0,2],"02"),n=l(t,0,[2,0,3],"02"),r=l(t,0,[2,0,4],"02"),o=l(t,0,[2,0,5],"02"),s=l(t,0,[2,0,6],"02"),a=l(t,0,[2,0,7],"02"),c=l(t,0,[2,0,8],"02")}catch(t){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(e,i,n,r,o,s,a,c)},rt.prototype.readPKCS5PubKeyHex=function(t){var e=dt,i=e.getV;if(!1===e.isASN1HEX(t))throw new Error("keyHex is not ASN.1 hex string");var n=e.getChildIdx(t,0);if(2!==n.length||"02"!==t.substr(n[0],2)||"02"!==t.substr(n[1],2))throw new Error("wrong hex for PKCS#5 public key");var r=i(t,n[0]),o=i(t,n[1]);this.setPublic(r,o)},rt.prototype.readPKCS8PubKeyHex=function(t){var e=dt;if(!1===e.isASN1HEX(t))throw new Error("not ASN.1 hex string");if("06092a864886f70d010101"!==e.getTLVbyListEx(t,0,[0,0]))throw new Error("not PKCS8 RSA public key");var i=e.getTLVbyListEx(t,0,[1,0]);this.readPKCS5PubKeyHex(i)},rt.prototype.readCertPubKeyHex=function(t){var e,i;(e=new qt).readCertHex(t),i=e.getPublicKeyHex(),this.readPKCS8PubKeyHex(i)},rt.prototype.sign=function(t,e){var i=lt.crypto.Util.hashString(t,e);return this.signWithMessageHash(i,e)},rt.prototype.signWithMessageHash=function(t,e){var i=it(lt.crypto.Util.getPaddedDigestInfoHex(t,e,this.n.bitLength()),16);return Ht(this.doPrivate(i).toString(16),this.n.bitLength())},rt.prototype.signPSS=function(t,e,i){var n,r=(n=St(t),lt.crypto.Util.hashHex(n,e));return void 0===i&&(i=-1),this.signWithMessageHashPSS(r,e,i)},rt.prototype.signWithMessageHashPSS=function(t,e,i){var n,r=Et(t),o=r.length,s=this.n.bitLength()-1,a=Math.ceil(s/8),c=function(t){return lt.crypto.Util.hashHex(t,e)};if(-1===i||void 0===i)i=o;else if(-2===i)i=a-o-2;else if(i<-2)throw new Error("invalid salt length");if(a<o+i+2)throw new Error("data too long");var l="";i>0&&(l=new Array(i),(new et).nextBytes(l),l=String.fromCharCode.apply(String,l));var u=Et(c(St("\0\0\0\0\0\0\0\0"+r+l))),h=[];for(n=0;n<a-i-o-2;n+=1)h[n]=0;var d=String.fromCharCode.apply(String,h)+""+l,f=Kt(u,d.length,c),p=[];for(n=0;n<d.length;n+=1)p[n]=d.charCodeAt(n)^f.charCodeAt(n);for(p[0]&=~(65280>>8*a-s&255),n=0;n<o;n++)p.push(u.charCodeAt(n));return p.push(188),Ht(this.doPrivate(new S(p)).toString(16),this.n.bitLength())},rt.prototype.verify=function(t,e){if(null==(e=e.toLowerCase()).match(/^[0-9a-f]+$/))return!1;var i=it(e,16),n=this.n.bitLength();if(i.bitLength()>n)return!1;var r=this.doPublic(i).toString(16);if(r.length+3!=n/4)return!1;var o=Wt(r.replace(/^1f+00/,""));return 0!=o.length&&o[1]==lt.crypto.Util.hashString(t,o[0])},rt.prototype.verifyWithMessageHash=function(t,e){if(e.length!=Math.ceil(this.n.bitLength()/4))return!1;var i=it(e,16);if(i.bitLength()>this.n.bitLength())return 0;var n=Wt(this.doPublic(i).toString(16).replace(/^1f+00/,""));return 0!=n.length&&n[1]==t},rt.prototype.verifyPSS=function(t,e,i,n){var r,o=(r=St(t),lt.crypto.Util.hashHex(r,i));return void 0===n&&(n=-1),this.verifyWithMessageHashPSS(o,e,i,n)},rt.prototype.verifyWithMessageHashPSS=function(t,e,i,n){if(e.length!=Math.ceil(this.n.bitLength()/4))return!1;var r,o=new S(e,16),s=function(t){return lt.crypto.Util.hashHex(t,i)},a=Et(t),c=a.length,l=this.n.bitLength()-1,u=Math.ceil(l/8);if(-1===n||void 0===n)n=c;else if(-2===n)n=u-c-2;else if(n<-2)throw new Error("invalid salt length");if(u<c+n+2)throw new Error("data too long");var h=this.doPublic(o).toByteArray();for(r=0;r<h.length;r+=1)h[r]&=255;for(;h.length<u;)h.unshift(0);if(188!==h[u-1])throw new Error("encoded message does not end in 0xbc");var d=(h=String.fromCharCode.apply(String,h)).substr(0,u-c-1),f=h.substr(d.length,c),p=65280>>8*u-l&255;if(0!=(d.charCodeAt(0)&p))throw new Error("bits beyond keysize not zero");var v=Kt(f,d.length,s),g=[];for(r=0;r<d.length;r+=1)g[r]=d.charCodeAt(r)^v.charCodeAt(r);g[0]&=~p;var m=u-c-n-2;for(r=0;r<m;r+=1)if(0!==g[r])throw new Error("leftmost octets not zero");if(1!==g[m])throw new Error("0x01 marker not found");return f===Et(s(St("\0\0\0\0\0\0\0\0"+a+String.fromCharCode.apply(String,g.slice(-n)))))},rt.SALT_LEN_HLEN=-1,rt.SALT_LEN_MAX=-2,rt.SALT_LEN_RECOVER=-2,qt.hex2dn=function(t,e){void 0===e&&(e=0);var i=new qt;return dt.getTLV(t,e),i.getX500Name(t).str},qt.hex2rdn=function(t,e){if(void 0===e&&(e=0),"31"!==t.substr(e,2))throw new Error("malformed RDN");for(var i=new Array,n=dt.getChildIdx(t,e),r=0;r<n.length;r++)i.push(qt.hex2attrTypeValue(t,n[r]));return(i=i.map((function(t){return t.replace("+","\\+")}))).join("+")},qt.hex2attrTypeValue=function(t,e){var i=dt,n=i.getV;if(void 0===e&&(e=0),"30"!==t.substr(e,2))throw new Error("malformed attribute type and value");var r=i.getChildIdx(t,e);2!==r.length||t.substr(r[0],2);var o=n(t,r[0]),s=lt.asn1.ASN1Util.oidHexToInt(o);return lt.asn1.x509.OID.oid2atype(s)+"="+Et(n(t,r[1]))},qt.getPublicKeyFromCertHex=function(t){var e=new qt;return e.readCertHex(t),e.getPublicKey()},qt.getPublicKeyFromCertPEM=function(t){var e=new qt;return e.readCertPEM(t),e.getPublicKey()},qt.getPublicKeyInfoPropOfCertPEM=function(t){var e,i,n=dt.getVbyList,r={algparam:null};return(e=new qt).readCertPEM(t),i=e.getPublicKeyHex(),r.keyhex=n(i,0,[1],"03").substr(2),r.algoid=n(i,0,[0,0],"06"),"2a8648ce3d0201"===r.algoid&&(r.algparam=n(i,0,[0,1],"06")),r},qt.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"],void 0!==lt&<||(e.KJUR=lt={}),void 0!==lt.jws&<.jws||(lt.jws={}),lt.jws.JWS=function(){var t=lt.jws.JWS.isSafeJSONString;this.parseJWS=function(e,i){if(void 0===this.parsedJWS||!i&&void 0===this.parsedJWS.sigvalH){var n=e.match(/^([^.]+)\.([^.]+)\.([^.]+)$/);if(null==n)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";var r=n[1],o=n[2],s=n[3],a=r+"."+o;if(this.parsedJWS={},this.parsedJWS.headB64U=r,this.parsedJWS.payloadB64U=o,this.parsedJWS.sigvalB64U=s,this.parsedJWS.si=a,!i){var c=yt(s),l=it(c,16);this.parsedJWS.sigvalH=c,this.parsedJWS.sigvalBI=l}var u=ht(r),h=ht(o);if(this.parsedJWS.headS=u,this.parsedJWS.payloadS=h,!t(u,this.parsedJWS,"headP"))throw"malformed JSON string for JWS Head: "+u}}},lt.jws.JWS.sign=function(t,e,i,n,r){var o,s,a,c=lt.jws.JWS,l=c.readSafeJSONString,u=c.isSafeJSONString,h=lt.crypto,d=h.Mac,f=h.Signature,p=JSON;if("string"!=typeof e&&"object"!=(void 0===e?"undefined":m(e)))throw"spHeader must be JSON string or object: "+e;if("object"==(void 0===e?"undefined":m(e))&&(o=p.stringify(s=e)),"string"==typeof e){if(!u(o=e))throw"JWS Head is not safe JSON string: "+o;s=l(o)}if(a=i,"object"==(void 0===i?"undefined":m(i))&&(a=p.stringify(i)),""!=t&&null!=t||void 0===s.alg||(t=s.alg),""!=t&&null!=t&&void 0===s.alg&&(s.alg=t,o=p.stringify(s)),t!==s.alg)throw"alg and sHeader.alg doesn't match: "+t+"!="+s.alg;var v=null;if(void 0===c.jwsalg2sigalg[t])throw"unsupported alg name: "+t;v=c.jwsalg2sigalg[t];var g=ut(o)+"."+ut(a),w="";if("Hmac"==v.substr(0,4)){if(void 0===n)throw"mac key shall be specified for HS* alg";var b=new d({alg:v,prov:"cryptojs",pass:n});b.updateString(g),w=b.doFinal()}else if(-1!=v.indexOf("withECDSA")){(x=new f({alg:v})).init(n,r),x.updateString(g);var y=x.sign();w=lt.crypto.ECDSA.asn1SigToConcatSig(y)}else{var x;"none"!=v&&((x=new f({alg:v})).init(n,r),x.updateString(g),w=x.sign())}return g+"."+bt(w)},lt.jws.JWS.verify=function(t,e,i){var n,r=lt.jws.JWS,o=r.readSafeJSONString,s=lt.crypto,a=s.ECDSA,c=s.Mac,l=s.Signature;void 0!==m(rt)&&(n=rt);var u=t.split(".");if(3!==u.length)return!1;var h,d=u[0]+"."+u[1],f=yt(u[2]),p=o(ht(u[0])),v=null;if(void 0===p.alg)throw"algorithm not specified in header";if(h=(v=p.alg).substr(0,2),null!=i&&"[object Array]"===Object.prototype.toString.call(i)&&i.length>0&&-1==(":"+i.join(":")+":").indexOf(":"+v+":"))throw"algorithm '"+v+"' not accepted in the list";if("none"!=v&&null===e)throw"key shall be specified to verify.";if("string"==typeof e&&-1!=e.indexOf("-----BEGIN ")&&(e=zt.getKey(e)),!("RS"!=h&&"PS"!=h||e instanceof n))throw"key shall be a RSAKey obj for RS* and PS* algs";if("ES"==h&&!(e instanceof a))throw"key shall be a ECDSA obj for ES* algs";var g=null;if(void 0===r.jwsalg2sigalg[p.alg])throw"unsupported alg name: "+v;if("none"==(g=r.jwsalg2sigalg[v]))throw"not supported";if("Hmac"==g.substr(0,4)){if(void 0===e)throw"hexadecimal key shall be specified for HMAC";var w=new c({alg:g,pass:e});return w.updateString(d),f==w.doFinal()}if(-1!=g.indexOf("withECDSA")){var b,y=null;try{y=a.concatSigToASN1Sig(f)}catch(t){return!1}return(b=new l({alg:g})).init(e),b.updateString(d),b.verify(y)}return(b=new l({alg:g})).init(e),b.updateString(d),b.verify(f)},lt.jws.JWS.parse=function(t){var e,i,n=t.split("."),r={};if(2!=n.length&&3!=n.length)throw"malformed sJWS: wrong number of '.' splitted elements";return e=n[1],3==n.length&&(i=n[2]),r.headerObj=lt.jws.JWS.readSafeJSONString(ht(n[0])),r.payloadObj=lt.jws.JWS.readSafeJSONString(ht(e)),r.headerPP=JSON.stringify(r.headerObj,null," "),r.payloadPP=null==r.payloadObj?ht(e):JSON.stringify(r.payloadObj,null," "),void 0!==i&&(r.sigHex=yt(i)),r},lt.jws.JWS.verifyJWT=function(t,e,i){var n=lt.jws,r=n.JWS,o=r.readSafeJSONString,s=r.inArray,a=r.includedArray,c=t.split("."),l=c[0],u=c[1],h=(yt(c[2]),o(ht(l))),d=o(ht(u));if(void 0===h.alg)return!1;if(void 0===i.alg)throw"acceptField.alg shall be specified";if(!s(h.alg,i.alg))return!1;if(void 0!==d.iss&&"object"===m(i.iss)&&!s(d.iss,i.iss))return!1;if(void 0!==d.sub&&"object"===m(i.sub)&&!s(d.sub,i.sub))return!1;if(void 0!==d.aud&&"object"===m(i.aud))if("string"==typeof d.aud){if(!s(d.aud,i.aud))return!1}else if("object"==m(d.aud)&&!a(d.aud,i.aud))return!1;var f=n.IntDate.getNow();return void 0!==i.verifyAt&&"number"==typeof i.verifyAt&&(f=i.verifyAt),void 0!==i.gracePeriod&&"number"==typeof i.gracePeriod||(i.gracePeriod=0),!(void 0!==d.exp&&"number"==typeof d.exp&&d.exp+i.gracePeriod<f||void 0!==d.nbf&&"number"==typeof d.nbf&&f<d.nbf-i.gracePeriod||void 0!==d.iat&&"number"==typeof d.iat&&f<d.iat-i.gracePeriod||void 0!==d.jti&&void 0!==i.jti&&d.jti!==i.jti||!r.verify(t,e,i.alg))},lt.jws.JWS.includedArray=function(t,e){var i=lt.jws.JWS.inArray;if(null===t)return!1;if("object"!==(void 0===t?"undefined":m(t)))return!1;if("number"!=typeof t.length)return!1;for(var n=0;n<t.length;n++)if(!i(t[n],e))return!1;return!0},lt.jws.JWS.inArray=function(t,e){if(null===e)return!1;if("object"!==(void 0===e?"undefined":m(e)))return!1;if("number"!=typeof e.length)return!1;for(var i=0;i<e.length;i++)if(e[i]==t)return!0;return!1},lt.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"},lt.jws.JWS.isSafeJSONString=function(t,e,i){var n=null;try{return"object"!=(void 0===(n=ct(t))?"undefined":m(n))||n.constructor===Array?0:(e&&(e[i]=n),1)}catch(t){return 0}},lt.jws.JWS.readSafeJSONString=function(t){var e=null;try{return"object"!=(void 0===(e=ct(t))?"undefined":m(e))||e.constructor===Array?null:e}catch(t){return null}},lt.jws.JWS.getEncodedSignatureValueFromJWS=function(t){var e=t.match(/^[^.]+\.[^.]+\.([^.]+)$/);if(null==e)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";return e[1]},lt.jws.JWS.getJWKthumbprint=function(t){if("RSA"!==t.kty&&"EC"!==t.kty&&"oct"!==t.kty)throw"unsupported algorithm for JWK Thumprint";var e="{";if("RSA"===t.kty){if("string"!=typeof t.n||"string"!=typeof t.e)throw"wrong n and e value for RSA key";e+='"e":"'+t.e+'",',e+='"kty":"'+t.kty+'",',e+='"n":"'+t.n+'"}'}else if("EC"===t.kty){if("string"!=typeof t.crv||"string"!=typeof t.x||"string"!=typeof t.y)throw"wrong crv, x and y value for EC key";e+='"crv":"'+t.crv+'",',e+='"kty":"'+t.kty+'",',e+='"x":"'+t.x+'",',e+='"y":"'+t.y+'"}'}else if("oct"===t.kty){if("string"!=typeof t.k)throw"wrong k value for oct(symmetric) key";e+='"kty":"'+t.kty+'",',e+='"k":"'+t.k+'"}'}var i=St(e);return bt(lt.crypto.Util.hashHex(i,"sha256"))},lt.jws.IntDate={},lt.jws.IntDate.get=function(t){var e=lt.jws.IntDate,i=e.getNow,n=e.getZulu;if("now"==t)return i();if("now + 1hour"==t)return i()+3600;if("now + 1day"==t)return i()+86400;if("now + 1month"==t)return i()+2592e3;if("now + 1year"==t)return i()+31536e3;if(t.match(/Z$/))return n(t);if(t.match(/^[0-9]+$/))return parseInt(t);throw"unsupported format: "+t},lt.jws.IntDate.getZulu=function(t){return It(t)},lt.jws.IntDate.getNow=function(){return~~(new Date/1e3)},lt.jws.IntDate.intDate2UTCString=function(t){return new Date(1e3*t).toUTCString()},lt.jws.IntDate.intDate2Zulu=function(t){var e=new Date(1e3*t);return("0000"+e.getUTCFullYear()).slice(-4)+("00"+(e.getUTCMonth()+1)).slice(-2)+("00"+e.getUTCDate()).slice(-2)+("00"+e.getUTCHours()).slice(-2)+("00"+e.getUTCMinutes()).slice(-2)+("00"+e.getUTCSeconds()).slice(-2)+"Z"},e.SecureRandom=et,e.rng_seed_time=X,e.BigInteger=S,e.RSAKey=rt,e.EDSA=lt.crypto.EDSA,e.DSA=lt.crypto.DSA,e.Signature=lt.crypto.Signature,e.MessageDigest=lt.crypto.MessageDigest,e.Mac=lt.crypto.Mac,e.Cipher=lt.crypto.Cipher,e.KEYUTIL=zt,e.ASN1HEX=dt,e.X509=qt,e.CryptoJS=b,e.b64tohex=k,e.b64toBA=E,e.stoBA=ft,e.BAtos=pt,e.BAtohex=vt,e.stohex=gt,e.stob64=function(t){return x(gt(t))},e.stob64u=function(t){return mt(x(gt(t)))},e.b64utos=function(t){return pt(E(wt(t)))},e.b64tob64u=mt,e.b64utob64=wt,e.hex2b64=x,e.hextob64u=bt,e.b64utohex=yt,e.utf8tob64u=ut,e.b64utoutf8=ht,e.utf8tob64=function(t){return x(Tt(Ut(t)))},e.b64toutf8=function(t){return decodeURIComponent(Ot(k(t)))},e.utf8tohex=xt,e.hextoutf8=kt,e.hextorstr=Et,e.rstrtohex=St,e.hextob64=Ft,e.hextob64nl=At,e.b64nltohex=_t,e.hextopem=jt,e.pemtohex=Ct,e.hextoArrayBuffer=function(t){if(t.length%2!=0)throw"input is not even length";if(null==t.match(/^[0-9A-Fa-f]+$/))throw"input is not hexadecimal";for(var e=new ArrayBuffer(t.length/2),i=new DataView(e),n=0;n<t.length/2;n++)i.setUint8(n,parseInt(t.substr(2*n,2),16));return e},e.ArrayBuffertohex=function(t){for(var e="",i=new DataView(t),n=0;n<t.byteLength;n++)e+=("00"+i.getUint8(n).toString(16)).slice(-2);return e},e.zulutomsec=Rt,e.zulutosec=It,e.zulutodate=function(t){return new Date(Rt(t))},e.datetozulu=function(t,e,i){var n,r=t.getUTCFullYear();if(e){if(r<1950||2049<r)throw"not proper year for UTCTime: "+r;n=(""+r).slice(-2)}else n=("000"+r).slice(-4);if(n+=("0"+(t.getUTCMonth()+1)).slice(-2),n+=("0"+t.getUTCDate()).slice(-2),n+=("0"+t.getUTCHours()).slice(-2),n+=("0"+t.getUTCMinutes()).slice(-2),n+=("0"+t.getUTCSeconds()).slice(-2),i){var o=t.getUTCMilliseconds();0!==o&&(n+="."+(o=(o=("00"+o).slice(-3)).replace(/0+$/g,"")))}return n+"Z"},e.uricmptohex=Tt,e.hextouricmp=Ot,e.ipv6tohex=Pt,e.hextoipv6=Nt,e.hextoip=Dt,e.iptohex=function(t){var e="malformed IP address";if(!(t=t.toLowerCase(t)).match(/^[0-9.]+$/)){if(t.match(/^[0-9a-f:]+$/)&&-1!==t.indexOf(":"))return Pt(t);throw e}var i=t.split(".");if(4!==i.length)throw e;var n="";try{for(var r=0;r<4;r++)n+=("0"+parseInt(i[r]).toString(16)).slice(-2);return n}catch(t){throw e}},e.encodeURIComponentAll=Ut,e.newline_toUnix=function(t){return t.replace(/\r\n/gm,"\n")},e.newline_toDos=function(t){return(t=t.replace(/\r\n/gm,"\n")).replace(/\n/gm,"\r\n")},e.hextoposhex=Bt,e.intarystrtohex=function(t){t=(t=(t=t.replace(/^\s*\[\s*/,"")).replace(/\s*\]\s*$/,"")).replace(/\s*/g,"");try{return t.split(/,/).map((function(t){var e=parseInt(t);if(e<0||255<e)throw"integer not in range 0-255";return("00"+e.toString(16)).slice(-2)})).join("")}catch(t){throw"malformed integer array string: "+t}},e.strdiffidx=function(t,e){var i=t.length;t.length>e.length&&(i=e.length);for(var n=0;n<i;n++)if(t.charCodeAt(n)!=e.charCodeAt(n))return n;return t.length!=e.length?i:-1},e.KJUR=lt,e.crypto=lt.crypto,e.asn1=lt.asn1,e.jws=lt.jws,e.lang=lt.lang}).call(this,i(28).Buffer)},function(t,e,i){(function(t){var n=i(30),r=i(31),o=i(32);function s(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=c.prototype:(null===t&&(t=new c(e)),t.length=e),t}function c(t,e,i){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(t,e,i);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return h(this,t)}return l(this,t,e,i)}function l(t,e,i,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,i,n){if(i<0||e.byteLength<i)throw new RangeError("'offset' is out of bounds");if(e.byteLength<i+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===i&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,i):new Uint8Array(e,i,n),c.TYPED_ARRAY_SUPPORT?(t=e).__proto__=c.prototype:t=d(t,e),t}(t,e,i,n):"string"==typeof e?function(t,e,i){if("string"==typeof i&&""!==i||(i="utf8"),!c.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(e,i),r=(t=a(t,n)).write(e,i);return r!==n&&(t=t.slice(0,r)),t}(t,e,i):function(t,e){if(c.isBuffer(e)){var i=0|f(e.length);return 0===(t=a(t,i)).length||e.copy(t,0,0,i),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?a(t,0):d(t,e);if("Buffer"===e.type&&o(e.data))return d(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function u(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function h(t,e){if(u(e),t=a(t,e<0?0:0|f(e)),!c.TYPED_ARRAY_SUPPORT)for(var i=0;i<e;++i)t[i]=0;return t}function d(t,e){var i=e.length<0?0:0|f(e.length);t=a(t,i);for(var n=0;n<i;n+=1)t[n]=255&e[n];return t}function f(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function p(t,e){if(c.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var i=t.length;if(0===i)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return J(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return $(t).length;default:if(n)return J(t).length;e=(""+e).toLowerCase(),n=!0}}function v(t,e,i){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,i);case"utf8":case"utf-8":return A(this,e,i);case"ascii":return j(this,e,i);case"latin1":case"binary":return C(this,e,i);case"base64":return F(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,i);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function m(t,e,i,n,r){if(0===t.length)return-1;if("string"==typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=r?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(r)return-1;i=t.length-1}else if(i<0){if(!r)return-1;i=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:w(t,e,i,n,r);if("number"==typeof e)return e&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(t,e,i):Uint8Array.prototype.lastIndexOf.call(t,e,i):w(t,[e],i,n,r);throw new TypeError("val must be string, number or Buffer")}function w(t,e,i,n,r){var o,s=1,a=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,c/=2,i/=2}function l(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(r){var u=-1;for(o=i;o<a;o++)if(l(t,o)===l(e,-1===u?0:o-u)){if(-1===u&&(u=o),o-u+1===c)return u*s}else-1!==u&&(o-=o-u),u=-1}else for(i+c>a&&(i=a-c),o=i;o>=0;o--){for(var h=!0,d=0;d<c;d++)if(l(t,o+d)!==l(e,d)){h=!1;break}if(h)return o}return-1}function b(t,e,i,n){i=Number(i)||0;var r=t.length-i;n?(n=Number(n))>r&&(n=r):n=r;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[i+s]=a}return s}function y(t,e,i,n){return z(J(e,t.length-i),t,i,n)}function x(t,e,i,n){return z(function(t){for(var e=[],i=0;i<t.length;++i)e.push(255&t.charCodeAt(i));return e}(e),t,i,n)}function k(t,e,i,n){return x(t,e,i,n)}function E(t,e,i,n){return z($(e),t,i,n)}function S(t,e,i,n){return z(function(t,e){for(var i,n,r=[],o=0;o<t.length&&!((e-=2)<0);++o)n=(i=t.charCodeAt(o))>>8,r.push(i%256),r.push(n);return r}(e,t.length-i),t,i,n)}function F(t,e,i){return n.fromByteArray(0===e&&i===t.length?t:t.slice(e,i))}function A(t,e,i){i=Math.min(t.length,i);for(var n=[],r=e;r<i;){var o,s,a,c,l=t[r],u=null,h=l>239?4:l>223?3:l>191?2:1;if(r+h<=i)switch(h){case 1:l<128&&(u=l);break;case 2:128==(192&(o=t[r+1]))&&(c=(31&l)<<6|63&o)>127&&(u=c);break;case 3:s=t[r+2],128==(192&(o=t[r+1]))&&128==(192&s)&&(c=(15&l)<<12|(63&o)<<6|63&s)>2047&&(c<55296||c>57343)&&(u=c);break;case 4:s=t[r+2],a=t[r+3],128==(192&(o=t[r+1]))&&128==(192&s)&&128==(192&a)&&(c=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&c<1114112&&(u=c)}null===u?(u=65533,h=1):u>65535&&(n.push((u-=65536)>>>10&1023|55296),u=56320|1023&u),n.push(u),r+=h}return function(t){var e=t.length;if(e<=_)return String.fromCharCode.apply(String,t);for(var i="",n=0;n<e;)i+=String.fromCharCode.apply(String,t.slice(n,n+=_));return i}(n)}e.Buffer=c,e.SlowBuffer=function(t){return+t!=t&&(t=0),c.alloc(+t)},e.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=s(),c.poolSize=8192,c._augment=function(t){return t.__proto__=c.prototype,t},c.from=function(t,e,i){return l(null,t,e,i)},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(t,e,i){return n=null,o=e,s=i,u(r=t),r<=0?a(n,r):void 0!==o?"string"==typeof s?a(n,r).fill(o,s):a(n,r).fill(o):a(n,r);var n,r,o,s},c.allocUnsafe=function(t){return h(null,t)},c.allocUnsafeSlow=function(t){return h(null,t)},c.isBuffer=function(t){return!(null==t||!t._isBuffer)},c.compare=function(t,e){if(!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var i=t.length,n=e.length,r=0,o=Math.min(i,n);r<o;++r)if(t[r]!==e[r]){i=t[r],n=e[r];break}return i<n?-1:n<i?1:0},c.isEncoding=function(t){switch(String(t).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(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);var i;if(void 0===e)for(e=0,i=0;i<t.length;++i)e+=t[i].length;var n=c.allocUnsafe(e),r=0;for(i=0;i<t.length;++i){var s=t[i];if(!c.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,r),r+=s.length}return n},c.byteLength=p,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},c.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},c.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},c.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?A(this,0,t):v.apply(this,arguments)},c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){var t="",i=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,i).match(/.{2}/g).join(" "),this.length>i&&(t+=" ... ")),"<Buffer "+t+">"},c.prototype.compare=function(t,e,i,n,r){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===i&&(i=t?t.length:0),void 0===n&&(n=0),void 0===r&&(r=this.length),e<0||i>t.length||n<0||r>this.length)throw new RangeError("out of range index");if(n>=r&&e>=i)return 0;if(n>=r)return-1;if(e>=i)return 1;if(this===t)return 0;for(var o=(r>>>=0)-(n>>>=0),s=(i>>>=0)-(e>>>=0),a=Math.min(o,s),l=this.slice(n,r),u=t.slice(e,i),h=0;h<a;++h)if(l[h]!==u[h]){o=l[h],s=u[h];break}return o<s?-1:s<o?1:0},c.prototype.includes=function(t,e,i){return-1!==this.indexOf(t,e,i)},c.prototype.indexOf=function(t,e,i){return m(this,t,e,i,!0)},c.prototype.lastIndexOf=function(t,e,i){return m(this,t,e,i,!1)},c.prototype.write=function(t,e,i,n){if(void 0===e)n="utf8",i=this.length,e=0;else if(void 0===i&&"string"==typeof e)n=e,i=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(i)?(i|=0,void 0===n&&(n="utf8")):(n=i,i=void 0)}var r=this.length-e;if((void 0===i||i>r)&&(i=r),t.length>0&&(i<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return b(this,t,e,i);case"utf8":case"utf-8":return y(this,t,e,i);case"ascii":return x(this,t,e,i);case"latin1":case"binary":return k(this,t,e,i);case"base64":return E(this,t,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,i);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var _=4096;function j(t,e,i){var n="";i=Math.min(t.length,i);for(var r=e;r<i;++r)n+=String.fromCharCode(127&t[r]);return n}function C(t,e,i){var n="";i=Math.min(t.length,i);for(var r=e;r<i;++r)n+=String.fromCharCode(t[r]);return n}function R(t,e,i){var n=t.length;(!e||e<0)&&(e=0),(!i||i<0||i>n)&&(i=n);for(var r="",o=e;o<i;++o)r+=B(t[o]);return r}function I(t,e,i){for(var n=t.slice(e,i),r="",o=0;o<n.length;o+=2)r+=String.fromCharCode(n[o]+256*n[o+1]);return r}function T(t,e,i){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>i)throw new RangeError("Trying to access beyond buffer length")}function O(t,e,i,n,r,o){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||e<o)throw new RangeError('"value" argument is out of bounds');if(i+n>t.length)throw new RangeError("Index out of range")}function P(t,e,i,n){e<0&&(e=65535+e+1);for(var r=0,o=Math.min(t.length-i,2);r<o;++r)t[i+r]=(e&255<<8*(n?r:1-r))>>>8*(n?r:1-r)}function N(t,e,i,n){e<0&&(e=4294967295+e+1);for(var r=0,o=Math.min(t.length-i,4);r<o;++r)t[i+r]=e>>>8*(n?r:3-r)&255}function D(t,e,i,n){if(i+n>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function M(t,e,i,n,o){return o||D(t,0,i,4),r.write(t,e,i,n,23,4),i+4}function U(t,e,i,n,o){return o||D(t,0,i,8),r.write(t,e,i,n,52,8),i+8}c.prototype.slice=function(t,e){var i,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),c.TYPED_ARRAY_SUPPORT)(i=this.subarray(t,e)).__proto__=c.prototype;else{var r=e-t;i=new c(r,void 0);for(var o=0;o<r;++o)i[o]=this[o+t]}return i},c.prototype.readUIntLE=function(t,e,i){t|=0,e|=0,i||T(t,e,this.length);for(var n=this[t],r=1,o=0;++o<e&&(r*=256);)n+=this[t+o]*r;return n},c.prototype.readUIntBE=function(t,e,i){t|=0,e|=0,i||T(t,e,this.length);for(var n=this[t+--e],r=1;e>0&&(r*=256);)n+=this[t+--e]*r;return n},c.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,e,i){t|=0,e|=0,i||T(t,e,this.length);for(var n=this[t],r=1,o=0;++o<e&&(r*=256);)n+=this[t+o]*r;return n>=(r*=128)&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,i){t|=0,e|=0,i||T(t,e,this.length);for(var n=e,r=1,o=this[t+--n];n>0&&(r*=256);)o+=this[t+--n]*r;return o>=(r*=128)&&(o-=Math.pow(2,8*e)),o},c.prototype.readInt8=function(t,e){return e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var i=this[t]|this[t+1]<<8;return 32768&i?4294901760|i:i},c.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var i=this[t+1]|this[t]<<8;return 32768&i?4294901760|i:i},c.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),r.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),r.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),r.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),r.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,e,i,n){t=+t,e|=0,i|=0,n||O(this,t,e,i,Math.pow(2,8*i)-1,0);var r=1,o=0;for(this[e]=255&t;++o<i&&(r*=256);)this[e+o]=t/r&255;return e+i},c.prototype.writeUIntBE=function(t,e,i,n){t=+t,e|=0,i|=0,n||O(this,t,e,i,Math.pow(2,8*i)-1,0);var r=i-1,o=1;for(this[e+r]=255&t;--r>=0&&(o*=256);)this[e+r]=t/o&255;return e+i},c.prototype.writeUInt8=function(t,e,i){return t=+t,e|=0,i||O(this,t,e,1,255,0),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},c.prototype.writeUInt16LE=function(t,e,i){return t=+t,e|=0,i||O(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):P(this,t,e,!0),e+2},c.prototype.writeUInt16BE=function(t,e,i){return t=+t,e|=0,i||O(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):P(this,t,e,!1),e+2},c.prototype.writeUInt32LE=function(t,e,i){return t=+t,e|=0,i||O(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):N(this,t,e,!0),e+4},c.prototype.writeUInt32BE=function(t,e,i){return t=+t,e|=0,i||O(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},c.prototype.writeIntLE=function(t,e,i,n){if(t=+t,e|=0,!n){var r=Math.pow(2,8*i-1);O(this,t,e,i,r-1,-r)}var o=0,s=1,a=0;for(this[e]=255&t;++o<i&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+i},c.prototype.writeIntBE=function(t,e,i,n){if(t=+t,e|=0,!n){var r=Math.pow(2,8*i-1);O(this,t,e,i,r-1,-r)}var o=i-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+i},c.prototype.writeInt8=function(t,e,i){return t=+t,e|=0,i||O(this,t,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,i){return t=+t,e|=0,i||O(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):P(this,t,e,!0),e+2},c.prototype.writeInt16BE=function(t,e,i){return t=+t,e|=0,i||O(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):P(this,t,e,!1),e+2},c.prototype.writeInt32LE=function(t,e,i){return t=+t,e|=0,i||O(this,t,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):N(this,t,e,!0),e+4},c.prototype.writeInt32BE=function(t,e,i){return t=+t,e|=0,i||O(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},c.prototype.writeFloatLE=function(t,e,i){return M(this,t,e,!0,i)},c.prototype.writeFloatBE=function(t,e,i){return M(this,t,e,!1,i)},c.prototype.writeDoubleLE=function(t,e,i){return U(this,t,e,!0,i)},c.prototype.writeDoubleBE=function(t,e,i){return U(this,t,e,!1,i)},c.prototype.copy=function(t,e,i,n){if(i||(i=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<i&&(n=i),n===i)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-i&&(n=t.length-e+i);var r,o=n-i;if(this===t&&i<e&&e<n)for(r=o-1;r>=0;--r)t[r+e]=this[r+i];else if(o<1e3||!c.TYPED_ARRAY_SUPPORT)for(r=0;r<o;++r)t[r+e]=this[r+i];else Uint8Array.prototype.set.call(t,this.subarray(i,i+o),e);return o},c.prototype.fill=function(t,e,i,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),1===t.length){var r=t.charCodeAt(0);r<256&&(t=r)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<i)throw new RangeError("Out of range index");if(i<=e)return this;var o;if(e>>>=0,i=void 0===i?this.length:i>>>0,t||(t=0),"number"==typeof t)for(o=e;o<i;++o)this[o]=t;else{var s=c.isBuffer(t)?t:J(new c(t,n).toString()),a=s.length;for(o=0;o<i-e;++o)this[o+e]=s[o%a]}return this};var L=/[^+\/0-9A-Za-z-_]/g;function B(t){return t<16?"0"+t.toString(16):t.toString(16)}function J(t,e){var i;e=e||1/0;for(var n=t.length,r=null,o=[],s=0;s<n;++s){if((i=t.charCodeAt(s))>55295&&i<57344){if(!r){if(i>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}r=i;continue}if(i<56320){(e-=3)>-1&&o.push(239,191,189),r=i;continue}i=65536+(r-55296<<10|i-56320)}else r&&(e-=3)>-1&&o.push(239,191,189);if(r=null,i<128){if((e-=1)<0)break;o.push(i)}else if(i<2048){if((e-=2)<0)break;o.push(i>>6|192,63&i|128)}else if(i<65536){if((e-=3)<0)break;o.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return o}function $(t){return n.toByteArray(function(t){if((t=(e=t,e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")).replace(L,"")).length<2)return"";for(var e;t.length%4!=0;)t+="=";return t}(t))}function z(t,e,i,n){for(var r=0;r<n&&!(r+i>=e.length||r>=t.length);++r)e[r+i]=t[r];return r}}).call(this,i(29))},function(t){var e;e=function(){return this}();try{e=e||new Function("return this")()}catch(t){"object"==typeof window&&(e=window)}t.exports=e},function(t,e){e.byteLength=function(t){var e=c(t),i=e[1];return 3*(e[0]+i)/4-i},e.toByteArray=function(t){var e,i,o,s=c(t),a=s[0],l=s[1],u=new r(3*(a+(o=l))/4-o),h=0,d=l>0?a-4:a;for(i=0;i<d;i+=4)e=n[t.charCodeAt(i)]<<18|n[t.charCodeAt(i+1)]<<12|n[t.charCodeAt(i+2)]<<6|n[t.charCodeAt(i+3)],u[h++]=e>>16&255,u[h++]=e>>8&255,u[h++]=255&e;return 2===l&&(e=n[t.charCodeAt(i)]<<2|n[t.charCodeAt(i+1)]>>4,u[h++]=255&e),1===l&&(e=n[t.charCodeAt(i)]<<10|n[t.charCodeAt(i+1)]<<4|n[t.charCodeAt(i+2)]>>2,u[h++]=e>>8&255,u[h++]=255&e),u},e.fromByteArray=function(t){for(var e,n=t.length,r=n%3,o=[],s=16383,a=0,c=n-r;a<c;a+=s)o.push(l(t,a,a+s>c?c:a+s));return 1===r?o.push(i[(e=t[n-1])>>2]+i[e<<4&63]+"=="):2===r&&o.push(i[(e=(t[n-2]<<8)+t[n-1])>>10]+i[e>>4&63]+i[e<<2&63]+"="),o.join("")};for(var i=[],n=[],r="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s<a;++s)i[s]=o[s],n[o.charCodeAt(s)]=s;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");return-1===i&&(i=e),[i,i===e?0:4-i%4]}function l(t,e,n){for(var r,o=[],s=e;s<n;s+=3)o.push(i[(r=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]))>>18&63]+i[r>>12&63]+i[r>>6&63]+i[63&r]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,i,n,r){var o,s,a=8*r-n-1,c=(1<<a)-1,l=c>>1,u=-7,h=i?r-1:0,d=i?-1:1,f=t[e+h];for(h+=d,o=f&(1<<-u)-1,f>>=-u,u+=a;u>0;o=256*o+t[e+h],h+=d,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=n;u>0;s=256*s+t[e+h],h+=d,u-=8);if(0===o)o=1-l;else{if(o===c)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,n),o-=l}return(f?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,i,n,r,o){var s,a,c,l=8*o-r-1,u=(1<<l)-1,h=u>>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,p=n?1:-1,v=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-s))<1&&(s--,c*=2),(e+=s+h>=1?d/c:d*Math.pow(2,1-h))*c>=2&&(s++,c/=2),s+h>=u?(a=0,s=u):s+h>=1?(a=(e*c-1)*Math.pow(2,r),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,r),s=0));r>=8;t[i+f]=255&a,f+=p,a/=256,r-=8);for(s=s<<r|a,l+=r;l>0;t[i+f]=255&s,f+=p,s/=256,l-=8);t[i+f-p]|=128*v}},function(t){var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=t.jws,i=t.KeyUtil,r=t.X509,o=t.crypto,s=t.hextob64u,a=t.b64tohex,c=t.AllowedSigningAlgs;return function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.parseJwt=function(t){n.Log.debug("JoseUtil.parseJwt");try{var i=e.JWS.parse(t);return{header:i.headerObj,payload:i.payloadObj}}catch(t){n.Log.error(t)}},t.validateJwt=function(e,o,s,c,l,u,h){n.Log.debug("JoseUtil.validateJwt");try{if("RSA"===o.kty)if(o.e&&o.n)o=i.getKey(o);else{if(!o.x5c||!o.x5c.length)return n.Log.error("JoseUtil.validateJwt: RSA key missing key material",o),Promise.reject(new Error("RSA key missing key material"));var d=a(o.x5c[0]);o=r.getPublicKeyFromCertHex(d)}else{if("EC"!==o.kty)return n.Log.error("JoseUtil.validateJwt: Unsupported key type",o&&o.kty),Promise.reject(new Error(o.kty));if(!(o.crv&&o.x&&o.y))return n.Log.error("JoseUtil.validateJwt: EC key missing key material",o),Promise.reject(new Error("EC key missing key material"));o=i.getKey(o)}return t._validateJwt(e,o,s,c,l,u,h)}catch(t){return n.Log.error(t&&t.message||t),Promise.reject("JWT validation failed")}},t.validateJwtAttributes=function(e,i,r,o,s,a){o||(o=0),s||(s=parseInt(Date.now()/1e3));var c=t.parseJwt(e).payload;if(!c.iss)return n.Log.error("JoseUtil._validateJwt: issuer was not provided"),Promise.reject(new Error("issuer was not provided"));if(c.iss!==i)return n.Log.error("JoseUtil._validateJwt: Invalid issuer in token",c.iss),Promise.reject(new Error("Invalid issuer in token: "+c.iss));if(!c.aud)return n.Log.error("JoseUtil._validateJwt: aud was not provided"),Promise.reject(new Error("aud was not provided"));if(!(c.aud===r||Array.isArray(c.aud)&&c.aud.indexOf(r)>=0))return n.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!==r)return n.Log.error("JoseUtil._validateJwt: Invalid azp in token",c.azp),Promise.reject(new Error("Invalid azp in token: "+c.azp));if(!a){var l=s+o,u=s-o;if(!c.iat)return n.Log.error("JoseUtil._validateJwt: iat was not provided"),Promise.reject(new Error("iat was not provided"));if(l<c.iat)return n.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&&l<c.nbf)return n.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 n.Log.error("JoseUtil._validateJwt: exp was not provided"),Promise.reject(new Error("exp was not provided"));if(c.exp<u)return n.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)},t._validateJwt=function(i,r,o,s,a,l,u){return t.validateJwtAttributes(i,o,s,a,l,u).then((function(t){try{return e.JWS.verify(i,r,c)?t:(n.Log.error("JoseUtil._validateJwt: signature validation failed"),Promise.reject(new Error("signature validation failed")))}catch(t){return n.Log.error(t&&t.message||t),Promise.reject(new Error("signature validation failed"))}}))},t.hashString=function(t,e){try{return o.Util.hashString(t,e)}catch(t){n.Log.error(t)}},t.hexToBase64Url=function(t){try{return s(t)}catch(t){n.Log.error(t)}},t}()};var n=i(0);t.exports=e.default},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.SigninResponse=void 0;var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),r=i(3);function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.SigninResponse=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#";o(this,t);var n=r.UrlUtility.parseUrlFragment(e,i);this.error=n.error,this.error_description=n.error_description,this.error_uri=n.error_uri,this.code=n.code,this.state=n.state,this.id_token=n.id_token,this.session_state=n.session_state,this.access_token=n.access_token,this.token_type=n.token_type,this.scope=n.scope,this.profile=void 0,this.expires_in=n.expires_in}return n(t,[{key:"expires_in",get:function(){if(this.expires_at){var t=parseInt(Date.now()/1e3);return this.expires_at-t}},set:function(t){var e=parseInt(t);if("number"==typeof e&&e>0){var i=parseInt(Date.now()/1e3);this.expires_at=i+e}}},{key:"expired",get:function(){var t=this.expires_in;if(void 0!==t)return t<=0}},{key:"scopes",get:function(){return(this.scope||"").split(" ")}},{key:"isOpenIdConnect",get:function(){return this.scopes.indexOf("openid")>=0||!!this.id_token}}]),t}()},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.SignoutRequest=void 0;var n=i(0),r=i(3),o=i(9);e.SignoutRequest=function t(e){var i=e.url,s=e.id_token_hint,a=e.post_logout_redirect_uri,c=e.data,l=e.extraQueryParams,u=e.request_type;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!i)throw n.Log.error("SignoutRequest.ctor: No url passed"),new Error("url");for(var h in s&&(i=r.UrlUtility.addQueryParam(i,"id_token_hint",s)),a&&(i=r.UrlUtility.addQueryParam(i,"post_logout_redirect_uri",a),c&&(this.state=new o.State({data:c,request_type:u}),i=r.UrlUtility.addQueryParam(i,"state",this.state.id))),l)i=r.UrlUtility.addQueryParam(i,h,l[h]);this.url=i}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.SignoutResponse=void 0;var n=i(3);e.SignoutResponse=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var i=n.UrlUtility.parseUrlFragment(e,"?");this.error=i.error,this.error_description=i.error_description,this.error_uri=i.error_uri,this.state=i.state}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.InMemoryWebStorage=void 0;var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),r=i(0);e.InMemoryWebStorage=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._data={}}return t.prototype.getItem=function(t){return r.Log.debug("InMemoryWebStorage.getItem",t),this._data[t]},t.prototype.setItem=function(t,e){r.Log.debug("InMemoryWebStorage.setItem",t),this._data[t]=e},t.prototype.removeItem=function(t){r.Log.debug("InMemoryWebStorage.removeItem",t),delete this._data[t]},t.prototype.key=function(t){return Object.getOwnPropertyNames(this._data)[t]},n(t,[{key:"length",get:function(){return Object.getOwnPropertyNames(this._data).length}}]),t}()},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.UserManager=void 0;var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),r=i(0),o=i(10),s=i(39),a=i(15),c=i(45),l=i(47),u=i(18),h=i(8),d=i(20),f=i(11),p=i(4);function v(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function g(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}e.UserManager=function(t){function e(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.SilentRenewService,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.SessionMonitor,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:d.TokenRevocationClient,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:f.TokenClient,m=arguments.length>5&&void 0!==arguments[5]?arguments[5]:p.JoseUtil;v(this,e),i instanceof s.UserManagerSettings||(i=new s.UserManagerSettings(i));var w=g(this,t.call(this,i));return w._events=new c.UserManagerEvents(i),w._silentRenewService=new n(w),w.settings.automaticSilentRenew&&(r.Log.debug("UserManager.ctor: automaticSilentRenew is configured, setting up silent renew"),w.startSilentRenew()),w.settings.monitorSession&&(r.Log.debug("UserManager.ctor: monitorSession is configured, setting up session monitor"),w._sessionMonitor=new o(w)),w._tokenRevocationClient=new a(w._settings),w._tokenClient=new h(w._settings),w._joseUtil=m,w}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.getUser=function(){var t=this;return this._loadUser().then((function(e){return e?(r.Log.info("UserManager.getUser: user loaded"),t._events.load(e,!1),e):(r.Log.info("UserManager.getUser: user not found in storage"),null)}))},e.prototype.removeUser=function(){var t=this;return this.storeUser(null).then((function(){r.Log.info("UserManager.removeUser: user removed from storage"),t._events.unload()}))},e.prototype.signinRedirect=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).request_type="si:r";var e={useReplaceToNavigate:t.useReplaceToNavigate};return this._signinStart(t,this._redirectNavigator,e).then((function(){r.Log.info("UserManager.signinRedirect: successful")}))},e.prototype.signinRedirectCallback=function(t){return this._signinEnd(t||this._redirectNavigator.url).then((function(t){return t.profile&&t.profile.sub?r.Log.info("UserManager.signinRedirectCallback: successful, signed in sub: ",t.profile.sub):r.Log.info("UserManager.signinRedirectCallback: no sub"),t}))},e.prototype.signinPopup=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).request_type="si:p";var e=t.redirect_uri||this.settings.popup_redirect_uri||this.settings.redirect_uri;return e?(t.redirect_uri=e,t.display="popup",this._signin(t,this._popupNavigator,{startUrl:e,popupWindowFeatures:t.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:t.popupWindowTarget||this.settings.popupWindowTarget}).then((function(t){return t&&(t.profile&&t.profile.sub?r.Log.info("UserManager.signinPopup: signinPopup successful, signed in sub: ",t.profile.sub):r.Log.info("UserManager.signinPopup: no sub")),t}))):(r.Log.error("UserManager.signinPopup: No popup_redirect_uri or redirect_uri configured"),Promise.reject(new Error("No popup_redirect_uri or redirect_uri configured")))},e.prototype.signinPopupCallback=function(t){return this._signinCallback(t,this._popupNavigator).then((function(t){return t&&(t.profile&&t.profile.sub?r.Log.info("UserManager.signinPopupCallback: successful, signed in sub: ",t.profile.sub):r.Log.info("UserManager.signinPopupCallback: no sub")),t})).catch((function(t){r.Log.error(t.message)}))},e.prototype.signinSilent=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e=Object.assign({},e),this._loadUser().then((function(i){return i&&i.refresh_token?(e.refresh_token=i.refresh_token,t._useRefreshToken(e)):(e.request_type="si:s",e.id_token_hint=e.id_token_hint||t.settings.includeIdTokenInSilentRenew&&i&&i.id_token,i&&t._settings.validateSubOnSilentRenew&&(r.Log.debug("UserManager.signinSilent, subject prior to silent renew: ",i.profile.sub),e.current_sub=i.profile.sub),t._signinSilentIframe(e))}))},e.prototype._useRefreshToken=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._tokenClient.exchangeRefreshToken(e).then((function(e){return e?e.access_token?t._loadUser().then((function(i){if(i){var n=Promise.resolve();return e.id_token&&(n=t._validateIdTokenFromTokenRefreshToken(i.profile,e.id_token)),n.then((function(){return r.Log.debug("UserManager._useRefreshToken: refresh token response success"),i.id_token=e.id_token||i.id_token,i.access_token=e.access_token,i.refresh_token=e.refresh_token||i.refresh_token,i.expires_in=e.expires_in,t.storeUser(i).then((function(){return t._events.load(i),i}))}))}return null})):(r.Log.error("UserManager._useRefreshToken: No access token returned from token endpoint"),Promise.reject("No access token returned from token endpoint")):(r.Log.error("UserManager._useRefreshToken: No response returned from token endpoint"),Promise.reject("No response returned from token endpoint"))}))},e.prototype._validateIdTokenFromTokenRefreshToken=function(t,e){var i=this;return this._metadataService.getIssuer().then((function(n){return i.settings.getEpochTime().then((function(o){return i._joseUtil.validateJwtAttributes(e,n,i._settings.client_id,i._settings.clockSkew,o).then((function(e){return e?e.sub!==t.sub?(r.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"))):e.auth_time&&e.auth_time!==t.auth_time?(r.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"))):e.azp&&e.azp!==t.azp?(r.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"))):!e.azp&&t.azp?(r.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:(r.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: Failed to validate id_token"),Promise.reject(new Error("Failed to validate id_token")))}))}))}))},e.prototype._signinSilentIframe=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.redirect_uri||this.settings.silent_redirect_uri||this.settings.redirect_uri;return e?(t.redirect_uri=e,t.prompt=t.prompt||"none",this._signin(t,this._iframeNavigator,{startUrl:e,silentRequestTimeout:t.silentRequestTimeout||this.settings.silentRequestTimeout}).then((function(t){return t&&(t.profile&&t.profile.sub?r.Log.info("UserManager.signinSilent: successful, signed in sub: ",t.profile.sub):r.Log.info("UserManager.signinSilent: no sub")),t}))):(r.Log.error("UserManager.signinSilent: No silent_redirect_uri configured"),Promise.reject(new Error("No silent_redirect_uri configured")))},e.prototype.signinSilentCallback=function(t){return this._signinCallback(t,this._iframeNavigator).then((function(t){return t&&(t.profile&&t.profile.sub?r.Log.info("UserManager.signinSilentCallback: successful, signed in sub: ",t.profile.sub):r.Log.info("UserManager.signinSilentCallback: no sub")),t}))},e.prototype.signinCallback=function(t){var e=this;return this.readSigninResponseState(t).then((function(i){var n=i.state;return"si:r"===n.request_type?e.signinRedirectCallback(t):"si:p"===n.request_type?e.signinPopupCallback(t):"si:s"===n.request_type?e.signinSilentCallback(t):Promise.reject(new Error("invalid response_type in state"))}))},e.prototype.signoutCallback=function(t,e){var i=this;return this.readSignoutResponseState(t).then((function(n){var r=n.state,o=n.response;return r?"so:r"===r.request_type?i.signoutRedirectCallback(t):"so:p"===r.request_type?i.signoutPopupCallback(t,e):Promise.reject(new Error("invalid response_type in state")):o}))},e.prototype.querySessionStatus=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).request_type="si:s";var i=e.redirect_uri||this.settings.silent_redirect_uri||this.settings.redirect_uri;return i?(e.redirect_uri=i,e.prompt="none",e.response_type=e.response_type||this.settings.query_status_response_type,e.scope=e.scope||"openid",e.skipUserInfo=!0,this._signinStart(e,this._iframeNavigator,{startUrl:i,silentRequestTimeout:e.silentRequestTimeout||this.settings.silentRequestTimeout}).then((function(e){return t.processSigninResponse(e.url).then((function(t){if(r.Log.debug("UserManager.querySessionStatus: got signin response"),t.session_state&&t.profile.sub)return r.Log.info("UserManager.querySessionStatus: querySessionStatus success for sub: ",t.profile.sub),{session_state:t.session_state,sub:t.profile.sub,sid:t.profile.sid};r.Log.info("querySessionStatus successful, user not authenticated")})).catch((function(e){if(e.session_state&&t.settings.monitorAnonymousSession&&("login_required"==e.message||"consent_required"==e.message||"interaction_required"==e.message||"account_selection_required"==e.message))return r.Log.info("UserManager.querySessionStatus: querySessionStatus success for anonymous user"),{session_state:e.session_state};throw e}))}))):(r.Log.error("UserManager.querySessionStatus: No silent_redirect_uri configured"),Promise.reject(new Error("No silent_redirect_uri configured")))},e.prototype._signin=function(t,e){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._signinStart(t,e,n).then((function(e){return i._signinEnd(e.url,t)}))},e.prototype._signinStart=function(t,e){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.prepare(n).then((function(e){return r.Log.debug("UserManager._signinStart: got navigator window handle"),i.createSigninRequest(t).then((function(t){return r.Log.debug("UserManager._signinStart: got signin request"),n.url=t.url,n.id=t.state.id,e.navigate(n)})).catch((function(t){throw e.close&&(r.Log.debug("UserManager._signinStart: Error after preparing navigator, closing navigator window"),e.close()),t}))}))},e.prototype._signinEnd=function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.processSigninResponse(t).then((function(t){r.Log.debug("UserManager._signinEnd: got signin response");var n=new a.User(t);if(i.current_sub){if(i.current_sub!==n.profile.sub)return r.Log.debug("UserManager._signinEnd: current user does not match user returned from signin. sub from signin: ",n.profile.sub),Promise.reject(new Error("login_required"));r.Log.debug("UserManager._signinEnd: current user matches user returned from signin")}return e.storeUser(n).then((function(){return r.Log.debug("UserManager._signinEnd: user stored"),e._events.load(n),n}))}))},e.prototype._signinCallback=function(t,e){r.Log.debug("UserManager._signinCallback");var i="query"===this._settings.response_mode||!this._settings.response_mode&&h.SigninRequest.isCode(this._settings.response_type)?"?":"#";return e.callback(t,void 0,i)},e.prototype.signoutRedirect=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).request_type="so:r";var e=t.post_logout_redirect_uri||this.settings.post_logout_redirect_uri;e&&(t.post_logout_redirect_uri=e);var i={useReplaceToNavigate:t.useReplaceToNavigate};return this._signoutStart(t,this._redirectNavigator,i).then((function(){r.Log.info("UserManager.signoutRedirect: successful")}))},e.prototype.signoutRedirectCallback=function(t){return this._signoutEnd(t||this._redirectNavigator.url).then((function(t){return r.Log.info("UserManager.signoutRedirectCallback: successful"),t}))},e.prototype.signoutPopup=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).request_type="so:p";var e=t.post_logout_redirect_uri||this.settings.popup_post_logout_redirect_uri||this.settings.post_logout_redirect_uri;return t.post_logout_redirect_uri=e,t.display="popup",t.post_logout_redirect_uri&&(t.state=t.state||{}),this._signout(t,this._popupNavigator,{startUrl:e,popupWindowFeatures:t.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:t.popupWindowTarget||this.settings.popupWindowTarget}).then((function(){r.Log.info("UserManager.signoutPopup: successful")}))},e.prototype.signoutPopupCallback=function(t,e){return void 0===e&&"boolean"==typeof t&&(e=t,t=null),this._popupNavigator.callback(t,e,"?").then((function(){r.Log.info("UserManager.signoutPopupCallback: successful")}))},e.prototype._signout=function(t,e){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._signoutStart(t,e,n).then((function(t){return i._signoutEnd(t.url)}))},e.prototype._signoutStart=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this,i=arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i.prepare(n).then((function(i){return r.Log.debug("UserManager._signoutStart: got navigator window handle"),e._loadUser().then((function(o){return r.Log.debug("UserManager._signoutStart: loaded current user from storage"),(e._settings.revokeAccessTokenOnSignout?e._revokeInternal(o):Promise.resolve()).then((function(){var s=t.id_token_hint||o&&o.id_token;return s&&(r.Log.debug("UserManager._signoutStart: Setting id_token into signout request"),t.id_token_hint=s),e.removeUser().then((function(){return r.Log.debug("UserManager._signoutStart: user removed, creating signout request"),e.createSignoutRequest(t).then((function(t){return r.Log.debug("UserManager._signoutStart: got signout request"),n.url=t.url,t.state&&(n.id=t.state.id),i.navigate(n)}))}))}))})).catch((function(t){throw i.close&&(r.Log.debug("UserManager._signoutStart: Error after preparing navigator, closing navigator window"),i.close()),t}))}))},e.prototype._signoutEnd=function(t){return this.processSignoutResponse(t).then((function(t){return r.Log.debug("UserManager._signoutEnd: got signout response"),t}))},e.prototype.revokeAccessToken=function(){var t=this;return this._loadUser().then((function(e){return t._revokeInternal(e,!0).then((function(i){if(i)return r.Log.debug("UserManager.revokeAccessToken: removing token properties from user and re-storing"),e.access_token=null,e.refresh_token=null,e.expires_at=null,e.token_type=null,t.storeUser(e).then((function(){r.Log.debug("UserManager.revokeAccessToken: user stored"),t._events.load(e)}))}))})).then((function(){r.Log.info("UserManager.revokeAccessToken: access token revoked successfully")}))},e.prototype._revokeInternal=function(t,e){var i=this;if(t){var n=t.refresh_token;return this._revokeAccessTokenInternal(t.access_token,e).then((function(t){return i._revokeRefreshTokenInternal(n,e).then((function(e){return t||e||r.Log.debug("UserManager.revokeAccessToken: no need to revoke due to no token(s), or JWT format"),t||e}))}))}return Promise.resolve(!1)},e.prototype._revokeAccessTokenInternal=function(t,e){return!t||t.indexOf(".")>=0?Promise.resolve(!1):this._tokenRevocationClient.revoke(t,e).then((function(){return!0}))},e.prototype._revokeRefreshTokenInternal=function(t,e){return t?this._tokenRevocationClient.revoke(t,e,"refresh_token").then((function(){return!0})):Promise.resolve(!1)},e.prototype.startSilentRenew=function(){this._silentRenewService.start()},e.prototype.stopSilentRenew=function(){this._silentRenewService.stop()},e.prototype._loadUser=function(){return this._userStore.get(this._userStoreKey).then((function(t){return t?(r.Log.debug("UserManager._loadUser: user storageString loaded"),a.User.fromStorageString(t)):(r.Log.debug("UserManager._loadUser: no user storageString"),null)}))},e.prototype.storeUser=function(t){if(t){r.Log.debug("UserManager.storeUser: storing user");var e=t.toStorageString();return this._userStore.set(this._userStoreKey,e)}return r.Log.debug("storeUser.storeUser: removing user"),this._userStore.remove(this._userStoreKey)},n(e,[{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}}]),e}(o.OidcClient)},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.UserManagerSettings=void 0;var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),r=(i(0),i(5)),o=i(40),s=i(41),a=i(43),c=i(6),l=i(1),u=i(8);function h(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function d(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}e.UserManagerSettings=function(t){function e(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=i.popup_redirect_uri,r=i.popup_post_logout_redirect_uri,f=i.popupWindowFeatures,p=i.popupWindowTarget,v=i.silent_redirect_uri,g=i.silentRequestTimeout,m=i.automaticSilentRenew,w=void 0!==m&&m,b=i.validateSubOnSilentRenew,y=void 0!==b&&b,x=i.includeIdTokenInSilentRenew,k=void 0===x||x,E=i.monitorSession,S=void 0===E||E,F=i.monitorAnonymousSession,A=void 0!==F&&F,_=i.checkSessionInterval,j=void 0===_?2e3:_,C=i.stopCheckSessionOnError,R=void 0===C||C,I=i.query_status_response_type,T=i.revokeAccessTokenOnSignout,O=void 0!==T&&T,P=i.accessTokenExpiringNotificationTime,N=void 0===P?60:P,D=i.redirectNavigator,M=void 0===D?new o.RedirectNavigator:D,U=i.popupNavigator,L=void 0===U?new s.PopupNavigator:U,B=i.iframeNavigator,J=void 0===B?new a.IFrameNavigator:B,$=i.userStore,z=void 0===$?new c.WebStorageStateStore({store:l.Global.sessionStorage}):$;h(this,e);var H=d(this,t.call(this,arguments[0]));return H._popup_redirect_uri=n,H._popup_post_logout_redirect_uri=r,H._popupWindowFeatures=f,H._popupWindowTarget=p,H._silent_redirect_uri=v,H._silentRequestTimeout=g,H._automaticSilentRenew=w,H._validateSubOnSilentRenew=y,H._includeIdTokenInSilentRenew=k,H._accessTokenExpiringNotificationTime=N,H._monitorSession=S,H._monitorAnonymousSession=A,H._checkSessionInterval=j,H._stopCheckSessionOnError=R,H._query_status_response_type=I||(arguments[0]&&arguments[0].response_type?u.SigninRequest.isOidc(arguments[0].response_type)?"id_token":"code":"id_token"),H._revokeAccessTokenOnSignout=O,H._redirectNavigator=M,H._popupNavigator=L,H._iframeNavigator=J,H._userStore=z,H}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),n(e,[{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}}]),e}(r.OidcClientSettings)},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.RedirectNavigator=void 0;var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),r=i(0);e.RedirectNavigator=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.prototype.prepare=function(){return Promise.resolve(this)},t.prototype.navigate=function(t){return t&&t.url?(t.useReplaceToNavigate?window.location.replace(t.url):window.location=t.url,Promise.resolve()):(r.Log.error("RedirectNavigator.navigate: No url provided"),Promise.reject(new Error("No url provided")))},n(t,[{key:"url",get:function(){return window.location.href}}]),t}()},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.PopupNavigator=void 0;var n=i(0),r=i(42);e.PopupNavigator=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.prototype.prepare=function(t){var e=new r.PopupWindow(t);return Promise.resolve(e)},t.prototype.callback=function(t,e,i){n.Log.debug("PopupNavigator.callback");try{return r.PopupWindow.notifyOpener(t,e,i),Promise.resolve()}catch(t){return Promise.reject(t)}},t}()},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.PopupWindow=void 0;var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),r=i(0),o=i(3);e.PopupWindow=function(){function t(e){var i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._promise=new Promise((function(t,e){i._resolve=t,i._reject=e})),this._popup=window.open("",e.popupWindowTarget||"_blank",e.popupWindowFeatures||"location=no,toolbar=no,width=500,height=500,left=100,top=100;"),this._popup&&(r.Log.debug("PopupWindow.ctor: popup successfully created"),this._checkForPopupClosedTimer=window.setInterval(this._checkForPopupClosed.bind(this),500))}return t.prototype.navigate=function(t){return this._popup?t&&t.url?(r.Log.debug("PopupWindow.navigate: Setting URL in popup"),this._id=t.id,this._id&&(window["popupCallback_"+t.id]=this._callback.bind(this)),this._popup.focus(),this._popup.window.location=t.url):(this._error("PopupWindow.navigate: no url provided"),this._error("No url provided")):this._error("PopupWindow.navigate: Error opening popup window"),this.promise},t.prototype._success=function(t){r.Log.debug("PopupWindow.callback: Successful response from popup window"),this._cleanup(),this._resolve(t)},t.prototype._error=function(t){r.Log.error("PopupWindow.error: ",t),this._cleanup(),this._reject(new Error(t))},t.prototype.close=function(){this._cleanup(!1)},t.prototype._cleanup=function(t){r.Log.debug("PopupWindow.cleanup"),window.clearInterval(this._checkForPopupClosedTimer),this._checkForPopupClosedTimer=null,delete window["popupCallback_"+this._id],this._popup&&!t&&this._popup.close(),this._popup=null},t.prototype._checkForPopupClosed=function(){this._popup&&!this._popup.closed||this._error("Popup window closed")},t.prototype._callback=function(t,e){this._cleanup(e),t?(r.Log.debug("PopupWindow.callback success"),this._success({url:t})):(r.Log.debug("PopupWindow.callback: Invalid response from popup"),this._error("Invalid response from popup"))},t.notifyOpener=function(t,e,i){if(window.opener){if(t=t||window.location.href){var n=o.UrlUtility.parseUrlFragment(t,i);if(n.state){var s=window.opener["popupCallback_"+n.state];s?(r.Log.debug("PopupWindow.notifyOpener: passing url message to opener"),s(t,e)):r.Log.warn("PopupWindow.notifyOpener: no matching callback found on opener")}else r.Log.warn("PopupWindow.notifyOpener: no state found in response url")}}else r.Log.warn("PopupWindow.notifyOpener: no window.opener. Can't complete notification.")},n(t,[{key:"promise",get:function(){return this._promise}}]),t}()},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.IFrameNavigator=void 0;var n=i(0),r=i(44);e.IFrameNavigator=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.prototype.prepare=function(t){var e=new r.IFrameWindow(t);return Promise.resolve(e)},t.prototype.callback=function(t){n.Log.debug("IFrameNavigator.callback");try{return r.IFrameWindow.notifyParent(t),Promise.resolve()}catch(t){return Promise.reject(t)}},t}()},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.IFrameWindow=void 0;var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),r=i(0);e.IFrameWindow=function(){function t(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._promise=new Promise((function(t,i){e._resolve=t,e._reject=i})),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 t.prototype.navigate=function(t){if(t&&t.url){var e=t.silentRequestTimeout||1e4;r.Log.debug("IFrameWindow.navigate: Using timeout of:",e),this._timer=window.setTimeout(this._timeout.bind(this),e),this._frame.src=t.url}else this._error("No url provided");return this.promise},t.prototype._success=function(t){this._cleanup(),r.Log.debug("IFrameWindow: Successful response from frame window"),this._resolve(t)},t.prototype._error=function(t){this._cleanup(),r.Log.error(t),this._reject(new Error(t))},t.prototype.close=function(){this._cleanup()},t.prototype._cleanup=function(){this._frame&&(r.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)},t.prototype._timeout=function(){r.Log.debug("IFrameWindow.timeout"),this._error("Frame window timed out")},t.prototype._message=function(t){if(r.Log.debug("IFrameWindow.message"),this._timer&&t.origin===this._origin&&t.source===this._frame.contentWindow&&"string"==typeof t.data&&(t.data.startsWith("http://")||t.data.startsWith("https://"))){var e=t.data;e?this._success({url:e}):this._error("Invalid response from frame")}},t.notifyParent=function(t){r.Log.debug("IFrameWindow.notifyParent"),(t=t||window.location.href)&&(r.Log.debug("IFrameWindow.notifyParent: posting url message to parent"),window.parent.postMessage(t,location.protocol+"//"+location.host))},n(t,[{key:"promise",get:function(){return this._promise}},{key:"_origin",get:function(){return location.protocol+"//"+location.host}}]),t}()},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.UserManagerEvents=void 0;var n=i(0),r=i(16),o=i(17);e.UserManagerEvents=function(t){function e(i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,i));return n._userLoaded=new o.Event("User loaded"),n._userUnloaded=new o.Event("User unloaded"),n._silentRenewError=new o.Event("Silent renew error"),n._userSignedIn=new o.Event("User signed in"),n._userSignedOut=new o.Event("User signed out"),n._userSessionChanged=new o.Event("User session changed"),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.load=function(e){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];n.Log.debug("UserManagerEvents.load"),t.prototype.load.call(this,e),i&&this._userLoaded.raise(e)},e.prototype.unload=function(){n.Log.debug("UserManagerEvents.unload"),t.prototype.unload.call(this),this._userUnloaded.raise()},e.prototype.addUserLoaded=function(t){this._userLoaded.addHandler(t)},e.prototype.removeUserLoaded=function(t){this._userLoaded.removeHandler(t)},e.prototype.addUserUnloaded=function(t){this._userUnloaded.addHandler(t)},e.prototype.removeUserUnloaded=function(t){this._userUnloaded.removeHandler(t)},e.prototype.addSilentRenewError=function(t){this._silentRenewError.addHandler(t)},e.prototype.removeSilentRenewError=function(t){this._silentRenewError.removeHandler(t)},e.prototype._raiseSilentRenewError=function(t){n.Log.debug("UserManagerEvents._raiseSilentRenewError",t.message),this._silentRenewError.raise(t)},e.prototype.addUserSignedIn=function(t){this._userSignedIn.addHandler(t)},e.prototype.removeUserSignedIn=function(t){this._userSignedIn.removeHandler(t)},e.prototype._raiseUserSignedIn=function(){n.Log.debug("UserManagerEvents._raiseUserSignedIn"),this._userSignedIn.raise()},e.prototype.addUserSignedOut=function(t){this._userSignedOut.addHandler(t)},e.prototype.removeUserSignedOut=function(t){this._userSignedOut.removeHandler(t)},e.prototype._raiseUserSignedOut=function(){n.Log.debug("UserManagerEvents._raiseUserSignedOut"),this._userSignedOut.raise()},e.prototype.addUserSessionChanged=function(t){this._userSessionChanged.addHandler(t)},e.prototype.removeUserSessionChanged=function(t){this._userSessionChanged.removeHandler(t)},e.prototype._raiseUserSessionChanged=function(){n.Log.debug("UserManagerEvents._raiseUserSessionChanged"),this._userSessionChanged.raise()},e}(r.AccessTokenEvents)},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.Timer=void 0;var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),r=i(0),o=i(1),s=i(17);function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}e.Timer=function(t){function e(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.Global.timer,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;a(this,e);var s=c(this,t.call(this,i));return s._timer=n,s._nowFunc=r||function(){return Date.now()/1e3},s}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.init=function(t){t<=0&&(t=1),t=parseInt(t);var e=this.now+t;if(this.expiration===e&&this._timerHandle)r.Log.debug("Timer.init timer "+this._name+" skipping initialization since already initialized for expiration:",this.expiration);else{this.cancel(),r.Log.debug("Timer.init timer "+this._name+" for duration:",t),this._expiration=e;var i=5;t<i&&(i=t),this._timerHandle=this._timer.setInterval(this._callback.bind(this),1e3*i)}},e.prototype.cancel=function(){this._timerHandle&&(r.Log.debug("Timer.cancel: ",this._name),this._timer.clearInterval(this._timerHandle),this._timerHandle=null)},e.prototype._callback=function(){r.Log.debug("Timer.callback; "+this._name+" timer expires in:",this._expiration-this.now),this._expiration<=this.now&&(this.cancel(),t.prototype.raise.call(this))},n(e,[{key:"now",get:function(){return parseInt(this._nowFunc())}},{key:"expiration",get:function(){return this._expiration}}]),e}(s.Event)},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.SilentRenewService=void 0;var n=i(0);e.SilentRenewService=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._userManager=e}return t.prototype.start=function(){this._callback||(this._callback=this._tokenExpiring.bind(this),this._userManager.events.addAccessTokenExpiring(this._callback),this._userManager.getUser().then((function(){})).catch((function(t){n.Log.error("SilentRenewService.start: Error from getUser:",t.message)})))},t.prototype.stop=function(){this._callback&&(this._userManager.events.removeAccessTokenExpiring(this._callback),delete this._callback)},t.prototype._tokenExpiring=function(){var t=this;this._userManager.signinSilent().then((function(){n.Log.debug("SilentRenewService._tokenExpiring: Silent token renewal successful")}),(function(e){n.Log.error("SilentRenewService._tokenExpiring: Error from signinSilent:",e.message),t._userManager.events._raiseSilentRenewError(e)}))},t}()},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.CordovaPopupNavigator=void 0;var n=i(21);e.CordovaPopupNavigator=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.prototype.prepare=function(t){var e=new n.CordovaPopupWindow(t);return Promise.resolve(e)},t}()},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.CordovaIFrameNavigator=void 0;var n=i(21);e.CordovaIFrameNavigator=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.prototype.prepare=function(t){t.popupWindowFeatures="hidden=yes";var e=new n.CordovaPopupWindow(t);return Promise.resolve(e)},t}()},function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Version="1.11.6"}])}))}}),Ho=ue({"../node_modules/@inrupt/oidc-client-ext/dist/index.js"(t){var e=zo(),i=Jo();function n(t){return void 0!==t.error_description&&"string"==typeof t.error_description}function r(t,e){if(void 0!==(r=t).error&&"string"==typeof r.error)throw new i.OidcProviderError(`Token endpoint returned error [${t.error}]${n(t)?`: ${t.error_description}`:""}${function(t){return void 0!==t.error_uri&&"string"==typeof t.error_uri}(t)?` (see ${t.error_uri})`:""}`,t.error,n(t)?t.error_description:void 0);var r;if(!function(t){return void 0!==t.access_token&&"string"==typeof t.access_token}(t))throw new i.InvalidResponseError(["access_token"]);if(!function(t){return void 0!==t.id_token&&"string"==typeof t.id_token}(t))throw new i.InvalidResponseError(["id_token"]);if(!function(t){return void 0!==t.token_type&&"string"==typeof t.token_type}(t))throw new i.InvalidResponseError(["token_type"]);if(!function(t){return void 0===t.expires_in||"number"==typeof t.expires_in}(t))throw new i.InvalidResponseError(["expires_in"]);if(!e&&"bearer"!==t.token_type.toLowerCase())throw new Error(`Invalid token endpoint response: requested a [Bearer] token, but got a 'token_type' value of [${t.token_type}].`);return t}Object.defineProperty(t,"CordovaIFrameNavigator",{enumerable:!0,get:function(){return e.CordovaIFrameNavigator}}),Object.defineProperty(t,"CordovaPopupNavigator",{enumerable:!0,get:function(){return e.CordovaPopupNavigator}}),Object.defineProperty(t,"InMemoryWebStorage",{enumerable:!0,get:function(){return e.InMemoryWebStorage}}),Object.defineProperty(t,"Log",{enumerable:!0,get:function(){return e.Log}}),Object.defineProperty(t,"OidcClient",{enumerable:!0,get:function(){return e.OidcClient}}),Object.defineProperty(t,"SessionMonitor",{enumerable:!0,get:function(){return e.SessionMonitor}}),Object.defineProperty(t,"User",{enumerable:!0,get:function(){return e.User}}),Object.defineProperty(t,"UserManager",{enumerable:!0,get:function(){return e.UserManager}}),Object.defineProperty(t,"Version",{enumerable:!0,get:function(){return e.Version}}),Object.defineProperty(t,"WebStorageStateStore",{enumerable:!0,get:function(){return e.WebStorageStateStore}}),t.clearOidcPersistentStorage=async function(){const t=new e.OidcClient({response_mode:"query"});await t.clearStaleState(new e.WebStorageStateStore({}));const i=window.localStorage,n=[];for(let t=0;t<=i.length;t+=1){const e=i.key(t);e&&(e.match(/^oidc\..+$/)||e.match(/^solidClientAuthenticationUser:.+$/))&&n.push(e)}n.forEach((t=>i.removeItem(t)))},t.getBearerToken=async function(t){let n;try{const r=new e.OidcClient({response_mode:"query",loadUserInfo:!1});if(n=await r.processSigninResponse(t),void 0===r.settings.metadata)throw new Error("Cannot retrieve issuer metadata from client information in storage.");if(void 0===r.settings.metadata.jwks_uri)throw new Error("Missing some issuer metadata from client information in storage: 'jwks_uri' is undefined");if(void 0===r.settings.metadata.issuer)throw new Error("Missing some issuer metadata from client information in storage: 'issuer' is undefined");if(void 0===r.settings.client_id)throw new Error("Missing some client information in storage: 'client_id' is undefined");const o=await i.getWebidFromTokenPayload(n.id_token,r.settings.metadata.jwks_uri,r.settings.metadata.issuer,r.settings.client_id);return{accessToken:n.access_token,idToken:n.id_token,webId:o,refreshToken:n.refresh_token}}catch(e){throw new Error(`Problem handling Auth Code Grant (Flow) redirect - URL [${t}]: ${e}`)}},t.getDpopToken=async function(t,e,n){return async function(t,e,n,o){!function(t,e){if(e.grantType&&(!t.grantTypesSupported||!t.grantTypesSupported.includes(e.grantType)))throw new Error(`The issuer [${t.issuer}] does not support the [${e.grantType}] grant`);if(!t.tokenEndpoint)throw new Error(`This issuer [${t.issuer}] does not have a token endpoint`)}(t,n);const s={"content-type":"application/x-www-form-urlencoded"};let a;o&&(a=await i.generateDpopKeyPair(),s.DPoP=await i.createDpopHeader(t.tokenEndpoint,"POST",a)),e.clientSecret&&(s.Authorization=`Basic ${btoa(`${e.clientId}:${e.clientSecret}`)}`);const c={method:"POST",headers:s,body:new URLSearchParams({grant_type:n.grantType,redirect_uri:n.redirectUrl,code:n.code,code_verifier:n.codeVerifier,client_id:e.clientId}).toString()},l=await await fetch(t.tokenEndpoint,c),u=r(await l.json(),o),h=await i.getWebidFromTokenPayload(u.id_token,t.jwksUri,t.issuer,e.clientId);return{accessToken:u.access_token,idToken:u.id_token,refreshToken:(d=u,void 0!==d.refresh_token&&"string"==typeof d.refresh_token?u.refresh_token:void 0),webId:h,dpopKey:a,expiresIn:u.expires_in};var d}(t,e,n,!0)},t.refresh=async function(t,e,n,o){if(void 0===n.clientId)throw new Error("No client ID available when trying to refresh the access token.");const s={grant_type:"refresh_token",refresh_token:t,scope:i.DEFAULT_SCOPES};let a={};void 0!==o&&(a={DPoP:await i.createDpopHeader(e.tokenEndpoint,"POST",o)});let c={};void 0!==n.clientSecret?c={Authorization:`Basic ${btoa(`${n.clientId}:${n.clientSecret}`)}`}:(t=>{try{return new URL(t),!0}catch(t){return!1}})(n.clientId)&&(s.client_id=n.clientId);const l=await fetch(e.tokenEndpoint,{method:"POST",body:new URLSearchParams(s).toString(),headers:{...a,...c,"Content-Type":"application/x-www-form-urlencoded"}});let u;try{u=await l.json()}catch(t){throw new Error(`The token endpoint of issuer ${e.issuer} returned a malformed response.`)}const h=r(u,void 0!==o),d=await i.getWebidFromTokenPayload(h.id_token,e.jwksUri,e.issuer,n.clientId);return{accessToken:h.access_token,idToken:h.id_token,refreshToken:"string"==typeof h.refresh_token?h.refresh_token:void 0,webId:d,dpopKey:o,expiresIn:h.expires_in}},t.registerClient=async function(t,e){var n;if(!e.registrationEndpoint)throw new Error("Dynamic Registration could not be completed because the issuer has no registration endpoint.");if(!Array.isArray(e.idTokenSigningAlgValuesSupported))throw new Error("The OIDC issuer discovery profile is missing the 'id_token_signing_alg_values_supported' value, which is mandatory.");const r=i.determineSigningAlg(e.idTokenSigningAlgValuesSupported,i.PREFERRED_SIGNING_ALG),o={client_name:t.clientName,application_type:"web",redirect_uris:[null===(n=t.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"]},s=await fetch(e.registrationEndpoint.toString(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)});if(s.ok){const e=await s.json();return function(t,e){if(void 0===t.client_id)throw new Error(`Dynamic client registration failed: no client_id has been found on ${JSON.stringify(t)}`);if(e.redirectUrl&&(void 0===t.redirect_uris||t.redirect_uris[0]!==e.redirectUrl.toString()))throw new Error(`Dynamic client registration failed: the returned redirect URIs ${JSON.stringify(t.redirect_uris)} don't match the provided ${JSON.stringify([e.redirectUrl.toString()])}`)}(e,t),{clientId:e.client_id,clientSecret:e.client_secret,idTokenSignedResponseAlg:e.id_token_signed_response_alg,clientType:"dynamic"}}throw 400===s.status&&function(t,e){var i,n,r,o;if("invalid_redirect_uri"===t.error)throw new Error(`Dynamic client registration failed: the provided redirect uri [${null===(i=e.redirectUrl)||void 0===i?void 0:i.toString()}] is invalid - ${null!==(n=t.error_description)&&void 0!==n?n:""}`);if("invalid_client_metadata"===t.error)throw new Error(`Dynamic client registration failed: the provided client metadata ${JSON.stringify(e)} is invalid - ${null!==(r=t.error_description)&&void 0!==r?r:""}`);throw new Error(`Dynamic client registration failed: ${t.error} - ${null!==(o=t.error_description)&&void 0!==o?o:""}`)}(await s.json(),t),new Error(`Dynamic client registration failed: the server returned ${s.status} ${s.statusText} - ${await s.text()}`)},t.removeOidcQueryParam=function(t){const e=new URL(t);return e.searchParams.delete("code"),e.searchParams.delete("state"),e.hash="",e.toString()}}}),Ko=ue({"../node_modules/@inrupt/solid-client-authn-browser/dist/ClientAuthentication.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Jo(),i=Ho(),n=(t,e)=>window.fetch(t,e);t.default=class{constructor(t,r,o,s,a){this.loginHandler=t,this.redirectHandler=r,this.logoutHandler=o,this.sessionInfoManager=s,this.issuerConfigFetcher=a,this.login=async(t,e)=>{var n,r;await this.sessionInfoManager.clear(t.sessionId);const o=(0,i.removeOidcQueryParam)(null!==(n=t.redirectUrl)&&void 0!==n?n:window.location.href);await this.loginHandler.handle({...t,redirectUrl:o,clientName:null!==(r=t.clientName)&&void 0!==r?r:t.clientId,eventEmitter:e})},this.fetch=n,this.logout=async t=>{await this.logoutHandler.handle(t),this.fetch=n},this.getSessionInfo=async t=>this.sessionInfoManager.get(t),this.getAllSessionInfo=async()=>this.sessionInfoManager.getAll(),this.validateCurrentSession=async t=>{const e=await this.sessionInfoManager.get(t);return void 0===e||void 0===e.clientAppId||void 0===e.issuer?null:e},this.handleIncomingRedirect=async(t,i)=>{try{const e=await this.redirectHandler.handle(t,i);return this.fetch=e.fetch.bind(window),this.cleanUrlAfterRedirect(t),{isLoggedIn:e.isLoggedIn,webId:e.webId,sessionId:e.sessionId,expirationDate:e.expirationDate}}catch(n){return this.cleanUrlAfterRedirect(t),void i.emit(e.EVENTS.ERROR,"redirect",n)}}}cleanUrlAfterRedirect(t){const e=new URL(t);e.searchParams.delete("state"),e.searchParams.delete("code"),e.searchParams.delete("id_token"),e.searchParams.delete("access_token"),e.searchParams.delete("error"),e.searchParams.delete("error_description"),window.history.replaceState(null,"",e.toString())}}}}),Wo=ue({"../node_modules/@inrupt/solid-client-authn-browser/dist/login/oidc/OidcLoginHandler.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Jo();function i(t){return"string"==typeof t.oidcIssuer}function n(t){return"string"==typeof t.redirectUrl}t.default=class{constructor(t,e,i,n){this.storageUtility=t,this.oidcHandler=e,this.issuerConfigFetcher=i,this.clientRegistrar=n}async canHandle(t){return i(t)&&n(t)}async handle(t){if(!i(t))throw new e.ConfigurationError(`OidcLoginHandler requires an OIDC issuer: missing property 'oidcIssuer' in ${JSON.stringify(t)}`);if(!n(t))throw new e.ConfigurationError(`OidcLoginHandler requires a redirect URL: missing property 'redirectUrl' in ${JSON.stringify(t)}`);const r=await this.issuerConfigFetcher.fetchConfig(t.oidcIssuer),o=await(0,e.handleRegistration)(t,r,this.storageUtility,this.clientRegistrar),s={issuer:r.issuer,dpop:"dpop"===t.tokenType.toLowerCase(),...t,issuerConfiguration:r,client:o};return this.oidcHandler.handle(s)}}}}),qo=ue({"../node_modules/@inrupt/solid-client-authn-browser/dist/login/oidc/oidcHandlers/AuthorizationCodeWithPkceOidcHandler.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Jo(),i=Ho();t.default=class{constructor(t,e){this.storageUtility=t,this.redirector=e}async canHandle(t){return!!(t.issuerConfiguration.grantTypesSupported&&t.issuerConfiguration.grantTypesSupported.indexOf("authorization_code")>-1)}async handle(t){var n;const r={authority:t.issuer.toString(),client_id:t.client.clientId,client_secret:t.client.clientSecret,redirect_uri:t.redirectUrl.toString(),post_logout_redirect_uri:t.redirectUrl.toString(),response_type:"code",scope:e.DEFAULT_SCOPES,filterProtocolClaims:!0,loadUserInfo:!1,code_verifier:!0,prompt:null!==(n=t.prompt)&&void 0!==n?n:"consent"},o=new i.OidcClient(r),{redirector:s}=this,a=this.storageUtility;try{const e=await o.createSigninRequest();await Promise.all([a.setForUser(e.state._id,{sessionId:t.sessionId}),a.setForUser(t.sessionId,{codeVerifier:e.state._code_verifier,issuer:t.issuer.toString(),redirectUrl:t.redirectUrl,dpop:t.dpop?"true":"false"})]),s.redirect(e.url.toString(),{handleRedirect:t.handleRedirect})}catch(t){console.error(t)}}}}}),Vo=ue({"../node_modules/@inrupt/solid-client-authn-browser/dist/util/urlPath.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.appendToUrlPathname=void 0,t.appendToUrlPathname=function(t,e){const i=new URL(t),n=i.pathname;return i.pathname=`${n}${n.endsWith("/")?"":"/"}${e.startsWith("/")?e.substring(1):e}`,i.toString()}}}),Go=ue({"../node_modules/@inrupt/solid-client-authn-browser/dist/login/oidc/IssuerConfigFetcher.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WELL_KNOWN_OPENID_CONFIG=void 0;var e=Jo(),i=Vo();t.WELL_KNOWN_OPENID_CONFIG=".well-known/openid-configuration";var n={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}},r=class{constructor(t){this.storageUtility=t}static getLocalStorageKey(t){return`issuerConfig:${t}`}async fetchConfig(o){let s;const a=(0,i.appendToUrlPathname)(o,t.WELL_KNOWN_OPENID_CONFIG),c=await window.fetch(a);try{s=function(t){const e={};return Object.keys(t).forEach((i=>{n[i]&&(e[n[i].toKey]=t[i])})),Array.isArray(e.scopesSupported)||(e.scopesSupported=["openid"]),e}(await c.json())}catch(t){throw new e.ConfigurationError(`[${o.toString()}] has an invalid configuration: ${t.message}`)}return await this.storageUtility.set(r.getLocalStorageKey(o),JSON.stringify(s)),s}};t.default=r}}),Xo=ue({"../node_modules/@inrupt/solid-client-authn-browser/dist/sessionInfo/SessionInfoManager.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SessionInfoManager=t.clear=t.getUnauthenticatedSession=void 0;var e=Jo(),i=Bo(),n=Ho();async function r(t,e){await Promise.all([e.deleteAllUserData(t,{secure:!1}),e.deleteAllUserData(t,{secure:!0}),e.delete("clientKey",{secure:!1})]),await(0,n.clearOidcPersistentStorage)()}t.getUnauthenticatedSession=function(){return{isLoggedIn:!1,sessionId:(0,i.v4)(),fetch}},t.clear=r,t.SessionInfoManager=class{constructor(t){this.storageUtility=t}update(t,e){throw new Error("Not Implemented")}async get(t){var i;const n=await this.storageUtility.getForUser(t,"isLoggedIn",{secure:!0}),r=await this.storageUtility.getForUser(t,"webId",{secure:!0}),o=await this.storageUtility.getForUser(t,"clientId",{secure:!1}),s=await this.storageUtility.getForUser(t,"clientSecret",{secure:!1}),a=await this.storageUtility.getForUser(t,"redirectUrl",{secure:!1}),c=await this.storageUtility.getForUser(t,"refreshToken",{secure:!0}),l=await this.storageUtility.getForUser(t,"issuer",{secure:!1}),u=null!==(i=await this.storageUtility.getForUser(t,"tokenType",{secure:!1}))&&void 0!==i?i:"DPoP";if(!(0,e.isSupportedTokenType)(u))throw new Error(`Tokens of type [${u}] are not supported.`);if(void 0!==o||void 0!==n||void 0!==r||void 0!==c)return{sessionId:t,webId:r,isLoggedIn:"true"===n,redirectUrl:a,refreshToken:c,issuer:l,clientAppId:o,clientAppSecret:s,tokenType:u}}async getAll(){throw new Error("Not implemented")}async clear(t){return r(t,this.storageUtility)}async register(t){throw new Error("Not implemented")}async getRegisteredSessionIdAll(){throw new Error("Not implemented")}async clearAll(){throw new Error("Not implemented")}}}}),Yo=ue({"../node_modules/@inrupt/solid-client-authn-browser/dist/login/oidc/incomingRedirectHandler/FallbackRedirectHandler.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.FallbackRedirectHandler=void 0;var e=Xo();t.FallbackRedirectHandler=class{async canHandle(t){try{return new URL(t),!0}catch(e){throw new Error(`[${t}] is not a valid URL, and cannot be used as a redirect URL: ${e}`)}}async handle(t){return(0,e.getUnauthenticatedSession)()}}}}),Zo=ue({"../node_modules/@inrupt/solid-client-authn-browser/dist/logout/GeneralLogoutHandler.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{constructor(t){this.sessionInfoManager=t}async canHandle(){return!0}async handle(t){await this.sessionInfoManager.clear(t)}}}}),Qo=ue({"../node_modules/@inrupt/solid-client-authn-browser/dist/login/oidc/incomingRedirectHandler/AuthCodeRedirectHandler.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.AuthCodeRedirectHandler=void 0;var e=Jo(),i=Ho();t.AuthCodeRedirectHandler=class{constructor(t,e,i,n,r){this.storageUtility=t,this.sessionInfoManager=e,this.issuerConfigFetcher=i,this.clientRegistrar=n,this.tokerRefresher=r}async canHandle(t){try{const e=new URL(t);return null!==e.searchParams.get("code")&&null!==e.searchParams.get("state")}catch(e){throw new Error(`[${t}] is not a valid URL, and cannot be used as a redirect URL: ${e}`)}}async handle(t,n){if(!await this.canHandle(t))throw new Error(`AuthCodeRedirectHandler cannot handle [${t}]: it is missing one of [code, state].`);const r=new URL(t),o=r.searchParams.get("state"),s=await this.storageUtility.getForUser(o,"sessionId",{errorIfNull:!0}),{issuerConfig:a,codeVerifier:c,redirectUrl:l,dpop:u}=await(0,e.loadOidcContextFromStorage)(s,this.storageUtility,this.issuerConfigFetcher);if(void 0===c)throw new Error(`The code verifier for session ${s} is missing from storage.`);if(void 0===l)throw new Error(`The redirect URL for session ${s} is missing from storage.`);const h=await this.clientRegistrar.getClient({sessionId:s},a);let d;const f=Date.now();let p;u?(d=await(0,i.getDpopToken)(a,h,{grantType:"authorization_code",code:r.searchParams.get("code"),codeVerifier:c,redirectUrl:l}),window.localStorage.removeItem(`oidc.${o}`)):d=await(0,i.getBearerToken)(r.toString()),void 0!==d.refreshToken&&(p={sessionId:s,refreshToken:d.refreshToken,tokenRefresher:this.tokerRefresher});const v=await(0,e.buildAuthenticatedFetch)(fetch,d.accessToken,{dpopKey:d.dpopKey,refreshOptions:p,eventEmitter:n,expiresIn:d.expiresIn});await this.storageUtility.setForUser(s,{webId:d.webId,isLoggedIn:"true"},{secure:!0}),r.searchParams.delete("code"),await this.storageUtility.setForUser(s,{redirectUrl:r.toString()},{secure:!1});const g=await this.sessionInfoManager.get(s);if(!g)throw new Error(`Could not retrieve session: [${s}].`);return Object.assign(g,{fetch:v,expirationDate:"number"==typeof d.expiresIn?f+1e3*d.expiresIn:null})}}}}),ts=ue({"../node_modules/@inrupt/solid-client-authn-browser/dist/login/oidc/AggregateRedirectHandler.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Jo();t.default=class extends e.AggregateHandler{constructor(t){super(t)}}}}),es=ue({"../node_modules/@inrupt/solid-client-authn-browser/dist/storage/BrowserStorage.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{get storage(){return window.localStorage}async get(t){return this.storage.getItem(t)||void 0}async set(t,e){this.storage.setItem(t,e)}async delete(t){this.storage.removeItem(t)}}}}),is=ue({"../node_modules/@inrupt/solid-client-authn-browser/dist/login/oidc/Redirector.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{redirect(t,e){e&&e.handleRedirect?e.handleRedirect(t):e&&e.redirectByReplacingState?window.history.replaceState({},"",t):window.location.href=t}}}}),ns=ue({"../node_modules/@inrupt/solid-client-authn-browser/dist/login/oidc/ClientRegistrar.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Ho();t.default=class{constructor(t){this.storageUtility=t}async getClient(t,i){const[n,r]=await Promise.all([this.storageUtility.getForUser(t.sessionId,"clientId",{secure:!1}),this.storageUtility.getForUser(t.sessionId,"clientSecret",{secure:!1})]);if(n)return{clientId:n,clientSecret:r,clientType:"dynamic"};try{const n=await(0,e.registerClient)(t,i),r={clientId:n.clientId};return n.clientSecret&&(r.clientSecret=n.clientSecret),n.idTokenSignedResponseAlg&&(r.idTokenSignedResponseAlg=n.idTokenSignedResponseAlg),await this.storageUtility.setForUser(t.sessionId,r,{secure:!1}),n}catch(t){throw new Error(`Client registration failed: [${t}]`)}}}}}),rs=ue({"../node_modules/@inrupt/solid-client-authn-browser/dist/login/oidc/incomingRedirectHandler/ErrorOidcHandler.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorOidcHandler=void 0;var e=Jo(),i=Xo();t.ErrorOidcHandler=class{async canHandle(t){try{return new URL(t).searchParams.has("error")}catch(e){throw new Error(`[${t}] is not a valid URL, and cannot be used as a redirect URL: ${e}`)}}async handle(t,n){if(void 0!==n){const i=new URL(t),r=i.searchParams.get("error"),o=i.searchParams.get("error_description");n.emit(e.EVENTS.ERROR,r,o)}return(0,i.getUnauthenticatedSession)()}}}}),os=ue({"../node_modules/@inrupt/solid-client-authn-browser/dist/login/oidc/refresh/TokenRefresher.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Jo(),i=Ho();t.default=class{constructor(t,e,i){this.storageUtility=t,this.issuerConfigFetcher=e,this.clientRegistrar=i}async refresh(t,n,r,o){const s=await(0,e.loadOidcContextFromStorage)(t,this.storageUtility,this.issuerConfigFetcher),a=await this.clientRegistrar.getClient({sessionId:t},s.issuerConfig);if(void 0===n)throw new Error(`Session [${t}] has no refresh token to allow it to refresh its access token.`);if(s.dpop&&void 0===r)throw new Error(`For session [${t}], the key bound to the DPoP access token must be provided to refresh said access token.`);const c=await(0,i.refresh)(n,s.issuerConfig,a,r);return void 0!==c.refreshToken&&(null==o||o.emit(e.EVENTS.NEW_REFRESH_TOKEN,c.refreshToken),await this.storageUtility.setForUser(t,{refreshToken:c.refreshToken})),c}}}}),ss=ue({"../node_modules/@inrupt/solid-client-authn-browser/dist/dependencies.js"(t){var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.getClientAuthenticationWithDependencies=void 0;var i=Jo(),n=e($o()),r=e(Ko()),o=e(Wo()),s=e(qo()),a=e(Go()),c=Yo(),l=e(Zo()),u=Xo(),h=Qo(),d=e(ts()),f=e(es()),p=e(is()),v=e(ns()),g=rs(),m=e(os());t.getClientAuthenticationWithDependencies=function(t){const e=new i.InMemoryStorage,w=t.secureStorage||e,b=t.insecureStorage||new f.default,y=new n.default(w,b),x=new a.default(y),k=new v.default(y),E=new u.SessionInfoManager(y),S=new m.default(y,x,k),F=new o.default(y,new s.default(y,new p.default),x,k),A=new d.default([new g.ErrorOidcHandler,new h.AuthCodeRedirectHandler(y,E,x,k,S),new c.FallbackRedirectHandler]);return new r.default(F,A,new l.default(E),E,x)}}}),as=ue({"../node_modules/@inrupt/solid-client-authn-browser/dist/constant.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.KEY_CURRENT_URL=t.KEY_CURRENT_SESSION=void 0;var e=Jo();t.KEY_CURRENT_SESSION=`${e.SOLID_CLIENT_AUTHN_KEY_PREFIX}currentSession`,t.KEY_CURRENT_URL=`${e.SOLID_CLIENT_AUTHN_KEY_PREFIX}currentUrl`}}),cs=ue({"../node_modules/@inrupt/solid-client-authn-browser/dist/Session.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Session=t.silentlyAuthenticate=void 0;var e=ve(),i=Jo(),n=Bo(),r=ss(),o=as();async function s(t,e,i){var n;const r=await e.validateCurrentSession(t);return null!==r&&(window.localStorage.setItem(o.KEY_CURRENT_URL,window.location.href),await e.login({sessionId:t,prompt:"none",oidcIssuer:r.issuer,redirectUrl:r.redirectUrl,clientId:r.clientAppId,clientSecret:r.clientAppSecret,tokenType:null!==(n=r.tokenType)&&void 0!==n?n:"DPoP"},i),!0)}t.silentlyAuthenticate=s,t.Session=class extends e.EventEmitter{constructor(t={},e){super(),this.tokenRequestInProgress=!1,this.login=async t=>{var e;return await this.clientAuthentication.login({sessionId:this.info.sessionId,...t,tokenType:null!==(e=t.tokenType)&&void 0!==e?e:"DPoP"},this),new Promise((()=>{}))},this.fetch=async(t,e)=>this.clientAuthentication.fetch(t,e),this.internalLogout=async t=>{window.localStorage.removeItem(o.KEY_CURRENT_SESSION),await this.clientAuthentication.logout(this.info.sessionId),this.info.isLoggedIn=!1,t&&this.emit(i.EVENTS.LOGOUT)},this.logout=async()=>this.internalLogout(!0),this.handleIncomingRedirect=async(t={})=>{var e;if(this.info.isLoggedIn)return this.info;if(this.tokenRequestInProgress)return;const n="string"==typeof t?{url:t}:t,r=null!==(e=n.url)&&void 0!==e?e:window.location.href;this.tokenRequestInProgress=!0;const a=await this.clientAuthentication.handleIncomingRedirect(r,this);if(function(t){return!!(null==t?void 0:t.isLoggedIn)}(a)){this.setSessionInfo(a);const t=window.localStorage.getItem(o.KEY_CURRENT_URL);null===t?this.emit(i.EVENTS.LOGIN):(window.localStorage.removeItem(o.KEY_CURRENT_URL),this.emit(i.EVENTS.SESSION_RESTORED,t))}else if(!0===n.restorePreviousSession){const t=window.localStorage.getItem(o.KEY_CURRENT_SESSION);if(null!==t&&await s(t,this.clientAuthentication,this))return new Promise((()=>{}))}return this.tokenRequestInProgress=!1,a},this.clientAuthentication=t.clientAuthentication?t.clientAuthentication:(0,r.getClientAuthenticationWithDependencies)(t.secureStorage&&t.insecureStorage?{secureStorage:t.secureStorage,insecureStorage:t.insecureStorage}:{}),this.info=t.sessionInfo?{sessionId:t.sessionInfo.sessionId,isLoggedIn:!1,webId:t.sessionInfo.webId}:{sessionId:null!=e?e:(0,n.v4)(),isLoggedIn:!1},this.on(i.EVENTS.LOGIN,(()=>window.localStorage.setItem(o.KEY_CURRENT_SESSION,this.info.sessionId))),this.on(i.EVENTS.SESSION_EXPIRED,(()=>this.internalLogout(!1))),this.on(i.EVENTS.ERROR,(()=>this.internalLogout(!1)))}onLogin(t){this.on(i.EVENTS.LOGIN,t)}onLogout(t){this.on(i.EVENTS.LOGOUT,t)}onError(t){this.on(i.EVENTS.ERROR,t)}onSessionRestore(t){this.on(i.EVENTS.SESSION_RESTORED,t)}onSessionExpiration(t){this.on(i.EVENTS.SESSION_EXPIRED,t)}setSessionInfo(t){this.info.isLoggedIn=t.isLoggedIn,this.info.webId=t.webId,this.info.sessionId=t.sessionId,this.info.expirationDate=t.expirationDate,this.on(i.EVENTS.SESSION_EXTENDED,(t=>{this.info.expirationDate=Date.now()+1e3*t}))}}}}),ls=ue({"../node_modules/@inrupt/solid-client-authn-browser/dist/defaultSession.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.onSessionRestore=t.onLogout=t.onLogin=t.handleIncomingRedirect=t.logout=t.login=t.fetch=t.getDefaultSession=void 0;var e,i=cs();function n(){return void 0===e&&(e=new i.Session),e}t.getDefaultSession=n,t.fetch=(...t)=>n().fetch(...t),t.login=(...t)=>n().login(...t),t.logout=(...t)=>n().logout(...t),t.handleIncomingRedirect=(...t)=>n().handleIncomingRedirect(...t),t.onLogin=(...t)=>n().onLogin(...t),t.onLogout=(...t)=>n().onLogout(...t),t.onSessionRestore=(...t)=>n().onSessionRestore(...t)}}),us=ue({"../node_modules/@inrupt/solid-client-authn-browser/dist/index.js"(t){var e=t&&t.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(e,i);r&&!("get"in r?!e.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,n,r)}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),i=t&&t.__exportStar||function(t,i){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(i,n)||e(i,t,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.InMemoryStorage=t.ConfigurationError=t.NotImplementedError=t.getClientAuthenticationWithDependencies=t.Session=void 0;var n=cs();Object.defineProperty(t,"Session",{enumerable:!0,get:function(){return n.Session}});var r=ss();Object.defineProperty(t,"getClientAuthenticationWithDependencies",{enumerable:!0,get:function(){return r.getClientAuthenticationWithDependencies}}),i(ls(),t);var o=Jo();Object.defineProperty(t,"NotImplementedError",{enumerable:!0,get:function(){return o.NotImplementedError}}),Object.defineProperty(t,"ConfigurationError",{enumerable:!0,get:function(){return o.ConfigurationError}}),Object.defineProperty(t,"InMemoryStorage",{enumerable:!0,get:function(){return o.InMemoryStorage}})}}),hs=ue({"../node_modules/rdf-canonize/lib/IdentifierIssuer.js"(t,e){e.exports=class t{constructor(t,e=new Map,i=0){this.prefix=t,this._existing=e,this.counter=i}clone(){const{prefix:e,_existing:i,counter:n}=this;return new t(e,new Map(i),n)}getId(t){const e=t&&this._existing.get(t);if(e)return e;const i=this.prefix+this.counter;return this.counter++,t&&this._existing.set(t,i),i}hasId(t){return this._existing.has(t)}getOldIds(){return[...this._existing.keys()]}}}}),ds=ue({"../node_modules/setimmediate/setImmediate.js"(t){!function(t){if(!t.setImmediate){var e,i,n,r,o,s=1,a={},c=!1,l=t.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(t);u=u&&u.setTimeout?u:t,"[object process]"==={}.toString.call(t.process)?e=function(t){process.nextTick((function(){d(t)}))}:function(){if(t.postMessage&&!t.importScripts){var e=!0,i=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=i,e}}()?(r="setImmediate$"+Math.random()+"$",o=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(r)&&d(+e.data.slice(r.length))},t.addEventListener?t.addEventListener("message",o,!1):t.attachEvent("onmessage",o),e=function(e){t.postMessage(r+e,"*")}):t.MessageChannel?((n=new MessageChannel).port1.onmessage=function(t){d(t.data)},e=function(t){n.port2.postMessage(t)}):l&&"onreadystatechange"in l.createElement("script")?(i=l.documentElement,e=function(t){var e=l.createElement("script");e.onreadystatechange=function(){d(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):e=function(t){setTimeout(d,0,t)},u.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var i=new Array(arguments.length-1),n=0;n<i.length;n++)i[n]=arguments[n+1];var r={callback:t,args:i};return a[s]=r,e(s),s++},u.clearImmediate=h}function h(t){delete a[t]}function d(t){if(c)setTimeout(d,0,t);else{var e=a[t];if(e){c=!0;try{!function(t){var e=t.callback,i=t.args;switch(i.length){case 0:e();break;case 1:e(i[0]);break;case 2:e(i[0],i[1]);break;case 3:e(i[0],i[1],i[2]);break;default:e.apply(void 0,i)}}(e)}finally{h(t),c=!1}}}}}("undefined"==typeof self?"undefined"==typeof global?t:global:self)}}),fs=ue({"../node_modules/rdf-canonize/lib/MessageDigest-browser.js"(t,e){ds();var i=self.crypto||self.msCrypto;e.exports=class{constructor(t){if(!i||!i.subtle)throw new Error("crypto.subtle not found.");if("sha256"===t)this.algorithm={name:"SHA-256"};else{if("sha1"!==t)throw new Error(`Unsupported algorithm "${t}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(t){this._content+=t}async digest(){const t=(new TextEncoder).encode(this._content),e=new Uint8Array(await i.subtle.digest(this.algorithm,t));let n="";for(let t=0;t<e.length;++t)n+=e[t].toString(16).padStart(2,"0");return n}}}}),ps=ue({"../node_modules/rdf-canonize/lib/Permuter.js"(t,e){e.exports=class{constructor(t){this.current=t.sort(),this.done=!1,this.dir=new Map;for(let e=0;e<t.length;++e)this.dir.set(t[e],!0)}hasNext(){return!this.done}next(){const{current:t,dir:e}=this,i=t.slice();let n=null,r=0;const o=t.length;for(let i=0;i<o;++i){const s=t[i],a=e.get(s);(null===n||s>n)&&(a&&i>0&&s>t[i-1]||!a&&i<o-1&&s>t[i+1])&&(n=s,r=i)}if(null===n)this.done=!0;else{const i=e.get(n)?r-1:r+1;t[r]=t[i],t[i]=n;for(const i of t)i>n&&e.set(i,!e.get(i))}return i}}}}),vs=ue({"../node_modules/rdf-canonize/lib/NQuads.js"(t,e){var i="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",n="http://www.w3.org/2001/XMLSchema#string",r="NamedNode",o="BlankNode",s="Literal",a="DefaultGraph",c={};(()=>{const t="(?:<([^:]+:[^>]*)>)",e="A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_",i=e+"0-9-·̀-ͯ‿-⁀",n="(_:(?:["+e+"0-9])(?:(?:["+i+".])*(?:["+i+"]))?)",r="[ \\t]+",o="[ \\t]*",s="(?:"+t+"|"+n+")"+r,a=t+r,l="(?:"+t+"|"+n+'|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^'+t+")|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))"+o,u="(?:\\.|(?:(?:"+t+"|"+n+")"+o+"\\.))";c.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,c.empty=new RegExp("^"+o+"$"),c.quad=new RegExp("^"+o+s+a+l+u+o+"$")})(),e.exports=class t{static parse(t){const e=[],l={},h=t.split(c.eoln);let d=0;for(const t of h){if(d++,c.empty.test(t))continue;const h=t.match(c.quad);if(null===h)throw new Error("N-Quads parse error on line "+d+".");const v={subject:null,predicate:null,object:null,graph:null};if(v.subject=void 0!==h[1]?{termType:r,value:h[1]}:{termType:o,value:h[2]},v.predicate={termType:r,value:h[3]},void 0!==h[4]?v.object={termType:r,value:h[4]}:void 0!==h[5]?v.object={termType:o,value:h[5]}:(v.object={termType:s,value:void 0,datatype:{termType:r}},void 0!==h[7]?v.object.datatype.value=h[7]:void 0!==h[8]?(v.object.datatype.value=i,v.object.language=h[8]):v.object.datatype.value=n,v.object.value=h[6].replace(u,(function(t,e,i,n){if(e)switch(e){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(i)return String.fromCharCode(parseInt(i,16));if(n)throw new Error("Unsupported U escape")}))),v.graph=void 0!==h[9]?{termType:r,value:h[9]}:void 0!==h[10]?{termType:o,value:h[10]}:{termType:a,value:""},v.graph.value in l){let t=!0;const i=l[v.graph.value];for(const e of i)if((f=e).subject.termType===(p=v).subject.termType&&f.object.termType===p.object.termType&&f.subject.value===p.subject.value&&f.predicate.value===p.predicate.value&&f.object.value===p.object.value&&(f.object.termType!==s||f.object.datatype.termType===p.object.datatype.termType&&f.object.language===p.object.language&&f.object.datatype.value===p.object.datatype.value)){t=!1;break}t&&(i.push(v),e.push(v))}else l[v.graph.value]=[v],e.push(v)}var f,p;return e}static serialize(e){Array.isArray(e)||(e=t.legacyDatasetToQuads(e));const i=[];for(const n of e)i.push(t.serializeQuad(n));return i.sort().join("")}static serializeQuadComponents(t,e,s,a){let c="";return c+=t.termType===r?`<${t.value}>`:`${t.value}`,c+=` <${e.value}> `,s.termType===r?c+=`<${s.value}>`:s.termType===o?c+=s.value:(c+=`"${function(t){return t.replace(l,(function(t){switch(t){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}}))}(s.value)}"`,s.datatype.value===i?s.language&&(c+=`@${s.language}`):s.datatype.value!==n&&(c+=`^^<${s.datatype.value}>`)),a.termType===r?c+=` <${a.value}>`:a.termType===o&&(c+=` ${a.value}`),c+=" .\n",c}static serializeQuad(e){return t.serializeQuadComponents(e.subject,e.predicate,e.object,e.graph)}static legacyDatasetToQuads(t){const e=[],c={"blank node":o,IRI:r,literal:s};for(const l in t)t[l].forEach((t=>{const u={};for(const e in t){const o=t[e],a={termType:c[o.type],value:o.value};a.termType===s&&(a.datatype={termType:r},"datatype"in o&&(a.datatype.value=o.datatype),"language"in o?("datatype"in o||(a.datatype.value=i),a.language=o.language):"datatype"in o||(a.datatype.value=n)),u[e]=a}u.graph="@default"===l?{termType:a,value:""}:{termType:l.startsWith("_:")?o:r,value:l},e.push(u)}));return e}};var l=/["\\\n\r]/g,u=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g}}),gs=ue({"../node_modules/rdf-canonize/lib/URDNA2015.js"(t,e){var i=hs(),n=fs(),r=ps(),o=vs();function s(t,e){return t.hash<e.hash?-1:t.hash>e.hash?1:0}e.exports=class{constructor({createMessageDigest:t=(()=>new n("sha256")),maxDeepIterations:e=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new i("_:c14n"),this.createMessageDigest=t,this.maxDeepIterations=e,this.quads=null,this.deepIterations=null}async main(t){this.deepIterations=new Map,this.quads=t;for(const e of t)this._addBlankNodeQuadInfo({quad:e,component:e.subject}),this._addBlankNodeQuadInfo({quad:e,component:e.object}),this._addBlankNodeQuadInfo({quad:e,component:e.graph});const e=new Map,n=[...this.blankNodeInfo.keys()];let r=0;for(const t of n)++r%100==0&&await this._yield(),await this._hashAndTrackBlankNode({id:t,hashToBlankNodes:e});const a=[...e.keys()].sort(),c=[];for(const t of a){const i=e.get(t);i.length>1?c.push(i):this.canonicalIssuer.getId(i[0])}for(const t of c){const e=[];for(const n of t){if(this.canonicalIssuer.hasId(n))continue;const t=new i("_:b");t.getId(n);const r=await this.hashNDegreeQuads(n,t);e.push(r)}e.sort(s);for(const t of e){const e=t.issuer.getOldIds();for(const t of e)this.canonicalIssuer.getId(t)}}const l=[];for(const t of this.quads){const e=o.serializeQuadComponents(this._componentWithCanonicalId(t.subject),t.predicate,this._componentWithCanonicalId(t.object),this._componentWithCanonicalId(t.graph));l.push(e)}return l.sort(),l.join("")}async hashFirstDegreeQuads(t){const e=[],i=this.blankNodeInfo.get(t),n=i.quads;for(const i of n){const n={subject:null,predicate:i.predicate,object:null,graph:null};n.subject=this.modifyFirstDegreeComponent(t,i.subject,"subject"),n.object=this.modifyFirstDegreeComponent(t,i.object,"object"),n.graph=this.modifyFirstDegreeComponent(t,i.graph,"graph"),e.push(o.serializeQuad(n))}e.sort();const r=this.createMessageDigest();for(const t of e)r.update(t);return i.hash=await r.digest(),i.hash}async hashRelatedBlankNode(t,e,i,n){let r;r=this.canonicalIssuer.hasId(t)?this.canonicalIssuer.getId(t):i.hasId(t)?i.getId(t):this.blankNodeInfo.get(t).hash;const o=this.createMessageDigest();return o.update(n),"g"!==n&&o.update(this.getRelatedPredicate(e)),o.update(r),o.digest()}async hashNDegreeQuads(t,e){const i=this.deepIterations.get(t)||0;if(i>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(t,i+1);const n=this.createMessageDigest(),o=await this.createHashToRelated(t,e),s=[...o.keys()].sort();for(const t of s){n.update(t);let i,s="";const a=new r(o.get(t));let c=0;for(;a.hasNext();){const t=a.next();++c%3==0&&await this._yield();let n=e.clone(),r="";const o=[];let l=!1;for(const e of t)if(this.canonicalIssuer.hasId(e)?r+=this.canonicalIssuer.getId(e):(n.hasId(e)||o.push(e),r+=n.getId(e)),0!==s.length&&r>s){l=!0;break}if(!l){for(const t of o){const e=await this.hashNDegreeQuads(t,n);if(r+=n.getId(t),r+=`<${e.hash}>`,n=e.issuer,0!==s.length&&r>s){l=!0;break}}l||(0===s.length||r<s)&&(s=r,i=n)}}n.update(s),e=i}return{hash:await n.digest(),issuer:e}}modifyFirstDegreeComponent(t,e){return"BlankNode"!==e.termType?e:{termType:"BlankNode",value:e.value===t?"_:a":"_:z"}}getRelatedPredicate(t){return`<${t.predicate.value}>`}async createHashToRelated(t,e){const i=new Map,n=this.blankNodeInfo.get(t).quads;let r=0;for(const o of n)++r%100==0&&await this._yield(),await Promise.all([this._addRelatedBlankNodeHash({quad:o,component:o.subject,position:"s",id:t,issuer:e,hashToRelated:i}),this._addRelatedBlankNodeHash({quad:o,component:o.object,position:"o",id:t,issuer:e,hashToRelated:i}),this._addRelatedBlankNodeHash({quad:o,component:o.graph,position:"g",id:t,issuer:e,hashToRelated:i})]);return i}async _hashAndTrackBlankNode({id:t,hashToBlankNodes:e}){const i=await this.hashFirstDegreeQuads(t),n=e.get(i);n?n.push(t):e.set(i,[t])}_addBlankNodeQuadInfo({quad:t,component:e}){if("BlankNode"!==e.termType)return;const i=e.value,n=this.blankNodeInfo.get(i);n?n.quads.add(t):this.blankNodeInfo.set(i,{quads:new Set([t]),hash:null})}async _addRelatedBlankNodeHash({quad:t,component:e,position:i,id:n,issuer:r,hashToRelated:o}){if("BlankNode"!==e.termType||e.value===n)return;const s=e.value,a=await this.hashRelatedBlankNode(s,t,r,i),c=o.get(a);c?c.push(s):o.set(a,[s])}_componentWithCanonicalId(t){return"BlankNode"!==t.termType||t.value.startsWith(this.canonicalIssuer.prefix)?t:{termType:"BlankNode",value:this.canonicalIssuer.getId(t.value)}}async _yield(){return new Promise((t=>setImmediate(t)))}}}}),ms=ue({"../node_modules/rdf-canonize/lib/URGNA2012.js"(t,e){var i=fs(),n=gs();e.exports=class extends n{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new i("sha1")}modifyFirstDegreeComponent(t,e,i){return"BlankNode"!==e.termType?e:"graph"===i?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:e.value===t?"_:a":"_:z"}}getRelatedPredicate(t){return t.predicate.value}async createHashToRelated(t,e){const i=new Map,n=this.blankNodeInfo.get(t).quads;let r=0;for(const o of n){let n,s;if("BlankNode"===o.subject.termType&&o.subject.value!==t)s=o.subject.value,n="p";else{if("BlankNode"!==o.object.termType||o.object.value===t)continue;s=o.object.value,n="r"}++r%100==0&&await this._yield();const a=await this.hashRelatedBlankNode(s,o,e,n),c=i.get(a);c?c.push(s):i.set(a,[s])}return i}}}}),ws=ue({"../node_modules/rdf-canonize/lib/URDNA2015Sync.js"(t,e){var i=hs(),n=fs(),r=ps(),o=vs();function s(t,e){return t.hash<e.hash?-1:t.hash>e.hash?1:0}e.exports=class{constructor({createMessageDigest:t=(()=>new n("sha256")),maxDeepIterations:e=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new i("_:c14n"),this.createMessageDigest=t,this.maxDeepIterations=e,this.quads=null,this.deepIterations=null}main(t){this.deepIterations=new Map,this.quads=t;for(const e of t)this._addBlankNodeQuadInfo({quad:e,component:e.subject}),this._addBlankNodeQuadInfo({quad:e,component:e.object}),this._addBlankNodeQuadInfo({quad:e,component:e.graph});const e=new Map,n=[...this.blankNodeInfo.keys()];for(const t of n)this._hashAndTrackBlankNode({id:t,hashToBlankNodes:e});const r=[...e.keys()].sort(),a=[];for(const t of r){const i=e.get(t);i.length>1?a.push(i):this.canonicalIssuer.getId(i[0])}for(const t of a){const e=[];for(const n of t){if(this.canonicalIssuer.hasId(n))continue;const t=new i("_:b");t.getId(n);const r=this.hashNDegreeQuads(n,t);e.push(r)}e.sort(s);for(const t of e){const e=t.issuer.getOldIds();for(const t of e)this.canonicalIssuer.getId(t)}}const c=[];for(const t of this.quads){const e=o.serializeQuadComponents(this._componentWithCanonicalId({component:t.subject}),t.predicate,this._componentWithCanonicalId({component:t.object}),this._componentWithCanonicalId({component:t.graph}));c.push(e)}return c.sort(),c.join("")}hashFirstDegreeQuads(t){const e=[],i=this.blankNodeInfo.get(t),n=i.quads;for(const i of n){const n={subject:null,predicate:i.predicate,object:null,graph:null};n.subject=this.modifyFirstDegreeComponent(t,i.subject,"subject"),n.object=this.modifyFirstDegreeComponent(t,i.object,"object"),n.graph=this.modifyFirstDegreeComponent(t,i.graph,"graph"),e.push(o.serializeQuad(n))}e.sort();const r=this.createMessageDigest();for(const t of e)r.update(t);return i.hash=r.digest(),i.hash}hashRelatedBlankNode(t,e,i,n){let r;r=this.canonicalIssuer.hasId(t)?this.canonicalIssuer.getId(t):i.hasId(t)?i.getId(t):this.blankNodeInfo.get(t).hash;const o=this.createMessageDigest();return o.update(n),"g"!==n&&o.update(this.getRelatedPredicate(e)),o.update(r),o.digest()}hashNDegreeQuads(t,e){const i=this.deepIterations.get(t)||0;if(i>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(t,i+1);const n=this.createMessageDigest(),o=this.createHashToRelated(t,e),s=[...o.keys()].sort();for(const t of s){n.update(t);let i,s="";const a=new r(o.get(t));for(;a.hasNext();){const t=a.next();let n=e.clone(),r="";const o=[];let c=!1;for(const e of t)if(this.canonicalIssuer.hasId(e)?r+=this.canonicalIssuer.getId(e):(n.hasId(e)||o.push(e),r+=n.getId(e)),0!==s.length&&r>s){c=!0;break}if(!c){for(const t of o){const e=this.hashNDegreeQuads(t,n);if(r+=n.getId(t),r+=`<${e.hash}>`,n=e.issuer,0!==s.length&&r>s){c=!0;break}}c||(0===s.length||r<s)&&(s=r,i=n)}}n.update(s),e=i}return{hash:n.digest(),issuer:e}}modifyFirstDegreeComponent(t,e){return"BlankNode"!==e.termType?e:{termType:"BlankNode",value:e.value===t?"_:a":"_:z"}}getRelatedPredicate(t){return`<${t.predicate.value}>`}createHashToRelated(t,e){const i=new Map,n=this.blankNodeInfo.get(t).quads;for(const r of n)this._addRelatedBlankNodeHash({quad:r,component:r.subject,position:"s",id:t,issuer:e,hashToRelated:i}),this._addRelatedBlankNodeHash({quad:r,component:r.object,position:"o",id:t,issuer:e,hashToRelated:i}),this._addRelatedBlankNodeHash({quad:r,component:r.graph,position:"g",id:t,issuer:e,hashToRelated:i});return i}_hashAndTrackBlankNode({id:t,hashToBlankNodes:e}){const i=this.hashFirstDegreeQuads(t),n=e.get(i);n?n.push(t):e.set(i,[t])}_addBlankNodeQuadInfo({quad:t,component:e}){if("BlankNode"!==e.termType)return;const i=e.value,n=this.blankNodeInfo.get(i);n?n.quads.add(t):this.blankNodeInfo.set(i,{quads:new Set([t]),hash:null})}_addRelatedBlankNodeHash({quad:t,component:e,position:i,id:n,issuer:r,hashToRelated:o}){if("BlankNode"!==e.termType||e.value===n)return;const s=e.value,a=this.hashRelatedBlankNode(s,t,r,i),c=o.get(a);c?c.push(s):o.set(a,[s])}_componentWithCanonicalId({component:t}){return"BlankNode"!==t.termType||t.value.startsWith(this.canonicalIssuer.prefix)?t:{termType:"BlankNode",value:this.canonicalIssuer.getId(t.value)}}}}}),bs=ue({"../node_modules/rdf-canonize/lib/URGNA2012Sync.js"(t,e){var i=fs(),n=ws();e.exports=class extends n{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new i("sha1")}modifyFirstDegreeComponent(t,e,i){return"BlankNode"!==e.termType?e:"graph"===i?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:e.value===t?"_:a":"_:z"}}getRelatedPredicate(t){return t.predicate.value}createHashToRelated(t,e){const i=new Map,n=this.blankNodeInfo.get(t).quads;for(const r of n){let n,o;if("BlankNode"===r.subject.termType&&r.subject.value!==t)o=r.subject.value,n="p";else{if("BlankNode"!==r.object.termType||r.object.value===t)continue;o=r.object.value,n="r"}const s=this.hashRelatedBlankNode(o,r,e,n),a=i.get(s);a?a.push(o):i.set(s,[o])}return i}}}}),ys=ue({"(disabled):rdf-canonize-native"(){}}),xs=ue({"../node_modules/rdf-canonize/lib/index.js"(t){var e,i=gs(),n=ms(),r=ws(),o=bs();try{e=ys()}catch(t){}t.NQuads=vs(),t.IdentifierIssuer=hs(),t._rdfCanonizeNative=function(t){return t&&(e=t),e},t.canonize=async function(r,o){if(Array.isArray(r)||(r=t.NQuads.legacyDatasetToQuads(r)),o.useNative){if(!e)throw new Error("rdf-canonize-native not available");if(o.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return new Promise(((t,i)=>e.canonize(r,o,((e,n)=>e?i(e):t(n)))))}if("URDNA2015"===o.algorithm)return new i(o).main(r);if("URGNA2012"===o.algorithm){if(o.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new n(o).main(r)}if(!("algorithm"in o))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+o.algorithm)},t._canonizeSync=function(i,n){if(Array.isArray(i)||(i=t.NQuads.legacyDatasetToQuads(i)),n.useNative){if(!e)throw new Error("rdf-canonize-native not available");if(n.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return e.canonizeSync(i,n)}if("URDNA2015"===n.algorithm)return new r(n).main(i);if("URGNA2012"===n.algorithm){if(n.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new o(n).main(i)}if(!("algorithm"in n))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+n.algorithm)}}}),ks=ue({"../node_modules/rdf-canonize/index.js"(t,e){e.exports=xs()}}),Es=ue({"../node_modules/jsonld/lib/types.js"(t,e){var i={};e.exports=i,i.isArray=Array.isArray,i.isBoolean=t=>"boolean"==typeof t||"[object Boolean]"===Object.prototype.toString.call(t),i.isDouble=t=>i.isNumber(t)&&(-1!==String(t).indexOf(".")||Math.abs(t)>=1e21),i.isEmptyObject=t=>i.isObject(t)&&0===Object.keys(t).length,i.isNumber=t=>"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t),i.isNumeric=t=>!isNaN(parseFloat(t))&&isFinite(t),i.isObject=t=>"[object Object]"===Object.prototype.toString.call(t),i.isString=t=>"string"==typeof t||"[object String]"===Object.prototype.toString.call(t),i.isUndefined=t=>void 0===t}}),Ss=ue({"../node_modules/jsonld/lib/graphTypes.js"(t,e){var i=Es(),n={};e.exports=n,n.isSubject=t=>!(!i.isObject(t)||"@value"in t||"@set"in t||"@list"in t)&&(Object.keys(t).length>1||!("@id"in t)),n.isSubjectReference=t=>i.isObject(t)&&1===Object.keys(t).length&&"@id"in t,n.isValue=t=>i.isObject(t)&&"@value"in t,n.isList=t=>i.isObject(t)&&"@list"in t,n.isGraph=t=>i.isObject(t)&&"@graph"in t&&1===Object.keys(t).filter((t=>"@id"!==t&&"@index"!==t)).length,n.isSimpleGraph=t=>n.isGraph(t)&&!("@id"in t),n.isBlankNode=t=>!!i.isObject(t)&&("@id"in t?0===t["@id"].indexOf("_:"):0===Object.keys(t).length||!("@value"in t||"@set"in t||"@list"in t))}}),Fs=ue({"../node_modules/jsonld/lib/JsonLdError.js"(t,e){e.exports=class extends Error{constructor(t="An unspecified JSON-LD error occurred.",e="jsonld.Error",i={}){super(t),this.name=e,this.message=t,this.details=i}}}}),As=ue({"../node_modules/jsonld/lib/util.js"(t,e){var i=Ss(),n=Es(),r=ks().IdentifierIssuer,o=Fs(),s=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,a=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,c=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,l="application/ld+json, application/json",u={};function h(t,e){if(n.isArray(e))for(let i=0;i<e.length;++i)e[i]=h(t,e[i]);else if(i.isList(e))e["@list"]=h(t,e["@list"]);else if(n.isObject(e)){i.isBlankNode(e)&&(e["@id"]=t.getId(e["@id"]));const n=Object.keys(e).sort();for(let i=0;i<n.length;++i){const r=n[i];"@id"!==r&&(e[r]=h(t,e[r]))}}return e}e.exports=u,u.IdentifierIssuer=r,u.clone=function(t){if(t&&"object"==typeof t){let e;if(n.isArray(t)){e=[];for(let i=0;i<t.length;++i)e[i]=u.clone(t[i])}else if(t instanceof Map){e=new Map;for(const[i,n]of t)e.set(i,u.clone(n))}else if(t instanceof Set){e=new Set;for(const i of t)e.add(u.clone(i))}else if(n.isObject(t)){e={};for(const i in t)e[i]=u.clone(t[i])}else e=t.toString();return e}return t},u.asArray=function(t){return Array.isArray(t)?t:[t]},u.buildHeaders=(t={})=>{const e=Object.keys(t).some((t=>"accept"===t.toLowerCase()));if(e)throw new RangeError('Accept header may not be specified; only "'+l+'" is supported.');return Object.assign({Accept:l},t)},u.parseLinkHeader=t=>{const e={},i=t.match(s);for(let t=0;t<i.length;++t){let n=i[t].match(a);if(!n)continue;const r={target:n[1]},o=n[2];for(;n=c.exec(o);)r[n[1]]=void 0===n[2]?n[3]:n[2];const s=r.rel||"";Array.isArray(e[s])?e[s].push(r):e[s]=e.hasOwnProperty(s)?[e[s],r]:r}return e},u.validateTypeValue=(t,e)=>{if(!(n.isString(t)||n.isArray(t)&&t.every((t=>n.isString(t))))){if(e&&n.isObject(t))switch(Object.keys(t).length){case 0:return;case 1:if("@default"in t&&u.asArray(t["@default"]).every((t=>n.isString(t))))return}throw new o('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:t})}},u.hasProperty=(t,e)=>{if(t.hasOwnProperty(e)){const i=t[e];return!n.isArray(i)||i.length>0}return!1},u.hasValue=(t,e,r)=>{if(u.hasProperty(t,e)){let o=t[e];const s=i.isList(o);if(n.isArray(o)||s){s&&(o=o["@list"]);for(let t=0;t<o.length;++t)if(u.compareValues(r,o[t]))return!0}else if(!n.isArray(r))return u.compareValues(r,o)}return!1},u.addValue=(t,e,i,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)t[e]=i;else if(n.isArray(i)){0===i.length&&r.propertyIsArray&&!t.hasOwnProperty(e)&&(t[e]=[]),r.prependValue&&(i=i.concat(t[e]),t[e]=[]);for(let n=0;n<i.length;++n)u.addValue(t,e,i[n],r)}else if(t.hasOwnProperty(e)){const o=!r.allowDuplicate&&u.hasValue(t,e,i);n.isArray(t[e])||o&&!r.propertyIsArray||(t[e]=[t[e]]),o||(r.prependValue?t[e].unshift(i):t[e].push(i))}else t[e]=r.propertyIsArray?[i]:i},u.getValues=(t,e)=>[].concat(t[e]||[]),u.removeProperty=(t,e)=>{delete t[e]},u.removeValue=(t,e,i,n)=>{"propertyIsArray"in(n=n||{})||(n.propertyIsArray=!1);const r=u.getValues(t,e).filter((t=>!u.compareValues(t,i)));0===r.length?u.removeProperty(t,e):t[e]=1!==r.length||n.propertyIsArray?r:r[0]},u.relabelBlankNodes=(t,e)=>h((e=e||{}).issuer||new r("_:b"),t),u.compareValues=(t,e)=>t===e||!(!i.isValue(t)||!i.isValue(e)||t["@value"]!==e["@value"]||t["@type"]!==e["@type"]||t["@language"]!==e["@language"]||t["@index"]!==e["@index"])||!!(n.isObject(t)&&"@id"in t&&n.isObject(e)&&"@id"in e)&&t["@id"]===e["@id"],u.compareShortestLeast=(t,e)=>t.length<e.length?-1:e.length<t.length?1:t===e?0:t<e?-1:1}}),_s=ue({"../node_modules/jsonld/lib/constants.js"(t,e){var i="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:i,RDF_LIST:i+"List",RDF_FIRST:i+"first",RDF_REST:i+"rest",RDF_NIL:i+"nil",RDF_TYPE:i+"type",RDF_PLAIN_LITERAL:i+"PlainLiteral",RDF_XML_LITERAL:i+"XMLLiteral",RDF_JSON_LITERAL:i+"JSON",RDF_OBJECT:i+"object",RDF_LANGSTRING:i+"langString",XSD:n,XSD_BOOLEAN:n+"boolean",XSD_DOUBLE:n+"double",XSD_INTEGER:n+"integer",XSD_STRING:n+"string"}}}),js=ue({"../node_modules/jsonld/lib/RequestQueue.js"(t,e){e.exports=class{constructor(){this._requests={}}wrapLoader(t){const e=this;return e._loader=t,function(){return e.add.apply(e,arguments)}}async add(t){let e=this._requests[t];if(e)return Promise.resolve(e);e=this._requests[t]=this._loader(t);try{return await e}finally{delete this._requests[t]}}}}}),Cs=ue({"../node_modules/jsonld/lib/url.js"(t,e){var i=Es(),n={};e.exports=n,n.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*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},n.parse=(t,e)=>{const i={},r=n.parsers[e||"full"],o=r.regex.exec(t);let s=r.keys.length;for(;s--;)i[r.keys[s]]=void 0===o[s]?null:o[s];return("https"===i.scheme&&"443"===i.port||"http"===i.scheme&&"80"===i.port)&&(i.href=i.href.replace(":"+i.port,""),i.authority=i.authority.replace(":"+i.port,""),i.port=null),i.normalizedPath=n.removeDotSegments(i.path),i},n.prependBase=(t,e)=>{if(null===t)return e;if(n.isAbsolute(e))return e;t&&!i.isString(t)||(t=n.parse(t||""));const r=n.parse(e),o={protocol:t.protocol||""};if(null!==r.authority)o.authority=r.authority,o.path=r.path,o.query=r.query;else if(o.authority=t.authority,""===r.path)o.path=t.path,o.query=null!==r.query?r.query:t.query;else{if(0===r.path.indexOf("/"))o.path=r.path;else{let e=t.path;e=e.substr(0,e.lastIndexOf("/")+1),(e.length>0||t.authority)&&"/"!==e.substr(-1)&&(e+="/"),e+=r.path,o.path=e}o.query=r.query}""!==r.path&&(o.path=n.removeDotSegments(o.path));let s=o.protocol;return null!==o.authority&&(s+="//"+o.authority),s+=o.path,null!==o.query&&(s+="?"+o.query),null!==r.fragment&&(s+="#"+r.fragment),""===s&&(s="./"),s},n.removeBase=(t,e)=>{if(null===t)return e;t&&!i.isString(t)||(t=n.parse(t||""));let r="";if(""!==t.href?r+=(t.protocol||"")+"//"+(t.authority||""):e.indexOf("//")&&(r+="//"),0!==e.indexOf(r))return e;const o=n.parse(e.substr(r.length)),s=t.normalizedPath.split("/"),a=o.normalizedPath.split("/"),c=o.fragment||o.query?0:1;for(;s.length>0&&a.length>c&&s[0]===a[0];)s.shift(),a.shift();let l="";if(s.length>0){s.pop();for(let t=0;t<s.length;++t)l+="../"}return l+=a.join("/"),null!==o.query&&(l+="?"+o.query),null!==o.fragment&&(l+="#"+o.fragment),""===l&&(l="./"),l},n.removeDotSegments=t=>{if(0===t.length)return"";const e=t.split("/"),i=[];for(;e.length>0;){const t=e.shift(),n=0===e.length;"."!==t?".."!==t?i.push(t):(i.pop(),n&&i.push("")):n&&i.push("")}return"/"===t[0]&&i.length>0&&""!==i[0]&&i.unshift(""),1===i.length&&""===i[0]?"/":i.join("/")};var r=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;n.isAbsolute=t=>i.isString(t)&&r.test(t),n.isRelative=t=>i.isString(t)}}),Rs=ue({"../node_modules/jsonld/lib/documentLoaders/xhr.js"(t,e){var{parseLinkHeader:i,buildHeaders:n}=As(),{LINK_HEADER_CONTEXT:r}=_s(),o=Fs(),s=js(),{prependBase:a}=Cs(),c=/(^|(\r\n))link:/i;e.exports=({secure:t,headers:e={},xhr:l}={headers:{}})=>(e=n(e),(new s).wrapLoader((async function n(s){if(0!==s.indexOf("http:")&&0!==s.indexOf("https:"))throw new o('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:s});if(t&&0!==s.indexOf("https"))throw new o('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 u;try{u=await function(t,e,i){const n=new(t=t||XMLHttpRequest);return new Promise(((t,r)=>{n.onload=()=>t(n),n.onerror=t=>r(t),n.open("GET",e,!0);for(const t in i)n.setRequestHeader(t,i[t]);n.send()}))}(l,s,e)}catch(t){throw new o("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:s,cause:t})}if(u.status>=400)throw new o("URL could not be dereferenced: "+u.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:s,httpStatusCode:u.status});let h={contextUrl:null,documentUrl:s,document:u.response},d=null;const f=u.getResponseHeader("Content-Type");let p;if(c.test(u.getAllResponseHeaders())&&(p=u.getResponseHeader("Link")),p&&"application/ld+json"!==f){const t=i(p),e=t[r];if(Array.isArray(e))throw new o("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:s});e&&(h.contextUrl=e.target),d=t.alternate,d&&"application/ld+json"==d.type&&!(f||"").match(/^application\/(\w*\+)?json$/)&&(h=await n(a(s,d.target)))}return h})))}}),Is=ue({"../node_modules/jsonld/lib/platform-browser.js"(t,e){var i=Rs(),n={};e.exports=n,n.setupDocumentLoaders=function(t){"undefined"!=typeof XMLHttpRequest&&(t.documentLoaders.xhr=i,t.useDocumentLoader("xhr"))},n.setupGlobals=function(t){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:t.JsonLdProcessor})}}}),Ts=ue({"../node_modules/jsonld/node_modules/yallist/iterator.js"(t,e){e.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}}}),Os=ue({"../node_modules/jsonld/node_modules/yallist/yallist.js"(t,e){function i(t){var e=this;if(e instanceof i||(e=new i),e.tail=null,e.head=null,e.length=0,t&&"function"==typeof t.forEach)t.forEach((function(t){e.push(t)}));else if(arguments.length>0)for(var n=0,r=arguments.length;n<r;n++)e.push(arguments[n]);return e}function n(t,e){t.tail=new o(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function r(t,e){t.head=new o(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function o(t,e,i,n){if(!(this instanceof o))return new o(t,e,i,n);this.list=n,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,i?(i.prev=this,this.next=i):this.next=null}e.exports=i,i.Node=o,i.create=i,i.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var e=t.next,i=t.prev;return e&&(e.prev=i),i&&(i.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=i),t.list.length--,t.next=null,t.prev=null,t.list=null,e},i.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}},i.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}},i.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)n(this,arguments[t]);return this.length},i.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)r(this,arguments[t]);return this.length},i.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}},i.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}},i.prototype.forEach=function(t,e){e=e||this;for(var i=this.head,n=0;null!==i;n++)t.call(e,i.value,n,this),i=i.next},i.prototype.forEachReverse=function(t,e){e=e||this;for(var i=this.tail,n=this.length-1;null!==i;n--)t.call(e,i.value,n,this),i=i.prev},i.prototype.get=function(t){for(var e=0,i=this.head;null!==i&&e<t;e++)i=i.next;if(e===t&&null!==i)return i.value},i.prototype.getReverse=function(t){for(var e=0,i=this.tail;null!==i&&e<t;e++)i=i.prev;if(e===t&&null!==i)return i.value},i.prototype.map=function(t,e){e=e||this;for(var n=new i,r=this.head;null!==r;)n.push(t.call(e,r.value,this)),r=r.next;return n},i.prototype.mapReverse=function(t,e){e=e||this;for(var n=new i,r=this.tail;null!==r;)n.push(t.call(e,r.value,this)),r=r.prev;return n},i.prototype.reduce=function(t,e){var i,n=this.head;if(arguments.length>1)i=e;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,i=this.head.value}for(var r=0;null!==n;r++)i=t(i,n.value,r),n=n.next;return i},i.prototype.reduceReverse=function(t,e){var i,n=this.tail;if(arguments.length>1)i=e;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,i=this.tail.value}for(var r=this.length-1;null!==n;r--)i=t(i,n.value,r),n=n.prev;return i},i.prototype.toArray=function(){for(var t=new Array(this.length),e=0,i=this.head;null!==i;e++)t[e]=i.value,i=i.next;return t},i.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,i=this.tail;null!==i;e++)t[e]=i.value,i=i.prev;return t},i.prototype.slice=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var n=new i;if(e<t||e<0)return n;t<0&&(t=0),e>this.length&&(e=this.length);for(var r=0,o=this.head;null!==o&&r<t;r++)o=o.next;for(;null!==o&&r<e;r++,o=o.next)n.push(o.value);return n},i.prototype.sliceReverse=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var n=new i;if(e<t||e<0)return n;t<0&&(t=0),e>this.length&&(e=this.length);for(var r=this.length,o=this.tail;null!==o&&r>e;r--)o=o.prev;for(;null!==o&&r>t;r--,o=o.prev)n.push(o.value);return n},i.prototype.splice=function(t,e,...i){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var n=0,r=this.head;null!==r&&n<t;n++)r=r.next;var s,a,c,l,u=[];for(n=0;r&&n<e;n++)u.push(r.value),r=this.removeNode(r);for(null===r&&(r=this.tail),r!==this.head&&r!==this.tail&&(r=r.prev),n=0;n<i.length;n++)c=i[n],l=void 0,null===(l=(a=r)===(s=this).head?new o(c,null,a,s):new o(c,a,a.next,s)).next&&(s.tail=l),null===l.prev&&(s.head=l),s.length++,r=l;return u},i.prototype.reverse=function(){for(var t=this.head,e=this.tail,i=t;null!==i;i=i.prev){var n=i.prev;i.prev=i.next,i.next=n}return this.head=e,this.tail=t,this};try{Ts()(i)}catch(t){}}}),Ps=ue({"../node_modules/jsonld/node_modules/lru-cache/index.js"(t,e){var i=Os(),n=Symbol("max"),r=Symbol("length"),o=Symbol("lengthCalculator"),s=Symbol("allowStale"),a=Symbol("maxAge"),c=Symbol("dispose"),l=Symbol("noDisposeOnSet"),u=Symbol("lruList"),h=Symbol("cache"),d=Symbol("updateAgeOnGet"),f=()=>1,p=(t,e,i)=>{const n=t[h].get(e);if(n){const e=n.value;if(v(t,e)){if(m(t,n),!t[s])return}else i&&(t[d]&&(n.value.now=Date.now()),t[u].unshiftNode(n));return e.value}},v=(t,e)=>{if(!e||!e.maxAge&&!t[a])return!1;const i=Date.now()-e.now;return e.maxAge?i>e.maxAge:t[a]&&i>t[a]},g=t=>{if(t[r]>t[n])for(let e=t[u].tail;t[r]>t[n]&&null!==e;){const i=e.prev;m(t,e),e=i}},m=(t,e)=>{if(e){const i=e.value;t[c]&&t[c](i.key,i.value),t[r]-=i.length,t[h].delete(i.key),t[u].removeNode(e)}},w=(t,e,i,n)=>{let r=i.value;v(t,r)&&(m(t,i),t[s]||(r=void 0)),r&&e.call(n,r.value,r.key,t)};e.exports=class{constructor(t){if("number"==typeof t&&(t={max:t}),t||(t={}),t.max&&("number"!=typeof t.max||t.max<0))throw new TypeError("max must be a non-negative number");this[n]=t.max||1/0;const e=t.length||f;if(this[o]="function"!=typeof e?f:e,this[s]=t.stale||!1,t.maxAge&&"number"!=typeof t.maxAge)throw new TypeError("maxAge must be a number");this[a]=t.maxAge||0,this[c]=t.dispose,this[l]=t.noDisposeOnSet||!1,this[d]=t.updateAgeOnGet||!1,this.reset()}set max(t){if("number"!=typeof t||t<0)throw new TypeError("max must be a non-negative number");this[n]=t||1/0,g(this)}get max(){return this[n]}set allowStale(t){this[s]=!!t}get allowStale(){return this[s]}set maxAge(t){if("number"!=typeof t)throw new TypeError("maxAge must be a non-negative number");this[a]=t,g(this)}get maxAge(){return this[a]}set lengthCalculator(t){"function"!=typeof t&&(t=f),t!==this[o]&&(this[o]=t,this[r]=0,this[u].forEach((t=>{t.length=this[o](t.value,t.key),this[r]+=t.length}))),g(this)}get lengthCalculator(){return this[o]}get length(){return this[r]}get itemCount(){return this[u].length}rforEach(t,e){e=e||this;for(let i=this[u].tail;null!==i;){const n=i.prev;w(this,t,i,e),i=n}}forEach(t,e){e=e||this;for(let i=this[u].head;null!==i;){const n=i.next;w(this,t,i,e),i=n}}keys(){return this[u].toArray().map((t=>t.key))}values(){return this[u].toArray().map((t=>t.value))}reset(){this[c]&&this[u]&&this[u].length&&this[u].forEach((t=>this[c](t.key,t.value))),this[h]=new Map,this[u]=new i,this[r]=0}dump(){return this[u].map((t=>!v(this,t)&&{k:t.key,v:t.value,e:t.now+(t.maxAge||0)})).toArray().filter((t=>t))}dumpLru(){return this[u]}set(t,e,i){if((i=i||this[a])&&"number"!=typeof i)throw new TypeError("maxAge must be a number");const s=i?Date.now():0,d=this[o](e,t);if(this[h].has(t)){if(d>this[n])return m(this,this[h].get(t)),!1;const o=this[h].get(t).value;return this[c]&&(this[l]||this[c](t,o.value)),o.now=s,o.maxAge=i,o.value=e,this[r]+=d-o.length,o.length=d,this.get(t),g(this),!0}const f=new class{constructor(t,e,i,n,r){this.key=t,this.value=e,this.length=i,this.now=n,this.maxAge=r||0}}(t,e,d,s,i);return f.length>this[n]?(this[c]&&this[c](t,e),!1):(this[r]+=f.length,this[u].unshift(f),this[h].set(t,this[u].head),g(this),!0)}has(t){if(!this[h].has(t))return!1;const e=this[h].get(t).value;return!v(this,e)}get(t){return p(this,t,!0)}peek(t){return p(this,t,!1)}pop(){const t=this[u].tail;return t?(m(this,t),t.value):null}del(t){m(this,this[h].get(t))}load(t){this.reset();const e=Date.now();for(let i=t.length-1;i>=0;i--){const n=t[i],r=n.e||0;if(0===r)this.set(n.k,n.v);else{const t=r-e;t>0&&this.set(n.k,n.v,t)}}}prune(){this[h].forEach(((t,e)=>p(this,e,!1)))}}}}),Ns=ue({"../node_modules/jsonld/lib/ResolvedContext.js"(t,e){var i=Ps();e.exports=class{constructor({document:t}){this.document=t,this.cache=new i({max:10})}getProcessed(t){return this.cache.get(t)}setProcessed(t,e){this.cache.set(t,e)}}}}),Ds=ue({"../node_modules/jsonld/lib/ContextResolver.js"(t,e){var{isArray:i,isObject:n,isString:r}=Es(),{asArray:o}=As(),{prependBase:s}=Cs(),a=Fs(),c=Ns();function l(t){throw new a("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:t})}function u({context:t,base:e}){if(!t)return;const o=t["@context"];if(r(o))t["@context"]=s(e,o);else if(i(o))for(let t=0;t<o.length;++t){const i=o[t];r(i)?o[t]=s(e,i):n(i)&&u({context:{"@context":i},base:e})}else if(n(o))for(const t in o)u({context:o[t],base:e})}e.exports=class{constructor({sharedCache:t}){this.perOpCache=new Map,this.sharedCache=t}async resolve({activeCtx:t,context:e,documentLoader:s,base:a,cycles:u=new Set}){e&&n(e)&&e["@context"]&&(e=e["@context"]),e=o(e);const h=[];for(const o of e){if(r(o)){let e=this._get(o);e||(e=await this._resolveRemoteContext({activeCtx:t,url:o,documentLoader:s,base:a,cycles:u})),i(e)?h.push(...e):h.push(e);continue}if(null===o){h.push(new c({document:null}));continue}n(o)||l(e);const d=JSON.stringify(o);let f=this._get(d);f||(f=new c({document:o}),this._cacheResolvedContext({key:d,resolved:f,tag:"static"})),h.push(f)}return h}_get(t){let e=this.perOpCache.get(t);if(!e){const i=this.sharedCache.get(t);i&&(e=i.get("static"),e&&this.perOpCache.set(t,e))}return e}_cacheResolvedContext({key:t,resolved:e,tag:i}){if(this.perOpCache.set(t,e),void 0!==i){let n=this.sharedCache.get(t);n||(n=new Map,this.sharedCache.set(t,n)),n.set(i,e)}return e}async _resolveRemoteContext({activeCtx:t,url:e,documentLoader:i,base:n,cycles:r}){e=s(n,e);const{context:o,remoteDoc:a}=await this._fetchContext({activeCtx:t,url:e,documentLoader:i,cycles:r});u({context:o,base:n=a.documentUrl||e});const c=await this.resolve({activeCtx:t,context:o,documentLoader:i,base:n,cycles:r});return this._cacheResolvedContext({key:e,resolved:c,tag:a.tag}),c}async _fetchContext({activeCtx:t,url:e,documentLoader:o,cycles:s}){if(s.size>10)throw new a("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===t.processingMode?"loading remote context failed":"context overflow",max:10});if(s.has(e))throw new a("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===t.processingMode?"recursive context inclusion":"context overflow",url:e});let c,l;s.add(e);try{l=await o(e),c=l.document||null,r(c)&&(c=JSON.parse(c))}catch(t){throw new a("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:e,cause:t})}if(!n(c))throw new a("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:e});return c="@context"in c?{"@context":c["@context"]}:{"@context":{}},l.contextUrl&&(i(c["@context"])||(c["@context"]=[c["@context"]]),c["@context"].push(l.contextUrl)),{context:c,remoteDoc:l}}}}}),Ms=ue({"../node_modules/jsonld/lib/NQuads.js"(t,e){e.exports=ks().NQuads}}),Us=ue({"../node_modules/jsonld/lib/context.js"(t,e){var i=As(),n=Fs(),{isArray:r,isObject:o,isString:s,isUndefined:a}=Es(),{isAbsolute:c,isRelative:l,prependBase:u}=Cs(),{asArray:h,compareShortestLeast:d}=As(),f=new Map,p=/^@[a-zA-Z]+$/,v={};function g(t,e,i,n,r,a){if(null===e||!s(e)||v.isKeyword(e))return e;if(e.match(p))return null;if(n&&n.hasOwnProperty(e)&&!0!==r.get(e)&&v.createTermDefinition({activeCtx:t,localCtx:n,term:e,defined:r,options:a}),(i=i||{}).vocab){const i=t.mappings.get(e);if(null===i)return null;if(o(i)&&"@id"in i)return i["@id"]}const l=e.indexOf(":");if(l>0){const i=e.substr(0,l),o=e.substr(l+1);if("_"===i||0===o.indexOf("//"))return e;n&&n.hasOwnProperty(i)&&v.createTermDefinition({activeCtx:t,localCtx:n,term:i,defined:r,options:a});const s=t.mappings.get(i);if(s&&s._prefix)return s["@id"]+o;if(c(e))return e}if(i.vocab&&"@vocab"in t)return t["@vocab"]+e;if(i.base&&"@base"in t){if(t["@base"])return u(u(a.base,t["@base"]),e)}else if(i.base)return u(a.base,e);return e}function m(t,e){if(!t||"object"!=typeof t||!e||"object"!=typeof e)return t===e;const i=Array.isArray(t);if(i!==Array.isArray(e))return!1;if(i){if(t.length!==e.length)return!1;for(let i=0;i<t.length;++i)if(!m(t[i],e[i]))return!1;return!0}const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const i in t){let n=t[i],r=e[i];if("@container"===i&&Array.isArray(n)&&Array.isArray(r)&&(n=n.slice().sort(),r=r.slice().sort()),!m(n,r))return!1}return!0}e.exports=v,v.process=async({activeCtx:t,localCtx:e,options:a,propagate:d=!0,overrideProtected:f=!1,cycles:p=new Set})=>{if(o(e)&&"@context"in e&&r(e["@context"])&&(e=e["@context"]),0===h(e).length)return t;const m=await a.contextResolver.resolve({activeCtx:t,context:e,documentLoader:a.documentLoader,base:a.base});o(m[0].document)&&"boolean"==typeof m[0].document["@propagate"]&&(d=m[0].document["@propagate"]);let w=t;d||w.previousContext||(w=w.clone(),w.previousContext=t);for(const r of m){let{document:h}=r;if(t=w,null===h){if(!f&&0!==Object.keys(t.protected).length){const o=a&&a.protectedMode||"error";if("error"===o)throw new n("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});if("warn"===o){console.warn("WARNING: invalid context nullification");const e=r.getProcessed(t);if(e){w=t=e;continue}const n=t;w=t=v.getInitialContext(a).clone();for(const[e,r]of Object.entries(n.protected))r&&(t.mappings[e]=i.clone(n.mappings[e]));t.protected=i.clone(n.protected),r.setProcessed(n,w);continue}throw new n("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:e,protectedMode:o})}w=t=v.getInitialContext(a).clone();continue}const d=r.getProcessed(t);if(d){w=t=d;continue}if(o(h)&&"@context"in h&&(h=h["@context"]),!o(h))throw new n("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:h});w=w.clone();const m=new Map;if("@version"in h){if(1.1!==h["@version"])throw new n("Unsupported JSON-LD version: "+h["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:h});if(t.processingMode&&"json-ld-1.0"===t.processingMode)throw new n("@version: "+h["@version"]+" not compatible with "+t.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:h});w.processingMode="json-ld-1.1",w["@version"]=h["@version"],m.set("@version",!0)}if(w.processingMode=w.processingMode||t.processingMode,"@base"in h){let t=h["@base"];if(null===t||c(t));else{if(!l(t))throw new n('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:h});t=u(w["@base"],t)}w["@base"]=t,m.set("@base",!0)}if("@vocab"in h){const t=h["@vocab"];if(null===t)delete w["@vocab"];else{if(!s(t))throw new n('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:h});if(!c(t)&&v.processingMode(w,1))throw new n('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:h});w["@vocab"]=g(w,t,{vocab:!0,base:!0},void 0,void 0,a)}m.set("@vocab",!0)}if("@language"in h){const t=h["@language"];if(null===t)delete w["@language"];else{if(!s(t))throw new n('Invalid JSON-LD syntax; the value of "@language" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid default language",context:h});w["@language"]=t.toLowerCase()}m.set("@language",!0)}if("@direction"in h){const e=h["@direction"];if("json-ld-1.0"===t.processingMode)throw new n("Invalid JSON-LD syntax; @direction not compatible with "+t.processingMode,"jsonld.SyntaxError",{code:"invalid context member",context:h});if(null===e)delete w["@direction"];else{if("ltr"!==e&&"rtl"!==e)throw new n('Invalid JSON-LD syntax; the value of "@direction" in a @context must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:h});w["@direction"]=e}m.set("@direction",!0)}if("@propagate"in h){const i=h["@propagate"];if("json-ld-1.0"===t.processingMode)throw new n("Invalid JSON-LD syntax; @propagate not compatible with "+t.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:h});if("boolean"!=typeof i)throw new n("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:e});m.set("@propagate",!0)}if("@import"in h){const i=h["@import"];if("json-ld-1.0"===t.processingMode)throw new n("Invalid JSON-LD syntax; @import not compatible with "+t.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:h});if(!s(i))throw new n("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:e});const r=await a.contextResolver.resolve({activeCtx:t,context:i,documentLoader:a.documentLoader,base:a.base});if(1!==r.length)throw new n("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:e});const o=r[0].getProcessed(t);if(o)h=o;else{const i=r[0].document;if("@import"in i)throw new n("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:e});for(const t in i)h.hasOwnProperty(t)||(h[t]=i[t]);r[0].setProcessed(t,h)}m.set("@import",!0)}m.set("@protected",h["@protected"]||!1);for(const t in h)if(v.createTermDefinition({activeCtx:w,localCtx:h,term:t,defined:m,options:a,overrideProtected:f}),o(h[t])&&"@context"in h[t]){const e=h[t]["@context"];let i=!0;if(s(e)){const t=u(a.base,e);p.has(t)?i=!1:p.add(t)}if(i)try{await v.process({activeCtx:w.clone(),localCtx:h[t]["@context"],overrideProtected:!0,options:a,cycles:p})}catch(e){throw new n("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:h[t]["@context"],term:t})}}r.setProcessed(t,w)}return w},v.createTermDefinition=({activeCtx:t,localCtx:e,term:i,defined:a,options:l,overrideProtected:u=!1})=>{if(a.has(i)){if(a.get(i))return;throw new n("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:e,term:i})}let h;if(a.set(i,!1),e.hasOwnProperty(i)&&(h=e[i]),"@type"===i&&o(h)&&"@set"===(h["@container"]||"@set")&&v.processingMode(t,1.1)){const t=["@container","@id","@protected"],r=Object.keys(h);if(0===r.length||r.some((e=>!t.includes(e))))throw new n("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:e,term:i})}else{if(v.isKeyword(i))throw new n("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:e,term:i});if(i.match(p))return void console.warn('WARNING: terms beginning with "@" are reserved for future use and ignored',{term:i});if(""===i)throw new n("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:e})}const d=t.mappings.get(i);t.mappings.has(i)&&t.mappings.delete(i);let f=!1;if((s(h)||null===h)&&(f=!0,h={"@id":h}),!o(h))throw new n("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:e});const w={};t.mappings.set(i,w),w.reverse=!1;const b=["@container","@id","@language","@reverse","@type"];v.processingMode(t,1.1)&&b.push("@context","@direction","@index","@nest","@prefix","@protected");for(const t in h)if(!b.includes(t))throw new n("Invalid JSON-LD syntax; a term definition must not contain "+t,"jsonld.SyntaxError",{code:"invalid term definition",context:e});const y=i.indexOf(":");if(w._termHasColon=y>0,"@reverse"in h){if("@id"in h)throw new n("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:e});if("@nest"in h)throw new n("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:e});const r=h["@reverse"];if(!s(r))throw new n("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:e});if(!v.isKeyword(r)&&r.match(p))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:r}),void(d?t.mappings.set(i,d):t.mappings.delete(i));const o=g(t,r,{vocab:!0,base:!1},e,a,l);if(!c(o))throw new n("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:e});w["@id"]=o,w.reverse=!0}else if("@id"in h){let r=h["@id"];if(r&&!s(r))throw new n("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:e});if(null===r)w["@id"]=null;else{if(!v.isKeyword(r)&&r.match(p))return console.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:r}),void(d?t.mappings.set(i,d):t.mappings.delete(i));if(r!==i){if(r=g(t,r,{vocab:!0,base:!1},e,a,l),!c(r)&&!v.isKeyword(r))throw new n("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:e});if(i.match(/(?::[^:])|\//)&&g(t,i,{vocab:!0,base:!1},e,new Map(a).set(i,!0),l)!==r)throw new n("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:e});w["@id"]=r,w._prefix=f&&!w._termHasColon&&r.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in w))if(w._termHasColon){const n=i.substr(0,y);if(e.hasOwnProperty(n)&&v.createTermDefinition({activeCtx:t,localCtx:e,term:n,defined:a,options:l}),t.mappings.has(n)){const e=i.substr(y+1);w["@id"]=t.mappings.get(n)["@id"]+e}else w["@id"]=i}else if("@type"===i)w["@id"]=i;else{if(!("@vocab"in t))throw new n("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:e,term:i});w["@id"]=t["@vocab"]+i}if((!0===h["@protected"]||!0===a.get("@protected")&&!1!==h["@protected"])&&(t.protected[i]=!0,w.protected=!0),a.set(i,!0),"@type"in h){let i=h["@type"];if(!s(i))throw new n("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:e});if("@json"===i||"@none"===i){if(v.processingMode(t,1))throw new n(`Invalid JSON-LD syntax; an @context @type value must not be "${i}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:e})}else if("@id"!==i&&"@vocab"!==i){if(i=g(t,i,{vocab:!0,base:!1},e,a,l),!c(i))throw new n("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:e});if(0===i.indexOf("_:"))throw new n("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:e})}w["@type"]=i}if("@container"in h){const i=s(h["@container"])?[h["@container"]]:h["@container"]||[],o=["@list","@set","@index","@language"];let a=!0;const c=i.includes("@set");if(v.processingMode(t,1.1)){if(o.push("@graph","@id","@type"),i.includes("@list")){if(1!==i.length)throw new n("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:e})}else if(i.includes("@graph")){if(i.some((t=>"@graph"!==t&&"@id"!==t&&"@index"!==t&&"@set"!==t)))throw new n("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:e})}else a&=i.length<=(c?2:1);if(i.includes("@type")&&(w["@type"]=w["@type"]||"@id",!["@id","@vocab"].includes(w["@type"])))throw new n("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:e})}else a&=!r(h["@container"]),a&=i.length<=1;if(a&=i.every((t=>o.includes(t))),a&=!(c&&i.includes("@list")),!a)throw new n("Invalid JSON-LD syntax; @context @container value must be one of the following: "+o.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:e});if(w.reverse&&!i.every((t=>["@index","@set"].includes(t))))throw new n("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:e});w["@container"]=i}if("@index"in h){if(!("@container"in h)||!w["@container"].includes("@index"))throw new n(`Invalid JSON-LD syntax; @index without @index in @container: "${h["@index"]}" on term "${i}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:e});if(!s(h["@index"])||0===h["@index"].indexOf("@"))throw new n(`Invalid JSON-LD syntax; @index must expand to an IRI: "${h["@index"]}" on term "${i}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:e});w["@index"]=h["@index"]}if("@context"in h&&(w["@context"]=h["@context"]),"@language"in h&&!("@type"in h)){let t=h["@language"];if(null!==t&&!s(t))throw new n("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:e});null!==t&&(t=t.toLowerCase()),w["@language"]=t}if("@prefix"in h){if(i.match(/:|\//))throw new n("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:e});if(v.isKeyword(w["@id"]))throw new n("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:e});if("boolean"!=typeof h["@prefix"])throw new n("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:e});w._prefix=!0===h["@prefix"]}if("@direction"in h){const t=h["@direction"];if(null!==t&&"ltr"!==t&&"rtl"!==t)throw new n('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:e});w["@direction"]=t}if("@nest"in h){const t=h["@nest"];if(!s(t)||"@nest"!==t&&0===t.indexOf("@"))throw new n("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:e});w["@nest"]=t}const x=w["@id"];if("@context"===x||"@preserve"===x)throw new n("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:e});if(d&&d.protected&&!u&&(t.protected[i]=!0,w.protected=!0,!m(d,w))){const t=l&&l.protectedMode||"error";if("error"===t)throw new n(`Invalid JSON-LD syntax; tried to redefine "${i}" which is a protected term.`,"jsonld.SyntaxError",{code:"protected term redefinition",context:e,term:i});if("warn"===t)return void console.warn("WARNING: protected term redefinition",{term:i});throw new n("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:e,term:i,protectedMode:t})}},v.expandIri=(t,e,i,n)=>g(t,e,i,void 0,void 0,n),v.getInitialContext=t=>{const e=JSON.stringify({processingMode:t.processingMode}),n=f.get(e);if(n)return n;const r={processingMode:t.processingMode,mappings:new Map,inverse:null,getInverse:function(){const t=this;if(t.inverse)return t.inverse;const e=t.inverse={},i=t.fastCurieMap={},n={},r=(t["@language"]||"@none").toLowerCase(),a=t["@direction"],c=t.mappings,l=[...c.keys()].sort(d);for(const t of l){const o=c.get(t);if(null===o)continue;let l=o["@container"]||"@none";if(l=[].concat(l).sort().join(""),null===o["@id"])continue;const u=h(o["@id"]);for(const c of u){let u=e[c];const h=v.isKeyword(c);if(u)h||o._termHasColon||n[c].push(t);else if(e[c]=u={},!h&&!o._termHasColon){n[c]=[t];const e={iri:c,terms:n[c]};c[0]in i?i[c[0]].push(e):i[c[0]]=[e]}if(u[l]||(u[l]={"@language":{},"@type":{},"@any":{}}),u=u[l],s(t,u["@any"],"@none"),o.reverse)s(t,u["@type"],"@reverse");else if("@none"===o["@type"])s(t,u["@any"],"@none"),s(t,u["@language"],"@none"),s(t,u["@type"],"@none");else if("@type"in o)s(t,u["@type"],o["@type"]);else if("@language"in o&&"@direction"in o){const e=o["@language"],i=o["@direction"];s(t,u["@language"],e&&i?`${e}_${i}`.toLowerCase():e?e.toLowerCase():i?`_${i}`:"@null")}else"@language"in o?s(t,u["@language"],(o["@language"]||"@null").toLowerCase()):"@direction"in o?s(t,u["@language"],o["@direction"]?`_${o["@direction"]}`:"@none"):a?(s(t,u["@language"],`_${a}`),s(t,u["@language"],"@none"),s(t,u["@type"],"@none")):(s(t,u["@language"],r),s(t,u["@language"],"@none"),s(t,u["@type"],"@none"))}}for(const t in i)o(i,t,1);return e},clone:function(){const t={};return t.mappings=i.clone(this.mappings),t.clone=this.clone,t.inverse=null,t.getInverse=this.getInverse,t.protected=i.clone(this.protected),this.previousContext&&(t.previousContext=this.previousContext.clone()),t.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(t["@base"]=this["@base"]),"@language"in this&&(t["@language"]=this["@language"]),"@vocab"in this&&(t["@vocab"]=this["@vocab"]),t},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===f.size&&f.clear(),f.set(e,r),r;function o(t,e,i){const n=t[e],r=t[e]={};let s,a;for(const t of n)s=t.iri,a=i>=s.length?"":s[i],a in r?r[a].push(t):r[a]=[t];for(const t in r)""!==t&&o(r,t,i+1)}function s(t,e,i){e.hasOwnProperty(i)||(e[i]=t)}},v.getContextValue=(t,e,i)=>{if(null===e){if("@context"===i)return;return null}if(t.mappings.has(e)){const n=t.mappings.get(e);if(a(i))return n;if(n.hasOwnProperty(i))return n[i]}return"@language"===i&&i in t||"@direction"===i&&i in t?t[i]:"@context"!==i?null:void 0},v.processingMode=(t,e)=>e.toString()>="1.1"?!t.processingMode||t.processingMode>="json-ld-"+e.toString():"json-ld-1.0"===t.processingMode,v.isKeyword=t=>{if(!s(t)||"@"!==t[0])return!1;switch(t){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}}}),Ls=ue({"../node_modules/jsonld/lib/expand.js"(t,e){var i=Fs(),{isArray:n,isObject:r,isEmptyObject:o,isString:s,isUndefined:a}=Es(),{isList:c,isValue:l,isGraph:u,isSubject:h}=Ss(),{expandIri:d,getContextValue:f,isKeyword:p,process:v,processingMode:g}=Us(),{isAbsolute:m}=Cs(),{addValue:w,asArray:b,getValues:y,validateTypeValue:x}=As(),k={};e.exports=k;var E=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;async function S({activeCtx:t,activeProperty:e,expandedActiveProperty:u,element:y,expandedParent:F,options:j={},insideList:C,typeKey:R,typeScopedContext:I,expansionMap:T}){const O=Object.keys(y).sort(),P=[];let N;const D=y[R]&&"@json"===d(t,n(y[R])?y[R][0]:y[R],{vocab:!0},j);for(const S of O){let R,O=y[S];if("@context"===S)continue;let M=d(t,S,{vocab:!0},j);if((null===M||!m(M)&&!p(M))&&(M=T({unmappedProperty:S,activeCtx:t,activeProperty:e,parent:y,options:j,insideList:C,value:O,expandedParent:F}),void 0===M))continue;if(p(M)){if("@reverse"===u)throw new i("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:O});if(M in F&&"@included"!==M&&"@type"!==M)throw new i("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:M})}if("@id"===M){if(!s(O)){if(!j.isFrame)throw new i('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:O});if(r(O)){if(!o(O))throw new i('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:O})}else{if(!n(O))throw new i('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:O});if(!O.every((t=>s(t))))throw new i('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:O})}}w(F,"@id",b(O).map((e=>s(e)?d(t,e,{base:!0},j):e)),{propertyIsArray:j.isFrame});continue}if("@type"===M){r(O)&&(O=Object.fromEntries(Object.entries(O).map((([t,e])=>[d(I,t,{vocab:!0}),b(e).map((t=>d(I,t,{base:!0,vocab:!0})))])))),x(O,j.isFrame),w(F,"@type",b(O).map((t=>s(t)?d(I,t,{base:!0,vocab:!0},j):t)),{propertyIsArray:j.isFrame});continue}if("@included"===M&&g(t,1.1)){const n=b(await k.expand({activeCtx:t,activeProperty:e,element:O,options:j,expansionMap:T}));if(!n.every((t=>h(t))))throw new i("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:O});w(F,"@included",n,{propertyIsArray:!0});continue}if("@graph"===M&&!r(O)&&!n(O))throw new i('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:O});if("@value"===M){N=O,D&&g(t,1.1)?F["@value"]=O:w(F,"@value",O,{propertyIsArray:j.isFrame});continue}if("@language"===M){if(null===O)continue;if(!s(O)&&!j.isFrame)throw new i('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:O});O=b(O).map((t=>s(t)?t.toLowerCase():t));for(const t of O)s(t)&&!t.match(E)&&console.warn(`@language must be valid BCP47: ${t}`);w(F,"@language",O,{propertyIsArray:j.isFrame});continue}if("@direction"===M){if(!s(O)&&!j.isFrame)throw new i('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:O});O=b(O);for(const t of O)if(s(t)&&"ltr"!==t&&"rtl"!==t)throw new i('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:O});w(F,"@direction",O,{propertyIsArray:j.isFrame});continue}if("@index"===M){if(!s(O))throw new i('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:O});w(F,"@index",O);continue}if("@reverse"===M){if(!r(O))throw new i('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:O});if(R=await k.expand({activeCtx:t,activeProperty:"@reverse",element:O,options:j,expansionMap:T}),"@reverse"in R)for(const t in R["@reverse"])w(F,t,R["@reverse"][t],{propertyIsArray:!0});let e=F["@reverse"]||null;for(const t in R){if("@reverse"===t)continue;null===e&&(e=F["@reverse"]={}),w(e,t,[],{propertyIsArray:!0});const n=R[t];for(let r=0;r<n.length;++r){const o=n[r];if(l(o)||c(o))throw new i('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:R});w(e,t,o,{propertyIsArray:!0})}}continue}if("@nest"===M){P.push(S);continue}let U=t;const L=f(t,S,"@context");a(L)||(U=await v({activeCtx:t,localCtx:L,propagate:!0,overrideProtected:!0,options:j}));const B=f(U,S,"@container")||[];if(B.includes("@language")&&r(O))R=A(U,O,f(U,S,"@direction"),j);else if(B.includes("@index")&&r(O)){const e=B.includes("@graph"),i=f(U,S,"@index")||"@index",n="@index"!==i&&d(t,i,{vocab:!0},j);R=await _({activeCtx:U,options:j,activeProperty:S,value:O,expansionMap:T,asGraph:e,indexKey:i,propertyIndex:n})}else if(B.includes("@id")&&r(O)){const t=B.includes("@graph");R=await _({activeCtx:U,options:j,activeProperty:S,value:O,expansionMap:T,asGraph:t,indexKey:"@id"})}else if(B.includes("@type")&&r(O))R=await _({activeCtx:U.revertToPreviousContext(),options:j,activeProperty:S,value:O,expansionMap:T,asGraph:!1,indexKey:"@type"});else{const i="@list"===M;if(i||"@set"===M){let t=e;i&&"@graph"===u&&(t=null),R=await k.expand({activeCtx:U,activeProperty:t,element:O,options:j,insideList:i,expansionMap:T})}else R="@json"===f(t,S,"@type")?{"@type":"@json","@value":O}:await k.expand({activeCtx:U,activeProperty:S,element:O,options:j,insideList:!1,expansionMap:T})}if(null!==R||"@value"===M||(R=T({unmappedValue:O,expandedProperty:M,activeCtx:U,activeProperty:e,parent:y,options:j,insideList:C,key:S,expandedParent:F}),void 0!==R))if("@list"!==M&&!c(R)&&B.includes("@list")&&(R={"@list":b(R)}),B.includes("@graph")&&!B.some((t=>"@id"===t||"@index"===t))&&(R=b(R).map((t=>({"@graph":b(t)})))),U.mappings.has(S)&&U.mappings.get(S).reverse){const t=F["@reverse"]=F["@reverse"]||{};R=b(R);for(let e=0;e<R.length;++e){const n=R[e];if(l(n)||c(n))throw new i('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:R});w(t,M,n,{propertyIsArray:!0})}}else w(F,M,R,{propertyIsArray:!0})}if("@value"in F)if("@json"===F["@type"]&&g(t,1.1));else if((r(N)||n(N))&&!j.isFrame)throw new i('Invalid JSON-LD syntax; "@value" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid value object value",value:N});for(const o of P){const s=n(y[o])?y[o]:[y[o]];for(const n of s){if(!r(n)||Object.keys(n).some((e=>"@value"===d(t,e,{vocab:!0},j))))throw new i("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:n});await S({activeCtx:t,activeProperty:e,expandedActiveProperty:u,element:n,expandedParent:F,options:j,insideList:C,typeScopedContext:I,typeKey:R,expansionMap:T})}}}function F({activeCtx:t,activeProperty:e,value:i,options:n}){if(null==i)return null;const r=d(t,e,{vocab:!0},n);if("@id"===r)return d(t,i,{base:!0},n);if("@type"===r)return d(t,i,{vocab:!0,base:!0},n);const o=f(t,e,"@type");if(("@id"===o||"@graph"===r)&&s(i))return{"@id":d(t,i,{base:!0},n)};if("@vocab"===o&&s(i))return{"@id":d(t,i,{vocab:!0,base:!0},n)};if(p(r))return i;const a={};if(o&&!["@id","@vocab","@none"].includes(o))a["@type"]=o;else if(s(i)){const i=f(t,e,"@language");null!==i&&(a["@language"]=i);const n=f(t,e,"@direction");null!==n&&(a["@direction"]=n)}return["boolean","number","string"].includes(typeof i)||(i=i.toString()),a["@value"]=i,a}function A(t,e,r,o){const a=[],c=Object.keys(e).sort();for(const l of c){const c=d(t,l,{vocab:!0},o);let u=e[l];n(u)||(u=[u]);for(const t of u){if(null===t)continue;if(!s(t))throw new i("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:e});const n={"@value":t};"@none"!==c&&(n["@language"]=l.toLowerCase()),r&&(n["@direction"]=r),a.push(n)}}return a}async function _({activeCtx:t,options:e,activeProperty:r,value:o,expansionMap:s,asGraph:c,indexKey:h,propertyIndex:p}){const g=[],m=Object.keys(o).sort(),b="@type"===h;for(let y of m){if(b){const i=f(t,y,"@context");a(i)||(t=await v({activeCtx:t,localCtx:i,propagate:!1,options:e}))}let m,x=o[y];n(x)||(x=[x]),x=await k.expand({activeCtx:t,activeProperty:r,element:x,options:e,insideList:!1,insideIndex:!0,expansionMap:s}),m=p?"@none"===y?"@none":F({activeCtx:t,activeProperty:h,value:y,options:e}):d(t,y,{vocab:!0},e),"@id"===h?y=d(t,y,{base:!0},e):b&&(y=m);for(let t of x){if(c&&!u(t)&&(t={"@graph":[t]}),"@type"===h)"@none"===m||(t["@type"]=t["@type"]?[y].concat(t["@type"]):[y]);else{if(l(t)&&!["@language","@type","@index"].includes(h))throw new i(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${h}".`,"jsonld.SyntaxError",{code:"invalid value object",value:t});p?"@none"!==m&&w(t,p,m,{propertyIsArray:!0,prependValue:!0}):"@none"===m||h in t||(t[h]=y)}g.push(t)}}return g}k.expand=async({activeCtx:t,activeProperty:e=null,element:c,options:l={},insideList:u=!1,insideIndex:h=!1,typeScopedContext:p=null,expansionMap:w=(()=>{})})=>{if(null==c)return null;if("@default"===e&&(l=Object.assign({},l,{isFrame:!1})),!n(c)&&!r(c)){if(!u&&(null===e||"@graph"===d(t,e,{vocab:!0},l))){const i=await w({unmappedValue:c,activeCtx:t,activeProperty:e,options:l,insideList:u});return void 0===i?null:i}return F({activeCtx:t,activeProperty:e,value:c,options:l})}if(n(c)){let i=[];const r=f(t,e,"@container")||[];u=u||r.includes("@list");for(let r=0;r<c.length;++r){let o=await k.expand({activeCtx:t,activeProperty:e,element:c[r],options:l,expansionMap:w,insideIndex:h,typeScopedContext:p});u&&n(o)&&(o={"@list":o}),null===o&&(o=await w({unmappedValue:c[r],activeCtx:t,activeProperty:e,parent:c,index:r,options:l,expandedParent:i,insideList:u}),void 0===o)||(n(o)?i=i.concat(o):i.push(o))}return i}const x=d(t,e,{vocab:!0},l),E=f(t,e,"@context");p=p||(t.previousContext?t:null);let A=Object.keys(c).sort(),_=!h;if(_&&p&&A.length<=2&&!A.includes("@context"))for(const e of A){const i=d(p,e,{vocab:!0},l);if("@value"===i){_=!1,t=p;break}if("@id"===i&&1===A.length){_=!1;break}}_&&(t=t.revertToPreviousContext()),a(E)||(t=await v({activeCtx:t,localCtx:E,propagate:!0,overrideProtected:!0,options:l})),"@context"in c&&(t=await v({activeCtx:t,localCtx:c["@context"],options:l})),p=t;let j=null;for(const e of A)if("@type"===d(t,e,{vocab:!0},l)){j=j||e;const i=c[e],n=Array.isArray(i)?i.length>1?i.slice().sort():i:[i];for(const e of n){const i=f(p,e,"@context");a(i)||(t=await v({activeCtx:t,localCtx:i,options:l,propagate:!1}))}}let C={};await S({activeCtx:t,activeProperty:e,expandedActiveProperty:x,element:c,expandedParent:C,options:l,insideList:u,typeKey:j,typeScopedContext:p,expansionMap:w}),A=Object.keys(C);let R=A.length;if("@value"in C){if("@type"in C&&("@language"in C||"@direction"in C))throw new i('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:C});let n=R-1;if("@type"in C&&(n-=1),"@index"in C&&(n-=1),"@language"in C&&(n-=1),"@direction"in C&&(n-=1),0!==n)throw new i('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:C});const r=null===C["@value"]?[]:b(C["@value"]),a=y(C,"@type");if(g(t,1.1)&&a.includes("@json")&&1===a.length);else if(0===r.length){const i=await w({unmappedValue:C,activeCtx:t,activeProperty:e,element:c,options:l,insideList:u});C=void 0!==i?i:null}else{if(!r.every((t=>s(t)||o(t)))&&"@language"in C)throw new i("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:C});if(!a.every((t=>m(t)&&!(s(t)&&0===t.indexOf("_:"))||o(t))))throw new i('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:C})}}else if("@type"in C&&!n(C["@type"]))C["@type"]=[C["@type"]];else if("@set"in C||"@list"in C){if(R>1&&(2!==R||!("@index"in C)))throw new i('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:C});"@set"in C&&(C=C["@set"],A=Object.keys(C),R=A.length)}else if(1===R&&"@language"in C){const i=await w(C,{unmappedValue:C,activeCtx:t,activeProperty:e,element:c,options:l,insideList:u});C=void 0!==i?i:null}if(r(C)&&!l.keepFreeFloatingNodes&&!u&&(null===e||"@graph"===x)&&(0===R||"@value"in C||"@list"in C||1===R&&"@id"in C)){const i=await w({unmappedValue:C,activeCtx:t,activeProperty:e,element:c,options:l,insideList:u});C=void 0!==i?i:null}return C}}}),Bs=ue({"../node_modules/jsonld/lib/nodeMap.js"(t,e){var{isKeyword:i}=Us(),n=Ss(),r=Es(),o=As(),s=Fs(),a={};e.exports=a,a.createMergedNodeMap=(t,e)=>{const i=(e=e||{}).issuer||new o.IdentifierIssuer("_:b"),n={"@default":{}};return a.createNodeMap(t,n,"@default",i),a.mergeNodeMaps(n)},a.createNodeMap=(t,e,c,l,u,h)=>{if(r.isArray(t)){for(const i of t)a.createNodeMap(i,e,c,l,void 0,h);return}if(!r.isObject(t))return void(h&&h.push(t));if(n.isValue(t)){if("@type"in t){let e=t["@type"];0===e.indexOf("_:")&&(t["@type"]=e=l.getId(e))}return void(h&&h.push(t))}if(h&&n.isList(t)){const i=[];return a.createNodeMap(t["@list"],e,c,l,u,i),void h.push({"@list":i})}if("@type"in t){const e=t["@type"];for(const t of e)0===t.indexOf("_:")&&l.getId(t)}r.isUndefined(u)&&(u=n.isBlankNode(t)?l.getId(t["@id"]):t["@id"]),h&&h.push({"@id":u});const d=e[c],f=d[u]=d[u]||{};f["@id"]=u;const p=Object.keys(t).sort();for(let r of p){if("@id"===r)continue;if("@reverse"===r){const i={"@id":u},r=t["@reverse"];for(const t in r){const s=r[t];for(const r of s){let s=r["@id"];n.isBlankNode(r)&&(s=l.getId(s)),a.createNodeMap(r,e,c,l,s),o.addValue(d[s],t,i,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===r){u in e||(e[u]={}),a.createNodeMap(t[r],e,u,l);continue}if("@included"===r){a.createNodeMap(t[r],e,c,l);continue}if("@type"!==r&&i(r)){if("@index"===r&&r in f&&(t[r]!==f[r]||t[r]["@id"]!==f[r]["@id"]))throw new s("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:f});f[r]=t[r];continue}const h=t[r];if(0===r.indexOf("_:")&&(r=l.getId(r)),0!==h.length)for(let t of h)if("@type"===r&&(t=0===t.indexOf("_:")?l.getId(t):t),n.isSubject(t)||n.isSubjectReference(t)){if("@id"in t&&!t["@id"])continue;const i=n.isBlankNode(t)?l.getId(t["@id"]):t["@id"];o.addValue(f,r,{"@id":i},{propertyIsArray:!0,allowDuplicate:!1}),a.createNodeMap(t,e,c,l,i)}else if(n.isValue(t))o.addValue(f,r,t,{propertyIsArray:!0,allowDuplicate:!1});else if(n.isList(t)){const i=[];a.createNodeMap(t["@list"],e,c,l,u,i),t={"@list":i},o.addValue(f,r,t,{propertyIsArray:!0,allowDuplicate:!1})}else a.createNodeMap(t,e,c,l,u),o.addValue(f,r,t,{propertyIsArray:!0,allowDuplicate:!1});else o.addValue(f,r,[],{propertyIsArray:!0})}},a.mergeNodeMapGraphs=t=>{const e={};for(const n of Object.keys(t).sort())for(const r of Object.keys(t[n]).sort()){const s=t[n][r];r in e||(e[r]={"@id":r});const a=e[r];for(const t of Object.keys(s).sort())if(i(t)&&"@type"!==t)a[t]=o.clone(s[t]);else for(const e of s[t])o.addValue(a,t,o.clone(e),{propertyIsArray:!0,allowDuplicate:!1})}return e},a.mergeNodeMaps=t=>{const e=t["@default"],i=Object.keys(t).sort();for(const r of i){if("@default"===r)continue;const i=t[r];let o=e[r];o?"@graph"in o||(o["@graph"]=[]):e[r]=o={"@id":r,"@graph":[]};const s=o["@graph"];for(const t of Object.keys(i).sort()){const e=i[t];n.isSubjectReference(e)||s.push(e)}}return e}}}),Js=ue({"../node_modules/jsonld/lib/flatten.js"(t,e){var{isSubjectReference:i}=Ss(),{createMergedNodeMap:n}=Bs(),r={};e.exports=r,r.flatten=t=>{const e=n(t),r=[],o=Object.keys(e).sort();for(let t=0;t<o.length;++t){const n=e[o[t]];i(n)||r.push(n)}return r}}}),$s=ue({"../node_modules/jsonld/lib/fromRdf.js"(t,e){var i=Fs(),n=Ss(),r=Es(),o=As(),{RDF_LIST:s,RDF_FIRST:a,RDF_REST:c,RDF_NIL:l,RDF_TYPE:u,RDF_JSON_LITERAL:h,XSD_BOOLEAN:d,XSD_DOUBLE:f,XSD_INTEGER:p,XSD_STRING:v}=_s(),g=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,m={};function w(t,e,n){if(t.termType.endsWith("Node"))return{"@id":t.value};const o={"@value":t.value};if(t.language)o["@language"]=t.language;else{let s=t.datatype.value;if(s||(s=v),s===h){s="@json";try{o["@value"]=JSON.parse(o["@value"])}catch(t){throw new i("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:o["@value"],cause:t})}}if(e){if(s===d)"true"===o["@value"]?o["@value"]=!0:"false"===o["@value"]&&(o["@value"]=!1);else if(r.isNumeric(o["@value"]))if(s===p){const t=parseInt(o["@value"],10);t.toFixed(0)===o["@value"]&&(o["@value"]=t)}else s===f&&(o["@value"]=parseFloat(o["@value"]));[d,p,f,v].includes(s)||(o["@type"]=s)}else if("i18n-datatype"===n&&s.startsWith("https://www.w3.org/ns/i18n#")){const[,t,e]=s.split(/[#_]/);t.length>0&&(o["@language"]=t,t.match(g)||console.warn(`@language must be valid BCP47: ${t}`)),o["@direction"]=e}else s!==v&&(o["@type"]=s)}return o}e.exports=m,m.fromRDF=async(t,{useRdfType:e=!1,useNativeTypes:i=!1,rdfDirection:h=null})=>{const d={},f={"@default":d},p={};for(const n of t){const t="DefaultGraph"===n.graph.termType?"@default":n.graph.value;t in f||(f[t]={}),"@default"===t||t in d||(d[t]={"@id":t});const r=f[t],s=n.subject.value,a=n.predicate.value,c=n.object;s in r||(r[s]={"@id":s});const v=r[s],g=c.termType.endsWith("Node");if(g&&!(c.value in r)&&(r[c.value]={"@id":c.value}),a===u&&!e&&g){o.addValue(v,"@type",c.value,{propertyIsArray:!0});continue}const m=w(c,i,h);if(o.addValue(v,a,m,{propertyIsArray:!0}),g)if(c.value===l){const t=r[c.value];"usages"in t||(t.usages=[]),t.usages.push({node:v,property:a,value:m})}else p[c.value]=!(c.value in p)&&{node:v,property:a,value:m}}for(const t in f){const e=f[t];if(!(l in e))continue;const i=e[l];if(i.usages){for(let t of i.usages){let i=t.node,o=t.property,l=t.value;const u=[],h=[];let d=Object.keys(i).length;for(;o===c&&r.isObject(p[i["@id"]])&&r.isArray(i[a])&&1===i[a].length&&r.isArray(i[c])&&1===i[c].length&&(3===d||4===d&&r.isArray(i["@type"])&&1===i["@type"].length&&i["@type"][0]===s)&&(u.push(i[a][0]),h.push(i["@id"]),t=p[i["@id"]],i=t.node,o=t.property,l=t.value,d=Object.keys(i).length,n.isBlankNode(i)););delete l["@id"],l["@list"]=u.reverse();for(const t of h)delete e[t]}delete i.usages}}const v=[],g=Object.keys(d).sort();for(const t of g){const e=d[t];if(t in f){const i=e["@graph"]=[],r=f[t],o=Object.keys(r).sort();for(const t of o){const e=r[t];n.isSubjectReference(e)||i.push(e)}}n.isSubjectReference(e)||v.push(e)}return v}}}),zs=ue({"../node_modules/canonicalize/lib/canonicalize.js"(t,e){e.exports=function t(e){return null===e||"object"!=typeof e||null!=e.toJSON?JSON.stringify(e):Array.isArray(e)?"["+e.reduce(((e,i,n)=>e+(0===n?"":",")+t(void 0===i||"symbol"==typeof i?null:i)),"")+"]":"{"+Object.keys(e).sort().reduce(((i,n)=>void 0===e[n]||"symbol"==typeof e[n]?i:i+(0===i.length?"":",")+t(n)+":"+t(e[n])),"")+"}"}}}),Hs=ue({"../node_modules/jsonld/lib/toRdf.js"(t,e){var{createNodeMap:i}=Bs(),{isKeyword:n}=Us(),r=Ss(),o=zs(),s=Es(),a=As(),{RDF_FIRST:c,RDF_REST:l,RDF_NIL:u,RDF_TYPE:h,RDF_JSON_LITERAL:d,RDF_LANGSTRING:f,XSD_BOOLEAN:p,XSD_DOUBLE:v,XSD_INTEGER:g,XSD_STRING:m}=_s(),{isAbsolute:w}=Cs(),b={};function y(t,e,i,r,o){const s=Object.keys(e).sort();for(const a of s){const s=e[a],c=Object.keys(s).sort();for(let e of c){const c=s[e];if("@type"===e)e=h;else if(n(e))continue;for(const n of c){const s={termType:a.startsWith("_:")?"BlankNode":"NamedNode",value:a};if(!w(a))continue;const c={termType:e.startsWith("_:")?"BlankNode":"NamedNode",value:e};if(!w(e))continue;if("BlankNode"===c.termType&&!o.produceGeneralizedRdf)continue;const l=x(n,r,t,i,o.rdfDirection);l&&t.push({subject:s,predicate:c,object:l,graph:i})}}}}function x(t,e,i,n,a){const h={};if(r.isValue(t)){h.termType="Literal",h.value=void 0,h.datatype={termType:"NamedNode"};let e=t["@value"];const i=t["@type"]||null;"@json"===i?(h.value=o(e),h.datatype.value=d):s.isBoolean(e)?(h.value=e.toString(),h.datatype.value=i||p):s.isDouble(e)||i===v?(s.isDouble(e)||(e=parseFloat(e)),h.value=e.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),h.datatype.value=i||v):s.isNumber(e)?(h.value=e.toFixed(0),h.datatype.value=i||g):"i18n-datatype"===a&&"@direction"in t?(h.datatype.value="https://www.w3.org/ns/i18n#"+(t["@language"]||"")+`_${t["@direction"]}`,h.value=e):"@language"in t?(h.value=e,h.datatype.value=i||f,h.language=t["@language"]):(h.value=e,h.datatype.value=i||m)}else if(r.isList(t)){const r=function(t,e,i,n,r){const o={termType:"NamedNode",value:c},s={termType:"NamedNode",value:l},a={termType:"NamedNode",value:u},h=t.pop(),d=h?{termType:"BlankNode",value:e.getId()}:a;let f=d;for(const a of t){const t=x(a,e,i,n,r),c={termType:"BlankNode",value:e.getId()};i.push({subject:f,predicate:o,object:t,graph:n}),i.push({subject:f,predicate:s,object:c,graph:n}),f=c}if(h){const t=x(h,e,i,n,r);i.push({subject:f,predicate:o,object:t,graph:n}),i.push({subject:f,predicate:s,object:a,graph:n})}return d}(t["@list"],e,i,n,a);h.termType=r.termType,h.value=r.value}else{const e=s.isObject(t)?t["@id"]:t;h.termType=e.startsWith("_:")?"BlankNode":"NamedNode",h.value=e}return"NamedNode"!==h.termType||w(h.value)?h:null}e.exports=b,b.toRDF=(t,e)=>{const n=new a.IdentifierIssuer("_:b"),r={"@default":{}};i(t,r,"@default",n);const o=[],s=Object.keys(r).sort();for(const t of s){let i;if("@default"===t)i={termType:"DefaultGraph",value:""};else{if(!w(t))continue;i=t.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},i.value=t}y(o,r[t],i,n,e)}return o}}}),Ks=ue({"../node_modules/jsonld/lib/frame.js"(t,e){var{isKeyword:i}=Us(),n=Ss(),r=Es(),o=As(),s=Cs(),a=Fs(),{createNodeMap:c,mergeNodeMapGraphs:l}=Bs(),u={};function h(t){const e={};for(const i in t)void 0!==t[i]&&(e["@"+i]=[t[i]]);return[e]}function d(t,e,i){for(let n=i.length-1;n>=0;--n){const r=i[n];if(r.graph===e&&r.subject["@id"]===t["@id"])return!0}return!1}function f(t,e,i){const n="@"+i;let r=n in t?t[n][0]:e[i];if("embed"===i)if(!0===r)r="@once";else if(!1===r)r="@never";else if("@always"!==r&&"@never"!==r&&"@link"!==r&&"@first"!==r&&"@last"!==r&&"@once"!==r)throw new a("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:t});return r}function p(t){if(!r.isArray(t)||1!==t.length||!r.isObject(t[0]))throw new a("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:t});if("@id"in t[0])for(const e of o.asArray(t[0]["@id"]))if(!r.isObject(e)&&!s.isAbsolute(e)||r.isString(e)&&0===e.indexOf("_:"))throw new a("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:t});if("@type"in t[0])for(const e of o.asArray(t[0]["@type"]))if(!r.isObject(e)&&!s.isAbsolute(e)||r.isString(e)&&0===e.indexOf("_:"))throw new a("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:t})}function v(t,e,s,a){let c=!0,l=!1;for(const u in s){let h=!1;const d=o.getValues(e,u),f=0===o.getValues(s,u).length;if("@id"===u){if(r.isEmptyObject(s["@id"][0]||{})?h=!0:s["@id"].length>=0&&(h=s["@id"].includes(d[0])),!a.requireAll)return h}else if("@type"===u){if(c=!1,f){if(d.length>0)return!1;h=!0}else if(1===s["@type"].length&&r.isEmptyObject(s["@type"][0]))h=d.length>0;else for(const t of s["@type"])h=!(!r.isObject(t)||!("@default"in t))||h||d.some((e=>e===t));if(!a.requireAll)return h}else{if(i(u))continue;{const e=o.getValues(s,u)[0];let i=!1;if(e&&(p([e]),i="@default"in e),c=!1,0===d.length&&i)continue;if(d.length>0&&f)return!1;if(void 0===e){if(d.length>0)return!1;h=!0}else if(n.isList(e)){const i=e["@list"][0];if(n.isList(d[0])){const e=d[0]["@list"];n.isValue(i)?h=e.some((t=>y(i,t))):(n.isSubject(i)||n.isSubjectReference(i))&&(h=e.some((e=>b(t,i,e,a))))}}else h=n.isValue(e)?d.some((t=>y(e,t))):n.isSubjectReference(e)?d.some((i=>b(t,e,i,a))):!!r.isObject(e)&&d.length>0}}if(!h&&a.requireAll)return!1;l=l||h}return c||l}function g(t,e){const i=t.uniqueEmbeds[t.graph],n=i[e],s=n.parent,a=n.property,c={"@id":e};if(r.isArray(s)){for(let t=0;t<s.length;++t)if(o.compareValues(s[t],c)){s[t]=c;break}}else{const t=r.isArray(s[a]);o.removeValue(s,a,c,{propertyIsArray:t}),o.addValue(s,a,c,{propertyIsArray:t})}const l=t=>{const e=Object.keys(i);for(const n of e)n in i&&r.isObject(i[n].parent)&&i[n].parent["@id"]===t&&(delete i[n],l(n))};l(e)}function m(t,e){if(r.isArray(t))return t.map((t=>m(t,e)));if(r.isObject(t)){if("@preserve"in t)return t["@preserve"][0];if(n.isValue(t))return t;if(n.isList(t))return t["@list"]=m(t["@list"],e),t;if("@id"in t){const i=t["@id"];if(e.link.hasOwnProperty(i)){const n=e.link[i].indexOf(t);if(-1!==n)return e.link[i][n];e.link[i].push(t)}else e.link[i]=[t]}for(const i in t)"@id"===i&&e.bnodesToClear.includes(t[i])?delete t["@id"]:t[i]=m(t[i],e)}return t}function w(t,e,i){r.isObject(t)?o.addValue(t,e,i,{propertyIsArray:!0}):t.push(i)}function b(t,e,i,n){if(!("@id"in i))return!1;const r=t.subjects[i["@id"]];return r&&v(t,r,e,n)}function y(t,e){const i=e["@value"],n=e["@type"],o=e["@language"],s=t["@value"]?r.isArray(t["@value"])?t["@value"]:[t["@value"]]:[],a=t["@type"]?r.isArray(t["@type"])?t["@type"]:[t["@type"]]:[],c=t["@language"]?r.isArray(t["@language"])?t["@language"]:[t["@language"]]:[];return 0===s.length&&0===a.length&&0===c.length||!(!s.includes(i)&&!r.isEmptyObject(s[0]))&&!!(!n&&0===a.length||a.includes(n)||n&&r.isEmptyObject(a[0]))&&!!(!o&&0===c.length||c.includes(o)||o&&r.isEmptyObject(c[0]))}e.exports=u,u.frameMergedOrDefault=(t,e,i)=>{const n={options:i,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},r=new o.IdentifierIssuer("_:b");c(t,n.graphMap,"@default",r),i.merged&&(n.graphMap["@merged"]=l(n.graphMap),n.graph="@merged"),n.subjects=n.graphMap[n.graph];const s=[];return u.frame(n,Object.keys(n.subjects).sort(),e,s),i.pruneBlankNodeIdentifiers&&(i.bnodesToClear=Object.keys(n.bnodeMap).filter((t=>1===n.bnodeMap[t].length))),i.link={},m(s,i)},u.frame=(t,e,s,c,l=null)=>{p(s);const m=t.options,b={embed:f(s=s[0],m,"embed"),explicit:f(s,m,"explicit"),requireAll:f(s,m,"requireAll")};t.link.hasOwnProperty(t.graph)||(t.link[t.graph]={});const x=t.link[t.graph],k=function(t,e,i,n){const r={};for(const o of e){const e=t.graphMap[t.graph][o];v(t,e,i,n)&&(r[o]=e)}return r}(t,e,s,b),E=Object.keys(k).sort();for(const p of E){const v=k[p];if(null===l?t.uniqueEmbeds={[t.graph]:{}}:t.uniqueEmbeds[t.graph]=t.uniqueEmbeds[t.graph]||{},"@link"===b.embed&&p in x){w(c,l,x[p]);continue}const E={"@id":p};if(0===p.indexOf("_:")&&o.addValue(t.bnodeMap,p,E,{propertyIsArray:!0}),x[p]=E,("@first"===b.embed||"@last"===b.embed)&&t.is11)throw new a("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:s});if(t.embedded||!t.uniqueEmbeds[t.graph].hasOwnProperty(p))if(!t.embedded||"@never"!==b.embed&&!d(v,t.graph,t.subjectStack))if(!t.embedded||"@first"!=b.embed&&"@once"!=b.embed||!t.uniqueEmbeds[t.graph].hasOwnProperty(p)){if("@last"===b.embed&&p in t.uniqueEmbeds[t.graph]&&g(t,p),t.uniqueEmbeds[t.graph][p]={parent:c,property:l},t.subjectStack.push({subject:v,graph:t.graph}),p in t.graphMap){let e=!1,i=null;"@graph"in s?(i=s["@graph"][0],e=!("@merged"===p||"@default"===p),r.isObject(i)||(i={})):(e="@merged"!==t.graph,i={}),e&&u.frame({...t,graph:p,embedded:!1},Object.keys(t.graphMap[p]).sort(),[i],E,"@graph")}"@included"in s&&u.frame({...t,embedded:!1},e,s["@included"],E,"@included");for(const e of Object.keys(v).sort())if(i(e)){if(E[e]=o.clone(v[e]),"@type"===e)for(const e of v["@type"])0===e.indexOf("_:")&&o.addValue(t.bnodeMap,e,E,{propertyIsArray:!0})}else if(!b.explicit||e in s)for(const i of v[e]){const r=e in s?s[e]:h(b);if(n.isList(i)){const r=s[e]&&s[e][0]&&s[e][0]["@list"]?s[e][0]["@list"]:h(b),a={"@list":[]};w(E,e,a);const c=i["@list"];for(const e of c)n.isSubjectReference(e)?u.frame({...t,embedded:!0},[e["@id"]],r,a,"@list"):w(a,"@list",o.clone(e))}else n.isSubjectReference(i)?u.frame({...t,embedded:!0},[i["@id"]],r,E,e):y(r[0],i)&&w(E,e,o.clone(i))}for(const t of Object.keys(s).sort()){if("@type"===t){if(!r.isObject(s[t][0])||!("@default"in s[t][0]))continue}else if(i(t))continue;const e=s[t][0]||{};if(!f(e,m,"omitDefault")&&!(t in E)){let i="@null";"@default"in e&&(i=o.clone(e["@default"])),r.isArray(i)||(i=[i]),E[t]=[{"@preserve":i}]}}for(const e of Object.keys(s["@reverse"]||{}).sort()){const i=s["@reverse"][e];for(const n of Object.keys(t.subjects))o.getValues(t.subjects[n],e).some((t=>t["@id"]===p))&&(E["@reverse"]=E["@reverse"]||{},o.addValue(E["@reverse"],e,[],{propertyIsArray:!0}),u.frame({...t,embedded:!0},[n],i,E["@reverse"][e],l))}w(c,l,E),t.subjectStack.pop()}else w(c,l,E);else w(c,l,E)}},u.cleanupNull=(t,e)=>{if(r.isArray(t))return t.map((t=>u.cleanupNull(t,e))).filter((t=>t));if("@null"===t)return null;if(r.isObject(t)){if("@id"in t){const i=t["@id"];if(e.link.hasOwnProperty(i)){const n=e.link[i].indexOf(t);if(-1!==n)return e.link[i][n];e.link[i].push(t)}else e.link[i]=[t]}for(const i in t)t[i]=u.cleanupNull(t[i],e)}return t}}}),Ws=ue({"../node_modules/jsonld/lib/compact.js"(t,e){var i=Fs(),{isArray:n,isObject:r,isString:o,isUndefined:s}=Es(),{isList:a,isValue:c,isGraph:l,isSimpleGraph:u,isSubjectReference:h}=Ss(),{expandIri:d,getContextValue:f,isKeyword:p,process:v,processingMode:g}=Us(),{removeBase:m,prependBase:w}=Cs(),{addValue:b,asArray:y,compareShortestLeast:x}=As(),k={};function E(t,e,n){if("@nest"!==d(t,e,{vocab:!0},n))throw new i("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}e.exports=k,k.compact=async({activeCtx:t,activeProperty:e=null,element:d,options:m={},compactionMap:w=(()=>{})})=>{if(n(d)){let i=[];for(let n=0;n<d.length;++n){let r=await k.compact({activeCtx:t,activeProperty:e,element:d[n],options:m,compactionMap:w});null===r&&(r=await w({unmappedValue:d[n],activeCtx:t,activeProperty:e,parent:d,index:n,options:m}),void 0===r)||i.push(r)}return m.compactArrays&&1===i.length&&0===(f(t,e,"@container")||[]).length&&(i=i[0]),i}const x=f(t,e,"@context");if(s(x)||(t=await v({activeCtx:t,localCtx:x,propagate:!0,overrideProtected:!0,options:m})),r(d)){if(m.link&&"@id"in d&&m.link.hasOwnProperty(d["@id"])){const t=m.link[d["@id"]];for(let e=0;e<t.length;++e)if(t[e].expanded===d)return t[e].compacted}if(c(d)||h(d)){const i=k.compactValue({activeCtx:t,activeProperty:e,value:d,options:m});return m.link&&h(d)&&(m.link.hasOwnProperty(d["@id"])||(m.link[d["@id"]]=[]),m.link[d["@id"]].push({expanded:d,compacted:i})),i}if(a(d)&&(f(t,e,"@container")||[]).includes("@list"))return k.compact({activeCtx:t,activeProperty:e,element:d["@list"],options:m,compactionMap:w});const x="@reverse"===e,S={},F=t;c(d)||h(d)||(t=t.revertToPreviousContext());const A=f(F,e,"@context");s(A)||(t=await v({activeCtx:t,localCtx:A,propagate:!0,overrideProtected:!0,options:m})),m.link&&"@id"in d&&(m.link.hasOwnProperty(d["@id"])||(m.link[d["@id"]]=[]),m.link[d["@id"]].push({expanded:d,compacted:S}));let _=d["@type"]||[];_.length>1&&(_=Array.from(_).sort());const j=t;for(const e of _){const i=k.compactIri({activeCtx:j,iri:e,relativeTo:{vocab:!0}}),n=f(F,i,"@context");s(n)||(t=await v({activeCtx:t,localCtx:n,options:m,propagate:!1}))}const C=Object.keys(d).sort();for(const s of C){const h=d[s];if("@id"!==s)if("@type"!==s)if("@reverse"!==s)if("@preserve"!==s)if("@index"!==s)if("@graph"!==s&&"@list"!==s&&"@included"!==s&&p(s)){const e=k.compactIri({activeCtx:t,iri:s,relativeTo:{vocab:!0}});b(S,e,h)}else{if(!n(h))throw new i("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===h.length){const e=k.compactIri({activeCtx:t,iri:s,value:h,relativeTo:{vocab:!0},reverse:x}),i=t.mappings.has(e)?t.mappings.get(e)["@nest"]:null;let n=S;i&&(E(t,i,m),r(S[i])||(S[i]={}),n=S[i]),b(n,e,h,{propertyIsArray:!0})}for(const e of h){const i=k.compactIri({activeCtx:t,iri:s,value:e,relativeTo:{vocab:!0},reverse:x}),h=t.mappings.has(i)?t.mappings.get(i)["@nest"]:null;let d=S;h&&(E(t,h,m),r(S[h])||(S[h]={}),d=S[h]);const p=f(t,i,"@container")||[],v=l(e),g=a(e);let F;g?F=e["@list"]:v&&(F=e["@graph"]);let A=await k.compact({activeCtx:t,activeProperty:i,element:g||v?F:e,options:m,compactionMap:w});if(g){if(n(A)||(A=[A]),p.includes("@list")){b(d,i,A,{valueIsArray:!0,allowDuplicate:!0});continue}A={[k.compactIri({activeCtx:t,iri:"@list",relativeTo:{vocab:!0}})]:A},"@index"in e&&(A[k.compactIri({activeCtx:t,iri:"@index",relativeTo:{vocab:!0}})]=e["@index"])}if(v)if(p.includes("@graph")&&(p.includes("@id")||p.includes("@index")&&u(e))){let n;d.hasOwnProperty(i)?n=d[i]:d[i]=n={};const r=(p.includes("@id")?e["@id"]:e["@index"])||k.compactIri({activeCtx:t,iri:"@none",relativeTo:{vocab:!0}});b(n,r,A,{propertyIsArray:!m.compactArrays||p.includes("@set")})}else p.includes("@graph")&&u(e)?(n(A)&&A.length>1&&(A={"@included":A}),b(d,i,A,{propertyIsArray:!m.compactArrays||p.includes("@set")})):(n(A)&&1===A.length&&m.compactArrays&&(A=A[0]),A={[k.compactIri({activeCtx:t,iri:"@graph",relativeTo:{vocab:!0}})]:A},"@id"in e&&(A[k.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}})]=e["@id"]),"@index"in e&&(A[k.compactIri({activeCtx:t,iri:"@index",relativeTo:{vocab:!0}})]=e["@index"]),b(d,i,A,{propertyIsArray:!m.compactArrays||p.includes("@set")}));else if(p.includes("@language")||p.includes("@index")||p.includes("@id")||p.includes("@type")){let n,r;if(d.hasOwnProperty(i)?n=d[i]:d[i]=n={},p.includes("@language"))c(A)&&(A=A["@value"]),r=e["@language"];else if(p.includes("@index")){const n=f(t,i,"@index")||"@index",s=k.compactIri({activeCtx:t,iri:n,relativeTo:{vocab:!0}});if("@index"===n)r=e["@index"],delete A[s];else{let t;if([r,...t]=y(A[n]||[]),o(r))switch(t.length){case 0:delete A[n];break;case 1:A[n]=t[0];break;default:A[n]=t}else r=null}}else if(p.includes("@id")){const e=k.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}});r=A[e],delete A[e]}else if(p.includes("@type")){const n=k.compactIri({activeCtx:t,iri:"@type",relativeTo:{vocab:!0}});let o;switch([r,...o]=y(A[n]||[]),o.length){case 0:delete A[n];break;case 1:A[n]=o[0];break;default:A[n]=o}1===Object.keys(A).length&&"@id"in e&&(A=await k.compact({activeCtx:t,activeProperty:i,element:{"@id":e["@id"]},options:m,compactionMap:w}))}r||(r=k.compactIri({activeCtx:t,iri:"@none",relativeTo:{vocab:!0}})),b(n,r,A,{propertyIsArray:p.includes("@set")})}else{const t=!m.compactArrays||p.includes("@set")||p.includes("@list")||n(A)&&0===A.length||"@list"===s||"@graph"===s;b(d,i,A,{propertyIsArray:t})}}}else{if((f(t,e,"@container")||[]).includes("@index"))continue;const i=k.compactIri({activeCtx:t,iri:s,relativeTo:{vocab:!0}});b(S,i,h)}else{const i=await k.compact({activeCtx:t,activeProperty:e,element:h,options:m,compactionMap:w});n(i)&&0===i.length||b(S,s,i)}else{const e=await k.compact({activeCtx:t,activeProperty:"@reverse",element:h,options:m,compactionMap:w});for(const i in e)if(t.mappings.has(i)&&t.mappings.get(i).reverse){const n=e[i],r=(f(t,i,"@container")||[]).includes("@set")||!m.compactArrays;b(S,i,n,{propertyIsArray:r}),delete e[i]}if(Object.keys(e).length>0){const i=k.compactIri({activeCtx:t,iri:s,relativeTo:{vocab:!0}});b(S,i,e)}}else{let e=y(h).map((t=>k.compactIri({activeCtx:F,iri:t,relativeTo:{vocab:!0}})));1===e.length&&(e=e[0]);const i=k.compactIri({activeCtx:t,iri:"@type",relativeTo:{vocab:!0}}),r=(f(t,i,"@container")||[]).includes("@set")&&g(t,1.1)||n(e)&&0===h.length;b(S,i,e,{propertyIsArray:r})}else{let e=y(h).map((e=>k.compactIri({activeCtx:t,iri:e,relativeTo:{vocab:!1},base:m.base})));1===e.length&&(e=e[0]),S[k.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}})]=e}}return S}return d},k.compactIri=({activeCtx:t,iri:e,value:n=null,relativeTo:o={vocab:!1},reverse:s=!1,base:u=null})=>{if(null===e)return e;t.isPropertyTermScoped&&t.previousContext&&(t=t.previousContext);const h=t.getInverse();if(p(e)&&e in h&&"@none"in h[e]&&"@type"in h[e]["@none"]&&"@none"in h[e]["@none"]["@type"])return h[e]["@none"]["@type"]["@none"];if(o.vocab&&e in h){const i=t["@language"]||"@none",o=[];r(n)&&"@index"in n&&!("@graph"in n)&&o.push("@index","@index@set"),r(n)&&"@preserve"in n&&(n=n["@preserve"][0]),l(n)?("@index"in n&&o.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n&&o.push("@graph@id","@graph@id@set"),o.push("@graph","@graph@set","@set"),"@index"in n||o.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n||o.push("@graph@id","@graph@id@set")):r(n)&&!c(n)&&o.push("@id","@id@set","@type","@set@type");let u="@language",h="@null";if(s)u="@type",h="@reverse",o.push("@set");else if(a(n)){"@index"in n||o.push("@list");const t=n["@list"];if(0===t.length)u="@any",h="@none";else{let e=0===t.length?i:null,n=null;for(let i=0;i<t.length;++i){const r=t[i];let o="@none",s="@none";if(c(r)?"@direction"in r?o=`${(r["@language"]||"").toLowerCase()}_${r["@direction"]}`:"@language"in r?o=r["@language"].toLowerCase():"@type"in r?s=r["@type"]:o="@null":s="@id",null===e?e=o:o!==e&&c(r)&&(e="@none"),null===n?n=s:s!==n&&(n="@none"),"@none"===e&&"@none"===n)break}e=e||"@none",n=n||"@none","@none"!==n?(u="@type",h=n):h=e}}else{if(c(n))if("@language"in n&&!("@index"in n)){o.push("@language","@language@set"),h=n["@language"];const t=n["@direction"];t&&(h=`${h}_${t}`)}else"@direction"in n&&!("@index"in n)?h=`_${n["@direction"]}`:"@type"in n&&(u="@type",h=n["@type"]);else u="@type",h="@id";o.push("@set")}o.push("@none"),r(n)&&!("@index"in n)&&o.push("@index","@index@set"),c(n)&&1===Object.keys(n).length&&o.push("@language","@language@set");const d=function(t,e,i,n,o,s){null===s&&(s="@null");const a=[];if(("@id"===s||"@reverse"===s)&&r(i)&&"@id"in i){"@reverse"===s&&a.push("@reverse");const e=k.compactIri({activeCtx:t,iri:i["@id"],relativeTo:{vocab:!0}});t.mappings.has(e)&&t.mappings.get(e)&&t.mappings.get(e)["@id"]===i["@id"]?a.push.apply(a,["@vocab","@id"]):a.push.apply(a,["@id","@vocab"])}else{a.push(s);const t=a.find((t=>t.includes("_")));t&&a.push(t.replace(/^[^_]+_/,"_"))}a.push("@none");const c=t.inverse[e];for(const t of n){if(!(t in c))continue;const e=c[t][o];for(const t of a)if(t in e)return e[t]}return null}(t,e,n,o,u,h);if(null!==d)return d}if(o.vocab&&"@vocab"in t){const i=t["@vocab"];if(0===e.indexOf(i)&&e!==i){const n=e.substr(i.length);if(!t.mappings.has(n))return n}}let d=null;const f=[];let v=t.fastCurieMap;const g=e.length-1;for(let t=0;t<g&&e[t]in v;++t)v=v[e[t]],""in v&&f.push(v[""][0]);for(let i=f.length-1;i>=0;--i){const r=f[i],o=r.terms;for(const i of o){const o=i+":"+e.substr(r.iri.length);t.mappings.get(i)._prefix&&(!t.mappings.has(o)||null===n&&t.mappings.get(o)["@id"]===e)&&(null===d||x(o,d)<0)&&(d=o)}}if(null!==d)return d;for(const[n,r]of t.mappings)if(r&&r._prefix&&e.startsWith(n+":"))throw new i(`Absolute IRI "${e}" confused with prefix "${n}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:t});return o.vocab?e:"@base"in t?t["@base"]?m(w(u,t["@base"]),e):e:m(u,e)},k.compactValue=({activeCtx:t,activeProperty:e,value:i,options:n})=>{if(c(i)){const n=f(t,e,"@type"),r=f(t,e,"@language"),s=f(t,e,"@direction"),a=f(t,e,"@container")||[],c="@index"in i&&!a.includes("@index");if(!c&&"@none"!==n){if(i["@type"]===n)return i["@value"];if("@language"in i&&i["@language"]===r&&"@direction"in i&&i["@direction"]===s)return i["@value"];if("@language"in i&&i["@language"]===r)return i["@value"];if("@direction"in i&&i["@direction"]===s)return i["@value"]}const l=Object.keys(i).length,u=1===l||2===l&&"@index"in i&&!c,h="@language"in t,d=o(i["@value"]),p=t.mappings.has(e)&&null===t.mappings.get(e)["@language"];if(u&&"@none"!==n&&(!h||!d||p))return i["@value"];const v={};return c&&(v[k.compactIri({activeCtx:t,iri:"@index",relativeTo:{vocab:!0}})]=i["@index"]),"@type"in i?v[k.compactIri({activeCtx:t,iri:"@type",relativeTo:{vocab:!0}})]=k.compactIri({activeCtx:t,iri:i["@type"],relativeTo:{vocab:!0}}):"@language"in i&&(v[k.compactIri({activeCtx:t,iri:"@language",relativeTo:{vocab:!0}})]=i["@language"]),"@direction"in i&&(v[k.compactIri({activeCtx:t,iri:"@direction",relativeTo:{vocab:!0}})]=i["@direction"]),v[k.compactIri({activeCtx:t,iri:"@value",relativeTo:{vocab:!0}})]=i["@value"],v}const r=d(t,e,{vocab:!0},n),s=f(t,e,"@type"),a=k.compactIri({activeCtx:t,iri:i["@id"],relativeTo:{vocab:"@vocab"===s},base:n.base});return"@id"===s||"@vocab"===s||"@graph"===r?a:{[k.compactIri({activeCtx:t,iri:"@id",relativeTo:{vocab:!0}})]:a}}}}),qs=ue({"../node_modules/jsonld/lib/JsonLdProcessor.js"(t,e){e.exports=t=>{class e{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(e,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(e.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:e}),e.compact=function(e,i){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):t.compact(e,i)},e.expand=function(e){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):t.expand(e)},e.flatten=function(e){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):t.flatten(e)},e}}}),Vs=ue({"../node_modules/jsonld/lib/jsonld.js"(t,e){var i=ks(),n=Is(),r=As(),o=Ds(),s=r.IdentifierIssuer,a=Fs(),c=Ps(),l=Ms(),{expand:u}=Ls(),{flatten:h}=Js(),{fromRDF:d}=$s(),{toRDF:f}=Hs(),{frameMergedOrDefault:p,cleanupNull:v}=Ks(),{isArray:g,isObject:m,isString:w}=Es(),{isSubjectReference:b}=Ss(),{expandIri:y,getInitialContext:x,process:k,processingMode:E}=Us(),{compact:S,compactIri:F}=Ws(),{createNodeMap:A,createMergedNodeMap:_,mergeNodeMaps:j}=Bs(),C=function(t){const e={},C=new c({max:100});function R(e,{documentLoader:i=t.documentLoader,...n}){return Object.assign({},{documentLoader:i},n,e)}return t.compact=async function(e,i,n){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===i)throw new a("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===e)return null;let c;(n=R(n,{base:w(e)?e:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new s("_:b"),contextResolver:new o({sharedCache:C})})).link&&(n.skipExpansion=!0),n.compactToRelative||delete n.base,c=n.skipExpansion?e:await t.expand(e,n);const l=await t.processContext(x(n),i,n);let u=await S({activeCtx:l,element:c,options:n,compactionMap:n.compactionMap});n.compactArrays&&!n.graph&&g(u)?1===u.length?u=u[0]:0===u.length&&(u={}):n.graph&&m(u)&&(u=[u]),m(i)&&"@context"in i&&(i=i["@context"]),i=r.clone(i),g(i)||(i=[i]);const h=i;i=[];for(let t=0;t<h.length;++t)(!m(h[t])||Object.keys(h[t]).length>0)&&i.push(h[t]);const d=i.length>0;if(1===i.length&&(i=i[0]),g(u)){const t=F({activeCtx:l,iri:"@graph",relativeTo:{vocab:!0}}),e=u;u={},d&&(u["@context"]=i),u[t]=e}else if(m(u)&&d){const t=u;u={"@context":i};for(const e in t)u[e]=t[e]}return u},t.expand=async function(e,i){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");!1===(i=R(i,{keepFreeFloatingNodes:!1,contextResolver:new o({sharedCache:C})})).expansionMap&&(i.expansionMap=void 0);const n={},s=[];if("expandContext"in i){const t=r.clone(i.expandContext);n.expandContext=m(t)&&"@context"in t?t:{"@context":t},s.push(n.expandContext)}let a;if(w(e)){const r=await t.get(e,i);a=r.documentUrl,n.input=r.document,r.contextUrl&&(n.remoteContext={"@context":r.contextUrl},s.push(n.remoteContext))}else n.input=r.clone(e);"base"in i||(i.base=a||"");let c=x(i);for(const t of s)c=await k({activeCtx:c,localCtx:t,options:i});let l=await u({activeCtx:c,element:n.input,options:i,expansionMap:i.expansionMap});return m(l)&&"@graph"in l&&1===Object.keys(l).length?l=l["@graph"]:null===l&&(l=[]),g(l)||(l=[l]),l},t.flatten=async function(e,i,n){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");i="function"==typeof i?null:i||null,n=R(n,{base:w(e)?e:"",contextResolver:new o({sharedCache:C})});const r=await t.expand(e,n),s=h(r);if(null===i)return s;n.graph=!0,n.skipExpansion=!0;const a=await t.compact(s,i,n);return a},t.frame=async function(e,i,n){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(n=R(n,{base:w(e)?e:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new o({sharedCache:C})}),w(i)){const e=await t.get(i,n);if(i=e.document,e.contextUrl){let t=i["@context"];t?g(t)?t.push(e.contextUrl):t=[t,e.contextUrl]:t=e.contextUrl,i["@context"]=t}}const r=i&&i["@context"]||{},s=await t.processContext(x(n),r,n);n.hasOwnProperty("omitGraph")||(n.omitGraph=E(s,1.1)),n.hasOwnProperty("pruneBlankNodeIdentifiers")||(n.pruneBlankNodeIdentifiers=E(s,1.1));const a=await t.expand(e,n),c={...n};c.isFrame=!0,c.keepFreeFloatingNodes=!0;const l=await t.expand(i,c),u=Object.keys(i).map((t=>y(s,t,{vocab:!0})));c.merged=!u.includes("@graph"),c.is11=E(s,1.1);const h=p(a,l,c);c.graph=!n.omitGraph,c.skipExpansion=!0,c.link={},c.framing=!0;let d=await t.compact(h,r,c);return c.link={},d=v(d,c),d},t.link=async function(e,i,n){const r={};return i&&(r["@context"]=i),r["@embed"]="@link",t.frame(e,r,n)},t.normalize=t.canonize=async function(e,n){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(n=R(n,{base:w(e)?e:"",algorithm:"URDNA2015",skipExpansion:!1,contextResolver:new o({sharedCache:C})}))){if("application/n-quads"!==n.inputFormat&&"application/nquads"!==n.inputFormat)throw new a("Unknown canonicalization input format.","jsonld.CanonizeError");const t=l.parse(e);return i.canonize(t,n)}const r={...n};delete r.format,r.produceGeneralizedRdf=!1;const s=await t.toRDF(e,r);return i.canonize(s,n)},t.fromRDF=async function(t,i){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");i=R(i,{format:w(t)?"application/n-quads":void 0});const{format:n}=i;let{rdfParser:r}=i;if(n){if(r=r||e[n],!r)throw new a("Unknown input format.","jsonld.UnknownFormat",{format:n})}else r=()=>t;const o=await r(t);return d(o,i)},t.toRDF=async function(e,i){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let n;n=(i=R(i,{base:w(e)?e:"",skipExpansion:!1,contextResolver:new o({sharedCache:C})})).skipExpansion?e:await t.expand(e,i);const r=f(n,i);if(i.format){if("application/n-quads"===i.format||"application/nquads"===i.format)return l.serialize(r);throw new a("Unknown output format.","jsonld.UnknownFormat",{format:i.format})}return r},t.createNodeMap=async function(e,i){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");i=R(i,{base:w(e)?e:"",contextResolver:new o({sharedCache:C})});const n=await t.expand(e,i);return _(n,i)},t.merge=async function(e,i,n){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!g(e))throw new TypeError('Could not merge, "docs" must be an array.');i="function"==typeof i?null:i||null,n=R(n,{contextResolver:new o({sharedCache:C})});const a=await Promise.all(e.map((e=>{const i={...n};return t.expand(e,i)})));let c=!0;"mergeNodes"in n&&(c=n.mergeNodes);const l=n.issuer||new s("_:b"),u={"@default":{}};for(let t=0;t<a.length;++t){const e=r.relabelBlankNodes(a[t],{issuer:new s("_:b"+t+"-")}),i=c||0===t?u:{"@default":{}};if(A(e,i,"@default",l),i!==u)for(const t in i){const e=i[t];if(!(t in u)){u[t]=e;continue}const n=u[t];for(const t in e)t in n||(n[t]=e[t])}}const h=j(u),d=[],f=Object.keys(h).sort();for(let t=0;t<f.length;++t){const e=h[f[t]];b(e)||d.push(e)}if(null===i)return d;n.graph=!0,n.skipExpansion=!0;const p=await t.compact(d,i,n);return p},Object.defineProperty(t,"documentLoader",{get:()=>t._documentLoader,set:e=>t._documentLoader=e}),t.documentLoader=async t=>{throw new a("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:t})},t.get=async function(e,i){let n;n="function"==typeof i.documentLoader?i.documentLoader:t.documentLoader;const r=await n(e);try{if(!r.document)throw new a("No remote document found at the given URL.","jsonld.NullRemoteDocument");w(r.document)&&(r.document=JSON.parse(r.document))}catch(t){throw new a("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:t,remoteDoc:r})}return r},t.processContext=async function(t,e,i){return i=R(i,{base:"",contextResolver:new o({sharedCache:C})}),null===e?x(i):(e=r.clone(e),m(e)&&"@context"in e||(e={"@context":e}),k({activeCtx:t,localCtx:e,options:i}))},t.getContextValue=Us().getContextValue,t.documentLoaders={},t.useDocumentLoader=function(e){if(!(e in t.documentLoaders))throw new a('Unknown document loader type: "'+e+'"',"jsonld.UnknownDocumentLoader",{type:e});t.documentLoader=t.documentLoaders[e].apply(t,Array.prototype.slice.call(arguments,1))},t.registerRDFParser=function(t,i){e[t]=i},t.unregisterRDFParser=function(t){delete e[t]},t.registerRDFParser("application/n-quads",l.parse),t.registerRDFParser("application/nquads",l.parse),t.url=Cs(),t.util=r,Object.assign(t,r),t.promises=t,t.RequestQueue=js(),t.JsonLdProcessor=qs()(t),n.setupGlobals(t),n.setupDocumentLoaders(t),t},R=function(){return C((function(){return R()}))};C(R),e.exports=R}}),Gs=ue({"../node_modules/queue-microtask/index.js"(t,e){var i;e.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:global):t=>(i||(i=Promise.resolve())).then(t).catch((t=>setTimeout((()=>{throw t}),0)))}}),Xs=ue({"../node_modules/@babel/runtime/helpers/typeof.js"(t,e){function i(t){return e.exports=i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e.exports.__esModule=!0,e.exports.default=e.exports,i(t)}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}}),Ys=ue({"../node_modules/@babel/runtime/helpers/regeneratorRuntime.js"(t,e){var i=Xs().default;function n(){e.exports=n=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},r=Object.prototype,o=r.hasOwnProperty,s=Object.defineProperty||function(t,e,i){t[e]=i.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function h(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,i){return t[e]=i}}function d(t,e,i,n){var r=Object.create((e&&e.prototype instanceof v?e:v).prototype),o=new j(n||[]);return s(r,"_invoke",{value:S(t,i,o)}),r}function f(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}t.wrap=d;var p={};function v(){}function g(){}function m(){}var w={};h(w,c,(function(){return this}));var b=Object.getPrototypeOf,y=b&&b(b(C([])));y&&y!==r&&o.call(y,c)&&(w=y);var x=m.prototype=v.prototype=Object.create(w);function k(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function n(r,s,a,c){var l=f(t[r],t,s);if("throw"!==l.type){var u=l.arg,h=u.value;return h&&"object"==i(h)&&o.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,c)}))}c(l.arg)}var r;s(this,"_invoke",{value:function(t,i){function o(){return new e((function(e,r){n(t,i,e,r)}))}return r=r?r.then(o,o):o()}})}function S(t,e,i){var n="suspendedStart";return function(r,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===r)throw o;return{value:void 0,done:!0}}for(i.method=r,i.arg=o;;){var s=i.delegate;if(s){var a=F(s,i);if(a){if(a===p)continue;return a}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if("suspendedStart"===n)throw n="completed",i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n="executing";var c=f(t,e,i);if("normal"===c.type){if(n=i.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:i.done}}"throw"===c.type&&(n="completed",i.method="throw",i.arg=c.arg)}}}function F(t,e){var i=e.method,n=t.iterator[i];if(void 0===n)return e.delegate=null,"throw"===i&&t.iterator.return&&(e.method="return",e.arg=void 0,F(t,e),"throw"===e.method)||"return"!==i&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+i+"' method")),p;var r=f(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,p;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function C(t){if(t){var e=t[c];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,n=function e(){for(;++i<t.length;)if(o.call(t,i))return e.value=t[i],e.done=!1,e;return e.value=void 0,e.done=!0,e};return n.next=n}}return{next:R}}function R(){return{value:void 0,done:!0}}return g.prototype=m,s(x,"constructor",{value:m,configurable:!0}),s(m,"constructor",{value:g,configurable:!0}),g.displayName=h(m,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,h(t,u,"GeneratorFunction")),t.prototype=Object.create(x),t},t.awrap=function(t){return{__await:t}},k(E.prototype),h(E.prototype,l,(function(){return this})),t.AsyncIterator=E,t.async=function(e,i,n,r,o){void 0===o&&(o=Promise);var s=new E(d(e,i,n,r),o);return t.isGeneratorFunction(i)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},k(x),h(x,u,"Generator"),h(x,c,(function(){return this})),h(x,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),i=[];for(var n in e)i.push(n);return i.reverse(),function t(){for(;i.length;){var n=i.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=C,j.prototype={constructor:j,reset:function(t){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(_),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function i(i,n){return s.type="throw",s.arg=t,e.next=i,n&&(e.method="next",e.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n],s=r.completion;if("root"===r.tryLoc)return i("end");if(r.tryLoc<=this.prev){var a=o.call(r,"catchLoc"),c=o.call(r,"finallyLoc");if(a&&c){if(this.prev<r.catchLoc)return i(r.catchLoc,!0);if(this.prev<r.finallyLoc)return i(r.finallyLoc)}else if(a){if(this.prev<r.catchLoc)return i(r.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return i(r.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;i>=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var r=n;break}}r&&("break"===t||"continue"===t)&&r.tryLoc<=e&&e<=r.finallyLoc&&(r=null);var s=r?r.completion:{};return s.type=t,s.arg=e,r?(this.method="next",this.next=r.finallyLoc,p):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),_(i),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var n=i.completion;if("throw"===n.type){var r=n.arg;_(i)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,i){return this.delegate={iterator:C(t),resultName:e,nextLoc:i},"next"===this.method&&(this.arg=void 0),p}},t}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),Zs=ue({"../node_modules/@babel/runtime/regenerator/index.js"(t,e){var i=Ys()();e.exports=i;try{regeneratorRuntime=i}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=i:Function("r","regeneratorRuntime = r")(i)}}}),Qs=ue({"../node_modules/@xmldom/xmldom/lib/conventions.js"(t){function e(t,e){return void 0===e&&(e=Object),e&&"function"==typeof e.freeze?e.freeze(t):t}var i=e({HTML:"text/html",isHTML:function(t){return t===i.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),n=e({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(t){return t===n.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(t,e){if(null===t||"object"!=typeof t)throw new TypeError("target is not an object");for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},t.find=function(t,e,i){if(void 0===i&&(i=Array.prototype),t&&"function"==typeof i.find)return i.find.call(t,e);for(var n=0;n<t.length;n++)if(Object.prototype.hasOwnProperty.call(t,n)){var r=t[n];if(e.call(void 0,r,n,t))return r}},t.freeze=e,t.MIME_TYPE=i,t.NAMESPACE=n}}),ta=ue({"../node_modules/@xmldom/xmldom/lib/dom.js"(t){var e=Qs(),i=e.find,n=e.NAMESPACE;function r(t){return""!==t}function o(t,e){return t.hasOwnProperty(e)||(t[e]=!0),t}function s(t){if(!t)return[];var e=function(t){return t?t.split(/[\t\n\f\r ]+/).filter(r):[]}(t);return Object.keys(e.reduce(o,{}))}function a(t,e){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}function c(t,e){var i=t.prototype;if(!(i instanceof e)){let n=function(){};n.prototype=e.prototype,n=new n,a(i,n),t.prototype=i=n}i.constructor!=t&&("function"!=typeof t&&console.error("unknown Class:"+t),i.constructor=t)}var l={},u=l.ELEMENT_NODE=1,h=l.ATTRIBUTE_NODE=2,d=l.TEXT_NODE=3,f=l.CDATA_SECTION_NODE=4,p=l.ENTITY_REFERENCE_NODE=5,v=l.ENTITY_NODE=6,g=l.PROCESSING_INSTRUCTION_NODE=7,m=l.COMMENT_NODE=8,w=l.DOCUMENT_NODE=9,b=l.DOCUMENT_TYPE_NODE=10,y=l.DOCUMENT_FRAGMENT_NODE=11,x=l.NOTATION_NODE=12,k={},E={};k.INDEX_SIZE_ERR=(E[1]="Index size error",1),k.DOMSTRING_SIZE_ERR=(E[2]="DOMString size error",2);var S=k.HIERARCHY_REQUEST_ERR=(E[3]="Hierarchy request error",3);k.WRONG_DOCUMENT_ERR=(E[4]="Wrong document",4),k.INVALID_CHARACTER_ERR=(E[5]="Invalid character",5),k.NO_DATA_ALLOWED_ERR=(E[6]="No data allowed",6),k.NO_MODIFICATION_ALLOWED_ERR=(E[7]="No modification allowed",7);var F=k.NOT_FOUND_ERR=(E[8]="Not found",8);k.NOT_SUPPORTED_ERR=(E[9]="Not supported",9);var A=k.INUSE_ATTRIBUTE_ERR=(E[10]="Attribute in use",10);function _(t,e){if(e instanceof Error)var i=e;else i=this,Error.call(this,E[t]),this.message=E[t],Error.captureStackTrace&&Error.captureStackTrace(this,_);return i.code=t,e&&(this.message=this.message+": "+e),i}function j(){}function C(t,e){this._node=t,this._refresh=e,R(this)}function R(t){var e=t._node._inc||t._node.ownerDocument._inc;if(t._inc!=e){var i=t._refresh(t._node);gt(t,"length",i.length),a(i,t),t._inc=e}}function I(){}function T(t,e){for(var i=t.length;i--;)if(t[i]===e)return i}function O(t,e,i,r){if(r?e[T(e,r)]=i:e[e.length++]=i,t){i.ownerElement=t;var o=t.ownerDocument;o&&(r&&B(o,t,r),function(t,e,i){t&&t._inc++,i.namespaceURI===n.XMLNS&&(e._nsMap[i.prefix?i.localName:""]=i.value)}(o,t,i))}}function P(t,e,i){var n=T(e,i);if(!(n>=0))throw new _(F,new Error(t.tagName+"@"+i));for(var r=e.length-1;n<r;)e[n]=e[++n];if(e.length=r,t){var o=t.ownerDocument;o&&(B(o,t,i),i.ownerElement=null)}}function N(){}function D(){}function M(t){return("<"==t?"<":">"==t&&">")||"&"==t&&"&"||'"'==t&&"""||"&#"+t.charCodeAt()+";"}function U(t,e){if(e(t))return!0;if(t=t.firstChild)do{if(U(t,e))return!0}while(t=t.nextSibling)}function L(){this.ownerDocument=this}function B(t,e,i){t&&t._inc++,i.namespaceURI===n.XMLNS&&delete e._nsMap[i.prefix?i.localName:""]}function J(t,e,i){if(t&&t._inc){t._inc++;var n=e.childNodes;if(i)n[n.length++]=i;else{for(var r=e.firstChild,o=0;r;)n[o++]=r,r=r.nextSibling;n.length=o,delete n[n.length]}}}function $(t,e){var i=e.previousSibling,n=e.nextSibling;return i?i.nextSibling=n:t.firstChild=n,n?n.previousSibling=i:t.lastChild=i,e.parentNode=null,e.previousSibling=null,e.nextSibling=null,J(t.ownerDocument,t),e}function z(t){return t&&t.nodeType===D.DOCUMENT_TYPE_NODE}function H(t){return t&&t.nodeType===D.ELEMENT_NODE}function K(t){return t&&t.nodeType===D.TEXT_NODE}function W(t,e){var n=t.childNodes||[];if(i(n,H)||z(e))return!1;var r=i(n,z);return!(e&&r&&n.indexOf(r)>n.indexOf(e))}function q(t,e){var n=t.childNodes||[];if(i(n,(function(t){return H(t)&&t!==e})))return!1;var r=i(n,z);return!(e&&r&&n.indexOf(r)>n.indexOf(e))}function V(t,e,n){var r=t.childNodes||[],o=e.childNodes||[];if(e.nodeType===D.DOCUMENT_FRAGMENT_NODE){var s=o.filter(H);if(s.length>1||i(o,K))throw new _(S,"More than one element or text in fragment");if(1===s.length&&!W(t,n))throw new _(S,"Element in fragment can not be inserted before doctype")}if(H(e)&&!W(t,n))throw new _(S,"Only one element can be added and only after doctype");if(z(e)){if(i(r,z))throw new _(S,"Only one doctype is allowed");var a=i(r,H);if(n&&r.indexOf(a)<r.indexOf(n))throw new _(S,"Doctype can only be inserted before an element");if(!n&&a)throw new _(S,"Doctype can not be appended since element is present")}}function G(t,e,n){var r=t.childNodes||[],o=e.childNodes||[];if(e.nodeType===D.DOCUMENT_FRAGMENT_NODE){var s=o.filter(H);if(s.length>1||i(o,K))throw new _(S,"More than one element or text in fragment");if(1===s.length&&!q(t,n))throw new _(S,"Element in fragment can not be inserted before doctype")}if(H(e)&&!q(t,n))throw new _(S,"Only one element can be added and only after doctype");if(z(e)){if(i(r,(function(t){return z(t)&&t!==n})))throw new _(S,"Only one doctype is allowed");var a=i(r,H);if(n&&r.indexOf(a)<r.indexOf(n))throw new _(S,"Doctype can only be inserted before an element")}}function X(t,e,i,n){(function(t,e,i){if(!function(t){return t&&(t.nodeType===D.DOCUMENT_NODE||t.nodeType===D.DOCUMENT_FRAGMENT_NODE||t.nodeType===D.ELEMENT_NODE)}(t))throw new _(S,"Unexpected parent node type "+t.nodeType);if(i&&i.parentNode!==t)throw new _(F,"child not in parent");if(!function(t){return t&&(H(t)||K(t)||z(t)||t.nodeType===D.DOCUMENT_FRAGMENT_NODE||t.nodeType===D.COMMENT_NODE||t.nodeType===D.PROCESSING_INSTRUCTION_NODE)}(e)||z(e)&&t.nodeType!==D.DOCUMENT_NODE)throw new _(S,"Unexpected node type "+e.nodeType+" for parent node type "+t.nodeType)})(t,e,i),t.nodeType===D.DOCUMENT_NODE&&(n||V)(t,e,i);var r=e.parentNode;if(r&&r.removeChild(e),e.nodeType===y){var o=e.firstChild;if(null==o)return e;var s=e.lastChild}else o=s=e;var a=i?i.previousSibling:t.lastChild;o.previousSibling=a,s.nextSibling=i,a?a.nextSibling=o:t.firstChild=o,null==i?t.lastChild=s:i.previousSibling=s;do{o.parentNode=t}while(o!==s&&(o=o.nextSibling));return J(t.ownerDocument||t,t),e.nodeType==y&&(e.firstChild=e.lastChild=null),e}function Y(){this._nsMap={}}function Z(){}function Q(){}function tt(){}function et(){}function it(){}function nt(){}function rt(){}function ot(){}function st(){}function at(){}function ct(){}function lt(){}function ut(t,e){var i=[],n=9==this.nodeType&&this.documentElement||this,r=n.prefix,o=n.namespaceURI;if(o&&null==r&&null==(r=n.lookupPrefix(o)))var s=[{namespace:o,prefix:null}];return ft(this,i,t,e,s),i.join("")}function ht(t,e,i){var r=t.prefix||"",o=t.namespaceURI;if(!o)return!1;if("xml"===r&&o===n.XML||o===n.XMLNS)return!1;for(var s=i.length;s--;){var a=i[s];if(a.prefix===r)return a.namespace!==o}return!0}function dt(t,e,i){t.push(" ",e,'="',i.replace(/[<>&"\t\n\r]/g,M),'"')}function ft(t,e,i,r,o){if(o||(o=[]),r){if(!(t=r(t)))return;if("string"==typeof t)return void e.push(t)}switch(t.nodeType){case u:var s=t.attributes,a=s.length,c=t.firstChild,l=t.tagName,v=l;if(!(i=n.isHTML(t.namespaceURI)||i)&&!t.prefix&&t.namespaceURI){for(var x,k=0;k<s.length;k++)if("xmlns"===s.item(k).name){x=s.item(k).value;break}if(!x)for(var E=o.length-1;E>=0;E--)if(""===(S=o[E]).prefix&&S.namespace===t.namespaceURI){x=S.namespace;break}if(x!==t.namespaceURI)for(E=o.length-1;E>=0;E--){var S;if((S=o[E]).namespace===t.namespaceURI){S.prefix&&(v=S.prefix+":"+l);break}}}e.push("<",v);for(var F=0;F<a;F++)"xmlns"==(A=s.item(F)).prefix?o.push({prefix:A.localName,namespace:A.value}):"xmlns"==A.nodeName&&o.push({prefix:"",namespace:A.value});for(F=0;F<a;F++){var A,_,j;ht(A=s.item(F),0,o)&&(dt(e,(_=A.prefix||"")?"xmlns:"+_:"xmlns",j=A.namespaceURI),o.push({prefix:_,namespace:j})),ft(A,e,i,r,o)}if(l===v&&ht(t,0,o)&&(dt(e,(_=t.prefix||"")?"xmlns:"+_:"xmlns",j=t.namespaceURI),o.push({prefix:_,namespace:j})),c||i&&!/^(?:meta|link|img|br|hr|input)$/i.test(l)){if(e.push(">"),i&&/^script$/i.test(l))for(;c;)c.data?e.push(c.data):ft(c,e,i,r,o.slice()),c=c.nextSibling;else for(;c;)ft(c,e,i,r,o.slice()),c=c.nextSibling;e.push("</",v,">")}else e.push("/>");return;case w:case y:for(c=t.firstChild;c;)ft(c,e,i,r,o.slice()),c=c.nextSibling;return;case h:return dt(e,t.name,t.value);case d:return e.push(t.data.replace(/[<&>]/g,M));case f:return e.push("<![CDATA[",t.data,"]]>");case m:return e.push("\x3c!--",t.data,"--\x3e");case b:var C=t.publicId,R=t.systemId;if(e.push("<!DOCTYPE ",t.name),C)e.push(" PUBLIC ",C),R&&"."!=R&&e.push(" ",R),e.push(">");else if(R&&"."!=R)e.push(" SYSTEM ",R,">");else{var I=t.internalSubset;I&&e.push(" [",I,"]"),e.push(">")}return;case g:return e.push("<?",t.target," ",t.data,"?>");case p:return e.push("&",t.nodeName,";");default:e.push("??",t.nodeName)}}function pt(t,e,i){var n;switch(e.nodeType){case u:(n=e.cloneNode(!1)).ownerDocument=t;case y:break;case h:i=!0}if(n||(n=e.cloneNode(!1)),n.ownerDocument=t,n.parentNode=null,i)for(var r=e.firstChild;r;)n.appendChild(pt(t,r,i)),r=r.nextSibling;return n}function vt(t,e,i){var n=new e.constructor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var o=e[r];"object"!=typeof o&&o!=n[r]&&(n[r]=o)}switch(e.childNodes&&(n.childNodes=new j),n.ownerDocument=t,n.nodeType){case u:var s=e.attributes,a=n.attributes=new I,c=s.length;a._ownerElement=n;for(var l=0;l<c;l++)n.setAttributeNode(vt(t,s.item(l),!0));break;case h:i=!0}if(i)for(var d=e.firstChild;d;)n.appendChild(vt(t,d,i)),d=d.nextSibling;return n}function gt(t,e,i){t[e]=i}k.INVALID_STATE_ERR=(E[11]="Invalid state",11),k.SYNTAX_ERR=(E[12]="Syntax error",12),k.INVALID_MODIFICATION_ERR=(E[13]="Invalid modification",13),k.NAMESPACE_ERR=(E[14]="Invalid namespace",14),k.INVALID_ACCESS_ERR=(E[15]="Invalid access",15),_.prototype=Error.prototype,a(k,_),j.prototype={length:0,item:function(t){return this[t]||null},toString:function(t,e){for(var i=[],n=0;n<this.length;n++)ft(this[n],i,t,e);return i.join("")},filter:function(t){return Array.prototype.filter.call(this,t)},indexOf:function(t){return Array.prototype.indexOf.call(this,t)}},C.prototype.item=function(t){return R(this),this[t]},c(C,j),I.prototype={length:0,item:j.prototype.item,getNamedItem:function(t){for(var e=this.length;e--;){var i=this[e];if(i.nodeName==t)return i}},setNamedItem:function(t){var e=t.ownerElement;if(e&&e!=this._ownerElement)throw new _(A);var i=this.getNamedItem(t.nodeName);return O(this._ownerElement,this,t,i),i},setNamedItemNS:function(t){var e,i=t.ownerElement;if(i&&i!=this._ownerElement)throw new _(A);return e=this.getNamedItemNS(t.namespaceURI,t.localName),O(this._ownerElement,this,t,e),e},removeNamedItem:function(t){var e=this.getNamedItem(t);return P(this._ownerElement,this,e),e},removeNamedItemNS:function(t,e){var i=this.getNamedItemNS(t,e);return P(this._ownerElement,this,i),i},getNamedItemNS:function(t,e){for(var i=this.length;i--;){var n=this[i];if(n.localName==e&&n.namespaceURI==t)return n}return null}},N.prototype={hasFeature:function(){return!0},createDocument:function(t,e,i){var n=new L;if(n.implementation=this,n.childNodes=new j,n.doctype=i||null,i&&n.appendChild(i),e){var r=n.createElementNS(t,e);n.appendChild(r)}return n},createDocumentType:function(t,e,i){var n=new nt;return n.name=t,n.nodeName=t,n.publicId=e||"",n.systemId=i||"",n}},D.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(t,e){return X(this,t,e)},replaceChild:function(t,e){X(this,t,e,G),e&&this.removeChild(e)},removeChild:function(t){return $(this,t)},appendChild:function(t){return this.insertBefore(t,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(t){return vt(this.ownerDocument||this,this,t)},normalize:function(){for(var t=this.firstChild;t;){var e=t.nextSibling;e&&e.nodeType==d&&t.nodeType==d?(this.removeChild(e),t.appendData(e.data)):(t.normalize(),t=e)}},isSupported:function(t,e){return this.ownerDocument.implementation.hasFeature(t,e)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(t){for(var e=this;e;){var i=e._nsMap;if(i)for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&i[n]===t)return n;e=e.nodeType==h?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(t){for(var e=this;e;){var i=e._nsMap;if(i&&Object.prototype.hasOwnProperty.call(i,t))return i[t];e=e.nodeType==h?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(t){return null==this.lookupPrefix(t)}},a(l,D),a(l,D.prototype),L.prototype={nodeName:"#document",nodeType:w,doctype:null,documentElement:null,_inc:1,insertBefore:function(t,e){if(t.nodeType==y){for(var i=t.firstChild;i;){var n=i.nextSibling;this.insertBefore(i,e),i=n}return t}return X(this,t,e),t.ownerDocument=this,null===this.documentElement&&t.nodeType===u&&(this.documentElement=t),t},removeChild:function(t){return this.documentElement==t&&(this.documentElement=null),$(this,t)},replaceChild:function(t,e){X(this,t,e,G),t.ownerDocument=this,e&&this.removeChild(e),H(t)&&(this.documentElement=t)},importNode:function(t,e){return pt(this,t,e)},getElementById:function(t){var e=null;return U(this.documentElement,(function(i){if(i.nodeType==u&&i.getAttribute("id")==t)return e=i,!0})),e},getElementsByClassName:function(t){var e=s(t);return new C(this,(function(i){var n=[];return e.length>0&&U(i.documentElement,(function(r){if(r!==i&&r.nodeType===u){var o=r.getAttribute("class");if(o){var a=t===o;if(!a){var c=s(o);a=e.every((l=c,function(t){return l&&-1!==l.indexOf(t)}))}a&&n.push(r)}}var l})),n}))},createElement:function(t){var e=new Y;return e.ownerDocument=this,e.nodeName=t,e.tagName=t,e.localName=t,e.childNodes=new j,(e.attributes=new I)._ownerElement=e,e},createDocumentFragment:function(){var t=new at;return t.ownerDocument=this,t.childNodes=new j,t},createTextNode:function(t){var e=new tt;return e.ownerDocument=this,e.appendData(t),e},createComment:function(t){var e=new et;return e.ownerDocument=this,e.appendData(t),e},createCDATASection:function(t){var e=new it;return e.ownerDocument=this,e.appendData(t),e},createProcessingInstruction:function(t,e){var i=new ct;return i.ownerDocument=this,i.tagName=i.target=t,i.nodeValue=i.data=e,i},createAttribute:function(t){var e=new Z;return e.ownerDocument=this,e.name=t,e.nodeName=t,e.localName=t,e.specified=!0,e},createEntityReference:function(t){var e=new st;return e.ownerDocument=this,e.nodeName=t,e},createElementNS:function(t,e){var i=new Y,n=e.split(":"),r=i.attributes=new I;return i.childNodes=new j,i.ownerDocument=this,i.nodeName=e,i.tagName=e,i.namespaceURI=t,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=e,r._ownerElement=i,i},createAttributeNS:function(t,e){var i=new Z,n=e.split(":");return i.ownerDocument=this,i.nodeName=e,i.name=e,i.namespaceURI=t,i.specified=!0,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=e,i}},c(L,D),Y.prototype={nodeType:u,hasAttribute:function(t){return null!=this.getAttributeNode(t)},getAttribute:function(t){var e=this.getAttributeNode(t);return e&&e.value||""},getAttributeNode:function(t){return this.attributes.getNamedItem(t)},setAttribute:function(t,e){var i=this.ownerDocument.createAttribute(t);i.value=i.nodeValue=""+e,this.setAttributeNode(i)},removeAttribute:function(t){var e=this.getAttributeNode(t);e&&this.removeAttributeNode(e)},appendChild:function(t){return t.nodeType===y?this.insertBefore(t,null):function(t,e){return e.parentNode&&e.parentNode.removeChild(e),e.parentNode=t,e.previousSibling=t.lastChild,e.nextSibling=null,e.previousSibling?e.previousSibling.nextSibling=e:t.firstChild=e,t.lastChild=e,J(t.ownerDocument,t,e),e}(this,t)},setAttributeNode:function(t){return this.attributes.setNamedItem(t)},setAttributeNodeNS:function(t){return this.attributes.setNamedItemNS(t)},removeAttributeNode:function(t){return this.attributes.removeNamedItem(t.nodeName)},removeAttributeNS:function(t,e){var i=this.getAttributeNodeNS(t,e);i&&this.removeAttributeNode(i)},hasAttributeNS:function(t,e){return null!=this.getAttributeNodeNS(t,e)},getAttributeNS:function(t,e){var i=this.getAttributeNodeNS(t,e);return i&&i.value||""},setAttributeNS:function(t,e,i){var n=this.ownerDocument.createAttributeNS(t,e);n.value=n.nodeValue=""+i,this.setAttributeNode(n)},getAttributeNodeNS:function(t,e){return this.attributes.getNamedItemNS(t,e)},getElementsByTagName:function(t){return new C(this,(function(e){var i=[];return U(e,(function(n){n===e||n.nodeType!=u||"*"!==t&&n.tagName!=t||i.push(n)})),i}))},getElementsByTagNameNS:function(t,e){return new C(this,(function(i){var n=[];return U(i,(function(r){r===i||r.nodeType!==u||"*"!==t&&r.namespaceURI!==t||"*"!==e&&r.localName!=e||n.push(r)})),n}))}},L.prototype.getElementsByTagName=Y.prototype.getElementsByTagName,L.prototype.getElementsByTagNameNS=Y.prototype.getElementsByTagNameNS,c(Y,D),Z.prototype.nodeType=h,c(Z,D),Q.prototype={data:"",substringData:function(t,e){return this.data.substring(t,t+e)},appendData:function(t){this.nodeValue=this.data=t=this.data+t,this.length=t.length},insertData:function(t,e){this.replaceData(t,0,e)},appendChild:function(){throw new Error(E[S])},deleteData:function(t,e){this.replaceData(t,e,"")},replaceData:function(t,e,i){var n=this.data.substring(0,t),r=this.data.substring(t+e);this.nodeValue=this.data=i=n+i+r,this.length=i.length}},c(Q,D),tt.prototype={nodeName:"#text",nodeType:d,splitText:function(t){var e=this.data,i=e.substring(t);e=e.substring(0,t),this.data=this.nodeValue=e,this.length=e.length;var n=this.ownerDocument.createTextNode(i);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}},c(tt,Q),et.prototype={nodeName:"#comment",nodeType:m},c(et,Q),it.prototype={nodeName:"#cdata-section",nodeType:f},c(it,Q),nt.prototype.nodeType=b,c(nt,D),rt.prototype.nodeType=x,c(rt,D),ot.prototype.nodeType=v,c(ot,D),st.prototype.nodeType=p,c(st,D),at.prototype.nodeName="#document-fragment",at.prototype.nodeType=y,c(at,D),ct.prototype.nodeType=g,c(ct,D),lt.prototype.serializeToString=function(t,e,i){return ut.call(t,e,i)},D.prototype.toString=ut;try{if(Object.defineProperty){let t=function(e){switch(e.nodeType){case u:case y:var i=[];for(e=e.firstChild;e;)7!==e.nodeType&&8!==e.nodeType&&i.push(t(e)),e=e.nextSibling;return i.join("");default:return e.nodeValue}};Object.defineProperty(C.prototype,"length",{get:function(){return R(this),this.$$length}}),Object.defineProperty(D.prototype,"textContent",{get:function(){return t(this)},set:function(t){switch(this.nodeType){case u:case y:for(;this.firstChild;)this.removeChild(this.firstChild);(t||String(t))&&this.appendChild(this.ownerDocument.createTextNode(t));break;default:this.data=t,this.value=t,this.nodeValue=t}}}),gt=function(t,e,i){t["$$"+e]=i}}}catch(t){}t.DocumentType=nt,t.DOMException=_,t.DOMImplementation=N,t.Element=Y,t.Node=D,t.NodeList=j,t.XMLSerializer=lt}}),ea=ue({"../node_modules/@xmldom/xmldom/lib/entities.js"(t){var e=Qs().freeze;t.XML_ENTITIES=e({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),t.HTML_ENTITIES=e({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}}),ia=ue({"../node_modules/@xmldom/xmldom/lib/sax.js"(t){var e=Qs().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]/,n=new RegExp("[\\-\\.0-9"+i.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),r=new RegExp("^"+i.source+n.source+"*(?::"+i.source+n.source+"*)?$");function o(t,e){this.message=t,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,o)}function s(){}function a(t,e){return e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber,e}function c(t,i,n,r,o,s){function a(t,e,i){n.attributeNames.hasOwnProperty(t)&&s.fatalError("Attribute "+t+" redefined"),n.addValue(t,e.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,o),i)}for(var c,l=++i,u=0;;){var h=t.charAt(l);switch(h){case"=":if(1===u)c=t.slice(i,l),u=3;else{if(2!==u)throw new Error("attribute equal must after attrName");u=3}break;case"'":case'"':if(3===u||1===u){if(1===u&&(s.warning('attribute value must after "="'),c=t.slice(i,l)),!((l=t.indexOf(h,i=l+1))>0))throw new Error("attribute value no end '"+h+"' match");a(c,d=t.slice(i,l),i-1),u=5}else{if(4!=u)throw new Error('attribute value must after "="');a(c,d=t.slice(i,l),i),s.warning('attribute "'+c+'" missed start quot('+h+")!!"),i=l+1,u=5}break;case"/":switch(u){case 0:n.setTagName(t.slice(i,l));case 5:case 6:case 7:u=7,n.closed=!0;case 4:case 1:case 2:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return s.error("unexpected end of input"),0==u&&n.setTagName(t.slice(i,l)),l;case">":switch(u){case 0:n.setTagName(t.slice(i,l));case 5:case 6:case 7:break;case 4:case 1:"/"===(d=t.slice(i,l)).slice(-1)&&(n.closed=!0,d=d.slice(0,-1));case 2:2===u&&(d=c),4==u?(s.warning('attribute "'+d+'" missed quot(")!'),a(c,d,i)):(e.isHTML(r[""])&&d.match(/^(?:disabled|checked|selected)$/i)||s.warning('attribute "'+d+'" missed value!! "'+d+'" instead!!'),a(d,d,i));break;case 3:throw new Error("attribute value missed!!")}return l;case"":h=" ";default:if(h<=" ")switch(u){case 0:n.setTagName(t.slice(i,l)),u=6;break;case 1:c=t.slice(i,l),u=2;break;case 4:var d=t.slice(i,l);s.warning('attribute "'+d+'" missed quot(")!!'),a(c,d,i);case 5:u=6}else switch(u){case 2:e.isHTML(r[""])&&c.match(/^(?:disabled|checked|selected)$/i)||s.warning('attribute "'+c+'" missed value!! "'+c+'" instead2!!'),a(c,c,i),i=l,u=1;break;case 5:s.warning('attribute space is required"'+c+'"!!');case 6:u=1,i=l;break;case 3:u=4,i=l;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}l++}}function l(t,i,n){for(var r=t.tagName,o=null,s=t.length;s--;){var a=t[s],c=a.qName,l=a.value;if((p=c.indexOf(":"))>0)var u=a.prefix=c.slice(0,p),h=c.slice(p+1),f="xmlns"===u&&h;else h=c,u=null,f="xmlns"===c&&"";a.localName=h,!1!==f&&(null==o&&(o={},d(n,n={})),n[f]=o[f]=l,a.uri=e.XMLNS,i.startPrefixMapping(f,l))}for(s=t.length;s--;)(u=(a=t[s]).prefix)&&("xml"===u&&(a.uri=e.XML),"xmlns"!==u&&(a.uri=n[u||""]));var p;(p=r.indexOf(":"))>0?(u=t.prefix=r.slice(0,p),h=t.localName=r.slice(p+1)):(u=null,h=t.localName=r);var v=t.uri=n[u||""];if(i.startElement(v,h,r,t),!t.closed)return t.currentNSMap=n,t.localNSMap=o,!0;if(i.endElement(v,h,r),o)for(u in o)Object.prototype.hasOwnProperty.call(o,u)&&i.endPrefixMapping(u)}function u(t,e,i,n,r){if(/^(?:script|textarea)$/i.test(i)){var o=t.indexOf("</"+i+">",e),s=t.substring(e+1,o);if(/[&<]/.test(s))return/^script$/i.test(i)?(r.characters(s,0,s.length),o):(s=s.replace(/&#?\w+;/g,n),r.characters(s,0,s.length),o)}return e+1}function h(t,e,i,n){var r=n[i];return null==r&&((r=t.lastIndexOf("</"+i+">"))<e&&(r=t.lastIndexOf("</"+i)),n[i]=r),r<e}function d(t,e){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}function f(t,e,i,n){if("-"===t.charAt(e+2))return"-"===t.charAt(e+3)?(r=t.indexOf("--\x3e",e+4))>e?(i.comment(t,e+4,r-e-4),r+3):(n.error("Unclosed comment"),-1):-1;if("CDATA["==t.substr(e+3,6)){var r=t.indexOf("]]>",e+9);return i.startCDATA(),i.characters(t,e+9,r-e-9),i.endCDATA(),r+3}var o=function(t,e){var i,n=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(r.lastIndex=e,r.exec(t);i=r.exec(t);)if(n.push(i),i[1])return n}(t,e),s=o.length;if(s>1&&/!doctype/i.test(o[0][0])){var a=o[1][0],c=!1,l=!1;s>3&&(/^public$/i.test(o[2][0])?(c=o[3][0],l=s>4&&o[4][0]):/^system$/i.test(o[2][0])&&(l=o[3][0]));var u=o[s-1];return i.startDTD(a,c,l),i.endDTD(),u.index+u[0].length}return-1}function p(t,e,i){var n=t.indexOf("?>",e);if(n){var r=t.substring(e,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return r?(i.processingInstruction(r[1],r[2]),n+2):-1}return-1}function v(){this.attributeNames={}}(o.prototype=new Error).name=o.name,s.prototype={parse:function(t,i,n){var r=this.domBuilder;r.startDocument(),d(i,i={}),function(t,i,n,r,s){function d(t){var e,i=t.slice(1,-1);return Object.hasOwnProperty.call(n,i)?n[i]:"#"===i.charAt(0)?(e=parseInt(i.substr(1).replace("x","0x")))>65535?(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e))):String.fromCharCode(e):(s.error("entity not found:"+t),t)}function g(e){if(e>S){var i=t.substring(S,e).replace(/&#?\w+;/g,d);x&&m(S),r.characters(i,0,e-S),S=e}}function m(e,i){for(;e>=b&&(i=y.exec(t));)b=(w=i.index)+i[0].length,x.lineNumber++;x.columnNumber=e-w+1}for(var w=0,b=0,y=/.*(?:\r\n?|\n)|.*$/g,x=r.locator,k=[{currentNSMap:i}],E={},S=0;;){try{var F=t.indexOf("<",S);if(F<0){if(!t.substr(S).match(/^\s*$/)){var A=r.doc,_=A.createTextNode(t.substr(S));A.appendChild(_),r.currentElement=_}return}switch(F>S&&g(F),t.charAt(F+1)){case"/":var j=t.indexOf(">",F+3),C=t.substring(F+2,j).replace(/[ \t\n\r]+$/g,""),R=k.pop();j<0?(C=t.substring(F+2).replace(/[\s<].*/,""),s.error("end tag name: "+C+" is not complete:"+R.tagName),j=F+1+C.length):C.match(/\s</)&&(C=C.replace(/[\s<].*/,""),s.error("end tag name: "+C+" maybe not complete"),j=F+1+C.length);var I=R.localNSMap,T=R.tagName==C;if(T||R.tagName&&R.tagName.toLowerCase()==C.toLowerCase()){if(r.endElement(R.uri,R.localName,C),I)for(var O in I)Object.prototype.hasOwnProperty.call(I,O)&&r.endPrefixMapping(O);T||s.fatalError("end tag name: "+C+" is not match the current start tagName:"+R.tagName)}else k.push(R);j++;break;case"?":x&&m(F),j=p(t,F,r);break;case"!":x&&m(F),j=f(t,F,r,s);break;default:x&&m(F);var P=new v,N=k[k.length-1].currentNSMap,D=(j=c(t,F,P,N,d,s),P.length);if(!P.closed&&h(t,j,P.tagName,E)&&(P.closed=!0,n.nbsp||s.warning("unclosed xml attribute")),x&&D){for(var M=a(x,{}),U=0;U<D;U++){var L=P[U];m(L.offset),L.locator=a(x,{})}r.locator=M,l(P,r,N)&&k.push(P),r.locator=x}else l(P,r,N)&&k.push(P);e.isHTML(P.uri)&&!P.closed?j=u(t,j,P.tagName,d,r):j++}}catch(t){if(t instanceof o)throw t;s.error("element parse error: "+t),j=-1}j>S?S=j:g(Math.max(F,S)+1)}}(t,i,n,r,this.errorHandler),r.endDocument()}},v.prototype={setTagName:function(t){if(!r.test(t))throw new Error("invalid tagName:"+t);this.tagName=t},addValue:function(t,e,i){if(!r.test(t))throw new Error("invalid attribute:"+t);this.attributeNames[t]=this.length,this[this.length++]={qName:t,value:e,offset:i}},length:0,getLocalName:function(t){return this[t].localName},getLocator:function(t){return this[t].locator},getQName:function(t){return this[t].qName},getURI:function(t){return this[t].uri},getValue:function(t){return this[t].value}},t.XMLReader=s,t.ParseError=o}}),na=ue({"../node_modules/@xmldom/xmldom/lib/dom-parser.js"(t){var e=Qs(),i=ta(),n=ea(),r=ia(),o=i.DOMImplementation,s=e.NAMESPACE,a=r.ParseError,c=r.XMLReader;function l(t){return t.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n")}function u(t){this.options=t||{locator:{}}}function h(){this.cdata=!1}function d(t,e){e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber}function f(t){if(t)return"\n@"+(t.systemId||"")+"#[line:"+t.lineNumber+",col:"+t.columnNumber+"]"}function p(t,e,i){return"string"==typeof t?t.substr(e,i):t.length>=e+i||e?new java.lang.String(t,e,i)+"":t}function v(t,e){t.currentElement?t.currentElement.appendChild(e):t.doc.appendChild(e)}u.prototype.parseFromString=function(t,e){var i=this.options,r=new c,o=i.domBuilder||new h,a=i.errorHandler,u=i.locator,d=i.xmlns||{},p=/\/x?html?$/.test(e),v=p?n.HTML_ENTITIES:n.XML_ENTITIES;return u&&o.setDocumentLocator(u),r.errorHandler=function(t,e,i){if(!t){if(e instanceof h)return e;t=e}var n={},r=t instanceof Function;function o(e){var o=t[e];!o&&r&&(o=2==t.length?function(i){t(e,i)}:t),n[e]=o&&function(t){o("[xmldom "+e+"]\t"+t+f(i))}||function(){}}return i=i||{},o("warning"),o("error"),o("fatalError"),n}(a,o,u),r.domBuilder=i.domBuilder||o,p&&(d[""]=s.HTML),d.xml=d.xml||s.XML,t&&"string"==typeof t?r.parse((i.normalizeLineEndings||l)(t),d,v):r.errorHandler.error("invalid doc source"),o.doc},h.prototype={startDocument:function(){this.doc=(new o).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(t,e,i,n){var r=this.doc,o=r.createElementNS(t,i||e),s=n.length;v(this,o),this.currentElement=o,this.locator&&d(this.locator,o);for(var a=0;a<s;a++){t=n.getURI(a);var c=n.getValue(a),l=(i=n.getQName(a),r.createAttributeNS(t,i));this.locator&&d(n.getLocator(a),l),l.value=l.nodeValue=c,o.setAttributeNode(l)}},endElement:function(){this.currentElement=this.currentElement.parentNode},startPrefixMapping:function(){},endPrefixMapping:function(){},processingInstruction:function(t,e){var i=this.doc.createProcessingInstruction(t,e);this.locator&&d(this.locator,i),v(this,i)},ignorableWhitespace:function(){},characters:function(t,e,i){if(t=p.apply(this,arguments)){if(this.cdata)var n=this.doc.createCDATASection(t);else n=this.doc.createTextNode(t);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(t)&&this.doc.appendChild(n),this.locator&&d(this.locator,n)}},skippedEntity:function(){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(t){(this.locator=t)&&(t.lineNumber=0)},comment:function(t,e,i){t=p.apply(this,arguments);var n=this.doc.createComment(t);this.locator&&d(this.locator,n),v(this,n)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(t,e,i){var n=this.doc.implementation;if(n&&n.createDocumentType){var r=n.createDocumentType(t,e,i);this.locator&&d(this.locator,r),v(this,r),this.doc.doctype=r}},warning:function(t){console.warn("[xmldom warning]\t"+t,f(this.locator))},error:function(t){console.error("[xmldom error]\t"+t,f(this.locator))},fatalError:function(t){throw new a(t,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(t){h.prototype[t]=function(){return null}})),t.__DOMHandler=h,t.normalizeLineEndings=l,t.DOMParser=u}}),ra=ue({"../node_modules/@xmldom/xmldom/lib/index.js"(t){var e=ta();t.DOMImplementation=e.DOMImplementation,t.XMLSerializer=e.XMLSerializer,t.DOMParser=na().DOMParser}}),oa=ue({"../node_modules/solid-namespace/index.js"(t,e){var i={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(t={namedNode:t=>t}){const e={};for(const n in i){const r=i[n];e[n]=function(e=""){return t.namedNode(r+e)}}return e}}}),sa=fe(us());function aa(t){return(aa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ca(t){var e=function(t){if("object"!==aa(t)||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!==aa(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===aa(e)?e:String(e)}function la(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ca(n.key),n)}}function ua(t,e,i){return e&&la(t.prototype,e),i&&la(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function ha(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function da(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function fa(t,e){return(fa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function pa(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&fa(t,e)}function va(t,e){if(e&&("object"===aa(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return da(t)}function ga(t){return(ga=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ma(t,e,i){return(e=ca(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var wa={Literal:1,Collection:3,Graph:4,NamedNode:5,BlankNode:6,Variable:7},ba=function(){function t(e){ha(this,t),ma(this,"termType",void 0),ma(this,"classOrder",void 0),ma(this,"value",void 0),this.value=e}return ua(t,[{key:"substitute",value:function(){return console.log("@@@ node substitute"+this),this}},{key:"compareTerm",value:function(t){return this.classOrder<t.classOrder?-1:this.classOrder>t.classOrder?1:this.value<t.value?-1:this.value>t.value?1:0}},{key:"equals",value:function(t){return!!t&&this.termType===t.termType&&this.value===t.value}},{key:"hashString",value:function(){return this.toCanonical()}},{key:"sameTerm",value:function(t){return this.equals(t)}},{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")}}]),t}();ma(ba,"fromValue",void 0),ma(ba,"toJS",void 0);var ya="NamedNode",xa="BlankNode",ka="Literal",Ea="Variable",Sa="DefaultGraph",Fa="Collection",Aa="Empty",_a="Graph",ja="text/html",Ca="application/ld+json",Ra="text/n3",Ia="application/nquads",Ta="application/n-quads",Oa="application/rdf+xml",Pa="application/sparql-update",Na="application/sparql-update-single-match",Da="text/turtle",Ma="application/xhtml+xml";var Ua=function(){pa(n,ba);var t,e,i=(t=n,e=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(t){return!1}}(),function(){var i,n=ga(t);if(e){var r=ga(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return va(this,i)});function n(t){var e;return ha(this,n),ma(da(e=i.call(this,n.getId(t))),"termType",xa),ma(da(e),"classOrder",wa.BlankNode),ma(da(e),"isBlank",1),ma(da(e),"isVar",1),e}return ua(n,[{key:"id",get:function(){return this.value},set:function(t){this.value=t}},{key:"compareTerm",value:function(t){return this.classOrder<t.classOrder?-1:this.classOrder>t.classOrder?1:this.id<t.id?-1:this.id>t.id?1:0}},{key:"copy",value:function(t){var e=new n;return t.copyTo(this,e),e}},{key:"toCanonical",value:function(){return n.NTAnonymousNodePrefix+this.value}},{key:"toString",value:function(){return n.NTAnonymousNodePrefix+this.id}}],[{key:"getId",value:function(t){if(t){if("string"!=typeof t)throw console.log("Bad blank id:",t),new Error("Bad id argument to new blank node: "+t);if(t.includes("#")){var e=t.split("#");return e[e.length-1]}return t}return"n"+n.nextId++}}]),n}();function La(t){return"string"==typeof t?t:t.value}function Ba(t){return"object"===aa(t)&&null!==t&&"subject"in t}function Ja(t){return"object"===aa(t)&&null!==t&&"statements"in t}function $a(t){return Wa(t)&&t.termType===Fa}function za(t){return t&&Object.prototype.hasOwnProperty.call(t,"termType")&&(t.termType===ya||t.termType===Ea||t.termType===xa||t.termType===Fa||t.termType===ka||t.termType===_a)}function Ha(t){return t&&Object.prototype.hasOwnProperty.call(t,"termType")&&(t.termType===ya||t.termType===Ea||t.termType===xa||t.termType===Fa||t.termType===ka||t.termType===_a)}function Ka(t){return Wa(t)&&(t.termType===ya||t.termType===xa||t.termType===Ea)}function Wa(t){return"object"===aa(t)&&null!==t&&"termType"in t}function qa(t){return t.termType===ka}function Va(t){return"object"===aa(t)&&null!==t&&"subject"in t&&"predicate"in t&&"object"in t}function Ga(t){return Wa(t)&&"NamedNode"===t.termType}function Xa(t){return Wa(t)&&(t.termType===ya||t.termType===Ea||t.termType===xa||t.termType===Sa)}ma(Ua,"nextId",0),ma(Ua,"NTAnonymousNodePrefix","_:");var Ya=function(){pa(n,ba);var t,e,i=(t=n,e=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(t){return!1}}(),function(){var i,n=ga(t);if(e){var r=ga(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return va(this,i)});function n(t){var e;if(ha(this,n),ma(da(e=i.call(this,La(t))),"termType",ya),ma(da(e),"classOrder",wa.NamedNode),!e.value)throw new Error("Missing IRI for NamedNode");if(!e.value.includes(":"))throw new Error('NamedNode IRI "'+t+'" must be absolute.');if(e.value.includes(" "))throw new Error('Error: NamedNode IRI "'+t+'" must not contain unencoded spaces.');return e}return ua(n,[{key:"dir",value:function(){var t=this.value.split("#")[0],e=t.slice(0,-1).lastIndexOf("/"),i=t.indexOf("//");return i>=0&&e<i+2||e<0?null:new n(t.slice(0,e+1))}},{key:"site",value:function(){var t=this.value.split("#")[0],e=t.indexOf("//");if(e<0)throw new Error("This URI does not have a web site part (origin)");var i=t.indexOf("/",e+2);return new n(i<0?t.slice(0)+"/":t.slice(0,i+1))}},{key:"doc",value:function(){return this.value.indexOf("#")<0?this:new n(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(t){this.value=t}}],[{key:"fromValue",value:function(t){return null==t||Wa(t)?t:new n(t)}}]),n}(),Za={boolean:new Ya("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:new Ya("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:new Ya("http://www.w3.org/2001/XMLSchema#decimal"),double:new Ya("http://www.w3.org/2001/XMLSchema#double"),integer:new Ya("http://www.w3.org/2001/XMLSchema#integer"),langString:new Ya("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:new Ya("http://www.w3.org/2001/XMLSchema#string")};var Qa=function(){pa(n,ba);var t,e,i=(t=n,e=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(t){return!1}}(),function(){var i,n=ga(t);if(e){var r=ga(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return va(this,i)});function n(t,e,r){var o;return ha(this,n),ma(da(o=i.call(this,t)),"termType",ka),ma(da(o),"classOrder",wa.Literal),ma(da(o),"datatype",Za.string),ma(da(o),"isVar",0),ma(da(o),"language",""),e?(o.language=e,o.datatype=Za.langString):o.datatype=r?Ya.fromValue(r):Za.string,o}return ua(n,[{key:"copy",value:function(){return new n(this.value,this.lang,this.datatype)}},{key:"equals",value:function(t){return!!t&&this.termType===t.termType&&this.value===t.value&&this.language===t.language&&(!this.datatype&&!t.datatype||this.datatype&&this.datatype.equals(t.datatype))}},{key:"lang",get:function(){return this.language},set:function(t){this.language=t||""}},{key:"toNT",value:function(){return n.toNT(this)}},{key:"toString",value:function(){return""+this.value}}],[{key:"toNT",value:function(t){if("number"==typeof t.value)return""+t.value;if("string"!=typeof t.value)throw new Error("Value of RDF literal is not string or number: "+t.value);var e=t.value;return e='"'+(e=(e=(e=(e=e.replace(/\\/g,"\\\\")).replace(/\"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r"))+'"',t.language?e+="@"+t.language:t.datatype.equals(Za.string)||(e+="^^"+t.datatype.toCanonical()),e}},{key:"fromBoolean",value:function(t){return new n(t?"1":"0",null,Za.boolean)}},{key:"fromDate",value:function(t){if(!(t instanceof Date))throw new TypeError("Invalid argument to Literal.fromDate()");var e=function(t){return(""+(100+t)).slice(1,3)};return new n(t.getUTCFullYear()+"-"+e(t.getUTCMonth()+1)+"-"+e(t.getUTCDate())+"T"+e(t.getUTCHours())+":"+e(t.getUTCMinutes())+":"+e(t.getUTCSeconds())+"Z",null,Za.dateTime)}},{key:"fromNumber",value:function(t){if("number"!=typeof t)throw new TypeError("Invalid argument to Literal.fromNumber()");var e,i=t.toString();return e=i.indexOf("e")<0&&Math.abs(t)<=Number.MAX_SAFE_INTEGER?Number.isInteger(t)?Za.integer:Za.decimal:Za.double,new n(i,null,e)}},{key:"fromValue",value:function(t){if(qa(t))return t;switch(aa(t)){case"object":if(t instanceof Date)return n.fromDate(t);case"boolean":return n.fromBoolean(t);case"number":return n.fromNumber(t);case"string":return new n(t)}throw new Error("Can't make literal from "+t+" of type "+aa(t))}}]),n}();function tc(t){return null==t||Wa(t)?t:Array.isArray(t)?new ec(t):Qa.fromValue(t)}var ec=function(){pa(n,ba);var t,e,i=(t=n,e=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(t){return!1}}(),function(){var i,n=ga(t);if(e){var r=ga(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return va(this,i)});function n(t){var e;return ha(this,n),ma(da(e=i.call(this,(Ua.nextId++).toString())),"termType",Fa),ma(da(e),"classOrder",wa.Collection),ma(da(e),"closed",!1),ma(da(e),"compareTerm",Ua.prototype.compareTerm),ma(da(e),"elements",[]),ma(da(e),"isVar",0),t&&t.length>0&&t.forEach((function(t){e.elements.push(tc(t))})),e}return ua(n,[{key:"id",get:function(){return this.value},set:function(t){this.value=t}},{key:"append",value:function(t){return this.elements.push(t)}},{key:"close",value:function(){return this.closed=!0,this.closed}},{key:"shift",value:function(){return this.elements.shift()}},{key:"substitute",value:function(t){return new n(this.elements.map((function(e){return e.substitute(t)})))}},{key:"toNT",value:function(){return n.toNT(this)}},{key:"toString",value:function(){return"("+this.elements.join(" ")+")"}},{key:"unshift",value:function(t){return this.elements.unshift(t)}}],[{key:"toNT",value:function(t){return Ua.NTAnonymousNodePrefix+t.id}}]),n}();function ic(t){return function(...e){var i=e.pop();return t.call(this,e,i)}}ma(ec,"termType",Fa);var nc="function"==typeof queueMicrotask&&queueMicrotask,rc="function"==typeof setImmediate&&setImmediate,oc="object"==typeof process&&"function"==typeof process.nextTick;function sc(t){setTimeout(t,0)}function ac(t){return(e,...i)=>t((()=>e(...i)))}var cc=ac(nc?queueMicrotask:rc?setImmediate:oc?process.nextTick:sc);function lc(t){return dc(t)?function(...e){const i=e.pop();return uc(t.apply(this,e),i)}:ic((function(e,i){var n;try{n=t.apply(this,e)}catch(t){return i(t)}if(n&&"function"==typeof n.then)return uc(n,i);i(null,n)}))}function uc(t,e){return t.then((t=>{hc(e,null,t)}),(t=>{hc(e,t&&t.message?t:new Error(t))}))}function hc(t,e,i){try{t(e,i)}catch(t){cc((t=>{throw t}),t)}}function dc(t){return"AsyncFunction"===t[Symbol.toStringTag]}function fc(t){if("function"!=typeof t)throw new Error("expected a function");return dc(t)?lc(t):t}function pc(t,e=t.length){if(!e)throw new Error("arity is undefined");return function(...i){return"function"==typeof i[e-1]?t.apply(this,i):new Promise(((n,r)=>{i[e-1]=(t,...e)=>{if(t)return r(t);n(e.length>1?e:e[0])},t.apply(this,i)}))}}function vc(t){return function(e,...i){return pc((function(n){var r=this;return t(e,((t,e)=>{fc(t).apply(r,i.concat(e))}),n)}))}}function gc(t,e,i,n){e=e||[];var r=[],o=0,s=fc(i);return t(e,((t,e,i)=>{var n=o++;s(t,((t,e)=>{r[n]=e,i(t)}))}),(t=>{n(t,r)}))}function mc(t){return t&&"number"==typeof t.length&&t.length>=0&&t.length%1==0}var wc={};function bc(t){function e(...e){if(null!==t){var i=t;t=null,i.apply(this,e)}}return Object.assign(e,t),e}function yc(t){return function(...e){if(null===t)throw new Error("Callback was already called.");var i=t;t=null,i.apply(this,e)}}function xc(t,e,i,n){let r=!1,o=!1,s=!1,a=0,c=0;function l(){a>=e||s||r||(s=!0,t.next().then((({value:t,done:e})=>{if(!o&&!r){if(s=!1,e)return r=!0,void(a<=0&&n(null));a++,i(t,c,u),c++,l()}})).catch(h))}function u(t,e){if(a-=1,!o)return t?h(t):!1===t?(r=!0,void(o=!0)):e===wc||r&&a<=0?(r=!0,n(null)):void l()}function h(t){o||(s=!1,r=!0,n(t))}l()}var kc=t=>(e,i,n)=>{if(n=bc(n),t<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!e)return n(null);if("AsyncGenerator"===e[Symbol.toStringTag])return xc(e,t,i,n);if(function(t){return"function"==typeof t[Symbol.asyncIterator]}(e))return xc(e[Symbol.asyncIterator](),t,i,n);var r=function(t){if(mc(t))return function(t){var e=-1,i=t.length;return function(){return++e<i?{value:t[e],key:e}:null}}(t);var e,i,n,r,o=function(t){return t[Symbol.iterator]&&t[Symbol.iterator]()}(t);return o?function(t){var e=-1;return function(){var i=t.next();return i.done?null:(e++,{value:i.value,key:e})}}(o):(i=(e=t)?Object.keys(e):[],n=-1,r=i.length,function t(){var o=i[++n];return"__proto__"===o?t():n<r?{value:e[o],key:o}:null})}(e),o=!1,s=!1,a=0,c=!1;function l(t,e){if(!s)if(a-=1,t)o=!0,n(t);else if(!1===t)o=!0,s=!0;else{if(e===wc||o&&a<=0)return o=!0,n(null);c||u()}}function u(){for(c=!0;a<t&&!o;){var e=r();if(null===e)return o=!0,void(a<=0&&n(null));a+=1,i(e.value,e.key,yc(l))}c=!1}u()},Ec=pc((function(t,e,i,n){return kc(e)(t,fc(i),n)}),4);function Sc(t,e,i){i=bc(i);var n=0,r=0,{length:o}=t,s=!1;function a(t,e){!1===t&&(s=!0),!0!==s&&(t?i(t):++r!==o&&e!==wc||i(null))}for(0===o&&i(null);n<o;n++)e(t[n],n,yc(a))}function Fc(t,e,i){return Ec(t,1/0,e,i)}var Ac=pc((function(t,e,i){return(mc(t)?Sc:Fc)(t,fc(e),i)}),3),_c=pc((function(t,e,i){return gc(Ac,t,e,i)}),3),jc=vc(_c),Cc=pc((function(t,e,i){return Ec(t,1,e,i)}),3),Rc=pc((function(t,e,i){return gc(Cc,t,e,i)}),3),Ic=vc(Rc),Tc=Symbol("promiseCallback");function Oc(){let t,e;function i(i,...n){if(i)return e(i);t(n.length>1?n:n[0])}return i[Tc]=new Promise(((i,n)=>{t=i,e=n})),i}function Pc(t,e,i){"number"!=typeof e&&(i=e,e=null),i=bc(i||Oc());var n=Object.keys(t).length;if(!n)return i(null);e||(e=n);var r={},o=0,s=!1,a=!1,c=Object.create(null),l=[],u=[],h={};function d(t,e){l.push((()=>function(t,e){if(!a){var n=yc(((e,...n)=>{if(o--,!1!==e)if(n.length<2&&([n]=n),e){var l={};if(Object.keys(r).forEach((t=>{l[t]=r[t]})),l[t]=n,a=!0,c=Object.create(null),s)return;i(e,l)}else r[t]=n,(c[t]||[]).forEach((t=>t())),f();else s=!0}));o++;var l=fc(e[e.length-1]);e.length>1?l(r,n):l(n)}}(t,e)))}function f(){if(!s){if(0===l.length&&0===o)return i(null,r);for(;l.length&&o<e;)l.shift()()}}function p(e){var i=[];return Object.keys(t).forEach((n=>{const r=t[n];Array.isArray(r)&&r.indexOf(e)>=0&&i.push(n)})),i}return Object.keys(t).forEach((e=>{var i=t[e];if(!Array.isArray(i))return d(e,[i]),void u.push(e);var n=i.slice(0,i.length-1),r=n.length;if(0===r)return d(e,i),void u.push(e);h[e]=r,n.forEach((o=>{if(!t[o])throw new Error("async.auto task `"+e+"` has a non-existent dependency `"+o+"` in "+n.join(", "));var s,a;(a=c[s=o])||(a=c[s]=[]),a.push((()=>{0==--r&&d(e,i)}))}))})),function(){for(var t=0;u.length;)t++,p(u.pop()).forEach((t=>{0==--h[t]&&u.push(t)}));if(t!==n)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}(),f(),i[Tc]}var Nc=/^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/,Dc=/^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/,Mc=/,/,Uc=/(=.+)?(\s*)$/,Lc=class{constructor(){this.head=this.tail=null,this.length=0}removeLink(t){return t.prev?t.prev.next=t.next:this.head=t.next,t.next?t.next.prev=t.prev:this.tail=t.prev,t.prev=t.next=null,this.length-=1,t}empty(){for(;this.head;)this.shift();return this}insertAfter(t,e){e.prev=t,e.next=t.next,t.next?t.next.prev=e:this.tail=e,t.next=e,this.length+=1}insertBefore(t,e){e.prev=t.prev,e.next=t,t.prev?t.prev.next=e:this.head=e,t.prev=e,this.length+=1}unshift(t){this.head?this.insertBefore(this.head,t):Bc(this,t)}push(t){this.tail?this.insertAfter(this.tail,t):Bc(this,t)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){for(var t=this.head;t;)yield t.data,t=t.next}remove(t){for(var e=this.head;e;){var{next:i}=e;t(e)&&this.removeLink(e),e=i}return this}};function Bc(t,e){t.length=1,t.head=t.tail=e}function Jc(t,e,i){if(null==e)e=1;else if(0===e)throw new RangeError("Concurrency must not be zero");var n=fc(t),r=0,o=[];const s={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function a(t,e){return t?e?void(s[t]=s[t].filter((t=>t!==e))):s[t]=[]:Object.keys(s).forEach((t=>s[t]=[]))}function c(t,...e){s[t].forEach((t=>t(...e)))}var l=!1;function u(t,e,i,n){if(null!=n&&"function"!=typeof n)throw new Error("task callback must be a function");var r,o;function s(t,...e){return t?i?o(t):r():e.length<=1?r(e[0]):void r(e)}v.started=!0;var a=v._createTaskItem(t,i?s:n||s);if(e?v._tasks.unshift(a):v._tasks.push(a),l||(l=!0,cc((()=>{l=!1,v.process()}))),i||!n)return new Promise(((t,e)=>{r=t,o=e}))}function h(t){return function(e,...i){r-=1;for(var n=0,s=t.length;n<s;n++){var a=t[n],l=o.indexOf(a);0===l?o.shift():l>0&&o.splice(l,1),a.callback(e,...i),null!=e&&c("error",e,a.data)}r<=v.concurrency-v.buffer&&c("unsaturated"),v.idle()&&c("drain"),v.process()}}function d(t){return!(0!==t.length||!v.idle()||(cc((()=>c("drain"))),0))}const f=t=>e=>{if(!e)return new Promise(((e,i)=>{!function(t){const n=(...r)=>{a(t,n),((t,n)=>{if(t)return i(t);e(n)})(...r)};s[t].push(n)}(t)}));a(t),function(t,e){s[t].push(e)}(t,e)};var p=!1,v={_tasks:new Lc,_createTaskItem:(t,e)=>({data:t,callback:e}),*[Symbol.iterator](){yield*v._tasks[Symbol.iterator]()},concurrency:e,payload:i,buffer:e/4,started:!1,paused:!1,push(t,e){if(Array.isArray(t)){if(d(t))return;return t.map((t=>u(t,!1,!1,e)))}return u(t,!1,!1,e)},pushAsync(t,e){if(Array.isArray(t)){if(d(t))return;return t.map((t=>u(t,!1,!0,e)))}return u(t,!1,!0,e)},kill(){a(),v._tasks.empty()},unshift(t,e){if(Array.isArray(t)){if(d(t))return;return t.map((t=>u(t,!0,!1,e)))}return u(t,!0,!1,e)},unshiftAsync(t,e){if(Array.isArray(t)){if(d(t))return;return t.map((t=>u(t,!0,!0,e)))}return u(t,!0,!0,e)},remove(t){v._tasks.remove(t)},process(){if(!p){for(p=!0;!v.paused&&r<v.concurrency&&v._tasks.length;){var t=[],e=[],i=v._tasks.length;v.payload&&(i=Math.min(i,v.payload));for(var s=0;s<i;s++){var a=v._tasks.shift();t.push(a),o.push(a),e.push(a.data)}r+=1,0===v._tasks.length&&c("empty"),r===v.concurrency&&c("saturated");var l=yc(h(t));n(e,l)}p=!1}},length:()=>v._tasks.length,running:()=>r,workersList:()=>o,idle:()=>v._tasks.length+r===0,pause(){v.paused=!0},resume(){!1!==v.paused&&(v.paused=!1,cc(v.process))}};return Object.defineProperties(v,{saturated:{writable:!1,value:f("saturated")},unsaturated:{writable:!1,value:f("unsaturated")},empty:{writable:!1,value:f("empty")},drain:{writable:!1,value:f("drain")},error:{writable:!1,value:f("error")}}),v}var $c=pc((function(t,e,i,n){n=bc(n);var r=fc(i);return Cc(t,((t,i,n)=>{r(e,t,((t,i)=>{e=i,n(t)}))}),(t=>n(t,e)))}),4);function zc(...t){var e=t.map(fc);return function(...t){var i=this,n=t[t.length-1];return"function"==typeof n?t.pop():n=Oc(),$c(e,t,((t,e,n)=>{e.apply(i,t.concat(((t,...e)=>{n(t,e)})))}),((t,e)=>n(t,...e))),n[Tc]}}var Hc=pc((function(t,e,i,n){return gc(kc(e),t,i,n)}),4),Kc=pc((function(t,e,i,n){var r=fc(i);return Hc(t,e,((t,e)=>{r(t,((t,...i)=>t?e(t):e(t,i)))}),((t,e)=>{for(var i=[],r=0;r<e.length;r++)e[r]&&(i=i.concat(...e[r]));return n(t,i)}))}),4),Wc=pc((function(t,e,i){return Kc(t,1/0,e,i)}),3),qc=pc((function(t,e,i){return Kc(t,1,e,i)}),3);function Vc(t,e){return(i,n,r,o)=>{var s,a=!1;const c=fc(r);i(n,((i,n,r)=>{c(i,((n,o)=>n||!1===n?r(n):t(o)&&!s?(a=!0,s=e(!0,i),r(null,wc)):void r()))}),(t=>{if(t)return o(t);o(null,a?s:e(!1))}))}}var Gc=pc((function(t,e,i){return Vc((t=>t),((t,e)=>e))(Ac,t,e,i)}),3),Xc=pc((function(t,e,i,n){return Vc((t=>t),((t,e)=>e))(kc(e),t,i,n)}),4),Yc=pc((function(t,e,i){return Vc((t=>t),((t,e)=>e))(kc(1),t,e,i)}),3);function Zc(t){return(e,...i)=>fc(e)(...i,((e,...i)=>{"object"==typeof console&&(e?console.error&&console.error(e):console[t]&&i.forEach((e=>console[t](e))))}))}var Qc=Zc("dir"),tl=pc((function(t,e,i){i=yc(i);var n,r=fc(t),o=fc(e);function s(t,...e){if(t)return i(t);!1!==t&&(n=e,o(...e,a))}function a(t,e){return t?i(t):!1!==t?e?void r(s):i(null,...n):void 0}return a(null,!0)}),3);function el(t){return(e,i,n)=>t(e,n)}var il=pc((function(t,e,i){return Ac(t,el(fc(e)),i)}),3),nl=pc((function(t,e,i,n){return kc(e)(t,el(fc(i)),n)}),4),rl=pc((function(t,e,i){return nl(t,1,e,i)}),3);function ol(t){return dc(t)?t:function(...e){var i=e.pop(),n=!0;e.push(((...t)=>{n?cc((()=>i(...t))):i(...t)})),t.apply(this,e),n=!1}}var sl=pc((function(t,e,i){return Vc((t=>!t),(t=>!t))(Ac,t,e,i)}),3),al=pc((function(t,e,i,n){return Vc((t=>!t),(t=>!t))(kc(e),t,i,n)}),4),cl=pc((function(t,e,i){return Vc((t=>!t),(t=>!t))(Cc,t,e,i)}),3);function ll(t,e,i,n){var r=new Array(e.length);t(e,((t,e,n)=>{i(t,((t,i)=>{r[e]=!!i,n(t)}))}),(t=>{if(t)return n(t);for(var i=[],o=0;o<e.length;o++)r[o]&&i.push(e[o]);n(null,i)}))}function ul(t,e,i,n){var r=[];t(e,((t,e,n)=>{i(t,((i,o)=>{if(i)return n(i);o&&r.push({index:e,value:t}),n(i)}))}),(t=>{if(t)return n(t);n(null,r.sort(((t,e)=>t.index-e.index)).map((t=>t.value)))}))}function hl(t,e,i,n){return(mc(e)?ll:ul)(t,e,fc(i),n)}var dl=pc((function(t,e,i){return hl(Ac,t,e,i)}),3),fl=pc((function(t,e,i,n){return hl(kc(e),t,i,n)}),4),pl=pc((function(t,e,i){return hl(Cc,t,e,i)}),3),vl=pc((function(t,e){var i=yc(e),n=fc(ol(t));return function t(e){if(e)return i(e);!1!==e&&n(t)}()}),2),gl=pc((function(t,e,i,n){var r=fc(i);return Hc(t,e,((t,e)=>{r(t,((i,n)=>i?e(i):e(i,{key:n,val:t})))}),((t,e)=>{for(var i={},{hasOwnProperty:r}=Object.prototype,o=0;o<e.length;o++)if(e[o]){var{key:s}=e[o],{val:a}=e[o];r.call(i,s)?i[s].push(a):i[s]=[a]}return n(t,i)}))}),4),ml=Zc("log"),wl=pc((function(t,e,i,n){n=bc(n);var r={},o=fc(i);return kc(e)(t,((t,e,i)=>{o(t,e,((t,n)=>{if(t)return i(t);r[e]=n,i(t)}))}),(t=>n(t,r)))}),4),bl=ac(oc?process.nextTick:rc?setImmediate:sc),yl=pc(((t,e,i)=>{var n=mc(e)?[]:{};t(e,((t,e,i)=>{fc(t)(((t,...r)=>{r.length<2&&([r]=r),n[e]=r,i(t)}))}),(t=>i(t,n)))}),3);function xl(t,e){var i=fc(t);return Jc(((t,e)=>{i(t[0],e)}),e,1)}var kl=class{constructor(){this.heap=[],this.pushCount=Number.MIN_SAFE_INTEGER}get length(){return this.heap.length}empty(){return this.heap=[],this}percUp(t){let e;for(;t>0&&Sl(this.heap[t],this.heap[e=El(t)]);){let i=this.heap[t];this.heap[t]=this.heap[e],this.heap[e]=i,t=e}}percDown(t){let e;for(;(e=1+(t<<1))<this.heap.length&&(e+1<this.heap.length&&Sl(this.heap[e+1],this.heap[e])&&(e+=1),!Sl(this.heap[t],this.heap[e]));){let i=this.heap[t];this.heap[t]=this.heap[e],this.heap[e]=i,t=e}}push(t){t.pushCount=++this.pushCount,this.heap.push(t),this.percUp(this.heap.length-1)}unshift(t){return this.heap.push(t)}shift(){let[t]=this.heap;return this.heap[0]=this.heap[this.heap.length-1],this.heap.pop(),this.percDown(0),t}toArray(){return[...this]}*[Symbol.iterator](){for(let t=0;t<this.heap.length;t++)yield this.heap[t].data}remove(t){let e=0;for(let i=0;i<this.heap.length;i++)t(this.heap[i])||(this.heap[e]=this.heap[i],e++);this.heap.splice(e);for(let t=El(this.heap.length-1);t>=0;t--)this.percDown(t);return this}};function El(t){return(t+1>>1)-1}function Sl(t,e){return t.priority!==e.priority?t.priority<e.priority:t.pushCount<e.pushCount}var Fl=pc((function(t,e){if(e=bc(e),!Array.isArray(t))return e(new TypeError("First argument to race must be an array of functions"));if(!t.length)return e();for(var i=0,n=t.length;i<n;i++)fc(t[i])(e)}),2);function Al(t,e,i,n){var r=[...t].reverse();return $c(r,e,i,n)}function _l(t){var e=fc(t);return ic((function(t,i){return t.push(((t,...e)=>{let n={};if(t&&(n.error=t),e.length>0){var r=e;e.length<=1&&([r]=e),n.value=r}i(null,n)})),e.apply(this,t)}))}function jl(t,e,i,n){const r=fc(i);return hl(t,e,((t,e)=>{r(t,((t,i)=>{e(t,!i)}))}),n)}var Cl=pc((function(t,e,i){return jl(Ac,t,e,i)}),3),Rl=pc((function(t,e,i,n){return jl(kc(e),t,i,n)}),4),Il=pc((function(t,e,i){return jl(Cc,t,e,i)}),3);function Tl(t){return function(){return t}}function Ol(t,e,i){var n={times:5,intervalFunc:Tl(0)};if(arguments.length<3&&"function"==typeof t?(i=e||Oc(),e=t):(Pl(n,t),i=i||Oc()),"function"!=typeof e)throw new Error("Invalid arguments for async.retry");var r=fc(e),o=1;function s(){r(((t,...e)=>{!1!==t&&(t&&o++<n.times&&("function"!=typeof n.errorFilter||n.errorFilter(t))?setTimeout(s,n.intervalFunc(o-1)):i(t,...e))}))}return s(),i[Tc]}function Pl(t,e){if("object"==typeof e)t.times=+e.times||5,t.intervalFunc="function"==typeof e.interval?e.interval:Tl(+e.interval||0),t.errorFilter=e.errorFilter;else{if("number"!=typeof e&&"string"!=typeof e)throw new Error("Invalid arguments for async.retry");t.times=+e||5}}var Nl=pc((function(t,e,i){return Vc(Boolean,(t=>t))(Ac,t,e,i)}),3),Dl=pc((function(t,e,i,n){return Vc(Boolean,(t=>t))(kc(e),t,i,n)}),4),Ml=pc((function(t,e,i){return Vc(Boolean,(t=>t))(Cc,t,e,i)}),3),Ul=pc((function(t,e,i){var n=fc(e);return _c(t,((t,e)=>{n(t,((i,n)=>{if(i)return e(i);e(i,{value:t,criteria:n})}))}),((t,e)=>{if(t)return i(t);i(null,e.sort(r).map((t=>t.value)))}));function r(t,e){var i=t.criteria,n=e.criteria;return i<n?-1:i>n?1:0}}),3);function Ll(t,e,i,n){var r=fc(i);return Hc(function(t){for(var e=Array(t);t--;)e[t]=t;return e}(t),e,r,n)}var Bl,Jl=pc((function(t,e){var i,n=null;return rl(t,((t,e)=>{fc(t)(((t,...r)=>{if(!1===t)return e(t);r.length<2?[i]=r:i=r,n=t,e(t?null:{})}))}),(()=>e(n,i)))})),$l=pc((function(t,e,i){i=yc(i);var n=fc(e),r=fc(t),o=[];function s(t,...e){if(t)return i(t);o=e,!1!==t&&r(a)}function a(t,e){return t?i(t):!1!==t?e?void n(s):i(null,...o):void 0}return r(a)}),3),zl=pc((function(t,e){if(e=bc(e),!Array.isArray(t))return e(new Error("First argument to waterfall must be an array of functions"));if(!t.length)return e();var i=0;function n(e){fc(t[i++])(...e,yc(r))}function r(r,...o){if(!1!==r)return r||i===t.length?e(r,...o):void n(o)}n([])})),Hl={apply:function(t,...e){return(...i)=>t(...e,...i)},applyEach:jc,applyEachSeries:Ic,asyncify:lc,auto:Pc,autoInject:function(t,e){var i={};return Object.keys(t).forEach((e=>{var n,r=t[e],o=dc(r),s=!o&&1===r.length||o&&0===r.length;if(Array.isArray(r))n=[...r],r=n.pop(),i[e]=n.concat(n.length>0?a:r);else if(s)i[e]=r;else{if(n=function(t){const e=function(t){let e="",i=0,n=t.indexOf("*/");for(;i<t.length;)if("/"===t[i]&&"/"===t[i+1]){let e=t.indexOf("\n",i);i=-1===e?t.length:e}else if(-1!==n&&"/"===t[i]&&"*"===t[i+1]){let r=t.indexOf("*/",i);-1!==r?(i=r+2,n=t.indexOf("*/",i)):(e+=t[i],i++)}else e+=t[i],i++;return e}(t.toString());let i=e.match(Nc);if(i||(i=e.match(Dc)),!i)throw new Error("could not parse args in autoInject\nSource:\n"+e);let[,n]=i;return n.replace(/\s/g,"").split(Mc).map((t=>t.replace(Uc,"").trim()))}(r),0===r.length&&!o&&0===n.length)throw new Error("autoInject task functions require explicit parameters.");o||n.pop(),i[e]=n.concat(a)}function a(t,e){var i=n.map((e=>t[e]));i.push(e),fc(r)(...i)}})),Pc(i,e)},cargo:function(t,e){return Jc(t,1,e)},cargoQueue:function(t,e,i){return Jc(t,e,i)},compose:function(...t){return zc(...t.reverse())},concat:Wc,concatLimit:Kc,concatSeries:qc,constant:function(...t){return function(...e){return e.pop()(null,...t)}},detect:Gc,detectLimit:Xc,detectSeries:Yc,dir:Qc,doUntil:function(t,e,i){const n=fc(e);return tl(t,((...t)=>{const e=t.pop();n(...t,((t,i)=>e(t,!i)))}),i)},doWhilst:tl,each:il,eachLimit:nl,eachOf:Ac,eachOfLimit:Ec,eachOfSeries:Cc,eachSeries:rl,ensureAsync:ol,every:sl,everyLimit:al,everySeries:cl,filter:dl,filterLimit:fl,filterSeries:pl,forever:vl,groupBy:function(t,e,i){return gl(t,1/0,e,i)},groupByLimit:gl,groupBySeries:function(t,e,i){return gl(t,1,e,i)},log:ml,map:_c,mapLimit:Hc,mapSeries:Rc,mapValues:function(t,e,i){return wl(t,1/0,e,i)},mapValuesLimit:wl,mapValuesSeries:function(t,e,i){return wl(t,1,e,i)},memoize:function(t,e=(t=>t)){var i=Object.create(null),n=Object.create(null),r=fc(t),o=ic(((t,o)=>{var s=e(...t);s in i?cc((()=>o(null,...i[s]))):s in n?n[s].push(o):(n[s]=[o],r(...t,((t,...e)=>{t||(i[s]=e);var r=n[s];delete n[s];for(var o=0,a=r.length;o<a;o++)r[o](t,...e)})))}));return o.memo=i,o.unmemoized=t,o},nextTick:bl,parallel:function(t,e){return yl(Ac,t,e)},parallelLimit:function(t,e,i){return yl(kc(e),t,i)},priorityQueue:function(t,e){var i=xl(t,e),{push:n,pushAsync:r}=i;function o(t,e){return Array.isArray(t)?t.map((t=>({data:t,priority:e}))):{data:t,priority:e}}return i._tasks=new kl,i._createTaskItem=({data:t,priority:e},i)=>({data:t,priority:e,callback:i}),i.push=function(t,e=0,i){return n(o(t,e),i)},i.pushAsync=function(t,e=0,i){return r(o(t,e),i)},delete i.unshift,delete i.unshiftAsync,i},queue:xl,race:Fl,reduce:$c,reduceRight:Al,reflect:_l,reflectAll:function(t){var e;return Array.isArray(t)?e=t.map(_l):(e={},Object.keys(t).forEach((i=>{e[i]=_l.call(this,t[i])}))),e},reject:Cl,rejectLimit:Rl,rejectSeries:Il,retry:Ol,retryable:function(t,e){e||(e=t,t=null);let i=t&&t.arity||e.length;dc(e)&&(i+=1);var n=fc(e);return ic(((e,r)=>{function o(t){n(...e,t)}return(e.length<i-1||null==r)&&(e.push(r),r=Oc()),t?Ol(t,o,r):Ol(o,r),r[Tc]}))},seq:zc,series:function(t,e){return yl(Cc,t,e)},setImmediate:cc,some:Nl,someLimit:Dl,someSeries:Ml,sortBy:Ul,timeout:function(t,e,i){var n=fc(t);return ic(((r,o)=>{var s,a=!1;r.push(((...t)=>{a||(o(...t),clearTimeout(s))})),s=setTimeout((function(){var e=new Error('Callback function "'+(t.name||"anonymous")+'" timed out.');e.code="ETIMEDOUT",i&&(e.info=i),a=!0,o(e)}),e),n(...r)}))},times:function(t,e,i){return Ll(t,1/0,e,i)},timesLimit:Ll,timesSeries:function(t,e,i){return Ll(t,1,e,i)},transform:function(t,e,i,n){arguments.length<=3&&"function"==typeof e&&(n=i,i=e,e=Array.isArray(t)?[]:{}),n=bc(n||Oc());var r=fc(i);return Ac(t,((t,i,n)=>{r(e,t,i,n)}),(t=>n(t,e))),n[Tc]},tryEach:Jl,unmemoize:function(t){return(...e)=>(t.unmemoized||t)(...e)},until:function(t,e,i){const n=fc(t);return $l((t=>n(((e,i)=>t(e,!i)))),e,i)},waterfall:zl,whilst:$l,all:sl,allLimit:al,allSeries:cl,any:Nl,anyLimit:Dl,anySeries:Ml,find:Gc,findLimit:Xc,findSeries:Yc,flatMap:Wc,flatMapLimit:Kc,flatMapSeries:qc,forEach:il,forEachSeries:rl,forEachLimit:nl,forEachOf:Ac,forEachOfSeries:Cc,forEachOfLimit:Ec,inject:$c,foldl:$c,foldr:Al,select:dl,selectLimit:fl,selectSeries:pl,wrapSync:lc,during:$l,doDuring:tl},Kl=Hl,Wl=fe(Vs()),ql="http://www.w3.org/1999/02/22-rdf-syntax-ns#",Vl="http://www.w3.org/2001/XMLSchema#",Gl="http://www.w3.org/2000/10/swap/",Xl={xsd:{decimal:`${Vl}decimal`,boolean:`${Vl}boolean`,double:`${Vl}double`,integer:`${Vl}integer`,string:`${Vl}string`},rdf:{type:`${ql}type`,nil:`${ql}nil`,first:`${ql}first`,rest:`${ql}rest`,langString:`${ql}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${Gl}reify#forSome`,forAll:`${Gl}reify#forAll`},log:{implies:`${Gl}log#implies`}},Yl=fe(Gs()),{xsd:Zl}=Xl,Ql=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,tu={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},eu=/[\x00-\x20<>\\"\{\}\|\^\`]/,iu={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},nu=/$0^/,{rdf:ru,xsd:ou}=Xl,su=0,au={namedNode:function(t){return new uu(t)},blankNode:function(t){return new du(t||"n3-"+su++)},variable:function(t){return new fu(t)},literal:function(t,e){if("string"==typeof e)return new hu(`"${t}"@${e.toLowerCase()}`);let i=e?e.value:"";return""===i&&("boolean"==typeof t?i=ou.boolean:"number"==typeof t&&(Number.isFinite(t)?i=Number.isInteger(t)?ou.integer:ou.double:(i=ou.double,Number.isNaN(t)||(t=t>0?"INF":"-INF")))),new hu(""===i||i===ou.string?`"${t}"`:`"${t}"^^${i}`)},defaultGraph:function(){return Bl},quad:vu,triple:vu},cu=au,lu=class{constructor(t){this.id=t}get value(){return this.id}equals(t){return t instanceof lu?this.id===t.id:!!t&&this.termType===t.termType&&this.value===t.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}},uu=class extends lu{get termType(){return"NamedNode"}},hu=class extends lu{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const t=this.id;let e=t.lastIndexOf('"')+1;return e<t.length&&"@"===t[e++]?t.substr(e).toLowerCase():""}get datatype(){return new uu(this.datatypeString)}get datatypeString(){const t=this.id,e=t.lastIndexOf('"')+1,i=e<t.length?t[e]:"";return"^"===i?t.substr(e+2):"@"!==i?ou.string:ru.langString}equals(t){return t instanceof hu?this.id===t.id:!!t&&!!t.datatype&&this.termType===t.termType&&this.value===t.value&&this.language===t.language&&this.datatype.value===t.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}},du=class extends lu{constructor(t){super(`_:${t}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}},fu=class extends lu{constructor(t){super(`?${t}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}};Bl=new class extends lu{constructor(){return super(""),Bl||this}get termType(){return"DefaultGraph"}equals(t){return this===t||!!t&&this.termType===t.termType}};var pu=class extends lu{constructor(t,e,i,n){super(""),this._subject=t,this._predicate=e,this._object=i,this._graph=n||Bl}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(t){return!!t&&this._subject.equals(t.subject)&&this._predicate.equals(t.predicate)&&this._object.equals(t.object)&&this._graph.equals(t.graph)}};function vu(t,e,i,n){return new pu(t,e,i,n)}var gu=0,mu=class{constructor(t){this._contextStack=[],this._graph=null,this._setBase((t=t||{}).baseIRI),t.factory&&bu(this,t.factory);const e="string"==typeof t.format?t.format.match(/\w*$/)[0].toLowerCase():"",i=/turtle/.test(e),n=/trig/.test(e),r=/triple/.test(e),o=/quad/.test(e),s=this._n3Mode=/n3/.test(e),a=r||o;(this._supportsNamedGraphs=!(i||s))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(i||n||r||s),this._supportsRDFStar=""===e||/star|\*$/.test(e),a&&(this._resolveRelativeIRI=()=>null),this._blankNodePrefix="string"!=typeof t.blankNodePrefix?"":t.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=t.lexer||new class{constructor(t){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]*)?$/,this._lineMode=!!(t=t||{}).lineMode){this._n3Mode=!1;for(const t in this)!(t in iu)&&this[t]instanceof RegExp&&(this[t]=nu)}else this._n3Mode=!1!==t.n3;this._comments=!!t.comments,this._literalClosingPos=0}_tokenizeToEnd(t,e){let i=this._input,n=i.length;for(;;){let t,s;for(;t=this._newline.exec(i);)this._comments&&(s=this._comment.exec(t[0]))&&r("comment",s[1],"",this._line,t[0].length),i=i.substr(t[0].length,i.length),n=i.length,this._line++;if(!t&&(t=this._whitespace.exec(i))&&(i=i.substr(t[0].length,i.length)),this._endOfFile.test(i))return e&&(this._comments&&(s=this._comment.exec(i))&&r("comment",s[1],"",this._line,i.length),i=null,r("eof","","",this._line,0)),this._input=i;const a=this._line,c=i[0];let l="",u="",h="",d=null,f=0,p=!1;switch(c){case"^":if(i.length<3)break;if("^"!==i[1]){this._n3Mode&&(f=1,l="^");break}if(this._previousMarker="^^",i=i.substr(2),"<"!==i[0]){p=!0;break}case"<":if(d=this._unescapedIri.exec(i))l="IRI",u=d[1];else if(d=this._iri.exec(i)){if(u=this._unescape(d[1]),null===u||eu.test(u))return o(this);l="IRI"}else i.length>1&&"<"===i[1]?(l="<<",f=2):this._n3Mode&&i.length>1&&"="===i[1]&&(l="inverse",f=2,u=">");break;case">":i.length>1&&">"===i[1]&&(l=">>",f=2);break;case"_":((d=this._blank.exec(i))||e&&(d=this._blank.exec(`${i} `)))&&(l="blank",h="_",u=d[1]);break;case'"':if(d=this._simpleQuotedString.exec(i))u=d[1];else if(({value:u,matchLength:f}=this._parseLiteral(i)),null===u)return o(this);null===d&&0===f||(l="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(d=this._simpleApostropheString.exec(i))u=d[1];else if(({value:u,matchLength:f}=this._parseLiteral(i)),null===u)return o(this);null===d&&0===f||(l="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(d=this._variable.exec(i))&&(l="var",u=d[0]);break;case"@":"literal"===this._previousMarker&&(d=this._langcode.exec(i))?(l="langcode",u=d[1]):(d=this._keyword.exec(i))&&(l=d[0]);break;case".":if(1===i.length?e:i[1]<"0"||i[1]>"9"){l=".",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"-":(d=this._number.exec(i)||e&&(d=this._number.exec(`${i} `)))&&(l="literal",u=d[0],h="string"==typeof d[1]?Zl.double:"string"==typeof d[2]?Zl.decimal:Zl.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(d=this._sparqlKeyword.exec(i))?l=d[0].toUpperCase():p=!0;break;case"f":case"t":(d=this._boolean.exec(i))?(l="literal",u=d[0],h=Zl.boolean):p=!0;break;case"a":(d=this._shortPredicates.exec(i))?(l="abbreviation",u="a"):p=!0;break;case"=":this._n3Mode&&i.length>1&&(l="abbreviation",">"!==i[1]?(f=1,u="="):(f=2,u=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(f=1,l=c);break;default:p=!0}if(p&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(d=this._prefix.exec(i))?((d=this._prefixed.exec(i))||e&&(d=this._prefixed.exec(`${i} `)))&&(l="prefixed",h=d[1]||"",u=this._unescape(d[2])):(l="prefix",u=d[1]||"")),"^^"===this._previousMarker)switch(l){case"prefixed":l="type";break;case"IRI":l="typeIRI";break;default:l=""}if(!l)return e||!/^'''|^"""/.test(i)&&/\n|\r/.test(i)?o(this):this._input=i;const v=f||d[0].length,g=r(l,u,h,a,v);this.previousToken=g,this._previousMarker=l,i=i.substr(v,i.length)}function r(e,r,o,s,a){const c=i?n-i.length:n,l={type:e,value:r,prefix:o,line:s,start:c,end:c+a};return t(null,l),l}function o(e){t(e._syntaxError(/^\S*/.exec(i)[0]))}}_unescape(t){let e=!1;const i=t.replace(Ql,((t,i,n,r)=>{if("string"==typeof i)return String.fromCharCode(Number.parseInt(i,16));if("string"==typeof n){let t=Number.parseInt(n,16);return t<=65535?String.fromCharCode(Number.parseInt(n,16)):String.fromCharCode(55296+((t-=65536)>>10),56320+(1023&t))}return r in tu?tu[r]:(e=!0,"")}));return e?null:i}_parseLiteral(t){if(t.length>=3){const e=t.match(/^(?:"""|"|'''|'|)/)[0],i=e.length;let n=Math.max(this._literalClosingPos,i);for(;(n=t.indexOf(e,n))>0;){let e=0;for(;"\\"===t[n-e-1];)e++;if(e%2==0){const e=t.substring(i,n),r=e.split(/\r\n|\r|\n/).length-1,o=n+i;if(1===i&&0!==r||3===i&&this._lineMode)break;return this._line+=r,{value:this._unescape(e),matchLength:o}}n++}this._literalClosingPos=t.length-i+1}return{value:"",matchLength:0}}_syntaxError(t){this._input=null;const e=new Error(`Unexpected "${t}" on line ${this._line}.`);return e.context={token:void 0,line:this._line,previousToken:this.previousToken},e}_readStartingBom(t){return t.startsWith("\ufeff")?t.substr(1):t}tokenize(t,e){if(this._line=1,"string"==typeof t){if(this._input=this._readStartingBom(t),"function"!=typeof e){const t=[];let e;if(this._tokenizeToEnd(((i,n)=>i?e=i:t.push(n)),!0),e)throw e;return t}(0,Yl.default)((()=>this._tokenizeToEnd(e,!0)))}else this._pendingBuffer=null,"function"==typeof t.setEncoding&&t.setEncoding("utf8"),t.on("data",(t=>{null!==this._input&&0!==t.length&&(this._pendingBuffer&&(t=Buffer.concat([this._pendingBuffer,t]),this._pendingBuffer=null),128&t[t.length-1]?this._pendingBuffer=t:(void 0===this._input?this._input=this._readStartingBom("string"==typeof t?t:t.toString()):this._input+=t,this._tokenizeToEnd(e,!1)))})),t.on("end",(()=>{"string"==typeof this._input&&this._tokenizeToEnd(e,!0)})),t.on("error",e)}}({lineMode:a,n3:s}),this._explicitQuantifiers=!!t.explicitQuantifiers}static _resetBlankNodePrefix(){gu=0}_setBase(t){if(t){const e=t.indexOf("#");e>=0&&(t=t.substr(0,e)),this._base=t,this._basePath=t.indexOf("/")<0?t:t.replace(/[^\/?]*(?:\?.*)?$/,""),t=t.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=t[0],this._baseScheme=t[1]}else this._base="",this._basePath=""}_saveContext(t,e,i,n,r){const o=this._n3Mode;this._contextStack.push({type:t,subject:i,predicate:n,object:r,graph:e,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(t,e){const i=this._contextStack.pop();if(!i||i.type!==t)return this._error(`Unexpected ${e.type}`,e);this._subject=i.subject,this._predicate=i.predicate,this._object=i.object,this._graph=i.graph,this._n3Mode&&(this._inversePredicate=i.inverse,this._prefixes._=i.blankPrefix,this._quantified=i.quantified)}_readInTopContext(t){switch(t.type){case"eof":return null!==this._graph?this._error("Unclosed graph",t):(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(t)}}_readEntity(t,e){let i;switch(t.type){case"IRI":case"typeIRI":const e=this._resolveIRI(t.value);if(null===e)return this._error("Invalid IRI",t);i=this._namedNode(e);break;case"type":case"prefixed":const n=this._prefixes[t.prefix];if(void 0===n)return this._error(`Undefined prefix "${t.prefix}:"`,t);i=this._namedNode(n+t.value);break;case"blank":i=this._blankNode(this._prefixes[t.prefix]+t.value);break;case"var":i=this._variable(t.value.substr(1));break;default:return this._error(`Expected entity but got ${t.type}`,t)}return!e&&this._n3Mode&&i.id in this._quantified&&(i=this._quantified[i.id]),i}_readSubject(t){switch(this._predicate=null,t.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",t);case"}":return this._readPunctuation(t);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',t);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',t);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",t);if(0===t.prefix.length)return this._literalValue=t.value,this._completeSubjectLiteral;this._subject=this._literal(t.value,this._namedNode(t.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",t);default:if(void 0===(this._subject=this._readEntity(t)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(t){const e=t.type;switch(e){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[t.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${e}`,t):(this._subject=null,"]"===e?this._readBlankNodeTail(t):this._readPunctuation(t));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",t);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",t);default:if(void 0===(this._predicate=this._readEntity(t)))return}return this._readObject}_readObject(t){switch(t.type){case"literal":if(0===t.prefix.length)return this._literalValue=t.value,this._readDataTypeOrLang;this._object=this._literal(t.value,this._namedNode(t.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",t);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",t);default:if(void 0===(this._object=this._readEntity(t)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(t){return"{"===t.type?this._readGraph(t):this._readPredicate(t)}_readGraph(t){return"{"!==t.type?this._error(`Expected graph but got ${t.type}`,t):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(t){return"]"===t.type?(this._subject=null,this._readBlankNodeTail(t)):(this._predicate=null,this._readPredicate(t))}_readBlankNodeTail(t){if("]"!==t.type)return this._readBlankNodePunctuation(t);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const e=null===this._predicate;return this._restoreContext("blank",t),null!==this._object?this._getContextEndReader():null!==this._predicate?this._readObject:e?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(t){switch(t.type){case".":case"}":return this._subject=null,this._readPunctuation(t);default:return this._readPredicate(t)}}_readListItem(t){let e=null,i=null,n=this._readListItem;const r=this._subject,o=this._contextStack,s=o[o.length-1];switch(t.type){case"[":this._saveContext("blank",this._graph,i=this._blankNode(),this.RDF_FIRST,this._subject=e=this._blankNode()),n=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,i=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",t),0!==o.length&&"list"===o[o.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(n=this._readPredicate,this._subject===this.RDF_NIL)return n}else if(n=this._getContextEndReader(),this._object===this.RDF_NIL)return n;i=this.RDF_NIL;break;case"literal":0===t.prefix.length?(this._literalValue=t.value,n=this._readListItemDataTypeOrLang):(e=this._literal(t.value,this._namedNode(t.prefix)),n=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",t);default:if(void 0===(e=this._readEntity(t)))return}if(null===i&&(this._subject=i=this._blankNode()),null===r?null===s.predicate?s.subject=i:s.object=i:this._emit(r,this.RDF_REST,i,this._graph),null!==e){if(this._n3Mode&&("IRI"===t.type||"prefixed"===t.type))return this._saveContext("item",this._graph,i,this.RDF_FIRST,e),this._subject=e,this._predicate=null,this._getPathReader(this._readListItem);this._emit(i,this.RDF_FIRST,e,this._graph)}return n}_readDataTypeOrLang(t){return this._completeObjectLiteral(t,!1)}_readListItemDataTypeOrLang(t){return this._completeObjectLiteral(t,!0)}_completeLiteral(t){let e=this._literal(this._literalValue);switch(t.type){case"type":case"typeIRI":const i=this._readEntity(t);if(void 0===i)return;e=this._literal(this._literalValue,i),t=null;break;case"langcode":e=this._literal(this._literalValue,t.value),t=null}return{token:t,literal:e}}_completeSubjectLiteral(t){return this._subject=this._completeLiteral(t).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(t,e){const i=this._completeLiteral(t);if(i)return this._object=i.literal,e&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===i.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(i.token))}_readFormulaTail(t){return"}"!==t.type?this._readPunctuation(t):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",t),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(t){let e,i=this._graph;const n=this._subject,r=this._inversePredicate;switch(t.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",t);if(this._n3Mode)return this._readFormulaTail(t);this._graph=null;case".":this._subject=null,e=this._contextStack.length?this._readSubject:this._readInTopContext,r&&(this._inversePredicate=!1);break;case";":e=this._readPredicate;break;case",":e=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(i=this._readEntity(t))){e=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,t)}if(null!==n){const t=this._predicate,e=this._object;r?this._emit(e,t,n,i):this._emit(n,t,e,i)}return e}_readBlankNodePunctuation(t){let e;switch(t.type){case";":e=this._readPredicate;break;case",":e=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,t)}return this._emit(this._subject,this._predicate,this._object,this._graph),e}_readQuadPunctuation(t){return"."!==t.type?this._error("Expected dot to follow quad",t):this._readInTopContext}_readPrefix(t){return"prefix"!==t.type?this._error("Expected prefix to follow @prefix",t):(this._prefix=t.value,this._readPrefixIRI)}_readPrefixIRI(t){if("IRI"!==t.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,t);const e=this._readEntity(t);return this._prefixes[this._prefix]=e.value,this._prefixCallback(this._prefix,e),this._readDeclarationPunctuation}_readBaseIRI(t){const e="IRI"===t.type&&this._resolveIRI(t.value);return e?(this._setBase(e),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",t)}_readNamedGraphLabel(t){switch(t.type){case"IRI":case"blank":case"prefixed":return this._readSubject(t),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",t)}}_readNamedGraphBlankLabel(t){return"]"!==t.type?this._error("Invalid graph label",t):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(t){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(t)):"."!==t.type?this._error("Expected declaration to end with a dot",t):this._readInTopContext}_readQuantifierList(t){let e;switch(t.type){case"IRI":case"prefixed":if(void 0!==(e=this._readEntity(t,!0)))break;default:return this._error(`Unexpected ${t.type}`,t)}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,e,this.QUANTIFIERS_GRAPH)):this._quantified[e.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(t){return","===t.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(t))}_getPathReader(t){return this._afterPath=t,this._readPath}_readPath(t){switch(t.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const e=this._contextStack,i=e.length&&e[e.length-1];if(i&&"item"===i.type){const e=this._subject;this._restoreContext("item",t),this._emit(this._subject,this.RDF_FIRST,e,this._graph)}return this._afterPath(t)}}_readForwardPath(t){let e,i;const n=this._blankNode();if(void 0!==(i=this._readEntity(t)))return null===this._predicate?(e=this._subject,this._subject=n):(e=this._object,this._object=n),this._emit(e,i,n,this._graph),this._readPath}_readBackwardPath(t){const e=this._blankNode();let i,n;if(void 0!==(i=this._readEntity(t)))return null===this._predicate?(n=this._subject,this._subject=e):(n=this._object,this._object=e),this._emit(e,i,n,this._graph),this._readPath}_readRDFStarTailOrGraph(t){return">>"!==t.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(t))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,t):this._readRDFStarTail(t)}_readRDFStarTail(t){if(">>"!==t.type)return this._error(`Expected >> but got ${t.type}`,t);const e=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",t),null===this._subject?(this._subject=e,this._readPredicate):(this._object=e,this._getContextEndReader())}_getContextEndReader(){const t=this._contextStack;if(!t.length)return this._readPunctuation;switch(t[t.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(t,e,i,n){this._callback(null,this._quad(t,e,i,n||this.DEFAULTGRAPH))}_error(t,e){const i=new Error(`${t} on line ${e.line}.`);i.context={token:e,line:e.line,previousToken:this._lexer.previousToken},this._callback(i),this._callback=wu}_resolveIRI(t){return/^[a-z][a-z0-9+.-]*:/i.test(t)?t:this._resolveRelativeIRI(t)}_resolveRelativeIRI(t){if(!t.length)return this._base;switch(t[0]){case"#":return this._base+t;case"?":return this._base.replace(/(?:\?.*)?$/,t);case"/":return("/"===t[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(t);default:return/^[^/:]*:/.test(t)?null:this._removeDotSegments(this._basePath+t)}}_removeDotSegments(t){if(!/(^|\/)\.\.?($|[/#?])/.test(t))return t;const e=t.length;let i="",n=-1,r=-1,o=0,s="/";for(;n<e;){switch(s){case":":if(r<0&&"/"===t[++n]&&"/"===t[++n])for(;(r=n+1)<e&&"/"!==t[r];)n=r;break;case"?":case"#":n=e;break;case"/":if("."===t[n+1])switch(s=t[1+ ++n],s){case"/":i+=t.substring(o,n-1),o=n+1;break;case void 0:case"?":case"#":return i+t.substring(o,n)+t.substr(n+1);case".":if(s=t[1+ ++n],void 0===s||"/"===s||"?"===s||"#"===s){if(i+=t.substring(o,n-2),(o=i.lastIndexOf("/"))>=r&&(i=i.substr(0,o)),"/"!==s)return`${i}/${t.substr(n+1)}`;o=n+1}}}s=t[++n]}return i+t.substring(o)}parse(t,e,i){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${gu++}_`,this._prefixCallback=i||wu,this._inversePredicate=!1,this._quantified=Object.create(null),!e){const e=[];let i;if(this._callback=(t,n)=>{t?i=t:n&&e.push(n)},this._lexer.tokenize(t).every((t=>this._readCallback=this._readCallback(t))),i)throw i;return e}this._callback=e,this._lexer.tokenize(t,((t,e)=>{null!==t?(this._callback(t),this._callback=wu):this._readCallback&&(this._readCallback=this._readCallback(e))}))}};function wu(){}function bu(t,e){const i=e.namedNode;t._namedNode=i,t._blankNode=e.blankNode,t._literal=e.literal,t._variable=e.variable,t._quad=e.quad,t.DEFAULTGRAPH=e.defaultGraph(),t.RDF_FIRST=i(Xl.rdf.first),t.RDF_REST=i(Xl.rdf.rest),t.RDF_NIL=i(Xl.rdf.nil),t.N3_FORALL=i(Xl.r.forAll),t.N3_FORSOME=i(Xl.r.forSome),t.ABBREVIATIONS={a:i(Xl.rdf.type),"=":i(Xl.owl.sameAs),">":i(Xl.log.implies)},t.QUANTIFIERS_GRAPH=i("urn:n3:quantifiers")}bu(mu.prototype,cu);var yu=cu.defaultGraph(),{rdf:xu,xsd:ku}=Xl,Eu=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,Su=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,Fu={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"},Au=class extends lu{equals(){return!1}};function _u(t){let e=Fu[t];return void 0===e&&(1===t.length?(e=t.charCodeAt(0).toString(16),e="\\u0000".substr(0,6-e.length)+e):(e=(1024*(t.charCodeAt(0)-55296)+t.charCodeAt(1)+9216).toString(16),e="\\U00000000".substr(0,10-e.length)+e)),e}function ju(t){return t.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}function Cu(t,e,i,n,r,o,s){try{var a=t[o](s),c=a.value}catch(t){return void i(t)}a.done?e(c):Promise.resolve(c).then(n,r)}var Ru=fe(Zs()),Iu="chrome:theSession";new Ya(Iu);var Tu=function(){pa(n,ba);var t,e,i=(t=n,e=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(t){return!1}}(),function(){var i,n=ga(t);if(e){var r=ga(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return va(this,i)});function n(){var t;return ha(this,n),ma(da(t=i.call(this,"")),"value",""),ma(da(t),"termType",Sa),ma(da(t),"uri",Iu),t}return ua(n,[{key:"toCanonical",value:function(){return this.value}},{key:"toString",value:function(){return"DefaultGraph"}}]),n}();function Ou(t){return!!t&&t.termType===Sa}var Pu=new Tu,Nu=function(){function t(e,i,n,r){ha(this,t),ma(this,"subject",void 0),ma(this,"predicate",void 0),ma(this,"object",void 0),ma(this,"graph",void 0),this.subject=ba.fromValue(e),this.predicate=ba.fromValue(i),this.object=ba.fromValue(n),this.graph=null==r?Pu:ba.fromValue(r)}return ua(t,[{key:"why",get:function(){return this.graph},set:function(t){this.graph=t}},{key:"equals",value:function(t){return t.subject.equals(this.subject)&&t.predicate.equals(this.predicate)&&t.object.equals(this.object)&&t.graph.equals(this.graph)}},{key:"substitute",value:function(e){var i=new t(this.subject.substitute(e),this.predicate.substitute(e),this.object.substitute(e),Ou(this.graph)?this.graph:this.graph.substitute(e));return console.log("@@@ statement substitute:"+i),i}},{key:"toCanonical",value:function(){var t=[this.subject.toCanonical(),this.predicate.toCanonical(),this.object.toCanonical()];return this.graph&&this.graph.termType!==Sa&&t.push(this.graph.toCanonical()),t.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(),Ou(this.graph)?"":this.graph.toNT()].join(" ")+" ."}},{key:"toString",value:function(){return this.toNT()}}]),t}(),Du={};he(Du,{docpart:()=>Uu,document:()=>Lu,hostpart:()=>Bu,join:()=>Ju,protocol:()=>$u,refTo:()=>zu});var Mu=Mu||console.log;function Uu(t){var e;return(e=t.indexOf("#"))<0?t:t.slice(0,e)}function Lu(t){return new Ya(Uu(t))}function Bu(t){var e=/[^\/]*\/\/([^\/]*)\//.exec(t);return e?e[1]:""}function Ju(t,e){var i,n,r,o,s,a=e.indexOf("#");if(a>0&&(e=e.slice(0,a)),0===t.length)return e;if(0===t.indexOf("#"))return e+t;if(t.indexOf(":")>=0)return t;if(i=e.indexOf(":"),0===e.length)return t;if(i<0)return Mu("Invalid base: "+e+" in join with given: "+t),t;if(n=e.slice(0,+i+1||9e9),0===t.indexOf("//"))return n+t;if(e.indexOf("//",i)===i+1){if((r=e.indexOf("/",i+3))<0)return e.length-i-3>0?e+"/"+t:n+t}else if((r=e.indexOf("/",i+1))<0)return e.length-i-1>0?e+"/"+t:n+t;if(0===t.indexOf("/"))return e.slice(0,r)+t;if((o=(s=e.slice(r)).lastIndexOf("/"))<0)return n+t;for(o>=0&&o<s.length-1&&(s=s.slice(0,+o+1||9e9)),s+=t;s.match(/[^\/]*\/\.\.\//);)s=s.replace(/[^\/]*\/\.\.\//,"");return s=(s=s.replace(/\.\//g,"")).replace(/\/\.$/,"/"),e.slice(0,r)+s}function $u(t){var e=t.indexOf(":");return e<0?null:t.slice(0,e)}function zu(t,e){var i,n,r,o,s,a,c,l,u,h,d,f,p=new RegExp("^[-_a-zA-Z0-9.]+:(//[^/]*)?/[^/]*$");if(!t)return e;if(t===e)return"";for(i=c=0,o=e.length;c<o&&e[i]===t[i];i=++c);if(t.slice(0,i).match(p)&&((n=e.indexOf("//"))<0&&(n=-2),r=e.indexOf("/",n+2),"/"!==e[r+1]&&"/"!==t[r+1]&&e.slice(0,r)===t.slice(0,r)))return e.slice(r);if("#"===e[i]&&t.length===i)return e.slice(i);for(;i>0&&"/"!==e[i-1];)i--;if(i<3)return e;if(t.indexOf("//",i-2)>0||e.indexOf("//",i-2)>0)return e;if(t.indexOf(":",i)>0)return e;for(a=0,l=0,s=(h=t.slice(i)).length;l<s;l++)"/"===h[l]&&a++;if(0===a&&i<e.length&&"#"===e[i])return"./"+e.slice(i);if(0===a&&i===e.length)return"./";if(f="",a>0)for(u=1,d=a;d>=1?u<=d:u>=d;d>=1?++u:--u)f+="../";return f+e.slice(i)}var Hu,Ku,Wu,qu=function(){pa(n,ba);var t,e,i=(t=n,e=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(t){return!1}}(),function(){var i,n=ga(t);if(e){var r=ga(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return va(this,i)});function n(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return ha(this,n),ma(da(t=i.call(this,e)),"termType",Ea),ma(da(t),"base","varid:"),ma(da(t),"classOrder",wa.Variable),ma(da(t),"isVar",1),ma(da(t),"uri",void 0),t.base="varid:",t.uri=Ju(e,t.base),t}return ua(n,[{key:"equals",value:function(t){return!!t&&this.termType===t.termType&&this.value===t.value}},{key:"hashString",value:function(){return this.toString()}},{key:"substitute",value:function(t){var e;return null!=(e=t[this.toNT()])?e:this}},{key:"toString",value:function(){return n.toString(this)}}],[{key:"toString",value:function(t){return t.uri.slice(0,t.base.length)===t.base?"?".concat(t.uri.slice(t.base.length)):"?".concat(t.uri)}}]),n}();(Ku=Hu||(Hu={})).collections="COLLECTIONS",Ku.defaultGraphType="DEFAULT_GRAPH_TYPE",Ku.equalsMethod="EQUALS_METHOD",Ku.id="ID",Ku.identity="IDENTITY",Ku.reversibleId="REVERSIBLE_ID",Ku.variableType="VARIABLE_TYPE";var Vu=new Tu,Gu={supports:(Wu={},ma(Wu,Hu.collections,!1),ma(Wu,Hu.defaultGraphType,!1),ma(Wu,Hu.equalsMethod,!0),ma(Wu,Hu.identity,!1),ma(Wu,Hu.id,!0),ma(Wu,Hu.reversibleId,!1),ma(Wu,Hu.variableType,!0),Wu),blankNode:function(t){return new Ua(t)},defaultGraph:function(){return Vu},equals:function(t,e){return t===e||!t||!e||(Va(t)||Va(e)?!(!Va(t)||!Va(e))&&this.equals(t.subject,e.subject)&&this.equals(t.predicate,e.predicate)&&this.equals(t.object,e.object)&&this.equals(t.graph,e.graph):!(!Wa(t)||!Wa(e))&&this.id(t)===this.id(e))},id:function(t){if(!t)return"undefined";if(Va(t))return this.quadToNQ(t);switch(t.termType){case Sa:return"defaultGraph";case Ea:return qu.toString(t);default:var e=this.termToNQ(t);if(e)return e;throw new Error("Can't id term with type '".concat(t.termType,"'"))}},isQuad:function(t){return t instanceof Nu},literal:function(t,e){if("string"!=typeof t&&!e)return Qa.fromValue(t);var i="string"==typeof t?t:""+t;return"string"==typeof e?-1===e.indexOf(":")?new Qa(i,e):new Qa(i,null,this.namedNode(e)):new Qa(i,null,e)},namedNode:function(t){return new Ya(t)},quad:function(t,e,i,n){return new Nu(t,e,i,n||Vu)},triple:function(t,e,i,n){return this.quad(t,e,i,n)},quadToNQ:function(t){return"".concat(this.termToNQ(t.subject)," ").concat(this.termToNQ(t.predicate)," ").concat(this.termToNQ(t.object)," ").concat(this.termToNQ(t.graph)," .")},termToNQ:function(t){var e=this;switch(t.termType){case xa:return"_:"+t.value;case Sa:return"";case Aa:return"<http://www.w3.org/1999/02/22-rdf-syntax-ns#nil>";case ka:return Qa.toNT(t);case _a:case ya:return"<"+t.value+">";case Fa:return"("+t.elements.map((function(t){return e.termToNQ(t)})).join(" ")+")";default:throw new Error("Can't serialize nonstandard term type (was '".concat(t.termType,"')"))}},toNQ:function(t){return this.isQuad(t)?this.quadToNQ(t):this.termToNQ(t)},variable:function(t){return new qu(t)}},Xu=Gu,Yu=function(){},Zu=function(){},Qu=function(){},th=function(){};function eh(t,e){var i=e||{namedNode:function(t){return new Ya(t)}};return function(e){return i.namedNode(t+(e||""))}}var ih=fe(ra());function nh(t,e){t.callbacks={};for(var i=e.length-1;i>=0;i--)t.callbacks[e[i]]=[];t.addHook=function(e){t.callbacks[e]||(t.callbacks[e]=[])},t.addCallback=function(e,i){t.callbacks[e].push(i)},t.removeCallback=function(e,i){for(var n=0;n<t.callbacks[e].length;n++)if(t.callbacks[e][n].name===i)return t.callbacks[e].splice(n,1),!0;return!1},t.insertCallback=function(e,i){t.callbacks[e].unshift(i)},t.fireCallbacks=function(e,i){var n,r,o=[],s=[],a=t.callbacks[e].length;for(n=a-1;n>=0;n--)(r=t.callbacks[e][n])&&r.apply(t,i)&&o.push(r);for(n=o.length-1;n>=0;n--)s.push(o[n]);for(n=a;n<t.callbacks[e].length;n++)s.push(t.callbacks[e][n]);t.callbacks[e]=s}}function rh(t,e){var i=[];(e=e||{})&&e.selfClosing&&e.selfClosing.split(" ").forEach((function(t){i[t]=!0}));var n=[];return e&&e.skipAttributes&&e.skipAttributes.split(" ").forEach((function(t){n[t]=!0})),oh(t,e,i,n)}function oh(t,e,i,n){var r,o="",s=[!1];if(void 0===t.nodeType)return o;if(1===t.nodeType){if(t.hasAttribute("class")&&e&&e.classWithChildText&&t.matches(e.classWithChildText.class))o+=t.querySelector(e.classWithChildText.element).textContent;else if(!(e&&e.skipNodeWithClass&&t.matches("."+e.skipNodeWithClass))){var a=t.nodeName.toLowerCase();o+="<"+a;var c=[];for(r=t.attributes.length-1;r>=0;r--){var l=t.attributes[r];if(!(n&&n.length>0&&n[l.name]||/^\d+$/.test(l.name))){if("class"===l.name&&e&&e.replaceClassItemWith&&l.value.split(" ").indexOf(e.replaceClassItemWith.source)>-1){var u=new RegExp(e.replaceClassItemWith.source,"g");l.value=l.value.replace(u,e.replaceClassItemWith.target).trim()}"class"===l.name&&e&&e.skipClassWithValue&&e.skipClassWithValue===l.value||c.push(l.name+"='"+l.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,""")+"'")}}if(c.length>0&&(e&&e.sortAttributes&&c.sort((function(t,e){return t.toLowerCase().localeCompare(e.toLowerCase())})),o+=" "+c.join(" ")),i&&i.ename)o+=" />";else{for(o+=">",o+="html"===a?"\n ":"",s.push("style"===a||"script"===a),r=0;r<t.childNodes.length;r++)o+=oh(t.childNodes[r]);s.pop(),o+="body"===a?"</"+a+">\n":"</"+a+">"}}}else if(8===t.nodeType)o+="\x3c!--"+t.nodeValue+"--\x3e";else if(3===t.nodeType||4===t.nodeType){var h=t.nodeValue.replace(/\n+$/,"");o+=s[s.length-1]?h:h.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}else console.log("Warning; Cannot handle serialising nodes of type: "+t.nodeType),console.log(t);return o}function sh(t,e,i,n){var r=function(t){return"BlankNode"===t.termType?null:t},o=function(t){var e=i.statementsMatching(t).map((function(t){return r(t.subject)+" "+r(t.predicate)+" "+r(t.object)})).concat(i.statementsMatching(void 0,void 0,t).map((function(t){return r(t.subject)+" "+r(t.predicate)+" "+r(t.object)})));return e.sort(),e.join("\n")},s=Object.prototype.hasOwnProperty.call(i,"compareTerms")?i.compareTerms(t,e):t.compareTerm(e);return"BlankNode"===t.termType&&"BlankNode"===e.termType?0===s?0:o(t)>o(e)?1:o(t)<o(e)?-1:s:n&&t.uri&&e.uri?(n[t.uri]||t.uri).localeCompare(n[e.uri]||e.uri):s}function ah(t,e){return e=e||{},"undefined"!=typeof module&&module&&module.exports?(new ih.DOMParser).parseFromString(t,e.contentType||"application/xhtml+xml"):("undefined"!=typeof window&&window.DOMParser?new window.DOMParser:new ih.DOMParser).parseFromString(t,"application/xml")}function ch(t,e){for(var i=0;i<t.length;i++)if(t[i].subject.equals(e.subject)&&t[i].predicate.equals(e.predicate)&&t[i].object.equals(e.object)&&t[i].why.equals(e.why))return void t.splice(i,1);throw new Error("RDFArrayRemove: Array did not contain "+e+" "+e.why)}function lh(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Xu;return{boolean:t.namedNode("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:t.namedNode("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:t.namedNode("http://www.w3.org/2001/XMLSchema#decimal"),double:t.namedNode("http://www.w3.org/2001/XMLSchema#double"),integer:t.namedNode("http://www.w3.org/2001/XMLSchema#integer"),langString:t.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:t.namedNode("http://www.w3.org/2001/XMLSchema#string")}}lh(Xu);var uh=fe(oa()),hh=function(){function t(e){ha(this,t),ma(this,"_notQNameChars","\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~"),ma(this,"_notNameChars",this._notQNameChars+":"),ma(this,"validPrefix",new RegExp(/^[a-zA-Z][a-zA-Z0-9]*$/)),ma(this,"forbidden1",new RegExp(/[\\"\b\f\r\v\t\n\u0080-\uffff]/gm)),ma(this,"forbidden3",new RegExp(/[\\"\b\f\r\v\u0080-\uffff]/gm)),this.flags="",this.base=null,this.prefixes=[],this.namespaces=[];var i=Object.keys((0,uh.default)());for(var n in i){var r=(0,uh.default)()[i[n]](""),o=i[n];this.prefixes[r]=o,this.namespaces[o]=r}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=e,this.rdfFactory=e.rdfFactory||Xu,this.xsd=lh(this.rdfFactory)}return ua(t,[{key:"setBase",value:function(t){return this.base=t,this}},{key:"setFlags",value:function(t){return this.flags=t||"",this}},{key:"toStr",value:function(t){var e=t.toNT();return"Graph"===t.termType&&(this.formulas[e]=t),e}},{key:"fromStr",value:function(t){if("{"===t[0]){var e=this.formulas[t];return e||console.log("No formula object for "+t),e}return this.store.fromNT(t)}},{key:"setNamespaces",value:function(t){for(var e in t)this.setPrefix(e,t[e]);return this}},{key:"setPrefix",value:function(t,e){if("default"!==t.slice(0,7)&&"ns"!==t.slice(0,2)&&t&&e){for(var i in this.prefixes)this.prefixes[i]==t&&delete this.prefixes[i];this.prefixes[e]=t,this.namespaces[t]=e}}},{key:"suggestPrefix",value:function(t,e){"default"!==t.slice(0,7)&&"ns"!==t.slice(0,2)&&t&&e&&(t in this.namespaces||e in this.prefixes||(this.prefixes[e]=t,this.namespaces[t]=e))}},{key:"suggestNamespaces",value:function(t){for(var e in t)this.suggestPrefix(e,t[e]);return this}},{key:"checkIntegrity",value:function(){var t,e;for(t in this.namespaces)if(this.prefixes[this.namespaces[t]]!==t)throw new Error("Serializer integity error 1: "+t+", "+this.namespaces[t]+", "+this.prefixes[this.namespaces[t]]+"!");for(e in this.prefixes)if(this.namespaces[this.prefixes[e]]!==e)throw new Error("Serializer integity error 2: "+e+", "+this.prefixs[e]+", "+this.namespaces[this.prefixes[e]]+"!")}},{key:"makeUpPrefix",value:function(t){var e=t,i=function(e){return!!this.validPrefix.test(e)&&"ns"!==e&&!(e in this.namespaces)&&(this.prefixes[t]=e,this.namespaces[e]=t,e)}.bind(this);"#/".indexOf(e[e.length-1])>=0&&(e=e.slice(0,-1));var n=e.lastIndexOf("/");n>=0&&(e=e.slice(n+1));for(var r=0;r<e.length&&this.prefixchars.indexOf(e[r]);)r++;if((e=e.slice(0,r)).length<6&&i(e))return e;if(i(e.slice(0,3)))return e.slice(0,3);if(i(e.slice(0,2)))return e.slice(0,2);if(i(e.slice(0,4)))return e.slice(0,4);if(i(e.slice(0,1)))return e.slice(0,1);if(i(e.slice(0,5)))return e.slice(0,5);this.validPrefix.test(e)||(e="n");for(var o=0;;o++)if(i(e.slice(0,3)+o))return e.slice(0,3)+o}},{key:"rootSubjects",value:function(t){for(var e={},i={},n={},r=0;r<t.length;r++){var o=t[r],s=function(t){e.hasOwnProperty(t)||(e[t]=[]),e[t].push(o.subject)};[o.subject,o.predicate,o.object].map((function(t){"BlankNode"===t.termType?n[t.toNT()]=!0:"Collection"===t.termType&&t.elements.forEach((function(t){s(t)}))})),s(t[r].object);var a=i[this.toStr(o.subject)];a||(a=[]),a.push(o),i[this.toStr(o.subject)]=a}var c=[];for(var l in i)if(i.hasOwnProperty(l)){var u=this.fromStr(l);"BlankNode"===u.termType&&e[u]&&1===e[u].length||c.push(u)}this.incoming=e;for(var h={},d=0;d<c.length;d++)h[c[d].toNT()]=!0;return{roots:c,subjects:i,rootsHash:h,incoming:e}}},{key:"toN3",value:function(t){return this.statementsToN3(t.statements)}},{key:"explicitURI",value:function(t){return"<"+(t=this.flags.indexOf("r")<0&&this.base?zu(this.base,t):this.flags.indexOf("u")>=0?function(t){for(var e,i="",n=0;n<t.length;n++)i+=(e=t.charCodeAt(n))>65535?"\\U"+("00000000"+e.toString(16)).slice(-8):e>126?"\\u"+("0000"+e.toString(16)).slice(-4):t[n];return i}(t):encodeURI(t))+">"}},{key:"statementsToNTriples",value:function(t){var e=t.slice();e.sort();for(var i="",n="http://www.w3.org/1999/02/22-rdf-syntax-ns#",r=this,o=this.store,s=this.rdfFactory,a=function t(e){if("Collection"!==e.termType)return r.atomicTermToN3(e);for(var a=e.elements,c=o.sym(n+"nill"),l=a.length-1;l>=0;l--){var u=s.blankNode();i+=t(u)+" "+t(o.sym(n+"first"))+" "+t(a[l])+".\n",i+=t(u)+" "+t(o.sym(n+"rest"))+" "+t(c)+".\n",c=u}return r.atomicTermToN3(c)},c=0;c<e.length;c++){var l=e[c],u="";u+=a(l.subject)+" ",u+=a(l.predicate)+" ",u+=a(l.object)+" ",this.flags.indexOf("q")>=0&&(u+=a(l.why)+" "),i+=u+=".\n"}return i}},{key:"statementsToN3",value:function(e){var i=this.store,n={"http://www.w3.org/1999/02/22-rdf-syntax-ns#type":"aaa:00"};e.sort((function(t,e){return function(t,e,i,n){return sh(t.subject,e.subject,i,n)||sh(t.predicate,e.predicate,i,n)||sh(t.object,e.object,i,n)}(t,e,i,n)})),this.base&&!this.defaultNamespace&&(this.defaultNamespace=this.base+"#");var r={};this.flags.indexOf("s")<0&&(r["http://www.w3.org/2002/07/owl#sameAs"]="="),this.flags.indexOf("t")<0&&(r["http://www.w3.org/1999/02/22-rdf-syntax-ns#type"]="a"),this.flags.indexOf("i")<0&&(r["http://www.w3.org/2000/10/swap/log#implies"]="=>");var o=function(t){for(var e="",i=0;i<t;i++)e+=" ";return e},s=function t(e){for(var i="",n=0;n<e.length;n++){var r=e[n],o="string"==typeof r?r:t(r);if(0!==n){var s=i.slice(-1)||" ";","===o||";"===o||("."!==o||"0123456789.:".includes(s))&&(i+=" ")}i+=o}return i},a=function(t){for(var e=this.rootSubjects(t),i=e.roots,n=[],r=0;r<i.length;r++)n.push(c(i[r],e));return n}.bind(this);function c(t,e){return"BlankNode"!==t.termType||e.incoming[t]?[h(t,e)].concat([l(t,e)]).concat(["."]):u(t,e,!0).concat(["."])}var l=function(t,e){var i=[],n=null,o=e.subjects[this.toStr(t)]||[];if(void 0===o)throw new Error("Cant find statements for "+t);for(var s=[],a=0;a<o.length;a++){var c=o[a];c.predicate.uri===n?s.push(","):(n&&(i=i.concat([s]).concat([";"]),s=[]),i.push(r[c.predicate.uri]?r[c.predicate.uri]:h(c.predicate,e))),n=c.predicate.uri,s.push(u(c.object,e))}return i.concat([s])}.bind(this),u=function(t,e,i){return"BlankNode"!==t.termType||!i&&void 0!==e.rootsHash[t.toNT()]?h(t,e):e.subjects[this.toStr(t)]?["[",l(t,e),"]"]:"[]"}.bind(this);t.prototype.termToN3=h;var h=function(t,e){var i,n;switch(t.termType){case"Graph":return(n=(n=["{"]).concat(a(t.statements))).concat(["}"]);case"Collection":for(n=["("],i=0;i<t.elements.length;i++)n.push([u(t.elements[i],e)]);return n.push(")"),n;default:return this.atomicTermToN3(t)}}.bind(this),d=function(){var t="";for(var e in this.defaultNamespace&&(t+="@prefix : "+this.explicitURI(this.defaultNamespace)+".\n"),this.prefixes)this.prefixes.hasOwnProperty(e)&&this.namespacesUsed[e]&&(t+="@prefix "+this.prefixes[e]+": "+this.explicitURI(e)+".\n");return t+"\n"}.bind(this),f=a(e);return d()+function t(e,i){var n="",r=1e5;void 0===i&&(i=-1);for(var a=0;a<e.length;a++){var c=e[a];if("string"!=typeof c){var l=t(c,i+1);if(l.length<10*(80-4*i)&&l.indexOf('"""')<0){var u=s(c);u.length<80-4*i&&(c=u,l="")}l&&(r=1e4),n+=l}if("string"==typeof c){if(1===c.length&&"\n"===n.slice(-1)&&",.;".indexOf(c)>=0){n=n.slice(0,-1),"."==c&&"0123456789.:".includes(n.charAt(n.length-1))&&(n+=" ",r+=1),n+=c+"\n",r+=1;continue}if(r<4*i+4||r+c.length+1<80&&";.".indexOf(n[n.length-2])<0)n=n.slice(0,-1)+" "+c+"\n",r+=c.length+1;else{var h=o(4*i)+c;n+=h+"\n",r=h.length,i<0&&(n+="\n",r=1e5)}}}return n}(f)}},{key:"atomicTermToN3",value:function(t,e){switch(t.termType){case"BlankNode":case"Variable":return t.toNT();case"Literal":var i=t.value;if("string"!=typeof i)throw new TypeError("Value of RDF literal node must be a string");if(t.datatype&&this.flags.indexOf("x")<0)switch(t.datatype.uri){case"http://www.w3.org/2001/XMLSchema#integer":return i;case"http://www.w3.org/2001/XMLSchema#decimal":return i.indexOf(".")<0&&(i+=".0"),i;case"http://www.w3.org/2001/XMLSchema#double":var n=i.toLowerCase().indexOf("e")>0;return i.indexOf(".")<0&&!n&&(i+=".0"),n||(i+="e0"),i;case"http://www.w3.org/2001/XMLSchema#boolean":return"1"===t.value?"true":"false"}var r=this.stringToN3(t.value);return t.language?r+="@"+t.language:t.datatype.equals(this.xsd.string)||(r+="^^"+this.atomicTermToN3(t.datatype,e)),r;case"NamedNode":return this.symbolToN3(t);case"DefaultGraph":return"";default:throw new Error("Internal: atomicTermToN3 cannot handle "+t+" of termType: "+t.termType)}}},{key:"stringToN3",value:function(t,e){e||(e="e");var i,n,r,o,s,a="";for(t.length>20&&'"'!==t.slice(-1)&&e.indexOf("n")<0&&(t.indexOf("\n")>0||t.indexOf('"')>0)?(o='"""',s=this.forbidden3):(o='"',s=this.forbidden1),i=0;i<t.length&&(s.lastIndex=0,null!=s.exec(t.slice(i)));){a+=t.slice(i,n=i+s.lastIndex-1);var c=t[n];'"'===c&&'"""'===o&&'"""'!==t.slice(n,n+3)?a+=c:(r='\b\f\r\t\v\n\\"'.indexOf(c))>=0?a+="\\"+'bfrtvn\\"'[r]:e.indexOf("e")>=0?a+="\\u"+("000"+c.charCodeAt(0).toString(16).toLowerCase()).slice(-4):a+=c,i=n+1}return o+a+t.slice(i)+o}},{key:"symbolToN3",value:function(t){var e=t.uri,i=e.indexOf("#");if(i<0&&this.flags.indexOf("/")<0&&(i=e.lastIndexOf("/")),i>=0&&this.flags.indexOf("p")<0&&(0===e.indexOf("http")||0===e.indexOf("ws")||0===e.indexOf("file"))){for(var n=!0,r=i+1;r<e.length;r++)if(this._notNameChars.indexOf(e[r])>=0){n=!1;break}if(n){var o=e.slice(i+1),s=e.slice(0,i+1);if(this.defaultNamespace&&this.defaultNamespace===s&&this.flags.indexOf("d")<0)return this.flags.indexOf("k")>=0&&this.keyords.indexOf(o)<0?o:":"+o;var a=this.prefixes[s];if(a||(a=this.makeUpPrefix(s)),a)return this.namespacesUsed[s]=!0,a+":"+o}}return this.explicitURI(e)}},{key:"writeStore",value:function(t){var e=this.store,i=e.fetcher,n=i&&i.appNode,r=this.store.index[3];for(var o in r){var s=e.fromNT(o);n&&s.equals(n)||t("\n"+this.atomicTermToN3(s)+" "+this.atomicTermToN3(e.sym("http://www.w3.org/2000/10/swap/log#semantics"))+" { "+this.statementsToN3(e.statementsMatching(void 0,void 0,void 0,s))+" }.\n")}e.statementsMatching(void 0,e.sym("http://www.w3.org/2007/ont/link#requestedURI")).map((function(i){t("\n<"+i.object.value+"> log:metadata {\n");var n=e.statementsMatching(void 0,void 0,void 0,i.subject);t(this.statementsToN3(this.statementsToN3(n))),t("}.\n")}));var a=[];n&&a.push(n);var c=[];a.map((function(t){c=c.concat(e.statementsMatching(void 0,void 0,void 0,t))})),t(this.statementsToN3(c))}},{key:"statementsToXML",value:function(t){var e=[];e["http://www.w3.org/1999/02/22-rdf-syntax-ns#"]=!0;var i="http://www.w3.org/1999/02/22-rdf-syntax-ns#_",n=function(t){for(var e="",i=0;i<t;i++)e+=" ";return e},r=function t(e){for(var i="",n=0;n<e.length;n++){var r=e[n];i+="string"==typeof r?r:t(r)}return i},o=function(t){this.suggestPrefix("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#");for(var e=this.rootSubjects(t),i=e.roots,n=[],r=0;r<i.length;r++)n.push(c(i[r],e));return n}.bind(this);function s(t){return void 0===t?"@@@undefined@@@@":t.replace(/[&<"]/g,(function(t){switch(t[0]){case"&":return"&";case"<":return"<";case'"':return"""}}))}var a=function(t){return s(this.base?Du.refTo(this.base,t.uri):t.uri)}.bind(this),c=function(t,e){var n,r,o,d,f=[],p=e.subjects[this.toStr(t)];if(void 0===p)return u(t,e);p.sort((function(t,e){var n=t.predicate.uri,r=e.predicate.uri;if(n.substring(0,i.length)===i||r.substring(0,i.length)===i)return n.localeCompare(r);var o=n.substring(i.length),s=r.substring(i.length),a=parseInt(o,10),c=parseInt(s,10);return isNaN(a)||isNaN(c)||a!==o||c!==s?n.localeCompare(r):a-c}));for(var v=0;v<p.length;v++)if("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"!==(o=p[v]).predicate.uri||n||"NamedNode"!==o.object.termType){if((d=o.predicate).uri.substr(0,i.length)===i){var g=d.uri.substr(i.length);g===parseInt(g,10).toString()&&(d=this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#li"))}switch(r=h(d),o.object.termType){case"BlankNode":f=f.concat(1===e.incoming[o.object].length?["<"+r+' rdf:parseType="Resource">',c(o.object,e),"</"+r+">"]:["<"+r+' rdf:nodeID="'+o.object.toNT().slice(2)+'"/>']);break;case"NamedNode":f=f.concat(["<"+r+' rdf:resource="'+a(o.object)+'"/>']);break;case"Literal":f=f.concat(["<"+r+(o.object.datatype.equals(this.xsd.string)?"":' rdf:datatype="'+s(o.object.datatype.uri)+'"')+(o.object.language?' xml:lang="'+o.object.language+'"':"")+">"+s(o.object.value)+"</"+r+">"]);break;case"Collection":f=f.concat(["<"+r+' rdf:parseType="Collection">',l(o.object,e),"</"+r+">"]);break;default:throw new Error("Can't serialize object of type "+o.object.termType+" into XML")}}else n=o.object;var m=n?h(n):"rdf:Description",w="";return"BlankNode"===t.termType?e.incoming[t]&&1===e.incoming[t].length||(w=' rdf:nodeID="'+t.toNT().slice(2)+'"'):w=' rdf:about="'+a(t)+'"',["<"+m+w+">"].concat([f]).concat(["</"+m+">"])}.bind(this);function l(t,e){for(var i=[],n=0;n<t.elements.length;n++)i.push(c(t.elements[n],e));return i}var u=function(t,e){var i=[],n=e.subjects[this.toStr(t)];if(!n)return i;n.sort();for(var r=0;r<n.length;r++){var o=n[r];switch(o.object.termType){case"BlankNode":i=e.rootsHash[o.object.toNT()]?i.concat(["<"+h(o.predicate)+' rdf:nodeID="'+o.object.toNT().slice(2)+'">',"</"+h(o.predicate)+">"]):i.concat(["<"+h(o.predicate)+' rdf:parseType="Resource">',u(o.object,e),"</"+h(o.predicate)+">"]);break;case"NamedNode":i=i.concat(["<"+h(o.predicate)+' rdf:resource="'+a(o.object)+'"/>']);break;case"Literal":i=i.concat(["<"+h(o.predicate)+(o.object.datatype.equals(this.xsd.string)?"":' rdf:datatype="'+s(o.object.datatype.value)+'"')+(o.object.language?' xml:lang="'+o.object.language+'"':"")+">"+s(o.object.value)+"</"+h(o.predicate)+">"]);break;case"Collection":i=i.concat(["<"+h(o.predicate)+' rdf:parseType="Collection">',l(o.object,e),"</"+h(o.predicate)+">"]);break;default:throw new Error("Can't serialize object of type "+o.object.termType+" into XML")}}return i}.bind(this),h=function(t){var i=t.uri,n=i.indexOf("#");if(n<0&&this.flags.indexOf("/")<0&&(n=i.lastIndexOf("/")),n<0)throw new Error("Cannot make qname out of <"+i+">");for(var r=n+1;r<i.length;r++)if(this._notNameChars.indexOf(i[r])>=0)throw new Error('Invalid character "'+i[r]+'" cannot be in XML qname for URI: '+i);var o=i.slice(n+1),s=i.slice(0,n+1);if(this.defaultNamespace&&this.defaultNamespace===s&&this.flags.indexOf("d")<0)return o;var a=this.prefixes[s];return a||(a=this.makeUpPrefix(s)),e[s]=!0,a+":"+o}.bind(this),d=o(t),f="<rdf:RDF";for(var p in this.defaultNamespace&&(f+=' xmlns="'+s(this.defaultNamespace)+'"'),e)if(e.hasOwnProperty(p)){var v=this.base&&this.flags.includes("z")?Du.refTo(this.base,p):p;f+="\n xmlns:"+this.prefixes[p]+'="'+s(v)+'"'}return function t(e,i){var o,s="",a=1e5;i||(i=0);for(var c=0;c<e.length;c++){var l=e[c];if("string"!=typeof l){var u=t(l,i+1);u.length<10*(80-4*i)&&u.indexOf('"""')<0&&(o=r(l)).length<80-4*i&&(l=" "+o,u=""),u&&(a=1e4),s+=u}"string"==typeof l&&(a<4*i+4?(s=s.slice(0,-1)+" "+l+"\n",a+=l.length+1):(s+=(o=n(4*i)+l)+"\n",a=o.length))}return s}([f+=">",d,"</rdf:RDF>"],-1)}}]),t}();function dh(t,e,i,n,r,o){i=i||(null==t?void 0:t.value);var s,a,c,l,u,h=o||{};n=n||Da;try{var d=function(t){return new hh(t)}(e);h.flags&&d.setFlags(h.flags);var f=e.statementsMatching(void 0,void 0,void 0,t);switch("namespaces"in e&&d.suggestNamespaces(e.namespaces),h.namespaces&&d.setNamespaces(h.namespaces),d.setBase(i),n){case Oa:return p(null,d.statementsToXML(f));case Ra:case"application/n3":return p(null,d.statementsToN3(f));case Da:case"application/x-turtle":return d.setFlags("si"),p(null,d.statementsToN3(f));case"application/n-triples":return d.setFlags("deinprstux"),p(null,d.statementsToNTriples(f));case Ca:d.setFlags("deinprstux"),s=d.statementsToNTriples(f),a=r,l=new mu,u=new class{constructor(t,e){if(this._prefixRegex=/$0^/,t&&"function"!=typeof t.write&&(e=t,t=null),this._lists=(e=e||{}).lists,t)this._outputStream=t,this._endStream=void 0===e.end||!!e.end;else{let t="";this._outputStream={write(e,i,n){t+=e,n&&n()},end:e=>{e&&e(null,t)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(e.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=yu,this._prefixIRIs=Object.create(null),e.prefixes&&this.addPrefixes(e.prefixes),e.baseIRI&&(this._baseMatcher=new RegExp(`^${ju(e.baseIRI)}${e.baseIRI.endsWith("/")?"":"[#?]"}`),this._baseLength=e.baseIRI.length))}get _inDefaultGraph(){return yu.equals(this._graph)}_write(t,e){this._outputStream.write(t,"utf8",e)}_writeQuad(t,e,i,n,r){try{n.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(yu.equals(n)?"":`${this._encodeIriOrBlank(n)} {\n`)),this._graph=n,this._subject=null),t.equals(this._subject)?e.equals(this._predicate)?this._write(`, ${this._encodeObject(i)}`,r):this._write(`;\n ${this._encodePredicate(this._predicate=e)} ${this._encodeObject(i)}`,r):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=t)} ${this._encodePredicate(this._predicate=e)} ${this._encodeObject(i)}`,r)}catch(t){r&&r(t)}}_writeQuadLine(t,e,i,n,r){delete this._prefixMatch,this._write(this.quadToString(t,e,i,n),r)}quadToString(t,e,i,n){return`${this._encodeSubject(t)} ${this._encodeIriOrBlank(e)} ${this._encodeObject(i)}${n&&n.value?` ${this._encodeIriOrBlank(n)} .\n`:" .\n"}`}quadsToString(t){return t.map((t=>this.quadToString(t.subject,t.predicate,t.object,t.graph))).join("")}_encodeSubject(t){return"Quad"===t.termType?this._encodeQuad(t):this._encodeIriOrBlank(t)}_encodeIriOrBlank(t){if("NamedNode"!==t.termType)return this._lists&&t.value in this._lists&&(t=this.list(this._lists[t.value])),"id"in t?t.id:`_:${t.value}`;let e=t.value;this._baseMatcher&&this._baseMatcher.test(e)&&(e=e.substr(this._baseLength)),Eu.test(e)&&(e=e.replace(Su,_u));const i=this._prefixRegex.exec(e);return i?i[1]?this._prefixIRIs[i[1]]+i[2]:e:`<${e}>`}_encodeLiteral(t){let e=t.value;if(Eu.test(e)&&(e=e.replace(Su,_u)),t.language)return`"${e}"@${t.language}`;if(this._lineMode){if(t.datatype.value===ku.string)return`"${e}"`}else switch(t.datatype.value){case ku.string:return`"${e}"`;case ku.boolean:if("true"===e||"false"===e)return e;break;case ku.integer:if(/^[+-]?\d+$/.test(e))return e;break;case ku.decimal:if(/^[+-]?\d*\.\d+$/.test(e))return e;break;case ku.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(e))return e}return`"${e}"^^${this._encodeIriOrBlank(t.datatype)}`}_encodePredicate(t){return t.value===xu.type?"a":this._encodeIriOrBlank(t)}_encodeObject(t){switch(t.termType){case"Quad":return this._encodeQuad(t);case"Literal":return this._encodeLiteral(t);default:return this._encodeIriOrBlank(t)}}_encodeQuad({subject:t,predicate:e,object:i,graph:n}){return`<<${this._encodeSubject(t)} ${this._encodePredicate(e)} ${this._encodeObject(i)}${r=n,r&&"DefaultGraph"===r.termType?"":` ${this._encodeIriOrBlank(n)}`}>>`;var r}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(t,e,i,n,r){void 0===i?this._writeQuad(t.subject,t.predicate,t.object,t.graph,e):"function"==typeof n?this._writeQuad(t,e,i,yu,n):this._writeQuad(t,e,i,n||yu,r)}addQuads(t){for(let e=0;e<t.length;e++)this.addQuad(t[e])}addPrefix(t,e,i){const n={};n[t]=e,this.addPrefixes(n,i)}addPrefixes(t,e){if(!this._prefixIRIs)return e&&e();let i=!1;for(let e in t){let n=t[e];"string"!=typeof n&&(n=n.value),i=!0,null!==this._subject&&(this._write(this._inDefaultGraph?".\n":"\n}\n"),this._subject=null,this._graph=""),this._prefixIRIs[n]=e+=":",this._write(`@prefix ${e} <${n}>.\n`)}if(i){let t="",e="";for(const i in this._prefixIRIs)t+=t?`|${i}`:i,e+=(e?"|":"")+this._prefixIRIs[i];t=ju(t),this._prefixRegex=new RegExp(`^(?:${e})[^/]*$|^(${t})([_a-zA-Z][\\-_a-zA-Z0-9]*)$`)}this._write(i?"\n":"",e)}blank(t,e){let i,n,r=t;switch(void 0===t?r=[]:t.termType?r=[{predicate:t,object:e}]:"length"in t||(r=[t]),n=r.length){case 0:return new Au("[]");case 1:if(i=r[0],!(i.object instanceof Au))return new Au(`[ ${this._encodePredicate(i.predicate)} ${this._encodeObject(i.object)} ]`);default:let e="[";for(let o=0;o<n;o++)i=r[o],i.predicate.equals(t)?e+=`, ${this._encodeObject(i.object)}`:(e+=`${(o?";\n ":"\n ")+this._encodePredicate(i.predicate)} ${this._encodeObject(i.object)}`,t=i.predicate);return new Au(`${e}\n]`)}}list(t){const e=t&&t.length||0,i=new Array(e);for(let n=0;n<e;n++)i[n]=this._encodeObject(t[n]);return new Au(`(${i.join(" ")})`)}end(t){null!==this._subject&&(this._write(this._inDefaultGraph?".\n":"\n}\n"),this._subject=null),this._write=this._blockedWrite;let e=t&&((i,n)=>{e=null,t(i,n)});if(this._endStream)try{return this._outputStream.end(e)}catch(t){}e&&e()}}({format:"N-Quads"}),Kl.waterfall([function(t){l.parse(s,(function(e,i){e?t(e):null!==i?u.addQuad(i):u.end(t)}))},function(t,e){try{Wl.default.fromRDF(t,{format:"application/nquads"}).then((function(t){e(null,t)}))}catch(t){e(t)}},function(t){c=JSON.stringify(t),a(null,c)}],(function(t){a(t,c)}));break;case Ta:case Ia:return d.setFlags("deinprstux q"),p(null,d.statementsToNTriples(f));default:throw new Error("Serialize: Content-type "+n+" not supported for data write.")}}catch(t){if(r)return r(t,void 0);throw t}function p(t,e){return r?void r(t,e):e}}var fh=["blankNode","defaultGraph","literal","namedNode","quad","variable","supports"],ph="http://www.w3.org/1999/02/22-rdf-syntax-ns#rest";function vh(t,e,i){var n=[];return i.reduce((function(e,i,r,o){var s;return n.push(t.quad(e,t.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#first"),o[r])),r<o.length-1?(s=t.blankNode(),n.push(t.quad(e,t.namedNode(ph),s))):n.push(t.quad(e,t.namedNode(ph),t.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"))),s}),e),n}function gh(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=t.length;for(i<0&&(i=n+i);i<n;i++)if(t[i]===e)return i;return-1}function mh(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return wh(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?wh(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}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,s=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw o}}}}function wh(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var bh=function(){pa(n,ba);var t,e,i=(t=n,e=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(t){return!1}}(),function(){var i,n=ga(t);if(e){var r=ga(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return va(this,i)});function n(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};ha(this,n),(t=i.call(this,"")).statements=e,t.constraints=r,t.initBindings=o,t.optional=s,ma(da(t),"termType",_a),ma(da(t),"classOrder",wa.Graph),ma(da(t),"fetcher",void 0),ma(da(t),"isVar",0),ma(da(t),"ns",eh),ma(da(t),"rdfFactory",void 0),t.rdfFactory=a&&a.rdfFactory||Xu;var c,l=mh(fh);try{var u=function(){var e=c.value;t[e]=function(){var i;return(i=t.rdfFactory)[e].apply(i,arguments)}};for(l.s();!(c=l.n()).done;)u()}catch(t){l.e(t)}finally{l.f()}return t}return ua(n,[{key:"add",value:function(t,e,i,n){var r=this;return 1===arguments.length&&t.forEach((function(t){return r.add(t.subject,t.predicate,t.object,t.graph)})),this.statements.push(this.rdfFactory.quad(t,e,i,n))}},{key:"addStatement",value:function(t){return this.add(t)}},{key:"bnode",value:function(t){return this.rdfFactory.blankNode(t)}},{key:"addAll",value:function(t){var e=this;t.forEach((function(t){e.add(t.subject,t.predicate,t.object,t.graph)}))}},{key:"any",value:function(t,e,i,n){var r=this.anyStatementMatching(t,e,i,n);return null==r?null:null==t?r.subject:null==e?r.predicate:null==i?r.object:null}},{key:"anyValue",value:function(t,e,i,n){var r=this.any(t,e,i,n);return r?r.value:void 0}},{key:"anyJS",value:function(t,e,i,n){var r=this.any(t,e,i,n);return r?ba.toJS(r):void 0}},{key:"anyStatementMatching",value:function(t,e,i,n){var r=this.statementsMatching(t,e,i,n,!0);if(r&&0!==r.length)return r[0]}},{key:"id",value:function(t){return this.rdfFactory.id(t)}},{key:"statementsMatching",value:function(t,e,i,n,r){var o=this.statements.filter((function(r){return(!t||t.equals(r.subject))&&(!e||e.equals(r.predicate))&&(!i||i.equals(r.object))&&(!n||n.equals(r.graph))}));return r?0===o.length?[]:[o[0]]:o}},{key:"bottomTypeURIs",value:function(t){var e,i,n,r,o,s;for(var a in e=[],t)if(t.hasOwnProperty(a)){for(s=t[a],i=!0,n=0,r=(o=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),this.rdfFactory.namedNode(a))).length;n<r;n++)if(o[n].uri in t){i=!1;break}i&&(e[a]=s)}return e}},{key:"collection",value:function(){return new ec}},{key:"each",value:function(t,e,i,n){var r=[],o=this.statementsMatching(t,e,i,n,!1);if(null==t)for(var s=0,a=o.length;s<a;s++)r.push(o[s].subject);else if(null==e)for(var c=0,l=o.length;c<l;c++)r.push(o[c].predicate);else if(null==i)for(var u=0,h=o.length;u<h;u++)r.push(o[u].object);else if(null==n)for(var d=0,f=o.length;d<f;d++)r.push(new Ya(o[d].graph.value));return r}},{key:"equals",value:function(t){return!!t&&this.hashString()===t.hashString()}},{key:"findMembersNT",value:function(t){var e,i,n,r,o,s,a,c,l,u,h,d,f;for(var p in(h={})[t.toNT()]=!0,r={},o=this.transitiveClosure(h,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0))if(o.hasOwnProperty(p)){for(var v=0,g=(s=this.statementsMatching(void 0,this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),this.fromNT(p))).length;v<g;v++)r[(d=s[v]).subject.toNT()]=d;for(var m=0,w=(a=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"),this.fromNT(p))).length;m<w;m++)for(n=0,e=(c=this.statementsMatching(void 0,a[m])).length;n<e;n++)r[(d=c[n]).subject.toNT()]=d;for(var b=0,y=(l=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"),this.fromNT(p))).length;b<y;b++)for(f=0,i=(u=this.statementsMatching(void 0,l[b])).length;f<i;f++)r[(d=u[f]).object.toNT()]=d}return r}},{key:"findMemberURIs",value:function(t){return this.NTtoURI(this.findMembersNT(t))}},{key:"findSubClassesNT",value:function(t){var e={};return e[t.toNT()]=!0,this.transitiveClosure(e,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0)}},{key:"findSuperClassesNT",value:function(t){var e={};return e[t.toNT()]=!0,this.transitiveClosure(e,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}},{key:"findTypesNT",value:function(t){var e,i,n,r,o,s;s=[];for(var a=0,c=(e=this.statementsMatching(t,void 0,void 0)).length;a<c;a++)if("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"===(o=e[a]).predicate.uri)s[o.object.toNT()]=o;else for(var l=0,u=(i=this.each(o.predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"))).length;l<u;l++)s[i[l].toNT()]=o;for(var h=0,d=(n=this.statementsMatching(void 0,void 0,t)).length;h<d;h++)for(var f=0,p=(r=this.each((o=n[h]).predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"))).length;f<p;f++)s[r[f].toNT()]=o;return this.transitiveClosure(s,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}},{key:"findTypeURIs",value:function(t){return this.NTtoURI(this.findTypesNT(t))}},{key:"connectedStatements",value:function(t,e,i){i=i||[];for(var n=[t],r={},o={},s=[],a=this,c=function(t){var c=function(t){"BlankNode"!==t.termType||r[t.value]||(r[t.value]=!0,n.push(t))},l=a.statementsMatching(null,null,t,e).concat(a.statementsMatching(t,null,null,e));(l=l.filter((function(t){if(i[t.predicate.value])return!1;var e=t.toNT();return!o[e]&&(o[e]=!0,!0)}))).forEach((function(t){c(t.subject),c(t.object)})),s=s.concat(l)};n.length;)c(n.shift());return s}},{key:"formula",value:function(){return new n}},{key:"fromNT",value:function(t){var e,i,n;switch(t[0]){case"<":return this.sym(t.slice(1,-1));case'"':if(n=void 0,e=void 0,(i=t.lastIndexOf('"'))<t.length-1)if("@"===t[i+1])n=t.slice(i+2);else{if("^^"!==t.slice(i+1,i+3))throw new Error("Can't convert string from NT: "+t);e=this.fromNT(t.slice(i+3))}return t=(t=(t=(t=t.slice(1,i)).replace(/\\"/g,'"')).replace(/\\n/g,"\n")).replace(/\\\\/g,"\\"),this.rdfFactory.literal(t,n||e);case"_":return this.rdfFactory.blankNode(t.slice(2));case"?":return new qu(t.slice(1))}throw new Error("Can't convert from NT: "+t)}},{key:"holds",value:function(t,e,i,n){var r;if(1===arguments.length){if(!t)return!0;if(t instanceof Array){for(r=0;r<t.length;r++)if(!this.holds(t[r]))return!1;return!0}if(Ba(t))return this.holds(t.subject,t.predicate,t.object,t.graph);if(t.statements)return this.holds(t.statements)}var o=this.anyStatementMatching(t,e,i,n);return null!=o}},{key:"holdsStatement",value:function(t){return this.holds(t.subject,t.predicate,t.object,t.graph)}},{key:"list",value:function(t,e){if(e.rdfFactory.supports.COLLECTIONS){var i=e.rdfFactory.collection();return t.forEach((function(t){i.append(t)})),i}var n=e.rdfFactory.blankNode(),r=vh(e.rdfFactory,n,t);return e.addAll(r),n}},{key:"NTtoURI",value:function(t){var e,i,n={};for(e in t)t.hasOwnProperty(e)&&(i=t[e],"<"===e[0]&&(n[e.slice(1,-1)]=i));return n}},{key:"serialize",value:function(t,e,i,n){return dh(i,this,t,e,void 0,n)}},{key:"substitute",value:function(t){var e=this.statements.map((function(e){return e.substitute(t)}));console.log("Formula subs statmnts:"+e);var i=new n;return i.addAll(e),console.log("indexed-form subs formula:"+i),i}},{key:"sym",value:function(t,e){if(e)throw new Error("This feature (kb.sym with 2 args) is removed. Do not assume prefix mappings.");return this.rdfFactory.namedNode(t)}},{key:"the",value:function(t,e,i,n){var r=this.any(t,e,i,n);return null==r&&th("No value found for the() {"+t+" "+e+" "+i+"}."),r}},{key:"transitiveClosure",value:function(t,e,i){var n,r,o,s,a,c={};Object.assign(c,t);for(var l={};;){if(null==(a=function(){for(var t in c)if(c.hasOwnProperty(t))return t}()))return l;for(n=0,r=(s=i?this.each(void 0,e,this.fromNT(a)):this.each(this.fromNT(a),e)).length;n<r;n++)(o=s[n].toNT())in l||o in c||(c[o]=c[a]);l[a]=c[a],delete c[a]}}},{key:"topTypeURIs",value:function(t){var e,i,n,r,o,s,a;for(i in s=[],t)if(t.hasOwnProperty(i)){for(a=t[i],r=0,e=0,n=(o=this.each(this.rdfFactory.namedNode(i),this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"))).length;e<n;e++)if("http://www.w3.org/2000/01/rdf-schema#Resource"!==o[e].uri){r++;break}r||(s[i]=a)}return s["http://www.w3.org/2000/01/rdf-schema#Resource"]&&delete s["http://www.w3.org/2000/01/rdf-schema#Resource"],s["http://www.w3.org/2002/07/owl#Thing"]&&delete s["http://www.w3.org/2002/07/owl#Thing"],s}},{key:"toString",value:function(){return"{"+this.statements.join("\n")+"}"}},{key:"variable",value:function(t){return new qu(t)}},{key:"whether",value:function(t,e,i,n){return this.statementsMatching(t,e,i,n,!1).length}}]),n}();ba.fromValue=tc;var yh=ba,xh={xsd:eh("http://www.w3.org/2001/XMLSchema#")};ba.toJS=function(t){return $a(t)?t.elements.map(ba.toJS):qa(t)?t.datatype.equals(xh.xsd("boolean"))?"1"===t.value||"true"===t.value:t.datatype.equals(xh.xsd("dateTime"))||t.datatype.equals(xh.xsd("date"))?new Date(t.value):t.datatype.equals(xh.xsd("integer"))||t.datatype.equals(xh.xsd("float"))||t.datatype.equals(xh.xsd("decimal"))?Number(t.value):t.value:t};var kh=ua((function t(e,i){ha(this,t),this.pat=new Th,this.vars=[],this.name=e,this.id=i}));function Eh(t,e,i,n){function r(t){var e,i="";for(e in t)t.hasOwnProperty(e)&&(i+=" "+e+" -> "+t[e]);return i}function o(t){var e,i="Bindings: ",n=t.length;for(e=0;e<n;e++)i+=r(t[e][0])+";\n\t";return i}function s(t,e,i,n){var r;if(t.length!==e.length)return[];if(!t.length)return[[[],null]];var o=function(t,e,i,n){var r=i[t];if(void 0===r){if(t.isVar){var o=[];return o[t]=e,[[o,null]]}r=t}if(!r.complexType)return n.redirections[r]&&(r=n.redirections[r]),n.redirections[e]&&(e=n.redirections[e]),r.equals(e)||r.uri&&r.uri===Iu?[[[],null]]:[];if(t instanceof Array)return e instanceof Array?s(t,e,i):[];throw new Error("query.js: oops - code not written yet")}(t[0],e[0],i,n);if(0===o.length)return o;var a,c,l,u,h,d,f,p=[],v=o.length;for(a=0;a<v;a++){for(h in f=[],c=o[a][0])c.hasOwnProperty(h)&&(f[h]=c[h]);for(h in i)i.hasOwnProperty(h)&&(f[h]=i[h]);for(u=(r=s(t.slice(1),e.slice(1),f,n)).length,l=0;l<u;l++){for(h in d=r[l][0],c)c.hasOwnProperty(h)&&(d[h]=c[h]);p.push([d,null])}}return p}function a(t,e){var i,n={};for(i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);for(i in e)e.hasOwnProperty(i)&&(n[i]=e[i]);return n}function c(t,e){return this.trunkBindings=e,this.originalCallback=t,this.branches=[],this}function l(t,e){return this.count=0,this.success=!1,this.done=!1,this.callback=t,this.onDone=e,this}c.prototype.checkAllDone=function(){var t;for(t=0;t<this.branches.length;t++)if(!this.branches[t].done)return;Yu("OPTIONAL BIDNINGS ALL DONE:"),this.doCallBacks(this.branches.length-1,this.trunkBindings)},c.prototype.doCallBacks=function(t,e){var i;if(t<0)return this.originalCallback(e);for(i=0;i<this.branches[t].results.length;i++)this.doCallBacks(t-1,a(e,this.branches[t].results[i]))},l.prototype.reportMatch=function(t){this.callback(t),this.success=!0},l.prototype.reportDone=function(){this.done=!0,Qu("Mandatory query branch finished.***"),void 0!==this.onDone&&this.onDone()};var u=function(t){return this.count=0,this.done=!1,this.results=[],this.junction=t,t.branches.push(this),this};function h(t,e,i){var n,r,o,s,a,c;for(e.nvars=0,e.index=null,n=[e.subject,e.predicate,e.object,e.why],s=[t.subjectIndex,t.predicateIndex,t.objectIndex,t.whyIndex],o=0;o<4;o++){var l=n[o];if(l.uri&&l.uri===Iu);else if(l.isVar&&void 0===i[l])e.nvars++;else{if(void 0,t.redirections[t.id(l=void 0===(c=i[a=n[o]])?a:c)]&&(l=t.redirections[t.id(l)]),!(r=s[o][t.id(l)]))return e.index=[],!1;(null===e.index||e.index.length>r.length)&&(e.index=r)}}return null===e.index&&(e.index=t.statements),!0}function d(t,e){return t.nvars!==e.nvars?t.nvars-e.nvars:t.index.length-e.index.length}u.prototype.reportMatch=function(t){this.results.push(t)},u.prototype.reportDone=function(){Yu("Optional branch finished - results.length = "+this.results.length),0===this.results.length&&(this.results.push({}),Yu("Optional branch FAILED - that's OK.")),this.done=!0,this.junction.checkAllDone()};var f=function t(i,n,o,s,a,l,h){Yu("Match begins, Branch count now: "+h.count+" for "+h.pattern_debug);var d,f,p=n.statements;if(0===p.length){if(Yu("FOUND MATCH WITH BINDINGS:"+r(o)),0===n.optional.length)h.reportMatch(o);else{Yu("OPTIONAL: "+n.optional);var g,m=new c(e,o),w=[];for(g=0;g<n.optional.length;g++)w[g]=new u(m),w[g].pattern_debug=n.optional[g];for(g=0;g<n.optional.length;g++)w[g].count=w[g].count+1,t(i,n.optional[g],o,"",a,e,w[g])}return h.count--,void Yu("Match ends -- success , Branch count now: "+h.count+" for "+h.pattern_debug)}var b=p.length;if(a){var y=function(e){var r=e.uri.split("#")[0];a.nowOrWhenFetched(r,void 0,(function(r,c){r||console.log("Error following link to <"+e.uri+"> in query: "+c),t(i,n,o,s,a,l,h)}))};for(f=0;f<b;f++){if(void 0!==o[(d=p[f]).subject]&&o[d.subject].uri&&a&&"unrequested"===a.getState(Uu(o[d.subject].uri)))return void y(o[d.subject]);if(void 0!==o[d.object]&&o[d.object].uri&&a&&"unrequested"===a.getState(Uu(o[d.object].uri)))return void y(o[d.object])}}v(i,n,o,s,a,l,h)},p=function(t,e){var i,n,r=!0;for(i in t)t.hasOwnProperty(i)&&e[i]&&(n=e[i].test)&&!n(t[i])&&(r=!1);return r},v=function(t,e,i,n,a,c,l){var u,v,g,m,w,b,y,x=e.statements,k=x.length;for(u=0;u<k;u++)h(t,y=x[u],i);x.sort(d),y=x[0];var E,S=t.formula();S.optional=e.optional,S.constraints=e.constraints,S.statements=x.slice(1),Yu(n+"match2 searching "+y.index.length+" for "+y+"; bindings so far="+r(i));var F,A,_=y.index.length,j=0;for(E=0;E<_;E++)for(F=s([y.subject,y.predicate,y.object,y.why],[(A=y.index[E]).subject,A.predicate,A.object,A.why],i,t),Qu(n+" From first: "+F.length+": "+o(F)),g=F.length,v=0;v<g;v++)if(w=[],p(b=F[v][0],e.constraints)){for(m in b)b.hasOwnProperty(m)&&(w[m]=b[m]);for(m in i)i.hasOwnProperty(m)&&(w[m]=i[m]);l.count++,j++,f(t,S,w,n+" ",a,c,l)}else Yu("Branch count CS: "+l.count);l.count--,0===j&&Yu("Match2 fails completely on "+y),Yu("Match2 ends, Branch count: "+l.count+" for "+l.pattern_debug),0===l.count&&(Yu("Branch finished."),l.reportDone())},g=this;Yu("Query on "+this.statements.length);var m=new l(e,n);m.count++,t.sync?f(g,t.pat,t.pat.initBindings,"",i,e,m):setTimeout((function(){f(g,t.pat,t.pat.initBindings,"",i,e,m)}),0)}function Sh(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Fh(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Sh(Object(i),!0).forEach((function(e){ma(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Sh(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Ah(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return _h(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_h(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}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,s=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw o}}}}function _h(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var jh="http://www.w3.org/2002/07/owl#";function Ch(t,e,i,n){var r=t.any(e,i,void 0);return!!r&&(t.equate(r,n),!0)}function Rh(t,e,i,n){var r=t.any(void 0,i,n);return!!r&&(t.equate(r,e),!0)}function Ih(t,e,i,n,r){t.typeCallback&&t.typeCallback(t,n,r);var o=t.classActions[t.id(n)],s=!1;if(o)for(var a=0;a<o.length;a++)s=s||o[a](t,e,i,n,r);return s}var Th=function(){pa(n,bh);var t,e,i=(t=n,e=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(t){return!1}}(),function(){var i,n=ga(t);if(e){var r=ga(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return va(this,i)});function n(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ha(this,n),ma(da(e=i.call(this,void 0,void 0,void 0,void 0,r)),"updater",void 0),ma(da(e),"namespaces",void 0),ma(da(e),"classActions",void 0),ma(da(e),"propertyActions",void 0),ma(da(e),"redirections",void 0),ma(da(e),"aliases",void 0),ma(da(e),"HTTPRedirects",void 0),ma(da(e),"subjectIndex",void 0),ma(da(e),"predicateIndex",void 0),ma(da(e),"objectIndex",void 0),ma(da(e),"whyIndex",void 0),ma(da(e),"index",void 0),ma(da(e),"features",void 0),ma(da(e),"_universalVariables",void 0),ma(da(e),"_existentialVariables",void 0),ma(da(e),"rdfArrayRemove",void 0),ma(da(e),"dataCallbacks",void 0),e.propertyActions={},e.classActions={},e.redirections=[],e.aliases=[],e.HTTPRedirects=[],e.subjectIndex=[],e.predicateIndex=[],e.objectIndex=[],e.whyIndex=[],e.index=[e.subjectIndex,e.predicateIndex,e.objectIndex,e.whyIndex],e.namespaces={},e.features=t||[],e.rdfArrayRemove=r.rdfArrayRemove||ch,r.dataCallback&&(e.dataCallbacks=[r.dataCallback]),e.initPropertyActions(e.features),e}return ua(n,[{key:"substitute",value:function(t){var e=this.statements.map((function(e){return e.substitute(t)})),i=new n;return i.add(e),i}},{key:"addDataCallback",value:function(t){this.dataCallbacks||(this.dataCallbacks=[]),this.dataCallbacks.push(t)}},{key:"applyPatch",value:function(t,e,i){var n,r=this,o=null;function s(s){if(t.delete){n=t.delete,o&&(n=n.substitute(o));var a=[],c=(n=n.statements).map((function(t){var i=r.statementsMatching(t.subject,t.predicate,t.object,e);return 0===i.length?(a.push(t),null):i[0]}));if(a.length)return i("Could not find to delete: "+a.join("\n or "));c.map((function(t){r.remove(t)}))}t.insert&&(n=t.insert,o&&(n=n.substitute(o)),(n=n.statements).map((function(t){t.graph=e,r.add(t.subject,t.predicate,t.object,t.graph)}))),s()}if(t.where){var a=new kh("patch");a.pat=t.where,a.pat.statements.map((function(t){t.graph=Bd(e.value)})),a.sync=!0;var c=[];r.query(a,(function(t){c.push(t)}),r.fetcher,(function(){return 0===c.length?i("No match found to be patched:"+t.where):c.length>1?i("Patch ambiguous. No patch done."):(o=c[0],void s(i))}))}else s(i)}},{key:"declareExistential",value:function(t){return this._existentialVariables||(this._existentialVariables=[]),this._existentialVariables.push(t),t}},{key:"initPropertyActions",value:function(t){this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"))]=[Ih],gh(t,"sameAs")>=0&&(this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode("".concat(jh,"sameAs")))]=[function(t,e,i,n){return t.equate(e,n),!0}]),gh(t,"InverseFunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode("".concat(jh,"InverseFunctionalProperty")))]=[function(t,e){return t.newPropertyAction(e,Rh)}]),gh(t,"FunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode("".concat(jh,"FunctionalProperty")))]=[function(t,e){return t.newPropertyAction(e,Ch)}])}},{key:"addStatement",value:function(t){return this.add(t.subject,t.predicate,t.object,t.graph),this.statements.length}},{key:"add",value:function(t,e,i,n){var r,o,s;if(1===arguments.length){if(t instanceof Array)for(r=0;r<t.length;r++)this.add(t[r]);else Va(t)?this.add(t.subject,t.predicate,t.object,t.graph):Ja(t)&&this.add(t.statements);return this}n||(n=this.fetcher?this.fetcher.appNode:this.rdfFactory.defaultGraph()),"string"==typeof t&&(t=this.rdfFactory.namedNode(t)),e=yh.fromValue(e);var a=yh.fromValue(i);if(n=yh.fromValue(n),!Ha(t))throw new Error("Subject is not a subject type");if(!Ka(e))throw new Error("Predicate ".concat(e," is not a predicate type"));if(!za(a))throw new Error("Object ".concat(a," is not an object type"));if(!Xa(n))throw new Error("Why is not a graph type");this.predicateCallback&&this.predicateCallback(this,e,n);var c=this.id(this.canon(e)),l=!1;if(o=this.propertyActions[c])for(r=0;r<o.length;r++)l=l||o[r](this,t,e,a,n);if(this.holds(t,e,a,n))return null;var u=[this.id(this.canon(t)),c,this.id(this.canon(a)),this.id(this.canon(n))];for(s=this.rdfFactory.quad(t,e,a,n),r=0;r<4;r++){var h=this.index[r],d=u[r];h[d]||(h[d]=[]),h[d].push(s)}if(this.statements.push(s),this.dataCallbacks){var f,p=Ah(this.dataCallbacks);try{for(p.s();!(f=p.n()).done;){var v=f.value;v(s)}}catch(t){p.e(t)}finally{p.f()}}return s}},{key:"canon",value:function(t){if(!t)return t;var e=this.redirections[this.id(t)];if(e)return e;switch(t.termType){case xa:return new Ua(t.value);case Fa:return t;case Sa:return new Tu;case Aa:case _a:return t;case ka:return new Qa(t.value,t.language,t.datatype);case ya:return new Ya(t.value);case Ea:return new qu(t.value);default:throw new Error("Term Type not recognized for canonization: ".concat(t.termType))}}},{key:"check",value:function(){this.checkStatementList(this.statements);for(var t=0;t<4;t++){var e=this.index[t];for(var i in e)e.hasOwnProperty(i)&&this.checkStatementList(e[i],t)}}},{key:"checkStatementList",value:function(t,e){void 0===e&&(e=0);for(var i,n=" found in "+["subject","predicate","object","why"][e]+" index.",r=0;r<t.length;r++){for(var o=[(i=t[r]).subject,i.predicate,i.object,i.graph],s=function(t,e){for(var i=0;i<t.length;i++)if(t[i].subject.equals(e.subject)&&t[i].predicate.equals(e.predicate)&&t[i].object.equals(e.object)&&t[i].why.equals(e.graph))return!0},a=0;a<4;a++){var c=this.canon(o[a]),l=this.id(c);this.index[a][l]&&s(this.index[a][l],i)}if(!s(this.statements,i))throw new Error("Statement list does not statement "+i+"@"+i.graph+n)}}},{key:"close",value:function(){return this}},{key:"compareTerms",value:function(t,e){return Object.prototype.hasOwnProperty.call(t,"compareTerm")?t.compareTerm(e):wa[t.termType]<wa[e.termType]?-1:wa[t.termType]>wa[e.termType]?1:t.value<e.value?-1:t.value>e.value?1:0}},{key:"copyTo",value:function(t,e,i){i||(i=[]);var n=this.statementsMatching(t);-1!==gh(i,"two-direction")&&n.concat(this.statementsMatching(void 0,void 0,t));for(var r=0;r<n.length;r++){var o=n[r];switch(o.object.termType){case"NamedNode":this.add(e,o.predicate,o.object);break;case"Literal":case"BlankNode":case"Collection":this.add(e,o.predicate,o.object.copy(this))}-1!==gh(i,"delete")&&this.remove(o)}}},{key:"equate",value:function(t,e){var i=this.canon(t),n=this.canon(e),r=this.compareTerms(i,n);return!r||(r<0?this.replaceWith(n,i):this.replaceWith(i,n))}},{key:"formula",value:function(t){return new n(t)}},{key:"length",get:function(){return this.statements.length}},{key:"match",value:function(t,e,i,n){return this.statementsMatching(yh.fromValue(t),yh.fromValue(e),yh.fromValue(i),yh.fromValue(n))}},{key:"mentionsURI",value:function(t){var e="<"+t+">";return!!this.subjectIndex[e]||!!this.objectIndex[e]||!!this.predicateIndex[e]}},{key:"newExistential",value:function(t){if(!t)return this.bnode();var e=this.sym(t);return this.declareExistential(e)}},{key:"newPropertyAction",value:function(t,e){var i=this.id(t);this.propertyActions[i]||(this.propertyActions[i]=[]),this.propertyActions[i].push(e);for(var n=this.statementsMatching(void 0,t,void 0),r=!1,o=0;o<n.length;o++)r=r||e(this,n[o].subject,t,n[o].object);return r}},{key:"newUniversal",value:function(t){var e=this.sym(t);return this._universalVariables||(this._universalVariables=[]),this._universalVariables.push(e),e}},{key:"variable",value:function(t){return new qu(t)}},{key:"nextSymbol",value:function(t){for(var e=0;;e++){var i=t.value+"#n"+e;if(!this.mentionsURI(i))return this.sym(i)}}},{key:"query",value:function(t,e,i,n){return Eh.call(this,t,e,i,n)}},{key:"querySync",value:function(t){var e=[],i=!1;if(t.sync=!0,Eh.call(this,t,(function(t){e.push(t)}),null,(function(){i=!0})),!i)throw new Error("Sync query should have called done function");return e}},{key:"remove",value:function(t){if(t instanceof Array){for(var e=0;e<t.length;e++)this.remove(t[e]);return this}if(Ja(t))return this.remove(t.statements);var i=this.statementsMatching(t.subject,t.predicate,t.object,t.graph);if(!i.length)throw new Error("Statement to be removed is not on store: "+t);return this.removeStatement(i[0]),this}},{key:"removeDocument",value:function(t){for(var e=this.statementsMatching(void 0,void 0,void 0,t).slice(),i=0;i<e.length;i++)this.removeStatement(e[i]);return this}},{key:"removeMany",value:function(t,e,i,n,r){for(var o=this.statementsMatching(t,e,i,n,!1),s=[],a=0;a<o.length;a++)s.push(o[a]);for(r&&(s=s.slice(0,r)),a=0;a<s.length;a++)this.remove(s[a])}},{key:"removeMatches",value:function(t,e,i,n){return this.removeMany(t,e,i,n),this}},{key:"removeStatement",value:function(t){for(var e=[t.subject,t.predicate,t.object,t.graph],i=0;i<4;i++){var n=this.canon(e[i]),r=this.id(n);this.index[i][r]&&this.rdfArrayRemove(this.index[i][r],t)}return this.rdfArrayRemove(this.statements,t),this}},{key:"removeStatements",value:function(t){for(var e=0;e<t.length;e++)this.remove(t[e]);return this}},{key:"replaceWith",value:function(t,e){for(var i=this.id(t),n=this.id(e),r=function(t){var e=t[i];if(e){var r=t[n];t[n]=r?e.concat(r):e,delete t[i]}},o=0;o<4;o++)r(this.index[o]);if(this.redirections[i]=e,t.value){if(this.aliases[n]||(this.aliases[n]=[]),this.aliases[n].push(t),this.aliases[i])for(o=0;o<this.aliases[i].length;o++)this.redirections[this.id(this.aliases[i][o])]=e,this.aliases[n].push(this.aliases[i][o]);this.add(e,this.sym("http://www.w3.org/2007/ont/link#uri"),t),this.fetcher&&this.fetcher.nowKnownAs(t,e)}return r(this.classActions),r(this.propertyActions),!0}},{key:"allAliases",value:function(t){var e=this.aliases[this.id(this.canon(t))]||[];return e.push(this.canon(t)),e}},{key:"sameThings",value:function(t,e){if(t.equals(e))return!0;var i=this.canon(t);if(!i)return!1;var n=this.canon(e);return!!n&&i.value===n.value}},{key:"setPrefixForURI",value:function(t,e){if(("tab"!==t||!this.namespaces.tab)&&"ns"!==t.slice(0,2)&&"default"!==t.slice(0,7)){for(var i in this.namespaces)this.namespaces[i]==e&&delete this.namespaces[i];this.namespaces[t]=e}}},{key:"statementsMatching",value:function(t,e,i,n,r){var o,s,a=[t,e,i,n],c=[],l=[],u=[];for(o=0;o<4;o++)c[o]=this.canon(yh.fromValue(a[o])),c[o]&&(u.push(o),l[o]=this.id(c[o]));if(0===u.length)return this.statements;if(1===u.length)return(s=this.index[o=u[0]][l[o]])&&r&&s.length>1&&(s=s.slice(0,1)),s||[];var h,d,f=1e10;for(d=0;d<u.length;d++){if(!(s=this.index[o=u[d]][l[o]]))return[];s.length<f&&(f=s.length,h=d)}for(var p=u[h],v=this.index[p][l[p]],g=u.slice(0,h).concat(u.slice(h+1)),m=[],w=["subject","predicate","object","why"],b=0;b<v.length;b++){var y=v[b];for(d=0;d<g.length;d++)if(!this.canon(y[w[o=g[d]]]).equals(c[o])){y=null;break}if(null!=y&&(m.push(y),r))break}return m}},{key:"uris",value:function(t){var e=this.canon(t),i=this.aliases[this.id(e)];if(!e.value)return[];var n=[e.value];if(i)for(var r=0;r<i.length;r++)n.push(i[r].uri);return n}},{key:"serialize",value:function(t,e,i,n){var r,o=null!==(r=n)&&void 0!==r&&r.namespaces?Fh(Fh({},this.namespaces),n.namespaces):Fh({},this.namespaces);return dh(i,this,t,e,void 0,n=Fh(Fh({},n||{}),{},{namespaces:o}))}}],[{key:"defaultGraphURI",get:function(){return Iu}}]),n}();ma(Th,"handleRDFType",void 0),Th.handleRDFType=Ih;var Oh="http://www.w3.org/2000/10/swap/log#",Ph=function(t){return t},Nh=function(t){return t},Dh=function(t){if(t.length>0)throw"missing.js: oops nnonempty dict not imp";return[]},Mh=function(t){return t.length},Uh=function(t,e,i){if(void 0===t.slice)throw"@@ mising.js: No .slice function for "+t+" of type "+aa(t);return void 0===i||null==i?t.slice(e):t.slice(e,i)},Lh=Error("dummy error stop iteration"),Bh=function(t){return this.last=0,this.li=t,this.next=function(){if(this.last==this.li.length)throw Lh;return this.li[this.last++]},this},Jh=function(t,e){return t.indexOf(e)},$h=function(t,e){if(!t){if(e)throw"python Assertion failed: "+e;throw"(python) Assertion failed."}};String.prototype.encode=function(t){if("utf-8"!=t)throw"UTF8_converter: can only do utf-8";return function(t){t=t.replace(/\r\n/g,"\n");for(var e="",i=0;i<t.length;i++){var n=t.charCodeAt(i);n<128?e+=String.fromCharCode(n):n>127&&n<2048?(e+=String.fromCharCode(n>>6|192),e+=String.fromCharCode(63&n|128)):(e+=String.fromCharCode(n>>12|224),e+=String.fromCharCode(n>>6&63|128),e+=String.fromCharCode(63&n|128))}return e}(this)},String.prototype.decode=function(t){if("utf-8"!=t)throw"UTF8_converter: can only do utf-8";return this};var zh,Hh=function(t,e){return Ju(e,t)},Kh="http://www.w3.org/2002/07/owl#sameAs",Wh="\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~",qh=Wh+":",Vh=new RegExp("^([-+]?[0-9]+)(\\.[0-9]+)?(e[-+]?[0-9]+)?","g"),Gh=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?"),Xh=new RegExp('[\\\\\\r\\n\\"]',"g"),Yh=new RegExp("^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*","g"),Zh=function(t,e,i,n,r,o,s,a){return new Qh(t,e,i,n,r,o,s,a)},Qh=function(){function t(e,i,n,r,o,s,a,c){ha(this,t),void 0===i&&(i=null),void 0===n&&(n=""),void 0===r&&(r=null),void 0===o&&(o=""),void 0===a&&(a=""),void 0===c&&(c=null),this._bindings=new Dh([]),this._flags=a,""!=n&&($h(n.indexOf(":")>=0,"Document URI not absolute: "+n),this._bindings[""]=n+"#"),this._store=e,o&&e.setGenPrefix(o),this._thisDoc=n,this.source=e.sym(n),this.lines=0,this.statementCount=0,this.startOfLine=0,this.previousLine=0,this._genPrefix=o,this.keywords=new Nh(["a","this","bind","has","is","of","true","false"]),this.keywordsSet=0,this._anonymousNodes=new Dh([]),this._variables=new Dh([]),this._parentVariables=new Dh([]),this._reason=c,this._reason2=null,this._baseURI=r||n||null,$h(!this._baseURI||this._baseURI.indexOf(":")>=0),this._genPrefix||(this._genPrefix=this._thisDoc?this._thisDoc+"#_g":RDFSink_uniqueURI()),this._formula=null==i?this._thisDoc?e.formula(n+"#_formula"):e.formula():i,this._context=this._formula,this._parentContext=null}return ua(t,[{key:"here",value:function(t){return this._genPrefix+"_L"+this.lines+"C"+(t-this.startOfLine+1)}},{key:"formula",value:function(){return this._formula}},{key:"loadStream",value:function(t){return this.loadBuf(t.read())}},{key:"loadBuf",value:function(t){return this.startDoc(),this.feed(t),this.endDoc()}},{key:"feed",value:function(t){for(var e=t.decode("utf-8"),i=0;i>=0;){var n=this.skipSpace(e,i);if(n<0)return;if((i=this.directiveOrStatement(e,n))<0)throw td(this._thisDoc,this.lines,e,n,"expected directive or statement")}}},{key:"directiveOrStatement",value:function(t,e){var i,n=this.skipSpace(t,e);return n<0?n:(i=this.directive(t,n))>=0||(i=this.statement(t,n))>=0?this.checkDot(t,i):i}},{key:"tok",value:function(t,e,i){if("@"==e.slice(i,i+1))i+=1;else if(gh(this.keywords,t)<0)return-1;var n=i+Mh(t);return e.slice(i,n)==t&&Wh.indexOf(e.charAt(n))>=0?n:-1}},{key:"directive",value:function(t,e){if((o=this.skipSpace(t,e))<0)return o;var i=new Nh([]);if((o=this.tok("bind",t,e))>0)throw td(this._thisDoc,this.lines,t,e,"keyword bind is obsolete: use @prefix");if((o=this.tok("keywords",t,e))>0){if((e=this.commaSeparatedList(t,o,i,!1))<0)throw td(this._thisDoc,this.lines,t,e,"'@keywords' needs comma separated list of words");return this.setKeywords(Uh(i,null,null)),e}if((o=this.tok("forAll",t,e))>0){if((e=this.commaSeparatedList(t,o,i,!0))<0)throw td(this._thisDoc,this.lines,t,e,"Bad variable list after @forAll");var n=new Bh(i);try{for(;;){var r=n.next();(gh(this._variables,r)<0||gh(this._parentVariables,r)>=0)&&(this._variables[r]=this._context.newUniversal(r))}}catch(t){if(t!=Lh)throw t}return e}if((o=this.tok("forSome",t,e))>0){if((e=this.commaSeparatedList(t,o,i,this.uri_ref2))<0)throw td(this._thisDoc,this.lines,t,e,"Bad variable list after @forSome");n=new Bh(i);try{for(;;)r=n.next(),this._context.declareExistential(r)}catch(t){if(t!=Lh)throw t}return e}if((o=this.tok("prefix",t,e))>=0){var o,s=new Nh([]);if((e=this.qname(t,o,s))<0)throw td(this._thisDoc,this.lines,t,o,"expected qname after @prefix");if((o=this.uri_ref2(t,e,s))<0)throw td(this._thisDoc,this.lines,t,e,"expected <uriref> after @prefix _qname_");var a=s[1].uri;return this._baseURI?a=Hh(this._baseURI,a):$h(a.indexOf(":")>=0,"With no base URI, cannot handle relative URI for NS"),$h(a.indexOf(":")>=0),this._bindings[s[0][0]]=a,this.bind(s[0][0],function(t){return encodeURI(t)}(a)),o}if((o=this.tok("base",t,e))>=0){if(s=new Nh([]),(e=this.uri_ref2(t,o,s))<0)throw td(this._thisDoc,this.lines,t,o,"expected <uri> after @base ");if(a=s[0].uri,!this._baseURI)throw td(this._thisDoc,this.lines,t,o,"With no previous base URI, cannot use relative URI in @base <"+a+">");return a=Hh(this._baseURI,a),$h(a.indexOf(":")>=0),this._baseURI=a,e}return-1}},{key:"bind",value:function(t,e){""==t||this._store.setPrefixForURI(t,e)}},{key:"setKeywords",value:function(t){null==t?this.keywordsSet=0:(this.keywords=t,this.keywordsSet=1)}},{key:"startDoc",value:function(){}},{key:"endDoc",value:function(){return this._formula}},{key:"makeStatement",value:function(t){t[0].add(t[2],t[1],t[3],this.source),this.statementCount+=1}},{key:"statement",value:function(t,e){var i=new Nh([]);if((e=this.object(t,e,i))<0)return e;var n=this.property_list(t,e,i[0]);if(n<0)throw td(this._thisDoc,this.lines,t,e,"expected propertylist");return n}},{key:"subject",value:function(t,e,i){return this.item(t,e,i)}},{key:"verb",value:function(t,e,i){if((r=this.skipSpace(t,e))<0)return r;var n=new Nh([]);if((r=this.tok("has",t,e))>=0){if((e=this.prop(t,r,n))<0)throw td(this._thisDoc,this.lines,t,r,"expected property after 'has'");return i.push(new Ph(["->",n[0]])),e}if((r=this.tok("is",t,e))>=0){var r;if((e=this.prop(t,r,n))<0)throw td(this._thisDoc,this.lines,t,r,"expected <property> after 'is'");if((r=this.skipSpace(t,e))<0)throw td(this._thisDoc,this.lines,t,e,"End of file found, expected property after 'is'");if((r=this.tok("of",t,e=r))<0)throw td(this._thisDoc,this.lines,t,e,"expected 'of' after 'is' <prop>");return i.push(new Ph(["<-",n[0]])),r}if((r=this.tok("a",t,e))>=0)return i.push(new Ph(["->",this._store.sym("http://www.w3.org/1999/02/22-rdf-syntax-ns#type")])),r;if("<="==t.slice(e,e+2))return i.push(new Ph(["<-",this._store.sym(Oh+"implies")])),e+2;if("="==t.slice(e,e+1))return">"==t.slice(e+1,e+2)?(i.push(new Ph(["->",this._store.sym(Oh+"implies")])),e+2):(i.push(new Ph(["->",this._store.sym(Kh)])),e+1);if(":="==t.slice(e,e+2))return i.push(new Ph(["->",Oh+"becomes"])),e+2;if((r=this.prop(t,e,n))>=0)return i.push(new Ph(["->",n[0]])),r;if(">-"==t.slice(e,e+2)||"<-"==t.slice(e,e+2))throw td(this._thisDoc,this.lines,t,r,">- ... -> syntax is obsolete.");return-1}},{key:"prop",value:function(t,e,i){return this.item(t,e,i)}},{key:"item",value:function(t,e,i){return this.path(t,e,i)}},{key:"blankNode",value:function(t){return this._context.bnode(t,this._reason2)}},{key:"path",value:function(t,e,i){if((o=this.nodeOrLiteral(t,e,i))<0)return o;for(;"!^.".indexOf(t.slice(o,o+1))>=0;){var n=t.slice(o,o+1);if("."==n){var r=t.slice(o+1,o+2);if(!r||qh.indexOf(r)>=0&&":?<[{(".indexOf(r)<0)break}var o,s=i.pop(),a=this.blankNode(this.here(o));if((o=this.node(t,o+1,i))<0)throw td(this._thisDoc,this.lines,t,o,"EOF found in middle of path syntax");var c=i.pop();this.makeStatement(new Ph("^"==n?[this._context,c,a,s]:[this._context,c,s,a])),i.push(a)}return o}},{key:"anonymousNode",value:function(t){if(e=this._anonymousNodes[t])return e;var e=this._store.bnode(t);return this._anonymousNodes[t]=e,e}},{key:"node",value:function(t,e,i,n){void 0===n&&(n=null);var r=n;if((u=this.skipSpace(t,e))<0)return u;var o=t.slice(e=u,e+1);if("["==o){var s=this.here(e);if((u=this.skipSpace(t,e+1))<0)throw td(this._thisDoc,this.lines,t,e,"EOF after '['");if("="==t.slice(u,u+1)){e=u+1;var a=new Nh([]);if(!((u=this.objectList(t,e,a))>=0))throw td(this._thisDoc,this.lines,t,e,"objectList expected after [= ");if(r=a[0],Mh(a)>1){var c=new Bh(a);try{for(;;){var l=c.next();this.makeStatement(new Ph([this._context,this._store.sym(Kh),r,l]))}}catch(t){if(t!=Lh)throw t}}if((u=this.skipSpace(t,u))<0)throw td(this._thisDoc,this.lines,t,e,"EOF when objectList expected after [ = ");if(";"==t.slice(u,u+1))var u=u+1}if(null==r&&(r=this.blankNode(s)),(e=this.property_list(t,u,r))<0)throw td(this._thisDoc,this.lines,t,u,"property_list expected");if((u=this.skipSpace(t,e))<0)throw td(this._thisDoc,this.lines,t,e,"EOF when ']' expected after [ <propertyList>");if("]"!=t.slice(u,u+1))throw td(this._thisDoc,this.lines,t,u,"']' expected");return i.push(r),u+1}if("{"==o){if("$"==t.slice(e+1,e+2)){u=(e+=1)+1;for(var h=new Nh([]),d=!0;;){if((e=this.skipSpace(t,u))<0)throw td(this._thisDoc,this.lines,t,e,"needed '$}', found end.");if("$}"==t.slice(e,e+2)){u=e+2;break}if(d)d=!1;else{if(","!=t.slice(e,e+1))throw td(this._thisDoc,this.lines,t,e,"expected: ','");e+=1}var f=new Nh([]);if((u=this.item(t,e,f))<0)throw td(this._thisDoc,this.lines,t,e,"expected item in set or '$}'");h.push(f[0])}return i.push(this._store.newSet(h,this._context)),u}u=e+1;var p=this._parentContext;this._parentContext=this._context;var v=this._anonymousNodes,g=this._parentVariables;this._parentVariables=this._variables,this._anonymousNodes=new Dh([]),this._variables=this._variables.slice();var m=this._reason2;for(this._reason2=null,null==r&&(r=this._store.formula()),this._context=r;;){if((e=this.skipSpace(t,u))<0)throw td(this._thisDoc,this.lines,t,e,"needed '}', found end.");if("}"==t.slice(e,e+1)){u=e+1;break}if((u=this.directiveOrStatement(t,e))<0)throw td(this._thisDoc,this.lines,t,e,"expected statement or '}'")}return this._anonymousNodes=v,this._variables=this._parentVariables,this._parentVariables=g,this._context=this._parentContext,this._reason2=m,this._parentContext=p,i.push(r.close()),u}if("("==o){var w=this._store.list;for("$"==t.slice(e+1,e+2)&&(w=this._store.newSet,e+=1),u=e+1,h=new Nh([]);;){if((e=this.skipSpace(t,u))<0)throw td(this._thisDoc,this.lines,t,e,"needed ')', found end.");if(")"==t.slice(e,e+1)){u=e+1;break}if(f=new Nh([]),(u=this.item(t,e,f))<0)throw td(this._thisDoc,this.lines,t,e,"expected item in list or ')'");h.push(f[0])}return i.push(w(h,this._context)),u}if((u=this.tok("this",t,e))>=0)throw td(this._thisDoc,this.lines,t,e,"Keyword 'this' was ancient N3. Now use @forSome and @forAll keywords.");return(u=this.tok("true",t,e))>=0?(i.push(!0),u):(u=this.tok("false",t,e))>=0?(i.push(!1),u):null==r&&(u=this.uri_ref2(t,e,i))>=0?u:-1}},{key:"property_list",value:function(t,e,i){for(;;){if((l=this.skipSpace(t,e))<0)throw td(this._thisDoc,this.lines,t,e,"EOF found when expected verb in property list");if(":-"!=t.slice(l,l+2)){e=l;var n=new Nh([]);if((l=this.verb(t,e,n))<=0)return e;var r=new Nh([]);if((e=this.objectList(t,l,r))<0)throw td(this._thisDoc,this.lines,t,l,"objectList expected");var o=new Bh(r);try{for(;;){var s=o.next(),a=n[0],c=a[1];this.makeStatement(new Ph("->"==a[0]?[this._context,c,i,s]:[this._context,c,s,i]))}}catch(t){if(t!=Lh)throw t}if((l=this.skipSpace(t,e))<0)throw td(this._thisDoc,this.lines,t,l,"EOF found in list of objects");if(";"!=t.slice(e,e+1))return e;e+=1}else{e=l+2;var l,u=new Nh([]);if((l=this.node(t,e,u,i))<0)throw td(this._thisDoc,this.lines,t,e,"bad {} or () or [] node after :- ");e=l}}}},{key:"commaSeparatedList",value:function(t,e,i,n){if((r=this.skipSpace(t,e))<0)throw td(this._thisDoc,this.lines,t,r,"EOF found expecting comma sep list");if("."==t.charAt(r))return e;if(n)var r=this.uri_ref2(t,r,i);else r=this.bareWord(t,r,i);if(r<0)return-1;for(;;){if((e=this.skipSpace(t,r))<0)return e;var o=t.slice(e,e+1);if(","!=o)return"."!=o?-1:e;if((r=n?this.uri_ref2(t,e+1,i):this.bareWord(t,e+1,i))<0)throw td(this._thisDoc,this.lines,t,r,"bad list content")}}},{key:"objectList",value:function(t,e,i){if((e=this.object(t,e,i))<0)return-1;for(;;){var n=this.skipSpace(t,e);if(n<0)throw td(this._thisDoc,this.lines,t,n,"EOF found after object");if(","!=t.slice(n,n+1))return n;if((e=this.object(t,n+1,i))<0)return e}}},{key:"checkDot",value:function(t,e){var i=this.skipSpace(t,e);if(i<0)return i;if("."==t.slice(i,i+1))return i+1;if("}"==t.slice(i,i+1))return i;if("]"==t.slice(i,i+1))return i;throw td(this._thisDoc,this.lines,t,i,"expected '.' or '}' or ']' at end of statement")}},{key:"uri_ref2",value:function(t,e,i){var n=new Nh([]);if((d=this.qname(t,e,n))>=0){var r=n[0],o=r[0],s=r[1];if(null==o){$h(0,"not used?");var a=this._baseURI+"#"}else if(!(a=this._bindings[o])){if("_"==o)return i.push(this.anonymousNode(s)),d;throw td(this._thisDoc,this.lines,t,e,"Prefix "+o+" not bound.")}var c=this._store.sym(a+s);return gh(this._variables,c)>=0?i.push(this._variables[c]):i.push(c),d}if((e=this.skipSpace(t,e))<0)return-1;if("?"==t.charAt(e)){var l=new Nh([]);return(d=this.variable(t,e,l))>0?(i.push(l[0]),d):-1}if("<"==t.charAt(e)){for(var u=e+=1;e<Mh(t);){if(">"==t.charAt(e)){var h=t.slice(u,e);return this._baseURI?h=Hh(this._baseURI,h):$h(h.indexOf(":")>=0,"With no base URI, cannot deal with relative URIs"),"#"==t.slice(e-1,e)&&"#"!=Uh(h,-1,null)&&(h+="#"),c=this._store.sym(h),gh(this._variables,c)>=0?i.push(this._variables[c]):i.push(c),e+1}e+=1}throw td(this._thisDoc,this.lines,t,d,"unterminated URI reference")}if(this.keywordsSet){var d;if(l=new Nh([]),(d=this.bareWord(t,e,l))<0)return-1;if(gh(this.keywords,l[0])>=0)throw td(this._thisDoc,this.lines,t,e,'Keyword "'+l[0]+'" not allowed here.');return i.push(this._store.sym(this._bindings[""]+l[0])),d}return-1}},{key:"skipSpace",value:function(t,e){for(var i=e||0;i<t.length;i++){var n=t.charAt(i);if(" \n\r\t\f\v \u2028\u2029 ".indexOf(n)<0){if("#"!==t.charAt(i))return i;for(;;i++){if(i===t.length)return-1;if("\n"===t.charAt(i)){this.lines=this.lines+1;break}}}else"\n"===t.charAt(i)&&(this.lines=this.lines+1)}return-1}},{key:"variable",value:function(t,e,i){if((n=this.skipSpace(t,e))<0)return-1;if("?"!=t.slice(n,n+1))return-1;var n;if(e=n+=1,"0123456789-".indexOf(t.charAt(n))>=0)throw td(this._thisDoc,this.lines,t,n,"Varible name can't start with '"+t.charAt(n)+"s'");for(;e<Mh(t)&&qh.indexOf(t.charAt(e))<0;)e+=1;if(null==this._parentContext)throw td(this._thisDoc,this.lines,t,n,"Can't use ?xxx syntax for variable in outermost level: "+t.slice(n-1,e));return i.push(this._store.variable(t.slice(n,e))),e}},{key:"bareWord",value:function(t,e,i){var n=this.skipSpace(t,e);if(n<0)return-1;var r=t.charAt(n);if("0123456789-".indexOf(r)>=0)return-1;if(qh.indexOf(r)>=0)return-1;for(e=n;e<Mh(t)&&qh.indexOf(t.charAt(e))<0;)e+=1;return i.push(t.slice(n,e)),e}},{key:"qname",value:function(t,e,i){if((e=this.skipSpace(t,e))<0)return-1;var n=t.charAt(e);if("0123456789-+".indexOf(n)>=0)return-1;if(qh.indexOf(n)<0){var r=n;for(e+=1;e<Mh(t)&&(n=t.charAt(e),qh.indexOf(n)<0);)r+=n,e+=1}else r="";if(e<Mh(t)&&":"==t.charAt(e)){var o=r;for(e+=1,r="";e<Mh(t)&&(n=t.charAt(e),qh.indexOf(n)<0);)r+=n,e+=1;return i.push(new Ph([o,r])),e}return r&&this.keywordsSet&&gh(this.keywords,r)<0?(i.push(new Ph(["",r])),e):-1}},{key:"object",value:function(t,e,i){if((s=this.subject(t,e,i))>=0)return s;if((s=this.skipSpace(t,e))<0)return-1;var n=null,r=t.charAt(e=s);if('"'==r||"'"==r){n=t.slice(e,e+3==r+r)?r+r+r:r,e+=Mh(n);var o=this.strconst(t,e,n),s=o[0];return i.push(this._store.literal(o[1])),s}return-1}},{key:"nodeOrLiteral",value:function(t,e,i){if((h=this.node(t,e,i))>=0)return h;if((h=this.skipSpace(t,e))<0)return-1;var n=t.charAt(e=h);if("-+0987654321".indexOf(n)>=0){if(Gh.lastIndex=0,null!=(u=Gh.exec(t.slice(e))))h=e+(r=u[0]).length,r.indexOf("T")>=0?i.push(this._store.literal(r,this._store.sym("http://www.w3.org/2001/XMLSchema#dateTime"))):i.push(this._store.literal(r,this._store.sym("http://www.w3.org/2001/XMLSchema#date")));else{var r;if(Vh.lastIndex=0,null==(u=Vh.exec(t.slice(e))))throw td(this._thisDoc,this.lines,t,e,"Bad number or date syntax");(r=t.slice(e,h=e+Vh.lastIndex)).indexOf("e")>=0?i.push(this._store.literal(parseFloat(r),this._store.sym("http://www.w3.org/2001/XMLSchema#double"))):t.slice(e,h).indexOf(".")>=0?i.push(this._store.literal(parseFloat(r),this._store.sym("http://www.w3.org/2001/XMLSchema#decimal"))):i.push(this._store.literal(parseInt(r),this._store.sym("http://www.w3.org/2001/XMLSchema#integer")))}return h}if('"'==t.charAt(e)){if('"""'==t.slice(e,e+3))var o='"""';else o='"';e+=Mh(o);var s=null,a=this.strconst(t,e,o),c=a[1],l=null;if("@"==t.slice(h=a[0],h+1)){var u;if(Yh.lastIndex=0,null==(u=Yh.exec(t.slice(h+1))))throw td(this._thisDoc,startline,t,e,"Bad language code syntax on string literal, after @");l=t.slice(h+1,e=Yh.lastIndex+h+1);var h=e}if("^^"==t.slice(h,h+2)){var d=new Nh([]);h=this.uri_ref2(t,h+2,d),s=d[0]}return i.push(this._store.literal(c,l||s)),h}return-1}},{key:"strconst",value:function(t,e,i){for(var n=e,r="",o=this.lines;n<Mh(t);){if(e=n+Mh(i),t.slice(n,e)==i)return new Ph([e,r]);if('"'!=t.charAt(n)){if(Xh.lastIndex=0,!Xh.exec(t.slice(n)))throw td(this._thisDoc,o,t,n,"Closing quote missing in string at ^ in "+t.slice(n-20,n)+"^"+t.slice(n,n+20));if(r+=t.slice(n,e=n+Xh.lastIndex-1),'"'!=(c=t.charAt(e)))if("\r"!=c){if("\n"==c){if('"'==i)throw td(this._thisDoc,o,t,e,"newline found in string literal");this.lines=this.lines+1,r+=c,n=e+1,this.previousLine=this.startOfLine,this.startOfLine=n}else if("\\"==c){if(!(c=t.slice(n=e+1,n+1)))throw td(this._thisDoc,o,t,e,"unterminated string literal (2)");var s=Jh('abfrtvn\\"',c);if(s>=0)r+='a\b\f\r\t\v\n\\"'.charAt(s),n+=1;else if("u"==c)n=(a=this.uEscape(t,n+1,o))[0],r+=c=a[1];else{if("U"!=c)throw td(this._thisDoc,this.lines,t,e,"bad escape");var a,c;n=(a=this.UEscape(t,n+1,o))[0],r+=c=a[1]}}}else n=e+1;else n=e}else r=r+'"',n=n+1}throw td(this._thisDoc,this.lines,t,e,"unterminated string literal")}},{key:"uEscape",value:function(t,e,i){for(var n=e,r=0,o=0;r<4;){var s=t.slice(n,n+1).toLowerCase();if(n+=1,""==s)throw td(this._thisDoc,i,t,e,"unterminated string literal(3)");var a=Jh("0123456789abcdef",s);if(a<0)throw td(this._thisDoc,i,t,e,"bad string literal hex escape");o=16*o+a,r+=1}var c=String.fromCharCode(o);return new Ph([n,c])}},{key:"UEscape",value:function(t,e,i){for(var n=e,r=0,o="\\U";r<8;){var s=t.slice(n,n+1).toLowerCase();if(n+=1,""==s)throw td(this._thisDoc,i,t,e,"unterminated string literal(3)");if(Jh("0123456789abcdef",s)<0)throw td(this._thisDoc,i,t,e,"bad string literal hex escape");o+=s,r+=1}var a,c=(a="0x"+Uh(o,2,10)-0,String.fromCharCode(a));return new Ph([n,c])}}]),t}();function td(t,e,i,n,r){var o=e+1,s="Line "+o+" of <"+t+">: Bad syntax: "+r+'\nat: "'+i.slice(n,n+30)+'"',a=new SyntaxError(s,t,o);return a.lineNo=o,a.characterInFile=n,a.syntaxProblem=r,a}function ed(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function id(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?ed(Object(i),!0).forEach((function(e){ma(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ed(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var nd,rd=id(id({},Xu),{},{supports:(zh={},ma(zh,Hu.collections,!0),ma(zh,Hu.defaultGraphType,!1),ma(zh,Hu.equalsMethod,!0),ma(zh,Hu.identity,!1),ma(zh,Hu.id,!0),ma(zh,Hu.reversibleId,!1),ma(zh,Hu.variableType,!0),zh),collection:function(t){return new ec(t)},id:function(t){var e,i=this;return $a(t)?"( ".concat(t.elements.map((function(t){return i.id(t)})).join(", ")," )"):Wa(e=t)&&e.termType===Ea?qu.toString(t):Xu.id(t)},termToNQ:function(t){return t.termType===Fa?ec.toNT(t):Xu.termToNQ(t)}}),od=fe(Vs());function sd(t,e){return"string"==typeof e?t.rdfFactory.literal(e):Object.prototype.hasOwnProperty.call(e,"@list")?!0===t.rdfFactory.supports.COLLECTIONS?function(t,e){if(!Array.isArray(e))throw new TypeError("Object must be an array");return t.rdfFactory.collection(e.map((function(e){return sd(t,e)})))}(t,e["@list"]):function(t,e){var i=e["@id"]?t.rdfFactory.namedNode(e["@id"]):t.rdfFactory.blankNode(),n=e["@list"].map((function(e){return sd(t,e)})),r=vh(t.rdfFactory,i,n);return t.addAll(r),i}(t,e):Object.prototype.hasOwnProperty.call(e,"@id")?t.rdfFactory.namedNode(e["@id"]):Object.prototype.hasOwnProperty.call(e,"@language")?t.rdfFactory.literal(e["@value"],e["@language"]):Object.prototype.hasOwnProperty.call(e,"@type")?t.rdfFactory.literal(e["@value"],t.rdfFactory.namedNode(e["@type"])):Object.prototype.hasOwnProperty.call(e,"@value")?t.rdfFactory.literal(e["@value"]):t.rdfFactory.literal(e)}function ad(t,e,i,n){var r=i&&Object.prototype.hasOwnProperty.call(i,"termType")?i.value:i;return od.default.flatten(JSON.parse(t),null,{base:r}).then((function(t){return t.reduce((function(t,n){return e=cd(e,i,n)}),e)})).then(n).catch(n)}function cd(t,e,i){for(var n=i["@id"]?t.rdfFactory.namedNode(i["@id"]):t.rdfFactory.blankNode(),r=0,o=Object.keys(i);r<o.length;r++){var s=o[r];if("@id"!==s){if("@graph"==s)for(var a=n,c=i[s],l=0;l<c.length;l++)t=cd(t,a,c[l]);var u=i[s];if(Array.isArray(u))for(var h=0;h<u.length;h++)t.addStatement(ld(t,n,s,u[h],e));else t.addStatement(ld(t,n,s,u,e))}}return t}function ld(t,e,i,n,r){var o,s;return"@type"===i?(o=t.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),s=t.rdfFactory.namedNode(n)):(o=t.rdfFactory.namedNode(i),s=sd(t,n)),t.rdfFactory.quad(e,o,s,t.rdfFactory.namedNode(r))}void 0===nd&&(nd={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 ud=function(){function t(e,i){ha(this,t),this.options=i||{},this.kb=e,this.target=i.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 ua(t,[{key:"addTriple",value:function(t,e,i,n){var r,o,s,a;r=void 0===e?Xu.namedNode(this.options.base):this.toRDFNodeObject(e),s=this.toRDFNodeObject(i),o=this.toRDFNodeObject(n),a=Xu.namedNode(this.options.base),this.kb.add(r,s,o,a)}},{key:"ancestorPath",value:function(t){for(var e="";t&&t.nodeType!==nd.DOCUMENT_NODE;)e="/"+t.localName+e,t=t.parentNode;return e}},{key:"copyMappings",value:function(t){var e={};for(var i in t)e[i]=t[i];return e}},{key:"copyProperties",value:function(){}},{key:"deriveDateTimeType",value:function(e){for(var i=0;i<t.dateTimeTypes.length;i++){var n=t.dateTimeTypes[i].pattern.exec(e);if(n&&n[0].length===e.length)return t.dateTimeTypes[i].type}return null}},{key:"init",value:function(){}},{key:"newBlankNode",value:function(){return this.blankCounter++,"_:"+this.blankCounter}},{key:"newSubjectOrigin",value:function(){}},{key:"parseCURIE",value:function(e,i){var n,r=e.indexOf(":");if(r>=0){var o=e.substring(0,r);if(""===o)return(n=i[""])?n+e.substring(r+1):null;if("_"===o)return"_:"+e.substring(r+1);if(t.NCNAME.test(o)&&(n=i[o]))return n+e.substring(r+1)}return null}},{key:"parseCURIEOrURI",value:function(t,e,i){return this.parseCURIE(t,e,i)||this.resolveAndNormalize(i,t)}},{key:"parsePredicate",value:function(t,e,i,n,r,o){if(""===t)return null;var s=this.parseTermOrCURIEOrAbsURI(t,e,o?null:i,n,r);return s&&0===s.indexOf("_:")?null:s}},{key:"parsePrefixMappings",value:function(t,e){for(var i=this.tokenize(t),n=null,r=0;r<i.length;r++)":"===i[r][i[r].length-1]?n=i[r].substring(0,i[r].length-1):n&&(e[n]=this.options.base?Ju(i[r],this.options.base):i[r],n=null)}},{key:"parseSafeCURIEOrCURIEOrURI",value:function(t,e,i){return"["===(t=this.trim(t)).charAt(0)&&"]"===t.charAt(t.length-1)?0===(t=(t=t.substring(1,t.length-1)).trim(t)).length?null:"_:"===t?this.theOne:this.parseCURIE(t,e,i):this.parseCURIEOrURI(t,e,i)}},{key:"parseTermOrCURIEOrAbsURI",value:function(t,e,i,n,r){t=this.trim(t);var o=this.parseCURIE(t,n,r);if(o)return o;if(i){if(e&&!this.absURIRE.exec(t))return e+t;var s=i[t];if(s)return s;if(s=i[t.toLowerCase()])return s}return this.absURIRE.exec(t)?this.resolveAndNormalize(r,t):null}},{key:"parseTermOrCURIEOrURI",value:function(t,e,i,n,r){t=this.trim(t);var o=this.parseCURIE(t,n,r);if(o)return o;var s=i[t];return s||((s=i[t.toLowerCase()])?s:e&&!this.absURIRE.exec(t)?e+t:this.resolveAndNormalize(r,t))}},{key:"parseURI",value:function(t){return t}},{key:"process",value:function(e,i){var n;i=i||{},e.nodeType===nd.DOCUMENT_NODE?(e.baseURI&&!i.baseURI&&(i.baseURI=e.baseURI),n=e.baseURI,(e=e.documentElement).baseURI||(e.baseURI=n),this.setContext(e)):e.parentNode.nodeType===nd.DOCUMENT_NODE&&this.setContext(e);var r=[],o=function(t){if(!t&&i&&i.baseURI)return i.baseURI;var e=t.indexOf("#");return e>=0&&(t=t.substring(0,e)),i&&i.baseURIMap&&(t=i.baseURIMap(t)),t};for(r.push({current:e,context:this.push(null,o(e.baseURI))});r.length>0;){var s=r.shift();if(s.parent){if(s.context.parent&&s.context.parent.listMapping===s.listMapping)continue;for(var a in s.listMapping){var c=s.listMapping[a];if(0!==c.length){for(var l=[],u=0;u<c.length;u++)l.push(this.newBlankNode());for(var h=0;h<l.length;h++)this.addTriple(s.parent,l[h],"http://www.w3.org/1999/02/22-rdf-syntax-ns#first",c[h]),this.addTriple(s.parent,l[h],"http://www.w3.org/1999/02/22-rdf-syntax-ns#rest",{type:t.objectURI,value:h+1<l.length?l[h+1]:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"});this.addTriple(s.parent,s.subject,a,{type:t.objectURI,value:l[0]})}else this.addTriple(s.parent,s.subject,a,{type:t.objectURI,value:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"})}}else{var d=s.current,f=s.context,p=!1,v=null,g=null,m=null,w=f.prefixes,b=!1,y=[],x=f.listMapping,k=!f.parent,E=f.language,S=f.vocabulary;n=this.parseURI(o(d.baseURI)),d.item=null;var F=d.getAttributeNode("vocab");if(F){var A=this.trim(F.value);A.length>0?this.addTriple(d,n.spec,"http://www.w3.org/ns/rdfa#usesVocabulary",{type:t.objectURI,value:S=A}):S=this.vocabulary}for(var _=0;_<d.attributes.length;_++){var j=d.attributes[_];if("x"===j.nodeName.charAt(0)&&0===j.nodeName.indexOf("xmlns:")){b||(w=this.copyMappings(w),b=!0);var C=j.nodeName.substring(6),R=t.trim(j.value);w[C]=this.options.base?Ju(R,this.options.base):R}}var I=d.getAttributeNode("prefix");I&&(b||(w=this.copyMappings(w),b=!0),this.parsePrefixMappings(I.value,w));for(var T=null,O=0;!T&&O<this.langAttributes.length;O++)T=d.getAttributeNodeNS(this.langAttributes[O].namespaceURI,this.langAttributes[O].localName);if(T){var P=t.trim(T.value);E=P.length>0?P:null}var N,D,M=d.getAttributeNode("rel"),U=d.getAttributeNode("rev"),L=d.getAttributeNode("typeof"),B=d.getAttributeNode("property"),J=d.getAttributeNode("datatype"),$=this.inHTMLMode?d.getAttributeNode("datetime"):null,z=d.getAttributeNode("content"),H=d.getAttributeNode("about"),K=d.getAttributeNode("src"),W=d.getAttributeNode("resource"),q=d.getAttributeNode("href"),V=d.getAttributeNode("inlist"),G=[];if(M){D=this.tokenize(M.value);for(var X=0;X<D.length;X++)(N=this.parsePredicate(D[X],S,f.terms,w,n,this.inHTMLMode&&null!==B))&&G.push(N)}var Y=[];if(U){D=this.tokenize(U.value);for(var Z=0;Z<D.length;Z++)(N=this.parsePredicate(D[Z],S,f.terms,w,n,this.inHTMLMode&&B))&&Y.push(N)}if(this.inHTMLMode&&(M||U)&&B&&(0===G.length&&(M=null),0===Y.length&&(U=null)),M||U?(H&&(v=this.parseSafeCURIEOrCURIEOrURI(H.value,w,n)),L&&(m=v),v||(d.parentNode.nodeType===nd.DOCUMENT_NODE?v=o(d.baseURI):f.parentObject&&(v=o(d.parentNode.baseURI)===f.parentObject?o(d.baseURI):f.parentObject)),W&&(g=this.parseSafeCURIEOrCURIEOrURI(W.value,w,n)),g||(q?g=this.resolveAndNormalize(n,encodeURI(q.value)):K?g=this.resolveAndNormalize(n,encodeURI(K.value)):!L||H||this.inXHTMLMode&&("head"===d.localName||"body"===d.localName)||(g=this.newBlankNode())),!L||H||!this.inXHTMLMode||"head"!==d.localName&&"body"!==d.localName?L&&!H&&(m=g):m=v):!B||z||J?(H&&(v=this.parseSafeCURIEOrCURIEOrURI(H.value,w,n)),!v&&W&&(v=this.parseSafeCURIEOrCURIEOrURI(W.value,w,n)),!v&&q&&(v=this.resolveAndNormalize(n,encodeURI(q.value))),!v&&K&&(v=this.resolveAndNormalize(n,encodeURI(K.value))),v||(d.parentNode.nodeType===nd.DOCUMENT_NODE?v=o(d.baseURI):!this.inXHTMLMode&&!this.inHTMLMode||"head"!==d.localName&&"body"!==d.localName?L?v=this.newBlankNode():f.parentObject&&(v=o(d.parentNode.baseURI)===f.parentObject?o(d.baseURI):f.parentObject,B||(p=!0)):v=o(d.parentNode.baseURI)===f.parentObject?o(d.baseURI):f.parentObject),L&&(m=v)):(H&&(v=this.parseSafeCURIEOrCURIEOrURI(H.value,w,n),L&&(m=v)),v||d.parentNode.nodeType!==nd.DOCUMENT_NODE?!v&&f.parentObject&&(v=o(d.parentNode.baseURI)===f.parentObject?o(d.baseURI):f.parentObject):(v=o(d.baseURI),L&&(m=v)),L&&!m&&(W&&(m=this.parseSafeCURIEOrCURIEOrURI(W.value,w,n)),!m&&q&&(m=this.resolveAndNormalize(n,encodeURI(q.value))),!m&&K&&(m=this.resolveAndNormalize(n,encodeURI(K.value))),m||!this.inXHTMLMode&&!this.inHTMLMode||"head"!==d.localName&&"body"!==d.localName||(m=v),m||(m=this.newBlankNode()),g=m)),v&&(H||W||m)){var Q=v;L&&!H&&!W&&g&&(Q=g),this.newSubjectOrigin(d,Q)}if(m){D=this.tokenize(L.value);for(var tt=0;tt<D.length;tt++){var et=this.parseTermOrCURIEOrAbsURI(D[tt],S,f.terms,w,n);et&&this.addTriple(d,m,t.typeURI,{type:t.objectURI,value:et})}}if(v&&v!==f.parentObject&&(x={},k=!0),g){if(M&&V)for(var it=0;it<G.length;it++){var nt=x[G[it]];nt||(x[G[it]]=nt=[]),nt.push({type:t.objectURI,value:g})}else if(M)for(var rt=0;rt<G.length;rt++)this.addTriple(d,v,G[rt],{type:t.objectURI,value:g});if(U)for(var ot=0;ot<Y.length;ot++)this.addTriple(d,g,Y[ot],{type:t.objectURI,value:v})}else{if(v&&!g&&(M||U)&&(g=this.newBlankNode()),M&&V)for(var st=0;st<G.length;st++){var at=x[G[st]];at||(x[N]=at=[]),y.push({predicate:G[st],list:at})}else if(M)for(var ct=0;ct<G.length;ct++)y.push({predicate:G[ct],forward:!0});if(U)for(var lt=0;lt<Y.length;lt++)y.push({predicate:Y[lt],forward:!1})}if(B){var ut=null,ht=null;J?(ut=""===J.value?t.PlainLiteralURI:this.parseTermOrCURIEOrAbsURI(J.value,S,f.terms,w,n),ht=$&&!z?$.value:ut===t.XMLLiteralURI||ut===t.HTMLLiteralURI?null:z?z.value:d.textContent):z?(ut=t.PlainLiteralURI,ht=z.value):$?(ut=t.deriveDateTimeType(ht=$.value))||(ut=t.PlainLiteralURI):M||U||(W&&(ht=this.parseSafeCURIEOrCURIEOrURI(W.value,w,n)),!ht&&q?ht=this.resolveAndNormalize(n,encodeURI(q.value)):!ht&&K&&(ht=this.resolveAndNormalize(n,encodeURI(K.value))),ht&&(ut=t.objectURI)),ut||(L&&!H?(ut=t.objectURI,ht=m):(ht=d.textContent,this.inHTMLMode&&"time"===d.localName&&(ut=t.deriveDateTimeType(ht)),ut||(ut=t.PlainLiteralURI))),D=this.tokenize(B.value);for(var dt=0;dt<D.length;dt++){var ft=this.parsePredicate(D[dt],S,f.terms,w,n);if(ft)if(V){var pt=x[ft];pt||(x[ft]=pt=[]),pt.push(ut===t.XMLLiteralURI||ut===t.HTMLLiteralURI?{type:ut,value:d.childNodes}:{type:ut||t.PlainLiteralURI,value:ht,language:E})}else this.addTriple(d,v,ft,ut===t.XMLLiteralURI||ut===t.HTMLLiteralURI?{type:ut,value:d.childNodes}:{type:ut||t.PlainLiteralURI,value:ht,language:E})}}if(v&&!p)for(var vt=0;vt<f.incomplete.length;vt++)f.incomplete[vt].list?f.incomplete[vt].list.push({type:t.objectURI,value:v}):f.incomplete[vt].forward?this.addTriple(d,f.subject,f.incomplete[vt].predicate,{type:t.objectURI,value:v}):this.addTriple(d,v,f.incomplete[vt].predicate,{type:t.objectURI,value:f.subject});var gt=null,mt=v;p?((gt=this.push(f,f.subject)).parentObject=o(d.parentNode.baseURI)===f.parentObject?o(d.baseURI):f.parentObject,gt.incomplete=f.incomplete,gt.language=E,gt.prefixes=w,gt.vocabulary=S):((gt=this.push(f,v)).parentObject=g||v||f.subject,gt.prefixes=w,gt.incomplete=y,g&&(mt=g,x={},k=!0),gt.listMapping=x,gt.language=E,gt.vocabulary=S),k&&r.unshift({parent:d,context:f,subject:mt,listMapping:x});for(var wt=d.lastChild;wt;wt=wt.previousSibling)wt.nodeType===nd.ELEMENT_NODE&&r.unshift({current:wt,context:gt})}}this.inHTMLMode&&this.copyProperties();for(var bt=0;bt<this.finishedHandlers.length;bt++)this.finishedHandlers[bt](e)}},{key:"push",value:function(t,e){return{parent:t,subject:e||(t?t.subject:null),parentObject:null,incomplete:[],listMapping:t?t.listMapping:{},language:t?t.language:this.language,prefixes:t?t.prefixes:this.target.graph.prefixes,terms:t?t.terms:this.target.graph.terms,vocabulary:t?t.vocabulary:this.vocabulary}}},{key:"resolveAndNormalize",value:function(t,e){return Ju(e,t)}},{key:"setContext",value:function(t){"html"===t.localName&&"XHTML+RDFa 1.1"===t.getAttribute("version")?this.setXHTMLContext():"html"===t.localName||"http://www.w3.org/1999/xhtml"===t.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(t){return this.trim(t).split(/\s+/)}},{key:"toRDFNodeObject",value:function(e){var i=this;if(void 0!==e){if("string"==typeof e)return"_:"===e.substring(0,2)?(void 0===this.blankNodes[e.substring(2)]&&(this.blankNodes[e.substring(2)]=new Ua(e.substring(2))),this.blankNodes[e.substring(2)]):Xu.namedNode(e);switch(e.type){case t.objectURI:return"_:"===e.value.substring(0,2)?(void 0===this.blankNodes[e.value.substring(2)]&&(this.blankNodes[e.value.substring(2)]=new Ua(e.value.substring(2))),this.blankNodes[e.value.substring(2)]):Xu.namedNode(e.value);case t.PlainLiteralURI:return new Qa(e.value,e.language||"");case t.XMLLiteralURI:case t.HTMLLiteralURI:var n="";return Object.keys(e.value).forEach((function(t){n+=rh(e.value[t],i.htmlOptions)})),new Qa(n,"",new Ya(e.type));default:return new Qa(e.value,"",new Ya(e.type))}}}},{key:"trim",value:function(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}}],[{key:"parseRDFaDOM",value:function(e,i,n){var r=new t(i,{base:n});e.baseURI||(e.baseURI=n),r.process(e,{baseURI:n})}},{key:"tokenize",value:function(t){return this.trim(t).split(/\s+/)}},{key:"trim",value:function(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}}]),t}();ud.XMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral",ud.HTMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML",ud.PlainLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral",ud.objectURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#object",ud.typeURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",ud.nameChar="[-A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�က0-F.0-9·̀-ͯ‿-⁀]",ud.nameStartChar="[A-Za-zÀ-ÖØ-öø-ÿĀ-ıĴ-ľŁ-ňŊ-žƀ-ǃǍ-ǰǴ-ǵǺ-ȗɐ-ʨʻ-ˁΆΈ-ΊΌΎ-ΡΣ-ώϐ-ϖϚϜϞϠϢ-ϳЁ-ЌЎ-яё-ќў-ҁҐ-ӄӇ-ӈӋ-ӌӐ-ӫӮ-ӵӸ-ӹԱ-Ֆՙա-ֆא-תװ-ײء-غف-يٱ-ڷں-ھۀ-ێې-ۓەۥ-ۦअ-हऽक़-ॡঅ-ঌএ-ঐও-নপ-রলশ-হড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઋઍએ-ઑઓ-નપ-રલ-ળવ-હઽૠଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଶ-ହଽଡ଼-ଢ଼ୟ-ୡஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-வஷ-ஹఅ-ఌఎ-ఐఒ-నప-ళవ-హౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹൠ-ൡก-ฮะา-ำเ-ๅກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ຮະາ-ຳຽເ-ໄཀ-ཇཉ-ཀྵႠ-Ⴥა-ჶᄀᄂ-ᄃᄅ-ᄇᄉᄋ-ᄌᄎ-ᄒᄼᄾᅀᅌᅎᅐᅔ-ᅕᅙᅟ-ᅡᅣᅥᅧᅩᅭ-ᅮᅲ-ᅳᅵᆞᆨᆫᆮ-ᆯᆷ-ᆸᆺᆼ-ᇂᇫᇰᇹḀ-ẛẠ-ỹἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼΩK-Å℮ↀ-ↂぁ-ゔァ-ヺㄅ-ㄬ가-힣一-龥〇〡-〩_]",ud.NCNAME=new RegExp("^"+ud.nameStartChar+ud.nameChar+"*$"),ud.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 hd=ud.parseRDFaDOM,dd=function(){function t(e){ha(this,t),this.store=e,this.bnodes={},this.why=null,this.reify=!1}return ua(t,[{key:"frameFactory",value:function(e,i,n){return{NODE:1,ARC:2,parent:i,parser:e,store:e.store,element:n,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(t,e){e=Ju(e,this.base),this.node=this.store.sym(e),this.nodeType=t},loadTriple:function(){if(this.parent.parent.collection?this.parent.parent.node.append(this.node):this.store.add(this.parent.parent.node,this.parent.node,this.node,this.parser.why),null!=this.parent.rdfid){var e=this.store.sym(Ju("#"+this.parent.rdfid,this.base));this.store.add(e,this.store.sym(t.ns.RDF+"type"),this.store.sym(t.ns.RDF+"Statement"),this.parser.why),this.store.add(e,this.store.sym(t.ns.RDF+"subject"),this.parent.parent.node,this.parser.why),this.store.add(e,this.store.sym(t.ns.RDF+"predicate"),this.parent.node,this.parser.why),this.store.add(e,this.store.sym(t.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(t){this.addSymbol(this.NODE,t),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(t){this.node=null!=t?null!=this.parser.bnodes[t]?this.parser.bnodes[t]:this.parser.bnodes[t]=this.store.bnode():this.store.bnode(),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()},addArc:function(e){e===t.ns.RDF+"li"&&(e=t.ns.RDF+"_"+this.parent.listIndex,this.parent.listIndex++),this.addSymbol(this.ARC,e)},addLiteral:function(e){this.node=this.store.literal(e,this.parent.datatype&&this.parent.datatype!==t.ns.RDF+"langString"?this.store.sym(this.parent.datatype):this.lang),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()}}}},{key:"getAttributeNodeNS",value:function(t,e,i){var n=null;if(t.getAttributeNodeNS)n=t.getAttributeNodeNS(e,i);else for(var r,o=t.attributes,s=0;s<o.length;++s)if((r=o[s]).namespaceURI===e&&(r.prefix?r.prefix+":"+i:i)===r.nodeName){n=r;break}return n}},{key:"parse",value:function(e,i,n){var r,o=e.childNodes;if(this.cleanParser(),e.nodeType===t.nodeType.DOCUMENT){for(var s=0;s<o.length;s++)if(o[s].nodeType===t.nodeType.ELEMENT){r=o[s];break}}else{if(e.nodeType!==t.nodeType.ELEMENT)throw new Error("RDFParser: can't find root in "+i+". Halting. ");r=e}this.why=n;var a=this.frameFactory(this);return this.base=i,a.base=i,a.lang=null,this.parseDOM(this.buildFrame(a,r)),!0}},{key:"parseDOM",value:function(e){for(var i,n=function(t){var e="";if(null==t.namespaceURI)throw new Error("RDF/XML syntax error: No namespace for "+t.localName+" in "+this.base);return t.namespaceURI&&(e+=t.namespaceURI),t.localName?e+=t.localName:t.nodeName&&(t.nodeName.indexOf(":")>=0?e+=t.nodeName.split(":")[1]:e+=t.nodeName),e}.bind(this),r=!0;e.parent;){var o=e.element,s=o.attributes;if(o.nodeType===t.nodeType.TEXT||o.nodeType===t.nodeType.CDATA_SECTION)e.parent.nodeType===e.NODE&&(e.addArc(t.ns.RDF+"value"),e=this.buildFrame(e)),e.addLiteral(o.nodeValue);else if(n(o)!==t.ns.RDF+"RDF")if(e.parent&&e.parent.collection&&(e.addCollectionArc(),(e=this.buildFrame(e,e.element)).parent.element=null),e.parent&&e.parent.nodeType&&e.parent.nodeType!==e.ARC){e.addArc(n(o)),this.reify&&(i=this.getAttributeNodeNS(o,t.ns.RDF,"ID"))&&(e.rdfid=i.nodeValue,o.removeAttributeNode(i));var a=this.getAttributeNodeNS(o,t.ns.RDF,"parseType"),c=this.getAttributeNodeNS(o,t.ns.RDF,"datatype");if(c&&(e.datatype=c.nodeValue,o.removeAttributeNode(c)),a){var l=a.nodeValue;"Literal"===l?(e.datatype=t.ns.RDF+"XMLLiteral",(e=this.buildFrame(e)).addLiteral(o.childNodes),r=!1):"Resource"===l?((e=this.buildFrame(e,e.element)).parent.element=null,e.addBNode()):"Collection"===l&&((e=this.buildFrame(e,e.element)).parent.element=null,e.addCollection()),o.removeAttributeNode(a)}if(0!==s.length){var u=this.getAttributeNodeNS(o,t.ns.RDF,"resource"),h=this.getAttributeNodeNS(o,t.ns.RDF,"nodeID");e=this.buildFrame(e),u?(e.addNode(u.nodeValue),o.removeAttributeNode(u)):h?(e.addBNode(h.nodeValue),o.removeAttributeNode(h)):e.addBNode();for(var d=s.length-1;d>=0;d--){var f=this.buildFrame(e);f.addArc(n(s[d])),n(s[d])===t.ns.RDF+"type"?this.buildFrame(f).addNode(s[d].nodeValue):this.buildFrame(f).addLiteral(s[d].nodeValue)}}else 0===o.childNodes.length&&this.buildFrame(e).addLiteral("")}else{var p=this.getAttributeNodeNS(o,t.ns.RDF,"about");if(i=this.getAttributeNodeNS(o,t.ns.RDF,"ID"),p&&i)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(!p&&i)e.addNode("#"+i.nodeValue),o.removeAttributeNode(i);else if(null==p&&null==i){var v=this.getAttributeNodeNS(o,t.ns.RDF,"nodeID");v?(e.addBNode(v.nodeValue),o.removeAttributeNode(v)):e.addBNode()}else e.addNode(p.nodeValue),o.removeAttributeNode(p);var g=this.getAttributeNodeNS(o,t.ns.RDF,"type");t.ns.RDF+"Description"!==n(o)&&(g={nodeValue:n(o)}),null!=g&&(this.store.add(e.node,this.store.sym(t.ns.RDF+"type"),this.store.sym(Ju(g.nodeValue,e.base)),this.why),g.nodeName&&o.removeAttributeNode(g));for(var m=s.length-1;m>=0;m--)this.store.add(e.node,this.store.sym(n(s[m])),this.store.literal(s[m].nodeValue,e.lang),this.why)}for(o=e.element;e.parent;){for(var w=e;null==o;)o=(e=e.parent).element;var b=o.childNodes&&o.childNodes[e.lastChild];if(b&&r){if((b.nodeType===t.nodeType.ELEMENT||b.nodeType===t.nodeType.TEXT||b.nodeType===t.nodeType.CDATA_SECTION)&&(b.nodeType!==t.nodeType.TEXT&&b.nodeType!==t.nodeType.CDATA_SECTION||1===o.childNodes.length)){e.lastChild++,e=this.buildFrame(w,o.childNodes[e.lastChild-1]);break}e.lastChild++}else{if(e.terminateFrame(),!(e=e.parent))break;o=e.element,r=!0}}}}},{key:"cleanParser",value:function(){this.bnodes={},this.why=null}},{key:"buildFrame",value:function(e,i){var n=this.frameFactory(this,e,i);if(e&&(n.base=e.base,n.lang=e.lang),!i||i.nodeType===t.nodeType.TEXT||i.nodeType===t.nodeType.CDATA_SECTION)return n;var r=i.attributes,o=i.getAttributeNode("xml:base");null!=o&&(n.base=o.nodeValue,i.removeAttribute("xml:base"));var s=i.getAttributeNode("xml:lang");null!=s&&(n.lang=s.nodeValue,i.removeAttribute("xml:lang"));for(var a=r.length-1;a>=0;a--)if("xml"===r[a].nodeName.substr(0,3)){if("xmlns:"===r[a].name.slice(0,6)){var c=r[a].nodeValue;this.base&&(c=Ju(c,this.base)),this.store.setPrefixForURI(r[a].name.slice(6),c)}i.removeAttributeNode(r[a])}return n}}]),t}();function fd(t,e,i){var n,r,o,s=["INSERT","DELETE","WHERE"],a=eh("http://www.w3.org/ns/pim/patch#"),c=Zh(e,e,i,i,null,null,"",null),l={},u=function(t,e,i,n,r){return"Line "+(e+1)+" of <"+t+">: Bad syntax:\n "+r+'\n at: "'+i.slice(n,n+30)+'"'};n=0;var h=e.sym(i+"#query");for(l.query=h;;){if((r=c.skipSpace(t,n))<0)return l;if(";"===t[r]){if((n=c.skipSpace(t,r+1))<0)return l;r=n}var d=!1;for(o=0;o<s.length;o++){var f=s[o];if(t.slice(r,r+f.length)===f){if((n=c.skipSpace(t,r+f.length))<0)throw u(c._thisDoc,c.lines,t,r+f.length,"found EOF, needed {...} after "+f);if(("INSERT"===f||"DELETE"===f)&&"DATA"===t.slice(n,n+4)){if((r=c.skipSpace(t,n+4))<0)throw u(c._thisDoc,c.lines,t,n+4,"needed {...} after INSERT DATA "+f);n=r}var p=[];if((r=c.node(t,n,p))<0)throw u(c._thisDoc,c.lines,t,n,"bad syntax or EOF in {...} after "+f);l[f.toLowerCase()]=p[0],e.add(h,a(f.toLowerCase()),p[0]),d=!0,n=r}}if(!d&&"@prefix"===t.slice(r,r+7)){if((n=c.directive(t,r))<0)throw u(c._thisDoc,c.lines,t,n,"bad syntax or EOF after @prefix ");n=c.checkDot(t,n),d=!0}if(!d)throw u(c._thisDoc,c.lines,t,r,"Unknown syntax at start of statememt: '"+t.slice(r).slice(0,20)+"'")}}function pd(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"text/turtle",r=arguments.length>4?arguments[4]:void 0;n=(n=n||Da).split(";")[0];try{if(n===Ra||n===Da){var o=Zh(e,e,i,i,null,null,"",null);o.loadBuf(t),c()}else if(n===Oa){var s=new dd(e);s.parse(ah(t),i,e.sym(i)),c()}else if(n===Ma)hd(ah(t,{contentType:Ma}),e,i),c();else if(n===ja)hd(ah(t,{contentType:ja}),e,i),c();else if(n===Pa||n===Na)fd(t,e,i),c();else if(n===Ca)ad(t,e,i,c);else{if(n!==Ta&&n!==Ia)throw void 0===n?new Error("contentType is undefined"):new Error("Don't know how to parse "+n+" yet");var a=new mu({factory:rd});u(null,t)}}catch(t){l(t)}function c(){r&&r(null,e)}function l(t){if(n!==Ca||n!==Ta||n!==Ia){if(!r){var o=new Error(t+" while trying to parse <"+i+"> as "+n);throw o.cause=t,o}r(t,e)}}function u(t,i){t&&r(t,e);try{a.parse(i,h)}catch(t){r(t,e)}}function h(t,i){i?e.add(i.subject,i.predicate,i.object,i.graph):r(t,e)}pd.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}}ma(dd,"ns",{RDF:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",RDFS:"http://www.w3.org/2000/01/rdf-schema#"}),ma(dd,"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 vd=fe(ge());function gd(t){var e=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(t){return!1}}();return function(){var i,n=ga(t);if(e){var r=ga(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return va(this,i)}}var md={"text/n3":!0,"text/turtle":!0,"application/rdf+xml":!0,"application/xhtml+xml":!0,"text/html":!0,"application/ld+json":!0},wd={rdf:Oa,owl:Oa,n3:"text/n3",ttl:"text/turtle",nt:"text/n3",acl:"text/n3",html:"text/html",xml:"text/xml"},bd=function(t){return{link:eh("http://www.w3.org/2007/ont/link#",t),http:eh("http://www.w3.org/2007/ont/http#",t),httph:eh("http://www.w3.org/2007/ont/httph#",t),rdf:eh("http://www.w3.org/1999/02/22-rdf-syntax-ns#",t),rdfs:eh("http://www.w3.org/2000/01/rdf-schema#",t),dc:eh("http://purl.org/dc/elements/1.1/",t),ldp:eh("http://www.w3.org/ns/ldp#",t)}},yd=bd(),xd=ua((function t(e,i){ha(this,t),ma(this,"response",void 0),ma(this,"dom",void 0),this.response=e,this.dom=i}));ma(xd,"pattern",void 0);var kd=function(){pa(e,xd);var t=gd(e);function e(){return ha(this,e),t.apply(this,arguments)}return ua(e,[{key:"parse",value:function(t,e,i){var n=t.store;if(this.dom||(this.dom=ah(e)),"parsererror"===this.dom.documentElement.nodeName)return t.failFetch(i,"Badly formed XML in "+i.resource.value,"parse_error");var r=new dd(n);try{r.parse(this.dom,i.original.value,i.original)}catch(e){return t.failFetch(i,"Syntax error parsing RDF/XML! "+e,"parse_error")}return i.noMeta||n.add(i.original,yd.rdf("type"),yd.link("RDFDocument"),t.appNode),t.doneFetch(i,this.response)}}],[{key:"toString",value:function(){return"RDFXMLHandler"}},{key:"register",value:function(t){t.mediatypes[Oa]={q:.9}}}]),e}();kd.pattern=new RegExp("application/rdf\\+xml");var Ed=function(){pa(e,xd);var t=gd(e);function e(){return ha(this,e),t.apply(this,arguments)}return ua(e,[{key:"parse",value:function(t,e,i){var n,r;this.dom||(this.dom=ah(e));var o=t.store,s=this.dom.getElementsByTagName("title");s.length>0&&o.add(i.resource,yd.dc("title"),o.rdfFactory.literal(s[0].textContent),i.resource);for(var a=this.dom.getElementsByTagName("link"),c=a.length-1;c>=0;c--)r=!1,(n=a[c].getAttribute("rel"))||(n=a[c].getAttribute("rev"),r=!0),n&&t.linkData(i.original,n,a[c].getAttribute("href"),i.resource,r);for(var l=this.dom.getElementsByTagName("script"),u=0;u<l.length;u++){var h=l[u].getAttribute("type");md[h]&&(pd(l[u].textContent,o,i.original.value,h),pd(l[u].textContent,o,i.original.value,h))}if(i.noMeta||o.add(i.resource,yd.rdf("type"),yd.link("WebPage"),t.appNode),!i.noRDFa&&hd)try{hd(this.dom,o,i.original.value)}catch(e){return t.failFetch(i,"Error trying to parse "+i.resource+" as RDFa:\n"+e+":\n"+e.stack,"parse_error")}return t.doneFetch(i,this.response)}}],[{key:"toString",value:function(){return"XHTMLHandler"}},{key:"register",value:function(t){t.mediatypes[Ma]={}}}]),e}();Ed.pattern=new RegExp("application/xhtml");var Sd=function(){pa(e,xd);var t=gd(e);function e(){return ha(this,e),t.apply(this,arguments)}return ua(e,[{key:"parse",value:function(t,i,n){for(var r=ah(i),o=0;o<r.childNodes.length;o++){var s=r.childNodes[o];if(e.isElement(s)){var a=s.namespaceURI;if(a&&a===a.rdf)return t.addStatus(n.req,"Has XML root element in the RDF namespace, so assume RDF/XML."),new kd(this.response,r).parse(t,i,n);break}}if(r.doctype&&"html"===r.doctype.name&&r.doctype.publicId.match(/^-\/\/W3C\/\/DTD XHTML/)&&r.doctype.systemId.match(/http:\/\/www.w3.org\/TR\/xhtml/))return t.addStatus(n.req,"Has XHTML DOCTYPE. Switching to XHTML Handler.\n"),new Ed(this.response,r).parse(t,i,n);var c=r.getElementsByTagName("html")[0];if(c){var l=c.getAttribute("xmlns");if(l&&l.match(/^http:\/\/www.w3.org\/1999\/xhtml/))return t.addStatus(n.req,"Has a default namespace for XHTML. Switching to XHTMLHandler.\n"),new Ed(this.response,r).parse(t,i,n)}return t.failFetch(n,"Unsupported dialect of XML: not RDF or XHTML namespace, etc.\n"+i.slice(0,80),901)}}],[{key:"toString",value:function(){return"XMLHandler"}},{key:"register",value:function(t){t.mediatypes["text/xml"]={q:.5},t.mediatypes["application/xml"]={q:.5}}},{key:"isElement",value:function(t){return t.nodeType===Node.ELEMENT_NODE}}]),e}();Sd.pattern=new RegExp("(text|application)/(.*)xml");var Fd=function(){pa(e,xd);var t=gd(e);function e(){return ha(this,e),t.apply(this,arguments)}return ua(e,[{key:"parse",value:function(t,e,i){var n=t.store;if(Rd(e))return t.addStatus(i.req,"Has an XML declaration. We'll assume it's XHTML as the content-type was text/html.\n"),new Ed(this.response).parse(t,e,i);if(function(t){var e=t.indexOf("<!DOCTYPE html"),i=t.indexOf(">");return!(-1===e||-1===i||e>i)&&-1!==t.substr(e,i-e).indexOf("XHTML")}(e))return t.addStatus(i.req,"Has XHTML DOCTYPE. Switching to XHTMLHandler.\n"),new Ed(this.response).parse(t,e,i);if(function(t){return!!t.match(/[^(<html)]*<html\s+[^<]*xmlns=['"]http:\/\/www.w3.org\/1999\/xhtml["'][^<]*>/)}(e))return t.addStatus(i.req,"Has default namespace for XHTML, so switching to XHTMLHandler.\n"),new Ed(this.response).parse(t,e,i);var r=new RegExp("<title>([\\s\\S]+?)</title>","im").exec(e);return r&&n.add(i.resource,yd.dc("title"),n.rdfFactory.literal(r[1]),i.resource),n.add(i.resource,yd.rdf("type"),yd.link("WebPage"),t.appNode),t.addStatus(i.req,"non-XML HTML document, not parsed for data."),t.doneFetch(i,this.response)}}],[{key:"toString",value:function(){return"HTMLHandler"}},{key:"register",value:function(t){t.mediatypes["text/html"]={q:.9}}}]),e}();Fd.pattern=new RegExp("text/html");var Ad=function(){pa(e,xd);var t=gd(e);function e(){return ha(this,e),t.apply(this,arguments)}return ua(e,[{key:"parse",value:function(t,e,i,n){var r=t.store;return new Promise((function(o){try{ad(e,r,i.original.value,(function(){o(t.doneFetch(i,n))}))}catch(e){o(t.failFetch(i,"Error trying to parse "+i.resource+" as JSON-LD:\n"+e,"parse_error",n))}}))}}],[{key:"toString",value:function(){return"JsonLdHandler"}},{key:"register",value:function(t){t.mediatypes["application/ld+json"]={q:.9}}}]),e}();Ad.pattern=/application\/ld\+json/;var _d=function(){pa(e,xd);var t=gd(e);function e(){return ha(this,e),t.apply(this,arguments)}return ua(e,[{key:"parse",value:function(t,e,i){return Rd(e)?(t.addStatus(i.req,"Warning: "+i.resource+" has an XML declaration. We'll assume it's XML but its content-type wasn't XML.\n"),new Sd(this.response).parse(t,e,i)):e.slice(0,500).match(/xmlns:/)?(t.addStatus(i.req,"May have an XML namespace. We'll assume it's XML but its content-type wasn't XML.\n"),new Sd(this.response).parse(t,e,i)):(t.addStatus(i.req,"Plain text document, no known RDF semantics."),t.doneFetch(i,this.response))}}],[{key:"toString",value:function(){return"TextHandler"}},{key:"register",value:function(t){t.mediatypes["text/plain"]={q:.5}}}]),e}();_d.pattern=new RegExp("text/plain");var jd=function(){pa(e,xd);var t=gd(e);function e(){return ha(this,e),t.apply(this,arguments)}return ua(e,[{key:"parse",value:function(t,e,i,n){var r=t.store,o=Zh(r,r,i.original.value,i.original.value,null,null,"",null);try{o.loadBuf(e)}catch(e){return t.failFetch(i,"Error trying to parse "+i.resource+" as Notation3:\n"+e,"parse_error",n)}return t.addStatus(i.req,"N3 parsed: "+o.statementCount+" triples in "+o.lines+" lines."),t.store.add(i.original,yd.rdf("type"),yd.link("RDFDocument"),t.appNode),t.doneFetch(i,this.response)}}],[{key:"toString",value:function(){return"N3Handler"}},{key:"register",value:function(t){t.mediatypes["text/n3"]={q:"1.0"},t.mediatypes["text/turtle"]={q:1}}}]),e}();jd.pattern=new RegExp("(application|text)/(x-)?(rdf\\+)?(n3|turtle)");var Cd={RDFXMLHandler:kd,XHTMLHandler:Ed,XMLHandler:Sd,HTMLHandler:Fd,TextHandler:_d,N3Handler:jd,JsonLdHandler:Ad};function Rd(t){return!!t.match(/\s*<\?xml\s+version\s*=[^<>]+\?>/)}var Id=function(){function t(e){var i=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(ha(this,t),ma(this,"store",void 0),ma(this,"timeout",void 0),ma(this,"_fetch",void 0),ma(this,"mediatypes",void 0),ma(this,"appNode",void 0),ma(this,"requested",void 0),ma(this,"timeouts",void 0),ma(this,"redirectedTo",void 0),ma(this,"fetchQueue",void 0),ma(this,"fetchCallbacks",void 0),ma(this,"nonexistent",void 0),ma(this,"lookedUp",void 0),ma(this,"handlers",void 0),ma(this,"ns",void 0),ma(this,"fireCallbacks",void 0),this.store=e||new Th,this.ns=bd(this.store.rdfFactory),this.timeout=n.timeout||3e4,this._fetch=n.fetch||"undefined"!=typeof global&&(global.solidFetcher||global.solidFetch)||"undefined"!=typeof window&&(window.solidFetcher||window.solidFetch)||vd.default,!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}},nh(this,["request","fail","refresh","retract","done"]),Object.keys(n.handlers||Cd).map((function(t){return i.addHandler(Cd[t])}))}var e,i;return ua(t,[{key:"load",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(i=Object.assign({},i),t instanceof Array)return Promise.all(t.map((function(t){return e.load(t,Object.assign({},i))})));var n=t,r=La(n);r=r.split("#")[0],i=this.initFetchOptions(r,i);var o=this.initFetchOptions(r,i);return this.pendingFetchPromise(r,o.baseURI,o)}},{key:"pendingFetchPromise",value:function(t,e,i){var n,r=this;return!i.force&&this.fetchQueue[e]?n=this.fetchQueue[e]:(n=Promise.race([this.setRequestTimeout(t,i),this.fetchUri(t,i)]),this.fetchQueue[e]=n,this.cleanupFetchRequest(e,void 0,this.timeout)),n.then((function(e){return t in r.timeouts&&(r.timeouts[t].forEach(clearTimeout),delete r.timeouts[t]),e}))}},{key:"cleanupFetchRequest",value:function(t,e,i){var n=this;void 0!==e&&console.warn("_options is deprecated"),this.timeouts[t]=(this.timeouts[t]||[]).concat(setTimeout((function(){n.isPending(t)||delete n.fetchQueue[t]}),i))}},{key:"initFetchOptions",value:function(e,i){var n=this.store;!i.method||"GET"===i.method.toUpperCase()||(i.force=!0),i.resource=n.rdfFactory.namedNode(e),i.baseURI=i.baseURI||e,i.original=n.rdfFactory.namedNode(i.baseURI),i.req=n.bnode(),i.headers=i.headers||new vd.Headers,i.contentType&&(i.headers["content-type"]=i.contentType),i.force&&(i.cache="no-cache");var r=this.acceptString();i.headers.accept=r;var o=t.offlineOverride(e);i.requestedURI=o,t.setCredentials(o,i);var s=t.proxyIfNecessary(o);return o!==s&&(i.proxyUsed=!0),i.actualProxyURI=s,i}},{key:"fetchUri",value:function(e,i){var n=this;if(!e)return Promise.reject(new Error("Cannot fetch an empty uri"));if(t.unsupportedProtocol(e))return this.failFetch(i,"fetcher: Unsupported protocol","unsupported_protocol");var r=this.getState(e);if(i.force)delete this.nonexistent[e];else{if("fetched"===r)return Promise.resolve(this.doneFetch(i,{status:200,ok:!0,statusText:"Already loaded into quadstore."}));if("failed"===r&&404===this.requested[e]){var o="Previously failed: "+this.requested[e],s={url:e,status:this.requested[e],statusText:o,responseText:o,headers:new vd.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return this.failFetch(i,o,this.requested[e],s)}}this.fireCallbacks("request",[e]),this.requested[e]=!0,i.noMeta||this.saveRequestMetadata(e,i);var a=i.actualProxyURI;return this._fetch(a,i).then((function(t){return n.handleResponse(t,e,i)}),(function(t){var r={url:a,status:999,statusText:(t.name||"network failure")+": "+(t.errno||t.code||t.type),responseText:t.message,headers:new vd.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return console.log("Fetcher: <"+a+"> Non-HTTP fetch exception: "+t),n.handleError(r,e,i)}))}},{key:"nowOrWhenFetched",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=La(t);"function"==typeof e?i=e:void 0===e||(Ga(e)?n.referringTerm=e:n=e),this.load(r,n).then((function(t){if(i)if(t)if(t.ok)i(!0,"OK",t);else{var e="HTTP error: Status "+t.status+" ("+t.statusText+")";t.responseText&&(e+=" "+t.responseText),console.log(e+" fetching "+r),i(!1,e,t)}else{var n="@@ nowOrWhenFetched: no response object!";console.log(n),i(!1,n)}}),(function(t){var e=t.message||t.statusText;e="Failed to load <"+r+"> "+e,console.log(e),t.response&&t.response.status&&(e+=" status: "+t.response.status),i(!1,e,t.response)}))}},{key:"addStatus",value:function(t,e){var i=new Date;e="["+i.getHours()+":"+i.getMinutes()+":"+i.getSeconds()+"."+i.getMilliseconds()+"] "+e;var n=this.store,r=n.the(t,this.ns.link("status"));$a(r)?r.append(n.rdfFactory.literal(e)):Zu("web.js: No list to add to: "+r+","+e)}},{key:"failFetch",value:function(t,e,i,n){this.addStatus(t.req,e),t.noMeta||this.store.add(t.original,this.ns.link("error"),this.store.rdfFactory.literal(e));var r=(t.method||"GET").toUpperCase();("GET"===r||"HEAD"===r)&&(t.resource.equals(t.original),this.requested[Uu(t.original.value)]=i,this.fireCallbacks("fail",[t.original.value,e]));var o=new Error("Fetcher: "+e);return o.status=i,o.statusText=e,o.response=n,Promise.reject(o)}},{key:"linkData",value:function(t,e,i,n,r){if(i){var o,s=this.store,a=s.rdfFactory.namedNode(Ju(i,t.value));if("alternate"===e||"seeAlso"===e||"meta"===e||"describedby"===e){if(a.value===t.value)return;o=this.ns.rdfs("seeAlso")}else o=s.rdfFactory.namedNode("type"===e?"http://www.w3.org/1999/02/22-rdf-syntax-ns#type":Ju(encodeURIComponent(e),"http://www.iana.org/assignments/link-relations/"));r?s.add(a,o,t,n):s.add(t,o,a,n)}}},{key:"parseLinkHeader",value:function(t,e,i){if(t){var n=/[^\(\)<>@,;:"\/\[\]\?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*"))/g,r=t.match(/<[^>]*>\s*(\s*;\s*[^()<>@,;:"/[\]?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*")))*(,|$)/g);if(null!=r)for(var o=0;o<r.length;o++){var s=r[o].split(">"),a=s[0].substring(1),c=s[1].match(n);if(null==c)return;for(var l=0;l<c.length;l++){var u=c[l].split("=")[1].replace(/["']/g,"");this.linkData(e,u,a,i)}}}}},{key:"doneFetch",value:function(t,e){return this.addStatus(t.req,"Done."),this.requested[t.original.value]="done",this.fireCallbacks("done",[t.original.value]),e.req=t.req,e}},{key:"nowKnownAs",value:function(t,e){this.lookedUp[t.value]?this.lookedUp[e.value]||this.lookUpThing(e,t):this.lookedUp[e.value]&&(this.lookedUp[t.value]||this.lookUpThing(t,e))}},{key:"putBack",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=La(t),r=new Ya(n).doc();return i.contentType=i["content-type"]||i["Content-Type"]||i.contentType||Da,"application/ld+json"===i.contentType?new Promise((function(n,o){dh(r,e.store,r.uri,i.contentType,(function(r,s){r?o(r):(i.data=s,e.webOperation("PUT",t,i).then((function(t){return n(t)})).catch((function(t){return o(t)})))}))})):(i.data=dh(r,this.store,r.value,i.contentType),this.webOperation("PUT",n,i))}},{key:"webCopy",value:function(t,e,i){var n=this;return this.webOperation("GET",t).then((function(t){return n.webOperation("PUT",e,{data:t.responseText,contentType:i})}))}},{key:"delete",value:function(t,e){var i=this;return this.webOperation("DELETE",t,e).then((function(e){return i.requested[t]=404,i.nonexistent[t]=!0,i.unload(i.store.rdfFactory.namedNode(t)),e}))}},{key:"createIfNotExists",value:(e=Ru.default.mark((function t(e){var i,n,r,o,s=arguments;return Ru.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=s.length>1&&void 0!==s[1]?s[1]:Da,n=s.length>2&&void 0!==s[2]?s[2]:"",r=this,t.prev=3,t.next=6,r.load(e);case 6:o=t.sent,t.next=29;break;case 9:if(t.prev=9,t.t0=t.catch(3),404!==t.t0.response.status){t.next=27;break}return console.log("createIfNotExists: doc does NOT exist, will create... "+e),t.prev=13,t.next=16,r.webOperation("PUT",e.value,{data:n,contentType:i});case 16:o=t.sent,t.next=23;break;case 19:throw t.prev=19,t.t1=t.catch(13),console.log("createIfNotExists doc FAILED: "+e+": "+t.t1),t.t1;case 23:return delete r.requested[e.value],t.abrupt("return",o);case 27:throw console.log("createIfNotExists doc load error NOT 404: "+e+": "+t.t0),t.t0;case 29:return t.abrupt("return",o);case 30:case"end":return t.stop()}}),t,this,[[3,9],[13,19]])})),i=function(){var t=this,i=arguments;return new Promise((function(n,r){var o=e.apply(t,i);function s(t){Cu(o,n,r,s,a,"next",t)}function a(t){Cu(o,n,r,s,a,"throw",t)}s(void 0)}))},function(t){return i.apply(this,arguments)})},{key:"createContainer",value:function(t,e,i){var n={"content-type":Da,link:this.ns.ldp("BasicContainer")+'; rel="type"'};e&&(n.slug=e);var r={headers:n};return i&&(r.body=i),this.webOperation("POST",t,r)}},{key:"invalidateCache",value:function(t){var e=La(t),i=this;if(i.fetchQueue&&i.fetchQueue[e]&&(console.log("Internal error - fetchQueue exists "+e),"resolved"===i.fetchQueue[e].PromiseStatus?delete i.fetchQueue[e]:(delete i.fetchQueue[e],console.log("*** Fetcher: pending fetchQueue deleted "+e))),i.requested[e]&&"done"!==i.requested[e]&&"failed"!==i.requested[e]&&404!==i.requested[e]){var n="Rdflib: fetcher: Destructive operation on <".concat(i.requested[e],"> file being fetched! ")+e;console.error(n)}else delete i.requested[e],delete i.nonexistent[e]}},{key:"webOperation",value:function(e,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=La(i);n.method=e,n.body=n.data||n.body,n.force=!0;var o=this;if(n.body&&!n.contentType)throw new Error("Web operation sending data must have a defined contentType.");return n.contentType&&(n.headers=n.headers||{},n.headers["content-type"]=n.contentType),t.setCredentials(r,n),new Promise((function(t,i){o._fetch(r,n).then((function(n){if(n.ok)"PUT"!==e&&"PATCH"!==e&&"POST"!==e&&"DELETE"!==e||o.invalidateCache(r),n.text?n.text().then((function(e){n.responseText=e,t(n)})):t(n);else{var s="Web error: "+n.status;n.statusText&&(s+=" ("+n.statusText+")"),s+=" on "+e+" of <"+r+">",n.responseText&&(s+=": "+n.responseText);var a=new Error(s);a.response=n,i(a)}}),(function(t){i(new Error("Fetch error for "+e+" of <"+r+">:"+t))}))}))}},{key:"lookUpThing",value:function(t,e){var i=this,n=this.store.uris(t);return(n=n.map((function(t){return Uu(t)}))).forEach((function(t){i.lookedUp[t]=!0})),this.load(n,{referringTerm:e})}},{key:"getHeader",value:function(t,e){for(var i=this.store,n=t.value,r=i.each(void 0,this.ns.link("requestedURI"),i.rdfFactory.literal(n)),o=0;o<r.length;o++){var s=r[o];if(void 0!==s){var a=i.any(s,this.ns.link("response"));if(void 0!==a&&i.anyValue(a,this.ns.http("status"))&&i.anyValue(a,this.ns.http("status")).startsWith("2")){var c=i.each(a,this.ns.httph(e.toLowerCase()));return c.length?c.map((function(t){return t.value})):[]}}}}},{key:"saveRequestMetadata",value:function(t,e){var i=e.req,n=this.store,r=e.referringTerm;this.addStatus(e.req,"Accept: "+e.headers.accept),Ga(r)&&n.add(n.rdfFactory.namedNode(t),this.ns.link("requestedBy"),r,this.appNode),e.original&&e.original.value!==t&&n.add(i,this.ns.link("orginalURI"),n.rdfFactory.literal(e.original.value),this.appNode);var o=new Date,s="["+o.getHours()+":"+o.getMinutes()+":"+o.getSeconds()+"] ";n.add(i,this.ns.rdfs("label"),n.rdfFactory.literal(s+" Request for "+t),this.appNode),n.add(i,this.ns.link("requestedURI"),n.rdfFactory.literal(t),this.appNode),n.add(i,this.ns.link("status"),n.collection(),this.appNode)}},{key:"saveResponseMetadata",value:function(t,e){var i=this,n=this.store,r=n.bnode();return n.add(e.req,this.ns.link("response"),r,r),n.add(r,this.ns.http("status"),n.rdfFactory.literal(t.status),r),n.add(r,this.ns.http("statusText"),n.rdfFactory.literal(t.statusText),r),t.headers.forEach((function(t,o){var s;n.add(r,i.ns.httph(o),i.store.rdfFactory.literal(t),r),"content-type"===o&&n.add(e.resource,i.ns.rdf("type"),n.rdfFactory.namedNode((s=t,s=s.split(";")[0].trim(),new Ya("http://www.w3.org/ns/iana/media-types/"+s+"#Resource")).value),r)})),r}},{key:"objectRefresh",value:function(t){var e=this.store.uris(t);if(void 0!==e)for(var i=0;i<e.length;i++)this.refresh(this.store.rdfFactory.namedNode(Uu(e[i])))}},{key:"refresh",value:function(t,e){this.fireCallbacks("refresh",arguments),this.nowOrWhenFetched(t,{force:!0,clearPreviousData:!0},e)}},{key:"refreshIfExpired",value:function(t,e){var i=this.getHeader(t,"Expires");!i||new Date(i[0]).getTime()<=(new Date).getTime()?this.refresh(t,e):e(!0,"Not expired",{})}},{key:"retract",value:function(t){this.store.removeMany(void 0,void 0,void 0,t),t.value&&delete this.requested[Uu(t.value)],this.fireCallbacks("retract",arguments)}},{key:"getState",value:function(t){return void 0===this.requested[t]?"unrequested":!0===this.requested[t]?"requested":"done"===this.requested[t]?"fetched":"redirected"===this.requested[t]?this.getState(this.redirectedTo[t]):"failed"}},{key:"isPending",value:function(t){return!0===this.requested[t]}},{key:"unload",value:function(t){this.store.removeDocument(t),delete this.requested[t.value]}},{key:"addHandler",value:function(t){this.handlers.push(t),t.register(this)}},{key:"retryNoCredentials",value:function(t,e){console.log("Fetcher: CORS: RETRYING with NO CREDENTIALS for "+e.resource),e.retriedWithNoCredentials=!0,delete this.requested[t],delete this.fetchQueue[t];var i=Object.assign({},e,{credentials:"omit"});return this.addStatus(e.req,"Abort: Will retry with credentials SUPPRESSED to see if that helps"),this.load(t,i)}},{key:"isCrossSite",value:function(t){if("undefined"==typeof document||!document.location)return!1;var e=Bu,i=""+document.location;return(e(i)&&e(t)&&e(i))!==e(t)}},{key:"handleError",value:function(e,i,n){if(this.isCrossSite(i)){if(n.credentials&&"include"===n.credentials&&!n.retriedWithNoCredentials)return this.retryNoCredentials(i,n);var r=t.crossSiteProxy(i);if(r&&!n.proxyUsed)return console.log("web: Direct failed so trying proxy "+r),this.redirectToProxy(r,n)}var o;return e instanceof Error?o="Fetch error: "+e.message:(o=e.statusText,e.responseText&&(o+=" ".concat(e.responseText))),this.failFetch(n,o,e.status||998,e)}},{key:"addType",value:function(t,e,i,n){var r=e;if(n){var o=i.any(r,this.ns.link("requestedURI"));o&&o.value!==n&&i.add(i.rdfFactory.namedNode(n),this.ns.rdf("type"),t,this.appNode)}for(;;){var s=i.any(r,this.ns.link("requestedURI"));if(s&&s.value&&i.add(i.rdfFactory.namedNode(s.value),this.ns.rdf("type"),t,this.appNode),!(r=i.any(void 0,i.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#redirectedRequest"),r)))break;var a=i.any(r,i.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#response"));if(!a)break;var c=i.any(a,i.rdfFactory.namedNode("http://www.w3.org/2007/ont/http#status"));if(!c)break;if("301"!==c&&"302"!==c)break}}},{key:"handleResponse",value:function(t,e,i){var n=this,r=this.store,o=t.headers,s=i.req,a=this.saveResponseMetadata(t,i),c=this.normalizedContentType(i,o)||"",l=o.get("content-location");if(0===t.status)return console.log("Masked error - status 0 for "+e),this.handleError(t,e,i);if(t.status>=400)return 404===t.status&&(this.nonexistent[i.original.value]=!0,this.nonexistent[e]=!0),this.saveErrorResponse(t,a).then((function(){return n.failFetch(i,i.resource+" "+t.statusText,t.status,t)}));var u=null,h=null;if(l&&(h=Ju(l,e))!==e&&(u=h),200===t.status){this.addType(this.ns.link("Document"),s,r,e),u&&this.addType(this.ns.link("Document"),s,r,u),i.clearPreviousData&&r.removeDocument(i.resource);var d=c.includes("image/")||c.includes("application/pdf");c&&d&&(this.addType(r.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),s,r,e),u&&this.addType(r.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),s,r,u))}if(l){if(!i.force&&u&&"done"===this.requested[h])return this.doneFetch(i,t);this.requested[h]=!0}this.parseLinkHeader(o.get("link"),i.original,s);var f=this.handlerForContentType(c,t);return f?t.text().then((function(e){return t.responseText=e,f.parse(n,e,i,t)})):(this.addStatus(s,"Fetch over. No data handled."),this.doneFetch(i,t))}},{key:"saveErrorResponse",value:function(t,e){var i=this,n=this.store;return t.text().then((function(t){t.length>10&&n.add(e,i.ns.http("content"),n.rdfFactory.literal(t),e)}))}},{key:"handlerForContentType",value:function(t,e){if(!t)return null;var i=this.handlers.find((function(e){return t.match(e.pattern)}));return i?new i(e):null}},{key:"guessContentType",value:function(t){return wd[t.split(".").pop()]}},{key:"normalizedContentType",value:function(t,e){if(t.forceContentType)return t.forceContentType;var i=e.get("content-type");if(!i||i.includes("application/octet-stream")){var n=this.guessContentType(t.resource.value);if(n)return n}var r=$u(t.resource.value);return!i&&["file","chrome"].includes(r)?"text/xml":i}},{key:"redirectToProxy",value:function(t,e){var i=this;this.addStatus(e.req,"BLOCKED -> Cross-site Proxy to <"+t+">"),e.proxyUsed=!0;var n=this.store,r=e.req;e.noMeta||(n.add(r,this.ns.link("redirectedTo"),n.rdfFactory.namedNode(t),r),this.addStatus(r,"redirected to new request")),this.requested[e.resource.value]="redirected",this.redirectedTo[e.resource.value]=t;var o=Object.assign({},e);return o.baseURI=e.resource.value,this.fetchUri(t,o).then((function(t){return o.noMeta||n.add(r,i.ns.link("redirectedRequest"),o.req,i.appNode),t}))}},{key:"setRequestTimeout",value:function(t,e){var i=this;return new Promise((function(n){i.timeouts[t]=(i.timeouts[t]||[]).concat(setTimeout((function(){!i.isPending(t)||e.retriedWithNoCredentials||e.proxyUsed||n(i.failFetch(e,"Request to ".concat(t," timed out"),"timeout"))}),i.timeout))}))}},{key:"addFetchCallback",value:function(t,e){this.fetchCallbacks[t]?this.fetchCallbacks[t].push(e):this.fetchCallbacks[t]=[e]}},{key:"acceptString",value:function(){var t="";for(var e in this.mediatypes)for(var i in""!==t&&(t+=", "),t+=e,this.mediatypes[e])t+=";"+i+"="+this.mediatypes[e][i];return t}}],[{key:"crossSiteProxy",value:function(e){return t.crossSiteProxyTemplate?t.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(e)):void 0}},{key:"offlineOverride",value:function(t){var e,i=t;return"undefined"!=typeof window&&window.panes&&(e=window.panes.UI)&&e.preferences&&e.preferences.get("offlineModeUsingLocalhost")&&"http://"===i.slice(0,7)&&"localhost/"!==i.slice(7,17)&&(i="http://localhost/"+i.slice(7),Zu("Localhost kludge for offline use: actually getting <"+i+">")),i}},{key:"proxyIfNecessary",value:function(e){var i;if("undefined"!=typeof window&&window.panes&&(i=window.panes.UI)&&i.isExtension)return e;if("undefined"!=typeof $SolidTestEnvironment&&$SolidTestEnvironment.localSiteMap){var n=function t(e,i){var n=i[e.shift()];return n?"string"==typeof n?n+e.join("/"):e?t(e,n):null:null}(e.split("/").slice(2),$SolidTestEnvironment.localSiteMap);if(n)return n}return t.crossSiteProxyTemplate&&"undefined"!=typeof document&&document.location&&"https:"===(""+document.location).slice(0,6)&&"http:"===e.slice(0,5)?t.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(e)):e}},{key:"unsupportedProtocol",value:function(t){var e=$u(t);return"tel"===e||"mailto"===e||"urn"===e}},{key:"setCredentials",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};void 0===e.credentials&&(e.credentials=void 0!==e.withCredentials?e.withCredentials?"include":"omit":"include")}}]),t}();function Td(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Od(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Td(Object(i),!0).forEach((function(e){ma(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Td(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}ma(Id,"HANDLERS",void 0),ma(Id,"CONTENT_TYPE_BY_EXT",void 0),ma(Id,"crossSiteProxyTemplate",void 0),Id.HANDLERS=Cd,Id.CONTENT_TYPE_BY_EXT=wd;var Pd,Nd=Od(Od({},rd),{},{fetcher:function(t,e){return new Id(t,e)},graph:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return new Th(t,e||{rdfFactory:rd})},lit:function(t,e,i){return this.literal(""+t,e||i)},st:function(t,e,i,n){return this.quad(t,e,i,n)}}),Dd=Nd,Md={};for(Pd in Dd)"function"==typeof Dd[Pd]&&(Md[Pd]=Dd[Pd].bind(Dd));var Ud=Md.fetcher,Ld=Md.graph,Bd=Md.namedNode;new bh;var Jd=(t,e)=>{const i=t[e.predicate.uri];return ce(ae({},t),{[e.predicate.uri]:i?[...i,e.subject.value]:[e.subject.value]})},$d=(t,e)=>{const i=t[e.predicate.uri];return ce(ae({},t),{[e.predicate.uri]:i?[...i,e.object.value]:[e.object.value]})},zd=class{constructor(t,e){this.uri=t,this.store=e}label(){const t=this.anyValue("http://www.w3.org/2006/vcard/ns#fn","http://xmlns.com/foaf/0.1/name","http://xmlns.com/foaf/0.1/nick","https://schema.org/name","http://schema.org/name","http://purl.org/dc/terms/title","http://purl.org/dc/elements/1.1/title","http://www.w3.org/2000/01/rdf-schema#label","https://www.w3.org/ns/activitystreams#name","http://schema.org/caption","https://schema.org/caption");return null!=t?t:this.uri}literals(){const t=this.store.statementsMatching(Bd(this.uri)).filter((t=>qa(t.object))).reduce($d,{});return Object.keys(t).map((e=>({predicate:e,values:t[e]})))}relations(){const t=this.store.statementsMatching(Bd(this.uri)).filter((t=>Ga(t.object)&&!t.predicate.sameTerm(Bd("http://www.w3.org/1999/02/22-rdf-syntax-ns#type")))).reduce($d,{});return Object.keys(t).map((e=>({predicate:e,uris:t[e]})))}reverseRelations(){const t=this.store.statementsMatching(void 0,void 0,Bd(this.uri)).reduce(Jd,{});return Object.keys(t).map((e=>({predicate:e,uris:t[e]})))}anyValue(...t){let e;return t.some((t=>(e=this.store.anyValue(Bd(this.uri),Bd(t)),Boolean(e)))),e}description(){return this.anyValue("http://purl.org/dc/terms/description","http://purl.org/dc/elements/1.1/description","http://schema.org/description","https://schema.org/description","https://schema.org/text","http://www.w3.org/2000/01/rdf-schema#comment","https://www.w3.org/ns/activitystreams#summary","https://www.w3.org/ns/activitystreams#content","http://www.w3.org/2006/vcard/ns#note")}picture(){const t=this.anyValue("http://schema.org/image","https://schema.org/image","http://schema.org/logo","https://schema.org/logo","http://www.w3.org/2006/vcard/ns#hasPhoto","http://www.w3.org/2006/vcard/ns#photo","http://www.w3.org/2006/vcard/ns#hasLogo","http://www.w3.org/2006/vcard/ns#logo","http://xmlns.com/foaf/0.1/img","http://xmlns.com/foaf/0.1/depiction","http://xmlns.com/foaf/0.1/thumbnail");return t?{url:t}:this.findActivityStreamsPicture()}findActivityStreamsPicture(){const t=this.store.any(Bd(this.uri),Bd("https://www.w3.org/ns/activitystreams#image"))||this.store.any(Bd(this.uri),Bd("https://www.w3.org/ns/activitystreams#icon"));if(!(t&&(e=t,Wa(e)&&"termType"in e&&"BlankNode"===e.termType||Ga(t))))return null;var e;const i=this.store.anyValue(t,Bd("https://www.w3.org/ns/activitystreams#url"));return i?{url:i}:null}types(){const t=this.store.findTypeURIs(Bd(this.uri));return Object.keys(t).map((t=>{return{uri:t,label:(e=t,e.includes("#")?e.substring(e.lastIndexOf("#")+1):e.substring(e.lastIndexOf("/")+1))};var e}))}assume(t){return new t(this.uri,this.store)}},Hd=class extends zd{constructor(t,e){super(t,e),this.uri=t,this.store=e}subjects(){const t=this.store.statementsMatching(null,null,null,Bd(this.uri)).filter((t=>Ga(t.subject))).map((t=>t.subject.value)),e=new Set(t);return e.delete(this.uri),[...e].map((t=>({uri:t})))}};
|
|
20
|
-
/*! Bundled license information:
|
|
21
|
-
|
|
22
|
-
@inrupt/oidc-client/lib/oidc-client.min.js:
|
|
23
|
-
(*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
|
|
24
|
-
*)
|
|
25
|
-
(*! Mike Samuel (c) 2009 | code.google.com/p/json-sans-eval
|
|
26
|
-
*)
|
|
27
|
-
(*!
|
|
28
|
-
* The buffer module from node.js, for the browser.
|
|
29
|
-
*
|
|
30
|
-
* @author Feross Aboukhadijeh <http://feross.org>
|
|
31
|
-
* @license MIT
|
|
32
|
-
*)
|
|
33
|
-
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
34
|
-
|
|
35
|
-
rdf-canonize/lib/MessageDigest-browser.js:
|
|
36
|
-
(*!
|
|
37
|
-
* Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
|
|
38
|
-
*)
|
|
39
|
-
|
|
40
|
-
rdf-canonize/lib/Permuter.js:
|
|
41
|
-
(*!
|
|
42
|
-
* Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
|
|
43
|
-
*)
|
|
44
|
-
|
|
45
|
-
rdf-canonize/lib/NQuads.js:
|
|
46
|
-
(*!
|
|
47
|
-
* Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
|
|
48
|
-
*)
|
|
49
|
-
|
|
50
|
-
rdf-canonize/lib/URDNA2015.js:
|
|
51
|
-
(*!
|
|
52
|
-
* Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
|
|
53
|
-
*)
|
|
54
|
-
|
|
55
|
-
rdf-canonize/lib/URGNA2012.js:
|
|
56
|
-
(*!
|
|
57
|
-
* Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
|
|
58
|
-
*)
|
|
59
|
-
|
|
60
|
-
rdf-canonize/lib/URDNA2015Sync.js:
|
|
61
|
-
(*!
|
|
62
|
-
* Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
|
|
63
|
-
*)
|
|
64
|
-
|
|
65
|
-
rdf-canonize/lib/URGNA2012Sync.js:
|
|
66
|
-
(*!
|
|
67
|
-
* Copyright (c) 2016-2021 Digital Bazaar, Inc. All rights reserved.
|
|
68
|
-
*)
|
|
69
|
-
|
|
70
|
-
jsonld/lib/context.js:
|
|
71
|
-
(* disallow aliasing @context and @preserve *)
|
|
72
|
-
|
|
73
|
-
jsonld/lib/frame.js:
|
|
74
|
-
(* remove @preserve from results *)
|
|
75
|
-
(**
|
|
76
|
-
* Removes the @preserve keywords from expanded result of framing.
|
|
77
|
-
*
|
|
78
|
-
* @param input the framed, framed output.
|
|
79
|
-
* @param options the framing options used.
|
|
80
|
-
*
|
|
81
|
-
* @return the resulting output.
|
|
82
|
-
*)
|
|
83
|
-
(* remove @preserve *)
|
|
84
|
-
|
|
85
|
-
jsonld/lib/jsonld.js:
|
|
86
|
-
(**
|
|
87
|
-
* A JavaScript implementation of the JSON-LD API.
|
|
88
|
-
*
|
|
89
|
-
* @author Dave Longley
|
|
90
|
-
*
|
|
91
|
-
* @license BSD 3-Clause License
|
|
92
|
-
* Copyright (c) 2011-2019 Digital Bazaar, Inc.
|
|
93
|
-
* All rights reserved.
|
|
94
|
-
*
|
|
95
|
-
* Redistribution and use in source and binary forms, with or without
|
|
96
|
-
* modification, are permitted provided that the following conditions are met:
|
|
97
|
-
*
|
|
98
|
-
* Redistributions of source code must retain the above copyright notice,
|
|
99
|
-
* this list of conditions and the following disclaimer.
|
|
100
|
-
*
|
|
101
|
-
* Redistributions in binary form must reproduce the above copyright
|
|
102
|
-
* notice, this list of conditions and the following disclaimer in the
|
|
103
|
-
* documentation and/or other materials provided with the distribution.
|
|
104
|
-
*
|
|
105
|
-
* Neither the name of the Digital Bazaar, Inc. nor the names of its
|
|
106
|
-
* contributors may be used to endorse or promote products derived from
|
|
107
|
-
* this software without specific prior written permission.
|
|
108
|
-
*
|
|
109
|
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
|
110
|
-
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
111
|
-
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
|
112
|
-
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
113
|
-
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
114
|
-
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
|
115
|
-
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
116
|
-
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
117
|
-
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
118
|
-
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
119
|
-
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
120
|
-
*)
|
|
121
|
-
|
|
122
|
-
queue-microtask/index.js:
|
|
123
|
-
(*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
124
|
-
|
|
125
|
-
@babel/runtime/helpers/regeneratorRuntime.js:
|
|
126
|
-
(*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE *)
|
|
127
|
-
*/
|
|
128
|
-
const Kd=()=>new class{constructor(){this.session=new class{get authenticatedFetch(){return this._authenticatedFetch}constructor(){this.session=new sa.Session,this._authenticatedFetch=this.session.fetch}handleIncomingRedirect(){return pe(this,null,(function*(){return this.session.handleIncomingRedirect({restorePreviousSession:!1})}))}login(t){return pe(this,null,(function*(){return this.session.login({oidcIssuer:t,redirectUrl:window.location.href,clientName:`Pod OS at ${window.location.host}`})}))}logout(){return pe(this,null,(function*(){return this.session.logout()}))}trackSession(t){this.session.onLogin((()=>t(this.session.info))),this.session.onLogout((()=>t(this.session.info))),this.session.onSessionRestore((()=>t(this.session.info))),t(this.session.info)}},this.store=new class{constructor(t){this.graph=Ld(),this.fetcher=Ud(this.graph,{fetch:t.authenticatedFetch})}fetch(t){return this.fetcher.load(Bd(t),{force:!0})}get(t){return new zd(t,this.graph)}}(this.session),this.fileFetcher=new class{constructor(t){this.session=t}fetchFile(t){return pe(this,null,(function*(){const e=yield this.session.authenticatedFetch(t);if(e.ok){const i=yield e.blob();return new class{constructor(t,e){this.url=t,this.data=e}blob(){return this.data}}(t,i)}return new class{constructor(t,e){this.url=t,this.status=e}toString(){return`${this.status.toString()} - ${this.url}`}blob(){return null}}(t,new class{constructor(t,e){this.code=t,this.text=e}toString(){return this.text?`${this.code} - ${this.text}`:this.code.toString()}}(e.status,e.statusText))}))}}(this.session)}handleIncomingRedirect(){this.session.handleIncomingRedirect()}fetch(t){return this.store.fetch(t)}fetchFile(t){return this.fileFetcher.fetchFile(t)}trackSession(t){return this.session.trackSession(t)}logout(){return this.session.logout()}login(t="http://localhost:3000"){return this.session.login(t)}},Wd=class{constructor(e){t(this,e),this.os=void 0}componentWillLoad(){this.os=Kd(),this.os.handleIncomingRedirect(),this.os.trackSession((t=>{zt.state.isLoggedIn=t.isLoggedIn,zt.state.webId=t.webId}))}async initializeOs(t){t.stopPropagation(),t.detail(this.os)}render(){return e("ion-app",null,e("slot",null))}},qd=class{constructor(e){t(this,e)}render(){return e("pos-app",null,e("ion-header",null,e("ion-toolbar",null,e("ion-title",{slot:"start"},"PodOS"),e("pos-login",null))),e("ion-content",null,e("pos-router",null)),e("ion-footer",null,e("ion-toolbar",null,e("ion-title",null,"PodOS Browser"))))}},Vd=class{constructor(e){t(this,e)}render(){return e("ion-grid",null,e("ion-row",null,e("ion-col",{size:"12","size-sm":!0},e("ion-card",null,e("ion-card-header",null,e("pos-type-badges",null),e("pos-picture",null),e("ion-card-title",null,e("pos-label",null))),e("ion-card-content",null,e("pos-description",null)))),e("ion-col",{size:"12","size-sm":!0},e("pos-literals",null)),e("ion-col",{size:"12","size-sm":!0},e("pos-relations",null),e("pos-reverse-relations",null))))}};function Gd(t){t.subscribeResource.emit(t.receiveResource)}const Xd=class{constructor(e){t(this,e),this.subscribeResource=r(this,"pod-os:resource",7),this.receiveResource=t=>{this.resource=t},this.resource=void 0}componentWillLoad(){Gd(this)}render(){return this.resource?e("ion-grid",null,e("ion-row",null,e("ion-col",{size:"12","size-sm":!0},e("pos-image",{src:this.resource.uri})),e("ion-col",{size:"12","size-sm":!0},e("ion-card",null,e("ion-card-header",null,e("ion-card-title",null,e("pos-label",null),e("pos-type-badges",null)),e("pos-literals",null)))))):null}};Xd.style="pos-image {\n --max-width: 100%;\n }";const Yd=class{constructor(e){t(this,e),this.subscribeResource=r(this,"pod-os:resource",7),this.receiveResource=t=>{this.resource=t},this.resource=void 0}componentWillLoad(){Gd(this)}render(){return this.resource?e("ion-grid",null,e("ion-row",null,e("ion-col",{size:"12","size-sm":!0},e("pos-pdf",{src:this.resource.uri})),e("ion-col",{size:"12","size-sm":!0},e("ion-card",null,e("ion-card-header",null,e("ion-card-title",null,e("pos-label",null),e("pos-type-badges",null)),e("pos-literals",null)))))):null}},Zd=class{constructor(e){t(this,e)}render(){return e("ion-grid",null,e("ion-row",null,e("ion-col",{size:"12","size-sm":!0},e("pos-subjects",null)),e("ion-col",{size:"12","size-sm":!0},e("ion-card",null,e("ion-card-header",null,e("ion-card-title",null,e("pos-label",null),e("pos-type-badges",null)),e("pos-literals",null))))))}},Qd=class{constructor(e){t(this,e),this.subscribeResource=r(this,"pod-os:resource",7),this.receiveResource=t=>{this.resource=t},this.resource=void 0}componentWillLoad(){Gd(this)}render(){return this.resource?this.resource.description():null}},tf=({file:t})=>{const i=function(t){switch(t.code){case 401:case 403:return"lock-closed-outline";case 404:return"help-circle-outline";default:return"alert-circle-outline"}}(t.status);return e("div",null,e("a",{class:"error",href:t.url},e("div",null,e("ion-icon",{name:i})),e("div",{class:"code"},t.status.code),e("div",{class:"text"},t.status.text)))},ef=class{constructor(e){t(this,e),this.initializeOsEmitter=r(this,"pod-os:init",7),this.setOs=async t=>{this.os=t},this.src=void 0,this.alt=void 0,this.os=void 0,this.dataUri=void 0,this.brokenFile=void 0,this.error=void 0,this.loading=!0}componentWillLoad(){zt.onChange("isLoggedIn",(()=>this.fetchBlob())),this.initializeOsEmitter.emit(this.setOs)}async fetchBlob(){try{this.loading=!0;const t=await this.os.fetchFile(this.src);t.blob()?(this.dataUri=URL.createObjectURL(t.blob()),this.error=null):this.brokenFile=t}catch(t){this.error=t}finally{this.loading=!1}}render(){return this.loading?e("ion-skeleton-text",{animated:!0}):this.error?e("div",{class:"error"},this.error.message):this.brokenFile?e(tf,{file:this.brokenFile}):e("img",{src:this.dataUri,alt:this.alt})}static get watchers(){return{os:["fetchBlob"],src:["fetchBlob"]}}};ef.style=":host{}img,ion-skeleton-text,div.error{border-radius:var(--border-radius);width:var(--width);height:var(--height);max-width:var(--max-width);max-height:var(--max-height)}.error{display:flex;opacity:0.8;background:repeating-linear-gradient( -45deg, rgba(150, 0, 0, 0.1), rgba(150, 0, 0, 0.1) 10px, #fff 5px, #fff 25px );flex-direction:column;border:1px solid red;color:black;align-items:center;justify-content:center;word-break:break-all;padding:1rem;box-sizing:border-box}.error ion-icon{color:#282828;--ionicon-stroke-width:calc(var(--width) / 5);font-size:calc(var(--width) / 2)}a{text-decoration:none;width:var(--width);height:var(--height)}.code{font-weight:bold;font-size:calc(var(--width) / 8)}.text{font-size:calc(var(--width) / 20)}";const nf=class{constructor(e){t(this,e),this.subscribeResource=r(this,"pod-os:resource",7),this.receiveResource=t=>{this.resource=t},this.resource=void 0}componentWillLoad(){Gd(this)}render(){return this.resource?this.resource.label():null}},rf=class{constructor(e){t(this,e),this.subscribeResource=r(this,"pod-os:resource",7),this.receiveResource=t=>{this.data=t.literals()},this.data=[]}componentWillLoad(){Gd(this)}render(){const t=this.data.map((t=>e("ion-item-group",null,e("ion-item-divider",null,e("ion-label",null,t.predicate)),t.values.map((t=>e("ion-item",null,e("ion-label",{class:"ion-text-wrap"},t)," "))))));return this.data.length>0?e("ion-list",null,t):null}},of=class{constructor(e){t(this,e),this.initializeOsEmitter=r(this,"pod-os:init",7),this.setOs=async t=>{this.os=t},this.os=void 0}componentWillLoad(){this.initializeOsEmitter.emit(this.setOs)}login(){const t=zt.state.getIdpUrl();this.os.login(t)}logout(){this.os.logout()}render(){return e(i,null,zt.state.isLoggedIn?e("pos-resource",{uri:zt.state.webId},e("span",{class:"user-data"},e("pos-picture",null),e("pos-label",null))):"",!zt.state.isLoggedIn&&e("ion-button",{onClick:()=>this.login()},"Login"),zt.state.isLoggedIn&&e("ion-button",{onClick:()=>this.logout()},"Logout"))}};of.style=":host{display:flex;gap:10px}.user-data{align-items:center;display:inline-flex;gap:10px}.user-data pos-picture{--width:40px;--height:40px;--border-radius:50%}";const sf=class{constructor(e){t(this,e),this.linkEmitter=r(this,"pod-os:link",7),this.uri="",this.value=this.uri}onChange(t){this.value=t.detail.value}onSubmit(t){t.preventDefault(),this.linkEmitter.emit(this.value)}render(){return e("form",{onSubmit:t=>this.onSubmit(t)},e("ion-searchbar",{enterkeyhint:"search",placeholder:"Enter URI",value:this.uri,debounce:0,onIonChange:t=>this.onChange(t)}))}},af=class{constructor(e){t(this,e),this.initializeOsEmitter=r(this,"pod-os:init",7),this.setOs=async t=>{this.os=t},this.src=void 0,this.alt=void 0,this.os=void 0,this.dataUri=void 0,this.brokenFile=void 0,this.error=void 0,this.loading=!0}componentWillLoad(){zt.onChange("isLoggedIn",(()=>this.fetchBlob())),this.initializeOsEmitter.emit(this.setOs)}async fetchBlob(){try{this.loading=!0;const t=await this.os.fetchFile(this.src);t.blob()?(this.dataUri=URL.createObjectURL(t.blob()),this.error=null):this.brokenFile=t}catch(t){this.error=t}finally{this.loading=!1}}render(){return this.loading?e("ion-skeleton-text",{animated:!0}):this.error?e("div",{class:"error"},this.error.message):this.brokenFile?e(tf,{file:this.brokenFile}):e("iframe",{src:this.dataUri})}static get watchers(){return{os:["fetchBlob"],src:["fetchBlob"]}}};af.style="iframe{width:100%;height:100vh}.error{display:flex;opacity:0.8;background:repeating-linear-gradient( -45deg, rgba(150, 0, 0, 0.1), rgba(150, 0, 0, 0.1) 10px, #fff 5px, #fff 25px );flex-direction:column;border:1px solid red;color:black;align-items:center;justify-content:center;word-break:break-all;padding:1rem;box-sizing:border-box}.error ion-icon{color:#282828;--ionicon-stroke-width:calc(var(--width) / 5);font-size:calc(var(--width) / 2)}a{text-decoration:none;width:var(--width);height:var(--height)}.code{font-weight:bold;font-size:calc(var(--width) / 8)}.text{font-size:calc(var(--width) / 20)}";const cf=class{constructor(e){t(this,e),this.subscribeResource=r(this,"pod-os:resource",7),this.receiveResource=t=>{this.resource=t},this.resource=void 0}componentWillLoad(){Gd(this)}render(){const t=this.resource?this.resource.picture():null;return t?e("pos-image",{src:t.url,alt:this.resource.label()}):null}};cf.style=":host{--width:300px;--height:300px;--border-radius:var(--border-radius, 0)}";const lf=class{constructor(e){t(this,e),this.subscribeResource=r(this,"pod-os:resource",7),this.receiveResource=t=>{this.data=t.relations()},this.data=[]}componentWillLoad(){Gd(this)}render(){const t=this.data.map((t=>e("ion-item-group",null,e("ion-item-divider",null,e("ion-label",null,t.predicate)),t.uris.map((t=>e("pos-rich-link",{uri:t}))))));return this.data.length>0?e("ion-list",null,t):null}},uf=class{constructor(e){t(this,e),this.initializeOsEmitter=r(this,"pod-os:init",7),this.setOs=async t=>{this.os=t},this.os=void 0,this.resource=void 0,this.consumers=[],this.uri=void 0,this.lazy=!1,this.error=void 0,this.loading=!0}componentWillLoad(){zt.onChange("isLoggedIn",(()=>this.loadResource())),this.initializeOsEmitter.emit(this.setOs)}async provideResource(t){t.stopPropagation(),this.resource&&t.detail(this.resource),this.consumers.push(t)}async loadResource(){await this.getResource(!this.lazy)}async fetch(){await this.getResource(!0)}async getResource(t=!1){try{t&&(this.loading=!0,await this.os.fetch(this.uri)),this.resource=this.os.store.get(this.uri),this.error=null,this.consumers.forEach((t=>{t.detail(this.resource)}))}catch(t){this.error=t}finally{this.loading=!1}}render(){return this.loading?e("ion-progress-bar",{type:"indeterminate"}):this.error?e("ion-card",null,e("ion-card-header",null,e("p",null,"Sorry, something went wrong"),e("p",null,"Status:",this.error.status),e("details",null,this.error.message)),e("ion-card-content",null,e("p",null,"You can try to open the link outside PodOS:"),e("a",{href:this.uri},this.uri))):e("slot",null)}static get watchers(){return{os:["loadResource"],uri:["loadResource"]}}},hf=class{constructor(e){t(this,e),this.subscribeResource=r(this,"pod-os:resource",7),this.receiveResource=t=>{this.data=t.reverseRelations()},this.data=[]}componentWillLoad(){Gd(this)}render(){const t=this.data.map((t=>e("ion-item-group",null,e("ion-item-divider",null,e("ion-label",null,"is ",t.predicate," of")),t.uris.map((t=>e("pos-rich-link",{uri:t}))))));return this.data.length>0?e("ion-list",null,t):null}},df=class{constructor(e){t(this,e),this.linkEmitter=r(this,"pod-os:link",7),this.uri=void 0}render(){return e("pos-resource",{lazy:!0,uri:this.uri},e("ion-item",{href:this.uri,onClick:t=>{t.preventDefault(),this.linkEmitter.emit(this.uri)}},e("ion-label",null,e("pos-label",null),e("p",null,e("ion-label",{style:{maxWidth:"50rem"}},e("pos-description",null))),e("p",null,e("a",{href:this.uri},this.uri)))))}},ff=t=>!("isConnected"in t)||t.isConnected,pf=(()=>{let t;return(...e)=>{t&&clearTimeout(t),t=setTimeout((()=>{t=0,(t=>{for(let e of t.keys())t.set(e,t.get(e).filter(ff))})(...e)}),2e3)}})(),vf=(t,e)=>{var i;return"to"in t?{path:t.path,to:t.to}:{path:t.path,id:t.id,jsx:null!==(i=t.render)&&void 0!==i?i:e}},gf=(t,e)=>{if("string"==typeof e){if(e===t)return{}}else if("function"==typeof e){const i=e(t);if(i)return!0===i?{}:{...i}}else{const i=e.exec(t);if(i)return e.lastIndex=0,{...i}}},mf=t=>t.pathname.toLowerCase(),wf=new RegExp(["(\\\\.)","(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?"].join("|"),"g"),bf=t=>t.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),yf=t=>t.replace(/([=!:$/()])/g,"\\$1"),xf=t=>t&&t.sensitive?"":"i",kf=(t,e,i)=>{for(var n=(i=i||{}).strict,r=!1!==i.end,o=bf(i.delimiter||"/"),s=i.delimiters||"./",a=[].concat(i.endsWith||[]).map(bf).concat("$").join("|"),c="",l=!1,u=0;u<t.length;u++){var h=t[u];if("string"==typeof h)c+=bf(h),l=u===t.length-1&&s.indexOf(h[h.length-1])>-1;else{var d=bf(h.prefix||""),f=h.repeat?"(?:"+h.pattern+")(?:"+d+"(?:"+h.pattern+"))*":h.pattern;e&&e.push(h),c+=h.optional?h.partial?d+"("+f+")?":"(?:"+d+"("+f+"))?":d+"("+f+")"}}return r?(n||(c+="(?:"+o+")?"),c+="$"===a?"$":"(?="+a+")"):(n||(c+="(?:"+o+"(?="+a+"))?"),l||(c+="(?="+o+"|"+a+")")),new RegExp("^"+c,xf(i))},Ef=(t,e,i)=>t instanceof RegExp?((t,e)=>{if(!e)return t;var i=t.source.match(/\((?!\?)/g);if(i)for(var n=0;n<i.length;n++)e.push({name:n,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,pattern:null});return t})(t,e):Array.isArray(t)?((t,e,i)=>{for(var n=[],r=0;r<t.length;r++)n.push(Ef(t[r],e,i).source);return new RegExp("(?:"+n.join("|")+")",xf(i))})(t,e,i):((t,e,i)=>kf(((t,e)=>{for(var i,n=[],r=0,o=0,s="",a=e&&e.delimiter||"/",c=e&&e.delimiters||"./",l=!1;null!==(i=wf.exec(t));){var u=i[0],h=i[1],d=i.index;if(s+=t.slice(o,d),o=d+u.length,h)s+=h[1],l=!0;else{var f="",p=t[o],v=i[2],g=i[3],m=i[4],w=i[5];if(!l&&s.length){var b=s.length-1;c.indexOf(s[b])>-1&&(f=s[b],s=s.slice(0,b))}s&&(n.push(s),s="",l=!1);var y=f||a,x=g||m;n.push({name:v||r++,prefix:f,delimiter:y,optional:"?"===w||"*"===w,repeat:"+"===w||"*"===w,partial:""!==f&&void 0!==p&&p!==f,pattern:x?yf(x):"[^"+bf(y)+"]+?"})}}return(s||o<t.length)&&n.push(s+t.substr(o)),n})(t,i),e,i))(t,e,i);let Sf=0;const Ff={},Af=(t,e={})=>{const{exact:i=!1,strict:n=!1}=e,{re:r,keys:o}=((t,e)=>{const i=`${e.end}${e.strict}`,n=Ff[i]||(Ff[i]={}),r=JSON.stringify(t);if(n[r])return n[r];const o=[],s={re:Ef(t,o,e),keys:o};return Sf<1e4&&(n[r]=s,Sf+=1),s})(t,{end:i,strict:n});return t=>{const e=r.exec(t);if(!e)return;const[n,...s]=e;return i&&t!==n?void 0:o.reduce(((t,e,i)=>(t[e.name]=s[i],t)),{})}},_f=(()=>{const t=window,e=new URL(t.location.href),i=(void 0,mf),{state:n,onChange:r,dispose:s}=((t,e)=>{const i=((t,e=((t,e)=>t!==e))=>{let i=new Map(Object.entries(null!=t?t:{}));const n={dispose:[],get:[],set:[],reset:[]},r=()=>{i=new Map(Object.entries(null!=t?t:{})),n.reset.forEach((t=>t()))},o=t=>(n.get.forEach((e=>e(t))),i.get(t)),s=(t,r)=>{const o=i.get(t);e(r,o,t)&&(i.set(t,r),n.set.forEach((e=>e(t,r,o))))},a="undefined"==typeof Proxy?{}:new Proxy(t,{get:(t,e)=>o(e),ownKeys:()=>Array.from(i.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(t,e)=>i.has(e),set:(t,e,i)=>(s(e,i),!0)}),c=(t,e)=>(n[t].push(e),()=>{((t,e)=>{const i=t.indexOf(e);i>=0&&(t[i]=t[t.length-1],t.length--)})(n[t],e)});return{state:a,get:o,set:s,on:c,onChange:(e,i)=>{const n=c("set",((t,n)=>{t===e&&i(n)})),r=c("reset",(()=>i(t[e])));return()=>{n(),r()}},use:(...t)=>{const e=t.reduce(((t,e)=>(e.set&&t.push(c("set",e.set)),e.get&&t.push(c("get",e.get)),e.reset&&t.push(c("reset",e.reset)),e.dispose&&t.push(c("dispose",e.dispose)),t)),[]);return()=>e.forEach((t=>t()))},dispose:()=>{n.dispose.forEach((t=>t())),r()},reset:r,forceUpdate:t=>{const e=i.get(t);n.set.forEach((i=>i(t,e,e)))}}})(t,e);return i.use((()=>{if("function"!=typeof l)return{};const t=new Map;return{dispose:()=>t.clear(),get:e=>{const i=l();i&&((t,e,i)=>{const n=t.get(e);n?n.includes(i)||n.push(i):t.set(e,[i])})(t,e,i)},set:e=>{const i=t.get(e);i&&t.set(e,i.filter(o)),pf(t)},reset:()=>{t.forEach((t=>t.forEach(o))),pf(t)}}})()),i})({url:e,activePath:i(e)},((t,e,i)=>"url"===i?t.href!==e.href:t!==e)),a=t=>{history.pushState(null,null,t);const e=new URL(t,document.baseURI);n.url=e,n.activePath=i(e)},c=t=>{const{activePath:e}=n;for(let i of t){const n=gf(e,i.path);if(n){if(null!=i.to){const n="string"==typeof i.to?i.to:i.to(e);return a(n),c(t)}return{params:n,route:i}}}},u=()=>{const e=new URL(t.location.href);n.url=e,n.activePath=i(e)},h={Switch:(t,e)=>{const i=c(e);if(i)return"function"==typeof i.route.jsx?i.route.jsx(i.params):i.route.jsx},get url(){return n.url},get activePath(){return n.activePath},push:a,onChange:r,dispose:()=>{t.removeEventListener("popstate",u),s()}};return u(),t.addEventListener("popstate",u),h})(),jf=class{constructor(e){t(this,e),this.uri=void 0}linkClicked(t){this.navigate(t.detail)}componentWillLoad(){this.updateUri(),_f.onChange("url",(()=>{this.updateUri()}))}navigate(t){_f.push("?uri="+encodeURIComponent(t))}updateUri(){this.uri=new URLSearchParams(window.location.search).get("uri")||window.location.href}render(){return console.log("render router",this.uri),e(_f.Switch,null,e(vf,{path:Af("",{exact:!1})},e("pos-navigation-bar",{uri:this.uri}),e("pos-resource",{key:this.uri,uri:this.uri},e("pos-type-router",null))))}},Cf=class{constructor(e){t(this,e),this.subscribeResource=r(this,"pod-os:resource",7),this.receiveResource=t=>{const e=t.assume(Hd);this.data=e.subjects()},this.data=[]}componentWillLoad(){Gd(this)}render(){const t=this.data.map((t=>e("pos-rich-link",{uri:t.uri})));return this.data.length>0?e("ion-list",null,t):null}},Rf=class{constructor(e){t(this,e),this.subscribeResource=r(this,"pod-os:resource",7),this.receiveResource=t=>{this.data=t.types(),this.typeLabels=[...new Set(t.types().map((t=>t.label)))]},this.data=[],this.typeLabels=[],this.isExpanded=!1}componentWillLoad(){Gd(this)}toggleDetails(){this.isExpanded=!this.isExpanded}render(){return 0==this.data.length?null:this.isExpanded?e("div",{class:"types expanded"},e("ion-badge",{class:"toggle",onClick:()=>this.toggleDetails()},e("ion-icon",{name:"contract-outline"})),this.data.map((t=>e("ion-badge",null,t.uri)))):e(i,null,e("div",{class:"types"},this.typeLabels.map((t=>e("ion-badge",null,t))),e("ion-badge",{class:"toggle",onClick:()=>this.toggleDetails()},e("ion-icon",{name:"expand-outline"}))))}};Rf.style=".types{display:flex;gap:0.25rem;margin:0.5rem 0}.expanded{flex-direction:column;justify-content:flex-start;align-items:flex-start}ion-badge{color:#333;background:#eee}ion-badge.toggle{cursor:pointer}ion-badge.toggle:hover{background:#ddd}";const If=class{constructor(e){t(this,e),this.subscribeResource=r(this,"pod-os:resource",7),this.receiveResource=t=>{this.types=t.types()},this.types=void 0}componentWillLoad(){Gd(this)}render(){return this.types?this.renderApp():null}renderApp(){return this.types.some((t=>"http://www.w3.org/2007/ont/link#RDFDocument"===t.uri))?e("pos-app-rdf-document",null):this.types.some((t=>"http://www.w3.org/ns/iana/media-types/application/pdf#Resource"===t.uri))?e("pos-app-pdf-viewer",null):this.types.some((t=>"http://purl.org/dc/terms/Image"===t.uri))?e("pos-app-image-viewer",null):e("pos-app-generic",null)}};export{D as ion_app,L as ion_badge,B as ion_button,J as ion_card,$ as ion_card_content,z as ion_card_header,H as ion_card_title,X as ion_col,Y as ion_content,et as ion_footer,it as ion_grid,ct as ion_header,bt as ion_icon,kt as ion_item,Et as ion_item_divider,St as ion_item_group,Ft as ion_label,At as ion_list,_t as ion_note,jt as ion_progress_bar,It as ion_ripple_effect,Nt as ion_row,Dt as ion_searchbar,Mt as ion_skeleton_text,Ut as ion_title,Lt as ion_toolbar,Wd as pos_app,qd as pos_app_browser,Vd as pos_app_generic,Xd as pos_app_image_viewer,Yd as pos_app_pdf_viewer,Zd as pos_app_rdf_document,Qd as pos_description,ef as pos_image,nf as pos_label,rf as pos_literals,of as pos_login,sf as pos_navigation_bar,af as pos_pdf,cf as pos_picture,lf as pos_relations,uf as pos_resource,hf as pos_reverse_relations,df as pos_rich_link,jf as pos_router,Cf as pos_subjects,Rf as pos_type_badges,If as pos_type_router}
|