@spectric/ui 0.0.6 → 0.0.8
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/components/Button.d.ts +8 -3
- package/dist/components/index.d.ts +2 -0
- package/dist/components/input.d.ts +3 -1
- package/dist/components/pagination/index.d.ts +1 -0
- package/dist/components/pagination/pagination.d.ts +60 -0
- package/dist/components/query_bar/QueryBar.d.ts +2 -3
- package/dist/components/table/body.d.ts +44 -0
- package/dist/components/table/cell.d.ts +53 -0
- package/dist/components/table/header.d.ts +42 -0
- package/dist/components/table/index.d.ts +1 -0
- package/dist/components/table/table.d.ts +90 -0
- package/dist/custom-elements.json +105 -6
- package/dist/index.es.js +1454 -1144
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +178 -72
- package/dist/index.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/src/components/Button.ts +12 -4
- package/src/components/button.css.ts +66 -0
- package/src/components/index.ts +3 -1
- package/src/components/input.ts +19 -2
- package/src/components/pagination/index.ts +1 -0
- package/src/components/pagination/pagination.css +10 -0
- package/src/components/pagination/pagination.ts +133 -0
- package/src/components/query_bar/QueryBar.ts +7 -21
- package/src/components/table/body.ts +69 -0
- package/src/components/table/cell.ts +117 -0
- package/src/components/table/header.ts +68 -0
- package/src/components/table/index.ts +1 -0
- package/src/components/table/table.css +36 -0
- package/src/components/table/table.ts +131 -0
- package/src/stories/Button.stories.ts +3 -2
- package/src/stories/QueryBar.stories.ts +7 -0
- package/src/stories/fixtures/data.ts +3 -0
- package/src/stories/pagination.stories.ts +63 -0
- package/src/stories/table.stories.ts +74 -0
- package/dist/assets/Banner-CZ3qKIQC.js +0 -172
- package/dist/assets/Banner.stories-BMf4MBpI.js +0 -19
- package/dist/assets/BitDisplay.stories-wztXxpxe.js +0 -18
- package/dist/assets/Bits-C_TSTjST.js +0 -1
- package/dist/assets/Button.stories-gHxjWwVf.js +0 -142
- package/dist/assets/Color-F6OSRLHC-AjFOL-zN.js +0 -1
- package/dist/assets/DocsRenderer-CFRXHY34-CvW79YxE.js +0 -761
- package/dist/assets/Header.stories-Bc09U6g1.js +0 -25
- package/dist/assets/Page.stories-DNJKhAFs.js +0 -114
- package/dist/assets/QueryBar.stories-Da5C-SV4.js +0 -17
- package/dist/assets/_commonjsHelpers-Cpj98o6Y.js +0 -1
- package/dist/assets/chunk-L4EGOTBX-AI5g0G5Z.js +0 -2
- package/dist/assets/data-CwENMT7L.js +0 -3
- package/dist/assets/dialog-CFHXbUTQ.js +0 -611
- package/dist/assets/directive-helpers-IbK5tOA8.js +0 -5
- package/dist/assets/entry-preview-Di-j0SPB.js +0 -4
- package/dist/assets/entry-preview-docs-CUBRpM7y.js +0 -1
- package/dist/assets/iframe-BQFuVTVZ.js +0 -2
- package/dist/assets/index-BCiKWbv6.js +0 -1
- package/dist/assets/index-BHYIh-Xd.js +0 -8
- package/dist/assets/index-DBGhiA-l.js +0 -1
- package/dist/assets/index-DrFu-skq.js +0 -6
- package/dist/assets/index-oFsFREWh.js +0 -9
- package/dist/assets/input.stories-Cgdv-5bN.js +0 -58
- package/dist/assets/lit-element-UdLzEcH-.js +0 -19
- package/dist/assets/preview-BWzBA1C2.js +0 -396
- package/dist/assets/preview-CGiTbRot.js +0 -2
- package/dist/assets/preview-D77C14du.js +0 -34
- package/dist/assets/preview-DEMzn_yN.js +0 -1
- package/dist/assets/preview-DFmD0pui.js +0 -1
- package/dist/assets/preview-DGUiP6tS.js +0 -7
- package/dist/assets/preview-DQVTHjv1.js +0 -182
- package/dist/assets/preview-aVwhiz9X.js +0 -1
- package/dist/assets/tiny-invariant-CopsF_GD.js +0 -1
- package/dist/components/input.css.d.ts +0 -2
- package/dist/favicon.svg +0 -1
- package/dist/iframe.html +0 -639
- package/dist/index.html +0 -190
- package/dist/index.json +0 -1
- package/dist/nunito-sans-bold-italic.woff2 +0 -0
- package/dist/nunito-sans-bold.woff2 +0 -0
- package/dist/nunito-sans-italic.woff2 +0 -0
- package/dist/nunito-sans-regular.woff2 +0 -0
- package/dist/project.json +0 -1
- package/dist/sb-addons/chromatic-com-storybook-8/manager-bundle.js +0 -333
- package/dist/sb-addons/chromatic-com-storybook-8/manager-bundle.js.LEGAL.txt +0 -40
- package/dist/sb-addons/essentials-actions-2/manager-bundle.js +0 -3
- package/dist/sb-addons/essentials-actions-2/manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-addons/essentials-backgrounds-3/manager-bundle.js +0 -12
- package/dist/sb-addons/essentials-backgrounds-3/manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-addons/essentials-controls-1/manager-bundle.js +0 -391
- package/dist/sb-addons/essentials-controls-1/manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-addons/essentials-measure-6/manager-bundle.js +0 -3
- package/dist/sb-addons/essentials-measure-6/manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-addons/essentials-outline-7/manager-bundle.js +0 -3
- package/dist/sb-addons/essentials-outline-7/manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-addons/essentials-toolbars-5/manager-bundle.js +0 -3
- package/dist/sb-addons/essentials-toolbars-5/manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-addons/essentials-viewport-4/manager-bundle.js +0 -3
- package/dist/sb-addons/essentials-viewport-4/manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +0 -3
- package/dist/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-common-assets/favicon.svg +0 -1
- package/dist/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/dist/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/dist/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/dist/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/dist/sb-manager/globals-module-info.js +0 -1028
- package/dist/sb-manager/globals-runtime.js +0 -40861
- package/dist/sb-manager/globals.js +0 -48
- package/dist/sb-manager/runtime.js +0 -13338
- package/dist/sb-preview/globals.js +0 -33
- package/dist/sb-preview/runtime.js +0 -7174
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
|
|
5
|
+
*/var Zr;const Z=globalThis,yt=Z.ShadowRoot&&(Z.ShadyCSS===void 0||Z.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,$t=Symbol(),nr=new WeakMap;let or=class{constructor(r,s,i){if(this._$cssResult$=!0,i!==$t)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(yt&&r===void 0){const i=s!==void 0&&s.length===1;i&&(r=nr.get(s)),r===void 0&&((this.o=r=new CSSStyleSheet).replaceSync(this.cssText),i&&nr.set(s,r))}return r}toString(){return this.cssText}};const ss=n=>new or(typeof n=="string"?n:n+"",void 0,$t),M=(n,...r)=>{const s=n.length===1?n[0]:r.reduce((i,c,t)=>i+(p=>{if(p._$cssResult$===!0)return p.cssText;if(typeof p=="number")return p;throw Error("Value passed to 'css' function must be a 'css' function result: "+p+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(c)+n[t+1],n[0]);return new or(s,n,$t)},ns=(n,r)=>{if(yt)n.adoptedStyleSheets=r.map(s=>s instanceof CSSStyleSheet?s:s.styleSheet);else for(const s of r){const i=document.createElement("style"),c=Z.litNonce;c!==void 0&&i.setAttribute("nonce",c),i.textContent=s.cssText,n.appendChild(i)}},ar=yt?n=>n:n=>n instanceof CSSStyleSheet?(r=>{let s="";for(const i of r.cssRules)s+=i.cssText;return ss(s)})(n):n;/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright 2017 Google LLC
|
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/const{is:
|
|
9
|
+
*/const{is:os,defineProperty:as,getOwnPropertyDescriptor:cs,getOwnPropertyNames:ls,getOwnPropertySymbols:us,getPrototypeOf:ps}=Object,X=globalThis,cr=X.trustedTypes,ds=cr?cr.emptyScript:"",_t=X.reactiveElementPolyfillSupport,ke=(n,r)=>n,Ie={toAttribute(n,r){switch(r){case Boolean:n=n?ds:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,r){let s=n;switch(r){case Boolean:s=n!==null;break;case Number:s=n===null?null:Number(n);break;case Object:case Array:try{s=JSON.parse(n)}catch{s=null}}return s}},wt=(n,r)=>!os(n,r),lr={attribute:!0,type:String,converter:Ie,reflect:!1,hasChanged:wt};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),X.litPropertyMetadata??(X.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=lr){if(s.state&&(s.attribute=!1),this._$Ei(),this.elementProperties.set(r,s),!s.noAccessor){const i=Symbol(),c=this.getPropertyDescriptor(r,i,s);c!==void 0&&as(this.prototype,r,c)}}static getPropertyDescriptor(r,s,i){const{get:c,set:t}=cs(this.prototype,r)??{get(){return this[s]},set(p){this[s]=p}};return{get(){return c==null?void 0:c.call(this)},set(p){const g=c==null?void 0:c.call(this);t.call(this,p),this.requestUpdate(r,g,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(r){return this.elementProperties.get(r)??lr}static _$Ei(){if(this.hasOwnProperty(ke("elementProperties")))return;const r=ps(this);r.finalize(),r.l!==void 0&&(this.l=[...r.l]),this.elementProperties=new Map(r.elementProperties)}static finalize(){if(this.hasOwnProperty(ke("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ke("properties"))){const s=this.properties,i=[...ls(s),...us(s)];for(const c of i)this.createProperty(c,s[c])}const r=this[Symbol.metadata];if(r!==null){const s=litPropertyMetadata.get(r);if(s!==void 0)for(const[i,c]of s)this.elementProperties.set(i,c)}this._$Eh=new Map;for(const[s,i]of this.elementProperties){const c=this._$Eu(s,i);c!==void 0&&this._$Eh.set(c,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 c of i)s.unshift(ar(c))}else r!==void 0&&s.push(ar(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 ns(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 t;const i=this.constructor.elementProperties.get(r),c=this.constructor._$Eu(r,i);if(c!==void 0&&i.reflect===!0){const p=(((t=i.converter)==null?void 0:t.toAttribute)!==void 0?i.converter:Ie).toAttribute(s,i.type);this._$Em=r,p==null?this.removeAttribute(c):this.setAttribute(c,p),this._$Em=null}}_$AK(r,s){var t;const i=this.constructor,c=i._$Eh.get(r);if(c!==void 0&&this._$Em!==c){const p=i.getPropertyOptions(c),g=typeof p.converter=="function"?{fromAttribute:p.converter}:((t=p.converter)==null?void 0:t.fromAttribute)!==void 0?p.converter:Ie;this._$Em=c,this[c]=g.fromAttribute(s,p.type),this._$Em=null}}requestUpdate(r,s,i){if(r!==void 0){if(i??(i=this.constructor.getPropertyOptions(r)),!(i.hasChanged??wt)(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[t,p]of this._$Ep)this[t]=p;this._$Ep=void 0}const c=this.constructor.elementProperties;if(c.size>0)for(const[t,p]of c)p.wrapped!==!0||this._$AL.has(t)||this[t]===void 0||this.P(t,this[t],p)}let r=!1;const s=this._$AL;try{r=this.shouldUpdate(s),r?(this.willUpdate(s),(i=this._$EO)==null||i.forEach(c=>{var t;return(t=c.hostUpdate)==null?void 0:t.call(c)}),this.update(s)):this._$EU()}catch(c){throw r=!1,this._$EU(),c}r&&this._$AE(s)}willUpdate(r){}_$AE(r){var s;(s=this._$EO)==null||s.forEach(i=>{var c;return(c=i.hostUpdated)==null?void 0:c.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[ke("elementProperties")]=new Map,fe[ke("finalized")]=new Map,_t==null||_t({ReactiveElement:fe}),(X.reactiveElementVersions??(X.reactiveElementVersions=[])).push("2.0.4");/**
|
|
10
10
|
* @license
|
|
11
11
|
* Copyright 2017 Google LLC
|
|
12
12
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
-
*/const
|
|
14
|
-
\f\r]`,
|
|
15
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
13
|
+
*/const Ce=globalThis,Fe=Ce.trustedTypes,ur=Fe?Fe.createPolicy("lit-html",{createHTML:n=>n}):void 0,pr="$lit$",G=`lit$${Math.random().toFixed(9).slice(2)}$`,dr="?"+G,fs=`<${dr}>`,ne=document,Ee=()=>ne.createComment(""),Oe=n=>n===null||typeof n!="object"&&typeof n!="function",St=Array.isArray,hs=n=>St(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",At=`[
|
|
14
|
+
\f\r]`,Pe=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,fr=/-->/g,hr=/>/g,oe=RegExp(`>|${At}(?:([^\\s"'>=/]+)(${At}*=${At}*(?:[^
|
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),gr=/'/g,br=/"/g,vr=/^(?:script|style|textarea|title)$/i,gs=n=>(r,...s)=>({_$litType$:n,strings:r,values:s}),A=gs(1),ae=Symbol.for("lit-noChange"),C=Symbol.for("lit-nothing"),mr=new WeakMap,ce=ne.createTreeWalker(ne,129);function yr(n,r){if(!St(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return ur!==void 0?ur.createHTML(r):r}const bs=(n,r)=>{const s=n.length-1,i=[];let c,t=r===2?"<svg>":r===3?"<math>":"",p=Pe;for(let g=0;g<s;g++){const v=n[g];let w,x,S=-1,E=0;for(;E<v.length&&(p.lastIndex=E,x=p.exec(v),x!==null);)E=p.lastIndex,p===Pe?x[1]==="!--"?p=fr:x[1]!==void 0?p=hr:x[2]!==void 0?(vr.test(x[2])&&(c=RegExp("</"+x[2],"g")),p=oe):x[3]!==void 0&&(p=oe):p===oe?x[0]===">"?(p=c??Pe,S=-1):x[1]===void 0?S=-2:(S=p.lastIndex-x[2].length,w=x[1],p=x[3]===void 0?oe:x[3]==='"'?br:gr):p===br||p===gr?p=oe:p===fr||p===hr?p=Pe:(p=oe,c=void 0);const k=p===oe&&n[g+1].startsWith("/>")?" ":"";t+=p===Pe?v+fs:S>=0?(i.push(w),v.slice(0,S)+pr+v.slice(S)+G+k):v+G+(S===-2?g:k)}return[yr(n,t+(n[s]||"<?>")+(r===2?"</svg>":r===3?"</math>":"")),i]};class Te{constructor({strings:r,_$litType$:s},i){let c;this.parts=[];let t=0,p=0;const g=r.length-1,v=this.parts,[w,x]=bs(r,s);if(this.el=Te.createElement(w,i),ce.currentNode=this.el.content,s===2||s===3){const S=this.el.content.firstChild;S.replaceWith(...S.childNodes)}for(;(c=ce.nextNode())!==null&&v.length<g;){if(c.nodeType===1){if(c.hasAttributes())for(const S of c.getAttributeNames())if(S.endsWith(pr)){const E=x[p++],k=c.getAttribute(S).split(G),N=/([.?@])?(.*)/.exec(E);v.push({type:1,index:t,name:N[2],strings:k,ctor:N[1]==="."?ms:N[1]==="?"?ys:N[1]==="@"?$s:Qe}),c.removeAttribute(S)}else S.startsWith(G)&&(v.push({type:6,index:t}),c.removeAttribute(S));if(vr.test(c.tagName)){const S=c.textContent.split(G),E=S.length-1;if(E>0){c.textContent=Fe?Fe.emptyScript:"";for(let k=0;k<E;k++)c.append(S[k],Ee()),ce.nextNode(),v.push({type:2,index:++t});c.append(S[E],Ee())}}}else if(c.nodeType===8)if(c.data===dr)v.push({type:2,index:t});else{let S=-1;for(;(S=c.data.indexOf(G,S+1))!==-1;)v.push({type:7,index:t}),S+=G.length-1}t++}}static createElement(r,s){const i=ne.createElement("template");return i.innerHTML=r,i}}function he(n,r,s=n,i){var p,g;if(r===ae)return r;let c=i!==void 0?(p=s._$Co)==null?void 0:p[i]:s._$Cl;const t=Oe(r)?void 0:r._$litDirective$;return(c==null?void 0:c.constructor)!==t&&((g=c==null?void 0:c._$AO)==null||g.call(c,!1),t===void 0?c=void 0:(c=new t(n),c._$AT(n,s,i)),i!==void 0?(s._$Co??(s._$Co=[]))[i]=c:s._$Cl=c),c!==void 0&&(r=he(n,c._$AS(n,r.values),c,i)),r}class vs{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,c=((r==null?void 0:r.creationScope)??ne).importNode(s,!0);ce.currentNode=c;let t=ce.nextNode(),p=0,g=0,v=i[0];for(;v!==void 0;){if(p===v.index){let w;v.type===2?w=new Le(t,t.nextSibling,this,r):v.type===1?w=new v.ctor(t,v.name,v.strings,this,r):v.type===6&&(w=new _s(t,this,r)),this._$AV.push(w),v=i[++g]}p!==(v==null?void 0:v.index)&&(t=ce.nextNode(),p++)}return ce.currentNode=ne,c}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 Le{get _$AU(){var r;return((r=this._$AM)==null?void 0:r._$AU)??this._$Cv}constructor(r,s,i,c){this.type=2,this._$AH=C,this._$AN=void 0,this._$AA=r,this._$AB=s,this._$AM=i,this.options=c,this._$Cv=(c==null?void 0:c.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=he(this,r,s),Oe(r)?r===C||r==null||r===""?(this._$AH!==C&&this._$AR(),this._$AH=C):r!==this._$AH&&r!==ae&&this._(r):r._$litType$!==void 0?this.$(r):r.nodeType!==void 0?this.T(r):hs(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!==C&&Oe(this._$AH)?this._$AA.nextSibling.data=r:this.T(ne.createTextNode(r)),this._$AH=r}$(r){var t;const{values:s,_$litType$:i}=r,c=typeof i=="number"?this._$AC(r):(i.el===void 0&&(i.el=Te.createElement(yr(i.h,i.h[0]),this.options)),i);if(((t=this._$AH)==null?void 0:t._$AD)===c)this._$AH.p(s);else{const p=new vs(c,this),g=p.u(this.options);p.p(s),this.T(g),this._$AH=p}}_$AC(r){let s=mr.get(r.strings);return s===void 0&&mr.set(r.strings,s=new Te(r)),s}k(r){St(this._$AH)||(this._$AH=[],this._$AR());const s=this._$AH;let i,c=0;for(const t of r)c===s.length?s.push(i=new Le(this.O(Ee()),this.O(Ee()),this,this.options)):i=s[c],i._$AI(t),c++;c<s.length&&(this._$AR(i&&i._$AB.nextSibling,c),s.length=c)}_$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 c=r.nextSibling;r.remove(),r=c}}setConnected(r){var s;this._$AM===void 0&&(this._$Cv=r,(s=this._$AP)==null||s.call(this,r))}}class Qe{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(r,s,i,c,t){this.type=1,this._$AH=C,this._$AN=void 0,this.element=r,this.name=s,this._$AM=c,this.options=t,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=C}_$AI(r,s=this,i,c){const t=this.strings;let p=!1;if(t===void 0)r=he(this,r,s,0),p=!Oe(r)||r!==this._$AH&&r!==ae,p&&(this._$AH=r);else{const g=r;let v,w;for(r=t[0],v=0;v<t.length-1;v++)w=he(this,g[i+v],s,v),w===ae&&(w=this._$AH[v]),p||(p=!Oe(w)||w!==this._$AH[v]),w===C?r=C:r!==C&&(r+=(w??"")+t[v+1]),this._$AH[v]=w}p&&!c&&this.j(r)}j(r){r===C?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,r??"")}}class ms extends Qe{constructor(){super(...arguments),this.type=3}j(r){this.element[this.name]=r===C?void 0:r}}class ys extends Qe{constructor(){super(...arguments),this.type=4}j(r){this.element.toggleAttribute(this.name,!!r&&r!==C)}}class $s extends Qe{constructor(r,s,i,c,t){super(r,s,i,c,t),this.type=5}_$AI(r,s=this){if((r=he(this,r,s,0)??C)===ae)return;const i=this._$AH,c=r===C&&i!==C||r.capture!==i.capture||r.once!==i.once||r.passive!==i.passive,t=r!==C&&(i===C||c);c&&this.element.removeEventListener(this.name,this,i),t&&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 _s{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){he(this,r)}}const xt=Ce.litHtmlPolyfillSupport;xt==null||xt(Te,Le),(Ce.litHtmlVersions??(Ce.litHtmlVersions=[])).push("3.2.1");const $r=(n,r,s)=>{const i=(s==null?void 0:s.renderBefore)??r;let c=i._$litPart$;if(c===void 0){const t=(s==null?void 0:s.renderBefore)??null;i._$litPart$=c=new Le(r.insertBefore(Ee(),t),t,void 0,s??{})}return c._$AI(n),c};/**
|
|
16
16
|
* @license
|
|
17
17
|
* Copyright 2017 Google LLC
|
|
18
18
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
-
*/let
|
|
19
|
+
*/let O=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=$r(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 ae}};O._$litElement$=!0,O.finalized=!0,(Zr=globalThis.litElementHydrateSupport)==null||Zr.call(globalThis,{LitElement:O});const kt=globalThis.litElementPolyfillSupport;kt==null||kt({LitElement:O}),(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
|
|
23
|
+
*/const _r={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Ct=n=>(...r)=>({_$litDirective$:n,values:r});let wr=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
|
|
27
|
+
*/const Sr="important",ws=" !"+Sr,Ar=Ct(class extends wr{constructor(n){var r;if(super(n),n.type!==_r.ATTRIBUTE||n.name!=="style"||((r=n.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(n){return Object.keys(n).reduce((r,s)=>{const i=n[s];return i==null?r:r+`${s=s.includes("-")?s:s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(n,[r]){const{style:s}=n.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 c=r[i];if(c!=null){this.ft.add(i);const t=typeof c=="string"&&c.endsWith(ws);i.includes("-")||t?s.setProperty(i,t?c.slice(0,-11):c,t?Sr:""):s[i]=c}}return ae}}),Ss=M`
|
|
28
28
|
:host{
|
|
29
29
|
display: inline-block;
|
|
30
30
|
--text-on-color: var(--spectric-text-on-color, #ffffff);
|
|
@@ -103,6 +103,53 @@
|
|
|
103
103
|
box-shadow: 0 0 30px white inset;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
+
:host([icon]) .spectric-button {
|
|
107
|
+
padding: unset;
|
|
108
|
+
display: flex;
|
|
109
|
+
align-items: center;
|
|
110
|
+
justify-content: center;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* :host([icon][size="small"]){
|
|
114
|
+
height:12px;
|
|
115
|
+
width:12px;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
:host([icon][size="medium"]){
|
|
119
|
+
height:14px;
|
|
120
|
+
width:14px;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
:host([icon][size="large"]){
|
|
124
|
+
width: 48px;
|
|
125
|
+
height: 48px;
|
|
126
|
+
} */
|
|
127
|
+
:host([icon][size="tiny"]) .spectric-button{
|
|
128
|
+
width: 10px;
|
|
129
|
+
height: 10px;
|
|
130
|
+
}
|
|
131
|
+
:host([icon][size="xxsmall"]) .spectric-button{
|
|
132
|
+
width: 20px;
|
|
133
|
+
height: 20px;
|
|
134
|
+
}
|
|
135
|
+
:host([icon][size="xsmall"]) .spectric-button{
|
|
136
|
+
width: 28px;
|
|
137
|
+
height: 28px;
|
|
138
|
+
}
|
|
139
|
+
:host([icon][size="small"]) .spectric-button{
|
|
140
|
+
width: 34px;
|
|
141
|
+
height: 34px;
|
|
142
|
+
}
|
|
143
|
+
:host([icon][size="medium"]) .spectric-button{
|
|
144
|
+
width: 40px;
|
|
145
|
+
height: 40px;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
:host([icon][size="large"]) .spectric-button{
|
|
149
|
+
width: 48px;
|
|
150
|
+
height: 48px;
|
|
151
|
+
}
|
|
152
|
+
|
|
106
153
|
.spectric-button:disabled{
|
|
107
154
|
cursor: not-allowed;
|
|
108
155
|
pointer-events: none;
|
|
@@ -170,6 +217,25 @@ opacity:1
|
|
|
170
217
|
background-color: transparent;
|
|
171
218
|
color: var(--text-secondary);
|
|
172
219
|
}
|
|
220
|
+
.spectric-button--tiny {
|
|
221
|
+
font-size: 10px;
|
|
222
|
+
line-height: 10px;
|
|
223
|
+
height: 10px;
|
|
224
|
+
display: flex;
|
|
225
|
+
align-content: center;
|
|
226
|
+
align-items: center;
|
|
227
|
+
}
|
|
228
|
+
.spectric-button--xxsmall {
|
|
229
|
+
padding: 5px 6px;
|
|
230
|
+
font-size: 10px;
|
|
231
|
+
line-height: 8px;
|
|
232
|
+
}
|
|
233
|
+
.spectric-button--xsmall {
|
|
234
|
+
padding: 5px 8px;
|
|
235
|
+
font-size: 10px;
|
|
236
|
+
font-size: 12px;
|
|
237
|
+
line-height: 14px;
|
|
238
|
+
}
|
|
173
239
|
.spectric-button--small {
|
|
174
240
|
padding: 5px 10px;
|
|
175
241
|
font-size: 12px;
|
|
@@ -186,49 +252,49 @@ opacity:1
|
|
|
186
252
|
* @license
|
|
187
253
|
* Copyright 2017 Google LLC
|
|
188
254
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
189
|
-
*/const
|
|
255
|
+
*/const L=n=>(r,s)=>{s!==void 0?s.addInitializer(()=>{customElements.define(n,r)}):customElements.define(n,r)};/**
|
|
190
256
|
* @license
|
|
191
257
|
* Copyright 2017 Google LLC
|
|
192
258
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
193
|
-
*/const
|
|
259
|
+
*/const As={attribute:!0,type:String,converter:Ie,reflect:!1,hasChanged:wt},xs=(n=As,r,s)=>{const{kind:i,metadata:c}=s;let t=globalThis.litPropertyMetadata.get(c);if(t===void 0&&globalThis.litPropertyMetadata.set(c,t=new Map),t.set(s.name,n),i==="accessor"){const{name:p}=s;return{set(g){const v=r.get.call(this);r.set.call(this,g),this.requestUpdate(p,v,n)},init(g){return g!==void 0&&this.P(p,void 0,n),g}}}if(i==="setter"){const{name:p}=s;return function(g){const v=this[p];r.call(this,g),this.requestUpdate(p,v,n)}}throw Error("Unsupported decorator location: "+i)};function m(n){return(r,s)=>typeof s=="object"?xs(n,r,s):((i,c,t)=>{const p=c.hasOwnProperty(t);return c.constructor.createProperty(t,p?{...i,wrapped:!0}:i),p?Object.getOwnPropertyDescriptor(c,t):void 0})(n,r,s)}/**
|
|
194
260
|
* @license
|
|
195
261
|
* Copyright 2017 Google LLC
|
|
196
262
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
197
|
-
*/function
|
|
263
|
+
*/function He(n){return m({...n,state:!0,attribute:!1})}/**
|
|
198
264
|
* @license
|
|
199
265
|
* Copyright 2017 Google LLC
|
|
200
266
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
201
|
-
*/const
|
|
267
|
+
*/const xr=(n,r,s)=>(s.configurable=!0,s.enumerable=!0,Reflect.decorate&&typeof r!="object"&&Object.defineProperty(n,r,s),s);/**
|
|
202
268
|
* @license
|
|
203
269
|
* Copyright 2017 Google LLC
|
|
204
270
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
205
|
-
*/function
|
|
271
|
+
*/function De(n,r){return(s,i,c)=>{const t=p=>{var g;return((g=p.renderRoot)==null?void 0:g.querySelector(n))??null};return xr(s,i,{get(){return t(this)}})}}/**
|
|
206
272
|
* @license
|
|
207
273
|
* Copyright 2017 Google LLC
|
|
208
274
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
209
|
-
*/function
|
|
275
|
+
*/function qe(n){return(r,s)=>xr(r,s,{async get(){var i;return await this.updateComplete,((i=this.renderRoot)==null?void 0:i.querySelector(n))??null}})}var ks=Object.defineProperty,Cs=Object.getOwnPropertyDescriptor,J=(n,r,s,i)=>{for(var c=i>1?void 0:i?Cs(r,s):r,t=n.length-1,p;t>=0;t--)(p=n[t])&&(c=(i?p(r,s,c):p(c))||c);return i&&c&&ks(r,s,c),c},kr=(n=>(n.large="large",n.medium="medium",n.small="small",n.xsmall="xsmall",n.xxsmall="xxsmall",n.tiny="tiny",n))(kr||{}),Cr=(n=>(n.primary="primary",n.secondary="secondary",n.text="text",n))(Cr||{});const Es={primary:"spectric-button--primary",secondary:"spectric-button--secondary",text:"spectric-button--text"};d.SpectricButton=class extends O{constructor(){super(...arguments),this.variant="primary",this.disabled=!1,this.size="small",this.label="",this.danger=!1,this.icon=!1,this._onClick=r=>{if(r instanceof CustomEvent)return;r.preventDefault(),r.stopImmediatePropagation(),r.stopPropagation();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=Es[this.variant]||"spectric-button--primary";return A`
|
|
210
276
|
<button
|
|
211
277
|
type="button"
|
|
212
278
|
?disabled=${this.disabled}
|
|
213
279
|
class=${["spectric-button",`spectric-button-danger--${this.danger||!1}`,`spectric-button--${this.size||"medium"}`,r].join(" ")}
|
|
214
|
-
style=${
|
|
280
|
+
style=${Ar({backgroundColor:this.backgroundColor})}
|
|
215
281
|
>
|
|
216
282
|
<span class="animation"></span>
|
|
217
283
|
<slot>${this.label}</slot>
|
|
218
284
|
</button>
|
|
219
|
-
`}},d.SpectricButton.styles=
|
|
285
|
+
`}},d.SpectricButton.styles=Ss,J([m({type:String,reflect:!0})],d.SpectricButton.prototype,"variant",2),J([m({type:Boolean,reflect:!0})],d.SpectricButton.prototype,"disabled",2),J([m({type:String,reflect:!0})],d.SpectricButton.prototype,"backgroundColor",2),J([m({type:String,reflect:!0})],d.SpectricButton.prototype,"size",2),J([m({type:String,reflect:!0})],d.SpectricButton.prototype,"label",2),J([m({type:Boolean,reflect:!0})],d.SpectricButton.prototype,"danger",2),J([m({type:Boolean,reflect:!0})],d.SpectricButton.prototype,"icon",2),d.SpectricButton=J([L("spectric-button")],d.SpectricButton);/**
|
|
220
286
|
* @license
|
|
221
287
|
* Copyright 2020 Google LLC
|
|
222
288
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
223
|
-
*/const
|
|
289
|
+
*/const Os=n=>n.strings===void 0;/**
|
|
224
290
|
* @license
|
|
225
291
|
* Copyright 2017 Google LLC
|
|
226
292
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
227
|
-
*/const Ne=(n,r)=>{var i;const s=n._$AN;if(s===void 0)return!1;for(const
|
|
293
|
+
*/const Ne=(n,r)=>{var i;const s=n._$AN;if(s===void 0)return!1;for(const c of s)(i=c._$AO)==null||i.call(c,r,!1),Ne(c,r);return!0},We=n=>{let r,s;do{if((r=n._$AM)===void 0)break;s=r._$AN,s.delete(n),n=r}while((s==null?void 0:s.size)===0)},Er=n=>{for(let r;r=n._$AM;n=r){let s=r._$AN;if(s===void 0)r._$AN=s=new Set;else if(s.has(n))break;s.add(n),Ls(r)}};function Ps(n){this._$AN!==void 0?(We(this),this._$AM=n,Er(this)):this._$AM=n}function Ts(n,r=!1,s=0){const i=this._$AH,c=this._$AN;if(c!==void 0&&c.size!==0)if(r)if(Array.isArray(i))for(let t=s;t<i.length;t++)Ne(i[t],!1),We(i[t]);else i!=null&&(Ne(i,!1),We(i));else Ne(this,n)}const Ls=n=>{n.type==_r.CHILD&&(n._$AP??(n._$AP=Ts),n._$AQ??(n._$AQ=Ps))};class Or extends wr{constructor(){super(...arguments),this._$AN=void 0}_$AT(r,s,i){super._$AT(r,s,i),Er(this),this.isConnected=r._$AU}_$AO(r,s=!0){var i,c;r!==this.isConnected&&(this.isConnected=r,r?(i=this.reconnected)==null||i.call(this):(c=this.disconnected)==null||c.call(this)),s&&(Ne(this,r),We(this))}setValue(r){if(Os(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(){}}/**
|
|
228
294
|
* @license
|
|
229
295
|
* Copyright 2020 Google LLC
|
|
230
296
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
231
|
-
*/const
|
|
297
|
+
*/const Ye=()=>new Ds;class Ds{}const Et=new WeakMap,Ve=Ct(class extends Or{render(n){return C}update(n,[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=n.options)==null?void 0:i.host,this.rt(this.ct=n.element)),C}rt(n){if(this.isConnected||(n=void 0),typeof this.Y=="function"){const r=this.ht??globalThis;let s=Et.get(r);s===void 0&&(s=new WeakMap,Et.set(r,s)),s.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),s.set(this.Y,n),n!==void 0&&this.Y.call(this.ht,n)}else this.Y.value=n}get lt(){var n,r;return typeof this.Y=="function"?(n=Et.get(this.ht??globalThis))==null?void 0:n.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)}}),Ns=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,c=0,t=r.length;c<t;i++,c++)this.setBit(i,r[c])}subarray(r,s){let i=[];r=r||0,s=s||this.length,s=s>this.length?this.length:s;for(let c=r;c<s;c++)i.push(this.getBit(c));return i}};class Pr{constructor(r,s,i,c){this.__target=r,this._handler=i,this._type=s,this._handler=i,this._options=c||!1,r instanceof Promise?r.then(t=>{this._handler&&(this._node=t,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 Tr extends O{constructor(){super(...arguments),this._disposables=new Set,this._isDisposed=!1,this._disposableListeners=[],this._connected=!1}addDisposableListener(r,s,i){if(this._disposableListeners.find(t=>t.event===s&&t.target===r&&t.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 Pr(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 Pr(r,s,i))})}disconnectedCallback(){super.disconnectedCallback(),this._connected=!1,this._disposables.forEach(r=>{r.dispose()}),this._isDisposed=!0}}const Lr=n=>{var r;return(...s)=>{r&&cancelAnimationFrame(r),r=requestAnimationFrame(()=>{n.apply(void 0,s)})}};var js=Object.defineProperty,zs=Object.getOwnPropertyDescriptor,le=(n,r,s,i)=>{for(var c=i>1?void 0:i?zs(r,s):r,t=n.length-1,p;t>=0;t--)(p=n[t])&&(c=(i?p(r,s,c):p(c))||c);return i&&c&&js(r,s,c),c};const Bs=["mousemove","click","dblclick","mousedown","mouseup","contextmenu"],Ke={width:200,height:200},Ze={width:10,height:10};d.BitDisplayCanvas=class extends Tr{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:Ye(),canvas:Ye(),scrollDiv:Ye()},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={};Bs.forEach(i=>{this.addDisposableListener(this._canvas,i,Lr(async c=>{c.stopImmediatePropagation(),c.stopPropagation(),c.preventDefault();var t=await this._canvas;let p=t.getBoundingClientRect(),g={x:Math.floor(Math.abs(c.clientX-p.left)),y:Math.floor(Math.abs(c.clientY-p.top))},v=this.canvasPositionToBit(g);if(i==="mousemove"&&s[i]==v)return;s[i]=v;let w="bit"+String(i).charAt(0).toUpperCase()+String(i).slice(1);if(v!=-1){let x=new CustomEvent(w,{detail:{bitIndex:v,position:g,nativeEvent:c}});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 Ns(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=Ke.width,height:c=Ke.height}=this,t=this.getPxPerBit(),p=this.refs.canvas.value.getContext("2d");if(!p)return;this.state.scale!=t&&(p.reset(),p.scale(t,t));let g=getComputedStyle(this);p.fillStyle=g.color,p.clearRect(0,0,i,c);let v=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*t)>i){v++,w=v*r+this.yStart*r+this.xStart-1;continue}if(Math.floor(v*t)>c)break;s.getBit(w)===1&&p.fillRect(S,v,1,1),(w+1)%r===0&&w>=r-1&&v++}}}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 c=s.length/r*i,t=r*i,p=this.refs.scrollDiv.value;p.style.width=t+"px",p.style.height=c+"px"}}render(){const{height:r=Ke.height,width:s=Ke.width}=this;return A`
|
|
232
298
|
<div
|
|
233
299
|
id="viewport"
|
|
234
300
|
${Ve(this.refs.viewport)}
|
|
@@ -243,10 +309,10 @@ opacity:1
|
|
|
243
309
|
</div>
|
|
244
310
|
<canvas
|
|
245
311
|
${Ve(this.refs.canvas)}
|
|
246
|
-
width=${s-
|
|
247
|
-
height=${r-
|
|
312
|
+
width=${s-Ze.width}
|
|
313
|
+
height=${r-Ze.height}
|
|
248
314
|
></canvas>
|
|
249
|
-
`}},d.BitDisplayCanvas.styles=
|
|
315
|
+
`}},d.BitDisplayCanvas.styles=M`
|
|
250
316
|
:host{
|
|
251
317
|
position: relative;
|
|
252
318
|
--border-radius: var(--spectric-border-radius,4em);
|
|
@@ -270,8 +336,8 @@ opacity:1
|
|
|
270
336
|
background-color:var(--background-color);
|
|
271
337
|
}
|
|
272
338
|
::-webkit-scrollbar {
|
|
273
|
-
height: ${
|
|
274
|
-
width: ${
|
|
339
|
+
height: ${Ze.height}px;
|
|
340
|
+
width: ${Ze.width}px;
|
|
275
341
|
|
|
276
342
|
}
|
|
277
343
|
|
|
@@ -342,7 +408,7 @@ opacity:1
|
|
|
342
408
|
|
|
343
409
|
}
|
|
344
410
|
|
|
345
|
-
`,le([
|
|
411
|
+
`,le([m({type:Object,attribute:!1})],d.BitDisplayCanvas.prototype,"arrayBuffer",2),le([m({type:Number})],d.BitDisplayCanvas.prototype,"frameWidth",2),le([m({type:Number})],d.BitDisplayCanvas.prototype,"scale",2),le([m({type:Number})],d.BitDisplayCanvas.prototype,"width",2),le([m({type:Number})],d.BitDisplayCanvas.prototype,"height",2),le([qe("canvas")],d.BitDisplayCanvas.prototype,"_canvas",2),d.BitDisplayCanvas=le([L("spectric-bit-display")],d.BitDisplayCanvas);const Rs=M`.spectric-header {
|
|
346
412
|
display: flex;
|
|
347
413
|
justify-content: space-between;
|
|
348
414
|
align-items: center;
|
|
@@ -377,7 +443,7 @@ opacity:1
|
|
|
377
443
|
color: #333;
|
|
378
444
|
font-size: 14px;
|
|
379
445
|
}
|
|
380
|
-
`;var
|
|
446
|
+
`;var Us=Object.defineProperty,Ms=Object.getOwnPropertyDescriptor,Xe=(n,r,s,i)=>{for(var c=i>1?void 0:i?Ms(r,s):r,t=n.length-1,p;t>=0;t--)(p=n[t])&&(c=(i?p(r,s,c):p(c))||c);return i&&c&&Us(r,s,c),c};d.Header=class extends O{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`
|
|
381
447
|
<header>
|
|
382
448
|
<div class="spectric-header">
|
|
383
449
|
<div style="flex-grow:1;">
|
|
@@ -385,10 +451,10 @@ opacity:1
|
|
|
385
451
|
<h1><slot name="name"></slot></h1>
|
|
386
452
|
<slot name="center"></slot>
|
|
387
453
|
</div>
|
|
388
|
-
${this.showLoginButton!==!1?
|
|
454
|
+
${this.showLoginButton!==!1?A`
|
|
389
455
|
<div>
|
|
390
|
-
${this.username&&this.username!==""?
|
|
391
|
-
${this.showCreateAccount!==!1?
|
|
456
|
+
${this.username&&this.username!==""?A`<spectric-button variant="secondary" size="small" @click=${this.onLogout}>Log out</spectric-button>`:A`
|
|
457
|
+
${this.showCreateAccount!==!1?A`<spectric-button variant="text" size="small" @click=${this.onCreateAccount}>Sign up</spectric-button>`:null}
|
|
392
458
|
<spectric-button variant="primary" size="small" @click=${this.onLogin}>Log in</spectric-button>`}
|
|
393
459
|
|
|
394
460
|
|
|
@@ -396,12 +462,12 @@ opacity:1
|
|
|
396
462
|
<slot name="end"></slot>
|
|
397
463
|
</div>
|
|
398
464
|
</header>
|
|
399
|
-
`}},d.Header.styles=
|
|
400
|
-
<header style=${
|
|
465
|
+
`}},d.Header.styles=Rs,Xe([m({type:Boolean,reflect:!0})],d.Header.prototype,"showCreateAccount",2),Xe([m({type:Boolean,reflect:!0})],d.Header.prototype,"showLoginButton",2),Xe([m({type:String,reflect:!0})],d.Header.prototype,"username",2),d.Header=Xe([L("spectric-header")],d.Header);var Is=Object.defineProperty,Fs=Object.getOwnPropertyDescriptor,ge=(n,r,s,i)=>{for(var c=i>1?void 0:i?Fs(r,s):r,t=n.length-1,p;t>=0;t--)(p=n[t])&&(c=(i?p(r,s,c):p(c))||c);return i&&c&&Is(r,s,c),c};const Qs={display:"flex",alignItems:"center",backgroundColor:"black",color:"white",textAlign:"center"};let ue=class extends O{constructor(){super(...arguments),this.dismissable=!1,this.text="",this.bannerId="",this.headerStyle={},this._dismissed=!1,this.onDismiss=n=>{n.preventDefault(),n.stopPropagation();const r={bubbles:!0,composed:!0};this._dismissed=!0;let{bannerId:s,text:i,headerStyle:c,dismissable:t}=this;this.dispatchEvent(new CustomEvent("bannerDismissed",{detail:{bannerId:s,text:i,headerStyle:c,dismissable:t},...r}))}}render(){if(!this._dismissed)return A`
|
|
466
|
+
<header style=${Ar({...Qs,...this.headerStyle})}>
|
|
401
467
|
<div style="flex-grow:1"><slot name="text">${this.text}</slot><slot></slot></div>
|
|
402
|
-
${this.dismissable?
|
|
468
|
+
${this.dismissable?A`<spectric-button size="small" @click=${this.onDismiss}>X</spectric-button>`:null}
|
|
403
469
|
</header>
|
|
404
|
-
`}};ge([
|
|
470
|
+
`}};ge([m({type:Boolean,reflect:!0})],ue.prototype,"dismissable",2),ge([m({type:String,reflect:!0})],ue.prototype,"text",2),ge([m({type:String,reflect:!0})],ue.prototype,"bannerId",2),ge([m({type:Object})],ue.prototype,"headerStyle",2),ge([m({state:!0,type:Boolean,attribute:!1})],ue.prototype,"_dismissed",2),ue=ge([L("spectric-banner")],ue);const Hs=M`
|
|
405
471
|
|
|
406
472
|
:host {
|
|
407
473
|
height:100vh;
|
|
@@ -561,18 +627,18 @@ article{
|
|
|
561
627
|
* @license
|
|
562
628
|
* Copyright 2018 Google LLC
|
|
563
629
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
564
|
-
*/const
|
|
630
|
+
*/const Ot=n=>n??C;class qs extends Or{constructor(){super(...arguments),this.prevData={}}render(r){return C}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 c in r){const t=r[c];t!==s[c]&&(i[c]=t)}}groom(r){const{prevData:s,element:i}=this;if(s)for(const c in s)(!r||!(c in r)&&i[c]===s[c])&&(i[c]=void 0)}}const Ge=Ct(qs);var Pt=(n=>(n.None="none",n.Uscui="us.cui",n.Usclassified="us.classified",n.Usunclassified="us.unclassified",n.Usconfidential="us.confidential",n.Ussecret="us.secret",n.Ustopsecret="us.topsecret",n.UstopsecretSi="us.topsecret.si",n.Uknotset="uk.notset",n.Ukofficial="uk.official",n.Uksecret="uk.secret",n.Uktopsecret="uk.topsecret",n.Caprotected_a="ca.protected_a",n.Caprotected_b="ca.protected_b",n.Caprotected_c="ca.protected_c",n.Caconfidential="ca.confidential",n.Casecret="ca.secret",n.Catopsecret="ca.topsecret",n.Auunofficial="au.unofficial",n.Auofficial="au.official",n.Auofficialsensitive="au.officialsensitive",n.Auconfidential="au.confidential",n.Ausecret="au.secret",n.Autopsecret="au.topsecret",n))(Pt||{});const Je={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 Ws=Object.defineProperty,Ys=Object.getOwnPropertyDescriptor,I=(n,r,s,i)=>{for(var c=i>1?void 0:i?Ys(r,s):r,t=n.length-1,p;t>=0;t--)(p=n[t])&&(c=(i?p(r,s,c):p(c))||c);return i&&c&&Ws(r,s,c),c};d.SpectricPage=class extends O{constructor(){super(...arguments),this.showHeader=!0,this.headerSticky=!0,this.classificationLevel=Pt.None,this.classificationText="",this.notifications=[],this.showCreateAccount=!1,this.showLoginButton=!0,this.username=""}render(){this.classificationLevel&&!Je[this.classificationLevel]&&(console.warn("Unknown classification",this.classificationLevel),this.classificationLevel=Pt.None);const r=this.classificationLevel?this.classificationText||Je[this.classificationLevel].content:"",s=this.showHeader?A`<spectric-header ?showCreateAccount=${this.showCreateAccount} .showLoginButton=${this.showLoginButton} username=${Ot(this.username)}>
|
|
565
631
|
<slot name="branding" slot="branding"></slot>
|
|
566
632
|
<slot name="name" slot="name"></slot>
|
|
567
633
|
<slot name="center" slot="center"></slot>
|
|
568
634
|
<slot name="end" slot="end"></slot>
|
|
569
|
-
</spectric-header>`:null;return
|
|
570
|
-
${this.classificationLevel&&r?
|
|
635
|
+
</spectric-header>`:null;return A`
|
|
636
|
+
${this.classificationLevel&&r?A`
|
|
571
637
|
<!-- Classification Banner -->
|
|
572
|
-
<spectric-banner ${
|
|
638
|
+
<spectric-banner ${Ge({text:r,headerStyle:Je[this.classificationLevel]})}></spectric-banner>
|
|
573
639
|
`:null}
|
|
574
|
-
<spectric-theme theme=${
|
|
575
|
-
${this.notifications?this.notifications.map(i=>
|
|
640
|
+
<spectric-theme theme=${Ot(this.theme)}>
|
|
641
|
+
${this.notifications?this.notifications.map(i=>A`<spectric-banner ${Ge(i)} ></spectric-banner>`):null}
|
|
576
642
|
${this.headerSticky?s:null}
|
|
577
643
|
<article>
|
|
578
644
|
${this.headerSticky?null:s}
|
|
@@ -582,9 +648,9 @@ article{
|
|
|
582
648
|
</section>
|
|
583
649
|
</article>
|
|
584
650
|
</spectric-theme>
|
|
585
|
-
${this.classificationLevel&&r?
|
|
651
|
+
${this.classificationLevel&&r?A`<spectric-banner ${Ge({text:r,headerStyle:Je[this.classificationLevel]})}></spectric-banner>`:null}
|
|
586
652
|
|
|
587
|
-
`}},d.SpectricPage.styles=
|
|
653
|
+
`}},d.SpectricPage.styles=Hs,I([m({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"showHeader",2),I([m({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"headerSticky",2),I([m({type:String,reflect:!0})],d.SpectricPage.prototype,"classificationLevel",2),I([m({type:String,reflect:!0})],d.SpectricPage.prototype,"classificationText",2),I([m({type:Array,reflect:!0})],d.SpectricPage.prototype,"notifications",2),I([m({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"showCreateAccount",2),I([m({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"showLoginButton",2),I([m({type:String,reflect:!0})],d.SpectricPage.prototype,"username",2),I([m({type:String,reflect:!0})],d.SpectricPage.prototype,"theme",2),d.SpectricPage=I([L("spectric-page")],d.SpectricPage);var Vs=Object.defineProperty,Ks=Object.getOwnPropertyDescriptor,P=(n,r,s,i)=>{for(var c=i>1?void 0:i?Ks(r,s):r,t=n.length-1,p;t>=0;t--)(p=n[t])&&(c=(i?p(r,s,c):p(c))||c);return i&&c&&Vs(r,s,c),c},Dr=(n=>(n.Text="text",n.TextArea="text-area",n.number="number",n.color="color",n.date="date",n.datetime="datetime-local",n.email="email",n.file="file",n.hidden="hidden",n.password="password",n))(Dr||{});d.SpectricInput=class extends O{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`
|
|
588
654
|
<div class="inputWrapper">
|
|
589
655
|
<div class="text-input__label-helper-wrapper">
|
|
590
656
|
<div class="--text-input__label-wrapper">
|
|
@@ -611,7 +677,7 @@ article{
|
|
|
611
677
|
@change=${()=>{this.dispatchEvent(new Event("change",{bubbles:!0}))}}
|
|
612
678
|
/>
|
|
613
679
|
|
|
614
|
-
${this.variant==="password"&&this.showPasswordVisibilityToggle?
|
|
680
|
+
${this.variant==="password"&&this.showPasswordVisibilityToggle?A`
|
|
615
681
|
<spectric-button
|
|
616
682
|
size="small"
|
|
617
683
|
type="button"
|
|
@@ -629,11 +695,11 @@ article{
|
|
|
629
695
|
|
|
630
696
|
</div>
|
|
631
697
|
</div>
|
|
632
|
-
`;case"hidden":return
|
|
633
|
-
`);super(
|
|
634
|
-
`},
|
|
635
|
-
`?(o.seenCR||o.line++,o.column=1,o.seenCR=!1):u==="\r"||u==="\u2028"||u==="\u2029"?(o.line++,o.column=1,o.seenCR=!0):(o.column++,o.seenCR=!1),l++;return st[e]=o,o}function nt(e,o){var l=Ci(e),u=Ci(o);return{start:{offset:e,line:l.line,column:l.column},end:{offset:o,line:u.line,column:u.column}}}function b(e){c<q||(c>q&&(q=c,Ft=[]),Ft.push(e))}function Ei(e,o,l,u){function h(P){var T=1;for(P.sort(function(ie,M){return ie.description<M.description?-1:ie.description>M.description?1:0});T<P.length;)P[T-1]===P[T]?P.splice(T,1):T++}function $(P,T){function ie(Qc){function ft(K){return K.charCodeAt(0).toString(16).toUpperCase()}return Qc.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(K){return"\\x0"+ft(K)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(K){return"\\x"+ft(K)}).replace(/[\u0100-\u0FFF]/g,function(K){return"\\u0"+ft(K)}).replace(/[\u1000-\uFFFF]/g,function(K){return"\\u"+ft(K)})}var M=new Array(P.length),Wi,Vi,Me;for(Me=0;Me<P.length;Me++)M[Me]=P[Me].description;return Wi=P.length>1?M.slice(0,-1).join(", ")+" or "+M[P.length-1]:M[0],Vi=T?'"'+ie(T)+'"':"end of input","Expected "+Wi+" but "+Vi+" found."}return o!==null&&h(o),new r(e!==null?e:$(o,l),o,l,u)}function Oi(){var e,o,l,u;for(e=c,o=[],l=m();l!==t;)o.push(l),l=m();return o!==t?(l=ct(),l===t&&(l=null),l!==t?(u=pt(),u!==t?(w=e,o=v(l,u),e=o):(c=e,e=t)):(c=e,e=t)):(c=e,e=t),e}function ct(){var e,o,l,u;return e=c,w=c,o=_(),o?o=void 0:o=t,o!==t?(l=Ac(),l!==t?(o=[o,l],e=o):(c=e,e=t)):(c=e,e=t),e===t&&(e=c,o=Ht(),o!==t?(l=at(),l!==t?(u=ct(),u!==t?(w=e,o=A(o,u),e=o):(c=e,e=t)):(c=e,e=t)):(c=e,e=t),e===t&&(e=Ht())),e}function Ht(){var e,o,l,u;return e=c,o=Pi(),o!==t?(l=lt(),l!==t?(u=Ht(),u!==t?(w=e,o=S(o,u),e=o):(c=e,e=t)):(c=e,e=t)):(c=e,e=t),e===t&&(e=Pi()),e}function Pi(){var e,o,l;return e=c,o=Yt(),o!==t?(l=Ti(),l!==t?(w=e,o=E(l),e=o):(c=e,e=t)):(c=e,e=t),e===t&&(e=Ti()),e}function Ti(){var e,o,l,u,h,$;if(e=c,i.charCodeAt(c)===40?(o=x,c++):(o=t,f===0&&b(L)),o!==t){for(l=[],u=m();u!==t;)l.push(u),u=m();l!==t?(u=ct(),u!==t?(h=pt(),h!==t?(i.charCodeAt(c)===41?($=et,c++):($=t,f===0&&b(te)),$!==t?(w=e,o=F(u,h),e=o):(c=e,e=t)):(c=e,e=t)):(c=e,e=t)):(c=e,e=t)}else c=e,e=t;return e===t&&(e=gc()),e}function gc(){var e,o,l,u,h,$,P,T,ie,M;if(e=c,o=qt(),o!==t){for(l=[],u=m();u!==t;)l.push(u),u=m();if(l!==t)if(i.charCodeAt(c)===58?(u=H,c++):(u=t,f===0&&b(j)),u!==t){for(h=[],$=m();$!==t;)h.push($),$=m();if(h!==t)if(i.charCodeAt(c)===123?($=me,c++):($=t,f===0&&b(Bt)),$!==t){for(P=[],T=m();T!==t;)P.push(T),T=m();P!==t?(T=ct(),T!==t?(ie=pt(),ie!==t?(i.charCodeAt(c)===125?(M=jt,c++):(M=t,f===0&&b(Rt)),M!==t?(w=e,o=ln(o,T,ie),e=o):(c=e,e=t)):(c=e,e=t)):(c=e,e=t)):(c=e,e=t)}else c=e,e=t;else c=e,e=t}else c=e,e=t;else c=e,e=t}else c=e,e=t;return e===t&&(e=bc()),e}function bc(){var e;return e=vc(),e===t&&(e=yc(),e===t&&(e=mc())),e}function qt(){var e;return f++,e=Kt(),f--,e===t&&f===0&&b(un),e}function vc(){var e,o,l,u,h,$;if(e=c,o=qt(),o!==t){for(l=[],u=m();u!==t;)l.push(u),u=m();if(l!==t)if(u=Ri(),u!==t){for(h=[],$=m();$!==t;)h.push($),$=m();h!==t?($=Kt(),$!==t?(w=e,o=pn(o,u,$),e=o):(c=e,e=t)):(c=e,e=t)}else c=e,e=t;else c=e,e=t}else c=e,e=t;return e}function yc(){var e,o,l,u,h,$;if(e=c,o=qt(),o!==t){for(l=[],u=m();u!==t;)l.push(u),u=m();if(l!==t)if(i.charCodeAt(c)===58?(u=H,c++):(u=t,f===0&&b(j)),u!==t){for(h=[],$=m();$!==t;)h.push($),$=m();h!==t?($=Wt(),$!==t?(w=e,o=dn(o,$),e=o):(c=e,e=t)):(c=e,e=t)}else c=e,e=t;else c=e,e=t}else c=e,e=t;return e}function mc(){var e,o;return e=c,o=Di(),o!==t&&(w=e,o=fn(o)),e=o,e}function Wt(){var e,o,l,u,h,$;if(e=c,i.charCodeAt(c)===40?(o=x,c++):(o=t,f===0&&b(L)),o!==t){for(l=[],u=m();u!==t;)l.push(u),u=m();l!==t?(u=Li(),u!==t?(h=pt(),h!==t?(i.charCodeAt(c)===41?($=et,c++):($=t,f===0&&b(te)),$!==t?(w=e,o=hn(u,h),e=o):(c=e,e=t)):(c=e,e=t)):(c=e,e=t)):(c=e,e=t)}else c=e,e=t;return e===t&&(e=Di()),e}function Li(){var e,o,l,u;return e=c,o=Vt(),o!==t?(l=at(),l!==t?(u=Li(),u!==t?(w=e,o=gn(o,u),e=o):(c=e,e=t)):(c=e,e=t)):(c=e,e=t),e===t&&(e=Vt()),e}function Vt(){var e,o,l,u;return e=c,o=Ni(),o!==t?(l=lt(),l!==t?(u=Vt(),u!==t?(w=e,o=bn(o,u),e=o):(c=e,e=t)):(c=e,e=t)):(c=e,e=t),e===t&&(e=Ni()),e}function Ni(){var e,o,l;return e=c,o=Yt(),o!==t?(l=Wt(),l!==t?(w=e,o=vn(l),e=o):(c=e,e=t)):(c=e,e=t),e===t&&(e=Wt()),e}function Di(){var e,o;return f++,e=c,o=ut(),o!==t&&(w=e,o=mn(o)),e=o,e===t&&(e=c,o=Bi(),o!==t&&(w=e,o=$n(o)),e=o),f--,e===t&&(o=t,f===0&&b(yn)),e}function at(){var e,o,l,u,h;if(f++,e=c,o=[],l=m(),l!==t)for(;l!==t;)o.push(l),l=m();else o=t;if(o!==t)if(i.substr(c,2).toLowerCase()===Ir?(l=i.substr(c,2),c+=2):(l=t,f===0&&b(Qr)),l!==t){if(u=[],h=m(),h!==t)for(;h!==t;)u.push(h),h=m();else u=t;u!==t?(o=[o,l,u],e=o):(c=e,e=t)}else c=e,e=t;else c=e,e=t;return e===t&&(e=c,w=c,o=_(),o?o=void 0:o=t,o!==t?(l=Ui(),l!==t?(o=[o,l],e=o):(c=e,e=t)):(c=e,e=t)),f--,e===t&&(o=t,f===0&&b(wn)),e}function lt(){var e,o,l,u,h;if(f++,e=c,o=[],l=m(),l!==t)for(;l!==t;)o.push(l),l=m();else o=t;if(o!==t)if(i.substr(c,3).toLowerCase()===Fr?(l=i.substr(c,3),c+=3):(l=t,f===0&&b(Hr)),l!==t){if(u=[],h=m(),h!==t)for(;h!==t;)u.push(h),h=m();else u=t;u!==t?(o=[o,l,u],e=o):(c=e,e=t)}else c=e,e=t;else c=e,e=t;return e===t&&(e=c,w=c,o=_(),o?o=void 0:o=t,o!==t?(l=Mi(),l!==t?(o=[o,l],e=o):(c=e,e=t)):(c=e,e=t)),f--,e===t&&(o=t,f===0&&b(_n)),e}function Yt(){var e,o,l,u;if(f++,e=c,i.substr(c,3).toLowerCase()===qr?(o=i.substr(c,3),c+=3):(o=t,f===0&&b(Wr)),o!==t){if(l=[],u=m(),u!==t)for(;u!==t;)l.push(u),u=m();else l=t;l!==t?(o=[o,l],e=o):(c=e,e=t)}else c=e,e=t;return e===t&&(e=c,w=c,o=_(),o?o=void 0:o=t,o!==t?(l=zi(),l!==t?(o=[o,l],e=o):(c=e,e=t)):(c=e,e=t)),f--,e===t&&(o=t,f===0&&b(Sn)),e}function Kt(){var e;return f++,e=ut(),e===t&&(e=Bi()),f--,e===t&&f===0&&b(An),e}function ut(){var e,o,l,u,h,$;if(e=c,i.charCodeAt(c)===34?(o=De,c++):(o=t,f===0&&b(Be)),o!==t){for(l=[],u=_e();u!==t;)l.push(u),u=_e();if(l!==t)if(u=Ue(),u!==t){for(h=[],$=_e();$!==t;)h.push($),$=_e();h!==t?(i.charCodeAt(c)===34?($=De,c++):($=t,f===0&&b(Be)),$!==t?(w=e,o=Ut(l,u,h),e=o):(c=e,e=t)):(c=e,e=t)}else c=e,e=t;else c=e,e=t}else c=e,e=t;if(e===t)if(e=c,i.charCodeAt(c)===34?(o=De,c++):(o=t,f===0&&b(Be)),o!==t){for(l=[],u=_e();u!==t;)l.push(u),u=_e();l!==t?(i.charCodeAt(c)===34?(u=De,c++):(u=t,f===0&&b(Be)),u!==t?(w=e,o=kn(l),e=o):(c=e,e=t)):(c=e,e=t)}else c=e,e=t;return e}function _e(){var e,o,l;return e=Zt(),e===t&&(e=c,i.charCodeAt(c)===92?(o=je,c++):(o=t,f===0&&b(Re)),o!==t?(xn.test(i.charAt(c))?(l=i.charAt(c),c++):(l=t,f===0&&b(Cn)),l!==t?(w=e,o=tt(l),e=o):(c=e,e=t)):(c=e,e=t),e===t&&(e=c,o=c,f++,l=Ue(),f--,l===t?o=void 0:(c=o,o=t),o!==t?(En.test(i.charAt(c))?(l=i.charAt(c),c++):(l=t,f===0&&b(On)),l!==t?(w=e,o=tt(l),e=o):(c=e,e=t)):(c=e,e=t))),e}function Bi(){var e,o,l,u,h;for(e=c,o=[],l=Se();l!==t;)o.push(l),l=Se();if(o!==t)if(l=Ue(),l!==t){for(u=[],h=Se();h!==t;)u.push(h),h=Se();u!==t?(w=e,o=Ut(o,l,u),e=o):(c=e,e=t)}else c=e,e=t;else c=e,e=t;if(e===t){if(e=c,o=[],l=Se(),l!==t)for(;l!==t;)o.push(l),l=Se();else o=t;o!==t&&(w=e,o=Pn(o)),e=o}return e}function Se(){var e,o,l,u,h;return e=Zt(),e===t&&(e=wc(),e===t&&(e=_c(),e===t&&(e=$c(),e===t&&(e=c,o=c,f++,l=ji(),f--,l===t?o=void 0:(c=o,o=t),o!==t?(l=c,f++,u=Sc(),f--,u===t?l=void 0:(c=l,l=t),l!==t?(u=c,f++,h=Ue(),f--,h===t?u=void 0:(c=u,u=t),u!==t?(i.length>c?(h=i.charAt(c),c++):(h=t,f===0&&b(Vr)),h!==t?(w=e,o=tt(h),e=o):(c=e,e=t)):(c=e,e=t)):(c=e,e=t)):(c=e,e=t))))),e}function $c(){var e,o;return e=c,i.charCodeAt(c)===42?(o=rt,c++):(o=t,f===0&&b(it)),o!==t&&(w=e,o=Tn()),e=o,e}function pt(){var e,o,l,u,h;for(e=c,o=[],l=m();l!==t;)o.push(l),l=m();if(o!==t)if(l=Ue(),l!==t){for(u=[],h=m();h!==t;)u.push(h),h=m();u!==t?(w=e,o=Ut(o,l,u),e=o):(c=e,e=t)}else c=e,e=t;else c=e,e=t;if(e===t)for(e=[],o=m();o!==t;)e.push(o),o=m();return e}function Zt(){var e,o;return e=c,i.substr(c,2)===Yr?(o=Yr,c+=2):(o=t,f===0&&b(Ln)),o!==t&&(w=e,o=Nn()),e=o,e===t&&(e=c,i.substr(c,2)===Kr?(o=Kr,c+=2):(o=t,f===0&&b(Dn)),o!==t&&(w=e,o=Bn()),e=o,e===t&&(e=c,i.substr(c,2)===Zr?(o=Zr,c+=2):(o=t,f===0&&b(jn)),o!==t&&(w=e,o=Rn()),e=o)),e}function wc(){var e,o,l;return e=c,i.charCodeAt(c)===92?(o=je,c++):(o=t,f===0&&b(Re)),o!==t?(l=ji(),l!==t?(w=e,o=tt(l),e=o):(c=e,e=t)):(c=e,e=t),e}function _c(){var e,o,l;return e=c,i.charCodeAt(c)===92?(o=je,c++):(o=t,f===0&&b(Re)),o!==t?(i.substr(c,2).toLowerCase()===Ir?(l=i.substr(c,2),c+=2):(l=t,f===0&&b(Qr)),l===t&&(i.substr(c,3).toLowerCase()===Fr?(l=i.substr(c,3),c+=3):(l=t,f===0&&b(Hr)),l===t&&(i.substr(c,3).toLowerCase()===qr?(l=i.substr(c,3),c+=3):(l=t,f===0&&b(Wr)))),l!==t?(w=e,o=Un(l),e=o):(c=e,e=t)):(c=e,e=t),e}function Sc(){var e;return e=at(),e===t&&(e=lt(),e===t&&(e=Yt())),e}function ji(){var e;return Mn.test(i.charAt(c))?(e=i.charAt(c),c++):(e=t,f===0&&b(zn)),e}function Ri(){var e,o;return e=c,i.substr(c,2)===Xr?(o=Xr,c+=2):(o=t,f===0&&b(In)),o!==t&&(w=e,o=Qn()),e=o,e===t&&(e=c,i.substr(c,2)===Gr?(o=Gr,c+=2):(o=t,f===0&&b(Fn)),o!==t&&(w=e,o=Hn()),e=o,e===t&&(e=c,i.charCodeAt(c)===60?(o=Jr,c++):(o=t,f===0&&b(ei)),o!==t&&(w=e,o=qn()),e=o,e===t&&(e=c,i.charCodeAt(c)===62?(o=ti,c++):(o=t,f===0&&b(ri)),o!==t&&(w=e,o=Wn()),e=o))),e}function m(){var e;return f++,Yn.test(i.charAt(c))?(e=i.charAt(c),c++):(e=t,f===0&&b(Kn)),f--,e===t&&f===0&&b(Vn),e}function Ue(){var e,o,l;return e=c,w=c,o=Zn(),o?o=void 0:o=t,o!==t?(i.substr(c,14)===ii?(l=ii,c+=14):(l=t,f===0&&b(Xn)),l!==t?(w=e,o=Gn(),e=o):(c=e,e=t)):(c=e,e=t),e}function Ui(){var e,o,l,u,h;for(e=c,o=[],l=m();l!==t;)o.push(l),l=m();if(o!==t)if(i.substr(c,2)===si?(l=si,c+=2):(l=t,f===0&&b(Jn)),l!==t){for(u=[],h=m();h!==t;)u.push(h),h=m();u!==t?(w=e,o=ec(),e=o):(c=e,e=t)}else c=e,e=t;else c=e,e=t;return e}function Mi(){var e,o,l,u,h;for(e=c,o=[],l=m();l!==t;)o.push(l),l=m();if(o!==t)if(i.substr(c,2)===oi?(l=oi,c+=2):(l=t,f===0&&b(tc)),l!==t){for(u=[],h=m();h!==t;)u.push(h),h=m();u!==t?(w=e,o=ni(),e=o):(c=e,e=t)}else c=e,e=t;else c=e,e=t;return e===t&&(e=c,i.charCodeAt(c)===43?(o=ci,c++):(o=t,f===0&&b(ai)),o!==t&&(w=e,o=ni()),e=o),e}function zi(){var e,o;return e=c,i.charCodeAt(c)===45?(o=li,c++):(o=t,f===0&&b(ui)),o!==t&&(w=e,o=pi()),e=o,e===t&&(e=c,i.charCodeAt(c)===33?(o=di,c++):(o=t,f===0&&b(fi)),o!==t&&(w=e,o=pi()),e=o),e}function Ac(){var e;return e=kc(),e===t&&(e=Ii(),e===t&&(e=xc())),e}function kc(){var e,o,l,u,h,$;if(e=c,o=Ae(),o!==t){for(l=[],u=m();u!==t;)l.push(u),u=m();if(l!==t)if(i.charCodeAt(c)===58?(u=H,c++):(u=t,f===0&&b(j)),u!==t){for(h=[],$=m();$!==t;)h.push($),$=m();h!==t?($=Ii(),$!==t?(o=[o,l,u,h,$],e=o):(c=e,e=t)):(c=e,e=t)}else c=e,e=t;else c=e,e=t}else c=e,e=t;return e}function Ii(){var e;return e=Cc(),e===t&&(e=Xt(),e===t&&(e=Ec(),e===t&&(e=Oc(),e===t&&(e=Pc(),e===t&&(e=Tc()))))),e}function xc(){var e,o,l,u,h,$;if(e=c,i.substr(c,8)===hi?(o=hi,c+=8):(o=t,f===0&&b(rc)),o!==t){for(l=[],u=m();u!==t;)l.push(u),u=m();if(l!==t)if(i.charCodeAt(c)===58?(u=H,c++):(u=t,f===0&&b(j)),u!==t){for(h=[],$=m();$!==t;)h.push($),$=m();h!==t?($=Ae(),$!==t?(w=e,o=ic(),e=o):(c=e,e=t)):(c=e,e=t)}else c=e,e=t;else c=e,e=t}else c=e,e=t;return e}function Cc(){var e,o,l,u,h,$,P;if(e=c,o=Ri(),o!==t){for(l=[],u=m();u!==t;)l.push(u),u=m();l!==t?(u=Ae(),u!==t?(w=e,o=gi(),e=o):(c=e,e=t)):(c=e,e=t)}else c=e,e=t;if(e===t)if(e=c,o=Dc(),o!==t){for(l=[],u=m();u!==t;)l.push(u),u=m();l!==t?(u=Ae(),u!==t?(h=Hi(),h!==t?($=Ae(),$!==t?(P=Bc(),P!==t?(w=e,o=gi(),e=o):(c=e,e=t)):(c=e,e=t)):(c=e,e=t)):(c=e,e=t)):(c=e,e=t)}else c=e,e=t;return e}function Xt(){var e,o,l,u,h;for(e=c,o=[],l=dt(),l===t&&(i.charCodeAt(c)===42?(l=rt,c++):(l=t,f===0&&b(it)));l!==t;)o.push(l),l=dt(),l===t&&(i.charCodeAt(c)===42?(l=rt,c++):(l=t,f===0&&b(it)));if(o!==t)if(i.charCodeAt(c)===63?(l=bi,c++):(l=t,f===0&&b(vi)),l!==t){for(u=[],h=Xt();h!==t;)u.push(h),h=Xt();u!==t?(w=e,o=sc(),e=o):(c=e,e=t)}else c=e,e=t;else c=e,e=t;return e}function Ec(){var e,o,l,u;if(e=c,i.charCodeAt(c)===47?(o=Mt,c++):(o=t,f===0&&b(zt)),o!==t){for(l=[],yi.test(i.charAt(c))?(u=i.charAt(c),c++):(u=t,f===0&&b(mi));u!==t;)l.push(u),yi.test(i.charAt(c))?(u=i.charAt(c),c++):(u=t,f===0&&b(mi));l!==t?(i.charCodeAt(c)===47?(u=Mt,c++):(u=t,f===0&&b(zt)),u!==t?(w=e,o=oc(),e=o):(c=e,e=t)):(c=e,e=t)}else c=e,e=t;return e}function Oc(){var e,o,l,u,h;if(e=c,o=Qi(),o!==t)if(i.charCodeAt(c)===126?(l=It,c++):(l=t,f===0&&b(Qt)),l!==t){for(u=[],$e.test(i.charAt(c))?(h=i.charAt(c),c++):(h=t,f===0&&b(we));h!==t;)u.push(h),$e.test(i.charAt(c))?(h=i.charAt(c),c++):(h=t,f===0&&b(we));u!==t?(w=e,o=nc(),e=o):(c=e,e=t)}else c=e,e=t;else c=e,e=t;return e}function Pc(){var e,o,l,u,h;if(e=c,o=ut(),o!==t)if(i.charCodeAt(c)===126?(l=It,c++):(l=t,f===0&&b(Qt)),l!==t){for(u=[],$e.test(i.charAt(c))?(h=i.charAt(c),c++):(h=t,f===0&&b(we));h!==t;)u.push(h),$e.test(i.charAt(c))?(h=i.charAt(c),c++):(h=t,f===0&&b(we));u!==t?(w=e,o=cc(),e=o):(c=e,e=t)}else c=e,e=t;else c=e,e=t;return e}function Tc(){var e,o,l,u,h;if(e=c,o=Ae(),o!==t)if(i.charCodeAt(c)===94?(l=$i,c++):(l=t,f===0&&b(wi)),l!==t){for(u=[],$e.test(i.charAt(c))?(h=i.charAt(c),c++):(h=t,f===0&&b(we));h!==t;)u.push(h),$e.test(i.charAt(c))?(h=i.charAt(c),c++):(h=t,f===0&&b(we));u!==t?(w=e,o=ac(),e=o):(c=e,e=t)}else c=e,e=t;else c=e,e=t;return e}function Ae(){var e;return e=ut(),e===t&&(e=Qi()),e}function Qi(){var e,o;if(e=[],o=dt(),o!==t)for(;o!==t;)e.push(o),o=dt();else e=t;return e}function dt(){var e,o,l,u;return e=Zt(),e===t&&(e=Nc(),e===t&&(e=c,o=c,f++,l=Fi(),f--,l===t?o=void 0:(c=o,o=t),o!==t?(l=c,f++,u=Lc(),f--,u===t?l=void 0:(c=l,l=t),l!==t?(i.length>c?(u=i.charAt(c),c++):(u=t,f===0&&b(Vr)),u!==t?(o=[o,l,u],e=o):(c=e,e=t)):(c=e,e=t)):(c=e,e=t))),e}function Lc(){var e;return e=at(),e===t&&(e=lt(),e===t&&(e=Ui(),e===t&&(e=Mi(),e===t&&(e=zi(),e===t&&(e=Hi()))))),e}function Nc(){var e,o,l;return e=c,i.charCodeAt(c)===92?(o=je,c++):(o=t,f===0&&b(Re)),o!==t?(l=Fi(),l!==t?(w=e,o=lc(),e=o):(c=e,e=t)):(c=e,e=t),e}function Fi(){var e;return i.charCodeAt(c)===43?(e=ci,c++):(e=t,f===0&&b(ai)),e===t&&(i.charCodeAt(c)===45?(e=li,c++):(e=t,f===0&&b(ui)),e===t&&(i.charCodeAt(c)===61?(e=uc,c++):(e=t,f===0&&b(pc)),e===t&&(i.charCodeAt(c)===62?(e=ti,c++):(e=t,f===0&&b(ri)),e===t&&(i.charCodeAt(c)===60?(e=Jr,c++):(e=t,f===0&&b(ei)),e===t&&(i.charCodeAt(c)===33?(e=di,c++):(e=t,f===0&&b(fi)),e===t&&(i.charCodeAt(c)===40?(e=x,c++):(e=t,f===0&&b(L)),e===t&&(i.charCodeAt(c)===41?(e=et,c++):(e=t,f===0&&b(te)),e===t&&(i.charCodeAt(c)===123?(e=me,c++):(e=t,f===0&&b(Bt)),e===t&&(i.charCodeAt(c)===125?(e=jt,c++):(e=t,f===0&&b(Rt)),e===t&&(i.charCodeAt(c)===91?(e=_i,c++):(e=t,f===0&&b(Si)),e===t&&(i.charCodeAt(c)===93?(e=Ai,c++):(e=t,f===0&&b(ki)),e===t&&(i.charCodeAt(c)===94?(e=$i,c++):(e=t,f===0&&b(wi)),e===t&&(i.charCodeAt(c)===34?(e=De,c++):(e=t,f===0&&b(Be)),e===t&&(i.charCodeAt(c)===126?(e=It,c++):(e=t,f===0&&b(Qt)),e===t&&(i.charCodeAt(c)===42?(e=rt,c++):(e=t,f===0&&b(it)),e===t&&(i.charCodeAt(c)===63?(e=bi,c++):(e=t,f===0&&b(vi)),e===t&&(i.charCodeAt(c)===58?(e=H,c++):(e=t,f===0&&b(j)),e===t&&(i.charCodeAt(c)===92?(e=je,c++):(e=t,f===0&&b(Re)),e===t&&(i.charCodeAt(c)===47?(e=Mt,c++):(e=t,f===0&&b(zt))))))))))))))))))))),e}function Hi(){var e,o,l,u,h;if(e=c,o=[],l=m(),l!==t)for(;l!==t;)o.push(l),l=m();else o=t;if(o!==t)if(i.substr(c,2)===xi?(l=xi,c+=2):(l=t,f===0&&b(dc)),l!==t){if(u=[],h=m(),h!==t)for(;h!==t;)u.push(h),h=m();else u=t;u!==t?(o=[o,l,u],e=o):(c=e,e=t)}else c=e,e=t;else c=e,e=t;return e}function Dc(){var e;return i.charCodeAt(c)===91?(e=_i,c++):(e=t,f===0&&b(Si)),e===t&&(i.charCodeAt(c)===123?(e=me,c++):(e=t,f===0&&b(Bt))),e}function Bc(){var e;return i.charCodeAt(c)===93?(e=Ai,c++):(e=t,f===0&&b(ki)),e===t&&(i.charCodeAt(c)===125?(e=jt,c++):(e=t,f===0&&b(Rt))),e}const{errorOnLuceneSyntax:jc,parseCursor:Rc,cursorSymbol:Uc,allowLeadingWildcards:Mc=!0,helpers:{nodeTypes:de}}=a,W=de.function.buildNodeWithArgumentNodes,re=de.literal.buildNode,zc=de.wildcard.buildNode,Ic=de.namedArg.buildNode,{wildcardSymbol:qi}=de.wildcard;if(ot=g(),ot!==t&&c===i.length)return ot;throw ot!==t&&c<i.length&&b({type:"end",description:"end of input"}),Ei(null,Ft,q<i.length?i.charAt(q):null,q<i.length?nt(q,q+1):nt(q,q))}return{SyntaxError:r,parse:s}}(),Et=(n,r={},s=Ge)=>{if(typeof n>"u")throw new Error("expression must be a string, got undefined instead");return s(n,{...r,helpers:{nodeTypes:Y}})},ye=(n,r={})=>Et(n,{...r,startRule:"Literal"},Ge),Je=(n,r={})=>{try{return Et(n,r,Ge)}catch(s){throw s.name==="SyntaxError"?new Cr(s,n):s}},Fs=n=>{try{return Et(n,{errorOnLuceneSyntax:!0},Ge),!1}catch(r){return r.message.startsWith("Lucene")}},D=(n,r,s,i)=>(r=void 0,!n||!n.type||!Y[n.type]?D(Y.function.buildNode("and",[]),r):Y[n.type].toOpenSearchQuery(n,r,s,i)),V="@kuery-wildcard@";function Hs(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function qs(n){return n.replace(/[+-=&|><!(){}[\]^"~*?:\\/]/g,"\\$&")}function Ws(n){return n.includes(V)?{type:"wildcard",value:n}:ye(n)}function Er(n,r){const{value:s}=n,i=s.split(V).map(Hs).join("[\\s\\S]*");return new RegExp(`^${i}$`).test(r)}function Vs(n){const{value:r}=n;return r.split(V).join("*")}function Ot(n){const{value:r}=n;return r.split(V).map(qs).join("*")}function Ys(n){const{value:r}=n;return r.startsWith(V)&&r.replace(V,"").length>0}const Ks=Object.freeze(Object.defineProperty({__proto__:null,buildNode:Ws,hasLeadingWildcard:Ys,test:Er,toOpenSearchQuery:Vs,toQueryStringQuery:Ot,wildcardSymbol:V},Symbol.toStringTag,{value:"Module"}));function Pt(n,r){if(!r)return[];if(n.type==="literal"){const s=Ct(n),i=r.fields.find(a=>a.name===s);return i?[i]:[]}else if(n.type==="wildcard")return r.fields.filter(i=>Er(n,i.name))}function Hc(n){return n}function Or(n,r,s){const i={...n,value:s?`${s}.${n.value}`:n.value};if(!r||i.type==="wildcard"&&!s)return i;const t=Pt(i,r).reduce((p,g)=>{const v=g.subType&&g.subType.nested?g.subType.nested.path:void 0;return s&&!v?[...p,`${g.name} is not a nested field but is in nested group "${s}" in the DQL expression.`]:v&&!s?[...p,`${g.name} is a nested field, but is not in a nested group in the DQL expression.`]:v!==s?[...p,`Nested field ${g.name} is being queried with the incorrect nested path. The correct path is ${g.subType.nested.path}.`]:p},[]);if(t.length>0)throw new Error(t.join(`
|
|
636
|
-
`));return i}function
|
|
698
|
+
`;case"hidden":return A`<input type="hidden"></input>`}return`Not yet implemented ${this.variant}`}},P([m({type:String,reflect:!0})],d.SpectricInput.prototype,"placeholder",2),P([m({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"readonly",2),P([m({type:String,reflect:!0})],d.SpectricInput.prototype,"variant",2),P([m({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"disabled",2),P([m({type:String,reflect:!0})],d.SpectricInput.prototype,"label",2),P([m()],d.SpectricInput.prototype,"hidePasswordLabel",2),P([m()],d.SpectricInput.prototype,"showPasswordLabel",2),P([m({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"showPasswordVisibilityToggle",2),P([m({type:String,reflect:!0})],d.SpectricInput.prototype,"helperText",2),P([m({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"invalid",2),P([m({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"required",2),P([m({type:String,reflect:!0})],d.SpectricInput.prototype,"invalidText",2),P([m()],d.SpectricInput.prototype,"name",2),P([m()],d.SpectricInput.prototype,"pattern",2),P([m({type:Number,reflect:!0})],d.SpectricInput.prototype,"maxCount",2),P([m({reflect:!0})],d.SpectricInput.prototype,"autocomplete",2),P([m({reflect:!0})],d.SpectricInput.prototype,"value",1),P([De("input")],d.SpectricInput.prototype,"_input",2),d.SpectricInput=P([L("spectric-input")],d.SpectricInput);const be=n=>Ot(n===""?void 0:n??void 0),Zs="end of input",Xs={fieldName:"field name",value:"value",literal:"literal",whitespace:"whitespace"};class Nr extends Error{constructor(r,s){let i=r.message;if(r.expected){const p=r.expected.map(v=>Xs[v.description]||v.description).join(", ");let g=r.found?`"${r.found}"`:Zs;i=`Expected ${p} but ${g} found.`}const c=[i,s,"-".repeat(r.location.start.offset)+"^"].join(`
|
|
699
|
+
`);super(c),this.name="DQLSyntaxError",this.shortMessage=i}}function ve(n){return{type:"literal",value:n}}function Tt(n){return n.value}const Gs=Object.freeze(Object.defineProperty({__proto__:null,buildNode:ve,toOpenSearchQuery:Tt},Symbol.toStringTag,{value:"Module"})),{SyntaxError:dc,parse:et}=function(){function n(i,c){function t(){this.constructor=i}t.prototype=c.prototype,i.prototype=new t}function r(i,c,t,p){this.message=i,this.expected=c,this.found=t,this.location=p,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,r)}n(r,Error);function s(i){var c=arguments.length>1?arguments[1]:{},t={},p={start:Ui,Literal:rr},g=Ui,v=function(e,o){return o.type==="cursor"?{...o,suggestionTypes:["conjunction"]}:e!==null?e:de.function.buildNode("is","*","*")},w=function(){return nc},x=function(e,o){const l=[e,o].find(u=>u.type==="cursor");return l||W("or",[e,o])},S=function(e,o){const l=[e,o].find(u=>u.type==="cursor");return l||W("and",[e,o])},E=function(e){return e.type==="cursor"?e:W("not",[e])},k="(",N={type:"literal",value:"(",description:'"("'},nt=")",re={type:"literal",value:")",description:'")"'},Q=function(e,o){return o.type==="cursor"?{...o,suggestionTypes:["conjunction"]}:e},H=":",B={type:"literal",value:":",description:'":"'},$e="{",Ft={type:"literal",value:"{",description:'"{"'},Qt="}",Ht={type:"literal",value:"}",description:'"}"'},Lo=function(e,o,l){return o.type==="cursor"?{...o,nestedPath:o.nestedPath?`${e.value}.${o.nestedPath}`:e.value}:l.type==="cursor"?{...l,suggestionTypes:["conjunction"]}:W("nested",[e,o])},Do={type:"other",description:"fieldName"},No=function(e,o,l){if(l.type==="cursor")return{...l,suggestionTypes:["conjunction"]};const u=uc(o,l);return W("range",[e,u])},jo=function(e,o){return o.type==="cursor"?{...o,fieldName:e.value,suggestionTypes:["value","conjunction"]}:o(e)},zo=function(e){if(e.type==="cursor"){const l=`${e.prefix}${e.suffix}`.trim();return{...e,fieldName:l,suggestionTypes:["field","operator","conjunction"]}}const o=ie(null);return e(o)},Bo=function(e,o){return o.type==="cursor"?{...o,suggestionTypes:["conjunction"]}:e},Ro=function(e,o){const l=[e,o].find(u=>u.type==="cursor");return l?{...l,suggestionTypes:["value"]}:u=>W("or",[e(u),o(u)])},Uo=function(e,o){const l=[e,o].find(u=>u.type==="cursor");return l?{...l,suggestionTypes:["value"]}:u=>W("and",[e(u),o(u)])},Mo=function(e){return e.type==="cursor"?{...list,suggestionTypes:["value"]}:o=>W("not",[e(o)])},Io={type:"other",description:"value"},Fo=function(e){if(e.type==="cursor")return e;const o=ie(!0);return l=>W("is",[l,e,o])},Qo=function(e){if(e.type==="cursor")return e;!cc&&e.type==="wildcard"&&de.wildcard.hasLeadingWildcard(e)&&R("Leading wildcards are disabled. See query:allowLeadingWildcards in Advanced Settings.");const o=ie(!1);return l=>W("is",[l,e,o])},Ho={type:"other",description:"OR"},Xr="or",Gr={type:"literal",value:"or",description:'"or"'},qo={type:"other",description:"AND"},Jr="and",ei={type:"literal",value:"and",description:'"and"'},Wo={type:"other",description:"NOT"},ti="not",ri={type:"literal",value:"not",description:'"not"'},Yo={type:"other",description:"literal"},je='"',ze={type:"literal",value:'"',description:'"\\""'},qt=function(e,o,l){const{start:u,end:h}=Ba();return{type:"cursor",start:u.offset,end:h.offset-o.length,prefix:e.join(""),suffix:l.join(""),text:za().replace(o,"")}},Vo=function(e){return ie(e.join(""))},Be="\\",Re={type:"literal",value:"\\",description:'"\\\\"'},Ko=/^[\\"]/,Zo={type:"class",value:'[\\\\"]',description:'[\\\\"]'},ot=function(e){return e},Xo=/^[^"]/,Go={type:"class",value:'[^"]',description:'[^"]'},Jo=function(e){const o=e.join("").trim();return o==="null"?ie(null):o==="true"?ie(!0):o==="false"?ie(!1):e.includes(ts)?lc(o):ie(/^(-?[1-9]+\d*([.]\d+)?)$|^(-?0[.]\d*[1-9]+)$|^0$|^0.0$|^[.]\d{1,}$/.test(o)?isFinite(o)&&(o>Number.MAX_SAFE_INTEGER||o<Number.MIN_SAFE_INTEGER)?BigInt(o):Number(o):o)},ii={type:"any",description:"any character"},at="*",ct={type:"literal",value:"*",description:'"*"'},ea=function(){return ts},si="\\t",ta={type:"literal",value:"\\t",description:'"\\\\t"'},ra=function(){return" "},ni="\\r",ia={type:"literal",value:"\\r",description:'"\\\\r"'},sa=function(){return"\r"},oi="\\n",na={type:"literal",value:"\\n",description:'"\\\\n"'},oa=function(){return`
|
|
700
|
+
`},aa=function(e){return e},ca=/^[\\():<>"*{}]/,la={type:"class",value:'[\\\\():<>"*{}]',description:'[\\\\():<>"*{}]'},ai="<=",ua={type:"literal",value:"<=",description:'"<="'},pa=function(){return"lte"},ci=">=",da={type:"literal",value:">=",description:'">="'},fa=function(){return"gte"},li="<",ui={type:"literal",value:"<",description:'"<"'},ha=function(){return"lt"},pi=">",di={type:"literal",value:">",description:'">"'},ga=function(){return"gt"},ba={type:"other",description:"whitespace"},va=/^[ \t\r\n]/,ma={type:"class",value:"[\\ \\t\\r\\n]",description:"[\\ \\t\\r\\n]"},ya=function(){return oc},fi="@kuery-cursor@",$a={type:"literal",value:"@kuery-cursor@",description:'"@kuery-cursor@"'},_a=function(){return ac},hi="||",wa={type:"literal",value:"||",description:'"||"'},Sa=function(){R("LuceneOr")},gi="&&",Aa={type:"literal",value:"&&",description:'"&&"'},bi=function(){R("LuceneAnd")},vi="+",mi={type:"literal",value:"+",description:'"+"'},yi="-",$i={type:"literal",value:"-",description:'"-"'},_i=function(){R("LuceneNot")},wi="!",Si={type:"literal",value:"!",description:'"!"'},Ai="_exists_",xa={type:"literal",value:"_exists_",description:'"_exists_"'},ka=function(){R("LuceneExists")},xi=function(){R("LuceneRange")},ki="?",Ci={type:"literal",value:"?",description:'"?"'},Ca=function(){R("LuceneWildcard")},Wt="/",Yt={type:"literal",value:"/",description:'"/"'},Ei=/^[^\/]/,Oi={type:"class",value:"[^/]",description:"[^/]"},Ea=function(){R("LuceneRegex")},Vt="~",Kt={type:"literal",value:"~",description:'"~"'},_e=/^[0-9]/,we={type:"class",value:"[0-9]",description:"[0-9]"},Oa=function(){R("LuceneFuzzy")},Pa=function(){R("LuceneProximity")},Pi="^",Ti={type:"literal",value:"^",description:'"^"'},Ta=function(){R("LuceneBoost")},La=function(){return char},Da="=",Na={type:"literal",value:"=",description:'"="'},Li="[",Di={type:"literal",value:"[",description:'"["'},Ni="]",ji={type:"literal",value:"]",description:'"]"'},zi="TO",ja={type:"literal",value:"TO",description:'"TO"'},a=0,_=0,lt=[{line:1,column:1,seenCR:!1}],q=0,Zt=[],f=0,ut;if("startRule"in c){if(!(c.startRule in p))throw new Error(`Can't start parsing from rule "`+c.startRule+'".');g=p[c.startRule]}function za(){return i.substring(_,a)}function Ba(){return pt(_,a)}function R(e){throw Ri(e,null,i.substring(_,a),pt(_,a))}function Bi(e){var o=lt[e],l,u;if(o)return o;for(l=e-1;!lt[l];)l--;for(o=lt[l],o={line:o.line,column:o.column,seenCR:o.seenCR};l<e;)u=i.charAt(l),u===`
|
|
701
|
+
`?(o.seenCR||o.line++,o.column=1,o.seenCR=!1):u==="\r"||u==="\u2028"||u==="\u2029"?(o.line++,o.column=1,o.seenCR=!0):(o.column++,o.seenCR=!1),l++;return lt[e]=o,o}function pt(e,o){var l=Bi(e),u=Bi(o);return{start:{offset:e,line:l.line,column:l.column},end:{offset:o,line:u.line,column:u.column}}}function b(e){a<q||(a>q&&(q=a,Zt=[]),Zt.push(e))}function Ri(e,o,l,u){function h(T){var D=1;for(T.sort(function(se,U){return se.description<U.description?-1:se.description>U.description?1:0});D<T.length;)T[D-1]===T[D]?T.splice(D,1):D++}function $(T,D){function se(pc){function mt(K){return K.charCodeAt(0).toString(16).toUpperCase()}return pc.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(K){return"\\x0"+mt(K)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(K){return"\\x"+mt(K)}).replace(/[\u0100-\u0FFF]/g,function(K){return"\\u0"+mt(K)}).replace(/[\u1000-\uFFFF]/g,function(K){return"\\u"+mt(K)})}var U=new Array(T.length),rs,is,Me;for(Me=0;Me<T.length;Me++)U[Me]=T[Me].description;return rs=T.length>1?U.slice(0,-1).join(", ")+" or "+U[T.length-1]:U[0],is=D?'"'+se(D)+'"':"end of input","Expected "+rs+" but "+is+" found."}return o!==null&&h(o),new r(e!==null?e:$(o,l),o,l,u)}function Ui(){var e,o,l,u;for(e=a,o=[],l=y();l!==t;)o.push(l),l=y();return o!==t?(l=dt(),l===t&&(l=null),l!==t?(u=bt(),u!==t?(_=e,o=v(l,u),e=o):(a=e,e=t)):(a=e,e=t)):(a=e,e=t),e}function dt(){var e,o,l,u;return e=a,_=a,o=w(),o?o=void 0:o=t,o!==t?(l=Ya(),l!==t?(o=[o,l],e=o):(a=e,e=t)):(a=e,e=t),e===t&&(e=a,o=Xt(),o!==t?(l=ft(),l!==t?(u=dt(),u!==t?(_=e,o=x(o,u),e=o):(a=e,e=t)):(a=e,e=t)):(a=e,e=t),e===t&&(e=Xt())),e}function Xt(){var e,o,l,u;return e=a,o=Mi(),o!==t?(l=ht(),l!==t?(u=Xt(),u!==t?(_=e,o=S(o,u),e=o):(a=e,e=t)):(a=e,e=t)):(a=e,e=t),e===t&&(e=Mi()),e}function Mi(){var e,o,l;return e=a,o=tr(),o!==t?(l=Ii(),l!==t?(_=e,o=E(l),e=o):(a=e,e=t)):(a=e,e=t),e===t&&(e=Ii()),e}function Ii(){var e,o,l,u,h,$;if(e=a,i.charCodeAt(a)===40?(o=k,a++):(o=t,f===0&&b(N)),o!==t){for(l=[],u=y();u!==t;)l.push(u),u=y();l!==t?(u=dt(),u!==t?(h=bt(),h!==t?(i.charCodeAt(a)===41?($=nt,a++):($=t,f===0&&b(re)),$!==t?(_=e,o=Q(u,h),e=o):(a=e,e=t)):(a=e,e=t)):(a=e,e=t)):(a=e,e=t)}else a=e,e=t;return e===t&&(e=Ra()),e}function Ra(){var e,o,l,u,h,$,T,D,se,U;if(e=a,o=Gt(),o!==t){for(l=[],u=y();u!==t;)l.push(u),u=y();if(l!==t)if(i.charCodeAt(a)===58?(u=H,a++):(u=t,f===0&&b(B)),u!==t){for(h=[],$=y();$!==t;)h.push($),$=y();if(h!==t)if(i.charCodeAt(a)===123?($=$e,a++):($=t,f===0&&b(Ft)),$!==t){for(T=[],D=y();D!==t;)T.push(D),D=y();T!==t?(D=dt(),D!==t?(se=bt(),se!==t?(i.charCodeAt(a)===125?(U=Qt,a++):(U=t,f===0&&b(Ht)),U!==t?(_=e,o=Lo(o,D,se),e=o):(a=e,e=t)):(a=e,e=t)):(a=e,e=t)):(a=e,e=t)}else a=e,e=t;else a=e,e=t}else a=e,e=t;else a=e,e=t}else a=e,e=t;return e===t&&(e=Ua()),e}function Ua(){var e;return e=Ma(),e===t&&(e=Ia(),e===t&&(e=Fa())),e}function Gt(){var e;return f++,e=rr(),f--,e===t&&f===0&&b(Do),e}function Ma(){var e,o,l,u,h,$;if(e=a,o=Gt(),o!==t){for(l=[],u=y();u!==t;)l.push(u),u=y();if(l!==t)if(u=Yi(),u!==t){for(h=[],$=y();$!==t;)h.push($),$=y();h!==t?($=rr(),$!==t?(_=e,o=No(o,u,$),e=o):(a=e,e=t)):(a=e,e=t)}else a=e,e=t;else a=e,e=t}else a=e,e=t;return e}function Ia(){var e,o,l,u,h,$;if(e=a,o=Gt(),o!==t){for(l=[],u=y();u!==t;)l.push(u),u=y();if(l!==t)if(i.charCodeAt(a)===58?(u=H,a++):(u=t,f===0&&b(B)),u!==t){for(h=[],$=y();$!==t;)h.push($),$=y();h!==t?($=Jt(),$!==t?(_=e,o=jo(o,$),e=o):(a=e,e=t)):(a=e,e=t)}else a=e,e=t;else a=e,e=t}else a=e,e=t;return e}function Fa(){var e,o;return e=a,o=Hi(),o!==t&&(_=e,o=zo(o)),e=o,e}function Jt(){var e,o,l,u,h,$;if(e=a,i.charCodeAt(a)===40?(o=k,a++):(o=t,f===0&&b(N)),o!==t){for(l=[],u=y();u!==t;)l.push(u),u=y();l!==t?(u=Fi(),u!==t?(h=bt(),h!==t?(i.charCodeAt(a)===41?($=nt,a++):($=t,f===0&&b(re)),$!==t?(_=e,o=Bo(u,h),e=o):(a=e,e=t)):(a=e,e=t)):(a=e,e=t)):(a=e,e=t)}else a=e,e=t;return e===t&&(e=Hi()),e}function Fi(){var e,o,l,u;return e=a,o=er(),o!==t?(l=ft(),l!==t?(u=Fi(),u!==t?(_=e,o=Ro(o,u),e=o):(a=e,e=t)):(a=e,e=t)):(a=e,e=t),e===t&&(e=er()),e}function er(){var e,o,l,u;return e=a,o=Qi(),o!==t?(l=ht(),l!==t?(u=er(),u!==t?(_=e,o=Uo(o,u),e=o):(a=e,e=t)):(a=e,e=t)):(a=e,e=t),e===t&&(e=Qi()),e}function Qi(){var e,o,l;return e=a,o=tr(),o!==t?(l=Jt(),l!==t?(_=e,o=Mo(l),e=o):(a=e,e=t)):(a=e,e=t),e===t&&(e=Jt()),e}function Hi(){var e,o;return f++,e=a,o=gt(),o!==t&&(_=e,o=Fo(o)),e=o,e===t&&(e=a,o=qi(),o!==t&&(_=e,o=Qo(o)),e=o),f--,e===t&&(o=t,f===0&&b(Io)),e}function ft(){var e,o,l,u,h;if(f++,e=a,o=[],l=y(),l!==t)for(;l!==t;)o.push(l),l=y();else o=t;if(o!==t)if(i.substr(a,2).toLowerCase()===Xr?(l=i.substr(a,2),a+=2):(l=t,f===0&&b(Gr)),l!==t){if(u=[],h=y(),h!==t)for(;h!==t;)u.push(h),h=y();else u=t;u!==t?(o=[o,l,u],e=o):(a=e,e=t)}else a=e,e=t;else a=e,e=t;return e===t&&(e=a,_=a,o=w(),o?o=void 0:o=t,o!==t?(l=Vi(),l!==t?(o=[o,l],e=o):(a=e,e=t)):(a=e,e=t)),f--,e===t&&(o=t,f===0&&b(Ho)),e}function ht(){var e,o,l,u,h;if(f++,e=a,o=[],l=y(),l!==t)for(;l!==t;)o.push(l),l=y();else o=t;if(o!==t)if(i.substr(a,3).toLowerCase()===Jr?(l=i.substr(a,3),a+=3):(l=t,f===0&&b(ei)),l!==t){if(u=[],h=y(),h!==t)for(;h!==t;)u.push(h),h=y();else u=t;u!==t?(o=[o,l,u],e=o):(a=e,e=t)}else a=e,e=t;else a=e,e=t;return e===t&&(e=a,_=a,o=w(),o?o=void 0:o=t,o!==t?(l=Ki(),l!==t?(o=[o,l],e=o):(a=e,e=t)):(a=e,e=t)),f--,e===t&&(o=t,f===0&&b(qo)),e}function tr(){var e,o,l,u;if(f++,e=a,i.substr(a,3).toLowerCase()===ti?(o=i.substr(a,3),a+=3):(o=t,f===0&&b(ri)),o!==t){if(l=[],u=y(),u!==t)for(;u!==t;)l.push(u),u=y();else l=t;l!==t?(o=[o,l],e=o):(a=e,e=t)}else a=e,e=t;return e===t&&(e=a,_=a,o=w(),o?o=void 0:o=t,o!==t?(l=Zi(),l!==t?(o=[o,l],e=o):(a=e,e=t)):(a=e,e=t)),f--,e===t&&(o=t,f===0&&b(Wo)),e}function rr(){var e;return f++,e=gt(),e===t&&(e=qi()),f--,e===t&&f===0&&b(Yo),e}function gt(){var e,o,l,u,h,$;if(e=a,i.charCodeAt(a)===34?(o=je,a++):(o=t,f===0&&b(ze)),o!==t){for(l=[],u=Se();u!==t;)l.push(u),u=Se();if(l!==t)if(u=Ue(),u!==t){for(h=[],$=Se();$!==t;)h.push($),$=Se();h!==t?(i.charCodeAt(a)===34?($=je,a++):($=t,f===0&&b(ze)),$!==t?(_=e,o=qt(l,u,h),e=o):(a=e,e=t)):(a=e,e=t)}else a=e,e=t;else a=e,e=t}else a=e,e=t;if(e===t)if(e=a,i.charCodeAt(a)===34?(o=je,a++):(o=t,f===0&&b(ze)),o!==t){for(l=[],u=Se();u!==t;)l.push(u),u=Se();l!==t?(i.charCodeAt(a)===34?(u=je,a++):(u=t,f===0&&b(ze)),u!==t?(_=e,o=Vo(l),e=o):(a=e,e=t)):(a=e,e=t)}else a=e,e=t;return e}function Se(){var e,o,l;return e=ir(),e===t&&(e=a,i.charCodeAt(a)===92?(o=Be,a++):(o=t,f===0&&b(Re)),o!==t?(Ko.test(i.charAt(a))?(l=i.charAt(a),a++):(l=t,f===0&&b(Zo)),l!==t?(_=e,o=ot(l),e=o):(a=e,e=t)):(a=e,e=t),e===t&&(e=a,o=a,f++,l=Ue(),f--,l===t?o=void 0:(a=o,o=t),o!==t?(Xo.test(i.charAt(a))?(l=i.charAt(a),a++):(l=t,f===0&&b(Go)),l!==t?(_=e,o=ot(l),e=o):(a=e,e=t)):(a=e,e=t))),e}function qi(){var e,o,l,u,h;for(e=a,o=[],l=Ae();l!==t;)o.push(l),l=Ae();if(o!==t)if(l=Ue(),l!==t){for(u=[],h=Ae();h!==t;)u.push(h),h=Ae();u!==t?(_=e,o=qt(o,l,u),e=o):(a=e,e=t)}else a=e,e=t;else a=e,e=t;if(e===t){if(e=a,o=[],l=Ae(),l!==t)for(;l!==t;)o.push(l),l=Ae();else o=t;o!==t&&(_=e,o=Jo(o)),e=o}return e}function Ae(){var e,o,l,u,h;return e=ir(),e===t&&(e=Ha(),e===t&&(e=qa(),e===t&&(e=Qa(),e===t&&(e=a,o=a,f++,l=Wi(),f--,l===t?o=void 0:(a=o,o=t),o!==t?(l=a,f++,u=Wa(),f--,u===t?l=void 0:(a=l,l=t),l!==t?(u=a,f++,h=Ue(),f--,h===t?u=void 0:(a=u,u=t),u!==t?(i.length>a?(h=i.charAt(a),a++):(h=t,f===0&&b(ii)),h!==t?(_=e,o=ot(h),e=o):(a=e,e=t)):(a=e,e=t)):(a=e,e=t)):(a=e,e=t))))),e}function Qa(){var e,o;return e=a,i.charCodeAt(a)===42?(o=at,a++):(o=t,f===0&&b(ct)),o!==t&&(_=e,o=ea()),e=o,e}function bt(){var e,o,l,u,h;for(e=a,o=[],l=y();l!==t;)o.push(l),l=y();if(o!==t)if(l=Ue(),l!==t){for(u=[],h=y();h!==t;)u.push(h),h=y();u!==t?(_=e,o=qt(o,l,u),e=o):(a=e,e=t)}else a=e,e=t;else a=e,e=t;if(e===t)for(e=[],o=y();o!==t;)e.push(o),o=y();return e}function ir(){var e,o;return e=a,i.substr(a,2)===si?(o=si,a+=2):(o=t,f===0&&b(ta)),o!==t&&(_=e,o=ra()),e=o,e===t&&(e=a,i.substr(a,2)===ni?(o=ni,a+=2):(o=t,f===0&&b(ia)),o!==t&&(_=e,o=sa()),e=o,e===t&&(e=a,i.substr(a,2)===oi?(o=oi,a+=2):(o=t,f===0&&b(na)),o!==t&&(_=e,o=oa()),e=o)),e}function Ha(){var e,o,l;return e=a,i.charCodeAt(a)===92?(o=Be,a++):(o=t,f===0&&b(Re)),o!==t?(l=Wi(),l!==t?(_=e,o=ot(l),e=o):(a=e,e=t)):(a=e,e=t),e}function qa(){var e,o,l;return e=a,i.charCodeAt(a)===92?(o=Be,a++):(o=t,f===0&&b(Re)),o!==t?(i.substr(a,2).toLowerCase()===Xr?(l=i.substr(a,2),a+=2):(l=t,f===0&&b(Gr)),l===t&&(i.substr(a,3).toLowerCase()===Jr?(l=i.substr(a,3),a+=3):(l=t,f===0&&b(ei)),l===t&&(i.substr(a,3).toLowerCase()===ti?(l=i.substr(a,3),a+=3):(l=t,f===0&&b(ri)))),l!==t?(_=e,o=aa(l),e=o):(a=e,e=t)):(a=e,e=t),e}function Wa(){var e;return e=ft(),e===t&&(e=ht(),e===t&&(e=tr())),e}function Wi(){var e;return ca.test(i.charAt(a))?(e=i.charAt(a),a++):(e=t,f===0&&b(la)),e}function Yi(){var e,o;return e=a,i.substr(a,2)===ai?(o=ai,a+=2):(o=t,f===0&&b(ua)),o!==t&&(_=e,o=pa()),e=o,e===t&&(e=a,i.substr(a,2)===ci?(o=ci,a+=2):(o=t,f===0&&b(da)),o!==t&&(_=e,o=fa()),e=o,e===t&&(e=a,i.charCodeAt(a)===60?(o=li,a++):(o=t,f===0&&b(ui)),o!==t&&(_=e,o=ha()),e=o,e===t&&(e=a,i.charCodeAt(a)===62?(o=pi,a++):(o=t,f===0&&b(di)),o!==t&&(_=e,o=ga()),e=o))),e}function y(){var e;return f++,va.test(i.charAt(a))?(e=i.charAt(a),a++):(e=t,f===0&&b(ma)),f--,e===t&&f===0&&b(ba),e}function Ue(){var e,o,l;return e=a,_=a,o=ya(),o?o=void 0:o=t,o!==t?(i.substr(a,14)===fi?(l=fi,a+=14):(l=t,f===0&&b($a)),l!==t?(_=e,o=_a(),e=o):(a=e,e=t)):(a=e,e=t),e}function Vi(){var e,o,l,u,h;for(e=a,o=[],l=y();l!==t;)o.push(l),l=y();if(o!==t)if(i.substr(a,2)===hi?(l=hi,a+=2):(l=t,f===0&&b(wa)),l!==t){for(u=[],h=y();h!==t;)u.push(h),h=y();u!==t?(_=e,o=Sa(),e=o):(a=e,e=t)}else a=e,e=t;else a=e,e=t;return e}function Ki(){var e,o,l,u,h;for(e=a,o=[],l=y();l!==t;)o.push(l),l=y();if(o!==t)if(i.substr(a,2)===gi?(l=gi,a+=2):(l=t,f===0&&b(Aa)),l!==t){for(u=[],h=y();h!==t;)u.push(h),h=y();u!==t?(_=e,o=bi(),e=o):(a=e,e=t)}else a=e,e=t;else a=e,e=t;return e===t&&(e=a,i.charCodeAt(a)===43?(o=vi,a++):(o=t,f===0&&b(mi)),o!==t&&(_=e,o=bi()),e=o),e}function Zi(){var e,o;return e=a,i.charCodeAt(a)===45?(o=yi,a++):(o=t,f===0&&b($i)),o!==t&&(_=e,o=_i()),e=o,e===t&&(e=a,i.charCodeAt(a)===33?(o=wi,a++):(o=t,f===0&&b(Si)),o!==t&&(_=e,o=_i()),e=o),e}function Ya(){var e;return e=Va(),e===t&&(e=Xi(),e===t&&(e=Ka())),e}function Va(){var e,o,l,u,h,$;if(e=a,o=xe(),o!==t){for(l=[],u=y();u!==t;)l.push(u),u=y();if(l!==t)if(i.charCodeAt(a)===58?(u=H,a++):(u=t,f===0&&b(B)),u!==t){for(h=[],$=y();$!==t;)h.push($),$=y();h!==t?($=Xi(),$!==t?(o=[o,l,u,h,$],e=o):(a=e,e=t)):(a=e,e=t)}else a=e,e=t;else a=e,e=t}else a=e,e=t;return e}function Xi(){var e;return e=Za(),e===t&&(e=sr(),e===t&&(e=Xa(),e===t&&(e=Ga(),e===t&&(e=Ja(),e===t&&(e=ec()))))),e}function Ka(){var e,o,l,u,h,$;if(e=a,i.substr(a,8)===Ai?(o=Ai,a+=8):(o=t,f===0&&b(xa)),o!==t){for(l=[],u=y();u!==t;)l.push(u),u=y();if(l!==t)if(i.charCodeAt(a)===58?(u=H,a++):(u=t,f===0&&b(B)),u!==t){for(h=[],$=y();$!==t;)h.push($),$=y();h!==t?($=xe(),$!==t?(_=e,o=ka(),e=o):(a=e,e=t)):(a=e,e=t)}else a=e,e=t;else a=e,e=t}else a=e,e=t;return e}function Za(){var e,o,l,u,h,$,T;if(e=a,o=Yi(),o!==t){for(l=[],u=y();u!==t;)l.push(u),u=y();l!==t?(u=xe(),u!==t?(_=e,o=xi(),e=o):(a=e,e=t)):(a=e,e=t)}else a=e,e=t;if(e===t)if(e=a,o=ic(),o!==t){for(l=[],u=y();u!==t;)l.push(u),u=y();l!==t?(u=xe(),u!==t?(h=es(),h!==t?($=xe(),$!==t?(T=sc(),T!==t?(_=e,o=xi(),e=o):(a=e,e=t)):(a=e,e=t)):(a=e,e=t)):(a=e,e=t)):(a=e,e=t)}else a=e,e=t;return e}function sr(){var e,o,l,u,h;for(e=a,o=[],l=vt(),l===t&&(i.charCodeAt(a)===42?(l=at,a++):(l=t,f===0&&b(ct)));l!==t;)o.push(l),l=vt(),l===t&&(i.charCodeAt(a)===42?(l=at,a++):(l=t,f===0&&b(ct)));if(o!==t)if(i.charCodeAt(a)===63?(l=ki,a++):(l=t,f===0&&b(Ci)),l!==t){for(u=[],h=sr();h!==t;)u.push(h),h=sr();u!==t?(_=e,o=Ca(),e=o):(a=e,e=t)}else a=e,e=t;else a=e,e=t;return e}function Xa(){var e,o,l,u;if(e=a,i.charCodeAt(a)===47?(o=Wt,a++):(o=t,f===0&&b(Yt)),o!==t){for(l=[],Ei.test(i.charAt(a))?(u=i.charAt(a),a++):(u=t,f===0&&b(Oi));u!==t;)l.push(u),Ei.test(i.charAt(a))?(u=i.charAt(a),a++):(u=t,f===0&&b(Oi));l!==t?(i.charCodeAt(a)===47?(u=Wt,a++):(u=t,f===0&&b(Yt)),u!==t?(_=e,o=Ea(),e=o):(a=e,e=t)):(a=e,e=t)}else a=e,e=t;return e}function Ga(){var e,o,l,u,h;if(e=a,o=Gi(),o!==t)if(i.charCodeAt(a)===126?(l=Vt,a++):(l=t,f===0&&b(Kt)),l!==t){for(u=[],_e.test(i.charAt(a))?(h=i.charAt(a),a++):(h=t,f===0&&b(we));h!==t;)u.push(h),_e.test(i.charAt(a))?(h=i.charAt(a),a++):(h=t,f===0&&b(we));u!==t?(_=e,o=Oa(),e=o):(a=e,e=t)}else a=e,e=t;else a=e,e=t;return e}function Ja(){var e,o,l,u,h;if(e=a,o=gt(),o!==t)if(i.charCodeAt(a)===126?(l=Vt,a++):(l=t,f===0&&b(Kt)),l!==t){for(u=[],_e.test(i.charAt(a))?(h=i.charAt(a),a++):(h=t,f===0&&b(we));h!==t;)u.push(h),_e.test(i.charAt(a))?(h=i.charAt(a),a++):(h=t,f===0&&b(we));u!==t?(_=e,o=Pa(),e=o):(a=e,e=t)}else a=e,e=t;else a=e,e=t;return e}function ec(){var e,o,l,u,h;if(e=a,o=xe(),o!==t)if(i.charCodeAt(a)===94?(l=Pi,a++):(l=t,f===0&&b(Ti)),l!==t){for(u=[],_e.test(i.charAt(a))?(h=i.charAt(a),a++):(h=t,f===0&&b(we));h!==t;)u.push(h),_e.test(i.charAt(a))?(h=i.charAt(a),a++):(h=t,f===0&&b(we));u!==t?(_=e,o=Ta(),e=o):(a=e,e=t)}else a=e,e=t;else a=e,e=t;return e}function xe(){var e;return e=gt(),e===t&&(e=Gi()),e}function Gi(){var e,o;if(e=[],o=vt(),o!==t)for(;o!==t;)e.push(o),o=vt();else e=t;return e}function vt(){var e,o,l,u;return e=ir(),e===t&&(e=rc(),e===t&&(e=a,o=a,f++,l=Ji(),f--,l===t?o=void 0:(a=o,o=t),o!==t?(l=a,f++,u=tc(),f--,u===t?l=void 0:(a=l,l=t),l!==t?(i.length>a?(u=i.charAt(a),a++):(u=t,f===0&&b(ii)),u!==t?(o=[o,l,u],e=o):(a=e,e=t)):(a=e,e=t)):(a=e,e=t))),e}function tc(){var e;return e=ft(),e===t&&(e=ht(),e===t&&(e=Vi(),e===t&&(e=Ki(),e===t&&(e=Zi(),e===t&&(e=es()))))),e}function rc(){var e,o,l;return e=a,i.charCodeAt(a)===92?(o=Be,a++):(o=t,f===0&&b(Re)),o!==t?(l=Ji(),l!==t?(_=e,o=La(),e=o):(a=e,e=t)):(a=e,e=t),e}function Ji(){var e;return i.charCodeAt(a)===43?(e=vi,a++):(e=t,f===0&&b(mi)),e===t&&(i.charCodeAt(a)===45?(e=yi,a++):(e=t,f===0&&b($i)),e===t&&(i.charCodeAt(a)===61?(e=Da,a++):(e=t,f===0&&b(Na)),e===t&&(i.charCodeAt(a)===62?(e=pi,a++):(e=t,f===0&&b(di)),e===t&&(i.charCodeAt(a)===60?(e=li,a++):(e=t,f===0&&b(ui)),e===t&&(i.charCodeAt(a)===33?(e=wi,a++):(e=t,f===0&&b(Si)),e===t&&(i.charCodeAt(a)===40?(e=k,a++):(e=t,f===0&&b(N)),e===t&&(i.charCodeAt(a)===41?(e=nt,a++):(e=t,f===0&&b(re)),e===t&&(i.charCodeAt(a)===123?(e=$e,a++):(e=t,f===0&&b(Ft)),e===t&&(i.charCodeAt(a)===125?(e=Qt,a++):(e=t,f===0&&b(Ht)),e===t&&(i.charCodeAt(a)===91?(e=Li,a++):(e=t,f===0&&b(Di)),e===t&&(i.charCodeAt(a)===93?(e=Ni,a++):(e=t,f===0&&b(ji)),e===t&&(i.charCodeAt(a)===94?(e=Pi,a++):(e=t,f===0&&b(Ti)),e===t&&(i.charCodeAt(a)===34?(e=je,a++):(e=t,f===0&&b(ze)),e===t&&(i.charCodeAt(a)===126?(e=Vt,a++):(e=t,f===0&&b(Kt)),e===t&&(i.charCodeAt(a)===42?(e=at,a++):(e=t,f===0&&b(ct)),e===t&&(i.charCodeAt(a)===63?(e=ki,a++):(e=t,f===0&&b(Ci)),e===t&&(i.charCodeAt(a)===58?(e=H,a++):(e=t,f===0&&b(B)),e===t&&(i.charCodeAt(a)===92?(e=Be,a++):(e=t,f===0&&b(Re)),e===t&&(i.charCodeAt(a)===47?(e=Wt,a++):(e=t,f===0&&b(Yt))))))))))))))))))))),e}function es(){var e,o,l,u,h;if(e=a,o=[],l=y(),l!==t)for(;l!==t;)o.push(l),l=y();else o=t;if(o!==t)if(i.substr(a,2)===zi?(l=zi,a+=2):(l=t,f===0&&b(ja)),l!==t){if(u=[],h=y(),h!==t)for(;h!==t;)u.push(h),h=y();else u=t;u!==t?(o=[o,l,u],e=o):(a=e,e=t)}else a=e,e=t;else a=e,e=t;return e}function ic(){var e;return i.charCodeAt(a)===91?(e=Li,a++):(e=t,f===0&&b(Di)),e===t&&(i.charCodeAt(a)===123?(e=$e,a++):(e=t,f===0&&b(Ft))),e}function sc(){var e;return i.charCodeAt(a)===93?(e=Ni,a++):(e=t,f===0&&b(ji)),e===t&&(i.charCodeAt(a)===125?(e=Qt,a++):(e=t,f===0&&b(Ht))),e}const{errorOnLuceneSyntax:nc,parseCursor:oc,cursorSymbol:ac,allowLeadingWildcards:cc=!0,helpers:{nodeTypes:de}}=c,W=de.function.buildNodeWithArgumentNodes,ie=de.literal.buildNode,lc=de.wildcard.buildNode,uc=de.namedArg.buildNode,{wildcardSymbol:ts}=de.wildcard;if(ut=g(),ut!==t&&a===i.length)return ut;throw ut!==t&&a<i.length&&b({type:"end",description:"end of input"}),Ri(null,Zt,q<i.length?i.charAt(q):null,q<i.length?pt(q,q+1):pt(q,q))}return{SyntaxError:r,parse:s}}(),Lt=(n,r={},s=et)=>{if(typeof n>"u")throw new Error("expression must be a string, got undefined instead");return s(n,{...r,helpers:{nodeTypes:V}})},me=(n,r={})=>Lt(n,{...r,startRule:"Literal"},et),tt=(n,r={})=>{try{return Lt(n,r,et)}catch(s){throw s.name==="SyntaxError"?new Nr(s,n):s}},Js=n=>{try{return Lt(n,{errorOnLuceneSyntax:!0},et),!1}catch(r){return r.message.startsWith("Lucene")}},j=(n,r,s,i)=>(r=void 0,!n||!n.type||!V[n.type]?j(V.function.buildNode("and",[]),r):V[n.type].toOpenSearchQuery(n,r,s,i)),Y="@kuery-wildcard@";function en(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function tn(n){return n.replace(/[+-=&|><!(){}[\]^"~*?:\\/]/g,"\\$&")}function rn(n){return n.includes(Y)?{type:"wildcard",value:n}:me(n)}function jr(n,r){const{value:s}=n,i=s.split(Y).map(en).join("[\\s\\S]*");return new RegExp(`^${i}$`).test(r)}function sn(n){const{value:r}=n;return r.split(Y).join("*")}function Dt(n){const{value:r}=n;return r.split(Y).map(tn).join("*")}function nn(n){const{value:r}=n;return r.startsWith(Y)&&r.replace(Y,"").length>0}const on=Object.freeze(Object.defineProperty({__proto__:null,buildNode:rn,hasLeadingWildcard:nn,test:jr,toOpenSearchQuery:sn,toQueryStringQuery:Dt,wildcardSymbol:Y},Symbol.toStringTag,{value:"Module"}));function Nt(n,r){if(!r)return[];if(n.type==="literal"){const s=Tt(n),i=r.fields.find(c=>c.name===s);return i?[i]:[]}else if(n.type==="wildcard")return r.fields.filter(i=>jr(n,i.name))}function fc(n){return n}function zr(n,r,s){const i={...n,value:s?`${s}.${n.value}`:n.value};if(!r||i.type==="wildcard"&&!s)return i;const t=Nt(i,r).reduce((p,g)=>{const v=g.subType&&g.subType.nested?g.subType.nested.path:void 0;return s&&!v?[...p,`${g.name} is not a nested field but is in nested group "${s}" in the DQL expression.`]:v&&!s?[...p,`${g.name} is a nested field, but is not in a nested group in the DQL expression.`]:v!==s?[...p,`Nested field ${g.name} is being queried with the incorrect nested path. The correct path is ${g.subType.nested.path}.`]:p},[]);if(t.length>0)throw new Error(t.join(`
|
|
702
|
+
`));return i}function an(n,r,s=!1){if(n===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 n=="string"?me(n):ve(n),c=typeof r=="string"?me(r):ve(r),t=ve(s);return{arguments:[i,c,t]}}function cn(n,r,s={},i={}){const{arguments:[c,t,p]}=n,g=zr(c,r,i!=null&&i.nested?i.nested.path:void 0),v=j(g),w=t!==void 0?j(t):t,x=p.value?"phrase":"best_fields";if(g.value===null)return t.type==="wildcard"?{query_string:{query:Dt(t)}}:{multi_match:{type:x,query:w,lenient:!0}};const S=r?Nt(g,r):[];S&&S.length===0&&S.push({name:j(g),scripted:!1,type:""});const E=t.type==="wildcard"&&w==="*",k=g.type==="wildcard"&&v==="*"||S&&r&&S.length===r.fields.length;return E&&k?{match_all:{}}:{bool:{should:S.reduce((re,Q)=>{const H=B=>{var $e;return g.type!=="wildcard"||!(($e=Q.subType)!=null&&$e.nested)||i!=null&&i.nested?B:{nested:{path:Q.subType.nested.path,query:B,score_mode:"none"}}};if(Q.scripted)return[];if(E)return[...re,H({exists:{field:Q.name}})];if(t.type==="wildcard")return[...re,H({query_string:{fields:[Q.name],query:Dt(t)}})];if(Q.type==="date"){const B=s.dateFormatTZ?{time_zone:s.dateFormatTZ}:{};return[...re,H({range:{[Q.name]:{gte:w,lte:w,...B}}})]}else{const B=x==="phrase"?"match_phrase":"match";return[...re,H({[B]:{[Q.name]:w}})]}},[])||[],minimum_should_match:1}}}const ln=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:an,toOpenSearchQuery:cn},Symbol.toStringTag,{value:"Module"}));function un(n){return{arguments:n}}function pn(n,r,s={},i={}){return{bool:{filter:(n.arguments||[]).map(t=>j(t,r,s,i))}}}const dn=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:un,toOpenSearchQuery:pn},Symbol.toStringTag,{value:"Module"}));function fn(n){return{arguments:n}}function hn(n,r,s={},i={}){return{bool:{should:(n.arguments||[]).map(t=>j(t,r,s,i)),minimum_should_match:1}}}const gn=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:fn,toOpenSearchQuery:hn},Symbol.toStringTag,{value:"Module"}));function bn(n){return{arguments:[n]}}function vn(n,r,s={},i={}){const[c]=n.arguments;return{bool:{must_not:j(c,r,s,i)}}}const mn=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:bn,toOpenSearchQuery:vn},Symbol.toStringTag,{value:"Module"}));function yn(n,...r){let s={};for(let i of r)s[i]=n[i];return s}function $n(n,r){const s=yn(r,"gt","lt","gte","lte","format"),i=typeof n=="string"?me(n):V.literal.buildNode(n),c=Object.entries(s).map(t=>{let[p,g]=t;return V.namedArg.buildNode(p,g)});return{arguments:[i,...c]}}function _n(n,r,s={},i={}){const[c,...t]=n.arguments,p=zr(c,r,i!=null&&i.nested?i.nested.path:void 0),g=r?Nt(p,r):[],v=wn(t),w=Object.fromEntries(Object.entries(v).map(([S,E])=>[S,j(E)]));return g&&g.length===0&&g.push({name:j(p),scripted:!1,type:""}),{bool:{should:g.map(S=>{const E=k=>{var N;return p.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 E({range:{[S.name]:{...w,...k}}})}return E({range:{[S.name]:w}})}),minimum_should_match:1}}}function wn(n){if(n.gt&&n.gte||n.lt&&n.lte)throw new Error("range ends cannot be both inclusive and exclusive");const r=["gte","lte","format"];return n.reduce((s,i,c)=>(i.type==="namedArg"?s[i.name]=i.value:s[r[c]]=i,s),{})}const Sn=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:$n,toOpenSearchQuery:_n},Symbol.toStringTag,{value:"Module"}));function An(n){return{arguments:[ve(n)]}}function xn(n,r,s={},i={}){const{arguments:[c]}=n,t={...c,value:i!=null&&i.nested?`${i.nested.path}.${c.value}`:c.value},p=Tt(t),g=((r==null?void 0:r.fields)||[]).find(v=>v.name===p);if(g&&g.scripted)throw new Error("Exists query does not support scripted fields");return{exists:{field:p}}}const kn=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:An,toOpenSearchQuery:xn},Symbol.toStringTag,{value:"Module"}));function Cn(n,r){return{arguments:[typeof n=="string"?me(n):ve(n),r]}}function En(n,r,s={},i={}){var v;const[c,t]=n.arguments,p=j(c),g=(v=i==null?void 0:i.nested)!=null&&v.path?`${i.nested.path}.${p}`:p;return{nested:{path:g,query:j(t,r,s,{...i,nested:{path:g}}),score_mode:"none"}}}const jt={is:ln,and:dn,or:gn,not:mn,range:Sn,exists:kn,nested:Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:Cn,toOpenSearchQuery:En},Symbol.toStringTag,{value:"Module"}))};function On(n,...r){const s=jt[n];if(s===void 0)throw new Error(`Unknown function "${n}"`);return{type:"function",function:n,...s.buildNodeParams(...r)}}function Pn(n,r){if(jt[n]===void 0)throw new Error(`Unknown function "${n}"`);return{type:"function",function:n,arguments:r}}function Tn(n,r,s,i){return jt[n.function].toOpenSearchQuery(n,r,s,i)}const Ln=Object.freeze(Object.defineProperty({__proto__:null,buildNode:On,buildNodeWithArgumentNodes:Pn,toOpenSearchQuery:Tn},Symbol.toStringTag,{value:"Module"}));function Dn(n,r){const s=r.type==="literal"?r:V.literal.buildNode(r);return{type:"namedArg",name:n,value:s}}function Nn(n){return j(n.value)}const V={function:Ln,literal:Gs,namedArg:Object.freeze(Object.defineProperty({__proto__:null,buildNode:Dn,toOpenSearchQuery:Nn},Symbol.toStringTag,{value:"Module"})),wildcard:on},jn=Y,zn=(n,r)=>"("+(n.arguments||[]).map(i=>pe(i,r)).join(" AND ")+")",Bn=(n,r)=>{var{arguments:[s,i,c]}=n;let t="=";i.type==="wildcard"&&(t="");let p=pe(i);c=c.value||typeof p=="string",i.type==="literal"&&c&&(p=`'${p}'`),i.type==="literal"&&!c&&(p=`${p}`);let g=pe(s);return g==null?r&&c?`(${r.filter(v=>v.type==="string").map(v=>`${v.name} ILIKE '%${i.value}%'`).join(" OR ")})`:r&&!c&&(i.value===!0||i.value===!1)?`(${r.filter(v=>v.type==="boolean").map(v=>`${v.name}=${i.value}`).join(" OR ")})`:"":g+t+p},Rn=(n,r)=>"("+(n.arguments||[]).map(i=>pe(i,r)).join(" OR ")+")",Un=(n,r)=>{const[s]=n.arguments;return"NOT ("+pe(s,r)+")"},Mn={gt:">",lt:"<",gte:">=",lte:"<="},In={is:Bn,and:zn,or:Rn,not:Un,range:n=>{const[r,s]=n.arguments;let i=s.value;const c=Mn[s.name];let t=pe(i);return i.type==="literal"&&(t=`${t}`),`${r.value} ${c} ${t}`},exists:n=>{const[r]=n.arguments;return`${r.value} IS NOT NULL`},nested:n=>(console.warn("Nested types dont exist in CQL",n),"")},Fn={function:(n,r)=>In[n.function](n,r),literal:n=>n.value,wildcard:n=>{const{value:r}=n;return` LIKE '${r.split(jn).join("%")}'`}},pe=(n,r)=>{const s=Fn[n.type];return s(n,r)},Qn=Y,Hn=n=>({$and:(n.arguments||[]).map(i=>ee(i))}),qn=n=>{const{arguments:[r,s]}=n;let i=ee(s);if(s.type==="wildcard"&&s.value==="@kuery-wildcard@")return Br(n);let t={};return t[ee(r)]={$eq:i},t},Wn=n=>({$or:(n.arguments||[]).map(s=>ee(s))}),Yn=n=>{const[r]=n.arguments;let s={};return s={$ne:ee(r)},s},Vn={gt:"$gt",lt:"$lt",gte:"$gte",lte:"$lte"},Kn=n=>{const[r,s]=n.arguments;let i=s.value;const c=Vn[s.name];let t=ee(i),p={};return p[r.value]={},p[r.value][c]=t,p},Br=n=>{const[r]=n.arguments;return{[ee(r)]:{$ne:null}}},Zn={is:qn,and:Hn,or:Wn,not:Yn,range:Kn,exists:Br,nested:n=>(console.warn("TODO Implement nested search",n),"")},Xn={function:n=>Zn[n.function](n),literal:n=>n.value,wildcard:n=>{const{value:r}=n;return`/${r.split(Qn).join(".*")}/`}},ee=(n,r)=>{const s=Xn[n.type];return s(n,r)},Gn=Object.freeze(Object.defineProperty({__proto__:null,DQLSyntaxError:Nr,doesKueryExpressionHaveLuceneSyntaxError:Js,fromKueryExpression:tt,fromLiteralExpression:me,nodeTypes:V,parse:tt,toCql:pe,toDSL:j,toMongo:ee,toOpenSearchQuery:j},Symbol.toStringTag,{value:"Module"})),Jn=M`
|
|
637
703
|
:host {
|
|
638
704
|
--dialog-padding: var(--spectric-dialog-padding, 5px);
|
|
639
705
|
--dialog-background:var(--spectric-background,rgb(246, 249, 252));
|
|
@@ -680,11 +746,11 @@ spectric-button{
|
|
|
680
746
|
right: 0;
|
|
681
747
|
top: 0;
|
|
682
748
|
}
|
|
683
|
-
`;var
|
|
749
|
+
`;var eo=Object.defineProperty,to=Object.getOwnPropertyDescriptor,te=(n,r,s,i)=>{for(var c=i>1?void 0:i?to(r,s):r,t=n.length-1,p;t>=0;t--)(p=n[t])&&(c=(i?p(r,s,c):p(c))||c);return i&&c&&eo(r,s,c),c};const zt="spectric-dialog";d.DialogElement=class extends O{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(zt);i.addEventListener("close",()=>{i.remove()});for(let t in r)i[t]=r[t];let c=document.createDocumentFragment();return $r(s,c),i.appendChild(c),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`
|
|
684
750
|
<dialog class=${this.hideBackdrop?"":"backdrop"} @close=${this._onClose} @click=${this.clickHandler}>
|
|
685
751
|
<spectric-panel>
|
|
686
752
|
<div class="modal">
|
|
687
|
-
${this.dismissable?
|
|
753
|
+
${this.dismissable?A`<spectric-button variant="text" size="small" @click=${()=>{this.open=!1}}>X</spectric-button>`:null}
|
|
688
754
|
<h3 >
|
|
689
755
|
<slot name="title">
|
|
690
756
|
${this.title.length?this.title:null}
|
|
@@ -696,17 +762,17 @@ spectric-button{
|
|
|
696
762
|
</div>
|
|
697
763
|
</spectric-panel>
|
|
698
764
|
</dialog>
|
|
699
|
-
`}},d.DialogElement.styles=
|
|
765
|
+
`}},d.DialogElement.styles=Jn,te([m({type:Boolean,reflect:!0})],d.DialogElement.prototype,"open",2),te([m({type:Boolean,reflect:!0})],d.DialogElement.prototype,"dismissable",2),te([m({type:Boolean,reflect:!0})],d.DialogElement.prototype,"hideBackdrop",2),te([m({type:String,reflect:!0})],d.DialogElement.prototype,"title",2),te([m({type:Boolean,reflect:!0})],d.DialogElement.prototype,"closeOnEscape",2),te([m({type:Boolean,reflect:!0})],d.DialogElement.prototype,"closeOnOutsideClick",2),te([qe("dialog")],d.DialogElement.prototype,"dialogElement",2),d.DialogElement=te([L(zt)],d.DialogElement);var ro=Object.defineProperty,io=Object.getOwnPropertyDescriptor,F=(n,r,s,i)=>{for(var c=i>1?void 0:i?io(r,s):r,t=n.length-1,p;t>=0;t--)(p=n[t])&&(c=(i?p(r,s,c):p(c))||c);return i&&c&&ro(r,s,c),c},Rr=(n=>(n.MONGO="toMongo",n.CQL="toCql",n.DSL="toDSL",n.AST="AST",n))(Rr||{});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"}},so={eq:{value:": ",label:" equals some value"},exists:{value:": *",label:" exists in any form"}},no=[{value:": true",label:" value is true"},{value:": false",label:"value is false"}],oo=Object.fromEntries(Object.entries(Ur).map(([n,r])=>[n,{value:r.value,label:(r.label||"").replace("value","date-time")}]));d.SpectricQuery=class extends O{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 t=this.value;this._input.selectionStart!==null&&(t=t.substring(0,this._input.selectionStart)+"@kuery-cursor@"+t.substring(this._input.selectionStart));let p=tt(t,{parseCursor:!0,cursorSymbol:"@kuery-cursor@",allowLeadingWildcards:!1});this.autoComplete(p),s=tt(this.value,{allowLeadingWildcards:!1})}catch{return}let i;this.outputLanguage=="AST"?i=s:i=Gn[this.outputLanguage](s,this.fields);let c=new CustomEvent("change",{detail:i});this.dispatchEvent(c)},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,c=this.value.substring(r.end);if(r.value.includes(c)?this.value=s:this.value=s+this.value.substring(r.end),this._input.setSelectionRange(i,i),r.onSelect){let t=await r.onSelect();t!==void 0&&(this.value+=t,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 c=i.querySelector(".option.active");c&&c.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:c}=r;for(let t of r.suggestionTypes){if(t=="conjunction"&&r.text.endsWith(" ")&&s.push(...["and ","or "].map(p=>({type:t,value:p,start:c,end:c}))),t==="field"){let p=this.fields.filter(g=>g.name.includes(r.fieldName)||g.name.includes(r.prefix)).map(g=>[{type:t,value:g.name,start:i,end:c}]).flat();s.push(...p)}if(t==="operator"){let p=this.fields.find(g=>g.name===r.fieldName);p&&(p.type==="number"?s.push(...Object.values(Ur).map(g=>({type:t,...g,start:c,end:c}))):p.type==="string"?p.format==="date-time"?s.push(...Object.values(oo).map(g=>({type:t,...g,start:c,end:c,onSelect:async()=>{let v=await this.getValuesForField(r.fieldName,r.prefix);v.length===0&&(v=["now-1m","now-1d","now-1M"]);let w,x=Ye();return await new Promise(S=>{let E=d.DialogElement.display({},A`
|
|
700
766
|
<div class="query-bar-date-quick-select">
|
|
701
|
-
${v.map(
|
|
767
|
+
${v.map(k=>A`<a href="#" @click=${N=>{N.preventDefault(),w=`"${k}"`,S(w),E.open=!1}}>${k}</a>`)}
|
|
702
768
|
</div>
|
|
703
|
-
<spectric-input variant="datetime-local" @change=${
|
|
704
|
-
<spectric-button ${Ve(
|
|
705
|
-
`)}),
|
|
706
|
-
<spectric-input .placeholder=${this.placeholder} style=${`anchor-name:--${this.uuid};`} autocomplete="off" @input=${this._parseQuery} @keydown=${this._handleArrows} @change=${r=>r.stopPropagation()}></spectric-input>
|
|
769
|
+
<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>
|
|
770
|
+
<spectric-button ${Ve(x)} .disabled=${!0} @click=${()=>{S(w),E.open=!1}}>Submit</spectric-button>
|
|
771
|
+
`)}),w}}))):s.push(...Object.values(so).map(g=>({type:t,...g,start:c,end:c}))):p.type==="boolean"&&s.push(...no.map(g=>({type:t,...g,start:c,end:c}))))}if(t==="value"){let p=this.fields.find(g=>g.name===r.fieldName);if(p&&p.type=="boolean")s.push({type:t,value:"true",start:i,end:c},{type:t,value:"false",start:i,end:c});else{console.log(`invoke callback to get values for ${r.fieldName}`);let g=await this.getValuesForField(r.fieldName,r.prefix);(p==null?void 0:p.type)==="string"&&(g=g.map(v=>`"${v}"`)),s.push(...g.map(v=>({type:t,value:v,start:i,end:c})))}}}if(this.completions=s,this.completions.length&&this._autocomplete){let{width:t,left:p,bottom:g}=this._input.getBoundingClientRect();this._autocomplete.showPopover(),"anchorName"in document.documentElement.style||(this._autocomplete.style.left=`${p+3.75}px`,this._autocomplete.style.top=`${g}px`),this._autocomplete.style.width=`${t-15}px`}}updated(r){r.has("outputLanguage")&&this._parseQuery()}render(){return A`
|
|
772
|
+
<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>
|
|
707
773
|
<div class="autocomplete" popover style=${`position-anchor: --${this.uuid};`}>
|
|
708
|
-
${this.completions.map((r,s)=>
|
|
709
|
-
</div>`}},
|
|
774
|
+
${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>`)}
|
|
775
|
+
</div>`}},F([m({type:String,reflect:!0})],d.SpectricQuery.prototype,"placeholder",2),F([m({type:String,reflect:!0})],d.SpectricQuery.prototype,"value",2),F([m({type:String,reflect:!0})],d.SpectricQuery.prototype,"outputLanguage",2),F([He()],d.SpectricQuery.prototype,"completions",2),F([He()],d.SpectricQuery.prototype,"completionIndex",2),F([m({type:Array,reflect:!0})],d.SpectricQuery.prototype,"fields",2),F([De(".autocomplete")],d.SpectricQuery.prototype,"_autocomplete",2),F([qe(".autocomplete")],d.SpectricQuery.prototype,"_asyncAutocomplete",2),F([De("spectric-input")],d.SpectricQuery.prototype,"_input",2),d.SpectricQuery=F([L("spectric-query")],d.SpectricQuery);const Mr=M`
|
|
710
776
|
border-color: color-mix(in hsl, var(--panel-color, #0b0b0b), var(--spectric-input-color, #000000) 3%);
|
|
711
777
|
background-color: var(--panel-color,#0b0b0b);
|
|
712
778
|
--spectric-input-color: var(--spectric-background);
|
|
@@ -714,7 +780,7 @@ spectric-button{
|
|
|
714
780
|
--spectric-text-primary:var(--text-primary);
|
|
715
781
|
--spectric-text-secondary:var(--text-secondary);
|
|
716
782
|
filter: drop-shadow(0px 1px 3px color-mix(in srgb, var(--text-secondary, #3c4c5b), transparent 50%));
|
|
717
|
-
`,
|
|
783
|
+
`,Ir=M`
|
|
718
784
|
border-color: color-mix(in hsl, var(--panel-color-inverse,#f4f4f4), var(--spectric-input-color, #000000) 3%);
|
|
719
785
|
background-color: var(--panel-color-inverse,#0b0b0b);
|
|
720
786
|
color:var(--text-primary,#3c4c5b);
|
|
@@ -722,7 +788,7 @@ spectric-button{
|
|
|
722
788
|
--spectric-text-primary:var(--text-secondary);
|
|
723
789
|
--spectric-text-secondary:var(--text-primary);
|
|
724
790
|
filter: drop-shadow(0px 1px 3px color-mix(in srgb, var(--text-primary, #3c4c5b), transparent 70%));
|
|
725
|
-
`,
|
|
791
|
+
`,ao=M`
|
|
726
792
|
:host{
|
|
727
793
|
display:block;
|
|
728
794
|
border:2px solid black;
|
|
@@ -732,20 +798,20 @@ spectric-button{
|
|
|
732
798
|
|
|
733
799
|
}
|
|
734
800
|
:host(spectric-panel[level='0']) {
|
|
735
|
-
${
|
|
801
|
+
${Mr};
|
|
736
802
|
}
|
|
737
803
|
|
|
738
804
|
:host(spectric-panel[level='1']) {
|
|
739
|
-
${
|
|
805
|
+
${Ir};
|
|
740
806
|
}
|
|
741
807
|
|
|
742
808
|
:host(spectric-panel[level='2']) {
|
|
743
|
-
${
|
|
809
|
+
${Mr};
|
|
744
810
|
}
|
|
745
811
|
:host(spectric-panel[level='3']) {
|
|
746
|
-
${
|
|
812
|
+
${Ir};
|
|
747
813
|
}
|
|
748
|
-
`;var
|
|
814
|
+
`;var co=Object.defineProperty,lo=Object.getOwnPropertyDescriptor,Bt=(n,r,s,i)=>{for(var c=i>1?void 0:i?lo(r,s):r,t=n.length-1,p;t>=0;t--)(p=n[t])&&(c=(i?p(r,s,c):p(c))||c);return i&&c&&co(r,s,c),c};d.SpectricPanel=class extends O{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=ao,Bt([m({type:Number,reflect:!0})],d.SpectricPanel.prototype,"level",2),Bt([m({attribute:!1})],d.SpectricPanel.prototype,"layers",2),d.SpectricPanel=Bt([L("spectric-panel")],d.SpectricPanel);var uo=Object.defineProperty,po=Object.getOwnPropertyDescriptor,Fr=(n,r,s,i)=>{for(var c=i>1?void 0:i?po(r,s):r,t=n.length-1,p;t>=0;t--)(p=n[t])&&(c=(i?p(r,s,c):p(c))||c);return i&&c&&uo(r,s,c),c};const fo={"--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"},Hr={...Qr,"--primary":"#ffd45a","--text-on-color":"#4f4f4f"},Rt={undefined:{},light:{},dark:Qr,spectric:Hr,spectricFlat:{...Hr,"--border-radius":"1px"}},ho=Object.fromEntries(Object.keys(Rt).map(n=>[n,n])),go=`
|
|
749
815
|
--spectric-background: var(--background,#ffffff);
|
|
750
816
|
--spectric-background-hover:var(--background-hover,rgba(141, 141, 141, 0.12));
|
|
751
817
|
--spectric-background-inverse: var(--background-inverse,#f4f4f4);
|
|
@@ -788,12 +854,12 @@ spectric-button{
|
|
|
788
854
|
--spectric-text-on-color-disabled: var(--disabled,#c6c6c6)
|
|
789
855
|
--spectric-button-disabled: #c6c6c6;
|
|
790
856
|
color: var(--spectric-text-primary);
|
|
791
|
-
`;d.SpectricThemeProvider=class extends
|
|
792
|
-
`);return
|
|
793
|
-
${this.theme&&this.theme!=="light"?
|
|
857
|
+
`;d.SpectricThemeProvider=class extends O{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(Rt).includes(this.theme)?this.theme:"undefined",s=Object.entries(Rt[r]).map(i=>`${i[0]}:${i[1]};`).join(`
|
|
858
|
+
`);return A`
|
|
859
|
+
${this.theme&&this.theme!=="light"?A`
|
|
794
860
|
<style>:host{
|
|
795
861
|
${s};
|
|
796
|
-
${
|
|
862
|
+
${go}
|
|
797
863
|
}
|
|
798
864
|
/* Webkit psudo elements don't pick up variables defined by the host */
|
|
799
865
|
::-webkit-scrollbar-thumb {
|
|
@@ -864,9 +930,9 @@ spectric-button{
|
|
|
864
930
|
}
|
|
865
931
|
</style>`:null}
|
|
866
932
|
<slot></slot>
|
|
867
|
-
`}},d.SpectricThemeProvider.styles=
|
|
933
|
+
`}},d.SpectricThemeProvider.styles=M`:host{
|
|
868
934
|
display:contents;
|
|
869
|
-
}`,
|
|
935
|
+
}`,Fr([m({reflect:!0})],d.SpectricThemeProvider.prototype,"theme",2),d.SpectricThemeProvider=Fr([L("spectric-theme")],d.SpectricThemeProvider);const bo=M`
|
|
870
936
|
:host {
|
|
871
937
|
display: block;
|
|
872
938
|
height: 100%;
|
|
@@ -929,7 +995,7 @@ spectric-button{
|
|
|
929
995
|
width: 5px;
|
|
930
996
|
cursor: ew-resize;
|
|
931
997
|
}
|
|
932
|
-
`;var
|
|
998
|
+
`;var vo=Object.defineProperty,mo=Object.getOwnPropertyDescriptor,z=(n,r,s,i)=>{for(var c=i>1?void 0:i?mo(r,s):r,t=n.length-1,p;t>=0;t--)(p=n[t])&&(c=(i?p(r,s,c):p(c))||c);return i&&c&&vo(r,s,c),c},qr=(n=>(n.horizontal="horizontal",n.vertical="vertical",n))(qr||{});const Wr="spectric-splitview";d.SplitView=class extends Tr{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:c,min:t,max:p,useSavedState:g}=this,v=this.getAttribute("id");v&&this.useSavedState&&localStorage.setItem(`splitview-${v}`,String(s)),this.dispatchEvent(new CustomEvent("change",{detail:{orientation:i,percentage:s,invisible:c,min:t,max:p,useSavedState:g}}))},this._onMouseMove=Lr(s=>{if(this.isDragging){const i=this.getBoundingClientRect();let c,t;this.orientation==="horizontal"?(c=s.clientX-i.left,t=c/i.width*100):(c=s.clientY-i.top,t=c/i.height*100),t=Math.min(Math.max(t,this.min),this.max),this.percentage=t,this._emitChange()}}),this._assignSlot=s=>{if(!s.target)return;let c=s.target.assignedNodes().filter(t=>t instanceof HTMLElement);c.length>2&&console.log("cannot assign more than 2 elements to a split view"),c.forEach(t=>{if(this._panel1.assignedNodes().length===0){t.slot="panel1";return}if(this._panel2.assignedNodes().length===0){t.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`
|
|
933
999
|
<div class="split-view ${this.orientation} ${this._error?"error":""} ${this.isDragging?"active":""}" style="--split-percentage: ${this.percentage}%;">
|
|
934
1000
|
<span class="error-display">${this._error}</span>
|
|
935
1001
|
<div class="panel" style="${this.orientation==="horizontal"?"flex: var(--split-percentage, 50%)":"max-height: var(--split-percentage, 50%)"}">
|
|
@@ -941,5 +1007,45 @@ spectric-button{
|
|
|
941
1007
|
</div>
|
|
942
1008
|
</div>
|
|
943
1009
|
<slot @slotchange=${this._assignSlot} style="display:none"></slot>
|
|
944
|
-
`}},d.SplitView.styles=
|
|
1010
|
+
`}},d.SplitView.styles=bo,z([m({type:String})],d.SplitView.prototype,"orientation",2),z([m({type:Number,reflect:!0})],d.SplitView.prototype,"percentage",2),z([m({type:Boolean})],d.SplitView.prototype,"invisible",2),z([m({type:Number,reflect:!0})],d.SplitView.prototype,"min",2),z([m({type:Number,reflect:!0})],d.SplitView.prototype,"max",2),z([m({type:Boolean,reflect:!0})],d.SplitView.prototype,"useSavedState",2),z([He()],d.SplitView.prototype,"isDragging",2),z([He()],d.SplitView.prototype,"_error",2),z([qe(".splitter")],d.SplitView.prototype,"_splitter",2),z([De("slot[name='panel1']")],d.SplitView.prototype,"_panel1",2),z([De("slot[name='panel2']")],d.SplitView.prototype,"_panel2",2),d.SplitView=z([L(Wr)],d.SplitView);var yo=Object.defineProperty,$o=Object.getOwnPropertyDescriptor,ye=(n,r,s,i)=>{for(var c=i>1?void 0:i?$o(r,s):r,t=n.length-1,p;t>=0;t--)(p=n[t])&&(c=(i?p(r,s,c):p(c))||c);return i&&c&&yo(r,s,c),c};const Yr="spectric-pagination";console.log("Pagination"),d.PaginationElement=class extends O{constructor(){super(...arguments),this.page=1,this.pageSize=10,this.pageSizeOptions=[10,20,50,100,1e3],this.size="small",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`
|
|
1011
|
+
<div class="spectric-pagination-container">
|
|
1012
|
+
<div>
|
|
1013
|
+
<!-- TODO/FIXME Make a select component and use it for cross browser styling-->
|
|
1014
|
+
<select @change=${this._handleSizeChange} .value=${String(this.pageSize)}>
|
|
1015
|
+
${this.pageSizeOptions.map(c=>A`<option .value=${String(c)} class=${String(c)===String(this.pageSize)?"selected":""}>${c}</option>`)}
|
|
1016
|
+
</select>
|
|
1017
|
+
</div>
|
|
1018
|
+
${this.totalItems?A`
|
|
1019
|
+
<div class="spectric-pagination-text">${`Items ${(this.page-1)*this.pageSize}-${Math.min(this.page*this.pageSize,this.totalItems)} of ${this.totalItems}`}</div>
|
|
1020
|
+
<div class="spectric-pagination-container">
|
|
1021
|
+
<div>
|
|
1022
|
+
${i}
|
|
1023
|
+
</div>
|
|
1024
|
+
<div>
|
|
1025
|
+
<spectric-button size=${this.size} ?disabled=${this.page===1} @click=${this._handlePageDown}><</spectric-button>
|
|
1026
|
+
<spectric-button size=${this.size} ?disabled=${s} @click=${this._handlePageUp}>></spectric-button>
|
|
1027
|
+
</div>
|
|
1028
|
+
</div>
|
|
1029
|
+
`:null}
|
|
1030
|
+
</div>
|
|
1031
|
+
`}},ye([m({type:Number,reflect:!0})],d.PaginationElement.prototype,"page",2),ye([m({type:Number,reflect:!0})],d.PaginationElement.prototype,"pageSize",2),ye([m({type:Number,reflect:!0})],d.PaginationElement.prototype,"totalItems",2),ye([m({type:Array})],d.PaginationElement.prototype,"pageSizeOptions",2),ye([m({type:String,reflect:!0})],d.PaginationElement.prototype,"size",2),d.PaginationElement=ye([L(Yr)],d.PaginationElement);var _o=Object.defineProperty,wo=Object.getOwnPropertyDescriptor,Vr=(n,r,s,i)=>{for(var c=i>1?void 0:i?wo(r,s):r,t=n.length-1,p;t>=0;t--)(p=n[t])&&(c=(i?p(r,s,c):p(c))||c);return i&&c&&_o(r,s,c),c};const So="spectric-table-header";let Ut=class extends O{constructor(){super(...arguments),this.columns=[]}createRenderRoot(){return this}render(){return A`
|
|
1032
|
+
<tr>
|
|
1033
|
+
${this.columns.map(n=>{let r=["header-contents"];return n.filterable,A`<td><div class=${r.join(" ")}>${n.title||n.key}</div></td>`})}
|
|
1034
|
+
</tr>
|
|
1035
|
+
`}};Vr([m({type:Array,attribute:!1})],Ut.prototype,"columns",2),Ut=Vr([L(So)],Ut);var Ao=Object.defineProperty,xo=Object.getOwnPropertyDescriptor,Mt=(n,r,s,i)=>{for(var c=i>1?void 0:i?xo(r,s):r,t=n.length-1,p;t>=0;t--)(p=n[t])&&(c=(i?p(r,s,c):p(c))||c);return i&&c&&Ao(r,s,c),c};const ko="spectric-table-cell";let rt=class extends O{constructor(){super(...arguments),this._handleFilterOut=()=>{let n;this.column.key&&typeof this.row=="object"&&(n=this.row[this.column.key]),this.dispatchEvent(new CustomEvent("filter",{composed:!0,bubbles:!0,detail:{include:!1,row:this.row,value:n,column:this.column}}))},this._handleFilterFor=()=>{let n;this.column.key&&typeof this.row=="object"&&(n=this.row[this.column.key]),this.dispatchEvent(new CustomEvent("filter",{composed:!0,bubbles:!0,detail:{include:!0,row:this.row,value:n,column:this.column}}))}}createRenderRoot(){return this}render(){let n;this.column.render?n=this.column.render(this.row,this.table):this.column.key&&typeof this.row=="object"?n=this.row[this.column.key]:n=A`error`;let r=["cell-contents"];this.column.filterable&&r.push("filterable");let s=A`<div class="table-cell-actions"><spectric-button @click=${this._handleFilterOut} size="tiny" variant="text" icon>-</spectric-button><spectric-button @click=${this._handleFilterFor} size="tiny" variant="text" icon>+</spectric-button></div>`;return A`
|
|
1036
|
+
<td>
|
|
1037
|
+
${this.column.filterable?s:null}
|
|
1038
|
+
<div class=${r.join(" ")}>${n}</div>
|
|
1039
|
+
</td>
|
|
1040
|
+
`}};Mt([m({type:Object,attribute:!1})],rt.prototype,"row",2),Mt([m({type:Object,attribute:!1})],rt.prototype,"column",2),rt=Mt([L(ko)],rt);var Co=Object.defineProperty,Eo=Object.getOwnPropertyDescriptor,It=(n,r,s,i)=>{for(var c=i>1?void 0:i?Eo(r,s):r,t=n.length-1,p;t>=0;t--)(p=n[t])&&(c=(i?p(r,s,c):p(c))||c);return i&&c&&Co(r,s,c),c};const Oo="spectric-table-body";let it=class extends O{constructor(){super(...arguments),this.data=[],this.columns=[]}createRenderRoot(){return this}render(){return A`
|
|
1041
|
+
<body>
|
|
1042
|
+
${this.data.map(n=>A`<tr>${this.columns.map(r=>A`<spectric-table-cell .column=${r} .row=${n}></spectric-table-cell>`)}</tr>`)}
|
|
1043
|
+
</body>
|
|
1044
|
+
`}};It([m({type:Array,attribute:!1})],it.prototype,"data",2),It([m({type:Array,attribute:!1})],it.prototype,"columns",2),it=It([L(Oo)],it);var Po=Object.defineProperty,To=Object.getOwnPropertyDescriptor,st=(n,r,s,i)=>{for(var c=i>1?void 0:i?To(r,s):r,t=n.length-1,p;t>=0;t--)(p=n[t])&&(c=(i?p(r,s,c):p(c))||c);return i&&c&&Po(r,s,c),c};const Kr="spectric-table";d.TableElement=class extends O{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"))}}createRenderRoot(){return this}render(){let r=this.columns.filter(s=>!s.hidden);return A`
|
|
1045
|
+
<div role="table">
|
|
1046
|
+
<spectric-table-header .columns=${r}></spectric-table-header>
|
|
1047
|
+
<spectric-table-body .columns=${r} .data=${this.data} .table=${this}></spectric-table-body>
|
|
1048
|
+
</div>
|
|
1049
|
+
${this.pagination?A`<spectric-pagination ${Ge(this.pagination)} @change=${this._handlePaginationChange}></spectric-pagination>`:null}
|
|
1050
|
+
`}},st([m({type:Array,attribute:!1})],d.TableElement.prototype,"data",2),st([m({type:Object,attribute:!1})],d.TableElement.prototype,"pagination",2),st([m({attribute:!1})],d.TableElement.prototype,"columns",2),d.TableElement=st([L(Kr)],d.TableElement),d.ButtonSizes=kr,d.ButtonVariants=Cr,d.CSSPropsControls=fo,d.DialogElementTag=zt,d.ElementTag=Wr,d.InputVariants=Dr,d.Orientations=qr,d.PaginationElementTag=Yr,d.SupportedLanguages=Rr,d.TableElementTag=Kr,d.ThemeSelections=ho,d.nodeTypes=V,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
|
945
1051
|
//# sourceMappingURL=index.umd.js.map
|