@cas-smartdesign/tree 4.0.5 → 4.1.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,18 +1,18 @@
1
- var window;(window||={})["@cas-smartdesign/tree"]=(()=>{var ge=Object.defineProperty;var ht=Object.getOwnPropertyDescriptor;var ct=Object.getOwnPropertyNames;var ut=Object.prototype.hasOwnProperty;var pt=(t,e)=>{for(var s in e)ge(t,s,{get:e[s],enumerable:!0})},ft=(t,e,s,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of ct(e))!ut.call(t,o)&&o!==s&&ge(t,o,{get:()=>e[o],enumerable:!(i=ht(e,o))||i.enumerable});return t};var gt=t=>ft(ge({},"__esModule",{value:!0}),t);var Xt={};pt(Xt,{CheckboxNode:()=>pe,Node:()=>se,RadioButtonNode:()=>fe,Tree:()=>dt,findNode:()=>Wt,findNodeByPath:()=>rt,findNodeIndex:()=>q,flattenNodes:()=>te,getOffsetForIndexAndAlignment:()=>at,isCheckboxNode:()=>it,isFlattenedNode:()=>$,isNode:()=>Ue,isRadioButtonNode:()=>ot});var ne=window,re=ne.ShadowRoot&&(ne.ShadyCSS===void 0||ne.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ve=Symbol(),Te=new WeakMap,J=class{constructor(e,s,i){if(this._$cssResult$=!0,i!==ve)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=s}get styleSheet(){let e=this.o,s=this.t;if(re&&e===void 0){let i=s!==void 0&&s.length===1;i&&(e=Te.get(s)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Te.set(s,e))}return e}toString(){return this.cssText}},b=t=>new J(typeof t=="string"?t:t+"",void 0,ve),x=(t,...e)=>{let s=t.length===1?t[0]:e.reduce((i,o,n)=>i+(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.")})(o)+t[n+1],t[0]);return new J(s,t,ve)},be=(t,e)=>{re?t.adoptedStyleSheets=e.map(s=>s instanceof CSSStyleSheet?s:s.styleSheet):e.forEach(s=>{let i=document.createElement("style"),o=ne.litNonce;o!==void 0&&i.setAttribute("nonce",o),i.textContent=s.cssText,t.appendChild(i)})},ae=re?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let s="";for(let i of e.cssRules)s+=i.cssText;return b(s)})(t):t;var me,de=window,ze=de.trustedTypes,vt=ze?ze.emptyScript:"",He=de.reactiveElementPolyfillSupport,ye={toAttribute(t,e){switch(e){case Boolean:t=t?vt:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=t!==null;break;case Number:s=t===null?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch{s=null}}return s}},Ve=(t,e)=>e!==t&&(e==e||t==t),xe={attribute:!0,type:String,converter:ye,reflect:!1,hasChanged:Ve},_e="finalized",k=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var s;this.finalize(),((s=this.h)!==null&&s!==void 0?s:this.h=[]).push(e)}static get observedAttributes(){this.finalize();let e=[];return this.elementProperties.forEach((s,i)=>{let o=this._$Ep(i,s);o!==void 0&&(this._$Ev.set(o,i),e.push(o))}),e}static createProperty(e,s=xe){if(s.state&&(s.attribute=!1),this.finalize(),this.elementProperties.set(e,s),!s.noAccessor&&!this.prototype.hasOwnProperty(e)){let i=typeof e=="symbol"?Symbol():"__"+e,o=this.getPropertyDescriptor(e,i,s);o!==void 0&&Object.defineProperty(this.prototype,e,o)}}static getPropertyDescriptor(e,s,i){return{get(){return this[s]},set(o){let n=this[e];this[s]=o,this.requestUpdate(e,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||xe}static finalize(){if(this.hasOwnProperty(_e))return!1;this[_e]=!0;let e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let s=this.properties,i=[...Object.getOwnPropertyNames(s),...Object.getOwnPropertySymbols(s)];for(let o of i)this.createProperty(o,s[o])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){let s=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let o of i)s.unshift(ae(o))}else e!==void 0&&s.push(ae(e));return s}static _$Ep(e,s){let i=s.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(s=>this.enableUpdating=s),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(s=>s(this))}addController(e){var s,i;((s=this._$ES)!==null&&s!==void 0?s:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((i=e.hostConnected)===null||i===void 0||i.call(e))}removeController(e){var s;(s=this._$ES)===null||s===void 0||s.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,s)=>{this.hasOwnProperty(s)&&(this._$Ei.set(s,this[s]),delete this[s])})}createRenderRoot(){var e;let s=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return be(s,this.constructor.elementStyles),s}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(s=>{var i;return(i=s.hostConnected)===null||i===void 0?void 0:i.call(s)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(s=>{var i;return(i=s.hostDisconnected)===null||i===void 0?void 0:i.call(s)})}attributeChangedCallback(e,s,i){this._$AK(e,i)}_$EO(e,s,i=xe){var o;let n=this.constructor._$Ep(e,i);if(n!==void 0&&i.reflect===!0){let r=(((o=i.converter)===null||o===void 0?void 0:o.toAttribute)!==void 0?i.converter:ye).toAttribute(s,i.type);this._$El=e,r==null?this.removeAttribute(n):this.setAttribute(n,r),this._$El=null}}_$AK(e,s){var i;let o=this.constructor,n=o._$Ev.get(e);if(n!==void 0&&this._$El!==n){let r=o.getPropertyOptions(n),l=typeof r.converter=="function"?{fromAttribute:r.converter}:((i=r.converter)===null||i===void 0?void 0:i.fromAttribute)!==void 0?r.converter:ye;this._$El=n,this[n]=l.fromAttribute(s,r.type),this._$El=null}}requestUpdate(e,s,i){let o=!0;e!==void 0&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||Ve)(this[e],s)?(this._$AL.has(e)||this._$AL.set(e,s),i.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,i))):o=!1),!this.isUpdatePending&&o&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(s){Promise.reject(s)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((o,n)=>this[n]=o),this._$Ei=void 0);let s=!1,i=this._$AL;try{s=this.shouldUpdate(i),s?(this.willUpdate(i),(e=this._$ES)===null||e===void 0||e.forEach(o=>{var n;return(n=o.hostUpdate)===null||n===void 0?void 0:n.call(o)}),this.update(i)):this._$Ek()}catch(o){throw s=!1,this._$Ek(),o}s&&this._$AE(i)}willUpdate(e){}_$AE(e){var s;(s=this._$ES)===null||s===void 0||s.forEach(i=>{var o;return(o=i.hostUpdated)===null||o===void 0?void 0:o.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((s,i)=>this._$EO(i,this[i],s)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};k[_e]=!0,k.elementProperties=new Map,k.elementStyles=[],k.shadowRootOptions={mode:"open"},He?.({ReactiveElement:k}),((me=de.reactiveElementVersions)!==null&&me!==void 0?me:de.reactiveElementVersions=[]).push("1.6.3");var Se,le=window,z=le.trustedTypes,Fe=z?z.createPolicy("lit-html",{createHTML:t=>t}):void 0,ke="$lit$",C=`lit$${(Math.random()+"").slice(9)}$`,Ye="?"+C,bt=`<${Ye}>`,L=document,W=()=>L.createComment(""),Y=t=>t===null||typeof t!="object"&&typeof t!="function",Qe=Array.isArray,mt=t=>Qe(t)||typeof t?.[Symbol.iterator]=="function",$e=`[
2
- \f\r]`,G=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,je=/-->/g,qe=/>/g,N=RegExp(`>|${$e}(?:([^\\s"'>=/]+)(${$e}*=${$e}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Ke=/'/g,Je=/"/g,Ze=/^(?:script|style|textarea|title)$/i,Xe=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),c=Xe(1),ns=Xe(2),B=Symbol.for("lit-noChange"),f=Symbol.for("lit-nothing"),Ge=new WeakMap,D=L.createTreeWalker(L,129,null,!1);function et(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Fe!==void 0?Fe.createHTML(e):e}var xt=(t,e)=>{let s=t.length-1,i=[],o,n=e===2?"<svg>":"",r=G;for(let l=0;l<s;l++){let a=t[l],h,u,p=-1,v=0;for(;v<a.length&&(r.lastIndex=v,u=r.exec(a),u!==null);)v=r.lastIndex,r===G?u[1]==="!--"?r=je:u[1]!==void 0?r=qe:u[2]!==void 0?(Ze.test(u[2])&&(o=RegExp("</"+u[2],"g")),r=N):u[3]!==void 0&&(r=N):r===N?u[0]===">"?(r=o??G,p=-1):u[1]===void 0?p=-2:(p=r.lastIndex-u[2].length,h=u[1],r=u[3]===void 0?N:u[3]==='"'?Je:Ke):r===Je||r===Ke?r=N:r===je||r===qe?r=G:(r=N,o=void 0);let _=r===N&&t[l+1].startsWith("/>")?" ":"";n+=r===G?a+bt:p>=0?(i.push(h),a.slice(0,p)+ke+a.slice(p)+C+_):a+C+(p===-2?(i.push(void 0),l):_)}return[et(t,n+(t[s]||"<?>")+(e===2?"</svg>":"")),i]},Q=class t{constructor({strings:e,_$litType$:s},i){let o;this.parts=[];let n=0,r=0,l=e.length-1,a=this.parts,[h,u]=xt(e,s);if(this.el=t.createElement(h,i),D.currentNode=this.el.content,s===2){let p=this.el.content,v=p.firstChild;v.remove(),p.append(...v.childNodes)}for(;(o=D.nextNode())!==null&&a.length<l;){if(o.nodeType===1){if(o.hasAttributes()){let p=[];for(let v of o.getAttributeNames())if(v.endsWith(ke)||v.startsWith(C)){let _=u[r++];if(p.push(v),_!==void 0){let lt=o.getAttribute(_.toLowerCase()+ke).split(C),oe=/([.?@])?(.*)/.exec(_);a.push({type:1,index:n,name:oe[2],strings:lt,ctor:oe[1]==="."?Ce:oe[1]==="?"?Ae:oe[1]==="@"?Ie:V})}else a.push({type:6,index:n})}for(let v of p)o.removeAttribute(v)}if(Ze.test(o.tagName)){let p=o.textContent.split(C),v=p.length-1;if(v>0){o.textContent=z?z.emptyScript:"";for(let _=0;_<v;_++)o.append(p[_],W()),D.nextNode(),a.push({type:2,index:++n});o.append(p[v],W())}}}else if(o.nodeType===8)if(o.data===Ye)a.push({type:2,index:n});else{let p=-1;for(;(p=o.data.indexOf(C,p+1))!==-1;)a.push({type:7,index:n}),p+=C.length-1}n++}}static createElement(e,s){let i=L.createElement("template");return i.innerHTML=e,i}};function H(t,e,s=t,i){var o,n,r,l;if(e===B)return e;let a=i!==void 0?(o=s._$Co)===null||o===void 0?void 0:o[i]:s._$Cl,h=Y(e)?void 0:e._$litDirective$;return a?.constructor!==h&&((n=a?._$AO)===null||n===void 0||n.call(a,!1),h===void 0?a=void 0:(a=new h(t),a._$AT(t,s,i)),i!==void 0?((r=(l=s)._$Co)!==null&&r!==void 0?r:l._$Co=[])[i]=a:s._$Cl=a),a!==void 0&&(e=H(t,a._$AS(t,e.values),a,i)),e}var we=class{constructor(e,s){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=s}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var s;let{el:{content:i},parts:o}=this._$AD,n=((s=e?.creationScope)!==null&&s!==void 0?s:L).importNode(i,!0);D.currentNode=n;let r=D.nextNode(),l=0,a=0,h=o[0];for(;h!==void 0;){if(l===h.index){let u;h.type===2?u=new Z(r,r.nextSibling,this,e):h.type===1?u=new h.ctor(r,h.name,h.strings,this,e):h.type===6&&(u=new Ee(r,this,e)),this._$AV.push(u),h=o[++a]}l!==h?.index&&(r=D.nextNode(),l++)}return D.currentNode=L,n}v(e){let s=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,s),s+=i.strings.length-2):i._$AI(e[s])),s++}},Z=class t{constructor(e,s,i,o){var n;this.type=2,this._$AH=f,this._$AN=void 0,this._$AA=e,this._$AB=s,this._$AM=i,this.options=o,this._$Cp=(n=o?.isConnected)===null||n===void 0||n}get _$AU(){var e,s;return(s=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&s!==void 0?s:this._$Cp}get parentNode(){let e=this._$AA.parentNode,s=this._$AM;return s!==void 0&&e?.nodeType===11&&(e=s.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,s=this){e=H(this,e,s),Y(e)?e===f||e==null||e===""?(this._$AH!==f&&this._$AR(),this._$AH=f):e!==this._$AH&&e!==B&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):mt(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==f&&Y(this._$AH)?this._$AA.nextSibling.data=e:this.$(L.createTextNode(e)),this._$AH=e}g(e){var s;let{values:i,_$litType$:o}=e,n=typeof o=="number"?this._$AC(e):(o.el===void 0&&(o.el=Q.createElement(et(o.h,o.h[0]),this.options)),o);if(((s=this._$AH)===null||s===void 0?void 0:s._$AD)===n)this._$AH.v(i);else{let r=new we(n,this),l=r.u(this.options);r.v(i),this.$(l),this._$AH=r}}_$AC(e){let s=Ge.get(e.strings);return s===void 0&&Ge.set(e.strings,s=new Q(e)),s}T(e){Qe(this._$AH)||(this._$AH=[],this._$AR());let s=this._$AH,i,o=0;for(let n of e)o===s.length?s.push(i=new t(this.k(W()),this.k(W()),this,this.options)):i=s[o],i._$AI(n),o++;o<s.length&&(this._$AR(i&&i._$AB.nextSibling,o),s.length=o)}_$AR(e=this._$AA.nextSibling,s){var i;for((i=this._$AP)===null||i===void 0||i.call(this,!1,!0,s);e&&e!==this._$AB;){let o=e.nextSibling;e.remove(),e=o}}setConnected(e){var s;this._$AM===void 0&&(this._$Cp=e,(s=this._$AP)===null||s===void 0||s.call(this,e))}},V=class{constructor(e,s,i,o,n){this.type=1,this._$AH=f,this._$AN=void 0,this.element=e,this.name=s,this._$AM=o,this.options=n,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=f}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,s=this,i,o){let n=this.strings,r=!1;if(n===void 0)e=H(this,e,s,0),r=!Y(e)||e!==this._$AH&&e!==B,r&&(this._$AH=e);else{let l=e,a,h;for(e=n[0],a=0;a<n.length-1;a++)h=H(this,l[i+a],s,a),h===B&&(h=this._$AH[a]),r||(r=!Y(h)||h!==this._$AH[a]),h===f?e=f:e!==f&&(e+=(h??"")+n[a+1]),this._$AH[a]=h}r&&!o&&this.j(e)}j(e){e===f?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Ce=class extends V{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===f?void 0:e}},yt=z?z.emptyScript:"",Ae=class extends V{constructor(){super(...arguments),this.type=4}j(e){e&&e!==f?this.element.setAttribute(this.name,yt):this.element.removeAttribute(this.name)}},Ie=class extends V{constructor(e,s,i,o,n){super(e,s,i,o,n),this.type=5}_$AI(e,s=this){var i;if((e=(i=H(this,e,s,0))!==null&&i!==void 0?i:f)===B)return;let o=this._$AH,n=e===f&&o!==f||e.capture!==o.capture||e.once!==o.once||e.passive!==o.passive,r=e!==f&&(o===f||n);n&&this.element.removeEventListener(this.name,this,o),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var s,i;typeof this._$AH=="function"?this._$AH.call((i=(s=this.options)===null||s===void 0?void 0:s.host)!==null&&i!==void 0?i:this.element,e):this._$AH.handleEvent(e)}},Ee=class{constructor(e,s,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=s,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){H(this,e)}};var We=le.litHtmlPolyfillSupport;We?.(Q,Z),((Se=le.litHtmlVersions)!==null&&Se!==void 0?Se:le.litHtmlVersions=[]).push("2.8.0");var he=(t,e,s)=>{var i,o;let n=(i=s?.renderBefore)!==null&&i!==void 0?i:e,r=n._$litPart$;if(r===void 0){let l=(o=s?.renderBefore)!==null&&o!==void 0?o:null;n._$litPart$=r=new Z(e.insertBefore(W(),l),l,void 0,s??{})}return r._$AI(t),r};var Ne,De;var g=class extends k{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,s;let i=super.createRenderRoot();return(e=(s=this.renderOptions).renderBefore)!==null&&e!==void 0||(s.renderBefore=i.firstChild),i}update(e){let s=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=he(s,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return B}};g.finalized=!0,g._$litElement$=!0,(Ne=globalThis.litElementHydrateSupport)===null||Ne===void 0||Ne.call(globalThis,{LitElement:g});var tt=globalThis.litElementPolyfillSupport;tt?.({LitElement:g});((De=globalThis.litElementVersions)!==null&&De!==void 0?De:globalThis.litElementVersions=[]).push("3.3.3");var _t=(t,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(s){s.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(s){s.createProperty(e.key,t)}},St=(t,e,s)=>{e.constructor.createProperty(s,t)};function d(t){return(e,s)=>s!==void 0?St(t,e,s):_t(t,e)}var ce=t=>t??f;var $t=":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}",kt="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",wt="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",Ct="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",At=Object.defineProperty,It=Object.getOwnPropertyDescriptor,Be=(t,e,s,i)=>{for(var o=i>1?void 0:i?It(e,s):e,n=t.length-1,r;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&At(e,s,o),o},F,X=(F=class extends g{static parseLevel(t){if(t){let e=Object.keys(P).find(s=>s.toLowerCase()===t.toLowerCase());return e&&P[e]}}static get styles(){return[x`
4
- ${b($t)}
5
- `]}render(){return c`${this.iconToUse&&c`<img class="icon" src="${this.iconToUse}">`}${this.message}`}get iconToUse(){return this.icon||this._defaultIconPath}shouldUpdate(t){return t.has("level")&&(this._defaultIconPath=this.iconForLevel,!this.icon)?!0:super.shouldUpdate(t)}get iconForLevel(){switch(F.parseLevel(this.level)){case"warn":return Ct;case"suggest":return wt;case"error":return kt;default:return null}}},F.ID="sd-field-validation-message",F.levelConverter={fromAttribute(t){return F.parseLevel(t)},toAttribute(t){return t&&t.toLowerCase()}},F);Be([d({type:String,attribute:!0})],X.prototype,"message",2);Be([d({type:String,attribute:!0})],X.prototype,"icon",2);Be([d({converter:X.levelConverter,reflect:!0})],X.prototype,"level",2);var Le=X,P=(t=>(t.Warn="warn",t.Suggest="suggest",t.Error="error",t))(P||{});customElements.get(Le.ID)||customElements.define(Le.ID,Le);var Et=`:host{display:block}:host,.label,.checkbox{outline:none}.checkbox-container{display:flex;flex-direction:row;align-items:flex-start}.checkbox{appearance:none;-moz-appearance:none;-webkit-appearance:none;display:block;margin:0;width:20px;height:20px;border:2px solid #767676;cursor:pointer;background-color:#fff}:host(:not([disabled]):focus) .highlight,:host(:not([disabled])[focused]) .highlight{background-color:#1467ba4d;border-radius:4px}:host(:not([disabled]):focus) .highlight .checkbox,:host(:not([disabled])[focused]) .highlight .checkbox{border-color:#1467ba}:host([checked]) .checkbox{background:#1467ba url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='15'%20height='15'%20viewBox='0%200%2020%2020'%3e%3cpath%20d='M15.9%204.6L17.4%206l-9.5%209.5-5.2-5.2%201.4-1.4%203.8%203.8%208-8.1z'%20fill='%23fff'/%3e%3c/svg%3e") no-repeat center center;border-color:#1467ba}.checkbox.indeterminate{background:#1467ba url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%3e%3cpath%20fill='%23fff'%20d='M8%2014h16v4H8z'/%3e%3c/svg%3e") no-repeat center center;background-size:20px;border-color:#1467ba}.highlight{border:4px solid transparent;margin-right:6px}:host([disabled]) .checkbox-container{opacity:.6;cursor:default;filter:grayscale(100%);pointer-events:none}.validation-message{margin-left:4px}.label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;margin-top:4px;line-height:20px}:host([oneline]) .label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}`,Nt=Object.defineProperty,Dt=Object.getOwnPropertyDescriptor,w=(t,e,s,i)=>{for(var o=i>1?void 0:i?Dt(e,s):e,n=t.length-1,r;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Nt(e,s,o),o},Lt="indeterminate",Pe="delegatesFocus"in window.ShadowRoot.prototype,A,S=(A=class extends g{constructor(){super(...arguments),this._checked=!1,this._indeterminate=!1}get checked(){return this._checked}set checked(t){let e=this._checked;this._checked=t,this._checked&&(this.indeterminate=!1),this.requestUpdate("checked",e)}get indeterminate(){return this._indeterminate}set indeterminate(t){let e=this._indeterminate;this._indeterminate=t,this._indeterminate&&(this.checked=!1),this.requestUpdate("indeterminate",e)}firstUpdated(t){super.firstUpdated(t),Pe||(this.checkboxElement.onfocus=()=>this.setAttribute("focused",""),this.checkboxElement.onblur=()=>this.removeAttribute("focused"),this.addEventListener("focus",e=>{e.target===this&&this.checkboxElement.focus()}))}focus(){this.checkboxElement?this.checkboxElement.focus():super.focus()}attributeChangedCallback(t,e,s){super.attributeChangedCallback(t,e,s),!Pe&&t==="tabindex"&&e!==s&&s==="0"&&this.removeAttribute("tabindex")}render(){return c`
1
+ var window;(window||={})["@cas-smartdesign/tree"]=(()=>{var mt=Object.defineProperty;var ie=Object.getOwnPropertyDescriptor;var oe=Object.getOwnPropertyNames;var ne=Object.prototype.hasOwnProperty;var re=(e,t)=>{for(var s in t)mt(e,s,{get:t[s],enumerable:!0})},ae=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of oe(t))!ne.call(e,o)&&o!==s&&mt(e,o,{get:()=>t[o],enumerable:!(i=ie(t,o))||i.enumerable});return e};var de=e=>ae(mt({},"__esModule",{value:!0}),e);var Ge={};re(Ge,{CheckboxNode:()=>ft,Node:()=>it,RadioButtonNode:()=>gt,Tree:()=>se,findNode:()=>je,findNodeByPath:()=>te,findNodeIndex:()=>q,flattenNodes:()=>st,getOffsetForIndexAndAlignment:()=>ee,isCheckboxNode:()=>Zt,isFlattenedNode:()=>_,isNode:()=>Bt,isRadioButtonNode:()=>Qt});var rt=globalThis,at=rt.ShadowRoot&&(rt.ShadyCSS===void 0||rt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,bt=Symbol(),Ot=new WeakMap,K=class{constructor(t,s,i){if(this._$cssResult$=!0,i!==bt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=s}get styleSheet(){let t=this.o,s=this.t;if(at&&t===void 0){let i=s!==void 0&&s.length===1;i&&(t=Ot.get(s)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Ot.set(s,t))}return t}toString(){return this.cssText}},m=e=>new K(typeof e=="string"?e:e+"",void 0,bt),x=(e,...t)=>{let s=e.length===1?e[0]:t.reduce(((i,o,n)=>i+(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.")})(o)+e[n+1]),e[0]);return new K(s,e,bt)},Ut=(e,t)=>{if(at)e.adoptedStyleSheets=t.map((s=>s instanceof CSSStyleSheet?s:s.styleSheet));else for(let s of t){let i=document.createElement("style"),o=rt.litNonce;o!==void 0&&i.setAttribute("nonce",o),i.textContent=s.cssText,e.appendChild(i)}},xt=at?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let s="";for(let i of t.cssRules)s+=i.cssText;return m(s)})(e):e;var{is:he,defineProperty:le,getOwnPropertyDescriptor:ce,getOwnPropertyNames:ue,getOwnPropertySymbols:pe,getPrototypeOf:fe}=Object,dt=globalThis,Mt=dt.trustedTypes,ge=Mt?Mt.emptyScript:"",me=dt.reactiveElementPolyfillSupport,J=(e,t)=>e,W={toAttribute(e,t){switch(t){case Boolean:e=e?ge:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let s=e;switch(t){case Boolean:s=e!==null;break;case Number:s=e===null?null:Number(e);break;case Object:case Array:try{s=JSON.parse(e)}catch{s=null}}return s}},ht=(e,t)=>!he(e,t),Tt={attribute:!0,type:String,converter:W,reflect:!1,useDefault:!1,hasChanged:ht};Symbol.metadata??=Symbol("metadata"),dt.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,s=Tt){if(s.state&&(s.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=!0),this.elementProperties.set(t,s),!s.noAccessor){let i=Symbol(),o=this.getPropertyDescriptor(t,i,s);o!==void 0&&le(this.prototype,t,o)}}static getPropertyDescriptor(t,s,i){let{get:o,set:n}=ce(this.prototype,t)??{get(){return this[s]},set(r){this[s]=r}};return{get:o,set(r){let h=o?.call(this);n?.call(this,r),this.requestUpdate(t,h,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Tt}static _$Ei(){if(this.hasOwnProperty(J("elementProperties")))return;let t=fe(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(J("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(J("properties"))){let s=this.properties,i=[...ue(s),...pe(s)];for(let o of i)this.createProperty(o,s[o])}let t=this[Symbol.metadata];if(t!==null){let s=litPropertyMetadata.get(t);if(s!==void 0)for(let[i,o]of s)this.elementProperties.set(i,o)}this._$Eh=new Map;for(let[s,i]of this.elementProperties){let o=this._$Eu(s,i);o!==void 0&&this._$Eh.set(o,s)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let s=[];if(Array.isArray(t)){let i=new Set(t.flat(1/0).reverse());for(let o of i)s.unshift(xt(o))}else t!==void 0&&s.push(xt(t));return s}static _$Eu(t,s){let i=s.attribute;return i===!1?void 0:typeof i=="string"?i: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,s=this.constructor.elementProperties;for(let i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ut(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,s,i){this._$AK(t,i)}_$ET(t,s){let i=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,i);if(o!==void 0&&i.reflect===!0){let n=(i.converter?.toAttribute!==void 0?i.converter:W).toAttribute(s,i.type);this._$Em=t,n==null?this.removeAttribute(o):this.setAttribute(o,n),this._$Em=null}}_$AK(t,s){let i=this.constructor,o=i._$Eh.get(t);if(o!==void 0&&this._$Em!==o){let n=i.getPropertyOptions(o),r=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:W;this._$Em=o;let h=r.fromAttribute(s,n.type);this[o]=h??this._$Ej?.get(o)??h,this._$Em=null}}requestUpdate(t,s,i){if(t!==void 0){let o=this.constructor,n=this[t];if(i??=o.getPropertyOptions(t),!((i.hasChanged??ht)(n,s)||i.useDefault&&i.reflect&&n===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,i))))return;this.C(t,s,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,s,{useDefault:i,reflect:o,wrapped:n},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??s??this[t]),n!==!0||r!==void 0)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),o===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(s){Promise.reject(s)}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,n]of this._$Ep)this[o]=n;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[o,n]of i){let{wrapped:r}=n,h=this[o];r!==!0||this._$AL.has(o)||h===void 0||this.C(o,void 0,n,h)}}let t=!1,s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((i=>i.hostUpdate?.())),this.update(s)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}t&&this._$AE(s)}willUpdate(t){}_$AE(t){this._$EO?.forEach((s=>s.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((s=>this._$ET(s,this[s]))),this._$EM()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[J("elementProperties")]=new Map,$[J("finalized")]=new Map,me?.({ReactiveElement:$}),(dt.reactiveElementVersions??=[]).push("2.1.1");var wt=globalThis,lt=wt.trustedTypes,zt=lt?lt.createPolicy("lit-html",{createHTML:e=>e}):void 0,Kt="$lit$",C=`lit$${Math.random().toFixed(9).slice(2)}$`,Jt="?"+C,be=`<${Jt}>`,P=document,Y=()=>P.createComment(""),Z=e=>e===null||typeof e!="object"&&typeof e!="function",Ct=Array.isArray,xe=e=>Ct(e)||typeof e?.[Symbol.iterator]=="function",yt=`[
2
+ \f\r]`,G=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ht=/-->/g,Ft=/>/g,N=RegExp(`>|${yt}(?:([^\\s"'>=/]+)(${yt}*=${yt}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Vt=/'/g,qt=/"/g,Wt=/^(?:script|style|textarea|title)$/i,At=e=>(t,...s)=>({_$litType$:e,strings:t,values:s}),c=At(1),es=At(2),ss=At(3),L=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),jt=new WeakMap,D=P.createTreeWalker(P,129);function Gt(e,t){if(!Ct(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return zt!==void 0?zt.createHTML(t):t}var ye=(e,t)=>{let s=e.length-1,i=[],o,n=t===2?"<svg>":t===3?"<math>":"",r=G;for(let h=0;h<s;h++){let d=e[h],u,g,l=-1,S=0;for(;S<d.length&&(r.lastIndex=S,g=r.exec(d),g!==null);)S=r.lastIndex,r===G?g[1]==="!--"?r=Ht:g[1]!==void 0?r=Ft:g[2]!==void 0?(Wt.test(g[2])&&(o=RegExp("</"+g[2],"g")),r=N):g[3]!==void 0&&(r=N):r===N?g[0]===">"?(r=o??G,l=-1):g[1]===void 0?l=-2:(l=r.lastIndex-g[2].length,u=g[1],r=g[3]===void 0?N:g[3]==='"'?qt:Vt):r===qt||r===Vt?r=N:r===Ht||r===Ft?r=G:(r=N,o=void 0);let w=r===N&&e[h+1].startsWith("/>")?" ":"";n+=r===G?d+be:l>=0?(i.push(u),d.slice(0,l)+Kt+d.slice(l)+C+w):d+C+(l===-2?h:w)}return[Gt(e,n+(e[s]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]},Q=class e{constructor({strings:t,_$litType$:s},i){let o;this.parts=[];let n=0,r=0,h=t.length-1,d=this.parts,[u,g]=ye(t,s);if(this.el=e.createElement(u,i),D.currentNode=this.el.content,s===2||s===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(o=D.nextNode())!==null&&d.length<h;){if(o.nodeType===1){if(o.hasAttributes())for(let l of o.getAttributeNames())if(l.endsWith(Kt)){let S=g[r++],w=o.getAttribute(l).split(C),nt=/([.?@])?(.*)/.exec(S);d.push({type:1,index:n,name:nt[2],strings:w,ctor:nt[1]==="."?_t:nt[1]==="?"?St:nt[1]==="@"?$t:H}),o.removeAttribute(l)}else l.startsWith(C)&&(d.push({type:6,index:n}),o.removeAttribute(l));if(Wt.test(o.tagName)){let l=o.textContent.split(C),S=l.length-1;if(S>0){o.textContent=lt?lt.emptyScript:"";for(let w=0;w<S;w++)o.append(l[w],Y()),D.nextNode(),d.push({type:2,index:++n});o.append(l[S],Y())}}}else if(o.nodeType===8)if(o.data===Jt)d.push({type:2,index:n});else{let l=-1;for(;(l=o.data.indexOf(C,l+1))!==-1;)d.push({type:7,index:n}),l+=C.length-1}n++}}static createElement(t,s){let i=P.createElement("template");return i.innerHTML=t,i}};function z(e,t,s=e,i){if(t===L)return t;let o=i!==void 0?s._$Co?.[i]:s._$Cl,n=Z(t)?void 0:t._$litDirective$;return o?.constructor!==n&&(o?._$AO?.(!1),n===void 0?o=void 0:(o=new n(e),o._$AT(e,s,i)),i!==void 0?(s._$Co??=[])[i]=o:s._$Cl=o),o!==void 0&&(t=z(e,o._$AS(e,t.values),o,i)),t}var vt=class{constructor(t,s){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=s}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:s},parts:i}=this._$AD,o=(t?.creationScope??P).importNode(s,!0);D.currentNode=o;let n=D.nextNode(),r=0,h=0,d=i[0];for(;d!==void 0;){if(r===d.index){let u;d.type===2?u=new X(n,n.nextSibling,this,t):d.type===1?u=new d.ctor(n,d.name,d.strings,this,t):d.type===6&&(u=new kt(n,this,t)),this._$AV.push(u),d=i[++h]}r!==d?.index&&(n=D.nextNode(),r++)}return D.currentNode=P,o}p(t){let s=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,s),s+=i.strings.length-2):i._$AI(t[s])),s++}},X=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,s,i,o){this.type=2,this._$AH=p,this._$AN=void 0,this._$AA=t,this._$AB=s,this._$AM=i,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,s=this._$AM;return s!==void 0&&t?.nodeType===11&&(t=s.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,s=this){t=z(this,t,s),Z(t)?t===p||t==null||t===""?(this._$AH!==p&&this._$AR(),this._$AH=p):t!==this._$AH&&t!==L&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):xe(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!==p&&Z(this._$AH)?this._$AA.nextSibling.data=t:this.T(P.createTextNode(t)),this._$AH=t}$(t){let{values:s,_$litType$:i}=t,o=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=Q.createElement(Gt(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===o)this._$AH.p(s);else{let n=new vt(o,this),r=n.u(this.options);n.p(s),this.T(r),this._$AH=n}}_$AC(t){let s=jt.get(t.strings);return s===void 0&&jt.set(t.strings,s=new Q(t)),s}k(t){Ct(this._$AH)||(this._$AH=[],this._$AR());let s=this._$AH,i,o=0;for(let n of t)o===s.length?s.push(i=new e(this.O(Y()),this.O(Y()),this,this.options)):i=s[o],i._$AI(n),o++;o<s.length&&(this._$AR(i&&i._$AB.nextSibling,o),s.length=o)}_$AR(t=this._$AA.nextSibling,s){for(this._$AP?.(!1,!0,s);t!==this._$AB;){let i=t.nextSibling;t.remove(),t=i}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},H=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,s,i,o,n){this.type=1,this._$AH=p,this._$AN=void 0,this.element=t,this.name=s,this._$AM=o,this.options=n,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=p}_$AI(t,s=this,i,o){let n=this.strings,r=!1;if(n===void 0)t=z(this,t,s,0),r=!Z(t)||t!==this._$AH&&t!==L,r&&(this._$AH=t);else{let h=t,d,u;for(t=n[0],d=0;d<n.length-1;d++)u=z(this,h[i+d],s,d),u===L&&(u=this._$AH[d]),r||=!Z(u)||u!==this._$AH[d],u===p?t=p:t!==p&&(t+=(u??"")+n[d+1]),this._$AH[d]=u}r&&!o&&this.j(t)}j(t){t===p?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},_t=class extends H{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===p?void 0:t}},St=class extends H{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==p)}},$t=class extends H{constructor(t,s,i,o,n){super(t,s,i,o,n),this.type=5}_$AI(t,s=this){if((t=z(this,t,s,0)??p)===L)return;let i=this._$AH,o=t===p&&i!==p||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,n=t!==p&&(i===p||o);o&&this.element.removeEventListener(this.name,this,i),n&&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)}},kt=class{constructor(t,s,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=s,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){z(this,t)}};var ve=wt.litHtmlPolyfillSupport;ve?.(Q,X),(wt.litHtmlVersions??=[]).push("3.3.1");var ct=(e,t,s)=>{let i=s?.renderBefore??t,o=i._$litPart$;if(o===void 0){let n=s?.renderBefore??null;i._$litPart$=o=new X(t.insertBefore(Y(),n),n,void 0,s??{})}return o._$AI(e),o};var It=globalThis,f=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 s=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=ct(s,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return L}};f._$litElement$=!0,f.finalized=!0,It.litElementHydrateSupport?.({LitElement:f});var _e=It.litElementPolyfillSupport;_e?.({LitElement:f});(It.litElementVersions??=[]).push("4.2.1");var Se={attribute:!0,type:String,converter:W,reflect:!1,hasChanged:ht},$e=(e=Se,t,s)=>{let{kind:i,metadata:o}=s,n=globalThis.litPropertyMetadata.get(o);if(n===void 0&&globalThis.litPropertyMetadata.set(o,n=new Map),i==="setter"&&((e=Object.create(e)).wrapped=!0),n.set(s.name,e),i==="accessor"){let{name:r}=s;return{set(h){let d=t.get.call(this);t.set.call(this,h),this.requestUpdate(r,d,e)},init(h){return h!==void 0&&this.C(r,void 0,e,h),h}}}if(i==="setter"){let{name:r}=s;return function(h){let d=this[r];t.call(this,h),this.requestUpdate(r,d,e)}}throw Error("Unsupported decorator location: "+i)};function a(e){return(t,s)=>typeof s=="object"?$e(e,t,s):((i,o,n)=>{let r=o.hasOwnProperty(n);return o.constructor.createProperty(n,i),r?Object.getOwnPropertyDescriptor(o,n):void 0})(e,t,s)}var ut=e=>e??p;var ke=":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}",we="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",Ce="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",Ae="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",Ie=Object.defineProperty,Nt=(e,t,s,i)=>{for(var o=void 0,n=e.length-1,r;n>=0;n--)(r=e[n])&&(o=r(t,s,o)||o);return o&&Ie(t,s,o),o},F,tt=(F=class extends f{static parseLevel(e){if(e){let t=Object.keys(B).find(s=>s.toLowerCase()===e.toLowerCase());return t&&B[t]}}static get styles(){return[x`
4
+ ${m(ke)}
5
+ `]}render(){return c`${this.iconToUse&&c`<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(F.parseLevel(this.level)){case"warn":return Ae;case"suggest":return Ce;case"error":return we;default:return null}}},F.ID="sd-field-validation-message",F.levelConverter={fromAttribute(e){return F.parseLevel(e)},toAttribute(e){return e&&e.toLowerCase()}},F);Nt([a({type:String,attribute:!0})],tt.prototype,"message");Nt([a({type:String,attribute:!0})],tt.prototype,"icon");Nt([a({converter:tt.levelConverter,reflect:!0})],tt.prototype,"level");var Et=tt,B=(e=>(e.Warn="warn",e.Suggest="suggest",e.Error="error",e))(B||{});customElements.get(Et.ID)||customElements.define(Et.ID,Et);var Ee=`:host{display:block}:host,.label,.checkbox{outline:none}.checkbox-container{display:flex;flex-direction:row;align-items:flex-start}.checkbox{appearance:none;-moz-appearance:none;-webkit-appearance:none;display:block;margin:0;width:20px;height:20px;border:2px solid #767676;cursor:pointer;background-color:#fff}:host(:not([disabled]):focus) .highlight,:host(:not([disabled])[focused]) .highlight{background-color:#1467ba4d;border-radius:4px}:host(:not([disabled]):focus) .highlight .checkbox,:host(:not([disabled])[focused]) .highlight .checkbox{border-color:#1467ba}:host([checked]) .checkbox{background:#1467ba url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='15'%20height='15'%20viewBox='0%200%2020%2020'%3e%3cpath%20d='M15.9%204.6L17.4%206l-9.5%209.5-5.2-5.2%201.4-1.4%203.8%203.8%208-8.1z'%20fill='%23fff'/%3e%3c/svg%3e") no-repeat center center;border-color:#1467ba}.checkbox.indeterminate{background:#1467ba url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%3e%3cpath%20fill='%23fff'%20d='M8%2014h16v4H8z'/%3e%3c/svg%3e") no-repeat center center;background-size:20px;border-color:#1467ba}.highlight{border:4px solid transparent;margin-right:6px}:host([disabled]) .checkbox-container{opacity:.6;cursor:default;filter:grayscale(100%);pointer-events:none}.validation-message{margin-left:4px}.label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;margin-top:4px;line-height:20px}:host([oneline]) .label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}`,Ne=Object.defineProperty,De=Object.getOwnPropertyDescriptor,k=(e,t,s,i)=>{for(var o=i>1?void 0:i?De(t,s):t,n=e.length-1,r;n>=0;n--)(r=e[n])&&(o=(i?r(t,s,o):r(o))||o);return i&&o&&Ne(t,s,o),o},Pe="indeterminate",Dt="delegatesFocus"in window.ShadowRoot.prototype,A,v=(A=class extends f{constructor(){super(...arguments),this._checked=!1,this._indeterminate=!1}get checked(){return this._checked}set checked(e){let t=this._checked;this._checked=e,this._checked&&(this.indeterminate=!1),this.requestUpdate("checked",t)}get indeterminate(){return this._indeterminate}set indeterminate(e){let t=this._indeterminate;this._indeterminate=e,this._indeterminate&&(this.checked=!1),this.requestUpdate("indeterminate",t)}firstUpdated(e){super.firstUpdated(e),Dt||(this.checkboxElement.onfocus=()=>this.setAttribute("focused",""),this.checkboxElement.onblur=()=>this.removeAttribute("focused"),this.addEventListener("focus",t=>{t.target===this&&this.checkboxElement.focus()}))}focus(){this.checkboxElement?this.checkboxElement.focus():super.focus()}attributeChangedCallback(e,t,s){super.attributeChangedCallback(e,t,s),!Dt&&e==="tabindex"&&t!==s&&s==="0"&&this.removeAttribute("tabindex")}render(){return c`
6
6
  <div class="checkbox-container">
7
7
  <div class="highlight">
8
8
  <input
9
9
  type="checkbox"
10
10
  id="input"
11
11
  ?disabled=${this.disabled}
12
- tabindex=${ce(this.tabIndex==null?void 0:this.tabIndex)}
12
+ tabindex=${ut(this.tabIndex==null?void 0:this.tabIndex)}
13
13
  .checked=${this.checked}
14
14
  .indeterminate=${this.indeterminate}
15
- class="checkbox${this.indeterminate?" "+Lt:""}"
15
+ class="checkbox${this.indeterminate?" "+Pe:""}"
16
16
  @change="${this.onInputValueChange}"
17
17
  />
18
18
  </div>
@@ -27,10 +27,10 @@ var window;(window||={})["@cas-smartdesign/tree"]=(()=>{var ge=Object.defineProp
27
27
  >
28
28
  </sd-field-validation-message>
29
29
  `}
30
- `}onInputValueChange(t){t.preventDefault(),t.stopPropagation(),this.checked=t.target.checked,this.fireValueChange()}fireValueChange(){this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this.checked}}))}get checkboxElement(){return this.shadowRoot.querySelector(".checkbox")}static get styles(){return[x`
31
- ${b(Et)}
32
- `]}},A.ID="sd-checkbox",A.ensureDefined=()=>{customElements.get(A.ID)||customElements.define(A.ID,A)},A.shadowRootOptions={...g.shadowRootOptions,delegatesFocus:Pe},A);w([d({type:Boolean,reflect:!0})],S.prototype,"disabled",2);w([d({type:String,reflect:!0})],S.prototype,"label",2);w([d({type:String})],S.prototype,"validationMessage",2);w([d({type:String})],S.prototype,"validationIconSrc",2);w([d({type:P,reflect:!0})],S.prototype,"validationLevel",2);w([d({type:Number})],S.prototype,"tabIndex",2);w([d({type:Boolean,reflect:!0})],S.prototype,"oneLine",2);w([d({type:Boolean,reflect:!0})],S.prototype,"checked",1);w([d({type:Boolean,reflect:!1,attribute:!1})],S.prototype,"indeterminate",1);var Re=S;Re.ensureDefined();var Bt=":host{display:block}:host,.label,.checkbox{outline:none}:host([disabled]){pointer-events:none}:host([disabled]) .root{opacity:.6;cursor:default;filter:grayscale(100%)}:host(:not([disabled])[focused]) .highlight{display:block!important}:host([checked]) circle.inner{display:block!important}:host([checked]) circle.outer{stroke:var(--sd-radio-button-checked-color, #1467ba)!important}:host([oneline]) .label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.root{display:inline-flex;align-items:center;vertical-align:middle;width:100%;padding-top:6px;padding-bottom:6px}.root .radio-button-container{position:relative;display:inline-block;width:28px;height:28px;box-sizing:border-box;cursor:pointer;margin-right:5px;flex-shrink:0}.root .radio-button-container input{position:absolute;top:0;left:0;opacity:0}.root .radio-button-container circle.highlight{stroke:var(--sd-radio-button-highlight-color, rgba(20, 103, 186, .3))}.root .radio-button-container circle.inner{fill:var(--sd-radio-button-checked-color, #1467ba)}.root .radio-button-container circle.outer{stroke:var(--sd-radio-button-unchecked-color, #767676)}.root .label{font-family:Segoe UI,Lucida Sans,Arial,sans-serif;text-overflow:ellipsis;overflow-x:hidden;-webkit-user-select:none;user-select:none;cursor:pointer;padding-top:2px;padding-bottom:2px}",Pt=Object.defineProperty,Rt=Object.getOwnPropertyDescriptor,ue=(t,e,s,i)=>{for(var o=i>1?void 0:i?Rt(e,s):e,n=t.length-1,r;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Pt(e,s,o),o},Ot=0,I,ee=(I=class extends g{constructor(){super(),this.checked=!1,this.value="",this.disabled=!1,this.label="",this.handleClick=t=>{t.preventDefault()},this.a11yID=I.ID+"_"+Ot++}static get styles(){return[x`
33
- ${b(Bt)}
30
+ `}onInputValueChange(e){e.preventDefault(),e.stopPropagation(),this.checked=e.target.checked,this.fireValueChange()}fireValueChange(){this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this.checked}}))}get checkboxElement(){return this.shadowRoot.querySelector(".checkbox")}static get styles(){return[x`
31
+ ${m(Ee)}
32
+ `]}},A.ID="sd-checkbox",A.ensureDefined=()=>{customElements.get(A.ID)||customElements.define(A.ID,A)},A.shadowRootOptions={...f.shadowRootOptions,delegatesFocus:Dt},A);k([a({type:Boolean,reflect:!0})],v.prototype,"disabled",2);k([a({type:String,reflect:!0})],v.prototype,"label",2);k([a({type:String})],v.prototype,"validationMessage",2);k([a({type:String})],v.prototype,"validationIconSrc",2);k([a({type:B,reflect:!0})],v.prototype,"validationLevel",2);k([a({type:Number})],v.prototype,"tabIndex",2);k([a({type:Boolean,reflect:!0})],v.prototype,"oneLine",2);k([a({type:Boolean,reflect:!0})],v.prototype,"checked",1);k([a({type:Boolean,reflect:!1,attribute:!1})],v.prototype,"indeterminate",1);var Pt=v;Pt.ensureDefined();var Le=":host{display:block}:host,.label,.checkbox{outline:none}:host([disabled]){pointer-events:none}:host([disabled]) .root{opacity:.6;cursor:default;filter:grayscale(100%)}:host(:not([disabled])[focused]) .highlight{display:block!important}:host([checked]) circle.inner{display:block!important}:host([checked]) circle.outer{stroke:var(--sd-radio-button-checked-color, #1467ba)!important}:host([oneline]) .label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.root{display:inline-flex;align-items:center;vertical-align:middle;width:100%;padding-top:6px;padding-bottom:6px}.root .radio-button-container{position:relative;display:inline-block;width:28px;height:28px;box-sizing:border-box;cursor:pointer;margin-right:5px;flex-shrink:0}.root .radio-button-container input{position:absolute;top:0;left:0;opacity:0}.root .radio-button-container circle.highlight{stroke:var(--sd-radio-button-highlight-color, rgba(20, 103, 186, .3))}.root .radio-button-container circle.inner{fill:var(--sd-radio-button-checked-color, #1467ba)}.root .radio-button-container circle.outer{stroke:var(--sd-radio-button-unchecked-color, #767676)}.root .label{font-family:Segoe UI,Lucida Sans,Arial,sans-serif;text-overflow:ellipsis;overflow-x:hidden;-webkit-user-select:none;user-select:none;cursor:pointer;padding-top:2px;padding-bottom:2px}",Be=Object.defineProperty,pt=(e,t,s,i)=>{for(var o=void 0,n=e.length-1,r;n>=0;n--)(r=e[n])&&(o=r(t,s,o)||o);return o&&Be(t,s,o),o},Re=0,I,et=(I=class extends f{constructor(){super(),this.checked=!1,this.value="",this.disabled=!1,this.label="",this.handleClick=e=>{e.preventDefault()},this.a11yID=I.ID+"_"+Re++}static get styles(){return[x`
33
+ ${m(Le)}
34
34
  `]}render(){return c`
35
35
  <div class="root">
36
36
  <div class="radio-button-container">
@@ -56,12 +56,12 @@ var window;(window||={})["@cas-smartdesign/tree"]=(()=>{var ge=Object.defineProp
56
56
  </div>
57
57
  <label class="label" for="${this.a11yID}" @click="${this.handleClick}">${this.label}</label>
58
58
  </div>
59
- `}},I.ID="sd-radio-button",I.ensureDefined=()=>{customElements.get(I.ID)||customElements.define(I.ID,I)},I);ue([d({type:Boolean,reflect:!0,attribute:!0})],ee.prototype,"checked",2);ue([d({type:String,reflect:!0,attribute:!0})],ee.prototype,"value",2);ue([d({type:Boolean,reflect:!0,attribute:!0})],ee.prototype,"disabled",2);ue([d({type:String,reflect:!0,attribute:!0})],ee.prototype,"label",2);var Oe=ee,Ut=":host(:focus){outline:none}.buttons-container{display:flex}.buttons-container.vertical{flex-direction:column}.validation-message{margin-left:5px}",Mt=Object.defineProperty,Tt=Object.getOwnPropertyDescriptor,O=(t,e,s,i)=>{for(var o=i>1?void 0:i?Tt(e,s):e,n=t.length-1,r;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Mt(e,s,o),o},R,E=(R=class extends g{constructor(){super(...arguments),this.layout="horizontal",this.value="",this.uncheckAllowed=!1,this.disabled=!1,this._focusIndex=-1,this._checkedButton=null,this.handleSlotChange=()=>{this._buttons=this.buttonsSlot.assignedElements(),this._buttons.forEach(t=>{!t.hasAttribute("disabled")&&this.disabled&&t.setAttribute("disabled",""),t.setAttribute("tabIndex","-1"),this.updateCheckedButton(t)})},this.handleFocusIn=t=>{let e=t.target,s=this._buttons.findIndex(i=>i==e);this.focusIndex=this.focusIndex>=0?this.focusIndex:this.getNextFocusIndex(s!==-1?s:0),this.updateFocused(null,this._buttons[this.focusIndex])},this.handleFocusOut=()=>{this.updateFocused(this._buttons[this.focusIndex])},this.handleButtonClick=t=>{this.focus();let e=this._buttons.find(i=>i.contains(t.target)),s=this._buttons.findIndex(i=>i==e);s>=0&&(this.focusIndex=s,this.updateChecked())},this.handleKeyDown=t=>{let e=!0;switch(t.key){case"Down":case"ArrowDown":{let s=this.getNextFocusIndex(this.focusIndex+1);this.focusIndex=s!==-1?s:this.getNextFocusIndex(0),this.uncheckAllowed||this.updateChecked();break}case"Up":case"ArrowUp":{let s=this.getPreviousFocusIndex(this.focusIndex-1);this.focusIndex=s!==-1?s:this.getPreviousFocusIndex(this.childElementCount-1),this.uncheckAllowed||this.updateChecked();break}case"Enter":{this.updateChecked();break}default:e=!1}e&&(t.preventDefault(),t.stopPropagation())}}get focusIndex(){return this._focusIndex}set focusIndex(t){if(t>=-1&&t<this.childElementCount){let e=this._focusIndex;if(this._focusIndex=t,e!==t){let s=this._buttons[e],i=this._buttons[this.focusIndex];this.updateFocused(s,i)}}}firstUpdated(t){super.firstUpdated(t),this.buttonsSlot.addEventListener("slotchange",this.handleSlotChange),this.addEventListener("focusin",this.handleFocusIn),this.addEventListener("focusout",this.handleFocusOut),this.addEventListener("keydown",this.handleKeyDown)}updated(t){super.updated(t),t.has("disabled")&&(this.disabled?this.disableButtons():this.enableButtons())}static get styles(){return[x`
60
- ${b(Ut)}
59
+ `}},I.ID="sd-radio-button",I.ensureDefined=()=>{customElements.get(I.ID)||customElements.define(I.ID,I)},I);pt([a({type:Boolean,reflect:!0,attribute:!0})],et.prototype,"checked");pt([a({type:String,reflect:!0,attribute:!0})],et.prototype,"value");pt([a({type:Boolean,reflect:!0,attribute:!0})],et.prototype,"disabled");pt([a({type:String,reflect:!0,attribute:!0})],et.prototype,"label");var Lt=et,Oe=":host(:focus){outline:none}.buttons-container{display:flex}.buttons-container.vertical{flex-direction:column}.validation-message{margin-left:5px}",Ue=Object.defineProperty,O=(e,t,s,i)=>{for(var o=void 0,n=e.length-1,r;n>=0;n--)(r=e[n])&&(o=r(t,s,o)||o);return o&&Ue(t,s,o),o},R,E=(R=class extends f{constructor(){super(...arguments),this.layout="horizontal",this.value="",this.uncheckAllowed=!1,this.disabled=!1,this._focusIndex=-1,this._checkedButton=null,this.handleSlotChange=()=>{this._buttons=this.buttonsSlot.assignedElements(),this._buttons.forEach(e=>{!e.hasAttribute("disabled")&&this.disabled&&e.setAttribute("disabled",""),e.setAttribute("tabIndex","-1"),this.updateCheckedButton(e)})},this.handleFocusIn=e=>{let t=e.target,s=this._buttons.findIndex(i=>i==t);this.focusIndex=this.focusIndex>=0?this.focusIndex:this.getNextFocusIndex(s!==-1?s:0),this.updateFocused(null,this._buttons[this.focusIndex])},this.handleFocusOut=()=>{this.updateFocused(this._buttons[this.focusIndex])},this.handleButtonClick=e=>{this.focus();let t=this._buttons.find(i=>i.contains(e.target)),s=this._buttons.findIndex(i=>i==t);s>=0&&(this.focusIndex=s,this.updateChecked())},this.handleKeyDown=e=>{let t=!0;switch(e.key){case"Down":case"ArrowDown":{let s=this.getNextFocusIndex(this.focusIndex+1);this.focusIndex=s!==-1?s:this.getNextFocusIndex(0),this.uncheckAllowed||this.updateChecked();break}case"Up":case"ArrowUp":{let s=this.getPreviousFocusIndex(this.focusIndex-1);this.focusIndex=s!==-1?s:this.getPreviousFocusIndex(this.childElementCount-1),this.uncheckAllowed||this.updateChecked();break}case"Enter":{this.updateChecked();break}default:t=!1}t&&(e.preventDefault(),e.stopPropagation())}}get focusIndex(){return this._focusIndex}set focusIndex(e){if(e>=-1&&e<this.childElementCount){let t=this._focusIndex;if(this._focusIndex=e,t!==e){let s=this._buttons[t],i=this._buttons[this.focusIndex];this.updateFocused(s,i)}}}firstUpdated(e){super.firstUpdated(e),this.buttonsSlot.addEventListener("slotchange",this.handleSlotChange),this.addEventListener("focusin",this.handleFocusIn),this.addEventListener("focusout",this.handleFocusOut),this.addEventListener("keydown",this.handleKeyDown)}updated(e){super.updated(e),e.has("disabled")&&(this.disabled?this.disableButtons():this.enableButtons())}static get styles(){return[x`
60
+ ${m(Oe)}
61
61
  `]}render(){return c`
62
62
  <div
63
63
  class="buttons-container ${this.layout==="vertical"?"vertical":"horizontal"}"
64
- @click="${ce(this.disabled?void 0:this.handleButtonClick)}"
64
+ @click="${ut(this.disabled?void 0:this.handleButtonClick)}"
65
65
  >
66
66
  <slot></slot>
67
67
  </div>
@@ -74,11 +74,11 @@ var window;(window||={})["@cas-smartdesign/tree"]=(()=>{var ge=Object.defineProp
74
74
  >
75
75
  </sd-field-validation-message>
76
76
  `}
77
- `}updateCheckedButton(t){if(this._checkedButton&&this._checkedButton!==t)this.uncheckButton(t);else if(t.hasAttribute("checked")){this._checkedButton=t;let e=t.getAttribute("value");this.updateValue(e)}}disableButtons(){var t;(t=this._buttons)==null||t.forEach(e=>{e.setAttribute("disabled","")})}enableButtons(){var t;(t=this._buttons)==null||t.forEach(e=>{e.removeAttribute("disabled")})}fireValueChangeEvent(){this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this.value,selectedIndex:this.selectedIndex}}))}getNextFocusIndex(t){for(let e=t;e<this.childElementCount;e++){let s=this._buttons[e];if(this.isFocusable(s))return e}return-1}getPreviousFocusIndex(t){for(let e=t;e>=0;e--){let s=this._buttons[e];if(this.isFocusable(s))return e}return-1}isFocusable(t){return!t.hasAttribute("disabled")}updateChecked(){let t=this._checkedButton,e=this._buttons[this.focusIndex];this._checkedButton=e,t&&t!==e&&this.uncheckButton(t),e&&this.toggleButton(e)}toggleButton(t){t.hasAttribute("checked")?this.uncheckAllowed&&(this.uncheckButton(t),this._checkedButton=null,this.updateValue("")):(this.checkButton(t),this.updateValue(t.getAttribute("value")))}updateValue(t){this.value=t,this.fireValueChangeEvent()}updateFocused(t,e){var s,i;(s=t?.removeAttribute)==null||s.call(t,"focused"),(i=e?.setAttribute)==null||i.call(e,"focused","")}checkButton(t){t.setAttribute("checked","")}uncheckButton(t){t.removeAttribute("checked")}get buttonsSlot(){return this.shadowRoot&&!this._buttonsSlot&&(this._buttonsSlot=this.shadowRoot.querySelector("slot")),this._buttonsSlot}get selectedIndex(){return this._buttons.indexOf(this._checkedButton)}},R.ID="sd-radio-button-group",R.ensureDefined=()=>{Oe.ensureDefined(),customElements.get(R.ID)||customElements.define(R.ID,R)},R);O([d({type:String,reflect:!0,attribute:!0})],E.prototype,"layout",2);O([d({type:String})],E.prototype,"value",2);O([d({type:Boolean,reflect:!0,attribute:"uncheck-allowed"})],E.prototype,"uncheckAllowed",2);O([d({type:Boolean,reflect:!0,attribute:!0})],E.prototype,"disabled",2);O([d({type:String})],E.prototype,"validationMessage",2);O([d({type:String})],E.prototype,"validationIconSrc",2);O([d({type:{fromAttribute(t){return t&&P[t.toLowerCase()]},toAttribute(t){return t&&t.toLowerCase()}},reflect:!0})],E.prototype,"validationLevel",2);var zt=E;zt.ensureDefined();var st=16,j=35,se=class{constructor(e,s,i,o){this.id=e,this.text=s,this.path=i,this.nodes=o,this.depth=0,this.selectionState="unchecked",this.expanded=!1,this.parentSelectionAllowed=!1,this.lastLoadingChild=!1,this.loading=!1,this.disabled=!1,this.parent=[],i?(this.depth=i.length-1,this.parent=i.slice(0,-1)):this.path=[e],this.childCount=o?o.length:0}updateSelectionStateOfChildren(){this.nodes.forEach(e=>{if(this.selectionState==="checked"){if(e.childrenType==="radio"||ot(e))return;e.selectionState="checked"}else this.selectionState==="unchecked"&&(e.selectionState="unchecked");e.updateSelectionStateOfChildren()})}updateParent(){let e=this.parentNode;return e&&(!this.parentSelectionAllowed||this.selectionState!=="unchecked"||e.disabled)&&(e.updateSelectionStateByChildren(),e.updateParent()),e}get parentNode(){return this.parent.length?this.nodeGetter(this.parent):null}check(){this.selectionState!=="checked"&&(this.selectionState="checked",this.updateBranch())}uncheck(){this.selectionState!=="unchecked"&&(this.selectionState="unchecked",this.updateBranch())}hasRadioButtonDescendant(){if(this.childrenType==="radio")return!0;for(let e of this.nodes)if(e.hasRadioButtonDescendant())return!0}},it=t=>t?.type==="checkbox",ot=t=>t?.type==="radio",pe=class extends se{constructor(e,s,i,o){super(e,s,i,o),this.type="checkbox"}toggle(){this.selectionState==="checked"?this.selectionState="unchecked":this.selectionState="checked",this.updateBranch()}updateBranch(){(!this.parentSelectionAllowed||this.selectionState==="unchecked")&&(this.updateSelectionStateOfChildren(),this.updateSelectionStateByChildren()),this.updateParent()}updateSelectionStateByChildren(){if(this.nodes.length===0)return;let e=this.nodes.map(i=>i.selectionState==="checked"||i.selectionState==="indeterminate"),s=e.some(Boolean);if(this.parentSelectionAllowed)this.selectionState=s?"checked":"unchecked";else{let i=e.every(Boolean),o=this.nodes.map(n=>n.selectionState).some(n=>n==="indeterminate");this.childrenType==="radio"?this.selectionState=s?"checked":"unchecked":o?this.selectionState="indeterminate":i?this.selectionState="checked":s?this.selectionState="indeterminate":this.selectionState="unchecked"}}getFlattenedSubtree(e){return e.reduce((s,i)=>s.concat(it(i)&&i.childCount>0&&i.expanded?[i,...this.getFlattenedSubtree(i.nodes)]:i),[])}},fe=class t extends se{constructor(e,s,i,o){super(e,s,i,o),this.type="radio"}toggle(){this.selectionState==="checked"?this.selectionState="unchecked":(this.selectionState="checked",this.clearSiblings()),this.updateBranch()}check(){this.selectionState!=="checked"&&(this.selectionState="checked",this.clearSiblings(),this.updateBranch())}updateBranch(){this.selectionState==="unchecked"&&this.updateSelectionStateOfChildren(),this.updateParent()}updateParent(){let e=super.updateParent();return e instanceof t&&e.clearSiblings(),e}updateSelectionStateByChildren(){this.nodes.length!==0&&(this.nodes.map(e=>e.selectionState==="checked").some(Boolean)?this.selectionState="checked":this.selectionState="unchecked")}clearSiblings(){this.getSiblings().forEach(e=>{e.uncheck()})}},Ht=`:host{width:100%;display:block;contain:layout;position:absolute}:host([readonly][focused]){background-color:#1467ba4d}.node{height:35px;display:flex;align-items:center}.node .expander,.node .placeholder{height:28px;width:30px;flex-shrink:0}.node .expander{cursor:pointer;background-position:center;background-size:24px;flex:0 0 auto}.node .expander.more{background-image:url("data:image/svg+xml,%3csvg%20height='32'%20viewBox='0%200%2032%2032'%20width='32'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m15%2021%209.5-9.5%209.5%209.5'%20fill='none'%20stroke='%23999'%20stroke-linecap='square'%20stroke-width='2'%20transform='matrix(0%201%20-1%200%2032.25%20-8.25)'/%3e%3c/svg%3e")}.node .expander.less{background-image:url("data:image/svg+xml,%3csvg%20height='32'%20viewBox='0%200%2032%2032'%20width='32'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m19.75%206.75%209.5%209.5-9.5%209.5'%20fill='none'%20stroke='%23999'%20stroke-linecap='square'%20stroke-width='2'%20transform='matrix(0%201%20-1%200%2032.25%20-8.25)'/%3e%3c/svg%3e")}.node .label{outline:none}.node .input{overflow:hidden}.node ul{list-style-type:none;margin:0;padding:0}`,Vt=Object.defineProperty,Ft=Object.getOwnPropertyDescriptor,y=(t,e,s,i)=>{for(var o=i>1?void 0:i?Ft(e,s):e,n=t.length-1,r;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Vt(e,s,o),o},U,m=(U=class extends g{constructor(){super(...arguments),this.text="",this.expanded=!1,this.childCount=0,this.focused=!1,this.readonly=!1,this.depth=0,this.path=[],this.type="checkbox",this.selectionState="unchecked",this.disabled=!1,this.loading=!1,this.onSelectionChange=()=>{if(!this.readonly){if(this.type=="checkbox"){let t=this.shadowRoot.querySelector(".input");this.selectionState=t.checked?"checked":t.indeterminate?"indeterminate":"unchecked"}else{let t=this.shadowRoot.querySelector(".input");this.selectionState=t.checked?"checked":"unchecked"}this.updateComplete.then(()=>{this.dispatchEvent(new CustomEvent("selection",{detail:{path:this.path,checked:this.selectionState==="checked",indeterminate:this.selectionState==="indeterminate"},bubbles:!0,composed:!0}))})}}}static get styles(){return[x`
78
- ${b(Ht)}
79
- `]}render(){let t=this.childCount>0||this.children.length>0;return c`
80
- <li class="node" style="margin-left: ${this.depth*st}px">
81
- ${t?c` <div class="expander ${this.expanded?"less":"more"}" @click="${this.toggle}"></div> `:c` <div class="placeholder"></div> `}
77
+ `}updateCheckedButton(e){if(this._checkedButton&&this._checkedButton!==e)this.uncheckButton(e);else if(e.hasAttribute("checked")){this._checkedButton=e;let t=e.getAttribute("value");this.updateValue(t)}}disableButtons(){this._buttons?.forEach(e=>{e.setAttribute("disabled","")})}enableButtons(){this._buttons?.forEach(e=>{e.removeAttribute("disabled")})}fireValueChangeEvent(){this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this.value,selectedIndex:this.selectedIndex}}))}getNextFocusIndex(e){for(let t=e;t<this.childElementCount;t++){let s=this._buttons[t];if(this.isFocusable(s))return t}return-1}getPreviousFocusIndex(e){for(let t=e;t>=0;t--){let s=this._buttons[t];if(this.isFocusable(s))return t}return-1}isFocusable(e){return!e.hasAttribute("disabled")}updateChecked(){let e=this._checkedButton,t=this._buttons[this.focusIndex];this._checkedButton=t,e&&e!==t&&this.uncheckButton(e),t&&this.toggleButton(t)}toggleButton(e){e.hasAttribute("checked")?this.uncheckAllowed&&(this.uncheckButton(e),this._checkedButton=null,this.updateValue("")):(this.checkButton(e),this.updateValue(e.getAttribute("value")))}updateValue(e){this.value=e,this.fireValueChangeEvent()}updateFocused(e,t){e?.removeAttribute?.("focused"),t?.setAttribute?.("focused","")}checkButton(e){e.setAttribute("checked","")}uncheckButton(e){e.removeAttribute("checked")}get buttonsSlot(){return this.shadowRoot&&!this._buttonsSlot&&(this._buttonsSlot=this.shadowRoot.querySelector("slot")),this._buttonsSlot}get selectedIndex(){return this._buttons.indexOf(this._checkedButton)}},R.ID="sd-radio-button-group",R.ensureDefined=()=>{Lt.ensureDefined(),customElements.get(R.ID)||customElements.define(R.ID,R)},R);O([a({type:String,reflect:!0,attribute:!0})],E.prototype,"layout");O([a({type:String})],E.prototype,"value");O([a({type:Boolean,reflect:!0,attribute:"uncheck-allowed"})],E.prototype,"uncheckAllowed");O([a({type:Boolean,reflect:!0,attribute:!0})],E.prototype,"disabled");O([a({type:String})],E.prototype,"validationMessage");O([a({type:String})],E.prototype,"validationIconSrc");O([a({type:{fromAttribute(e){return e&&B[e.toLowerCase()]},toAttribute(e){return e&&e.toLowerCase()}},reflect:!0})],E.prototype,"validationLevel");var Me=E;Me.ensureDefined();var Yt=16,V=35,it=class{constructor(t,s,i,o){this.id=t,this.text=s,this.path=i,this.nodes=o,this.depth=0,this.selectionState="unchecked",this.expanded=!1,this.parentSelectionAllowed=!1,this.lastLoadingChild=!1,this.loading=!1,this.disabled=!1,this.parent=[],i?(this.depth=i.length-1,this.parent=i.slice(0,-1)):this.path=[t],this.childCount=o?o.length:0}updateSelectionStateOfChildren(){this.nodes.forEach(t=>{if(this.selectionState==="checked"){if(t.childrenType==="radio"||Qt(t))return;t.selectionState="checked"}else this.selectionState==="unchecked"&&(t.selectionState="unchecked");t.updateSelectionStateOfChildren()})}updateParent(){let t=this.parentNode;return t&&(!this.parentSelectionAllowed||this.selectionState!=="unchecked"||t.disabled)&&(t.updateSelectionStateByChildren(),t.updateParent()),t}get parentNode(){return this.parent.length?this.nodeGetter(this.parent):null}check(){this.selectionState!=="checked"&&(this.selectionState="checked",this.updateBranch())}uncheck(){this.selectionState!=="unchecked"&&(this.selectionState="unchecked",this.updateBranch())}hasRadioButtonDescendant(){if(this.childrenType==="radio")return!0;for(let t of this.nodes)if(t.hasRadioButtonDescendant())return!0}},Zt=e=>e?.type==="checkbox",Qt=e=>e?.type==="radio",ft=class extends it{constructor(t,s,i,o){super(t,s,i,o),this.type="checkbox"}toggle(){this.selectionState==="checked"?this.selectionState="unchecked":this.selectionState="checked",this.updateBranch()}updateBranch(){(!this.parentSelectionAllowed||this.selectionState==="unchecked")&&(this.updateSelectionStateOfChildren(),this.updateSelectionStateByChildren()),this.updateParent()}updateSelectionStateByChildren(){if(this.nodes.length===0)return;let t=this.nodes.map(i=>i.selectionState==="checked"||i.selectionState==="indeterminate"),s=t.some(Boolean);if(this.parentSelectionAllowed)this.selectionState=s?"checked":"unchecked";else{let i=t.every(Boolean),o=this.nodes.map(n=>n.selectionState).some(n=>n==="indeterminate");this.childrenType==="radio"?this.selectionState=s?"checked":"unchecked":o?this.selectionState="indeterminate":i?this.selectionState="checked":s?this.selectionState="indeterminate":this.selectionState="unchecked"}}getFlattenedSubtree(t){return t.reduce((s,i)=>s.concat(Zt(i)&&i.childCount>0&&i.expanded?[i,...this.getFlattenedSubtree(i.nodes)]:i),[])}},gt=class e extends it{constructor(t,s,i,o){super(t,s,i,o),this.type="radio"}toggle(){this.selectionState==="checked"?this.selectionState="unchecked":(this.selectionState="checked",this.clearSiblings()),this.updateBranch()}check(){this.selectionState!=="checked"&&(this.selectionState="checked",this.clearSiblings(),this.updateBranch())}updateBranch(){this.selectionState==="unchecked"&&this.updateSelectionStateOfChildren(),this.updateParent()}updateParent(){let t=super.updateParent();return t instanceof e&&t.clearSiblings(),t}updateSelectionStateByChildren(){this.nodes.length!==0&&(this.nodes.map(t=>t.selectionState==="checked").some(Boolean)?this.selectionState="checked":this.selectionState="unchecked")}clearSiblings(){this.getSiblings().forEach(t=>{t.uncheck()})}},Te=`:host{width:100%;display:block;contain:layout;position:absolute}:host([readonly][focused]){background-color:#1467ba4d}.node{height:35px;display:flex;align-items:center}.node .expander,.node .placeholder{height:28px;width:30px;flex-shrink:0}.node .expander{cursor:pointer;background-position:center;background-size:24px;flex:0 0 auto}.node .expander.more{background-image:url("data:image/svg+xml,%3csvg%20height='32'%20viewBox='0%200%2032%2032'%20width='32'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m15%2021%209.5-9.5%209.5%209.5'%20fill='none'%20stroke='%23999'%20stroke-linecap='square'%20stroke-width='2'%20transform='matrix(0%201%20-1%200%2032.25%20-8.25)'/%3e%3c/svg%3e")}.node .expander.less{background-image:url("data:image/svg+xml,%3csvg%20height='32'%20viewBox='0%200%2032%2032'%20width='32'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m19.75%206.75%209.5%209.5-9.5%209.5'%20fill='none'%20stroke='%23999'%20stroke-linecap='square'%20stroke-width='2'%20transform='matrix(0%201%20-1%200%2032.25%20-8.25)'/%3e%3c/svg%3e")}.node .label{outline:none}.node .input{overflow:hidden}.node ul{list-style-type:none;margin:0;padding:0}`,ze=Object.defineProperty,y=(e,t,s,i)=>{for(var o=void 0,n=e.length-1,r;n>=0;n--)(r=e[n])&&(o=r(t,s,o)||o);return o&&ze(t,s,o),o},U,b=(U=class extends f{constructor(){super(...arguments),this.text="",this.expanded=!1,this.childCount=0,this.focused=!1,this.readonly=!1,this.depth=0,this.path=[],this.type="checkbox",this.selectionState="unchecked",this.disabled=!1,this.loading=!1,this.onSelectionChange=()=>{if(!this.readonly){if(this.type=="checkbox"){let e=this.shadowRoot.querySelector(".input");this.selectionState=e.checked?"checked":e.indeterminate?"indeterminate":"unchecked"}else{let e=this.shadowRoot.querySelector(".input");this.selectionState=e.checked?"checked":"unchecked"}this.updateComplete.then(()=>{this.dispatchEvent(new CustomEvent("selection",{detail:{path:this.path,checked:this.selectionState==="checked",indeterminate:this.selectionState==="indeterminate"},bubbles:!0,composed:!0}))})}}}static get styles(){return[x`
78
+ ${m(Te)}
79
+ `]}render(){let e=this.childCount>0||this.children.length>0;return c`
80
+ <li class="node" style="margin-left: ${this.depth*Yt}px">
81
+ ${e?c` <div class="expander ${this.expanded?"less":"more"}" @click="${this.toggle}"></div> `:c` <div class="placeholder"></div> `}
82
82
  ${this.readonly?c` <div class="label">${this.text}</div> `:c`
83
83
  ${this.type==="checkbox"?c`
84
84
  <sd-checkbox
@@ -105,34 +105,34 @@ var window;(window||={})["@cas-smartdesign/tree"]=(()=>{var ge=Object.defineProp
105
105
  ></sd-radio-button>
106
106
  `}
107
107
  `}
108
- ${t&&this.expanded?c`
108
+ ${e&&this.expanded?c`
109
109
  <ul>
110
110
  <slot></slot>
111
111
  </ul>
112
112
  `:""}
113
113
  </li>
114
- `}toggle(){this.loading||(this.expanded=!this.expanded,this.dispatchExpansionEvent())}expand(){if(!this.loading){let t=!this.expanded;this.expanded=!0,t&&this.dispatchExpansionEvent()}}collapse(){if(!this.loading){let t=this.expanded;this.expanded=!1,t&&this.dispatchExpansionEvent()}}getState(t){var e;let s=Array.isArray(t)?[...t,this.nodeId]:[this.nodeId],i=[...this.children].map(n=>n.getState(s)),o;return this.type==="checkbox"?o=new pe(this.nodeId,this.text,s,i):o=new fe(this.nodeId,this.text,s,i),o.selectionState=this.selectionState,o.childrenType=(e=i[0])==null?void 0:e.type,o.expanded=this.expanded,o.disabled=this.disabled,o}dispatchExpansionEvent(){this.dispatchEvent(new CustomEvent("expansion",{detail:{path:this.path,expanded:this.expanded},bubbles:!0,composed:!0}))}},U.ID="sd-tree-node",U.ensureDefined=()=>{Oe.ensureDefined(),Re.ensureDefined(),customElements.get(U.ID)||customElements.define(U.ID,U)},U);y([d({type:String,reflect:!0,attribute:!0})],m.prototype,"text",2);y([d({type:Boolean,reflect:!0,attribute:!0})],m.prototype,"expanded",2);y([d({type:String,reflect:!0,attribute:"node-id"})],m.prototype,"nodeId",2);y([d({type:Number,reflect:!0,attribute:"child-count"})],m.prototype,"childCount",2);y([d({type:Boolean,reflect:!0,attribute:!0})],m.prototype,"focused",2);y([d({type:Boolean,reflect:!0,attribute:!0})],m.prototype,"readonly",2);y([d({type:Number})],m.prototype,"depth",2);y([d({type:Array,attribute:!1})],m.prototype,"path",2);y([d({type:String,reflect:!0,attribute:!0})],m.prototype,"type",2);y([d({type:String,reflect:!0,attribute:"selection-state"})],m.prototype,"selectionState",2);y([d({type:Boolean,reflect:!0,attribute:!0})],m.prototype,"disabled",2);y([d({type:Boolean,reflect:!0,attribute:!0})],m.prototype,"loading",2);var jt=m,qt=":host{position:absolute;width:100%}:host([readonly]) li{padding-left:30px}li{height:35px;padding-left:34px}.text{vertical-align:middle;line-height:35px;font-family:Segoe UI,Lucida Sans,Arial,sans-serif;color:#111;font-size:16px}",Kt=Object.defineProperty,Jt=Object.getOwnPropertyDescriptor,nt=(t,e,s,i)=>{for(var o=i>1?void 0:i?Jt(e,s):e,n=t.length-1,r;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Kt(e,s,o),o},M,Me=(M=class extends g{constructor(){super(...arguments),this.readonly=!1,this.depth=0}static get styles(){return[x`
115
- ${b(qt)}
114
+ `}toggle(){this.loading||(this.expanded=!this.expanded,this.dispatchExpansionEvent())}expand(){if(!this.loading){let e=!this.expanded;this.expanded=!0,e&&this.dispatchExpansionEvent()}}collapse(){if(!this.loading){let e=this.expanded;this.expanded=!1,e&&this.dispatchExpansionEvent()}}getState(e){let t=Array.isArray(e)?[...e,this.nodeId]:[this.nodeId],s=[...this.children].map(o=>o.getState(t)),i;return this.type==="checkbox"?i=new ft(this.nodeId,this.text,t,s):i=new gt(this.nodeId,this.text,t,s),i.selectionState=this.selectionState,i.childrenType=s[0]?.type,i.expanded=this.expanded,i.disabled=this.disabled,i}dispatchExpansionEvent(){this.dispatchEvent(new CustomEvent("expansion",{detail:{path:this.path,expanded:this.expanded},bubbles:!0,composed:!0}))}},U.ID="sd-tree-node",U.ensureDefined=()=>{Lt.ensureDefined(),Pt.ensureDefined(),customElements.get(U.ID)||customElements.define(U.ID,U)},U);y([a({type:String,reflect:!0,attribute:!0})],b.prototype,"text");y([a({type:Boolean,reflect:!0,attribute:!0})],b.prototype,"expanded");y([a({type:String,reflect:!0,attribute:"node-id"})],b.prototype,"nodeId");y([a({type:Number,reflect:!0,attribute:"child-count"})],b.prototype,"childCount");y([a({type:Boolean,reflect:!0,attribute:!0})],b.prototype,"focused");y([a({type:Boolean,reflect:!0,attribute:!0})],b.prototype,"readonly");y([a({type:Number})],b.prototype,"depth");y([a({type:Array,attribute:!1})],b.prototype,"path");y([a({type:String,reflect:!0,attribute:!0})],b.prototype,"type");y([a({type:String,reflect:!0,attribute:"selection-state"})],b.prototype,"selectionState");y([a({type:Boolean,reflect:!0,attribute:!0})],b.prototype,"disabled");y([a({type:Boolean,reflect:!0,attribute:!0})],b.prototype,"loading");var He=b,Fe=":host{position:absolute;width:100%}:host([readonly]) li{padding-left:30px}li{height:35px;padding-left:34px}.text{vertical-align:middle;line-height:35px;font-family:Segoe UI,Lucida Sans,Arial,sans-serif;color:#111;font-size:16px}",Ve=Object.defineProperty,Xt=(e,t,s,i)=>{for(var o=void 0,n=e.length-1,r;n>=0;n--)(r=e[n])&&(o=r(t,s,o)||o);return o&&Ve(t,s,o),o},M,Rt=(M=class extends f{constructor(){super(...arguments),this.readonly=!1,this.depth=0}static get styles(){return[x`
115
+ ${m(Fe)}
116
116
  `]}render(){return c`
117
- <li class="root" style="margin-left: ${this.depth*st}px;">
117
+ <li class="root" style="margin-left: ${this.depth*Yt}px;">
118
118
  <div class="text">
119
119
  <slot>Loading...</slot>
120
120
  </div>
121
121
  </li>
122
- `}},M.ID="sd-tree-loading-indicator",M.ensureDefined=()=>{customElements.get(M.ID)||customElements.define(M.ID,M)},M);nt([d({type:Boolean,reflect:!0,attribute:!0})],Me.prototype,"readonly",2);nt([d({type:Number})],Me.prototype,"depth",2);var Gt=Me,te=(t,e=1,s=0)=>e>0?t.reduce((i,o)=>i.concat(o.childCount>0&&o.expanded?[o,...te(o.nodes,e-1,s+1)]:o),[]):t.slice(),rt=(t,e,s=0)=>{if(!e)return null;let i=e[s],o=t.find(n=>n.id===i);return e.length-1===s?o:o?.nodes.length>0?rt(o.nodes,e,s+1):null},at=(t,e,s,i,o,n)=>{let r=Math.max(0,n*i),l=Math.min(r,t*i),a=Math.max(0,t*i-o+i);switch(e){case"start":return l;case"end":return a;case"center":{let h=Math.round(a+(l-a)/2);return h<Math.ceil(o/2)?0:h>r+Math.floor(o/2)?r:h}case"auto":default:return s>=a&&s<=l?s:s<a?a:l}},Ue=t=>t&&typeof t!="string",Wt=(t,e)=>{let s=t.find(i=>Ue(i)&&JSON.stringify(i.path)===JSON.stringify(e));return Ue(s)?s:null},q=(t,e)=>t.findIndex(s=>typeof s=="string"&&s===JSON.stringify(e)),$=t=>typeof t=="string",Yt=":host{display:block;position:relative;contain:layout;overflow:auto}:host(:focus){outline:none}ul{list-style-type:none;margin:0;padding:0}.root{width:100%}",Qt=Object.defineProperty,Zt=Object.getOwnPropertyDescriptor,ie=(t,e,s,i)=>{for(var o=i>1?void 0:i?Zt(e,s):e,n=t.length-1,r;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Qt(e,s,o),o},T,K=(T=class extends g{constructor(){super(),this.pageSize=50,this.loadingText="Loading...",this.parentSelectionAllowed=!1,this.readonly=!1,this._lastKnownHeight=0,this._lastKnownScrollTop=0,this._lastRenderedScrollTop=0,this._visibleItemsNum=0,this._firstVisibleIndex=0,this._lastVisibleIndex=0,this._firstRenderedIndex=0,this._lastRenderedIndex=0,this._focusIndex=-1,this._flattenedNodes=[],this._rootItemsLoading=!1,this._rootNodeCount=0,this._loadedRootNodeCount=0,this._allNodeCount=0,this._nodeStates=new Map,this.onScroll=()=>{this._lastKnownScrollTop=this.scrollTop;let t=this._lastRenderedScrollTop-this._lastKnownScrollTop;Math.abs(t)>=j&&(this._lastRenderedScrollTop=this._lastKnownScrollTop,this.requestUpdate())},this.handleNodeExpansion=t=>{let{path:e,expanded:s}=t.detail;this.updateAfterExpansion(e,s)},this.handleKeyDown=t=>{let e=!0;switch(t.key){case"ArrowDown":{this.focusIndex=this.normalizeIndex(this.focusIndex+1);break}case"ArrowUp":{this.focusIndex=this.normalizeIndex(this.focusIndex-1);break}case"ArrowRight":{let s=this.focusedNode;if(s)if(s.childCount>0&&!s.expanded){let i=this.querySelector(`[node-id='${s.id}']`);i&&i.expand()}else this.focusIndex=this.normalizeIndex(this.focusIndex+1);break}case"ArrowLeft":{let s=this.focusedNode;if(s)if(s.childCount>0&&s.expanded){let i=this.querySelector(`[node-id='${s.id}']`);i&&i.collapse()}else this.focusIndex=this.normalizeIndex(this.focusIndex-1);break}case"Enter":{let s=this.focusedNode;s&&(this.toggleSelection(s.path),this.updateComplete.then(()=>{this.dispatchEvent(new CustomEvent("selection",{detail:{path:s.path,checked:s.selectionState==="checked",indeterminate:s.selectionState==="indeterminate"},bubbles:!0,composed:!0}))}));break}default:{e=!1;break}}e&&(t.preventDefault(),t.stopPropagation())},this.handleNodeSelection=t=>{if(t.target==this)return;this._reusePreviousRenderData=!0;let{path:e}=t.detail;this.focusIndex=q(this._flattenedNodes,e),this.focus(),this.toggleSelection(e),this.updateComplete.then(()=>{this._reusePreviousRenderData=!1})},this.getFlattenedNodeId=t=>JSON.stringify(t.path),this.nodeGetter=t=>t?this._nodeStates.get(JSON.stringify(t)):null,this._resizeObserver=new ResizeObserver(()=>{this._lastKnownHeight!==this.offsetHeight&&(this._lastKnownHeight=this.offsetHeight,this.requestUpdate())})}get rootNodeCount(){return this._rootNodeCount}set rootNodeCount(t){t===0?this._allNodeCount=0:t>0&&(this._allNodeCount+=t-this.rootNodeCount),this._rootNodeCount=t,this.requestUpdate()}get focusIndex(){return this._focusIndex}set focusIndex(t){if(t>=-1&&t<this._allNodeCount){let e=this._focusIndex;this._focusIndex=t,(t<=this._firstVisibleIndex||this._lastVisibleIndex<=t)&&this.scrollToNode(t),e!=t&&this.requestUpdate("focusIndex",e)}}setNodes(t){this.stopLoadingIndicator(),this.setLastLoadingChildren(t,this.rootNodeCount,t.length),t.forEach((e,s)=>{let i=[...t];i.splice(s,1),this.updateNodeMap(e,i)}),this.updateCount(t),this._loadedRootNodeCount=t.length,this._flattenedNodes=te(t,1/0).map(this.getFlattenedNodeId),this.requestUpdate()}addNodes(t,e){this.stopLoadingIndicator(e),t.forEach((i,o)=>{let n=[...t];n.splice(o,1),this.updateNodeMap(i,n)});let s=this.nodeGetter(e);s?s.expanded&&(this._allNodeCount+=t.length+this.getNodeCount(t)):this._loadedRootNodeCount+=t.length,this.updateFlattenedNodes(t,e),this.requestUpdate()}connectedCallback(){super.connectedCallback(),this._resizeObserver.observe(this)}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver.disconnect()}static get styles(){return[x`
123
- ${b(Yt)}
124
- `]}firstUpdated(t){super.firstUpdated(t),this.addEventListener("scroll",this.onScroll),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("expansion",this.handleNodeExpansion),this.addEventListener("selection",this.handleNodeSelection),this.addEventListener("focus",()=>{this.focusIndex==-1&&(this.focusIndex=this.normalizeIndex(0))}),this._nodeStates.size===0&&(this.children.length>0?this.syncState():this.requestData())}updated(t){super.updated(t),this.updateNodes(),t.has("parentSelectionAllowed")&&this.updateParentSelectionAllowed()}render(){return this.updateRenderData(),c`
125
- <div class="root" style="height: ${this._allNodeCount*j}px">
122
+ `}},M.ID="sd-tree-loading-indicator",M.ensureDefined=()=>{customElements.get(M.ID)||customElements.define(M.ID,M)},M);Xt([a({type:Boolean,reflect:!0,attribute:!0})],Rt.prototype,"readonly");Xt([a({type:Number})],Rt.prototype,"depth");var qe=Rt,st=(e,t=1,s=0)=>t>0?e.reduce((i,o)=>i.concat(o.childCount>0&&o.expanded?[o,...st(o.nodes,t-1,s+1)]:o),[]):e.slice(),te=(e,t,s=0)=>{if(!t)return null;let i=t[s],o=e.find(n=>n.id===i);return t.length-1===s?o:o?.nodes.length>0?te(o.nodes,t,s+1):null},ee=(e,t,s,i,o,n)=>{let r=Math.max(0,n*i),h=Math.min(r,e*i),d=Math.max(0,e*i-o+i);switch(t){case"start":return h;case"end":return d;case"center":{let u=Math.round(d+(h-d)/2);return u<Math.ceil(o/2)?0:u>r+Math.floor(o/2)?r:u}case"auto":default:return s>=d&&s<=h?s:s<d?d:h}},Bt=e=>e&&typeof e!="string",je=(e,t)=>{let s=e.find(i=>Bt(i)&&JSON.stringify(i.path)===JSON.stringify(t));return Bt(s)?s:null},q=(e,t)=>e.findIndex(s=>typeof s=="string"&&s===JSON.stringify(t)),_=e=>typeof e=="string",Ke=":host{display:block;position:relative;contain:layout;overflow:auto}:host(:focus){outline:none}ul{list-style-type:none;margin:0;padding:0}.root{width:100%}",Je=Object.defineProperty,We=Object.getOwnPropertyDescriptor,ot=(e,t,s,i)=>{for(var o=i>1?void 0:i?We(t,s):t,n=e.length-1,r;n>=0;n--)(r=e[n])&&(o=(i?r(t,s,o):r(o))||o);return i&&o&&Je(t,s,o),o},T,j=(T=class extends f{constructor(){super(),this.pageSize=50,this.loadingText="Loading...",this.parentSelectionAllowed=!1,this.readonly=!1,this._lastKnownHeight=0,this._lastKnownScrollTop=0,this._lastRenderedScrollTop=0,this._visibleItemsNum=0,this._firstVisibleIndex=0,this._lastVisibleIndex=0,this._firstRenderedIndex=0,this._lastRenderedIndex=0,this._focusIndex=-1,this._flattenedNodes=[],this._rootItemsLoading=!1,this._rootNodeCount=0,this._loadedRootNodeCount=0,this._allNodeCount=0,this._nodeStates=new Map,this.onScroll=()=>{this._lastKnownScrollTop=this.scrollTop;let e=this._lastRenderedScrollTop-this._lastKnownScrollTop;Math.abs(e)>=V&&(this._lastRenderedScrollTop=this._lastKnownScrollTop,this.requestUpdate())},this.handleNodeExpansion=e=>{let{path:t,expanded:s}=e.detail;this.updateAfterExpansion(t,s)},this.handleKeyDown=e=>{let t=!0;switch(e.key){case"ArrowDown":{this.focusIndex=this.normalizeIndex(this.focusIndex+1);break}case"ArrowUp":{this.focusIndex=this.normalizeIndex(this.focusIndex-1);break}case"ArrowRight":{let s=this.focusedNode;if(s)if(s.childCount>0&&!s.expanded){let i=this.querySelector(`[node-id='${s.id}']`);i&&i.expand()}else this.focusIndex=this.normalizeIndex(this.focusIndex+1);break}case"ArrowLeft":{let s=this.focusedNode;if(s)if(s.childCount>0&&s.expanded){let i=this.querySelector(`[node-id='${s.id}']`);i&&i.collapse()}else this.focusIndex=this.normalizeIndex(this.focusIndex-1);break}case"Enter":{let s=this.focusedNode;s&&(this.toggleSelection(s.path),this.updateComplete.then(()=>{this.dispatchEvent(new CustomEvent("selection",{detail:{path:s.path,checked:s.selectionState==="checked",indeterminate:s.selectionState==="indeterminate"},bubbles:!0,composed:!0}))}));break}default:{t=!1;break}}t&&(e.preventDefault(),e.stopPropagation())},this.handleNodeSelection=e=>{if(e.target==this)return;this._reusePreviousRenderData=!0;let{path:t}=e.detail;this.focusIndex=q(this._flattenedNodes,t),this.focus(),this.toggleSelection(t),this.updateComplete.then(()=>{this._reusePreviousRenderData=!1})},this.getFlattenedNodeId=e=>JSON.stringify(e.path),this.nodeGetter=e=>e?this._nodeStates.get(JSON.stringify(e)):null,this._resizeObserver=new ResizeObserver(()=>{this._lastKnownHeight!==this.offsetHeight&&(this._lastKnownHeight=this.offsetHeight,this.requestUpdate())})}get rootNodeCount(){return this._rootNodeCount}set rootNodeCount(e){e===0?this._allNodeCount=0:e>0&&(this._allNodeCount+=e-this.rootNodeCount),this._rootNodeCount=e,this.requestUpdate()}get focusIndex(){return this._focusIndex}set focusIndex(e){if(e>=-1&&e<this._allNodeCount){let t=this._focusIndex;this._focusIndex=e,(e<=this._firstVisibleIndex||this._lastVisibleIndex<=e)&&this.scrollToNode(e),t!=e&&this.requestUpdate("focusIndex",t)}}setNodes(e){this.stopLoadingIndicator(),this.setLastLoadingChildren(e,this.rootNodeCount,e.length),e.forEach((t,s)=>{let i=[...e];i.splice(s,1),this.updateNodeMap(t,i)}),this.updateCount(e),this._loadedRootNodeCount=e.length,this._flattenedNodes=st(e,1/0).map(this.getFlattenedNodeId),this.requestUpdate()}addNodes(e,t){this.stopLoadingIndicator(t),e.forEach((i,o)=>{let n=[...e];n.splice(o,1),this.updateNodeMap(i,n)});let s=this.nodeGetter(t);s?s.expanded&&(this._allNodeCount+=e.length+this.getNodeCount(e)):this._loadedRootNodeCount+=e.length,this.updateFlattenedNodes(e,t),this.requestUpdate()}connectedCallback(){super.connectedCallback(),this._resizeObserver.observe(this)}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver.disconnect()}static get styles(){return[x`
123
+ ${m(Ke)}
124
+ `]}firstUpdated(e){super.firstUpdated(e),this.addEventListener("scroll",this.onScroll),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("expansion",this.handleNodeExpansion),this.addEventListener("selection",this.handleNodeSelection),this.addEventListener("focus",()=>{this.focusIndex==-1&&this.matches(":focus-visible")&&(this.focusIndex=this.normalizeIndex(0))}),this._nodeStates.size===0&&(this.children.length>0?this.syncState():this.requestData())}updated(e){super.updated(e),this.updateNodes(),e.has("parentSelectionAllowed")&&this.updateParentSelectionAllowed()}render(){return this.updateRenderData(),c`
125
+ <div class="root" style="height: ${this._allNodeCount*V}px">
126
126
  <ul>
127
127
  <slot></slot>
128
128
  </ul>
129
129
  </div>
130
- `}scrollToNode(t,e="auto"){this.scrollTop=at(this.normalizeIndex(t),e,this.scrollTop,j,this.height,this._allNodeCount)}updateNodeMap(t,e){t&&(t.nodeGetter=this.nodeGetter,t.getSiblings=()=>e,this._nodeStates.set(JSON.stringify(t.path),t),t.nodes.forEach((s,i)=>{let o=[...t.nodes];o.splice(i,1),this.updateNodeMap(s,o)}))}updateParentSelectionAllowed(){this._nodeStates.forEach(t=>{t.parentSelectionAllowed=this.parentSelectionAllowed})}updateNodes(){let t=this._flattenedNodes.slice(this._firstRenderedIndex,this._lastRenderedIndex+1);he(c`
131
- ${t.map((e,s)=>{let i=s+this._firstRenderedIndex,o=this.getTopPosition(i);if(!$(e))return c`
132
- <sd-tree-loading-indicator .depth="${e.depth}" style="transform: translateY(${o}px)"
130
+ `}scrollToNode(e,t="auto"){this.scrollTop=ee(this.normalizeIndex(e),t,this.scrollTop,V,this.height,this._allNodeCount)}updateNodeMap(e,t){e&&(e.nodeGetter=this.nodeGetter,e.getSiblings=()=>t,this._nodeStates.set(JSON.stringify(e.path),e),e.nodes.forEach((s,i)=>{let o=[...e.nodes];o.splice(i,1),this.updateNodeMap(s,o)}))}updateParentSelectionAllowed(){this._nodeStates.forEach(e=>{e.parentSelectionAllowed=this.parentSelectionAllowed})}updateNodes(){let e=this._flattenedNodes.slice(this._firstRenderedIndex,this._lastRenderedIndex+1);ct(c`
131
+ ${e.map((t,s)=>{let i=s+this._firstRenderedIndex,o=this.getTopPosition(i);if(!_(t))return c`
132
+ <sd-tree-loading-indicator .depth="${t.depth}" style="transform: translateY(${o}px)"
133
133
  >${this.loadingText}</sd-tree-loading-indicator
134
134
  >
135
- `;let n=this._nodeStates.get(e),r=i===this.focusIndex,l=n.disabled;return this.parentSelectionAllowed||(l=l||n.hasRadioButtonDescendant()),c`
135
+ `;let n=this._nodeStates.get(t),r=i===this.focusIndex,h=n.disabled;return this.parentSelectionAllowed||(h=h||n.hasRadioButtonDescendant()),c`
136
136
  <sd-tree-node
137
137
  text="${n.text}"
138
138
  selection-state="${n.selectionState}"
@@ -145,11 +145,11 @@ var window;(window||={})["@cas-smartdesign/tree"]=(()=>{var ge=Object.defineProp
145
145
  type="${n.type}"
146
146
  ?expanded="${n.expanded}"
147
147
  child-count="${n.childCount}"
148
- ?disabled="${l}"
148
+ ?disabled="${h}"
149
149
  .loading="${n.loading}"
150
150
  ></sd-tree-node>
151
151
  `})}
152
- `,this)}getTopPosition(t){return t*j}updateRenderData(){if(!this._reusePreviousRenderData)if(this._lastRenderedScrollTop=this.scrollTop,this._visibleItemsNum=Math.min(Math.ceil(this.height/j),this._allNodeCount),this._visibleItemsNum>0){this._firstVisibleIndex=this.normalizeIndex(Math.floor(this._lastRenderedScrollTop/j)),this._lastVisibleIndex=this.normalizeIndex(this._firstVisibleIndex+this._visibleItemsNum),this._firstRenderedIndex=this.normalizeIndex(this._firstVisibleIndex-2),this._lastRenderedIndex=this.normalizeIndex(this._lastVisibleIndex+2);for(let t of this._flattenedNodes.slice(this._firstRenderedIndex,this._lastRenderedIndex+1)){let e=$(t)&&this._nodeStates.get(t);if(e){if(e.lastLoadingChild){let s=e.parentNode;if(s){if(this.needsFurtherData(s)){this.requestData(s);break}}else if(this._loadedRootNodeCount<this.rootNodeCount&&!this._rootItemsLoading){this.requestData();break}}else if(this.needsFurtherData(e)){this.requestData(e);break}}}}else this._firstVisibleIndex=0,this._lastVisibleIndex=0,this._firstRenderedIndex=0,this._lastRenderedIndex=0}needsFurtherData(t){return t.expanded&&t.childCount>t.nodes.length&&this.nodeIndex(t.id)+t.nodes.length<this._lastRenderedIndex}nodeIndex(t){return this._flattenedNodes.findIndex(e=>e===t)}normalizeIndex(t){return Math.max(0,Math.min(t,this._allNodeCount-1))}get height(){return this.offsetHeight}requestData(t){if(!(t!=null&&t.loading)){let e=t?.path;this.startLoadingIndicator(e),this.dispatchEvent(new CustomEvent("data-request",{detail:{path:e}}))}}updateAfterExpansion(t,e){let s=this._nodeStates.get(JSON.stringify(t));if(s){s.expanded=e;let i=q(this._flattenedNodes,t),o=this._flattenedNodes[this.focusIndex];if(e){let n=this.addSubtree(s,i+1),r=s.childCount>s.nodes.length,l=i+s.nodes.length<this._lastRenderedIndex;r&&l&&this.requestData(s),this._allNodeCount+=n}else{let n=this.removeSubtree(i);this._allNodeCount-=n}if(o){let n=this._flattenedNodes.findIndex(r=>r==o);n!==this.focusIndex&&(this._focusIndex=n)}}this.requestUpdate()}addSubtree(t,e){let s=this.getFlattenedSubtree(t.nodes);return this._flattenedNodes.splice(e,0,...s),s.length}getFlattenedSubtree(t){return t.reduce((e,s)=>e.concat(s&&s.childCount>0&&s.expanded?[JSON.stringify(s.path),...this.getFlattenedSubtree(s.nodes)]:JSON.stringify(s.path)),[])}removeSubtree(t){let e=this.getNextNonDescendantIndex(t),s=0;return e!==-1?(s=e-t-1,this._flattenedNodes.splice(t+1,s)):(s=this._flattenedNodes.length-t-1,this._flattenedNodes.splice(t+1)),s}getNextNonDescendantIndex(t){let e=this._flattenedNodes[t],s=$(e)&&this._nodeStates.get(e);if(s)for(let i=t+1;i<this._flattenedNodes.length;i++){let o=this._flattenedNodes[i],n=$(o)&&this._nodeStates.get(o);if(n&&n.path.length<=s.path.length)return i}return-1}get focusedNode(){let t=this._flattenedNodes[this.focusIndex];return $(t)&&this._nodeStates.get(t)}toggleSelection(t){this.nodeGetter(t).toggle(),this.requestUpdate()}updateFlattenedNodes(t,e){if(e){let s=q(this._flattenedNodes,e),i=this._flattenedNodes[s];if($(i)){let o=this._nodeStates.get(i);if(o){let n=s+o.nodes.length+1,r=o.depth,l=te(t,1/0,r+1).map(this.getFlattenedNodeId);o.expanded&&this._flattenedNodes.splice(n,0,...l),o.nodes=[...o.nodes,...t],o.loading=!1,this.updateLastLoadingChild(o.nodes,l)}}}else{let s=te(t,1/0).map(this.getFlattenedNodeId);this.updateLastLoadingChild(this._flattenedNodes,s),this._flattenedNodes=[...this._flattenedNodes,...s]}}updateLastLoadingChild(t,e){let s=t[t.length-1],i=$(s)&&this._nodeStates.get(s),o=e[e.length-1],n=$(o)&&this._nodeStates.get(o);if(i&&(i.lastLoadingChild=!1),n){let r=n.parentNode;(r&&r.childCount>r.nodes.length||!r&&this.rootNodeCount>this._loadedRootNodeCount)&&(n.lastLoadingChild=!0)}}setLastLoadingChildren(t,e,s){if(s<e){let i=t[t.length-1];i&&(i.lastLoadingChild=!0)}t.forEach(i=>{this.setLastLoadingChildren(i.nodes,i.childCount,i.nodes.length)})}startLoadingIndicator(t){if(t){let e=this._nodeStates.get(JSON.stringify(t));if(e){let s=q(this._flattenedNodes,t);e.loading=!0,this.addPlaceholders(s,e)}}else this._rootItemsLoading=!0,this._flattenedNodes=[...this._flattenedNodes,...new Array(this.rootNodeCount-this._loadedRootNodeCount).fill({depth:0})];this.updateNodes()}addPlaceholders(t,e){let s=t+e.nodes.length+1,i=e.childCount-e.nodes.length;this._flattenedNodes.splice(s,0,...new Array(i).fill({depth:e.depth+1}))}stopLoadingIndicator(t){if(t){let e=this._nodeStates.get(JSON.stringify(t));if(e&&(e.loading=!1,e.expanded)){let s=q(this._flattenedNodes,t);this.removePlaceHolders(s,e)}}else{this._rootItemsLoading=!1;let e=this._flattenedNodes.findIndex(s=>!$(s));this._flattenedNodes.splice(e)}}removePlaceHolders(t,e){let s=t+e.nodes.length+1,i=e.childCount-e.nodes.length;this._flattenedNodes.splice(s,i)}syncState(){let t=[...this.children].map(e=>e.getState());this.addNodes(t),this.rootNodeCount=t.length,this.innerHTML=""}updateCount(t){this._allNodeCount=t.length+this.getNodeCount(t)}getNodeCount(t){let e=0;return t.forEach(s=>{s.expanded&&(e+=s.childCount+this.getNodeCount(s.nodes))}),e}},T.ID="sd-tree",T.ensureDefined=()=>{jt.ensureDefined(),Gt.ensureDefined(),customElements.get(T.ID)||customElements.define(T.ID,T)},T);ie([d({type:String})],K.prototype,"loadingText",2);ie([d({type:Boolean,reflect:!0,attribute:"parent-selection-allowed"})],K.prototype,"parentSelectionAllowed",2);ie([d({type:Boolean,reflect:!0,attribute:!0})],K.prototype,"readonly",2);ie([d({type:Number})],K.prototype,"rootNodeCount",1);ie([d({type:Number,attribute:"focus-index",reflect:!0})],K.prototype,"focusIndex",1);var dt=K;dt.ensureDefined();return gt(Xt);})();
152
+ `,this)}getTopPosition(e){return e*V}updateRenderData(){if(!this._reusePreviousRenderData)if(this._lastRenderedScrollTop=this.scrollTop,this._visibleItemsNum=Math.min(Math.ceil(this.height/V),this._allNodeCount),this._visibleItemsNum>0){this._firstVisibleIndex=this.normalizeIndex(Math.floor(this._lastRenderedScrollTop/V)),this._lastVisibleIndex=this.normalizeIndex(this._firstVisibleIndex+this._visibleItemsNum),this._firstRenderedIndex=this.normalizeIndex(this._firstVisibleIndex-2),this._lastRenderedIndex=this.normalizeIndex(this._lastVisibleIndex+2);for(let e of this._flattenedNodes.slice(this._firstRenderedIndex,this._lastRenderedIndex+1)){let t=_(e)&&this._nodeStates.get(e);if(t){if(t.lastLoadingChild){let s=t.parentNode;if(s){if(this.needsFurtherData(s)){this.requestData(s);break}}else if(this._loadedRootNodeCount<this.rootNodeCount&&!this._rootItemsLoading){this.requestData();break}}else if(this.needsFurtherData(t)){this.requestData(t);break}}}}else this._firstVisibleIndex=0,this._lastVisibleIndex=0,this._firstRenderedIndex=0,this._lastRenderedIndex=0}needsFurtherData(e){return e.expanded&&e.childCount>e.nodes.length&&this.nodeIndex(e.id)+e.nodes.length<this._lastRenderedIndex}nodeIndex(e){return this._flattenedNodes.findIndex(t=>t===e)}normalizeIndex(e){return Math.max(0,Math.min(e,this._allNodeCount-1))}get height(){return this.offsetHeight}requestData(e){if(!e?.loading){let t=e?.path;this.startLoadingIndicator(t),this.dispatchEvent(new CustomEvent("data-request",{detail:{path:t}}))}}updateAfterExpansion(e,t){let s=this._nodeStates.get(JSON.stringify(e));if(s){s.expanded=t;let i=q(this._flattenedNodes,e),o=this._flattenedNodes[this.focusIndex];if(t){let n=this.addSubtree(s,i+1),r=s.childCount>s.nodes.length,h=i+s.nodes.length<this._lastRenderedIndex;r&&h&&this.requestData(s),this._allNodeCount+=n}else{let n=this.removeSubtree(i);this._allNodeCount-=n}if(o){let n=this._flattenedNodes.findIndex(r=>r==o);n!==this.focusIndex&&(this._focusIndex=n)}}this.requestUpdate()}addSubtree(e,t){let s=this.getFlattenedSubtree(e.nodes);return this._flattenedNodes.splice(t,0,...s),s.length}getFlattenedSubtree(e){return e.reduce((t,s)=>t.concat(s&&s.childCount>0&&s.expanded?[JSON.stringify(s.path),...this.getFlattenedSubtree(s.nodes)]:JSON.stringify(s.path)),[])}removeSubtree(e){let t=this.getNextNonDescendantIndex(e),s=0;return t!==-1?(s=t-e-1,this._flattenedNodes.splice(e+1,s)):(s=this._flattenedNodes.length-e-1,this._flattenedNodes.splice(e+1)),s}getNextNonDescendantIndex(e){let t=this._flattenedNodes[e],s=_(t)&&this._nodeStates.get(t);if(s)for(let i=e+1;i<this._flattenedNodes.length;i++){let o=this._flattenedNodes[i],n=_(o)&&this._nodeStates.get(o);if(n&&n.path.length<=s.path.length)return i}return-1}get focusedNode(){let e=this._flattenedNodes[this.focusIndex];return _(e)&&this._nodeStates.get(e)}toggleSelection(e){this.nodeGetter(e).toggle(),this.requestUpdate()}updateFlattenedNodes(e,t){if(t){let s=q(this._flattenedNodes,t),i=this._flattenedNodes[s];if(_(i)){let o=this._nodeStates.get(i);if(o){let n=s+o.nodes.length+1,r=o.depth,h=st(e,1/0,r+1).map(this.getFlattenedNodeId);o.expanded&&this._flattenedNodes.splice(n,0,...h),o.nodes=[...o.nodes,...e],o.loading=!1,this.updateLastLoadingChild(o.nodes,h)}}}else{let s=st(e,1/0).map(this.getFlattenedNodeId);this.updateLastLoadingChild(this._flattenedNodes,s),this._flattenedNodes=[...this._flattenedNodes,...s]}}updateLastLoadingChild(e,t){let s=e[e.length-1],i=_(s)&&this._nodeStates.get(s),o=t[t.length-1],n=_(o)&&this._nodeStates.get(o);if(i&&(i.lastLoadingChild=!1),n){let r=n.parentNode;(r&&r.childCount>r.nodes.length||!r&&this.rootNodeCount>this._loadedRootNodeCount)&&(n.lastLoadingChild=!0)}}setLastLoadingChildren(e,t,s){if(s<t){let i=e[e.length-1];i&&(i.lastLoadingChild=!0)}e.forEach(i=>{this.setLastLoadingChildren(i.nodes,i.childCount,i.nodes.length)})}startLoadingIndicator(e){if(e){let t=this._nodeStates.get(JSON.stringify(e));if(t){let s=q(this._flattenedNodes,e);t.loading=!0,this.addPlaceholders(s,t)}}else this._rootItemsLoading=!0,this._flattenedNodes=[...this._flattenedNodes,...new Array(this.rootNodeCount-this._loadedRootNodeCount).fill({depth:0})];this.updateNodes()}addPlaceholders(e,t){let s=e+t.nodes.length+1,i=t.childCount-t.nodes.length;this._flattenedNodes.splice(s,0,...new Array(i).fill({depth:t.depth+1}))}stopLoadingIndicator(e){if(e){let t=this._nodeStates.get(JSON.stringify(e));if(t&&(t.loading=!1,t.expanded)){let s=q(this._flattenedNodes,e);this.removePlaceHolders(s,t)}}else{this._rootItemsLoading=!1;let t=this._flattenedNodes.findIndex(s=>!_(s));this._flattenedNodes.splice(t)}}removePlaceHolders(e,t){let s=e+t.nodes.length+1,i=t.childCount-t.nodes.length;this._flattenedNodes.splice(s,i)}syncState(){let e=[...this.children].map(t=>t.getState());this.addNodes(e),this.rootNodeCount=e.length,this.innerHTML=""}updateCount(e){this._allNodeCount=e.length+this.getNodeCount(e)}getNodeCount(e){let t=0;return e.forEach(s=>{s.expanded&&(t+=s.childCount+this.getNodeCount(s.nodes))}),t}},T.ID="sd-tree",T.ensureDefined=()=>{He.ensureDefined(),qe.ensureDefined(),customElements.get(T.ID)||customElements.define(T.ID,T)},T);ot([a({type:String})],j.prototype,"loadingText",2);ot([a({type:Boolean,reflect:!0,attribute:"parent-selection-allowed"})],j.prototype,"parentSelectionAllowed",2);ot([a({type:Boolean,reflect:!0,attribute:!0})],j.prototype,"readonly",2);ot([a({type:Number})],j.prototype,"rootNodeCount",1);ot([a({type:Number,attribute:"focus-index",reflect:!0})],j.prototype,"focusIndex",1);var se=j;se.ensureDefined();return de(Ge);})();
153
153
  /*! Bundled license information:
154
154
 
155
155
  @lit/reactive-element/css-tag.js:
@@ -160,20 +160,9 @@ var window;(window||={})["@cas-smartdesign/tree"]=(()=>{var ge=Object.defineProp
160
160
  *)
161
161
 
162
162
  @lit/reactive-element/reactive-element.js:
163
- (**
164
- * @license
165
- * Copyright 2017 Google LLC
166
- * SPDX-License-Identifier: BSD-3-Clause
167
- *)
168
-
169
163
  lit-html/lit-html.js:
170
- (**
171
- * @license
172
- * Copyright 2017 Google LLC
173
- * SPDX-License-Identifier: BSD-3-Clause
174
- *)
175
-
176
164
  lit-element/lit-element.js:
165
+ @lit/reactive-element/decorators/property.js:
177
166
  (**
178
167
  * @license
179
168
  * Copyright 2017 Google LLC
@@ -187,13 +176,6 @@ lit-html/is-server.js:
187
176
  * SPDX-License-Identifier: BSD-3-Clause
188
177
  *)
189
178
 
190
- @lit/reactive-element/decorators/property.js:
191
- (**
192
- * @license
193
- * Copyright 2017 Google LLC
194
- * SPDX-License-Identifier: BSD-3-Clause
195
- *)
196
-
197
179
  lit-html/directives/if-defined.js:
198
180
  (**
199
181
  * @license