UNPKG

@beamimpact/web-sdk

Version:

The Beam SDK enables brands to connect with their customers over shared values, not transactional discounts, to build stronger loyalty. Our integration achieves this by allowing customers to (a) choose a nonprofit where the brand will donate part of their

367 lines (331 loc) 94.7 kB
import{i as U,n as u,s as Xe,r as Lt,x as Y,e as Ye,a as ot,b as I,c as zt,o as E,d as Ot}from"./lit-WqMxC_PA.esm.js";var qt="";function Kt(t){qt=t}function Ze(t=""){if(!qt){const e=[...document.getElementsByTagName("script")],o=e.find(r=>r.hasAttribute("data-shoelace"));if(o)Kt(o.getAttribute("data-shoelace"));else{const r=e.find(n=>/shoelace(\.min)?\.js($|\?)/.test(n.src)||/shoelace-autoloader(\.min)?\.js($|\?)/.test(n.src));let i="";r&&(i=r.getAttribute("src")),Kt(i.split("/").slice(0,-1).join("/"))}}return qt.replace(/\/$/,"")+(t?`/${t.replace(/^\//,"")}`:"")}var he=Object.defineProperty,Ge=Object.defineProperties,Je=Object.getOwnPropertyDescriptor,Qe=Object.getOwnPropertyDescriptors,pe=Object.getOwnPropertySymbols,to=Object.prototype.hasOwnProperty,eo=Object.prototype.propertyIsEnumerable,Xt=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),fe=(t,e,o)=>e in t?he(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,rt=(t,e)=>{for(var o in e||(e={}))to.call(e,o)&&fe(t,o,e[o]);if(pe)for(var o of pe(e))eo.call(e,o)&&fe(t,o,e[o]);return t},$t=(t,e)=>Ge(t,Qe(e)),c=(t,e,o,r)=>{for(var i=r>1?void 0:r?Je(e,o):e,n=t.length-1,s;n>=0;n--)(s=t[n])&&(i=(r?s(e,o,i):s(i))||i);return r&&i&&he(e,o,i),i},oo=function(t,e){this[0]=t,this[1]=e},ro=t=>{var e=t[Xt("asyncIterator")],o=!1,r,i={};return e==null?(e=t[Xt("iterator")](),r=n=>i[n]=s=>e[n](s)):(e=e.call(t),r=n=>i[n]=s=>{if(o){if(o=!1,n==="throw")throw s;return s}return o=!0,{done:!1,value:new oo(new Promise(a=>{var l=e[n](s);if(!(l instanceof Object))throw TypeError("Object expected");a(l)}),1)}}),i[Xt("iterator")]=()=>i,r("next"),"throw"in e?r("throw"):i.throw=n=>{throw n},"return"in e&&r("return"),i},io={name:"default",resolver:t=>Ze(`assets/icons/${t}.svg`)},no=io,be={caret:` <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <polyline points="6 9 12 15 18 9"></polyline> </svg> `,check:` <svg part="checked-icon" class="checkbox__icon" viewBox="0 0 16 16"> <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round"> <g stroke="currentColor"> <g transform="translate(3.428571, 3.428571)"> <path d="M0,5.71428571 L3.42857143,9.14285714"></path> <path d="M9.14285714,0 L3.42857143,9.14285714"></path> </g> </g> </g> </svg> `,"chevron-down":` <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-down" viewBox="0 0 16 16"> <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"/> </svg> `,"chevron-left":` <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-left" viewBox="0 0 16 16"> <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"/> </svg> `,"chevron-right":` <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-right" viewBox="0 0 16 16"> <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"/> </svg> `,copy:` <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-copy" viewBox="0 0 16 16"> <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"/> </svg> `,eye:` <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye" viewBox="0 0 16 16"> <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"/> <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"/> </svg> `,"eye-slash":` <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye-slash" viewBox="0 0 16 16"> <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"/> <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"/> <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"/> </svg> `,eyedropper:` <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eyedropper" viewBox="0 0 16 16"> <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> </svg> `,"grip-vertical":` <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-grip-vertical" viewBox="0 0 16 16"> <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> </svg> `,indeterminate:` <svg part="indeterminate-icon" class="checkbox__icon" viewBox="0 0 16 16"> <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round"> <g stroke="currentColor" stroke-width="2"> <g transform="translate(2.285714, 6.857143)"> <path d="M10.2857143,1.14285714 L1.14285714,1.14285714"></path> </g> </g> </g> </svg> `,"person-fill":` <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-person-fill" viewBox="0 0 16 16"> <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"/> </svg> `,"play-fill":` <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-play-fill" viewBox="0 0 16 16"> <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> </svg> `,"pause-fill":` <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pause-fill" viewBox="0 0 16 16"> <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> </svg> `,radio:` <svg part="checked-icon" class="radio__icon" viewBox="0 0 16 16"> <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> <g fill="currentColor"> <circle cx="8" cy="8" r="3.42857143"></circle> </g> </g> </svg> `,"star-fill":` <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-star-fill" viewBox="0 0 16 16"> <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"/> </svg> `,"x-lg":` <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-lg" viewBox="0 0 16 16"> <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"/> </svg> `,"x-circle-fill":` <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"> <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> </svg> `},so={name:"system",resolver:t=>t in be?`data:image/svg+xml,${encodeURIComponent(be[t])}`:""},ao=so,Pt=[no,ao],Ft=[];function lo(t){Ft.push(t)}function co(t){Ft=Ft.filter(e=>e!==t)}function ge(t){return Pt.find(e=>e.name===t)}function uo(t,e){ho(t),Pt.push({name:t,resolver:e.resolver,mutator:e.mutator,spriteSheet:e.spriteSheet}),Ft.forEach(o=>{o.library===t&&o.setIcon()})}function ho(t){Pt=Pt.filter(e=>e.name!==t)}var po=U` :host { display: inline-block; width: 1em; height: 1em; box-sizing: content-box !important; } svg { display: block; height: 100%; width: 100%; } `;function it(t,e){const o=rt({waitUntilFirstUpdate:!1},e);return(r,i)=>{const{update:n}=r,s=Array.isArray(t)?t:[t];r.update=function(a){s.forEach(l=>{const d=l;if(a.has(d)){const p=a.get(d),b=this[d];p!==b&&(!o.waitUntilFirstUpdate||this.hasUpdated)&&this[i](p,b)}}),n.call(this,a)}}}var Z=U` :host { box-sizing: border-box; } :host *, :host *::before, :host *::after { box-sizing: inherit; } [hidden] { display: none !important; } `,B=class extends Xe{constructor(){super(),Object.entries(this.constructor.dependencies).forEach(([t,e])=>{this.constructor.define(t,e)})}emit(t,e){const o=new CustomEvent(t,rt({bubbles:!0,cancelable:!1,composed:!0,detail:{}},e));return this.dispatchEvent(o),o}static define(t,e=this,o={}){const r=customElements.get(t);if(!r){customElements.define(t,class extends e{},o);return}let i=" (unknown version)",n=i;"version"in e&&e.version&&(i=" v"+e.version),"version"in r&&r.version&&(n=" v"+r.version),!(i&&n&&i===n)&&console.warn(`Attempted to register <${t}>${i}, but <${t}>${n} has already been registered.`)}};B.version="2.15.0",B.dependencies={},c([u()],B.prototype,"dir",2),c([u()],B.prototype,"lang",2);var yt=Symbol(),Rt=Symbol(),Yt,Zt=new Map,D=class extends B{constructor(){super(...arguments),this.initialRender=!1,this.svg=null,this.label="",this.library="default"}async resolveIcon(t,e){var o;let r;if(e?.spriteSheet){this.svg=Y`<svg part="svg"> <use part="use" href="${t}"></use> </svg>`,await this.updateComplete;const i=this.shadowRoot.querySelector("[part='svg']");return typeof e.mutator=="function"&&e.mutator(i),this.svg}try{if(r=await fetch(t,{mode:"cors"}),!r.ok)return r.status===410?yt:Rt}catch{return Rt}try{const i=document.createElement("div");i.innerHTML=await r.text();const n=i.firstElementChild;if(((o=n?.tagName)==null?void 0:o.toLowerCase())!=="svg")return yt;Yt||(Yt=new DOMParser);const a=Yt.parseFromString(n.outerHTML,"text/html").body.querySelector("svg");return a?(a.part.add("svg"),document.adoptNode(a)):yt}catch{return yt}}connectedCallback(){super.connectedCallback(),lo(this)}firstUpdated(){this.initialRender=!0,this.setIcon()}disconnectedCallback(){super.disconnectedCallback(),co(this)}getIconSource(){const t=ge(this.library);return this.name&&t?{url:t.resolver(this.name),fromLibrary:!0}:{url:this.src,fromLibrary:!1}}handleLabelChange(){typeof this.label=="string"&&this.label.length>0?(this.setAttribute("role","img"),this.setAttribute("aria-label",this.label),this.removeAttribute("aria-hidden")):(this.removeAttribute("role"),this.removeAttribute("aria-label"),this.setAttribute("aria-hidden","true"))}async setIcon(){var t;const{url:e,fromLibrary:o}=this.getIconSource(),r=o?ge(this.library):void 0;if(!e){this.svg=null;return}let i=Zt.get(e);if(i||(i=this.resolveIcon(e,r),Zt.set(e,i)),!this.initialRender)return;const n=await i;if(n===Rt&&Zt.delete(e),e===this.getIconSource().url){if(Ye(n)){this.svg=n;return}switch(n){case Rt:case yt:this.svg=null,this.emit("sl-error");break;default:this.svg=n.cloneNode(!0),(t=r?.mutator)==null||t.call(r,this.svg),this.emit("sl-load")}}}render(){return this.svg}};D.styles=[Z,po],c([Lt()],D.prototype,"svg",2),c([u({reflect:!0})],D.prototype,"name",2),c([u()],D.prototype,"src",2),c([u()],D.prototype,"label",2),c([u({reflect:!0})],D.prototype,"library",2),c([it("label")],D.prototype,"handleLabelChange",1),c([it(["name","src","library"])],D.prototype,"setIcon",1),D.define("sl-icon");var fo=U` :host { display: inline-flex; } .badge { display: inline-flex; align-items: center; justify-content: center; font-size: max(12px, 0.75em); font-weight: var(--sl-font-weight-semibold); letter-spacing: var(--sl-letter-spacing-normal); line-height: 1; border-radius: var(--sl-border-radius-small); border: solid 1px var(--sl-color-neutral-0); white-space: nowrap; padding: 0.35em 0.6em; user-select: none; -webkit-user-select: none; cursor: inherit; } /* Variant modifiers */ .badge--primary { background-color: var(--sl-color-primary-600); color: var(--sl-color-neutral-0); } .badge--success { background-color: var(--sl-color-success-600); color: var(--sl-color-neutral-0); } .badge--neutral { background-color: var(--sl-color-neutral-600); color: var(--sl-color-neutral-0); } .badge--warning { background-color: var(--sl-color-warning-600); color: var(--sl-color-neutral-0); } .badge--danger { background-color: var(--sl-color-danger-600); color: var(--sl-color-neutral-0); } /* Pill modifier */ .badge--pill { border-radius: var(--sl-border-radius-pill); } /* Pulse modifier */ .badge--pulse { animation: pulse 1.5s infinite; } .badge--pulse.badge--primary { --pulse-color: var(--sl-color-primary-600); } .badge--pulse.badge--success { --pulse-color: var(--sl-color-success-600); } .badge--pulse.badge--neutral { --pulse-color: var(--sl-color-neutral-600); } .badge--pulse.badge--warning { --pulse-color: var(--sl-color-warning-600); } .badge--pulse.badge--danger { --pulse-color: var(--sl-color-danger-600); } @keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--pulse-color); } 70% { box-shadow: 0 0 0 0.5rem transparent; } 100% { box-shadow: 0 0 0 0 transparent; } } `,wt=class extends B{constructor(){super(...arguments),this.variant="primary",this.pill=!1,this.pulse=!1}render(){return Y` <span part="base" class=${ot({badge:!0,"badge--primary":this.variant==="primary","badge--success":this.variant==="success","badge--neutral":this.variant==="neutral","badge--warning":this.variant==="warning","badge--danger":this.variant==="danger","badge--pill":this.pill,"badge--pulse":this.pulse})} role="status" > <slot></slot> </span> `}};wt.styles=[Z,fo],c([u({reflect:!0})],wt.prototype,"variant",2),c([u({type:Boolean,reflect:!0})],wt.prototype,"pill",2),c([u({type:Boolean,reflect:!0})],wt.prototype,"pulse",2),wt.define("sl-badge");var bo=U` :host { --max-width: 20rem; --hide-delay: 0ms; --show-delay: 150ms; display: contents; } .tooltip { --arrow-size: var(--sl-tooltip-arrow-size); --arrow-color: var(--sl-tooltip-background-color); } .tooltip::part(popup) { z-index: var(--sl-z-index-tooltip); } .tooltip[placement^='top']::part(popup) { transform-origin: bottom; } .tooltip[placement^='bottom']::part(popup) { transform-origin: top; } .tooltip[placement^='left']::part(popup) { transform-origin: right; } .tooltip[placement^='right']::part(popup) { transform-origin: left; } .tooltip__body { display: block; width: max-content; max-width: var(--max-width); border-radius: var(--sl-tooltip-border-radius); background-color: var(--sl-tooltip-background-color); font-family: var(--sl-tooltip-font-family); font-size: var(--sl-tooltip-font-size); font-weight: var(--sl-tooltip-font-weight); line-height: var(--sl-tooltip-line-height); color: var(--sl-tooltip-color); padding: var(--sl-tooltip-padding); pointer-events: none; user-select: none; -webkit-user-select: none; } `,go=U` :host { --arrow-color: var(--sl-color-neutral-1000); --arrow-size: 6px; /* * These properties are computed to account for the arrow's dimensions after being rotated 45º. The constant * 0.7071 is derived from sin(45), which is the diagonal size of the arrow's container after rotating. */ --arrow-size-diagonal: calc(var(--arrow-size) * 0.7071); --arrow-padding-offset: calc(var(--arrow-size-diagonal) - var(--arrow-size)); display: contents; } .popup { position: absolute; isolation: isolate; max-width: var(--auto-size-available-width, none); max-height: var(--auto-size-available-height, none); } .popup--fixed { position: fixed; } .popup:not(.popup--active) { display: none; } .popup__arrow { position: absolute; width: calc(var(--arrow-size-diagonal) * 2); height: calc(var(--arrow-size-diagonal) * 2); rotate: 45deg; background: var(--arrow-color); z-index: -1; } /* Hover bridge */ .popup-hover-bridge:not(.popup-hover-bridge--visible) { display: none; } .popup-hover-bridge { position: fixed; z-index: calc(var(--sl-z-index-dropdown) - 1); top: 0; right: 0; bottom: 0; left: 0; clip-path: polygon( var(--hover-bridge-top-left-x, 0) var(--hover-bridge-top-left-y, 0), var(--hover-bridge-top-right-x, 0) var(--hover-bridge-top-right-y, 0), var(--hover-bridge-bottom-right-x, 0) var(--hover-bridge-bottom-right-y, 0), var(--hover-bridge-bottom-left-x, 0) var(--hover-bridge-bottom-left-y, 0) ); } `;const G=Math.min,P=Math.max,Bt=Math.round,Tt=Math.floor,J=t=>({x:t,y:t}),mo={left:"right",right:"left",bottom:"top",top:"bottom"},vo={start:"end",end:"start"};function Gt(t,e,o){return P(t,G(e,o))}function dt(t,e){return typeof t=="function"?t(e):t}function Q(t){return t.split("-")[0]}function ut(t){return t.split("-")[1]}function me(t){return t==="x"?"y":"x"}function Jt(t){return t==="y"?"height":"width"}function xt(t){return["top","bottom"].includes(Q(t))?"y":"x"}function Qt(t){return me(xt(t))}function yo(t,e,o){o===void 0&&(o=!1);const r=ut(t),i=Qt(t),n=Jt(i);let s=i==="x"?r===(o?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[n]>e.floating[n]&&(s=Dt(s)),[s,Dt(s)]}function wo(t){const e=Dt(t);return[te(t),e,te(e)]}function te(t){return t.replace(/start|end/g,e=>vo[e])}function xo(t,e,o){const r=["left","right"],i=["right","left"],n=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return o?e?i:r:e?r:i;case"left":case"right":return e?n:s;default:return[]}}function ko(t,e,o,r){const i=ut(t);let n=xo(Q(t),o==="start",r);return i&&(n=n.map(s=>s+"-"+i),e&&(n=n.concat(n.map(te)))),n}function Dt(t){return t.replace(/left|right|bottom|top/g,e=>mo[e])}function _o(t){return{top:0,right:0,bottom:0,left:0,...t}}function ve(t){return typeof t!="number"?_o(t):{top:t,right:t,bottom:t,left:t}}function Vt(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function ye(t,e,o){let{reference:r,floating:i}=t;const n=xt(e),s=Qt(e),a=Jt(s),l=Q(e),d=n==="y",p=r.x+r.width/2-i.width/2,b=r.y+r.height/2-i.height/2,g=r[a]/2-i[a]/2;let h;switch(l){case"top":h={x:p,y:r.y-i.height};break;case"bottom":h={x:p,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:b};break;case"left":h={x:r.x-i.width,y:b};break;default:h={x:r.x,y:r.y}}switch(ut(e)){case"start":h[s]-=g*(o&&d?-1:1);break;case"end":h[s]+=g*(o&&d?-1:1);break}return h}const Co=async(t,e,o)=>{const{placement:r="bottom",strategy:i="absolute",middleware:n=[],platform:s}=o,a=n.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e));let d=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:p,y:b}=ye(d,r,l),g=r,h={},f=0;for(let m=0;m<a.length;m++){const{name:y,fn:v}=a[m],{x,y:_,data:A,reset:C}=await v({x:p,y:b,initialPlacement:r,placement:g,strategy:i,middlewareData:h,rects:d,platform:s,elements:{reference:t,floating:e}});if(p=x??p,b=_??b,h={...h,[y]:{...h[y],...A}},C&&f<=50){f++,typeof C=="object"&&(C.placement&&(g=C.placement),C.rects&&(d=C.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):C.rects),{x:p,y:b}=ye(d,g,l)),m=-1;continue}}return{x:p,y:b,placement:g,strategy:i,middlewareData:h}};async function ee(t,e){var o;e===void 0&&(e={});const{x:r,y:i,platform:n,rects:s,elements:a,strategy:l}=t,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:b="floating",altBoundary:g=!1,padding:h=0}=dt(e,t),f=ve(h),y=a[g?b==="floating"?"reference":"floating":b],v=Vt(await n.getClippingRect({element:(o=await(n.isElement==null?void 0:n.isElement(y)))==null||o?y:y.contextElement||await(n.getDocumentElement==null?void 0:n.getDocumentElement(a.floating)),boundary:d,rootBoundary:p,strategy:l})),x=b==="floating"?{...s.floating,x:r,y:i}:s.reference,_=await(n.getOffsetParent==null?void 0:n.getOffsetParent(a.floating)),A=await(n.isElement==null?void 0:n.isElement(_))?await(n.getScale==null?void 0:n.getScale(_))||{x:1,y:1}:{x:1,y:1},C=Vt(n.convertOffsetParentRelativeRectToViewportRelativeRect?await n.convertOffsetParentRelativeRectToViewportRelativeRect({rect:x,offsetParent:_,strategy:l}):x);return{top:(v.top-C.top+f.top)/A.y,bottom:(C.bottom-v.bottom+f.bottom)/A.y,left:(v.left-C.left+f.left)/A.x,right:(C.right-v.right+f.right)/A.x}}const Eo=t=>({name:"arrow",options:t,async fn(e){const{x:o,y:r,placement:i,rects:n,platform:s,elements:a,middlewareData:l}=e,{element:d,padding:p=0}=dt(t,e)||{};if(d==null)return{};const b=ve(p),g={x:o,y:r},h=Qt(i),f=Jt(h),m=await s.getDimensions(d),y=h==="y",v=y?"top":"left",x=y?"bottom":"right",_=y?"clientHeight":"clientWidth",A=n.reference[f]+n.reference[h]-g[h]-n.floating[f],C=g[h]-n.reference[h],S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let O=S?S[_]:0;(!O||!await(s.isElement==null?void 0:s.isElement(S)))&&(O=a.floating[_]||n.floating[f]);const V=A/2-C/2,X=O/2-m[f]/2-1,gt=G(b[v],X),mt=G(b[x],X),R=gt,vt=O-m[f]-mt,$=O/2-m[f]/2+V,M=Gt(R,$,vt),N=!l.arrow&&ut(i)!=null&&$!=M&&n.reference[f]/2-($<R?gt:mt)-m[f]/2<0,j=N?$<R?$-R:$-vt:0;return{[h]:g[h]+j,data:{[h]:M,centerOffset:$-M-j,...N&&{alignmentOffset:j}},reset:N}}}),So=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var o,r;const{placement:i,middlewareData:n,rects:s,initialPlacement:a,platform:l,elements:d}=e,{mainAxis:p=!0,crossAxis:b=!0,fallbackPlacements:g,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...y}=dt(t,e);if((o=n.arrow)!=null&&o.alignmentOffset)return{};const v=Q(i),x=Q(a)===a,_=await(l.isRTL==null?void 0:l.isRTL(d.floating)),A=g||(x||!m?[Dt(a)]:wo(a));!g&&f!=="none"&&A.push(...ko(a,m,f,_));const C=[a,...A],S=await ee(e,y),O=[];let V=((r=n.flip)==null?void 0:r.overflows)||[];if(p&&O.push(S[v]),b){const R=yo(i,s,_);O.push(S[R[0]],S[R[1]])}if(V=[...V,{placement:i,overflows:O}],!O.every(R=>R<=0)){var X,gt;const R=(((X=n.flip)==null?void 0:X.index)||0)+1,vt=C[R];if(vt)return{data:{index:R,overflows:V},reset:{placement:vt}};let $=(gt=V.filter(M=>M.overflows[0]<=0).sort((M,N)=>M.overflows[1]-N.overflows[1])[0])==null?void 0:gt.placement;if(!$)switch(h){case"bestFit":{var mt;const M=(mt=V.map(N=>[N.placement,N.overflows.filter(j=>j>0).reduce((j,Ke)=>j+Ke,0)]).sort((N,j)=>N[1]-j[1])[0])==null?void 0:mt[0];M&&($=M);break}case"initialPlacement":$=a;break}if(i!==$)return{reset:{placement:$}}}return{}}}};async function Ao(t,e){const{placement:o,platform:r,elements:i}=t,n=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=Q(o),a=ut(o),l=xt(o)==="y",d=["left","top"].includes(s)?-1:1,p=n&&l?-1:1,b=dt(e,t);let{mainAxis:g,crossAxis:h,alignmentAxis:f}=typeof b=="number"?{mainAxis:b,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...b};return a&&typeof f=="number"&&(h=a==="end"?f*-1:f),l?{x:h*p,y:g*d}:{x:g*d,y:h*p}}const Lo=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){const{x:o,y:r}=e,i=await Ao(e,t);return{x:o+i.x,y:r+i.y,data:i}}}},zo=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:o,y:r,placement:i}=e,{mainAxis:n=!0,crossAxis:s=!1,limiter:a={fn:y=>{let{x:v,y:x}=y;return{x:v,y:x}}},...l}=dt(t,e),d={x:o,y:r},p=await ee(e,l),b=xt(Q(i)),g=me(b);let h=d[g],f=d[b];if(n){const y=g==="y"?"top":"left",v=g==="y"?"bottom":"right",x=h+p[y],_=h-p[v];h=Gt(x,h,_)}if(s){const y=b==="y"?"top":"left",v=b==="y"?"bottom":"right",x=f+p[y],_=f-p[v];f=Gt(x,f,_)}const m=a.fn({...e,[g]:h,[b]:f});return{...m,data:{x:m.x-o,y:m.y-r}}}}},we=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:o,rects:r,platform:i,elements:n}=e,{apply:s=()=>{},...a}=dt(t,e),l=await ee(e,a),d=Q(o),p=ut(o),b=xt(o)==="y",{width:g,height:h}=r.floating;let f,m;d==="top"||d==="bottom"?(f=d,m=p===(await(i.isRTL==null?void 0:i.isRTL(n.floating))?"start":"end")?"left":"right"):(m=d,f=p==="end"?"top":"bottom");const y=h-l[f],v=g-l[m],x=!e.middlewareData.shift;let _=y,A=v;if(b){const S=g-l.left-l.right;A=p||x?G(v,S):S}else{const S=h-l.top-l.bottom;_=p||x?G(y,S):S}if(x&&!p){const S=P(l.left,0),O=P(l.right,0),V=P(l.top,0),X=P(l.bottom,0);b?A=g-2*(S!==0||O!==0?S+O:P(l.left,l.right)):_=h-2*(V!==0||X!==0?V+X:P(l.top,l.bottom))}await s({...e,availableWidth:A,availableHeight:_});const C=await i.getDimensions(n.floating);return g!==C.width||h!==C.height?{reset:{rects:!0}}:{}}}};function tt(t){return xe(t)?(t.nodeName||"").toLowerCase():"#document"}function F(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function q(t){var e;return(e=(xe(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function xe(t){return t instanceof Node||t instanceof F(t).Node}function K(t){return t instanceof Element||t instanceof F(t).Element}function W(t){return t instanceof HTMLElement||t instanceof F(t).HTMLElement}function ke(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof F(t).ShadowRoot}function kt(t){const{overflow:e,overflowX:o,overflowY:r,display:i}=T(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+o)&&!["inline","contents"].includes(i)}function Oo(t){return["table","td","th"].includes(tt(t))}function oe(t){const e=re(),o=T(t);return o.transform!=="none"||o.perspective!=="none"||(o.containerType?o.containerType!=="normal":!1)||!e&&(o.backdropFilter?o.backdropFilter!=="none":!1)||!e&&(o.filter?o.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(o.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(o.contain||"").includes(r))}function $o(t){let e=ht(t);for(;W(e)&&!Mt(e);){if(oe(e))return e;e=ht(e)}return null}function re(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Mt(t){return["html","body","#document"].includes(tt(t))}function T(t){return F(t).getComputedStyle(t)}function Nt(t){return K(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function ht(t){if(tt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||ke(t)&&t.host||q(t);return ke(e)?e.host:e}function _e(t){const e=ht(t);return Mt(e)?t.ownerDocument?t.ownerDocument.body:t.body:W(e)&&kt(e)?e:_e(e)}function _t(t,e,o){var r;e===void 0&&(e=[]),o===void 0&&(o=!0);const i=_e(t),n=i===((r=t.ownerDocument)==null?void 0:r.body),s=F(i);return n?e.concat(s,s.visualViewport||[],kt(i)?i:[],s.frameElement&&o?_t(s.frameElement):[]):e.concat(i,_t(i,[],o))}function Ce(t){const e=T(t);let o=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=W(t),n=i?t.offsetWidth:o,s=i?t.offsetHeight:r,a=Bt(o)!==n||Bt(r)!==s;return a&&(o=n,r=s),{width:o,height:r,$:a}}function ie(t){return K(t)?t:t.contextElement}function pt(t){const e=ie(t);if(!W(e))return J(1);const o=e.getBoundingClientRect(),{width:r,height:i,$:n}=Ce(e);let s=(n?Bt(o.width):o.width)/r,a=(n?Bt(o.height):o.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Po=J(0);function Ee(t){const e=F(t);return!re()||!e.visualViewport?Po:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Fo(t,e,o){return e===void 0&&(e=!1),!o||e&&o!==F(t)?!1:e}function nt(t,e,o,r){e===void 0&&(e=!1),o===void 0&&(o=!1);const i=t.getBoundingClientRect(),n=ie(t);let s=J(1);e&&(r?K(r)&&(s=pt(r)):s=pt(t));const a=Fo(n,o,r)?Ee(n):J(0);let l=(i.left+a.x)/s.x,d=(i.top+a.y)/s.y,p=i.width/s.x,b=i.height/s.y;if(n){const g=F(n),h=r&&K(r)?F(r):r;let f=g.frameElement;for(;f&&r&&h!==g;){const m=pt(f),y=f.getBoundingClientRect(),v=T(f),x=y.left+(f.clientLeft+parseFloat(v.paddingLeft))*m.x,_=y.top+(f.clientTop+parseFloat(v.paddingTop))*m.y;l*=m.x,d*=m.y,p*=m.x,b*=m.y,l+=x,d+=_,f=F(f).frameElement}}return Vt({width:p,height:b,x:l,y:d})}function Ro(t){let{rect:e,offsetParent:o,strategy:r}=t;const i=W(o),n=q(o);if(o===n)return e;let s={scrollLeft:0,scrollTop:0},a=J(1);const l=J(0);if((i||!i&&r!=="fixed")&&((tt(o)!=="body"||kt(n))&&(s=Nt(o)),W(o))){const d=nt(o);a=pt(o),l.x=d.x+o.clientLeft,l.y=d.y+o.clientTop}return{width:e.width*a.x,height:e.height*a.y,x:e.x*a.x-s.scrollLeft*a.x+l.x,y:e.y*a.y-s.scrollTop*a.y+l.y}}function Bo(t){return Array.from(t.getClientRects())}function Se(t){return nt(q(t)).left+Nt(t).scrollLeft}function To(t){const e=q(t),o=Nt(t),r=t.ownerDocument.body,i=P(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),n=P(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-o.scrollLeft+Se(t);const a=-o.scrollTop;return T(r).direction==="rtl"&&(s+=P(e.clientWidth,r.clientWidth)-i),{width:i,height:n,x:s,y:a}}function Do(t,e){const o=F(t),r=q(t),i=o.visualViewport;let n=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){n=i.width,s=i.height;const d=re();(!d||d&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:n,height:s,x:a,y:l}}function Vo(t,e){const o=nt(t,!0,e==="fixed"),r=o.top+t.clientTop,i=o.left+t.clientLeft,n=W(t)?pt(t):J(1),s=t.clientWidth*n.x,a=t.clientHeight*n.y,l=i*n.x,d=r*n.y;return{width:s,height:a,x:l,y:d}}function Ae(t,e,o){let r;if(e==="viewport")r=Do(t,o);else if(e==="document")r=To(q(t));else if(K(e))r=Vo(e,o);else{const i=Ee(t);r={...e,x:e.x-i.x,y:e.y-i.y}}return Vt(r)}function Le(t,e){const o=ht(t);return o===e||!K(o)||Mt(o)?!1:T(o).position==="fixed"||Le(o,e)}function Mo(t,e){const o=e.get(t);if(o)return o;let r=_t(t,[],!1).filter(a=>K(a)&&tt(a)!=="body"),i=null;const n=T(t).position==="fixed";let s=n?ht(t):t;for(;K(s)&&!Mt(s);){const a=T(s),l=oe(s);!l&&a.position==="fixed"&&(i=null),(n?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||kt(s)&&!l&&Le(t,s))?r=r.filter(p=>p!==s):i=a,s=ht(s)}return e.set(t,r),r}function No(t){let{element:e,boundary:o,rootBoundary:r,strategy:i}=t;const s=[...o==="clippingAncestors"?Mo(e,this._c):[].concat(o),r],a=s[0],l=s.reduce((d,p)=>{const b=Ae(e,p,i);return d.top=P(b.top,d.top),d.right=G(b.right,d.right),d.bottom=G(b.bottom,d.bottom),d.left=P(b.left,d.left),d},Ae(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Io(t){return Ce(t)}function Wo(t,e,o){const r=W(e),i=q(e),n=o==="fixed",s=nt(t,!0,n,e);let a={scrollLeft:0,scrollTop:0};const l=J(0);if(r||!r&&!n)if((tt(e)!=="body"||kt(i))&&(a=Nt(e)),r){const d=nt(e,!0,n,e);l.x=d.x+e.clientLeft,l.y=d.y+e.clientTop}else i&&(l.x=Se(i));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function ze(t,e){return!W(t)||T(t).position==="fixed"?null:e?e(t):t.offsetParent}function Oe(t,e){const o=F(t);if(!W(t))return o;let r=ze(t,e);for(;r&&Oo(r)&&T(r).position==="static";)r=ze(r,e);return r&&(tt(r)==="html"||tt(r)==="body"&&T(r).position==="static"&&!oe(r))?o:r||$o(t)||o}const Ho=async function(t){let{reference:e,floating:o,strategy:r}=t;const i=this.getOffsetParent||Oe,n=this.getDimensions;return{reference:Wo(e,await i(o),r),floating:{x:0,y:0,...await n(o)}}};function jo(t){return T(t).direction==="rtl"}const It={convertOffsetParentRelativeRectToViewportRelativeRect:Ro,getDocumentElement:q,getClippingRect:No,getOffsetParent:Oe,getElementRects:Ho,getClientRects:Bo,getDimensions:Io,getScale:pt,isElement:K,isRTL:jo};function Uo(t,e){let o=null,r;const i=q(t);function n(){clearTimeout(r),o&&o.disconnect(),o=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),n();const{left:d,top:p,width:b,height:g}=t.getBoundingClientRect();if(a||e(),!b||!g)return;const h=Tt(p),f=Tt(i.clientWidth-(d+b)),m=Tt(i.clientHeight-(p+g)),y=Tt(d),x={rootMargin:-h+"px "+-f+"px "+-m+"px "+-y+"px",threshold:P(0,G(1,l))||1};let _=!0;function A(C){const S=C[0].intersectionRatio;if(S!==l){if(!_)return s();S?s(!1,S):r=setTimeout(()=>{s(!1,1e-7)},100)}_=!1}try{o=new IntersectionObserver(A,{...x,root:i.ownerDocument})}catch{o=new IntersectionObserver(A,x)}o.observe(t)}return s(!0),n}function qo(t,e,o,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:n=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,d=ie(t),p=i||n?[...d?_t(d):[],..._t(e)]:[];p.forEach(v=>{i&&v.addEventListener("scroll",o,{passive:!0}),n&&v.addEventListener("resize",o)});const b=d&&a?Uo(d,o):null;let g=-1,h=null;s&&(h=new ResizeObserver(v=>{let[x]=v;x&&x.target===d&&h&&(h.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{h&&h.observe(e)})),o()}),d&&!l&&h.observe(d),h.observe(e));let f,m=l?nt(t):null;l&&y();function y(){const v=nt(t);m&&(v.x!==m.x||v.y!==m.y||v.width!==m.width||v.height!==m.height)&&o(),m=v,f=requestAnimationFrame(y)}return o(),()=>{p.forEach(v=>{i&&v.removeEventListener("scroll",o),n&&v.removeEventListener("resize",o)}),b&&b(),h&&h.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const Ko=(t,e,o)=>{const r=new Map,i={platform:It,...o},n={...i.platform,_c:r};return Co(t,e,{...i,platform:n})};function Xo(t){return Yo(t)}function ne(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}function Yo(t){for(let e=t;e;e=ne(e))if(e instanceof Element&&getComputedStyle(e).display==="none")return null;for(let e=ne(t);e;e=ne(e)){if(!(e instanceof Element))continue;const o=getComputedStyle(e);if(o.display!=="contents"&&(o.position!=="static"||o.filter!=="none"||e.tagName==="BODY"))return e}return null}function Zo(t){return t!==null&&typeof t=="object"&&"getBoundingClientRect"in t&&("contextElement"in t?t instanceof Element:!0)}var k=class extends B{constructor(){super(...arguments),this.active=!1,this.placement="top",this.strategy="absolute",this.distance=0,this.skidding=0,this.arrow=!1,this.arrowPlacement="anchor",this.arrowPadding=10,this.flip=!1,this.flipFallbackPlacements="",this.flipFallbackStrategy="best-fit",this.flipPadding=0,this.shift=!1,this.shiftPadding=0,this.autoSizePadding=0,this.hoverBridge=!1,this.updateHoverBridge=()=>{if(this.hoverBridge&&this.anchorEl){const t=this.anchorEl.getBoundingClientRect(),e=this.popup.getBoundingClientRect(),o=this.placement.includes("top")||this.placement.includes("bottom");let r=0,i=0,n=0,s=0,a=0,l=0,d=0,p=0;o?t.top<e.top?(r=t.left,i=t.bottom,n=t.right,s=t.bottom,a=e.left,l=e.top,d=e.right,p=e.top):(r=e.left,i=e.bottom,n=e.right,s=e.bottom,a=t.left,l=t.top,d=t.right,p=t.top):t.left<e.left?(r=t.right,i=t.top,n=e.left,s=e.top,a=t.right,l=t.bottom,d=e.left,p=e.bottom):(r=e.right,i=e.top,n=t.left,s=t.top,a=e.right,l=e.bottom,d=t.left,p=t.bottom),this.style.setProperty("--hover-bridge-top-left-x",`${r}px`),this.style.setProperty("--hover-bridge-top-left-y",`${i}px`),this.style.setProperty("--hover-bridge-top-right-x",`${n}px`),this.style.setProperty("--hover-bridge-top-right-y",`${s}px`),this.style.setProperty("--hover-bridge-bottom-left-x",`${a}px`),this.style.setProperty("--hover-bridge-bottom-left-y",`${l}px`),this.style.setProperty("--hover-bridge-bottom-right-x",`${d}px`),this.style.setProperty("--hover-bridge-bottom-right-y",`${p}px`)}}}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.start()}disconnectedCallback(){super.disconnectedCallback(),this.stop()}async updated(t){super.updated(t),t.has("active")&&(this.active?this.start():this.stop()),t.has("anchor")&&this.handleAnchorChange(),this.active&&(await this.updateComplete,this.reposition())}async handleAnchorChange(){if(await this.stop(),this.anchor&&typeof this.anchor=="string"){const t=this.getRootNode();this.anchorEl=t.getElementById(this.anchor)}else this.anchor instanceof Element||Zo(this.anchor)?this.anchorEl=this.anchor:this.anchorEl=this.querySelector('[slot="anchor"]');this.anchorEl instanceof HTMLSlotElement&&(this.anchorEl=this.anchorEl.assignedElements({flatten:!0})[0]),this.anchorEl&&this.start()}start(){this.anchorEl&&(this.cleanup=qo(this.anchorEl,this.popup,()=>{this.reposition()}))}async stop(){return new Promise(t=>{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())):t()})}reposition(){if(!this.active||!this.anchorEl)return;const t=[Lo({mainAxis:this.distance,crossAxis:this.skidding})];this.sync?t.push(we({apply:({rects:o})=>{const r=this.sync==="width"||this.sync==="both",i=this.sync==="height"||this.sync==="both";this.popup.style.width=r?`${o.reference.width}px`:"",this.popup.style.height=i?`${o.reference.height}px`:""}})):(this.popup.style.width="",this.popup.style.height=""),this.flip&&t.push(So({boundary:this.flipBoundary,fallbackPlacements:this.flipFallbackPlacements,fallbackStrategy:this.flipFallbackStrategy==="best-fit"?"bestFit":"initialPlacement",padding:this.flipPadding})),this.shift&&t.push(zo({boundary:this.shiftBoundary,padding:this.shiftPadding})),this.autoSize?t.push(we({boundary:this.autoSizeBoundary,padding:this.autoSizePadding,apply:({availableWidth:o,availableHeight:r})=>{this.autoSize==="vertical"||this.autoSize==="both"?this.style.setProperty("--auto-size-available-height",`${r}px`):this.style.removeProperty("--auto-size-available-height"),this.autoSize==="horizontal"||this.autoSize==="both"?this.style.setProperty("--auto-size-available-width",`${o}px`):this.style.removeProperty("--auto-size-available-width")}})):(this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height")),this.arrow&&t.push(Eo({element:this.arrowEl,padding:this.arrowPadding}));const e=this.strategy==="absolute"?o=>It.getOffsetParent(o,Xo):It.getOffsetParent;Ko(this.anchorEl,this.popup,{placement:this.placement,middleware:t,strategy:this.strategy,platform:$t(rt({},It),{getOffsetParent:e})}).then(({x:o,y:r,middlewareData:i,placement:n})=>{const s=getComputedStyle(this).direction==="rtl",a={top:"bottom",right:"left",bottom:"top",left:"right"}[n.split("-")[0]];if(this.setAttribute("data-current-placement",n),Object.assign(this.popup.style,{left:`${o}px`,top:`${r}px`}),this.arrow){const l=i.arrow.x,d=i.arrow.y;let p="",b="",g="",h="";if(this.arrowPlacement==="start"){const f=typeof l=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";p=typeof d=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"",b=s?f:"",h=s?"":f}else if(this.arrowPlacement==="end"){const f=typeof l=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";b=s?"":f,h=s?f:"",g=typeof d=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:""}else this.arrowPlacement==="center"?(h=typeof l=="number"?"calc(50% - var(--arrow-size-diagonal))":"",p=typeof d=="number"?"calc(50% - var(--arrow-size-diagonal))":""):(h=typeof l=="number"?`${l}px`:"",p=typeof d=="number"?`${d}px`:"");Object.assign(this.arrowEl.style,{top:p,right:b,bottom:g,left:h,[a]:"calc(var(--arrow-size-diagonal) * -1)"})}}),requestAnimationFrame(()=>this.updateHoverBridge()),this.emit("sl-reposition")}render(){return Y` <slot name="anchor" @slotchange=${this.handleAnchorChange}></slot> <span part="hover-bridge" class=${ot({"popup-hover-bridge":!0,"popup-hover-bridge--visible":this.hoverBridge&&this.active})} ></span> <div part="popup" class=${ot({popup:!0,"popup--active":this.active,"popup--fixed":this.strategy==="fixed","popup--has-arrow":this.arrow})} > <slot></slot> ${this.arrow?Y`<div part="arrow" class="popup__arrow" role="presentation"></div>`:""} </div> `}};k.styles=[Z,go],c([I(".popup")],k.prototype,"popup",2),c([I(".popup__arrow")],k.prototype,"arrowEl",2),c([u()],k.prototype,"anchor",2),c([u({type:Boolean,reflect:!0})],k.prototype,"active",2),c([u({reflect:!0})],k.prototype,"placement",2),c([u({reflect:!0})],k.prototype,"strategy",2),c([u({type:Number})],k.prototype,"distance",2),c([u({type:Number})],k.prototype,"skidding",2),c([u({type:Boolean})],k.prototype,"arrow",2),c([u({attribute:"arrow-placement"})],k.prototype,"arrowPlacement",2),c([u({attribute:"arrow-padding",type:Number})],k.prototype,"arrowPadding",2),c([u({type:Boolean})],k.prototype,"flip",2),c([u({attribute:"flip-fallback-placements",converter:{fromAttribute:t=>t.split(" ").map(e=>e.trim()).filter(e=>e!==""),toAttribute:t=>t.join(" ")}})],k.prototype,"flipFallbackPlacements",2),c([u({attribute:"flip-fallback-strategy"})],k.prototype,"flipFallbackStrategy",2),c([u({type:Object})],k.prototype,"flipBoundary",2),c([u({attribute:"flip-padding",type:Number})],k.prototype,"flipPadding",2),c([u({type:Boolean})],k.prototype,"shift",2),c([u({type:Object})],k.prototype,"shiftBoundary",2),c([u({attribute:"shift-padding",type:Number})],k.prototype,"shiftPadding",2),c([u({attribute:"auto-size"})],k.prototype,"autoSize",2),c([u()],k.prototype,"sync",2),c([u({type:Object})],k.prototype,"autoSizeBoundary",2),c([u({attribute:"auto-size-padding",type:Number})],k.prototype,"autoSizePadding",2),c([u({attribute:"hover-bridge",type:Boolean})],k.prototype,"hoverBridge",2);var $e=new Map,Go=new WeakMap;function Jo(t){return t??{keyframes:[],options:{duration:0}}}function Pe(t,e){return e.toLowerCase()==="rtl"?{keyframes:t.rtlKeyframes||t.keyframes,options:t.options}:t}function st(t,e){$e.set(t,Jo(e))}function at(t,e,o){const r=Go.get(t);if(r?.[e])return Pe(r[e],o.dir);const i=$e.get(e);return i?Pe(i,o.dir):{keyframes:[],options:{duration:0}}}function Wt(t,e){return new Promise(o=>{function r(i){i.target===t&&(t.removeEventListener(e,r),o())}t.addEventListener(e,r)})}function lt(t,e,o){return new Promise(r=>{if(o?.duration===1/0)throw new Error("Promise-based animations must be finite.");const i=t.animate(e,$t(rt({},o),{duration:Qo()?0:o.duration}));i.addEventListener("cancel",r,{once:!0}),i.addEventListener("finish",r,{once:!0})})}function Fe(t){return t=t.toString().toLowerCase(),t.indexOf("ms")>-1?parseFloat(t):t.indexOf("s")>-1?parseFloat(t)*1e3:parseFloat(t)}function Qo(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}function ft(t){return Promise.all(t.getAnimations().map(e=>new Promise(o=>{e.cancel(),requestAnimationFrame(o)})))}const se=new Set,tr=new MutationObserver(De),bt=new Map;let Re=document.documentElement.dir||"ltr",Be=document.documentElement.lang||navigator.language,ct;tr.observe(document.documentElement,{attributes:!0,attributeFilter:["dir","lang"]});function Te(...t){t.map(e=>{const o=e.$code.toLowerCase();bt.has(o)?bt.set(o,Object.assign(Object.assign({},bt.get(o)),e)):bt.set(o,e),ct||(ct=e)}),De()}function De(){Re=document.documentElement.dir||"ltr",Be=document.documentElement.lang||navigator.language,[...se.keys()].map(t=>{typeof t.requestUpdate=="function"&&t.requestUpdate()})}let er=class{constructor(e){this.host=e,this.host.addController(this)}hostConnected(){se.add(this.host)}hostDisconnected(){se.delete(this.host)}dir(){return`${this.host.dir||Re}`.toLowerCase()}lang(){return`${this.host.lang||Be}`.toLowerCase()}getTranslationData(e){var o,r;const i=new Intl.Locale(e.replace(/_/g,"-")),n=i?.language.toLowerCase(),s=(r=(o=i?.region)===null||o===void 0?void 0:o.toLowerCase())!==null&&r!==void 0?r:"",a=bt.get(`${n}-${s}`),l=bt.get(n);return{locale:i,language:n,region:s,primary:a,secondary:l}}exists(e,o){var r;const{primary:i,secondary:n}=this.getTranslationData((r=o.lang)!==null&&r!==void 0?r:this.lang());return o=Object.assign({includeFallback:!1},o),!!(i&&i[e]||n&&n[e]||o.includeFallback&&ct&&ct[e])}term(e,...o){const{primary:r,secondary:i}=this.getTranslationData(this.lang());let n;if(r&&r[e])n=r[e];else if(i&&i[e])n=i[e];else if(ct&&ct[e])n=ct[e];else return console.error(`No translation found for: ${String(e)}`),String(e);return typeof n=="function"?n(...o):n}date(e,o){return e=new Date(e),new Intl.DateTimeFormat(this.lang(),o).format(e)}number(e,o){return e=Number(e),isNaN(e)?"":new Intl.NumberFormat(this.lang(),o).format(e)}relativeTime(e,o,r){return new Intl.RelativeTimeFormat(this.lang(),r).format(e,o)}};var Ve={$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=>t===0?"No options selected":t===1?"1 option selected":`${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"};Te(Ve);var or=Ve,Ht=class extends er{};Te(or);var L=class extends B{constructor(){super(),this.localize=new Ht(this),this.content="",this.placement="top",this.disabled=!1,this.distance=8,this.open=!1,this.skidding=0,this.trigger="hover focus",this.hoist=!1,this.handleBlur=()=>{this.hasTrigger("focus")&&this.hide()},this.handleClick=()=>{this.hasTrigger("click")&&(this.open?this.hide():this.show())},this.handleFocus=()=>{this.hasTrigger("focus")&&this.show()},this.handleDocumentKeyDown=t=>{t.key==="Escape"&&(t.stopPropagation(),this.hide())},this.handleMouseOver=()=>{if(this.hasTrigger("hover")){const t=Fe(getComputedStyle(this).getPropertyValue("--show-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout(()=>this.show(),t)}},this.handleMouseOut=()=>{if(this.hasTrigger("hover")){const t=Fe(getComputedStyle(this).getPropertyValue("--hide-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout(()=>this.hide(),t)}},this.addEventListener("blur",this.handleBlur,!0),this.addEventListener("focus",this.handleFocus,!0),this.addEventListener("click",this.handleClick),this.addEventListener("mouseover",this.handleMouseOver),this.addEventListener("mouseout",this.handleMouseOut)}disconnectedCallback(){var t;(t=this.closeWatcher)==null||t.destroy(),document.removeEventListener("keydown",this.handleDocumentKeyDown)}firstUpdated(){this.body.hidden=!this.open,this.open&&(this.popup.active=!0,this.popup.reposition())}hasTrigger(t){return this.trigger.split(" ").includes(t)}async handleOpenChange(){var t,e;if(this.open){if(this.disabled)return;this.emit("sl-show"),"CloseWatcher"in window?((t=this.closeWatcher)==null||t.destroy(),this.closeWatcher=new CloseWatcher,this.closeWatcher.onclose=()=>{this.hide()}):document.addEventListener("keydown",this.handleDocumentKeyDown),await ft(this.body),this.body.hidden=!1,this.popup.active=!0;const{keyframes:o,options:r}=at(this,"tooltip.show",{dir:this.localize.dir()});await lt(this.popup.popup,o,r),this.popup.reposition(),this.emit("sl-after-show")}else{this.emit("sl-hide"),(e=this.closeWatcher)==null||e.destroy(),document.removeEventListener("keydown",this.handleDocumentKeyDown),await ft(this.body);const{keyframes:o,options:r}=at(this,"tooltip.hide",{dir:this.localize.dir()});await lt(this.popup.popup,o,r),this.popup.active=!1,this.body.hidden=!0,this.emit("sl-after-hide")}}async handleOptionsChange(){this.hasUpdated&&(await this.updateComplete,this.popup.reposition())}handleDisabledChange(){this.disabled&&this.open&&this.hide()}async show(){if(!this.open)return this.open=!0,Wt(this,"sl-after-show")}async hide(){if(this.open)return this.open=!1,Wt(this,"sl-after-hide")}render(){return Y` <sl-popup part="base" exportparts=" popup:base__popup, arrow:base__arrow " class=${ot({tooltip:!0,"tooltip--open":this.open})} placement=${this.placement} distance=${this.distance} skidding=${this.skidding} strategy=${this.hoist?"fixed":"absolute"} flip shift arrow hover-bridge > ${""} <slot slot="anchor" aria-describedby="tooltip"></slot> ${""} <div part="body" id="tooltip" class="tooltip__body" role="tooltip" aria-live=${this.open?"polite":"off"}> <slot name="content">${this.content}</slot> </div> </sl-popup> `}};L.styles=[Z,bo],L.dependencies={"sl-popup":k},c([I("slot:no