@pod-os/elements 0.29.1-rc.88079dc.0 → 0.29.1-rc.aee4031.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/elements.cjs.js +1 -1
- package/dist/cjs/ion-icon_33.cjs.entry.js +14 -6
- package/dist/cjs/ion-icon_33.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/pos-tool-select/pos-tool-select.css +14 -5
- package/dist/collection/components/pos-tool-select/pos-tool-select.js +4 -1
- package/dist/collection/components/pos-tool-select/pos-tool-select.js.map +1 -1
- package/dist/collection/components/pos-type-router/pos-type-router.css +4 -2
- package/dist/collection/components/pos-type-router/pos-type-router.js +9 -2
- package/dist/collection/components/pos-type-router/pos-type-router.js.map +1 -1
- package/dist/collection/components/pos-type-router/selectToolsForTypes.js.map +1 -1
- package/dist/components/pos-app2.js +7 -2
- package/dist/components/pos-app2.js.map +1 -1
- package/dist/components/pos-tool-select2.js +2 -2
- package/dist/components/pos-tool-select2.js.map +1 -1
- package/dist/components/pos-type-router2.js +7 -3
- package/dist/components/pos-type-router2.js.map +1 -1
- package/dist/elements/elements.esm.js +1 -1
- package/dist/elements/elements.esm.js.map +1 -1
- package/dist/elements/{p-21649e42.entry.js → p-e7498ab7.entry.js} +11 -11
- package/dist/elements/p-e7498ab7.entry.js.map +1 -0
- package/dist/esm/elements.js +1 -1
- package/dist/esm/ion-icon_33.entry.js +14 -6
- package/dist/esm/ion-icon_33.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/pos-tool-select/pos-tool-select.d.ts +3 -0
- package/dist/types/components/pos-type-router/pos-type-router.d.ts +4 -0
- package/dist/types/components/pos-type-router/selectToolsForTypes.d.ts +25 -0
- package/dist/types/components.d.ts +24 -0
- package/package.json +3 -3
- package/dist/elements/p-21649e42.entry.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as t,r as e,h as n,H as i,e as s,f as r,w as o,i as a,j as c,k as l}from"./p-97889672.js";import{c as h,g as d,r as u}from"./p-3f316fc4.js";import{c as f,h as p,g as b}from"./p-669fab6c.js";import{c as m,g}from"./p-ebe1c8ca.js";import{E as w,s as v}from"./p-46b6ae86.js";import{c as y}from"./p-3a4d289f.js";import{p as k}from"./p-d6769f21.js";import{O as x,c as S,a as _,i as E,p as A,s as C,b as T,d as z,e as $,f as P,G as I,t as R}from"./p-01adc2b7.js";import{c as O}from"./p-b110cb49.js";import{w as D}from"./p-7efd6867.js";import{createGesture as j}from"./p-b943833e.js";import{c as L,s as M,B as W}from"./p-93f5c8ec.js";import{P as U,N as H,L as N}from"./p-c4ec5d75.js";import{s as J}from"./p-f6671856.js";import"./p-98c00bd2.js";import{s as B}from"./p-182f722d.js";import{g as K}from"./p-c066fd50.js";import"./p-bde7428a.js";import"./p-30cd90ec.js";var F=Object.defineProperty;var X=Object.defineProperties;var V=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyDescriptors;var q=Object.getOwnPropertySymbols;var G=Object.prototype.hasOwnProperty;var Z=Object.prototype.propertyIsEnumerable;var Q=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t);var tt=t=>{throw TypeError(t)};var et=(t,e,n)=>e in t?F(t,e,{enumerable:true,configurable:true,writable:true,value:n}):t[e]=n;var nt=(t,e)=>{for(var n in e||(e={}))if(G.call(e,n))et(t,n,e[n]);if(q)for(var n of q(e)){if(Z.call(e,n))et(t,n,e[n])}return t};var it=(t,e)=>X(t,Y(e));var st=(t,e,n,i)=>{var s=i>1?void 0:i?V(e,n):e;for(var r=t.length-1,o;r>=0;r--)if(o=t[r])s=(i?o(e,n,s):o(s))||s;if(i&&s)F(e,n,s);return s};var rt=(t,e,n)=>e.has(t)||tt("Cannot "+n);var ot=(t,e,n)=>(rt(t,e,"read from private field"),n?n.call(t):e.get(t));var at=(t,e,n)=>e.has(t)?tt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n);var ct=(t,e,n,i)=>(rt(t,e,"write to private field"),i?i.call(t,n):e.set(t,n),n);var lt=function(t,e){this[0]=t;this[1]=e};var ht=t=>{var e=t[Q("asyncIterator")],n=false,i,s={};if(e==null){e=t[Q("iterator")]();i=t=>s[t]=n=>e[t](n)}else{e=e.call(t);i=t=>s[t]=i=>{if(n){n=false;if(t==="throw")throw i;return i}n=true;return{done:false,value:new lt(new Promise((n=>{var s=e[t](i);if(!(s instanceof Object))tt("Object expected");n(s)})),1)}}}return s[Q("iterator")]=()=>s,i("next"),"throw"in e?i("throw"):s.throw=t=>{throw t},"return"in e&&i("return"),s};let dt;const ut=()=>{if(typeof window==="undefined"){return new Map}else{if(!dt){const t=window;t.Ionicons=t.Ionicons||{};dt=t.Ionicons.map=t.Ionicons.map||new Map}return dt}};const ft=t=>{let e=mt(t.src);if(e){return e}e=bt(t.name,t.icon,t.mode,t.ios,t.md);if(e){return pt(e,t)}if(t.icon){e=mt(t.icon);if(e){return e}e=mt(t.icon[t.mode]);if(e){return e}}return null};const pt=(e,n)=>{const i=ut().get(e);if(i){return i}try{return t(`svg/${e}.svg`)}catch(t){console.warn(`[Ionicons Warning]: Could not load icon with name "${e}". Ensure that the icon is registered using addIcons or that the icon SVG data is passed directly to the icon component.`,n)}};const bt=(t,e,n,i,s)=>{n=(n&&vt(n))==="ios"?"ios":"md";if(i&&n==="ios"){t=vt(i)}else if(s&&n==="md"){t=vt(s)}else{if(!t&&e&&!gt(e)){t=e}if(wt(t)){t=vt(t)}}if(!wt(t)||t.trim()===""){return null}const r=t.replace(/[a-z]|-|\d/gi,"");if(r!==""){return null}return t};const mt=t=>{if(wt(t)){t=t.trim();if(gt(t)){return t}}return null};const gt=t=>t.length>0&&/(\/|\.)/.test(t);const wt=t=>typeof t==="string";const vt=t=>t.toLowerCase();const yt=(t,e=[])=>{const n={};e.forEach((e=>{if(t.hasAttribute(e)){const i=t.getAttribute(e);if(i!==null){n[e]=t.getAttribute(e)}t.removeAttribute(e)}}));return n};const kt=t=>{if(t){if(t.dir!==""){return t.dir.toLowerCase()==="rtl"}}return(document===null||document===void 0?void 0:document.dir.toLowerCase())==="rtl"};const xt=t=>{const e=document.createElement("div");e.innerHTML=t;for(let t=e.childNodes.length-1;t>=0;t--){if(e.childNodes[t].nodeName.toLowerCase()!=="svg"){e.removeChild(e.childNodes[t])}}const n=e.firstElementChild;if(n&&n.nodeName.toLowerCase()==="svg"){const t=n.getAttribute("class")||"";n.setAttribute("class",(t+" s-ion-icon").trim());if(St(n)){return e.innerHTML}}return""};const St=t=>{if(t.nodeType===1){if(t.nodeName.toLowerCase()==="script"){return false}for(let e=0;e<t.attributes.length;e++){const n=t.attributes[e].name;if(wt(n)&&n.toLowerCase().indexOf("on")===0){return false}}for(let e=0;e<t.childNodes.length;e++){if(!St(t.childNodes[e])){return false}}}return true};const _t=t=>t.startsWith("data:image/svg+xml");const Et=t=>t.indexOf(";utf8,")!==-1;const At=new Map;const Ct=new Map;let Tt;const zt=(t,e)=>{let n=Ct.get(t);if(!n){if(typeof fetch!=="undefined"&&typeof document!=="undefined"){if(_t(t)&&Et(t)){if(!Tt){Tt=new DOMParser}const e=Tt.parseFromString(t,"text/html");const n=e.querySelector("svg");if(n){At.set(t,n.outerHTML)}return Promise.resolve()}else{n=fetch(t).then((n=>{if(n.ok){return n.text().then((n=>{if(n&&e!==false){n=xt(n)}At.set(t,n||"")}))}At.set(t,"")}));Ct.set(t,n)}}else{At.set(t,"");return Promise.resolve()}}return n};const $t=":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%}@supports (background: -webkit-named-image(i)){:host(.icon-rtl) .icon-inner{transform:scaleX(-1)}}@supports not selector(:dir(rtl)) and selector(:host-context([dir='rtl'])){:host(.icon-rtl) .icon-inner{transform:scaleX(-1)}}:host(.flip-rtl):host-context([dir='rtl']) .icon-inner{transform:scaleX(-1)}@supports selector(:dir(rtl)){:host(.flip-rtl:dir(rtl)) .icon-inner{transform:scaleX(-1)}:host(.flip-rtl:dir(ltr)) .icon-inner{transform:scaleX(1)}}:host(.icon-small){font-size:1.125rem !important}:host(.icon-large){font-size:2rem !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 Pt=$t;const It=class{constructor(t){e(this,t);this.iconName=null;this.inheritedAttributes={};this.didLoadIcon=false;this.svgContent=undefined;this.isVisible=false;this.mode=Rt();this.color=undefined;this.ios=undefined;this.md=undefined;this.flipRtl=undefined;this.name=undefined;this.src=undefined;this.icon=undefined;this.size=undefined;this.lazy=false;this.sanitize=true}componentWillLoad(){this.inheritedAttributes=yt(this.el,["aria-label"])}connectedCallback(){this.waitUntilVisible(this.el,"50px",(()=>{this.isVisible=true;this.loadIcon()}))}componentDidLoad(){if(!this.didLoadIcon){this.loadIcon()}}disconnectedCallback(){if(this.io){this.io.disconnect();this.io=undefined}}waitUntilVisible(t,e,n){if(this.lazy&&typeof window!=="undefined"&&window.IntersectionObserver){const i=this.io=new window.IntersectionObserver((t=>{if(t[0].isIntersecting){i.disconnect();this.io=undefined;n()}}),{rootMargin:e});i.observe(t)}else{n()}}loadIcon(){if(this.isVisible){const t=ft(this);if(t){if(At.has(t)){this.svgContent=At.get(t)}else{zt(t,this.sanitize).then((()=>this.svgContent=At.get(t)))}this.didLoadIcon=true}}this.iconName=bt(this.name,this.icon,this.mode,this.ios,this.md)}render(){const{flipRtl:t,iconName:e,inheritedAttributes:s,el:r}=this;const o=this.mode||"md";const a=e?(e.includes("arrow")||e.includes("chevron"))&&t!==false:false;const c=t||a;return n(i,Object.assign({role:"img",class:Object.assign(Object.assign({[o]:true},Ot(this.color)),{[`icon-${this.size}`]:!!this.size,"flip-rtl":c,"icon-rtl":c&&kt(r)})},s),this.svgContent?n("div",{class:"icon-inner",innerHTML:this.svgContent}):n("div",{class:"icon-inner"}))}static get assetsDirs(){return["svg"]}get el(){return s(this)}static get watchers(){return{name:["loadIcon"],src:["loadIcon"],icon:["loadIcon"],ios:["loadIcon"],md:["loadIcon"]}}};const Rt=()=>typeof document!=="undefined"&&document.documentElement.getAttribute("mode")||"md";const Ot=t=>t?{"ion-color":true,[`ion-color-${t}`]:true}:null;It.style=Pt;const Dt=":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}";const jt=Dt;const Lt=":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 Mt=Lt;const Wt=class{constructor(t){e(this,t);this.type="determinate";this.reversed=false;this.value=0;this.buffer=1;this.color=undefined}render(){const{color:t,type:e,reversed:s,value:r,buffer:o}=this;const a=m.getBoolean("_testing");const c=g(this);return n(i,{key:"944b79ed6fce1b2c0ed48681cd8517a5abbddd80",role:"progressbar","aria-valuenow":e==="determinate"?r:null,"aria-valuemin":"0","aria-valuemax":"1",class:f(t,{[c]:true,[`progress-bar-${e}`]:true,"progress-paused":a,"progress-bar-reversed":document.dir==="rtl"?!s:s})},e==="indeterminate"?Ut():Ht(r,o))}};const Ut=()=>n("div",{part:"track",class:"progress-buffer-bar"},n("div",{class:"indeterminate-bar-primary"},n("span",{part:"progress",class:"progress-indeterminate"})),n("div",{class:"indeterminate-bar-secondary"},n("span",{part:"progress",class:"progress-indeterminate"})));const Ht=(t,e)=>{const i=h(0,t,1);const s=h(0,e,1);return[n("div",{part:"progress",class:"progress",style:{transform:`scaleX(${i})`}}),n("div",{class:{"buffer-circles-container":true,"ion-hide":s===1},style:{transform:`translateX(${s*100}%)`}},n("div",{class:"buffer-circles-container",style:{transform:`translateX(-${s*100}%)`}},n("div",{part:"stream",class:"buffer-circles"}))),n("div",{part:"track",class:"progress-buffer-bar",style:{transform:`scaleX(${s})`}})]};Wt.style={ios:jt,md:Mt};const Nt=":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 Jt=Nt;const Bt=class{constructor(t){e(this,t);this.type="bounded"}async addRipple(t,e){return new Promise((n=>{r((()=>{const i=this.el.getBoundingClientRect();const s=i.width;const r=i.height;const a=Math.sqrt(s*s+r*r);const c=Math.max(r,s);const l=this.unbounded?c:a+Ft;const h=Math.floor(c*Xt);const d=l/h;let u=t-i.left;let f=e-i.top;if(this.unbounded){u=s*.5;f=r*.5}const p=u-h*.5;const b=f-h*.5;const m=s*.5-u;const g=r*.5-f;o((()=>{const t=document.createElement("div");t.classList.add("ripple-effect");const e=t.style;e.top=b+"px";e.left=p+"px";e.width=e.height=h+"px";e.setProperty("--final-scale",`${d}`);e.setProperty("--translate-end",`${m}px, ${g}px`);const i=this.el.shadowRoot||this.el;i.appendChild(t);setTimeout((()=>{n((()=>{Kt(t)}))}),225+100)}))}))}))}get unbounded(){return this.type==="unbounded"}render(){const t=g(this);return n(i,{key:"f1129019a6d556b008c754aeb79618c69baea9f8",role:"presentation",class:{[t]:true,unbounded:this.unbounded}})}get el(){return s(this)}};const Kt=t=>{t.classList.add("fade-out");setTimeout((()=>{t.remove()}),200)};const Ft=10;const Xt=.5;Bt.style=Jt;const Vt=":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 Yt=Vt;const qt=class{constructor(t){e(this,t);this.ionStyle=a(this,"ionStyle",7);this.animated=false}componentWillLoad(){this.emitStyle()}emitStyle(){const t={"skeleton-text":true};this.ionStyle.emit(t)}render(){const t=this.animated&&m.getBoolean("animated",true);const e=p("ion-avatar",this.el)||p("ion-thumbnail",this.el);const s=g(this);return n(i,{key:"4dab0fd2de666de12ad8f6dc6ed1e1de0be67ddd",class:{[s]:true,"skeleton-text-animated":t,"in-media":e}},n("span",{key:"f8f908ec24d65e63b14d9a54640a5f18f0fa8fa5"}," "))}get el(){return s(this)}};qt.style=Yt;
|
|
1
|
+
import{d as t,r as e,h as n,H as i,e as s,f as r,w as o,i as a,j as c,k as l}from"./p-97889672.js";import{c as h,g as d,r as u}from"./p-3f316fc4.js";import{c as f,h as p,g as b}from"./p-669fab6c.js";import{c as m,g}from"./p-ebe1c8ca.js";import{E as w,s as v}from"./p-46b6ae86.js";import{c as y}from"./p-3a4d289f.js";import{p as k}from"./p-d6769f21.js";import{O as x,c as S,a as _,i as E,p as A,s as C,b as z,d as T,e as $,f as P,G as I,t as R}from"./p-01adc2b7.js";import{c as O}from"./p-b110cb49.js";import{w as D}from"./p-7efd6867.js";import{createGesture as j}from"./p-b943833e.js";import{c as L,s as M,B as W}from"./p-93f5c8ec.js";import{P as U,N as H,L as N}from"./p-c4ec5d75.js";import{s as J}from"./p-f6671856.js";import"./p-98c00bd2.js";import{s as B}from"./p-182f722d.js";import{g as K}from"./p-c066fd50.js";import"./p-bde7428a.js";import"./p-30cd90ec.js";var F=Object.defineProperty;var X=Object.defineProperties;var V=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyDescriptors;var q=Object.getOwnPropertySymbols;var G=Object.prototype.hasOwnProperty;var Z=Object.prototype.propertyIsEnumerable;var Q=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t);var tt=t=>{throw TypeError(t)};var et=(t,e,n)=>e in t?F(t,e,{enumerable:true,configurable:true,writable:true,value:n}):t[e]=n;var nt=(t,e)=>{for(var n in e||(e={}))if(G.call(e,n))et(t,n,e[n]);if(q)for(var n of q(e)){if(Z.call(e,n))et(t,n,e[n])}return t};var it=(t,e)=>X(t,Y(e));var st=(t,e,n,i)=>{var s=i>1?void 0:i?V(e,n):e;for(var r=t.length-1,o;r>=0;r--)if(o=t[r])s=(i?o(e,n,s):o(s))||s;if(i&&s)F(e,n,s);return s};var rt=(t,e,n)=>e.has(t)||tt("Cannot "+n);var ot=(t,e,n)=>(rt(t,e,"read from private field"),n?n.call(t):e.get(t));var at=(t,e,n)=>e.has(t)?tt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n);var ct=(t,e,n,i)=>(rt(t,e,"write to private field"),i?i.call(t,n):e.set(t,n),n);var lt=function(t,e){this[0]=t;this[1]=e};var ht=t=>{var e=t[Q("asyncIterator")],n=false,i,s={};if(e==null){e=t[Q("iterator")]();i=t=>s[t]=n=>e[t](n)}else{e=e.call(t);i=t=>s[t]=i=>{if(n){n=false;if(t==="throw")throw i;return i}n=true;return{done:false,value:new lt(new Promise((n=>{var s=e[t](i);if(!(s instanceof Object))tt("Object expected");n(s)})),1)}}}return s[Q("iterator")]=()=>s,i("next"),"throw"in e?i("throw"):s.throw=t=>{throw t},"return"in e&&i("return"),s};let dt;const ut=()=>{if(typeof window==="undefined"){return new Map}else{if(!dt){const t=window;t.Ionicons=t.Ionicons||{};dt=t.Ionicons.map=t.Ionicons.map||new Map}return dt}};const ft=t=>{let e=mt(t.src);if(e){return e}e=bt(t.name,t.icon,t.mode,t.ios,t.md);if(e){return pt(e,t)}if(t.icon){e=mt(t.icon);if(e){return e}e=mt(t.icon[t.mode]);if(e){return e}}return null};const pt=(e,n)=>{const i=ut().get(e);if(i){return i}try{return t(`svg/${e}.svg`)}catch(t){console.warn(`[Ionicons Warning]: Could not load icon with name "${e}". Ensure that the icon is registered using addIcons or that the icon SVG data is passed directly to the icon component.`,n)}};const bt=(t,e,n,i,s)=>{n=(n&&vt(n))==="ios"?"ios":"md";if(i&&n==="ios"){t=vt(i)}else if(s&&n==="md"){t=vt(s)}else{if(!t&&e&&!gt(e)){t=e}if(wt(t)){t=vt(t)}}if(!wt(t)||t.trim()===""){return null}const r=t.replace(/[a-z]|-|\d/gi,"");if(r!==""){return null}return t};const mt=t=>{if(wt(t)){t=t.trim();if(gt(t)){return t}}return null};const gt=t=>t.length>0&&/(\/|\.)/.test(t);const wt=t=>typeof t==="string";const vt=t=>t.toLowerCase();const yt=(t,e=[])=>{const n={};e.forEach((e=>{if(t.hasAttribute(e)){const i=t.getAttribute(e);if(i!==null){n[e]=t.getAttribute(e)}t.removeAttribute(e)}}));return n};const kt=t=>{if(t){if(t.dir!==""){return t.dir.toLowerCase()==="rtl"}}return(document===null||document===void 0?void 0:document.dir.toLowerCase())==="rtl"};const xt=t=>{const e=document.createElement("div");e.innerHTML=t;for(let t=e.childNodes.length-1;t>=0;t--){if(e.childNodes[t].nodeName.toLowerCase()!=="svg"){e.removeChild(e.childNodes[t])}}const n=e.firstElementChild;if(n&&n.nodeName.toLowerCase()==="svg"){const t=n.getAttribute("class")||"";n.setAttribute("class",(t+" s-ion-icon").trim());if(St(n)){return e.innerHTML}}return""};const St=t=>{if(t.nodeType===1){if(t.nodeName.toLowerCase()==="script"){return false}for(let e=0;e<t.attributes.length;e++){const n=t.attributes[e].name;if(wt(n)&&n.toLowerCase().indexOf("on")===0){return false}}for(let e=0;e<t.childNodes.length;e++){if(!St(t.childNodes[e])){return false}}}return true};const _t=t=>t.startsWith("data:image/svg+xml");const Et=t=>t.indexOf(";utf8,")!==-1;const At=new Map;const Ct=new Map;let zt;const Tt=(t,e)=>{let n=Ct.get(t);if(!n){if(typeof fetch!=="undefined"&&typeof document!=="undefined"){if(_t(t)&&Et(t)){if(!zt){zt=new DOMParser}const e=zt.parseFromString(t,"text/html");const n=e.querySelector("svg");if(n){At.set(t,n.outerHTML)}return Promise.resolve()}else{n=fetch(t).then((n=>{if(n.ok){return n.text().then((n=>{if(n&&e!==false){n=xt(n)}At.set(t,n||"")}))}At.set(t,"")}));Ct.set(t,n)}}else{At.set(t,"");return Promise.resolve()}}return n};const $t=":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%}@supports (background: -webkit-named-image(i)){:host(.icon-rtl) .icon-inner{transform:scaleX(-1)}}@supports not selector(:dir(rtl)) and selector(:host-context([dir='rtl'])){:host(.icon-rtl) .icon-inner{transform:scaleX(-1)}}:host(.flip-rtl):host-context([dir='rtl']) .icon-inner{transform:scaleX(-1)}@supports selector(:dir(rtl)){:host(.flip-rtl:dir(rtl)) .icon-inner{transform:scaleX(-1)}:host(.flip-rtl:dir(ltr)) .icon-inner{transform:scaleX(1)}}:host(.icon-small){font-size:1.125rem !important}:host(.icon-large){font-size:2rem !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 Pt=$t;const It=class{constructor(t){e(this,t);this.iconName=null;this.inheritedAttributes={};this.didLoadIcon=false;this.svgContent=undefined;this.isVisible=false;this.mode=Rt();this.color=undefined;this.ios=undefined;this.md=undefined;this.flipRtl=undefined;this.name=undefined;this.src=undefined;this.icon=undefined;this.size=undefined;this.lazy=false;this.sanitize=true}componentWillLoad(){this.inheritedAttributes=yt(this.el,["aria-label"])}connectedCallback(){this.waitUntilVisible(this.el,"50px",(()=>{this.isVisible=true;this.loadIcon()}))}componentDidLoad(){if(!this.didLoadIcon){this.loadIcon()}}disconnectedCallback(){if(this.io){this.io.disconnect();this.io=undefined}}waitUntilVisible(t,e,n){if(this.lazy&&typeof window!=="undefined"&&window.IntersectionObserver){const i=this.io=new window.IntersectionObserver((t=>{if(t[0].isIntersecting){i.disconnect();this.io=undefined;n()}}),{rootMargin:e});i.observe(t)}else{n()}}loadIcon(){if(this.isVisible){const t=ft(this);if(t){if(At.has(t)){this.svgContent=At.get(t)}else{Tt(t,this.sanitize).then((()=>this.svgContent=At.get(t)))}this.didLoadIcon=true}}this.iconName=bt(this.name,this.icon,this.mode,this.ios,this.md)}render(){const{flipRtl:t,iconName:e,inheritedAttributes:s,el:r}=this;const o=this.mode||"md";const a=e?(e.includes("arrow")||e.includes("chevron"))&&t!==false:false;const c=t||a;return n(i,Object.assign({role:"img",class:Object.assign(Object.assign({[o]:true},Ot(this.color)),{[`icon-${this.size}`]:!!this.size,"flip-rtl":c,"icon-rtl":c&&kt(r)})},s),this.svgContent?n("div",{class:"icon-inner",innerHTML:this.svgContent}):n("div",{class:"icon-inner"}))}static get assetsDirs(){return["svg"]}get el(){return s(this)}static get watchers(){return{name:["loadIcon"],src:["loadIcon"],icon:["loadIcon"],ios:["loadIcon"],md:["loadIcon"]}}};const Rt=()=>typeof document!=="undefined"&&document.documentElement.getAttribute("mode")||"md";const Ot=t=>t?{"ion-color":true,[`ion-color-${t}`]:true}:null;It.style=Pt;const Dt=":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}";const jt=Dt;const Lt=":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 Mt=Lt;const Wt=class{constructor(t){e(this,t);this.type="determinate";this.reversed=false;this.value=0;this.buffer=1;this.color=undefined}render(){const{color:t,type:e,reversed:s,value:r,buffer:o}=this;const a=m.getBoolean("_testing");const c=g(this);return n(i,{key:"944b79ed6fce1b2c0ed48681cd8517a5abbddd80",role:"progressbar","aria-valuenow":e==="determinate"?r:null,"aria-valuemin":"0","aria-valuemax":"1",class:f(t,{[c]:true,[`progress-bar-${e}`]:true,"progress-paused":a,"progress-bar-reversed":document.dir==="rtl"?!s:s})},e==="indeterminate"?Ut():Ht(r,o))}};const Ut=()=>n("div",{part:"track",class:"progress-buffer-bar"},n("div",{class:"indeterminate-bar-primary"},n("span",{part:"progress",class:"progress-indeterminate"})),n("div",{class:"indeterminate-bar-secondary"},n("span",{part:"progress",class:"progress-indeterminate"})));const Ht=(t,e)=>{const i=h(0,t,1);const s=h(0,e,1);return[n("div",{part:"progress",class:"progress",style:{transform:`scaleX(${i})`}}),n("div",{class:{"buffer-circles-container":true,"ion-hide":s===1},style:{transform:`translateX(${s*100}%)`}},n("div",{class:"buffer-circles-container",style:{transform:`translateX(-${s*100}%)`}},n("div",{part:"stream",class:"buffer-circles"}))),n("div",{part:"track",class:"progress-buffer-bar",style:{transform:`scaleX(${s})`}})]};Wt.style={ios:jt,md:Mt};const Nt=":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 Jt=Nt;const Bt=class{constructor(t){e(this,t);this.type="bounded"}async addRipple(t,e){return new Promise((n=>{r((()=>{const i=this.el.getBoundingClientRect();const s=i.width;const r=i.height;const a=Math.sqrt(s*s+r*r);const c=Math.max(r,s);const l=this.unbounded?c:a+Ft;const h=Math.floor(c*Xt);const d=l/h;let u=t-i.left;let f=e-i.top;if(this.unbounded){u=s*.5;f=r*.5}const p=u-h*.5;const b=f-h*.5;const m=s*.5-u;const g=r*.5-f;o((()=>{const t=document.createElement("div");t.classList.add("ripple-effect");const e=t.style;e.top=b+"px";e.left=p+"px";e.width=e.height=h+"px";e.setProperty("--final-scale",`${d}`);e.setProperty("--translate-end",`${m}px, ${g}px`);const i=this.el.shadowRoot||this.el;i.appendChild(t);setTimeout((()=>{n((()=>{Kt(t)}))}),225+100)}))}))}))}get unbounded(){return this.type==="unbounded"}render(){const t=g(this);return n(i,{key:"f1129019a6d556b008c754aeb79618c69baea9f8",role:"presentation",class:{[t]:true,unbounded:this.unbounded}})}get el(){return s(this)}};const Kt=t=>{t.classList.add("fade-out");setTimeout((()=>{t.remove()}),200)};const Ft=10;const Xt=.5;Bt.style=Jt;const Vt=":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 Yt=Vt;const qt=class{constructor(t){e(this,t);this.ionStyle=a(this,"ionStyle",7);this.animated=false}componentWillLoad(){this.emitStyle()}emitStyle(){const t={"skeleton-text":true};this.ionStyle.emit(t)}render(){const t=this.animated&&m.getBoolean("animated",true);const e=p("ion-avatar",this.el)||p("ion-thumbnail",this.el);const s=g(this);return n(i,{key:"4dab0fd2de666de12ad8f6dc6ed1e1de0be67ddd",class:{[s]:true,"skeleton-text-animated":t,"in-media":e}},n("span",{key:"f8f908ec24d65e63b14d9a54640a5f18f0fa8fa5"}," "))}get el(){return s(this)}};qt.style=Yt;
|
|
2
2
|
/*!
|
|
3
3
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
4
4
|
*/function Gt(t,e,n,i){let s;if(n==="md"){s=t==="top"?8:-8}else{s=t==="top"?10:-10}if(e&&D){Zt(e,i);const n=e.getBoundingClientRect();if(t==="top"){s+=n.bottom}else if(t==="bottom"){s-=D.innerHeight-n.top}return{top:`${s}px`,bottom:`${s}px`}}else{return{top:`calc(${s}px + var(--ion-safe-area-top, 0px))`,bottom:`calc(${s}px - var(--ion-safe-area-bottom, 0px))`}}}function Zt(t,e){if(t.offsetParent===null){k("The positionAnchor element for ion-toast was found in the DOM, but appears to be hidden. This may lead to unexpected positioning of the toast.",e)}}const Qt=(t,e)=>Math.floor(t/2-e/2);
|
|
@@ -16,7 +16,7 @@ import{d as t,r as e,h as n,H as i,e as s,f as r,w as o,i as a,j as c,k as l}fro
|
|
|
16
16
|
*/const ie=t=>{const e=O();const n=O();const i=d(t);const s=i.querySelector(".toast-wrapper");n.addElement(s).fromTo("opacity",.99,0);return e.easing("cubic-bezier(.36,.66,.04,1)").duration(300).addAnimation(n)};
|
|
17
17
|
/*!
|
|
18
18
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
19
|
-
*/const se=(t,e,n)=>{const i=d(t).querySelector(".toast-wrapper");const s=t.clientHeight;const r=i.getBoundingClientRect();let o=0;const a=.5;const c=t.position==="middle"?.5:0;const l=t.position==="top"?-1:1;const h=Qt(s,r.height);const u=[{offset:0,transform:`translateY(-${h+r.height}px)`},{offset:.5,transform:`translateY(0px)`},{offset:1,transform:`translateY(${h+r.height}px)`}];const f=O("toast-swipe-to-dismiss-animation").addElement(i).duration(100);switch(t.position){case"middle":o=s+r.height;f.keyframes(u);f.progressStart(true,.5);break;case"top":o=r.bottom;f.keyframes([{offset:0,transform:`translateY(${e.top})`},{offset:1,transform:"translateY(-100%)"}]);f.progressStart(true,0);break;case"bottom":default:o=s-r.top;f.keyframes([{offset:0,transform:`translateY(${e.bottom})`},{offset:1,transform:"translateY(100%)"}]);f.progressStart(true,0);break}const p=t=>t*l/o;const b=t=>{const e=c+p(t.deltaY);f.progressStep(e)};const m=e=>{const s=e.velocityY;const r=(e.deltaY+s*1e3)/o*l;g.enable(false);let c=true;let d=1;let b=0;let m=0;if(t.position==="middle"){c=r>=a/2||r<=-a/2;d=1;b=0;const t=i.getBoundingClientRect();const n=t.top-h;const s=`${n}px`;const o=e.deltaY<=0?-1:1;const l=(h+t.height)*o;const u=c?`${l}px`:"0px";const p=[{offset:0,transform:`translateY(${s})`},{offset:1,transform:`translateY(${u})`}];f.keyframes(p);m=l-n}else{c=r>=a;d=c?1:0;b=p(e.deltaY);const t=c?1-b:b;m=t*o}const w=Math.min(Math.abs(m)/Math.abs(s),200);f.onFinish((()=>{if(c){n();f.destroy()}else{if(t.position==="middle"){f.keyframes(u).progressStart(true,.5)}else{f.progressStart(true,0)}g.enable(true)}}),{oneTimeCallback:true}).progressEnd(d,b,w)};const g=j({el:i,gestureName:"toast-swipe-to-dismiss",gesturePriority:x,direction:"y",onMove:b,onEnd:m});return g};const re=":host{--border-width:0;--border-style:none;--border-color:initial;--box-shadow:none;--min-width:auto;--width:auto;--min-height:auto;--height:auto;--max-height:auto;--white-space:normal;top:0;display:block;position:absolute;width:100%;height:100%;outline:none;color:var(--color);font-family:var(--ion-font-family, inherit);contain:strict;z-index:1001;pointer-events:none}@supports (inset-inline-start: 0){:host{inset-inline-start:0}}@supports not (inset-inline-start: 0){:host{left:0}:host-context([dir=rtl]){left:unset;right:unset;right:0}@supports selector(:dir(rtl)){:host(:dir(rtl)){left:unset;right:unset;right:0}}}:host(.overlay-hidden){display:none}:host(.ion-color){--button-color:inherit;color:var(--ion-color-contrast)}:host(.ion-color) .toast-button-cancel{color:inherit}:host(.ion-color) .toast-wrapper{background:var(--ion-color-base)}.toast-wrapper{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);box-shadow:var(--box-shadow)}@supports (inset-inline-start: 0){.toast-wrapper{inset-inline-start:var(--start);inset-inline-end:var(--end)}}@supports not (inset-inline-start: 0){.toast-wrapper{left:var(--start);right:var(--end)}:host-context([dir=rtl]) .toast-wrapper{left:unset;right:unset;left:var(--end);right:var(--start)}[dir=rtl] .toast-wrapper{left:unset;right:unset;left:var(--end);right:var(--start)}@supports selector(:dir(rtl)){.toast-wrapper:dir(rtl){left:unset;right:unset;left:var(--end);right:var(--start)}}}.toast-wrapper.toast-top{transform:translate3d(0, -100%, 0);top:0}.toast-wrapper.toast-bottom{transform:translate3d(0, 100%, 0);bottom:0}.toast-container{display:flex;align-items:center;pointer-events:auto;height:inherit;min-height:inherit;max-height:inherit;contain:content}.toast-layout-stacked .toast-container{flex-wrap:wrap}.toast-layout-baseline .toast-content{display:flex;flex:1;flex-direction:column;justify-content:center}.toast-icon{-webkit-margin-start:16px;margin-inline-start:16px}.toast-content{min-width:0}.toast-message{flex:1;white-space:var(--white-space)}.toast-button-group{display:flex}.toast-layout-stacked .toast-button-group{justify-content:end;width:100%}.toast-button{border:0;outline:none;color:var(--button-color);z-index:0}.toast-icon,.toast-button-icon{font-size:1.4em}.toast-button-inner{display:flex;align-items:center}@media (any-hover: hover){.toast-button:hover{cursor:pointer}}:host{--background:var(--ion-color-step-50, #f2f2f2);--border-radius:14px;--button-color:var(--ion-color-primary, #3880ff);--color:var(--ion-color-step-850, #262626);--max-width:700px;--max-height:478px;--start:10px;--end:10px;font-size:clamp(14px, 0.875rem, 43.4px)}.toast-wrapper{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:auto;margin-bottom:auto;display:block;position:absolute;z-index:10}@supports (backdrop-filter: blur(0)){:host(.toast-translucent) .toast-wrapper{background:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8);backdrop-filter:saturate(180%) blur(20px)}:host(.ion-color.toast-translucent) .toast-wrapper{background:rgba(var(--ion-color-base-rgb), 0.8)}}.toast-wrapper.toast-middle{opacity:0.01}.toast-content{-webkit-padding-start:15px;padding-inline-start:15px;-webkit-padding-end:15px;padding-inline-end:15px;padding-top:15px;padding-bottom:15px}.toast-header{margin-bottom:2px;font-weight:500}.toast-button{-webkit-padding-start:15px;padding-inline-start:15px;-webkit-padding-end:15px;padding-inline-end:15px;padding-top:10px;padding-bottom:10px;min-height:44px;transition:background-color, opacity 100ms linear;border:0;background-color:transparent;font-family:var(--ion-font-family);font-size:clamp(17px, 1.0625rem, 21.998px);font-weight:500;overflow:hidden}.toast-button.ion-activated{opacity:0.4}@media (any-hover: hover){.toast-button:hover{opacity:0.6}}";const oe=re;const ae=":host{--border-width:0;--border-style:none;--border-color:initial;--box-shadow:none;--min-width:auto;--width:auto;--min-height:auto;--height:auto;--max-height:auto;--white-space:normal;top:0;display:block;position:absolute;width:100%;height:100%;outline:none;color:var(--color);font-family:var(--ion-font-family, inherit);contain:strict;z-index:1001;pointer-events:none}@supports (inset-inline-start: 0){:host{inset-inline-start:0}}@supports not (inset-inline-start: 0){:host{left:0}:host-context([dir=rtl]){left:unset;right:unset;right:0}@supports selector(:dir(rtl)){:host(:dir(rtl)){left:unset;right:unset;right:0}}}:host(.overlay-hidden){display:none}:host(.ion-color){--button-color:inherit;color:var(--ion-color-contrast)}:host(.ion-color) .toast-button-cancel{color:inherit}:host(.ion-color) .toast-wrapper{background:var(--ion-color-base)}.toast-wrapper{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);box-shadow:var(--box-shadow)}@supports (inset-inline-start: 0){.toast-wrapper{inset-inline-start:var(--start);inset-inline-end:var(--end)}}@supports not (inset-inline-start: 0){.toast-wrapper{left:var(--start);right:var(--end)}:host-context([dir=rtl]) .toast-wrapper{left:unset;right:unset;left:var(--end);right:var(--start)}[dir=rtl] .toast-wrapper{left:unset;right:unset;left:var(--end);right:var(--start)}@supports selector(:dir(rtl)){.toast-wrapper:dir(rtl){left:unset;right:unset;left:var(--end);right:var(--start)}}}.toast-wrapper.toast-top{transform:translate3d(0, -100%, 0);top:0}.toast-wrapper.toast-bottom{transform:translate3d(0, 100%, 0);bottom:0}.toast-container{display:flex;align-items:center;pointer-events:auto;height:inherit;min-height:inherit;max-height:inherit;contain:content}.toast-layout-stacked .toast-container{flex-wrap:wrap}.toast-layout-baseline .toast-content{display:flex;flex:1;flex-direction:column;justify-content:center}.toast-icon{-webkit-margin-start:16px;margin-inline-start:16px}.toast-content{min-width:0}.toast-message{flex:1;white-space:var(--white-space)}.toast-button-group{display:flex}.toast-layout-stacked .toast-button-group{justify-content:end;width:100%}.toast-button{border:0;outline:none;color:var(--button-color);z-index:0}.toast-icon,.toast-button-icon{font-size:1.4em}.toast-button-inner{display:flex;align-items:center}@media (any-hover: hover){.toast-button:hover{cursor:pointer}}:host{--background:var(--ion-color-step-800, #333333);--border-radius:4px;--box-shadow:0 3px 5px -1px rgba(0, 0, 0, 0.2), 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12);--button-color:var(--ion-color-primary, #3880ff);--color:var(--ion-color-step-50, #f2f2f2);--max-width:700px;--start:8px;--end:8px;font-size:0.875rem}.toast-wrapper{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:auto;margin-bottom:auto;display:block;position:absolute;opacity:0.01;z-index:10}.toast-content{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:14px;padding-bottom:14px}.toast-header{margin-bottom:2px;font-weight:500;line-height:1.25rem}.toast-message{line-height:1.25rem}.toast-layout-baseline .toast-button-group-start{-webkit-margin-start:8px;margin-inline-start:8px}.toast-layout-stacked .toast-button-group-start{-webkit-margin-end:8px;margin-inline-end:8px;margin-top:8px}.toast-layout-baseline .toast-button-group-end{-webkit-margin-end:8px;margin-inline-end:8px}.toast-layout-stacked .toast-button-group-end{-webkit-margin-end:8px;margin-inline-end:8px;margin-bottom:8px}.toast-button{-webkit-padding-start:15px;padding-inline-start:15px;-webkit-padding-end:15px;padding-inline-end:15px;padding-top:10px;padding-bottom:10px;position:relative;background-color:transparent;font-family:var(--ion-font-family);font-size:0.875rem;font-weight:500;letter-spacing:0.84px;text-transform:uppercase;overflow:hidden}.toast-button-cancel{color:var(--ion-color-step-100, #e6e6e6)}.toast-button-icon-only{border-radius:50%;-webkit-padding-start:9px;padding-inline-start:9px;-webkit-padding-end:9px;padding-inline-end:9px;padding-top:9px;padding-bottom:9px;width:36px;height:36px}@media (any-hover: hover){.toast-button:hover{background-color:rgba(var(--ion-color-primary-rgb, 56, 128, 255), 0.08)}.toast-button-cancel:hover{background-color:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.08)}}";const ce=ae;const le=class{constructor(t){e(this,t);this.didPresent=a(this,"ionToastDidPresent",7);this.willPresent=a(this,"ionToastWillPresent",7);this.willDismiss=a(this,"ionToastWillDismiss",7);this.didDismiss=a(this,"ionToastDidDismiss",7);this.didPresentShorthand=a(this,"didPresent",7);this.willPresentShorthand=a(this,"willPresent",7);this.willDismissShorthand=a(this,"willDismiss",7);this.didDismissShorthand=a(this,"didDismiss",7);this.delegateController=S(this);this.lockController=y();this.triggerController=_();this.customHTMLEnabled=m.get("innerHTMLTemplatesEnabled",w);this.presented=false;this.dispatchCancelHandler=t=>{const e=t.detail.role;if(E(e)){const t=this.getButtons().find((t=>t.role==="cancel"));this.callButtonHandler(t)}};this.createSwipeGesture=t=>{const e=this.gesture=se(this.el,t,(()=>{this.dismiss(undefined,I)}));e.enable(true)};this.destroySwipeGesture=()=>{const{gesture:t}=this;if(t===undefined){return}t.destroy();this.gesture=undefined};this.prefersSwipeGesture=()=>{const{swipeGesture:t}=this;return t==="vertical"};this.revealContentToScreenReader=false;this.overlayIndex=undefined;this.delegate=undefined;this.hasController=false;this.color=undefined;this.enterAnimation=undefined;this.leaveAnimation=undefined;this.cssClass=undefined;this.duration=m.getNumber("toastDuration",0);this.header=undefined;this.layout="baseline";this.message=undefined;this.keyboardClose=false;this.position="bottom";this.positionAnchor=undefined;this.buttons=undefined;this.translucent=false;this.animated=true;this.icon=undefined;this.htmlAttributes=undefined;this.swipeGesture=undefined;this.isOpen=false;this.trigger=undefined}swipeGestureChanged(){this.destroySwipeGesture();if(this.presented&&this.prefersSwipeGesture()){this.createSwipeGesture(this.lastPresentedPosition)}}onIsOpenChange(t,e){if(t===true&&e===false){this.present()}else if(t===false&&e===true){this.dismiss()}}triggerChanged(){const{trigger:t,el:e,triggerController:n}=this;if(t){n.addClickListener(e,t)}}connectedCallback(){A(this.el);this.triggerChanged()}disconnectedCallback(){this.triggerController.removeClickListener()}componentWillLoad(){C(this.el)}componentDidLoad(){if(this.isOpen===true){u((()=>this.present()))}this.triggerChanged()}async present(){const t=await this.lockController.lock();await this.delegateController.attachViewToDom();const{el:e,position:n}=this;const i=this.getAnchorElement();const s=Gt(n,i,g(this),e);this.lastPresentedPosition=s;await T(this,"toastEnter",te,ne,{position:n,top:s.top,bottom:s.bottom});this.revealContentToScreenReader=true;if(this.duration>0){this.durationTimeout=setTimeout((()=>this.dismiss(undefined,"timeout")),this.duration)}if(this.prefersSwipeGesture()){this.createSwipeGesture(s)}t()}async dismiss(t,e){var n,i;const s=await this.lockController.lock();const{durationTimeout:r,position:o,lastPresentedPosition:a}=this;if(r){clearTimeout(r)}const c=await z(this,t,e,"toastLeave",ee,ie,{position:o,top:(n=a===null||a===void 0?void 0:a.top)!==null&&n!==void 0?n:"",bottom:(i=a===null||a===void 0?void 0:a.bottom)!==null&&i!==void 0?i:""});if(c){this.delegateController.removeViewFromDom();this.revealContentToScreenReader=false}this.lastPresentedPosition=undefined;this.destroySwipeGesture();s();return c}onDidDismiss(){return $(this.el,"ionToastDidDismiss")}onWillDismiss(){return $(this.el,"ionToastWillDismiss")}getButtons(){const t=this.buttons?this.buttons.map((t=>typeof t==="string"?{text:t}:t)):[];return t}getAnchorElement(){const{position:t,positionAnchor:e,el:n}=this;if(e===undefined){return}if(t==="middle"&&e!==undefined){k('The positionAnchor property is ignored when using position="middle".',this.el);return undefined}if(typeof e==="string"){const t=document.getElementById(e);if(t===null){k(`An anchor element with an ID of "${e}" was not found in the DOM.`,n);return undefined}return t}if(e instanceof HTMLElement){return e}k("Invalid positionAnchor value:",e,n);return undefined}async buttonClick(t){const e=t.role;if(E(e)){return this.dismiss(undefined,e)}const n=await this.callButtonHandler(t);if(n){return this.dismiss(undefined,e)}return Promise.resolve()}async callButtonHandler(t){if(t===null||t===void 0?void 0:t.handler){try{const e=await P(t.handler);if(e===false){return false}}catch(t){console.error(t)}}return true}renderButtons(t,e){if(t.length===0){return}const i=g(this);const s={"toast-button-group":true,[`toast-button-group-${e}`]:true};return n("div",{class:s},t.map((t=>n("button",Object.assign({},t.htmlAttributes,{type:"button",class:he(t),tabIndex:0,onClick:()=>this.buttonClick(t),part:de(t)}),n("div",{class:"toast-button-inner"},t.icon&&n("ion-icon",{"aria-hidden":"true",icon:t.icon,slot:t.text===undefined?"icon-only":undefined,class:"toast-button-icon"}),t.text),i==="md"&&n("ion-ripple-effect",{type:t.icon!==undefined&&t.text===undefined?"unbounded":"bounded"})))))}renderToastMessage(t,e=null){const{customHTMLEnabled:i,message:s}=this;if(i){return n("div",{key:t,"aria-hidden":e,class:"toast-message",part:"message",innerHTML:v(s)})}return n("div",{key:t,"aria-hidden":e,class:"toast-message",part:"message"},s)}renderHeader(t,e=null){return n("div",{key:t,class:"toast-header","aria-hidden":e,part:"header"},this.header)}render(){const{layout:t,el:e,revealContentToScreenReader:s,header:r,message:o}=this;const a=this.getButtons();const c=a.filter((t=>t.side==="start"));const l=a.filter((t=>t.side!=="start"));const h=g(this);const d={"toast-wrapper":true,[`toast-${this.position}`]:true,[`toast-layout-${t}`]:true};if(t==="stacked"&&c.length>0&&l.length>0){k("This toast is using start and end buttons with the stacked toast layout. We recommend following the best practice of using either start or end buttons with the stacked toast layout.",e)}return n(i,Object.assign({key:"23803334fb668f6ce7044d3a321cb84bc753bd16",tabindex:"-1"},this.htmlAttributes,{style:{zIndex:`${6e4+this.overlayIndex}`},class:f(this.color,Object.assign(Object.assign({[h]:true},b(this.cssClass)),{"overlay-hidden":true,"toast-translucent":this.translucent})),onIonToastWillDismiss:this.dispatchCancelHandler}),n("div",{key:"7cd7138ba079fccf97f318b91e9986491ab4214d",class:d},n("div",{key:"93b78fa64e24435adeb77a04c1d1d53d2f093864",class:"toast-container",part:"container"},this.renderButtons(c,"start"),this.icon!==undefined&&n("ion-icon",{key:"9a3c71b164ebcfba2540acb7568beffa76b62f47",class:"toast-icon",part:"icon",icon:this.icon,lazy:false,"aria-hidden":"true"}),n("div",{key:"feb9268102d844f1314205f7440de7066cf0620e",class:"toast-content",role:"status","aria-atomic":"true","aria-live":"polite"},!s&&r!==undefined&&this.renderHeader("oldHeader","true"),!s&&o!==undefined&&this.renderToastMessage("oldMessage","true"),s&&r!==undefined&&this.renderHeader("header"),s&&o!==undefined&&this.renderToastMessage("header")),this.renderButtons(l,"end"))))}get el(){return s(this)}static get watchers(){return{swipeGesture:["swipeGestureChanged"],isOpen:["onIsOpenChange"],trigger:["triggerChanged"]}}};const he=t=>Object.assign({"toast-button":true,"toast-button-icon-only":t.icon!==undefined&&t.text===undefined,[`toast-button-${t.role}`]:t.role!==undefined,"ion-focusable":true,"ion-activatable":true},b(t.cssClass));const de=t=>E(t.role)?"button cancel":"button";le.style={ios:oe,md:ce};const ue=":host{font-family:var(--font-sans);display:block}button#new{cursor:pointer;display:flex;align-items:center;justify-content:center;border:none;width:var(--size-10);height:var(--size-10);background-color:var(--pos-primary-color);color:var(--pos-primary-text-color);font-size:var(--scale-6);border-radius:var(--radius-xs)}button#new:hover,button#new:focus{outline:none;filter:brightness(110%);box-shadow:var(--shadow-sm)}pos-new-thing-form{margin:var(--scale-3)}";const fe=ue;const pe=class{constructor(t){e(this,t)}openDialog(){this.dialog.showModal()}render(){return n(i,{key:"6142a141ef03ca93a362a6b00ebe8d515c3a677a"},n("button",{key:"72ecf353cd3a7d2d68f9ef28eb1bbe7fdb88b700",id:"new",title:"Add a new thing",onClick:()=>this.openDialog()},n("ion-icon",{key:"bd05d75c42c10de6df519575787fc66eafb22930",name:"add-circle-outline"})),n("pos-dialog",{key:"23cf0118149704dfca16758970e4f4658e87e946",ref:t=>this.dialog=t},n("span",{key:"5af7b7f618cc20684c39134b5ea295400e651cb6",slot:"title"},"Add a new thing"),n("pos-new-thing-form",{key:"895496c2f6ede3c8677d9d918e0b13582090baed",slot:"content",referenceUri:this.referenceUri})))}};pe.style=fe;const be=localStorage.getItem("settings");const me=be?JSON.parse(be):{offlineCache:false};const ge=L(me);we();ve();function we(){ge.on("set",(()=>{const t=JSON.stringify(ge.state);localStorage.setItem("settings",t)}))}function ve(){window.addEventListener("storage",(t=>{if(t.key==="settings"&&t.newValue){const e=JSON.parse(t.newValue);ge.state.offlineCache=e.offlineCache}}))}const ye=(t,e)=>e.some((e=>t instanceof e));let ke;let xe;function Se(){return ke||(ke=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function _e(){return xe||(xe=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Ee=new WeakMap;const Ae=new WeakMap;const Ce=new WeakMap;function Te(t){const e=new Promise(((e,n)=>{const i=()=>{t.removeEventListener("success",s);t.removeEventListener("error",r)};const s=()=>{e(Oe(t.result));i()};const r=()=>{n(t.error);i()};t.addEventListener("success",s);t.addEventListener("error",r)}));Ce.set(e,t);return e}function ze(t){if(Ee.has(t))return;const e=new Promise(((e,n)=>{const i=()=>{t.removeEventListener("complete",s);t.removeEventListener("error",r);t.removeEventListener("abort",r)};const s=()=>{e();i()};const r=()=>{n(t.error||new DOMException("AbortError","AbortError"));i()};t.addEventListener("complete",s);t.addEventListener("error",r);t.addEventListener("abort",r)}));Ee.set(t,e)}let $e={get(t,e,n){if(t instanceof IDBTransaction){if(e==="done")return Ee.get(t);if(e==="store"){return n.objectStoreNames[1]?undefined:n.objectStore(n.objectStoreNames[0])}}return Oe(t[e])},set(t,e,n){t[e]=n;return true},has(t,e){if(t instanceof IDBTransaction&&(e==="done"||e==="store")){return true}return e in t}};function Pe(t){$e=t($e)}function Ie(t){if(_e().includes(t)){return function(...e){t.apply(De(this),e);return Oe(this.request)}}return function(...e){return Oe(t.apply(De(this),e))}}function Re(t){if(typeof t==="function")return Ie(t);if(t instanceof IDBTransaction)ze(t);if(ye(t,Se()))return new Proxy(t,$e);return t}function Oe(t){if(t instanceof IDBRequest)return Te(t);if(Ae.has(t))return Ae.get(t);const e=Re(t);if(e!==t){Ae.set(t,e);Ce.set(e,t)}return e}const De=t=>Ce.get(t);function je(t,e,{blocked:n,upgrade:i,blocking:s,terminated:r}={}){const o=indexedDB.open(t,e);const a=Oe(o);if(i){o.addEventListener("upgradeneeded",(t=>{i(Oe(o.result),t.oldVersion,t.newVersion,Oe(o.transaction),t)}))}if(n){o.addEventListener("blocked",(t=>n(t.oldVersion,t.newVersion,t)))}a.then((t=>{if(r)t.addEventListener("close",(()=>r()));if(s){t.addEventListener("versionchange",(t=>s(t.oldVersion,t.newVersion,t)))}})).catch((()=>{}));return a}const Le=["get","getKey","getAll","getAllKeys","count"];const Me=["put","add","delete","clear"];const We=new Map;function Ue(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e==="string")){return}if(We.get(e))return We.get(e);const n=e.replace(/FromIndex$/,"");const i=e!==n;const s=Me.includes(n);if(!(n in(i?IDBIndex:IDBObjectStore).prototype)||!(s||Le.includes(n))){return}const r=async function(t,...e){const r=this.transaction(t,s?"readwrite":"readonly");let o=r.store;if(i)o=o.index(e.shift());return(await Promise.all([o[n](...e),s&&r.done]))[0]};We.set(e,r);return r}Pe((t=>({...t,get:(e,n,i)=>Ue(e,n)||t.get(e,n,i),has:(e,n)=>!!Ue(e,n)||t.has(e,n)})));const He=["continue","continuePrimaryKey","advance"];const Ne={};const Je=new WeakMap;const Be=new WeakMap;const Ke={get(t,e){if(!He.includes(e))return t[e];let n=Ne[e];if(!n){n=Ne[e]=function(...t){Je.set(this,Be.get(this)[e](...t))}}return n}};async function*Fe(...t){let e=this;if(!(e instanceof IDBCursor)){e=await e.openCursor(...t)}if(!e)return;e=e;const n=new Proxy(e,Ke);Be.set(n,e);Ce.set(n,De(e));while(e){yield n;e=await(Je.get(n)||e.continue());Je.delete(n)}}function Xe(t,e){return e===Symbol.asyncIterator&&ye(t,[IDBIndex,IDBObjectStore,IDBCursor])||e==="iterate"&&ye(t,[IDBIndex,IDBObjectStore])}Pe((t=>({...t,get(e,n,i){if(Xe(e,n))return Fe;return t.get(e,n,i)},has(e,n){return Xe(e,n)||t.has(e,n)}})));class Ve{constructor(){this.dbPromise=je("OfflineCacheDB",1,{upgrade(t){if(!t.objectStoreNames.contains("documents")){const e=t.createObjectStore("documents",{keyPath:"url"});e.createIndex("url-revision",["url","revision"])}}})}async clear(){const t=await this.dbPromise;return t.clear("documents")}async get(t){const e=await this.dbPromise;return await e.get("documents",t)}async put(t){const e=await this.dbPromise;const n=await e.getFromIndex("documents","url-revision",[t.url,t.revision]);if(n){return}await e.put("documents",t)}}class Ye{isOnline(){return navigator.onLine}}const qe=(t,e)=>new U({session:t,offlineCache:e.offlineCache?new Ve:new H,onlineStatus:new Ye});function Ge(t){return typeof t==="function"}function Ze(t){const e=t=>{Error.call(t);t.stack=(new Error).stack};const n=t(e);n.prototype=Object.create(Error.prototype);n.prototype.constructor=n;return n}const Qe=Ze((t=>function e(n){t(this);this.message=n?`${n.length} errors occurred during unsubscription:\n${n.map(((t,e)=>`${e+1}) ${t.toString()}`)).join("\n ")}`:"";this.name="UnsubscriptionError";this.errors=n}));function tn(t,e){if(t){const n=t.indexOf(e);0<=n&&t.splice(n,1)}}class en{constructor(t){this.initialTeardown=t;this.closed=false;this._parentage=null;this._finalizers=null}unsubscribe(){let t;if(!this.closed){this.closed=true;const{_parentage:e}=this;if(e){this._parentage=null;if(Array.isArray(e)){for(const t of e){t.remove(this)}}else{e.remove(this)}}const{initialTeardown:n}=this;if(Ge(n)){try{n()}catch(e){t=e instanceof Qe?e.errors:[e]}}const{_finalizers:i}=this;if(i){this._finalizers=null;for(const e of i){try{rn(e)}catch(e){t=t!==null&&t!==void 0?t:[];if(e instanceof Qe){t=[...t,...e.errors]}else{t.push(e)}}}}if(t){throw new Qe(t)}}}add(t){var e;if(t&&t!==this){if(this.closed){rn(t)}else{if(t instanceof en){if(t.closed||t._hasParent(this)){return}t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}}}_hasParent(t){const{_parentage:e}=this;return e===t||Array.isArray(e)&&e.includes(t)}_addParent(t){const{_parentage:e}=this;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t}_removeParent(t){const{_parentage:e}=this;if(e===t){this._parentage=null}else if(Array.isArray(e)){tn(e,t)}}remove(t){const{_finalizers:e}=this;e&&tn(e,t);if(t instanceof en){t._removeParent(this)}}}en.EMPTY=(()=>{const t=new en;t.closed=true;return t})();const nn=en.EMPTY;function sn(t){return t instanceof en||t&&"closed"in t&&Ge(t.remove)&&Ge(t.add)&&Ge(t.unsubscribe)}function rn(t){if(Ge(t)){t()}else{t.unsubscribe()}}const on={onUnhandledError:null,onStoppedNotification:null,Promise:undefined,useDeprecatedSynchronousErrorHandling:false,useDeprecatedNextContext:false};const an={setTimeout(t,e,...n){const{delegate:i}=an;if(i===null||i===void 0?void 0:i.setTimeout){return i.setTimeout(t,e,...n)}return setTimeout(t,e,...n)},clearTimeout(t){const{delegate:e}=an;return((e===null||e===void 0?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:undefined};function cn(t){an.setTimeout((()=>{const{onUnhandledError:e}=on;if(e){e(t)}else{throw t}}))}function ln(){}const hn=(()=>fn("C",undefined,undefined))();function dn(t){return fn("E",undefined,t)}function un(t){return fn("N",t,undefined)}function fn(t,e,n){return{kind:t,value:e,error:n}}let pn=null;function bn(t){if(on.useDeprecatedSynchronousErrorHandling){const e=!pn;if(e){pn={errorThrown:false,error:null}}t();if(e){const{errorThrown:t,error:e}=pn;pn=null;if(t){throw e}}}else{t()}}class mn extends en{constructor(t){super();this.isStopped=false;if(t){this.destination=t;if(sn(t)){t.add(this)}}else{this.destination=_n}}static create(t,e,n){return new yn(t,e,n)}next(t){if(this.isStopped){Sn(un(t),this)}else{this._next(t)}}error(t){if(this.isStopped){Sn(dn(t),this)}else{this.isStopped=true;this._error(t)}}complete(){if(this.isStopped){Sn(hn,this)}else{this.isStopped=true;this._complete()}}unsubscribe(){if(!this.closed){this.isStopped=true;super.unsubscribe();this.destination=null}}_next(t){this.destination.next(t)}_error(t){try{this.destination.error(t)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const gn=Function.prototype.bind;function wn(t,e){return gn.call(t,e)}class vn{constructor(t){this.partialObserver=t}next(t){const{partialObserver:e}=this;if(e.next){try{e.next(t)}catch(t){kn(t)}}}error(t){const{partialObserver:e}=this;if(e.error){try{e.error(t)}catch(t){kn(t)}}else{kn(t)}}complete(){const{partialObserver:t}=this;if(t.complete){try{t.complete()}catch(t){kn(t)}}}}class yn extends mn{constructor(t,e,n){super();let i;if(Ge(t)||!t){i={next:t!==null&&t!==void 0?t:undefined,error:e!==null&&e!==void 0?e:undefined,complete:n!==null&&n!==void 0?n:undefined}}else{let e;if(this&&on.useDeprecatedNextContext){e=Object.create(t);e.unsubscribe=()=>this.unsubscribe();i={next:t.next&&wn(t.next,e),error:t.error&&wn(t.error,e),complete:t.complete&&wn(t.complete,e)}}else{i=t}}this.destination=new vn(i)}}function kn(t){{cn(t)}}function xn(t){throw t}function Sn(t,e){const{onStoppedNotification:n}=on;n&&an.setTimeout((()=>n(t,e)))}const _n={closed:true,next:ln,error:xn,complete:ln};const En=(()=>typeof Symbol==="function"&&Symbol.observable||"@@observable")();function An(t){return t}function Cn(t){if(t.length===0){return An}if(t.length===1){return t[0]}return function e(n){return t.reduce(((t,e)=>e(t)),n)}}class Tn{constructor(t){if(t){this._subscribe=t}}lift(t){const e=new Tn;e.source=this;e.operator=t;return e}subscribe(t,e,n){const i=Pn(t)?t:new yn(t,e,n);bn((()=>{const{operator:t,source:e}=this;i.add(t?t.call(i,e):e?this._subscribe(i):this._trySubscribe(i))}));return i}_trySubscribe(t){try{return this._subscribe(t)}catch(e){t.error(e)}}forEach(t,e){e=zn(e);return new e(((e,n)=>{const i=new yn({next:e=>{try{t(e)}catch(t){n(t);i.unsubscribe()}},error:n,complete:e});this.subscribe(i)}))}_subscribe(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)}[En](){return this}pipe(...t){return Cn(t)(this)}toPromise(t){t=zn(t);return new t(((t,e)=>{let n;this.subscribe((t=>n=t),(t=>e(t)),(()=>t(n)))}))}}Tn.create=t=>new Tn(t);function zn(t){var e;return(e=t!==null&&t!==void 0?t:on.Promise)!==null&&e!==void 0?e:Promise}function $n(t){return t&&Ge(t.next)&&Ge(t.error)&&Ge(t.complete)}function Pn(t){return t&&t instanceof mn||$n(t)&&sn(t)}function In(t){return Ge(t===null||t===void 0?void 0:t.lift)}function Rn(t){return e=>{if(In(e)){return e.lift((function(e){try{return t(e,this)}catch(t){this.error(t)}}))}throw new TypeError("Unable to lift unknown Observable type")}}function On(t,e,n,i,s){return new Dn(t,e,n,i,s)}class Dn extends mn{constructor(t,e,n,i,s,r){super(t);this.onFinalize=s;this.shouldUnsubscribe=r;this._next=e?function(n){try{e(n)}catch(e){t.error(e)}}:super._next;this._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:super._error;this._complete=n?function(){try{n()}catch(e){t.error(e)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){const{closed:e}=this;super.unsubscribe();!e&&((t=this.onFinalize)===null||t===void 0?void 0:t.call(this))}}}const jn=Ze((t=>function e(){t(this);this.name="ObjectUnsubscribedError";this.message="object unsubscribed"}));class Ln extends Tn{constructor(){super();this.closed=false;this.currentObservers=null;this.observers=[];this.isStopped=false;this.hasError=false;this.thrownError=null}lift(t){const e=new Mn(this,this);e.operator=t;return e}_throwIfClosed(){if(this.closed){throw new jn}}next(t){bn((()=>{this._throwIfClosed();if(!this.isStopped){if(!this.currentObservers){this.currentObservers=Array.from(this.observers)}for(const e of this.currentObservers){e.next(t)}}}))}error(t){bn((()=>{this._throwIfClosed();if(!this.isStopped){this.hasError=this.isStopped=true;this.thrownError=t;const{observers:e}=this;while(e.length){e.shift().error(t)}}}))}complete(){bn((()=>{this._throwIfClosed();if(!this.isStopped){this.isStopped=true;const{observers:t}=this;while(t.length){t.shift().complete()}}}))}unsubscribe(){this.isStopped=this.closed=true;this.observers=this.currentObservers=null}get observed(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0}_trySubscribe(t){this._throwIfClosed();return super._trySubscribe(t)}_subscribe(t){this._throwIfClosed();this._checkFinalizedStatuses(t);return this._innerSubscribe(t)}_innerSubscribe(t){const{hasError:e,isStopped:n,observers:i}=this;if(e||n){return nn}this.currentObservers=null;i.push(t);return new en((()=>{this.currentObservers=null;tn(i,t)}))}_checkFinalizedStatuses(t){const{hasError:e,thrownError:n,isStopped:i}=this;if(e){t.error(n)}else if(i){t.complete()}}asObservable(){const t=new Tn;t.source=this;return t}}Ln.create=(t,e)=>new Mn(t,e);class Mn extends Ln{constructor(t,e){super();this.destination=t;this.source=e}next(t){var e,n;(n=(e=this.destination)===null||e===void 0?void 0:e.next)===null||n===void 0?void 0:n.call(e,t)}error(t){var e,n;(n=(e=this.destination)===null||e===void 0?void 0:e.error)===null||n===void 0?void 0:n.call(e,t)}complete(){var t,e;(e=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||e===void 0?void 0:e.call(t)}_subscribe(t){var e,n;return(n=(e=this.source)===null||e===void 0?void 0:e.subscribe(t))!==null&&n!==void 0?n:nn}}class Wn extends Ln{constructor(t){super();this._value=t}get value(){return this.getValue()}_subscribe(t){const e=super._subscribe(t);!e.closed&&t.next(this._value);return e}getValue(){const{hasError:t,thrownError:e,_value:n}=this;if(t){throw e}this._throwIfClosed();return n}next(t){super.next(this._value=t)}}const Un={now(){return(Un.delegate||Date).now()},delegate:undefined};class Hn extends en{constructor(t,e){super()}schedule(t,e=0){return this}}const Nn={setInterval(t,e,...n){const{delegate:i}=Nn;if(i===null||i===void 0?void 0:i.setInterval){return i.setInterval(t,e,...n)}return setInterval(t,e,...n)},clearInterval(t){const{delegate:e}=Nn;return((e===null||e===void 0?void 0:e.clearInterval)||clearInterval)(t)},delegate:undefined};class Jn extends Hn{constructor(t,e){super(t,e);this.scheduler=t;this.work=e;this.pending=false}schedule(t,e=0){var n;if(this.closed){return this}this.state=t;const i=this.id;const s=this.scheduler;if(i!=null){this.id=this.recycleAsyncId(s,i,e)}this.pending=true;this.delay=e;this.id=(n=this.id)!==null&&n!==void 0?n:this.requestAsyncId(s,this.id,e);return this}requestAsyncId(t,e,n=0){return Nn.setInterval(t.flush.bind(t,this),n)}recycleAsyncId(t,e,n=0){if(n!=null&&this.delay===n&&this.pending===false){return e}if(e!=null){Nn.clearInterval(e)}return undefined}execute(t,e){if(this.closed){return new Error("executing a cancelled action")}this.pending=false;const n=this._execute(t,e);if(n){return n}else if(this.pending===false&&this.id!=null){this.id=this.recycleAsyncId(this.scheduler,this.id,null)}}_execute(t,e){let n=false;let i;try{this.work(t)}catch(t){n=true;i=t?t:new Error("Scheduled action threw falsy error")}if(n){this.unsubscribe();return i}}unsubscribe(){if(!this.closed){const{id:t,scheduler:e}=this;const{actions:n}=e;this.work=this.state=this.scheduler=null;this.pending=false;tn(n,this);if(t!=null){this.id=this.recycleAsyncId(e,t,null)}this.delay=null;super.unsubscribe()}}}class Bn{constructor(t,e=Bn.now){this.schedulerActionCtor=t;this.now=e}schedule(t,e=0,n){return new this.schedulerActionCtor(this,t).schedule(n,e)}}Bn.now=Un.now;class Kn extends Bn{constructor(t,e=Bn.now){super(t,e);this.actions=[];this._active=false}flush(t){const{actions:e}=this;if(this._active){e.push(t);return}let n;this._active=true;do{if(n=t.execute(t.state,t.delay)){break}}while(t=e.shift());this._active=false;if(n){while(t=e.shift()){t.unsubscribe()}throw n}}}const Fn=new Kn(Jn);function Xn(t,e,n,i){function s(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,r){function o(t){try{c(i.next(t))}catch(t){r(t)}}function a(t){try{c(i["throw"](t))}catch(t){r(t)}}function c(t){t.done?n(t.value):s(t.value).then(o,a)}c((i=i.apply(t,e||[])).next())}))}function Vn(t){var e=typeof Symbol==="function"&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&i>=t.length)t=void 0;return{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Yn(t){return this instanceof Yn?(this.v=t,this):new Yn(t)}function qn(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n.apply(t,e||[]),s,r=[];return s={},o("next"),o("throw"),o("return"),s[Symbol.asyncIterator]=function(){return this},s;function o(t){if(i[t])s[t]=function(e){return new Promise((function(n,i){r.push([t,e,n,i])>1||a(t,e)}))}}function a(t,e){try{c(i[t](e))}catch(t){d(r[0][3],t)}}function c(t){t.value instanceof Yn?Promise.resolve(t.value.v).then(l,h):d(r[0][2],t)}function l(t){a("next",t)}function h(t){a("throw",t)}function d(t,e){if(t(e),r.shift(),r.length)a(r[0][0],r[0][1])}}function Gn(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof Vn==="function"?Vn(t):t[Symbol.iterator](),n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n);function i(e){n[e]=t[e]&&function(n){return new Promise((function(i,r){n=t[e](n),s(i,r,n.done,n.value)}))}}function s(t,e,n,i){Promise.resolve(i).then((function(e){t({value:e,done:n})}),e)}}typeof SuppressedError==="function"?SuppressedError:function(t,e,n){var i=new Error(n);return i.name="SuppressedError",i.error=t,i.suppressed=e,i};const Zn=t=>t&&typeof t.length==="number"&&typeof t!=="function";function Qn(t){return Ge(t===null||t===void 0?void 0:t.then)}function ti(t){return Ge(t[En])}function ei(t){return Symbol.asyncIterator&&Ge(t===null||t===void 0?void 0:t[Symbol.asyncIterator])}function ni(t){return new TypeError(`You provided ${t!==null&&typeof t==="object"?"an invalid object":`'${t}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function ii(){if(typeof Symbol!=="function"||!Symbol.iterator){return"@@iterator"}return Symbol.iterator}const si=ii();function ri(t){return Ge(t===null||t===void 0?void 0:t[si])}function oi(t){return qn(this,arguments,(function*e(){const n=t.getReader();try{while(true){const{value:t,done:e}=yield Yn(n.read());if(e){return yield Yn(void 0)}yield yield Yn(t)}}finally{n.releaseLock()}}))}function ai(t){return Ge(t===null||t===void 0?void 0:t.getReader)}function ci(t){if(t instanceof Tn){return t}if(t!=null){if(ti(t)){return li(t)}if(Zn(t)){return hi(t)}if(Qn(t)){return di(t)}if(ei(t)){return fi(t)}if(ri(t)){return ui(t)}if(ai(t)){return pi(t)}}throw ni(t)}function li(t){return new Tn((e=>{const n=t[En]();if(Ge(n.subscribe)){return n.subscribe(e)}throw new TypeError("Provided object does not correctly implement Symbol.observable")}))}function hi(t){return new Tn((e=>{for(let n=0;n<t.length&&!e.closed;n++){e.next(t[n])}e.complete()}))}function di(t){return new Tn((e=>{t.then((t=>{if(!e.closed){e.next(t);e.complete()}}),(t=>e.error(t))).then(null,cn)}))}function ui(t){return new Tn((e=>{for(const n of t){e.next(n);if(e.closed){return}}e.complete()}))}function fi(t){return new Tn((e=>{bi(t,e).catch((t=>e.error(t)))}))}function pi(t){return fi(oi(t))}function bi(t,e){var n,i;var s,r;return Xn(this,void 0,void 0,(function*(){try{for(n=Gn(t);i=yield n.next(),!i.done;){const t=i.value;e.next(t);if(e.closed){return}}}catch(t){s={error:t}}finally{try{if(i&&!i.done&&(r=n.return))yield r.call(n)}finally{if(s)throw s.error}}e.complete()}))}function mi(t,e=Fn){return Rn(((n,i)=>{let s=null;let r=null;let o=null;const a=()=>{if(s){s.unsubscribe();s=null;const t=r;r=null;i.next(t)}};function c(){const n=o+t;const r=e.now();if(r<n){s=this.schedule(undefined,n-r);i.add(s);return}a()}n.subscribe(On(i,(n=>{r=n;o=e.now();if(!s){s=e.schedule(c,t);i.add(s)}}),(()=>{a();i.complete()}),undefined,(()=>{r=s=null})))}))}function gi(t){return Rn(((e,n)=>{ci(t).subscribe(On(n,(()=>n.complete()),ln));!n.closed&&e.subscribe(n)}))}var wi=crypto;const vi=t=>t instanceof CryptoKey;const yi=async(t,e)=>{const n=`SHA-${t.slice(-3)}`;return new Uint8Array(await wi.subtle.digest(n,e))};var ki=yi;const xi=new TextEncoder;const Si=new TextDecoder;function _i(...t){const e=t.reduce(((t,{length:e})=>t+e),0);const n=new Uint8Array(e);let i=0;for(const e of t){n.set(e,i);i+=e.length}return n}const Ei=t=>{let e=t;if(typeof e==="string"){e=xi.encode(e)}const n=32768;const i=[];for(let t=0;t<e.length;t+=n){i.push(String.fromCharCode.apply(null,e.subarray(t,t+n)))}return btoa(i.join(""))};const Ai=t=>Ei(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_");const Ci=t=>{const e=atob(t);const n=new Uint8Array(e.length);for(let t=0;t<e.length;t++){n[t]=e.charCodeAt(t)}return n};const Ti=t=>{let e=t;if(e instanceof Uint8Array){e=Si.decode(e)}e=e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return Ci(e)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}};class zi extends Error{constructor(t,e){super(t,e);this.code="ERR_JOSE_GENERIC";this.name=this.constructor.name;Error.captureStackTrace?.(this,this.constructor)}}zi.code="ERR_JOSE_GENERIC";class $i extends zi{constructor(t,e,n="unspecified",i="unspecified"){super(t,{cause:{claim:n,reason:i,payload:e}});this.code="ERR_JWT_CLAIM_VALIDATION_FAILED";this.claim=n;this.reason=i;this.payload=e}}$i.code="ERR_JWT_CLAIM_VALIDATION_FAILED";class Pi extends zi{constructor(t,e,n="unspecified",i="unspecified"){super(t,{cause:{claim:n,reason:i,payload:e}});this.code="ERR_JWT_EXPIRED";this.claim=n;this.reason=i;this.payload=e}}Pi.code="ERR_JWT_EXPIRED";class Ii extends zi{constructor(){super(...arguments);this.code="ERR_JOSE_ALG_NOT_ALLOWED"}}Ii.code="ERR_JOSE_ALG_NOT_ALLOWED";class Ri extends zi{constructor(){super(...arguments);this.code="ERR_JOSE_NOT_SUPPORTED"}}Ri.code="ERR_JOSE_NOT_SUPPORTED";class Oi extends zi{constructor(t="decryption operation failed",e){super(t,e);this.code="ERR_JWE_DECRYPTION_FAILED"}}Oi.code="ERR_JWE_DECRYPTION_FAILED";class Di extends zi{constructor(){super(...arguments);this.code="ERR_JWE_INVALID"}}Di.code="ERR_JWE_INVALID";class ji extends zi{constructor(){super(...arguments);this.code="ERR_JWS_INVALID"}}ji.code="ERR_JWS_INVALID";class Li extends zi{constructor(){super(...arguments);this.code="ERR_JWT_INVALID"}}Li.code="ERR_JWT_INVALID";class Mi extends zi{constructor(){super(...arguments);this.code="ERR_JWK_INVALID"}}Mi.code="ERR_JWK_INVALID";class Wi extends zi{constructor(){super(...arguments);this.code="ERR_JWKS_INVALID"}}Wi.code="ERR_JWKS_INVALID";class Ui extends zi{constructor(t="no applicable key found in the JSON Web Key Set",e){super(t,e);this.code="ERR_JWKS_NO_MATCHING_KEY"}}Ui.code="ERR_JWKS_NO_MATCHING_KEY";class Hi extends zi{constructor(t="multiple matching keys found in the JSON Web Key Set",e){super(t,e);this.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS"}}Hi.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";class Ni extends zi{constructor(t="request timed out",e){super(t,e);this.code="ERR_JWKS_TIMEOUT"}}Ni.code="ERR_JWKS_TIMEOUT";class Ji extends zi{constructor(t="signature verification failed",e){super(t,e);this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}}Ji.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";function Bi(t,e="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${e} must be ${t}`)}function Ki(t,e){return t.name===e}function Fi(t){return parseInt(t.name.slice(4),10)}function Xi(t){switch(t){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}function Vi(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 n=e.pop();t+=`one of ${e.join(", ")}, or ${n}.`}else if(e.length===2){t+=`one of ${e[0]} or ${e[1]}.`}else{t+=`${e[0]}.`}throw new TypeError(t)}}function Yi(t,e,...n){switch(e){case"HS256":case"HS384":case"HS512":{if(!Ki(t.algorithm,"HMAC"))throw Bi("HMAC");const n=parseInt(e.slice(2),10);const i=Fi(t.algorithm.hash);if(i!==n)throw Bi(`SHA-${n}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!Ki(t.algorithm,"RSASSA-PKCS1-v1_5"))throw Bi("RSASSA-PKCS1-v1_5");const n=parseInt(e.slice(2),10);const i=Fi(t.algorithm.hash);if(i!==n)throw Bi(`SHA-${n}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!Ki(t.algorithm,"RSA-PSS"))throw Bi("RSA-PSS");const n=parseInt(e.slice(2),10);const i=Fi(t.algorithm.hash);if(i!==n)throw Bi(`SHA-${n}`,"algorithm.hash");break}case"EdDSA":{if(t.algorithm.name!=="Ed25519"&&t.algorithm.name!=="Ed448"){throw Bi("Ed25519 or Ed448")}break}case"Ed25519":{if(!Ki(t.algorithm,"Ed25519"))throw Bi("Ed25519");break}case"ES256":case"ES384":case"ES512":{if(!Ki(t.algorithm,"ECDSA"))throw Bi("ECDSA");const n=Xi(e);const i=t.algorithm.namedCurve;if(i!==n)throw Bi(n,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}Vi(t,n)}function qi(t,e,...n){n=n.filter(Boolean);if(n.length>2){const e=n.pop();t+=`one of type ${n.join(", ")}, or ${e}.`}else if(n.length===2){t+=`one of type ${n[0]} or ${n[1]}.`}else{t+=`of type ${n[0]}.`}if(e==null){t+=` Received ${e}`}else if(typeof e==="function"&&e.name){t+=` Received function ${e.name}`}else if(typeof e==="object"&&e!=null){if(e.constructor?.name){t+=` Received an instance of ${e.constructor.name}`}}return t}var Gi=(t,...e)=>qi("Key must be ",t,...e);function Zi(t,e,...n){return qi(`Key for the ${t} algorithm must be `,e,...n)}var Qi=t=>{if(vi(t)){return true}return t?.[Symbol.toStringTag]==="KeyObject"};const ts=["CryptoKey"];const es=(...t)=>{const e=t.filter(Boolean);if(e.length===0||e.length===1){return true}let n;for(const t of e){const e=Object.keys(t);if(!n||n.size===0){n=new Set(e);continue}for(const t of e){if(n.has(t)){return false}n.add(t)}}return true};var ns=es;function is(t){return typeof t==="object"&&t!==null}function ss(t){if(!is(t)||Object.prototype.toString.call(t)!=="[object Object]"){return false}if(Object.getPrototypeOf(t)===null){return true}let e=t;while(Object.getPrototypeOf(e)!==null){e=Object.getPrototypeOf(e)}return Object.getPrototypeOf(t)===e}var rs=(t,e)=>{if(t.startsWith("RS")||t.startsWith("PS")){const{modulusLength:n}=e.algorithm;if(typeof n!=="number"||n<2048){throw new TypeError(`${t} requires key modulusLength to be 2048 bits or larger`)}}};function os(t){return ss(t)&&typeof t.kty==="string"}function as(t){return t.kty!=="oct"&&typeof t.d==="string"}function cs(t){return t.kty!=="oct"&&typeof t.d==="undefined"}function ls(t){return os(t)&&t.kty==="oct"&&typeof t.k==="string"}function hs(t){let e;let n;switch(t.kty){case"RSA":{switch(t.alg){case"PS256":case"PS384":case"PS512":e={name:"RSA-PSS",hash:`SHA-${t.alg.slice(-3)}`};n=t.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":e={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${t.alg.slice(-3)}`};n=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}`};n=t.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new Ri('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"EC":{switch(t.alg){case"ES256":e={name:"ECDSA",namedCurve:"P-256"};n=t.d?["sign"]:["verify"];break;case"ES384":e={name:"ECDSA",namedCurve:"P-384"};n=t.d?["sign"]:["verify"];break;case"ES512":e={name:"ECDSA",namedCurve:"P-521"};n=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};n=t.d?["deriveBits"]:[];break;default:throw new Ri('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"OKP":{switch(t.alg){case"Ed25519":e={name:"Ed25519"};n=t.d?["sign"]:["verify"];break;case"EdDSA":e={name:t.crv};n=t.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":e={name:t.crv};n=t.d?["deriveBits"]:[];break;default:throw new Ri('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}default:throw new Ri('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:e,keyUsages:n}}const ds=async t=>{if(!t.alg){throw new TypeError('"alg" argument is required when "jwk.alg" is not present')}const{algorithm:e,keyUsages:n}=hs(t);const i=[e,t.ext??false,t.key_ops??n];const s={...t};delete s.alg;delete s.use;return wi.subtle.importKey("jwk",s,...i)};var us=ds;const fs=t=>Ti(t);let ps;let bs;const ms=t=>t?.[Symbol.toStringTag]==="KeyObject";const gs=async(t,e,n,i,s=false)=>{let r=t.get(e);if(r?.[i]){return r[i]}const o=await us({...n,alg:i});if(s)Object.freeze(e);if(!r){t.set(e,{[i]:o})}else{r[i]=o}return o};const ws=(t,e)=>{if(ms(t)){let n=t.export({format:"jwk"});delete n.d;delete n.dp;delete n.dq;delete n.p;delete n.q;delete n.qi;if(n.k){return fs(n.k)}bs||(bs=new WeakMap);return gs(bs,t,n,e)}if(os(t)){if(t.k)return Ti(t.k);bs||(bs=new WeakMap);const n=gs(bs,t,t,e,true);return n}return t};const vs=(t,e)=>{if(ms(t)){let n=t.export({format:"jwk"});if(n.k){return fs(n.k)}ps||(ps=new WeakMap);return gs(ps,t,n,e)}if(os(t)){if(t.k)return Ti(t.k);ps||(ps=new WeakMap);const n=gs(ps,t,t,e,true);return n}return t};var ys={normalizePublicKey:ws,normalizePrivateKey:vs};async function ks(t,e){if(!ss(t)){throw new TypeError("JWK must be an object")}e||(e=t.alg);switch(t.kty){case"oct":if(typeof t.k!=="string"||!t.k){throw new TypeError('missing "k" (Key Value) Parameter value')}return Ti(t.k);case"RSA":if("oth"in t&&t.oth!==undefined){throw new Ri('RSA JWK "oth" (Other Primes Info) Parameter value is not supported')}case"EC":case"OKP":return us({...t,alg:e});default:throw new Ri('Unsupported "kty" (Key Type) Parameter value')}}const xs=t=>t?.[Symbol.toStringTag];const Ss=(t,e,n)=>{if(e.use!==undefined&&e.use!=="sig"){throw new TypeError("Invalid key for this operation, when present its use must be sig")}if(e.key_ops!==undefined&&e.key_ops.includes?.(n)!==true){throw new TypeError(`Invalid key for this operation, when present its key_ops must include ${n}`)}if(e.alg!==undefined&&e.alg!==t){throw new TypeError(`Invalid key for this operation, when present its alg must be ${t}`)}return true};const _s=(t,e,n,i)=>{if(e instanceof Uint8Array)return;if(i&&os(e)){if(ls(e)&&Ss(t,e,n))return;throw new TypeError(`JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present`)}if(!Qi(e)){throw new TypeError(Zi(t,e,...ts,"Uint8Array",i?"JSON Web Key":null))}if(e.type!=="secret"){throw new TypeError(`${xs(e)} instances for symmetric algorithms must be of type "secret"`)}};const Es=(t,e,n,i)=>{if(i&&os(e)){switch(n){case"sign":if(as(e)&&Ss(t,e,n))return;throw new TypeError(`JSON Web Key for this operation be a private JWK`);case"verify":if(cs(e)&&Ss(t,e,n))return;throw new TypeError(`JSON Web Key for this operation be a public JWK`)}}if(!Qi(e)){throw new TypeError(Zi(t,e,...ts,i?"JSON Web Key":null))}if(e.type==="secret"){throw new TypeError(`${xs(e)} instances for asymmetric algorithms must not be of type "secret"`)}if(n==="sign"&&e.type==="public"){throw new TypeError(`${xs(e)} instances for asymmetric algorithm signing must be of type "private"`)}if(n==="decrypt"&&e.type==="public"){throw new TypeError(`${xs(e)} instances for asymmetric algorithm decryption must be of type "private"`)}if(e.algorithm&&n==="verify"&&e.type==="private"){throw new TypeError(`${xs(e)} instances for asymmetric algorithm verifying must be of type "public"`)}if(e.algorithm&&n==="encrypt"&&e.type==="private"){throw new TypeError(`${xs(e)} instances for asymmetric algorithm encryption must be of type "public"`)}};function As(t,e,n,i){const s=e.startsWith("HS")||e==="dir"||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e);if(s){_s(e,n,i,t)}else{Es(e,n,i,t)}}As.bind(undefined,false);const Cs=As.bind(undefined,true);function Ts(t,e,n,i,s){if(s.crit!==undefined&&i?.crit===undefined){throw new t('"crit" (Critical) Header Parameter MUST be integrity protected')}if(!i||i.crit===undefined){return new Set}if(!Array.isArray(i.crit)||i.crit.length===0||i.crit.some((t=>typeof t!=="string"||t.length===0))){throw new t('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present')}let r;if(n!==undefined){r=new Map([...Object.entries(n),...e.entries()])}else{r=e}for(const e of i.crit){if(!r.has(e)){throw new Ri(`Extension Header Parameter "${e}" is not recognized`)}if(s[e]===undefined){throw new t(`Extension Header Parameter "${e}" is missing`)}if(r.get(e)&&i[e]===undefined){throw new t(`Extension Header Parameter "${e}" MUST be integrity protected`)}}return new Set(i.crit)}const zs=(t,e)=>{if(e!==undefined&&(!Array.isArray(e)||e.some((t=>typeof t!=="string")))){throw new TypeError(`"${t}" option must be an array of strings`)}if(!e){return undefined}return new Set(e)};var $s=zs;const Ps=async t=>{if(t instanceof Uint8Array){return{kty:"oct",k:Ai(t)}}if(!vi(t)){throw new TypeError(Gi(t,...ts,"Uint8Array"))}if(!t.extractable){throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK")}const{ext:e,key_ops:n,alg:i,use:s,...r}=await wi.subtle.exportKey("jwk",t);return r};var Is=Ps;async function Rs(t){return Is(t)}function Os(t,e){const n=`SHA-${t.slice(-3)}`;switch(t){case"HS256":case"HS384":case"HS512":return{hash:n,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:n,name:"RSA-PSS",saltLength:t.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:n,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:n,name:"ECDSA",namedCurve:e.namedCurve};case"Ed25519":return{name:"Ed25519"};case"EdDSA":return{name:e.name};default:throw new Ri(`alg ${t} is not supported either by JOSE or your javascript runtime`)}}async function Ds(t,e,n){if(n==="sign"){e=await ys.normalizePrivateKey(e,t)}if(n==="verify"){e=await ys.normalizePublicKey(e,t)}if(vi(e)){Yi(e,t,n);return e}if(e instanceof Uint8Array){if(!t.startsWith("HS")){throw new TypeError(Gi(e,...ts))}return wi.subtle.importKey("raw",e,{hash:`SHA-${t.slice(-3)}`,name:"HMAC"},false,[n])}throw new TypeError(Gi(e,...ts,"Uint8Array","JSON Web Key"))}const js=async(t,e,n,i)=>{const s=await Ds(t,e,"verify");rs(t,s);const r=Os(t,s.algorithm);try{return await wi.subtle.verify(r,s,n,i)}catch{return false}};var Ls=js;async function Ms(t,e,n){if(!ss(t)){throw new ji("Flattened JWS must be an object")}if(t.protected===undefined&&t.header===undefined){throw new ji('Flattened JWS must have either of the "protected" or "header" members')}if(t.protected!==undefined&&typeof t.protected!=="string"){throw new ji("JWS Protected Header incorrect type")}if(t.payload===undefined){throw new ji("JWS Payload missing")}if(typeof t.signature!=="string"){throw new ji("JWS Signature missing or incorrect type")}if(t.header!==undefined&&!ss(t.header)){throw new ji("JWS Unprotected Header incorrect type")}let i={};if(t.protected){try{const e=Ti(t.protected);i=JSON.parse(Si.decode(e))}catch{throw new ji("JWS Protected Header is invalid")}}if(!ns(i,t.header)){throw new ji("JWS Protected and JWS Unprotected Header Parameter names must be disjoint")}const s={...i,...t.header};const r=Ts(ji,new Map([["b64",true]]),n?.crit,i,s);let o=true;if(r.has("b64")){o=i.b64;if(typeof o!=="boolean"){throw new ji('The "b64" (base64url-encode payload) Header Parameter must be a boolean')}}const{alg:a}=s;if(typeof a!=="string"||!a){throw new ji('JWS "alg" (Algorithm) Header Parameter missing or invalid')}const c=n&&$s("algorithms",n.algorithms);if(c&&!c.has(a)){throw new Ii('"alg" (Algorithm) Header Parameter value not allowed')}if(o){if(typeof t.payload!=="string"){throw new ji("JWS Payload must be a string")}}else if(typeof t.payload!=="string"&&!(t.payload instanceof Uint8Array)){throw new ji("JWS Payload must be a string or an Uint8Array instance")}let l=false;if(typeof e==="function"){e=await e(i,t);l=true;Cs(a,e,"verify");if(os(e)){e=await ks(e,a)}}else{Cs(a,e,"verify")}const h=_i(xi.encode(t.protected??""),xi.encode("."),typeof t.payload==="string"?xi.encode(t.payload):t.payload);let d;try{d=Ti(t.signature)}catch{throw new ji("Failed to base64url decode the signature")}const u=await Ls(a,e,d,h);if(!u){throw new Ji}let f;if(o){try{f=Ti(t.payload)}catch{throw new ji("Failed to base64url decode the payload")}}else if(typeof t.payload==="string"){f=xi.encode(t.payload)}else{f=t.payload}const p={payload:f};if(t.protected!==undefined){p.protectedHeader=i}if(t.header!==undefined){p.unprotectedHeader=t.header}if(l){return{...p,key:e}}return p}async function Ws(t,e,n){if(t instanceof Uint8Array){t=Si.decode(t)}if(typeof t!=="string"){throw new ji("Compact JWS must be a string or Uint8Array")}const{0:i,1:s,2:r,length:o}=t.split(".");if(o!==3){throw new ji("Invalid Compact JWS")}const a=await Ms({payload:s,protected:i,signature:r},e,n);const c={payload:a.payload,protectedHeader:a.protectedHeader};if(typeof e==="function"){return{...c,key:a.key}}return c}var Us=t=>Math.floor(t.getTime()/1e3);const Hs=60;const Ns=Hs*60;const Js=Ns*24;const Bs=Js*7;const Ks=Js*365.25;const Fs=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;var Xs=t=>{const e=Fs.exec(t);if(!e||e[4]&&e[1]){throw new TypeError("Invalid time period format")}const n=parseFloat(e[2]);const i=e[3].toLowerCase();let s;switch(i){case"sec":case"secs":case"second":case"seconds":case"s":s=Math.round(n);break;case"minute":case"minutes":case"min":case"mins":case"m":s=Math.round(n*Hs);break;case"hour":case"hours":case"hr":case"hrs":case"h":s=Math.round(n*Ns);break;case"day":case"days":case"d":s=Math.round(n*Js);break;case"week":case"weeks":case"w":s=Math.round(n*Bs);break;default:s=Math.round(n*Ks);break}if(e[1]==="-"||e[4]==="ago"){return-s}return s};const Vs=t=>t.toLowerCase().replace(/^application\//,"");const Ys=(t,e)=>{if(typeof t==="string"){return e.includes(t)}if(Array.isArray(t)){return e.some(Set.prototype.has.bind(new Set(t)))}return false};var qs=(t,e,n={})=>{let i;try{i=JSON.parse(Si.decode(e))}catch{}if(!ss(i)){throw new Li("JWT Claims Set must be a top-level JSON object")}const{typ:s}=n;if(s&&(typeof t.typ!=="string"||Vs(t.typ)!==Vs(s))){throw new $i('unexpected "typ" JWT header value',i,"typ","check_failed")}const{requiredClaims:r=[],issuer:o,subject:a,audience:c,maxTokenAge:l}=n;const h=[...r];if(l!==undefined)h.push("iat");if(c!==undefined)h.push("aud");if(a!==undefined)h.push("sub");if(o!==undefined)h.push("iss");for(const t of new Set(h.reverse())){if(!(t in i)){throw new $i(`missing required "${t}" claim`,i,t,"missing")}}if(o&&!(Array.isArray(o)?o:[o]).includes(i.iss)){throw new $i('unexpected "iss" claim value',i,"iss","check_failed")}if(a&&i.sub!==a){throw new $i('unexpected "sub" claim value',i,"sub","check_failed")}if(c&&!Ys(i.aud,typeof c==="string"?[c]:c)){throw new $i('unexpected "aud" claim value',i,"aud","check_failed")}let d;switch(typeof n.clockTolerance){case"string":d=Xs(n.clockTolerance);break;case"number":d=n.clockTolerance;break;case"undefined":d=0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:u}=n;const f=Us(u||new Date);if((i.iat!==undefined||l)&&typeof i.iat!=="number"){throw new $i('"iat" claim must be a number',i,"iat","invalid")}if(i.nbf!==undefined){if(typeof i.nbf!=="number"){throw new $i('"nbf" claim must be a number',i,"nbf","invalid")}if(i.nbf>f+d){throw new $i('"nbf" claim timestamp check failed',i,"nbf","check_failed")}}if(i.exp!==undefined){if(typeof i.exp!=="number"){throw new $i('"exp" claim must be a number',i,"exp","invalid")}if(i.exp<=f-d){throw new Pi('"exp" claim timestamp check failed',i,"exp","check_failed")}}if(l){const t=f-i.iat;const e=typeof l==="number"?l:Xs(l);if(t-d>e){throw new Pi('"iat" claim timestamp check failed (too far in the past)',i,"iat","check_failed")}if(t<0-d){throw new $i('"iat" claim timestamp check failed (it should be in the past)',i,"iat","check_failed")}}return i};async function Gs(t,e,n){const i=await Ws(t,e,n);if(i.protectedHeader.crit?.includes("b64")&&i.protectedHeader.b64===false){throw new Li("JWTs MUST NOT use unencoded payload")}const s=qs(i.protectedHeader,i.payload,n);const r={payload:s,protectedHeader:i.protectedHeader};if(typeof e==="function"){return{...r,key:i.key}}return r}const Zs=async(t,e,n)=>{const i=await Ds(t,e,"sign");rs(t,i);const s=await wi.subtle.sign(Os(t,i.algorithm),i,n);return new Uint8Array(s)};var Qs=Zs;class tr{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")}this._protectedHeader=t;return this}setUnprotectedHeader(t){if(this._unprotectedHeader){throw new TypeError("setUnprotectedHeader can only be called once")}this._unprotectedHeader=t;return this}async sign(t,e){if(!this._protectedHeader&&!this._unprotectedHeader){throw new ji("either setProtectedHeader or setUnprotectedHeader must be called before #sign()")}if(!ns(this._protectedHeader,this._unprotectedHeader)){throw new ji("JWS Protected and JWS Unprotected Header Parameter names must be disjoint")}const n={...this._protectedHeader,...this._unprotectedHeader};const i=Ts(ji,new Map([["b64",true]]),e?.crit,this._protectedHeader,n);let s=true;if(i.has("b64")){s=this._protectedHeader.b64;if(typeof s!=="boolean"){throw new ji('The "b64" (base64url-encode payload) Header Parameter must be a boolean')}}const{alg:r}=n;if(typeof r!=="string"||!r){throw new ji('JWS "alg" (Algorithm) Header Parameter missing or invalid')}Cs(r,t,"sign");let o=this._payload;if(s){o=xi.encode(Ai(o))}let a;if(this._protectedHeader){a=xi.encode(Ai(JSON.stringify(this._protectedHeader)))}else{a=xi.encode("")}const c=_i(a,xi.encode("."),o);const l=await Qs(r,t,c);const h={signature:Ai(l),payload:""};if(s){h.payload=Si.decode(o)}if(this._unprotectedHeader){h.header=this._unprotectedHeader}if(this._protectedHeader){h.protected=Si.decode(a)}return h}}class er{constructor(t){this._flattened=new tr(t)}setProtectedHeader(t){this._flattened.setProtectedHeader(t);return this}async sign(t,e){const n=await this._flattened.sign(t,e);if(n.payload===undefined){throw new TypeError("use the flattened module for creating JWS with b64: false")}return`${n.protected}.${n.payload}.${n.signature}`}}function nr(t,e){if(!Number.isFinite(e)){throw new TypeError(`Invalid ${t} input`)}return e}class ir{constructor(t={}){if(!ss(t)){throw new TypeError("JWT Claims Set MUST be an object")}this._payload=t}setIssuer(t){this._payload={...this._payload,iss:t};return this}setSubject(t){this._payload={...this._payload,sub:t};return this}setAudience(t){this._payload={...this._payload,aud:t};return this}setJti(t){this._payload={...this._payload,jti:t};return this}setNotBefore(t){if(typeof t==="number"){this._payload={...this._payload,nbf:nr("setNotBefore",t)}}else if(t instanceof Date){this._payload={...this._payload,nbf:nr("setNotBefore",Us(t))}}else{this._payload={...this._payload,nbf:Us(new Date)+Xs(t)}}return this}setExpirationTime(t){if(typeof t==="number"){this._payload={...this._payload,exp:nr("setExpirationTime",t)}}else if(t instanceof Date){this._payload={...this._payload,exp:nr("setExpirationTime",Us(t))}}else{this._payload={...this._payload,exp:Us(new Date)+Xs(t)}}return this}setIssuedAt(t){if(typeof t==="undefined"){this._payload={...this._payload,iat:Us(new Date)}}else if(t instanceof Date){this._payload={...this._payload,iat:nr("setIssuedAt",Us(t))}}else if(typeof t==="string"){this._payload={...this._payload,iat:nr("setIssuedAt",Us(new Date)+Xs(t))}}else{this._payload={...this._payload,iat:nr("setIssuedAt",t)}}return this}}class sr extends ir{setProtectedHeader(t){this._protectedHeader=t;return this}async sign(t,e){const n=new er(xi.encode(JSON.stringify(this._payload)));n.setProtectedHeader(this._protectedHeader);if(Array.isArray(this._protectedHeader?.crit)&&this._protectedHeader.crit.includes("b64")&&this._protectedHeader.b64===false){throw new Li("JWTs MUST NOT use unencoded payload")}return n.sign(t,e)}}const rr=(t,e)=>{if(typeof t!=="string"||!t){throw new Mi(`${e} missing or invalid`)}};async function or(t,e){if(!ss(t)){throw new TypeError("JWK must be an object")}e??(e="sha256");if(e!=="sha256"&&e!=="sha384"&&e!=="sha512"){throw new TypeError('digestAlgorithm must one of "sha256", "sha384", or "sha512"')}let n;switch(t.kty){case"EC":rr(t.crv,'"crv" (Curve) Parameter');rr(t.x,'"x" (X Coordinate) Parameter');rr(t.y,'"y" (Y Coordinate) Parameter');n={crv:t.crv,kty:t.kty,x:t.x,y:t.y};break;case"OKP":rr(t.crv,'"crv" (Subtype of Key Pair) Parameter');rr(t.x,'"x" (Public Key) Parameter');n={crv:t.crv,kty:t.kty,x:t.x};break;case"RSA":rr(t.e,'"e" (Exponent) Parameter');rr(t.n,'"n" (Modulus) Parameter');n={e:t.e,kty:t.kty,n:t.n};break;case"oct":rr(t.k,'"k" (Key Value) Parameter');n={k:t.k,kty:t.kty};break;default:throw new Ri('"kty" (Key Type) Parameter missing or unsupported')}const i=xi.encode(JSON.stringify(n));return Ai(await ki(e,i))}function ar(t){switch(typeof t==="string"&&t.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";default:throw new Ri('Unsupported "alg" value for a JSON Web Key Set')}}function cr(t){return t&&typeof t==="object"&&Array.isArray(t.keys)&&t.keys.every(lr)}function lr(t){return ss(t)}function hr(t){if(typeof structuredClone==="function"){return structuredClone(t)}return JSON.parse(JSON.stringify(t))}class dr{constructor(t){this._cached=new WeakMap;if(!cr(t)){throw new Wi("JSON Web Key Set malformed")}this._jwks=hr(t)}async getKey(t,e){const{alg:n,kid:i}={...t,...e?.header};const s=ar(n);const r=this._jwks.keys.filter((t=>{let e=s===t.kty;if(e&&typeof i==="string"){e=i===t.kid}if(e&&typeof t.alg==="string"){e=n===t.alg}if(e&&typeof t.use==="string"){e=t.use==="sig"}if(e&&Array.isArray(t.key_ops)){e=t.key_ops.includes("verify")}if(e){switch(n){case"ES256":e=t.crv==="P-256";break;case"ES256K":e=t.crv==="secp256k1";break;case"ES384":e=t.crv==="P-384";break;case"ES512":e=t.crv==="P-521";break;case"Ed25519":e=t.crv==="Ed25519";break;case"EdDSA":e=t.crv==="Ed25519"||t.crv==="Ed448";break}}return e}));const{0:o,length:a}=r;if(a===0){throw new Ui}if(a!==1){const t=new Hi;const{_cached:e}=this;t[Symbol.asyncIterator]=async function*(){for(const t of r){try{yield await ur(e,t,n)}catch{}}};throw t}return ur(this._cached,o,n)}}async function ur(t,e,n){const i=t.get(e)||t.set(e,{}).get(e);if(i[n]===undefined){const t=await ks({...e,ext:true},n);if(t instanceof Uint8Array||t.type!=="public"){throw new Wi("JSON Web Key Set members must be public keys")}i[n]=t}return i[n]}function fr(t){const e=new dr(t);const n=async(t,n)=>e.getKey(t,n);Object.defineProperties(n,{jwks:{value:()=>hr(e._jwks),enumerable:true,configurable:false,writable:false}});return n}const pr=async(t,e,n)=>{let i;let s;let r=false;if(typeof AbortController==="function"){i=new AbortController;s=setTimeout((()=>{r=true;i.abort()}),e)}const o=await fetch(t.href,{signal:i?i.signal:undefined,redirect:"manual",headers:n.headers}).catch((t=>{if(r)throw new Ni;throw t}));if(s!==undefined)clearTimeout(s);if(o.status!==200){throw new zi("Expected 200 OK from the JSON Web Key Set HTTP response")}try{return await o.json()}catch{throw new zi("Failed to parse the JSON Web Key Set HTTP response as JSON")}};var br=pr;function mr(){return typeof WebSocketPair!=="undefined"||typeof navigator!=="undefined"&&navigator.userAgent==="Cloudflare-Workers"||typeof EdgeRuntime!=="undefined"&&EdgeRuntime==="vercel"}let gr;if(typeof navigator==="undefined"||!navigator.userAgent?.startsWith?.("Mozilla/5.0 ")){const t="jose";const e="v5.10.0";gr=`${t}/${e}`}const wr=Symbol();function vr(t,e){if(typeof t!=="object"||t===null){return false}if(!("uat"in t)||typeof t.uat!=="number"||Date.now()-t.uat>=e){return false}if(!("jwks"in t)||!ss(t.jwks)||!Array.isArray(t.jwks.keys)||!Array.prototype.every.call(t.jwks.keys,ss)){return false}return true}class yr{constructor(t,e){if(!(t instanceof URL)){throw new TypeError("url must be an instance of URL")}this._url=new URL(t.href);this._options={agent:e?.agent,headers:e?.headers};this._timeoutDuration=typeof e?.timeoutDuration==="number"?e?.timeoutDuration:5e3;this._cooldownDuration=typeof e?.cooldownDuration==="number"?e?.cooldownDuration:3e4;this._cacheMaxAge=typeof e?.cacheMaxAge==="number"?e?.cacheMaxAge:6e5;if(e?.[wr]!==undefined){this._cache=e?.[wr];if(vr(e?.[wr],this._cacheMaxAge)){this._jwksTimestamp=this._cache.uat;this._local=fr(this._cache.jwks)}}}coolingDown(){return typeof this._jwksTimestamp==="number"?Date.now()<this._jwksTimestamp+this._cooldownDuration:false}fresh(){return typeof this._jwksTimestamp==="number"?Date.now()<this._jwksTimestamp+this._cacheMaxAge:false}async getKey(t,e){if(!this._local||!this.fresh()){await this.reload()}try{return await this._local(t,e)}catch(n){if(n instanceof Ui){if(this.coolingDown()===false){await this.reload();return this._local(t,e)}}throw n}}async reload(){if(this._pendingFetch&&mr()){this._pendingFetch=undefined}const t=new Headers(this._options.headers);if(gr&&!t.has("User-Agent")){t.set("User-Agent",gr);this._options.headers=Object.fromEntries(t.entries())}this._pendingFetch||(this._pendingFetch=br(this._url,this._timeoutDuration,this._options).then((t=>{this._local=fr(t);if(this._cache){this._cache.uat=Date.now();this._cache.jwks=t}this._jwksTimestamp=Date.now();this._pendingFetch=undefined})).catch((t=>{this._pendingFetch=undefined;throw t})));await this._pendingFetch}}function kr(t,e){const n=new yr(t,e);const i=async(t,e)=>n.getKey(t,e);Object.defineProperties(i,{coolingDown:{get:()=>n.coolingDown(),enumerable:true,configurable:false},fresh:{get:()=>n.fresh(),enumerable:true,configurable:false},reload:{value:()=>n.reload(),enumerable:true,configurable:false,writable:false},reloading:{get:()=>!!n._pendingFetch,enumerable:true,configurable:false},jwks:{value:()=>n._local?.jwks(),enumerable:true,configurable:false,writable:false}});return i}const xr=Ti;function Sr(t){if(typeof t!=="string")throw new Li("JWTs must use Compact JWS serialization, JWT must be a string");const{1:e,length:n}=t.split(".");if(n===5)throw new Li("Only JWTs using Compact JWS serialization can be decoded");if(n!==3)throw new Li("Invalid JWT");if(!e)throw new Li("JWTs must contain a payload");let i;try{i=xr(e)}catch{throw new Li("Failed to base64url decode the payload")}let s;try{s=JSON.parse(Si.decode(i))}catch{throw new Li("Failed to parse the decoded payload as JSON")}if(!ss(s))throw new Li("Invalid JWT Claims Set");return s}function _r(t){const e=t?.modulusLength??2048;if(typeof e!=="number"||e<2048){throw new Ri("Invalid or unsupported modulusLength option provided, 2048 bits or larger keys must be used")}return e}async function Er(t,e){let n;let i;switch(t){case"PS256":case"PS384":case"PS512":n={name:"RSA-PSS",hash:`SHA-${t.slice(-3)}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:_r(e)};i=["sign","verify"];break;case"RS256":case"RS384":case"RS512":n={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${t.slice(-3)}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:_r(e)};i=["sign","verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":n={name:"RSA-OAEP",hash:`SHA-${parseInt(t.slice(-3),10)||1}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:_r(e)};i=["decrypt","unwrapKey","encrypt","wrapKey"];break;case"ES256":n={name:"ECDSA",namedCurve:"P-256"};i=["sign","verify"];break;case"ES384":n={name:"ECDSA",namedCurve:"P-384"};i=["sign","verify"];break;case"ES512":n={name:"ECDSA",namedCurve:"P-521"};i=["sign","verify"];break;case"Ed25519":n={name:"Ed25519"};i=["sign","verify"];break;case"EdDSA":{i=["sign","verify"];const t=e?.crv??"Ed25519";switch(t){case"Ed25519":case"Ed448":n={name:t};break;default:throw new Ri("Invalid or unsupported crv option provided")}break}case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{i=["deriveKey","deriveBits"];const t=e?.crv??"P-256";switch(t){case"P-256":case"P-384":case"P-521":{n={name:"ECDH",namedCurve:t};break}case"X25519":case"X448":n={name:t};break;default:throw new Ri("Invalid or unsupported crv option provided, supported values are P-256, P-384, P-521, X25519, and X448")}break}default:throw new Ri('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}return wi.subtle.generateKey(n,e?.extractable??false,i)}async function Ar(t,e){return Er(t,e)}const Cr=async(t,e)=>{const n={...e,grant_types:["authorization_code","refresh_token"],id_token_signed_response_alg:"ES256",token_endpoint_auth_method:"none",application_type:"web",subject_type:"public"};return fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})};class Tr{dbName;storeName;dbVersion;db=null;constructor(t="soidc",e="session",n=1){this.dbName=t;this.storeName=e;this.dbVersion=n}async init(){return new Promise(((t,e)=>{const n=indexedDB.open(this.dbName,this.dbVersion);n.onerror=t=>{e(new Error(`Database error: ${t.target.error}`))};n.onsuccess=e=>{this.db=e.target.result;t(this)};n.onupgradeneeded=t=>{const e=t.target.result;if(!e.objectStoreNames.contains(this.storeName)){e.createObjectStore(this.storeName)}}}))}async setItem(t,e){if(!this.db){await this.init()}return new Promise(((n,i)=>{const s=this.db.transaction(this.storeName,"readwrite");s.oncomplete=()=>{n()};s.onerror=e=>{i(new Error(`Transaction error for setItem(${t},...): ${e.target.error}`))};s.onabort=e=>{i(new Error(`Transaction aborted for setItem(${t},...): ${e.target.error}`))};const r=s.objectStore(this.storeName);r.put(e,t)}))}async getItem(t){if(!this.db){await this.init()}return new Promise(((e,n)=>{const i=this.db.transaction(this.storeName,"readonly");i.onerror=e=>{n(new Error(`Transaction error for getItem(${t}): ${e.target.error}`))};i.onabort=e=>{n(new Error(`Transaction aborted for getItem(${t}): ${e.target.error}`))};const s=i.objectStore(this.storeName);const r=s.get(t);r.onsuccess=()=>{e(r.result||null)}}))}async deleteItem(t){if(!this.db){await this.init()}return new Promise(((e,n)=>{const i=this.db.transaction(this.storeName,"readwrite");i.oncomplete=()=>{e()};i.onerror=e=>{n(new Error(`Transaction error for deleteItem(${t}): ${e.target.error}`))};i.onabort=e=>{n(new Error(`Transaction aborted for deleteItem(${t}): ${e.target.error}`))};const s=i.objectStore(this.storeName);s.delete(t)}))}async clear(){if(!this.db){await this.init()}return new Promise(((t,e)=>{const n=this.db.transaction(this.storeName,"readwrite");n.oncomplete=()=>{t()};n.onerror=t=>{e(new Error(`Transaction error for clear(): ${t.target.error}`))};n.onabort=t=>{e(new Error(`Transaction aborted for clear(): ${t.target.error}`))};const i=n.objectStore(this.storeName);i.clear()}))}close(){if(this.db){this.db.close();this.db=null}}}const zr=async(t,e,n)=>{const i=new URL(e);const s=i.origin+i.pathname+i.search;sessionStorage.setItem("idp",t);const r=new URL(t).origin;const o=await fetch(`${r}/.well-known/openid-configuration`).then((t=>{if(!t.ok){throw new Error(`HTTP error! Status: ${t.status}`)}return t.json()}));sessionStorage.setItem("token_endpoint",o["token_endpoint"]);sessionStorage.setItem("jwks_uri",o["jwks_uri"]);let a=n?.client_id;if(!a){const t=o["registration_endpoint"];const e=await Cr(t,n??{redirect_uris:[s]}).then((t=>{if(!t.ok){throw new Error(`HTTP error! Status: ${t.status}`)}return t.json()}));a=e["client_id"];sessionStorage.setItem("client_id",a)}const{pkce_code_verifier:c,pkce_code_challenge:l}=await $r();sessionStorage.setItem("pkce_code_verifier",c);const h=window.crypto.randomUUID();sessionStorage.setItem("csrf_token",h);const d=o["authorization_endpoint"]+`?response_type=code`+`&redirect_uri=${encodeURIComponent(s)}`+`&scope=openid offline_access webid`+`&client_id=${encodeURIComponent(a)}`+`&code_challenge_method=S256`+`&code_challenge=${l}`+`&state=${h}`+`&prompt=consent`;window.location.href=d};const $r=async()=>{const t=window.crypto.randomUUID()+"-"+window.crypto.randomUUID();const e=new Uint8Array(await window.crypto.subtle.digest("SHA-256",(new TextEncoder).encode(t)));const n=btoa(String.fromCharCode(...e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return{pkce_code_verifier:t,pkce_code_challenge:n}};const Pr=async t=>{const e=new URL(window.location.href);const n=e.searchParams.get("code");if(n===null){return{clientDetails:t}}const i=sessionStorage.getItem("idp");if(i===null||e.searchParams.get("iss")!=i){throw new Error("RFC 9207 - iss != idp - "+e.searchParams.get("iss")+" != "+i)}if(e.searchParams.get("state")!=sessionStorage.getItem("csrf_token")){throw new Error("RFC 6749 - state != csrf_token - "+e.searchParams.get("state")+" != "+sessionStorage.getItem("csrf_token"))}e.searchParams.delete("iss");e.searchParams.delete("state");e.searchParams.delete("code");window.history.pushState({},document.title,e.toString());const s=sessionStorage.getItem("pkce_code_verifier");if(s===null){throw new Error("Access Token Request preparation - Could not find in sessionStorage: pkce_code_verifier")}const r=t?.client_id||sessionStorage.getItem("client_id");if(!r){throw new Error("Access Token Request preparation - Could not find in sessionStorage: client_id (dynamic registration)")}const o=sessionStorage.getItem("token_endpoint");if(o===null){throw new Error("Access Token Request preparation - Could not find in sessionStorage: token_endpoint")}const a=await Ar("ES256");const c=await Ir(n,s,e.toString(),r,o,a).then((t=>{if(!t.ok){throw new Error(`HTTP error! Status: ${t.status}`)}return t.json()}));const l=c["access_token"];const h=sessionStorage.getItem("jwks_uri");if(h===null){throw new Error("Access Token validation preparation - Could not find in sessionStorage: jwks_uri")}const d=kr(new URL(h));const{payload:u}=await Gs(l,d,{issuer:i,audience:"solid"});const f=await or(await Rs(a.publicKey));if(u["cnf"]["jkt"]!=f){throw new Error("Access Token validation failed on `jkt`: jkt != DPoP thumbprint - "+u["cnf"]["jkt"]+" != "+f)}if(u["client_id"]!=r){throw new Error("Access Token validation failed on `client_id`: JWT payload != client_id - "+u["client_id"]+" != "+r)}const p={...c,dpop_key_pair:a};const b={idp:i,jwks_uri:h,token_endpoint:o};if(!t)t={redirect_uris:[window.location.href]};t.client_id=r;const m=await(new Tr).init();await Promise.all([m.setItem("idp",i),m.setItem("jwks_uri",h),m.setItem("token_endpoint",o),m.setItem("client_id",r),m.setItem("dpop_keypair",a),m.setItem("refresh_token",c["refresh_token"])]);m.close();sessionStorage.removeItem("csrf_token");sessionStorage.removeItem("pkce_code_verifier");sessionStorage.removeItem("idp");sessionStorage.removeItem("jwks_uri");sessionStorage.removeItem("token_endpoint");sessionStorage.removeItem("client_id");return{clientDetails:t,idpDetails:b,tokenDetails:p}};const Ir=async(t,e,n,i,s,r)=>{const o=await Rs(r.publicKey);o.alg="ES256";const a=await new sr({htu:s,htm:"POST"}).setIssuedAt().setJti(window.crypto.randomUUID()).setProtectedHeader({alg:"ES256",typ:"dpop+jwt",jwk:o}).sign(r.privateKey);return fetch(s,{method:"POST",headers:{dpop:a,"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"authorization_code",code:t,code_verifier:e,redirect_uri:n,client_id:i})})};const Rr=async()=>{const t=await(new Tr).init();const e=await t.getItem("client_id");const n=await t.getItem("token_endpoint");const i=await t.getItem("dpop_keypair");const s=await t.getItem("refresh_token");if(e===null||n===null||i===null||s===null){throw new Error("Could not refresh tokens: details missing from database.")}const r=await Or(s,e,n,i).then((t=>{if(!t.ok){throw new Error(`HTTP error! Status: ${t.status}`)}return t.json()}));const o=r["access_token"];const a=await t.getItem("idp");if(a===null){throw new Error("Access Token validation preparation - Could not find in sessionDatabase: idp")}const c=await t.getItem("jwks_uri");if(c===null){throw new Error("Access Token validation preparation - Could not find in sessionDatabase: jwks_uri")}const l=kr(new URL(c));const{payload:h}=await Gs(o,l,{issuer:a,audience:"solid"});const d=await or(await Rs(i.publicKey));if(h["cnf"]["jkt"]!=d){throw new Error("Access Token validation failed on `jkt`: jkt != DPoP thumbprint - "+h["cnf"]["jkt"]+" != "+d)}if(h["client_id"]!=e){throw new Error("Access Token validation failed on `client_id`: JWT payload != client_id - "+h["client_id"]+" != "+e)}await t.setItem("refresh_token",r["refresh_token"]);t.close();return{...r,dpop_key_pair:i}};const Or=async(t,e,n,i)=>{const s=await Rs(i.publicKey);s.alg="ES256";const r=await new sr({htu:n,htm:"POST"}).setIssuedAt().setJti(window.crypto.randomUUID()).setProtectedHeader({alg:"ES256",typ:"dpop+jwt",jwk:s}).sign(i.privateKey);return fetch(n,{method:"POST",headers:{dpop:r,"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:t,client_id:e})})};class Dr{sessionInformation;isActive_=false;webId_=undefined;currentAth_=undefined;tokenRefreshTimeout;sessionDeactivateTimeout;onSessionExpirationWarning;constructor(t,e){this.sessionInformation={clientDetails:t};this.onSessionExpirationWarning=e?.onSessionExpirationWarning}async login(t,e){await zr(t,e,this.sessionInformation.clientDetails)}async logout(){if(this.sessionDeactivateTimeout)clearTimeout(this.sessionDeactivateTimeout);this.sessionDeactivateTimeout=undefined;if(this.tokenRefreshTimeout)clearTimeout(this.tokenRefreshTimeout);this.tokenRefreshTimeout=undefined;this.sessionInformation.idpDetails=undefined;this.sessionInformation.tokenDetails=undefined;this.isActive_=false;this.webId_=undefined;if(this.sessionInformation.clientDetails?.client_id)try{new URL(this.sessionInformation.clientDetails.client_id)}catch(t){this.sessionInformation.clientDetails.client_id=undefined}const t=await(new Tr).init();await t.clear();t.close()}async handleRedirectFromLogin(){const t=await Pr(this.sessionInformation.clientDetails);if(!t.tokenDetails){return}this.sessionInformation=t;await this.setSessionDetails()}async restore(){await Rr().then((t=>{this.sessionInformation.tokenDetails=t;return this.setSessionDetails()})).catch((t=>{}))}async createSignedDPoPToken(t){if(!this.sessionInformation.tokenDetails||!this.currentAth_){throw new Error("Session not established.")}t.ath=this.currentAth_;const e=await Rs(this.sessionInformation.tokenDetails.dpop_key_pair.publicKey);return new sr(t).setIssuedAt().setJti(window.crypto.randomUUID()).setProtectedHeader({alg:"ES256",typ:"dpop+jwt",jwk:e}).sign(this.sessionInformation.tokenDetails.dpop_key_pair.privateKey)}async authFetch(t,e,n){let i;let s;let r;if(t instanceof Request){i=new URL(t.url);s=e?.method||t?.method||"GET";r=new Headers(t.headers)}else{e=e||{};i=new URL(t.toString());s=e.method||"GET";r=e.headers?new Headers(e.headers):new Headers}if(this.sessionInformation.tokenDetails){n=n??{htu:`${i.origin}${i.pathname}`,htm:s.toUpperCase()};const t=await this.createSignedDPoPToken(n);r.set("dpop",t);r.set("authorization",`DPoP ${this.sessionInformation.tokenDetails.access_token}`)}if(t instanceof Request){return fetch(new Request(t,{...e,headers:r}))}return fetch(i,{...e,headers:r})}get isActive(){return this.isActive_}get webId(){return this.webId_}async setSessionDetails(){if(!this.sessionInformation.tokenDetails?.access_token){this.logout()}this.currentAth_=await this.computeAth(this.sessionInformation.tokenDetails.access_token);this.webId_=Sr(this.sessionInformation.tokenDetails.access_token)["webid"];this.isActive_=this.webId!==undefined;this.setSessionDeactivateTimeout();this.setTokenRefreshTimeout()}setSessionDeactivateTimeout(){const t=5;const e=(this.sessionInformation.tokenDetails.expires_in-t)*1e3;if(this.sessionDeactivateTimeout)clearTimeout(this.sessionDeactivateTimeout);this.sessionDeactivateTimeout=setTimeout((()=>this.logout()),e)}setTokenRefreshTimeout(){const t=95;const e=(this.sessionInformation.tokenDetails.expires_in-t)*1e3;if(this.tokenRefreshTimeout)clearTimeout(this.tokenRefreshTimeout);this.tokenRefreshTimeout=setTimeout((async()=>{const t=await Rr().catch((t=>{if(this.onSessionExpirationWarning)this.onSessionExpirationWarning();return undefined}));if(!t){return}this.sessionInformation.tokenDetails=t;this.setSessionDeactivateTimeout();this.setTokenRefreshTimeout()}),e)}async computeAth(t){const e=new TextEncoder;const n=e.encode(t);const i=await crypto.subtle.digest("SHA-256",n);const s=Array.from(new Uint8Array(i));const r=btoa(String.fromCharCode(...s));const o=r.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return o}}class jr{get authenticatedFetch(){return this._authenticatedFetch}constructor(){this.onSessionRestoreCallback=()=>{};this.sessionInfo$=new Wn({isLoggedIn:false,webId:undefined});this.session=new Dr;this._authenticatedFetch=this.session.authFetch.bind(this.session)}async handleIncomingRedirect(t=false){await this.session.handleRedirectFromLogin();if(t){await this.session.restore();if(this.session.isActive){this.onSessionRestoreCallback(window.location.href)}}this.sessionInfo$.next({isLoggedIn:this.session.isActive,webId:this.session.webId})}async login(t){return this.session.login(t,window.location.href)}async logout(){await this.session.logout();this.sessionInfo$.next({isLoggedIn:false,webId:undefined})}observeSession(){return this.sessionInfo$}onSessionRestore(t){this.onSessionRestoreCallback=t}}const Lr=class{constructor(t){e(this,t);this.sessionRestoredEmitter=a(this,"pod-os:session-restored",7);this.podOsLoadedEmitter=a(this,"pod-os:loaded",7);this.restorePreviousSession=false;this.disconnected$=new Ln;this.loading=true}async componentWillLoad(){const t=new jr;this.unsubscribeSettings=ge.on("set",(()=>{this.os=qe(t,ge.state)}));this.os=qe(t,ge.state);t.onSessionRestore((t=>{this.sessionRestoredEmitter.emit({url:t})}));try{await t.handleIncomingRedirect(this.restorePreviousSession)}catch(t){console.error(t)}this.os.observeSession().pipe(gi(this.disconnected$)).subscribe((async t=>{M.state.webId=t.webId;if(t.isLoggedIn){const e=await this.os.fetchProfile(t.webId);M.state.profile=e}M.state.isLoggedIn=t.isLoggedIn;this.loading=false}));this.podOsLoadedEmitter.emit({os:this.os,authenticatedFetch:t.authenticatedFetch})}disconnectedCallback(){this.unsubscribeSettings();this.disconnected$.next();this.disconnected$.unsubscribe()}async initializeOs(t){t.stopPropagation();t.detail(this.os)}async loadModule(t){t.stopPropagation();if(t.detail.module==="contacts"){const e=await this.os.loadContactsModule();t.detail.receiver(e)}else{throw Error(`Unknown module "${t.detail.module}"`)}}render(){return this.loading?n("ion-progress-bar",{type:"indeterminate"}):n("slot",null)}};const Mr="pos-router {\n margin: 0;\n padding: 0;\n display: flex;\n flex-direction: column;\n height: 100%;\n}\n\npos-navigation {\n max-width: var(--width-lg);\n margin: 0;\n min-width: var(--size-32);\n flex-shrink: 1; /* Ensure navigation can shrink */\n}\n\npos-add-new-thing,\npos-login {\n flex: 0 1 auto;\n flex-shrink: 0; /* Ensure those items don't shrink */\n}\n\nheader,\nfooter {\n display: flex;\n gap: var(--size-1);\n height: auto;\n justify-content: center;\n align-items: center;\n padding: var(--size-1);\n}\n\nfooter svg {\n width: var(--size-5);\n height: var(--size-5);\n}\n\nfooter {\n font-size: var(--scale-fluid-000);\n\n .settings {\n padding: 0 var(--size-1);\n text-decoration: none;\n background-color: var(--pos-background-color);\n border: 1px solid var(--pos-secondary-border-color);\n color: var(--pos-secondary-border-color);\n border-radius: var(--radius-xs);\n\n &:hover {\n background-color: var(--pos-secondary-border-color);\n color: var(--pos-background-color);\n }\n }\n}\n\nheader {\n flex-wrap: nowrap;\n padding: var(--size-1) var(--size-8);\n}\n\nmain {\n flex: 1;\n max-height: 100vh;\n overflow: auto;\n}\n\n@media (max-width: 640px) {\n header {\n padding: var(--size-1);\n justify-content: space-between;\n }\n footer {\n display: none;\n }\n}\n";const Wr=Mr;const Ur=class{constructor(t){e(this,t);this.restorePreviousSession=false;this.mode="standalone";this.uri=""}render(){return n(i,{key:"08b186d2f354d6c07df02707eb4ada81aef7dec3"},n("pos-app",{key:"54c372343e916ab5d77584381b3965c925ae0cd0",restorePreviousSession:this.restorePreviousSession},n("pos-error-toast",{key:"ab63e18121ca16670f81da141219a782dde0694b"},n("pos-router",{key:"69b6f3bf8ce3720c6c39cdb4be69e640e27ccc5b",mode:this.mode,"onPod-os:route-changed":t=>this.uri=t.detail},n("header",{key:"5cd3412caf13b6d99da517ae7e6f5877234e65d7"},n("pos-add-new-thing",{key:"9b83b3cf03b7038303975386176df539b35ff547",referenceUri:this.uri}),n("pos-navigation",{key:"26bfed9b1c8dd1be018babc6ef40ae42808a5c42",uri:this.uri==="pod-os:dashboard"?"":this.uri}),n("pos-login",{key:"e29f18dcde866d8ac1e317fcd7b71ef584e69034"},n("pos-user-menu",{key:"be796f0914649eb4e8525a9d8acdfd535626303c",webId:M.state.webId,slot:"if-logged-in"}))),n("main",{key:"f99dfb2d43e949528bc767b94801c99bf04a7eea"},this.mainContent()),n("footer",{key:"64744d1246356fa00da9c6b561785e2b794a7907"},n(Hr,{key:"a648f7f88e12c79348bda33152f2759d2b93e738"}),n("span",{key:"f22e2f9904ba517fc2e579a05018704b5ade6302"},"PodOS Browser"))))))}mainContent(){if(this.uri===""){return null}if(this.uri.startsWith("pod-os:")){return n("pos-internal-router",{uri:this.uri})}return n("pos-resource",{key:this.uri,uri:this.uri},n("pos-type-router",null))}};const Hr=()=>n("svg",{viewBox:"0 0 400 400",xmlns:"http://www.w3.org/2000/svg"},n("path",{d:"M50 350 L50 100 L200 50 L350 100 L350 350 Z",style:{fill:"#008BF8",stroke:"#008BF8","stroke-width":"70"},"stroke-linejoin":"round"}),n("path",{d:"M100 300 L100 150 L200 120 L300 150 L300 300 L130 300 L130 370 L100 370Z",style:{fill:"white",stroke:"white","stroke-width":"45"},"stroke-linejoin":"round"}),n("path",{d:"M150 250 L150 200 L200 180 L250 200 L250 250 Z",style:{fill:"#DC0073",stroke:"#DC0073","stroke-width":"20"},"stroke-linejoin":"round"}));Ur.style=Wr;const Nr=":host{display:grid;grid-template-columns:repeat(auto-fit, minmax(var(--size-12), var(--size-96)));gap:var(--size-4);padding:var(--size-2);justify-content:center;align-items:start;justify-items:stretch}";const Jr=Nr;const Br=class{constructor(t){e(this,t)}render(){return n(i,{key:"18dc165b7be1c796136804a2ba7643b2a6fffc73"},n("pos-getting-started",{key:"e3f7a22641e4c24168a36f96463515cd1a89ca5e"}),n("pos-example-resources",{key:"1044dd873049118e165ff6d38449c85695f63a50"}))}};Br.style=Jr;const Kr=":host{display:grid;grid-template-columns:repeat(auto-fit, minmax(var(--size-12), var(--size-96)));gap:var(--size-4);padding:var(--size-2);justify-content:center;align-items:start;justify-items:stretch}";const Fr=Kr;const Xr=class{constructor(t){e(this,t)}render(){return n("pos-setting-offline-cache",{key:"f065206f6291089773a19045243f04b6ce35eeb9"})}};Xr.style=Fr;const Vr=class{constructor(t){e(this,t);this.subscribeResource=a(this,"pod-os:resource",7);this.receiveResource=t=>{this.resource=t}}componentWillLoad(){J(this)}render(){return this.resource?this.resource.description():null}};const Yr="dialog{background-color:var(--pos-background-color);color:var(--pos-normal-text-color);border:none;border-radius:var(--radius-md);box-shadow:var(--shadow-md);max-width:var(--width-xs);animation:slideIn 0.2s ease-out}dialog::backdrop{background:rgba(0, 0, 0, 0.5);backdrop-filter:var(--blur-sm);animation:fadeIn 0.2s ease-out}@media (prefers-color-scheme: dark){dialog::backdrop{background:rgb(100, 100, 100, 0.5)}}dialog header>:first-child{flex-grow:1;font-weight:var(--weight-light);font-size:var(--scale-2);font-family:var(--font-sans);margin:0}dialog header{display:flex;flex-direction:row;justify-content:space-between;align-items:center;gap:var(--scale-0);border-bottom-style:inset;padding:0 0 var(--scale-0) 0}dialog>:last-child{display:block;margin-top:var(--scale-3)}button#close{cursor:pointer;display:flex;align-items:center;justify-content:center;border:none;background:none;font-size:var(--scale-3);color:var(--color-grey-500)}button#close:hover{color:var(--pos-secondary-border-color)}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes slideIn{from{opacity:0;transform:translateY(-20px) scale(0.95)}to{opacity:1;transform:translateY(0) scale(1)}}";const qr=Yr;const Gr=class{constructor(t){e(this,t)}async showModal(){this.dialog.showModal()}async close(){this.dialog.close()}render(){return n(i,{key:"4e570e7fb1942fab0f4056d17a28c67a7abfee19"},n("dialog",{key:"c2282c2ac11c236672ee4848019dacb59ff6b1ef",ref:t=>this.dialog=t},n("header",{key:"ca58f3372a078235d931e60b6a7979e5006010c5"},n("slot",{key:"2e63b07551e537491d86bae21c80c235ce5ca0db",name:"title"}),n("button",{key:"a3afd2ab3624f98799976de5d4b86c86360bd2af",tabindex:-1,id:"close",title:"Close",onClick:()=>this.close()},n("ion-icon",{key:"9f7fccd041dab2f0f224a13fdcb7b7254f090740",name:"close-outline"}))),n("slot",{key:"5e5b4e385c7000ece9ced84d5ba6f5b45a990e33",name:"content"})))}};Gr.style=qr;const Zr=class{constructor(t){e(this,t)}async unhandledRejection(t){t.stopPropagation();console.error("unhandled promise rejection",t);await this.showToast(t.reason.toString())}async catchError(t){t.stopPropagation();console.error(t.detail);await this.showToast(t.detail.message)}async showToast(t){const e=await R.create({message:t,duration:1e4,position:"top",color:"danger",buttons:[{text:"Dismiss",role:"cancel"}]});await e.present()}render(){return n(i,{key:"323aca8226bb81061d9edf6db10ba6fcfa69fa21"},n("ion-toast",{key:"e8bcbfb1d06594a25a27beb87da97f47c32067b1",trigger:"never",message:"Workarround to preload ion-toast and ion-ripple-effect to be able to show errors while offline",duration:0},n("ion-ripple-effect",{key:"273603931e206584a1bf3b98751d92daec0465cf"})),n("slot",{key:"6cee55328058d883459a4c89edd63a0dfac9aa7e"}))}};const Qr=":host{border:var(--size-px) solid var(--pos-border-color);border-radius:var(--radius-lg);box-shadow:var(--shadow-md);padding:var(--size-8);max-width:var(--size-96);background:var(--pos-card-background)}.links{display:flex;flex-direction:column;gap:var(--size-3);max-width:80vw}";const to=Qr;const eo=class{constructor(t){e(this,t)}render(){return n(i,{key:"42e8ecc30fa26eb7750efff9a65048bb42b4c71d"},n("div",{key:"1df80385f1f6c44f7fe4255ecb93f6183df61727"},n("h2",{key:"9b249d38f00d1b00863226799bdcd13e4f78a4a9"},"Try these... 💡"),n("p",{key:"c33157b085b1ad3397e38bf5f4b1c601b0e40b6a"},"No idea where to start? Try these example resources, and follow your nose 👃"),n("div",{key:"f0f35cc2ec1f7fbf8a306e718e1f2aaffcbe84e0",class:"links"},n("pos-rich-link",{key:"999b7dc0aa587b1964838820f17a02257b051c0e",uri:"https://pod-os.solidcommunity.net/profile/card#me"}),n("pos-rich-link",{key:"67ca02160d0bdaa73bcfb188fcf40b058a584bf8",uri:"https://angelo.veltens.org/profile/card#me"}),n("pos-rich-link",{key:"800829fb68c96b0caa0ad2372b02e08b7842b704",uri:"https://angelo.veltens.org/public/bookmarks"}),n("pos-rich-link",{key:"680e29b8bf0437d6adba15052339b91ffd41b9a4",uri:"https://solidos.solidcommunity.net/profile/card#me"}))))}};eo.style=to;const no=":host{border:var(--size-px) solid var(--pos-border-color);border-radius:var(--radius-lg);box-shadow:var(--shadow-md);padding:var(--size-8);max-width:var(--size-96);background:var(--pos-card-background)}.question{font-weight:var(--weight-semibold)}a{font-weight:var(--weight-bold);color:var(--pos-primary-color)}button.login{background:none;color:var(--pos-primary-color);display:inline;text-decoration:underline;border:none;padding:0;margin:0;cursor:pointer;font-size:unset}";const io=no;const so=class{constructor(t){e(this,t);this.login=a(this,"pod-os:login",7)}render(){return n(i,{key:"23a14b5ee10d585cc8cf3166ce041072b68cabb2"},n("div",{key:"964e46223d77516aaed40c7c55371716cfccf40a"},n("h2",{key:"5eaf56d6b0751d8511632d05570a05d5deba88c0"},"Getting started 🚀"),n("p",{key:"f41d858112a0337bcf2be9a39986cacac6921210"},"🔎 Enter a URL into the above navigation bar to browse through the web of data. "),n("p",{key:"8d40de32d86b871343687b402122b0dcc843daf9"},"🔐"," ",n("button",{key:"225091e03c1cf175362dc9530cf1eb5238e50d65",class:"login",onClick:()=>this.login.emit()},"Sign in")," ","to access private resources on your Solid Pod or those of your friends or coworkers.")),n("div",{key:"92924f3a67ac70cd333932f0658f9f73dd7474c9"},n("p",{key:"365d7c78aee4bb9396ac7d55c42c9e26b47fe87a",class:"question"},"New to Solid?"),n("p",{key:"42190c0f401faff3cf43fe8f3c69f4afc380f819"},n("a",{key:"d7de0d55a657c8a54a389efc50aa89bc4d48c5e6",href:"https://solidproject.org/for-developers#hosted-pod-services"},"Get a Pod →"))),n("div",{key:"8ad728231a1f2af613a462982af6bf129956ab1c"},n("p",{key:"c960fa49ff9789fe881cadc4f37d315c7727115a",class:"question"},"Want to dig deeper into PodOS?"),n("p",{key:"7991e91dbfdfc0447a2e08850e3634086f3f12ee"},n("a",{key:"a35d336eb2ca5947e66abb9e37526ee035c0a700",href:"http://pod-os.org"},"Learn more →"))))}};so.style=io;const ro=":host{display:flex;background-size:cover;background-repeat:no-repeat;background-position:center;border-radius:inherit}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);object-fit:var(--object-fit)}img{backdrop-filter:var(--blur-xl)}.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.error{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 oo=ro;const ao=class{constructor(t){e(this,t);this.initializeOsEmitter=a(this,"pod-os:init",7);this.resourceLoadedEmitter=a(this,"pod-os:resource-loaded",7);this.blurredBackground=false;this.loading=true;this.setOs=async t=>{this.os=t}}componentWillLoad(){M.onChange("isLoggedIn",(()=>this.fetchBlob()));this.initializeOsEmitter.emit(this.setOs)}async fetchBlob(){try{this.loading=true;this.imageError=null;this.networkError=null;this.brokenFile=null;const t=await this.os.fetchFile(this.src);this.resourceLoadedEmitter.emit(this.src);if(t.blob()){this.dataUri=URL.createObjectURL(t.blob())}else{this.brokenFile=t}}catch(t){this.networkError=t}finally{this.loading=false}}onImageError(t){this.networkError=null;this.imageError=t}render(){if(this.loading){return n("ion-skeleton-text",{animated:true})}if(this.networkError){return n("img",{alt:this.alt,src:this.src,onError:t=>this.onImageError(t)})}if(this.brokenFile){return n(W,{file:this.brokenFile})}if(this.imageError){return n("div",{class:"error"},n("a",{href:this.src},this.src))}return n(i,{style:{backgroundImage:this.blurredBackground?`url('${this.dataUri}')`:null}},n("img",{src:this.dataUri,alt:this.alt}))}static get watchers(){return{os:["fetchBlob"],src:["fetchBlob"]}}};ao.style=oo;const co=class{constructor(t){e(this,t);this.uri="pod-os:dashboard"}render(){return this.uri==="pod-os:settings"?n("pos-app-settings",null):n("pos-app-dashboard",null)}};const lo=class{constructor(t){e(this,t);this.subscribeResource=a(this,"pod-os:resource",7);this.receiveResource=t=>{this.resource=t}}componentWillLoad(){J(this)}render(){return this.resource?this.resource.label():null}};const ho=".container{display:flex;align-items:center;gap:var(--size-2)}.user-data{align-items:center;display:inline-flex;gap:10px}.user-data pos-picture{--width:40px;--height:40px;--border-radius:50%}pos-login-form{margin:var(--size-2)}dialog{margin-top:var(--size-10)}button#login,button#logout{outline:none;font-weight:var(--weight-bold);letter-spacing:var(--letter-xl);border:none;box-sizing:border-box;border-radius:var(--radius-xs);padding:var(--size-2);box-shadow:var(--shadow-sm);color:var(--pos-primary-text-color);background-color:var(--pos-primary-color)}button#login:focus-within,button#logout:focus-within{outline:var(--pos-input-focus-outline)}button#login:focus,button#login:hover,button#logout:focus,button#logout:hover{filter:brightness(110%);box-shadow:var(--shadow-md)}";const uo=ho;const fo=class{constructor(t){e(this,t);this.initializeOsEmitter=a(this,"pod-os:init",7);this.customLoggedInComponent=false;this.setOs=async t=>{this.os=t}}componentWillLoad(){this.customLoggedInComponent=!!this.host.querySelector('[slot="if-logged-in"]');this.initializeOsEmitter.emit(this.setOs)}login(t){const e=t.detail;this.os.login(e)}logout(){this.os.logout()}onLogin(){this.openDialog()}openDialog(){this.dialog.showModal()}render(){return n(i,{key:"8f9cbfdf5a4024b197771ecff10208ee39ab39da"},n("div",{key:"9d63ca7862e6ef22be30d6388d9e9a8061b5081e",class:"container"},!M.state.isLoggedIn?n("button",{id:"login",onClick:()=>this.openDialog()},"Login"):this.loggedInComponents()),n("pos-dialog",{key:"0e5847b6fdd0aebac9e0bbbb2d47698bf0737b22",ref:t=>this.dialog=t},n("span",{key:"d5f2d6df1406e079cbc50106c01a0aa1ea7d07dd",slot:"title"},"Sign in to your Pod"),n("pos-login-form",{key:"369326cb176faf50d5e8d6d1b636b3d7798cd0d3","onPod-os:idp-url-selected":t=>this.login(t),slot:"content"})))}loggedInComponents(){return this.customLoggedInComponent?n("slot",{name:"if-logged-in"}):this.defaultLoggedInComponents()}defaultLoggedInComponents(){return[n("pos-resource",{uri:M.state.webId},n("span",{class:"user-data"},n("pos-picture",null),n("pos-label",null))),n("button",{id:"logout",onClick:()=>this.logout()},"Logout")]}get host(){return s(this)}};fo.style=uo;const po=":host{display:block;margin:0}form{display:flex;flex-direction:column;gap:var(--size-4)}input{outline:var(--pos-input-outline);padding:var(--scale-000);border:none;border-radius:var(--radius-xs);width:var(--size-full);box-sizing:border-box;background:var(--pos-input-background-color);color:var(--pos-normal-text-color)}input:focus-within{outline:var(--pos-input-focus-outline)}input#login{outline:none;box-shadow:var(--shadow-sm);cursor:pointer;color:var(--pos-primary-text-color);background-color:var(--pos-primary-color)}input#login:disabled{cursor:default;color:var(--pos-disabled-text-color);background-color:var(--pos-disabled-color);box-shadow:none}input#login:hover:not(:disabled),input#login:focus{filter:brightness(110%);box-shadow:var(--shadow-md)}";const bo=po;const mo=class{constructor(t){e(this,t);this.idpUrlSelected=a(this,"pod-os:idp-url-selected",7);this.idpUrl="";this.canSubmit=false}validate(){this.canSubmit=Boolean(this.idpUrl)}render(){return n("form",{key:"8504357a8c80ea64a4673ccbf73c1ca870b4a244",method:"dialog",onSubmit:()=>this.handleSubmit()},n("label",{key:"d53473ff19f1ba89d3c70294eac925a2b3ef6baf",htmlFor:"idpUrl"},"Please enter your Identity Provider"),n("input",{key:"311a6c2e10e8c4b5d1d6d6fb49173b4c170da4f5",id:"idpUrl",type:"url",value:this.idpUrl,required:true,onInput:t=>this.handleChange(t),list:"suggestedIssuers",placeholder:"Type to search..."}),n("datalist",{key:"b9d4555ff8cc1cb8328171d51f6fb26163de6747",id:"suggestedIssuers"},n("option",{key:"b5beeb77c2def2f8773fc20324f92b91fd487169",value:"https://solidcommunity.net/"},"solidcommunity.net"),n("option",{key:"49979b609e9340bfda3be7b8f1614451a9d767eb",value:"https://solidweb.me/"},"solidweb.me"),n("option",{key:"a898a1b9e967fdf1a3cd1290d3fdec330294aa7d",value:"https://login.inrupt.com"},"Inrupt PodSpaces"),n("option",{key:"cc87c94deb800b066d545c002786aa6af8ea630b",value:"https://trinpod.us"},"trinpod.us"),n("option",{key:"2f4705747451be8b0e1e831897ae9044239b1c74",value:"https://trinpod.eu"},"trinpod.eu"),n("option",{key:"aaad788c5f3f9103a095be51e9db843e0dcad272",value:"https://solid.redpencil.io/"},"redpencil.io"),n("option",{key:"49cf185d7eedc8781ff37e2fe39bcee0c4894f40",value:"https://teamid.live/"},"teamid.live")),n("input",{key:"7ddd76b1600d05e8585e895fb9ac7821c8648375",id:"login",type:"submit",value:"Login",disabled:!this.canSubmit}))}handleChange(t){this.validate();this.idpUrl=t.target.value}async handleSubmit(){this.idpUrlSelected.emit(this.idpUrl)}static get delegatesFocus(){return true}static get watchers(){return{idpUrl:["validate"]}}};mo.style=bo;
|
|
19
|
+
*/const se=(t,e,n)=>{const i=d(t).querySelector(".toast-wrapper");const s=t.clientHeight;const r=i.getBoundingClientRect();let o=0;const a=.5;const c=t.position==="middle"?.5:0;const l=t.position==="top"?-1:1;const h=Qt(s,r.height);const u=[{offset:0,transform:`translateY(-${h+r.height}px)`},{offset:.5,transform:`translateY(0px)`},{offset:1,transform:`translateY(${h+r.height}px)`}];const f=O("toast-swipe-to-dismiss-animation").addElement(i).duration(100);switch(t.position){case"middle":o=s+r.height;f.keyframes(u);f.progressStart(true,.5);break;case"top":o=r.bottom;f.keyframes([{offset:0,transform:`translateY(${e.top})`},{offset:1,transform:"translateY(-100%)"}]);f.progressStart(true,0);break;case"bottom":default:o=s-r.top;f.keyframes([{offset:0,transform:`translateY(${e.bottom})`},{offset:1,transform:"translateY(100%)"}]);f.progressStart(true,0);break}const p=t=>t*l/o;const b=t=>{const e=c+p(t.deltaY);f.progressStep(e)};const m=e=>{const s=e.velocityY;const r=(e.deltaY+s*1e3)/o*l;g.enable(false);let c=true;let d=1;let b=0;let m=0;if(t.position==="middle"){c=r>=a/2||r<=-a/2;d=1;b=0;const t=i.getBoundingClientRect();const n=t.top-h;const s=`${n}px`;const o=e.deltaY<=0?-1:1;const l=(h+t.height)*o;const u=c?`${l}px`:"0px";const p=[{offset:0,transform:`translateY(${s})`},{offset:1,transform:`translateY(${u})`}];f.keyframes(p);m=l-n}else{c=r>=a;d=c?1:0;b=p(e.deltaY);const t=c?1-b:b;m=t*o}const w=Math.min(Math.abs(m)/Math.abs(s),200);f.onFinish((()=>{if(c){n();f.destroy()}else{if(t.position==="middle"){f.keyframes(u).progressStart(true,.5)}else{f.progressStart(true,0)}g.enable(true)}}),{oneTimeCallback:true}).progressEnd(d,b,w)};const g=j({el:i,gestureName:"toast-swipe-to-dismiss",gesturePriority:x,direction:"y",onMove:b,onEnd:m});return g};const re=":host{--border-width:0;--border-style:none;--border-color:initial;--box-shadow:none;--min-width:auto;--width:auto;--min-height:auto;--height:auto;--max-height:auto;--white-space:normal;top:0;display:block;position:absolute;width:100%;height:100%;outline:none;color:var(--color);font-family:var(--ion-font-family, inherit);contain:strict;z-index:1001;pointer-events:none}@supports (inset-inline-start: 0){:host{inset-inline-start:0}}@supports not (inset-inline-start: 0){:host{left:0}:host-context([dir=rtl]){left:unset;right:unset;right:0}@supports selector(:dir(rtl)){:host(:dir(rtl)){left:unset;right:unset;right:0}}}:host(.overlay-hidden){display:none}:host(.ion-color){--button-color:inherit;color:var(--ion-color-contrast)}:host(.ion-color) .toast-button-cancel{color:inherit}:host(.ion-color) .toast-wrapper{background:var(--ion-color-base)}.toast-wrapper{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);box-shadow:var(--box-shadow)}@supports (inset-inline-start: 0){.toast-wrapper{inset-inline-start:var(--start);inset-inline-end:var(--end)}}@supports not (inset-inline-start: 0){.toast-wrapper{left:var(--start);right:var(--end)}:host-context([dir=rtl]) .toast-wrapper{left:unset;right:unset;left:var(--end);right:var(--start)}[dir=rtl] .toast-wrapper{left:unset;right:unset;left:var(--end);right:var(--start)}@supports selector(:dir(rtl)){.toast-wrapper:dir(rtl){left:unset;right:unset;left:var(--end);right:var(--start)}}}.toast-wrapper.toast-top{transform:translate3d(0, -100%, 0);top:0}.toast-wrapper.toast-bottom{transform:translate3d(0, 100%, 0);bottom:0}.toast-container{display:flex;align-items:center;pointer-events:auto;height:inherit;min-height:inherit;max-height:inherit;contain:content}.toast-layout-stacked .toast-container{flex-wrap:wrap}.toast-layout-baseline .toast-content{display:flex;flex:1;flex-direction:column;justify-content:center}.toast-icon{-webkit-margin-start:16px;margin-inline-start:16px}.toast-content{min-width:0}.toast-message{flex:1;white-space:var(--white-space)}.toast-button-group{display:flex}.toast-layout-stacked .toast-button-group{justify-content:end;width:100%}.toast-button{border:0;outline:none;color:var(--button-color);z-index:0}.toast-icon,.toast-button-icon{font-size:1.4em}.toast-button-inner{display:flex;align-items:center}@media (any-hover: hover){.toast-button:hover{cursor:pointer}}:host{--background:var(--ion-color-step-50, #f2f2f2);--border-radius:14px;--button-color:var(--ion-color-primary, #3880ff);--color:var(--ion-color-step-850, #262626);--max-width:700px;--max-height:478px;--start:10px;--end:10px;font-size:clamp(14px, 0.875rem, 43.4px)}.toast-wrapper{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:auto;margin-bottom:auto;display:block;position:absolute;z-index:10}@supports (backdrop-filter: blur(0)){:host(.toast-translucent) .toast-wrapper{background:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8);backdrop-filter:saturate(180%) blur(20px)}:host(.ion-color.toast-translucent) .toast-wrapper{background:rgba(var(--ion-color-base-rgb), 0.8)}}.toast-wrapper.toast-middle{opacity:0.01}.toast-content{-webkit-padding-start:15px;padding-inline-start:15px;-webkit-padding-end:15px;padding-inline-end:15px;padding-top:15px;padding-bottom:15px}.toast-header{margin-bottom:2px;font-weight:500}.toast-button{-webkit-padding-start:15px;padding-inline-start:15px;-webkit-padding-end:15px;padding-inline-end:15px;padding-top:10px;padding-bottom:10px;min-height:44px;transition:background-color, opacity 100ms linear;border:0;background-color:transparent;font-family:var(--ion-font-family);font-size:clamp(17px, 1.0625rem, 21.998px);font-weight:500;overflow:hidden}.toast-button.ion-activated{opacity:0.4}@media (any-hover: hover){.toast-button:hover{opacity:0.6}}";const oe=re;const ae=":host{--border-width:0;--border-style:none;--border-color:initial;--box-shadow:none;--min-width:auto;--width:auto;--min-height:auto;--height:auto;--max-height:auto;--white-space:normal;top:0;display:block;position:absolute;width:100%;height:100%;outline:none;color:var(--color);font-family:var(--ion-font-family, inherit);contain:strict;z-index:1001;pointer-events:none}@supports (inset-inline-start: 0){:host{inset-inline-start:0}}@supports not (inset-inline-start: 0){:host{left:0}:host-context([dir=rtl]){left:unset;right:unset;right:0}@supports selector(:dir(rtl)){:host(:dir(rtl)){left:unset;right:unset;right:0}}}:host(.overlay-hidden){display:none}:host(.ion-color){--button-color:inherit;color:var(--ion-color-contrast)}:host(.ion-color) .toast-button-cancel{color:inherit}:host(.ion-color) .toast-wrapper{background:var(--ion-color-base)}.toast-wrapper{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);box-shadow:var(--box-shadow)}@supports (inset-inline-start: 0){.toast-wrapper{inset-inline-start:var(--start);inset-inline-end:var(--end)}}@supports not (inset-inline-start: 0){.toast-wrapper{left:var(--start);right:var(--end)}:host-context([dir=rtl]) .toast-wrapper{left:unset;right:unset;left:var(--end);right:var(--start)}[dir=rtl] .toast-wrapper{left:unset;right:unset;left:var(--end);right:var(--start)}@supports selector(:dir(rtl)){.toast-wrapper:dir(rtl){left:unset;right:unset;left:var(--end);right:var(--start)}}}.toast-wrapper.toast-top{transform:translate3d(0, -100%, 0);top:0}.toast-wrapper.toast-bottom{transform:translate3d(0, 100%, 0);bottom:0}.toast-container{display:flex;align-items:center;pointer-events:auto;height:inherit;min-height:inherit;max-height:inherit;contain:content}.toast-layout-stacked .toast-container{flex-wrap:wrap}.toast-layout-baseline .toast-content{display:flex;flex:1;flex-direction:column;justify-content:center}.toast-icon{-webkit-margin-start:16px;margin-inline-start:16px}.toast-content{min-width:0}.toast-message{flex:1;white-space:var(--white-space)}.toast-button-group{display:flex}.toast-layout-stacked .toast-button-group{justify-content:end;width:100%}.toast-button{border:0;outline:none;color:var(--button-color);z-index:0}.toast-icon,.toast-button-icon{font-size:1.4em}.toast-button-inner{display:flex;align-items:center}@media (any-hover: hover){.toast-button:hover{cursor:pointer}}:host{--background:var(--ion-color-step-800, #333333);--border-radius:4px;--box-shadow:0 3px 5px -1px rgba(0, 0, 0, 0.2), 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12);--button-color:var(--ion-color-primary, #3880ff);--color:var(--ion-color-step-50, #f2f2f2);--max-width:700px;--start:8px;--end:8px;font-size:0.875rem}.toast-wrapper{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:auto;margin-bottom:auto;display:block;position:absolute;opacity:0.01;z-index:10}.toast-content{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:14px;padding-bottom:14px}.toast-header{margin-bottom:2px;font-weight:500;line-height:1.25rem}.toast-message{line-height:1.25rem}.toast-layout-baseline .toast-button-group-start{-webkit-margin-start:8px;margin-inline-start:8px}.toast-layout-stacked .toast-button-group-start{-webkit-margin-end:8px;margin-inline-end:8px;margin-top:8px}.toast-layout-baseline .toast-button-group-end{-webkit-margin-end:8px;margin-inline-end:8px}.toast-layout-stacked .toast-button-group-end{-webkit-margin-end:8px;margin-inline-end:8px;margin-bottom:8px}.toast-button{-webkit-padding-start:15px;padding-inline-start:15px;-webkit-padding-end:15px;padding-inline-end:15px;padding-top:10px;padding-bottom:10px;position:relative;background-color:transparent;font-family:var(--ion-font-family);font-size:0.875rem;font-weight:500;letter-spacing:0.84px;text-transform:uppercase;overflow:hidden}.toast-button-cancel{color:var(--ion-color-step-100, #e6e6e6)}.toast-button-icon-only{border-radius:50%;-webkit-padding-start:9px;padding-inline-start:9px;-webkit-padding-end:9px;padding-inline-end:9px;padding-top:9px;padding-bottom:9px;width:36px;height:36px}@media (any-hover: hover){.toast-button:hover{background-color:rgba(var(--ion-color-primary-rgb, 56, 128, 255), 0.08)}.toast-button-cancel:hover{background-color:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.08)}}";const ce=ae;const le=class{constructor(t){e(this,t);this.didPresent=a(this,"ionToastDidPresent",7);this.willPresent=a(this,"ionToastWillPresent",7);this.willDismiss=a(this,"ionToastWillDismiss",7);this.didDismiss=a(this,"ionToastDidDismiss",7);this.didPresentShorthand=a(this,"didPresent",7);this.willPresentShorthand=a(this,"willPresent",7);this.willDismissShorthand=a(this,"willDismiss",7);this.didDismissShorthand=a(this,"didDismiss",7);this.delegateController=S(this);this.lockController=y();this.triggerController=_();this.customHTMLEnabled=m.get("innerHTMLTemplatesEnabled",w);this.presented=false;this.dispatchCancelHandler=t=>{const e=t.detail.role;if(E(e)){const t=this.getButtons().find((t=>t.role==="cancel"));this.callButtonHandler(t)}};this.createSwipeGesture=t=>{const e=this.gesture=se(this.el,t,(()=>{this.dismiss(undefined,I)}));e.enable(true)};this.destroySwipeGesture=()=>{const{gesture:t}=this;if(t===undefined){return}t.destroy();this.gesture=undefined};this.prefersSwipeGesture=()=>{const{swipeGesture:t}=this;return t==="vertical"};this.revealContentToScreenReader=false;this.overlayIndex=undefined;this.delegate=undefined;this.hasController=false;this.color=undefined;this.enterAnimation=undefined;this.leaveAnimation=undefined;this.cssClass=undefined;this.duration=m.getNumber("toastDuration",0);this.header=undefined;this.layout="baseline";this.message=undefined;this.keyboardClose=false;this.position="bottom";this.positionAnchor=undefined;this.buttons=undefined;this.translucent=false;this.animated=true;this.icon=undefined;this.htmlAttributes=undefined;this.swipeGesture=undefined;this.isOpen=false;this.trigger=undefined}swipeGestureChanged(){this.destroySwipeGesture();if(this.presented&&this.prefersSwipeGesture()){this.createSwipeGesture(this.lastPresentedPosition)}}onIsOpenChange(t,e){if(t===true&&e===false){this.present()}else if(t===false&&e===true){this.dismiss()}}triggerChanged(){const{trigger:t,el:e,triggerController:n}=this;if(t){n.addClickListener(e,t)}}connectedCallback(){A(this.el);this.triggerChanged()}disconnectedCallback(){this.triggerController.removeClickListener()}componentWillLoad(){C(this.el)}componentDidLoad(){if(this.isOpen===true){u((()=>this.present()))}this.triggerChanged()}async present(){const t=await this.lockController.lock();await this.delegateController.attachViewToDom();const{el:e,position:n}=this;const i=this.getAnchorElement();const s=Gt(n,i,g(this),e);this.lastPresentedPosition=s;await z(this,"toastEnter",te,ne,{position:n,top:s.top,bottom:s.bottom});this.revealContentToScreenReader=true;if(this.duration>0){this.durationTimeout=setTimeout((()=>this.dismiss(undefined,"timeout")),this.duration)}if(this.prefersSwipeGesture()){this.createSwipeGesture(s)}t()}async dismiss(t,e){var n,i;const s=await this.lockController.lock();const{durationTimeout:r,position:o,lastPresentedPosition:a}=this;if(r){clearTimeout(r)}const c=await T(this,t,e,"toastLeave",ee,ie,{position:o,top:(n=a===null||a===void 0?void 0:a.top)!==null&&n!==void 0?n:"",bottom:(i=a===null||a===void 0?void 0:a.bottom)!==null&&i!==void 0?i:""});if(c){this.delegateController.removeViewFromDom();this.revealContentToScreenReader=false}this.lastPresentedPosition=undefined;this.destroySwipeGesture();s();return c}onDidDismiss(){return $(this.el,"ionToastDidDismiss")}onWillDismiss(){return $(this.el,"ionToastWillDismiss")}getButtons(){const t=this.buttons?this.buttons.map((t=>typeof t==="string"?{text:t}:t)):[];return t}getAnchorElement(){const{position:t,positionAnchor:e,el:n}=this;if(e===undefined){return}if(t==="middle"&&e!==undefined){k('The positionAnchor property is ignored when using position="middle".',this.el);return undefined}if(typeof e==="string"){const t=document.getElementById(e);if(t===null){k(`An anchor element with an ID of "${e}" was not found in the DOM.`,n);return undefined}return t}if(e instanceof HTMLElement){return e}k("Invalid positionAnchor value:",e,n);return undefined}async buttonClick(t){const e=t.role;if(E(e)){return this.dismiss(undefined,e)}const n=await this.callButtonHandler(t);if(n){return this.dismiss(undefined,e)}return Promise.resolve()}async callButtonHandler(t){if(t===null||t===void 0?void 0:t.handler){try{const e=await P(t.handler);if(e===false){return false}}catch(t){console.error(t)}}return true}renderButtons(t,e){if(t.length===0){return}const i=g(this);const s={"toast-button-group":true,[`toast-button-group-${e}`]:true};return n("div",{class:s},t.map((t=>n("button",Object.assign({},t.htmlAttributes,{type:"button",class:he(t),tabIndex:0,onClick:()=>this.buttonClick(t),part:de(t)}),n("div",{class:"toast-button-inner"},t.icon&&n("ion-icon",{"aria-hidden":"true",icon:t.icon,slot:t.text===undefined?"icon-only":undefined,class:"toast-button-icon"}),t.text),i==="md"&&n("ion-ripple-effect",{type:t.icon!==undefined&&t.text===undefined?"unbounded":"bounded"})))))}renderToastMessage(t,e=null){const{customHTMLEnabled:i,message:s}=this;if(i){return n("div",{key:t,"aria-hidden":e,class:"toast-message",part:"message",innerHTML:v(s)})}return n("div",{key:t,"aria-hidden":e,class:"toast-message",part:"message"},s)}renderHeader(t,e=null){return n("div",{key:t,class:"toast-header","aria-hidden":e,part:"header"},this.header)}render(){const{layout:t,el:e,revealContentToScreenReader:s,header:r,message:o}=this;const a=this.getButtons();const c=a.filter((t=>t.side==="start"));const l=a.filter((t=>t.side!=="start"));const h=g(this);const d={"toast-wrapper":true,[`toast-${this.position}`]:true,[`toast-layout-${t}`]:true};if(t==="stacked"&&c.length>0&&l.length>0){k("This toast is using start and end buttons with the stacked toast layout. We recommend following the best practice of using either start or end buttons with the stacked toast layout.",e)}return n(i,Object.assign({key:"23803334fb668f6ce7044d3a321cb84bc753bd16",tabindex:"-1"},this.htmlAttributes,{style:{zIndex:`${6e4+this.overlayIndex}`},class:f(this.color,Object.assign(Object.assign({[h]:true},b(this.cssClass)),{"overlay-hidden":true,"toast-translucent":this.translucent})),onIonToastWillDismiss:this.dispatchCancelHandler}),n("div",{key:"7cd7138ba079fccf97f318b91e9986491ab4214d",class:d},n("div",{key:"93b78fa64e24435adeb77a04c1d1d53d2f093864",class:"toast-container",part:"container"},this.renderButtons(c,"start"),this.icon!==undefined&&n("ion-icon",{key:"9a3c71b164ebcfba2540acb7568beffa76b62f47",class:"toast-icon",part:"icon",icon:this.icon,lazy:false,"aria-hidden":"true"}),n("div",{key:"feb9268102d844f1314205f7440de7066cf0620e",class:"toast-content",role:"status","aria-atomic":"true","aria-live":"polite"},!s&&r!==undefined&&this.renderHeader("oldHeader","true"),!s&&o!==undefined&&this.renderToastMessage("oldMessage","true"),s&&r!==undefined&&this.renderHeader("header"),s&&o!==undefined&&this.renderToastMessage("header")),this.renderButtons(l,"end"))))}get el(){return s(this)}static get watchers(){return{swipeGesture:["swipeGestureChanged"],isOpen:["onIsOpenChange"],trigger:["triggerChanged"]}}};const he=t=>Object.assign({"toast-button":true,"toast-button-icon-only":t.icon!==undefined&&t.text===undefined,[`toast-button-${t.role}`]:t.role!==undefined,"ion-focusable":true,"ion-activatable":true},b(t.cssClass));const de=t=>E(t.role)?"button cancel":"button";le.style={ios:oe,md:ce};const ue=":host{font-family:var(--font-sans);display:block}button#new{cursor:pointer;display:flex;align-items:center;justify-content:center;border:none;width:var(--size-10);height:var(--size-10);background-color:var(--pos-primary-color);color:var(--pos-primary-text-color);font-size:var(--scale-6);border-radius:var(--radius-xs)}button#new:hover,button#new:focus{outline:none;filter:brightness(110%);box-shadow:var(--shadow-sm)}pos-new-thing-form{margin:var(--scale-3)}";const fe=ue;const pe=class{constructor(t){e(this,t)}openDialog(){this.dialog.showModal()}render(){return n(i,{key:"6142a141ef03ca93a362a6b00ebe8d515c3a677a"},n("button",{key:"72ecf353cd3a7d2d68f9ef28eb1bbe7fdb88b700",id:"new",title:"Add a new thing",onClick:()=>this.openDialog()},n("ion-icon",{key:"bd05d75c42c10de6df519575787fc66eafb22930",name:"add-circle-outline"})),n("pos-dialog",{key:"23cf0118149704dfca16758970e4f4658e87e946",ref:t=>this.dialog=t},n("span",{key:"5af7b7f618cc20684c39134b5ea295400e651cb6",slot:"title"},"Add a new thing"),n("pos-new-thing-form",{key:"895496c2f6ede3c8677d9d918e0b13582090baed",slot:"content",referenceUri:this.referenceUri})))}};pe.style=fe;const be=localStorage.getItem("settings");const me=be?JSON.parse(be):{offlineCache:false};const ge=L(me);we();ve();function we(){ge.on("set",(()=>{const t=JSON.stringify(ge.state);localStorage.setItem("settings",t)}))}function ve(){window.addEventListener("storage",(t=>{if(t.key==="settings"&&t.newValue){const e=JSON.parse(t.newValue);ge.state.offlineCache=e.offlineCache}}))}const ye=(t,e)=>e.some((e=>t instanceof e));let ke;let xe;function Se(){return ke||(ke=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function _e(){return xe||(xe=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Ee=new WeakMap;const Ae=new WeakMap;const Ce=new WeakMap;function ze(t){const e=new Promise(((e,n)=>{const i=()=>{t.removeEventListener("success",s);t.removeEventListener("error",r)};const s=()=>{e(Oe(t.result));i()};const r=()=>{n(t.error);i()};t.addEventListener("success",s);t.addEventListener("error",r)}));Ce.set(e,t);return e}function Te(t){if(Ee.has(t))return;const e=new Promise(((e,n)=>{const i=()=>{t.removeEventListener("complete",s);t.removeEventListener("error",r);t.removeEventListener("abort",r)};const s=()=>{e();i()};const r=()=>{n(t.error||new DOMException("AbortError","AbortError"));i()};t.addEventListener("complete",s);t.addEventListener("error",r);t.addEventListener("abort",r)}));Ee.set(t,e)}let $e={get(t,e,n){if(t instanceof IDBTransaction){if(e==="done")return Ee.get(t);if(e==="store"){return n.objectStoreNames[1]?undefined:n.objectStore(n.objectStoreNames[0])}}return Oe(t[e])},set(t,e,n){t[e]=n;return true},has(t,e){if(t instanceof IDBTransaction&&(e==="done"||e==="store")){return true}return e in t}};function Pe(t){$e=t($e)}function Ie(t){if(_e().includes(t)){return function(...e){t.apply(De(this),e);return Oe(this.request)}}return function(...e){return Oe(t.apply(De(this),e))}}function Re(t){if(typeof t==="function")return Ie(t);if(t instanceof IDBTransaction)Te(t);if(ye(t,Se()))return new Proxy(t,$e);return t}function Oe(t){if(t instanceof IDBRequest)return ze(t);if(Ae.has(t))return Ae.get(t);const e=Re(t);if(e!==t){Ae.set(t,e);Ce.set(e,t)}return e}const De=t=>Ce.get(t);function je(t,e,{blocked:n,upgrade:i,blocking:s,terminated:r}={}){const o=indexedDB.open(t,e);const a=Oe(o);if(i){o.addEventListener("upgradeneeded",(t=>{i(Oe(o.result),t.oldVersion,t.newVersion,Oe(o.transaction),t)}))}if(n){o.addEventListener("blocked",(t=>n(t.oldVersion,t.newVersion,t)))}a.then((t=>{if(r)t.addEventListener("close",(()=>r()));if(s){t.addEventListener("versionchange",(t=>s(t.oldVersion,t.newVersion,t)))}})).catch((()=>{}));return a}const Le=["get","getKey","getAll","getAllKeys","count"];const Me=["put","add","delete","clear"];const We=new Map;function Ue(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e==="string")){return}if(We.get(e))return We.get(e);const n=e.replace(/FromIndex$/,"");const i=e!==n;const s=Me.includes(n);if(!(n in(i?IDBIndex:IDBObjectStore).prototype)||!(s||Le.includes(n))){return}const r=async function(t,...e){const r=this.transaction(t,s?"readwrite":"readonly");let o=r.store;if(i)o=o.index(e.shift());return(await Promise.all([o[n](...e),s&&r.done]))[0]};We.set(e,r);return r}Pe((t=>({...t,get:(e,n,i)=>Ue(e,n)||t.get(e,n,i),has:(e,n)=>!!Ue(e,n)||t.has(e,n)})));const He=["continue","continuePrimaryKey","advance"];const Ne={};const Je=new WeakMap;const Be=new WeakMap;const Ke={get(t,e){if(!He.includes(e))return t[e];let n=Ne[e];if(!n){n=Ne[e]=function(...t){Je.set(this,Be.get(this)[e](...t))}}return n}};async function*Fe(...t){let e=this;if(!(e instanceof IDBCursor)){e=await e.openCursor(...t)}if(!e)return;e=e;const n=new Proxy(e,Ke);Be.set(n,e);Ce.set(n,De(e));while(e){yield n;e=await(Je.get(n)||e.continue());Je.delete(n)}}function Xe(t,e){return e===Symbol.asyncIterator&&ye(t,[IDBIndex,IDBObjectStore,IDBCursor])||e==="iterate"&&ye(t,[IDBIndex,IDBObjectStore])}Pe((t=>({...t,get(e,n,i){if(Xe(e,n))return Fe;return t.get(e,n,i)},has(e,n){return Xe(e,n)||t.has(e,n)}})));class Ve{constructor(){this.dbPromise=je("OfflineCacheDB",1,{upgrade(t){if(!t.objectStoreNames.contains("documents")){const e=t.createObjectStore("documents",{keyPath:"url"});e.createIndex("url-revision",["url","revision"])}}})}async clear(){const t=await this.dbPromise;return t.clear("documents")}async get(t){const e=await this.dbPromise;return await e.get("documents",t)}async put(t){const e=await this.dbPromise;const n=await e.getFromIndex("documents","url-revision",[t.url,t.revision]);if(n){return}await e.put("documents",t)}}class Ye{isOnline(){return navigator.onLine}}const qe=(t,e)=>new U({session:t,offlineCache:e.offlineCache?new Ve:new H,onlineStatus:new Ye});function Ge(t){return typeof t==="function"}function Ze(t){const e=t=>{Error.call(t);t.stack=(new Error).stack};const n=t(e);n.prototype=Object.create(Error.prototype);n.prototype.constructor=n;return n}const Qe=Ze((t=>function e(n){t(this);this.message=n?`${n.length} errors occurred during unsubscription:\n${n.map(((t,e)=>`${e+1}) ${t.toString()}`)).join("\n ")}`:"";this.name="UnsubscriptionError";this.errors=n}));function tn(t,e){if(t){const n=t.indexOf(e);0<=n&&t.splice(n,1)}}class en{constructor(t){this.initialTeardown=t;this.closed=false;this._parentage=null;this._finalizers=null}unsubscribe(){let t;if(!this.closed){this.closed=true;const{_parentage:e}=this;if(e){this._parentage=null;if(Array.isArray(e)){for(const t of e){t.remove(this)}}else{e.remove(this)}}const{initialTeardown:n}=this;if(Ge(n)){try{n()}catch(e){t=e instanceof Qe?e.errors:[e]}}const{_finalizers:i}=this;if(i){this._finalizers=null;for(const e of i){try{rn(e)}catch(e){t=t!==null&&t!==void 0?t:[];if(e instanceof Qe){t=[...t,...e.errors]}else{t.push(e)}}}}if(t){throw new Qe(t)}}}add(t){var e;if(t&&t!==this){if(this.closed){rn(t)}else{if(t instanceof en){if(t.closed||t._hasParent(this)){return}t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}}}_hasParent(t){const{_parentage:e}=this;return e===t||Array.isArray(e)&&e.includes(t)}_addParent(t){const{_parentage:e}=this;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t}_removeParent(t){const{_parentage:e}=this;if(e===t){this._parentage=null}else if(Array.isArray(e)){tn(e,t)}}remove(t){const{_finalizers:e}=this;e&&tn(e,t);if(t instanceof en){t._removeParent(this)}}}en.EMPTY=(()=>{const t=new en;t.closed=true;return t})();const nn=en.EMPTY;function sn(t){return t instanceof en||t&&"closed"in t&&Ge(t.remove)&&Ge(t.add)&&Ge(t.unsubscribe)}function rn(t){if(Ge(t)){t()}else{t.unsubscribe()}}const on={onUnhandledError:null,onStoppedNotification:null,Promise:undefined,useDeprecatedSynchronousErrorHandling:false,useDeprecatedNextContext:false};const an={setTimeout(t,e,...n){const{delegate:i}=an;if(i===null||i===void 0?void 0:i.setTimeout){return i.setTimeout(t,e,...n)}return setTimeout(t,e,...n)},clearTimeout(t){const{delegate:e}=an;return((e===null||e===void 0?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:undefined};function cn(t){an.setTimeout((()=>{const{onUnhandledError:e}=on;if(e){e(t)}else{throw t}}))}function ln(){}const hn=(()=>fn("C",undefined,undefined))();function dn(t){return fn("E",undefined,t)}function un(t){return fn("N",t,undefined)}function fn(t,e,n){return{kind:t,value:e,error:n}}let pn=null;function bn(t){if(on.useDeprecatedSynchronousErrorHandling){const e=!pn;if(e){pn={errorThrown:false,error:null}}t();if(e){const{errorThrown:t,error:e}=pn;pn=null;if(t){throw e}}}else{t()}}class mn extends en{constructor(t){super();this.isStopped=false;if(t){this.destination=t;if(sn(t)){t.add(this)}}else{this.destination=_n}}static create(t,e,n){return new yn(t,e,n)}next(t){if(this.isStopped){Sn(un(t),this)}else{this._next(t)}}error(t){if(this.isStopped){Sn(dn(t),this)}else{this.isStopped=true;this._error(t)}}complete(){if(this.isStopped){Sn(hn,this)}else{this.isStopped=true;this._complete()}}unsubscribe(){if(!this.closed){this.isStopped=true;super.unsubscribe();this.destination=null}}_next(t){this.destination.next(t)}_error(t){try{this.destination.error(t)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const gn=Function.prototype.bind;function wn(t,e){return gn.call(t,e)}class vn{constructor(t){this.partialObserver=t}next(t){const{partialObserver:e}=this;if(e.next){try{e.next(t)}catch(t){kn(t)}}}error(t){const{partialObserver:e}=this;if(e.error){try{e.error(t)}catch(t){kn(t)}}else{kn(t)}}complete(){const{partialObserver:t}=this;if(t.complete){try{t.complete()}catch(t){kn(t)}}}}class yn extends mn{constructor(t,e,n){super();let i;if(Ge(t)||!t){i={next:t!==null&&t!==void 0?t:undefined,error:e!==null&&e!==void 0?e:undefined,complete:n!==null&&n!==void 0?n:undefined}}else{let e;if(this&&on.useDeprecatedNextContext){e=Object.create(t);e.unsubscribe=()=>this.unsubscribe();i={next:t.next&&wn(t.next,e),error:t.error&&wn(t.error,e),complete:t.complete&&wn(t.complete,e)}}else{i=t}}this.destination=new vn(i)}}function kn(t){{cn(t)}}function xn(t){throw t}function Sn(t,e){const{onStoppedNotification:n}=on;n&&an.setTimeout((()=>n(t,e)))}const _n={closed:true,next:ln,error:xn,complete:ln};const En=(()=>typeof Symbol==="function"&&Symbol.observable||"@@observable")();function An(t){return t}function Cn(t){if(t.length===0){return An}if(t.length===1){return t[0]}return function e(n){return t.reduce(((t,e)=>e(t)),n)}}class zn{constructor(t){if(t){this._subscribe=t}}lift(t){const e=new zn;e.source=this;e.operator=t;return e}subscribe(t,e,n){const i=Pn(t)?t:new yn(t,e,n);bn((()=>{const{operator:t,source:e}=this;i.add(t?t.call(i,e):e?this._subscribe(i):this._trySubscribe(i))}));return i}_trySubscribe(t){try{return this._subscribe(t)}catch(e){t.error(e)}}forEach(t,e){e=Tn(e);return new e(((e,n)=>{const i=new yn({next:e=>{try{t(e)}catch(t){n(t);i.unsubscribe()}},error:n,complete:e});this.subscribe(i)}))}_subscribe(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)}[En](){return this}pipe(...t){return Cn(t)(this)}toPromise(t){t=Tn(t);return new t(((t,e)=>{let n;this.subscribe((t=>n=t),(t=>e(t)),(()=>t(n)))}))}}zn.create=t=>new zn(t);function Tn(t){var e;return(e=t!==null&&t!==void 0?t:on.Promise)!==null&&e!==void 0?e:Promise}function $n(t){return t&&Ge(t.next)&&Ge(t.error)&&Ge(t.complete)}function Pn(t){return t&&t instanceof mn||$n(t)&&sn(t)}function In(t){return Ge(t===null||t===void 0?void 0:t.lift)}function Rn(t){return e=>{if(In(e)){return e.lift((function(e){try{return t(e,this)}catch(t){this.error(t)}}))}throw new TypeError("Unable to lift unknown Observable type")}}function On(t,e,n,i,s){return new Dn(t,e,n,i,s)}class Dn extends mn{constructor(t,e,n,i,s,r){super(t);this.onFinalize=s;this.shouldUnsubscribe=r;this._next=e?function(n){try{e(n)}catch(e){t.error(e)}}:super._next;this._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:super._error;this._complete=n?function(){try{n()}catch(e){t.error(e)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){const{closed:e}=this;super.unsubscribe();!e&&((t=this.onFinalize)===null||t===void 0?void 0:t.call(this))}}}const jn=Ze((t=>function e(){t(this);this.name="ObjectUnsubscribedError";this.message="object unsubscribed"}));class Ln extends zn{constructor(){super();this.closed=false;this.currentObservers=null;this.observers=[];this.isStopped=false;this.hasError=false;this.thrownError=null}lift(t){const e=new Mn(this,this);e.operator=t;return e}_throwIfClosed(){if(this.closed){throw new jn}}next(t){bn((()=>{this._throwIfClosed();if(!this.isStopped){if(!this.currentObservers){this.currentObservers=Array.from(this.observers)}for(const e of this.currentObservers){e.next(t)}}}))}error(t){bn((()=>{this._throwIfClosed();if(!this.isStopped){this.hasError=this.isStopped=true;this.thrownError=t;const{observers:e}=this;while(e.length){e.shift().error(t)}}}))}complete(){bn((()=>{this._throwIfClosed();if(!this.isStopped){this.isStopped=true;const{observers:t}=this;while(t.length){t.shift().complete()}}}))}unsubscribe(){this.isStopped=this.closed=true;this.observers=this.currentObservers=null}get observed(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0}_trySubscribe(t){this._throwIfClosed();return super._trySubscribe(t)}_subscribe(t){this._throwIfClosed();this._checkFinalizedStatuses(t);return this._innerSubscribe(t)}_innerSubscribe(t){const{hasError:e,isStopped:n,observers:i}=this;if(e||n){return nn}this.currentObservers=null;i.push(t);return new en((()=>{this.currentObservers=null;tn(i,t)}))}_checkFinalizedStatuses(t){const{hasError:e,thrownError:n,isStopped:i}=this;if(e){t.error(n)}else if(i){t.complete()}}asObservable(){const t=new zn;t.source=this;return t}}Ln.create=(t,e)=>new Mn(t,e);class Mn extends Ln{constructor(t,e){super();this.destination=t;this.source=e}next(t){var e,n;(n=(e=this.destination)===null||e===void 0?void 0:e.next)===null||n===void 0?void 0:n.call(e,t)}error(t){var e,n;(n=(e=this.destination)===null||e===void 0?void 0:e.error)===null||n===void 0?void 0:n.call(e,t)}complete(){var t,e;(e=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||e===void 0?void 0:e.call(t)}_subscribe(t){var e,n;return(n=(e=this.source)===null||e===void 0?void 0:e.subscribe(t))!==null&&n!==void 0?n:nn}}class Wn extends Ln{constructor(t){super();this._value=t}get value(){return this.getValue()}_subscribe(t){const e=super._subscribe(t);!e.closed&&t.next(this._value);return e}getValue(){const{hasError:t,thrownError:e,_value:n}=this;if(t){throw e}this._throwIfClosed();return n}next(t){super.next(this._value=t)}}const Un={now(){return(Un.delegate||Date).now()},delegate:undefined};class Hn extends en{constructor(t,e){super()}schedule(t,e=0){return this}}const Nn={setInterval(t,e,...n){const{delegate:i}=Nn;if(i===null||i===void 0?void 0:i.setInterval){return i.setInterval(t,e,...n)}return setInterval(t,e,...n)},clearInterval(t){const{delegate:e}=Nn;return((e===null||e===void 0?void 0:e.clearInterval)||clearInterval)(t)},delegate:undefined};class Jn extends Hn{constructor(t,e){super(t,e);this.scheduler=t;this.work=e;this.pending=false}schedule(t,e=0){var n;if(this.closed){return this}this.state=t;const i=this.id;const s=this.scheduler;if(i!=null){this.id=this.recycleAsyncId(s,i,e)}this.pending=true;this.delay=e;this.id=(n=this.id)!==null&&n!==void 0?n:this.requestAsyncId(s,this.id,e);return this}requestAsyncId(t,e,n=0){return Nn.setInterval(t.flush.bind(t,this),n)}recycleAsyncId(t,e,n=0){if(n!=null&&this.delay===n&&this.pending===false){return e}if(e!=null){Nn.clearInterval(e)}return undefined}execute(t,e){if(this.closed){return new Error("executing a cancelled action")}this.pending=false;const n=this._execute(t,e);if(n){return n}else if(this.pending===false&&this.id!=null){this.id=this.recycleAsyncId(this.scheduler,this.id,null)}}_execute(t,e){let n=false;let i;try{this.work(t)}catch(t){n=true;i=t?t:new Error("Scheduled action threw falsy error")}if(n){this.unsubscribe();return i}}unsubscribe(){if(!this.closed){const{id:t,scheduler:e}=this;const{actions:n}=e;this.work=this.state=this.scheduler=null;this.pending=false;tn(n,this);if(t!=null){this.id=this.recycleAsyncId(e,t,null)}this.delay=null;super.unsubscribe()}}}class Bn{constructor(t,e=Bn.now){this.schedulerActionCtor=t;this.now=e}schedule(t,e=0,n){return new this.schedulerActionCtor(this,t).schedule(n,e)}}Bn.now=Un.now;class Kn extends Bn{constructor(t,e=Bn.now){super(t,e);this.actions=[];this._active=false}flush(t){const{actions:e}=this;if(this._active){e.push(t);return}let n;this._active=true;do{if(n=t.execute(t.state,t.delay)){break}}while(t=e.shift());this._active=false;if(n){while(t=e.shift()){t.unsubscribe()}throw n}}}const Fn=new Kn(Jn);function Xn(t,e,n,i){function s(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,r){function o(t){try{c(i.next(t))}catch(t){r(t)}}function a(t){try{c(i["throw"](t))}catch(t){r(t)}}function c(t){t.done?n(t.value):s(t.value).then(o,a)}c((i=i.apply(t,e||[])).next())}))}function Vn(t){var e=typeof Symbol==="function"&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&i>=t.length)t=void 0;return{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Yn(t){return this instanceof Yn?(this.v=t,this):new Yn(t)}function qn(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n.apply(t,e||[]),s,r=[];return s={},o("next"),o("throw"),o("return"),s[Symbol.asyncIterator]=function(){return this},s;function o(t){if(i[t])s[t]=function(e){return new Promise((function(n,i){r.push([t,e,n,i])>1||a(t,e)}))}}function a(t,e){try{c(i[t](e))}catch(t){d(r[0][3],t)}}function c(t){t.value instanceof Yn?Promise.resolve(t.value.v).then(l,h):d(r[0][2],t)}function l(t){a("next",t)}function h(t){a("throw",t)}function d(t,e){if(t(e),r.shift(),r.length)a(r[0][0],r[0][1])}}function Gn(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof Vn==="function"?Vn(t):t[Symbol.iterator](),n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n);function i(e){n[e]=t[e]&&function(n){return new Promise((function(i,r){n=t[e](n),s(i,r,n.done,n.value)}))}}function s(t,e,n,i){Promise.resolve(i).then((function(e){t({value:e,done:n})}),e)}}typeof SuppressedError==="function"?SuppressedError:function(t,e,n){var i=new Error(n);return i.name="SuppressedError",i.error=t,i.suppressed=e,i};const Zn=t=>t&&typeof t.length==="number"&&typeof t!=="function";function Qn(t){return Ge(t===null||t===void 0?void 0:t.then)}function ti(t){return Ge(t[En])}function ei(t){return Symbol.asyncIterator&&Ge(t===null||t===void 0?void 0:t[Symbol.asyncIterator])}function ni(t){return new TypeError(`You provided ${t!==null&&typeof t==="object"?"an invalid object":`'${t}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function ii(){if(typeof Symbol!=="function"||!Symbol.iterator){return"@@iterator"}return Symbol.iterator}const si=ii();function ri(t){return Ge(t===null||t===void 0?void 0:t[si])}function oi(t){return qn(this,arguments,(function*e(){const n=t.getReader();try{while(true){const{value:t,done:e}=yield Yn(n.read());if(e){return yield Yn(void 0)}yield yield Yn(t)}}finally{n.releaseLock()}}))}function ai(t){return Ge(t===null||t===void 0?void 0:t.getReader)}function ci(t){if(t instanceof zn){return t}if(t!=null){if(ti(t)){return li(t)}if(Zn(t)){return hi(t)}if(Qn(t)){return di(t)}if(ei(t)){return fi(t)}if(ri(t)){return ui(t)}if(ai(t)){return pi(t)}}throw ni(t)}function li(t){return new zn((e=>{const n=t[En]();if(Ge(n.subscribe)){return n.subscribe(e)}throw new TypeError("Provided object does not correctly implement Symbol.observable")}))}function hi(t){return new zn((e=>{for(let n=0;n<t.length&&!e.closed;n++){e.next(t[n])}e.complete()}))}function di(t){return new zn((e=>{t.then((t=>{if(!e.closed){e.next(t);e.complete()}}),(t=>e.error(t))).then(null,cn)}))}function ui(t){return new zn((e=>{for(const n of t){e.next(n);if(e.closed){return}}e.complete()}))}function fi(t){return new zn((e=>{bi(t,e).catch((t=>e.error(t)))}))}function pi(t){return fi(oi(t))}function bi(t,e){var n,i;var s,r;return Xn(this,void 0,void 0,(function*(){try{for(n=Gn(t);i=yield n.next(),!i.done;){const t=i.value;e.next(t);if(e.closed){return}}}catch(t){s={error:t}}finally{try{if(i&&!i.done&&(r=n.return))yield r.call(n)}finally{if(s)throw s.error}}e.complete()}))}function mi(t,e=Fn){return Rn(((n,i)=>{let s=null;let r=null;let o=null;const a=()=>{if(s){s.unsubscribe();s=null;const t=r;r=null;i.next(t)}};function c(){const n=o+t;const r=e.now();if(r<n){s=this.schedule(undefined,n-r);i.add(s);return}a()}n.subscribe(On(i,(n=>{r=n;o=e.now();if(!s){s=e.schedule(c,t);i.add(s)}}),(()=>{a();i.complete()}),undefined,(()=>{r=s=null})))}))}function gi(t){return Rn(((e,n)=>{ci(t).subscribe(On(n,(()=>n.complete()),ln));!n.closed&&e.subscribe(n)}))}var wi=crypto;const vi=t=>t instanceof CryptoKey;const yi=async(t,e)=>{const n=`SHA-${t.slice(-3)}`;return new Uint8Array(await wi.subtle.digest(n,e))};var ki=yi;const xi=new TextEncoder;const Si=new TextDecoder;function _i(...t){const e=t.reduce(((t,{length:e})=>t+e),0);const n=new Uint8Array(e);let i=0;for(const e of t){n.set(e,i);i+=e.length}return n}const Ei=t=>{let e=t;if(typeof e==="string"){e=xi.encode(e)}const n=32768;const i=[];for(let t=0;t<e.length;t+=n){i.push(String.fromCharCode.apply(null,e.subarray(t,t+n)))}return btoa(i.join(""))};const Ai=t=>Ei(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_");const Ci=t=>{const e=atob(t);const n=new Uint8Array(e.length);for(let t=0;t<e.length;t++){n[t]=e.charCodeAt(t)}return n};const zi=t=>{let e=t;if(e instanceof Uint8Array){e=Si.decode(e)}e=e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return Ci(e)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}};class Ti extends Error{constructor(t,e){super(t,e);this.code="ERR_JOSE_GENERIC";this.name=this.constructor.name;Error.captureStackTrace?.(this,this.constructor)}}Ti.code="ERR_JOSE_GENERIC";class $i extends Ti{constructor(t,e,n="unspecified",i="unspecified"){super(t,{cause:{claim:n,reason:i,payload:e}});this.code="ERR_JWT_CLAIM_VALIDATION_FAILED";this.claim=n;this.reason=i;this.payload=e}}$i.code="ERR_JWT_CLAIM_VALIDATION_FAILED";class Pi extends Ti{constructor(t,e,n="unspecified",i="unspecified"){super(t,{cause:{claim:n,reason:i,payload:e}});this.code="ERR_JWT_EXPIRED";this.claim=n;this.reason=i;this.payload=e}}Pi.code="ERR_JWT_EXPIRED";class Ii extends Ti{constructor(){super(...arguments);this.code="ERR_JOSE_ALG_NOT_ALLOWED"}}Ii.code="ERR_JOSE_ALG_NOT_ALLOWED";class Ri extends Ti{constructor(){super(...arguments);this.code="ERR_JOSE_NOT_SUPPORTED"}}Ri.code="ERR_JOSE_NOT_SUPPORTED";class Oi extends Ti{constructor(t="decryption operation failed",e){super(t,e);this.code="ERR_JWE_DECRYPTION_FAILED"}}Oi.code="ERR_JWE_DECRYPTION_FAILED";class Di extends Ti{constructor(){super(...arguments);this.code="ERR_JWE_INVALID"}}Di.code="ERR_JWE_INVALID";class ji extends Ti{constructor(){super(...arguments);this.code="ERR_JWS_INVALID"}}ji.code="ERR_JWS_INVALID";class Li extends Ti{constructor(){super(...arguments);this.code="ERR_JWT_INVALID"}}Li.code="ERR_JWT_INVALID";class Mi extends Ti{constructor(){super(...arguments);this.code="ERR_JWK_INVALID"}}Mi.code="ERR_JWK_INVALID";class Wi extends Ti{constructor(){super(...arguments);this.code="ERR_JWKS_INVALID"}}Wi.code="ERR_JWKS_INVALID";class Ui extends Ti{constructor(t="no applicable key found in the JSON Web Key Set",e){super(t,e);this.code="ERR_JWKS_NO_MATCHING_KEY"}}Ui.code="ERR_JWKS_NO_MATCHING_KEY";class Hi extends Ti{constructor(t="multiple matching keys found in the JSON Web Key Set",e){super(t,e);this.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS"}}Hi.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";class Ni extends Ti{constructor(t="request timed out",e){super(t,e);this.code="ERR_JWKS_TIMEOUT"}}Ni.code="ERR_JWKS_TIMEOUT";class Ji extends Ti{constructor(t="signature verification failed",e){super(t,e);this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}}Ji.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";function Bi(t,e="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${e} must be ${t}`)}function Ki(t,e){return t.name===e}function Fi(t){return parseInt(t.name.slice(4),10)}function Xi(t){switch(t){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}function Vi(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 n=e.pop();t+=`one of ${e.join(", ")}, or ${n}.`}else if(e.length===2){t+=`one of ${e[0]} or ${e[1]}.`}else{t+=`${e[0]}.`}throw new TypeError(t)}}function Yi(t,e,...n){switch(e){case"HS256":case"HS384":case"HS512":{if(!Ki(t.algorithm,"HMAC"))throw Bi("HMAC");const n=parseInt(e.slice(2),10);const i=Fi(t.algorithm.hash);if(i!==n)throw Bi(`SHA-${n}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!Ki(t.algorithm,"RSASSA-PKCS1-v1_5"))throw Bi("RSASSA-PKCS1-v1_5");const n=parseInt(e.slice(2),10);const i=Fi(t.algorithm.hash);if(i!==n)throw Bi(`SHA-${n}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!Ki(t.algorithm,"RSA-PSS"))throw Bi("RSA-PSS");const n=parseInt(e.slice(2),10);const i=Fi(t.algorithm.hash);if(i!==n)throw Bi(`SHA-${n}`,"algorithm.hash");break}case"EdDSA":{if(t.algorithm.name!=="Ed25519"&&t.algorithm.name!=="Ed448"){throw Bi("Ed25519 or Ed448")}break}case"Ed25519":{if(!Ki(t.algorithm,"Ed25519"))throw Bi("Ed25519");break}case"ES256":case"ES384":case"ES512":{if(!Ki(t.algorithm,"ECDSA"))throw Bi("ECDSA");const n=Xi(e);const i=t.algorithm.namedCurve;if(i!==n)throw Bi(n,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}Vi(t,n)}function qi(t,e,...n){n=n.filter(Boolean);if(n.length>2){const e=n.pop();t+=`one of type ${n.join(", ")}, or ${e}.`}else if(n.length===2){t+=`one of type ${n[0]} or ${n[1]}.`}else{t+=`of type ${n[0]}.`}if(e==null){t+=` Received ${e}`}else if(typeof e==="function"&&e.name){t+=` Received function ${e.name}`}else if(typeof e==="object"&&e!=null){if(e.constructor?.name){t+=` Received an instance of ${e.constructor.name}`}}return t}var Gi=(t,...e)=>qi("Key must be ",t,...e);function Zi(t,e,...n){return qi(`Key for the ${t} algorithm must be `,e,...n)}var Qi=t=>{if(vi(t)){return true}return t?.[Symbol.toStringTag]==="KeyObject"};const ts=["CryptoKey"];const es=(...t)=>{const e=t.filter(Boolean);if(e.length===0||e.length===1){return true}let n;for(const t of e){const e=Object.keys(t);if(!n||n.size===0){n=new Set(e);continue}for(const t of e){if(n.has(t)){return false}n.add(t)}}return true};var ns=es;function is(t){return typeof t==="object"&&t!==null}function ss(t){if(!is(t)||Object.prototype.toString.call(t)!=="[object Object]"){return false}if(Object.getPrototypeOf(t)===null){return true}let e=t;while(Object.getPrototypeOf(e)!==null){e=Object.getPrototypeOf(e)}return Object.getPrototypeOf(t)===e}var rs=(t,e)=>{if(t.startsWith("RS")||t.startsWith("PS")){const{modulusLength:n}=e.algorithm;if(typeof n!=="number"||n<2048){throw new TypeError(`${t} requires key modulusLength to be 2048 bits or larger`)}}};function os(t){return ss(t)&&typeof t.kty==="string"}function as(t){return t.kty!=="oct"&&typeof t.d==="string"}function cs(t){return t.kty!=="oct"&&typeof t.d==="undefined"}function ls(t){return os(t)&&t.kty==="oct"&&typeof t.k==="string"}function hs(t){let e;let n;switch(t.kty){case"RSA":{switch(t.alg){case"PS256":case"PS384":case"PS512":e={name:"RSA-PSS",hash:`SHA-${t.alg.slice(-3)}`};n=t.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":e={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${t.alg.slice(-3)}`};n=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}`};n=t.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new Ri('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"EC":{switch(t.alg){case"ES256":e={name:"ECDSA",namedCurve:"P-256"};n=t.d?["sign"]:["verify"];break;case"ES384":e={name:"ECDSA",namedCurve:"P-384"};n=t.d?["sign"]:["verify"];break;case"ES512":e={name:"ECDSA",namedCurve:"P-521"};n=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};n=t.d?["deriveBits"]:[];break;default:throw new Ri('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"OKP":{switch(t.alg){case"Ed25519":e={name:"Ed25519"};n=t.d?["sign"]:["verify"];break;case"EdDSA":e={name:t.crv};n=t.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":e={name:t.crv};n=t.d?["deriveBits"]:[];break;default:throw new Ri('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}default:throw new Ri('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:e,keyUsages:n}}const ds=async t=>{if(!t.alg){throw new TypeError('"alg" argument is required when "jwk.alg" is not present')}const{algorithm:e,keyUsages:n}=hs(t);const i=[e,t.ext??false,t.key_ops??n];const s={...t};delete s.alg;delete s.use;return wi.subtle.importKey("jwk",s,...i)};var us=ds;const fs=t=>zi(t);let ps;let bs;const ms=t=>t?.[Symbol.toStringTag]==="KeyObject";const gs=async(t,e,n,i,s=false)=>{let r=t.get(e);if(r?.[i]){return r[i]}const o=await us({...n,alg:i});if(s)Object.freeze(e);if(!r){t.set(e,{[i]:o})}else{r[i]=o}return o};const ws=(t,e)=>{if(ms(t)){let n=t.export({format:"jwk"});delete n.d;delete n.dp;delete n.dq;delete n.p;delete n.q;delete n.qi;if(n.k){return fs(n.k)}bs||(bs=new WeakMap);return gs(bs,t,n,e)}if(os(t)){if(t.k)return zi(t.k);bs||(bs=new WeakMap);const n=gs(bs,t,t,e,true);return n}return t};const vs=(t,e)=>{if(ms(t)){let n=t.export({format:"jwk"});if(n.k){return fs(n.k)}ps||(ps=new WeakMap);return gs(ps,t,n,e)}if(os(t)){if(t.k)return zi(t.k);ps||(ps=new WeakMap);const n=gs(ps,t,t,e,true);return n}return t};var ys={normalizePublicKey:ws,normalizePrivateKey:vs};async function ks(t,e){if(!ss(t)){throw new TypeError("JWK must be an object")}e||(e=t.alg);switch(t.kty){case"oct":if(typeof t.k!=="string"||!t.k){throw new TypeError('missing "k" (Key Value) Parameter value')}return zi(t.k);case"RSA":if("oth"in t&&t.oth!==undefined){throw new Ri('RSA JWK "oth" (Other Primes Info) Parameter value is not supported')}case"EC":case"OKP":return us({...t,alg:e});default:throw new Ri('Unsupported "kty" (Key Type) Parameter value')}}const xs=t=>t?.[Symbol.toStringTag];const Ss=(t,e,n)=>{if(e.use!==undefined&&e.use!=="sig"){throw new TypeError("Invalid key for this operation, when present its use must be sig")}if(e.key_ops!==undefined&&e.key_ops.includes?.(n)!==true){throw new TypeError(`Invalid key for this operation, when present its key_ops must include ${n}`)}if(e.alg!==undefined&&e.alg!==t){throw new TypeError(`Invalid key for this operation, when present its alg must be ${t}`)}return true};const _s=(t,e,n,i)=>{if(e instanceof Uint8Array)return;if(i&&os(e)){if(ls(e)&&Ss(t,e,n))return;throw new TypeError(`JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present`)}if(!Qi(e)){throw new TypeError(Zi(t,e,...ts,"Uint8Array",i?"JSON Web Key":null))}if(e.type!=="secret"){throw new TypeError(`${xs(e)} instances for symmetric algorithms must be of type "secret"`)}};const Es=(t,e,n,i)=>{if(i&&os(e)){switch(n){case"sign":if(as(e)&&Ss(t,e,n))return;throw new TypeError(`JSON Web Key for this operation be a private JWK`);case"verify":if(cs(e)&&Ss(t,e,n))return;throw new TypeError(`JSON Web Key for this operation be a public JWK`)}}if(!Qi(e)){throw new TypeError(Zi(t,e,...ts,i?"JSON Web Key":null))}if(e.type==="secret"){throw new TypeError(`${xs(e)} instances for asymmetric algorithms must not be of type "secret"`)}if(n==="sign"&&e.type==="public"){throw new TypeError(`${xs(e)} instances for asymmetric algorithm signing must be of type "private"`)}if(n==="decrypt"&&e.type==="public"){throw new TypeError(`${xs(e)} instances for asymmetric algorithm decryption must be of type "private"`)}if(e.algorithm&&n==="verify"&&e.type==="private"){throw new TypeError(`${xs(e)} instances for asymmetric algorithm verifying must be of type "public"`)}if(e.algorithm&&n==="encrypt"&&e.type==="private"){throw new TypeError(`${xs(e)} instances for asymmetric algorithm encryption must be of type "public"`)}};function As(t,e,n,i){const s=e.startsWith("HS")||e==="dir"||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e);if(s){_s(e,n,i,t)}else{Es(e,n,i,t)}}As.bind(undefined,false);const Cs=As.bind(undefined,true);function zs(t,e,n,i,s){if(s.crit!==undefined&&i?.crit===undefined){throw new t('"crit" (Critical) Header Parameter MUST be integrity protected')}if(!i||i.crit===undefined){return new Set}if(!Array.isArray(i.crit)||i.crit.length===0||i.crit.some((t=>typeof t!=="string"||t.length===0))){throw new t('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present')}let r;if(n!==undefined){r=new Map([...Object.entries(n),...e.entries()])}else{r=e}for(const e of i.crit){if(!r.has(e)){throw new Ri(`Extension Header Parameter "${e}" is not recognized`)}if(s[e]===undefined){throw new t(`Extension Header Parameter "${e}" is missing`)}if(r.get(e)&&i[e]===undefined){throw new t(`Extension Header Parameter "${e}" MUST be integrity protected`)}}return new Set(i.crit)}const Ts=(t,e)=>{if(e!==undefined&&(!Array.isArray(e)||e.some((t=>typeof t!=="string")))){throw new TypeError(`"${t}" option must be an array of strings`)}if(!e){return undefined}return new Set(e)};var $s=Ts;const Ps=async t=>{if(t instanceof Uint8Array){return{kty:"oct",k:Ai(t)}}if(!vi(t)){throw new TypeError(Gi(t,...ts,"Uint8Array"))}if(!t.extractable){throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK")}const{ext:e,key_ops:n,alg:i,use:s,...r}=await wi.subtle.exportKey("jwk",t);return r};var Is=Ps;async function Rs(t){return Is(t)}function Os(t,e){const n=`SHA-${t.slice(-3)}`;switch(t){case"HS256":case"HS384":case"HS512":return{hash:n,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:n,name:"RSA-PSS",saltLength:t.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:n,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:n,name:"ECDSA",namedCurve:e.namedCurve};case"Ed25519":return{name:"Ed25519"};case"EdDSA":return{name:e.name};default:throw new Ri(`alg ${t} is not supported either by JOSE or your javascript runtime`)}}async function Ds(t,e,n){if(n==="sign"){e=await ys.normalizePrivateKey(e,t)}if(n==="verify"){e=await ys.normalizePublicKey(e,t)}if(vi(e)){Yi(e,t,n);return e}if(e instanceof Uint8Array){if(!t.startsWith("HS")){throw new TypeError(Gi(e,...ts))}return wi.subtle.importKey("raw",e,{hash:`SHA-${t.slice(-3)}`,name:"HMAC"},false,[n])}throw new TypeError(Gi(e,...ts,"Uint8Array","JSON Web Key"))}const js=async(t,e,n,i)=>{const s=await Ds(t,e,"verify");rs(t,s);const r=Os(t,s.algorithm);try{return await wi.subtle.verify(r,s,n,i)}catch{return false}};var Ls=js;async function Ms(t,e,n){if(!ss(t)){throw new ji("Flattened JWS must be an object")}if(t.protected===undefined&&t.header===undefined){throw new ji('Flattened JWS must have either of the "protected" or "header" members')}if(t.protected!==undefined&&typeof t.protected!=="string"){throw new ji("JWS Protected Header incorrect type")}if(t.payload===undefined){throw new ji("JWS Payload missing")}if(typeof t.signature!=="string"){throw new ji("JWS Signature missing or incorrect type")}if(t.header!==undefined&&!ss(t.header)){throw new ji("JWS Unprotected Header incorrect type")}let i={};if(t.protected){try{const e=zi(t.protected);i=JSON.parse(Si.decode(e))}catch{throw new ji("JWS Protected Header is invalid")}}if(!ns(i,t.header)){throw new ji("JWS Protected and JWS Unprotected Header Parameter names must be disjoint")}const s={...i,...t.header};const r=zs(ji,new Map([["b64",true]]),n?.crit,i,s);let o=true;if(r.has("b64")){o=i.b64;if(typeof o!=="boolean"){throw new ji('The "b64" (base64url-encode payload) Header Parameter must be a boolean')}}const{alg:a}=s;if(typeof a!=="string"||!a){throw new ji('JWS "alg" (Algorithm) Header Parameter missing or invalid')}const c=n&&$s("algorithms",n.algorithms);if(c&&!c.has(a)){throw new Ii('"alg" (Algorithm) Header Parameter value not allowed')}if(o){if(typeof t.payload!=="string"){throw new ji("JWS Payload must be a string")}}else if(typeof t.payload!=="string"&&!(t.payload instanceof Uint8Array)){throw new ji("JWS Payload must be a string or an Uint8Array instance")}let l=false;if(typeof e==="function"){e=await e(i,t);l=true;Cs(a,e,"verify");if(os(e)){e=await ks(e,a)}}else{Cs(a,e,"verify")}const h=_i(xi.encode(t.protected??""),xi.encode("."),typeof t.payload==="string"?xi.encode(t.payload):t.payload);let d;try{d=zi(t.signature)}catch{throw new ji("Failed to base64url decode the signature")}const u=await Ls(a,e,d,h);if(!u){throw new Ji}let f;if(o){try{f=zi(t.payload)}catch{throw new ji("Failed to base64url decode the payload")}}else if(typeof t.payload==="string"){f=xi.encode(t.payload)}else{f=t.payload}const p={payload:f};if(t.protected!==undefined){p.protectedHeader=i}if(t.header!==undefined){p.unprotectedHeader=t.header}if(l){return{...p,key:e}}return p}async function Ws(t,e,n){if(t instanceof Uint8Array){t=Si.decode(t)}if(typeof t!=="string"){throw new ji("Compact JWS must be a string or Uint8Array")}const{0:i,1:s,2:r,length:o}=t.split(".");if(o!==3){throw new ji("Invalid Compact JWS")}const a=await Ms({payload:s,protected:i,signature:r},e,n);const c={payload:a.payload,protectedHeader:a.protectedHeader};if(typeof e==="function"){return{...c,key:a.key}}return c}var Us=t=>Math.floor(t.getTime()/1e3);const Hs=60;const Ns=Hs*60;const Js=Ns*24;const Bs=Js*7;const Ks=Js*365.25;const Fs=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;var Xs=t=>{const e=Fs.exec(t);if(!e||e[4]&&e[1]){throw new TypeError("Invalid time period format")}const n=parseFloat(e[2]);const i=e[3].toLowerCase();let s;switch(i){case"sec":case"secs":case"second":case"seconds":case"s":s=Math.round(n);break;case"minute":case"minutes":case"min":case"mins":case"m":s=Math.round(n*Hs);break;case"hour":case"hours":case"hr":case"hrs":case"h":s=Math.round(n*Ns);break;case"day":case"days":case"d":s=Math.round(n*Js);break;case"week":case"weeks":case"w":s=Math.round(n*Bs);break;default:s=Math.round(n*Ks);break}if(e[1]==="-"||e[4]==="ago"){return-s}return s};const Vs=t=>t.toLowerCase().replace(/^application\//,"");const Ys=(t,e)=>{if(typeof t==="string"){return e.includes(t)}if(Array.isArray(t)){return e.some(Set.prototype.has.bind(new Set(t)))}return false};var qs=(t,e,n={})=>{let i;try{i=JSON.parse(Si.decode(e))}catch{}if(!ss(i)){throw new Li("JWT Claims Set must be a top-level JSON object")}const{typ:s}=n;if(s&&(typeof t.typ!=="string"||Vs(t.typ)!==Vs(s))){throw new $i('unexpected "typ" JWT header value',i,"typ","check_failed")}const{requiredClaims:r=[],issuer:o,subject:a,audience:c,maxTokenAge:l}=n;const h=[...r];if(l!==undefined)h.push("iat");if(c!==undefined)h.push("aud");if(a!==undefined)h.push("sub");if(o!==undefined)h.push("iss");for(const t of new Set(h.reverse())){if(!(t in i)){throw new $i(`missing required "${t}" claim`,i,t,"missing")}}if(o&&!(Array.isArray(o)?o:[o]).includes(i.iss)){throw new $i('unexpected "iss" claim value',i,"iss","check_failed")}if(a&&i.sub!==a){throw new $i('unexpected "sub" claim value',i,"sub","check_failed")}if(c&&!Ys(i.aud,typeof c==="string"?[c]:c)){throw new $i('unexpected "aud" claim value',i,"aud","check_failed")}let d;switch(typeof n.clockTolerance){case"string":d=Xs(n.clockTolerance);break;case"number":d=n.clockTolerance;break;case"undefined":d=0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:u}=n;const f=Us(u||new Date);if((i.iat!==undefined||l)&&typeof i.iat!=="number"){throw new $i('"iat" claim must be a number',i,"iat","invalid")}if(i.nbf!==undefined){if(typeof i.nbf!=="number"){throw new $i('"nbf" claim must be a number',i,"nbf","invalid")}if(i.nbf>f+d){throw new $i('"nbf" claim timestamp check failed',i,"nbf","check_failed")}}if(i.exp!==undefined){if(typeof i.exp!=="number"){throw new $i('"exp" claim must be a number',i,"exp","invalid")}if(i.exp<=f-d){throw new Pi('"exp" claim timestamp check failed',i,"exp","check_failed")}}if(l){const t=f-i.iat;const e=typeof l==="number"?l:Xs(l);if(t-d>e){throw new Pi('"iat" claim timestamp check failed (too far in the past)',i,"iat","check_failed")}if(t<0-d){throw new $i('"iat" claim timestamp check failed (it should be in the past)',i,"iat","check_failed")}}return i};async function Gs(t,e,n){const i=await Ws(t,e,n);if(i.protectedHeader.crit?.includes("b64")&&i.protectedHeader.b64===false){throw new Li("JWTs MUST NOT use unencoded payload")}const s=qs(i.protectedHeader,i.payload,n);const r={payload:s,protectedHeader:i.protectedHeader};if(typeof e==="function"){return{...r,key:i.key}}return r}const Zs=async(t,e,n)=>{const i=await Ds(t,e,"sign");rs(t,i);const s=await wi.subtle.sign(Os(t,i.algorithm),i,n);return new Uint8Array(s)};var Qs=Zs;class tr{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")}this._protectedHeader=t;return this}setUnprotectedHeader(t){if(this._unprotectedHeader){throw new TypeError("setUnprotectedHeader can only be called once")}this._unprotectedHeader=t;return this}async sign(t,e){if(!this._protectedHeader&&!this._unprotectedHeader){throw new ji("either setProtectedHeader or setUnprotectedHeader must be called before #sign()")}if(!ns(this._protectedHeader,this._unprotectedHeader)){throw new ji("JWS Protected and JWS Unprotected Header Parameter names must be disjoint")}const n={...this._protectedHeader,...this._unprotectedHeader};const i=zs(ji,new Map([["b64",true]]),e?.crit,this._protectedHeader,n);let s=true;if(i.has("b64")){s=this._protectedHeader.b64;if(typeof s!=="boolean"){throw new ji('The "b64" (base64url-encode payload) Header Parameter must be a boolean')}}const{alg:r}=n;if(typeof r!=="string"||!r){throw new ji('JWS "alg" (Algorithm) Header Parameter missing or invalid')}Cs(r,t,"sign");let o=this._payload;if(s){o=xi.encode(Ai(o))}let a;if(this._protectedHeader){a=xi.encode(Ai(JSON.stringify(this._protectedHeader)))}else{a=xi.encode("")}const c=_i(a,xi.encode("."),o);const l=await Qs(r,t,c);const h={signature:Ai(l),payload:""};if(s){h.payload=Si.decode(o)}if(this._unprotectedHeader){h.header=this._unprotectedHeader}if(this._protectedHeader){h.protected=Si.decode(a)}return h}}class er{constructor(t){this._flattened=new tr(t)}setProtectedHeader(t){this._flattened.setProtectedHeader(t);return this}async sign(t,e){const n=await this._flattened.sign(t,e);if(n.payload===undefined){throw new TypeError("use the flattened module for creating JWS with b64: false")}return`${n.protected}.${n.payload}.${n.signature}`}}function nr(t,e){if(!Number.isFinite(e)){throw new TypeError(`Invalid ${t} input`)}return e}class ir{constructor(t={}){if(!ss(t)){throw new TypeError("JWT Claims Set MUST be an object")}this._payload=t}setIssuer(t){this._payload={...this._payload,iss:t};return this}setSubject(t){this._payload={...this._payload,sub:t};return this}setAudience(t){this._payload={...this._payload,aud:t};return this}setJti(t){this._payload={...this._payload,jti:t};return this}setNotBefore(t){if(typeof t==="number"){this._payload={...this._payload,nbf:nr("setNotBefore",t)}}else if(t instanceof Date){this._payload={...this._payload,nbf:nr("setNotBefore",Us(t))}}else{this._payload={...this._payload,nbf:Us(new Date)+Xs(t)}}return this}setExpirationTime(t){if(typeof t==="number"){this._payload={...this._payload,exp:nr("setExpirationTime",t)}}else if(t instanceof Date){this._payload={...this._payload,exp:nr("setExpirationTime",Us(t))}}else{this._payload={...this._payload,exp:Us(new Date)+Xs(t)}}return this}setIssuedAt(t){if(typeof t==="undefined"){this._payload={...this._payload,iat:Us(new Date)}}else if(t instanceof Date){this._payload={...this._payload,iat:nr("setIssuedAt",Us(t))}}else if(typeof t==="string"){this._payload={...this._payload,iat:nr("setIssuedAt",Us(new Date)+Xs(t))}}else{this._payload={...this._payload,iat:nr("setIssuedAt",t)}}return this}}class sr extends ir{setProtectedHeader(t){this._protectedHeader=t;return this}async sign(t,e){const n=new er(xi.encode(JSON.stringify(this._payload)));n.setProtectedHeader(this._protectedHeader);if(Array.isArray(this._protectedHeader?.crit)&&this._protectedHeader.crit.includes("b64")&&this._protectedHeader.b64===false){throw new Li("JWTs MUST NOT use unencoded payload")}return n.sign(t,e)}}const rr=(t,e)=>{if(typeof t!=="string"||!t){throw new Mi(`${e} missing or invalid`)}};async function or(t,e){if(!ss(t)){throw new TypeError("JWK must be an object")}e??(e="sha256");if(e!=="sha256"&&e!=="sha384"&&e!=="sha512"){throw new TypeError('digestAlgorithm must one of "sha256", "sha384", or "sha512"')}let n;switch(t.kty){case"EC":rr(t.crv,'"crv" (Curve) Parameter');rr(t.x,'"x" (X Coordinate) Parameter');rr(t.y,'"y" (Y Coordinate) Parameter');n={crv:t.crv,kty:t.kty,x:t.x,y:t.y};break;case"OKP":rr(t.crv,'"crv" (Subtype of Key Pair) Parameter');rr(t.x,'"x" (Public Key) Parameter');n={crv:t.crv,kty:t.kty,x:t.x};break;case"RSA":rr(t.e,'"e" (Exponent) Parameter');rr(t.n,'"n" (Modulus) Parameter');n={e:t.e,kty:t.kty,n:t.n};break;case"oct":rr(t.k,'"k" (Key Value) Parameter');n={k:t.k,kty:t.kty};break;default:throw new Ri('"kty" (Key Type) Parameter missing or unsupported')}const i=xi.encode(JSON.stringify(n));return Ai(await ki(e,i))}function ar(t){switch(typeof t==="string"&&t.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";default:throw new Ri('Unsupported "alg" value for a JSON Web Key Set')}}function cr(t){return t&&typeof t==="object"&&Array.isArray(t.keys)&&t.keys.every(lr)}function lr(t){return ss(t)}function hr(t){if(typeof structuredClone==="function"){return structuredClone(t)}return JSON.parse(JSON.stringify(t))}class dr{constructor(t){this._cached=new WeakMap;if(!cr(t)){throw new Wi("JSON Web Key Set malformed")}this._jwks=hr(t)}async getKey(t,e){const{alg:n,kid:i}={...t,...e?.header};const s=ar(n);const r=this._jwks.keys.filter((t=>{let e=s===t.kty;if(e&&typeof i==="string"){e=i===t.kid}if(e&&typeof t.alg==="string"){e=n===t.alg}if(e&&typeof t.use==="string"){e=t.use==="sig"}if(e&&Array.isArray(t.key_ops)){e=t.key_ops.includes("verify")}if(e){switch(n){case"ES256":e=t.crv==="P-256";break;case"ES256K":e=t.crv==="secp256k1";break;case"ES384":e=t.crv==="P-384";break;case"ES512":e=t.crv==="P-521";break;case"Ed25519":e=t.crv==="Ed25519";break;case"EdDSA":e=t.crv==="Ed25519"||t.crv==="Ed448";break}}return e}));const{0:o,length:a}=r;if(a===0){throw new Ui}if(a!==1){const t=new Hi;const{_cached:e}=this;t[Symbol.asyncIterator]=async function*(){for(const t of r){try{yield await ur(e,t,n)}catch{}}};throw t}return ur(this._cached,o,n)}}async function ur(t,e,n){const i=t.get(e)||t.set(e,{}).get(e);if(i[n]===undefined){const t=await ks({...e,ext:true},n);if(t instanceof Uint8Array||t.type!=="public"){throw new Wi("JSON Web Key Set members must be public keys")}i[n]=t}return i[n]}function fr(t){const e=new dr(t);const n=async(t,n)=>e.getKey(t,n);Object.defineProperties(n,{jwks:{value:()=>hr(e._jwks),enumerable:true,configurable:false,writable:false}});return n}const pr=async(t,e,n)=>{let i;let s;let r=false;if(typeof AbortController==="function"){i=new AbortController;s=setTimeout((()=>{r=true;i.abort()}),e)}const o=await fetch(t.href,{signal:i?i.signal:undefined,redirect:"manual",headers:n.headers}).catch((t=>{if(r)throw new Ni;throw t}));if(s!==undefined)clearTimeout(s);if(o.status!==200){throw new Ti("Expected 200 OK from the JSON Web Key Set HTTP response")}try{return await o.json()}catch{throw new Ti("Failed to parse the JSON Web Key Set HTTP response as JSON")}};var br=pr;function mr(){return typeof WebSocketPair!=="undefined"||typeof navigator!=="undefined"&&navigator.userAgent==="Cloudflare-Workers"||typeof EdgeRuntime!=="undefined"&&EdgeRuntime==="vercel"}let gr;if(typeof navigator==="undefined"||!navigator.userAgent?.startsWith?.("Mozilla/5.0 ")){const t="jose";const e="v5.10.0";gr=`${t}/${e}`}const wr=Symbol();function vr(t,e){if(typeof t!=="object"||t===null){return false}if(!("uat"in t)||typeof t.uat!=="number"||Date.now()-t.uat>=e){return false}if(!("jwks"in t)||!ss(t.jwks)||!Array.isArray(t.jwks.keys)||!Array.prototype.every.call(t.jwks.keys,ss)){return false}return true}class yr{constructor(t,e){if(!(t instanceof URL)){throw new TypeError("url must be an instance of URL")}this._url=new URL(t.href);this._options={agent:e?.agent,headers:e?.headers};this._timeoutDuration=typeof e?.timeoutDuration==="number"?e?.timeoutDuration:5e3;this._cooldownDuration=typeof e?.cooldownDuration==="number"?e?.cooldownDuration:3e4;this._cacheMaxAge=typeof e?.cacheMaxAge==="number"?e?.cacheMaxAge:6e5;if(e?.[wr]!==undefined){this._cache=e?.[wr];if(vr(e?.[wr],this._cacheMaxAge)){this._jwksTimestamp=this._cache.uat;this._local=fr(this._cache.jwks)}}}coolingDown(){return typeof this._jwksTimestamp==="number"?Date.now()<this._jwksTimestamp+this._cooldownDuration:false}fresh(){return typeof this._jwksTimestamp==="number"?Date.now()<this._jwksTimestamp+this._cacheMaxAge:false}async getKey(t,e){if(!this._local||!this.fresh()){await this.reload()}try{return await this._local(t,e)}catch(n){if(n instanceof Ui){if(this.coolingDown()===false){await this.reload();return this._local(t,e)}}throw n}}async reload(){if(this._pendingFetch&&mr()){this._pendingFetch=undefined}const t=new Headers(this._options.headers);if(gr&&!t.has("User-Agent")){t.set("User-Agent",gr);this._options.headers=Object.fromEntries(t.entries())}this._pendingFetch||(this._pendingFetch=br(this._url,this._timeoutDuration,this._options).then((t=>{this._local=fr(t);if(this._cache){this._cache.uat=Date.now();this._cache.jwks=t}this._jwksTimestamp=Date.now();this._pendingFetch=undefined})).catch((t=>{this._pendingFetch=undefined;throw t})));await this._pendingFetch}}function kr(t,e){const n=new yr(t,e);const i=async(t,e)=>n.getKey(t,e);Object.defineProperties(i,{coolingDown:{get:()=>n.coolingDown(),enumerable:true,configurable:false},fresh:{get:()=>n.fresh(),enumerable:true,configurable:false},reload:{value:()=>n.reload(),enumerable:true,configurable:false,writable:false},reloading:{get:()=>!!n._pendingFetch,enumerable:true,configurable:false},jwks:{value:()=>n._local?.jwks(),enumerable:true,configurable:false,writable:false}});return i}const xr=zi;function Sr(t){if(typeof t!=="string")throw new Li("JWTs must use Compact JWS serialization, JWT must be a string");const{1:e,length:n}=t.split(".");if(n===5)throw new Li("Only JWTs using Compact JWS serialization can be decoded");if(n!==3)throw new Li("Invalid JWT");if(!e)throw new Li("JWTs must contain a payload");let i;try{i=xr(e)}catch{throw new Li("Failed to base64url decode the payload")}let s;try{s=JSON.parse(Si.decode(i))}catch{throw new Li("Failed to parse the decoded payload as JSON")}if(!ss(s))throw new Li("Invalid JWT Claims Set");return s}function _r(t){const e=t?.modulusLength??2048;if(typeof e!=="number"||e<2048){throw new Ri("Invalid or unsupported modulusLength option provided, 2048 bits or larger keys must be used")}return e}async function Er(t,e){let n;let i;switch(t){case"PS256":case"PS384":case"PS512":n={name:"RSA-PSS",hash:`SHA-${t.slice(-3)}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:_r(e)};i=["sign","verify"];break;case"RS256":case"RS384":case"RS512":n={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${t.slice(-3)}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:_r(e)};i=["sign","verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":n={name:"RSA-OAEP",hash:`SHA-${parseInt(t.slice(-3),10)||1}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:_r(e)};i=["decrypt","unwrapKey","encrypt","wrapKey"];break;case"ES256":n={name:"ECDSA",namedCurve:"P-256"};i=["sign","verify"];break;case"ES384":n={name:"ECDSA",namedCurve:"P-384"};i=["sign","verify"];break;case"ES512":n={name:"ECDSA",namedCurve:"P-521"};i=["sign","verify"];break;case"Ed25519":n={name:"Ed25519"};i=["sign","verify"];break;case"EdDSA":{i=["sign","verify"];const t=e?.crv??"Ed25519";switch(t){case"Ed25519":case"Ed448":n={name:t};break;default:throw new Ri("Invalid or unsupported crv option provided")}break}case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{i=["deriveKey","deriveBits"];const t=e?.crv??"P-256";switch(t){case"P-256":case"P-384":case"P-521":{n={name:"ECDH",namedCurve:t};break}case"X25519":case"X448":n={name:t};break;default:throw new Ri("Invalid or unsupported crv option provided, supported values are P-256, P-384, P-521, X25519, and X448")}break}default:throw new Ri('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}return wi.subtle.generateKey(n,e?.extractable??false,i)}async function Ar(t,e){return Er(t,e)}const Cr=async(t,e)=>{const n={...e,grant_types:["authorization_code","refresh_token"],id_token_signed_response_alg:"ES256",token_endpoint_auth_method:"none",application_type:"web",subject_type:"public"};return fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})};class zr{dbName;storeName;dbVersion;db=null;constructor(t="soidc",e="session",n=1){this.dbName=t;this.storeName=e;this.dbVersion=n}async init(){return new Promise(((t,e)=>{const n=indexedDB.open(this.dbName,this.dbVersion);n.onerror=t=>{e(new Error(`Database error: ${t.target.error}`))};n.onsuccess=e=>{this.db=e.target.result;t(this)};n.onupgradeneeded=t=>{const e=t.target.result;if(!e.objectStoreNames.contains(this.storeName)){e.createObjectStore(this.storeName)}}}))}async setItem(t,e){if(!this.db){await this.init()}return new Promise(((n,i)=>{const s=this.db.transaction(this.storeName,"readwrite");s.oncomplete=()=>{n()};s.onerror=e=>{i(new Error(`Transaction error for setItem(${t},...): ${e.target.error}`))};s.onabort=e=>{i(new Error(`Transaction aborted for setItem(${t},...): ${e.target.error}`))};const r=s.objectStore(this.storeName);r.put(e,t)}))}async getItem(t){if(!this.db){await this.init()}return new Promise(((e,n)=>{const i=this.db.transaction(this.storeName,"readonly");i.onerror=e=>{n(new Error(`Transaction error for getItem(${t}): ${e.target.error}`))};i.onabort=e=>{n(new Error(`Transaction aborted for getItem(${t}): ${e.target.error}`))};const s=i.objectStore(this.storeName);const r=s.get(t);r.onsuccess=()=>{e(r.result||null)}}))}async deleteItem(t){if(!this.db){await this.init()}return new Promise(((e,n)=>{const i=this.db.transaction(this.storeName,"readwrite");i.oncomplete=()=>{e()};i.onerror=e=>{n(new Error(`Transaction error for deleteItem(${t}): ${e.target.error}`))};i.onabort=e=>{n(new Error(`Transaction aborted for deleteItem(${t}): ${e.target.error}`))};const s=i.objectStore(this.storeName);s.delete(t)}))}async clear(){if(!this.db){await this.init()}return new Promise(((t,e)=>{const n=this.db.transaction(this.storeName,"readwrite");n.oncomplete=()=>{t()};n.onerror=t=>{e(new Error(`Transaction error for clear(): ${t.target.error}`))};n.onabort=t=>{e(new Error(`Transaction aborted for clear(): ${t.target.error}`))};const i=n.objectStore(this.storeName);i.clear()}))}close(){if(this.db){this.db.close();this.db=null}}}const Tr=async(t,e,n)=>{const i=new URL(e);const s=i.origin+i.pathname+i.search;const r=new URL(t).origin;const o=await fetch(`${r}/.well-known/openid-configuration`).then((t=>{if(!t.ok){throw new Error(`HTTP error! Status: ${t.status}`)}return t.json()}));const a=o["issuer"];const c=t=>t.endsWith("/")?t.slice(0,-1):t;if(c(t)!==c(a)){throw new Error("RFC 9207 - iss != idp - "+a+" != "+t)}sessionStorage.setItem("idp",a);sessionStorage.setItem("token_endpoint",o["token_endpoint"]);sessionStorage.setItem("jwks_uri",o["jwks_uri"]);let l=n?.client_id;if(!l){const t=o["registration_endpoint"];const e=await Cr(t,n??{redirect_uris:[s]}).then((t=>{if(!t.ok){throw new Error(`HTTP error! Status: ${t.status}`)}return t.json()}));l=e["client_id"];sessionStorage.setItem("client_id",l)}const{pkce_code_verifier:h,pkce_code_challenge:d}=await $r();sessionStorage.setItem("pkce_code_verifier",h);const u=window.crypto.randomUUID();sessionStorage.setItem("csrf_token",u);const f=o["authorization_endpoint"]+`?response_type=code`+`&redirect_uri=${encodeURIComponent(s)}`+`&scope=openid offline_access webid`+`&client_id=${encodeURIComponent(l)}`+`&code_challenge_method=S256`+`&code_challenge=${d}`+`&state=${u}`+`&prompt=consent`;window.location.href=f};const $r=async()=>{const t=window.crypto.randomUUID()+"-"+window.crypto.randomUUID();const e=new Uint8Array(await window.crypto.subtle.digest("SHA-256",(new TextEncoder).encode(t)));const n=btoa(String.fromCharCode(...e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return{pkce_code_verifier:t,pkce_code_challenge:n}};const Pr=async t=>{const e=new URL(window.location.href);const n=e.searchParams.get("code");if(n===null){return{clientDetails:t}}const i=sessionStorage.getItem("idp");if(i===null||e.searchParams.get("iss")!=i){throw new Error("RFC 9207 - iss != idp - "+e.searchParams.get("iss")+" != "+i)}if(e.searchParams.get("state")!=sessionStorage.getItem("csrf_token")){throw new Error("RFC 6749 - state != csrf_token - "+e.searchParams.get("state")+" != "+sessionStorage.getItem("csrf_token"))}e.searchParams.delete("iss");e.searchParams.delete("state");e.searchParams.delete("code");window.history.pushState({},document.title,e.toString());const s=sessionStorage.getItem("pkce_code_verifier");if(s===null){throw new Error("Access Token Request preparation - Could not find in sessionStorage: pkce_code_verifier")}const r=t?.client_id||sessionStorage.getItem("client_id");if(!r){throw new Error("Access Token Request preparation - Could not find in sessionStorage: client_id (dynamic registration)")}const o=sessionStorage.getItem("token_endpoint");if(o===null){throw new Error("Access Token Request preparation - Could not find in sessionStorage: token_endpoint")}const a=await Ar("ES256");const c=await Ir(n,s,e.toString(),r,o,a).then((t=>{if(!t.ok){throw new Error(`HTTP error! Status: ${t.status}`)}return t.json()}));const l=c["access_token"];const h=sessionStorage.getItem("jwks_uri");if(h===null){throw new Error("Access Token validation preparation - Could not find in sessionStorage: jwks_uri")}const d=kr(new URL(h));const{payload:u}=await Gs(l,d,{issuer:i,audience:"solid"});const f=await or(await Rs(a.publicKey));if(u["cnf"]["jkt"]!=f){throw new Error("Access Token validation failed on `jkt`: jkt != DPoP thumbprint - "+u["cnf"]["jkt"]+" != "+f)}if(u["client_id"]!=r){throw new Error("Access Token validation failed on `client_id`: JWT payload != client_id - "+u["client_id"]+" != "+r)}const p={...c,dpop_key_pair:a};const b={idp:i,jwks_uri:h,token_endpoint:o};if(!t)t={redirect_uris:[window.location.href]};t.client_id=r;const m=await(new zr).init();await Promise.all([m.setItem("idp",i),m.setItem("jwks_uri",h),m.setItem("token_endpoint",o),m.setItem("client_id",r),m.setItem("dpop_keypair",a),m.setItem("refresh_token",c["refresh_token"])]);m.close();sessionStorage.removeItem("csrf_token");sessionStorage.removeItem("pkce_code_verifier");sessionStorage.removeItem("idp");sessionStorage.removeItem("jwks_uri");sessionStorage.removeItem("token_endpoint");sessionStorage.removeItem("client_id");return{clientDetails:t,idpDetails:b,tokenDetails:p}};const Ir=async(t,e,n,i,s,r)=>{const o=await Rs(r.publicKey);o.alg="ES256";const a=await new sr({htu:s,htm:"POST"}).setIssuedAt().setJti(window.crypto.randomUUID()).setProtectedHeader({alg:"ES256",typ:"dpop+jwt",jwk:o}).sign(r.privateKey);return fetch(s,{method:"POST",headers:{dpop:a,"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"authorization_code",code:t,code_verifier:e,redirect_uri:n,client_id:i})})};const Rr=async()=>{const t=await(new zr).init();const e=await t.getItem("client_id");const n=await t.getItem("token_endpoint");const i=await t.getItem("dpop_keypair");const s=await t.getItem("refresh_token");if(e===null||n===null||i===null||s===null){throw new Error("Could not refresh tokens: details missing from database.")}const r=await Or(s,e,n,i).then((t=>{if(!t.ok){throw new Error(`HTTP error! Status: ${t.status}`)}return t.json()}));const o=r["access_token"];const a=await t.getItem("idp");if(a===null){throw new Error("Access Token validation preparation - Could not find in sessionDatabase: idp")}const c=await t.getItem("jwks_uri");if(c===null){throw new Error("Access Token validation preparation - Could not find in sessionDatabase: jwks_uri")}const l=kr(new URL(c));const{payload:h}=await Gs(o,l,{issuer:a,audience:"solid"});const d=await or(await Rs(i.publicKey));if(h["cnf"]["jkt"]!=d){throw new Error("Access Token validation failed on `jkt`: jkt != DPoP thumbprint - "+h["cnf"]["jkt"]+" != "+d)}if(h["client_id"]!=e){throw new Error("Access Token validation failed on `client_id`: JWT payload != client_id - "+h["client_id"]+" != "+e)}await t.setItem("refresh_token",r["refresh_token"]);t.close();return{...r,dpop_key_pair:i}};const Or=async(t,e,n,i)=>{const s=await Rs(i.publicKey);s.alg="ES256";const r=await new sr({htu:n,htm:"POST"}).setIssuedAt().setJti(window.crypto.randomUUID()).setProtectedHeader({alg:"ES256",typ:"dpop+jwt",jwk:s}).sign(i.privateKey);return fetch(n,{method:"POST",headers:{dpop:r,"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:t,client_id:e})})};class Dr{sessionInformation;isActive_=false;webId_=undefined;currentAth_=undefined;tokenRefreshTimeout;sessionDeactivateTimeout;onSessionExpirationWarning;constructor(t,e){this.sessionInformation={clientDetails:t};this.onSessionExpirationWarning=e?.onSessionExpirationWarning}async login(t,e){await Tr(t,e,this.sessionInformation.clientDetails)}async logout(){if(this.sessionDeactivateTimeout)clearTimeout(this.sessionDeactivateTimeout);this.sessionDeactivateTimeout=undefined;if(this.tokenRefreshTimeout)clearTimeout(this.tokenRefreshTimeout);this.tokenRefreshTimeout=undefined;this.sessionInformation.idpDetails=undefined;this.sessionInformation.tokenDetails=undefined;this.isActive_=false;this.webId_=undefined;if(this.sessionInformation.clientDetails?.client_id)try{new URL(this.sessionInformation.clientDetails.client_id)}catch(t){this.sessionInformation.clientDetails.client_id=undefined}const t=await(new zr).init();await t.clear();t.close()}async handleRedirectFromLogin(){const t=await Pr(this.sessionInformation.clientDetails);if(!t.tokenDetails){return}this.sessionInformation=t;await this.setSessionDetails()}async restore(){await Rr().then((t=>{this.sessionInformation.tokenDetails=t;return this.setSessionDetails()})).catch((t=>{}))}async createSignedDPoPToken(t){if(!this.sessionInformation.tokenDetails||!this.currentAth_){throw new Error("Session not established.")}t.ath=this.currentAth_;const e=await Rs(this.sessionInformation.tokenDetails.dpop_key_pair.publicKey);return new sr(t).setIssuedAt().setJti(window.crypto.randomUUID()).setProtectedHeader({alg:"ES256",typ:"dpop+jwt",jwk:e}).sign(this.sessionInformation.tokenDetails.dpop_key_pair.privateKey)}async authFetch(t,e,n){let i;let s;let r;if(t instanceof Request){i=new URL(t.url);s=e?.method||t?.method||"GET";r=new Headers(t.headers)}else{e=e||{};i=new URL(t.toString());s=e.method||"GET";r=e.headers?new Headers(e.headers):new Headers}if(this.sessionInformation.tokenDetails){n=n??{htu:`${i.origin}${i.pathname}`,htm:s.toUpperCase()};const t=await this.createSignedDPoPToken(n);r.set("dpop",t);r.set("authorization",`DPoP ${this.sessionInformation.tokenDetails.access_token}`)}if(t instanceof Request){return fetch(new Request(t,{...e,headers:r}))}return fetch(i,{...e,headers:r})}get isActive(){return this.isActive_}get webId(){return this.webId_}async setSessionDetails(){if(!this.sessionInformation.tokenDetails?.access_token){this.logout()}this.currentAth_=await this.computeAth(this.sessionInformation.tokenDetails.access_token);this.webId_=Sr(this.sessionInformation.tokenDetails.access_token)["webid"];this.isActive_=this.webId!==undefined;this.setSessionDeactivateTimeout();this.setTokenRefreshTimeout()}setSessionDeactivateTimeout(){const t=5;const e=(this.sessionInformation.tokenDetails.expires_in-t)*1e3;if(this.sessionDeactivateTimeout)clearTimeout(this.sessionDeactivateTimeout);this.sessionDeactivateTimeout=setTimeout((()=>this.logout()),e)}setTokenRefreshTimeout(){const t=95;const e=(this.sessionInformation.tokenDetails.expires_in-t)*1e3;if(this.tokenRefreshTimeout)clearTimeout(this.tokenRefreshTimeout);this.tokenRefreshTimeout=setTimeout((async()=>{const t=await Rr().catch((t=>{if(this.onSessionExpirationWarning)this.onSessionExpirationWarning();return undefined}));if(!t){return}this.sessionInformation.tokenDetails=t;this.setSessionDeactivateTimeout();this.setTokenRefreshTimeout()}),e)}async computeAth(t){const e=new TextEncoder;const n=e.encode(t);const i=await crypto.subtle.digest("SHA-256",n);const s=Array.from(new Uint8Array(i));const r=btoa(String.fromCharCode(...s));const o=r.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return o}}class jr{get authenticatedFetch(){return this._authenticatedFetch}constructor(){this.onSessionRestoreCallback=()=>{};this.sessionInfo$=new Wn({isLoggedIn:false,webId:undefined});this.session=new Dr;this._authenticatedFetch=this.session.authFetch.bind(this.session)}async handleIncomingRedirect(t=false){await this.session.handleRedirectFromLogin();if(t){await this.session.restore();if(this.session.isActive){this.onSessionRestoreCallback(window.location.href)}}this.sessionInfo$.next({isLoggedIn:this.session.isActive,webId:this.session.webId})}async login(t){return this.session.login(t,window.location.href)}async logout(){await this.session.logout();this.sessionInfo$.next({isLoggedIn:false,webId:undefined})}observeSession(){return this.sessionInfo$}onSessionRestore(t){this.onSessionRestoreCallback=t}}const Lr=class{constructor(t){e(this,t);this.sessionRestoredEmitter=a(this,"pod-os:session-restored",7);this.podOsLoadedEmitter=a(this,"pod-os:loaded",7);this.restorePreviousSession=false;this.disconnected$=new Ln;this.loading=true}async componentWillLoad(){const t=new jr;this.unsubscribeSettings=ge.on("set",(()=>{this.os=qe(t,ge.state)}));this.os=qe(t,ge.state);t.onSessionRestore((t=>{this.sessionRestoredEmitter.emit({url:t})}));try{await t.handleIncomingRedirect(this.restorePreviousSession)}catch(t){console.error(t)}this.os.observeSession().pipe(gi(this.disconnected$)).subscribe((async t=>{M.state.webId=t.webId;if(t.isLoggedIn){const e=await this.os.fetchProfile(t.webId);M.state.profile=e}M.state.isLoggedIn=t.isLoggedIn;this.loading=false}));this.podOsLoadedEmitter.emit({os:this.os,authenticatedFetch:t.authenticatedFetch})}disconnectedCallback(){this.unsubscribeSettings();this.disconnected$.next();this.disconnected$.unsubscribe()}async initializeOs(t){t.stopPropagation();t.detail(this.os)}async loadModule(t){t.stopPropagation();if(t.detail.module==="contacts"){const e=await this.os.loadContactsModule();t.detail.receiver(e)}else{throw Error(`Unknown module "${t.detail.module}"`)}}render(){return this.loading?n("ion-progress-bar",{type:"indeterminate"}):n("slot",null)}};const Mr="pos-router {\n margin: 0;\n padding: 0;\n display: flex;\n flex-direction: column;\n height: 100%;\n}\n\npos-navigation {\n max-width: var(--width-lg);\n margin: 0;\n min-width: var(--size-32);\n flex-shrink: 1; /* Ensure navigation can shrink */\n}\n\npos-add-new-thing,\npos-login {\n flex: 0 1 auto;\n flex-shrink: 0; /* Ensure those items don't shrink */\n}\n\nheader,\nfooter {\n display: flex;\n gap: var(--size-1);\n height: auto;\n justify-content: center;\n align-items: center;\n padding: var(--size-1);\n}\n\nfooter svg {\n width: var(--size-5);\n height: var(--size-5);\n}\n\nfooter {\n font-size: var(--scale-fluid-000);\n\n .settings {\n padding: 0 var(--size-1);\n text-decoration: none;\n background-color: var(--pos-background-color);\n border: 1px solid var(--pos-secondary-border-color);\n color: var(--pos-secondary-border-color);\n border-radius: var(--radius-xs);\n\n &:hover {\n background-color: var(--pos-secondary-border-color);\n color: var(--pos-background-color);\n }\n }\n}\n\nheader {\n flex-wrap: nowrap;\n padding: var(--size-1) var(--size-8);\n}\n\nmain {\n flex: 1;\n max-height: 100vh;\n overflow: auto;\n}\n\n@media (max-width: 640px) {\n header {\n padding: var(--size-1);\n justify-content: space-between;\n }\n footer {\n display: none;\n }\n}\n";const Wr=Mr;const Ur=class{constructor(t){e(this,t);this.restorePreviousSession=false;this.mode="standalone";this.uri=""}render(){return n(i,{key:"08b186d2f354d6c07df02707eb4ada81aef7dec3"},n("pos-app",{key:"54c372343e916ab5d77584381b3965c925ae0cd0",restorePreviousSession:this.restorePreviousSession},n("pos-error-toast",{key:"ab63e18121ca16670f81da141219a782dde0694b"},n("pos-router",{key:"69b6f3bf8ce3720c6c39cdb4be69e640e27ccc5b",mode:this.mode,"onPod-os:route-changed":t=>this.uri=t.detail},n("header",{key:"5cd3412caf13b6d99da517ae7e6f5877234e65d7"},n("pos-add-new-thing",{key:"9b83b3cf03b7038303975386176df539b35ff547",referenceUri:this.uri}),n("pos-navigation",{key:"26bfed9b1c8dd1be018babc6ef40ae42808a5c42",uri:this.uri==="pod-os:dashboard"?"":this.uri}),n("pos-login",{key:"e29f18dcde866d8ac1e317fcd7b71ef584e69034"},n("pos-user-menu",{key:"be796f0914649eb4e8525a9d8acdfd535626303c",webId:M.state.webId,slot:"if-logged-in"}))),n("main",{key:"f99dfb2d43e949528bc767b94801c99bf04a7eea"},this.mainContent()),n("footer",{key:"64744d1246356fa00da9c6b561785e2b794a7907"},n(Hr,{key:"a648f7f88e12c79348bda33152f2759d2b93e738"}),n("span",{key:"f22e2f9904ba517fc2e579a05018704b5ade6302"},"PodOS Browser"))))))}mainContent(){if(this.uri===""){return null}if(this.uri.startsWith("pod-os:")){return n("pos-internal-router",{uri:this.uri})}return n("pos-resource",{key:this.uri,uri:this.uri},n("pos-type-router",null))}};const Hr=()=>n("svg",{viewBox:"0 0 400 400",xmlns:"http://www.w3.org/2000/svg"},n("path",{d:"M50 350 L50 100 L200 50 L350 100 L350 350 Z",style:{fill:"#008BF8",stroke:"#008BF8","stroke-width":"70"},"stroke-linejoin":"round"}),n("path",{d:"M100 300 L100 150 L200 120 L300 150 L300 300 L130 300 L130 370 L100 370Z",style:{fill:"white",stroke:"white","stroke-width":"45"},"stroke-linejoin":"round"}),n("path",{d:"M150 250 L150 200 L200 180 L250 200 L250 250 Z",style:{fill:"#DC0073",stroke:"#DC0073","stroke-width":"20"},"stroke-linejoin":"round"}));Ur.style=Wr;const Nr=":host{display:grid;grid-template-columns:repeat(auto-fit, minmax(var(--size-12), var(--size-96)));gap:var(--size-4);padding:var(--size-2);justify-content:center;align-items:start;justify-items:stretch}";const Jr=Nr;const Br=class{constructor(t){e(this,t)}render(){return n(i,{key:"18dc165b7be1c796136804a2ba7643b2a6fffc73"},n("pos-getting-started",{key:"e3f7a22641e4c24168a36f96463515cd1a89ca5e"}),n("pos-example-resources",{key:"1044dd873049118e165ff6d38449c85695f63a50"}))}};Br.style=Jr;const Kr=":host{display:grid;grid-template-columns:repeat(auto-fit, minmax(var(--size-12), var(--size-96)));gap:var(--size-4);padding:var(--size-2);justify-content:center;align-items:start;justify-items:stretch}";const Fr=Kr;const Xr=class{constructor(t){e(this,t)}render(){return n("pos-setting-offline-cache",{key:"f065206f6291089773a19045243f04b6ce35eeb9"})}};Xr.style=Fr;const Vr=class{constructor(t){e(this,t);this.subscribeResource=a(this,"pod-os:resource",7);this.receiveResource=t=>{this.resource=t}}componentWillLoad(){J(this)}render(){return this.resource?this.resource.description():null}};const Yr="dialog{background-color:var(--pos-background-color);color:var(--pos-normal-text-color);border:none;border-radius:var(--radius-md);box-shadow:var(--shadow-md);max-width:var(--width-xs);animation:slideIn 0.2s ease-out}dialog::backdrop{background:rgba(0, 0, 0, 0.5);backdrop-filter:var(--blur-sm);animation:fadeIn 0.2s ease-out}@media (prefers-color-scheme: dark){dialog::backdrop{background:rgb(100, 100, 100, 0.5)}}dialog header>:first-child{flex-grow:1;font-weight:var(--weight-light);font-size:var(--scale-2);font-family:var(--font-sans);margin:0}dialog header{display:flex;flex-direction:row;justify-content:space-between;align-items:center;gap:var(--scale-0);border-bottom-style:inset;padding:0 0 var(--scale-0) 0}dialog>:last-child{display:block;margin-top:var(--scale-3)}button#close{cursor:pointer;display:flex;align-items:center;justify-content:center;border:none;background:none;font-size:var(--scale-3);color:var(--color-grey-500)}button#close:hover{color:var(--pos-secondary-border-color)}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes slideIn{from{opacity:0;transform:translateY(-20px) scale(0.95)}to{opacity:1;transform:translateY(0) scale(1)}}";const qr=Yr;const Gr=class{constructor(t){e(this,t)}async showModal(){this.dialog.showModal()}async close(){this.dialog.close()}render(){return n(i,{key:"4e570e7fb1942fab0f4056d17a28c67a7abfee19"},n("dialog",{key:"c2282c2ac11c236672ee4848019dacb59ff6b1ef",ref:t=>this.dialog=t},n("header",{key:"ca58f3372a078235d931e60b6a7979e5006010c5"},n("slot",{key:"2e63b07551e537491d86bae21c80c235ce5ca0db",name:"title"}),n("button",{key:"a3afd2ab3624f98799976de5d4b86c86360bd2af",tabindex:-1,id:"close",title:"Close",onClick:()=>this.close()},n("ion-icon",{key:"9f7fccd041dab2f0f224a13fdcb7b7254f090740",name:"close-outline"}))),n("slot",{key:"5e5b4e385c7000ece9ced84d5ba6f5b45a990e33",name:"content"})))}};Gr.style=qr;const Zr=class{constructor(t){e(this,t)}async unhandledRejection(t){t.stopPropagation();console.error("unhandled promise rejection",t);await this.showToast(t.reason.toString())}async catchError(t){t.stopPropagation();console.error(t.detail);await this.showToast(t.detail.message)}async showToast(t){const e=await R.create({message:t,duration:1e4,position:"top",color:"danger",buttons:[{text:"Dismiss",role:"cancel"}]});await e.present()}render(){return n(i,{key:"323aca8226bb81061d9edf6db10ba6fcfa69fa21"},n("ion-toast",{key:"e8bcbfb1d06594a25a27beb87da97f47c32067b1",trigger:"never",message:"Workarround to preload ion-toast and ion-ripple-effect to be able to show errors while offline",duration:0},n("ion-ripple-effect",{key:"273603931e206584a1bf3b98751d92daec0465cf"})),n("slot",{key:"6cee55328058d883459a4c89edd63a0dfac9aa7e"}))}};const Qr=":host{border:var(--size-px) solid var(--pos-border-color);border-radius:var(--radius-lg);box-shadow:var(--shadow-md);padding:var(--size-8);max-width:var(--size-96);background:var(--pos-card-background)}.links{display:flex;flex-direction:column;gap:var(--size-3);max-width:80vw}";const to=Qr;const eo=class{constructor(t){e(this,t)}render(){return n(i,{key:"42e8ecc30fa26eb7750efff9a65048bb42b4c71d"},n("div",{key:"1df80385f1f6c44f7fe4255ecb93f6183df61727"},n("h2",{key:"9b249d38f00d1b00863226799bdcd13e4f78a4a9"},"Try these... 💡"),n("p",{key:"c33157b085b1ad3397e38bf5f4b1c601b0e40b6a"},"No idea where to start? Try these example resources, and follow your nose 👃"),n("div",{key:"f0f35cc2ec1f7fbf8a306e718e1f2aaffcbe84e0",class:"links"},n("pos-rich-link",{key:"999b7dc0aa587b1964838820f17a02257b051c0e",uri:"https://pod-os.solidcommunity.net/profile/card#me"}),n("pos-rich-link",{key:"67ca02160d0bdaa73bcfb188fcf40b058a584bf8",uri:"https://angelo.veltens.org/profile/card#me"}),n("pos-rich-link",{key:"800829fb68c96b0caa0ad2372b02e08b7842b704",uri:"https://angelo.veltens.org/public/bookmarks"}),n("pos-rich-link",{key:"680e29b8bf0437d6adba15052339b91ffd41b9a4",uri:"https://solidos.solidcommunity.net/profile/card#me"}))))}};eo.style=to;const no=":host{border:var(--size-px) solid var(--pos-border-color);border-radius:var(--radius-lg);box-shadow:var(--shadow-md);padding:var(--size-8);max-width:var(--size-96);background:var(--pos-card-background)}.question{font-weight:var(--weight-semibold)}a{font-weight:var(--weight-bold);color:var(--pos-primary-color)}button.login{background:none;color:var(--pos-primary-color);display:inline;text-decoration:underline;border:none;padding:0;margin:0;cursor:pointer;font-size:unset}";const io=no;const so=class{constructor(t){e(this,t);this.login=a(this,"pod-os:login",7)}render(){return n(i,{key:"23a14b5ee10d585cc8cf3166ce041072b68cabb2"},n("div",{key:"964e46223d77516aaed40c7c55371716cfccf40a"},n("h2",{key:"5eaf56d6b0751d8511632d05570a05d5deba88c0"},"Getting started 🚀"),n("p",{key:"f41d858112a0337bcf2be9a39986cacac6921210"},"🔎 Enter a URL into the above navigation bar to browse through the web of data. "),n("p",{key:"8d40de32d86b871343687b402122b0dcc843daf9"},"🔐"," ",n("button",{key:"225091e03c1cf175362dc9530cf1eb5238e50d65",class:"login",onClick:()=>this.login.emit()},"Sign in")," ","to access private resources on your Solid Pod or those of your friends or coworkers.")),n("div",{key:"92924f3a67ac70cd333932f0658f9f73dd7474c9"},n("p",{key:"365d7c78aee4bb9396ac7d55c42c9e26b47fe87a",class:"question"},"New to Solid?"),n("p",{key:"42190c0f401faff3cf43fe8f3c69f4afc380f819"},n("a",{key:"d7de0d55a657c8a54a389efc50aa89bc4d48c5e6",href:"https://solidproject.org/for-developers#hosted-pod-services"},"Get a Pod →"))),n("div",{key:"8ad728231a1f2af613a462982af6bf129956ab1c"},n("p",{key:"c960fa49ff9789fe881cadc4f37d315c7727115a",class:"question"},"Want to dig deeper into PodOS?"),n("p",{key:"7991e91dbfdfc0447a2e08850e3634086f3f12ee"},n("a",{key:"a35d336eb2ca5947e66abb9e37526ee035c0a700",href:"http://pod-os.org"},"Learn more →"))))}};so.style=io;const ro=":host{display:flex;background-size:cover;background-repeat:no-repeat;background-position:center;border-radius:inherit}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);object-fit:var(--object-fit)}img{backdrop-filter:var(--blur-xl)}.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.error{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 oo=ro;const ao=class{constructor(t){e(this,t);this.initializeOsEmitter=a(this,"pod-os:init",7);this.resourceLoadedEmitter=a(this,"pod-os:resource-loaded",7);this.blurredBackground=false;this.loading=true;this.setOs=async t=>{this.os=t}}componentWillLoad(){M.onChange("isLoggedIn",(()=>this.fetchBlob()));this.initializeOsEmitter.emit(this.setOs)}async fetchBlob(){try{this.loading=true;this.imageError=null;this.networkError=null;this.brokenFile=null;const t=await this.os.fetchFile(this.src);this.resourceLoadedEmitter.emit(this.src);if(t.blob()){this.dataUri=URL.createObjectURL(t.blob())}else{this.brokenFile=t}}catch(t){this.networkError=t}finally{this.loading=false}}onImageError(t){this.networkError=null;this.imageError=t}render(){if(this.loading){return n("ion-skeleton-text",{animated:true})}if(this.networkError){return n("img",{alt:this.alt,src:this.src,onError:t=>this.onImageError(t)})}if(this.brokenFile){return n(W,{file:this.brokenFile})}if(this.imageError){return n("div",{class:"error"},n("a",{href:this.src},this.src))}return n(i,{style:{backgroundImage:this.blurredBackground?`url('${this.dataUri}')`:null}},n("img",{src:this.dataUri,alt:this.alt}))}static get watchers(){return{os:["fetchBlob"],src:["fetchBlob"]}}};ao.style=oo;const co=class{constructor(t){e(this,t);this.uri="pod-os:dashboard"}render(){return this.uri==="pod-os:settings"?n("pos-app-settings",null):n("pos-app-dashboard",null)}};const lo=class{constructor(t){e(this,t);this.subscribeResource=a(this,"pod-os:resource",7);this.receiveResource=t=>{this.resource=t}}componentWillLoad(){J(this)}render(){return this.resource?this.resource.label():null}};const ho=".container{display:flex;align-items:center;gap:var(--size-2)}.user-data{align-items:center;display:inline-flex;gap:10px}.user-data pos-picture{--width:40px;--height:40px;--border-radius:50%}pos-login-form{margin:var(--size-2)}dialog{margin-top:var(--size-10)}button#login,button#logout{outline:none;font-weight:var(--weight-bold);letter-spacing:var(--letter-xl);border:none;box-sizing:border-box;border-radius:var(--radius-xs);padding:var(--size-2);box-shadow:var(--shadow-sm);color:var(--pos-primary-text-color);background-color:var(--pos-primary-color)}button#login:focus-within,button#logout:focus-within{outline:var(--pos-input-focus-outline)}button#login:focus,button#login:hover,button#logout:focus,button#logout:hover{filter:brightness(110%);box-shadow:var(--shadow-md)}";const uo=ho;const fo=class{constructor(t){e(this,t);this.initializeOsEmitter=a(this,"pod-os:init",7);this.customLoggedInComponent=false;this.setOs=async t=>{this.os=t}}componentWillLoad(){this.customLoggedInComponent=!!this.host.querySelector('[slot="if-logged-in"]');this.initializeOsEmitter.emit(this.setOs)}login(t){const e=t.detail;this.os.login(e)}logout(){this.os.logout()}onLogin(){this.openDialog()}openDialog(){this.dialog.showModal()}render(){return n(i,{key:"8f9cbfdf5a4024b197771ecff10208ee39ab39da"},n("div",{key:"9d63ca7862e6ef22be30d6388d9e9a8061b5081e",class:"container"},!M.state.isLoggedIn?n("button",{id:"login",onClick:()=>this.openDialog()},"Login"):this.loggedInComponents()),n("pos-dialog",{key:"0e5847b6fdd0aebac9e0bbbb2d47698bf0737b22",ref:t=>this.dialog=t},n("span",{key:"d5f2d6df1406e079cbc50106c01a0aa1ea7d07dd",slot:"title"},"Sign in to your Pod"),n("pos-login-form",{key:"369326cb176faf50d5e8d6d1b636b3d7798cd0d3","onPod-os:idp-url-selected":t=>this.login(t),slot:"content"})))}loggedInComponents(){return this.customLoggedInComponent?n("slot",{name:"if-logged-in"}):this.defaultLoggedInComponents()}defaultLoggedInComponents(){return[n("pos-resource",{uri:M.state.webId},n("span",{class:"user-data"},n("pos-picture",null),n("pos-label",null))),n("button",{id:"logout",onClick:()=>this.logout()},"Logout")]}get host(){return s(this)}};fo.style=uo;const po=":host{display:block;margin:0}form{display:flex;flex-direction:column;gap:var(--size-4)}input{outline:var(--pos-input-outline);padding:var(--scale-000);border:none;border-radius:var(--radius-xs);width:var(--size-full);box-sizing:border-box;background:var(--pos-input-background-color);color:var(--pos-normal-text-color)}input:focus-within{outline:var(--pos-input-focus-outline)}input#login{outline:none;box-shadow:var(--shadow-sm);cursor:pointer;color:var(--pos-primary-text-color);background-color:var(--pos-primary-color)}input#login:disabled{cursor:default;color:var(--pos-disabled-text-color);background-color:var(--pos-disabled-color);box-shadow:none}input#login:hover:not(:disabled),input#login:focus{filter:brightness(110%);box-shadow:var(--shadow-md)}";const bo=po;const mo=class{constructor(t){e(this,t);this.idpUrlSelected=a(this,"pod-os:idp-url-selected",7);this.idpUrl="";this.canSubmit=false}validate(){this.canSubmit=Boolean(this.idpUrl)}render(){return n("form",{key:"8504357a8c80ea64a4673ccbf73c1ca870b4a244",method:"dialog",onSubmit:()=>this.handleSubmit()},n("label",{key:"d53473ff19f1ba89d3c70294eac925a2b3ef6baf",htmlFor:"idpUrl"},"Please enter your Identity Provider"),n("input",{key:"311a6c2e10e8c4b5d1d6d6fb49173b4c170da4f5",id:"idpUrl",type:"url",value:this.idpUrl,required:true,onInput:t=>this.handleChange(t),list:"suggestedIssuers",placeholder:"Type to search..."}),n("datalist",{key:"b9d4555ff8cc1cb8328171d51f6fb26163de6747",id:"suggestedIssuers"},n("option",{key:"b5beeb77c2def2f8773fc20324f92b91fd487169",value:"https://solidcommunity.net/"},"solidcommunity.net"),n("option",{key:"49979b609e9340bfda3be7b8f1614451a9d767eb",value:"https://solidweb.me/"},"solidweb.me"),n("option",{key:"a898a1b9e967fdf1a3cd1290d3fdec330294aa7d",value:"https://login.inrupt.com"},"Inrupt PodSpaces"),n("option",{key:"cc87c94deb800b066d545c002786aa6af8ea630b",value:"https://trinpod.us"},"trinpod.us"),n("option",{key:"2f4705747451be8b0e1e831897ae9044239b1c74",value:"https://trinpod.eu"},"trinpod.eu"),n("option",{key:"aaad788c5f3f9103a095be51e9db843e0dcad272",value:"https://solid.redpencil.io/"},"redpencil.io"),n("option",{key:"49cf185d7eedc8781ff37e2fe39bcee0c4894f40",value:"https://teamid.live/"},"teamid.live")),n("input",{key:"7ddd76b1600d05e8585e895fb9ac7821c8648375",id:"login",type:"submit",value:"Login",disabled:!this.canSubmit}))}handleChange(t){this.validate();this.idpUrl=t.target.value}async handleSubmit(){this.idpUrlSelected.emit(this.idpUrl)}static get delegatesFocus(){return true}static get watchers(){return{idpUrl:["validate"]}}};mo.style=bo;
|
|
20
20
|
/**
|
|
21
21
|
* @license
|
|
22
22
|
* Copyright 2019 Google LLC
|
|
@@ -26,7 +26,7 @@ import{d as t,r as e,h as n,H as i,e as s,f as r,w as o,i as a,j as c,k as l}fro
|
|
|
26
26
|
* @license
|
|
27
27
|
* Copyright 2017 Google LLC
|
|
28
28
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
29
|
-
*/;const{is:Ao,defineProperty:Co,getOwnPropertyDescriptor:
|
|
29
|
+
*/;const{is:Ao,defineProperty:Co,getOwnPropertyDescriptor:zo,getOwnPropertyNames:To,getOwnPropertySymbols:$o,getPrototypeOf:Po}=Object,Io=globalThis,Ro=Io.trustedTypes,Oo=Ro?Ro.emptyScript:"",Do=Io.reactiveElementPolyfillSupport,jo=(t,e)=>t,Lo={toAttribute(t,e){switch(e){case Boolean:t=t?Oo:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=null!==t;break;case Number:n=null===t?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch(t){n=null}}return n}},Mo=(t,e)=>!Ao(t,e),Wo={attribute:!0,type:String,converter:Lo,reflect:!1,useDefault:!1,hasChanged:Mo};Symbol.metadata??=Symbol("metadata"),Io.litPropertyMetadata??=new WeakMap;class Uo extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Wo){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const n=Symbol(),i=this.getPropertyDescriptor(t,n,e);void 0!==i&&Co(this.prototype,t,i)}}static getPropertyDescriptor(t,e,n){const{get:i,set:s}=zo(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:i,set(e){const r=i?.call(this);s?.call(this,e),this.requestUpdate(t,r,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Wo}static _$Ei(){if(this.hasOwnProperty(jo("elementProperties")))return;const t=Po(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(jo("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(jo("properties"))){const t=this.properties,e=[...To(t),...$o(t)];for(const n of e)this.createProperty(n,t[n])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,n]of e)this.elementProperties.set(t,n)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const n=this._$Eu(t,e);void 0!==n&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const t of n)e.unshift(Eo(t))}else void 0!==t&&e.push(Eo(t));return e}static _$Eu(t,e){const n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const n of e.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return _o(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,n){this._$AK(t,n)}_$ET(t,e){const n=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,n);if(void 0!==i&&!0===n.reflect){const s=(void 0!==n.converter?.toAttribute?n.converter:Lo).toAttribute(e,n.type);this._$Em=t,null==s?this.removeAttribute(i):this.setAttribute(i,s),this._$Em=null}}_$AK(t,e){const n=this.constructor,i=n._$Eh.get(t);if(void 0!==i&&this._$Em!==i){const t=n.getPropertyOptions(i),s="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:Lo;this._$Em=i;const r=s.fromAttribute(e,t.type);this[i]=r??this._$Ej?.get(i)??r,this._$Em=null}}requestUpdate(t,e,n){if(void 0!==t){const i=this.constructor,s=this[t];if(n??=i.getPropertyOptions(t),!((n.hasChanged??Mo)(s,e)||n.useDefault&&n.reflect&&s===this._$Ej?.get(t)&&!this.hasAttribute(i._$Eu(t,n))))return;this.C(t,e,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:n,reflect:i,wrapped:s},r){n&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??e??this[t]),!0!==s||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||n||(e=void 0),this._$AL.set(t,e)),!0===i&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,n]of t){const{wrapped:t}=n,i=this[e];!0!==t||this._$AL.has(e)||void 0===i||this.C(e,void 0,n,i)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM()}updated(t){}firstUpdated(t){}}Uo.elementStyles=[],Uo.shadowRootOptions={mode:"open"},Uo[jo("elementProperties")]=new Map,Uo[jo("finalized")]=new Map,Do?.({ReactiveElement:Uo}),(Io.reactiveElementVersions??=[]).push("2.1.1");
|
|
30
30
|
/**
|
|
31
31
|
* @license
|
|
32
32
|
* Copyright 2017 Google LLC
|
|
@@ -36,7 +36,7 @@ import{d as t,r as e,h as n,H as i,e as s,f as r,w as o,i as a,j as c,k as l}fro
|
|
|
36
36
|
* @license
|
|
37
37
|
* Copyright 2017 Google LLC
|
|
38
38
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
39
|
-
*/};const Aa=globalThis;class Ca extends Uo{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Ea(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return la}}Ca._$litElement$=!0,Ca["finalized"]=!0,Aa.litElementHydrateSupport?.({LitElement:Ca});const
|
|
39
|
+
*/};const Aa=globalThis;class Ca extends Uo{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Ea(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return la}}Ca._$litElement$=!0,Ca["finalized"]=!0,Aa.litElementHydrateSupport?.({LitElement:Ca});const za=Aa.litElementPolyfillSupport;za?.({LitElement:Ca});(Aa.litElementVersions??=[]).push("4.2.1");var Ta=So`
|
|
40
40
|
:host {
|
|
41
41
|
display: inline-block;
|
|
42
42
|
}
|
|
@@ -176,7 +176,7 @@ import{d as t,r as e,h as n,H as i,e as s,f as r,w as o,i as a,j as c,k as l}fro
|
|
|
176
176
|
* @license
|
|
177
177
|
* Copyright 2017 Google LLC
|
|
178
178
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
179
|
-
*/;function rc(t,e){return(n,i,s)=>{const r=e=>e.renderRoot?.querySelector(t)??null;if(e){const{get:t,set:e}="object"==typeof i?n:s??(()=>{const t=Symbol();return{get(){return this[t]},set(e){this[t]=e}}})();return sc(n,i,{get(){let n=t.call(this);return void 0===n&&(n=r(this),(null!==n||this.hasUpdated)&&e.call(this,n)),n}})}return sc(n,i,{get(){return r(this)}})}}var oc;var ac=class extends Ca{constructor(){super();at(this,oc,false);this.initialReflectedProperties=new Map;Object.entries(this.constructor.dependencies).forEach((([t,e])=>{this.constructor.define(t,e)}))}emit(t,e){const n=new CustomEvent(t,nt({bubbles:true,cancelable:false,composed:true,detail:{}},e));this.dispatchEvent(n);return n}static define(t,e=this,n={}){const i=customElements.get(t);if(!i){try{customElements.define(t,e,n)}catch(i){customElements.define(t,class extends e{},n)}return}let s=" (unknown version)";let r=s;if("version"in e&&e.version){s=" v"+e.version}if("version"in i&&i.version){r=" v"+i.version}if(s&&r&&s===r){return}console.warn(`Attempted to register <${t}>${s}, but <${t}>${r} has already been registered.`)}attributeChangedCallback(t,e,n){if(!ot(this,oc)){this.constructor.elementProperties.forEach(((t,e)=>{if(t.reflect&&this[e]!=null){this.initialReflectedProperties.set(e,this[e])}}));ct(this,oc,true)}super.attributeChangedCallback(t,e,n)}willUpdate(t){super.willUpdate(t);this.initialReflectedProperties.forEach(((e,n)=>{if(t.has(n)&&this[n]==null){this[n]=e}}))}};oc=new WeakMap;ac.version="2.20.1";ac.dependencies={};st([nc()],ac.prototype,"dir",2);st([nc()],ac.prototype,"lang",2);const cc=["top","right","bottom","left"];const lc=["start","end"];const hc=cc.reduce(((t,e)=>t.concat(e,e+"-"+lc[0],e+"-"+lc[1])),[]);const dc=Math.min;const uc=Math.max;const fc=Math.round;const pc=Math.floor;const bc=t=>({x:t,y:t});const mc={left:"right",right:"left",bottom:"top",top:"bottom"};const gc={start:"end",end:"start"};function wc(t,e,n){return uc(t,dc(e,n))}function vc(t,e){return typeof t==="function"?t(e):t}function yc(t){return t.split("-")[0]}function kc(t){return t.split("-")[1]}function xc(t){return t==="x"?"y":"x"}function Sc(t){return t==="y"?"height":"width"}const _c=new Set(["top","bottom"]);function Ec(t){return _c.has(yc(t))?"y":"x"}function Ac(t){return xc(Ec(t))}function Cc(t,e,n){if(n===void 0){n=false}const i=kc(t);const s=Ac(t);const r=Sc(s);let o=s==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";if(e.reference[r]>e.floating[r]){o=jc(o)}return[o,jc(o)]}function Tc(t){const e=jc(t);return[zc(t),e,zc(e)]}function zc(t){return t.replace(/start|end/g,(t=>gc[t]))}const $c=["left","right"];const Pc=["right","left"];const Ic=["top","bottom"];const Rc=["bottom","top"];function Oc(t,e,n){switch(t){case"top":case"bottom":if(n)return e?Pc:$c;return e?$c:Pc;case"left":case"right":return e?Ic:Rc;default:return[]}}function Dc(t,e,n,i){const s=kc(t);let r=Oc(yc(t),n==="start",i);if(s){r=r.map((t=>t+"-"+s));if(e){r=r.concat(r.map(zc))}}return r}function jc(t){return t.replace(/left|right|bottom|top/g,(t=>mc[t]))}function Lc(t){return{top:0,right:0,bottom:0,left:0,...t}}function Mc(t){return typeof t!=="number"?Lc(t):{top:t,right:t,bottom:t,left:t}}function Wc(t){const{x:e,y:n,width:i,height:s}=t;return{width:i,height:s,top:n,left:e,right:e+i,bottom:n+s,x:e,y:n}}function Uc(t,e,n){let{reference:i,floating:s}=t;const r=Ec(e);const o=Ac(e);const a=Sc(o);const c=yc(e);const l=r==="y";const h=i.x+i.width/2-s.width/2;const d=i.y+i.height/2-s.height/2;const u=i[a]/2-s[a]/2;let f;switch(c){case"top":f={x:h,y:i.y-s.height};break;case"bottom":f={x:h,y:i.y+i.height};break;case"right":f={x:i.x+i.width,y:d};break;case"left":f={x:i.x-s.width,y:d};break;default:f={x:i.x,y:i.y}}switch(kc(e)){case"start":f[o]-=u*(n&&l?-1:1);break;case"end":f[o]+=u*(n&&l?-1:1);break}return f}const Hc=async(t,e,n)=>{const{placement:i="bottom",strategy:s="absolute",middleware:r=[],platform:o}=n;const a=r.filter(Boolean);const c=await(o.isRTL==null?void 0:o.isRTL(e));let l=await o.getElementRects({reference:t,floating:e,strategy:s});let{x:h,y:d}=Uc(l,i,c);let u=i;let f={};let p=0;for(let n=0;n<a.length;n++){const{name:r,fn:b}=a[n];const{x:m,y:g,data:w,reset:v}=await b({x:h,y:d,initialPlacement:i,placement:u,strategy:s,middlewareData:f,rects:l,platform:o,elements:{reference:t,floating:e}});h=m!=null?m:h;d=g!=null?g:d;f={...f,[r]:{...f[r],...w}};if(v&&p<=50){p++;if(typeof v==="object"){if(v.placement){u=v.placement}if(v.rects){l=v.rects===true?await o.getElementRects({reference:t,floating:e,strategy:s}):v.rects}({x:h,y:d}=Uc(l,u,c))}n=-1}}return{x:h,y:d,placement:u,strategy:s,middlewareData:f}};async function Nc(t,e){var n;if(e===void 0){e={}}const{x:i,y:s,platform:r,rects:o,elements:a,strategy:c}=t;const{boundary:l="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:u=false,padding:f=0}=vc(e,t);const p=Mc(f);const b=d==="floating"?"reference":"floating";const m=a[u?b:d];const g=Wc(await r.getClippingRect({element:((n=await(r.isElement==null?void 0:r.isElement(m)))!=null?n:true)?m:m.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:l,rootBoundary:h,strategy:c}));const w=d==="floating"?{x:i,y:s,width:o.floating.width,height:o.floating.height}:o.reference;const v=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating));const y=await(r.isElement==null?void 0:r.isElement(v))?await(r.getScale==null?void 0:r.getScale(v))||{x:1,y:1}:{x:1,y:1};const k=Wc(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:v,strategy:c}):w);return{top:(g.top-k.top+p.top)/y.y,bottom:(k.bottom-g.bottom+p.bottom)/y.y,left:(g.left-k.left+p.left)/y.x,right:(k.right-g.right+p.right)/y.x}}const Jc=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:i,placement:s,rects:r,platform:o,elements:a,middlewareData:c}=e;const{element:l,padding:h=0}=vc(t,e)||{};if(l==null){return{}}const d=Mc(h);const u={x:n,y:i};const f=Ac(s);const p=Sc(f);const b=await o.getDimensions(l);const m=f==="y";const g=m?"top":"left";const w=m?"bottom":"right";const v=m?"clientHeight":"clientWidth";const y=r.reference[p]+r.reference[f]-u[f]-r.floating[p];const k=u[f]-r.reference[f];const x=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l));let S=x?x[v]:0;if(!S||!await(o.isElement==null?void 0:o.isElement(x))){S=a.floating[v]||r.floating[p]}const _=y/2-k/2;const E=S/2-b[p]/2-1;const A=dc(d[g],E);const C=dc(d[w],E);const T=A;const z=S-b[p]-C;const $=S/2-b[p]/2+_;const P=wc(T,$,z);const I=!c.arrow&&kc(s)!=null&&$!==P&&r.reference[p]/2-($<T?A:C)-b[p]/2<0;const R=I?$<T?$-T:$-z:0;return{[f]:u[f]+R,data:{[f]:P,centerOffset:$-P-R,...I&&{alignmentOffset:R}},reset:I}}});function Bc(t,e,n){const i=t?[...n.filter((e=>kc(e)===t)),...n.filter((e=>kc(e)!==t))]:n.filter((t=>yc(t)===t));return i.filter((n=>{if(t){return kc(n)===t||(e?zc(n)!==n:false)}return true}))}const Kc=function(t){if(t===void 0){t={}}return{name:"autoPlacement",options:t,async fn(e){var n,i,s;const{rects:r,middlewareData:o,placement:a,platform:c,elements:l}=e;const{crossAxis:h=false,alignment:d,allowedPlacements:u=hc,autoAlignment:f=true,...p}=vc(t,e);const b=d!==undefined||u===hc?Bc(d||null,f,u):u;const m=await Nc(e,p);const g=((n=o.autoPlacement)==null?void 0:n.index)||0;const w=b[g];if(w==null){return{}}const v=Cc(w,r,await(c.isRTL==null?void 0:c.isRTL(l.floating)));if(a!==w){return{reset:{placement:b[0]}}}const y=[m[yc(w)],m[v[0]],m[v[1]]];const k=[...((i=o.autoPlacement)==null?void 0:i.overflows)||[],{placement:w,overflows:y}];const x=b[g+1];if(x){return{data:{index:g+1,overflows:k},reset:{placement:x}}}const S=k.map((t=>{const e=kc(t.placement);return[t.placement,e&&h?t.overflows.slice(0,2).reduce(((t,e)=>t+e),0):t.overflows[0],t.overflows]})).sort(((t,e)=>t[1]-e[1]));const _=S.filter((t=>t[2].slice(0,kc(t[0])?2:3).every((t=>t<=0))));const E=((s=_[0])==null?void 0:s[0])||S[0][0];if(E!==a){return{data:{index:g+1,overflows:k},reset:{placement:E}}}return{}}}};const Fc=function(t){if(t===void 0){t={}}return{name:"flip",options:t,async fn(e){var n,i;const{placement:s,middlewareData:r,rects:o,initialPlacement:a,platform:c,elements:l}=e;const{mainAxis:h=true,crossAxis:d=true,fallbackPlacements:u,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:b=true,...m}=vc(t,e);if((n=r.arrow)!=null&&n.alignmentOffset){return{}}const g=yc(s);const w=Ec(a);const v=yc(a)===a;const y=await(c.isRTL==null?void 0:c.isRTL(l.floating));const k=u||(v||!b?[jc(a)]:Tc(a));const x=p!=="none";if(!u&&x){k.push(...Dc(a,b,p,y))}const S=[a,...k];const _=await Nc(e,m);const E=[];let A=((i=r.flip)==null?void 0:i.overflows)||[];if(h){E.push(_[g])}if(d){const t=Cc(s,o,y);E.push(_[t[0]],_[t[1]])}A=[...A,{placement:s,overflows:E}];if(!E.every((t=>t<=0))){var C,T;const t=(((C=r.flip)==null?void 0:C.index)||0)+1;const e=S[t];if(e){const n=d==="alignment"?w!==Ec(e):false;if(!n||A.every((t=>t.overflows[0]>0&&Ec(t.placement)===w))){return{data:{index:t,overflows:A},reset:{placement:e}}}}let n=(T=A.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])==null?void 0:T.placement;if(!n){switch(f){case"bestFit":{var z;const t=(z=A.filter((t=>{if(x){const e=Ec(t.placement);return e===w||e==="y"}return true})).map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])==null?void 0:z[0];if(t){n=t}break}case"initialPlacement":n=a;break}}if(s!==n){return{reset:{placement:n}}}}return{}}}};function Xc(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Vc(t){return cc.some((e=>t[e]>=0))}const Yc=function(t){if(t===void 0){t={}}return{name:"hide",options:t,async fn(e){const{rects:n}=e;const{strategy:i="referenceHidden",...s}=vc(t,e);switch(i){case"referenceHidden":{const t=await Nc(e,{...s,elementContext:"reference"});const i=Xc(t,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Vc(i)}}}case"escaped":{const t=await Nc(e,{...s,altBoundary:true});const i=Xc(t,n.floating);return{data:{escapedOffsets:i,escaped:Vc(i)}}}default:{return{}}}}}};function qc(t){const e=dc(...t.map((t=>t.left)));const n=dc(...t.map((t=>t.top)));const i=uc(...t.map((t=>t.right)));const s=uc(...t.map((t=>t.bottom)));return{x:e,y:n,width:i-e,height:s-n}}function Gc(t){const e=t.slice().sort(((t,e)=>t.y-e.y));const n=[];let i=null;for(let t=0;t<e.length;t++){const s=e[t];if(!i||s.y-i.y>i.height/2){n.push([s])}else{n[n.length-1].push(s)}i=s}return n.map((t=>Wc(qc(t))))}const Zc=function(t){if(t===void 0){t={}}return{name:"inline",options:t,async fn(e){const{placement:n,elements:i,rects:s,platform:r,strategy:o}=e;const{padding:a=2,x:c,y:l}=vc(t,e);const h=Array.from(await(r.getClientRects==null?void 0:r.getClientRects(i.reference))||[]);const d=Gc(h);const u=Wc(qc(h));const f=Mc(a);function p(){if(d.length===2&&d[0].left>d[1].right&&c!=null&&l!=null){return d.find((t=>c>t.left-f.left&&c<t.right+f.right&&l>t.top-f.top&&l<t.bottom+f.bottom))||u}if(d.length>=2){if(Ec(n)==="y"){const t=d[0];const e=d[d.length-1];const i=yc(n)==="top";const s=t.top;const r=e.bottom;const o=i?t.left:e.left;const a=i?t.right:e.right;const c=a-o;const l=r-s;return{top:s,bottom:r,left:o,right:a,width:c,height:l,x:o,y:s}}const t=yc(n)==="left";const e=uc(...d.map((t=>t.right)));const i=dc(...d.map((t=>t.left)));const s=d.filter((n=>t?n.left===i:n.right===e));const r=s[0].top;const o=s[s.length-1].bottom;const a=i;const c=e;const l=c-a;const h=o-r;return{top:r,bottom:o,left:a,right:c,width:l,height:h,x:a,y:r}}return u}const b=await r.getElementRects({reference:{getBoundingClientRect:p},floating:i.floating,strategy:o});if(s.reference.x!==b.reference.x||s.reference.y!==b.reference.y||s.reference.width!==b.reference.width||s.reference.height!==b.reference.height){return{reset:{rects:b}}}return{}}}};const Qc=new Set(["left","top"]);async function tl(t,e){const{placement:n,platform:i,elements:s}=t;const r=await(i.isRTL==null?void 0:i.isRTL(s.floating));const o=yc(n);const a=kc(n);const c=Ec(n)==="y";const l=Qc.has(o)?-1:1;const h=r&&c?-1:1;const d=vc(e,t);let{mainAxis:u,crossAxis:f,alignmentAxis:p}=typeof d==="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};if(a&&typeof p==="number"){f=a==="end"?p*-1:p}return c?{x:f*h,y:u*l}:{x:u*l,y:f*h}}const el=function(t){if(t===void 0){t=0}return{name:"offset",options:t,async fn(e){var n,i;const{x:s,y:r,placement:o,middlewareData:a}=e;const c=await tl(e,t);if(o===((n=a.offset)==null?void 0:n.placement)&&(i=a.arrow)!=null&&i.alignmentOffset){return{}}return{x:s+c.x,y:r+c.y,data:{...c,placement:o}}}}};const nl=function(t){if(t===void 0){t={}}return{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:s}=e;const{mainAxis:r=true,crossAxis:o=false,limiter:a={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...c}=vc(t,e);const l={x:n,y:i};const h=await Nc(e,c);const d=Ec(yc(s));const u=xc(d);let f=l[u];let p=l[d];if(r){const t=u==="y"?"top":"left";const e=u==="y"?"bottom":"right";const n=f+h[t];const i=f-h[e];f=wc(n,f,i)}if(o){const t=d==="y"?"top":"left";const e=d==="y"?"bottom":"right";const n=p+h[t];const i=p-h[e];p=wc(n,p,i)}const b=a.fn({...e,[u]:f,[d]:p});return{...b,data:{x:b.x-n,y:b.y-i,enabled:{[u]:r,[d]:o}}}}}};const il=function(t){if(t===void 0){t={}}return{options:t,fn(e){const{x:n,y:i,placement:s,rects:r,middlewareData:o}=e;const{offset:a=0,mainAxis:c=true,crossAxis:l=true}=vc(t,e);const h={x:n,y:i};const d=Ec(s);const u=xc(d);let f=h[u];let p=h[d];const b=vc(a,e);const m=typeof b==="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(c){const t=u==="y"?"height":"width";const e=r.reference[u]-r.floating[t]+m.mainAxis;const n=r.reference[u]+r.reference[t]-m.mainAxis;if(f<e){f=e}else if(f>n){f=n}}if(l){var g,w;const t=u==="y"?"width":"height";const e=Qc.has(yc(s));const n=r.reference[d]-r.floating[t]+(e?((g=o.offset)==null?void 0:g[d])||0:0)+(e?0:m.crossAxis);const i=r.reference[d]+r.reference[t]+(e?0:((w=o.offset)==null?void 0:w[d])||0)-(e?m.crossAxis:0);if(p<n){p=n}else if(p>i){p=i}}return{[u]:f,[d]:p}}}};const sl=function(t){if(t===void 0){t={}}return{name:"size",options:t,async fn(e){var n,i;const{placement:s,rects:r,platform:o,elements:a}=e;const{apply:c=(()=>{}),...l}=vc(t,e);const h=await Nc(e,l);const d=yc(s);const u=kc(s);const f=Ec(s)==="y";const{width:p,height:b}=r.floating;let m;let g;if(d==="top"||d==="bottom"){m=d;g=u===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"}else{g=d;m=u==="end"?"top":"bottom"}const w=b-h.top-h.bottom;const v=p-h.left-h.right;const y=dc(b-h[m],w);const k=dc(p-h[g],v);const x=!e.middlewareData.shift;let S=y;let _=k;if((n=e.middlewareData.shift)!=null&&n.enabled.x){_=v}if((i=e.middlewareData.shift)!=null&&i.enabled.y){S=w}if(x&&!u){const t=uc(h.left,0);const e=uc(h.right,0);const n=uc(h.top,0);const i=uc(h.bottom,0);if(f){_=p-2*(t!==0||e!==0?t+e:uc(h.left,h.right))}else{S=b-2*(n!==0||i!==0?n+i:uc(h.top,h.bottom))}}await c({...e,availableWidth:_,availableHeight:S});const E=await o.getDimensions(a.floating);if(p!==E.width||b!==E.height){return{reset:{rects:true}}}return{}}}};function rl(){return typeof window!=="undefined"}function ol(t){if(ll(t)){return(t.nodeName||"").toLowerCase()}return"#document"}function al(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function cl(t){var e;return(e=(ll(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function ll(t){if(!rl()){return false}return t instanceof Node||t instanceof al(t).Node}function hl(t){if(!rl()){return false}return t instanceof Element||t instanceof al(t).Element}function dl(t){if(!rl()){return false}return t instanceof HTMLElement||t instanceof al(t).HTMLElement}function ul(t){if(!rl()||typeof ShadowRoot==="undefined"){return false}return t instanceof ShadowRoot||t instanceof al(t).ShadowRoot}const fl=new Set(["inline","contents"]);function pl(t){const{overflow:e,overflowX:n,overflowY:i,display:s}=Cl(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!fl.has(s)}const bl=new Set(["table","td","th"]);function ml(t){return bl.has(ol(t))}const gl=[":popover-open",":modal"];function wl(t){return gl.some((e=>{try{return t.matches(e)}catch(t){return false}}))}const vl=["transform","translate","scale","rotate","perspective"];const yl=["transform","translate","scale","rotate","perspective","filter"];const kl=["paint","layout","strict","content"];function xl(t){const e=_l();const n=hl(t)?Cl(t):t;return vl.some((t=>n[t]?n[t]!=="none":false))||(n.containerType?n.containerType!=="normal":false)||!e&&(n.backdropFilter?n.backdropFilter!=="none":false)||!e&&(n.filter?n.filter!=="none":false)||yl.some((t=>(n.willChange||"").includes(t)))||kl.some((t=>(n.contain||"").includes(t)))}function Sl(t){let e=zl(t);while(dl(e)&&!Al(e)){if(xl(e)){return e}else if(wl(e)){return null}e=zl(e)}return null}function _l(){if(typeof CSS==="undefined"||!CSS.supports)return false;return CSS.supports("-webkit-backdrop-filter","none")}const El=new Set(["html","body","#document"]);function Al(t){return El.has(ol(t))}function Cl(t){return al(t).getComputedStyle(t)}function Tl(t){if(hl(t)){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}return{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function zl(t){if(ol(t)==="html"){return t}const e=t.assignedSlot||t.parentNode||ul(t)&&t.host||cl(t);return ul(e)?e.host:e}function $l(t){const e=zl(t);if(Al(e)){return t.ownerDocument?t.ownerDocument.body:t.body}if(dl(e)&&pl(e)){return e}return $l(e)}function Pl(t,e,n){var i;if(e===void 0){e=[]}if(n===void 0){n=true}const s=$l(t);const r=s===((i=t.ownerDocument)==null?void 0:i.body);const o=al(s);if(r){const t=Il(o);return e.concat(o,o.visualViewport||[],pl(s)?s:[],t&&n?Pl(t):[])}return e.concat(s,Pl(s,[],n))}function Il(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Rl(t){const e=Cl(t);let n=parseFloat(e.width)||0;let i=parseFloat(e.height)||0;const s=dl(t);const r=s?t.offsetWidth:n;const o=s?t.offsetHeight:i;const a=fc(n)!==r||fc(i)!==o;if(a){n=r;i=o}return{width:n,height:i,$:a}}function Ol(t){return!hl(t)?t.contextElement:t}function Dl(t){const e=Ol(t);if(!dl(e)){return bc(1)}const n=e.getBoundingClientRect();const{width:i,height:s,$:r}=Rl(e);let o=(r?fc(n.width):n.width)/i;let a=(r?fc(n.height):n.height)/s;if(!o||!Number.isFinite(o)){o=1}if(!a||!Number.isFinite(a)){a=1}return{x:o,y:a}}const jl=bc(0);function Ll(t){const e=al(t);if(!_l()||!e.visualViewport){return jl}return{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ml(t,e,n){if(e===void 0){e=false}if(!n||e&&n!==al(t)){return false}return e}function Wl(t,e,n,i){if(e===void 0){e=false}if(n===void 0){n=false}const s=t.getBoundingClientRect();const r=Ol(t);let o=bc(1);if(e){if(i){if(hl(i)){o=Dl(i)}}else{o=Dl(t)}}const a=Ml(r,n,i)?Ll(r):bc(0);let c=(s.left+a.x)/o.x;let l=(s.top+a.y)/o.y;let h=s.width/o.x;let d=s.height/o.y;if(r){const t=al(r);const e=i&&hl(i)?al(i):i;let n=t;let s=Il(n);while(s&&i&&e!==n){const t=Dl(s);const e=s.getBoundingClientRect();const i=Cl(s);const r=e.left+(s.clientLeft+parseFloat(i.paddingLeft))*t.x;const o=e.top+(s.clientTop+parseFloat(i.paddingTop))*t.y;c*=t.x;l*=t.y;h*=t.x;d*=t.y;c+=r;l+=o;n=al(s);s=Il(n)}}return Wc({width:h,height:d,x:c,y:l})}function Ul(t,e){const n=Tl(t).scrollLeft;if(!e){return Wl(cl(t)).left+n}return e.left+n}function Hl(t,e,n){if(n===void 0){n=false}const i=t.getBoundingClientRect();const s=i.left+e.scrollLeft-(n?0:Ul(t,i));const r=i.top+e.scrollTop;return{x:s,y:r}}function Nl(t){let{elements:e,rect:n,offsetParent:i,strategy:s}=t;const r=s==="fixed";const o=cl(i);const a=e?wl(e.floating):false;if(i===o||a&&r){return n}let c={scrollLeft:0,scrollTop:0};let l=bc(1);const h=bc(0);const d=dl(i);if(d||!d&&!r){if(ol(i)!=="body"||pl(o)){c=Tl(i)}if(dl(i)){const t=Wl(i);l=Dl(i);h.x=t.x+i.clientLeft;h.y=t.y+i.clientTop}}const u=o&&!d&&!r?Hl(o,c,true):bc(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+h.x+u.x,y:n.y*l.y-c.scrollTop*l.y+h.y+u.y}}function Jl(t){return Array.from(t.getClientRects())}function Bl(t){const e=cl(t);const n=Tl(t);const i=t.ownerDocument.body;const s=uc(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth);const r=uc(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let o=-n.scrollLeft+Ul(t);const a=-n.scrollTop;if(Cl(i).direction==="rtl"){o+=uc(e.clientWidth,i.clientWidth)-s}return{width:s,height:r,x:o,y:a}}function Kl(t,e){const n=al(t);const i=cl(t);const s=n.visualViewport;let r=i.clientWidth;let o=i.clientHeight;let a=0;let c=0;if(s){r=s.width;o=s.height;const t=_l();if(!t||t&&e==="fixed"){a=s.offsetLeft;c=s.offsetTop}}return{width:r,height:o,x:a,y:c}}const Fl=new Set(["absolute","fixed"]);function Xl(t,e){const n=Wl(t,true,e==="fixed");const i=n.top+t.clientTop;const s=n.left+t.clientLeft;const r=dl(t)?Dl(t):bc(1);const o=t.clientWidth*r.x;const a=t.clientHeight*r.y;const c=s*r.x;const l=i*r.y;return{width:o,height:a,x:c,y:l}}function Vl(t,e,n){let i;if(e==="viewport"){i=Kl(t,n)}else if(e==="document"){i=Bl(cl(t))}else if(hl(e)){i=Xl(e,n)}else{const n=Ll(t);i={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return Wc(i)}function Yl(t,e){const n=zl(t);if(n===e||!hl(n)||Al(n)){return false}return Cl(n).position==="fixed"||Yl(n,e)}function ql(t,e){const n=e.get(t);if(n){return n}let i=Pl(t,[],false).filter((t=>hl(t)&&ol(t)!=="body"));let s=null;const r=Cl(t).position==="fixed";let o=r?zl(t):t;while(hl(o)&&!Al(o)){const e=Cl(o);const n=xl(o);if(!n&&e.position==="fixed"){s=null}const a=r?!n&&!s:!n&&e.position==="static"&&!!s&&Fl.has(s.position)||pl(o)&&!n&&Yl(t,o);if(a){i=i.filter((t=>t!==o))}else{s=e}o=zl(o)}e.set(t,i);return i}function Gl(t){let{element:e,boundary:n,rootBoundary:i,strategy:s}=t;const r=n==="clippingAncestors"?wl(e)?[]:ql(e,this._c):[].concat(n);const o=[...r,i];const a=o[0];const c=o.reduce(((t,n)=>{const i=Vl(e,n,s);t.top=uc(i.top,t.top);t.right=dc(i.right,t.right);t.bottom=dc(i.bottom,t.bottom);t.left=uc(i.left,t.left);return t}),Vl(e,a,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Zl(t){const{width:e,height:n}=Rl(t);return{width:e,height:n}}function Ql(t,e,n){const i=dl(e);const s=cl(e);const r=n==="fixed";const o=Wl(t,true,r,e);let a={scrollLeft:0,scrollTop:0};const c=bc(0);function l(){c.x=Ul(s)}if(i||!i&&!r){if(ol(e)!=="body"||pl(s)){a=Tl(e)}if(i){const t=Wl(e,true,r,e);c.x=t.x+e.clientLeft;c.y=t.y+e.clientTop}else if(s){l()}}if(r&&!i&&s){l()}const h=s&&!i&&!r?Hl(s,a):bc(0);const d=o.left+a.scrollLeft-c.x-h.x;const u=o.top+a.scrollTop-c.y-h.y;return{x:d,y:u,width:o.width,height:o.height}}function th(t){return Cl(t).position==="static"}function eh(t,e){if(!dl(t)||Cl(t).position==="fixed"){return null}if(e){return e(t)}let n=t.offsetParent;if(cl(t)===n){n=n.ownerDocument.body}return n}function nh(t,e){const n=al(t);if(wl(t)){return n}if(!dl(t)){let e=zl(t);while(e&&!Al(e)){if(hl(e)&&!th(e)){return e}e=zl(e)}return n}let i=eh(t,e);while(i&&ml(i)&&th(i)){i=eh(i,e)}if(i&&Al(i)&&th(i)&&!xl(i)){return n}return i||Sl(t)||n}const ih=async function(t){const e=this.getOffsetParent||nh;const n=this.getDimensions;const i=await n(t.floating);return{reference:Ql(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function sh(t){return Cl(t).direction==="rtl"}const rh={convertOffsetParentRelativeRectToViewportRelativeRect:Nl,getDocumentElement:cl,getClippingRect:Gl,getOffsetParent:nh,getElementRects:ih,getClientRects:Jl,getDimensions:Zl,getScale:Dl,isElement:hl,isRTL:sh};function oh(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function ah(t,e){let n=null;let i;const s=cl(t);function r(){var t;clearTimeout(i);(t=n)==null||t.disconnect();n=null}function o(a,c){if(a===void 0){a=false}if(c===void 0){c=1}r();const l=t.getBoundingClientRect();const{left:h,top:d,width:u,height:f}=l;if(!a){e()}if(!u||!f){return}const p=pc(d);const b=pc(s.clientWidth-(h+u));const m=pc(s.clientHeight-(d+f));const g=pc(h);const w=-p+"px "+-b+"px "+-m+"px "+-g+"px";const v={rootMargin:w,threshold:uc(0,dc(1,c))||1};let y=true;function k(e){const n=e[0].intersectionRatio;if(n!==c){if(!y){return o()}if(!n){i=setTimeout((()=>{o(false,1e-7)}),1e3)}else{o(false,n)}}if(n===1&&!oh(l,t.getBoundingClientRect())){o()}y=false}try{n=new IntersectionObserver(k,{...v,root:s.ownerDocument})}catch(t){n=new IntersectionObserver(k,v)}n.observe(t)}o(true);return r}function ch(t,e,n,i){if(i===void 0){i={}}const{ancestorScroll:s=true,ancestorResize:r=true,elementResize:o=typeof ResizeObserver==="function",layoutShift:a=typeof IntersectionObserver==="function",animationFrame:c=false}=i;const l=Ol(t);const h=s||r?[...l?Pl(l):[],...Pl(e)]:[];h.forEach((t=>{s&&t.addEventListener("scroll",n,{passive:true});r&&t.addEventListener("resize",n)}));const d=l&&a?ah(l,n):null;let u=-1;let f=null;if(o){f=new ResizeObserver((t=>{let[i]=t;if(i&&i.target===l&&f){f.unobserve(e);cancelAnimationFrame(u);u=requestAnimationFrame((()=>{var t;(t=f)==null||t.observe(e)}))}n()}));if(l&&!c){f.observe(l)}f.observe(e)}let p;let b=c?Wl(t):null;if(c){m()}function m(){const e=Wl(t);if(b&&!oh(b,e)){n()}b=e;p=requestAnimationFrame(m)}n();return()=>{var t;h.forEach((t=>{s&&t.removeEventListener("scroll",n);r&&t.removeEventListener("resize",n)}));d==null||d();(t=f)==null||t.disconnect();f=null;if(c){cancelAnimationFrame(p)}}}const lh=el;Kc;const hh=nl;const dh=Fc;const uh=sl;Yc;const fh=Jc;Zc;il;const ph=(t,e,n)=>{const i=new Map;const s={platform:rh,...n};const r={...s.platform,_c:i};return Hc(t,e,{...s,platform:r})};
|
|
179
|
+
*/;function rc(t,e){return(n,i,s)=>{const r=e=>e.renderRoot?.querySelector(t)??null;if(e){const{get:t,set:e}="object"==typeof i?n:s??(()=>{const t=Symbol();return{get(){return this[t]},set(e){this[t]=e}}})();return sc(n,i,{get(){let n=t.call(this);return void 0===n&&(n=r(this),(null!==n||this.hasUpdated)&&e.call(this,n)),n}})}return sc(n,i,{get(){return r(this)}})}}var oc;var ac=class extends Ca{constructor(){super();at(this,oc,false);this.initialReflectedProperties=new Map;Object.entries(this.constructor.dependencies).forEach((([t,e])=>{this.constructor.define(t,e)}))}emit(t,e){const n=new CustomEvent(t,nt({bubbles:true,cancelable:false,composed:true,detail:{}},e));this.dispatchEvent(n);return n}static define(t,e=this,n={}){const i=customElements.get(t);if(!i){try{customElements.define(t,e,n)}catch(i){customElements.define(t,class extends e{},n)}return}let s=" (unknown version)";let r=s;if("version"in e&&e.version){s=" v"+e.version}if("version"in i&&i.version){r=" v"+i.version}if(s&&r&&s===r){return}console.warn(`Attempted to register <${t}>${s}, but <${t}>${r} has already been registered.`)}attributeChangedCallback(t,e,n){if(!ot(this,oc)){this.constructor.elementProperties.forEach(((t,e)=>{if(t.reflect&&this[e]!=null){this.initialReflectedProperties.set(e,this[e])}}));ct(this,oc,true)}super.attributeChangedCallback(t,e,n)}willUpdate(t){super.willUpdate(t);this.initialReflectedProperties.forEach(((e,n)=>{if(t.has(n)&&this[n]==null){this[n]=e}}))}};oc=new WeakMap;ac.version="2.20.1";ac.dependencies={};st([nc()],ac.prototype,"dir",2);st([nc()],ac.prototype,"lang",2);const cc=["top","right","bottom","left"];const lc=["start","end"];const hc=cc.reduce(((t,e)=>t.concat(e,e+"-"+lc[0],e+"-"+lc[1])),[]);const dc=Math.min;const uc=Math.max;const fc=Math.round;const pc=Math.floor;const bc=t=>({x:t,y:t});const mc={left:"right",right:"left",bottom:"top",top:"bottom"};const gc={start:"end",end:"start"};function wc(t,e,n){return uc(t,dc(e,n))}function vc(t,e){return typeof t==="function"?t(e):t}function yc(t){return t.split("-")[0]}function kc(t){return t.split("-")[1]}function xc(t){return t==="x"?"y":"x"}function Sc(t){return t==="y"?"height":"width"}const _c=new Set(["top","bottom"]);function Ec(t){return _c.has(yc(t))?"y":"x"}function Ac(t){return xc(Ec(t))}function Cc(t,e,n){if(n===void 0){n=false}const i=kc(t);const s=Ac(t);const r=Sc(s);let o=s==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";if(e.reference[r]>e.floating[r]){o=jc(o)}return[o,jc(o)]}function zc(t){const e=jc(t);return[Tc(t),e,Tc(e)]}function Tc(t){return t.replace(/start|end/g,(t=>gc[t]))}const $c=["left","right"];const Pc=["right","left"];const Ic=["top","bottom"];const Rc=["bottom","top"];function Oc(t,e,n){switch(t){case"top":case"bottom":if(n)return e?Pc:$c;return e?$c:Pc;case"left":case"right":return e?Ic:Rc;default:return[]}}function Dc(t,e,n,i){const s=kc(t);let r=Oc(yc(t),n==="start",i);if(s){r=r.map((t=>t+"-"+s));if(e){r=r.concat(r.map(Tc))}}return r}function jc(t){return t.replace(/left|right|bottom|top/g,(t=>mc[t]))}function Lc(t){return{top:0,right:0,bottom:0,left:0,...t}}function Mc(t){return typeof t!=="number"?Lc(t):{top:t,right:t,bottom:t,left:t}}function Wc(t){const{x:e,y:n,width:i,height:s}=t;return{width:i,height:s,top:n,left:e,right:e+i,bottom:n+s,x:e,y:n}}function Uc(t,e,n){let{reference:i,floating:s}=t;const r=Ec(e);const o=Ac(e);const a=Sc(o);const c=yc(e);const l=r==="y";const h=i.x+i.width/2-s.width/2;const d=i.y+i.height/2-s.height/2;const u=i[a]/2-s[a]/2;let f;switch(c){case"top":f={x:h,y:i.y-s.height};break;case"bottom":f={x:h,y:i.y+i.height};break;case"right":f={x:i.x+i.width,y:d};break;case"left":f={x:i.x-s.width,y:d};break;default:f={x:i.x,y:i.y}}switch(kc(e)){case"start":f[o]-=u*(n&&l?-1:1);break;case"end":f[o]+=u*(n&&l?-1:1);break}return f}const Hc=async(t,e,n)=>{const{placement:i="bottom",strategy:s="absolute",middleware:r=[],platform:o}=n;const a=r.filter(Boolean);const c=await(o.isRTL==null?void 0:o.isRTL(e));let l=await o.getElementRects({reference:t,floating:e,strategy:s});let{x:h,y:d}=Uc(l,i,c);let u=i;let f={};let p=0;for(let n=0;n<a.length;n++){const{name:r,fn:b}=a[n];const{x:m,y:g,data:w,reset:v}=await b({x:h,y:d,initialPlacement:i,placement:u,strategy:s,middlewareData:f,rects:l,platform:o,elements:{reference:t,floating:e}});h=m!=null?m:h;d=g!=null?g:d;f={...f,[r]:{...f[r],...w}};if(v&&p<=50){p++;if(typeof v==="object"){if(v.placement){u=v.placement}if(v.rects){l=v.rects===true?await o.getElementRects({reference:t,floating:e,strategy:s}):v.rects}({x:h,y:d}=Uc(l,u,c))}n=-1}}return{x:h,y:d,placement:u,strategy:s,middlewareData:f}};async function Nc(t,e){var n;if(e===void 0){e={}}const{x:i,y:s,platform:r,rects:o,elements:a,strategy:c}=t;const{boundary:l="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:u=false,padding:f=0}=vc(e,t);const p=Mc(f);const b=d==="floating"?"reference":"floating";const m=a[u?b:d];const g=Wc(await r.getClippingRect({element:((n=await(r.isElement==null?void 0:r.isElement(m)))!=null?n:true)?m:m.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:l,rootBoundary:h,strategy:c}));const w=d==="floating"?{x:i,y:s,width:o.floating.width,height:o.floating.height}:o.reference;const v=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating));const y=await(r.isElement==null?void 0:r.isElement(v))?await(r.getScale==null?void 0:r.getScale(v))||{x:1,y:1}:{x:1,y:1};const k=Wc(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:v,strategy:c}):w);return{top:(g.top-k.top+p.top)/y.y,bottom:(k.bottom-g.bottom+p.bottom)/y.y,left:(g.left-k.left+p.left)/y.x,right:(k.right-g.right+p.right)/y.x}}const Jc=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:i,placement:s,rects:r,platform:o,elements:a,middlewareData:c}=e;const{element:l,padding:h=0}=vc(t,e)||{};if(l==null){return{}}const d=Mc(h);const u={x:n,y:i};const f=Ac(s);const p=Sc(f);const b=await o.getDimensions(l);const m=f==="y";const g=m?"top":"left";const w=m?"bottom":"right";const v=m?"clientHeight":"clientWidth";const y=r.reference[p]+r.reference[f]-u[f]-r.floating[p];const k=u[f]-r.reference[f];const x=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l));let S=x?x[v]:0;if(!S||!await(o.isElement==null?void 0:o.isElement(x))){S=a.floating[v]||r.floating[p]}const _=y/2-k/2;const E=S/2-b[p]/2-1;const A=dc(d[g],E);const C=dc(d[w],E);const z=A;const T=S-b[p]-C;const $=S/2-b[p]/2+_;const P=wc(z,$,T);const I=!c.arrow&&kc(s)!=null&&$!==P&&r.reference[p]/2-($<z?A:C)-b[p]/2<0;const R=I?$<z?$-z:$-T:0;return{[f]:u[f]+R,data:{[f]:P,centerOffset:$-P-R,...I&&{alignmentOffset:R}},reset:I}}});function Bc(t,e,n){const i=t?[...n.filter((e=>kc(e)===t)),...n.filter((e=>kc(e)!==t))]:n.filter((t=>yc(t)===t));return i.filter((n=>{if(t){return kc(n)===t||(e?Tc(n)!==n:false)}return true}))}const Kc=function(t){if(t===void 0){t={}}return{name:"autoPlacement",options:t,async fn(e){var n,i,s;const{rects:r,middlewareData:o,placement:a,platform:c,elements:l}=e;const{crossAxis:h=false,alignment:d,allowedPlacements:u=hc,autoAlignment:f=true,...p}=vc(t,e);const b=d!==undefined||u===hc?Bc(d||null,f,u):u;const m=await Nc(e,p);const g=((n=o.autoPlacement)==null?void 0:n.index)||0;const w=b[g];if(w==null){return{}}const v=Cc(w,r,await(c.isRTL==null?void 0:c.isRTL(l.floating)));if(a!==w){return{reset:{placement:b[0]}}}const y=[m[yc(w)],m[v[0]],m[v[1]]];const k=[...((i=o.autoPlacement)==null?void 0:i.overflows)||[],{placement:w,overflows:y}];const x=b[g+1];if(x){return{data:{index:g+1,overflows:k},reset:{placement:x}}}const S=k.map((t=>{const e=kc(t.placement);return[t.placement,e&&h?t.overflows.slice(0,2).reduce(((t,e)=>t+e),0):t.overflows[0],t.overflows]})).sort(((t,e)=>t[1]-e[1]));const _=S.filter((t=>t[2].slice(0,kc(t[0])?2:3).every((t=>t<=0))));const E=((s=_[0])==null?void 0:s[0])||S[0][0];if(E!==a){return{data:{index:g+1,overflows:k},reset:{placement:E}}}return{}}}};const Fc=function(t){if(t===void 0){t={}}return{name:"flip",options:t,async fn(e){var n,i;const{placement:s,middlewareData:r,rects:o,initialPlacement:a,platform:c,elements:l}=e;const{mainAxis:h=true,crossAxis:d=true,fallbackPlacements:u,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:b=true,...m}=vc(t,e);if((n=r.arrow)!=null&&n.alignmentOffset){return{}}const g=yc(s);const w=Ec(a);const v=yc(a)===a;const y=await(c.isRTL==null?void 0:c.isRTL(l.floating));const k=u||(v||!b?[jc(a)]:zc(a));const x=p!=="none";if(!u&&x){k.push(...Dc(a,b,p,y))}const S=[a,...k];const _=await Nc(e,m);const E=[];let A=((i=r.flip)==null?void 0:i.overflows)||[];if(h){E.push(_[g])}if(d){const t=Cc(s,o,y);E.push(_[t[0]],_[t[1]])}A=[...A,{placement:s,overflows:E}];if(!E.every((t=>t<=0))){var C,z;const t=(((C=r.flip)==null?void 0:C.index)||0)+1;const e=S[t];if(e){const n=d==="alignment"?w!==Ec(e):false;if(!n||A.every((t=>t.overflows[0]>0&&Ec(t.placement)===w))){return{data:{index:t,overflows:A},reset:{placement:e}}}}let n=(z=A.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])==null?void 0:z.placement;if(!n){switch(f){case"bestFit":{var T;const t=(T=A.filter((t=>{if(x){const e=Ec(t.placement);return e===w||e==="y"}return true})).map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])==null?void 0:T[0];if(t){n=t}break}case"initialPlacement":n=a;break}}if(s!==n){return{reset:{placement:n}}}}return{}}}};function Xc(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Vc(t){return cc.some((e=>t[e]>=0))}const Yc=function(t){if(t===void 0){t={}}return{name:"hide",options:t,async fn(e){const{rects:n}=e;const{strategy:i="referenceHidden",...s}=vc(t,e);switch(i){case"referenceHidden":{const t=await Nc(e,{...s,elementContext:"reference"});const i=Xc(t,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Vc(i)}}}case"escaped":{const t=await Nc(e,{...s,altBoundary:true});const i=Xc(t,n.floating);return{data:{escapedOffsets:i,escaped:Vc(i)}}}default:{return{}}}}}};function qc(t){const e=dc(...t.map((t=>t.left)));const n=dc(...t.map((t=>t.top)));const i=uc(...t.map((t=>t.right)));const s=uc(...t.map((t=>t.bottom)));return{x:e,y:n,width:i-e,height:s-n}}function Gc(t){const e=t.slice().sort(((t,e)=>t.y-e.y));const n=[];let i=null;for(let t=0;t<e.length;t++){const s=e[t];if(!i||s.y-i.y>i.height/2){n.push([s])}else{n[n.length-1].push(s)}i=s}return n.map((t=>Wc(qc(t))))}const Zc=function(t){if(t===void 0){t={}}return{name:"inline",options:t,async fn(e){const{placement:n,elements:i,rects:s,platform:r,strategy:o}=e;const{padding:a=2,x:c,y:l}=vc(t,e);const h=Array.from(await(r.getClientRects==null?void 0:r.getClientRects(i.reference))||[]);const d=Gc(h);const u=Wc(qc(h));const f=Mc(a);function p(){if(d.length===2&&d[0].left>d[1].right&&c!=null&&l!=null){return d.find((t=>c>t.left-f.left&&c<t.right+f.right&&l>t.top-f.top&&l<t.bottom+f.bottom))||u}if(d.length>=2){if(Ec(n)==="y"){const t=d[0];const e=d[d.length-1];const i=yc(n)==="top";const s=t.top;const r=e.bottom;const o=i?t.left:e.left;const a=i?t.right:e.right;const c=a-o;const l=r-s;return{top:s,bottom:r,left:o,right:a,width:c,height:l,x:o,y:s}}const t=yc(n)==="left";const e=uc(...d.map((t=>t.right)));const i=dc(...d.map((t=>t.left)));const s=d.filter((n=>t?n.left===i:n.right===e));const r=s[0].top;const o=s[s.length-1].bottom;const a=i;const c=e;const l=c-a;const h=o-r;return{top:r,bottom:o,left:a,right:c,width:l,height:h,x:a,y:r}}return u}const b=await r.getElementRects({reference:{getBoundingClientRect:p},floating:i.floating,strategy:o});if(s.reference.x!==b.reference.x||s.reference.y!==b.reference.y||s.reference.width!==b.reference.width||s.reference.height!==b.reference.height){return{reset:{rects:b}}}return{}}}};const Qc=new Set(["left","top"]);async function tl(t,e){const{placement:n,platform:i,elements:s}=t;const r=await(i.isRTL==null?void 0:i.isRTL(s.floating));const o=yc(n);const a=kc(n);const c=Ec(n)==="y";const l=Qc.has(o)?-1:1;const h=r&&c?-1:1;const d=vc(e,t);let{mainAxis:u,crossAxis:f,alignmentAxis:p}=typeof d==="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};if(a&&typeof p==="number"){f=a==="end"?p*-1:p}return c?{x:f*h,y:u*l}:{x:u*l,y:f*h}}const el=function(t){if(t===void 0){t=0}return{name:"offset",options:t,async fn(e){var n,i;const{x:s,y:r,placement:o,middlewareData:a}=e;const c=await tl(e,t);if(o===((n=a.offset)==null?void 0:n.placement)&&(i=a.arrow)!=null&&i.alignmentOffset){return{}}return{x:s+c.x,y:r+c.y,data:{...c,placement:o}}}}};const nl=function(t){if(t===void 0){t={}}return{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:s}=e;const{mainAxis:r=true,crossAxis:o=false,limiter:a={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...c}=vc(t,e);const l={x:n,y:i};const h=await Nc(e,c);const d=Ec(yc(s));const u=xc(d);let f=l[u];let p=l[d];if(r){const t=u==="y"?"top":"left";const e=u==="y"?"bottom":"right";const n=f+h[t];const i=f-h[e];f=wc(n,f,i)}if(o){const t=d==="y"?"top":"left";const e=d==="y"?"bottom":"right";const n=p+h[t];const i=p-h[e];p=wc(n,p,i)}const b=a.fn({...e,[u]:f,[d]:p});return{...b,data:{x:b.x-n,y:b.y-i,enabled:{[u]:r,[d]:o}}}}}};const il=function(t){if(t===void 0){t={}}return{options:t,fn(e){const{x:n,y:i,placement:s,rects:r,middlewareData:o}=e;const{offset:a=0,mainAxis:c=true,crossAxis:l=true}=vc(t,e);const h={x:n,y:i};const d=Ec(s);const u=xc(d);let f=h[u];let p=h[d];const b=vc(a,e);const m=typeof b==="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(c){const t=u==="y"?"height":"width";const e=r.reference[u]-r.floating[t]+m.mainAxis;const n=r.reference[u]+r.reference[t]-m.mainAxis;if(f<e){f=e}else if(f>n){f=n}}if(l){var g,w;const t=u==="y"?"width":"height";const e=Qc.has(yc(s));const n=r.reference[d]-r.floating[t]+(e?((g=o.offset)==null?void 0:g[d])||0:0)+(e?0:m.crossAxis);const i=r.reference[d]+r.reference[t]+(e?0:((w=o.offset)==null?void 0:w[d])||0)-(e?m.crossAxis:0);if(p<n){p=n}else if(p>i){p=i}}return{[u]:f,[d]:p}}}};const sl=function(t){if(t===void 0){t={}}return{name:"size",options:t,async fn(e){var n,i;const{placement:s,rects:r,platform:o,elements:a}=e;const{apply:c=(()=>{}),...l}=vc(t,e);const h=await Nc(e,l);const d=yc(s);const u=kc(s);const f=Ec(s)==="y";const{width:p,height:b}=r.floating;let m;let g;if(d==="top"||d==="bottom"){m=d;g=u===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"}else{g=d;m=u==="end"?"top":"bottom"}const w=b-h.top-h.bottom;const v=p-h.left-h.right;const y=dc(b-h[m],w);const k=dc(p-h[g],v);const x=!e.middlewareData.shift;let S=y;let _=k;if((n=e.middlewareData.shift)!=null&&n.enabled.x){_=v}if((i=e.middlewareData.shift)!=null&&i.enabled.y){S=w}if(x&&!u){const t=uc(h.left,0);const e=uc(h.right,0);const n=uc(h.top,0);const i=uc(h.bottom,0);if(f){_=p-2*(t!==0||e!==0?t+e:uc(h.left,h.right))}else{S=b-2*(n!==0||i!==0?n+i:uc(h.top,h.bottom))}}await c({...e,availableWidth:_,availableHeight:S});const E=await o.getDimensions(a.floating);if(p!==E.width||b!==E.height){return{reset:{rects:true}}}return{}}}};function rl(){return typeof window!=="undefined"}function ol(t){if(ll(t)){return(t.nodeName||"").toLowerCase()}return"#document"}function al(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function cl(t){var e;return(e=(ll(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function ll(t){if(!rl()){return false}return t instanceof Node||t instanceof al(t).Node}function hl(t){if(!rl()){return false}return t instanceof Element||t instanceof al(t).Element}function dl(t){if(!rl()){return false}return t instanceof HTMLElement||t instanceof al(t).HTMLElement}function ul(t){if(!rl()||typeof ShadowRoot==="undefined"){return false}return t instanceof ShadowRoot||t instanceof al(t).ShadowRoot}const fl=new Set(["inline","contents"]);function pl(t){const{overflow:e,overflowX:n,overflowY:i,display:s}=Cl(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!fl.has(s)}const bl=new Set(["table","td","th"]);function ml(t){return bl.has(ol(t))}const gl=[":popover-open",":modal"];function wl(t){return gl.some((e=>{try{return t.matches(e)}catch(t){return false}}))}const vl=["transform","translate","scale","rotate","perspective"];const yl=["transform","translate","scale","rotate","perspective","filter"];const kl=["paint","layout","strict","content"];function xl(t){const e=_l();const n=hl(t)?Cl(t):t;return vl.some((t=>n[t]?n[t]!=="none":false))||(n.containerType?n.containerType!=="normal":false)||!e&&(n.backdropFilter?n.backdropFilter!=="none":false)||!e&&(n.filter?n.filter!=="none":false)||yl.some((t=>(n.willChange||"").includes(t)))||kl.some((t=>(n.contain||"").includes(t)))}function Sl(t){let e=Tl(t);while(dl(e)&&!Al(e)){if(xl(e)){return e}else if(wl(e)){return null}e=Tl(e)}return null}function _l(){if(typeof CSS==="undefined"||!CSS.supports)return false;return CSS.supports("-webkit-backdrop-filter","none")}const El=new Set(["html","body","#document"]);function Al(t){return El.has(ol(t))}function Cl(t){return al(t).getComputedStyle(t)}function zl(t){if(hl(t)){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}return{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Tl(t){if(ol(t)==="html"){return t}const e=t.assignedSlot||t.parentNode||ul(t)&&t.host||cl(t);return ul(e)?e.host:e}function $l(t){const e=Tl(t);if(Al(e)){return t.ownerDocument?t.ownerDocument.body:t.body}if(dl(e)&&pl(e)){return e}return $l(e)}function Pl(t,e,n){var i;if(e===void 0){e=[]}if(n===void 0){n=true}const s=$l(t);const r=s===((i=t.ownerDocument)==null?void 0:i.body);const o=al(s);if(r){const t=Il(o);return e.concat(o,o.visualViewport||[],pl(s)?s:[],t&&n?Pl(t):[])}return e.concat(s,Pl(s,[],n))}function Il(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Rl(t){const e=Cl(t);let n=parseFloat(e.width)||0;let i=parseFloat(e.height)||0;const s=dl(t);const r=s?t.offsetWidth:n;const o=s?t.offsetHeight:i;const a=fc(n)!==r||fc(i)!==o;if(a){n=r;i=o}return{width:n,height:i,$:a}}function Ol(t){return!hl(t)?t.contextElement:t}function Dl(t){const e=Ol(t);if(!dl(e)){return bc(1)}const n=e.getBoundingClientRect();const{width:i,height:s,$:r}=Rl(e);let o=(r?fc(n.width):n.width)/i;let a=(r?fc(n.height):n.height)/s;if(!o||!Number.isFinite(o)){o=1}if(!a||!Number.isFinite(a)){a=1}return{x:o,y:a}}const jl=bc(0);function Ll(t){const e=al(t);if(!_l()||!e.visualViewport){return jl}return{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ml(t,e,n){if(e===void 0){e=false}if(!n||e&&n!==al(t)){return false}return e}function Wl(t,e,n,i){if(e===void 0){e=false}if(n===void 0){n=false}const s=t.getBoundingClientRect();const r=Ol(t);let o=bc(1);if(e){if(i){if(hl(i)){o=Dl(i)}}else{o=Dl(t)}}const a=Ml(r,n,i)?Ll(r):bc(0);let c=(s.left+a.x)/o.x;let l=(s.top+a.y)/o.y;let h=s.width/o.x;let d=s.height/o.y;if(r){const t=al(r);const e=i&&hl(i)?al(i):i;let n=t;let s=Il(n);while(s&&i&&e!==n){const t=Dl(s);const e=s.getBoundingClientRect();const i=Cl(s);const r=e.left+(s.clientLeft+parseFloat(i.paddingLeft))*t.x;const o=e.top+(s.clientTop+parseFloat(i.paddingTop))*t.y;c*=t.x;l*=t.y;h*=t.x;d*=t.y;c+=r;l+=o;n=al(s);s=Il(n)}}return Wc({width:h,height:d,x:c,y:l})}function Ul(t,e){const n=zl(t).scrollLeft;if(!e){return Wl(cl(t)).left+n}return e.left+n}function Hl(t,e,n){if(n===void 0){n=false}const i=t.getBoundingClientRect();const s=i.left+e.scrollLeft-(n?0:Ul(t,i));const r=i.top+e.scrollTop;return{x:s,y:r}}function Nl(t){let{elements:e,rect:n,offsetParent:i,strategy:s}=t;const r=s==="fixed";const o=cl(i);const a=e?wl(e.floating):false;if(i===o||a&&r){return n}let c={scrollLeft:0,scrollTop:0};let l=bc(1);const h=bc(0);const d=dl(i);if(d||!d&&!r){if(ol(i)!=="body"||pl(o)){c=zl(i)}if(dl(i)){const t=Wl(i);l=Dl(i);h.x=t.x+i.clientLeft;h.y=t.y+i.clientTop}}const u=o&&!d&&!r?Hl(o,c,true):bc(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+h.x+u.x,y:n.y*l.y-c.scrollTop*l.y+h.y+u.y}}function Jl(t){return Array.from(t.getClientRects())}function Bl(t){const e=cl(t);const n=zl(t);const i=t.ownerDocument.body;const s=uc(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth);const r=uc(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let o=-n.scrollLeft+Ul(t);const a=-n.scrollTop;if(Cl(i).direction==="rtl"){o+=uc(e.clientWidth,i.clientWidth)-s}return{width:s,height:r,x:o,y:a}}function Kl(t,e){const n=al(t);const i=cl(t);const s=n.visualViewport;let r=i.clientWidth;let o=i.clientHeight;let a=0;let c=0;if(s){r=s.width;o=s.height;const t=_l();if(!t||t&&e==="fixed"){a=s.offsetLeft;c=s.offsetTop}}return{width:r,height:o,x:a,y:c}}const Fl=new Set(["absolute","fixed"]);function Xl(t,e){const n=Wl(t,true,e==="fixed");const i=n.top+t.clientTop;const s=n.left+t.clientLeft;const r=dl(t)?Dl(t):bc(1);const o=t.clientWidth*r.x;const a=t.clientHeight*r.y;const c=s*r.x;const l=i*r.y;return{width:o,height:a,x:c,y:l}}function Vl(t,e,n){let i;if(e==="viewport"){i=Kl(t,n)}else if(e==="document"){i=Bl(cl(t))}else if(hl(e)){i=Xl(e,n)}else{const n=Ll(t);i={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return Wc(i)}function Yl(t,e){const n=Tl(t);if(n===e||!hl(n)||Al(n)){return false}return Cl(n).position==="fixed"||Yl(n,e)}function ql(t,e){const n=e.get(t);if(n){return n}let i=Pl(t,[],false).filter((t=>hl(t)&&ol(t)!=="body"));let s=null;const r=Cl(t).position==="fixed";let o=r?Tl(t):t;while(hl(o)&&!Al(o)){const e=Cl(o);const n=xl(o);if(!n&&e.position==="fixed"){s=null}const a=r?!n&&!s:!n&&e.position==="static"&&!!s&&Fl.has(s.position)||pl(o)&&!n&&Yl(t,o);if(a){i=i.filter((t=>t!==o))}else{s=e}o=Tl(o)}e.set(t,i);return i}function Gl(t){let{element:e,boundary:n,rootBoundary:i,strategy:s}=t;const r=n==="clippingAncestors"?wl(e)?[]:ql(e,this._c):[].concat(n);const o=[...r,i];const a=o[0];const c=o.reduce(((t,n)=>{const i=Vl(e,n,s);t.top=uc(i.top,t.top);t.right=dc(i.right,t.right);t.bottom=dc(i.bottom,t.bottom);t.left=uc(i.left,t.left);return t}),Vl(e,a,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Zl(t){const{width:e,height:n}=Rl(t);return{width:e,height:n}}function Ql(t,e,n){const i=dl(e);const s=cl(e);const r=n==="fixed";const o=Wl(t,true,r,e);let a={scrollLeft:0,scrollTop:0};const c=bc(0);function l(){c.x=Ul(s)}if(i||!i&&!r){if(ol(e)!=="body"||pl(s)){a=zl(e)}if(i){const t=Wl(e,true,r,e);c.x=t.x+e.clientLeft;c.y=t.y+e.clientTop}else if(s){l()}}if(r&&!i&&s){l()}const h=s&&!i&&!r?Hl(s,a):bc(0);const d=o.left+a.scrollLeft-c.x-h.x;const u=o.top+a.scrollTop-c.y-h.y;return{x:d,y:u,width:o.width,height:o.height}}function th(t){return Cl(t).position==="static"}function eh(t,e){if(!dl(t)||Cl(t).position==="fixed"){return null}if(e){return e(t)}let n=t.offsetParent;if(cl(t)===n){n=n.ownerDocument.body}return n}function nh(t,e){const n=al(t);if(wl(t)){return n}if(!dl(t)){let e=Tl(t);while(e&&!Al(e)){if(hl(e)&&!th(e)){return e}e=Tl(e)}return n}let i=eh(t,e);while(i&&ml(i)&&th(i)){i=eh(i,e)}if(i&&Al(i)&&th(i)&&!xl(i)){return n}return i||Sl(t)||n}const ih=async function(t){const e=this.getOffsetParent||nh;const n=this.getDimensions;const i=await n(t.floating);return{reference:Ql(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function sh(t){return Cl(t).direction==="rtl"}const rh={convertOffsetParentRelativeRectToViewportRelativeRect:Nl,getDocumentElement:cl,getClippingRect:Gl,getOffsetParent:nh,getElementRects:ih,getClientRects:Jl,getDimensions:Zl,getScale:Dl,isElement:hl,isRTL:sh};function oh(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function ah(t,e){let n=null;let i;const s=cl(t);function r(){var t;clearTimeout(i);(t=n)==null||t.disconnect();n=null}function o(a,c){if(a===void 0){a=false}if(c===void 0){c=1}r();const l=t.getBoundingClientRect();const{left:h,top:d,width:u,height:f}=l;if(!a){e()}if(!u||!f){return}const p=pc(d);const b=pc(s.clientWidth-(h+u));const m=pc(s.clientHeight-(d+f));const g=pc(h);const w=-p+"px "+-b+"px "+-m+"px "+-g+"px";const v={rootMargin:w,threshold:uc(0,dc(1,c))||1};let y=true;function k(e){const n=e[0].intersectionRatio;if(n!==c){if(!y){return o()}if(!n){i=setTimeout((()=>{o(false,1e-7)}),1e3)}else{o(false,n)}}if(n===1&&!oh(l,t.getBoundingClientRect())){o()}y=false}try{n=new IntersectionObserver(k,{...v,root:s.ownerDocument})}catch(t){n=new IntersectionObserver(k,v)}n.observe(t)}o(true);return r}function ch(t,e,n,i){if(i===void 0){i={}}const{ancestorScroll:s=true,ancestorResize:r=true,elementResize:o=typeof ResizeObserver==="function",layoutShift:a=typeof IntersectionObserver==="function",animationFrame:c=false}=i;const l=Ol(t);const h=s||r?[...l?Pl(l):[],...Pl(e)]:[];h.forEach((t=>{s&&t.addEventListener("scroll",n,{passive:true});r&&t.addEventListener("resize",n)}));const d=l&&a?ah(l,n):null;let u=-1;let f=null;if(o){f=new ResizeObserver((t=>{let[i]=t;if(i&&i.target===l&&f){f.unobserve(e);cancelAnimationFrame(u);u=requestAnimationFrame((()=>{var t;(t=f)==null||t.observe(e)}))}n()}));if(l&&!c){f.observe(l)}f.observe(e)}let p;let b=c?Wl(t):null;if(c){m()}function m(){const e=Wl(t);if(b&&!oh(b,e)){n()}b=e;p=requestAnimationFrame(m)}n();return()=>{var t;h.forEach((t=>{s&&t.removeEventListener("scroll",n);r&&t.removeEventListener("resize",n)}));d==null||d();(t=f)==null||t.disconnect();f=null;if(c){cancelAnimationFrame(p)}}}const lh=el;Kc;const hh=nl;const dh=Fc;const uh=sl;Yc;const fh=Jc;Zc;il;const ph=(t,e,n)=>{const i=new Map;const s={platform:rh,...n};const r={...s.platform,_c:i};return Hc(t,e,{...s,platform:r})};
|
|
180
180
|
/**
|
|
181
181
|
* @license
|
|
182
182
|
* Copyright 2017 Google LLC
|
|
@@ -201,12 +201,12 @@ import{d as t,r as e,h as n,H as i,e as s,f as r,w as o,i as a,j as c,k as l}fro
|
|
|
201
201
|
<slot></slot>
|
|
202
202
|
${this.arrow?ca`<div part="arrow" class="popup__arrow" role="presentation"></div>`:""}
|
|
203
203
|
</div>
|
|
204
|
-
`}};Sh.styles=[Qa,Ua];st([rc(".popup")],Sh.prototype,"popup",2);st([rc(".popup__arrow")],Sh.prototype,"arrowEl",2);st([nc()],Sh.prototype,"anchor",2);st([nc({type:Boolean,reflect:true})],Sh.prototype,"active",2);st([nc({reflect:true})],Sh.prototype,"placement",2);st([nc({reflect:true})],Sh.prototype,"strategy",2);st([nc({type:Number})],Sh.prototype,"distance",2);st([nc({type:Number})],Sh.prototype,"skidding",2);st([nc({type:Boolean})],Sh.prototype,"arrow",2);st([nc({attribute:"arrow-placement"})],Sh.prototype,"arrowPlacement",2);st([nc({attribute:"arrow-padding",type:Number})],Sh.prototype,"arrowPadding",2);st([nc({type:Boolean})],Sh.prototype,"flip",2);st([nc({attribute:"flip-fallback-placements",converter:{fromAttribute:t=>t.split(" ").map((t=>t.trim())).filter((t=>t!=="")),toAttribute:t=>t.join(" ")}})],Sh.prototype,"flipFallbackPlacements",2);st([nc({attribute:"flip-fallback-strategy"})],Sh.prototype,"flipFallbackStrategy",2);st([nc({type:Object})],Sh.prototype,"flipBoundary",2);st([nc({attribute:"flip-padding",type:Number})],Sh.prototype,"flipPadding",2);st([nc({type:Boolean})],Sh.prototype,"shift",2);st([nc({type:Object})],Sh.prototype,"shiftBoundary",2);st([nc({attribute:"shift-padding",type:Number})],Sh.prototype,"shiftPadding",2);st([nc({attribute:"auto-size"})],Sh.prototype,"autoSize",2);st([nc()],Sh.prototype,"sync",2);st([nc({type:Object})],Sh.prototype,"autoSizeBoundary",2);st([nc({attribute:"auto-size-padding",type:Number})],Sh.prototype,"autoSizePadding",2);st([nc({attribute:"hover-bridge",type:Boolean})],Sh.prototype,"hoverBridge",2);var _h=new Map;var Eh=new WeakMap;function Ah(t){return t!=null?t:{keyframes:[],options:{duration:0}}}function Ch(t,e){if(e.toLowerCase()==="rtl"){return{keyframes:t.rtlKeyframes||t.keyframes,options:t.options}}return t}function
|
|
204
|
+
`}};Sh.styles=[Qa,Ua];st([rc(".popup")],Sh.prototype,"popup",2);st([rc(".popup__arrow")],Sh.prototype,"arrowEl",2);st([nc()],Sh.prototype,"anchor",2);st([nc({type:Boolean,reflect:true})],Sh.prototype,"active",2);st([nc({reflect:true})],Sh.prototype,"placement",2);st([nc({reflect:true})],Sh.prototype,"strategy",2);st([nc({type:Number})],Sh.prototype,"distance",2);st([nc({type:Number})],Sh.prototype,"skidding",2);st([nc({type:Boolean})],Sh.prototype,"arrow",2);st([nc({attribute:"arrow-placement"})],Sh.prototype,"arrowPlacement",2);st([nc({attribute:"arrow-padding",type:Number})],Sh.prototype,"arrowPadding",2);st([nc({type:Boolean})],Sh.prototype,"flip",2);st([nc({attribute:"flip-fallback-placements",converter:{fromAttribute:t=>t.split(" ").map((t=>t.trim())).filter((t=>t!=="")),toAttribute:t=>t.join(" ")}})],Sh.prototype,"flipFallbackPlacements",2);st([nc({attribute:"flip-fallback-strategy"})],Sh.prototype,"flipFallbackStrategy",2);st([nc({type:Object})],Sh.prototype,"flipBoundary",2);st([nc({attribute:"flip-padding",type:Number})],Sh.prototype,"flipPadding",2);st([nc({type:Boolean})],Sh.prototype,"shift",2);st([nc({type:Object})],Sh.prototype,"shiftBoundary",2);st([nc({attribute:"shift-padding",type:Number})],Sh.prototype,"shiftPadding",2);st([nc({attribute:"auto-size"})],Sh.prototype,"autoSize",2);st([nc()],Sh.prototype,"sync",2);st([nc({type:Object})],Sh.prototype,"autoSizeBoundary",2);st([nc({attribute:"auto-size-padding",type:Number})],Sh.prototype,"autoSizePadding",2);st([nc({attribute:"hover-bridge",type:Boolean})],Sh.prototype,"hoverBridge",2);var _h=new Map;var Eh=new WeakMap;function Ah(t){return t!=null?t:{keyframes:[],options:{duration:0}}}function Ch(t,e){if(e.toLowerCase()==="rtl"){return{keyframes:t.rtlKeyframes||t.keyframes,options:t.options}}return t}function zh(t,e){_h.set(t,Ah(e))}function Th(t,e,n){const i=Eh.get(t);if(i==null?void 0:i[e]){return Ch(i[e],n.dir)}const s=_h.get(e);if(s){return Ch(s,n.dir)}return{keyframes:[],options:{duration:0}}}function $h(t,e){return new Promise((n=>{function i(s){if(s.target===t){t.removeEventListener(e,i);n()}}t.addEventListener(e,i)}))}function Ph(t,e,n){return new Promise((i=>{if((n==null?void 0:n.duration)===Infinity){throw new Error("Promise-based animations must be finite.")}const s=t.animate(e,it(nt({},n),{duration:Ih()?0:n.duration}));s.addEventListener("cancel",i,{once:true});s.addEventListener("finish",i,{once:true})}))}function Ih(){const t=window.matchMedia("(prefers-reduced-motion: reduce)");return t.matches}function Rh(t){return Promise.all(t.getAnimations().map((t=>new Promise((e=>{t.cancel();requestAnimationFrame(e)})))))}function Oh(t,e){const n=nt({waitUntilFirstUpdate:false},e);return(e,i)=>{const{update:s}=e;const r=Array.isArray(t)?t:[t];e.update=function(t){r.forEach((e=>{const s=e;if(t.has(s)){const e=t.get(s);const r=this[s];if(e!==r){if(!n.waitUntilFirstUpdate||this.hasUpdated){this[i](e,r)}}}}));s.call(this,t)}}}
|
|
205
205
|
/**
|
|
206
206
|
* @license
|
|
207
207
|
* Copyright 2018 Google LLC
|
|
208
208
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
209
|
-
*/const Dh=t=>t??ha;var jh=class extends ac{constructor(){super(...arguments);this.localize=new Za(this);this.open=false;this.placement="bottom-start";this.disabled=false;this.stayOpenOnSelect=false;this.distance=0;this.skidding=0;this.hoist=false;this.sync=void 0;this.handleKeyDown=t=>{if(this.open&&t.key==="Escape"){t.stopPropagation();this.hide();this.focusOnTrigger()}};this.handleDocumentKeyDown=t=>{var e;if(t.key==="Escape"&&this.open&&!this.closeWatcher){t.stopPropagation();this.focusOnTrigger();this.hide();return}if(t.key==="Tab"){if(this.open&&((e=document.activeElement)==null?void 0:e.tagName.toLowerCase())==="sl-menu-item"){t.preventDefault();this.hide();this.focusOnTrigger();return}const n=(t,e)=>{if(!t)return null;const i=t.closest(e);if(i)return i;const s=t.getRootNode();if(s instanceof ShadowRoot){return n(s.host,e)}return null};setTimeout((()=>{var t;const e=((t=this.containingElement)==null?void 0:t.getRootNode())instanceof ShadowRoot?Pa():document.activeElement;if(!this.containingElement||n(e,this.containingElement.tagName.toLowerCase())!==this.containingElement){this.hide()}}))}};this.handleDocumentMouseDown=t=>{const e=t.composedPath();if(this.containingElement&&!e.includes(this.containingElement)){this.hide()}};this.handlePanelSelect=t=>{const e=t.target;if(!this.stayOpenOnSelect&&e.tagName.toLowerCase()==="sl-menu"){this.hide();this.focusOnTrigger()}}}connectedCallback(){super.connectedCallback();if(!this.containingElement){this.containingElement=this}}firstUpdated(){this.panel.hidden=!this.open;if(this.open){this.addOpenListeners();this.popup.active=true}}disconnectedCallback(){super.disconnectedCallback();this.removeOpenListeners();this.hide()}focusOnTrigger(){const t=this.trigger.assignedElements({flatten:true})[0];if(typeof(t==null?void 0:t.focus)==="function"){t.focus()}}getMenu(){return this.panel.assignedElements({flatten:true}).find((t=>t.tagName.toLowerCase()==="sl-menu"))}handleTriggerClick(){if(this.open){this.hide()}else{this.show();this.focusOnTrigger()}}async handleTriggerKeyDown(t){if([" ","Enter"].includes(t.key)){t.preventDefault();this.handleTriggerClick();return}const e=this.getMenu();if(e){const n=e.getAllItems();const i=n[0];const s=n[n.length-1];if(["ArrowDown","ArrowUp","Home","End"].includes(t.key)){t.preventDefault();if(!this.open){this.show();await this.updateComplete}if(n.length>0){this.updateComplete.then((()=>{if(t.key==="ArrowDown"||t.key==="Home"){e.setCurrentItem(i);i.focus()}if(t.key==="ArrowUp"||t.key==="End"){e.setCurrentItem(s);s.focus()}}))}}}}handleTriggerKeyUp(t){if(t.key===" "){t.preventDefault()}}handleTriggerSlotChange(){this.updateAccessibleTrigger()}updateAccessibleTrigger(){const t=this.trigger.assignedElements({flatten:true});const e=t.find((t=>La(t).start));let n;if(e){switch(e.tagName.toLowerCase()){case"sl-button":case"sl-icon-button":n=e.button;break;default:n=e}n.setAttribute("aria-haspopup","true");n.setAttribute("aria-expanded",this.open?"true":"false")}}async show(){if(this.open){return void 0}this.open=true;return $h(this,"sl-after-show")}async hide(){if(!this.open){return void 0}this.open=false;return $h(this,"sl-after-hide")}reposition(){this.popup.reposition()}addOpenListeners(){var t;this.panel.addEventListener("sl-select",this.handlePanelSelect);if("CloseWatcher"in window){(t=this.closeWatcher)==null?void 0:t.destroy();this.closeWatcher=new CloseWatcher;this.closeWatcher.onclose=()=>{this.hide();this.focusOnTrigger()}}else{this.panel.addEventListener("keydown",this.handleKeyDown)}document.addEventListener("keydown",this.handleDocumentKeyDown);document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){var t;if(this.panel){this.panel.removeEventListener("sl-select",this.handlePanelSelect);this.panel.removeEventListener("keydown",this.handleKeyDown)}document.removeEventListener("keydown",this.handleDocumentKeyDown);document.removeEventListener("mousedown",this.handleDocumentMouseDown);(t=this.closeWatcher)==null?void 0:t.destroy()}async handleOpenChange(){if(this.disabled){this.open=false;return}this.updateAccessibleTrigger();if(this.open){this.emit("sl-show");this.addOpenListeners();await Rh(this);this.panel.hidden=false;this.popup.active=true;const{keyframes:t,options:e}=
|
|
209
|
+
*/const Dh=t=>t??ha;var jh=class extends ac{constructor(){super(...arguments);this.localize=new Za(this);this.open=false;this.placement="bottom-start";this.disabled=false;this.stayOpenOnSelect=false;this.distance=0;this.skidding=0;this.hoist=false;this.sync=void 0;this.handleKeyDown=t=>{if(this.open&&t.key==="Escape"){t.stopPropagation();this.hide();this.focusOnTrigger()}};this.handleDocumentKeyDown=t=>{var e;if(t.key==="Escape"&&this.open&&!this.closeWatcher){t.stopPropagation();this.focusOnTrigger();this.hide();return}if(t.key==="Tab"){if(this.open&&((e=document.activeElement)==null?void 0:e.tagName.toLowerCase())==="sl-menu-item"){t.preventDefault();this.hide();this.focusOnTrigger();return}const n=(t,e)=>{if(!t)return null;const i=t.closest(e);if(i)return i;const s=t.getRootNode();if(s instanceof ShadowRoot){return n(s.host,e)}return null};setTimeout((()=>{var t;const e=((t=this.containingElement)==null?void 0:t.getRootNode())instanceof ShadowRoot?Pa():document.activeElement;if(!this.containingElement||n(e,this.containingElement.tagName.toLowerCase())!==this.containingElement){this.hide()}}))}};this.handleDocumentMouseDown=t=>{const e=t.composedPath();if(this.containingElement&&!e.includes(this.containingElement)){this.hide()}};this.handlePanelSelect=t=>{const e=t.target;if(!this.stayOpenOnSelect&&e.tagName.toLowerCase()==="sl-menu"){this.hide();this.focusOnTrigger()}}}connectedCallback(){super.connectedCallback();if(!this.containingElement){this.containingElement=this}}firstUpdated(){this.panel.hidden=!this.open;if(this.open){this.addOpenListeners();this.popup.active=true}}disconnectedCallback(){super.disconnectedCallback();this.removeOpenListeners();this.hide()}focusOnTrigger(){const t=this.trigger.assignedElements({flatten:true})[0];if(typeof(t==null?void 0:t.focus)==="function"){t.focus()}}getMenu(){return this.panel.assignedElements({flatten:true}).find((t=>t.tagName.toLowerCase()==="sl-menu"))}handleTriggerClick(){if(this.open){this.hide()}else{this.show();this.focusOnTrigger()}}async handleTriggerKeyDown(t){if([" ","Enter"].includes(t.key)){t.preventDefault();this.handleTriggerClick();return}const e=this.getMenu();if(e){const n=e.getAllItems();const i=n[0];const s=n[n.length-1];if(["ArrowDown","ArrowUp","Home","End"].includes(t.key)){t.preventDefault();if(!this.open){this.show();await this.updateComplete}if(n.length>0){this.updateComplete.then((()=>{if(t.key==="ArrowDown"||t.key==="Home"){e.setCurrentItem(i);i.focus()}if(t.key==="ArrowUp"||t.key==="End"){e.setCurrentItem(s);s.focus()}}))}}}}handleTriggerKeyUp(t){if(t.key===" "){t.preventDefault()}}handleTriggerSlotChange(){this.updateAccessibleTrigger()}updateAccessibleTrigger(){const t=this.trigger.assignedElements({flatten:true});const e=t.find((t=>La(t).start));let n;if(e){switch(e.tagName.toLowerCase()){case"sl-button":case"sl-icon-button":n=e.button;break;default:n=e}n.setAttribute("aria-haspopup","true");n.setAttribute("aria-expanded",this.open?"true":"false")}}async show(){if(this.open){return void 0}this.open=true;return $h(this,"sl-after-show")}async hide(){if(!this.open){return void 0}this.open=false;return $h(this,"sl-after-hide")}reposition(){this.popup.reposition()}addOpenListeners(){var t;this.panel.addEventListener("sl-select",this.handlePanelSelect);if("CloseWatcher"in window){(t=this.closeWatcher)==null?void 0:t.destroy();this.closeWatcher=new CloseWatcher;this.closeWatcher.onclose=()=>{this.hide();this.focusOnTrigger()}}else{this.panel.addEventListener("keydown",this.handleKeyDown)}document.addEventListener("keydown",this.handleDocumentKeyDown);document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){var t;if(this.panel){this.panel.removeEventListener("sl-select",this.handlePanelSelect);this.panel.removeEventListener("keydown",this.handleKeyDown)}document.removeEventListener("keydown",this.handleDocumentKeyDown);document.removeEventListener("mousedown",this.handleDocumentMouseDown);(t=this.closeWatcher)==null?void 0:t.destroy()}async handleOpenChange(){if(this.disabled){this.open=false;return}this.updateAccessibleTrigger();if(this.open){this.emit("sl-show");this.addOpenListeners();await Rh(this);this.panel.hidden=false;this.popup.active=true;const{keyframes:t,options:e}=Th(this,"dropdown.show",{dir:this.localize.dir()});await Ph(this.popup.popup,t,e);this.emit("sl-after-show")}else{this.emit("sl-hide");this.removeOpenListeners();await Rh(this);const{keyframes:t,options:e}=Th(this,"dropdown.hide",{dir:this.localize.dir()});await Ph(this.popup.popup,t,e);this.panel.hidden=true;this.popup.active=false;this.emit("sl-after-hide")}}render(){return ca`
|
|
210
210
|
<sl-popup
|
|
211
211
|
part="base"
|
|
212
212
|
exportparts="popup:base__popup"
|
|
@@ -237,7 +237,7 @@ import{d as t,r as e,h as n,H as i,e as s,f as r,w as o,i as a,j as c,k as l}fro
|
|
|
237
237
|
<slot part="panel" class="dropdown__panel"></slot>
|
|
238
238
|
</div>
|
|
239
239
|
</sl-popup>
|
|
240
|
-
`}};jh.styles=[Qa,
|
|
240
|
+
`}};jh.styles=[Qa,Ta];jh.dependencies={"sl-popup":Sh};st([rc(".dropdown")],jh.prototype,"popup",2);st([rc(".dropdown__trigger")],jh.prototype,"trigger",2);st([rc(".dropdown__panel")],jh.prototype,"panel",2);st([nc({type:Boolean,reflect:true})],jh.prototype,"open",2);st([nc({reflect:true})],jh.prototype,"placement",2);st([nc({type:Boolean,reflect:true})],jh.prototype,"disabled",2);st([nc({attribute:"stay-open-on-select",type:Boolean,reflect:true})],jh.prototype,"stayOpenOnSelect",2);st([nc({attribute:false})],jh.prototype,"containingElement",2);st([nc({type:Number})],jh.prototype,"distance",2);st([nc({type:Number})],jh.prototype,"skidding",2);st([nc({type:Boolean})],jh.prototype,"hoist",2);st([nc({reflect:true})],jh.prototype,"sync",2);st([Oh("open",{waitUntilFirstUpdate:true})],jh.prototype,"handleOpenChange",1);zh("dropdown.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}});zh("dropdown.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}});jh.define("sl-dropdown");var Lh=So`
|
|
241
241
|
:host {
|
|
242
242
|
display: block;
|
|
243
243
|
position: relative;
|
|
@@ -542,7 +542,7 @@ import{d as t,r as e,h as n,H as i,e as s,f as r,w as o,i as a,j as c,k as l}fro
|
|
|
542
542
|
${this.submenuController.renderSubmenu()}
|
|
543
543
|
${this.loading?ca` <sl-spinner part="spinner" exportparts="base:spinner__base"></sl-spinner> `:""}
|
|
544
544
|
</div>
|
|
545
|
-
`}};yd.styles=[Qa,Wh];yd.dependencies={"sl-icon":vd,"sl-popup":Sh,"sl-spinner":ed};st([rc("slot:not([name])")],yd.prototype,"defaultSlot",2);st([rc(".menu-item")],yd.prototype,"menuItem",2);st([nc()],yd.prototype,"type",2);st([nc({type:Boolean,reflect:true})],yd.prototype,"checked",2);st([nc()],yd.prototype,"value",2);st([nc({type:Boolean,reflect:true})],yd.prototype,"loading",2);st([nc({type:Boolean,reflect:true})],yd.prototype,"disabled",2);st([Oh("checked")],yd.prototype,"handleCheckedChange",1);st([Oh("disabled")],yd.prototype,"handleDisabledChange",1);st([Oh("type")],yd.prototype,"handleTypeChange",1);yd.define("sl-menu-item");const kd="button.main {\n display: flex;\n transition:\n width 200ms,\n background-color 500ms,\n color 500ms,\n border-color 500ms;\n max-width: var(--size-40);\n flex-direction: row;\n overflow: hidden;\n height: var(--pos-navigation-bar-height);\n width: var(--pos-navigation-bar-height);\n align-items: center;\n justify-content: center;\n border-radius: var(--radius-md);\n color: var(--pos-subtle-text-color);\n border: var(--size-px) dashed var(--pos-subtle-text-color);\n background-color: var(--pos-background-color);\n\n p {\n padding: 0;\n margin: 0;\n display: none;\n white-space: nowrap;\n }\n\n &.success {\n color: var(--color-green-700);\n border-color: var(--color-green-700);\n border-style: solid;\n background-color: var(--color-green-100);\n }\n\n &:active {\n transform: scale(0.99);\n filter: brightness(90%);\n }\n &:focus {\n outline: var(--pos-input-focus-outline);\n }\n}\n\nsvg {\n display: inline-block;\n height: var(--size-6);\n flex-shrink: 0;\n flex-grow: 0;\n width: var(--size-6);\n}\n\nbutton.main:hover,\nsl-dropdown[open] button {\n &.success {\n background: var(--color-green-200);\n color: var(--color-green-700);\n }\n width: var(--size-full);\n height: var(--pos-navigation-bar-height);\n background: var(--pos-background-color);\n color: var(--pos-normal-text-color);\n\n p {\n display: inline-block;\n }\n}\n";const xd=kd;const Sd=class{constructor(t){e(this,t);this.subscribePodOs=a(this,"pod-os:init",7);this.errorEmitter=a(this,"pod-os:error",7);this.indexUpdatedEmitter=a(this,"pod-os:search:index-updated",7);this.indexCreatedEmitter=a(this,"pod-os:search:index-created",7);this.indexes=[];this.showOptions=false;this.isIndexed=false;this.receivePodOs=async t=>{this.os=t;this.thing=this.os.store.get(this.uri);this.getLabelIndexes(M.state.profile);this.unsubscribeSessionChange=M.onChange("profile",(t=>{this.getLabelIndexes(t)}))}}componentWillLoad(){B(this)}disconnectedCallback(){this.unsubscribeSessionChange&&this.unsubscribeSessionChange()}updateUri(t){this.thing=this.os.store.get(t);this.isIndexed=this.checkIfIndexed(t)}checkIfIndexed(t){return this.indexes.some((e=>e.contains(t)))}getLabelIndexes(t){if(t){this.indexes=t.getPrivateLabelIndexes().map((t=>this.os.store.get(t).assume(N)));this.showOptions=this.indexes.length>1;this.isIndexed=this.checkIfIndexed(this.uri)}}async onClick(t){t.preventDefault();if(this.indexes.length===1){const t=this.indexes[0];await this.addToLabelIndex(t);this.indexUpdatedEmitter.emit(t)}else if(this.indexes.length===0){const t=await this.createDefaultLabelIndex();await this.addToLabelIndex(t);this.indexCreatedEmitter.emit(t)}}async addToLabelIndex(t){try{await this.os.addToLabelIndex(this.thing,t);this.isIndexed=true}catch(t){this.errorEmitter.emit(t)}}async createDefaultLabelIndex(){try{return await this.os.createDefaultLabelIndex(M.state.profile)}catch(t){this.errorEmitter.emit(t)}}render(){if(!M.state.isLoggedIn||!this.uri){return null}const t="Make this findable";const e=n("button",{type:"button",slot:"trigger","aria-label":t,class:{main:true,success:this.isIndexed},onClick:t=>this.onClick(t),title:""},this.isIndexed?n(Ed,null):n(_d,null),n("p",null,t));if(this.showOptions){return n(i,null,n("sl-dropdown",null,e,n("sl-menu",{role:"listbox"},this.indexes.map((t=>n("sl-menu-item",{role:"option",value:t,type:"checkbox",checked:t.contains(this.uri)},n("pos-resource",{uri:t.uri,lazy:true},n("pos-label",null))))))))}else{return e}}async onSelect(t){const e=t.detail.item.value;t.preventDefault();await this.addToLabelIndex(e);this.indexUpdatedEmitter.emit(e)}get el(){return s(this)}static get watchers(){return{uri:["updateUri"]}}};const _d=()=>n("svg",{role:"presentation",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},n("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m5.231 13.481L15 17.25m-4.5-15H5.625c-.621 0-1.125.504-1.125 1.125v16.5c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Zm3.75 11.625a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z"}));const Ed=()=>n("svg",{role:"presentation",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},n("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M10.125 2.25h-4.5c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125v-9M10.125 2.25h.375a9 9 0 0 1 9 9v.375M10.125 2.25A3.375 3.375 0 0 1 13.5 5.625v1.5c0 .621.504 1.125 1.125 1.125h1.5a3.375 3.375 0 0 1 3.375 3.375M9 15l2.25 2.25L15 12"}));Sd.style=xd;const Ad=":host {\n --pos-navigation-bar-height: var(--size-10);\n}\n\nsearch {\n position: relative;\n}\n\n.suggestions ol {\n border: 1px solid var(--pos-border-color);\n display: flex;\n flex-direction: column;\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n\n.suggestions {\n width: 100%;\n overflow-y: auto;\n max-height: 90dvh;\n li {\n padding: 1rem;\n background-color: var(--pos-background-color);\n pos-rich-link {\n --background-color: inherit;\n }\n &[aria-selected='true'] {\n background-color: var(--pos-primary-color);\n &:hover {\n background-color: var(--pos-primary-color);\n }\n }\n &:hover {\n background-color: var(--pos-border-color);\n }\n }\n}\n\n.suggestions li.selected pos-rich-link {\n --label-color: white;\n --description-color: var(--pos-border-color);\n --uri-color: var(--pos-subtle-text-color);\n}\n\ndialog {\n position: absolute;\n margin-top: calc(-1 * var(--pos-navigation-bar-height));\n padding: 0;\n width: 100%;\n max-width: 100%;\n min-width: 100%;\n overflow: hidden;\n max-height: 100dvh;\n background-color: var(--pos-background-color);\n color: var(--pos-normal-text-color);\n border: var(--pos-border-color);\n border-radius: var(--radius-md);\n box-shadow: var(--shadow-md);\n form {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n align-items: center;\n input {\n display: flex;\n font-size: var(--scale-1);\n height: var(--pos-navigation-bar-height);\n border-top-left-radius: var(--radius-md);\n border-top-right-radius: var(--radius-md);\n padding-left: var(--size-2);\n width: 100%;\n border: none;\n outline: none;\n color: var(--pos-normal-text-color);\n background-color: var(--pos-input-background-color);\n box-sizing: border-box;\n }\n }\n}\n\ndialog[open] {\n display: flex;\n z-index: var(--layer-top);\n animation: slideIn 100ms ease-out;\n}\n\n@media (max-width: 640px) {\n search {\n position: unset;\n }\n dialog {\n margin-top: var(--size-1);\n top: 0;\n width: 95dvw;\n max-width: unset;\n min-width: unset;\n form {\n input {\n height: var(--size-12);\n font-size: var(--scale-fluid-3);\n }\n }\n }\n}\n\n@keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n";const Cd=Ad;const Td=class{constructor(t){e(this,t);this.subscribePodOs=a(this,"pod-os:init",7);this.linkEmitter=a(this,"pod-os:link",7);this.uri="";this.inputValue=this.uri;this.searchIndex=undefined;this.suggestions=[];this.selectedIndex=-1;this.resource=null;this.changeEvents=new Ln;this.debouncedSearch=null;this.receivePodOs=async t=>{this.os=t}}updateResource(){var t;try{this.resource=this.uri?(t=this.os)===null||t===void 0?void 0:t.store.get(this.uri):null}catch(t){this.resource=null}}componentWillLoad(){B(this);this.updateResource();M.onChange("isLoggedIn",(async t=>{if(t){await this.buildSearchIndex()}else{this.clearSearchIndex()}}));this.debouncedSearch=this.changeEvents.pipe(mi(300)).subscribe((()=>this.search()))}disconnectedCallback(){var t;(t=this.debouncedSearch)===null||t===void 0?void 0:t.unsubscribe()}async buildSearchIndex(){this.searchIndex=await this.os.buildSearchIndex(M.state.profile)}rebuildSearchIndex(){this.searchIndex.rebuild()}openNavigationDialog(t){var e,n;this.resource=t.detail;if(t.detail){this.inputValue=t.detail.uri;this.search()}(e=this.inputRef)===null||e===void 0?void 0:e.select();(n=this.dialogRef)===null||n===void 0?void 0:n.show()}clearSearchIndex(){var t;(t=this.searchIndex)===null||t===void 0?void 0:t.clear()}onChange(t){this.inputValue=t.target.value;this.changeEvents.next()}closeDialog(){var t;(t=this.dialogRef)===null||t===void 0?void 0:t.close();this.selectedIndex=-1}clearSuggestions(){var t;this.suggestions=[];(t=this.dialogRef)===null||t===void 0?void 0:t.close();this.selectedIndex=-1}onClickSelf(t){t.stopPropagation()}handleKeyDown(t){if(t.key==="Escape"){this.closeDialog()}else if(t.key==="ArrowDown"){t.preventDefault();this.selectedIndex=Math.min(this.selectedIndex+1,this.suggestions.length-1)}else if(t.key==="ArrowUp"){t.preventDefault();this.selectedIndex=Math.max(this.selectedIndex-1,0)}}search(){if(this.searchIndex){this.suggestions=this.inputValue?this.searchIndex.search(this.inputValue):[]}}onSubmit(){if(this.suggestions&&this.selectedIndex>-1){this.linkEmitter.emit(this.suggestions[this.selectedIndex].ref)}else{this.linkEmitter.emit(this.inputValue)}}render(){return n("nav",{key:"75fef6f1c6fd945150ebb4123a2cce80537c46e1"},n("search",{key:"eb81710c97b1edcc9295050585e14b505cc4e9ca"},n("pos-navigation-bar",{key:"5566254cee17f0ebc923b61f08d0765f2e51db08",searchIndexReady:this.searchIndex!==undefined,current:this.resource}),n("dialog",{key:"bed472296c931b2409094b9d3d5ca875b262b4b2",ref:t=>this.dialogRef=t},n("form",{key:"1bfbb8191a04fc215da7250ef533f8c7cb65fca9",method:"dialog",onSubmit:()=>this.onSubmit()},n("input",{key:"532bdbabb64164b879d60e5f7f944dc79eebeb2b",ref:t=>this.inputRef=t,enterkeyhint:"search","aria-label":"Search or enter URI",placeholder:"Search or enter URI",value:this.uri,onChange:t=>this.onChange(t),onInput:t=>this.onChange(t),role:"combobox","aria-autocomplete":"list","aria-expanded":this.suggestions.length>0,"aria-controls":"suggestions-list","aria-activedescendant":this.selectedIndex>=0?`option-${this.selectedIndex}`:null}),this.suggestions.length>0?n("div",{class:"suggestions"},n("ol",{id:"suggestions-list",role:"listbox","aria-label":"Search results"},this.suggestions.map(((t,e)=>n("li",{id:`option-${e}`,role:"option","aria-selected":e===this.selectedIndex?"true":"false"},n("pos-rich-link",{uri:t.ref})))))):null))))}static get watchers(){return{uri:["updateResource"],os:["updateResource"]}}};Td.style=Cd;const zd="section.current {\n display: flex;\n height: var(--pos-navigation-bar-height);\n flex-grow: 1;\n gap: 0;\n background-color: var(--pos-input-background-color);\n border-radius: var(--radius-md);\n width: 100%;\n &:focus-within {\n outline: var(--pos-input-focus-outline);\n }\n}\n\nsection.current button {\n cursor: pointer;\n font-size: var(--scale-1);\n display: flex;\n align-items: center;\n justify-content: center;\n flex-grow: 1;\n background: none;\n color: var(--pos-normal-text-color);\n outline: none;\n border: none;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n &:focus {\n text-decoration: underline;\n }\n :first-child {\n flex-grow: 1;\n }\n svg {\n width: var(--size-6);\n color: var(--pos-subtle-text-color);\n }\n}\n";const $d=zd;const Pd=class{constructor(t){e(this,t);this.navigate=a(this,"pod-os:navigate",7)}onClick(){this.navigate.emit(this.current)}activate(t){if((t.ctrlKey||t.metaKey)&&t.key==="k"){t.preventDefault();this.navigate.emit(this.current)}}render(){const t=this.current?`${this.current.label()} (Click to search or enter URI)`:"Search or enter URI";return n("section",{key:"d8b48cc6908244bb35139ead157687f1a6f05bd7",class:"current"},this.current&&this.searchIndexReady&&n("pos-make-findable",{key:"215e525705b27a7a30de2f32a1bc57aba72652c2",uri:this.current.uri}),n("button",{key:"55b79e62adac3f10e8b9f5a514c5d4191af251d9","aria-label":t,onClick:()=>this.onClick()},n("div",{key:"7b1a9ebe7fb3c90ac3694826f3202ba4617925cb"},this.current?this.current.label():"Search or enter URI"),this.icon()))}icon(){return n("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},n("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"}))}};Pd.style=$d;const Id=":host{display:block}form{display:grid;grid-template-columns:var(--size-16) 1fr;grid-gap:var(--scale-0)}label{grid-column:1 / 2;display:flex;align-items:center;justify-content:flex-end}input,pos-select-term,button{grid-column:2 / 3}input,pos-select-term::part(input){outline:var(--pos-input-outline);padding:var(--scale-000);border:none;border-radius:var(--radius-xs);width:var(--size-full);box-sizing:border-box;background:var(--pos-input-background-color);color:var(--pos-normal-text-color)}input:focus-within,pos-select-term::part(input):focus-within{outline:var(--pos-input-focus-outline)}#new-uri{grid-column:1/3;cursor:default;word-break:break-all;color:var(--pos-normal-text-color);font-weight:var(--weight-light);background:var(--pos-disabled-color);padding:var(--scale-000);border-radius:var(--radius-xs)}input#create{outline:none;box-shadow:var(--shadow-sm);cursor:pointer;color:var(--pos-primary-text-color);background-color:var(--pos-primary-color)}input#create:disabled{cursor:default;color:var(--pos-disabled-text-color);background-color:var(--pos-disabled-color);box-shadow:none}input#create:hover:not(:disabled),input#create:focus{filter:brightness(110%);box-shadow:var(--shadow-md)}";const Rd=Id;const Od=class{constructor(t){e(this,t);this.linkEmitter=a(this,"pod-os:link",7);this.errorEmitter=a(this,"pod-os:error",7);this.subscribePodOs=a(this,"pod-os:init",7);this.canSubmit=false;this.receivePodOs=async t=>{this.os=t}}validate(){this.canSubmit=Boolean(this.name&&this.selectedTypeUri)}componentWillLoad(){B(this)}render(){return n("form",{key:"0d52a6b85338d0353876f0fde0a7ef45e5ebe104",method:"dialog",onSubmit:t=>this.handleSubmit(t)},n("label",{key:"6765ada99850150a6a1dc9135a6ec0c575e3066d",htmlFor:"type"},"Type"),n("pos-select-term",{key:"375ca79b6ffa3d363954578cf83d2eab10b0e486",id:"type",placeholder:"",value:this.selectedTypeUri,"onPod-os:term-selected":t=>this.onTermSelected(t)}),n("label",{key:"9da148cb532d236a5dc9ad73fc75e1bd2d277d17",htmlFor:"name"},"Name"),n("input",{key:"81b5a4bf51eb403bfebfa0c9e023935ddde48194",id:"name",type:"text",value:this.name,onInput:t=>this.handleChange(t)}),this.newUri?n("div",{id:"new-uri",title:"This will be the URI of the new thing"},this.newUri):null,n("input",{key:"5f4ff09818262ad875f80bce3a0f942b0428335f",id:"create",type:"submit",value:"Create",disabled:!this.canSubmit}))}handleChange(t){this.name=t.target.value;this.newUri=this.os.proposeUriForNewThing(this.referenceUri,this.name)}onTermSelected(t){this.selectedTypeUri=t.detail.uri}async handleSubmit(t){try{await this.os.addNewThing(this.newUri,this.name,this.selectedTypeUri);this.linkEmitter.emit(this.newUri);this.reset()}catch(e){t.preventDefault();this.errorEmitter.emit(e)}}reset(){this.name="";this.newUri="";this.selectedTypeUri=""}static get delegatesFocus(){return true}static get watchers(){return{name:["validate"],selectedTypeUri:["validate"]}}};Od.style=Rd;const Dd=":host{--width:300px;--height:300px;--border-radius:var(--border-radius, 0);--object-fit:var(--object-fit, cover)}";const jd=Dd;const Ld=class{constructor(t){e(this,t);this.subscribeResource=a(this,"pod-os:resource",7);this.blurredBackground=false;this.receiveResource=t=>{this.resource=t}}componentWillLoad(){J(this)}render(){const t=this.resource?this.resource.picture():null;if(!t)return n("slot",null);return n("pos-image",{blurredBackground:this.blurredBackground,src:t.url,alt:this.resource.label()})}};Ld.style=jd;const Md="details.error {\n margin: var(--size-2);\n background-color: var(--pos-error-background-color);\n border: var(--size-px) solid var(--pos-error-border-color);\n padding: var(--size-2);\n border-radius: var(--radius-md);\n\n a {\n color: var(--pos-normal-text-color);\n }\n}\n";const Wd=Md;const Ud=class{constructor(t){e(this,t);this.subscribePodOs=a(this,"pod-os:init",7);this.resourceLoadedEmitter=a(this,"pod-os:resource-loaded",7);this.consumers=[];this.lazy=false;this.loading=true;this.receivePodOs=async t=>{this.os=t}}componentWillLoad(){M.onChange("isLoggedIn",(()=>this.loadResource()));B(this)}async provideResource(t){t.stopPropagation();if(this.resource){t.detail(this.resource)}this.consumers.push(t)}async loadResource(){await this.getResource(!this.lazy)}async fetch(){await this.getResource(true)}async getResource(t=false){try{if(t){this.loading=true;await this.os.fetch(this.uri);this.resourceLoadedEmitter.emit(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=false}}render(){if(this.loading){return n("ion-progress-bar",{type:"indeterminate"})}if(this.error){return n("details",{class:"error"},n("summary",{title:"Click to expand"},"⚠ Sorry, something went wrong"),n("p",null,"Status:",this.error.status),n("p",null,this.error.message),n("p",null,"You can try to open the link outside PodOS: ",n("a",{href:this.uri},this.uri)))}return n("slot",null)}static get watchers(){return{os:["loadResource"],uri:["loadResource"]}}};Ud.style=Wd;const Hd=":host {\n --background-color: inherit;\n --label-color: var(--pos-normal-text-color);\n --description-color: var(--pos-normal-text-color);\n --uri-color: var(--pos-subtle-text-color);\n --font-family: var(--font-sans);\n}\n\np.content {\n background-color: var(--background-color);\n line-height: var(--line-xs);\n margin: 0;\n display: flex;\n flex-direction: column;\n align-items: baseline;\n gap: var(--size-1);\n\n .url {\n font-size: var(--scale-fluid-1);\n color: var(--pos-subtle-text-color);\n }\n}\n\na {\n color: var(--label-color);\n max-width: min(100%, var(--prose-lg));\n text-decoration: underline;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n text-decoration-thickness: var(--size-px);\n}\n\npos-label {\n color: var(--label-color);\n font-size: var(--scale-fluid-2);\n margin-bottom: var(--size-1);\n}\n\npos-description {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n text-overflow: ellipsis;\n overflow: hidden;\n font-weight: var(--weight-light);\n color: var(--description-color);\n font-size: var(--scale-fluid-2);\n}\n\n@media (min-width: 640px) {\n pos-label {\n font-size: var(--scale-fluid-0);\n }\n pos-description {\n font-size: var(--scale-fluid-1);\n }\n\n p.content {\n .url {\n font-size: var(--scale-fluid-000);\n }\n }\n}\n";const Nd=Hd;const Jd=class{constructor(t){e(this,t);this.linkEmitter=a(this,"pod-os:link",7);this.subscribeResource=a(this,"pod-os:resource",7);this.errorEmitter=a(this,"pod-os:error",7);this.followPredicate=false;this.error=null;this.showCustomContent=false;this.receiveResource=t=>{const e=(t,e,n,i)=>{if(t.length==0){this.error="No matching link found";this.errorEmitter.emit(new Error(`pos-rich-link: No matching link found from ${e.uri} ${i}=${n}`))}else if(t[0].uris.length>1){this.error="More than one matching link found";this.errorEmitter.emit(new Error(`pos-rich-link: More than one matching link found from ${e.uri} ${i}=${n}`))}else{this.link=t[0].uris[0];this.followPredicate=true}};if(this.rel){e(t.relations(this.rel),t,this.rel,"rel")}else if(this.rev){e(t.reverseRelations(this.rev),t,this.rev,"rev")}else{this.link=t.uri}}}componentWillLoad(){this.showCustomContent=!!this.host.lastElementChild||this.host.textContent.trim()!="";if(!this.uri)J(this)}render(){const t=t=>this.showCustomContent?n("a",{href:t,onClick:e=>{e.preventDefault();this.linkEmitter.emit(t)}},n("slot",null)):n("p",{class:"content"},n("a",{href:t,onClick:e=>{e.preventDefault();this.linkEmitter.emit(t)}},n("pos-label",null)),n("span",{class:"url"},new URL(t).host),n("pos-description",null));if(this.error){return this.error}else if(this.followPredicate){return n("pos-resource",{lazy:true,uri:this.link},t(this.link))}else if(this.link){return t(this.link)}else if(this.uri){return n("pos-resource",{lazy:true,uri:this.uri},t(this.uri))}else{return null}}get host(){return s(this)}};Jd.style=Nd;const Bd=(t,e,n)=>{const i=t.get(e);if(!i){t.set(e,[n])}else if(!i.includes(n)){i.push(n)}};const Kd=(t,e)=>{let n;return(...i)=>{if(n){clearTimeout(n)}n=setTimeout((()=>{n=0;t(...i)}),e)}};const Fd=t=>!("isConnected"in t)||t.isConnected;const Xd=Kd((t=>{for(let e of t.keys()){t.set(e,t.get(e).filter(Fd))}}),2e3);const Vd=()=>{if(typeof c!=="function"){return{}}const t=new Map;return{dispose:()=>t.clear(),get:e=>{const n=c();if(n){Bd(t,e,n)}},set:e=>{const n=t.get(e);if(n){t.set(e,n.filter(l))}Xd(t)},reset:()=>{t.forEach((t=>t.forEach(l)));Xd(t)}}};const Yd=(t,e=((t,e)=>t!==e))=>{let n=new Map(Object.entries(t!==null&&t!==void 0?t:{}));const i={dispose:[],get:[],set:[],reset:[]};const s=()=>{n=new Map(Object.entries(t!==null&&t!==void 0?t:{}));i.reset.forEach((t=>t()))};const r=()=>{i.dispose.forEach((t=>t()));s()};const o=t=>{i.get.forEach((e=>e(t)));return n.get(t)};const a=(t,s)=>{const r=n.get(t);if(e(s,r,t)){n.set(t,s);i.set.forEach((e=>e(t,s,r)))}};const c=typeof Proxy==="undefined"?{}:new Proxy(t,{get(t,e){return o(e)},ownKeys(t){return Array.from(n.keys())},getOwnPropertyDescriptor(){return{enumerable:true,configurable:true}},has(t,e){return n.has(e)},set(t,e,n){a(e,n);return true}});const l=(t,e)=>{i[t].push(e);return()=>{qd(i[t],e)}};const h=(e,n)=>{const i=l("set",((t,i)=>{if(t===e){n(i)}}));const s=l("reset",(()=>n(t[e])));return()=>{i();s()}};const d=(...t)=>{const e=t.reduce(((t,e)=>{if(e.set){t.push(l("set",e.set))}if(e.get){t.push(l("get",e.get))}if(e.reset){t.push(l("reset",e.reset))}if(e.dispose){t.push(l("dispose",e.dispose))}return t}),[]);return()=>e.forEach((t=>t()))};const u=t=>{const e=n.get(t);i.set.forEach((n=>n(t,e,e)))};return{state:c,get:o,set:a,on:l,onChange:h,use:d,dispose:r,reset:s,forceUpdate:u}};const qd=(t,e)=>{const n=t.indexOf(e);if(n>=0){t[n]=t[t.length-1];t.length--}};const Gd=(t,e)=>{const n=Yd(t,e);n.use(Vd());return n};const Zd=t=>{var e;const n=window;const i=new URL(n.location.href);const s=(e=t===null||t===void 0?void 0:t.parseURL)!==null&&e!==void 0?e:tu;const{state:r,onChange:o,dispose:a}=Gd({url:i,activePath:s(i)},((t,e,n)=>{if(n==="url"){return t.href!==e.href}return t!==e}));const c=t=>{history.pushState(null,null,t);const e=new URL(t,document.baseURI);r.url=e;r.activePath=s(e)};const l=t=>{const{activePath:e}=r;for(let n of t){const i=Qd(e,n.path);if(i){if(n.to!=null){const i=typeof n.to==="string"?n.to:n.to(e);c(i);return l(t)}else{return{params:i,route:n}}}}return undefined};const h=()=>{const t=new URL(n.location.href);r.url=t;r.activePath=s(t)};const d=(t,e)=>{const n=l(e);if(n){if(typeof n.route.jsx==="function"){return n.route.jsx(n.params)}else{return n.route.jsx}}};const u=()=>{n.removeEventListener("popstate",h);a()};const f={Switch:d,get url(){return r.url},get activePath(){return r.activePath},push:c,onChange:o,dispose:u};h();n.addEventListener("popstate",h);return f};const Qd=(t,e)=>{if(typeof e==="string"){if(e===t){return{}}}else if(typeof e==="function"){const n=e(t);if(n){return n===true?{}:{...n}}}else{const n=e.exec(t);if(n){e.lastIndex=0;return{...n}}}return undefined};const tu=t=>t.pathname.toLowerCase();const eu=".toolbar{display:flex;flex-direction:row;gap:0;align-items:center;margin-left:0.5rem}pos-navigation{flex-grow:1}";const nu=eu;const iu=Zd();const su=class{constructor(t){e(this,t);this.routeChanged=a(this,"pod-os:route-changed",7);this.mode="standalone"}linkClicked(t){this.navigate(t.detail)}sessionRestored(t){iu.push(t.detail.url)}componentWillLoad(){this.updateUri();iu.onChange("url",(()=>{this.updateUri()}))}navigate(t){iu.push("?uri="+encodeURIComponent(t))}updateUri(){this.uri=new URLSearchParams(window.location.search).get("uri")||(this.mode==="standalone"?"pod-os:dashboard":window.location.href);this.routeChanged.emit(this.uri)}render(){return n("slot",{key:"5d39b495d0835298a50ff39ec55d83481764c376"})}};su.style=nu;const ru=":host{display:block}input{background-color:transparent;color:var(--pos-normal-text-color);border:none;padding-top:1rem;padding-bottom:1rem}input:focus{outline:none}";const ou=ru;const au=class{constructor(t){e(this,t);this.subscribePodOs=a(this,"pod-os:init",7);this.termSelected=a(this,"pod-os:term-selected",7);this.placeholder="Type to search...";this.value="";this.terms=[];this.receivePodOs=async t=>{this.os=t}}componentWillLoad(){B(this)}setTerms(){this.terms=this.os.listKnownTerms()}handleChange(t){this.termSelected.emit({uri:t.target.value})}render(){return n(i,{key:"19fcf00d5d0b45657e304307b52249d0d387a44a"},n("input",{key:"0ed3ff623d93a3b940a7615683aa4428e69da56f",part:"input",list:"terms",placeholder:this.placeholder,value:this.value,onChange:t=>this.handleChange(t)}),n("datalist",{key:"cc518b371003586cf9a4df1423bf3588666b3ebd",part:"terms",id:"terms"},this.terms.map((t=>n("option",{value:t.uri},t.shorthand)))))}static get delegatesFocus(){return true}static get watchers(){return{os:["setTerms"]}}};au.style=ou;const cu=":host{border:var(--size-px) solid var(--pos-border-color);border-radius:var(--radius-lg);box-shadow:var(--shadow-md);padding:var(--size-8);max-width:var(--size-96);background:var(--pos-card-background)}svg{width:var(--size-8)}h2{display:flex;align-items:center}p{padding:var(--size-2)}.info{color:var(--color-grey-900);background-color:var(--color-blue-200)}.warn{color:var(--color-grey-900);background-color:var(--color-yellow-200)}";const lu=cu;const hu=class{constructor(t){e(this,t)}render(){return n(i,{key:"f024e7d542cfc87a4dc0a1f22694b664086ebd60"},n("div",{key:"e88e694cefa4a2361ca8c67f1bd023fda1b70f2a"},n("h2",{key:"c4b2e6270f26a2eb7f62e5076b40834903fc10e4"},n("svg",{key:"d63643c1ed908c6fe9ab4ff6c47b13848c714c32",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},n("path",{key:"78f055556bb175ea17d0db1ccf78c16343d67d3f","stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"})),"Cache Settings"),n("p",{key:"3045ae3214b9e91feb34857ce45a3db6529f2959",class:"info"},"ℹ Enable offline cache to be able to access previously loaded data while offline."),n("p",{key:"9987c1cb59b62e1eb06c67a9c646a9a2f125529a",class:"warn"},"⚠ Private data may be stored on this device. Only enable it, if you trust this device."),n("label",{key:"55dd3c0fa7ece9a59437e7818d6cfa9b0e9eb5bf"},n("input",{key:"22874f8a39b5016b71818fa1d6226bf66ff969c3",type:"checkbox",checked:ge.state.offlineCache,onChange:t=>ge.state.offlineCache=t.target.checked}),"Enable offline cache")))}};hu.style=lu;vd.define("sl-icon");const du=":host {\n --button-size: var(--size-16);\n display: block;\n position: sticky;\n align-self: flex-start;\n top: 0;\n overflow: auto;\n min-width: var(--button-size);\n z-index: var(--layer-1);\n}\n\naside {\n display: flex;\n flex-direction: column;\n justify-content: center;\n\n button {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 0;\n font-size: var(--size-6);\n position: relative;\n overflow: hidden;\n outline: none;\n border: none;\n width: var(--button-size);\n min-width: var(--button-size);\n height: var(--button-size);\n min-height: var(--button-size);\n background-color: var(--pos-background-color);\n\n &::after {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n width: 0;\n height: 0;\n border-radius: 100%;\n background: color-mix(in srgb, var(--pos-primary-color), transparent 50%);\n transform: translate(-50%, -50%);\n opacity: 1;\n }\n\n &:active::after,\n &:focus::after {\n width: calc(var(--button-size) * 1.5);\n height: calc(var(--button-size) * 1.5);\n opacity: 0;\n transition:\n width 0.5s ease-out,\n height 0.5s ease-out,\n opacity 1s ease-out;\n }\n\n &[aria-selected] {\n border-right: var(--size-1) solid var(--pos-primary-color);\n }\n\n .text {\n font-size: var(--size-3);\n white-space: nowrap;\n text-overflow: ellipsis;\n width: 100%;\n overflow: hidden;\n }\n }\n}\n\n@media (max-width: 640px) {\n :host {\n position: fixed;\n top: unset;\n bottom: 0;\n width: 100dvw;\n }\n aside {\n flex-direction: row;\n background-color: var(--pos-background-color);\n\n button {\n &[aria-selected] {\n border-right: none;\n border-top: var(--size-1) solid var(--pos-primary-color);\n }\n }\n }\n}\n";const uu=du;const fu=class{constructor(t){e(this,t);this.toolSelected=a(this,"pod-os:tool-selected",7);this.tools=[]}render(){if(this.tools.length>1){return n("aside",null,this.tools.map((t=>{var e;return n("button",{role:"tab","aria-selected":((e=this.selected)===null||e===void 0?void 0:e.element)===t.element,onClick:()=>this.toolSelected.emit(t)},n("sl-icon",{name:t.icon}),n("span",{class:"text"},t.label))})))}return null}};fu.style=uu;const pu={Generic:{element:"pos-app-generic",label:"Data",icon:"list-ul",types:[]},RdfDocument:{element:"pos-app-rdf-document",label:"Things",icon:"diagram-2",types:[{uri:"http://www.w3.org/2007/ont/link#RDFDocument",priority:20}]},DocumentViewer:{element:"pos-app-document-viewer",label:"Doc",icon:"file-text",types:[{uri:bu("application/pdf"),priority:30},{uri:"http://www.w3.org/2007/ont/link#Document",priority:10}]},ImageViewer:{element:"pos-app-image-viewer",label:"Pic",icon:"file-image",types:[{uri:"http://purl.org/dc/terms/Image",priority:20}]},LdpContainer:{element:"pos-app-ldp-container",label:"Content",icon:"folder",types:[{uri:"http://www.w3.org/ns/ldp#Container",priority:30}]}};function bu(t){return"http://www.w3.org/ns/iana/media-types/"+t+"#Resource"}function mu(t){const e=new Set(t.map((t=>t.uri)));return Object.values(pu).map(gu(e)).filter(vu).toSorted(yu).map((t=>t.tool)).concat(pu.Generic)}const gu=t=>e=>({tool:e,priority:wu(e.types,t)});function wu(t,e){return t.filter((t=>e.has(t.uri))).reduce(((t,e)=>Math.max(t,e.priority)),0)}const vu=t=>t.priority>0;const yu=(t,e)=>e.priority-t.priority;const ku="section {\n display: flex;\n flex-direction: row;\n}\n\n.tools {\n position: relative;\n flex-grow: 1;\n}\n\n.tool {\n position: absolute;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n &.visible {\n animation: fadeIn 300ms ease-in;\n }\n &.hidden {\n animation: fadeOut 300ms ease-in;\n }\n}\n\n@keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n@keyframes fadeOut {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n}\n\n@media (max-width: 640px) {\n section {\n --toolbar-size: var(--size-16);\n flex-direction: column-reverse;\n padding-bottom: var(--toolbar-size);\n pos-tool-select {\n --button-size: var(--toolbar-size);\n }\n }\n}\n";const xu=ku;const Su=class{constructor(t){e(this,t);this.subscribeResource=a(this,"pod-os:resource",7);this.receiveResource=t=>{var e;const n=t.types();this.availableTools=mu(n);this.currentTool=(e=this.availableTools.find((t=>t.element===this.initialTool)))!==null&&e!==void 0?e:this.availableTools[0]}}componentWillLoad(){J(this);const t=new URLSearchParams(window.location.search);const e=t.get("tool");if(e){this.initialTool=e}}handleToolSelected(t){this.oldTool=this.currentTool;this.currentTool=t.detail;const e=new URL(window.location.href);e.searchParams.set("tool",t.detail.element);window.history.replaceState({},"",e.toString())}render(){return this.availableTools?this.renderApp():null}renderApp(){var t;const e=this.currentTool.element;const i=(t=this.oldTool)===null||t===void 0?void 0:t.element;return n("section",null,n("pos-tool-select",{selected:this.currentTool,tools:this.availableTools}),n("div",{class:"tools",onAnimationEnd:()=>this.removeOldTool()},i&&n(i,{class:"tool hidden"}),n(e,{class:"tool visible"})))}removeOldTool(){this.oldTool=null}};Su.style=xu;var _u=So`
|
|
545
|
+
`}};yd.styles=[Qa,Wh];yd.dependencies={"sl-icon":vd,"sl-popup":Sh,"sl-spinner":ed};st([rc("slot:not([name])")],yd.prototype,"defaultSlot",2);st([rc(".menu-item")],yd.prototype,"menuItem",2);st([nc()],yd.prototype,"type",2);st([nc({type:Boolean,reflect:true})],yd.prototype,"checked",2);st([nc()],yd.prototype,"value",2);st([nc({type:Boolean,reflect:true})],yd.prototype,"loading",2);st([nc({type:Boolean,reflect:true})],yd.prototype,"disabled",2);st([Oh("checked")],yd.prototype,"handleCheckedChange",1);st([Oh("disabled")],yd.prototype,"handleDisabledChange",1);st([Oh("type")],yd.prototype,"handleTypeChange",1);yd.define("sl-menu-item");const kd="button.main {\n display: flex;\n transition:\n width 200ms,\n background-color 500ms,\n color 500ms,\n border-color 500ms;\n max-width: var(--size-40);\n flex-direction: row;\n overflow: hidden;\n height: var(--pos-navigation-bar-height);\n width: var(--pos-navigation-bar-height);\n align-items: center;\n justify-content: center;\n border-radius: var(--radius-md);\n color: var(--pos-subtle-text-color);\n border: var(--size-px) dashed var(--pos-subtle-text-color);\n background-color: var(--pos-background-color);\n\n p {\n padding: 0;\n margin: 0;\n display: none;\n white-space: nowrap;\n }\n\n &.success {\n color: var(--color-green-700);\n border-color: var(--color-green-700);\n border-style: solid;\n background-color: var(--color-green-100);\n }\n\n &:active {\n transform: scale(0.99);\n filter: brightness(90%);\n }\n &:focus {\n outline: var(--pos-input-focus-outline);\n }\n}\n\nsvg {\n display: inline-block;\n height: var(--size-6);\n flex-shrink: 0;\n flex-grow: 0;\n width: var(--size-6);\n}\n\nbutton.main:hover,\nsl-dropdown[open] button {\n &.success {\n background: var(--color-green-200);\n color: var(--color-green-700);\n }\n width: var(--size-full);\n height: var(--pos-navigation-bar-height);\n background: var(--pos-background-color);\n color: var(--pos-normal-text-color);\n\n p {\n display: inline-block;\n }\n}\n";const xd=kd;const Sd=class{constructor(t){e(this,t);this.subscribePodOs=a(this,"pod-os:init",7);this.errorEmitter=a(this,"pod-os:error",7);this.indexUpdatedEmitter=a(this,"pod-os:search:index-updated",7);this.indexCreatedEmitter=a(this,"pod-os:search:index-created",7);this.indexes=[];this.showOptions=false;this.isIndexed=false;this.receivePodOs=async t=>{this.os=t;this.thing=this.os.store.get(this.uri);this.getLabelIndexes(M.state.profile);this.unsubscribeSessionChange=M.onChange("profile",(t=>{this.getLabelIndexes(t)}))}}componentWillLoad(){B(this)}disconnectedCallback(){this.unsubscribeSessionChange&&this.unsubscribeSessionChange()}updateUri(t){this.thing=this.os.store.get(t);this.isIndexed=this.checkIfIndexed(t)}checkIfIndexed(t){return this.indexes.some((e=>e.contains(t)))}getLabelIndexes(t){if(t){this.indexes=t.getPrivateLabelIndexes().map((t=>this.os.store.get(t).assume(N)));this.showOptions=this.indexes.length>1;this.isIndexed=this.checkIfIndexed(this.uri)}}async onClick(t){t.preventDefault();if(this.indexes.length===1){const t=this.indexes[0];await this.addToLabelIndex(t);this.indexUpdatedEmitter.emit(t)}else if(this.indexes.length===0){const t=await this.createDefaultLabelIndex();await this.addToLabelIndex(t);this.indexCreatedEmitter.emit(t)}}async addToLabelIndex(t){try{await this.os.addToLabelIndex(this.thing,t);this.isIndexed=true}catch(t){this.errorEmitter.emit(t)}}async createDefaultLabelIndex(){try{return await this.os.createDefaultLabelIndex(M.state.profile)}catch(t){this.errorEmitter.emit(t)}}render(){if(!M.state.isLoggedIn||!this.uri){return null}const t="Make this findable";const e=n("button",{type:"button",slot:"trigger","aria-label":t,class:{main:true,success:this.isIndexed},onClick:t=>this.onClick(t),title:""},this.isIndexed?n(Ed,null):n(_d,null),n("p",null,t));if(this.showOptions){return n(i,null,n("sl-dropdown",null,e,n("sl-menu",{role:"listbox"},this.indexes.map((t=>n("sl-menu-item",{role:"option",value:t,type:"checkbox",checked:t.contains(this.uri)},n("pos-resource",{uri:t.uri,lazy:true},n("pos-label",null))))))))}else{return e}}async onSelect(t){const e=t.detail.item.value;t.preventDefault();await this.addToLabelIndex(e);this.indexUpdatedEmitter.emit(e)}get el(){return s(this)}static get watchers(){return{uri:["updateUri"]}}};const _d=()=>n("svg",{role:"presentation",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},n("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m5.231 13.481L15 17.25m-4.5-15H5.625c-.621 0-1.125.504-1.125 1.125v16.5c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Zm3.75 11.625a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z"}));const Ed=()=>n("svg",{role:"presentation",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},n("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M10.125 2.25h-4.5c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125v-9M10.125 2.25h.375a9 9 0 0 1 9 9v.375M10.125 2.25A3.375 3.375 0 0 1 13.5 5.625v1.5c0 .621.504 1.125 1.125 1.125h1.5a3.375 3.375 0 0 1 3.375 3.375M9 15l2.25 2.25L15 12"}));Sd.style=xd;const Ad=":host {\n --pos-navigation-bar-height: var(--size-10);\n}\n\nsearch {\n position: relative;\n}\n\n.suggestions ol {\n border: 1px solid var(--pos-border-color);\n display: flex;\n flex-direction: column;\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n\n.suggestions {\n width: 100%;\n overflow-y: auto;\n max-height: 90dvh;\n li {\n padding: 1rem;\n background-color: var(--pos-background-color);\n pos-rich-link {\n --background-color: inherit;\n }\n &[aria-selected='true'] {\n background-color: var(--pos-primary-color);\n &:hover {\n background-color: var(--pos-primary-color);\n }\n }\n &:hover {\n background-color: var(--pos-border-color);\n }\n }\n}\n\n.suggestions li.selected pos-rich-link {\n --label-color: white;\n --description-color: var(--pos-border-color);\n --uri-color: var(--pos-subtle-text-color);\n}\n\ndialog {\n position: absolute;\n margin-top: calc(-1 * var(--pos-navigation-bar-height));\n padding: 0;\n width: 100%;\n max-width: 100%;\n min-width: 100%;\n overflow: hidden;\n max-height: 100dvh;\n background-color: var(--pos-background-color);\n color: var(--pos-normal-text-color);\n border: var(--pos-border-color);\n border-radius: var(--radius-md);\n box-shadow: var(--shadow-md);\n form {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n align-items: center;\n input {\n display: flex;\n font-size: var(--scale-1);\n height: var(--pos-navigation-bar-height);\n border-top-left-radius: var(--radius-md);\n border-top-right-radius: var(--radius-md);\n padding-left: var(--size-2);\n width: 100%;\n border: none;\n outline: none;\n color: var(--pos-normal-text-color);\n background-color: var(--pos-input-background-color);\n box-sizing: border-box;\n }\n }\n}\n\ndialog[open] {\n display: flex;\n z-index: var(--layer-top);\n animation: slideIn 100ms ease-out;\n}\n\n@media (max-width: 640px) {\n search {\n position: unset;\n }\n dialog {\n margin-top: var(--size-1);\n top: 0;\n width: 95dvw;\n max-width: unset;\n min-width: unset;\n form {\n input {\n height: var(--size-12);\n font-size: var(--scale-fluid-3);\n }\n }\n }\n}\n\n@keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n";const Cd=Ad;const zd=class{constructor(t){e(this,t);this.subscribePodOs=a(this,"pod-os:init",7);this.linkEmitter=a(this,"pod-os:link",7);this.uri="";this.inputValue=this.uri;this.searchIndex=undefined;this.suggestions=[];this.selectedIndex=-1;this.resource=null;this.changeEvents=new Ln;this.debouncedSearch=null;this.receivePodOs=async t=>{this.os=t}}updateResource(){var t;try{this.resource=this.uri?(t=this.os)===null||t===void 0?void 0:t.store.get(this.uri):null}catch(t){this.resource=null}}componentWillLoad(){B(this);this.updateResource();M.onChange("isLoggedIn",(async t=>{if(t){await this.buildSearchIndex()}else{this.clearSearchIndex()}}));this.debouncedSearch=this.changeEvents.pipe(mi(300)).subscribe((()=>this.search()))}disconnectedCallback(){var t;(t=this.debouncedSearch)===null||t===void 0?void 0:t.unsubscribe()}async buildSearchIndex(){this.searchIndex=await this.os.buildSearchIndex(M.state.profile)}rebuildSearchIndex(){this.searchIndex.rebuild()}openNavigationDialog(t){var e,n;this.resource=t.detail;if(t.detail){this.inputValue=t.detail.uri;this.search()}(e=this.inputRef)===null||e===void 0?void 0:e.select();(n=this.dialogRef)===null||n===void 0?void 0:n.show()}clearSearchIndex(){var t;(t=this.searchIndex)===null||t===void 0?void 0:t.clear()}onChange(t){this.inputValue=t.target.value;this.changeEvents.next()}closeDialog(){var t;(t=this.dialogRef)===null||t===void 0?void 0:t.close();this.selectedIndex=-1}clearSuggestions(){var t;this.suggestions=[];(t=this.dialogRef)===null||t===void 0?void 0:t.close();this.selectedIndex=-1}onClickSelf(t){t.stopPropagation()}handleKeyDown(t){if(t.key==="Escape"){this.closeDialog()}else if(t.key==="ArrowDown"){t.preventDefault();this.selectedIndex=Math.min(this.selectedIndex+1,this.suggestions.length-1)}else if(t.key==="ArrowUp"){t.preventDefault();this.selectedIndex=Math.max(this.selectedIndex-1,0)}}search(){if(this.searchIndex){this.suggestions=this.inputValue?this.searchIndex.search(this.inputValue):[]}}onSubmit(){if(this.suggestions&&this.selectedIndex>-1){this.linkEmitter.emit(this.suggestions[this.selectedIndex].ref)}else{this.linkEmitter.emit(this.inputValue)}}render(){return n("nav",{key:"75fef6f1c6fd945150ebb4123a2cce80537c46e1"},n("search",{key:"eb81710c97b1edcc9295050585e14b505cc4e9ca"},n("pos-navigation-bar",{key:"5566254cee17f0ebc923b61f08d0765f2e51db08",searchIndexReady:this.searchIndex!==undefined,current:this.resource}),n("dialog",{key:"bed472296c931b2409094b9d3d5ca875b262b4b2",ref:t=>this.dialogRef=t},n("form",{key:"1bfbb8191a04fc215da7250ef533f8c7cb65fca9",method:"dialog",onSubmit:()=>this.onSubmit()},n("input",{key:"532bdbabb64164b879d60e5f7f944dc79eebeb2b",ref:t=>this.inputRef=t,enterkeyhint:"search","aria-label":"Search or enter URI",placeholder:"Search or enter URI",value:this.uri,onChange:t=>this.onChange(t),onInput:t=>this.onChange(t),role:"combobox","aria-autocomplete":"list","aria-expanded":this.suggestions.length>0,"aria-controls":"suggestions-list","aria-activedescendant":this.selectedIndex>=0?`option-${this.selectedIndex}`:null}),this.suggestions.length>0?n("div",{class:"suggestions"},n("ol",{id:"suggestions-list",role:"listbox","aria-label":"Search results"},this.suggestions.map(((t,e)=>n("li",{id:`option-${e}`,role:"option","aria-selected":e===this.selectedIndex?"true":"false"},n("pos-rich-link",{uri:t.ref})))))):null))))}static get watchers(){return{uri:["updateResource"],os:["updateResource"]}}};zd.style=Cd;const Td="section.current {\n display: flex;\n height: var(--pos-navigation-bar-height);\n flex-grow: 1;\n gap: 0;\n background-color: var(--pos-input-background-color);\n border-radius: var(--radius-md);\n width: 100%;\n &:focus-within {\n outline: var(--pos-input-focus-outline);\n }\n}\n\nsection.current button {\n cursor: pointer;\n font-size: var(--scale-1);\n display: flex;\n align-items: center;\n justify-content: center;\n flex-grow: 1;\n background: none;\n color: var(--pos-normal-text-color);\n outline: none;\n border: none;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n &:focus {\n text-decoration: underline;\n }\n :first-child {\n flex-grow: 1;\n }\n svg {\n width: var(--size-6);\n color: var(--pos-subtle-text-color);\n }\n}\n";const $d=Td;const Pd=class{constructor(t){e(this,t);this.navigate=a(this,"pod-os:navigate",7)}onClick(){this.navigate.emit(this.current)}activate(t){if((t.ctrlKey||t.metaKey)&&t.key==="k"){t.preventDefault();this.navigate.emit(this.current)}}render(){const t=this.current?`${this.current.label()} (Click to search or enter URI)`:"Search or enter URI";return n("section",{key:"d8b48cc6908244bb35139ead157687f1a6f05bd7",class:"current"},this.current&&this.searchIndexReady&&n("pos-make-findable",{key:"215e525705b27a7a30de2f32a1bc57aba72652c2",uri:this.current.uri}),n("button",{key:"55b79e62adac3f10e8b9f5a514c5d4191af251d9","aria-label":t,onClick:()=>this.onClick()},n("div",{key:"7b1a9ebe7fb3c90ac3694826f3202ba4617925cb"},this.current?this.current.label():"Search or enter URI"),this.icon()))}icon(){return n("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},n("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"}))}};Pd.style=$d;const Id=":host{display:block}form{display:grid;grid-template-columns:var(--size-16) 1fr;grid-gap:var(--scale-0)}label{grid-column:1 / 2;display:flex;align-items:center;justify-content:flex-end}input,pos-select-term,button{grid-column:2 / 3}input,pos-select-term::part(input){outline:var(--pos-input-outline);padding:var(--scale-000);border:none;border-radius:var(--radius-xs);width:var(--size-full);box-sizing:border-box;background:var(--pos-input-background-color);color:var(--pos-normal-text-color)}input:focus-within,pos-select-term::part(input):focus-within{outline:var(--pos-input-focus-outline)}#new-uri{grid-column:1/3;cursor:default;word-break:break-all;color:var(--pos-normal-text-color);font-weight:var(--weight-light);background:var(--pos-disabled-color);padding:var(--scale-000);border-radius:var(--radius-xs)}input#create{outline:none;box-shadow:var(--shadow-sm);cursor:pointer;color:var(--pos-primary-text-color);background-color:var(--pos-primary-color)}input#create:disabled{cursor:default;color:var(--pos-disabled-text-color);background-color:var(--pos-disabled-color);box-shadow:none}input#create:hover:not(:disabled),input#create:focus{filter:brightness(110%);box-shadow:var(--shadow-md)}";const Rd=Id;const Od=class{constructor(t){e(this,t);this.linkEmitter=a(this,"pod-os:link",7);this.errorEmitter=a(this,"pod-os:error",7);this.subscribePodOs=a(this,"pod-os:init",7);this.canSubmit=false;this.receivePodOs=async t=>{this.os=t}}validate(){this.canSubmit=Boolean(this.name&&this.selectedTypeUri)}componentWillLoad(){B(this)}render(){return n("form",{key:"0d52a6b85338d0353876f0fde0a7ef45e5ebe104",method:"dialog",onSubmit:t=>this.handleSubmit(t)},n("label",{key:"6765ada99850150a6a1dc9135a6ec0c575e3066d",htmlFor:"type"},"Type"),n("pos-select-term",{key:"375ca79b6ffa3d363954578cf83d2eab10b0e486",id:"type",placeholder:"",value:this.selectedTypeUri,"onPod-os:term-selected":t=>this.onTermSelected(t)}),n("label",{key:"9da148cb532d236a5dc9ad73fc75e1bd2d277d17",htmlFor:"name"},"Name"),n("input",{key:"81b5a4bf51eb403bfebfa0c9e023935ddde48194",id:"name",type:"text",value:this.name,onInput:t=>this.handleChange(t)}),this.newUri?n("div",{id:"new-uri",title:"This will be the URI of the new thing"},this.newUri):null,n("input",{key:"5f4ff09818262ad875f80bce3a0f942b0428335f",id:"create",type:"submit",value:"Create",disabled:!this.canSubmit}))}handleChange(t){this.name=t.target.value;this.newUri=this.os.proposeUriForNewThing(this.referenceUri,this.name)}onTermSelected(t){this.selectedTypeUri=t.detail.uri}async handleSubmit(t){try{await this.os.addNewThing(this.newUri,this.name,this.selectedTypeUri);this.linkEmitter.emit(this.newUri);this.reset()}catch(e){t.preventDefault();this.errorEmitter.emit(e)}}reset(){this.name="";this.newUri="";this.selectedTypeUri=""}static get delegatesFocus(){return true}static get watchers(){return{name:["validate"],selectedTypeUri:["validate"]}}};Od.style=Rd;const Dd=":host{--width:300px;--height:300px;--border-radius:var(--border-radius, 0);--object-fit:var(--object-fit, cover)}";const jd=Dd;const Ld=class{constructor(t){e(this,t);this.subscribeResource=a(this,"pod-os:resource",7);this.blurredBackground=false;this.receiveResource=t=>{this.resource=t}}componentWillLoad(){J(this)}render(){const t=this.resource?this.resource.picture():null;if(!t)return n("slot",null);return n("pos-image",{blurredBackground:this.blurredBackground,src:t.url,alt:this.resource.label()})}};Ld.style=jd;const Md="details.error {\n margin: var(--size-2);\n background-color: var(--pos-error-background-color);\n border: var(--size-px) solid var(--pos-error-border-color);\n padding: var(--size-2);\n border-radius: var(--radius-md);\n\n a {\n color: var(--pos-normal-text-color);\n }\n}\n";const Wd=Md;const Ud=class{constructor(t){e(this,t);this.subscribePodOs=a(this,"pod-os:init",7);this.resourceLoadedEmitter=a(this,"pod-os:resource-loaded",7);this.consumers=[];this.lazy=false;this.loading=true;this.receivePodOs=async t=>{this.os=t}}componentWillLoad(){M.onChange("isLoggedIn",(()=>this.loadResource()));B(this)}async provideResource(t){t.stopPropagation();if(this.resource){t.detail(this.resource)}this.consumers.push(t)}async loadResource(){await this.getResource(!this.lazy)}async fetch(){await this.getResource(true)}async getResource(t=false){try{if(t){this.loading=true;await this.os.fetch(this.uri);this.resourceLoadedEmitter.emit(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=false}}render(){if(this.loading){return n("ion-progress-bar",{type:"indeterminate"})}if(this.error){return n("details",{class:"error"},n("summary",{title:"Click to expand"},"⚠ Sorry, something went wrong"),n("p",null,"Status:",this.error.status),n("p",null,this.error.message),n("p",null,"You can try to open the link outside PodOS: ",n("a",{href:this.uri},this.uri)))}return n("slot",null)}static get watchers(){return{os:["loadResource"],uri:["loadResource"]}}};Ud.style=Wd;const Hd=":host {\n --background-color: inherit;\n --label-color: var(--pos-normal-text-color);\n --description-color: var(--pos-normal-text-color);\n --uri-color: var(--pos-subtle-text-color);\n --font-family: var(--font-sans);\n}\n\np.content {\n background-color: var(--background-color);\n line-height: var(--line-xs);\n margin: 0;\n display: flex;\n flex-direction: column;\n align-items: baseline;\n gap: var(--size-1);\n\n .url {\n font-size: var(--scale-fluid-1);\n color: var(--pos-subtle-text-color);\n }\n}\n\na {\n color: var(--label-color);\n max-width: min(100%, var(--prose-lg));\n text-decoration: underline;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n text-decoration-thickness: var(--size-px);\n}\n\npos-label {\n color: var(--label-color);\n font-size: var(--scale-fluid-2);\n margin-bottom: var(--size-1);\n}\n\npos-description {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n text-overflow: ellipsis;\n overflow: hidden;\n font-weight: var(--weight-light);\n color: var(--description-color);\n font-size: var(--scale-fluid-2);\n}\n\n@media (min-width: 640px) {\n pos-label {\n font-size: var(--scale-fluid-0);\n }\n pos-description {\n font-size: var(--scale-fluid-1);\n }\n\n p.content {\n .url {\n font-size: var(--scale-fluid-000);\n }\n }\n}\n";const Nd=Hd;const Jd=class{constructor(t){e(this,t);this.linkEmitter=a(this,"pod-os:link",7);this.subscribeResource=a(this,"pod-os:resource",7);this.errorEmitter=a(this,"pod-os:error",7);this.followPredicate=false;this.error=null;this.showCustomContent=false;this.receiveResource=t=>{const e=(t,e,n,i)=>{if(t.length==0){this.error="No matching link found";this.errorEmitter.emit(new Error(`pos-rich-link: No matching link found from ${e.uri} ${i}=${n}`))}else if(t[0].uris.length>1){this.error="More than one matching link found";this.errorEmitter.emit(new Error(`pos-rich-link: More than one matching link found from ${e.uri} ${i}=${n}`))}else{this.link=t[0].uris[0];this.followPredicate=true}};if(this.rel){e(t.relations(this.rel),t,this.rel,"rel")}else if(this.rev){e(t.reverseRelations(this.rev),t,this.rev,"rev")}else{this.link=t.uri}}}componentWillLoad(){this.showCustomContent=!!this.host.lastElementChild||this.host.textContent.trim()!="";if(!this.uri)J(this)}render(){const t=t=>this.showCustomContent?n("a",{href:t,onClick:e=>{e.preventDefault();this.linkEmitter.emit(t)}},n("slot",null)):n("p",{class:"content"},n("a",{href:t,onClick:e=>{e.preventDefault();this.linkEmitter.emit(t)}},n("pos-label",null)),n("span",{class:"url"},new URL(t).host),n("pos-description",null));if(this.error){return this.error}else if(this.followPredicate){return n("pos-resource",{lazy:true,uri:this.link},t(this.link))}else if(this.link){return t(this.link)}else if(this.uri){return n("pos-resource",{lazy:true,uri:this.uri},t(this.uri))}else{return null}}get host(){return s(this)}};Jd.style=Nd;const Bd=(t,e,n)=>{const i=t.get(e);if(!i){t.set(e,[n])}else if(!i.includes(n)){i.push(n)}};const Kd=(t,e)=>{let n;return(...i)=>{if(n){clearTimeout(n)}n=setTimeout((()=>{n=0;t(...i)}),e)}};const Fd=t=>!("isConnected"in t)||t.isConnected;const Xd=Kd((t=>{for(let e of t.keys()){t.set(e,t.get(e).filter(Fd))}}),2e3);const Vd=()=>{if(typeof c!=="function"){return{}}const t=new Map;return{dispose:()=>t.clear(),get:e=>{const n=c();if(n){Bd(t,e,n)}},set:e=>{const n=t.get(e);if(n){t.set(e,n.filter(l))}Xd(t)},reset:()=>{t.forEach((t=>t.forEach(l)));Xd(t)}}};const Yd=(t,e=((t,e)=>t!==e))=>{let n=new Map(Object.entries(t!==null&&t!==void 0?t:{}));const i={dispose:[],get:[],set:[],reset:[]};const s=()=>{n=new Map(Object.entries(t!==null&&t!==void 0?t:{}));i.reset.forEach((t=>t()))};const r=()=>{i.dispose.forEach((t=>t()));s()};const o=t=>{i.get.forEach((e=>e(t)));return n.get(t)};const a=(t,s)=>{const r=n.get(t);if(e(s,r,t)){n.set(t,s);i.set.forEach((e=>e(t,s,r)))}};const c=typeof Proxy==="undefined"?{}:new Proxy(t,{get(t,e){return o(e)},ownKeys(t){return Array.from(n.keys())},getOwnPropertyDescriptor(){return{enumerable:true,configurable:true}},has(t,e){return n.has(e)},set(t,e,n){a(e,n);return true}});const l=(t,e)=>{i[t].push(e);return()=>{qd(i[t],e)}};const h=(e,n)=>{const i=l("set",((t,i)=>{if(t===e){n(i)}}));const s=l("reset",(()=>n(t[e])));return()=>{i();s()}};const d=(...t)=>{const e=t.reduce(((t,e)=>{if(e.set){t.push(l("set",e.set))}if(e.get){t.push(l("get",e.get))}if(e.reset){t.push(l("reset",e.reset))}if(e.dispose){t.push(l("dispose",e.dispose))}return t}),[]);return()=>e.forEach((t=>t()))};const u=t=>{const e=n.get(t);i.set.forEach((n=>n(t,e,e)))};return{state:c,get:o,set:a,on:l,onChange:h,use:d,dispose:r,reset:s,forceUpdate:u}};const qd=(t,e)=>{const n=t.indexOf(e);if(n>=0){t[n]=t[t.length-1];t.length--}};const Gd=(t,e)=>{const n=Yd(t,e);n.use(Vd());return n};const Zd=t=>{var e;const n=window;const i=new URL(n.location.href);const s=(e=t===null||t===void 0?void 0:t.parseURL)!==null&&e!==void 0?e:tu;const{state:r,onChange:o,dispose:a}=Gd({url:i,activePath:s(i)},((t,e,n)=>{if(n==="url"){return t.href!==e.href}return t!==e}));const c=t=>{history.pushState(null,null,t);const e=new URL(t,document.baseURI);r.url=e;r.activePath=s(e)};const l=t=>{const{activePath:e}=r;for(let n of t){const i=Qd(e,n.path);if(i){if(n.to!=null){const i=typeof n.to==="string"?n.to:n.to(e);c(i);return l(t)}else{return{params:i,route:n}}}}return undefined};const h=()=>{const t=new URL(n.location.href);r.url=t;r.activePath=s(t)};const d=(t,e)=>{const n=l(e);if(n){if(typeof n.route.jsx==="function"){return n.route.jsx(n.params)}else{return n.route.jsx}}};const u=()=>{n.removeEventListener("popstate",h);a()};const f={Switch:d,get url(){return r.url},get activePath(){return r.activePath},push:c,onChange:o,dispose:u};h();n.addEventListener("popstate",h);return f};const Qd=(t,e)=>{if(typeof e==="string"){if(e===t){return{}}}else if(typeof e==="function"){const n=e(t);if(n){return n===true?{}:{...n}}}else{const n=e.exec(t);if(n){e.lastIndex=0;return{...n}}}return undefined};const tu=t=>t.pathname.toLowerCase();const eu=".toolbar{display:flex;flex-direction:row;gap:0;align-items:center;margin-left:0.5rem}pos-navigation{flex-grow:1}";const nu=eu;const iu=Zd();const su=class{constructor(t){e(this,t);this.routeChanged=a(this,"pod-os:route-changed",7);this.mode="standalone"}linkClicked(t){this.navigate(t.detail)}sessionRestored(t){iu.push(t.detail.url)}componentWillLoad(){this.updateUri();iu.onChange("url",(()=>{this.updateUri()}))}navigate(t){iu.push("?uri="+encodeURIComponent(t))}updateUri(){this.uri=new URLSearchParams(window.location.search).get("uri")||(this.mode==="standalone"?"pod-os:dashboard":window.location.href);this.routeChanged.emit(this.uri)}render(){return n("slot",{key:"5d39b495d0835298a50ff39ec55d83481764c376"})}};su.style=nu;const ru=":host{display:block}input{background-color:transparent;color:var(--pos-normal-text-color);border:none;padding-top:1rem;padding-bottom:1rem}input:focus{outline:none}";const ou=ru;const au=class{constructor(t){e(this,t);this.subscribePodOs=a(this,"pod-os:init",7);this.termSelected=a(this,"pod-os:term-selected",7);this.placeholder="Type to search...";this.value="";this.terms=[];this.receivePodOs=async t=>{this.os=t}}componentWillLoad(){B(this)}setTerms(){this.terms=this.os.listKnownTerms()}handleChange(t){this.termSelected.emit({uri:t.target.value})}render(){return n(i,{key:"19fcf00d5d0b45657e304307b52249d0d387a44a"},n("input",{key:"0ed3ff623d93a3b940a7615683aa4428e69da56f",part:"input",list:"terms",placeholder:this.placeholder,value:this.value,onChange:t=>this.handleChange(t)}),n("datalist",{key:"cc518b371003586cf9a4df1423bf3588666b3ebd",part:"terms",id:"terms"},this.terms.map((t=>n("option",{value:t.uri},t.shorthand)))))}static get delegatesFocus(){return true}static get watchers(){return{os:["setTerms"]}}};au.style=ou;const cu=":host{border:var(--size-px) solid var(--pos-border-color);border-radius:var(--radius-lg);box-shadow:var(--shadow-md);padding:var(--size-8);max-width:var(--size-96);background:var(--pos-card-background)}svg{width:var(--size-8)}h2{display:flex;align-items:center}p{padding:var(--size-2)}.info{color:var(--color-grey-900);background-color:var(--color-blue-200)}.warn{color:var(--color-grey-900);background-color:var(--color-yellow-200)}";const lu=cu;const hu=class{constructor(t){e(this,t)}render(){return n(i,{key:"f024e7d542cfc87a4dc0a1f22694b664086ebd60"},n("div",{key:"e88e694cefa4a2361ca8c67f1bd023fda1b70f2a"},n("h2",{key:"c4b2e6270f26a2eb7f62e5076b40834903fc10e4"},n("svg",{key:"d63643c1ed908c6fe9ab4ff6c47b13848c714c32",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},n("path",{key:"78f055556bb175ea17d0db1ccf78c16343d67d3f","stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"})),"Cache Settings"),n("p",{key:"3045ae3214b9e91feb34857ce45a3db6529f2959",class:"info"},"ℹ Enable offline cache to be able to access previously loaded data while offline."),n("p",{key:"9987c1cb59b62e1eb06c67a9c646a9a2f125529a",class:"warn"},"⚠ Private data may be stored on this device. Only enable it, if you trust this device."),n("label",{key:"55dd3c0fa7ece9a59437e7818d6cfa9b0e9eb5bf"},n("input",{key:"22874f8a39b5016b71818fa1d6226bf66ff969c3",type:"checkbox",checked:ge.state.offlineCache,onChange:t=>ge.state.offlineCache=t.target.checked}),"Enable offline cache")))}};hu.style=lu;vd.define("sl-icon");const du=":host {\n --button-size: var(--size-16);\n display: block;\n position: sticky;\n align-self: flex-start;\n top: 0;\n overflow: auto;\n min-width: var(--button-size);\n z-index: var(--layer-1);\n}\n\n[role='tablist'] {\n display: flex;\n flex-direction: column;\n justify-content: center;\n\n border-right: var(--size-px) solid var(--pos-border-color);\n\n button {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 0;\n font-size: var(--size-6);\n position: relative;\n overflow: hidden;\n outline: none;\n border: none;\n width: var(--button-size);\n min-width: var(--button-size);\n height: var(--button-size);\n min-height: var(--button-size);\n background-color: var(--pos-background-color);\n\n &::after {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n width: 0;\n height: 0;\n border-radius: 100%;\n background: color-mix(in srgb, var(--pos-primary-color), transparent 50%);\n transform: translate(-50%, -50%);\n opacity: 1;\n }\n\n &:active::after,\n &:focus::after {\n width: calc(var(--button-size) * 1.5);\n height: calc(var(--button-size) * 1.5);\n opacity: 0;\n transition:\n width 0.5s ease-out,\n height 0.5s ease-out,\n opacity 1s ease-out;\n }\n\n &:focus-visible {\n border: var(--size-px) solid var(--pos-primary-color);\n }\n\n @media (min-width: 640px) {\n &[aria-selected] {\n border-right: var(--size-1) solid var(--pos-primary-color);\n }\n }\n\n .text {\n font-size: var(--size-3);\n white-space: nowrap;\n text-overflow: ellipsis;\n width: 100%;\n overflow: hidden;\n }\n }\n}\n\n@media (max-width: 640px) {\n :host {\n position: fixed;\n top: unset;\n bottom: 0;\n width: 100dvw;\n }\n [role='tablist'] {\n flex-direction: row;\n background-color: var(--pos-background-color);\n\n border-top: var(--size-px) solid var(--pos-border-color);\n\n button {\n &[aria-selected] {\n border-top: var(--size-1) solid var(--pos-primary-color);\n }\n }\n }\n}\n";const uu=du;const fu=class{constructor(t){e(this,t);this.toolSelected=a(this,"pod-os:tool-selected",7);this.tools=[]}render(){if(this.tools.length>1){return n("div",{role:"tablist","aria-label":"Tools","aria-multiselectable":"false"},this.tools.map((t=>{var e;return n("button",{role:"tab","aria-selected":((e=this.selected)===null||e===void 0?void 0:e.element)===t.element,onClick:()=>this.toolSelected.emit(t)},n("sl-icon",{name:t.icon}),n("span",{class:"text"},t.label))})))}return null}};fu.style=uu;const pu={Generic:{element:"pos-app-generic",label:"Data",icon:"list-ul",types:[]},RdfDocument:{element:"pos-app-rdf-document",label:"Things",icon:"diagram-2",types:[{uri:"http://www.w3.org/2007/ont/link#RDFDocument",priority:20}]},DocumentViewer:{element:"pos-app-document-viewer",label:"Doc",icon:"file-text",types:[{uri:bu("application/pdf"),priority:30},{uri:"http://www.w3.org/2007/ont/link#Document",priority:10}]},ImageViewer:{element:"pos-app-image-viewer",label:"Pic",icon:"file-image",types:[{uri:"http://purl.org/dc/terms/Image",priority:20}]},LdpContainer:{element:"pos-app-ldp-container",label:"Content",icon:"folder",types:[{uri:"http://www.w3.org/ns/ldp#Container",priority:30}]}};function bu(t){return"http://www.w3.org/ns/iana/media-types/"+t+"#Resource"}function mu(t){const e=new Set(t.map((t=>t.uri)));return Object.values(pu).map(gu(e)).filter(vu).toSorted(yu).map((t=>t.tool)).concat(pu.Generic)}const gu=t=>e=>({tool:e,priority:wu(e.types,t)});function wu(t,e){return t.filter((t=>e.has(t.uri))).reduce(((t,e)=>Math.max(t,e.priority)),0)}const vu=t=>t.priority>0;const yu=(t,e)=>e.priority-t.priority;const ku="section {\n display: flex;\n flex-direction: row;\n}\n\n.transition {\n position: relative;\n flex-grow: 1;\n .tool {\n position: absolute;\n }\n}\n\n.tool {\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n &.visible {\n animation: fadeIn 300ms ease-in;\n }\n &.hidden {\n animation: fadeOut 300ms ease-in;\n }\n}\n\n@keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n@keyframes fadeOut {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n}\n\n@media (max-width: 640px) {\n section {\n --toolbar-size: var(--size-16);\n flex-direction: column-reverse;\n padding-bottom: var(--toolbar-size);\n pos-tool-select {\n --button-size: var(--toolbar-size);\n }\n }\n}\n";const xu=ku;const Su=class{constructor(t){e(this,t);this.subscribeResource=a(this,"pod-os:resource",7);this.transitioning=false;this.receiveResource=t=>{var e;const n=t.types();this.availableTools=mu(n);this.currentTool=(e=this.availableTools.find((t=>t.element===this.initialTool)))!==null&&e!==void 0?e:this.availableTools[0]}}componentWillLoad(){J(this);const t=new URLSearchParams(window.location.search);const e=t.get("tool");if(e){this.initialTool=e}}handleToolSelected(t){this.oldTool=this.currentTool;this.currentTool=t.detail;this.transitioning=true;const e=new URL(window.location.href);e.searchParams.set("tool",t.detail.element);window.history.replaceState({},"",e.toString())}render(){return this.availableTools?this.renderApp():null}renderApp(){var t;const e=this.currentTool.element;const i=(t=this.oldTool)===null||t===void 0?void 0:t.element;return n("section",null,n("pos-tool-select",{selected:this.currentTool,tools:this.availableTools}),n("div",{class:{transition:this.transitioning},onAnimationEnd:()=>this.removeOldTool()},i&&n(i,{class:"tool hidden"}),n(e,{class:"tool visible"})))}removeOldTool(){this.oldTool=null;this.transitioning=false}};Su.style=xu;var _u=So`
|
|
546
546
|
:host {
|
|
547
547
|
display: inline-block;
|
|
548
548
|
|
|
@@ -648,5 +648,5 @@ import{d as t,r as e,h as n,H as i,e as s,f as r,w as o,i as a,j as c,k as l}fro
|
|
|
648
648
|
border-left: solid var(--width) var(--color);
|
|
649
649
|
margin: 0 var(--spacing);
|
|
650
650
|
}
|
|
651
|
-
`;var Cu=class extends ac{constructor(){super(...arguments);this.vertical=false}connectedCallback(){super.connectedCallback();this.setAttribute("role","separator")}handleVerticalChange(){this.setAttribute("aria-orientation",this.vertical?"vertical":"horizontal")}};Cu.styles=[Qa,Au];st([nc({type:Boolean,reflect:true})],Cu.prototype,"vertical",2);st([Oh("vertical")],Cu.prototype,"handleVerticalChange",1);Cu.define("sl-divider");const
|
|
652
|
-
//# sourceMappingURL=p-
|
|
651
|
+
`;var Cu=class extends ac{constructor(){super(...arguments);this.vertical=false}connectedCallback(){super.connectedCallback();this.setAttribute("role","separator")}handleVerticalChange(){this.setAttribute("aria-orientation",this.vertical?"vertical":"horizontal")}};Cu.styles=[Qa,Au];st([nc({type:Boolean,reflect:true})],Cu.prototype,"vertical",2);st([Oh("vertical")],Cu.prototype,"handleVerticalChange",1);Cu.define("sl-divider");const zu="button {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n margin: 0;\n border: none;\n background: none;\n cursor: pointer;\n border-radius: 50%;\n pos-picture {\n --width: 40px;\n --height: 40px;\n --border-radius: 50%;\n }\n sl-avatar {\n --size: 40px;\n }\n}\n\nsl-dropdown {\n display: block;\n}\n";const Tu=zu;const $u=class{constructor(t){e(this,t);this.logout=a(this,"pod-os:logout",7);this.link=a(this,"pod-os:link",7)}onSelect(t){const{value:e}=t.detail.item;if(e==="logout"){this.logout.emit()}else if(e==="profile"){this.link.emit(this.webId)}else if(e==="dashboard"){this.link.emit("pod-os:dashboard")}else if(e==="settings"){this.link.emit("pod-os:settings")}}render(){if(!this.webId)return null;return n("pos-resource",{uri:this.webId},n("sl-dropdown",null,n("button",{slot:"trigger","aria-label":"User menu"},n("pos-picture",null,n("sl-avatar",null))),n("sl-menu",null,n("sl-menu-item",{value:"dashboard"},"Dashboard"),n("sl-menu-item",{value:"profile"},n("pos-label",null)),n("sl-menu-item",{value:"settings"},"Settings"),n("sl-divider",null),n("sl-menu-item",{value:"logout"},"Logout"))))}};$u.style=Tu;export{It as ion_icon,Wt as ion_progress_bar,Bt as ion_ripple_effect,qt as ion_skeleton_text,le as ion_toast,pe as pos_add_new_thing,Lr as pos_app,Ur as pos_app_browser,Br as pos_app_dashboard,Xr as pos_app_settings,Vr as pos_description,Gr as pos_dialog,Zr as pos_error_toast,eo as pos_example_resources,so as pos_getting_started,ao as pos_image,co as pos_internal_router,lo as pos_label,fo as pos_login,mo as pos_login_form,Sd as pos_make_findable,zd as pos_navigation,Pd as pos_navigation_bar,Od as pos_new_thing_form,Ld as pos_picture,Ud as pos_resource,Jd as pos_rich_link,su as pos_router,au as pos_select_term,hu as pos_setting_offline_cache,fu as pos_tool_select,Su as pos_type_router,$u as pos_user_menu};
|
|
652
|
+
//# sourceMappingURL=p-e7498ab7.entry.js.map
|