@cas-smartdesign/virtual-list 6.2.4 → 6.3.1

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,44 +1,43 @@
1
- var window;(window||={})["@cas-smartdesign/virtual-list"]=(()=>{var Q=Object.defineProperty;var Kt=Object.getOwnPropertyDescriptor;var Wt=Object.getOwnPropertyNames;var Vt=Object.prototype.hasOwnProperty;var jt=(i,t)=>{for(var e in t)Q(i,e,{get:t[e],enumerable:!0})},Bt=(i,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Wt(t))!Vt.call(i,n)&&n!==e&&Q(i,n,{get:()=>t[n],enumerable:!(s=Kt(t,n))||s.enumerable});return i};var Ft=i=>Bt(Q({},"__esModule",{value:!0}),i);var he={};jt(he,{ListDataProvider:()=>vt,SelectionType:()=>Ut,default:()=>zt});var j=window,B=j.ShadowRoot&&(j.ShadyCSS===void 0||j.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,X=Symbol(),_t=new WeakMap,P=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==X)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(B&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=_t.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&_t.set(e,t))}return t}toString(){return this.cssText}},k=i=>new P(typeof i=="string"?i:i+"",void 0,X),M=(i,...t)=>{let e=i.length===1?i[0]:t.reduce((s,n,o)=>s+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+i[o+1],i[0]);return new P(e,i,X)},tt=(i,t)=>{B?i.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):t.forEach(e=>{let s=document.createElement("style"),n=j.litNonce;n!==void 0&&s.setAttribute("nonce",n),s.textContent=e.cssText,i.appendChild(s)})},F=B?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return k(e)})(i):i;var et,G=window,gt=G.trustedTypes,Gt=gt?gt.emptyScript:"",bt=G.reactiveElementPolyfillSupport,st={toAttribute(i,t){switch(t){case Boolean:i=i?Gt:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,t){let e=i;switch(t){case Boolean:e=i!==null;break;case Number:e=i===null?null:Number(i);break;case Object:case Array:try{e=JSON.parse(i)}catch{e=null}}return e}},yt=(i,t)=>t!==i&&(t==t||i==i),it={attribute:!0,type:String,converter:st,reflect:!1,hasChanged:yt},nt="finalized",b=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),((e=this.h)!==null&&e!==void 0?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();let t=[];return this.elementProperties.forEach((e,s)=>{let n=this._$Ep(s,e);n!==void 0&&(this._$Ev.set(n,s),t.push(n))}),t}static createProperty(t,e=it){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){let s=typeof t=="symbol"?Symbol():"__"+t,n=this.getPropertyDescriptor(t,s,e);n!==void 0&&Object.defineProperty(this.prototype,t,n)}}static getPropertyDescriptor(t,e,s){return{get(){return this[e]},set(n){let o=this[t];this[e]=n,this.requestUpdate(t,o,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||it}static finalize(){if(this.hasOwnProperty(nt))return!1;this[nt]=!0;let t=Object.getPrototypeOf(this);if(t.finalize(),t.h!==void 0&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let e=this.properties,s=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(let n of s)this.createProperty(n,e[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let n of s)e.unshift(F(n))}else t!==void 0&&e.push(F(t));return e}static _$Ep(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(t=this.constructor.h)===null||t===void 0||t.forEach(e=>e(this))}addController(t){var e,s;((e=this._$ES)!==null&&e!==void 0?e:this._$ES=[]).push(t),this.renderRoot!==void 0&&this.isConnected&&((s=t.hostConnected)===null||s===void 0||s.call(t))}removeController(t){var e;(e=this._$ES)===null||e===void 0||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])})}createRenderRoot(){var t;let e=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return tt(e,this.constructor.elementStyles),e}connectedCallback(){var t;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$ES)===null||t===void 0||t.forEach(e=>{var s;return(s=e.hostConnected)===null||s===void 0?void 0:s.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$ES)===null||t===void 0||t.forEach(e=>{var s;return(s=e.hostDisconnected)===null||s===void 0?void 0:s.call(e)})}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EO(t,e,s=it){var n;let o=this.constructor._$Ep(t,s);if(o!==void 0&&s.reflect===!0){let r=(((n=s.converter)===null||n===void 0?void 0:n.toAttribute)!==void 0?s.converter:st).toAttribute(e,s.type);this._$El=t,r==null?this.removeAttribute(o):this.setAttribute(o,r),this._$El=null}}_$AK(t,e){var s;let n=this.constructor,o=n._$Ev.get(t);if(o!==void 0&&this._$El!==o){let r=n.getPropertyOptions(o),h=typeof r.converter=="function"?{fromAttribute:r.converter}:((s=r.converter)===null||s===void 0?void 0:s.fromAttribute)!==void 0?r.converter:st;this._$El=o,this[o]=h.fromAttribute(e,r.type),this._$El=null}}requestUpdate(t,e,s){let n=!0;t!==void 0&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||yt)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$El!==t&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(t,s))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((n,o)=>this[o]=n),this._$Ei=void 0);let e=!1,s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),(t=this._$ES)===null||t===void 0||t.forEach(n=>{var o;return(o=n.hostUpdate)===null||o===void 0?void 0:o.call(n)}),this.update(s)):this._$Ek()}catch(n){throw e=!1,this._$Ek(),n}e&&this._$AE(s)}willUpdate(t){}_$AE(t){var e;(e=this._$ES)===null||e===void 0||e.forEach(s=>{var n;return(n=s.hostUpdated)===null||n===void 0?void 0:n.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){this._$EC!==void 0&&(this._$EC.forEach((e,s)=>this._$EO(s,this[s],e)),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}};b[nt]=!0,b.elementProperties=new Map,b.elementStyles=[],b.shadowRootOptions={mode:"open"},bt?.({ReactiveElement:b}),((et=G.reactiveElementVersions)!==null&&et!==void 0?et:G.reactiveElementVersions=[]).push("1.6.3");var ot,J=window,N=J.trustedTypes,$t=N?N.createPolicy("lit-html",{createHTML:i=>i}):void 0,lt="$lit$",A=`lit$${(Math.random()+"").slice(9)}$`,Et="?"+A,Jt=`<${Et}>`,C=document,O=()=>C.createComment(""),U=i=>i===null||typeof i!="object"&&typeof i!="function",Tt=Array.isArray,Yt=i=>Tt(i)||typeof i?.[Symbol.iterator]=="function",rt=`[
2
- \f\r]`,H=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,At=/-->/g,xt=/>/g,S=RegExp(`>|${rt}(?:([^\\s"'>=/]+)(${rt}*=${rt}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),It=/'/g,St=/"/g,Lt=/^(?:script|style|textarea|title)$/i,kt=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),E=kt(1),fe=kt(2),y=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),wt=new WeakMap,w=C.createTreeWalker(C,129,null,!1);function Nt(i,t){if(!Array.isArray(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return $t!==void 0?$t.createHTML(t):t}var Zt=(i,t)=>{let e=i.length-1,s=[],n,o=t===2?"<svg>":"",r=H;for(let h=0;h<e;h++){let l=i[h],a,c,p=-1,m=0;for(;m<l.length&&(r.lastIndex=m,c=r.exec(l),c!==null);)m=r.lastIndex,r===H?c[1]==="!--"?r=At:c[1]!==void 0?r=xt:c[2]!==void 0?(Lt.test(c[2])&&(n=RegExp("</"+c[2],"g")),r=S):c[3]!==void 0&&(r=S):r===S?c[0]===">"?(r=n??H,p=-1):c[1]===void 0?p=-2:(p=r.lastIndex-c[2].length,a=c[1],r=c[3]===void 0?S:c[3]==='"'?St:It):r===St||r===It?r=S:r===At||r===xt?r=H:(r=S,n=void 0);let _=r===S&&i[h+1].startsWith("/>")?" ":"";o+=r===H?l+Jt:p>=0?(s.push(a),l.slice(0,p)+lt+l.slice(p)+A+_):l+A+(p===-2?(s.push(void 0),h):_)}return[Nt(i,o+(i[e]||"<?>")+(t===2?"</svg>":"")),s]},z=class i{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let o=0,r=0,h=t.length-1,l=this.parts,[a,c]=Zt(t,e);if(this.el=i.createElement(a,s),w.currentNode=this.el.content,e===2){let p=this.el.content,m=p.firstChild;m.remove(),p.append(...m.childNodes)}for(;(n=w.nextNode())!==null&&l.length<h;){if(n.nodeType===1){if(n.hasAttributes()){let p=[];for(let m of n.getAttributeNames())if(m.endsWith(lt)||m.startsWith(A)){let _=c[r++];if(p.push(m),_!==void 0){let qt=n.getAttribute(_.toLowerCase()+lt).split(A),V=/([.?@])?(.*)/.exec(_);l.push({type:1,index:o,name:V[2],strings:qt,ctor:V[1]==="."?ht:V[1]==="?"?dt:V[1]==="@"?ct:D})}else l.push({type:6,index:o})}for(let m of p)n.removeAttribute(m)}if(Lt.test(n.tagName)){let p=n.textContent.split(A),m=p.length-1;if(m>0){n.textContent=N?N.emptyScript:"";for(let _=0;_<m;_++)n.append(p[_],O()),w.nextNode(),l.push({type:2,index:++o});n.append(p[m],O())}}}else if(n.nodeType===8)if(n.data===Et)l.push({type:2,index:o});else{let p=-1;for(;(p=n.data.indexOf(A,p+1))!==-1;)l.push({type:7,index:o}),p+=A.length-1}o++}}static createElement(t,e){let s=C.createElement("template");return s.innerHTML=t,s}};function R(i,t,e=i,s){var n,o,r,h;if(t===y)return t;let l=s!==void 0?(n=e._$Co)===null||n===void 0?void 0:n[s]:e._$Cl,a=U(t)?void 0:t._$litDirective$;return l?.constructor!==a&&((o=l?._$AO)===null||o===void 0||o.call(l,!1),a===void 0?l=void 0:(l=new a(i),l._$AT(i,e,s)),s!==void 0?((r=(h=e)._$Co)!==null&&r!==void 0?r:h._$Co=[])[s]=l:e._$Cl=l),l!==void 0&&(t=R(i,l._$AS(i,t.values),l,s)),t}var at=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var e;let{el:{content:s},parts:n}=this._$AD,o=((e=t?.creationScope)!==null&&e!==void 0?e:C).importNode(s,!0);w.currentNode=o;let r=w.nextNode(),h=0,l=0,a=n[0];for(;a!==void 0;){if(h===a.index){let c;a.type===2?c=new q(r,r.nextSibling,this,t):a.type===1?c=new a.ctor(r,a.name,a.strings,this,t):a.type===6&&(c=new ut(r,this,t)),this._$AV.push(c),a=n[++l]}h!==a?.index&&(r=w.nextNode(),h++)}return w.currentNode=C,o}v(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}},q=class i{constructor(t,e,s,n){var o;this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=n,this._$Cp=(o=n?.isConnected)===null||o===void 0||o}get _$AU(){var t,e;return(e=(t=this._$AM)===null||t===void 0?void 0:t._$AU)!==null&&e!==void 0?e:this._$Cp}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=R(this,t,e),U(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==y&&this._(t):t._$litType$!==void 0?this.g(t):t.nodeType!==void 0?this.$(t):Yt(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==d&&U(this._$AH)?this._$AA.nextSibling.data=t:this.$(C.createTextNode(t)),this._$AH=t}g(t){var e;let{values:s,_$litType$:n}=t,o=typeof n=="number"?this._$AC(t):(n.el===void 0&&(n.el=z.createElement(Nt(n.h,n.h[0]),this.options)),n);if(((e=this._$AH)===null||e===void 0?void 0:e._$AD)===o)this._$AH.v(s);else{let r=new at(o,this),h=r.u(this.options);r.v(s),this.$(h),this._$AH=r}}_$AC(t){let e=wt.get(t.strings);return e===void 0&&wt.set(t.strings,e=new z(t)),e}T(t){Tt(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,n=0;for(let o of t)n===e.length?e.push(s=new i(this.k(O()),this.k(O()),this,this.options)):s=e[n],s._$AI(o),n++;n<e.length&&(this._$AR(s&&s._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)===null||s===void 0||s.call(this,!1,!0,e);t&&t!==this._$AB;){let n=t.nextSibling;t.remove(),t=n}}setConnected(t){var e;this._$AM===void 0&&(this._$Cp=t,(e=this._$AP)===null||e===void 0||e.call(this,t))}},D=class{constructor(t,e,s,n,o){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=o,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,n){let o=this.strings,r=!1;if(o===void 0)t=R(this,t,e,0),r=!U(t)||t!==this._$AH&&t!==y,r&&(this._$AH=t);else{let h=t,l,a;for(t=o[0],l=0;l<o.length-1;l++)a=R(this,h[s+l],e,l),a===y&&(a=this._$AH[l]),r||(r=!U(a)||a!==this._$AH[l]),a===d?t=d:t!==d&&(t+=(a??"")+o[l+1]),this._$AH[l]=a}r&&!n&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},ht=class extends D{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}},Qt=N?N.emptyScript:"",dt=class extends D{constructor(){super(...arguments),this.type=4}j(t){t&&t!==d?this.element.setAttribute(this.name,Qt):this.element.removeAttribute(this.name)}},ct=class extends D{constructor(t,e,s,n,o){super(t,e,s,n,o),this.type=5}_$AI(t,e=this){var s;if((t=(s=R(this,t,e,0))!==null&&s!==void 0?s:d)===y)return;let n=this._$AH,o=t===d&&n!==d||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,r=t!==d&&(n===d||o);o&&this.element.removeEventListener(this.name,this,n),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,s;typeof this._$AH=="function"?this._$AH.call((s=(e=this.options)===null||e===void 0?void 0:e.host)!==null&&s!==void 0?s:this.element,t):this._$AH.handleEvent(t)}},ut=class{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){R(this,t)}};var Ct=J.litHtmlPolyfillSupport;Ct?.(z,q),((ot=J.litHtmlVersions)!==null&&ot!==void 0?ot:J.litHtmlVersions=[]).push("2.8.0");var Rt=(i,t,e)=>{var s,n;let o=(s=e?.renderBefore)!==null&&s!==void 0?s:t,r=o._$litPart$;if(r===void 0){let h=(n=e?.renderBefore)!==null&&n!==void 0?n:null;o._$litPart$=r=new q(t.insertBefore(O(),h),h,void 0,e??{})}return r._$AI(i),r};var pt,mt;var g=class extends b{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;let s=super.createRenderRoot();return(t=(e=this.renderOptions).renderBefore)!==null&&t!==void 0||(e.renderBefore=s.firstChild),s}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Rt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!1)}render(){return y}};g.finalized=!0,g._$litElement$=!0,(pt=globalThis.litElementHydrateSupport)===null||pt===void 0||pt.call(globalThis,{LitElement:g});var Dt=globalThis.litElementPolyfillSupport;Dt?.({LitElement:g});((mt=globalThis.litElementVersions)!==null&&mt!==void 0?mt:globalThis.litElementVersions=[]).push("3.3.3");var Xt=(i,t)=>t.kind==="method"&&t.descriptor&&!("value"in t.descriptor)?{...t,finisher(e){e.createProperty(t.key,i)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){typeof t.initializer=="function"&&(this[t.key]=t.initializer.call(this))},finisher(e){e.createProperty(t.key,i)}},te=(i,t,e)=>{t.constructor.createProperty(e,i)};function u(i){return(t,e)=>e!==void 0?te(i,t,e):Xt(i,t)}var Pt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Mt=i=>(...t)=>({_$litDirective$:i,values:t}),Y=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var K=class extends Y{constructor(t){if(super(t),this.et=d,t.type!==Pt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===d||t==null)return this.ft=void 0,this.et=t;if(t===y)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.et)return this.ft;this.et=t;let e=[t];return e.raw=e,this.ft={_$litType$:this.constructor.resultType,strings:e,values:[]}}};K.directiveName="unsafeHTML",K.resultType=1;var Ht=Mt(K);var W=i=>i??d;var Z=class{static showImage(t,e,s,n){let o;if(n||!(t instanceof HTMLImageElement)?o=r=>t.style.backgroundImage=this.prepareSrc(r):o=r=>t.src=r,o(s),e){let r=()=>{o(e)},h=new Image;h.addEventListener("load",r),h.src=e,h.complete&&(h.removeEventListener("load",r),r())}}static prepareSrc(t){return t?t.startsWith("url")?t:`url("${t}")`:null}};var ee=':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;word-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}',ie=Object.defineProperty,se=Object.getOwnPropertyDescriptor,v=(i,t,e,s)=>{for(var n=s>1?void 0:s?se(t,e):t,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=(s?r(t,e,n):r(n))||n);return s&&n&&ie(t,e,n),n},T,f=(T=class extends g{constructor(){super(...arguments),this.contentMode="text",this.role="option"}static get styles(){return[M`
4
- ${k(ee)}
5
- `]}render(){return E`
1
+ var window;(window||={})["@cas-smartdesign/virtual-list"]=(()=>{var lt=Object.defineProperty;var Vt=Object.getOwnPropertyDescriptor;var jt=Object.getOwnPropertyNames;var Ft=Object.prototype.hasOwnProperty;var Gt=(e,t)=>{for(var i in t)lt(e,i,{get:t[i],enumerable:!0})},Jt=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of jt(t))!Ft.call(e,n)&&n!==i&&lt(e,n,{get:()=>t[n],enumerable:!(s=Vt(t,n))||s.enumerable});return e};var Zt=e=>Jt(lt({},"__esModule",{value:!0}),e);var ye={};Gt(ye,{ListDataProvider:()=>bt,SelectionType:()=>Bt,default:()=>Wt});var Z=globalThis,Q=Z.ShadowRoot&&(Z.ShadyCSS===void 0||Z.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ht=Symbol(),yt=new WeakMap,O=class{constructor(t,i,s){if(this._$cssResult$=!0,s!==ht)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(Q&&t===void 0){let s=i!==void 0&&i.length===1;s&&(t=yt.get(i)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&yt.set(i,t))}return t}toString(){return this.cssText}},N=e=>new O(typeof e=="string"?e:e+"",void 0,ht),H=(e,...t)=>{let i=e.length===1?e[0]:t.reduce(((s,n,o)=>s+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+e[o+1]),e[0]);return new O(i,e,ht)},At=(e,t)=>{if(Q)e.adoptedStyleSheets=t.map((i=>i instanceof CSSStyleSheet?i:i.styleSheet));else for(let i of t){let s=document.createElement("style"),n=Z.litNonce;n!==void 0&&s.setAttribute("nonce",n),s.textContent=i.cssText,e.appendChild(s)}},ct=Q?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let i="";for(let s of t.cssRules)i+=s.cssText;return N(i)})(e):e;var{is:Qt,defineProperty:Yt,getOwnPropertyDescriptor:Xt,getOwnPropertyNames:te,getOwnPropertySymbols:ee,getPrototypeOf:ie}=Object,Y=globalThis,xt=Y.trustedTypes,se=xt?xt.emptyScript:"",ne=Y.reactiveElementPolyfillSupport,U=(e,t)=>e,z={toAttribute(e,t){switch(t){case Boolean:e=e?se: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}},X=(e,t)=>!Qt(e,t),It={attribute:!0,type:String,converter:z,reflect:!1,useDefault:!1,hasChanged:X};Symbol.metadata??=Symbol("metadata"),Y.litPropertyMetadata??=new WeakMap;var $=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=It){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(),n=this.getPropertyDescriptor(t,s,i);n!==void 0&&Yt(this.prototype,t,n)}}static getPropertyDescriptor(t,i,s){let{get:n,set:o}=Xt(this.prototype,t)??{get(){return this[i]},set(r){this[i]=r}};return{get:n,set(r){let l=n?.call(this);o?.call(this,r),this.requestUpdate(t,l,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??It}static _$Ei(){if(this.hasOwnProperty(U("elementProperties")))return;let t=ie(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(U("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(U("properties"))){let i=this.properties,s=[...te(i),...ee(i)];for(let n of s)this.createProperty(n,i[n])}let t=this[Symbol.metadata];if(t!==null){let i=litPropertyMetadata.get(t);if(i!==void 0)for(let[s,n]of i)this.elementProperties.set(s,n)}this._$Eh=new Map;for(let[i,s]of this.elementProperties){let n=this._$Eu(i,s);n!==void 0&&this._$Eh.set(n,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 n of s)i.unshift(ct(n))}else t!==void 0&&i.push(ct(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 At(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),n=this.constructor._$Eu(t,s);if(n!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:z).toAttribute(i,s.type);this._$Em=t,o==null?this.removeAttribute(n):this.setAttribute(n,o),this._$Em=null}}_$AK(t,i){let s=this.constructor,n=s._$Eh.get(t);if(n!==void 0&&this._$Em!==n){let o=s.getPropertyOptions(n),r=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:z;this._$Em=n;let l=r.fromAttribute(i,o.type);this[n]=l??this._$Ej?.get(n)??l,this._$Em=null}}requestUpdate(t,i,s){if(t!==void 0){let n=this.constructor,o=this[t];if(s??=n.getPropertyOptions(t),!((s.hasChanged??X)(o,i)||s.useDefault&&s.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(n._$Eu(t,s))))return;this.C(t,i,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,i,{useDefault:s,reflect:n,wrapped:o},r){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??i??this[t]),o!==!0||r!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(i=void 0),this._$AL.set(t,i)),n===!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[n,o]of this._$Ep)this[n]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[n,o]of s){let{wrapped:r}=o,l=this[n];r!==!0||this._$AL.has(n)||l===void 0||this.C(n,void 0,o,l)}}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){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[U("elementProperties")]=new Map,$[U("finalized")]=new Map,ne?.({ReactiveElement:$}),(Y.reactiveElementVersions??=[]).push("2.1.1");var pt=globalThis,tt=pt.trustedTypes,St=tt?tt.createPolicy("lit-html",{createHTML:e=>e}):void 0,ut="$lit$",v=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+v,oe=`<${mt}>`,E=document,K=()=>E.createComment(""),B=e=>e===null||typeof e!="object"&&typeof e!="function",ft=Array.isArray,Lt=e=>ft(e)||typeof e?.[Symbol.iterator]=="function",dt=`[
2
+ \f\r]`,q=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,wt=/-->/g,Ct=/>/g,w=RegExp(`>|${dt}(?:([^\\s"'>=/]+)(${dt}*=${dt}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Et=/'/g,Tt=/"/g,Mt=/^(?:script|style|textarea|title)$/i,_t=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),x=_t(1),Ce=_t(2),Ee=_t(3),b=Symbol.for("lit-noChange"),h=Symbol.for("lit-nothing"),Pt=new WeakMap,C=E.createTreeWalker(E,129);function Nt(e,t){if(!ft(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return St!==void 0?St.createHTML(t):t}var kt=(e,t)=>{let i=e.length-1,s=[],n,o=t===2?"<svg>":t===3?"<math>":"",r=q;for(let l=0;l<i;l++){let a=e[l],d,u,p=-1,g=0;for(;g<a.length&&(r.lastIndex=g,u=r.exec(a),u!==null);)g=r.lastIndex,r===q?u[1]==="!--"?r=wt:u[1]!==void 0?r=Ct:u[2]!==void 0?(Mt.test(u[2])&&(n=RegExp("</"+u[2],"g")),r=w):u[3]!==void 0&&(r=w):r===w?u[0]===">"?(r=n??q,p=-1):u[1]===void 0?p=-2:(p=r.lastIndex-u[2].length,d=u[1],r=u[3]===void 0?w:u[3]==='"'?Tt:Et):r===Tt||r===Et?r=w:r===wt||r===Ct?r=q:(r=w,n=void 0);let A=r===w&&e[l+1].startsWith("/>")?" ":"";o+=r===q?a+oe:p>=0?(s.push(d),a.slice(0,p)+ut+a.slice(p)+v+A):a+v+(p===-2?l:A)}return[Nt(e,o+(e[i]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]},W=class e{constructor({strings:t,_$litType$:i},s){let n;this.parts=[];let o=0,r=0,l=t.length-1,a=this.parts,[d,u]=kt(t,i);if(this.el=e.createElement(d,s),C.currentNode=this.el.content,i===2||i===3){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(n=C.nextNode())!==null&&a.length<l;){if(n.nodeType===1){if(n.hasAttributes())for(let p of n.getAttributeNames())if(p.endsWith(ut)){let g=u[r++],A=n.getAttribute(p).split(v),J=/([.?@])?(.*)/.exec(g);a.push({type:1,index:o,name:J[2],strings:A,ctor:J[1]==="."?it:J[1]==="?"?st:J[1]==="@"?nt:P}),n.removeAttribute(p)}else p.startsWith(v)&&(a.push({type:6,index:o}),n.removeAttribute(p));if(Mt.test(n.tagName)){let p=n.textContent.split(v),g=p.length-1;if(g>0){n.textContent=tt?tt.emptyScript:"";for(let A=0;A<g;A++)n.append(p[A],K()),C.nextNode(),a.push({type:2,index:++o});n.append(p[g],K())}}}else if(n.nodeType===8)if(n.data===mt)a.push({type:2,index:o});else{let p=-1;for(;(p=n.data.indexOf(v,p+1))!==-1;)a.push({type:7,index:o}),p+=v.length-1}o++}}static createElement(t,i){let s=E.createElement("template");return s.innerHTML=t,s}};function T(e,t,i=e,s){if(t===b)return t;let n=s!==void 0?i._$Co?.[s]:i._$Cl,o=B(t)?void 0:t._$litDirective$;return n?.constructor!==o&&(n?._$AO?.(!1),o===void 0?n=void 0:(n=new o(e),n._$AT(e,i,s)),s!==void 0?(i._$Co??=[])[s]=n:i._$Cl=n),n!==void 0&&(t=T(e,n._$AS(e,t.values),n,s)),t}var et=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,n=(t?.creationScope??E).importNode(i,!0);C.currentNode=n;let o=C.nextNode(),r=0,l=0,a=s[0];for(;a!==void 0;){if(r===a.index){let d;a.type===2?d=new k(o,o.nextSibling,this,t):a.type===1?d=new a.ctor(o,a.name,a.strings,this,t):a.type===6&&(d=new ot(o,this,t)),this._$AV.push(d),a=s[++l]}r!==a?.index&&(o=C.nextNode(),r++)}return C.currentNode=E,n}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++}},k=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,n){this.type=2,this._$AH=h,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=n,this._$Cv=n?.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=T(this,t,i),B(t)?t===h||t==null||t===""?(this._$AH!==h&&this._$AR(),this._$AH=h):t!==this._$AH&&t!==b&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Lt(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!==h&&B(this._$AH)?this._$AA.nextSibling.data=t:this.T(E.createTextNode(t)),this._$AH=t}$(t){let{values:i,_$litType$:s}=t,n=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=W.createElement(Nt(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===n)this._$AH.p(i);else{let o=new et(n,this),r=o.u(this.options);o.p(i),this.T(r),this._$AH=o}}_$AC(t){let i=Pt.get(t.strings);return i===void 0&&Pt.set(t.strings,i=new W(t)),i}k(t){ft(this._$AH)||(this._$AH=[],this._$AR());let i=this._$AH,s,n=0;for(let o of t)n===i.length?i.push(s=new e(this.O(K()),this.O(K()),this,this.options)):s=i[n],s._$AI(o),n++;n<i.length&&(this._$AR(s&&s._$AB.nextSibling,n),i.length=n)}_$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))}},P=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,n,o){this.type=1,this._$AH=h,this._$AN=void 0,this.element=t,this.name=i,this._$AM=n,this.options=o,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=h}_$AI(t,i=this,s,n){let o=this.strings,r=!1;if(o===void 0)t=T(this,t,i,0),r=!B(t)||t!==this._$AH&&t!==b,r&&(this._$AH=t);else{let l=t,a,d;for(t=o[0],a=0;a<o.length-1;a++)d=T(this,l[s+a],i,a),d===b&&(d=this._$AH[a]),r||=!B(d)||d!==this._$AH[a],d===h?t=h:t!==h&&(t+=(d??"")+o[a+1]),this._$AH[a]=d}r&&!n&&this.j(t)}j(t){t===h?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},it=class extends P{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===h?void 0:t}},st=class extends P{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==h)}},nt=class extends P{constructor(t,i,s,n,o){super(t,i,s,n,o),this.type=5}_$AI(t,i=this){if((t=T(this,t,i,0)??h)===b)return;let s=this._$AH,n=t===h&&s!==h||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,o=t!==h&&(s===h||n);n&&this.element.removeEventListener(this.name,this,s),o&&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)}},ot=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){T(this,t)}},Dt={M:ut,P:v,A:mt,C:1,L:kt,R:et,D:Lt,V:T,I:k,H:P,N:st,U:nt,B:it,F:ot},re=pt.litHtmlPolyfillSupport;re?.(W,k),(pt.litHtmlVersions??=[]).push("3.3.1");var Rt=(e,t,i)=>{let s=i?.renderBefore??t,n=s._$litPart$;if(n===void 0){let o=i?.renderBefore??null;s._$litPart$=n=new k(t.insertBefore(K(),o),o,void 0,i??{})}return n._$AI(e),n};var gt=globalThis,_=class extends ${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=Rt(i,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return b}};_._$litElement$=!0,_.finalized=!0,gt.litElementHydrateSupport?.({LitElement:_});var ae=gt.litElementPolyfillSupport;ae?.({LitElement:_});(gt.litElementVersions??=[]).push("4.2.1");var le={attribute:!0,type:String,converter:z,reflect:!1,hasChanged:X},he=(e=le,t,i)=>{let{kind:s,metadata:n}=i,o=globalThis.litPropertyMetadata.get(n);if(o===void 0&&globalThis.litPropertyMetadata.set(n,o=new Map),s==="setter"&&((e=Object.create(e)).wrapped=!0),o.set(i.name,e),s==="accessor"){let{name:r}=i;return{set(l){let a=t.get.call(this);t.set.call(this,l),this.requestUpdate(r,a,e)},init(l){return l!==void 0&&this.C(r,void 0,e,l),l}}}if(s==="setter"){let{name:r}=i;return function(l){let a=this[r];t.call(this,l),this.requestUpdate(r,a,e)}}throw Error("Unsupported decorator location: "+s)};function c(e){return(t,i)=>typeof i=="object"?he(e,t,i):((s,n,o)=>{let r=n.hasOwnProperty(o);return n.constructor.createProperty(o,s),r?Object.getOwnPropertyDescriptor(n,o):void 0})(e,t,i)}var R={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},V=e=>(...t)=>({_$litDirective$:e,values:t}),D=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 j=class extends D{constructor(t){if(super(t),this.it=h,t.type!==R.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===h||t==null)return this._t=void 0,this.it=t;if(t===b)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:[]}}};j.directiveName="unsafeHTML",j.resultType=1;var Ot=V(j);var F=e=>e??h;var{I:ii}=Dt;var Ht=e=>e.strings===void 0;var G=(e,t)=>{let i=e._$AN;if(i===void 0)return!1;for(let s of i)s._$AO?.(t,!1),G(s,t);return!0},rt=e=>{let t,i;do{if((t=e._$AM)===void 0)break;i=t._$AN,i.delete(e),e=t}while(i?.size===0)},Ut=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),pe(t)}};function ce(e){this._$AN!==void 0?(rt(this),this._$AM=e,Ut(this)):this._$AM=e}function de(e,t=!1,i=0){let s=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(t)if(Array.isArray(s))for(let o=i;o<s.length;o++)G(s[o],!1),rt(s[o]);else s!=null&&(G(s,!1),rt(s));else G(this,e)}var pe=e=>{e.type==R.CHILD&&(e._$AP??=de,e._$AQ??=ce)},at=class extends D{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,i,s){super._$AT(t,i,s),Ut(this),this.isConnected=t._$AU}_$AO(t,i=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),i&&(G(this,t),rt(this))}setValue(t){if(Ht(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 zt=e=>e?e.startsWith("url")?e:`url("${e}")`:null,ue=(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 $t=class extends at{constructor(t){if(super(t),t.type!==R.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(n=>{this.preload(n,s)}),this.useCssBackground?zt(i):i}preload(t,i){t!=null&&!i.cancelled&&ue(t,()=>{i.cancelled||this.setValue(this.useCssBackground?zt(t):t)})}},qt=V($t);var me=':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}',fe=Object.defineProperty,f=(e,t,i,s)=>{for(var n=void 0,o=e.length-1,r;o>=0;o--)(r=e[o])&&(n=r(t,i,n)||n);return n&&fe(t,i,n),n},L,m=(L=class extends _{constructor(){super(...arguments),this.contentMode="text",this.role="option"}static get styles(){return[H`
4
+ ${N(me)}
5
+ `]}render(){return x`
6
6
  <div class="container">
7
- ${this.getLevelIndicators().map((i,t)=>E` <div class="level-indicator level-${t}"></div> `)}
7
+ ${this.getLevelIndicators().map((e,t)=>x` <div class="level-indicator level-${t}"></div> `)}
8
8
  <div class="side-content">
9
9
  <slot name="left-content"></slot>
10
10
  ${this.renderIcon()}
11
11
  </div>
12
12
  <div class="labels">
13
13
  ${this.renderLabel("caption",this.caption,this.captionAttrTitle)}
14
- ${this.renderLabel("description",this.description,this.descriptionAttrTitle)}
14
+ ${this.renderLabel("description",this.description,this.descriptionAttrTitle,this.descriptionIcon)}
15
15
  </div>
16
16
  <div class="side-content">
17
17
  <slot name="right-content"></slot>
18
18
  </div>
19
19
  </div>
20
- `}renderIcon(){if(this.icon||this.iconPlaceholder){let i=this.iconBackgroundColor!=null?`background-color:${this.iconBackgroundColor}`:void 0;return E`
21
- <div
22
- class="icon-wrapper"
23
- @pointerdown="${this.handleIconClick}"
24
- style="${W(i)}"
25
- role="img"
26
- aria-label="${W(this.iconAttrAriaLabel)}"
27
- title="${W(this.iconAttrTitle)}"
28
- >
29
- <div class="icon"></div>
30
- </div>
31
- `}return d}renderLabel(i,t,e){return t?E`
32
- <div class="${i}" title="${W(e)}">
33
- ${this.contentMode==="html"?Ht(t):t}
20
+ `}renderIcon(){return this.icon||this.iconPlaceholder?x`<div
21
+ class="icon-wrapper"
22
+ @pointerdown="${this.handleIconClick}"
23
+ style="background-color:${F(this.iconBackgroundColor)};"
24
+ role="img"
25
+ aria-label="${F(this.iconAttrAriaLabel)}"
26
+ title="${F(this.iconAttrTitle)}"
27
+ >
28
+ <div class="icon" style="background-image:${qt(this.icon,this.iconPlaceholder)}"></div>
29
+ </div> `:h}renderLabel(e,t,i,s){return t?x`
30
+ <div class="${e} ${s?"with-icon":""}" title="${F(i)}">
31
+ ${s?x` <div class="${e}-icon" style="background-image:url('${s}')" aria-hidden="true"></div> `:h}
32
+ ${this.contentMode==="html"?Ot(t):t}
34
33
  </div>
35
- `:d}updated(i){super.updated(i),(i.has("icon")||i.has("iconPlaceholder"))&&(this.icon||this.iconPlaceholder)&&Z.showImage(this.shadowRoot.querySelector(".icon"),this.icon,this.iconPlaceholder),i.has("selected")&&this.setAttribute("aria-selected",String(this.selected))}get missingWidthForTexts(){let i=this.enableLineClamp;this.removeAttribute("enable-line-clamp");let t=0,e=this.shadowRoot.querySelector(".caption");e&&(t+=e.scrollWidth-e.clientWidth);let s=this.shadowRoot.querySelector(".description");return s&&(t=Math.max(t,s.scrollWidth-s.clientWidth)),t>0&&t++,i&&this.setAttribute("enable-line-clamp",""),t}handleIconClick(i){!this.disabled&&!this.dispatchEvent(new PointerEvent("list-item-icon-click",i))&&i.preventDefault()}getLevelIndicators(){return this.level?Array(Number(this.level)).fill(null):[]}},T.ID="sd-list-item",T.ensureDefined=()=>{customElements.get(T.ID)||customElements.define(T.ID,T)},T);v([u({type:String})],f.prototype,"caption",2);v([u({type:String})],f.prototype,"description",2);v([u({type:Boolean})],f.prototype,"selected",2);v([u({type:String})],f.prototype,"icon",2);v([u({type:String})],f.prototype,"iconBackgroundColor",2);v([u({type:String})],f.prototype,"iconPlaceholder",2);v([u({type:Number})],f.prototype,"level",2);v([u()],f.prototype,"contentMode",2);v([u({type:Boolean,reflect:!0,attribute:"enable-line-clamp"})],f.prototype,"enableLineClamp",2);v([u({converter:{fromAttribute:i=>i=="true",toAttribute:i=>i},reflect:!0,attribute:"aria-disabled"})],f.prototype,"disabled",2);v([u({type:String,attribute:"icon-attr-aria-label"})],f.prototype,"iconAttrAriaLabel",2);v([u({type:String,reflect:!0})],f.prototype,"role",2);v([u({type:String,attribute:"caption-attr-title"})],f.prototype,"captionAttrTitle",2);v([u({type:String,attribute:"description-attr-title"})],f.prototype,"descriptionAttrTitle",2);v([u({type:String,attribute:"icon-attr-title"})],f.prototype,"iconAttrTitle",2);var L=f,Ot=(i,t)=>{let e=document.createElement(L.ID);if(i){if(e.caption=i.caption,e.description=i.description,e.icon=i.icon,e.iconBackgroundColor=i.iconBackgroundColor,e.iconPlaceholder=i.iconPlaceholder,e.level=i.level,e.disabled=i.disabled,i.contentMode&&(e.contentMode=i.contentMode),i.leftContentGenerator){let s=i.leftContentGenerator(i,e);s&&(s.slot="left-content",e.appendChild(s))}if(i.rightContentGenerator){let s=i.rightContentGenerator(i,e);s&&(s.slot="right-content",e.appendChild(s))}}return e};L.ensureDefined();var ft=class{getOffsetForIndexAndAlignment(t,e,s,n,o,r){let h=Math.max(0,r*n),l=Math.min(h,t*n),a=Math.max(0,t*n-o+n);switch(e){case"start":return l;case"end":return a;case"center":{let c=Math.round(a+(l-a)/2);return c<Math.ceil(o/2)?0:c>h+Math.floor(o/2)?h:c}case"auto":default:return s>=a&&s<=l?s:s<a?a:l}}debounce(t){let e;return(...s)=>{e&&window.cancelAnimationFrame(e),e=window.requestAnimationFrame(()=>{t(...s),e=null})}}},ne=new ft,vt=class{constructor(t=100,e=5){this.pageSize=t,this.preloadedItemsCount=e,this._finalSizeIsKnown=!1,this._itemCache=[],this._lastRequestedFirstIndex=0,this._lastRequestedLastIndex=0,this._lastLoadedIndex=0,this.handleListDataRequest=s=>{let{startIndex:n,stopIndex:o}=s.detail;this._lastRequestedFirstIndex=n,this._lastRequestedLastIndex=o,this._list.items=this._itemCache.slice(n,o+1),!this.finalSizeIsKnown&&this._lastLoadedIndex<o+this.preloadedItemsCount&&this.requestData()},this.itemCount=t}get currentPage(){return this.items.length==0&&this.finalSizeIsKnown?0:Math.floor((this.items.length-1)/this.pageSize)}get finalSizeIsKnown(){return this._finalSizeIsKnown}set finalSizeIsKnown(t){this._finalSizeIsKnown=t,t&&(this.itemCount=this._itemCache.length),this._list&&(this._list.finalSizeIsKnown=t)}get itemCount(){return this._itemCount}set itemCount(t){this._itemCount=t,this._list&&(this._list.itemCount=t)}get items(){return this._itemCache}set items(t){this._itemCache=t,this.onItemsChange()}addItems(t){this._itemCache=this._itemCache.concat(t),this.onItemsChange()}connectList(t){this._list&&this._list.removeEventListener("data-request",this.handleListDataRequest),this._list=t,t.itemCount=this.itemCount,t.addEventListener("data-request",this.handleListDataRequest),t.finalSizeIsKnown=this._finalSizeIsKnown}onItemsChange(){this._pendingDataRequest=!1,this._lastLoadedIndex=this._itemCache.length-1,this.finalSizeIsKnown?this.itemCount=this._itemCache.length:this._lastLoadedIndex>this.itemCount&&(this.itemCount=this._lastLoadedIndex),this._list&&(this._list.items=this._itemCache.slice(this._lastRequestedFirstIndex,this._lastRequestedLastIndex+1))}requestData(){if(!this._pendingDataRequest)if(this.onDataRequest)this._pendingDataRequest=!0,this.onDataRequest(this.currentPage+1),this._lastLoadedIndex+=this.pageSize-1,this._lastLoadedIndex>this.itemCount&&(this.itemCount=this._lastLoadedIndex);else throw Error("The final size is not yet known and the list would require item data from index "+this._lastRequestedFirstIndex+". to "+this._lastRequestedLastIndex+". which is not possible to load without a configured onDataRequest")}},oe=":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}",re=Object.defineProperty,le=Object.getOwnPropertyDescriptor,I=(i,t,e,s)=>{for(var n=s>1?void 0:s?le(t,e):t,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=(s?r(t,e,n):r(n))||n);return s&&n&&re(t,e,n),n},Ut=(i=>(i.TriggerOnly="trigger-only",i.Single="single",i.Multi="multi",i))(Ut||{}),ae=0,x,$=(x=class extends g{constructor(){super(),this.items=[],this.selectionType="trigger-only",this.id=x.ID+"_"+ae++,this.role="listbox",this.itemGenerator=Ot,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 i=this._lastRenderedScrollTop-this._lastKnownScrollTop;Math.abs(i)>=this.itemHeight&&(this._lastRenderedScrollTop=this._lastKnownScrollTop,this.requestUpdate())},this.handleKeyDown=i=>{let t=!0;switch(i.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,i.metaKey||i.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&&(i.preventDefault(),i.stopPropagation())},this._resizeObserver=new ResizeObserver(()=>{this._lastKnownHeight!==this.offsetHeight&&(this._lastKnownHeight=this.offsetHeight,this.requestUpdate())})}get focusTarget(){return this.hasAttribute("focus-target")}set focusTarget(i){this.toggleAttribute("focus-target",i)}get focusIndex(){return this._focusIndex}set focusIndex(i){if(i>=-1&&i<this.itemCount){let t=this._focusIndex;this._focusIndex=i,(i<=this._firstVisibleIndex||this._lastVisibleIndex<=i)&&this.scrollToItem(i),t!=i&&(i==-1&&this.removeAttribute("aria-activedescendant"),this.requestUpdate("focusIndex",t))}}get selectedIndices(){return this._selectedIndices}set selectedIndices(i){i?this._selectedIndices=i.map(t=>Number(t)):this._selectedIndices=[],this.requestUpdate("selectedIndices")}scrollToItem(i,t="auto"){this.scrollTop=ne.getOffsetForIndexAndAlignment(this.normalizeIndex(i),t,this.scrollTop,this.itemHeight,this.height,this.itemCount),this._lastKnownScrollTop=this.scrollTop}getListItem(i){return!this.shadowRoot||i<this._firstVisibleIndex||this._lastVisibleIndex<i?null:this.querySelector(`[item-index="${i}"]`)}connectedCallback(){super.connectedCallback(),this._resizeObserver.observe(this),this.scrollTop!==this._lastKnownScrollTop&&(this.scrollTop=this._lastKnownScrollTop,this.requestUpdate())}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver.disconnect()}firstUpdated(i){super.firstUpdated(i),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 i=this.getListItem(this.focusIndex);i&&(this.focusTarget||document.activeElement==this?(i.setAttribute("focused",""),this.setAttribute("aria-activedescendant",i.id)):(i.removeAttribute("focused"),this.removeAttribute("aria-activedescendant")))}static get styles(){return[M`
36
- ${k(oe)}
37
- `]}render(){return this.updateItemsRenderData(),E`
34
+ `:h}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):[]}},L.ID="sd-list-item",L.ensureDefined=()=>{customElements.get(L.ID)||customElements.define(L.ID,L)},L);f([c({type:String})],m.prototype,"caption");f([c({type:String})],m.prototype,"description");f([c({type:String})],m.prototype,"descriptionIcon");f([c({type:Boolean})],m.prototype,"selected");f([c({type:String})],m.prototype,"icon");f([c({type:String})],m.prototype,"iconBackgroundColor");f([c({type:String})],m.prototype,"iconPlaceholder");f([c({type:Number})],m.prototype,"level");f([c()],m.prototype,"contentMode");f([c({type:Boolean,reflect:!0,attribute:"enable-line-clamp"})],m.prototype,"enableLineClamp");f([c({converter:{fromAttribute:e=>e=="true",toAttribute:e=>e},reflect:!0,attribute:"aria-disabled"})],m.prototype,"disabled");f([c({type:String,attribute:"icon-attr-aria-label"})],m.prototype,"iconAttrAriaLabel");f([c({type:String,reflect:!0})],m.prototype,"role");f([c({type:String,attribute:"caption-attr-title"})],m.prototype,"captionAttrTitle");f([c({type:String,attribute:"description-attr-title"})],m.prototype,"descriptionAttrTitle");f([c({type:String,attribute:"icon-attr-title"})],m.prototype,"iconAttrTitle");var M=m,Kt=(e,t)=>{let i=document.createElement(M.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};M.ensureDefined();var vt=class{getOffsetForIndexAndAlignment(t,i,s,n,o,r){let l=Math.max(0,r*n),a=Math.min(l,t*n),d=Math.max(0,t*n-o+n);switch(i){case"start":return a;case"end":return d;case"center":{let u=Math.round(d+(a-d)/2);return u<Math.ceil(o/2)?0:u>l+Math.floor(o/2)?l:u}case"auto":default:return s>=d&&s<=a?s:s<d?d:a}}debounce(t){let i;return(...s)=>{i&&window.cancelAnimationFrame(i),i=window.requestAnimationFrame(()=>{t(...s),i=null})}}},_e=new vt,bt=class{constructor(t=100,i=5){this.pageSize=t,this.preloadedItemsCount=i,this._finalSizeIsKnown=!1,this._itemCache=[],this._lastRequestedFirstIndex=0,this._lastRequestedLastIndex=0,this._lastLoadedIndex=0,this.handleListDataRequest=s=>{let{startIndex:n,stopIndex:o}=s.detail;this._lastRequestedFirstIndex=n,this._lastRequestedLastIndex=o,this._list.items=this._itemCache.slice(n,o+1),!this.finalSizeIsKnown&&this._lastLoadedIndex<o+this.preloadedItemsCount&&this.requestData()},this.itemCount=t}get currentPage(){return this.items.length==0&&this.finalSizeIsKnown?0:Math.floor((this.items.length-1)/this.pageSize)}get finalSizeIsKnown(){return this._finalSizeIsKnown}set finalSizeIsKnown(t){this._finalSizeIsKnown=t,t&&(this.itemCount=this._itemCache.length),this._list&&(this._list.finalSizeIsKnown=t)}get itemCount(){return this._itemCount}set itemCount(t){this._itemCount=t,this._list&&(this._list.itemCount=t)}get items(){return this._itemCache}set items(t){this._itemCache=t,this.onItemsChange()}addItems(t){this._itemCache=this._itemCache.concat(t),this.onItemsChange()}connectList(t){this._list&&this._list.removeEventListener("data-request",this.handleListDataRequest),this._list=t,t.itemCount=this.itemCount,t.addEventListener("data-request",this.handleListDataRequest),t.finalSizeIsKnown=this._finalSizeIsKnown}onItemsChange(){this._pendingDataRequest=!1,this._lastLoadedIndex=this._itemCache.length-1,this.finalSizeIsKnown?this.itemCount=this._itemCache.length:this._lastLoadedIndex>this.itemCount&&(this.itemCount=this._lastLoadedIndex),this._list&&(this._list.items=this._itemCache.slice(this._lastRequestedFirstIndex,this._lastRequestedLastIndex+1))}requestData(){if(!this._pendingDataRequest)if(this.onDataRequest)this._pendingDataRequest=!0,this.onDataRequest(this.currentPage+1),this._lastLoadedIndex+=this.pageSize-1,this._lastLoadedIndex>this.itemCount&&(this.itemCount=this._lastLoadedIndex);else throw Error("The final size is not yet known and the list would require item data from index "+this._lastRequestedFirstIndex+". to "+this._lastRequestedLastIndex+". which is not possible to load without a configured onDataRequest")}},ge=":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}",$e=Object.defineProperty,ve=Object.getOwnPropertyDescriptor,S=(e,t,i,s)=>{for(var n=s>1?void 0:s?ve(t,i):t,o=e.length-1,r;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&$e(t,i,n),n},Bt=(e=>(e.TriggerOnly="trigger-only",e.Single="single",e.Multi="multi",e))(Bt||{}),be=0,I,y=(I=class extends _{constructor(){super(),this.items=[],this.selectionType="trigger-only",this.id=I.ID+"_"+be++,this.role="listbox",this.itemGenerator=Kt,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.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=_e.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[H`
35
+ ${N(ge)}
36
+ `]}render(){return this.updateItemsRenderData(),x`
38
37
  <div class="container" style="height: ${this.itemCount*this.itemHeight}px">
39
38
  <slot name="items"></slot>
40
39
  </div>
41
- `}updated(i){if(super.updated(i),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 i=Number.parseInt(getComputedStyle(this).maxWidth)-this.offsetWidth;if(i==0)this._reachedMaxWidth=!0,this.enableLineClampOnItemsIfNeeded();else{this._reachedMaxWidth=!1;let t=[...this.querySelectorAll("[item-index]")].map(s=>{if(s instanceof L){s.enableLineClamp=!1;let n=s.missingWidthForTexts;return n>i&&(s.enableLineClamp=!0),n}}),e=Math.max(...t);e>0&&(this.style.width=`${this.offsetWidth+e}px`)}})):this._reachedMaxWidth&&this.enableLineClampOnItemsIfNeeded()}enableLineClampOnItemsIfNeeded(){this.querySelectorAll("[item-index]").forEach(i=>{i instanceof L&&(i.enableLineClamp=i.enableLineClamp||i.missingWidthForTexts>0)})}increaseWidthOnNextRenderIfNeeded(){this._increaseWidthOnNextRenderIfNeeded=!0}updateItems(){let i=[...this.querySelectorAll("[item-index]")],t=new Map,e=document.createDocumentFragment();for(let s of this._itemsRenderData){let n=this.renderItem(s);n.parentElement||e.appendChild(n),t.set(s.dataHash,n);let o=i.indexOf(n);o!==-1&&i.splice(o,1)}this.appendChild(e);for(let s of i)s instanceof L&&(s.enableLineClamp=!1),this.removeChild(s);t.forEach((s,n)=>{this._elementCache.set(n,s)})}renderItem({index:i,top:t,dataHash:e,data:s}){let n;return s?this._elementCache.has(e)?(n=this._elementCache.get(e),this._elementCache.delete(e)):(n=this.itemGenerator(s,i),n.setAttribute("slot","items")):(n=document.createElement("div"),n.setAttribute("placeholder-item",""),n.setAttribute("slot","items")),Object.assign(n.style,{transform:`translateY(${t}px)`,height:`${this.itemHeight}px`}),n.setAttribute("item-index",i.toString()),n.setAttribute("aria-setsize",String(this.finalSizeIsKnown?this.itemCount:-1)),n.setAttribute("aria-posinset",String(i+1)),(!n.id||n.id.startsWith(this.id+"_item_"))&&(n.id=this.id+"_item_"+i),this.itemCount-1==i?n.setAttribute("last",""):n.removeAttribute("last"),this.updateSelectedAttribute(i,n),this.updateFocusedAttribute(i,n),n}updateFocusedAttribute(i,t){this.focusIndex==i&&(this.focusTarget||document.activeElement==this)?(t.setAttribute("focused",""),this.setAttribute("aria-activedescendant",t.id)):t.removeAttribute("focused")}updateSelectedAttribute(i,t){let e=this.selectedIndices.indexOf(i)!==-1;e?t.setAttribute("selected",""):t.removeAttribute("selected"),t.setAttribute("aria-selected",String(e))}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 i=this.normalizeIndex(this._firstVisibleIndex-2),t=this.normalizeIndex(this._lastVisibleIndex+2);this.requestData(i,t);for(let e=i;e<=t;e++){let s=e-i,n=this.items[s],o;n?o=JSON.stringify(n):o=`placeholder-${s}`,this._itemsRenderData.push({index:e,top:this.itemHeight*e,physicalIndex:s,dataHash:o,data:n})}}else this._firstVisibleIndex=0,this._lastVisibleIndex=0}normalizeIndex(i){return Math.max(0,Math.min(i,this.itemCount-1))}get height(){return this.offsetHeight}requestData(i,t){!Number.isNaN(i)&&!Number.isNaN(t)&&this.dispatchEvent(new CustomEvent("data-request",{detail:{startIndex:i,stopIndex:t}}))}handleSelection(i,t){if(i<0||this.itemCount<=i)return;let e=this.getListItem(i);if(e.getAttribute("aria-disabled")=="true"||e.hasAttribute("disabled"))return;let s=!0;if(this.selectionType!=="trigger-only"){let n=this.selectedIndices.indexOf(i);s=n==-1,s?this.selectionType==="single"?this.selectedIndices=[i]:this.selectedIndices.push(i):this.selectedIndices.splice(n,1),this.requestUpdate("selectedIndices")}this.focusIndex=i,this.dispatchSelectionEvent(i,s,t)}dispatchSelectionEvent(i,t,e){this.dispatchEvent(new CustomEvent("selection",{detail:{index:i,selected:t,hasModifier:e}}))}handleClick(i){let t=i.composedPath().find(e=>e.hasAttribute&&e.hasAttribute("item-index"));if(t){let e=parseInt(t.getAttribute("item-index"));if(Number.isInteger(e)){if(i.button==0||i.button==1){let s=i.type=="auxclick"&&i.button==1||i.metaKey||i.ctrlKey;this.handleSelection(e,s)}this.focusIndex=e}}}},x.ID="sd-virtual-list",x.ensureDefined=()=>{L.ensureDefined(),customElements.get(x.ID)||customElements.define(x.ID,x)},x);I([u({type:Number,attribute:"item-height",reflect:!0})],$.prototype,"itemHeight",2);I([u({type:Number})],$.prototype,"itemCount",2);I([u({type:Array,attribute:!1})],$.prototype,"items",2);I([u({type:String,attribute:"selection-type",reflect:!0,noAccessor:!0})],$.prototype,"selectionType",2);I([u({type:String,attribute:!0,reflect:!0})],$.prototype,"id",2);I([u({type:String,reflect:!0})],$.prototype,"role",2);I([u({type:Number,attribute:"focus-index",reflect:!0})],$.prototype,"focusIndex",1);I([u({type:Array,attribute:!1})],$.prototype,"selectedIndices",1);var zt=$;zt.ensureDefined();return Ft(he);})();
40
+ `}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 M){s.enableLineClamp=!1;let n=s.missingWidthForTexts;return n>e&&(s.enableLineClamp=!0),n}}),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 M&&(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 n=this.renderItem(s);n.parentElement||i.appendChild(n),t.set(s.dataHash,n);let o=e.indexOf(n);o!==-1&&e.splice(o,1)}this.appendChild(i);for(let s of e)s instanceof M&&(s.enableLineClamp=!1),this.removeChild(s);t.forEach((s,n)=>{this._elementCache.set(n,s)})}renderItem({index:e,top:t,dataHash:i,data:s}){let n;return s?this._elementCache.has(i)?(n=this._elementCache.get(i),this._elementCache.delete(i)):(n=this.itemGenerator(s,e),n.setAttribute("slot","items")):(n=document.createElement("div"),n.setAttribute("placeholder-item",""),n.setAttribute("slot","items")),Object.assign(n.style,{transform:`translateY(${t}px)`,height:`${this.itemHeight}px`}),n.setAttribute("item-index",e.toString()),n.setAttribute("aria-setsize",String(this.finalSizeIsKnown?this.itemCount:-1)),n.setAttribute("aria-posinset",String(e+1)),(!n.id||n.id.startsWith(this.id+"_item_"))&&(n.id=this.id+"_item_"+e),this.itemCount-1==e?n.setAttribute("last",""):n.removeAttribute("last"),this.updateSelectedAttribute(e,n),this.updateFocusedAttribute(e,n),n}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,n=this.items[s],o;n?o=JSON.stringify(n):o=`placeholder-${s}`,this._itemsRenderData.push({index:i,top:this.itemHeight*i,physicalIndex:s,dataHash:o,data:n})}}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 n=this.selectedIndices.indexOf(e);s=n==-1,s?this.selectionType==="single"?this.selectedIndices=[e]:this.selectedIndices.push(e):this.selectedIndices.splice(n,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}}}},I.ID="sd-virtual-list",I.ensureDefined=()=>{M.ensureDefined(),customElements.get(I.ID)||customElements.define(I.ID,I)},I);S([c({type:Number,attribute:"item-height",reflect:!0})],y.prototype,"itemHeight",2);S([c({type:Number})],y.prototype,"itemCount",2);S([c({type:Array,attribute:!1})],y.prototype,"items",2);S([c({type:String,attribute:"selection-type",reflect:!0,noAccessor:!0})],y.prototype,"selectionType",2);S([c({type:String,attribute:!0,reflect:!0})],y.prototype,"id",2);S([c({type:String,reflect:!0})],y.prototype,"role",2);S([c({type:Number,attribute:"focus-index",reflect:!0})],y.prototype,"focusIndex",1);S([c({type:Array,attribute:!1})],y.prototype,"selectedIndices",1);var Wt=y;Wt.ensureDefined();return Zt(ye);})();
42
41
  /*! Bundled license information:
43
42
 
44
43
  @lit/reactive-element/css-tag.js:
@@ -49,20 +48,12 @@ var window;(window||={})["@cas-smartdesign/virtual-list"]=(()=>{var Q=Object.def
49
48
  *)
50
49
 
51
50
  @lit/reactive-element/reactive-element.js:
52
- (**
53
- * @license
54
- * Copyright 2017 Google LLC
55
- * SPDX-License-Identifier: BSD-3-Clause
56
- *)
57
-
58
51
  lit-html/lit-html.js:
59
- (**
60
- * @license
61
- * Copyright 2017 Google LLC
62
- * SPDX-License-Identifier: BSD-3-Clause
63
- *)
64
-
65
52
  lit-element/lit-element.js:
53
+ @lit/reactive-element/decorators/property.js:
54
+ lit-html/directive.js:
55
+ lit-html/directives/unsafe-html.js:
56
+ lit-html/async-directive.js:
66
57
  (**
67
58
  * @license
68
59
  * Copyright 2017 Google LLC
@@ -76,31 +67,17 @@ lit-html/is-server.js:
76
67
  * SPDX-License-Identifier: BSD-3-Clause
77
68
  *)
78
69
 
79
- @lit/reactive-element/decorators/property.js:
80
- (**
81
- * @license
82
- * Copyright 2017 Google LLC
83
- * SPDX-License-Identifier: BSD-3-Clause
84
- *)
85
-
86
- lit-html/directive.js:
87
- (**
88
- * @license
89
- * Copyright 2017 Google LLC
90
- * SPDX-License-Identifier: BSD-3-Clause
91
- *)
92
-
93
- lit-html/directives/unsafe-html.js:
70
+ lit-html/directives/if-defined.js:
94
71
  (**
95
72
  * @license
96
- * Copyright 2017 Google LLC
73
+ * Copyright 2018 Google LLC
97
74
  * SPDX-License-Identifier: BSD-3-Clause
98
75
  *)
99
76
 
100
- lit-html/directives/if-defined.js:
77
+ lit-html/directive-helpers.js:
101
78
  (**
102
79
  * @license
103
- * Copyright 2018 Google LLC
80
+ * Copyright 2020 Google LLC
104
81
  * SPDX-License-Identifier: BSD-3-Clause
105
82
  *)
106
83
  */