@pod-os/elements 0.29.1-rc.c8e652b.0 → 0.29.1-rc.d6d1332.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.
Files changed (78) hide show
  1. package/dist/cjs/{app-globals-97a7ec18.js → app-globals-92c0c4ce.js} +3 -1
  2. package/dist/cjs/app-globals-92c0c4ce.js.map +1 -0
  3. package/dist/cjs/chunk.3Y6SB6QS-10eff6c1.js +31 -0
  4. package/dist/cjs/chunk.3Y6SB6QS-10eff6c1.js.map +1 -0
  5. package/dist/cjs/elements.cjs.js +3 -2
  6. package/dist/cjs/elements.cjs.js.map +1 -1
  7. package/dist/cjs/{ion-icon_32.cjs.entry.js → ion-icon_33.cjs.entry.js} +136 -120
  8. package/dist/cjs/ion-icon_33.cjs.entry.js.map +1 -0
  9. package/dist/cjs/loader.cjs.js +3 -2
  10. package/dist/cjs/loader.cjs.js.map +1 -1
  11. package/dist/collection/apps/pos-app-browser/pos-app-browser.css +3 -0
  12. package/dist/collection/collection-manifest.json +1 -0
  13. package/dist/collection/components/pos-tool-select/pos-tool-select.css +51 -0
  14. package/dist/collection/components/pos-tool-select/pos-tool-select.js +55 -0
  15. package/dist/collection/components/pos-tool-select/pos-tool-select.js.map +1 -0
  16. package/dist/collection/components/pos-tool-select/shoelace.js +2 -0
  17. package/dist/collection/components/pos-tool-select/shoelace.js.map +1 -0
  18. package/dist/collection/components/pos-type-router/pos-type-router.css +14 -0
  19. package/dist/collection/components/pos-type-router/pos-type-router.js +14 -3
  20. package/dist/collection/components/pos-type-router/pos-type-router.js.map +1 -1
  21. package/dist/collection/components/pos-type-router/selectToolsForTypes.js +47 -0
  22. package/dist/collection/components/pos-type-router/selectToolsForTypes.js.map +1 -0
  23. package/dist/collection/global.js +2 -0
  24. package/dist/collection/global.js.map +1 -1
  25. package/dist/components/chunk.3Y6SB6QS.js +28 -0
  26. package/dist/components/chunk.3Y6SB6QS.js.map +1 -0
  27. package/dist/components/chunk.HVTXQL7M.js +24 -598
  28. package/dist/components/chunk.HVTXQL7M.js.map +1 -1
  29. package/dist/components/chunk.YHLNUJ7P.js +556 -0
  30. package/dist/components/chunk.YHLNUJ7P.js.map +1 -0
  31. package/dist/components/index.js +2 -0
  32. package/dist/components/index.js.map +1 -1
  33. package/dist/components/pos-app-browser.js +65 -59
  34. package/dist/components/pos-app-browser.js.map +1 -1
  35. package/dist/components/pos-make-findable2.js +1 -0
  36. package/dist/components/pos-make-findable2.js.map +1 -1
  37. package/dist/components/pos-tool-select.d.ts +11 -0
  38. package/dist/components/pos-tool-select.js +8 -0
  39. package/dist/components/pos-tool-select.js.map +1 -0
  40. package/dist/components/pos-tool-select2.js +43 -0
  41. package/dist/components/pos-tool-select2.js.map +1 -0
  42. package/dist/components/pos-type-router2.js +43 -18
  43. package/dist/components/pos-type-router2.js.map +1 -1
  44. package/dist/components/pos-user-menu2.js +2 -1
  45. package/dist/components/pos-user-menu2.js.map +1 -1
  46. package/dist/elements/elements.esm.js +1 -1
  47. package/dist/elements/elements.esm.js.map +1 -1
  48. package/dist/elements/{p-d303d82c.entry.js → p-20c36eb6.entry.js} +48 -48
  49. package/dist/elements/p-20c36eb6.entry.js.map +1 -0
  50. package/dist/elements/p-36a54274.js +2 -0
  51. package/dist/elements/p-36a54274.js.map +1 -0
  52. package/dist/elements/p-c066fd50.js +2 -0
  53. package/dist/elements/p-c066fd50.js.map +1 -0
  54. package/dist/esm/{app-globals-fd9221d0.js → app-globals-64c60cb2.js} +3 -1
  55. package/dist/esm/app-globals-64c60cb2.js.map +1 -0
  56. package/dist/esm/chunk.3Y6SB6QS-ff2f5b55.js +28 -0
  57. package/dist/esm/chunk.3Y6SB6QS-ff2f5b55.js.map +1 -0
  58. package/dist/esm/elements.js +3 -2
  59. package/dist/esm/elements.js.map +1 -1
  60. package/dist/esm/{ion-icon_32.entry.js → ion-icon_33.entry.js} +135 -120
  61. package/dist/esm/ion-icon_33.entry.js.map +1 -0
  62. package/dist/esm/loader.js +3 -2
  63. package/dist/esm/loader.js.map +1 -1
  64. package/dist/types/components/pos-tool-select/pos-tool-select.d.ts +6 -0
  65. package/dist/types/components/pos-tool-select/shoelace.d.ts +1 -0
  66. package/dist/types/components/pos-type-router/selectToolsForTypes.d.ts +13 -0
  67. package/dist/types/components.d.ts +17 -0
  68. package/package.json +1 -1
  69. package/dist/cjs/app-globals-97a7ec18.js.map +0 -1
  70. package/dist/cjs/ion-icon_32.cjs.entry.js.map +0 -1
  71. package/dist/collection/components/pos-type-router/selectAppForTypes.js +0 -33
  72. package/dist/collection/components/pos-type-router/selectAppForTypes.js.map +0 -1
  73. package/dist/elements/p-61cd1259.js +0 -2
  74. package/dist/elements/p-61cd1259.js.map +0 -1
  75. package/dist/elements/p-d303d82c.entry.js.map +0 -1
  76. package/dist/esm/app-globals-fd9221d0.js.map +0 -1
  77. package/dist/esm/ion-icon_32.entry.js.map +0 -1
  78. package/dist/types/components/pos-type-router/selectAppForTypes.d.ts +0 -9
@@ -1,42 +1,42 @@
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 $,e as z,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"./p-bde7428a.js";import"./p-30cd90ec.js";let K;const F=()=>{if(typeof window==="undefined"){return new Map}else{if(!K){const t=window;t.Ionicons=t.Ionicons||{};K=t.Ionicons.map=t.Ionicons.map||new Map}return K}};const X=t=>{let e=q(t.src);if(e){return e}e=Y(t.name,t.icon,t.mode,t.ios,t.md);if(e){return V(e,t)}if(t.icon){e=q(t.icon);if(e){return e}e=q(t.icon[t.mode]);if(e){return e}}return null};const V=(e,n)=>{const i=F().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 Y=(t,e,n,i,s)=>{n=(n&&Q(n))==="ios"?"ios":"md";if(i&&n==="ios"){t=Q(i)}else if(s&&n==="md"){t=Q(s)}else{if(!t&&e&&!G(e)){t=e}if(Z(t)){t=Q(t)}}if(!Z(t)||t.trim()===""){return null}const r=t.replace(/[a-z]|-|\d/gi,"");if(r!==""){return null}return t};const q=t=>{if(Z(t)){t=t.trim();if(G(t)){return t}}return null};const G=t=>t.length>0&&/(\/|\.)/.test(t);const Z=t=>typeof t==="string";const Q=t=>t.toLowerCase();const tt=(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 et=t=>{if(t){if(t.dir!==""){return t.dir.toLowerCase()==="rtl"}}return(document===null||document===void 0?void 0:document.dir.toLowerCase())==="rtl"};const nt=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(it(n)){return e.innerHTML}}return""};const it=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(Z(n)&&n.toLowerCase().indexOf("on")===0){return false}}for(let e=0;e<t.childNodes.length;e++){if(!it(t.childNodes[e])){return false}}}return true};const st=t=>t.startsWith("data:image/svg+xml");const rt=t=>t.indexOf(";utf8,")!==-1;const ot=new Map;const at=new Map;let ct;const lt=(t,e)=>{let n=at.get(t);if(!n){if(typeof fetch!=="undefined"&&typeof document!=="undefined"){if(st(t)&&rt(t)){if(!ct){ct=new DOMParser}const e=ct.parseFromString(t,"text/html");const n=e.querySelector("svg");if(n){ot.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=nt(n)}ot.set(t,n||"")}))}ot.set(t,"")}));at.set(t,n)}}else{ot.set(t,"");return Promise.resolve()}}return n};const ht=":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 dt=ht;const ut=class{constructor(t){e(this,t);this.iconName=null;this.inheritedAttributes={};this.didLoadIcon=false;this.svgContent=undefined;this.isVisible=false;this.mode=ft();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=tt(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=X(this);if(t){if(ot.has(t)){this.svgContent=ot.get(t)}else{lt(t,this.sanitize).then((()=>this.svgContent=ot.get(t)))}this.didLoadIcon=true}}this.iconName=Y(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},pt(this.color)),{[`icon-${this.size}`]:!!this.size,"flip-rtl":c,"icon-rtl":c&&et(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 ft=()=>typeof document!=="undefined"&&document.documentElement.getAttribute("mode")||"md";const pt=t=>t?{"ion-color":true,[`ion-color-${t}`]:true}:null;ut.style=dt;const bt=":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 mt=bt;const gt=":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 wt=gt;const vt=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"?yt():kt(r,o))}};const yt=()=>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 kt=(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})`}})]};vt.style={ios:mt,md:wt};const xt=":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 St=xt;const _t=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+At;const h=Math.floor(c*Ct);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((()=>{Et(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 Et=t=>{t.classList.add("fade-out");setTimeout((()=>{t.remove()}),200)};const At=10;const Ct=.5;_t.style=St;const Tt=":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 $t=Tt;const zt=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)}};zt.style=$t;
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 $,e as z,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 $t=(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 zt=":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=zt;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{$t(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
- */function Pt(t,e,n,i){let s;if(n==="md"){s=t==="top"?8:-8}else{s=t==="top"?10:-10}if(e&&D){It(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 It(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 Rt=(t,e)=>Math.floor(t/2-e/2);
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);
5
5
  /*!
6
6
  * (C) Ionic http://ionicframework.com - MIT License
7
- */const Ot=(t,e)=>{const n=O();const i=O();const{position:s,top:r,bottom:o}=e;const a=d(t);const c=a.querySelector(".toast-wrapper");i.addElement(c);switch(s){case"top":i.fromTo("transform","translateY(-100%)",`translateY(${r})`);break;case"middle":const e=Rt(t.clientHeight,c.clientHeight);c.style.top=`${e}px`;i.fromTo("opacity",.01,1);break;default:i.fromTo("transform","translateY(100%)",`translateY(${o})`);break}return n.easing("cubic-bezier(.155,1.105,.295,1.12)").duration(400).addAnimation(i)};
7
+ */const te=(t,e)=>{const n=O();const i=O();const{position:s,top:r,bottom:o}=e;const a=d(t);const c=a.querySelector(".toast-wrapper");i.addElement(c);switch(s){case"top":i.fromTo("transform","translateY(-100%)",`translateY(${r})`);break;case"middle":const e=Qt(t.clientHeight,c.clientHeight);c.style.top=`${e}px`;i.fromTo("opacity",.01,1);break;default:i.fromTo("transform","translateY(100%)",`translateY(${o})`);break}return n.easing("cubic-bezier(.155,1.105,.295,1.12)").duration(400).addAnimation(i)};
8
8
  /*!
9
9
  * (C) Ionic http://ionicframework.com - MIT License
10
- */const Dt=(t,e)=>{const n=O();const i=O();const{position:s,top:r,bottom:o}=e;const a=d(t);const c=a.querySelector(".toast-wrapper");i.addElement(c);switch(s){case"top":i.fromTo("transform",`translateY(${r})`,"translateY(-100%)");break;case"middle":i.fromTo("opacity",.99,0);break;default:i.fromTo("transform",`translateY(${o})`,"translateY(100%)");break}return n.easing("cubic-bezier(.36,.66,.04,1)").duration(300).addAnimation(i)};
10
+ */const ee=(t,e)=>{const n=O();const i=O();const{position:s,top:r,bottom:o}=e;const a=d(t);const c=a.querySelector(".toast-wrapper");i.addElement(c);switch(s){case"top":i.fromTo("transform",`translateY(${r})`,"translateY(-100%)");break;case"middle":i.fromTo("opacity",.99,0);break;default:i.fromTo("transform",`translateY(${o})`,"translateY(100%)");break}return n.easing("cubic-bezier(.36,.66,.04,1)").duration(300).addAnimation(i)};
11
11
  /*!
12
12
  * (C) Ionic http://ionicframework.com - MIT License
13
- */const jt=(t,e)=>{const n=O();const i=O();const{position:s,top:r,bottom:o}=e;const a=d(t);const c=a.querySelector(".toast-wrapper");i.addElement(c);switch(s){case"top":c.style.setProperty("transform",`translateY(${r})`);i.fromTo("opacity",.01,1);break;case"middle":const e=Rt(t.clientHeight,c.clientHeight);c.style.top=`${e}px`;i.fromTo("opacity",.01,1);break;default:c.style.setProperty("transform",`translateY(${o})`);i.fromTo("opacity",.01,1);break}return n.easing("cubic-bezier(.36,.66,.04,1)").duration(400).addAnimation(i)};
13
+ */const ne=(t,e)=>{const n=O();const i=O();const{position:s,top:r,bottom:o}=e;const a=d(t);const c=a.querySelector(".toast-wrapper");i.addElement(c);switch(s){case"top":c.style.setProperty("transform",`translateY(${r})`);i.fromTo("opacity",.01,1);break;case"middle":const e=Qt(t.clientHeight,c.clientHeight);c.style.top=`${e}px`;i.fromTo("opacity",.01,1);break;default:c.style.setProperty("transform",`translateY(${o})`);i.fromTo("opacity",.01,1);break}return n.easing("cubic-bezier(.36,.66,.04,1)").duration(400).addAnimation(i)};
14
14
  /*!
15
15
  * (C) Ionic http://ionicframework.com - MIT License
16
- */const Lt=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)};
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 Mt=(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=Rt(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 Wt=":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 Ut=Wt;const Ht=":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 Nt=Ht;const Jt=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=Mt(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=Pt(n,i,g(this),e);this.lastPresentedPosition=s;await T(this,"toastEnter",Ot,jt,{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 $(this,t,e,"toastLeave",Dt,Lt,{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 z(this.el,"ionToastDidDismiss")}onWillDismiss(){return z(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:Bt(t),tabIndex:0,onClick:()=>this.buttonClick(t),part:Kt(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 Bt=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 Kt=t=>E(t.role)?"button cancel":"button";Jt.style={ios:Ut,md:Nt};const Ft=":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 Xt=Ft;const Vt=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})))}};Vt.style=Xt;const Yt=localStorage.getItem("settings");const qt=Yt?JSON.parse(Yt):{offlineCache:false};const Gt=L(qt);Zt();Qt();function Zt(){Gt.on("set",(()=>{const t=JSON.stringify(Gt.state);localStorage.setItem("settings",t)}))}function Qt(){window.addEventListener("storage",(t=>{if(t.key==="settings"&&t.newValue){const e=JSON.parse(t.newValue);Gt.state.offlineCache=e.offlineCache}}))}const te=(t,e)=>e.some((e=>t instanceof e));let ee;let ne;function ie(){return ee||(ee=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function se(){return ne||(ne=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const re=new WeakMap;const oe=new WeakMap;const ae=new WeakMap;function ce(t){const e=new Promise(((e,n)=>{const i=()=>{t.removeEventListener("success",s);t.removeEventListener("error",r)};const s=()=>{e(pe(t.result));i()};const r=()=>{n(t.error);i()};t.addEventListener("success",s);t.addEventListener("error",r)}));ae.set(e,t);return e}function le(t){if(re.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)}));re.set(t,e)}let he={get(t,e,n){if(t instanceof IDBTransaction){if(e==="done")return re.get(t);if(e==="store"){return n.objectStoreNames[1]?undefined:n.objectStore(n.objectStoreNames[0])}}return pe(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 de(t){he=t(he)}function ue(t){if(se().includes(t)){return function(...e){t.apply(be(this),e);return pe(this.request)}}return function(...e){return pe(t.apply(be(this),e))}}function fe(t){if(typeof t==="function")return ue(t);if(t instanceof IDBTransaction)le(t);if(te(t,ie()))return new Proxy(t,he);return t}function pe(t){if(t instanceof IDBRequest)return ce(t);if(oe.has(t))return oe.get(t);const e=fe(t);if(e!==t){oe.set(t,e);ae.set(e,t)}return e}const be=t=>ae.get(t);function me(t,e,{blocked:n,upgrade:i,blocking:s,terminated:r}={}){const o=indexedDB.open(t,e);const a=pe(o);if(i){o.addEventListener("upgradeneeded",(t=>{i(pe(o.result),t.oldVersion,t.newVersion,pe(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 ge=["get","getKey","getAll","getAllKeys","count"];const we=["put","add","delete","clear"];const ve=new Map;function ye(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e==="string")){return}if(ve.get(e))return ve.get(e);const n=e.replace(/FromIndex$/,"");const i=e!==n;const s=we.includes(n);if(!(n in(i?IDBIndex:IDBObjectStore).prototype)||!(s||ge.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]};ve.set(e,r);return r}de((t=>({...t,get:(e,n,i)=>ye(e,n)||t.get(e,n,i),has:(e,n)=>!!ye(e,n)||t.has(e,n)})));const ke=["continue","continuePrimaryKey","advance"];const xe={};const Se=new WeakMap;const _e=new WeakMap;const Ee={get(t,e){if(!ke.includes(e))return t[e];let n=xe[e];if(!n){n=xe[e]=function(...t){Se.set(this,_e.get(this)[e](...t))}}return n}};async function*Ae(...t){let e=this;if(!(e instanceof IDBCursor)){e=await e.openCursor(...t)}if(!e)return;e=e;const n=new Proxy(e,Ee);_e.set(n,e);ae.set(n,be(e));while(e){yield n;e=await(Se.get(n)||e.continue());Se.delete(n)}}function Ce(t,e){return e===Symbol.asyncIterator&&te(t,[IDBIndex,IDBObjectStore,IDBCursor])||e==="iterate"&&te(t,[IDBIndex,IDBObjectStore])}de((t=>({...t,get(e,n,i){if(Ce(e,n))return Ae;return t.get(e,n,i)},has(e,n){return Ce(e,n)||t.has(e,n)}})));class Te{constructor(){this.dbPromise=me("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 $e{isOnline(){return navigator.onLine}}const ze=(t,e)=>new U({session:t,offlineCache:e.offlineCache?new Te:new H,onlineStatus:new $e});function Pe(t){return typeof t==="function"}function Ie(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 Re=Ie((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 Oe(t,e){if(t){const n=t.indexOf(e);0<=n&&t.splice(n,1)}}class De{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(Pe(n)){try{n()}catch(e){t=e instanceof Re?e.errors:[e]}}const{_finalizers:i}=this;if(i){this._finalizers=null;for(const e of i){try{Me(e)}catch(e){t=t!==null&&t!==void 0?t:[];if(e instanceof Re){t=[...t,...e.errors]}else{t.push(e)}}}}if(t){throw new Re(t)}}}add(t){var e;if(t&&t!==this){if(this.closed){Me(t)}else{if(t instanceof De){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)){Oe(e,t)}}remove(t){const{_finalizers:e}=this;e&&Oe(e,t);if(t instanceof De){t._removeParent(this)}}}De.EMPTY=(()=>{const t=new De;t.closed=true;return t})();const je=De.EMPTY;function Le(t){return t instanceof De||t&&"closed"in t&&Pe(t.remove)&&Pe(t.add)&&Pe(t.unsubscribe)}function Me(t){if(Pe(t)){t()}else{t.unsubscribe()}}const We={onUnhandledError:null,onStoppedNotification:null,Promise:undefined,useDeprecatedSynchronousErrorHandling:false,useDeprecatedNextContext:false};const Ue={setTimeout(t,e,...n){const{delegate:i}=Ue;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}=Ue;return((e===null||e===void 0?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:undefined};function He(t){Ue.setTimeout((()=>{const{onUnhandledError:e}=We;if(e){e(t)}else{throw t}}))}function Ne(){}const Je=(()=>Fe("C",undefined,undefined))();function Be(t){return Fe("E",undefined,t)}function Ke(t){return Fe("N",t,undefined)}function Fe(t,e,n){return{kind:t,value:e,error:n}}let Xe=null;function Ve(t){if(We.useDeprecatedSynchronousErrorHandling){const e=!Xe;if(e){Xe={errorThrown:false,error:null}}t();if(e){const{errorThrown:t,error:e}=Xe;Xe=null;if(t){throw e}}}else{t()}}class Ye extends De{constructor(t){super();this.isStopped=false;if(t){this.destination=t;if(Le(t)){t.add(this)}}else{this.destination=sn}}static create(t,e,n){return new Qe(t,e,n)}next(t){if(this.isStopped){nn(Ke(t),this)}else{this._next(t)}}error(t){if(this.isStopped){nn(Be(t),this)}else{this.isStopped=true;this._error(t)}}complete(){if(this.isStopped){nn(Je,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 qe=Function.prototype.bind;function Ge(t,e){return qe.call(t,e)}class Ze{constructor(t){this.partialObserver=t}next(t){const{partialObserver:e}=this;if(e.next){try{e.next(t)}catch(t){tn(t)}}}error(t){const{partialObserver:e}=this;if(e.error){try{e.error(t)}catch(t){tn(t)}}else{tn(t)}}complete(){const{partialObserver:t}=this;if(t.complete){try{t.complete()}catch(t){tn(t)}}}}class Qe extends Ye{constructor(t,e,n){super();let i;if(Pe(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&&We.useDeprecatedNextContext){e=Object.create(t);e.unsubscribe=()=>this.unsubscribe();i={next:t.next&&Ge(t.next,e),error:t.error&&Ge(t.error,e),complete:t.complete&&Ge(t.complete,e)}}else{i=t}}this.destination=new Ze(i)}}function tn(t){{He(t)}}function en(t){throw t}function nn(t,e){const{onStoppedNotification:n}=We;n&&Ue.setTimeout((()=>n(t,e)))}const sn={closed:true,next:Ne,error:en,complete:Ne};const rn=(()=>typeof Symbol==="function"&&Symbol.observable||"@@observable")();function on(t){return t}function an(t){if(t.length===0){return on}if(t.length===1){return t[0]}return function e(n){return t.reduce(((t,e)=>e(t)),n)}}class cn{constructor(t){if(t){this._subscribe=t}}lift(t){const e=new cn;e.source=this;e.operator=t;return e}subscribe(t,e,n){const i=dn(t)?t:new Qe(t,e,n);Ve((()=>{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=ln(e);return new e(((e,n)=>{const i=new Qe({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)}[rn](){return this}pipe(...t){return an(t)(this)}toPromise(t){t=ln(t);return new t(((t,e)=>{let n;this.subscribe((t=>n=t),(t=>e(t)),(()=>t(n)))}))}}cn.create=t=>new cn(t);function ln(t){var e;return(e=t!==null&&t!==void 0?t:We.Promise)!==null&&e!==void 0?e:Promise}function hn(t){return t&&Pe(t.next)&&Pe(t.error)&&Pe(t.complete)}function dn(t){return t&&t instanceof Ye||hn(t)&&Le(t)}function un(t){return Pe(t===null||t===void 0?void 0:t.lift)}function fn(t){return e=>{if(un(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 pn(t,e,n,i,s){return new bn(t,e,n,i,s)}class bn extends Ye{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 mn=Ie((t=>function e(){t(this);this.name="ObjectUnsubscribedError";this.message="object unsubscribed"}));class gn extends cn{constructor(){super();this.closed=false;this.currentObservers=null;this.observers=[];this.isStopped=false;this.hasError=false;this.thrownError=null}lift(t){const e=new wn(this,this);e.operator=t;return e}_throwIfClosed(){if(this.closed){throw new mn}}next(t){Ve((()=>{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){Ve((()=>{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(){Ve((()=>{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 je}this.currentObservers=null;i.push(t);return new De((()=>{this.currentObservers=null;Oe(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 cn;t.source=this;return t}}gn.create=(t,e)=>new wn(t,e);class wn extends gn{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:je}}class vn extends gn{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 yn={now(){return(yn.delegate||Date).now()},delegate:undefined};class kn extends De{constructor(t,e){super()}schedule(t,e=0){return this}}const xn={setInterval(t,e,...n){const{delegate:i}=xn;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}=xn;return((e===null||e===void 0?void 0:e.clearInterval)||clearInterval)(t)},delegate:undefined};class Sn extends kn{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 xn.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){xn.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;Oe(n,this);if(t!=null){this.id=this.recycleAsyncId(e,t,null)}this.delay=null;super.unsubscribe()}}}class _n{constructor(t,e=_n.now){this.schedulerActionCtor=t;this.now=e}schedule(t,e=0,n){return new this.schedulerActionCtor(this,t).schedule(n,e)}}_n.now=yn.now;class En extends _n{constructor(t,e=_n.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 An=new En(Sn);function Cn(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 Tn(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 $n(t){return this instanceof $n?(this.v=t,this):new $n(t)}function zn(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 $n?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 Pn(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 Tn==="function"?Tn(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 In=t=>t&&typeof t.length==="number"&&typeof t!=="function";function Rn(t){return Pe(t===null||t===void 0?void 0:t.then)}function On(t){return Pe(t[rn])}function Dn(t){return Symbol.asyncIterator&&Pe(t===null||t===void 0?void 0:t[Symbol.asyncIterator])}function jn(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 Ln(){if(typeof Symbol!=="function"||!Symbol.iterator){return"@@iterator"}return Symbol.iterator}const Mn=Ln();function Wn(t){return Pe(t===null||t===void 0?void 0:t[Mn])}function Un(t){return zn(this,arguments,(function*e(){const n=t.getReader();try{while(true){const{value:t,done:e}=yield $n(n.read());if(e){return yield $n(void 0)}yield yield $n(t)}}finally{n.releaseLock()}}))}function Hn(t){return Pe(t===null||t===void 0?void 0:t.getReader)}function Nn(t){if(t instanceof cn){return t}if(t!=null){if(On(t)){return Jn(t)}if(In(t)){return Bn(t)}if(Rn(t)){return Kn(t)}if(Dn(t)){return Xn(t)}if(Wn(t)){return Fn(t)}if(Hn(t)){return Vn(t)}}throw jn(t)}function Jn(t){return new cn((e=>{const n=t[rn]();if(Pe(n.subscribe)){return n.subscribe(e)}throw new TypeError("Provided object does not correctly implement Symbol.observable")}))}function Bn(t){return new cn((e=>{for(let n=0;n<t.length&&!e.closed;n++){e.next(t[n])}e.complete()}))}function Kn(t){return new cn((e=>{t.then((t=>{if(!e.closed){e.next(t);e.complete()}}),(t=>e.error(t))).then(null,He)}))}function Fn(t){return new cn((e=>{for(const n of t){e.next(n);if(e.closed){return}}e.complete()}))}function Xn(t){return new cn((e=>{Yn(t,e).catch((t=>e.error(t)))}))}function Vn(t){return Xn(Un(t))}function Yn(t,e){var n,i;var s,r;return Cn(this,void 0,void 0,(function*(){try{for(n=Pn(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 qn(t,e=An){return fn(((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(pn(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 Gn(t){return fn(((e,n)=>{Nn(t).subscribe(pn(n,(()=>n.complete()),Ne));!n.closed&&e.subscribe(n)}))}var Zn=crypto;const Qn=t=>t instanceof CryptoKey;const ti=async(t,e)=>{const n=`SHA-${t.slice(-3)}`;return new Uint8Array(await Zn.subtle.digest(n,e))};var ei=ti;const ni=new TextEncoder;const ii=new TextDecoder;function si(...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 ri=t=>{let e=t;if(typeof e==="string"){e=ni.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 oi=t=>ri(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_");const ai=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 ci=t=>{let e=t;if(e instanceof Uint8Array){e=ii.decode(e)}e=e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return ai(e)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}};class li extends Error{constructor(t,e){super(t,e);this.code="ERR_JOSE_GENERIC";this.name=this.constructor.name;Error.captureStackTrace?.(this,this.constructor)}}li.code="ERR_JOSE_GENERIC";class hi extends li{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}}hi.code="ERR_JWT_CLAIM_VALIDATION_FAILED";class di extends li{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}}di.code="ERR_JWT_EXPIRED";class ui extends li{constructor(){super(...arguments);this.code="ERR_JOSE_ALG_NOT_ALLOWED"}}ui.code="ERR_JOSE_ALG_NOT_ALLOWED";class fi extends li{constructor(){super(...arguments);this.code="ERR_JOSE_NOT_SUPPORTED"}}fi.code="ERR_JOSE_NOT_SUPPORTED";class pi extends li{constructor(t="decryption operation failed",e){super(t,e);this.code="ERR_JWE_DECRYPTION_FAILED"}}pi.code="ERR_JWE_DECRYPTION_FAILED";class bi extends li{constructor(){super(...arguments);this.code="ERR_JWE_INVALID"}}bi.code="ERR_JWE_INVALID";class mi extends li{constructor(){super(...arguments);this.code="ERR_JWS_INVALID"}}mi.code="ERR_JWS_INVALID";class gi extends li{constructor(){super(...arguments);this.code="ERR_JWT_INVALID"}}gi.code="ERR_JWT_INVALID";class wi extends li{constructor(){super(...arguments);this.code="ERR_JWK_INVALID"}}wi.code="ERR_JWK_INVALID";class vi extends li{constructor(){super(...arguments);this.code="ERR_JWKS_INVALID"}}vi.code="ERR_JWKS_INVALID";class yi extends li{constructor(t="no applicable key found in the JSON Web Key Set",e){super(t,e);this.code="ERR_JWKS_NO_MATCHING_KEY"}}yi.code="ERR_JWKS_NO_MATCHING_KEY";class ki extends li{constructor(t="multiple matching keys found in the JSON Web Key Set",e){super(t,e);this.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS"}}ki.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";class xi extends li{constructor(t="request timed out",e){super(t,e);this.code="ERR_JWKS_TIMEOUT"}}xi.code="ERR_JWKS_TIMEOUT";class Si extends li{constructor(t="signature verification failed",e){super(t,e);this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}}Si.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";function _i(t,e="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${e} must be ${t}`)}function Ei(t,e){return t.name===e}function Ai(t){return parseInt(t.name.slice(4),10)}function Ci(t){switch(t){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}function Ti(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 $i(t,e,...n){switch(e){case"HS256":case"HS384":case"HS512":{if(!Ei(t.algorithm,"HMAC"))throw _i("HMAC");const n=parseInt(e.slice(2),10);const i=Ai(t.algorithm.hash);if(i!==n)throw _i(`SHA-${n}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!Ei(t.algorithm,"RSASSA-PKCS1-v1_5"))throw _i("RSASSA-PKCS1-v1_5");const n=parseInt(e.slice(2),10);const i=Ai(t.algorithm.hash);if(i!==n)throw _i(`SHA-${n}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!Ei(t.algorithm,"RSA-PSS"))throw _i("RSA-PSS");const n=parseInt(e.slice(2),10);const i=Ai(t.algorithm.hash);if(i!==n)throw _i(`SHA-${n}`,"algorithm.hash");break}case"EdDSA":{if(t.algorithm.name!=="Ed25519"&&t.algorithm.name!=="Ed448"){throw _i("Ed25519 or Ed448")}break}case"Ed25519":{if(!Ei(t.algorithm,"Ed25519"))throw _i("Ed25519");break}case"ES256":case"ES384":case"ES512":{if(!Ei(t.algorithm,"ECDSA"))throw _i("ECDSA");const n=Ci(e);const i=t.algorithm.namedCurve;if(i!==n)throw _i(n,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}Ti(t,n)}function zi(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 Pi=(t,...e)=>zi("Key must be ",t,...e);function Ii(t,e,...n){return zi(`Key for the ${t} algorithm must be `,e,...n)}var Ri=t=>{if(Qn(t)){return true}return t?.[Symbol.toStringTag]==="KeyObject"};const Oi=["CryptoKey"];const Di=(...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 ji=Di;function Li(t){return typeof t==="object"&&t!==null}function Mi(t){if(!Li(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 Wi=(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 Ui(t){return Mi(t)&&typeof t.kty==="string"}function Hi(t){return t.kty!=="oct"&&typeof t.d==="string"}function Ni(t){return t.kty!=="oct"&&typeof t.d==="undefined"}function Ji(t){return Ui(t)&&t.kty==="oct"&&typeof t.k==="string"}function Bi(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 fi('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 fi('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 fi('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}default:throw new fi('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:e,keyUsages:n}}const Ki=async t=>{if(!t.alg){throw new TypeError('"alg" argument is required when "jwk.alg" is not present')}const{algorithm:e,keyUsages:n}=Bi(t);const i=[e,t.ext??false,t.key_ops??n];const s={...t};delete s.alg;delete s.use;return Zn.subtle.importKey("jwk",s,...i)};var Fi=Ki;const Xi=t=>ci(t);let Vi;let Yi;const qi=t=>t?.[Symbol.toStringTag]==="KeyObject";const Gi=async(t,e,n,i,s=false)=>{let r=t.get(e);if(r?.[i]){return r[i]}const o=await Fi({...n,alg:i});if(s)Object.freeze(e);if(!r){t.set(e,{[i]:o})}else{r[i]=o}return o};const Zi=(t,e)=>{if(qi(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 Xi(n.k)}Yi||(Yi=new WeakMap);return Gi(Yi,t,n,e)}if(Ui(t)){if(t.k)return ci(t.k);Yi||(Yi=new WeakMap);const n=Gi(Yi,t,t,e,true);return n}return t};const Qi=(t,e)=>{if(qi(t)){let n=t.export({format:"jwk"});if(n.k){return Xi(n.k)}Vi||(Vi=new WeakMap);return Gi(Vi,t,n,e)}if(Ui(t)){if(t.k)return ci(t.k);Vi||(Vi=new WeakMap);const n=Gi(Vi,t,t,e,true);return n}return t};var ts={normalizePublicKey:Zi,normalizePrivateKey:Qi};async function es(t,e){if(!Mi(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 ci(t.k);case"RSA":if("oth"in t&&t.oth!==undefined){throw new fi('RSA JWK "oth" (Other Primes Info) Parameter value is not supported')}case"EC":case"OKP":return Fi({...t,alg:e});default:throw new fi('Unsupported "kty" (Key Type) Parameter value')}}const ns=t=>t?.[Symbol.toStringTag];const is=(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 ss=(t,e,n,i)=>{if(e instanceof Uint8Array)return;if(i&&Ui(e)){if(Ji(e)&&is(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(!Ri(e)){throw new TypeError(Ii(t,e,...Oi,"Uint8Array",i?"JSON Web Key":null))}if(e.type!=="secret"){throw new TypeError(`${ns(e)} instances for symmetric algorithms must be of type "secret"`)}};const rs=(t,e,n,i)=>{if(i&&Ui(e)){switch(n){case"sign":if(Hi(e)&&is(t,e,n))return;throw new TypeError(`JSON Web Key for this operation be a private JWK`);case"verify":if(Ni(e)&&is(t,e,n))return;throw new TypeError(`JSON Web Key for this operation be a public JWK`)}}if(!Ri(e)){throw new TypeError(Ii(t,e,...Oi,i?"JSON Web Key":null))}if(e.type==="secret"){throw new TypeError(`${ns(e)} instances for asymmetric algorithms must not be of type "secret"`)}if(n==="sign"&&e.type==="public"){throw new TypeError(`${ns(e)} instances for asymmetric algorithm signing must be of type "private"`)}if(n==="decrypt"&&e.type==="public"){throw new TypeError(`${ns(e)} instances for asymmetric algorithm decryption must be of type "private"`)}if(e.algorithm&&n==="verify"&&e.type==="private"){throw new TypeError(`${ns(e)} instances for asymmetric algorithm verifying must be of type "public"`)}if(e.algorithm&&n==="encrypt"&&e.type==="private"){throw new TypeError(`${ns(e)} instances for asymmetric algorithm encryption must be of type "public"`)}};function os(t,e,n,i){const s=e.startsWith("HS")||e==="dir"||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e);if(s){ss(e,n,i,t)}else{rs(e,n,i,t)}}os.bind(undefined,false);const as=os.bind(undefined,true);function cs(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 fi(`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 ls=(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 hs=ls;const ds=async t=>{if(t instanceof Uint8Array){return{kty:"oct",k:oi(t)}}if(!Qn(t)){throw new TypeError(Pi(t,...Oi,"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 Zn.subtle.exportKey("jwk",t);return r};var us=ds;async function fs(t){return us(t)}function ps(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 fi(`alg ${t} is not supported either by JOSE or your javascript runtime`)}}async function bs(t,e,n){if(n==="sign"){e=await ts.normalizePrivateKey(e,t)}if(n==="verify"){e=await ts.normalizePublicKey(e,t)}if(Qn(e)){$i(e,t,n);return e}if(e instanceof Uint8Array){if(!t.startsWith("HS")){throw new TypeError(Pi(e,...Oi))}return Zn.subtle.importKey("raw",e,{hash:`SHA-${t.slice(-3)}`,name:"HMAC"},false,[n])}throw new TypeError(Pi(e,...Oi,"Uint8Array","JSON Web Key"))}const ms=async(t,e,n,i)=>{const s=await bs(t,e,"verify");Wi(t,s);const r=ps(t,s.algorithm);try{return await Zn.subtle.verify(r,s,n,i)}catch{return false}};var gs=ms;async function ws(t,e,n){if(!Mi(t)){throw new mi("Flattened JWS must be an object")}if(t.protected===undefined&&t.header===undefined){throw new mi('Flattened JWS must have either of the "protected" or "header" members')}if(t.protected!==undefined&&typeof t.protected!=="string"){throw new mi("JWS Protected Header incorrect type")}if(t.payload===undefined){throw new mi("JWS Payload missing")}if(typeof t.signature!=="string"){throw new mi("JWS Signature missing or incorrect type")}if(t.header!==undefined&&!Mi(t.header)){throw new mi("JWS Unprotected Header incorrect type")}let i={};if(t.protected){try{const e=ci(t.protected);i=JSON.parse(ii.decode(e))}catch{throw new mi("JWS Protected Header is invalid")}}if(!ji(i,t.header)){throw new mi("JWS Protected and JWS Unprotected Header Parameter names must be disjoint")}const s={...i,...t.header};const r=cs(mi,new Map([["b64",true]]),n?.crit,i,s);let o=true;if(r.has("b64")){o=i.b64;if(typeof o!=="boolean"){throw new mi('The "b64" (base64url-encode payload) Header Parameter must be a boolean')}}const{alg:a}=s;if(typeof a!=="string"||!a){throw new mi('JWS "alg" (Algorithm) Header Parameter missing or invalid')}const c=n&&hs("algorithms",n.algorithms);if(c&&!c.has(a)){throw new ui('"alg" (Algorithm) Header Parameter value not allowed')}if(o){if(typeof t.payload!=="string"){throw new mi("JWS Payload must be a string")}}else if(typeof t.payload!=="string"&&!(t.payload instanceof Uint8Array)){throw new mi("JWS Payload must be a string or an Uint8Array instance")}let l=false;if(typeof e==="function"){e=await e(i,t);l=true;as(a,e,"verify");if(Ui(e)){e=await es(e,a)}}else{as(a,e,"verify")}const h=si(ni.encode(t.protected??""),ni.encode("."),typeof t.payload==="string"?ni.encode(t.payload):t.payload);let d;try{d=ci(t.signature)}catch{throw new mi("Failed to base64url decode the signature")}const u=await gs(a,e,d,h);if(!u){throw new Si}let f;if(o){try{f=ci(t.payload)}catch{throw new mi("Failed to base64url decode the payload")}}else if(typeof t.payload==="string"){f=ni.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 vs(t,e,n){if(t instanceof Uint8Array){t=ii.decode(t)}if(typeof t!=="string"){throw new mi("Compact JWS must be a string or Uint8Array")}const{0:i,1:s,2:r,length:o}=t.split(".");if(o!==3){throw new mi("Invalid Compact JWS")}const a=await ws({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 ys=t=>Math.floor(t.getTime()/1e3);const ks=60;const xs=ks*60;const Ss=xs*24;const _s=Ss*7;const Es=Ss*365.25;const As=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;var Cs=t=>{const e=As.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*ks);break;case"hour":case"hours":case"hr":case"hrs":case"h":s=Math.round(n*xs);break;case"day":case"days":case"d":s=Math.round(n*Ss);break;case"week":case"weeks":case"w":s=Math.round(n*_s);break;default:s=Math.round(n*Es);break}if(e[1]==="-"||e[4]==="ago"){return-s}return s};const Ts=t=>t.toLowerCase().replace(/^application\//,"");const $s=(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 zs=(t,e,n={})=>{let i;try{i=JSON.parse(ii.decode(e))}catch{}if(!Mi(i)){throw new gi("JWT Claims Set must be a top-level JSON object")}const{typ:s}=n;if(s&&(typeof t.typ!=="string"||Ts(t.typ)!==Ts(s))){throw new hi('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 hi(`missing required "${t}" claim`,i,t,"missing")}}if(o&&!(Array.isArray(o)?o:[o]).includes(i.iss)){throw new hi('unexpected "iss" claim value',i,"iss","check_failed")}if(a&&i.sub!==a){throw new hi('unexpected "sub" claim value',i,"sub","check_failed")}if(c&&!$s(i.aud,typeof c==="string"?[c]:c)){throw new hi('unexpected "aud" claim value',i,"aud","check_failed")}let d;switch(typeof n.clockTolerance){case"string":d=Cs(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=ys(u||new Date);if((i.iat!==undefined||l)&&typeof i.iat!=="number"){throw new hi('"iat" claim must be a number',i,"iat","invalid")}if(i.nbf!==undefined){if(typeof i.nbf!=="number"){throw new hi('"nbf" claim must be a number',i,"nbf","invalid")}if(i.nbf>f+d){throw new hi('"nbf" claim timestamp check failed',i,"nbf","check_failed")}}if(i.exp!==undefined){if(typeof i.exp!=="number"){throw new hi('"exp" claim must be a number',i,"exp","invalid")}if(i.exp<=f-d){throw new di('"exp" claim timestamp check failed',i,"exp","check_failed")}}if(l){const t=f-i.iat;const e=typeof l==="number"?l:Cs(l);if(t-d>e){throw new di('"iat" claim timestamp check failed (too far in the past)',i,"iat","check_failed")}if(t<0-d){throw new hi('"iat" claim timestamp check failed (it should be in the past)',i,"iat","check_failed")}}return i};async function Ps(t,e,n){const i=await vs(t,e,n);if(i.protectedHeader.crit?.includes("b64")&&i.protectedHeader.b64===false){throw new gi("JWTs MUST NOT use unencoded payload")}const s=zs(i.protectedHeader,i.payload,n);const r={payload:s,protectedHeader:i.protectedHeader};if(typeof e==="function"){return{...r,key:i.key}}return r}const Is=async(t,e,n)=>{const i=await bs(t,e,"sign");Wi(t,i);const s=await Zn.subtle.sign(ps(t,i.algorithm),i,n);return new Uint8Array(s)};var Rs=Is;class Os{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 mi("either setProtectedHeader or setUnprotectedHeader must be called before #sign()")}if(!ji(this._protectedHeader,this._unprotectedHeader)){throw new mi("JWS Protected and JWS Unprotected Header Parameter names must be disjoint")}const n={...this._protectedHeader,...this._unprotectedHeader};const i=cs(mi,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 mi('The "b64" (base64url-encode payload) Header Parameter must be a boolean')}}const{alg:r}=n;if(typeof r!=="string"||!r){throw new mi('JWS "alg" (Algorithm) Header Parameter missing or invalid')}as(r,t,"sign");let o=this._payload;if(s){o=ni.encode(oi(o))}let a;if(this._protectedHeader){a=ni.encode(oi(JSON.stringify(this._protectedHeader)))}else{a=ni.encode("")}const c=si(a,ni.encode("."),o);const l=await Rs(r,t,c);const h={signature:oi(l),payload:""};if(s){h.payload=ii.decode(o)}if(this._unprotectedHeader){h.header=this._unprotectedHeader}if(this._protectedHeader){h.protected=ii.decode(a)}return h}}class Ds{constructor(t){this._flattened=new Os(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 js(t,e){if(!Number.isFinite(e)){throw new TypeError(`Invalid ${t} input`)}return e}class Ls{constructor(t={}){if(!Mi(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:js("setNotBefore",t)}}else if(t instanceof Date){this._payload={...this._payload,nbf:js("setNotBefore",ys(t))}}else{this._payload={...this._payload,nbf:ys(new Date)+Cs(t)}}return this}setExpirationTime(t){if(typeof t==="number"){this._payload={...this._payload,exp:js("setExpirationTime",t)}}else if(t instanceof Date){this._payload={...this._payload,exp:js("setExpirationTime",ys(t))}}else{this._payload={...this._payload,exp:ys(new Date)+Cs(t)}}return this}setIssuedAt(t){if(typeof t==="undefined"){this._payload={...this._payload,iat:ys(new Date)}}else if(t instanceof Date){this._payload={...this._payload,iat:js("setIssuedAt",ys(t))}}else if(typeof t==="string"){this._payload={...this._payload,iat:js("setIssuedAt",ys(new Date)+Cs(t))}}else{this._payload={...this._payload,iat:js("setIssuedAt",t)}}return this}}class Ms extends Ls{setProtectedHeader(t){this._protectedHeader=t;return this}async sign(t,e){const n=new Ds(ni.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 gi("JWTs MUST NOT use unencoded payload")}return n.sign(t,e)}}const Ws=(t,e)=>{if(typeof t!=="string"||!t){throw new wi(`${e} missing or invalid`)}};async function Us(t,e){if(!Mi(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":Ws(t.crv,'"crv" (Curve) Parameter');Ws(t.x,'"x" (X Coordinate) Parameter');Ws(t.y,'"y" (Y Coordinate) Parameter');n={crv:t.crv,kty:t.kty,x:t.x,y:t.y};break;case"OKP":Ws(t.crv,'"crv" (Subtype of Key Pair) Parameter');Ws(t.x,'"x" (Public Key) Parameter');n={crv:t.crv,kty:t.kty,x:t.x};break;case"RSA":Ws(t.e,'"e" (Exponent) Parameter');Ws(t.n,'"n" (Modulus) Parameter');n={e:t.e,kty:t.kty,n:t.n};break;case"oct":Ws(t.k,'"k" (Key Value) Parameter');n={k:t.k,kty:t.kty};break;default:throw new fi('"kty" (Key Type) Parameter missing or unsupported')}const i=ni.encode(JSON.stringify(n));return oi(await ei(e,i))}function Hs(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 fi('Unsupported "alg" value for a JSON Web Key Set')}}function Ns(t){return t&&typeof t==="object"&&Array.isArray(t.keys)&&t.keys.every(Js)}function Js(t){return Mi(t)}function Bs(t){if(typeof structuredClone==="function"){return structuredClone(t)}return JSON.parse(JSON.stringify(t))}class Ks{constructor(t){this._cached=new WeakMap;if(!Ns(t)){throw new vi("JSON Web Key Set malformed")}this._jwks=Bs(t)}async getKey(t,e){const{alg:n,kid:i}={...t,...e?.header};const s=Hs(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 yi}if(a!==1){const t=new ki;const{_cached:e}=this;t[Symbol.asyncIterator]=async function*(){for(const t of r){try{yield await Fs(e,t,n)}catch{}}};throw t}return Fs(this._cached,o,n)}}async function Fs(t,e,n){const i=t.get(e)||t.set(e,{}).get(e);if(i[n]===undefined){const t=await es({...e,ext:true},n);if(t instanceof Uint8Array||t.type!=="public"){throw new vi("JSON Web Key Set members must be public keys")}i[n]=t}return i[n]}function Xs(t){const e=new Ks(t);const n=async(t,n)=>e.getKey(t,n);Object.defineProperties(n,{jwks:{value:()=>Bs(e._jwks),enumerable:true,configurable:false,writable:false}});return n}const Vs=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 xi;throw t}));if(s!==undefined)clearTimeout(s);if(o.status!==200){throw new li("Expected 200 OK from the JSON Web Key Set HTTP response")}try{return await o.json()}catch{throw new li("Failed to parse the JSON Web Key Set HTTP response as JSON")}};var Ys=Vs;function qs(){return typeof WebSocketPair!=="undefined"||typeof navigator!=="undefined"&&navigator.userAgent==="Cloudflare-Workers"||typeof EdgeRuntime!=="undefined"&&EdgeRuntime==="vercel"}let Gs;if(typeof navigator==="undefined"||!navigator.userAgent?.startsWith?.("Mozilla/5.0 ")){const t="jose";const e="v5.10.0";Gs=`${t}/${e}`}const Zs=Symbol();function Qs(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)||!Mi(t.jwks)||!Array.isArray(t.jwks.keys)||!Array.prototype.every.call(t.jwks.keys,Mi)){return false}return true}class tr{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?.[Zs]!==undefined){this._cache=e?.[Zs];if(Qs(e?.[Zs],this._cacheMaxAge)){this._jwksTimestamp=this._cache.uat;this._local=Xs(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 yi){if(this.coolingDown()===false){await this.reload();return this._local(t,e)}}throw n}}async reload(){if(this._pendingFetch&&qs()){this._pendingFetch=undefined}const t=new Headers(this._options.headers);if(Gs&&!t.has("User-Agent")){t.set("User-Agent",Gs);this._options.headers=Object.fromEntries(t.entries())}this._pendingFetch||(this._pendingFetch=Ys(this._url,this._timeoutDuration,this._options).then((t=>{this._local=Xs(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 er(t,e){const n=new tr(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 nr=ci;function ir(t){if(typeof t!=="string")throw new gi("JWTs must use Compact JWS serialization, JWT must be a string");const{1:e,length:n}=t.split(".");if(n===5)throw new gi("Only JWTs using Compact JWS serialization can be decoded");if(n!==3)throw new gi("Invalid JWT");if(!e)throw new gi("JWTs must contain a payload");let i;try{i=nr(e)}catch{throw new gi("Failed to base64url decode the payload")}let s;try{s=JSON.parse(ii.decode(i))}catch{throw new gi("Failed to parse the decoded payload as JSON")}if(!Mi(s))throw new gi("Invalid JWT Claims Set");return s}function sr(t){const e=t?.modulusLength??2048;if(typeof e!=="number"||e<2048){throw new fi("Invalid or unsupported modulusLength option provided, 2048 bits or larger keys must be used")}return e}async function rr(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:sr(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:sr(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:sr(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 fi("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 fi("Invalid or unsupported crv option provided, supported values are P-256, P-384, P-521, X25519, and X448")}break}default:throw new fi('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}return Zn.subtle.generateKey(n,e?.extractable??false,i)}async function or(t,e){return rr(t,e)}const ar=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 cr{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 lr=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 ar(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 hr();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 hr=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 dr=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 or("ES256");const c=await ur(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=er(new URL(h));const{payload:u}=await Ps(l,d,{issuer:i,audience:"solid"});const f=await Us(await fs(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 cr).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 ur=async(t,e,n,i,s,r)=>{const o=await fs(r.publicKey);o.alg="ES256";const a=await new Ms({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 fr=async()=>{const t=await(new cr).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 pr(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=er(new URL(c));const{payload:h}=await Ps(o,l,{issuer:a,audience:"solid"});const d=await Us(await fs(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 pr=async(t,e,n,i)=>{const s=await fs(i.publicKey);s.alg="ES256";const r=await new Ms({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 br{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 lr(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 cr).init();await t.clear();t.close()}async handleRedirectFromLogin(){const t=await dr(this.sessionInformation.clientDetails);if(!t.tokenDetails){return}this.sessionInformation=t;await this.setSessionDetails()}async restore(){await fr().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 fs(this.sessionInformation.tokenDetails.dpop_key_pair.publicKey);return new Ms(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_=ir(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 fr().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 mr{get authenticatedFetch(){return this._authenticatedFetch}constructor(){this.onSessionRestoreCallback=()=>{};this.sessionInfo$=new vn({isLoggedIn:false,webId:undefined});this.session=new br;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 gr=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 gn;this.loading=true}async componentWillLoad(){const t=new mr;this.unsubscribeSettings=Gt.on("set",(()=>{this.os=ze(t,Gt.state)}));this.os=ze(t,Gt.state);t.onSessionRestore((t=>{this.sessionRestoredEmitter.emit({url:t})}));try{await t.handleIncomingRedirect(this.restorePreviousSession)}catch(t){console.error(t)}this.os.observeSession().pipe(Gn(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 wr="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}\n";const vr=wr;const yr=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(kr,{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 kr=()=>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"}));yr.style=vr;const xr=":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 Sr=xr;const _r=class{constructor(t){e(this,t)}render(){return n(i,{key:"18dc165b7be1c796136804a2ba7643b2a6fffc73"},n("pos-getting-started",{key:"e3f7a22641e4c24168a36f96463515cd1a89ca5e"}),n("pos-example-resources",{key:"1044dd873049118e165ff6d38449c85695f63a50"}))}};_r.style=Sr;const Er=":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 Ar=Er;const Cr=class{constructor(t){e(this,t)}render(){return n("pos-setting-offline-cache",{key:"f065206f6291089773a19045243f04b6ce35eeb9"})}};Cr.style=Ar;const Tr=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 $r="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 zr=$r;const Pr=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"})))}};Pr.style=zr;const Ir=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 Rr=":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 Or=Rr;const Dr=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"}))))}};Dr.style=Or;const jr=":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 Lr=jr;const Mr=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 →"))))}};Mr.style=Lr;const Wr=":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 Ur=Wr;const Hr=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"]}}};Hr.style=Ur;const Nr=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 Jr=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 Br=".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 Kr=Br;const Fr=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)}};Fr.style=Kr;const Xr=":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 Vr=Xr;const Yr=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"]}}};Yr.style=Vr;
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 $(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 z(this.el,"ionToastDidDismiss")}onWillDismiss(){return z(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 $e(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 ze={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){ze=t(ze)}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)$e(t);if(ye(t,Se()))return new Proxy(t,ze);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=$n(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=$n(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 $n(t){var e;return(e=t!==null&&t!==void 0?t:on.Promise)!==null&&e!==void 0?e:Promise}function zn(t){return t&&Ge(t.next)&&Ge(t.error)&&Ge(t.complete)}function Pn(t){return t&&t instanceof mn||zn(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 $i extends Error{constructor(t,e){super(t,e);this.code="ERR_JOSE_GENERIC";this.name=this.constructor.name;Error.captureStackTrace?.(this,this.constructor)}}$i.code="ERR_JOSE_GENERIC";class zi extends $i{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}}zi.code="ERR_JWT_CLAIM_VALIDATION_FAILED";class Pi extends $i{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 $i{constructor(){super(...arguments);this.code="ERR_JOSE_ALG_NOT_ALLOWED"}}Ii.code="ERR_JOSE_ALG_NOT_ALLOWED";class Ri extends $i{constructor(){super(...arguments);this.code="ERR_JOSE_NOT_SUPPORTED"}}Ri.code="ERR_JOSE_NOT_SUPPORTED";class Oi extends $i{constructor(t="decryption operation failed",e){super(t,e);this.code="ERR_JWE_DECRYPTION_FAILED"}}Oi.code="ERR_JWE_DECRYPTION_FAILED";class Di extends $i{constructor(){super(...arguments);this.code="ERR_JWE_INVALID"}}Di.code="ERR_JWE_INVALID";class ji extends $i{constructor(){super(...arguments);this.code="ERR_JWS_INVALID"}}ji.code="ERR_JWS_INVALID";class Li extends $i{constructor(){super(...arguments);this.code="ERR_JWT_INVALID"}}Li.code="ERR_JWT_INVALID";class Mi extends $i{constructor(){super(...arguments);this.code="ERR_JWK_INVALID"}}Mi.code="ERR_JWK_INVALID";class Wi extends $i{constructor(){super(...arguments);this.code="ERR_JWKS_INVALID"}}Wi.code="ERR_JWKS_INVALID";class Ui extends $i{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 $i{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 $i{constructor(t="request timed out",e){super(t,e);this.code="ERR_JWKS_TIMEOUT"}}Ni.code="ERR_JWKS_TIMEOUT";class Ji extends $i{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 $s=(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 zs=$s;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&&zs("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 zi('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 zi(`missing required "${t}" claim`,i,t,"missing")}}if(o&&!(Array.isArray(o)?o:[o]).includes(i.iss)){throw new zi('unexpected "iss" claim value',i,"iss","check_failed")}if(a&&i.sub!==a){throw new zi('unexpected "sub" claim value',i,"sub","check_failed")}if(c&&!Ys(i.aud,typeof c==="string"?[c]:c)){throw new zi('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 zi('"iat" claim must be a number',i,"iat","invalid")}if(i.nbf!==undefined){if(typeof i.nbf!=="number"){throw new zi('"nbf" claim must be a number',i,"nbf","invalid")}if(i.nbf>f+d){throw new zi('"nbf" claim timestamp check failed',i,"nbf","check_failed")}}if(i.exp!==undefined){if(typeof i.exp!=="number"){throw new zi('"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 zi('"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 $i("Expected 200 OK from the JSON Web Key Set HTTP response")}try{return await o.json()}catch{throw new $i("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 $r=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 zr();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 zr=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 $r(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;
20
20
  /**
21
21
  * @license
22
22
  * Copyright 2019 Google LLC
23
23
  * SPDX-License-Identifier: BSD-3-Clause
24
- */const qr=globalThis,Gr=qr.ShadowRoot&&(void 0===qr.ShadyCSS||qr.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Zr=Symbol(),Qr=new WeakMap;class to{constructor(t,e,n){if(this._$cssResult$=!0,n!==Zr)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(Gr&&void 0===t){const n=void 0!==e&&1===e.length;n&&(t=Qr.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&Qr.set(e,t))}return t}toString(){return this.cssText}}const eo=t=>new to("string"==typeof t?t:t+"",void 0,Zr),no=(t,...e)=>{const n=1===t.length?t[0]:e.reduce(((e,n,i)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[i+1]),t[0]);return new to(n,t,Zr)},io=(t,e)=>{if(Gr)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const n of e){const e=document.createElement("style"),i=qr.litNonce;void 0!==i&&e.setAttribute("nonce",i),e.textContent=n.cssText,t.appendChild(e)}},so=Gr?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const n of t.cssRules)e+=n.cssText;return eo(e)})(t):t
24
+ */const go=globalThis,wo=go.ShadowRoot&&(void 0===go.ShadyCSS||go.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,vo=Symbol(),yo=new WeakMap;class ko{constructor(t,e,n){if(this._$cssResult$=!0,n!==vo)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(wo&&void 0===t){const n=void 0!==e&&1===e.length;n&&(t=yo.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&yo.set(e,t))}return t}toString(){return this.cssText}}const xo=t=>new ko("string"==typeof t?t:t+"",void 0,vo),So=(t,...e)=>{const n=1===t.length?t[0]:e.reduce(((e,n,i)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[i+1]),t[0]);return new ko(n,t,vo)},_o=(t,e)=>{if(wo)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const n of e){const e=document.createElement("style"),i=go.litNonce;void 0!==i&&e.setAttribute("nonce",i),e.textContent=n.cssText,t.appendChild(e)}},Eo=wo?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const n of t.cssRules)e+=n.cssText;return xo(e)})(t):t
25
25
  /**
26
26
  * @license
27
27
  * Copyright 2017 Google LLC
28
28
  * SPDX-License-Identifier: BSD-3-Clause
29
- */;const{is:ro,defineProperty:oo,getOwnPropertyDescriptor:ao,getOwnPropertyNames:co,getOwnPropertySymbols:lo,getPrototypeOf:ho}=Object,uo=globalThis,fo=uo.trustedTypes,po=fo?fo.emptyScript:"",bo=uo.reactiveElementPolyfillSupport,mo=(t,e)=>t,go={toAttribute(t,e){switch(e){case Boolean:t=t?po: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}},wo=(t,e)=>!ro(t,e),vo={attribute:!0,type:String,converter:go,reflect:!1,useDefault:!1,hasChanged:wo};Symbol.metadata??=Symbol("metadata"),uo.litPropertyMetadata??=new WeakMap;class yo 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=vo){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&&oo(this.prototype,t,i)}}static getPropertyDescriptor(t,e,n){const{get:i,set:s}=ao(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)??vo}static _$Ei(){if(this.hasOwnProperty(mo("elementProperties")))return;const t=ho(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(mo("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(mo("properties"))){const t=this.properties,e=[...co(t),...lo(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(so(t))}else void 0!==t&&e.push(so(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 io(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:go).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:go;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??wo)(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){}}yo.elementStyles=[],yo.shadowRootOptions={mode:"open"},yo[mo("elementProperties")]=new Map,yo[mo("finalized")]=new Map,bo?.({ReactiveElement:yo}),(uo.reactiveElementVersions??=[]).push("2.1.1");
29
+ */;const{is:Ao,defineProperty:Co,getOwnPropertyDescriptor:To,getOwnPropertyNames:$o,getOwnPropertySymbols:zo,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}=To(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=[...$o(t),...zo(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
33
33
  * SPDX-License-Identifier: BSD-3-Clause
34
- */const ko=globalThis,xo=ko.trustedTypes,So=xo?xo.createPolicy("lit-html",{createHTML:t=>t}):void 0,_o="$lit$",Eo=`lit$${Math.random().toFixed(9).slice(2)}$`,Ao="?"+Eo,Co=`<${Ao}>`,To=document,$o=()=>To.createComment(""),zo=t=>null===t||"object"!=typeof t&&"function"!=typeof t,Po=Array.isArray,Io=t=>Po(t)||"function"==typeof t?.[Symbol.iterator],Ro="[ \t\n\f\r]",Oo=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Do=/-->/g,jo=/>/g,Lo=RegExp(`>|${Ro}(?:([^\\s"'>=/]+)(${Ro}*=${Ro}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),Mo=/'/g,Wo=/"/g,Uo=/^(?:script|style|textarea|title)$/i,Ho=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),No=Ho(1),Jo=Symbol.for("lit-noChange"),Bo=Symbol.for("lit-nothing"),Ko=new WeakMap,Fo=To.createTreeWalker(To,129);function Xo(t,e){if(!Po(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==So?So.createHTML(e):e}const Vo=(t,e)=>{const n=t.length-1,i=[];let s,r=2===e?"<svg>":3===e?"<math>":"",o=Oo;for(let e=0;e<n;e++){const n=t[e];let a,c,l=-1,h=0;for(;h<n.length&&(o.lastIndex=h,c=o.exec(n),null!==c);)h=o.lastIndex,o===Oo?"!--"===c[1]?o=Do:void 0!==c[1]?o=jo:void 0!==c[2]?(Uo.test(c[2])&&(s=RegExp("</"+c[2],"g")),o=Lo):void 0!==c[3]&&(o=Lo):o===Lo?">"===c[0]?(o=s??Oo,l=-1):void 0===c[1]?l=-2:(l=o.lastIndex-c[2].length,a=c[1],o=void 0===c[3]?Lo:'"'===c[3]?Wo:Mo):o===Wo||o===Mo?o=Lo:o===Do||o===jo?o=Oo:(o=Lo,s=void 0);const d=o===Lo&&t[e+1].startsWith("/>")?" ":"";r+=o===Oo?n+Co:l>=0?(i.push(a),n.slice(0,l)+_o+n.slice(l)+Eo+d):n+Eo+(-2===l?e:d)}return[Xo(t,r+(t[n]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),i]};class Yo{constructor({strings:t,_$litType$:e},n){let i;this.parts=[];let s=0,r=0;const o=t.length-1,a=this.parts,[c,l]=Vo(t,e);if(this.el=Yo.createElement(c,n),Fo.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=Fo.nextNode())&&a.length<o;){if(1===i.nodeType){if(i.hasAttributes())for(const t of i.getAttributeNames())if(t.endsWith(_o)){const e=l[r++],n=i.getAttribute(t).split(Eo),o=/([.?@])?(.*)/.exec(e);a.push({type:1,index:s,name:o[2],strings:n,ctor:"."===o[1]?ta:"?"===o[1]?ea:"@"===o[1]?na:Qo}),i.removeAttribute(t)}else t.startsWith(Eo)&&(a.push({type:6,index:s}),i.removeAttribute(t));if(Uo.test(i.tagName)){const t=i.textContent.split(Eo),e=t.length-1;if(e>0){i.textContent=xo?xo.emptyScript:"";for(let n=0;n<e;n++)i.append(t[n],$o()),Fo.nextNode(),a.push({type:2,index:++s});i.append(t[e],$o())}}}else if(8===i.nodeType)if(i.data===Ao)a.push({type:2,index:s});else{let t=-1;for(;-1!==(t=i.data.indexOf(Eo,t+1));)a.push({type:7,index:s}),t+=Eo.length-1}s++}}static createElement(t,e){const n=To.createElement("template");return n.innerHTML=t,n}}function qo(t,e,n=t,i){if(e===Jo)return e;let s=void 0!==i?n._$Co?.[i]:n._$Cl;const r=zo(e)?void 0:e._$litDirective$;return s?.constructor!==r&&(s?._$AO?.(!1),void 0===r?s=void 0:(s=new r(t),s._$AT(t,n,i)),void 0!==i?(n._$Co??=[])[i]=s:n._$Cl=s),void 0!==s&&(e=qo(t,s._$AS(t,e.values),s,i)),e}class Go{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:n}=this._$AD,i=(t?.creationScope??To).importNode(e,!0);Fo.currentNode=i;let s=Fo.nextNode(),r=0,o=0,a=n[0];for(;void 0!==a;){if(r===a.index){let e;2===a.type?e=new Zo(s,s.nextSibling,this,t):1===a.type?e=new a.ctor(s,a.name,a.strings,this,t):6===a.type&&(e=new ia(s,this,t)),this._$AV.push(e),a=n[++o]}r!==a?.index&&(s=Fo.nextNode(),r++)}return Fo.currentNode=To,i}p(t){let e=0;for(const n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(t,n,e),e+=n.strings.length-2):n._$AI(t[e])),e++}}class Zo{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,n,i){this.type=2,this._$AH=Bo,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=n,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=qo(this,t,e),zo(t)?t===Bo||null==t||""===t?(this._$AH!==Bo&&this._$AR(),this._$AH=Bo):t!==this._$AH&&t!==Jo&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):Io(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==Bo&&zo(this._$AH)?this._$AA.nextSibling.data=t:this.T(To.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:n}=t,i="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=Yo.createElement(Xo(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===i)this._$AH.p(e);else{const t=new Go(i,this),n=t.u(this.options);t.p(e),this.T(n),this._$AH=t}}_$AC(t){let e=Ko.get(t.strings);return void 0===e&&Ko.set(t.strings,e=new Yo(t)),e}k(t){Po(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let n,i=0;for(const s of t)i===e.length?e.push(n=new Zo(this.O($o()),this.O($o()),this,this.options)):n=e[i],n._$AI(s),i++;i<e.length&&(this._$AR(n&&n._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class Qo{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,n,i,s){this.type=1,this._$AH=Bo,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=s,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=Bo}_$AI(t,e=this,n,i){const s=this.strings;let r=!1;if(void 0===s)t=qo(this,t,e,0),r=!zo(t)||t!==this._$AH&&t!==Jo,r&&(this._$AH=t);else{const i=t;let o,a;for(t=s[0],o=0;o<s.length-1;o++)a=qo(this,i[n+o],e,o),a===Jo&&(a=this._$AH[o]),r||=!zo(a)||a!==this._$AH[o],a===Bo?t=Bo:t!==Bo&&(t+=(a??"")+s[o+1]),this._$AH[o]=a}r&&!i&&this.j(t)}j(t){t===Bo?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class ta extends Qo{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===Bo?void 0:t}}class ea extends Qo{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==Bo)}}class na extends Qo{constructor(t,e,n,i,s){super(t,e,n,i,s),this.type=5}_$AI(t,e=this){if((t=qo(this,t,e,0)??Bo)===Jo)return;const n=this._$AH,i=t===Bo&&n!==Bo||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,s=t!==Bo&&(n===Bo||i);i&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class ia{constructor(t,e,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){qo(this,t)}}const sa=ko.litHtmlPolyfillSupport;sa?.(Yo,Zo),(ko.litHtmlVersions??=[]).push("3.3.1");const ra=(t,e,n)=>{const i=n?.renderBefore??e;let s=i._$litPart$;if(void 0===s){const t=n?.renderBefore??null;i._$litPart$=s=new Zo(e.insertBefore($o(),t),t,void 0,n??{})}return s._$AI(t),s
34
+ */const Ho=globalThis,No=Ho.trustedTypes,Jo=No?No.createPolicy("lit-html",{createHTML:t=>t}):void 0,Bo="$lit$",Ko=`lit$${Math.random().toFixed(9).slice(2)}$`,Fo="?"+Ko,Xo=`<${Fo}>`,Vo=document,Yo=()=>Vo.createComment(""),qo=t=>null===t||"object"!=typeof t&&"function"!=typeof t,Go=Array.isArray,Zo=t=>Go(t)||"function"==typeof t?.[Symbol.iterator],Qo="[ \t\n\f\r]",ta=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ea=/-->/g,na=/>/g,ia=RegExp(`>|${Qo}(?:([^\\s"'>=/]+)(${Qo}*=${Qo}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),sa=/'/g,ra=/"/g,oa=/^(?:script|style|textarea|title)$/i,aa=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),ca=aa(1),la=Symbol.for("lit-noChange"),ha=Symbol.for("lit-nothing"),da=new WeakMap,ua=Vo.createTreeWalker(Vo,129);function fa(t,e){if(!Go(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==Jo?Jo.createHTML(e):e}const pa=(t,e)=>{const n=t.length-1,i=[];let s,r=2===e?"<svg>":3===e?"<math>":"",o=ta;for(let e=0;e<n;e++){const n=t[e];let a,c,l=-1,h=0;for(;h<n.length&&(o.lastIndex=h,c=o.exec(n),null!==c);)h=o.lastIndex,o===ta?"!--"===c[1]?o=ea:void 0!==c[1]?o=na:void 0!==c[2]?(oa.test(c[2])&&(s=RegExp("</"+c[2],"g")),o=ia):void 0!==c[3]&&(o=ia):o===ia?">"===c[0]?(o=s??ta,l=-1):void 0===c[1]?l=-2:(l=o.lastIndex-c[2].length,a=c[1],o=void 0===c[3]?ia:'"'===c[3]?ra:sa):o===ra||o===sa?o=ia:o===ea||o===na?o=ta:(o=ia,s=void 0);const d=o===ia&&t[e+1].startsWith("/>")?" ":"";r+=o===ta?n+Xo:l>=0?(i.push(a),n.slice(0,l)+Bo+n.slice(l)+Ko+d):n+Ko+(-2===l?e:d)}return[fa(t,r+(t[n]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),i]};class ba{constructor({strings:t,_$litType$:e},n){let i;this.parts=[];let s=0,r=0;const o=t.length-1,a=this.parts,[c,l]=pa(t,e);if(this.el=ba.createElement(c,n),ua.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=ua.nextNode())&&a.length<o;){if(1===i.nodeType){if(i.hasAttributes())for(const t of i.getAttributeNames())if(t.endsWith(Bo)){const e=l[r++],n=i.getAttribute(t).split(Ko),o=/([.?@])?(.*)/.exec(e);a.push({type:1,index:s,name:o[2],strings:n,ctor:"."===o[1]?ya:"?"===o[1]?ka:"@"===o[1]?xa:va}),i.removeAttribute(t)}else t.startsWith(Ko)&&(a.push({type:6,index:s}),i.removeAttribute(t));if(oa.test(i.tagName)){const t=i.textContent.split(Ko),e=t.length-1;if(e>0){i.textContent=No?No.emptyScript:"";for(let n=0;n<e;n++)i.append(t[n],Yo()),ua.nextNode(),a.push({type:2,index:++s});i.append(t[e],Yo())}}}else if(8===i.nodeType)if(i.data===Fo)a.push({type:2,index:s});else{let t=-1;for(;-1!==(t=i.data.indexOf(Ko,t+1));)a.push({type:7,index:s}),t+=Ko.length-1}s++}}static createElement(t,e){const n=Vo.createElement("template");return n.innerHTML=t,n}}function ma(t,e,n=t,i){if(e===la)return e;let s=void 0!==i?n._$Co?.[i]:n._$Cl;const r=qo(e)?void 0:e._$litDirective$;return s?.constructor!==r&&(s?._$AO?.(!1),void 0===r?s=void 0:(s=new r(t),s._$AT(t,n,i)),void 0!==i?(n._$Co??=[])[i]=s:n._$Cl=s),void 0!==s&&(e=ma(t,s._$AS(t,e.values),s,i)),e}class ga{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:n}=this._$AD,i=(t?.creationScope??Vo).importNode(e,!0);ua.currentNode=i;let s=ua.nextNode(),r=0,o=0,a=n[0];for(;void 0!==a;){if(r===a.index){let e;2===a.type?e=new wa(s,s.nextSibling,this,t):1===a.type?e=new a.ctor(s,a.name,a.strings,this,t):6===a.type&&(e=new Sa(s,this,t)),this._$AV.push(e),a=n[++o]}r!==a?.index&&(s=ua.nextNode(),r++)}return ua.currentNode=Vo,i}p(t){let e=0;for(const n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(t,n,e),e+=n.strings.length-2):n._$AI(t[e])),e++}}class wa{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,n,i){this.type=2,this._$AH=ha,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=n,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=ma(this,t,e),qo(t)?t===ha||null==t||""===t?(this._$AH!==ha&&this._$AR(),this._$AH=ha):t!==this._$AH&&t!==la&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):Zo(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==ha&&qo(this._$AH)?this._$AA.nextSibling.data=t:this.T(Vo.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:n}=t,i="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=ba.createElement(fa(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===i)this._$AH.p(e);else{const t=new ga(i,this),n=t.u(this.options);t.p(e),this.T(n),this._$AH=t}}_$AC(t){let e=da.get(t.strings);return void 0===e&&da.set(t.strings,e=new ba(t)),e}k(t){Go(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let n,i=0;for(const s of t)i===e.length?e.push(n=new wa(this.O(Yo()),this.O(Yo()),this,this.options)):n=e[i],n._$AI(s),i++;i<e.length&&(this._$AR(n&&n._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class va{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,n,i,s){this.type=1,this._$AH=ha,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=s,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=ha}_$AI(t,e=this,n,i){const s=this.strings;let r=!1;if(void 0===s)t=ma(this,t,e,0),r=!qo(t)||t!==this._$AH&&t!==la,r&&(this._$AH=t);else{const i=t;let o,a;for(t=s[0],o=0;o<s.length-1;o++)a=ma(this,i[n+o],e,o),a===la&&(a=this._$AH[o]),r||=!qo(a)||a!==this._$AH[o],a===ha?t=ha:t!==ha&&(t+=(a??"")+s[o+1]),this._$AH[o]=a}r&&!i&&this.j(t)}j(t){t===ha?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class ya extends va{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===ha?void 0:t}}class ka extends va{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==ha)}}class xa extends va{constructor(t,e,n,i,s){super(t,e,n,i,s),this.type=5}_$AI(t,e=this){if((t=ma(this,t,e,0)??ha)===la)return;const n=this._$AH,i=t===ha&&n!==ha||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,s=t!==ha&&(n===ha||i);i&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class Sa{constructor(t,e,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){ma(this,t)}}const _a=Ho.litHtmlPolyfillSupport;_a?.(ba,wa),(Ho.litHtmlVersions??=[]).push("3.3.1");const Ea=(t,e,n)=>{const i=n?.renderBefore??e;let s=i._$litPart$;if(void 0===s){const t=n?.renderBefore??null;i._$litPart$=s=new wa(e.insertBefore(Yo(),t),t,void 0,n??{})}return s._$AI(t),s
35
35
  /**
36
36
  * @license
37
37
  * Copyright 2017 Google LLC
38
38
  * SPDX-License-Identifier: BSD-3-Clause
39
- */};const oa=globalThis;class aa extends yo{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=ra(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Jo}}aa._$litElement$=!0,aa["finalized"]=!0,oa.litElementHydrateSupport?.({LitElement:aa});const ca=oa.litElementPolyfillSupport;ca?.({LitElement:aa});(oa.litElementVersions??=[]).push("4.2.1");var la=no`
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 Ta=Aa.litElementPolyfillSupport;Ta?.({LitElement:Ca});(Aa.litElementVersions??=[]).push("4.2.1");var $a=So`
40
40
  :host {
41
41
  display: inline-block;
42
42
  }
@@ -84,7 +84,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
84
84
  max-width: var(--auto-size-available-width) !important;
85
85
  max-height: var(--auto-size-available-height) !important;
86
86
  }
87
- `;var ha=Object.defineProperty;var da=Object.defineProperties;var ua=Object.getOwnPropertyDescriptor;var fa=Object.getOwnPropertyDescriptors;var pa=Object.getOwnPropertySymbols;var ba=Object.prototype.hasOwnProperty;var ma=Object.prototype.propertyIsEnumerable;var ga=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t);var wa=t=>{throw TypeError(t)};var va=(t,e,n)=>e in t?ha(t,e,{enumerable:true,configurable:true,writable:true,value:n}):t[e]=n;var ya=(t,e)=>{for(var n in e||(e={}))if(ba.call(e,n))va(t,n,e[n]);if(pa)for(var n of pa(e)){if(ma.call(e,n))va(t,n,e[n])}return t};var ka=(t,e)=>da(t,fa(e));var xa=(t,e,n,i)=>{var s=i>1?void 0:i?ua(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)ha(e,n,s);return s};var Sa=(t,e,n)=>e.has(t)||wa("Cannot "+n);var _a=(t,e,n)=>(Sa(t,e,"read from private field"),n?n.call(t):e.get(t));var Ea=(t,e,n)=>e.has(t)?wa("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n);var Aa=(t,e,n,i)=>(Sa(t,e,"write to private field"),i?i.call(t,n):e.set(t,n),n);var Ca=function(t,e){this[0]=t;this[1]=e};var Ta=t=>{var e=t[ga("asyncIterator")],n=false,i,s={};if(e==null){e=t[ga("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 Ca(new Promise((n=>{var s=e[t](i);if(!(s instanceof Object))wa("Object expected");n(s)})),1)}}}return s[ga("iterator")]=()=>s,i("next"),"throw"in e?i("throw"):s.throw=t=>{throw t},"return"in e&&i("return"),s};function*$a(t=document.activeElement){if(t===null||t===void 0)return;yield t;if("shadowRoot"in t&&t.shadowRoot&&t.shadowRoot.mode!=="closed"){yield*Ta($a(t.shadowRoot.activeElement))}}function za(){return[...$a()].pop()}var Pa=new WeakMap;function Ia(t){let e=Pa.get(t);if(!e){e=window.getComputedStyle(t,null);Pa.set(t,e)}return e}function Ra(t){if(typeof t.checkVisibility==="function"){return t.checkVisibility({checkOpacity:false,checkVisibilityCSS:true})}const e=Ia(t);return e.visibility!=="hidden"&&e.display!=="none"}function Oa(t){const e=Ia(t);const{overflowY:n,overflowX:i}=e;if(n==="scroll"||i==="scroll"){return true}if(n!=="auto"||i!=="auto"){return false}const s=t.scrollHeight>t.clientHeight;if(s&&n==="auto"){return true}const r=t.scrollWidth>t.clientWidth;if(r&&i==="auto"){return true}return false}function Da(t){const e=t.tagName.toLowerCase();const n=Number(t.getAttribute("tabindex"));const i=t.hasAttribute("tabindex");if(i&&(isNaN(n)||n<=-1)){return false}if(t.hasAttribute("disabled")){return false}if(t.closest("[inert]")){return false}if(e==="input"&&t.getAttribute("type")==="radio"){const e=t.getRootNode();const n=`input[type='radio'][name="${t.getAttribute("name")}"]`;const i=e.querySelector(`${n}:checked`);if(i){return i===t}const s=e.querySelector(n);return s===t}if(!Ra(t)){return false}if((e==="audio"||e==="video")&&t.hasAttribute("controls")){return true}if(t.hasAttribute("tabindex")){return true}if(t.hasAttribute("contenteditable")&&t.getAttribute("contenteditable")!=="false"){return true}const s=["button","input","select","textarea","a","audio","video","summary","iframe"].includes(e);if(s){return true}return Oa(t)}function ja(t){var e,n;const i=Ma(t);const s=(e=i[0])!=null?e:null;const r=(n=i[i.length-1])!=null?n:null;return{start:s,end:r}}function La(t,e){var n;return((n=t.getRootNode({composed:true}))==null?void 0:n.host)!==e}function Ma(t){const e=new WeakMap;const n=[];function i(s){if(s instanceof Element){if(s.hasAttribute("inert")||s.closest("[inert]")){return}if(e.has(s)){return}e.set(s,true);if(!n.includes(s)&&Da(s)){n.push(s)}if(s instanceof HTMLSlotElement&&La(s,t)){s.assignedElements({flatten:true}).forEach((t=>{i(t)}))}if(s.shadowRoot!==null&&s.shadowRoot.mode==="open"){i(s.shadowRoot)}}for(const t of s.children){i(t)}}i(t);return n.sort(((t,e)=>{const n=Number(t.getAttribute("tabindex"))||0;const i=Number(e.getAttribute("tabindex"))||0;return i-n}))}var Wa=no`
87
+ `;function*za(t=document.activeElement){if(t===null||t===void 0)return;yield t;if("shadowRoot"in t&&t.shadowRoot&&t.shadowRoot.mode!=="closed"){yield*ht(za(t.shadowRoot.activeElement))}}function Pa(){return[...za()].pop()}var Ia=new WeakMap;function Ra(t){let e=Ia.get(t);if(!e){e=window.getComputedStyle(t,null);Ia.set(t,e)}return e}function Oa(t){if(typeof t.checkVisibility==="function"){return t.checkVisibility({checkOpacity:false,checkVisibilityCSS:true})}const e=Ra(t);return e.visibility!=="hidden"&&e.display!=="none"}function Da(t){const e=Ra(t);const{overflowY:n,overflowX:i}=e;if(n==="scroll"||i==="scroll"){return true}if(n!=="auto"||i!=="auto"){return false}const s=t.scrollHeight>t.clientHeight;if(s&&n==="auto"){return true}const r=t.scrollWidth>t.clientWidth;if(r&&i==="auto"){return true}return false}function ja(t){const e=t.tagName.toLowerCase();const n=Number(t.getAttribute("tabindex"));const i=t.hasAttribute("tabindex");if(i&&(isNaN(n)||n<=-1)){return false}if(t.hasAttribute("disabled")){return false}if(t.closest("[inert]")){return false}if(e==="input"&&t.getAttribute("type")==="radio"){const e=t.getRootNode();const n=`input[type='radio'][name="${t.getAttribute("name")}"]`;const i=e.querySelector(`${n}:checked`);if(i){return i===t}const s=e.querySelector(n);return s===t}if(!Oa(t)){return false}if((e==="audio"||e==="video")&&t.hasAttribute("controls")){return true}if(t.hasAttribute("tabindex")){return true}if(t.hasAttribute("contenteditable")&&t.getAttribute("contenteditable")!=="false"){return true}const s=["button","input","select","textarea","a","audio","video","summary","iframe"].includes(e);if(s){return true}return Da(t)}function La(t){var e,n;const i=Wa(t);const s=(e=i[0])!=null?e:null;const r=(n=i[i.length-1])!=null?n:null;return{start:s,end:r}}function Ma(t,e){var n;return((n=t.getRootNode({composed:true}))==null?void 0:n.host)!==e}function Wa(t){const e=new WeakMap;const n=[];function i(s){if(s instanceof Element){if(s.hasAttribute("inert")||s.closest("[inert]")){return}if(e.has(s)){return}e.set(s,true);if(!n.includes(s)&&ja(s)){n.push(s)}if(s instanceof HTMLSlotElement&&Ma(s,t)){s.assignedElements({flatten:true}).forEach((t=>{i(t)}))}if(s.shadowRoot!==null&&s.shadowRoot.mode==="open"){i(s.shadowRoot)}}for(const t of s.children){i(t)}}i(t);return n.sort(((t,e)=>{const n=Number(t.getAttribute("tabindex"))||0;const i=Number(e.getAttribute("tabindex"))||0;return i-n}))}var Ua=So`
88
88
  :host {
89
89
  --arrow-color: var(--sl-color-neutral-1000);
90
90
  --arrow-size: 6px;
@@ -142,7 +142,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
142
142
  var(--hover-bridge-bottom-left-x, 0) var(--hover-bridge-bottom-left-y, 0)
143
143
  );
144
144
  }
145
- `;const Ua=new Set;const Ha=new Map;let Na;let Ja="ltr";let Ba="en";const Ka=typeof MutationObserver!=="undefined"&&typeof document!=="undefined"&&typeof document.documentElement!=="undefined";if(Ka){const t=new MutationObserver(Xa);Ja=document.documentElement.dir||"ltr";Ba=document.documentElement.lang||navigator.language;t.observe(document.documentElement,{attributes:true,attributeFilter:["dir","lang"]})}function Fa(...t){t.map((t=>{const e=t.$code.toLowerCase();if(Ha.has(e)){Ha.set(e,Object.assign(Object.assign({},Ha.get(e)),t))}else{Ha.set(e,t)}if(!Na){Na=t}}));Xa()}function Xa(){if(Ka){Ja=document.documentElement.dir||"ltr";Ba=document.documentElement.lang||navigator.language}[...Ua.keys()].map((t=>{if(typeof t.requestUpdate==="function"){t.requestUpdate()}}))}class Va{constructor(t){this.host=t;this.host.addController(this)}hostConnected(){Ua.add(this.host)}hostDisconnected(){Ua.delete(this.host)}dir(){return`${this.host.dir||Ja}`.toLowerCase()}lang(){return`${this.host.lang||Ba}`.toLowerCase()}getTranslationData(t){var e,n;const i=new Intl.Locale(t.replace(/_/g,"-"));const s=i===null||i===void 0?void 0:i.language.toLowerCase();const r=(n=(e=i===null||i===void 0?void 0:i.region)===null||e===void 0?void 0:e.toLowerCase())!==null&&n!==void 0?n:"";const o=Ha.get(`${s}-${r}`);const a=Ha.get(s);return{locale:i,language:s,region:r,primary:o,secondary:a}}exists(t,e){var n;const{primary:i,secondary:s}=this.getTranslationData((n=e.lang)!==null&&n!==void 0?n:this.lang());e=Object.assign({includeFallback:false},e);if(i&&i[t]||s&&s[t]||e.includeFallback&&Na&&Na[t]){return true}return false}term(t,...e){const{primary:n,secondary:i}=this.getTranslationData(this.lang());let s;if(n&&n[t]){s=n[t]}else if(i&&i[t]){s=i[t]}else if(Na&&Na[t]){s=Na[t]}else{console.error(`No translation found for: ${String(t)}`);return String(t)}if(typeof s==="function"){return s(...e)}return s}date(t,e){t=new Date(t);return new Intl.DateTimeFormat(this.lang(),e).format(t)}number(t,e){t=Number(t);return isNaN(t)?"":new Intl.NumberFormat(this.lang(),e).format(t)}relativeTime(t,e,n){return new Intl.RelativeTimeFormat(this.lang(),n).format(t,e)}}var Ya={$code:"en",$name:"English",$dir:"ltr",carousel:"Carousel",clearEntry:"Clear entry",close:"Close",copied:"Copied",copy:"Copy",currentValue:"Current value",error:"Error",goToSlide:(t,e)=>`Go to slide ${t} of ${e}`,hidePassword:"Hide password",loading:"Loading",nextSlide:"Next slide",numOptionsSelected:t=>{if(t===0)return"No options selected";if(t===1)return"1 option selected";return`${t} options selected`},previousSlide:"Previous slide",progress:"Progress",remove:"Remove",resize:"Resize",scrollToEnd:"Scroll to end",scrollToStart:"Scroll to start",selectAColorFromTheScreen:"Select a color from the screen",showPassword:"Show password",slideNum:t=>`Slide ${t}`,toggleColorFormat:"Toggle color format"};Fa(Ya);var qa=Ya;var Ga=class extends Va{};Fa(qa);var Za=no`
145
+ `;const Ha=new Set;const Na=new Map;let Ja;let Ba="ltr";let Ka="en";const Fa=typeof MutationObserver!=="undefined"&&typeof document!=="undefined"&&typeof document.documentElement!=="undefined";if(Fa){const t=new MutationObserver(Va);Ba=document.documentElement.dir||"ltr";Ka=document.documentElement.lang||navigator.language;t.observe(document.documentElement,{attributes:true,attributeFilter:["dir","lang"]})}function Xa(...t){t.map((t=>{const e=t.$code.toLowerCase();if(Na.has(e)){Na.set(e,Object.assign(Object.assign({},Na.get(e)),t))}else{Na.set(e,t)}if(!Ja){Ja=t}}));Va()}function Va(){if(Fa){Ba=document.documentElement.dir||"ltr";Ka=document.documentElement.lang||navigator.language}[...Ha.keys()].map((t=>{if(typeof t.requestUpdate==="function"){t.requestUpdate()}}))}class Ya{constructor(t){this.host=t;this.host.addController(this)}hostConnected(){Ha.add(this.host)}hostDisconnected(){Ha.delete(this.host)}dir(){return`${this.host.dir||Ba}`.toLowerCase()}lang(){return`${this.host.lang||Ka}`.toLowerCase()}getTranslationData(t){var e,n;const i=new Intl.Locale(t.replace(/_/g,"-"));const s=i===null||i===void 0?void 0:i.language.toLowerCase();const r=(n=(e=i===null||i===void 0?void 0:i.region)===null||e===void 0?void 0:e.toLowerCase())!==null&&n!==void 0?n:"";const o=Na.get(`${s}-${r}`);const a=Na.get(s);return{locale:i,language:s,region:r,primary:o,secondary:a}}exists(t,e){var n;const{primary:i,secondary:s}=this.getTranslationData((n=e.lang)!==null&&n!==void 0?n:this.lang());e=Object.assign({includeFallback:false},e);if(i&&i[t]||s&&s[t]||e.includeFallback&&Ja&&Ja[t]){return true}return false}term(t,...e){const{primary:n,secondary:i}=this.getTranslationData(this.lang());let s;if(n&&n[t]){s=n[t]}else if(i&&i[t]){s=i[t]}else if(Ja&&Ja[t]){s=Ja[t]}else{console.error(`No translation found for: ${String(t)}`);return String(t)}if(typeof s==="function"){return s(...e)}return s}date(t,e){t=new Date(t);return new Intl.DateTimeFormat(this.lang(),e).format(t)}number(t,e){t=Number(t);return isNaN(t)?"":new Intl.NumberFormat(this.lang(),e).format(t)}relativeTime(t,e,n){return new Intl.RelativeTimeFormat(this.lang(),n).format(t,e)}}var qa={$code:"en",$name:"English",$dir:"ltr",carousel:"Carousel",clearEntry:"Clear entry",close:"Close",copied:"Copied",copy:"Copy",currentValue:"Current value",error:"Error",goToSlide:(t,e)=>`Go to slide ${t} of ${e}`,hidePassword:"Hide password",loading:"Loading",nextSlide:"Next slide",numOptionsSelected:t=>{if(t===0)return"No options selected";if(t===1)return"1 option selected";return`${t} options selected`},previousSlide:"Previous slide",progress:"Progress",remove:"Remove",resize:"Resize",scrollToEnd:"Scroll to end",scrollToStart:"Scroll to start",selectAColorFromTheScreen:"Select a color from the screen",showPassword:"Show password",slideNum:t=>`Slide ${t}`,toggleColorFormat:"Toggle color format"};Xa(qa);var Ga=qa;var Za=class extends Ya{};Xa(Ga);var Qa=So`
146
146
  :host {
147
147
  box-sizing: border-box;
148
148
  }
@@ -161,52 +161,52 @@ 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
161
161
  * @license
162
162
  * Copyright 2017 Google LLC
163
163
  * SPDX-License-Identifier: BSD-3-Clause
164
- */;const Qa={attribute:!0,type:String,converter:go,reflect:!1,hasChanged:wo},tc=(t=Qa,e,n)=>{const{kind:i,metadata:s}=n;let r=globalThis.litPropertyMetadata.get(s);if(void 0===r&&globalThis.litPropertyMetadata.set(s,r=new Map),"setter"===i&&((t=Object.create(t)).wrapped=!0),r.set(n.name,t),"accessor"===i){const{name:i}=n;return{set(n){const s=e.get.call(this);e.set.call(this,n),this.requestUpdate(i,s,t)},init(e){return void 0!==e&&this.C(i,void 0,t,e),e}}}if("setter"===i){const{name:i}=n;return function(n){const s=this[i];e.call(this,n),this.requestUpdate(i,s,t)}}throw Error("Unsupported decorator location: "+i)};function ec(t){return(e,n)=>"object"==typeof n?tc(t,e,n):((t,e,n)=>{const i=e.hasOwnProperty(n);return e.constructor.createProperty(n,t),i?Object.getOwnPropertyDescriptor(e,n):void 0})(t,e,n)
164
+ */;const tc={attribute:!0,type:String,converter:Lo,reflect:!1,hasChanged:Mo},ec=(t=tc,e,n)=>{const{kind:i,metadata:s}=n;let r=globalThis.litPropertyMetadata.get(s);if(void 0===r&&globalThis.litPropertyMetadata.set(s,r=new Map),"setter"===i&&((t=Object.create(t)).wrapped=!0),r.set(n.name,t),"accessor"===i){const{name:i}=n;return{set(n){const s=e.get.call(this);e.set.call(this,n),this.requestUpdate(i,s,t)},init(e){return void 0!==e&&this.C(i,void 0,t,e),e}}}if("setter"===i){const{name:i}=n;return function(n){const s=this[i];e.call(this,n),this.requestUpdate(i,s,t)}}throw Error("Unsupported decorator location: "+i)};function nc(t){return(e,n)=>"object"==typeof n?ec(t,e,n):((t,e,n)=>{const i=e.hasOwnProperty(n);return e.constructor.createProperty(n,t),i?Object.getOwnPropertyDescriptor(e,n):void 0})(t,e,n)
165
165
  /**
166
166
  * @license
167
167
  * Copyright 2017 Google LLC
168
168
  * SPDX-License-Identifier: BSD-3-Clause
169
- */}function nc(t){return ec({...t,state:!0,attribute:!1})}
169
+ */}function ic(t){return nc({...t,state:!0,attribute:!1})}
170
170
  /**
171
171
  * @license
172
172
  * Copyright 2017 Google LLC
173
173
  * SPDX-License-Identifier: BSD-3-Clause
174
- */const ic=(t,e,n)=>(n.configurable=!0,n.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,n),n)
174
+ */const sc=(t,e,n)=>(n.configurable=!0,n.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,n),n)
175
175
  /**
176
176
  * @license
177
177
  * Copyright 2017 Google LLC
178
178
  * SPDX-License-Identifier: BSD-3-Clause
179
- */;function sc(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 ic(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 ic(n,i,{get(){return r(this)}})}}var rc;var oc=class extends aa{constructor(){super();Ea(this,rc,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,ya({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(!_a(this,rc)){this.constructor.elementProperties.forEach(((t,e)=>{if(t.reflect&&this[e]!=null){this.initialReflectedProperties.set(e,this[e])}}));Aa(this,rc,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}}))}};rc=new WeakMap;oc.version="2.20.1";oc.dependencies={};xa([ec()],oc.prototype,"dir",2);xa([ec()],oc.prototype,"lang",2);const ac=["top","right","bottom","left"];const cc=["start","end"];const lc=ac.reduce(((t,e)=>t.concat(e,e+"-"+cc[0],e+"-"+cc[1])),[]);const hc=Math.min;const dc=Math.max;const uc=Math.round;const fc=Math.floor;const pc=t=>({x:t,y:t});const bc={left:"right",right:"left",bottom:"top",top:"bottom"};const mc={start:"end",end:"start"};function gc(t,e,n){return dc(t,hc(e,n))}function wc(t,e){return typeof t==="function"?t(e):t}function vc(t){return t.split("-")[0]}function yc(t){return t.split("-")[1]}function kc(t){return t==="x"?"y":"x"}function xc(t){return t==="y"?"height":"width"}const Sc=new Set(["top","bottom"]);function _c(t){return Sc.has(vc(t))?"y":"x"}function Ec(t){return kc(_c(t))}function Ac(t,e,n){if(n===void 0){n=false}const i=yc(t);const s=Ec(t);const r=xc(s);let o=s==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";if(e.reference[r]>e.floating[r]){o=Dc(o)}return[o,Dc(o)]}function Cc(t){const e=Dc(t);return[Tc(t),e,Tc(e)]}function Tc(t){return t.replace(/start|end/g,(t=>mc[t]))}const $c=["left","right"];const zc=["right","left"];const Pc=["top","bottom"];const Ic=["bottom","top"];function Rc(t,e,n){switch(t){case"top":case"bottom":if(n)return e?zc:$c;return e?$c:zc;case"left":case"right":return e?Pc:Ic;default:return[]}}function Oc(t,e,n,i){const s=yc(t);let r=Rc(vc(t),n==="start",i);if(s){r=r.map((t=>t+"-"+s));if(e){r=r.concat(r.map(Tc))}}return r}function Dc(t){return t.replace(/left|right|bottom|top/g,(t=>bc[t]))}function jc(t){return{top:0,right:0,bottom:0,left:0,...t}}function Lc(t){return typeof t!=="number"?jc(t):{top:t,right:t,bottom:t,left:t}}function Mc(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 Wc(t,e,n){let{reference:i,floating:s}=t;const r=_c(e);const o=Ec(e);const a=xc(o);const c=vc(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(yc(e)){case"start":f[o]-=u*(n&&l?-1:1);break;case"end":f[o]+=u*(n&&l?-1:1);break}return f}const Uc=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}=Wc(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}=Wc(l,u,c))}n=-1}}return{x:h,y:d,placement:u,strategy:s,middlewareData:f}};async function Hc(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}=wc(e,t);const p=Lc(f);const b=d==="floating"?"reference":"floating";const m=a[u?b:d];const g=Mc(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=Mc(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 Nc=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}=wc(t,e)||{};if(l==null){return{}}const d=Lc(h);const u={x:n,y:i};const f=Ec(s);const p=xc(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=hc(d[g],E);const C=hc(d[w],E);const T=A;const $=S-b[p]-C;const z=S/2-b[p]/2+_;const P=gc(T,z,$);const I=!c.arrow&&yc(s)!=null&&z!==P&&r.reference[p]/2-(z<T?A:C)-b[p]/2<0;const R=I?z<T?z-T:z-$:0;return{[f]:u[f]+R,data:{[f]:P,centerOffset:z-P-R,...I&&{alignmentOffset:R}},reset:I}}});function Jc(t,e,n){const i=t?[...n.filter((e=>yc(e)===t)),...n.filter((e=>yc(e)!==t))]:n.filter((t=>vc(t)===t));return i.filter((n=>{if(t){return yc(n)===t||(e?Tc(n)!==n:false)}return true}))}const Bc=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=lc,autoAlignment:f=true,...p}=wc(t,e);const b=d!==undefined||u===lc?Jc(d||null,f,u):u;const m=await Hc(e,p);const g=((n=o.autoPlacement)==null?void 0:n.index)||0;const w=b[g];if(w==null){return{}}const v=Ac(w,r,await(c.isRTL==null?void 0:c.isRTL(l.floating)));if(a!==w){return{reset:{placement:b[0]}}}const y=[m[vc(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=yc(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,yc(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 Kc=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}=wc(t,e);if((n=r.arrow)!=null&&n.alignmentOffset){return{}}const g=vc(s);const w=_c(a);const v=vc(a)===a;const y=await(c.isRTL==null?void 0:c.isRTL(l.floating));const k=u||(v||!b?[Dc(a)]:Cc(a));const x=p!=="none";if(!u&&x){k.push(...Oc(a,b,p,y))}const S=[a,...k];const _=await Hc(e,m);const E=[];let A=((i=r.flip)==null?void 0:i.overflows)||[];if(h){E.push(_[g])}if(d){const t=Ac(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!==_c(e):false;if(!n||A.every((t=>t.overflows[0]>0&&_c(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 $;const t=($=A.filter((t=>{if(x){const e=_c(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:$[0];if(t){n=t}break}case"initialPlacement":n=a;break}}if(s!==n){return{reset:{placement:n}}}}return{}}}};function Fc(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Xc(t){return ac.some((e=>t[e]>=0))}const Vc=function(t){if(t===void 0){t={}}return{name:"hide",options:t,async fn(e){const{rects:n}=e;const{strategy:i="referenceHidden",...s}=wc(t,e);switch(i){case"referenceHidden":{const t=await Hc(e,{...s,elementContext:"reference"});const i=Fc(t,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Xc(i)}}}case"escaped":{const t=await Hc(e,{...s,altBoundary:true});const i=Fc(t,n.floating);return{data:{escapedOffsets:i,escaped:Xc(i)}}}default:{return{}}}}}};function Yc(t){const e=hc(...t.map((t=>t.left)));const n=hc(...t.map((t=>t.top)));const i=dc(...t.map((t=>t.right)));const s=dc(...t.map((t=>t.bottom)));return{x:e,y:n,width:i-e,height:s-n}}function qc(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=>Mc(Yc(t))))}const Gc=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}=wc(t,e);const h=Array.from(await(r.getClientRects==null?void 0:r.getClientRects(i.reference))||[]);const d=qc(h);const u=Mc(Yc(h));const f=Lc(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(_c(n)==="y"){const t=d[0];const e=d[d.length-1];const i=vc(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=vc(n)==="left";const e=dc(...d.map((t=>t.right)));const i=hc(...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 Zc=new Set(["left","top"]);async function Qc(t,e){const{placement:n,platform:i,elements:s}=t;const r=await(i.isRTL==null?void 0:i.isRTL(s.floating));const o=vc(n);const a=yc(n);const c=_c(n)==="y";const l=Zc.has(o)?-1:1;const h=r&&c?-1:1;const d=wc(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 tl=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 Qc(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 el=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}=wc(t,e);const l={x:n,y:i};const h=await Hc(e,c);const d=_c(vc(s));const u=kc(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=gc(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=gc(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 nl=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}=wc(t,e);const h={x:n,y:i};const d=_c(s);const u=kc(d);let f=h[u];let p=h[d];const b=wc(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=Zc.has(vc(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 il=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}=wc(t,e);const h=await Hc(e,l);const d=vc(s);const u=yc(s);const f=_c(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=hc(b-h[m],w);const k=hc(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=dc(h.left,0);const e=dc(h.right,0);const n=dc(h.top,0);const i=dc(h.bottom,0);if(f){_=p-2*(t!==0||e!==0?t+e:dc(h.left,h.right))}else{S=b-2*(n!==0||i!==0?n+i:dc(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 sl(){return typeof window!=="undefined"}function rl(t){if(cl(t)){return(t.nodeName||"").toLowerCase()}return"#document"}function ol(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function al(t){var e;return(e=(cl(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function cl(t){if(!sl()){return false}return t instanceof Node||t instanceof ol(t).Node}function ll(t){if(!sl()){return false}return t instanceof Element||t instanceof ol(t).Element}function hl(t){if(!sl()){return false}return t instanceof HTMLElement||t instanceof ol(t).HTMLElement}function dl(t){if(!sl()||typeof ShadowRoot==="undefined"){return false}return t instanceof ShadowRoot||t instanceof ol(t).ShadowRoot}const ul=new Set(["inline","contents"]);function fl(t){const{overflow:e,overflowX:n,overflowY:i,display:s}=Al(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!ul.has(s)}const pl=new Set(["table","td","th"]);function bl(t){return pl.has(rl(t))}const ml=[":popover-open",":modal"];function gl(t){return ml.some((e=>{try{return t.matches(e)}catch(t){return false}}))}const wl=["transform","translate","scale","rotate","perspective"];const vl=["transform","translate","scale","rotate","perspective","filter"];const yl=["paint","layout","strict","content"];function kl(t){const e=Sl();const n=ll(t)?Al(t):t;return wl.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)||vl.some((t=>(n.willChange||"").includes(t)))||yl.some((t=>(n.contain||"").includes(t)))}function xl(t){let e=Tl(t);while(hl(e)&&!El(e)){if(kl(e)){return e}else if(gl(e)){return null}e=Tl(e)}return null}function Sl(){if(typeof CSS==="undefined"||!CSS.supports)return false;return CSS.supports("-webkit-backdrop-filter","none")}const _l=new Set(["html","body","#document"]);function El(t){return _l.has(rl(t))}function Al(t){return ol(t).getComputedStyle(t)}function Cl(t){if(ll(t)){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}return{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Tl(t){if(rl(t)==="html"){return t}const e=t.assignedSlot||t.parentNode||dl(t)&&t.host||al(t);return dl(e)?e.host:e}function $l(t){const e=Tl(t);if(El(e)){return t.ownerDocument?t.ownerDocument.body:t.body}if(hl(e)&&fl(e)){return e}return $l(e)}function zl(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=ol(s);if(r){const t=Pl(o);return e.concat(o,o.visualViewport||[],fl(s)?s:[],t&&n?zl(t):[])}return e.concat(s,zl(s,[],n))}function Pl(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Il(t){const e=Al(t);let n=parseFloat(e.width)||0;let i=parseFloat(e.height)||0;const s=hl(t);const r=s?t.offsetWidth:n;const o=s?t.offsetHeight:i;const a=uc(n)!==r||uc(i)!==o;if(a){n=r;i=o}return{width:n,height:i,$:a}}function Rl(t){return!ll(t)?t.contextElement:t}function Ol(t){const e=Rl(t);if(!hl(e)){return pc(1)}const n=e.getBoundingClientRect();const{width:i,height:s,$:r}=Il(e);let o=(r?uc(n.width):n.width)/i;let a=(r?uc(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 Dl=pc(0);function jl(t){const e=ol(t);if(!Sl()||!e.visualViewport){return Dl}return{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ll(t,e,n){if(e===void 0){e=false}if(!n||e&&n!==ol(t)){return false}return e}function Ml(t,e,n,i){if(e===void 0){e=false}if(n===void 0){n=false}const s=t.getBoundingClientRect();const r=Rl(t);let o=pc(1);if(e){if(i){if(ll(i)){o=Ol(i)}}else{o=Ol(t)}}const a=Ll(r,n,i)?jl(r):pc(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=ol(r);const e=i&&ll(i)?ol(i):i;let n=t;let s=Pl(n);while(s&&i&&e!==n){const t=Ol(s);const e=s.getBoundingClientRect();const i=Al(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=ol(s);s=Pl(n)}}return Mc({width:h,height:d,x:c,y:l})}function Wl(t,e){const n=Cl(t).scrollLeft;if(!e){return Ml(al(t)).left+n}return e.left+n}function Ul(t,e,n){if(n===void 0){n=false}const i=t.getBoundingClientRect();const s=i.left+e.scrollLeft-(n?0:Wl(t,i));const r=i.top+e.scrollTop;return{x:s,y:r}}function Hl(t){let{elements:e,rect:n,offsetParent:i,strategy:s}=t;const r=s==="fixed";const o=al(i);const a=e?gl(e.floating):false;if(i===o||a&&r){return n}let c={scrollLeft:0,scrollTop:0};let l=pc(1);const h=pc(0);const d=hl(i);if(d||!d&&!r){if(rl(i)!=="body"||fl(o)){c=Cl(i)}if(hl(i)){const t=Ml(i);l=Ol(i);h.x=t.x+i.clientLeft;h.y=t.y+i.clientTop}}const u=o&&!d&&!r?Ul(o,c,true):pc(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 Nl(t){return Array.from(t.getClientRects())}function Jl(t){const e=al(t);const n=Cl(t);const i=t.ownerDocument.body;const s=dc(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth);const r=dc(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let o=-n.scrollLeft+Wl(t);const a=-n.scrollTop;if(Al(i).direction==="rtl"){o+=dc(e.clientWidth,i.clientWidth)-s}return{width:s,height:r,x:o,y:a}}function Bl(t,e){const n=ol(t);const i=al(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=Sl();if(!t||t&&e==="fixed"){a=s.offsetLeft;c=s.offsetTop}}return{width:r,height:o,x:a,y:c}}const Kl=new Set(["absolute","fixed"]);function Fl(t,e){const n=Ml(t,true,e==="fixed");const i=n.top+t.clientTop;const s=n.left+t.clientLeft;const r=hl(t)?Ol(t):pc(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 Xl(t,e,n){let i;if(e==="viewport"){i=Bl(t,n)}else if(e==="document"){i=Jl(al(t))}else if(ll(e)){i=Fl(e,n)}else{const n=jl(t);i={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return Mc(i)}function Vl(t,e){const n=Tl(t);if(n===e||!ll(n)||El(n)){return false}return Al(n).position==="fixed"||Vl(n,e)}function Yl(t,e){const n=e.get(t);if(n){return n}let i=zl(t,[],false).filter((t=>ll(t)&&rl(t)!=="body"));let s=null;const r=Al(t).position==="fixed";let o=r?Tl(t):t;while(ll(o)&&!El(o)){const e=Al(o);const n=kl(o);if(!n&&e.position==="fixed"){s=null}const a=r?!n&&!s:!n&&e.position==="static"&&!!s&&Kl.has(s.position)||fl(o)&&!n&&Vl(t,o);if(a){i=i.filter((t=>t!==o))}else{s=e}o=Tl(o)}e.set(t,i);return i}function ql(t){let{element:e,boundary:n,rootBoundary:i,strategy:s}=t;const r=n==="clippingAncestors"?gl(e)?[]:Yl(e,this._c):[].concat(n);const o=[...r,i];const a=o[0];const c=o.reduce(((t,n)=>{const i=Xl(e,n,s);t.top=dc(i.top,t.top);t.right=hc(i.right,t.right);t.bottom=hc(i.bottom,t.bottom);t.left=dc(i.left,t.left);return t}),Xl(e,a,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Gl(t){const{width:e,height:n}=Il(t);return{width:e,height:n}}function Zl(t,e,n){const i=hl(e);const s=al(e);const r=n==="fixed";const o=Ml(t,true,r,e);let a={scrollLeft:0,scrollTop:0};const c=pc(0);function l(){c.x=Wl(s)}if(i||!i&&!r){if(rl(e)!=="body"||fl(s)){a=Cl(e)}if(i){const t=Ml(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?Ul(s,a):pc(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 Ql(t){return Al(t).position==="static"}function th(t,e){if(!hl(t)||Al(t).position==="fixed"){return null}if(e){return e(t)}let n=t.offsetParent;if(al(t)===n){n=n.ownerDocument.body}return n}function eh(t,e){const n=ol(t);if(gl(t)){return n}if(!hl(t)){let e=Tl(t);while(e&&!El(e)){if(ll(e)&&!Ql(e)){return e}e=Tl(e)}return n}let i=th(t,e);while(i&&bl(i)&&Ql(i)){i=th(i,e)}if(i&&El(i)&&Ql(i)&&!kl(i)){return n}return i||xl(t)||n}const nh=async function(t){const e=this.getOffsetParent||eh;const n=this.getDimensions;const i=await n(t.floating);return{reference:Zl(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function ih(t){return Al(t).direction==="rtl"}const sh={convertOffsetParentRelativeRectToViewportRelativeRect:Hl,getDocumentElement:al,getClippingRect:ql,getOffsetParent:eh,getElementRects:nh,getClientRects:Nl,getDimensions:Gl,getScale:Ol,isElement:ll,isRTL:ih};function rh(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function oh(t,e){let n=null;let i;const s=al(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=fc(d);const b=fc(s.clientWidth-(h+u));const m=fc(s.clientHeight-(d+f));const g=fc(h);const w=-p+"px "+-b+"px "+-m+"px "+-g+"px";const v={rootMargin:w,threshold:dc(0,hc(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&&!rh(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 ah(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=Rl(t);const h=s||r?[...l?zl(l):[],...zl(e)]:[];h.forEach((t=>{s&&t.addEventListener("scroll",n,{passive:true});r&&t.addEventListener("resize",n)}));const d=l&&a?oh(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?Ml(t):null;if(c){m()}function m(){const e=Ml(t);if(b&&!rh(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 ch=tl;Bc;const lh=el;const hh=Kc;const dh=il;Vc;const uh=Nc;Gc;nl;const fh=(t,e,n)=>{const i=new Map;const s={platform:sh,...n};const r={...s.platform,_c:i};return Uc(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 Tc(t){const e=jc(t);return[$c(t),e,$c(e)]}function $c(t){return t.replace(/start|end/g,(t=>gc[t]))}const zc=["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:zc;return e?zc: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($c))}}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 $=S-b[p]-C;const z=S/2-b[p]/2+_;const P=wc(T,z,$);const I=!c.arrow&&kc(s)!=null&&z!==P&&r.reference[p]/2-(z<T?A:C)-b[p]/2<0;const R=I?z<T?z-T:z-$:0;return{[f]:u[f]+R,data:{[f]:P,centerOffset:z-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?$c(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 $;const 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:$[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=$l(t);while(dl(e)&&!Al(e)){if(xl(e)){return e}else if(wl(e)){return null}e=$l(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 $l(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 zl(t){const e=$l(t);if(Al(e)){return t.ownerDocument?t.ownerDocument.body:t.body}if(dl(e)&&pl(e)){return e}return zl(e)}function Pl(t,e,n){var i;if(e===void 0){e=[]}if(n===void 0){n=true}const s=zl(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=$l(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?$l(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=$l(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=$l(t);while(e&&!Al(e)){if(hl(e)&&!th(e)){return e}e=$l(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
183
183
  * SPDX-License-Identifier: BSD-3-Clause
184
- */const ph={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},bh=t=>(...e)=>({_$litDirective$:t,values:e});class mh{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,n){this._$Ct=t,this._$AM=e,this._$Ci=n}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}
184
+ */const bh={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},mh=t=>(...e)=>({_$litDirective$:t,values:e});class gh{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,n){this._$Ct=t,this._$AM=e,this._$Ci=n}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}
185
185
  /**
186
186
  * @license
187
187
  * Copyright 2018 Google LLC
188
188
  * SPDX-License-Identifier: BSD-3-Clause
189
- */const gh=bh(class extends mh{constructor(t){if(super(t),t.type!==ph.ATTRIBUTE||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(e)}const n=t.element.classList;for(const t of this.st)t in e||(n.remove(t),this.st.delete(t));for(const t in e){const i=!!e[t];i===this.st.has(t)||this.nt?.has(t)||(i?(n.add(t),this.st.add(t)):(n.remove(t),this.st.delete(t)))}return Jo}});function wh(t){return yh(t)}function vh(t){if(t.assignedSlot){return t.assignedSlot}if(t.parentNode instanceof ShadowRoot){return t.parentNode.host}return t.parentNode}function yh(t){for(let e=t;e;e=vh(e)){if(!(e instanceof Element)){continue}if(getComputedStyle(e).display==="none"){return null}}for(let e=vh(t);e;e=vh(e)){if(!(e instanceof Element)){continue}const t=getComputedStyle(e);if(t.display==="contents"){continue}if(t.position!=="static"||kl(t)){return e}if(e.tagName==="BODY"){return e}}return null}function kh(t){return t!==null&&typeof t==="object"&&"getBoundingClientRect"in t&&("contextElement"in t?t.contextElement instanceof Element:true)}var xh=class extends oc{constructor(){super(...arguments);this.localize=new Ga(this);this.active=false;this.placement="top";this.strategy="absolute";this.distance=0;this.skidding=0;this.arrow=false;this.arrowPlacement="anchor";this.arrowPadding=10;this.flip=false;this.flipFallbackPlacements="";this.flipFallbackStrategy="best-fit";this.flipPadding=0;this.shift=false;this.shiftPadding=0;this.autoSizePadding=0;this.hoverBridge=false;this.updateHoverBridge=()=>{if(this.hoverBridge&&this.anchorEl){const t=this.anchorEl.getBoundingClientRect();const e=this.popup.getBoundingClientRect();const n=this.placement.includes("top")||this.placement.includes("bottom");let i=0;let s=0;let r=0;let o=0;let a=0;let c=0;let l=0;let h=0;if(n){if(t.top<e.top){i=t.left;s=t.bottom;r=t.right;o=t.bottom;a=e.left;c=e.top;l=e.right;h=e.top}else{i=e.left;s=e.bottom;r=e.right;o=e.bottom;a=t.left;c=t.top;l=t.right;h=t.top}}else{if(t.left<e.left){i=t.right;s=t.top;r=e.left;o=e.top;a=t.right;c=t.bottom;l=e.left;h=e.bottom}else{i=e.right;s=e.top;r=t.left;o=t.top;a=e.right;c=e.bottom;l=t.left;h=t.bottom}}this.style.setProperty("--hover-bridge-top-left-x",`${i}px`);this.style.setProperty("--hover-bridge-top-left-y",`${s}px`);this.style.setProperty("--hover-bridge-top-right-x",`${r}px`);this.style.setProperty("--hover-bridge-top-right-y",`${o}px`);this.style.setProperty("--hover-bridge-bottom-left-x",`${a}px`);this.style.setProperty("--hover-bridge-bottom-left-y",`${c}px`);this.style.setProperty("--hover-bridge-bottom-right-x",`${l}px`);this.style.setProperty("--hover-bridge-bottom-right-y",`${h}px`)}}}async connectedCallback(){super.connectedCallback();await this.updateComplete;this.start()}disconnectedCallback(){super.disconnectedCallback();this.stop()}async updated(t){super.updated(t);if(t.has("active")){if(this.active){this.start()}else{this.stop()}}if(t.has("anchor")){this.handleAnchorChange()}if(this.active){await this.updateComplete;this.reposition()}}async handleAnchorChange(){await this.stop();if(this.anchor&&typeof this.anchor==="string"){const t=this.getRootNode();this.anchorEl=t.getElementById(this.anchor)}else if(this.anchor instanceof Element||kh(this.anchor)){this.anchorEl=this.anchor}else{this.anchorEl=this.querySelector('[slot="anchor"]')}if(this.anchorEl instanceof HTMLSlotElement){this.anchorEl=this.anchorEl.assignedElements({flatten:true})[0]}if(this.anchorEl&&this.active){this.start()}}start(){if(!this.anchorEl||!this.active){return}this.cleanup=ah(this.anchorEl,this.popup,(()=>{this.reposition()}))}async stop(){return new Promise((t=>{if(this.cleanup){this.cleanup();this.cleanup=void 0;this.removeAttribute("data-current-placement");this.style.removeProperty("--auto-size-available-width");this.style.removeProperty("--auto-size-available-height");requestAnimationFrame((()=>t()))}else{t()}}))}reposition(){if(!this.active||!this.anchorEl){return}const t=[ch({mainAxis:this.distance,crossAxis:this.skidding})];if(this.sync){t.push(dh({apply:({rects:t})=>{const e=this.sync==="width"||this.sync==="both";const n=this.sync==="height"||this.sync==="both";this.popup.style.width=e?`${t.reference.width}px`:"";this.popup.style.height=n?`${t.reference.height}px`:""}}))}else{this.popup.style.width="";this.popup.style.height=""}if(this.flip){t.push(hh({boundary:this.flipBoundary,fallbackPlacements:this.flipFallbackPlacements,fallbackStrategy:this.flipFallbackStrategy==="best-fit"?"bestFit":"initialPlacement",padding:this.flipPadding}))}if(this.shift){t.push(lh({boundary:this.shiftBoundary,padding:this.shiftPadding}))}if(this.autoSize){t.push(dh({boundary:this.autoSizeBoundary,padding:this.autoSizePadding,apply:({availableWidth:t,availableHeight:e})=>{if(this.autoSize==="vertical"||this.autoSize==="both"){this.style.setProperty("--auto-size-available-height",`${e}px`)}else{this.style.removeProperty("--auto-size-available-height")}if(this.autoSize==="horizontal"||this.autoSize==="both"){this.style.setProperty("--auto-size-available-width",`${t}px`)}else{this.style.removeProperty("--auto-size-available-width")}}}))}else{this.style.removeProperty("--auto-size-available-width");this.style.removeProperty("--auto-size-available-height")}if(this.arrow){t.push(uh({element:this.arrowEl,padding:this.arrowPadding}))}const e=this.strategy==="absolute"?t=>sh.getOffsetParent(t,wh):sh.getOffsetParent;fh(this.anchorEl,this.popup,{placement:this.placement,middleware:t,strategy:this.strategy,platform:ka(ya({},sh),{getOffsetParent:e})}).then((({x:t,y:e,middlewareData:n,placement:i})=>{const s=this.localize.dir()==="rtl";const r={top:"bottom",right:"left",bottom:"top",left:"right"}[i.split("-")[0]];this.setAttribute("data-current-placement",i);Object.assign(this.popup.style,{left:`${t}px`,top:`${e}px`});if(this.arrow){const t=n.arrow.x;const e=n.arrow.y;let i="";let o="";let a="";let c="";if(this.arrowPlacement==="start"){const n=typeof t==="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";i=typeof e==="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";o=s?n:"";c=s?"":n}else if(this.arrowPlacement==="end"){const n=typeof t==="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";o=s?"":n;c=s?n:"";a=typeof e==="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:""}else if(this.arrowPlacement==="center"){c=typeof t==="number"?`calc(50% - var(--arrow-size-diagonal))`:"";i=typeof e==="number"?`calc(50% - var(--arrow-size-diagonal))`:""}else{c=typeof t==="number"?`${t}px`:"";i=typeof e==="number"?`${e}px`:""}Object.assign(this.arrowEl.style,{top:i,right:o,bottom:a,left:c,[r]:"calc(var(--arrow-size-diagonal) * -1)"})}}));requestAnimationFrame((()=>this.updateHoverBridge()));this.emit("sl-reposition")}render(){return No`
189
+ */const wh=mh(class extends gh{constructor(t){if(super(t),t.type!==bh.ATTRIBUTE||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(e)}const n=t.element.classList;for(const t of this.st)t in e||(n.remove(t),this.st.delete(t));for(const t in e){const i=!!e[t];i===this.st.has(t)||this.nt?.has(t)||(i?(n.add(t),this.st.add(t)):(n.remove(t),this.st.delete(t)))}return la}});function vh(t){return kh(t)}function yh(t){if(t.assignedSlot){return t.assignedSlot}if(t.parentNode instanceof ShadowRoot){return t.parentNode.host}return t.parentNode}function kh(t){for(let e=t;e;e=yh(e)){if(!(e instanceof Element)){continue}if(getComputedStyle(e).display==="none"){return null}}for(let e=yh(t);e;e=yh(e)){if(!(e instanceof Element)){continue}const t=getComputedStyle(e);if(t.display==="contents"){continue}if(t.position!=="static"||xl(t)){return e}if(e.tagName==="BODY"){return e}}return null}function xh(t){return t!==null&&typeof t==="object"&&"getBoundingClientRect"in t&&("contextElement"in t?t.contextElement instanceof Element:true)}var Sh=class extends ac{constructor(){super(...arguments);this.localize=new Za(this);this.active=false;this.placement="top";this.strategy="absolute";this.distance=0;this.skidding=0;this.arrow=false;this.arrowPlacement="anchor";this.arrowPadding=10;this.flip=false;this.flipFallbackPlacements="";this.flipFallbackStrategy="best-fit";this.flipPadding=0;this.shift=false;this.shiftPadding=0;this.autoSizePadding=0;this.hoverBridge=false;this.updateHoverBridge=()=>{if(this.hoverBridge&&this.anchorEl){const t=this.anchorEl.getBoundingClientRect();const e=this.popup.getBoundingClientRect();const n=this.placement.includes("top")||this.placement.includes("bottom");let i=0;let s=0;let r=0;let o=0;let a=0;let c=0;let l=0;let h=0;if(n){if(t.top<e.top){i=t.left;s=t.bottom;r=t.right;o=t.bottom;a=e.left;c=e.top;l=e.right;h=e.top}else{i=e.left;s=e.bottom;r=e.right;o=e.bottom;a=t.left;c=t.top;l=t.right;h=t.top}}else{if(t.left<e.left){i=t.right;s=t.top;r=e.left;o=e.top;a=t.right;c=t.bottom;l=e.left;h=e.bottom}else{i=e.right;s=e.top;r=t.left;o=t.top;a=e.right;c=e.bottom;l=t.left;h=t.bottom}}this.style.setProperty("--hover-bridge-top-left-x",`${i}px`);this.style.setProperty("--hover-bridge-top-left-y",`${s}px`);this.style.setProperty("--hover-bridge-top-right-x",`${r}px`);this.style.setProperty("--hover-bridge-top-right-y",`${o}px`);this.style.setProperty("--hover-bridge-bottom-left-x",`${a}px`);this.style.setProperty("--hover-bridge-bottom-left-y",`${c}px`);this.style.setProperty("--hover-bridge-bottom-right-x",`${l}px`);this.style.setProperty("--hover-bridge-bottom-right-y",`${h}px`)}}}async connectedCallback(){super.connectedCallback();await this.updateComplete;this.start()}disconnectedCallback(){super.disconnectedCallback();this.stop()}async updated(t){super.updated(t);if(t.has("active")){if(this.active){this.start()}else{this.stop()}}if(t.has("anchor")){this.handleAnchorChange()}if(this.active){await this.updateComplete;this.reposition()}}async handleAnchorChange(){await this.stop();if(this.anchor&&typeof this.anchor==="string"){const t=this.getRootNode();this.anchorEl=t.getElementById(this.anchor)}else if(this.anchor instanceof Element||xh(this.anchor)){this.anchorEl=this.anchor}else{this.anchorEl=this.querySelector('[slot="anchor"]')}if(this.anchorEl instanceof HTMLSlotElement){this.anchorEl=this.anchorEl.assignedElements({flatten:true})[0]}if(this.anchorEl&&this.active){this.start()}}start(){if(!this.anchorEl||!this.active){return}this.cleanup=ch(this.anchorEl,this.popup,(()=>{this.reposition()}))}async stop(){return new Promise((t=>{if(this.cleanup){this.cleanup();this.cleanup=void 0;this.removeAttribute("data-current-placement");this.style.removeProperty("--auto-size-available-width");this.style.removeProperty("--auto-size-available-height");requestAnimationFrame((()=>t()))}else{t()}}))}reposition(){if(!this.active||!this.anchorEl){return}const t=[lh({mainAxis:this.distance,crossAxis:this.skidding})];if(this.sync){t.push(uh({apply:({rects:t})=>{const e=this.sync==="width"||this.sync==="both";const n=this.sync==="height"||this.sync==="both";this.popup.style.width=e?`${t.reference.width}px`:"";this.popup.style.height=n?`${t.reference.height}px`:""}}))}else{this.popup.style.width="";this.popup.style.height=""}if(this.flip){t.push(dh({boundary:this.flipBoundary,fallbackPlacements:this.flipFallbackPlacements,fallbackStrategy:this.flipFallbackStrategy==="best-fit"?"bestFit":"initialPlacement",padding:this.flipPadding}))}if(this.shift){t.push(hh({boundary:this.shiftBoundary,padding:this.shiftPadding}))}if(this.autoSize){t.push(uh({boundary:this.autoSizeBoundary,padding:this.autoSizePadding,apply:({availableWidth:t,availableHeight:e})=>{if(this.autoSize==="vertical"||this.autoSize==="both"){this.style.setProperty("--auto-size-available-height",`${e}px`)}else{this.style.removeProperty("--auto-size-available-height")}if(this.autoSize==="horizontal"||this.autoSize==="both"){this.style.setProperty("--auto-size-available-width",`${t}px`)}else{this.style.removeProperty("--auto-size-available-width")}}}))}else{this.style.removeProperty("--auto-size-available-width");this.style.removeProperty("--auto-size-available-height")}if(this.arrow){t.push(fh({element:this.arrowEl,padding:this.arrowPadding}))}const e=this.strategy==="absolute"?t=>rh.getOffsetParent(t,vh):rh.getOffsetParent;ph(this.anchorEl,this.popup,{placement:this.placement,middleware:t,strategy:this.strategy,platform:it(nt({},rh),{getOffsetParent:e})}).then((({x:t,y:e,middlewareData:n,placement:i})=>{const s=this.localize.dir()==="rtl";const r={top:"bottom",right:"left",bottom:"top",left:"right"}[i.split("-")[0]];this.setAttribute("data-current-placement",i);Object.assign(this.popup.style,{left:`${t}px`,top:`${e}px`});if(this.arrow){const t=n.arrow.x;const e=n.arrow.y;let i="";let o="";let a="";let c="";if(this.arrowPlacement==="start"){const n=typeof t==="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";i=typeof e==="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";o=s?n:"";c=s?"":n}else if(this.arrowPlacement==="end"){const n=typeof t==="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";o=s?"":n;c=s?n:"";a=typeof e==="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:""}else if(this.arrowPlacement==="center"){c=typeof t==="number"?`calc(50% - var(--arrow-size-diagonal))`:"";i=typeof e==="number"?`calc(50% - var(--arrow-size-diagonal))`:""}else{c=typeof t==="number"?`${t}px`:"";i=typeof e==="number"?`${e}px`:""}Object.assign(this.arrowEl.style,{top:i,right:o,bottom:a,left:c,[r]:"calc(var(--arrow-size-diagonal) * -1)"})}}));requestAnimationFrame((()=>this.updateHoverBridge()));this.emit("sl-reposition")}render(){return ca`
190
190
  <slot name="anchor" @slotchange=${this.handleAnchorChange}></slot>
191
191
 
192
192
  <span
193
193
  part="hover-bridge"
194
- class=${gh({"popup-hover-bridge":true,"popup-hover-bridge--visible":this.hoverBridge&&this.active})}
194
+ class=${wh({"popup-hover-bridge":true,"popup-hover-bridge--visible":this.hoverBridge&&this.active})}
195
195
  ></span>
196
196
 
197
197
  <div
198
198
  part="popup"
199
- class=${gh({popup:true,"popup--active":this.active,"popup--fixed":this.strategy==="fixed","popup--has-arrow":this.arrow})}
199
+ class=${wh({popup:true,"popup--active":this.active,"popup--fixed":this.strategy==="fixed","popup--has-arrow":this.arrow})}
200
200
  >
201
201
  <slot></slot>
202
- ${this.arrow?No`<div part="arrow" class="popup__arrow" role="presentation"></div>`:""}
202
+ ${this.arrow?ca`<div part="arrow" class="popup__arrow" role="presentation"></div>`:""}
203
203
  </div>
204
- `}};xh.styles=[Za,Wa];xa([sc(".popup")],xh.prototype,"popup",2);xa([sc(".popup__arrow")],xh.prototype,"arrowEl",2);xa([ec()],xh.prototype,"anchor",2);xa([ec({type:Boolean,reflect:true})],xh.prototype,"active",2);xa([ec({reflect:true})],xh.prototype,"placement",2);xa([ec({reflect:true})],xh.prototype,"strategy",2);xa([ec({type:Number})],xh.prototype,"distance",2);xa([ec({type:Number})],xh.prototype,"skidding",2);xa([ec({type:Boolean})],xh.prototype,"arrow",2);xa([ec({attribute:"arrow-placement"})],xh.prototype,"arrowPlacement",2);xa([ec({attribute:"arrow-padding",type:Number})],xh.prototype,"arrowPadding",2);xa([ec({type:Boolean})],xh.prototype,"flip",2);xa([ec({attribute:"flip-fallback-placements",converter:{fromAttribute:t=>t.split(" ").map((t=>t.trim())).filter((t=>t!=="")),toAttribute:t=>t.join(" ")}})],xh.prototype,"flipFallbackPlacements",2);xa([ec({attribute:"flip-fallback-strategy"})],xh.prototype,"flipFallbackStrategy",2);xa([ec({type:Object})],xh.prototype,"flipBoundary",2);xa([ec({attribute:"flip-padding",type:Number})],xh.prototype,"flipPadding",2);xa([ec({type:Boolean})],xh.prototype,"shift",2);xa([ec({type:Object})],xh.prototype,"shiftBoundary",2);xa([ec({attribute:"shift-padding",type:Number})],xh.prototype,"shiftPadding",2);xa([ec({attribute:"auto-size"})],xh.prototype,"autoSize",2);xa([ec()],xh.prototype,"sync",2);xa([ec({type:Object})],xh.prototype,"autoSizeBoundary",2);xa([ec({attribute:"auto-size-padding",type:Number})],xh.prototype,"autoSizePadding",2);xa([ec({attribute:"hover-bridge",type:Boolean})],xh.prototype,"hoverBridge",2);var Sh=new Map;var _h=new WeakMap;function Eh(t){return t!=null?t:{keyframes:[],options:{duration:0}}}function Ah(t,e){if(e.toLowerCase()==="rtl"){return{keyframes:t.rtlKeyframes||t.keyframes,options:t.options}}return t}function Ch(t,e){Sh.set(t,Eh(e))}function Th(t,e,n){const i=_h.get(t);if(i==null?void 0:i[e]){return Ah(i[e],n.dir)}const s=Sh.get(e);if(s){return Ah(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 zh(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,ka(ya({},n),{duration:Ph()?0:n.duration}));s.addEventListener("cancel",i,{once:true});s.addEventListener("finish",i,{once:true})}))}function Ph(){const t=window.matchMedia("(prefers-reduced-motion: reduce)");return t.matches}function Ih(t){return Promise.all(t.getAnimations().map((t=>new Promise((e=>{t.cancel();requestAnimationFrame(e)})))))}function Rh(t,e){const n=ya({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)}}}
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 Th(t,e){_h.set(t,Ah(e))}function $h(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 zh(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 Oh=t=>t??Bo;var Dh=class extends oc{constructor(){super(...arguments);this.localize=new Ga(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?za():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=>ja(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 Ih(this);this.panel.hidden=false;this.popup.active=true;const{keyframes:t,options:e}=Th(this,"dropdown.show",{dir:this.localize.dir()});await zh(this.popup.popup,t,e);this.emit("sl-after-show")}else{this.emit("sl-hide");this.removeOpenListeners();await Ih(this);const{keyframes:t,options:e}=Th(this,"dropdown.hide",{dir:this.localize.dir()});await zh(this.popup.popup,t,e);this.panel.hidden=true;this.popup.active=false;this.emit("sl-after-hide")}}render(){return No`
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 zh(this,"sl-after-show")}async hide(){if(!this.open){return void 0}this.open=false;return zh(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}=$h(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}=$h(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"
@@ -219,8 +219,8 @@ 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
219
219
  shift
220
220
  auto-size="vertical"
221
221
  auto-size-padding="10"
222
- sync=${Oh(this.sync?this.sync:void 0)}
223
- class=${gh({dropdown:true,"dropdown--open":this.open})}
222
+ sync=${Dh(this.sync?this.sync:void 0)}
223
+ class=${wh({dropdown:true,"dropdown--open":this.open})}
224
224
  >
225
225
  <slot
226
226
  name="trigger"
@@ -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
- `}};Dh.styles=[Za,la];Dh.dependencies={"sl-popup":xh};xa([sc(".dropdown")],Dh.prototype,"popup",2);xa([sc(".dropdown__trigger")],Dh.prototype,"trigger",2);xa([sc(".dropdown__panel")],Dh.prototype,"panel",2);xa([ec({type:Boolean,reflect:true})],Dh.prototype,"open",2);xa([ec({reflect:true})],Dh.prototype,"placement",2);xa([ec({type:Boolean,reflect:true})],Dh.prototype,"disabled",2);xa([ec({attribute:"stay-open-on-select",type:Boolean,reflect:true})],Dh.prototype,"stayOpenOnSelect",2);xa([ec({attribute:false})],Dh.prototype,"containingElement",2);xa([ec({type:Number})],Dh.prototype,"distance",2);xa([ec({type:Number})],Dh.prototype,"skidding",2);xa([ec({type:Boolean})],Dh.prototype,"hoist",2);xa([ec({reflect:true})],Dh.prototype,"sync",2);xa([Rh("open",{waitUntilFirstUpdate:true})],Dh.prototype,"handleOpenChange",1);Ch("dropdown.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}});Ch("dropdown.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}});Dh.define("sl-dropdown");var jh=no`
240
+ `}};jh.styles=[Qa,$a];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);Th("dropdown.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}});Th("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;
@@ -252,14 +252,14 @@ 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
252
252
  ::slotted(sl-divider) {
253
253
  --spacing: var(--sl-spacing-x-small);
254
254
  }
255
- `;var Lh=class extends oc{connectedCallback(){super.connectedCallback();this.setAttribute("role","menu")}handleClick(t){const e=["menuitem","menuitemcheckbox"];const n=t.composedPath();const i=n.find((t=>{var n;return e.includes(((n=t==null?void 0:t.getAttribute)==null?void 0:n.call(t,"role"))||"")}));if(!i)return;const s=n.find((t=>{var e;return((e=t==null?void 0:t.getAttribute)==null?void 0:e.call(t,"role"))==="menu"}));const r=s!==this;if(r)return;const o=i;if(o.type==="checkbox"){o.checked=!o.checked}this.emit("sl-select",{detail:{item:o}})}handleKeyDown(t){if(t.key==="Enter"||t.key===" "){const e=this.getCurrentItem();t.preventDefault();t.stopPropagation();e==null?void 0:e.click()}else if(["ArrowDown","ArrowUp","Home","End"].includes(t.key)){const e=this.getAllItems();const n=this.getCurrentItem();let i=n?e.indexOf(n):0;if(e.length>0){t.preventDefault();t.stopPropagation();if(t.key==="ArrowDown"){i++}else if(t.key==="ArrowUp"){i--}else if(t.key==="Home"){i=0}else if(t.key==="End"){i=e.length-1}if(i<0){i=e.length-1}if(i>e.length-1){i=0}this.setCurrentItem(e[i]);e[i].focus()}}}handleMouseDown(t){const e=t.target;if(this.isMenuItem(e)){this.setCurrentItem(e)}}handleSlotChange(){const t=this.getAllItems();if(t.length>0){this.setCurrentItem(t[0])}}isMenuItem(t){var e;return t.tagName.toLowerCase()==="sl-menu-item"||["menuitem","menuitemcheckbox","menuitemradio"].includes((e=t.getAttribute("role"))!=null?e:"")}getAllItems(){return[...this.defaultSlot.assignedElements({flatten:true})].filter((t=>{if(t.inert||!this.isMenuItem(t)){return false}return true}))}getCurrentItem(){return this.getAllItems().find((t=>t.getAttribute("tabindex")==="0"))}setCurrentItem(t){const e=this.getAllItems();e.forEach((e=>{e.setAttribute("tabindex",e===t?"0":"-1")}))}render(){return No`
255
+ `;var Mh=class extends ac{connectedCallback(){super.connectedCallback();this.setAttribute("role","menu")}handleClick(t){const e=["menuitem","menuitemcheckbox"];const n=t.composedPath();const i=n.find((t=>{var n;return e.includes(((n=t==null?void 0:t.getAttribute)==null?void 0:n.call(t,"role"))||"")}));if(!i)return;const s=n.find((t=>{var e;return((e=t==null?void 0:t.getAttribute)==null?void 0:e.call(t,"role"))==="menu"}));const r=s!==this;if(r)return;const o=i;if(o.type==="checkbox"){o.checked=!o.checked}this.emit("sl-select",{detail:{item:o}})}handleKeyDown(t){if(t.key==="Enter"||t.key===" "){const e=this.getCurrentItem();t.preventDefault();t.stopPropagation();e==null?void 0:e.click()}else if(["ArrowDown","ArrowUp","Home","End"].includes(t.key)){const e=this.getAllItems();const n=this.getCurrentItem();let i=n?e.indexOf(n):0;if(e.length>0){t.preventDefault();t.stopPropagation();if(t.key==="ArrowDown"){i++}else if(t.key==="ArrowUp"){i--}else if(t.key==="Home"){i=0}else if(t.key==="End"){i=e.length-1}if(i<0){i=e.length-1}if(i>e.length-1){i=0}this.setCurrentItem(e[i]);e[i].focus()}}}handleMouseDown(t){const e=t.target;if(this.isMenuItem(e)){this.setCurrentItem(e)}}handleSlotChange(){const t=this.getAllItems();if(t.length>0){this.setCurrentItem(t[0])}}isMenuItem(t){var e;return t.tagName.toLowerCase()==="sl-menu-item"||["menuitem","menuitemcheckbox","menuitemradio"].includes((e=t.getAttribute("role"))!=null?e:"")}getAllItems(){return[...this.defaultSlot.assignedElements({flatten:true})].filter((t=>{if(t.inert||!this.isMenuItem(t)){return false}return true}))}getCurrentItem(){return this.getAllItems().find((t=>t.getAttribute("tabindex")==="0"))}setCurrentItem(t){const e=this.getAllItems();e.forEach((e=>{e.setAttribute("tabindex",e===t?"0":"-1")}))}render(){return ca`
256
256
  <slot
257
257
  @slotchange=${this.handleSlotChange}
258
258
  @click=${this.handleClick}
259
259
  @keydown=${this.handleKeyDown}
260
260
  @mousedown=${this.handleMouseDown}
261
261
  ></slot>
262
- `}};Lh.styles=[Za,jh];xa([sc("slot")],Lh.prototype,"defaultSlot",2);Lh.define("sl-menu");var Mh=no`
262
+ `}};Mh.styles=[Qa,Lh];st([rc("slot")],Mh.prototype,"defaultSlot",2);Mh.define("sl-menu");var Wh=So`
263
263
  :host {
264
264
  --submenu-offset: -2px;
265
265
 
@@ -416,19 +416,19 @@ 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
416
416
  * @license
417
417
  * Copyright 2020 Google LLC
418
418
  * SPDX-License-Identifier: BSD-3-Clause
419
- */;const Wh=(t,e)=>void 0===e?void 0!==t?._$litType$:t?._$litType$===e,Uh=t=>void 0===t.strings
419
+ */;const Uh=(t,e)=>void 0===e?void 0!==t?._$litType$:t?._$litType$===e,Hh=t=>void 0===t.strings
420
420
  /**
421
421
  * @license
422
422
  * Copyright 2017 Google LLC
423
423
  * SPDX-License-Identifier: BSD-3-Clause
424
- */;const Hh=(t,e)=>{const n=t._$AN;if(void 0===n)return!1;for(const t of n)t._$AO?.(e,!1),Hh(t,e);return!0},Nh=t=>{let e,n;do{if(void 0===(e=t._$AM))break;n=e._$AN,n.delete(t),t=e}while(0===n?.size)},Jh=t=>{for(let e;e=t._$AM;t=e){let n=e._$AN;if(void 0===n)e._$AN=n=new Set;else if(n.has(t))break;n.add(t),Fh(e)}};function Bh(t){void 0!==this._$AN?(Nh(this),this._$AM=t,Jh(this)):this._$AM=t}function Kh(t,e=!1,n=0){const i=this._$AH,s=this._$AN;if(void 0!==s&&0!==s.size)if(e)if(Array.isArray(i))for(let t=n;t<i.length;t++)Hh(i[t],!1),Nh(i[t]);else null!=i&&(Hh(i,!1),Nh(i));else Hh(this,t)}const Fh=t=>{t.type==ph.CHILD&&(t._$AP??=Kh,t._$AQ??=Bh)};class Xh extends mh{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,n){super._$AT(t,e,n),Jh(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(Hh(this,t),Nh(this))}setValue(t){if(Uh(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}
424
+ */;const Nh=(t,e)=>{const n=t._$AN;if(void 0===n)return!1;for(const t of n)t._$AO?.(e,!1),Nh(t,e);return!0},Jh=t=>{let e,n;do{if(void 0===(e=t._$AM))break;n=e._$AN,n.delete(t),t=e}while(0===n?.size)},Bh=t=>{for(let e;e=t._$AM;t=e){let n=e._$AN;if(void 0===n)e._$AN=n=new Set;else if(n.has(t))break;n.add(t),Xh(e)}};function Kh(t){void 0!==this._$AN?(Jh(this),this._$AM=t,Bh(this)):this._$AM=t}function Fh(t,e=!1,n=0){const i=this._$AH,s=this._$AN;if(void 0!==s&&0!==s.size)if(e)if(Array.isArray(i))for(let t=n;t<i.length;t++)Nh(i[t],!1),Jh(i[t]);else null!=i&&(Nh(i,!1),Jh(i));else Nh(this,t)}const Xh=t=>{t.type==bh.CHILD&&(t._$AP??=Fh,t._$AQ??=Kh)};class Vh extends gh{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,n){super._$AT(t,e,n),Bh(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(Nh(this,t),Jh(this))}setValue(t){if(Hh(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}
425
425
  /**
426
426
  * @license
427
427
  * Copyright 2020 Google LLC
428
428
  * SPDX-License-Identifier: BSD-3-Clause
429
- */const Vh=()=>new Yh;class Yh{}const qh=new WeakMap,Gh=bh(class extends Xh{render(t){return Bo}update(t,[e]){const n=e!==this.G;return n&&void 0!==this.G&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.G=e,this.ht=t.options?.host,this.rt(this.ct=t.element)),Bo}rt(t){if(this.isConnected||(t=void 0),"function"==typeof this.G){const e=this.ht??globalThis;let n=qh.get(e);void 0===n&&(n=new WeakMap,qh.set(e,n)),void 0!==n.get(this.G)&&this.G.call(this.ht,void 0),n.set(this.G,t),void 0!==t&&this.G.call(this.ht,t)}else this.G.value=t}get lt(){return"function"==typeof this.G?qh.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var Zh=class{constructor(t,e){this.popupRef=Vh();this.enableSubmenuTimer=-1;this.isConnected=false;this.isPopupConnected=false;this.skidding=0;this.submenuOpenDelay=100;this.handleMouseMove=t=>{this.host.style.setProperty("--safe-triangle-cursor-x",`${t.clientX}px`);this.host.style.setProperty("--safe-triangle-cursor-y",`${t.clientY}px`)};this.handleMouseOver=()=>{if(this.hasSlotController.test("submenu")){this.enableSubmenu()}};this.handleKeyDown=t=>{switch(t.key){case"Escape":case"Tab":this.disableSubmenu();break;case"ArrowLeft":if(t.target!==this.host){t.preventDefault();t.stopPropagation();this.host.focus();this.disableSubmenu()}break;case"ArrowRight":case"Enter":case" ":this.handleSubmenuEntry(t);break}};this.handleClick=t=>{var e;if(t.target===this.host){t.preventDefault();t.stopPropagation()}else if(t.target instanceof Element&&(t.target.tagName==="sl-menu-item"||((e=t.target.role)==null?void 0:e.startsWith("menuitem")))){this.disableSubmenu()}};this.handleFocusOut=t=>{if(t.relatedTarget&&t.relatedTarget instanceof Element&&this.host.contains(t.relatedTarget)){return}this.disableSubmenu()};this.handlePopupMouseover=t=>{t.stopPropagation()};this.handlePopupReposition=()=>{const t=this.host.renderRoot.querySelector("slot[name='submenu']");const e=t==null?void 0:t.assignedElements({flatten:true}).filter((t=>t.localName==="sl-menu"))[0];const n=getComputedStyle(this.host).direction==="rtl";if(!e){return}const{left:i,top:s,width:r,height:o}=e.getBoundingClientRect();this.host.style.setProperty("--safe-triangle-submenu-start-x",`${n?i+r:i}px`);this.host.style.setProperty("--safe-triangle-submenu-start-y",`${s}px`);this.host.style.setProperty("--safe-triangle-submenu-end-x",`${n?i+r:i}px`);this.host.style.setProperty("--safe-triangle-submenu-end-y",`${s+o}px`)};(this.host=t).addController(this);this.hasSlotController=e}hostConnected(){if(this.hasSlotController.test("submenu")&&!this.host.disabled){this.addListeners()}}hostDisconnected(){this.removeListeners()}hostUpdated(){if(this.hasSlotController.test("submenu")&&!this.host.disabled){this.addListeners();this.updateSkidding()}else{this.removeListeners()}}addListeners(){if(!this.isConnected){this.host.addEventListener("mousemove",this.handleMouseMove);this.host.addEventListener("mouseover",this.handleMouseOver);this.host.addEventListener("keydown",this.handleKeyDown);this.host.addEventListener("click",this.handleClick);this.host.addEventListener("focusout",this.handleFocusOut);this.isConnected=true}if(!this.isPopupConnected){if(this.popupRef.value){this.popupRef.value.addEventListener("mouseover",this.handlePopupMouseover);this.popupRef.value.addEventListener("sl-reposition",this.handlePopupReposition);this.isPopupConnected=true}}}removeListeners(){if(this.isConnected){this.host.removeEventListener("mousemove",this.handleMouseMove);this.host.removeEventListener("mouseover",this.handleMouseOver);this.host.removeEventListener("keydown",this.handleKeyDown);this.host.removeEventListener("click",this.handleClick);this.host.removeEventListener("focusout",this.handleFocusOut);this.isConnected=false}if(this.isPopupConnected){if(this.popupRef.value){this.popupRef.value.removeEventListener("mouseover",this.handlePopupMouseover);this.popupRef.value.removeEventListener("sl-reposition",this.handlePopupReposition);this.isPopupConnected=false}}}handleSubmenuEntry(t){const e=this.host.renderRoot.querySelector("slot[name='submenu']");if(!e){console.error("Cannot activate a submenu if no corresponding menuitem can be found.",this);return}let n=null;for(const t of e.assignedElements()){n=t.querySelectorAll("sl-menu-item, [role^='menuitem']");if(n.length!==0){break}}if(!n||n.length===0){return}n[0].setAttribute("tabindex","0");for(let t=1;t!==n.length;++t){n[t].setAttribute("tabindex","-1")}if(this.popupRef.value){t.preventDefault();t.stopPropagation();if(this.popupRef.value.active){if(n[0]instanceof HTMLElement){n[0].focus()}}else{this.enableSubmenu(false);this.host.updateComplete.then((()=>{if(n[0]instanceof HTMLElement){n[0].focus()}}));this.host.requestUpdate()}}}setSubmenuState(t){if(this.popupRef.value){if(this.popupRef.value.active!==t){this.popupRef.value.active=t;this.host.requestUpdate()}}}enableSubmenu(t=true){if(t){window.clearTimeout(this.enableSubmenuTimer);this.enableSubmenuTimer=window.setTimeout((()=>{this.setSubmenuState(true)}),this.submenuOpenDelay)}else{this.setSubmenuState(true)}}disableSubmenu(){window.clearTimeout(this.enableSubmenuTimer);this.setSubmenuState(false)}updateSkidding(){var t;if(!((t=this.host.parentElement)==null?void 0:t.computedStyleMap)){return}const e=this.host.parentElement.computedStyleMap();const n=["padding-top","border-top-width","margin-top"];const i=n.reduce(((t,n)=>{var i;const s=(i=e.get(n))!=null?i:new CSSUnitValue(0,"px");const r=s instanceof CSSUnitValue?s:new CSSUnitValue(0,"px");const o=r.to("px");return t-o.value}),0);this.skidding=i}isExpanded(){return this.popupRef.value?this.popupRef.value.active:false}renderSubmenu(){const t=getComputedStyle(this.host).direction==="rtl";if(!this.isConnected){return No` <slot name="submenu" hidden></slot> `}return No`
429
+ */const Yh=()=>new qh;class qh{}const Gh=new WeakMap,Zh=mh(class extends Vh{render(t){return ha}update(t,[e]){const n=e!==this.G;return n&&void 0!==this.G&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.G=e,this.ht=t.options?.host,this.rt(this.ct=t.element)),ha}rt(t){if(this.isConnected||(t=void 0),"function"==typeof this.G){const e=this.ht??globalThis;let n=Gh.get(e);void 0===n&&(n=new WeakMap,Gh.set(e,n)),void 0!==n.get(this.G)&&this.G.call(this.ht,void 0),n.set(this.G,t),void 0!==t&&this.G.call(this.ht,t)}else this.G.value=t}get lt(){return"function"==typeof this.G?Gh.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var Qh=class{constructor(t,e){this.popupRef=Yh();this.enableSubmenuTimer=-1;this.isConnected=false;this.isPopupConnected=false;this.skidding=0;this.submenuOpenDelay=100;this.handleMouseMove=t=>{this.host.style.setProperty("--safe-triangle-cursor-x",`${t.clientX}px`);this.host.style.setProperty("--safe-triangle-cursor-y",`${t.clientY}px`)};this.handleMouseOver=()=>{if(this.hasSlotController.test("submenu")){this.enableSubmenu()}};this.handleKeyDown=t=>{switch(t.key){case"Escape":case"Tab":this.disableSubmenu();break;case"ArrowLeft":if(t.target!==this.host){t.preventDefault();t.stopPropagation();this.host.focus();this.disableSubmenu()}break;case"ArrowRight":case"Enter":case" ":this.handleSubmenuEntry(t);break}};this.handleClick=t=>{var e;if(t.target===this.host){t.preventDefault();t.stopPropagation()}else if(t.target instanceof Element&&(t.target.tagName==="sl-menu-item"||((e=t.target.role)==null?void 0:e.startsWith("menuitem")))){this.disableSubmenu()}};this.handleFocusOut=t=>{if(t.relatedTarget&&t.relatedTarget instanceof Element&&this.host.contains(t.relatedTarget)){return}this.disableSubmenu()};this.handlePopupMouseover=t=>{t.stopPropagation()};this.handlePopupReposition=()=>{const t=this.host.renderRoot.querySelector("slot[name='submenu']");const e=t==null?void 0:t.assignedElements({flatten:true}).filter((t=>t.localName==="sl-menu"))[0];const n=getComputedStyle(this.host).direction==="rtl";if(!e){return}const{left:i,top:s,width:r,height:o}=e.getBoundingClientRect();this.host.style.setProperty("--safe-triangle-submenu-start-x",`${n?i+r:i}px`);this.host.style.setProperty("--safe-triangle-submenu-start-y",`${s}px`);this.host.style.setProperty("--safe-triangle-submenu-end-x",`${n?i+r:i}px`);this.host.style.setProperty("--safe-triangle-submenu-end-y",`${s+o}px`)};(this.host=t).addController(this);this.hasSlotController=e}hostConnected(){if(this.hasSlotController.test("submenu")&&!this.host.disabled){this.addListeners()}}hostDisconnected(){this.removeListeners()}hostUpdated(){if(this.hasSlotController.test("submenu")&&!this.host.disabled){this.addListeners();this.updateSkidding()}else{this.removeListeners()}}addListeners(){if(!this.isConnected){this.host.addEventListener("mousemove",this.handleMouseMove);this.host.addEventListener("mouseover",this.handleMouseOver);this.host.addEventListener("keydown",this.handleKeyDown);this.host.addEventListener("click",this.handleClick);this.host.addEventListener("focusout",this.handleFocusOut);this.isConnected=true}if(!this.isPopupConnected){if(this.popupRef.value){this.popupRef.value.addEventListener("mouseover",this.handlePopupMouseover);this.popupRef.value.addEventListener("sl-reposition",this.handlePopupReposition);this.isPopupConnected=true}}}removeListeners(){if(this.isConnected){this.host.removeEventListener("mousemove",this.handleMouseMove);this.host.removeEventListener("mouseover",this.handleMouseOver);this.host.removeEventListener("keydown",this.handleKeyDown);this.host.removeEventListener("click",this.handleClick);this.host.removeEventListener("focusout",this.handleFocusOut);this.isConnected=false}if(this.isPopupConnected){if(this.popupRef.value){this.popupRef.value.removeEventListener("mouseover",this.handlePopupMouseover);this.popupRef.value.removeEventListener("sl-reposition",this.handlePopupReposition);this.isPopupConnected=false}}}handleSubmenuEntry(t){const e=this.host.renderRoot.querySelector("slot[name='submenu']");if(!e){console.error("Cannot activate a submenu if no corresponding menuitem can be found.",this);return}let n=null;for(const t of e.assignedElements()){n=t.querySelectorAll("sl-menu-item, [role^='menuitem']");if(n.length!==0){break}}if(!n||n.length===0){return}n[0].setAttribute("tabindex","0");for(let t=1;t!==n.length;++t){n[t].setAttribute("tabindex","-1")}if(this.popupRef.value){t.preventDefault();t.stopPropagation();if(this.popupRef.value.active){if(n[0]instanceof HTMLElement){n[0].focus()}}else{this.enableSubmenu(false);this.host.updateComplete.then((()=>{if(n[0]instanceof HTMLElement){n[0].focus()}}));this.host.requestUpdate()}}}setSubmenuState(t){if(this.popupRef.value){if(this.popupRef.value.active!==t){this.popupRef.value.active=t;this.host.requestUpdate()}}}enableSubmenu(t=true){if(t){window.clearTimeout(this.enableSubmenuTimer);this.enableSubmenuTimer=window.setTimeout((()=>{this.setSubmenuState(true)}),this.submenuOpenDelay)}else{this.setSubmenuState(true)}}disableSubmenu(){window.clearTimeout(this.enableSubmenuTimer);this.setSubmenuState(false)}updateSkidding(){var t;if(!((t=this.host.parentElement)==null?void 0:t.computedStyleMap)){return}const e=this.host.parentElement.computedStyleMap();const n=["padding-top","border-top-width","margin-top"];const i=n.reduce(((t,n)=>{var i;const s=(i=e.get(n))!=null?i:new CSSUnitValue(0,"px");const r=s instanceof CSSUnitValue?s:new CSSUnitValue(0,"px");const o=r.to("px");return t-o.value}),0);this.skidding=i}isExpanded(){return this.popupRef.value?this.popupRef.value.active:false}renderSubmenu(){const t=getComputedStyle(this.host).direction==="rtl";if(!this.isConnected){return ca` <slot name="submenu" hidden></slot> `}return ca`
430
430
  <sl-popup
431
- ${Gh(this.popupRef)}
431
+ ${Zh(this.popupRef)}
432
432
  placement=${t?"left-start":"right-start"}
433
433
  anchor="anchor"
434
434
  flip
@@ -440,7 +440,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
440
440
  >
441
441
  <slot name="submenu"></slot>
442
442
  </sl-popup>
443
- `}};var Qh=no`
443
+ `}};var td=So`
444
444
  :host {
445
445
  --track-width: 2px;
446
446
  --track-color: rgb(128 128 128 / 25%);
@@ -497,12 +497,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
497
497
  stroke-dasharray: 0.05em, 3em;
498
498
  }
499
499
  }
500
- `;var td=class extends oc{constructor(){super(...arguments);this.localize=new Ga(this)}render(){return No`
500
+ `;var ed=class extends ac{constructor(){super(...arguments);this.localize=new Za(this)}render(){return ca`
501
501
  <svg part="base" class="spinner" role="progressbar" aria-label=${this.localize.term("loading")}>
502
502
  <circle class="spinner__track"></circle>
503
503
  <circle class="spinner__indicator"></circle>
504
504
  </svg>
505
- `}};td.styles=[Za,Qh];var ed=class{constructor(t,...e){this.slotNames=[];this.handleSlotChange=t=>{const e=t.target;if(this.slotNames.includes("[default]")&&!e.name||e.name&&this.slotNames.includes(e.name)){this.host.requestUpdate()}};(this.host=t).addController(this);this.slotNames=e}hasDefaultSlot(){return[...this.host.childNodes].some((t=>{if(t.nodeType===t.TEXT_NODE&&t.textContent.trim()!==""){return true}if(t.nodeType===t.ELEMENT_NODE){const e=t;const n=e.tagName.toLowerCase();if(n==="sl-visually-hidden"){return false}if(!e.hasAttribute("slot")){return true}}return false}))}hasNamedSlot(t){return this.host.querySelector(`:scope > [slot="${t}"]`)!==null}test(t){return t==="[default]"?this.hasDefaultSlot():this.hasNamedSlot(t)}hostConnected(){this.host.shadowRoot.addEventListener("slotchange",this.handleSlotChange)}hostDisconnected(){this.host.shadowRoot.removeEventListener("slotchange",this.handleSlotChange)}};function nd(t){if(!t){return""}const e=t.assignedNodes({flatten:true});let n="";[...e].forEach((t=>{if(t.nodeType===Node.TEXT_NODE){n+=t.textContent}}));return n}var id="";function sd(t){id=t}function rd(t=""){if(!id){const t=[...document.getElementsByTagName("script")];const e=t.find((t=>t.hasAttribute("data-shoelace")));if(e){sd(e.getAttribute("data-shoelace"))}else{const e=t.find((t=>/shoelace(\.min)?\.js($|\?)/.test(t.src)||/shoelace-autoloader(\.min)?\.js($|\?)/.test(t.src)));let n="";if(e){n=e.getAttribute("src")}sd(n.split("/").slice(0,-1).join("/"))}}return id.replace(/\/$/,"")+(t?`/${t.replace(/^\//,"")}`:``)}var od={name:"default",resolver:t=>rd(`assets/icons/${t}.svg`)};var ad=od;var cd={caret:`\n <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <polyline points="6 9 12 15 18 9"></polyline>\n </svg>\n `,check:`\n <svg part="checked-icon" class="checkbox__icon" viewBox="0 0 16 16">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round">\n <g stroke="currentColor">\n <g transform="translate(3.428571, 3.428571)">\n <path d="M0,5.71428571 L3.42857143,9.14285714"></path>\n <path d="M9.14285714,0 L3.42857143,9.14285714"></path>\n </g>\n </g>\n </g>\n </svg>\n `,"chevron-down":`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-down" viewBox="0 0 16 16">\n <path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"/>\n </svg>\n `,"chevron-left":`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-left" viewBox="0 0 16 16">\n <path fill-rule="evenodd" d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z"/>\n </svg>\n `,"chevron-right":`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-right" viewBox="0 0 16 16">\n <path fill-rule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"/>\n </svg>\n `,copy:`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-copy" viewBox="0 0 16 16">\n <path fill-rule="evenodd" d="M4 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V2Zm2-1a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H6ZM2 5a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-1h1v1a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h1v1H2Z"/>\n </svg>\n `,eye:`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye" viewBox="0 0 16 16">\n <path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/>\n <path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/>\n </svg>\n `,"eye-slash":`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye-slash" viewBox="0 0 16 16">\n <path d="M13.359 11.238C15.06 9.72 16 8 16 8s-3-5.5-8-5.5a7.028 7.028 0 0 0-2.79.588l.77.771A5.944 5.944 0 0 1 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.134 13.134 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755-.165.165-.337.328-.517.486l.708.709z"/>\n <path d="M11.297 9.176a3.5 3.5 0 0 0-4.474-4.474l.823.823a2.5 2.5 0 0 1 2.829 2.829l.822.822zm-2.943 1.299.822.822a3.5 3.5 0 0 1-4.474-4.474l.823.823a2.5 2.5 0 0 0 2.829 2.829z"/>\n <path d="M3.35 5.47c-.18.16-.353.322-.518.487A13.134 13.134 0 0 0 1.172 8l.195.288c.335.48.83 1.12 1.465 1.755C4.121 11.332 5.881 12.5 8 12.5c.716 0 1.39-.133 2.02-.36l.77.772A7.029 7.029 0 0 1 8 13.5C3 13.5 0 8 0 8s.939-1.721 2.641-3.238l.708.709zm10.296 8.884-12-12 .708-.708 12 12-.708.708z"/>\n </svg>\n `,eyedropper:`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eyedropper" viewBox="0 0 16 16">\n <path d="M13.354.646a1.207 1.207 0 0 0-1.708 0L8.5 3.793l-.646-.647a.5.5 0 1 0-.708.708L8.293 5l-7.147 7.146A.5.5 0 0 0 1 12.5v1.793l-.854.853a.5.5 0 1 0 .708.707L1.707 15H3.5a.5.5 0 0 0 .354-.146L11 7.707l1.146 1.147a.5.5 0 0 0 .708-.708l-.647-.646 3.147-3.146a1.207 1.207 0 0 0 0-1.708l-2-2zM2 12.707l7-7L10.293 7l-7 7H2v-1.293z"></path>\n </svg>\n `,"grip-vertical":`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-grip-vertical" viewBox="0 0 16 16">\n <path d="M7 2a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zM7 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zM7 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"></path>\n </svg>\n `,indeterminate:`\n <svg part="indeterminate-icon" class="checkbox__icon" viewBox="0 0 16 16">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round">\n <g stroke="currentColor" stroke-width="2">\n <g transform="translate(2.285714, 6.857143)">\n <path d="M10.2857143,1.14285714 L1.14285714,1.14285714"></path>\n </g>\n </g>\n </g>\n </svg>\n `,"person-fill":`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-person-fill" viewBox="0 0 16 16">\n <path d="M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H3zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"/>\n </svg>\n `,"play-fill":`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-play-fill" viewBox="0 0 16 16">\n <path d="m11.596 8.697-6.363 3.692c-.54.313-1.233-.066-1.233-.697V4.308c0-.63.692-1.01 1.233-.696l6.363 3.692a.802.802 0 0 1 0 1.393z"></path>\n </svg>\n `,"pause-fill":`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pause-fill" viewBox="0 0 16 16">\n <path d="M5.5 3.5A1.5 1.5 0 0 1 7 5v6a1.5 1.5 0 0 1-3 0V5a1.5 1.5 0 0 1 1.5-1.5zm5 0A1.5 1.5 0 0 1 12 5v6a1.5 1.5 0 0 1-3 0V5a1.5 1.5 0 0 1 1.5-1.5z"></path>\n </svg>\n `,radio:`\n <svg part="checked-icon" class="radio__icon" viewBox="0 0 16 16">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g fill="currentColor">\n <circle cx="8" cy="8" r="3.42857143"></circle>\n </g>\n </g>\n </svg>\n `,"star-fill":`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-star-fill" viewBox="0 0 16 16">\n <path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"/>\n </svg>\n `,"x-lg":`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-lg" viewBox="0 0 16 16">\n <path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z"/>\n </svg>\n `,"x-circle-fill":`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-circle-fill" viewBox="0 0 16 16">\n <path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293 5.354 4.646z"></path>\n </svg>\n `};var ld={name:"system",resolver:t=>{if(t in cd){return`data:image/svg+xml,${encodeURIComponent(cd[t])}`}return""}};var hd=ld;var dd=[ad,hd];var ud=[];function fd(t){ud.push(t)}function pd(t){ud=ud.filter((e=>e!==t))}function bd(t){return dd.find((e=>e.name===t))}var md=no`
505
+ `}};ed.styles=[Qa,td];var nd=class{constructor(t,...e){this.slotNames=[];this.handleSlotChange=t=>{const e=t.target;if(this.slotNames.includes("[default]")&&!e.name||e.name&&this.slotNames.includes(e.name)){this.host.requestUpdate()}};(this.host=t).addController(this);this.slotNames=e}hasDefaultSlot(){return[...this.host.childNodes].some((t=>{if(t.nodeType===t.TEXT_NODE&&t.textContent.trim()!==""){return true}if(t.nodeType===t.ELEMENT_NODE){const e=t;const n=e.tagName.toLowerCase();if(n==="sl-visually-hidden"){return false}if(!e.hasAttribute("slot")){return true}}return false}))}hasNamedSlot(t){return this.host.querySelector(`:scope > [slot="${t}"]`)!==null}test(t){return t==="[default]"?this.hasDefaultSlot():this.hasNamedSlot(t)}hostConnected(){this.host.shadowRoot.addEventListener("slotchange",this.handleSlotChange)}hostDisconnected(){this.host.shadowRoot.removeEventListener("slotchange",this.handleSlotChange)}};function id(t){if(!t){return""}const e=t.assignedNodes({flatten:true});let n="";[...e].forEach((t=>{if(t.nodeType===Node.TEXT_NODE){n+=t.textContent}}));return n}var sd={name:"default",resolver:t=>K(`assets/icons/${t}.svg`)};var rd=sd;var od={caret:`\n <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <polyline points="6 9 12 15 18 9"></polyline>\n </svg>\n `,check:`\n <svg part="checked-icon" class="checkbox__icon" viewBox="0 0 16 16">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round">\n <g stroke="currentColor">\n <g transform="translate(3.428571, 3.428571)">\n <path d="M0,5.71428571 L3.42857143,9.14285714"></path>\n <path d="M9.14285714,0 L3.42857143,9.14285714"></path>\n </g>\n </g>\n </g>\n </svg>\n `,"chevron-down":`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-down" viewBox="0 0 16 16">\n <path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"/>\n </svg>\n `,"chevron-left":`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-left" viewBox="0 0 16 16">\n <path fill-rule="evenodd" d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z"/>\n </svg>\n `,"chevron-right":`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-right" viewBox="0 0 16 16">\n <path fill-rule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"/>\n </svg>\n `,copy:`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-copy" viewBox="0 0 16 16">\n <path fill-rule="evenodd" d="M4 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V2Zm2-1a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H6ZM2 5a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-1h1v1a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h1v1H2Z"/>\n </svg>\n `,eye:`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye" viewBox="0 0 16 16">\n <path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/>\n <path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/>\n </svg>\n `,"eye-slash":`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye-slash" viewBox="0 0 16 16">\n <path d="M13.359 11.238C15.06 9.72 16 8 16 8s-3-5.5-8-5.5a7.028 7.028 0 0 0-2.79.588l.77.771A5.944 5.944 0 0 1 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.134 13.134 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755-.165.165-.337.328-.517.486l.708.709z"/>\n <path d="M11.297 9.176a3.5 3.5 0 0 0-4.474-4.474l.823.823a2.5 2.5 0 0 1 2.829 2.829l.822.822zm-2.943 1.299.822.822a3.5 3.5 0 0 1-4.474-4.474l.823.823a2.5 2.5 0 0 0 2.829 2.829z"/>\n <path d="M3.35 5.47c-.18.16-.353.322-.518.487A13.134 13.134 0 0 0 1.172 8l.195.288c.335.48.83 1.12 1.465 1.755C4.121 11.332 5.881 12.5 8 12.5c.716 0 1.39-.133 2.02-.36l.77.772A7.029 7.029 0 0 1 8 13.5C3 13.5 0 8 0 8s.939-1.721 2.641-3.238l.708.709zm10.296 8.884-12-12 .708-.708 12 12-.708.708z"/>\n </svg>\n `,eyedropper:`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eyedropper" viewBox="0 0 16 16">\n <path d="M13.354.646a1.207 1.207 0 0 0-1.708 0L8.5 3.793l-.646-.647a.5.5 0 1 0-.708.708L8.293 5l-7.147 7.146A.5.5 0 0 0 1 12.5v1.793l-.854.853a.5.5 0 1 0 .708.707L1.707 15H3.5a.5.5 0 0 0 .354-.146L11 7.707l1.146 1.147a.5.5 0 0 0 .708-.708l-.647-.646 3.147-3.146a1.207 1.207 0 0 0 0-1.708l-2-2zM2 12.707l7-7L10.293 7l-7 7H2v-1.293z"></path>\n </svg>\n `,"grip-vertical":`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-grip-vertical" viewBox="0 0 16 16">\n <path d="M7 2a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zM7 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zM7 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"></path>\n </svg>\n `,indeterminate:`\n <svg part="indeterminate-icon" class="checkbox__icon" viewBox="0 0 16 16">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round">\n <g stroke="currentColor" stroke-width="2">\n <g transform="translate(2.285714, 6.857143)">\n <path d="M10.2857143,1.14285714 L1.14285714,1.14285714"></path>\n </g>\n </g>\n </g>\n </svg>\n `,"person-fill":`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-person-fill" viewBox="0 0 16 16">\n <path d="M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H3zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"/>\n </svg>\n `,"play-fill":`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-play-fill" viewBox="0 0 16 16">\n <path d="m11.596 8.697-6.363 3.692c-.54.313-1.233-.066-1.233-.697V4.308c0-.63.692-1.01 1.233-.696l6.363 3.692a.802.802 0 0 1 0 1.393z"></path>\n </svg>\n `,"pause-fill":`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pause-fill" viewBox="0 0 16 16">\n <path d="M5.5 3.5A1.5 1.5 0 0 1 7 5v6a1.5 1.5 0 0 1-3 0V5a1.5 1.5 0 0 1 1.5-1.5zm5 0A1.5 1.5 0 0 1 12 5v6a1.5 1.5 0 0 1-3 0V5a1.5 1.5 0 0 1 1.5-1.5z"></path>\n </svg>\n `,radio:`\n <svg part="checked-icon" class="radio__icon" viewBox="0 0 16 16">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g fill="currentColor">\n <circle cx="8" cy="8" r="3.42857143"></circle>\n </g>\n </g>\n </svg>\n `,"star-fill":`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-star-fill" viewBox="0 0 16 16">\n <path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"/>\n </svg>\n `,"x-lg":`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-lg" viewBox="0 0 16 16">\n <path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z"/>\n </svg>\n `,"x-circle-fill":`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-circle-fill" viewBox="0 0 16 16">\n <path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293 5.354 4.646z"></path>\n </svg>\n `};var ad={name:"system",resolver:t=>{if(t in od){return`data:image/svg+xml,${encodeURIComponent(od[t])}`}return""}};var cd=ad;var ld=[rd,cd];var hd=[];function dd(t){hd.push(t)}function ud(t){hd=hd.filter((e=>e!==t))}function fd(t){return ld.find((e=>e.name===t))}var pd=So`
506
506
  :host {
507
507
  display: inline-block;
508
508
  width: 1em;
@@ -515,13 +515,13 @@ 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
515
515
  height: 100%;
516
516
  width: 100%;
517
517
  }
518
- `;var gd=Symbol();var wd=Symbol();var vd;var yd=new Map;var kd=class extends oc{constructor(){super(...arguments);this.initialRender=false;this.svg=null;this.label="";this.library="default"}async resolveIcon(t,e){var n;let i;if(e==null?void 0:e.spriteSheet){this.svg=No`<svg part="svg">
518
+ `;var bd=Symbol();var md=Symbol();var gd;var wd=new Map;var vd=class extends ac{constructor(){super(...arguments);this.initialRender=false;this.svg=null;this.label="";this.library="default"}async resolveIcon(t,e){var n;let i;if(e==null?void 0:e.spriteSheet){this.svg=ca`<svg part="svg">
519
519
  <use part="use" href="${t}"></use>
520
- </svg>`;return this.svg}try{i=await fetch(t,{mode:"cors"});if(!i.ok)return i.status===410?gd:wd}catch(t){return wd}try{const t=document.createElement("div");t.innerHTML=await i.text();const e=t.firstElementChild;if(((n=e==null?void 0:e.tagName)==null?void 0:n.toLowerCase())!=="svg")return gd;if(!vd)vd=new DOMParser;const s=vd.parseFromString(e.outerHTML,"text/html");const r=s.body.querySelector("svg");if(!r)return gd;r.part.add("svg");return document.adoptNode(r)}catch(t){return gd}}connectedCallback(){super.connectedCallback();fd(this)}firstUpdated(){this.initialRender=true;this.setIcon()}disconnectedCallback(){super.disconnectedCallback();pd(this)}getIconSource(){const t=bd(this.library);if(this.name&&t){return{url:t.resolver(this.name),fromLibrary:true}}return{url:this.src,fromLibrary:false}}handleLabelChange(){const t=typeof this.label==="string"&&this.label.length>0;if(t){this.setAttribute("role","img");this.setAttribute("aria-label",this.label);this.removeAttribute("aria-hidden")}else{this.removeAttribute("role");this.removeAttribute("aria-label");this.setAttribute("aria-hidden","true")}}async setIcon(){var t;const{url:e,fromLibrary:n}=this.getIconSource();const i=n?bd(this.library):void 0;if(!e){this.svg=null;return}let s=yd.get(e);if(!s){s=this.resolveIcon(e,i);yd.set(e,s)}if(!this.initialRender){return}const r=await s;if(r===wd){yd.delete(e)}if(e!==this.getIconSource().url){return}if(Wh(r)){this.svg=r;if(i){await this.updateComplete;const t=this.shadowRoot.querySelector("[part='svg']");if(typeof i.mutator==="function"&&t){i.mutator(t)}}return}switch(r){case wd:case gd:this.svg=null;this.emit("sl-error");break;default:this.svg=r.cloneNode(true);(t=i==null?void 0:i.mutator)==null?void 0:t.call(i,this.svg);this.emit("sl-load")}}render(){return this.svg}};kd.styles=[Za,md];xa([nc()],kd.prototype,"svg",2);xa([ec({reflect:true})],kd.prototype,"name",2);xa([ec()],kd.prototype,"src",2);xa([ec()],kd.prototype,"label",2);xa([ec({reflect:true})],kd.prototype,"library",2);xa([Rh("label")],kd.prototype,"handleLabelChange",1);xa([Rh(["name","src","library"])],kd.prototype,"setIcon",1);var xd=class extends oc{constructor(){super(...arguments);this.localize=new Ga(this);this.type="normal";this.checked=false;this.value="";this.loading=false;this.disabled=false;this.hasSlotController=new ed(this,"submenu");this.submenuController=new Zh(this,this.hasSlotController);this.handleHostClick=t=>{if(this.disabled){t.preventDefault();t.stopImmediatePropagation()}};this.handleMouseOver=t=>{this.focus();t.stopPropagation()}}connectedCallback(){super.connectedCallback();this.addEventListener("click",this.handleHostClick);this.addEventListener("mouseover",this.handleMouseOver)}disconnectedCallback(){super.disconnectedCallback();this.removeEventListener("click",this.handleHostClick);this.removeEventListener("mouseover",this.handleMouseOver)}handleDefaultSlotChange(){const t=this.getTextLabel();if(typeof this.cachedTextLabel==="undefined"){this.cachedTextLabel=t;return}if(t!==this.cachedTextLabel){this.cachedTextLabel=t;this.emit("slotchange",{bubbles:true,composed:false,cancelable:false})}}handleCheckedChange(){if(this.checked&&this.type!=="checkbox"){this.checked=false;console.error('The checked attribute can only be used on menu items with type="checkbox"',this);return}if(this.type==="checkbox"){this.setAttribute("aria-checked",this.checked?"true":"false")}else{this.removeAttribute("aria-checked")}}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}handleTypeChange(){if(this.type==="checkbox"){this.setAttribute("role","menuitemcheckbox");this.setAttribute("aria-checked",this.checked?"true":"false")}else{this.setAttribute("role","menuitem");this.removeAttribute("aria-checked")}}getTextLabel(){return nd(this.defaultSlot)}isSubmenu(){return this.hasSlotController.test("submenu")}render(){const t=this.localize.dir()==="rtl";const e=this.submenuController.isExpanded();return No`
520
+ </svg>`;return this.svg}try{i=await fetch(t,{mode:"cors"});if(!i.ok)return i.status===410?bd:md}catch(t){return md}try{const t=document.createElement("div");t.innerHTML=await i.text();const e=t.firstElementChild;if(((n=e==null?void 0:e.tagName)==null?void 0:n.toLowerCase())!=="svg")return bd;if(!gd)gd=new DOMParser;const s=gd.parseFromString(e.outerHTML,"text/html");const r=s.body.querySelector("svg");if(!r)return bd;r.part.add("svg");return document.adoptNode(r)}catch(t){return bd}}connectedCallback(){super.connectedCallback();dd(this)}firstUpdated(){this.initialRender=true;this.setIcon()}disconnectedCallback(){super.disconnectedCallback();ud(this)}getIconSource(){const t=fd(this.library);if(this.name&&t){return{url:t.resolver(this.name),fromLibrary:true}}return{url:this.src,fromLibrary:false}}handleLabelChange(){const t=typeof this.label==="string"&&this.label.length>0;if(t){this.setAttribute("role","img");this.setAttribute("aria-label",this.label);this.removeAttribute("aria-hidden")}else{this.removeAttribute("role");this.removeAttribute("aria-label");this.setAttribute("aria-hidden","true")}}async setIcon(){var t;const{url:e,fromLibrary:n}=this.getIconSource();const i=n?fd(this.library):void 0;if(!e){this.svg=null;return}let s=wd.get(e);if(!s){s=this.resolveIcon(e,i);wd.set(e,s)}if(!this.initialRender){return}const r=await s;if(r===md){wd.delete(e)}if(e!==this.getIconSource().url){return}if(Uh(r)){this.svg=r;if(i){await this.updateComplete;const t=this.shadowRoot.querySelector("[part='svg']");if(typeof i.mutator==="function"&&t){i.mutator(t)}}return}switch(r){case md:case bd:this.svg=null;this.emit("sl-error");break;default:this.svg=r.cloneNode(true);(t=i==null?void 0:i.mutator)==null?void 0:t.call(i,this.svg);this.emit("sl-load")}}render(){return this.svg}};vd.styles=[Qa,pd];st([ic()],vd.prototype,"svg",2);st([nc({reflect:true})],vd.prototype,"name",2);st([nc()],vd.prototype,"src",2);st([nc()],vd.prototype,"label",2);st([nc({reflect:true})],vd.prototype,"library",2);st([Oh("label")],vd.prototype,"handleLabelChange",1);st([Oh(["name","src","library"])],vd.prototype,"setIcon",1);var yd=class extends ac{constructor(){super(...arguments);this.localize=new Za(this);this.type="normal";this.checked=false;this.value="";this.loading=false;this.disabled=false;this.hasSlotController=new nd(this,"submenu");this.submenuController=new Qh(this,this.hasSlotController);this.handleHostClick=t=>{if(this.disabled){t.preventDefault();t.stopImmediatePropagation()}};this.handleMouseOver=t=>{this.focus();t.stopPropagation()}}connectedCallback(){super.connectedCallback();this.addEventListener("click",this.handleHostClick);this.addEventListener("mouseover",this.handleMouseOver)}disconnectedCallback(){super.disconnectedCallback();this.removeEventListener("click",this.handleHostClick);this.removeEventListener("mouseover",this.handleMouseOver)}handleDefaultSlotChange(){const t=this.getTextLabel();if(typeof this.cachedTextLabel==="undefined"){this.cachedTextLabel=t;return}if(t!==this.cachedTextLabel){this.cachedTextLabel=t;this.emit("slotchange",{bubbles:true,composed:false,cancelable:false})}}handleCheckedChange(){if(this.checked&&this.type!=="checkbox"){this.checked=false;console.error('The checked attribute can only be used on menu items with type="checkbox"',this);return}if(this.type==="checkbox"){this.setAttribute("aria-checked",this.checked?"true":"false")}else{this.removeAttribute("aria-checked")}}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}handleTypeChange(){if(this.type==="checkbox"){this.setAttribute("role","menuitemcheckbox");this.setAttribute("aria-checked",this.checked?"true":"false")}else{this.setAttribute("role","menuitem");this.removeAttribute("aria-checked")}}getTextLabel(){return id(this.defaultSlot)}isSubmenu(){return this.hasSlotController.test("submenu")}render(){const t=this.localize.dir()==="rtl";const e=this.submenuController.isExpanded();return ca`
521
521
  <div
522
522
  id="anchor"
523
523
  part="base"
524
- class=${gh({"menu-item":true,"menu-item--rtl":t,"menu-item--checked":this.checked,"menu-item--disabled":this.disabled,"menu-item--loading":this.loading,"menu-item--has-submenu":this.isSubmenu(),"menu-item--submenu-expanded":e})}
524
+ class=${wh({"menu-item":true,"menu-item--rtl":t,"menu-item--checked":this.checked,"menu-item--disabled":this.disabled,"menu-item--loading":this.loading,"menu-item--has-submenu":this.isSubmenu(),"menu-item--submenu-expanded":e})}
525
525
  ?aria-haspopup="${this.isSubmenu()}"
526
526
  ?aria-expanded="${e?true:false}"
527
527
  >
@@ -540,9 +540,9 @@ 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
540
540
  </span>
541
541
 
542
542
  ${this.submenuController.renderSubmenu()}
543
- ${this.loading?No` <sl-spinner part="spinner" exportparts="base:spinner__base"></sl-spinner> `:""}
543
+ ${this.loading?ca` <sl-spinner part="spinner" exportparts="base:spinner__base"></sl-spinner> `:""}
544
544
  </div>
545
- `}};xd.styles=[Za,Mh];xd.dependencies={"sl-icon":kd,"sl-popup":xh,"sl-spinner":td};xa([sc("slot:not([name])")],xd.prototype,"defaultSlot",2);xa([sc(".menu-item")],xd.prototype,"menuItem",2);xa([ec()],xd.prototype,"type",2);xa([ec({type:Boolean,reflect:true})],xd.prototype,"checked",2);xa([ec()],xd.prototype,"value",2);xa([ec({type:Boolean,reflect:true})],xd.prototype,"loading",2);xa([ec({type:Boolean,reflect:true})],xd.prototype,"disabled",2);xa([Rh("checked")],xd.prototype,"handleCheckedChange",1);xa([Rh("disabled")],xd.prototype,"handleDisabledChange",1);xa([Rh("type")],xd.prototype,"handleTypeChange",1);xd.define("sl-menu-item");const Sd="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 _d=Sd;const Ed=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(Cd,null):n(Ad,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 Ad=()=>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 Cd=()=>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"}));Ed.style=_d;const Td=":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 $d=Td;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 gn;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(qn(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=$d;const Pd="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 Id=Pd;const Rd=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"}))}};Rd.style=Id;const Od=":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 Dd=Od;const jd=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"]}}};jd.style=Dd;const Ld=":host{--width:300px;--height:300px;--border-radius:var(--border-radius, 0);--object-fit:var(--object-fit, cover)}";const Md=Ld;const Wd=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()})}};Wd.style=Md;const Ud="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 Hd=Ud;const Nd=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"]}}};Nd.style=Hd;const Jd=":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 Bd=Jd;const Kd=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)}};Kd.style=Bd;const Fd=(t,e,n)=>{const i=t.get(e);if(!i){t.set(e,[n])}else if(!i.includes(n)){i.push(n)}};const Xd=(t,e)=>{let n;return(...i)=>{if(n){clearTimeout(n)}n=setTimeout((()=>{n=0;t(...i)}),e)}};const Vd=t=>!("isConnected"in t)||t.isConnected;const Yd=Xd((t=>{for(let e of t.keys()){t.set(e,t.get(e).filter(Vd))}}),2e3);const qd=()=>{if(typeof c!=="function"){return{}}const t=new Map;return{dispose:()=>t.clear(),get:e=>{const n=c();if(n){Fd(t,e,n)}},set:e=>{const n=t.get(e);if(n){t.set(e,n.filter(l))}Yd(t)},reset:()=>{t.forEach((t=>t.forEach(l)));Yd(t)}}};const Gd=(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()=>{Zd(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 Zd=(t,e)=>{const n=t.indexOf(e);if(n>=0){t[n]=t[t.length-1];t.length--}};const Qd=(t,e)=>{const n=Gd(t,e);n.use(qd());return n};const tu=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:nu;const{state:r,onChange:o,dispose:a}=Qd({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=eu(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 eu=(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 nu=t=>t.pathname.toLowerCase();const iu=".toolbar{display:flex;flex-direction:row;gap:0;align-items:center;margin-left:0.5rem}pos-navigation{flex-grow:1}";const su=iu;const ru=tu();const ou=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){ru.push(t.detail.url)}componentWillLoad(){this.updateUri();ru.onChange("url",(()=>{this.updateUri()}))}navigate(t){ru.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"})}};ou.style=su;const au=":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 cu=au;const lu=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"]}}};lu.style=cu;const hu=":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 du=hu;const uu=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:Gt.state.offlineCache,onChange:t=>Gt.state.offlineCache=t.target.checked}),"Enable offline cache")))}};uu.style=du;var fu;(function(t){t["Generic"]="pos-app-generic";t["RdfDocument"]="pos-app-rdf-document";t["DocumentViewer"]="pos-app-document-viewer";t["ImageViewer"]="pos-app-image-viewer";t["LdpContainer"]="pos-app-ldp-container"})(fu||(fu={}));function pu(t,e){return t.some((t=>t.uri===e))}function bu(t){if(pu(t,"http://www.w3.org/ns/ldp#Container")){return fu.LdpContainer}else if(pu(t,"http://www.w3.org/2007/ont/link#RDFDocument")){return fu.RdfDocument}else if(pu(t,"http://www.w3.org/ns/iana/media-types/application/pdf#Resource")){return fu.DocumentViewer}else if(pu(t,"http://purl.org/dc/terms/Image")){return fu.ImageViewer}else if(pu(t,"http://www.w3.org/2007/ont/link#Document")){return fu.DocumentViewer}else{return fu.Generic}}const mu=class{constructor(t){e(this,t);this.subscribeResource=a(this,"pod-os:resource",7);this.receiveResource=t=>{this.types=t.types()}}componentWillLoad(){J(this)}render(){return this.types?this.renderApp():null}renderApp(){const t=bu(this.types);return n(t,null)}};var gu=no`
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 $d="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 zd=$d;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=zd;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-14);\n display: block;\n /* TODO sticky does not work yet */\n position: sticky;\n top: 0;\n overflow: auto;\n min-width: var(--button-size);\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 .text {\n font-size: var(--size-3);\n white-space: nowrap;\n text-overflow: ellipsis;\n width: 100%;\n overflow: hidden;\n }\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}\n\n@media (max-width: 640px) {\n :host {\n position: absolute;\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}\n";const uu=du;const fu=class{constructor(t){e(this,t);this.tools=[]}render(){console.log("toos",this.tools);if(this.tools.length>1){return n("aside",null,this.tools.map((t=>n("button",null,n("sl-icon",{name:"list-ul"}),n("span",{class:"text"},t.label)))))}return null}};fu.style=uu;const pu={Generic:{element:"pos-app-generic",label:"Generic"},RdfDocument:{element:"pos-app-rdf-document",label:"RDF Document"},DocumentViewer:{element:"pos-app-document-viewer",label:"Document"},ImageViewer:{element:"pos-app-image-viewer",label:"Image"},LdpContainer:{element:"pos-app-ldp-container",label:"Container"}};function bu(t,e){return t.some((t=>t.uri===e))}function mu(t){if(bu(t,"http://www.w3.org/ns/ldp#Container")){return[pu.LdpContainer]}else if(bu(t,"http://www.w3.org/2007/ont/link#RDFDocument")){return[pu.RdfDocument]}else if(bu(t,"http://www.w3.org/ns/iana/media-types/application/pdf#Resource")){return[pu.DocumentViewer]}else if(bu(t,"http://purl.org/dc/terms/Image")){return[pu.ImageViewer]}else if(bu(t,"http://www.w3.org/2007/ont/link#Document")){return[pu.DocumentViewer]}else{return[pu.Generic]}}const gu="section{display:flex;flex-direction:row}section>:last-child{flex-grow:1}@media (max-width: 640px){section{flex-direction:column-reverse}}";const wu=gu;const vu=class{constructor(t){e(this,t);this.subscribeResource=a(this,"pod-os:resource",7);this.receiveResource=t=>{this.types=t.types()}}componentWillLoad(){J(this)}render(){return this.types?this.renderApp():null}renderApp(){const t=mu(this.types);const e=t[0].element;return n("section",null,n("pos-tool-select",{tools:t}),n(e,null))}};vu.style=wu;var yu=So`
546
546
  :host {
547
547
  display: inline-block;
548
548
 
@@ -605,7 +605,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
605
605
  object-fit: cover;
606
606
  overflow: hidden;
607
607
  }
608
- `;var wu=class extends oc{constructor(){super(...arguments);this.hasError=false;this.image="";this.label="";this.initials="";this.loading="eager";this.shape="circle"}handleImageChange(){this.hasError=false}handleImageLoadError(){this.hasError=true;this.emit("sl-error")}render(){const t=No`
608
+ `;var ku=class extends ac{constructor(){super(...arguments);this.hasError=false;this.image="";this.label="";this.initials="";this.loading="eager";this.shape="circle"}handleImageChange(){this.hasError=false}handleImageLoadError(){this.hasError=true;this.emit("sl-error")}render(){const t=ca`
609
609
  <img
610
610
  part="image"
611
611
  class="avatar__image"
@@ -614,22 +614,22 @@ 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
614
614
  alt=""
615
615
  @error="${this.handleImageLoadError}"
616
616
  />
617
- `;let e=No``;if(this.initials){e=No`<div part="initials" class="avatar__initials">${this.initials}</div>`}else{e=No`
617
+ `;let e=ca``;if(this.initials){e=ca`<div part="initials" class="avatar__initials">${this.initials}</div>`}else{e=ca`
618
618
  <div part="icon" class="avatar__icon" aria-hidden="true">
619
619
  <slot name="icon">
620
620
  <sl-icon name="person-fill" library="system"></sl-icon>
621
621
  </slot>
622
622
  </div>
623
- `}return No`
623
+ `}return ca`
624
624
  <div
625
625
  part="base"
626
- class=${gh({avatar:true,"avatar--circle":this.shape==="circle","avatar--rounded":this.shape==="rounded","avatar--square":this.shape==="square"})}
626
+ class=${wh({avatar:true,"avatar--circle":this.shape==="circle","avatar--rounded":this.shape==="rounded","avatar--square":this.shape==="square"})}
627
627
  role="img"
628
628
  aria-label=${this.label}
629
629
  >
630
630
  ${this.image&&!this.hasError?t:e}
631
631
  </div>
632
- `}};wu.styles=[Za,gu];wu.dependencies={"sl-icon":kd};xa([nc()],wu.prototype,"hasError",2);xa([ec()],wu.prototype,"image",2);xa([ec()],wu.prototype,"label",2);xa([ec()],wu.prototype,"initials",2);xa([ec()],wu.prototype,"loading",2);xa([ec({reflect:true})],wu.prototype,"shape",2);xa([Rh("image")],wu.prototype,"handleImageChange",1);wu.define("sl-avatar");var vu=no`
632
+ `}};ku.styles=[Qa,yu];ku.dependencies={"sl-icon":vd};st([ic()],ku.prototype,"hasError",2);st([nc()],ku.prototype,"image",2);st([nc()],ku.prototype,"label",2);st([nc()],ku.prototype,"initials",2);st([nc()],ku.prototype,"loading",2);st([nc({reflect:true})],ku.prototype,"shape",2);st([Oh("image")],ku.prototype,"handleImageChange",1);ku.define("sl-avatar");var xu=So`
633
633
  :host {
634
634
  --color: var(--sl-panel-border-color);
635
635
  --width: var(--sl-panel-border-width);
@@ -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 yu=class extends oc{constructor(){super(...arguments);this.vertical=false}connectedCallback(){super.connectedCallback();this.setAttribute("role","separator")}handleVerticalChange(){this.setAttribute("aria-orientation",this.vertical?"vertical":"horizontal")}};yu.styles=[Za,vu];xa([ec({type:Boolean,reflect:true})],yu.prototype,"vertical",2);xa([Rh("vertical")],yu.prototype,"handleVerticalChange",1);yu.define("sl-divider");const ku="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 xu=ku;const Su=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"))))}};Su.style=xu;export{ut as ion_icon,vt as ion_progress_bar,_t as ion_ripple_effect,zt as ion_skeleton_text,Jt as ion_toast,Vt as pos_add_new_thing,gr as pos_app,yr as pos_app_browser,_r as pos_app_dashboard,Cr as pos_app_settings,Tr as pos_description,Pr as pos_dialog,Ir as pos_error_toast,Dr as pos_example_resources,Mr as pos_getting_started,Hr as pos_image,Nr as pos_internal_router,Jr as pos_label,Fr as pos_login,Yr as pos_login_form,Ed as pos_make_findable,zd as pos_navigation,Rd as pos_navigation_bar,jd as pos_new_thing_form,Wd as pos_picture,Nd as pos_resource,Kd as pos_rich_link,ou as pos_router,lu as pos_select_term,uu as pos_setting_offline_cache,mu as pos_type_router,Su as pos_user_menu};
652
- //# sourceMappingURL=p-d303d82c.entry.js.map
651
+ `;var Su=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")}};Su.styles=[Qa,xu];st([nc({type:Boolean,reflect:true})],Su.prototype,"vertical",2);st([Oh("vertical")],Su.prototype,"handleVerticalChange",1);Su.define("sl-divider");const _u="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 Eu=_u;const Au=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"))))}};Au.style=Eu;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,Td 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,vu as pos_type_router,Au as pos_user_menu};
652
+ //# sourceMappingURL=p-20c36eb6.entry.js.map