@spectric/ui 0.0.9 → 0.0.10

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.
package/dist/index.umd.js CHANGED
@@ -2,29 +2,29 @@
2
2
  * @license
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
- */var Jr;const X=globalThis,_t=X.ShadowRoot&&(X.ShadyCSS===void 0||X.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,wt=Symbol(),ar=new WeakMap;let cr=class{constructor(r,s,i){if(this._$cssResult$=!0,i!==wt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=r,this.t=s}get styleSheet(){let r=this.o;const s=this.t;if(_t&&r===void 0){const i=s!==void 0&&s.length===1;i&&(r=ar.get(s)),r===void 0&&((this.o=r=new CSSStyleSheet).replaceSync(this.cssText),i&&ar.set(s,r))}return r}toString(){return this.cssText}};const as=o=>new cr(typeof o=="string"?o:o+"",void 0,wt),R=(o,...r)=>{const s=o.length===1?o[0]:r.reduce((i,a,e)=>i+(u=>{if(u._$cssResult$===!0)return u.cssText;if(typeof u=="number")return u;throw Error("Value passed to 'css' function must be a 'css' function result: "+u+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(a)+o[e+1],o[0]);return new cr(s,o,wt)},cs=(o,r)=>{if(_t)o.adoptedStyleSheets=r.map(s=>s instanceof CSSStyleSheet?s:s.styleSheet);else for(const s of r){const i=document.createElement("style"),a=X.litNonce;a!==void 0&&i.setAttribute("nonce",a),i.textContent=s.cssText,o.appendChild(i)}},lr=_t?o=>o:o=>o instanceof CSSStyleSheet?(r=>{let s="";for(const i of r.cssRules)s+=i.cssText;return as(s)})(o):o;/**
5
+ */var ei;const X=globalThis,wt=X.ShadowRoot&&(X.ShadyCSS===void 0||X.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,St=Symbol(),cr=new WeakMap;let lr=class{constructor(r,s,i){if(this._$cssResult$=!0,i!==St)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=r,this.t=s}get styleSheet(){let r=this.o;const s=this.t;if(wt&&r===void 0){const i=s!==void 0&&s.length===1;i&&(r=cr.get(s)),r===void 0&&((this.o=r=new CSSStyleSheet).replaceSync(this.cssText),i&&cr.set(s,r))}return r}toString(){return this.cssText}};const cs=o=>new lr(typeof o=="string"?o:o+"",void 0,St),R=(o,...r)=>{const s=o.length===1?o[0]:r.reduce((i,a,e)=>i+(u=>{if(u._$cssResult$===!0)return u.cssText;if(typeof u=="number")return u;throw Error("Value passed to 'css' function must be a 'css' function result: "+u+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(a)+o[e+1],o[0]);return new lr(s,o,St)},ls=(o,r)=>{if(wt)o.adoptedStyleSheets=r.map(s=>s instanceof CSSStyleSheet?s:s.styleSheet);else for(const s of r){const i=document.createElement("style"),a=X.litNonce;a!==void 0&&i.setAttribute("nonce",a),i.textContent=s.cssText,o.appendChild(i)}},pr=wt?o=>o:o=>o instanceof CSSStyleSheet?(r=>{let s="";for(const i of r.cssRules)s+=i.cssText;return cs(s)})(o):o;/**
6
6
  * @license
7
7
  * Copyright 2017 Google LLC
8
8
  * SPDX-License-Identifier: BSD-3-Clause
9
- */const{is:ls,defineProperty:ps,getOwnPropertyDescriptor:us,getOwnPropertyNames:ds,getOwnPropertySymbols:hs,getPrototypeOf:fs}=Object,G=globalThis,pr=G.trustedTypes,gs=pr?pr.emptyScript:"",St=G.reactiveElementPolyfillSupport,Pe=(o,r)=>o,qe={toAttribute(o,r){switch(r){case Boolean:o=o?gs:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,r){let s=o;switch(r){case Boolean:s=o!==null;break;case Number:s=o===null?null:Number(o);break;case Object:case Array:try{s=JSON.parse(o)}catch{s=null}}return s}},At=(o,r)=>!ls(o,r),ur={attribute:!0,type:String,converter:qe,reflect:!1,hasChanged:At};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),G.litPropertyMetadata??(G.litPropertyMetadata=new WeakMap);class fe extends HTMLElement{static addInitializer(r){this._$Ei(),(this.l??(this.l=[])).push(r)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(r,s=ur){if(s.state&&(s.attribute=!1),this._$Ei(),this.elementProperties.set(r,s),!s.noAccessor){const i=Symbol(),a=this.getPropertyDescriptor(r,i,s);a!==void 0&&ps(this.prototype,r,a)}}static getPropertyDescriptor(r,s,i){const{get:a,set:e}=us(this.prototype,r)??{get(){return this[s]},set(u){this[s]=u}};return{get(){return a==null?void 0:a.call(this)},set(u){const g=a==null?void 0:a.call(this);e.call(this,u),this.requestUpdate(r,g,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(r){return this.elementProperties.get(r)??ur}static _$Ei(){if(this.hasOwnProperty(Pe("elementProperties")))return;const r=fs(this);r.finalize(),r.l!==void 0&&(this.l=[...r.l]),this.elementProperties=new Map(r.elementProperties)}static finalize(){if(this.hasOwnProperty(Pe("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Pe("properties"))){const s=this.properties,i=[...ds(s),...hs(s)];for(const a of i)this.createProperty(a,s[a])}const r=this[Symbol.metadata];if(r!==null){const s=litPropertyMetadata.get(r);if(s!==void 0)for(const[i,a]of s)this.elementProperties.set(i,a)}this._$Eh=new Map;for(const[s,i]of this.elementProperties){const a=this._$Eu(s,i);a!==void 0&&this._$Eh.set(a,s)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(r){const s=[];if(Array.isArray(r)){const i=new Set(r.flat(1/0).reverse());for(const a of i)s.unshift(lr(a))}else r!==void 0&&s.push(lr(r));return s}static _$Eu(r,s){const i=s.attribute;return i===!1?void 0:typeof i=="string"?i:typeof r=="string"?r.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var r;this._$ES=new Promise(s=>this.enableUpdating=s),this._$AL=new Map,this._$E_(),this.requestUpdate(),(r=this.constructor.l)==null||r.forEach(s=>s(this))}addController(r){var s;(this._$EO??(this._$EO=new Set)).add(r),this.renderRoot!==void 0&&this.isConnected&&((s=r.hostConnected)==null||s.call(r))}removeController(r){var s;(s=this._$EO)==null||s.delete(r)}_$E_(){const r=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(r.set(i,this[i]),delete this[i]);r.size>0&&(this._$Ep=r)}createRenderRoot(){const r=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return cs(r,this.constructor.elementStyles),r}connectedCallback(){var r;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(r=this._$EO)==null||r.forEach(s=>{var i;return(i=s.hostConnected)==null?void 0:i.call(s)})}enableUpdating(r){}disconnectedCallback(){var r;(r=this._$EO)==null||r.forEach(s=>{var i;return(i=s.hostDisconnected)==null?void 0:i.call(s)})}attributeChangedCallback(r,s,i){this._$AK(r,i)}_$EC(r,s){var e;const i=this.constructor.elementProperties.get(r),a=this.constructor._$Eu(r,i);if(a!==void 0&&i.reflect===!0){const u=(((e=i.converter)==null?void 0:e.toAttribute)!==void 0?i.converter:qe).toAttribute(s,i.type);this._$Em=r,u==null?this.removeAttribute(a):this.setAttribute(a,u),this._$Em=null}}_$AK(r,s){var e;const i=this.constructor,a=i._$Eh.get(r);if(a!==void 0&&this._$Em!==a){const u=i.getPropertyOptions(a),g=typeof u.converter=="function"?{fromAttribute:u.converter}:((e=u.converter)==null?void 0:e.fromAttribute)!==void 0?u.converter:qe;this._$Em=a,this[a]=g.fromAttribute(s,u.type),this._$Em=null}}requestUpdate(r,s,i){if(r!==void 0){if(i??(i=this.constructor.getPropertyOptions(r)),!(i.hasChanged??At)(this[r],s))return;this.P(r,s,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(r,s,i){this._$AL.has(r)||this._$AL.set(r,s),i.reflect===!0&&this._$Em!==r&&(this._$Ej??(this._$Ej=new Set)).add(r)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(s){Promise.reject(s)}const r=this.scheduleUpdate();return r!=null&&await r,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[e,u]of this._$Ep)this[e]=u;this._$Ep=void 0}const a=this.constructor.elementProperties;if(a.size>0)for(const[e,u]of a)u.wrapped!==!0||this._$AL.has(e)||this[e]===void 0||this.P(e,this[e],u)}let r=!1;const s=this._$AL;try{r=this.shouldUpdate(s),r?(this.willUpdate(s),(i=this._$EO)==null||i.forEach(a=>{var e;return(e=a.hostUpdate)==null?void 0:e.call(a)}),this.update(s)):this._$EU()}catch(a){throw r=!1,this._$EU(),a}r&&this._$AE(s)}willUpdate(r){}_$AE(r){var s;(s=this._$EO)==null||s.forEach(i=>{var a;return(a=i.hostUpdated)==null?void 0:a.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(r)),this.updated(r)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(r){return!0}update(r){this._$Ej&&(this._$Ej=this._$Ej.forEach(s=>this._$EC(s,this[s]))),this._$EU()}updated(r){}firstUpdated(r){}}fe.elementStyles=[],fe.shadowRootOptions={mode:"open"},fe[Pe("elementProperties")]=new Map,fe[Pe("finalized")]=new Map,St==null||St({ReactiveElement:fe}),(G.reactiveElementVersions??(G.reactiveElementVersions=[])).push("2.0.4");/**
9
+ */const{is:ps,defineProperty:us,getOwnPropertyDescriptor:ds,getOwnPropertyNames:hs,getOwnPropertySymbols:fs,getPrototypeOf:gs}=Object,G=globalThis,ur=G.trustedTypes,bs=ur?ur.emptyScript:"",At=G.reactiveElementPolyfillSupport,Pe=(o,r)=>o,qe={toAttribute(o,r){switch(r){case Boolean:o=o?bs:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,r){let s=o;switch(r){case Boolean:s=o!==null;break;case Number:s=o===null?null:Number(o);break;case Object:case Array:try{s=JSON.parse(o)}catch{s=null}}return s}},xt=(o,r)=>!ps(o,r),dr={attribute:!0,type:String,converter:qe,reflect:!1,hasChanged:xt};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),G.litPropertyMetadata??(G.litPropertyMetadata=new WeakMap);class fe extends HTMLElement{static addInitializer(r){this._$Ei(),(this.l??(this.l=[])).push(r)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(r,s=dr){if(s.state&&(s.attribute=!1),this._$Ei(),this.elementProperties.set(r,s),!s.noAccessor){const i=Symbol(),a=this.getPropertyDescriptor(r,i,s);a!==void 0&&us(this.prototype,r,a)}}static getPropertyDescriptor(r,s,i){const{get:a,set:e}=ds(this.prototype,r)??{get(){return this[s]},set(u){this[s]=u}};return{get(){return a==null?void 0:a.call(this)},set(u){const g=a==null?void 0:a.call(this);e.call(this,u),this.requestUpdate(r,g,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(r){return this.elementProperties.get(r)??dr}static _$Ei(){if(this.hasOwnProperty(Pe("elementProperties")))return;const r=gs(this);r.finalize(),r.l!==void 0&&(this.l=[...r.l]),this.elementProperties=new Map(r.elementProperties)}static finalize(){if(this.hasOwnProperty(Pe("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Pe("properties"))){const s=this.properties,i=[...hs(s),...fs(s)];for(const a of i)this.createProperty(a,s[a])}const r=this[Symbol.metadata];if(r!==null){const s=litPropertyMetadata.get(r);if(s!==void 0)for(const[i,a]of s)this.elementProperties.set(i,a)}this._$Eh=new Map;for(const[s,i]of this.elementProperties){const a=this._$Eu(s,i);a!==void 0&&this._$Eh.set(a,s)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(r){const s=[];if(Array.isArray(r)){const i=new Set(r.flat(1/0).reverse());for(const a of i)s.unshift(pr(a))}else r!==void 0&&s.push(pr(r));return s}static _$Eu(r,s){const i=s.attribute;return i===!1?void 0:typeof i=="string"?i:typeof r=="string"?r.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var r;this._$ES=new Promise(s=>this.enableUpdating=s),this._$AL=new Map,this._$E_(),this.requestUpdate(),(r=this.constructor.l)==null||r.forEach(s=>s(this))}addController(r){var s;(this._$EO??(this._$EO=new Set)).add(r),this.renderRoot!==void 0&&this.isConnected&&((s=r.hostConnected)==null||s.call(r))}removeController(r){var s;(s=this._$EO)==null||s.delete(r)}_$E_(){const r=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(r.set(i,this[i]),delete this[i]);r.size>0&&(this._$Ep=r)}createRenderRoot(){const r=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ls(r,this.constructor.elementStyles),r}connectedCallback(){var r;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(r=this._$EO)==null||r.forEach(s=>{var i;return(i=s.hostConnected)==null?void 0:i.call(s)})}enableUpdating(r){}disconnectedCallback(){var r;(r=this._$EO)==null||r.forEach(s=>{var i;return(i=s.hostDisconnected)==null?void 0:i.call(s)})}attributeChangedCallback(r,s,i){this._$AK(r,i)}_$EC(r,s){var e;const i=this.constructor.elementProperties.get(r),a=this.constructor._$Eu(r,i);if(a!==void 0&&i.reflect===!0){const u=(((e=i.converter)==null?void 0:e.toAttribute)!==void 0?i.converter:qe).toAttribute(s,i.type);this._$Em=r,u==null?this.removeAttribute(a):this.setAttribute(a,u),this._$Em=null}}_$AK(r,s){var e;const i=this.constructor,a=i._$Eh.get(r);if(a!==void 0&&this._$Em!==a){const u=i.getPropertyOptions(a),g=typeof u.converter=="function"?{fromAttribute:u.converter}:((e=u.converter)==null?void 0:e.fromAttribute)!==void 0?u.converter:qe;this._$Em=a,this[a]=g.fromAttribute(s,u.type),this._$Em=null}}requestUpdate(r,s,i){if(r!==void 0){if(i??(i=this.constructor.getPropertyOptions(r)),!(i.hasChanged??xt)(this[r],s))return;this.P(r,s,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(r,s,i){this._$AL.has(r)||this._$AL.set(r,s),i.reflect===!0&&this._$Em!==r&&(this._$Ej??(this._$Ej=new Set)).add(r)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(s){Promise.reject(s)}const r=this.scheduleUpdate();return r!=null&&await r,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[e,u]of this._$Ep)this[e]=u;this._$Ep=void 0}const a=this.constructor.elementProperties;if(a.size>0)for(const[e,u]of a)u.wrapped!==!0||this._$AL.has(e)||this[e]===void 0||this.P(e,this[e],u)}let r=!1;const s=this._$AL;try{r=this.shouldUpdate(s),r?(this.willUpdate(s),(i=this._$EO)==null||i.forEach(a=>{var e;return(e=a.hostUpdate)==null?void 0:e.call(a)}),this.update(s)):this._$EU()}catch(a){throw r=!1,this._$EU(),a}r&&this._$AE(s)}willUpdate(r){}_$AE(r){var s;(s=this._$EO)==null||s.forEach(i=>{var a;return(a=i.hostUpdated)==null?void 0:a.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(r)),this.updated(r)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(r){return!0}update(r){this._$Ej&&(this._$Ej=this._$Ej.forEach(s=>this._$EC(s,this[s]))),this._$EU()}updated(r){}firstUpdated(r){}}fe.elementStyles=[],fe.shadowRootOptions={mode:"open"},fe[Pe("elementProperties")]=new Map,fe[Pe("finalized")]=new Map,At==null||At({ReactiveElement:fe}),(G.reactiveElementVersions??(G.reactiveElementVersions=[])).push("2.0.4");/**
10
10
  * @license
11
11
  * Copyright 2017 Google LLC
12
12
  * SPDX-License-Identifier: BSD-3-Clause
13
- */const Te=globalThis,We=Te.trustedTypes,dr=We?We.createPolicy("lit-html",{createHTML:o=>o}):void 0,hr="$lit$",J=`lit$${Math.random().toFixed(9).slice(2)}$`,fr="?"+J,bs=`<${fr}>`,ne=document,Oe=()=>ne.createComment(""),Le=o=>o===null||typeof o!="object"&&typeof o!="function",xt=Array.isArray,vs=o=>xt(o)||typeof(o==null?void 0:o[Symbol.iterator])=="function",kt=`[
14
- \f\r]`,De=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,gr=/-->/g,br=/>/g,ae=RegExp(`>|${kt}(?:([^\\s"'>=/]+)(${kt}*=${kt}*(?:[^
15
- \f\r"'\`<>=]|("|')|))|$)`,"g"),vr=/'/g,mr=/"/g,yr=/^(?:script|style|textarea|title)$/i,ms=o=>(r,...s)=>({_$litType$:o,strings:r,values:s}),A=ms(1),ce=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),$r=new WeakMap,le=ne.createTreeWalker(ne,129);function _r(o,r){if(!xt(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return dr!==void 0?dr.createHTML(r):r}const ys=(o,r)=>{const s=o.length-1,i=[];let a,e=r===2?"<svg>":r===3?"<math>":"",u=De;for(let g=0;g<s;g++){const m=o[g];let w,x,S=-1,C=0;for(;C<m.length&&(u.lastIndex=C,x=u.exec(m),x!==null);)C=u.lastIndex,u===De?x[1]==="!--"?u=gr:x[1]!==void 0?u=br:x[2]!==void 0?(yr.test(x[2])&&(a=RegExp("</"+x[2],"g")),u=ae):x[3]!==void 0&&(u=ae):u===ae?x[0]===">"?(u=a??De,S=-1):x[1]===void 0?S=-2:(S=u.lastIndex-x[2].length,w=x[1],u=x[3]===void 0?ae:x[3]==='"'?mr:vr):u===mr||u===vr?u=ae:u===gr||u===br?u=De:(u=ae,a=void 0);const k=u===ae&&o[g+1].startsWith("/>")?" ":"";e+=u===De?m+bs:S>=0?(i.push(w),m.slice(0,S)+hr+m.slice(S)+J+k):m+J+(S===-2?g:k)}return[_r(o,e+(o[s]||"<?>")+(r===2?"</svg>":r===3?"</math>":"")),i]};class Ne{constructor({strings:r,_$litType$:s},i){let a;this.parts=[];let e=0,u=0;const g=r.length-1,m=this.parts,[w,x]=ys(r,s);if(this.el=Ne.createElement(w,i),le.currentNode=this.el.content,s===2||s===3){const S=this.el.content.firstChild;S.replaceWith(...S.childNodes)}for(;(a=le.nextNode())!==null&&m.length<g;){if(a.nodeType===1){if(a.hasAttributes())for(const S of a.getAttributeNames())if(S.endsWith(hr)){const C=x[u++],k=a.getAttribute(S).split(J),N=/([.?@])?(.*)/.exec(C);m.push({type:1,index:e,name:N[2],strings:k,ctor:N[1]==="."?_s:N[1]==="?"?ws:N[1]==="@"?Ss:Ve}),a.removeAttribute(S)}else S.startsWith(J)&&(m.push({type:6,index:e}),a.removeAttribute(S));if(yr.test(a.tagName)){const S=a.textContent.split(J),C=S.length-1;if(C>0){a.textContent=We?We.emptyScript:"";for(let k=0;k<C;k++)a.append(S[k],Oe()),le.nextNode(),m.push({type:2,index:++e});a.append(S[C],Oe())}}}else if(a.nodeType===8)if(a.data===fr)m.push({type:2,index:e});else{let S=-1;for(;(S=a.data.indexOf(J,S+1))!==-1;)m.push({type:7,index:e}),S+=J.length-1}e++}}static createElement(r,s){const i=ne.createElement("template");return i.innerHTML=r,i}}function ge(o,r,s=o,i){var u,g;if(r===ce)return r;let a=i!==void 0?(u=s._$Co)==null?void 0:u[i]:s._$Cl;const e=Le(r)?void 0:r._$litDirective$;return(a==null?void 0:a.constructor)!==e&&((g=a==null?void 0:a._$AO)==null||g.call(a,!1),e===void 0?a=void 0:(a=new e(o),a._$AT(o,s,i)),i!==void 0?(s._$Co??(s._$Co=[]))[i]=a:s._$Cl=a),a!==void 0&&(r=ge(o,a._$AS(o,r.values),a,i)),r}class $s{constructor(r,s){this._$AV=[],this._$AN=void 0,this._$AD=r,this._$AM=s}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(r){const{el:{content:s},parts:i}=this._$AD,a=((r==null?void 0:r.creationScope)??ne).importNode(s,!0);le.currentNode=a;let e=le.nextNode(),u=0,g=0,m=i[0];for(;m!==void 0;){if(u===m.index){let w;m.type===2?w=new je(e,e.nextSibling,this,r):m.type===1?w=new m.ctor(e,m.name,m.strings,this,r):m.type===6&&(w=new As(e,this,r)),this._$AV.push(w),m=i[++g]}u!==(m==null?void 0:m.index)&&(e=le.nextNode(),u++)}return le.currentNode=ne,a}p(r){let s=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(r,i,s),s+=i.strings.length-2):i._$AI(r[s])),s++}}class je{get _$AU(){var r;return((r=this._$AM)==null?void 0:r._$AU)??this._$Cv}constructor(r,s,i,a){this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=r,this._$AB=s,this._$AM=i,this.options=a,this._$Cv=(a==null?void 0:a.isConnected)??!0}get parentNode(){let r=this._$AA.parentNode;const s=this._$AM;return s!==void 0&&(r==null?void 0:r.nodeType)===11&&(r=s.parentNode),r}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(r,s=this){r=ge(this,r,s),Le(r)?r===E||r==null||r===""?(this._$AH!==E&&this._$AR(),this._$AH=E):r!==this._$AH&&r!==ce&&this._(r):r._$litType$!==void 0?this.$(r):r.nodeType!==void 0?this.T(r):vs(r)?this.k(r):this._(r)}O(r){return this._$AA.parentNode.insertBefore(r,this._$AB)}T(r){this._$AH!==r&&(this._$AR(),this._$AH=this.O(r))}_(r){this._$AH!==E&&Le(this._$AH)?this._$AA.nextSibling.data=r:this.T(ne.createTextNode(r)),this._$AH=r}$(r){var e;const{values:s,_$litType$:i}=r,a=typeof i=="number"?this._$AC(r):(i.el===void 0&&(i.el=Ne.createElement(_r(i.h,i.h[0]),this.options)),i);if(((e=this._$AH)==null?void 0:e._$AD)===a)this._$AH.p(s);else{const u=new $s(a,this),g=u.u(this.options);u.p(s),this.T(g),this._$AH=u}}_$AC(r){let s=$r.get(r.strings);return s===void 0&&$r.set(r.strings,s=new Ne(r)),s}k(r){xt(this._$AH)||(this._$AH=[],this._$AR());const s=this._$AH;let i,a=0;for(const e of r)a===s.length?s.push(i=new je(this.O(Oe()),this.O(Oe()),this,this.options)):i=s[a],i._$AI(e),a++;a<s.length&&(this._$AR(i&&i._$AB.nextSibling,a),s.length=a)}_$AR(r=this._$AA.nextSibling,s){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,s);r&&r!==this._$AB;){const a=r.nextSibling;r.remove(),r=a}}setConnected(r){var s;this._$AM===void 0&&(this._$Cv=r,(s=this._$AP)==null||s.call(this,r))}}class Ve{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(r,s,i,a,e){this.type=1,this._$AH=E,this._$AN=void 0,this.element=r,this.name=s,this._$AM=a,this.options=e,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=E}_$AI(r,s=this,i,a){const e=this.strings;let u=!1;if(e===void 0)r=ge(this,r,s,0),u=!Le(r)||r!==this._$AH&&r!==ce,u&&(this._$AH=r);else{const g=r;let m,w;for(r=e[0],m=0;m<e.length-1;m++)w=ge(this,g[i+m],s,m),w===ce&&(w=this._$AH[m]),u||(u=!Le(w)||w!==this._$AH[m]),w===E?r=E:r!==E&&(r+=(w??"")+e[m+1]),this._$AH[m]=w}u&&!a&&this.j(r)}j(r){r===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,r??"")}}class _s extends Ve{constructor(){super(...arguments),this.type=3}j(r){this.element[this.name]=r===E?void 0:r}}class ws extends Ve{constructor(){super(...arguments),this.type=4}j(r){this.element.toggleAttribute(this.name,!!r&&r!==E)}}class Ss extends Ve{constructor(r,s,i,a,e){super(r,s,i,a,e),this.type=5}_$AI(r,s=this){if((r=ge(this,r,s,0)??E)===ce)return;const i=this._$AH,a=r===E&&i!==E||r.capture!==i.capture||r.once!==i.once||r.passive!==i.passive,e=r!==E&&(i===E||a);a&&this.element.removeEventListener(this.name,this,i),e&&this.element.addEventListener(this.name,this,r),this._$AH=r}handleEvent(r){var s;typeof this._$AH=="function"?this._$AH.call(((s=this.options)==null?void 0:s.host)??this.element,r):this._$AH.handleEvent(r)}}class As{constructor(r,s,i){this.element=r,this.type=6,this._$AN=void 0,this._$AM=s,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(r){ge(this,r)}}const Et=Te.litHtmlPolyfillSupport;Et==null||Et(Ne,je),(Te.litHtmlVersions??(Te.litHtmlVersions=[])).push("3.2.1");const Ct=(o,r,s)=>{const i=(s==null?void 0:s.renderBefore)??r;let a=i._$litPart$;if(a===void 0){const e=(s==null?void 0:s.renderBefore)??null;i._$litPart$=a=new je(r.insertBefore(Oe(),e),e,void 0,s??{})}return a._$AI(o),a};/**
13
+ */const Te=globalThis,We=Te.trustedTypes,hr=We?We.createPolicy("lit-html",{createHTML:o=>o}):void 0,fr="$lit$",J=`lit$${Math.random().toFixed(9).slice(2)}$`,gr="?"+J,vs=`<${gr}>`,ne=document,Oe=()=>ne.createComment(""),Le=o=>o===null||typeof o!="object"&&typeof o!="function",kt=Array.isArray,ms=o=>kt(o)||typeof(o==null?void 0:o[Symbol.iterator])=="function",Et=`[
14
+ \f\r]`,De=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,br=/-->/g,vr=/>/g,ae=RegExp(`>|${Et}(?:([^\\s"'>=/]+)(${Et}*=${Et}*(?:[^
15
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),mr=/'/g,yr=/"/g,$r=/^(?:script|style|textarea|title)$/i,ys=o=>(r,...s)=>({_$litType$:o,strings:r,values:s}),A=ys(1),ce=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),_r=new WeakMap,le=ne.createTreeWalker(ne,129);function wr(o,r){if(!kt(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return hr!==void 0?hr.createHTML(r):r}const $s=(o,r)=>{const s=o.length-1,i=[];let a,e=r===2?"<svg>":r===3?"<math>":"",u=De;for(let g=0;g<s;g++){const m=o[g];let w,x,S=-1,C=0;for(;C<m.length&&(u.lastIndex=C,x=u.exec(m),x!==null);)C=u.lastIndex,u===De?x[1]==="!--"?u=br:x[1]!==void 0?u=vr:x[2]!==void 0?($r.test(x[2])&&(a=RegExp("</"+x[2],"g")),u=ae):x[3]!==void 0&&(u=ae):u===ae?x[0]===">"?(u=a??De,S=-1):x[1]===void 0?S=-2:(S=u.lastIndex-x[2].length,w=x[1],u=x[3]===void 0?ae:x[3]==='"'?yr:mr):u===yr||u===mr?u=ae:u===br||u===vr?u=De:(u=ae,a=void 0);const k=u===ae&&o[g+1].startsWith("/>")?" ":"";e+=u===De?m+vs:S>=0?(i.push(w),m.slice(0,S)+fr+m.slice(S)+J+k):m+J+(S===-2?g:k)}return[wr(o,e+(o[s]||"<?>")+(r===2?"</svg>":r===3?"</math>":"")),i]};class Ne{constructor({strings:r,_$litType$:s},i){let a;this.parts=[];let e=0,u=0;const g=r.length-1,m=this.parts,[w,x]=$s(r,s);if(this.el=Ne.createElement(w,i),le.currentNode=this.el.content,s===2||s===3){const S=this.el.content.firstChild;S.replaceWith(...S.childNodes)}for(;(a=le.nextNode())!==null&&m.length<g;){if(a.nodeType===1){if(a.hasAttributes())for(const S of a.getAttributeNames())if(S.endsWith(fr)){const C=x[u++],k=a.getAttribute(S).split(J),N=/([.?@])?(.*)/.exec(C);m.push({type:1,index:e,name:N[2],strings:k,ctor:N[1]==="."?ws:N[1]==="?"?Ss:N[1]==="@"?As:Ve}),a.removeAttribute(S)}else S.startsWith(J)&&(m.push({type:6,index:e}),a.removeAttribute(S));if($r.test(a.tagName)){const S=a.textContent.split(J),C=S.length-1;if(C>0){a.textContent=We?We.emptyScript:"";for(let k=0;k<C;k++)a.append(S[k],Oe()),le.nextNode(),m.push({type:2,index:++e});a.append(S[C],Oe())}}}else if(a.nodeType===8)if(a.data===gr)m.push({type:2,index:e});else{let S=-1;for(;(S=a.data.indexOf(J,S+1))!==-1;)m.push({type:7,index:e}),S+=J.length-1}e++}}static createElement(r,s){const i=ne.createElement("template");return i.innerHTML=r,i}}function ge(o,r,s=o,i){var u,g;if(r===ce)return r;let a=i!==void 0?(u=s._$Co)==null?void 0:u[i]:s._$Cl;const e=Le(r)?void 0:r._$litDirective$;return(a==null?void 0:a.constructor)!==e&&((g=a==null?void 0:a._$AO)==null||g.call(a,!1),e===void 0?a=void 0:(a=new e(o),a._$AT(o,s,i)),i!==void 0?(s._$Co??(s._$Co=[]))[i]=a:s._$Cl=a),a!==void 0&&(r=ge(o,a._$AS(o,r.values),a,i)),r}class _s{constructor(r,s){this._$AV=[],this._$AN=void 0,this._$AD=r,this._$AM=s}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(r){const{el:{content:s},parts:i}=this._$AD,a=((r==null?void 0:r.creationScope)??ne).importNode(s,!0);le.currentNode=a;let e=le.nextNode(),u=0,g=0,m=i[0];for(;m!==void 0;){if(u===m.index){let w;m.type===2?w=new je(e,e.nextSibling,this,r):m.type===1?w=new m.ctor(e,m.name,m.strings,this,r):m.type===6&&(w=new xs(e,this,r)),this._$AV.push(w),m=i[++g]}u!==(m==null?void 0:m.index)&&(e=le.nextNode(),u++)}return le.currentNode=ne,a}p(r){let s=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(r,i,s),s+=i.strings.length-2):i._$AI(r[s])),s++}}class je{get _$AU(){var r;return((r=this._$AM)==null?void 0:r._$AU)??this._$Cv}constructor(r,s,i,a){this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=r,this._$AB=s,this._$AM=i,this.options=a,this._$Cv=(a==null?void 0:a.isConnected)??!0}get parentNode(){let r=this._$AA.parentNode;const s=this._$AM;return s!==void 0&&(r==null?void 0:r.nodeType)===11&&(r=s.parentNode),r}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(r,s=this){r=ge(this,r,s),Le(r)?r===E||r==null||r===""?(this._$AH!==E&&this._$AR(),this._$AH=E):r!==this._$AH&&r!==ce&&this._(r):r._$litType$!==void 0?this.$(r):r.nodeType!==void 0?this.T(r):ms(r)?this.k(r):this._(r)}O(r){return this._$AA.parentNode.insertBefore(r,this._$AB)}T(r){this._$AH!==r&&(this._$AR(),this._$AH=this.O(r))}_(r){this._$AH!==E&&Le(this._$AH)?this._$AA.nextSibling.data=r:this.T(ne.createTextNode(r)),this._$AH=r}$(r){var e;const{values:s,_$litType$:i}=r,a=typeof i=="number"?this._$AC(r):(i.el===void 0&&(i.el=Ne.createElement(wr(i.h,i.h[0]),this.options)),i);if(((e=this._$AH)==null?void 0:e._$AD)===a)this._$AH.p(s);else{const u=new _s(a,this),g=u.u(this.options);u.p(s),this.T(g),this._$AH=u}}_$AC(r){let s=_r.get(r.strings);return s===void 0&&_r.set(r.strings,s=new Ne(r)),s}k(r){kt(this._$AH)||(this._$AH=[],this._$AR());const s=this._$AH;let i,a=0;for(const e of r)a===s.length?s.push(i=new je(this.O(Oe()),this.O(Oe()),this,this.options)):i=s[a],i._$AI(e),a++;a<s.length&&(this._$AR(i&&i._$AB.nextSibling,a),s.length=a)}_$AR(r=this._$AA.nextSibling,s){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,s);r&&r!==this._$AB;){const a=r.nextSibling;r.remove(),r=a}}setConnected(r){var s;this._$AM===void 0&&(this._$Cv=r,(s=this._$AP)==null||s.call(this,r))}}class Ve{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(r,s,i,a,e){this.type=1,this._$AH=E,this._$AN=void 0,this.element=r,this.name=s,this._$AM=a,this.options=e,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=E}_$AI(r,s=this,i,a){const e=this.strings;let u=!1;if(e===void 0)r=ge(this,r,s,0),u=!Le(r)||r!==this._$AH&&r!==ce,u&&(this._$AH=r);else{const g=r;let m,w;for(r=e[0],m=0;m<e.length-1;m++)w=ge(this,g[i+m],s,m),w===ce&&(w=this._$AH[m]),u||(u=!Le(w)||w!==this._$AH[m]),w===E?r=E:r!==E&&(r+=(w??"")+e[m+1]),this._$AH[m]=w}u&&!a&&this.j(r)}j(r){r===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,r??"")}}class ws extends Ve{constructor(){super(...arguments),this.type=3}j(r){this.element[this.name]=r===E?void 0:r}}class Ss extends Ve{constructor(){super(...arguments),this.type=4}j(r){this.element.toggleAttribute(this.name,!!r&&r!==E)}}class As extends Ve{constructor(r,s,i,a,e){super(r,s,i,a,e),this.type=5}_$AI(r,s=this){if((r=ge(this,r,s,0)??E)===ce)return;const i=this._$AH,a=r===E&&i!==E||r.capture!==i.capture||r.once!==i.once||r.passive!==i.passive,e=r!==E&&(i===E||a);a&&this.element.removeEventListener(this.name,this,i),e&&this.element.addEventListener(this.name,this,r),this._$AH=r}handleEvent(r){var s;typeof this._$AH=="function"?this._$AH.call(((s=this.options)==null?void 0:s.host)??this.element,r):this._$AH.handleEvent(r)}}class xs{constructor(r,s,i){this.element=r,this.type=6,this._$AN=void 0,this._$AM=s,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(r){ge(this,r)}}const Ct=Te.litHtmlPolyfillSupport;Ct==null||Ct(Ne,je),(Te.litHtmlVersions??(Te.litHtmlVersions=[])).push("3.2.1");const Pt=(o,r,s)=>{const i=(s==null?void 0:s.renderBefore)??r;let a=i._$litPart$;if(a===void 0){const e=(s==null?void 0:s.renderBefore)??null;i._$litPart$=a=new je(r.insertBefore(Oe(),e),e,void 0,s??{})}return a._$AI(o),a};/**
16
16
  * @license
17
17
  * Copyright 2017 Google LLC
18
18
  * SPDX-License-Identifier: BSD-3-Clause
19
- */let P=class extends fe{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var s;const r=super.createRenderRoot();return(s=this.renderOptions).renderBefore??(s.renderBefore=r.firstChild),r}update(r){const s=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(r),this._$Do=Ct(s,this.renderRoot,this.renderOptions)}connectedCallback(){var r;super.connectedCallback(),(r=this._$Do)==null||r.setConnected(!0)}disconnectedCallback(){var r;super.disconnectedCallback(),(r=this._$Do)==null||r.setConnected(!1)}render(){return ce}};P._$litElement$=!0,P.finalized=!0,(Jr=globalThis.litElementHydrateSupport)==null||Jr.call(globalThis,{LitElement:P});const Pt=globalThis.litElementPolyfillSupport;Pt==null||Pt({LitElement:P}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.1");/**
19
+ */let P=class extends fe{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var s;const r=super.createRenderRoot();return(s=this.renderOptions).renderBefore??(s.renderBefore=r.firstChild),r}update(r){const s=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(r),this._$Do=Pt(s,this.renderRoot,this.renderOptions)}connectedCallback(){var r;super.connectedCallback(),(r=this._$Do)==null||r.setConnected(!0)}disconnectedCallback(){var r;super.disconnectedCallback(),(r=this._$Do)==null||r.setConnected(!1)}render(){return ce}};P._$litElement$=!0,P.finalized=!0,(ei=globalThis.litElementHydrateSupport)==null||ei.call(globalThis,{LitElement:P});const Tt=globalThis.litElementPolyfillSupport;Tt==null||Tt({LitElement:P}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.1");/**
20
20
  * @license
21
21
  * Copyright 2017 Google LLC
22
22
  * SPDX-License-Identifier: BSD-3-Clause
23
- */const wr={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Tt=o=>(...r)=>({_$litDirective$:o,values:r});let Sr=class{constructor(r){}get _$AU(){return this._$AM._$AU}_$AT(r,s,i){this._$Ct=r,this._$AM=s,this._$Ci=i}_$AS(r,s){return this.update(r,s)}update(r,s){return this.render(...s)}};/**
23
+ */const Sr={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Ot=o=>(...r)=>({_$litDirective$:o,values:r});let Ar=class{constructor(r){}get _$AU(){return this._$AM._$AU}_$AT(r,s,i){this._$Ct=r,this._$AM=s,this._$Ci=i}_$AS(r,s){return this.update(r,s)}update(r,s){return this.render(...s)}};/**
24
24
  * @license
25
25
  * Copyright 2018 Google LLC
26
26
  * SPDX-License-Identifier: BSD-3-Clause
27
- */const Ar="important",xs=" !"+Ar,xr=Tt(class extends Sr{constructor(o){var r;if(super(o),o.type!==wr.ATTRIBUTE||o.name!=="style"||((r=o.strings)==null?void 0:r.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(o){return Object.keys(o).reduce((r,s)=>{const i=o[s];return i==null?r:r+`${s=s.includes("-")?s:s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(o,[r]){const{style:s}=o.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(r)),this.render(r);for(const i of this.ft)r[i]==null&&(this.ft.delete(i),i.includes("-")?s.removeProperty(i):s[i]=null);for(const i in r){const a=r[i];if(a!=null){this.ft.add(i);const e=typeof a=="string"&&a.endsWith(xs);i.includes("-")||e?s.setProperty(i,e?a.slice(0,-11):a,e?Ar:""):s[i]=a}}return ce}}),ks=R`
27
+ */const xr="important",ks=" !"+xr,kr=Ot(class extends Ar{constructor(o){var r;if(super(o),o.type!==Sr.ATTRIBUTE||o.name!=="style"||((r=o.strings)==null?void 0:r.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(o){return Object.keys(o).reduce((r,s)=>{const i=o[s];return i==null?r:r+`${s=s.includes("-")?s:s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(o,[r]){const{style:s}=o.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(r)),this.render(r);for(const i of this.ft)r[i]==null&&(this.ft.delete(i),i.includes("-")?s.removeProperty(i):s[i]=null);for(const i in r){const a=r[i];if(a!=null){this.ft.add(i);const e=typeof a=="string"&&a.endsWith(ks);i.includes("-")||e?s.setProperty(i,e?a.slice(0,-11):a,e?xr:""):s[i]=a}}return ce}}),Es=R`
28
28
  :host{
29
29
  display: inline-block;
30
30
  --text-on-color: var(--spectric-text-on-color, #ffffff);
@@ -273,7 +273,7 @@ opacity:1
273
273
  * @license
274
274
  * Copyright 2017 Google LLC
275
275
  * SPDX-License-Identifier: BSD-3-Clause
276
- */const Es={attribute:!0,type:String,converter:qe,reflect:!1,hasChanged:At},Cs=(o=Es,r,s)=>{const{kind:i,metadata:a}=s;let e=globalThis.litPropertyMetadata.get(a);if(e===void 0&&globalThis.litPropertyMetadata.set(a,e=new Map),e.set(s.name,o),i==="accessor"){const{name:u}=s;return{set(g){const m=r.get.call(this);r.set.call(this,g),this.requestUpdate(u,m,o)},init(g){return g!==void 0&&this.P(u,void 0,o),g}}}if(i==="setter"){const{name:u}=s;return function(g){const m=this[u];r.call(this,g),this.requestUpdate(u,m,o)}}throw Error("Unsupported decorator location: "+i)};function v(o){return(r,s)=>typeof s=="object"?Cs(o,r,s):((i,a,e)=>{const u=a.hasOwnProperty(e);return a.constructor.createProperty(e,u?{...i,wrapped:!0}:i),u?Object.getOwnPropertyDescriptor(a,e):void 0})(o,r,s)}/**
276
+ */const Cs={attribute:!0,type:String,converter:qe,reflect:!1,hasChanged:xt},Ps=(o=Cs,r,s)=>{const{kind:i,metadata:a}=s;let e=globalThis.litPropertyMetadata.get(a);if(e===void 0&&globalThis.litPropertyMetadata.set(a,e=new Map),e.set(s.name,o),i==="accessor"){const{name:u}=s;return{set(g){const m=r.get.call(this);r.set.call(this,g),this.requestUpdate(u,m,o)},init(g){return g!==void 0&&this.P(u,void 0,o),g}}}if(i==="setter"){const{name:u}=s;return function(g){const m=this[u];r.call(this,g),this.requestUpdate(u,m,o)}}throw Error("Unsupported decorator location: "+i)};function v(o){return(r,s)=>typeof s=="object"?Ps(o,r,s):((i,a,e)=>{const u=a.hasOwnProperty(e);return a.constructor.createProperty(e,u?{...i,wrapped:!0}:i),u?Object.getOwnPropertyDescriptor(a,e):void 0})(o,r,s)}/**
277
277
  * @license
278
278
  * Copyright 2017 Google LLC
279
279
  * SPDX-License-Identifier: BSD-3-Clause
@@ -281,38 +281,38 @@ opacity:1
281
281
  * @license
282
282
  * Copyright 2017 Google LLC
283
283
  * SPDX-License-Identifier: BSD-3-Clause
284
- */const kr=(o,r,s)=>(s.configurable=!0,s.enumerable=!0,Reflect.decorate&&typeof r!="object"&&Object.defineProperty(o,r,s),s);/**
284
+ */const Er=(o,r,s)=>(s.configurable=!0,s.enumerable=!0,Reflect.decorate&&typeof r!="object"&&Object.defineProperty(o,r,s),s);/**
285
285
  * @license
286
286
  * Copyright 2017 Google LLC
287
287
  * SPDX-License-Identifier: BSD-3-Clause
288
- */function be(o,r){return(s,i,a)=>{const e=u=>{var g;return((g=u.renderRoot)==null?void 0:g.querySelector(o))??null};return kr(s,i,{get(){return e(this)}})}}/**
288
+ */function be(o,r){return(s,i,a)=>{const e=u=>{var g;return((g=u.renderRoot)==null?void 0:g.querySelector(o))??null};return Er(s,i,{get(){return e(this)}})}}/**
289
289
  * @license
290
290
  * Copyright 2017 Google LLC
291
291
  * SPDX-License-Identifier: BSD-3-Clause
292
- */function Ye(o){return(r,s)=>kr(r,s,{async get(){var i;return await this.updateComplete,((i=this.renderRoot)==null?void 0:i.querySelector(o))??null}})}var Ps=Object.defineProperty,Ts=Object.getOwnPropertyDescriptor,I=(o,r,s,i)=>{for(var a=i>1?void 0:i?Ts(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&Ps(r,s,a),a},Er=(o=>(o.large="large",o.medium="medium",o.small="small",o.xsmall="xsmall",o.xxsmall="xxsmall",o.tiny="tiny",o))(Er||{}),Cr=(o=>(o.primary="primary",o.secondary="secondary",o.text="text",o))(Cr||{});const Os={primary:"spectric-button--primary",secondary:"spectric-button--secondary",text:"spectric-button--text"};d.SpectricButton=class extends P{constructor(){super(...arguments),this.variant="primary",this.disabled=!1,this.size="small",this.label="",this.danger=!1,this.icon=!1,this.tooltipPosition="right",this._onClick=r=>{if(r instanceof CustomEvent||(r.preventDefault(),r.stopImmediatePropagation(),r.stopPropagation(),this.disabled))return;const s={bubbles:!0,composed:!0,detail:r};this.dispatchEvent(new CustomEvent("click",s))}}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this._onClick,{capture:!0})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this._onClick)}render(){const r=Os[this.variant]||"spectric-button--primary";return A`
292
+ */function Ye(o){return(r,s)=>Er(r,s,{async get(){var i;return await this.updateComplete,((i=this.renderRoot)==null?void 0:i.querySelector(o))??null}})}var Ts=Object.defineProperty,Os=Object.getOwnPropertyDescriptor,I=(o,r,s,i)=>{for(var a=i>1?void 0:i?Os(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&Ts(r,s,a),a},Cr=(o=>(o.large="large",o.medium="medium",o.small="small",o.xsmall="xsmall",o.xxsmall="xxsmall",o.tiny="tiny",o))(Cr||{}),Pr=(o=>(o.primary="primary",o.secondary="secondary",o.text="text",o))(Pr||{});const Ls={primary:"spectric-button--primary",secondary:"spectric-button--secondary",text:"spectric-button--text"};d.SpectricButton=class extends P{constructor(){super(...arguments),this.variant="primary",this.disabled=!1,this.size="small",this.label="",this.danger=!1,this.icon=!1,this.tooltipPosition="right",this._onClick=r=>{if(r instanceof CustomEvent||(r.preventDefault(),r.stopImmediatePropagation(),r.stopPropagation(),this.disabled))return;const s={bubbles:!0,composed:!0,detail:r};this.dispatchEvent(new CustomEvent("click",s))}}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this._onClick,{capture:!0})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this._onClick)}render(){const r=Ls[this.variant]||"spectric-button--primary";return A`
293
293
  ${this.tooltip?A`<spectric-tooltip .text=${this.tooltip} .position=${this.tooltipPosition||"right"} .triggerTarget=${this}></spectric-tooltip>`:null}
294
294
  <button
295
295
  type="button"
296
296
  ?disabled=${this.disabled}
297
297
  class=${["spectric-button",`spectric-button-danger--${this.danger||!1}`,`spectric-button--${this.size||"medium"}`,r].join(" ")}
298
- style=${xr({backgroundColor:this.backgroundColor})}
298
+ style=${kr({backgroundColor:this.backgroundColor})}
299
299
  >
300
300
  <span class="animation"></span>
301
301
  <slot>${this.label}</slot>
302
302
  </button>
303
- `}},d.SpectricButton.styles=ks,I([v({type:String,reflect:!0})],d.SpectricButton.prototype,"variant",2),I([v({type:Boolean,reflect:!0})],d.SpectricButton.prototype,"disabled",2),I([v({type:String,reflect:!0})],d.SpectricButton.prototype,"backgroundColor",2),I([v({type:String,reflect:!0})],d.SpectricButton.prototype,"size",2),I([v({type:String,reflect:!0})],d.SpectricButton.prototype,"label",2),I([v({type:Boolean,reflect:!0})],d.SpectricButton.prototype,"danger",2),I([v({type:Boolean,reflect:!0})],d.SpectricButton.prototype,"icon",2),I([v({type:String,reflect:!0})],d.SpectricButton.prototype,"tooltip",2),I([v({type:String,reflect:!0})],d.SpectricButton.prototype,"tooltipPosition",2),d.SpectricButton=I([L("spectric-button")],d.SpectricButton);/**
303
+ `}},d.SpectricButton.styles=Es,I([v({type:String,reflect:!0})],d.SpectricButton.prototype,"variant",2),I([v({type:Boolean,reflect:!0})],d.SpectricButton.prototype,"disabled",2),I([v({type:String,reflect:!0})],d.SpectricButton.prototype,"backgroundColor",2),I([v({type:String,reflect:!0})],d.SpectricButton.prototype,"size",2),I([v({type:String,reflect:!0})],d.SpectricButton.prototype,"label",2),I([v({type:Boolean,reflect:!0})],d.SpectricButton.prototype,"danger",2),I([v({type:Boolean,reflect:!0})],d.SpectricButton.prototype,"icon",2),I([v({type:String,reflect:!0})],d.SpectricButton.prototype,"tooltip",2),I([v({type:String,reflect:!0})],d.SpectricButton.prototype,"tooltipPosition",2),d.SpectricButton=I([L("spectric-button")],d.SpectricButton);/**
304
304
  * @license
305
305
  * Copyright 2020 Google LLC
306
306
  * SPDX-License-Identifier: BSD-3-Clause
307
- */const Ls=o=>o.strings===void 0;/**
307
+ */const Ds=o=>o.strings===void 0;/**
308
308
  * @license
309
309
  * Copyright 2017 Google LLC
310
310
  * SPDX-License-Identifier: BSD-3-Clause
311
- */const Be=(o,r)=>{var i;const s=o._$AN;if(s===void 0)return!1;for(const a of s)(i=a._$AO)==null||i.call(a,r,!1),Be(a,r);return!0},Ke=o=>{let r,s;do{if((r=o._$AM)===void 0)break;s=r._$AN,s.delete(o),o=r}while((s==null?void 0:s.size)===0)},Pr=o=>{for(let r;r=o._$AM;o=r){let s=r._$AN;if(s===void 0)r._$AN=s=new Set;else if(s.has(o))break;s.add(o),js(r)}};function Ds(o){this._$AN!==void 0?(Ke(this),this._$AM=o,Pr(this)):this._$AM=o}function Ns(o,r=!1,s=0){const i=this._$AH,a=this._$AN;if(a!==void 0&&a.size!==0)if(r)if(Array.isArray(i))for(let e=s;e<i.length;e++)Be(i[e],!1),Ke(i[e]);else i!=null&&(Be(i,!1),Ke(i));else Be(this,o)}const js=o=>{o.type==wr.CHILD&&(o._$AP??(o._$AP=Ns),o._$AQ??(o._$AQ=Ds))};class Tr extends Sr{constructor(){super(...arguments),this._$AN=void 0}_$AT(r,s,i){super._$AT(r,s,i),Pr(this),this.isConnected=r._$AU}_$AO(r,s=!0){var i,a;r!==this.isConnected&&(this.isConnected=r,r?(i=this.reconnected)==null||i.call(this):(a=this.disconnected)==null||a.call(this)),s&&(Be(this,r),Ke(this))}setValue(r){if(Ls(this._$Ct))this._$Ct._$AI(r,this);else{const s=[...this._$Ct._$AH];s[this._$Ci]=r,this._$Ct._$AI(s,this,0)}}disconnected(){}reconnected(){}}/**
311
+ */const Be=(o,r)=>{var i;const s=o._$AN;if(s===void 0)return!1;for(const a of s)(i=a._$AO)==null||i.call(a,r,!1),Be(a,r);return!0},Ke=o=>{let r,s;do{if((r=o._$AM)===void 0)break;s=r._$AN,s.delete(o),o=r}while((s==null?void 0:s.size)===0)},Tr=o=>{for(let r;r=o._$AM;o=r){let s=r._$AN;if(s===void 0)r._$AN=s=new Set;else if(s.has(o))break;s.add(o),zs(r)}};function Ns(o){this._$AN!==void 0?(Ke(this),this._$AM=o,Tr(this)):this._$AM=o}function js(o,r=!1,s=0){const i=this._$AH,a=this._$AN;if(a!==void 0&&a.size!==0)if(r)if(Array.isArray(i))for(let e=s;e<i.length;e++)Be(i[e],!1),Ke(i[e]);else i!=null&&(Be(i,!1),Ke(i));else Be(this,o)}const zs=o=>{o.type==Sr.CHILD&&(o._$AP??(o._$AP=js),o._$AQ??(o._$AQ=Ns))};class Or extends Ar{constructor(){super(...arguments),this._$AN=void 0}_$AT(r,s,i){super._$AT(r,s,i),Tr(this),this.isConnected=r._$AU}_$AO(r,s=!0){var i,a;r!==this.isConnected&&(this.isConnected=r,r?(i=this.reconnected)==null||i.call(this):(a=this.disconnected)==null||a.call(this)),s&&(Be(this,r),Ke(this))}setValue(r){if(Ds(this._$Ct))this._$Ct._$AI(r,this);else{const s=[...this._$Ct._$AH];s[this._$Ci]=r,this._$Ct._$AI(s,this,0)}}disconnected(){}reconnected(){}}/**
312
312
  * @license
313
313
  * Copyright 2020 Google LLC
314
314
  * SPDX-License-Identifier: BSD-3-Clause
315
- */const Ze=()=>new zs;class zs{}const Ot=new WeakMap,Xe=Tt(class extends Tr{render(o){return E}update(o,[r]){var i;const s=r!==this.Y;return s&&this.Y!==void 0&&this.rt(void 0),(s||this.lt!==this.ct)&&(this.Y=r,this.ht=(i=o.options)==null?void 0:i.host,this.rt(this.ct=o.element)),E}rt(o){if(this.isConnected||(o=void 0),typeof this.Y=="function"){const r=this.ht??globalThis;let s=Ot.get(r);s===void 0&&(s=new WeakMap,Ot.set(r,s)),s.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),s.set(this.Y,o),o!==void 0&&this.Y.call(this.ht,o)}else this.Y.value=o}get lt(){var o,r;return typeof this.Y=="function"?(o=Ot.get(this.ht??globalThis))==null?void 0:o.get(this.Y):(r=this.Y)==null?void 0:r.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),Bs=class{constructor(r){return this.buffer=r,this.u8=new Uint8Array(r),new Proxy(this,{get(s,i){return s[i]?s[i]:s.getBit(i)}})}getBit(r){var s=this.u8[r>>3],i=r&7;return s>>7-i&1}setBit(r,s){var i=r&7;s?this.u8[r>>3]|=128>>i:this.u8[r>>3]&=~(128>>i)}get length(){return this.u8.byteLength*8}set(r,s){for(let i=s||0,a=0,e=r.length;a<e;i++,a++)this.setBit(i,r[a])}subarray(r,s){let i=[];r=r||0,s=s||this.length,s=s>this.length?this.length:s;for(let a=r;a<s;a++)i.push(this.getBit(a));return i}};class Or{constructor(r,s,i,a){this.__target=r,this._handler=i,this._type=s,this._handler=i,this._options=a||!1,r instanceof Promise?r.then(e=>{this._handler&&(this._node=e,this._node.addEventListener(this._type,this._handler,this._options))}):(this._node=r,this._node.addEventListener(this._type,this._handler,this._options))}dispose(){this._handler&&(this._node&&(console.log(`removing event ${this._type} from `,this._node,this.__target instanceof Promise),this._node.removeEventListener(this._type,this._handler,this._options)),this.__target=void 0,this._node=void 0,this._handler=void 0)}}class Lr extends P{constructor(){super(...arguments),this._disposables=new Set,this._isDisposed=!1,this._disposableListeners=[],this._connected=!1}addDisposableListener(r,s,i){if(this._disposableListeners.find(e=>e.event===s&&e.target===r&&e.handler===i)){console.warn("Event handler already exists best practice is to add the this in the constructor");return}this._disposableListeners.push({target:r,event:s,handler:i}),this._connected&&this.registerDisposable(new Or(r,s,i))}registerDisposable(r){if(!r)return r;if(r===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?console.warn(new Error("Trying to add a disposable to something that has already been disposed of. The added object will be leaked!").stack):this._disposables.add(r),r}connectedCallback(){super.connectedCallback(),this._connected=!0,this._isDisposed=!1,this._disposableListeners.forEach(({target:r,event:s,handler:i})=>{this.registerDisposable(new Or(r,s,i))})}disconnectedCallback(){super.disconnectedCallback(),this._connected=!1,this._disposables.forEach(r=>{r.dispose()}),this._isDisposed=!0}}const Dr=o=>{var r;return(...s)=>{r&&cancelAnimationFrame(r),r=requestAnimationFrame(()=>{o.apply(void 0,s)})}};var Rs=Object.defineProperty,Ms=Object.getOwnPropertyDescriptor,pe=(o,r,s,i)=>{for(var a=i>1?void 0:i?Ms(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&Rs(r,s,a),a};const Us=["mousemove","click","dblclick","mousedown","mouseup","contextmenu"],Ge={width:200,height:200},Je={width:10,height:10};d.BitDisplayCanvas=class extends Lr{constructor(){super(),this.arrayBuffer=new ArrayBuffer(0),this.frameWidth=100,this.scale=1,this.width=200,this.height=200,this.state={},this.yStart=0,this.xStart=0,this.refs={viewport:Ze(),canvas:Ze(),scrollDiv:Ze()},this.color="#000000",this.onThemeChange=()=>{let i=getComputedStyle(this);this.color!=i.color&&(this.color=i.color,this.paint())},this.onResize=()=>{this.calculateViewport()},this.handleScroll=()=>{if(!this.refs.viewport.value)return;const i=this.getPxPerBit();this.yStart=this.refs.viewport.value.scrollTop?Math.floor(this.refs.viewport.value.scrollTop/i)+1:0,this.xStart=this.refs.viewport.value.scrollLeft?Math.floor(this.refs.viewport.value.scrollLeft/i)+1:0,this.paint()};let r=new ResizeObserver(this.onResize);r.dispose=()=>{this.resizeObserver.disconnect()},this.resizeObserver=r,this.addDisposableListener(document.body,"theme-change",this.onThemeChange);var s={};Us.forEach(i=>{this.addDisposableListener(this._canvas,i,Dr(async a=>{a.stopImmediatePropagation(),a.stopPropagation(),a.preventDefault();var e=await this._canvas;let u=e.getBoundingClientRect(),g={x:Math.floor(Math.abs(a.clientX-u.left)),y:Math.floor(Math.abs(a.clientY-u.top))},m=this.canvasPositionToBit(g);if(i==="mousemove"&&s[i]==m)return;s[i]=m;let w="bit"+String(i).charAt(0).toUpperCase()+String(i).slice(1);if(m!=-1){let x=new CustomEvent(w,{detail:{bitIndex:m,position:g,nativeEvent:a}});this.dispatchEvent(x)}}))})}connectedCallback(){this.onResize(),super.connectedCallback(),this.registerDisposable(this.resizeObserver),this.resizeObserver.observe(this)}updated(r){r.has("arrayBuffer")&&this.arrayBuffer&&(this._bitArray=new Bs(this.arrayBuffer));const s=["arrayBuffer","scale","frameWidth","width","height"];for(const i of s)if(r.has(i)){this.paint();return}}canvasPositionToBit(r){let s=Math.floor(r.x/this.scale),i=Math.floor(r.y/this.scale);return s>this.frameWidth-1?-1:this.yStart*this.frameWidth+this.xStart+(i*this.frameWidth+s)}paint(){if(!this.refs.canvas.value||!this._bitArray)return;const{frameWidth:r,_bitArray:s}=this;if(r<=0)return;this.calculateViewport();const{width:i=Ge.width,height:a=Ge.height}=this,e=this.getPxPerBit(),u=this.refs.canvas.value.getContext("2d");if(!u)return;this.state.scale!=e&&(u.reset(),u.scale(e,e));let g=getComputedStyle(this);u.fillStyle=g.color,u.clearRect(0,0,i,a);let m=0;for(let w=this.yStart*r+this.xStart,x=s.length;w<x;w++){let S=w%r-this.xStart;if(!(S<0)){if(Math.floor(S*e)>i){m++,w=m*r+this.yStart*r+this.xStart-1;continue}if(Math.floor(m*e)>a)break;s.getBit(w)===1&&u.fillRect(S,m,1,1),(w+1)%r===0&&w>=r-1&&m++}}}getPxPerBit(){return this.scale>0?this.scale:1}calculateViewport(){const{frameWidth:r,_bitArray:s}=this;if(this.refs.scrollDiv.value){var i=this.getPxPerBit();const a=s.length/r*i,e=r*i,u=this.refs.scrollDiv.value;u.style.width=e+"px",u.style.height=a+"px"}}render(){const{height:r=Ge.height,width:s=Ge.width}=this;return A`
315
+ */const Ze=()=>new Bs;class Bs{}const Lt=new WeakMap,Xe=Ot(class extends Or{render(o){return E}update(o,[r]){var i;const s=r!==this.Y;return s&&this.Y!==void 0&&this.rt(void 0),(s||this.lt!==this.ct)&&(this.Y=r,this.ht=(i=o.options)==null?void 0:i.host,this.rt(this.ct=o.element)),E}rt(o){if(this.isConnected||(o=void 0),typeof this.Y=="function"){const r=this.ht??globalThis;let s=Lt.get(r);s===void 0&&(s=new WeakMap,Lt.set(r,s)),s.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),s.set(this.Y,o),o!==void 0&&this.Y.call(this.ht,o)}else this.Y.value=o}get lt(){var o,r;return typeof this.Y=="function"?(o=Lt.get(this.ht??globalThis))==null?void 0:o.get(this.Y):(r=this.Y)==null?void 0:r.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),Rs=class{constructor(r){return this.buffer=r,this.u8=new Uint8Array(r),new Proxy(this,{get(s,i){return s[i]?s[i]:s.getBit(i)}})}getBit(r){var s=this.u8[r>>3],i=r&7;return s>>7-i&1}setBit(r,s){var i=r&7;s?this.u8[r>>3]|=128>>i:this.u8[r>>3]&=~(128>>i)}get length(){return this.u8.byteLength*8}set(r,s){for(let i=s||0,a=0,e=r.length;a<e;i++,a++)this.setBit(i,r[a])}subarray(r,s){let i=[];r=r||0,s=s||this.length,s=s>this.length?this.length:s;for(let a=r;a<s;a++)i.push(this.getBit(a));return i}};class Lr{constructor(r,s,i,a){this.__target=r,this._handler=i,this._type=s,this._handler=i,this._options=a||!1,r instanceof Promise?r.then(e=>{this._handler&&(this._node=e,this._node.addEventListener(this._type,this._handler,this._options))}):(this._node=r,this._node.addEventListener(this._type,this._handler,this._options))}dispose(){this._handler&&(this._node&&(console.log(`removing event ${this._type} from `,this._node,this.__target instanceof Promise),this._node.removeEventListener(this._type,this._handler,this._options)),this.__target=void 0,this._node=void 0,this._handler=void 0)}}class Dr extends P{constructor(){super(...arguments),this._disposables=new Set,this._isDisposed=!1,this._disposableListeners=[],this._connected=!1}addDisposableListener(r,s,i){if(this._disposableListeners.find(e=>e.event===s&&e.target===r&&e.handler===i)){console.warn("Event handler already exists best practice is to add the this in the constructor");return}this._disposableListeners.push({target:r,event:s,handler:i}),this._connected&&this.registerDisposable(new Lr(r,s,i))}registerDisposable(r){if(!r)return r;if(r===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?console.warn(new Error("Trying to add a disposable to something that has already been disposed of. The added object will be leaked!").stack):this._disposables.add(r),r}connectedCallback(){super.connectedCallback(),this._connected=!0,this._isDisposed=!1,this._disposableListeners.forEach(({target:r,event:s,handler:i})=>{this.registerDisposable(new Lr(r,s,i))})}disconnectedCallback(){super.disconnectedCallback(),this._connected=!1,this._disposables.forEach(r=>{r.dispose()}),this._isDisposed=!0}}const Nr=o=>{var r;return(...s)=>{r&&cancelAnimationFrame(r),r=requestAnimationFrame(()=>{o.apply(void 0,s)})}};var Ms=Object.defineProperty,Us=Object.getOwnPropertyDescriptor,pe=(o,r,s,i)=>{for(var a=i>1?void 0:i?Us(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&Ms(r,s,a),a};const Is=["mousemove","click","dblclick","mousedown","mouseup","contextmenu"],Ge={width:200,height:200},Je={width:10,height:10};d.BitDisplayCanvas=class extends Dr{constructor(){super(),this.arrayBuffer=new ArrayBuffer(0),this.frameWidth=100,this.scale=1,this.width=200,this.height=200,this.state={},this.yStart=0,this.xStart=0,this.refs={viewport:Ze(),canvas:Ze(),scrollDiv:Ze()},this.color="#000000",this.onThemeChange=()=>{let i=getComputedStyle(this);this.color!=i.color&&(this.color=i.color,this.paint())},this.onResize=()=>{this.calculateViewport()},this.handleScroll=()=>{if(!this.refs.viewport.value)return;const i=this.getPxPerBit();this.yStart=this.refs.viewport.value.scrollTop?Math.floor(this.refs.viewport.value.scrollTop/i)+1:0,this.xStart=this.refs.viewport.value.scrollLeft?Math.floor(this.refs.viewport.value.scrollLeft/i)+1:0,this.paint()};let r=new ResizeObserver(this.onResize);r.dispose=()=>{this.resizeObserver.disconnect()},this.resizeObserver=r,this.addDisposableListener(document.body,"theme-change",this.onThemeChange);var s={};Is.forEach(i=>{this.addDisposableListener(this._canvas,i,Nr(async a=>{a.stopImmediatePropagation(),a.stopPropagation(),a.preventDefault();var e=await this._canvas;let u=e.getBoundingClientRect(),g={x:Math.floor(Math.abs(a.clientX-u.left)),y:Math.floor(Math.abs(a.clientY-u.top))},m=this.canvasPositionToBit(g);if(i==="mousemove"&&s[i]==m)return;s[i]=m;let w="bit"+String(i).charAt(0).toUpperCase()+String(i).slice(1);if(m!=-1){let x=new CustomEvent(w,{detail:{bitIndex:m,position:g,nativeEvent:a}});this.dispatchEvent(x)}}))})}connectedCallback(){this.onResize(),super.connectedCallback(),this.registerDisposable(this.resizeObserver),this.resizeObserver.observe(this)}updated(r){r.has("arrayBuffer")&&this.arrayBuffer&&(this._bitArray=new Rs(this.arrayBuffer));const s=["arrayBuffer","scale","frameWidth","width","height"];for(const i of s)if(r.has(i)){this.paint();return}}canvasPositionToBit(r){let s=Math.floor(r.x/this.scale),i=Math.floor(r.y/this.scale);return s>this.frameWidth-1?-1:this.yStart*this.frameWidth+this.xStart+(i*this.frameWidth+s)}paint(){if(!this.refs.canvas.value||!this._bitArray)return;const{frameWidth:r,_bitArray:s}=this;if(r<=0)return;this.calculateViewport();const{width:i=Ge.width,height:a=Ge.height}=this,e=this.getPxPerBit(),u=this.refs.canvas.value.getContext("2d");if(!u)return;this.state.scale!=e&&(u.reset(),u.scale(e,e));let g=getComputedStyle(this);u.fillStyle=g.color,u.clearRect(0,0,i,a);let m=0;for(let w=this.yStart*r+this.xStart,x=s.length;w<x;w++){let S=w%r-this.xStart;if(!(S<0)){if(Math.floor(S*e)>i){m++,w=m*r+this.yStart*r+this.xStart-1;continue}if(Math.floor(m*e)>a)break;s.getBit(w)===1&&u.fillRect(S,m,1,1),(w+1)%r===0&&w>=r-1&&m++}}}getPxPerBit(){return this.scale>0?this.scale:1}calculateViewport(){const{frameWidth:r,_bitArray:s}=this;if(this.refs.scrollDiv.value){var i=this.getPxPerBit();const a=s.length/r*i,e=r*i,u=this.refs.scrollDiv.value;u.style.width=e+"px",u.style.height=a+"px"}}render(){const{height:r=Ge.height,width:s=Ge.width}=this;return A`
316
316
  <div
317
317
  id="viewport"
318
318
  ${Xe(this.refs.viewport)}
@@ -426,7 +426,7 @@ opacity:1
426
426
 
427
427
  }
428
428
 
429
- `,pe([v({type:Object,attribute:!1})],d.BitDisplayCanvas.prototype,"arrayBuffer",2),pe([v({type:Number})],d.BitDisplayCanvas.prototype,"frameWidth",2),pe([v({type:Number})],d.BitDisplayCanvas.prototype,"scale",2),pe([v({type:Number})],d.BitDisplayCanvas.prototype,"width",2),pe([v({type:Number})],d.BitDisplayCanvas.prototype,"height",2),pe([Ye("canvas")],d.BitDisplayCanvas.prototype,"_canvas",2),d.BitDisplayCanvas=pe([L("spectric-bit-display")],d.BitDisplayCanvas);const Is=R`.spectric-header {
429
+ `,pe([v({type:Object,attribute:!1})],d.BitDisplayCanvas.prototype,"arrayBuffer",2),pe([v({type:Number})],d.BitDisplayCanvas.prototype,"frameWidth",2),pe([v({type:Number})],d.BitDisplayCanvas.prototype,"scale",2),pe([v({type:Number})],d.BitDisplayCanvas.prototype,"width",2),pe([v({type:Number})],d.BitDisplayCanvas.prototype,"height",2),pe([Ye("canvas")],d.BitDisplayCanvas.prototype,"_canvas",2),d.BitDisplayCanvas=pe([L("spectric-bit-display")],d.BitDisplayCanvas);const Fs=R`.spectric-header {
430
430
  display: flex;
431
431
  justify-content: space-between;
432
432
  align-items: center;
@@ -461,7 +461,7 @@ opacity:1
461
461
  color: #333;
462
462
  font-size: 14px;
463
463
  }
464
- `;var Fs=Object.defineProperty,Qs=Object.getOwnPropertyDescriptor,et=(o,r,s,i)=>{for(var a=i>1?void 0:i?Qs(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&Fs(r,s,a),a};d.Header=class extends P{constructor(){super(...arguments),this.showCreateAccount=!1,this.showLoginButton=!1,this.username="",this.onLogout=()=>{const r={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("logout",r))},this.onLogin=()=>{const r={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("login",r))},this.onCreateAccount=()=>{const r={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("createAccount",r))}}render(){return A`
464
+ `;var Qs=Object.defineProperty,Hs=Object.getOwnPropertyDescriptor,et=(o,r,s,i)=>{for(var a=i>1?void 0:i?Hs(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&Qs(r,s,a),a};d.Header=class extends P{constructor(){super(...arguments),this.showCreateAccount=!1,this.showLoginButton=!1,this.username="",this.onLogout=()=>{const r={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("logout",r))},this.onLogin=()=>{const r={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("login",r))},this.onCreateAccount=()=>{const r={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("createAccount",r))}}render(){return A`
465
465
  <header>
466
466
  <div class="spectric-header">
467
467
  <div style="flex-grow:1;">
@@ -480,12 +480,12 @@ opacity:1
480
480
  <slot name="end"></slot>
481
481
  </div>
482
482
  </header>
483
- `}},d.Header.styles=Is,et([v({type:Boolean,reflect:!0})],d.Header.prototype,"showCreateAccount",2),et([v({type:Boolean,reflect:!0})],d.Header.prototype,"showLoginButton",2),et([v({type:String,reflect:!0})],d.Header.prototype,"username",2),d.Header=et([L("spectric-header")],d.Header);var Hs=Object.defineProperty,qs=Object.getOwnPropertyDescriptor,ve=(o,r,s,i)=>{for(var a=i>1?void 0:i?qs(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&Hs(r,s,a),a};const Ws={display:"flex",alignItems:"center",backgroundColor:"black",color:"white",textAlign:"center"};let ue=class extends P{constructor(){super(...arguments),this.dismissable=!1,this.text="",this.bannerId="",this.headerStyle={},this._dismissed=!1,this.onDismiss=o=>{o.preventDefault(),o.stopPropagation();const r={bubbles:!0,composed:!0};this._dismissed=!0;let{bannerId:s,text:i,headerStyle:a,dismissable:e}=this;this.dispatchEvent(new CustomEvent("bannerDismissed",{detail:{bannerId:s,text:i,headerStyle:a,dismissable:e},...r}))}}render(){if(!this._dismissed)return A`
484
- <header style=${xr({...Ws,...this.headerStyle})}>
483
+ `}},d.Header.styles=Fs,et([v({type:Boolean,reflect:!0})],d.Header.prototype,"showCreateAccount",2),et([v({type:Boolean,reflect:!0})],d.Header.prototype,"showLoginButton",2),et([v({type:String,reflect:!0})],d.Header.prototype,"username",2),d.Header=et([L("spectric-header")],d.Header);var qs=Object.defineProperty,Ws=Object.getOwnPropertyDescriptor,ve=(o,r,s,i)=>{for(var a=i>1?void 0:i?Ws(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&qs(r,s,a),a};const Vs={display:"flex",alignItems:"center",backgroundColor:"black",color:"white",textAlign:"center"};let ue=class extends P{constructor(){super(...arguments),this.dismissable=!1,this.text="",this.bannerId="",this.headerStyle={},this._dismissed=!1,this.onDismiss=o=>{o.preventDefault(),o.stopPropagation();const r={bubbles:!0,composed:!0};this._dismissed=!0;let{bannerId:s,text:i,headerStyle:a,dismissable:e}=this;this.dispatchEvent(new CustomEvent("bannerDismissed",{detail:{bannerId:s,text:i,headerStyle:a,dismissable:e},...r}))}}render(){if(!this._dismissed)return A`
484
+ <header style=${kr({...Vs,...this.headerStyle})}>
485
485
  <div style="flex-grow:1"><slot name="text">${this.text}</slot><slot></slot></div>
486
486
  ${this.dismissable?A`<spectric-button size="small" @click=${this.onDismiss}>X</spectric-button>`:null}
487
487
  </header>
488
- `}};ve([v({type:Boolean,reflect:!0})],ue.prototype,"dismissable",2),ve([v({type:String,reflect:!0})],ue.prototype,"text",2),ve([v({type:String,reflect:!0})],ue.prototype,"bannerId",2),ve([v({type:Object})],ue.prototype,"headerStyle",2),ve([v({state:!0,type:Boolean,attribute:!1})],ue.prototype,"_dismissed",2),ue=ve([L("spectric-banner")],ue);const Vs=R`
488
+ `}};ve([v({type:Boolean,reflect:!0})],ue.prototype,"dismissable",2),ve([v({type:String,reflect:!0})],ue.prototype,"text",2),ve([v({type:String,reflect:!0})],ue.prototype,"bannerId",2),ve([v({type:Object})],ue.prototype,"headerStyle",2),ve([v({state:!0,type:Boolean,attribute:!1})],ue.prototype,"_dismissed",2),ue=ve([L("spectric-banner")],ue);const Ys=R`
489
489
 
490
490
  :host {
491
491
  height:100vh;
@@ -645,7 +645,7 @@ article{
645
645
  * @license
646
646
  * Copyright 2018 Google LLC
647
647
  * SPDX-License-Identifier: BSD-3-Clause
648
- */const Lt=o=>o??E;class Ys extends Tr{constructor(){super(...arguments),this.prevData={}}render(r){return E}update(r,[s]){var i;this.element!==r.element&&(this.element=r.element),this.host=((i=r.options)==null?void 0:i.host)||this.element,this.apply(s),this.groom(s),this.prevData={...s}}apply(r){if(!r)return;const{prevData:s,element:i}=this;for(const a in r){const e=r[a];e!==s[a]&&(i[a]=e)}}groom(r){const{prevData:s,element:i}=this;if(s)for(const a in s)(!r||!(a in r)&&i[a]===s[a])&&(i[a]=void 0)}}const tt=Tt(Ys);var Dt=(o=>(o.None="none",o.Uscui="us.cui",o.Usclassified="us.classified",o.Usunclassified="us.unclassified",o.Usconfidential="us.confidential",o.Ussecret="us.secret",o.Ustopsecret="us.topsecret",o.UstopsecretSi="us.topsecret.si",o.Uknotset="uk.notset",o.Ukofficial="uk.official",o.Uksecret="uk.secret",o.Uktopsecret="uk.topsecret",o.Caprotected_a="ca.protected_a",o.Caprotected_b="ca.protected_b",o.Caprotected_c="ca.protected_c",o.Caconfidential="ca.confidential",o.Casecret="ca.secret",o.Catopsecret="ca.topsecret",o.Auunofficial="au.unofficial",o.Auofficial="au.official",o.Auofficialsensitive="au.officialsensitive",o.Auconfidential="au.confidential",o.Ausecret="au.secret",o.Autopsecret="au.topsecret",o))(Dt||{});const rt={none:{},"us.cui":{color:"white",backgroundColor:"#3D1E5A",content:"Controlled Unclassified Information"},"us.classified":{color:"white",backgroundColor:"#723D9A",content:"Classified"},"us.unclassified":{color:"white",backgroundColor:"#007A33",content:"Unclassified"},"us.confidential":{color:"white",backgroundColor:"#0033A0",content:"Confidential"},"us.secret":{color:"white",backgroundColor:"#C8102E",content:"Secret"},"us.topsecret":{color:"white",backgroundColor:"#FF671F",content:"Top Secret"},"us.topsecret.si":{color:"black",backgroundColor:"#F7EA48",content:"Top Secret//SI"},"uk.notset":{color:"white",backgroundColor:" #616161",content:"Not Set"},"uk.official":{color:"white",backgroundColor:"#2B71C7",content:"For Offical Use"},"uk.secret":{color:"white",backgroundColor:"#F39C2C",content:"Secret"},"uk.topsecret":{color:"white",backgroundColor:"#AA0000",content:"Top Secret"},"ca.protected_a":{color:"white",backgroundColor:"#227ABC",content:"PROTECTED A"},"ca.protected_b":{color:"white",backgroundColor:"#900FB5",content:"PROTECTED B"},"ca.protected_c":{color:"white",backgroundColor:"#460FB5",content:"PROTECTED C"},"ca.confidential":{color:"white",backgroundColor:"#0033a0",content:"Confidential"},"ca.secret":{color:"white",backgroundColor:"#c8102e",content:"Secret"},"ca.topsecret":{color:"white",backgroundColor:"#ff671f",content:"Top Secret"},"au.unofficial":{color:"#666",backgroundColor:"#ffffffff",content:"Unofficial"},"au.official":{color:"#666",backgroundColor:"#ffffffff",content:"Official"},"au.officialsensitive":{color:"#666",backgroundColor:"#ffffffff",content:"Official Sentitive"},"au.confidential":{color:"white",backgroundColor:"#4F81BD",content:"Confidential"},"au.secret":{color:"black",backgroundColor:" #E5B8B7",content:"Secret"},"au.topsecret":{color:"black",backgroundColor:"#AA0000",content:"Top Secret"}};var Ks=Object.defineProperty,Zs=Object.getOwnPropertyDescriptor,F=(o,r,s,i)=>{for(var a=i>1?void 0:i?Zs(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&Ks(r,s,a),a};d.SpectricPage=class extends P{constructor(){super(...arguments),this.showHeader=!0,this.headerSticky=!0,this.classificationLevel=Dt.None,this.classificationText="",this.notifications=[],this.showCreateAccount=!1,this.showLoginButton=!0,this.username=""}render(){this.classificationLevel&&!rt[this.classificationLevel]&&(console.warn("Unknown classification",this.classificationLevel),this.classificationLevel=Dt.None);const r=this.classificationLevel?this.classificationText||rt[this.classificationLevel].content:"",s=this.showHeader?A`<spectric-header ?showCreateAccount=${this.showCreateAccount} .showLoginButton=${this.showLoginButton} username=${Lt(this.username)}>
648
+ */const Dt=o=>o??E;class Ks extends Or{constructor(){super(...arguments),this.prevData={}}render(r){return E}update(r,[s]){var i;this.element!==r.element&&(this.element=r.element),this.host=((i=r.options)==null?void 0:i.host)||this.element,this.apply(s),this.groom(s),this.prevData={...s}}apply(r){if(!r)return;const{prevData:s,element:i}=this;for(const a in r){const e=r[a];e!==s[a]&&(i[a]=e)}}groom(r){const{prevData:s,element:i}=this;if(s)for(const a in s)(!r||!(a in r)&&i[a]===s[a])&&(i[a]=void 0)}}const tt=Ot(Ks);var Nt=(o=>(o.None="none",o.Uscui="us.cui",o.Usclassified="us.classified",o.Usunclassified="us.unclassified",o.Usconfidential="us.confidential",o.Ussecret="us.secret",o.Ustopsecret="us.topsecret",o.UstopsecretSi="us.topsecret.si",o.Uknotset="uk.notset",o.Ukofficial="uk.official",o.Uksecret="uk.secret",o.Uktopsecret="uk.topsecret",o.Caprotected_a="ca.protected_a",o.Caprotected_b="ca.protected_b",o.Caprotected_c="ca.protected_c",o.Caconfidential="ca.confidential",o.Casecret="ca.secret",o.Catopsecret="ca.topsecret",o.Auunofficial="au.unofficial",o.Auofficial="au.official",o.Auofficialsensitive="au.officialsensitive",o.Auconfidential="au.confidential",o.Ausecret="au.secret",o.Autopsecret="au.topsecret",o))(Nt||{});const rt={none:{},"us.cui":{color:"white",backgroundColor:"#3D1E5A",content:"Controlled Unclassified Information"},"us.classified":{color:"white",backgroundColor:"#723D9A",content:"Classified"},"us.unclassified":{color:"white",backgroundColor:"#007A33",content:"Unclassified"},"us.confidential":{color:"white",backgroundColor:"#0033A0",content:"Confidential"},"us.secret":{color:"white",backgroundColor:"#C8102E",content:"Secret"},"us.topsecret":{color:"white",backgroundColor:"#FF671F",content:"Top Secret"},"us.topsecret.si":{color:"black",backgroundColor:"#F7EA48",content:"Top Secret//SI"},"uk.notset":{color:"white",backgroundColor:" #616161",content:"Not Set"},"uk.official":{color:"white",backgroundColor:"#2B71C7",content:"For Offical Use"},"uk.secret":{color:"white",backgroundColor:"#F39C2C",content:"Secret"},"uk.topsecret":{color:"white",backgroundColor:"#AA0000",content:"Top Secret"},"ca.protected_a":{color:"white",backgroundColor:"#227ABC",content:"PROTECTED A"},"ca.protected_b":{color:"white",backgroundColor:"#900FB5",content:"PROTECTED B"},"ca.protected_c":{color:"white",backgroundColor:"#460FB5",content:"PROTECTED C"},"ca.confidential":{color:"white",backgroundColor:"#0033a0",content:"Confidential"},"ca.secret":{color:"white",backgroundColor:"#c8102e",content:"Secret"},"ca.topsecret":{color:"white",backgroundColor:"#ff671f",content:"Top Secret"},"au.unofficial":{color:"#666",backgroundColor:"#ffffffff",content:"Unofficial"},"au.official":{color:"#666",backgroundColor:"#ffffffff",content:"Official"},"au.officialsensitive":{color:"#666",backgroundColor:"#ffffffff",content:"Official Sentitive"},"au.confidential":{color:"white",backgroundColor:"#4F81BD",content:"Confidential"},"au.secret":{color:"black",backgroundColor:" #E5B8B7",content:"Secret"},"au.topsecret":{color:"black",backgroundColor:"#AA0000",content:"Top Secret"}};var Zs=Object.defineProperty,Xs=Object.getOwnPropertyDescriptor,F=(o,r,s,i)=>{for(var a=i>1?void 0:i?Xs(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&Zs(r,s,a),a};d.SpectricPage=class extends P{constructor(){super(...arguments),this.showHeader=!0,this.headerSticky=!0,this.classificationLevel=Nt.None,this.classificationText="",this.notifications=[],this.showCreateAccount=!1,this.showLoginButton=!0,this.username=""}render(){this.classificationLevel&&!rt[this.classificationLevel]&&(console.warn("Unknown classification",this.classificationLevel),this.classificationLevel=Nt.None);const r=this.classificationLevel?this.classificationText||rt[this.classificationLevel].content:"",s=this.showHeader?A`<spectric-header ?showCreateAccount=${this.showCreateAccount} .showLoginButton=${this.showLoginButton} username=${Dt(this.username)}>
649
649
  <slot name="branding" slot="branding"></slot>
650
650
  <slot name="name" slot="name"></slot>
651
651
  <slot name="center" slot="center"></slot>
@@ -655,7 +655,7 @@ article{
655
655
  <!-- Classification Banner -->
656
656
  <spectric-banner ${tt({text:r,headerStyle:rt[this.classificationLevel]})}></spectric-banner>
657
657
  `:null}
658
- <spectric-theme theme=${Lt(this.theme)}>
658
+ <spectric-theme theme=${Dt(this.theme)}>
659
659
  ${this.notifications?this.notifications.map(i=>A`<spectric-banner ${tt(i)} ></spectric-banner>`):null}
660
660
  ${this.headerSticky?s:null}
661
661
  <article>
@@ -668,7 +668,7 @@ article{
668
668
  </spectric-theme>
669
669
  ${this.classificationLevel&&r?A`<spectric-banner ${tt({text:r,headerStyle:rt[this.classificationLevel]})}></spectric-banner>`:null}
670
670
 
671
- `}},d.SpectricPage.styles=Vs,F([v({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"showHeader",2),F([v({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"headerSticky",2),F([v({type:String,reflect:!0})],d.SpectricPage.prototype,"classificationLevel",2),F([v({type:String,reflect:!0})],d.SpectricPage.prototype,"classificationText",2),F([v({type:Array,reflect:!0})],d.SpectricPage.prototype,"notifications",2),F([v({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"showCreateAccount",2),F([v({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"showLoginButton",2),F([v({type:String,reflect:!0})],d.SpectricPage.prototype,"username",2),F([v({type:String,reflect:!0})],d.SpectricPage.prototype,"theme",2),d.SpectricPage=F([L("spectric-page")],d.SpectricPage);var Xs=Object.defineProperty,Gs=Object.getOwnPropertyDescriptor,T=(o,r,s,i)=>{for(var a=i>1?void 0:i?Gs(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&Xs(r,s,a),a},Nr=(o=>(o.Text="text",o.TextArea="text-area",o.number="number",o.color="color",o.date="date",o.datetime="datetime-local",o.email="email",o.file="file",o.hidden="hidden",o.password="password",o.checkbox="checkbox",o))(Nr||{});d.SpectricInput=class extends P{constructor(){super(...arguments),this.placeholder="",this.readonly=!1,this.variant="text",this.disabled=!1,this.label="",this.hidePasswordLabel="Hide",this.showPasswordLabel="Show",this.showPasswordVisibilityToggle=!0,this.helperText="",this.invalid=!1,this.required=!1,this.invalidText="",this.name="",this.pattern="",this.maxCount=0,this._value="",this._showPassword=!1,this.autocomplete="",this._handleInput=({target:r})=>{const s=r;this.value=s.value,this.invalid=!s.validity.valid},this.handleTogglePasswordVisibility=()=>{this._showPassword=!this._showPassword,this.requestUpdate()}}createRenderRoot(){return this}get selectionStart(){return this._input?this._input.selectionStart:null}get value(){return this._input?this.variant=="number"?parseFloat(this._input.value):this._input.value:this._value}set value(r){const s=this._value;this._value=r,this.requestUpdate("value",s),this._input&&(this._input.value=String(r))}blur(){this._input&&this._input.blur()}focus(r){this._input&&(this._input.blur(),this._input.focus(r))}setSelectionRange(r,s,i="none"){this._input&&this._input.setSelectionRange(r,s,i)}render(){switch(this.variant){case"text":case"password":case"number":case"email":case"date":case"datetime-local":case"file":case"color":return A`
671
+ `}},d.SpectricPage.styles=Ys,F([v({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"showHeader",2),F([v({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"headerSticky",2),F([v({type:String,reflect:!0})],d.SpectricPage.prototype,"classificationLevel",2),F([v({type:String,reflect:!0})],d.SpectricPage.prototype,"classificationText",2),F([v({type:Array,reflect:!0})],d.SpectricPage.prototype,"notifications",2),F([v({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"showCreateAccount",2),F([v({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"showLoginButton",2),F([v({type:String,reflect:!0})],d.SpectricPage.prototype,"username",2),F([v({type:String,reflect:!0})],d.SpectricPage.prototype,"theme",2),d.SpectricPage=F([L("spectric-page")],d.SpectricPage);var Gs=Object.defineProperty,Js=Object.getOwnPropertyDescriptor,T=(o,r,s,i)=>{for(var a=i>1?void 0:i?Js(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&Gs(r,s,a),a},jr=(o=>(o.Text="text",o.TextArea="text-area",o.number="number",o.color="color",o.date="date",o.datetime="datetime-local",o.email="email",o.file="file",o.hidden="hidden",o.password="password",o.checkbox="checkbox",o))(jr||{});d.SpectricInput=class extends P{constructor(){super(...arguments),this.placeholder="",this.readonly=!1,this.variant="text",this.disabled=!1,this.label="",this.hidePasswordLabel="Hide",this.showPasswordLabel="Show",this.showPasswordVisibilityToggle=!0,this.helperText="",this.invalid=!1,this.required=!1,this.invalidText="",this.name="",this.pattern="",this.maxCount=0,this._value="",this._showPassword=!1,this.autocomplete="",this._handleInput=({target:r})=>{const s=r;this.value=s.value,this.invalid=!s.validity.valid},this.handleTogglePasswordVisibility=()=>{this._showPassword=!this._showPassword,this.requestUpdate()}}createRenderRoot(){return this}get selectionStart(){return this._input?this._input.selectionStart:null}get value(){return this._input?this.variant=="number"?parseFloat(this._input.value):this._input.value:this._value}set value(r){const s=this._value;this._value=r,this.requestUpdate("value",s),this._input&&(this._input.value=String(r))}blur(){this._input&&this._input.blur()}focus(r){this._input&&(this._input.blur(),this._input.focus(r))}setSelectionRange(r,s,i="none"){this._input&&this._input.setSelectionRange(r,s,i)}render(){switch(this.variant){case"text":case"password":case"number":case"email":case"date":case"datetime-local":case"file":case"color":return A`
672
672
  <div class="inputWrapper">
673
673
  <div class="text-input__label-helper-wrapper">
674
674
  <div class="--text-input__label-wrapper">
@@ -720,11 +720,11 @@ article{
720
720
  ${this.label}
721
721
  </div>
722
722
  </label>
723
- `}return`Not yet implemented ${this.variant}`}},T([v({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"checked",2),T([v({type:String,reflect:!0})],d.SpectricInput.prototype,"placeholder",2),T([v({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"readonly",2),T([v({type:String,reflect:!0})],d.SpectricInput.prototype,"variant",2),T([v({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"disabled",2),T([v({type:String,reflect:!0})],d.SpectricInput.prototype,"label",2),T([v()],d.SpectricInput.prototype,"hidePasswordLabel",2),T([v()],d.SpectricInput.prototype,"showPasswordLabel",2),T([v({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"showPasswordVisibilityToggle",2),T([v({type:String,reflect:!0})],d.SpectricInput.prototype,"helperText",2),T([v({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"invalid",2),T([v({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"required",2),T([v({type:String,reflect:!0})],d.SpectricInput.prototype,"invalidText",2),T([v()],d.SpectricInput.prototype,"name",2),T([v()],d.SpectricInput.prototype,"pattern",2),T([v({type:Number,reflect:!0})],d.SpectricInput.prototype,"maxCount",2),T([v({reflect:!0})],d.SpectricInput.prototype,"autocomplete",2),T([v({reflect:!0})],d.SpectricInput.prototype,"value",1),T([be("input")],d.SpectricInput.prototype,"_input",2),d.SpectricInput=T([L("spectric-input")],d.SpectricInput);const me=o=>Lt(o===""?void 0:o??void 0),Js="end of input",eo={fieldName:"field name",value:"value",literal:"literal",whitespace:"whitespace"};class jr extends Error{constructor(r,s){let i=r.message;if(r.expected){const u=r.expected.map(m=>eo[m.description]||m.description).join(", ");let g=r.found?`"${r.found}"`:Js;i=`Expected ${u} but ${g} found.`}const a=[i,s,"-".repeat(r.location.start.offset)+"^"].join(`
724
- `);super(a),this.name="DQLSyntaxError",this.shortMessage=i}}function ye(o){return{type:"literal",value:o}}function Nt(o){return o.value}const to=Object.freeze(Object.defineProperty({__proto__:null,buildNode:ye,toOpenSearchQuery:Nt},Symbol.toStringTag,{value:"Module"})),{SyntaxError:vc,parse:it}=function(){function o(i,a){function e(){this.constructor=i}e.prototype=a.prototype,i.prototype=new e}function r(i,a,e,u){this.message=i,this.expected=a,this.found=e,this.location=u,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,r)}o(r,Error);function s(i){var a=arguments.length>1?arguments[1]:{},e={},u={start:Fi,Literal:sr},g=Fi,m=function(t,n){return n.type==="cursor"?{...n,suggestionTypes:["conjunction"]}:t!==null?t:he.function.buildNode("is","*","*")},w=function(){return pc},x=function(t,n){const l=[t,n].find(p=>p.type==="cursor");return l||V("or",[t,n])},S=function(t,n){const l=[t,n].find(p=>p.type==="cursor");return l||V("and",[t,n])},C=function(t){return t.type==="cursor"?t:V("not",[t])},k="(",N={type:"literal",value:"(",description:'"("'},at=")",ie={type:"literal",value:")",description:'")"'},H=function(t,n){return n.type==="cursor"?{...n,suggestionTypes:["conjunction"]}:t},q=":",B={type:"literal",value:":",description:'":"'},Se="{",Ht={type:"literal",value:"{",description:'"{"'},qt="}",Wt={type:"literal",value:"}",description:'"}"'},Bn=function(t,n,l){return n.type==="cursor"?{...n,nestedPath:n.nestedPath?`${t.value}.${n.nestedPath}`:t.value}:l.type==="cursor"?{...l,suggestionTypes:["conjunction"]}:V("nested",[t,n])},Rn={type:"other",description:"fieldName"},Mn=function(t,n,l){if(l.type==="cursor")return{...l,suggestionTypes:["conjunction"]};const p=gc(n,l);return V("range",[t,p])},Un=function(t,n){return n.type==="cursor"?{...n,fieldName:t.value,suggestionTypes:["value","conjunction"]}:n(t)},In=function(t){if(t.type==="cursor"){const l=`${t.prefix}${t.suffix}`.trim();return{...t,fieldName:l,suggestionTypes:["field","operator","conjunction"]}}const n=se(null);return t(n)},Fn=function(t,n){return n.type==="cursor"?{...n,suggestionTypes:["conjunction"]}:t},Qn=function(t,n){const l=[t,n].find(p=>p.type==="cursor");return l?{...l,suggestionTypes:["value"]}:p=>V("or",[t(p),n(p)])},Hn=function(t,n){const l=[t,n].find(p=>p.type==="cursor");return l?{...l,suggestionTypes:["value"]}:p=>V("and",[t(p),n(p)])},qn=function(t){return t.type==="cursor"?{...list,suggestionTypes:["value"]}:n=>V("not",[t(n)])},Wn={type:"other",description:"value"},Vn=function(t){if(t.type==="cursor")return t;const n=se(!0);return l=>V("is",[l,t,n])},Yn=function(t){if(t.type==="cursor")return t;!hc&&t.type==="wildcard"&&he.wildcard.hasLeadingWildcard(t)&&M("Leading wildcards are disabled. See query:allowLeadingWildcards in Advanced Settings.");const n=se(!1);return l=>V("is",[l,t,n])},Kn={type:"other",description:"OR"},ei="or",ti={type:"literal",value:"or",description:'"or"'},Zn={type:"other",description:"AND"},ri="and",ii={type:"literal",value:"and",description:'"and"'},Xn={type:"other",description:"NOT"},si="not",oi={type:"literal",value:"not",description:'"not"'},Gn={type:"other",description:"literal"},Me='"',Ue={type:"literal",value:'"',description:'"\\""'},Vt=function(t,n,l){const{start:p,end:f}=Fa();return{type:"cursor",start:p.offset,end:f.offset-n.length,prefix:t.join(""),suffix:l.join(""),text:Ia().replace(n,"")}},Jn=function(t){return se(t.join(""))},Ie="\\",Fe={type:"literal",value:"\\",description:'"\\\\"'},ea=/^[\\"]/,ta={type:"class",value:'[\\\\"]',description:'[\\\\"]'},ct=function(t){return t},ra=/^[^"]/,ia={type:"class",value:'[^"]',description:'[^"]'},sa=function(t){const n=t.join("").trim();return n==="null"?se(null):n==="true"?se(!0):n==="false"?se(!1):t.includes(ss)?fc(n):se(/^(-?[1-9]+\d*([.]\d+)?)$|^(-?0[.]\d*[1-9]+)$|^0$|^0.0$|^[.]\d{1,}$/.test(n)?isFinite(n)&&(n>Number.MAX_SAFE_INTEGER||n<Number.MIN_SAFE_INTEGER)?BigInt(n):Number(n):n)},ni={type:"any",description:"any character"},lt="*",pt={type:"literal",value:"*",description:'"*"'},oa=function(){return ss},ai="\\t",na={type:"literal",value:"\\t",description:'"\\\\t"'},aa=function(){return" "},ci="\\r",ca={type:"literal",value:"\\r",description:'"\\\\r"'},la=function(){return"\r"},li="\\n",pa={type:"literal",value:"\\n",description:'"\\\\n"'},ua=function(){return`
725
- `},da=function(t){return t},ha=/^[\\():<>"*{}]/,fa={type:"class",value:'[\\\\():<>"*{}]',description:'[\\\\():<>"*{}]'},pi="<=",ga={type:"literal",value:"<=",description:'"<="'},ba=function(){return"lte"},ui=">=",va={type:"literal",value:">=",description:'">="'},ma=function(){return"gte"},di="<",hi={type:"literal",value:"<",description:'"<"'},ya=function(){return"lt"},fi=">",gi={type:"literal",value:">",description:'">"'},$a=function(){return"gt"},_a={type:"other",description:"whitespace"},wa=/^[ \t\r\n]/,Sa={type:"class",value:"[\\ \\t\\r\\n]",description:"[\\ \\t\\r\\n]"},Aa=function(){return uc},bi="@kuery-cursor@",xa={type:"literal",value:"@kuery-cursor@",description:'"@kuery-cursor@"'},ka=function(){return dc},vi="||",Ea={type:"literal",value:"||",description:'"||"'},Ca=function(){M("LuceneOr")},mi="&&",Pa={type:"literal",value:"&&",description:'"&&"'},yi=function(){M("LuceneAnd")},$i="+",_i={type:"literal",value:"+",description:'"+"'},wi="-",Si={type:"literal",value:"-",description:'"-"'},Ai=function(){M("LuceneNot")},xi="!",ki={type:"literal",value:"!",description:'"!"'},Ei="_exists_",Ta={type:"literal",value:"_exists_",description:'"_exists_"'},Oa=function(){M("LuceneExists")},Ci=function(){M("LuceneRange")},Pi="?",Ti={type:"literal",value:"?",description:'"?"'},La=function(){M("LuceneWildcard")},Yt="/",Kt={type:"literal",value:"/",description:'"/"'},Oi=/^[^\/]/,Li={type:"class",value:"[^/]",description:"[^/]"},Da=function(){M("LuceneRegex")},Zt="~",Xt={type:"literal",value:"~",description:'"~"'},Ae=/^[0-9]/,xe={type:"class",value:"[0-9]",description:"[0-9]"},Na=function(){M("LuceneFuzzy")},ja=function(){M("LuceneProximity")},Di="^",Ni={type:"literal",value:"^",description:'"^"'},za=function(){M("LuceneBoost")},Ba=function(){return char},Ra="=",Ma={type:"literal",value:"=",description:'"="'},ji="[",zi={type:"literal",value:"[",description:'"["'},Bi="]",Ri={type:"literal",value:"]",description:'"]"'},Mi="TO",Ua={type:"literal",value:"TO",description:'"TO"'},c=0,_=0,ut=[{line:1,column:1,seenCR:!1}],W=0,Gt=[],h=0,dt;if("startRule"in a){if(!(a.startRule in u))throw new Error(`Can't start parsing from rule "`+a.startRule+'".');g=u[a.startRule]}function Ia(){return i.substring(_,c)}function Fa(){return ht(_,c)}function M(t){throw Ii(t,null,i.substring(_,c),ht(_,c))}function Ui(t){var n=ut[t],l,p;if(n)return n;for(l=t-1;!ut[l];)l--;for(n=ut[l],n={line:n.line,column:n.column,seenCR:n.seenCR};l<t;)p=i.charAt(l),p===`
726
- `?(n.seenCR||n.line++,n.column=1,n.seenCR=!1):p==="\r"||p==="\u2028"||p==="\u2029"?(n.line++,n.column=1,n.seenCR=!0):(n.column++,n.seenCR=!1),l++;return ut[t]=n,n}function ht(t,n){var l=Ui(t),p=Ui(n);return{start:{offset:t,line:l.line,column:l.column},end:{offset:n,line:p.line,column:p.column}}}function b(t){c<W||(c>W&&(W=c,Gt=[]),Gt.push(t))}function Ii(t,n,l,p){function f(O){var D=1;for(O.sort(function(oe,U){return oe.description<U.description?-1:oe.description>U.description?1:0});D<O.length;)O[D-1]===O[D]?O.splice(D,1):D++}function $(O,D){function oe(bc){function $t(Z){return Z.charCodeAt(0).toString(16).toUpperCase()}return bc.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(Z){return"\\x0"+$t(Z)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(Z){return"\\x"+$t(Z)}).replace(/[\u0100-\u0FFF]/g,function(Z){return"\\u0"+$t(Z)}).replace(/[\u1000-\uFFFF]/g,function(Z){return"\\u"+$t(Z)})}var U=new Array(O.length),os,ns,He;for(He=0;He<O.length;He++)U[He]=O[He].description;return os=O.length>1?U.slice(0,-1).join(", ")+" or "+U[O.length-1]:U[0],ns=D?'"'+oe(D)+'"':"end of input","Expected "+os+" but "+ns+" found."}return n!==null&&f(n),new r(t!==null?t:$(n,l),n,l,p)}function Fi(){var t,n,l,p;for(t=c,n=[],l=y();l!==e;)n.push(l),l=y();return n!==e?(l=ft(),l===e&&(l=null),l!==e?(p=mt(),p!==e?(_=t,n=m(l,p),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e),t}function ft(){var t,n,l,p;return t=c,_=c,n=w(),n?n=void 0:n=e,n!==e?(l=Ga(),l!==e?(n=[n,l],t=n):(c=t,t=e)):(c=t,t=e),t===e&&(t=c,n=Jt(),n!==e?(l=gt(),l!==e?(p=ft(),p!==e?(_=t,n=x(n,p),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e),t===e&&(t=Jt())),t}function Jt(){var t,n,l,p;return t=c,n=Qi(),n!==e?(l=bt(),l!==e?(p=Jt(),p!==e?(_=t,n=S(n,p),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e),t===e&&(t=Qi()),t}function Qi(){var t,n,l;return t=c,n=ir(),n!==e?(l=Hi(),l!==e?(_=t,n=C(l),t=n):(c=t,t=e)):(c=t,t=e),t===e&&(t=Hi()),t}function Hi(){var t,n,l,p,f,$;if(t=c,i.charCodeAt(c)===40?(n=k,c++):(n=e,h===0&&b(N)),n!==e){for(l=[],p=y();p!==e;)l.push(p),p=y();l!==e?(p=ft(),p!==e?(f=mt(),f!==e?(i.charCodeAt(c)===41?($=at,c++):($=e,h===0&&b(ie)),$!==e?(_=t,n=H(p,f),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;return t===e&&(t=Qa()),t}function Qa(){var t,n,l,p,f,$,O,D,oe,U;if(t=c,n=er(),n!==e){for(l=[],p=y();p!==e;)l.push(p),p=y();if(l!==e)if(i.charCodeAt(c)===58?(p=q,c++):(p=e,h===0&&b(B)),p!==e){for(f=[],$=y();$!==e;)f.push($),$=y();if(f!==e)if(i.charCodeAt(c)===123?($=Se,c++):($=e,h===0&&b(Ht)),$!==e){for(O=[],D=y();D!==e;)O.push(D),D=y();O!==e?(D=ft(),D!==e?(oe=mt(),oe!==e?(i.charCodeAt(c)===125?(U=qt,c++):(U=e,h===0&&b(Wt)),U!==e?(_=t,n=Bn(n,D,oe),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;else c=t,t=e}else c=t,t=e;else c=t,t=e}else c=t,t=e;return t===e&&(t=Ha()),t}function Ha(){var t;return t=qa(),t===e&&(t=Wa(),t===e&&(t=Va())),t}function er(){var t;return h++,t=sr(),h--,t===e&&h===0&&b(Rn),t}function qa(){var t,n,l,p,f,$;if(t=c,n=er(),n!==e){for(l=[],p=y();p!==e;)l.push(p),p=y();if(l!==e)if(p=Zi(),p!==e){for(f=[],$=y();$!==e;)f.push($),$=y();f!==e?($=sr(),$!==e?(_=t,n=Mn(n,p,$),t=n):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;else c=t,t=e}else c=t,t=e;return t}function Wa(){var t,n,l,p,f,$;if(t=c,n=er(),n!==e){for(l=[],p=y();p!==e;)l.push(p),p=y();if(l!==e)if(i.charCodeAt(c)===58?(p=q,c++):(p=e,h===0&&b(B)),p!==e){for(f=[],$=y();$!==e;)f.push($),$=y();f!==e?($=tr(),$!==e?(_=t,n=Un(n,$),t=n):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;else c=t,t=e}else c=t,t=e;return t}function Va(){var t,n;return t=c,n=Vi(),n!==e&&(_=t,n=In(n)),t=n,t}function tr(){var t,n,l,p,f,$;if(t=c,i.charCodeAt(c)===40?(n=k,c++):(n=e,h===0&&b(N)),n!==e){for(l=[],p=y();p!==e;)l.push(p),p=y();l!==e?(p=qi(),p!==e?(f=mt(),f!==e?(i.charCodeAt(c)===41?($=at,c++):($=e,h===0&&b(ie)),$!==e?(_=t,n=Fn(p,f),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;return t===e&&(t=Vi()),t}function qi(){var t,n,l,p;return t=c,n=rr(),n!==e?(l=gt(),l!==e?(p=qi(),p!==e?(_=t,n=Qn(n,p),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e),t===e&&(t=rr()),t}function rr(){var t,n,l,p;return t=c,n=Wi(),n!==e?(l=bt(),l!==e?(p=rr(),p!==e?(_=t,n=Hn(n,p),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e),t===e&&(t=Wi()),t}function Wi(){var t,n,l;return t=c,n=ir(),n!==e?(l=tr(),l!==e?(_=t,n=qn(l),t=n):(c=t,t=e)):(c=t,t=e),t===e&&(t=tr()),t}function Vi(){var t,n;return h++,t=c,n=vt(),n!==e&&(_=t,n=Vn(n)),t=n,t===e&&(t=c,n=Yi(),n!==e&&(_=t,n=Yn(n)),t=n),h--,t===e&&(n=e,h===0&&b(Wn)),t}function gt(){var t,n,l,p,f;if(h++,t=c,n=[],l=y(),l!==e)for(;l!==e;)n.push(l),l=y();else n=e;if(n!==e)if(i.substr(c,2).toLowerCase()===ei?(l=i.substr(c,2),c+=2):(l=e,h===0&&b(ti)),l!==e){if(p=[],f=y(),f!==e)for(;f!==e;)p.push(f),f=y();else p=e;p!==e?(n=[n,l,p],t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t===e&&(t=c,_=c,n=w(),n?n=void 0:n=e,n!==e?(l=Xi(),l!==e?(n=[n,l],t=n):(c=t,t=e)):(c=t,t=e)),h--,t===e&&(n=e,h===0&&b(Kn)),t}function bt(){var t,n,l,p,f;if(h++,t=c,n=[],l=y(),l!==e)for(;l!==e;)n.push(l),l=y();else n=e;if(n!==e)if(i.substr(c,3).toLowerCase()===ri?(l=i.substr(c,3),c+=3):(l=e,h===0&&b(ii)),l!==e){if(p=[],f=y(),f!==e)for(;f!==e;)p.push(f),f=y();else p=e;p!==e?(n=[n,l,p],t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t===e&&(t=c,_=c,n=w(),n?n=void 0:n=e,n!==e?(l=Gi(),l!==e?(n=[n,l],t=n):(c=t,t=e)):(c=t,t=e)),h--,t===e&&(n=e,h===0&&b(Zn)),t}function ir(){var t,n,l,p;if(h++,t=c,i.substr(c,3).toLowerCase()===si?(n=i.substr(c,3),c+=3):(n=e,h===0&&b(oi)),n!==e){if(l=[],p=y(),p!==e)for(;p!==e;)l.push(p),p=y();else l=e;l!==e?(n=[n,l],t=n):(c=t,t=e)}else c=t,t=e;return t===e&&(t=c,_=c,n=w(),n?n=void 0:n=e,n!==e?(l=Ji(),l!==e?(n=[n,l],t=n):(c=t,t=e)):(c=t,t=e)),h--,t===e&&(n=e,h===0&&b(Xn)),t}function sr(){var t;return h++,t=vt(),t===e&&(t=Yi()),h--,t===e&&h===0&&b(Gn),t}function vt(){var t,n,l,p,f,$;if(t=c,i.charCodeAt(c)===34?(n=Me,c++):(n=e,h===0&&b(Ue)),n!==e){for(l=[],p=ke();p!==e;)l.push(p),p=ke();if(l!==e)if(p=Qe(),p!==e){for(f=[],$=ke();$!==e;)f.push($),$=ke();f!==e?(i.charCodeAt(c)===34?($=Me,c++):($=e,h===0&&b(Ue)),$!==e?(_=t,n=Vt(l,p,f),t=n):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;else c=t,t=e}else c=t,t=e;if(t===e)if(t=c,i.charCodeAt(c)===34?(n=Me,c++):(n=e,h===0&&b(Ue)),n!==e){for(l=[],p=ke();p!==e;)l.push(p),p=ke();l!==e?(i.charCodeAt(c)===34?(p=Me,c++):(p=e,h===0&&b(Ue)),p!==e?(_=t,n=Jn(l),t=n):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;return t}function ke(){var t,n,l;return t=or(),t===e&&(t=c,i.charCodeAt(c)===92?(n=Ie,c++):(n=e,h===0&&b(Fe)),n!==e?(ea.test(i.charAt(c))?(l=i.charAt(c),c++):(l=e,h===0&&b(ta)),l!==e?(_=t,n=ct(l),t=n):(c=t,t=e)):(c=t,t=e),t===e&&(t=c,n=c,h++,l=Qe(),h--,l===e?n=void 0:(c=n,n=e),n!==e?(ra.test(i.charAt(c))?(l=i.charAt(c),c++):(l=e,h===0&&b(ia)),l!==e?(_=t,n=ct(l),t=n):(c=t,t=e)):(c=t,t=e))),t}function Yi(){var t,n,l,p,f;for(t=c,n=[],l=Ee();l!==e;)n.push(l),l=Ee();if(n!==e)if(l=Qe(),l!==e){for(p=[],f=Ee();f!==e;)p.push(f),f=Ee();p!==e?(_=t,n=Vt(n,l,p),t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;if(t===e){if(t=c,n=[],l=Ee(),l!==e)for(;l!==e;)n.push(l),l=Ee();else n=e;n!==e&&(_=t,n=sa(n)),t=n}return t}function Ee(){var t,n,l,p,f;return t=or(),t===e&&(t=Ka(),t===e&&(t=Za(),t===e&&(t=Ya(),t===e&&(t=c,n=c,h++,l=Ki(),h--,l===e?n=void 0:(c=n,n=e),n!==e?(l=c,h++,p=Xa(),h--,p===e?l=void 0:(c=l,l=e),l!==e?(p=c,h++,f=Qe(),h--,f===e?p=void 0:(c=p,p=e),p!==e?(i.length>c?(f=i.charAt(c),c++):(f=e,h===0&&b(ni)),f!==e?(_=t,n=ct(f),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)):(c=t,t=e))))),t}function Ya(){var t,n;return t=c,i.charCodeAt(c)===42?(n=lt,c++):(n=e,h===0&&b(pt)),n!==e&&(_=t,n=oa()),t=n,t}function mt(){var t,n,l,p,f;for(t=c,n=[],l=y();l!==e;)n.push(l),l=y();if(n!==e)if(l=Qe(),l!==e){for(p=[],f=y();f!==e;)p.push(f),f=y();p!==e?(_=t,n=Vt(n,l,p),t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;if(t===e)for(t=[],n=y();n!==e;)t.push(n),n=y();return t}function or(){var t,n;return t=c,i.substr(c,2)===ai?(n=ai,c+=2):(n=e,h===0&&b(na)),n!==e&&(_=t,n=aa()),t=n,t===e&&(t=c,i.substr(c,2)===ci?(n=ci,c+=2):(n=e,h===0&&b(ca)),n!==e&&(_=t,n=la()),t=n,t===e&&(t=c,i.substr(c,2)===li?(n=li,c+=2):(n=e,h===0&&b(pa)),n!==e&&(_=t,n=ua()),t=n)),t}function Ka(){var t,n,l;return t=c,i.charCodeAt(c)===92?(n=Ie,c++):(n=e,h===0&&b(Fe)),n!==e?(l=Ki(),l!==e?(_=t,n=ct(l),t=n):(c=t,t=e)):(c=t,t=e),t}function Za(){var t,n,l;return t=c,i.charCodeAt(c)===92?(n=Ie,c++):(n=e,h===0&&b(Fe)),n!==e?(i.substr(c,2).toLowerCase()===ei?(l=i.substr(c,2),c+=2):(l=e,h===0&&b(ti)),l===e&&(i.substr(c,3).toLowerCase()===ri?(l=i.substr(c,3),c+=3):(l=e,h===0&&b(ii)),l===e&&(i.substr(c,3).toLowerCase()===si?(l=i.substr(c,3),c+=3):(l=e,h===0&&b(oi)))),l!==e?(_=t,n=da(l),t=n):(c=t,t=e)):(c=t,t=e),t}function Xa(){var t;return t=gt(),t===e&&(t=bt(),t===e&&(t=ir())),t}function Ki(){var t;return ha.test(i.charAt(c))?(t=i.charAt(c),c++):(t=e,h===0&&b(fa)),t}function Zi(){var t,n;return t=c,i.substr(c,2)===pi?(n=pi,c+=2):(n=e,h===0&&b(ga)),n!==e&&(_=t,n=ba()),t=n,t===e&&(t=c,i.substr(c,2)===ui?(n=ui,c+=2):(n=e,h===0&&b(va)),n!==e&&(_=t,n=ma()),t=n,t===e&&(t=c,i.charCodeAt(c)===60?(n=di,c++):(n=e,h===0&&b(hi)),n!==e&&(_=t,n=ya()),t=n,t===e&&(t=c,i.charCodeAt(c)===62?(n=fi,c++):(n=e,h===0&&b(gi)),n!==e&&(_=t,n=$a()),t=n))),t}function y(){var t;return h++,wa.test(i.charAt(c))?(t=i.charAt(c),c++):(t=e,h===0&&b(Sa)),h--,t===e&&h===0&&b(_a),t}function Qe(){var t,n,l;return t=c,_=c,n=Aa(),n?n=void 0:n=e,n!==e?(i.substr(c,14)===bi?(l=bi,c+=14):(l=e,h===0&&b(xa)),l!==e?(_=t,n=ka(),t=n):(c=t,t=e)):(c=t,t=e),t}function Xi(){var t,n,l,p,f;for(t=c,n=[],l=y();l!==e;)n.push(l),l=y();if(n!==e)if(i.substr(c,2)===vi?(l=vi,c+=2):(l=e,h===0&&b(Ea)),l!==e){for(p=[],f=y();f!==e;)p.push(f),f=y();p!==e?(_=t,n=Ca(),t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t}function Gi(){var t,n,l,p,f;for(t=c,n=[],l=y();l!==e;)n.push(l),l=y();if(n!==e)if(i.substr(c,2)===mi?(l=mi,c+=2):(l=e,h===0&&b(Pa)),l!==e){for(p=[],f=y();f!==e;)p.push(f),f=y();p!==e?(_=t,n=yi(),t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t===e&&(t=c,i.charCodeAt(c)===43?(n=$i,c++):(n=e,h===0&&b(_i)),n!==e&&(_=t,n=yi()),t=n),t}function Ji(){var t,n;return t=c,i.charCodeAt(c)===45?(n=wi,c++):(n=e,h===0&&b(Si)),n!==e&&(_=t,n=Ai()),t=n,t===e&&(t=c,i.charCodeAt(c)===33?(n=xi,c++):(n=e,h===0&&b(ki)),n!==e&&(_=t,n=Ai()),t=n),t}function Ga(){var t;return t=Ja(),t===e&&(t=es(),t===e&&(t=ec())),t}function Ja(){var t,n,l,p,f,$;if(t=c,n=Ce(),n!==e){for(l=[],p=y();p!==e;)l.push(p),p=y();if(l!==e)if(i.charCodeAt(c)===58?(p=q,c++):(p=e,h===0&&b(B)),p!==e){for(f=[],$=y();$!==e;)f.push($),$=y();f!==e?($=es(),$!==e?(n=[n,l,p,f,$],t=n):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;else c=t,t=e}else c=t,t=e;return t}function es(){var t;return t=tc(),t===e&&(t=nr(),t===e&&(t=rc(),t===e&&(t=ic(),t===e&&(t=sc(),t===e&&(t=oc()))))),t}function ec(){var t,n,l,p,f,$;if(t=c,i.substr(c,8)===Ei?(n=Ei,c+=8):(n=e,h===0&&b(Ta)),n!==e){for(l=[],p=y();p!==e;)l.push(p),p=y();if(l!==e)if(i.charCodeAt(c)===58?(p=q,c++):(p=e,h===0&&b(B)),p!==e){for(f=[],$=y();$!==e;)f.push($),$=y();f!==e?($=Ce(),$!==e?(_=t,n=Oa(),t=n):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;else c=t,t=e}else c=t,t=e;return t}function tc(){var t,n,l,p,f,$,O;if(t=c,n=Zi(),n!==e){for(l=[],p=y();p!==e;)l.push(p),p=y();l!==e?(p=Ce(),p!==e?(_=t,n=Ci(),t=n):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;if(t===e)if(t=c,n=cc(),n!==e){for(l=[],p=y();p!==e;)l.push(p),p=y();l!==e?(p=Ce(),p!==e?(f=is(),f!==e?($=Ce(),$!==e?(O=lc(),O!==e?(_=t,n=Ci(),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;return t}function nr(){var t,n,l,p,f;for(t=c,n=[],l=yt(),l===e&&(i.charCodeAt(c)===42?(l=lt,c++):(l=e,h===0&&b(pt)));l!==e;)n.push(l),l=yt(),l===e&&(i.charCodeAt(c)===42?(l=lt,c++):(l=e,h===0&&b(pt)));if(n!==e)if(i.charCodeAt(c)===63?(l=Pi,c++):(l=e,h===0&&b(Ti)),l!==e){for(p=[],f=nr();f!==e;)p.push(f),f=nr();p!==e?(_=t,n=La(),t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t}function rc(){var t,n,l,p;if(t=c,i.charCodeAt(c)===47?(n=Yt,c++):(n=e,h===0&&b(Kt)),n!==e){for(l=[],Oi.test(i.charAt(c))?(p=i.charAt(c),c++):(p=e,h===0&&b(Li));p!==e;)l.push(p),Oi.test(i.charAt(c))?(p=i.charAt(c),c++):(p=e,h===0&&b(Li));l!==e?(i.charCodeAt(c)===47?(p=Yt,c++):(p=e,h===0&&b(Kt)),p!==e?(_=t,n=Da(),t=n):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;return t}function ic(){var t,n,l,p,f;if(t=c,n=ts(),n!==e)if(i.charCodeAt(c)===126?(l=Zt,c++):(l=e,h===0&&b(Xt)),l!==e){for(p=[],Ae.test(i.charAt(c))?(f=i.charAt(c),c++):(f=e,h===0&&b(xe));f!==e;)p.push(f),Ae.test(i.charAt(c))?(f=i.charAt(c),c++):(f=e,h===0&&b(xe));p!==e?(_=t,n=Na(),t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t}function sc(){var t,n,l,p,f;if(t=c,n=vt(),n!==e)if(i.charCodeAt(c)===126?(l=Zt,c++):(l=e,h===0&&b(Xt)),l!==e){for(p=[],Ae.test(i.charAt(c))?(f=i.charAt(c),c++):(f=e,h===0&&b(xe));f!==e;)p.push(f),Ae.test(i.charAt(c))?(f=i.charAt(c),c++):(f=e,h===0&&b(xe));p!==e?(_=t,n=ja(),t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t}function oc(){var t,n,l,p,f;if(t=c,n=Ce(),n!==e)if(i.charCodeAt(c)===94?(l=Di,c++):(l=e,h===0&&b(Ni)),l!==e){for(p=[],Ae.test(i.charAt(c))?(f=i.charAt(c),c++):(f=e,h===0&&b(xe));f!==e;)p.push(f),Ae.test(i.charAt(c))?(f=i.charAt(c),c++):(f=e,h===0&&b(xe));p!==e?(_=t,n=za(),t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t}function Ce(){var t;return t=vt(),t===e&&(t=ts()),t}function ts(){var t,n;if(t=[],n=yt(),n!==e)for(;n!==e;)t.push(n),n=yt();else t=e;return t}function yt(){var t,n,l,p;return t=or(),t===e&&(t=ac(),t===e&&(t=c,n=c,h++,l=rs(),h--,l===e?n=void 0:(c=n,n=e),n!==e?(l=c,h++,p=nc(),h--,p===e?l=void 0:(c=l,l=e),l!==e?(i.length>c?(p=i.charAt(c),c++):(p=e,h===0&&b(ni)),p!==e?(n=[n,l,p],t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e))),t}function nc(){var t;return t=gt(),t===e&&(t=bt(),t===e&&(t=Xi(),t===e&&(t=Gi(),t===e&&(t=Ji(),t===e&&(t=is()))))),t}function ac(){var t,n,l;return t=c,i.charCodeAt(c)===92?(n=Ie,c++):(n=e,h===0&&b(Fe)),n!==e?(l=rs(),l!==e?(_=t,n=Ba(),t=n):(c=t,t=e)):(c=t,t=e),t}function rs(){var t;return i.charCodeAt(c)===43?(t=$i,c++):(t=e,h===0&&b(_i)),t===e&&(i.charCodeAt(c)===45?(t=wi,c++):(t=e,h===0&&b(Si)),t===e&&(i.charCodeAt(c)===61?(t=Ra,c++):(t=e,h===0&&b(Ma)),t===e&&(i.charCodeAt(c)===62?(t=fi,c++):(t=e,h===0&&b(gi)),t===e&&(i.charCodeAt(c)===60?(t=di,c++):(t=e,h===0&&b(hi)),t===e&&(i.charCodeAt(c)===33?(t=xi,c++):(t=e,h===0&&b(ki)),t===e&&(i.charCodeAt(c)===40?(t=k,c++):(t=e,h===0&&b(N)),t===e&&(i.charCodeAt(c)===41?(t=at,c++):(t=e,h===0&&b(ie)),t===e&&(i.charCodeAt(c)===123?(t=Se,c++):(t=e,h===0&&b(Ht)),t===e&&(i.charCodeAt(c)===125?(t=qt,c++):(t=e,h===0&&b(Wt)),t===e&&(i.charCodeAt(c)===91?(t=ji,c++):(t=e,h===0&&b(zi)),t===e&&(i.charCodeAt(c)===93?(t=Bi,c++):(t=e,h===0&&b(Ri)),t===e&&(i.charCodeAt(c)===94?(t=Di,c++):(t=e,h===0&&b(Ni)),t===e&&(i.charCodeAt(c)===34?(t=Me,c++):(t=e,h===0&&b(Ue)),t===e&&(i.charCodeAt(c)===126?(t=Zt,c++):(t=e,h===0&&b(Xt)),t===e&&(i.charCodeAt(c)===42?(t=lt,c++):(t=e,h===0&&b(pt)),t===e&&(i.charCodeAt(c)===63?(t=Pi,c++):(t=e,h===0&&b(Ti)),t===e&&(i.charCodeAt(c)===58?(t=q,c++):(t=e,h===0&&b(B)),t===e&&(i.charCodeAt(c)===92?(t=Ie,c++):(t=e,h===0&&b(Fe)),t===e&&(i.charCodeAt(c)===47?(t=Yt,c++):(t=e,h===0&&b(Kt))))))))))))))))))))),t}function is(){var t,n,l,p,f;if(t=c,n=[],l=y(),l!==e)for(;l!==e;)n.push(l),l=y();else n=e;if(n!==e)if(i.substr(c,2)===Mi?(l=Mi,c+=2):(l=e,h===0&&b(Ua)),l!==e){if(p=[],f=y(),f!==e)for(;f!==e;)p.push(f),f=y();else p=e;p!==e?(n=[n,l,p],t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t}function cc(){var t;return i.charCodeAt(c)===91?(t=ji,c++):(t=e,h===0&&b(zi)),t===e&&(i.charCodeAt(c)===123?(t=Se,c++):(t=e,h===0&&b(Ht))),t}function lc(){var t;return i.charCodeAt(c)===93?(t=Bi,c++):(t=e,h===0&&b(Ri)),t===e&&(i.charCodeAt(c)===125?(t=qt,c++):(t=e,h===0&&b(Wt))),t}const{errorOnLuceneSyntax:pc,parseCursor:uc,cursorSymbol:dc,allowLeadingWildcards:hc=!0,helpers:{nodeTypes:he}}=a,V=he.function.buildNodeWithArgumentNodes,se=he.literal.buildNode,fc=he.wildcard.buildNode,gc=he.namedArg.buildNode,{wildcardSymbol:ss}=he.wildcard;if(dt=g(),dt!==e&&c===i.length)return dt;throw dt!==e&&c<i.length&&b({type:"end",description:"end of input"}),Ii(null,Gt,W<i.length?i.charAt(W):null,W<i.length?ht(W,W+1):ht(W,W))}return{SyntaxError:r,parse:s}}(),jt=(o,r={},s=it)=>{if(typeof o>"u")throw new Error("expression must be a string, got undefined instead");return s(o,{...r,helpers:{nodeTypes:K}})},$e=(o,r={})=>jt(o,{...r,startRule:"Literal"},it),st=(o,r={})=>{try{return jt(o,r,it)}catch(s){throw s.name==="SyntaxError"?new jr(s,o):s}},ro=o=>{try{return jt(o,{errorOnLuceneSyntax:!0},it),!1}catch(r){return r.message.startsWith("Lucene")}},j=(o,r,s,i)=>(r=void 0,!o||!o.type||!K[o.type]?j(K.function.buildNode("and",[]),r):K[o.type].toOpenSearchQuery(o,r,s,i)),Y="@kuery-wildcard@";function io(o){return o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function so(o){return o.replace(/[+-=&|><!(){}[\]^"~*?:\\/]/g,"\\$&")}function oo(o){return o.includes(Y)?{type:"wildcard",value:o}:$e(o)}function zr(o,r){const{value:s}=o,i=s.split(Y).map(io).join("[\\s\\S]*");return new RegExp(`^${i}$`).test(r)}function no(o){const{value:r}=o;return r.split(Y).join("*")}function zt(o){const{value:r}=o;return r.split(Y).map(so).join("*")}function ao(o){const{value:r}=o;return r.startsWith(Y)&&r.replace(Y,"").length>0}const co=Object.freeze(Object.defineProperty({__proto__:null,buildNode:oo,hasLeadingWildcard:ao,test:zr,toOpenSearchQuery:no,toQueryStringQuery:zt,wildcardSymbol:Y},Symbol.toStringTag,{value:"Module"}));function Bt(o,r){if(!r)return[];if(o.type==="literal"){const s=Nt(o),i=r.fields.find(a=>a.name===s);return i?[i]:[]}else if(o.type==="wildcard")return r.fields.filter(i=>zr(o,i.name))}function mc(o){return o}function Br(o,r,s){const i={...o,value:s?`${s}.${o.value}`:o.value};if(!r||i.type==="wildcard"&&!s)return i;const e=Bt(i,r).reduce((u,g)=>{const m=g.subType&&g.subType.nested?g.subType.nested.path:void 0;return s&&!m?[...u,`${g.name} is not a nested field but is in nested group "${s}" in the DQL expression.`]:m&&!s?[...u,`${g.name} is a nested field, but is not in a nested group in the DQL expression.`]:m!==s?[...u,`Nested field ${g.name} is being queried with the incorrect nested path. The correct path is ${g.subType.nested.path}.`]:u},[]);if(e.length>0)throw new Error(e.join(`
727
- `));return i}function lo(o,r,s=!1){if(o===void 0)throw new Error("fieldName is a required argument");if(r===void 0)throw new Error("value is a required argument");const i=typeof o=="string"?$e(o):ye(o),a=typeof r=="string"?$e(r):ye(r),e=ye(s);return{arguments:[i,a,e]}}function po(o,r,s={},i={}){const{arguments:[a,e,u]}=o,g=Br(a,r,i!=null&&i.nested?i.nested.path:void 0),m=j(g),w=e!==void 0?j(e):e,x=u.value?"phrase":"best_fields";if(g.value===null)return e.type==="wildcard"?{query_string:{query:zt(e)}}:{multi_match:{type:x,query:w,lenient:!0}};const S=r?Bt(g,r):[];S&&S.length===0&&S.push({name:j(g),scripted:!1,type:""});const C=e.type==="wildcard"&&w==="*",k=g.type==="wildcard"&&m==="*"||S&&r&&S.length===r.fields.length;return C&&k?{match_all:{}}:{bool:{should:S.reduce((ie,H)=>{const q=B=>{var Se;return g.type!=="wildcard"||!((Se=H.subType)!=null&&Se.nested)||i!=null&&i.nested?B:{nested:{path:H.subType.nested.path,query:B,score_mode:"none"}}};if(H.scripted)return[];if(C)return[...ie,q({exists:{field:H.name}})];if(e.type==="wildcard")return[...ie,q({query_string:{fields:[H.name],query:zt(e)}})];if(H.type==="date"){const B=s.dateFormatTZ?{time_zone:s.dateFormatTZ}:{};return[...ie,q({range:{[H.name]:{gte:w,lte:w,...B}}})]}else{const B=x==="phrase"?"match_phrase":"match";return[...ie,q({[B]:{[H.name]:w}})]}},[])||[],minimum_should_match:1}}}const uo=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:lo,toOpenSearchQuery:po},Symbol.toStringTag,{value:"Module"}));function ho(o){return{arguments:o}}function fo(o,r,s={},i={}){return{bool:{filter:(o.arguments||[]).map(e=>j(e,r,s,i))}}}const go=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:ho,toOpenSearchQuery:fo},Symbol.toStringTag,{value:"Module"}));function bo(o){return{arguments:o}}function vo(o,r,s={},i={}){return{bool:{should:(o.arguments||[]).map(e=>j(e,r,s,i)),minimum_should_match:1}}}const mo=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:bo,toOpenSearchQuery:vo},Symbol.toStringTag,{value:"Module"}));function yo(o){return{arguments:[o]}}function $o(o,r,s={},i={}){const[a]=o.arguments;return{bool:{must_not:j(a,r,s,i)}}}const _o=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:yo,toOpenSearchQuery:$o},Symbol.toStringTag,{value:"Module"}));function wo(o,...r){let s={};for(let i of r)s[i]=o[i];return s}function So(o,r){const s=wo(r,"gt","lt","gte","lte","format"),i=typeof o=="string"?$e(o):K.literal.buildNode(o),a=Object.entries(s).map(e=>{let[u,g]=e;return K.namedArg.buildNode(u,g)});return{arguments:[i,...a]}}function Ao(o,r,s={},i={}){const[a,...e]=o.arguments,u=Br(a,r,i!=null&&i.nested?i.nested.path:void 0),g=r?Bt(u,r):[],m=xo(e),w=Object.fromEntries(Object.entries(m).map(([S,C])=>[S,j(C)]));return g&&g.length===0&&g.push({name:j(u),scripted:!1,type:""}),{bool:{should:g.map(S=>{const C=k=>{var N;return u.type!=="wildcard"||!((N=S.subType)!=null&&N.nested)||i.nested?k:{nested:{path:S.subType.nested.path,query:k,score_mode:"none"}}};if(S.scripted)return{};if(S.type==="date"){const k=s.dateFormatTZ?{time_zone:s.dateFormatTZ}:{};return C({range:{[S.name]:{...w,...k}}})}return C({range:{[S.name]:w}})}),minimum_should_match:1}}}function xo(o){if(o.gt&&o.gte||o.lt&&o.lte)throw new Error("range ends cannot be both inclusive and exclusive");const r=["gte","lte","format"];return o.reduce((s,i,a)=>(i.type==="namedArg"?s[i.name]=i.value:s[r[a]]=i,s),{})}const ko=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:So,toOpenSearchQuery:Ao},Symbol.toStringTag,{value:"Module"}));function Eo(o){return{arguments:[ye(o)]}}function Co(o,r,s={},i={}){const{arguments:[a]}=o,e={...a,value:i!=null&&i.nested?`${i.nested.path}.${a.value}`:a.value},u=Nt(e),g=((r==null?void 0:r.fields)||[]).find(m=>m.name===u);if(g&&g.scripted)throw new Error("Exists query does not support scripted fields");return{exists:{field:u}}}const Po=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:Eo,toOpenSearchQuery:Co},Symbol.toStringTag,{value:"Module"}));function To(o,r){return{arguments:[typeof o=="string"?$e(o):ye(o),r]}}function Oo(o,r,s={},i={}){var m;const[a,e]=o.arguments,u=j(a),g=(m=i==null?void 0:i.nested)!=null&&m.path?`${i.nested.path}.${u}`:u;return{nested:{path:g,query:j(e,r,s,{...i,nested:{path:g}}),score_mode:"none"}}}const Rt={is:uo,and:go,or:mo,not:_o,range:ko,exists:Po,nested:Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:To,toOpenSearchQuery:Oo},Symbol.toStringTag,{value:"Module"}))};function Lo(o,...r){const s=Rt[o];if(s===void 0)throw new Error(`Unknown function "${o}"`);return{type:"function",function:o,...s.buildNodeParams(...r)}}function Do(o,r){if(Rt[o]===void 0)throw new Error(`Unknown function "${o}"`);return{type:"function",function:o,arguments:r}}function No(o,r,s,i){return Rt[o.function].toOpenSearchQuery(o,r,s,i)}const jo=Object.freeze(Object.defineProperty({__proto__:null,buildNode:Lo,buildNodeWithArgumentNodes:Do,toOpenSearchQuery:No},Symbol.toStringTag,{value:"Module"}));function zo(o,r){const s=r.type==="literal"?r:K.literal.buildNode(r);return{type:"namedArg",name:o,value:s}}function Bo(o){return j(o.value)}const K={function:jo,literal:to,namedArg:Object.freeze(Object.defineProperty({__proto__:null,buildNode:zo,toOpenSearchQuery:Bo},Symbol.toStringTag,{value:"Module"})),wildcard:co},Ro=Y,Mo=(o,r)=>"("+(o.arguments||[]).map(i=>de(i,r)).join(" AND ")+")",Uo=(o,r)=>{var{arguments:[s,i,a]}=o;let e="=";i.type==="wildcard"&&(e="");let u=de(i);a=a.value||typeof u=="string",i.type==="literal"&&a&&(u=`'${u}'`),i.type==="literal"&&!a&&(u=`${u}`);let g=de(s);return g==null?r&&a?`(${r.filter(m=>m.type==="string").map(m=>`${m.name} ILIKE '%${i.value}%'`).join(" OR ")})`:r&&!a&&(i.value===!0||i.value===!1)?`(${r.filter(m=>m.type==="boolean").map(m=>`${m.name}=${i.value}`).join(" OR ")})`:"":g+e+u},Io=(o,r)=>"("+(o.arguments||[]).map(i=>de(i,r)).join(" OR ")+")",Fo=(o,r)=>{const[s]=o.arguments;return"NOT ("+de(s,r)+")"},Qo={gt:">",lt:"<",gte:">=",lte:"<="},Ho={is:Uo,and:Mo,or:Io,not:Fo,range:o=>{const[r,s]=o.arguments;let i=s.value;const a=Qo[s.name];let e=de(i);return i.type==="literal"&&(e=`${e}`),`${r.value} ${a} ${e}`},exists:o=>{const[r]=o.arguments;return`${r.value} IS NOT NULL`},nested:o=>(console.warn("Nested types dont exist in CQL",o),"")},qo={function:(o,r)=>Ho[o.function](o,r),literal:o=>o.value,wildcard:o=>{const{value:r}=o;return` LIKE '${r.split(Ro).join("%")}'`}},de=(o,r)=>{const s=qo[o.type];return s(o,r)},Wo=Y,Vo=o=>({$and:(o.arguments||[]).map(i=>ee(i))}),Yo=o=>{const{arguments:[r,s]}=o;let i=ee(s);if(s.type==="wildcard"&&s.value==="@kuery-wildcard@")return Rr(o);let e={};return e[ee(r)]={$eq:i},e},Ko=o=>({$or:(o.arguments||[]).map(s=>ee(s))}),Zo=o=>{const[r]=o.arguments;let s={};return s={$ne:ee(r)},s},Xo={gt:"$gt",lt:"$lt",gte:"$gte",lte:"$lte"},Go=o=>{const[r,s]=o.arguments;let i=s.value;const a=Xo[s.name];let e=ee(i),u={};return u[r.value]={},u[r.value][a]=e,u},Rr=o=>{const[r]=o.arguments;return{[ee(r)]:{$ne:null}}},Jo={is:Yo,and:Vo,or:Ko,not:Zo,range:Go,exists:Rr,nested:o=>(console.warn("TODO Implement nested search",o),"")},en={function:o=>Jo[o.function](o),literal:o=>o.value,wildcard:o=>{const{value:r}=o;return`/${r.split(Wo).join(".*")}/`}},ee=(o,r)=>{const s=en[o.type];return s(o,r)},tn=Object.freeze(Object.defineProperty({__proto__:null,DQLSyntaxError:jr,doesKueryExpressionHaveLuceneSyntaxError:ro,fromKueryExpression:st,fromLiteralExpression:$e,nodeTypes:K,parse:st,toCql:de,toDSL:j,toMongo:ee,toOpenSearchQuery:j},Symbol.toStringTag,{value:"Module"})),rn=R`
723
+ `}return`Not yet implemented ${this.variant}`}},T([v({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"checked",2),T([v({type:String,reflect:!0})],d.SpectricInput.prototype,"placeholder",2),T([v({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"readonly",2),T([v({type:String,reflect:!0})],d.SpectricInput.prototype,"variant",2),T([v({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"disabled",2),T([v({type:String,reflect:!0})],d.SpectricInput.prototype,"label",2),T([v()],d.SpectricInput.prototype,"hidePasswordLabel",2),T([v()],d.SpectricInput.prototype,"showPasswordLabel",2),T([v({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"showPasswordVisibilityToggle",2),T([v({type:String,reflect:!0})],d.SpectricInput.prototype,"helperText",2),T([v({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"invalid",2),T([v({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"required",2),T([v({type:String,reflect:!0})],d.SpectricInput.prototype,"invalidText",2),T([v()],d.SpectricInput.prototype,"name",2),T([v()],d.SpectricInput.prototype,"pattern",2),T([v({type:Number,reflect:!0})],d.SpectricInput.prototype,"maxCount",2),T([v({reflect:!0})],d.SpectricInput.prototype,"autocomplete",2),T([v({reflect:!0})],d.SpectricInput.prototype,"value",1),T([be("input")],d.SpectricInput.prototype,"_input",2),d.SpectricInput=T([L("spectric-input")],d.SpectricInput);const me=o=>Dt(o===""?void 0:o??void 0),eo="end of input",to={fieldName:"field name",value:"value",literal:"literal",whitespace:"whitespace"};class zr extends Error{constructor(r,s){let i=r.message;if(r.expected){const u=r.expected.map(m=>to[m.description]||m.description).join(", ");let g=r.found?`"${r.found}"`:eo;i=`Expected ${u} but ${g} found.`}const a=[i,s,"-".repeat(r.location.start.offset)+"^"].join(`
724
+ `);super(a),this.name="DQLSyntaxError",this.shortMessage=i}}function ye(o){return{type:"literal",value:o}}function jt(o){return o.value}const ro=Object.freeze(Object.defineProperty({__proto__:null,buildNode:ye,toOpenSearchQuery:jt},Symbol.toStringTag,{value:"Module"})),{SyntaxError:mc,parse:it}=function(){function o(i,a){function e(){this.constructor=i}e.prototype=a.prototype,i.prototype=new e}function r(i,a,e,u){this.message=i,this.expected=a,this.found=e,this.location=u,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,r)}o(r,Error);function s(i){var a=arguments.length>1?arguments[1]:{},e={},u={start:Qi,Literal:or},g=Qi,m=function(t,n){return n.type==="cursor"?{...n,suggestionTypes:["conjunction"]}:t!==null?t:he.function.buildNode("is","*","*")},w=function(){return uc},x=function(t,n){const l=[t,n].find(p=>p.type==="cursor");return l||V("or",[t,n])},S=function(t,n){const l=[t,n].find(p=>p.type==="cursor");return l||V("and",[t,n])},C=function(t){return t.type==="cursor"?t:V("not",[t])},k="(",N={type:"literal",value:"(",description:'"("'},ct=")",ie={type:"literal",value:")",description:'")"'},H=function(t,n){return n.type==="cursor"?{...n,suggestionTypes:["conjunction"]}:t},q=":",B={type:"literal",value:":",description:'":"'},Se="{",qt={type:"literal",value:"{",description:'"{"'},Wt="}",Vt={type:"literal",value:"}",description:'"}"'},Rn=function(t,n,l){return n.type==="cursor"?{...n,nestedPath:n.nestedPath?`${t.value}.${n.nestedPath}`:t.value}:l.type==="cursor"?{...l,suggestionTypes:["conjunction"]}:V("nested",[t,n])},Mn={type:"other",description:"fieldName"},Un=function(t,n,l){if(l.type==="cursor")return{...l,suggestionTypes:["conjunction"]};const p=bc(n,l);return V("range",[t,p])},In=function(t,n){return n.type==="cursor"?{...n,fieldName:t.value,suggestionTypes:["value","conjunction"]}:n(t)},Fn=function(t){if(t.type==="cursor"){const l=`${t.prefix}${t.suffix}`.trim();return{...t,fieldName:l,suggestionTypes:["field","operator","conjunction"]}}const n=se(null);return t(n)},Qn=function(t,n){return n.type==="cursor"?{...n,suggestionTypes:["conjunction"]}:t},Hn=function(t,n){const l=[t,n].find(p=>p.type==="cursor");return l?{...l,suggestionTypes:["value"]}:p=>V("or",[t(p),n(p)])},qn=function(t,n){const l=[t,n].find(p=>p.type==="cursor");return l?{...l,suggestionTypes:["value"]}:p=>V("and",[t(p),n(p)])},Wn=function(t){return t.type==="cursor"?{...list,suggestionTypes:["value"]}:n=>V("not",[t(n)])},Vn={type:"other",description:"value"},Yn=function(t){if(t.type==="cursor")return t;const n=se(!0);return l=>V("is",[l,t,n])},Kn=function(t){if(t.type==="cursor")return t;!fc&&t.type==="wildcard"&&he.wildcard.hasLeadingWildcard(t)&&M("Leading wildcards are disabled. See query:allowLeadingWildcards in Advanced Settings.");const n=se(!1);return l=>V("is",[l,t,n])},Zn={type:"other",description:"OR"},ti="or",ri={type:"literal",value:"or",description:'"or"'},Xn={type:"other",description:"AND"},ii="and",si={type:"literal",value:"and",description:'"and"'},Gn={type:"other",description:"NOT"},oi="not",ni={type:"literal",value:"not",description:'"not"'},Jn={type:"other",description:"literal"},Me='"',Ue={type:"literal",value:'"',description:'"\\""'},Yt=function(t,n,l){const{start:p,end:f}=Qa();return{type:"cursor",start:p.offset,end:f.offset-n.length,prefix:t.join(""),suffix:l.join(""),text:Fa().replace(n,"")}},ea=function(t){return se(t.join(""))},Ie="\\",Fe={type:"literal",value:"\\",description:'"\\\\"'},ta=/^[\\"]/,ra={type:"class",value:'[\\\\"]',description:'[\\\\"]'},lt=function(t){return t},ia=/^[^"]/,sa={type:"class",value:'[^"]',description:'[^"]'},oa=function(t){const n=t.join("").trim();return n==="null"?se(null):n==="true"?se(!0):n==="false"?se(!1):t.includes(os)?gc(n):se(/^(-?[1-9]+\d*([.]\d+)?)$|^(-?0[.]\d*[1-9]+)$|^0$|^0.0$|^[.]\d{1,}$/.test(n)?isFinite(n)&&(n>Number.MAX_SAFE_INTEGER||n<Number.MIN_SAFE_INTEGER)?BigInt(n):Number(n):n)},ai={type:"any",description:"any character"},pt="*",ut={type:"literal",value:"*",description:'"*"'},na=function(){return os},ci="\\t",aa={type:"literal",value:"\\t",description:'"\\\\t"'},ca=function(){return" "},li="\\r",la={type:"literal",value:"\\r",description:'"\\\\r"'},pa=function(){return"\r"},pi="\\n",ua={type:"literal",value:"\\n",description:'"\\\\n"'},da=function(){return`
725
+ `},ha=function(t){return t},fa=/^[\\():<>"*{}]/,ga={type:"class",value:'[\\\\():<>"*{}]',description:'[\\\\():<>"*{}]'},ui="<=",ba={type:"literal",value:"<=",description:'"<="'},va=function(){return"lte"},di=">=",ma={type:"literal",value:">=",description:'">="'},ya=function(){return"gte"},hi="<",fi={type:"literal",value:"<",description:'"<"'},$a=function(){return"lt"},gi=">",bi={type:"literal",value:">",description:'">"'},_a=function(){return"gt"},wa={type:"other",description:"whitespace"},Sa=/^[ \t\r\n]/,Aa={type:"class",value:"[\\ \\t\\r\\n]",description:"[\\ \\t\\r\\n]"},xa=function(){return dc},vi="@kuery-cursor@",ka={type:"literal",value:"@kuery-cursor@",description:'"@kuery-cursor@"'},Ea=function(){return hc},mi="||",Ca={type:"literal",value:"||",description:'"||"'},Pa=function(){M("LuceneOr")},yi="&&",Ta={type:"literal",value:"&&",description:'"&&"'},$i=function(){M("LuceneAnd")},_i="+",wi={type:"literal",value:"+",description:'"+"'},Si="-",Ai={type:"literal",value:"-",description:'"-"'},xi=function(){M("LuceneNot")},ki="!",Ei={type:"literal",value:"!",description:'"!"'},Ci="_exists_",Oa={type:"literal",value:"_exists_",description:'"_exists_"'},La=function(){M("LuceneExists")},Pi=function(){M("LuceneRange")},Ti="?",Oi={type:"literal",value:"?",description:'"?"'},Da=function(){M("LuceneWildcard")},Kt="/",Zt={type:"literal",value:"/",description:'"/"'},Li=/^[^\/]/,Di={type:"class",value:"[^/]",description:"[^/]"},Na=function(){M("LuceneRegex")},Xt="~",Gt={type:"literal",value:"~",description:'"~"'},Ae=/^[0-9]/,xe={type:"class",value:"[0-9]",description:"[0-9]"},ja=function(){M("LuceneFuzzy")},za=function(){M("LuceneProximity")},Ni="^",ji={type:"literal",value:"^",description:'"^"'},Ba=function(){M("LuceneBoost")},Ra=function(){return char},Ma="=",Ua={type:"literal",value:"=",description:'"="'},zi="[",Bi={type:"literal",value:"[",description:'"["'},Ri="]",Mi={type:"literal",value:"]",description:'"]"'},Ui="TO",Ia={type:"literal",value:"TO",description:'"TO"'},c=0,_=0,dt=[{line:1,column:1,seenCR:!1}],W=0,Jt=[],h=0,ht;if("startRule"in a){if(!(a.startRule in u))throw new Error(`Can't start parsing from rule "`+a.startRule+'".');g=u[a.startRule]}function Fa(){return i.substring(_,c)}function Qa(){return ft(_,c)}function M(t){throw Fi(t,null,i.substring(_,c),ft(_,c))}function Ii(t){var n=dt[t],l,p;if(n)return n;for(l=t-1;!dt[l];)l--;for(n=dt[l],n={line:n.line,column:n.column,seenCR:n.seenCR};l<t;)p=i.charAt(l),p===`
726
+ `?(n.seenCR||n.line++,n.column=1,n.seenCR=!1):p==="\r"||p==="\u2028"||p==="\u2029"?(n.line++,n.column=1,n.seenCR=!0):(n.column++,n.seenCR=!1),l++;return dt[t]=n,n}function ft(t,n){var l=Ii(t),p=Ii(n);return{start:{offset:t,line:l.line,column:l.column},end:{offset:n,line:p.line,column:p.column}}}function b(t){c<W||(c>W&&(W=c,Jt=[]),Jt.push(t))}function Fi(t,n,l,p){function f(O){var D=1;for(O.sort(function(oe,U){return oe.description<U.description?-1:oe.description>U.description?1:0});D<O.length;)O[D-1]===O[D]?O.splice(D,1):D++}function $(O,D){function oe(vc){function _t(Z){return Z.charCodeAt(0).toString(16).toUpperCase()}return vc.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(Z){return"\\x0"+_t(Z)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(Z){return"\\x"+_t(Z)}).replace(/[\u0100-\u0FFF]/g,function(Z){return"\\u0"+_t(Z)}).replace(/[\u1000-\uFFFF]/g,function(Z){return"\\u"+_t(Z)})}var U=new Array(O.length),ns,as,He;for(He=0;He<O.length;He++)U[He]=O[He].description;return ns=O.length>1?U.slice(0,-1).join(", ")+" or "+U[O.length-1]:U[0],as=D?'"'+oe(D)+'"':"end of input","Expected "+ns+" but "+as+" found."}return n!==null&&f(n),new r(t!==null?t:$(n,l),n,l,p)}function Qi(){var t,n,l,p;for(t=c,n=[],l=y();l!==e;)n.push(l),l=y();return n!==e?(l=gt(),l===e&&(l=null),l!==e?(p=yt(),p!==e?(_=t,n=m(l,p),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e),t}function gt(){var t,n,l,p;return t=c,_=c,n=w(),n?n=void 0:n=e,n!==e?(l=Ja(),l!==e?(n=[n,l],t=n):(c=t,t=e)):(c=t,t=e),t===e&&(t=c,n=er(),n!==e?(l=bt(),l!==e?(p=gt(),p!==e?(_=t,n=x(n,p),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e),t===e&&(t=er())),t}function er(){var t,n,l,p;return t=c,n=Hi(),n!==e?(l=vt(),l!==e?(p=er(),p!==e?(_=t,n=S(n,p),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e),t===e&&(t=Hi()),t}function Hi(){var t,n,l;return t=c,n=sr(),n!==e?(l=qi(),l!==e?(_=t,n=C(l),t=n):(c=t,t=e)):(c=t,t=e),t===e&&(t=qi()),t}function qi(){var t,n,l,p,f,$;if(t=c,i.charCodeAt(c)===40?(n=k,c++):(n=e,h===0&&b(N)),n!==e){for(l=[],p=y();p!==e;)l.push(p),p=y();l!==e?(p=gt(),p!==e?(f=yt(),f!==e?(i.charCodeAt(c)===41?($=ct,c++):($=e,h===0&&b(ie)),$!==e?(_=t,n=H(p,f),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;return t===e&&(t=Ha()),t}function Ha(){var t,n,l,p,f,$,O,D,oe,U;if(t=c,n=tr(),n!==e){for(l=[],p=y();p!==e;)l.push(p),p=y();if(l!==e)if(i.charCodeAt(c)===58?(p=q,c++):(p=e,h===0&&b(B)),p!==e){for(f=[],$=y();$!==e;)f.push($),$=y();if(f!==e)if(i.charCodeAt(c)===123?($=Se,c++):($=e,h===0&&b(qt)),$!==e){for(O=[],D=y();D!==e;)O.push(D),D=y();O!==e?(D=gt(),D!==e?(oe=yt(),oe!==e?(i.charCodeAt(c)===125?(U=Wt,c++):(U=e,h===0&&b(Vt)),U!==e?(_=t,n=Rn(n,D,oe),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;else c=t,t=e}else c=t,t=e;else c=t,t=e}else c=t,t=e;return t===e&&(t=qa()),t}function qa(){var t;return t=Wa(),t===e&&(t=Va(),t===e&&(t=Ya())),t}function tr(){var t;return h++,t=or(),h--,t===e&&h===0&&b(Mn),t}function Wa(){var t,n,l,p,f,$;if(t=c,n=tr(),n!==e){for(l=[],p=y();p!==e;)l.push(p),p=y();if(l!==e)if(p=Xi(),p!==e){for(f=[],$=y();$!==e;)f.push($),$=y();f!==e?($=or(),$!==e?(_=t,n=Un(n,p,$),t=n):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;else c=t,t=e}else c=t,t=e;return t}function Va(){var t,n,l,p,f,$;if(t=c,n=tr(),n!==e){for(l=[],p=y();p!==e;)l.push(p),p=y();if(l!==e)if(i.charCodeAt(c)===58?(p=q,c++):(p=e,h===0&&b(B)),p!==e){for(f=[],$=y();$!==e;)f.push($),$=y();f!==e?($=rr(),$!==e?(_=t,n=In(n,$),t=n):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;else c=t,t=e}else c=t,t=e;return t}function Ya(){var t,n;return t=c,n=Yi(),n!==e&&(_=t,n=Fn(n)),t=n,t}function rr(){var t,n,l,p,f,$;if(t=c,i.charCodeAt(c)===40?(n=k,c++):(n=e,h===0&&b(N)),n!==e){for(l=[],p=y();p!==e;)l.push(p),p=y();l!==e?(p=Wi(),p!==e?(f=yt(),f!==e?(i.charCodeAt(c)===41?($=ct,c++):($=e,h===0&&b(ie)),$!==e?(_=t,n=Qn(p,f),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;return t===e&&(t=Yi()),t}function Wi(){var t,n,l,p;return t=c,n=ir(),n!==e?(l=bt(),l!==e?(p=Wi(),p!==e?(_=t,n=Hn(n,p),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e),t===e&&(t=ir()),t}function ir(){var t,n,l,p;return t=c,n=Vi(),n!==e?(l=vt(),l!==e?(p=ir(),p!==e?(_=t,n=qn(n,p),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e),t===e&&(t=Vi()),t}function Vi(){var t,n,l;return t=c,n=sr(),n!==e?(l=rr(),l!==e?(_=t,n=Wn(l),t=n):(c=t,t=e)):(c=t,t=e),t===e&&(t=rr()),t}function Yi(){var t,n;return h++,t=c,n=mt(),n!==e&&(_=t,n=Yn(n)),t=n,t===e&&(t=c,n=Ki(),n!==e&&(_=t,n=Kn(n)),t=n),h--,t===e&&(n=e,h===0&&b(Vn)),t}function bt(){var t,n,l,p,f;if(h++,t=c,n=[],l=y(),l!==e)for(;l!==e;)n.push(l),l=y();else n=e;if(n!==e)if(i.substr(c,2).toLowerCase()===ti?(l=i.substr(c,2),c+=2):(l=e,h===0&&b(ri)),l!==e){if(p=[],f=y(),f!==e)for(;f!==e;)p.push(f),f=y();else p=e;p!==e?(n=[n,l,p],t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t===e&&(t=c,_=c,n=w(),n?n=void 0:n=e,n!==e?(l=Gi(),l!==e?(n=[n,l],t=n):(c=t,t=e)):(c=t,t=e)),h--,t===e&&(n=e,h===0&&b(Zn)),t}function vt(){var t,n,l,p,f;if(h++,t=c,n=[],l=y(),l!==e)for(;l!==e;)n.push(l),l=y();else n=e;if(n!==e)if(i.substr(c,3).toLowerCase()===ii?(l=i.substr(c,3),c+=3):(l=e,h===0&&b(si)),l!==e){if(p=[],f=y(),f!==e)for(;f!==e;)p.push(f),f=y();else p=e;p!==e?(n=[n,l,p],t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t===e&&(t=c,_=c,n=w(),n?n=void 0:n=e,n!==e?(l=Ji(),l!==e?(n=[n,l],t=n):(c=t,t=e)):(c=t,t=e)),h--,t===e&&(n=e,h===0&&b(Xn)),t}function sr(){var t,n,l,p;if(h++,t=c,i.substr(c,3).toLowerCase()===oi?(n=i.substr(c,3),c+=3):(n=e,h===0&&b(ni)),n!==e){if(l=[],p=y(),p!==e)for(;p!==e;)l.push(p),p=y();else l=e;l!==e?(n=[n,l],t=n):(c=t,t=e)}else c=t,t=e;return t===e&&(t=c,_=c,n=w(),n?n=void 0:n=e,n!==e?(l=es(),l!==e?(n=[n,l],t=n):(c=t,t=e)):(c=t,t=e)),h--,t===e&&(n=e,h===0&&b(Gn)),t}function or(){var t;return h++,t=mt(),t===e&&(t=Ki()),h--,t===e&&h===0&&b(Jn),t}function mt(){var t,n,l,p,f,$;if(t=c,i.charCodeAt(c)===34?(n=Me,c++):(n=e,h===0&&b(Ue)),n!==e){for(l=[],p=ke();p!==e;)l.push(p),p=ke();if(l!==e)if(p=Qe(),p!==e){for(f=[],$=ke();$!==e;)f.push($),$=ke();f!==e?(i.charCodeAt(c)===34?($=Me,c++):($=e,h===0&&b(Ue)),$!==e?(_=t,n=Yt(l,p,f),t=n):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;else c=t,t=e}else c=t,t=e;if(t===e)if(t=c,i.charCodeAt(c)===34?(n=Me,c++):(n=e,h===0&&b(Ue)),n!==e){for(l=[],p=ke();p!==e;)l.push(p),p=ke();l!==e?(i.charCodeAt(c)===34?(p=Me,c++):(p=e,h===0&&b(Ue)),p!==e?(_=t,n=ea(l),t=n):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;return t}function ke(){var t,n,l;return t=nr(),t===e&&(t=c,i.charCodeAt(c)===92?(n=Ie,c++):(n=e,h===0&&b(Fe)),n!==e?(ta.test(i.charAt(c))?(l=i.charAt(c),c++):(l=e,h===0&&b(ra)),l!==e?(_=t,n=lt(l),t=n):(c=t,t=e)):(c=t,t=e),t===e&&(t=c,n=c,h++,l=Qe(),h--,l===e?n=void 0:(c=n,n=e),n!==e?(ia.test(i.charAt(c))?(l=i.charAt(c),c++):(l=e,h===0&&b(sa)),l!==e?(_=t,n=lt(l),t=n):(c=t,t=e)):(c=t,t=e))),t}function Ki(){var t,n,l,p,f;for(t=c,n=[],l=Ee();l!==e;)n.push(l),l=Ee();if(n!==e)if(l=Qe(),l!==e){for(p=[],f=Ee();f!==e;)p.push(f),f=Ee();p!==e?(_=t,n=Yt(n,l,p),t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;if(t===e){if(t=c,n=[],l=Ee(),l!==e)for(;l!==e;)n.push(l),l=Ee();else n=e;n!==e&&(_=t,n=oa(n)),t=n}return t}function Ee(){var t,n,l,p,f;return t=nr(),t===e&&(t=Za(),t===e&&(t=Xa(),t===e&&(t=Ka(),t===e&&(t=c,n=c,h++,l=Zi(),h--,l===e?n=void 0:(c=n,n=e),n!==e?(l=c,h++,p=Ga(),h--,p===e?l=void 0:(c=l,l=e),l!==e?(p=c,h++,f=Qe(),h--,f===e?p=void 0:(c=p,p=e),p!==e?(i.length>c?(f=i.charAt(c),c++):(f=e,h===0&&b(ai)),f!==e?(_=t,n=lt(f),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)):(c=t,t=e))))),t}function Ka(){var t,n;return t=c,i.charCodeAt(c)===42?(n=pt,c++):(n=e,h===0&&b(ut)),n!==e&&(_=t,n=na()),t=n,t}function yt(){var t,n,l,p,f;for(t=c,n=[],l=y();l!==e;)n.push(l),l=y();if(n!==e)if(l=Qe(),l!==e){for(p=[],f=y();f!==e;)p.push(f),f=y();p!==e?(_=t,n=Yt(n,l,p),t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;if(t===e)for(t=[],n=y();n!==e;)t.push(n),n=y();return t}function nr(){var t,n;return t=c,i.substr(c,2)===ci?(n=ci,c+=2):(n=e,h===0&&b(aa)),n!==e&&(_=t,n=ca()),t=n,t===e&&(t=c,i.substr(c,2)===li?(n=li,c+=2):(n=e,h===0&&b(la)),n!==e&&(_=t,n=pa()),t=n,t===e&&(t=c,i.substr(c,2)===pi?(n=pi,c+=2):(n=e,h===0&&b(ua)),n!==e&&(_=t,n=da()),t=n)),t}function Za(){var t,n,l;return t=c,i.charCodeAt(c)===92?(n=Ie,c++):(n=e,h===0&&b(Fe)),n!==e?(l=Zi(),l!==e?(_=t,n=lt(l),t=n):(c=t,t=e)):(c=t,t=e),t}function Xa(){var t,n,l;return t=c,i.charCodeAt(c)===92?(n=Ie,c++):(n=e,h===0&&b(Fe)),n!==e?(i.substr(c,2).toLowerCase()===ti?(l=i.substr(c,2),c+=2):(l=e,h===0&&b(ri)),l===e&&(i.substr(c,3).toLowerCase()===ii?(l=i.substr(c,3),c+=3):(l=e,h===0&&b(si)),l===e&&(i.substr(c,3).toLowerCase()===oi?(l=i.substr(c,3),c+=3):(l=e,h===0&&b(ni)))),l!==e?(_=t,n=ha(l),t=n):(c=t,t=e)):(c=t,t=e),t}function Ga(){var t;return t=bt(),t===e&&(t=vt(),t===e&&(t=sr())),t}function Zi(){var t;return fa.test(i.charAt(c))?(t=i.charAt(c),c++):(t=e,h===0&&b(ga)),t}function Xi(){var t,n;return t=c,i.substr(c,2)===ui?(n=ui,c+=2):(n=e,h===0&&b(ba)),n!==e&&(_=t,n=va()),t=n,t===e&&(t=c,i.substr(c,2)===di?(n=di,c+=2):(n=e,h===0&&b(ma)),n!==e&&(_=t,n=ya()),t=n,t===e&&(t=c,i.charCodeAt(c)===60?(n=hi,c++):(n=e,h===0&&b(fi)),n!==e&&(_=t,n=$a()),t=n,t===e&&(t=c,i.charCodeAt(c)===62?(n=gi,c++):(n=e,h===0&&b(bi)),n!==e&&(_=t,n=_a()),t=n))),t}function y(){var t;return h++,Sa.test(i.charAt(c))?(t=i.charAt(c),c++):(t=e,h===0&&b(Aa)),h--,t===e&&h===0&&b(wa),t}function Qe(){var t,n,l;return t=c,_=c,n=xa(),n?n=void 0:n=e,n!==e?(i.substr(c,14)===vi?(l=vi,c+=14):(l=e,h===0&&b(ka)),l!==e?(_=t,n=Ea(),t=n):(c=t,t=e)):(c=t,t=e),t}function Gi(){var t,n,l,p,f;for(t=c,n=[],l=y();l!==e;)n.push(l),l=y();if(n!==e)if(i.substr(c,2)===mi?(l=mi,c+=2):(l=e,h===0&&b(Ca)),l!==e){for(p=[],f=y();f!==e;)p.push(f),f=y();p!==e?(_=t,n=Pa(),t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t}function Ji(){var t,n,l,p,f;for(t=c,n=[],l=y();l!==e;)n.push(l),l=y();if(n!==e)if(i.substr(c,2)===yi?(l=yi,c+=2):(l=e,h===0&&b(Ta)),l!==e){for(p=[],f=y();f!==e;)p.push(f),f=y();p!==e?(_=t,n=$i(),t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t===e&&(t=c,i.charCodeAt(c)===43?(n=_i,c++):(n=e,h===0&&b(wi)),n!==e&&(_=t,n=$i()),t=n),t}function es(){var t,n;return t=c,i.charCodeAt(c)===45?(n=Si,c++):(n=e,h===0&&b(Ai)),n!==e&&(_=t,n=xi()),t=n,t===e&&(t=c,i.charCodeAt(c)===33?(n=ki,c++):(n=e,h===0&&b(Ei)),n!==e&&(_=t,n=xi()),t=n),t}function Ja(){var t;return t=ec(),t===e&&(t=ts(),t===e&&(t=tc())),t}function ec(){var t,n,l,p,f,$;if(t=c,n=Ce(),n!==e){for(l=[],p=y();p!==e;)l.push(p),p=y();if(l!==e)if(i.charCodeAt(c)===58?(p=q,c++):(p=e,h===0&&b(B)),p!==e){for(f=[],$=y();$!==e;)f.push($),$=y();f!==e?($=ts(),$!==e?(n=[n,l,p,f,$],t=n):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;else c=t,t=e}else c=t,t=e;return t}function ts(){var t;return t=rc(),t===e&&(t=ar(),t===e&&(t=ic(),t===e&&(t=sc(),t===e&&(t=oc(),t===e&&(t=nc()))))),t}function tc(){var t,n,l,p,f,$;if(t=c,i.substr(c,8)===Ci?(n=Ci,c+=8):(n=e,h===0&&b(Oa)),n!==e){for(l=[],p=y();p!==e;)l.push(p),p=y();if(l!==e)if(i.charCodeAt(c)===58?(p=q,c++):(p=e,h===0&&b(B)),p!==e){for(f=[],$=y();$!==e;)f.push($),$=y();f!==e?($=Ce(),$!==e?(_=t,n=La(),t=n):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;else c=t,t=e}else c=t,t=e;return t}function rc(){var t,n,l,p,f,$,O;if(t=c,n=Xi(),n!==e){for(l=[],p=y();p!==e;)l.push(p),p=y();l!==e?(p=Ce(),p!==e?(_=t,n=Pi(),t=n):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;if(t===e)if(t=c,n=lc(),n!==e){for(l=[],p=y();p!==e;)l.push(p),p=y();l!==e?(p=Ce(),p!==e?(f=ss(),f!==e?($=Ce(),$!==e?(O=pc(),O!==e?(_=t,n=Pi(),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;return t}function ar(){var t,n,l,p,f;for(t=c,n=[],l=$t(),l===e&&(i.charCodeAt(c)===42?(l=pt,c++):(l=e,h===0&&b(ut)));l!==e;)n.push(l),l=$t(),l===e&&(i.charCodeAt(c)===42?(l=pt,c++):(l=e,h===0&&b(ut)));if(n!==e)if(i.charCodeAt(c)===63?(l=Ti,c++):(l=e,h===0&&b(Oi)),l!==e){for(p=[],f=ar();f!==e;)p.push(f),f=ar();p!==e?(_=t,n=Da(),t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t}function ic(){var t,n,l,p;if(t=c,i.charCodeAt(c)===47?(n=Kt,c++):(n=e,h===0&&b(Zt)),n!==e){for(l=[],Li.test(i.charAt(c))?(p=i.charAt(c),c++):(p=e,h===0&&b(Di));p!==e;)l.push(p),Li.test(i.charAt(c))?(p=i.charAt(c),c++):(p=e,h===0&&b(Di));l!==e?(i.charCodeAt(c)===47?(p=Kt,c++):(p=e,h===0&&b(Zt)),p!==e?(_=t,n=Na(),t=n):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;return t}function sc(){var t,n,l,p,f;if(t=c,n=rs(),n!==e)if(i.charCodeAt(c)===126?(l=Xt,c++):(l=e,h===0&&b(Gt)),l!==e){for(p=[],Ae.test(i.charAt(c))?(f=i.charAt(c),c++):(f=e,h===0&&b(xe));f!==e;)p.push(f),Ae.test(i.charAt(c))?(f=i.charAt(c),c++):(f=e,h===0&&b(xe));p!==e?(_=t,n=ja(),t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t}function oc(){var t,n,l,p,f;if(t=c,n=mt(),n!==e)if(i.charCodeAt(c)===126?(l=Xt,c++):(l=e,h===0&&b(Gt)),l!==e){for(p=[],Ae.test(i.charAt(c))?(f=i.charAt(c),c++):(f=e,h===0&&b(xe));f!==e;)p.push(f),Ae.test(i.charAt(c))?(f=i.charAt(c),c++):(f=e,h===0&&b(xe));p!==e?(_=t,n=za(),t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t}function nc(){var t,n,l,p,f;if(t=c,n=Ce(),n!==e)if(i.charCodeAt(c)===94?(l=Ni,c++):(l=e,h===0&&b(ji)),l!==e){for(p=[],Ae.test(i.charAt(c))?(f=i.charAt(c),c++):(f=e,h===0&&b(xe));f!==e;)p.push(f),Ae.test(i.charAt(c))?(f=i.charAt(c),c++):(f=e,h===0&&b(xe));p!==e?(_=t,n=Ba(),t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t}function Ce(){var t;return t=mt(),t===e&&(t=rs()),t}function rs(){var t,n;if(t=[],n=$t(),n!==e)for(;n!==e;)t.push(n),n=$t();else t=e;return t}function $t(){var t,n,l,p;return t=nr(),t===e&&(t=cc(),t===e&&(t=c,n=c,h++,l=is(),h--,l===e?n=void 0:(c=n,n=e),n!==e?(l=c,h++,p=ac(),h--,p===e?l=void 0:(c=l,l=e),l!==e?(i.length>c?(p=i.charAt(c),c++):(p=e,h===0&&b(ai)),p!==e?(n=[n,l,p],t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e))),t}function ac(){var t;return t=bt(),t===e&&(t=vt(),t===e&&(t=Gi(),t===e&&(t=Ji(),t===e&&(t=es(),t===e&&(t=ss()))))),t}function cc(){var t,n,l;return t=c,i.charCodeAt(c)===92?(n=Ie,c++):(n=e,h===0&&b(Fe)),n!==e?(l=is(),l!==e?(_=t,n=Ra(),t=n):(c=t,t=e)):(c=t,t=e),t}function is(){var t;return i.charCodeAt(c)===43?(t=_i,c++):(t=e,h===0&&b(wi)),t===e&&(i.charCodeAt(c)===45?(t=Si,c++):(t=e,h===0&&b(Ai)),t===e&&(i.charCodeAt(c)===61?(t=Ma,c++):(t=e,h===0&&b(Ua)),t===e&&(i.charCodeAt(c)===62?(t=gi,c++):(t=e,h===0&&b(bi)),t===e&&(i.charCodeAt(c)===60?(t=hi,c++):(t=e,h===0&&b(fi)),t===e&&(i.charCodeAt(c)===33?(t=ki,c++):(t=e,h===0&&b(Ei)),t===e&&(i.charCodeAt(c)===40?(t=k,c++):(t=e,h===0&&b(N)),t===e&&(i.charCodeAt(c)===41?(t=ct,c++):(t=e,h===0&&b(ie)),t===e&&(i.charCodeAt(c)===123?(t=Se,c++):(t=e,h===0&&b(qt)),t===e&&(i.charCodeAt(c)===125?(t=Wt,c++):(t=e,h===0&&b(Vt)),t===e&&(i.charCodeAt(c)===91?(t=zi,c++):(t=e,h===0&&b(Bi)),t===e&&(i.charCodeAt(c)===93?(t=Ri,c++):(t=e,h===0&&b(Mi)),t===e&&(i.charCodeAt(c)===94?(t=Ni,c++):(t=e,h===0&&b(ji)),t===e&&(i.charCodeAt(c)===34?(t=Me,c++):(t=e,h===0&&b(Ue)),t===e&&(i.charCodeAt(c)===126?(t=Xt,c++):(t=e,h===0&&b(Gt)),t===e&&(i.charCodeAt(c)===42?(t=pt,c++):(t=e,h===0&&b(ut)),t===e&&(i.charCodeAt(c)===63?(t=Ti,c++):(t=e,h===0&&b(Oi)),t===e&&(i.charCodeAt(c)===58?(t=q,c++):(t=e,h===0&&b(B)),t===e&&(i.charCodeAt(c)===92?(t=Ie,c++):(t=e,h===0&&b(Fe)),t===e&&(i.charCodeAt(c)===47?(t=Kt,c++):(t=e,h===0&&b(Zt))))))))))))))))))))),t}function ss(){var t,n,l,p,f;if(t=c,n=[],l=y(),l!==e)for(;l!==e;)n.push(l),l=y();else n=e;if(n!==e)if(i.substr(c,2)===Ui?(l=Ui,c+=2):(l=e,h===0&&b(Ia)),l!==e){if(p=[],f=y(),f!==e)for(;f!==e;)p.push(f),f=y();else p=e;p!==e?(n=[n,l,p],t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t}function lc(){var t;return i.charCodeAt(c)===91?(t=zi,c++):(t=e,h===0&&b(Bi)),t===e&&(i.charCodeAt(c)===123?(t=Se,c++):(t=e,h===0&&b(qt))),t}function pc(){var t;return i.charCodeAt(c)===93?(t=Ri,c++):(t=e,h===0&&b(Mi)),t===e&&(i.charCodeAt(c)===125?(t=Wt,c++):(t=e,h===0&&b(Vt))),t}const{errorOnLuceneSyntax:uc,parseCursor:dc,cursorSymbol:hc,allowLeadingWildcards:fc=!0,helpers:{nodeTypes:he}}=a,V=he.function.buildNodeWithArgumentNodes,se=he.literal.buildNode,gc=he.wildcard.buildNode,bc=he.namedArg.buildNode,{wildcardSymbol:os}=he.wildcard;if(ht=g(),ht!==e&&c===i.length)return ht;throw ht!==e&&c<i.length&&b({type:"end",description:"end of input"}),Fi(null,Jt,W<i.length?i.charAt(W):null,W<i.length?ft(W,W+1):ft(W,W))}return{SyntaxError:r,parse:s}}(),zt=(o,r={},s=it)=>{if(typeof o>"u")throw new Error("expression must be a string, got undefined instead");return s(o,{...r,helpers:{nodeTypes:K}})},$e=(o,r={})=>zt(o,{...r,startRule:"Literal"},it),st=(o,r={})=>{try{return zt(o,r,it)}catch(s){throw s.name==="SyntaxError"?new zr(s,o):s}},io=o=>{try{return zt(o,{errorOnLuceneSyntax:!0},it),!1}catch(r){return r.message.startsWith("Lucene")}},j=(o,r,s,i)=>(r=void 0,!o||!o.type||!K[o.type]?j(K.function.buildNode("and",[]),r):K[o.type].toOpenSearchQuery(o,r,s,i)),Y="@kuery-wildcard@";function so(o){return o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function oo(o){return o.replace(/[+-=&|><!(){}[\]^"~*?:\\/]/g,"\\$&")}function no(o){return o.includes(Y)?{type:"wildcard",value:o}:$e(o)}function Br(o,r){const{value:s}=o,i=s.split(Y).map(so).join("[\\s\\S]*");return new RegExp(`^${i}$`).test(r)}function ao(o){const{value:r}=o;return r.split(Y).join("*")}function Bt(o){const{value:r}=o;return r.split(Y).map(oo).join("*")}function co(o){const{value:r}=o;return r.startsWith(Y)&&r.replace(Y,"").length>0}const lo=Object.freeze(Object.defineProperty({__proto__:null,buildNode:no,hasLeadingWildcard:co,test:Br,toOpenSearchQuery:ao,toQueryStringQuery:Bt,wildcardSymbol:Y},Symbol.toStringTag,{value:"Module"}));function Rt(o,r){if(!r)return[];if(o.type==="literal"){const s=jt(o),i=r.fields.find(a=>a.name===s);return i?[i]:[]}else if(o.type==="wildcard")return r.fields.filter(i=>Br(o,i.name))}function yc(o){return o}function Rr(o,r,s){const i={...o,value:s?`${s}.${o.value}`:o.value};if(!r||i.type==="wildcard"&&!s)return i;const e=Rt(i,r).reduce((u,g)=>{const m=g.subType&&g.subType.nested?g.subType.nested.path:void 0;return s&&!m?[...u,`${g.name} is not a nested field but is in nested group "${s}" in the DQL expression.`]:m&&!s?[...u,`${g.name} is a nested field, but is not in a nested group in the DQL expression.`]:m!==s?[...u,`Nested field ${g.name} is being queried with the incorrect nested path. The correct path is ${g.subType.nested.path}.`]:u},[]);if(e.length>0)throw new Error(e.join(`
727
+ `));return i}function po(o,r,s=!1){if(o===void 0)throw new Error("fieldName is a required argument");if(r===void 0)throw new Error("value is a required argument");const i=typeof o=="string"?$e(o):ye(o),a=typeof r=="string"?$e(r):ye(r),e=ye(s);return{arguments:[i,a,e]}}function uo(o,r,s={},i={}){const{arguments:[a,e,u]}=o,g=Rr(a,r,i!=null&&i.nested?i.nested.path:void 0),m=j(g),w=e!==void 0?j(e):e,x=u.value?"phrase":"best_fields";if(g.value===null)return e.type==="wildcard"?{query_string:{query:Bt(e)}}:{multi_match:{type:x,query:w,lenient:!0}};const S=r?Rt(g,r):[];S&&S.length===0&&S.push({name:j(g),scripted:!1,type:""});const C=e.type==="wildcard"&&w==="*",k=g.type==="wildcard"&&m==="*"||S&&r&&S.length===r.fields.length;return C&&k?{match_all:{}}:{bool:{should:S.reduce((ie,H)=>{const q=B=>{var Se;return g.type!=="wildcard"||!((Se=H.subType)!=null&&Se.nested)||i!=null&&i.nested?B:{nested:{path:H.subType.nested.path,query:B,score_mode:"none"}}};if(H.scripted)return[];if(C)return[...ie,q({exists:{field:H.name}})];if(e.type==="wildcard")return[...ie,q({query_string:{fields:[H.name],query:Bt(e)}})];if(H.type==="date"){const B=s.dateFormatTZ?{time_zone:s.dateFormatTZ}:{};return[...ie,q({range:{[H.name]:{gte:w,lte:w,...B}}})]}else{const B=x==="phrase"?"match_phrase":"match";return[...ie,q({[B]:{[H.name]:w}})]}},[])||[],minimum_should_match:1}}}const ho=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:po,toOpenSearchQuery:uo},Symbol.toStringTag,{value:"Module"}));function fo(o){return{arguments:o}}function go(o,r,s={},i={}){return{bool:{filter:(o.arguments||[]).map(e=>j(e,r,s,i))}}}const bo=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:fo,toOpenSearchQuery:go},Symbol.toStringTag,{value:"Module"}));function vo(o){return{arguments:o}}function mo(o,r,s={},i={}){return{bool:{should:(o.arguments||[]).map(e=>j(e,r,s,i)),minimum_should_match:1}}}const yo=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:vo,toOpenSearchQuery:mo},Symbol.toStringTag,{value:"Module"}));function $o(o){return{arguments:[o]}}function _o(o,r,s={},i={}){const[a]=o.arguments;return{bool:{must_not:j(a,r,s,i)}}}const wo=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:$o,toOpenSearchQuery:_o},Symbol.toStringTag,{value:"Module"}));function So(o,...r){let s={};for(let i of r)s[i]=o[i];return s}function Ao(o,r){const s=So(r,"gt","lt","gte","lte","format"),i=typeof o=="string"?$e(o):K.literal.buildNode(o),a=Object.entries(s).map(e=>{let[u,g]=e;return K.namedArg.buildNode(u,g)});return{arguments:[i,...a]}}function xo(o,r,s={},i={}){const[a,...e]=o.arguments,u=Rr(a,r,i!=null&&i.nested?i.nested.path:void 0),g=r?Rt(u,r):[],m=ko(e),w=Object.fromEntries(Object.entries(m).map(([S,C])=>[S,j(C)]));return g&&g.length===0&&g.push({name:j(u),scripted:!1,type:""}),{bool:{should:g.map(S=>{const C=k=>{var N;return u.type!=="wildcard"||!((N=S.subType)!=null&&N.nested)||i.nested?k:{nested:{path:S.subType.nested.path,query:k,score_mode:"none"}}};if(S.scripted)return{};if(S.type==="date"){const k=s.dateFormatTZ?{time_zone:s.dateFormatTZ}:{};return C({range:{[S.name]:{...w,...k}}})}return C({range:{[S.name]:w}})}),minimum_should_match:1}}}function ko(o){if(o.gt&&o.gte||o.lt&&o.lte)throw new Error("range ends cannot be both inclusive and exclusive");const r=["gte","lte","format"];return o.reduce((s,i,a)=>(i.type==="namedArg"?s[i.name]=i.value:s[r[a]]=i,s),{})}const Eo=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:Ao,toOpenSearchQuery:xo},Symbol.toStringTag,{value:"Module"}));function Co(o){return{arguments:[ye(o)]}}function Po(o,r,s={},i={}){const{arguments:[a]}=o,e={...a,value:i!=null&&i.nested?`${i.nested.path}.${a.value}`:a.value},u=jt(e),g=((r==null?void 0:r.fields)||[]).find(m=>m.name===u);if(g&&g.scripted)throw new Error("Exists query does not support scripted fields");return{exists:{field:u}}}const To=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:Co,toOpenSearchQuery:Po},Symbol.toStringTag,{value:"Module"}));function Oo(o,r){return{arguments:[typeof o=="string"?$e(o):ye(o),r]}}function Lo(o,r,s={},i={}){var m;const[a,e]=o.arguments,u=j(a),g=(m=i==null?void 0:i.nested)!=null&&m.path?`${i.nested.path}.${u}`:u;return{nested:{path:g,query:j(e,r,s,{...i,nested:{path:g}}),score_mode:"none"}}}const Mt={is:ho,and:bo,or:yo,not:wo,range:Eo,exists:To,nested:Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:Oo,toOpenSearchQuery:Lo},Symbol.toStringTag,{value:"Module"}))};function Do(o,...r){const s=Mt[o];if(s===void 0)throw new Error(`Unknown function "${o}"`);return{type:"function",function:o,...s.buildNodeParams(...r)}}function No(o,r){if(Mt[o]===void 0)throw new Error(`Unknown function "${o}"`);return{type:"function",function:o,arguments:r}}function jo(o,r,s,i){return Mt[o.function].toOpenSearchQuery(o,r,s,i)}const zo=Object.freeze(Object.defineProperty({__proto__:null,buildNode:Do,buildNodeWithArgumentNodes:No,toOpenSearchQuery:jo},Symbol.toStringTag,{value:"Module"}));function Bo(o,r){const s=r.type==="literal"?r:K.literal.buildNode(r);return{type:"namedArg",name:o,value:s}}function Ro(o){return j(o.value)}const K={function:zo,literal:ro,namedArg:Object.freeze(Object.defineProperty({__proto__:null,buildNode:Bo,toOpenSearchQuery:Ro},Symbol.toStringTag,{value:"Module"})),wildcard:lo},Mo=Y,Uo=(o,r)=>"("+(o.arguments||[]).map(i=>de(i,r)).join(" AND ")+")",Io=(o,r)=>{var{arguments:[s,i,a]}=o;let e="=";i.type==="wildcard"&&(e="");let u=de(i);a=a.value||typeof u=="string",i.type==="literal"&&a&&(u=`'${u}'`),i.type==="literal"&&!a&&(u=`${u}`);let g=de(s);return g==null?r&&a?`(${r.filter(m=>m.type==="string").map(m=>`${m.name} ILIKE '%${i.value}%'`).join(" OR ")})`:r&&!a&&(i.value===!0||i.value===!1)?`(${r.filter(m=>m.type==="boolean").map(m=>`${m.name}=${i.value}`).join(" OR ")})`:"":g+e+u},Fo=(o,r)=>"("+(o.arguments||[]).map(i=>de(i,r)).join(" OR ")+")",Qo=(o,r)=>{const[s]=o.arguments;return"NOT ("+de(s,r)+")"},Ho={gt:">",lt:"<",gte:">=",lte:"<="},qo={is:Io,and:Uo,or:Fo,not:Qo,range:o=>{const[r,s]=o.arguments;let i=s.value;const a=Ho[s.name];let e=de(i);return i.type==="literal"&&(e=`${e}`),`${r.value} ${a} ${e}`},exists:o=>{const[r]=o.arguments;return`${r.value} IS NOT NULL`},nested:o=>(console.warn("Nested types dont exist in CQL",o),"")},Wo={function:(o,r)=>qo[o.function](o,r),literal:o=>o.value,wildcard:o=>{const{value:r}=o;return` LIKE '${r.split(Mo).join("%")}'`}},de=(o,r)=>{const s=Wo[o.type];return s(o,r)},Vo=Y,Yo=o=>({$and:(o.arguments||[]).map(i=>ee(i))}),Ko=o=>{const{arguments:[r,s]}=o;let i=ee(s);if(s.type==="wildcard"&&s.value==="@kuery-wildcard@")return Mr(o);let e={};return e[ee(r)]={$eq:i},e},Zo=o=>({$or:(o.arguments||[]).map(s=>ee(s))}),Xo=o=>{const[r]=o.arguments;let s={};return s={$ne:ee(r)},s},Go={gt:"$gt",lt:"$lt",gte:"$gte",lte:"$lte"},Jo=o=>{const[r,s]=o.arguments;let i=s.value;const a=Go[s.name];let e=ee(i),u={};return u[r.value]={},u[r.value][a]=e,u},Mr=o=>{const[r]=o.arguments;return{[ee(r)]:{$ne:null}}},en={is:Ko,and:Yo,or:Zo,not:Xo,range:Jo,exists:Mr,nested:o=>(console.warn("TODO Implement nested search",o),"")},tn={function:o=>en[o.function](o),literal:o=>o.value,wildcard:o=>{const{value:r}=o;return`/${r.split(Vo).join(".*")}/`}},ee=(o,r)=>{const s=tn[o.type];return s(o,r)},rn=Object.freeze(Object.defineProperty({__proto__:null,DQLSyntaxError:zr,doesKueryExpressionHaveLuceneSyntaxError:io,fromKueryExpression:st,fromLiteralExpression:$e,nodeTypes:K,parse:st,toCql:de,toDSL:j,toMongo:ee,toOpenSearchQuery:j},Symbol.toStringTag,{value:"Module"})),sn=R`
728
728
  :host {
729
729
  --dialog-padding: var(--spectric-dialog-padding, 5px);
730
730
  --dialog-background:var(--spectric-background,rgb(246, 249, 252));
@@ -771,7 +771,7 @@ spectric-button{
771
771
  right: 0;
772
772
  top: 0;
773
773
  }
774
- `;var sn=Object.defineProperty,on=Object.getOwnPropertyDescriptor,te=(o,r,s,i)=>{for(var a=i>1?void 0:i?on(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&sn(r,s,a),a};const Mt="spectric-dialog";d.DialogElement=class extends P{constructor(){super(...arguments),this.open=!1,this.dismissable=!0,this.hideBackdrop=!1,this.title="",this.closeOnEscape=!0,this.closeOnOutsideClick=!0,this.clickHandler=async r=>{const s=await this.dialogElement;!this.dismissable||!this.closeOnOutsideClick||s===r.target&&(this.open=!1)},this._handleKeyDown=r=>{this.closeOnEscape||r.preventDefault(),this.open&&this.closeOnEscape&&r.key==="Escape"&&(this.open=!1)},this._onClose=r=>{r.preventDefault(),r.stopPropagation(),this.open=!1,this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}static display(r,s){let i=document.createElement(Mt);i.addEventListener("close",()=>{i.remove()});for(let e in r)i[e]=r[e];let a=document.createDocumentFragment();return Ct(s,a),i.appendChild(a),i.open=!0,document.body.appendChild(i),i}connectedCallback(){super.connectedCallback(),this.dialogElement.then(r=>r.addEventListener("keydown",this._handleKeyDown))}disconnectedCallback(){super.disconnectedCallback(),this.dialogElement.then(r=>r.removeEventListener("keydown",this._handleKeyDown))}updated(r){r.has("open")&&this.dialogElement.then(s=>{this.open?s.showModal():s.close()})}render(){return A`
774
+ `;var on=Object.defineProperty,nn=Object.getOwnPropertyDescriptor,te=(o,r,s,i)=>{for(var a=i>1?void 0:i?nn(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&on(r,s,a),a};const Ut="spectric-dialog";d.DialogElement=class extends P{constructor(){super(...arguments),this.open=!1,this.dismissable=!0,this.hideBackdrop=!1,this.title="",this.closeOnEscape=!0,this.closeOnOutsideClick=!0,this.clickHandler=async r=>{const s=await this.dialogElement;!this.dismissable||!this.closeOnOutsideClick||s===r.target&&(this.open=!1)},this._handleKeyDown=r=>{this.closeOnEscape||r.preventDefault(),this.open&&this.closeOnEscape&&r.key==="Escape"&&(this.open=!1)},this._onClose=r=>{r.preventDefault(),r.stopPropagation(),this.open=!1,this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}static display(r,s){let i=document.createElement(Ut);i.addEventListener("close",()=>{i.remove()});for(let e in r)i[e]=r[e];let a=document.createDocumentFragment();return Pt(s,a),i.appendChild(a),i.open=!0,document.body.appendChild(i),i}connectedCallback(){super.connectedCallback(),this.dialogElement.then(r=>r.addEventListener("keydown",this._handleKeyDown))}disconnectedCallback(){super.disconnectedCallback(),this.dialogElement.then(r=>r.removeEventListener("keydown",this._handleKeyDown))}updated(r){r.has("open")&&this.dialogElement.then(s=>{this.open?s.showModal():s.close()})}render(){return A`
775
775
  <dialog class=${this.hideBackdrop?"":"backdrop"} @close=${this._onClose} @click=${this.clickHandler}>
776
776
  <spectric-panel>
777
777
  <div class="modal">
@@ -787,17 +787,17 @@ spectric-button{
787
787
  </div>
788
788
  </spectric-panel>
789
789
  </dialog>
790
- `}},d.DialogElement.styles=rn,te([v({type:Boolean,reflect:!0})],d.DialogElement.prototype,"open",2),te([v({type:Boolean,reflect:!0})],d.DialogElement.prototype,"dismissable",2),te([v({type:Boolean,reflect:!0})],d.DialogElement.prototype,"hideBackdrop",2),te([v({type:String,reflect:!0})],d.DialogElement.prototype,"title",2),te([v({type:Boolean,reflect:!0})],d.DialogElement.prototype,"closeOnEscape",2),te([v({type:Boolean,reflect:!0})],d.DialogElement.prototype,"closeOnOutsideClick",2),te([Ye("dialog")],d.DialogElement.prototype,"dialogElement",2),d.DialogElement=te([L(Mt)],d.DialogElement);var nn=Object.defineProperty,an=Object.getOwnPropertyDescriptor,Q=(o,r,s,i)=>{for(var a=i>1?void 0:i?an(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&nn(r,s,a),a},Mr=(o=>(o.MONGO="toMongo",o.CQL="toCql",o.DSL="toDSL",o.AST="AST",o))(Mr||{});const Ur={eq:{value:" : ",label:" equals some value"},gt:{value:" > ",label:" is greater than some value"},lt:{value:" < ",label:" is less than some value"},gte:{value:" >= ",label:" is greater than or equal to some value"},lte:{value:" <= ",label:" is less than or equal to some value"}},cn={eq:{value:": ",label:" equals some value"},exists:{value:": *",label:" exists in any form"}},ln=[{value:": true",label:" value is true"},{value:": false",label:"value is false"}],pn=Object.fromEntries(Object.entries(Ur).map(([o,r])=>[o,{value:r.value,label:(r.label||"").replace("value","date-time")}]));d.SpectricQuery=class extends P{constructor(){super(),this.placeholder="",this._value="",this.value="",this.outputLanguage="AST",this.completions=[],this.completionIndex=0,this.fields=[],this._parseQuery=(r=void 0)=>{let s;if(r&&(r!=null&&r.currentTarget)&&r.currentTarget.value&&(this.value=r.currentTarget.value),this.value=="")return;try{r&&r.data=="("&&(this.value=this.value+" )",this._input.setSelectionRange(this.value.length-2,this.value.length-2));let e=this.value;this._input.selectionStart!==null&&(e=e.substring(0,this._input.selectionStart)+"@kuery-cursor@"+e.substring(this._input.selectionStart));let u=st(e,{parseCursor:!0,cursorSymbol:"@kuery-cursor@",allowLeadingWildcards:!1});this.autoComplete(u),s=st(this.value,{allowLeadingWildcards:!1})}catch{return}let i;this.outputLanguage=="AST"?i=s:i=tn[this.outputLanguage](s,this.fields);let a=new CustomEvent("change",{detail:i});this.dispatchEvent(a)},this.getValuesForField=async(r,s)=>(console.log("getValuesForField isn't set no values returned",r,s),[]),this._selectCompletion=async()=>{if(!this.suggestion)return;let r=this.completions[this.completionIndex],s=this.value.substring(0,r.start)+r.value,i=s.length,a=this.value.substring(r.end);if(r.value.includes(a)?this.value=s:this.value=s+this.value.substring(r.end),this._input.setSelectionRange(i,i),r.onSelect){let e=await r.onSelect();e!==void 0&&(this.value+=e,setTimeout(()=>{this._input.focus()}))}this.completionIndex=0,this.completions=[],this._parseQuery()},this._handleArrows=r=>{var s;r.key==="Escape"&&(this.completions=[]),(r.key=="ArrowLeft"||r.key==="ArrowRight")&&setTimeout(this._parseQuery,100),this.completions.length&&["ArrowUp","ArrowDown","Enter","Tab"].includes(r.key)&&this.suggestion&&(r.preventDefault(),(r.key==="ArrowDown"||r.key==="Tab")&&(this.completionIndex+=1,this.completionIndex>this.completions.length-1&&(this.completionIndex=0)),r.key==="ArrowUp"&&(this.completionIndex-=1,this.completionIndex<0&&(this.completionIndex=this.completions.length-1)),(s=this._asyncAutocomplete)==null||s.then(i=>{let a=i.querySelector(".option.active");a&&a.scrollIntoView({block:"nearest"})}),r.key==="Enter"&&this._selectCompletion())},this.uuid=crypto.randomUUID()}createRenderRoot(){return this}async autoComplete(r){if(this.completions=[],r.type!=="cursor")return;let s=[];this.suggestion=r;let{start:i,end:a}=r;for(let e of r.suggestionTypes){if(e=="conjunction"&&r.text.endsWith(" ")&&s.push(...["and ","or "].map(u=>({type:e,value:u,start:a,end:a}))),e==="field"){let u=this.fields.filter(g=>g.name.includes(r.fieldName)||g.name.includes(r.prefix)).map(g=>[{type:e,value:g.name,start:i,end:a}]).flat();s.push(...u)}if(e==="operator"){let u=this.fields.find(g=>g.name===r.fieldName);u&&(u.type==="number"?s.push(...Object.values(Ur).map(g=>({type:e,...g,start:a,end:a}))):u.type==="string"?u.format==="date-time"?s.push(...Object.values(pn).map(g=>({type:e,...g,start:a,end:a,onSelect:async()=>{let m=await this.getValuesForField(r.fieldName,r.prefix);m.length===0&&(m=["now-1m","now-1d","now-1M"]);let w,x=Ze();return await new Promise(S=>{let C=d.DialogElement.display({},A`
790
+ `}},d.DialogElement.styles=sn,te([v({type:Boolean,reflect:!0})],d.DialogElement.prototype,"open",2),te([v({type:Boolean,reflect:!0})],d.DialogElement.prototype,"dismissable",2),te([v({type:Boolean,reflect:!0})],d.DialogElement.prototype,"hideBackdrop",2),te([v({type:String,reflect:!0})],d.DialogElement.prototype,"title",2),te([v({type:Boolean,reflect:!0})],d.DialogElement.prototype,"closeOnEscape",2),te([v({type:Boolean,reflect:!0})],d.DialogElement.prototype,"closeOnOutsideClick",2),te([Ye("dialog")],d.DialogElement.prototype,"dialogElement",2),d.DialogElement=te([L(Ut)],d.DialogElement);var an=Object.defineProperty,cn=Object.getOwnPropertyDescriptor,Q=(o,r,s,i)=>{for(var a=i>1?void 0:i?cn(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&an(r,s,a),a},Ur=(o=>(o.MONGO="toMongo",o.CQL="toCql",o.DSL="toDSL",o.AST="AST",o))(Ur||{});const Ir={eq:{value:" : ",label:" equals some value"},gt:{value:" > ",label:" is greater than some value"},lt:{value:" < ",label:" is less than some value"},gte:{value:" >= ",label:" is greater than or equal to some value"},lte:{value:" <= ",label:" is less than or equal to some value"}},ln={eq:{value:": ",label:" equals some value"},exists:{value:": *",label:" exists in any form"}},pn=[{value:": true",label:" value is true"},{value:": false",label:"value is false"}],un=Object.fromEntries(Object.entries(Ir).map(([o,r])=>[o,{value:r.value,label:(r.label||"").replace("value","date-time")}]));d.SpectricQuery=class extends P{constructor(){super(),this.placeholder="",this._value="",this.value="",this.outputLanguage="AST",this.completions=[],this.completionIndex=0,this.fields=[],this._parseQuery=(r=void 0)=>{let s;if(r&&(r!=null&&r.currentTarget)&&r.currentTarget.value&&(this.value=r.currentTarget.value),this.value=="")return;try{r&&r.data=="("&&(this.value=this.value+" )",this._input.setSelectionRange(this.value.length-2,this.value.length-2));let e=this.value;this._input.selectionStart!==null&&(e=e.substring(0,this._input.selectionStart)+"@kuery-cursor@"+e.substring(this._input.selectionStart));let u=st(e,{parseCursor:!0,cursorSymbol:"@kuery-cursor@",allowLeadingWildcards:!1});this.autoComplete(u),s=st(this.value,{allowLeadingWildcards:!1})}catch{return}let i;this.outputLanguage=="AST"?i=s:i=rn[this.outputLanguage](s,this.fields);let a=new CustomEvent("change",{detail:i});this.dispatchEvent(a)},this.getValuesForField=async(r,s)=>(console.log("getValuesForField isn't set no values returned",r,s),[]),this._selectCompletion=async()=>{if(!this.suggestion)return;let r=this.completions[this.completionIndex],s=this.value.substring(0,r.start)+r.value,i=s.length,a=this.value.substring(r.end);if(r.value.includes(a)?this.value=s:this.value=s+this.value.substring(r.end),this._input.setSelectionRange(i,i),r.onSelect){let e=await r.onSelect();e!==void 0&&(this.value+=e,setTimeout(()=>{this._input.focus()}))}this.completionIndex=0,this.completions=[],this._parseQuery()},this._handleArrows=r=>{var s;r.key==="Escape"&&(this.completions=[]),(r.key=="ArrowLeft"||r.key==="ArrowRight")&&setTimeout(this._parseQuery,100),this.completions.length&&["ArrowUp","ArrowDown","Enter","Tab"].includes(r.key)&&this.suggestion&&(r.preventDefault(),(r.key==="ArrowDown"||r.key==="Tab")&&(this.completionIndex+=1,this.completionIndex>this.completions.length-1&&(this.completionIndex=0)),r.key==="ArrowUp"&&(this.completionIndex-=1,this.completionIndex<0&&(this.completionIndex=this.completions.length-1)),(s=this._asyncAutocomplete)==null||s.then(i=>{let a=i.querySelector(".option.active");a&&a.scrollIntoView({block:"nearest"})}),r.key==="Enter"&&this._selectCompletion())},this.uuid=crypto.randomUUID()}createRenderRoot(){return this}async autoComplete(r){if(this.completions=[],r.type!=="cursor")return;let s=[];this.suggestion=r;let{start:i,end:a}=r;for(let e of r.suggestionTypes){if(e=="conjunction"&&r.text.endsWith(" ")&&s.push(...["and ","or "].map(u=>({type:e,value:u,start:a,end:a}))),e==="field"){let u=this.fields.filter(g=>g.name.includes(r.fieldName)||g.name.includes(r.prefix)).map(g=>[{type:e,value:g.name,start:i,end:a}]).flat();s.push(...u)}if(e==="operator"){let u=this.fields.find(g=>g.name===r.fieldName);u&&(u.type==="number"?s.push(...Object.values(Ir).map(g=>({type:e,...g,start:a,end:a}))):u.type==="string"?u.format==="date-time"?s.push(...Object.values(un).map(g=>({type:e,...g,start:a,end:a,onSelect:async()=>{let m=await this.getValuesForField(r.fieldName,r.prefix);m.length===0&&(m=["now-1m","now-1d","now-1M"]);let w,x=Ze();return await new Promise(S=>{let C=d.DialogElement.display({},A`
791
791
  <div class="query-bar-date-quick-select">
792
792
  ${m.map(k=>A`<a href="#" @click=${N=>{N.preventDefault(),w=`"${k}"`,S(w),C.open=!1}}>${k}</a>`)}
793
793
  </div>
794
794
  <spectric-input variant="datetime-local" @change=${k=>{if(!k.target)return;w=`"${new Date(k.target.value+":00.000Z").toISOString()}"`,x.value.disabled=w===void 0}}></spectric-input>
795
795
  <spectric-button ${Xe(x)} .disabled=${!0} @click=${()=>{S(w),C.open=!1}}>Submit</spectric-button>
796
- `)}),w}}))):s.push(...Object.values(cn).map(g=>({type:e,...g,start:a,end:a}))):u.type==="boolean"&&s.push(...ln.map(g=>({type:e,...g,start:a,end:a}))))}if(e==="value"){let u=this.fields.find(g=>g.name===r.fieldName);if(u&&u.type=="boolean")s.push({type:e,value:"true",start:i,end:a},{type:e,value:"false",start:i,end:a});else{console.log(`invoke callback to get values for ${r.fieldName}`);let g=await this.getValuesForField(r.fieldName,r.prefix);(u==null?void 0:u.type)==="string"&&(g=g.map(m=>`"${m}"`)),s.push(...g.map(m=>({type:e,value:m,start:i,end:a})))}}}if(this.completions=s,this.completions.length&&this._autocomplete){let{width:e,left:u,bottom:g}=this._input.getBoundingClientRect();this._autocomplete.showPopover(),"anchorName"in document.documentElement.style||(this._autocomplete.style.left=`${u+3.75}px`,this._autocomplete.style.top=`${g}px`),this._autocomplete.style.width=`${e-15}px`}}updated(r){r.has("outputLanguage")&&this._parseQuery()}render(){return A`
796
+ `)}),w}}))):s.push(...Object.values(ln).map(g=>({type:e,...g,start:a,end:a}))):u.type==="boolean"&&s.push(...pn.map(g=>({type:e,...g,start:a,end:a}))))}if(e==="value"){let u=this.fields.find(g=>g.name===r.fieldName);if(u&&u.type=="boolean")s.push({type:e,value:"true",start:i,end:a},{type:e,value:"false",start:i,end:a});else{console.log(`invoke callback to get values for ${r.fieldName}`);let g=await this.getValuesForField(r.fieldName,r.prefix);(u==null?void 0:u.type)==="string"&&(g=g.map(m=>`"${m}"`)),s.push(...g.map(m=>({type:e,value:m,start:i,end:a})))}}}if(this.completions=s,this.completions.length&&this._autocomplete){let{width:e,left:u,bottom:g}=this._input.getBoundingClientRect();this._autocomplete.showPopover(),"anchorName"in document.documentElement.style||(this._autocomplete.style.left=`${u+3.75}px`,this._autocomplete.style.top=`${g}px`),this._autocomplete.style.width=`${e-15}px`}}updated(r){r.has("outputLanguage")&&this._parseQuery()}render(){return A`
797
797
  <spectric-input .value=${this.value} .placeholder=${this.placeholder} style=${`anchor-name:--${this.uuid};`} autocomplete="off" @input=${this._parseQuery} @keydown=${this._handleArrows} @change=${r=>r.stopPropagation()}></spectric-input>
798
798
  <div class="autocomplete" popover style=${`position-anchor: --${this.uuid};`}>
799
799
  ${this.completions.map((r,s)=>A`<div @click=${()=>{this.completionIndex=s,this._selectCompletion()}} class=${this.completionIndex==s?"option active":"option"}><span class="optiontype ${r.type}">${r.type}</span> <span class="value">${r.value}</span> <span class="label">${r.label}</span></span> </div></div>`)}
800
- </div>`}},Q([v({type:String,reflect:!0})],d.SpectricQuery.prototype,"placeholder",2),Q([v({type:String,reflect:!0})],d.SpectricQuery.prototype,"value",2),Q([v({type:String,reflect:!0})],d.SpectricQuery.prototype,"outputLanguage",2),Q([ze()],d.SpectricQuery.prototype,"completions",2),Q([ze()],d.SpectricQuery.prototype,"completionIndex",2),Q([v({type:Array,reflect:!0})],d.SpectricQuery.prototype,"fields",2),Q([be(".autocomplete")],d.SpectricQuery.prototype,"_autocomplete",2),Q([Ye(".autocomplete")],d.SpectricQuery.prototype,"_asyncAutocomplete",2),Q([be("spectric-input")],d.SpectricQuery.prototype,"_input",2),d.SpectricQuery=Q([L("spectric-query")],d.SpectricQuery);const Ir=R`
800
+ </div>`}},Q([v({type:String,reflect:!0})],d.SpectricQuery.prototype,"placeholder",2),Q([v({type:String,reflect:!0})],d.SpectricQuery.prototype,"value",2),Q([v({type:String,reflect:!0})],d.SpectricQuery.prototype,"outputLanguage",2),Q([ze()],d.SpectricQuery.prototype,"completions",2),Q([ze()],d.SpectricQuery.prototype,"completionIndex",2),Q([v({type:Array,reflect:!0})],d.SpectricQuery.prototype,"fields",2),Q([be(".autocomplete")],d.SpectricQuery.prototype,"_autocomplete",2),Q([Ye(".autocomplete")],d.SpectricQuery.prototype,"_asyncAutocomplete",2),Q([be("spectric-input")],d.SpectricQuery.prototype,"_input",2),d.SpectricQuery=Q([L("spectric-query")],d.SpectricQuery);const Fr=R`
801
801
  border-color: color-mix(in hsl, var(--panel-color, #0b0b0b), var(--spectric-input-color, #000000) 3%);
802
802
  background-color: var(--panel-color,#0b0b0b);
803
803
  --spectric-input-color: var(--spectric-background);
@@ -805,7 +805,7 @@ spectric-button{
805
805
  --spectric-text-primary:var(--text-primary);
806
806
  --spectric-text-secondary:var(--text-secondary);
807
807
  filter: drop-shadow(0px 1px 3px color-mix(in srgb, var(--text-secondary, #3c4c5b), transparent 50%));
808
- `,Fr=R`
808
+ `,Qr=R`
809
809
  border-color: color-mix(in hsl, var(--panel-color-inverse,#f4f4f4), var(--spectric-input-color, #000000) 3%);
810
810
  background-color: var(--panel-color-inverse,#0b0b0b);
811
811
  color:var(--text-primary,#3c4c5b);
@@ -813,7 +813,7 @@ spectric-button{
813
813
  --spectric-text-primary:var(--text-secondary);
814
814
  --spectric-text-secondary:var(--text-primary);
815
815
  filter: drop-shadow(0px 1px 3px color-mix(in srgb, var(--text-primary, #3c4c5b), transparent 70%));
816
- `,un=R`
816
+ `,dn=R`
817
817
  :host{
818
818
  display:block;
819
819
  border:2px solid black;
@@ -823,20 +823,20 @@ spectric-button{
823
823
 
824
824
  }
825
825
  :host(spectric-panel[level='0']) {
826
- ${Ir};
826
+ ${Fr};
827
827
  }
828
828
 
829
829
  :host(spectric-panel[level='1']) {
830
- ${Fr};
830
+ ${Qr};
831
831
  }
832
832
 
833
833
  :host(spectric-panel[level='2']) {
834
- ${Ir};
834
+ ${Fr};
835
835
  }
836
836
  :host(spectric-panel[level='3']) {
837
- ${Fr};
837
+ ${Qr};
838
838
  }
839
- `;var dn=Object.defineProperty,hn=Object.getOwnPropertyDescriptor,Ut=(o,r,s,i)=>{for(var a=i>1?void 0:i?hn(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&dn(r,s,a),a};d.SpectricPanel=class extends P{constructor(){super(...arguments),this.level=0}updated(){this.layers||(this.layers=this.querySelectorAll("spectric-panel")),this.layers.forEach(r=>{r.setAttribute("level",((this.level+1)%4).toString())}),this.dispatchEvent(new CustomEvent("use-layer",{bubbles:!0,cancelable:!0,composed:!0,detail:{layer:this,level:this.level}}))}render(){return A` <slot></slot> `}},d.SpectricPanel.styles=un,Ut([v({type:Number,reflect:!0})],d.SpectricPanel.prototype,"level",2),Ut([v({attribute:!1})],d.SpectricPanel.prototype,"layers",2),d.SpectricPanel=Ut([L("spectric-panel")],d.SpectricPanel);var fn=Object.defineProperty,gn=Object.getOwnPropertyDescriptor,Qr=(o,r,s,i)=>{for(var a=i>1?void 0:i?gn(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&fn(r,s,a),a};const bn={"--primary":{control:"color"},"--secondary":{control:"color"},"--tertiary":{control:"color"},"--disabled":{control:"color"},"--background":{control:"color"},"--background-inverse":{control:"color"},"--text-primary":{control:"color"},"--text-secondary":{control:"color"},"--text-on-color":{control:"color"},"--border-radius":{control:"text"}},Hr={"--secondary":"#77878b","--tertiary":"#c7c7c7","--disabled":"#000000","--text-primary":"#cccccc","--text-secondary":"#cccccc","--text-on-color":"#ededed","--background":"#181818","--background-inverse":"#37373d"},qr={...Hr,"--primary":"#ffd45a","--text-on-color":"#4f4f4f"},It={undefined:{},light:{},dark:Hr,spectric:qr,spectricFlat:{...qr,"--border-radius":"1px"}},vn=Object.fromEntries(Object.keys(It).map(o=>[o,o])),mn=`
839
+ `;var hn=Object.defineProperty,fn=Object.getOwnPropertyDescriptor,It=(o,r,s,i)=>{for(var a=i>1?void 0:i?fn(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&hn(r,s,a),a};d.SpectricPanel=class extends P{constructor(){super(...arguments),this.level=0}updated(){this.layers||(this.layers=this.querySelectorAll("spectric-panel")),this.layers.forEach(r=>{r.setAttribute("level",((this.level+1)%4).toString())}),this.dispatchEvent(new CustomEvent("use-layer",{bubbles:!0,cancelable:!0,composed:!0,detail:{layer:this,level:this.level}}))}render(){return A` <slot></slot> `}},d.SpectricPanel.styles=dn,It([v({type:Number,reflect:!0})],d.SpectricPanel.prototype,"level",2),It([v({attribute:!1})],d.SpectricPanel.prototype,"layers",2),d.SpectricPanel=It([L("spectric-panel")],d.SpectricPanel);var gn=Object.defineProperty,bn=Object.getOwnPropertyDescriptor,Hr=(o,r,s,i)=>{for(var a=i>1?void 0:i?bn(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&gn(r,s,a),a};const vn={"--primary":{control:"color"},"--secondary":{control:"color"},"--tertiary":{control:"color"},"--disabled":{control:"color"},"--background":{control:"color"},"--background-inverse":{control:"color"},"--text-primary":{control:"color"},"--text-secondary":{control:"color"},"--text-on-color":{control:"color"},"--border-radius":{control:"text"}},qr={"--secondary":"#77878b","--tertiary":"#c7c7c7","--disabled":"#000000","--text-primary":"#cccccc","--text-secondary":"#cccccc","--text-on-color":"#ededed","--background":"#181818","--background-inverse":"#37373d"},Wr={...qr,"--primary":"#ffd45a","--text-on-color":"#4f4f4f"},Ft={undefined:{},light:{},dark:qr,spectric:Wr,spectricFlat:{...Wr,"--border-radius":"1px"}},mn=Object.fromEntries(Object.keys(Ft).map(o=>[o,o])),yn=`
840
840
  --spectric-background: var(--background,#ffffff);
841
841
  --spectric-background-hover:var(--background-hover,rgba(141, 141, 141, 0.12));
842
842
  --spectric-background-inverse: var(--background-inverse,#f4f4f4);
@@ -879,12 +879,12 @@ spectric-button{
879
879
  --spectric-text-on-color-disabled: var(--disabled,#c6c6c6)
880
880
  --spectric-button-disabled: #c6c6c6;
881
881
  color: var(--spectric-text-primary);
882
- `;d.SpectricThemeProvider=class extends P{constructor(){super(...arguments),this.theme="undefined"}updated(r){if(r.has("theme")&&this.theme!=r.get("theme")){const s={old:r.get("theme"),new:this.theme};this.dispatchEvent(new CustomEvent("theme-change",{detail:s,bubbles:!0,composed:!0}))}}render(){let r=Object.keys(It).includes(this.theme)?this.theme:"undefined",s=Object.entries(It[r]).map(i=>`${i[0]}:${i[1]};`).join(`
882
+ `;d.SpectricThemeProvider=class extends P{constructor(){super(...arguments),this.theme="undefined"}updated(r){if(r.has("theme")&&this.theme!=r.get("theme")){const s={old:r.get("theme"),new:this.theme};this.dispatchEvent(new CustomEvent("theme-change",{detail:s,bubbles:!0,composed:!0}))}}render(){let r=Object.keys(Ft).includes(this.theme)?this.theme:"undefined",s=Object.entries(Ft[r]).map(i=>`${i[0]}:${i[1]};`).join(`
883
883
  `);return A`
884
884
  ${this.theme&&this.theme!=="light"?A`
885
885
  <style>:host{
886
886
  ${s};
887
- ${mn}
887
+ ${yn}
888
888
  }
889
889
  /* Webkit psudo elements don't pick up variables defined by the host */
890
890
  ::-webkit-scrollbar-thumb {
@@ -957,7 +957,7 @@ spectric-button{
957
957
  <slot></slot>
958
958
  `}},d.SpectricThemeProvider.styles=R`:host{
959
959
  display:contents;
960
- }`,Qr([v({reflect:!0})],d.SpectricThemeProvider.prototype,"theme",2),d.SpectricThemeProvider=Qr([L("spectric-theme")],d.SpectricThemeProvider);const yn=R`
960
+ }`,Hr([v({reflect:!0})],d.SpectricThemeProvider.prototype,"theme",2),d.SpectricThemeProvider=Hr([L("spectric-theme")],d.SpectricThemeProvider);const $n=R`
961
961
  :host {
962
962
  display: block;
963
963
  height: 100%;
@@ -1020,7 +1020,7 @@ spectric-button{
1020
1020
  width: 5px;
1021
1021
  cursor: ew-resize;
1022
1022
  }
1023
- `;var $n=Object.defineProperty,_n=Object.getOwnPropertyDescriptor,z=(o,r,s,i)=>{for(var a=i>1?void 0:i?_n(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&$n(r,s,a),a},Wr=(o=>(o.horizontal="horizontal",o.vertical="vertical",o))(Wr||{});const Vr="spectric-splitview";d.SplitView=class extends Lr{constructor(){super(),this.orientation="horizontal",this.percentage=50,this.invisible=!1,this.min=10,this.max=90,this.useSavedState=!0,this.isDragging=!1,this._error=!1,this._emitChange=()=>{let{percentage:s,orientation:i,invisible:a,min:e,max:u,useSavedState:g}=this,m=this.getAttribute("id");m&&this.useSavedState&&localStorage.setItem(`splitview-${m}`,String(s)),this.dispatchEvent(new CustomEvent("change",{detail:{orientation:i,percentage:s,invisible:a,min:e,max:u,useSavedState:g}}))},this._onMouseMove=Dr(s=>{if(this.isDragging){const i=this.getBoundingClientRect();let a,e;this.orientation==="horizontal"?(a=s.clientX-i.left,e=a/i.width*100):(a=s.clientY-i.top,e=a/i.height*100),e=Math.min(Math.max(e,this.min),this.max),this.percentage=e,this._emitChange()}}),this._assignSlot=s=>{if(!s.target)return;let a=s.target.assignedNodes().filter(e=>e instanceof HTMLElement);a.length>2&&console.log("cannot assign more than 2 elements to a split view"),a.forEach(e=>{if(this._panel1.assignedNodes().length===0){e.slot="panel1";return}if(this._panel2.assignedNodes().length===0){e.slot="panel2";return}this._error="Too many element assigned to split view splitter can only have a maximum of 2 children",console.warn("Too many element assigned to split view splitter can only have a maximum of 2 children")})};let r=this.getAttribute("id");if(r&&this.useSavedState){let s=localStorage.getItem(`splitview-${r}`);s&&(this.percentage=parseFloat(s))}this.addDisposableListener(this._splitter,"mousedown",()=>{this.isDragging=!0}),this.addDisposableListener(this._splitter,"dblclick",()=>{this.percentage=50,this._emitChange()}),this.addDisposableListener(document.body,"mousemove",this._onMouseMove),this.addDisposableListener(document.body,"mouseup",()=>{this.isDragging=!1})}updated(r){r.has("percentage")&&(this.percentage=Math.min(Math.max(Number(this.percentage),this.min),this.max))}render(){return A`
1023
+ `;var _n=Object.defineProperty,wn=Object.getOwnPropertyDescriptor,z=(o,r,s,i)=>{for(var a=i>1?void 0:i?wn(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&_n(r,s,a),a},Vr=(o=>(o.horizontal="horizontal",o.vertical="vertical",o))(Vr||{});const Yr="spectric-splitview";d.SplitView=class extends Dr{constructor(){super(),this.orientation="horizontal",this.percentage=50,this.invisible=!1,this.min=10,this.max=90,this.useSavedState=!0,this.isDragging=!1,this._error=!1,this._emitChange=()=>{let{percentage:s,orientation:i,invisible:a,min:e,max:u,useSavedState:g}=this,m=this.getAttribute("id");m&&this.useSavedState&&localStorage.setItem(`splitview-${m}`,String(s)),this.dispatchEvent(new CustomEvent("change",{detail:{orientation:i,percentage:s,invisible:a,min:e,max:u,useSavedState:g}}))},this._onMouseMove=Nr(s=>{if(this.isDragging){const i=this.getBoundingClientRect();let a,e;this.orientation==="horizontal"?(a=s.clientX-i.left,e=a/i.width*100):(a=s.clientY-i.top,e=a/i.height*100),e=Math.min(Math.max(e,this.min),this.max),this.percentage=e,this._emitChange()}}),this._assignSlot=s=>{if(!s.target)return;let a=s.target.assignedNodes().filter(e=>e instanceof HTMLElement);a.length>2&&console.log("cannot assign more than 2 elements to a split view"),a.forEach(e=>{if(this._panel1.assignedNodes().length===0){e.slot="panel1";return}if(this._panel2.assignedNodes().length===0){e.slot="panel2";return}this._error="Too many element assigned to split view splitter can only have a maximum of 2 children",console.warn("Too many element assigned to split view splitter can only have a maximum of 2 children")})};let r=this.getAttribute("id");if(r&&this.useSavedState){let s=localStorage.getItem(`splitview-${r}`);s&&(this.percentage=parseFloat(s))}this.addDisposableListener(this._splitter,"mousedown",()=>{this.isDragging=!0}),this.addDisposableListener(this._splitter,"dblclick",()=>{this.percentage=50,this._emitChange()}),this.addDisposableListener(document.body,"mousemove",this._onMouseMove),this.addDisposableListener(document.body,"mouseup",()=>{this.isDragging=!1})}updated(r){r.has("percentage")&&(this.percentage=Math.min(Math.max(Number(this.percentage),this.min),this.max))}render(){return A`
1024
1024
  <div class="split-view ${this.orientation} ${this._error?"error":""} ${this.isDragging?"active":""}" style="--split-percentage: ${this.percentage}%;">
1025
1025
  <span class="error-display">${this._error}</span>
1026
1026
  <div class="panel" style="${this.orientation==="horizontal"?"flex: var(--split-percentage, 50%)":"max-height: var(--split-percentage, 50%)"}">
@@ -1032,7 +1032,7 @@ spectric-button{
1032
1032
  </div>
1033
1033
  </div>
1034
1034
  <slot @slotchange=${this._assignSlot} style="display:none"></slot>
1035
- `}},d.SplitView.styles=yn,z([v({type:String})],d.SplitView.prototype,"orientation",2),z([v({type:Number,reflect:!0})],d.SplitView.prototype,"percentage",2),z([v({type:Boolean})],d.SplitView.prototype,"invisible",2),z([v({type:Number,reflect:!0})],d.SplitView.prototype,"min",2),z([v({type:Number,reflect:!0})],d.SplitView.prototype,"max",2),z([v({type:Boolean,reflect:!0})],d.SplitView.prototype,"useSavedState",2),z([ze()],d.SplitView.prototype,"isDragging",2),z([ze()],d.SplitView.prototype,"_error",2),z([Ye(".splitter")],d.SplitView.prototype,"_splitter",2),z([be("slot[name='panel1']")],d.SplitView.prototype,"_panel1",2),z([be("slot[name='panel2']")],d.SplitView.prototype,"_panel2",2),d.SplitView=z([L(Vr)],d.SplitView);var wn=Object.defineProperty,Sn=Object.getOwnPropertyDescriptor,_e=(o,r,s,i)=>{for(var a=i>1?void 0:i?Sn(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&wn(r,s,a),a};const Yr="spectric-pagination";console.log("Pagination"),d.PaginationElement=class extends P{constructor(){super(...arguments),this.page=1,this.pageSize=10,this.pageSizeOptions=[10,20,50,100,1e3],this.size="xsmall",this._handlePageUp=()=>{this.page+=1,this._emitChange()},this._handlePageDown=()=>{this.page-=1,this._emitChange()},this._handleSizeChange=r=>{let s=parseInt(r.target.value);this.pageSize=s,this._emitChange()},this._emitChange=()=>{let{page:r,pageSize:s}=this;this.dispatchEvent(new CustomEvent("change",{detail:{page:r,pageSize:s}}))}}createRenderRoot(){return this}updated(r){r.has("pageSize")&&!this.pageSizeOptions.includes(this.pageSize)&&(this.pageSizeOptions=[...this.pageSizeOptions,this.pageSize].sort((s,i)=>s-i))}render(){let r=this.page*this.pageSize,s=!0;this.totalItems&&r<this.totalItems&&(s=!1);let i="";return this.totalItems&&(i=`${this.page} of ${Math.ceil(this.totalItems/this.pageSize)}`),A`
1035
+ `}},d.SplitView.styles=$n,z([v({type:String})],d.SplitView.prototype,"orientation",2),z([v({type:Number,reflect:!0})],d.SplitView.prototype,"percentage",2),z([v({type:Boolean})],d.SplitView.prototype,"invisible",2),z([v({type:Number,reflect:!0})],d.SplitView.prototype,"min",2),z([v({type:Number,reflect:!0})],d.SplitView.prototype,"max",2),z([v({type:Boolean,reflect:!0})],d.SplitView.prototype,"useSavedState",2),z([ze()],d.SplitView.prototype,"isDragging",2),z([ze()],d.SplitView.prototype,"_error",2),z([Ye(".splitter")],d.SplitView.prototype,"_splitter",2),z([be("slot[name='panel1']")],d.SplitView.prototype,"_panel1",2),z([be("slot[name='panel2']")],d.SplitView.prototype,"_panel2",2),d.SplitView=z([L(Yr)],d.SplitView);var Sn=Object.defineProperty,An=Object.getOwnPropertyDescriptor,_e=(o,r,s,i)=>{for(var a=i>1?void 0:i?An(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&Sn(r,s,a),a};const Kr="spectric-pagination";console.log("Pagination"),d.PaginationElement=class extends P{constructor(){super(...arguments),this.page=1,this.pageSize=10,this.pageSizeOptions=[10,20,50,100,1e3],this.size="xsmall",this._handlePageUp=()=>{this.page+=1,this._emitChange()},this._handlePageDown=()=>{this.page-=1,this._emitChange()},this._handleSizeChange=r=>{let s=parseInt(r.target.value);this.pageSize=s,this._emitChange()},this._emitChange=()=>{let{page:r,pageSize:s}=this;this.dispatchEvent(new CustomEvent("change",{detail:{page:r,pageSize:s}}))}}createRenderRoot(){return this}updated(r){r.has("pageSize")&&!this.pageSizeOptions.includes(this.pageSize)&&(this.pageSizeOptions=[...this.pageSizeOptions,this.pageSize].sort((s,i)=>s-i))}render(){let r=this.page*this.pageSize,s=!0;this.totalItems&&r<this.totalItems&&(s=!1);let i="";return this.totalItems&&(i=`${this.page} of ${Math.ceil(this.totalItems/this.pageSize)}`),A`
1036
1036
  <div class="spectric-pagination-container">
1037
1037
  <div>
1038
1038
  <!-- TODO/FIXME Make a select component and use it for cross browser styling-->
@@ -1053,32 +1053,32 @@ spectric-button{
1053
1053
  </div>
1054
1054
  `:null}
1055
1055
  </div>
1056
- `}},_e([v({type:Number,reflect:!0})],d.PaginationElement.prototype,"page",2),_e([v({type:Number,reflect:!0})],d.PaginationElement.prototype,"pageSize",2),_e([v({type:Number,reflect:!0})],d.PaginationElement.prototype,"totalItems",2),_e([v({type:Array})],d.PaginationElement.prototype,"pageSizeOptions",2),_e([v({type:String,reflect:!0})],d.PaginationElement.prototype,"size",2),d.PaginationElement=_e([L(Yr)],d.PaginationElement);var An=Object.defineProperty,xn=Object.getOwnPropertyDescriptor,Kr=(o,r,s,i)=>{for(var a=i>1?void 0:i?xn(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&An(r,s,a),a};const kn="spectric-table-header";let Ft=class extends P{constructor(){super(...arguments),this.columns=[]}createRenderRoot(){return this}render(){return A`
1056
+ `}},_e([v({type:Number,reflect:!0})],d.PaginationElement.prototype,"page",2),_e([v({type:Number,reflect:!0})],d.PaginationElement.prototype,"pageSize",2),_e([v({type:Number,reflect:!0})],d.PaginationElement.prototype,"totalItems",2),_e([v({type:Array})],d.PaginationElement.prototype,"pageSizeOptions",2),_e([v({type:String,reflect:!0})],d.PaginationElement.prototype,"size",2),d.PaginationElement=_e([L(Kr)],d.PaginationElement);var xn=Object.defineProperty,kn=Object.getOwnPropertyDescriptor,Zr=(o,r,s,i)=>{for(var a=i>1?void 0:i?kn(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&xn(r,s,a),a};const En="spectric-table-header";let Qt=class extends P{constructor(){super(...arguments),this.columns=[]}createRenderRoot(){return this}render(){return A`
1057
1057
  <tr>
1058
1058
  ${this.columns.map(o=>{let r=["header-contents"];return o.filterable,A`<td><div class=${r.join(" ")}>${o.title||o.key}</div></td>`})}
1059
1059
  </tr>
1060
- `}};Kr([v({type:Array,attribute:!1})],Ft.prototype,"columns",2),Ft=Kr([L(kn)],Ft);var En=Object.defineProperty,Cn=Object.getOwnPropertyDescriptor,ot=(o,r,s,i)=>{for(var a=i>1?void 0:i?Cn(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&En(r,s,a),a};const Pn="spectric-table-cell";let Re=class extends P{constructor(){super(),this._handleFilterOut=()=>{let o;this.column.key&&typeof this.row=="object"&&(o=this.row[this.column.key]),this.dispatchEvent(new CustomEvent("filter",{composed:!0,bubbles:!0,detail:{include:!1,row:this.row,value:o,column:this.column}}))},this._handleFilterFor=()=>{let o;this.column.key&&typeof this.row=="object"&&(o=this.row[this.column.key]),this.dispatchEvent(new CustomEvent("filter",{composed:!0,bubbles:!0,detail:{include:!0,row:this.row,value:o,column:this.column}}))},this.styleRules=document.createElement("span").style}updated(o){Object.assign(this.td.style,this.styleRules)}createRenderRoot(){return this}render(){let o;this.column.render?o=this.column.render(this.row,this.table):this.column.key&&typeof this.row=="object"?o=this.row[this.column.key]:o=A`error`;let r=["cell-contents"];this.column.filterable&&r.push("filterable");let s=A`<div class="table-cell-actions">
1060
+ `}};Zr([v({type:Array,attribute:!1})],Qt.prototype,"columns",2),Qt=Zr([L(En)],Qt);var Cn=Object.defineProperty,Pn=Object.getOwnPropertyDescriptor,ot=(o,r,s,i)=>{for(var a=i>1?void 0:i?Pn(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&Cn(r,s,a),a};const Tn="spectric-table-cell";let Re=class extends P{constructor(){super(),this._handleFilterOut=()=>{let o;this.column.key&&typeof this.row=="object"&&(o=nt(this.row,this.column.key)),this.dispatchEvent(new CustomEvent("filter",{composed:!0,bubbles:!0,detail:{include:!1,row:this.row,value:o,column:this.column}}))},this._handleFilterFor=()=>{let o;this.column.key&&typeof this.row=="object"&&(o=nt(this.row,this.column.key)),this.dispatchEvent(new CustomEvent("filter",{composed:!0,bubbles:!0,detail:{include:!0,row:this.row,value:o,column:this.column}}))},this.styleRules=document.createElement("span").style}updated(o){Object.assign(this.td.style,this.styleRules)}createRenderRoot(){return this}render(){let o;this.column.render?o=this.column.render(this.row,this.table):this.column.key&&typeof this.row=="object"?o=nt(this.row,this.column.key):o=A`error`;let r=["cell-contents"];this.column.filterable&&r.push("filterable");let s=A`<div class="table-cell-actions">
1061
1061
  <spectric-button @click=${this._handleFilterOut} size="tiny" variant="text" icon tooltip="Filter Out Value">-</spectric-button>
1062
1062
  <spectric-button @click=${this._handleFilterFor} size="tiny" variant="text" icon tooltip="Filter For Value">+</spectric-button></div>`;return this.styleRules={...this.styleRules,width:this.column.width?this.column.width+"px":"",whiteSpace:this.column.whiteSpace||""},A`
1063
1063
  <td>
1064
1064
  ${this.column.filterable?s:null}
1065
1065
  <div class=${r.join(" ")}>${o}</div>
1066
1066
  </td>
1067
- `}};ot([v({type:Object,attribute:!1})],Re.prototype,"row",2),ot([v({type:Object,attribute:!1})],Re.prototype,"column",2),ot([be("td")],Re.prototype,"td",2),Re=ot([L(Pn)],Re);var Tn=Object.defineProperty,On=Object.getOwnPropertyDescriptor,Qt=(o,r,s,i)=>{for(var a=i>1?void 0:i?On(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&Tn(r,s,a),a};const Ln="spectric-table-body";let nt=class extends P{constructor(){super(...arguments),this.data=[],this.columns=[]}createRenderRoot(){return this}render(){return A`
1067
+ `}};ot([v({type:Object,attribute:!1})],Re.prototype,"row",2),ot([v({type:Object,attribute:!1})],Re.prototype,"column",2),ot([be("td")],Re.prototype,"td",2),Re=ot([L(Tn)],Re);const nt=(o,r)=>{let s=r.split("."),i=o[s[0]];return s.length>1&&(i=nt(i,s.slice(1).join("."))),i};var On=Object.defineProperty,Ln=Object.getOwnPropertyDescriptor,Ht=(o,r,s,i)=>{for(var a=i>1?void 0:i?Ln(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&On(r,s,a),a};const Dn="spectric-table-body";let at=class extends P{constructor(){super(...arguments),this.data=[],this.columns=[]}createRenderRoot(){return this}render(){return A`
1068
1068
  <body>
1069
1069
  ${this.data.map(o=>A`<tr>${this.columns.map(r=>A`<spectric-table-cell .column=${r} .row=${o} .columns=${this.columns}></spectric-table-cell>`)}</tr>`)}
1070
1070
  </body>
1071
- `}};Qt([v({type:Array,attribute:!1})],nt.prototype,"data",2),Qt([v({type:Array,attribute:!1})],nt.prototype,"columns",2),nt=Qt([L(Ln)],nt);var Dn=Object.defineProperty,Nn=Object.getOwnPropertyDescriptor,we=(o,r,s,i)=>{for(var a=i>1?void 0:i?Nn(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&Dn(r,s,a),a};const Zr="spectric-table";d.TableElement=class extends P{constructor(){super(...arguments),this.data=[],this.columns=[],this._handlePaginationChange=r=>{r.preventDefault(),r.stopPropagation(),this.pagination&&(this.pagination.size,this.pagination={...this.pagination,...r.detail}),this._emitChange()},this._emitChange=()=>{let{pagination:r}=this;this.dispatchEvent(new CustomEvent("change",{detail:{pagination:r}}))},this.__DO_NOT_USE_filter=()=>{this.dispatchEvent(new CustomEvent("filter"))},this.selected=[],this._handleSelectAllChange=r=>{r.stopPropagation(),r.target.checked?this.selected=[...this.data]:this.selected=[],this.dispatchEvent(new CustomEvent("select",{detail:this.selected}))}}createRenderRoot(){return this}render(){let r=this.columns.filter(s=>!s.hidden);return this.select&&r.unshift({title:this.select==="multi"?A`<spectric-input variant="checkbox" @change=${this._handleSelectAllChange} .helperText=${"Select All"}></spectric-input>`:null,render:s=>A`<spectric-input variant="checkbox" .checked=${this.selected.includes(s)} @change=${i=>{if(i.stopPropagation(),this.select==="single"&&(this.selected=[]),i.target.checked)this.selected.push(s),this.dispatchEvent(new CustomEvent("select",{detail:this.selected}));else{let a=this.selected.findIndex(e=>e===s);a!==-1&&(this.selected.splice(a,1),this.dispatchEvent(new CustomEvent("select",{detail:this.selected})))}}}></spectric-input>`}),A`
1071
+ `}};Ht([v({type:Array,attribute:!1})],at.prototype,"data",2),Ht([v({type:Array,attribute:!1})],at.prototype,"columns",2),at=Ht([L(Dn)],at);var Nn=Object.defineProperty,jn=Object.getOwnPropertyDescriptor,we=(o,r,s,i)=>{for(var a=i>1?void 0:i?jn(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&Nn(r,s,a),a};const Xr="spectric-table";d.TableElement=class extends P{constructor(){super(...arguments),this.data=[],this.columns=[],this._handlePaginationChange=r=>{r.preventDefault(),r.stopPropagation(),this.pagination&&(this.pagination.size,this.pagination={...this.pagination,...r.detail}),this._emitChange()},this._emitChange=()=>{let{pagination:r}=this;this.dispatchEvent(new CustomEvent("change",{detail:{pagination:r}}))},this.__DO_NOT_USE_filter=()=>{this.dispatchEvent(new CustomEvent("filter"))},this.selected=[],this._handleSelectAllChange=r=>{r.stopPropagation(),r.target.checked?this.selected=[...this.data]:this.selected=[],this.dispatchEvent(new CustomEvent("select",{detail:this.selected}))}}createRenderRoot(){return this}render(){let r=this.columns.filter(s=>!s.hidden);return this.select&&r.unshift({title:this.select==="multi"?A`<spectric-input variant="checkbox" @change=${this._handleSelectAllChange} .helperText=${"Select All"}></spectric-input>`:null,render:s=>A`<spectric-input variant="checkbox" .checked=${this.selected.includes(s)} @change=${i=>{if(i.stopPropagation(),this.select==="single"&&(this.selected=[]),i.target.checked)this.selected.push(s),this.dispatchEvent(new CustomEvent("select",{detail:this.selected}));else{let a=this.selected.findIndex(e=>e===s);a!==-1&&(this.selected.splice(a,1),this.dispatchEvent(new CustomEvent("select",{detail:this.selected})))}}}></spectric-input>`}),A`
1072
1072
  <div role="table">
1073
1073
  <spectric-table-header .columns=${r}></spectric-table-header>
1074
1074
  <spectric-table-body .columns=${r} .data=${this.data} .table=${this}></spectric-table-body>
1075
1075
  </div>
1076
1076
  ${this.pagination?A`<spectric-pagination ${tt(this.pagination)} @change=${this._handlePaginationChange}></spectric-pagination>`:null}
1077
- `}},we([v({type:Array,attribute:!1})],d.TableElement.prototype,"data",2),we([v({type:Object,attribute:!1})],d.TableElement.prototype,"pagination",2),we([v({attribute:!1})],d.TableElement.prototype,"columns",2),we([v({type:String,reflect:!1})],d.TableElement.prototype,"select",2),we([ze()],d.TableElement.prototype,"selected",2),d.TableElement=we([L(Zr)],d.TableElement);var jn=Object.defineProperty,zn=Object.getOwnPropertyDescriptor,re=(o,r,s,i)=>{for(var a=i>1?void 0:i?zn(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&jn(r,s,a),a};const Xr="spectric-tooltip";var Gr=(o=>(o.top="top",o.bottom="bottom",o.left="left",o.right="right",o.mouse="mouse",o))(Gr||{});d.TooltipElement=class extends P{constructor(){super(...arguments),this.delay=100,this.animationDuration=0,this.text="",this.position="right",this.maxWidth=300,this.portalElement=document.createElement("div"),this.portalTarget=document.body,this.open=!1,this._getMousePosition=r=>{this.mouseLocation={left:r.clientX,top:r.clientY},this.position=="mouse"&&this.open&&!this.mouseframe&&(this.mouseframe=requestAnimationFrame(()=>this.positionTooltip()))},this._hideTooltip=()=>{this.timer&&clearTimeout(this.timer),this.open=!1,this.portalElement.remove()},this.showToolTip=async()=>{this.timer&&clearTimeout(this.timer),await new Promise(s=>{this.timer=window.setTimeout(s,this.delay)}),this.portalElement.style.pointerEvents="none",this.portalElement.className=`spectric-tooltip-portal ${this.position}`;const r=A`<div class="tooltip-container">
1077
+ `}},we([v({type:Array,attribute:!1})],d.TableElement.prototype,"data",2),we([v({type:Object,attribute:!1})],d.TableElement.prototype,"pagination",2),we([v({attribute:!1})],d.TableElement.prototype,"columns",2),we([v({type:String,reflect:!1})],d.TableElement.prototype,"select",2),we([ze()],d.TableElement.prototype,"selected",2),d.TableElement=we([L(Xr)],d.TableElement);var zn=Object.defineProperty,Bn=Object.getOwnPropertyDescriptor,re=(o,r,s,i)=>{for(var a=i>1?void 0:i?Bn(r,s):r,e=o.length-1,u;e>=0;e--)(u=o[e])&&(a=(i?u(r,s,a):u(a))||a);return i&&a&&zn(r,s,a),a};const Gr="spectric-tooltip";var Jr=(o=>(o.top="top",o.bottom="bottom",o.left="left",o.right="right",o.mouse="mouse",o))(Jr||{});d.TooltipElement=class extends P{constructor(){super(...arguments),this.delay=100,this.animationDuration=0,this.text="",this.position="right",this.maxWidth=300,this.portalElement=document.createElement("div"),this.portalTarget=document.body,this.open=!1,this._getMousePosition=r=>{this.mouseLocation={left:r.clientX,top:r.clientY},this.position=="mouse"&&this.open&&!this.mouseframe&&(this.mouseframe=requestAnimationFrame(()=>this.positionTooltip()))},this._hideTooltip=()=>{this.timer&&clearTimeout(this.timer),this.open=!1,this.portalElement.remove()},this.showToolTip=async()=>{this.timer&&clearTimeout(this.timer),await new Promise(s=>{this.timer=window.setTimeout(s,this.delay)}),this.portalElement.style.pointerEvents="none",this.portalElement.className=`spectric-tooltip-portal ${this.position}`;const r=A`<div class="tooltip-container">
1078
1078
  <span class="tooltip-caret"></span>
1079
1079
  <div class="tooltip-content">${this.text}</div>
1080
- </div>`;Ct(r,this.portalElement),!(!this.target||!this.target.checkVisibility())&&(this.portalTarget.appendChild(this.portalElement),this.open=!0,requestAnimationFrame(this.positionTooltip))},this.applyStyle=r=>{Object.entries(r).forEach(([s,i])=>{this.portalElement.style.setProperty(s,i)})},this.positionTooltip=()=>{if(!this.target)return;let r=getComputedStyle(this),s={"--spectric-primary":r.getPropertyValue("--spectric-primary"),"--spectric-background-inverse":r.getPropertyValue("--spectric-background-inverse"),"--spectric-background-hover":r.getPropertyValue("--spectric-background-hover"),"--spectric-text-on-color":r.getPropertyValue("--spectric-text-on-color"),"--spectric-border-radius":r.getPropertyValue("--spectric-border-radius")};const i=this.target.getBoundingClientRect(),a=this.portalElement.getBoundingClientRect();if(this.target!==document.body&&this.maxWidth&&this.maxWidth>0&&(a.width=Math.min(a.width,this.maxWidth)),this.position==="mouse"&&this.mouseLocation){this.mouseframe=void 0;const e={left:this.mouseLocation.left+10+"px",top:this.mouseLocation.top-a.height/2+"px"};this.applyStyle({...s,...e})}else if(this.position==="top"){const e={top:i.top-a.height+"px",left:i.left+i.width/2-a.width/2+"px"};this.applyStyle({...s,...e})}else if(this.position==="bottom"){const e={top:i.bottom+"px",left:i.left+i.width/2-a.width/2+"px"};this.applyStyle({...s,...e})}else if(this.position==="left"){const e={top:Math.max(0,i.top+i.height/2-a.height/2)+"px",left:i.left-a.width+"px"};this.applyStyle({...s,...e})}else if(this.position==="right"){const e={top:Math.max(0,i.top+i.height/2-a.height/2)+"px",left:i.right+"px"};this.applyStyle({...s,...e})}this.position!=="mouse"&&this.portalElement.animate({opacity:[0,1]},{duration:this.animationDuration})}}get target(){return this.triggerTarget||this.parentElement}connectedCallback(){super.connectedCallback(),this.target&&(this.target.addEventListener("mousemove",this._getMousePosition),this.target.addEventListener("mouseover",this.showToolTip),this.target.addEventListener("mouseleave",this._hideTooltip))}disconnectedCallback(){var r,s,i;super.connectedCallback(),(r=this.target)==null||r.removeEventListener("mousemove",this._getMousePosition),(s=this.target)==null||s.removeEventListener("mouseover",this.showToolTip),(i=this.target)==null||i.removeEventListener("mouseleave",this._hideTooltip),this.portalElement.remove()}render(){}},d.TooltipElement.styles=R`:host{max-height: 0px;
1080
+ </div>`;Pt(r,this.portalElement),!(!this.target||!this.target.checkVisibility())&&(this.portalTarget.appendChild(this.portalElement),this.open=!0,requestAnimationFrame(this.positionTooltip))},this.applyStyle=r=>{Object.entries(r).forEach(([s,i])=>{this.portalElement.style.setProperty(s,i)})},this.positionTooltip=()=>{if(!this.target)return;let r=getComputedStyle(this),s={"--spectric-primary":r.getPropertyValue("--spectric-primary"),"--spectric-background-inverse":r.getPropertyValue("--spectric-background-inverse"),"--spectric-background-hover":r.getPropertyValue("--spectric-background-hover"),"--spectric-text-on-color":r.getPropertyValue("--spectric-text-on-color"),"--spectric-border-radius":r.getPropertyValue("--spectric-border-radius")};const i=this.target.getBoundingClientRect(),a=this.portalElement.getBoundingClientRect();if(this.target!==document.body&&this.maxWidth&&this.maxWidth>0&&(a.width=Math.min(a.width,this.maxWidth)),this.position==="mouse"&&this.mouseLocation){this.mouseframe=void 0;const e={left:this.mouseLocation.left+10+"px",top:this.mouseLocation.top-a.height/2+"px"};this.applyStyle({...s,...e})}else if(this.position==="top"){const e={top:i.top-a.height+"px",left:i.left+i.width/2-a.width/2+"px"};this.applyStyle({...s,...e})}else if(this.position==="bottom"){const e={top:i.bottom+"px",left:i.left+i.width/2-a.width/2+"px"};this.applyStyle({...s,...e})}else if(this.position==="left"){const e={top:Math.max(0,i.top+i.height/2-a.height/2)+"px",left:i.left-a.width+"px"};this.applyStyle({...s,...e})}else if(this.position==="right"){const e={top:Math.max(0,i.top+i.height/2-a.height/2)+"px",left:i.right+"px"};this.applyStyle({...s,...e})}this.position!=="mouse"&&this.portalElement.animate({opacity:[0,1]},{duration:this.animationDuration})}}get target(){return this.triggerTarget||this.parentElement}connectedCallback(){super.connectedCallback(),this.target&&(this.target.addEventListener("mousemove",this._getMousePosition),this.target.addEventListener("mouseover",this.showToolTip),this.target.addEventListener("mouseleave",this._hideTooltip))}disconnectedCallback(){var r,s,i;super.connectedCallback(),(r=this.target)==null||r.removeEventListener("mousemove",this._getMousePosition),(s=this.target)==null||s.removeEventListener("mouseover",this.showToolTip),(i=this.target)==null||i.removeEventListener("mouseleave",this._hideTooltip),this.portalElement.remove()}render(){}},d.TooltipElement.styles=R`:host{max-height: 0px;
1081
1081
  max-width: 0px;
1082
1082
  display: none;
1083
- pointer-events:none;}`,re([v({type:Number,reflect:!0})],d.TooltipElement.prototype,"delay",2),re([v({type:Number,reflect:!0})],d.TooltipElement.prototype,"animationDuration",2),re([v({type:String,reflect:!1})],d.TooltipElement.prototype,"text",2),re([v({type:String,reflect:!0})],d.TooltipElement.prototype,"position",2),re([v({type:Number,reflect:!0})],d.TooltipElement.prototype,"maxWidth",2),re([v({attribute:!1})],d.TooltipElement.prototype,"portalTarget",2),re([v({attribute:!1})],d.TooltipElement.prototype,"triggerTarget",2),d.TooltipElement=re([L(Xr)],d.TooltipElement),d.ButtonSizes=Er,d.ButtonVariants=Cr,d.CSSPropsControls=bn,d.DialogElementTag=Mt,d.ElementTag=Vr,d.InputVariants=Nr,d.Orientations=Wr,d.PaginationElementTag=Yr,d.SupportedLanguages=Mr,d.TableElementTag=Zr,d.ThemeSelections=vn,d.TooltipElementTag=Xr,d.TooltipPostions=Gr,d.nodeTypes=K,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
1083
+ pointer-events:none;}`,re([v({type:Number,reflect:!0})],d.TooltipElement.prototype,"delay",2),re([v({type:Number,reflect:!0})],d.TooltipElement.prototype,"animationDuration",2),re([v({type:String,reflect:!1})],d.TooltipElement.prototype,"text",2),re([v({type:String,reflect:!0})],d.TooltipElement.prototype,"position",2),re([v({type:Number,reflect:!0})],d.TooltipElement.prototype,"maxWidth",2),re([v({attribute:!1})],d.TooltipElement.prototype,"portalTarget",2),re([v({attribute:!1})],d.TooltipElement.prototype,"triggerTarget",2),d.TooltipElement=re([L(Gr)],d.TooltipElement),d.ButtonSizes=Cr,d.ButtonVariants=Pr,d.CSSPropsControls=vn,d.DialogElementTag=Ut,d.ElementTag=Yr,d.InputVariants=jr,d.Orientations=Vr,d.PaginationElementTag=Kr,d.SupportedLanguages=Ur,d.TableElementTag=Xr,d.ThemeSelections=mn,d.TooltipElementTag=Gr,d.TooltipPostions=Jr,d.nodeTypes=K,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
1084
1084
  //# sourceMappingURL=index.umd.js.map