@cas-smartdesign/token-selector 1.0.3 → 1.0.5

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.
@@ -1,8 +1,8 @@
1
- var window;(window||={})["@cas-smartdesign/token-selector"]=(()=>{var ii=Object.defineProperty;var Vs=Object.getOwnPropertyDescriptor;var Fs=Object.getOwnPropertyNames;var Ws=Object.prototype.hasOwnProperty;var js=(e,t)=>{for(var i in t)ii(e,i,{get:t[i],enumerable:!0})},Ks=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Fs(t))!Ws.call(e,o)&&o!==i&&ii(e,o,{get:()=>t[o],enumerable:!(s=Vs(t,o))||s.enumerable});return e};var Gs=e=>Ks(ii({},"__esModule",{value:!0}),e);var yr={};js(yr,{SelectionMode:()=>Rs,default:()=>br,generator:()=>Ms});var Ie=globalThis,Ce=Ie.ShadowRoot&&(Ie.ShadyCSS===void 0||Ie.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,si=Symbol(),Vi=new WeakMap,oe=class{constructor(t,i,s){if(this._$cssResult$=!0,s!==si)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=i}get styleSheet(){let t=this.o,i=this.t;if(Ce&&t===void 0){let s=i!==void 0&&i.length===1;s&&(t=Vi.get(i)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Vi.set(i,t))}return t}toString(){return this.cssText}},X=e=>new oe(typeof e=="string"?e:e+"",void 0,si),at=(e,...t)=>{let i=e.length===1?e[0]:t.reduce(((s,o,r)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+e[r+1]),e[0]);return new oe(i,e,si)},Fi=(e,t)=>{if(Ce)e.adoptedStyleSheets=t.map((i=>i instanceof CSSStyleSheet?i:i.styleSheet));else for(let i of t){let s=document.createElement("style"),o=Ie.litNonce;o!==void 0&&s.setAttribute("nonce",o),s.textContent=i.cssText,e.appendChild(s)}},oi=Ce?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let i="";for(let s of t.cssRules)i+=s.cssText;return X(i)})(e):e;var{is:Xs,defineProperty:Ys,getOwnPropertyDescriptor:Js,getOwnPropertyNames:Zs,getOwnPropertySymbols:Qs,getPrototypeOf:to}=Object,Te=globalThis,Wi=Te.trustedTypes,eo=Wi?Wi.emptyScript:"",io=Te.reactiveElementPolyfillSupport,re=(e,t)=>e,ne={toAttribute(e,t){switch(t){case Boolean:e=e?eo:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=e!==null;break;case Number:i=e===null?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch{i=null}}return i}},Le=(e,t)=>!Xs(e,t),ji={attribute:!0,type:String,converter:ne,reflect:!1,useDefault:!1,hasChanged:Le};Symbol.metadata??=Symbol("metadata"),Te.litPropertyMetadata??=new WeakMap;var lt=class 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,i=ji){if(i.state&&(i.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((i=Object.create(i)).wrapped=!0),this.elementProperties.set(t,i),!i.noAccessor){let s=Symbol(),o=this.getPropertyDescriptor(t,s,i);o!==void 0&&Ys(this.prototype,t,o)}}static getPropertyDescriptor(t,i,s){let{get:o,set:r}=Js(this.prototype,t)??{get(){return this[i]},set(n){this[i]=n}};return{get:o,set(n){let a=o?.call(this);r?.call(this,n),this.requestUpdate(t,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??ji}static _$Ei(){if(this.hasOwnProperty(re("elementProperties")))return;let t=to(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(re("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(re("properties"))){let i=this.properties,s=[...Zs(i),...Qs(i)];for(let o of s)this.createProperty(o,i[o])}let t=this[Symbol.metadata];if(t!==null){let i=litPropertyMetadata.get(t);if(i!==void 0)for(let[s,o]of i)this.elementProperties.set(s,o)}this._$Eh=new Map;for(let[i,s]of this.elementProperties){let o=this._$Eu(i,s);o!==void 0&&this._$Eh.set(o,i)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let i=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let o of s)i.unshift(oi(o))}else t!==void 0&&i.push(oi(t));return i}static _$Eu(t,i){let s=i.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?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),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,i=this.constructor.elementProperties;for(let s of i.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Fi(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,i,s){this._$AK(t,s)}_$ET(t,i){let s=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,s);if(o!==void 0&&s.reflect===!0){let r=(s.converter?.toAttribute!==void 0?s.converter:ne).toAttribute(i,s.type);this._$Em=t,r==null?this.removeAttribute(o):this.setAttribute(o,r),this._$Em=null}}_$AK(t,i){let s=this.constructor,o=s._$Eh.get(t);if(o!==void 0&&this._$Em!==o){let r=s.getPropertyOptions(o),n=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:ne;this._$Em=o;let a=n.fromAttribute(i,r.type);this[o]=a??this._$Ej?.get(o)??a,this._$Em=null}}requestUpdate(t,i,s){if(t!==void 0){let o=this.constructor,r=this[t];if(s??=o.getPropertyOptions(t),!((s.hasChanged??Le)(r,i)||s.useDefault&&s.reflect&&r===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,s))))return;this.C(t,i,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,i,{useDefault:s,reflect:o,wrapped:r},n){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,n??i??this[t]),r!==!0||n!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(i=void 0),this._$AL.set(t,i)),o===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(i){Promise.reject(i)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[o,r]of this._$Ep)this[o]=r;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[o,r]of s){let{wrapped:n}=r,a=this[o];n!==!0||this._$AL.has(o)||a===void 0||this.C(o,void 0,r,a)}}let t=!1,i=this._$AL;try{t=this.shouldUpdate(i),t?(this.willUpdate(i),this._$EO?.forEach((s=>s.hostUpdate?.())),this.update(i)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(i)}willUpdate(t){}_$AE(t){this._$EO?.forEach((i=>i.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((i=>this._$ET(i,this[i]))),this._$EM()}updated(t){}firstUpdated(t){}};lt.elementStyles=[],lt.shadowRootOptions={mode:"open"},lt[re("elementProperties")]=new Map,lt[re("finalized")]=new Map,io?.({ReactiveElement:lt}),(Te.reactiveElementVersions??=[]).push("2.1.1");var ni=globalThis,Pe=ni.trustedTypes,Ki=Pe?Pe.createPolicy("lit-html",{createHTML:e=>e}):void 0,ai="$lit$",dt=`lit$${Math.random().toFixed(9).slice(2)}$`,li="?"+dt,so=`<${li}>`,Tt=document,le=()=>Tt.createComment(""),de=e=>e===null||typeof e!="object"&&typeof e!="function",di=Array.isArray,Qi=e=>di(e)||typeof e?.[Symbol.iterator]=="function",ri=`[
1
+ var window;(window||={})["@cas-smartdesign/token-selector"]=(()=>{var ii=Object.defineProperty;var Fs=Object.getOwnPropertyDescriptor;var Vs=Object.getOwnPropertyNames;var Ws=Object.prototype.hasOwnProperty;var js=(e,t)=>{for(var i in t)ii(e,i,{get:t[i],enumerable:!0})},Ks=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Vs(t))!Ws.call(e,o)&&o!==i&&ii(e,o,{get:()=>t[o],enumerable:!(s=Fs(t,o))||s.enumerable});return e};var Gs=e=>Ks(ii({},"__esModule",{value:!0}),e);var yr={};js(yr,{SelectionMode:()=>Rs,default:()=>br,generator:()=>Ms});var Ie=globalThis,Ce=Ie.ShadowRoot&&(Ie.ShadyCSS===void 0||Ie.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,si=Symbol(),Fi=new WeakMap,oe=class{constructor(t,i,s){if(this._$cssResult$=!0,s!==si)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=i}get styleSheet(){let t=this.o,i=this.t;if(Ce&&t===void 0){let s=i!==void 0&&i.length===1;s&&(t=Fi.get(i)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Fi.set(i,t))}return t}toString(){return this.cssText}},X=e=>new oe(typeof e=="string"?e:e+"",void 0,si),at=(e,...t)=>{let i=e.length===1?e[0]:t.reduce(((s,o,r)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+e[r+1]),e[0]);return new oe(i,e,si)},Vi=(e,t)=>{if(Ce)e.adoptedStyleSheets=t.map((i=>i instanceof CSSStyleSheet?i:i.styleSheet));else for(let i of t){let s=document.createElement("style"),o=Ie.litNonce;o!==void 0&&s.setAttribute("nonce",o),s.textContent=i.cssText,e.appendChild(s)}},oi=Ce?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let i="";for(let s of t.cssRules)i+=s.cssText;return X(i)})(e):e;var{is:Xs,defineProperty:Ys,getOwnPropertyDescriptor:Js,getOwnPropertyNames:Zs,getOwnPropertySymbols:Qs,getPrototypeOf:to}=Object,Te=globalThis,Wi=Te.trustedTypes,eo=Wi?Wi.emptyScript:"",io=Te.reactiveElementPolyfillSupport,re=(e,t)=>e,ne={toAttribute(e,t){switch(t){case Boolean:e=e?eo:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=e!==null;break;case Number:i=e===null?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch{i=null}}return i}},Le=(e,t)=>!Xs(e,t),ji={attribute:!0,type:String,converter:ne,reflect:!1,useDefault:!1,hasChanged:Le};Symbol.metadata??=Symbol("metadata"),Te.litPropertyMetadata??=new WeakMap;var lt=class 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,i=ji){if(i.state&&(i.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((i=Object.create(i)).wrapped=!0),this.elementProperties.set(t,i),!i.noAccessor){let s=Symbol(),o=this.getPropertyDescriptor(t,s,i);o!==void 0&&Ys(this.prototype,t,o)}}static getPropertyDescriptor(t,i,s){let{get:o,set:r}=Js(this.prototype,t)??{get(){return this[i]},set(n){this[i]=n}};return{get:o,set(n){let a=o?.call(this);r?.call(this,n),this.requestUpdate(t,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??ji}static _$Ei(){if(this.hasOwnProperty(re("elementProperties")))return;let t=to(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(re("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(re("properties"))){let i=this.properties,s=[...Zs(i),...Qs(i)];for(let o of s)this.createProperty(o,i[o])}let t=this[Symbol.metadata];if(t!==null){let i=litPropertyMetadata.get(t);if(i!==void 0)for(let[s,o]of i)this.elementProperties.set(s,o)}this._$Eh=new Map;for(let[i,s]of this.elementProperties){let o=this._$Eu(i,s);o!==void 0&&this._$Eh.set(o,i)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let i=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let o of s)i.unshift(oi(o))}else t!==void 0&&i.push(oi(t));return i}static _$Eu(t,i){let s=i.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?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),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,i=this.constructor.elementProperties;for(let s of i.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Vi(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,i,s){this._$AK(t,s)}_$ET(t,i){let s=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,s);if(o!==void 0&&s.reflect===!0){let r=(s.converter?.toAttribute!==void 0?s.converter:ne).toAttribute(i,s.type);this._$Em=t,r==null?this.removeAttribute(o):this.setAttribute(o,r),this._$Em=null}}_$AK(t,i){let s=this.constructor,o=s._$Eh.get(t);if(o!==void 0&&this._$Em!==o){let r=s.getPropertyOptions(o),n=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:ne;this._$Em=o;let a=n.fromAttribute(i,r.type);this[o]=a??this._$Ej?.get(o)??a,this._$Em=null}}requestUpdate(t,i,s){if(t!==void 0){let o=this.constructor,r=this[t];if(s??=o.getPropertyOptions(t),!((s.hasChanged??Le)(r,i)||s.useDefault&&s.reflect&&r===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,s))))return;this.C(t,i,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,i,{useDefault:s,reflect:o,wrapped:r},n){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,n??i??this[t]),r!==!0||n!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(i=void 0),this._$AL.set(t,i)),o===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(i){Promise.reject(i)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[o,r]of this._$Ep)this[o]=r;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[o,r]of s){let{wrapped:n}=r,a=this[o];n!==!0||this._$AL.has(o)||a===void 0||this.C(o,void 0,r,a)}}let t=!1,i=this._$AL;try{t=this.shouldUpdate(i),t?(this.willUpdate(i),this._$EO?.forEach((s=>s.hostUpdate?.())),this.update(i)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(i)}willUpdate(t){}_$AE(t){this._$EO?.forEach((i=>i.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((i=>this._$ET(i,this[i]))),this._$EM()}updated(t){}firstUpdated(t){}};lt.elementStyles=[],lt.shadowRootOptions={mode:"open"},lt[re("elementProperties")]=new Map,lt[re("finalized")]=new Map,io?.({ReactiveElement:lt}),(Te.reactiveElementVersions??=[]).push("2.1.1");var ni=globalThis,Pe=ni.trustedTypes,Ki=Pe?Pe.createPolicy("lit-html",{createHTML:e=>e}):void 0,ai="$lit$",dt=`lit$${Math.random().toFixed(9).slice(2)}$`,li="?"+dt,so=`<${li}>`,Tt=document,le=()=>Tt.createComment(""),de=e=>e===null||typeof e!="object"&&typeof e!="function",di=Array.isArray,Qi=e=>di(e)||typeof e?.[Symbol.iterator]=="function",ri=`[
2
2
  \f\r]`,ae=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Gi=/-->/g,Xi=/>/g,It=RegExp(`>|${ri}(?:([^\\s"'>=/]+)(${ri}*=${ri}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Yi=/'/g,Ji=/"/g,ts=/^(?:script|style|textarea|title)$/i,ci=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),A=ci(1),kr=ci(2),Sr=ci(3),ct=Symbol.for("lit-noChange"),g=Symbol.for("lit-nothing"),Zi=new WeakMap,Ct=Tt.createTreeWalker(Tt,129);function es(e,t){if(!di(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ki!==void 0?Ki.createHTML(t):t}var is=(e,t)=>{let i=e.length-1,s=[],o,r=t===2?"<svg>":t===3?"<math>":"",n=ae;for(let a=0;a<i;a++){let l=e[a],c,d,p=-1,f=0;for(;f<l.length&&(n.lastIndex=f,d=n.exec(l),d!==null);)f=n.lastIndex,n===ae?d[1]==="!--"?n=Gi:d[1]!==void 0?n=Xi:d[2]!==void 0?(ts.test(d[2])&&(o=RegExp("</"+d[2],"g")),n=It):d[3]!==void 0&&(n=It):n===It?d[0]===">"?(n=o??ae,p=-1):d[1]===void 0?p=-2:(p=n.lastIndex-d[2].length,c=d[1],n=d[3]===void 0?It:d[3]==='"'?Ji:Yi):n===Ji||n===Yi?n=It:n===Gi||n===Xi?n=ae:(n=It,o=void 0);let u=n===It&&e[a+1].startsWith("/>")?" ":"";r+=n===ae?l+so:p>=0?(s.push(c),l.slice(0,p)+ai+l.slice(p)+dt+u):l+dt+(p===-2?a:u)}return[es(e,r+(e[i]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]},ce=class e{constructor({strings:t,_$litType$:i},s){let o;this.parts=[];let r=0,n=0,a=t.length-1,l=this.parts,[c,d]=is(t,i);if(this.el=e.createElement(c,s),Ct.currentNode=this.el.content,i===2||i===3){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(o=Ct.nextNode())!==null&&l.length<a;){if(o.nodeType===1){if(o.hasAttributes())for(let p of o.getAttributeNames())if(p.endsWith(ai)){let f=d[n++],u=o.getAttribute(p).split(dt),y=/([.?@])?(.*)/.exec(f);l.push({type:1,index:r,name:y[2],strings:u,ctor:y[1]==="."?De:y[1]==="?"?Me:y[1]==="@"?Re:Pt}),o.removeAttribute(p)}else p.startsWith(dt)&&(l.push({type:6,index:r}),o.removeAttribute(p));if(ts.test(o.tagName)){let p=o.textContent.split(dt),f=p.length-1;if(f>0){o.textContent=Pe?Pe.emptyScript:"";for(let u=0;u<f;u++)o.append(p[u],le()),Ct.nextNode(),l.push({type:2,index:++r});o.append(p[f],le())}}}else if(o.nodeType===8)if(o.data===li)l.push({type:2,index:r});else{let p=-1;for(;(p=o.data.indexOf(dt,p+1))!==-1;)l.push({type:7,index:r}),p+=dt.length-1}r++}}static createElement(t,i){let s=Tt.createElement("template");return s.innerHTML=t,s}};function Lt(e,t,i=e,s){if(t===ct)return t;let o=s!==void 0?i._$Co?.[s]:i._$Cl,r=de(t)?void 0:t._$litDirective$;return o?.constructor!==r&&(o?._$AO?.(!1),r===void 0?o=void 0:(o=new r(e),o._$AT(e,i,s)),s!==void 0?(i._$Co??=[])[s]=o:i._$Cl=o),o!==void 0&&(t=Lt(e,o._$AS(e,t.values),o,s)),t}var Oe=class{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:i},parts:s}=this._$AD,o=(t?.creationScope??Tt).importNode(i,!0);Ct.currentNode=o;let r=Ct.nextNode(),n=0,a=0,l=s[0];for(;l!==void 0;){if(n===l.index){let c;l.type===2?c=new Kt(r,r.nextSibling,this,t):l.type===1?c=new l.ctor(r,l.name,l.strings,this,t):l.type===6&&(c=new Ne(r,this,t)),this._$AV.push(c),l=s[++a]}n!==l?.index&&(r=Ct.nextNode(),n++)}return Ct.currentNode=Tt,o}p(t){let i=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++}},Kt=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,o){this.type=2,this._$AH=g,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,i=this._$AM;return i!==void 0&&t?.nodeType===11&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=Lt(this,t,i),de(t)?t===g||t==null||t===""?(this._$AH!==g&&this._$AR(),this._$AH=g):t!==this._$AH&&t!==ct&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Qi(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!==g&&de(this._$AH)?this._$AA.nextSibling.data=t:this.T(Tt.createTextNode(t)),this._$AH=t}$(t){let{values:i,_$litType$:s}=t,o=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=ce.createElement(es(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===o)this._$AH.p(i);else{let r=new Oe(o,this),n=r.u(this.options);r.p(i),this.T(n),this._$AH=r}}_$AC(t){let i=Zi.get(t.strings);return i===void 0&&Zi.set(t.strings,i=new ce(t)),i}k(t){di(this._$AH)||(this._$AH=[],this._$AR());let i=this._$AH,s,o=0;for(let r of t)o===i.length?i.push(s=new e(this.O(le()),this.O(le()),this,this.options)):s=i[o],s._$AI(r),o++;o<i.length&&(this._$AR(s&&s._$AB.nextSibling,o),i.length=o)}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(!1,!0,i);t!==this._$AB;){let s=t.nextSibling;t.remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},Pt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,o,r){this.type=1,this._$AH=g,this._$AN=void 0,this.element=t,this.name=i,this._$AM=o,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=g}_$AI(t,i=this,s,o){let r=this.strings,n=!1;if(r===void 0)t=Lt(this,t,i,0),n=!de(t)||t!==this._$AH&&t!==ct,n&&(this._$AH=t);else{let a=t,l,c;for(t=r[0],l=0;l<r.length-1;l++)c=Lt(this,a[s+l],i,l),c===ct&&(c=this._$AH[l]),n||=!de(c)||c!==this._$AH[l],c===g?t=g:t!==g&&(t+=(c??"")+r[l+1]),this._$AH[l]=c}n&&!o&&this.j(t)}j(t){t===g?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},De=class extends Pt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===g?void 0:t}},Me=class extends Pt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==g)}},Re=class extends Pt{constructor(t,i,s,o,r){super(t,i,s,o,r),this.type=5}_$AI(t,i=this){if((t=Lt(this,t,i,0)??g)===ct)return;let s=this._$AH,o=t===g&&s!==g||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==g&&(s===g||o);o&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},Ne=class{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){Lt(this,t)}},ss={M:ai,P:dt,A:li,C:1,L:is,R:Oe,D:Qi,V:Lt,I:Kt,H:Pt,N:Me,U:Re,B:De,F:Ne},oo=ni.litHtmlPolyfillSupport;oo?.(ce,Kt),(ni.litHtmlVersions??=[]).push("3.3.1");var os=(e,t,i)=>{let s=i?.renderBefore??t,o=s._$litPart$;if(o===void 0){let r=i?.renderBefore??null;s._$litPart$=o=new Kt(t.insertBefore(le(),r),r,void 0,i??{})}return o._$AI(e),o};var hi=globalThis,D=class extends lt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=os(i,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return ct}};D._$litElement$=!0,D.finalized=!0,hi.litElementHydrateSupport?.({LitElement:D});var ro=hi.litElementPolyfillSupport;ro?.({LitElement:D});(hi.litElementVersions??=[]).push("4.2.1");var no={attribute:!0,type:String,converter:ne,reflect:!1,hasChanged:Le},ao=(e=no,t,i)=>{let{kind:s,metadata:o}=i,r=globalThis.litPropertyMetadata.get(o);if(r===void 0&&globalThis.litPropertyMetadata.set(o,r=new Map),s==="setter"&&((e=Object.create(e)).wrapped=!0),r.set(i.name,e),s==="accessor"){let{name:n}=i;return{set(a){let l=t.get.call(this);t.set.call(this,a),this.requestUpdate(n,l,e)},init(a){return a!==void 0&&this.C(n,void 0,e,a),a}}}if(s==="setter"){let{name:n}=i;return function(a){let l=this[n];t.call(this,a),this.requestUpdate(n,l,e)}}throw Error("Unsupported decorator location: "+s)};function h(e){return(t,i)=>typeof i=="object"?ao(e,t,i):((s,o,r)=>{let n=o.hasOwnProperty(r);return o.constructor.createProperty(r,s),n?Object.getOwnPropertyDescriptor(o,r):void 0})(e,t,i)}var M=e=>e??g;var lo=":host{display:inline-block;font-size:13px;line-height:20px;font-family:Segoe UI,Lucida Sans,Arial,sans-serif;color:#111;contain:content}:host([hidden]){display:none!important}:host([level=warn i]){color:#555}:host([level=suggest i]){color:#bf8800}:host([level=error i]){color:#cc0017}:host([level=warn]){color:#555}:host([level=suggest]){color:#bf8800}:host([level=error]){color:#cc0017}.icon{height:12px;width:12px;padding-right:4px;margin-bottom:-1px}",co="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2012%2012'%3e%3cstyle%20id='style3'%3e%20.st0{fill:%23fff}.st1{fill:%23c00}%20%3c/style%3e%3cg%20id='g5'%3e%3cpath%20class='st1'%20d='M6%20.9c2.8%200%205.1%202.3%205.1%205.1S8.8%2011.1%206%2011.1.9%208.8.9%206%203.2.9%206%20.9m0-1C2.7-.1-.1%202.7-.1%206s2.7%206.1%206.1%206.1%206.1-2.7%206.1-6.1S9.3-.1%206-.1z'%20id='path9'/%3e%3c/g%3e%3cg%20id='g11'%3e%3cpath%20class='st0'%20id='rect13'%20d='M5.5%202.5h1v4h-1z'/%3e%3cpath%20class='st1'%20d='M6%203v3-3m1-1H5v5h2V2z'%20id='path15'/%3e%3c/g%3e%3cg%20id='g17'%3e%3cpath%20class='st0'%20id='rect19'%20d='M5.5%208.5h1v1h-1z'/%3e%3cpath%20class='st1'%20id='polygon21'%20d='M7%208H5v2h2V8z'/%3e%3c/g%3e%3c/svg%3e",ho="data:image/svg+xml,%3csvg%20id='Ebene_1'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cstyle%3e%20.st0{fill:%23bf8800}%20%3c/style%3e%3cpath%20class='st0'%20d='M12%20.8l11%2019.8v1.3H1v-1.3L12%20.8zm.8-.6h-1.6L0%2020v3h24v-3L12.8.2z'/%3e%3cpath%20class='st0'%20d='M11%208h2v8h-2zm0%2010h2v2h-2z'/%3e%3c/svg%3e",po="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2012%2012'%3e%3cpath%20class='st1'%20d='M6%20.9c2.8%200%205.1%202.3%205.1%205.1S8.8%2011.1%206%2011.1.9%208.8.9%206%203.2.9%206%20.9m0-1C2.7-.1-.1%202.7-.1%206s2.7%206.1%206.1%206.1%206.1-2.7%206.1-6.1S9.3-.1%206-.1z'%20fill='%23555'/%3e%3cpath%20d='M6%209V6v3m-1%201h2V5H5v5zm2-8H5v2h2z'%20class='st1'%20fill='%23555'/%3e%3c/svg%3e",uo=Object.defineProperty,pi=(e,t,i,s)=>{for(var o=void 0,r=e.length-1,n;r>=0;r--)(n=e[r])&&(o=n(t,i,o)||o);return o&&uo(t,i,o),o},Gt,pe=(Gt=class extends D{static parseLevel(e){if(e){let t=Object.keys(ue).find(i=>i.toLowerCase()===e.toLowerCase());return t&&ue[t]}}static get styles(){return[at`
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Yi=/'/g,Ji=/"/g,ts=/^(?:script|style|textarea|title)$/i,ci=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),A=ci(1),kr=ci(2),Sr=ci(3),ct=Symbol.for("lit-noChange"),v=Symbol.for("lit-nothing"),Zi=new WeakMap,Ct=Tt.createTreeWalker(Tt,129);function es(e,t){if(!di(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ki!==void 0?Ki.createHTML(t):t}var is=(e,t)=>{let i=e.length-1,s=[],o,r=t===2?"<svg>":t===3?"<math>":"",n=ae;for(let a=0;a<i;a++){let l=e[a],c,d,p=-1,f=0;for(;f<l.length&&(n.lastIndex=f,d=n.exec(l),d!==null);)f=n.lastIndex,n===ae?d[1]==="!--"?n=Gi:d[1]!==void 0?n=Xi:d[2]!==void 0?(ts.test(d[2])&&(o=RegExp("</"+d[2],"g")),n=It):d[3]!==void 0&&(n=It):n===It?d[0]===">"?(n=o??ae,p=-1):d[1]===void 0?p=-2:(p=n.lastIndex-d[2].length,c=d[1],n=d[3]===void 0?It:d[3]==='"'?Ji:Yi):n===Ji||n===Yi?n=It:n===Gi||n===Xi?n=ae:(n=It,o=void 0);let u=n===It&&e[a+1].startsWith("/>")?" ":"";r+=n===ae?l+so:p>=0?(s.push(c),l.slice(0,p)+ai+l.slice(p)+dt+u):l+dt+(p===-2?a:u)}return[es(e,r+(e[i]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]},ce=class e{constructor({strings:t,_$litType$:i},s){let o;this.parts=[];let r=0,n=0,a=t.length-1,l=this.parts,[c,d]=is(t,i);if(this.el=e.createElement(c,s),Ct.currentNode=this.el.content,i===2||i===3){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(o=Ct.nextNode())!==null&&l.length<a;){if(o.nodeType===1){if(o.hasAttributes())for(let p of o.getAttributeNames())if(p.endsWith(ai)){let f=d[n++],u=o.getAttribute(p).split(dt),y=/([.?@])?(.*)/.exec(f);l.push({type:1,index:r,name:y[2],strings:u,ctor:y[1]==="."?De:y[1]==="?"?Me:y[1]==="@"?Re:Pt}),o.removeAttribute(p)}else p.startsWith(dt)&&(l.push({type:6,index:r}),o.removeAttribute(p));if(ts.test(o.tagName)){let p=o.textContent.split(dt),f=p.length-1;if(f>0){o.textContent=Pe?Pe.emptyScript:"";for(let u=0;u<f;u++)o.append(p[u],le()),Ct.nextNode(),l.push({type:2,index:++r});o.append(p[f],le())}}}else if(o.nodeType===8)if(o.data===li)l.push({type:2,index:r});else{let p=-1;for(;(p=o.data.indexOf(dt,p+1))!==-1;)l.push({type:7,index:r}),p+=dt.length-1}r++}}static createElement(t,i){let s=Tt.createElement("template");return s.innerHTML=t,s}};function Lt(e,t,i=e,s){if(t===ct)return t;let o=s!==void 0?i._$Co?.[s]:i._$Cl,r=de(t)?void 0:t._$litDirective$;return o?.constructor!==r&&(o?._$AO?.(!1),r===void 0?o=void 0:(o=new r(e),o._$AT(e,i,s)),s!==void 0?(i._$Co??=[])[s]=o:i._$Cl=o),o!==void 0&&(t=Lt(e,o._$AS(e,t.values),o,s)),t}var Oe=class{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:i},parts:s}=this._$AD,o=(t?.creationScope??Tt).importNode(i,!0);Ct.currentNode=o;let r=Ct.nextNode(),n=0,a=0,l=s[0];for(;l!==void 0;){if(n===l.index){let c;l.type===2?c=new Kt(r,r.nextSibling,this,t):l.type===1?c=new l.ctor(r,l.name,l.strings,this,t):l.type===6&&(c=new Ne(r,this,t)),this._$AV.push(c),l=s[++a]}n!==l?.index&&(r=Ct.nextNode(),n++)}return Ct.currentNode=Tt,o}p(t){let i=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++}},Kt=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,o){this.type=2,this._$AH=v,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,i=this._$AM;return i!==void 0&&t?.nodeType===11&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=Lt(this,t,i),de(t)?t===v||t==null||t===""?(this._$AH!==v&&this._$AR(),this._$AH=v):t!==this._$AH&&t!==ct&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Qi(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!==v&&de(this._$AH)?this._$AA.nextSibling.data=t:this.T(Tt.createTextNode(t)),this._$AH=t}$(t){let{values:i,_$litType$:s}=t,o=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=ce.createElement(es(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===o)this._$AH.p(i);else{let r=new Oe(o,this),n=r.u(this.options);r.p(i),this.T(n),this._$AH=r}}_$AC(t){let i=Zi.get(t.strings);return i===void 0&&Zi.set(t.strings,i=new ce(t)),i}k(t){di(this._$AH)||(this._$AH=[],this._$AR());let i=this._$AH,s,o=0;for(let r of t)o===i.length?i.push(s=new e(this.O(le()),this.O(le()),this,this.options)):s=i[o],s._$AI(r),o++;o<i.length&&(this._$AR(s&&s._$AB.nextSibling,o),i.length=o)}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(!1,!0,i);t!==this._$AB;){let s=t.nextSibling;t.remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},Pt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,o,r){this.type=1,this._$AH=v,this._$AN=void 0,this.element=t,this.name=i,this._$AM=o,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=v}_$AI(t,i=this,s,o){let r=this.strings,n=!1;if(r===void 0)t=Lt(this,t,i,0),n=!de(t)||t!==this._$AH&&t!==ct,n&&(this._$AH=t);else{let a=t,l,c;for(t=r[0],l=0;l<r.length-1;l++)c=Lt(this,a[s+l],i,l),c===ct&&(c=this._$AH[l]),n||=!de(c)||c!==this._$AH[l],c===v?t=v:t!==v&&(t+=(c??"")+r[l+1]),this._$AH[l]=c}n&&!o&&this.j(t)}j(t){t===v?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},De=class extends Pt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===v?void 0:t}},Me=class extends Pt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==v)}},Re=class extends Pt{constructor(t,i,s,o,r){super(t,i,s,o,r),this.type=5}_$AI(t,i=this){if((t=Lt(this,t,i,0)??v)===ct)return;let s=this._$AH,o=t===v&&s!==v||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==v&&(s===v||o);o&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},Ne=class{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){Lt(this,t)}},ss={M:ai,P:dt,A:li,C:1,L:is,R:Oe,D:Qi,V:Lt,I:Kt,H:Pt,N:Me,U:Re,B:De,F:Ne},oo=ni.litHtmlPolyfillSupport;oo?.(ce,Kt),(ni.litHtmlVersions??=[]).push("3.3.1");var os=(e,t,i)=>{let s=i?.renderBefore??t,o=s._$litPart$;if(o===void 0){let r=i?.renderBefore??null;s._$litPart$=o=new Kt(t.insertBefore(le(),r),r,void 0,i??{})}return o._$AI(e),o};var hi=globalThis,D=class extends lt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=os(i,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return ct}};D._$litElement$=!0,D.finalized=!0,hi.litElementHydrateSupport?.({LitElement:D});var ro=hi.litElementPolyfillSupport;ro?.({LitElement:D});(hi.litElementVersions??=[]).push("4.2.1");var no={attribute:!0,type:String,converter:ne,reflect:!1,hasChanged:Le},ao=(e=no,t,i)=>{let{kind:s,metadata:o}=i,r=globalThis.litPropertyMetadata.get(o);if(r===void 0&&globalThis.litPropertyMetadata.set(o,r=new Map),s==="setter"&&((e=Object.create(e)).wrapped=!0),r.set(i.name,e),s==="accessor"){let{name:n}=i;return{set(a){let l=t.get.call(this);t.set.call(this,a),this.requestUpdate(n,l,e)},init(a){return a!==void 0&&this.C(n,void 0,e,a),a}}}if(s==="setter"){let{name:n}=i;return function(a){let l=this[n];t.call(this,a),this.requestUpdate(n,l,e)}}throw Error("Unsupported decorator location: "+s)};function h(e){return(t,i)=>typeof i=="object"?ao(e,t,i):((s,o,r)=>{let n=o.hasOwnProperty(r);return o.constructor.createProperty(r,s),n?Object.getOwnPropertyDescriptor(o,r):void 0})(e,t,i)}var M=e=>e??v;var lo=":host{display:inline-block;font-size:13px;line-height:20px;font-family:Segoe UI,Lucida Sans,Arial,sans-serif;color:#111;contain:content}:host([hidden]){display:none!important}:host([level=warn i]){color:#555}:host([level=suggest i]){color:#bf8800}:host([level=error i]){color:#cc0017}:host([level=warn]){color:#555}:host([level=suggest]){color:#bf8800}:host([level=error]){color:#cc0017}.icon{height:12px;width:12px;padding-right:4px;margin-bottom:-1px}",co="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2012%2012'%3e%3cstyle%20id='style3'%3e%20.st0{fill:%23fff}.st1{fill:%23c00}%20%3c/style%3e%3cg%20id='g5'%3e%3cpath%20class='st1'%20d='M6%20.9c2.8%200%205.1%202.3%205.1%205.1S8.8%2011.1%206%2011.1.9%208.8.9%206%203.2.9%206%20.9m0-1C2.7-.1-.1%202.7-.1%206s2.7%206.1%206.1%206.1%206.1-2.7%206.1-6.1S9.3-.1%206-.1z'%20id='path9'/%3e%3c/g%3e%3cg%20id='g11'%3e%3cpath%20class='st0'%20id='rect13'%20d='M5.5%202.5h1v4h-1z'/%3e%3cpath%20class='st1'%20d='M6%203v3-3m1-1H5v5h2V2z'%20id='path15'/%3e%3c/g%3e%3cg%20id='g17'%3e%3cpath%20class='st0'%20id='rect19'%20d='M5.5%208.5h1v1h-1z'/%3e%3cpath%20class='st1'%20id='polygon21'%20d='M7%208H5v2h2V8z'/%3e%3c/g%3e%3c/svg%3e",ho="data:image/svg+xml,%3csvg%20id='Ebene_1'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cstyle%3e%20.st0{fill:%23bf8800}%20%3c/style%3e%3cpath%20class='st0'%20d='M12%20.8l11%2019.8v1.3H1v-1.3L12%20.8zm.8-.6h-1.6L0%2020v3h24v-3L12.8.2z'/%3e%3cpath%20class='st0'%20d='M11%208h2v8h-2zm0%2010h2v2h-2z'/%3e%3c/svg%3e",po="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2012%2012'%3e%3cpath%20class='st1'%20d='M6%20.9c2.8%200%205.1%202.3%205.1%205.1S8.8%2011.1%206%2011.1.9%208.8.9%206%203.2.9%206%20.9m0-1C2.7-.1-.1%202.7-.1%206s2.7%206.1%206.1%206.1%206.1-2.7%206.1-6.1S9.3-.1%206-.1z'%20fill='%23555'/%3e%3cpath%20d='M6%209V6v3m-1%201h2V5H5v5zm2-8H5v2h2z'%20class='st1'%20fill='%23555'/%3e%3c/svg%3e",uo=Object.defineProperty,pi=(e,t,i,s)=>{for(var o=void 0,r=e.length-1,n;r>=0;r--)(n=e[r])&&(o=n(t,i,o)||o);return o&&uo(t,i,o),o},Gt,pe=(Gt=class extends D{static parseLevel(e){if(e){let t=Object.keys(ue).find(i=>i.toLowerCase()===e.toLowerCase());return t&&ue[t]}}static get styles(){return[at`
4
4
  ${X(lo)}
5
- `]}render(){return A`${this.iconToUse&&A`<img class="icon" src="${this.iconToUse}">`}${this.message}`}get iconToUse(){return this.icon||this._defaultIconPath}shouldUpdate(e){return e.has("level")&&(this._defaultIconPath=this.iconForLevel,!this.icon)?!0:super.shouldUpdate(e)}get iconForLevel(){switch(Gt.parseLevel(this.level)){case"warn":return po;case"suggest":return ho;case"error":return co;default:return null}}},Gt.ID="sd-field-validation-message",Gt.levelConverter={fromAttribute(e){return Gt.parseLevel(e)},toAttribute(e){return e&&e.toLowerCase()}},Gt);pi([h({type:String,attribute:!0})],pe.prototype,"message");pi([h({type:String,attribute:!0})],pe.prototype,"icon");pi([h({converter:pe.levelConverter,reflect:!0})],pe.prototype,"level");var he=pe,ue=(e=>(e.Warn="warn",e.Suggest="suggest",e.Error="error",e))(ue||{});customElements.get(he.ID)||customElements.define(he.ID,he);var fo=":host{display:inline-flex;position:relative;cursor:text;font-family:Segoe UI,Lucida Sans,Arial,sans-serif;font-size:16px;color:#111;contain:layout style;flex-direction:column}:host([hidden]),:host([type=hidden]){display:none!important}:host([effective-disabled]){opacity:.6;cursor:default;filter:grayscale(100%)}:host([effective-disabled]) .unfocused-line,:host([effective-disabled]) .focused-line{border-bottom-style:dashed}:host(:not([effective-disabled]):focus) .focused-line,:host(:not([effective-disabled])[focused]) .focused-line{transform:none;transition:transform .25s}:host(:not([effective-disabled]):focus) .label.float,:host(:not([effective-disabled])[focused]) .label.float{color:var(--sd-input-focused-color, #1467ba)}:host([inactive]) .input{pointer-events:none}:host([effective-disabled]:focus),:host([effective-disabled][focused]){box-shadow:0 0 0 1px #111}:host(:not([effective-disabled])[validationlevel]) .focused-line,:host(:not([effective-disabled]):invalid) .focused-line{transform:none;transition:transform .25s}:host([validationlevel=warn i]) .focused-line{border-bottom-color:var(--sd-input-validation-color, #555555)}:host([validationlevel=warn i]) .label,:host([validationlevel=warn i]) .validation-message{color:var(--sd-input-validation-color, #555555)!important}:host([validationlevel=suggest i]) .focused-line{border-bottom-color:var(--sd-input-validation-color, #bf8800)}:host([validationlevel=suggest i]) .label,:host([validationlevel=suggest i]) .validation-message{color:var(--sd-input-validation-color, #bf8800)!important}:host([validationlevel=error i]) .focused-line,:host(:not([validationlevel]):invalid) .focused-line{border-bottom-color:var(--sd-input-validation-color, #cc0017)}:host([validationlevel=error i]) .label,:host([validationlevel=error i]) .validation-message,:host(:not([validationlevel]):invalid) .label,:host(:not([validationlevel]):invalid) .validation-message{color:var(--sd-input-validation-color, #cc0017)!important}.validation-message-wrapper{min-height:var(--sd-input-validation-message-minheight, 0px);position:relative;font-size:0}.validation-message{position:relative;position:var(--sd-input-validation-message-minheight, absolute);left:0;right:0}.label.float{transform:translateY(-75%) scale(.75);width:133%}.label:not(.float){max-width:100%}.floated-label-placeholder{height:20px;width:100%}.label{position:absolute;top:0;left:0;line-height:24px;pointer-events:none;color:var(--sd-input-color, #767676);transition:transform .25s,width .25s;transform-origin:left top}.input-wrapper{position:relative;display:flex;flex-direction:row;align-items:center;background-color:var(--input-wrapper-background-color)}:host([extended-prefix]:focus-within:not([effective-disabled])) .input-wrapper{flex-direction:column;align-items:baseline}:host([extended-prefix]:focus-within:not([effective-disabled])) .input-container{width:100%}:host([extended-prefix]:not(:focus-within)) .input-container,:host([extended-prefix][effective-disabled]) .input-container{width:0px}.input-container{line-height:var(--sd-input-line-height, 24px);flex:1 1 auto}.input{width:100%;background:var(--sd-input-background, transparent);font-family:inherit;font-size:inherit;text-align:inherit;color:inherit;border:none;outline:none;resize:none;padding-left:0;padding-right:0}.input:-webkit-autofill{animation-name:onautofillstart}.input:not(:-webkit-autofill){animation-name:onautofillcancel}@keyframes onautofillstart{0%{outline:none}}@keyframes onautofillcancel{0%{outline:none}}.label,input.input{text-overflow:ellipsis;overflow-x:hidden;white-space:nowrap}.validation-message{text-overflow:ellipsis;overflow-x:hidden;white-space:normal;white-space:var(--sd-input-validation-message-minheight, nowrap)}.input::placeholder{color:var(--sd-input-color, #767676)}.underline{height:2px;width:100%;position:relative}.unfocused-line,.focused-line{position:absolute;inset:0}.unfocused-line{border-bottom:1px solid var(--sd-input-underline-color, #959595)}.focused-line{border-bottom:2px solid var(--sd-input-focused-color, #1467ba);transform-origin:center center;transform:scale3d(0,1,1)}.prefix,.suffix{display:flex;flex-wrap:nowrap;max-width:100%}.prefix ::slotted(*),.suffix ::slotted(*){display:flex}",mo=Object.defineProperty,$=(e,t,i,s)=>{for(var o=void 0,r=e.length-1,n;r>=0;r--)(n=e[r])&&(o=n(t,i,o)||o);return o&&mo(t,i,o),o},vo="sd-lit-input",rs="delegatesFocus"in window.ShadowRoot.prototype,go=0,nt,k=(nt=class extends D{constructor(){super(),this.rows=1,this.effectiveDisabled=!1,this.type="text",this.autocomplete="off";let e=go++;this._validationMessageId=nt.ID+"_message_"+e,this._inputId=nt.ID+"_input_"+e,this.attachInternals&&!this.activeShadyDOM&&(this._internals=this.attachInternals())}connectedCallback(){super.connectedCallback(),this.hasAttribute("tabIndex")||(this.tabIndex=0)}firstUpdated(e){super.firstUpdated(e),this.initAutocompleted(this.inputElement),this.updateInitialValue(),this.updateFormValidity(),this.hasAttribute("disabled")&&(this.disabled=!0),this.inputElement.oninput=t=>{this.autocompleted=t.inputType==="insertReplacementText"||!("data"in t),this.currentText=this.inputElement.value,this.fireValueChange(!0)},this.inputElement.onchange=()=>this.fireValueChange(),rs||(this.inputElement.onfocus=()=>this.setAttribute("focused",""),this.inputElement.onblur=()=>this.removeAttribute("focused"),this.addEventListener("focus",t=>{t.target===this&&this.inputElement.focus()})),this.inputElement.addEventListener("keyup",()=>{this.updateFormValidity()}),this.addEventListener("keydown",t=>{t.key=="Enter"&&this._internals?.form?.requestSubmit()}),this._initialized=!0}initAutocompleted(e){let t=i=>{/^onautofillstart(-sd-lit-input-\d+|\s?)$/.test(i.animationName)?this.autocompleted=!0:/^onautofillcancel(-sd-lit-input-\d+|\s?)$/.test(i.animationName)&&(this.autocompleted=!1)};this.activeShadyDOM?(this._needsAutocompletedCheck=!0,this.activeShadyDOM.nativeMethods.addEventListener.call(e,"animationstart",t)):e.addEventListener("animationstart",t)}get activeShadyDOM(){let e=window.ShadyDOM;return e&&e.inUse?e:null}updateInitialValue(){typeof this.currentText<"u"?this.value=this.currentText:this.value=this.getAttribute("value"),this.value&&(this.currentText=this.inputElement.value),this._initialValue=this.value}get disabled(){return this.hasAttribute("disabled")}set disabled(e){e?this.setAttribute("disabled",""):this.removeAttribute("disabled"),this._internals||(this.effectiveDisabled=e)}get inputElement(){return this.shadowRoot&&!this._inputElement&&(this._inputElement=this.shadowRoot.querySelector(".input")),this._inputElement}get value(){return this.inputElement&&this.inputElement.value}set value(e){this.currentText=e||"",this.inputElement&&(this.inputElement.value=this.currentText),this.setFormValue(this.currentText)}get selectionStart(){return this.inputElement?this.inputElement.selectionStart:0}focus(){this.inputElement?this.inputElement.focus():super.focus()}select(){this.inputElement&&this.inputElement.select()}setSelectionRange(e,t){this.updateComplete.then(()=>{this.inputElement&&this.inputElement.setSelectionRange(e,t)})}static get styles(){return[at`
5
+ `]}render(){return A`${this.iconToUse&&A`<img class="icon" src="${this.iconToUse}">`}${this.message}`}get iconToUse(){return this.icon||this._defaultIconPath}shouldUpdate(e){return e.has("level")&&(this._defaultIconPath=this.iconForLevel,!this.icon)?!0:super.shouldUpdate(e)}get iconForLevel(){switch(Gt.parseLevel(this.level)){case"warn":return po;case"suggest":return ho;case"error":return co;default:return null}}},Gt.ID="sd-field-validation-message",Gt.levelConverter={fromAttribute(e){return Gt.parseLevel(e)},toAttribute(e){return e&&e.toLowerCase()}},Gt);pi([h({type:String,attribute:!0})],pe.prototype,"message");pi([h({type:String,attribute:!0})],pe.prototype,"icon");pi([h({converter:pe.levelConverter,reflect:!0})],pe.prototype,"level");var he=pe,ue=(e=>(e.Warn="warn",e.Suggest="suggest",e.Error="error",e))(ue||{});customElements.get(he.ID)||customElements.define(he.ID,he);var fo=":host{display:inline-flex;position:relative;cursor:text;font-family:Segoe UI,Lucida Sans,Arial,sans-serif;font-size:16px;color:#111;contain:layout style;flex-direction:column}:host([hidden]),:host([type=hidden]){display:none!important}:host([effective-disabled]){opacity:.6;cursor:default;filter:grayscale(100%)}:host([effective-disabled]) .unfocused-line,:host([effective-disabled]) .focused-line{border-bottom-style:dashed}:host(:not([effective-disabled]):focus) .focused-line,:host(:not([effective-disabled])[focused]) .focused-line{transform:none;transition:transform .25s}:host(:not([effective-disabled]):focus) .label.float,:host(:not([effective-disabled])[focused]) .label.float{color:var(--sd-input-focused-color, #1467ba)}:host([inactive]) .input{pointer-events:none}:host([effective-disabled]:focus),:host([effective-disabled][focused]){box-shadow:0 0 0 1px #111}:host(:not([effective-disabled])[validationlevel]) .focused-line,:host(:not([effective-disabled]):invalid) .focused-line{transform:none;transition:transform .25s}:host([validationlevel=warn i]) .focused-line{border-bottom-color:var(--sd-input-validation-color, #555555)}:host([validationlevel=warn i]) .label,:host([validationlevel=warn i]) .validation-message{color:var(--sd-input-validation-color, #555555)!important}:host([validationlevel=suggest i]) .focused-line{border-bottom-color:var(--sd-input-validation-color, #bf8800)}:host([validationlevel=suggest i]) .label,:host([validationlevel=suggest i]) .validation-message{color:var(--sd-input-validation-color, #bf8800)!important}:host([validationlevel=error i]) .focused-line,:host(:not([validationlevel]):invalid) .focused-line{border-bottom-color:var(--sd-input-validation-color, #cc0017)}:host([validationlevel=error i]) .label,:host([validationlevel=error i]) .validation-message,:host(:not([validationlevel]):invalid) .label,:host(:not([validationlevel]):invalid) .validation-message{color:var(--sd-input-validation-color, #cc0017)!important}.validation-message-wrapper{min-height:var(--sd-input-validation-message-minheight, 0px);position:relative;font-size:0}.validation-message{position:relative;position:var(--sd-input-validation-message-minheight, absolute);left:0;right:0}.label.float{transform:translateY(-75%) scale(.75);width:133%}.label:not(.float){max-width:100%}.floated-label-placeholder{height:20px;width:100%}.label{position:absolute;top:0;left:0;line-height:24px;pointer-events:none;color:var(--sd-input-color, #767676);transition:transform .25s,width .25s;transform-origin:left top}.input-wrapper{position:relative;display:flex;flex-direction:row;align-items:center;background-color:var(--input-wrapper-background-color)}:host([extended-prefix]:focus-within:not([effective-disabled])) .input-wrapper{flex-direction:column;align-items:baseline}:host([extended-prefix]:focus-within:not([effective-disabled])) .input-container{width:100%}:host([extended-prefix]:not(:focus-within)) .input-container,:host([extended-prefix][effective-disabled]) .input-container{width:0px}.input-container{line-height:var(--sd-input-line-height, 24px);flex:1 1 auto}.input{width:100%;background:var(--sd-input-background, transparent);font-family:inherit;font-size:inherit;text-align:inherit;color:inherit;border:none;outline:none;resize:none;padding-left:0;padding-right:0}.input:-webkit-autofill{animation-name:onautofillstart}.input:not(:-webkit-autofill){animation-name:onautofillcancel}@keyframes onautofillstart{0%{outline:none}}@keyframes onautofillcancel{0%{outline:none}}.label,input.input{text-overflow:ellipsis;overflow-x:hidden;white-space:nowrap}.validation-message{text-overflow:ellipsis;overflow-x:hidden;white-space:normal;white-space:var(--sd-input-validation-message-minheight, nowrap)}.input::placeholder{color:var(--sd-input-color, #767676)}.underline{height:2px;width:100%;position:relative}.unfocused-line,.focused-line{position:absolute;inset:0}.unfocused-line{border-bottom:1px solid var(--sd-input-underline-color, #959595)}.focused-line{border-bottom:2px solid var(--sd-input-focused-color, #1467ba);transform-origin:center center;transform:scale3d(0,1,1)}.prefix,.suffix{display:flex;flex-wrap:nowrap;max-width:100%}.prefix ::slotted(*),.suffix ::slotted(*){display:flex}",mo=Object.defineProperty,$=(e,t,i,s)=>{for(var o=void 0,r=e.length-1,n;r>=0;r--)(n=e[r])&&(o=n(t,i,o)||o);return o&&mo(t,i,o),o},vo="sd-lit-input",rs="delegatesFocus"in window.ShadowRoot.prototype,go=0,nt,k=(nt=class extends D{constructor(){super(),this.rows=1,this.effectiveDisabled=!1,this.type="text",this.autocomplete="off";let e=go++;this._validationMessageId=nt.ID+"_message_"+e,this._inputId=nt.ID+"_input_"+e,this.attachInternals&&!this.activeShadyDOM&&(this._internals=this.attachInternals())}connectedCallback(){super.connectedCallback(),this.hasAttribute("tabIndex")||(this.tabIndex=0)}firstUpdated(e){super.firstUpdated(e),this.initAutocompleted(this.inputElement),this.updateInitialValue(),this.updateFormValidity(),this.hasAttribute("disabled")&&(this.disabled=!0),this.inputElement.oninput=t=>{this.autocompleted=t.inputType==="insertReplacementText"||!("data"in t),this.currentText=this.inputElement.value,this.fireValueChange(!0)},this.inputElement.onchange=()=>this.fireValueChange(),rs||(this.inputElement.onfocus=()=>this.setAttribute("focused",""),this.inputElement.onblur=()=>this.removeAttribute("focused"),this.addEventListener("focus",t=>{t.target===this&&this.inputElement.focus()})),this.inputElement.addEventListener("keyup",()=>{this.updateFormValidity()}),this.addEventListener("keydown",t=>{this.rows==1&&t.key=="Enter"&&this._internals?.form?.requestSubmit()}),this._initialized=!0}initAutocompleted(e){let t=i=>{/^onautofillstart(-sd-lit-input-\d+|\s?)$/.test(i.animationName)?this.autocompleted=!0:/^onautofillcancel(-sd-lit-input-\d+|\s?)$/.test(i.animationName)&&(this.autocompleted=!1)};this.activeShadyDOM?(this._needsAutocompletedCheck=!0,this.activeShadyDOM.nativeMethods.addEventListener.call(e,"animationstart",t)):e.addEventListener("animationstart",t)}get activeShadyDOM(){let e=window.ShadyDOM;return e&&e.inUse?e:null}updateInitialValue(){typeof this.currentText<"u"?this.value=this.currentText:this.value=this.getAttribute("value"),this.value&&(this.currentText=this.inputElement.value),this._initialValue=this.value}get disabled(){return this.hasAttribute("disabled")}set disabled(e){e?this.setAttribute("disabled",""):this.removeAttribute("disabled"),this._internals||(this.effectiveDisabled=e)}get inputElement(){return this.shadowRoot&&!this._inputElement&&(this._inputElement=this.shadowRoot.querySelector(".input")),this._inputElement}get value(){return this.inputElement&&this.inputElement.value}set value(e){this.currentText=e||"",this.inputElement&&(this.inputElement.value=this.currentText),this.setFormValue(this.currentText)}get selectionStart(){return this.inputElement?this.inputElement.selectionStart:0}focus(){this.inputElement?this.inputElement.focus():super.focus()}select(){this.inputElement&&this.inputElement.select()}setSelectionRange(e,t){this.updateComplete.then(()=>{this.inputElement&&this.inputElement.setSelectionRange(e,t)})}static get styles(){return[at`
6
6
  ${X(fo)}
7
7
  `]}render(){let e,t=this.validationMessage||this.inputElement?.validationMessage,i=t||this.validationLevel!=null;return this.rows===1?e=A`
8
8
  <input
@@ -42,7 +42,7 @@ var window;(window||={})["@cas-smartdesign/token-selector"]=(()=>{var ii=Object.
42
42
  aria-label=${M(this.sdAriaLabel||void 0)}
43
43
  ></textarea>
44
44
  `,A`
45
- ${this.label?A` <div class="floated-label-placeholder" aria-hidden="true">&nbsp;</div> `:g}
45
+ ${this.label?A` <div class="floated-label-placeholder" aria-hidden="true">&nbsp;</div> `:v}
46
46
  <div class="input-wrapper">
47
47
  <span class="prefix"><slot name="prefix"></slot></span>
48
48
  <div class="input-container" style="position:${this.shouldFloat()?"static":"relative"};">
@@ -71,7 +71,7 @@ var window;(window||={})["@cas-smartdesign/token-selector"]=(()=>{var ii=Object.
71
71
  </sd-field-validation-message>
72
72
  `}
73
73
  </div>
74
- `}updated(e){super.updated(e),this._needsAutocompletedCheck&&!this.autocompleted&&setTimeout(()=>{try{this.autocompleted=this.autocompleted||!!this.shadowRoot.querySelector(":-webkit-autofill")}catch{}},0),this.rows>1&&((e.has("min")||e.has("max")||e.has("pattern"))&&console.warn("min, max & pattern attributes are not supported with multiple rows configuration."),this.type!="text"&&console.warn(`type: ${this.type} is not supported with multiple rows configuration.`))}update(e){if(super.update(e),e.has("validationMessage")&&(this.validationMessage?this._internals?.setValidity({customError:!0},this.validationMessage):this._internals?.setValidity(this.inputElement.validity,this.inputElement.validationMessage)),this._initialized&&e.has("rows"))throw Error("rows attribute cannot be changed after the input is attached to the DOM")}fireValueChange(e){this.dispatchEvent(new CustomEvent(`${e?"immediate-":""}value-change`,{detail:{value:this.value}})),this.setFormValue(this.value)}updateFormValidity(){if(this.validationMessage==null&&this.inputElement!=null){this._internals.setValidity(this.inputElement.validity,this.inputElement.validationMessage);let e=this.shadowRoot.querySelector("sd-field-validation-message");this.requestUpdate("validationMessage",e==null?null:e.message)}}shouldFloat(){return this.alwaysFloatLabel||this.currentText||this.placeholder||this.autocompleted||this.type==="date"}setFormValue(e){this._internals?.setFormValue(e),this.updateFormValidity()}formResetCallback(){this.value=this._initialValue}formDisabledCallback(e){this.effectiveDisabled=e||this.hasAttribute("disabled")}formAssociatedCallback(e){this._needsAutocompletedCheck=!0}formStateRestoreCallback(e,t){typeof e=="string"&&(this.value=e)}},nt.ID=vo,nt.DEFAULT_MAX_LENGTH=524288,nt.formAssociated=!0,nt.shadowRootOptions={...D.shadowRootOptions,delegatesFocus:rs},nt);$([h({type:String,reflect:!0})],k.prototype,"label");$([h({type:String,attribute:!0})],k.prototype,"validationMessage");$([h({type:String,attribute:!0})],k.prototype,"validationIconSrc");$([h({type:ue,attribute:!0,reflect:!0})],k.prototype,"validationLevel");$([h({type:String,hasChanged(e,t){return t!=null&&t!=e}})],k.prototype,"currentText");$([h({type:Boolean,attribute:!0})],k.prototype,"alwaysFloatLabel");$([h({type:Boolean,attribute:!0})],k.prototype,"autocompleted");$([h({type:Number,attribute:!0})],k.prototype,"rows");$([h({type:Boolean,reflect:!0,attribute:"effective-disabled"})],k.prototype,"effectiveDisabled");$([h({type:Boolean,reflect:!0,attribute:"extended-prefix"})],k.prototype,"extendedPrefix");$([h({type:String,reflect:!0})],k.prototype,"type");$([h({type:String,reflect:!0})],k.prototype,"placeholder");$([h({type:String,reflect:!0})],k.prototype,"sdAriaLabel");$([h({type:Number,reflect:!0})],k.prototype,"maxlength");$([h({type:Boolean,reflect:!0})],k.prototype,"readonly");$([h({type:Boolean,reflect:!0})],k.prototype,"required");$([h({type:String,reflect:!0})],k.prototype,"name");$([h({type:Boolean,reflect:!0})],k.prototype,"inactive");$([h({type:String,attribute:!0})],k.prototype,"autocomplete");$([h({type:String,attribute:!0})],k.prototype,"min");$([h({type:String,attribute:!0})],k.prototype,"max");$([h({type:String,attribute:!0})],k.prototype,"pattern");var ui=k;customElements.get(ui.ID)||customElements.define(ui.ID,ui);var Yt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Ot=e=>(...t)=>({_$litDirective$:e,values:t}),Xt=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,i,s){this._$Ct=t,this._$AM=i,this._$Ci=s}_$AS(t,i){return this.update(t,i)}update(t,i){return this.render(...i)}};var Dt=class extends Xt{constructor(t){if(super(t),this.it=g,t.type!==Yt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===g||t==null)return this._t=void 0,this.it=t;if(t===ct)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;let i=[t];return i.raw=i,this._t={_$litType$:this.constructor.resultType,strings:i,values:[]}}};Dt.directiveName="unsafeHTML",Dt.resultType=1;var ns=Ot(Dt);var{I:hn}=ss;var as=e=>e.strings===void 0;var fe=(e,t)=>{let i=e._$AN;if(i===void 0)return!1;for(let s of i)s._$AO?.(t,!1),fe(s,t);return!0},He=e=>{let t,i;do{if((t=e._$AM)===void 0)break;i=t._$AN,i.delete(e),e=t}while(i?.size===0)},ls=e=>{for(let t;t=e._$AM;e=t){let i=t._$AN;if(i===void 0)t._$AN=i=new Set;else if(i.has(e))break;i.add(e),xo(t)}};function bo(e){this._$AN!==void 0?(He(this),this._$AM=e,ls(this)):this._$AM=e}function yo(e,t=!1,i=0){let s=this._$AH,o=this._$AN;if(o!==void 0&&o.size!==0)if(t)if(Array.isArray(s))for(let r=i;r<s.length;r++)fe(s[r],!1),He(s[r]);else s!=null&&(fe(s,!1),He(s));else fe(this,e)}var xo=e=>{e.type==Yt.CHILD&&(e._$AP??=yo,e._$AQ??=bo)},Ue=class extends Xt{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,i,s){super._$AT(t,i,s),ls(this),this.isConnected=t._$AU}_$AO(t,i=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),i&&(fe(this,t),He(this))}setValue(t){if(as(this._$Ct))this._$Ct._$AI(t,this);else{let i=[...this._$Ct._$AH];i[this._$Ci]=t,this._$Ct._$AI(i,this,0)}}disconnected(){}reconnected(){}};var ds=e=>e?e.startsWith("url")?e:`url("${e}")`:null,wo=(e,t)=>{if(e){let i=new Image;i.addEventListener("load",t),i.src=e,i.complete&&(i.removeEventListener("load",t),window.queueMicrotask(()=>t()))}};var fi=class extends Ue{constructor(t){if(super(t),t.type!==Yt.ATTRIBUTE||t.name!=="src"&&t.name!=="style")throw new Error("The `placeholder` directive must be used in the `src` or `style` attributes")}update(t,[i,s]){return this.useCssBackground=t.name=="style",this.render(i,s)}render(t,i){this.loadingToken!=null&&(this.loadingToken.cancelled=!0);let s={cancelled:!1};return this.loadingToken=s,typeof t=="string"?this.preload(t,s):t?.then(o=>{this.preload(o,s)}),this.useCssBackground?ds(i):i}preload(t,i){t!=null&&!i.cancelled&&wo(t,()=>{i.cancelled||this.setValue(this.useCssBackground?ds(t):t)})}},Be=Ot(fi);var _o=':host{display:block;contain:strict;height:50px}:host([selected]){background-color:#d3e6fa}:host(:not([selected]):hover),:host(:not([selected])[focused]){background-color:#e7f1fa}@media (forced-colors: active){:host([selected]){outline:4px solid}:host(:not([selected]):hover){outline:4px dotted}:host(:not([selected])[focused]){outline:4px dashed}}:host([enable-line-clamp]) .labels>:only-child{display:-webkit-box;overflow:hidden;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:normal;overflow-wrap:break-word}.container{display:flex;height:100%;box-sizing:border-box}.container .level-indicator{width:7px;height:100%}.container .level-indicator.level-0{background-color:#a0c3ef}.container .level-indicator.level-1{background-color:#e7c374}.container .level-indicator.level-2{background-color:#bfd596}.container .level-indicator.level-3{background-color:#fd998d}.container .level-indicator.level-4{background-color:#c6e8f5}.container .level-indicator.level-5{background-color:#fde3a4}.container .level-indicator.level-6{background-color:#dcbfe0}.side-content{display:flex;align-items:center;flex-grow:0}.labels{display:flex;flex-direction:column;justify-content:center;flex:1 1 0px;height:100%;line-height:normal;overflow:hidden;padding:var(--sd-list-item-label-content-padding, 0 8px)}.caption,.description{width:100%;font-family:var(--sd-list-item-font-family, "Segoe UI", "Lucida Sans", Arial, sans-serif);font-style:normal;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;-webkit-user-select:none;user-select:none;text-decoration:var(--sd-list-item-text-decoration, inherit)}.caption em,.description em{font-weight:bolder}.caption{font-size:var(--sd-list-item-caption-font-size, 16px);color:var(--sd-list-item-caption-text-color, #111);font-weight:var(--sd-list-item-caption-font-weight, normal)}.description{font-size:var(--sd-list-item-description-font-size, 13px);color:var(--sd-list-item-description-text-color, #767676);font-weight:var(--sd-list-item-description-font-weight, normal)}.icon-wrapper{width:var(--sd-list-item-icon-wrapper-width, 45px);height:100%;display:flex;align-items:center;justify-content:center}.icon-wrapper .icon{min-height:var(--sd-list-item-icon-size, 24px);min-width:var(--sd-list-item-icon-size, 24px);background-repeat:no-repeat;background-position:center;background-size:cover}',Ao=Object.defineProperty,j=(e,t,i,s)=>{for(var o=void 0,r=e.length-1,n;r>=0;r--)(n=e[r])&&(o=n(t,i,o)||o);return o&&Ao(t,i,o),o},Mt,F=(Mt=class extends D{constructor(){super(...arguments),this.contentMode="text",this.role="option"}static get styles(){return[at`
74
+ `}updated(e){super.updated(e),this._needsAutocompletedCheck&&!this.autocompleted&&setTimeout(()=>{try{this.autocompleted=this.autocompleted||!!this.shadowRoot.querySelector(":-webkit-autofill")}catch{}},0),this.rows>1&&((e.has("min")||e.has("max")||e.has("pattern"))&&console.warn("min, max & pattern attributes are not supported with multiple rows configuration."),this.type!="text"&&console.warn(`type: ${this.type} is not supported with multiple rows configuration.`))}update(e){if(super.update(e),e.has("validationMessage")&&(this.validationMessage?this._internals?.setValidity({customError:!0},this.validationMessage):this._internals?.setValidity(this.inputElement.validity,this.inputElement.validationMessage)),this._initialized&&e.has("rows"))throw Error("rows attribute cannot be changed after the input is attached to the DOM")}fireValueChange(e){this.dispatchEvent(new CustomEvent(`${e?"immediate-":""}value-change`,{detail:{value:this.value}})),this.setFormValue(this.value)}updateFormValidity(){if(this.validationMessage==null&&this.inputElement!=null){this._internals.setValidity(this.inputElement.validity,this.inputElement.validationMessage);let e=this.shadowRoot.querySelector("sd-field-validation-message");this.requestUpdate("validationMessage",e==null?null:e.message)}}shouldFloat(){return this.alwaysFloatLabel||this.currentText||this.placeholder||this.autocompleted||this.type==="date"}setFormValue(e){this._internals?.setFormValue(e),this.updateFormValidity()}formResetCallback(){this.value=this._initialValue}formDisabledCallback(e){this.effectiveDisabled=e||this.hasAttribute("disabled")}formAssociatedCallback(e){this._needsAutocompletedCheck=!0}formStateRestoreCallback(e,t){typeof e=="string"&&(this.value=e)}},nt.ID=vo,nt.DEFAULT_MAX_LENGTH=524288,nt.formAssociated=!0,nt.shadowRootOptions={...D.shadowRootOptions,delegatesFocus:rs},nt);$([h({type:String,reflect:!0})],k.prototype,"label");$([h({type:String,attribute:!0})],k.prototype,"validationMessage");$([h({type:String,attribute:!0})],k.prototype,"validationIconSrc");$([h({type:ue,attribute:!0,reflect:!0})],k.prototype,"validationLevel");$([h({type:String,hasChanged(e,t){return t!=null&&t!=e}})],k.prototype,"currentText");$([h({type:Boolean,attribute:!0})],k.prototype,"alwaysFloatLabel");$([h({type:Boolean,attribute:!0})],k.prototype,"autocompleted");$([h({type:Number,attribute:!0})],k.prototype,"rows");$([h({type:Boolean,reflect:!0,attribute:"effective-disabled"})],k.prototype,"effectiveDisabled");$([h({type:Boolean,reflect:!0,attribute:"extended-prefix"})],k.prototype,"extendedPrefix");$([h({type:String,reflect:!0})],k.prototype,"type");$([h({type:String,reflect:!0})],k.prototype,"placeholder");$([h({type:String,reflect:!0})],k.prototype,"sdAriaLabel");$([h({type:Number,reflect:!0})],k.prototype,"maxlength");$([h({type:Boolean,reflect:!0})],k.prototype,"readonly");$([h({type:Boolean,reflect:!0})],k.prototype,"required");$([h({type:String,reflect:!0})],k.prototype,"name");$([h({type:Boolean,reflect:!0})],k.prototype,"inactive");$([h({type:String,attribute:!0})],k.prototype,"autocomplete");$([h({type:String,attribute:!0})],k.prototype,"min");$([h({type:String,attribute:!0})],k.prototype,"max");$([h({type:String,attribute:!0})],k.prototype,"pattern");var ui=k;customElements.get(ui.ID)||customElements.define(ui.ID,ui);var Yt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Ot=e=>(...t)=>({_$litDirective$:e,values:t}),Xt=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,i,s){this._$Ct=t,this._$AM=i,this._$Ci=s}_$AS(t,i){return this.update(t,i)}update(t,i){return this.render(...i)}};var Dt=class extends Xt{constructor(t){if(super(t),this.it=v,t.type!==Yt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===v||t==null)return this._t=void 0,this.it=t;if(t===ct)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;let i=[t];return i.raw=i,this._t={_$litType$:this.constructor.resultType,strings:i,values:[]}}};Dt.directiveName="unsafeHTML",Dt.resultType=1;var ns=Ot(Dt);var{I:hn}=ss;var as=e=>e.strings===void 0;var fe=(e,t)=>{let i=e._$AN;if(i===void 0)return!1;for(let s of i)s._$AO?.(t,!1),fe(s,t);return!0},He=e=>{let t,i;do{if((t=e._$AM)===void 0)break;i=t._$AN,i.delete(e),e=t}while(i?.size===0)},ls=e=>{for(let t;t=e._$AM;e=t){let i=t._$AN;if(i===void 0)t._$AN=i=new Set;else if(i.has(e))break;i.add(e),xo(t)}};function bo(e){this._$AN!==void 0?(He(this),this._$AM=e,ls(this)):this._$AM=e}function yo(e,t=!1,i=0){let s=this._$AH,o=this._$AN;if(o!==void 0&&o.size!==0)if(t)if(Array.isArray(s))for(let r=i;r<s.length;r++)fe(s[r],!1),He(s[r]);else s!=null&&(fe(s,!1),He(s));else fe(this,e)}var xo=e=>{e.type==Yt.CHILD&&(e._$AP??=yo,e._$AQ??=bo)},Ue=class extends Xt{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,i,s){super._$AT(t,i,s),ls(this),this.isConnected=t._$AU}_$AO(t,i=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),i&&(fe(this,t),He(this))}setValue(t){if(as(this._$Ct))this._$Ct._$AI(t,this);else{let i=[...this._$Ct._$AH];i[this._$Ci]=t,this._$Ct._$AI(i,this,0)}}disconnected(){}reconnected(){}};var ds=e=>e?e.startsWith("url")?e:`url("${e}")`:null,wo=(e,t)=>{if(e){let i=new Image;i.addEventListener("load",t),i.src=e,i.complete&&(i.removeEventListener("load",t),window.queueMicrotask(()=>t()))}};var fi=class extends Ue{constructor(t){if(super(t),t.type!==Yt.ATTRIBUTE||t.name!=="src"&&t.name!=="style")throw new Error("The `placeholder` directive must be used in the `src` or `style` attributes")}update(t,[i,s]){return this.useCssBackground=t.name=="style",this.render(i,s)}render(t,i){this.loadingToken!=null&&(this.loadingToken.cancelled=!0);let s={cancelled:!1};return this.loadingToken=s,typeof t=="string"?this.preload(t,s):t?.then(o=>{this.preload(o,s)}),this.useCssBackground?ds(i):i}preload(t,i){t!=null&&!i.cancelled&&wo(t,()=>{i.cancelled||this.setValue(this.useCssBackground?ds(t):t)})}},Be=Ot(fi);var _o=':host{display:block;contain:strict;height:50px}:host([selected]){background-color:#d3e6fa}:host(:not([selected]):hover),:host(:not([selected])[focused]){background-color:#e7f1fa}@media (forced-colors: active){:host([selected]){outline:4px solid}:host(:not([selected]):hover){outline:4px dotted}:host(:not([selected])[focused]){outline:4px dashed}}:host([enable-line-clamp]) .labels>:only-child{display:-webkit-box;overflow:hidden;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:normal;overflow-wrap:break-word}.container{display:flex;height:100%;box-sizing:border-box}.container .level-indicator{width:7px;height:100%}.container .level-indicator.level-0{background-color:#a0c3ef}.container .level-indicator.level-1{background-color:#e7c374}.container .level-indicator.level-2{background-color:#bfd596}.container .level-indicator.level-3{background-color:#fd998d}.container .level-indicator.level-4{background-color:#c6e8f5}.container .level-indicator.level-5{background-color:#fde3a4}.container .level-indicator.level-6{background-color:#dcbfe0}.side-content{display:flex;align-items:center;flex-grow:0}.labels{display:flex;flex-direction:column;justify-content:center;flex:1 1 0px;height:100%;line-height:normal;overflow:hidden;padding:var(--sd-list-item-label-content-padding, 0 8px)}.caption,.description{width:100%;font-family:var(--sd-list-item-font-family, "Segoe UI", "Lucida Sans", Arial, sans-serif);font-style:normal;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;-webkit-user-select:none;user-select:none;text-decoration:var(--sd-list-item-text-decoration, inherit)}.caption em,.description em{font-weight:bolder}.caption{font-size:var(--sd-list-item-caption-font-size, 16px);color:var(--sd-list-item-caption-text-color, #111);font-weight:var(--sd-list-item-caption-font-weight, normal)}.description{font-size:var(--sd-list-item-description-font-size, 13px);color:var(--sd-list-item-description-text-color, #767676);font-weight:var(--sd-list-item-description-font-weight, normal)}.description.with-icon{display:flex;align-items:center;gap:4px}.description.with-icon .description-icon{width:var(--sd-list-item-description-font-size, 13px);height:var(--sd-list-item-description-font-size, 13px);background-repeat:no-repeat;background-position:bottom;background-size:90%}.icon-wrapper{width:var(--sd-list-item-icon-wrapper-width, 45px);height:100%;display:flex;align-items:center;justify-content:center}.icon-wrapper .icon{min-height:var(--sd-list-item-icon-size, 24px);min-width:var(--sd-list-item-icon-size, 24px);background-repeat:no-repeat;background-position:center;background-size:cover}',Ao=Object.defineProperty,W=(e,t,i,s)=>{for(var o=void 0,r=e.length-1,n;r>=0;r--)(n=e[r])&&(o=n(t,i,o)||o);return o&&Ao(t,i,o),o},Mt,z=(Mt=class extends D{constructor(){super(...arguments),this.contentMode="text",this.role="option"}static get styles(){return[at`
75
75
  ${X(_o)}
76
76
  `]}render(){return A`
77
77
  <div class="container">
@@ -82,7 +82,7 @@ var window;(window||={})["@cas-smartdesign/token-selector"]=(()=>{var ii=Object.
82
82
  </div>
83
83
  <div class="labels">
84
84
  ${this.renderLabel("caption",this.caption,this.captionAttrTitle)}
85
- ${this.renderLabel("description",this.description,this.descriptionAttrTitle)}
85
+ ${this.renderLabel("description",this.description,this.descriptionAttrTitle,this.descriptionIcon)}
86
86
  </div>
87
87
  <div class="side-content">
88
88
  <slot name="right-content"></slot>
@@ -97,23 +97,24 @@ var window;(window||={})["@cas-smartdesign/token-selector"]=(()=>{var ii=Object.
97
97
  title="${M(this.iconAttrTitle)}"
98
98
  >
99
99
  <div class="icon" style="background-image:${Be(this.icon,this.iconPlaceholder)}"></div>
100
- </div> `:g}renderLabel(e,t,i){return t?A`
101
- <div class="${e}" title="${M(i)}">
100
+ </div> `:v}renderLabel(e,t,i,s){return t?A`
101
+ <div class="${e} ${s?"with-icon":""}" title="${M(i)}">
102
+ ${s?A` <div class="${e}-icon" style="background-image:url('${s}')" aria-hidden="true"></div> `:v}
102
103
  ${this.contentMode==="html"?ns(t):t}
103
104
  </div>
104
- `:g}updated(e){super.updated(e),e.has("selected")&&this.setAttribute("aria-selected",String(this.selected))}get missingWidthForTexts(){let e=this.enableLineClamp;this.removeAttribute("enable-line-clamp");let t=0,i=this.shadowRoot.querySelector(".caption");i&&(t+=i.scrollWidth-i.clientWidth);let s=this.shadowRoot.querySelector(".description");return s&&(t=Math.max(t,s.scrollWidth-s.clientWidth)),t>0&&t++,e&&this.setAttribute("enable-line-clamp",""),t}handleIconClick(e){!this.disabled&&!this.dispatchEvent(new PointerEvent("list-item-icon-click",e))&&e.preventDefault()}getLevelIndicators(){return this.level?Array(Number(this.level)).fill(null):[]}},Mt.ID="sd-list-item",Mt.ensureDefined=()=>{customElements.get(Mt.ID)||customElements.define(Mt.ID,Mt)},Mt);j([h({type:String})],F.prototype,"caption");j([h({type:String})],F.prototype,"description");j([h({type:Boolean})],F.prototype,"selected");j([h({type:String})],F.prototype,"icon");j([h({type:String})],F.prototype,"iconBackgroundColor");j([h({type:String})],F.prototype,"iconPlaceholder");j([h({type:Number})],F.prototype,"level");j([h()],F.prototype,"contentMode");j([h({type:Boolean,reflect:!0,attribute:"enable-line-clamp"})],F.prototype,"enableLineClamp");j([h({converter:{fromAttribute:e=>e=="true",toAttribute:e=>e},reflect:!0,attribute:"aria-disabled"})],F.prototype,"disabled");j([h({type:String,attribute:"icon-attr-aria-label"})],F.prototype,"iconAttrAriaLabel");j([h({type:String,reflect:!0})],F.prototype,"role");j([h({type:String,attribute:"caption-attr-title"})],F.prototype,"captionAttrTitle");j([h({type:String,attribute:"description-attr-title"})],F.prototype,"descriptionAttrTitle");j([h({type:String,attribute:"icon-attr-title"})],F.prototype,"iconAttrTitle");var Rt=F,qe=(e,t)=>{let i=document.createElement(Rt.ID);if(e){if(i.caption=e.caption,i.description=e.description,i.icon=e.icon,i.iconBackgroundColor=e.iconBackgroundColor,i.iconPlaceholder=e.iconPlaceholder,i.level=e.level,i.disabled=e.disabled,e.contentMode&&(i.contentMode=e.contentMode),e.leftContentGenerator){let s=e.leftContentGenerator(e,i);s&&(s.slot="left-content",i.appendChild(s))}if(e.rightContentGenerator){let s=e.rightContentGenerator(e,i);s&&(s.slot="right-content",i.appendChild(s))}}return i};Rt.ensureDefined();var I="top",R="bottom",P="right",L="left",ze="auto",gt=[I,R,P,L],ht="start",Nt="end",cs="clippingParents",Ve="viewport",Jt="popper",hs="reference",mi=gt.reduce(function(e,t){return e.concat([t+"-"+ht,t+"-"+Nt])},[]),Fe=[].concat(gt,[ze]).reduce(function(e,t){return e.concat([t,t+"-"+ht,t+"-"+Nt])},[]),Eo="beforeRead",ko="read",So="afterRead",$o="beforeMain",Io="main",Co="afterMain",To="beforeWrite",Lo="write",Po="afterWrite",ps=[Eo,ko,So,$o,Io,Co,To,Lo,Po];function U(e){return e?(e.nodeName||"").toLowerCase():null}function E(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function J(e){var t=E(e).Element;return e instanceof t||e instanceof Element}function N(e){var t=E(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Zt(e){if(typeof ShadowRoot>"u")return!1;var t=E(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Oo(e){var t=e.state;Object.keys(t.elements).forEach(function(i){var s=t.styles[i]||{},o=t.attributes[i]||{},r=t.elements[i];!N(r)||!U(r)||(Object.assign(r.style,s),Object.keys(o).forEach(function(n){var a=o[n];a===!1?r.removeAttribute(n):r.setAttribute(n,a===!0?"":a)}))})}function Do(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach(function(s){var o=t.elements[s],r=t.attributes[s]||{},n=Object.keys(t.styles.hasOwnProperty(s)?t.styles[s]:i[s]),a=n.reduce(function(l,c){return l[c]="",l},{});!N(o)||!U(o)||(Object.assign(o.style,a),Object.keys(r).forEach(function(l){o.removeAttribute(l)}))})}}var us={name:"applyStyles",enabled:!0,phase:"write",fn:Oo,effect:Do,requires:["computeStyles"]};function B(e){return e.split("-")[0]}var st=Math.max,Ht=Math.min,pt=Math.round;function Qt(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function me(){return!/^((?!chrome|android).)*safari/i.test(Qt())}function Z(e,t,i){t===void 0&&(t=!1),i===void 0&&(i=!1);var s=e.getBoundingClientRect(),o=1,r=1;t&&N(e)&&(o=e.offsetWidth>0&&pt(s.width)/e.offsetWidth||1,r=e.offsetHeight>0&&pt(s.height)/e.offsetHeight||1);var n=J(e)?E(e):window,a=n.visualViewport,l=!me()&&i,c=(s.left+(l&&a?a.offsetLeft:0))/o,d=(s.top+(l&&a?a.offsetTop:0))/r,p=s.width/o,f=s.height/r;return{width:p,height:f,top:d,right:c+p,bottom:d+f,left:c,x:c,y:d}}function Ut(e){var t=Z(e),i=e.offsetWidth,s=e.offsetHeight;return Math.abs(t.width-i)<=1&&(i=t.width),Math.abs(t.height-s)<=1&&(s=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:s}}function ve(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&Zt(i)){var s=t;do{if(s&&e.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function K(e){return E(e).getComputedStyle(e)}function vi(e){return["table","td","th"].indexOf(U(e))>=0}function z(e){return((J(e)?e.ownerDocument:e.document)||window.document).documentElement}function ut(e){return U(e)==="html"?e:e.assignedSlot||e.parentNode||(Zt(e)?e.host:null)||z(e)}function fs(e){return!N(e)||K(e).position==="fixed"?null:e.offsetParent}function Mo(e){var t=/firefox/i.test(Qt()),i=/Trident/i.test(Qt());if(i&&N(e)){var s=K(e);if(s.position==="fixed")return null}var o=ut(e);for(Zt(o)&&(o=o.host);N(o)&&["html","body"].indexOf(U(o))<0;){var r=K(o);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||t&&r.willChange==="filter"||t&&r.filter&&r.filter!=="none")return o;o=o.parentNode}return null}function ot(e){for(var t=E(e),i=fs(e);i&&vi(i)&&K(i).position==="static";)i=fs(i);return i&&(U(i)==="html"||U(i)==="body"&&K(i).position==="static")?t:i||Mo(e)||t}function Bt(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function qt(e,t,i){return st(e,Ht(t,i))}function ms(e,t,i){var s=qt(e,t,i);return s>i?i:s}function ge(){return{top:0,right:0,bottom:0,left:0}}function be(e){return Object.assign({},ge(),e)}function ye(e,t){return t.reduce(function(i,s){return i[s]=e,i},{})}var Ro=function(t,i){return t=typeof t=="function"?t(Object.assign({},i.rects,{placement:i.placement})):t,be(typeof t!="number"?t:ye(t,gt))};function No(e){var t,i=e.state,s=e.name,o=e.options,r=i.elements.arrow,n=i.modifiersData.popperOffsets,a=B(i.placement),l=Bt(a),c=[L,P].indexOf(a)>=0,d=c?"height":"width";if(!(!r||!n)){var p=Ro(o.padding,i),f=Ut(r),u=l==="y"?I:L,y=l==="y"?R:P,b=i.rects.reference[d]+i.rects.reference[l]-n[l]-i.rects.popper[d],v=n[l]-i.rects.reference[l],_=ot(r),C=_?l==="y"?_.clientHeight||0:_.clientWidth||0:0,T=b/2-v/2,m=p[u],x=C-f[d]-p[y],w=C/2-f[d]/2+T,S=qt(m,w,x),q=l;i.modifiersData[s]=(t={},t[q]=S,t.centerOffset=S-w,t)}}function Ho(e){var t=e.state,i=e.options,s=i.element,o=s===void 0?"[data-popper-arrow]":s;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||ve(t.elements.popper,o)&&(t.elements.arrow=o))}var vs={name:"arrow",enabled:!0,phase:"main",fn:No,effect:Ho,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Q(e){return e.split("-")[1]}var Uo={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Bo(e,t){var i=e.x,s=e.y,o=t.devicePixelRatio||1;return{x:pt(i*o)/o||0,y:pt(s*o)/o||0}}function gs(e){var t,i=e.popper,s=e.popperRect,o=e.placement,r=e.variation,n=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,d=e.roundOffsets,p=e.isFixed,f=n.x,u=f===void 0?0:f,y=n.y,b=y===void 0?0:y,v=typeof d=="function"?d({x:u,y:b}):{x:u,y:b};u=v.x,b=v.y;var _=n.hasOwnProperty("x"),C=n.hasOwnProperty("y"),T=L,m=I,x=window;if(c){var w=ot(i),S="clientHeight",q="clientWidth";if(w===E(i)&&(w=z(i),K(w).position!=="static"&&a==="absolute"&&(S="scrollHeight",q="scrollWidth")),w=w,o===I||(o===L||o===P)&&r===Nt){m=R;var H=p&&w===x&&x.visualViewport?x.visualViewport.height:w[S];b-=H-s.height,b*=l?1:-1}if(o===L||(o===I||o===R)&&r===Nt){T=P;var O=p&&w===x&&x.visualViewport?x.visualViewport.width:w[q];u-=O-s.width,u*=l?1:-1}}var V=Object.assign({position:a},c&&Uo),et=d===!0?Bo({x:u,y:b},E(i)):{x:u,y:b};if(u=et.x,b=et.y,l){var W;return Object.assign({},V,(W={},W[m]=C?"0":"",W[T]=_?"0":"",W.transform=(x.devicePixelRatio||1)<=1?"translate("+u+"px, "+b+"px)":"translate3d("+u+"px, "+b+"px, 0)",W))}return Object.assign({},V,(t={},t[m]=C?b+"px":"",t[T]=_?u+"px":"",t.transform="",t))}function qo(e){var t=e.state,i=e.options,s=i.gpuAcceleration,o=s===void 0?!0:s,r=i.adaptive,n=r===void 0?!0:r,a=i.roundOffsets,l=a===void 0?!0:a,c={placement:B(t.placement),variation:Q(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,gs(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:n,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,gs(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var bs={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:qo,data:{}};var We={passive:!0};function zo(e){var t=e.state,i=e.instance,s=e.options,o=s.scroll,r=o===void 0?!0:o,n=s.resize,a=n===void 0?!0:n,l=E(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&c.forEach(function(d){d.addEventListener("scroll",i.update,We)}),a&&l.addEventListener("resize",i.update,We),function(){r&&c.forEach(function(d){d.removeEventListener("scroll",i.update,We)}),a&&l.removeEventListener("resize",i.update,We)}}var ys={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:zo,data:{}};var Vo={left:"right",right:"left",bottom:"top",top:"bottom"};function te(e){return e.replace(/left|right|bottom|top/g,function(t){return Vo[t]})}var Fo={start:"end",end:"start"};function je(e){return e.replace(/start|end/g,function(t){return Fo[t]})}function zt(e){var t=E(e),i=t.pageXOffset,s=t.pageYOffset;return{scrollLeft:i,scrollTop:s}}function Vt(e){return Z(z(e)).left+zt(e).scrollLeft}function gi(e,t){var i=E(e),s=z(e),o=i.visualViewport,r=s.clientWidth,n=s.clientHeight,a=0,l=0;if(o){r=o.width,n=o.height;var c=me();(c||!c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:r,height:n,x:a+Vt(e),y:l}}function bi(e){var t,i=z(e),s=zt(e),o=(t=e.ownerDocument)==null?void 0:t.body,r=st(i.scrollWidth,i.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),n=st(i.scrollHeight,i.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-s.scrollLeft+Vt(e),l=-s.scrollTop;return K(o||i).direction==="rtl"&&(a+=st(i.clientWidth,o?o.clientWidth:0)-r),{width:r,height:n,x:a,y:l}}function Ft(e){var t=K(e),i=t.overflow,s=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+o+s)}function Ke(e){return["html","body","#document"].indexOf(U(e))>=0?e.ownerDocument.body:N(e)&&Ft(e)?e:Ke(ut(e))}function bt(e,t){var i;t===void 0&&(t=[]);var s=Ke(e),o=s===((i=e.ownerDocument)==null?void 0:i.body),r=E(s),n=o?[r].concat(r.visualViewport||[],Ft(s)?s:[]):s,a=t.concat(n);return o?a:a.concat(bt(ut(n)))}function ee(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Wo(e,t){var i=Z(e,!1,t==="fixed");return i.top=i.top+e.clientTop,i.left=i.left+e.clientLeft,i.bottom=i.top+e.clientHeight,i.right=i.left+e.clientWidth,i.width=e.clientWidth,i.height=e.clientHeight,i.x=i.left,i.y=i.top,i}function xs(e,t,i){return t===Ve?ee(gi(e,i)):J(t)?Wo(t,i):ee(bi(z(e)))}function jo(e){var t=bt(ut(e)),i=["absolute","fixed"].indexOf(K(e).position)>=0,s=i&&N(e)?ot(e):e;return J(s)?t.filter(function(o){return J(o)&&ve(o,s)&&U(o)!=="body"}):[]}function yi(e,t,i,s){var o=t==="clippingParents"?jo(e):[].concat(t),r=[].concat(o,[i]),n=r[0],a=r.reduce(function(l,c){var d=xs(e,c,s);return l.top=st(d.top,l.top),l.right=Ht(d.right,l.right),l.bottom=Ht(d.bottom,l.bottom),l.left=st(d.left,l.left),l},xs(e,n,s));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function xe(e){var t=e.reference,i=e.element,s=e.placement,o=s?B(s):null,r=s?Q(s):null,n=t.x+t.width/2-i.width/2,a=t.y+t.height/2-i.height/2,l;switch(o){case I:l={x:n,y:t.y-i.height};break;case R:l={x:n,y:t.y+t.height};break;case P:l={x:t.x+t.width,y:a};break;case L:l={x:t.x-i.width,y:a};break;default:l={x:t.x,y:t.y}}var c=o?Bt(o):null;if(c!=null){var d=c==="y"?"height":"width";switch(r){case ht:l[c]=l[c]-(t[d]/2-i[d]/2);break;case Nt:l[c]=l[c]+(t[d]/2-i[d]/2);break;default:}}return l}function rt(e,t){t===void 0&&(t={});var i=t,s=i.placement,o=s===void 0?e.placement:s,r=i.strategy,n=r===void 0?e.strategy:r,a=i.boundary,l=a===void 0?cs:a,c=i.rootBoundary,d=c===void 0?Ve:c,p=i.elementContext,f=p===void 0?Jt:p,u=i.altBoundary,y=u===void 0?!1:u,b=i.padding,v=b===void 0?0:b,_=be(typeof v!="number"?v:ye(v,gt)),C=f===Jt?hs:Jt,T=e.rects.popper,m=e.elements[y?C:f],x=yi(J(m)?m:m.contextElement||z(e.elements.popper),l,d,n),w=Z(e.elements.reference),S=xe({reference:w,element:T,strategy:"absolute",placement:o}),q=ee(Object.assign({},T,S)),H=f===Jt?q:w,O={top:x.top-H.top+_.top,bottom:H.bottom-x.bottom+_.bottom,left:x.left-H.left+_.left,right:H.right-x.right+_.right},V=e.modifiersData.offset;if(f===Jt&&V){var et=V[o];Object.keys(O).forEach(function(W){var At=[P,R].indexOf(W)>=0?1:-1,Et=[I,R].indexOf(W)>=0?"y":"x";O[W]+=et[Et]*At})}return O}function xi(e,t){t===void 0&&(t={});var i=t,s=i.placement,o=i.boundary,r=i.rootBoundary,n=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=l===void 0?Fe:l,d=Q(s),p=d?a?mi:mi.filter(function(y){return Q(y)===d}):gt,f=p.filter(function(y){return c.indexOf(y)>=0});f.length===0&&(f=p);var u=f.reduce(function(y,b){return y[b]=rt(e,{placement:b,boundary:o,rootBoundary:r,padding:n})[B(b)],y},{});return Object.keys(u).sort(function(y,b){return u[y]-u[b]})}function Ko(e){if(B(e)===ze)return[];var t=te(e);return[je(e),t,je(t)]}function Go(e){var t=e.state,i=e.options,s=e.name;if(!t.modifiersData[s]._skip){for(var o=i.mainAxis,r=o===void 0?!0:o,n=i.altAxis,a=n===void 0?!0:n,l=i.fallbackPlacements,c=i.padding,d=i.boundary,p=i.rootBoundary,f=i.altBoundary,u=i.flipVariations,y=u===void 0?!0:u,b=i.allowedAutoPlacements,v=t.options.placement,_=B(v),C=_===v,T=l||(C||!y?[te(v)]:Ko(v)),m=[v].concat(T).reduce(function(jt,vt){return jt.concat(B(vt)===ze?xi(t,{placement:vt,boundary:d,rootBoundary:p,padding:c,flipVariations:y,allowedAutoPlacements:b}):vt)},[]),x=t.rects.reference,w=t.rects.popper,S=new Map,q=!0,H=m[0],O=0;O<m.length;O++){var V=m[O],et=B(V),W=Q(V)===ht,At=[I,R].indexOf(et)>=0,Et=At?"width":"height",G=rt(t,{placement:V,boundary:d,rootBoundary:p,altBoundary:f,padding:c}),it=At?W?P:L:W?R:I;x[Et]>w[Et]&&(it=te(it));var Ae=te(it),kt=[];if(r&&kt.push(G[et]<=0),a&&kt.push(G[it]<=0,G[Ae]<=0),kt.every(function(jt){return jt})){H=V,q=!1;break}S.set(V,kt)}if(q)for(var Ee=y?3:1,Ze=function(vt){var se=m.find(function(Se){var St=S.get(Se);if(St)return St.slice(0,vt).every(function(Qe){return Qe})});if(se)return H=se,"break"},ie=Ee;ie>0;ie--){var ke=Ze(ie);if(ke==="break")break}t.placement!==H&&(t.modifiersData[s]._skip=!0,t.placement=H,t.reset=!0)}}var ws={name:"flip",enabled:!0,phase:"main",fn:Go,requiresIfExists:["offset"],data:{_skip:!1}};function _s(e,t,i){return i===void 0&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function As(e){return[I,P,R,L].some(function(t){return e[t]>=0})}function Xo(e){var t=e.state,i=e.name,s=t.rects.reference,o=t.rects.popper,r=t.modifiersData.preventOverflow,n=rt(t,{elementContext:"reference"}),a=rt(t,{altBoundary:!0}),l=_s(n,s),c=_s(a,o,r),d=As(l),p=As(c);t.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":p})}var Es={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Xo};function Yo(e,t,i){var s=B(e),o=[L,I].indexOf(s)>=0?-1:1,r=typeof i=="function"?i(Object.assign({},t,{placement:e})):i,n=r[0],a=r[1];return n=n||0,a=(a||0)*o,[L,P].indexOf(s)>=0?{x:a,y:n}:{x:n,y:a}}function Jo(e){var t=e.state,i=e.options,s=e.name,o=i.offset,r=o===void 0?[0,0]:o,n=Fe.reduce(function(d,p){return d[p]=Yo(p,t.rects,r),d},{}),a=n[t.placement],l=a.x,c=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[s]=n}var ks={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Jo};function Zo(e){var t=e.state,i=e.name;t.modifiersData[i]=xe({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}var Ss={name:"popperOffsets",enabled:!0,phase:"read",fn:Zo,data:{}};function wi(e){return e==="x"?"y":"x"}function Qo(e){var t=e.state,i=e.options,s=e.name,o=i.mainAxis,r=o===void 0?!0:o,n=i.altAxis,a=n===void 0?!1:n,l=i.boundary,c=i.rootBoundary,d=i.altBoundary,p=i.padding,f=i.tether,u=f===void 0?!0:f,y=i.tetherOffset,b=y===void 0?0:y,v=rt(t,{boundary:l,rootBoundary:c,padding:p,altBoundary:d}),_=B(t.placement),C=Q(t.placement),T=!C,m=Bt(_),x=wi(m),w=t.modifiersData.popperOffsets,S=t.rects.reference,q=t.rects.popper,H=typeof b=="function"?b(Object.assign({},t.rects,{placement:t.placement})):b,O=typeof H=="number"?{mainAxis:H,altAxis:H}:Object.assign({mainAxis:0,altAxis:0},H),V=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,et={x:0,y:0};if(w){if(r){var W,At=m==="y"?I:L,Et=m==="y"?R:P,G=m==="y"?"height":"width",it=w[m],Ae=it+v[At],kt=it-v[Et],Ee=u?-q[G]/2:0,Ze=C===ht?S[G]:q[G],ie=C===ht?-q[G]:-S[G],ke=t.elements.arrow,jt=u&&ke?Ut(ke):{width:0,height:0},vt=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:ge(),se=vt[At],Se=vt[Et],St=qt(0,S[G],jt[G]),Qe=T?S[G]/2-Ee-St-se-O.mainAxis:Ze-St-se-O.mainAxis,Ns=T?-S[G]/2+Ee+St+Se+O.mainAxis:ie+St+Se+O.mainAxis,ti=t.elements.arrow&&ot(t.elements.arrow),Hs=ti?m==="y"?ti.clientTop||0:ti.clientLeft||0:0,Di=(W=V?.[m])!=null?W:0,Us=it+Qe-Di-Hs,Bs=it+Ns-Di,Mi=qt(u?Ht(Ae,Us):Ae,it,u?st(kt,Bs):kt);w[m]=Mi,et[m]=Mi-it}if(a){var Ri,qs=m==="x"?I:L,zs=m==="x"?R:P,$t=w[x],$e=x==="y"?"height":"width",Ni=$t+v[qs],Hi=$t-v[zs],ei=[I,L].indexOf(_)!==-1,Ui=(Ri=V?.[x])!=null?Ri:0,Bi=ei?Ni:$t-S[$e]-q[$e]-Ui+O.altAxis,qi=ei?$t+S[$e]+q[$e]-Ui-O.altAxis:Hi,zi=u&&ei?ms(Bi,$t,qi):qt(u?Bi:Ni,$t,u?qi:Hi);w[x]=zi,et[x]=zi-$t}t.modifiersData[s]=et}}var $s={name:"preventOverflow",enabled:!0,phase:"main",fn:Qo,requiresIfExists:["offset"]};function _i(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Ai(e){return e===E(e)||!N(e)?zt(e):_i(e)}function tr(e){var t=e.getBoundingClientRect(),i=pt(t.width)/e.offsetWidth||1,s=pt(t.height)/e.offsetHeight||1;return i!==1||s!==1}function Ei(e,t,i){i===void 0&&(i=!1);var s=N(t),o=N(t)&&tr(t),r=z(t),n=Z(e,o,i),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(s||!s&&!i)&&((U(t)!=="body"||Ft(r))&&(a=Ai(t)),N(t)?(l=Z(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):r&&(l.x=Vt(r))),{x:n.left+a.scrollLeft-l.x,y:n.top+a.scrollTop-l.y,width:n.width,height:n.height}}function er(e){var t=new Map,i=new Set,s=[];e.forEach(function(r){t.set(r.name,r)});function o(r){i.add(r.name);var n=[].concat(r.requires||[],r.requiresIfExists||[]);n.forEach(function(a){if(!i.has(a)){var l=t.get(a);l&&o(l)}}),s.push(r)}return e.forEach(function(r){i.has(r.name)||o(r)}),s}function ki(e){var t=er(e);return ps.reduce(function(i,s){return i.concat(t.filter(function(o){return o.phase===s}))},[])}function Si(e){var t;return function(){return t||(t=new Promise(function(i){Promise.resolve().then(function(){t=void 0,i(e())})})),t}}function $i(e){var t=e.reduce(function(i,s){var o=i[s.name];return i[s.name]=o?Object.assign({},o,s,{options:Object.assign({},o.options,s.options),data:Object.assign({},o.data,s.data)}):s,i},{});return Object.keys(t).map(function(i){return t[i]})}var Is={placement:"bottom",modifiers:[],strategy:"absolute"};function Cs(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return!t.some(function(s){return!(s&&typeof s.getBoundingClientRect=="function")})}function Ts(e){e===void 0&&(e={});var t=e,i=t.defaultModifiers,s=i===void 0?[]:i,o=t.defaultOptions,r=o===void 0?Is:o;return function(a,l,c){c===void 0&&(c=r);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},Is,r),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},p=[],f=!1,u={state:d,setOptions:function(_){var C=typeof _=="function"?_(d.options):_;b(),d.options=Object.assign({},r,d.options,C),d.scrollParents={reference:J(a)?bt(a):a.contextElement?bt(a.contextElement):[],popper:bt(l)};var T=ki($i([].concat(s,d.options.modifiers)));return d.orderedModifiers=T.filter(function(m){return m.enabled}),y(),u.update()},forceUpdate:function(){if(!f){var _=d.elements,C=_.reference,T=_.popper;if(Cs(C,T)){d.rects={reference:Ei(C,ot(T),d.options.strategy==="fixed"),popper:Ut(T)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(O){return d.modifiersData[O.name]=Object.assign({},O.data)});for(var m=0;m<d.orderedModifiers.length;m++){if(d.reset===!0){d.reset=!1,m=-1;continue}var x=d.orderedModifiers[m],w=x.fn,S=x.options,q=S===void 0?{}:S,H=x.name;typeof w=="function"&&(d=w({state:d,options:q,name:H,instance:u})||d)}}}},update:Si(function(){return new Promise(function(v){u.forceUpdate(),v(d)})}),destroy:function(){b(),f=!0}};if(!Cs(a,l))return u;u.setOptions(c).then(function(v){!f&&c.onFirstUpdate&&c.onFirstUpdate(v)});function y(){d.orderedModifiers.forEach(function(v){var _=v.name,C=v.options,T=C===void 0?{}:C,m=v.effect;if(typeof m=="function"){var x=m({state:d,name:_,instance:u,options:T}),w=function(){};p.push(x||w)}})}function b(){p.forEach(function(v){return v()}),p=[]}return u}}var ir=[ys,Ss,bs,us,ks,ws,$s,vs,Es],Ii=Ts({defaultModifiers:ir});var sr=`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="12" viewBox="0 0 24 12">\r
105
+ `:v}updated(e){super.updated(e),e.has("selected")&&this.setAttribute("aria-selected",String(this.selected))}get missingWidthForTexts(){let e=this.enableLineClamp;this.removeAttribute("enable-line-clamp");let t=0,i=this.shadowRoot.querySelector(".caption");i&&(t+=i.scrollWidth-i.clientWidth);let s=this.shadowRoot.querySelector(".description");return s&&(t=Math.max(t,s.scrollWidth-s.clientWidth)),t>0&&t++,e&&this.setAttribute("enable-line-clamp",""),t}handleIconClick(e){!this.disabled&&!this.dispatchEvent(new PointerEvent("list-item-icon-click",e))&&e.preventDefault()}getLevelIndicators(){return this.level?Array(Number(this.level)).fill(null):[]}},Mt.ID="sd-list-item",Mt.ensureDefined=()=>{customElements.get(Mt.ID)||customElements.define(Mt.ID,Mt)},Mt);W([h({type:String})],z.prototype,"caption");W([h({type:String})],z.prototype,"description");W([h({type:String})],z.prototype,"descriptionIcon");W([h({type:Boolean})],z.prototype,"selected");W([h({type:String})],z.prototype,"icon");W([h({type:String})],z.prototype,"iconBackgroundColor");W([h({type:String})],z.prototype,"iconPlaceholder");W([h({type:Number})],z.prototype,"level");W([h()],z.prototype,"contentMode");W([h({type:Boolean,reflect:!0,attribute:"enable-line-clamp"})],z.prototype,"enableLineClamp");W([h({converter:{fromAttribute:e=>e=="true",toAttribute:e=>e},reflect:!0,attribute:"aria-disabled"})],z.prototype,"disabled");W([h({type:String,attribute:"icon-attr-aria-label"})],z.prototype,"iconAttrAriaLabel");W([h({type:String,reflect:!0})],z.prototype,"role");W([h({type:String,attribute:"caption-attr-title"})],z.prototype,"captionAttrTitle");W([h({type:String,attribute:"description-attr-title"})],z.prototype,"descriptionAttrTitle");W([h({type:String,attribute:"icon-attr-title"})],z.prototype,"iconAttrTitle");var Rt=z,qe=(e,t)=>{let i=document.createElement(Rt.ID);if(e){if(i.caption=e.caption,i.description=e.description,i.descriptionIcon=e.descriptionIcon,i.icon=e.icon,i.iconBackgroundColor=e.iconBackgroundColor,i.iconPlaceholder=e.iconPlaceholder,i.level=e.level,i.disabled=e.disabled,e.contentMode&&(i.contentMode=e.contentMode),e.leftContentGenerator){let s=e.leftContentGenerator(e,i);s&&(s.slot="left-content",i.appendChild(s))}if(e.rightContentGenerator){let s=e.rightContentGenerator(e,i);s&&(s.slot="right-content",i.appendChild(s))}}return i};Rt.ensureDefined();var I="top",R="bottom",P="right",L="left",ze="auto",gt=[I,R,P,L],ht="start",Nt="end",cs="clippingParents",Fe="viewport",Jt="popper",hs="reference",mi=gt.reduce(function(e,t){return e.concat([t+"-"+ht,t+"-"+Nt])},[]),Ve=[].concat(gt,[ze]).reduce(function(e,t){return e.concat([t,t+"-"+ht,t+"-"+Nt])},[]),Eo="beforeRead",ko="read",So="afterRead",$o="beforeMain",Io="main",Co="afterMain",To="beforeWrite",Lo="write",Po="afterWrite",ps=[Eo,ko,So,$o,Io,Co,To,Lo,Po];function U(e){return e?(e.nodeName||"").toLowerCase():null}function E(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function J(e){var t=E(e).Element;return e instanceof t||e instanceof Element}function N(e){var t=E(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Zt(e){if(typeof ShadowRoot>"u")return!1;var t=E(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Oo(e){var t=e.state;Object.keys(t.elements).forEach(function(i){var s=t.styles[i]||{},o=t.attributes[i]||{},r=t.elements[i];!N(r)||!U(r)||(Object.assign(r.style,s),Object.keys(o).forEach(function(n){var a=o[n];a===!1?r.removeAttribute(n):r.setAttribute(n,a===!0?"":a)}))})}function Do(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach(function(s){var o=t.elements[s],r=t.attributes[s]||{},n=Object.keys(t.styles.hasOwnProperty(s)?t.styles[s]:i[s]),a=n.reduce(function(l,c){return l[c]="",l},{});!N(o)||!U(o)||(Object.assign(o.style,a),Object.keys(r).forEach(function(l){o.removeAttribute(l)}))})}}var us={name:"applyStyles",enabled:!0,phase:"write",fn:Oo,effect:Do,requires:["computeStyles"]};function B(e){return e.split("-")[0]}var st=Math.max,Ht=Math.min,pt=Math.round;function Qt(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function me(){return!/^((?!chrome|android).)*safari/i.test(Qt())}function Z(e,t,i){t===void 0&&(t=!1),i===void 0&&(i=!1);var s=e.getBoundingClientRect(),o=1,r=1;t&&N(e)&&(o=e.offsetWidth>0&&pt(s.width)/e.offsetWidth||1,r=e.offsetHeight>0&&pt(s.height)/e.offsetHeight||1);var n=J(e)?E(e):window,a=n.visualViewport,l=!me()&&i,c=(s.left+(l&&a?a.offsetLeft:0))/o,d=(s.top+(l&&a?a.offsetTop:0))/r,p=s.width/o,f=s.height/r;return{width:p,height:f,top:d,right:c+p,bottom:d+f,left:c,x:c,y:d}}function Ut(e){var t=Z(e),i=e.offsetWidth,s=e.offsetHeight;return Math.abs(t.width-i)<=1&&(i=t.width),Math.abs(t.height-s)<=1&&(s=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:s}}function ve(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&Zt(i)){var s=t;do{if(s&&e.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function K(e){return E(e).getComputedStyle(e)}function vi(e){return["table","td","th"].indexOf(U(e))>=0}function F(e){return((J(e)?e.ownerDocument:e.document)||window.document).documentElement}function ut(e){return U(e)==="html"?e:e.assignedSlot||e.parentNode||(Zt(e)?e.host:null)||F(e)}function fs(e){return!N(e)||K(e).position==="fixed"?null:e.offsetParent}function Mo(e){var t=/firefox/i.test(Qt()),i=/Trident/i.test(Qt());if(i&&N(e)){var s=K(e);if(s.position==="fixed")return null}var o=ut(e);for(Zt(o)&&(o=o.host);N(o)&&["html","body"].indexOf(U(o))<0;){var r=K(o);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||t&&r.willChange==="filter"||t&&r.filter&&r.filter!=="none")return o;o=o.parentNode}return null}function ot(e){for(var t=E(e),i=fs(e);i&&vi(i)&&K(i).position==="static";)i=fs(i);return i&&(U(i)==="html"||U(i)==="body"&&K(i).position==="static")?t:i||Mo(e)||t}function Bt(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function qt(e,t,i){return st(e,Ht(t,i))}function ms(e,t,i){var s=qt(e,t,i);return s>i?i:s}function ge(){return{top:0,right:0,bottom:0,left:0}}function be(e){return Object.assign({},ge(),e)}function ye(e,t){return t.reduce(function(i,s){return i[s]=e,i},{})}var Ro=function(t,i){return t=typeof t=="function"?t(Object.assign({},i.rects,{placement:i.placement})):t,be(typeof t!="number"?t:ye(t,gt))};function No(e){var t,i=e.state,s=e.name,o=e.options,r=i.elements.arrow,n=i.modifiersData.popperOffsets,a=B(i.placement),l=Bt(a),c=[L,P].indexOf(a)>=0,d=c?"height":"width";if(!(!r||!n)){var p=Ro(o.padding,i),f=Ut(r),u=l==="y"?I:L,y=l==="y"?R:P,b=i.rects.reference[d]+i.rects.reference[l]-n[l]-i.rects.popper[d],g=n[l]-i.rects.reference[l],_=ot(r),C=_?l==="y"?_.clientHeight||0:_.clientWidth||0:0,T=b/2-g/2,m=p[u],x=C-f[d]-p[y],w=C/2-f[d]/2+T,S=qt(m,w,x),q=l;i.modifiersData[s]=(t={},t[q]=S,t.centerOffset=S-w,t)}}function Ho(e){var t=e.state,i=e.options,s=i.element,o=s===void 0?"[data-popper-arrow]":s;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||ve(t.elements.popper,o)&&(t.elements.arrow=o))}var vs={name:"arrow",enabled:!0,phase:"main",fn:No,effect:Ho,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Q(e){return e.split("-")[1]}var Uo={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Bo(e,t){var i=e.x,s=e.y,o=t.devicePixelRatio||1;return{x:pt(i*o)/o||0,y:pt(s*o)/o||0}}function gs(e){var t,i=e.popper,s=e.popperRect,o=e.placement,r=e.variation,n=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,d=e.roundOffsets,p=e.isFixed,f=n.x,u=f===void 0?0:f,y=n.y,b=y===void 0?0:y,g=typeof d=="function"?d({x:u,y:b}):{x:u,y:b};u=g.x,b=g.y;var _=n.hasOwnProperty("x"),C=n.hasOwnProperty("y"),T=L,m=I,x=window;if(c){var w=ot(i),S="clientHeight",q="clientWidth";if(w===E(i)&&(w=F(i),K(w).position!=="static"&&a==="absolute"&&(S="scrollHeight",q="scrollWidth")),w=w,o===I||(o===L||o===P)&&r===Nt){m=R;var H=p&&w===x&&x.visualViewport?x.visualViewport.height:w[S];b-=H-s.height,b*=l?1:-1}if(o===L||(o===I||o===R)&&r===Nt){T=P;var O=p&&w===x&&x.visualViewport?x.visualViewport.width:w[q];u-=O-s.width,u*=l?1:-1}}var V=Object.assign({position:a},c&&Uo),et=d===!0?Bo({x:u,y:b},E(i)):{x:u,y:b};if(u=et.x,b=et.y,l){var j;return Object.assign({},V,(j={},j[m]=C?"0":"",j[T]=_?"0":"",j.transform=(x.devicePixelRatio||1)<=1?"translate("+u+"px, "+b+"px)":"translate3d("+u+"px, "+b+"px, 0)",j))}return Object.assign({},V,(t={},t[m]=C?b+"px":"",t[T]=_?u+"px":"",t.transform="",t))}function qo(e){var t=e.state,i=e.options,s=i.gpuAcceleration,o=s===void 0?!0:s,r=i.adaptive,n=r===void 0?!0:r,a=i.roundOffsets,l=a===void 0?!0:a,c={placement:B(t.placement),variation:Q(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,gs(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:n,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,gs(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var bs={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:qo,data:{}};var We={passive:!0};function zo(e){var t=e.state,i=e.instance,s=e.options,o=s.scroll,r=o===void 0?!0:o,n=s.resize,a=n===void 0?!0:n,l=E(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&c.forEach(function(d){d.addEventListener("scroll",i.update,We)}),a&&l.addEventListener("resize",i.update,We),function(){r&&c.forEach(function(d){d.removeEventListener("scroll",i.update,We)}),a&&l.removeEventListener("resize",i.update,We)}}var ys={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:zo,data:{}};var Fo={left:"right",right:"left",bottom:"top",top:"bottom"};function te(e){return e.replace(/left|right|bottom|top/g,function(t){return Fo[t]})}var Vo={start:"end",end:"start"};function je(e){return e.replace(/start|end/g,function(t){return Vo[t]})}function zt(e){var t=E(e),i=t.pageXOffset,s=t.pageYOffset;return{scrollLeft:i,scrollTop:s}}function Ft(e){return Z(F(e)).left+zt(e).scrollLeft}function gi(e,t){var i=E(e),s=F(e),o=i.visualViewport,r=s.clientWidth,n=s.clientHeight,a=0,l=0;if(o){r=o.width,n=o.height;var c=me();(c||!c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:r,height:n,x:a+Ft(e),y:l}}function bi(e){var t,i=F(e),s=zt(e),o=(t=e.ownerDocument)==null?void 0:t.body,r=st(i.scrollWidth,i.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),n=st(i.scrollHeight,i.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-s.scrollLeft+Ft(e),l=-s.scrollTop;return K(o||i).direction==="rtl"&&(a+=st(i.clientWidth,o?o.clientWidth:0)-r),{width:r,height:n,x:a,y:l}}function Vt(e){var t=K(e),i=t.overflow,s=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+o+s)}function Ke(e){return["html","body","#document"].indexOf(U(e))>=0?e.ownerDocument.body:N(e)&&Vt(e)?e:Ke(ut(e))}function bt(e,t){var i;t===void 0&&(t=[]);var s=Ke(e),o=s===((i=e.ownerDocument)==null?void 0:i.body),r=E(s),n=o?[r].concat(r.visualViewport||[],Vt(s)?s:[]):s,a=t.concat(n);return o?a:a.concat(bt(ut(n)))}function ee(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Wo(e,t){var i=Z(e,!1,t==="fixed");return i.top=i.top+e.clientTop,i.left=i.left+e.clientLeft,i.bottom=i.top+e.clientHeight,i.right=i.left+e.clientWidth,i.width=e.clientWidth,i.height=e.clientHeight,i.x=i.left,i.y=i.top,i}function xs(e,t,i){return t===Fe?ee(gi(e,i)):J(t)?Wo(t,i):ee(bi(F(e)))}function jo(e){var t=bt(ut(e)),i=["absolute","fixed"].indexOf(K(e).position)>=0,s=i&&N(e)?ot(e):e;return J(s)?t.filter(function(o){return J(o)&&ve(o,s)&&U(o)!=="body"}):[]}function yi(e,t,i,s){var o=t==="clippingParents"?jo(e):[].concat(t),r=[].concat(o,[i]),n=r[0],a=r.reduce(function(l,c){var d=xs(e,c,s);return l.top=st(d.top,l.top),l.right=Ht(d.right,l.right),l.bottom=Ht(d.bottom,l.bottom),l.left=st(d.left,l.left),l},xs(e,n,s));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function xe(e){var t=e.reference,i=e.element,s=e.placement,o=s?B(s):null,r=s?Q(s):null,n=t.x+t.width/2-i.width/2,a=t.y+t.height/2-i.height/2,l;switch(o){case I:l={x:n,y:t.y-i.height};break;case R:l={x:n,y:t.y+t.height};break;case P:l={x:t.x+t.width,y:a};break;case L:l={x:t.x-i.width,y:a};break;default:l={x:t.x,y:t.y}}var c=o?Bt(o):null;if(c!=null){var d=c==="y"?"height":"width";switch(r){case ht:l[c]=l[c]-(t[d]/2-i[d]/2);break;case Nt:l[c]=l[c]+(t[d]/2-i[d]/2);break;default:}}return l}function rt(e,t){t===void 0&&(t={});var i=t,s=i.placement,o=s===void 0?e.placement:s,r=i.strategy,n=r===void 0?e.strategy:r,a=i.boundary,l=a===void 0?cs:a,c=i.rootBoundary,d=c===void 0?Fe:c,p=i.elementContext,f=p===void 0?Jt:p,u=i.altBoundary,y=u===void 0?!1:u,b=i.padding,g=b===void 0?0:b,_=be(typeof g!="number"?g:ye(g,gt)),C=f===Jt?hs:Jt,T=e.rects.popper,m=e.elements[y?C:f],x=yi(J(m)?m:m.contextElement||F(e.elements.popper),l,d,n),w=Z(e.elements.reference),S=xe({reference:w,element:T,strategy:"absolute",placement:o}),q=ee(Object.assign({},T,S)),H=f===Jt?q:w,O={top:x.top-H.top+_.top,bottom:H.bottom-x.bottom+_.bottom,left:x.left-H.left+_.left,right:H.right-x.right+_.right},V=e.modifiersData.offset;if(f===Jt&&V){var et=V[o];Object.keys(O).forEach(function(j){var At=[P,R].indexOf(j)>=0?1:-1,Et=[I,R].indexOf(j)>=0?"y":"x";O[j]+=et[Et]*At})}return O}function xi(e,t){t===void 0&&(t={});var i=t,s=i.placement,o=i.boundary,r=i.rootBoundary,n=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=l===void 0?Ve:l,d=Q(s),p=d?a?mi:mi.filter(function(y){return Q(y)===d}):gt,f=p.filter(function(y){return c.indexOf(y)>=0});f.length===0&&(f=p);var u=f.reduce(function(y,b){return y[b]=rt(e,{placement:b,boundary:o,rootBoundary:r,padding:n})[B(b)],y},{});return Object.keys(u).sort(function(y,b){return u[y]-u[b]})}function Ko(e){if(B(e)===ze)return[];var t=te(e);return[je(e),t,je(t)]}function Go(e){var t=e.state,i=e.options,s=e.name;if(!t.modifiersData[s]._skip){for(var o=i.mainAxis,r=o===void 0?!0:o,n=i.altAxis,a=n===void 0?!0:n,l=i.fallbackPlacements,c=i.padding,d=i.boundary,p=i.rootBoundary,f=i.altBoundary,u=i.flipVariations,y=u===void 0?!0:u,b=i.allowedAutoPlacements,g=t.options.placement,_=B(g),C=_===g,T=l||(C||!y?[te(g)]:Ko(g)),m=[g].concat(T).reduce(function(jt,vt){return jt.concat(B(vt)===ze?xi(t,{placement:vt,boundary:d,rootBoundary:p,padding:c,flipVariations:y,allowedAutoPlacements:b}):vt)},[]),x=t.rects.reference,w=t.rects.popper,S=new Map,q=!0,H=m[0],O=0;O<m.length;O++){var V=m[O],et=B(V),j=Q(V)===ht,At=[I,R].indexOf(et)>=0,Et=At?"width":"height",G=rt(t,{placement:V,boundary:d,rootBoundary:p,altBoundary:f,padding:c}),it=At?j?P:L:j?R:I;x[Et]>w[Et]&&(it=te(it));var Ae=te(it),kt=[];if(r&&kt.push(G[et]<=0),a&&kt.push(G[it]<=0,G[Ae]<=0),kt.every(function(jt){return jt})){H=V,q=!1;break}S.set(V,kt)}if(q)for(var Ee=y?3:1,Ze=function(vt){var se=m.find(function(Se){var St=S.get(Se);if(St)return St.slice(0,vt).every(function(Qe){return Qe})});if(se)return H=se,"break"},ie=Ee;ie>0;ie--){var ke=Ze(ie);if(ke==="break")break}t.placement!==H&&(t.modifiersData[s]._skip=!0,t.placement=H,t.reset=!0)}}var ws={name:"flip",enabled:!0,phase:"main",fn:Go,requiresIfExists:["offset"],data:{_skip:!1}};function _s(e,t,i){return i===void 0&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function As(e){return[I,P,R,L].some(function(t){return e[t]>=0})}function Xo(e){var t=e.state,i=e.name,s=t.rects.reference,o=t.rects.popper,r=t.modifiersData.preventOverflow,n=rt(t,{elementContext:"reference"}),a=rt(t,{altBoundary:!0}),l=_s(n,s),c=_s(a,o,r),d=As(l),p=As(c);t.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":p})}var Es={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Xo};function Yo(e,t,i){var s=B(e),o=[L,I].indexOf(s)>=0?-1:1,r=typeof i=="function"?i(Object.assign({},t,{placement:e})):i,n=r[0],a=r[1];return n=n||0,a=(a||0)*o,[L,P].indexOf(s)>=0?{x:a,y:n}:{x:n,y:a}}function Jo(e){var t=e.state,i=e.options,s=e.name,o=i.offset,r=o===void 0?[0,0]:o,n=Ve.reduce(function(d,p){return d[p]=Yo(p,t.rects,r),d},{}),a=n[t.placement],l=a.x,c=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[s]=n}var ks={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Jo};function Zo(e){var t=e.state,i=e.name;t.modifiersData[i]=xe({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}var Ss={name:"popperOffsets",enabled:!0,phase:"read",fn:Zo,data:{}};function wi(e){return e==="x"?"y":"x"}function Qo(e){var t=e.state,i=e.options,s=e.name,o=i.mainAxis,r=o===void 0?!0:o,n=i.altAxis,a=n===void 0?!1:n,l=i.boundary,c=i.rootBoundary,d=i.altBoundary,p=i.padding,f=i.tether,u=f===void 0?!0:f,y=i.tetherOffset,b=y===void 0?0:y,g=rt(t,{boundary:l,rootBoundary:c,padding:p,altBoundary:d}),_=B(t.placement),C=Q(t.placement),T=!C,m=Bt(_),x=wi(m),w=t.modifiersData.popperOffsets,S=t.rects.reference,q=t.rects.popper,H=typeof b=="function"?b(Object.assign({},t.rects,{placement:t.placement})):b,O=typeof H=="number"?{mainAxis:H,altAxis:H}:Object.assign({mainAxis:0,altAxis:0},H),V=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,et={x:0,y:0};if(w){if(r){var j,At=m==="y"?I:L,Et=m==="y"?R:P,G=m==="y"?"height":"width",it=w[m],Ae=it+g[At],kt=it-g[Et],Ee=u?-q[G]/2:0,Ze=C===ht?S[G]:q[G],ie=C===ht?-q[G]:-S[G],ke=t.elements.arrow,jt=u&&ke?Ut(ke):{width:0,height:0},vt=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:ge(),se=vt[At],Se=vt[Et],St=qt(0,S[G],jt[G]),Qe=T?S[G]/2-Ee-St-se-O.mainAxis:Ze-St-se-O.mainAxis,Ns=T?-S[G]/2+Ee+St+Se+O.mainAxis:ie+St+Se+O.mainAxis,ti=t.elements.arrow&&ot(t.elements.arrow),Hs=ti?m==="y"?ti.clientTop||0:ti.clientLeft||0:0,Di=(j=V?.[m])!=null?j:0,Us=it+Qe-Di-Hs,Bs=it+Ns-Di,Mi=qt(u?Ht(Ae,Us):Ae,it,u?st(kt,Bs):kt);w[m]=Mi,et[m]=Mi-it}if(a){var Ri,qs=m==="x"?I:L,zs=m==="x"?R:P,$t=w[x],$e=x==="y"?"height":"width",Ni=$t+g[qs],Hi=$t-g[zs],ei=[I,L].indexOf(_)!==-1,Ui=(Ri=V?.[x])!=null?Ri:0,Bi=ei?Ni:$t-S[$e]-q[$e]-Ui+O.altAxis,qi=ei?$t+S[$e]+q[$e]-Ui-O.altAxis:Hi,zi=u&&ei?ms(Bi,$t,qi):qt(u?Bi:Ni,$t,u?qi:Hi);w[x]=zi,et[x]=zi-$t}t.modifiersData[s]=et}}var $s={name:"preventOverflow",enabled:!0,phase:"main",fn:Qo,requiresIfExists:["offset"]};function _i(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Ai(e){return e===E(e)||!N(e)?zt(e):_i(e)}function tr(e){var t=e.getBoundingClientRect(),i=pt(t.width)/e.offsetWidth||1,s=pt(t.height)/e.offsetHeight||1;return i!==1||s!==1}function Ei(e,t,i){i===void 0&&(i=!1);var s=N(t),o=N(t)&&tr(t),r=F(t),n=Z(e,o,i),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(s||!s&&!i)&&((U(t)!=="body"||Vt(r))&&(a=Ai(t)),N(t)?(l=Z(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):r&&(l.x=Ft(r))),{x:n.left+a.scrollLeft-l.x,y:n.top+a.scrollTop-l.y,width:n.width,height:n.height}}function er(e){var t=new Map,i=new Set,s=[];e.forEach(function(r){t.set(r.name,r)});function o(r){i.add(r.name);var n=[].concat(r.requires||[],r.requiresIfExists||[]);n.forEach(function(a){if(!i.has(a)){var l=t.get(a);l&&o(l)}}),s.push(r)}return e.forEach(function(r){i.has(r.name)||o(r)}),s}function ki(e){var t=er(e);return ps.reduce(function(i,s){return i.concat(t.filter(function(o){return o.phase===s}))},[])}function Si(e){var t;return function(){return t||(t=new Promise(function(i){Promise.resolve().then(function(){t=void 0,i(e())})})),t}}function $i(e){var t=e.reduce(function(i,s){var o=i[s.name];return i[s.name]=o?Object.assign({},o,s,{options:Object.assign({},o.options,s.options),data:Object.assign({},o.data,s.data)}):s,i},{});return Object.keys(t).map(function(i){return t[i]})}var Is={placement:"bottom",modifiers:[],strategy:"absolute"};function Cs(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return!t.some(function(s){return!(s&&typeof s.getBoundingClientRect=="function")})}function Ts(e){e===void 0&&(e={});var t=e,i=t.defaultModifiers,s=i===void 0?[]:i,o=t.defaultOptions,r=o===void 0?Is:o;return function(a,l,c){c===void 0&&(c=r);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},Is,r),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},p=[],f=!1,u={state:d,setOptions:function(_){var C=typeof _=="function"?_(d.options):_;b(),d.options=Object.assign({},r,d.options,C),d.scrollParents={reference:J(a)?bt(a):a.contextElement?bt(a.contextElement):[],popper:bt(l)};var T=ki($i([].concat(s,d.options.modifiers)));return d.orderedModifiers=T.filter(function(m){return m.enabled}),y(),u.update()},forceUpdate:function(){if(!f){var _=d.elements,C=_.reference,T=_.popper;if(Cs(C,T)){d.rects={reference:Ei(C,ot(T),d.options.strategy==="fixed"),popper:Ut(T)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(O){return d.modifiersData[O.name]=Object.assign({},O.data)});for(var m=0;m<d.orderedModifiers.length;m++){if(d.reset===!0){d.reset=!1,m=-1;continue}var x=d.orderedModifiers[m],w=x.fn,S=x.options,q=S===void 0?{}:S,H=x.name;typeof w=="function"&&(d=w({state:d,options:q,name:H,instance:u})||d)}}}},update:Si(function(){return new Promise(function(g){u.forceUpdate(),g(d)})}),destroy:function(){b(),f=!0}};if(!Cs(a,l))return u;u.setOptions(c).then(function(g){!f&&c.onFirstUpdate&&c.onFirstUpdate(g)});function y(){d.orderedModifiers.forEach(function(g){var _=g.name,C=g.options,T=C===void 0?{}:C,m=g.effect;if(typeof m=="function"){var x=m({state:d,name:_,instance:u,options:T}),w=function(){};p.push(x||w)}})}function b(){p.forEach(function(g){return g()}),p=[]}return u}}var ir=[ys,Ss,bs,us,ks,ws,$s,vs,Es],Ii=Ts({defaultModifiers:ir});var sr=`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="12" viewBox="0 0 24 12">\r
105
106
  <path d="M0 0l11.96 12L24 0z" fill="#999" class="arrow-border"/>\r
106
107
  <path d="M12 11L1 0h22z" fill="#f2f2f2" class="arrow-background"/>\r
107
108
  </svg>\r
108
- `,or=navigator.userAgent.indexOf("Trident")!==-1,Ls=1,Ps="sd-popover-open",Os=class extends HTMLElement{constructor(){super(...arguments),this._open=!1,this._firstUpdated=!1,this.toggle=()=>{this.open=!this.open},this.show=()=>{this.open=!0},this.hide=()=>{this.open=!1},this.hideIfExternalTarget=t=>{let i=t.target;(!(i instanceof HTMLElement)||!this._container.contains(i)&&!this.targetElement.contains(i))&&this.hide()}}get triggerType(){return this.getAttribute("trigger-type")}set triggerType(t){t?this.setAttribute("trigger-type",t):this.removeAttribute("trigger-type")}get placement(){return this.getAttribute("placement")}set placement(t){t?this.setAttribute("placement",t):this.removeAttribute("placement")}get targetElement(){return this._targetElement}set targetElement(t){this.removeTargetEventListener(this.targetElement),this._targetElement&&this._targetElement.getAttribute("aria-expanded")=="true"&&this._targetElement.setAttribute("aria-expanded","false"),this._targetElement=t,t&&t.setAttribute("aria-expanded","false"),this.addTargetEventListener(this.targetElement),this.updatePopper()}get targetSelector(){return this.getAttribute("target-selector")}set targetSelector(t){t?this.setAttribute("target-selector",t):this.removeAttribute("target-selector")}get modal(){return this.hasAttribute("modal")}set modal(t){t?this.setAttribute("modal",""):this.removeAttribute("modal")}get popoverFor(){return this.getAttribute("popover-for")}set popoverFor(t){t?this.setAttribute("popover-for",t):this.removeAttribute("popover-for")}get flipPriority(){return this._flipPriority}set flipPriority(t){t&&t.length>0?this._flipPriority=t:this._flipPriority=null,this.reConfigurePopper()}get offset(){return this.getAttribute("offset")?parseInt(this.getAttribute("offset")):0}set offset(t){t?this.setAttribute("offset",t.toString()):this.removeAttribute("offset"),this.reConfigurePopper()}reConfigurePopper(){this._popper&&this.configurePopper()}get noArrow(){return this.hasAttribute("no-arrow")}set noArrow(t){t?this.setAttribute("no-arrow",""):this.removeAttribute("no-arrow")}static get observedAttributes(){return["placement","target-selector","trigger-type"]}attributeChangedCallback(t,i){switch(t){case"placement":{this.updatePopper();break}case"trigger-type":{this.removeTargetEventListener(this.targetElement),this.addTargetEventListener(this.targetElement);break}case"target-selector":{this.handleTargetSelectorChange(i);break}}}connectedCallback(){this._firstUpdated||(this.firstUpdated(),this._firstUpdated=!0),this.targetElement?this.addTargetEventListener(this.targetElement):this.targetSelector&&requestAnimationFrame(()=>{this.isConnected&&this.handleTargetSelectorChange(null)}),this._arrow=document.createElement("div"),this._arrow.classList.add("popover-arrow"),this._arrow.setAttribute("data-popper-arrow",""),this._arrow.style.display="flex",this._arrow.innerHTML=sr}disconnectedCallback(){this.targetElement&&(this.removeTargetEventListener(this.targetElement),this.removeTargetClassForOpen(this.targetElement)),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}firstUpdated(){this.style.display="none",this.triggerType=this.triggerType||"click",this.placement=this.placement||"auto"}get open(){return this._open}set open(t){t!==this._open&&(this._open=t,this.handleOpenChange())}handleOpenChange(){this.open?(this._popper||this.configurePopper(),this._container.innerHTML="",this.popoverFor&&this._container.setAttribute("popover-for",this.popoverFor),this.content&&(this._container.prepend(this.content),Object.assign(this.content.style,{position:"relative",display:"block",zIndex:1}),window.requestAnimationFrame(()=>{let t=getComputedStyle(this.content).backgroundColor;t=="rgba(0, 0, 0, 0)"&&(this.content.style.background=t="#f2f2f2"),this._arrow.querySelector(".arrow-background").style.fill=t})),this.ensureArrowIsAdded(),this.ownerDocument.body.appendChild(this._container),this.updatePopper(),this.setAttribute("open",""),this.modal&&(window.addEventListener("click",this.hideIfExternalTarget,{capture:!0}),window.addEventListener("focus",this.hideIfExternalTarget,{capture:!0})),this.targetElement&&(this.addTargetClassForOpen(this.targetElement),this.targetElement.setAttribute("aria-expanded","true")),this.dispatchEvent(new CustomEvent("open"))):(this.ownerDocument.body.removeChild(this._container),this.removeAttribute("open"),window.removeEventListener("click",this.hideIfExternalTarget,{capture:!0}),window.removeEventListener("focus",this.hideIfExternalTarget,{capture:!0}),this.targetElement&&(this.removeTargetClassForOpen(this.targetElement),this.targetElement.setAttribute("aria-expanded","false")),this.dispatchEvent(new CustomEvent("close")))}handleTargetSelectorChange(t){let i=document.querySelector(t);i&&(this.removeTargetEventListener(i),this.removeTargetClassForOpen(i)),this.targetSelector&&(this.targetElement=document.querySelector(this.targetSelector),this.addTargetEventListener(this.targetElement))}addTargetEventListener(t){if(t)switch(this.triggerType){case"hover":{t.addEventListener("mouseenter",this.show),t.addEventListener("mouseleave",this.hide);break}case"click":{t.addEventListener("click",this.toggle);break}}}removeTargetEventListener(t){if(t)switch(this.triggerType){case"hover":{t.removeEventListener("mouseenter",this.show),t.removeEventListener("mouseleave",this.hide);break}case"click":{t.removeEventListener("click",this.toggle);break}}}configurePopper(){this.createContentContainer(),this.ensureArrowIsAdded();let t=this,i={placement:t.placement,strategy:"absolute",modifiers:[{name:"computeStyles",options:{gpuAcceleration:!or}},{name:"flip",options:{fallbackPlacements:t._flipPriority}},{name:"offset",options:{offset:()=>[0,t.noArrow?0+t.offset:this._arrow.clientHeight+t.offset]}},{name:"arrow",options:{padding:6}},{name:"resetArrowStyles",enabled:!0,phase:"beforeWrite",fn({state:s}){Object.assign(t._arrow.style,{top:s.styles.arrow.top||"",left:s.styles.arrow.left||"",bottom:s.styles.arrow.bottom||"",right:s.styles.arrow.right||""})}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn({state:s}){t.updateArrow(s.placement)}}]};this._popper=Ii(this.targetElement,this._container,i)}createContentContainer(){this._container=document.createElement("div"),this._container.classList.add("popover-container"),this._container.tabIndex=0,this._resizeObserver&&this._resizeObserver.disconnect(),this._resizeObserver=new ResizeObserver(()=>{this._popper&&this._popper.update()}),this._resizeObserver.observe(this._container),Object.assign(this._container.style,{boxShadow:`0 4px 5px 0 rgba(0, 0, 0, 0.14),
109
+ `,or=navigator.userAgent.indexOf("Trident")!==-1,Ls=1,Ps="sd-popover-open",Os=class extends HTMLElement{constructor(){super(...arguments),this._open=!1,this._firstUpdated=!1,this.toggle=()=>{this.open=!this.open},this.show=()=>{this.open=!0},this.hide=()=>{this.open=!1},this.hideIfExternalTarget=t=>{let i=t.target;(!(i instanceof HTMLElement)||!this._container.contains(i)&&!this.targetElement.contains(i))&&this.hide()},this.handleTabKeyDown=t=>{if(t.key!=="Tab")return;let i=t.shiftKey,s=null,o=t.target,r=this.content;o instanceof HTMLElement&&r&&(s=this.findNextFocusableAfter(o,r,!i)),!s&&(t.preventDefault(),this.open=!1,this.findNextFocusableAfter(this.targetElement,null,!i)?.focus())}}get triggerType(){return this.getAttribute("trigger-type")}set triggerType(t){t?this.setAttribute("trigger-type",t):this.removeAttribute("trigger-type")}get placement(){return this.getAttribute("placement")}set placement(t){t?this.setAttribute("placement",t):this.removeAttribute("placement")}get targetElement(){return this._targetElement}set targetElement(t){this.removeTargetEventListener(this.targetElement),this._targetElement&&this._targetElement.getAttribute("aria-expanded")=="true"&&this._targetElement.setAttribute("aria-expanded","false"),this._targetElement=t,t&&t.setAttribute("aria-expanded","false"),this.addTargetEventListener(this.targetElement),this.updatePopper()}get targetSelector(){return this.getAttribute("target-selector")}set targetSelector(t){t?this.setAttribute("target-selector",t):this.removeAttribute("target-selector")}get modal(){return this.hasAttribute("modal")}set modal(t){t?this.setAttribute("modal",""):this.removeAttribute("modal")}get popoverFor(){return this.getAttribute("popover-for")}set popoverFor(t){t?this.setAttribute("popover-for",t):this.removeAttribute("popover-for")}get flipPriority(){return this._flipPriority}set flipPriority(t){t&&t.length>0?this._flipPriority=t:this._flipPriority=null,this.reConfigurePopper()}get offset(){return this.getAttribute("offset")?parseInt(this.getAttribute("offset")):0}set offset(t){t?this.setAttribute("offset",t.toString()):this.removeAttribute("offset"),this.reConfigurePopper()}reConfigurePopper(){this._popper&&this.configurePopper()}get noArrow(){return this.hasAttribute("no-arrow")}set noArrow(t){t?this.setAttribute("no-arrow",""):this.removeAttribute("no-arrow")}static get observedAttributes(){return["placement","target-selector","trigger-type"]}attributeChangedCallback(t,i){switch(t){case"placement":{this.updatePopper();break}case"trigger-type":{this.removeTargetEventListener(this.targetElement),this.addTargetEventListener(this.targetElement);break}case"target-selector":{this.handleTargetSelectorChange(i);break}}}connectedCallback(){this._firstUpdated||(this.firstUpdated(),this._firstUpdated=!0),this.targetElement?this.addTargetEventListener(this.targetElement):this.targetSelector&&requestAnimationFrame(()=>{this.isConnected&&this.handleTargetSelectorChange(null)}),this._arrow=document.createElement("div"),this._arrow.classList.add("popover-arrow"),this._arrow.setAttribute("data-popper-arrow",""),this._arrow.style.display="flex",this._arrow.innerHTML=sr}disconnectedCallback(){this.targetElement&&(this.removeTargetEventListener(this.targetElement),this.removeTargetClassForOpen(this.targetElement)),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}firstUpdated(){this.style.display="none",this.triggerType=this.triggerType||"click",this.placement=this.placement||"auto"}get open(){return this._open}set open(t){t!==this._open&&(this._open=t,this.handleOpenChange())}handleOpenChange(){this.open?(this._popper||this.configurePopper(),this._container.innerHTML="",this.popoverFor&&this._container.setAttribute("popover-for",this.popoverFor),this.content&&(this._container.prepend(this.content),Object.assign(this.content.style,{position:"relative",display:"block",zIndex:1}),window.requestAnimationFrame(()=>{let t=getComputedStyle(this.content).backgroundColor;t=="rgba(0, 0, 0, 0)"&&(this.content.style.background=t="#f2f2f2"),this._arrow.querySelector(".arrow-background").style.fill=t})),this.ensureArrowIsAdded(),this.ownerDocument.body.appendChild(this._container),this.updatePopper(),this.setAttribute("open",""),this.modal&&(window.addEventListener("click",this.hideIfExternalTarget,{capture:!0}),window.addEventListener("focus",this.hideIfExternalTarget,{capture:!0})),this.targetElement&&(this.addTargetClassForOpen(this.targetElement),this.targetElement.setAttribute("aria-expanded","true")),this.dispatchEvent(new CustomEvent("open")),this._container.addEventListener("keydown",this.handleTabKeyDown)):(this.ownerDocument.body.removeChild(this._container),this.removeAttribute("open"),window.removeEventListener("click",this.hideIfExternalTarget,{capture:!0}),window.removeEventListener("focus",this.hideIfExternalTarget,{capture:!0}),this.targetElement&&(this.removeTargetClassForOpen(this.targetElement),this.targetElement.setAttribute("aria-expanded","false")),this.dispatchEvent(new CustomEvent("close")),this._container.removeEventListener("keydown",this.handleTabKeyDown))}handleTargetSelectorChange(t){let i=document.querySelector(t);i&&(this.removeTargetEventListener(i),this.removeTargetClassForOpen(i)),this.targetSelector&&(this.targetElement=document.querySelector(this.targetSelector),this.addTargetEventListener(this.targetElement))}addTargetEventListener(t){if(t)switch(this.triggerType){case"hover":{t.addEventListener("mouseenter",this.show),t.addEventListener("mouseleave",this.hide);break}case"click":{t.addEventListener("click",this.toggle);break}}}removeTargetEventListener(t){if(t)switch(this.triggerType){case"hover":{t.removeEventListener("mouseenter",this.show),t.removeEventListener("mouseleave",this.hide);break}case"click":{t.removeEventListener("click",this.toggle);break}}}configurePopper(){this.createContentContainer(),this.ensureArrowIsAdded();let t=this,i={placement:t.placement,strategy:"absolute",modifiers:[{name:"computeStyles",options:{gpuAcceleration:!or}},{name:"flip",options:{fallbackPlacements:t._flipPriority}},{name:"offset",options:{offset:()=>[0,t.noArrow?0+t.offset:this._arrow.clientHeight+t.offset]}},{name:"arrow",options:{padding:6}},{name:"resetArrowStyles",enabled:!0,phase:"beforeWrite",fn({state:s}){Object.assign(t._arrow.style,{top:s.styles.arrow.top||"",left:s.styles.arrow.left||"",bottom:s.styles.arrow.bottom||"",right:s.styles.arrow.right||""})}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn({state:s}){t.updateArrow(s.placement)}}]};this._popper=Ii(this.targetElement,this._container,i)}createContentContainer(){this._container=document.createElement("div"),this._container.classList.add("popover-container"),this._container.tabIndex=0,this._resizeObserver&&this._resizeObserver.disconnect(),this._resizeObserver=new ResizeObserver(()=>{this._popper&&this._popper.update()}),this._resizeObserver.observe(this._container),Object.assign(this._container.style,{boxShadow:`0 4px 5px 0 rgba(0, 0, 0, 0.14),
109
110
  0 1px 10px 0 rgba(0, 0, 0, 0.12),
110
- 0 2px 4px -1px rgba(0, 0, 0, 0.4)`,border:"1px solid #999",boxSizing:"border-box",zIndex:2e4})}ensureArrowIsAdded(){!this.noArrow&&!this._container.contains(this._arrow)&&this._container.appendChild(this._arrow)}updatePopper(){this._popper&&(this._popper.state.elements.reference=this.targetElement,this._popper.state.options.placement=this.placement,this.open&&this._popper.update())}updateArrow(t){if(this._arrow){let i=this.getArrowVariant(t);if(this._arrow.setAttribute("variant",i),this._content){let s=this._arrow.querySelector("svg"),o=this._arrow.clientWidth,r=this._arrow.clientHeight,n=`-${r-Ls}px`,a=(o-r)/2,l=`-${r+a-Ls}px`;switch(i){case"bottom":{this._arrow.style.top=n,s.style.transform="rotate(180deg)";break}case"top":{this._arrow.style.bottom=n,s.style.transform="rotate(0deg)";break}case"left":{this._arrow.style.right=l,s.style.transform="rotate(270deg)";break}case"right":{this._arrow.style.left=l,s.style.transform="rotate(90deg)";break}}}}}getArrowVariant(t){if(t.indexOf("bottom")!==-1)return"bottom";if(t.indexOf("top")!==-1)return"top";if(t.indexOf("left")!==-1)return"left";if(t.indexOf("right")!==-1)return"right"}get content(){return this._content||(this._content=this.firstElementChild,this._content.setAttribute("data-popper-content","")),this._content}addTargetClassForOpen(t){t&&t.classList.add(Ps)}removeTargetClassForOpen(t){t&&t.classList.remove(Ps)}};Os.ID="sd-popover";var we=Os;customElements.get(we.ID)||customElements.define(we.ID,we);var Ci=class{getOffsetForIndexAndAlignment(t,i,s,o,r,n){let a=Math.max(0,n*o),l=Math.min(a,t*o),c=Math.max(0,t*o-r+o);switch(i){case"start":return l;case"end":return c;case"center":{let d=Math.round(c+(l-c)/2);return d<Math.ceil(r/2)?0:d>a+Math.floor(r/2)?a:d}case"auto":default:return s>=c&&s<=l?s:s<c?c:l}}debounce(t){let i;return(...s)=>{i&&window.cancelAnimationFrame(i),i=window.requestAnimationFrame(()=>{t(...s),i=null})}}},rr=new Ci;var nr=":host{display:block;position:relative;contain:layout}:host(:focus){outline:none}:host(:focus-visible) ::slotted([focused]){box-shadow:0 0 0 1px #1467ba inset}.container{width:100%}.container>::slotted(*){width:100%;position:absolute;box-sizing:border-box}.container>::slotted(:not([last])){border-bottom:1px solid #d9d9d9}",ar=Object.defineProperty,lr=Object.getOwnPropertyDescriptor,xt=(e,t,i,s)=>{for(var o=s>1?void 0:s?lr(t,i):t,r=e.length-1,n;r>=0;r--)(n=e[r])&&(o=(s?n(t,i,o):n(o))||o);return s&&o&&ar(t,i,o),o};var dr=0,yt,ft=(yt=class extends D{constructor(){super(),this.items=[],this.selectionType="trigger-only",this.id=yt.ID+"_"+dr++,this.role="listbox",this.itemGenerator=qe,this._lastKnownScrollTop=0,this._lastRenderedScrollTop=0,this._itemsRenderData=[],this._elementCache=new Map,this._visibleItemsNum=0,this._selectedIndices=[],this._focusIndex=-1,this._lastKnownHeight=0,this.onScroll=()=>{this._lastKnownScrollTop=this.scrollTop;let e=this._lastRenderedScrollTop-this._lastKnownScrollTop;Math.abs(e)>=this.itemHeight&&(this._lastRenderedScrollTop=this._lastKnownScrollTop,this.requestUpdate())},this.handleKeyDown=e=>{let t=!0;switch(e.key){case"Down":case"ArrowDown":this.focusIndex=this.normalizeIndex(this.focusIndex+1);break;case"Up":case"ArrowUp":this.focusIndex=this.normalizeIndex(this.focusIndex-1);break;case"Enter":this.handleSelection(this.focusIndex,e.metaKey||e.ctrlKey);break;case"End":this.focusIndex=this.itemCount-1;break;case"PageDown":this.focusIndex=this.normalizeIndex(this.focusIndex+this._visibleItemsNum-1);break;case"Home":this.focusIndex=0;break;case"PageUp":this.focusIndex=this.normalizeIndex(this.focusIndex-this._visibleItemsNum+1);break;default:t=!1;break}t&&(e.preventDefault(),e.stopPropagation())},this._resizeObserver=new ResizeObserver(()=>{this._lastKnownHeight!==this.offsetHeight&&(this._lastKnownHeight=this.offsetHeight,this.requestUpdate())})}get focusTarget(){return this.hasAttribute("focus-target")}set focusTarget(e){this.toggleAttribute("focus-target",e)}get focusIndex(){return this._focusIndex}set focusIndex(e){if(e>=-1&&e<this.itemCount){let t=this._focusIndex;this._focusIndex=e,(e<=this._firstVisibleIndex||this._lastVisibleIndex<=e)&&this.scrollToItem(e),t!=e&&(e==-1&&this.removeAttribute("aria-activedescendant"),this.requestUpdate("focusIndex",t))}}get selectedIndices(){return this._selectedIndices}set selectedIndices(e){e?this._selectedIndices=e.map(t=>Number(t)):this._selectedIndices=[],this.requestUpdate("selectedIndices")}scrollToItem(e,t="auto"){this.scrollTop=rr.getOffsetForIndexAndAlignment(this.normalizeIndex(e),t,this.scrollTop,this.itemHeight,this.height,this.itemCount),this._lastKnownScrollTop=this.scrollTop}getListItem(e){return!this.shadowRoot||e<this._firstVisibleIndex||this._lastVisibleIndex<e?null:this.querySelector(`[item-index="${e}"]`)}connectedCallback(){super.connectedCallback(),this._resizeObserver.observe(this),this.scrollTop!==this._lastKnownScrollTop&&(this.scrollTop=this._lastKnownScrollTop,this.requestUpdate())}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver.disconnect()}firstUpdated(e){super.firstUpdated(e),this.addEventListener("scroll",this.onScroll),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("click",this.handleClick),this.addEventListener("mousedown",t=>{t.button==1&&t.preventDefault()}),this.addEventListener("auxclick",this.handleClick),this.addEventListener("focus",()=>{this.matches(":focus-visible")&&(this.focusIndex==-1?(this.selectedIndices&&(this.focusIndex=this.selectedIndices[0]),this.focusIndex==-1&&this.itemCount>0&&(this.focusIndex=0)):this.updateFocusedItemAttributes())}),this.addEventListener("blur",()=>{this.focusIndex!=-1&&this.updateFocusedItemAttributes()}),this.selectedIndices.length>0&&this.scrollToItem(this.selectedIndices[0],"center")}updateFocusedItemAttributes(){let e=this.getListItem(this.focusIndex);e&&(this.focusTarget||document.activeElement==this?(e.setAttribute("focused",""),this.setAttribute("aria-activedescendant",e.id)):(e.removeAttribute("focused"),this.removeAttribute("aria-activedescendant")))}static get styles(){return[at`
111
+ 0 2px 4px -1px rgba(0, 0, 0, 0.4)`,border:"1px solid #999",boxSizing:"border-box",zIndex:2e4})}ensureArrowIsAdded(){!this.noArrow&&!this._container.contains(this._arrow)&&this._container.appendChild(this._arrow)}updatePopper(){this._popper&&(this._popper.state.elements.reference=this.targetElement,this._popper.state.options.placement=this.placement,this.open&&this._popper.update())}updateArrow(t){if(this._arrow){let i=this.getArrowVariant(t);if(this._arrow.setAttribute("variant",i),this._content){let s=this._arrow.querySelector("svg"),o=this._arrow.clientWidth,r=this._arrow.clientHeight,n=`-${r-Ls}px`,a=(o-r)/2,l=`-${r+a-Ls}px`;switch(i){case"bottom":{this._arrow.style.top=n,s.style.transform="rotate(180deg)";break}case"top":{this._arrow.style.bottom=n,s.style.transform="rotate(0deg)";break}case"left":{this._arrow.style.right=l,s.style.transform="rotate(270deg)";break}case"right":{this._arrow.style.left=l,s.style.transform="rotate(90deg)";break}}}}}getArrowVariant(t){if(t.indexOf("bottom")!==-1)return"bottom";if(t.indexOf("top")!==-1)return"top";if(t.indexOf("left")!==-1)return"left";if(t.indexOf("right")!==-1)return"right"}get content(){return this._content||(this._content=this.firstElementChild,this._content.setAttribute("data-popper-content","")),this._content}addTargetClassForOpen(t){t&&t.classList.add(Ps)}removeTargetClassForOpen(t){t&&t.classList.remove(Ps)}findNextFocusableAfter(t,i,s){if(!t)return null;let o=i??document.body,r=document.createTreeWalker(o,NodeFilter.SHOW_ELEMENT,{acceptNode(n){let a=n;return a.tabIndex>=0&&!a.hidden&&a.offsetParent!==null?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return r.currentNode=t,s?r.nextNode():r.previousNode()}};Os.ID="sd-popover";var we=Os;customElements.get(we.ID)||customElements.define(we.ID,we);var Ci=class{getOffsetForIndexAndAlignment(t,i,s,o,r,n){let a=Math.max(0,n*o),l=Math.min(a,t*o),c=Math.max(0,t*o-r+o);switch(i){case"start":return l;case"end":return c;case"center":{let d=Math.round(c+(l-c)/2);return d<Math.ceil(r/2)?0:d>a+Math.floor(r/2)?a:d}case"auto":default:return s>=c&&s<=l?s:s<c?c:l}}debounce(t){let i;return(...s)=>{i&&window.cancelAnimationFrame(i),i=window.requestAnimationFrame(()=>{t(...s),i=null})}}},rr=new Ci;var nr=":host{display:block;position:relative;contain:layout}:host(:focus){outline:none}:host(:focus-visible) ::slotted([focused]){box-shadow:0 0 0 1px #1467ba inset}.container{width:100%}.container>::slotted(*){width:100%;position:absolute;box-sizing:border-box}.container>::slotted(:not([last])){border-bottom:1px solid #d9d9d9}",ar=Object.defineProperty,lr=Object.getOwnPropertyDescriptor,xt=(e,t,i,s)=>{for(var o=s>1?void 0:s?lr(t,i):t,r=e.length-1,n;r>=0;r--)(n=e[r])&&(o=(s?n(t,i,o):n(o))||o);return s&&o&&ar(t,i,o),o};var dr=0,yt,ft=(yt=class extends D{constructor(){super(),this.items=[],this.selectionType="trigger-only",this.id=yt.ID+"_"+dr++,this.role="listbox",this.itemGenerator=qe,this._lastKnownScrollTop=0,this._lastRenderedScrollTop=0,this._itemsRenderData=[],this._elementCache=new Map,this._visibleItemsNum=0,this._selectedIndices=[],this._focusIndex=-1,this._lastKnownHeight=0,this.onScroll=()=>{this._lastKnownScrollTop=this.scrollTop;let e=this._lastRenderedScrollTop-this._lastKnownScrollTop;Math.abs(e)>=this.itemHeight&&(this._lastRenderedScrollTop=this._lastKnownScrollTop,this.requestUpdate())},this.handleKeyDown=e=>{let t=!0;switch(e.key){case"Down":case"ArrowDown":this.focusIndex=(this.focusIndex+1)%this.itemCount;break;case"Up":case"ArrowUp":this.focusIndex>0?this.focusIndex--:this.finalSizeIsKnown&&(this.focusIndex=this.itemCount-1);break;case"Enter":this.handleSelection(this.focusIndex,e);break;case"End":this.focusIndex=this.itemCount-1;break;case"PageDown":this.focusIndex=this.normalizeIndex(this.focusIndex+this._visibleItemsNum-1);break;case"Home":this.focusIndex=0;break;case"PageUp":this.focusIndex=this.normalizeIndex(this.focusIndex-this._visibleItemsNum+1);break;default:t=!1;break}t&&(e.preventDefault(),e.stopPropagation())},this._resizeObserver=new ResizeObserver(()=>{this._lastKnownHeight!==this.offsetHeight&&(this._lastKnownHeight=this.offsetHeight,this.requestUpdate())})}get focusTarget(){return this.hasAttribute("focus-target")}set focusTarget(e){this.toggleAttribute("focus-target",e)}get focusIndex(){return this._focusIndex}set focusIndex(e){if(e>=-1&&e<this.itemCount){let t=this._focusIndex;this._focusIndex=e,(e<=this._firstVisibleIndex||this._lastVisibleIndex<=e)&&this.scrollToItem(e),t!=e&&(e==-1&&this.removeAttribute("aria-activedescendant"),this.requestUpdate("focusIndex",t))}}get selectedIndices(){return this._selectedIndices}set selectedIndices(e){e?this._selectedIndices=e.map(t=>Number(t)):this._selectedIndices=[],this.requestUpdate("selectedIndices")}scrollToItem(e,t="auto"){this.scrollTop=rr.getOffsetForIndexAndAlignment(this.normalizeIndex(e),t,this.scrollTop,this.itemHeight,this.height,this.itemCount),this._lastKnownScrollTop=this.scrollTop}getListItem(e){return!this.shadowRoot||e<this._firstVisibleIndex||this._lastVisibleIndex<e?null:this.querySelector(`[item-index="${e}"]`)}connectedCallback(){super.connectedCallback(),this._resizeObserver.observe(this),this.scrollTop!==this._lastKnownScrollTop&&(this.scrollTop=this._lastKnownScrollTop,this.requestUpdate())}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver.disconnect()}firstUpdated(e){super.firstUpdated(e),this.addEventListener("scroll",this.onScroll),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("click",this.handleClick),this.addEventListener("mousedown",t=>{t.button==1&&t.preventDefault()}),this.addEventListener("auxclick",this.handleClick),this.addEventListener("focus",()=>{this.matches(":focus-visible")&&(this.focusIndex==-1?(this.selectedIndices&&(this.focusIndex=this.selectedIndices[0]),this.focusIndex==-1&&this.itemCount>0&&(this.focusIndex=0)):this.updateFocusedItemAttributes())}),this.addEventListener("blur",()=>{this.focusIndex!=-1&&this.updateFocusedItemAttributes()}),this.selectedIndices.length>0&&this.scrollToItem(this.selectedIndices[0],"center")}updateFocusedItemAttributes(){let e=this.getListItem(this.focusIndex);e&&(this.focusTarget||document.activeElement==this?(e.setAttribute("focused",""),this.setAttribute("aria-activedescendant",e.id)):(e.removeAttribute("focused"),this.removeAttribute("aria-activedescendant")))}static get styles(){return[at`
111
112
  ${X(nr)}
112
113
  `]}render(){return this.updateItemsRenderData(),A`
113
114
  <div class="container" style="height: ${this.itemCount*this.itemHeight}px">
114
115
  <slot name="items"></slot>
115
116
  </div>
116
- `}updated(e){if(super.updated(e),this._lastRenderedScrollTop=this._lastKnownScrollTop,this.updateItems(),(this._increaseWidthOnNextRenderIfNeeded||this._reachedMaxWidth)&&this._firstVisibleIndex<this._lastVisibleIndex)if(this.querySelector("[item-index]"))this.adjustWidthIfNeeded();else{let t=new MutationObserver(()=>{this.adjustWidthIfNeeded(),t.disconnect()});t.observe(this)}}adjustWidthIfNeeded(){this._increaseWidthOnNextRenderIfNeeded?(this._increaseWidthOnNextRenderIfNeeded=!1,window.requestAnimationFrame(()=>{let e=Number.parseInt(getComputedStyle(this).maxWidth)-this.offsetWidth;if(e==0)this._reachedMaxWidth=!0,this.enableLineClampOnItemsIfNeeded();else{this._reachedMaxWidth=!1;let t=[...this.querySelectorAll("[item-index]")].map(s=>{if(s instanceof Rt){s.enableLineClamp=!1;let o=s.missingWidthForTexts;return o>e&&(s.enableLineClamp=!0),o}}),i=Math.max(...t);i>0&&(this.style.width=`${this.offsetWidth+i}px`)}})):this._reachedMaxWidth&&this.enableLineClampOnItemsIfNeeded()}enableLineClampOnItemsIfNeeded(){this.querySelectorAll("[item-index]").forEach(e=>{e instanceof Rt&&(e.enableLineClamp=e.enableLineClamp||e.missingWidthForTexts>0)})}increaseWidthOnNextRenderIfNeeded(){this._increaseWidthOnNextRenderIfNeeded=!0}updateItems(){let e=[...this.querySelectorAll("[item-index]")],t=new Map,i=document.createDocumentFragment();for(let s of this._itemsRenderData){let o=this.renderItem(s);o.parentElement||i.appendChild(o),t.set(s.dataHash,o);let r=e.indexOf(o);r!==-1&&e.splice(r,1)}this.appendChild(i);for(let s of e)s instanceof Rt&&(s.enableLineClamp=!1),this.removeChild(s);t.forEach((s,o)=>{this._elementCache.set(o,s)})}renderItem({index:e,top:t,dataHash:i,data:s}){let o;return s?this._elementCache.has(i)?(o=this._elementCache.get(i),this._elementCache.delete(i)):(o=this.itemGenerator(s,e),o.setAttribute("slot","items")):(o=document.createElement("div"),o.setAttribute("placeholder-item",""),o.setAttribute("slot","items")),Object.assign(o.style,{transform:`translateY(${t}px)`,height:`${this.itemHeight}px`}),o.setAttribute("item-index",e.toString()),o.setAttribute("aria-setsize",String(this.finalSizeIsKnown?this.itemCount:-1)),o.setAttribute("aria-posinset",String(e+1)),(!o.id||o.id.startsWith(this.id+"_item_"))&&(o.id=this.id+"_item_"+e),this.itemCount-1==e?o.setAttribute("last",""):o.removeAttribute("last"),this.updateSelectedAttribute(e,o),this.updateFocusedAttribute(e,o),o}updateFocusedAttribute(e,t){this.focusIndex==e&&(this.focusTarget||document.activeElement==this)?(t.setAttribute("focused",""),this.setAttribute("aria-activedescendant",t.id)):t.removeAttribute("focused")}updateSelectedAttribute(e,t){let i=this.selectedIndices.indexOf(e)!==-1;i?t.setAttribute("selected",""):t.removeAttribute("selected"),t.setAttribute("aria-selected",String(i))}updateItemsRenderData(){if(this._itemsRenderData=[],this._visibleItemsNum=Math.min(Math.ceil(this.height/this.itemHeight),this.itemCount),this._visibleItemsNum>0){this._firstVisibleIndex=this.normalizeIndex(Math.floor(this._lastKnownScrollTop/this.itemHeight)),this._lastVisibleIndex=this.normalizeIndex(this._firstVisibleIndex+this._visibleItemsNum);let e=this.normalizeIndex(this._firstVisibleIndex-2),t=this.normalizeIndex(this._lastVisibleIndex+2);this.requestData(e,t);for(let i=e;i<=t;i++){let s=i-e,o=this.items[s],r;o?r=JSON.stringify(o):r=`placeholder-${s}`,this._itemsRenderData.push({index:i,top:this.itemHeight*i,physicalIndex:s,dataHash:r,data:o})}}else this._firstVisibleIndex=0,this._lastVisibleIndex=0}normalizeIndex(e){return Math.max(0,Math.min(e,this.itemCount-1))}get height(){return this.offsetHeight}requestData(e,t){!Number.isNaN(e)&&!Number.isNaN(t)&&this.dispatchEvent(new CustomEvent("data-request",{detail:{startIndex:e,stopIndex:t}}))}handleSelection(e,t){if(e<0||this.itemCount<=e)return;let i=this.getListItem(e);if(i.getAttribute("aria-disabled")=="true"||i.hasAttribute("disabled"))return;let s=!0;if(this.selectionType!=="trigger-only"){let o=this.selectedIndices.indexOf(e);s=o==-1,s?this.selectionType==="single"?this.selectedIndices=[e]:this.selectedIndices.push(e):this.selectedIndices.splice(o,1),this.requestUpdate("selectedIndices")}this.focusIndex=e,this.dispatchSelectionEvent(e,s,t)}dispatchSelectionEvent(e,t,i){this.dispatchEvent(new CustomEvent("selection",{detail:{index:e,selected:t,hasModifier:i}}))}handleClick(e){let t=e.composedPath().find(i=>i.hasAttribute&&i.hasAttribute("item-index"));if(t){let i=parseInt(t.getAttribute("item-index"));if(Number.isInteger(i)){if(e.button==0||e.button==1){let s=e.type=="auxclick"&&e.button==1||e.metaKey||e.ctrlKey;this.handleSelection(i,s)}this.focusIndex=i}}}},yt.ID="sd-virtual-list",yt.ensureDefined=()=>{Rt.ensureDefined(),customElements.get(yt.ID)||customElements.define(yt.ID,yt)},yt);xt([h({type:Number,attribute:"item-height",reflect:!0})],ft.prototype,"itemHeight",2);xt([h({type:Number})],ft.prototype,"itemCount",2);xt([h({type:Array,attribute:!1})],ft.prototype,"items",2);xt([h({type:String,attribute:"selection-type",reflect:!0,noAccessor:!0})],ft.prototype,"selectionType",2);xt([h({type:String,attribute:!0,reflect:!0})],ft.prototype,"id",2);xt([h({type:String,reflect:!0})],ft.prototype,"role",2);xt([h({type:Number,attribute:"focus-index",reflect:!0})],ft.prototype,"focusIndex",1);xt([h({type:Array,attribute:!1})],ft.prototype,"selectedIndices",1);var Ge=ft;Ge.ensureDefined();var Xe=class e{constructor(t,i){this.eventTarget=t,this.keydownHandler=i,this.catchedKeys=["Down","ArrowDown","Up","ArrowUp","Enter"],this.markAsFocusTargetHandler=()=>this.eventTarget.setAttribute("focus-target",""),this.unmarkAsFocusTargetHandler=()=>this.eventTarget.removeAttribute("focus-target"),this.delegateKeyDownEvent=s=>{if(this.catchedKeys.indexOf(s.key)!==-1){let o=s.key.toLocaleLowerCase(),r=0,n=o.includes("enter");n||(r=o.includes("down")?1:-1),this.keydownHandler(s,r,n),s.preventDefault(),s.stopPropagation(),s.stopImmediatePropagation()}}}static delegateTo(t){return new e(t,i=>t.dispatchEvent(new KeyboardEvent(i.type,i)))}connect(t){if(t!=null){t.addEventListener("keydown",this.delegateKeyDownEvent),t.addEventListener("focus",this.markAsFocusTargetHandler),t.addEventListener("blur",this.unmarkAsFocusTargetHandler);let i=document.activeElement;(t.contains(i)||t.shadowRoot?.activeElement?.contains(i))&&this.markAsFocusTargetHandler()}}disconnect(t){t!=null&&(t.removeEventListener("keydown",this.delegateKeyDownEvent),t.removeEventListener("focus",this.markAsFocusTargetHandler),t.removeEventListener("blur",this.unmarkAsFocusTargetHandler),this.unmarkAsFocusTargetHandler())}};var _e=class extends Dt{};_e.directiveName="unsafeSVG",_e.resultType=2;var Ds=Ot(_e);var cr=0,Ti=class{constructor(t,i,s,o){this.inputElement=t,this.notSelectedTokensProvider=i,this.initializeCallback=o,this.filter=(r,n)=>r?n.filter(a=>a.disabled||a.deactivated?!1:a.caption&&a.caption.toLowerCase().includes(r)):n,Ge.ensureDefined(),this._tokenList=new Ge,this._tokenList.id="sd_token_suggest_popover_list_"+cr++,this._tokenList.style.minWidth="250px",this._tokenList.style.maxHeight="49vh",this._tokenList.itemHeight=50,this._tokenList.addEventListener("pointerdown",()=>{this.pointerDown=!0,window.addEventListener("pointerup",()=>{this.pointerDown=!1,this._tokenList.increaseWidthOnNextRenderIfNeeded(),this._tokenList.isUpdatePending||this._tokenList.requestUpdate()},{once:!0,capture:!0})}),this._tokenList.addEventListener("selection",r=>{let n=r.detail.index,a=this._suggestItems[n];s(a),this.hide()}),this._tokenList.addEventListener("data-request",r=>{this.lastRequestedStartIndex=r.detail.startIndex,this.lastRequestedStopIndex=r.detail.stopIndex,this.pointerDown||this._tokenList.increaseWidthOnNextRenderIfNeeded(),this._tokenList.items=this._suggestItems.slice(this.lastRequestedStartIndex,this.lastRequestedStopIndex+1)}),new Xe(this._tokenList,(r,n,a)=>{this._tokenList.dispatchEvent(new KeyboardEvent(r.type,r)),!a&&!this.isOpened&&this.show()}).connect(t)}show(){this.inputElement.effectiveDisabled||(this.ensurePopover(),this._suggestItems=this.filterItems((this.inputElement.value||"").toLowerCase()),this._suggestItems.length==0?this.hide():(this._tokenList.itemCount=this._suggestItems.length,this._tokenList.focusIndex=-1,this._tokenList.style.width=null,requestAnimationFrame(()=>{this.lastRequestedStartIndex!=null&&(this._tokenList.increaseWidthOnNextRenderIfNeeded(),this._tokenList.items=this._suggestItems.slice(this.lastRequestedStartIndex,this.lastRequestedStopIndex+1))}),this.popover.show()))}refreshItems(){this.isOpened&&(this._suggestItems=this.filterItems((this.inputElement.value||"").toLowerCase()),this._suggestItems.length==0?this.hide():(this._tokenList.itemCount=this._suggestItems.length,this._tokenList.items=[],this._tokenList.style.width=null))}filterItems(t){let i=this.notSelectedTokensProvider();return this.filter(t,i)}ensurePopover(){this._popover||(this._popover=this.createPopover(),this.initializeCallback(this))}hide(){this._suggestItems=[],this._tokenList.itemCount=0,this._tokenList.items=[],this._popover?.hide()}get list(){return this._tokenList}get popover(){return this.ensurePopover(),this._popover}createPopover(){let t=new we;return t.setAttribute("trigger-type","manual"),t.setAttribute("placement","bottom-start"),t.setAttribute("modal",""),t.setAttribute("popover-for","token-autosuggest-popover"),t.setAttribute("offset","-2"),t.targetElement=this.inputElement,t.appendChild(this._tokenList),t}get isOpened(){return this._popover&&this._popover.hasAttribute("open")}get focusedSuggestToken(){return this._suggestItems[this._tokenList.focusIndex]}},hr=`:host{flex-shrink:0;max-width:100%;height:28px}:host([aria-checked=true]){position:relative}:host([aria-checked=true]):before{content:"";position:absolute;left:0;top:0;height:12px;width:12px;background:#1467ba url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='12'%20height='12'%20fill='none'%3e%3cpath%20stroke='%23FFF'%20stroke-width='2'%20d='M9%204%205%208%203%206'/%3e%3c/svg%3e") no-repeat center center}.container{display:flex;height:100%;background-color:var(--sd-token-background-color, #f3f3f3);border:var(--sd-token-focused-border, var(--sd-token-border));box-sizing:border-box}.container .icon-wrapper{display:flex;flex-shrink:0;justify-content:center;align-items:center;width:28px;height:100%;overflow:hidden;background-color:var(--sd-token-icon-background-color, transparent)}.container .icon-wrapper .icon{height:100%;width:100%;object-fit:contain;background-size:cover;background-repeat:no-repeat;background-position:center}.container .value{display:inline-block;align-self:center;padding:0 8px;font-family:Segoe UI,Lucida Sans,Arial,sans-serif;font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.container .delete-button-wrapper{display:flex;align-self:center;height:16px;width:16px;padding-right:8px;opacity:.5}.container .delete-button-wrapper:hover{cursor:pointer;filter:brightness(10%);opacity:1}`,pr=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">\r
117
+ `}updated(e){if(super.updated(e),this._lastRenderedScrollTop=this._lastKnownScrollTop,this.updateItems(),(this._increaseWidthOnNextRenderIfNeeded||this._reachedMaxWidth)&&this._firstVisibleIndex<this._lastVisibleIndex)if(this.querySelector("[item-index]"))this.adjustWidthIfNeeded();else{let t=new MutationObserver(()=>{this.adjustWidthIfNeeded(),t.disconnect()});t.observe(this)}}adjustWidthIfNeeded(){this._increaseWidthOnNextRenderIfNeeded?(this._increaseWidthOnNextRenderIfNeeded=!1,window.requestAnimationFrame(()=>{let e=Number.parseInt(getComputedStyle(this).maxWidth)-this.offsetWidth;if(e==0)this._reachedMaxWidth=!0,this.enableLineClampOnItemsIfNeeded();else{this._reachedMaxWidth=!1;let t=[...this.querySelectorAll("[item-index]")].map(s=>{if(s instanceof Rt){s.enableLineClamp=!1;let o=s.missingWidthForTexts;return o>e&&(s.enableLineClamp=!0),o}}),i=Math.max(...t);i>0&&(this.style.width=`${this.offsetWidth+i}px`)}})):this._reachedMaxWidth&&this.enableLineClampOnItemsIfNeeded()}enableLineClampOnItemsIfNeeded(){this.querySelectorAll("[item-index]").forEach(e=>{e instanceof Rt&&(e.enableLineClamp=e.enableLineClamp||e.missingWidthForTexts>0)})}increaseWidthOnNextRenderIfNeeded(){this._increaseWidthOnNextRenderIfNeeded=!0}updateItems(){let e=[...this.querySelectorAll("[item-index]")],t=new Map,i=document.createDocumentFragment();for(let s of this._itemsRenderData){let o=this.renderItem(s);o.parentElement||i.appendChild(o),t.set(s.dataHash,o);let r=e.indexOf(o);r!==-1&&e.splice(r,1)}this.appendChild(i);for(let s of e)s instanceof Rt&&(s.enableLineClamp=!1),this.removeChild(s);t.forEach((s,o)=>{this._elementCache.set(o,s)})}renderItem({index:e,top:t,dataHash:i,data:s}){let o;return s?this._elementCache.has(i)?(o=this._elementCache.get(i),this._elementCache.delete(i)):(o=this.itemGenerator(s,e),o.setAttribute("slot","items")):(o=document.createElement("div"),o.setAttribute("placeholder-item",""),o.setAttribute("slot","items")),Object.assign(o.style,{transform:`translateY(${t}px)`,height:`${this.itemHeight}px`}),o.setAttribute("item-index",e.toString()),o.setAttribute("aria-setsize",String(this.finalSizeIsKnown?this.itemCount:-1)),o.setAttribute("aria-posinset",String(e+1)),(!o.id||o.id.startsWith(this.id+"_item_"))&&(o.id=this.id+"_item_"+e),this.itemCount-1==e?o.setAttribute("last",""):o.removeAttribute("last"),this.updateSelectedAttribute(e,o),this.updateFocusedAttribute(e,o),o}updateFocusedAttribute(e,t){this.focusIndex==e&&(this.focusTarget||document.activeElement==this)?(t.setAttribute("focused",""),this.setAttribute("aria-activedescendant",t.id)):t.removeAttribute("focused")}updateSelectedAttribute(e,t){let i=this.selectedIndices.indexOf(e)!==-1;i?t.setAttribute("selected",""):t.removeAttribute("selected"),t.setAttribute("aria-selected",String(i))}updateItemsRenderData(){if(this._itemsRenderData=[],this._visibleItemsNum=Math.min(Math.ceil(this.height/this.itemHeight),this.itemCount),this._visibleItemsNum>0){this._firstVisibleIndex=this.normalizeIndex(Math.floor(this._lastKnownScrollTop/this.itemHeight)),this._lastVisibleIndex=this.normalizeIndex(this._firstVisibleIndex+this._visibleItemsNum);let e=this.normalizeIndex(this._firstVisibleIndex-2),t=this.normalizeIndex(this._lastVisibleIndex+2);this.requestData(e,t);for(let i=e;i<=t;i++){let s=i-e,o=this.items[s],r;o?r=JSON.stringify(o):r=`placeholder-${s}`,this._itemsRenderData.push({index:i,top:this.itemHeight*i,physicalIndex:s,dataHash:r,data:o})}}else this._firstVisibleIndex=0,this._lastVisibleIndex=0}normalizeIndex(e){return Math.max(0,Math.min(e,this.itemCount-1))}get height(){return this.offsetHeight}requestData(e,t){!Number.isNaN(e)&&!Number.isNaN(t)&&this.dispatchEvent(new CustomEvent("data-request",{detail:{startIndex:e,stopIndex:t}}))}handleSelection(e,t){if(e<0||this.itemCount<=e)return;let i=this.getListItem(e);if(i.getAttribute("aria-disabled")=="true"||i.hasAttribute("disabled"))return;let s=!0;if(this.selectionType!=="trigger-only"){let o=this.selectedIndices.indexOf(e);s=o==-1,s?this.selectionType==="single"?this.selectedIndices=[e]:this.selectedIndices.push(e):this.selectedIndices.splice(o,1),this.requestUpdate("selectedIndices")}this.focusIndex=e,this.dispatchSelectionEvent(e,s,t)}dispatchSelectionEvent(e,t,i){this.dispatchEvent(new CustomEvent("selection",{detail:{index:e,selected:t,originalEvent:i}}))}handleClick(e){let t=e.composedPath().find(i=>i.hasAttribute&&i.hasAttribute("item-index"));if(t){let i=parseInt(t.getAttribute("item-index"));Number.isInteger(i)&&((e.button==0||e.button==1)&&this.handleSelection(i,e),this.focusIndex=i)}}},yt.ID="sd-virtual-list",yt.ensureDefined=()=>{Rt.ensureDefined(),customElements.get(yt.ID)||customElements.define(yt.ID,yt)},yt);xt([h({type:Number,attribute:"item-height",reflect:!0})],ft.prototype,"itemHeight",2);xt([h({type:Number})],ft.prototype,"itemCount",2);xt([h({type:Array,attribute:!1})],ft.prototype,"items",2);xt([h({type:String,attribute:"selection-type",reflect:!0,noAccessor:!0})],ft.prototype,"selectionType",2);xt([h({type:String,attribute:!0,reflect:!0})],ft.prototype,"id",2);xt([h({type:String,reflect:!0})],ft.prototype,"role",2);xt([h({type:Number,attribute:"focus-index",reflect:!0})],ft.prototype,"focusIndex",1);xt([h({type:Array,attribute:!1})],ft.prototype,"selectedIndices",1);var Ge=ft;Ge.ensureDefined();var Xe=class e{constructor(t,i){this.eventTarget=t,this.keydownHandler=i,this.catchedKeys=["Down","ArrowDown","Up","ArrowUp","Enter"],this.markAsFocusTargetHandler=()=>this.eventTarget.setAttribute("focus-target",""),this.unmarkAsFocusTargetHandler=()=>this.eventTarget.removeAttribute("focus-target"),this.delegateKeyDownEvent=s=>{if(this.catchedKeys.indexOf(s.key)!==-1){let o=s.key.toLocaleLowerCase(),r=0,n=o.includes("enter");n||(r=o.includes("down")?1:-1),this.keydownHandler(s,r,n),s.preventDefault(),s.stopPropagation(),s.stopImmediatePropagation()}}}static delegateTo(t){return new e(t,i=>t.dispatchEvent(new KeyboardEvent(i.type,i)))}connect(t){if(t!=null){t.addEventListener("keydown",this.delegateKeyDownEvent),t.addEventListener("focus",this.markAsFocusTargetHandler),t.addEventListener("blur",this.unmarkAsFocusTargetHandler);let i=document.activeElement;(t.contains(i)||t.shadowRoot?.activeElement?.contains(i))&&this.markAsFocusTargetHandler()}}disconnect(t){t!=null&&(t.removeEventListener("keydown",this.delegateKeyDownEvent),t.removeEventListener("focus",this.markAsFocusTargetHandler),t.removeEventListener("blur",this.unmarkAsFocusTargetHandler),this.unmarkAsFocusTargetHandler())}};var _e=class extends Dt{};_e.directiveName="unsafeSVG",_e.resultType=2;var Ds=Ot(_e);var cr=0,Ti=class{constructor(t,i,s,o){this.inputElement=t,this.notSelectedTokensProvider=i,this.initializeCallback=o,this.filter=(r,n)=>r?n.filter(a=>a.disabled||a.deactivated?!1:a.caption&&a.caption.toLowerCase().includes(r)):n,Ge.ensureDefined(),this._tokenList=new Ge,this._tokenList.id="sd_token_suggest_popover_list_"+cr++,this._tokenList.style.minWidth="250px",this._tokenList.style.maxHeight="49vh",this._tokenList.itemHeight=50,this._tokenList.addEventListener("pointerdown",()=>{this.pointerDown=!0,window.addEventListener("pointerup",()=>{this.pointerDown=!1,this._tokenList.increaseWidthOnNextRenderIfNeeded(),this._tokenList.isUpdatePending||this._tokenList.requestUpdate()},{once:!0,capture:!0})}),this._tokenList.addEventListener("selection",r=>{let n=r.detail.index,a=this._suggestItems[n];s(a),this.hide()}),this._tokenList.addEventListener("data-request",r=>{this.lastRequestedStartIndex=r.detail.startIndex,this.lastRequestedStopIndex=r.detail.stopIndex,this.pointerDown||this._tokenList.increaseWidthOnNextRenderIfNeeded(),this._tokenList.items=this._suggestItems.slice(this.lastRequestedStartIndex,this.lastRequestedStopIndex+1)}),new Xe(this._tokenList,(r,n,a)=>{this._tokenList.dispatchEvent(new KeyboardEvent(r.type,r)),!a&&!this.isOpened&&this.show()}).connect(t)}show(){this.inputElement.effectiveDisabled||(this.ensurePopover(),this._suggestItems=this.filterItems((this.inputElement.value||"").toLowerCase()),this._suggestItems.length==0?this.hide():(this._tokenList.itemCount=this._suggestItems.length,this._tokenList.focusIndex=-1,this._tokenList.style.width=null,requestAnimationFrame(()=>{this.lastRequestedStartIndex!=null&&(this._tokenList.increaseWidthOnNextRenderIfNeeded(),this._tokenList.items=this._suggestItems.slice(this.lastRequestedStartIndex,this.lastRequestedStopIndex+1))}),this.popover.show()))}refreshItems(){this.isOpened&&(this._suggestItems=this.filterItems((this.inputElement.value||"").toLowerCase()),this._suggestItems.length==0?this.hide():(this._tokenList.itemCount=this._suggestItems.length,this._tokenList.items=[],this._tokenList.style.width=null))}filterItems(t){let i=this.notSelectedTokensProvider();return this.filter(t,i)}ensurePopover(){this._popover||(this._popover=this.createPopover(),this.initializeCallback(this))}hide(){this._suggestItems=[],this._tokenList.itemCount=0,this._tokenList.items=[],this._popover?.hide()}get list(){return this._tokenList}get popover(){return this.ensurePopover(),this._popover}createPopover(){let t=new we;return t.setAttribute("trigger-type","manual"),t.setAttribute("placement","bottom-start"),t.setAttribute("modal",""),t.setAttribute("popover-for","token-autosuggest-popover"),t.setAttribute("offset","-2"),t.targetElement=this.inputElement,t.appendChild(this._tokenList),t}get isOpened(){return this._popover&&this._popover.hasAttribute("open")}get focusedSuggestToken(){return this._suggestItems[this._tokenList.focusIndex]}},hr=`:host{flex-shrink:0;max-width:100%;height:28px}:host([aria-checked=true]){position:relative}:host([aria-checked=true]):before{content:"";position:absolute;left:0;top:0;height:12px;width:12px;background:#1467ba url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='12'%20height='12'%20fill='none'%3e%3cpath%20stroke='%23FFF'%20stroke-width='2'%20d='M9%204%205%208%203%206'/%3e%3c/svg%3e") no-repeat center center}.container{display:flex;height:100%;background-color:var(--sd-token-background-color, #f3f3f3);border:var(--sd-token-focused-border, var(--sd-token-border));box-sizing:border-box}.container .icon-wrapper{display:flex;flex-shrink:0;justify-content:center;align-items:center;width:28px;height:100%;overflow:hidden;background-color:var(--sd-token-icon-background-color, transparent)}.container .icon-wrapper .icon{height:100%;width:100%;object-fit:contain;background-size:cover;background-repeat:no-repeat;background-position:center}.container .value{display:inline-block;align-self:center;padding:0 8px;font-family:Segoe UI,Lucida Sans,Arial,sans-serif;font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.container .delete-button-wrapper{display:flex;align-self:center;height:16px;width:16px;padding-right:8px;opacity:.5}.container .delete-button-wrapper:hover{cursor:pointer;filter:brightness(10%);opacity:1}`,pr=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">\r
117
118
  <path d="m3.5 12.5 9-9m-9 0 9 9" style="fill:none;stroke:#333;stroke-linecap:square;stroke-width:1.1px"/>\r
118
119
  </svg>`,ur=Object.defineProperty,fr=Object.getOwnPropertyDescriptor,_t=(e,t,i,s)=>{for(var o=s>1?void 0:s?fr(t,i):t,r=e.length-1,n;r>=0;r--)(n=e[r])&&(o=(s?n(t,i,o):n(o))||o);return s&&o&&ur(t,i,o),o},Oi={fromAttribute:e=>e=="true",toAttribute:e=>e},Wt,mt=(Wt=class extends D{constructor(){super(...arguments),this.value="",this.type="",this.icon="",this.iconPlaceholder="",this.iconBackgroundColor="",this._checked=!1}static get styles(){return X(hr)}set checked(e){let t=this._checked;this._checked=!this.disabled&&e,this.requestUpdate("checked",t)}get checked(){return this._checked}firstUpdated(e){super.firstUpdated(e),this.tabIndex=-1,this.setAttribute("role","option"),this.setAttribute("aria-selected","true"),this.addEventListener("click",i=>{let s=window.getSelection();if(s&&s.type=="Range")return;i.stopPropagation();let o=i.getModifierState("Control");this.disabled||(o?this.checked=!this.checked:this.checked=!0),this._tokenClickHandler&&this._tokenClickHandler(this.index,o)});let t=this.shadowRoot.querySelector(".delete-button-wrapper");t&&t.addEventListener("click",i=>{i.stopPropagation(),this._tokenDeleteHandler&&this._tokenDeleteHandler(this.index)})}render(){return A`
119
120
  <div class="container">
@@ -121,7 +122,7 @@ var window;(window||={})["@cas-smartdesign/token-selector"]=(()=>{var ii=Object.
121
122
  ${this.renderIcon()}
122
123
  <slot name="after-icon"></slot>
123
124
  <div class="value">${this.value}</div>
124
- ${this.disabled?g:A` <div class="delete-button-wrapper">${Ds(pr)}</div> `}
125
+ ${this.disabled?v:A` <div class="delete-button-wrapper">${Ds(pr)}</div> `}
125
126
  </div>
126
127
  `}renderIcon(){if(this.icon||this.iconPlaceholder){let e=this.iconBackgroundColor!=null?`--sd-token-icon-background-color: ${this.iconBackgroundColor}`:void 0;return A`
127
128
  <div class="icon-wrapper" style="${M(e)}" role="img">
@@ -131,11 +132,11 @@ var window;(window||={})["@cas-smartdesign/token-selector"]=(()=>{var ii=Object.
131
132
  style="background-image:${Be(this.icon,this.iconPlaceholder)}"
132
133
  ></div>
133
134
  </div>
134
- `}return g}updated(e){super.updated(e),e.has("disabled")&&!this.disabled&&this.checked&&(this.checked=!1)}setClickHandler(e){this._tokenClickHandler=e}setDeleteHandler(e){this._tokenDeleteHandler=e}},Wt.ID="sd-token",Wt.ensureDefined=()=>{customElements.get(Wt.ID)||customElements.define(Wt.ID,Wt)},Wt);_t([h({type:String,attribute:!0,reflect:!0})],mt.prototype,"value",2);_t([h({type:String,attribute:!0,reflect:!0})],mt.prototype,"type",2);_t([h({type:String})],mt.prototype,"icon",2);_t([h({type:String})],mt.prototype,"iconPlaceholder",2);_t([h({type:String})],mt.prototype,"iconBackgroundColor",2);_t([h({converter:Oi,reflect:!0,attribute:"aria-disabled"})],mt.prototype,"disabled",2);_t([h({converter:Oi,reflect:!0,attribute:"aria-current"})],mt.prototype,"current",2);_t([h({converter:Oi,reflect:!0,attribute:"aria-checked"})],mt.prototype,"checked",1);var Je=mt,Ms=(e,t)=>{let i=document.createElement(Je.ID);return e&&(i.value=e.caption,i.type=e.type,i.icon=e.icon,i.iconPlaceholder=e.iconPlaceholder,i.iconBackgroundColor=e.iconBackgroundColor,i.disabled=e.disabled,i.index=t),i};Je.ensureDefined();var Ye="web application/json",Li=class{constructor(t,i,s){navigator.clipboard&&(t.addEventListener("copy",()=>{let o=window.getSelection();(!o||o.type!="Range")&&!i()&&this.writeToClipboard(t)}),t.addEventListener("cut",()=>{i()||(t.removeSelectionOrActiveToken(),this.writeToClipboard(t))}),t.addEventListener("paste",()=>{t.disabled||this.readFromClipboard(s)}))}writeToClipboard(t){let i=t.querySelectorAll("[slot='items'][aria-checked='true']"),s=[];if(i.length>0)i.forEach(o=>s.push(o.index));else if(t.activeTokenIndex!=-1){let o=t.activeTokenElement;o&&s.push(o.index)}if(s.length>0){let o=JSON.stringify(s.map(n=>t.items[n])),r=new Blob([o],{type:Ye});navigator.clipboard.write([new ClipboardItem({[Ye]:r})])}}async readFromClipboard(t){let i=await navigator.clipboard.read();for(let s of i)if(s.types.includes(Ye)){let o=await(await s.getType(Ye)).text(),r=JSON.parse(o);Array.isArray(r)&&t(r)}}},mr=":host{display:flex;contain:layout style}:host .additonal-content::slotted(*){align-self:end;flex-shrink:0}:host([drop]) ::slotted(*){pointer-events:none}:host(:not([readonly])) ::slotted(sd-token:last-of-type){max-width:calc(100% - 24px);margin-right:24px;margin-bottom:4px}:host ::slotted(sd-token){--sd-token-border: 1px solid transparent;margin:1px}:host([selection-mode=multi][aria-disabled=true]){opacity:.6}:host([selection-mode=multi][aria-disabled=true]) .input[effective-disabled]{opacity:1}:host([selection-mode=multi][aria-disabled=true]) ::slotted([aria-disabled=true]){opacity:1}.input[focus-visible]:focus-within ::slotted(sd-token[aria-current=true]),.container:focus-visible ::slotted(sd-token[aria-current=true]){outline:1px solid #1467ba;--sd-token-focused-border: 1px solid #fff}.input[focus-visible]:focus-within ::slotted(sd-token[aria-current=true][aria-disabled=true]:not([aria-haspopup])),.container:focus-visible ::slotted(sd-token[aria-current=true][aria-disabled=true]:not([aria-haspopup])){outline-color:#767676}.container{outline:none;display:flex;flex-wrap:wrap;gap:6px;flex-grow:1;min-width:0;margin-top:auto}.container .placeholder{color:#767676;line-height:24px;align-self:flex-end}.input{flex-grow:1;min-width:0;width:100%;margin-top:auto}.input .token-wrapper{display:flex;flex-wrap:wrap;flex:1 0 auto;width:100%;gap:6px}",Pi=class{constructor(t,i){this.tokenSelector=t;let s=new Map,o=r=>{let n=r.target;if(t.removeAttribute("drag-source"),!t.contains(n)){let a=r.addedIndexes;a&&t.removeTokens(a.map(l=>s.get(l)))}s.clear()};t.addEventListener("dragstart",r=>{let n=r.target;if(n instanceof Je){if(n.disabled){r.preventDefault();return}t.setAttribute("drag-source",""),n.setAttribute("aria-checked","true");let a=t.querySelectorAll("[slot='items'][aria-checked='true']");if(a.length>0){let l=Array.from(a).filter(c=>!c.disabled).map((c,d)=>(s.set(d,c.index),t.items[c.index]));if(r.dataTransfer.setData("text/sd-token-selector",JSON.stringify(l)),r.dataTransfer.dropEffect="move",r.dataTransfer.effectAllowed="move",a.length>1){let c=this.createCustomDragImage(n,l.length);r.dataTransfer.setDragImage(c,-14,-14)}window.addEventListener("drop",o,{once:!0})}}}),t.addEventListener("dragenter",r=>{t.setAttribute("drop",""),r.preventDefault()}),t.addEventListener("dragover",r=>r.preventDefault()),t.addEventListener("dragleave",r=>{r.target==t&&t.removeAttribute("drop")}),t.addEventListener("drop",r=>{t.removeAttribute("drop");let n=r.dataTransfer.getData("text/sd-token-selector");if(n)try{let a=JSON.parse(n);Array.isArray(a)&&(r.addedIndexes=i(a),r.preventDefault())}catch{}}),t.addEventListener("dragend",()=>{window.removeEventListener("drop",o),t.removeAttribute("drag-source"),s.clear()})}createCustomDragImage(t,i){let s=t.cloneNode(!0);if(s.setAttribute("aria-disabled","true"),this.tokenSelector.tokenType)s.value=i+" "+this.tokenSelector.tokenType;else{let o=document.createElement("div");o.innerText="+"+(i-1),Object.assign(o.style,{position:"absolute",left:"90%",top:"75%"});let r=document.createElement("div");r.appendChild(s),r.appendChild(o),s=r}return Object.assign(s.style,{height:t.offsetHeight,outline:"none",maxWidth:"500px",position:"absolute",display:"block",left:"-99999px",overflow:"visible",margin:"1px"}),s.slot="items",this.tokenSelector.appendChild(s),requestAnimationFrame(()=>s.remove()),s}},vr=Object.defineProperty,tt=(e,t,i,s)=>{for(var o=void 0,r=e.length-1,n;r>=0;r--)(n=e[r])&&(o=n(t,i,o)||o);return o&&vr(t,i,o),o};function gr(e,t){let i;return function(...s){i!=null&&clearTimeout(i),i=window.setTimeout(()=>e(...s),t)}}var Rs=(e=>(e.RemoveOnly="remove-only",e.Multi="multi",e))(Rs||{}),wt,Y=(wt=class extends D{constructor(){super(...arguments),this.selectionMode="multi",this.items=[],this.selectedIndexes=[],this._tokenGenerator=Ms,this._autoSuggestItemGenerator=qe,this.additionalTokenCommittingKeys=[],this._activeTokenIndex=-1,this.handleInputKeyDown=(e,t)=>{if((e.key==="Enter"||this.additionalTokenCommittingKeys.includes(e.key))&&t.value){e.preventDefault(),e.stopPropagation(),this.commitTokenValue(t.value),this.inputElement.removeAttribute("focus-visible");return}switch(e.key){case"Escape":{this.tokenSuggestPopover.isOpened&&(e.preventDefault(),e.stopPropagation(),this.tokenSuggestPopover.hide());break}case"Tab":{this.commitTokenValue(t.value),this.tokenSuggestPopover.hide(),this.inputElement.removeAttribute("focus-visible");break}default:this.handleKeyDown(e)}},this.handleKeyDown=e=>{switch(e.key){case"ArrowLeft":{this.hasInputValue||this.updateActiveToken(-1);break}case"ArrowRight":{this.hasInputValue||this.updateActiveToken(1);break}case"Enter":{if(!this.hasInputValue&&this.activeTokenIndex!=-1){let t=this.activeTokenElement,i=e.getModifierState("Control");i?t.checked=!t.checked:t.checked=!0,this.onTokenClick(t,!1,i),document.activeElement!=this&&this.focus()}break}case"Backspace":{this.hasInputValue||(this.activeTokenIndex==-1?this.updateActiveToken(-1):this.removeSelectionOrActiveToken());break}case"Clear":case"Delete":{this.removeSelectionOrActiveToken();break}case"a":{!this.hasInputValue&&e.getModifierState("Control")&&(this.querySelectorAll("[slot='items']").forEach(t=>t.checked=!0),e.preventDefault(),e.stopPropagation());break}}},this.selectOrAddItems=e=>{let t=[],i=e.map((s,o)=>{let r=s.caption==null?-1:this.findIndex(s);return r!=-1&&!this.items[r].disabled&&!this.selectedIndexes.includes(r)?(t.push(o),r):-1}).filter(s=>s!=-1);return i.length>0&&this.handleTokenSelection(i),t},this.handleWindowPointerDown=e=>{let t=this.inputElement;!t||!t.value||e.composedPath().some(i=>{if(i instanceof HTMLElement&&(e.composedPath().indexOf(t)>-1||i.getAttribute("popover-for")==="token-autosuggest-popover"))return!0})||this.commitTokenValue(t.value)},this.debouncedShowTokenSuggestPopover=gr(this.showFilteredTokenSuggestions.bind(this),200)}static get styles(){return X(mr)}get tokenGenerator(){return this._tokenGenerator}set tokenGenerator(e){this._tokenGenerator=e,this.render()}get autoSuggestItemGenerator(){return this._autoSuggestItemGenerator}set autoSuggestItemGenerator(e){this._autoSuggestItemGenerator=e,this._tokenSuggestPopover&&(this._tokenSuggestPopover.list.itemGenerator=e)}setAdditionalTokenCommittingKeys(e){this.additionalTokenCommittingKeys=e}openSuggestions(){this.inputElement&&(this.focus(),this.tokenSuggestPopover.show())}focus(){let e=this.inputElement;e?e.focus():this.shadowRoot.querySelector(".container").focus()}render(){return this.selectionMode=="remove-only"?A`<div class="container" tabindex="${this.disabled?-1:0}">
135
+ `}return v}updated(e){super.updated(e),e.has("disabled")&&!this.disabled&&this.checked&&(this.checked=!1)}setClickHandler(e){this._tokenClickHandler=e}setDeleteHandler(e){this._tokenDeleteHandler=e}},Wt.ID="sd-token",Wt.ensureDefined=()=>{customElements.get(Wt.ID)||customElements.define(Wt.ID,Wt)},Wt);_t([h({type:String,attribute:!0,reflect:!0})],mt.prototype,"value",2);_t([h({type:String,attribute:!0,reflect:!0})],mt.prototype,"type",2);_t([h({type:String})],mt.prototype,"icon",2);_t([h({type:String})],mt.prototype,"iconPlaceholder",2);_t([h({type:String})],mt.prototype,"iconBackgroundColor",2);_t([h({converter:Oi,reflect:!0,attribute:"aria-disabled"})],mt.prototype,"disabled",2);_t([h({converter:Oi,reflect:!0,attribute:"aria-current"})],mt.prototype,"current",2);_t([h({converter:Oi,reflect:!0,attribute:"aria-checked"})],mt.prototype,"checked",1);var Je=mt,Ms=(e,t)=>{let i=document.createElement(Je.ID);return e&&(i.value=e.caption,i.type=e.type,i.icon=e.icon,i.iconPlaceholder=e.iconPlaceholder,i.iconBackgroundColor=e.iconBackgroundColor,i.disabled=e.disabled,i.index=t),i};Je.ensureDefined();var Ye="web application/json",Li=class{constructor(t,i,s){navigator.clipboard&&(t.addEventListener("copy",()=>{let o=window.getSelection();(!o||o.type!="Range")&&!i()&&this.writeToClipboard(t)}),t.addEventListener("cut",()=>{i()||(t.removeSelectionOrActiveToken(),this.writeToClipboard(t))}),t.addEventListener("paste",()=>{t.disabled||this.readFromClipboard(s)}))}writeToClipboard(t){let i=t.querySelectorAll("[slot='items'][aria-checked='true']"),s=[];if(i.length>0)i.forEach(o=>s.push(o.index));else if(t.activeTokenIndex!=-1){let o=t.activeTokenElement;o&&s.push(o.index)}if(s.length>0){let o=JSON.stringify(s.map(n=>t.items[n])),r=new Blob([o],{type:Ye});navigator.clipboard.write([new ClipboardItem({[Ye]:r})])}}async readFromClipboard(t){let i=await navigator.clipboard.read();for(let s of i)if(s.types.includes(Ye)){let o=await(await s.getType(Ye)).text(),r=JSON.parse(o);Array.isArray(r)&&t(r)}}},mr=":host{display:flex;contain:layout style}:host .additonal-content::slotted(*){align-self:end;flex-shrink:0}:host([drop]) ::slotted(*){pointer-events:none}:host(:not([readonly])) ::slotted(sd-token:last-of-type){max-width:calc(100% - 24px);margin-right:24px;margin-bottom:4px}:host ::slotted(sd-token){--sd-token-border: 1px solid transparent;margin:1px}:host([selection-mode=multi][aria-disabled=true]){opacity:.6}:host([selection-mode=multi][aria-disabled=true]) .input[effective-disabled]{opacity:1}:host([selection-mode=multi][aria-disabled=true]) ::slotted([aria-disabled=true]){opacity:1}.input[focus-visible]:focus-within ::slotted(sd-token[aria-current=true]),.container:focus-visible ::slotted(sd-token[aria-current=true]){outline:1px solid #1467ba;--sd-token-focused-border: 1px solid #fff}.input[focus-visible]:focus-within ::slotted(sd-token[aria-current=true][aria-disabled=true]:not([aria-haspopup])),.container:focus-visible ::slotted(sd-token[aria-current=true][aria-disabled=true]:not([aria-haspopup])){outline-color:#767676}.container{outline:none;display:flex;flex-wrap:wrap;gap:6px;flex-grow:1;min-width:0;margin-top:auto}.container .placeholder{color:#767676;line-height:24px;align-self:flex-end}.input{flex-grow:1;min-width:0;width:100%;margin-top:auto}.input .token-wrapper{display:flex;flex-wrap:wrap;flex:1 0 auto;width:100%;gap:6px}",Pi=class{constructor(t,i){this.tokenSelector=t;let s=new Map,o=r=>{let n=r.target;if(t.removeAttribute("drag-source"),!t.contains(n)){let a=r.addedIndexes;a&&t.removeTokens(a.map(l=>s.get(l)))}s.clear()};t.addEventListener("dragstart",r=>{let n=r.target;if(n instanceof Je){if(n.disabled){r.preventDefault();return}t.setAttribute("drag-source",""),n.setAttribute("aria-checked","true");let a=t.querySelectorAll("[slot='items'][aria-checked='true']");if(a.length>0){let l=Array.from(a).filter(c=>!c.disabled).map((c,d)=>(s.set(d,c.index),t.items[c.index]));if(r.dataTransfer.setData("text/sd-token-selector",JSON.stringify(l)),r.dataTransfer.dropEffect="move",r.dataTransfer.effectAllowed="move",a.length>1){let c=this.createCustomDragImage(n,l.length);r.dataTransfer.setDragImage(c,-14,-14)}window.addEventListener("drop",o,{once:!0})}}}),t.addEventListener("dragenter",r=>{t.setAttribute("drop",""),r.preventDefault()}),t.addEventListener("dragover",r=>r.preventDefault()),t.addEventListener("dragleave",r=>{r.target==t&&t.removeAttribute("drop")}),t.addEventListener("drop",r=>{t.removeAttribute("drop");let n=r.dataTransfer.getData("text/sd-token-selector");if(n)try{let a=JSON.parse(n);Array.isArray(a)&&(r.addedIndexes=i(a),r.preventDefault())}catch{}}),t.addEventListener("dragend",()=>{window.removeEventListener("drop",o),t.removeAttribute("drag-source"),s.clear()})}createCustomDragImage(t,i){let s=t.cloneNode(!0);if(s.setAttribute("aria-disabled","true"),this.tokenSelector.tokenType)s.value=i+" "+this.tokenSelector.tokenType;else{let o=document.createElement("div");o.innerText="+"+(i-1),Object.assign(o.style,{position:"absolute",left:"90%",top:"75%"});let r=document.createElement("div");r.appendChild(s),r.appendChild(o),s=r}return Object.assign(s.style,{height:t.offsetHeight,outline:"none",maxWidth:"500px",position:"absolute",display:"block",left:"-99999px",overflow:"visible",margin:"1px"}),s.slot="items",this.tokenSelector.appendChild(s),requestAnimationFrame(()=>s.remove()),s}},vr=Object.defineProperty,tt=(e,t,i,s)=>{for(var o=void 0,r=e.length-1,n;r>=0;r--)(n=e[r])&&(o=n(t,i,o)||o);return o&&vr(t,i,o),o};function gr(e,t){let i;return function(...s){i!=null&&clearTimeout(i),i=window.setTimeout(()=>e(...s),t)}}var Rs=(e=>(e.RemoveOnly="remove-only",e.Multi="multi",e))(Rs||{}),wt,Y=(wt=class extends D{constructor(){super(...arguments),this.selectionMode="multi",this.items=[],this.selectedIndexes=[],this._tokenGenerator=Ms,this._autoSuggestItemGenerator=qe,this.additionalTokenCommittingKeys=[],this._activeTokenIndex=-1,this.handleInputKeyDown=(e,t)=>{if((e.key==="Enter"||this.additionalTokenCommittingKeys.includes(e.key))&&t.value){e.preventDefault(),e.stopPropagation(),this.commitTokenValue(t.value),this.inputElement.removeAttribute("focus-visible");return}switch(e.key){case"Escape":{this.tokenSuggestPopover.isOpened&&(e.preventDefault(),e.stopPropagation(),this.tokenSuggestPopover.hide());break}case"Tab":{this.commitTokenValue(t.value),this.tokenSuggestPopover.hide(),this.inputElement.removeAttribute("focus-visible");break}default:this.handleKeyDown(e)}},this.handleKeyDown=e=>{switch(e.key){case"ArrowLeft":{this.hasInputValue||this.updateActiveToken(-1);break}case"ArrowRight":{this.hasInputValue||this.updateActiveToken(1);break}case"Enter":{if(!this.hasInputValue&&this.activeTokenIndex!=-1){let t=this.activeTokenElement,i=e.getModifierState("Control");i?t.checked=!t.checked:t.checked=!0,this.onTokenClick(t,!1,i),document.activeElement!=this&&this.focus()}break}case"Backspace":{this.hasInputValue||(this.activeTokenIndex==-1?this.updateActiveToken(-1):this.removeSelectionOrActiveToken());break}case"Clear":case"Delete":{this.removeSelectionOrActiveToken();break}case"a":{!this.hasInputValue&&e.getModifierState("Control")&&(this.querySelectorAll("[slot='items']").forEach(t=>t.checked=!0),e.preventDefault(),e.stopPropagation());break}}},this.selectOrAddItems=e=>{let t=[],i=e.map((s,o)=>{let r=s.caption==null?-1:this.findIndex(s);return r!=-1&&!this.items[r].disabled&&!this.selectedIndexes.includes(r)?(t.push(o),r):-1}).filter(s=>s!=-1);return i.length>0&&this.handleTokenSelection(i),t},this.handleWindowPointerDown=e=>{let t=this.inputElement;!t||!t.value||e.composedPath().some(i=>{if(i instanceof HTMLElement&&(e.composedPath().indexOf(t)>-1||i.getAttribute("popover-for")==="token-autosuggest-popover"))return!0})||this.commitTokenValue(t.value)},this.debouncedShowTokenSuggestPopover=gr(this.showFilteredTokenSuggestions.bind(this),200)}static get styles(){return X(mr)}get tokenGenerator(){return this._tokenGenerator}set tokenGenerator(e){this._tokenGenerator=e,this.render()}get autoSuggestItemGenerator(){return this._autoSuggestItemGenerator}set autoSuggestItemGenerator(e){this._autoSuggestItemGenerator=e,this._tokenSuggestPopover&&(this._tokenSuggestPopover.list.itemGenerator=e)}setAdditionalTokenCommittingKeys(e){this.additionalTokenCommittingKeys=e}openSuggestions(){this.inputElement&&(this.focus(),this.tokenSuggestPopover.show())}focus(){let e=this.inputElement;e?e.focus():this.shadowRoot.querySelector(".container").focus()}render(){return this.selectionMode=="remove-only"?A`<div class="container" tabindex="${this.disabled?-1:0}">
135
136
  <slot name="items"
136
137
  >${this.placeholder?A`<span part="remove-only-placeholder" class="placeholder"
137
138
  >${this.placeholder}</span
138
- >`:g}</slot
139
+ >`:v}</slot
139
140
  >
140
141
  </div>
141
142
  <slot class="additonal-content" name="additional-content" @focusin=${this.clearCheckedTokens}></slot>`:A`
@@ -155,7 +156,7 @@ var window;(window||={})["@cas-smartdesign/token-selector"]=(()=>{var ii=Object.
155
156
  ><div class="token-wrapper" slot="prefix"><slot name="items"></slot></div>
156
157
  </sd-lit-input>
157
158
  <slot class="additonal-content" name="additional-content" @focusin=${this.clearCheckedTokens}></slot>
158
- `}firstUpdated(e){super.firstUpdated(e),this.setAttribute("role","listbox"),this.setAttribute("aria-multiselectable","true"),!this.hasAttribute("tabIndex")&&!this.disabled&&(this.tabIndex=0),this.addEventListener("focusout",t=>{let i=t.relatedTarget;!this.contains(i)&&!this.shadowRoot.contains(i)&&this.clearCheckedTokens()}),this.addEventListener("focusin",()=>{this.selectionMode=="remove-only"&&this.activeTokenIndex==-1&&this.items.length>0&&!this.disabled&&(this.activeTokenIndex=0)}),new Li(this,()=>this.inputElement?.value,t=>this.selectOrAddItems(t)),new Pi(this,t=>this.selectOrAddItems(t))}clearCheckedTokens(){this.querySelectorAll("[slot='items'][aria-checked='true']").forEach(t=>t.checked=!1);let e=this.inputElement;e&&(e.removeAttribute("focus-visible"),e.removeAttribute("focused"))}removeSelectionOrActiveToken(){if(!this.disabled){let e=this.querySelectorAll("[slot='items'][aria-checked='true']");if(e.length>0){let t=Array.from(e);this.removeTokens(t.filter(i=>!i.disabled).map(i=>i.index))}else if(this.activeTokenIndex!=-1){let t=this.activeTokenElement;t&&!t.disabled&&this.removeTokens([t.index])}}}updateActiveToken(e){if(this.disabled)return;let t=this.querySelectorAll("[slot='items']").length-1;if(this.activeTokenIndex==-1?e<0&&(this.activeTokenIndex=t):this.activeTokenIndex==t&&e>0&&this.selectionMode=="multi"?(this.activeTokenIndex=-1,this.focus()):this.activeTokenIndex=Math.max(0,Math.min(t,this.activeTokenIndex+e)),this.activeTokenIndex>-1&&(this.inputElement?.setAttribute("focus-visible",""),this.scrollHeight>this.offsetHeight)){let i=this.activeTokenElement;i.scrollIntoViewIfNeeded?i.scrollIntoViewIfNeeded():i.scrollIntoView()}}commitTokenValue(e){if(this.disabled)return;if(this.tokenSuggestPopover.isOpened){let i=this.tokenSuggestPopover.focusedSuggestToken;if(i){if(!i.disabled){let s=this.findIndex(i);this.handleTokenSelection([s]),this.tokenSuggestPopover.hide()}return}}if(!e?.trim())return;let t=this.items.findIndex(i=>this.caseSensitive?i.caption==e:i.caption.toLowerCase()==e.toLowerCase());this.selectedIndexes.includes(t)||(t>=0?this.handleTokenSelection([t]):this.handleTokenCreation(e)),this.requestUpdate("selectedIndexes"),this.tokenSuggestPopover.hide(),window.removeEventListener("pointerdown",this.handleWindowPointerDown)}updated(e){if(super.updated(e),this._tokenSuggestPopover&&(this.tokenSuggestPopover.list.className=this.suggestListClass||"",this.suggestionFilter&&(this.tokenSuggestPopover.filter=this.suggestionFilter)),e.has("selectionMode"))if(this.selectionMode=="multi"){this.setAttribute("aria-haspopup","listbox");let t=this.inputElement;t.addEventListener("immediate-value-change",i=>this.handleInputValueChange(i)),t.addEventListener("keydown",i=>this.handleInputKeyDown(i,t)),window.queueMicrotask(()=>this.tokenSuggestPopover)}else this.removeAttribute("aria-haspopup"),this.addEventListener("keydown",this.handleKeyDown),this._tokenSuggestPopover&&(this._tokenSuggestPopover.hide(),this._tokenSuggestPopover=null);(e.size==0||e.has("selectionMode")||e.has("items")||e.has("selectedIndexes")||e.has("disabled"))&&this.updateItems(),e.has("inputLabel")&&(this.inputLabel?this.setAttribute("aria-label",this.inputLabel):this.removeAttribute("aria-label"))}handleInputValueChange(e){e.detail.value?(this.activeTokenIndex=-1,this.cancelSearch=!1,this.debouncedShowTokenSuggestPopover(),window.addEventListener("pointerdown",this.handleWindowPointerDown)):(this.tokenSuggestPopover.hide(),this.cancelSearch=!0)}showFilteredTokenSuggestions(){!this.cancelSearch&&this.inputElement.value&&this.tokenSuggestPopover.show()}isTokenNotSelected(e){return!this.selectedIndexes.includes(e)}get tokenSuggestPopover(){return!this._tokenSuggestPopover&&this.inputElement&&(this._tokenSuggestPopover=new Ti(this.inputElement,()=>this.items.filter((e,t)=>!e.disabled&&this.isTokenNotSelected(t)),e=>{let t=this.findIndex(e);this.handleTokenSelection([t]),window.removeEventListener("pointerdown",this.handleWindowPointerDown)},e=>{this.appendChild(e.popover),this.inputElement.setAttribute("aria-controls",e.list.id),this.dispatchEvent(new CustomEvent("auto-suggest-initialized")),e.popover.addEventListener("close",()=>{this.inputElement.value&&!this.contains(document.activeElement)&&(this.inputElement.value="")})}),this._tokenSuggestPopover.list.itemGenerator=this._autoSuggestItemGenerator,this._tokenSuggestPopover.list.className=this.suggestListClass,this.suggestionFilter&&(this._tokenSuggestPopover.filter=this.suggestionFilter)),this._tokenSuggestPopover}updateItems(){if(!this.isConnected||!this.items)return;this.activeTokenIndex=-1;let e=this.inputElement;e&&(!this._tokenSuggestPopover||!this._tokenSuggestPopover.isOpened)&&(e.value=""),this.querySelectorAll("[slot='items']").forEach(s=>{this.removeChild(s)});let t=document.createDocumentFragment(),i=[];this.selectionMode=="remove-only"?i=this.items.map(s=>this.disableIfNeeded(s)):this.selectedIndexes.forEach(s=>{i.push(this.disableIfNeeded(this.items[s]))}),i.forEach(s=>{let o=this.tokenGenerator(s,this.findIndex(s));o.slot="items",t.appendChild(o),o.id||(o.id=window.crypto.getRandomValues(new Uint32Array(1))[0].toString(16)),o.setClickHandler((r,n)=>this.onTokenClick(o,!0,n)),o.addEventListener("click",()=>{this.inputElement?.removeAttribute("focus-visible");let r=window.getSelection();(!r||r.type!="Range")&&document.activeElement!=this&&this.focus()}),o.setDeleteHandler(r=>this.removeTokens([r]))}),this.appendChild(t),this._tokenSuggestPopover&&this._tokenSuggestPopover.refreshItems()}removeTokens(e){if(!(this.disabled||e==null||e.length==0))if(this.activeTokenIndex!=-1&&e.includes(this.activeTokenElement.index)&&(this.activeTokenIndex=-1),this.selectionMode=="remove-only")this.dispatchEvent(new CustomEvent("tokens-removed",{detail:{removedIndices:e}}));else{let t=e.filter(i=>this.selectedIndexes.includes(i));t.length>0&&(this.selectedIndexes=this.selectedIndexes.filter(i=>!t.includes(i)),this.dispatchEvent(new CustomEvent("tokens-removed",{detail:{removedIndices:t,selectedIndices:[...this.selectedIndexes]}})))}}onTokenClick(e,t,i){let s;this.querySelectorAll("[slot='items']").forEach((o,r)=>{e==o?s=r:i||o.setAttribute("aria-checked","false")}),this.activeTokenIndex=s,this.setAttribute("aria-activedescendant",this.activeTokenElement.id),this._tokenSuggestPopover&&this._tokenSuggestPopover.isOpened&&this._tokenSuggestPopover.hide(),i||this.dispatchEvent(new CustomEvent("token-clicked",{detail:{index:e.index,tokenElement:e,byPointerDevice:t}}))}disableIfNeeded(e){return this.disabled?{...e,disabled:!0}:e}handleTokenSelection(e){this.selectedIndexes=this.selectedIndexes.concat(e),this.dispatchEvent(new CustomEvent("tokens-selected",{detail:{newIndices:e,selectedIndices:[...this.selectedIndexes]}}))}handleTokenCreation(e){this.dispatchEvent(new CustomEvent("token-created",{detail:{value:e}}))}get inputElement(){return this.shadowRoot.querySelector(".input")}get activeTokenElement(){return this.getTokenElement(this.activeTokenIndex)}getTokenElement(e){return this.querySelector("[slot='items']:nth-of-type("+(e+1)+")")}findIndex(e){return this.items.findIndex(t=>t.caption===e.caption)}get activeTokenIndex(){return this._activeTokenIndex}set activeTokenIndex(e){if(this._activeTokenIndex!=-1){let t=this.activeTokenElement;t&&(t.current=!1)}if(this._activeTokenIndex=e,e==-1)this.removeAttribute("aria-activedescendant");else{let t=this.activeTokenElement;t.current=!0,this.setAttribute("aria-activedescendant",t.id)}}get hasInputValue(){return!!this.inputElement?.value}},wt.ID="sd-token-selector",wt.ensureDefined=()=>{Je.ensureDefined(),customElements.get(wt.ID)||customElements.define(wt.ID,wt)},wt.shadowRootOptions={...D.shadowRootOptions,delegatesFocus:!0},wt);tt([h({type:String,attribute:"selection-mode",reflect:!0})],Y.prototype,"selectionMode");tt([h({type:Array,attribute:!1})],Y.prototype,"items");tt([h({type:Array,attribute:!1})],Y.prototype,"selectedIndexes");tt([h({type:String,reflect:!0})],Y.prototype,"placeholder");tt([h({type:String,reflect:!0,attribute:"suggest-list-class"})],Y.prototype,"suggestListClass");tt([h({type:String,reflect:!0,attribute:"input-label"})],Y.prototype,"inputLabel");tt([h({converter:{fromAttribute:e=>e=="true",toAttribute:e=>e},reflect:!0,attribute:"aria-disabled"})],Y.prototype,"disabled");tt([h({type:String,attribute:!0})],Y.prototype,"validationMessage");tt([h({type:String,attribute:!0})],Y.prototype,"validationIconSrc");tt([h({converter:he.levelConverter,attribute:!0,reflect:!0})],Y.prototype,"validationLevel");tt([h({type:String,reflect:!0,attribute:"token-type"})],Y.prototype,"tokenType");tt([h({type:Boolean,reflect:!0,attribute:"case-sensitive"})],Y.prototype,"caseSensitive");var br=Y;return Gs(yr);})();
159
+ `}connectedCallback(){super.connectedCallback(),this.updateItemsOnConnect&&(this.updateItemsOnConnect=!1,this.updateItems())}firstUpdated(e){super.firstUpdated(e),this.setAttribute("role","listbox"),this.setAttribute("aria-multiselectable","true"),!this.hasAttribute("tabIndex")&&!this.disabled&&(this.tabIndex=0),this.addEventListener("focusout",t=>{let i=t.relatedTarget;!this.contains(i)&&!this.shadowRoot.contains(i)&&this.clearCheckedTokens()}),this.addEventListener("focusin",()=>{this.selectionMode=="remove-only"&&this.activeTokenIndex==-1&&this.items.length>0&&!this.disabled&&(this.activeTokenIndex=0)}),new Li(this,()=>this.inputElement?.value,t=>this.selectOrAddItems(t)),new Pi(this,t=>this.selectOrAddItems(t))}clearCheckedTokens(){this.querySelectorAll("[slot='items'][aria-checked='true']").forEach(t=>t.checked=!1);let e=this.inputElement;e&&(e.removeAttribute("focus-visible"),e.removeAttribute("focused"))}removeSelectionOrActiveToken(){if(!this.disabled){let e=this.querySelectorAll("[slot='items'][aria-checked='true']");if(e.length>0){let t=Array.from(e);this.removeTokens(t.filter(i=>!i.disabled).map(i=>i.index))}else if(this.activeTokenIndex!=-1){let t=this.activeTokenElement;t&&!t.disabled&&this.removeTokens([t.index])}}}updateActiveToken(e){if(this.disabled)return;let t=this.querySelectorAll("[slot='items']").length-1;if(this.activeTokenIndex==-1?e<0&&(this.activeTokenIndex=t):this.activeTokenIndex==t&&e>0&&this.selectionMode=="multi"?(this.activeTokenIndex=-1,this.focus()):this.activeTokenIndex=Math.max(0,Math.min(t,this.activeTokenIndex+e)),this.activeTokenIndex>-1&&(this.inputElement?.setAttribute("focus-visible",""),this.scrollHeight>this.offsetHeight)){let i=this.activeTokenElement;i.scrollIntoViewIfNeeded?i.scrollIntoViewIfNeeded():i.scrollIntoView()}}commitTokenValue(e){if(this.disabled)return;if(this.tokenSuggestPopover.isOpened){let i=this.tokenSuggestPopover.focusedSuggestToken;if(i){if(!i.disabled){let s=this.findIndex(i);this.handleTokenSelection([s]),this.tokenSuggestPopover.hide()}return}}if(!e?.trim())return;let t=this.items.findIndex(i=>this.caseSensitive?i.caption==e:i.caption.toLowerCase()==e.toLowerCase());this.selectedIndexes.includes(t)||(t>=0?this.handleTokenSelection([t]):this.handleTokenCreation(e)),this.requestUpdate("selectedIndexes"),this.tokenSuggestPopover.hide(),window.removeEventListener("pointerdown",this.handleWindowPointerDown)}updated(e){if(super.updated(e),this._tokenSuggestPopover&&(this.tokenSuggestPopover.list.className=this.suggestListClass||"",this.suggestionFilter&&(this.tokenSuggestPopover.filter=this.suggestionFilter)),e.has("selectionMode"))if(this.selectionMode=="multi"){this.setAttribute("aria-haspopup","listbox");let t=this.inputElement;t.addEventListener("immediate-value-change",i=>this.handleInputValueChange(i)),t.addEventListener("keydown",i=>this.handleInputKeyDown(i,t)),window.queueMicrotask(()=>this.tokenSuggestPopover)}else this.removeAttribute("aria-haspopup"),this.addEventListener("keydown",this.handleKeyDown),this._tokenSuggestPopover&&(this._tokenSuggestPopover.hide(),this._tokenSuggestPopover=null);(e.size==0||e.has("selectionMode")||e.has("items")||e.has("selectedIndexes")||e.has("disabled"))&&this.updateItems(),e.has("inputLabel")&&(this.inputLabel?this.setAttribute("aria-label",this.inputLabel):this.removeAttribute("aria-label"))}handleInputValueChange(e){e.detail.value?(this.activeTokenIndex=-1,this.cancelSearch=!1,this.debouncedShowTokenSuggestPopover(),window.addEventListener("pointerdown",this.handleWindowPointerDown)):(this.tokenSuggestPopover.hide(),this.cancelSearch=!0)}showFilteredTokenSuggestions(){!this.cancelSearch&&this.inputElement.value&&this.tokenSuggestPopover.show()}isTokenNotSelected(e){return!this.selectedIndexes.includes(e)}get tokenSuggestPopover(){return!this._tokenSuggestPopover&&this.inputElement&&(this._tokenSuggestPopover=new Ti(this.inputElement,()=>this.items.filter((e,t)=>!e.disabled&&this.isTokenNotSelected(t)),e=>{let t=this.findIndex(e);this.handleTokenSelection([t]),window.removeEventListener("pointerdown",this.handleWindowPointerDown)},e=>{this.appendChild(e.popover),this.inputElement.setAttribute("aria-controls",e.list.id),this.dispatchEvent(new CustomEvent("auto-suggest-initialized")),e.popover.addEventListener("close",()=>{this.inputElement.value&&!this.contains(document.activeElement)&&(this.inputElement.value="")})}),this._tokenSuggestPopover.list.itemGenerator=this._autoSuggestItemGenerator,this._tokenSuggestPopover.list.className=this.suggestListClass,this.suggestionFilter&&(this._tokenSuggestPopover.filter=this.suggestionFilter)),this._tokenSuggestPopover}updateItems(){if(!this.items)return;if(!this.isConnected){this.updateItemsOnConnect=!0;return}this.activeTokenIndex=-1;let e=this.inputElement;e&&(!this._tokenSuggestPopover||!this._tokenSuggestPopover.isOpened)&&(e.value=""),this.querySelectorAll("[slot='items']").forEach(s=>{this.removeChild(s)});let t=document.createDocumentFragment(),i=[];this.selectionMode=="remove-only"?i=this.items.map(s=>this.disableIfNeeded(s)):this.selectedIndexes.forEach(s=>{i.push(this.disableIfNeeded(this.items[s]))}),i.forEach(s=>{let o=this.tokenGenerator(s,this.findIndex(s));o.slot="items",t.appendChild(o),o.id||(o.id=window.crypto.getRandomValues(new Uint32Array(1))[0].toString(16)),o.setClickHandler((r,n)=>this.onTokenClick(o,!0,n)),o.addEventListener("click",()=>{this.inputElement?.removeAttribute("focus-visible");let r=window.getSelection();(!r||r.type!="Range")&&document.activeElement!=this&&this.focus()}),o.setDeleteHandler(r=>this.removeTokens([r]))}),this.appendChild(t),this._tokenSuggestPopover&&this._tokenSuggestPopover.refreshItems()}removeTokens(e){if(!(this.disabled||e==null||e.length==0))if(this.activeTokenIndex!=-1&&e.includes(this.activeTokenElement.index)&&(this.activeTokenIndex=-1),this.selectionMode=="remove-only")this.dispatchEvent(new CustomEvent("tokens-removed",{detail:{removedIndices:e}}));else{let t=e.filter(i=>this.selectedIndexes.includes(i));t.length>0&&(this.selectedIndexes=this.selectedIndexes.filter(i=>!t.includes(i)),this.dispatchEvent(new CustomEvent("tokens-removed",{detail:{removedIndices:t,selectedIndices:[...this.selectedIndexes]}})))}}onTokenClick(e,t,i){let s;this.querySelectorAll("[slot='items']").forEach((o,r)=>{e==o?s=r:i||o.setAttribute("aria-checked","false")}),this.activeTokenIndex=s,this.setAttribute("aria-activedescendant",this.activeTokenElement.id),this._tokenSuggestPopover&&this._tokenSuggestPopover.isOpened&&this._tokenSuggestPopover.hide(),i||this.dispatchEvent(new CustomEvent("token-clicked",{detail:{index:e.index,tokenElement:e,byPointerDevice:t}}))}disableIfNeeded(e){return this.disabled?{...e,disabled:!0}:e}handleTokenSelection(e){this.selectedIndexes=this.selectedIndexes.concat(e),this.dispatchEvent(new CustomEvent("tokens-selected",{detail:{newIndices:e,selectedIndices:[...this.selectedIndexes]}}))}handleTokenCreation(e){this.dispatchEvent(new CustomEvent("token-created",{detail:{value:e}}))}get inputElement(){return this.shadowRoot.querySelector(".input")}get activeTokenElement(){return this.getTokenElement(this.activeTokenIndex)}getTokenElement(e){return this.querySelector("[slot='items']:nth-of-type("+(e+1)+")")}findIndex(e){return this.items.findIndex(t=>t.caption===e.caption)}get activeTokenIndex(){return this._activeTokenIndex}set activeTokenIndex(e){if(this._activeTokenIndex!=-1){let t=this.activeTokenElement;t&&(t.current=!1)}if(this._activeTokenIndex=e,e==-1)this.removeAttribute("aria-activedescendant");else{let t=this.activeTokenElement;t.current=!0,this.setAttribute("aria-activedescendant",t.id)}}get hasInputValue(){return!!this.inputElement?.value}},wt.ID="sd-token-selector",wt.ensureDefined=()=>{Je.ensureDefined(),customElements.get(wt.ID)||customElements.define(wt.ID,wt)},wt.shadowRootOptions={...D.shadowRootOptions,delegatesFocus:!0},wt);tt([h({type:String,attribute:"selection-mode",reflect:!0})],Y.prototype,"selectionMode");tt([h({type:Array,attribute:!1})],Y.prototype,"items");tt([h({type:Array,attribute:!1})],Y.prototype,"selectedIndexes");tt([h({type:String,reflect:!0})],Y.prototype,"placeholder");tt([h({type:String,reflect:!0,attribute:"suggest-list-class"})],Y.prototype,"suggestListClass");tt([h({type:String,reflect:!0,attribute:"input-label"})],Y.prototype,"inputLabel");tt([h({converter:{fromAttribute:e=>e=="true",toAttribute:e=>e},reflect:!0,attribute:"aria-disabled"})],Y.prototype,"disabled");tt([h({type:String,attribute:!0})],Y.prototype,"validationMessage");tt([h({type:String,attribute:!0})],Y.prototype,"validationIconSrc");tt([h({converter:he.levelConverter,attribute:!0,reflect:!0})],Y.prototype,"validationLevel");tt([h({type:String,reflect:!0,attribute:"token-type"})],Y.prototype,"tokenType");tt([h({type:Boolean,reflect:!0,attribute:"case-sensitive"})],Y.prototype,"caseSensitive");var br=Y;return Gs(yr);})();
159
160
  /*! Bundled license information:
160
161
 
161
162
  @lit/reactive-element/css-tag.js: