@spectric/ui 0.0.21 → 0.0.22
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/dialog/dialog.d.ts +1 -0
- package/dist/components/pagination/pagination.d.ts +1 -1
- package/dist/components/query_bar/QueryBar.d.ts +30 -10
- package/dist/components/query_bar/dateTimePopup.d.ts +2 -0
- package/dist/components/query_bar/geojsonPopup.d.ts +2 -0
- package/dist/components/query_bar/querylanguage/kuery/functions/geospatial.d.ts +19 -0
- package/dist/components/query_bar/querylanguage/outputTypes/toCQL.d.ts +2 -1
- package/dist/components/query_bar/querylanguage/outputTypes/toMongo.d.ts +6 -1
- package/dist/components/symbols.d.ts +6 -0
- package/dist/components/table/cell.d.ts +1 -1
- package/dist/components/table/table.d.ts +5 -1
- package/dist/custom-elements.json +5 -5
- package/dist/index.d.ts +4 -0
- package/dist/index.es.js +4382 -2795
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +349 -248
- package/dist/index.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +6 -1
- package/src/components/dialog/dialog.css.ts +29 -29
- package/src/components/dialog/dialog.ts +3 -1
- package/src/components/input.ts +49 -39
- package/src/components/pagination/pagination.ts +167 -113
- package/src/components/query_bar/QueryBar.ts +438 -187
- package/src/components/query_bar/dateTimePopup.ts +54 -0
- package/src/components/query_bar/geojsonPopup.ts +44 -0
- package/src/components/query_bar/querylanguage/kuery/ast/_generated_/kuery.js +1836 -2745
- package/src/components/query_bar/querylanguage/kuery/ast/ast.ts +15 -13
- package/src/components/query_bar/querylanguage/kuery/ast/kuery.peg +92 -126
- package/src/components/query_bar/querylanguage/kuery/functions/geospatial.ts +25 -0
- package/src/components/query_bar/querylanguage/kuery/functions/index.ts +9 -7
- package/src/components/query_bar/querylanguage/outputTypes/toCQL.ts +56 -34
- package/src/components/query_bar/querylanguage/outputTypes/toMongo.ts +46 -34
- package/src/components/symbols.ts +6 -0
- package/src/components/table/__tests__/table.spec.ts +2 -2
- package/src/components/table/cell.ts +7 -3
- package/src/components/table/header.ts +3 -2
- package/src/components/table/table.css +4 -2
- package/src/components/table/table.ts +61 -5
- package/src/components/table/virtualBody.ts +8 -3
- package/src/components/tooltip/popover.ts +263 -225
- package/src/stories/Dialog.stories.ts +59 -0
- package/src/stories/QueryBar.stories.ts +46 -37
- package/src/stories/fixtures/data.ts +195 -36
- package/src/stories/table.stories.ts +70 -22
package/dist/index.umd.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
(function(h,
|
|
1
|
+
(function(h,be){typeof exports=="object"&&typeof module<"u"?be(exports):typeof define=="function"&&define.amd?define(["exports"],be):(h=typeof globalThis<"u"?globalThis:h||self,be(h["Spectric-UI"]={}))})(this,function(h){"use strict";/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/var
|
|
5
|
+
*/var ps;const be=globalThis,ur=be.ShadowRoot&&(be.ShadyCSS===void 0||be.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,pr=Symbol(),fi=new WeakMap;let gi=class{constructor(e,r,s){if(this._$cssResult$=!0,s!==pr)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o;const r=this.t;if(ur&&e===void 0){const s=r!==void 0&&r.length===1;s&&(e=fi.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&fi.set(r,e))}return e}toString(){return this.cssText}};const Ds=i=>new gi(typeof i=="string"?i:i+"",void 0,pr),Z=(i,...e)=>{const r=i.length===1?i[0]:e.reduce((s,t,a)=>s+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(t)+i[a+1],i[0]);return new gi(r,i,pr)},Ns=(i,e)=>{if(ur)i.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(const r of e){const s=document.createElement("style"),t=be.litNonce;t!==void 0&&s.setAttribute("nonce",t),s.textContent=r.cssText,i.appendChild(s)}},bi=ur?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let r="";for(const s of e.cssRules)r+=s.cssText;return Ds(r)})(i):i;/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright 2017 Google LLC
|
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/const{is:
|
|
9
|
+
*/const{is:Ms,defineProperty:zs,getOwnPropertyDescriptor:Is,getOwnPropertyNames:Rs,getOwnPropertySymbols:js,getPrototypeOf:Bs}=Object,ye=globalThis,yi=ye.trustedTypes,Us=yi?yi.emptyScript:"",hr=ye.reactiveElementPolyfillSupport,bt=(i,e)=>i,Bt={toAttribute(i,e){switch(e){case Boolean:i=i?Us:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let r=i;switch(e){case Boolean:r=i!==null;break;case Number:r=i===null?null:Number(i);break;case Object:case Array:try{r=JSON.parse(i)}catch{r=null}}return r}},dr=(i,e)=>!Ms(i,e),vi={attribute:!0,type:String,converter:Bt,reflect:!1,hasChanged:dr};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),ye.litPropertyMetadata??(ye.litPropertyMetadata=new WeakMap);class Qe extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,r=vi){if(r.state&&(r.attribute=!1),this._$Ei(),this.elementProperties.set(e,r),!r.noAccessor){const s=Symbol(),t=this.getPropertyDescriptor(e,s,r);t!==void 0&&zs(this.prototype,e,t)}}static getPropertyDescriptor(e,r,s){const{get:t,set:a}=Is(this.prototype,e)??{get(){return this[r]},set(o){this[r]=o}};return{get(){return t==null?void 0:t.call(this)},set(o){const d=t==null?void 0:t.call(this);a.call(this,o),this.requestUpdate(e,d,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??vi}static _$Ei(){if(this.hasOwnProperty(bt("elementProperties")))return;const e=Bs(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(bt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(bt("properties"))){const r=this.properties,s=[...Rs(r),...js(r)];for(const t of s)this.createProperty(t,r[t])}const e=this[Symbol.metadata];if(e!==null){const r=litPropertyMetadata.get(e);if(r!==void 0)for(const[s,t]of r)this.elementProperties.set(s,t)}this._$Eh=new Map;for(const[r,s]of this.elementProperties){const t=this._$Eu(r,s);t!==void 0&&this._$Eh.set(t,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const r=[];if(Array.isArray(e)){const s=new Set(e.flat(1/0).reverse());for(const t of s)r.unshift(bi(t))}else e!==void 0&&r.push(bi(e));return r}static _$Eu(e,r){const s=r.attribute;return s===!1?void 0:typeof s=="string"?s:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(r=>r(this))}addController(e){var r;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((r=e.hostConnected)==null||r.call(e))}removeController(e){var r;(r=this._$EO)==null||r.delete(e)}_$E_(){const e=new Map,r=this.constructor.elementProperties;for(const s of r.keys())this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ns(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(r=>{var s;return(s=r.hostConnected)==null?void 0:s.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(r=>{var s;return(s=r.hostDisconnected)==null?void 0:s.call(r)})}attributeChangedCallback(e,r,s){this._$AK(e,s)}_$EC(e,r){var a;const s=this.constructor.elementProperties.get(e),t=this.constructor._$Eu(e,s);if(t!==void 0&&s.reflect===!0){const o=(((a=s.converter)==null?void 0:a.toAttribute)!==void 0?s.converter:Bt).toAttribute(r,s.type);this._$Em=e,o==null?this.removeAttribute(t):this.setAttribute(t,o),this._$Em=null}}_$AK(e,r){var a;const s=this.constructor,t=s._$Eh.get(e);if(t!==void 0&&this._$Em!==t){const o=s.getPropertyOptions(t),d=typeof o.converter=="function"?{fromAttribute:o.converter}:((a=o.converter)==null?void 0:a.fromAttribute)!==void 0?o.converter:Bt;this._$Em=t,this[t]=d.fromAttribute(r,o.type),this._$Em=null}}requestUpdate(e,r,s){if(e!==void 0){if(s??(s=this.constructor.getPropertyOptions(e)),!(s.hasChanged??dr)(this[e],r))return;this.P(e,r,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,r,s){this._$AL.has(e)||this._$AL.set(e,r),s.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(r){Promise.reject(r)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[a,o]of this._$Ep)this[a]=o;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[a,o]of t)o.wrapped!==!0||this._$AL.has(a)||this[a]===void 0||this.P(a,this[a],o)}let e=!1;const r=this._$AL;try{e=this.shouldUpdate(r),e?(this.willUpdate(r),(s=this._$EO)==null||s.forEach(t=>{var a;return(a=t.hostUpdate)==null?void 0:a.call(t)}),this.update(r)):this._$EU()}catch(t){throw e=!1,this._$EU(),t}e&&this._$AE(r)}willUpdate(e){}_$AE(e){var r;(r=this._$EO)==null||r.forEach(s=>{var t;return(t=s.hostUpdated)==null?void 0:t.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(r=>this._$EC(r,this[r]))),this._$EU()}updated(e){}firstUpdated(e){}}Qe.elementStyles=[],Qe.shadowRootOptions={mode:"open"},Qe[bt("elementProperties")]=new Map,Qe[bt("finalized")]=new Map,hr==null||hr({ReactiveElement:Qe}),(ye.reactiveElementVersions??(ye.reactiveElementVersions=[])).push("2.0.4");/**
|
|
10
10
|
* @license
|
|
11
11
|
* Copyright 2017 Google LLC
|
|
12
12
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
-
*/const
|
|
14
|
-
\f\r]
|
|
15
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
13
|
+
*/const yt=globalThis,Ut=yt.trustedTypes,mi=Ut?Ut.createPolicy("lit-html",{createHTML:i=>i}):void 0,fr="$lit$",ue=`lit$${Math.random().toFixed(9).slice(2)}$`,gr="?"+ue,Hs=`<${gr}>`,Ee=document,vt=()=>Ee.createComment(""),mt=i=>i===null||typeof i!="object"&&typeof i!="function",br=Array.isArray,$i=i=>br(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",yr=`[
|
|
14
|
+
\f\r]`,$t=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_i=/-->/g,wi=/>/g,Ae=RegExp(`>|${yr}(?:([^\\s"'>=/]+)(${yr}*=${yr}*(?:[^
|
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Si=/'/g,xi=/"/g,ki=/^(?:script|style|textarea|title)$/i,Fs=i=>(e,...r)=>({_$litType$:i,strings:e,values:r}),$=Fs(1),ve=Symbol.for("lit-noChange"),M=Symbol.for("lit-nothing"),Ei=new WeakMap,Ce=Ee.createTreeWalker(Ee,129);function Ai(i,e){if(!br(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return mi!==void 0?mi.createHTML(e):e}const Ci=(i,e)=>{const r=i.length-1,s=[];let t,a=e===2?"<svg>":e===3?"<math>":"",o=$t;for(let d=0;d<r;d++){const c=i[d];let b,_,y=-1,C=0;for(;C<c.length&&(o.lastIndex=C,_=o.exec(c),_!==null);)C=o.lastIndex,o===$t?_[1]==="!--"?o=_i:_[1]!==void 0?o=wi:_[2]!==void 0?(ki.test(_[2])&&(t=RegExp("</"+_[2],"g")),o=Ae):_[3]!==void 0&&(o=Ae):o===Ae?_[0]===">"?(o=t??$t,y=-1):_[1]===void 0?y=-2:(y=o.lastIndex-_[2].length,b=_[1],o=_[3]===void 0?Ae:_[3]==='"'?xi:Si):o===xi||o===Si?o=Ae:o===_i||o===wi?o=$t:(o=Ae,t=void 0);const w=o===Ae&&i[d+1].startsWith("/>")?" ":"";a+=o===$t?c+Hs:y>=0?(s.push(b),c.slice(0,y)+fr+c.slice(y)+ue+w):c+ue+(y===-2?d:w)}return[Ai(i,a+(i[r]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),s]};class _t{constructor({strings:e,_$litType$:r},s){let t;this.parts=[];let a=0,o=0;const d=e.length-1,c=this.parts,[b,_]=Ci(e,r);if(this.el=_t.createElement(b,s),Ce.currentNode=this.el.content,r===2||r===3){const y=this.el.content.firstChild;y.replaceWith(...y.childNodes)}for(;(t=Ce.nextNode())!==null&&c.length<d;){if(t.nodeType===1){if(t.hasAttributes())for(const y of t.getAttributeNames())if(y.endsWith(fr)){const C=_[o++],w=t.getAttribute(y).split(ue),S=/([.?@])?(.*)/.exec(C);c.push({type:1,index:a,name:S[2],strings:w,ctor:S[1]==="."?Pi:S[1]==="?"?Ti:S[1]==="@"?Li:wt}),t.removeAttribute(y)}else y.startsWith(ue)&&(c.push({type:6,index:a}),t.removeAttribute(y));if(ki.test(t.tagName)){const y=t.textContent.split(ue),C=y.length-1;if(C>0){t.textContent=Ut?Ut.emptyScript:"";for(let w=0;w<C;w++)t.append(y[w],vt()),Ce.nextNode(),c.push({type:2,index:++a});t.append(y[C],vt())}}}else if(t.nodeType===8)if(t.data===gr)c.push({type:2,index:a});else{let y=-1;for(;(y=t.data.indexOf(ue,y+1))!==-1;)c.push({type:7,index:a}),y+=ue.length-1}a++}}static createElement(e,r){const s=Ee.createElement("template");return s.innerHTML=e,s}}function Oe(i,e,r=i,s){var o,d;if(e===ve)return e;let t=s!==void 0?(o=r._$Co)==null?void 0:o[s]:r._$Cl;const a=mt(e)?void 0:e._$litDirective$;return(t==null?void 0:t.constructor)!==a&&((d=t==null?void 0:t._$AO)==null||d.call(t,!1),a===void 0?t=void 0:(t=new a(i),t._$AT(i,r,s)),s!==void 0?(r._$Co??(r._$Co=[]))[s]=t:r._$Cl=t),t!==void 0&&(e=Oe(i,t._$AS(i,e.values),t,s)),e}let Oi=class{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:r},parts:s}=this._$AD,t=((e==null?void 0:e.creationScope)??Ee).importNode(r,!0);Ce.currentNode=t;let a=Ce.nextNode(),o=0,d=0,c=s[0];for(;c!==void 0;){if(o===c.index){let b;c.type===2?b=new qe(a,a.nextSibling,this,e):c.type===1?b=new c.ctor(a,c.name,c.strings,this,e):c.type===6&&(b=new Di(a,this,e)),this._$AV.push(b),c=s[++d]}o!==(c==null?void 0:c.index)&&(a=Ce.nextNode(),o++)}return Ce.currentNode=Ee,t}p(e){let r=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(e,s,r),r+=s.strings.length-2):s._$AI(e[r])),r++}};class qe{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,r,s,t){this.type=2,this._$AH=M,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=s,this.options=t,this._$Cv=(t==null?void 0:t.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const r=this._$AM;return r!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=Oe(this,e,r),mt(e)?e===M||e==null||e===""?(this._$AH!==M&&this._$AR(),this._$AH=M):e!==this._$AH&&e!==ve&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):$i(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==M&&mt(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ee.createTextNode(e)),this._$AH=e}$(e){var a;const{values:r,_$litType$:s}=e,t=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=_t.createElement(Ai(s.h,s.h[0]),this.options)),s);if(((a=this._$AH)==null?void 0:a._$AD)===t)this._$AH.p(r);else{const o=new Oi(t,this),d=o.u(this.options);o.p(r),this.T(d),this._$AH=o}}_$AC(e){let r=Ei.get(e.strings);return r===void 0&&Ei.set(e.strings,r=new _t(e)),r}k(e){br(this._$AH)||(this._$AH=[],this._$AR());const r=this._$AH;let s,t=0;for(const a of e)t===r.length?r.push(s=new qe(this.O(vt()),this.O(vt()),this,this.options)):s=r[t],s._$AI(a),t++;t<r.length&&(this._$AR(s&&s._$AB.nextSibling,t),r.length=t)}_$AR(e=this._$AA.nextSibling,r){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,r);e&&e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){var r;this._$AM===void 0&&(this._$Cv=e,(r=this._$AP)==null||r.call(this,e))}}class wt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,r,s,t,a){this.type=1,this._$AH=M,this._$AN=void 0,this.element=e,this.name=r,this._$AM=t,this.options=a,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=M}_$AI(e,r=this,s,t){const a=this.strings;let o=!1;if(a===void 0)e=Oe(this,e,r,0),o=!mt(e)||e!==this._$AH&&e!==ve,o&&(this._$AH=e);else{const d=e;let c,b;for(e=a[0],c=0;c<a.length-1;c++)b=Oe(this,d[s+c],r,c),b===ve&&(b=this._$AH[c]),o||(o=!mt(b)||b!==this._$AH[c]),b===M?e=M:e!==M&&(e+=(b??"")+a[c+1]),this._$AH[c]=b}o&&!t&&this.j(e)}j(e){e===M?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class Pi extends wt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===M?void 0:e}}class Ti extends wt{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==M)}}class Li extends wt{constructor(e,r,s,t,a){super(e,r,s,t,a),this.type=5}_$AI(e,r=this){if((e=Oe(this,e,r,0)??M)===ve)return;const s=this._$AH,t=e===M&&s!==M||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,a=e!==M&&(s===M||t);t&&this.element.removeEventListener(this.name,this,s),a&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var r;typeof this._$AH=="function"?this._$AH.call(((r=this.options)==null?void 0:r.host)??this.element,e):this._$AH.handleEvent(e)}}class Di{constructor(e,r,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){Oe(this,e)}}const Qs={M:fr,P:ue,A:gr,C:1,L:Ci,R:Oi,D:$i,V:Oe,I:qe,H:wt,N:Ti,U:Li,B:Pi,F:Di},vr=yt.litHtmlPolyfillSupport;vr==null||vr(_t,qe),(yt.litHtmlVersions??(yt.litHtmlVersions=[])).push("3.2.1");const Ht=(i,e,r)=>{const s=(r==null?void 0:r.renderBefore)??e;let t=s._$litPart$;if(t===void 0){const a=(r==null?void 0:r.renderBefore)??null;s._$litPart$=t=new qe(e.insertBefore(vt(),a),a,void 0,r??{})}return t._$AI(i),t};/**
|
|
16
16
|
* @license
|
|
17
17
|
* Copyright 2017 Google LLC
|
|
18
18
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
-
*/let
|
|
19
|
+
*/let B=class extends Qe{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var r;const e=super.createRenderRoot();return(r=this.renderOptions).renderBefore??(r.renderBefore=e.firstChild),e}update(e){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Ht(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return ve}};B._$litElement$=!0,B.finalized=!0,(ps=globalThis.litElementHydrateSupport)==null||ps.call(globalThis,{LitElement:B});const mr=globalThis.litElementPolyfillSupport;mr==null||mr({LitElement:B}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.1");/**
|
|
20
20
|
* @license
|
|
21
21
|
* Copyright 2017 Google LLC
|
|
22
22
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
-
*/const
|
|
23
|
+
*/const $r={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},St=i=>(...e)=>({_$litDirective$:i,values:e});let Ft=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,s){this._$Ct=e,this._$AM=r,this._$Ci=s}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}};/**
|
|
24
24
|
* @license
|
|
25
25
|
* Copyright 2018 Google LLC
|
|
26
26
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
-
*/const
|
|
27
|
+
*/const Ni="important",qs=" !"+Ni,_r=St(class extends Ft{constructor(i){var e;if(super(i),i.type!==$r.ATTRIBUTE||i.name!=="style"||((e=i.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(i){return Object.keys(i).reduce((e,r)=>{const s=i[r];return s==null?e:e+`${r=r.includes("-")?r:r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`},"")}update(i,[e]){const{style:r}=i.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const s of this.ft)e[s]==null&&(this.ft.delete(s),s.includes("-")?r.removeProperty(s):r[s]=null);for(const s in e){const t=e[s];if(t!=null){this.ft.add(s);const a=typeof t=="string"&&t.endsWith(qs);s.includes("-")||a?r.setProperty(s,a?t.slice(0,-11):t,a?Ni:""):r[s]=t}}return ve}}),Vs=Z`
|
|
28
28
|
:host{
|
|
29
29
|
display: inline-block;
|
|
30
30
|
--text-on-color: var(--spectric-text-on-color, #ffffff);
|
|
@@ -282,72 +282,72 @@ opacity:1
|
|
|
282
282
|
* @license
|
|
283
283
|
* Copyright 2017 Google LLC
|
|
284
284
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
285
|
-
*/const
|
|
285
|
+
*/const I=i=>(e,r)=>{r!==void 0?r.addInitializer(()=>{customElements.define(i,e)}):customElements.define(i,e)};/**
|
|
286
286
|
* @license
|
|
287
287
|
* Copyright 2017 Google LLC
|
|
288
288
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
289
|
-
*/const
|
|
289
|
+
*/const Ws={attribute:!0,type:String,converter:Bt,reflect:!1,hasChanged:dr},Gs=(i=Ws,e,r)=>{const{kind:s,metadata:t}=r;let a=globalThis.litPropertyMetadata.get(t);if(a===void 0&&globalThis.litPropertyMetadata.set(t,a=new Map),a.set(r.name,i),s==="accessor"){const{name:o}=r;return{set(d){const c=e.get.call(this);e.set.call(this,d),this.requestUpdate(o,c,i)},init(d){return d!==void 0&&this.P(o,void 0,i),d}}}if(s==="setter"){const{name:o}=r;return function(d){const c=this[o];e.call(this,d),this.requestUpdate(o,c,i)}}throw Error("Unsupported decorator location: "+s)};function g(i){return(e,r)=>typeof r=="object"?Gs(i,e,r):((s,t,a)=>{const o=t.hasOwnProperty(a);return t.constructor.createProperty(a,o?{...s,wrapped:!0}:s),o?Object.getOwnPropertyDescriptor(t,a):void 0})(i,e,r)}/**
|
|
290
290
|
* @license
|
|
291
291
|
* Copyright 2017 Google LLC
|
|
292
292
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
293
|
-
*/function
|
|
293
|
+
*/function W(i){return g({...i,state:!0,attribute:!1})}/**
|
|
294
294
|
* @license
|
|
295
295
|
* Copyright 2017 Google LLC
|
|
296
296
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
297
|
-
*/function
|
|
297
|
+
*/function Pe(i){return(e,r)=>{const s=typeof e=="function"?e:e[r];Object.assign(s,i)}}/**
|
|
298
298
|
* @license
|
|
299
299
|
* Copyright 2017 Google LLC
|
|
300
300
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
301
|
-
*/const
|
|
301
|
+
*/const Mi=(i,e,r)=>(r.configurable=!0,r.enumerable=!0,Reflect.decorate&&typeof e!="object"&&Object.defineProperty(i,e,r),r);/**
|
|
302
302
|
* @license
|
|
303
303
|
* Copyright 2017 Google LLC
|
|
304
304
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
305
|
-
*/function
|
|
305
|
+
*/function pe(i,e){return(r,s,t)=>{const a=o=>{var d;return((d=o.renderRoot)==null?void 0:d.querySelector(i))??null};return Mi(r,s,{get(){return a(this)}})}}/**
|
|
306
306
|
* @license
|
|
307
307
|
* Copyright 2017 Google LLC
|
|
308
308
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
309
|
-
*/function
|
|
309
|
+
*/function xt(i){return(e,r)=>Mi(e,r,{async get(){var s;return await this.updateComplete,((s=this.renderRoot)==null?void 0:s.querySelector(i))??null}})}let wr=0;const zi=()=>wr;class Ii{constructor(e,r,s,t){this._handler=s,this._type=r,this._handler=s,this._options=t||!1,e instanceof Promise?e.then(a=>{this._handler&&(this._node=a,this._node.addEventListener(this._type,this._handler,this._options))}):typeof e=="function"?(this._node=e(),this._node.addEventListener(this._type,this._handler,this._options)):(this._node=e,this._node.addEventListener(this._type,this._handler,this._options)),wr+=1}dispose(){this._handler&&(this._node&&(wr-=1,this._node.removeEventListener(this._type,this._handler,this._options)),this._node=void 0,this._handler=void 0)}}class ie extends B{constructor(){super(...arguments),this._disposables=new Set,this._isDisposed=!1,this._disposableListeners=[],this._connected=!1}addDisposableListener(e,r,s,t){if(this._disposableListeners.find(o=>o.event===r&&o.target===e&&o.handler===s)){console.warn("Event handler already exists best practice is to add the this in the constructor");return}this._disposableListeners.push({target:e,event:r,handler:s,options:t}),this._connected&&this.registerDisposable(new Ii(e,r,s,t))}registerDisposable(e){if(!e)return e;if(e===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(e),e}connectedCallback(){super.connectedCallback(),this._connected=!0,this._isDisposed=!1,this._disposableListeners.forEach(({target:e,event:r,handler:s,options:t})=>{this.registerDisposable(new Ii(e,r,s,t))})}disconnectedCallback(){super.disconnectedCallback(),this._connected=!1,this._disposables.forEach(e=>{e.dispose()}),this._isDisposed=!0}}var Ys=Object.defineProperty,Zs=Object.getOwnPropertyDescriptor,se=(i,e,r,s)=>{for(var t=s>1?void 0:s?Zs(e,r):e,a=i.length-1,o;a>=0;a--)(o=i[a])&&(t=(s?o(e,r,t):o(t))||t);return s&&t&&Ys(e,r,t),t},Sr=(i=>(i.large="large",i.medium="medium",i.small="small",i.xsmall="xsmall",i.xxsmall="xxsmall",i.tiny="tiny",i))(Sr||{}),xr=(i=>(i.primary="primary",i.secondary="secondary",i.text="text",i))(xr||{});const Js={primary:"spectric-button--primary",secondary:"spectric-button--secondary",text:"spectric-button--text"};h.SpectricButton=class extends ie{constructor(){super(),this.variant="primary",this.disabled=!1,this.size="small",this.label="",this.danger=!1,this.icon=!1,this.tooltipPosition="right",this.addDisposableListener(this,"click",this._onClick,{capture:!0}),this._onClick=this._onClick.bind(this)}_onClick(e){if(!(e instanceof CustomEvent)&&this.disabled){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation();return}}updated(e){this.tooltip&&this.tooltip!==""&&Ht($`<spectric-tooltip slot="tooltip" .text=${this.tooltip} .position=${this.tooltipPosition||"right"}></spectric-tooltip>`,this)}render(){const e=Js[this.variant]||"spectric-button--primary";return $`
|
|
310
310
|
<slot name="tooltip"></slot>
|
|
311
311
|
<button
|
|
312
312
|
type="button"
|
|
313
313
|
?disabled=${this.disabled}
|
|
314
314
|
class=${["spectric-button",`spectric-button-danger--${this.danger||!1}`,`spectric-button--${this.size||"medium"}`,e].join(" ")}
|
|
315
|
-
style=${
|
|
315
|
+
style=${_r({backgroundColor:this.backgroundColor})}
|
|
316
316
|
>
|
|
317
317
|
<span class="animation"></span>
|
|
318
318
|
<slot>${this.label}</slot>
|
|
319
319
|
</button>
|
|
320
|
-
`}},h.SpectricButton.styles=
|
|
320
|
+
`}},h.SpectricButton.styles=Vs,se([g({type:String,reflect:!0})],h.SpectricButton.prototype,"variant",2),se([g({type:Boolean,reflect:!0})],h.SpectricButton.prototype,"disabled",2),se([g({type:String,reflect:!0})],h.SpectricButton.prototype,"backgroundColor",2),se([g({type:String,reflect:!0})],h.SpectricButton.prototype,"size",2),se([g({type:String,reflect:!0})],h.SpectricButton.prototype,"label",2),se([g({type:Boolean,reflect:!0})],h.SpectricButton.prototype,"danger",2),se([g({type:Boolean,reflect:!0})],h.SpectricButton.prototype,"icon",2),se([g({type:String,reflect:!0})],h.SpectricButton.prototype,"tooltip",2),se([g({type:String,reflect:!0})],h.SpectricButton.prototype,"tooltipPosition",2),h.SpectricButton=se([I("spectric-button")],h.SpectricButton);/**
|
|
321
321
|
* @license
|
|
322
322
|
* Copyright 2020 Google LLC
|
|
323
323
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
324
|
-
*/const{I:
|
|
324
|
+
*/const{I:Ks}=Qs,Ri=(i,e)=>(i==null?void 0:i._$litType$)!==void 0,Xs=i=>{var e;return((e=i==null?void 0:i._$litType$)==null?void 0:e.h)!=null},en=i=>i.strings===void 0,ji=()=>document.createComment(""),Te=(i,e,r)=>{var a;const s=i._$AA.parentNode,t=e===void 0?i._$AB:e._$AA;if(r===void 0){const o=s.insertBefore(ji(),t),d=s.insertBefore(ji(),t);r=new Ks(o,d,i,i.options)}else{const o=r._$AB.nextSibling,d=r._$AM,c=d!==i;if(c){let b;(a=r._$AQ)==null||a.call(r,i),r._$AM=i,r._$AP!==void 0&&(b=i._$AU)!==d._$AU&&r._$AP(b)}if(o!==t||c){let b=r._$AA;for(;b!==o;){const _=b.nextSibling;s.insertBefore(b,t),b=_}}}return r},Le=(i,e,r=i)=>(i._$AI(e,r),i),tn={},kr=(i,e=tn)=>i._$AH=e,Er=i=>i._$AH,Ar=i=>{var s;(s=i._$AP)==null||s.call(i,!1,!0);let e=i._$AA;const r=i._$AB.nextSibling;for(;e!==r;){const t=e.nextSibling;e.remove(),e=t}},rn=i=>{i._$AR()};/**
|
|
325
325
|
* @license
|
|
326
326
|
* Copyright 2017 Google LLC
|
|
327
327
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
328
|
-
*/const
|
|
328
|
+
*/const kt=(i,e)=>{var s;const r=i._$AN;if(r===void 0)return!1;for(const t of r)(s=t._$AO)==null||s.call(t,e,!1),kt(t,e);return!0},Qt=i=>{let e,r;do{if((e=i._$AM)===void 0)break;r=e._$AN,r.delete(i),i=e}while((r==null?void 0:r.size)===0)},Bi=i=>{for(let e;e=i._$AM;i=e){let r=e._$AN;if(r===void 0)e._$AN=r=new Set;else if(r.has(i))break;r.add(i),on(e)}};function sn(i){this._$AN!==void 0?(Qt(this),this._$AM=i,Bi(this)):this._$AM=i}function nn(i,e=!1,r=0){const s=this._$AH,t=this._$AN;if(t!==void 0&&t.size!==0)if(e)if(Array.isArray(s))for(let a=r;a<s.length;a++)kt(s[a],!1),Qt(s[a]);else s!=null&&(kt(s,!1),Qt(s));else kt(this,i)}const on=i=>{i.type==$r.CHILD&&(i._$AP??(i._$AP=nn),i._$AQ??(i._$AQ=sn))};class Ui extends Ft{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,r,s){super._$AT(e,r,s),Bi(this),this.isConnected=e._$AU}_$AO(e,r=!0){var s,t;e!==this.isConnected&&(this.isConnected=e,e?(s=this.reconnected)==null||s.call(this):(t=this.disconnected)==null||t.call(this)),r&&(kt(this,e),Qt(this))}setValue(e){if(en(this._$Ct))this._$Ct._$AI(e,this);else{const r=[...this._$Ct._$AH];r[this._$Ci]=e,this._$Ct._$AI(r,this,0)}}disconnected(){}reconnected(){}}/**
|
|
329
329
|
* @license
|
|
330
330
|
* Copyright 2020 Google LLC
|
|
331
331
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
332
|
-
*/const
|
|
332
|
+
*/const Ve=()=>new an;let an=class{};const Cr=new WeakMap,We=St(class extends Ui{render(i){return M}update(i,[e]){var s;const r=e!==this.Y;return r&&this.Y!==void 0&&this.rt(void 0),(r||this.lt!==this.ct)&&(this.Y=e,this.ht=(s=i.options)==null?void 0:s.host,this.rt(this.ct=i.element)),M}rt(i){if(this.isConnected||(i=void 0),typeof this.Y=="function"){const e=this.ht??globalThis;let r=Cr.get(e);r===void 0&&(r=new WeakMap,Cr.set(e,r)),r.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),r.set(this.Y,i),i!==void 0&&this.Y.call(this.ht,i)}else this.Y.value=i}get lt(){var i,e;return typeof this.Y=="function"?(i=Cr.get(this.ht??globalThis))==null?void 0:i.get(this.Y):(e=this.Y)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),Or=class{constructor(e){return this.buffer=e,this.u8=new Uint8Array(e),new Proxy(this,{get(r,s){return r[s]?r[s]:r.getBit(s)}})}getBit(e){var r=this.u8[e>>3],s=e&7;return r>>7-s&1}setBit(e,r){var s=e&7;r?this.u8[e>>3]|=128>>s:this.u8[e>>3]&=~(128>>s)}get length(){return this.u8.byteLength*8}set(e,r){for(let s=r||0,t=0,a=e.length;t<a;s++,t++)this.setBit(s,e[t])}subarray(e,r){let s=[];e=e||0,r=r||this.length,r=r>this.length?this.length:r;for(let t=e;t<r;t++)s.push(this.getBit(t));return s}},Hi=(i,e)=>{let r;return(...s)=>{clearTimeout(r),r=window.setTimeout(()=>i.apply(void 0,s),e)}},Et=i=>{var e;return(...r)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{i.apply(void 0,r)})}};var ln=Object.defineProperty,cn=Object.getOwnPropertyDescriptor,De=(i,e,r,s)=>{for(var t=s>1?void 0:s?cn(e,r):e,a=i.length-1,o;a>=0;a--)(o=i[a])&&(t=(s?o(e,r,t):o(t))||t);return s&&t&&ln(e,r,t),t};const un=["mousemove","click","dblclick","mousedown","mouseup","contextmenu"],qt={width:200,height:200},Vt={width:10,height:10};h.BitDisplayCanvas=class extends ie{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:Ve(),canvas:Ve(),scrollDiv:Ve()},this.color="#000000",this.onThemeChange=()=>{let s=getComputedStyle(this);this.color!=s.color&&(this.color=s.color,this.paint())},this.onResize=()=>{this.calculateViewport()},this.handleScroll=()=>{if(!this.refs.viewport.value)return;const s=this.getPxPerBit();this.yStart=this.refs.viewport.value.scrollTop?Math.floor(this.refs.viewport.value.scrollTop/s)+1:0,this.xStart=this.refs.viewport.value.scrollLeft?Math.floor(this.refs.viewport.value.scrollLeft/s)+1:0,this.paint()};let e=new ResizeObserver(this.onResize);e.dispose=()=>{this.resizeObserver.disconnect()},this.resizeObserver=e,this.addDisposableListener(document.body,"theme-change",this.onThemeChange);var r={};un.forEach(s=>{this.addDisposableListener(this._canvas,s,Et(async t=>{t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault();var a=await this._canvas;let o=a.getBoundingClientRect(),d={x:Math.floor(Math.abs(t.clientX-o.left)),y:Math.floor(Math.abs(t.clientY-o.top))},c=this.canvasPositionToBit(d);if(s==="mousemove"&&r[s]==c)return;r[s]=c;let b="bit"+String(s).charAt(0).toUpperCase()+String(s).slice(1);if(c!=-1){let _=new CustomEvent(b,{detail:{bitIndex:c,position:d,nativeEvent:t}});this.dispatchEvent(_)}}))})}connectedCallback(){this.onResize(),super.connectedCallback(),this.registerDisposable(this.resizeObserver),this.resizeObserver.observe(this)}updated(e){e.has("arrayBuffer")&&this.arrayBuffer&&(this._bitArray=new Or(this.arrayBuffer));const r=["arrayBuffer","scale","frameWidth","width","height"];for(const s of r)if(e.has(s)){this.paint();return}}canvasPositionToBit(e){let r=Math.floor(e.x/this.scale),s=Math.floor(e.y/this.scale);return r>this.frameWidth-1?-1:this.yStart*this.frameWidth+this.xStart+(s*this.frameWidth+r)}paint(){if(!this.refs.canvas.value||!this._bitArray)return;const{frameWidth:e,_bitArray:r}=this;if(e<=0)return;this.calculateViewport();const{width:s=qt.width,height:t=qt.height}=this,a=this.getPxPerBit(),o=this.refs.canvas.value.getContext("2d");if(!o)return;this.state.scale!=a&&(o.reset(),o.scale(a,a));let d=getComputedStyle(this);o.fillStyle=d.color,o.clearRect(0,0,s,t);let c=0;for(let b=this.yStart*e+this.xStart,_=r.length;b<_;b++){let y=b%e-this.xStart;if(!(y<0)){if(Math.floor(y*a)>s){c++,b=c*e+this.yStart*e+this.xStart-1;continue}if(Math.floor(c*a)>t)break;r.getBit(b)===1&&o.fillRect(y,c,1,1),(b+1)%e===0&&b>=e-1&&c++}}}getPxPerBit(){return this.scale>0?this.scale:1}calculateViewport(){const{frameWidth:e,_bitArray:r}=this;if(this.refs.scrollDiv.value){var s=this.getPxPerBit();const t=r.length/e*s,a=e*s,o=this.refs.scrollDiv.value;o.style.width=a+"px",o.style.height=t+"px"}}render(){const{height:e=qt.height,width:r=qt.width}=this;return $`
|
|
333
333
|
<div
|
|
334
334
|
id="viewport"
|
|
335
|
-
${
|
|
335
|
+
${We(this.refs.viewport)}
|
|
336
336
|
@scroll=${this.handleScroll}
|
|
337
|
-
style=${`width:${
|
|
337
|
+
style=${`width:${r+Vt.width}px;height:${e+Vt.height}px;overflow:auto;position:relative`}
|
|
338
338
|
>
|
|
339
339
|
<div
|
|
340
340
|
id="fakescrolldiv"
|
|
341
|
-
${
|
|
341
|
+
${We(this.refs.scrollDiv)}
|
|
342
342
|
>
|
|
343
343
|
</div>
|
|
344
344
|
</div>
|
|
345
345
|
<canvas
|
|
346
|
-
${
|
|
347
|
-
width=${
|
|
346
|
+
${We(this.refs.canvas)}
|
|
347
|
+
width=${r}
|
|
348
348
|
height=${e}
|
|
349
349
|
></canvas>
|
|
350
|
-
`}},h.BitDisplayCanvas.styles=
|
|
350
|
+
`}},h.BitDisplayCanvas.styles=Z`
|
|
351
351
|
:host{
|
|
352
352
|
position: relative;
|
|
353
353
|
--border-radius: var(--spectric-border-radius,4em);
|
|
@@ -371,8 +371,8 @@ opacity:1
|
|
|
371
371
|
background-color:var(--background-color);
|
|
372
372
|
}
|
|
373
373
|
::-webkit-scrollbar {
|
|
374
|
-
height: ${
|
|
375
|
-
width: ${
|
|
374
|
+
height: ${Vt.height}px;
|
|
375
|
+
width: ${Vt.width}px;
|
|
376
376
|
|
|
377
377
|
}
|
|
378
378
|
|
|
@@ -443,7 +443,7 @@ opacity:1
|
|
|
443
443
|
|
|
444
444
|
}
|
|
445
445
|
|
|
446
|
-
`,
|
|
446
|
+
`,De([g({type:Object,attribute:!1})],h.BitDisplayCanvas.prototype,"arrayBuffer",2),De([g({type:Number})],h.BitDisplayCanvas.prototype,"frameWidth",2),De([g({type:Number})],h.BitDisplayCanvas.prototype,"scale",2),De([g({type:Number})],h.BitDisplayCanvas.prototype,"width",2),De([g({type:Number})],h.BitDisplayCanvas.prototype,"height",2),De([xt("canvas")],h.BitDisplayCanvas.prototype,"_canvas",2),h.BitDisplayCanvas=De([I("spectric-bit-display")],h.BitDisplayCanvas);const pn=Z`.spectric-header {
|
|
447
447
|
display: flex;
|
|
448
448
|
justify-content: space-between;
|
|
449
449
|
align-items: center;
|
|
@@ -478,7 +478,7 @@ opacity:1
|
|
|
478
478
|
color: #333;
|
|
479
479
|
font-size: 14px;
|
|
480
480
|
}
|
|
481
|
-
`;var
|
|
481
|
+
`;var hn=Object.defineProperty,dn=Object.getOwnPropertyDescriptor,Wt=(i,e,r,s)=>{for(var t=s>1?void 0:s?dn(e,r):e,a=i.length-1,o;a>=0;a--)(o=i[a])&&(t=(s?o(e,r,t):o(t))||t);return s&&t&&hn(e,r,t),t};h.Header=class extends B{constructor(){super(...arguments),this.showCreateAccount=!1,this.showLoginButton=!1,this.username="",this.onLogout=()=>{const e={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("logout",e))},this.onLogin=()=>{const e={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("login",e))},this.onCreateAccount=()=>{const e={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("createAccount",e))}}render(){return $`
|
|
482
482
|
<header>
|
|
483
483
|
<div class="spectric-header">
|
|
484
484
|
<div style="flex-grow:1;">
|
|
@@ -486,10 +486,10 @@ opacity:1
|
|
|
486
486
|
<h1><slot name="name"></slot></h1>
|
|
487
487
|
<slot name="center"></slot>
|
|
488
488
|
</div>
|
|
489
|
-
${this.showLoginButton!==!1
|
|
489
|
+
${this.showLoginButton!==!1?$`
|
|
490
490
|
<div>
|
|
491
|
-
${this.username&&this.username!==""
|
|
492
|
-
${this.showCreateAccount!==!1
|
|
491
|
+
${this.username&&this.username!==""?$`<spectric-button variant="secondary" size="small" @click=${this.onLogout}>Log out</spectric-button>`:$`
|
|
492
|
+
${this.showCreateAccount!==!1?$`<spectric-button variant="text" size="small" @click=${this.onCreateAccount}>Sign up</spectric-button>`:null}
|
|
493
493
|
<spectric-button variant="primary" size="small" @click=${this.onLogin}>Log in</spectric-button>`}
|
|
494
494
|
|
|
495
495
|
|
|
@@ -497,16 +497,16 @@ opacity:1
|
|
|
497
497
|
<slot name="end"></slot>
|
|
498
498
|
</div>
|
|
499
499
|
</header>
|
|
500
|
-
`}},h.Header.styles=
|
|
501
|
-
<header style=${
|
|
500
|
+
`}},h.Header.styles=pn,Wt([g({type:Boolean,reflect:!0})],h.Header.prototype,"showCreateAccount",2),Wt([g({type:Boolean,reflect:!0})],h.Header.prototype,"showLoginButton",2),Wt([g({type:String,reflect:!0})],h.Header.prototype,"username",2),h.Header=Wt([I("spectric-header")],h.Header);var fn=Object.defineProperty,gn=Object.getOwnPropertyDescriptor,Ge=(i,e,r,s)=>{for(var t=s>1?void 0:s?gn(e,r):e,a=i.length-1,o;a>=0;a--)(o=i[a])&&(t=(s?o(e,r,t):o(t))||t);return s&&t&&fn(e,r,t),t};const bn={display:"flex",alignItems:"center",backgroundColor:"black",color:"white",textAlign:"center"};let Ne=class extends B{constructor(){super(...arguments),this.dismissable=!1,this.text="",this.bannerId="",this.headerStyle={},this._dismissed=!1,this.onDismiss=i=>{i.preventDefault(),i.stopPropagation();const e={bubbles:!0,composed:!0};this._dismissed=!0;let{bannerId:r,text:s,headerStyle:t,dismissable:a}=this;this.dispatchEvent(new CustomEvent("bannerDismissed",{detail:{bannerId:r,text:s,headerStyle:t,dismissable:a},...e}))}}render(){if(!this._dismissed)return $`
|
|
501
|
+
<header style=${_r({...bn,...this.headerStyle})}>
|
|
502
502
|
<div style="flex-grow:1">
|
|
503
503
|
<slot name="text">${this.text}</slot><slot></slot>
|
|
504
504
|
</div>
|
|
505
|
-
${this.dismissable
|
|
505
|
+
${this.dismissable?$`<spectric-button size="small" @click=${this.onDismiss} icon
|
|
506
506
|
>X</spectric-button
|
|
507
507
|
>`:null}
|
|
508
508
|
</header>
|
|
509
|
-
`}};
|
|
509
|
+
`}};Ge([g({type:Boolean,reflect:!0})],Ne.prototype,"dismissable",2),Ge([g({type:String,reflect:!0})],Ne.prototype,"text",2),Ge([g({type:String,reflect:!0})],Ne.prototype,"bannerId",2),Ge([g({type:Object})],Ne.prototype,"headerStyle",2),Ge([g({state:!0,type:Boolean,attribute:!1})],Ne.prototype,"_dismissed",2),Ne=Ge([I("spectric-banner")],Ne);const yn=Z`
|
|
510
510
|
|
|
511
511
|
:host {
|
|
512
512
|
height:100vh;
|
|
@@ -666,33 +666,34 @@ article{
|
|
|
666
666
|
* @license
|
|
667
667
|
* Copyright 2018 Google LLC
|
|
668
668
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
669
|
-
*/const
|
|
669
|
+
*/const Pr=i=>i??M;class Tr extends Ui{constructor(){super(...arguments),this.prevData={}}render(e){return M}update(e,[r]){var s;this.element!==e.element&&(this.element=e.element),this.host=((s=e.options)==null?void 0:s.host)||this.element,this.apply(r),this.groom(r),this.prevData={...r}}apply(e){if(!e)return;const{element:r}=this;for(const s in e){const t=e[s];r[s]!==t&&(r[s]=t)}}groom(e){const{prevData:r,element:s}=this;if(r)for(const t in r)(!e||!(t in e)&&s[t]===r[t])&&(s[t]=void 0)}}const Me=St(Tr);var Lr=(i=>(i.None="none",i.Uscui="us.cui",i.Usclassified="us.classified",i.Usunclassified="us.unclassified",i.Usconfidential="us.confidential",i.Ussecret="us.secret",i.Ustopsecret="us.topsecret",i.UstopsecretSi="us.topsecret.si",i.Uknotset="uk.notset",i.Ukofficial="uk.official",i.Uksecret="uk.secret",i.Uktopsecret="uk.topsecret",i.Caprotected_a="ca.protected_a",i.Caprotected_b="ca.protected_b",i.Caprotected_c="ca.protected_c",i.Caconfidential="ca.confidential",i.Casecret="ca.secret",i.Catopsecret="ca.topsecret",i.Auunofficial="au.unofficial",i.Auofficial="au.official",i.Auofficialsensitive="au.officialsensitive",i.Auconfidential="au.confidential",i.Ausecret="au.secret",i.Autopsecret="au.topsecret",i))(Lr||{});const Gt={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 vn=Object.defineProperty,mn=Object.getOwnPropertyDescriptor,ne=(i,e,r,s)=>{for(var t=s>1?void 0:s?mn(e,r):e,a=i.length-1,o;a>=0;a--)(o=i[a])&&(t=(s?o(e,r,t):o(t))||t);return s&&t&&vn(e,r,t),t};h.SpectricPage=class extends B{constructor(){super(...arguments),this.showHeader=!0,this.headerSticky=!0,this.classificationLevel=Lr.None,this.classificationText="",this.notifications=[],this.showCreateAccount=!1,this.showLoginButton=!0,this.username=""}render(){this.classificationLevel&&!Gt[this.classificationLevel]&&(console.warn("Unknown classification",this.classificationLevel),this.classificationLevel=Lr.None);const e=this.classificationLevel?this.classificationText||Gt[this.classificationLevel].content:"",r=this.showHeader?$`<spectric-header ?showCreateAccount=${this.showCreateAccount} .showLoginButton=${this.showLoginButton} username=${Pr(this.username)}>
|
|
670
670
|
<slot name="branding" slot="branding"></slot>
|
|
671
671
|
<slot name="name" slot="name"></slot>
|
|
672
672
|
<slot name="center" slot="center"></slot>
|
|
673
673
|
<slot name="end" slot="end"></slot>
|
|
674
|
-
</spectric-header>`:null;return
|
|
675
|
-
${this.classificationLevel&&e
|
|
674
|
+
</spectric-header>`:null;return $`
|
|
675
|
+
${this.classificationLevel&&e?$`
|
|
676
676
|
<!-- Classification Banner -->
|
|
677
|
-
<spectric-banner ${
|
|
677
|
+
<spectric-banner ${Me({text:e,headerStyle:Gt[this.classificationLevel]})}></spectric-banner>
|
|
678
678
|
`:null}
|
|
679
|
-
<spectric-theme theme=${
|
|
680
|
-
${this.notifications?this.notifications.map(
|
|
681
|
-
${this.headerSticky?
|
|
679
|
+
<spectric-theme theme=${Pr(this.theme)}>
|
|
680
|
+
${this.notifications?this.notifications.map(s=>$`<spectric-banner ${Me(s)} ></spectric-banner>`):null}
|
|
681
|
+
${this.headerSticky?r:null}
|
|
682
682
|
<article>
|
|
683
|
-
${this.headerSticky?null:
|
|
683
|
+
${this.headerSticky?null:r}
|
|
684
684
|
<section class="spectric-page">
|
|
685
685
|
<slot name="content"></slot>
|
|
686
686
|
<slot></slot>
|
|
687
687
|
</section>
|
|
688
688
|
</article>
|
|
689
689
|
</spectric-theme>
|
|
690
|
-
${this.classificationLevel&&e
|
|
690
|
+
${this.classificationLevel&&e?$`<spectric-banner ${Me({text:e,headerStyle:Gt[this.classificationLevel]})}></spectric-banner>`:null}
|
|
691
691
|
|
|
692
|
-
`}},h.SpectricPage.styles=
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
692
|
+
`}},h.SpectricPage.styles=yn,ne([g({type:Boolean,reflect:!0})],h.SpectricPage.prototype,"showHeader",2),ne([g({type:Boolean,reflect:!0})],h.SpectricPage.prototype,"headerSticky",2),ne([g({type:String,reflect:!0})],h.SpectricPage.prototype,"classificationLevel",2),ne([g({type:String,reflect:!0})],h.SpectricPage.prototype,"classificationText",2),ne([g({type:Array,reflect:!0})],h.SpectricPage.prototype,"notifications",2),ne([g({type:Boolean,reflect:!0})],h.SpectricPage.prototype,"showCreateAccount",2),ne([g({type:Boolean,reflect:!0})],h.SpectricPage.prototype,"showLoginButton",2),ne([g({type:String,reflect:!0})],h.SpectricPage.prototype,"username",2),ne([g({type:String,reflect:!0})],h.SpectricPage.prototype,"theme",2),h.SpectricPage=ne([I("spectric-page")],h.SpectricPage);var $n=Object.defineProperty,_n=Object.getOwnPropertyDescriptor,R=(i,e,r,s)=>{for(var t=s>1?void 0:s?_n(e,r):e,a=i.length-1,o;a>=0;a--)(o=i[a])&&(t=(s?o(e,r,t):o(t))||t);return s&&t&&$n(e,r,t),t},Dr=(i=>(i.Text="text",i.TextArea="text-area",i.number="number",i.color="color",i.date="date",i.datePopup="popup-date",i.datetime="datetime-local",i.email="email",i.file="file",i.hidden="hidden",i.password="password",i.checkbox="checkbox",i.range="range",i))(Dr||{});h.SpectricInput=class extends B{constructor(){super(...arguments),this.checked=!1,this.files=null,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="off",this._handleInput=({target:e})=>{const r=e;this.variant=="file"?this.files=r.files:this.value=r.value,this.invalid=!r.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(e){const r=this._value;this._value=e,this.requestUpdate("value",r),this._input&&(this._input.value=String(e))}blur(){this._input&&this._input.blur()}focus(e){this._input&&(this._input.blur(),this._input.focus(e))}setSelectionRange(e,r,s="none"){this._input&&this._input.setSelectionRange(e,r,s)}updated(e){e.has("checked")&&e.get("checked")!==void 0&&this.dispatchEvent(new Event("change",{bubbles:!0}))}_handleChange(e){e.stopPropagation(),this.variant==="file"?this.files=e.target.files:this.value=e.target.value,this.dispatchEvent(new Event("change",{bubbles:!0}))}render(){const e=$`<spectric-calendar
|
|
693
|
+
.popup=${this.variant==="popup-date"}
|
|
694
|
+
@select=${r=>{var s;this.value=r.detail.toISOString(),(s=this.querySelector("spectric-popover"))==null||s.hidePopover()}}
|
|
695
|
+
>
|
|
696
|
+
</spectric-calendar>`;switch(this.variant){case"text":case"password":case"number":case"email":case"date":case"popup-date":case"datetime-local":case"file":case"range":return $`
|
|
696
697
|
<div class="inputWrapper">
|
|
697
698
|
<div class="text-input__label-helper-wrapper">
|
|
698
699
|
<div class="--text-input__label-wrapper">
|
|
@@ -708,21 +709,21 @@ article{
|
|
|
708
709
|
?disabled="${this.disabled}"
|
|
709
710
|
aria-describedby="helper-text"
|
|
710
711
|
id="input"
|
|
711
|
-
name="${
|
|
712
|
-
pattern="${
|
|
713
|
-
placeholder="${
|
|
714
|
-
autocomplete="${
|
|
712
|
+
name="${Ye(this.name)}"
|
|
713
|
+
pattern="${Ye(this.pattern)}"
|
|
714
|
+
placeholder="${Ye(this.placeholder)}"
|
|
715
|
+
autocomplete="${Ye(this.autocomplete)}"
|
|
715
716
|
?readonly="${this.readonly}"
|
|
716
717
|
?required="${this.required}"
|
|
717
|
-
type="${
|
|
718
|
+
type="${Ye(this.variant!=="password"?this.variant!=="date"?this.variant:"text":this._showPassword?"text":"password")}"
|
|
718
719
|
.value="${this._value}"
|
|
719
|
-
maxlength="${
|
|
720
|
+
maxlength="${Ye(this.maxCount>0?this.maxCount:void 0)}"
|
|
720
721
|
@input="${this._handleInput}"
|
|
721
722
|
@change=${this._handleChange}
|
|
722
723
|
/>
|
|
723
724
|
|
|
724
|
-
|
|
725
|
-
${this.variant==="password"&&this.showPasswordVisibilityToggle
|
|
725
|
+
${this.variant==="popup-date"?e:null}
|
|
726
|
+
${this.variant==="password"&&this.showPasswordVisibilityToggle?$`
|
|
726
727
|
<spectric-button
|
|
727
728
|
icon
|
|
728
729
|
class="input-button-right"
|
|
@@ -745,7 +746,7 @@ article{
|
|
|
745
746
|
</div>
|
|
746
747
|
</div>
|
|
747
748
|
</div>
|
|
748
|
-
`;case"color":return
|
|
749
|
+
`;case"color":return $`<div class="inputWrapper">
|
|
749
750
|
<div class="text-input__label-helper-wrapper">
|
|
750
751
|
<div class="--text-input__label-wrapper">
|
|
751
752
|
${this.label} ${this.maxCount>0&&this._value?`${this._value.length}/${this.maxCount}`:null}
|
|
@@ -755,8 +756,8 @@ article{
|
|
|
755
756
|
<div ?data-invalid="${this.invalid}" class="inputContainer">
|
|
756
757
|
<input type="hidden" .value=${String(this.value)} > </input>
|
|
757
758
|
<spectric-colorpicker
|
|
758
|
-
@cancel=${
|
|
759
|
-
@change=${
|
|
759
|
+
@cancel=${r=>{this.value=r.target.value}}
|
|
760
|
+
@change=${r=>{r.stopPropagation(),this.value=r.target.value,this._handleChange(r)}} .value=${String(this.value)}></spectric-colorpicker>
|
|
760
761
|
</div>
|
|
761
762
|
<div
|
|
762
763
|
id="helper-text"
|
|
@@ -766,7 +767,7 @@ article{
|
|
|
766
767
|
</div>
|
|
767
768
|
|
|
768
769
|
</div>
|
|
769
|
-
</div>`;case"hidden":return
|
|
770
|
+
</div>`;case"hidden":return $`<input type="hidden" />`;case"checkbox":return $`
|
|
770
771
|
<div class="checkbox">
|
|
771
772
|
<spectric-button
|
|
772
773
|
.tooltip=${this.helperText}
|
|
@@ -775,101 +776,72 @@ article{
|
|
|
775
776
|
${this.label}
|
|
776
777
|
</div>
|
|
777
778
|
</label>
|
|
778
|
-
`}return`Not yet implemented ${this.variant}`}},
|
|
779
|
-
`);super(
|
|
780
|
-
|
|
781
|
-
`?(a.seenCR||a.line++,a.column=1,a.seenCR=!1):u==="\r"||u==="\u2028"||u==="\u2029"?(a.line++,a.column=1,a.seenCR=!0):(a.column++,a.seenCR=!1),p++;return zt[r]=a,a}function Bt(r,a){var p=ks(r),u=ks(a);return{start:{offset:r,line:p.line,column:p.column},end:{offset:a,line:u.line,column:u.column}}}function m(r){l<ie||(l>ie&&(ie=l,Ir=[]),Ir.push(r))}function Ps(r,a,p,u){function b(L){var N=1;for(L.sort(function(be,Z){return be.description<Z.description?-1:be.description>Z.description?1:0});N<L.length;)L[N-1]===L[N]?L.splice(N,1):N++}function S(L,N){function be(bc){function Ft(ae){return ae.charCodeAt(0).toString(16).toUpperCase()}return bc.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(ae){return"\\x0"+Ft(ae)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(ae){return"\\x"+Ft(ae)}).replace(/[\u0100-\u0FFF]/g,function(ae){return"\\u0"+Ft(ae)}).replace(/[\u1000-\uFFFF]/g,function(ae){return"\\u"+Ft(ae)})}var Z=new Array(L.length),Vs,Ys,gt;for(gt=0;gt<L.length;gt++)Z[gt]=L[gt].description;return Vs=L.length>1?Z.slice(0,-1).join(", ")+" or "+Z[L.length-1]:Z[0],Ys=N?'"'+be(N)+'"':"end of input","Expected "+Vs+" but "+Ys+" found."}return a!==null&&b(a),new e(r!==null?r:S(a,p),a,p,u)}function Ts(){var r,a,p,u;for(r=l,a=[],p=_();p!==t;)a.push(p),p=_();return a!==t?(p=Mt(),p===t&&(p=null),p!==t?(u=Ut(),u!==t?(A=r,a=d(p,u),r=a):(l=r,r=t)):(l=r,r=t)):(l=r,r=t),r}function Mt(){var r,a,p,u;return r=l,A=l,a=y(),a?a=void 0:a=t,a!==t?(p=Jl(),p!==t?(a=[a,p],r=a):(l=r,r=t)):(l=r,r=t),r===t&&(r=l,a=Ur(),a!==t?(p=jt(),p!==t?(u=Mt(),u!==t?(A=r,a=C(a,u),r=a):(l=r,r=t)):(l=r,r=t)):(l=r,r=t),r===t&&(r=Ur())),r}function Ur(){var r,a,p,u;return r=l,a=Os(),a!==t?(p=Rt(),p!==t?(u=Ur(),u!==t?(A=r,a=$(a,u),r=a):(l=r,r=t)):(l=r,r=t)):(l=r,r=t),r===t&&(r=Os()),r}function Os(){var r,a,p;return r=l,a=qr(),a!==t?(p=Ds(),p!==t?(A=r,a=E(p),r=a):(l=r,r=t)):(l=r,r=t),r===t&&(r=Ds()),r}function Ds(){var r,a,p,u,b,S;if(r=l,i.charCodeAt(l)===40?(a=x,l++):(a=t,g===0&&m(k)),a!==t){for(p=[],u=_();u!==t;)p.push(u),u=_();p!==t?(u=Mt(),u!==t?(b=Ut(),b!==t?(i.charCodeAt(l)===41?(S=D,l++):(S=t,g===0&&m(I)),S!==t?(A=r,a=H(u,b),r=a):(l=r,r=t)):(l=r,r=t)):(l=r,r=t)):(l=r,r=t)}else l=r,r=t;return r===t&&(r=Ql()),r}function Ql(){var r,a,p,u,b,S,L,N,be,Z;if(r=l,a=Hr(),a!==t){for(p=[],u=_();u!==t;)p.push(u),u=_();if(p!==t)if(i.charCodeAt(l)===58?(u=re,l++):(u=t,g===0&&m(W)),u!==t){for(b=[],S=_();S!==t;)b.push(S),S=_();if(b!==t)if(i.charCodeAt(l)===123?(S=Qe,l++):(S=t,g===0&&m(Dr)),S!==t){for(L=[],N=_();N!==t;)L.push(N),N=_();L!==t?(N=Mt(),N!==t?(be=Ut(),be!==t?(i.charCodeAt(l)===125?(Z=Lr,l++):(Z=t,g===0&&m(zr)),Z!==t?(A=r,a=ja(a,N,be),r=a):(l=r,r=t)):(l=r,r=t)):(l=r,r=t)):(l=r,r=t)}else l=r,r=t;else l=r,r=t}else l=r,r=t;else l=r,r=t}else l=r,r=t;return r===t&&(r=ql()),r}function ql(){var r;return r=Wl(),r===t&&(r=Vl(),r===t&&(r=Yl())),r}function Hr(){var r;return g++,r=Wr(),g--,r===t&&g===0&&m(Ra),r}function Wl(){var r,a,p,u,b,S;if(r=l,a=Hr(),a!==t){for(p=[],u=_();u!==t;)p.push(u),u=_();if(p!==t)if(u=js(),u!==t){for(b=[],S=_();S!==t;)b.push(S),S=_();b!==t?(S=Wr(),S!==t?(A=r,a=Ia(a,u,S),r=a):(l=r,r=t)):(l=r,r=t)}else l=r,r=t;else l=r,r=t}else l=r,r=t;return r}function Vl(){var r,a,p,u,b,S;if(r=l,a=Hr(),a!==t){for(p=[],u=_();u!==t;)p.push(u),u=_();if(p!==t)if(i.charCodeAt(l)===58?(u=re,l++):(u=t,g===0&&m(W)),u!==t){for(b=[],S=_();S!==t;)b.push(S),S=_();b!==t?(S=Fr(),S!==t?(A=r,a=Ua(a,S),r=a):(l=r,r=t)):(l=r,r=t)}else l=r,r=t;else l=r,r=t}else l=r,r=t;return r}function Yl(){var r,a;return r=l,a=Ns(),a!==t&&(A=r,a=Ha(a)),r=a,r}function Fr(){var r,a,p,u,b,S;if(r=l,i.charCodeAt(l)===40?(a=x,l++):(a=t,g===0&&m(k)),a!==t){for(p=[],u=_();u!==t;)p.push(u),u=_();p!==t?(u=Ls(),u!==t?(b=Ut(),b!==t?(i.charCodeAt(l)===41?(S=D,l++):(S=t,g===0&&m(I)),S!==t?(A=r,a=Fa(u,b),r=a):(l=r,r=t)):(l=r,r=t)):(l=r,r=t)):(l=r,r=t)}else l=r,r=t;return r===t&&(r=Ns()),r}function Ls(){var r,a,p,u;return r=l,a=Qr(),a!==t?(p=jt(),p!==t?(u=Ls(),u!==t?(A=r,a=Qa(a,u),r=a):(l=r,r=t)):(l=r,r=t)):(l=r,r=t),r===t&&(r=Qr()),r}function Qr(){var r,a,p,u;return r=l,a=zs(),a!==t?(p=Rt(),p!==t?(u=Qr(),u!==t?(A=r,a=qa(a,u),r=a):(l=r,r=t)):(l=r,r=t)):(l=r,r=t),r===t&&(r=zs()),r}function zs(){var r,a,p;return r=l,a=qr(),a!==t?(p=Fr(),p!==t?(A=r,a=Wa(p),r=a):(l=r,r=t)):(l=r,r=t),r===t&&(r=Fr()),r}function Ns(){var r,a;return g++,r=l,a=It(),a!==t&&(A=r,a=Ya(a)),r=a,r===t&&(r=l,a=Bs(),a!==t&&(A=r,a=Za(a)),r=a),g--,r===t&&(a=t,g===0&&m(Va)),r}function jt(){var r,a,p,u,b;if(g++,r=l,a=[],p=_(),p!==t)for(;p!==t;)a.push(p),p=_();else a=t;if(a!==t)if(i.substr(l,2).toLowerCase()===Hi?(p=i.substr(l,2),l+=2):(p=t,g===0&&m(Fi)),p!==t){if(u=[],b=_(),b!==t)for(;b!==t;)u.push(b),b=_();else u=t;u!==t?(a=[a,p,u],r=a):(l=r,r=t)}else l=r,r=t;else l=r,r=t;return r===t&&(r=l,A=l,a=y(),a?a=void 0:a=t,a!==t?(p=Rs(),p!==t?(a=[a,p],r=a):(l=r,r=t)):(l=r,r=t)),g--,r===t&&(a=t,g===0&&m(Ka)),r}function Rt(){var r,a,p,u,b;if(g++,r=l,a=[],p=_(),p!==t)for(;p!==t;)a.push(p),p=_();else a=t;if(a!==t)if(i.substr(l,3).toLowerCase()===Qi?(p=i.substr(l,3),l+=3):(p=t,g===0&&m(qi)),p!==t){if(u=[],b=_(),b!==t)for(;b!==t;)u.push(b),b=_();else u=t;u!==t?(a=[a,p,u],r=a):(l=r,r=t)}else l=r,r=t;else l=r,r=t;return r===t&&(r=l,A=l,a=y(),a?a=void 0:a=t,a!==t?(p=Is(),p!==t?(a=[a,p],r=a):(l=r,r=t)):(l=r,r=t)),g--,r===t&&(a=t,g===0&&m(Xa)),r}function qr(){var r,a,p,u;if(g++,r=l,i.substr(l,3).toLowerCase()===Wi?(a=i.substr(l,3),l+=3):(a=t,g===0&&m(Vi)),a!==t){if(p=[],u=_(),u!==t)for(;u!==t;)p.push(u),u=_();else p=t;p!==t?(a=[a,p],r=a):(l=r,r=t)}else l=r,r=t;return r===t&&(r=l,A=l,a=y(),a?a=void 0:a=t,a!==t?(p=Us(),p!==t?(a=[a,p],r=a):(l=r,r=t)):(l=r,r=t)),g--,r===t&&(a=t,g===0&&m(Ga)),r}function Wr(){var r;return g++,r=It(),r===t&&(r=Bs()),g--,r===t&&g===0&&m(Ja),r}function It(){var r,a,p,u,b,S;if(r=l,i.charCodeAt(l)===34?(a=pt,l++):(a=t,g===0&&m(ut)),a!==t){for(p=[],u=Ve();u!==t;)p.push(u),u=Ve();if(p!==t)if(u=ft(),u!==t){for(b=[],S=Ve();S!==t;)b.push(S),S=Ve();b!==t?(i.charCodeAt(l)===34?(S=pt,l++):(S=t,g===0&&m(ut)),S!==t?(A=r,a=Nr(p,u,b),r=a):(l=r,r=t)):(l=r,r=t)}else l=r,r=t;else l=r,r=t}else l=r,r=t;if(r===t)if(r=l,i.charCodeAt(l)===34?(a=pt,l++):(a=t,g===0&&m(ut)),a!==t){for(p=[],u=Ve();u!==t;)p.push(u),u=Ve();p!==t?(i.charCodeAt(l)===34?(u=pt,l++):(u=t,g===0&&m(ut)),u!==t?(A=r,a=el(p),r=a):(l=r,r=t)):(l=r,r=t)}else l=r,r=t;return r}function Ve(){var r,a,p;return r=Vr(),r===t&&(r=l,i.charCodeAt(l)===92?(a=ht,l++):(a=t,g===0&&m(dt)),a!==t?(tl.test(i.charAt(l))?(p=i.charAt(l),l++):(p=t,g===0&&m(rl)),p!==t?(A=r,a=Ot(p),r=a):(l=r,r=t)):(l=r,r=t),r===t&&(r=l,a=l,g++,p=ft(),g--,p===t?a=void 0:(l=a,a=t),a!==t?(il.test(i.charAt(l))?(p=i.charAt(l),l++):(p=t,g===0&&m(sl)),p!==t?(A=r,a=Ot(p),r=a):(l=r,r=t)):(l=r,r=t))),r}function Bs(){var r,a,p,u,b;for(r=l,a=[],p=Ye();p!==t;)a.push(p),p=Ye();if(a!==t)if(p=ft(),p!==t){for(u=[],b=Ye();b!==t;)u.push(b),b=Ye();u!==t?(A=r,a=Nr(a,p,u),r=a):(l=r,r=t)}else l=r,r=t;else l=r,r=t;if(r===t){if(r=l,a=[],p=Ye(),p!==t)for(;p!==t;)a.push(p),p=Ye();else a=t;a!==t&&(A=r,a=nl(a)),r=a}return r}function Ye(){var r,a,p,u,b;return r=Vr(),r===t&&(r=Kl(),r===t&&(r=Xl(),r===t&&(r=Zl(),r===t&&(r=l,a=l,g++,p=Ms(),g--,p===t?a=void 0:(l=a,a=t),a!==t?(p=l,g++,u=Gl(),g--,u===t?p=void 0:(l=p,p=t),p!==t?(u=l,g++,b=ft(),g--,b===t?u=void 0:(l=u,u=t),u!==t?(i.length>l?(b=i.charAt(l),l++):(b=t,g===0&&m(Yi)),b!==t?(A=r,a=Ot(b),r=a):(l=r,r=t)):(l=r,r=t)):(l=r,r=t)):(l=r,r=t))))),r}function Zl(){var r,a;return r=l,i.charCodeAt(l)===42?(a=Dt,l++):(a=t,g===0&&m(Lt)),a!==t&&(A=r,a=ol()),r=a,r}function Ut(){var r,a,p,u,b;for(r=l,a=[],p=_();p!==t;)a.push(p),p=_();if(a!==t)if(p=ft(),p!==t){for(u=[],b=_();b!==t;)u.push(b),b=_();u!==t?(A=r,a=Nr(a,p,u),r=a):(l=r,r=t)}else l=r,r=t;else l=r,r=t;if(r===t)for(r=[],a=_();a!==t;)r.push(a),a=_();return r}function Vr(){var r,a;return r=l,i.substr(l,2)===Zi?(a=Zi,l+=2):(a=t,g===0&&m(al)),a!==t&&(A=r,a=ll()),r=a,r===t&&(r=l,i.substr(l,2)===Ki?(a=Ki,l+=2):(a=t,g===0&&m(cl)),a!==t&&(A=r,a=pl()),r=a,r===t&&(r=l,i.substr(l,2)===Xi?(a=Xi,l+=2):(a=t,g===0&&m(ul)),a!==t&&(A=r,a=hl()),r=a)),r}function Kl(){var r,a,p;return r=l,i.charCodeAt(l)===92?(a=ht,l++):(a=t,g===0&&m(dt)),a!==t?(p=Ms(),p!==t?(A=r,a=Ot(p),r=a):(l=r,r=t)):(l=r,r=t),r}function Xl(){var r,a,p;return r=l,i.charCodeAt(l)===92?(a=ht,l++):(a=t,g===0&&m(dt)),a!==t?(i.substr(l,2).toLowerCase()===Hi?(p=i.substr(l,2),l+=2):(p=t,g===0&&m(Fi)),p===t&&(i.substr(l,3).toLowerCase()===Qi?(p=i.substr(l,3),l+=3):(p=t,g===0&&m(qi)),p===t&&(i.substr(l,3).toLowerCase()===Wi?(p=i.substr(l,3),l+=3):(p=t,g===0&&m(Vi)))),p!==t?(A=r,a=dl(p),r=a):(l=r,r=t)):(l=r,r=t),r}function Gl(){var r;return r=jt(),r===t&&(r=Rt(),r===t&&(r=qr())),r}function Ms(){var r;return fl.test(i.charAt(l))?(r=i.charAt(l),l++):(r=t,g===0&&m(gl)),r}function js(){var r,a;return r=l,i.substr(l,2)===Gi?(a=Gi,l+=2):(a=t,g===0&&m(vl)),a!==t&&(A=r,a=bl()),r=a,r===t&&(r=l,i.substr(l,2)===Ji?(a=Ji,l+=2):(a=t,g===0&&m(ml)),a!==t&&(A=r,a=yl()),r=a,r===t&&(r=l,i.charCodeAt(l)===60?(a=es,l++):(a=t,g===0&&m(ts)),a!==t&&(A=r,a=$l()),r=a,r===t&&(r=l,i.charCodeAt(l)===62?(a=rs,l++):(a=t,g===0&&m(is)),a!==t&&(A=r,a=wl()),r=a))),r}function _(){var r;return g++,Sl.test(i.charAt(l))?(r=i.charAt(l),l++):(r=t,g===0&&m(Al)),g--,r===t&&g===0&&m(_l),r}function ft(){var r,a,p;return r=l,A=l,a=Cl(),a?a=void 0:a=t,a!==t?(i.substr(l,14)===ss?(p=ss,l+=14):(p=t,g===0&&m(xl)),p!==t?(A=r,a=El(),r=a):(l=r,r=t)):(l=r,r=t),r}function Rs(){var r,a,p,u,b;for(r=l,a=[],p=_();p!==t;)a.push(p),p=_();if(a!==t)if(i.substr(l,2)===ns?(p=ns,l+=2):(p=t,g===0&&m(kl)),p!==t){for(u=[],b=_();b!==t;)u.push(b),b=_();u!==t?(A=r,a=Pl(),r=a):(l=r,r=t)}else l=r,r=t;else l=r,r=t;return r}function Is(){var r,a,p,u,b;for(r=l,a=[],p=_();p!==t;)a.push(p),p=_();if(a!==t)if(i.substr(l,2)===os?(p=os,l+=2):(p=t,g===0&&m(Tl)),p!==t){for(u=[],b=_();b!==t;)u.push(b),b=_();u!==t?(A=r,a=as(),r=a):(l=r,r=t)}else l=r,r=t;else l=r,r=t;return r===t&&(r=l,i.charCodeAt(l)===43?(a=ls,l++):(a=t,g===0&&m(cs)),a!==t&&(A=r,a=as()),r=a),r}function Us(){var r,a;return r=l,i.charCodeAt(l)===45?(a=ps,l++):(a=t,g===0&&m(us)),a!==t&&(A=r,a=hs()),r=a,r===t&&(r=l,i.charCodeAt(l)===33?(a=ds,l++):(a=t,g===0&&m(fs)),a!==t&&(A=r,a=hs()),r=a),r}function Jl(){var r;return r=ec(),r===t&&(r=Hs(),r===t&&(r=tc())),r}function ec(){var r,a,p,u,b,S;if(r=l,a=Ze(),a!==t){for(p=[],u=_();u!==t;)p.push(u),u=_();if(p!==t)if(i.charCodeAt(l)===58?(u=re,l++):(u=t,g===0&&m(W)),u!==t){for(b=[],S=_();S!==t;)b.push(S),S=_();b!==t?(S=Hs(),S!==t?(a=[a,p,u,b,S],r=a):(l=r,r=t)):(l=r,r=t)}else l=r,r=t;else l=r,r=t}else l=r,r=t;return r}function Hs(){var r;return r=rc(),r===t&&(r=Yr(),r===t&&(r=ic(),r===t&&(r=sc(),r===t&&(r=nc(),r===t&&(r=oc()))))),r}function tc(){var r,a,p,u,b,S;if(r=l,i.substr(l,8)===gs?(a=gs,l+=8):(a=t,g===0&&m(Ol)),a!==t){for(p=[],u=_();u!==t;)p.push(u),u=_();if(p!==t)if(i.charCodeAt(l)===58?(u=re,l++):(u=t,g===0&&m(W)),u!==t){for(b=[],S=_();S!==t;)b.push(S),S=_();b!==t?(S=Ze(),S!==t?(A=r,a=Dl(),r=a):(l=r,r=t)):(l=r,r=t)}else l=r,r=t;else l=r,r=t}else l=r,r=t;return r}function rc(){var r,a,p,u,b,S,L;if(r=l,a=js(),a!==t){for(p=[],u=_();u!==t;)p.push(u),u=_();p!==t?(u=Ze(),u!==t?(A=r,a=vs(),r=a):(l=r,r=t)):(l=r,r=t)}else l=r,r=t;if(r===t)if(r=l,a=cc(),a!==t){for(p=[],u=_();u!==t;)p.push(u),u=_();p!==t?(u=Ze(),u!==t?(b=qs(),b!==t?(S=Ze(),S!==t?(L=pc(),L!==t?(A=r,a=vs(),r=a):(l=r,r=t)):(l=r,r=t)):(l=r,r=t)):(l=r,r=t)):(l=r,r=t)}else l=r,r=t;return r}function Yr(){var r,a,p,u,b;for(r=l,a=[],p=Ht(),p===t&&(i.charCodeAt(l)===42?(p=Dt,l++):(p=t,g===0&&m(Lt)));p!==t;)a.push(p),p=Ht(),p===t&&(i.charCodeAt(l)===42?(p=Dt,l++):(p=t,g===0&&m(Lt)));if(a!==t)if(i.charCodeAt(l)===63?(p=bs,l++):(p=t,g===0&&m(ms)),p!==t){for(u=[],b=Yr();b!==t;)u.push(b),b=Yr();u!==t?(A=r,a=Ll(),r=a):(l=r,r=t)}else l=r,r=t;else l=r,r=t;return r}function ic(){var r,a,p,u;if(r=l,i.charCodeAt(l)===47?(a=Br,l++):(a=t,g===0&&m(Mr)),a!==t){for(p=[],ys.test(i.charAt(l))?(u=i.charAt(l),l++):(u=t,g===0&&m($s));u!==t;)p.push(u),ys.test(i.charAt(l))?(u=i.charAt(l),l++):(u=t,g===0&&m($s));p!==t?(i.charCodeAt(l)===47?(u=Br,l++):(u=t,g===0&&m(Mr)),u!==t?(A=r,a=zl(),r=a):(l=r,r=t)):(l=r,r=t)}else l=r,r=t;return r}function sc(){var r,a,p,u,b;if(r=l,a=Fs(),a!==t)if(i.charCodeAt(l)===126?(p=jr,l++):(p=t,g===0&&m(Rr)),p!==t){for(u=[],qe.test(i.charAt(l))?(b=i.charAt(l),l++):(b=t,g===0&&m(We));b!==t;)u.push(b),qe.test(i.charAt(l))?(b=i.charAt(l),l++):(b=t,g===0&&m(We));u!==t?(A=r,a=Nl(),r=a):(l=r,r=t)}else l=r,r=t;else l=r,r=t;return r}function nc(){var r,a,p,u,b;if(r=l,a=It(),a!==t)if(i.charCodeAt(l)===126?(p=jr,l++):(p=t,g===0&&m(Rr)),p!==t){for(u=[],qe.test(i.charAt(l))?(b=i.charAt(l),l++):(b=t,g===0&&m(We));b!==t;)u.push(b),qe.test(i.charAt(l))?(b=i.charAt(l),l++):(b=t,g===0&&m(We));u!==t?(A=r,a=Bl(),r=a):(l=r,r=t)}else l=r,r=t;else l=r,r=t;return r}function oc(){var r,a,p,u,b;if(r=l,a=Ze(),a!==t)if(i.charCodeAt(l)===94?(p=ws,l++):(p=t,g===0&&m(_s)),p!==t){for(u=[],qe.test(i.charAt(l))?(b=i.charAt(l),l++):(b=t,g===0&&m(We));b!==t;)u.push(b),qe.test(i.charAt(l))?(b=i.charAt(l),l++):(b=t,g===0&&m(We));u!==t?(A=r,a=Ml(),r=a):(l=r,r=t)}else l=r,r=t;else l=r,r=t;return r}function Ze(){var r;return r=It(),r===t&&(r=Fs()),r}function Fs(){var r,a;if(r=[],a=Ht(),a!==t)for(;a!==t;)r.push(a),a=Ht();else r=t;return r}function Ht(){var r,a,p,u;return r=Vr(),r===t&&(r=lc(),r===t&&(r=l,a=l,g++,p=Qs(),g--,p===t?a=void 0:(l=a,a=t),a!==t?(p=l,g++,u=ac(),g--,u===t?p=void 0:(l=p,p=t),p!==t?(i.length>l?(u=i.charAt(l),l++):(u=t,g===0&&m(Yi)),u!==t?(a=[a,p,u],r=a):(l=r,r=t)):(l=r,r=t)):(l=r,r=t))),r}function ac(){var r;return r=jt(),r===t&&(r=Rt(),r===t&&(r=Rs(),r===t&&(r=Is(),r===t&&(r=Us(),r===t&&(r=qs()))))),r}function lc(){var r,a,p;return r=l,i.charCodeAt(l)===92?(a=ht,l++):(a=t,g===0&&m(dt)),a!==t?(p=Qs(),p!==t?(A=r,a=jl(),r=a):(l=r,r=t)):(l=r,r=t),r}function Qs(){var r;return i.charCodeAt(l)===43?(r=ls,l++):(r=t,g===0&&m(cs)),r===t&&(i.charCodeAt(l)===45?(r=ps,l++):(r=t,g===0&&m(us)),r===t&&(i.charCodeAt(l)===61?(r=Rl,l++):(r=t,g===0&&m(Il)),r===t&&(i.charCodeAt(l)===62?(r=rs,l++):(r=t,g===0&&m(is)),r===t&&(i.charCodeAt(l)===60?(r=es,l++):(r=t,g===0&&m(ts)),r===t&&(i.charCodeAt(l)===33?(r=ds,l++):(r=t,g===0&&m(fs)),r===t&&(i.charCodeAt(l)===40?(r=x,l++):(r=t,g===0&&m(k)),r===t&&(i.charCodeAt(l)===41?(r=D,l++):(r=t,g===0&&m(I)),r===t&&(i.charCodeAt(l)===123?(r=Qe,l++):(r=t,g===0&&m(Dr)),r===t&&(i.charCodeAt(l)===125?(r=Lr,l++):(r=t,g===0&&m(zr)),r===t&&(i.charCodeAt(l)===91?(r=Ss,l++):(r=t,g===0&&m(As)),r===t&&(i.charCodeAt(l)===93?(r=Cs,l++):(r=t,g===0&&m(xs)),r===t&&(i.charCodeAt(l)===94?(r=ws,l++):(r=t,g===0&&m(_s)),r===t&&(i.charCodeAt(l)===34?(r=pt,l++):(r=t,g===0&&m(ut)),r===t&&(i.charCodeAt(l)===126?(r=jr,l++):(r=t,g===0&&m(Rr)),r===t&&(i.charCodeAt(l)===42?(r=Dt,l++):(r=t,g===0&&m(Lt)),r===t&&(i.charCodeAt(l)===63?(r=bs,l++):(r=t,g===0&&m(ms)),r===t&&(i.charCodeAt(l)===58?(r=re,l++):(r=t,g===0&&m(W)),r===t&&(i.charCodeAt(l)===92?(r=ht,l++):(r=t,g===0&&m(dt)),r===t&&(i.charCodeAt(l)===47?(r=Br,l++):(r=t,g===0&&m(Mr))))))))))))))))))))),r}function qs(){var r,a,p,u,b;if(r=l,a=[],p=_(),p!==t)for(;p!==t;)a.push(p),p=_();else a=t;if(a!==t)if(i.substr(l,2)===Es?(p=Es,l+=2):(p=t,g===0&&m(Ul)),p!==t){if(u=[],b=_(),b!==t)for(;b!==t;)u.push(b),b=_();else u=t;u!==t?(a=[a,p,u],r=a):(l=r,r=t)}else l=r,r=t;else l=r,r=t;return r}function cc(){var r;return i.charCodeAt(l)===91?(r=Ss,l++):(r=t,g===0&&m(As)),r===t&&(i.charCodeAt(l)===123?(r=Qe,l++):(r=t,g===0&&m(Dr))),r}function pc(){var r;return i.charCodeAt(l)===93?(r=Cs,l++):(r=t,g===0&&m(xs)),r===t&&(i.charCodeAt(l)===125?(r=Lr,l++):(r=t,g===0&&m(zr))),r}const{errorOnLuceneSyntax:uc,parseCursor:hc,cursorSymbol:dc,allowLeadingWildcards:fc=!0,helpers:{nodeTypes:De}}=o,se=De.function.buildNodeWithArgumentNodes,ve=De.literal.buildNode,gc=De.wildcard.buildNode,vc=De.namedArg.buildNode,{wildcardSymbol:Ws}=De.wildcard;if(Nt=f(),Nt!==t&&l===i.length)return Nt;throw Nt!==t&&l<i.length&&m({type:"end",description:"end of input"}),Ps(null,Ir,ie<i.length?i.charAt(ie):null,ie<i.length?Bt(ie,ie+1):Bt(ie,ie))}return{SyntaxError:e,parse:s}}(),gr=(n,e={},s=Ct)=>{if(typeof n>"u")throw new Error("expression must be a string, got undefined instead");return s(n,{...e,helpers:{nodeTypes:J}})},je=(n,e={})=>gr(n,{...e,startRule:"Literal"},Ct),xt=(n,e={})=>{try{return gr(n,e,Ct)}catch(s){throw s.name==="SyntaxError"?new Ai(s,n):s}},Un=n=>{try{return gr(n,{errorOnLuceneSyntax:!0},Ct),!1}catch(e){return e.message.startsWith("Lucene")}},B=(n,e,s,i)=>(e=void 0,!n||!n.type||!J[n.type]?B(J.function.buildNode("and",[]),e):J[n.type].toOpenSearchQuery(n,e,s,i)),oe="@kuery-wildcard@";function Hn(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Fn(n){return n.replace(/[+-=&|><!(){}[\]^"~*?:\\/]/g,"\\$&")}function Qn(n){return n.includes(oe)?{type:"wildcard",value:n}:je(n)}function Ci(n,e){const{value:s}=n,i=s.split(oe).map(Hn).join("[\\s\\S]*");return new RegExp(`^${i}$`).test(e)}function qn(n){const{value:e}=n;return e.split(oe).join("*")}function vr(n){const{value:e}=n;return e.split(oe).map(Fn).join("*")}function Wn(n){const{value:e}=n;return e.startsWith(oe)&&e.replace(oe,"").length>0}const Vn=Object.freeze(Object.defineProperty({__proto__:null,buildNode:Qn,hasLeadingWildcard:Wn,test:Ci,toOpenSearchQuery:qn,toQueryStringQuery:vr,wildcardSymbol:oe},Symbol.toStringTag,{value:"Module"}));function br(n,e){if(!e)return[];if(n.type==="literal"){const s=fr(n),i=e.fields.find(o=>o.name===s);return i?[i]:[]}else if(n.type==="wildcard")return e.fields.filter(i=>Ci(n,i.name))}function yc(n){return n}function xi(n,e,s){const i={...n,value:s?`${s}.${n.value}`:n.value};if(!e||i.type==="wildcard"&&!s)return i;const t=br(i,e).reduce((c,f)=>{const d=f.subType&&f.subType.nested?f.subType.nested.path:void 0;return s&&!d?[...c,`${f.name} is not a nested field but is in nested group "${s}" in the DQL expression.`]:d&&!s?[...c,`${f.name} is a nested field, but is not in a nested group in the DQL expression.`]:d!==s?[...c,`Nested field ${f.name} is being queried with the incorrect nested path. The correct path is ${f.subType.nested.path}.`]:c},[]);if(t.length>0)throw new Error(t.join(`
|
|
782
|
-
|
|
783
|
-
|
|
779
|
+
`}return`Not yet implemented ${this.variant}`}},R([g({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"checked",2),R([g({type:String,reflect:!0})],h.SpectricInput.prototype,"placeholder",2),R([g({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"readonly",2),R([g({type:String,reflect:!0})],h.SpectricInput.prototype,"variant",2),R([g({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"disabled",2),R([g({type:String,reflect:!0})],h.SpectricInput.prototype,"label",2),R([g()],h.SpectricInput.prototype,"hidePasswordLabel",2),R([g()],h.SpectricInput.prototype,"showPasswordLabel",2),R([g({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"showPasswordVisibilityToggle",2),R([g({type:String,reflect:!0})],h.SpectricInput.prototype,"helperText",2),R([g({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"invalid",2),R([g({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"required",2),R([g({type:String,reflect:!0})],h.SpectricInput.prototype,"invalidText",2),R([g()],h.SpectricInput.prototype,"name",2),R([g()],h.SpectricInput.prototype,"pattern",2),R([g({type:Number,reflect:!0})],h.SpectricInput.prototype,"maxCount",2),R([g({reflect:!0})],h.SpectricInput.prototype,"autocomplete",2),R([g({reflect:!0})],h.SpectricInput.prototype,"value",1),R([pe("input")],h.SpectricInput.prototype,"_input",2),R([Pe({capture:!0})],h.SpectricInput.prototype,"_handleChange",1),h.SpectricInput=R([I("spectric-input")],h.SpectricInput);const Ye=i=>Pr(i===""?void 0:i??void 0),wn="end of input",Sn={fieldName:"field name",value:"value",literal:"literal",whitespace:"whitespace"};class Fi extends Error{constructor(e,r){let s=e.message;if(e.expected){const o=e.expected.map(c=>Sn[c.description]||c.description).join(", ");let d=e.found?`"${e.found}"`:wn;s=`Expected ${o} but ${d} found.`}const t=[s,r,"-".repeat(e.location.start.offset)+"^"].join(`
|
|
780
|
+
`);super(t),this.name="DQLSyntaxError",this.shortMessage=s}}function Ze(i){return{type:"literal",value:i}}function Nr(i){return i.value}const xn=Object.freeze(Object.defineProperty({__proto__:null,buildNode:Ze,toOpenSearchQuery:Nr},Symbol.toStringTag,{value:"Module"})),{parse:Yt}=function(){class i extends SyntaxError{constructor(s,t,a,o){super(s),this.expected=t,this.found=a,this.location=o,this.name="SyntaxError"}format(s){let t="Error: "+this.message;if(this.location){let a=null;const o=s.find(_=>_.source===this.location.source);o&&(a=o.text.split(/\r\n|\n|\r/g));const d=this.location.start,c=this.location.source&&typeof this.location.source.offset=="function"?this.location.source.offset(d):d,b=this.location.source+":"+c.line+":"+c.column;if(a){const _=this.location.end,y="".padEnd(c.line.toString().length," "),C=a[d.line-1],S=(d.line===_.line?_.column:C.length+1)-d.column||1;t+=`
|
|
781
|
+
--> `+b+`
|
|
782
|
+
`+y+` |
|
|
783
|
+
`+c.line+" | "+C+`
|
|
784
|
+
`+y+" | "+"".padEnd(d.column-1," ")+"".padEnd(S,"^")}else t+=`
|
|
785
|
+
at `+b}return t}static buildMessage(s,t){function a(S){return S.codePointAt(0).toString(16).toUpperCase()}const o=Object.prototype.hasOwnProperty.call(RegExp.prototype,"unicode")?new RegExp("[\\p{C}\\p{Mn}\\p{Mc}]","gu"):null;function d(S){return o?S.replace(o,A=>"\\u{"+a(A)+"}"):S}function c(S){return d(S.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,A=>"\\x0"+a(A)).replace(/[\x10-\x1F\x7F-\x9F]/g,A=>"\\x"+a(A)))}function b(S){return d(S.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,A=>"\\x0"+a(A)).replace(/[\x10-\x1F\x7F-\x9F]/g,A=>"\\x"+a(A)))}const _={literal(S){return'"'+c(S.text)+'"'},class(S){const A=S.parts.map(L=>Array.isArray(L)?b(L[0])+"-"+b(L[1]):b(L));return"["+(S.inverted?"^":"")+A.join("")+"]"+(S.unicode?"u":"")},any(){return"any character"},end(){return"end of input"},other(S){return S.description}};function y(S){return _[S.type](S)}function C(S){const A=S.map(y);if(A.sort(),A.length>0){let L=1;for(let N=1;N<A.length;N++)A[N-1]!==A[N]&&(A[L]=A[N],L++);A.length=L}switch(A.length){case 1:return A[0];case 2:return A[0]+" or "+A[1];default:return A.slice(0,-1).join(", ")+", or "+A[A.length-1]}}function w(S){return S?'"'+c(S)+'"':"end of input"}return"Expected "+C(s)+" but "+w(t)+" found."}}function e(r,s){s=s!==void 0?s:{};const t={},a=s.grammarSource,o={start:ms,Literal:li};let d=ms;const c="(",b=")",_=":",y="{",C="}",w="or",S="and",A="not",L=".",N='"',ce="\\",z="*",Y="\\t",H="\\r",ut="\\n",ge="<@",Be="<=",X=">=",ir="<",pt=">",ht="©kuery-cursor©",Dt=/^[0-9]/,xe=/^[\\"]/,La=/^[^"]/,Da=/^[\\():<>"*{}]/,Na=/^[ \t\r\n]/,hs=j("(",!1),ds=j(")",!1),fs=j(":",!1),Ma=j("{",!1),za=j("}",!1),Ia=Ue("fieldName"),Ra=Ue("value"),ja=Ue("OR"),gs=j("or",!0),Ba=Ue("AND"),bs=j("and",!0),Ua=Ue("NOT"),ys=j("not",!0),Ha=Ue("literal"),Fa=j(".",!1),sr=zt([["0","9"]],!1,!1,!1),nr=j('"',!1),ti=j("\\",!1),Qa=zt(["\\",'"'],!1,!1,!1),qa=zt(['"'],!0,!1,!1),Va=Fl(),Wa=j("*",!1),Ga=j("\\t",!1),Ya=j("\\r",!1),Za=j("\\n",!1),Ja=zt(["\\","(",")",":","<",">",'"',"*","{","}"],!1,!1,!1),Ka=j("<@",!1),Xa=j("<=",!1),el=j(">=",!1),tl=j("<",!1),rl=j(">",!1),il=Ue("whitespace"),sl=zt([" "," ","\r",`
|
|
786
|
+
`],!1,!1,!1),nl=j("©kuery-cursor©",!1);function ol(n,l){return l.type==="cursor"?{...l,suggestionTypes:["conjunction"],rule:"start"}:n!==null?n:He.function.buildNode("is","*","*")}function al(n,l){const p=[n,l].find(f=>f.type==="cursor");return p||ee("or",[n,l])}function ll(n,l){const p=[n,l].find(f=>f.type==="cursor");return p||ee("and",[n,l])}function cl(n){return n.type==="cursor"?n:ee("not",[n])}function ul(n,l){return l.type==="cursor"?{...l,suggestionTypes:["conjunction"],rule:"SubQuery"}:n}function pl(n,l,p){return l.type==="cursor"?{...l,nestedPath:l.nestedPath?`${n.value}.${l.nestedPath}`:n.value}:p.type==="cursor"?{...p,suggestionTypes:["conjunction"]}:ee("nested",[n,l])}function hl(n,l,p){return p.type==="cursor"?{...p,fieldName:n.value,suggestionTypes:["geo_value","conjunction"],rule:"FieldGeoSpatialExpression"}:{type:"function",function:"geospatial",arguments:[n,l,p]}}function dl(n,l,p){if(p.type==="cursor")return{...p,fieldName:n.value,suggestionTypes:["geo_value","conjunction"],rule:"FieldMultiGeoSpatialExpression"};Ps(l,p(n));const f=p(n);return f.function=="is"?ee("geospatial",[n,l,f.arguments[1]]):{...f,arguments:f.arguments.map(v=>ee("geospatial",{type:"function",function:"geospatial",arguments:[n,l,v.arguments[1]]}))}}function fl(n,l,p){if(p.type==="cursor")return{...p,fieldName:n.value,suggestionTypes:["value","conjunction"],rule:"FieldRangeExpression"};const f=Ps(l,p);return ee("range",[n,f])}function gl(n,l){return l.type==="cursor"?l.prefix.includes(ui)?{...l,fieldName:n.value,suggestionTypes:["conjunction"],rule:"FieldValueExpression"}:{...l,fieldName:n.value,suggestionTypes:["value","conjunction"],rule:"FieldValueExpression"}:l(n)}function bl(n){if(n.type==="cursor"){const p=`${n.prefix}${n.suffix}`.trim();return{...n,fieldName:p,suggestionTypes:["field","operator","conjunction"],rule:"ValueExpression"}}const l=ke(null);return n(l)}function yl(n,l){return l.type==="cursor"?{...l,suggestionTypes:["conjunction"],rule:"ListOfValues"}:n}function vl(n,l){const p=[n,l].find(f=>f.type==="cursor");return p?{...p,suggestionTypes:["value"],rule:"OrListOfValues"}:f=>ee("or",[n(f),l(f)])}function ml(n,l){const p=[n,l].find(f=>f.type==="cursor");return p?{...p,suggestionTypes:["value"],rule:"AndListOfValues"}:f=>ee("and",[n(f),l(f)])}function $l(n){return n.type==="cursor"?{...list,suggestionTypes:["value"],rule:"NotListOfValues"}:l=>ee("not",[n(l)])}function _l(n){if(n.type==="cursor")return n;const l=ke(!0);return p=>ee("is",[p,n,l])}function wl(n){if(n.type==="cursor")return n;!uc&&n.type==="wildcard"&&He.wildcard.hasLeadingWildcard(n)&&Ul("Leading wildcards are disabled. See query:allowLeadingWildcards in Advanced Settings.");const l=ke(!1);return p=>ee("is",[p,n,l])}function Sl(){return parseFloat(Mt())}function xl(){return parseInt(Mt(),10)}function kl(n,l,p){const{start:f,end:v}=ri();return{type:"cursor",start:f.offset,end:v.offset-l.length,prefix:n.join(""),suffix:p.join(""),text:Mt().replace(l,""),rule:"QuotedString"}}function El(n){return ke(n.join(""))}function wc(n){return n}function Sc(n){return n}function Al(n,l,p){const{start:f,end:v}=ri();return{type:"cursor",start:f.offset,end:v.offset-l.length,prefix:n.join(""),suffix:p.join(""),text:Mt().replace(l,""),rule:"UnquotedLiteral"}}function Cl(n){const l=n.join("").trim();return l==="null"?ke(null):l==="true"?ke(!0):l==="false"?ke(!1):n.includes(ui)?pc(l):ke(/^(-?[1-9]+\d*([.]\d+)?)$|^(-?0[.]\d*[1-9]+)$|^0$|^0.0$|^[.]\d{1,}$/.test(l)?isFinite(l)&&(l>Number.MAX_SAFE_INTEGER||l<Number.MIN_SAFE_INTEGER)?BigInt(l):Number(l):l)}function xc(n){return n}function Ol(){return ui}function Pl(n,l,p){const{start:f,end:v}=ri();return{type:"cursor",start:f.offset,end:v.offset-l.length,prefix:n.join(""),suffix:p.join(""),text:Mt().replace(l,""),rule:"OptionalSpace"}}function Tl(){return" "}function Ll(){return"\r"}function Dl(){return`
|
|
787
|
+
`}function kc(n){return n}function Ec(n){return n}function Nl(){return"within"}function Ml(){return"lte"}function zl(){return"gte"}function Il(){return"lt"}function Rl(){return"gt"}function jl(){return lc}function Bl(){return cc}let u=s.peg$currPos|0,P=u;const dt=[{line:1,column:1}];let re=u,or=s.peg$maxFailExpected||[],m=s.peg$silentFails|0,Nt;if(s.startRule){if(!(s.startRule in o))throw new Error(`Can't start parsing from rule "`+s.startRule+'".');d=o[s.startRule]}function Mt(){return r.substring(P,u)}function ri(){return ar(P,u)}function Ul(n,l){throw l=l!==void 0?l:ar(P,u),ql(n,l)}function Hl(n=u){const l=r.codePointAt(n);return l===void 0?"":String.fromCodePoint(l)}function j(n,l){return{type:"literal",text:n,ignoreCase:l}}function zt(n,l,p,f){return{type:"class",parts:n,inverted:l,ignoreCase:p,unicode:f}}function Fl(){return{type:"any"}}function Ql(){return{type:"end"}}function Ue(n){return{type:"other",description:n}}function vs(n){let l=dt[n],p;if(l)return l;if(n>=dt.length)p=dt.length-1;else for(p=n;!dt[--p];);for(l=dt[p],l={line:l.line,column:l.column};p<n;)r.charCodeAt(p)===10?(l.line++,l.column=1):l.column++,p++;return dt[n]=l,l}function ar(n,l,p){const f=vs(n),v=vs(l);return{source:a,start:{offset:n,line:f.line,column:f.column},end:{offset:l,line:v.line,column:v.column}}}function E(n){u<re||(u>re&&(re=u,or=[]),or.push(n))}function ql(n,l){return new i(n,null,null,l)}function Vl(n,l,p){return new i(i.buildMessage(n,l),n,l,p)}function ms(){let n,l,p,f;for(n=u,l=[],p=O();p!==t;)l.push(p),p=O();return p=lr(),p===t&&(p=null),f=Rt(),f!==t?(P=n,n=ol(p,f)):(u=n,n=t),n}function lr(){let n,l,p,f;return n=u,l=ii(),l!==t?(p=ni(),p!==t?(f=lr(),f!==t?(P=n,n=al(l,f)):(u=n,n=t)):(u=n,n=t)):(u=n,n=t),n===t&&(n=ii()),n}function ii(){let n,l,p,f;return n=u,l=$s(),l!==t?(p=oi(),p!==t?(f=ii(),f!==t?(P=n,n=ll(l,f)):(u=n,n=t)):(u=n,n=t)):(u=n,n=t),n===t&&(n=$s()),n}function $s(){let n,l,p;return n=u,l=ai(),l!==t?(p=_s(),p!==t?(P=n,n=cl(p)):(u=n,n=t)):(u=n,n=t),n===t&&(n=_s()),n}function _s(){let n,l,p,f,v,k;if(n=u,r.charCodeAt(u)===40?(l=c,u++):(l=t,m===0&&E(hs)),l!==t){for(p=[],f=O();f!==t;)p.push(f),f=O();f=lr(),f!==t?(v=Rt(),v!==t?(r.charCodeAt(u)===41?(k=b,u++):(k=t,m===0&&E(ds)),k!==t?(P=n,n=ul(f,v)):(u=n,n=t)):(u=n,n=t)):(u=n,n=t)}else u=n,n=t;return n===t&&(n=Wl()),n}function Wl(){let n,l,p,f,v,k,Ls,Fe,hi,di;if(n=u,l=It(),l!==t){for(p=[],f=O();f!==t;)p.push(f),f=O();if(r.charCodeAt(u)===58?(f=_,u++):(f=t,m===0&&E(fs)),f!==t){for(v=[],k=O();k!==t;)v.push(k),k=O();if(r.charCodeAt(u)===123?(k=y,u++):(k=t,m===0&&E(Ma)),k!==t){for(Ls=[],Fe=O();Fe!==t;)Ls.push(Fe),Fe=O();Fe=lr(),Fe!==t?(hi=Rt(),hi!==t?(r.charCodeAt(u)===125?(di=C,u++):(di=t,m===0&&E(za)),di!==t?(P=n,n=pl(l,Fe,hi)):(u=n,n=t)):(u=n,n=t)):(u=n,n=t)}else u=n,n=t}else u=n,n=t}else u=n,n=t;return n===t&&(n=Gl()),n}function Gl(){let n;return n=Yl(),n===t&&(n=Zl(),n===t&&(n=Jl(),n===t&&(n=Kl(),n===t&&(n=Xl())))),n}function It(){let n;return m++,n=li(),m--,n===t&&m===0&&E(Ia),n}function Yl(){let n,l,p,f,v,k;if(n=u,l=It(),l!==t){for(p=[],f=O();f!==t;)p.push(f),f=O();if(f=Os(),f!==t){for(v=[],k=O();k!==t;)v.push(k),k=O();k=li(),k!==t?(P=n,n=hl(l,f,k)):(u=n,n=t)}else u=n,n=t}else u=n,n=t;return n}function Zl(){let n,l,p,f,v,k;if(n=u,l=It(),l!==t){for(p=[],f=O();f!==t;)p.push(f),f=O();if(f=Os(),f!==t){for(v=[],k=O();k!==t;)v.push(k),k=O();k=cr(),k!==t?(P=n,n=dl(l,f,k)):(u=n,n=t)}else u=n,n=t}else u=n,n=t;return n}function Jl(){let n,l,p,f,v,k;if(n=u,l=It(),l!==t){for(p=[],f=O();f!==t;)p.push(f),f=O();if(f=ac(),f!==t){for(v=[],k=O();k!==t;)v.push(k),k=O();k=rc(),k!==t?(P=n,n=fl(l,f,k)):(u=n,n=t)}else u=n,n=t}else u=n,n=t;return n}function Kl(){let n,l,p,f,v,k;if(n=u,l=It(),l!==t){for(p=[],f=O();f!==t;)p.push(f),f=O();if(r.charCodeAt(u)===58?(f=_,u++):(f=t,m===0&&E(fs)),f!==t){for(v=[],k=O();k!==t;)v.push(k),k=O();k=cr(),k!==t?(P=n,n=gl(l,k)):(u=n,n=t)}else u=n,n=t}else u=n,n=t;return n}function Xl(){let n,l;return n=u,l=xs(),l!==t&&(P=n,l=bl(l)),n=l,n}function cr(){let n,l,p,f,v,k;if(n=u,r.charCodeAt(u)===40?(l=c,u++):(l=t,m===0&&E(hs)),l!==t){for(p=[],f=O();f!==t;)p.push(f),f=O();f=ws(),f!==t?(v=Rt(),v!==t?(r.charCodeAt(u)===41?(k=b,u++):(k=t,m===0&&E(ds)),k!==t?(P=n,n=yl(f,v)):(u=n,n=t)):(u=n,n=t)):(u=n,n=t)}else u=n,n=t;return n===t&&(n=xs()),n}function ws(){let n,l,p,f;return n=u,l=si(),l!==t?(p=ni(),p!==t?(f=ws(),f!==t?(P=n,n=vl(l,f)):(u=n,n=t)):(u=n,n=t)):(u=n,n=t),n===t&&(n=si()),n}function si(){let n,l,p,f;return n=u,l=Ss(),l!==t?(p=oi(),p!==t?(f=si(),f!==t?(P=n,n=ml(l,f)):(u=n,n=t)):(u=n,n=t)):(u=n,n=t),n===t&&(n=Ss()),n}function Ss(){let n,l,p;return n=u,l=ai(),l!==t?(p=cr(),p!==t?(P=n,n=$l(p)):(u=n,n=t)):(u=n,n=t),n===t&&(n=cr()),n}function xs(){let n,l;return m++,n=u,l=ci(),l!==t&&(P=n,l=_l(l)),n=l,n===t&&(n=u,l=Es(),l!==t&&(P=n,l=wl(l)),n=l),m--,n===t&&(l=t,m===0&&E(Ra)),n}function ni(){let n,l,p,f,v;if(m++,n=u,l=[],p=O(),p!==t)for(;p!==t;)l.push(p),p=O();else l=t;if(l!==t)if(p=r.substr(u,2),p.toLowerCase()===w?u+=2:(p=t,m===0&&E(gs)),p!==t){if(f=[],v=O(),v!==t)for(;v!==t;)f.push(v),v=O();else f=t;f!==t?(l=[l,p,f],n=l):(u=n,n=t)}else u=n,n=t;else u=n,n=t;return m--,n===t&&(l=t,m===0&&E(ja)),n}function oi(){let n,l,p,f,v;if(m++,n=u,l=[],p=O(),p!==t)for(;p!==t;)l.push(p),p=O();else l=t;if(l!==t)if(p=r.substr(u,3),p.toLowerCase()===S?u+=3:(p=t,m===0&&E(bs)),p!==t){if(f=[],v=O(),v!==t)for(;v!==t;)f.push(v),v=O();else f=t;f!==t?(l=[l,p,f],n=l):(u=n,n=t)}else u=n,n=t;else u=n,n=t;return m--,n===t&&(l=t,m===0&&E(Ba)),n}function ai(){let n,l,p,f;if(m++,n=u,l=r.substr(u,3),l.toLowerCase()===A?u+=3:(l=t,m===0&&E(ys)),l!==t){if(p=[],f=O(),f!==t)for(;f!==t;)p.push(f),f=O();else p=t;p!==t?(l=[l,p],n=l):(u=n,n=t)}else u=n,n=t;return m--,n===t&&(l=t,m===0&&E(Ua)),n}function li(){let n;return m++,n=ci(),n===t&&(n=Es()),m--,n===t&&m===0&&E(Ha),n}function ec(){let n;return n=tc(),n===t&&(n=ks()),n}function tc(){let n,l,p,f,v;if(n=u,l=ks(),l!==t)if(r.charCodeAt(u)===46?(p=L,u++):(p=t,m===0&&E(Fa)),p!==t){if(f=[],v=r.charAt(u),Dt.test(v)?u++:(v=t,m===0&&E(sr)),v!==t)for(;v!==t;)f.push(v),v=r.charAt(u),Dt.test(v)?u++:(v=t,m===0&&E(sr));else f=t;f!==t?(P=n,n=Sl()):(u=n,n=t)}else u=n,n=t;else u=n,n=t;return n}function ks(){let n,l,p;if(n=u,l=[],p=r.charAt(u),Dt.test(p)?u++:(p=t,m===0&&E(sr)),p!==t)for(;p!==t;)l.push(p),p=r.charAt(u),Dt.test(p)?u++:(p=t,m===0&&E(sr));else l=t;return l!==t&&(P=n,l=xl()),n=l,n}function ci(){let n,l,p,f,v,k;if(n=u,r.charCodeAt(u)===34?(l=N,u++):(l=t,m===0&&E(nr)),l!==t){for(p=[],f=ft();f!==t;)p.push(f),f=ft();if(f=jt(),f!==t){for(v=[],k=ft();k!==t;)v.push(k),k=ft();r.charCodeAt(u)===34?(k=N,u++):(k=t,m===0&&E(nr)),k!==t?(P=n,n=kl(p,f,v)):(u=n,n=t)}else u=n,n=t}else u=n,n=t;if(n===t)if(n=u,r.charCodeAt(u)===34?(l=N,u++):(l=t,m===0&&E(nr)),l!==t){for(p=[],f=ft();f!==t;)p.push(f),f=ft();r.charCodeAt(u)===34?(f=N,u++):(f=t,m===0&&E(nr)),f!==t?(P=n,n=El(p)):(u=n,n=t)}else u=n,n=t;return n}function rc(){let n;return n=ec(),n===t&&(n=ci(),n===t&&(n=Rt())),n}function ft(){let n,l,p;return n=As(),n===t&&(n=u,r.charCodeAt(u)===92?(l=ce,u++):(l=t,m===0&&E(ti)),l!==t?(p=r.charAt(u),xe.test(p)?u++:(p=t,m===0&&E(Qa)),p!==t?(P=n,n=p):(u=n,n=t)):(u=n,n=t),n===t&&(n=u,l=u,m++,p=jt(),m--,p===t?l=void 0:(u=l,l=t),l!==t?(p=r.charAt(u),La.test(p)?u++:(p=t,m===0&&E(qa)),p!==t?(P=n,n=p):(u=n,n=t)):(u=n,n=t))),n}function Es(){let n,l,p,f,v;for(n=u,l=[],p=gt();p!==t;)l.push(p),p=gt();if(p=jt(),p!==t){for(f=[],v=gt();v!==t;)f.push(v),v=gt();P=n,n=Al(l,p,f)}else u=n,n=t;if(n===t){if(n=u,l=[],p=gt(),p!==t)for(;p!==t;)l.push(p),p=gt();else l=t;l!==t&&(P=n,l=Cl(l)),n=l}return n}function gt(){let n,l,p,f,v;return n=As(),n===t&&(n=sc(),n===t&&(n=nc(),n===t&&(n=ic(),n===t&&(n=u,l=u,m++,p=Cs(),m--,p===t?l=void 0:(u=l,l=t),l!==t?(p=u,m++,f=oc(),m--,f===t?p=void 0:(u=p,p=t),p!==t?(f=u,m++,v=jt(),m--,v===t?f=void 0:(u=f,f=t),f!==t?(r.length>u?(v=r.charAt(u),u++):(v=t,m===0&&E(Va)),v!==t?(P=n,n=v):(u=n,n=t)):(u=n,n=t)):(u=n,n=t)):(u=n,n=t))))),n}function ic(){let n,l;return n=u,r.charCodeAt(u)===42?(l=z,u++):(l=t,m===0&&E(Wa)),l!==t&&(P=n,l=Ol()),n=l,n}function Rt(){let n,l,p,f,v;for(n=u,l=[],p=O();p!==t;)l.push(p),p=O();if(p=jt(),p!==t){for(f=[],v=O();v!==t;)f.push(v),v=O();P=n,n=Pl(l,p,f)}else u=n,n=t;if(n===t)for(n=[],l=O();l!==t;)n.push(l),l=O();return n}function As(){let n,l;return n=u,r.substr(u,2)===Y?(l=Y,u+=2):(l=t,m===0&&E(Ga)),l!==t&&(P=n,l=Tl()),n=l,n===t&&(n=u,r.substr(u,2)===H?(l=H,u+=2):(l=t,m===0&&E(Ya)),l!==t&&(P=n,l=Ll()),n=l,n===t&&(n=u,r.substr(u,2)===ut?(l=ut,u+=2):(l=t,m===0&&E(Za)),l!==t&&(P=n,l=Dl()),n=l)),n}function sc(){let n,l,p;return n=u,r.charCodeAt(u)===92?(l=ce,u++):(l=t,m===0&&E(ti)),l!==t?(p=Cs(),p!==t?(P=n,n=p):(u=n,n=t)):(u=n,n=t),n}function nc(){let n,l,p;return n=u,r.charCodeAt(u)===92?(l=ce,u++):(l=t,m===0&&E(ti)),l!==t?(p=r.substr(u,2),p.toLowerCase()===w?u+=2:(p=t,m===0&&E(gs)),p===t&&(p=r.substr(u,3),p.toLowerCase()===S?u+=3:(p=t,m===0&&E(bs)),p===t&&(p=r.substr(u,3),p.toLowerCase()===A?u+=3:(p=t,m===0&&E(ys)))),p!==t?(P=n,n=p):(u=n,n=t)):(u=n,n=t),n}function oc(){let n;return n=ni(),n===t&&(n=oi(),n===t&&(n=ai())),n}function Cs(){let n;return n=r.charAt(u),Da.test(n)?u++:(n=t,m===0&&E(Ja)),n}function Os(){let n,l;return n=u,r.substr(u,2)===ge?(l=ge,u+=2):(l=t,m===0&&E(Ka)),l!==t&&(P=n,l=Nl()),n=l,n}function ac(){let n,l;return n=u,r.substr(u,2)===Be?(l=Be,u+=2):(l=t,m===0&&E(Xa)),l!==t&&(P=n,l=Ml()),n=l,n===t&&(n=u,r.substr(u,2)===X?(l=X,u+=2):(l=t,m===0&&E(el)),l!==t&&(P=n,l=zl()),n=l,n===t&&(n=u,r.charCodeAt(u)===60?(l=ir,u++):(l=t,m===0&&E(tl)),l!==t&&(P=n,l=Il()),n=l,n===t&&(n=u,r.charCodeAt(u)===62?(l=pt,u++):(l=t,m===0&&E(rl)),l!==t&&(P=n,l=Rl()),n=l))),n}function O(){let n;return m++,n=r.charAt(u),Na.test(n)?u++:(n=t,m===0&&E(sl)),m--,n===t&&m===0&&E(il),n}function jt(){let n,l,p;return n=u,P=u,l=jl(),l?l=void 0:l=t,l!==t?(r.substr(u,14)===ht?(p=ht,u+=14):(p=t,m===0&&E(nl)),p!==t?(P=n,n=Bl()):(u=n,n=t)):(u=n,n=t),n}const{errorOnLuceneSyntax:Ac,parseCursor:lc,cursorSymbol:cc,allowLeadingWildcards:uc=!0,helpers:{nodeTypes:He}}=s,ee=He.function.buildNodeWithArgumentNodes,ke=He.literal.buildNode,pc=He.wildcard.buildNode,Ps=He.namedArg.buildNode,{wildcardSymbol:ui}=He.wildcard;Nt=d();const pi=Nt!==t&&u===r.length;function Ts(){throw Nt!==t&&u<r.length&&E(Ql()),Vl(or,re<r.length?Hl(re):null,re<r.length?ar(re,re+1):ar(re,re))}if(s.peg$library)return{peg$result:Nt,peg$currPos:u,peg$FAILED:t,peg$maxFailExpected:or,peg$maxFailPos:re,peg$success:pi,peg$throw:pi?void 0:Ts};if(pi)return Nt;Ts()}return{StartRules:["start","Literal"],SyntaxError:i,parse:e}}(),Mr=(i,e={},r=Yt)=>{if(typeof i>"u")throw new Error("expression must be a string, got undefined instead");return r(i,{...e,helpers:{nodeTypes:ae}})},Je=(i,e={})=>Mr(i,{...e,startRule:"Literal"},Yt),Zt=(i,e={})=>{try{return Mr(i,e,Yt)}catch(r){throw r.name==="SyntaxError"?new Fi(r,i):r}},kn=i=>{try{return Mr(i,{errorOnLuceneSyntax:!0},Yt),!1}catch(e){return e.message.startsWith("Lucene")}},F=(i,e,r,s)=>(e=void 0,!i||!i.type||!ae[i.type]?F(ae.function.buildNode("and",[]),e):ae[i.type].toOpenSearchQuery(i,e,r,s)),he="@kuery-wildcard@";function En(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function An(i){return i.replace(/[+-=&|><!(){}[\]^"~*?:\\/]/g,"\\$&")}function Cn(i){return i.includes(he)?{type:"wildcard",value:i}:Je(i)}function Qi(i,e){const{value:r}=i,s=r.split(he).map(En).join("[\\s\\S]*");return new RegExp(`^${s}$`).test(e)}function On(i){const{value:e}=i;return e.split(he).join("*")}function zr(i){const{value:e}=i;return e.split(he).map(An).join("*")}function Pn(i){const{value:e}=i;return e.startsWith(he)&&e.replace(he,"").length>0}const Tn=Object.freeze(Object.defineProperty({__proto__:null,buildNode:Cn,hasLeadingWildcard:Pn,test:Qi,toOpenSearchQuery:On,toQueryStringQuery:zr,wildcardSymbol:he},Symbol.toStringTag,{value:"Module"}));function Ir(i,e){if(!e)return[];if(i.type==="literal"){const r=Nr(i),s=e.fields.find(t=>t.name===r);return s?[s]:[]}else if(i.type==="wildcard")return e.fields.filter(s=>Qi(i,s.name))}function hc(i){return i}function qi(i,e,r){const s={...i,value:r?`${r}.${i.value}`:i.value};if(!e||s.type==="wildcard"&&!r)return s;const a=Ir(s,e).reduce((o,d)=>{const c=d.subType&&d.subType.nested?d.subType.nested.path:void 0;return r&&!c?[...o,`${d.name} is not a nested field but is in nested group "${r}" in the DQL expression.`]:c&&!r?[...o,`${d.name} is a nested field, but is not in a nested group in the DQL expression.`]:c!==r?[...o,`Nested field ${d.name} is being queried with the incorrect nested path. The correct path is ${d.subType.nested.path}.`]:o},[]);if(a.length>0)throw new Error(a.join(`
|
|
788
|
+
`));return s}function Ln(i,e,r=!1){if(i===void 0)throw new Error("fieldName is a required argument");if(e===void 0)throw new Error("value is a required argument");const s=typeof i=="string"?Je(i):Ze(i),t=typeof e=="string"?Je(e):Ze(e),a=Ze(r);return{arguments:[s,t,a]}}function Dn(i,e,r={},s={}){const{arguments:[t,a,o]}=i,d=qi(t,e,s!=null&&s.nested?s.nested.path:void 0),c=F(d),b=a!==void 0?F(a):a,_=o.value?"phrase":"best_fields";if(d.value===null)return a.type==="wildcard"?{query_string:{query:zr(a)}}:{multi_match:{type:_,query:b,lenient:!0}};const y=e?Ir(d,e):[];y&&y.length===0&&y.push({name:F(d),scripted:!1,type:""});const C=a.type==="wildcard"&&b==="*",w=d.type==="wildcard"&&c==="*"||y&&e&&y.length===e.fields.length;return C&&w?{match_all:{}}:{bool:{should:y.reduce((L,N)=>{const ce=z=>{var Y;return d.type!=="wildcard"||!((Y=N.subType)!=null&&Y.nested)||s!=null&&s.nested?z:{nested:{path:N.subType.nested.path,query:z,score_mode:"none"}}};if(N.scripted)return[];if(C)return[...L,ce({exists:{field:N.name}})];if(a.type==="wildcard")return[...L,ce({query_string:{fields:[N.name],query:zr(a)}})];if(N.type==="date"){const z=r.dateFormatTZ?{time_zone:r.dateFormatTZ}:{};return[...L,ce({range:{[N.name]:{gte:b,lte:b,...z}}})]}else{const z=_==="phrase"?"match_phrase":"match";return[...L,ce({[z]:{[N.name]:b}})]}},[])||[],minimum_should_match:1}}}const Nn=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:Ln,toOpenSearchQuery:Dn},Symbol.toStringTag,{value:"Module"}));function Mn(i){return{arguments:i}}function zn(i,e,r={},s={}){return{bool:{filter:(i.arguments||[]).map(a=>F(a,e,r,s))}}}const In=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:Mn,toOpenSearchQuery:zn},Symbol.toStringTag,{value:"Module"}));function Rn(i){return{arguments:i}}function jn(i,e,r={},s={}){return{bool:{should:(i.arguments||[]).map(a=>F(a,e,r,s)),minimum_should_match:1}}}const Bn=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:Rn,toOpenSearchQuery:jn},Symbol.toStringTag,{value:"Module"}));function Un(i){return{arguments:[i]}}function Hn(i,e,r={},s={}){const[t]=i.arguments;return{bool:{must_not:F(t,e,r,s)}}}const Fn=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:Un,toOpenSearchQuery:Hn},Symbol.toStringTag,{value:"Module"}));function Qn(i,...e){let r={};for(let s of e)r[s]=i[s];return r}function qn(i,e){const r=Qn(e,"gt","lt","gte","lte","format"),s=typeof i=="string"?Je(i):ae.literal.buildNode(i),t=Object.entries(r).map(a=>{let[o,d]=a;return ae.namedArg.buildNode(o,d)});return{arguments:[s,...t]}}function Vn(i,e,r={},s={}){const[t,...a]=i.arguments,o=qi(t,e,s!=null&&s.nested?s.nested.path:void 0),d=e?Ir(o,e):[],c=Wn(a),b=Object.fromEntries(Object.entries(c).map(([y,C])=>[y,F(C)]));return d&&d.length===0&&d.push({name:F(o),scripted:!1,type:""}),{bool:{should:d.map(y=>{const C=w=>{var S;return o.type!=="wildcard"||!((S=y.subType)!=null&&S.nested)||s.nested?w:{nested:{path:y.subType.nested.path,query:w,score_mode:"none"}}};if(y.scripted)return{};if(y.type==="date"){const w=r.dateFormatTZ?{time_zone:r.dateFormatTZ}:{};return C({range:{[y.name]:{...b,...w}}})}return C({range:{[y.name]:b}})}),minimum_should_match:1}}}function Wn(i){if(i.gt&&i.gte||i.lt&&i.lte)throw new Error("range ends cannot be both inclusive and exclusive");const e=["gte","lte","format"];return i.reduce((r,s,t)=>(s.type==="namedArg"?r[s.name]=s.value:r[e[t]]=s,r),{})}const Gn=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:qn,toOpenSearchQuery:Vn},Symbol.toStringTag,{value:"Module"}));function Yn(i){return{arguments:[Ze(i)]}}function Zn(i,e,r={},s={}){const{arguments:[t]}=i,a={...t,value:s!=null&&s.nested?`${s.nested.path}.${t.value}`:t.value},o=Nr(a),d=((e==null?void 0:e.fields)||[]).find(c=>c.name===o);if(d&&d.scripted)throw new Error("Exists query does not support scripted fields");return{exists:{field:o}}}const Jn=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:Yn,toOpenSearchQuery:Zn},Symbol.toStringTag,{value:"Module"}));function Kn(i,e){return{arguments:[typeof i=="string"?Je(i):Ze(i),e]}}function Xn(i,e,r={},s={}){var c;const[t,a]=i.arguments,o=F(t),d=(c=s==null?void 0:s.nested)!=null&&c.path?`${s.nested.path}.${o}`:o;return{nested:{path:d,query:F(a,e,r,{...s,nested:{path:d}}),score_mode:"none"}}}const eo=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:Kn,toOpenSearchQuery:Xn},Symbol.toStringTag,{value:"Module"}));/* @preserve
|
|
789
|
+
* @terraformer/wkt - v2.2.0 - MIT
|
|
790
|
+
* Copyright (c) 2012-2024 Environmental Systems Research Institute, Inc.
|
|
791
|
+
* Wed May 15 2024 14:35:51 GMT-0700 (Pacific Daylight Time)
|
|
792
|
+
*/var x=function(e,r,s,t){for(s=s||{},t=e.length;t--;s[e[t]]=r);return s},Ke=[1,9],Xe=[1,10],et=[1,11],tt=[1,12],rt=[1,13],it=[1,14],st=[1,15],U=[1,60],T=[5,15,19],de=[1,67],oe=[1,73],At=[1,87],Ct=[1,104],D=[15,19],me=[1,110],fe=[1,116],Jt=[1,130],Kt=[1,136],Ot={trace:function(){},yy:{},symbols_:{error:2,expressions:3,point:4,EOF:5,linestring:6,polygon:7,multipoint:8,multilinestring:9,multipolygon:10,geometrycollection:11,coordinate:12,DOUBLE_TOK:13,ptarray:14,COMMA:15,ring_list:16,ring:17,"(":18,")":19,POINT:20,Z:21,ZM:22,M:23,EMPTY:24,point_untagged:25,polygon_list:26,polygon_untagged:27,point_list:28,LINESTRING:29,POLYGON:30,MULTIPOINT:31,MULTILINESTRING:32,MULTIPOLYGON:33,geometry:34,geometry_collection:35,GEOMETRYCOLLECTION:36,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",13:"DOUBLE_TOK",15:"COMMA",18:"(",19:")",20:"POINT",21:"Z",22:"ZM",23:"M",24:"EMPTY",29:"LINESTRING",30:"POLYGON",31:"MULTIPOINT",32:"MULTILINESTRING",33:"MULTIPOLYGON",36:"GEOMETRYCOLLECTION"},productions_:[0,[3,2],[3,2],[3,2],[3,2],[3,2],[3,2],[3,2],[12,2],[12,3],[12,4],[14,3],[14,1],[16,3],[16,1],[17,3],[4,4],[4,5],[4,5],[4,5],[4,2],[25,1],[25,3],[26,3],[26,1],[27,3],[28,3],[28,1],[6,4],[6,5],[6,5],[6,5],[6,2],[7,4],[7,5],[7,5],[7,5],[7,2],[8,4],[8,5],[8,5],[8,5],[8,2],[9,4],[9,5],[9,5],[9,5],[9,2],[10,4],[10,5],[10,5],[10,5],[10,2],[34,1],[34,1],[34,1],[34,1],[34,1],[34,1],[34,1],[35,3],[35,1],[11,4],[11,5],[11,5],[11,5],[11,2]],performAction:function(e,r,s,t,a,o,d){var c=o.length-1;switch(a){case 1:case 2:case 3:case 4:case 5:case 6:case 7:return o[c-1];case 8:this.$=new Pt([Number(o[c-1]),Number(o[c])]);break;case 9:this.$=new Pt([Number(o[c-2]),Number(o[c-1]),Number(o[c])]);break;case 10:this.$=new Pt([Number(o[c-3]),Number(o[c-2]),Number(o[c-1]),Number(o[c])]);break;case 11:case 26:this.$=o[c-2].addPoint(o[c]);break;case 12:case 21:case 27:case 53:case 54:case 55:case 56:case 57:case 58:case 59:this.$=o[c];break;case 13:this.$=o[c-2].addRing(o[c]);break;case 14:this.$=new Rr(o[c]);break;case 15:this.$=new Wi(o[c-1]);break;case 16:this.$={type:"Point",coordinates:o[c-1].data[0]};break;case 17:this.$={type:"Point",coordinates:o[c-1].data[0],properties:{z:!0}};break;case 18:this.$={type:"Point",coordinates:o[c-1].data[0],properties:{z:!0,m:!0}};break;case 19:this.$={type:"Point",coordinates:o[c-1].data[0],properties:{m:!0}};break;case 20:this.$={type:"Point",coordinates:[]};break;case 22:case 25:this.$=o[c-1];break;case 23:this.$=o[c-2].addPolygon(o[c]);break;case 24:this.$=new Br(o[c]);break;case 28:this.$={type:"LineString",coordinates:o[c-1].data};break;case 29:this.$={type:"LineString",coordinates:o[c-1].data,properties:{z:!0}};break;case 30:this.$={type:"LineString",coordinates:o[c-1].data,properties:{m:!0}};break;case 31:this.$={type:"LineString",coordinates:o[c-1].data,properties:{z:!0,m:!0}};break;case 32:this.$={type:"LineString",coordinates:[]};break;case 33:this.$={type:"Polygon",coordinates:o[c-1].toJSON()};break;case 34:this.$={type:"Polygon",coordinates:o[c-1].toJSON(),properties:{z:!0}};break;case 35:this.$={type:"Polygon",coordinates:o[c-1].toJSON(),properties:{m:!0}};break;case 36:this.$={type:"Polygon",coordinates:o[c-1].toJSON(),properties:{z:!0,m:!0}};break;case 37:this.$={type:"Polygon",coordinates:[]};break;case 38:this.$={type:"MultiPoint",coordinates:o[c-1].data};break;case 39:this.$={type:"MultiPoint",coordinates:o[c-1].data,properties:{z:!0}};break;case 40:this.$={type:"MultiPoint",coordinates:o[c-1].data,properties:{m:!0}};break;case 41:this.$={type:"MultiPoint",coordinates:o[c-1].data,properties:{z:!0,m:!0}};break;case 42:this.$={type:"MultiPoint",coordinates:[]};break;case 43:this.$={type:"MultiLineString",coordinates:o[c-1].toJSON()};break;case 44:this.$={type:"MultiLineString",coordinates:o[c-1].toJSON(),properties:{z:!0}};break;case 45:this.$={type:"MultiLineString",coordinates:o[c-1].toJSON(),properties:{m:!0}};break;case 46:this.$={type:"MultiLineString",coordinates:o[c-1].toJSON(),properties:{z:!0,m:!0}};break;case 47:this.$={type:"MultiLineString",coordinates:[]};break;case 48:this.$={type:"MultiPolygon",coordinates:o[c-1].toJSON()};break;case 49:this.$={type:"MultiPolygon",coordinates:o[c-1].toJSON(),properties:{z:!0}};break;case 50:this.$={type:"MultiPolygon",coordinates:o[c-1].toJSON(),properties:{m:!0}};break;case 51:this.$={type:"MultiPolygon",coordinates:o[c-1].toJSON(),properties:{z:!0,m:!0}};break;case 52:this.$={type:"MultiPolygon",coordinates:[]};break;case 60:this.$=o[c-2].addGeometry(o[c]);break;case 61:this.$=new jr(o[c]);break;case 62:this.$={type:"GeometryCollection",geometries:o[c-1].toJSON()};break;case 63:this.$={type:"GeometryCollection",geometries:o[c-1].toJSON(),properties:{z:!0}};break;case 64:this.$={type:"GeometryCollection",geometries:o[c-1].toJSON(),properties:{m:!0}};break;case 65:this.$={type:"GeometryCollection",geometries:o[c-1].toJSON(),properties:{z:!0,m:!0}};break;case 66:this.$={type:"GeometryCollection",geometries:[]};break}},table:[{3:1,4:2,6:3,7:4,8:5,9:6,10:7,11:8,20:Ke,29:Xe,30:et,31:tt,32:rt,33:it,36:st},{1:[3]},{5:[1,16]},{5:[1,17]},{5:[1,18]},{5:[1,19]},{5:[1,20]},{5:[1,21]},{5:[1,22]},{18:[1,23],21:[1,24],22:[1,25],23:[1,26],24:[1,27]},{18:[1,28],21:[1,29],22:[1,31],23:[1,30],24:[1,32]},{18:[1,33],21:[1,34],22:[1,36],23:[1,35],24:[1,37]},{18:[1,38],21:[1,39],22:[1,41],23:[1,40],24:[1,42]},{18:[1,43],21:[1,44],22:[1,46],23:[1,45],24:[1,47]},{18:[1,48],21:[1,49],22:[1,51],23:[1,50],24:[1,52]},{18:[1,53],21:[1,54],22:[1,56],23:[1,55],24:[1,57]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{1:[2,7]},{12:59,13:U,14:58},{18:[1,61]},{18:[1,62]},{18:[1,63]},x(T,[2,20]),{12:66,13:U,18:de,25:65,28:64},{18:[1,68]},{18:[1,69]},{18:[1,70]},x(T,[2,32]),{16:71,17:72,18:oe},{18:[1,74]},{18:[1,75]},{18:[1,76]},x(T,[2,37]),{12:66,13:U,18:de,25:65,28:77},{18:[1,78]},{18:[1,79]},{18:[1,80]},x(T,[2,42]),{16:81,17:72,18:oe},{18:[1,82]},{18:[1,83]},{18:[1,84]},x(T,[2,47]),{18:At,26:85,27:86},{18:[1,88]},{18:[1,89]},{18:[1,90]},x(T,[2,52]),{4:93,6:94,7:95,8:96,9:97,10:98,11:99,20:Ke,29:Xe,30:et,31:tt,32:rt,33:it,34:92,35:91,36:st},{18:[1,100]},{18:[1,101]},{18:[1,102]},x(T,[2,66]),{15:Ct,19:[1,103]},x(D,[2,12]),{13:[1,105]},{12:59,13:U,14:106},{12:59,13:U,14:107},{12:59,13:U,14:108},{15:me,19:[1,109]},x(D,[2,27]),x(D,[2,21]),{12:111,13:U},{12:66,13:U,18:de,25:65,28:112},{12:66,13:U,18:de,25:65,28:113},{12:66,13:U,18:de,25:65,28:114},{15:fe,19:[1,115]},x(D,[2,14]),{12:59,13:U,14:117},{16:118,17:72,18:oe},{16:119,17:72,18:oe},{16:120,17:72,18:oe},{15:me,19:[1,121]},{12:66,13:U,18:de,25:65,28:122},{12:66,13:U,18:de,25:65,28:123},{12:66,13:U,18:de,25:65,28:124},{15:fe,19:[1,125]},{16:126,17:72,18:oe},{16:127,17:72,18:oe},{16:128,17:72,18:oe},{15:Jt,19:[1,129]},x(D,[2,24]),{16:131,17:72,18:oe},{18:At,26:132,27:86},{18:At,26:133,27:86},{18:At,26:134,27:86},{15:Kt,19:[1,135]},x(D,[2,61]),x(D,[2,53]),x(D,[2,54]),x(D,[2,55]),x(D,[2,56]),x(D,[2,57]),x(D,[2,58]),x(D,[2,59]),{4:93,6:94,7:95,8:96,9:97,10:98,11:99,20:Ke,29:Xe,30:et,31:tt,32:rt,33:it,34:92,35:137,36:st},{4:93,6:94,7:95,8:96,9:97,10:98,11:99,20:Ke,29:Xe,30:et,31:tt,32:rt,33:it,34:92,35:138,36:st},{4:93,6:94,7:95,8:96,9:97,10:98,11:99,20:Ke,29:Xe,30:et,31:tt,32:rt,33:it,34:92,35:139,36:st},x(T,[2,16]),{12:140,13:U},x(D,[2,8],{13:[1,141]}),{15:Ct,19:[1,142]},{15:Ct,19:[1,143]},{15:Ct,19:[1,144]},x(T,[2,28]),{12:66,13:U,18:de,25:145},{19:[1,146]},{15:me,19:[1,147]},{15:me,19:[1,148]},{15:me,19:[1,149]},x(T,[2,33]),{17:150,18:oe},{15:Ct,19:[1,151]},{15:fe,19:[1,152]},{15:fe,19:[1,153]},{15:fe,19:[1,154]},x(T,[2,38]),{15:me,19:[1,155]},{15:me,19:[1,156]},{15:me,19:[1,157]},x(T,[2,43]),{15:fe,19:[1,158]},{15:fe,19:[1,159]},{15:fe,19:[1,160]},x(T,[2,48]),{18:At,27:161},{15:fe,19:[1,162]},{15:Jt,19:[1,163]},{15:Jt,19:[1,164]},{15:Jt,19:[1,165]},x(T,[2,62]),{4:93,6:94,7:95,8:96,9:97,10:98,11:99,20:Ke,29:Xe,30:et,31:tt,32:rt,33:it,34:166,36:st},{15:Kt,19:[1,167]},{15:Kt,19:[1,168]},{15:Kt,19:[1,169]},x(D,[2,11]),x(D,[2,9],{13:[1,170]}),x(T,[2,17]),x(T,[2,18]),x(T,[2,19]),x(D,[2,26]),x(D,[2,22]),x(T,[2,29]),x(T,[2,30]),x(T,[2,31]),x(D,[2,13]),x(D,[2,15]),x(T,[2,34]),x(T,[2,35]),x(T,[2,36]),x(T,[2,39]),x(T,[2,40]),x(T,[2,41]),x(T,[2,44]),x(T,[2,45]),x(T,[2,46]),x(D,[2,23]),x(D,[2,25]),x(T,[2,49]),x(T,[2,50]),x(T,[2,51]),x(D,[2,60]),x(T,[2,63]),x(T,[2,64]),x(T,[2,65]),x(D,[2,10])],defaultActions:{16:[2,1],17:[2,2],18:[2,3],19:[2,4],20:[2,5],21:[2,6],22:[2,7]},parseError:function(e,r){if(r.recoverable)this.trace(e);else{var s=new Error(e);throw s.hash=r,s}},parse:function(e){var r=this,s=[0],t=[null],a=[],o=this.table,d="",c=0,b=0,_=2,y=1,C=a.slice.call(arguments,1),w=Object.create(this.lexer),S={yy:{}};for(var A in this.yy)Object.prototype.hasOwnProperty.call(this.yy,A)&&(S.yy[A]=this.yy[A]);w.setInput(e,S.yy),S.yy.lexer=w,S.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var L=w.yylloc;a.push(L);var N=w.options&&w.options.ranges;typeof S.yy.parseError=="function"?this.parseError=S.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var ce=function(){var xe;return xe=w.lex()||y,typeof xe!="number"&&(xe=r.symbols_[xe]||xe),xe},z,Y,H,ut,ge={},Be,X,ir,pt;;){if(Y=s[s.length-1],this.defaultActions[Y]?H=this.defaultActions[Y]:((z===null||typeof z>"u")&&(z=ce()),H=o[Y]&&o[Y][z]),typeof H>"u"||!H.length||!H[0]){var ht="";pt=[];for(Be in o[Y])this.terminals_[Be]&&Be>_&&pt.push("'"+this.terminals_[Be]+"'");w.showPosition?ht="Parse error on line "+(c+1)+`:
|
|
793
|
+
`+w.showPosition()+`
|
|
794
|
+
Expecting `+pt.join(", ")+", got '"+(this.terminals_[z]||z)+"'":ht="Parse error on line "+(c+1)+": Unexpected "+(z==y?"end of input":"'"+(this.terminals_[z]||z)+"'"),this.parseError(ht,{text:w.match,token:this.terminals_[z]||z,line:w.yylineno,loc:L,expected:pt})}if(H[0]instanceof Array&&H.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Y+", token: "+z);switch(H[0]){case 1:s.push(z),t.push(w.yytext),a.push(w.yylloc),s.push(H[1]),z=null,b=w.yyleng,d=w.yytext,c=w.yylineno,L=w.yylloc;break;case 2:if(X=this.productions_[H[1]][1],ge.$=t[t.length-X],ge._$={first_line:a[a.length-(X||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(X||1)].first_column,last_column:a[a.length-1].last_column},N&&(ge._$.range=[a[a.length-(X||1)].range[0],a[a.length-1].range[1]]),ut=this.performAction.apply(ge,[d,b,c,S.yy,H[1],t,a].concat(C)),typeof ut<"u")return ut;X&&(s=s.slice(0,-1*X*2),t=t.slice(0,-1*X),a=a.slice(0,-1*X)),s.push(this.productions_[H[1]][0]),t.push(ge.$),a.push(ge._$),ir=o[s[s.length-2]][s[s.length-1]],s.push(ir);break;case 3:return!0}}return!0}},to=function(){var i={EOF:1,parseError:function(r,s){if(this.yy.parser)this.yy.parser.parseError(r,s);else throw new Error(r)},setInput:function(r,s){return this.yy=s||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var s=r.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},unput:function(r){var s=r.length,t=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var a=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),t.length-1&&(this.yylineno-=t.length-1);var o=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:t?(t.length===a.length?this.yylloc.first_column:0)+a[a.length-t.length].length-t[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[o[0],o[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
795
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(r){this.unput(this.match.slice(r))},pastInput:function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var r=this.pastInput(),s=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
|
|
796
|
+
`+s+"^"},test_match:function(r,s){var t,a,o;if(this.options.backtrack_lexer&&(o={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(o.yylloc.range=this.yylloc.range.slice(0))),a=r[0].match(/(?:\r\n?|\n).*/g),a&&(this.yylineno+=a.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:a?a[a.length-1].length-a[a.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(r[0].length),this.matched+=r[0],t=this.performAction.call(this,this.yy,this,s,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),t)return t;if(this._backtrack){for(var d in o)this[d]=o[d];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,s,t,a;this._more||(this.yytext="",this.match="");for(var o=this._currentRules(),d=0;d<o.length;d++)if(t=this._input.match(this.rules[o[d]]),t&&(!s||t[0].length>s[0].length)){if(s=t,a=d,this.options.backtrack_lexer){if(r=this.test_match(t,o[d]),r!==!1)return r;if(this._backtrack){s=!1;continue}else return!1}else if(!this.options.flex)break}return s?(r=this.test_match(s,o[a]),r!==!1?r:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
797
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var r=this.next();return r||this.lex()},begin:function(r){this.conditionStack.push(r)},popState:function(){var r=this.conditionStack.length-1;return r>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(r){return r=this.conditionStack.length-1-Math.abs(r||0),r>=0?this.conditionStack[r]:"INITIAL"},pushState:function(r){this.begin(r)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(r,s,t,a){switch(t){case 0:break;case 1:return 18;case 2:return 19;case 3:return 13;case 4:return 20;case 5:return 29;case 6:return 30;case 7:return 31;case 8:return 32;case 9:return 33;case 10:return 36;case 11:return 15;case 12:return 24;case 13:return 23;case 14:return 21;case 15:return 22;case 16:return 5;case 17:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:\()/,/^(?:\))/,/^(?:-?[0-9]+(\.[0-9]+)?([eE][\-\+]?[0-9]+)?)/,/^(?:POINT\b)/,/^(?:LINESTRING\b)/,/^(?:POLYGON\b)/,/^(?:MULTIPOINT\b)/,/^(?:MULTILINESTRING\b)/,/^(?:MULTIPOLYGON\b)/,/^(?:GEOMETRYCOLLECTION\b)/,/^(?:,)/,/^(?:EMPTY\b)/,/^(?:M\b)/,/^(?:Z\b)/,/^(?:ZM\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],inclusive:!0}}};return i}();Ot.lexer=to;function Vi(){this.yy={}}Vi.prototype=Ot,Ot.Parser=Vi,Ot.yy.parseError=function(i){throw i};function Pt(i){this.data=[i],this.type="PointArray"}Pt.prototype.addPoint=function(i){return i.type==="PointArray"?this.data=this.data.concat(i.data):this.data.push(i),this},Pt.prototype.toJSON=function(){return this.data};function Wi(i){this.data=i,this.type="Ring"}Wi.prototype.toJSON=function(){for(var i=[],e=0;e<this.data.data.length;e++)i.push(this.data.data[e]);return i};function Rr(i){this.data=[i],this.type="RingList"}Rr.prototype.addRing=function(i){return this.data.push(i),this},Rr.prototype.toJSON=function(){for(var i=[],e=0;e<this.data.length;e++)i.push(this.data[e].toJSON());return i.length===1,i};function jr(i){this.data=[i],this.type="GeometryList"}jr.prototype.addGeometry=function(i){return this.data.push(i),this},jr.prototype.toJSON=function(){return this.data};function Br(i){this.data=[i],this.type="PolygonList"}Br.prototype.addPolygon=function(i){return this.data.push(i),this},Br.prototype.toJSON=function(){for(var i=[],e=0;e<this.data.length;e++)i=i.concat([this.data[e].toJSON()]);return i};var Gi=function(e){var r;try{r=Ot.parse(e)}catch(s){throw Error("Unable to parse: "+s)}return r};function ro(i){const[e,r,s]=i.arguments;return{bool:{must:[{exists:{field:e.value}},{geo_shape:{[e.value]:{relation:r,shape:Gi(s.value)}}}]}}}const Ur={is:Nn,and:In,or:Bn,not:Fn,range:Gn,exists:Jn,nested:eo,geospatial:Object.freeze(Object.defineProperty({__proto__:null,toOpenSearchQuery:ro},Symbol.toStringTag,{value:"Module"}))};function io(i,...e){const r=Ur[i];if(r===void 0)throw new Error(`Unknown function "${i}"`);return{type:"function",function:i,...r.buildNodeParams(...e)}}function so(i,e){if(Ur[i]===void 0)throw new Error(`Unknown function "${i}"`);return{type:"function",function:i,arguments:e}}function no(i,e,r,s){return Ur[i.function].toOpenSearchQuery(i,e,r,s)}const oo=Object.freeze(Object.defineProperty({__proto__:null,buildNode:io,buildNodeWithArgumentNodes:so,toOpenSearchQuery:no},Symbol.toStringTag,{value:"Module"}));function ao(i,e){const r=e.type==="literal"?e:ae.literal.buildNode(e);return{type:"namedArg",name:i,value:r}}function lo(i){return F(i.value)}const ae={function:oo,literal:xn,namedArg:Object.freeze(Object.defineProperty({__proto__:null,buildNode:ao,toOpenSearchQuery:lo},Symbol.toStringTag,{value:"Module"})),wildcard:Tn},co=he,uo=(i,e)=>"("+(i.arguments||[]).map(s=>ze(s,e)).join(" AND ")+")",po=(i,e)=>{var{arguments:[r,s,t]}=i;let a="=";s.type==="wildcard"&&(a="");let o=ze(s);t=t.value||typeof o=="string",s.type==="literal"&&t&&(o=`'${o}'`),s.type==="literal"&&!t&&(o=`${o}`);let d=ze(r);return d==null?e&&t?`(${e.filter(c=>c.type==="string").map(c=>`${c.name} ILIKE '%${s.value}%'`).join(" OR ")})`:e&&!t&&(s.value===!0||s.value===!1)?`(${e.filter(c=>c.type==="boolean").map(c=>`${c.name}=${s.value}`).join(" OR ")})`:"":d+a+o},ho=(i,e)=>"("+(i.arguments||[]).map(s=>ze(s,e)).join(" OR ")+")",fo=(i,e)=>{const[r]=i.arguments;return"NOT ("+ze(r,e)+")"},go={gt:">",lt:"<",gte:">=",lte:"<="},bo={is:po,and:uo,or:ho,not:fo,range:i=>{const[e,r]=i.arguments;let s=r.value;const t=go[r.name];let a=ze(s);return s.type==="literal"&&(a=`${a}`),`${e.value} ${t} ${a}`},exists:i=>{const[e]=i.arguments;return`${e.value} IS NOT NULL`},nested:i=>(console.warn("Nested types dont exist in CQL",i),""),geospatial:i=>{const[e,r,s]=i.arguments;if(console.log(e,r,s),r==="within")return`WITHIN(${e.value},${s.value})`;throw Error(`Unsupported GEO Operator:${r}`)}},yo={function:(i,e)=>bo[i.function](i,e),literal:i=>i.value,wildcard:i=>{const{value:e}=i;return` LIKE '${e.split(co).join("%")}'`}},ze=(i,e)=>{const r=yo[i.type];return r(i,e)},vo=he,mo=i=>({$and:(i.arguments||[]).map(s=>$e(s))}),$o=i=>{const{arguments:[e,r]}=i;let s=$e(r);if(r.type==="wildcard"&&r.value==="@kuery-wildcard@")return Yi(i);let a={};return a[$e(e)]={$eq:s},a},_o=i=>({$or:(i.arguments||[]).map(r=>$e(r))}),wo=i=>{const[e]=i.arguments;let r={};return r={$ne:$e(e)},r},So={gt:"$gt",lt:"$lt",gte:"$gte",lte:"$lte"},xo=i=>{const[e,r]=i.arguments;let s=r.value;const t=So[r.name];let a=$e(s),o={};return o[e.value]={},o[e.value][t]=a,o},Yi=i=>{const[e]=i.arguments;return{[$e(e)]:{$ne:null}}},ko={is:$o,and:mo,or:_o,not:wo,range:xo,exists:Yi,nested:i=>(console.warn("TODO Implement nested search",i),""),geospatial:i=>{const[e,r,s]=i.arguments;if(r=="within")return{[e.value]:{$geoWithin:Gi(s.value)}}}},Eo={function:i=>ko[i.function](i),literal:i=>i.value,wildcard:i=>{const{value:e}=i;return`/${e.split(vo).join(".*")}/`}},$e=(i,e)=>{const r=Eo[i.type];return r(i,e)},Ao=Object.freeze(Object.defineProperty({__proto__:null,DQLSyntaxError:Fi,doesKueryExpressionHaveLuceneSyntaxError:kn,fromKueryExpression:Zt,fromLiteralExpression:Je,nodeTypes:ae,parse:Zt,toCql:ze,toDSL:F,toMongo:$e,toOpenSearchQuery:F},Symbol.toStringTag,{value:"Module"})),Co=Z`
|
|
798
|
+
:host {
|
|
784
799
|
--dialog-padding: var(--spectric-dialog-padding, 5px);
|
|
785
|
-
--dialog-background:var(--spectric-background,rgb(246, 249, 252));
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
800
|
+
--dialog-background: var(--spectric-background, rgb(246, 249, 252));
|
|
801
|
+
--dialog-border-radius: var(--spectric-border-radius, 0.4em);
|
|
802
|
+
}
|
|
803
|
+
dialog {
|
|
804
|
+
border: 0px;
|
|
789
805
|
--spectric-background: var(--dialog-background);
|
|
790
|
-
--panel-color:var(--dialog-background);
|
|
806
|
+
--panel-color: var(--dialog-background);
|
|
791
807
|
padding: 0;
|
|
792
|
-
border-radius: var(--
|
|
793
|
-
overflow:hidden;
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
dialog::backdrop {
|
|
808
|
+
border-radius: var(--dialog-border-radius);
|
|
809
|
+
overflow: hidden;
|
|
810
|
+
}
|
|
811
|
+
dialog[open] {
|
|
812
|
+
display: flex;
|
|
813
|
+
}
|
|
814
|
+
spectric-panel {
|
|
815
|
+
margin: 0px;
|
|
816
|
+
}
|
|
817
|
+
dialog::backdrop {
|
|
803
818
|
background-color: transparent;
|
|
804
|
-
}
|
|
805
|
-
dialog.backdrop::backdrop {
|
|
819
|
+
}
|
|
820
|
+
dialog.backdrop::backdrop {
|
|
806
821
|
background-color: rgba(0, 0, 0, 0.5);
|
|
807
|
-
}
|
|
808
|
-
.modal{
|
|
822
|
+
}
|
|
823
|
+
.modal {
|
|
809
824
|
display: flex;
|
|
810
825
|
overflow: hidden;
|
|
811
826
|
flex-direction: column;
|
|
812
827
|
height: 100%;
|
|
813
|
-
}
|
|
814
|
-
.content{
|
|
828
|
+
}
|
|
829
|
+
.content {
|
|
815
830
|
flex-shrink: 1;
|
|
816
831
|
overflow: auto;
|
|
817
|
-
}
|
|
832
|
+
}
|
|
818
833
|
|
|
819
|
-
h3 {
|
|
834
|
+
h3 {
|
|
820
835
|
padding: 1em var(--dialog-padding);
|
|
821
836
|
margin: 0;
|
|
822
|
-
}
|
|
837
|
+
}
|
|
823
838
|
|
|
824
|
-
spectric-button{
|
|
839
|
+
spectric-button {
|
|
825
840
|
position: absolute;
|
|
826
841
|
right: 0;
|
|
827
842
|
top: 0;
|
|
828
|
-
}
|
|
829
|
-
|
|
830
|
-
<dialog
|
|
831
|
-
class=${this.hideBackdrop?"":"backdrop"}
|
|
832
|
-
@close=${this._onClose}
|
|
833
|
-
@click=${this.clickHandler}
|
|
834
|
-
>
|
|
835
|
-
<spectric-panel>
|
|
836
|
-
<div class="modal">
|
|
837
|
-
${this.dismissable?w`<spectric-button
|
|
838
|
-
variant="text"
|
|
839
|
-
size="small"
|
|
840
|
-
@click=${()=>{this.open=!1}}
|
|
841
|
-
icon
|
|
842
|
-
>X</spectric-button
|
|
843
|
-
>`:null}
|
|
844
|
-
<h3>
|
|
845
|
-
<slot name="title">
|
|
846
|
-
${this.title.length?this.title:null}
|
|
847
|
-
</slot>
|
|
848
|
-
</h3>
|
|
849
|
-
|
|
850
|
-
<div class="content"><slot></slot></div>
|
|
851
|
-
<div class="footer"><slot name="footer"></slot></div>
|
|
852
|
-
</div>
|
|
853
|
-
</spectric-panel>
|
|
854
|
-
</dialog>
|
|
855
|
-
`}},h.DialogElement.styles=Uo,de([v({type:Boolean,reflect:!0})],h.DialogElement.prototype,"open",2),de([v({type:Boolean,reflect:!0})],h.DialogElement.prototype,"dismissable",2),de([v({type:Boolean,reflect:!0})],h.DialogElement.prototype,"hideBackdrop",2),de([v({type:String,reflect:!0})],h.DialogElement.prototype,"title",2),de([v({type:Boolean,reflect:!0})],h.DialogElement.prototype,"closeOnEscape",2),de([v({type:Boolean,reflect:!0})],h.DialogElement.prototype,"closeOnOutsideClick",2),de([st("dialog")],h.DialogElement.prototype,"dialogElement",2),h.DialogElement=de([T(Et)],h.DialogElement);var Qo=Object.defineProperty,qo=Object.getOwnPropertyDescriptor,ee=(n,e,s,i)=>{for(var o=i>1?void 0:i?qo(e,s):e,t=n.length-1,c;t>=0;t--)(c=n[t])&&(o=(i?c(e,s,o):c(o))||o);return i&&o&&Qo(e,s,o),o},yr=(n=>(n.MONGO="toMongo",n.CQL="toCql",n.DSL="toDSL",n.AST="AST",n))(yr||{});const ki={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"}},Wo={exists:{value:": *",label:" exists in any form"}},Vo={eq:{value:": ",label:" equals some value"},exists:{value:": *",label:" exists in any form"}},Yo=[{value:": true",label:" value is true"},{value:": false",label:"value is false"}],Zo=Object.fromEntries(Object.entries(ki).map(([n,e])=>[n,{value:e.value,label:(e.label||"").replace("value","date-time")}]));h.SpectricQuery=class extends z{constructor(){super(),this.placeholder="",this._value="",this.value="",this.outputLanguage="AST",this.completions=[],this.completionIndex=0,this.fields=[],this._parseQuery=(e=void 0)=>{let s;if(e&&(e!=null&&e.currentTarget)&&(this.value=e.currentTarget.value),this.value)try{e&&e.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 c=xt(t,{parseCursor:!0,cursorSymbol:"@kuery-cursor@",allowLeadingWildcards:!1});this.autoComplete(c)}catch{return}try{s=xt(this.value,{allowLeadingWildcards:!1})}catch{return}let i;this.outputLanguage=="AST"?i=s:i=Io[this.outputLanguage](s,this.fields);let o=new CustomEvent("change",{detail:i});this.dispatchEvent(o)},this.getValuesForField=async(e,s)=>(console.log("getValuesForField isn't set no values returned",e,s),[]),this._selectCompletion=async()=>{if(!this.suggestion)return;let e=this.completions[this.completionIndex],s=this.value.substring(0,e.start)+e.value,i=s.length,o=this.value.substring(e.end);if(e.value.includes(o)?this.value=s:this.value=s+this.value.substring(e.end),this._input.value=this.value,this._input.setSelectionRange(i,i),e.onSelect){let t=await e.onSelect();t!==void 0&&(this.value+=t,setTimeout(()=>{this._input.focus()}))}this.completionIndex=0,this.completions=[],this._parseQuery(),this._input.focus()},this._handleArrows=e=>{var s;e.key==="Escape"&&(this.completions=[]),(e.key=="ArrowLeft"||e.key==="ArrowRight")&&setTimeout(this._parseQuery,100),this.completions.length&&["ArrowUp","ArrowDown","Enter","Tab"].includes(e.key)&&this.suggestion&&(e.preventDefault(),(e.key==="ArrowDown"||e.key==="Tab")&&(this.completionIndex+=1,this.completionIndex>this.completions.length-1&&(this.completionIndex=0)),e.key==="ArrowUp"&&(this.completionIndex-=1,this.completionIndex<0&&(this.completionIndex=this.completions.length-1)),(s=this._asyncAutocomplete)==null||s.then(i=>{let o=i.querySelector(".option.active");o&&o.scrollIntoView({block:"nearest"})}),e.key==="Enter"&&this._selectCompletion())},this.uuid=crypto.randomUUID()}createRenderRoot(){return this}async autoComplete(e){var t;if(this.completions=[],e.type!=="cursor")return;let s=[];this.suggestion=e;let{start:i,end:o}=e;for(let c of e.suggestionTypes){if(c=="conjunction"&&e.text.endsWith(" ")&&s.push(...["and ","or "].map(f=>({type:c,value:f,start:o,end:o}))),c==="field"){let f=this.fields.filter(d=>d.name.includes(e.fieldName)||d.name.includes(e.prefix)).map(d=>[{type:c,value:d.name,start:i,end:o}]).flat();s.push(...f)}if(c==="operator"){let f=this.fields.find(d=>d.name===e.fieldName);f&&(["number","integer"].includes(f.type)?s.push(...Object.values(ki).map(d=>({type:c,...d,start:o,end:o}))):f.type==="object"?s.push(...Object.values(Wo).map(d=>({type:c,...d,start:o,end:o}))):f.type==="string"?f.format==="date-time"?s.push(...Object.values(Zo).map(d=>({type:c,...d,start:o,end:o,onSelect:async()=>{let y=await this.getValuesForField(e.fieldName,e.prefix);y.length===0&&(y=["now-1m","now-1d","now-1M"]);let C,$=ot();return await new Promise(E=>{let x=h.DialogElement.display({},w`
|
|
856
|
-
<div class="query-bar-date-quick-select">
|
|
857
|
-
${y.map(k=>w`<a href="#" @click=${D=>{D.preventDefault(),C=`"${k}"`,E(C),x.open=!1}}>${k}</a>`)}
|
|
858
|
-
</div>
|
|
859
|
-
<spectric-input variant="datetime-local" @change=${k=>{if(!k.target)return;C=`"${new Date(k.target.value+":00.000Z").toISOString()}"`,$.value.disabled=C===void 0}}></spectric-input>
|
|
860
|
-
<spectric-button ${at($)} .disabled=${!0} @click=${()=>{E(C),x.open=!1}}>Submit</spectric-button>
|
|
861
|
-
`)}),C}}))):s.push(...Object.values(Vo).map(d=>({type:c,...d,start:o,end:o}))):f.type==="boolean"&&s.push(...Yo.map(d=>({type:c,...d,start:o,end:o}))))}if(c==="value"){let f=this.fields.find(d=>d.name===e.fieldName);if(f&&f.type=="boolean")s.push({type:c,value:"true",start:i,end:o},{type:c,value:"false",start:i,end:o});else{console.log(`invoke callback to get values for ${e.fieldName}`);let d=await this.getValuesForField(e.fieldName,e.prefix);(f==null?void 0:f.type)==="string"&&(d=d.map(y=>`"${y}"`)),s.push(...d.map(y=>({type:c,value:y,start:i,end:o})))}}}if(this.completions=s,this.completions.length&&this._autocomplete){let{width:c}=this._input.getBoundingClientRect();this._autocomplete.maxWidth=c,this._autocomplete.showPopover(),this._autocomplete.style.width=`${c-15}px`;let f=this._autocomplete.querySelector("[popover]");f&&(f.style.width=`${c-15}px`)}else(t=this._autocomplete)==null||t.hidePopover()}updated(e){e.has("outputLanguage")&&this._parseQuery()}render(){return w`
|
|
862
|
-
<spectric-input .value=${this.value} .placeholder=${this.placeholder} style=${`anchor-name:--${this.uuid};`} autocomplete="off" @input=${this._parseQuery} @keydown=${this._handleArrows} @change=${e=>e.stopPropagation()}></spectric-input>
|
|
863
|
-
<spectric-popover position="bottom" class="autocomplete" .text=${this.completions.map((e,s)=>w`<div @click=${()=>{this.completionIndex=s,this._selectCompletion()}}
|
|
864
|
-
class=${this.completionIndex==s?"option active":"option"}>
|
|
865
|
-
<span class="optiontype ${e.type}">${e.type}</span>
|
|
866
|
-
<span class="value">${e.value}</span>
|
|
867
|
-
<span class="label">${e.label}</span>
|
|
868
|
-
</div>
|
|
869
|
-
`)}>
|
|
870
|
-
|
|
871
|
-
</spectric-popover>
|
|
872
|
-
`}},ee([v({type:String,reflect:!0})],h.SpectricQuery.prototype,"placeholder",2),ee([v({type:String,reflect:!0})],h.SpectricQuery.prototype,"value",2),ee([v({type:String,reflect:!0})],h.SpectricQuery.prototype,"outputLanguage",2),ee([Q()],h.SpectricQuery.prototype,"completions",2),ee([Q()],h.SpectricQuery.prototype,"completionIndex",2),ee([v({type:Array,reflect:!0})],h.SpectricQuery.prototype,"fields",2),ee([ue(".autocomplete")],h.SpectricQuery.prototype,"_autocomplete",2),ee([st(".autocomplete")],h.SpectricQuery.prototype,"_asyncAutocomplete",2),ee([ue("spectric-input")],h.SpectricQuery.prototype,"_input",2),h.SpectricQuery=ee([T("spectric-query")],h.SpectricQuery);const Pi=F`
|
|
843
|
+
}
|
|
844
|
+
`,Zi=Z`
|
|
873
845
|
--panel-color: var(--spectric-background,#f4f4f4);
|
|
874
846
|
--panel-color-inverse: var(--spectric-background-inverse,#ffffff);
|
|
875
847
|
border-color: color-mix(in hsl, var(--panel-color, #0b0b0b), var(--spectric-input-color, #000000) 3%);
|
|
@@ -879,7 +851,7 @@ spectric-button{
|
|
|
879
851
|
--spectric-text-primary:var(--text-primary,#161616);
|
|
880
852
|
--spectric-text-secondary:var(--text-secondary,#525252);
|
|
881
853
|
filter: drop-shadow(0px 1px 3px color-mix(in srgb, var(--text-secondary, #3c4c5b), transparent 50%));
|
|
882
|
-
`,
|
|
854
|
+
`,Ji=Z`
|
|
883
855
|
border-color: color-mix(in hsl, var(--panel-color-inverse,#f4f4f4), var(--spectric-input-color, #000000) 3%);
|
|
884
856
|
background-color: var(--panel-color-inverse,#0b0b0b);
|
|
885
857
|
color:var(--text-primary,#3c4c5b);
|
|
@@ -887,7 +859,7 @@ spectric-button{
|
|
|
887
859
|
--spectric-text-primary:var(--text-secondary,#525252);
|
|
888
860
|
--spectric-text-secondary:var(--text-primary,#161616);
|
|
889
861
|
filter: drop-shadow(0px 1px 3px color-mix(in srgb, var(--text-primary, #3c4c5b), transparent 70%));
|
|
890
|
-
`,
|
|
862
|
+
`,Oo=Z`
|
|
891
863
|
:host{
|
|
892
864
|
display:block;
|
|
893
865
|
border:2px solid black;
|
|
@@ -897,20 +869,125 @@ spectric-button{
|
|
|
897
869
|
|
|
898
870
|
}
|
|
899
871
|
:host(spectric-panel[level='0']) {
|
|
900
|
-
${
|
|
872
|
+
${Zi};
|
|
901
873
|
}
|
|
902
874
|
|
|
903
875
|
:host(spectric-panel[level='1']) {
|
|
904
|
-
${
|
|
876
|
+
${Ji};
|
|
905
877
|
}
|
|
906
878
|
|
|
907
879
|
:host(spectric-panel[level='2']) {
|
|
908
|
-
${
|
|
880
|
+
${Zi};
|
|
909
881
|
}
|
|
910
882
|
:host(spectric-panel[level='3']) {
|
|
911
|
-
${
|
|
883
|
+
${Ji};
|
|
912
884
|
}
|
|
913
|
-
`;var
|
|
885
|
+
`;var Po=Object.defineProperty,To=Object.getOwnPropertyDescriptor,Hr=(i,e,r,s)=>{for(var t=s>1?void 0:s?To(e,r):e,a=i.length-1,o;a>=0;a--)(o=i[a])&&(t=(s?o(e,r,t):o(t))||t);return s&&t&&Po(e,r,t),t};h.SpectricPanel=class extends ie{constructor(){super(),this.level=0,this.addDisposableListener(this,"layer-add",()=>{this.layers=this.querySelectorAll("spectric-panel")},{capture:!0})}connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("layer-add",{bubbles:!0,cancelable:!0,composed:!0,detail:{layer:this,level:this.level}}))}update(e){this.layers=this.querySelectorAll("spectric-panel"),this.layers.forEach(r=>{r.setAttribute("level",((this.level+1)%4).toString())}),super.update(e)}render(){return $` <slot></slot> `}},h.SpectricPanel.styles=Oo,Hr([g({type:Number,reflect:!0})],h.SpectricPanel.prototype,"level",2),Hr([g({attribute:!1})],h.SpectricPanel.prototype,"layers",2),h.SpectricPanel=Hr([I("spectric-panel")],h.SpectricPanel);var Lo=Object.defineProperty,Do=Object.getOwnPropertyDescriptor,_e=(i,e,r,s)=>{for(var t=s>1?void 0:s?Do(e,r):e,a=i.length-1,o;a>=0;a--)(o=i[a])&&(t=(s?o(e,r,t):o(t))||t);return s&&t&&Lo(e,r,t),t};const Xt="spectric-dialog";h.DialogElement=class extends B{constructor(){super(...arguments),this.open=!1,this.dismissable=!0,this.hideBackdrop=!1,this.title="",this.closeOnEscape=!0,this.closeOnOutsideClick=!0,this.clickHandler=async e=>{const r=await this.dialogElement;!this.dismissable||!this.closeOnOutsideClick||r===e.target&&(this.open=!1)},this._handleKeyDown=e=>{this.closeOnEscape||e.preventDefault(),this.open&&this.closeOnEscape&&e.key==="Escape"&&(this.open=!1)},this._onClose=e=>{e.preventDefault(),e.stopPropagation(),this.open=!1,this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}static display(e,r){let s=document.createElement(Xt);s.addEventListener("close",()=>{s.remove()});for(let a in e)s[a]=e[a];let t=document.createDocumentFragment();return Ht(r,t),s.appendChild(t),s.open=!0,document.body.appendChild(s),s}connectedCallback(){super.connectedCallback(),this.dialogElement.then(e=>e.addEventListener("keydown",this._handleKeyDown))}disconnectedCallback(){super.disconnectedCallback(),this.dialogElement.then(e=>e.removeEventListener("keydown",this._handleKeyDown))}updated(e){e.has("open")&&this.dialogElement.then(r=>{this.open?r.showModal():r.close()})}render(){return $`
|
|
886
|
+
<dialog
|
|
887
|
+
class=${this.hideBackdrop?"":"backdrop"}
|
|
888
|
+
@close=${this._onClose}
|
|
889
|
+
@click=${this.clickHandler}
|
|
890
|
+
>
|
|
891
|
+
<spectric-panel>
|
|
892
|
+
<div class="modal">
|
|
893
|
+
${this.dismissable?$`<spectric-button
|
|
894
|
+
variant="text"
|
|
895
|
+
size="xsmall"
|
|
896
|
+
@click=${()=>{this.open=!1}}
|
|
897
|
+
icon
|
|
898
|
+
>X</spectric-button
|
|
899
|
+
>`:null}
|
|
900
|
+
<h3>
|
|
901
|
+
<slot name="title">
|
|
902
|
+
${this.title.length?this.title:null}
|
|
903
|
+
</slot>
|
|
904
|
+
</h3>
|
|
905
|
+
|
|
906
|
+
<div class="content"><slot></slot></div>
|
|
907
|
+
<div class="footer"><slot name="footer"></slot></div>
|
|
908
|
+
</div>
|
|
909
|
+
</spectric-panel>
|
|
910
|
+
</dialog>
|
|
911
|
+
`}},h.DialogElement.styles=Co,_e([g({type:Boolean,reflect:!0})],h.DialogElement.prototype,"open",2),_e([g({type:Boolean,reflect:!0})],h.DialogElement.prototype,"dismissable",2),_e([g({type:Boolean,reflect:!0})],h.DialogElement.prototype,"hideBackdrop",2),_e([g({type:String,reflect:!0})],h.DialogElement.prototype,"title",2),_e([g({type:Boolean,reflect:!0})],h.DialogElement.prototype,"closeOnEscape",2),_e([g({type:Boolean,reflect:!0})],h.DialogElement.prototype,"closeOnOutsideClick",2),_e([xt("dialog")],h.DialogElement.prototype,"dialogElement",2),h.DialogElement=_e([I(Xt)],h.DialogElement);const Ki=async i=>{let e,r=Ve();return await new Promise(s=>{let t=h.DialogElement.display({},$`
|
|
912
|
+
<div class="query-bar-date-quick-select">
|
|
913
|
+
${i.map(a=>{let o=Tt(a);return $`<a
|
|
914
|
+
href="#"
|
|
915
|
+
@click=${d=>{d.preventDefault(),e=`"${o.label}"`,s(e),t.open=!1}}
|
|
916
|
+
>${o.value}</a
|
|
917
|
+
>`})}
|
|
918
|
+
</div>
|
|
919
|
+
<spectric-input
|
|
920
|
+
variant="datetime-local"
|
|
921
|
+
@change=${a=>{if(!a.target)return;e=`"${new Date(a.target.value+":00.000Z").toISOString()}"`,r.value.disabled=e===void 0}}
|
|
922
|
+
></spectric-input>
|
|
923
|
+
<spectric-button
|
|
924
|
+
${We(r)}
|
|
925
|
+
.disabled=${!0}
|
|
926
|
+
@click=${()=>{s(e),t.open=!1}}
|
|
927
|
+
>Submit</spectric-button
|
|
928
|
+
>
|
|
929
|
+
`)}),e},Xi=async i=>{let e,r=Ve();return await new Promise(s=>{let t=h.DialogElement.display({},$`
|
|
930
|
+
<div class="query-bar-date-quick-select">
|
|
931
|
+
${i.map(a=>{let o=Tt(a);return $`<a
|
|
932
|
+
href="#"
|
|
933
|
+
@click=${d=>{d.preventDefault(),e=`"${o.value}"`,s(e),t.open=!1}}
|
|
934
|
+
>${o.label}</a
|
|
935
|
+
>`})}
|
|
936
|
+
</div>
|
|
937
|
+
<div>TODO DISPLAY MAP with drawing tools HERE!!</div>
|
|
938
|
+
<spectric-button
|
|
939
|
+
${We(r)}
|
|
940
|
+
.disabled=${!0}
|
|
941
|
+
@click=${()=>{s(e),t.open=!1}}
|
|
942
|
+
>Submit</spectric-button
|
|
943
|
+
>
|
|
944
|
+
`)}),e},No="🖉",Mo="🗑",zo="🠈",Io="🠊",Ro="🠉",jo="🠋";var Bo=Object.defineProperty,Uo=Object.getOwnPropertyDescriptor,J=(i,e,r,s)=>{for(var t=s>1?void 0:s?Uo(e,r):e,a=i.length-1,o;a>=0;a--)(o=i[a])&&(t=(s?o(e,r,t):o(t))||t);return s&&t&&Bo(e,r,t),t},Fr=(i=>(i.MONGO="toMongo",i.CQL="toCql",i.DSL="toDSL",i.AST="AST",i))(Fr||{});const Tt=i=>typeof i=="string"?{label:i,value:i}:{label:i.label||i.value,value:i.value},es={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"}},Ho={within:{value:" <@ ",label:" is contained within geometry"}},Fo={exists:{value:": *",label:" exists in any form"}},Qo={eq:{value:": ",label:" equals some value"},exists:{value:": *",label:" exists in any form"}},qo=[{value:": true",label:" value is true"},{value:": false",label:"value is false"}],Vo=Object.fromEntries(Object.entries(es).map(([i,e])=>[i,{value:e.value,label:(e.label||"").replace("value","date-time")}]));h.SpectricQuery=class extends B{constructor(){super(),this.placeholder="",this._value="",this.value="",this.outputLanguage="AST",this.completions=[],this.completionIndex=0,this.fields=[],this._checkClickLocation=async e=>{console.log(e);let r=null;try{r=this._getSuggestion()}catch(s){console.log(s)}r&&this._showValueHelper(r)},this._setValue=(e,r)=>{e!==void 0&&(this.value=this.value.substring(0,r.start)+e+this.value.substring(r.end),this._input.value=this.value,this._input.setSelectionRange(r.start+e.length,r.start+e.length),this._valueHelper&&this._valueHelper.hidePopover())},this._showValueHelper=async e=>{var a,o;if(this.valueHelper=void 0,!e||e.start===e.end)return;let r=this.fields.find(d=>d.name===e.fieldName);if(!r)return;let s=await this.getValuesForField(e.fieldName,e.prefix);r.format==="date-time"&&!s.length&&(s=["now-1m","now-1d","now-1M"]);let t;r.format=="date-time"?t=Ki:r.format=="geojson"&&(t=Xi),!this.completions.length&&!((a=this._autocomplete)!=null&&a.isOpen())&&(this.valueHelper=$`<div>
|
|
945
|
+
<spectric-button
|
|
946
|
+
tooltip="Delete Value"
|
|
947
|
+
tooltipPosition="top"
|
|
948
|
+
icon
|
|
949
|
+
size="xsmall"
|
|
950
|
+
@click=${()=>{this._setValue("",e)}}
|
|
951
|
+
>${Mo}</spectric-button
|
|
952
|
+
>
|
|
953
|
+
${t?$`<spectric-button
|
|
954
|
+
icon
|
|
955
|
+
tooltip="Edit Value"
|
|
956
|
+
tooltipPosition="top"
|
|
957
|
+
size="xsmall"
|
|
958
|
+
@click=${async()=>{this._setValue(await t(s),e)}}
|
|
959
|
+
>${No}</spectric-button
|
|
960
|
+
>`:null}
|
|
961
|
+
</div>`,(o=this._valueHelper)==null||o.showPopover())},this._getSuggestion=()=>{let e=this.value;this._input.selectionStart!==null&&(e=e.substring(0,this._input.selectionStart)+"©kuery-cursor©"+e.substring(this._input.selectionStart));let r=Zt(e,{parseCursor:!0,cursorSymbol:"©kuery-cursor©",allowLeadingWildcards:!1});return this._showValueHelper(r),r},this._parseQuery=(e=void 0)=>{let r;if(e&&(e!=null&&e.currentTarget)&&(this.value=e.currentTarget.value),this.value)try{e&&e.data=="("&&(this.value=this.value+" )",this._input.setSelectionRange(this.value.length-2,this.value.length-2));let a=this._getSuggestion();this.autoComplete(a)}catch{return}try{r=Zt(this.value,{allowLeadingWildcards:!1})}catch{return}let s;this.outputLanguage=="AST"?s=r:s=Ao[this.outputLanguage](r,this.fields);let t=new CustomEvent("change",{detail:s});this.dispatchEvent(t)},this.getValuesForField=async(e,r)=>(console.log("getValuesForField isn't set no values returned",e,r),[]),this._selectCompletion=async()=>{var a;if(!this.suggestion)return;let e=this.completions[this.completionIndex],r=this.value.substring(0,e.start)+e.value,s=r.length,t=this.value.substring(e.end);if(e.value.includes(t)?this.value=r:this.value=r+this.value.substring(e.end),this._input.value=this.value,this._input.setSelectionRange(s,s),e.onSelect){let o=await e.onSelect();o!==void 0&&(this.value+=o,setTimeout(()=>{this._input.focus(),this._showValueHelper(this._getSuggestion())}))}(a=this._autocomplete)==null||a.hidePopover(),this.completionIndex=0,this.completions=[],this._parseQuery(),this._input.focus()},this._handleArrows=e=>{var r;e.key==="Escape"&&(this.completions=[]),(e.key=="ArrowLeft"||e.key==="ArrowRight")&&setTimeout(this._parseQuery,100),this.completions.length&&["ArrowUp","ArrowDown","Enter","Tab"].includes(e.key)&&this.suggestion&&(e.preventDefault(),(e.key==="ArrowDown"||e.key==="Tab")&&(this.completionIndex+=1,this.completionIndex>this.completions.length-1&&(this.completionIndex=0)),e.key==="ArrowUp"&&(this.completionIndex-=1,this.completionIndex<0&&(this.completionIndex=this.completions.length-1)),(r=this._asyncAutocomplete)==null||r.then(s=>{let t=s.querySelector(".option.active");t&&t.scrollIntoView({block:"nearest"})}),e.key==="Enter"&&this._selectCompletion())},this.uuid=crypto.randomUUID()}createRenderRoot(){return this}async autoComplete(e){var a,o;if(this.completions=[],e.type!=="cursor")return;let r=[];this.suggestion=e;let{start:s,end:t}=e;for(let d of e.suggestionTypes){if(d=="conjunction"&&e.text.endsWith(" ")&&r.push(...["and ","or "].map(c=>({type:d,value:c,start:t,end:t}))),d==="field"){let c=this.fields.filter(b=>b.name.includes(e.fieldName)||b.name.includes(e.prefix)).map(b=>[{type:d,value:b.name,start:s,end:t}]).flat();r.push(...c)}if(d==="operator"){let c=this.fields.find(b=>b.name===e.fieldName);c&&(["number","integer"].includes(c.type)?r.push(...Object.values(es).map(b=>({type:d,...b,start:t,end:t}))):c.type==="object"?(c.format=="geojson"&&r.push(...Object.values(Ho).map(b=>({type:d,...b,start:t,end:t,onSelect:async()=>{let _=await this.getValuesForField(e.fieldName,e.prefix);return await Xi(_)}}))),r.push(...Object.values(Fo).map(b=>({type:d,...b,start:t,end:t})))):c.type==="string"?c.format==="date-time"?r.push(...Object.values(Vo).map(b=>({type:d,...b,start:t,end:t,onSelect:async()=>{let _=await this.getValuesForField(e.fieldName,e.prefix);return _.length===0&&(_=["now-1m","now-1d","now-1M"]),await Ki(_)}}))):r.push(...Object.values(Qo).map(b=>({type:d,...b,start:t,end:t}))):c.type==="boolean"&&r.push(...qo.map(b=>({type:d,...b,start:t,end:t}))))}if(d==="value"){let c=this.fields.find(b=>b.name===e.fieldName);if(!(c&&c.type=="number"||(c==null?void 0:c.type)=="integer"))if(c&&c.type=="boolean")r.push({type:d,value:"true",start:s,end:t},{type:d,value:"false",start:s,end:t});else{console.log(`invoke callback to get values for ${e.fieldName}`);let b=await this.getValuesForField(e.fieldName,e.prefix);(c==null?void 0:c.type)==="string"&&(b=b.map(_=>`"${_}"`)),r.push(...b.map(Tt).map(_=>({type:d,value:_.value,start:s,end:t})))}}}if(this.completions=r,this.completions.length&&this._autocomplete){(a=this._valueHelper)==null||a.hidePopover();let{width:d}=this._input.getBoundingClientRect();this._autocomplete.maxWidth=d,this._autocomplete.showPopover(),this._autocomplete.style.width=`${d-15}px`;let c=this._autocomplete.querySelector("[popover]");c&&(c.style.width=`${d-15}px`)}else(o=this._autocomplete)==null||o.hidePopover()}updated(e){e.has("outputLanguage")&&this._parseQuery()}render(){return $`
|
|
962
|
+
<spectric-input
|
|
963
|
+
.value=${this.value}
|
|
964
|
+
.placeholder=${this.placeholder}
|
|
965
|
+
style=${`anchor-name:--${this.uuid};`}
|
|
966
|
+
autocomplete="off"
|
|
967
|
+
@input=${this._parseQuery}
|
|
968
|
+
@keydown=${this._handleArrows}
|
|
969
|
+
@change=${e=>e.stopPropagation()}
|
|
970
|
+
@click=${this._checkClickLocation}
|
|
971
|
+
></spectric-input>
|
|
972
|
+
<spectric-popover
|
|
973
|
+
class="valueHelper"
|
|
974
|
+
.text=${this.valueHelper}
|
|
975
|
+
position="top"
|
|
976
|
+
></spectric-popover>
|
|
977
|
+
<spectric-popover
|
|
978
|
+
position="bottom"
|
|
979
|
+
class="autocomplete"
|
|
980
|
+
.text=${this.completions.map((e,r)=>$`<div
|
|
981
|
+
@click=${()=>{this.completionIndex=r,this._selectCompletion()}}
|
|
982
|
+
class=${this.completionIndex==r?"option active":"option"}
|
|
983
|
+
>
|
|
984
|
+
<span class="optiontype ${e.type}">${e.type}</span>
|
|
985
|
+
<span class="value">${e.value}</span>
|
|
986
|
+
<span class="label">${e.label}</span>
|
|
987
|
+
</div> `)}
|
|
988
|
+
>
|
|
989
|
+
</spectric-popover>
|
|
990
|
+
`}},J([g({type:String,reflect:!0})],h.SpectricQuery.prototype,"placeholder",2),J([W()],h.SpectricQuery.prototype,"valueHelper",2),J([g({type:String,reflect:!0})],h.SpectricQuery.prototype,"value",2),J([g({type:String,reflect:!0})],h.SpectricQuery.prototype,"outputLanguage",2),J([W()],h.SpectricQuery.prototype,"completions",2),J([W()],h.SpectricQuery.prototype,"completionIndex",2),J([g({type:Array,reflect:!0})],h.SpectricQuery.prototype,"fields",2),J([pe(".autocomplete")],h.SpectricQuery.prototype,"_autocomplete",2),J([pe(".valueHelper")],h.SpectricQuery.prototype,"_valueHelper",2),J([xt(".autocomplete")],h.SpectricQuery.prototype,"_asyncAutocomplete",2),J([pe("spectric-input")],h.SpectricQuery.prototype,"_input",2),h.SpectricQuery=J([I("spectric-query")],h.SpectricQuery);var Wo=Object.defineProperty,Go=Object.getOwnPropertyDescriptor,ts=(i,e,r,s)=>{for(var t=s>1?void 0:s?Go(e,r):e,a=i.length-1,o;a>=0;a--)(o=i[a])&&(t=(s?o(e,r,t):o(t))||t);return s&&t&&Wo(e,r,t),t};const rs={"--primary":{control:"color"},"--secondary":{control:"color"},"--tertiary":{control:"color"},"--disabled":{control:"color"},"--background":{control:"color"},"--background-inverse":{control:"color"},"--text-primary":{control:"color"},"--text-secondary":{control:"color"},"--text-on-color":{control:"color"},"--border-radius":{control:"text"}},is={"--secondary":"#77878b","--tertiary":"#c7c7c7","--disabled":"#000000","--text-primary":"#cccccc","--text-secondary":"#cccccc","--text-on-color":"#ededed","--background":"#181818","--background-inverse":"#37373d"},ss={...is,"--primary":"#ffd45a","--text-on-color":"#4f4f4f"},Qr={undefined:{},light:{},dark:is,spectric:ss,spectricFlat:{...ss,"--border-radius":"1px"}},ns=Object.fromEntries(Object.keys(Qr).map(i=>[i,i])),os=["--spectric-background","--spectric-background-hover","--spectric-background-inverse","--spectric-background-inverse-hover","--spectric-border-radius","--spectric-primary","--spectric-secondary","--spectric-tertiary","--spectric-disabled","--panel-color","--panel-color-inverse","--spectric-border-disabled","--spectric-input-color","--spectric-input-bottom","--spectric-text-on-color","--spectric-text-on-color-disabled","--spectric-text-placeholder","--spectric-text-primary","--spectric-text-secondary","--spectric-button-separator","--spectric-button-primary","--spectric-button-secondary","--spectric-button-tertiary","--spectric-button-danger-primary","--spectric-button-danger-secondary","--spectric-button-danger-active","--spectric-button-primary-active","--spectric-button-secondary-active","--spectric-button-tertiary-active","--spectric-button-danger-hover","--spectric-button-primary-hover","--spectric-button-secondary-hover","--spectric-button-tertiary-hover","--spectric-text-on-color-disabled"],Yo=`
|
|
914
991
|
--spectric-background: var(--background,#ffffff);
|
|
915
992
|
--spectric-background-hover:var(--background-hover,rgba(141, 141, 141, 0.12));
|
|
916
993
|
--spectric-background-inverse: var(--background-inverse,#f4f4f4);
|
|
@@ -953,12 +1030,12 @@ spectric-button{
|
|
|
953
1030
|
--spectric-text-on-color-disabled: var(--disabled,#c6c6c6)
|
|
954
1031
|
--spectric-button-disabled: #c6c6c6;
|
|
955
1032
|
color: var(--spectric-text-primary);
|
|
956
|
-
`;h.SpectricThemeProvider=class extends
|
|
957
|
-
`);return
|
|
958
|
-
${this.theme&&this.theme!=="light"
|
|
1033
|
+
`;h.SpectricThemeProvider=class extends B{constructor(){super(...arguments),this.theme="undefined"}updated(e){if(e.has("theme")&&this.theme!=e.get("theme")){const r={old:e.get("theme"),new:this.theme};this.dispatchEvent(new CustomEvent("theme-change",{detail:r,bubbles:!0,composed:!0}))}}render(){let e=Object.keys(Qr).includes(this.theme)?this.theme:"undefined",r=Object.entries(Qr[e]).map(s=>`${s[0]}:${s[1]};`).join(`
|
|
1034
|
+
`);return $`
|
|
1035
|
+
${this.theme&&this.theme!=="light"?$`
|
|
959
1036
|
<style>:host{
|
|
960
|
-
${
|
|
961
|
-
${
|
|
1037
|
+
${r};
|
|
1038
|
+
${Yo}
|
|
962
1039
|
}
|
|
963
1040
|
/* Webkit psudo elements don't pick up variables defined by the host */
|
|
964
1041
|
::-webkit-scrollbar-thumb {
|
|
@@ -1029,9 +1106,9 @@ spectric-button{
|
|
|
1029
1106
|
}
|
|
1030
1107
|
</style>`:null}
|
|
1031
1108
|
<slot></slot>
|
|
1032
|
-
`}},h.SpectricThemeProvider.styles=
|
|
1109
|
+
`}},h.SpectricThemeProvider.styles=Z`:host{
|
|
1033
1110
|
display:contents;
|
|
1034
|
-
}`,
|
|
1111
|
+
}`,ts([g({reflect:!0})],h.SpectricThemeProvider.prototype,"theme",2),h.SpectricThemeProvider=ts([I("spectric-theme")],h.SpectricThemeProvider);const Zo=Z`
|
|
1035
1112
|
:host {
|
|
1036
1113
|
display: block;
|
|
1037
1114
|
height: 100%;
|
|
@@ -1094,7 +1171,7 @@ spectric-button{
|
|
|
1094
1171
|
width: 5px;
|
|
1095
1172
|
cursor: ew-resize;
|
|
1096
1173
|
}
|
|
1097
|
-
`;var
|
|
1174
|
+
`;var Jo=Object.defineProperty,Ko=Object.getOwnPropertyDescriptor,K=(i,e,r,s)=>{for(var t=s>1?void 0:s?Ko(e,r):e,a=i.length-1,o;a>=0;a--)(o=i[a])&&(t=(s?o(e,r,t):o(t))||t);return s&&t&&Jo(e,r,t),t},qr=(i=>(i.horizontal="horizontal",i.vertical="vertical",i))(qr||{});const Vr="spectric-splitview";h.SplitView=class extends ie{constructor(){super(),this.orientation="horizontal",this.percentage=50,this.invisible=!1,this.min=10,this.max=90,this.useSavedState=!0,this.isDragging=!1,this._error=!1,this._emitChange=()=>{let{percentage:r,orientation:s,invisible:t,min:a,max:o,useSavedState:d}=this,c=this.getAttribute("id");c&&this.useSavedState&&localStorage.setItem(`splitview-${c}`,String(r)),this.dispatchEvent(new CustomEvent("change",{detail:{orientation:s,percentage:r,invisible:t,min:a,max:o,useSavedState:d}}))},this._onMouseMove=Et(r=>{if(this.isDragging){const s=this.getBoundingClientRect();let t,a;this.orientation==="horizontal"?(t=r.clientX-s.left,a=t/s.width*100):(t=r.clientY-s.top,a=t/s.height*100),a=Math.min(Math.max(a,this.min),this.max),this.percentage=a,this._emitChange()}}),this._assignSlot=r=>{if(!r.target)return;let t=r.target.assignedNodes().filter(a=>a instanceof HTMLElement);t.length>2&&console.log("cannot assign more than 2 elements to a split view"),t.forEach(a=>{if(this._panel1.assignedNodes().length===0){a.slot="panel1";return}if(this._panel2.assignedNodes().length===0){a.slot="panel2";return}this._error="Too many element assigned to split view splitter can only have a maximum of 2 children",console.warn("Too many element assigned to split view splitter can only have a maximum of 2 children")})};let e=this.getAttribute("id");if(e&&this.useSavedState){let r=localStorage.getItem(`splitview-${e}`);r&&(this.percentage=parseFloat(r))}this.addDisposableListener(this._splitter,"mousedown",()=>{this.isDragging=!0}),this.addDisposableListener(this._splitter,"dblclick",()=>{this.percentage=50,this._emitChange()}),this.addDisposableListener(document.body,"mousemove",this._onMouseMove),this.addDisposableListener(document.body,"mouseup",()=>{this.isDragging=!1})}updated(e){e.has("percentage")&&(this.percentage=Math.min(Math.max(Number(this.percentage),this.min),this.max))}render(){return $`
|
|
1098
1175
|
<div class="split-view ${this.orientation} ${this._error?"error":""} ${this.isDragging?"active":""}" style="--split-percentage: ${this.percentage}%;">
|
|
1099
1176
|
<span class="error-display">${this._error}</span>
|
|
1100
1177
|
<div class="panel" style="${this.orientation==="horizontal"?"flex: var(--split-percentage, 50%)":"max-height: var(--split-percentage, 50%)"}">
|
|
@@ -1106,49 +1183,69 @@ spectric-button{
|
|
|
1106
1183
|
</div>
|
|
1107
1184
|
</div>
|
|
1108
1185
|
<slot @slotchange=${this._assignSlot} style="display:none"></slot>
|
|
1109
|
-
`}},h.SplitView.styles=
|
|
1110
|
-
|
|
1186
|
+
`}},h.SplitView.styles=Zo,K([g({type:String})],h.SplitView.prototype,"orientation",2),K([g({type:Number,reflect:!0})],h.SplitView.prototype,"percentage",2),K([g({type:Boolean})],h.SplitView.prototype,"invisible",2),K([g({type:Number,reflect:!0})],h.SplitView.prototype,"min",2),K([g({type:Number,reflect:!0})],h.SplitView.prototype,"max",2),K([g({type:Boolean,reflect:!0})],h.SplitView.prototype,"useSavedState",2),K([W()],h.SplitView.prototype,"isDragging",2),K([W()],h.SplitView.prototype,"_error",2),K([xt(".splitter")],h.SplitView.prototype,"_splitter",2),K([pe("slot[name='panel1']")],h.SplitView.prototype,"_panel1",2),K([pe("slot[name='panel2']")],h.SplitView.prototype,"_panel2",2),h.SplitView=K([I(Vr)],h.SplitView);var Xo=Object.defineProperty,ea=Object.getOwnPropertyDescriptor,Ie=(i,e,r,s)=>{for(var t=s>1?void 0:s?ea(e,r):e,a=i.length-1,o;a>=0;a--)(o=i[a])&&(t=(s?o(e,r,t):o(t))||t);return s&&t&&Xo(e,r,t),t};const Wr="spectric-pagination";h.PaginationElement=class extends B{constructor(){super(...arguments),this.page=1,this.pageSize=10,this.pageSizeOptions=[10,20,50,100,1e3],this.size="xsmall",this._handlePageUp=()=>{this.page+=1,this._emitChange()},this._handlePageDown=()=>{this.page-=1,this._emitChange()},this._handleSizeChange=e=>{e.stopPropagation(),e.preventDefault();let r=parseInt(e.target.value);this.pageSize=r,this._emitChange()},this._emitChange=()=>{let{page:e,pageSize:r}=this;this.dispatchEvent(new CustomEvent("change",{detail:{page:e,pageSize:r}}))}}createRenderRoot(){return this}update(e){e.has("pageSize")&&!this.pageSizeOptions.includes(this.pageSize)&&(this.pageSizeOptions=[...this.pageSizeOptions,this.pageSize].sort((r,s)=>r-s),requestAnimationFrame(()=>{this.select&&this.select.value!==String(this.pageSize)&&(this.select.value=String(this.pageSize))})),super.update(e)}render(){let e=this.page*this.pageSize,r=!0;this.totalItems&&e<this.totalItems&&(r=!1);let s="";return this.totalItems&&(s=`${this.page} of ${Math.ceil(this.totalItems/this.pageSize)}`),$`
|
|
1187
|
+
<div class="spectric-pagination-container">
|
|
1188
|
+
<div>
|
|
1189
|
+
<!-- TODO/FIXME Make a select component and use it for cross browser styling-->
|
|
1190
|
+
<select
|
|
1191
|
+
@change=${this._handleSizeChange}
|
|
1192
|
+
.value=${String(this.pageSize)}
|
|
1193
|
+
>
|
|
1194
|
+
${this.pageSizeOptions.map(t=>$`<option
|
|
1195
|
+
.value=${String(t)}
|
|
1196
|
+
class=${String(t)===String(this.pageSize)?"selected":""}
|
|
1197
|
+
>
|
|
1198
|
+
${t}
|
|
1199
|
+
</option>`)}
|
|
1200
|
+
</select>
|
|
1201
|
+
</div>
|
|
1202
|
+
${this.totalItems?$`
|
|
1203
|
+
<div class="spectric-pagination-text">
|
|
1204
|
+
${`Items ${(this.page-1)*this.pageSize}-${Math.min(this.page*this.pageSize,this.totalItems)} of ${this.totalItems}`}
|
|
1205
|
+
</div>
|
|
1206
|
+
<div class="spectric-pagination-container">
|
|
1207
|
+
<div>${s}</div>
|
|
1111
1208
|
<div>
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1209
|
+
<spectric-button
|
|
1210
|
+
size=${this.size}
|
|
1211
|
+
?disabled=${this.page===1}
|
|
1212
|
+
@click=${this._handlePageDown}
|
|
1213
|
+
icon
|
|
1214
|
+
>${zo}</spectric-button
|
|
1215
|
+
>
|
|
1216
|
+
<spectric-button
|
|
1217
|
+
size=${this.size}
|
|
1218
|
+
?disabled=${r}
|
|
1219
|
+
@click=${this._handlePageUp}
|
|
1220
|
+
icon
|
|
1221
|
+
>${Io}</spectric-button
|
|
1222
|
+
>
|
|
1116
1223
|
</div>
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
${i}
|
|
1122
|
-
</div>
|
|
1123
|
-
<div>
|
|
1124
|
-
<spectric-button size=${this.size} ?disabled=${this.page===1} @click=${this._handlePageDown} icon>🠈</spectric-button>
|
|
1125
|
-
<spectric-button size=${this.size} ?disabled=${s} @click=${this._handlePageUp} icon>🠊</spectric-button>
|
|
1126
|
-
</div>
|
|
1127
|
-
</div>
|
|
1128
|
-
`:null}
|
|
1129
|
-
</div>
|
|
1130
|
-
`}},Pe([v({type:Number,reflect:!0})],h.PaginationElement.prototype,"page",2),Pe([v({type:Number,reflect:!0})],h.PaginationElement.prototype,"pageSize",2),Pe([v({type:Number,reflect:!0})],h.PaginationElement.prototype,"totalItems",2),Pe([v({type:Array})],h.PaginationElement.prototype,"pageSizeOptions",2),Pe([ue("select")],h.PaginationElement.prototype,"select",2),Pe([v({type:String,reflect:!0})],h.PaginationElement.prototype,"size",2),h.PaginationElement=Pe([T(Ar)],h.PaginationElement);const aa=Object.freeze(Object.defineProperty({__proto__:null,BitArray:cr,DisposableElement:K,getListeners:bi},Symbol.toStringTag,{value:"Module"}));var la=Object.defineProperty,ca=Object.getOwnPropertyDescriptor,kt=(n,e,s,i)=>{for(var o=i>1?void 0:i?ca(e,s):e,t=n.length-1,c;t>=0;t--)(c=n[t])&&(o=(i?c(e,s,o):c(o))||o);return i&&o&&la(e,s,o),o};const pa="spectric-table-header";let ct=class extends K{constructor(){super(),this.columns=[],this._handleSortChange=n=>{this._resizeStart||(n=JSON.parse(JSON.stringify(n)),n.sortable&&(n.sortDirection===M.none||n.sortDirection===void 0?n.sortDirection=M.ascending:n.sortDirection===M.ascending?n.sortDirection=M.descending:n.sortDirection===M.descending&&(n.sortDirection=M.none),this.dispatchEvent(new CustomEvent("sortChange",{composed:!0,bubbles:!0,detail:n}))))},this._handleResizeStart=(n,e)=>{this._resizeStart={event:n,column:e}},this._handleResizeEnd=n=>{var s;if(!this._resizeStart)return;let e=n.pageX-((s=this._resizeStart)==null?void 0:s.event.pageX);if(this._resizeStart.column.width)this._resizeStart.column.width=this._resizeStart.column.width+e;else{let i=this._resizeStart.event.target.closest("td");this._resizeStart.column.width=i.getBoundingClientRect().width+e}this.dispatchEvent(new CustomEvent("columnResize",{detail:this._resizeStart.column})),requestAnimationFrame(()=>{if(this._resizeStart=void 0,window.getSelection){let i=window.getSelection();i&&i.removeAllRanges()}})},this.addDisposableListener(()=>document.body,"mouseup",this._handleResizeEnd)}createRenderRoot(){return this}render(){return w`
|
|
1224
|
+
</div>
|
|
1225
|
+
`:null}
|
|
1226
|
+
</div>
|
|
1227
|
+
`}},Ie([g({type:Number,reflect:!0})],h.PaginationElement.prototype,"page",2),Ie([g({type:Number,reflect:!0})],h.PaginationElement.prototype,"pageSize",2),Ie([g({type:Number,reflect:!0})],h.PaginationElement.prototype,"totalItems",2),Ie([g({type:Array})],h.PaginationElement.prototype,"pageSizeOptions",2),Ie([pe("select")],h.PaginationElement.prototype,"select",2),Ie([g({type:String,reflect:!0})],h.PaginationElement.prototype,"size",2),h.PaginationElement=Ie([I(Wr)],h.PaginationElement);const ta=Object.freeze(Object.defineProperty({__proto__:null,BitArray:Or,DisposableElement:ie,getListeners:zi},Symbol.toStringTag,{value:"Module"}));var ra=Object.defineProperty,ia=Object.getOwnPropertyDescriptor,er=(i,e,r,s)=>{for(var t=s>1?void 0:s?ia(e,r):e,a=i.length-1,o;a>=0;a--)(o=i[a])&&(t=(s?o(e,r,t):o(t))||t);return s&&t&&ra(e,r,t),t};const sa="spectric-table-header";let Lt=class extends ie{constructor(){super(),this.columns=[],this._handleSortChange=i=>{this._resizeStart||(i=JSON.parse(JSON.stringify(i)),i.sortable&&(i.sortDirection===Q.none||i.sortDirection===void 0?i.sortDirection=Q.ascending:i.sortDirection===Q.ascending?i.sortDirection=Q.descending:i.sortDirection===Q.descending&&(i.sortDirection=Q.none),this.dispatchEvent(new CustomEvent("sortChange",{composed:!0,bubbles:!0,detail:i}))))},this._handleResizeStart=(i,e)=>{this._resizeStart={event:i,column:e}},this._handleResizeEnd=i=>{var r;if(!this._resizeStart)return;let e=i.pageX-((r=this._resizeStart)==null?void 0:r.event.pageX);if(this._resizeStart.column.width)this._resizeStart.column.width=this._resizeStart.column.width+e;else{let s=this._resizeStart.event.target.closest("td");this._resizeStart.column.width=s.getBoundingClientRect().width+e}this.dispatchEvent(new CustomEvent("columnResize",{detail:this._resizeStart.column})),requestAnimationFrame(()=>{if(this._resizeStart=void 0,window.getSelection){let s=window.getSelection();s&&s.removeAllRanges()}})},this.addDisposableListener(()=>document.body,"mouseup",this._handleResizeEnd)}createRenderRoot(){return this}render(){return $`
|
|
1131
1228
|
<tr>
|
|
1132
|
-
${this.columns.map(
|
|
1229
|
+
${this.columns.map(i=>this.renderCell(i))}
|
|
1133
1230
|
</tr>
|
|
1134
|
-
`}renderCell(
|
|
1231
|
+
`}renderCell(i){let e=["header-contents"];i.filterable,i.sortable&&e.push("sortable"),this._resizeStart&&e.push("resizing");let r=i.width?`min-width:${i.width}px;max-width:${i.width}px;`:"",s=i.sortDirection===Q.ascending?Ro:i.sortDirection==Q.descending?jo:"",t=i.sortDirection||Q.none,o=i.allowResize||i.allowResize===void 0?$`<div
|
|
1135
1232
|
class="header-resize-handle"
|
|
1136
|
-
@mousedown=${
|
|
1233
|
+
@mousedown=${c=>{this._handleResizeStart(c,i)}}
|
|
1137
1234
|
@mouseup=${this._handleResizeEnd}
|
|
1138
|
-
></div>`:null,
|
|
1139
|
-
@click=${()=>this._handleSortChange(
|
|
1140
|
-
style="${
|
|
1235
|
+
></div>`:null,d=i.title||i.key;return typeof d=="function"&&(d=d(this.table)||void 0),$` <td
|
|
1236
|
+
@click=${()=>this._handleSortChange(i)}
|
|
1237
|
+
style="${r}"
|
|
1141
1238
|
>
|
|
1142
|
-
${
|
|
1239
|
+
${o}
|
|
1143
1240
|
<div class=${e.join(" ")}>
|
|
1144
|
-
${
|
|
1145
|
-
<span class="sort-direction ${
|
|
1241
|
+
${d}
|
|
1242
|
+
<span class="sort-direction ${t}">${s}</span>
|
|
1146
1243
|
</div>
|
|
1147
|
-
</td>`}};
|
|
1244
|
+
</td>`}};er([g({type:Array,attribute:!1})],Lt.prototype,"columns",2),er([W()],Lt.prototype,"_resizeStart",2),er([g({type:Object,attribute:!1})],Lt.prototype,"table",2),Lt=er([I(sa)],Lt);/**
|
|
1148
1245
|
* @license
|
|
1149
1246
|
* Copyright 2017 Google LLC
|
|
1150
1247
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1151
|
-
*/const
|
|
1248
|
+
*/const as=i=>Xs(i)?i._$litType$.h:i.strings,na=St(class extends Ft{constructor(i){super(i),this.et=new WeakMap}render(i){return[i]}update(i,[e]){const r=Ri(this.it)?as(this.it):null,s=Ri(e)?as(e):null;if(r!==null&&(s===null||r!==s)){const t=Er(i).pop();let a=this.et.get(r);if(a===void 0){const o=document.createDocumentFragment();a=Ht(M,o),a.setConnected(!1),this.et.set(r,a)}kr(a,[t]),Te(a,void 0,t)}if(s!==null){if(r===null||r!==s){const t=this.et.get(s);if(t!==void 0){const a=Er(t).pop();rn(i),Te(i,void 0,a),kr(i,[a])}}this.it=e}else this.it=void 0;return this.render(e)}});var oa=Object.defineProperty,aa=Object.getOwnPropertyDescriptor,Re=(i,e,r,s)=>{for(var t=s>1?void 0:s?aa(e,r):e,a=i.length-1,o;a>=0;a--)(o=i[a])&&(t=(s?o(e,r,t):o(t))||t);return s&&t&&oa(e,r,t),t};const la="spectric-table-cell";let we=class extends B{constructor(){super(...arguments),this.overflow="",this.styleRules={whiteSpace:"",width:""},this._handleFilterOut=()=>{let i;this.column.key&&typeof this.row=="object"&&(i=nt(this.row,this.column.key)),this._emitFilter({include:!1,row:this.row,value:i,column:this.column})},this._handleFilterFor=()=>{let i;this.column.key&&typeof this.row=="object"&&(i=nt(this.row,this.column.key)),this._emitFilter({include:!0,row:this.row,value:i,column:this.column})},this._displayOverflowTooltip=()=>{if(this.column.disableCellOverflowTooltip){this.overflow=null;return}let i=this.querySelector("div.cell-contents"),e=this.querySelector("span");if(i&&e){let r=e.getBoundingClientRect(),s=i.getBoundingClientRect();r.width*r.height>s.width*s.height?(console.log("We need to show a tooltip with the content because we are overflowing"),this.overflow=this.getRenderedValue(),this.updateComplete.then(()=>{let t=this.querySelector("spectric-tooltip");t&&t.showToolTip()})):this.overflow=""}}}createRenderRoot(){return this}updated(i){}_emitFilter(i){this.dispatchEvent(new CustomEvent("filter",{composed:!0,bubbles:!0,detail:i}))}getRenderedValue(){let i;return this.column.render?i=this.column.render(this.row,this.index,this.table):this.column.key&&typeof this.row=="object"?i=nt(this.row,this.column.key):i=$`error`,i}render(){let i=this.getRenderedValue(),e=["cell-contents"];this.column.filterable&&e.push("filterable");let r=na(this.column.filterable?$`<div class="table-cell-actions">
|
|
1152
1249
|
<spectric-button
|
|
1153
1250
|
@click=${this._handleFilterOut}
|
|
1154
1251
|
size="tiny"
|
|
@@ -1165,77 +1262,77 @@ spectric-button{
|
|
|
1165
1262
|
tooltip="Filter For Value"
|
|
1166
1263
|
>+</spectric-button
|
|
1167
1264
|
>
|
|
1168
|
-
</div>`:null);return this.styleRules={width:this.column.width?this.column.width+"px":null,whiteSpace:this.column.whiteSpace||null}
|
|
1265
|
+
</div>`:null);return this.styleRules={width:this.column.width?this.column.width+"px":null,whiteSpace:this.column.whiteSpace||null},$`
|
|
1169
1266
|
<td
|
|
1170
|
-
style=${
|
|
1171
|
-
@mouseenter=${this.
|
|
1267
|
+
style=${_r(this.styleRules)}
|
|
1268
|
+
@mouseenter=${this._displayOverflowTooltip}
|
|
1172
1269
|
>
|
|
1173
|
-
${
|
|
1270
|
+
${r}
|
|
1174
1271
|
<div class=${e.join(" ")}>
|
|
1175
|
-
${this.overflow
|
|
1272
|
+
${this.overflow?$`<spectric-tooltip .text=${this.overflow}></spectric-tooltip>`:null}<span>${i}</span>
|
|
1176
1273
|
</div>
|
|
1177
1274
|
</td>
|
|
1178
|
-
`}};
|
|
1275
|
+
`}};Re([g({type:Object,attribute:!1})],we.prototype,"row",2),Re([g({type:Number,attribute:!1})],we.prototype,"index",2),Re([g({type:Object,attribute:!1})],we.prototype,"column",2),Re([g({type:Object,attribute:!1})],we.prototype,"table",2),Re([W()],we.prototype,"overflow",2),Re([pe("td")],we.prototype,"td",2),we=Re([I(la)],we);const nt=(i,e)=>{let r=e.split("."),s=i[r[0]];return s==null||r.length>1&&(s=nt(s,r.slice(1).join("."))),s};/**
|
|
1179
1276
|
* @license
|
|
1180
1277
|
* Copyright 2017 Google LLC
|
|
1181
1278
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1182
|
-
*/const
|
|
1279
|
+
*/const ls=(i,e,r)=>{const s=new Map;for(let t=e;t<=r;t++)s.set(i[t],t);return s},tr=St(class extends Ft{constructor(i){if(super(i),i.type!==$r.CHILD)throw Error("repeat() can only be used in text expressions")}dt(i,e,r){let s;r===void 0?r=e:e!==void 0&&(s=e);const t=[],a=[];let o=0;for(const d of i)t[o]=s?s(d,o):o,a[o]=r(d,o),o++;return{values:a,keys:t}}render(i,e,r){return this.dt(i,e,r).values}update(i,[e,r,s]){const t=Er(i),{values:a,keys:o}=this.dt(e,r,s);if(!Array.isArray(t))return this.ut=o,a;const d=this.ut??(this.ut=[]),c=[];let b,_,y=0,C=t.length-1,w=0,S=a.length-1;for(;y<=C&&w<=S;)if(t[y]===null)y++;else if(t[C]===null)C--;else if(d[y]===o[w])c[w]=Le(t[y],a[w]),y++,w++;else if(d[C]===o[S])c[S]=Le(t[C],a[S]),C--,S--;else if(d[y]===o[S])c[S]=Le(t[y],a[S]),Te(i,c[S+1],t[y]),y++,S--;else if(d[C]===o[w])c[w]=Le(t[C],a[w]),Te(i,t[y],t[C]),C--,w++;else if(b===void 0&&(b=ls(o,w,S),_=ls(d,y,C)),b.has(d[y]))if(b.has(d[C])){const A=_.get(o[w]),L=A!==void 0?t[A]:null;if(L===null){const N=Te(i,t[y]);Le(N,a[w]),c[w]=N}else c[w]=Le(L,a[w]),Te(i,t[y],L),t[A]=null;w++}else Ar(t[C]),C--;else Ar(t[y]),y++;for(;w<=S;){const A=Te(i,c[S+1]);Le(A,a[w]),c[w++]=A}for(;y<=C;){const A=t[y++];A!==null&&Ar(A)}return this.ut=o,kr(i,c),ve}});var ca=Object.defineProperty,ua=Object.getOwnPropertyDescriptor,Gr=(i,e,r,s)=>{for(var t=s>1?void 0:s?ua(e,r):e,a=i.length-1,o;a>=0;a--)(o=i[a])&&(t=(s?o(e,r,t):o(t))||t);return s&&t&&ca(e,r,t),t};const pa="spectric-table-body";let rr=class extends B{constructor(){super(...arguments),this.data=[],this.columns=[]}createRenderRoot(){return this}firstUpdated(i){this.data.length>100&&console.warn("Table is rendering excessive amounts of data to the DOM you should set rowHeight and use a virtualized scroll or use pagination")}render(){return $`
|
|
1183
1280
|
<body>
|
|
1184
|
-
${
|
|
1281
|
+
${tr(this.data,(i,e)=>$`
|
|
1185
1282
|
<tr class="${e%2===0?"odd":""}">
|
|
1186
|
-
${
|
|
1283
|
+
${tr(this.columns,r=>$`<spectric-table-cell .column=${r} .index=${e} .row=${i} .columns=${this.columns}></spectric-table-cell>`)}
|
|
1187
1284
|
</tr>`)}
|
|
1188
1285
|
|
|
1189
1286
|
</body>
|
|
1190
|
-
`}};
|
|
1191
|
-
style="height:${
|
|
1287
|
+
`}};Gr([g({type:Array,attribute:!1})],rr.prototype,"data",2),Gr([g({type:Array,attribute:!1})],rr.prototype,"columns",2),rr=Gr([I(pa)],rr);var ha=Object.defineProperty,da=Object.getOwnPropertyDescriptor,ot=(i,e,r,s)=>{for(var t=s>1?void 0:s?da(e,r):e,a=i.length-1,o;a>=0;a--)(o=i[a])&&(t=(s?o(e,r,t):o(t))||t);return s&&t&&ha(e,r,t),t};const fa="spectric-table-virtual-body";let je=class extends ie{constructor(){super(),this.data=[],this.columns=[],this.rowHeight=30,this.startIndex=0,this.columnsMeasured=!1;let i=0;this.addDisposableListener(()=>this.table.querySelector(".table-wrapper"),"scroll",()=>{const e=this.table.querySelector(".table-wrapper").scrollTop;Math.abs(i-e)<=this.rowHeight/4||(i=e,this.startIndex=Math.floor(e/this.rowHeight))})}updated(){if(this.columnsMeasured===!1){let i=this.querySelector("tr"),e=i==null?void 0:i.querySelectorAll("spectric-table-cell td");i&&e&&e.length&&(this.columns.forEach((r,s)=>{if(!r.width||r.width===0){let t=e[s].getBoundingClientRect();t.width>0&&(this.columnsMeasured=!0,r.width=t.width-at)}}),this.columnsMeasured&&(this.columns=[...this.columns]))}}createRenderRoot(){return this}render(){let i=this.data.length,e=10,r=this.table.querySelector("spectric-table-header").clientHeight,s=this.table.querySelector(".table-wrapper"),t=Math.max(this.startIndex,0);const a=Math.ceil((s.clientHeight-r)/this.rowHeight),o=Math.min(t+a+e,i),d=o-t;let c=i*this.rowHeight,b=t*this.rowHeight+(s.scrollTop-t*this.rowHeight);o===i&&(b=t*this.rowHeight);let _=d*this.rowHeight,y=c-b-_,C=t!=0?$` <tr
|
|
1288
|
+
style="height:${b}px"
|
|
1192
1289
|
class="virtual-scroll-spacer"
|
|
1193
1290
|
>
|
|
1194
1291
|
<td colspan="${this.columns.length}"></td>
|
|
1195
|
-
</tr>`:null,
|
|
1196
|
-
style="height:${
|
|
1292
|
+
</tr>`:null,w=$` <tr
|
|
1293
|
+
style="height:${y}px"
|
|
1197
1294
|
class="virtual-scroll-spacer"
|
|
1198
1295
|
>
|
|
1199
1296
|
<td colspan="${this.columns.length}"></td>
|
|
1200
|
-
</tr>`;return
|
|
1297
|
+
</tr>`;return $`
|
|
1201
1298
|
<div
|
|
1202
|
-
style="height:${
|
|
1299
|
+
style="height:${c}px;position: absolute;overflow-x: hidden;overflow-y: hidden;z-index:-1;width:1px;"
|
|
1203
1300
|
></div>
|
|
1204
1301
|
<tbody>
|
|
1205
|
-
${
|
|
1302
|
+
${C}
|
|
1206
1303
|
</tbody>
|
|
1207
1304
|
<div
|
|
1208
|
-
style="display:table-row-group;max-height:${
|
|
1305
|
+
style="display:table-row-group;max-height:${_}px; overflow:hidden;"
|
|
1209
1306
|
>
|
|
1210
|
-
${
|
|
1211
|
-
class="${(
|
|
1307
|
+
${tr(this.data.slice(Math.max(t,0),o),(S,A)=>$` <tr
|
|
1308
|
+
class="${(A+t)%2===0?"odd":""}"
|
|
1212
1309
|
>
|
|
1213
|
-
${
|
|
1214
|
-
.column=${
|
|
1215
|
-
.row=${
|
|
1216
|
-
.index=${
|
|
1310
|
+
${tr(this.columns,L=>$`<spectric-table-cell
|
|
1311
|
+
.column=${L}
|
|
1312
|
+
.row=${S}
|
|
1313
|
+
.index=${A+t}
|
|
1217
1314
|
.columns=${this.columns}
|
|
1218
1315
|
.table=${this.table}
|
|
1219
1316
|
></spectric-table-cell>`)}
|
|
1220
1317
|
</tr>`)}
|
|
1221
1318
|
</div>
|
|
1222
1319
|
<tbody>
|
|
1223
|
-
${
|
|
1320
|
+
${y>0?w:null}
|
|
1224
1321
|
</tbody>
|
|
1225
|
-
`}};
|
|
1322
|
+
`}};ot([g({type:Array,attribute:!1})],je.prototype,"data",2),ot([g({type:Array,attribute:!1})],je.prototype,"columns",2),ot([g({type:Number,attribute:!1})],je.prototype,"rowHeight",2),ot([g({type:Number,state:!0})],je.prototype,"startIndex",2),ot([g({type:Object,attribute:!1})],je.prototype,"table",2),je=ot([I(fa)],je);function cs(i){let e=!1,r;return function(...s){return e||(e=!0,r=i.apply(this,s)),r}}const ga=i=>i.map(({key:e,sortDirection:r,compareFn:s})=>(t,a)=>{if(!e)return;let o=nt(t,e),d=nt(a,e);if(s)return s(t,a);if(typeof o=="number"||typeof o=="bigint"||typeof o=="boolean"){let c=o-d;return r===Q.descending&&(c=c*-1),c}else if(typeof o=="string")return o.localeCompare(d)*(r===Q.descending?-1:1)});var ba=Object.defineProperty,ya=Object.getOwnPropertyDescriptor,le=(i,e,r,s)=>{for(var t=s>1?void 0:s?ya(e,r):e,a=i.length-1,o;a>=0;a--)(o=i[a])&&(t=(s?o(e,r,t):o(t))||t);return s&&t&&ba(e,r,t),t};const Yr="spectric-table";var Zr=(i=>(i.multi="multi",i.single="single",i.none="none",i))(Zr||{}),Jr=(i=>(i.multi="multi",i.single="single",i))(Jr||{}),Q=(i=>(i.ascending="ascending",i.descending="descending",i.none="none",i))(Q||{});const at=4,Kr=Symbol("spectric-table-selection-column");h.SpectricTableElement=class extends B{constructor(){super(...arguments),this.data=[],this.columns=[],this.select="none",this.sort="single",this.sortOrder=[],this.rowHeight=25,this.fontSize=16,this._handlePaginationChange=e=>{if(this.pagination){let r={...this.pagination,...e.detail},{totalItems:s,page:t,pageSize:a}=r;s&&t&&a&&(t-1)*a>s&&(r.page=1),this.pagination=r}this.dispatchEvent(new CustomEvent("paginationChange",{detail:e.detail})),this._emitChange()},this._handleSortChange=e=>{let r=e.detail,s=this.columns.find(t=>t.key==r.key);if(!s||s.key===void 0){console.warn("Unable to find sort column");return}if(this.sort=="single"&&(this.columns.forEach(t=>{t.sortDirection="none"}),this.sortOrder=[]),s.sortDirection=r.sortDirection,!s.sortDirection||s.sortDirection==="none"){let t=this.sortOrder.findIndex(a=>a===s.key);t!==-1&&this.sortOrder.splice(t,1)}else this.sortOrder.findIndex(a=>a===s.key)===-1&&(this.sortOrder=[...this.sortOrder,s.key]);this.columns=[...this.columns],this._emitChange()},this._handleColumnResize=e=>{let r=e.detail,s=this.columns.findIndex(t=>t.key==r.key);this.columns[s]={...this.columns[s]},this.columns=[...this.columns],this._emitChange()},this._emitChange=()=>{let{pagination:e,columns:r,sortOrder:s}=this;this.dispatchEvent(new CustomEvent("change",{detail:{pagination:e,columns:r,sortOrder:s}}))},this.__DO_NOT_USE_filter=()=>{this.dispatchEvent(new CustomEvent("filter")),this.dispatchEvent(new CustomEvent("sortChange"))},this.selected=[],this._getRowHeight=()=>{let e=this.rowHeight-at;return e<this.fontSize+at&&(e=this.fontSize+at),e},this._handleSelectAllChange=e=>{e.stopPropagation(),e.target.checked?this.selectAll():this.deselectAll()},this.selectColumnConfig={[Kr]:!0,width:39,title:e=>e.select==="multi"?$`<spectric-input
|
|
1226
1323
|
variant="checkbox"
|
|
1227
1324
|
@change=${e._handleSelectAllChange}
|
|
1228
1325
|
.helperText=${"Select All"}
|
|
1229
|
-
></spectric-input>`:null,render:(e,s
|
|
1326
|
+
></spectric-input>`:null,render:(e,r,s)=>{let t=s.selected.includes(e);return $`<spectric-input
|
|
1230
1327
|
variant="checkbox"
|
|
1231
|
-
class="table-checkbox-${
|
|
1328
|
+
class="table-checkbox-${s.select}"
|
|
1232
1329
|
.helperText=${""}
|
|
1233
|
-
${
|
|
1234
|
-
@change=${
|
|
1235
|
-
></spectric-input>`}}}static getDefaultDataSorterAndPaginatior(e){return
|
|
1330
|
+
${Me({checked:t})}
|
|
1331
|
+
@change=${o=>{o.stopPropagation();let d=s.selected.findIndex(c=>c===e);if(!(o.target.checked&&d!==-1)){{if(!o.target.checked&&d===-1)return;!o.target.checked&&d!==-1&&s.selected.splice(d,1)}o.target.checked&&(s.select==="single"&&(s.selected=[],s.forceRefreshofSelectionColumn()),s.selected.push(e)),s.dispatchEvent(new CustomEvent("selected",{detail:[...s.selected]}))}}}
|
|
1332
|
+
></spectric-input>`}}}static getDefaultDataSorterAndPaginatior(e){return r=>{let s=(r.sortOrder||[]).map(d=>r.columns.find(c=>c.key===d)),t=[...e];if(s.length){let d=ga(s);t.sort((c,b)=>{for(let _ of d){let y=_(c,b);if(y)return y}return 0})}if(!r.pagination)return t;let{page:a,pageSize:o}=r.pagination;return!a||!o?t:r.pagination?t.slice((a-1)*o,a*o):t}}createRenderRoot(){return this}forceRefreshofSelectionColumn(){let e=this.columns.findIndex(r=>r[Kr]);e!==-1&&(this.columns[e]={...this.selectColumnConfig})}setSelected(e){this.selected=e,this.forceRefreshofSelectionColumn()}getSelected(){return this.selected}deselectAll(){this.selected=[],this.forceRefreshofSelectionColumn(),this.dispatchEvent(new CustomEvent("selected",{detail:this.selected}))}selectAll(){this.selected=[...this.data],this.forceRefreshofSelectionColumn(),this.dispatchEvent(new CustomEvent("selected",{detail:this.selected}))}async scrollToRow(e){let r=-1;if(Number.isInteger(e)?r=e:r=this.data.findIndex(s=>s===e),r!==-1){let s=this.querySelector("spectric-table-virtual-body"),t=this.querySelector(".table-wrapper"),a=r*this._getRowHeight();t.scrollTo({top:a,behavior:"smooth"});for(let o=0;o<100;o++)if(await new Promise(d=>setTimeout(d,10)),t.scrollTop==a){console.log("Scroll complete");break}s&&requestAnimationFrame(()=>{let o=[...s.querySelectorAll("tr")];o=o.filter(d=>{var c;return((c=d.querySelector("spectric-table-cell"))==null?void 0:c.index)===r}),o.length&&o[0].animate([{backgroundColor:"red"},{backgroundColor:"unset"}],{duration:200,iterations:5})})}}update(e){e.has("data")&&(this.selected=this.data.reduce((r,s)=>(this.selected.includes(s)&&r.push(s),r),[])),e.has("columns")&&this.select!=="none"&&(this.columns.find(r=>r[Kr])||this.columns.unshift(this.selectColumnConfig)),e.has("select")&&this.select==="single"&&this.selected.length>1&&(this.selected=[this.selected[0]],this.dispatchEvent(new CustomEvent("selected",{detail:[...this.selected]}))),super.update(e)}render(){let e=this.columns.filter(s=>!s.hidden),r=this._getRowHeight();return $`
|
|
1236
1333
|
<div
|
|
1237
1334
|
class="table-wrapper"
|
|
1238
|
-
style="--rowHeight:${
|
|
1335
|
+
style="--rowHeight:${r}px;--fontSize:${this.fontSize}px;--lineClamp:${Math.floor(r/this.fontSize)}"
|
|
1239
1336
|
>
|
|
1240
1337
|
<div role="table">
|
|
1241
1338
|
<spectric-table-header
|
|
@@ -1248,45 +1345,49 @@ spectric-button{
|
|
|
1248
1345
|
.columns=${e}
|
|
1249
1346
|
.data=${this.data}
|
|
1250
1347
|
.table=${this}
|
|
1251
|
-
.rowHeight=${
|
|
1348
|
+
.rowHeight=${r}
|
|
1252
1349
|
></spectric-table-virtual-body>
|
|
1253
1350
|
</div>
|
|
1254
1351
|
</div>
|
|
1255
|
-
${this.pagination
|
|
1256
|
-
${
|
|
1352
|
+
${this.pagination?$`<spectric-pagination
|
|
1353
|
+
${Me(this.pagination)}
|
|
1257
1354
|
@change=${this._handlePaginationChange}
|
|
1258
1355
|
></spectric-pagination>`:null}
|
|
1259
|
-
`}},
|
|
1260
|
-
|
|
1356
|
+
`}},le([g({type:Array,attribute:!1})],h.SpectricTableElement.prototype,"data",2),le([g({type:Object,attribute:!1})],h.SpectricTableElement.prototype,"pagination",2),le([g({attribute:!1})],h.SpectricTableElement.prototype,"columns",2),le([g({type:String,reflect:!0})],h.SpectricTableElement.prototype,"select",2),le([g({type:String,reflect:!0})],h.SpectricTableElement.prototype,"sort",2),le([g({type:Array,reflect:!1})],h.SpectricTableElement.prototype,"sortOrder",2),le([g({type:Number,reflect:!0})],h.SpectricTableElement.prototype,"rowHeight",2),le([g({type:Number,reflect:!0})],h.SpectricTableElement.prototype,"fontSize",2),le([W()],h.SpectricTableElement.prototype,"selected",2),h.SpectricTableElement=le([I(Yr)],h.SpectricTableElement);var va=Object.defineProperty,ma=Object.getOwnPropertyDescriptor,te=(i,e,r,s)=>{for(var t=s>1?void 0:s?ma(e,r):e,a=i.length-1,o;a>=0;a--)(o=i[a])&&(t=(s?o(e,r,t):o(t))||t);return s&&t&&va(e,r,t),t};const $a="spectric-popover";let q=class extends ie{constructor(){super(),this.delay=100,this.animationDuration=0,this.text="",this.position="right",this.maxWidth=300,this.mouseOffsetX=10,this.mouseOffsetY=0,this.portalTarget=document.body,this.open=!1,this._getMousePosition=i=>{this.mouseLocation={left:i.clientX,top:i.clientY},this.position=="mouse"&&this.open&&!this.mouseframe&&(this.mouseframe=requestAnimationFrame(()=>this.positionTooltip()))},this.applyStyle=i=>{Object.entries(i).forEach(([e,r])=>{this.portalElement.style.setProperty(e,r)})},this.positionTooltip=()=>{if(!this.target)return;let i={};const e=this.target.getBoundingClientRect(),r=this.portalElement.getBoundingClientRect();this.target!==document.body&&this.maxWidth&&this.maxWidth>0&&(r.width=Math.min(r.width,this.maxWidth));let s;this.position==="mouse"&&this.mouseLocation?(this.mouseframe=void 0,s={left:this.mouseLocation.left+this.mouseOffsetX+"px",top:this.mouseLocation.top+this.mouseOffsetY-r.height/2+"px"}):this.position==="top"?s={top:e.top-r.height+"px",left:e.left+e.width/2-r.width/2+"px"}:this.position==="bottom"?s={top:e.bottom+"px",left:e.left+e.width/2-r.width/2+"px"}:this.position==="left"?s={top:Math.max(0,e.top+e.height/2-r.height/2)+"px",left:e.left-r.width+"px"}:this.position==="right"?s={top:Math.max(0,e.top+e.height/2-r.height/2)+"px",left:e.right+"px"}:(s={left:"0px",top:"0px"},console.error("Unknown position... Maybe we sould implement auto?")),this.applyStyle({...i,...s}),this.position!=="mouse"&&this.portalElement.animate({opacity:[0,1]},{duration:this.animationDuration})},this.showPopover=this.showPopover.bind(this),this.hidePopover=this.hidePopover.bind(this),this.addDisposableListener(()=>this.target,"mousemove",this._getMousePosition)}isOpen(){return this.open}get target(){return this.triggerTarget||this.parentElement}createRenderRoot(){return this}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}hidePopover(){this.timer&&clearTimeout(this.timer),this.open=!1,this.portalElement.hidePopover()}async showPopover(){this.timer&&clearTimeout(this.timer),await new Promise(i=>{this.timer=window.setTimeout(i,this.delay)}),this.isConnected&&(this.portalElement.showPopover(),this.open=!0,requestAnimationFrame(this.positionTooltip))}render(){return $`<!-- ToolTip -->
|
|
1357
|
+
<div class="spectric-popover-portal ${this.position}" popover>
|
|
1261
1358
|
<div class="tooltip-container">
|
|
1262
|
-
|
|
1263
|
-
|
|
1359
|
+
<span class="tooltip-caret"></span>
|
|
1360
|
+
<div class="tooltip-content">${this.text}<slot></slot></div>
|
|
1264
1361
|
</div>
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1362
|
+
</div>`}};q.styles=Z`
|
|
1363
|
+
:host {
|
|
1364
|
+
max-height: 0px;
|
|
1365
|
+
max-width: 0px;
|
|
1366
|
+
display: none;
|
|
1367
|
+
pointer-events: none;
|
|
1368
|
+
}
|
|
1369
|
+
`,te([g({type:Number,reflect:!0})],q.prototype,"delay",2),te([g({type:Number,reflect:!0})],q.prototype,"animationDuration",2),te([g({type:String,reflect:!1})],q.prototype,"text",2),te([g({type:String,reflect:!0})],q.prototype,"position",2),te([g({type:Number,reflect:!0})],q.prototype,"maxWidth",2),te([g({type:Number,reflect:!1})],q.prototype,"mouseOffsetX",2),te([g({type:Number,reflect:!1})],q.prototype,"mouseOffsetY",2),te([pe(".spectric-popover-portal")],q.prototype,"portalElement",2),te([g({attribute:!1})],q.prototype,"portalTarget",2),te([g({attribute:!1})],q.prototype,"triggerTarget",2),q=te([I($a)],q);var _a=Object.defineProperty,wa=Object.getOwnPropertyDescriptor,Se=(i,e,r,s)=>{for(var t=s>1?void 0:s?wa(e,r):e,a=i.length-1,o;a>=0;a--)(o=i[a])&&(t=(s?o(e,r,t):o(t))||t);return s&&t&&_a(e,r,t),t};const Xr="spectric-tooltip";var ei=(i=>(i.top="top",i.bottom="bottom",i.left="left",i.right="right",i.mouse="mouse",i))(ei||{});h.TooltipElement=class extends q{constructor(){super(),this.delay=100,this.animationDuration=0,this.text="",this.position="right",this.maxWidth=300,this.portalTarget=document.body,this.open=!1,this.showToolTip=this.showToolTip.bind(this),this.addDisposableListener(()=>this.target,"mouseover",this.showToolTip),this.addDisposableListener(()=>this.target,"mouseleave",this.hidePopover)}async showToolTip(){await super.showPopover(),this.portalElement.classList.add("spectric-tooltip-portal")}},h.TooltipElement.styles=Z`:host{max-height: 0px;
|
|
1269
1370
|
max-width: 0px;
|
|
1270
1371
|
display: none;
|
|
1271
|
-
pointer-events:none;}`,
|
|
1372
|
+
pointer-events:none;}`,Se([g({type:Number,reflect:!0})],h.TooltipElement.prototype,"delay",2),Se([g({type:Number,reflect:!0})],h.TooltipElement.prototype,"animationDuration",2),Se([g({type:String,reflect:!1})],h.TooltipElement.prototype,"text",2),Se([g({type:String,reflect:!0})],h.TooltipElement.prototype,"position",2),Se([g({type:Number,reflect:!0})],h.TooltipElement.prototype,"maxWidth",2),Se([g({attribute:!1})],h.TooltipElement.prototype,"portalTarget",2),Se([g({attribute:!1})],h.TooltipElement.prototype,"triggerTarget",2),h.TooltipElement=Se([I(Xr)],h.TooltipElement);var Sa=Object.defineProperty,xa=Object.getOwnPropertyDescriptor,G=(i,e,r,s)=>{for(var t=s>1?void 0:s?xa(e,r):e,a=i.length-1,o;a>=0;a--)(o=i[a])&&(t=(s?o(e,r,t):o(t))||t);return s&&t&&Sa(e,r,t),t};let lt;window.hasOwnProperty("EyeDropper")&&(lt=new EyeDropper);let V=class extends B{constructor(){super(),this.value="#FF0000FF",this.showAlpha=!0,this.hue=0,this.alpha=1,this.saturation=1,this.lightness=1,this.canvas=Ve(),this.sldown=!1,this._handleAlphaChange=this._handleAlphaChange.bind(this),this._handleHueChange=this._handleHueChange.bind(this),this._handleApply=this._handleApply.bind(this),this._cancel=this._cancel.bind(this),this._handleSaturationLightnessClick=this._handleSaturationLightnessClick.bind(this)}createRenderRoot(){return this}update(i){if(i.has("value")){let{h:e,s:r,l:s,a:t}=us(this.value);this.hue=e,this.saturation=r,this.lightness=s,this.alpha=t,this.renderHueSaturationGrid()}super.update(i)}renderHueSaturationGrid(){if(!this.canvas.value)return;let e=this.canvas.value.getContext("2d");if(!e)return;let r=this.canvas.value.width/100,s=this.canvas.value.height/100,t=0,a=0;for(let o of Ea(this.hue))e.fillStyle=o,e.fillRect(t,a,r,s),t+=r,t=t%(r*101),t||(a+=s)}_handleSaturationLightnessClick(i){if(!this.canvas.value)return;let{offsetX:e,offsetY:r}=i;this.saturation=e/this.canvas.value.width,this.lightness=(this.canvas.value.height-r)/this.canvas.value.height,this.updateValue()}_handleHueChange(i){i.stopPropagation(),this.hue=parseInt(String(i.target.value))/100*360,i.target.style.setProperty("accent-color",`hsl(${this.hue}deg 100% 50%)`),this.renderHueSaturationGrid(),this.updateValue()}updateValue(){let i=Aa(this.hue,this.saturation*100,this.lightness*100)+Math.round(this.alpha*255).toString(16).padStart(2,"0");this.value=i}_handleAlphaChange(i){i.stopPropagation(),this.alpha=parseInt(String(i.target.value))/100,this.updateValue()}_handleApply(){var i;this.updateValue(),(i=this.querySelector("spectric-popover"))==null||i.hidePopover(),this.dispatchEvent(new Event("change",{bubbles:!0}))}_cancel(){var i;this.original&&(this.value=this.original),(i=this.querySelector("spectric-popover"))==null||i.hidePopover(),this.dispatchEvent(new Event("cancel"))}async _openPopover(){var e;let i=this.querySelector("spectric-popover");if(!(!i||i.isOpen())){for(this.original=this.value,(e=this.querySelector("spectric-popover"))==null||e.showPopover();!this.canvas.value;)await new Promise(r=>setTimeout(r,100));this.renderHueSaturationGrid()}}getPopover(){return $`
|
|
1272
1373
|
<spectric-input label="Hue" class="hue-gradient" variant="range" .value=${this.hue||0} style="accent-color:hsl(${this.hue}deg 100% 50%)" @change=${this._handleHueChange}></spectric-input>
|
|
1273
|
-
<canvas ${
|
|
1274
|
-
@mousedown=${
|
|
1275
|
-
@mouseup=${
|
|
1276
|
-
@mousemove=${
|
|
1374
|
+
<canvas ${We(this.canvas)} width=200 height=100 class="color-picker-saturation-lightness-grid" @click=${this._handleSaturationLightnessClick}
|
|
1375
|
+
@mousedown=${i=>{this.sldown=!0,i.preventDefault(),i.stopPropagation()}}
|
|
1376
|
+
@mouseup=${i=>{this.sldown=!1,i.preventDefault(),i.stopPropagation()}}
|
|
1377
|
+
@mousemove=${i=>{this.sldown&&this._handleSaturationLightnessClick(i)}}
|
|
1277
1378
|
></canvas>
|
|
1278
1379
|
<spectric-input class="alpha-gradient" ?hidden=${!this.showAlpha} label="Opacity" variant="range" .value=${(this.alpha||1)*100} @change=${this._handleAlphaChange}></spectric-input>
|
|
1279
1380
|
<div class="color-picker-footer">
|
|
1280
|
-
<spectric-button icon class="color-picker-eyedropper ${
|
|
1381
|
+
<spectric-button icon class="color-picker-eyedropper ${lt===void 0?"hidden":""}" @click=${async()=>{if(lt){let i=await(lt==null?void 0:lt.open()),{h:e,s:r,l:s,a:t}=us(i.sRGBHex);this.hue=e,this.saturation=r,this.lightness=s,this.alpha=t,this.updateValue()}}}>${ka}</spectric-button>
|
|
1281
1382
|
<spectric-button @click=${this._handleApply}>Apply</spectric-button>
|
|
1282
1383
|
<spectric-button variant="secondary" @click=${this._cancel}>Cancel</spectric-button>
|
|
1283
1384
|
</div>
|
|
1284
|
-
`}render(){return
|
|
1385
|
+
`}render(){return $`
|
|
1285
1386
|
<spectric-button variant="secondary" @click=${this._openPopover} icon>
|
|
1286
1387
|
<spectric-popover .text=${this.getPopover()} icon variant="text"></spectric-popover>
|
|
1287
1388
|
<div style="width:15px;height:15px;background-color:${this.value}"></div>
|
|
1288
1389
|
</spectric-button>
|
|
1289
|
-
`}};
|
|
1390
|
+
`}};G([g({type:String,reflect:!0})],V.prototype,"value",2),G([g({type:Boolean,reflect:!0})],V.prototype,"showAlpha",2),G([W()],V.prototype,"hue",2),G([W()],V.prototype,"alpha",2),G([W()],V.prototype,"saturation",2),G([W()],V.prototype,"lightness",2),G([Pe({capture:!0})],V.prototype,"_handleSaturationLightnessClick",1),G([Pe({capture:!0})],V.prototype,"_handleHueChange",1),G([Pe({capture:!0})],V.prototype,"_handleAlphaChange",1),G([Pe({capture:!0})],V.prototype,"_handleApply",1),G([Pe({capture:!0})],V.prototype,"_cancel",1),G([Pe({capture:!0})],V.prototype,"_openPopover",1),V=G([I("spectric-colorpicker")],V);const ka=$`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" height="15" width="15" fill="currentColor"><path d="M222,67.34a33.81,33.81,0,0,0-10.64-24.25C198.12,30.56,176.68,31,163.54,44.18L142.82,65l-.63-.63a22,22,0,0,0-31.11,0l-9,9a14,14,0,0,0,0,19.81l3.47,3.47L53.14,149.1a37.79,37.79,0,0,0-9.84,36.73l-8.31,19a11.68,11.68,0,0,0,2.46,13A13.91,13.91,0,0,0,47.32,222,14.15,14.15,0,0,0,53,220.82L71,212.92a37.92,37.92,0,0,0,35.84-10.07l52.44-52.46,3.47,3.48a14,14,0,0,0,19.8,0l9-9a22,22,0,0,0,0-31.12l-.66-.66L212,91.85A33.76,33.76,0,0,0,222,67.34Zm-123.61,127a26,26,0,0,1-26,6.47,6,6,0,0,0-4.16.24l-20,8.75a2,2,0,0,1-2.09-.31l9.12-20.9a5.94,5.94,0,0,0,.19-4.31,25.88,25.88,0,0,1,6.26-26.72l52.44-52.45,36.76,36.78Zm105.16-111L178.17,108.9a6,6,0,0,0,0,8.47l4.88,4.89a10,10,0,0,1,0,14.15l-9,9a2,2,0,0,1-2.82,0l-60.69-60.7a2,2,0,0,1,0-2.83l9-9a10,10,0,0,1,14.14,0l4.89,4.89a6,6,0,0,0,4.24,1.75h0a6,6,0,0,0,4.25-1.77L172,52.66c8.58-8.58,22.52-9,31.08-.85a22,22,0,0,1,.44,31.57Z"/></svg>`;function*Ea(i){for(let e=100;e>=0;e--)for(let r=0;r<=100;r++)yield`hsl(${i}, ${r}%, ${e}%)`}function Aa(i,e,r){r/=100;const s=e*Math.min(r,1-r)/100,t=a=>{const o=(a+i/30)%12,d=r-s*Math.max(Math.min(o-3,9-o,1),-1);return Math.round(255*d).toString(16).padStart(2,"0")};return`#${t(0)}${t(8)}${t(4)}`}function us(i){let e=0,r=0,s=0,t=255;i.length===4||i.length===5?(e=parseInt(i[1]+i[1],16),r=parseInt(i[2]+i[2],16),s=parseInt(i[3]+i[3],16),i.length===5&&(t=parseInt(i[4]+i[4],16))):(i.length===7||i.length===9)&&(e=parseInt(i.substring(1,3),16),r=parseInt(i.substring(3,5),16),s=parseInt(i.substring(5,7),16),i.length===9&&(t=parseInt(i.substring(7,9),16))),e/=255,r/=255,s/=255,t/=255;const a=Math.max(e,r,s),o=Math.min(e,r,s);let d=0,c=0,b=(a+o)/2;if(a===o)d=0,c=0;else{const _=a-o;switch(c=b>.5?_/(2-a-o):_/(a+o),a){case e:d=(r-s)/_+(r<s?6:0);break;case r:d=(s-e)/_+2;break;case s:d=(e-r)/_+4;break}d/=6}return d=Math.round(d*360),{h:d,s:c,l:b,a:t}}const Ca=Object.freeze(Object.defineProperty({__proto__:null,SpreadPropsDirective:Tr,debounce:Hi,debounceAnimation:Et,once:cs,spreadProps:Me},Symbol.toStringTag,{value:"Module"}));var Oa=Object.defineProperty,Pa=Object.getOwnPropertyDescriptor,ct=(i,e,r,s)=>{for(var t=s>1?void 0:s?Pa(e,r):e,a=i.length-1,o;a>=0;a--)(o=i[a])&&(t=(s?o(e,r,t):o(t))||t);return s&&t&&Oa(e,r,t),t};h.SpectricCalendar=class extends ie{constructor(){super(),this.currentDate=new Date,this.date=new Date,this.popup=!1,this.disabled=!1,this.handleMouseMove=Et(async e=>{const r=await this.calendarElement,s=r.getBoundingClientRect(),t=(e.clientX-s.left)/s.width*100,a=(e.clientY-s.top)/s.height*100;r.style.setProperty("--x",`${t}%`),r.style.setProperty("--y",`${a}%`)}),this.resetMouseMove=async()=>{const e=await this.calendarElement;e.style.setProperty("--x","200%"),e.style.setProperty("--y","200%")},this.addDisposableListener(this.calendarElement,"mousemove",this.handleMouseMove),this.addDisposableListener(this.calendarElement,"mouseleave",this.resetMouseMove)}createRenderRoot(){return this}getMonthDays(e,r){const s=new Date(e,r,1),t=[],a=s.getUTCDay(),o=new Date(e,r+1,0).getUTCDate();for(let d=0;d<a;d++)t.push("");for(let d=1;d<=o;d++)t.push(d);return t}changeMonth(e){const r=new Date(this.date);r.setUTCMonth(r.getUTCMonth()+e),this.currentDate=r}changeYear(e){const r=parseInt(e.target.value,10),s=new Date(this.date);s.setUTCFullYear(r),this.currentDate=s}selectDay(e){let r=this.date.getUTCFullYear(),s=this.date.getUTCMonth(),t=this.date.getUTCHours(),a=this.date.getUTCMinutes(),o=this.date.getUTCSeconds(),d=this.date.getUTCMilliseconds(),c=new Date;c.setUTCFullYear(r,s,e),c.setUTCHours(t,a,o,d),console.log(c.toISOString(),r,s,e),this.date=c;let b=this.querySelector("spectric-popover");b&&b.hidePopover(),this.dispatchEvent(new CustomEvent("select",{detail:c}))}update(e){e.has("currentDate")&&(this.currentDate===void 0?this.date=new Date:this.date=new Date(this.currentDate)),super.update(e)}render(){const e=this.date.getUTCFullYear(),r=this.date.getUTCMonth(),s=this.date.getUTCDate();this.date.toUTCString();const t=new Date(e,r,s).toLocaleString("default",{month:"long"}),a=this.getMonthDays(e,r),o=Array.from({length:21},(c,b)=>e-10+b),d=$`<spectric-panel class="calendar">
|
|
1290
1391
|
<div class="header">
|
|
1291
1392
|
<spectric-button
|
|
1292
1393
|
?disabled=${this.disabled}
|
|
@@ -1297,9 +1398,9 @@ spectric-button{
|
|
|
1297
1398
|
>🠈</spectric-button
|
|
1298
1399
|
>
|
|
1299
1400
|
<div class="month-year">
|
|
1300
|
-
<span>${
|
|
1401
|
+
<span>${t}</span>
|
|
1301
1402
|
<select ?disabled=${this.disabled} @change=${this.changeYear}>
|
|
1302
|
-
${
|
|
1403
|
+
${o.map(c=>$`<option value=${c} ?selected=${c===e}>${c}</option>`)}
|
|
1303
1404
|
</select>
|
|
1304
1405
|
</div>
|
|
1305
1406
|
<spectric-button ?disabled=${this.disabled} size="xsmall" icon @click=${()=>this.changeMonth(1)}
|
|
@@ -1307,18 +1408,18 @@ spectric-button{
|
|
|
1307
1408
|
>
|
|
1308
1409
|
</div>
|
|
1309
1410
|
<div class="days">
|
|
1310
|
-
${["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map(
|
|
1311
|
-
${
|
|
1411
|
+
${["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map(c=>$`<div class="day">${c}</div>`)}
|
|
1412
|
+
${a.map(c=>c==""?$`<span></span>`:$`<spectric-button
|
|
1312
1413
|
?disabled=${this.disabled}
|
|
1313
|
-
@click=${()=>this.selectDay(
|
|
1314
|
-
.backgroundColor=${
|
|
1414
|
+
@click=${()=>this.selectDay(c)}
|
|
1415
|
+
.backgroundColor=${c===s?void 0:"var(--spectric-background,#f4f4f4)"}
|
|
1315
1416
|
icon
|
|
1316
1417
|
size="xsmall"
|
|
1317
|
-
class="date ${
|
|
1318
|
-
>${
|
|
1418
|
+
class="date ${c===s?"active":""}"
|
|
1419
|
+
>${c}</spectric-button
|
|
1319
1420
|
>`)}
|
|
1320
1421
|
</div>
|
|
1321
|
-
</spectric-panel>`;return this.popup
|
|
1422
|
+
</spectric-panel>`;return this.popup?$`
|
|
1322
1423
|
<spectric-button
|
|
1323
1424
|
class="input-button-right"
|
|
1324
1425
|
icon
|
|
@@ -1326,7 +1427,7 @@ spectric-button{
|
|
|
1326
1427
|
variant="text"
|
|
1327
1428
|
type="button"
|
|
1328
1429
|
?disabled=${this.disabled}
|
|
1329
|
-
@click=${
|
|
1430
|
+
@click=${c=>{let b=this.querySelector("spectric-popover");b&&c.target&&(b.triggerTarget=c.target,b.showPopover())}}
|
|
1330
1431
|
><svg
|
|
1331
1432
|
xmlns="http://www.w3.org/2000/svg"
|
|
1332
1433
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
@@ -1367,6 +1468,6 @@ spectric-button{
|
|
|
1367
1468
|
></path>
|
|
1368
1469
|
</g></svg>
|
|
1369
1470
|
</spectric-button>
|
|
1370
|
-
<spectric-popover position="left" .text=${
|
|
1371
|
-
`:
|
|
1471
|
+
<spectric-popover position="left" .text=${d}></spectric-popover>
|
|
1472
|
+
`:d}},ct([xt(".days")],h.SpectricCalendar.prototype,"calendarElement",2),ct([g({attribute:!1})],h.SpectricCalendar.prototype,"currentDate",2),ct([W()],h.SpectricCalendar.prototype,"date",2),ct([g({type:Boolean,reflect:!0})],h.SpectricCalendar.prototype,"popup",2),ct([g({type:Boolean,reflect:!0})],h.SpectricCalendar.prototype,"disabled",2),h.SpectricCalendar=ct([I("spectric-calendar")],h.SpectricCalendar);const Ta={...ta,...Object.freeze(Object.defineProperty({__proto__:null,get BitDisplayCanvas(){return h.BitDisplayCanvas},ButtonSizes:Sr,ButtonVariants:xr,CSSPropsControls:rs,get DialogElement(){return h.DialogElement},DialogElementTag:Xt,ElementTag:Vr,get Header(){return h.Header},InputVariants:Dr,Orientations:qr,get PaginationElement(){return h.PaginationElement},PaginationElementTag:Wr,SPECTRIC_CSS_VARIABLES:os,get SpectricButton(){return h.SpectricButton},get SpectricCalendar(){return h.SpectricCalendar},get SpectricInput(){return h.SpectricInput},get SpectricPage(){return h.SpectricPage},get SpectricPanel(){return h.SpectricPanel},get SpectricQuery(){return h.SpectricQuery},get SpectricTableElement(){return h.SpectricTableElement},get SpectricThemeProvider(){return h.SpectricThemeProvider},get SplitView(){return h.SplitView},SupportedLanguages:Fr,TD_BorderAndPadding:at,TableElementTag:Yr,TableSelectOptions:Zr,TableSortDirection:Q,TableSortOption:Jr,ThemeSelections:ns,get TooltipElement(){return h.TooltipElement},TooltipElementTag:Xr,TooltipPostions:ei,nodeTypes:ae,toLabelValue:Tt},Symbol.toStringTag,{value:"Module"})),...Ca};h.BitArray=Or,h.ButtonSizes=Sr,h.ButtonVariants=xr,h.CSSPropsControls=rs,h.DialogElementTag=Xt,h.DisposableElement=ie,h.ElementTag=Vr,h.InputVariants=Dr,h.Orientations=qr,h.PaginationElementTag=Wr,h.SPECTRIC_CSS_VARIABLES=os,h.SpreadPropsDirective=Tr,h.SupportedLanguages=Fr,h.TD_BorderAndPadding=at,h.TableElementTag=Yr,h.TableSelectOptions=Zr,h.TableSortDirection=Q,h.TableSortOption=Jr,h.ThemeSelections=ns,h.TooltipElementTag=Xr,h.TooltipPostions=ei,h.debounce=Hi,h.debounceAnimation=Et,h.default=Ta,h.getListeners=zi,h.nodeTypes=ae,h.once=cs,h.spreadProps=Me,h.toLabelValue=Tt,Object.defineProperties(h,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1372
1473
|
//# sourceMappingURL=index.umd.js.map
|