@kodaris/krubble-components 1.0.53 → 1.0.54

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.
@@ -3,23 +3,23 @@
3
3
  * @license
4
4
  * Copyright 2019 Google LLC
5
5
  * SPDX-License-Identifier: BSD-3-Clause
6
- */const t=globalThis,i=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),o=new WeakMap;let r=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(i&&void 0===e){const i=void 0!==t&&1===t.length;i&&(e=o.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&o.set(t,e))}return e}toString(){return this.cssText}};const a=(e,...t)=>{const i=1===e.length?e[0]:t.reduce(((t,i,s)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+e[s+1]),e[0]);return new r(i,e,s)},l=i?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return(e=>new r("string"==typeof e?e:e+"",void 0,s))(t)})(e):e
6
+ */const t=globalThis,i=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),o=new WeakMap;let r=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(i&&void 0===e){const i=void 0!==t&&1===t.length;i&&(e=o.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&o.set(t,e))}return e}toString(){return this.cssText}};const l=(e,...t)=>{const i=1===e.length?e[0]:t.reduce(((t,i,s)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+e[s+1]),e[0]);return new r(i,e,s)},a=i?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return(e=>new r("string"==typeof e?e:e+"",void 0,s))(t)})(e):e
7
7
  /**
8
8
  * @license
9
9
  * Copyright 2017 Google LLC
10
10
  * SPDX-License-Identifier: BSD-3-Clause
11
- */,{is:n,defineProperty:d,getOwnPropertyDescriptor:c,getOwnPropertyNames:h,getOwnPropertySymbols:p,getPrototypeOf:u}=Object,f=globalThis,g=f.trustedTypes,b=g?g.emptyScript:"",v=f.reactiveElementPolyfillSupport,m=(e,t)=>e,_={toAttribute(e,t){switch(t){case Boolean:e=e?b:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},y=(e,t)=>!n(e,t),x={attribute:!0,type:String,converter:_,reflect:!1,useDefault:!1,hasChanged:y};Symbol.metadata??=Symbol("metadata"),f.litPropertyMetadata??=new WeakMap;let k=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=x){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(e,i,t);void 0!==s&&d(this.prototype,e,s)}}static getPropertyDescriptor(e,t,i){const{get:s,set:o}=c(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:s,set(t){const r=s?.call(this);o?.call(this,t),this.requestUpdate(e,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??x}static _$Ei(){if(this.hasOwnProperty(m("elementProperties")))return;const e=u(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(m("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(m("properties"))){const e=this.properties,t=[...h(e),...p(e)];for(const i of t)this.createProperty(i,e[i])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,i]of t)this.elementProperties.set(e,i)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const i=this._$Eu(e,t);void 0!==i&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const e of i)t.unshift(l(e))}else void 0!==e&&t.push(l(e));return t}static _$Eu(e,t){const i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.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((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,s)=>{if(i)e.adoptedStyleSheets=s.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const i of s){const s=document.createElement("style"),o=t.litNonce;void 0!==o&&s.setAttribute("nonce",o),s.textContent=i.cssText,e.appendChild(s)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$ET(e,t){const i=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,i);if(void 0!==s&&!0===i.reflect){const o=(void 0!==i.converter?.toAttribute?i.converter:_).toAttribute(t,i.type);this._$Em=e,null==o?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(e,t){const i=this.constructor,s=i._$Eh.get(e);if(void 0!==s&&this._$Em!==s){const e=i.getPropertyOptions(s),o="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:_;this._$Em=s;const r=o.fromAttribute(t,e.type);this[s]=r??this._$Ej?.get(s)??r,this._$Em=null}}requestUpdate(e,t,i,s=!1,o){if(void 0!==e){const r=this.constructor;if(!1===s&&(o=this[e]),i??=r.getPropertyOptions(e),!((i.hasChanged??y)(o,t)||i.useDefault&&i.reflect&&o===this._$Ej?.get(e)&&!this.hasAttribute(r._$Eu(e,i))))return;this.C(e,t,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:s,wrapped:o},r){i&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,r??t??this[e]),!0!==o||void 0!==r)||(this._$AL.has(e)||(this.hasUpdated||i||(t=void 0),this._$AL.set(e,t)),!0===s&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,i]of e){const{wrapped:e}=i,s=this[t];!0!==e||this._$AL.has(t)||void 0===s||this.C(t,void 0,i,s)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach((e=>this._$ET(e,this[e]))),this._$EM()}updated(e){}firstUpdated(e){}};k.elementStyles=[],k.shadowRootOptions={mode:"open"},k[m("elementProperties")]=new Map,k[m("finalized")]=new Map,v?.({ReactiveElement:k}),(f.reactiveElementVersions??=[]).push("2.1.2");
11
+ */,{is:n,defineProperty:d,getOwnPropertyDescriptor:h,getOwnPropertyNames:c,getOwnPropertySymbols:p,getPrototypeOf:u}=Object,f=globalThis,g=f.trustedTypes,b=g?g.emptyScript:"",v=f.reactiveElementPolyfillSupport,_=(e,t)=>e,m={toAttribute(e,t){switch(t){case Boolean:e=e?b:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},y=(e,t)=>!n(e,t),x={attribute:!0,type:String,converter:m,reflect:!1,useDefault:!1,hasChanged:y};Symbol.metadata??=Symbol("metadata"),f.litPropertyMetadata??=new WeakMap;let k=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=x){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(e,i,t);void 0!==s&&d(this.prototype,e,s)}}static getPropertyDescriptor(e,t,i){const{get:s,set:o}=h(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:s,set(t){const r=s?.call(this);o?.call(this,t),this.requestUpdate(e,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??x}static _$Ei(){if(this.hasOwnProperty(_("elementProperties")))return;const e=u(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(_("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(_("properties"))){const e=this.properties,t=[...c(e),...p(e)];for(const i of t)this.createProperty(i,e[i])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,i]of t)this.elementProperties.set(e,i)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const i=this._$Eu(e,t);void 0!==i&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const e of i)t.unshift(a(e))}else void 0!==e&&t.push(a(e));return t}static _$Eu(e,t){const i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.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((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,s)=>{if(i)e.adoptedStyleSheets=s.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const i of s){const s=document.createElement("style"),o=t.litNonce;void 0!==o&&s.setAttribute("nonce",o),s.textContent=i.cssText,e.appendChild(s)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$ET(e,t){const i=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,i);if(void 0!==s&&!0===i.reflect){const o=(void 0!==i.converter?.toAttribute?i.converter:m).toAttribute(t,i.type);this._$Em=e,null==o?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(e,t){const i=this.constructor,s=i._$Eh.get(e);if(void 0!==s&&this._$Em!==s){const e=i.getPropertyOptions(s),o="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:m;this._$Em=s;const r=o.fromAttribute(t,e.type);this[s]=r??this._$Ej?.get(s)??r,this._$Em=null}}requestUpdate(e,t,i,s=!1,o){if(void 0!==e){const r=this.constructor;if(!1===s&&(o=this[e]),i??=r.getPropertyOptions(e),!((i.hasChanged??y)(o,t)||i.useDefault&&i.reflect&&o===this._$Ej?.get(e)&&!this.hasAttribute(r._$Eu(e,i))))return;this.C(e,t,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:s,wrapped:o},r){i&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,r??t??this[e]),!0!==o||void 0!==r)||(this._$AL.has(e)||(this.hasUpdated||i||(t=void 0),this._$AL.set(e,t)),!0===s&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,i]of e){const{wrapped:e}=i,s=this[t];!0!==e||this._$AL.has(t)||void 0===s||this.C(t,void 0,i,s)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach((e=>this._$ET(e,this[e]))),this._$EM()}updated(e){}firstUpdated(e){}};k.elementStyles=[],k.shadowRootOptions={mode:"open"},k[_("elementProperties")]=new Map,k[_("finalized")]=new Map,v?.({ReactiveElement:k}),(f.reactiveElementVersions??=[]).push("2.1.2");
12
12
  /**
13
13
  * @license
14
14
  * Copyright 2017 Google LLC
15
15
  * SPDX-License-Identifier: BSD-3-Clause
16
16
  */
17
- const w=globalThis,$=w.trustedTypes,S=$?$.createPolicy("lit-html",{createHTML:e=>e}):void 0,C="$lit$",R=`lit$${Math.random().toFixed(9).slice(2)}$`,T="?"+R,E=`<${T}>`,z=document,O=()=>z.createComment(""),A=e=>null===e||"object"!=typeof e&&"function"!=typeof e,K=Array.isArray,P="[ \t\n\f\r]",D=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,L=/-->/g,M=/>/g,I=RegExp(`>|${P}(?:([^\\s"'>=/]+)(${P}*=${P}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),q=/'/g,F=/"/g,H=/^(?:script|style|textarea|title)$/i,j=(e=>(t,...i)=>({_$litType$:e,strings:t,values:i}))(1),B=Symbol.for("lit-noChange"),V=Symbol.for("lit-nothing"),U=new WeakMap,N=z.createTreeWalker(z,129);function W(e,t){if(!K(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==S?S.createHTML(t):t}const X=(e,t)=>{const i=e.length-1,s=[];let o,r=2===t?"<svg>":3===t?"<math>":"",a=D;for(let t=0;t<i;t++){const i=e[t];let l,n,d=-1,c=0;for(;c<i.length&&(a.lastIndex=c,n=a.exec(i),null!==n);)c=a.lastIndex,a===D?"!--"===n[1]?a=L:void 0!==n[1]?a=M:void 0!==n[2]?(H.test(n[2])&&(o=RegExp("</"+n[2],"g")),a=I):void 0!==n[3]&&(a=I):a===I?">"===n[0]?(a=o??D,d=-1):void 0===n[1]?d=-2:(d=a.lastIndex-n[2].length,l=n[1],a=void 0===n[3]?I:'"'===n[3]?F:q):a===F||a===q?a=I:a===L||a===M?a=D:(a=I,o=void 0);const h=a===I&&e[t+1].startsWith("/>")?" ":"";r+=a===D?i+E:d>=0?(s.push(l),i.slice(0,d)+C+i.slice(d)+R+h):i+R+(-2===d?t:h)}return[W(e,r+(e[i]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),s]};class Y{constructor({strings:e,_$litType$:t},i){let s;this.parts=[];let o=0,r=0;const a=e.length-1,l=this.parts,[n,d]=X(e,t);if(this.el=Y.createElement(n,i),N.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(s=N.nextNode())&&l.length<a;){if(1===s.nodeType){if(s.hasAttributes())for(const e of s.getAttributeNames())if(e.endsWith(C)){const t=d[r++],i=s.getAttribute(e).split(R),a=/([.?@])?(.*)/.exec(t);l.push({type:1,index:o,name:a[2],strings:i,ctor:"."===a[1]?ee:"?"===a[1]?te:"@"===a[1]?ie:J}),s.removeAttribute(e)}else e.startsWith(R)&&(l.push({type:6,index:o}),s.removeAttribute(e));if(H.test(s.tagName)){const e=s.textContent.split(R),t=e.length-1;if(t>0){s.textContent=$?$.emptyScript:"";for(let i=0;i<t;i++)s.append(e[i],O()),N.nextNode(),l.push({type:2,index:++o});s.append(e[t],O())}}}else if(8===s.nodeType)if(s.data===T)l.push({type:2,index:o});else{let e=-1;for(;-1!==(e=s.data.indexOf(R,e+1));)l.push({type:7,index:o}),e+=R.length-1}o++}}static createElement(e,t){const i=z.createElement("template");return i.innerHTML=e,i}}function Z(e,t,i=e,s){if(t===B)return t;let o=void 0!==s?i._$Co?.[s]:i._$Cl;const r=A(t)?void 0:t._$litDirective$;return o?.constructor!==r&&(o?._$AO?.(!1),void 0===r?o=void 0:(o=new r(e),o._$AT(e,i,s)),void 0!==s?(i._$Co??=[])[s]=o:i._$Cl=o),void 0!==o&&(t=Z(e,o._$AS(e,t.values),o,s)),t}class G{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:i}=this._$AD,s=(e?.creationScope??z).importNode(t,!0);N.currentNode=s;let o=N.nextNode(),r=0,a=0,l=i[0];for(;void 0!==l;){if(r===l.index){let t;2===l.type?t=new Q(o,o.nextSibling,this,e):1===l.type?t=new l.ctor(o,l.name,l.strings,this,e):6===l.type&&(t=new se(o,this,e)),this._$AV.push(t),l=i[++a]}r!==l?.index&&(o=N.nextNode(),r++)}return N.currentNode=z,s}p(e){let t=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}}class Q{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,s){this.type=2,this._$AH=V,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Z(this,e,t),A(e)?e===V||null==e||""===e?(this._$AH!==V&&this._$AR(),this._$AH=V):e!==this._$AH&&e!==B&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>K(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==V&&A(this._$AH)?this._$AA.nextSibling.data=e:this.T(z.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:i}=e,s="number"==typeof i?this._$AC(e):(void 0===i.el&&(i.el=Y.createElement(W(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(t);else{const e=new G(s,this),i=e.u(this.options);e.p(t),this.T(i),this._$AH=e}}_$AC(e){let t=U.get(e.strings);return void 0===t&&U.set(e.strings,t=new Y(e)),t}k(e){K(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,s=0;for(const o of e)s===t.length?t.push(i=new Q(this.O(O()),this.O(O()),this,this.options)):i=t[s],i._$AI(o),s++;s<t.length&&(this._$AR(i&&i._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class J{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,s,o){this.type=1,this._$AH=V,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=o,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=V}_$AI(e,t=this,i,s){const o=this.strings;let r=!1;if(void 0===o)e=Z(this,e,t,0),r=!A(e)||e!==this._$AH&&e!==B,r&&(this._$AH=e);else{const s=e;let a,l;for(e=o[0],a=0;a<o.length-1;a++)l=Z(this,s[i+a],t,a),l===B&&(l=this._$AH[a]),r||=!A(l)||l!==this._$AH[a],l===V?e=V:e!==V&&(e+=(l??"")+o[a+1]),this._$AH[a]=l}r&&!s&&this.j(e)}j(e){e===V?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class ee extends J{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===V?void 0:e}}class te extends J{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==V)}}class ie extends J{constructor(e,t,i,s,o){super(e,t,i,s,o),this.type=5}_$AI(e,t=this){if((e=Z(this,e,t,0)??V)===B)return;const i=this._$AH,s=e===V&&i!==V||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,o=e!==V&&(i===V||s);s&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class se{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){Z(this,e)}}const oe=w.litHtmlPolyfillSupport;oe?.(Y,Q),(w.litHtmlVersions??=[]).push("3.3.2");const re=(e,t,i)=>{const s=i?.renderBefore??t;let o=s._$litPart$;if(void 0===o){const e=i?.renderBefore??null;s._$litPart$=o=new Q(t.insertBefore(O(),e),e,void 0,i??{})}return o._$AI(e),o
17
+ const w=globalThis,$=w.trustedTypes,C=$?$.createPolicy("lit-html",{createHTML:e=>e}):void 0,S="$lit$",R=`lit$${Math.random().toFixed(9).slice(2)}$`,T="?"+R,E=`<${T}>`,z=document,O=()=>z.createComment(""),K=e=>null===e||"object"!=typeof e&&"function"!=typeof e,A=Array.isArray,P="[ \t\n\f\r]",D=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,I=/-->/g,L=/>/g,q=RegExp(`>|${P}(?:([^\\s"'>=/]+)(${P}*=${P}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),M=/'/g,H=/"/g,F=/^(?:script|style|textarea|title)$/i,B=(e=>(t,...i)=>({_$litType$:e,strings:t,values:i}))(1),j=Symbol.for("lit-noChange"),V=Symbol.for("lit-nothing"),U=new WeakMap,N=z.createTreeWalker(z,129);function W(e,t){if(!A(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==C?C.createHTML(t):t}const X=(e,t)=>{const i=e.length-1,s=[];let o,r=2===t?"<svg>":3===t?"<math>":"",l=D;for(let t=0;t<i;t++){const i=e[t];let a,n,d=-1,h=0;for(;h<i.length&&(l.lastIndex=h,n=l.exec(i),null!==n);)h=l.lastIndex,l===D?"!--"===n[1]?l=I:void 0!==n[1]?l=L:void 0!==n[2]?(F.test(n[2])&&(o=RegExp("</"+n[2],"g")),l=q):void 0!==n[3]&&(l=q):l===q?">"===n[0]?(l=o??D,d=-1):void 0===n[1]?d=-2:(d=l.lastIndex-n[2].length,a=n[1],l=void 0===n[3]?q:'"'===n[3]?H:M):l===H||l===M?l=q:l===I||l===L?l=D:(l=q,o=void 0);const c=l===q&&e[t+1].startsWith("/>")?" ":"";r+=l===D?i+E:d>=0?(s.push(a),i.slice(0,d)+S+i.slice(d)+R+c):i+R+(-2===d?t:c)}return[W(e,r+(e[i]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),s]};class Y{constructor({strings:e,_$litType$:t},i){let s;this.parts=[];let o=0,r=0;const l=e.length-1,a=this.parts,[n,d]=X(e,t);if(this.el=Y.createElement(n,i),N.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(s=N.nextNode())&&a.length<l;){if(1===s.nodeType){if(s.hasAttributes())for(const e of s.getAttributeNames())if(e.endsWith(S)){const t=d[r++],i=s.getAttribute(e).split(R),l=/([.?@])?(.*)/.exec(t);a.push({type:1,index:o,name:l[2],strings:i,ctor:"."===l[1]?ee:"?"===l[1]?te:"@"===l[1]?ie:J}),s.removeAttribute(e)}else e.startsWith(R)&&(a.push({type:6,index:o}),s.removeAttribute(e));if(F.test(s.tagName)){const e=s.textContent.split(R),t=e.length-1;if(t>0){s.textContent=$?$.emptyScript:"";for(let i=0;i<t;i++)s.append(e[i],O()),N.nextNode(),a.push({type:2,index:++o});s.append(e[t],O())}}}else if(8===s.nodeType)if(s.data===T)a.push({type:2,index:o});else{let e=-1;for(;-1!==(e=s.data.indexOf(R,e+1));)a.push({type:7,index:o}),e+=R.length-1}o++}}static createElement(e,t){const i=z.createElement("template");return i.innerHTML=e,i}}function Z(e,t,i=e,s){if(t===j)return t;let o=void 0!==s?i._$Co?.[s]:i._$Cl;const r=K(t)?void 0:t._$litDirective$;return o?.constructor!==r&&(o?._$AO?.(!1),void 0===r?o=void 0:(o=new r(e),o._$AT(e,i,s)),void 0!==s?(i._$Co??=[])[s]=o:i._$Cl=o),void 0!==o&&(t=Z(e,o._$AS(e,t.values),o,s)),t}class Q{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:i}=this._$AD,s=(e?.creationScope??z).importNode(t,!0);N.currentNode=s;let o=N.nextNode(),r=0,l=0,a=i[0];for(;void 0!==a;){if(r===a.index){let t;2===a.type?t=new G(o,o.nextSibling,this,e):1===a.type?t=new a.ctor(o,a.name,a.strings,this,e):6===a.type&&(t=new se(o,this,e)),this._$AV.push(t),a=i[++l]}r!==a?.index&&(o=N.nextNode(),r++)}return N.currentNode=z,s}p(e){let t=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}}class G{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,s){this.type=2,this._$AH=V,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Z(this,e,t),K(e)?e===V||null==e||""===e?(this._$AH!==V&&this._$AR(),this._$AH=V):e!==this._$AH&&e!==j&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>A(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==V&&K(this._$AH)?this._$AA.nextSibling.data=e:this.T(z.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:i}=e,s="number"==typeof i?this._$AC(e):(void 0===i.el&&(i.el=Y.createElement(W(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(t);else{const e=new Q(s,this),i=e.u(this.options);e.p(t),this.T(i),this._$AH=e}}_$AC(e){let t=U.get(e.strings);return void 0===t&&U.set(e.strings,t=new Y(e)),t}k(e){A(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,s=0;for(const o of e)s===t.length?t.push(i=new G(this.O(O()),this.O(O()),this,this.options)):i=t[s],i._$AI(o),s++;s<t.length&&(this._$AR(i&&i._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class J{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,s,o){this.type=1,this._$AH=V,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=o,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=V}_$AI(e,t=this,i,s){const o=this.strings;let r=!1;if(void 0===o)e=Z(this,e,t,0),r=!K(e)||e!==this._$AH&&e!==j,r&&(this._$AH=e);else{const s=e;let l,a;for(e=o[0],l=0;l<o.length-1;l++)a=Z(this,s[i+l],t,l),a===j&&(a=this._$AH[l]),r||=!K(a)||a!==this._$AH[l],a===V?e=V:e!==V&&(e+=(a??"")+o[l+1]),this._$AH[l]=a}r&&!s&&this.j(e)}j(e){e===V?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class ee extends J{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===V?void 0:e}}class te extends J{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==V)}}class ie extends J{constructor(e,t,i,s,o){super(e,t,i,s,o),this.type=5}_$AI(e,t=this){if((e=Z(this,e,t,0)??V)===j)return;const i=this._$AH,s=e===V&&i!==V||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,o=e!==V&&(i===V||s);s&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class se{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){Z(this,e)}}const oe=w.litHtmlPolyfillSupport;oe?.(Y,G),(w.litHtmlVersions??=[]).push("3.3.2");const re=(e,t,i)=>{const s=i?.renderBefore??t;let o=s._$litPart$;if(void 0===o){const e=i?.renderBefore??null;s._$litPart$=o=new G(t.insertBefore(O(),e),e,void 0,i??{})}return o._$AI(e),o
18
18
  /**
19
19
  * @license
20
20
  * Copyright 2017 Google LLC
21
21
  * SPDX-License-Identifier: BSD-3-Clause
22
- */},ae=globalThis;let le=class extends k{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=re(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return B}};le._$litElement$=!0,le.finalized=!0,ae.litElementHydrateSupport?.({LitElement:le});const ne=ae.litElementPolyfillSupport;ne?.({LitElement:le}),(ae.litElementVersions??=[]).push("4.2.2");const de=a`
22
+ */},le=globalThis;let ae=class extends k{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=re(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return j}};ae._$litElement$=!0,ae.finalized=!0,le.litElementHydrateSupport?.({LitElement:ae});const ne=le.litElementPolyfillSupport;ne?.({LitElement:ae}),(le.litElementVersions??=[]).push("4.2.2");const de=l`
23
23
  :host,
24
24
  *,
25
25
  *::before,
@@ -51,12 +51,12 @@ const w=globalThis,$=w.trustedTypes,S=$?$.createPolicy("lit-html",{createHTML:e=
51
51
  * @license
52
52
  * Copyright 2017 Google LLC
53
53
  * SPDX-License-Identifier: BSD-3-Clause
54
- */,ce=e=>(t,i)=>{void 0!==i?i.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)}
54
+ */,he=e=>(t,i)=>{void 0!==i?i.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)}
55
55
  /**
56
56
  * @license
57
57
  * Copyright 2017 Google LLC
58
58
  * SPDX-License-Identifier: BSD-3-Clause
59
- */,he={attribute:!0,type:String,converter:_,reflect:!1,hasChanged:y},pe=(e=he,t,i)=>{const{kind:s,metadata:o}=i;let r=globalThis.litPropertyMetadata.get(o);if(void 0===r&&globalThis.litPropertyMetadata.set(o,r=new Map),"setter"===s&&((e=Object.create(e)).wrapped=!0),r.set(i.name,e),"accessor"===s){const{name:s}=i;return{set(i){const o=t.get.call(this);t.set.call(this,i),this.requestUpdate(s,o,e,!0,i)},init(t){return void 0!==t&&this.C(s,void 0,e,t),t}}}if("setter"===s){const{name:s}=i;return function(i){const o=this[s];t.call(this,i),this.requestUpdate(s,o,e,!0,i)}}throw Error("Unsupported decorator location: "+s)};function ue(e){return(t,i)=>"object"==typeof i?pe(e,t,i):((e,t,i)=>{const s=t.hasOwnProperty(i);return t.constructor.createProperty(i,e),s?Object.getOwnPropertyDescriptor(t,i):void 0})(e,t,i)
59
+ */,ce={attribute:!0,type:String,converter:m,reflect:!1,hasChanged:y},pe=(e=ce,t,i)=>{const{kind:s,metadata:o}=i;let r=globalThis.litPropertyMetadata.get(o);if(void 0===r&&globalThis.litPropertyMetadata.set(o,r=new Map),"setter"===s&&((e=Object.create(e)).wrapped=!0),r.set(i.name,e),"accessor"===s){const{name:s}=i;return{set(i){const o=t.get.call(this);t.set.call(this,i),this.requestUpdate(s,o,e,!0,i)},init(t){return void 0!==t&&this.C(s,void 0,e,t),t}}}if("setter"===s){const{name:s}=i;return function(i){const o=this[s];t.call(this,i),this.requestUpdate(s,o,e,!0,i)}}throw Error("Unsupported decorator location: "+s)};function ue(e){return(t,i)=>"object"==typeof i?pe(e,t,i):((e,t,i)=>{const s=t.hasOwnProperty(i);return t.constructor.createProperty(i,e),s?Object.getOwnPropertyDescriptor(t,i):void 0})(e,t,i)
60
60
  /**
61
61
  * @license
62
62
  * Copyright 2017 Google LLC
@@ -72,7 +72,7 @@ const w=globalThis,$=w.trustedTypes,S=$?$.createPolicy("lit-html",{createHTML:e=
72
72
  * Copyright 2017 Google LLC
73
73
  * SPDX-License-Identifier: BSD-3-Clause
74
74
  */
75
- function ge(e,t){return(t,i,s)=>((e,t,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,i),i))(t,i,{get(){return(t=>t.renderRoot?.querySelector(e)??null)(this)}})}var be=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};e.KRAccordion=class extends le{constructor(){super(...arguments),this.header="",this.expanded=!1}toggle(){this.expanded=!this.expanded}render(){return j`
75
+ function ge(e,t){return(t,i,s)=>((e,t,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,i),i))(t,i,{get(){return(t=>t.renderRoot?.querySelector(e)??null)(this)}})}var be=function(e,t,i,s){var o,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(l=(r<3?o(l):r>3?o(t,i,l):o(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};e.KRAccordion=class extends ae{constructor(){super(...arguments),this.header="",this.expanded=!1}toggle(){this.expanded=!this.expanded}render(){return B`
76
76
  <div class="header" @click=${this.toggle}>
77
77
  <span class="header__title">${this.header}</span>
78
78
  <svg class="header__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
@@ -86,7 +86,7 @@ function ge(e,t){return(t,i,s)=>((e,t,i)=>(i.configurable=!0,i.enumerable=!0,Ref
86
86
  </div>
87
87
  </div>
88
88
  </div>
89
- `}},e.KRAccordion.styles=a`
89
+ `}},e.KRAccordion.styles=l`
90
90
  :host {
91
91
  display: block;
92
92
  margin-bottom: 16px;
@@ -138,30 +138,30 @@ function ge(e,t){return(t,i,s)=>((e,t,i)=>(i.configurable=!0,i.enumerable=!0,Ref
138
138
  .content__body {
139
139
  padding: 16px 16px 8px 16px;
140
140
  }
141
- `,be([ue({type:String})],e.KRAccordion.prototype,"header",void 0),be([ue({type:Boolean,reflect:!0})],e.KRAccordion.prototype,"expanded",void 0),e.KRAccordion=be([ce("kr-accordion")],e.KRAccordion);
141
+ `,be([ue({type:String})],e.KRAccordion.prototype,"header",void 0),be([ue({type:Boolean,reflect:!0})],e.KRAccordion.prototype,"expanded",void 0),e.KRAccordion=be([he("kr-accordion")],e.KRAccordion);
142
142
  /**
143
143
  * @license
144
144
  * Copyright 2017 Google LLC
145
145
  * SPDX-License-Identifier: BSD-3-Clause
146
146
  */
147
- const ve=1,me=2,_e=3,ye=4,xe=e=>(...t)=>({_$litDirective$:e,values:t});let ke=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};
147
+ const ve=1,_e=2,me=3,ye=4,xe=e=>(...t)=>({_$litDirective$:e,values:t});let ke=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};
148
148
  /**
149
149
  * @license
150
150
  * Copyright 2018 Google LLC
151
151
  * SPDX-License-Identifier: BSD-3-Clause
152
- */const we=xe(class extends ke{constructor(e){if(super(e),e.type!==ve||"class"!==e.name||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter((t=>e[t])).join(" ")+" "}update(e,[t]){if(void 0===this.st){this.st=new Set,void 0!==e.strings&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter((e=>""!==e))));for(const e in t)t[e]&&!this.nt?.has(e)&&this.st.add(e);return this.render(t)}const i=e.element.classList;for(const e of this.st)e in t||(i.remove(e),this.st.delete(e));for(const e in t){const s=!!t[e];s===this.st.has(e)||this.nt?.has(e)||(s?(i.add(e),this.st.add(e)):(i.remove(e),this.st.delete(e)))}return B}});var $e=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};e.KRAlert=class extends le{constructor(){super(...arguments),this.type="info",this.title="",this.dismissible=!1,this.visible=!0}_handleDismiss(){this.visible=!1,this.dispatchEvent(new CustomEvent("dismiss",{bubbles:!0,composed:!0}))}render(){const e={info:j`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd"/></svg>`,success:j`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"/></svg>`,warning:j`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule="evenodd"/></svg>`,error:j`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd"/></svg>`};return j`
152
+ */const we=xe(class extends ke{constructor(e){if(super(e),e.type!==ve||"class"!==e.name||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter((t=>e[t])).join(" ")+" "}update(e,[t]){if(void 0===this.st){this.st=new Set,void 0!==e.strings&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter((e=>""!==e))));for(const e in t)t[e]&&!this.nt?.has(e)&&this.st.add(e);return this.render(t)}const i=e.element.classList;for(const e of this.st)e in t||(i.remove(e),this.st.delete(e));for(const e in t){const s=!!t[e];s===this.st.has(e)||this.nt?.has(e)||(s?(i.add(e),this.st.add(e)):(i.remove(e),this.st.delete(e)))}return j}});var $e=function(e,t,i,s){var o,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(l=(r<3?o(l):r>3?o(t,i,l):o(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};e.KRAlert=class extends ae{constructor(){super(...arguments),this.type="info",this.title="",this.dismissible=!1,this.visible=!0}_handleDismiss(){this.visible=!1,this.dispatchEvent(new CustomEvent("dismiss",{bubbles:!0,composed:!0}))}render(){const e={info:B`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd"/></svg>`,success:B`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"/></svg>`,warning:B`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule="evenodd"/></svg>`,error:B`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd"/></svg>`};return B`
153
153
  <div
154
154
  class=${we({alert:!0,["alert--"+this.type]:!0,"alert--has-header":!!this.title,"alert--hidden":!this.visible})}
155
155
  role="alert"
156
156
  >
157
157
  ${e[this.type]}
158
158
  <div class="content">
159
- ${this.title?j`<h4 class="header">${this.title}</h4>`:V}
159
+ ${this.title?B`<h4 class="header">${this.title}</h4>`:V}
160
160
  <div class="message">
161
161
  <slot></slot>
162
162
  </div>
163
163
  </div>
164
- ${this.dismissible?j`
164
+ ${this.dismissible?B`
165
165
  <button
166
166
  class="dismiss"
167
167
  type="button"
@@ -174,7 +174,7 @@ const ve=1,me=2,_e=3,ye=4,xe=e=>(...t)=>({_$litDirective$:e,values:t});let ke=cl
174
174
  </button>
175
175
  `:V}
176
176
  </div>
177
- `}},e.KRAlert.styles=a`
177
+ `}},e.KRAlert.styles=l`
178
178
  :host {
179
179
  display: block;
180
180
  }
@@ -290,18 +290,18 @@ const ve=1,me=2,_e=3,ye=4,xe=e=>(...t)=>({_$litDirective$:e,values:t});let ke=cl
290
290
  outline: 2px solid #3b82f6;
291
291
  outline-offset: 2px;
292
292
  }
293
- `,$e([ue({type:String})],e.KRAlert.prototype,"type",void 0),$e([ue({type:String})],e.KRAlert.prototype,"title",void 0),$e([ue({type:Boolean})],e.KRAlert.prototype,"dismissible",void 0),$e([ue({type:Boolean})],e.KRAlert.prototype,"visible",void 0),e.KRAlert=$e([ce("kr-alert")],e.KRAlert);var Se=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};e.KRButton=class extends le{constructor(){super(...arguments),this.variant="flat",this.color="primary",this.size="medium",this.disabled=!1,this.options=[],this.iconPosition="left",this._state="idle",this._stateText="",this._dropdownOpened=!1,this._handleHostClick=e=>{this.options.length&&(e.stopPropagation(),this._toggleDropdown())},this._handleKeydown=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.options.length?this._toggleDropdown():this.click()),"Escape"===e.key&&this._dropdownOpened&&(this._dropdownOpened=!1)},this._handleClickOutside=e=>{this._dropdownOpened&&!this.contains(e.target)&&(this._dropdownOpened=!1)}}connectedCallback(){super.connectedCallback(),this.setAttribute("role",this.href?"link":"button"),this.setAttribute("tabindex","0"),this.addEventListener("keydown",this._handleKeydown),this.addEventListener("click",this._handleHostClick),document.addEventListener("click",this._handleClickOutside)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this._handleKeydown),this.removeEventListener("click",this._handleHostClick),document.removeEventListener("click",this._handleClickOutside)}_toggleDropdown(){this._dropdownOpened=!this._dropdownOpened,this._dropdownOpened&&requestAnimationFrame((()=>{const e=this.shadowRoot?.querySelector(".dropdown");if(e){const t=this.getBoundingClientRect();e.style.top=t.bottom+4+"px",e.style.bottom="",e.style.left=t.left+"px",e.style.right="",e.style.minWidth=t.width+"px",e.style.transformOrigin="top left";const i=e.getBoundingClientRect();i.bottom>window.innerHeight?(e.style.top="",e.style.bottom=window.innerHeight-t.top+4+"px",e.style.transformOrigin="bottom left",e.classList.add("dropdown--above")):e.classList.remove("dropdown--above"),i.right>window.innerWidth&&(e.style.left="",e.style.right=window.innerWidth-t.right+"px",i.bottom>window.innerHeight?e.style.transformOrigin="bottom right":e.style.transformOrigin="top right")}}))}_handleOptionClick(e,t){t.stopPropagation(),this._dropdownOpened=!1,this.dispatchEvent(new CustomEvent("option-select",{detail:{id:e.id,label:e.label},bubbles:!0,composed:!0}))}showLoading(){this._clearStateTimeout(),this._state="loading",this._stateText=""}showSuccess(e="Success",t=2e3){this._clearStateTimeout(),this._state="success",this._stateText=e,t>0&&(this._stateTimeout=window.setTimeout((()=>this.reset()),t))}showError(e="Error",t=2e3){this._clearStateTimeout(),this._state="error",this._stateText=e,t>0&&(this._stateTimeout=window.setTimeout((()=>this.reset()),t))}isLoading(){return"loading"===this._state}reset(){this._clearStateTimeout(),this._state="idle",this._stateText=""}_clearStateTimeout(){this._stateTimeout&&(clearTimeout(this._stateTimeout),this._stateTimeout=void 0)}updated(e){this.classList.toggle("kr-button--loading","loading"===this._state),this.classList.toggle("kr-button--success","success"===this._state),this.classList.toggle("kr-button--error","error"===this._state),this.classList.toggle(`kr-button--${this.variant}`,!0),this.classList.toggle(`kr-button--${this.color}`,!0),this.classList.toggle("kr-button--small","small"===this.size),this.classList.toggle("kr-button--large","large"===this.size)}render(){const e=j`
293
+ `,$e([ue({type:String})],e.KRAlert.prototype,"type",void 0),$e([ue({type:String})],e.KRAlert.prototype,"title",void 0),$e([ue({type:Boolean})],e.KRAlert.prototype,"dismissible",void 0),$e([ue({type:Boolean})],e.KRAlert.prototype,"visible",void 0),e.KRAlert=$e([he("kr-alert")],e.KRAlert);var Ce=function(e,t,i,s){var o,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(l=(r<3?o(l):r>3?o(t,i,l):o(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};e.KRButton=class extends ae{constructor(){super(...arguments),this.variant="flat",this.color="primary",this.size="medium",this.disabled=!1,this.options=[],this.iconPosition="left",this._state="idle",this._stateText="",this._dropdownOpened=!1,this._handleHostClick=e=>{this.options.length&&(e.stopPropagation(),this._toggleDropdown())},this._handleKeydown=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.options.length?this._toggleDropdown():this.click()),"Escape"===e.key&&this._dropdownOpened&&(this._dropdownOpened=!1)},this._handleClickOutside=e=>{this._dropdownOpened&&!this.contains(e.target)&&(this._dropdownOpened=!1)}}connectedCallback(){super.connectedCallback(),this.setAttribute("role",this.href?"link":"button"),this.setAttribute("tabindex","0"),this.addEventListener("keydown",this._handleKeydown),this.addEventListener("click",this._handleHostClick),document.addEventListener("click",this._handleClickOutside)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this._handleKeydown),this.removeEventListener("click",this._handleHostClick),document.removeEventListener("click",this._handleClickOutside)}_toggleDropdown(){this._dropdownOpened=!this._dropdownOpened,this._dropdownOpened&&requestAnimationFrame((()=>{const e=this.shadowRoot?.querySelector(".dropdown");if(e){const t=this.getBoundingClientRect();e.style.top=t.bottom+4+"px",e.style.bottom="",e.style.left=t.left+"px",e.style.right="",e.style.minWidth=t.width+"px",e.style.transformOrigin="top left";const i=e.getBoundingClientRect();i.bottom>window.innerHeight?(e.style.top="",e.style.bottom=window.innerHeight-t.top+4+"px",e.style.transformOrigin="bottom left",e.classList.add("dropdown--above")):e.classList.remove("dropdown--above"),i.right>window.innerWidth&&(e.style.left="",e.style.right=window.innerWidth-t.right+"px",i.bottom>window.innerHeight?e.style.transformOrigin="bottom right":e.style.transformOrigin="top right")}}))}_handleOptionClick(e,t){t.stopPropagation(),this._dropdownOpened=!1,this.dispatchEvent(new CustomEvent("option-select",{detail:{id:e.id,label:e.label},bubbles:!0,composed:!0}))}showLoading(){this._clearStateTimeout(),this._state="loading",this._stateText=""}showSuccess(e="Success",t=2e3){this._clearStateTimeout(),this._state="success",this._stateText=e,t>0&&(this._stateTimeout=window.setTimeout((()=>this.reset()),t))}showError(e="Error",t=2e3){this._clearStateTimeout(),this._state="error",this._stateText=e,t>0&&(this._stateTimeout=window.setTimeout((()=>this.reset()),t))}isLoading(){return"loading"===this._state}reset(){this._clearStateTimeout(),this._state="idle",this._stateText=""}_clearStateTimeout(){this._stateTimeout&&(clearTimeout(this._stateTimeout),this._stateTimeout=void 0)}updated(e){this.classList.toggle("kr-button--loading","loading"===this._state),this.classList.toggle("kr-button--success","success"===this._state),this.classList.toggle("kr-button--error","error"===this._state),this.classList.toggle(`kr-button--${this.variant}`,!0),this.classList.toggle(`kr-button--${this.color}`,!0),this.classList.toggle("kr-button--small","small"===this.size),this.classList.toggle("kr-button--large","large"===this.size)}render(){const e=B`
294
294
  <span class="content">
295
295
  <slot name="icon"></slot>
296
296
  <slot></slot>
297
297
  </span>
298
- ${this.options.length?j`<svg class="caret" xmlns="http://www.w3.org/2000/svg" height="20" width="20" viewBox="0 0 24 24" fill="currentColor"><path d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"/></svg>`:V}
299
- ${"idle"!==this._state?j`<span class="state-overlay">
300
- ${"loading"===this._state?j`<span class="spinner"></span>`:this._stateText}
298
+ ${this.options.length?B`<svg class="caret" xmlns="http://www.w3.org/2000/svg" height="20" width="20" viewBox="0 0 24 24" fill="currentColor"><path d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"/></svg>`:V}
299
+ ${"idle"!==this._state?B`<span class="state-overlay">
300
+ ${"loading"===this._state?B`<span class="spinner"></span>`:this._stateText}
301
301
  </span>`:V}
302
- ${this.options.length?j`
302
+ ${this.options.length?B`
303
303
  <div class="dropdown ${this._dropdownOpened?"dropdown--opened":""}">
304
- ${this.options.map((e=>j`
304
+ ${this.options.map((e=>B`
305
305
  <button
306
306
  class="dropdown-item"
307
307
  @click=${t=>this._handleOptionClick(e,t)}
@@ -309,7 +309,7 @@ const ve=1,me=2,_e=3,ye=4,xe=e=>(...t)=>({_$litDirective$:e,values:t});let ke=cl
309
309
  `))}
310
310
  </div>
311
311
  `:V}
312
- `;return this.href?j`<a class="link" href=${this.href} target=${this.target||V}>${e}</a>`:e}},e.KRButton.styles=a`
312
+ `;return this.href?B`<a class="link" href=${this.href} target=${this.target||V}>${e}</a>`:e}},e.KRButton.styles=l`
313
313
  :host {
314
314
  display: inline-flex;
315
315
  position: relative;
@@ -579,13 +579,13 @@ const ve=1,me=2,_e=3,ye=4,xe=e=>(...t)=>({_$litDirective$:e,values:t});let ke=cl
579
579
  width: 22px;
580
580
  height: 22px;
581
581
  }
582
- `,Se([ue({type:String,reflect:!0})],e.KRButton.prototype,"variant",void 0),Se([ue({type:String,reflect:!0})],e.KRButton.prototype,"color",void 0),Se([ue({type:String,reflect:!0})],e.KRButton.prototype,"size",void 0),Se([ue({type:Boolean,reflect:!0})],e.KRButton.prototype,"disabled",void 0),Se([ue({type:String})],e.KRButton.prototype,"href",void 0),Se([ue({type:String})],e.KRButton.prototype,"target",void 0),Se([ue({type:Array})],e.KRButton.prototype,"options",void 0),Se([ue({type:String,reflect:!0,attribute:"icon-position"})],e.KRButton.prototype,"iconPosition",void 0),Se([fe()],e.KRButton.prototype,"_state",void 0),Se([fe()],e.KRButton.prototype,"_stateText",void 0),Se([fe()],e.KRButton.prototype,"_dropdownOpened",void 0),e.KRButton=Se([ce("kr-button")],e.KRButton);
582
+ `,Ce([ue({type:String,reflect:!0})],e.KRButton.prototype,"variant",void 0),Ce([ue({type:String,reflect:!0})],e.KRButton.prototype,"color",void 0),Ce([ue({type:String,reflect:!0})],e.KRButton.prototype,"size",void 0),Ce([ue({type:Boolean,reflect:!0})],e.KRButton.prototype,"disabled",void 0),Ce([ue({type:String})],e.KRButton.prototype,"href",void 0),Ce([ue({type:String})],e.KRButton.prototype,"target",void 0),Ce([ue({type:Array})],e.KRButton.prototype,"options",void 0),Ce([ue({type:String,reflect:!0,attribute:"icon-position"})],e.KRButton.prototype,"iconPosition",void 0),Ce([fe()],e.KRButton.prototype,"_state",void 0),Ce([fe()],e.KRButton.prototype,"_stateText",void 0),Ce([fe()],e.KRButton.prototype,"_dropdownOpened",void 0),e.KRButton=Ce([he("kr-button")],e.KRButton);
583
583
  /**
584
584
  * @license
585
585
  * Copyright 2017 Google LLC
586
586
  * SPDX-License-Identifier: BSD-3-Clause
587
587
  */
588
- class Ce extends ke{constructor(e){if(super(e),this.it=V,e.type!==me)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===V||null==e)return this._t=void 0,this.it=e;if(e===B)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}Ce.directiveName="unsafeHTML",Ce.resultType=1;const Re=xe(Ce);var Te=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};e.KRCodeDemo=class extends le{constructor(){super(...arguments),this.language="html",this.code="",this.activeTab="preview",this.copied=!1,this.highlightedCode=""}connectedCallback(){super.connectedCallback(),requestAnimationFrame((()=>{this.code||(this.code=this.innerHTML.trim().replace(/=""(?=[\s>])/g,"")),this.querySelectorAll("script").forEach((e=>{const t=document.createElement("script");t.textContent=e.textContent,e.replaceWith(t)})),this.code&&window.hljs&&window.hljs.getLanguage(this.language)?this.highlightedCode=window.hljs.highlight(this.code,{language:this.language}).value:this.highlightedCode=this.code.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}))}activateTab(e){this.activeTab=e}copyCode(){this.code&&navigator.clipboard.writeText(this.code).then((()=>{this.copied=!0,setTimeout((()=>{this.copied=!1}),2e3)}))}render(){return j`
588
+ class Se extends ke{constructor(e){if(super(e),this.it=V,e.type!==_e)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===V||null==e)return this._t=void 0,this.it=e;if(e===j)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}Se.directiveName="unsafeHTML",Se.resultType=1;const Re=xe(Se);var Te=function(e,t,i,s){var o,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(l=(r<3?o(l):r>3?o(t,i,l):o(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};e.KRCodeDemo=class extends ae{constructor(){super(...arguments),this.language="html",this.code="",this.activeTab="preview",this.copied=!1,this.highlightedCode=""}connectedCallback(){super.connectedCallback(),requestAnimationFrame((()=>{this.code||(this.code=this.innerHTML.trim().replace(/=""(?=[\s>])/g,"")),this.querySelectorAll("script").forEach((e=>{const t=document.createElement("script");t.textContent=e.textContent,e.replaceWith(t)})),this.code&&window.hljs&&window.hljs.getLanguage(this.language)?this.highlightedCode=window.hljs.highlight(this.code,{language:this.language}).value:this.highlightedCode=this.code.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}))}activateTab(e){this.activeTab=e}copyCode(){this.code&&navigator.clipboard.writeText(this.code).then((()=>{this.copied=!0,setTimeout((()=>{this.copied=!1}),2e3)}))}render(){return B`
589
589
  <div class="tabs">
590
590
  <button
591
591
  class=${we({tab:!0,"tab--active":"preview"===this.activeTab})}
@@ -604,7 +604,7 @@ class Ce extends ke{constructor(e){if(super(e),this.it=V,e.type!==me)throw Error
604
604
  @click=${this.copyCode}
605
605
  title=${this.copied?"Copied!":"Copy code"}
606
606
  >
607
- ${this.copied?j`<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>`:j`<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>`}
607
+ ${this.copied?B`<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>`:B`<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>`}
608
608
  </button>
609
609
  </div>
610
610
 
@@ -616,7 +616,7 @@ class Ce extends ke{constructor(e){if(super(e),this.it=V,e.type!==me)throw Error
616
616
  <pre class="code"><code>${Re(this.highlightedCode)}</code></pre>
617
617
  </div>
618
618
 
619
- `}},e.KRCodeDemo.styles=[de,a`
619
+ `}},e.KRCodeDemo.styles=[de,l`
620
620
  :host {
621
621
  display: block;
622
622
  border: 1px solid #d5dbdb;
@@ -738,20 +738,20 @@ class Ce extends ke{constructor(e){if(super(e),this.it=V,e.type!==me)throw Error
738
738
  .hljs-attribute { color: #005cc5; }
739
739
  .hljs-property { color: #005cc5; }
740
740
 
741
- `],Te([ue({type:String})],e.KRCodeDemo.prototype,"language",void 0),Te([fe()],e.KRCodeDemo.prototype,"code",void 0),Te([fe()],e.KRCodeDemo.prototype,"activeTab",void 0),Te([fe()],e.KRCodeDemo.prototype,"copied",void 0),Te([fe()],e.KRCodeDemo.prototype,"highlightedCode",void 0),e.KRCodeDemo=Te([ce("kr-code-demo")],e.KRCodeDemo);var Ee=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};e.KRContextMenu=class extends le{constructor(){super(...arguments),this.items=[],this.resolvePromise=null,this.boundHandleOutsideClick=this.handleOutsideClick.bind(this),this.boundHandleKeyDown=this.handleKeyDown.bind(this)}static async open(e){const t=document.querySelector("kr-context-menu");t&&t.remove();const i=document.createElement("kr-context-menu");return document.body.appendChild(i),i.show(e)}async show(e){this.items=e.items,this.style.left=`${e.x}px`,this.style.top=`${e.y}px`,await this.updateComplete;const t=this.getBoundingClientRect();return t.right>window.innerWidth&&(this.style.left=e.x-t.width+"px"),t.bottom>window.innerHeight&&(this.style.top=e.y-t.height+"px"),requestAnimationFrame((()=>{document.addEventListener("click",this.boundHandleOutsideClick),document.addEventListener("contextmenu",this.boundHandleOutsideClick),document.addEventListener("keydown",this.boundHandleKeyDown)})),new Promise((e=>{this.resolvePromise=e}))}handleOutsideClick(e){this.contains(e.target)||this.close(null)}handleKeyDown(e){"Escape"===e.key&&this.close(null)}handleItemClick(e){e.disabled||e.divider||this.close(e)}close(e){document.removeEventListener("click",this.boundHandleOutsideClick),document.removeEventListener("contextmenu",this.boundHandleOutsideClick),document.removeEventListener("keydown",this.boundHandleKeyDown),this.resolvePromise&&(this.resolvePromise(e),this.resolvePromise=null),this.remove()}render(){return j`
741
+ `],Te([ue({type:String})],e.KRCodeDemo.prototype,"language",void 0),Te([fe()],e.KRCodeDemo.prototype,"code",void 0),Te([fe()],e.KRCodeDemo.prototype,"activeTab",void 0),Te([fe()],e.KRCodeDemo.prototype,"copied",void 0),Te([fe()],e.KRCodeDemo.prototype,"highlightedCode",void 0),e.KRCodeDemo=Te([he("kr-code-demo")],e.KRCodeDemo);var Ee=function(e,t,i,s){var o,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(l=(r<3?o(l):r>3?o(t,i,l):o(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};e.KRContextMenu=class extends ae{constructor(){super(...arguments),this.items=[],this.resolvePromise=null,this.boundHandleOutsideClick=this.handleOutsideClick.bind(this),this.boundHandleKeyDown=this.handleKeyDown.bind(this)}static async open(e){const t=document.querySelector("kr-context-menu");t&&t.remove();const i=document.createElement("kr-context-menu");return document.body.appendChild(i),i.show(e)}async show(e){this.items=e.items,this.style.left=`${e.x}px`,this.style.top=`${e.y}px`,await this.updateComplete;const t=this.getBoundingClientRect();return t.right>window.innerWidth&&(this.style.left=e.x-t.width+"px"),t.bottom>window.innerHeight&&(this.style.top=e.y-t.height+"px"),requestAnimationFrame((()=>{document.addEventListener("click",this.boundHandleOutsideClick),document.addEventListener("contextmenu",this.boundHandleOutsideClick),document.addEventListener("keydown",this.boundHandleKeyDown)})),new Promise((e=>{this.resolvePromise=e}))}handleOutsideClick(e){this.contains(e.target)||this.close(null)}handleKeyDown(e){"Escape"===e.key&&this.close(null)}handleItemClick(e){e.disabled||e.divider||this.close(e)}close(e){document.removeEventListener("click",this.boundHandleOutsideClick),document.removeEventListener("contextmenu",this.boundHandleOutsideClick),document.removeEventListener("keydown",this.boundHandleKeyDown),this.resolvePromise&&(this.resolvePromise(e),this.resolvePromise=null),this.remove()}render(){return B`
742
742
  <div class="menu">
743
- ${this.items.map((e=>e.divider?j`<div class="menu__divider"></div>`:j`
743
+ ${this.items.map((e=>e.divider?B`<div class="menu__divider"></div>`:B`
744
744
  <button
745
745
  class="menu__item"
746
746
  ?disabled=${e.disabled}
747
747
  @click=${()=>this.handleItemClick(e)}
748
748
  >
749
- ${e.icon?j`<span class="menu__item-icon">${e.icon}</span>`:null}
749
+ ${e.icon?B`<span class="menu__item-icon">${e.icon}</span>`:null}
750
750
  ${e.label}
751
751
  </button>
752
752
  `))}
753
753
  </div>
754
- `}},e.KRContextMenu.styles=a`
754
+ `}},e.KRContextMenu.styles=l`
755
755
  :host {
756
756
  position: fixed;
757
757
  z-index: 10000;
@@ -806,13 +806,13 @@ class Ce extends ke{constructor(e){if(super(e),this.it=V,e.type!==me)throw Error
806
806
  background: rgba(255, 255, 255, 0.1);
807
807
  margin: 4px 0;
808
808
  }
809
- `,Ee([fe()],e.KRContextMenu.prototype,"items",void 0),e.KRContextMenu=Ee([ce("kr-context-menu")],e.KRContextMenu);
809
+ `,Ee([fe()],e.KRContextMenu.prototype,"items",void 0),e.KRContextMenu=Ee([he("kr-context-menu")],e.KRContextMenu);
810
810
  /**
811
811
  * @license
812
812
  * Copyright 2018 Google LLC
813
813
  * SPDX-License-Identifier: BSD-3-Clause
814
814
  */
815
- const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e),e.type!==ve||"style"!==e.name||e.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce(((t,i)=>{const s=e[i];return null==s?t:t+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`}),"")}update(e,[t]){const{style:i}=e.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(t)),this.render(t);for(const e of this.ft)null==t[e]&&(this.ft.delete(e),e.includes("-")?i.removeProperty(e):i[e]=null);for(const e in t){const s=t[e];if(null!=s){this.ft.add(e);const t="string"==typeof s&&s.endsWith(Oe);e.includes("-")||t?i.setProperty(e,t?s.slice(0,-11):s,t?ze:""):i[e]=s}}return B}});var Ke=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};let Pe=class extends le{render(){return j`<slot></slot>`}};Pe.styles=a`
815
+ const ze="important",Oe=" !"+ze,Ke=xe(class extends ke{constructor(e){if(super(e),e.type!==ve||"style"!==e.name||e.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce(((t,i)=>{const s=e[i];return null==s?t:t+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`}),"")}update(e,[t]){const{style:i}=e.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(t)),this.render(t);for(const e of this.ft)null==t[e]&&(this.ft.delete(e),e.includes("-")?i.removeProperty(e):i[e]=null);for(const e in t){const s=t[e];if(null!=s){this.ft.add(e);const t="string"==typeof s&&s.endsWith(Oe);e.includes("-")||t?i.setProperty(e,t?s.slice(0,-11):s,t?ze:""):i[e]=s}}return j}});var Ae=function(e,t,i,s){var o,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(l=(r<3?o(l):r>3?o(t,i,l):o(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};let Pe=class extends ae{render(){return B`<slot></slot>`}};Pe.styles=l`
816
816
  :host {
817
817
  display: flex;
818
818
  padding: 0 24px;
@@ -827,14 +827,14 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
827
827
  font-size: 18px;
828
828
  font-weight: 600;
829
829
  }
830
- `,Pe=Ke([ce("kr-dialog-header")],Pe);let De=class extends le{render(){return j`<slot></slot>`}};De.styles=a`
830
+ `,Pe=Ae([he("kr-dialog-header")],Pe);let De=class extends ae{render(){return B`<slot></slot>`}};De.styles=l`
831
831
  :host {
832
832
  display: block;
833
833
  padding: 24px;
834
834
  overflow: auto;
835
835
  flex: 1 1 auto;
836
836
  }
837
- `,De=Ke([ce("kr-dialog-content")],De);let Le=class extends le{render(){return j`<slot></slot>`}};Le.styles=a`
837
+ `,De=Ae([he("kr-dialog-content")],De);let Ie=class extends ae{render(){return B`<slot></slot>`}};Ie.styles=l`
838
838
  :host {
839
839
  display: flex;
840
840
  padding: 0 24px;
@@ -845,13 +845,13 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
845
845
  gap: 12px;
846
846
  justify-content: flex-end;
847
847
  }
848
- `,Le=Ke([ce("kr-dialog-footer")],Le);class Me{constructor(){this._resolvePromise=null,this._dialogElement=null,this._promise=new Promise((e=>{this._resolvePromise=e}))}setDialogElement(e){this._dialogElement=e}close(e){this._resolvePromise&&(this._resolvePromise(e),this._resolvePromise=null),this._dialogElement?.remove()}afterClosed(){return this._promise}}e.KRDialog=class extends le{constructor(){super(...arguments),this._dialogRef=null,this._contentElement=null,this.opened=!1,this.label="",this.width="560px",this._handleDocumentKeyDown=e=>{"Escape"===e.key&&this.close()}}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this._handleDocumentKeyDown)}updated(e){super.updated(e),e.has("opened")&&(this.opened?document.addEventListener("keydown",this._handleDocumentKeyDown):document.removeEventListener("keydown",this._handleDocumentKeyDown))}open(){this.opened=!0}close(){this._dialogRef?this._dialogRef.close(void 0):(this.opened=!1,this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))}static open(e,t){document.querySelectorAll("kr-dialog").forEach((e=>{e._dialogRef&&e.remove()}));const i=new Me,s=document.createElement("kr-dialog");i.setDialogElement(s),s._dialogRef=i;const o=new e;return o.dialogRef=i,t?.data&&(o.data=t.data),t?.label&&(s.label=t.label),t?.width&&(s.width=t.width),s._contentElement=o,s.opened=!0,document.body.appendChild(s),i}_handleBackdropClick(e){e.target.classList.contains("backdrop")&&this.close()}render(){return j`
848
+ `,Ie=Ae([he("kr-dialog-footer")],Ie);class Le{constructor(){this._resolvePromise=null,this._dialogElement=null,this._promise=new Promise((e=>{this._resolvePromise=e}))}setDialogElement(e){this._dialogElement=e}close(e){this._resolvePromise&&(this._resolvePromise(e),this._resolvePromise=null),this._dialogElement?.remove()}afterClosed(){return this._promise}}e.KRDialog=class extends ae{constructor(){super(...arguments),this._dialogRef=null,this._contentElement=null,this.opened=!1,this.label="",this.width="560px",this._handleDocumentKeyDown=e=>{"Escape"===e.key&&this.close()}}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this._handleDocumentKeyDown)}updated(e){super.updated(e),e.has("opened")&&(this.opened?document.addEventListener("keydown",this._handleDocumentKeyDown):document.removeEventListener("keydown",this._handleDocumentKeyDown))}open(){this.opened=!0}close(){this._dialogRef?this._dialogRef.close(void 0):(this.opened=!1,this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))}static open(e,t){document.querySelectorAll("kr-dialog").forEach((e=>{e._dialogRef&&e.remove()}));const i=new Le,s=document.createElement("kr-dialog");i.setDialogElement(s),s._dialogRef=i;const o=new e;return o.dialogRef=i,t?.data&&(o.data=t.data),t?.label&&(s.label=t.label),t?.width&&(s.width=t.width),s._contentElement=o,s.opened=!0,document.body.appendChild(s),i}_handleBackdropClick(e){e.target.classList.contains("backdrop")&&this.close()}render(){return B`
849
849
  <div class="backdrop" @click=${this._handleBackdropClick}></div>
850
- <div class="dialog" style=${Ae({width:this.width})}>
851
- ${this.label?j`<div class="dialog__header"><div class="dialog__header-label">${this.label}</div></div>`:""}
852
- ${this._contentElement?this._contentElement:j`<slot></slot>`}
850
+ <div class="dialog" style=${Ke({width:this.width})}>
851
+ ${this.label?B`<div class="dialog__header"><div class="dialog__header-label">${this.label}</div></div>`:""}
852
+ ${this._contentElement?this._contentElement:B`<slot></slot>`}
853
853
  </div>
854
- `}},e.KRDialog.styles=a`
854
+ `}},e.KRDialog.styles=l`
855
855
  :host {
856
856
  position: fixed;
857
857
  inset: 0;
@@ -909,10 +909,10 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
909
909
  font-size: 18px;
910
910
  font-weight: 600;
911
911
  }
912
- `,Ke([fe()],e.KRDialog.prototype,"_contentElement",void 0),Ke([ue({type:Boolean,reflect:!0})],e.KRDialog.prototype,"opened",void 0),Ke([ue({type:String})],e.KRDialog.prototype,"label",void 0),Ke([ue({type:String})],e.KRDialog.prototype,"width",void 0),e.KRDialog=Ke([ce("kr-dialog")],e.KRDialog);var Ie,qe=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};e.KRSnackbar=Ie=class extends le{constructor(){super(...arguments),this.dismissTimeout=null,this.type="info",this.title="",this.message="",this.duration=5e3}static show(e){for(const e of this.activeSnackbars)e.dismiss();const t=document.createElement("kr-snackbar");return t.message=e.message,t.title=e.title??"",t.type=e.type??"info",void 0!==e.duration?t.duration=e.duration:"error"===t.type?t.duration=0:t.duration=5e3,document.body.appendChild(t),t}connectedCallback(){super.connectedCallback(),this.setAttribute("role","alert"),this.classList.add(`kr-snackbar--${this.type}`),this.title&&this.classList.add("kr-snackbar--has-title"),Ie.activeSnackbars.push(this),this.duration>0&&(this.dismissTimeout=window.setTimeout((()=>{this.dismiss()}),this.duration))}disconnectedCallback(){super.disconnectedCallback();const e=Ie.activeSnackbars.indexOf(this);e>-1&&Ie.activeSnackbars.splice(e,1),this.dismissTimeout&&clearTimeout(this.dismissTimeout)}dismiss(){this.dismissTimeout&&(clearTimeout(this.dismissTimeout),this.dismissTimeout=null),this.classList.add("kr-snackbar--closing"),this.addEventListener("animationend",(()=>{this.dispatchEvent(new CustomEvent("dismiss",{bubbles:!0,composed:!0})),this.remove()}),{once:!0})}render(){const e={info:j`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd"/></svg>`,success:j`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"/></svg>`,warning:j`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule="evenodd"/></svg>`,error:j`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd"/></svg>`};return j`
912
+ `,Ae([fe()],e.KRDialog.prototype,"_contentElement",void 0),Ae([ue({type:Boolean,reflect:!0})],e.KRDialog.prototype,"opened",void 0),Ae([ue({type:String})],e.KRDialog.prototype,"label",void 0),Ae([ue({type:String})],e.KRDialog.prototype,"width",void 0),e.KRDialog=Ae([he("kr-dialog")],e.KRDialog);var qe,Me=function(e,t,i,s){var o,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(l=(r<3?o(l):r>3?o(t,i,l):o(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};e.KRSnackbar=qe=class extends ae{constructor(){super(...arguments),this.dismissTimeout=null,this.type="info",this.title="",this.message="",this.duration=5e3}static show(e){for(const e of this.activeSnackbars)e.dismiss();const t=document.createElement("kr-snackbar");return t.message=e.message,t.title=e.title??"",t.type=e.type??"info",void 0!==e.duration?t.duration=e.duration:"error"===t.type?t.duration=0:t.duration=5e3,document.body.appendChild(t),t}connectedCallback(){super.connectedCallback(),this.setAttribute("role","alert"),this.classList.add(`kr-snackbar--${this.type}`),this.title&&this.classList.add("kr-snackbar--has-title"),qe.activeSnackbars.push(this),this.duration>0&&(this.dismissTimeout=window.setTimeout((()=>{this.dismiss()}),this.duration))}disconnectedCallback(){super.disconnectedCallback();const e=qe.activeSnackbars.indexOf(this);e>-1&&qe.activeSnackbars.splice(e,1),this.dismissTimeout&&clearTimeout(this.dismissTimeout)}dismiss(){this.dismissTimeout&&(clearTimeout(this.dismissTimeout),this.dismissTimeout=null),this.classList.add("kr-snackbar--closing"),this.addEventListener("animationend",(()=>{this.dispatchEvent(new CustomEvent("dismiss",{bubbles:!0,composed:!0})),this.remove()}),{once:!0})}render(){const e={info:B`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd"/></svg>`,success:B`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"/></svg>`,warning:B`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule="evenodd"/></svg>`,error:B`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd"/></svg>`};return B`
913
913
  ${e[this.type]}
914
914
  <div class="content">
915
- ${this.title?j`<div class="title">${this.title}</div>`:""}
915
+ ${this.title?B`<div class="title">${this.title}</div>`:""}
916
916
  <div class="message">${this.message}</div>
917
917
  </div>
918
918
  <button
@@ -925,7 +925,7 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
925
925
  <path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"/>
926
926
  </svg>
927
927
  </button>
928
- `}},e.KRSnackbar.styles=a`
928
+ `}},e.KRSnackbar.styles=l`
929
929
  :host,
930
930
  *,
931
931
  *::before,
@@ -1073,9 +1073,9 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
1073
1073
  outline: 2px solid #3b82f6;
1074
1074
  outline-offset: 2px;
1075
1075
  }
1076
- `,e.KRSnackbar.activeSnackbars=[],qe([ue({type:String})],e.KRSnackbar.prototype,"type",void 0),qe([ue({type:String})],e.KRSnackbar.prototype,"title",void 0),qe([ue({type:String})],e.KRSnackbar.prototype,"message",void 0),qe([ue({type:Number})],e.KRSnackbar.prototype,"duration",void 0),e.KRSnackbar=Ie=qe([ce("kr-snackbar")],e.KRSnackbar);var Fe=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};e.KRTabGroup=class extends le{constructor(){super(...arguments),this.justified=!1,this.size="medium"}updated(e){e.has("activeTabId")&&this._updateActiveTab()}firstUpdated(){this._updateActiveTab()}_getTabs(){return Array.from(this.querySelectorAll("kr-tab"))}_updateActiveTab(){const e=this._getTabs();0!==e.length&&(this.activeTabId||(this.activeTabId=e[0]?.id),e.forEach((e=>{e.active=e.id===this.activeTabId})),this.requestUpdate())}_handleTabClick(e){e.disabled||(this.activeTabId=e.id,this.dispatchEvent(new CustomEvent("tab-change",{detail:{activeTabId:e.id},bubbles:!0,composed:!0})))}_handleTabDismiss(e,t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("tab-dismiss",{detail:{tabId:e.id},bubbles:!0,composed:!0}))}_handleKeyDown(e){const t=this._getTabs().filter((e=>!e.disabled)),i=t.findIndex((e=>e.id===this.activeTabId));let s=-1;switch(e.key){case"ArrowLeft":s=i>0?i-1:t.length-1;break;case"ArrowRight":s=i<t.length-1?i+1:0;break;case"Home":s=0;break;case"End":s=t.length-1}if(s>=0){e.preventDefault();const i=t[s];this.activeTabId=i.id,this.dispatchEvent(new CustomEvent("tab-change",{detail:{activeTabId:i.id},bubbles:!0,composed:!0}));const o=this.shadowRoot?.querySelectorAll(".label"),r=Array.from(o||[]).find((e=>e.getAttribute("data-tab-id")===i.id));r?.focus()}}_renderTabIcon(e){const t=e.getIconElement();if(!t)return V;const i=t.cloneNode(!0);return i.removeAttribute("slot"),j`<span class="label-icon">${i}</span>`}render(){return j`
1076
+ `,e.KRSnackbar.activeSnackbars=[],Me([ue({type:String})],e.KRSnackbar.prototype,"type",void 0),Me([ue({type:String})],e.KRSnackbar.prototype,"title",void 0),Me([ue({type:String})],e.KRSnackbar.prototype,"message",void 0),Me([ue({type:Number})],e.KRSnackbar.prototype,"duration",void 0),e.KRSnackbar=qe=Me([he("kr-snackbar")],e.KRSnackbar);var He=function(e,t,i,s){var o,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(l=(r<3?o(l):r>3?o(t,i,l):o(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};e.KRTabGroup=class extends ae{constructor(){super(...arguments),this.justified=!1,this.size="medium"}updated(e){e.has("activeTabId")&&this._updateActiveTab()}firstUpdated(){this._updateActiveTab()}_getTabs(){return Array.from(this.querySelectorAll("kr-tab"))}_updateActiveTab(){const e=this._getTabs();0!==e.length&&(this.activeTabId||(this.activeTabId=e[0]?.id),e.forEach((e=>{e.active=e.id===this.activeTabId})),this.requestUpdate())}_handleTabClick(e){e.disabled||(this.activeTabId=e.id,this.dispatchEvent(new CustomEvent("tab-change",{detail:{activeTabId:e.id},bubbles:!0,composed:!0})))}_handleTabDismiss(e,t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("tab-dismiss",{detail:{tabId:e.id},bubbles:!0,composed:!0}))}_handleKeyDown(e){const t=this._getTabs().filter((e=>!e.disabled)),i=t.findIndex((e=>e.id===this.activeTabId));let s=-1;switch(e.key){case"ArrowLeft":s=i>0?i-1:t.length-1;break;case"ArrowRight":s=i<t.length-1?i+1:0;break;case"Home":s=0;break;case"End":s=t.length-1}if(s>=0){e.preventDefault();const i=t[s];this.activeTabId=i.id,this.dispatchEvent(new CustomEvent("tab-change",{detail:{activeTabId:i.id},bubbles:!0,composed:!0}));const o=this.shadowRoot?.querySelectorAll(".label"),r=Array.from(o||[]).find((e=>e.getAttribute("data-tab-id")===i.id));r?.focus()}}_renderTabIcon(e){const t=e.getIconElement();if(!t)return V;const i=t.cloneNode(!0);return i.removeAttribute("slot"),B`<span class="label-icon">${i}</span>`}render(){return B`
1077
1077
  <div class="header" role="tablist" @keydown=${this._handleKeyDown}>
1078
- ${this._getTabs().map((e=>j`
1078
+ ${this._getTabs().map((e=>B`
1079
1079
  <button
1080
1080
  class=${we({label:!0,"label--active":e.id===this.activeTabId,"label--justified":this.justified})}
1081
1081
  role="tab"
@@ -1088,8 +1088,8 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
1088
1088
  >
1089
1089
  ${this._renderTabIcon(e)}
1090
1090
  <span>${e.label}</span>
1091
- ${e.badge?j`<span class="label-badge" style=${Ae({backgroundColor:e.badgeBackground,color:e.badgeColor})}>${e.badge}</span>`:V}
1092
- ${e.dismissible?j`
1091
+ ${e.badge?B`<span class="label-badge" style=${Ke({backgroundColor:e.badgeBackground,color:e.badgeColor})}>${e.badge}</span>`:V}
1092
+ ${e.dismissible?B`
1093
1093
  <button
1094
1094
  class="label-dismiss"
1095
1095
  type="button"
@@ -1105,7 +1105,7 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
1105
1105
  <div class="content" role="tabpanel" aria-labelledby=${this.activeTabId||""}>
1106
1106
  <slot @slotchange=${this._updateActiveTab}></slot>
1107
1107
  </div>
1108
- `}},e.KRTabGroup.styles=[de,a`
1108
+ `}},e.KRTabGroup.styles=[de,l`
1109
1109
  :host {
1110
1110
  display: flex;
1111
1111
  flex-direction: column;
@@ -1238,7 +1238,7 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
1238
1238
  ::slotted(kr-tab[active]) {
1239
1239
  display: block;
1240
1240
  }
1241
- `],Fe([ue({type:String,attribute:"active-tab-id"})],e.KRTabGroup.prototype,"activeTabId",void 0),Fe([ue({type:Boolean})],e.KRTabGroup.prototype,"justified",void 0),Fe([ue({type:String,reflect:!0})],e.KRTabGroup.prototype,"size",void 0),e.KRTabGroup=Fe([ce("kr-tab-group")],e.KRTabGroup);var He=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};e.KRTab=class extends le{constructor(){super(...arguments),this.id="",this.label="",this.badge="",this.badgeBackground="",this.badgeColor="",this.disabled=!1,this.dismissible=!1,this.active=!1}getIconElement(){return this.querySelector('[slot="icon"]')}render(){return console.log("tab render"),j`<slot></slot>`}},e.KRTab.styles=[de,a`
1241
+ `],He([ue({type:String,attribute:"active-tab-id"})],e.KRTabGroup.prototype,"activeTabId",void 0),He([ue({type:Boolean})],e.KRTabGroup.prototype,"justified",void 0),He([ue({type:String,reflect:!0})],e.KRTabGroup.prototype,"size",void 0),e.KRTabGroup=He([he("kr-tab-group")],e.KRTabGroup);var Fe=function(e,t,i,s){var o,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(l=(r<3?o(l):r>3?o(t,i,l):o(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};e.KRTab=class extends ae{constructor(){super(...arguments),this.id="",this.label="",this.badge="",this.badgeBackground="",this.badgeColor="",this.disabled=!1,this.dismissible=!1,this.active=!1}getIconElement(){return this.querySelector('[slot="icon"]')}render(){return console.log("tab render"),B`<slot></slot>`}},e.KRTab.styles=[de,l`
1242
1242
  :host {
1243
1243
  display: none;
1244
1244
  }
@@ -1248,12 +1248,12 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
1248
1248
  width: 100%;
1249
1249
  height: 100%;
1250
1250
  }
1251
- `],He([ue({type:String,reflect:!0})],e.KRTab.prototype,"id",void 0),He([ue({type:String})],e.KRTab.prototype,"label",void 0),He([ue({type:String})],e.KRTab.prototype,"badge",void 0),He([ue({type:String,attribute:"badge-background"})],e.KRTab.prototype,"badgeBackground",void 0),He([ue({type:String,attribute:"badge-color"})],e.KRTab.prototype,"badgeColor",void 0),He([ue({type:Boolean})],e.KRTab.prototype,"disabled",void 0),He([ue({type:Boolean})],e.KRTab.prototype,"dismissible",void 0),He([ue({type:Boolean,reflect:!0})],e.KRTab.prototype,"active",void 0),e.KRTab=He([ce("kr-tab")],e.KRTab);var je=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};e.KRSelectField=class extends le{constructor(){super(),this.label="",this.name="",this.value="",this.placeholder="Select an option",this.disabled=!1,this.required=!1,this.readonly=!1,this.hint="",this._isOpen=!1,this._highlightedIndex=-1,this._touched=!1,this._handleInvalid=e=>{e.preventDefault(),this._touched=!0},this._handleOutsideClick=e=>{e.composedPath().includes(this)||this._close()},this._handleKeyDown=e=>{if(!this._isOpen)return;const t=Array.from(this.querySelectorAll("kr-select-option"));switch(e.key){case"Escape":this._close(),this._triggerElement?.focus();break;case"ArrowDown":if(e.preventDefault(),t.some((e=>!e.disabled))){let e=this._highlightedIndex+1;for(;e<t.length&&t[e]?.disabled;)e++;e<t.length&&(this._highlightedIndex=e)}break;case"ArrowUp":e.preventDefault();{let e=this._highlightedIndex-1;for(;e>=0&&t[e]?.disabled;)e--;e>=0&&(this._highlightedIndex=e)}break;case"Enter":e.preventDefault(),this._highlightedIndex>=0&&this._highlightedIndex<t.length&&this._selectOption(t[this._highlightedIndex])}},this._internals=this.attachInternals()}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}formResetCallback(){this.value="",this._touched=!1,this._internals.setFormValue(""),this._internals.setValidity({})}formStateRestoreCallback(e){this.value=e}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleOutsideClick),document.addEventListener("keydown",this._handleKeyDown),this.addEventListener("invalid",this._handleInvalid)}firstUpdated(){this._updateValidity()}updated(e){(e.has("required")||e.has("value"))&&this._updateValidity()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleOutsideClick),document.removeEventListener("keydown",this._handleKeyDown),this.removeEventListener("invalid",this._handleInvalid)}_toggle(){if(!this.disabled&&!this.readonly)if(this._isOpen)this._close();else{this._isOpen=!0;const e=Array.from(this.querySelectorAll("kr-select-option"));this._highlightedIndex=e.findIndex((e=>e.value===this.value)),requestAnimationFrame((()=>{const e=this.shadowRoot?.querySelector(".select-dropdown");if(e){const t=this._triggerElement.getBoundingClientRect(),i=window.innerHeight-t.bottom-4-8;e.style.top=t.bottom+4+"px",e.style.left=t.left+"px",e.style.width=t.width+"px",e.style.maxHeight=i+"px"}}))}}_close(){this._isOpen=!1,this._highlightedIndex=-1}_selectOption(e){e.disabled||(this.value=e.value,this._internals.setFormValue(this.value),this._updateValidity(),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this._close(),this._triggerElement?.focus())}_handleBlur(){this._touched=!0,this._updateValidity()}_updateValidity(){this.required&&!this.value?this._internals.setValidity({valueMissing:!0},"Please select an option",this._triggerElement):this._internals.setValidity({})}render(){const e=Array.from(this.querySelectorAll("kr-select-option")),t=e.find((e=>e.value===this.value))?.label;return j`
1251
+ `],Fe([ue({type:String,reflect:!0})],e.KRTab.prototype,"id",void 0),Fe([ue({type:String})],e.KRTab.prototype,"label",void 0),Fe([ue({type:String})],e.KRTab.prototype,"badge",void 0),Fe([ue({type:String,attribute:"badge-background"})],e.KRTab.prototype,"badgeBackground",void 0),Fe([ue({type:String,attribute:"badge-color"})],e.KRTab.prototype,"badgeColor",void 0),Fe([ue({type:Boolean})],e.KRTab.prototype,"disabled",void 0),Fe([ue({type:Boolean})],e.KRTab.prototype,"dismissible",void 0),Fe([ue({type:Boolean,reflect:!0})],e.KRTab.prototype,"active",void 0),e.KRTab=Fe([he("kr-tab")],e.KRTab);var Be=function(e,t,i,s){var o,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(l=(r<3?o(l):r>3?o(t,i,l):o(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};e.KRSelectField=class extends ae{constructor(){super(),this.label="",this.name="",this.value="",this.placeholder="Select an option",this.disabled=!1,this.required=!1,this.readonly=!1,this.hint="",this._isOpen=!1,this._highlightedIndex=-1,this._touched=!1,this._handleInvalid=e=>{e.preventDefault(),this._touched=!0},this._handleOutsideClick=e=>{e.composedPath().includes(this)||this._close()},this._handleKeyDown=e=>{if(!this._isOpen)return;const t=Array.from(this.querySelectorAll("kr-select-option"));switch(e.key){case"Escape":this._close(),this._triggerElement?.focus();break;case"ArrowDown":if(e.preventDefault(),t.some((e=>!e.disabled))){let e=this._highlightedIndex+1;for(;e<t.length&&t[e]?.disabled;)e++;e<t.length&&(this._highlightedIndex=e)}break;case"ArrowUp":e.preventDefault();{let e=this._highlightedIndex-1;for(;e>=0&&t[e]?.disabled;)e--;e>=0&&(this._highlightedIndex=e)}break;case"Enter":e.preventDefault(),this._highlightedIndex>=0&&this._highlightedIndex<t.length&&this._selectOption(t[this._highlightedIndex])}},this._internals=this.attachInternals()}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}formResetCallback(){this.value="",this._touched=!1,this._internals.setFormValue(""),this._internals.setValidity({})}formStateRestoreCallback(e){this.value=e}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleOutsideClick),document.addEventListener("keydown",this._handleKeyDown),this.addEventListener("invalid",this._handleInvalid)}firstUpdated(){this._updateValidity()}updated(e){(e.has("required")||e.has("value"))&&this._updateValidity()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleOutsideClick),document.removeEventListener("keydown",this._handleKeyDown),this.removeEventListener("invalid",this._handleInvalid)}_toggle(){if(!this.disabled&&!this.readonly)if(this._isOpen)this._close();else{this._isOpen=!0;const e=Array.from(this.querySelectorAll("kr-select-option"));this._highlightedIndex=e.findIndex((e=>e.value===this.value)),requestAnimationFrame((()=>{const e=this.shadowRoot?.querySelector(".select-dropdown");if(e){const t=this._triggerElement.getBoundingClientRect(),i=window.innerHeight-t.bottom-4-8;e.style.top=t.bottom+4+"px",e.style.left=t.left+"px",e.style.width=t.width+"px",e.style.maxHeight=i+"px"}}))}}_close(){this._isOpen=!1,this._highlightedIndex=-1}_selectOption(e){e.disabled||(this.value=e.value,this._internals.setFormValue(this.value),this._updateValidity(),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this._close(),this._triggerElement?.focus())}_handleBlur(){this._touched=!0,this._updateValidity()}_updateValidity(){this.required&&!this.value?this._internals.setValidity({valueMissing:!0},"Please select an option",this._triggerElement):this._internals.setValidity({})}render(){const e=Array.from(this.querySelectorAll("kr-select-option")),t=e.find((e=>e.value===this.value))?.label;return B`
1252
1252
  <div class="wrapper">
1253
- ${this.label?j`
1253
+ ${this.label?B`
1254
1254
  <label>
1255
1255
  ${this.label}
1256
- ${this.required?j`<span class="required" aria-hidden="true">*</span>`:""}
1256
+ ${this.required?B`<span class="required" aria-hidden="true">*</span>`:""}
1257
1257
  </label>
1258
1258
  `:V}
1259
1259
  <div class="select-wrapper">
@@ -1280,7 +1280,7 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
1280
1280
 
1281
1281
  <div class=${we({"select-dropdown":!0,hidden:!this._isOpen})} role="listbox">
1282
1282
  <div class="select-options">
1283
- ${0===e.length?j`<div class="select-empty">No options available</div>`:e.map(((e,t)=>{const i=e.value===this.value;return j`
1283
+ ${0===e.length?B`<div class="select-empty">No options available</div>`:e.map(((e,t)=>{const i=e.value===this.value;return B`
1284
1284
  <div
1285
1285
  class=${we({"select-option":!0,"select-option--selected":i,"select-option--disabled":e.disabled,"select-option--highlighted":t===this._highlightedIndex})}
1286
1286
  role="option"
@@ -1294,12 +1294,12 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
1294
1294
  </div>
1295
1295
  </div>
1296
1296
  </div>
1297
- ${this._touched&&this.required&&!this.value?j`<div class="validation-message">Please select an option</div>`:this.hint?j`<div class="hint">${this.hint}</div>`:""}
1297
+ ${this._touched&&this.required&&!this.value?B`<div class="validation-message">Please select an option</div>`:this.hint?B`<div class="hint">${this.hint}</div>`:""}
1298
1298
  </div>
1299
1299
  <div class="options-slot">
1300
1300
  <slot @slotchange=${()=>this.requestUpdate()}></slot>
1301
1301
  </div>
1302
- `}focus(){this._triggerElement?.focus()}blur(){this._triggerElement?.blur()}},e.KRSelectField.styles=[de,a`
1302
+ `}focus(){this._triggerElement?.focus()}blur(){this._triggerElement?.blur()}},e.KRSelectField.styles=[de,l`
1303
1303
  :host {
1304
1304
  display: block;
1305
1305
  font-family: inherit;
@@ -1475,11 +1475,11 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
1475
1475
  .options-slot {
1476
1476
  display: none;
1477
1477
  }
1478
- `],e.KRSelectField.formAssociated=!0,je([ue({type:String})],e.KRSelectField.prototype,"label",void 0),je([ue({type:String})],e.KRSelectField.prototype,"name",void 0),je([ue({type:String})],e.KRSelectField.prototype,"value",void 0),je([ue({type:String})],e.KRSelectField.prototype,"placeholder",void 0),je([ue({type:Boolean})],e.KRSelectField.prototype,"disabled",void 0),je([ue({type:Boolean})],e.KRSelectField.prototype,"required",void 0),je([ue({type:Boolean})],e.KRSelectField.prototype,"readonly",void 0),je([ue({type:String})],e.KRSelectField.prototype,"hint",void 0),je([fe()],e.KRSelectField.prototype,"_isOpen",void 0),je([fe()],e.KRSelectField.prototype,"_highlightedIndex",void 0),je([fe()],e.KRSelectField.prototype,"_touched",void 0),je([ge(".select-trigger")],e.KRSelectField.prototype,"_triggerElement",void 0),e.KRSelectField=je([ce("kr-select-field")],e.KRSelectField);var Be=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};e.KRSelectOption=class extends le{constructor(){super(...arguments),this.value="",this.disabled=!1}get label(){return this.textContent?.trim()||""}render(){return j`<slot></slot>`}},e.KRSelectOption.styles=a`
1478
+ `],e.KRSelectField.formAssociated=!0,Be([ue({type:String})],e.KRSelectField.prototype,"label",void 0),Be([ue({type:String})],e.KRSelectField.prototype,"name",void 0),Be([ue({type:String})],e.KRSelectField.prototype,"value",void 0),Be([ue({type:String})],e.KRSelectField.prototype,"placeholder",void 0),Be([ue({type:Boolean})],e.KRSelectField.prototype,"disabled",void 0),Be([ue({type:Boolean})],e.KRSelectField.prototype,"required",void 0),Be([ue({type:Boolean})],e.KRSelectField.prototype,"readonly",void 0),Be([ue({type:String})],e.KRSelectField.prototype,"hint",void 0),Be([fe()],e.KRSelectField.prototype,"_isOpen",void 0),Be([fe()],e.KRSelectField.prototype,"_highlightedIndex",void 0),Be([fe()],e.KRSelectField.prototype,"_touched",void 0),Be([ge(".select-trigger")],e.KRSelectField.prototype,"_triggerElement",void 0),e.KRSelectField=Be([he("kr-select-field")],e.KRSelectField);var je=function(e,t,i,s){var o,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(l=(r<3?o(l):r>3?o(t,i,l):o(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};e.KRSelectOption=class extends ae{constructor(){super(...arguments),this.value="",this.disabled=!1}get label(){return this.textContent?.trim()||""}render(){return B`<slot></slot>`}},e.KRSelectOption.styles=l`
1479
1479
  :host {
1480
1480
  display: none;
1481
1481
  }
1482
- `,Be([ue({type:String})],e.KRSelectOption.prototype,"value",void 0),Be([ue({type:Boolean})],e.KRSelectOption.prototype,"disabled",void 0),e.KRSelectOption=Be([ce("kr-select-option")],e.KRSelectOption);const Ve={equals:{key:"equals",type:"comparison",dataTypes:["string","number","date","boolean"],label:"Equals"},n_equals:{key:"n_equals",type:"comparison",dataTypes:["string","number","date","boolean"],label:"Doesn't equal"},contains:{key:"contains",type:"comparison",dataTypes:["string"],label:"Contains"},n_contains:{key:"n_contains",type:"comparison",dataTypes:["string"],label:"Doesn't contain"},starts_with:{key:"starts_with",type:"comparison",dataTypes:["string"],label:"Starts with"},ends_with:{key:"ends_with",type:"comparison",dataTypes:["string"],label:"Ends with"},less_than:{key:"less_than",type:"comparison",dataTypes:["number","date"],label:"Less than"},less_than_equal:{key:"less_than_equal",type:"comparison",dataTypes:["number","date"],label:"Less than or equal"},greater_than:{key:"greater_than",type:"comparison",dataTypes:["number","date"],label:"Greater than"},greater_than_equal:{key:"greater_than_equal",type:"comparison",dataTypes:["number","date"],label:"Greater than or equal"},between:{key:"between",type:"range",dataTypes:["number","date"],label:"Between"},in:{key:"in",type:"list",dataTypes:["string","number"],label:"In"},empty:{key:"empty",type:"nil",dataTypes:["string","number","date","boolean"],label:"Empty"},n_empty:{key:"n_empty",type:"nil",dataTypes:["string","number","date","boolean"],label:"Not empty"}};function Ue(e){const t=[];for(const i of Object.values(Ve))i.dataTypes.includes(e)&&t.push({key:i.key,label:i.label});return t}const Ne=['"',"+","-","&&","||","!","(",")","{","}","[","]","^","~","*","?",":"],We=['\\"',"\\+","\\-","\\&\\&","\\|\\|","\\!","\\(","\\)","\\{","\\}","\\[","\\]","\\^","\\~","\\*","\\?","\\:"];function Xe(e,t=!0){return!0===e||!1===e?e.toString():null===e?"(*:* NOT *)":"number"==typeof e?e.toString():"string"==typeof e?(Ne.forEach(((t,i)=>{var s;e=e.replace(new RegExp(`${s=t,"string"!=typeof s?s:s.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}`,"g"),We[i])})),t?`"${e}"`:e.replace(/ /g,"\\ ")):e}function Ye(e,t=!1){const i=new Date(e);return i.setMinutes(i.getMinutes()-i.getTimezoneOffset()),t&&(i.setUTCHours(23),i.setUTCMinutes(59),i.setUTCSeconds(59),i.setUTCMilliseconds(999)),i.toISOString().replace(/:/g,"\\:")}function Ze(e,t){let i,s,o,r;if(e&&"start"in e&&"end"in e)i=new Date(e.start),s=new Date(e.end),o=t[0],r=t[1];else{if(!(e instanceof Date))return"[* TO *]";i=new Date(e),s=new Date(e),o=t[0],r=t[0]}return"year"===o?(i.setUTCMonth(0,1),i.setUTCHours(0,0,0,0)):"month"===o?(i.setUTCDate(1),i.setUTCHours(0,0,0,0)):"day"===o?i.setUTCHours(0,0,0,0):"time"===o&&i.setUTCSeconds(0,0),"year"===r?(s.setUTCMonth(11,31),s.setUTCHours(23,59,59,999)):"month"===r?(s.setUTCMonth(s.getUTCMonth()+1),s.setUTCDate(0),s.setUTCHours(23,59,59,999)):"day"===r?s.setUTCHours(23,59,59,999):"time"===r&&s.setUTCSeconds(59,999),`[${i.toISOString().replace(/:/g,"\\:")} TO ${s.toISOString().replace(/:/g,"\\:")}]`}function Ge(e,t){let i,s,o,r,a,l;return e&&"start"in e&&"end"in e?(i=new Date(e.start),s=new Date(e.end),o=t[0],r=t[1]):(i=new Date(e),s=new Date(e),o=t[0],r=t[0]),"year"===o?(i.setUTCMonth(0,1),i.setUTCHours(0,0,0,0),a=i):"month"===o?(i.setUTCDate(1),i.setUTCHours(0,0,0,0),a=i):"day"===o?(i.setUTCHours(0,0,0,0),a=i):"time"===o?(i.setUTCSeconds(0,0),a=i):a=i,"year"===r?(s.setUTCMonth(11,31),s.setUTCHours(23,59,59,999),l=s):"month"===r?(s.setUTCMonth(s.getUTCMonth()+1),s.setUTCDate(0),s.setUTCHours(23,59,59,999),l=s):"day"===r?(s.setUTCHours(23,59,59,999),l=s):"time"===r?(s.setUTCSeconds(59,999),l=s):l=s,[a.toISOString().replace(/\..+/,"").replace("T"," "),l.toISOString().replace(/\..+/,"").replace("T"," ")]}function Qe(e){return e=e.trim(),/^(\d{1,2})\/(\d{1,2})\/(\d{2})$/.test(e)||/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/.test(e)?"day":/^(\d{1,2})\/(\d{1,2})\/(\d{4}),?\s+(\d{1,2}):(\d{2})\s*(AM|PM)?$/i.test(e)||/^(?:[A-Za-z]+,\s+)?([A-Za-z]+)\s+(\d{1,2}),?\s+(\d{4}),?\s+(\d{1,2}):(\d{2})\s*(AM|PM)?$/i.test(e)?"time":/^(?:[A-Za-z]+,\s+)?([A-Za-z]+)\s+(\d{1,2}),?\s+(\d{4})$/.test(e)?"day":/^(\d{2})$/.test(e)||/^(\d{4})$/.test(e)?"year":/^([A-Za-z]+)\s+(\d{4})$/.test(e)?"month":null}class Je{constructor(){this.field="",this.operator="equals",this.value=null,this.kql="",this.text="",this.type="",this.specificity=[]}setKql(e){if(this.kql=e.trim(),this.text="",this.specificity=[],this.value=null,this.kql)if(e.startsWith("="))this.operator="equals",this.text=e.substring(1).trim(),this.value=this._parse(this.text),this.specificity=[Qe(this.text)];else if(e.startsWith("!="))this.operator="n_equals",this.text=e.substring(2).trim(),this.value=this._parse(this.text),this.specificity=[Qe(this.text)];else if(e.startsWith("~")&&"string"===this.type)this.operator="contains",this.text=e.substring(1).trim(),this.value=this._parse(this.text),this.specificity=[Qe(this.text)];else if(e.startsWith("!~")&&"string"===this.type)this.operator="n_contains",this.text=e.substring(2).trim(),this.value=this._parse(this.text),this.specificity=[Qe(this.text)];else if(e.endsWith("*")&&"string"===this.type)this.operator="starts_with",this.text=e.substring(0,e.length-1),this.value=this._parse(this.text),this.specificity=[Qe(this.text)];else if(e.startsWith("*")&&"string"===this.type)this.operator="ends_with",this.text=e.substring(1),this.value=this._parse(this.text),this.specificity=[Qe(this.text)];else if("EMPTY"===e)this.operator="empty",this.value=null,this.specificity=[];else if("NOT EMPTY"===e)this.operator="n_empty",this.value=null,this.specificity=[];else if(e.startsWith("<="))this.operator="less_than_equal",this.text=e.substring(2).trim(),this.value=this._parse(this.text),this.specificity=[Qe(this.text)];else if(e.startsWith("<"))this.operator="less_than",this.text=e.substring(1).trim(),this.value=this._parse(this.text),this.specificity=[Qe(this.text)];else if(e.startsWith(">="))this.operator="greater_than_equal",this.text=e.substring(2).trim(),this.value=this._parse(this.text),this.specificity=[Qe(this.text)];else if(e.startsWith(">"))this.operator="greater_than",this.text=e.substring(1).trim(),this.value=this._parse(this.text),this.specificity=[Qe(this.text)];else if(e.startsWith("[")&&e.endsWith("]")&&e.indexOf(" TO ")>-1){this.operator="between";const t=e.indexOf(" TO "),i=e.substring(1,t).trim(),s=e.substring(t+4,e.length-1).trim();this.text=`${i} - ${s}`,this.value={start:this._parse(i),end:this._parse(s)},this.specificity=[Qe(i),Qe(s)]}else e.startsWith("(")&&e.endsWith(")")?(this.operator="in",this.text=e.substring(1,e.length-1).trim(),this.value=this.text.split(",").map((e=>e.trim())).map((e=>this._parse(e))),this.specificity=[Qe(this.text)]):"date"===this.type||"boolean"===this.type||"number"===this.type?(this.operator="equals",this.text=this.kql,this.value=this._parse(this.text),this.specificity=[Qe(this.text)]):(this.operator="contains",this.text=e,this.value=this._parse(this.text),this.specificity=[Qe(this.text)]);else"string"===this.type?this.operator="contains":this.operator="equals"}setOperator(e){"empty"===this.operator||"n_empty"===this.operator||"between"===this.operator?(this.value=null,this.text=""):"in"===this.operator&&(this.value=[],this.text=""),this.operator=e,"empty"===this.operator?(this.value="EMPTY",this.text="EMPTY"):"n_empty"===this.operator?(this.value="NOT EMPTY",this.text="NOT EMPTY"):"between"===this.operator?(this.value=null,this.text=""):"in"===this.operator&&(this.value=[],this.text=""),this._buildKql()}setValue(e,t){this.value=e,t?this.specificity=[t]:e instanceof Date?this.specificity=["time"]:this.specificity=[],this._buildText(),this._buildKql()}setStart(e,t){void 0===this.value?.start&&(this.value={start:null,end:null}),this.value.start=e,t?this.specificity[0]=t:e instanceof Date&&(this.specificity[0]="time"),this._buildText(),this._buildKql()}setEnd(e,t){void 0===this.value?.end&&(this.value={start:null,end:null}),this.value.end=e,t?this.specificity[1]=t:e instanceof Date&&(this.specificity[1]="time"),this._buildText(),this._buildKql()}clear(){"string"===this.type?this.operator="contains":this.operator="equals",this.value=null,this.kql="",this.text="",this.specificity=[]}isEmpty(){return"empty"===this.operator||"n_empty"===this.operator?!this.text:"between"===this.operator?!this.value?.start&&!this.value?.end:"in"===this.operator?!this.value?.length:void 0===this.value||null===this.value||""===this.value}has(e){return!("in"!==this.operator||!Array.isArray(this.value))&&("boolean"===this.type&&"string"==typeof e&&("true"===e?e=!0:"false"===e&&(e=!1)),this.value.indexOf(e)>=0)}toggle(e){"in"!==this.operator&&this.setOperator("in"),"boolean"===this.type&&"string"==typeof e&&("true"===e?e=!0:"false"===e&&(e=!1));const t=this.value.indexOf(e);t>=0?this.value.splice(t,1):this.value.push(e),this._buildText(),this._buildKql()}isValid(){return!this.kql||!!this.field&&(!!this.operator&&("empty"===this.operator||("n_empty"===this.operator||("in"===this.operator?Array.isArray(this.value)&&this.value.length>0:"date"===this.type?"between"===this.operator?this.value?.start instanceof Date&&this.value?.end instanceof Date&&!isNaN(this.value.start.getTime())&&!isNaN(this.value.end.getTime()):this.value instanceof Date&&!isNaN(this.value.getTime()):"number"===this.type?"between"===this.operator?"number"==typeof this.value?.start&&"number"==typeof this.value?.end:"number"==typeof this.value:"boolean"===this.type?"boolean"==typeof this.value:"string"==typeof this.value&&!!this.value.trim().length))))}toSolrData(){const e={boost:null,fuzzy:null,not:!1,name:null,operation:null,tagged:!1,value:null};switch(e.name=this.field,this.operator){case"equals":this.value instanceof Date?(e.operation="EXPRESSION",e.value=Ze(this.value,this.specificity)):(e.operation="IS",e.value=this.value);break;case"n_equals":this.value instanceof Date?(e.operation="EXPRESSION",e.not=!0,e.value=Ze(this.value,this.specificity)):(e.operation="IS",e.not=!0,e.value=this.value);break;case"contains":e.operation="EXPRESSION",e.value=`*${Xe(this.value,!1)}*`;break;case"n_contains":e.operation="EXPRESSION",e.not=!0,e.value=`*${Xe(this.value,!1)}*`;break;case"starts_with":e.operation="EXPRESSION",e.value=`${Xe(this.value,!1)}*`;break;case"ends_with":e.operation="EXPRESSION",e.value=`*${Xe(this.value,!1)}`;break;case"empty":e.operation="EXPRESSION",e.not=!0,e.value="[* TO *]";break;case"n_empty":e.operation="EXPRESSION",e.value="[* TO *]";break;case"less_than":this.value instanceof Date?(e.operation="EXPRESSION",e.value=`[* TO ${Ye(this.value)}}`):(e.operation="EXPRESSION",e.value=`[* TO ${Xe(this.value,!0)}}`);break;case"less_than_equal":this.value instanceof Date?(e.operation="EXPRESSION",e.value=`[* TO ${Ye(this.value,!0)}]`):(e.operation="EXPRESSION",e.value=`[* TO ${Xe(this.value,!0)}]`);break;case"greater_than":this.value instanceof Date?(e.operation="EXPRESSION",e.value=`{${Ye(this.value,!0)} TO *]`):(e.operation="EXPRESSION",e.value=`{${Xe(this.value,!0)} TO *]`);break;case"greater_than_equal":this.value instanceof Date?(e.operation="EXPRESSION",e.value=`[${Ye(this.value)} TO *]`):(e.operation="EXPRESSION",e.value=`[${Xe(this.value,!0)} TO *]`);break;case"between":this.value?.start instanceof Date&&this.value?.end instanceof Date?(e.operation="EXPRESSION",e.value=Ze(this.value,this.specificity)):(e.operation="EXPRESSION",e.value=`[${this.value.start} TO ${this.value.end}]`);break;case"in":Array.isArray(this.value)&&this.value.length>0?(e.operation="EXPRESSION",e.value=`(${this.value.map((e=>Xe(e,!0))).join(" OR ")})`):(e.operation="EXPRESSION",e.value=Xe(this.value,!0));break;default:e.operation="EXPRESSION",e.value=Xe(this.value,!0)}return e}toDbParams(){const e={boost:null,fuzzy:null,not:!1,name:null,operation:null,tagged:!1,value:null,values:null};switch(e.name=this.field,this.operator){case"equals":"date"===this.type?(e.operation="BETWEEN",e.values=Ge(this.value,this.specificity)):(e.operation="IS",e.value=this.value);break;case"n_equals":"date"===this.type?(e.operation="BETWEEN",e.not=!0,e.values=Ge(this.value,this.specificity)):(e.operation="IS",e.value=this.value,e.not=!0);break;case"contains":e.operation="CONTAINS",e.value=this.value;break;case"n_contains":e.operation="CONTAINS",e.value=this.value,e.not=!0;break;case"starts_with":e.operation="STARTS_WITH",e.value=this.value;break;case"ends_with":e.operation="ENDS_WITH",e.value=this.value;break;case"empty":e.operation="IS_BLANK";break;case"n_empty":e.operation="IS_NOT_BLANK";break;case"less_than":e.operation="LESS_THAN",e.value=this.value;break;case"less_than_equal":e.operation="LESS_THAN_EQUAL",e.value=this.value;break;case"greater_than":e.operation="GREATER_THAN",e.value=this.value;break;case"greater_than_equal":e.operation="GREATER_THAN_EQUAL",e.value=this.value;break;case"between":e.operation="BETWEEN","date"===this.type?e.values=Ge(this.value,this.specificity):e.values=[this.value.start,this.value.end];break;case"in":e.operation="IN",e.values=this.value??[];break;default:throw Error(`${this.operator} operator not supported by db params.`)}return e}_buildText(){this.isEmpty()?this.text="":"between"===this.operator?this.text=`${this._format(this.value?.start)} - ${this._format(this.value?.end)}`:"in"===this.operator?this.text=this.value.map((e=>this._format(e))).join(","):this.text=this._format(this.value)}_format(e){if(e instanceof Date&&!isNaN(e.getTime())){return`${String(e.getUTCMonth()+1).padStart(2,"0")}/${String(e.getUTCDate()).padStart(2,"0")}/${e.getUTCFullYear()}`}return"boolean"==typeof e?e?"Yes":"No":String(e??"")}_parse(e){if(null==e||""===e)return null;if(this.type)switch(this.type){case"boolean":{const t=e.toString().toLowerCase();return!0===e||!1!==e&&("yes"===t||"no"!==t&&("1"===t||"0"!==t&&null))}case"date":return this._parseDate(e);case"number":{const t=Number(e.toString().replace(/[$,]+/g,""));return isNaN(t)?null:t}default:return e.toString()}return e}_parseDate(e){if(null==e||""===e)return null;const t={jan:0,january:0,feb:1,february:1,mar:2,march:2,apr:3,april:3,may:4,jun:5,june:5,jul:6,july:6,aug:7,august:7,sep:8,september:8,oct:9,october:9,nov:10,november:10,dec:11,december:11};let i;if(i=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{2})$/),i)return new Date(Date.UTC(2e3+parseInt(i[3]),parseInt(i[1])-1,parseInt(i[2])));if(i=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/),i)return new Date(Date.UTC(parseInt(i[3]),parseInt(i[1])-1,parseInt(i[2])));if(i=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4}),?\s+(\d{1,2}):(\d{2})\s*(AM|PM)?$/i),i){let e=parseInt(i[4]);return i[6]&&("PM"===i[6].toUpperCase()&&12!==e&&(e+=12),"AM"===i[6].toUpperCase()&&12===e&&(e=0)),new Date(Date.UTC(parseInt(i[3]),parseInt(i[1])-1,parseInt(i[2]),e,parseInt(i[5])))}if(i=e.match(/^(?:[A-Za-z]+,\s+)?([A-Za-z]+)\s+(\d{1,2}),?\s+(\d{4}),?\s+(\d{1,2}):(\d{2})\s*(AM|PM)?$/i),i){const e=t[i[1].toLowerCase()];if(void 0!==e){let t=parseInt(i[4]);return i[6]&&("PM"===i[6].toUpperCase()&&12!==t&&(t+=12),"AM"===i[6].toUpperCase()&&12===t&&(t=0)),new Date(Date.UTC(parseInt(i[3]),e,parseInt(i[2]),t,parseInt(i[5])))}}if(i=e.match(/^(?:[A-Za-z]+,\s+)?([A-Za-z]+)\s+(\d{1,2}),?\s+(\d{4})$/),i){const e=t[i[1].toLowerCase()];if(void 0!==e)return new Date(Date.UTC(parseInt(i[3]),e,parseInt(i[2])))}if(i=e.match(/^(\d{2})$/),i)return new Date(Date.UTC(2e3+parseInt(i[1]),0,1));if(i=e.match(/^(\d{4})$/),i)return new Date(Date.UTC(parseInt(i[1]),0,1));if(i=e.match(/^([A-Za-z]+)\s+(\d{4})$/),i){const e=t[i[1].toLowerCase()];if(void 0!==e)return new Date(Date.UTC(parseInt(i[2]),e,1))}return null}_buildKql(){if(this.isEmpty())this.kql="";else switch(this.operator){case"equals":this.kql=`= ${this.text}`;break;case"n_equals":this.kql=`!= ${this.text}`;break;case"contains":this.kql=`~ ${this.text}`;break;case"n_contains":this.kql=`!~ ${this.text}`;break;case"starts_with":this.kql=`${this.text}*`;break;case"ends_with":this.kql=`*${this.text}`;break;case"empty":this.kql="EMPTY";break;case"n_empty":this.kql="NOT EMPTY";break;case"less_than":this.kql=`< ${this.text}`;break;case"less_than_equal":this.kql=`<= ${this.text}`;break;case"greater_than":this.kql=`> ${this.text}`;break;case"greater_than_equal":this.kql=`>= ${this.text}`;break;case"between":this.kql=`[${this._format(this.value?.start??"")} TO ${this._format(this.value?.end??"")}]`;break;case"in":this.kql=`(${this.value.map((e=>this._format(e))).join(",")})`;break;default:throw Error(`Unknown operator ${this.operator}`)}}}var et=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};class tt{constructor(){this.title="",this.actions=[],this.columns=[],this.displayedColumns=[],this.data=null,this.dataSource=null,this.refreshInterval=0,this.pageSize=0,this.rowClickable=!1,this.rowHref=null}}e.KRTable=class extends le{constructor(){super(...arguments),this._scrollStyle="overlay",this._data=[],this._dataState="idle",this._page=1,this._pageSize=50,this._totalItems=0,this._totalPages=0,this._searchQuery="",this._canScrollLeft=!1,this._canScrollRight=!1,this._canScrollHorizontal=!1,this._columnPickerOpen=!1,this._filterPanelOpened=null,this._filterPanelTab="filter",this._buckets=new Map,this._filterPanelPos={top:0,left:0},this._resizing=null,this._resizeObserver=null,this._searchPositionLocked=!1,this._model=new tt,this.def={columns:[]},this._handleClickOutside=e=>{const t=e.composedPath();if(this._columnPickerOpen){const e=this.shadowRoot?.querySelector(".column-picker-wrapper");e&&!t.includes(e)&&(this._columnPickerOpen=!1)}this._filterPanelOpened&&(t.some((e=>e.classList?.contains("filter-panel")))||this._handleFilterApply())},this._handleResizeMove=e=>{if(!this._resizing)return;const t=this._model.columns.find((e=>e.id===this._resizing.columnId));if(t){const i=this._resizing.startWidth+(e.clientX-this._resizing.startX);t.width=`${Math.min(900,Math.max(50,i))}px`,this.requestUpdate()}},this._handleResizeEnd=()=>{this._resizing=null,document.removeEventListener("mousemove",this._handleResizeMove),document.removeEventListener("mouseup",this._handleResizeEnd)}}connectedCallback(){super.connectedCallback(),this.classList.toggle("kr-table--scroll-overlay","overlay"===this._scrollStyle),this.classList.toggle("kr-table--scroll-edge","edge"===this._scrollStyle),this._fetch(),this._initRefresh(),document.addEventListener("click",this._handleClickOutside),this._resizeObserver=new ResizeObserver((()=>{this._searchPositionLocked=!1,this._updateSearchPosition()})),this._resizeObserver.observe(this)}disconnectedCallback(){super.disconnectedCallback(),clearInterval(this._refreshTimer),document.removeEventListener("click",this._handleClickOutside),this._resizeObserver?.disconnect()}willUpdate(e){e.has("def")&&(this._model=new tt,this.def.title&&(this._model.title=this.def.title),this.def.actions&&(this._model.actions=this.def.actions),this.def.data&&(this._model.data=this.def.data),this.def.dataSource&&(this._model.dataSource=this.def.dataSource),"number"==typeof this.def.refreshInterval&&(this._model.refreshInterval=this.def.refreshInterval),"number"==typeof this.def.pageSize&&(this._model.pageSize=this.def.pageSize),this.def.rowClickable&&(this._model.rowClickable=this.def.rowClickable),this.def.rowHref&&(this._model.rowHref=this.def.rowHref),this._model.columns=this.def.columns.map((e=>{const t={...e,filter:null};return t.type||(t.type="string"),"actions"===t.type?(t.label=e.label??"",t.sticky="right",t.resizable=!1,t):((e.filterable||e.facetable)&&(t.filter=new Je,t.filter.field=e.id,t.filter.type=t.type,e.facetable&&!e.filterable?(t.filter.operator="in",t.filter.value=[]):"string"===t.filter.type&&(t.filter.operator="contains")),t)})),this.def.displayedColumns?this._model.displayedColumns=this.def.displayedColumns:this._model.displayedColumns=this._model.columns.map((e=>e.id)),this._fetch(),this._initRefresh())}updated(e){this._updateScrollFlags(),this._syncSlottedContent()}_syncSlottedContent(){const e=this.getDisplayedColumns().filter((e=>e.render));e.length&&(this.querySelectorAll('[slot^="cell-"]').forEach((e=>e.remove())),this._data.forEach(((t,i)=>{e.forEach((e=>{const s=e.render(t);if(!s)return;const o=document.createElement("span");o.slot=`cell-${i}-${e.id}`,"actions"===e.type&&(o.style.display="flex",o.style.gap="8px"),"string"==typeof s?o.innerHTML=s:re(s,o),this.appendChild(o)}))})))}refresh(){this._fetch()}goToPrevPage(){this._page>1&&(this._page--,this._fetch())}goToNextPage(){this._page<this._totalPages&&(this._page++,this._fetch())}goToPage(e){e>=1&&e<=this._totalPages&&(this._page=e,this._fetch())}_toSolrData(){const e={page:this._page-1,size:this._pageSize,sorts:[],filterFields:[],queryFields:[],facetFields:[]};for(const t of this._model.columns){if(!t.filter||t.filter.isEmpty()||!t.filter.isValid())continue;const i=t.filter.toSolrData();t.facetable&&"in"===t.filter.operator&&(i.tagged=!0),e.filterFields.push(i)}for(const t of this._model.columns)t.facetable&&e.facetFields.push({name:t.id,type:"FIELD",limit:100,sort:"count",minimumCount:1});return this._searchQuery?.trim().length&&e.queryFields.push({name:"_text_",operation:"IS",value:Xe(this._searchQuery,!1)}),e}_toDbParams(){const e={page:this._page-1,size:this._pageSize,sorts:[],filterFields:[],queryFields:[],facetFields:[]};for(const t of this._model.columns)t.filter&&!t.filter.isEmpty()&&t.filter.isValid()&&e.filterFields.push(t.filter.toDbParams());return this._searchQuery?.trim().length&&this._model.columns.filter((e=>e.searchable)).forEach((t=>{e.queryFields.push({name:t.id,operation:"CONTAINS",value:this._searchQuery,and:!1})})),e}_fetch(){if(this._model.data)return this._data=this._model.data,this._totalItems=this._model.data.length,this._totalPages=Math.ceil(this._model.data.length/this._pageSize),void(this._dataState="success");if(!this._model.dataSource)return;let t;this._dataState="loading",t="db"===this._model.dataSource.mode?this._toDbParams():this._toSolrData(),this._model.dataSource.fetch(t).then((e=>{switch(this._model.dataSource?.mode){case"opensearch":throw Error("Opensearch not supported yet");case"db":{const t=e;this._data=t.data.content,this._totalItems=t.data.totalElements,this._totalPages=t.data.totalPages,this._pageSize=t.data.size;break}default:{const t=e;this._data=t.data.content,this._totalItems=t.data.totalElements,this._totalPages=t.data.totalPages,this._pageSize=t.data.size,this._parseFacetResults(t)}}this._dataState="success",this._updateSearchPosition()})).catch((t=>{this._dataState="error",e.KRSnackbar.show({message:t instanceof Error?t.message:"Failed to load data",type:"error"})}))}_parseFacetResults(e){if(e.data.facetFields){for(const t of this._model.columns){if(!t.facetable)continue;const i=e.data.facetFields[t.id];if(!i){this._buckets.set(t.id,[]);continue}const s=[];for(const e of i){let i=e.name;"boolean"===t.type&&"string"==typeof e.name&&("true"===e.name?i=!0:"false"===e.name&&(i=!1)),null===e.name&&e.count>0&&s.unshift({val:null,count:e.count}),null!==e.name&&s.push({val:i,count:e.count})}if(t.filter&&"in"===t.filter.operator&&Array.isArray(t.filter.value))for(const e of t.filter.value)s.some((t=>t.val===e))||s.push({val:e,count:0});this._buckets.set(t.id,s)}this._buckets=new Map(this._buckets)}}_initRefresh(){clearInterval(this._refreshTimer),this._model.refreshInterval&&this._model.refreshInterval>0&&(this._refreshTimer=window.setInterval((()=>{this._fetch()}),this._model.refreshInterval))}_handleSearch(e){const t=e.target;this._searchQuery=t.value,this._page=1,this._fetch()}_getGridTemplateColumns(){return this.getDisplayedColumns().map((e=>e.width?e.width:"actions"===e.type?"max-content":"minmax(80px, auto)")).join(" ")}_updateSearchPosition(){if(this._searchPositionLocked)return;const e=this.shadowRoot?.querySelector(".search"),t=e?.querySelector(".search-field");e&&t&&(e.style.justifyContent="center",t.style.marginLeft="",requestAnimationFrame((()=>{const i=e.getBoundingClientRect(),s=t.getBoundingClientRect().left-i.left;e.style.justifyContent="flex-start",t.style.marginLeft=`${s}px`,this._searchPositionLocked=!0})))}_toggleColumnPicker(){this._columnPickerOpen=!this._columnPickerOpen}_toggleColumn(e){this._model.displayedColumns.includes(e)?this._model.displayedColumns=this._model.displayedColumns.filter((t=>t!==e)):this._model.displayedColumns=[...this._model.displayedColumns,e]}_handleRowMouseDown(){this._model.rowClickable&&window.getSelection()?.removeAllRanges()}_handleRowClick(e,t){if(!this._model.rowClickable)return;const i=window.getSelection();i&&i.toString().length>0||this.dispatchEvent(new CustomEvent("row-click",{detail:{row:e,rowIndex:t},bubbles:!0,composed:!0}))}getDisplayedColumns(){return this._model.displayedColumns.map((e=>this._model.columns.find((t=>t.id===e)))).sort(((e,t)=>"actions"===e.type&&"actions"!==t.type?1:"actions"!==e.type&&"actions"===t.type?-1:0))}_handleScroll(e){const t=e.target;this._canScrollLeft=t.scrollLeft>0,this._canScrollRight=t.scrollLeft<t.scrollWidth-t.clientWidth-1}_updateScrollFlags(){const e=this.shadowRoot?.querySelector(".content");e&&(this._canScrollLeft=e.scrollLeft>0,this._canScrollRight=e.scrollWidth>e.clientWidth&&e.scrollLeft<e.scrollWidth-e.clientWidth-1,this._canScrollHorizontal=e.scrollWidth>e.clientWidth),this.classList.toggle("kr-table--scroll-left-available",this._canScrollLeft),this.classList.toggle("kr-table--scroll-right-available",this._canScrollRight),this.classList.toggle("kr-table--scroll-horizontal-available",this._canScrollHorizontal),this.classList.toggle("kr-table--sticky-left",this.getDisplayedColumns().some((e=>"left"===e.sticky))),this.classList.toggle("kr-table--sticky-right",this.getDisplayedColumns().some((e=>"right"===e.sticky)))}_handleResizeStart(e,t){e.preventDefault();const i=this.shadowRoot?.querySelector(`.header-cell[data-column-id="${t}"]`);this._resizing={columnId:t,startX:e.clientX,startWidth:i?.offsetWidth||200},document.addEventListener("mousemove",this._handleResizeMove),document.addEventListener("mouseup",this._handleResizeEnd)}_handleAction(e){e.href||this.dispatchEvent(new CustomEvent("action",{detail:{action:e.id},bubbles:!0,composed:!0}))}_handleKqlChange(e,t){const i=e.target.value.trim();if(i){if(t.filter.setKql(i),this.requestUpdate(),!t.filter.isValid())return}else t.filter.clear(),this.requestUpdate();this._page=1,this._fetch()}_handleFilterPanelToggle(e,t){if(e.stopPropagation(),this._filterPanelOpened===t.id)this._filterPanelOpened=null;else{const i=e.currentTarget.getBoundingClientRect();this._filterPanelPos={top:i.bottom+4,left:i.left},this._filterPanelOpened=t.id,t.facetable?this._filterPanelTab="counts":this._filterPanelTab="filter"}}_handleKqlClear(e){e.filter.clear(),this._page=1,this._fetch()}_handleFilterClear(){const e=this._model.columns.find((e=>e.id===this._filterPanelOpened));e&&(e.filter.clear(),e.facetable&&!e.filterable&&(e.filter.operator="in",e.filter.value=[])),this._filterPanelOpened=null,this._page=1,this._fetch()}_handleFilterTextKeydown(e,t){"Enter"===e.key&&(e.preventDefault(),this._handleFilterApply())}_handleOperatorChange(e,t){t.filter.setOperator(e.target.value),this.requestUpdate()}_handleFilterStringChange(e,t){t.filter.setValue(e.target.value),this.requestUpdate()}_handleFilterNumberChange(e,t){t.filter.setValue(Number(e.target.value)),this.requestUpdate()}_handleFilterDateChange(e,t){t.filter.setValue(new Date(e.target.value),"day"),this.requestUpdate()}_handleFilterBooleanChange(e,t){t.filter.setValue("true"===e.target.value),this.requestUpdate()}_handleFilterDateStartChange(e,t){t.filter.setStart(new Date(e.target.value),"day"),this.requestUpdate()}_handleFilterDateEndChange(e,t){t.filter.setEnd(new Date(e.target.value),"day"),this.requestUpdate()}_handleFilterNumberStartChange(e,t){t.filter.setStart(Number(e.target.value)),this.requestUpdate()}_handleFilterNumberEndChange(e,t){t.filter.setEnd(Number(e.target.value)),this.requestUpdate()}_handleFilterListChange(e,t){const i=e.target.value.split(",").map((e=>e.trim())).filter((e=>""!==e));"number"===t.type?t.filter.setValue(i.map((e=>Number(e)))):t.filter.setValue(i),this.requestUpdate()}_handleFilterApply(){this._filterPanelOpened=null,this._page=1,this._fetch()}_handleFilterPanelTabChange(e){this._filterPanelTab=e.detail.activeTabId}_handleBucketToggle(e,t,i){t.filter.toggle(i.val),this._page=1,this._fetch()}_renderCellContent(e,t,i){const s=t[e.id];if(e.render)return j`<slot name="cell-${i}-${e.id}"></slot>`;if(null==s)return"";switch(e.type){case"number":return"currency"===e.format&&"number"==typeof s?s.toLocaleString("en-US",{style:"currency",currency:"USD"}):String(s);case"date":{let e;if(s instanceof Date)e=s;else if("string"==typeof s&&/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/.test(s)){const t=s.replace(/(\d{2}:\d{2}:\d{2}):(\d+)$/,"$1.$2").replace(" ","T")+"Z";e=new Date(t)}else e=new Date(s);return e.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZone:"UTC"})}case"boolean":return!0===s?"Yes":!1===s?"No":"";default:return String(s)}}_getHeaderCellClasses(e,t){return{"header-cell":!0,"header-cell--align-center":"center"===e.align,"header-cell--align-right":"right"===e.align,"header-cell--sticky-left":"left"===e.sticky,"header-cell--sticky-left-last":"left"===e.sticky&&!this.getDisplayedColumns().slice(t+1).some((e=>"left"===e.sticky)),"header-cell--sticky-right":"right"===e.sticky,"header-cell--sticky-right-first":"right"===e.sticky&&!this.getDisplayedColumns().slice(0,t).some((e=>"right"===e.sticky))}}_getCellClasses(e,t){return{cell:!0,"cell--actions":"actions"===e.type,"cell--align-center":"center"===e.align,"cell--align-right":"right"===e.align,"cell--sticky-left":"left"===e.sticky,"cell--sticky-left-last":"left"===e.sticky&&!this.getDisplayedColumns().slice(t+1).some((e=>"left"===e.sticky)),"cell--sticky-right":"right"===e.sticky,"cell--sticky-right-first":"right"===e.sticky&&!this.getDisplayedColumns().slice(0,t).some((e=>"right"===e.sticky))}}_getCellStyle(e,t){const i={};if("left"===e.sticky){let e=0;for(let i=0;i<t;i++){const t=this.getDisplayedColumns()[i];"left"===t.sticky&&(e+=parseInt(t.width||"0",10))}i.left=`${e}px`}if("right"===e.sticky){let e=0;for(let i=t+1;i<this.getDisplayedColumns().length;i++){const t=this.getDisplayedColumns()[i];"right"===t.sticky&&(e+=parseInt(t.width||"0",10))}i.right=`${e}px`}return i}_renderPagination(){const e=(this._page-1)*this._pageSize+1,t=Math.min(this._page*this._pageSize,this._totalItems);return j`
1482
+ `,je([ue({type:String})],e.KRSelectOption.prototype,"value",void 0),je([ue({type:Boolean})],e.KRSelectOption.prototype,"disabled",void 0),e.KRSelectOption=je([he("kr-select-option")],e.KRSelectOption);const Ve={equals:{key:"equals",type:"comparison",dataTypes:["string","number","date","boolean"],label:"Equals"},n_equals:{key:"n_equals",type:"comparison",dataTypes:["string","number","date","boolean"],label:"Doesn't equal"},contains:{key:"contains",type:"comparison",dataTypes:["string"],label:"Contains"},n_contains:{key:"n_contains",type:"comparison",dataTypes:["string"],label:"Doesn't contain"},starts_with:{key:"starts_with",type:"comparison",dataTypes:["string"],label:"Starts with"},ends_with:{key:"ends_with",type:"comparison",dataTypes:["string"],label:"Ends with"},less_than:{key:"less_than",type:"comparison",dataTypes:["number","date"],label:"Less than"},less_than_equal:{key:"less_than_equal",type:"comparison",dataTypes:["number","date"],label:"Less than or equal"},greater_than:{key:"greater_than",type:"comparison",dataTypes:["number","date"],label:"Greater than"},greater_than_equal:{key:"greater_than_equal",type:"comparison",dataTypes:["number","date"],label:"Greater than or equal"},between:{key:"between",type:"range",dataTypes:["number","date"],label:"Between"},in:{key:"in",type:"list",dataTypes:["string","number"],label:"In"},empty:{key:"empty",type:"nil",dataTypes:["string","number","date","boolean"],label:"Empty"},n_empty:{key:"n_empty",type:"nil",dataTypes:["string","number","date","boolean"],label:"Not empty"}};function Ue(e){const t=[];for(const i of Object.values(Ve))i.dataTypes.includes(e)&&t.push({key:i.key,label:i.label});return t}const Ne=['"',"+","-","&&","||","!","(",")","{","}","[","]","^","~","*","?",":"],We=['\\"',"\\+","\\-","\\&\\&","\\|\\|","\\!","\\(","\\)","\\{","\\}","\\[","\\]","\\^","\\~","\\*","\\?","\\:"];function Xe(e,t=!0){return!0===e||!1===e?e.toString():null===e?"(*:* NOT *)":"number"==typeof e?e.toString():"string"==typeof e?(Ne.forEach(((t,i)=>{var s;e=e.replace(new RegExp(`${s=t,"string"!=typeof s?s:s.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}`,"g"),We[i])})),t?`"${e}"`:e.replace(/ /g,"\\ ")):e}function Ye(e,t=!1){const i=new Date(e);return i.setMinutes(i.getMinutes()-i.getTimezoneOffset()),t&&(i.setUTCHours(23),i.setUTCMinutes(59),i.setUTCSeconds(59),i.setUTCMilliseconds(999)),i.toISOString().replace(/:/g,"\\:")}function Ze(e,t){let i,s,o,r;if(e&&"start"in e&&"end"in e)i=new Date(e.start),s=new Date(e.end),o=t[0],r=t[1];else{if(!(e instanceof Date))return"[* TO *]";i=new Date(e),s=new Date(e),o=t[0],r=t[0]}return"year"===o?(i.setUTCMonth(0,1),i.setUTCHours(0,0,0,0)):"month"===o?(i.setUTCDate(1),i.setUTCHours(0,0,0,0)):"day"===o?i.setUTCHours(0,0,0,0):"time"===o&&i.setUTCSeconds(0,0),"year"===r?(s.setUTCMonth(11,31),s.setUTCHours(23,59,59,999)):"month"===r?(s.setUTCMonth(s.getUTCMonth()+1),s.setUTCDate(0),s.setUTCHours(23,59,59,999)):"day"===r?s.setUTCHours(23,59,59,999):"time"===r&&s.setUTCSeconds(59,999),`[${i.toISOString().replace(/:/g,"\\:")} TO ${s.toISOString().replace(/:/g,"\\:")}]`}function Qe(e,t){let i,s,o,r,l,a;return e&&"start"in e&&"end"in e?(i=new Date(e.start),s=new Date(e.end),o=t[0],r=t[1]):(i=new Date(e),s=new Date(e),o=t[0],r=t[0]),"year"===o?(i.setUTCMonth(0,1),i.setUTCHours(0,0,0,0),l=i):"month"===o?(i.setUTCDate(1),i.setUTCHours(0,0,0,0),l=i):"day"===o?(i.setUTCHours(0,0,0,0),l=i):"time"===o?(i.setUTCSeconds(0,0),l=i):l=i,"year"===r?(s.setUTCMonth(11,31),s.setUTCHours(23,59,59,999),a=s):"month"===r?(s.setUTCMonth(s.getUTCMonth()+1),s.setUTCDate(0),s.setUTCHours(23,59,59,999),a=s):"day"===r?(s.setUTCHours(23,59,59,999),a=s):"time"===r?(s.setUTCSeconds(59,999),a=s):a=s,[l.toISOString().replace(/\..+/,"").replace("T"," "),a.toISOString().replace(/\..+/,"").replace("T"," ")]}function Ge(e){return e=e.trim(),/^(\d{1,2})\/(\d{1,2})\/(\d{2})$/.test(e)||/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/.test(e)?"day":/^(\d{1,2})\/(\d{1,2})\/(\d{4}),?\s+(\d{1,2}):(\d{2})\s*(AM|PM)?$/i.test(e)||/^(?:[A-Za-z]+,\s+)?([A-Za-z]+)\s+(\d{1,2}),?\s+(\d{4}),?\s+(\d{1,2}):(\d{2})\s*(AM|PM)?$/i.test(e)?"time":/^(?:[A-Za-z]+,\s+)?([A-Za-z]+)\s+(\d{1,2}),?\s+(\d{4})$/.test(e)?"day":/^(\d{2})$/.test(e)||/^(\d{4})$/.test(e)?"year":/^([A-Za-z]+)\s+(\d{4})$/.test(e)?"month":null}class Je{constructor(){this.field="",this.operator="equals",this.value=null,this.kql="",this.text="",this.type="",this.specificity=[]}setKql(e){if(this.kql=e.trim(),this.text="",this.specificity=[],this.value=null,this.kql)if(e.startsWith("="))this.operator="equals",this.text=e.substring(1).trim(),this.value=this._parse(this.text),this.specificity=[Ge(this.text)];else if(e.startsWith("!="))this.operator="n_equals",this.text=e.substring(2).trim(),this.value=this._parse(this.text),this.specificity=[Ge(this.text)];else if(e.startsWith("~")&&"string"===this.type)this.operator="contains",this.text=e.substring(1).trim(),this.value=this._parse(this.text),this.specificity=[Ge(this.text)];else if(e.startsWith("!~")&&"string"===this.type)this.operator="n_contains",this.text=e.substring(2).trim(),this.value=this._parse(this.text),this.specificity=[Ge(this.text)];else if(e.endsWith("*")&&"string"===this.type)this.operator="starts_with",this.text=e.substring(0,e.length-1),this.value=this._parse(this.text),this.specificity=[Ge(this.text)];else if(e.startsWith("*")&&"string"===this.type)this.operator="ends_with",this.text=e.substring(1),this.value=this._parse(this.text),this.specificity=[Ge(this.text)];else if("EMPTY"===e)this.operator="empty",this.value=null,this.specificity=[];else if("NOT EMPTY"===e)this.operator="n_empty",this.value=null,this.specificity=[];else if(e.startsWith("<="))this.operator="less_than_equal",this.text=e.substring(2).trim(),this.value=this._parse(this.text),this.specificity=[Ge(this.text)];else if(e.startsWith("<"))this.operator="less_than",this.text=e.substring(1).trim(),this.value=this._parse(this.text),this.specificity=[Ge(this.text)];else if(e.startsWith(">="))this.operator="greater_than_equal",this.text=e.substring(2).trim(),this.value=this._parse(this.text),this.specificity=[Ge(this.text)];else if(e.startsWith(">"))this.operator="greater_than",this.text=e.substring(1).trim(),this.value=this._parse(this.text),this.specificity=[Ge(this.text)];else if(e.startsWith("[")&&e.endsWith("]")&&e.indexOf(" TO ")>-1){this.operator="between";const t=e.indexOf(" TO "),i=e.substring(1,t).trim(),s=e.substring(t+4,e.length-1).trim();this.text=`${i} - ${s}`,this.value={start:this._parse(i),end:this._parse(s)},this.specificity=[Ge(i),Ge(s)]}else e.startsWith("(")&&e.endsWith(")")?(this.operator="in",this.text=e.substring(1,e.length-1).trim(),this.value=this.text.split(",").map((e=>e.trim())).map((e=>this._parse(e))),this.specificity=[Ge(this.text)]):"date"===this.type||"boolean"===this.type||"number"===this.type?(this.operator="equals",this.text=this.kql,this.value=this._parse(this.text),this.specificity=[Ge(this.text)]):(this.operator="contains",this.text=e,this.value=this._parse(this.text),this.specificity=[Ge(this.text)]);else"string"===this.type?this.operator="contains":this.operator="equals"}setOperator(e){"empty"===this.operator||"n_empty"===this.operator||"between"===this.operator?(this.value=null,this.text=""):"in"===this.operator&&(this.value=[],this.text=""),this.operator=e,"empty"===this.operator?(this.value="EMPTY",this.text="EMPTY"):"n_empty"===this.operator?(this.value="NOT EMPTY",this.text="NOT EMPTY"):"between"===this.operator?(this.value=null,this.text=""):"in"===this.operator&&(this.value=[],this.text=""),this._buildKql()}setValue(e,t){this.value=e,t?this.specificity=[t]:e instanceof Date?this.specificity=["time"]:this.specificity=[],this._buildText(),this._buildKql()}setStart(e,t){void 0===this.value?.start&&(this.value={start:null,end:null}),this.value.start=e,t?this.specificity[0]=t:e instanceof Date&&(this.specificity[0]="time"),this._buildText(),this._buildKql()}setEnd(e,t){void 0===this.value?.end&&(this.value={start:null,end:null}),this.value.end=e,t?this.specificity[1]=t:e instanceof Date&&(this.specificity[1]="time"),this._buildText(),this._buildKql()}clear(){"string"===this.type?this.operator="contains":this.operator="equals",this.value=null,this.kql="",this.text="",this.specificity=[]}isEmpty(){return"empty"===this.operator||"n_empty"===this.operator?!this.text:"between"===this.operator?!this.value?.start&&!this.value?.end:"in"===this.operator?!this.value?.length:void 0===this.value||null===this.value||""===this.value}has(e){return!("in"!==this.operator||!Array.isArray(this.value))&&("boolean"===this.type&&"string"==typeof e&&("true"===e?e=!0:"false"===e&&(e=!1)),this.value.indexOf(e)>=0)}toggle(e){"in"!==this.operator&&this.setOperator("in"),"boolean"===this.type&&"string"==typeof e&&("true"===e?e=!0:"false"===e&&(e=!1));const t=this.value.indexOf(e);t>=0?this.value.splice(t,1):this.value.push(e),this._buildText(),this._buildKql()}isValid(){return!this.kql||!!this.field&&(!!this.operator&&("empty"===this.operator||("n_empty"===this.operator||("in"===this.operator?Array.isArray(this.value)&&this.value.length>0:"date"===this.type?"between"===this.operator?this.value?.start instanceof Date&&this.value?.end instanceof Date&&!isNaN(this.value.start.getTime())&&!isNaN(this.value.end.getTime()):this.value instanceof Date&&!isNaN(this.value.getTime()):"number"===this.type?"between"===this.operator?"number"==typeof this.value?.start&&"number"==typeof this.value?.end:"number"==typeof this.value:"boolean"===this.type?"boolean"==typeof this.value:"string"==typeof this.value&&!!this.value.trim().length))))}toSolrData(){const e={boost:null,fuzzy:null,not:!1,name:null,operation:null,tagged:!1,value:null};switch(e.name=this.field,this.operator){case"equals":this.value instanceof Date?(e.operation="EXPRESSION",e.value=Ze(this.value,this.specificity)):(e.operation="IS",e.value=this.value);break;case"n_equals":this.value instanceof Date?(e.operation="EXPRESSION",e.not=!0,e.value=Ze(this.value,this.specificity)):(e.operation="IS",e.not=!0,e.value=this.value);break;case"contains":e.operation="EXPRESSION",e.value=`*${Xe(this.value,!1)}*`;break;case"n_contains":e.operation="EXPRESSION",e.not=!0,e.value=`*${Xe(this.value,!1)}*`;break;case"starts_with":e.operation="EXPRESSION",e.value=`${Xe(this.value,!1)}*`;break;case"ends_with":e.operation="EXPRESSION",e.value=`*${Xe(this.value,!1)}`;break;case"empty":e.operation="EXPRESSION",e.not=!0,e.value="[* TO *]";break;case"n_empty":e.operation="EXPRESSION",e.value="[* TO *]";break;case"less_than":this.value instanceof Date?(e.operation="EXPRESSION",e.value=`[* TO ${Ye(this.value)}}`):(e.operation="EXPRESSION",e.value=`[* TO ${Xe(this.value,!0)}}`);break;case"less_than_equal":this.value instanceof Date?(e.operation="EXPRESSION",e.value=`[* TO ${Ye(this.value,!0)}]`):(e.operation="EXPRESSION",e.value=`[* TO ${Xe(this.value,!0)}]`);break;case"greater_than":this.value instanceof Date?(e.operation="EXPRESSION",e.value=`{${Ye(this.value,!0)} TO *]`):(e.operation="EXPRESSION",e.value=`{${Xe(this.value,!0)} TO *]`);break;case"greater_than_equal":this.value instanceof Date?(e.operation="EXPRESSION",e.value=`[${Ye(this.value)} TO *]`):(e.operation="EXPRESSION",e.value=`[${Xe(this.value,!0)} TO *]`);break;case"between":this.value?.start instanceof Date&&this.value?.end instanceof Date?(e.operation="EXPRESSION",e.value=Ze(this.value,this.specificity)):(e.operation="EXPRESSION",e.value=`[${this.value.start} TO ${this.value.end}]`);break;case"in":Array.isArray(this.value)&&this.value.length>0?(e.operation="EXPRESSION",e.value=`(${this.value.map((e=>Xe(e,!0))).join(" OR ")})`):(e.operation="EXPRESSION",e.value=Xe(this.value,!0));break;default:e.operation="EXPRESSION",e.value=Xe(this.value,!0)}return e}toDbParams(){const e={boost:null,fuzzy:null,not:!1,name:null,operation:null,tagged:!1,value:null,values:null};switch(e.name=this.field,this.operator){case"equals":"date"===this.type?(e.operation="BETWEEN",e.values=Qe(this.value,this.specificity)):(e.operation="IS",e.value=this.value);break;case"n_equals":"date"===this.type?(e.operation="BETWEEN",e.not=!0,e.values=Qe(this.value,this.specificity)):(e.operation="IS",e.value=this.value,e.not=!0);break;case"contains":e.operation="CONTAINS",e.value=this.value;break;case"n_contains":e.operation="CONTAINS",e.value=this.value,e.not=!0;break;case"starts_with":e.operation="STARTS_WITH",e.value=this.value;break;case"ends_with":e.operation="ENDS_WITH",e.value=this.value;break;case"empty":e.operation="IS_BLANK";break;case"n_empty":e.operation="IS_NOT_BLANK";break;case"less_than":e.operation="LESS_THAN",e.value=this.value;break;case"less_than_equal":e.operation="LESS_THAN_EQUAL",e.value=this.value;break;case"greater_than":e.operation="GREATER_THAN",e.value=this.value;break;case"greater_than_equal":e.operation="GREATER_THAN_EQUAL",e.value=this.value;break;case"between":e.operation="BETWEEN","date"===this.type?e.values=Qe(this.value,this.specificity):e.values=[this.value.start,this.value.end];break;case"in":e.operation="IN",e.values=this.value??[];break;default:throw Error(`${this.operator} operator not supported by db params.`)}return e}_buildText(){this.isEmpty()?this.text="":"between"===this.operator?this.text=`${this._format(this.value?.start)} - ${this._format(this.value?.end)}`:"in"===this.operator?this.text=this.value.map((e=>this._format(e))).join(","):this.text=this._format(this.value)}_format(e){if(e instanceof Date&&!isNaN(e.getTime())){return`${String(e.getUTCMonth()+1).padStart(2,"0")}/${String(e.getUTCDate()).padStart(2,"0")}/${e.getUTCFullYear()}`}return"boolean"==typeof e?e?"Yes":"No":String(e??"")}_parse(e){if(null==e||""===e)return null;if(this.type)switch(this.type){case"boolean":{const t=e.toString().toLowerCase();return!0===e||!1!==e&&("yes"===t||"no"!==t&&("1"===t||"0"!==t&&null))}case"date":return this._parseDate(e);case"number":{const t=Number(e.toString().replace(/[$,]+/g,""));return isNaN(t)?null:t}default:return e.toString()}return e}_parseDate(e){if(null==e||""===e)return null;const t={jan:0,january:0,feb:1,february:1,mar:2,march:2,apr:3,april:3,may:4,jun:5,june:5,jul:6,july:6,aug:7,august:7,sep:8,september:8,oct:9,october:9,nov:10,november:10,dec:11,december:11};let i;if(i=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{2})$/),i)return new Date(Date.UTC(2e3+parseInt(i[3]),parseInt(i[1])-1,parseInt(i[2])));if(i=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/),i)return new Date(Date.UTC(parseInt(i[3]),parseInt(i[1])-1,parseInt(i[2])));if(i=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4}),?\s+(\d{1,2}):(\d{2})\s*(AM|PM)?$/i),i){let e=parseInt(i[4]);return i[6]&&("PM"===i[6].toUpperCase()&&12!==e&&(e+=12),"AM"===i[6].toUpperCase()&&12===e&&(e=0)),new Date(Date.UTC(parseInt(i[3]),parseInt(i[1])-1,parseInt(i[2]),e,parseInt(i[5])))}if(i=e.match(/^(?:[A-Za-z]+,\s+)?([A-Za-z]+)\s+(\d{1,2}),?\s+(\d{4}),?\s+(\d{1,2}):(\d{2})\s*(AM|PM)?$/i),i){const e=t[i[1].toLowerCase()];if(void 0!==e){let t=parseInt(i[4]);return i[6]&&("PM"===i[6].toUpperCase()&&12!==t&&(t+=12),"AM"===i[6].toUpperCase()&&12===t&&(t=0)),new Date(Date.UTC(parseInt(i[3]),e,parseInt(i[2]),t,parseInt(i[5])))}}if(i=e.match(/^(?:[A-Za-z]+,\s+)?([A-Za-z]+)\s+(\d{1,2}),?\s+(\d{4})$/),i){const e=t[i[1].toLowerCase()];if(void 0!==e)return new Date(Date.UTC(parseInt(i[3]),e,parseInt(i[2])))}if(i=e.match(/^(\d{2})$/),i)return new Date(Date.UTC(2e3+parseInt(i[1]),0,1));if(i=e.match(/^(\d{4})$/),i)return new Date(Date.UTC(parseInt(i[1]),0,1));if(i=e.match(/^([A-Za-z]+)\s+(\d{4})$/),i){const e=t[i[1].toLowerCase()];if(void 0!==e)return new Date(Date.UTC(parseInt(i[2]),e,1))}return null}_buildKql(){if(this.isEmpty())this.kql="";else switch(this.operator){case"equals":this.kql=`= ${this.text}`;break;case"n_equals":this.kql=`!= ${this.text}`;break;case"contains":this.kql=`~ ${this.text}`;break;case"n_contains":this.kql=`!~ ${this.text}`;break;case"starts_with":this.kql=`${this.text}*`;break;case"ends_with":this.kql=`*${this.text}`;break;case"empty":this.kql="EMPTY";break;case"n_empty":this.kql="NOT EMPTY";break;case"less_than":this.kql=`< ${this.text}`;break;case"less_than_equal":this.kql=`<= ${this.text}`;break;case"greater_than":this.kql=`> ${this.text}`;break;case"greater_than_equal":this.kql=`>= ${this.text}`;break;case"between":this.kql=`[${this._format(this.value?.start??"")} TO ${this._format(this.value?.end??"")}]`;break;case"in":this.kql=`(${this.value.map((e=>this._format(e))).join(",")})`;break;default:throw Error(`Unknown operator ${this.operator}`)}}}var et=function(e,t,i,s){var o,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(l=(r<3?o(l):r>3?o(t,i,l):o(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};class tt{constructor(){this.title="",this.actions=[],this.columns=[],this.displayedColumns=[],this.data=null,this.dataSource=null,this.refreshInterval=0,this.pageSize=0,this.rowClickable=!1,this.rowHref=null}}e.KRTable=class extends ae{constructor(){super(...arguments),this._scrollStyle="overlay",this._data=[],this._dataState="idle",this._page=1,this._pageSize=50,this._totalItems=0,this._totalPages=0,this._searchQuery="",this._canScrollLeft=!1,this._canScrollRight=!1,this._canScrollHorizontal=!1,this._columnPickerOpen=!1,this._filterPanelOpened=null,this._filterPanelTab="filter",this._buckets=new Map,this._filterPanelPos={top:0,left:0},this._resizing=null,this._resizeObserver=null,this._searchPositionLocked=!1,this._model=new tt,this.def={columns:[]},this._handleClickOutside=e=>{const t=e.composedPath();if(this._columnPickerOpen){const e=this.shadowRoot?.querySelector(".column-picker-wrapper");e&&!t.includes(e)&&(this._columnPickerOpen=!1)}this._filterPanelOpened&&(t.some((e=>e.classList?.contains("filter-panel")))||this._handleFilterApply())},this._handleResizeMove=e=>{if(!this._resizing)return;const t=this._model.columns.find((e=>e.id===this._resizing.columnId));if(t){const i=this._resizing.startWidth+(e.clientX-this._resizing.startX);t.width=`${Math.min(900,Math.max(50,i))}px`,this.requestUpdate()}},this._handleResizeEnd=()=>{this._resizing=null,document.removeEventListener("mousemove",this._handleResizeMove),document.removeEventListener("mouseup",this._handleResizeEnd)}}connectedCallback(){super.connectedCallback(),this.classList.toggle("kr-table--scroll-overlay","overlay"===this._scrollStyle),this.classList.toggle("kr-table--scroll-edge","edge"===this._scrollStyle),this._fetch(),this._initRefresh(),document.addEventListener("click",this._handleClickOutside),this._resizeObserver=new ResizeObserver((()=>{this._searchPositionLocked=!1,this._updateSearchPosition()})),this._resizeObserver.observe(this)}disconnectedCallback(){super.disconnectedCallback(),clearInterval(this._refreshTimer),document.removeEventListener("click",this._handleClickOutside),this._resizeObserver?.disconnect()}willUpdate(e){e.has("def")&&(this._model=new tt,this.def.title&&(this._model.title=this.def.title),this.def.actions&&(this._model.actions=this.def.actions),this.def.data&&(this._model.data=this.def.data),this.def.dataSource&&(this._model.dataSource=this.def.dataSource),"number"==typeof this.def.refreshInterval&&(this._model.refreshInterval=this.def.refreshInterval),"number"==typeof this.def.pageSize&&(this._model.pageSize=this.def.pageSize),this.def.rowClickable&&(this._model.rowClickable=this.def.rowClickable),this.def.rowHref&&(this._model.rowHref=this.def.rowHref),this._model.columns=this.def.columns.map((e=>{const t={...e,filter:null};return t.type||(t.type="string"),"actions"===t.type?(t.label=e.label??"",t.sticky="right",t.resizable=!1,t):((e.filterable||e.facetable)&&(t.filter=new Je,t.filter.field=e.id,t.filter.type=t.type,e.facetable&&!e.filterable?(t.filter.operator="in",t.filter.value=[]):"string"===t.filter.type&&(t.filter.operator="contains")),t)})),this.def.displayedColumns?this._model.displayedColumns=this.def.displayedColumns:this._model.displayedColumns=this._model.columns.map((e=>e.id)),this._fetch(),this._initRefresh())}updated(e){this._updateScrollFlags(),this._syncSlottedContent()}_syncSlottedContent(){const e=this.getDisplayedColumns().filter((e=>e.render));e.length&&(this.querySelectorAll('[slot^="cell-"]').forEach((e=>e.remove())),this._data.forEach(((t,i)=>{e.forEach((e=>{const s=e.render(t);if(!s)return;const o=document.createElement("span");o.slot=`cell-${i}-${e.id}`,"actions"===e.type&&(o.style.display="flex",o.style.gap="8px"),"string"==typeof s?o.innerHTML=s:re(s,o),this.appendChild(o)}))})))}refresh(){this._fetch()}goToPrevPage(){this._page>1&&(this._page--,this._fetch())}goToNextPage(){this._page<this._totalPages&&(this._page++,this._fetch())}goToPage(e){e>=1&&e<=this._totalPages&&(this._page=e,this._fetch())}_toSolrData(){const e={page:this._page-1,size:this._pageSize,sorts:[],filterFields:[],queryFields:[],facetFields:[]};for(const t of this._model.columns){if(!t.filter||t.filter.isEmpty()||!t.filter.isValid())continue;const i=t.filter.toSolrData();t.facetable&&"in"===t.filter.operator&&(i.tagged=!0),e.filterFields.push(i)}for(const t of this._model.columns)t.facetable&&e.facetFields.push({name:t.id,type:"FIELD",limit:100,sort:"count",minimumCount:1});return this._searchQuery?.trim().length&&e.queryFields.push({name:"_text_",operation:"IS",value:Xe(this._searchQuery,!1)}),e}_toDbParams(){const e={page:this._page-1,size:this._pageSize,sorts:[],filterFields:[],queryFields:[],facetFields:[]};for(const t of this._model.columns)t.filter&&!t.filter.isEmpty()&&t.filter.isValid()&&e.filterFields.push(t.filter.toDbParams());return this._searchQuery?.trim().length&&this._model.columns.filter((e=>e.searchable)).forEach((t=>{e.queryFields.push({name:t.id,operation:"CONTAINS",value:this._searchQuery,and:!1})})),e}_fetch(){if(this._model.data)return this._data=this._model.data,this._totalItems=this._model.data.length,this._totalPages=Math.ceil(this._model.data.length/this._pageSize),void(this._dataState="success");if(!this._model.dataSource)return;let t;this._dataState="loading",t="db"===this._model.dataSource.mode?this._toDbParams():this._toSolrData(),this._model.dataSource.fetch(t).then((e=>{switch(this._model.dataSource?.mode){case"opensearch":throw Error("Opensearch not supported yet");case"db":{const t=e;this._data=t.data.content,this._totalItems=t.data.totalElements,this._totalPages=t.data.totalPages,this._pageSize=t.data.size;break}default:{const t=e;this._data=t.data.content,this._totalItems=t.data.totalElements,this._totalPages=t.data.totalPages,this._pageSize=t.data.size,this._parseFacetResults(t)}}this._dataState="success",this._updateSearchPosition()})).catch((t=>{this._dataState="error",e.KRSnackbar.show({message:t instanceof Error?t.message:"Failed to load data",type:"error"})}))}_parseFacetResults(e){if(e.data.facetFields){for(const t of this._model.columns){if(!t.facetable)continue;const i=e.data.facetFields[t.id];if(!i){this._buckets.set(t.id,[]);continue}const s=[];for(const e of i){let i=e.name;"boolean"===t.type&&"string"==typeof e.name&&("true"===e.name?i=!0:"false"===e.name&&(i=!1)),null===e.name&&e.count>0&&s.unshift({val:null,count:e.count}),null!==e.name&&s.push({val:i,count:e.count})}if(t.filter&&"in"===t.filter.operator&&Array.isArray(t.filter.value))for(const e of t.filter.value)s.some((t=>t.val===e))||s.push({val:e,count:0});this._buckets.set(t.id,s)}this._buckets=new Map(this._buckets)}}_initRefresh(){clearInterval(this._refreshTimer),this._model.refreshInterval&&this._model.refreshInterval>0&&(this._refreshTimer=window.setInterval((()=>{this._fetch()}),this._model.refreshInterval))}_handleSearch(e){const t=e.target;this._searchQuery=t.value,this._page=1,this._fetch()}_getGridTemplateColumns(){return this.getDisplayedColumns().map((e=>e.width?e.width:"actions"===e.type?"max-content":"minmax(80px, auto)")).join(" ")}_updateSearchPosition(){if(this._searchPositionLocked)return;const e=this.shadowRoot?.querySelector(".search"),t=e?.querySelector(".search-field");e&&t&&(e.style.justifyContent="center",t.style.marginLeft="",requestAnimationFrame((()=>{const i=e.getBoundingClientRect(),s=t.getBoundingClientRect().left-i.left;e.style.justifyContent="flex-start",t.style.marginLeft=`${s}px`,this._searchPositionLocked=!0})))}_toggleColumnPicker(){this._columnPickerOpen=!this._columnPickerOpen}_toggleColumn(e){this._model.displayedColumns.includes(e)?this._model.displayedColumns=this._model.displayedColumns.filter((t=>t!==e)):this._model.displayedColumns=[...this._model.displayedColumns,e]}_handleRowMouseDown(){this._model.rowClickable&&window.getSelection()?.removeAllRanges()}_handleRowClick(e,t){if(!this._model.rowClickable)return;const i=window.getSelection();i&&i.toString().length>0||this.dispatchEvent(new CustomEvent("row-click",{detail:{row:e,rowIndex:t},bubbles:!0,composed:!0}))}getDisplayedColumns(){return this._model.displayedColumns.map((e=>this._model.columns.find((t=>t.id===e)))).sort(((e,t)=>"actions"===e.type&&"actions"!==t.type?1:"actions"!==e.type&&"actions"===t.type?-1:0))}_handleScroll(e){const t=e.target;this._canScrollLeft=t.scrollLeft>0,this._canScrollRight=t.scrollLeft<t.scrollWidth-t.clientWidth-1}_updateScrollFlags(){const e=this.shadowRoot?.querySelector(".content");e&&(this._canScrollLeft=e.scrollLeft>0,this._canScrollRight=e.scrollWidth>e.clientWidth&&e.scrollLeft<e.scrollWidth-e.clientWidth-1,this._canScrollHorizontal=e.scrollWidth>e.clientWidth),this.classList.toggle("kr-table--scroll-left-available",this._canScrollLeft),this.classList.toggle("kr-table--scroll-right-available",this._canScrollRight),this.classList.toggle("kr-table--scroll-horizontal-available",this._canScrollHorizontal),this.classList.toggle("kr-table--sticky-left",this.getDisplayedColumns().some((e=>"left"===e.sticky))),this.classList.toggle("kr-table--sticky-right",this.getDisplayedColumns().some((e=>"right"===e.sticky)))}_handleResizeStart(e,t){e.preventDefault();const i=this.shadowRoot?.querySelector(`.header-cell[data-column-id="${t}"]`);this._resizing={columnId:t,startX:e.clientX,startWidth:i?.offsetWidth||200},document.addEventListener("mousemove",this._handleResizeMove),document.addEventListener("mouseup",this._handleResizeEnd)}_handleAction(e){e.href||this.dispatchEvent(new CustomEvent("action",{detail:{action:e.id},bubbles:!0,composed:!0}))}_handleKqlChange(e,t){const i=e.target.value.trim();if(i){if(t.filter.setKql(i),this.requestUpdate(),!t.filter.isValid())return}else t.filter.clear(),this.requestUpdate();this._page=1,this._fetch()}_handleFilterPanelToggle(e,t){if(e.stopPropagation(),this._filterPanelOpened===t.id)this._filterPanelOpened=null;else{const i=e.currentTarget.getBoundingClientRect();let s=i.left;s+328>window.innerWidth&&(s=window.innerWidth-328),this._filterPanelPos={top:i.bottom+4,left:s},this._filterPanelOpened=t.id,t.facetable?this._filterPanelTab="counts":this._filterPanelTab="filter"}}_handleKqlClear(e){e.filter.clear(),this._page=1,this._fetch()}_handleFilterClear(){const e=this._model.columns.find((e=>e.id===this._filterPanelOpened));e&&(e.filter.clear(),e.facetable&&!e.filterable&&(e.filter.operator="in",e.filter.value=[])),this._filterPanelOpened=null,this._page=1,this._fetch()}_handleFilterTextKeydown(e,t){"Enter"===e.key&&(e.preventDefault(),this._handleFilterApply())}_handleOperatorChange(e,t){t.filter.setOperator(e.target.value),this.requestUpdate()}_handleFilterStringChange(e,t){t.filter.setValue(e.target.value),this.requestUpdate()}_handleFilterNumberChange(e,t){t.filter.setValue(Number(e.target.value)),this.requestUpdate()}_handleFilterDateChange(e,t){t.filter.setValue(new Date(e.target.value),"day"),this.requestUpdate()}_handleFilterBooleanChange(e,t){t.filter.setValue("true"===e.target.value),this.requestUpdate()}_handleFilterDateStartChange(e,t){t.filter.setStart(new Date(e.target.value),"day"),this.requestUpdate()}_handleFilterDateEndChange(e,t){t.filter.setEnd(new Date(e.target.value),"day"),this.requestUpdate()}_handleFilterNumberStartChange(e,t){t.filter.setStart(Number(e.target.value)),this.requestUpdate()}_handleFilterNumberEndChange(e,t){t.filter.setEnd(Number(e.target.value)),this.requestUpdate()}_handleFilterListChange(e,t){const i=e.target.value.split(",").map((e=>e.trim())).filter((e=>""!==e));"number"===t.type?t.filter.setValue(i.map((e=>Number(e)))):t.filter.setValue(i),this.requestUpdate()}_handleFilterApply(){this._filterPanelOpened=null,this._page=1,this._fetch()}_handleFilterPanelTabChange(e){this._filterPanelTab=e.detail.activeTabId}_handleBucketToggle(e,t,i){t.filter.toggle(i.val),this._page=1,this._fetch()}_renderCellContent(e,t,i){const s=t[e.id];if(e.render)return B`<slot name="cell-${i}-${e.id}"></slot>`;if(null==s)return"";switch(e.type){case"number":return"currency"===e.format&&"number"==typeof s?s.toLocaleString("en-US",{style:"currency",currency:"USD"}):String(s);case"date":{let e;if(s instanceof Date)e=s;else if("string"==typeof s&&/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/.test(s)){const t=s.replace(/(\d{2}:\d{2}:\d{2}):(\d+)$/,"$1.$2").replace(" ","T")+"Z";e=new Date(t)}else e=new Date(s);return e.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZone:"UTC"})}case"boolean":return!0===s?"Yes":!1===s?"No":"";default:return String(s)}}_getHeaderCellClasses(e,t){return{"header-cell":!0,"header-cell--align-center":"center"===e.align,"header-cell--align-right":"right"===e.align,"header-cell--sticky-left":"left"===e.sticky,"header-cell--sticky-left-last":"left"===e.sticky&&!this.getDisplayedColumns().slice(t+1).some((e=>"left"===e.sticky)),"header-cell--sticky-right":"right"===e.sticky,"header-cell--sticky-right-first":"right"===e.sticky&&!this.getDisplayedColumns().slice(0,t).some((e=>"right"===e.sticky))}}_getCellClasses(e,t){return{cell:!0,"cell--actions":"actions"===e.type,"cell--align-center":"center"===e.align,"cell--align-right":"right"===e.align,"cell--sticky-left":"left"===e.sticky,"cell--sticky-left-last":"left"===e.sticky&&!this.getDisplayedColumns().slice(t+1).some((e=>"left"===e.sticky)),"cell--sticky-right":"right"===e.sticky,"cell--sticky-right-first":"right"===e.sticky&&!this.getDisplayedColumns().slice(0,t).some((e=>"right"===e.sticky))}}_getCellStyle(e,t){const i={};if("left"===e.sticky){let e=0;for(let i=0;i<t;i++){const t=this.getDisplayedColumns()[i];"left"===t.sticky&&(e+=parseInt(t.width||"0",10))}i.left=`${e}px`}if("right"===e.sticky){let e=0;for(let i=t+1;i<this.getDisplayedColumns().length;i++){const t=this.getDisplayedColumns()[i];"right"===t.sticky&&(e+=parseInt(t.width||"0",10))}i.right=`${e}px`}return i}_renderPagination(){const e=(this._page-1)*this._pageSize+1,t=Math.min(this._page*this._pageSize,this._totalItems);return B`
1483
1483
  <div class="pagination">
1484
1484
  <span
1485
1485
  class="pagination-icon ${1===this._page?"pagination-icon--disabled":""}"
@@ -1495,10 +1495,10 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
1495
1495
  <svg viewBox="0 0 24 24" fill="currentColor"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/></svg>
1496
1496
  </span>
1497
1497
  </div>
1498
- `}_renderHeader(){return!this._model.title&&!this._model.actions?.length&&this._totalPages<=1?V:j`
1498
+ `}_renderHeader(){return!this._model.title&&!this._model.actions?.length&&this._totalPages<=1?V:B`
1499
1499
  <div class="header">
1500
1500
  <div class="title">${this._model.title??""}</div>
1501
- ${"db"!==this._model.dataSource?.mode||this._model.columns.some((e=>e.searchable))?j`
1501
+ ${"db"!==this._model.dataSource?.mode||this._model.columns.some((e=>e.searchable))?B`
1502
1502
  <div class="search">
1503
1503
  <!-- TODO: Saved views dropdown
1504
1504
  <div class="views">
@@ -1517,7 +1517,7 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
1517
1517
  />
1518
1518
  </div>
1519
1519
  </div>
1520
- `:j`<div class="search"></div>`}
1520
+ `:B`<div class="search"></div>`}
1521
1521
  <div class="tools">
1522
1522
  ${this._renderPagination()}
1523
1523
  <span class="refresh" title="Refresh" @click=${()=>this.refresh()}>
@@ -1528,7 +1528,7 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
1528
1528
  <svg viewBox="0 -960 960 960" fill="currentColor"><path d="M121-280v-400q0-33 23.5-56.5T201-760h559q33 0 56.5 23.5T840-680v400q0 33-23.5 56.5T760-200H201q-33 0-56.5-23.5T121-280Zm79 0h133v-400H200v400Zm213 0h133v-400H413v400Zm213 0h133v-400H626v400Z"/></svg>
1529
1529
  </span>
1530
1530
  <div class="column-picker ${this._columnPickerOpen?"open":""}">
1531
- ${[...this._model.columns].filter((e=>"actions"!==e.type)).sort(((e,t)=>(e.label??e.id).localeCompare(t.label??t.id))).map((e=>j`
1531
+ ${[...this._model.columns].filter((e=>"actions"!==e.type)).sort(((e,t)=>(e.label??e.id).localeCompare(t.label??t.id))).map((e=>B`
1532
1532
  <div class="column-picker-item" @click=${()=>this._toggleColumn(e.id)}>
1533
1533
  <div class="column-picker-checkbox ${this._model.displayedColumns.includes(e.id)?"checked":""}">
1534
1534
  <svg viewBox="0 0 24 24" fill="currentColor"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>
@@ -1538,7 +1538,7 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
1538
1538
  `))}
1539
1539
  </div>
1540
1540
  </div>
1541
- ${1===this._model.actions?.length?j`
1541
+ ${1===this._model.actions?.length?B`
1542
1542
  <kr-button
1543
1543
  class="actions"
1544
1544
  .href=${this._model.actions[0].href}
@@ -1547,7 +1547,7 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
1547
1547
  >
1548
1548
  ${this._model.actions[0].label}
1549
1549
  </kr-button>
1550
- `:this._model.actions?.length?j`
1550
+ `:this._model.actions?.length?B`
1551
1551
  <kr-button
1552
1552
  class="actions"
1553
1553
  .options=${this._model.actions.map((e=>({id:e.id,label:e.label})))}
@@ -1558,14 +1558,14 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
1558
1558
  `:V}
1559
1559
  </div>
1560
1560
  </div>
1561
- `}_renderStatus(){return"loading"===this._dataState&&0===this._data.length?j`<div class="status">Loading...</div>`:"error"===this._dataState&&0===this._data.length?j`<div class="status status--error">Error loading data</div>`:0===this._data.length?j`<div class="status">No data available</div>`:V}_renderFilterPanel(){if(!this._filterPanelOpened)return V;const e=this._model.columns.find((e=>e.id===this._filterPanelOpened));let t=j``;t="empty"===e.filter.operator||"n_empty"===e.filter.operator?j`
1561
+ `}_renderStatus(){return"loading"===this._dataState&&0===this._data.length?B`<div class="status">Loading...</div>`:"error"===this._dataState&&0===this._data.length?B`<div class="status status--error">Error loading data</div>`:0===this._data.length?B`<div class="status">No data available</div>`:V}_renderFilterPanel(){if(!this._filterPanelOpened)return V;const e=this._model.columns.find((e=>e.id===this._filterPanelOpened));let t=B``;t="empty"===e.filter.operator||"n_empty"===e.filter.operator?B`
1562
1562
  <input
1563
1563
  type="text"
1564
1564
  class="filter-panel__input"
1565
1565
  disabled
1566
1566
  .value=${e.filter.text}
1567
1567
  />
1568
- `:"between"===e.filter.operator&&"date"===e.type?j`
1568
+ `:"between"===e.filter.operator&&"date"===e.type?B`
1569
1569
  <input
1570
1570
  type="date"
1571
1571
  class="filter-panel__input"
@@ -1578,7 +1578,7 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
1578
1578
  .valueAsDate=${e.filter.value?.end??null}
1579
1579
  @change=${t=>this._handleFilterDateEndChange(t,e)}
1580
1580
  />
1581
- `:"between"===e.filter.operator&&"number"===e.type?j`
1581
+ `:"between"===e.filter.operator&&"number"===e.type?B`
1582
1582
  <input
1583
1583
  type="number"
1584
1584
  class="filter-panel__input"
@@ -1595,7 +1595,7 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
1595
1595
  @input=${t=>this._handleFilterNumberEndChange(t,e)}
1596
1596
  @keydown=${t=>this._handleFilterTextKeydown(t,e)}
1597
1597
  />
1598
- `:"in"===e.filter.operator?j`
1598
+ `:"in"===e.filter.operator?B`
1599
1599
  <textarea
1600
1600
  class="filter-panel__textarea"
1601
1601
  rows="3"
@@ -1604,7 +1604,7 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
1604
1604
  @input=${t=>this._handleFilterListChange(t,e)}
1605
1605
  @keydown=${t=>this._handleFilterTextKeydown(t,e)}
1606
1606
  ></textarea>
1607
- `:"boolean"===e.type?j`
1607
+ `:"boolean"===e.type?B`
1608
1608
  <kr-select-field
1609
1609
  placeholder="Value"
1610
1610
  .value=${String(e.filter.value??"")}
@@ -1613,14 +1613,14 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
1613
1613
  <kr-select-option value="true">Yes</kr-select-option>
1614
1614
  <kr-select-option value="false">No</kr-select-option>
1615
1615
  </kr-select-field>
1616
- `:"date"===e.type?j`
1616
+ `:"date"===e.type?B`
1617
1617
  <input
1618
1618
  type="date"
1619
1619
  class="filter-panel__input"
1620
1620
  .valueAsDate=${e.filter.value}
1621
1621
  @change=${t=>this._handleFilterDateChange(t,e)}
1622
1622
  />
1623
- `:"number"===e.type?j`
1623
+ `:"number"===e.type?B`
1624
1624
  <input
1625
1625
  type="number"
1626
1626
  class="filter-panel__input"
@@ -1630,7 +1630,7 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
1630
1630
  @input=${t=>this._handleFilterNumberChange(t,e)}
1631
1631
  @keydown=${t=>this._handleFilterTextKeydown(t,e)}
1632
1632
  />
1633
- `:j`
1633
+ `:B`
1634
1634
  <input
1635
1635
  type="text"
1636
1636
  class="filter-panel__input"
@@ -1639,25 +1639,25 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
1639
1639
  @input=${t=>this._handleFilterStringChange(t,e)}
1640
1640
  @keydown=${t=>this._handleFilterTextKeydown(t,e)}
1641
1641
  />
1642
- `;const i=j`
1642
+ `;const i=B`
1643
1643
  <div class="filter-panel__content">
1644
1644
  <kr-select-field
1645
1645
  .value=${e.filter.operator}
1646
1646
  @change=${t=>this._handleOperatorChange(t,e)}
1647
1647
  >
1648
- ${Ue(e.type).map((e=>j`
1648
+ ${Ue(e.type).map((e=>B`
1649
1649
  <kr-select-option value=${e.key}>${e.label}</kr-select-option>
1650
1650
  `))}
1651
1651
  </kr-select-field>
1652
1652
  ${t}
1653
1653
  </div>
1654
- `,s=this._buckets.get(e.id)||[];let o,r;return o=s.length?j`
1654
+ `,s=this._buckets.get(e.id)||[];let o,r;return o=s.length?B`
1655
1655
  <div class="buckets">
1656
- ${s.map((t=>{let i="(Empty)";null!==t.val&&void 0!==t.val&&(i="boolean"===e.type?!0===t.val||"true"===t.val?"Yes":"No":String(t.val));let s=V;return e.filter.has(t.val)&&(s=j`
1656
+ ${s.map((t=>{let i="(Empty)";null!==t.val&&void 0!==t.val&&(i="boolean"===e.type?!0===t.val||"true"===t.val?"Yes":"No":String(t.val));let s=V;return e.filter.has(t.val)&&(s=B`
1657
1657
  <svg viewBox="0 0 24 24" fill="currentColor">
1658
1658
  <path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>
1659
1659
  </svg>
1660
- `),j`
1660
+ `),B`
1661
1661
  <div
1662
1662
  class="bucket"
1663
1663
  @click=${i=>this._handleBucketToggle(i,e,t)}
@@ -1670,7 +1670,7 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
1670
1670
  </div>
1671
1671
  `}))}
1672
1672
  </div>
1673
- `:j`<div class="bucket-empty">No data</div>`,r=e.facetable&&e.filterable?j`
1673
+ `:B`<div class="bucket-empty">No data</div>`,r=e.facetable&&e.filterable?B`
1674
1674
  <kr-tab-group
1675
1675
  size="small"
1676
1676
  active-tab-id=${this._filterPanelTab}
@@ -1683,10 +1683,10 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
1683
1683
  ${o}
1684
1684
  </kr-tab>
1685
1685
  </kr-tab-group>
1686
- `:e.facetable?o:i,j`
1686
+ `:e.facetable?o:i,B`
1687
1687
  <div
1688
1688
  class="filter-panel"
1689
- style=${Ae({top:this._filterPanelPos.top+"px",left:this._filterPanelPos.left+"px"})}
1689
+ style=${Ke({top:this._filterPanelPos.top+"px",left:this._filterPanelPos.left+"px"})}
1690
1690
  >
1691
1691
  ${r}
1692
1692
  <div class="filter-panel__actions">
@@ -1698,12 +1698,12 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
1698
1698
  </kr-button>
1699
1699
  </div>
1700
1700
  </div>
1701
- `}_renderFilterRow(){const e=this.getDisplayedColumns();return e.some((e=>e.filterable||e.facetable))?j`
1701
+ `}_renderFilterRow(){const e=this.getDisplayedColumns();return e.some((e=>e.filterable||e.facetable))?B`
1702
1702
  <div class="filter-row">
1703
- ${e.map(((t,i)=>t.filterable||t.facetable?j`
1703
+ ${e.map(((t,i)=>t.filterable||t.facetable?B`
1704
1704
  <div
1705
1705
  class=${we({"filter-cell":!0,"filter-cell--sticky-left":"left"===t.sticky,"filter-cell--sticky-right":"right"===t.sticky,"filter-cell--sticky-right-first":"right"===t.sticky&&!e.slice(0,i).some((e=>"right"===e.sticky))})}
1706
- style=${Ae(this._getCellStyle(t,i))}
1706
+ style=${Ke(this._getCellStyle(t,i))}
1707
1707
  >
1708
1708
  <div class="filter-cell__wrapper">
1709
1709
  <input
@@ -1712,7 +1712,7 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
1712
1712
  .value=${t.filter.kql}
1713
1713
  @change=${e=>this._handleKqlChange(e,t)}
1714
1714
  />
1715
- ${t.filter?.kql?.length>0?j`
1715
+ ${t.filter?.kql?.length>0?B`
1716
1716
  <button
1717
1717
  class="filter-cell__clear"
1718
1718
  @click=${()=>this._handleKqlClear(t)}
@@ -1732,12 +1732,12 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
1732
1732
  </button>
1733
1733
  </div>
1734
1734
  </div>
1735
- `:j`<div
1735
+ `:B`<div
1736
1736
  class=${we({"filter-cell":!0,"filter-cell--sticky-left":"left"===t.sticky,"filter-cell--sticky-right":"right"===t.sticky,"filter-cell--sticky-right-first":"right"===t.sticky&&!e.slice(0,i).some((e=>"right"===e.sticky))})}
1737
- style=${Ae(this._getCellStyle(t,i))}
1737
+ style=${Ke(this._getCellStyle(t,i))}
1738
1738
  ></div>`))}
1739
1739
  </div>
1740
- `:V}_renderTable(){return j`
1740
+ `:V}_renderTable(){return B`
1741
1741
  <div class="wrapper">
1742
1742
  <div class="overlay-left"></div>
1743
1743
  <div class="overlay-right"></div>
@@ -1745,34 +1745,34 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
1745
1745
  <div class="content" @scroll=${this._handleScroll}>
1746
1746
  <div class="table" style="grid-template-columns: ${this._getGridTemplateColumns()}">
1747
1747
  <div class="header-row">
1748
- ${this.getDisplayedColumns().map(((e,t)=>j`
1748
+ ${this.getDisplayedColumns().map(((e,t)=>B`
1749
1749
  <div
1750
1750
  class=${we(this._getHeaderCellClasses(e,t))}
1751
- style=${Ae(this._getCellStyle(e,t))}
1751
+ style=${Ke(this._getCellStyle(e,t))}
1752
1752
  data-column-id=${e.id}
1753
- >${e.label??e.id}${!1!==e.resizable?j`<div
1753
+ >${e.label??e.id}${!1!==e.resizable?B`<div
1754
1754
  class="header-cell__resize"
1755
1755
  @mousedown=${t=>this._handleResizeStart(t,e.id)}
1756
1756
  ></div>`:V}</div>
1757
1757
  `))}
1758
1758
  </div>
1759
1759
  ${this._renderFilterRow()}
1760
- ${this._data.map(((e,t)=>{const i=this.getDisplayedColumns().map(((i,s)=>j`
1760
+ ${this._data.map(((e,t)=>{const i=this.getDisplayedColumns().map(((i,s)=>B`
1761
1761
  <div
1762
1762
  class=${we(this._getCellClasses(i,s))}
1763
- style=${Ae(this._getCellStyle(i,s))}
1763
+ style=${Ke(this._getCellStyle(i,s))}
1764
1764
  data-column-id=${i.id}
1765
1765
  >
1766
1766
  ${this._renderCellContent(i,e,t)}
1767
1767
  </div>
1768
- `));return this._model.rowHref?j`
1768
+ `));return this._model.rowHref?B`
1769
1769
  <a
1770
1770
  href=${this._model.rowHref(e)}
1771
1771
  class=${we({row:!0,"row--clickable":!0,"row--link":!0})}
1772
1772
  @mousedown=${()=>this._handleRowMouseDown()}
1773
1773
  @click=${()=>this._handleRowClick(e,t)}
1774
1774
  >${i}</a>
1775
- `:j`
1775
+ `:B`
1776
1776
  <div
1777
1777
  class=${we({row:!0,"row--clickable":!!this._model.rowClickable})}
1778
1778
  @mousedown=${()=>this._handleRowMouseDown()}
@@ -1782,11 +1782,11 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
1782
1782
  </div>
1783
1783
  </div>
1784
1784
  </div>
1785
- `}render(){return this._model.columns.length?j`
1785
+ `}render(){return this._model.columns.length?B`
1786
1786
  ${this._renderHeader()}
1787
1787
  ${this._renderTable()}
1788
1788
  ${this._renderFilterPanel()}
1789
- `:j`<slot></slot>`}},e.KRTable.styles=[de,a`
1789
+ `:B`<slot></slot>`}},e.KRTable.styles=[de,l`
1790
1790
  /* -------------------------------------------------------------------------
1791
1791
  * Host
1792
1792
  * ----------------------------------------------------------------------- */
@@ -2601,7 +2601,7 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
2601
2601
  padding: 16px;
2602
2602
  }
2603
2603
 
2604
- `],et([fe()],e.KRTable.prototype,"_data",void 0),et([fe()],e.KRTable.prototype,"_dataState",void 0),et([fe()],e.KRTable.prototype,"_page",void 0),et([fe()],e.KRTable.prototype,"_pageSize",void 0),et([fe()],e.KRTable.prototype,"_totalItems",void 0),et([fe()],e.KRTable.prototype,"_totalPages",void 0),et([fe()],e.KRTable.prototype,"_searchQuery",void 0),et([fe()],e.KRTable.prototype,"_canScrollLeft",void 0),et([fe()],e.KRTable.prototype,"_canScrollRight",void 0),et([fe()],e.KRTable.prototype,"_canScrollHorizontal",void 0),et([fe()],e.KRTable.prototype,"_columnPickerOpen",void 0),et([fe()],e.KRTable.prototype,"_filterPanelOpened",void 0),et([fe()],e.KRTable.prototype,"_filterPanelTab",void 0),et([fe()],e.KRTable.prototype,"_buckets",void 0),et([ue({type:Object})],e.KRTable.prototype,"def",void 0),e.KRTable=et([ce("kr-table")],e.KRTable);var it=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};e.KRSpinner=class extends le{constructor(){super(...arguments),this.size="md",this.color="dark"}render(){var e="",t="";return e="sm"==this.size?"16px":"md"==this.size?"24px":"lg"==this.size?"32px":"xl"==this.size?"48px":this.size,t="dark"==this.color?"#163052":"light"==this.color?"#ffffff":this.color,j`
2604
+ `],et([fe()],e.KRTable.prototype,"_data",void 0),et([fe()],e.KRTable.prototype,"_dataState",void 0),et([fe()],e.KRTable.prototype,"_page",void 0),et([fe()],e.KRTable.prototype,"_pageSize",void 0),et([fe()],e.KRTable.prototype,"_totalItems",void 0),et([fe()],e.KRTable.prototype,"_totalPages",void 0),et([fe()],e.KRTable.prototype,"_searchQuery",void 0),et([fe()],e.KRTable.prototype,"_canScrollLeft",void 0),et([fe()],e.KRTable.prototype,"_canScrollRight",void 0),et([fe()],e.KRTable.prototype,"_canScrollHorizontal",void 0),et([fe()],e.KRTable.prototype,"_columnPickerOpen",void 0),et([fe()],e.KRTable.prototype,"_filterPanelOpened",void 0),et([fe()],e.KRTable.prototype,"_filterPanelTab",void 0),et([fe()],e.KRTable.prototype,"_buckets",void 0),et([ue({type:Object})],e.KRTable.prototype,"def",void 0),e.KRTable=et([he("kr-table")],e.KRTable);var it=function(e,t,i,s){var o,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(l=(r<3?o(l):r>3?o(t,i,l):o(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};e.KRSpinner=class extends ae{constructor(){super(...arguments),this.size="md",this.color="dark"}render(){var e="",t="";return e="sm"==this.size?"16px":"md"==this.size?"24px":"lg"==this.size?"32px":"xl"==this.size?"48px":this.size,t="dark"==this.color?"#163052":"light"==this.color?"#ffffff":this.color,B`
2605
2605
  <svg
2606
2606
  class="spinner"
2607
2607
  style=${`width: ${e}; height: ${e}; color: ${t}`}
@@ -2618,7 +2618,7 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
2618
2618
  stroke-width="4"
2619
2619
  />
2620
2620
  </svg>
2621
- `}},e.KRSpinner.styles=a`
2621
+ `}},e.KRSpinner.styles=l`
2622
2622
  :host {
2623
2623
  display: inline-flex;
2624
2624
  align-items: center;
@@ -2661,7 +2661,7 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
2661
2661
  stroke: currentColor;
2662
2662
  stroke-linecap: round;
2663
2663
  }
2664
- `,it([ue({type:String,reflect:!0})],e.KRSpinner.prototype,"size",void 0),it([ue({type:String,reflect:!0})],e.KRSpinner.prototype,"color",void 0),e.KRSpinner=it([ce("kr-spinner")],e.KRSpinner);var st=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};e.KRProgressBar=class extends le{constructor(){super(...arguments),this.color="dark"}render(){let e="",t="";return e="dark"===this.color?"#163052":"light"===this.color?"#ffffff":this.color,t=this.trackColor?this.trackColor:"light"===this.color?"#ffffff4d":"#0000001a",j`
2664
+ `,it([ue({type:String,reflect:!0})],e.KRSpinner.prototype,"size",void 0),it([ue({type:String,reflect:!0})],e.KRSpinner.prototype,"color",void 0),e.KRSpinner=it([he("kr-spinner")],e.KRSpinner);var st=function(e,t,i,s){var o,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(l=(r<3?o(l):r>3?o(t,i,l):o(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};e.KRProgressBar=class extends ae{constructor(){super(...arguments),this.color="dark"}render(){let e="",t="";return e="dark"===this.color?"#163052":"light"===this.color?"#ffffff":this.color,t=this.trackColor?this.trackColor:"light"===this.color?"#ffffff4d":"#0000001a",B`
2665
2665
  <div
2666
2666
  class="progress-bar"
2667
2667
  style=${`background: ${t}`}
@@ -2670,7 +2670,7 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
2670
2670
  >
2671
2671
  <div class="fill" style=${`background: ${e}`}></div>
2672
2672
  </div>
2673
- `}},e.KRProgressBar.styles=a`
2673
+ `}},e.KRProgressBar.styles=l`
2674
2674
  :host {
2675
2675
  display: block;
2676
2676
  width: 100%;
@@ -2702,13 +2702,13 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
2702
2702
  left: 100%;
2703
2703
  }
2704
2704
  }
2705
- `,st([ue({type:String,reflect:!0})],e.KRProgressBar.prototype,"color",void 0),st([ue({type:String,reflect:!0})],e.KRProgressBar.prototype,"trackColor",void 0),e.KRProgressBar=st([ce("kr-progress-bar")],e.KRProgressBar);var ot,rt=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};e.KRFilePreview=ot=class extends le{constructor(){super(...arguments),this._zoom=100,this._panX=0,this._panY=0,this._dragging=!1,this._dragStartX=0,this._dragStartY=0,this._panStartX=0,this._panStartY=0,this.src="",this.name="",this._zoomLevel=100,this._textContent=null,this._handleKeydown=e=>{"Escape"===e.key&&this._close()},this._handleDragMove=e=>{this._dragging&&(this._panX=this._panStartX+(e.clientX-this._dragStartX),this._panY=this._panStartY+(e.clientY-this._dragStartY),this.requestUpdate())},this._handleDragEnd=()=>{this._dragging=!1,document.removeEventListener("mousemove",this._handleDragMove),document.removeEventListener("mouseup",this._handleDragEnd)}}static open(e){this._activePreview&&this._activePreview._close();const t=document.createElement("kr-file-preview");return t.src=e.src,t.name=e.name,document.body.appendChild(t),this._activePreview=t,t}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this._handleKeydown),this._isText()&&this._loadTextContent()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this._handleKeydown)}_close(){this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})),ot._activePreview===this&&(ot._activePreview=null),this.remove()}_handleDownload(){this.dispatchEvent(new CustomEvent("download",{bubbles:!0,composed:!0,detail:{src:this.src,name:this.name}}))}_handleZoomIn(){this._zoomLevel=Math.min(this._zoomLevel+25,300),this._zoomLevel<=100&&(this._panX=0,this._panY=0)}_handleZoomOut(){this._zoomLevel=Math.max(this._zoomLevel-25,25),this._zoomLevel<=100&&(this._panX=0,this._panY=0)}_handleZoomReset(){this._zoomLevel=100,this._panX=0,this._panY=0}_handleDragStart(e){this._zoomLevel<=100||(e.preventDefault(),this._dragging=!0,this._dragStartX=e.clientX,this._dragStartY=e.clientY,this._panStartX=this._panX,this._panStartY=this._panY,document.addEventListener("mousemove",this._handleDragMove),document.addEventListener("mouseup",this._handleDragEnd))}_handleBackdropClick(e){e.target===e.currentTarget&&this._close()}_getExtension(){return(this.name||"").split(".").pop()?.toLowerCase()||""}_isImage(){return["jpg","jpeg","png","gif","webp","svg","bmp"].includes(this._getExtension())}_isPdf(){return"pdf"===this._getExtension()}_isText(){return["csv","txt","json","xml","log","md","yml","yaml","ini","cfg","conf","env","sh","bat"].includes(this._getExtension())}_isCsv(){return"csv"===this._getExtension()}_loadTextContent(){fetch(this.src).then((e=>e.text())).then((e=>{this._isCsv()?this._textContent=this._formatCsv(e):this._textContent=e})).catch((()=>{this._textContent="Failed to load file content."}))}_formatCsv(e){const t=e.trim().split("\n");if(!t.length)return e;const i=t.map((e=>e.split(",").map((e=>e.trim())))),s=Math.max(...i.map((e=>e.length))),o=[];for(let e=0;e<s;e++){let t=0;for(const s of i){const i=(s[e]||"").length;i>t&&(t=i)}o.push(t)}return i.map((e=>e.map(((e,t)=>e.padEnd(o[t]||0))).join(" "))).join("\n")}_getFallbackIconClass(e){return["doc","docx","rtf","txt"].includes(e)?"fallback__icon--doc":["xls","xlsx","csv"].includes(e)?"fallback__icon--xls":["zip","rar","7z","gz","tar"].includes(e)?"fallback__icon--zip":"fallback__icon--default"}_getFallbackIcon(e){return["doc","docx","rtf","txt"].includes(e)?j`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6zm2-6h8v2H8v-2zm0-4h8v2H8v-2zm0 8h5v2H8v-2z"/></svg>`:["xls","xlsx","csv"].includes(e)?j`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 2v3H5V5h14zm0 5v4H5v-4h14zM5 19v-3h14v3H5zm2-8h4v2H7v-2zm0 5h4v2H7v-2z"/></svg>`:["zip","rar","7z","gz","tar"].includes(e)?j`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M20 6h-8l-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V6h5.17l2 2H20v10zm-8-4h2v2h-2v-2zm0-4h2v2h-2v-2zm-2 2h2v2h-2v-2z"/></svg>`:j`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"/></svg>`}render(){let e;if(this._isImage()){const t=this._zoomLevel/100,i=this._panX/t,s=this._panY/t,o=this._zoomLevel>100?"grab":"default";e=j`<img
2705
+ `,st([ue({type:String,reflect:!0})],e.KRProgressBar.prototype,"color",void 0),st([ue({type:String,reflect:!0})],e.KRProgressBar.prototype,"trackColor",void 0),e.KRProgressBar=st([he("kr-progress-bar")],e.KRProgressBar);var ot,rt=function(e,t,i,s){var o,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(l=(r<3?o(l):r>3?o(t,i,l):o(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};e.KRFilePreview=ot=class extends ae{constructor(){super(...arguments),this._zoom=100,this._panX=0,this._panY=0,this._dragging=!1,this._dragStartX=0,this._dragStartY=0,this._panStartX=0,this._panStartY=0,this.src="",this.name="",this._zoomLevel=100,this._textContent=null,this._handleKeydown=e=>{"Escape"===e.key&&this._close()},this._handleDragMove=e=>{this._dragging&&(this._panX=this._panStartX+(e.clientX-this._dragStartX),this._panY=this._panStartY+(e.clientY-this._dragStartY),this.requestUpdate())},this._handleDragEnd=()=>{this._dragging=!1,document.removeEventListener("mousemove",this._handleDragMove),document.removeEventListener("mouseup",this._handleDragEnd)}}static open(e){this._activePreview&&this._activePreview._close();const t=document.createElement("kr-file-preview");return t.src=e.src,t.name=e.name,document.body.appendChild(t),this._activePreview=t,t}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this._handleKeydown),this._isText()&&this._loadTextContent()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this._handleKeydown)}_close(){this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})),ot._activePreview===this&&(ot._activePreview=null),this.remove()}_handleDownload(){this.dispatchEvent(new CustomEvent("download",{bubbles:!0,composed:!0,detail:{src:this.src,name:this.name}}))}_handleZoomIn(){this._zoomLevel=Math.min(this._zoomLevel+25,300),this._zoomLevel<=100&&(this._panX=0,this._panY=0)}_handleZoomOut(){this._zoomLevel=Math.max(this._zoomLevel-25,25),this._zoomLevel<=100&&(this._panX=0,this._panY=0)}_handleZoomReset(){this._zoomLevel=100,this._panX=0,this._panY=0}_handleDragStart(e){this._zoomLevel<=100||(e.preventDefault(),this._dragging=!0,this._dragStartX=e.clientX,this._dragStartY=e.clientY,this._panStartX=this._panX,this._panStartY=this._panY,document.addEventListener("mousemove",this._handleDragMove),document.addEventListener("mouseup",this._handleDragEnd))}_handleBackdropClick(e){e.target===e.currentTarget&&this._close()}_getExtension(){return(this.name||"").split(".").pop()?.toLowerCase()||""}_isImage(){return["jpg","jpeg","png","gif","webp","svg","bmp"].includes(this._getExtension())}_isPdf(){return"pdf"===this._getExtension()}_isText(){return["csv","txt","json","xml","log","md","yml","yaml","ini","cfg","conf","env","sh","bat"].includes(this._getExtension())}_isCsv(){return"csv"===this._getExtension()}_loadTextContent(){fetch(this.src).then((e=>e.text())).then((e=>{this._isCsv()?this._textContent=this._formatCsv(e):this._textContent=e})).catch((()=>{this._textContent="Failed to load file content."}))}_formatCsv(e){const t=e.trim().split("\n");if(!t.length)return e;const i=t.map((e=>e.split(",").map((e=>e.trim())))),s=Math.max(...i.map((e=>e.length))),o=[];for(let e=0;e<s;e++){let t=0;for(const s of i){const i=(s[e]||"").length;i>t&&(t=i)}o.push(t)}return i.map((e=>e.map(((e,t)=>e.padEnd(o[t]||0))).join(" "))).join("\n")}_getFallbackIconClass(e){return["doc","docx","rtf","txt"].includes(e)?"fallback__icon--doc":["xls","xlsx","csv"].includes(e)?"fallback__icon--xls":["zip","rar","7z","gz","tar"].includes(e)?"fallback__icon--zip":"fallback__icon--default"}_getFallbackIcon(e){return["doc","docx","rtf","txt"].includes(e)?B`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6zm2-6h8v2H8v-2zm0-4h8v2H8v-2zm0 8h5v2H8v-2z"/></svg>`:["xls","xlsx","csv"].includes(e)?B`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 2v3H5V5h14zm0 5v4H5v-4h14zM5 19v-3h14v3H5zm2-8h4v2H7v-2zm0 5h4v2H7v-2z"/></svg>`:["zip","rar","7z","gz","tar"].includes(e)?B`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M20 6h-8l-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V6h5.17l2 2H20v10zm-8-4h2v2h-2v-2zm0-4h2v2h-2v-2zm-2 2h2v2h-2v-2z"/></svg>`:B`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"/></svg>`}render(){let e;if(this._isImage()){const t=this._zoomLevel/100,i=this._panX/t,s=this._panY/t,o=this._zoomLevel>100?"grab":"default";e=B`<img
2706
2706
  class="body__image"
2707
2707
  src="${this.src}"
2708
2708
  alt="${this.name}"
2709
2709
  style="transform: scale(${t}) translate(${i}px, ${s}px); cursor: ${o}"
2710
2710
  @mousedown=${this._handleDragStart}
2711
- />`}else if(this._isPdf())e=j`<iframe class="body__iframe" src="${this.src}"></iframe>`;else if(this._isText())e=null===this._textContent?j`<div class="body__text-loading">Loading...</div>`:j`<pre class="body__text">${this._textContent}</pre>`;else{const t=this._getExtension();e=j`
2711
+ />`}else if(this._isPdf())e=B`<iframe class="body__iframe" src="${this.src}"></iframe>`;else if(this._isText())e=null===this._textContent?B`<div class="body__text-loading">Loading...</div>`:B`<pre class="body__text">${this._textContent}</pre>`;else{const t=this._getExtension();e=B`
2712
2712
  <div class="fallback">
2713
2713
  <div class="fallback__icon ${this._getFallbackIconClass(t)}">
2714
2714
  ${this._getFallbackIcon(t)}
@@ -2720,11 +2720,11 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
2720
2720
  Download
2721
2721
  </kr-button>
2722
2722
  </div>
2723
- `}return j`
2723
+ `}return B`
2724
2724
  <div class="toolbar">
2725
2725
  <div class="toolbar__name">${this.name}</div>
2726
2726
  <div class="toolbar__controls">
2727
- ${this._isImage()?j`
2727
+ ${this._isImage()?B`
2728
2728
  <button class="toolbar__btn" @click=${this._handleZoomOut} title="Zoom out">
2729
2729
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7V9z"/></svg>
2730
2730
  </button>
@@ -2745,7 +2745,7 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
2745
2745
  <div class="body" @click=${this._handleBackdropClick}>
2746
2746
  ${e}
2747
2747
  </div>
2748
- `}},e.KRFilePreview.styles=a`
2748
+ `}},e.KRFilePreview.styles=l`
2749
2749
  *,
2750
2750
  *::after,
2751
2751
  *::before,
@@ -2925,14 +2925,14 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
2925
2925
  height: 18px;
2926
2926
  fill: currentColor;
2927
2927
  }
2928
- `,e.KRFilePreview._activePreview=null,rt([ue({type:String})],e.KRFilePreview.prototype,"src",void 0),rt([ue({type:String})],e.KRFilePreview.prototype,"name",void 0),rt([fe()],e.KRFilePreview.prototype,"_zoomLevel",void 0),rt([fe()],e.KRFilePreview.prototype,"_textContent",void 0),e.KRFilePreview=ot=rt([ce("kr-file-preview")],e.KRFilePreview);var at=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};e.KRFileList=class extends le{constructor(){super(...arguments),this.files=[],this.emptyMessage="No files"}_handleFileClick(t){if(this.dispatchEvent(new CustomEvent("file-click",{bubbles:!0,composed:!0,detail:{file:t}})),t.url){e.KRFilePreview.open({src:t.url,name:t.name}).addEventListener("download",(()=>{this._handleDownload(t)}))}}_handleDownload(e){this.dispatchEvent(new CustomEvent("download",{bubbles:!0,composed:!0,detail:{file:e}}))}_handleDelete(e){this.dispatchEvent(new CustomEvent("delete",{bubbles:!0,composed:!0,detail:{file:e}}))}_getExtension(e){return e.split(".").pop()?.toLowerCase()||""}_getExtClass(e){return["pdf"].includes(e)?"file-list__ext--pdf":["doc","docx","rtf","txt"].includes(e)?"file-list__ext--doc":["xls","xlsx","csv"].includes(e)?"file-list__ext--xls":["zip","rar","7z","gz","tar"].includes(e)?"file-list__ext--zip":["jpg","jpeg","png","gif","webp","svg","bmp"].includes(e)?"file-list__ext--img":"file-list__ext--default"}_getExtIcon(e){return["jpg","jpeg","png","gif","webp","svg","bmp"].includes(e)?j`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86-3 3.87L9 13.14 6 17h12l-3.86-5.14z"/></svg>`:["pdf"].includes(e)?j`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5v3zm4-3H19v1h1.5V11H19v2h-1.5V7h3v1.5zM9 9.5h1v-1H9v1zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm10 5.5h1v-3h-1v3z"/></svg>`:["doc","docx","rtf","txt"].includes(e)?j`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6zm2-6h8v2H8v-2zm0-4h8v2H8v-2zm0 8h5v2H8v-2z"/></svg>`:["xls","xlsx","csv"].includes(e)?j`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 2v3H5V5h14zm0 5v4H5v-4h14zM5 19v-3h14v3H5zm2-8h4v2H7v-2zm0 5h4v2H7v-2z"/></svg>`:["zip","rar","7z","gz","tar"].includes(e)?j`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M20 6h-8l-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V6h5.17l2 2H20v10zm-8-4h2v2h-2v-2zm0-4h2v2h-2v-2zm-2 2h2v2h-2v-2z"/></svg>`:j`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"/></svg>`}render(){return this.files.length?j`
2928
+ `,e.KRFilePreview._activePreview=null,rt([ue({type:String})],e.KRFilePreview.prototype,"src",void 0),rt([ue({type:String})],e.KRFilePreview.prototype,"name",void 0),rt([fe()],e.KRFilePreview.prototype,"_zoomLevel",void 0),rt([fe()],e.KRFilePreview.prototype,"_textContent",void 0),e.KRFilePreview=ot=rt([he("kr-file-preview")],e.KRFilePreview);var lt=function(e,t,i,s){var o,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(l=(r<3?o(l):r>3?o(t,i,l):o(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};e.KRFileList=class extends ae{constructor(){super(...arguments),this.files=[],this.emptyMessage="No files"}_handleFileClick(t){if(this.dispatchEvent(new CustomEvent("file-click",{bubbles:!0,composed:!0,detail:{file:t}})),t.url){e.KRFilePreview.open({src:t.url,name:t.name}).addEventListener("download",(()=>{this._handleDownload(t)}))}}_handleDownload(e){this.dispatchEvent(new CustomEvent("download",{bubbles:!0,composed:!0,detail:{file:e}}))}_handleDelete(e){this.dispatchEvent(new CustomEvent("delete",{bubbles:!0,composed:!0,detail:{file:e}}))}_getExtension(e){return e.split(".").pop()?.toLowerCase()||""}_getExtClass(e){return["pdf"].includes(e)?"file-list__ext--pdf":["doc","docx","rtf","txt"].includes(e)?"file-list__ext--doc":["xls","xlsx","csv"].includes(e)?"file-list__ext--xls":["zip","rar","7z","gz","tar"].includes(e)?"file-list__ext--zip":["jpg","jpeg","png","gif","webp","svg","bmp"].includes(e)?"file-list__ext--img":"file-list__ext--default"}_getExtIcon(e){return["jpg","jpeg","png","gif","webp","svg","bmp"].includes(e)?B`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86-3 3.87L9 13.14 6 17h12l-3.86-5.14z"/></svg>`:["pdf"].includes(e)?B`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5v3zm4-3H19v1h1.5V11H19v2h-1.5V7h3v1.5zM9 9.5h1v-1H9v1zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm10 5.5h1v-3h-1v3z"/></svg>`:["doc","docx","rtf","txt"].includes(e)?B`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6zm2-6h8v2H8v-2zm0-4h8v2H8v-2zm0 8h5v2H8v-2z"/></svg>`:["xls","xlsx","csv"].includes(e)?B`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 2v3H5V5h14zm0 5v4H5v-4h14zM5 19v-3h14v3H5zm2-8h4v2H7v-2zm0 5h4v2H7v-2z"/></svg>`:["zip","rar","7z","gz","tar"].includes(e)?B`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M20 6h-8l-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V6h5.17l2 2H20v10zm-8-4h2v2h-2v-2zm0-4h2v2h-2v-2zm-2 2h2v2h-2v-2z"/></svg>`:B`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"/></svg>`}render(){return this.files.length?B`
2929
2929
  <div class="file-list">
2930
- ${this.files.map((e=>{const t=this._getExtension(e.name),i=e.meta||e.date||"";return j`
2930
+ ${this.files.map((e=>{const t=this._getExtension(e.name),i=e.meta||e.date||"";return B`
2931
2931
  <div class="file-list__item">
2932
2932
  <div class="file-list__ext ${this._getExtClass(t)}">${this._getExtIcon(t)}</div>
2933
2933
  <div class="file-list__info">
2934
2934
  <a class="file-list__name" @click=${()=>this._handleFileClick(e)}>${e.name}</a>
2935
- ${i?j`<div class="file-list__meta">${i}</div>`:""}
2935
+ ${i?B`<div class="file-list__meta">${i}</div>`:""}
2936
2936
  </div>
2937
2937
  <div class="file-list__actions">
2938
2938
  <svg class="file-list__action" @click=${()=>this._handleDownload(e)} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" title="Download"><path d="M19 9h-4V3H9v6H5l7 7 7-7zm-8 2V5h2v6h1.17L12 13.17 9.83 11H11zm-6 7h14v2H5v-2z"/></svg>
@@ -2941,7 +2941,7 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
2941
2941
  </div>
2942
2942
  `}))}
2943
2943
  </div>
2944
- `:j`<div class="file-list__empty">${this.emptyMessage}</div>`}},e.KRFileList.styles=a`
2944
+ `:B`<div class="file-list__empty">${this.emptyMessage}</div>`}},e.KRFileList.styles=l`
2945
2945
  *,
2946
2946
  *::after,
2947
2947
  *::before,
@@ -3055,28 +3055,28 @@ const ze="important",Oe=" !"+ze,Ae=xe(class extends ke{constructor(e){if(super(e
3055
3055
  font-style: italic;
3056
3056
  padding: 20px;
3057
3057
  }
3058
- `,at([ue({type:Array})],e.KRFileList.prototype,"files",void 0),at([ue({type:String,attribute:"empty-message"})],e.KRFileList.prototype,"emptyMessage",void 0),e.KRFileList=at([ce("kr-file-list")],e.KRFileList);
3058
+ `,lt([ue({type:Array})],e.KRFileList.prototype,"files",void 0),lt([ue({type:String,attribute:"empty-message"})],e.KRFileList.prototype,"emptyMessage",void 0),e.KRFileList=lt([he("kr-file-list")],e.KRFileList);
3059
3059
  /**
3060
3060
  * @license
3061
3061
  * Copyright 2018 Google LLC
3062
3062
  * SPDX-License-Identifier: BSD-3-Clause
3063
3063
  */
3064
- const lt=e=>e??V
3064
+ const at=e=>e??V
3065
3065
  /**
3066
3066
  * @license
3067
3067
  * Copyright 2020 Google LLC
3068
3068
  * SPDX-License-Identifier: BSD-3-Clause
3069
- */,nt={},dt=xe(class extends ke{constructor(e){if(super(e),e.type!==_e&&e.type!==ve&&e.type!==ye)throw Error("The `live` directive is not allowed on child or event bindings");if(!(e=>void 0===e.strings)(e))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[t]){if(t===B||t===V)return t;const i=e.element,s=e.name;if(e.type===_e){if(t===i[s])return B}else if(e.type===ye){if(!!t===i.hasAttribute(s))return B}else if(e.type===ve&&i.getAttribute(s)===t+"")return B;return((e,t=nt)=>{e._$AH=t;
3069
+ */,nt={},dt=xe(class extends ke{constructor(e){if(super(e),e.type!==me&&e.type!==ve&&e.type!==ye)throw Error("The `live` directive is not allowed on child or event bindings");if(!(e=>void 0===e.strings)(e))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[t]){if(t===j||t===V)return t;const i=e.element,s=e.name;if(e.type===me){if(t===i[s])return j}else if(e.type===ye){if(!!t===i.hasAttribute(s))return j}else if(e.type===ve&&i.getAttribute(s)===t+"")return j;return((e,t=nt)=>{e._$AH=t;
3070
3070
  /**
3071
3071
  * @license
3072
3072
  * Copyright 2020 Google LLC
3073
3073
  * SPDX-License-Identifier: BSD-3-Clause
3074
- */})(e),t}});var ct=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};e.KRTextField=class extends le{constructor(){super(),this.label="",this.name="",this.value="",this.placeholder="",this.type="text",this.required=!1,this.disabled=!1,this.readonly=!1,this.autocomplete="",this.hint="",this._touched=!1,this._dirty=!1,this._handleInvalid=e=>{e.preventDefault(),this._touched=!0},this._internals=this.attachInternals()}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}formResetCallback(){this.value="",this._touched=!1,this._dirty=!1,this._internals.setFormValue(""),this._internals.setValidity({})}formStateRestoreCallback(e){this.value=e}connectedCallback(){super.connectedCallback(),this.addEventListener("invalid",this._handleInvalid)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("invalid",this._handleInvalid)}firstUpdated(){this._updateValidity()}updated(e){(e.has("required")||e.has("value"))&&this._updateValidity()}_updateValidity(){this._input&&this._internals.setValidity(this._input.validity,this._input.validationMessage)}_handleInput(e){this.value=e.target.value,this._dirty=!0,this._internals.setFormValue(this.value),this._internals.setValidity(this._input.validity,this._input.validationMessage)}_handleChange(e){this.value=e.target.value,this._internals.setFormValue(this.value)}_handleBlur(){this._touched=!0,this._internals.setValidity(this._input.validity,this._input.validationMessage)}render(){let e="";return this._touched&&this._input&&!this._input.validity.valid&&(e=this._input.validationMessage),j`
3074
+ */})(e),t}});var ht=function(e,t,i,s){var o,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(l=(r<3?o(l):r>3?o(t,i,l):o(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};e.KRTextField=class extends ae{constructor(){super(),this.label="",this.name="",this.value="",this.placeholder="",this.type="text",this.required=!1,this.disabled=!1,this.readonly=!1,this.autocomplete="",this.hint="",this._touched=!1,this._dirty=!1,this._handleInvalid=e=>{e.preventDefault(),this._touched=!0},this._internals=this.attachInternals()}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}formResetCallback(){this.value="",this._touched=!1,this._dirty=!1,this._internals.setFormValue(""),this._internals.setValidity({})}formStateRestoreCallback(e){this.value=e}connectedCallback(){super.connectedCallback(),this.addEventListener("invalid",this._handleInvalid)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("invalid",this._handleInvalid)}firstUpdated(){this._updateValidity()}updated(e){(e.has("required")||e.has("value"))&&this._updateValidity()}_updateValidity(){this._input&&this._internals.setValidity(this._input.validity,this._input.validationMessage)}_handleInput(e){this.value=e.target.value,this._dirty=!0,this._internals.setFormValue(this.value),this._internals.setValidity(this._input.validity,this._input.validationMessage)}_handleChange(e){this.value=e.target.value,this._internals.setFormValue(this.value)}_handleBlur(){this._touched=!0,this._internals.setValidity(this._input.validity,this._input.validationMessage)}render(){let e="";return this._touched&&this._input&&!this._input.validity.valid&&(e=this._input.validationMessage),B`
3075
3075
  <div class="wrapper">
3076
- ${this.label?j`
3076
+ ${this.label?B`
3077
3077
  <label for="input">
3078
3078
  ${this.label}
3079
- ${this.required?j`<span class="required" aria-hidden="true">*</span>`:""}
3079
+ ${this.required?B`<span class="required" aria-hidden="true">*</span>`:""}
3080
3080
  </label>
3081
3081
  `:""}
3082
3082
  <input
@@ -3089,17 +3089,17 @@ const lt=e=>e??V
3089
3089
  ?required=${this.required}
3090
3090
  ?disabled=${this.disabled}
3091
3091
  ?readonly=${this.readonly}
3092
- minlength=${lt(this.minlength)}
3093
- maxlength=${lt(this.maxlength)}
3094
- pattern=${lt(this.pattern)}
3095
- autocomplete=${lt(this.autocomplete||void 0)}
3092
+ minlength=${at(this.minlength)}
3093
+ maxlength=${at(this.maxlength)}
3094
+ pattern=${at(this.pattern)}
3095
+ autocomplete=${at(this.autocomplete||void 0)}
3096
3096
  @input=${this._handleInput}
3097
3097
  @change=${this._handleChange}
3098
3098
  @blur=${this._handleBlur}
3099
3099
  />
3100
- ${e?j`<div class="validation-message">${e}</div>`:this.hint?j`<div class="hint">${this.hint}</div>`:""}
3100
+ ${e?B`<div class="validation-message">${e}</div>`:this.hint?B`<div class="hint">${this.hint}</div>`:""}
3101
3101
  </div>
3102
- `}focus(){this._input?.focus()}blur(){this._input?.blur()}select(){this._input?.select()}},e.KRTextField.styles=a`
3102
+ `}focus(){this._input?.focus()}blur(){this._input?.blur()}select(){this._input?.select()}},e.KRTextField.styles=l`
3103
3103
  :host {
3104
3104
  display: block;
3105
3105
  font-family: inherit;
@@ -3166,12 +3166,12 @@ const lt=e=>e??V
3166
3166
  font-size: 0.75rem;
3167
3167
  color: var(--kr-text-field-helper-color, #6b7280);
3168
3168
  }
3169
- `,e.KRTextField.formAssociated=!0,ct([ue({type:String})],e.KRTextField.prototype,"label",void 0),ct([ue({type:String})],e.KRTextField.prototype,"name",void 0),ct([ue({type:String})],e.KRTextField.prototype,"value",void 0),ct([ue({type:String})],e.KRTextField.prototype,"placeholder",void 0),ct([ue({type:String})],e.KRTextField.prototype,"type",void 0),ct([ue({type:Boolean})],e.KRTextField.prototype,"required",void 0),ct([ue({type:Boolean})],e.KRTextField.prototype,"disabled",void 0),ct([ue({type:Boolean})],e.KRTextField.prototype,"readonly",void 0),ct([ue({type:Number})],e.KRTextField.prototype,"minlength",void 0),ct([ue({type:Number})],e.KRTextField.prototype,"maxlength",void 0),ct([ue({type:String})],e.KRTextField.prototype,"pattern",void 0),ct([ue({type:String})],e.KRTextField.prototype,"autocomplete",void 0),ct([ue({type:String})],e.KRTextField.prototype,"hint",void 0),ct([ge("input")],e.KRTextField.prototype,"_input",void 0),ct([fe()],e.KRTextField.prototype,"_touched",void 0),ct([fe()],e.KRTextField.prototype,"_dirty",void 0),e.KRTextField=ct([ce("kr-text-field")],e.KRTextField);var ht=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};e.KRTextareaField=class extends le{constructor(){super(),this.label="",this.name="",this.value="",this.placeholder="",this.required=!1,this.disabled=!1,this.readonly=!1,this.rows=3,this.autocomplete="",this.hint="",this._touched=!1,this._dirty=!1,this._handleInvalid=e=>{e.preventDefault(),this._touched=!0},this._internals=this.attachInternals()}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}formResetCallback(){this.value="",this._touched=!1,this._dirty=!1,this._internals.setFormValue(""),this._internals.setValidity({})}formStateRestoreCallback(e){this.value=e}connectedCallback(){super.connectedCallback(),this.addEventListener("invalid",this._handleInvalid)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("invalid",this._handleInvalid)}firstUpdated(){this._updateValidity()}updated(e){(e.has("required")||e.has("value"))&&this._updateValidity()}_updateValidity(){this._textarea&&this._internals.setValidity(this._textarea.validity,this._textarea.validationMessage)}_handleInput(e){this.value=e.target.value,this._dirty=!0,this._internals.setFormValue(this.value),this._internals.setValidity(this._textarea.validity,this._textarea.validationMessage)}_handleChange(e){this.value=e.target.value,this._internals.setFormValue(this.value)}_handleBlur(){this._touched=!0,this._internals.setValidity(this._textarea.validity,this._textarea.validationMessage)}render(){let e="";return this._touched&&this._textarea&&!this._textarea.validity.valid&&(e=this._textarea.validationMessage),j`
3169
+ `,e.KRTextField.formAssociated=!0,ht([ue({type:String})],e.KRTextField.prototype,"label",void 0),ht([ue({type:String})],e.KRTextField.prototype,"name",void 0),ht([ue({type:String})],e.KRTextField.prototype,"value",void 0),ht([ue({type:String})],e.KRTextField.prototype,"placeholder",void 0),ht([ue({type:String})],e.KRTextField.prototype,"type",void 0),ht([ue({type:Boolean})],e.KRTextField.prototype,"required",void 0),ht([ue({type:Boolean})],e.KRTextField.prototype,"disabled",void 0),ht([ue({type:Boolean})],e.KRTextField.prototype,"readonly",void 0),ht([ue({type:Number})],e.KRTextField.prototype,"minlength",void 0),ht([ue({type:Number})],e.KRTextField.prototype,"maxlength",void 0),ht([ue({type:String})],e.KRTextField.prototype,"pattern",void 0),ht([ue({type:String})],e.KRTextField.prototype,"autocomplete",void 0),ht([ue({type:String})],e.KRTextField.prototype,"hint",void 0),ht([ge("input")],e.KRTextField.prototype,"_input",void 0),ht([fe()],e.KRTextField.prototype,"_touched",void 0),ht([fe()],e.KRTextField.prototype,"_dirty",void 0),e.KRTextField=ht([he("kr-text-field")],e.KRTextField);var ct=function(e,t,i,s){var o,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(l=(r<3?o(l):r>3?o(t,i,l):o(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};e.KRTextareaField=class extends ae{constructor(){super(),this.label="",this.name="",this.value="",this.placeholder="",this.required=!1,this.disabled=!1,this.readonly=!1,this.rows=3,this.autocomplete="",this.hint="",this._touched=!1,this._dirty=!1,this._handleInvalid=e=>{e.preventDefault(),this._touched=!0},this._internals=this.attachInternals()}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}formResetCallback(){this.value="",this._touched=!1,this._dirty=!1,this._internals.setFormValue(""),this._internals.setValidity({})}formStateRestoreCallback(e){this.value=e}connectedCallback(){super.connectedCallback(),this.addEventListener("invalid",this._handleInvalid)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("invalid",this._handleInvalid)}firstUpdated(){this._updateValidity()}updated(e){(e.has("required")||e.has("value"))&&this._updateValidity()}_updateValidity(){this._textarea&&this._internals.setValidity(this._textarea.validity,this._textarea.validationMessage)}_handleInput(e){this.value=e.target.value,this._dirty=!0,this._internals.setFormValue(this.value),this._internals.setValidity(this._textarea.validity,this._textarea.validationMessage)}_handleChange(e){this.value=e.target.value,this._internals.setFormValue(this.value)}_handleBlur(){this._touched=!0,this._internals.setValidity(this._textarea.validity,this._textarea.validationMessage)}render(){let e="";return this._touched&&this._textarea&&!this._textarea.validity.valid&&(e=this._textarea.validationMessage),B`
3170
3170
  <div class="wrapper">
3171
- ${this.label?j`
3171
+ ${this.label?B`
3172
3172
  <label for="textarea">
3173
3173
  ${this.label}
3174
- ${this.required?j`<span class="required" aria-hidden="true">*</span>`:V}
3174
+ ${this.required?B`<span class="required" aria-hidden="true">*</span>`:V}
3175
3175
  </label>
3176
3176
  `:V}
3177
3177
  <textarea
@@ -3184,17 +3184,17 @@ const lt=e=>e??V
3184
3184
  ?disabled=${this.disabled}
3185
3185
  ?readonly=${this.readonly}
3186
3186
  rows=${this.rows}
3187
- cols=${lt(this.cols)}
3188
- minlength=${lt(this.minlength)}
3189
- maxlength=${lt(this.maxlength)}
3190
- autocomplete=${lt(this.autocomplete||void 0)}
3187
+ cols=${at(this.cols)}
3188
+ minlength=${at(this.minlength)}
3189
+ maxlength=${at(this.maxlength)}
3190
+ autocomplete=${at(this.autocomplete||void 0)}
3191
3191
  @input=${this._handleInput}
3192
3192
  @change=${this._handleChange}
3193
3193
  @blur=${this._handleBlur}
3194
3194
  ></textarea>
3195
- ${e?j`<div class="validation-message">${e}</div>`:this.hint?j`<div class="hint">${this.hint}</div>`:V}
3195
+ ${e?B`<div class="validation-message">${e}</div>`:this.hint?B`<div class="hint">${this.hint}</div>`:V}
3196
3196
  </div>
3197
- `}focus(){this._textarea?.focus()}blur(){this._textarea?.blur()}select(){this._textarea?.select()}},e.KRTextareaField.styles=a`
3197
+ `}focus(){this._textarea?.focus()}blur(){this._textarea?.blur()}select(){this._textarea?.select()}},e.KRTextareaField.styles=l`
3198
3198
  :host {
3199
3199
  display: block;
3200
3200
  font-family: inherit;
@@ -3264,12 +3264,12 @@ const lt=e=>e??V
3264
3264
  font-size: 0.75rem;
3265
3265
  color: var(--kr-textarea-field-helper-color, #6b7280);
3266
3266
  }
3267
- `,e.KRTextareaField.formAssociated=!0,ht([ue({type:String})],e.KRTextareaField.prototype,"label",void 0),ht([ue({type:String})],e.KRTextareaField.prototype,"name",void 0),ht([ue({type:String})],e.KRTextareaField.prototype,"value",void 0),ht([ue({type:String})],e.KRTextareaField.prototype,"placeholder",void 0),ht([ue({type:Boolean})],e.KRTextareaField.prototype,"required",void 0),ht([ue({type:Boolean})],e.KRTextareaField.prototype,"disabled",void 0),ht([ue({type:Boolean})],e.KRTextareaField.prototype,"readonly",void 0),ht([ue({type:Number})],e.KRTextareaField.prototype,"rows",void 0),ht([ue({type:Number})],e.KRTextareaField.prototype,"cols",void 0),ht([ue({type:Number})],e.KRTextareaField.prototype,"minlength",void 0),ht([ue({type:Number})],e.KRTextareaField.prototype,"maxlength",void 0),ht([ue({type:String})],e.KRTextareaField.prototype,"autocomplete",void 0),ht([ue({type:String})],e.KRTextareaField.prototype,"hint",void 0),ht([ge("textarea")],e.KRTextareaField.prototype,"_textarea",void 0),ht([fe()],e.KRTextareaField.prototype,"_touched",void 0),ht([fe()],e.KRTextareaField.prototype,"_dirty",void 0),e.KRTextareaField=ht([ce("kr-textarea-field")],e.KRTextareaField);var pt=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};let ut=class extends le{constructor(){super(...arguments),this.label="",this.value=""}render(){return j`
3267
+ `,e.KRTextareaField.formAssociated=!0,ct([ue({type:String})],e.KRTextareaField.prototype,"label",void 0),ct([ue({type:String})],e.KRTextareaField.prototype,"name",void 0),ct([ue({type:String})],e.KRTextareaField.prototype,"value",void 0),ct([ue({type:String})],e.KRTextareaField.prototype,"placeholder",void 0),ct([ue({type:Boolean})],e.KRTextareaField.prototype,"required",void 0),ct([ue({type:Boolean})],e.KRTextareaField.prototype,"disabled",void 0),ct([ue({type:Boolean})],e.KRTextareaField.prototype,"readonly",void 0),ct([ue({type:Number})],e.KRTextareaField.prototype,"rows",void 0),ct([ue({type:Number})],e.KRTextareaField.prototype,"cols",void 0),ct([ue({type:Number})],e.KRTextareaField.prototype,"minlength",void 0),ct([ue({type:Number})],e.KRTextareaField.prototype,"maxlength",void 0),ct([ue({type:String})],e.KRTextareaField.prototype,"autocomplete",void 0),ct([ue({type:String})],e.KRTextareaField.prototype,"hint",void 0),ct([ge("textarea")],e.KRTextareaField.prototype,"_textarea",void 0),ct([fe()],e.KRTextareaField.prototype,"_touched",void 0),ct([fe()],e.KRTextareaField.prototype,"_dirty",void 0),e.KRTextareaField=ct([he("kr-textarea-field")],e.KRTextareaField);var pt=function(e,t,i,s){var o,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(l=(r<3?o(l):r>3?o(t,i,l):o(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};let ut=class extends ae{constructor(){super(...arguments),this.label="",this.value=""}render(){return B`
3268
3268
  <div class="wrapper">
3269
- ${this.label?j`<label>${this.label}</label>`:V}
3269
+ ${this.label?B`<label>${this.label}</label>`:V}
3270
3270
  <div class="value">${this.value}</div>
3271
3271
  </div>
3272
- `}};ut.styles=a`
3272
+ `}};ut.styles=l`
3273
3273
  :host {
3274
3274
  display: block;
3275
3275
  font-family: inherit;
@@ -3291,141 +3291,92 @@ const lt=e=>e??V
3291
3291
  font-size: 14px;
3292
3292
  color: black;
3293
3293
  }
3294
- `,pt([ue({type:String})],ut.prototype,"label",void 0),pt([ue({type:String})],ut.prototype,"value",void 0),ut=pt([ce("kr-detail-field")],ut);var ft=function(e,t,i,s){var o,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a};function gt(e){return"options"in e}e.KRAutoSuggest=class extends le{constructor(){super(),this.label="",this.name="",this.value="",this.placeholder="",this.disabled=!1,this.readonly=!1,this.required=!1,this.hint="",this.options=[],this.statusType="finished",this.loadingText="Loading...",this.errorText="Error loading options",this.emptyText="No matches found",this.filteringType="auto",this.highlightMatches=!0,this._isOpen=!1,this._highlightedIndex=-1,this._touched=!1,this._dirty=!1,this._handleDocumentClick=this._onDocumentClick.bind(this),this._internals=this.attachInternals()}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleDocumentClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleDocumentClick)}firstUpdated(){this._updateFormValue()}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}formResetCallback(){this.value="",this._touched=!1,this._dirty=!1,this._isOpen=!1,this._highlightedIndex=-1,this._updateFormValue()}formStateRestoreCallback(e){this.value=e}get _filteredOptions(){if("manual"===this.filteringType||!this.value)return this.options;const e=this.value.toLowerCase(),t=[];for(const i of this.options)if(gt(i)){const s=i.options.filter((t=>{const i=(t.label||t.value).toLowerCase(),s=t.filteringTags?.join(" ").toLowerCase()||"";return i.includes(e)||s.includes(e)}));s.length>0&&t.push({...i,options:s})}else{const s=(i.label||i.value).toLowerCase(),o=i.filteringTags?.join(" ").toLowerCase()||"";(s.includes(e)||o.includes(e))&&t.push(i)}return t}get _flatOptions(){const e=[];for(const t of this._filteredOptions)gt(t)?e.push(...t.options):e.push(t);return e}_updateFormValue(){this._internals.setFormValue(this.value),this.required&&!this.value?this._internals.setValidity({valueMissing:!0},"This field is required",this._input):this._internals.setValidity({})}_onInput(e){const t=e.target;this.value=t.value,this._dirty=!0,this._isOpen=!0,this._highlightedIndex=-1,this._updateFormValue(),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),"manual"===this.filteringType&&this.dispatchEvent(new CustomEvent("load-items",{detail:{filteringText:this.value},bubbles:!0,composed:!0}))}_onFocus(){this._isOpen=!0,"manual"===this.filteringType&&this.dispatchEvent(new CustomEvent("load-items",{detail:{filteringText:this.value},bubbles:!0,composed:!0}))}_onBlur(){this._touched=!0,setTimeout((()=>{this._isOpen=!1,this._highlightedIndex=-1}),200),this._updateFormValue()}_onKeyDown(e){const t=this._flatOptions;switch(e.key){case"ArrowDown":e.preventDefault(),this._isOpen=!0,this._highlightedIndex=Math.min(this._highlightedIndex+1,t.length-1),this._scrollToHighlighted();break;case"ArrowUp":e.preventDefault(),this._highlightedIndex=Math.max(this._highlightedIndex-1,-1),this._scrollToHighlighted();break;case"Enter":this._highlightedIndex>=0&&t[this._highlightedIndex]&&(e.preventDefault(),this._selectOption(t[this._highlightedIndex]));break;case"Escape":e.preventDefault(),this._isOpen=!1,this._highlightedIndex=-1;break;case"Tab":this._isOpen=!1,this._highlightedIndex=-1}}_scrollToHighlighted(){this.updateComplete.then((()=>{const e=this.shadowRoot?.querySelector(".dropdown"),t=this.shadowRoot?.querySelector(".option.is-highlighted");if(e&&t){const i=e.getBoundingClientRect(),s=t.getBoundingClientRect();(s.bottom>i.bottom||s.top<i.top)&&t.scrollIntoView({block:"nearest"})}}))}_selectOption(e){e.disabled||(this.value=e.label||e.value,this._isOpen=!1,this._highlightedIndex=-1,this._dirty=!0,this._updateFormValue(),this.dispatchEvent(new CustomEvent("select",{detail:{value:e.value,selectedOption:e},bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}_handleClear(){this.value="",this._updateFormValue(),this.dispatchEvent(new CustomEvent("change",{detail:{value:""},bubbles:!0,composed:!0})),this._input?.focus()}_onDocumentClick(e){e.composedPath().includes(this)||(this._isOpen=!1)}_highlightMatch(e){if(!this.value||"manual"===this.filteringType||!this.highlightMatches)return j`${e}`;const t=this.value.toLowerCase(),i=e.toLowerCase().indexOf(t);if(-1===i)return j`${e}`;const s=e.slice(0,i),o=e.slice(i,i+this.value.length),r=e.slice(i+this.value.length);return j`${s}<span class="highlight">${o}</span>${r}`}_renderOption(e,t){const i=t===this._highlightedIndex;return j`
3294
+ `,pt([ue({type:String})],ut.prototype,"label",void 0),pt([ue({type:String})],ut.prototype,"value",void 0),ut=pt([he("kr-detail-field")],ut);var ft=function(e,t,i,s){var o,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(l=(r<3?o(l):r>3?o(t,i,l):o(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};e.KRAutoSuggest=class extends ae{constructor(){super(),this._requestId=0,this._handleDocumentClick=e=>{e.composedPath().includes(this)||(this._isOpen=!1)},this.label="",this.name="",this.value="",this.placeholder="",this.disabled=!1,this.readonly=!1,this.required=!1,this.hint="",this.options=[],this.fetch=null,this._isOpen=!1,this._highlightedIndex=-1,this._touched=!1,this._handleInvalid=e=>{e.preventDefault(),this._touched=!0},this._internals=this.attachInternals()}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleDocumentClick),this.addEventListener("invalid",this._handleInvalid)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleDocumentClick),this.removeEventListener("invalid",this._handleInvalid)}firstUpdated(){this._updateValidity()}updated(e){(e.has("required")||e.has("value"))&&this._updateValidity(),e.has("options")&&this._isOpen&&this._positionDropdown()}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}formResetCallback(){this.value="",this._touched=!1,this._isOpen=!1,this._highlightedIndex=-1,this._internals.setFormValue(""),this._internals.setValidity({})}formStateRestoreCallback(e){this.value=e}_updateValidity(){this._input&&this._internals.setValidity(this._input.validity,this._input.validationMessage)}_fetch(){if(!this.fetch)return;this._requestId++;const e=this._requestId;this.fetch(this.value).then((t=>{e===this._requestId&&(this.options=t)})).catch((e=>{console.error("kr-auto-suggest: fetch failed",e)}))}_handleInput(e){this.value=e.target.value,this._isOpen=!0,this._highlightedIndex=-1,this._positionDropdown(),this._internals.setFormValue(this.value),this._internals.setValidity(this._input.validity,this._input.validationMessage),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this._fetch()}_positionDropdown(){requestAnimationFrame((()=>{const e=this.shadowRoot?.querySelector(".dropdown");if(!e)return;const t=this._input.getBoundingClientRect(),i=window.innerHeight-t.bottom-4-8,s=t.top-4-8;e.style.left=t.left+"px",e.style.width=t.width+"px",s>i?(e.style.top="",e.style.bottom=window.innerHeight-t.top+4+"px",e.style.maxHeight=s+"px"):(e.style.bottom="",e.style.top=t.bottom+4+"px",e.style.maxHeight=i+"px")}))}_handleFocus(){this._isOpen=!0,this._positionDropdown(),this._fetch()}_handleBlur(){this._touched=!0,this._internals.setValidity(this._input.validity,this._input.validationMessage),setTimeout((()=>{this._isOpen=!1,this._highlightedIndex=-1}),200)}_handleKeyDown(e){switch(e.key){case"ArrowDown":e.preventDefault(),this._isOpen=!0,this._highlightedIndex=Math.min(this._highlightedIndex+1,this.options.length-1),this._scrollToHighlighted();break;case"ArrowUp":e.preventDefault(),-1===this._highlightedIndex?(this._isOpen=!0,this._highlightedIndex=this.options.length-1):this._highlightedIndex=Math.max(this._highlightedIndex-1,0),this._scrollToHighlighted();break;case"Enter":this._highlightedIndex>=0&&this.options[this._highlightedIndex]&&(e.preventDefault(),this._selectOption(this.options[this._highlightedIndex]));break;case"Escape":e.preventDefault(),this._isOpen=!1,this._highlightedIndex=-1;break;case"Tab":this._isOpen=!1,this._highlightedIndex=-1}}_scrollToHighlighted(){this.updateComplete.then((()=>{const e=this.shadowRoot?.querySelector(".dropdown"),t=this.shadowRoot?.querySelector(".option--highlighted");if(e&&t){const i=e.getBoundingClientRect(),s=t.getBoundingClientRect();(s.bottom>i.bottom||s.top<i.top)&&t.scrollIntoView({block:"nearest"})}}))}_selectOption(e){e.disabled||(this.value=e.value,this._isOpen=!1,this._highlightedIndex=-1,this._internals.setFormValue(this.value),this.dispatchEvent(new CustomEvent("select",{detail:{value:e.value,option:e},bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}_handleClear(){this.value="",this._internals.setFormValue(this.value),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this._input?.focus()}_handleOptionMouseEnter(e,t){this._highlightedIndex=t}_renderOption(e,t){return B`
3295
3295
  <button
3296
- class=${we({option:!0,"is-highlighted":i})}
3296
+ class=${we({option:!0,"option--highlighted":t===this._highlightedIndex})}
3297
3297
  type="button"
3298
3298
  role="option"
3299
- aria-selected=${i}
3299
+ aria-selected=${t===this._highlightedIndex}
3300
3300
  ?disabled=${e.disabled}
3301
- @click=${()=>this._selectOption(e)}
3302
- @mouseenter=${()=>{this._highlightedIndex=t}}
3301
+ @click=${t=>this._selectOption(e)}
3302
+ @mouseenter=${e=>this._handleOptionMouseEnter(e,t)}
3303
3303
  >
3304
- <div class="option-content">
3305
- <div class="option-label">
3306
- ${this._highlightMatch(e.label||e.value)}
3307
- ${e.labelTag?j`<span class="option-tag">${e.labelTag}</span>`:V}
3308
- </div>
3309
- ${e.description?j`<div class="option-description">${e.description}</div>`:V}
3310
- ${e.tags&&e.tags.length>0?j`
3311
- <div class="option-tags">
3312
- ${e.tags.map((e=>j`<span class="option-tag">${e}</span>`))}
3313
- </div>
3314
- `:V}
3315
- </div>
3304
+ ${e.label||e.value}
3316
3305
  </button>
3317
- `}_renderDropdownContent(){if("loading"===this.statusType)return j`
3318
- <div class="status">
3319
- <div class="spinner"></div>
3320
- ${this.loadingText}
3321
- </div>
3322
- `;if("error"===this.statusType)return j`
3323
- <div class="status is-error">
3324
- <svg width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
3325
- <path
3326
- d="M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"
3327
- />
3328
- </svg>
3329
- ${this.errorText}
3330
- </div>
3331
- `;const e=this._filteredOptions;if(0===e.length)return j`<div class="empty">${this.emptyText}</div>`;let t=0;return j`
3332
- ${e.map((e=>{if(gt(e)){const i=e.options.map((e=>{const i=this._renderOption(e,t);return t++,i}));return j`
3333
- <div class="group-label">${e.label}</div>
3334
- ${i}
3335
- `}const i=this._renderOption(e,t);return t++,i}))}
3336
- `}render(){const e=this._touched&&!this.validity.valid;return j`
3337
- <div class="field-wrapper">
3338
- ${this.label?j`
3306
+ `}render(){let e=V;return this._touched&&this._input&&!this._input.validity.valid?e=B`<div class="validation-message">${this._input.validationMessage}</div>`:this.hint&&(e=B`<div class="hint">${this.hint}</div>`),B`
3307
+ <div class="wrapper">
3308
+ ${this.label?B`
3339
3309
  <label>
3340
3310
  ${this.label}
3341
- ${this.required?j`<span class="required">*</span>`:V}
3311
+ ${this.required?B`<span class="required">*</span>`:V}
3342
3312
  </label>
3343
3313
  `:V}
3344
3314
 
3345
- <div class="input-container">
3346
- <div class="input-wrapper">
3347
- <input
3348
- type="text"
3349
- .value=${dt(this.value)}
3350
- placeholder=${lt(this.placeholder||void 0)}
3351
- ?disabled=${this.disabled}
3352
- ?readonly=${this.readonly}
3353
- ?required=${this.required}
3354
- name=${lt(this.name||void 0)}
3355
- autocomplete="off"
3356
- role="combobox"
3357
- aria-autocomplete="list"
3358
- aria-expanded=${this._isOpen}
3359
- aria-controls="dropdown"
3360
- class=${we({"input--invalid":e})}
3361
- @input=${this._onInput}
3362
- @blur=${this._onBlur}
3363
- @focus=${this._onFocus}
3364
- @keydown=${this._onKeyDown}
3365
- />
3366
- <div class="icon-container">
3367
- ${!this.value||this.disabled||this.readonly?"":j`
3368
- <button
3369
- class="clear-button"
3370
- type="button"
3371
- aria-label="Clear"
3372
- @click=${this._handleClear}
3373
- >
3374
- <svg width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
3375
- <path
3376
- d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"
3377
- />
3378
- </svg>
3379
- </button>
3380
- `}
3381
- ${this.value||this.disabled||this.readonly?"":j`
3382
- <svg class="search-icon" fill="currentColor" viewBox="0 0 16 16">
3383
- <path
3384
- d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"
3385
- />
3386
- </svg>
3387
- `}
3388
- </div>
3315
+ <div class="input-wrapper">
3316
+ <input
3317
+ type="text"
3318
+ .value=${dt(this.value)}
3319
+ placeholder=${this.placeholder}
3320
+ ?disabled=${this.disabled}
3321
+ ?readonly=${this.readonly}
3322
+ ?required=${this.required}
3323
+ name=${this.name}
3324
+ autocomplete="off"
3325
+ role="combobox"
3326
+ aria-autocomplete="list"
3327
+ aria-expanded=${this._isOpen}
3328
+ aria-controls="dropdown"
3329
+ class=${we({"input--invalid":this._touched&&this._input&&!this._input.validity.valid})}
3330
+ @input=${this._handleInput}
3331
+ @blur=${this._handleBlur}
3332
+ @focus=${this._handleFocus}
3333
+ @keydown=${this._handleKeyDown}
3334
+ />
3335
+ <div class="icon-wrapper">
3336
+ ${!this.value||this.disabled||this.readonly?V:B`
3337
+ <svg class="clear" viewBox="0 0 24 24" fill="currentColor" aria-label="Clear" @click=${this._handleClear}>
3338
+ <path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/>
3339
+ </svg>
3340
+ `}
3341
+ ${this.value||this.disabled||this.readonly?V:B`
3342
+ <svg class="search-icon" viewBox="0 0 24 24" fill="currentColor">
3343
+ <path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/>
3344
+ </svg>
3345
+ `}
3389
3346
  </div>
3347
+ </div>
3390
3348
 
3391
- <div
3392
- id="dropdown"
3393
- role="listbox"
3394
- class=${we({dropdown:!0,"is-open":this._isOpen})}
3395
- >
3396
- ${this._renderDropdownContent()}
3397
- </div>
3349
+ <div
3350
+ id="dropdown"
3351
+ role="listbox"
3352
+ class=${we({dropdown:!0,"dropdown--open":this._isOpen&&this.options.length>0})}
3353
+ >
3354
+ ${this.options.map(((e,t)=>this._renderOption(e,t)))}
3398
3355
  </div>
3399
3356
 
3400
- ${e?j`<div class="validation-message">${this.validationMessage}</div>`:this.hint?j`<div class="hint">${this.hint}</div>`:V}
3357
+ ${e}
3401
3358
  </div>
3402
- `}},e.KRAutoSuggest.styles=a`
3359
+ `}},e.KRAutoSuggest.styles=l`
3403
3360
  :host {
3404
3361
  display: block;
3405
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
3406
- 'Helvetica Neue', sans-serif;
3362
+ font-family: inherit;
3407
3363
  }
3408
3364
 
3409
- .field-wrapper {
3365
+ .wrapper {
3410
3366
  display: flex;
3411
3367
  flex-direction: column;
3412
- gap: 4px;
3368
+ gap: 6px;
3413
3369
  }
3414
3370
 
3415
3371
  label {
3416
3372
  font-size: 14px;
3417
3373
  font-weight: 500;
3418
- color: var(--kr-text-field-label-color, #374151);
3419
- display: block;
3374
+ color: black;
3420
3375
  }
3421
3376
 
3422
3377
  .required {
3423
3378
  color: var(--kr-text-field-required-color, #ef4444);
3424
- margin-left: 2px;
3425
- }
3426
-
3427
- .input-container {
3428
- position: relative;
3379
+ margin-left: 0.125rem;
3429
3380
  }
3430
3381
 
3431
3382
  .input-wrapper {
@@ -3437,15 +3388,15 @@ const lt=e=>e??V
3437
3388
  input {
3438
3389
  flex: 1;
3439
3390
  width: 100%;
3440
- padding: 8px 32px 8px 12px;
3391
+ padding: 10px 32px 10px 12px;
3441
3392
  font-size: 14px;
3442
- border: 1px solid var(--kr-text-field-border-color, #d1d5db);
3443
- border-radius: 6px;
3444
- background: var(--kr-text-field-bg, #ffffff);
3445
- color: var(--kr-text-field-color, #000000);
3446
- transition: all 0.2s ease;
3447
- box-sizing: border-box;
3448
3393
  font-family: inherit;
3394
+ border: 1px solid var(--kr-text-field-border-color, #0000003d);
3395
+ border-radius: 8px;
3396
+ background-color: var(--kr-text-field-bg, #fff);
3397
+ color: var(--kr-text-field-color, #111827);
3398
+ transition: border-color 0.2s, box-shadow 0.2s;
3399
+ box-sizing: border-box;
3449
3400
  }
3450
3401
 
3451
3402
  input:focus {
@@ -3455,13 +3406,13 @@ const lt=e=>e??V
3455
3406
  }
3456
3407
 
3457
3408
  input:disabled {
3458
- background: var(--kr-text-field-disabled-bg, #f3f4f6);
3409
+ background-color: var(--kr-text-field-disabled-bg, #f3f4f6);
3410
+ color: var(--kr-text-field-disabled-color, #9ca3af);
3459
3411
  cursor: not-allowed;
3460
- opacity: 0.6;
3461
3412
  }
3462
3413
 
3463
3414
  input:read-only {
3464
- background: var(--kr-text-field-disabled-bg, #f3f4f6);
3415
+ background-color: var(--kr-text-field-disabled-bg, #f3f4f6);
3465
3416
  cursor: default;
3466
3417
  }
3467
3418
 
@@ -3470,14 +3421,14 @@ const lt=e=>e??V
3470
3421
  }
3471
3422
 
3472
3423
  input.input--invalid:focus {
3473
- box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
3424
+ box-shadow: 0 0 0 3px var(--kr-text-field-error-ring-color, rgba(239, 68, 68, 0.1));
3474
3425
  }
3475
3426
 
3476
3427
  input::placeholder {
3477
3428
  color: var(--kr-text-field-placeholder-color, #9ca3af);
3478
3429
  }
3479
3430
 
3480
- .icon-container {
3431
+ .icon-wrapper {
3481
3432
  position: absolute;
3482
3433
  right: 8px;
3483
3434
  display: flex;
@@ -3485,51 +3436,40 @@ const lt=e=>e??V
3485
3436
  gap: 4px;
3486
3437
  }
3487
3438
 
3488
- .clear-button {
3489
- display: flex;
3490
- align-items: center;
3491
- justify-content: center;
3439
+ .clear {
3492
3440
  width: 20px;
3493
3441
  height: 20px;
3494
- padding: 0;
3495
- background: none;
3496
- border: none;
3497
- border-radius: 50%;
3498
3442
  color: var(--kr-text-muted, #6b7280);
3499
3443
  cursor: pointer;
3500
- transition: all 0.15s ease;
3444
+ transition: color 0.15s ease;
3501
3445
  }
3502
3446
 
3503
- .clear-button:hover {
3504
- background-color: var(--kr-select-option-hover-bg, #f3f4f6);
3447
+ .clear:hover {
3505
3448
  color: var(--kr-text, #000000);
3506
3449
  }
3507
3450
 
3508
3451
  .search-icon {
3509
- width: 16px;
3510
- height: 16px;
3452
+ width: 20px;
3453
+ height: 20px;
3511
3454
  color: var(--kr-text-muted, #6b7280);
3512
3455
  pointer-events: none;
3513
3456
  }
3514
3457
 
3515
3458
  /* Dropdown */
3516
3459
  .dropdown {
3517
- position: absolute;
3518
- top: 100%;
3519
- left: 0;
3520
- right: 0;
3521
- z-index: 50;
3522
- margin-top: 4px;
3523
- max-height: 300px;
3460
+ position: fixed;
3461
+ z-index: 10000;
3524
3462
  overflow-y: auto;
3525
3463
  background: white;
3526
- border: 1px solid var(--kr-text-field-border-color, #d1d5db);
3527
- border-radius: 6px;
3528
- box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
3464
+ border: 1px solid #9ba7b6;
3465
+ border-radius: 8px;
3466
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
3467
+ padding: 8px 0;
3468
+ box-sizing: border-box;
3529
3469
  display: none;
3530
3470
  }
3531
3471
 
3532
- .dropdown.is-open {
3472
+ .dropdown--open {
3533
3473
  display: block;
3534
3474
  }
3535
3475
 
@@ -3554,114 +3494,304 @@ const lt=e=>e??V
3554
3494
  background: var(--kr-select-option-hover-bg, #f3f4f6);
3555
3495
  }
3556
3496
 
3557
- .option.is-highlighted {
3558
- background: var(--kr-select-option-highlight-bg, #e5e7eb);
3497
+ .option--highlighted {
3498
+ background-color: var(--kr-select-option-hover-bg, #f3f4f6);
3559
3499
  }
3560
3500
 
3561
3501
  .option:disabled {
3562
3502
  opacity: 0.5;
3563
3503
  cursor: not-allowed;
3564
3504
  }
3505
+
3506
+ .hint {
3507
+ font-size: 0.75rem;
3508
+ color: var(--kr-text-field-helper-color, #6b7280);
3509
+ }
3565
3510
 
3566
- .option-content {
3567
- flex: 1;
3568
- min-width: 0;
3511
+ .validation-message {
3512
+ font-size: 0.75rem;
3513
+ color: var(--kr-text-field-error-color, #ef4444);
3569
3514
  }
3515
+ `,e.KRAutoSuggest.formAssociated=!0,ft([ue({type:String})],e.KRAutoSuggest.prototype,"label",void 0),ft([ue({type:String})],e.KRAutoSuggest.prototype,"name",void 0),ft([ue({type:String})],e.KRAutoSuggest.prototype,"value",void 0),ft([ue({type:String})],e.KRAutoSuggest.prototype,"placeholder",void 0),ft([ue({type:Boolean})],e.KRAutoSuggest.prototype,"disabled",void 0),ft([ue({type:Boolean})],e.KRAutoSuggest.prototype,"readonly",void 0),ft([ue({type:Boolean})],e.KRAutoSuggest.prototype,"required",void 0),ft([ue({type:String})],e.KRAutoSuggest.prototype,"hint",void 0),ft([ue({type:Array})],e.KRAutoSuggest.prototype,"options",void 0),ft([ue({attribute:!1})],e.KRAutoSuggest.prototype,"fetch",void 0),ft([fe()],e.KRAutoSuggest.prototype,"_isOpen",void 0),ft([fe()],e.KRAutoSuggest.prototype,"_highlightedIndex",void 0),ft([fe()],e.KRAutoSuggest.prototype,"_touched",void 0),ft([ge("input")],e.KRAutoSuggest.prototype,"_input",void 0),e.KRAutoSuggest=ft([he("kr-auto-suggest")],e.KRAutoSuggest);var gt=function(e,t,i,s){var o,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(l=(r<3?o(l):r>3?o(t,i,l):o(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l};e.KRComboBox=class extends ae{constructor(){super(),this._requestId=0,this._selectedOption=null,this._handleDocumentClick=e=>{e.composedPath().includes(this)||this._close()},this.label="",this.name="",this.value="",this.placeholder="Select an option",this.disabled=!1,this.readonly=!1,this.required=!1,this.hint="",this.optionValue="value",this.optionLabel="label",this.options=[],this.fetch=null,this.fetchSelection=null,this._isOpen=!1,this._highlightedIndex=-1,this._touched=!1,this._searchQuery="",this._handleInvalid=e=>{e.preventDefault(),this._touched=!0},this._internals=this.attachInternals()}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleDocumentClick),this.addEventListener("invalid",this._handleInvalid)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleDocumentClick),this.removeEventListener("invalid",this._handleInvalid)}firstUpdated(){this._updateValidity(),this.value&&this.fetchSelection&&this._resolveSelection()}updated(e){(e.has("required")||e.has("value"))&&this._updateValidity(),e.has("value")&&(this.value?this._selectedOption&&this._getOptionValue(this._selectedOption)===this.value||this._resolveSelection():this._selectedOption=null),e.has("options")&&this._isOpen&&this._positionDropdown()}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}formResetCallback(){this.value="",this._selectedOption=null,this._touched=!1,this._isOpen=!1,this._highlightedIndex=-1,this._searchQuery="",this._internals.setFormValue(""),this._internals.setValidity({})}formStateRestoreCallback(e){this.value=e}focus(){this._triggerElement?.focus()}blur(){this._triggerElement?.blur()}_updateValidity(){this.required&&!this.value?this._internals.setValidity({valueMissing:!0},"Please select an option",this._triggerElement):this._internals.setValidity({})}_handleTriggerClick(){this.disabled||this.readonly||(this._isOpen?this._close():this._open())}_open(){this._isOpen=!0,this._searchQuery="",this._highlightedIndex=-1,this._fetch(),this.updateComplete.then((()=>{this._positionDropdown(),this._searchInput&&this._searchInput.focus()}))}_close(){this._isOpen=!1,this._highlightedIndex=-1,this._searchQuery=""}_positionDropdown(){requestAnimationFrame((()=>{const e=this.shadowRoot?.querySelector(".dropdown");if(!e)return;const t=this._triggerElement.getBoundingClientRect(),i=window.innerHeight-t.bottom-4-8,s=t.top-4-8;e.style.left=t.left+"px",e.style.width=t.width+"px",i<200&&s>i?(e.style.top="",e.style.bottom=window.innerHeight-t.top+4+"px",e.style.maxHeight=s+"px"):(e.style.bottom="",e.style.top=t.bottom+4+"px",e.style.maxHeight=i+"px")}))}_fetch(){if(!this.fetch)return;this._requestId++;const e=this._requestId;this.fetch(this._searchQuery).then((t=>{e===this._requestId&&(this.options=t)})).catch((e=>{console.error("kr-combo-box: fetch failed",e)}))}_handleSearchInput(e){this._searchQuery=e.target.value,this._highlightedIndex=-1,this._fetch()}_handleSearchKeyDown(e){switch(e.key){case"ArrowDown":e.preventDefault(),this._highlightedIndex=Math.min(this._highlightedIndex+1,this.options.length-1),this._scrollToHighlighted();break;case"ArrowUp":e.preventDefault(),-1===this._highlightedIndex?this._highlightedIndex=this.options.length-1:this._highlightedIndex=Math.max(this._highlightedIndex-1,0),this._scrollToHighlighted();break;case"Enter":e.preventDefault(),this._highlightedIndex>=0&&this.options[this._highlightedIndex]&&this._selectOption(this.options[this._highlightedIndex]);break;case"Escape":e.preventDefault(),this._close(),this._triggerElement?.focus();break;case"Tab":this._close()}}_handleTriggerKeyDown(e){"ArrowDown"!==e.key&&"ArrowUp"!==e.key&&"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this._isOpen||this._open())}_handleTriggerBlur(){this._touched=!0,this._updateValidity()}_scrollToHighlighted(){this.updateComplete.then((()=>{const e=this.shadowRoot?.querySelector(".options"),t=this.shadowRoot?.querySelector(".option--highlighted");if(e&&t){const i=e.getBoundingClientRect(),s=t.getBoundingClientRect();(s.bottom>i.bottom||s.top<i.top)&&t.scrollIntoView({block:"nearest"})}}))}_getOptionValue(e){return"function"==typeof this.optionValue?this.optionValue(e):e[this.optionValue]}_getOptionLabel(e){let t;return t="function"==typeof this.optionLabel?this.optionLabel(e):e[this.optionLabel],t||this._getOptionValue(e)}_resolveSelection(){if(!this.fetchSelection)return;const e=this.value;this.fetchSelection(this.value).then((t=>{this.value===e&&t&&(this._selectedOption=t,this.requestUpdate())})).catch((e=>{console.error("kr-combo-box: fetchSelection failed",e)}))}_selectOption(e){e.disabled||(this.value=this._getOptionValue(e),this._selectedOption=e,this._close(),this._internals.setFormValue(this.value),this._updateValidity(),this.dispatchEvent(new CustomEvent("select",{detail:{option:e},bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this._triggerElement?.focus())}_handleOptionMouseEnter(e,t){this._highlightedIndex=t}_renderOption(e,t){const i=this._getOptionValue(e);return B`
3516
+ <button
3517
+ class=${we({option:!0,"option--highlighted":t===this._highlightedIndex,"option--selected":i===this.value})}
3518
+ type="button"
3519
+ role="option"
3520
+ aria-selected=${i===this.value}
3521
+ ?disabled=${e.disabled}
3522
+ @click=${t=>this._selectOption(e)}
3523
+ @mouseenter=${e=>this._handleOptionMouseEnter(e,t)}
3524
+ >
3525
+ ${this._getOptionLabel(e)}
3526
+ </button>
3527
+ `}render(){let e=V;return this._touched&&this.required&&!this.value?e=B`<div class="validation-message">Please select an option</div>`:this.hint&&(e=B`<div class="hint">${this.hint}</div>`),B`
3528
+ <div class="wrapper">
3529
+ ${this.label?B`
3530
+ <label>
3531
+ ${this.label}
3532
+ ${this.required?B`<span class="required">*</span>`:V}
3533
+ </label>
3534
+ `:V}
3535
+
3536
+ <button
3537
+ class=${we({trigger:!0,"trigger--open":this._isOpen,"trigger--invalid":this._touched&&this.required&&!this.value})}
3538
+ type="button"
3539
+ ?disabled=${this.disabled}
3540
+ aria-haspopup="listbox"
3541
+ aria-expanded=${this._isOpen}
3542
+ @click=${this._handleTriggerClick}
3543
+ @keydown=${this._handleTriggerKeyDown}
3544
+ @blur=${this._handleTriggerBlur}
3545
+ >
3546
+ <span class=${we({trigger__value:!0,trigger__placeholder:!this._selectedOption})}>
3547
+ ${this._selectedOption?this._getOptionLabel(this._selectedOption):this.placeholder}
3548
+ </span>
3549
+ <svg
3550
+ class=${we({trigger__icon:!0,"trigger__icon--open":this._isOpen})}
3551
+ viewBox="0 0 24 24"
3552
+ fill="currentColor"
3553
+ >
3554
+ <path d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6z"/>
3555
+ </svg>
3556
+ </button>
3570
3557
 
3571
- .option-label {
3558
+ <div
3559
+ role="listbox"
3560
+ class=${we({dropdown:!0,"dropdown--open":this._isOpen})}
3561
+ >
3562
+ <div class="search">
3563
+ <div class="search__field">
3564
+ <input
3565
+ class="search__input"
3566
+ type="text"
3567
+ placeholder="Search..."
3568
+ .value=${this._searchQuery}
3569
+ @input=${this._handleSearchInput}
3570
+ @keydown=${this._handleSearchKeyDown}
3571
+ />
3572
+ <svg class="search__icon" viewBox="0 0 24 24" fill="currentColor">
3573
+ <path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/>
3574
+ </svg>
3575
+ </div>
3576
+ </div>
3577
+
3578
+ <div class="options">
3579
+ ${0===this.options.length?B`<div class="empty">No options found</div>`:this.options.map(((e,t)=>this._renderOption(e,t)))}
3580
+ </div>
3581
+ </div>
3582
+
3583
+ ${e}
3584
+ </div>
3585
+ `}},e.KRComboBox.styles=l`
3586
+ :host {
3587
+ display: block;
3588
+ font-family: inherit;
3589
+ }
3590
+
3591
+ .wrapper {
3572
3592
  display: flex;
3573
- align-items: center;
3593
+ flex-direction: column;
3574
3594
  gap: 6px;
3575
- flex-wrap: wrap;
3576
3595
  }
3577
3596
 
3578
- .option-tag {
3597
+ label {
3598
+ font-size: 14px;
3599
+ font-weight: 500;
3600
+ color: black;
3601
+ }
3602
+
3603
+ .required {
3604
+ color: var(--kr-text-field-required-color, #ef4444);
3605
+ margin-left: 0.125rem;
3606
+ }
3607
+
3608
+ /* Trigger button */
3609
+ .trigger {
3610
+ display: flex;
3611
+ align-items: center;
3612
+ justify-content: space-between;
3613
+ width: 100%;
3614
+ padding: 10px 12px;
3615
+ font-family: inherit;
3616
+ font-size: 14px;
3617
+ line-height: 1.5;
3618
+ color: var(--kr-text-field-color, #111827);
3619
+ background-color: var(--kr-text-field-bg, #fff);
3620
+ border: 1px solid var(--kr-text-field-border-color, #0000003d);
3621
+ border-radius: 8px;
3622
+ cursor: pointer;
3623
+ transition: border-color 0.2s, box-shadow 0.2s;
3624
+ text-align: left;
3625
+ }
3626
+
3627
+ .trigger:hover:not(:disabled) {
3628
+ border-color: #9ca3af;
3629
+ }
3630
+
3631
+ .trigger:focus {
3632
+ outline: none;
3633
+ border-color: var(--kr-text-field-focus-border-color, #163052);
3634
+ box-shadow: 0 0 0 3px var(--kr-text-field-focus-ring-color, rgba(22, 48, 82, 0.1));
3635
+ }
3636
+
3637
+ .trigger:disabled {
3638
+ background-color: var(--kr-text-field-disabled-bg, #f3f4f6);
3639
+ color: var(--kr-text-field-disabled-color, #9ca3af);
3640
+ cursor: not-allowed;
3641
+ }
3642
+
3643
+ .trigger--open {
3644
+ border-color: var(--kr-text-field-focus-border-color, #163052);
3645
+ box-shadow: 0 0 0 3px var(--kr-text-field-focus-ring-color, rgba(22, 48, 82, 0.1));
3646
+ }
3647
+
3648
+ .trigger--invalid {
3649
+ border-color: var(--kr-text-field-error-border-color, #ef4444);
3650
+ }
3651
+
3652
+ .trigger--invalid:focus {
3653
+ box-shadow: 0 0 0 3px var(--kr-text-field-error-ring-color, rgba(239, 68, 68, 0.1));
3654
+ }
3655
+
3656
+ .trigger__value {
3657
+ flex: 1;
3658
+ overflow: hidden;
3659
+ text-overflow: ellipsis;
3660
+ white-space: nowrap;
3661
+ }
3662
+
3663
+ .trigger__placeholder {
3664
+ color: var(--kr-text-field-placeholder-color, #9ca3af);
3665
+ }
3666
+
3667
+ .trigger__icon {
3579
3668
  flex-shrink: 0;
3580
- padding: 2px 6px;
3581
- font-size: 11px;
3669
+ margin-left: 0.5rem;
3670
+ width: 20px;
3671
+ height: 20px;
3582
3672
  color: var(--kr-text-muted, #6b7280);
3583
- background: var(--kr-select-option-hover-bg, #f3f4f6);
3584
- border-radius: 3px;
3673
+ transition: transform 0.2s;
3585
3674
  }
3586
3675
 
3587
- .option-description {
3588
- font-size: 12px;
3589
- color: var(--kr-text-muted, #6b7280);
3590
- margin-top: 2px;
3676
+ .trigger__icon--open {
3677
+ transform: rotate(180deg);
3591
3678
  }
3592
3679
 
3593
- .option-tags {
3680
+ /* Dropdown */
3681
+ .dropdown {
3682
+ position: fixed;
3683
+ z-index: 10000;
3684
+ background: white;
3685
+ border: 1px solid #9ba7b6;
3686
+ border-radius: 8px;
3687
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
3688
+ box-sizing: border-box;
3689
+ display: none;
3690
+ overflow: hidden;
3691
+ }
3692
+
3693
+ .dropdown--open {
3594
3694
  display: flex;
3595
- flex-wrap: wrap;
3596
- gap: 4px;
3597
- margin-top: 4px;
3695
+ flex-direction: column;
3598
3696
  }
3599
3697
 
3600
- /* Highlight */
3601
- .highlight {
3602
- font-weight: 600;
3603
- background-color: #fef3c7;
3604
- color: #92400e;
3698
+ /* Search input inside dropdown */
3699
+ .search {
3700
+ padding: 12px 12px 2px 12px;
3701
+ flex-shrink: 0;
3605
3702
  }
3606
3703
 
3607
- /* Group */
3608
- .group-label {
3704
+ .search__field {
3705
+ display: flex;
3706
+ align-items: center;
3609
3707
  padding: 8px 12px;
3610
- font-size: 11px;
3611
- font-weight: 600;
3708
+ border: 1px solid var(--kr-text-field-border-color, #0000003d);
3709
+ border-radius: 8px;
3710
+ background-color: var(--kr-text-field-bg, #fff);
3711
+ transition: border-color 0.2s, box-shadow 0.2s;
3712
+ }
3713
+
3714
+ .search__field:focus-within {
3715
+ border-color: var(--kr-text-field-focus-border-color, #163052);
3716
+ box-shadow: 0 0 0 3px var(--kr-text-field-focus-ring-color, rgba(22, 48, 82, 0.1));
3717
+ }
3718
+
3719
+ .search__icon {
3720
+ width: 20px;
3721
+ height: 20px;
3612
3722
  color: var(--kr-text-muted, #6b7280);
3613
- text-transform: uppercase;
3614
- letter-spacing: 0.05em;
3615
- background: var(--kr-select-option-hover-bg, #f9fafb);
3616
- border-bottom: 1px solid var(--kr-text-field-border-color, #e5e7eb);
3723
+ flex-shrink: 0;
3724
+ margin-left: 8px;
3617
3725
  }
3618
3726
 
3619
- /* Status */
3620
- .status {
3727
+ .search__input {
3728
+ flex: 1;
3729
+ border: none;
3730
+ outline: none;
3731
+ font-size: 14px;
3732
+ font-family: inherit;
3733
+ color: var(--kr-text-field-color, #111827);
3734
+ background: transparent;
3735
+ padding: 0;
3736
+ }
3737
+
3738
+ .search__input::placeholder {
3739
+ color: var(--kr-text-field-placeholder-color, #9ca3af);
3740
+ }
3741
+
3742
+ /* Options list */
3743
+ .options {
3744
+ overflow-y: auto;
3745
+ padding: 4px 0;
3746
+ }
3747
+
3748
+ .option {
3621
3749
  display: flex;
3622
3750
  align-items: center;
3623
- justify-content: center;
3624
- gap: 8px;
3625
- padding: 16px;
3751
+ width: 100%;
3752
+ padding: 12px 18px;
3753
+ background: none;
3754
+ border: none;
3626
3755
  font-size: 14px;
3627
- color: var(--kr-text-muted, #6b7280);
3756
+ font-family: inherit;
3757
+ color: var(--kr-text, #000000);
3758
+ text-align: left;
3759
+ cursor: pointer;
3760
+ transition: background 0.15s ease;
3628
3761
  }
3629
3762
 
3630
- .status.is-error {
3631
- color: var(--kr-text-field-error-border-color, #ef4444);
3763
+ .option:hover:not(:disabled) {
3764
+ background: var(--kr-select-option-hover-bg, #f3f4f6);
3632
3765
  }
3633
3766
 
3634
- .spinner {
3635
- width: 16px;
3636
- height: 16px;
3637
- border: 2px solid var(--kr-text-field-border-color, #e5e7eb);
3638
- border-top-color: var(--kr-text-field-focus-border-color, #163052);
3639
- border-radius: 50%;
3640
- animation: spin 0.6s linear infinite;
3767
+ .option--highlighted {
3768
+ background-color: var(--kr-select-option-hover-bg, #f3f4f6);
3641
3769
  }
3642
3770
 
3643
- @keyframes spin {
3644
- to {
3645
- transform: rotate(360deg);
3646
- }
3771
+ .option--selected {
3772
+ color: var(--kr-text-field-focus-border-color, #163052);
3773
+ }
3774
+
3775
+ .option:disabled {
3776
+ opacity: 0.5;
3777
+ cursor: not-allowed;
3647
3778
  }
3648
3779
 
3649
3780
  .empty {
3650
- padding: 16px;
3651
- text-align: center;
3652
- font-size: 14px;
3781
+ padding: 12px 18px;
3782
+ text-align: left;
3653
3783
  color: var(--kr-text-muted, #6b7280);
3784
+ font-size: 14px;
3654
3785
  }
3655
3786
 
3656
3787
  .hint {
3657
- font-size: 12px;
3658
- color: var(--kr-text-field-hint-color, #6b7280);
3788
+ font-size: 0.75rem;
3789
+ color: var(--kr-text-field-helper-color, #6b7280);
3659
3790
  }
3660
3791
 
3661
3792
  .validation-message {
3662
- font-size: 12px;
3663
- color: var(--kr-text-field-error-border-color, #ef4444);
3664
- margin-top: 2px;
3793
+ font-size: 0.75rem;
3794
+ color: var(--kr-text-field-error-color, #ef4444);
3665
3795
  }
3666
- `,e.KRAutoSuggest.formAssociated=!0,ft([ue({type:String})],e.KRAutoSuggest.prototype,"label",void 0),ft([ue({type:String})],e.KRAutoSuggest.prototype,"name",void 0),ft([ue({type:String})],e.KRAutoSuggest.prototype,"value",void 0),ft([ue({type:String})],e.KRAutoSuggest.prototype,"placeholder",void 0),ft([ue({type:Boolean})],e.KRAutoSuggest.prototype,"disabled",void 0),ft([ue({type:Boolean})],e.KRAutoSuggest.prototype,"readonly",void 0),ft([ue({type:Boolean})],e.KRAutoSuggest.prototype,"required",void 0),ft([ue({type:String})],e.KRAutoSuggest.prototype,"hint",void 0),ft([ue({type:Array})],e.KRAutoSuggest.prototype,"options",void 0),ft([ue({type:String,attribute:"status-type"})],e.KRAutoSuggest.prototype,"statusType",void 0),ft([ue({type:String,attribute:"loading-text"})],e.KRAutoSuggest.prototype,"loadingText",void 0),ft([ue({type:String,attribute:"error-text"})],e.KRAutoSuggest.prototype,"errorText",void 0),ft([ue({type:String,attribute:"empty-text"})],e.KRAutoSuggest.prototype,"emptyText",void 0),ft([ue({type:String,attribute:"filtering-type"})],e.KRAutoSuggest.prototype,"filteringType",void 0),ft([ue({type:Boolean,attribute:"highlight-matches"})],e.KRAutoSuggest.prototype,"highlightMatches",void 0),ft([fe()],e.KRAutoSuggest.prototype,"_isOpen",void 0),ft([fe()],e.KRAutoSuggest.prototype,"_highlightedIndex",void 0),ft([fe()],e.KRAutoSuggest.prototype,"_touched",void 0),ft([fe()],e.KRAutoSuggest.prototype,"_dirty",void 0),ft([ge("input")],e.KRAutoSuggest.prototype,"_input",void 0),e.KRAutoSuggest=ft([ce("kr-auto-suggest")],e.KRAutoSuggest),e.KRDialogRef=Me,e.KRQuery=Je,e.KR_OPERATORS=Ve,e.getOperatorsForType=Ue,e.krBaseCSS=de})),function(e){Object.keys(e).forEach((function(t){t.startsWith("KR")&&"function"==typeof e[t]&&(e[t.slice(2)]=e[t])}))}(kr);
3796
+ `,e.KRComboBox.formAssociated=!0,gt([ue({type:String})],e.KRComboBox.prototype,"label",void 0),gt([ue({type:String})],e.KRComboBox.prototype,"name",void 0),gt([ue({type:String})],e.KRComboBox.prototype,"value",void 0),gt([ue({type:String})],e.KRComboBox.prototype,"placeholder",void 0),gt([ue({type:Boolean})],e.KRComboBox.prototype,"disabled",void 0),gt([ue({type:Boolean})],e.KRComboBox.prototype,"readonly",void 0),gt([ue({type:Boolean})],e.KRComboBox.prototype,"required",void 0),gt([ue({type:String})],e.KRComboBox.prototype,"hint",void 0),gt([ue({attribute:"option-value"})],e.KRComboBox.prototype,"optionValue",void 0),gt([ue({attribute:"option-label"})],e.KRComboBox.prototype,"optionLabel",void 0),gt([ue({type:Array})],e.KRComboBox.prototype,"options",void 0),gt([ue({attribute:!1})],e.KRComboBox.prototype,"fetch",void 0),gt([ue({attribute:!1})],e.KRComboBox.prototype,"fetchSelection",void 0),gt([fe()],e.KRComboBox.prototype,"_isOpen",void 0),gt([fe()],e.KRComboBox.prototype,"_highlightedIndex",void 0),gt([fe()],e.KRComboBox.prototype,"_touched",void 0),gt([fe()],e.KRComboBox.prototype,"_searchQuery",void 0),gt([ge(".trigger")],e.KRComboBox.prototype,"_triggerElement",void 0),gt([ge(".search__input")],e.KRComboBox.prototype,"_searchInput",void 0),e.KRComboBox=gt([he("kr-combo-box")],e.KRComboBox),e.KRDialogRef=Le,e.KRQuery=Je,e.KR_OPERATORS=Ve,e.getOperatorsForType=Ue,e.krBaseCSS=de})),function(e){Object.keys(e).forEach((function(t){t.startsWith("KR")&&"function"==typeof e[t]&&(e[t.slice(2)]=e[t])}))}(kr);
3667
3797
  //# sourceMappingURL=krubble-components.umd.min.js.map