@spectric/ui 0.0.4 → 0.0.5
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/assets/Banner-CZ3qKIQC.js +172 -0
- package/dist/assets/Banner.stories-BMf4MBpI.js +19 -0
- package/dist/assets/BitDisplay.stories-wztXxpxe.js +18 -0
- package/dist/assets/Bits-C_TSTjST.js +1 -0
- package/dist/assets/Button.stories-gHxjWwVf.js +142 -0
- package/dist/assets/Color-F6OSRLHC-AjFOL-zN.js +1 -0
- package/dist/assets/DocsRenderer-CFRXHY34-CvW79YxE.js +761 -0
- package/dist/assets/Header.stories-Bc09U6g1.js +25 -0
- package/dist/assets/Page.stories-DNJKhAFs.js +114 -0
- package/dist/assets/QueryBar.stories-Da5C-SV4.js +17 -0
- package/dist/assets/_commonjsHelpers-Cpj98o6Y.js +1 -0
- package/dist/assets/chunk-L4EGOTBX-AI5g0G5Z.js +2 -0
- package/dist/assets/data-CwENMT7L.js +3 -0
- package/dist/assets/dialog-CFHXbUTQ.js +611 -0
- package/dist/assets/directive-helpers-IbK5tOA8.js +5 -0
- package/dist/assets/entry-preview-Di-j0SPB.js +4 -0
- package/dist/assets/entry-preview-docs-CUBRpM7y.js +1 -0
- package/dist/assets/iframe-BQFuVTVZ.js +2 -0
- package/dist/assets/index-BCiKWbv6.js +1 -0
- package/dist/assets/index-BHYIh-Xd.js +8 -0
- package/dist/assets/index-DBGhiA-l.js +1 -0
- package/dist/assets/index-DrFu-skq.js +6 -0
- package/dist/assets/index-oFsFREWh.js +9 -0
- package/dist/assets/input.stories-Cgdv-5bN.js +58 -0
- package/dist/assets/lit-element-UdLzEcH-.js +19 -0
- package/dist/assets/preview-BWzBA1C2.js +396 -0
- package/dist/assets/preview-CGiTbRot.js +2 -0
- package/dist/assets/preview-D77C14du.js +34 -0
- package/dist/assets/preview-DEMzn_yN.js +1 -0
- package/dist/assets/preview-DFmD0pui.js +1 -0
- package/dist/assets/preview-DGUiP6tS.js +7 -0
- package/dist/assets/preview-DQVTHjv1.js +182 -0
- package/dist/assets/preview-aVwhiz9X.js +1 -0
- package/dist/assets/tiny-invariant-CopsF_GD.js +1 -0
- package/dist/classes/BitArray.d.ts +11 -0
- package/dist/classes/DisposibleElement.d.ts +21 -0
- package/dist/components/Banner.d.ts +51 -0
- package/dist/components/Bitdisplay.d.ts +91 -0
- package/dist/components/Button.d.ts +65 -0
- package/dist/components/Header.d.ts +70 -0
- package/dist/components/Page.d.ts +93 -0
- package/dist/components/Panel.d.ts +14 -0
- package/dist/components/ThemeProvider.d.ts +99 -0
- package/dist/components/button.css.d.ts +2 -0
- package/dist/components/configurations/classifications.d.ts +29 -0
- package/dist/components/dialog/dialog.css.d.ts +1 -0
- package/dist/components/dialog/dialog.d.ts +60 -0
- package/dist/components/dialog/index.d.ts +1 -0
- package/dist/components/header.css.d.ts +2 -0
- package/dist/components/index.d.ts +10 -0
- package/dist/components/input.css.d.ts +2 -0
- package/dist/components/input.d.ts +156 -0
- package/dist/components/page.css.d.ts +2 -0
- package/dist/components/panel.css.d.ts +2 -0
- package/dist/components/query_bar/QueryBar.d.ts +108 -0
- package/dist/components/query_bar/index.d.ts +2 -0
- package/dist/components/query_bar/querylanguage/kuery/ast/ast.d.ts +13 -0
- package/dist/components/query_bar/querylanguage/kuery/ast/index.d.ts +1 -0
- package/dist/components/query_bar/querylanguage/kuery/functions/and.d.ts +9 -0
- package/dist/components/query_bar/querylanguage/kuery/functions/exists.d.ts +10 -0
- package/dist/components/query_bar/querylanguage/kuery/functions/index.d.ts +1 -0
- package/dist/components/query_bar/querylanguage/kuery/functions/is.d.ts +34 -0
- package/dist/components/query_bar/querylanguage/kuery/functions/nested.d.ts +11 -0
- package/dist/components/query_bar/querylanguage/kuery/functions/not.d.ts +9 -0
- package/dist/components/query_bar/querylanguage/kuery/functions/or.d.ts +10 -0
- package/dist/components/query_bar/querylanguage/kuery/functions/range.d.ts +10 -0
- package/dist/components/query_bar/querylanguage/kuery/functions/utils/get_fields.d.ts +2 -0
- package/dist/components/query_bar/querylanguage/kuery/functions/utils/get_full_field_name_node.d.ts +2 -0
- package/dist/components/query_bar/querylanguage/kuery/index.d.ts +7 -0
- package/dist/components/query_bar/querylanguage/kuery/kuery_syntax_error.d.ts +13 -0
- package/dist/components/query_bar/querylanguage/kuery/node_types/function.d.ts +5 -0
- package/dist/components/query_bar/querylanguage/kuery/node_types/index.d.ts +3 -0
- package/dist/components/query_bar/querylanguage/kuery/node_types/literal.d.ts +3 -0
- package/dist/components/query_bar/querylanguage/kuery/node_types/named_arg.d.ts +4 -0
- package/dist/components/query_bar/querylanguage/kuery/node_types/types.d.ts +49 -0
- package/dist/components/query_bar/querylanguage/kuery/node_types/wildcard.d.ts +8 -0
- package/dist/components/query_bar/querylanguage/kuery/types.d.ts +18 -0
- package/dist/components/query_bar/querylanguage/outputTypes/toCQL.d.ts +14 -0
- package/dist/components/query_bar/querylanguage/outputTypes/toMongo.d.ts +20 -0
- package/dist/components/query_bar/querylanguage/utils.d.ts +1 -0
- package/dist/components/query_bar/types.d.ts +56 -0
- package/dist/components/splitview/index.d.ts +1 -0
- package/dist/components/splitview/splitview.css.d.ts +1 -0
- package/dist/components/splitview/splitview.d.ts +73 -0
- package/dist/components/types.d.ts +21 -0
- package/dist/custom-elements.json +1915 -0
- package/dist/favicon.svg +1 -0
- package/dist/iframe.html +639 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +4136 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.html +190 -0
- package/dist/index.json +1 -0
- package/dist/index.umd.js +945 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/nunito-sans-bold-italic.woff2 +0 -0
- package/dist/nunito-sans-bold.woff2 +0 -0
- package/dist/nunito-sans-italic.woff2 +0 -0
- package/dist/nunito-sans-regular.woff2 +0 -0
- package/dist/project.json +1 -0
- package/dist/sb-addons/chromatic-com-storybook-8/manager-bundle.js +333 -0
- package/dist/sb-addons/chromatic-com-storybook-8/manager-bundle.js.LEGAL.txt +40 -0
- package/dist/sb-addons/essentials-actions-2/manager-bundle.js +3 -0
- package/dist/sb-addons/essentials-actions-2/manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-addons/essentials-backgrounds-3/manager-bundle.js +12 -0
- package/dist/sb-addons/essentials-backgrounds-3/manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-addons/essentials-controls-1/manager-bundle.js +391 -0
- package/dist/sb-addons/essentials-controls-1/manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-addons/essentials-measure-6/manager-bundle.js +3 -0
- package/dist/sb-addons/essentials-measure-6/manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-addons/essentials-outline-7/manager-bundle.js +3 -0
- package/dist/sb-addons/essentials-outline-7/manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-addons/essentials-toolbars-5/manager-bundle.js +3 -0
- package/dist/sb-addons/essentials-toolbars-5/manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-addons/essentials-viewport-4/manager-bundle.js +3 -0
- package/dist/sb-addons/essentials-viewport-4/manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +3 -0
- package/dist/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-common-assets/favicon.svg +1 -0
- package/dist/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/dist/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/dist/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/dist/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/dist/sb-manager/globals-module-info.js +1028 -0
- package/dist/sb-manager/globals-runtime.js +40861 -0
- package/dist/sb-manager/globals.js +48 -0
- package/dist/sb-manager/runtime.js +13338 -0
- package/dist/sb-preview/globals.js +33 -0
- package/dist/sb-preview/runtime.js +7174 -0
- package/dist/style.css +1 -0
- package/dist/utils/debounce.d.ts +2 -0
- package/dist/utils/spread.d.ts +32 -0
- package/package.json +6 -1
- package/.gitlab-ci.yml +0 -28
- package/.nvmrc +0 -1
- package/.storybook/analyze.sh +0 -4
- package/.storybook/main.ts +0 -55
- package/.storybook/preview.ts +0 -42
- package/.vscode/extensions.json +0 -5
- package/.vscode/settings.json +0 -41
- package/html-include.png +0 -0
- package/test/__init__.py +0 -9
- package/test/elastic.py +0 -9
- package/test/interface.py +0 -16
- package/tsconfig.json +0 -29
- package/vite.config.js +0 -34
- package/vue-example.png +0 -0
- package/vue-include.png +0 -0
|
@@ -0,0 +1,945 @@
|
|
|
1
|
+
(function(d,Z){typeof exports=="object"&&typeof module<"u"?Z(exports):typeof define=="function"&&define.amd?define(["exports"],Z):(d=typeof globalThis<"u"?globalThis:d||self,Z(d["Spectric-UI"]={}))})(this,function(d){"use strict";/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2019 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/var zr;const Z=globalThis,ht=Z.ShadowRoot&&(Z.ShadyCSS===void 0||Z.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,gt=Symbol(),Gt=new WeakMap;let Jt=class{constructor(r,s,i){if(this._$cssResult$=!0,i!==gt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=r,this.t=s}get styleSheet(){let r=this.o;const s=this.t;if(ht&&r===void 0){const i=s!==void 0&&s.length===1;i&&(r=Gt.get(s)),r===void 0&&((this.o=r=new CSSStyleSheet).replaceSync(this.cssText),i&&Gt.set(s,r))}return r}toString(){return this.cssText}};const Yi=n=>new Jt(typeof n=="string"?n:n+"",void 0,gt),z=(n,...r)=>{const s=n.length===1?n[0]:r.reduce((i,a,t)=>i+(p=>{if(p._$cssResult$===!0)return p.cssText;if(typeof p=="number")return p;throw Error("Value passed to 'css' function must be a 'css' function result: "+p+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(a)+n[t+1],n[0]);return new Jt(s,n,gt)},Ki=(n,r)=>{if(ht)n.adoptedStyleSheets=r.map(s=>s instanceof CSSStyleSheet?s:s.styleSheet);else for(const s of r){const i=document.createElement("style"),a=Z.litNonce;a!==void 0&&i.setAttribute("nonce",a),i.textContent=s.cssText,n.appendChild(i)}},er=ht?n=>n:n=>n instanceof CSSStyleSheet?(r=>{let s="";for(const i of r.cssRules)s+=i.cssText;return Yi(s)})(n):n;/**
|
|
6
|
+
* @license
|
|
7
|
+
* Copyright 2017 Google LLC
|
|
8
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
+
*/const{is:Zi,defineProperty:Xi,getOwnPropertyDescriptor:Gi,getOwnPropertyNames:Ji,getOwnPropertySymbols:es,getPrototypeOf:ts}=Object,X=globalThis,tr=X.trustedTypes,rs=tr?tr.emptyScript:"",bt=X.reactiveElementPolyfillSupport,ke=(n,r)=>n,ze={toAttribute(n,r){switch(r){case Boolean:n=n?rs:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,r){let s=n;switch(r){case Boolean:s=n!==null;break;case Number:s=n===null?null:Number(n);break;case Object:case Array:try{s=JSON.parse(n)}catch{s=null}}return s}},vt=(n,r)=>!Zi(n,r),rr={attribute:!0,type:String,converter:ze,reflect:!1,hasChanged:vt};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),X.litPropertyMetadata??(X.litPropertyMetadata=new WeakMap);class fe extends HTMLElement{static addInitializer(r){this._$Ei(),(this.l??(this.l=[])).push(r)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(r,s=rr){if(s.state&&(s.attribute=!1),this._$Ei(),this.elementProperties.set(r,s),!s.noAccessor){const i=Symbol(),a=this.getPropertyDescriptor(r,i,s);a!==void 0&&Xi(this.prototype,r,a)}}static getPropertyDescriptor(r,s,i){const{get:a,set:t}=Gi(this.prototype,r)??{get(){return this[s]},set(p){this[s]=p}};return{get(){return a==null?void 0:a.call(this)},set(p){const g=a==null?void 0:a.call(this);t.call(this,p),this.requestUpdate(r,g,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(r){return this.elementProperties.get(r)??rr}static _$Ei(){if(this.hasOwnProperty(ke("elementProperties")))return;const r=ts(this);r.finalize(),r.l!==void 0&&(this.l=[...r.l]),this.elementProperties=new Map(r.elementProperties)}static finalize(){if(this.hasOwnProperty(ke("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ke("properties"))){const s=this.properties,i=[...Ji(s),...es(s)];for(const a of i)this.createProperty(a,s[a])}const r=this[Symbol.metadata];if(r!==null){const s=litPropertyMetadata.get(r);if(s!==void 0)for(const[i,a]of s)this.elementProperties.set(i,a)}this._$Eh=new Map;for(const[s,i]of this.elementProperties){const a=this._$Eu(s,i);a!==void 0&&this._$Eh.set(a,s)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(r){const s=[];if(Array.isArray(r)){const i=new Set(r.flat(1/0).reverse());for(const a of i)s.unshift(er(a))}else r!==void 0&&s.push(er(r));return s}static _$Eu(r,s){const i=s.attribute;return i===!1?void 0:typeof i=="string"?i:typeof r=="string"?r.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var r;this._$ES=new Promise(s=>this.enableUpdating=s),this._$AL=new Map,this._$E_(),this.requestUpdate(),(r=this.constructor.l)==null||r.forEach(s=>s(this))}addController(r){var s;(this._$EO??(this._$EO=new Set)).add(r),this.renderRoot!==void 0&&this.isConnected&&((s=r.hostConnected)==null||s.call(r))}removeController(r){var s;(s=this._$EO)==null||s.delete(r)}_$E_(){const r=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(r.set(i,this[i]),delete this[i]);r.size>0&&(this._$Ep=r)}createRenderRoot(){const r=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ki(r,this.constructor.elementStyles),r}connectedCallback(){var r;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(r=this._$EO)==null||r.forEach(s=>{var i;return(i=s.hostConnected)==null?void 0:i.call(s)})}enableUpdating(r){}disconnectedCallback(){var r;(r=this._$EO)==null||r.forEach(s=>{var i;return(i=s.hostDisconnected)==null?void 0:i.call(s)})}attributeChangedCallback(r,s,i){this._$AK(r,i)}_$EC(r,s){var t;const i=this.constructor.elementProperties.get(r),a=this.constructor._$Eu(r,i);if(a!==void 0&&i.reflect===!0){const p=(((t=i.converter)==null?void 0:t.toAttribute)!==void 0?i.converter:ze).toAttribute(s,i.type);this._$Em=r,p==null?this.removeAttribute(a):this.setAttribute(a,p),this._$Em=null}}_$AK(r,s){var t;const i=this.constructor,a=i._$Eh.get(r);if(a!==void 0&&this._$Em!==a){const p=i.getPropertyOptions(a),g=typeof p.converter=="function"?{fromAttribute:p.converter}:((t=p.converter)==null?void 0:t.fromAttribute)!==void 0?p.converter:ze;this._$Em=a,this[a]=g.fromAttribute(s,p.type),this._$Em=null}}requestUpdate(r,s,i){if(r!==void 0){if(i??(i=this.constructor.getPropertyOptions(r)),!(i.hasChanged??vt)(this[r],s))return;this.P(r,s,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(r,s,i){this._$AL.has(r)||this._$AL.set(r,s),i.reflect===!0&&this._$Em!==r&&(this._$Ej??(this._$Ej=new Set)).add(r)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(s){Promise.reject(s)}const r=this.scheduleUpdate();return r!=null&&await r,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[t,p]of this._$Ep)this[t]=p;this._$Ep=void 0}const a=this.constructor.elementProperties;if(a.size>0)for(const[t,p]of a)p.wrapped!==!0||this._$AL.has(t)||this[t]===void 0||this.P(t,this[t],p)}let r=!1;const s=this._$AL;try{r=this.shouldUpdate(s),r?(this.willUpdate(s),(i=this._$EO)==null||i.forEach(a=>{var t;return(t=a.hostUpdate)==null?void 0:t.call(a)}),this.update(s)):this._$EU()}catch(a){throw r=!1,this._$EU(),a}r&&this._$AE(s)}willUpdate(r){}_$AE(r){var s;(s=this._$EO)==null||s.forEach(i=>{var a;return(a=i.hostUpdated)==null?void 0:a.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(r)),this.updated(r)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(r){return!0}update(r){this._$Ej&&(this._$Ej=this._$Ej.forEach(s=>this._$EC(s,this[s]))),this._$EU()}updated(r){}firstUpdated(r){}}fe.elementStyles=[],fe.shadowRootOptions={mode:"open"},fe[ke("elementProperties")]=new Map,fe[ke("finalized")]=new Map,bt==null||bt({ReactiveElement:fe}),(X.reactiveElementVersions??(X.reactiveElementVersions=[])).push("2.0.4");/**
|
|
10
|
+
* @license
|
|
11
|
+
* Copyright 2017 Google LLC
|
|
12
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
+
*/const Ce=globalThis,Ie=Ce.trustedTypes,ir=Ie?Ie.createPolicy("lit-html",{createHTML:n=>n}):void 0,sr="$lit$",G=`lit$${Math.random().toFixed(9).slice(2)}$`,or="?"+G,is=`<${or}>`,se=document,xe=()=>se.createComment(""),Ee=n=>n===null||typeof n!="object"&&typeof n!="function",yt=Array.isArray,ss=n=>yt(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",mt=`[
|
|
14
|
+
\f\r]`,Oe=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,nr=/-->/g,cr=/>/g,oe=RegExp(`>|${mt}(?:([^\\s"'>=/]+)(${mt}*=${mt}*(?:[^
|
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),ar=/'/g,lr=/"/g,ur=/^(?:script|style|textarea|title)$/i,os=n=>(r,...s)=>({_$litType$:n,strings:r,values:s}),k=os(1),ne=Symbol.for("lit-noChange"),x=Symbol.for("lit-nothing"),pr=new WeakMap,ce=se.createTreeWalker(se,129);function dr(n,r){if(!yt(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return ir!==void 0?ir.createHTML(r):r}const ns=(n,r)=>{const s=n.length-1,i=[];let a,t=r===2?"<svg>":r===3?"<math>":"",p=Oe;for(let g=0;g<s;g++){const v=n[g];let _,A,S=-1,E=0;for(;E<v.length&&(p.lastIndex=E,A=p.exec(v),A!==null);)E=p.lastIndex,p===Oe?A[1]==="!--"?p=nr:A[1]!==void 0?p=cr:A[2]!==void 0?(ur.test(A[2])&&(a=RegExp("</"+A[2],"g")),p=oe):A[3]!==void 0&&(p=oe):p===oe?A[0]===">"?(p=a??Oe,S=-1):A[1]===void 0?S=-2:(S=p.lastIndex-A[2].length,_=A[1],p=A[3]===void 0?oe:A[3]==='"'?lr:ar):p===lr||p===ar?p=oe:p===nr||p===cr?p=Oe:(p=oe,a=void 0);const C=p===oe&&n[g+1].startsWith("/>")?" ":"";t+=p===Oe?v+is:S>=0?(i.push(_),v.slice(0,S)+sr+v.slice(S)+G+C):v+G+(S===-2?g:C)}return[dr(n,t+(n[s]||"<?>")+(r===2?"</svg>":r===3?"</math>":"")),i]};class Pe{constructor({strings:r,_$litType$:s},i){let a;this.parts=[];let t=0,p=0;const g=r.length-1,v=this.parts,[_,A]=ns(r,s);if(this.el=Pe.createElement(_,i),ce.currentNode=this.el.content,s===2||s===3){const S=this.el.content.firstChild;S.replaceWith(...S.childNodes)}for(;(a=ce.nextNode())!==null&&v.length<g;){if(a.nodeType===1){if(a.hasAttributes())for(const S of a.getAttributeNames())if(S.endsWith(sr)){const E=A[p++],C=a.getAttribute(S).split(G),L=/([.?@])?(.*)/.exec(E);v.push({type:1,index:t,name:L[2],strings:C,ctor:L[1]==="."?as:L[1]==="?"?ls:L[1]==="@"?us:Qe}),a.removeAttribute(S)}else S.startsWith(G)&&(v.push({type:6,index:t}),a.removeAttribute(S));if(ur.test(a.tagName)){const S=a.textContent.split(G),E=S.length-1;if(E>0){a.textContent=Ie?Ie.emptyScript:"";for(let C=0;C<E;C++)a.append(S[C],xe()),ce.nextNode(),v.push({type:2,index:++t});a.append(S[E],xe())}}}else if(a.nodeType===8)if(a.data===or)v.push({type:2,index:t});else{let S=-1;for(;(S=a.data.indexOf(G,S+1))!==-1;)v.push({type:7,index:t}),S+=G.length-1}t++}}static createElement(r,s){const i=se.createElement("template");return i.innerHTML=r,i}}function he(n,r,s=n,i){var p,g;if(r===ne)return r;let a=i!==void 0?(p=s._$Co)==null?void 0:p[i]:s._$Cl;const t=Ee(r)?void 0:r._$litDirective$;return(a==null?void 0:a.constructor)!==t&&((g=a==null?void 0:a._$AO)==null||g.call(a,!1),t===void 0?a=void 0:(a=new t(n),a._$AT(n,s,i)),i!==void 0?(s._$Co??(s._$Co=[]))[i]=a:s._$Cl=a),a!==void 0&&(r=he(n,a._$AS(n,r.values),a,i)),r}class cs{constructor(r,s){this._$AV=[],this._$AN=void 0,this._$AD=r,this._$AM=s}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(r){const{el:{content:s},parts:i}=this._$AD,a=((r==null?void 0:r.creationScope)??se).importNode(s,!0);ce.currentNode=a;let t=ce.nextNode(),p=0,g=0,v=i[0];for(;v!==void 0;){if(p===v.index){let _;v.type===2?_=new Te(t,t.nextSibling,this,r):v.type===1?_=new v.ctor(t,v.name,v.strings,this,r):v.type===6&&(_=new ps(t,this,r)),this._$AV.push(_),v=i[++g]}p!==(v==null?void 0:v.index)&&(t=ce.nextNode(),p++)}return ce.currentNode=se,a}p(r){let s=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(r,i,s),s+=i.strings.length-2):i._$AI(r[s])),s++}}class Te{get _$AU(){var r;return((r=this._$AM)==null?void 0:r._$AU)??this._$Cv}constructor(r,s,i,a){this.type=2,this._$AH=x,this._$AN=void 0,this._$AA=r,this._$AB=s,this._$AM=i,this.options=a,this._$Cv=(a==null?void 0:a.isConnected)??!0}get parentNode(){let r=this._$AA.parentNode;const s=this._$AM;return s!==void 0&&(r==null?void 0:r.nodeType)===11&&(r=s.parentNode),r}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(r,s=this){r=he(this,r,s),Ee(r)?r===x||r==null||r===""?(this._$AH!==x&&this._$AR(),this._$AH=x):r!==this._$AH&&r!==ne&&this._(r):r._$litType$!==void 0?this.$(r):r.nodeType!==void 0?this.T(r):ss(r)?this.k(r):this._(r)}O(r){return this._$AA.parentNode.insertBefore(r,this._$AB)}T(r){this._$AH!==r&&(this._$AR(),this._$AH=this.O(r))}_(r){this._$AH!==x&&Ee(this._$AH)?this._$AA.nextSibling.data=r:this.T(se.createTextNode(r)),this._$AH=r}$(r){var t;const{values:s,_$litType$:i}=r,a=typeof i=="number"?this._$AC(r):(i.el===void 0&&(i.el=Pe.createElement(dr(i.h,i.h[0]),this.options)),i);if(((t=this._$AH)==null?void 0:t._$AD)===a)this._$AH.p(s);else{const p=new cs(a,this),g=p.u(this.options);p.p(s),this.T(g),this._$AH=p}}_$AC(r){let s=pr.get(r.strings);return s===void 0&&pr.set(r.strings,s=new Pe(r)),s}k(r){yt(this._$AH)||(this._$AH=[],this._$AR());const s=this._$AH;let i,a=0;for(const t of r)a===s.length?s.push(i=new Te(this.O(xe()),this.O(xe()),this,this.options)):i=s[a],i._$AI(t),a++;a<s.length&&(this._$AR(i&&i._$AB.nextSibling,a),s.length=a)}_$AR(r=this._$AA.nextSibling,s){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,s);r&&r!==this._$AB;){const a=r.nextSibling;r.remove(),r=a}}setConnected(r){var s;this._$AM===void 0&&(this._$Cv=r,(s=this._$AP)==null||s.call(this,r))}}class Qe{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(r,s,i,a,t){this.type=1,this._$AH=x,this._$AN=void 0,this.element=r,this.name=s,this._$AM=a,this.options=t,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=x}_$AI(r,s=this,i,a){const t=this.strings;let p=!1;if(t===void 0)r=he(this,r,s,0),p=!Ee(r)||r!==this._$AH&&r!==ne,p&&(this._$AH=r);else{const g=r;let v,_;for(r=t[0],v=0;v<t.length-1;v++)_=he(this,g[i+v],s,v),_===ne&&(_=this._$AH[v]),p||(p=!Ee(_)||_!==this._$AH[v]),_===x?r=x:r!==x&&(r+=(_??"")+t[v+1]),this._$AH[v]=_}p&&!a&&this.j(r)}j(r){r===x?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,r??"")}}class as extends Qe{constructor(){super(...arguments),this.type=3}j(r){this.element[this.name]=r===x?void 0:r}}class ls extends Qe{constructor(){super(...arguments),this.type=4}j(r){this.element.toggleAttribute(this.name,!!r&&r!==x)}}class us extends Qe{constructor(r,s,i,a,t){super(r,s,i,a,t),this.type=5}_$AI(r,s=this){if((r=he(this,r,s,0)??x)===ne)return;const i=this._$AH,a=r===x&&i!==x||r.capture!==i.capture||r.once!==i.once||r.passive!==i.passive,t=r!==x&&(i===x||a);a&&this.element.removeEventListener(this.name,this,i),t&&this.element.addEventListener(this.name,this,r),this._$AH=r}handleEvent(r){var s;typeof this._$AH=="function"?this._$AH.call(((s=this.options)==null?void 0:s.host)??this.element,r):this._$AH.handleEvent(r)}}class ps{constructor(r,s,i){this.element=r,this.type=6,this._$AN=void 0,this._$AM=s,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(r){he(this,r)}}const $t=Ce.litHtmlPolyfillSupport;$t==null||$t(Pe,Te),(Ce.litHtmlVersions??(Ce.litHtmlVersions=[])).push("3.2.1");const fr=(n,r,s)=>{const i=(s==null?void 0:s.renderBefore)??r;let a=i._$litPart$;if(a===void 0){const t=(s==null?void 0:s.renderBefore)??null;i._$litPart$=a=new Te(r.insertBefore(xe(),t),t,void 0,s??{})}return a._$AI(n),a};/**
|
|
16
|
+
* @license
|
|
17
|
+
* Copyright 2017 Google LLC
|
|
18
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
+
*/let N=class extends fe{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var s;const r=super.createRenderRoot();return(s=this.renderOptions).renderBefore??(s.renderBefore=r.firstChild),r}update(r){const s=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(r),this._$Do=fr(s,this.renderRoot,this.renderOptions)}connectedCallback(){var r;super.connectedCallback(),(r=this._$Do)==null||r.setConnected(!0)}disconnectedCallback(){var r;super.disconnectedCallback(),(r=this._$Do)==null||r.setConnected(!1)}render(){return ne}};N._$litElement$=!0,N.finalized=!0,(zr=globalThis.litElementHydrateSupport)==null||zr.call(globalThis,{LitElement:N});const wt=globalThis.litElementPolyfillSupport;wt==null||wt({LitElement:N}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.1");/**
|
|
20
|
+
* @license
|
|
21
|
+
* Copyright 2017 Google LLC
|
|
22
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
+
*/const hr={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},_t=n=>(...r)=>({_$litDirective$:n,values:r});let gr=class{constructor(r){}get _$AU(){return this._$AM._$AU}_$AT(r,s,i){this._$Ct=r,this._$AM=s,this._$Ci=i}_$AS(r,s){return this.update(r,s)}update(r,s){return this.render(...s)}};/**
|
|
24
|
+
* @license
|
|
25
|
+
* Copyright 2018 Google LLC
|
|
26
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
+
*/const br="important",ds=" !"+br,vr=_t(class extends gr{constructor(n){var r;if(super(n),n.type!==hr.ATTRIBUTE||n.name!=="style"||((r=n.strings)==null?void 0:r.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(n){return Object.keys(n).reduce((r,s)=>{const i=n[s];return i==null?r:r+`${s=s.includes("-")?s:s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(n,[r]){const{style:s}=n.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(r)),this.render(r);for(const i of this.ft)r[i]==null&&(this.ft.delete(i),i.includes("-")?s.removeProperty(i):s[i]=null);for(const i in r){const a=r[i];if(a!=null){this.ft.add(i);const t=typeof a=="string"&&a.endsWith(ds);i.includes("-")||t?s.setProperty(i,t?a.slice(0,-11):a,t?br:""):s[i]=a}}return ne}}),fs=z`
|
|
28
|
+
:host{
|
|
29
|
+
display: inline-block;
|
|
30
|
+
--text-on-color: var(--spectric-text-on-color, #ffffff);
|
|
31
|
+
--text-on-color-disabled: var(--spectric-text-on-color-disabled, #8d8d8d);
|
|
32
|
+
--text-placeholder: var(--spectric-text-placeholder, rgba(22, 22, 22, 0.4));
|
|
33
|
+
--text-primary: var(--spectric-text-primary, #161616);
|
|
34
|
+
--text-secondary: var(--spectric-text-secondary, #525252);
|
|
35
|
+
--button-border-radius: var(--spectric-border-radius,.4em);
|
|
36
|
+
--button-separator: var(--spectric-button-separator, #e0e0e0);
|
|
37
|
+
--button-primary: var(--spectric-button-primary,#1ea7fd);
|
|
38
|
+
--button-secondary: var(--spectric-button-secondary, #77878b);
|
|
39
|
+
--button-tertiary: var(--spectric-button-tertiary, #0f62fe);
|
|
40
|
+
--button-danger-primary: var(--spectric-button-danger-primary, #da1e28);
|
|
41
|
+
--button-danger-secondary: var(--spectric-button-danger-secondary, #da1e28);
|
|
42
|
+
--button-danger-active: var(--spectric-button-danger-active, #750e13);
|
|
43
|
+
--button-primary-active: var(--spectric-button-primary-active, #002d9c);
|
|
44
|
+
--button-secondary-active: var(--spectric-button-secondary-active, #6f6f6f);
|
|
45
|
+
--button-tertiary-active: var(--spectric-button-tertiary-active, #002d9c);
|
|
46
|
+
--button-danger-hover: var(--spectric-button-danger-hover, #b81921);
|
|
47
|
+
--button-primary-hover: var(--spectric-button-primary-hover, #0050e6);
|
|
48
|
+
--button-secondary-hover: var(--spectric-button-secondary-hover, #474747);
|
|
49
|
+
--button-tertiary-hover: var(--spectric-button-tertiary-hover, #0050e6);
|
|
50
|
+
--button-disabled: var(--spectric-button-disabled, #c6c6c6);
|
|
51
|
+
}
|
|
52
|
+
:host([disabled]) { pointer-events: none }
|
|
53
|
+
|
|
54
|
+
.spectric-button {
|
|
55
|
+
pointer-events:none;
|
|
56
|
+
position: relative;
|
|
57
|
+
display: inline-block;
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
border: 0;
|
|
60
|
+
border-radius: var(--button-border-radius);
|
|
61
|
+
font-weight: 700;
|
|
62
|
+
line-height: 2em;
|
|
63
|
+
font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
|
64
|
+
overflow:hidden;
|
|
65
|
+
}
|
|
66
|
+
.animation{
|
|
67
|
+
pointer-events: none;
|
|
68
|
+
transition: background-color 0.3s cubic-bezier(0.25, 0.8, 0.5, 1), opacity 0.4s cubic-bezier(0.25, 0.8, 0.5, 1);
|
|
69
|
+
width: 100%;
|
|
70
|
+
height: 100%;
|
|
71
|
+
position: absolute;
|
|
72
|
+
left: 0;
|
|
73
|
+
top: 0;
|
|
74
|
+
}
|
|
75
|
+
.animation::before {
|
|
76
|
+
content: "";
|
|
77
|
+
position: absolute;
|
|
78
|
+
top: 0;
|
|
79
|
+
left: 0 /* rtl:ignore */;
|
|
80
|
+
width: 100%;
|
|
81
|
+
height: 100%;
|
|
82
|
+
}
|
|
83
|
+
:host(:active) .animation::after {
|
|
84
|
+
box-shadow: 0 0 0 0 black;
|
|
85
|
+
position: absolute;
|
|
86
|
+
opacity: 1;
|
|
87
|
+
transition: 0s;
|
|
88
|
+
}
|
|
89
|
+
.animation::after{
|
|
90
|
+
content: "";
|
|
91
|
+
display: block;
|
|
92
|
+
position: absolute;
|
|
93
|
+
border-radius: var(--border-radius);
|
|
94
|
+
left: 0;
|
|
95
|
+
top: 0;
|
|
96
|
+
width: 100%;
|
|
97
|
+
height: 100%;
|
|
98
|
+
opacity: 0;
|
|
99
|
+
transition: all .5s;
|
|
100
|
+
box-shadow: 0 0 30px black inset;
|
|
101
|
+
}
|
|
102
|
+
.spectric-button.spectric-button--secondary .animation::after , .spectric-button.spectric-button--text .animation::after {
|
|
103
|
+
box-shadow: 0 0 30px white inset;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.spectric-button:disabled{
|
|
107
|
+
cursor: not-allowed;
|
|
108
|
+
pointer-events: none;
|
|
109
|
+
filter: contrast(0.5);
|
|
110
|
+
/* background-color:var(--button-disabled); */
|
|
111
|
+
color:var(--text-on-color-disabled);
|
|
112
|
+
}
|
|
113
|
+
.spectric-button:disabled .animation , :host(:disabled:hover) .animation{
|
|
114
|
+
background-color: rgba(0, 0, 0, 0);
|
|
115
|
+
opacity:1
|
|
116
|
+
}
|
|
117
|
+
.spectric-button-danger--true:hover{
|
|
118
|
+
background-color:var(--button-danger-hover);
|
|
119
|
+
}
|
|
120
|
+
.spectric-button--primary.spectric-button-danger--true {
|
|
121
|
+
background-color:var(--button-danger-primary);
|
|
122
|
+
box-shadow:none;
|
|
123
|
+
}
|
|
124
|
+
.spectric-button--secondary.spectric-button-danger--true {
|
|
125
|
+
color: var(--text-on-color);
|
|
126
|
+
background-color:color-mix(in srgb, var(--button-danger-primary) 70%, transparent);
|
|
127
|
+
box-shadow:none;
|
|
128
|
+
}
|
|
129
|
+
.spectric-button--text.spectric-button-danger--true {
|
|
130
|
+
color:var(--button-danger-primary);
|
|
131
|
+
|
|
132
|
+
}
|
|
133
|
+
:host(:hover) .spectric-button--text.spectric-button-danger--true {
|
|
134
|
+
background-color:var(--button-danger-primary);
|
|
135
|
+
color:var(--text-on-color)
|
|
136
|
+
}
|
|
137
|
+
:host(:hover) .animation{
|
|
138
|
+
background: currentColor;
|
|
139
|
+
opacity: 0.15;
|
|
140
|
+
}
|
|
141
|
+
.spectric-button--primary {
|
|
142
|
+
box-shadow: color-mix(in srgb, var(--button-primary) 50%, transparent) 0px 0px 0px 1px inset;
|
|
143
|
+
background-color: var(--button-primary);
|
|
144
|
+
color: var(--text-on-color);
|
|
145
|
+
}
|
|
146
|
+
:host > .spectric-button--primary:focus {
|
|
147
|
+
outline-color: var(--button-secondary);
|
|
148
|
+
outline-width: thin;
|
|
149
|
+
outline-style: solid;
|
|
150
|
+
}
|
|
151
|
+
:host > .spectric-button--secondary:focus {
|
|
152
|
+
outline-color: var(--button-primary);
|
|
153
|
+
outline-width: thin;
|
|
154
|
+
outline-style: solid;
|
|
155
|
+
}
|
|
156
|
+
:host > .spectric-button--text:focus {
|
|
157
|
+
outline-color: var(--button-primary);
|
|
158
|
+
outline-width: thin;
|
|
159
|
+
outline-style: solid;
|
|
160
|
+
}
|
|
161
|
+
/* :host([variant="text"]):focus-within:focus,button:focus, button:focus-within, button:focus-visible{
|
|
162
|
+
outline-color: red;
|
|
163
|
+
} */
|
|
164
|
+
.spectric-button--secondary {
|
|
165
|
+
background-color:transparent;
|
|
166
|
+
box-shadow: var(--button-secondary) 0px 0px 0px 1px inset;
|
|
167
|
+
color: var(--button-secondary);
|
|
168
|
+
}
|
|
169
|
+
.spectric-button--text {
|
|
170
|
+
background-color: transparent;
|
|
171
|
+
color: var(--text-secondary);
|
|
172
|
+
}
|
|
173
|
+
.spectric-button--small {
|
|
174
|
+
padding: 5px 10px;
|
|
175
|
+
font-size: 12px;
|
|
176
|
+
}
|
|
177
|
+
.spectric-button--medium {
|
|
178
|
+
padding: 6px 17px;
|
|
179
|
+
font-size: 14px;
|
|
180
|
+
}
|
|
181
|
+
.spectric-button--large {
|
|
182
|
+
padding: 7px 24px;
|
|
183
|
+
font-size: 16px;
|
|
184
|
+
}
|
|
185
|
+
`;/**
|
|
186
|
+
* @license
|
|
187
|
+
* Copyright 2017 Google LLC
|
|
188
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
189
|
+
*/const R=n=>(r,s)=>{s!==void 0?s.addInitializer(()=>{customElements.define(n,r)}):customElements.define(n,r)};/**
|
|
190
|
+
* @license
|
|
191
|
+
* Copyright 2017 Google LLC
|
|
192
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
193
|
+
*/const hs={attribute:!0,type:String,converter:ze,reflect:!1,hasChanged:vt},gs=(n=hs,r,s)=>{const{kind:i,metadata:a}=s;let t=globalThis.litPropertyMetadata.get(a);if(t===void 0&&globalThis.litPropertyMetadata.set(a,t=new Map),t.set(s.name,n),i==="accessor"){const{name:p}=s;return{set(g){const v=r.get.call(this);r.set.call(this,g),this.requestUpdate(p,v,n)},init(g){return g!==void 0&&this.P(p,void 0,n),g}}}if(i==="setter"){const{name:p}=s;return function(g){const v=this[p];r.call(this,g),this.requestUpdate(p,v,n)}}throw Error("Unsupported decorator location: "+i)};function y(n){return(r,s)=>typeof s=="object"?gs(n,r,s):((i,a,t)=>{const p=a.hasOwnProperty(t);return a.constructor.createProperty(t,p?{...i,wrapped:!0}:i),p?Object.getOwnPropertyDescriptor(a,t):void 0})(n,r,s)}/**
|
|
194
|
+
* @license
|
|
195
|
+
* Copyright 2017 Google LLC
|
|
196
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
197
|
+
*/function Fe(n){return y({...n,state:!0,attribute:!1})}/**
|
|
198
|
+
* @license
|
|
199
|
+
* Copyright 2017 Google LLC
|
|
200
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
201
|
+
*/const yr=(n,r,s)=>(s.configurable=!0,s.enumerable=!0,Reflect.decorate&&typeof r!="object"&&Object.defineProperty(n,r,s),s);/**
|
|
202
|
+
* @license
|
|
203
|
+
* Copyright 2017 Google LLC
|
|
204
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
205
|
+
*/function Le(n,r){return(s,i,a)=>{const t=p=>{var g;return((g=p.renderRoot)==null?void 0:g.querySelector(n))??null};return yr(s,i,{get(){return t(this)}})}}/**
|
|
206
|
+
* @license
|
|
207
|
+
* Copyright 2017 Google LLC
|
|
208
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
209
|
+
*/function He(n){return(r,s)=>yr(r,s,{async get(){var i;return await this.updateComplete,((i=this.renderRoot)==null?void 0:i.querySelector(n))??null}})}var bs=Object.defineProperty,vs=Object.getOwnPropertyDescriptor,ae=(n,r,s,i)=>{for(var a=i>1?void 0:i?vs(r,s):r,t=n.length-1,p;t>=0;t--)(p=n[t])&&(a=(i?p(r,s,a):p(a))||a);return i&&a&&bs(r,s,a),a},mr=(n=>(n.large="large",n.medium="medium",n.small="small",n))(mr||{}),$r=(n=>(n.primary="primary",n.secondary="secondary",n.text="text",n))($r||{});const ys={primary:"spectric-button--primary",secondary:"spectric-button--secondary",text:"spectric-button--text"};d.SpectricButton=class extends N{constructor(){super(...arguments),this.variant="primary",this.disabled=!1,this.size="large",this.label="",this.danger=!1,this._onClick=r=>{if(r instanceof CustomEvent)return;r.preventDefault(),r.stopImmediatePropagation(),r.stopPropagation();const s={bubbles:!0,composed:!0,detail:r};this.dispatchEvent(new CustomEvent("click",s))}}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this._onClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this._onClick)}render(){const r=ys[this.variant]||"spectric-button--primary";return k`
|
|
210
|
+
<button
|
|
211
|
+
type="button"
|
|
212
|
+
?disabled=${this.disabled}
|
|
213
|
+
class=${["spectric-button",`spectric-button-danger--${this.danger||!1}`,`spectric-button--${this.size||"medium"}`,r].join(" ")}
|
|
214
|
+
style=${vr({backgroundColor:this.backgroundColor})}
|
|
215
|
+
>
|
|
216
|
+
<span class="animation"></span>
|
|
217
|
+
<slot>${this.label}</slot>
|
|
218
|
+
</button>
|
|
219
|
+
`}},d.SpectricButton.styles=fs,ae([y({type:String,reflect:!0})],d.SpectricButton.prototype,"variant",2),ae([y({type:Boolean,reflect:!0})],d.SpectricButton.prototype,"disabled",2),ae([y({type:String,reflect:!0})],d.SpectricButton.prototype,"backgroundColor",2),ae([y({type:String,reflect:!0})],d.SpectricButton.prototype,"size",2),ae([y({type:String,reflect:!0})],d.SpectricButton.prototype,"label",2),ae([y({type:Boolean,reflect:!0})],d.SpectricButton.prototype,"danger",2),d.SpectricButton=ae([R("spectric-button")],d.SpectricButton);/**
|
|
220
|
+
* @license
|
|
221
|
+
* Copyright 2020 Google LLC
|
|
222
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
223
|
+
*/const ms=n=>n.strings===void 0;/**
|
|
224
|
+
* @license
|
|
225
|
+
* Copyright 2017 Google LLC
|
|
226
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
227
|
+
*/const Ne=(n,r)=>{var i;const s=n._$AN;if(s===void 0)return!1;for(const a of s)(i=a._$AO)==null||i.call(a,r,!1),Ne(a,r);return!0},qe=n=>{let r,s;do{if((r=n._$AM)===void 0)break;s=r._$AN,s.delete(n),n=r}while((s==null?void 0:s.size)===0)},wr=n=>{for(let r;r=n._$AM;n=r){let s=r._$AN;if(s===void 0)r._$AN=s=new Set;else if(s.has(n))break;s.add(n),_s(r)}};function $s(n){this._$AN!==void 0?(qe(this),this._$AM=n,wr(this)):this._$AM=n}function ws(n,r=!1,s=0){const i=this._$AH,a=this._$AN;if(a!==void 0&&a.size!==0)if(r)if(Array.isArray(i))for(let t=s;t<i.length;t++)Ne(i[t],!1),qe(i[t]);else i!=null&&(Ne(i,!1),qe(i));else Ne(this,n)}const _s=n=>{n.type==hr.CHILD&&(n._$AP??(n._$AP=ws),n._$AQ??(n._$AQ=$s))};class _r extends gr{constructor(){super(...arguments),this._$AN=void 0}_$AT(r,s,i){super._$AT(r,s,i),wr(this),this.isConnected=r._$AU}_$AO(r,s=!0){var i,a;r!==this.isConnected&&(this.isConnected=r,r?(i=this.reconnected)==null||i.call(this):(a=this.disconnected)==null||a.call(this)),s&&(Ne(this,r),qe(this))}setValue(r){if(ms(this._$Ct))this._$Ct._$AI(r,this);else{const s=[...this._$Ct._$AH];s[this._$Ci]=r,this._$Ct._$AI(s,this,0)}}disconnected(){}reconnected(){}}/**
|
|
228
|
+
* @license
|
|
229
|
+
* Copyright 2020 Google LLC
|
|
230
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
231
|
+
*/const We=()=>new Ss;class Ss{}const St=new WeakMap,Ve=_t(class extends _r{render(n){return x}update(n,[r]){var i;const s=r!==this.Y;return s&&this.Y!==void 0&&this.rt(void 0),(s||this.lt!==this.ct)&&(this.Y=r,this.ht=(i=n.options)==null?void 0:i.host,this.rt(this.ct=n.element)),x}rt(n){if(this.isConnected||(n=void 0),typeof this.Y=="function"){const r=this.ht??globalThis;let s=St.get(r);s===void 0&&(s=new WeakMap,St.set(r,s)),s.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),s.set(this.Y,n),n!==void 0&&this.Y.call(this.ht,n)}else this.Y.value=n}get lt(){var n,r;return typeof this.Y=="function"?(n=St.get(this.ht??globalThis))==null?void 0:n.get(this.Y):(r=this.Y)==null?void 0:r.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),As=class{constructor(r){return this.buffer=r,this.u8=new Uint8Array(r),new Proxy(this,{get(s,i){return s[i]?s[i]:s.getBit(i)}})}getBit(r){var s=this.u8[r>>3],i=r&7;return s>>7-i&1}setBit(r,s){var i=r&7;s?this.u8[r>>3]|=128>>i:this.u8[r>>3]&=~(128>>i)}get length(){return this.u8.byteLength*8}set(r,s){for(let i=s||0,a=0,t=r.length;a<t;i++,a++)this.setBit(i,r[a])}subarray(r,s){let i=[];r=r||0,s=s||this.length,s=s>this.length?this.length:s;for(let a=r;a<s;a++)i.push(this.getBit(a));return i}};class Sr{constructor(r,s,i,a){this.__target=r,this._handler=i,this._type=s,this._handler=i,this._options=a||!1,r instanceof Promise?r.then(t=>{this._handler&&(this._node=t,this._node.addEventListener(this._type,this._handler,this._options))}):(this._node=r,this._node.addEventListener(this._type,this._handler,this._options))}dispose(){this._handler&&(this._node&&(console.log(`removing event ${this._type} from `,this._node,this.__target instanceof Promise),this._node.removeEventListener(this._type,this._handler,this._options)),this.__target=void 0,this._node=void 0,this._handler=void 0)}}class Ar extends N{constructor(){super(...arguments),this._disposables=new Set,this._isDisposed=!1,this._disposableListeners=[],this._connected=!1}addDisposableListener(r,s,i){if(this._disposableListeners.find(t=>t.event===s&&t.target===r&&t.handler===i)){console.warn("Event handler already exists best practice is to add the this in the constructor");return}this._disposableListeners.push({target:r,event:s,handler:i}),this._connected&&this.registerDisposable(new Sr(r,s,i))}registerDisposable(r){if(!r)return r;if(r===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?console.warn(new Error("Trying to add a disposable to something that has already been disposed of. The added object will be leaked!").stack):this._disposables.add(r),r}connectedCallback(){super.connectedCallback(),this._connected=!0,this._isDisposed=!1,this._disposableListeners.forEach(({target:r,event:s,handler:i})=>{this.registerDisposable(new Sr(r,s,i))})}disconnectedCallback(){super.disconnectedCallback(),this._connected=!1,this._disposables.forEach(r=>{r.dispose()}),this._isDisposed=!0}}const kr=n=>{var r;return(...s)=>{r&&cancelAnimationFrame(r),r=requestAnimationFrame(()=>{n.apply(void 0,s)})}};var ks=Object.defineProperty,Cs=Object.getOwnPropertyDescriptor,le=(n,r,s,i)=>{for(var a=i>1?void 0:i?Cs(r,s):r,t=n.length-1,p;t>=0;t--)(p=n[t])&&(a=(i?p(r,s,a):p(a))||a);return i&&a&&ks(r,s,a),a};const xs=["mousemove","click","dblclick","mousedown","mouseup","contextmenu"],Ye={width:200,height:200},Ke={width:10,height:10};d.BitDisplayCanvas=class extends Ar{constructor(){super(),this.arrayBuffer=new ArrayBuffer(0),this.frameWidth=100,this.scale=1,this.width=200,this.height=200,this.state={},this.yStart=0,this.xStart=0,this.refs={viewport:We(),canvas:We(),scrollDiv:We()},this.color="#000000",this.onThemeChange=()=>{let i=getComputedStyle(this);this.color!=i.color&&(this.color=i.color,this.paint())},this.onResize=()=>{this.calculateViewport()},this.handleScroll=()=>{if(!this.refs.viewport.value)return;const i=this.getPxPerBit();this.yStart=this.refs.viewport.value.scrollTop?Math.floor(this.refs.viewport.value.scrollTop/i)+1:0,this.xStart=this.refs.viewport.value.scrollLeft?Math.floor(this.refs.viewport.value.scrollLeft/i)+1:0,this.paint()};let r=new ResizeObserver(this.onResize);r.dispose=()=>{this.resizeObserver.disconnect()},this.resizeObserver=r,this.addDisposableListener(document.body,"theme-change",this.onThemeChange);var s={};xs.forEach(i=>{this.addDisposableListener(this._canvas,i,kr(async a=>{a.stopImmediatePropagation(),a.stopPropagation(),a.preventDefault();var t=await this._canvas;let p=t.getBoundingClientRect(),g={x:Math.floor(Math.abs(a.clientX-p.left)),y:Math.floor(Math.abs(a.clientY-p.top))},v=this.canvasPositionToBit(g);if(i==="mousemove"&&s[i]==v)return;s[i]=v;let _="bit"+String(i).charAt(0).toUpperCase()+String(i).slice(1);if(v!=-1){let A=new CustomEvent(_,{detail:{bitIndex:v,position:g,nativeEvent:a}});this.dispatchEvent(A)}}))})}connectedCallback(){this.onResize(),super.connectedCallback(),this.registerDisposable(this.resizeObserver),this.resizeObserver.observe(this)}updated(r){r.has("arrayBuffer")&&this.arrayBuffer&&(this._bitArray=new As(this.arrayBuffer));const s=["arrayBuffer","scale","frameWidth","width","height"];for(const i of s)if(r.has(i)){this.paint();return}}canvasPositionToBit(r){let s=Math.floor(r.x/this.scale),i=Math.floor(r.y/this.scale);return s>this.frameWidth-1?-1:this.yStart*this.frameWidth+this.xStart+(i*this.frameWidth+s)}paint(){if(!this.refs.canvas.value||!this._bitArray)return;const{frameWidth:r,_bitArray:s}=this;if(r<=0)return;this.calculateViewport();const{width:i=Ye.width,height:a=Ye.height}=this,t=this.getPxPerBit(),p=this.refs.canvas.value.getContext("2d");if(!p)return;this.state.scale!=t&&(p.reset(),p.scale(t,t));let g=getComputedStyle(this);p.fillStyle=g.color,p.clearRect(0,0,i,a);let v=0;for(let _=this.yStart*r+this.xStart,A=s.length;_<A;_++){let S=_%r-this.xStart;if(!(S<0)){if(Math.floor(S*t)>i){v++,_=v*r+this.yStart*r+this.xStart-1;continue}if(Math.floor(v*t)>a)break;s.getBit(_)===1&&p.fillRect(S,v,1,1),(_+1)%r===0&&_>=r-1&&v++}}}getPxPerBit(){return this.scale>0?this.scale:1}calculateViewport(){const{frameWidth:r,_bitArray:s}=this;if(this.refs.scrollDiv.value){var i=this.getPxPerBit();const a=s.length/r*i,t=r*i,p=this.refs.scrollDiv.value;p.style.width=t+"px",p.style.height=a+"px"}}render(){const{height:r=Ye.height,width:s=Ye.width}=this;return k`
|
|
232
|
+
<div
|
|
233
|
+
id="viewport"
|
|
234
|
+
${Ve(this.refs.viewport)}
|
|
235
|
+
@scroll=${this.handleScroll}
|
|
236
|
+
style=${`width:${s}px;height:${r}px;overflow:auto;position:relative`}
|
|
237
|
+
>
|
|
238
|
+
<div
|
|
239
|
+
id="fakescrolldiv"
|
|
240
|
+
${Ve(this.refs.scrollDiv)}
|
|
241
|
+
>
|
|
242
|
+
</div>
|
|
243
|
+
</div>
|
|
244
|
+
<canvas
|
|
245
|
+
${Ve(this.refs.canvas)}
|
|
246
|
+
width=${s-Ke.width}
|
|
247
|
+
height=${r-Ke.height}
|
|
248
|
+
></canvas>
|
|
249
|
+
`}},d.BitDisplayCanvas.styles=z`
|
|
250
|
+
:host{
|
|
251
|
+
position: relative;
|
|
252
|
+
--border-radius: var(--spectric-border-radius,4em);
|
|
253
|
+
--scroll-color: var(--spectric-background-inverse,#393939);
|
|
254
|
+
--background-color: var(--spectric-background, #ffffff);
|
|
255
|
+
}
|
|
256
|
+
#viewport{
|
|
257
|
+
overflow: scroll;
|
|
258
|
+
position: absolute;
|
|
259
|
+
}
|
|
260
|
+
#fakescrolldiv {
|
|
261
|
+
position: relative;
|
|
262
|
+
overflow-x: hidden;
|
|
263
|
+
overflow-y: hidden;
|
|
264
|
+
z-index:-1;
|
|
265
|
+
}
|
|
266
|
+
canvas{
|
|
267
|
+
position: absolute;
|
|
268
|
+
left:0;
|
|
269
|
+
top:0;
|
|
270
|
+
background-color:var(--background-color);
|
|
271
|
+
}
|
|
272
|
+
::-webkit-scrollbar {
|
|
273
|
+
height: ${Ke.height}px;
|
|
274
|
+
width: ${Ke.width}px;
|
|
275
|
+
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/* Webkit psudo elements don't pick up variables defined by the host */
|
|
279
|
+
::-webkit-scrollbar-thumb {
|
|
280
|
+
background: var(--spectric-background-inverse,#393939);
|
|
281
|
+
border-radius: var(--spectric-border-radius,4em);
|
|
282
|
+
-webkit-border-radius: var(--spectric-border-radius,4em);
|
|
283
|
+
padding-top: 1px;
|
|
284
|
+
padding-bottom: 1px;
|
|
285
|
+
box-shadow: 0 0 1px var(--spectric-primary,#242424) inset;
|
|
286
|
+
}
|
|
287
|
+
::-webkit-scrollbar-thumb:hover {
|
|
288
|
+
background: var(--spectric-primary,#009eb3);
|
|
289
|
+
}
|
|
290
|
+
::-webkit-scrollbar-corner {
|
|
291
|
+
background: var(--spectric-background, #ffffff);
|
|
292
|
+
}
|
|
293
|
+
/* Buttons */
|
|
294
|
+
|
|
295
|
+
::-webkit-scrollbar-button:single-button {
|
|
296
|
+
background-color: transparent;
|
|
297
|
+
display: block;
|
|
298
|
+
border-style: solid;
|
|
299
|
+
}/* Up */
|
|
300
|
+
::-webkit-scrollbar-button:single-button:vertical:decrement {
|
|
301
|
+
border-width: 0 5px 5px 5px;
|
|
302
|
+
border-color: var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-background-inverse,#393939) var(--spectric-background, #ffffff);
|
|
303
|
+
}
|
|
304
|
+
::-webkit-scrollbar-button:single-button:vertical:decrement:hover {
|
|
305
|
+
border-color: var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-primary,#009eb3) var(--spectric-background, #ffffff);
|
|
306
|
+
}
|
|
307
|
+
/* Down */
|
|
308
|
+
::-webkit-scrollbar-button:single-button:vertical:increment {
|
|
309
|
+
border-width: 5px 5px 0 5px;
|
|
310
|
+
border-color: var(--spectric-background-inverse,#393939) var(--spectric-background, #ffffff) transparent var(--spectric-background, #ffffff);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
::-webkit-scrollbar-button:vertical:single-button:increment:hover {
|
|
314
|
+
border-color: var(--spectric-primary,#009eb3) var(--spectric-background, #ffffff) transparent var(--spectric-background, #ffffff);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/* Left */
|
|
318
|
+
::-webkit-scrollbar-button:single-button:horizontal:decrement {
|
|
319
|
+
border-width: 5px 5px 5px 0;
|
|
320
|
+
border-color:var(--spectric-background, #ffffff) var(--spectric-background-inverse,#393939) var(--spectric-background, #ffffff) var(--spectric-background, #ffffff);
|
|
321
|
+
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
::-webkit-scrollbar-button:single-button:horizontal:decrement:hover {
|
|
325
|
+
border-width: 5px 5px 5px 0;
|
|
326
|
+
border-color:var(--spectric-background, #ffffff) var(--spectric-primary,#009eb3) var(--spectric-background, #ffffff) var(--spectric-background, #ffffff);
|
|
327
|
+
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
/* Right */
|
|
333
|
+
::-webkit-scrollbar-button:single-button:horizontal:increment {
|
|
334
|
+
border-width: 5px 0 5px 5px;
|
|
335
|
+
border-color:var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-background-inverse,#393939);
|
|
336
|
+
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
::-webkit-scrollbar-button:single-button:horizontal:increment:hover {
|
|
340
|
+
border-width: 5px 0 5px 5px;
|
|
341
|
+
border-color:var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-primary,#009eb3);
|
|
342
|
+
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
`,le([y({type:Object,attribute:!1})],d.BitDisplayCanvas.prototype,"arrayBuffer",2),le([y({type:Number})],d.BitDisplayCanvas.prototype,"frameWidth",2),le([y({type:Number})],d.BitDisplayCanvas.prototype,"scale",2),le([y({type:Number})],d.BitDisplayCanvas.prototype,"width",2),le([y({type:Number})],d.BitDisplayCanvas.prototype,"height",2),le([He("canvas")],d.BitDisplayCanvas.prototype,"_canvas",2),d.BitDisplayCanvas=le([R("spectric-bit-display")],d.BitDisplayCanvas);const Es=z`.spectric-header {
|
|
346
|
+
display: flex;
|
|
347
|
+
justify-content: space-between;
|
|
348
|
+
align-items: center;
|
|
349
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
|
350
|
+
padding: 15px 20px;
|
|
351
|
+
font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.spectric-header svg {
|
|
355
|
+
display: inline-block;
|
|
356
|
+
vertical-align: top;
|
|
357
|
+
}
|
|
358
|
+
.spectric-header slot {
|
|
359
|
+
display: inline-block;
|
|
360
|
+
vertical-align: middle;
|
|
361
|
+
}
|
|
362
|
+
.spectric-header h1 {
|
|
363
|
+
display: inline-block;
|
|
364
|
+
vertical-align: middle;
|
|
365
|
+
margin: 6px 0 6px 10px;
|
|
366
|
+
font-weight: 700;
|
|
367
|
+
font-size: 20px;
|
|
368
|
+
line-height: 1;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
.spectric-header button + button {
|
|
372
|
+
margin-left: 10px;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
.spectric-header .welcome {
|
|
376
|
+
margin-right: 10px;
|
|
377
|
+
color: #333;
|
|
378
|
+
font-size: 14px;
|
|
379
|
+
}
|
|
380
|
+
`;var Os=Object.defineProperty,Ps=Object.getOwnPropertyDescriptor,Ze=(n,r,s,i)=>{for(var a=i>1?void 0:i?Ps(r,s):r,t=n.length-1,p;t>=0;t--)(p=n[t])&&(a=(i?p(r,s,a):p(a))||a);return i&&a&&Os(r,s,a),a};d.Header=class extends N{constructor(){super(...arguments),this.showCreateAccount=!1,this.showLoginButton=!1,this.username="",this.onLogout=()=>{const r={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("logout",r))},this.onLogin=()=>{const r={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("login",r))},this.onCreateAccount=()=>{const r={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("createAccount",r))}}render(){return k`
|
|
381
|
+
<header>
|
|
382
|
+
<div class="spectric-header">
|
|
383
|
+
<div style="flex-grow:1;">
|
|
384
|
+
<slot name="branding"></slot>
|
|
385
|
+
<h1><slot name="name"></slot></h1>
|
|
386
|
+
<slot name="center"></slot>
|
|
387
|
+
</div>
|
|
388
|
+
${this.showLoginButton!==!1?k`
|
|
389
|
+
<div>
|
|
390
|
+
${this.username&&this.username!==""?k`<spectric-button variant="secondary" size="small" @click=${this.onLogout}>Log out</spectric-button>`:k`
|
|
391
|
+
${this.showCreateAccount!==!1?k`<spectric-button variant="text" size="small" @click=${this.onCreateAccount}>Sign up</spectric-button>`:null}
|
|
392
|
+
<spectric-button variant="primary" size="small" @click=${this.onLogin}>Log in</spectric-button>`}
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
</div>`:null}
|
|
396
|
+
<slot name="end"></slot>
|
|
397
|
+
</div>
|
|
398
|
+
</header>
|
|
399
|
+
`}},d.Header.styles=Es,Ze([y({type:Boolean,reflect:!0})],d.Header.prototype,"showCreateAccount",2),Ze([y({type:Boolean,reflect:!0})],d.Header.prototype,"showLoginButton",2),Ze([y({type:String,reflect:!0})],d.Header.prototype,"username",2),d.Header=Ze([R("spectric-header")],d.Header);var Ts=Object.defineProperty,Ls=Object.getOwnPropertyDescriptor,ge=(n,r,s,i)=>{for(var a=i>1?void 0:i?Ls(r,s):r,t=n.length-1,p;t>=0;t--)(p=n[t])&&(a=(i?p(r,s,a):p(a))||a);return i&&a&&Ts(r,s,a),a};const Ns={display:"flex",alignItems:"center",backgroundColor:"black",color:"white",textAlign:"center"};let ue=class extends N{constructor(){super(...arguments),this.dismissable=!1,this.text="",this.bannerId="",this.headerStyle={},this._dismissed=!1,this.onDismiss=n=>{n.preventDefault(),n.stopPropagation();const r={bubbles:!0,composed:!0};this._dismissed=!0;let{bannerId:s,text:i,headerStyle:a,dismissable:t}=this;this.dispatchEvent(new CustomEvent("bannerDismissed",{detail:{bannerId:s,text:i,headerStyle:a,dismissable:t},...r}))}}render(){if(!this._dismissed)return k`
|
|
400
|
+
<header style=${vr({...Ns,...this.headerStyle})}>
|
|
401
|
+
<div style="flex-grow:1"><slot name="text">${this.text}</slot><slot></slot></div>
|
|
402
|
+
${this.dismissable?k`<spectric-button size="small" @click=${this.onDismiss}>X</spectric-button>`:null}
|
|
403
|
+
</header>
|
|
404
|
+
`}};ge([y({type:Boolean,reflect:!0})],ue.prototype,"dismissable",2),ge([y({type:String,reflect:!0})],ue.prototype,"text",2),ge([y({type:String,reflect:!0})],ue.prototype,"bannerId",2),ge([y({type:Object})],ue.prototype,"headerStyle",2),ge([y({state:!0,type:Boolean,attribute:!1})],ue.prototype,"_dismissed",2),ue=ge([R("spectric-banner")],ue);const Ds=z`
|
|
405
|
+
|
|
406
|
+
:host {
|
|
407
|
+
height:100vh;
|
|
408
|
+
width: 100%;
|
|
409
|
+
display: flex;
|
|
410
|
+
flex-direction: column;
|
|
411
|
+
font-size: 14px;
|
|
412
|
+
line-height: 24px;
|
|
413
|
+
font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
|
414
|
+
--spectric-background: var(--background,#ffffff);
|
|
415
|
+
--spectric-background-hover:var(--background-hover,rgba(141, 141, 141, 0.12));
|
|
416
|
+
--spectric-background-inverse: var(--background-inverse,#f4f4f4);
|
|
417
|
+
--spectric-background-inverse-hover: var(--background-inverse-hover,#474747);
|
|
418
|
+
--spectric-border-radius: var(--border-radius,.4em);
|
|
419
|
+
--spectric-primary:var(--primary,#1ea7fd);
|
|
420
|
+
--spectric-secondary: var(--secondary,#77878b);
|
|
421
|
+
--spectric-tertiary: var(--tertiary,#0f62fe);
|
|
422
|
+
--spectric-disabled: var(--disabled,#c6c6c6);
|
|
423
|
+
|
|
424
|
+
/* panel */
|
|
425
|
+
--panel-color:var(--spectric-background-inverse);
|
|
426
|
+
--panel-color-inverse:var(--spectric-background);
|
|
427
|
+
--spectric-border-disabled: var(--disabled);
|
|
428
|
+
|
|
429
|
+
/*inputs*/
|
|
430
|
+
--spectric-input-color: var(--panel-color-inverse);
|
|
431
|
+
--spectric-input-bottom: var(--panel-color);
|
|
432
|
+
|
|
433
|
+
--spectric-text-on-color: var(--text-on-color,#ffffff);
|
|
434
|
+
--spectric-text-on-color-disabled: var(--text-on-color-disabled,#8d8d8d);
|
|
435
|
+
--spectric-text-placeholder: var(--text-placeholder,rgba(22, 22, 22, 0.4));
|
|
436
|
+
--spectric-text-primary: var(--text-primary,#161616);
|
|
437
|
+
--spectric-text-secondary: var(--text-secondary,#525252);
|
|
438
|
+
/* Buttons */
|
|
439
|
+
--spectric-button-separator: #e0e0e0;
|
|
440
|
+
--spectric-button-primary: var(--primary,#1ea7fd);
|
|
441
|
+
--spectric-button-secondary: var(--secondary,#77878b);
|
|
442
|
+
--spectric-button-tertiary: var(--tertiary);
|
|
443
|
+
--spectric-button-danger-primary: #da1e28;
|
|
444
|
+
--spectric-button-danger-secondary: #da1e28;
|
|
445
|
+
--spectric-button-danger-active: #750e13;
|
|
446
|
+
--spectric-button-primary-active: #002d9c;
|
|
447
|
+
--spectric-button-secondary-active: #6f6f6f;
|
|
448
|
+
--spectric-button-tertiary-active: #002d9c;
|
|
449
|
+
--spectric-button-danger-hover: #b81921;
|
|
450
|
+
--spectric-button-primary-hover: #0050e6;
|
|
451
|
+
--spectric-button-secondary-hover: #474747;
|
|
452
|
+
--spectric-button-tertiary-hover: #0050e6;
|
|
453
|
+
--spectric-text-on-color-disabled: var(--disabled,#c6c6c6)
|
|
454
|
+
--spectric-button-disabled: #c6c6c6;
|
|
455
|
+
}
|
|
456
|
+
*{
|
|
457
|
+
color: var(--spectric-text-primary);
|
|
458
|
+
background-color: var(--spectric-background,rgb(255 255 255 / 60%));
|
|
459
|
+
}
|
|
460
|
+
article{
|
|
461
|
+
flex-grow:1;
|
|
462
|
+
overflow-y:auto;
|
|
463
|
+
padding-left: calc(var(--spectric-border-radius, 0.4em) + 2px);
|
|
464
|
+
padding-right: calc(var(--spectric-border-radius, 0.4em) + 2px);
|
|
465
|
+
}
|
|
466
|
+
h2 {
|
|
467
|
+
display: inline-block;
|
|
468
|
+
vertical-align: middle;
|
|
469
|
+
margin: 0 0 4px;
|
|
470
|
+
font-weight: 700;
|
|
471
|
+
font-size: 32px;
|
|
472
|
+
line-height: 1;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
p {
|
|
476
|
+
margin: 1em 0;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
a {
|
|
480
|
+
color: var(--primary);
|
|
481
|
+
text-decoration: var(--primary);
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
ul {
|
|
485
|
+
margin: 1em 0;
|
|
486
|
+
padding-left: 30px;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
li {
|
|
490
|
+
margin-bottom: 8px;
|
|
491
|
+
}
|
|
492
|
+
::-webkit-scrollbar {
|
|
493
|
+
width: 10px;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
::-webkit-scrollbar-thumb {
|
|
497
|
+
background: var(--spectric-background-inverse,#393939);
|
|
498
|
+
border-radius: var(--spectric-border-radius,4em);
|
|
499
|
+
-webkit-border-radius: var(--spectric-border-radius,4em);
|
|
500
|
+
padding-top: 1px;
|
|
501
|
+
padding-bottom: 1px;
|
|
502
|
+
box-shadow: 0 0 1px var(--spectric-primary,#242424) inset;
|
|
503
|
+
}
|
|
504
|
+
::-webkit-scrollbar-thumb:hover {
|
|
505
|
+
background: var(--spectric-primary,#009eb3);
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
::-webkit-scrollbar-button:single-button {
|
|
510
|
+
background-color: transparent;
|
|
511
|
+
display: block;
|
|
512
|
+
border-style: solid;
|
|
513
|
+
}
|
|
514
|
+
/* Up */
|
|
515
|
+
::-webkit-scrollbar-button:single-button:vertical:decrement {
|
|
516
|
+
border-width: 0 5px 5px 5px;
|
|
517
|
+
border-color: var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-background-inverse,#393939) var(--spectric-background, #ffffff);
|
|
518
|
+
}
|
|
519
|
+
::-webkit-scrollbar-button:single-button:vertical:decrement:hover {
|
|
520
|
+
border-color: var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-primary,#009eb3) var(--spectric-background, #ffffff);
|
|
521
|
+
}
|
|
522
|
+
/* Down */
|
|
523
|
+
::-webkit-scrollbar-button:single-button:vertical:increment {
|
|
524
|
+
border-width: 5px 5px 0 5px;
|
|
525
|
+
border-color: var(--spectric-background-inverse,#393939) var(--spectric-background, #ffffff) transparent var(--spectric-background, #ffffff);
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
::-webkit-scrollbar-button:vertical:single-button:increment:hover {
|
|
529
|
+
border-color: var(--spectric-primary,#009eb3) var(--spectric-background, #ffffff) transparent var(--spectric-background, #ffffff);
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
/* Left */
|
|
533
|
+
::-webkit-scrollbar-button:single-button:horizontal:decrement {
|
|
534
|
+
border-width: 5px 5px 5px 0;
|
|
535
|
+
border-color:var(--spectric-background, #ffffff) var(--spectric-background-inverse,#393939) var(--spectric-background, #ffffff) var(--spectric-background, #ffffff);
|
|
536
|
+
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
::-webkit-scrollbar-button:single-button:horizontal:decrement:hover {
|
|
540
|
+
border-width: 5px 5px 5px 0;
|
|
541
|
+
border-color:var(--spectric-background, #ffffff) var(--spectric-primary,#009eb3) var(--spectric-background, #ffffff) var(--spectric-background, #ffffff);
|
|
542
|
+
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
|
|
547
|
+
/* Right */
|
|
548
|
+
::-webkit-scrollbar-button:single-button:horizontal:increment {
|
|
549
|
+
border-width: 5px 0 5px 5px;
|
|
550
|
+
border-color:var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-primary,#009eb3);
|
|
551
|
+
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
::-webkit-scrollbar-button:single-button:horizontal:increment:hover {
|
|
555
|
+
border-width: 5px 0 5px 5px;
|
|
556
|
+
border-color:var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-background-inverse-hover,#474747);
|
|
557
|
+
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
`;/**
|
|
561
|
+
* @license
|
|
562
|
+
* Copyright 2018 Google LLC
|
|
563
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
564
|
+
*/const At=n=>n??x;class Bs extends _r{constructor(){super(...arguments),this.prevData={}}render(r){return x}update(r,[s]){var i;this.element!==r.element&&(this.element=r.element),this.host=((i=r.options)==null?void 0:i.host)||this.element,this.apply(s),this.groom(s),this.prevData={...s}}apply(r){if(!r)return;const{prevData:s,element:i}=this;for(const a in r){const t=r[a];t!==s[a]&&(i[a]=t)}}groom(r){const{prevData:s,element:i}=this;if(s)for(const a in s)(!r||!(a in r)&&i[a]===s[a])&&(i[a]=void 0)}}const kt=_t(Bs);var Ct=(n=>(n.None="none",n.Uscui="us.cui",n.Usclassified="us.classified",n.Usunclassified="us.unclassified",n.Usconfidential="us.confidential",n.Ussecret="us.secret",n.Ustopsecret="us.topsecret",n.UstopsecretSi="us.topsecret.si",n.Uknotset="uk.notset",n.Ukofficial="uk.official",n.Uksecret="uk.secret",n.Uktopsecret="uk.topsecret",n.Caprotected_a="ca.protected_a",n.Caprotected_b="ca.protected_b",n.Caprotected_c="ca.protected_c",n.Caconfidential="ca.confidential",n.Casecret="ca.secret",n.Catopsecret="ca.topsecret",n.Auunofficial="au.unofficial",n.Auofficial="au.official",n.Auofficialsensitive="au.officialsensitive",n.Auconfidential="au.confidential",n.Ausecret="au.secret",n.Autopsecret="au.topsecret",n))(Ct||{});const Xe={none:{},"us.cui":{color:"white",backgroundColor:"#3D1E5A",content:"Controlled Unclassified Information"},"us.classified":{color:"white",backgroundColor:"#723D9A",content:"Classified"},"us.unclassified":{color:"white",backgroundColor:"#007A33",content:"Unclassified"},"us.confidential":{color:"white",backgroundColor:"#0033A0",content:"Confidential"},"us.secret":{color:"white",backgroundColor:"#C8102E",content:"Secret"},"us.topsecret":{color:"white",backgroundColor:"#FF671F",content:"Top Secret"},"us.topsecret.si":{color:"black",backgroundColor:"#F7EA48",content:"Top Secret//SI"},"uk.notset":{color:"white",backgroundColor:" #616161",content:"Not Set"},"uk.official":{color:"white",backgroundColor:"#2B71C7",content:"For Offical Use"},"uk.secret":{color:"white",backgroundColor:"#F39C2C",content:"Secret"},"uk.topsecret":{color:"white",backgroundColor:"#AA0000",content:"Top Secret"},"ca.protected_a":{color:"white",backgroundColor:"#227ABC",content:"PROTECTED A"},"ca.protected_b":{color:"white",backgroundColor:"#900FB5",content:"PROTECTED B"},"ca.protected_c":{color:"white",backgroundColor:"#460FB5",content:"PROTECTED C"},"ca.confidential":{color:"white",backgroundColor:"#0033a0",content:"Confidential"},"ca.secret":{color:"white",backgroundColor:"#c8102e",content:"Secret"},"ca.topsecret":{color:"white",backgroundColor:"#ff671f",content:"Top Secret"},"au.unofficial":{color:"#666",backgroundColor:"#ffffffff",content:"Unofficial"},"au.official":{color:"#666",backgroundColor:"#ffffffff",content:"Official"},"au.officialsensitive":{color:"#666",backgroundColor:"#ffffffff",content:"Official Sentitive"},"au.confidential":{color:"white",backgroundColor:"#4F81BD",content:"Confidential"},"au.secret":{color:"black",backgroundColor:" #E5B8B7",content:"Secret"},"au.topsecret":{color:"black",backgroundColor:"#AA0000",content:"Top Secret"}};var js=Object.defineProperty,Rs=Object.getOwnPropertyDescriptor,I=(n,r,s,i)=>{for(var a=i>1?void 0:i?Rs(r,s):r,t=n.length-1,p;t>=0;t--)(p=n[t])&&(a=(i?p(r,s,a):p(a))||a);return i&&a&&js(r,s,a),a};d.SpectricPage=class extends N{constructor(){super(...arguments),this.showHeader=!0,this.headerSticky=!0,this.classificationLevel=Ct.None,this.classificationText="",this.notifications=[],this.showCreateAccount=!1,this.showLoginButton=!0,this.username=""}render(){this.classificationLevel&&!Xe[this.classificationLevel]&&(console.warn("Unknown classification",this.classificationLevel),this.classificationLevel=Ct.None);const r=this.classificationLevel?this.classificationText||Xe[this.classificationLevel].content:"",s=this.showHeader?k`<spectric-header ?showCreateAccount=${this.showCreateAccount} .showLoginButton=${this.showLoginButton} username=${At(this.username)}>
|
|
565
|
+
<slot name="branding" slot="branding"></slot>
|
|
566
|
+
<slot name="name" slot="name"></slot>
|
|
567
|
+
<slot name="center" slot="center"></slot>
|
|
568
|
+
<slot name="end" slot="end"></slot>
|
|
569
|
+
</spectric-header>`:null;return k`
|
|
570
|
+
${this.classificationLevel&&r?k`
|
|
571
|
+
<!-- Classification Banner -->
|
|
572
|
+
<spectric-banner ${kt({text:r,headerStyle:Xe[this.classificationLevel]})}></spectric-banner>
|
|
573
|
+
`:null}
|
|
574
|
+
<spectric-theme theme=${At(this.theme)}>
|
|
575
|
+
${this.notifications?this.notifications.map(i=>k`<spectric-banner ${kt(i)} ></spectric-banner>`):null}
|
|
576
|
+
${this.headerSticky?s:null}
|
|
577
|
+
<article>
|
|
578
|
+
${this.headerSticky?null:s}
|
|
579
|
+
<section class="spectric-page">
|
|
580
|
+
<slot name="content"></slot>
|
|
581
|
+
<slot></slot>
|
|
582
|
+
</section>
|
|
583
|
+
</article>
|
|
584
|
+
</spectric-theme>
|
|
585
|
+
${this.classificationLevel&&r?k`<spectric-banner ${kt({text:r,headerStyle:Xe[this.classificationLevel]})}></spectric-banner>`:null}
|
|
586
|
+
|
|
587
|
+
`}},d.SpectricPage.styles=Ds,I([y({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"showHeader",2),I([y({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"headerSticky",2),I([y({type:String,reflect:!0})],d.SpectricPage.prototype,"classificationLevel",2),I([y({type:String,reflect:!0})],d.SpectricPage.prototype,"classificationText",2),I([y({type:Array,reflect:!0})],d.SpectricPage.prototype,"notifications",2),I([y({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"showCreateAccount",2),I([y({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"showLoginButton",2),I([y({type:String,reflect:!0})],d.SpectricPage.prototype,"username",2),I([y({type:String,reflect:!0})],d.SpectricPage.prototype,"theme",2),d.SpectricPage=I([R("spectric-page")],d.SpectricPage);var Us=Object.defineProperty,Ms=Object.getOwnPropertyDescriptor,O=(n,r,s,i)=>{for(var a=i>1?void 0:i?Ms(r,s):r,t=n.length-1,p;t>=0;t--)(p=n[t])&&(a=(i?p(r,s,a):p(a))||a);return i&&a&&Us(r,s,a),a},Cr=(n=>(n.Text="text",n.TextArea="text-area",n.number="number",n.color="color",n.date="date",n.datetime="datetime-local",n.email="email",n.file="file",n.hidden="hidden",n.password="password",n))(Cr||{});d.SpectricInput=class extends N{constructor(){super(...arguments),this.placeholder="",this.readonly=!1,this.variant="text",this.disabled=!1,this.label="",this.hidePasswordLabel="Hide",this.showPasswordLabel="Show",this.showPasswordVisibilityToggle=!0,this.helperText="",this.invalid=!1,this.required=!1,this.invalidText="",this.name="",this.pattern="",this.maxCount=0,this._value="",this._showPassword=!1,this.autocomplete="",this._handleInput=({target:r})=>{const s=r;this.value=s.value,this.invalid=!s.validity.valid},this.handleTogglePasswordVisibility=()=>{this._showPassword=!this._showPassword,this.requestUpdate()}}createRenderRoot(){return this}get selectionStart(){return this._input.selectionStart}get value(){return this._input?this.variant=="number"?parseFloat(this._input.value):this._input.value:this._value}set value(r){const s=this._value;this._value=r,this.requestUpdate("value",s),this._input&&(this._input.value=String(r))}setSelectionRange(r,s,i="none"){this._input.setSelectionRange(r,s,i)}render(){switch(this.variant){case"text":case"password":case"number":case"email":case"date":case"datetime-local":case"file":case"color":return k`
|
|
588
|
+
<div class="inputWrapper">
|
|
589
|
+
<div class="text-input__label-helper-wrapper">
|
|
590
|
+
<div class="--text-input__label-wrapper">
|
|
591
|
+
${this.label} ${this.maxCount>0&&this._value?`${this._value.length}/${this.maxCount}`:null}
|
|
592
|
+
</div>
|
|
593
|
+
</div>
|
|
594
|
+
<div class="fieldwrapper">
|
|
595
|
+
<div ?data-invalid="${this.invalid}" class="inputContainer">
|
|
596
|
+
<input
|
|
597
|
+
?data-invalid="${this.invalid}"
|
|
598
|
+
?disabled="${this.disabled}"
|
|
599
|
+
aria-describedby="helper-text"
|
|
600
|
+
id="input"
|
|
601
|
+
name="${be(this.name)}"
|
|
602
|
+
pattern="${be(this.pattern)}"
|
|
603
|
+
placeholder="${be(this.placeholder)}"
|
|
604
|
+
autocomplete="${be(this.autocomplete)}"
|
|
605
|
+
?readonly="${this.readonly}"
|
|
606
|
+
?required="${this.required}"
|
|
607
|
+
type="${be(this.variant!=="password"?this.variant:this._showPassword?"text":"password")}"
|
|
608
|
+
.value="${this._value}"
|
|
609
|
+
maxlength="${be(this.maxCount>0?this.maxCount:void 0)}"
|
|
610
|
+
@input="${this._handleInput}"
|
|
611
|
+
@change=${()=>{this.dispatchEvent(new Event("change",{bubbles:!0}))}}
|
|
612
|
+
/>
|
|
613
|
+
|
|
614
|
+
${this.variant==="password"&&this.showPasswordVisibilityToggle?k`
|
|
615
|
+
<spectric-button
|
|
616
|
+
size="small"
|
|
617
|
+
type="button"
|
|
618
|
+
?disabled="${this.disabled}"
|
|
619
|
+
@click=${this.handleTogglePasswordVisibility}>
|
|
620
|
+
${this._showPassword?this.hidePasswordLabel:this.showPasswordLabel}
|
|
621
|
+
</spectric-button>
|
|
622
|
+
`:null}
|
|
623
|
+
</div>
|
|
624
|
+
<div
|
|
625
|
+
id="helper-text"
|
|
626
|
+
>
|
|
627
|
+
<slot name="helper-text"> ${this.invalid?this.invalidText:this.helperText} </slot>
|
|
628
|
+
</div>
|
|
629
|
+
|
|
630
|
+
</div>
|
|
631
|
+
</div>
|
|
632
|
+
`;case"hidden":return k`<input type="hidden"></input>`}return`Not yet implemented ${this.variant}`}},O([y({type:String,reflect:!0})],d.SpectricInput.prototype,"placeholder",2),O([y({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"readonly",2),O([y({type:String,reflect:!0})],d.SpectricInput.prototype,"variant",2),O([y({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"disabled",2),O([y({type:String,reflect:!0})],d.SpectricInput.prototype,"label",2),O([y()],d.SpectricInput.prototype,"hidePasswordLabel",2),O([y()],d.SpectricInput.prototype,"showPasswordLabel",2),O([y({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"showPasswordVisibilityToggle",2),O([y({type:String,reflect:!0})],d.SpectricInput.prototype,"helperText",2),O([y({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"invalid",2),O([y({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"required",2),O([y({type:String,reflect:!0})],d.SpectricInput.prototype,"invalidText",2),O([y()],d.SpectricInput.prototype,"name",2),O([y()],d.SpectricInput.prototype,"pattern",2),O([y({type:Number,reflect:!0})],d.SpectricInput.prototype,"maxCount",2),O([y({reflect:!0})],d.SpectricInput.prototype,"autocomplete",2),O([y({reflect:!0})],d.SpectricInput.prototype,"value",1),O([Le("input")],d.SpectricInput.prototype,"_input",2),d.SpectricInput=O([R("spectric-input")],d.SpectricInput);const be=n=>At(n===""?void 0:n??void 0),zs="end of input",Is={fieldName:"field name",value:"value",literal:"literal",whitespace:"whitespace"};class xr extends Error{constructor(r,s){let i=r.message;if(r.expected){const p=r.expected.map(v=>Is[v.description]||v.description).join(", ");let g=r.found?`"${r.found}"`:zs;i=`Expected ${p} but ${g} found.`}const a=[i,s,"-".repeat(r.location.start.offset)+"^"].join(`
|
|
633
|
+
`);super(a),this.name="DQLSyntaxError",this.shortMessage=i}}function ve(n){return{type:"literal",value:n}}function xt(n){return n.value}const Qs=Object.freeze(Object.defineProperty({__proto__:null,buildNode:ve,toOpenSearchQuery:xt},Symbol.toStringTag,{value:"Module"})),{SyntaxError:Fc,parse:Ge}=function(){function n(i,a){function t(){this.constructor=i}t.prototype=a.prototype,i.prototype=new t}function r(i,a,t,p){this.message=i,this.expected=a,this.found=t,this.location=p,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,r)}n(r,Error);function s(i){var a=arguments.length>1?arguments[1]:{},t={},p={start:Oi,Literal:Kt},g=Oi,v=function(e,o){return o.type==="cursor"?{...o,suggestionTypes:["conjunction"]}:e!==null?e:de.function.buildNode("is","*","*")},_=function(){return jc},A=function(e,o){const l=[e,o].find(u=>u.type==="cursor");return l||q("or",[e,o])},S=function(e,o){const l=[e,o].find(u=>u.type==="cursor");return l||q("and",[e,o])},E=function(e){return e.type==="cursor"?e:q("not",[e])},C="(",L={type:"literal",value:"(",description:'"("'},et=")",te={type:"literal",value:")",description:'")"'},Q=function(e,o){return o.type==="cursor"?{...o,suggestionTypes:["conjunction"]}:e},F=":",j={type:"literal",value:":",description:'":"'},me="{",Bt={type:"literal",value:"{",description:'"{"'},jt="}",Rt={type:"literal",value:"}",description:'"}"'},ln=function(e,o,l){return o.type==="cursor"?{...o,nestedPath:o.nestedPath?`${e.value}.${o.nestedPath}`:e.value}:l.type==="cursor"?{...l,suggestionTypes:["conjunction"]}:q("nested",[e,o])},un={type:"other",description:"fieldName"},pn=function(e,o,l){if(l.type==="cursor")return{...l,suggestionTypes:["conjunction"]};const u=Ic(o,l);return q("range",[e,u])},dn=function(e,o){return o.type==="cursor"?{...o,fieldName:e.value,suggestionTypes:["value","conjunction"]}:o(e)},fn=function(e){if(e.type==="cursor"){const l=`${e.prefix}${e.suffix}`.trim();return{...e,fieldName:l,suggestionTypes:["field","operator","conjunction"]}}const o=re(null);return e(o)},hn=function(e,o){return o.type==="cursor"?{...o,suggestionTypes:["conjunction"]}:e},gn=function(e,o){const l=[e,o].find(u=>u.type==="cursor");return l?{...l,suggestionTypes:["value"]}:u=>q("or",[e(u),o(u)])},bn=function(e,o){const l=[e,o].find(u=>u.type==="cursor");return l?{...l,suggestionTypes:["value"]}:u=>q("and",[e(u),o(u)])},vn=function(e){return e.type==="cursor"?{...list,suggestionTypes:["value"]}:o=>q("not",[e(o)])},yn={type:"other",description:"value"},mn=function(e){if(e.type==="cursor")return e;const o=re(!0);return l=>q("is",[l,e,o])},$n=function(e){if(e.type==="cursor")return e;!Mc&&e.type==="wildcard"&&de.wildcard.hasLeadingWildcard(e)&&U("Leading wildcards are disabled. See query:allowLeadingWildcards in Advanced Settings.");const o=re(!1);return l=>q("is",[l,e,o])},wn={type:"other",description:"OR"},Ir="or",Qr={type:"literal",value:"or",description:'"or"'},_n={type:"other",description:"AND"},Fr="and",Hr={type:"literal",value:"and",description:'"and"'},Sn={type:"other",description:"NOT"},qr="not",Wr={type:"literal",value:"not",description:'"not"'},An={type:"other",description:"literal"},De='"',Be={type:"literal",value:'"',description:'"\\""'},Ut=function(e,o,l){const{start:u,end:h}=hc();return{type:"cursor",start:u.offset,end:h.offset-o.length,prefix:e.join(""),suffix:l.join(""),text:fc().replace(o,"")}},kn=function(e){return re(e.join(""))},je="\\",Re={type:"literal",value:"\\",description:'"\\\\"'},Cn=/^[\\"]/,xn={type:"class",value:'[\\\\"]',description:'[\\\\"]'},tt=function(e){return e},En=/^[^"]/,On={type:"class",value:'[^"]',description:'[^"]'},Pn=function(e){const o=e.join("").trim();return o==="null"?re(null):o==="true"?re(!0):o==="false"?re(!1):e.includes(qi)?zc(o):re(/^(-?[1-9]+\d*([.]\d+)?)$|^(-?0[.]\d*[1-9]+)$|^0$|^0.0$|^[.]\d{1,}$/.test(o)?isFinite(o)&&(o>Number.MAX_SAFE_INTEGER||o<Number.MIN_SAFE_INTEGER)?BigInt(o):Number(o):o)},Vr={type:"any",description:"any character"},rt="*",it={type:"literal",value:"*",description:'"*"'},Tn=function(){return qi},Yr="\\t",Ln={type:"literal",value:"\\t",description:'"\\\\t"'},Nn=function(){return" "},Kr="\\r",Dn={type:"literal",value:"\\r",description:'"\\\\r"'},Bn=function(){return"\r"},Zr="\\n",jn={type:"literal",value:"\\n",description:'"\\\\n"'},Rn=function(){return`
|
|
634
|
+
`},Un=function(e){return e},Mn=/^[\\():<>"*{}]/,zn={type:"class",value:'[\\\\():<>"*{}]',description:'[\\\\():<>"*{}]'},Xr="<=",In={type:"literal",value:"<=",description:'"<="'},Qn=function(){return"lte"},Gr=">=",Fn={type:"literal",value:">=",description:'">="'},Hn=function(){return"gte"},Jr="<",ei={type:"literal",value:"<",description:'"<"'},qn=function(){return"lt"},ti=">",ri={type:"literal",value:">",description:'">"'},Wn=function(){return"gt"},Vn={type:"other",description:"whitespace"},Yn=/^[ \t\r\n]/,Kn={type:"class",value:"[\\ \\t\\r\\n]",description:"[\\ \\t\\r\\n]"},Zn=function(){return Rc},ii="@kuery-cursor@",Xn={type:"literal",value:"@kuery-cursor@",description:'"@kuery-cursor@"'},Gn=function(){return Uc},si="||",Jn={type:"literal",value:"||",description:'"||"'},ec=function(){U("LuceneOr")},oi="&&",tc={type:"literal",value:"&&",description:'"&&"'},ni=function(){U("LuceneAnd")},ci="+",ai={type:"literal",value:"+",description:'"+"'},li="-",ui={type:"literal",value:"-",description:'"-"'},pi=function(){U("LuceneNot")},di="!",fi={type:"literal",value:"!",description:'"!"'},hi="_exists_",rc={type:"literal",value:"_exists_",description:'"_exists_"'},ic=function(){U("LuceneExists")},gi=function(){U("LuceneRange")},bi="?",vi={type:"literal",value:"?",description:'"?"'},sc=function(){U("LuceneWildcard")},Mt="/",zt={type:"literal",value:"/",description:'"/"'},yi=/^[^\/]/,mi={type:"class",value:"[^/]",description:"[^/]"},oc=function(){U("LuceneRegex")},It="~",Qt={type:"literal",value:"~",description:'"~"'},$e=/^[0-9]/,we={type:"class",value:"[0-9]",description:"[0-9]"},nc=function(){U("LuceneFuzzy")},cc=function(){U("LuceneProximity")},$i="^",wi={type:"literal",value:"^",description:'"^"'},ac=function(){U("LuceneBoost")},lc=function(){return char},uc="=",pc={type:"literal",value:"=",description:'"="'},_i="[",Si={type:"literal",value:"[",description:'"["'},Ai="]",ki={type:"literal",value:"]",description:'"]"'},Ci="TO",dc={type:"literal",value:"TO",description:'"TO"'},c=0,w=0,st=[{line:1,column:1,seenCR:!1}],H=0,Ft=[],f=0,ot;if("startRule"in a){if(!(a.startRule in p))throw new Error(`Can't start parsing from rule "`+a.startRule+'".');g=p[a.startRule]}function fc(){return i.substring(w,c)}function hc(){return nt(w,c)}function U(e){throw Ei(e,null,i.substring(w,c),nt(w,c))}function xi(e){var o=st[e],l,u;if(o)return o;for(l=e-1;!st[l];)l--;for(o=st[l],o={line:o.line,column:o.column,seenCR:o.seenCR};l<e;)u=i.charAt(l),u===`
|
|
635
|
+
`?(o.seenCR||o.line++,o.column=1,o.seenCR=!1):u==="\r"||u==="\u2028"||u==="\u2029"?(o.line++,o.column=1,o.seenCR=!0):(o.column++,o.seenCR=!1),l++;return st[e]=o,o}function nt(e,o){var l=xi(e),u=xi(o);return{start:{offset:e,line:l.line,column:l.column},end:{offset:o,line:u.line,column:u.column}}}function b(e){c<H||(c>H&&(H=c,Ft=[]),Ft.push(e))}function Ei(e,o,l,u){function h(P){var T=1;for(P.sort(function(ie,M){return ie.description<M.description?-1:ie.description>M.description?1:0});T<P.length;)P[T-1]===P[T]?P.splice(T,1):T++}function $(P,T){function ie(Qc){function ft(K){return K.charCodeAt(0).toString(16).toUpperCase()}return Qc.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(K){return"\\x0"+ft(K)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(K){return"\\x"+ft(K)}).replace(/[\u0100-\u0FFF]/g,function(K){return"\\u0"+ft(K)}).replace(/[\u1000-\uFFFF]/g,function(K){return"\\u"+ft(K)})}var M=new Array(P.length),Wi,Vi,Me;for(Me=0;Me<P.length;Me++)M[Me]=P[Me].description;return Wi=P.length>1?M.slice(0,-1).join(", ")+" or "+M[P.length-1]:M[0],Vi=T?'"'+ie(T)+'"':"end of input","Expected "+Wi+" but "+Vi+" found."}return o!==null&&h(o),new r(e!==null?e:$(o,l),o,l,u)}function Oi(){var e,o,l,u;for(e=c,o=[],l=m();l!==t;)o.push(l),l=m();return o!==t?(l=ct(),l===t&&(l=null),l!==t?(u=pt(),u!==t?(w=e,o=v(l,u),e=o):(c=e,e=t)):(c=e,e=t)):(c=e,e=t),e}function ct(){var e,o,l,u;return e=c,w=c,o=_(),o?o=void 0:o=t,o!==t?(l=Ac(),l!==t?(o=[o,l],e=o):(c=e,e=t)):(c=e,e=t),e===t&&(e=c,o=Ht(),o!==t?(l=at(),l!==t?(u=ct(),u!==t?(w=e,o=A(o,u),e=o):(c=e,e=t)):(c=e,e=t)):(c=e,e=t),e===t&&(e=Ht())),e}function Ht(){var e,o,l,u;return e=c,o=Pi(),o!==t?(l=lt(),l!==t?(u=Ht(),u!==t?(w=e,o=S(o,u),e=o):(c=e,e=t)):(c=e,e=t)):(c=e,e=t),e===t&&(e=Pi()),e}function Pi(){var e,o,l;return e=c,o=Yt(),o!==t?(l=Ti(),l!==t?(w=e,o=E(l),e=o):(c=e,e=t)):(c=e,e=t),e===t&&(e=Ti()),e}function Ti(){var e,o,l,u,h,$;if(e=c,i.charCodeAt(c)===40?(o=C,c++):(o=t,f===0&&b(L)),o!==t){for(l=[],u=m();u!==t;)l.push(u),u=m();l!==t?(u=ct(),u!==t?(h=pt(),h!==t?(i.charCodeAt(c)===41?($=et,c++):($=t,f===0&&b(te)),$!==t?(w=e,o=Q(u,h),e=o):(c=e,e=t)):(c=e,e=t)):(c=e,e=t)):(c=e,e=t)}else c=e,e=t;return e===t&&(e=gc()),e}function gc(){var e,o,l,u,h,$,P,T,ie,M;if(e=c,o=qt(),o!==t){for(l=[],u=m();u!==t;)l.push(u),u=m();if(l!==t)if(i.charCodeAt(c)===58?(u=F,c++):(u=t,f===0&&b(j)),u!==t){for(h=[],$=m();$!==t;)h.push($),$=m();if(h!==t)if(i.charCodeAt(c)===123?($=me,c++):($=t,f===0&&b(Bt)),$!==t){for(P=[],T=m();T!==t;)P.push(T),T=m();P!==t?(T=ct(),T!==t?(ie=pt(),ie!==t?(i.charCodeAt(c)===125?(M=jt,c++):(M=t,f===0&&b(Rt)),M!==t?(w=e,o=ln(o,T,ie),e=o):(c=e,e=t)):(c=e,e=t)):(c=e,e=t)):(c=e,e=t)}else c=e,e=t;else c=e,e=t}else c=e,e=t;else c=e,e=t}else c=e,e=t;return e===t&&(e=bc()),e}function bc(){var e;return e=vc(),e===t&&(e=yc(),e===t&&(e=mc())),e}function qt(){var e;return f++,e=Kt(),f--,e===t&&f===0&&b(un),e}function vc(){var e,o,l,u,h,$;if(e=c,o=qt(),o!==t){for(l=[],u=m();u!==t;)l.push(u),u=m();if(l!==t)if(u=Ri(),u!==t){for(h=[],$=m();$!==t;)h.push($),$=m();h!==t?($=Kt(),$!==t?(w=e,o=pn(o,u,$),e=o):(c=e,e=t)):(c=e,e=t)}else c=e,e=t;else c=e,e=t}else c=e,e=t;return e}function yc(){var e,o,l,u,h,$;if(e=c,o=qt(),o!==t){for(l=[],u=m();u!==t;)l.push(u),u=m();if(l!==t)if(i.charCodeAt(c)===58?(u=F,c++):(u=t,f===0&&b(j)),u!==t){for(h=[],$=m();$!==t;)h.push($),$=m();h!==t?($=Wt(),$!==t?(w=e,o=dn(o,$),e=o):(c=e,e=t)):(c=e,e=t)}else c=e,e=t;else c=e,e=t}else c=e,e=t;return e}function mc(){var e,o;return e=c,o=Di(),o!==t&&(w=e,o=fn(o)),e=o,e}function Wt(){var e,o,l,u,h,$;if(e=c,i.charCodeAt(c)===40?(o=C,c++):(o=t,f===0&&b(L)),o!==t){for(l=[],u=m();u!==t;)l.push(u),u=m();l!==t?(u=Li(),u!==t?(h=pt(),h!==t?(i.charCodeAt(c)===41?($=et,c++):($=t,f===0&&b(te)),$!==t?(w=e,o=hn(u,h),e=o):(c=e,e=t)):(c=e,e=t)):(c=e,e=t)):(c=e,e=t)}else c=e,e=t;return e===t&&(e=Di()),e}function Li(){var e,o,l,u;return e=c,o=Vt(),o!==t?(l=at(),l!==t?(u=Li(),u!==t?(w=e,o=gn(o,u),e=o):(c=e,e=t)):(c=e,e=t)):(c=e,e=t),e===t&&(e=Vt()),e}function Vt(){var e,o,l,u;return e=c,o=Ni(),o!==t?(l=lt(),l!==t?(u=Vt(),u!==t?(w=e,o=bn(o,u),e=o):(c=e,e=t)):(c=e,e=t)):(c=e,e=t),e===t&&(e=Ni()),e}function Ni(){var e,o,l;return e=c,o=Yt(),o!==t?(l=Wt(),l!==t?(w=e,o=vn(l),e=o):(c=e,e=t)):(c=e,e=t),e===t&&(e=Wt()),e}function Di(){var e,o;return f++,e=c,o=ut(),o!==t&&(w=e,o=mn(o)),e=o,e===t&&(e=c,o=Bi(),o!==t&&(w=e,o=$n(o)),e=o),f--,e===t&&(o=t,f===0&&b(yn)),e}function at(){var e,o,l,u,h;if(f++,e=c,o=[],l=m(),l!==t)for(;l!==t;)o.push(l),l=m();else o=t;if(o!==t)if(i.substr(c,2).toLowerCase()===Ir?(l=i.substr(c,2),c+=2):(l=t,f===0&&b(Qr)),l!==t){if(u=[],h=m(),h!==t)for(;h!==t;)u.push(h),h=m();else u=t;u!==t?(o=[o,l,u],e=o):(c=e,e=t)}else c=e,e=t;else c=e,e=t;return e===t&&(e=c,w=c,o=_(),o?o=void 0:o=t,o!==t?(l=Ui(),l!==t?(o=[o,l],e=o):(c=e,e=t)):(c=e,e=t)),f--,e===t&&(o=t,f===0&&b(wn)),e}function lt(){var e,o,l,u,h;if(f++,e=c,o=[],l=m(),l!==t)for(;l!==t;)o.push(l),l=m();else o=t;if(o!==t)if(i.substr(c,3).toLowerCase()===Fr?(l=i.substr(c,3),c+=3):(l=t,f===0&&b(Hr)),l!==t){if(u=[],h=m(),h!==t)for(;h!==t;)u.push(h),h=m();else u=t;u!==t?(o=[o,l,u],e=o):(c=e,e=t)}else c=e,e=t;else c=e,e=t;return e===t&&(e=c,w=c,o=_(),o?o=void 0:o=t,o!==t?(l=Mi(),l!==t?(o=[o,l],e=o):(c=e,e=t)):(c=e,e=t)),f--,e===t&&(o=t,f===0&&b(_n)),e}function Yt(){var e,o,l,u;if(f++,e=c,i.substr(c,3).toLowerCase()===qr?(o=i.substr(c,3),c+=3):(o=t,f===0&&b(Wr)),o!==t){if(l=[],u=m(),u!==t)for(;u!==t;)l.push(u),u=m();else l=t;l!==t?(o=[o,l],e=o):(c=e,e=t)}else c=e,e=t;return e===t&&(e=c,w=c,o=_(),o?o=void 0:o=t,o!==t?(l=zi(),l!==t?(o=[o,l],e=o):(c=e,e=t)):(c=e,e=t)),f--,e===t&&(o=t,f===0&&b(Sn)),e}function Kt(){var e;return f++,e=ut(),e===t&&(e=Bi()),f--,e===t&&f===0&&b(An),e}function ut(){var e,o,l,u,h,$;if(e=c,i.charCodeAt(c)===34?(o=De,c++):(o=t,f===0&&b(Be)),o!==t){for(l=[],u=_e();u!==t;)l.push(u),u=_e();if(l!==t)if(u=Ue(),u!==t){for(h=[],$=_e();$!==t;)h.push($),$=_e();h!==t?(i.charCodeAt(c)===34?($=De,c++):($=t,f===0&&b(Be)),$!==t?(w=e,o=Ut(l,u,h),e=o):(c=e,e=t)):(c=e,e=t)}else c=e,e=t;else c=e,e=t}else c=e,e=t;if(e===t)if(e=c,i.charCodeAt(c)===34?(o=De,c++):(o=t,f===0&&b(Be)),o!==t){for(l=[],u=_e();u!==t;)l.push(u),u=_e();l!==t?(i.charCodeAt(c)===34?(u=De,c++):(u=t,f===0&&b(Be)),u!==t?(w=e,o=kn(l),e=o):(c=e,e=t)):(c=e,e=t)}else c=e,e=t;return e}function _e(){var e,o,l;return e=Zt(),e===t&&(e=c,i.charCodeAt(c)===92?(o=je,c++):(o=t,f===0&&b(Re)),o!==t?(Cn.test(i.charAt(c))?(l=i.charAt(c),c++):(l=t,f===0&&b(xn)),l!==t?(w=e,o=tt(l),e=o):(c=e,e=t)):(c=e,e=t),e===t&&(e=c,o=c,f++,l=Ue(),f--,l===t?o=void 0:(c=o,o=t),o!==t?(En.test(i.charAt(c))?(l=i.charAt(c),c++):(l=t,f===0&&b(On)),l!==t?(w=e,o=tt(l),e=o):(c=e,e=t)):(c=e,e=t))),e}function Bi(){var e,o,l,u,h;for(e=c,o=[],l=Se();l!==t;)o.push(l),l=Se();if(o!==t)if(l=Ue(),l!==t){for(u=[],h=Se();h!==t;)u.push(h),h=Se();u!==t?(w=e,o=Ut(o,l,u),e=o):(c=e,e=t)}else c=e,e=t;else c=e,e=t;if(e===t){if(e=c,o=[],l=Se(),l!==t)for(;l!==t;)o.push(l),l=Se();else o=t;o!==t&&(w=e,o=Pn(o)),e=o}return e}function Se(){var e,o,l,u,h;return e=Zt(),e===t&&(e=wc(),e===t&&(e=_c(),e===t&&(e=$c(),e===t&&(e=c,o=c,f++,l=ji(),f--,l===t?o=void 0:(c=o,o=t),o!==t?(l=c,f++,u=Sc(),f--,u===t?l=void 0:(c=l,l=t),l!==t?(u=c,f++,h=Ue(),f--,h===t?u=void 0:(c=u,u=t),u!==t?(i.length>c?(h=i.charAt(c),c++):(h=t,f===0&&b(Vr)),h!==t?(w=e,o=tt(h),e=o):(c=e,e=t)):(c=e,e=t)):(c=e,e=t)):(c=e,e=t))))),e}function $c(){var e,o;return e=c,i.charCodeAt(c)===42?(o=rt,c++):(o=t,f===0&&b(it)),o!==t&&(w=e,o=Tn()),e=o,e}function pt(){var e,o,l,u,h;for(e=c,o=[],l=m();l!==t;)o.push(l),l=m();if(o!==t)if(l=Ue(),l!==t){for(u=[],h=m();h!==t;)u.push(h),h=m();u!==t?(w=e,o=Ut(o,l,u),e=o):(c=e,e=t)}else c=e,e=t;else c=e,e=t;if(e===t)for(e=[],o=m();o!==t;)e.push(o),o=m();return e}function Zt(){var e,o;return e=c,i.substr(c,2)===Yr?(o=Yr,c+=2):(o=t,f===0&&b(Ln)),o!==t&&(w=e,o=Nn()),e=o,e===t&&(e=c,i.substr(c,2)===Kr?(o=Kr,c+=2):(o=t,f===0&&b(Dn)),o!==t&&(w=e,o=Bn()),e=o,e===t&&(e=c,i.substr(c,2)===Zr?(o=Zr,c+=2):(o=t,f===0&&b(jn)),o!==t&&(w=e,o=Rn()),e=o)),e}function wc(){var e,o,l;return e=c,i.charCodeAt(c)===92?(o=je,c++):(o=t,f===0&&b(Re)),o!==t?(l=ji(),l!==t?(w=e,o=tt(l),e=o):(c=e,e=t)):(c=e,e=t),e}function _c(){var e,o,l;return e=c,i.charCodeAt(c)===92?(o=je,c++):(o=t,f===0&&b(Re)),o!==t?(i.substr(c,2).toLowerCase()===Ir?(l=i.substr(c,2),c+=2):(l=t,f===0&&b(Qr)),l===t&&(i.substr(c,3).toLowerCase()===Fr?(l=i.substr(c,3),c+=3):(l=t,f===0&&b(Hr)),l===t&&(i.substr(c,3).toLowerCase()===qr?(l=i.substr(c,3),c+=3):(l=t,f===0&&b(Wr)))),l!==t?(w=e,o=Un(l),e=o):(c=e,e=t)):(c=e,e=t),e}function Sc(){var e;return e=at(),e===t&&(e=lt(),e===t&&(e=Yt())),e}function ji(){var e;return Mn.test(i.charAt(c))?(e=i.charAt(c),c++):(e=t,f===0&&b(zn)),e}function Ri(){var e,o;return e=c,i.substr(c,2)===Xr?(o=Xr,c+=2):(o=t,f===0&&b(In)),o!==t&&(w=e,o=Qn()),e=o,e===t&&(e=c,i.substr(c,2)===Gr?(o=Gr,c+=2):(o=t,f===0&&b(Fn)),o!==t&&(w=e,o=Hn()),e=o,e===t&&(e=c,i.charCodeAt(c)===60?(o=Jr,c++):(o=t,f===0&&b(ei)),o!==t&&(w=e,o=qn()),e=o,e===t&&(e=c,i.charCodeAt(c)===62?(o=ti,c++):(o=t,f===0&&b(ri)),o!==t&&(w=e,o=Wn()),e=o))),e}function m(){var e;return f++,Yn.test(i.charAt(c))?(e=i.charAt(c),c++):(e=t,f===0&&b(Kn)),f--,e===t&&f===0&&b(Vn),e}function Ue(){var e,o,l;return e=c,w=c,o=Zn(),o?o=void 0:o=t,o!==t?(i.substr(c,14)===ii?(l=ii,c+=14):(l=t,f===0&&b(Xn)),l!==t?(w=e,o=Gn(),e=o):(c=e,e=t)):(c=e,e=t),e}function Ui(){var e,o,l,u,h;for(e=c,o=[],l=m();l!==t;)o.push(l),l=m();if(o!==t)if(i.substr(c,2)===si?(l=si,c+=2):(l=t,f===0&&b(Jn)),l!==t){for(u=[],h=m();h!==t;)u.push(h),h=m();u!==t?(w=e,o=ec(),e=o):(c=e,e=t)}else c=e,e=t;else c=e,e=t;return e}function Mi(){var e,o,l,u,h;for(e=c,o=[],l=m();l!==t;)o.push(l),l=m();if(o!==t)if(i.substr(c,2)===oi?(l=oi,c+=2):(l=t,f===0&&b(tc)),l!==t){for(u=[],h=m();h!==t;)u.push(h),h=m();u!==t?(w=e,o=ni(),e=o):(c=e,e=t)}else c=e,e=t;else c=e,e=t;return e===t&&(e=c,i.charCodeAt(c)===43?(o=ci,c++):(o=t,f===0&&b(ai)),o!==t&&(w=e,o=ni()),e=o),e}function zi(){var e,o;return e=c,i.charCodeAt(c)===45?(o=li,c++):(o=t,f===0&&b(ui)),o!==t&&(w=e,o=pi()),e=o,e===t&&(e=c,i.charCodeAt(c)===33?(o=di,c++):(o=t,f===0&&b(fi)),o!==t&&(w=e,o=pi()),e=o),e}function Ac(){var e;return e=kc(),e===t&&(e=Ii(),e===t&&(e=Cc())),e}function kc(){var e,o,l,u,h,$;if(e=c,o=Ae(),o!==t){for(l=[],u=m();u!==t;)l.push(u),u=m();if(l!==t)if(i.charCodeAt(c)===58?(u=F,c++):(u=t,f===0&&b(j)),u!==t){for(h=[],$=m();$!==t;)h.push($),$=m();h!==t?($=Ii(),$!==t?(o=[o,l,u,h,$],e=o):(c=e,e=t)):(c=e,e=t)}else c=e,e=t;else c=e,e=t}else c=e,e=t;return e}function Ii(){var e;return e=xc(),e===t&&(e=Xt(),e===t&&(e=Ec(),e===t&&(e=Oc(),e===t&&(e=Pc(),e===t&&(e=Tc()))))),e}function Cc(){var e,o,l,u,h,$;if(e=c,i.substr(c,8)===hi?(o=hi,c+=8):(o=t,f===0&&b(rc)),o!==t){for(l=[],u=m();u!==t;)l.push(u),u=m();if(l!==t)if(i.charCodeAt(c)===58?(u=F,c++):(u=t,f===0&&b(j)),u!==t){for(h=[],$=m();$!==t;)h.push($),$=m();h!==t?($=Ae(),$!==t?(w=e,o=ic(),e=o):(c=e,e=t)):(c=e,e=t)}else c=e,e=t;else c=e,e=t}else c=e,e=t;return e}function xc(){var e,o,l,u,h,$,P;if(e=c,o=Ri(),o!==t){for(l=[],u=m();u!==t;)l.push(u),u=m();l!==t?(u=Ae(),u!==t?(w=e,o=gi(),e=o):(c=e,e=t)):(c=e,e=t)}else c=e,e=t;if(e===t)if(e=c,o=Dc(),o!==t){for(l=[],u=m();u!==t;)l.push(u),u=m();l!==t?(u=Ae(),u!==t?(h=Hi(),h!==t?($=Ae(),$!==t?(P=Bc(),P!==t?(w=e,o=gi(),e=o):(c=e,e=t)):(c=e,e=t)):(c=e,e=t)):(c=e,e=t)):(c=e,e=t)}else c=e,e=t;return e}function Xt(){var e,o,l,u,h;for(e=c,o=[],l=dt(),l===t&&(i.charCodeAt(c)===42?(l=rt,c++):(l=t,f===0&&b(it)));l!==t;)o.push(l),l=dt(),l===t&&(i.charCodeAt(c)===42?(l=rt,c++):(l=t,f===0&&b(it)));if(o!==t)if(i.charCodeAt(c)===63?(l=bi,c++):(l=t,f===0&&b(vi)),l!==t){for(u=[],h=Xt();h!==t;)u.push(h),h=Xt();u!==t?(w=e,o=sc(),e=o):(c=e,e=t)}else c=e,e=t;else c=e,e=t;return e}function Ec(){var e,o,l,u;if(e=c,i.charCodeAt(c)===47?(o=Mt,c++):(o=t,f===0&&b(zt)),o!==t){for(l=[],yi.test(i.charAt(c))?(u=i.charAt(c),c++):(u=t,f===0&&b(mi));u!==t;)l.push(u),yi.test(i.charAt(c))?(u=i.charAt(c),c++):(u=t,f===0&&b(mi));l!==t?(i.charCodeAt(c)===47?(u=Mt,c++):(u=t,f===0&&b(zt)),u!==t?(w=e,o=oc(),e=o):(c=e,e=t)):(c=e,e=t)}else c=e,e=t;return e}function Oc(){var e,o,l,u,h;if(e=c,o=Qi(),o!==t)if(i.charCodeAt(c)===126?(l=It,c++):(l=t,f===0&&b(Qt)),l!==t){for(u=[],$e.test(i.charAt(c))?(h=i.charAt(c),c++):(h=t,f===0&&b(we));h!==t;)u.push(h),$e.test(i.charAt(c))?(h=i.charAt(c),c++):(h=t,f===0&&b(we));u!==t?(w=e,o=nc(),e=o):(c=e,e=t)}else c=e,e=t;else c=e,e=t;return e}function Pc(){var e,o,l,u,h;if(e=c,o=ut(),o!==t)if(i.charCodeAt(c)===126?(l=It,c++):(l=t,f===0&&b(Qt)),l!==t){for(u=[],$e.test(i.charAt(c))?(h=i.charAt(c),c++):(h=t,f===0&&b(we));h!==t;)u.push(h),$e.test(i.charAt(c))?(h=i.charAt(c),c++):(h=t,f===0&&b(we));u!==t?(w=e,o=cc(),e=o):(c=e,e=t)}else c=e,e=t;else c=e,e=t;return e}function Tc(){var e,o,l,u,h;if(e=c,o=Ae(),o!==t)if(i.charCodeAt(c)===94?(l=$i,c++):(l=t,f===0&&b(wi)),l!==t){for(u=[],$e.test(i.charAt(c))?(h=i.charAt(c),c++):(h=t,f===0&&b(we));h!==t;)u.push(h),$e.test(i.charAt(c))?(h=i.charAt(c),c++):(h=t,f===0&&b(we));u!==t?(w=e,o=ac(),e=o):(c=e,e=t)}else c=e,e=t;else c=e,e=t;return e}function Ae(){var e;return e=ut(),e===t&&(e=Qi()),e}function Qi(){var e,o;if(e=[],o=dt(),o!==t)for(;o!==t;)e.push(o),o=dt();else e=t;return e}function dt(){var e,o,l,u;return e=Zt(),e===t&&(e=Nc(),e===t&&(e=c,o=c,f++,l=Fi(),f--,l===t?o=void 0:(c=o,o=t),o!==t?(l=c,f++,u=Lc(),f--,u===t?l=void 0:(c=l,l=t),l!==t?(i.length>c?(u=i.charAt(c),c++):(u=t,f===0&&b(Vr)),u!==t?(o=[o,l,u],e=o):(c=e,e=t)):(c=e,e=t)):(c=e,e=t))),e}function Lc(){var e;return e=at(),e===t&&(e=lt(),e===t&&(e=Ui(),e===t&&(e=Mi(),e===t&&(e=zi(),e===t&&(e=Hi()))))),e}function Nc(){var e,o,l;return e=c,i.charCodeAt(c)===92?(o=je,c++):(o=t,f===0&&b(Re)),o!==t?(l=Fi(),l!==t?(w=e,o=lc(),e=o):(c=e,e=t)):(c=e,e=t),e}function Fi(){var e;return i.charCodeAt(c)===43?(e=ci,c++):(e=t,f===0&&b(ai)),e===t&&(i.charCodeAt(c)===45?(e=li,c++):(e=t,f===0&&b(ui)),e===t&&(i.charCodeAt(c)===61?(e=uc,c++):(e=t,f===0&&b(pc)),e===t&&(i.charCodeAt(c)===62?(e=ti,c++):(e=t,f===0&&b(ri)),e===t&&(i.charCodeAt(c)===60?(e=Jr,c++):(e=t,f===0&&b(ei)),e===t&&(i.charCodeAt(c)===33?(e=di,c++):(e=t,f===0&&b(fi)),e===t&&(i.charCodeAt(c)===40?(e=C,c++):(e=t,f===0&&b(L)),e===t&&(i.charCodeAt(c)===41?(e=et,c++):(e=t,f===0&&b(te)),e===t&&(i.charCodeAt(c)===123?(e=me,c++):(e=t,f===0&&b(Bt)),e===t&&(i.charCodeAt(c)===125?(e=jt,c++):(e=t,f===0&&b(Rt)),e===t&&(i.charCodeAt(c)===91?(e=_i,c++):(e=t,f===0&&b(Si)),e===t&&(i.charCodeAt(c)===93?(e=Ai,c++):(e=t,f===0&&b(ki)),e===t&&(i.charCodeAt(c)===94?(e=$i,c++):(e=t,f===0&&b(wi)),e===t&&(i.charCodeAt(c)===34?(e=De,c++):(e=t,f===0&&b(Be)),e===t&&(i.charCodeAt(c)===126?(e=It,c++):(e=t,f===0&&b(Qt)),e===t&&(i.charCodeAt(c)===42?(e=rt,c++):(e=t,f===0&&b(it)),e===t&&(i.charCodeAt(c)===63?(e=bi,c++):(e=t,f===0&&b(vi)),e===t&&(i.charCodeAt(c)===58?(e=F,c++):(e=t,f===0&&b(j)),e===t&&(i.charCodeAt(c)===92?(e=je,c++):(e=t,f===0&&b(Re)),e===t&&(i.charCodeAt(c)===47?(e=Mt,c++):(e=t,f===0&&b(zt))))))))))))))))))))),e}function Hi(){var e,o,l,u,h;if(e=c,o=[],l=m(),l!==t)for(;l!==t;)o.push(l),l=m();else o=t;if(o!==t)if(i.substr(c,2)===Ci?(l=Ci,c+=2):(l=t,f===0&&b(dc)),l!==t){if(u=[],h=m(),h!==t)for(;h!==t;)u.push(h),h=m();else u=t;u!==t?(o=[o,l,u],e=o):(c=e,e=t)}else c=e,e=t;else c=e,e=t;return e}function Dc(){var e;return i.charCodeAt(c)===91?(e=_i,c++):(e=t,f===0&&b(Si)),e===t&&(i.charCodeAt(c)===123?(e=me,c++):(e=t,f===0&&b(Bt))),e}function Bc(){var e;return i.charCodeAt(c)===93?(e=Ai,c++):(e=t,f===0&&b(ki)),e===t&&(i.charCodeAt(c)===125?(e=jt,c++):(e=t,f===0&&b(Rt))),e}const{errorOnLuceneSyntax:jc,parseCursor:Rc,cursorSymbol:Uc,allowLeadingWildcards:Mc=!0,helpers:{nodeTypes:de}}=a,q=de.function.buildNodeWithArgumentNodes,re=de.literal.buildNode,zc=de.wildcard.buildNode,Ic=de.namedArg.buildNode,{wildcardSymbol:qi}=de.wildcard;if(ot=g(),ot!==t&&c===i.length)return ot;throw ot!==t&&c<i.length&&b({type:"end",description:"end of input"}),Ei(null,Ft,H<i.length?i.charAt(H):null,H<i.length?nt(H,H+1):nt(H,H))}return{SyntaxError:r,parse:s}}(),Et=(n,r={},s=Ge)=>{if(typeof n>"u")throw new Error("expression must be a string, got undefined instead");return s(n,{...r,helpers:{nodeTypes:V}})},ye=(n,r={})=>Et(n,{...r,startRule:"Literal"},Ge),Je=(n,r={})=>{try{return Et(n,r,Ge)}catch(s){throw s.name==="SyntaxError"?new xr(s,n):s}},Fs=n=>{try{return Et(n,{errorOnLuceneSyntax:!0},Ge),!1}catch(r){return r.message.startsWith("Lucene")}},D=(n,r,s,i)=>(r=void 0,!n||!n.type||!V[n.type]?D(V.function.buildNode("and",[]),r):V[n.type].toOpenSearchQuery(n,r,s,i)),W="@kuery-wildcard@";function Hs(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function qs(n){return n.replace(/[+-=&|><!(){}[\]^"~*?:\\/]/g,"\\$&")}function Ws(n){return n.includes(W)?{type:"wildcard",value:n}:ye(n)}function Er(n,r){const{value:s}=n,i=s.split(W).map(Hs).join("[\\s\\S]*");return new RegExp(`^${i}$`).test(r)}function Vs(n){const{value:r}=n;return r.split(W).join("*")}function Ot(n){const{value:r}=n;return r.split(W).map(qs).join("*")}function Ys(n){const{value:r}=n;return r.startsWith(W)&&r.replace(W,"").length>0}const Ks=Object.freeze(Object.defineProperty({__proto__:null,buildNode:Ws,hasLeadingWildcard:Ys,test:Er,toOpenSearchQuery:Vs,toQueryStringQuery:Ot,wildcardSymbol:W},Symbol.toStringTag,{value:"Module"}));function Pt(n,r){if(!r)return[];if(n.type==="literal"){const s=xt(n),i=r.fields.find(a=>a.name===s);return i?[i]:[]}else if(n.type==="wildcard")return r.fields.filter(i=>Er(n,i.name))}function Hc(n){return n}function Or(n,r,s){const i={...n,value:s?`${s}.${n.value}`:n.value};if(!r||i.type==="wildcard"&&!s)return i;const t=Pt(i,r).reduce((p,g)=>{const v=g.subType&&g.subType.nested?g.subType.nested.path:void 0;return s&&!v?[...p,`${g.name} is not a nested field but is in nested group "${s}" in the DQL expression.`]:v&&!s?[...p,`${g.name} is a nested field, but is not in a nested group in the DQL expression.`]:v!==s?[...p,`Nested field ${g.name} is being queried with the incorrect nested path. The correct path is ${g.subType.nested.path}.`]:p},[]);if(t.length>0)throw new Error(t.join(`
|
|
636
|
+
`));return i}function Zs(n,r,s=!1){if(n===void 0)throw new Error("fieldName is a required argument");if(r===void 0)throw new Error("value is a required argument");const i=typeof n=="string"?ye(n):ve(n),a=typeof r=="string"?ye(r):ve(r),t=ve(s);return{arguments:[i,a,t]}}function Xs(n,r,s={},i={}){const{arguments:[a,t,p]}=n,g=Or(a,r,i!=null&&i.nested?i.nested.path:void 0),v=D(g),_=t!==void 0?D(t):t,A=p.value?"phrase":"best_fields";if(g.value===null)return t.type==="wildcard"?{query_string:{query:Ot(t)}}:{multi_match:{type:A,query:_,lenient:!0}};const S=r?Pt(g,r):[];S&&S.length===0&&S.push({name:D(g),scripted:!1,type:""});const E=t.type==="wildcard"&&_==="*",C=g.type==="wildcard"&&v==="*"||S&&r&&S.length===r.fields.length;return E&&C?{match_all:{}}:{bool:{should:S.reduce((te,Q)=>{const F=j=>{var me;return g.type!=="wildcard"||!((me=Q.subType)!=null&&me.nested)||i!=null&&i.nested?j:{nested:{path:Q.subType.nested.path,query:j,score_mode:"none"}}};if(Q.scripted)return[];if(E)return[...te,F({exists:{field:Q.name}})];if(t.type==="wildcard")return[...te,F({query_string:{fields:[Q.name],query:Ot(t)}})];if(Q.type==="date"){const j=s.dateFormatTZ?{time_zone:s.dateFormatTZ}:{};return[...te,F({range:{[Q.name]:{gte:_,lte:_,...j}}})]}else{const j=A==="phrase"?"match_phrase":"match";return[...te,F({[j]:{[Q.name]:_}})]}},[])||[],minimum_should_match:1}}}const Gs=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:Zs,toOpenSearchQuery:Xs},Symbol.toStringTag,{value:"Module"}));function Js(n){return{arguments:n}}function eo(n,r,s={},i={}){return{bool:{filter:(n.arguments||[]).map(t=>D(t,r,s,i))}}}const to=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:Js,toOpenSearchQuery:eo},Symbol.toStringTag,{value:"Module"}));function ro(n){return{arguments:n}}function io(n,r,s={},i={}){return{bool:{should:(n.arguments||[]).map(t=>D(t,r,s,i)),minimum_should_match:1}}}const so=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:ro,toOpenSearchQuery:io},Symbol.toStringTag,{value:"Module"}));function oo(n){return{arguments:[n]}}function no(n,r,s={},i={}){const[a]=n.arguments;return{bool:{must_not:D(a,r,s,i)}}}const co=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:oo,toOpenSearchQuery:no},Symbol.toStringTag,{value:"Module"}));function ao(n,...r){let s={};for(let i of r)s[i]=n[i];return s}function lo(n,r){const s=ao(r,"gt","lt","gte","lte","format"),i=typeof n=="string"?ye(n):V.literal.buildNode(n),a=Object.entries(s).map(t=>{let[p,g]=t;return V.namedArg.buildNode(p,g)});return{arguments:[i,...a]}}function uo(n,r,s={},i={}){const[a,...t]=n.arguments,p=Or(a,r,i!=null&&i.nested?i.nested.path:void 0),g=r?Pt(p,r):[],v=po(t),_=Object.fromEntries(Object.entries(v).map(([S,E])=>[S,D(E)]));return g&&g.length===0&&g.push({name:D(p),scripted:!1,type:""}),{bool:{should:g.map(S=>{const E=C=>{var L;return p.type!=="wildcard"||!((L=S.subType)!=null&&L.nested)||i.nested?C:{nested:{path:S.subType.nested.path,query:C,score_mode:"none"}}};if(S.scripted)return{};if(S.type==="date"){const C=s.dateFormatTZ?{time_zone:s.dateFormatTZ}:{};return E({range:{[S.name]:{..._,...C}}})}return E({range:{[S.name]:_}})}),minimum_should_match:1}}}function po(n){if(n.gt&&n.gte||n.lt&&n.lte)throw new Error("range ends cannot be both inclusive and exclusive");const r=["gte","lte","format"];return n.reduce((s,i,a)=>(i.type==="namedArg"?s[i.name]=i.value:s[r[a]]=i,s),{})}const fo=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:lo,toOpenSearchQuery:uo},Symbol.toStringTag,{value:"Module"}));function ho(n){return{arguments:[ve(n)]}}function go(n,r,s={},i={}){const{arguments:[a]}=n,t={...a,value:i!=null&&i.nested?`${i.nested.path}.${a.value}`:a.value},p=xt(t),g=((r==null?void 0:r.fields)||[]).find(v=>v.name===p);if(g&&g.scripted)throw new Error("Exists query does not support scripted fields");return{exists:{field:p}}}const bo=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:ho,toOpenSearchQuery:go},Symbol.toStringTag,{value:"Module"}));function vo(n,r){return{arguments:[typeof n=="string"?ye(n):ve(n),r]}}function yo(n,r,s={},i={}){var v;const[a,t]=n.arguments,p=D(a),g=(v=i==null?void 0:i.nested)!=null&&v.path?`${i.nested.path}.${p}`:p;return{nested:{path:g,query:D(t,r,s,{...i,nested:{path:g}}),score_mode:"none"}}}const Tt={is:Gs,and:to,or:so,not:co,range:fo,exists:bo,nested:Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:vo,toOpenSearchQuery:yo},Symbol.toStringTag,{value:"Module"}))};function mo(n,...r){const s=Tt[n];if(s===void 0)throw new Error(`Unknown function "${n}"`);return{type:"function",function:n,...s.buildNodeParams(...r)}}function $o(n,r){if(Tt[n]===void 0)throw new Error(`Unknown function "${n}"`);return{type:"function",function:n,arguments:r}}function wo(n,r,s,i){return Tt[n.function].toOpenSearchQuery(n,r,s,i)}const _o=Object.freeze(Object.defineProperty({__proto__:null,buildNode:mo,buildNodeWithArgumentNodes:$o,toOpenSearchQuery:wo},Symbol.toStringTag,{value:"Module"}));function So(n,r){const s=r.type==="literal"?r:V.literal.buildNode(r);return{type:"namedArg",name:n,value:s}}function Ao(n){return D(n.value)}const V={function:_o,literal:Qs,namedArg:Object.freeze(Object.defineProperty({__proto__:null,buildNode:So,toOpenSearchQuery:Ao},Symbol.toStringTag,{value:"Module"})),wildcard:Ks},ko=W,Co=(n,r)=>"("+(n.arguments||[]).map(i=>pe(i,r)).join(" AND ")+")",xo=(n,r)=>{var{arguments:[s,i,a]}=n;let t="=";i.type==="wildcard"&&(t="");let p=pe(i);a=a.value||typeof p=="string",i.type==="literal"&&a&&(p=`'${p}'`),i.type==="literal"&&!a&&(p=`${p}`);let g=pe(s);return g==null?r&&a?`(${r.filter(v=>v.type==="string").map(v=>`${v.name} ILIKE '%${i.value}%'`).join(" OR ")})`:r&&!a&&(i.value===!0||i.value===!1)?`(${r.filter(v=>v.type==="boolean").map(v=>`${v.name}=${i.value}`).join(" OR ")})`:"":g+t+p},Eo=(n,r)=>"("+(n.arguments||[]).map(i=>pe(i,r)).join(" OR ")+")",Oo=(n,r)=>{const[s]=n.arguments;return"NOT ("+pe(s,r)+")"},Po={gt:">",lt:"<",gte:">=",lte:"<="},To={is:xo,and:Co,or:Eo,not:Oo,range:n=>{const[r,s]=n.arguments;let i=s.value;const a=Po[s.name];let t=pe(i);return i.type==="literal"&&(t=`${t}`),`${r.value} ${a} ${t}`},exists:n=>{const[r]=n.arguments;return`${r.value} IS NOT NULL`},nested:n=>(console.warn("Nested types dont exist in CQL",n),"")},Lo={function:(n,r)=>To[n.function](n,r),literal:n=>n.value,wildcard:n=>{const{value:r}=n;return` LIKE '${r.split(ko).join("%")}'`}},pe=(n,r)=>{const s=Lo[n.type];return s(n,r)},No=W,Do=n=>({$and:(n.arguments||[]).map(i=>J(i))}),Bo=n=>{const{arguments:[r,s]}=n;let i=J(s);if(s.type==="wildcard"&&s.value==="@kuery-wildcard@")return Pr(n);let t={};return t[J(r)]={$eq:i},t},jo=n=>({$or:(n.arguments||[]).map(s=>J(s))}),Ro=n=>{const[r]=n.arguments;let s={};return s={$ne:J(r)},s},Uo={gt:"$gt",lt:"$lt",gte:"$gte",lte:"$lte"},Mo=n=>{const[r,s]=n.arguments;let i=s.value;const a=Uo[s.name];let t=J(i),p={};return p[r.value]={},p[r.value][a]=t,p},Pr=n=>{const[r]=n.arguments;return{[J(r)]:{$ne:null}}},zo={is:Bo,and:Do,or:jo,not:Ro,range:Mo,exists:Pr,nested:n=>(console.warn("TODO Implement nested search",n),"")},Io={function:n=>zo[n.function](n),literal:n=>n.value,wildcard:n=>{const{value:r}=n;return`/${r.split(No).join(".*")}/`}},J=(n,r)=>{const s=Io[n.type];return s(n,r)},Qo=Object.freeze(Object.defineProperty({__proto__:null,DQLSyntaxError:xr,doesKueryExpressionHaveLuceneSyntaxError:Fs,fromKueryExpression:Je,fromLiteralExpression:ye,nodeTypes:V,parse:Je,toCql:pe,toDSL:D,toMongo:J,toOpenSearchQuery:D},Symbol.toStringTag,{value:"Module"})),Fo=z`
|
|
637
|
+
:host {
|
|
638
|
+
--dialog-padding: var(--spectric-dialog-padding, 5px);
|
|
639
|
+
--dialog-background:var(--spectric-background,rgb(246, 249, 252));
|
|
640
|
+
}
|
|
641
|
+
dialog {
|
|
642
|
+
border: 0px solid var(--background-inverse);
|
|
643
|
+
--spectric-background: var(--dialog-background);
|
|
644
|
+
--panel-color:var(--dialog-background);
|
|
645
|
+
padding: 0;
|
|
646
|
+
border-radius: var(--spectric-border-radius);
|
|
647
|
+
overflow:hidden;
|
|
648
|
+
|
|
649
|
+
}
|
|
650
|
+
dialog[open]{
|
|
651
|
+
display:flex;
|
|
652
|
+
}
|
|
653
|
+
spectric-panel{
|
|
654
|
+
margin:0px
|
|
655
|
+
}
|
|
656
|
+
dialog::backdrop {
|
|
657
|
+
background-color: transparent;
|
|
658
|
+
}
|
|
659
|
+
dialog.backdrop::backdrop {
|
|
660
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
661
|
+
}
|
|
662
|
+
.modal{
|
|
663
|
+
display: flex;
|
|
664
|
+
overflow: hidden;
|
|
665
|
+
flex-direction: column;
|
|
666
|
+
height: 100%;
|
|
667
|
+
}
|
|
668
|
+
.content{
|
|
669
|
+
flex-shrink: 1;
|
|
670
|
+
overflow: auto;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
h3 {
|
|
674
|
+
padding: 1em var(--dialog-padding);
|
|
675
|
+
margin: 0;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
spectric-button{
|
|
679
|
+
position: absolute;
|
|
680
|
+
right: 0;
|
|
681
|
+
top: 0;
|
|
682
|
+
}
|
|
683
|
+
`;var Ho=Object.defineProperty,qo=Object.getOwnPropertyDescriptor,ee=(n,r,s,i)=>{for(var a=i>1?void 0:i?qo(r,s):r,t=n.length-1,p;t>=0;t--)(p=n[t])&&(a=(i?p(r,s,a):p(a))||a);return i&&a&&Ho(r,s,a),a};const Lt="spectric-dialog";d.DialogElement=class extends N{constructor(){super(...arguments),this.open=!1,this.dismissable=!0,this.hideBackdrop=!1,this.title="",this.closeOnEscape=!0,this.closeOnOutsideClick=!0,this.clickHandler=async r=>{const s=await this.dialogElement;!this.dismissable||!this.closeOnOutsideClick||s===r.target&&(this.open=!1)},this._handleKeyDown=r=>{this.closeOnEscape||r.preventDefault(),this.open&&this.closeOnEscape&&r.key==="Escape"&&(this.open=!1)},this._onClose=r=>{r.preventDefault(),r.stopPropagation(),this.open=!1,this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}static display(r,s){let i=document.createElement(Lt);i.addEventListener("close",()=>{i.remove()});for(let t in r)i[t]=r[t];let a=document.createDocumentFragment();return fr(s,a),i.appendChild(a),i.open=!0,document.body.appendChild(i),i}connectedCallback(){super.connectedCallback(),this.dialogElement.then(r=>r.addEventListener("keydown",this._handleKeyDown))}disconnectedCallback(){super.disconnectedCallback(),this.dialogElement.then(r=>r.removeEventListener("keydown",this._handleKeyDown))}updated(r){r.has("open")&&this.dialogElement.then(s=>{this.open?s.showModal():s.close()})}render(){return k`
|
|
684
|
+
<dialog class=${this.hideBackdrop?"":"backdrop"} @close=${this._onClose} @click=${this.clickHandler}>
|
|
685
|
+
<spectric-panel>
|
|
686
|
+
<div class="modal">
|
|
687
|
+
${this.dismissable?k`<spectric-button variant="text" size="small" @click=${()=>{this.open=!1}}>X</spectric-button>`:null}
|
|
688
|
+
<h3 >
|
|
689
|
+
<slot name="title">
|
|
690
|
+
${this.title.length?this.title:null}
|
|
691
|
+
</slot>
|
|
692
|
+
</h3>
|
|
693
|
+
|
|
694
|
+
<div class="content"><slot></slot></div>
|
|
695
|
+
<div class="footer"><slot name="footer"></slot></div>
|
|
696
|
+
</div>
|
|
697
|
+
</spectric-panel>
|
|
698
|
+
</dialog>
|
|
699
|
+
`}},d.DialogElement.styles=Fo,ee([y({type:Boolean,reflect:!0})],d.DialogElement.prototype,"open",2),ee([y({type:Boolean,reflect:!0})],d.DialogElement.prototype,"dismissable",2),ee([y({type:Boolean,reflect:!0})],d.DialogElement.prototype,"hideBackdrop",2),ee([y({type:String,reflect:!0})],d.DialogElement.prototype,"title",2),ee([y({type:Boolean,reflect:!0})],d.DialogElement.prototype,"closeOnEscape",2),ee([y({type:Boolean,reflect:!0})],d.DialogElement.prototype,"closeOnOutsideClick",2),ee([He("dialog")],d.DialogElement.prototype,"dialogElement",2),d.DialogElement=ee([R(Lt)],d.DialogElement);var Wo=Object.defineProperty,Vo=Object.getOwnPropertyDescriptor,Y=(n,r,s,i)=>{for(var a=i>1?void 0:i?Vo(r,s):r,t=n.length-1,p;t>=0;t--)(p=n[t])&&(a=(i?p(r,s,a):p(a))||a);return i&&a&&Wo(r,s,a),a},Tr=(n=>(n.MONGO="toMongo",n.CQL="toCql",n.DSL="toDSL",n.AST="AST",n))(Tr||{});const Lr={eq:{value:" : ",label:" equals some value"},gt:{value:" > ",label:" is greater than some value"},lt:{value:" < ",label:" is less than some value"},gte:{value:" >= ",label:" is greater than or equal to some value"},lte:{value:" <= ",label:" is less than or equal to some value"}},Yo={eq:{value:": ",label:" equals some value"},exists:{value:": *",label:" exists in any form"}},Ko=[{value:": true",label:" value is true"},{value:": false",label:"value is false"}],Zo=Object.fromEntries(Object.entries(Lr).map(([n,r])=>[n,{value:r.value,label:(r.label||"").replace("value","date-time")}]));d.SpectricQuery=class extends N{constructor(){super(),this._value="",this.outputLanguage="AST",this.completions=[],this.completionIndex=0,this.fields=[],this._parseQuery=(r=void 0)=>{let s;if(this.value=="")return;try{r&&r.data=="("&&(this.value=this.value+" )",this._input.setSelectionRange(this.value.length-2,this.value.length-2));let t=this.value;this._input.selectionStart!==null&&(t=t.substring(0,this._input.selectionStart)+"@kuery-cursor@"+t.substring(this._input.selectionStart));let p=Je(t,{parseCursor:!0,cursorSymbol:"@kuery-cursor@",allowLeadingWildcards:!1});this.autoComplete(p),s=Je(this.value,{allowLeadingWildcards:!1})}catch{return}let i;this.outputLanguage=="AST"?i=s:i=Qo[this.outputLanguage](s,this.fields);let a=new CustomEvent("change",{detail:i});this.dispatchEvent(a)},this.getValuesForField=async(r,s)=>(console.log("getValuesForField isn't set no values returned",r,s),[]),this._selectCompletion=async()=>{if(!this.suggestion)return;let r=this.completions[this.completionIndex],s=this.value.substring(0,r.start)+r.value,i=s.length,a=this.value.substring(r.end);if(r.value.includes(a)?this.value=s:this.value=s+this.value.substring(r.end),this._input.setSelectionRange(i,i),r.onSelect){let t=await r.onSelect();t!==void 0&&(this.value+=t)}this.completionIndex=0,this.completions=[],this._parseQuery()},this._handleArrows=r=>{var s;r.key==="Escape"&&(this.completions=[]),(r.key=="ArrowLeft"||r.key==="ArrowRight")&&setTimeout(this._parseQuery,100),this.completions.length&&["ArrowUp","ArrowDown","Enter","Tab"].includes(r.key)&&this.suggestion&&(r.preventDefault(),(r.key==="ArrowDown"||r.key==="Tab")&&(this.completionIndex+=1,this.completionIndex>this.completions.length-1&&(this.completionIndex=0)),r.key==="ArrowUp"&&(this.completionIndex-=1,this.completionIndex<0&&(this.completionIndex=this.completions.length-1)),(s=this._asyncAutocomplete)==null||s.then(i=>{let a=i.querySelector(".option.active");a&&a.scrollIntoView({block:"nearest"})}),r.key==="Enter"&&this._selectCompletion())},this.uuid=crypto.randomUUID()}createRenderRoot(){return this}get value(){return this._input?String(this._input.value):this._value}set value(r){const s=this._value;this._value=r,this.requestUpdate("value",s),this._input&&(this._input.value=String(r))}async autoComplete(r){if(this.completions=[],r.type!=="cursor")return;let s=[];this.suggestion=r;let{start:i,end:a}=r;for(let t of r.suggestionTypes){if(t=="conjunction"&&r.text.endsWith(" ")&&s.push(...["and ","or "].map(p=>({type:t,value:p,start:a,end:a}))),t==="field"){let p=this.fields.filter(g=>g.name.includes(r.fieldName)||g.name.includes(r.prefix)).map(g=>[{type:t,value:g.name,start:i,end:a}]).flat();s.push(...p)}if(t==="operator"){let p=this.fields.find(g=>g.name===r.fieldName);p&&(p.type==="number"?s.push(...Object.values(Lr).map(g=>({type:t,...g,start:a,end:a}))):p.type==="string"?p.format==="date-time"?s.push(...Object.values(Zo).map(g=>({type:t,...g,start:a,end:a,onSelect:async()=>{let v=await this.getValuesForField(r.fieldName,r.prefix);v.length===0&&(v=["now-1m","now-1d","now-1M"]);let _,A=We();return await new Promise(S=>{let E=d.DialogElement.display({},k`
|
|
700
|
+
<div class="query-bar-date-quick-select">
|
|
701
|
+
${v.map(C=>k`<a href="#" @click=${L=>{L.preventDefault(),_=`"${C}"`,S(_),E.open=!1}}>${C}</a>`)}
|
|
702
|
+
</div>
|
|
703
|
+
<spectric-input variant="datetime-local" @change=${C=>{if(!C.target)return;_=`"${new Date(C.target.value+":00.000Z").toISOString()}"`,A.value.disabled=_===void 0}}></spectric-input>
|
|
704
|
+
<spectric-button ${Ve(A)} .disabled=${!0} @click=${()=>{S(_),E.open=!1}}>Submit</spectric-button>
|
|
705
|
+
`)}),_}}))):s.push(...Object.values(Yo).map(g=>({type:t,...g,start:a,end:a}))):p.type==="boolean"&&s.push(...Ko.map(g=>({type:t,...g,start:a,end:a}))))}if(t==="value"){let p=this.fields.find(g=>g.name===r.fieldName);if(p&&p.type=="boolean")s.push({type:t,value:"true",start:i,end:a},{type:t,value:"false",start:i,end:a});else{console.log(`invoke callback to get values for ${r.fieldName}`);let g=await this.getValuesForField(r.fieldName,r.prefix);(p==null?void 0:p.type)==="string"&&(g=g.map(v=>`"${v}"`)),s.push(...g.map(v=>({type:t,value:v,start:i,end:a})))}}}if(this.completions=s,this.completions.length&&this._autocomplete){let{width:t}=this._input.getBoundingClientRect();this._autocomplete.showPopover(),this._autocomplete.style.width=`${t-15}px`}}updated(r){r.has("outputLanguage")&&this._parseQuery()}render(){return k`
|
|
706
|
+
<spectric-input style=${`anchor-name:--${this.uuid};`} autocomplete="off" @input=${this._parseQuery} @keydown=${this._handleArrows}></spectric-input>
|
|
707
|
+
<div class="autocomplete" popover style=${`position-anchor: --${this.uuid};`}>
|
|
708
|
+
${this.completions.map((r,s)=>k`<div @click=${()=>{this.completionIndex=s,this._selectCompletion()}} class=${this.completionIndex==s?"option active":"option"}><span class="optiontype ${r.type}">${r.type}</span> <span class="value">${r.value}</span> <span class="label">${r.label}</span></span> </div></div>`)}
|
|
709
|
+
</div>`}},Y([y({type:String,reflect:!0})],d.SpectricQuery.prototype,"value",1),Y([y({type:String,reflect:!0})],d.SpectricQuery.prototype,"outputLanguage",2),Y([Fe()],d.SpectricQuery.prototype,"completions",2),Y([Fe()],d.SpectricQuery.prototype,"completionIndex",2),Y([y({type:Array,reflect:!0})],d.SpectricQuery.prototype,"fields",2),Y([Le(".autocomplete")],d.SpectricQuery.prototype,"_autocomplete",2),Y([He(".autocomplete")],d.SpectricQuery.prototype,"_asyncAutocomplete",2),Y([Le("spectric-input")],d.SpectricQuery.prototype,"_input",2),d.SpectricQuery=Y([R("spectric-query")],d.SpectricQuery);const Nr=z`
|
|
710
|
+
border-color: color-mix(in hsl, var(--panel-color, #0b0b0b), var(--spectric-input-color, #000000) 3%);
|
|
711
|
+
background-color: var(--panel-color,#0b0b0b);
|
|
712
|
+
--spectric-input-color: var(--spectric-background);
|
|
713
|
+
color:var(--text-secondary,#3c4c5b);
|
|
714
|
+
--spectric-text-primary:var(--text-primary);
|
|
715
|
+
--spectric-text-secondary:var(--text-secondary);
|
|
716
|
+
filter: drop-shadow(0px 1px 3px color-mix(in srgb, var(--text-secondary, #3c4c5b), transparent 50%));
|
|
717
|
+
`,Dr=z`
|
|
718
|
+
border-color: color-mix(in hsl, var(--panel-color-inverse,#f4f4f4), var(--spectric-input-color, #000000) 3%);
|
|
719
|
+
background-color: var(--panel-color-inverse,#0b0b0b);
|
|
720
|
+
color:var(--text-primary,#3c4c5b);
|
|
721
|
+
--spectric-input-color: var(--panel-color);
|
|
722
|
+
--spectric-text-primary:var(--text-secondary);
|
|
723
|
+
--spectric-text-secondary:var(--text-primary);
|
|
724
|
+
filter: drop-shadow(0px 1px 3px color-mix(in srgb, var(--text-primary, #3c4c5b), transparent 70%));
|
|
725
|
+
`,Xo=z`
|
|
726
|
+
:host{
|
|
727
|
+
display:block;
|
|
728
|
+
border:2px solid black;
|
|
729
|
+
margin: 5px;
|
|
730
|
+
border-radius:var(--spectric-border-radius,0.4em);
|
|
731
|
+
padding: calc(var(--spectric-border-radius,0.4em) + 2px);
|
|
732
|
+
|
|
733
|
+
}
|
|
734
|
+
:host(spectric-panel[level='0']) {
|
|
735
|
+
${Nr};
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
:host(spectric-panel[level='1']) {
|
|
739
|
+
${Dr};
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
:host(spectric-panel[level='2']) {
|
|
743
|
+
${Nr};
|
|
744
|
+
}
|
|
745
|
+
:host(spectric-panel[level='3']) {
|
|
746
|
+
${Dr};
|
|
747
|
+
}
|
|
748
|
+
`;var Go=Object.defineProperty,Jo=Object.getOwnPropertyDescriptor,Nt=(n,r,s,i)=>{for(var a=i>1?void 0:i?Jo(r,s):r,t=n.length-1,p;t>=0;t--)(p=n[t])&&(a=(i?p(r,s,a):p(a))||a);return i&&a&&Go(r,s,a),a};d.SpectricPanel=class extends N{constructor(){super(...arguments),this.level=0}updated(){this.layers||(this.layers=this.querySelectorAll("spectric-panel")),this.layers.forEach(r=>{r.setAttribute("level",((this.level+1)%4).toString())}),this.dispatchEvent(new CustomEvent("use-layer",{bubbles:!0,cancelable:!0,composed:!0,detail:{layer:this,level:this.level}}))}render(){return k` <slot></slot> `}},d.SpectricPanel.styles=Xo,Nt([y({type:Number,reflect:!0})],d.SpectricPanel.prototype,"level",2),Nt([y({attribute:!1})],d.SpectricPanel.prototype,"layers",2),d.SpectricPanel=Nt([R("spectric-panel")],d.SpectricPanel);var en=Object.defineProperty,tn=Object.getOwnPropertyDescriptor,Br=(n,r,s,i)=>{for(var a=i>1?void 0:i?tn(r,s):r,t=n.length-1,p;t>=0;t--)(p=n[t])&&(a=(i?p(r,s,a):p(a))||a);return i&&a&&en(r,s,a),a};const rn={"--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"}},jr={"--secondary":"#77878b","--tertiary":"#c7c7c7","--disabled":"#000000","--text-primary":"#cccccc","--text-secondary":"#cccccc","--text-on-color":"#ededed","--background":"#181818","--background-inverse":"#37373d"},Rr={...jr,"--primary":"#ffd45a","--text-on-color":"#4f4f4f"},Dt={undefined:{},light:{},dark:jr,spectric:Rr,spectricFlat:{...Rr,"--border-radius":"1px"}},sn=Object.fromEntries(Object.keys(Dt).map(n=>[n,n])),on=`
|
|
749
|
+
--spectric-background: var(--background,#ffffff);
|
|
750
|
+
--spectric-background-hover:var(--background-hover,rgba(141, 141, 141, 0.12));
|
|
751
|
+
--spectric-background-inverse: var(--background-inverse,#f4f4f4);
|
|
752
|
+
--spectric-background-inverse-hover: var(--background-inverse-hover,#474747);
|
|
753
|
+
--spectric-border-radius: var(--border-radius,.4em);
|
|
754
|
+
--spectric-primary:var(--primary,#1ea7fd);
|
|
755
|
+
--spectric-secondary: var(--secondary,#77878b);
|
|
756
|
+
--spectric-tertiary: var(--tertiary,#0f62fe);
|
|
757
|
+
--spectric-disabled: var(--disabled,#c6c6c6);
|
|
758
|
+
|
|
759
|
+
/* panel */
|
|
760
|
+
--panel-color:var(--spectric-background-inverse);
|
|
761
|
+
--panel-color-inverse:var(--spectric-background);
|
|
762
|
+
--spectric-border-disabled: var(--disabled);
|
|
763
|
+
|
|
764
|
+
/*inputs*/
|
|
765
|
+
--spectric-input-color: var(--panel-color-inverse);
|
|
766
|
+
--spectric-input-bottom: var(--panel-color);
|
|
767
|
+
|
|
768
|
+
--spectric-text-on-color: var(--text-on-color,#ffffff);
|
|
769
|
+
--spectric-text-on-color-disabled: var(--text-on-color-disabled,#8d8d8d);
|
|
770
|
+
--spectric-text-placeholder: var(--text-placeholder,rgba(22, 22, 22, 0.4));
|
|
771
|
+
--spectric-text-primary: var(--text-primary,#161616);
|
|
772
|
+
--spectric-text-secondary: var(--text-secondary,#525252);
|
|
773
|
+
/* Buttons */
|
|
774
|
+
--spectric-button-separator: #e0e0e0;
|
|
775
|
+
--spectric-button-primary: var(--primary,#1ea7fd);
|
|
776
|
+
--spectric-button-secondary: var(--secondary,#77878b);
|
|
777
|
+
--spectric-button-tertiary: var(--tertiary);
|
|
778
|
+
--spectric-button-danger-primary: #da1e28;
|
|
779
|
+
--spectric-button-danger-secondary: #da1e28;
|
|
780
|
+
--spectric-button-danger-active: #750e13;
|
|
781
|
+
--spectric-button-primary-active: #002d9c;
|
|
782
|
+
--spectric-button-secondary-active: #6f6f6f;
|
|
783
|
+
--spectric-button-tertiary-active: #002d9c;
|
|
784
|
+
--spectric-button-danger-hover: #b81921;
|
|
785
|
+
--spectric-button-primary-hover: #0050e6;
|
|
786
|
+
--spectric-button-secondary-hover: #474747;
|
|
787
|
+
--spectric-button-tertiary-hover: #0050e6;
|
|
788
|
+
--spectric-text-on-color-disabled: var(--disabled,#c6c6c6)
|
|
789
|
+
--spectric-button-disabled: #c6c6c6;
|
|
790
|
+
color: var(--spectric-text-primary);
|
|
791
|
+
`;d.SpectricThemeProvider=class extends N{constructor(){super(...arguments),this.theme="undefined"}updated(r){if(r.has("theme")&&this.theme!=r.get("theme")){const s={old:r.get("theme"),new:this.theme};this.dispatchEvent(new CustomEvent("theme-change",{detail:s,bubbles:!0,composed:!0}))}}render(){let r=Object.keys(Dt).includes(this.theme)?this.theme:"undefined",s=Object.entries(Dt[r]).map(i=>`${i[0]}:${i[1]};`).join(`
|
|
792
|
+
`);return k`
|
|
793
|
+
${this.theme&&this.theme!=="light"?k`
|
|
794
|
+
<style>:host{
|
|
795
|
+
${s};
|
|
796
|
+
${on}
|
|
797
|
+
}
|
|
798
|
+
/* Webkit psudo elements don't pick up variables defined by the host */
|
|
799
|
+
::-webkit-scrollbar-thumb {
|
|
800
|
+
background: var(--spectric-background-inverse,#393939);
|
|
801
|
+
border-radius: var(--spectric-border-radius,4em);
|
|
802
|
+
-webkit-border-radius: var(--spectric-border-radius,4em);
|
|
803
|
+
padding-top: 1px;
|
|
804
|
+
padding-bottom: 1px;
|
|
805
|
+
}
|
|
806
|
+
::-webkit-scrollbar-thumb:hover {
|
|
807
|
+
background: var(--spectric-background-inverse-hover,#474747);
|
|
808
|
+
|
|
809
|
+
}
|
|
810
|
+
::-webkit-scrollbar-corner {
|
|
811
|
+
background: var(--spectric-background, #ffffff);
|
|
812
|
+
}
|
|
813
|
+
/* Buttons */
|
|
814
|
+
|
|
815
|
+
::-webkit-scrollbar-button:single-button {
|
|
816
|
+
background-color: transparent;
|
|
817
|
+
display: block;
|
|
818
|
+
border-style: solid;
|
|
819
|
+
}
|
|
820
|
+
/* Up */
|
|
821
|
+
::-webkit-scrollbar-button:single-button:vertical:decrement {
|
|
822
|
+
border-width: 0 5px 5px 5px;
|
|
823
|
+
border-color: var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-background-inverse,#393939) var(--spectric-background, #ffffff);
|
|
824
|
+
}
|
|
825
|
+
::-webkit-scrollbar-button:single-button:vertical:decrement:hover {
|
|
826
|
+
border-color: var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-background-inverse-hover,#474747) var(--spectric-background, #ffffff);
|
|
827
|
+
}
|
|
828
|
+
/* Down */
|
|
829
|
+
::-webkit-scrollbar-button:single-button:vertical:increment {
|
|
830
|
+
border-width: 5px 5px 0 5px;
|
|
831
|
+
border-color: var(--spectric-background-inverse,#393939) var(--spectric-background, #ffffff) transparent var(--spectric-background, #ffffff);
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
::-webkit-scrollbar-button:vertical:single-button:increment:hover {
|
|
835
|
+
border-color: var(--spectric-background-inverse-hover,#474747) var(--spectric-background, #ffffff) transparent var(--spectric-background, #ffffff);
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
/* Left */
|
|
839
|
+
::-webkit-scrollbar-button:single-button:horizontal:decrement {
|
|
840
|
+
border-width: 5px 5px 5px 0;
|
|
841
|
+
border-color:var(--spectric-background, #ffffff) var(--spectric-background-inverse,#393939) var(--spectric-background, #ffffff) var(--spectric-background, #ffffff);
|
|
842
|
+
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
::-webkit-scrollbar-button:single-button:horizontal:decrement:hover {
|
|
846
|
+
border-width: 5px 5px 5px 0;
|
|
847
|
+
border-color:var(--spectric-background, #ffffff) var(--spectric-background-inverse-hover,#474747) var(--spectric-background, #ffffff) var(--spectric-background, #ffffff);
|
|
848
|
+
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
|
|
852
|
+
|
|
853
|
+
/* Right */
|
|
854
|
+
::-webkit-scrollbar-button:single-button:horizontal:increment {
|
|
855
|
+
border-width: 5px 0 5px 5px;
|
|
856
|
+
border-color:var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-background-inverse,#393939);
|
|
857
|
+
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
::-webkit-scrollbar-button:single-button:horizontal:increment:hover {
|
|
861
|
+
border-width: 5px 0 5px 5px;
|
|
862
|
+
border-color:var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-background-inverse-hover,#474747);
|
|
863
|
+
|
|
864
|
+
}
|
|
865
|
+
</style>`:null}
|
|
866
|
+
<slot></slot>
|
|
867
|
+
`}},d.SpectricThemeProvider.styles=z`:host{
|
|
868
|
+
display:contents;
|
|
869
|
+
}`,Br([y({reflect:!0})],d.SpectricThemeProvider.prototype,"theme",2),d.SpectricThemeProvider=Br([R("spectric-theme")],d.SpectricThemeProvider);const nn=z`
|
|
870
|
+
:host {
|
|
871
|
+
display: block;
|
|
872
|
+
height: 100%;
|
|
873
|
+
width: 100%;
|
|
874
|
+
|
|
875
|
+
}
|
|
876
|
+
.split-view {
|
|
877
|
+
display: flex;
|
|
878
|
+
height: 100%;
|
|
879
|
+
width: 100%;
|
|
880
|
+
position:relative;
|
|
881
|
+
}
|
|
882
|
+
.split-view.active{
|
|
883
|
+
cursor:ew-resize;
|
|
884
|
+
}
|
|
885
|
+
.split-view.active.vertical{
|
|
886
|
+
cursor:ns-resize;
|
|
887
|
+
}
|
|
888
|
+
.split-view.vertical {
|
|
889
|
+
flex-direction: column;
|
|
890
|
+
}
|
|
891
|
+
.panel {
|
|
892
|
+
flex: 1;
|
|
893
|
+
overflow: auto;
|
|
894
|
+
}
|
|
895
|
+
.splitter {
|
|
896
|
+
border-radius: var(--spectric-border-radius, .4em);
|
|
897
|
+
background-color: var(--spectric-input-color,#ccc);
|
|
898
|
+
user-select: none;
|
|
899
|
+
transition: background-color 100ms linear;
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
.splitter.invisible {
|
|
903
|
+
background-color: #00000000;
|
|
904
|
+
}
|
|
905
|
+
.splitter:hover {
|
|
906
|
+
background-color: var(--spectric-button-primary, #1ea7fd);
|
|
907
|
+
transition: background-color 500ms linear;
|
|
908
|
+
}
|
|
909
|
+
.splitter.active {
|
|
910
|
+
background-color: var(--spectric-button-primary, #1ea7fd);
|
|
911
|
+
transition: background-color 500ms linear;
|
|
912
|
+
}
|
|
913
|
+
.split-view > .error-display{
|
|
914
|
+
display:none;
|
|
915
|
+
position:absolute;
|
|
916
|
+
top:0;
|
|
917
|
+
right:0
|
|
918
|
+
}
|
|
919
|
+
.split-view.error > .error-display{
|
|
920
|
+
display:inline-block;
|
|
921
|
+
|
|
922
|
+
}
|
|
923
|
+
.split-view.vertical .splitter {
|
|
924
|
+
cursor: ns-resize;
|
|
925
|
+
height: 5px;
|
|
926
|
+
width: 100%;
|
|
927
|
+
}
|
|
928
|
+
.split-view:not(.vertical) .splitter {
|
|
929
|
+
width: 5px;
|
|
930
|
+
cursor: ew-resize;
|
|
931
|
+
}
|
|
932
|
+
`;var cn=Object.defineProperty,an=Object.getOwnPropertyDescriptor,B=(n,r,s,i)=>{for(var a=i>1?void 0:i?an(r,s):r,t=n.length-1,p;t>=0;t--)(p=n[t])&&(a=(i?p(r,s,a):p(a))||a);return i&&a&&cn(r,s,a),a},Ur=(n=>(n.horizontal="horizontal",n.vertical="vertical",n))(Ur||{});const Mr="spectric-splitview";d.SplitView=class extends Ar{constructor(){super(),this.orientation="horizontal",this.percentage=50,this.invisible=!1,this.min=10,this.max=90,this.useSavedState=!0,this.isDragging=!1,this._error=!1,this._emitChange=()=>{let{percentage:s,orientation:i,invisible:a,min:t,max:p,useSavedState:g}=this,v=this.getAttribute("id");v&&this.useSavedState&&localStorage.setItem(`splitview-${v}`,String(s)),this.dispatchEvent(new CustomEvent("change",{detail:{orientation:i,percentage:s,invisible:a,min:t,max:p,useSavedState:g}}))},this._onMouseMove=kr(s=>{if(this.isDragging){const i=this.getBoundingClientRect();let a,t;this.orientation==="horizontal"?(a=s.clientX-i.left,t=a/i.width*100):(a=s.clientY-i.top,t=a/i.height*100),t=Math.min(Math.max(t,this.min),this.max),this.percentage=t,this._emitChange()}}),this._assignSlot=s=>{if(!s.target)return;let a=s.target.assignedNodes().filter(t=>t instanceof HTMLElement);a.length>2&&console.log("cannot assign more than 2 elements to a split view"),a.forEach(t=>{if(this._panel1.assignedNodes().length===0){t.slot="panel1";return}if(this._panel2.assignedNodes().length===0){t.slot="panel2";return}this._error="Too many element assigned to split view splitter can only have a maximum of 2 children",console.warn("Too many element assigned to split view splitter can only have a maximum of 2 children")})};let r=this.getAttribute("id");if(r&&this.useSavedState){let s=localStorage.getItem(`splitview-${r}`);s&&(this.percentage=parseFloat(s))}this.addDisposableListener(this._splitter,"mousedown",()=>{this.isDragging=!0}),this.addDisposableListener(this._splitter,"dblclick",()=>{this.percentage=50,this._emitChange()}),this.addDisposableListener(document.body,"mousemove",this._onMouseMove),this.addDisposableListener(document.body,"mouseup",()=>{this.isDragging=!1})}updated(r){r.has("percentage")&&(this.percentage=Math.min(Math.max(Number(this.percentage),this.min),this.max))}render(){return k`
|
|
933
|
+
<div class="split-view ${this.orientation} ${this._error?"error":""} ${this.isDragging?"active":""}" style="--split-percentage: ${this.percentage}%;">
|
|
934
|
+
<span class="error-display">${this._error}</span>
|
|
935
|
+
<div class="panel" style="${this.orientation==="horizontal"?"flex: var(--split-percentage, 50%)":"max-height: var(--split-percentage, 50%)"}">
|
|
936
|
+
<slot name="panel1"></slot>
|
|
937
|
+
</div>
|
|
938
|
+
<div class="splitter ${this.invisible?"invisible":""} ${this.isDragging?"active":""}"></div>
|
|
939
|
+
<div class="panel" style="${this.orientation==="horizontal"?"flex: calc(100% - var(--split-percentage, 50%))":"max-height: calc(100% - var(--split-percentage, 50%))"}">
|
|
940
|
+
<slot name="panel2"></slot>
|
|
941
|
+
</div>
|
|
942
|
+
</div>
|
|
943
|
+
<slot @slotchange=${this._assignSlot} style="display:none"></slot>
|
|
944
|
+
`}},d.SplitView.styles=nn,B([y({type:String})],d.SplitView.prototype,"orientation",2),B([y({type:Number,reflect:!0})],d.SplitView.prototype,"percentage",2),B([y({type:Boolean})],d.SplitView.prototype,"invisible",2),B([y({type:Number,reflect:!0})],d.SplitView.prototype,"min",2),B([y({type:Number,reflect:!0})],d.SplitView.prototype,"max",2),B([y({type:Boolean,reflect:!0})],d.SplitView.prototype,"useSavedState",2),B([Fe()],d.SplitView.prototype,"isDragging",2),B([Fe()],d.SplitView.prototype,"_error",2),B([He(".splitter")],d.SplitView.prototype,"_splitter",2),B([Le("slot[name='panel1']")],d.SplitView.prototype,"_panel1",2),B([Le("slot[name='panel2']")],d.SplitView.prototype,"_panel2",2),d.SplitView=B([R(Mr)],d.SplitView),d.ButtonSizes=mr,d.ButtonVariants=$r,d.CSSPropsControls=rn,d.DialogElementTag=Lt,d.ElementTag=Mr,d.InputVariants=Cr,d.Orientations=Ur,d.SupportedLanguages=Tr,d.ThemeSelections=sn,d.nodeTypes=V,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
|
945
|
+
//# sourceMappingURL=index.umd.js.map
|