@spectric/ui 0.0.5 → 0.0.7
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/input.d.ts +3 -1
- package/dist/components/query_bar/QueryBar.d.ts +7 -3
- package/dist/custom-elements.json +7 -3
- package/dist/index.es.js +130 -126
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +22 -22
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
- package/src/components/input.ts +19 -2
- package/src/components/query_bar/QueryBar.ts +21 -22
- package/src/stories/QueryBar.stories.ts +7 -0
- package/src/stories/fixtures/data.ts +3 -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,7 +2,7 @@
|
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/var zr;const Z=globalThis,ht=Z.ShadowRoot&&(Z.ShadyCSS===void 0||Z.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,gt=Symbol(),Gt=new WeakMap;let Jt=class{constructor(r,s,i){if(this._$cssResult$=!0,i!==gt)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(ht&&r===void 0){const i=s!==void 0&&s.length===1;i&&(r=Gt.get(s)),r===void 0&&((this.o=r=new CSSStyleSheet).replaceSync(this.cssText),i&&Gt.set(s,r))}return r}toString(){return this.cssText}};const
|
|
5
|
+
*/var zr;const Z=globalThis,ht=Z.ShadowRoot&&(Z.ShadyCSS===void 0||Z.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,gt=Symbol(),Gt=new WeakMap;let Jt=class{constructor(r,s,i){if(this._$cssResult$=!0,i!==gt)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(ht&&r===void 0){const i=s!==void 0&&s.length===1;i&&(r=Gt.get(s)),r===void 0&&((this.o=r=new CSSStyleSheet).replaceSync(this.cssText),i&&Gt.set(s,r))}return r}toString(){return this.cssText}};const Vi=n=>new Jt(typeof n=="string"?n:n+"",void 0,gt),z=(n,...r)=>{const s=n.length===1?n[0]:r.reduce((i,a,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.")})(a)+n[t+1],n[0]);return new Jt(s,n,gt)},Ki=(n,r)=>{if(ht)n.adoptedStyleSheets=r.map(s=>s instanceof CSSStyleSheet?s:s.styleSheet);else for(const s of r){const i=document.createElement("style"),a=Z.litNonce;a!==void 0&&i.setAttribute("nonce",a),i.textContent=s.cssText,n.appendChild(i)}},er=ht?n=>n:n=>n instanceof CSSStyleSheet?(r=>{let s="";for(const i of r.cssRules)s+=i.cssText;return Vi(s)})(n):n;/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright 2017 Google LLC
|
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
* @license
|
|
11
11
|
* Copyright 2017 Google LLC
|
|
12
12
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
-
*/const
|
|
13
|
+
*/const xe=globalThis,Ie=xe.trustedTypes,ir=Ie?Ie.createPolicy("lit-html",{createHTML:n=>n}):void 0,sr="$lit$",G=`lit$${Math.random().toFixed(9).slice(2)}$`,or="?"+G,is=`<${or}>`,se=document,Ce=()=>se.createComment(""),Ee=n=>n===null||typeof n!="object"&&typeof n!="function",yt=Array.isArray,ss=n=>yt(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",mt=`[
|
|
14
14
|
\f\r]`,Oe=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,nr=/-->/g,cr=/>/g,oe=RegExp(`>|${mt}(?:([^\\s"'>=/]+)(${mt}*=${mt}*(?:[^
|
|
15
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),ar=/'/g,lr=/"/g,ur=/^(?:script|style|textarea|title)$/i,os=n=>(r,...s)=>({_$litType$:n,strings:r,values:s}),k=os(1),ne=Symbol.for("lit-noChange"),
|
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),ar=/'/g,lr=/"/g,ur=/^(?:script|style|textarea|title)$/i,os=n=>(r,...s)=>({_$litType$:n,strings:r,values:s}),k=os(1),ne=Symbol.for("lit-noChange"),C=Symbol.for("lit-nothing"),pr=new WeakMap,ce=se.createTreeWalker(se,129);function dr(n,r){if(!yt(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return ir!==void 0?ir.createHTML(r):r}const ns=(n,r)=>{const s=n.length-1,i=[];let a,t=r===2?"<svg>":r===3?"<math>":"",p=Oe;for(let g=0;g<s;g++){const v=n[g];let _,A,S=-1,E=0;for(;E<v.length&&(p.lastIndex=E,A=p.exec(v),A!==null);)E=p.lastIndex,p===Oe?A[1]==="!--"?p=nr:A[1]!==void 0?p=cr:A[2]!==void 0?(ur.test(A[2])&&(a=RegExp("</"+A[2],"g")),p=oe):A[3]!==void 0&&(p=oe):p===oe?A[0]===">"?(p=a??Oe,S=-1):A[1]===void 0?S=-2:(S=p.lastIndex-A[2].length,_=A[1],p=A[3]===void 0?oe:A[3]==='"'?lr:ar):p===lr||p===ar?p=oe:p===nr||p===cr?p=Oe:(p=oe,a=void 0);const x=p===oe&&n[g+1].startsWith("/>")?" ":"";t+=p===Oe?v+is:S>=0?(i.push(_),v.slice(0,S)+sr+v.slice(S)+G+x):v+G+(S===-2?g:x)}return[dr(n,t+(n[s]||"<?>")+(r===2?"</svg>":r===3?"</math>":"")),i]};class Pe{constructor({strings:r,_$litType$:s},i){let a;this.parts=[];let t=0,p=0;const g=r.length-1,v=this.parts,[_,A]=ns(r,s);if(this.el=Pe.createElement(_,i),ce.currentNode=this.el.content,s===2||s===3){const S=this.el.content.firstChild;S.replaceWith(...S.childNodes)}for(;(a=ce.nextNode())!==null&&v.length<g;){if(a.nodeType===1){if(a.hasAttributes())for(const S of a.getAttributeNames())if(S.endsWith(sr)){const E=A[p++],x=a.getAttribute(S).split(G),L=/([.?@])?(.*)/.exec(E);v.push({type:1,index:t,name:L[2],strings:x,ctor:L[1]==="."?as:L[1]==="?"?ls:L[1]==="@"?us:Qe}),a.removeAttribute(S)}else S.startsWith(G)&&(v.push({type:6,index:t}),a.removeAttribute(S));if(ur.test(a.tagName)){const S=a.textContent.split(G),E=S.length-1;if(E>0){a.textContent=Ie?Ie.emptyScript:"";for(let x=0;x<E;x++)a.append(S[x],Ce()),ce.nextNode(),v.push({type:2,index:++t});a.append(S[E],Ce())}}}else if(a.nodeType===8)if(a.data===or)v.push({type:2,index:t});else{let S=-1;for(;(S=a.data.indexOf(G,S+1))!==-1;)v.push({type:7,index:t}),S+=G.length-1}t++}}static createElement(r,s){const i=se.createElement("template");return i.innerHTML=r,i}}function he(n,r,s=n,i){var p,g;if(r===ne)return r;let a=i!==void 0?(p=s._$Co)==null?void 0:p[i]:s._$Cl;const t=Ee(r)?void 0:r._$litDirective$;return(a==null?void 0:a.constructor)!==t&&((g=a==null?void 0:a._$AO)==null||g.call(a,!1),t===void 0?a=void 0:(a=new t(n),a._$AT(n,s,i)),i!==void 0?(s._$Co??(s._$Co=[]))[i]=a:s._$Cl=a),a!==void 0&&(r=he(n,a._$AS(n,r.values),a,i)),r}class cs{constructor(r,s){this._$AV=[],this._$AN=void 0,this._$AD=r,this._$AM=s}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(r){const{el:{content:s},parts:i}=this._$AD,a=((r==null?void 0:r.creationScope)??se).importNode(s,!0);ce.currentNode=a;let t=ce.nextNode(),p=0,g=0,v=i[0];for(;v!==void 0;){if(p===v.index){let _;v.type===2?_=new Te(t,t.nextSibling,this,r):v.type===1?_=new v.ctor(t,v.name,v.strings,this,r):v.type===6&&(_=new ps(t,this,r)),this._$AV.push(_),v=i[++g]}p!==(v==null?void 0:v.index)&&(t=ce.nextNode(),p++)}return ce.currentNode=se,a}p(r){let s=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(r,i,s),s+=i.strings.length-2):i._$AI(r[s])),s++}}class Te{get _$AU(){var r;return((r=this._$AM)==null?void 0:r._$AU)??this._$Cv}constructor(r,s,i,a){this.type=2,this._$AH=C,this._$AN=void 0,this._$AA=r,this._$AB=s,this._$AM=i,this.options=a,this._$Cv=(a==null?void 0:a.isConnected)??!0}get parentNode(){let r=this._$AA.parentNode;const s=this._$AM;return s!==void 0&&(r==null?void 0:r.nodeType)===11&&(r=s.parentNode),r}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(r,s=this){r=he(this,r,s),Ee(r)?r===C||r==null||r===""?(this._$AH!==C&&this._$AR(),this._$AH=C):r!==this._$AH&&r!==ne&&this._(r):r._$litType$!==void 0?this.$(r):r.nodeType!==void 0?this.T(r):ss(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&&Ee(this._$AH)?this._$AA.nextSibling.data=r:this.T(se.createTextNode(r)),this._$AH=r}$(r){var t;const{values:s,_$litType$:i}=r,a=typeof i=="number"?this._$AC(r):(i.el===void 0&&(i.el=Pe.createElement(dr(i.h,i.h[0]),this.options)),i);if(((t=this._$AH)==null?void 0:t._$AD)===a)this._$AH.p(s);else{const p=new cs(a,this),g=p.u(this.options);p.p(s),this.T(g),this._$AH=p}}_$AC(r){let s=pr.get(r.strings);return s===void 0&&pr.set(r.strings,s=new Pe(r)),s}k(r){yt(this._$AH)||(this._$AH=[],this._$AR());const s=this._$AH;let i,a=0;for(const t of r)a===s.length?s.push(i=new Te(this.O(Ce()),this.O(Ce()),this,this.options)):i=s[a],i._$AI(t),a++;a<s.length&&(this._$AR(i&&i._$AB.nextSibling,a),s.length=a)}_$AR(r=this._$AA.nextSibling,s){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,s);r&&r!==this._$AB;){const a=r.nextSibling;r.remove(),r=a}}setConnected(r){var s;this._$AM===void 0&&(this._$Cv=r,(s=this._$AP)==null||s.call(this,r))}}class Qe{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(r,s,i,a,t){this.type=1,this._$AH=C,this._$AN=void 0,this.element=r,this.name=s,this._$AM=a,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,a){const t=this.strings;let p=!1;if(t===void 0)r=he(this,r,s,0),p=!Ee(r)||r!==this._$AH&&r!==ne,p&&(this._$AH=r);else{const g=r;let v,_;for(r=t[0],v=0;v<t.length-1;v++)_=he(this,g[i+v],s,v),_===ne&&(_=this._$AH[v]),p||(p=!Ee(_)||_!==this._$AH[v]),_===C?r=C:r!==C&&(r+=(_??"")+t[v+1]),this._$AH[v]=_}p&&!a&&this.j(r)}j(r){r===C?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,r??"")}}class as extends Qe{constructor(){super(...arguments),this.type=3}j(r){this.element[this.name]=r===C?void 0:r}}class ls extends Qe{constructor(){super(...arguments),this.type=4}j(r){this.element.toggleAttribute(this.name,!!r&&r!==C)}}class us extends Qe{constructor(r,s,i,a,t){super(r,s,i,a,t),this.type=5}_$AI(r,s=this){if((r=he(this,r,s,0)??C)===ne)return;const i=this._$AH,a=r===C&&i!==C||r.capture!==i.capture||r.once!==i.once||r.passive!==i.passive,t=r!==C&&(i===C||a);a&&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 ps{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 $t=xe.litHtmlPolyfillSupport;$t==null||$t(Pe,Te),(xe.litHtmlVersions??(xe.litHtmlVersions=[])).push("3.2.1");const fr=(n,r,s)=>{const i=(s==null?void 0:s.renderBefore)??r;let a=i._$litPart$;if(a===void 0){const t=(s==null?void 0:s.renderBefore)??null;i._$litPart$=a=new Te(r.insertBefore(Ce(),t),t,void 0,s??{})}return a._$AI(n),a};/**
|
|
16
16
|
* @license
|
|
17
17
|
* Copyright 2017 Google LLC
|
|
18
18
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -228,21 +228,21 @@ opacity:1
|
|
|
228
228
|
* @license
|
|
229
229
|
* Copyright 2020 Google LLC
|
|
230
230
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
231
|
-
*/const We=()=>new Ss;class Ss{}const St=new WeakMap,
|
|
231
|
+
*/const We=()=>new Ss;class Ss{}const St=new WeakMap,Ye=_t(class extends _r{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=St.get(r);s===void 0&&(s=new WeakMap,St.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=St.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)}}),As=class{constructor(r){return this.buffer=r,this.u8=new Uint8Array(r),new Proxy(this,{get(s,i){return s[i]?s[i]:s.getBit(i)}})}getBit(r){var s=this.u8[r>>3],i=r&7;return s>>7-i&1}setBit(r,s){var i=r&7;s?this.u8[r>>3]|=128>>i:this.u8[r>>3]&=~(128>>i)}get length(){return this.u8.byteLength*8}set(r,s){for(let i=s||0,a=0,t=r.length;a<t;i++,a++)this.setBit(i,r[a])}subarray(r,s){let i=[];r=r||0,s=s||this.length,s=s>this.length?this.length:s;for(let a=r;a<s;a++)i.push(this.getBit(a));return i}};class Sr{constructor(r,s,i,a){this.__target=r,this._handler=i,this._type=s,this._handler=i,this._options=a||!1,r instanceof Promise?r.then(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 Ar extends N{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 Sr(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 Sr(r,s,i))})}disconnectedCallback(){super.disconnectedCallback(),this._connected=!1,this._disposables.forEach(r=>{r.dispose()}),this._isDisposed=!0}}const kr=n=>{var r;return(...s)=>{r&&cancelAnimationFrame(r),r=requestAnimationFrame(()=>{n.apply(void 0,s)})}};var ks=Object.defineProperty,xs=Object.getOwnPropertyDescriptor,le=(n,r,s,i)=>{for(var a=i>1?void 0:i?xs(r,s):r,t=n.length-1,p;t>=0;t--)(p=n[t])&&(a=(i?p(r,s,a):p(a))||a);return i&&a&&ks(r,s,a),a};const Cs=["mousemove","click","dblclick","mousedown","mouseup","contextmenu"],Ve={width:200,height:200},Ke={width:10,height:10};d.BitDisplayCanvas=class extends Ar{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:We(),canvas:We(),scrollDiv:We()},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={};Cs.forEach(i=>{this.addDisposableListener(this._canvas,i,kr(async a=>{a.stopImmediatePropagation(),a.stopPropagation(),a.preventDefault();var t=await this._canvas;let p=t.getBoundingClientRect(),g={x:Math.floor(Math.abs(a.clientX-p.left)),y:Math.floor(Math.abs(a.clientY-p.top))},v=this.canvasPositionToBit(g);if(i==="mousemove"&&s[i]==v)return;s[i]=v;let _="bit"+String(i).charAt(0).toUpperCase()+String(i).slice(1);if(v!=-1){let A=new CustomEvent(_,{detail:{bitIndex:v,position:g,nativeEvent:a}});this.dispatchEvent(A)}}))})}connectedCallback(){this.onResize(),super.connectedCallback(),this.registerDisposable(this.resizeObserver),this.resizeObserver.observe(this)}updated(r){r.has("arrayBuffer")&&this.arrayBuffer&&(this._bitArray=new As(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=Ve.width,height:a=Ve.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,a);let v=0;for(let _=this.yStart*r+this.xStart,A=s.length;_<A;_++){let S=_%r-this.xStart;if(!(S<0)){if(Math.floor(S*t)>i){v++,_=v*r+this.yStart*r+this.xStart-1;continue}if(Math.floor(v*t)>a)break;s.getBit(_)===1&&p.fillRect(S,v,1,1),(_+1)%r===0&&_>=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 a=s.length/r*i,t=r*i,p=this.refs.scrollDiv.value;p.style.width=t+"px",p.style.height=a+"px"}}render(){const{height:r=Ve.height,width:s=Ve.width}=this;return k`
|
|
232
232
|
<div
|
|
233
233
|
id="viewport"
|
|
234
|
-
${
|
|
234
|
+
${Ye(this.refs.viewport)}
|
|
235
235
|
@scroll=${this.handleScroll}
|
|
236
236
|
style=${`width:${s}px;height:${r}px;overflow:auto;position:relative`}
|
|
237
237
|
>
|
|
238
238
|
<div
|
|
239
239
|
id="fakescrolldiv"
|
|
240
|
-
${
|
|
240
|
+
${Ye(this.refs.scrollDiv)}
|
|
241
241
|
>
|
|
242
242
|
</div>
|
|
243
243
|
</div>
|
|
244
244
|
<canvas
|
|
245
|
-
${
|
|
245
|
+
${Ye(this.refs.canvas)}
|
|
246
246
|
width=${s-Ke.width}
|
|
247
247
|
height=${r-Ke.height}
|
|
248
248
|
></canvas>
|
|
@@ -561,7 +561,7 @@ article{
|
|
|
561
561
|
* @license
|
|
562
562
|
* Copyright 2018 Google LLC
|
|
563
563
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
564
|
-
*/const At=n=>n??
|
|
564
|
+
*/const At=n=>n??C;class Bs extends _r{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 a in r){const t=r[a];t!==s[a]&&(i[a]=t)}}groom(r){const{prevData:s,element:i}=this;if(s)for(const a in s)(!r||!(a in r)&&i[a]===s[a])&&(i[a]=void 0)}}const kt=_t(Bs);var xt=(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))(xt||{});const Xe={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 js=Object.defineProperty,Rs=Object.getOwnPropertyDescriptor,I=(n,r,s,i)=>{for(var a=i>1?void 0:i?Rs(r,s):r,t=n.length-1,p;t>=0;t--)(p=n[t])&&(a=(i?p(r,s,a):p(a))||a);return i&&a&&js(r,s,a),a};d.SpectricPage=class extends N{constructor(){super(...arguments),this.showHeader=!0,this.headerSticky=!0,this.classificationLevel=xt.None,this.classificationText="",this.notifications=[],this.showCreateAccount=!1,this.showLoginButton=!0,this.username=""}render(){this.classificationLevel&&!Xe[this.classificationLevel]&&(console.warn("Unknown classification",this.classificationLevel),this.classificationLevel=xt.None);const r=this.classificationLevel?this.classificationText||Xe[this.classificationLevel].content:"",s=this.showHeader?k`<spectric-header ?showCreateAccount=${this.showCreateAccount} .showLoginButton=${this.showLoginButton} username=${At(this.username)}>
|
|
565
565
|
<slot name="branding" slot="branding"></slot>
|
|
566
566
|
<slot name="name" slot="name"></slot>
|
|
567
567
|
<slot name="center" slot="center"></slot>
|
|
@@ -584,7 +584,7 @@ article{
|
|
|
584
584
|
</spectric-theme>
|
|
585
585
|
${this.classificationLevel&&r?k`<spectric-banner ${kt({text:r,headerStyle:Xe[this.classificationLevel]})}></spectric-banner>`:null}
|
|
586
586
|
|
|
587
|
-
`}},d.SpectricPage.styles=Ds,I([y({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"showHeader",2),I([y({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"headerSticky",2),I([y({type:String,reflect:!0})],d.SpectricPage.prototype,"classificationLevel",2),I([y({type:String,reflect:!0})],d.SpectricPage.prototype,"classificationText",2),I([y({type:Array,reflect:!0})],d.SpectricPage.prototype,"notifications",2),I([y({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"showCreateAccount",2),I([y({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"showLoginButton",2),I([y({type:String,reflect:!0})],d.SpectricPage.prototype,"username",2),I([y({type:String,reflect:!0})],d.SpectricPage.prototype,"theme",2),d.SpectricPage=I([R("spectric-page")],d.SpectricPage);var Us=Object.defineProperty,Ms=Object.getOwnPropertyDescriptor,O=(n,r,s,i)=>{for(var a=i>1?void 0:i?Ms(r,s):r,t=n.length-1,p;t>=0;t--)(p=n[t])&&(a=(i?p(r,s,a):p(a))||a);return i&&a&&Us(r,s,a),a},
|
|
587
|
+
`}},d.SpectricPage.styles=Ds,I([y({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"showHeader",2),I([y({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"headerSticky",2),I([y({type:String,reflect:!0})],d.SpectricPage.prototype,"classificationLevel",2),I([y({type:String,reflect:!0})],d.SpectricPage.prototype,"classificationText",2),I([y({type:Array,reflect:!0})],d.SpectricPage.prototype,"notifications",2),I([y({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"showCreateAccount",2),I([y({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"showLoginButton",2),I([y({type:String,reflect:!0})],d.SpectricPage.prototype,"username",2),I([y({type:String,reflect:!0})],d.SpectricPage.prototype,"theme",2),d.SpectricPage=I([R("spectric-page")],d.SpectricPage);var Us=Object.defineProperty,Ms=Object.getOwnPropertyDescriptor,O=(n,r,s,i)=>{for(var a=i>1?void 0:i?Ms(r,s):r,t=n.length-1,p;t>=0;t--)(p=n[t])&&(a=(i?p(r,s,a):p(a))||a);return i&&a&&Us(r,s,a),a},xr=(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))(xr||{});d.SpectricInput=class extends N{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 k`
|
|
588
588
|
<div class="inputWrapper">
|
|
589
589
|
<div class="text-input__label-helper-wrapper">
|
|
590
590
|
<div class="--text-input__label-wrapper">
|
|
@@ -629,11 +629,11 @@ article{
|
|
|
629
629
|
|
|
630
630
|
</div>
|
|
631
631
|
</div>
|
|
632
|
-
`;case"hidden":return k`<input type="hidden"></input>`}return`Not yet implemented ${this.variant}`}},O([y({type:String,reflect:!0})],d.SpectricInput.prototype,"placeholder",2),O([y({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"readonly",2),O([y({type:String,reflect:!0})],d.SpectricInput.prototype,"variant",2),O([y({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"disabled",2),O([y({type:String,reflect:!0})],d.SpectricInput.prototype,"label",2),O([y()],d.SpectricInput.prototype,"hidePasswordLabel",2),O([y()],d.SpectricInput.prototype,"showPasswordLabel",2),O([y({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"showPasswordVisibilityToggle",2),O([y({type:String,reflect:!0})],d.SpectricInput.prototype,"helperText",2),O([y({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"invalid",2),O([y({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"required",2),O([y({type:String,reflect:!0})],d.SpectricInput.prototype,"invalidText",2),O([y()],d.SpectricInput.prototype,"name",2),O([y()],d.SpectricInput.prototype,"pattern",2),O([y({type:Number,reflect:!0})],d.SpectricInput.prototype,"maxCount",2),O([y({reflect:!0})],d.SpectricInput.prototype,"autocomplete",2),O([y({reflect:!0})],d.SpectricInput.prototype,"value",1),O([Le("input")],d.SpectricInput.prototype,"_input",2),d.SpectricInput=O([R("spectric-input")],d.SpectricInput);const be=n=>At(n===""?void 0:n??void 0),zs="end of input",Is={fieldName:"field name",value:"value",literal:"literal",whitespace:"whitespace"};class
|
|
633
|
-
`);super(a),this.name="DQLSyntaxError",this.shortMessage=i}}function ve(n){return{type:"literal",value:n}}function
|
|
634
|
-
`},Un=function(e){return e},Mn=/^[\\():<>"*{}]/,zn={type:"class",value:'[\\\\():<>"*{}]',description:'[\\\\():<>"*{}]'},Xr="<=",In={type:"literal",value:"<=",description:'"<="'},Qn=function(){return"lte"},Gr=">=",Fn={type:"literal",value:">=",description:'">="'},Hn=function(){return"gte"},Jr="<",ei={type:"literal",value:"<",description:'"<"'},qn=function(){return"lt"},ti=">",ri={type:"literal",value:">",description:'">"'},Wn=function(){return"gt"},
|
|
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=xi(e),u=xi(o);return{start:{offset:e,line:l.line,column:l.column},end:{offset:o,line:u.line,column:u.column}}}function b(e){c<H||(c>H&&(H=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=C,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=Q(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=F,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=F,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=C,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?(Cn.test(i.charAt(c))?(l=i.charAt(c),c++):(l=t,f===0&&b(xn)),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=Cc())),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=F,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=xc(),e===t&&(e=Xt(),e===t&&(e=Ec(),e===t&&(e=Oc(),e===t&&(e=Pc(),e===t&&(e=Tc()))))),e}function Cc(){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=F,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 xc(){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=C,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=F,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)===Ci?(l=Ci,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,q=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,H<i.length?i.charAt(H):null,H<i.length?nt(H,H+1):nt(H,H))}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:V}})},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 xr(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||!V[n.type]?D(V.function.buildNode("and",[]),r):V[n.type].toOpenSearchQuery(n,r,s,i)),W="@kuery-wildcard@";function Hs(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function qs(n){return n.replace(/[+-=&|><!(){}[\]^"~*?:\\/]/g,"\\$&")}function Ws(n){return n.includes(W)?{type:"wildcard",value:n}:ye(n)}function Er(n,r){const{value:s}=n,i=s.split(W).map(Hs).join("[\\s\\S]*");return new RegExp(`^${i}$`).test(r)}function Vs(n){const{value:r}=n;return r.split(W).join("*")}function Ot(n){const{value:r}=n;return r.split(W).map(qs).join("*")}function Ys(n){const{value:r}=n;return r.startsWith(W)&&r.replace(W,"").length>0}const Ks=Object.freeze(Object.defineProperty({__proto__:null,buildNode:Ws,hasLeadingWildcard:Ys,test:Er,toOpenSearchQuery:Vs,toQueryStringQuery:Ot,wildcardSymbol:W},Symbol.toStringTag,{value:"Module"}));function Pt(n,r){if(!r)return[];if(n.type==="literal"){const s=xt(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 Zs(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"?ye(n):ve(n),a=typeof r=="string"?ye(r):ve(r),t=ve(s);return{arguments:[i,a,t]}}function Xs(n,r,s={},i={}){const{arguments:[a,t,p]}=n,g=Or(a,r,i!=null&&i.nested?i.nested.path:void 0),v=D(g),_=t!==void 0?D(t):t,A=p.value?"phrase":"best_fields";if(g.value===null)return t.type==="wildcard"?{query_string:{query:Ot(t)}}:{multi_match:{type:A,query:_,lenient:!0}};const S=r?Pt(g,r):[];S&&S.length===0&&S.push({name:D(g),scripted:!1,type:""});const E=t.type==="wildcard"&&_==="*",
|
|
632
|
+
`;case"hidden":return k`<input type="hidden"></input>`}return`Not yet implemented ${this.variant}`}},O([y({type:String,reflect:!0})],d.SpectricInput.prototype,"placeholder",2),O([y({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"readonly",2),O([y({type:String,reflect:!0})],d.SpectricInput.prototype,"variant",2),O([y({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"disabled",2),O([y({type:String,reflect:!0})],d.SpectricInput.prototype,"label",2),O([y()],d.SpectricInput.prototype,"hidePasswordLabel",2),O([y()],d.SpectricInput.prototype,"showPasswordLabel",2),O([y({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"showPasswordVisibilityToggle",2),O([y({type:String,reflect:!0})],d.SpectricInput.prototype,"helperText",2),O([y({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"invalid",2),O([y({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"required",2),O([y({type:String,reflect:!0})],d.SpectricInput.prototype,"invalidText",2),O([y()],d.SpectricInput.prototype,"name",2),O([y()],d.SpectricInput.prototype,"pattern",2),O([y({type:Number,reflect:!0})],d.SpectricInput.prototype,"maxCount",2),O([y({reflect:!0})],d.SpectricInput.prototype,"autocomplete",2),O([y({reflect:!0})],d.SpectricInput.prototype,"value",1),O([Le("input")],d.SpectricInput.prototype,"_input",2),d.SpectricInput=O([R("spectric-input")],d.SpectricInput);const be=n=>At(n===""?void 0:n??void 0),zs="end of input",Is={fieldName:"field name",value:"value",literal:"literal",whitespace:"whitespace"};class Cr extends Error{constructor(r,s){let i=r.message;if(r.expected){const p=r.expected.map(v=>Is[v.description]||v.description).join(", ");let g=r.found?`"${r.found}"`:zs;i=`Expected ${p} but ${g} found.`}const a=[i,s,"-".repeat(r.location.start.offset)+"^"].join(`
|
|
633
|
+
`);super(a),this.name="DQLSyntaxError",this.shortMessage=i}}function ve(n){return{type:"literal",value:n}}function Ct(n){return n.value}const Qs=Object.freeze(Object.defineProperty({__proto__:null,buildNode:ve,toOpenSearchQuery:Ct},Symbol.toStringTag,{value:"Module"})),{SyntaxError:Fc,parse:Ge}=function(){function n(i,a){function t(){this.constructor=i}t.prototype=a.prototype,i.prototype=new t}function r(i,a,t,p){this.message=i,this.expected=a,this.found=t,this.location=p,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,r)}n(r,Error);function s(i){var a=arguments.length>1?arguments[1]:{},t={},p={start:Oi,Literal:Kt},g=Oi,v=function(e,o){return o.type==="cursor"?{...o,suggestionTypes:["conjunction"]}:e!==null?e:de.function.buildNode("is","*","*")},_=function(){return jc},A=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])},x="(",L={type:"literal",value:"(",description:'"("'},et=")",te={type:"literal",value:")",description:'")"'},F=function(e,o){return o.type==="cursor"?{...o,suggestionTypes:["conjunction"]}:e},H=":",j={type:"literal",value:":",description:'":"'},me="{",Bt={type:"literal",value:"{",description:'"{"'},jt="}",Rt={type:"literal",value:"}",description:'"}"'},ln=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])},un={type:"other",description:"fieldName"},pn=function(e,o,l){if(l.type==="cursor")return{...l,suggestionTypes:["conjunction"]};const u=Ic(o,l);return W("range",[e,u])},dn=function(e,o){return o.type==="cursor"?{...o,fieldName:e.value,suggestionTypes:["value","conjunction"]}:o(e)},fn=function(e){if(e.type==="cursor"){const l=`${e.prefix}${e.suffix}`.trim();return{...e,fieldName:l,suggestionTypes:["field","operator","conjunction"]}}const o=re(null);return e(o)},hn=function(e,o){return o.type==="cursor"?{...o,suggestionTypes:["conjunction"]}:e},gn=function(e,o){const l=[e,o].find(u=>u.type==="cursor");return l?{...l,suggestionTypes:["value"]}:u=>W("or",[e(u),o(u)])},bn=function(e,o){const l=[e,o].find(u=>u.type==="cursor");return l?{...l,suggestionTypes:["value"]}:u=>W("and",[e(u),o(u)])},vn=function(e){return e.type==="cursor"?{...list,suggestionTypes:["value"]}:o=>W("not",[e(o)])},yn={type:"other",description:"value"},mn=function(e){if(e.type==="cursor")return e;const o=re(!0);return l=>W("is",[l,e,o])},$n=function(e){if(e.type==="cursor")return e;!Mc&&e.type==="wildcard"&&de.wildcard.hasLeadingWildcard(e)&&U("Leading wildcards are disabled. See query:allowLeadingWildcards in Advanced Settings.");const o=re(!1);return l=>W("is",[l,e,o])},wn={type:"other",description:"OR"},Ir="or",Qr={type:"literal",value:"or",description:'"or"'},_n={type:"other",description:"AND"},Fr="and",Hr={type:"literal",value:"and",description:'"and"'},Sn={type:"other",description:"NOT"},qr="not",Wr={type:"literal",value:"not",description:'"not"'},An={type:"other",description:"literal"},De='"',Be={type:"literal",value:'"',description:'"\\""'},Ut=function(e,o,l){const{start:u,end:h}=hc();return{type:"cursor",start:u.offset,end:h.offset-o.length,prefix:e.join(""),suffix:l.join(""),text:fc().replace(o,"")}},kn=function(e){return re(e.join(""))},je="\\",Re={type:"literal",value:"\\",description:'"\\\\"'},xn=/^[\\"]/,Cn={type:"class",value:'[\\\\"]',description:'[\\\\"]'},tt=function(e){return e},En=/^[^"]/,On={type:"class",value:'[^"]',description:'[^"]'},Pn=function(e){const o=e.join("").trim();return o==="null"?re(null):o==="true"?re(!0):o==="false"?re(!1):e.includes(qi)?zc(o):re(/^(-?[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)},Yr={type:"any",description:"any character"},rt="*",it={type:"literal",value:"*",description:'"*"'},Tn=function(){return qi},Vr="\\t",Ln={type:"literal",value:"\\t",description:'"\\\\t"'},Nn=function(){return" "},Kr="\\r",Dn={type:"literal",value:"\\r",description:'"\\\\r"'},Bn=function(){return"\r"},Zr="\\n",jn={type:"literal",value:"\\n",description:'"\\\\n"'},Rn=function(){return`
|
|
634
|
+
`},Un=function(e){return e},Mn=/^[\\():<>"*{}]/,zn={type:"class",value:'[\\\\():<>"*{}]',description:'[\\\\():<>"*{}]'},Xr="<=",In={type:"literal",value:"<=",description:'"<="'},Qn=function(){return"lte"},Gr=">=",Fn={type:"literal",value:">=",description:'">="'},Hn=function(){return"gte"},Jr="<",ei={type:"literal",value:"<",description:'"<"'},qn=function(){return"lt"},ti=">",ri={type:"literal",value:">",description:'">"'},Wn=function(){return"gt"},Yn={type:"other",description:"whitespace"},Vn=/^[ \t\r\n]/,Kn={type:"class",value:"[\\ \\t\\r\\n]",description:"[\\ \\t\\r\\n]"},Zn=function(){return Rc},ii="@kuery-cursor@",Xn={type:"literal",value:"@kuery-cursor@",description:'"@kuery-cursor@"'},Gn=function(){return Uc},si="||",Jn={type:"literal",value:"||",description:'"||"'},ec=function(){U("LuceneOr")},oi="&&",tc={type:"literal",value:"&&",description:'"&&"'},ni=function(){U("LuceneAnd")},ci="+",ai={type:"literal",value:"+",description:'"+"'},li="-",ui={type:"literal",value:"-",description:'"-"'},pi=function(){U("LuceneNot")},di="!",fi={type:"literal",value:"!",description:'"!"'},hi="_exists_",rc={type:"literal",value:"_exists_",description:'"_exists_"'},ic=function(){U("LuceneExists")},gi=function(){U("LuceneRange")},bi="?",vi={type:"literal",value:"?",description:'"?"'},sc=function(){U("LuceneWildcard")},Mt="/",zt={type:"literal",value:"/",description:'"/"'},yi=/^[^\/]/,mi={type:"class",value:"[^/]",description:"[^/]"},oc=function(){U("LuceneRegex")},It="~",Qt={type:"literal",value:"~",description:'"~"'},$e=/^[0-9]/,we={type:"class",value:"[0-9]",description:"[0-9]"},nc=function(){U("LuceneFuzzy")},cc=function(){U("LuceneProximity")},$i="^",wi={type:"literal",value:"^",description:'"^"'},ac=function(){U("LuceneBoost")},lc=function(){return char},uc="=",pc={type:"literal",value:"=",description:'"="'},_i="[",Si={type:"literal",value:"[",description:'"["'},Ai="]",ki={type:"literal",value:"]",description:'"]"'},xi="TO",dc={type:"literal",value:"TO",description:'"TO"'},c=0,w=0,st=[{line:1,column:1,seenCR:!1}],q=0,Ft=[],f=0,ot;if("startRule"in a){if(!(a.startRule in p))throw new Error(`Can't start parsing from rule "`+a.startRule+'".');g=p[a.startRule]}function fc(){return i.substring(w,c)}function hc(){return nt(w,c)}function U(e){throw Ei(e,null,i.substring(w,c),nt(w,c))}function Ci(e){var o=st[e],l,u;if(o)return o;for(l=e-1;!st[l];)l--;for(o=st[l],o={line:o.line,column:o.column,seenCR:o.seenCR};l<e;)u=i.charAt(l),u===`
|
|
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,Yi,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],Yi=T?'"'+ie(T)+'"':"end of input","Expected "+Wi+" but "+Yi+" 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=Vt(),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=Yt(),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=Yt()),e}function Yt(){var e,o,l,u;return e=c,o=Ni(),o!==t?(l=lt(),l!==t?(u=Yt(),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=Vt(),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 Vt(){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(Yr)),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)===Vr?(o=Vr,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=Vt())),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++,Vn.test(i.charAt(c))?(e=i.charAt(c),c++):(e=t,f===0&&b(Kn)),f--,e===t&&f===0&&b(Yn),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(Yr)),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:V}})},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||!V[n.type]?D(V.function.buildNode("and",[]),r):V[n.type].toOpenSearchQuery(n,r,s,i)),Y="@kuery-wildcard@";function Hs(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function qs(n){return n.replace(/[+-=&|><!(){}[\]^"~*?:\\/]/g,"\\$&")}function Ws(n){return n.includes(Y)?{type:"wildcard",value:n}:ye(n)}function Er(n,r){const{value:s}=n,i=s.split(Y).map(Hs).join("[\\s\\S]*");return new RegExp(`^${i}$`).test(r)}function Ys(n){const{value:r}=n;return r.split(Y).join("*")}function Ot(n){const{value:r}=n;return r.split(Y).map(qs).join("*")}function Vs(n){const{value:r}=n;return r.startsWith(Y)&&r.replace(Y,"").length>0}const Ks=Object.freeze(Object.defineProperty({__proto__:null,buildNode:Ws,hasLeadingWildcard:Vs,test:Er,toOpenSearchQuery:Ys,toQueryStringQuery:Ot,wildcardSymbol:Y},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 Zs(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"?ye(n):ve(n),a=typeof r=="string"?ye(r):ve(r),t=ve(s);return{arguments:[i,a,t]}}function Xs(n,r,s={},i={}){const{arguments:[a,t,p]}=n,g=Or(a,r,i!=null&&i.nested?i.nested.path:void 0),v=D(g),_=t!==void 0?D(t):t,A=p.value?"phrase":"best_fields";if(g.value===null)return t.type==="wildcard"?{query_string:{query:Ot(t)}}:{multi_match:{type:A,query:_,lenient:!0}};const S=r?Pt(g,r):[];S&&S.length===0&&S.push({name:D(g),scripted:!1,type:""});const E=t.type==="wildcard"&&_==="*",x=g.type==="wildcard"&&v==="*"||S&&r&&S.length===r.fields.length;return E&&x?{match_all:{}}:{bool:{should:S.reduce((te,F)=>{const H=j=>{var me;return g.type!=="wildcard"||!((me=F.subType)!=null&&me.nested)||i!=null&&i.nested?j:{nested:{path:F.subType.nested.path,query:j,score_mode:"none"}}};if(F.scripted)return[];if(E)return[...te,H({exists:{field:F.name}})];if(t.type==="wildcard")return[...te,H({query_string:{fields:[F.name],query:Ot(t)}})];if(F.type==="date"){const j=s.dateFormatTZ?{time_zone:s.dateFormatTZ}:{};return[...te,H({range:{[F.name]:{gte:_,lte:_,...j}}})]}else{const j=A==="phrase"?"match_phrase":"match";return[...te,H({[j]:{[F.name]:_}})]}},[])||[],minimum_should_match:1}}}const Gs=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:Zs,toOpenSearchQuery:Xs},Symbol.toStringTag,{value:"Module"}));function Js(n){return{arguments:n}}function eo(n,r,s={},i={}){return{bool:{filter:(n.arguments||[]).map(t=>D(t,r,s,i))}}}const to=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:Js,toOpenSearchQuery:eo},Symbol.toStringTag,{value:"Module"}));function ro(n){return{arguments:n}}function io(n,r,s={},i={}){return{bool:{should:(n.arguments||[]).map(t=>D(t,r,s,i)),minimum_should_match:1}}}const so=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:ro,toOpenSearchQuery:io},Symbol.toStringTag,{value:"Module"}));function oo(n){return{arguments:[n]}}function no(n,r,s={},i={}){const[a]=n.arguments;return{bool:{must_not:D(a,r,s,i)}}}const co=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:oo,toOpenSearchQuery:no},Symbol.toStringTag,{value:"Module"}));function ao(n,...r){let s={};for(let i of r)s[i]=n[i];return s}function lo(n,r){const s=ao(r,"gt","lt","gte","lte","format"),i=typeof n=="string"?ye(n):V.literal.buildNode(n),a=Object.entries(s).map(t=>{let[p,g]=t;return V.namedArg.buildNode(p,g)});return{arguments:[i,...a]}}function uo(n,r,s={},i={}){const[a,...t]=n.arguments,p=Or(a,r,i!=null&&i.nested?i.nested.path:void 0),g=r?Pt(p,r):[],v=po(t),_=Object.fromEntries(Object.entries(v).map(([S,E])=>[S,D(E)]));return g&&g.length===0&&g.push({name:D(p),scripted:!1,type:""}),{bool:{should:g.map(S=>{const E=x=>{var L;return p.type!=="wildcard"||!((L=S.subType)!=null&&L.nested)||i.nested?x:{nested:{path:S.subType.nested.path,query:x,score_mode:"none"}}};if(S.scripted)return{};if(S.type==="date"){const x=s.dateFormatTZ?{time_zone:s.dateFormatTZ}:{};return E({range:{[S.name]:{..._,...x}}})}return E({range:{[S.name]:_}})}),minimum_should_match:1}}}function po(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,a)=>(i.type==="namedArg"?s[i.name]=i.value:s[r[a]]=i,s),{})}const fo=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:lo,toOpenSearchQuery:uo},Symbol.toStringTag,{value:"Module"}));function ho(n){return{arguments:[ve(n)]}}function go(n,r,s={},i={}){const{arguments:[a]}=n,t={...a,value:i!=null&&i.nested?`${i.nested.path}.${a.value}`:a.value},p=Ct(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 bo=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:ho,toOpenSearchQuery:go},Symbol.toStringTag,{value:"Module"}));function vo(n,r){return{arguments:[typeof n=="string"?ye(n):ve(n),r]}}function yo(n,r,s={},i={}){var v;const[a,t]=n.arguments,p=D(a),g=(v=i==null?void 0:i.nested)!=null&&v.path?`${i.nested.path}.${p}`:p;return{nested:{path:g,query:D(t,r,s,{...i,nested:{path:g}}),score_mode:"none"}}}const Tt={is:Gs,and:to,or:so,not:co,range:fo,exists:bo,nested:Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:vo,toOpenSearchQuery:yo},Symbol.toStringTag,{value:"Module"}))};function mo(n,...r){const s=Tt[n];if(s===void 0)throw new Error(`Unknown function "${n}"`);return{type:"function",function:n,...s.buildNodeParams(...r)}}function $o(n,r){if(Tt[n]===void 0)throw new Error(`Unknown function "${n}"`);return{type:"function",function:n,arguments:r}}function wo(n,r,s,i){return Tt[n.function].toOpenSearchQuery(n,r,s,i)}const _o=Object.freeze(Object.defineProperty({__proto__:null,buildNode:mo,buildNodeWithArgumentNodes:$o,toOpenSearchQuery:wo},Symbol.toStringTag,{value:"Module"}));function So(n,r){const s=r.type==="literal"?r:V.literal.buildNode(r);return{type:"namedArg",name:n,value:s}}function Ao(n){return D(n.value)}const V={function:_o,literal:Qs,namedArg:Object.freeze(Object.defineProperty({__proto__:null,buildNode:So,toOpenSearchQuery:Ao},Symbol.toStringTag,{value:"Module"})),wildcard:Ks},ko=Y,xo=(n,r)=>"("+(n.arguments||[]).map(i=>pe(i,r)).join(" AND ")+")",Co=(n,r)=>{var{arguments:[s,i,a]}=n;let t="=";i.type==="wildcard"&&(t="");let p=pe(i);a=a.value||typeof p=="string",i.type==="literal"&&a&&(p=`'${p}'`),i.type==="literal"&&!a&&(p=`${p}`);let g=pe(s);return g==null?r&&a?`(${r.filter(v=>v.type==="string").map(v=>`${v.name} ILIKE '%${i.value}%'`).join(" OR ")})`:r&&!a&&(i.value===!0||i.value===!1)?`(${r.filter(v=>v.type==="boolean").map(v=>`${v.name}=${i.value}`).join(" OR ")})`:"":g+t+p},Eo=(n,r)=>"("+(n.arguments||[]).map(i=>pe(i,r)).join(" OR ")+")",Oo=(n,r)=>{const[s]=n.arguments;return"NOT ("+pe(s,r)+")"},Po={gt:">",lt:"<",gte:">=",lte:"<="},To={is:Co,and:xo,or:Eo,not:Oo,range:n=>{const[r,s]=n.arguments;let i=s.value;const a=Po[s.name];let t=pe(i);return i.type==="literal"&&(t=`${t}`),`${r.value} ${a} ${t}`},exists:n=>{const[r]=n.arguments;return`${r.value} IS NOT NULL`},nested:n=>(console.warn("Nested types dont exist in CQL",n),"")},Lo={function:(n,r)=>To[n.function](n,r),literal:n=>n.value,wildcard:n=>{const{value:r}=n;return` LIKE '${r.split(ko).join("%")}'`}},pe=(n,r)=>{const s=Lo[n.type];return s(n,r)},No=Y,Do=n=>({$and:(n.arguments||[]).map(i=>J(i))}),Bo=n=>{const{arguments:[r,s]}=n;let i=J(s);if(s.type==="wildcard"&&s.value==="@kuery-wildcard@")return Pr(n);let t={};return t[J(r)]={$eq:i},t},jo=n=>({$or:(n.arguments||[]).map(s=>J(s))}),Ro=n=>{const[r]=n.arguments;let s={};return s={$ne:J(r)},s},Uo={gt:"$gt",lt:"$lt",gte:"$gte",lte:"$lte"},Mo=n=>{const[r,s]=n.arguments;let i=s.value;const a=Uo[s.name];let t=J(i),p={};return p[r.value]={},p[r.value][a]=t,p},Pr=n=>{const[r]=n.arguments;return{[J(r)]:{$ne:null}}},zo={is:Bo,and:Do,or:jo,not:Ro,range:Mo,exists:Pr,nested:n=>(console.warn("TODO Implement nested search",n),"")},Io={function:n=>zo[n.function](n),literal:n=>n.value,wildcard:n=>{const{value:r}=n;return`/${r.split(No).join(".*")}/`}},J=(n,r)=>{const s=Io[n.type];return s(n,r)},Qo=Object.freeze(Object.defineProperty({__proto__:null,DQLSyntaxError:Cr,doesKueryExpressionHaveLuceneSyntaxError:Fs,fromKueryExpression:Je,fromLiteralExpression:ye,nodeTypes:V,parse:Je,toCql:pe,toDSL:D,toMongo:J,toOpenSearchQuery:D},Symbol.toStringTag,{value:"Module"})),Fo=z`
|
|
637
637
|
:host {
|
|
638
638
|
--dialog-padding: var(--spectric-dialog-padding, 5px);
|
|
639
639
|
--dialog-background:var(--spectric-background,rgb(246, 249, 252));
|
|
@@ -696,17 +696,17 @@ spectric-button{
|
|
|
696
696
|
</div>
|
|
697
697
|
</spectric-panel>
|
|
698
698
|
</dialog>
|
|
699
|
-
`}},d.DialogElement.styles=Fo,ee([y({type:Boolean,reflect:!0})],d.DialogElement.prototype,"open",2),ee([y({type:Boolean,reflect:!0})],d.DialogElement.prototype,"dismissable",2),ee([y({type:Boolean,reflect:!0})],d.DialogElement.prototype,"hideBackdrop",2),ee([y({type:String,reflect:!0})],d.DialogElement.prototype,"title",2),ee([y({type:Boolean,reflect:!0})],d.DialogElement.prototype,"closeOnEscape",2),ee([y({type:Boolean,reflect:!0})],d.DialogElement.prototype,"closeOnOutsideClick",2),ee([He("dialog")],d.DialogElement.prototype,"dialogElement",2),d.DialogElement=ee([R(Lt)],d.DialogElement);var Wo=Object.defineProperty,
|
|
699
|
+
`}},d.DialogElement.styles=Fo,ee([y({type:Boolean,reflect:!0})],d.DialogElement.prototype,"open",2),ee([y({type:Boolean,reflect:!0})],d.DialogElement.prototype,"dismissable",2),ee([y({type:Boolean,reflect:!0})],d.DialogElement.prototype,"hideBackdrop",2),ee([y({type:String,reflect:!0})],d.DialogElement.prototype,"title",2),ee([y({type:Boolean,reflect:!0})],d.DialogElement.prototype,"closeOnEscape",2),ee([y({type:Boolean,reflect:!0})],d.DialogElement.prototype,"closeOnOutsideClick",2),ee([He("dialog")],d.DialogElement.prototype,"dialogElement",2),d.DialogElement=ee([R(Lt)],d.DialogElement);var Wo=Object.defineProperty,Yo=Object.getOwnPropertyDescriptor,Q=(n,r,s,i)=>{for(var a=i>1?void 0:i?Yo(r,s):r,t=n.length-1,p;t>=0;t--)(p=n[t])&&(a=(i?p(r,s,a):p(a))||a);return i&&a&&Wo(r,s,a),a},Tr=(n=>(n.MONGO="toMongo",n.CQL="toCql",n.DSL="toDSL",n.AST="AST",n))(Tr||{});const Lr={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"}},Vo={eq:{value:": ",label:" equals some value"},exists:{value:": *",label:" exists in any form"}},Ko=[{value:": true",label:" value is true"},{value:": false",label:"value is false"}],Zo=Object.fromEntries(Object.entries(Lr).map(([n,r])=>[n,{value:r.value,label:(r.label||"").replace("value","date-time")}]));d.SpectricQuery=class extends N{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=Je(t,{parseCursor:!0,cursorSymbol:"@kuery-cursor@",allowLeadingWildcards:!1});this.autoComplete(p),s=Je(this.value,{allowLeadingWildcards:!1})}catch{return}let i;this.outputLanguage=="AST"?i=s:i=Qo[this.outputLanguage](s,this.fields);let a=new CustomEvent("change",{detail:i});this.dispatchEvent(a)},this.getValuesForField=async(r,s)=>(console.log("getValuesForField isn't set no values returned",r,s),[]),this._selectCompletion=async()=>{if(!this.suggestion)return;let r=this.completions[this.completionIndex],s=this.value.substring(0,r.start)+r.value,i=s.length,a=this.value.substring(r.end);if(r.value.includes(a)?this.value=s:this.value=s+this.value.substring(r.end),this._input.setSelectionRange(i,i),r.onSelect){let 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 a=i.querySelector(".option.active");a&&a.scrollIntoView({block:"nearest"})}),r.key==="Enter"&&this._selectCompletion())},this.uuid=crypto.randomUUID()}createRenderRoot(){return this}async autoComplete(r){if(this.completions=[],r.type!=="cursor")return;let s=[];this.suggestion=r;let{start:i,end:a}=r;for(let t of r.suggestionTypes){if(t=="conjunction"&&r.text.endsWith(" ")&&s.push(...["and ","or "].map(p=>({type:t,value:p,start:a,end:a}))),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:a}]).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(Lr).map(g=>({type:t,...g,start:a,end:a}))):p.type==="string"?p.format==="date-time"?s.push(...Object.values(Zo).map(g=>({type:t,...g,start:a,end:a,onSelect:async()=>{let v=await this.getValuesForField(r.fieldName,r.prefix);v.length===0&&(v=["now-1m","now-1d","now-1M"]);let _,A=We();return await new Promise(S=>{let E=d.DialogElement.display({},k`
|
|
700
700
|
<div class="query-bar-date-quick-select">
|
|
701
|
-
${v.map(
|
|
701
|
+
${v.map(x=>k`<a href="#" @click=${L=>{L.preventDefault(),_=`"${x}"`,S(_),E.open=!1}}>${x}</a>`)}
|
|
702
702
|
</div>
|
|
703
|
-
<spectric-input variant="datetime-local" @change=${
|
|
704
|
-
<spectric-button ${
|
|
705
|
-
`)}),_}}))):s.push(...Object.values(
|
|
706
|
-
<spectric-input style=${`anchor-name:--${this.uuid};`} autocomplete="off" @input=${this._parseQuery} @keydown=${this._handleArrows}></spectric-input>
|
|
703
|
+
<spectric-input variant="datetime-local" @change=${x=>{if(!x.target)return;_=`"${new Date(x.target.value+":00.000Z").toISOString()}"`,A.value.disabled=_===void 0}}></spectric-input>
|
|
704
|
+
<spectric-button ${Ye(A)} .disabled=${!0} @click=${()=>{S(_),E.open=!1}}>Submit</spectric-button>
|
|
705
|
+
`)}),_}}))):s.push(...Object.values(Vo).map(g=>({type:t,...g,start:a,end:a}))):p.type==="boolean"&&s.push(...Ko.map(g=>({type:t,...g,start:a,end:a}))))}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:a},{type:t,value:"false",start:i,end:a});else{console.log(`invoke callback to get values for ${r.fieldName}`);let g=await this.getValuesForField(r.fieldName,r.prefix);(p==null?void 0:p.type)==="string"&&(g=g.map(v=>`"${v}"`)),s.push(...g.map(v=>({type:t,value:v,start:i,end:a})))}}}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 k`
|
|
706
|
+
<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
707
|
<div class="autocomplete" popover style=${`position-anchor: --${this.uuid};`}>
|
|
708
708
|
${this.completions.map((r,s)=>k`<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>`)}
|
|
709
|
-
</div>`}},
|
|
709
|
+
</div>`}},Q([y({type:String,reflect:!0})],d.SpectricQuery.prototype,"placeholder",2),Q([y({type:String,reflect:!0})],d.SpectricQuery.prototype,"value",2),Q([y({type:String,reflect:!0})],d.SpectricQuery.prototype,"outputLanguage",2),Q([Fe()],d.SpectricQuery.prototype,"completions",2),Q([Fe()],d.SpectricQuery.prototype,"completionIndex",2),Q([y({type:Array,reflect:!0})],d.SpectricQuery.prototype,"fields",2),Q([Le(".autocomplete")],d.SpectricQuery.prototype,"_autocomplete",2),Q([He(".autocomplete")],d.SpectricQuery.prototype,"_asyncAutocomplete",2),Q([Le("spectric-input")],d.SpectricQuery.prototype,"_input",2),d.SpectricQuery=Q([R("spectric-query")],d.SpectricQuery);const Nr=z`
|
|
710
710
|
border-color: color-mix(in hsl, var(--panel-color, #0b0b0b), var(--spectric-input-color, #000000) 3%);
|
|
711
711
|
background-color: var(--panel-color,#0b0b0b);
|
|
712
712
|
--spectric-input-color: var(--spectric-background);
|
|
@@ -941,5 +941,5 @@ spectric-button{
|
|
|
941
941
|
</div>
|
|
942
942
|
</div>
|
|
943
943
|
<slot @slotchange=${this._assignSlot} style="display:none"></slot>
|
|
944
|
-
`}},d.SplitView.styles=nn,B([y({type:String})],d.SplitView.prototype,"orientation",2),B([y({type:Number,reflect:!0})],d.SplitView.prototype,"percentage",2),B([y({type:Boolean})],d.SplitView.prototype,"invisible",2),B([y({type:Number,reflect:!0})],d.SplitView.prototype,"min",2),B([y({type:Number,reflect:!0})],d.SplitView.prototype,"max",2),B([y({type:Boolean,reflect:!0})],d.SplitView.prototype,"useSavedState",2),B([Fe()],d.SplitView.prototype,"isDragging",2),B([Fe()],d.SplitView.prototype,"_error",2),B([He(".splitter")],d.SplitView.prototype,"_splitter",2),B([Le("slot[name='panel1']")],d.SplitView.prototype,"_panel1",2),B([Le("slot[name='panel2']")],d.SplitView.prototype,"_panel2",2),d.SplitView=B([R(Mr)],d.SplitView),d.ButtonSizes=mr,d.ButtonVariants=$r,d.CSSPropsControls=rn,d.DialogElementTag=Lt,d.ElementTag=Mr,d.InputVariants=
|
|
944
|
+
`}},d.SplitView.styles=nn,B([y({type:String})],d.SplitView.prototype,"orientation",2),B([y({type:Number,reflect:!0})],d.SplitView.prototype,"percentage",2),B([y({type:Boolean})],d.SplitView.prototype,"invisible",2),B([y({type:Number,reflect:!0})],d.SplitView.prototype,"min",2),B([y({type:Number,reflect:!0})],d.SplitView.prototype,"max",2),B([y({type:Boolean,reflect:!0})],d.SplitView.prototype,"useSavedState",2),B([Fe()],d.SplitView.prototype,"isDragging",2),B([Fe()],d.SplitView.prototype,"_error",2),B([He(".splitter")],d.SplitView.prototype,"_splitter",2),B([Le("slot[name='panel1']")],d.SplitView.prototype,"_panel1",2),B([Le("slot[name='panel2']")],d.SplitView.prototype,"_panel2",2),d.SplitView=B([R(Mr)],d.SplitView),d.ButtonSizes=mr,d.ButtonVariants=$r,d.CSSPropsControls=rn,d.DialogElementTag=Lt,d.ElementTag=Mr,d.InputVariants=xr,d.Orientations=Ur,d.SupportedLanguages=Tr,d.ThemeSelections=sn,d.nodeTypes=V,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
|
945
945
|
//# sourceMappingURL=index.umd.js.map
|