@kodaris/krubble-components 1.0.60 → 1.0.61

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 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
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
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: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");
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(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: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,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,B=/"/g,H=/^(?:script|style|textarea|title)$/i,F=(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]?(H.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]?B:M):l===B||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(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(),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
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}>`,O=document,z=()=>O.createComment(""),D=e=>null===e||"object"!=typeof e&&"function"!=typeof e,K=Array.isArray,A="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,I=/-->/g,L=/>/g,q=RegExp(`>|${A}(?:([^\\s"'>=/]+)(${A}*=${A}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),M=/'/g,B=/"/g,H=/^(?:script|style|textarea|title)$/i,F=(e=>(t,...i)=>({_$litType$:e,strings:t,values:i}))(1),j=Symbol.for("lit-noChange"),V=Symbol.for("lit-nothing"),U=new WeakMap,N=O.createTreeWalker(O,129);function W(e,t){if(!K(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>":"",a=P;for(let t=0;t<i;t++){const i=e[t];let l,n,d=-1,h=0;for(;h<i.length&&(a.lastIndex=h,n=a.exec(i),null!==n);)h=a.lastIndex,a===P?"!--"===n[1]?a=I:void 0!==n[1]?a=L:void 0!==n[2]?(H.test(n[2])&&(o=RegExp("</"+n[2],"g")),a=q):void 0!==n[3]&&(a=q):a===q?">"===n[0]?(a=o??P,d=-1):void 0===n[1]?d=-2:(d=a.lastIndex-n[2].length,l=n[1],a=void 0===n[3]?q:'"'===n[3]?B:M):a===B||a===M?a=q:a===I||a===L?a=P:(a=q,o=void 0);const c=a===q&&e[t+1].startsWith("/>")?" ":"";r+=a===P?i+E:d>=0?(s.push(l),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 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(S)){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],z()),N.nextNode(),l.push({type:2,index:++o});s.append(e[t],z())}}}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=O.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=D(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??O).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 G(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=O,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),D(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=>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&&D(this._$AH)?this._$AA.nextSibling.data=e:this.T(O.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){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 G(this.O(z()),this.O(z()),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=!D(e)||e!==this._$AH&&e!==j,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===j&&(l=this._$AH[a]),r||=!D(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)===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(z(),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
- */},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`
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 j}};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`
23
23
  :host,
24
24
  *,
25
25
  *::before,
@@ -72,7 +72,7 @@ const w=globalThis,$=w.trustedTypes,C=$?$.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,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 F`
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 F`
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=l`
89
+ `}},e.KRAccordion.styles=a`
90
90
  :host {
91
91
  display: block;
92
92
  margin-bottom: 16px;
@@ -149,7 +149,7 @@ const ve=1,_e=2,me=3,ye=4,xe=e=>(...t)=>({_$litDirective$:e,values:t});let ke=cl
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 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:F`<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:F`<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:F`<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:F`<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 F`
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,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:F`<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:F`<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:F`<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:F`<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 F`
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"
@@ -174,7 +174,7 @@ const ve=1,_e=2,me=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=l`
177
+ `}},e.KRAlert.styles=a`
178
178
  :host {
179
179
  display: block;
180
180
  }
@@ -290,7 +290,7 @@ const ve=1,_e=2,me=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([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=F`
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,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=F`
294
294
  <span class="content">
295
295
  <slot name="icon"></slot>
296
296
  <slot></slot>
@@ -309,7 +309,7 @@ const ve=1,_e=2,me=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?F`<a class="link" href=${this.href} target=${this.target||V}>${e}</a>`:e}},e.KRButton.styles=l`
312
+ `;return this.href?F`<a class="link" href=${this.href} target=${this.target||V}>${e}</a>`:e}},e.KRButton.styles=a`
313
313
  :host {
314
314
  display: inline-flex;
315
315
  position: relative;
@@ -585,7 +585,7 @@ const ve=1,_e=2,me=3,ye=4,xe=e=>(...t)=>({_$litDirective$:e,values:t});let ke=cl
585
585
  * Copyright 2017 Google LLC
586
586
  * SPDX-License-Identifier: BSD-3-Clause
587
587
  */
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 F`
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,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 F`
589
589
  <div class="tabs">
590
590
  <button
591
591
  class=${we({tab:!0,"tab--active":"preview"===this.activeTab})}
@@ -616,12 +616,12 @@ class Se extends ke{constructor(e){if(super(e),this.it=V,e.type!==_e)throw Error
616
616
  <pre class="code"><code>${Re(this.highlightedCode)}</code></pre>
617
617
  </div>
618
618
 
619
- `}},e.KRCodeDemo.styles=[de,l`
619
+ `}},e.KRCodeDemo.styles=[de,a`
620
620
  :host {
621
621
  display: block;
622
622
  border: 1px solid #d5dbdb;
623
623
  border-radius: 8px;
624
- overflow: hidden;
624
+ overflow: visible;
625
625
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
626
626
  }
627
627
 
@@ -738,7 +738,7 @@ class Se extends ke{constructor(e){if(super(e),this.it=V,e.type!==_e)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([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 F`
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,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 F`
742
742
  <div class="menu">
743
743
  ${this.items.map((e=>e.divider?F`<div class="menu__divider"></div>`:F`
744
744
  <button
@@ -751,7 +751,7 @@ class Se extends ke{constructor(e){if(super(e),this.it=V,e.type!==_e)throw Error
751
751
  </button>
752
752
  `))}
753
753
  </div>
754
- `}},e.KRContextMenu.styles=l`
754
+ `}},e.KRContextMenu.styles=a`
755
755
  :host {
756
756
  position: fixed;
757
757
  z-index: 10000;
@@ -812,7 +812,7 @@ class Se extends ke{constructor(e){if(super(e),this.it=V,e.type!==_e)throw Error
812
812
  * Copyright 2018 Google LLC
813
813
  * SPDX-License-Identifier: BSD-3-Clause
814
814
  */
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 F`<slot></slot>`}};Pe.styles=l`
815
+ const Oe="important",ze=" !"+Oe,De=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(ze);e.includes("-")||t?i.setProperty(e,t?s.slice(0,-11):s,t?Oe:""):i[e]=s}}return j}});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 Ae=class extends le{render(){return F`<slot></slot>`}};Ae.styles=a`
816
816
  :host {
817
817
  display: flex;
818
818
  padding: 0 24px;
@@ -827,14 +827,14 @@ const ze="important",Oe=" !"+ze,Ke=xe(class extends ke{constructor(e){if(super(e
827
827
  font-size: 18px;
828
828
  font-weight: 600;
829
829
  }
830
- `,Pe=Ae([he("kr-dialog-header")],Pe);let De=class extends ae{render(){return F`<slot></slot>`}};De.styles=l`
830
+ `,Ae=Ke([he("kr-dialog-header")],Ae);let Pe=class extends le{render(){return F`<slot></slot>`}};Pe.styles=a`
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=Ae([he("kr-dialog-content")],De);let Ie=class extends ae{render(){return F`<slot></slot>`}};Ie.styles=l`
837
+ `,Pe=Ke([he("kr-dialog-content")],Pe);let Ie=class extends le{render(){return F`<slot></slot>`}};Ie.styles=a`
838
838
  :host {
839
839
  display: flex;
840
840
  padding: 0 24px;
@@ -845,13 +845,13 @@ const ze="important",Oe=" !"+ze,Ke=xe(class extends ke{constructor(e){if(super(e
845
845
  gap: 12px;
846
846
  justify-content: flex-end;
847
847
  }
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 F`
848
+ `,Ie=Ke([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 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 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 F`
849
849
  <div class="backdrop" @click=${this._handleBackdropClick}></div>
850
- <div class="dialog" style=${Ke({width:this.width})}>
850
+ <div class="dialog" style=${De({width:this.width})}>
851
851
  ${this.label?F`<div class="dialog__header"><div class="dialog__header-label">${this.label}</div></div>`:""}
852
852
  ${this._contentElement?this._contentElement:F`<slot></slot>`}
853
853
  </div>
854
- `}},e.KRDialog.styles=l`
854
+ `}},e.KRDialog.styles=a`
855
855
  :host {
856
856
  position: fixed;
857
857
  inset: 0;
@@ -909,7 +909,301 @@ const ze="important",Oe=" !"+ze,Ke=xe(class extends ke{constructor(e){if(super(e
909
909
  font-size: 18px;
910
910
  font-weight: 600;
911
911
  }
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:F`<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:F`<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:F`<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:F`<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 F`
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([he("kr-dialog")],e.KRDialog);var 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.KRDateRangePicker=class extends le{constructor(){super(...arguments),this.relativeOptions=[{key:"last-5-minutes",amount:5,unit:"minute",type:"relative"},{key:"last-30-minutes",amount:30,unit:"minute",type:"relative"},{key:"last-1-hour",amount:1,unit:"hour",type:"relative"},{key:"last-6-hours",amount:6,unit:"hour",type:"relative"},{key:"last-1-day",amount:1,unit:"day",type:"relative"},{key:"last-7-days",amount:7,unit:"day",type:"relative"},{key:"last-30-days",amount:30,unit:"day",type:"relative"}],this.disabled=!1,this.invalid=!1,this.placeholder="Select a date range",this.startDate="",this.endDate="",this._isOpen=!1,this._activeTab="relative",this._tempStartDate="",this._tempEndDate="",this._handleClickOutside=e=>{e.composedPath().includes(this)||(this._isOpen=!1)}}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleClickOutside),this.startDate&&(this._tempStartDate=this.startDate),this.endDate&&(this._tempEndDate=this.endDate),"relative"===this.mode?this._activeTab="relative":"absolute"===this.mode&&(this._activeTab="absolute")}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleClickOutside)}_handleTriggerClick(){this.disabled||(this._isOpen=!this._isOpen)}_handleTabClick(e){this._activeTab=e}_handleRelativeSelect(e){this.value={type:"relative",amount:e.amount,unit:e.unit},this._isOpen=!1,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}))}_handleApplyAbsolute(){this._tempStartDate&&this._tempEndDate&&(this._tempStartDate>=this._tempEndDate||(this.value={type:"absolute",startDate:this._tempStartDate,endDate:this._tempEndDate},this.startDate=this._tempStartDate,this.endDate=this._tempEndDate,this._isOpen=!1,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}))))}_handleCancel(){this._isOpen=!1,this._tempStartDate=this.startDate,this._tempEndDate=this.endDate}_formatRelativeOption(e){if(0===e.amount)return"day"===e.unit?"Today":`This ${e.unit}`;const t={second:1===e.amount?"second":"seconds",minute:1===e.amount?"minute":"minutes",hour:1===e.amount?"hour":"hours",day:1===e.amount?"day":"days",week:1===e.amount?"week":"weeks",month:1===e.amount?"month":"months",year:1===e.amount?"year":"years"};return`Last ${e.amount} ${t[e.unit]}`}_getDisplayValue(){return this.value?"relative"===this.value.type&&void 0!==this.value.amount&&this.value.unit?this._formatRelativeOption({key:"",amount:this.value.amount,unit:this.value.unit,type:"relative"}):"absolute"===this.value.type&&this.value.startDate&&this.value.endDate?`${this.value.startDate} - ${this.value.endDate}`:"":""}_renderTriggerText(){const e=this._getDisplayValue();return e?F`${e}`:F`<span class="trigger-placeholder">${this.placeholder}</span>`}_renderContent(){return"relative"===this.mode?this._renderRelativeContent():"absolute"===this.mode?this._renderAbsoluteContent():"relative"===this._activeTab?this._renderRelativeContent():this._renderAbsoluteContent()}_renderRelativeContent(){return F`
913
+ <div class="relative-options">
914
+ ${this.relativeOptions.map((e=>F`
915
+ <button
916
+ class=${we({"relative-option":!0,"relative-option--selected":"relative"===this.value?.type&&this.value?.amount===e.amount&&this.value?.unit===e.unit})}
917
+ type="button"
918
+ @click=${()=>this._handleRelativeSelect(e)}
919
+ >
920
+ ${this._formatRelativeOption(e)}
921
+ </button>
922
+ `))}
923
+ </div>
924
+ `}_renderAbsoluteContent(){return F`
925
+ <div class="absolute">
926
+ <div class="date-row">
927
+ <span class="date-label">Start</span>
928
+ <input
929
+ class="date-input"
930
+ type="date"
931
+ .value=${this._tempStartDate}
932
+ @change=${this._handleStartDateChange}
933
+ />
934
+ </div>
935
+ <div class="date-row">
936
+ <span class="date-label">End</span>
937
+ <input
938
+ class="date-input"
939
+ type="date"
940
+ .value=${this._tempEndDate}
941
+ @change=${this._handleEndDateChange}
942
+ />
943
+ </div>
944
+ </div>
945
+ `}_renderFooter(){return"absolute"===this.mode?F`
946
+ <div class="footer">
947
+ <kr-button variant="outline" size="small" @click=${this._handleCancel}>
948
+ Cancel
949
+ </kr-button>
950
+ <kr-button
951
+ variant="primary"
952
+ size="small"
953
+ ?disabled=${!this._tempStartDate||!this._tempEndDate}
954
+ @click=${this._handleApplyAbsolute}
955
+ >
956
+ Apply
957
+ </kr-button>
958
+ </div>
959
+ `:"relative"===this.mode?V:"absolute"===this._activeTab?F`
960
+ <div class="footer">
961
+ <kr-button variant="outline" size="small" @click=${this._handleCancel}>
962
+ Cancel
963
+ </kr-button>
964
+ <kr-button
965
+ variant="primary"
966
+ size="small"
967
+ ?disabled=${!this._tempStartDate||!this._tempEndDate}
968
+ @click=${this._handleApplyAbsolute}
969
+ >
970
+ Apply
971
+ </kr-button>
972
+ </div>
973
+ `:V}_handleStartDateChange(e){this._tempStartDate=e.target.value}_handleEndDateChange(e){this._tempEndDate=e.target.value}render(){return F`
974
+ <button
975
+ part="trigger"
976
+ class=${we({trigger:!0,"trigger--invalid":this.invalid})}
977
+ type="button"
978
+ ?disabled=${this.disabled}
979
+ @click=${this._handleTriggerClick}
980
+ >
981
+ <svg class="icon" fill="none" viewBox="0 0 24 24" stroke="currentColor">
982
+ <path
983
+ stroke-linecap="round"
984
+ stroke-linejoin="round"
985
+ stroke-width="2"
986
+ d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"
987
+ />
988
+ </svg>
989
+ <span class="trigger-text">
990
+ ${this._renderTriggerText()}
991
+ </span>
992
+ <svg class="icon" fill="none" viewBox="0 0 24 24" stroke="currentColor">
993
+ <path
994
+ stroke-linecap="round"
995
+ stroke-linejoin="round"
996
+ stroke-width="2"
997
+ d="M19 9l-7 7-7-7"
998
+ />
999
+ </svg>
1000
+ </button>
1001
+
1002
+ <div part="dropdown" class=${we({dropdown:!0,"dropdown--open":this._isOpen})}>
1003
+ ${this.mode?V:F`
1004
+ <div class="tabs">
1005
+ <button
1006
+ class=${we({tab:!0,"tab--active":"relative"===this._activeTab})}
1007
+ type="button"
1008
+ @click=${()=>this._handleTabClick("relative")}
1009
+ >
1010
+ Relative
1011
+ </button>
1012
+ <button
1013
+ class=${we({tab:!0,"tab--active":"absolute"===this._activeTab})}
1014
+ type="button"
1015
+ @click=${()=>this._handleTabClick("absolute")}
1016
+ >
1017
+ Absolute
1018
+ </button>
1019
+ </div>
1020
+ `}
1021
+
1022
+ <div class="content">
1023
+ ${this._renderContent()}
1024
+ </div>
1025
+
1026
+ ${this._renderFooter()}
1027
+ </div>
1028
+ `}},e.KRDateRangePicker.styles=a`
1029
+ :host {
1030
+ display: inline-block;
1031
+ position: relative;
1032
+ font-family: inherit;
1033
+ }
1034
+
1035
+ .trigger {
1036
+ display: inline-flex;
1037
+ align-items: center;
1038
+ gap: 0.5rem;
1039
+ min-width: 250px;
1040
+ padding: 0.5rem 0.75rem;
1041
+ font-size: 14px;
1042
+ font-family: inherit;
1043
+ color: #111827;
1044
+ background-color: #fff;
1045
+ border: 1px solid #d1d5db;
1046
+ border-radius: 4px;
1047
+ cursor: pointer;
1048
+ transition: border-color 0.2s, box-shadow 0.2s;
1049
+ text-align: left;
1050
+ }
1051
+
1052
+ .trigger:hover:not(:disabled) {
1053
+ border-color: #9ca3af;
1054
+ }
1055
+
1056
+ .trigger:focus {
1057
+ outline: none;
1058
+ border-color: #2563eb;
1059
+ box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
1060
+ }
1061
+
1062
+ .trigger:disabled {
1063
+ background-color: #f3f4f6;
1064
+ color: #9ca3af;
1065
+ cursor: not-allowed;
1066
+ }
1067
+
1068
+ .trigger--invalid {
1069
+ border-color: #ef4444;
1070
+ }
1071
+
1072
+ .trigger-text {
1073
+ flex: 1;
1074
+ }
1075
+
1076
+ .trigger-placeholder {
1077
+ color: #9ca3af;
1078
+ }
1079
+
1080
+ .icon {
1081
+ width: 16px;
1082
+ height: 16px;
1083
+ color: #6b7280;
1084
+ flex-shrink: 0;
1085
+ }
1086
+
1087
+ .dropdown {
1088
+ position: absolute;
1089
+ top: calc(100% + 4px);
1090
+ left: 0;
1091
+ z-index: 1000;
1092
+ min-width: 320px;
1093
+ background-color: #fff;
1094
+ border: 1px solid #d1d5db;
1095
+ border-radius: 8px;
1096
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
1097
+ display: none;
1098
+ }
1099
+
1100
+ .dropdown--open {
1101
+ display: block;
1102
+ }
1103
+
1104
+ .tabs {
1105
+ display: flex;
1106
+ border-bottom: 1px solid #e5e7eb;
1107
+ }
1108
+
1109
+ .tab {
1110
+ flex: 1;
1111
+ padding: 0.75rem;
1112
+ font-size: 14px;
1113
+ font-weight: 500;
1114
+ font-family: inherit;
1115
+ color: #6b7280;
1116
+ background: none;
1117
+ border: none;
1118
+ border-bottom: 2px solid transparent;
1119
+ cursor: pointer;
1120
+ transition: color 0.2s;
1121
+ }
1122
+
1123
+ .tab:hover {
1124
+ color: #111827;
1125
+ }
1126
+
1127
+ .tab--active {
1128
+ color: #2563eb;
1129
+ border-bottom-color: #2563eb;
1130
+ }
1131
+
1132
+ .content {
1133
+ padding: 1rem;
1134
+ }
1135
+
1136
+ .relative-options {
1137
+ display: flex;
1138
+ flex-direction: column;
1139
+ gap: 0.25rem;
1140
+ }
1141
+
1142
+ .relative-option {
1143
+ display: flex;
1144
+ align-items: center;
1145
+ padding: 0.5rem 0.75rem;
1146
+ font-size: 14px;
1147
+ font-family: inherit;
1148
+ color: #111827;
1149
+ background: none;
1150
+ border: none;
1151
+ border-radius: 4px;
1152
+ cursor: pointer;
1153
+ text-align: left;
1154
+ transition: background-color 0.2s;
1155
+ }
1156
+
1157
+ .relative-option:hover {
1158
+ background-color: #f3f4f6;
1159
+ }
1160
+
1161
+ .relative-option--selected {
1162
+ background-color: #eff6ff;
1163
+ color: #1e40af;
1164
+ }
1165
+
1166
+ .absolute {
1167
+ display: flex;
1168
+ flex-direction: column;
1169
+ gap: 1rem;
1170
+ }
1171
+
1172
+ .date-row {
1173
+ display: flex;
1174
+ align-items: center;
1175
+ gap: 0.75rem;
1176
+ }
1177
+
1178
+ .date-label {
1179
+ width: 60px;
1180
+ font-size: 14px;
1181
+ color: #6b7280;
1182
+ }
1183
+
1184
+ .date-input {
1185
+ flex: 1;
1186
+ padding: 0.5rem 0.75rem;
1187
+ font-size: 14px;
1188
+ font-family: inherit;
1189
+ border: 1px solid #d1d5db;
1190
+ border-radius: 4px;
1191
+ }
1192
+
1193
+ .date-input:focus {
1194
+ outline: none;
1195
+ border-color: #2563eb;
1196
+ box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
1197
+ }
1198
+
1199
+ .footer {
1200
+ display: flex;
1201
+ justify-content: flex-end;
1202
+ gap: 0.5rem;
1203
+ padding: 0.75rem 1rem;
1204
+ border-top: 1px solid #e5e7eb;
1205
+ }
1206
+ `,qe([ue({type:Object})],e.KRDateRangePicker.prototype,"value",void 0),qe([ue({type:Array})],e.KRDateRangePicker.prototype,"relativeOptions",void 0),qe([ue({type:Boolean})],e.KRDateRangePicker.prototype,"disabled",void 0),qe([ue({type:Boolean})],e.KRDateRangePicker.prototype,"invalid",void 0),qe([ue({type:String})],e.KRDateRangePicker.prototype,"placeholder",void 0),qe([ue({type:String})],e.KRDateRangePicker.prototype,"startDate",void 0),qe([ue({type:String})],e.KRDateRangePicker.prototype,"endDate",void 0),qe([ue({type:String})],e.KRDateRangePicker.prototype,"mode",void 0),qe([fe()],e.KRDateRangePicker.prototype,"_isOpen",void 0),qe([fe()],e.KRDateRangePicker.prototype,"_activeTab",void 0),qe([fe()],e.KRDateRangePicker.prototype,"_tempStartDate",void 0),qe([fe()],e.KRDateRangePicker.prototype,"_tempEndDate",void 0),e.KRDateRangePicker=qe([he("kr-date-range-picker")],e.KRDateRangePicker);var Me,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.KRSnackbar=Me=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"),Me.activeSnackbars.push(this),this.duration>0&&(this.dismissTimeout=window.setTimeout((()=>{this.dismiss()}),this.duration))}disconnectedCallback(){super.disconnectedCallback();const e=Me.activeSnackbars.indexOf(this);e>-1&&Me.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:F`<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:F`<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:F`<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:F`<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 F`
913
1207
  ${e[this.type]}
914
1208
  <div class="content">
915
1209
  ${this.title?F`<div class="title">${this.title}</div>`:""}
@@ -925,7 +1219,7 @@ const ze="important",Oe=" !"+ze,Ke=xe(class extends ke{constructor(e){if(super(e
925
1219
  <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
1220
  </svg>
927
1221
  </button>
928
- `}},e.KRSnackbar.styles=l`
1222
+ `}},e.KRSnackbar.styles=a`
929
1223
  :host,
930
1224
  *,
931
1225
  *::before,
@@ -1073,7 +1367,7 @@ const ze="important",Oe=" !"+ze,Ke=xe(class extends ke{constructor(e){if(super(e
1073
1367
  outline: 2px solid #3b82f6;
1074
1368
  outline-offset: 2px;
1075
1369
  }
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 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.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"),F`<span class="label-icon">${i}</span>`}render(){return F`
1370
+ `,e.KRSnackbar.activeSnackbars=[],Be([ue({type:String})],e.KRSnackbar.prototype,"type",void 0),Be([ue({type:String})],e.KRSnackbar.prototype,"title",void 0),Be([ue({type:String})],e.KRSnackbar.prototype,"message",void 0),Be([ue({type:Number})],e.KRSnackbar.prototype,"duration",void 0),e.KRSnackbar=Me=Be([he("kr-snackbar")],e.KRSnackbar);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.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"),F`<span class="label-icon">${i}</span>`}render(){return F`
1077
1371
  <div class="header" role="tablist" @keydown=${this._handleKeyDown}>
1078
1372
  ${this._getTabs().map((e=>F`
1079
1373
  <button
@@ -1088,7 +1382,7 @@ const ze="important",Oe=" !"+ze,Ke=xe(class extends ke{constructor(e){if(super(e
1088
1382
  >
1089
1383
  ${this._renderTabIcon(e)}
1090
1384
  <span>${e.label}</span>
1091
- ${e.badge?F`<span class="label-badge" style=${Ke({backgroundColor:e.badgeBackground,color:e.badgeColor})}>${e.badge}</span>`:V}
1385
+ ${e.badge?F`<span class="label-badge" style=${De({backgroundColor:e.badgeBackground,color:e.badgeColor})}>${e.badge}</span>`:V}
1092
1386
  ${e.dismissible?F`
1093
1387
  <button
1094
1388
  class="label-dismiss"
@@ -1105,7 +1399,7 @@ const ze="important",Oe=" !"+ze,Ke=xe(class extends ke{constructor(e){if(super(e
1105
1399
  <div class="content" role="tabpanel" aria-labelledby=${this.activeTabId||""}>
1106
1400
  <slot @slotchange=${this._updateActiveTab}></slot>
1107
1401
  </div>
1108
- `}},e.KRTabGroup.styles=[de,l`
1402
+ `}},e.KRTabGroup.styles=[de,a`
1109
1403
  :host {
1110
1404
  display: flex;
1111
1405
  flex-direction: column;
@@ -1238,7 +1532,7 @@ const ze="important",Oe=" !"+ze,Ke=xe(class extends ke{constructor(e){if(super(e
1238
1532
  ::slotted(kr-tab[active]) {
1239
1533
  display: block;
1240
1534
  }
1241
- `],Be([ue({type:String,attribute:"active-tab-id"})],e.KRTabGroup.prototype,"activeTabId",void 0),Be([ue({type:Boolean})],e.KRTabGroup.prototype,"justified",void 0),Be([ue({type:String,reflect:!0})],e.KRTabGroup.prototype,"size",void 0),e.KRTabGroup=Be([he("kr-tab-group")],e.KRTabGroup);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.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"]')}updated(){const e=this.closest("kr-tab-group");e&&e.requestUpdate()}render(){return F`<slot></slot>`}},e.KRTab.styles=[de,l`
1535
+ `],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,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"]')}updated(){const e=this.closest("kr-tab-group");e&&e.requestUpdate()}render(){return F`<slot></slot>`}},e.KRTab.styles=[de,a`
1242
1536
  :host {
1243
1537
  display: none;
1244
1538
  }
@@ -1248,7 +1542,7 @@ const ze="important",Oe=" !"+ze,Ke=xe(class extends ke{constructor(e){if(super(e
1248
1542
  width: 100%;
1249
1543
  height: 100%;
1250
1544
  }
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([he("kr-tab")],e.KRTab);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.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 F`
1545
+ `],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 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 F`
1252
1546
  <div class="wrapper">
1253
1547
  ${this.label?F`
1254
1548
  <label>
@@ -1299,7 +1593,7 @@ const ze="important",Oe=" !"+ze,Ke=xe(class extends ke{constructor(e){if(super(e
1299
1593
  <div class="options-slot">
1300
1594
  <slot @slotchange=${()=>this.requestUpdate()}></slot>
1301
1595
  </div>
1302
- `}focus(){this._triggerElement?.focus()}blur(){this._triggerElement?.blur()}},e.KRSelectField.styles=[de,l`
1596
+ `}focus(){this._triggerElement?.focus()}blur(){this._triggerElement?.blur()}},e.KRSelectField.styles=[de,a`
1303
1597
  :host {
1304
1598
  display: block;
1305
1599
  font-family: inherit;
@@ -1475,11 +1769,11 @@ const ze="important",Oe=" !"+ze,Ke=xe(class extends ke{constructor(e){if(super(e
1475
1769
  .options-slot {
1476
1770
  display: none;
1477
1771
  }
1478
- `],e.KRSelectField.formAssociated=!0,Fe([ue({type:String})],e.KRSelectField.prototype,"label",void 0),Fe([ue({type:String})],e.KRSelectField.prototype,"name",void 0),Fe([ue({type:String})],e.KRSelectField.prototype,"value",void 0),Fe([ue({type:String})],e.KRSelectField.prototype,"placeholder",void 0),Fe([ue({type:Boolean})],e.KRSelectField.prototype,"disabled",void 0),Fe([ue({type:Boolean})],e.KRSelectField.prototype,"required",void 0),Fe([ue({type:Boolean})],e.KRSelectField.prototype,"readonly",void 0),Fe([ue({type:String})],e.KRSelectField.prototype,"hint",void 0),Fe([fe()],e.KRSelectField.prototype,"_isOpen",void 0),Fe([fe()],e.KRSelectField.prototype,"_highlightedIndex",void 0),Fe([fe()],e.KRSelectField.prototype,"_touched",void 0),Fe([ge(".select-trigger")],e.KRSelectField.prototype,"_triggerElement",void 0),e.KRSelectField=Fe([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 F`<slot></slot>`}},e.KRSelectOption.styles=l`
1772
+ `],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([he("kr-select-field")],e.KRSelectField);var Ve=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 F`<slot></slot>`}},e.KRSelectOption.styles=a`
1479
1773
  :host {
1480
1774
  display: none;
1481
1775
  }
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"},n_in:{key:"n_in",type:"list",dataTypes:["string","number","date","boolean"],label:"Not 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="n_in",this.text=e.substring(2,e.length-1).trim(),this.value=this.text.split(",").map((e=>e.trim())).map((e=>this._parse(e))),this.specificity=[Ge(this.text)]):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&&"n_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&&"n_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||"n_in"===this.operator?!this.value?.length:void 0===this.value||null===this.value||""===this.value}has(e){return!("in"!==this.operator&&"n_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&&"n_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||"n_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;case"n_in":Array.isArray(this.value)&&this.value.length>0?(e.operation="EXPRESSION",e.not=!0,e.value=`(${this.value.map((e=>Xe(e,!0))).join(" OR ")})`):(e.operation="EXPRESSION",e.not=!0,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;case"n_in":e.operation="IN",e.not=!0,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||"n_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;case"n_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="edge",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._sorts=[],this._resizing=null,this._resizeObserver=null,this._searchPositionLocked=!1,this._columnWidthsLocked=!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._columnWidthsLocked=!1,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._sorts=[],this._model.columns=this.def.columns.map((e=>{const t={...e,filter:null};return t.type||(t.type="string"),e.sort&&this._sorts.push({sortBy:e.id,sortDirection:e.sort}),"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.filter?(t.filter.setOperator(e.filter.operator),t.filter.setValue(e.filter.value)):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:this._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&&"n_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:this._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._columnWidthsLocked||requestAnimationFrame((()=>{const e=this.shadowRoot?.querySelectorAll(".header-row > .header-cell");if(e){const t=this.getDisplayedColumns();e.forEach(((e,i)=>{i<t.length&&!t[i].width&&"actions"!==t[i].type&&(t[i].width=`${e.offsetWidth}px`)}))}this._columnWidthsLocked=!0})),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||"n_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],this.requestUpdate()}_handleRowMouseDown(){(this._model.rowClickable||this._model.rowHref)&&window.getSelection()?.removeAllRanges()}_handleRowClick(e,t,i){if(!this._model.rowClickable&&!this._model.rowHref)return;const s=window.getSelection();s&&s.toString().length>0?e.preventDefault():this.dispatchEvent(new CustomEvent("row-click",{detail:{row:t,rowIndex:i},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)}_handleSortClick(e,t){if(e.shiftKey){const e=this._sorts.findIndex((e=>e.sortBy===t.id));if(-1===e)this._sorts.push({sortBy:t.id,sortDirection:"asc"});else{const t=this._sorts[e];"asc"===t.sortDirection?t.sortDirection="desc":this._sorts.splice(e,1)}this.requestUpdate()}else{let e=null;1===this._sorts.length&&(e=this._sorts.find((e=>e.sortBy===t.id))),e?"asc"===e.sortDirection?this._sorts=[{sortBy:t.id,sortDirection:"desc"}]:this._sorts=[]:this._sorts=[{sortBy:t.id,sortDirection:"asc"}]}this._page=1,this._fetch()}_renderSortIndicator(e){if(!e.sortable)return V;const t=this._sorts.findIndex((t=>t.sortBy===e.id));if(-1===t)return F`
1776
+ `,Ve([ue({type:String})],e.KRSelectOption.prototype,"value",void 0),Ve([ue({type:Boolean})],e.KRSelectOption.prototype,"disabled",void 0),e.KRSelectOption=Ve([he("kr-select-option")],e.KRSelectOption);const Ue={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"},n_in:{key:"n_in",type:"list",dataTypes:["string","number","date","boolean"],label:"Not 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 Ne(e){const t=[];for(const i of Object.values(Ue))i.dataTypes.includes(e)&&t.push({key:i.key,label:i.label});return t}const We=['"',"+","-","&&","||","!","(",")","{","}","[","]","^","~","*","?",":"],Xe=['\\"',"\\+","\\-","\\&\\&","\\|\\|","\\!","\\(","\\)","\\{","\\}","\\[","\\]","\\^","\\~","\\*","\\?","\\:"];function Ye(e,t=!0){return!0===e||!1===e?e.toString():null===e?"(*:* NOT *)":"number"==typeof e?e.toString():"string"==typeof e?(We.forEach(((t,i)=>{var s;e=e.replace(new RegExp(`${s=t,"string"!=typeof s?s:s.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}`,"g"),Xe[i])})),t?`"${e}"`:e.replace(/ /g,"\\ ")):e}function Ze(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 Qe(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 Je(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 et{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=[Je(this.text)];else if(e.startsWith("!="))this.operator="n_equals",this.text=e.substring(2).trim(),this.value=this._parse(this.text),this.specificity=[Je(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=[Je(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=[Je(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=[Je(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=[Je(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=[Je(this.text)];else if(e.startsWith("<"))this.operator="less_than",this.text=e.substring(1).trim(),this.value=this._parse(this.text),this.specificity=[Je(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=[Je(this.text)];else if(e.startsWith(">"))this.operator="greater_than",this.text=e.substring(1).trim(),this.value=this._parse(this.text),this.specificity=[Je(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=[Je(i),Je(s)]}else e.startsWith("!(")&&e.endsWith(")")?(this.operator="n_in",this.text=e.substring(2,e.length-1).trim(),this.value=this.text.split(",").map((e=>e.trim())).map((e=>this._parse(e))),this.specificity=[Je(this.text)]):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=[Je(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=[Je(this.text)]):(this.operator="contains",this.text=e,this.value=this._parse(this.text),this.specificity=[Je(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&&"n_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&&"n_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||"n_in"===this.operator?!this.value?.length:void 0===this.value||null===this.value||""===this.value}has(e){return!("in"!==this.operator&&"n_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&&"n_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||"n_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=Qe(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=Qe(this.value,this.specificity)):(e.operation="IS",e.not=!0,e.value=this.value);break;case"contains":e.operation="EXPRESSION",e.value=`*${Ye(this.value,!1)}*`;break;case"n_contains":e.operation="EXPRESSION",e.not=!0,e.value=`*${Ye(this.value,!1)}*`;break;case"starts_with":e.operation="EXPRESSION",e.value=`${Ye(this.value,!1)}*`;break;case"ends_with":e.operation="EXPRESSION",e.value=`*${Ye(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 ${Ze(this.value)}}`):(e.operation="EXPRESSION",e.value=`[* TO ${Ye(this.value,!0)}}`);break;case"less_than_equal":this.value instanceof Date?(e.operation="EXPRESSION",e.value=`[* TO ${Ze(this.value,!0)}]`):(e.operation="EXPRESSION",e.value=`[* TO ${Ye(this.value,!0)}]`);break;case"greater_than":this.value instanceof Date?(e.operation="EXPRESSION",e.value=`{${Ze(this.value,!0)} TO *]`):(e.operation="EXPRESSION",e.value=`{${Ye(this.value,!0)} TO *]`);break;case"greater_than_equal":this.value instanceof Date?(e.operation="EXPRESSION",e.value=`[${Ze(this.value)} TO *]`):(e.operation="EXPRESSION",e.value=`[${Ye(this.value,!0)} TO *]`);break;case"between":this.value?.start instanceof Date&&this.value?.end instanceof Date?(e.operation="EXPRESSION",e.value=Qe(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=>Ye(e,!0))).join(" OR ")})`):(e.operation="EXPRESSION",e.value=Ye(this.value,!0));break;case"n_in":Array.isArray(this.value)&&this.value.length>0?(e.operation="EXPRESSION",e.not=!0,e.value=`(${this.value.map((e=>Ye(e,!0))).join(" OR ")})`):(e.operation="EXPRESSION",e.not=!0,e.value=Ye(this.value,!0));break;default:e.operation="EXPRESSION",e.value=Ye(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;case"n_in":e.operation="IN",e.not=!0,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||"n_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;case"n_in":this.kql=`!(${this.value.map((e=>this._format(e))).join(",")})`;break;default:throw Error(`Unknown operator ${this.operator}`)}}}var tt=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 it{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="edge",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._sorts=[],this._resizing=null,this._resizeObserver=null,this._searchPositionLocked=!1,this._columnWidthsLocked=!1,this._model=new it,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._columnWidthsLocked=!1,this._model=new it,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._sorts=[],this._model.columns=this.def.columns.map((e=>{const t={...e,filter:null};return t.type||(t.type="string"),e.sort&&this._sorts.push({sortBy:e.id,sortDirection:e.sort}),"actions"===t.type?(t.label=e.label??"",t.sticky="right",t.resizable=!1,t):((e.filterable||e.facetable)&&(t.filter=new et,t.filter.field=e.id,t.filter.type=t.type,e.filter?(t.filter.setOperator(e.filter.operator),t.filter.setValue(e.filter.value)):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:this._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&&"n_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:Ye(this._searchQuery,!1)}),e}_toDbParams(){const e={page:this._page-1,size:this._pageSize,sorts:this._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._columnWidthsLocked||requestAnimationFrame((()=>{const e=this.shadowRoot?.querySelectorAll(".header-row > .header-cell");if(e){const t=this.getDisplayedColumns();e.forEach(((e,i)=>{i<t.length&&!t[i].width&&"actions"!==t[i].type&&(t[i].width=`${e.offsetWidth}px`)}))}this._columnWidthsLocked=!0})),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||"n_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],this.requestUpdate()}_handleRowMouseDown(){(this._model.rowClickable||this._model.rowHref)&&window.getSelection()?.removeAllRanges()}_handleRowClick(e,t,i){if(!this._model.rowClickable&&!this._model.rowHref)return;const s=window.getSelection();s&&s.toString().length>0?e.preventDefault():this.dispatchEvent(new CustomEvent("row-click",{detail:{row:t,rowIndex:i},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)}_handleSortClick(e,t){if(e.shiftKey){const e=this._sorts.findIndex((e=>e.sortBy===t.id));if(-1===e)this._sorts.push({sortBy:t.id,sortDirection:"asc"});else{const t=this._sorts[e];"asc"===t.sortDirection?t.sortDirection="desc":this._sorts.splice(e,1)}this.requestUpdate()}else{let e=null;1===this._sorts.length&&(e=this._sorts.find((e=>e.sortBy===t.id))),e?"asc"===e.sortDirection?this._sorts=[{sortBy:t.id,sortDirection:"desc"}]:this._sorts=[]:this._sorts=[{sortBy:t.id,sortDirection:"asc"}]}this._page=1,this._fetch()}_renderSortIndicator(e){if(!e.sortable)return V;const t=this._sorts.findIndex((t=>t.sortBy===e.id));if(-1===t)return F`
1483
1777
  <span class="header-cell__sort" @click=${t=>this._handleSortClick(t,e)}>
1484
1778
  <svg class="header-cell__sort-arrow header-cell__sort-arrow--ghost" viewBox="0 0 24 24" fill="currentColor">
1485
1779
  <path d="M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"/>
@@ -1487,7 +1781,7 @@ const ze="important",Oe=" !"+ze,Ke=xe(class extends ke{constructor(e){if(super(e
1487
1781
  </span>
1488
1782
  `;let i={};return"desc"===this._sorts[t].sortDirection&&(i={transform:"rotate(180deg)"}),F`
1489
1783
  <span class="header-cell__sort" @click=${t=>this._handleSortClick(t,e)}>
1490
- <svg class="header-cell__sort-arrow" viewBox="0 0 24 24" fill="currentColor" style=${Ke(i)}>
1784
+ <svg class="header-cell__sort-arrow" viewBox="0 0 24 24" fill="currentColor" style=${De(i)}>
1491
1785
  <path d="M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"/>
1492
1786
  </svg>
1493
1787
  ${this._sorts.length>1?F`
@@ -1660,7 +1954,7 @@ const ze="important",Oe=" !"+ze,Ke=xe(class extends ke{constructor(e){if(super(e
1660
1954
  .value=${e.filter.operator}
1661
1955
  @change=${t=>this._handleOperatorChange(t,e)}
1662
1956
  >
1663
- ${Ue(e.type).map((e=>F`
1957
+ ${Ne(e.type).map((e=>F`
1664
1958
  <kr-select-option value=${e.key}>${e.label}</kr-select-option>
1665
1959
  `))}
1666
1960
  </kr-select-field>
@@ -1701,7 +1995,7 @@ const ze="important",Oe=" !"+ze,Ke=xe(class extends ke{constructor(e){if(super(e
1701
1995
  `:e.facetable?o:i,F`
1702
1996
  <div
1703
1997
  class="filter-panel"
1704
- style=${Ke({top:this._filterPanelPos.top+"px",left:this._filterPanelPos.left+"px"})}
1998
+ style=${De({top:this._filterPanelPos.top+"px",left:this._filterPanelPos.left+"px"})}
1705
1999
  >
1706
2000
  ${r}
1707
2001
  <div class="filter-panel__actions">
@@ -1718,7 +2012,7 @@ const ze="important",Oe=" !"+ze,Ke=xe(class extends ke{constructor(e){if(super(e
1718
2012
  ${e.map(((t,i)=>t.filterable||t.facetable?F`
1719
2013
  <div
1720
2014
  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))})}
1721
- style=${Ke(this._getCellStyle(t,i))}
2015
+ style=${De(this._getCellStyle(t,i))}
1722
2016
  >
1723
2017
  <div class="filter-cell__wrapper">
1724
2018
  <input
@@ -1749,7 +2043,7 @@ const ze="important",Oe=" !"+ze,Ke=xe(class extends ke{constructor(e){if(super(e
1749
2043
  </div>
1750
2044
  `:F`<div
1751
2045
  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))})}
1752
- style=${Ke(this._getCellStyle(t,i))}
2046
+ style=${De(this._getCellStyle(t,i))}
1753
2047
  ></div>`))}
1754
2048
  </div>
1755
2049
  `:V}_renderTable(){return F`
@@ -1763,7 +2057,7 @@ const ze="important",Oe=" !"+ze,Ke=xe(class extends ke{constructor(e){if(super(e
1763
2057
  ${this.getDisplayedColumns().map(((e,t)=>F`
1764
2058
  <div
1765
2059
  class=${we(this._getHeaderCellClasses(e,t))}
1766
- style=${Ke(this._getCellStyle(e,t))}
2060
+ style=${De(this._getCellStyle(e,t))}
1767
2061
  data-column-id=${e.id}
1768
2062
  >
1769
2063
  <span class="header-cell__label">${e.label??e.id}</span>
@@ -1779,7 +2073,7 @@ const ze="important",Oe=" !"+ze,Ke=xe(class extends ke{constructor(e){if(super(e
1779
2073
  ${this._data.map(((e,t)=>{const i=this.getDisplayedColumns().map(((i,s)=>F`
1780
2074
  <div
1781
2075
  class=${we(this._getCellClasses(i,s))}
1782
- style=${Ke(this._getCellStyle(i,s))}
2076
+ style=${De(this._getCellStyle(i,s))}
1783
2077
  data-column-id=${i.id}
1784
2078
  >
1785
2079
  ${this._renderCellContent(i,e,t)}
@@ -1806,7 +2100,7 @@ const ze="important",Oe=" !"+ze,Ke=xe(class extends ke{constructor(e){if(super(e
1806
2100
  ${this._renderHeader()}
1807
2101
  ${this._renderTable()}
1808
2102
  ${this._renderFilterPanel()}
1809
- `:F`<slot></slot>`}},e.KRTable.styles=[de,l`
2103
+ `:F`<slot></slot>`}},e.KRTable.styles=[de,a`
1810
2104
  /* -------------------------------------------------------------------------
1811
2105
  * Host
1812
2106
  * ----------------------------------------------------------------------- */
@@ -2663,7 +2957,7 @@ const ze="important",Oe=" !"+ze,Ke=xe(class extends ke{constructor(e){if(super(e
2663
2957
  padding: 16px;
2664
2958
  }
2665
2959
 
2666
- `],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([fe()],e.KRTable.prototype,"_sorts",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,F`
2960
+ `],tt([fe()],e.KRTable.prototype,"_data",void 0),tt([fe()],e.KRTable.prototype,"_dataState",void 0),tt([fe()],e.KRTable.prototype,"_page",void 0),tt([fe()],e.KRTable.prototype,"_pageSize",void 0),tt([fe()],e.KRTable.prototype,"_totalItems",void 0),tt([fe()],e.KRTable.prototype,"_totalPages",void 0),tt([fe()],e.KRTable.prototype,"_searchQuery",void 0),tt([fe()],e.KRTable.prototype,"_canScrollLeft",void 0),tt([fe()],e.KRTable.prototype,"_canScrollRight",void 0),tt([fe()],e.KRTable.prototype,"_canScrollHorizontal",void 0),tt([fe()],e.KRTable.prototype,"_columnPickerOpen",void 0),tt([fe()],e.KRTable.prototype,"_filterPanelOpened",void 0),tt([fe()],e.KRTable.prototype,"_filterPanelTab",void 0),tt([fe()],e.KRTable.prototype,"_buckets",void 0),tt([fe()],e.KRTable.prototype,"_sorts",void 0),tt([ue({type:Object})],e.KRTable.prototype,"def",void 0),e.KRTable=tt([he("kr-table")],e.KRTable);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.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,F`
2667
2961
  <svg
2668
2962
  class="spinner"
2669
2963
  style=${`width: ${e}; height: ${e}; color: ${t}`}
@@ -2680,7 +2974,7 @@ const ze="important",Oe=" !"+ze,Ke=xe(class extends ke{constructor(e){if(super(e
2680
2974
  stroke-width="4"
2681
2975
  />
2682
2976
  </svg>
2683
- `}},e.KRSpinner.styles=l`
2977
+ `}},e.KRSpinner.styles=a`
2684
2978
  :host {
2685
2979
  display: inline-flex;
2686
2980
  align-items: center;
@@ -2723,7 +3017,7 @@ const ze="important",Oe=" !"+ze,Ke=xe(class extends ke{constructor(e){if(super(e
2723
3017
  stroke: currentColor;
2724
3018
  stroke-linecap: round;
2725
3019
  }
2726
- `,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",F`
3020
+ `,st([ue({type:String,reflect:!0})],e.KRSpinner.prototype,"size",void 0),st([ue({type:String,reflect:!0})],e.KRSpinner.prototype,"color",void 0),e.KRSpinner=st([he("kr-spinner")],e.KRSpinner);var ot=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",F`
2727
3021
  <div
2728
3022
  class="progress-bar"
2729
3023
  style=${`background: ${t}`}
@@ -2732,7 +3026,7 @@ const ze="important",Oe=" !"+ze,Ke=xe(class extends ke{constructor(e){if(super(e
2732
3026
  >
2733
3027
  <div class="fill" style=${`background: ${e}`}></div>
2734
3028
  </div>
2735
- `}},e.KRProgressBar.styles=l`
3029
+ `}},e.KRProgressBar.styles=a`
2736
3030
  :host {
2737
3031
  display: block;
2738
3032
  width: 100%;
@@ -2764,7 +3058,7 @@ const ze="important",Oe=" !"+ze,Ke=xe(class extends ke{constructor(e){if(super(e
2764
3058
  left: 100%;
2765
3059
  }
2766
3060
  }
2767
- `,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)?F`<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)?F`<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)?F`<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>`:F`<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=F`<img
3061
+ `,ot([ue({type:String,reflect:!0})],e.KRProgressBar.prototype,"color",void 0),ot([ue({type:String,reflect:!0})],e.KRProgressBar.prototype,"trackColor",void 0),e.KRProgressBar=ot([he("kr-progress-bar")],e.KRProgressBar);var rt,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.KRFilePreview=rt=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})),rt._activePreview===this&&(rt._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)?F`<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)?F`<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)?F`<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>`:F`<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=F`<img
2768
3062
  class="body__image"
2769
3063
  src="${this.src}"
2770
3064
  alt="${this.name}"
@@ -2807,7 +3101,7 @@ const ze="important",Oe=" !"+ze,Ke=xe(class extends ke{constructor(e){if(super(e
2807
3101
  <div class="body" @click=${this._handleBackdropClick}>
2808
3102
  ${e}
2809
3103
  </div>
2810
- `}},e.KRFilePreview.styles=l`
3104
+ `}},e.KRFilePreview.styles=a`
2811
3105
  *,
2812
3106
  *::after,
2813
3107
  *::before,
@@ -2987,7 +3281,7 @@ const ze="important",Oe=" !"+ze,Ke=xe(class extends ke{constructor(e){if(super(e
2987
3281
  height: 18px;
2988
3282
  fill: currentColor;
2989
3283
  }
2990
- `,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)?F`<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)?F`<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)?F`<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)?F`<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)?F`<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>`:F`<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?F`
3284
+ `,e.KRFilePreview._activePreview=null,at([ue({type:String})],e.KRFilePreview.prototype,"src",void 0),at([ue({type:String})],e.KRFilePreview.prototype,"name",void 0),at([fe()],e.KRFilePreview.prototype,"_zoomLevel",void 0),at([fe()],e.KRFilePreview.prototype,"_textContent",void 0),e.KRFilePreview=rt=at([he("kr-file-preview")],e.KRFilePreview);var lt=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)?F`<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)?F`<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)?F`<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)?F`<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)?F`<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>`:F`<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?F`
2991
3285
  <div class="file-list">
2992
3286
  ${this.files.map((e=>{const t=this._getExtension(e.name),i=e.meta||e.date||"";return F`
2993
3287
  <div class="file-list__item">
@@ -3003,7 +3297,7 @@ const ze="important",Oe=" !"+ze,Ke=xe(class extends ke{constructor(e){if(super(e
3003
3297
  </div>
3004
3298
  `}))}
3005
3299
  </div>
3006
- `:F`<div class="file-list__empty">${this.emptyMessage}</div>`}},e.KRFileList.styles=l`
3300
+ `:F`<div class="file-list__empty">${this.emptyMessage}</div>`}},e.KRFileList.styles=a`
3007
3301
  *,
3008
3302
  *::after,
3009
3303
  *::before,
@@ -3123,17 +3417,17 @@ const ze="important",Oe=" !"+ze,Ke=xe(class extends ke{constructor(e){if(super(e
3123
3417
  * Copyright 2018 Google LLC
3124
3418
  * SPDX-License-Identifier: BSD-3-Clause
3125
3419
  */
3126
- const at=e=>e??V
3420
+ const nt=e=>e??V
3127
3421
  /**
3128
3422
  * @license
3129
3423
  * Copyright 2020 Google LLC
3130
3424
  * SPDX-License-Identifier: BSD-3-Clause
3131
- */,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;
3425
+ */,dt={},ht=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=dt)=>{e._$AH=t;
3132
3426
  /**
3133
3427
  * @license
3134
3428
  * Copyright 2020 Google LLC
3135
3429
  * SPDX-License-Identifier: BSD-3-Clause
3136
- */})(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),F`
3430
+ */})(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),F`
3137
3431
  <div class="wrapper">
3138
3432
  ${this.label?F`
3139
3433
  <label for="input">
@@ -3146,22 +3440,22 @@ const at=e=>e??V
3146
3440
  class=${we({"input--invalid":this._touched&&this._input&&!this._input.validity.valid})}
3147
3441
  type=${this.type}
3148
3442
  name=${this.name}
3149
- .value=${dt(this.value)}
3443
+ .value=${ht(this.value)}
3150
3444
  placeholder=${this.placeholder}
3151
3445
  ?required=${this.required}
3152
3446
  ?disabled=${this.disabled}
3153
3447
  ?readonly=${this.readonly}
3154
- minlength=${at(this.minlength)}
3155
- maxlength=${at(this.maxlength)}
3156
- pattern=${at(this.pattern)}
3157
- autocomplete=${at(this.autocomplete||void 0)}
3448
+ minlength=${nt(this.minlength)}
3449
+ maxlength=${nt(this.maxlength)}
3450
+ pattern=${nt(this.pattern)}
3451
+ autocomplete=${nt(this.autocomplete||void 0)}
3158
3452
  @input=${this._handleInput}
3159
3453
  @change=${this._handleChange}
3160
3454
  @blur=${this._handleBlur}
3161
3455
  />
3162
3456
  ${e?F`<div class="validation-message">${e}</div>`:this.hint?F`<div class="hint">${this.hint}</div>`:""}
3163
3457
  </div>
3164
- `}focus(){this._input?.focus()}blur(){this._input?.blur()}select(){this._input?.select()}},e.KRTextField.styles=l`
3458
+ `}focus(){this._input?.focus()}blur(){this._input?.blur()}select(){this._input?.select()}},e.KRTextField.styles=a`
3165
3459
  :host {
3166
3460
  display: block;
3167
3461
  font-family: inherit;
@@ -3228,7 +3522,7 @@ const at=e=>e??V
3228
3522
  font-size: 0.75rem;
3229
3523
  color: var(--kr-text-field-helper-color, #6b7280);
3230
3524
  }
3231
- `,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),F`
3525
+ `,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([he("kr-text-field")],e.KRTextField);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};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),F`
3232
3526
  <div class="wrapper">
3233
3527
  ${this.label?F`
3234
3528
  <label for="textarea">
@@ -3240,23 +3534,23 @@ const at=e=>e??V
3240
3534
  id="textarea"
3241
3535
  class=${we({"textarea--invalid":this._touched&&this._textarea&&!this._textarea.validity.valid})}
3242
3536
  name=${this.name}
3243
- .value=${dt(this.value)}
3537
+ .value=${ht(this.value)}
3244
3538
  placeholder=${this.placeholder}
3245
3539
  ?required=${this.required}
3246
3540
  ?disabled=${this.disabled}
3247
3541
  ?readonly=${this.readonly}
3248
3542
  rows=${this.rows}
3249
- cols=${at(this.cols)}
3250
- minlength=${at(this.minlength)}
3251
- maxlength=${at(this.maxlength)}
3252
- autocomplete=${at(this.autocomplete||void 0)}
3543
+ cols=${nt(this.cols)}
3544
+ minlength=${nt(this.minlength)}
3545
+ maxlength=${nt(this.maxlength)}
3546
+ autocomplete=${nt(this.autocomplete||void 0)}
3253
3547
  @input=${this._handleInput}
3254
3548
  @change=${this._handleChange}
3255
3549
  @blur=${this._handleBlur}
3256
3550
  ></textarea>
3257
3551
  ${e?F`<div class="validation-message">${e}</div>`:this.hint?F`<div class="hint">${this.hint}</div>`:V}
3258
3552
  </div>
3259
- `}focus(){this._textarea?.focus()}blur(){this._textarea?.blur()}select(){this._textarea?.select()}},e.KRTextareaField.styles=l`
3553
+ `}focus(){this._textarea?.focus()}blur(){this._textarea?.blur()}select(){this._textarea?.select()}},e.KRTextareaField.styles=a`
3260
3554
  :host {
3261
3555
  display: block;
3262
3556
  font-family: inherit;
@@ -3326,12 +3620,12 @@ const at=e=>e??V
3326
3620
  font-size: 0.75rem;
3327
3621
  color: var(--kr-textarea-field-helper-color, #6b7280);
3328
3622
  }
3329
- `,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 F`
3623
+ `,e.KRTextareaField.formAssociated=!0,pt([ue({type:String})],e.KRTextareaField.prototype,"label",void 0),pt([ue({type:String})],e.KRTextareaField.prototype,"name",void 0),pt([ue({type:String})],e.KRTextareaField.prototype,"value",void 0),pt([ue({type:String})],e.KRTextareaField.prototype,"placeholder",void 0),pt([ue({type:Boolean})],e.KRTextareaField.prototype,"required",void 0),pt([ue({type:Boolean})],e.KRTextareaField.prototype,"disabled",void 0),pt([ue({type:Boolean})],e.KRTextareaField.prototype,"readonly",void 0),pt([ue({type:Number})],e.KRTextareaField.prototype,"rows",void 0),pt([ue({type:Number})],e.KRTextareaField.prototype,"cols",void 0),pt([ue({type:Number})],e.KRTextareaField.prototype,"minlength",void 0),pt([ue({type:Number})],e.KRTextareaField.prototype,"maxlength",void 0),pt([ue({type:String})],e.KRTextareaField.prototype,"autocomplete",void 0),pt([ue({type:String})],e.KRTextareaField.prototype,"hint",void 0),pt([ge("textarea")],e.KRTextareaField.prototype,"_textarea",void 0),pt([fe()],e.KRTextareaField.prototype,"_touched",void 0),pt([fe()],e.KRTextareaField.prototype,"_dirty",void 0),e.KRTextareaField=pt([he("kr-textarea-field")],e.KRTextareaField);var ut=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 ft=class extends le{constructor(){super(...arguments),this.label="",this.value=""}render(){return F`
3330
3624
  <div class="wrapper">
3331
3625
  ${this.label?F`<label>${this.label}</label>`:V}
3332
3626
  <div class="value">${this.value}</div>
3333
3627
  </div>
3334
- `}};ut.styles=l`
3628
+ `}};ft.styles=a`
3335
3629
  :host {
3336
3630
  display: block;
3337
3631
  font-family: inherit;
@@ -3353,7 +3647,7 @@ const at=e=>e??V
3353
3647
  font-size: 14px;
3354
3648
  color: black;
3355
3649
  }
3356
- `,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 F`
3650
+ `,ut([ue({type:String})],ft.prototype,"label",void 0),ut([ue({type:String})],ft.prototype,"value",void 0),ft=ut([he("kr-detail-field")],ft);var gt=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.KRAutoSuggest=class extends le{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 F`
3357
3651
  <button
3358
3652
  class=${we({option:!0,"option--highlighted":t===this._highlightedIndex})}
3359
3653
  type="button"
@@ -3377,7 +3671,7 @@ const at=e=>e??V
3377
3671
  <div class="input-wrapper">
3378
3672
  <input
3379
3673
  type="text"
3380
- .value=${dt(this.value)}
3674
+ .value=${ht(this.value)}
3381
3675
  placeholder=${this.placeholder}
3382
3676
  ?disabled=${this.disabled}
3383
3677
  ?readonly=${this.readonly}
@@ -3418,7 +3712,7 @@ const at=e=>e??V
3418
3712
 
3419
3713
  ${e}
3420
3714
  </div>
3421
- `}},e.KRAutoSuggest.styles=l`
3715
+ `}},e.KRAutoSuggest.styles=a`
3422
3716
  :host {
3423
3717
  display: block;
3424
3718
  font-family: inherit;
@@ -3575,7 +3869,7 @@ const at=e=>e??V
3575
3869
  font-size: 0.75rem;
3576
3870
  color: var(--kr-text-field-error-color, #ef4444);
3577
3871
  }
3578
- `,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._loading=!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(),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._isOpen||this._open()}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._loading=!0,this._requestId++;const e=this._requestId;this.fetch(this._searchQuery).then((t=>{e===this._requestId&&(this.options=t,this._loading=!1)})).catch((e=>{console.error("kr-combo-box: fetch failed",e),this._loading=!1}))}_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 F`
3872
+ `,e.KRAutoSuggest.formAssociated=!0,gt([ue({type:String})],e.KRAutoSuggest.prototype,"label",void 0),gt([ue({type:String})],e.KRAutoSuggest.prototype,"name",void 0),gt([ue({type:String})],e.KRAutoSuggest.prototype,"value",void 0),gt([ue({type:String})],e.KRAutoSuggest.prototype,"placeholder",void 0),gt([ue({type:Boolean})],e.KRAutoSuggest.prototype,"disabled",void 0),gt([ue({type:Boolean})],e.KRAutoSuggest.prototype,"readonly",void 0),gt([ue({type:Boolean})],e.KRAutoSuggest.prototype,"required",void 0),gt([ue({type:String})],e.KRAutoSuggest.prototype,"hint",void 0),gt([ue({type:Array})],e.KRAutoSuggest.prototype,"options",void 0),gt([ue({attribute:!1})],e.KRAutoSuggest.prototype,"fetch",void 0),gt([fe()],e.KRAutoSuggest.prototype,"_isOpen",void 0),gt([fe()],e.KRAutoSuggest.prototype,"_highlightedIndex",void 0),gt([fe()],e.KRAutoSuggest.prototype,"_touched",void 0),gt([ge("input")],e.KRAutoSuggest.prototype,"_input",void 0),e.KRAutoSuggest=gt([he("kr-auto-suggest")],e.KRAutoSuggest);var bt=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.KRComboBox=class extends le{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._loading=!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(),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._isOpen||this._open()}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._loading=!0,this._requestId++;const e=this._requestId;this.fetch(this._searchQuery).then((t=>{e===this._requestId&&(this.options=t,this._loading=!1)})).catch((e=>{console.error("kr-combo-box: fetch failed",e),this._loading=!1}))}_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 F`
3579
3873
  <button
3580
3874
  class=${we({option:!0,"option--highlighted":t===this._highlightedIndex,"option--selected":i===this.value})}
3581
3875
  type="button"
@@ -3645,7 +3939,7 @@ const at=e=>e??V
3645
3939
 
3646
3940
  ${e}
3647
3941
  </div>
3648
- `}},e.KRComboBox.styles=l`
3942
+ `}},e.KRComboBox.styles=a`
3649
3943
  :host {
3650
3944
  display: block;
3651
3945
  font-family: inherit;
@@ -3857,5 +4151,5 @@ const at=e=>e??V
3857
4151
  font-size: 0.75rem;
3858
4152
  color: var(--kr-text-field-error-color, #ef4444);
3859
4153
  }
3860
- `,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([fe()],e.KRComboBox.prototype,"_loading",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);
4154
+ `,e.KRComboBox.formAssociated=!0,bt([ue({type:String})],e.KRComboBox.prototype,"label",void 0),bt([ue({type:String})],e.KRComboBox.prototype,"name",void 0),bt([ue({type:String})],e.KRComboBox.prototype,"value",void 0),bt([ue({type:String})],e.KRComboBox.prototype,"placeholder",void 0),bt([ue({type:Boolean})],e.KRComboBox.prototype,"disabled",void 0),bt([ue({type:Boolean})],e.KRComboBox.prototype,"readonly",void 0),bt([ue({type:Boolean})],e.KRComboBox.prototype,"required",void 0),bt([ue({type:String})],e.KRComboBox.prototype,"hint",void 0),bt([ue({attribute:"option-value"})],e.KRComboBox.prototype,"optionValue",void 0),bt([ue({attribute:"option-label"})],e.KRComboBox.prototype,"optionLabel",void 0),bt([ue({type:Array})],e.KRComboBox.prototype,"options",void 0),bt([ue({attribute:!1})],e.KRComboBox.prototype,"fetch",void 0),bt([ue({attribute:!1})],e.KRComboBox.prototype,"fetchSelection",void 0),bt([fe()],e.KRComboBox.prototype,"_isOpen",void 0),bt([fe()],e.KRComboBox.prototype,"_highlightedIndex",void 0),bt([fe()],e.KRComboBox.prototype,"_touched",void 0),bt([fe()],e.KRComboBox.prototype,"_searchQuery",void 0),bt([fe()],e.KRComboBox.prototype,"_loading",void 0),bt([ge(".trigger")],e.KRComboBox.prototype,"_triggerElement",void 0),bt([ge(".search__input")],e.KRComboBox.prototype,"_searchInput",void 0),e.KRComboBox=bt([he("kr-combo-box")],e.KRComboBox),e.KRDialogRef=Le,e.KRQuery=et,e.KR_OPERATORS=Ue,e.getOperatorsForType=Ne,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);
3861
4155
  //# sourceMappingURL=krubble-components.umd.min.js.map