@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.
Files changed (148) hide show
  1. package/dist/assets/Banner-CZ3qKIQC.js +172 -0
  2. package/dist/assets/Banner.stories-BMf4MBpI.js +19 -0
  3. package/dist/assets/BitDisplay.stories-wztXxpxe.js +18 -0
  4. package/dist/assets/Bits-C_TSTjST.js +1 -0
  5. package/dist/assets/Button.stories-gHxjWwVf.js +142 -0
  6. package/dist/assets/Color-F6OSRLHC-AjFOL-zN.js +1 -0
  7. package/dist/assets/DocsRenderer-CFRXHY34-CvW79YxE.js +761 -0
  8. package/dist/assets/Header.stories-Bc09U6g1.js +25 -0
  9. package/dist/assets/Page.stories-DNJKhAFs.js +114 -0
  10. package/dist/assets/QueryBar.stories-Da5C-SV4.js +17 -0
  11. package/dist/assets/_commonjsHelpers-Cpj98o6Y.js +1 -0
  12. package/dist/assets/chunk-L4EGOTBX-AI5g0G5Z.js +2 -0
  13. package/dist/assets/data-CwENMT7L.js +3 -0
  14. package/dist/assets/dialog-CFHXbUTQ.js +611 -0
  15. package/dist/assets/directive-helpers-IbK5tOA8.js +5 -0
  16. package/dist/assets/entry-preview-Di-j0SPB.js +4 -0
  17. package/dist/assets/entry-preview-docs-CUBRpM7y.js +1 -0
  18. package/dist/assets/iframe-BQFuVTVZ.js +2 -0
  19. package/dist/assets/index-BCiKWbv6.js +1 -0
  20. package/dist/assets/index-BHYIh-Xd.js +8 -0
  21. package/dist/assets/index-DBGhiA-l.js +1 -0
  22. package/dist/assets/index-DrFu-skq.js +6 -0
  23. package/dist/assets/index-oFsFREWh.js +9 -0
  24. package/dist/assets/input.stories-Cgdv-5bN.js +58 -0
  25. package/dist/assets/lit-element-UdLzEcH-.js +19 -0
  26. package/dist/assets/preview-BWzBA1C2.js +396 -0
  27. package/dist/assets/preview-CGiTbRot.js +2 -0
  28. package/dist/assets/preview-D77C14du.js +34 -0
  29. package/dist/assets/preview-DEMzn_yN.js +1 -0
  30. package/dist/assets/preview-DFmD0pui.js +1 -0
  31. package/dist/assets/preview-DGUiP6tS.js +7 -0
  32. package/dist/assets/preview-DQVTHjv1.js +182 -0
  33. package/dist/assets/preview-aVwhiz9X.js +1 -0
  34. package/dist/assets/tiny-invariant-CopsF_GD.js +1 -0
  35. package/dist/classes/BitArray.d.ts +11 -0
  36. package/dist/classes/DisposibleElement.d.ts +21 -0
  37. package/dist/components/Banner.d.ts +51 -0
  38. package/dist/components/Bitdisplay.d.ts +91 -0
  39. package/dist/components/Button.d.ts +65 -0
  40. package/dist/components/Header.d.ts +70 -0
  41. package/dist/components/Page.d.ts +93 -0
  42. package/dist/components/Panel.d.ts +14 -0
  43. package/dist/components/ThemeProvider.d.ts +99 -0
  44. package/dist/components/button.css.d.ts +2 -0
  45. package/dist/components/configurations/classifications.d.ts +29 -0
  46. package/dist/components/dialog/dialog.css.d.ts +1 -0
  47. package/dist/components/dialog/dialog.d.ts +60 -0
  48. package/dist/components/dialog/index.d.ts +1 -0
  49. package/dist/components/header.css.d.ts +2 -0
  50. package/dist/components/index.d.ts +10 -0
  51. package/dist/components/input.css.d.ts +2 -0
  52. package/dist/components/input.d.ts +156 -0
  53. package/dist/components/page.css.d.ts +2 -0
  54. package/dist/components/panel.css.d.ts +2 -0
  55. package/dist/components/query_bar/QueryBar.d.ts +108 -0
  56. package/dist/components/query_bar/index.d.ts +2 -0
  57. package/dist/components/query_bar/querylanguage/kuery/ast/ast.d.ts +13 -0
  58. package/dist/components/query_bar/querylanguage/kuery/ast/index.d.ts +1 -0
  59. package/dist/components/query_bar/querylanguage/kuery/functions/and.d.ts +9 -0
  60. package/dist/components/query_bar/querylanguage/kuery/functions/exists.d.ts +10 -0
  61. package/dist/components/query_bar/querylanguage/kuery/functions/index.d.ts +1 -0
  62. package/dist/components/query_bar/querylanguage/kuery/functions/is.d.ts +34 -0
  63. package/dist/components/query_bar/querylanguage/kuery/functions/nested.d.ts +11 -0
  64. package/dist/components/query_bar/querylanguage/kuery/functions/not.d.ts +9 -0
  65. package/dist/components/query_bar/querylanguage/kuery/functions/or.d.ts +10 -0
  66. package/dist/components/query_bar/querylanguage/kuery/functions/range.d.ts +10 -0
  67. package/dist/components/query_bar/querylanguage/kuery/functions/utils/get_fields.d.ts +2 -0
  68. package/dist/components/query_bar/querylanguage/kuery/functions/utils/get_full_field_name_node.d.ts +2 -0
  69. package/dist/components/query_bar/querylanguage/kuery/index.d.ts +7 -0
  70. package/dist/components/query_bar/querylanguage/kuery/kuery_syntax_error.d.ts +13 -0
  71. package/dist/components/query_bar/querylanguage/kuery/node_types/function.d.ts +5 -0
  72. package/dist/components/query_bar/querylanguage/kuery/node_types/index.d.ts +3 -0
  73. package/dist/components/query_bar/querylanguage/kuery/node_types/literal.d.ts +3 -0
  74. package/dist/components/query_bar/querylanguage/kuery/node_types/named_arg.d.ts +4 -0
  75. package/dist/components/query_bar/querylanguage/kuery/node_types/types.d.ts +49 -0
  76. package/dist/components/query_bar/querylanguage/kuery/node_types/wildcard.d.ts +8 -0
  77. package/dist/components/query_bar/querylanguage/kuery/types.d.ts +18 -0
  78. package/dist/components/query_bar/querylanguage/outputTypes/toCQL.d.ts +14 -0
  79. package/dist/components/query_bar/querylanguage/outputTypes/toMongo.d.ts +20 -0
  80. package/dist/components/query_bar/querylanguage/utils.d.ts +1 -0
  81. package/dist/components/query_bar/types.d.ts +56 -0
  82. package/dist/components/splitview/index.d.ts +1 -0
  83. package/dist/components/splitview/splitview.css.d.ts +1 -0
  84. package/dist/components/splitview/splitview.d.ts +73 -0
  85. package/dist/components/types.d.ts +21 -0
  86. package/dist/custom-elements.json +1915 -0
  87. package/dist/favicon.svg +1 -0
  88. package/dist/iframe.html +639 -0
  89. package/dist/index.d.ts +1 -0
  90. package/dist/index.es.js +4136 -0
  91. package/dist/index.es.js.map +1 -0
  92. package/dist/index.html +190 -0
  93. package/dist/index.json +1 -0
  94. package/dist/index.umd.js +945 -0
  95. package/dist/index.umd.js.map +1 -0
  96. package/dist/nunito-sans-bold-italic.woff2 +0 -0
  97. package/dist/nunito-sans-bold.woff2 +0 -0
  98. package/dist/nunito-sans-italic.woff2 +0 -0
  99. package/dist/nunito-sans-regular.woff2 +0 -0
  100. package/dist/project.json +1 -0
  101. package/dist/sb-addons/chromatic-com-storybook-8/manager-bundle.js +333 -0
  102. package/dist/sb-addons/chromatic-com-storybook-8/manager-bundle.js.LEGAL.txt +40 -0
  103. package/dist/sb-addons/essentials-actions-2/manager-bundle.js +3 -0
  104. package/dist/sb-addons/essentials-actions-2/manager-bundle.js.LEGAL.txt +0 -0
  105. package/dist/sb-addons/essentials-backgrounds-3/manager-bundle.js +12 -0
  106. package/dist/sb-addons/essentials-backgrounds-3/manager-bundle.js.LEGAL.txt +0 -0
  107. package/dist/sb-addons/essentials-controls-1/manager-bundle.js +391 -0
  108. package/dist/sb-addons/essentials-controls-1/manager-bundle.js.LEGAL.txt +0 -0
  109. package/dist/sb-addons/essentials-measure-6/manager-bundle.js +3 -0
  110. package/dist/sb-addons/essentials-measure-6/manager-bundle.js.LEGAL.txt +0 -0
  111. package/dist/sb-addons/essentials-outline-7/manager-bundle.js +3 -0
  112. package/dist/sb-addons/essentials-outline-7/manager-bundle.js.LEGAL.txt +0 -0
  113. package/dist/sb-addons/essentials-toolbars-5/manager-bundle.js +3 -0
  114. package/dist/sb-addons/essentials-toolbars-5/manager-bundle.js.LEGAL.txt +0 -0
  115. package/dist/sb-addons/essentials-viewport-4/manager-bundle.js +3 -0
  116. package/dist/sb-addons/essentials-viewport-4/manager-bundle.js.LEGAL.txt +0 -0
  117. package/dist/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +3 -0
  118. package/dist/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js.LEGAL.txt +0 -0
  119. package/dist/sb-common-assets/favicon.svg +1 -0
  120. package/dist/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
  121. package/dist/sb-common-assets/nunito-sans-bold.woff2 +0 -0
  122. package/dist/sb-common-assets/nunito-sans-italic.woff2 +0 -0
  123. package/dist/sb-common-assets/nunito-sans-regular.woff2 +0 -0
  124. package/dist/sb-manager/globals-module-info.js +1028 -0
  125. package/dist/sb-manager/globals-runtime.js +40861 -0
  126. package/dist/sb-manager/globals.js +48 -0
  127. package/dist/sb-manager/runtime.js +13338 -0
  128. package/dist/sb-preview/globals.js +33 -0
  129. package/dist/sb-preview/runtime.js +7174 -0
  130. package/dist/style.css +1 -0
  131. package/dist/utils/debounce.d.ts +2 -0
  132. package/dist/utils/spread.d.ts +32 -0
  133. package/package.json +6 -1
  134. package/.gitlab-ci.yml +0 -28
  135. package/.nvmrc +0 -1
  136. package/.storybook/analyze.sh +0 -4
  137. package/.storybook/main.ts +0 -55
  138. package/.storybook/preview.ts +0 -42
  139. package/.vscode/extensions.json +0 -5
  140. package/.vscode/settings.json +0 -41
  141. package/html-include.png +0 -0
  142. package/test/__init__.py +0 -9
  143. package/test/elastic.py +0 -9
  144. package/test/interface.py +0 -16
  145. package/tsconfig.json +0 -29
  146. package/vite.config.js +0 -34
  147. package/vue-example.png +0 -0
  148. package/vue-include.png +0 -0
@@ -0,0 +1,4136 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */
6
+ const lt = globalThis, Xt = lt.ShadowRoot && (lt.ShadyCSS === void 0 || lt.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Gt = Symbol(), fs = /* @__PURE__ */ new WeakMap();
7
+ let Es = class {
8
+ constructor(r, o, i) {
9
+ if (this._$cssResult$ = !0, i !== Gt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
10
+ this.cssText = r, this.t = o;
11
+ }
12
+ get styleSheet() {
13
+ let r = this.o;
14
+ const o = this.t;
15
+ if (Xt && r === void 0) {
16
+ const i = o !== void 0 && o.length === 1;
17
+ i && (r = fs.get(o)), r === void 0 && ((this.o = r = new CSSStyleSheet()).replaceSync(this.cssText), i && fs.set(o, r));
18
+ }
19
+ return r;
20
+ }
21
+ toString() {
22
+ return this.cssText;
23
+ }
24
+ };
25
+ const Lo = (s) => new Es(typeof s == "string" ? s : s + "", void 0, Gt), K = (s, ...r) => {
26
+ const o = s.length === 1 ? s[0] : r.reduce((i, c, t) => i + ((p) => {
27
+ if (p._$cssResult$ === !0) return p.cssText;
28
+ if (typeof p == "number") return p;
29
+ 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.");
30
+ })(c) + s[t + 1], s[0]);
31
+ return new Es(o, s, Gt);
32
+ }, No = (s, r) => {
33
+ if (Xt) s.adoptedStyleSheets = r.map((o) => o instanceof CSSStyleSheet ? o : o.styleSheet);
34
+ else for (const o of r) {
35
+ const i = document.createElement("style"), c = lt.litNonce;
36
+ c !== void 0 && i.setAttribute("nonce", c), i.textContent = o.cssText, s.appendChild(i);
37
+ }
38
+ }, hs = Xt ? (s) => s : (s) => s instanceof CSSStyleSheet ? ((r) => {
39
+ let o = "";
40
+ for (const i of r.cssRules) o += i.cssText;
41
+ return Lo(o);
42
+ })(s) : s;
43
+ /**
44
+ * @license
45
+ * Copyright 2017 Google LLC
46
+ * SPDX-License-Identifier: BSD-3-Clause
47
+ */
48
+ const { is: Do, defineProperty: jo, getOwnPropertyDescriptor: Ro, getOwnPropertyNames: Bo, getOwnPropertySymbols: Uo, getPrototypeOf: Mo } = Object, oe = globalThis, bs = oe.trustedTypes, zo = bs ? bs.emptyScript : "", zt = oe.reactiveElementPolyfillSupport, Ue = (s, r) => s, dt = { toAttribute(s, r) {
49
+ switch (r) {
50
+ case Boolean:
51
+ s = s ? zo : null;
52
+ break;
53
+ case Object:
54
+ case Array:
55
+ s = s == null ? s : JSON.stringify(s);
56
+ }
57
+ return s;
58
+ }, fromAttribute(s, r) {
59
+ let o = s;
60
+ switch (r) {
61
+ case Boolean:
62
+ o = s !== null;
63
+ break;
64
+ case Number:
65
+ o = s === null ? null : Number(s);
66
+ break;
67
+ case Object:
68
+ case Array:
69
+ try {
70
+ o = JSON.parse(s);
71
+ } catch {
72
+ o = null;
73
+ }
74
+ }
75
+ return o;
76
+ } }, Jt = (s, r) => !Do(s, r), gs = { attribute: !0, type: String, converter: dt, reflect: !1, hasChanged: Jt };
77
+ Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), oe.litPropertyMetadata ?? (oe.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
78
+ class ke extends HTMLElement {
79
+ static addInitializer(r) {
80
+ this._$Ei(), (this.l ?? (this.l = [])).push(r);
81
+ }
82
+ static get observedAttributes() {
83
+ return this.finalize(), this._$Eh && [...this._$Eh.keys()];
84
+ }
85
+ static createProperty(r, o = gs) {
86
+ if (o.state && (o.attribute = !1), this._$Ei(), this.elementProperties.set(r, o), !o.noAccessor) {
87
+ const i = Symbol(), c = this.getPropertyDescriptor(r, i, o);
88
+ c !== void 0 && jo(this.prototype, r, c);
89
+ }
90
+ }
91
+ static getPropertyDescriptor(r, o, i) {
92
+ const { get: c, set: t } = Ro(this.prototype, r) ?? { get() {
93
+ return this[o];
94
+ }, set(p) {
95
+ this[o] = p;
96
+ } };
97
+ return { get() {
98
+ return c == null ? void 0 : c.call(this);
99
+ }, set(p) {
100
+ const b = c == null ? void 0 : c.call(this);
101
+ t.call(this, p), this.requestUpdate(r, b, i);
102
+ }, configurable: !0, enumerable: !0 };
103
+ }
104
+ static getPropertyOptions(r) {
105
+ return this.elementProperties.get(r) ?? gs;
106
+ }
107
+ static _$Ei() {
108
+ if (this.hasOwnProperty(Ue("elementProperties"))) return;
109
+ const r = Mo(this);
110
+ r.finalize(), r.l !== void 0 && (this.l = [...r.l]), this.elementProperties = new Map(r.elementProperties);
111
+ }
112
+ static finalize() {
113
+ if (this.hasOwnProperty(Ue("finalized"))) return;
114
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(Ue("properties"))) {
115
+ const o = this.properties, i = [...Bo(o), ...Uo(o)];
116
+ for (const c of i) this.createProperty(c, o[c]);
117
+ }
118
+ const r = this[Symbol.metadata];
119
+ if (r !== null) {
120
+ const o = litPropertyMetadata.get(r);
121
+ if (o !== void 0) for (const [i, c] of o) this.elementProperties.set(i, c);
122
+ }
123
+ this._$Eh = /* @__PURE__ */ new Map();
124
+ for (const [o, i] of this.elementProperties) {
125
+ const c = this._$Eu(o, i);
126
+ c !== void 0 && this._$Eh.set(c, o);
127
+ }
128
+ this.elementStyles = this.finalizeStyles(this.styles);
129
+ }
130
+ static finalizeStyles(r) {
131
+ const o = [];
132
+ if (Array.isArray(r)) {
133
+ const i = new Set(r.flat(1 / 0).reverse());
134
+ for (const c of i) o.unshift(hs(c));
135
+ } else r !== void 0 && o.push(hs(r));
136
+ return o;
137
+ }
138
+ static _$Eu(r, o) {
139
+ const i = o.attribute;
140
+ return i === !1 ? void 0 : typeof i == "string" ? i : typeof r == "string" ? r.toLowerCase() : void 0;
141
+ }
142
+ constructor() {
143
+ super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
144
+ }
145
+ _$Ev() {
146
+ var r;
147
+ this._$ES = new Promise((o) => this.enableUpdating = o), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (r = this.constructor.l) == null || r.forEach((o) => o(this));
148
+ }
149
+ addController(r) {
150
+ var o;
151
+ (this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(r), this.renderRoot !== void 0 && this.isConnected && ((o = r.hostConnected) == null || o.call(r));
152
+ }
153
+ removeController(r) {
154
+ var o;
155
+ (o = this._$EO) == null || o.delete(r);
156
+ }
157
+ _$E_() {
158
+ const r = /* @__PURE__ */ new Map(), o = this.constructor.elementProperties;
159
+ for (const i of o.keys()) this.hasOwnProperty(i) && (r.set(i, this[i]), delete this[i]);
160
+ r.size > 0 && (this._$Ep = r);
161
+ }
162
+ createRenderRoot() {
163
+ const r = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
164
+ return No(r, this.constructor.elementStyles), r;
165
+ }
166
+ connectedCallback() {
167
+ var r;
168
+ this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (r = this._$EO) == null || r.forEach((o) => {
169
+ var i;
170
+ return (i = o.hostConnected) == null ? void 0 : i.call(o);
171
+ });
172
+ }
173
+ enableUpdating(r) {
174
+ }
175
+ disconnectedCallback() {
176
+ var r;
177
+ (r = this._$EO) == null || r.forEach((o) => {
178
+ var i;
179
+ return (i = o.hostDisconnected) == null ? void 0 : i.call(o);
180
+ });
181
+ }
182
+ attributeChangedCallback(r, o, i) {
183
+ this._$AK(r, i);
184
+ }
185
+ _$EC(r, o) {
186
+ var t;
187
+ const i = this.constructor.elementProperties.get(r), c = this.constructor._$Eu(r, i);
188
+ if (c !== void 0 && i.reflect === !0) {
189
+ const p = (((t = i.converter) == null ? void 0 : t.toAttribute) !== void 0 ? i.converter : dt).toAttribute(o, i.type);
190
+ this._$Em = r, p == null ? this.removeAttribute(c) : this.setAttribute(c, p), this._$Em = null;
191
+ }
192
+ }
193
+ _$AK(r, o) {
194
+ var t;
195
+ const i = this.constructor, c = i._$Eh.get(r);
196
+ if (c !== void 0 && this._$Em !== c) {
197
+ const p = i.getPropertyOptions(c), b = typeof p.converter == "function" ? { fromAttribute: p.converter } : ((t = p.converter) == null ? void 0 : t.fromAttribute) !== void 0 ? p.converter : dt;
198
+ this._$Em = c, this[c] = b.fromAttribute(o, p.type), this._$Em = null;
199
+ }
200
+ }
201
+ requestUpdate(r, o, i) {
202
+ if (r !== void 0) {
203
+ if (i ?? (i = this.constructor.getPropertyOptions(r)), !(i.hasChanged ?? Jt)(this[r], o)) return;
204
+ this.P(r, o, i);
205
+ }
206
+ this.isUpdatePending === !1 && (this._$ES = this._$ET());
207
+ }
208
+ P(r, o, i) {
209
+ this._$AL.has(r) || this._$AL.set(r, o), i.reflect === !0 && this._$Em !== r && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(r);
210
+ }
211
+ async _$ET() {
212
+ this.isUpdatePending = !0;
213
+ try {
214
+ await this._$ES;
215
+ } catch (o) {
216
+ Promise.reject(o);
217
+ }
218
+ const r = this.scheduleUpdate();
219
+ return r != null && await r, !this.isUpdatePending;
220
+ }
221
+ scheduleUpdate() {
222
+ return this.performUpdate();
223
+ }
224
+ performUpdate() {
225
+ var i;
226
+ if (!this.isUpdatePending) return;
227
+ if (!this.hasUpdated) {
228
+ if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
229
+ for (const [t, p] of this._$Ep) this[t] = p;
230
+ this._$Ep = void 0;
231
+ }
232
+ const c = this.constructor.elementProperties;
233
+ if (c.size > 0) for (const [t, p] of c) p.wrapped !== !0 || this._$AL.has(t) || this[t] === void 0 || this.P(t, this[t], p);
234
+ }
235
+ let r = !1;
236
+ const o = this._$AL;
237
+ try {
238
+ r = this.shouldUpdate(o), r ? (this.willUpdate(o), (i = this._$EO) == null || i.forEach((c) => {
239
+ var t;
240
+ return (t = c.hostUpdate) == null ? void 0 : t.call(c);
241
+ }), this.update(o)) : this._$EU();
242
+ } catch (c) {
243
+ throw r = !1, this._$EU(), c;
244
+ }
245
+ r && this._$AE(o);
246
+ }
247
+ willUpdate(r) {
248
+ }
249
+ _$AE(r) {
250
+ var o;
251
+ (o = this._$EO) == null || o.forEach((i) => {
252
+ var c;
253
+ return (c = i.hostUpdated) == null ? void 0 : c.call(i);
254
+ }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(r)), this.updated(r);
255
+ }
256
+ _$EU() {
257
+ this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
258
+ }
259
+ get updateComplete() {
260
+ return this.getUpdateComplete();
261
+ }
262
+ getUpdateComplete() {
263
+ return this._$ES;
264
+ }
265
+ shouldUpdate(r) {
266
+ return !0;
267
+ }
268
+ update(r) {
269
+ this._$Ej && (this._$Ej = this._$Ej.forEach((o) => this._$EC(o, this[o]))), this._$EU();
270
+ }
271
+ updated(r) {
272
+ }
273
+ firstUpdated(r) {
274
+ }
275
+ }
276
+ ke.elementStyles = [], ke.shadowRootOptions = { mode: "open" }, ke[Ue("elementProperties")] = /* @__PURE__ */ new Map(), ke[Ue("finalized")] = /* @__PURE__ */ new Map(), zt == null || zt({ ReactiveElement: ke }), (oe.reactiveElementVersions ?? (oe.reactiveElementVersions = [])).push("2.0.4");
277
+ /**
278
+ * @license
279
+ * Copyright 2017 Google LLC
280
+ * SPDX-License-Identifier: BSD-3-Clause
281
+ */
282
+ const Me = globalThis, ft = Me.trustedTypes, vs = ft ? ft.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, Os = "$lit$", ie = `lit$${Math.random().toFixed(9).slice(2)}$`, Ts = "?" + ie, Fo = `<${Ts}>`, de = document, Fe = () => de.createComment(""), Qe = (s) => s === null || typeof s != "object" && typeof s != "function", Vt = Array.isArray, Qo = (s) => Vt(s) || typeof (s == null ? void 0 : s[Symbol.iterator]) == "function", Ft = `[
283
+ \f\r]`, Be = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ys = /-->/g, ms = />/g, ue = RegExp(`>|${Ft}(?:([^\\s"'>=/]+)(${Ft}*=${Ft}*(?:[^
284
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), $s = /'/g, _s = /"/g, Ps = /^(?:script|style|textarea|title)$/i, Io = (s) => (r, ...o) => ({ _$litType$: s, strings: r, values: o }), A = Io(1), fe = Symbol.for("lit-noChange"), C = Symbol.for("lit-nothing"), ws = /* @__PURE__ */ new WeakMap(), pe = de.createTreeWalker(de, 129);
285
+ function Ls(s, r) {
286
+ if (!Vt(s) || !s.hasOwnProperty("raw")) throw Error("invalid template strings array");
287
+ return vs !== void 0 ? vs.createHTML(r) : r;
288
+ }
289
+ const Ho = (s, r) => {
290
+ const o = s.length - 1, i = [];
291
+ let c, t = r === 2 ? "<svg>" : r === 3 ? "<math>" : "", p = Be;
292
+ for (let b = 0; b < o; b++) {
293
+ const g = s[b];
294
+ let w, x, _ = -1, k = 0;
295
+ for (; k < g.length && (p.lastIndex = k, x = p.exec(g), x !== null); ) k = p.lastIndex, p === Be ? x[1] === "!--" ? p = ys : x[1] !== void 0 ? p = ms : x[2] !== void 0 ? (Ps.test(x[2]) && (c = RegExp("</" + x[2], "g")), p = ue) : x[3] !== void 0 && (p = ue) : p === ue ? x[0] === ">" ? (p = c ?? Be, _ = -1) : x[1] === void 0 ? _ = -2 : (_ = p.lastIndex - x[2].length, w = x[1], p = x[3] === void 0 ? ue : x[3] === '"' ? _s : $s) : p === _s || p === $s ? p = ue : p === ys || p === ms ? p = Be : (p = ue, c = void 0);
296
+ const S = p === ue && s[b + 1].startsWith("/>") ? " " : "";
297
+ t += p === Be ? g + Fo : _ >= 0 ? (i.push(w), g.slice(0, _) + Os + g.slice(_) + ie + S) : g + ie + (_ === -2 ? b : S);
298
+ }
299
+ return [Ls(s, t + (s[o] || "<?>") + (r === 2 ? "</svg>" : r === 3 ? "</math>" : "")), i];
300
+ };
301
+ class Ie {
302
+ constructor({ strings: r, _$litType$: o }, i) {
303
+ let c;
304
+ this.parts = [];
305
+ let t = 0, p = 0;
306
+ const b = r.length - 1, g = this.parts, [w, x] = Ho(r, o);
307
+ if (this.el = Ie.createElement(w, i), pe.currentNode = this.el.content, o === 2 || o === 3) {
308
+ const _ = this.el.content.firstChild;
309
+ _.replaceWith(..._.childNodes);
310
+ }
311
+ for (; (c = pe.nextNode()) !== null && g.length < b; ) {
312
+ if (c.nodeType === 1) {
313
+ if (c.hasAttributes()) for (const _ of c.getAttributeNames()) if (_.endsWith(Os)) {
314
+ const k = x[p++], S = c.getAttribute(_).split(ie), j = /([.?@])?(.*)/.exec(k);
315
+ g.push({ type: 1, index: t, name: j[2], strings: S, ctor: j[1] === "." ? Wo : j[1] === "?" ? Yo : j[1] === "@" ? Ko : yt }), c.removeAttribute(_);
316
+ } else _.startsWith(ie) && (g.push({ type: 6, index: t }), c.removeAttribute(_));
317
+ if (Ps.test(c.tagName)) {
318
+ const _ = c.textContent.split(ie), k = _.length - 1;
319
+ if (k > 0) {
320
+ c.textContent = ft ? ft.emptyScript : "";
321
+ for (let S = 0; S < k; S++) c.append(_[S], Fe()), pe.nextNode(), g.push({ type: 2, index: ++t });
322
+ c.append(_[k], Fe());
323
+ }
324
+ }
325
+ } else if (c.nodeType === 8) if (c.data === Ts) g.push({ type: 2, index: t });
326
+ else {
327
+ let _ = -1;
328
+ for (; (_ = c.data.indexOf(ie, _ + 1)) !== -1; ) g.push({ type: 7, index: t }), _ += ie.length - 1;
329
+ }
330
+ t++;
331
+ }
332
+ }
333
+ static createElement(r, o) {
334
+ const i = de.createElement("template");
335
+ return i.innerHTML = r, i;
336
+ }
337
+ }
338
+ function Ce(s, r, o = s, i) {
339
+ var p, b;
340
+ if (r === fe) return r;
341
+ let c = i !== void 0 ? (p = o._$Co) == null ? void 0 : p[i] : o._$Cl;
342
+ const t = Qe(r) ? void 0 : r._$litDirective$;
343
+ return (c == null ? void 0 : c.constructor) !== t && ((b = c == null ? void 0 : c._$AO) == null || b.call(c, !1), t === void 0 ? c = void 0 : (c = new t(s), c._$AT(s, o, i)), i !== void 0 ? (o._$Co ?? (o._$Co = []))[i] = c : o._$Cl = c), c !== void 0 && (r = Ce(s, c._$AS(s, r.values), c, i)), r;
344
+ }
345
+ class qo {
346
+ constructor(r, o) {
347
+ this._$AV = [], this._$AN = void 0, this._$AD = r, this._$AM = o;
348
+ }
349
+ get parentNode() {
350
+ return this._$AM.parentNode;
351
+ }
352
+ get _$AU() {
353
+ return this._$AM._$AU;
354
+ }
355
+ u(r) {
356
+ const { el: { content: o }, parts: i } = this._$AD, c = ((r == null ? void 0 : r.creationScope) ?? de).importNode(o, !0);
357
+ pe.currentNode = c;
358
+ let t = pe.nextNode(), p = 0, b = 0, g = i[0];
359
+ for (; g !== void 0; ) {
360
+ if (p === g.index) {
361
+ let w;
362
+ g.type === 2 ? w = new qe(t, t.nextSibling, this, r) : g.type === 1 ? w = new g.ctor(t, g.name, g.strings, this, r) : g.type === 6 && (w = new Zo(t, this, r)), this._$AV.push(w), g = i[++b];
363
+ }
364
+ p !== (g == null ? void 0 : g.index) && (t = pe.nextNode(), p++);
365
+ }
366
+ return pe.currentNode = de, c;
367
+ }
368
+ p(r) {
369
+ let o = 0;
370
+ for (const i of this._$AV) i !== void 0 && (i.strings !== void 0 ? (i._$AI(r, i, o), o += i.strings.length - 2) : i._$AI(r[o])), o++;
371
+ }
372
+ }
373
+ class qe {
374
+ get _$AU() {
375
+ var r;
376
+ return ((r = this._$AM) == null ? void 0 : r._$AU) ?? this._$Cv;
377
+ }
378
+ constructor(r, o, i, c) {
379
+ this.type = 2, this._$AH = C, this._$AN = void 0, this._$AA = r, this._$AB = o, this._$AM = i, this.options = c, this._$Cv = (c == null ? void 0 : c.isConnected) ?? !0;
380
+ }
381
+ get parentNode() {
382
+ let r = this._$AA.parentNode;
383
+ const o = this._$AM;
384
+ return o !== void 0 && (r == null ? void 0 : r.nodeType) === 11 && (r = o.parentNode), r;
385
+ }
386
+ get startNode() {
387
+ return this._$AA;
388
+ }
389
+ get endNode() {
390
+ return this._$AB;
391
+ }
392
+ _$AI(r, o = this) {
393
+ r = Ce(this, r, o), Qe(r) ? r === C || r == null || r === "" ? (this._$AH !== C && this._$AR(), this._$AH = C) : r !== this._$AH && r !== fe && this._(r) : r._$litType$ !== void 0 ? this.$(r) : r.nodeType !== void 0 ? this.T(r) : Qo(r) ? this.k(r) : this._(r);
394
+ }
395
+ O(r) {
396
+ return this._$AA.parentNode.insertBefore(r, this._$AB);
397
+ }
398
+ T(r) {
399
+ this._$AH !== r && (this._$AR(), this._$AH = this.O(r));
400
+ }
401
+ _(r) {
402
+ this._$AH !== C && Qe(this._$AH) ? this._$AA.nextSibling.data = r : this.T(de.createTextNode(r)), this._$AH = r;
403
+ }
404
+ $(r) {
405
+ var t;
406
+ const { values: o, _$litType$: i } = r, c = typeof i == "number" ? this._$AC(r) : (i.el === void 0 && (i.el = Ie.createElement(Ls(i.h, i.h[0]), this.options)), i);
407
+ if (((t = this._$AH) == null ? void 0 : t._$AD) === c) this._$AH.p(o);
408
+ else {
409
+ const p = new qo(c, this), b = p.u(this.options);
410
+ p.p(o), this.T(b), this._$AH = p;
411
+ }
412
+ }
413
+ _$AC(r) {
414
+ let o = ws.get(r.strings);
415
+ return o === void 0 && ws.set(r.strings, o = new Ie(r)), o;
416
+ }
417
+ k(r) {
418
+ Vt(this._$AH) || (this._$AH = [], this._$AR());
419
+ const o = this._$AH;
420
+ let i, c = 0;
421
+ for (const t of r) c === o.length ? o.push(i = new qe(this.O(Fe()), this.O(Fe()), this, this.options)) : i = o[c], i._$AI(t), c++;
422
+ c < o.length && (this._$AR(i && i._$AB.nextSibling, c), o.length = c);
423
+ }
424
+ _$AR(r = this._$AA.nextSibling, o) {
425
+ var i;
426
+ for ((i = this._$AP) == null ? void 0 : i.call(this, !1, !0, o); r && r !== this._$AB; ) {
427
+ const c = r.nextSibling;
428
+ r.remove(), r = c;
429
+ }
430
+ }
431
+ setConnected(r) {
432
+ var o;
433
+ this._$AM === void 0 && (this._$Cv = r, (o = this._$AP) == null || o.call(this, r));
434
+ }
435
+ }
436
+ class yt {
437
+ get tagName() {
438
+ return this.element.tagName;
439
+ }
440
+ get _$AU() {
441
+ return this._$AM._$AU;
442
+ }
443
+ constructor(r, o, i, c, t) {
444
+ this.type = 1, this._$AH = C, this._$AN = void 0, this.element = r, this.name = o, this._$AM = c, this.options = t, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = C;
445
+ }
446
+ _$AI(r, o = this, i, c) {
447
+ const t = this.strings;
448
+ let p = !1;
449
+ if (t === void 0) r = Ce(this, r, o, 0), p = !Qe(r) || r !== this._$AH && r !== fe, p && (this._$AH = r);
450
+ else {
451
+ const b = r;
452
+ let g, w;
453
+ for (r = t[0], g = 0; g < t.length - 1; g++) w = Ce(this, b[i + g], o, g), w === fe && (w = this._$AH[g]), p || (p = !Qe(w) || w !== this._$AH[g]), w === C ? r = C : r !== C && (r += (w ?? "") + t[g + 1]), this._$AH[g] = w;
454
+ }
455
+ p && !c && this.j(r);
456
+ }
457
+ j(r) {
458
+ r === C ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, r ?? "");
459
+ }
460
+ }
461
+ class Wo extends yt {
462
+ constructor() {
463
+ super(...arguments), this.type = 3;
464
+ }
465
+ j(r) {
466
+ this.element[this.name] = r === C ? void 0 : r;
467
+ }
468
+ }
469
+ class Yo extends yt {
470
+ constructor() {
471
+ super(...arguments), this.type = 4;
472
+ }
473
+ j(r) {
474
+ this.element.toggleAttribute(this.name, !!r && r !== C);
475
+ }
476
+ }
477
+ class Ko extends yt {
478
+ constructor(r, o, i, c, t) {
479
+ super(r, o, i, c, t), this.type = 5;
480
+ }
481
+ _$AI(r, o = this) {
482
+ if ((r = Ce(this, r, o, 0) ?? C) === fe) return;
483
+ const i = this._$AH, c = r === C && i !== C || r.capture !== i.capture || r.once !== i.once || r.passive !== i.passive, t = r !== C && (i === C || c);
484
+ c && this.element.removeEventListener(this.name, this, i), t && this.element.addEventListener(this.name, this, r), this._$AH = r;
485
+ }
486
+ handleEvent(r) {
487
+ var o;
488
+ typeof this._$AH == "function" ? this._$AH.call(((o = this.options) == null ? void 0 : o.host) ?? this.element, r) : this._$AH.handleEvent(r);
489
+ }
490
+ }
491
+ class Zo {
492
+ constructor(r, o, i) {
493
+ this.element = r, this.type = 6, this._$AN = void 0, this._$AM = o, this.options = i;
494
+ }
495
+ get _$AU() {
496
+ return this._$AM._$AU;
497
+ }
498
+ _$AI(r) {
499
+ Ce(this, r);
500
+ }
501
+ }
502
+ const Qt = Me.litHtmlPolyfillSupport;
503
+ Qt == null || Qt(Ie, qe), (Me.litHtmlVersions ?? (Me.litHtmlVersions = [])).push("3.2.1");
504
+ const Ns = (s, r, o) => {
505
+ const i = (o == null ? void 0 : o.renderBefore) ?? r;
506
+ let c = i._$litPart$;
507
+ if (c === void 0) {
508
+ const t = (o == null ? void 0 : o.renderBefore) ?? null;
509
+ i._$litPart$ = c = new qe(r.insertBefore(Fe(), t), t, void 0, o ?? {});
510
+ }
511
+ return c._$AI(s), c;
512
+ };
513
+ /**
514
+ * @license
515
+ * Copyright 2017 Google LLC
516
+ * SPDX-License-Identifier: BSD-3-Clause
517
+ */
518
+ let L = class extends ke {
519
+ constructor() {
520
+ super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
521
+ }
522
+ createRenderRoot() {
523
+ var o;
524
+ const r = super.createRenderRoot();
525
+ return (o = this.renderOptions).renderBefore ?? (o.renderBefore = r.firstChild), r;
526
+ }
527
+ update(r) {
528
+ const o = this.render();
529
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(r), this._$Do = Ns(o, this.renderRoot, this.renderOptions);
530
+ }
531
+ connectedCallback() {
532
+ var r;
533
+ super.connectedCallback(), (r = this._$Do) == null || r.setConnected(!0);
534
+ }
535
+ disconnectedCallback() {
536
+ var r;
537
+ super.disconnectedCallback(), (r = this._$Do) == null || r.setConnected(!1);
538
+ }
539
+ render() {
540
+ return fe;
541
+ }
542
+ };
543
+ var Cs;
544
+ L._$litElement$ = !0, L.finalized = !0, (Cs = globalThis.litElementHydrateSupport) == null || Cs.call(globalThis, { LitElement: L });
545
+ const It = globalThis.litElementPolyfillSupport;
546
+ It == null || It({ LitElement: L });
547
+ (globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.1.1");
548
+ /**
549
+ * @license
550
+ * Copyright 2017 Google LLC
551
+ * SPDX-License-Identifier: BSD-3-Clause
552
+ */
553
+ const Ds = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 }, er = (s) => (...r) => ({ _$litDirective$: s, values: r });
554
+ let js = class {
555
+ constructor(r) {
556
+ }
557
+ get _$AU() {
558
+ return this._$AM._$AU;
559
+ }
560
+ _$AT(r, o, i) {
561
+ this._$Ct = r, this._$AM = o, this._$Ci = i;
562
+ }
563
+ _$AS(r, o) {
564
+ return this.update(r, o);
565
+ }
566
+ update(r, o) {
567
+ return this.render(...o);
568
+ }
569
+ };
570
+ /**
571
+ * @license
572
+ * Copyright 2018 Google LLC
573
+ * SPDX-License-Identifier: BSD-3-Clause
574
+ */
575
+ const Rs = "important", Xo = " !" + Rs, Bs = er(class extends js {
576
+ constructor(s) {
577
+ var r;
578
+ if (super(s), s.type !== Ds.ATTRIBUTE || s.name !== "style" || ((r = s.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.");
579
+ }
580
+ render(s) {
581
+ return Object.keys(s).reduce((r, o) => {
582
+ const i = s[o];
583
+ return i == null ? r : r + `${o = o.includes("-") ? o : o.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase()}:${i};`;
584
+ }, "");
585
+ }
586
+ update(s, [r]) {
587
+ const { style: o } = s.element;
588
+ if (this.ft === void 0) return this.ft = new Set(Object.keys(r)), this.render(r);
589
+ for (const i of this.ft) r[i] == null && (this.ft.delete(i), i.includes("-") ? o.removeProperty(i) : o[i] = null);
590
+ for (const i in r) {
591
+ const c = r[i];
592
+ if (c != null) {
593
+ this.ft.add(i);
594
+ const t = typeof c == "string" && c.endsWith(Xo);
595
+ i.includes("-") || t ? o.setProperty(i, t ? c.slice(0, -11) : c, t ? Rs : "") : o[i] = c;
596
+ }
597
+ }
598
+ return fe;
599
+ }
600
+ }), Go = K`
601
+ :host{
602
+ display: inline-block;
603
+ --text-on-color: var(--spectric-text-on-color, #ffffff);
604
+ --text-on-color-disabled: var(--spectric-text-on-color-disabled, #8d8d8d);
605
+ --text-placeholder: var(--spectric-text-placeholder, rgba(22, 22, 22, 0.4));
606
+ --text-primary: var(--spectric-text-primary, #161616);
607
+ --text-secondary: var(--spectric-text-secondary, #525252);
608
+ --button-border-radius: var(--spectric-border-radius,.4em);
609
+ --button-separator: var(--spectric-button-separator, #e0e0e0);
610
+ --button-primary: var(--spectric-button-primary,#1ea7fd);
611
+ --button-secondary: var(--spectric-button-secondary, #77878b);
612
+ --button-tertiary: var(--spectric-button-tertiary, #0f62fe);
613
+ --button-danger-primary: var(--spectric-button-danger-primary, #da1e28);
614
+ --button-danger-secondary: var(--spectric-button-danger-secondary, #da1e28);
615
+ --button-danger-active: var(--spectric-button-danger-active, #750e13);
616
+ --button-primary-active: var(--spectric-button-primary-active, #002d9c);
617
+ --button-secondary-active: var(--spectric-button-secondary-active, #6f6f6f);
618
+ --button-tertiary-active: var(--spectric-button-tertiary-active, #002d9c);
619
+ --button-danger-hover: var(--spectric-button-danger-hover, #b81921);
620
+ --button-primary-hover: var(--spectric-button-primary-hover, #0050e6);
621
+ --button-secondary-hover: var(--spectric-button-secondary-hover, #474747);
622
+ --button-tertiary-hover: var(--spectric-button-tertiary-hover, #0050e6);
623
+ --button-disabled: var(--spectric-button-disabled, #c6c6c6);
624
+ }
625
+ :host([disabled]) { pointer-events: none }
626
+
627
+ .spectric-button {
628
+ pointer-events:none;
629
+ position: relative;
630
+ display: inline-block;
631
+ cursor: pointer;
632
+ border: 0;
633
+ border-radius: var(--button-border-radius);
634
+ font-weight: 700;
635
+ line-height: 2em;
636
+ font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
637
+ overflow:hidden;
638
+ }
639
+ .animation{
640
+ pointer-events: none;
641
+ 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);
642
+ width: 100%;
643
+ height: 100%;
644
+ position: absolute;
645
+ left: 0;
646
+ top: 0;
647
+ }
648
+ .animation::before {
649
+ content: "";
650
+ position: absolute;
651
+ top: 0;
652
+ left: 0 /* rtl:ignore */;
653
+ width: 100%;
654
+ height: 100%;
655
+ }
656
+ :host(:active) .animation::after {
657
+ box-shadow: 0 0 0 0 black;
658
+ position: absolute;
659
+ opacity: 1;
660
+ transition: 0s;
661
+ }
662
+ .animation::after{
663
+ content: "";
664
+ display: block;
665
+ position: absolute;
666
+ border-radius: var(--border-radius);
667
+ left: 0;
668
+ top: 0;
669
+ width: 100%;
670
+ height: 100%;
671
+ opacity: 0;
672
+ transition: all .5s;
673
+ box-shadow: 0 0 30px black inset;
674
+ }
675
+ .spectric-button.spectric-button--secondary .animation::after , .spectric-button.spectric-button--text .animation::after {
676
+ box-shadow: 0 0 30px white inset;
677
+ }
678
+
679
+ .spectric-button:disabled{
680
+ cursor: not-allowed;
681
+ pointer-events: none;
682
+ filter: contrast(0.5);
683
+ /* background-color:var(--button-disabled); */
684
+ color:var(--text-on-color-disabled);
685
+ }
686
+ .spectric-button:disabled .animation , :host(:disabled:hover) .animation{
687
+ background-color: rgba(0, 0, 0, 0);
688
+ opacity:1
689
+ }
690
+ .spectric-button-danger--true:hover{
691
+ background-color:var(--button-danger-hover);
692
+ }
693
+ .spectric-button--primary.spectric-button-danger--true {
694
+ background-color:var(--button-danger-primary);
695
+ box-shadow:none;
696
+ }
697
+ .spectric-button--secondary.spectric-button-danger--true {
698
+ color: var(--text-on-color);
699
+ background-color:color-mix(in srgb, var(--button-danger-primary) 70%, transparent);
700
+ box-shadow:none;
701
+ }
702
+ .spectric-button--text.spectric-button-danger--true {
703
+ color:var(--button-danger-primary);
704
+
705
+ }
706
+ :host(:hover) .spectric-button--text.spectric-button-danger--true {
707
+ background-color:var(--button-danger-primary);
708
+ color:var(--text-on-color)
709
+ }
710
+ :host(:hover) .animation{
711
+ background: currentColor;
712
+ opacity: 0.15;
713
+ }
714
+ .spectric-button--primary {
715
+ box-shadow: color-mix(in srgb, var(--button-primary) 50%, transparent) 0px 0px 0px 1px inset;
716
+ background-color: var(--button-primary);
717
+ color: var(--text-on-color);
718
+ }
719
+ :host > .spectric-button--primary:focus {
720
+ outline-color: var(--button-secondary);
721
+ outline-width: thin;
722
+ outline-style: solid;
723
+ }
724
+ :host > .spectric-button--secondary:focus {
725
+ outline-color: var(--button-primary);
726
+ outline-width: thin;
727
+ outline-style: solid;
728
+ }
729
+ :host > .spectric-button--text:focus {
730
+ outline-color: var(--button-primary);
731
+ outline-width: thin;
732
+ outline-style: solid;
733
+ }
734
+ /* :host([variant="text"]):focus-within:focus,button:focus, button:focus-within, button:focus-visible{
735
+ outline-color: red;
736
+ } */
737
+ .spectric-button--secondary {
738
+ background-color:transparent;
739
+ box-shadow: var(--button-secondary) 0px 0px 0px 1px inset;
740
+ color: var(--button-secondary);
741
+ }
742
+ .spectric-button--text {
743
+ background-color: transparent;
744
+ color: var(--text-secondary);
745
+ }
746
+ .spectric-button--small {
747
+ padding: 5px 10px;
748
+ font-size: 12px;
749
+ }
750
+ .spectric-button--medium {
751
+ padding: 6px 17px;
752
+ font-size: 14px;
753
+ }
754
+ .spectric-button--large {
755
+ padding: 7px 24px;
756
+ font-size: 16px;
757
+ }
758
+ `;
759
+ /**
760
+ * @license
761
+ * Copyright 2017 Google LLC
762
+ * SPDX-License-Identifier: BSD-3-Clause
763
+ */
764
+ const Q = (s) => (r, o) => {
765
+ o !== void 0 ? o.addInitializer(() => {
766
+ customElements.define(s, r);
767
+ }) : customElements.define(s, r);
768
+ };
769
+ /**
770
+ * @license
771
+ * Copyright 2017 Google LLC
772
+ * SPDX-License-Identifier: BSD-3-Clause
773
+ */
774
+ const Jo = { attribute: !0, type: String, converter: dt, reflect: !1, hasChanged: Jt }, Vo = (s = Jo, r, o) => {
775
+ const { kind: i, metadata: c } = o;
776
+ let t = globalThis.litPropertyMetadata.get(c);
777
+ if (t === void 0 && globalThis.litPropertyMetadata.set(c, t = /* @__PURE__ */ new Map()), t.set(o.name, s), i === "accessor") {
778
+ const { name: p } = o;
779
+ return { set(b) {
780
+ const g = r.get.call(this);
781
+ r.set.call(this, b), this.requestUpdate(p, g, s);
782
+ }, init(b) {
783
+ return b !== void 0 && this.P(p, void 0, s), b;
784
+ } };
785
+ }
786
+ if (i === "setter") {
787
+ const { name: p } = o;
788
+ return function(b) {
789
+ const g = this[p];
790
+ r.call(this, b), this.requestUpdate(p, g, s);
791
+ };
792
+ }
793
+ throw Error("Unsupported decorator location: " + i);
794
+ };
795
+ function v(s) {
796
+ return (r, o) => typeof o == "object" ? Vo(s, r, o) : ((i, c, t) => {
797
+ const p = c.hasOwnProperty(t);
798
+ return c.constructor.createProperty(t, p ? { ...i, wrapped: !0 } : i), p ? Object.getOwnPropertyDescriptor(c, t) : void 0;
799
+ })(s, r, o);
800
+ }
801
+ /**
802
+ * @license
803
+ * Copyright 2017 Google LLC
804
+ * SPDX-License-Identifier: BSD-3-Clause
805
+ */
806
+ function mt(s) {
807
+ return v({ ...s, state: !0, attribute: !1 });
808
+ }
809
+ /**
810
+ * @license
811
+ * Copyright 2017 Google LLC
812
+ * SPDX-License-Identifier: BSD-3-Clause
813
+ */
814
+ const Us = (s, r, o) => (o.configurable = !0, o.enumerable = !0, Reflect.decorate && typeof r != "object" && Object.defineProperty(s, r, o), o);
815
+ /**
816
+ * @license
817
+ * Copyright 2017 Google LLC
818
+ * SPDX-License-Identifier: BSD-3-Clause
819
+ */
820
+ function We(s, r) {
821
+ return (o, i, c) => {
822
+ const t = (p) => {
823
+ var b;
824
+ return ((b = p.renderRoot) == null ? void 0 : b.querySelector(s)) ?? null;
825
+ };
826
+ return Us(o, i, { get() {
827
+ return t(this);
828
+ } });
829
+ };
830
+ }
831
+ /**
832
+ * @license
833
+ * Copyright 2017 Google LLC
834
+ * SPDX-License-Identifier: BSD-3-Clause
835
+ */
836
+ function $t(s) {
837
+ return (r, o) => Us(r, o, { async get() {
838
+ var i;
839
+ return await this.updateComplete, ((i = this.renderRoot) == null ? void 0 : i.querySelector(s)) ?? null;
840
+ } });
841
+ }
842
+ var en = Object.defineProperty, tn = Object.getOwnPropertyDescriptor, ge = (s, r, o, i) => {
843
+ for (var c = i > 1 ? void 0 : i ? tn(r, o) : r, t = s.length - 1, p; t >= 0; t--)
844
+ (p = s[t]) && (c = (i ? p(r, o, c) : p(c)) || c);
845
+ return i && c && en(r, o, c), c;
846
+ }, rn = /* @__PURE__ */ ((s) => (s.large = "large", s.medium = "medium", s.small = "small", s))(rn || {}), sn = /* @__PURE__ */ ((s) => (s.primary = "primary", s.secondary = "secondary", s.text = "text", s))(sn || {});
847
+ const on = {
848
+ primary: "spectric-button--primary",
849
+ secondary: "spectric-button--secondary",
850
+ text: "spectric-button--text"
851
+ };
852
+ let G = class extends L {
853
+ constructor() {
854
+ super(...arguments), this.variant = "primary", this.disabled = !1, this.size = "large", this.label = "", this.danger = !1, this._onClick = (s) => {
855
+ if (s instanceof CustomEvent)
856
+ return;
857
+ s.preventDefault(), s.stopImmediatePropagation(), s.stopPropagation();
858
+ const r = {
859
+ bubbles: !0,
860
+ composed: !0,
861
+ detail: s
862
+ };
863
+ this.dispatchEvent(new CustomEvent("click", r));
864
+ };
865
+ }
866
+ connectedCallback() {
867
+ super.connectedCallback(), this.addEventListener("click", this._onClick);
868
+ }
869
+ disconnectedCallback() {
870
+ super.disconnectedCallback(), this.removeEventListener("click", this._onClick);
871
+ }
872
+ render() {
873
+ const s = on[this.variant] || "spectric-button--primary";
874
+ return A`
875
+ <button
876
+ type="button"
877
+ ?disabled=${this.disabled}
878
+ class=${["spectric-button", `spectric-button-danger--${this.danger || !1}`, `spectric-button--${this.size || "medium"}`, s].join(" ")}
879
+ style=${Bs({ backgroundColor: this.backgroundColor })}
880
+ >
881
+ <span class="animation"></span>
882
+ <slot>${this.label}</slot>
883
+ </button>
884
+ `;
885
+ }
886
+ };
887
+ G.styles = Go;
888
+ ge([
889
+ v({ type: String, reflect: !0 })
890
+ ], G.prototype, "variant", 2);
891
+ ge([
892
+ v({ type: Boolean, reflect: !0 })
893
+ ], G.prototype, "disabled", 2);
894
+ ge([
895
+ v({ type: String, reflect: !0 })
896
+ ], G.prototype, "backgroundColor", 2);
897
+ ge([
898
+ v({ type: String, reflect: !0 })
899
+ ], G.prototype, "size", 2);
900
+ ge([
901
+ v({ type: String, reflect: !0 })
902
+ ], G.prototype, "label", 2);
903
+ ge([
904
+ v({ type: Boolean, reflect: !0 })
905
+ ], G.prototype, "danger", 2);
906
+ G = ge([
907
+ Q("spectric-button")
908
+ ], G);
909
+ /**
910
+ * @license
911
+ * Copyright 2020 Google LLC
912
+ * SPDX-License-Identifier: BSD-3-Clause
913
+ */
914
+ const nn = (s) => s.strings === void 0;
915
+ /**
916
+ * @license
917
+ * Copyright 2017 Google LLC
918
+ * SPDX-License-Identifier: BSD-3-Clause
919
+ */
920
+ const ze = (s, r) => {
921
+ var i;
922
+ const o = s._$AN;
923
+ if (o === void 0) return !1;
924
+ for (const c of o) (i = c._$AO) == null || i.call(c, r, !1), ze(c, r);
925
+ return !0;
926
+ }, ht = (s) => {
927
+ let r, o;
928
+ do {
929
+ if ((r = s._$AM) === void 0) break;
930
+ o = r._$AN, o.delete(s), s = r;
931
+ } while ((o == null ? void 0 : o.size) === 0);
932
+ }, Ms = (s) => {
933
+ for (let r; r = s._$AM; s = r) {
934
+ let o = r._$AN;
935
+ if (o === void 0) r._$AN = o = /* @__PURE__ */ new Set();
936
+ else if (o.has(s)) break;
937
+ o.add(s), ln(r);
938
+ }
939
+ };
940
+ function an(s) {
941
+ this._$AN !== void 0 ? (ht(this), this._$AM = s, Ms(this)) : this._$AM = s;
942
+ }
943
+ function cn(s, r = !1, o = 0) {
944
+ const i = this._$AH, c = this._$AN;
945
+ if (c !== void 0 && c.size !== 0) if (r) if (Array.isArray(i)) for (let t = o; t < i.length; t++) ze(i[t], !1), ht(i[t]);
946
+ else i != null && (ze(i, !1), ht(i));
947
+ else ze(this, s);
948
+ }
949
+ const ln = (s) => {
950
+ s.type == Ds.CHILD && (s._$AP ?? (s._$AP = cn), s._$AQ ?? (s._$AQ = an));
951
+ };
952
+ class zs extends js {
953
+ constructor() {
954
+ super(...arguments), this._$AN = void 0;
955
+ }
956
+ _$AT(r, o, i) {
957
+ super._$AT(r, o, i), Ms(this), this.isConnected = r._$AU;
958
+ }
959
+ _$AO(r, o = !0) {
960
+ var i, c;
961
+ r !== this.isConnected && (this.isConnected = r, r ? (i = this.reconnected) == null || i.call(this) : (c = this.disconnected) == null || c.call(this)), o && (ze(this, r), ht(this));
962
+ }
963
+ setValue(r) {
964
+ if (nn(this._$Ct)) this._$Ct._$AI(r, this);
965
+ else {
966
+ const o = [...this._$Ct._$AH];
967
+ o[this._$Ci] = r, this._$Ct._$AI(o, this, 0);
968
+ }
969
+ }
970
+ disconnected() {
971
+ }
972
+ reconnected() {
973
+ }
974
+ }
975
+ /**
976
+ * @license
977
+ * Copyright 2020 Google LLC
978
+ * SPDX-License-Identifier: BSD-3-Clause
979
+ */
980
+ const ut = () => new un();
981
+ class un {
982
+ }
983
+ const Ht = /* @__PURE__ */ new WeakMap(), pt = er(class extends zs {
984
+ render(s) {
985
+ return C;
986
+ }
987
+ update(s, [r]) {
988
+ var i;
989
+ const o = r !== this.Y;
990
+ return o && this.Y !== void 0 && this.rt(void 0), (o || this.lt !== this.ct) && (this.Y = r, this.ht = (i = s.options) == null ? void 0 : i.host, this.rt(this.ct = s.element)), C;
991
+ }
992
+ rt(s) {
993
+ if (this.isConnected || (s = void 0), typeof this.Y == "function") {
994
+ const r = this.ht ?? globalThis;
995
+ let o = Ht.get(r);
996
+ o === void 0 && (o = /* @__PURE__ */ new WeakMap(), Ht.set(r, o)), o.get(this.Y) !== void 0 && this.Y.call(this.ht, void 0), o.set(this.Y, s), s !== void 0 && this.Y.call(this.ht, s);
997
+ } else this.Y.value = s;
998
+ }
999
+ get lt() {
1000
+ var s, r;
1001
+ return typeof this.Y == "function" ? (s = Ht.get(this.ht ?? globalThis)) == null ? void 0 : s.get(this.Y) : (r = this.Y) == null ? void 0 : r.value;
1002
+ }
1003
+ disconnected() {
1004
+ this.lt === this.ct && this.rt(void 0);
1005
+ }
1006
+ reconnected() {
1007
+ this.rt(this.ct);
1008
+ }
1009
+ }), pn = class {
1010
+ constructor(r) {
1011
+ return this.buffer = r, this.u8 = new Uint8Array(r), new Proxy(this, {
1012
+ get(o, i) {
1013
+ return o[i] ? o[i] : o.getBit(i);
1014
+ }
1015
+ });
1016
+ }
1017
+ getBit(r) {
1018
+ var o = this.u8[r >> 3], i = r & 7;
1019
+ return o >> 7 - i & 1;
1020
+ }
1021
+ setBit(r, o) {
1022
+ var i = r & 7;
1023
+ o ? this.u8[r >> 3] |= 128 >> i : this.u8[r >> 3] &= ~(128 >> i);
1024
+ }
1025
+ get length() {
1026
+ return this.u8.byteLength * 8;
1027
+ }
1028
+ set(r, o) {
1029
+ for (let i = o || 0, c = 0, t = r.length; c < t; i++, c++)
1030
+ this.setBit(i, r[c]);
1031
+ }
1032
+ subarray(r, o) {
1033
+ let i = [];
1034
+ r = r || 0, o = o || this.length, o = o > this.length ? this.length : o;
1035
+ for (let c = r; c < o; c++)
1036
+ i.push(this.getBit(c));
1037
+ return i;
1038
+ }
1039
+ };
1040
+ class xs {
1041
+ constructor(r, o, i, c) {
1042
+ this.__target = r, this._handler = i, this._type = o, this._handler = i, this._options = c || !1, r instanceof Promise ? r.then((t) => {
1043
+ this._handler && (this._node = t, this._node.addEventListener(this._type, this._handler, this._options));
1044
+ }) : (this._node = r, this._node.addEventListener(this._type, this._handler, this._options));
1045
+ }
1046
+ dispose() {
1047
+ 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);
1048
+ }
1049
+ }
1050
+ class Fs extends L {
1051
+ constructor() {
1052
+ super(...arguments), this._disposables = /* @__PURE__ */ new Set(), this._isDisposed = !1, this._disposableListeners = [], this._connected = !1;
1053
+ }
1054
+ addDisposableListener(r, o, i) {
1055
+ if (this._disposableListeners.find((t) => t.event === o && t.target === r && t.handler === i)) {
1056
+ console.warn("Event handler already exists best practice is to add the this in the constructor");
1057
+ return;
1058
+ }
1059
+ this._disposableListeners.push({ target: r, event: o, handler: i }), this._connected && this.registerDisposable(new xs(r, o, i));
1060
+ }
1061
+ registerDisposable(r) {
1062
+ if (!r)
1063
+ return r;
1064
+ if (r === this)
1065
+ throw new Error("Cannot register a disposable on itself!");
1066
+ 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;
1067
+ }
1068
+ connectedCallback() {
1069
+ super.connectedCallback(), this._connected = !0, this._isDisposed = !1, this._disposableListeners.forEach(({ target: r, event: o, handler: i }) => {
1070
+ this.registerDisposable(new xs(r, o, i));
1071
+ });
1072
+ }
1073
+ disconnectedCallback() {
1074
+ super.disconnectedCallback(), this._connected = !1, this._disposables.forEach((r) => {
1075
+ r.dispose();
1076
+ }), this._isDisposed = !0;
1077
+ }
1078
+ }
1079
+ const Qs = (s) => {
1080
+ var r;
1081
+ return (...o) => {
1082
+ r && cancelAnimationFrame(r), r = requestAnimationFrame(() => {
1083
+ s.apply(void 0, o);
1084
+ });
1085
+ };
1086
+ };
1087
+ var dn = Object.defineProperty, fn = Object.getOwnPropertyDescriptor, ve = (s, r, o, i) => {
1088
+ for (var c = i > 1 ? void 0 : i ? fn(r, o) : r, t = s.length - 1, p; t >= 0; t--)
1089
+ (p = s[t]) && (c = (i ? p(r, o, c) : p(c)) || c);
1090
+ return i && c && dn(r, o, c), c;
1091
+ };
1092
+ const hn = ["mousemove", "click", "dblclick", "mousedown", "mouseup", "contextmenu"], at = { width: 200, height: 200 }, bt = { width: 10, height: 10 };
1093
+ let J = class extends Fs {
1094
+ constructor() {
1095
+ 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 = {
1096
+ viewport: ut(),
1097
+ canvas: ut(),
1098
+ scrollDiv: ut()
1099
+ }, this.color = "#000000", this.onThemeChange = () => {
1100
+ let o = getComputedStyle(this);
1101
+ this.color != o.color && (this.color = o.color, this.paint());
1102
+ }, this.onResize = () => {
1103
+ this.calculateViewport();
1104
+ }, this.handleScroll = () => {
1105
+ if (!this.refs.viewport.value)
1106
+ return;
1107
+ const o = this.getPxPerBit();
1108
+ this.yStart = this.refs.viewport.value.scrollTop ? Math.floor(this.refs.viewport.value.scrollTop / o) + 1 : 0, this.xStart = this.refs.viewport.value.scrollLeft ? Math.floor(this.refs.viewport.value.scrollLeft / o) + 1 : 0, this.paint();
1109
+ };
1110
+ let s = new ResizeObserver(this.onResize);
1111
+ s.dispose = () => {
1112
+ this.resizeObserver.disconnect();
1113
+ }, this.resizeObserver = s, this.addDisposableListener(document.body, "theme-change", this.onThemeChange);
1114
+ var r = {};
1115
+ hn.forEach((o) => {
1116
+ this.addDisposableListener(this._canvas, o, Qs(async (i) => {
1117
+ i.stopImmediatePropagation(), i.stopPropagation(), i.preventDefault();
1118
+ var c = await this._canvas;
1119
+ let t = c.getBoundingClientRect(), p = {
1120
+ x: Math.floor(Math.abs(i.clientX - t.left)),
1121
+ y: Math.floor(Math.abs(i.clientY - t.top))
1122
+ }, b = this.canvasPositionToBit(p);
1123
+ if (o === "mousemove" && r[o] == b)
1124
+ return;
1125
+ r[o] = b;
1126
+ let g = "bit" + String(o).charAt(0).toUpperCase() + String(o).slice(1);
1127
+ if (b != -1) {
1128
+ let w = new CustomEvent(g, {
1129
+ detail: { bitIndex: b, position: p, nativeEvent: i }
1130
+ });
1131
+ this.dispatchEvent(w);
1132
+ }
1133
+ }));
1134
+ });
1135
+ }
1136
+ connectedCallback() {
1137
+ this.onResize(), super.connectedCallback(), this.registerDisposable(this.resizeObserver), this.resizeObserver.observe(this);
1138
+ }
1139
+ updated(s) {
1140
+ s.has("arrayBuffer") && this.arrayBuffer && (this._bitArray = new pn(this.arrayBuffer));
1141
+ const r = ["arrayBuffer", "scale", "frameWidth", "width", "height"];
1142
+ for (const o of r)
1143
+ if (s.has(o)) {
1144
+ this.paint();
1145
+ return;
1146
+ }
1147
+ }
1148
+ canvasPositionToBit(s) {
1149
+ let r = Math.floor(s.x / this.scale), o = Math.floor(s.y / this.scale);
1150
+ return r > this.frameWidth - 1 ? -1 : this.yStart * this.frameWidth + this.xStart + (o * this.frameWidth + r);
1151
+ }
1152
+ paint() {
1153
+ if (!this.refs.canvas.value || !this._bitArray)
1154
+ return;
1155
+ const { frameWidth: s, _bitArray: r } = this;
1156
+ if (s <= 0)
1157
+ return;
1158
+ this.calculateViewport();
1159
+ const { width: o = at.width, height: i = at.height } = this, c = this.getPxPerBit(), t = this.refs.canvas.value.getContext("2d");
1160
+ if (!t)
1161
+ return;
1162
+ this.state.scale != c && (t.reset(), t.scale(c, c));
1163
+ let p = getComputedStyle(this);
1164
+ t.fillStyle = p.color, t.clearRect(0, 0, o, i);
1165
+ let b = 0;
1166
+ for (let g = this.yStart * s + this.xStart, w = r.length; g < w; g++) {
1167
+ let x = g % s - this.xStart;
1168
+ if (!(x < 0)) {
1169
+ if (Math.floor(x * c) > o) {
1170
+ b++, g = b * s + this.yStart * s + this.xStart - 1;
1171
+ continue;
1172
+ }
1173
+ if (Math.floor(b * c) > i)
1174
+ break;
1175
+ r.getBit(g) === 1 && t.fillRect(x, b, 1, 1), (g + 1) % s === 0 && g >= s - 1 && b++;
1176
+ }
1177
+ }
1178
+ }
1179
+ getPxPerBit() {
1180
+ return this.scale > 0 ? this.scale : 1;
1181
+ }
1182
+ calculateViewport() {
1183
+ const { frameWidth: s, _bitArray: r } = this;
1184
+ if (this.refs.scrollDiv.value) {
1185
+ var o = this.getPxPerBit();
1186
+ const i = r.length / s * o, c = s * o, t = this.refs.scrollDiv.value;
1187
+ t.style.width = c + "px", t.style.height = i + "px";
1188
+ }
1189
+ }
1190
+ render() {
1191
+ const { height: s = at.height, width: r = at.width } = this;
1192
+ return A`
1193
+ <div
1194
+ id="viewport"
1195
+ ${pt(this.refs.viewport)}
1196
+ @scroll=${this.handleScroll}
1197
+ style=${`width:${r}px;height:${s}px;overflow:auto;position:relative`}
1198
+ >
1199
+ <div
1200
+ id="fakescrolldiv"
1201
+ ${pt(this.refs.scrollDiv)}
1202
+ >
1203
+ </div>
1204
+ </div>
1205
+ <canvas
1206
+ ${pt(this.refs.canvas)}
1207
+ width=${r - bt.width}
1208
+ height=${s - bt.height}
1209
+ ></canvas>
1210
+ `;
1211
+ }
1212
+ };
1213
+ J.styles = K`
1214
+ :host{
1215
+ position: relative;
1216
+ --border-radius: var(--spectric-border-radius,4em);
1217
+ --scroll-color: var(--spectric-background-inverse,#393939);
1218
+ --background-color: var(--spectric-background, #ffffff);
1219
+ }
1220
+ #viewport{
1221
+ overflow: scroll;
1222
+ position: absolute;
1223
+ }
1224
+ #fakescrolldiv {
1225
+ position: relative;
1226
+ overflow-x: hidden;
1227
+ overflow-y: hidden;
1228
+ z-index:-1;
1229
+ }
1230
+ canvas{
1231
+ position: absolute;
1232
+ left:0;
1233
+ top:0;
1234
+ background-color:var(--background-color);
1235
+ }
1236
+ ::-webkit-scrollbar {
1237
+ height: ${bt.height}px;
1238
+ width: ${bt.width}px;
1239
+
1240
+ }
1241
+
1242
+ /* Webkit psudo elements don't pick up variables defined by the host */
1243
+ ::-webkit-scrollbar-thumb {
1244
+ background: var(--spectric-background-inverse,#393939);
1245
+ border-radius: var(--spectric-border-radius,4em);
1246
+ -webkit-border-radius: var(--spectric-border-radius,4em);
1247
+ padding-top: 1px;
1248
+ padding-bottom: 1px;
1249
+ box-shadow: 0 0 1px var(--spectric-primary,#242424) inset;
1250
+ }
1251
+ ::-webkit-scrollbar-thumb:hover {
1252
+ background: var(--spectric-primary,#009eb3);
1253
+ }
1254
+ ::-webkit-scrollbar-corner {
1255
+ background: var(--spectric-background, #ffffff);
1256
+ }
1257
+ /* Buttons */
1258
+
1259
+ ::-webkit-scrollbar-button:single-button {
1260
+ background-color: transparent;
1261
+ display: block;
1262
+ border-style: solid;
1263
+ }/* Up */
1264
+ ::-webkit-scrollbar-button:single-button:vertical:decrement {
1265
+ border-width: 0 5px 5px 5px;
1266
+ border-color: var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-background-inverse,#393939) var(--spectric-background, #ffffff);
1267
+ }
1268
+ ::-webkit-scrollbar-button:single-button:vertical:decrement:hover {
1269
+ border-color: var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-primary,#009eb3) var(--spectric-background, #ffffff);
1270
+ }
1271
+ /* Down */
1272
+ ::-webkit-scrollbar-button:single-button:vertical:increment {
1273
+ border-width: 5px 5px 0 5px;
1274
+ border-color: var(--spectric-background-inverse,#393939) var(--spectric-background, #ffffff) transparent var(--spectric-background, #ffffff);
1275
+ }
1276
+
1277
+ ::-webkit-scrollbar-button:vertical:single-button:increment:hover {
1278
+ border-color: var(--spectric-primary,#009eb3) var(--spectric-background, #ffffff) transparent var(--spectric-background, #ffffff);
1279
+ }
1280
+
1281
+ /* Left */
1282
+ ::-webkit-scrollbar-button:single-button:horizontal:decrement {
1283
+ border-width: 5px 5px 5px 0;
1284
+ border-color:var(--spectric-background, #ffffff) var(--spectric-background-inverse,#393939) var(--spectric-background, #ffffff) var(--spectric-background, #ffffff);
1285
+
1286
+ }
1287
+
1288
+ ::-webkit-scrollbar-button:single-button:horizontal:decrement:hover {
1289
+ border-width: 5px 5px 5px 0;
1290
+ border-color:var(--spectric-background, #ffffff) var(--spectric-primary,#009eb3) var(--spectric-background, #ffffff) var(--spectric-background, #ffffff);
1291
+
1292
+ }
1293
+
1294
+
1295
+
1296
+ /* Right */
1297
+ ::-webkit-scrollbar-button:single-button:horizontal:increment {
1298
+ border-width: 5px 0 5px 5px;
1299
+ border-color:var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-background-inverse,#393939);
1300
+
1301
+ }
1302
+
1303
+ ::-webkit-scrollbar-button:single-button:horizontal:increment:hover {
1304
+ border-width: 5px 0 5px 5px;
1305
+ border-color:var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-primary,#009eb3);
1306
+
1307
+ }
1308
+
1309
+ `;
1310
+ ve([
1311
+ v({ type: Object, attribute: !1 })
1312
+ ], J.prototype, "arrayBuffer", 2);
1313
+ ve([
1314
+ v({ type: Number })
1315
+ ], J.prototype, "frameWidth", 2);
1316
+ ve([
1317
+ v({ type: Number })
1318
+ ], J.prototype, "scale", 2);
1319
+ ve([
1320
+ v({ type: Number })
1321
+ ], J.prototype, "width", 2);
1322
+ ve([
1323
+ v({ type: Number })
1324
+ ], J.prototype, "height", 2);
1325
+ ve([
1326
+ $t("canvas")
1327
+ ], J.prototype, "_canvas", 2);
1328
+ J = ve([
1329
+ Q("spectric-bit-display")
1330
+ ], J);
1331
+ const bn = K`.spectric-header {
1332
+ display: flex;
1333
+ justify-content: space-between;
1334
+ align-items: center;
1335
+ border-bottom: 1px solid rgba(0, 0, 0, 0.1);
1336
+ padding: 15px 20px;
1337
+ font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
1338
+ }
1339
+
1340
+ .spectric-header svg {
1341
+ display: inline-block;
1342
+ vertical-align: top;
1343
+ }
1344
+ .spectric-header slot {
1345
+ display: inline-block;
1346
+ vertical-align: middle;
1347
+ }
1348
+ .spectric-header h1 {
1349
+ display: inline-block;
1350
+ vertical-align: middle;
1351
+ margin: 6px 0 6px 10px;
1352
+ font-weight: 700;
1353
+ font-size: 20px;
1354
+ line-height: 1;
1355
+ }
1356
+
1357
+ .spectric-header button + button {
1358
+ margin-left: 10px;
1359
+ }
1360
+
1361
+ .spectric-header .welcome {
1362
+ margin-right: 10px;
1363
+ color: #333;
1364
+ font-size: 14px;
1365
+ }
1366
+ `;
1367
+ var gn = Object.defineProperty, vn = Object.getOwnPropertyDescriptor, _t = (s, r, o, i) => {
1368
+ for (var c = i > 1 ? void 0 : i ? vn(r, o) : r, t = s.length - 1, p; t >= 0; t--)
1369
+ (p = s[t]) && (c = (i ? p(r, o, c) : p(c)) || c);
1370
+ return i && c && gn(r, o, c), c;
1371
+ };
1372
+ let Ee = class extends L {
1373
+ constructor() {
1374
+ super(...arguments), this.showCreateAccount = !1, this.showLoginButton = !1, this.username = "", this.onLogout = () => {
1375
+ const s = {
1376
+ bubbles: !0,
1377
+ composed: !0
1378
+ };
1379
+ this.dispatchEvent(new CustomEvent("logout", s));
1380
+ }, this.onLogin = () => {
1381
+ const s = {
1382
+ bubbles: !0,
1383
+ composed: !0
1384
+ };
1385
+ this.dispatchEvent(new CustomEvent("login", s));
1386
+ }, this.onCreateAccount = () => {
1387
+ const s = {
1388
+ bubbles: !0,
1389
+ composed: !0
1390
+ };
1391
+ this.dispatchEvent(new CustomEvent("createAccount", s));
1392
+ };
1393
+ }
1394
+ render() {
1395
+ return A`
1396
+ <header>
1397
+ <div class="spectric-header">
1398
+ <div style="flex-grow:1;">
1399
+ <slot name="branding"></slot>
1400
+ <h1><slot name="name"></slot></h1>
1401
+ <slot name="center"></slot>
1402
+ </div>
1403
+ ${this.showLoginButton !== !1 ? A`
1404
+ <div>
1405
+ ${this.username && this.username !== "" ? A`<spectric-button variant="secondary" size="small" @click=${this.onLogout}>Log out</spectric-button>` : A`
1406
+ ${this.showCreateAccount !== !1 ? A`<spectric-button variant="text" size="small" @click=${this.onCreateAccount}>Sign up</spectric-button>` : null}
1407
+ <spectric-button variant="primary" size="small" @click=${this.onLogin}>Log in</spectric-button>`}
1408
+
1409
+
1410
+ </div>` : null}
1411
+ <slot name="end"></slot>
1412
+ </div>
1413
+ </header>
1414
+ `;
1415
+ }
1416
+ };
1417
+ Ee.styles = bn;
1418
+ _t([
1419
+ v({ type: Boolean, reflect: !0 })
1420
+ ], Ee.prototype, "showCreateAccount", 2);
1421
+ _t([
1422
+ v({ type: Boolean, reflect: !0 })
1423
+ ], Ee.prototype, "showLoginButton", 2);
1424
+ _t([
1425
+ v({ type: String, reflect: !0 })
1426
+ ], Ee.prototype, "username", 2);
1427
+ Ee = _t([
1428
+ Q("spectric-header")
1429
+ ], Ee);
1430
+ var yn = Object.defineProperty, mn = Object.getOwnPropertyDescriptor, Te = (s, r, o, i) => {
1431
+ for (var c = i > 1 ? void 0 : i ? mn(r, o) : r, t = s.length - 1, p; t >= 0; t--)
1432
+ (p = s[t]) && (c = (i ? p(r, o, c) : p(c)) || c);
1433
+ return i && c && yn(r, o, c), c;
1434
+ };
1435
+ const $n = {
1436
+ display: "flex",
1437
+ alignItems: "center",
1438
+ backgroundColor: "black",
1439
+ color: "white",
1440
+ textAlign: "center"
1441
+ };
1442
+ let he = class extends L {
1443
+ constructor() {
1444
+ super(...arguments), this.dismissable = !1, this.text = "", this.bannerId = "", this.headerStyle = {}, this._dismissed = !1, this.onDismiss = (s) => {
1445
+ s.preventDefault(), s.stopPropagation();
1446
+ const r = {
1447
+ bubbles: !0,
1448
+ composed: !0
1449
+ };
1450
+ this._dismissed = !0;
1451
+ let { bannerId: o, text: i, headerStyle: c, dismissable: t } = this;
1452
+ this.dispatchEvent(new CustomEvent("bannerDismissed", {
1453
+ detail: { bannerId: o, text: i, headerStyle: c, dismissable: t },
1454
+ ...r
1455
+ }));
1456
+ };
1457
+ }
1458
+ render() {
1459
+ if (!this._dismissed)
1460
+ return A`
1461
+ <header style=${Bs({ ...$n, ...this.headerStyle })}>
1462
+ <div style="flex-grow:1"><slot name="text">${this.text}</slot><slot></slot></div>
1463
+ ${this.dismissable ? A`<spectric-button size="small" @click=${this.onDismiss}>X</spectric-button>` : null}
1464
+ </header>
1465
+ `;
1466
+ }
1467
+ };
1468
+ Te([
1469
+ v({ type: Boolean, reflect: !0 })
1470
+ ], he.prototype, "dismissable", 2);
1471
+ Te([
1472
+ v({ type: String, reflect: !0 })
1473
+ ], he.prototype, "text", 2);
1474
+ Te([
1475
+ v({ type: String, reflect: !0 })
1476
+ ], he.prototype, "bannerId", 2);
1477
+ Te([
1478
+ v({ type: Object })
1479
+ ], he.prototype, "headerStyle", 2);
1480
+ Te([
1481
+ v({ state: !0, type: Boolean, attribute: !1 })
1482
+ ], he.prototype, "_dismissed", 2);
1483
+ he = Te([
1484
+ Q("spectric-banner")
1485
+ ], he);
1486
+ const _n = K`
1487
+
1488
+ :host {
1489
+ height:100vh;
1490
+ width: 100%;
1491
+ display: flex;
1492
+ flex-direction: column;
1493
+ font-size: 14px;
1494
+ line-height: 24px;
1495
+ font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
1496
+ --spectric-background: var(--background,#ffffff);
1497
+ --spectric-background-hover:var(--background-hover,rgba(141, 141, 141, 0.12));
1498
+ --spectric-background-inverse: var(--background-inverse,#f4f4f4);
1499
+ --spectric-background-inverse-hover: var(--background-inverse-hover,#474747);
1500
+ --spectric-border-radius: var(--border-radius,.4em);
1501
+ --spectric-primary:var(--primary,#1ea7fd);
1502
+ --spectric-secondary: var(--secondary,#77878b);
1503
+ --spectric-tertiary: var(--tertiary,#0f62fe);
1504
+ --spectric-disabled: var(--disabled,#c6c6c6);
1505
+
1506
+ /* panel */
1507
+ --panel-color:var(--spectric-background-inverse);
1508
+ --panel-color-inverse:var(--spectric-background);
1509
+ --spectric-border-disabled: var(--disabled);
1510
+
1511
+ /*inputs*/
1512
+ --spectric-input-color: var(--panel-color-inverse);
1513
+ --spectric-input-bottom: var(--panel-color);
1514
+
1515
+ --spectric-text-on-color: var(--text-on-color,#ffffff);
1516
+ --spectric-text-on-color-disabled: var(--text-on-color-disabled,#8d8d8d);
1517
+ --spectric-text-placeholder: var(--text-placeholder,rgba(22, 22, 22, 0.4));
1518
+ --spectric-text-primary: var(--text-primary,#161616);
1519
+ --spectric-text-secondary: var(--text-secondary,#525252);
1520
+ /* Buttons */
1521
+ --spectric-button-separator: #e0e0e0;
1522
+ --spectric-button-primary: var(--primary,#1ea7fd);
1523
+ --spectric-button-secondary: var(--secondary,#77878b);
1524
+ --spectric-button-tertiary: var(--tertiary);
1525
+ --spectric-button-danger-primary: #da1e28;
1526
+ --spectric-button-danger-secondary: #da1e28;
1527
+ --spectric-button-danger-active: #750e13;
1528
+ --spectric-button-primary-active: #002d9c;
1529
+ --spectric-button-secondary-active: #6f6f6f;
1530
+ --spectric-button-tertiary-active: #002d9c;
1531
+ --spectric-button-danger-hover: #b81921;
1532
+ --spectric-button-primary-hover: #0050e6;
1533
+ --spectric-button-secondary-hover: #474747;
1534
+ --spectric-button-tertiary-hover: #0050e6;
1535
+ --spectric-text-on-color-disabled: var(--disabled,#c6c6c6)
1536
+ --spectric-button-disabled: #c6c6c6;
1537
+ }
1538
+ *{
1539
+ color: var(--spectric-text-primary);
1540
+ background-color: var(--spectric-background,rgb(255 255 255 / 60%));
1541
+ }
1542
+ article{
1543
+ flex-grow:1;
1544
+ overflow-y:auto;
1545
+ padding-left: calc(var(--spectric-border-radius, 0.4em) + 2px);
1546
+ padding-right: calc(var(--spectric-border-radius, 0.4em) + 2px);
1547
+ }
1548
+ h2 {
1549
+ display: inline-block;
1550
+ vertical-align: middle;
1551
+ margin: 0 0 4px;
1552
+ font-weight: 700;
1553
+ font-size: 32px;
1554
+ line-height: 1;
1555
+ }
1556
+
1557
+ p {
1558
+ margin: 1em 0;
1559
+ }
1560
+
1561
+ a {
1562
+ color: var(--primary);
1563
+ text-decoration: var(--primary);
1564
+ }
1565
+
1566
+ ul {
1567
+ margin: 1em 0;
1568
+ padding-left: 30px;
1569
+ }
1570
+
1571
+ li {
1572
+ margin-bottom: 8px;
1573
+ }
1574
+ ::-webkit-scrollbar {
1575
+ width: 10px;
1576
+ }
1577
+
1578
+ ::-webkit-scrollbar-thumb {
1579
+ background: var(--spectric-background-inverse,#393939);
1580
+ border-radius: var(--spectric-border-radius,4em);
1581
+ -webkit-border-radius: var(--spectric-border-radius,4em);
1582
+ padding-top: 1px;
1583
+ padding-bottom: 1px;
1584
+ box-shadow: 0 0 1px var(--spectric-primary,#242424) inset;
1585
+ }
1586
+ ::-webkit-scrollbar-thumb:hover {
1587
+ background: var(--spectric-primary,#009eb3);
1588
+ }
1589
+
1590
+
1591
+ ::-webkit-scrollbar-button:single-button {
1592
+ background-color: transparent;
1593
+ display: block;
1594
+ border-style: solid;
1595
+ }
1596
+ /* Up */
1597
+ ::-webkit-scrollbar-button:single-button:vertical:decrement {
1598
+ border-width: 0 5px 5px 5px;
1599
+ border-color: var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-background-inverse,#393939) var(--spectric-background, #ffffff);
1600
+ }
1601
+ ::-webkit-scrollbar-button:single-button:vertical:decrement:hover {
1602
+ border-color: var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-primary,#009eb3) var(--spectric-background, #ffffff);
1603
+ }
1604
+ /* Down */
1605
+ ::-webkit-scrollbar-button:single-button:vertical:increment {
1606
+ border-width: 5px 5px 0 5px;
1607
+ border-color: var(--spectric-background-inverse,#393939) var(--spectric-background, #ffffff) transparent var(--spectric-background, #ffffff);
1608
+ }
1609
+
1610
+ ::-webkit-scrollbar-button:vertical:single-button:increment:hover {
1611
+ border-color: var(--spectric-primary,#009eb3) var(--spectric-background, #ffffff) transparent var(--spectric-background, #ffffff);
1612
+ }
1613
+
1614
+ /* Left */
1615
+ ::-webkit-scrollbar-button:single-button:horizontal:decrement {
1616
+ border-width: 5px 5px 5px 0;
1617
+ border-color:var(--spectric-background, #ffffff) var(--spectric-background-inverse,#393939) var(--spectric-background, #ffffff) var(--spectric-background, #ffffff);
1618
+
1619
+ }
1620
+
1621
+ ::-webkit-scrollbar-button:single-button:horizontal:decrement:hover {
1622
+ border-width: 5px 5px 5px 0;
1623
+ border-color:var(--spectric-background, #ffffff) var(--spectric-primary,#009eb3) var(--spectric-background, #ffffff) var(--spectric-background, #ffffff);
1624
+
1625
+ }
1626
+
1627
+
1628
+
1629
+ /* Right */
1630
+ ::-webkit-scrollbar-button:single-button:horizontal:increment {
1631
+ border-width: 5px 0 5px 5px;
1632
+ border-color:var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-primary,#009eb3);
1633
+
1634
+ }
1635
+
1636
+ ::-webkit-scrollbar-button:single-button:horizontal:increment:hover {
1637
+ border-width: 5px 0 5px 5px;
1638
+ border-color:var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-background-inverse-hover,#474747);
1639
+
1640
+ }
1641
+
1642
+ `;
1643
+ /**
1644
+ * @license
1645
+ * Copyright 2018 Google LLC
1646
+ * SPDX-License-Identifier: BSD-3-Clause
1647
+ */
1648
+ const Wt = (s) => s ?? C;
1649
+ class wn extends zs {
1650
+ constructor() {
1651
+ super(...arguments), this.prevData = {};
1652
+ }
1653
+ render(r) {
1654
+ return C;
1655
+ }
1656
+ update(r, [o]) {
1657
+ var i;
1658
+ this.element !== r.element && (this.element = r.element), this.host = ((i = r.options) == null ? void 0 : i.host) || this.element, this.apply(o), this.groom(o), this.prevData = { ...o };
1659
+ }
1660
+ apply(r) {
1661
+ if (!r) return;
1662
+ const { prevData: o, element: i } = this;
1663
+ for (const c in r) {
1664
+ const t = r[c];
1665
+ t !== o[c] && (i[c] = t);
1666
+ }
1667
+ }
1668
+ groom(r) {
1669
+ const { prevData: o, element: i } = this;
1670
+ if (o)
1671
+ for (const c in o)
1672
+ (!r || !(c in r) && i[c] === o[c]) && (i[c] = void 0);
1673
+ }
1674
+ }
1675
+ const qt = er(wn);
1676
+ var Yt = /* @__PURE__ */ ((s) => (s.None = "none", s.Uscui = "us.cui", s.Usclassified = "us.classified", s.Usunclassified = "us.unclassified", s.Usconfidential = "us.confidential", s.Ussecret = "us.secret", s.Ustopsecret = "us.topsecret", s.UstopsecretSi = "us.topsecret.si", s.Uknotset = "uk.notset", s.Ukofficial = "uk.official", s.Uksecret = "uk.secret", s.Uktopsecret = "uk.topsecret", s.Caprotected_a = "ca.protected_a", s.Caprotected_b = "ca.protected_b", s.Caprotected_c = "ca.protected_c", s.Caconfidential = "ca.confidential", s.Casecret = "ca.secret", s.Catopsecret = "ca.topsecret", s.Auunofficial = "au.unofficial", s.Auofficial = "au.official", s.Auofficialsensitive = "au.officialsensitive", s.Auconfidential = "au.confidential", s.Ausecret = "au.secret", s.Autopsecret = "au.topsecret", s))(Yt || {});
1677
+ const ct = {
1678
+ none: {},
1679
+ //US Department of Defense spec CFR-2002-title31-vol1-sec2-7
1680
+ "us.cui": {
1681
+ //controlled unclassified information
1682
+ color: "white",
1683
+ backgroundColor: "#3D1E5A",
1684
+ content: "Controlled Unclassified Information"
1685
+ },
1686
+ "us.classified": {
1687
+ color: "white",
1688
+ backgroundColor: "#723D9A",
1689
+ content: "Classified"
1690
+ },
1691
+ "us.unclassified": {
1692
+ color: "white",
1693
+ backgroundColor: "#007A33",
1694
+ content: "Unclassified"
1695
+ },
1696
+ "us.confidential": {
1697
+ color: "white",
1698
+ backgroundColor: "#0033A0",
1699
+ content: "Confidential"
1700
+ },
1701
+ "us.secret": {
1702
+ color: "white",
1703
+ backgroundColor: "#C8102E",
1704
+ content: "Secret"
1705
+ },
1706
+ "us.topsecret": {
1707
+ color: "white",
1708
+ backgroundColor: "#FF671F",
1709
+ content: "Top Secret"
1710
+ },
1711
+ "us.topsecret.si": {
1712
+ color: "black",
1713
+ backgroundColor: "#F7EA48",
1714
+ content: "Top Secret//SI"
1715
+ },
1716
+ "uk.notset": {
1717
+ color: "white",
1718
+ backgroundColor: " #616161",
1719
+ content: "Not Set"
1720
+ },
1721
+ "uk.official": {
1722
+ color: "white",
1723
+ backgroundColor: "#2B71C7",
1724
+ content: "For Offical Use"
1725
+ },
1726
+ "uk.secret": {
1727
+ color: "white",
1728
+ backgroundColor: "#F39C2C",
1729
+ content: "Secret"
1730
+ },
1731
+ "uk.topsecret": {
1732
+ color: "white",
1733
+ backgroundColor: "#AA0000",
1734
+ content: "Top Secret"
1735
+ },
1736
+ "ca.protected_a": {
1737
+ color: "white",
1738
+ backgroundColor: "#227ABC",
1739
+ content: "PROTECTED A"
1740
+ },
1741
+ "ca.protected_b": {
1742
+ color: "white",
1743
+ backgroundColor: "#900FB5",
1744
+ content: "PROTECTED B"
1745
+ },
1746
+ "ca.protected_c": {
1747
+ color: "white",
1748
+ backgroundColor: "#460FB5",
1749
+ content: "PROTECTED C"
1750
+ },
1751
+ "ca.confidential": {
1752
+ color: "white",
1753
+ backgroundColor: "#0033a0",
1754
+ content: "Confidential"
1755
+ },
1756
+ "ca.secret": {
1757
+ color: "white",
1758
+ backgroundColor: "#c8102e",
1759
+ content: "Secret"
1760
+ },
1761
+ "ca.topsecret": {
1762
+ color: "white",
1763
+ backgroundColor: "#ff671f",
1764
+ content: "Top Secret"
1765
+ },
1766
+ "au.unofficial": {
1767
+ color: "#666",
1768
+ backgroundColor: "#ffffffff",
1769
+ content: "Unofficial"
1770
+ },
1771
+ "au.official": {
1772
+ color: "#666",
1773
+ backgroundColor: "#ffffffff",
1774
+ content: "Official"
1775
+ },
1776
+ "au.officialsensitive": {
1777
+ color: "#666",
1778
+ backgroundColor: "#ffffffff",
1779
+ content: "Official Sentitive"
1780
+ },
1781
+ "au.confidential": {
1782
+ color: "white",
1783
+ backgroundColor: "#4F81BD",
1784
+ content: "Confidential"
1785
+ },
1786
+ "au.secret": {
1787
+ color: "black",
1788
+ backgroundColor: " #E5B8B7",
1789
+ content: "Secret"
1790
+ },
1791
+ "au.topsecret": {
1792
+ color: "black",
1793
+ backgroundColor: "#AA0000",
1794
+ content: "Top Secret"
1795
+ }
1796
+ };
1797
+ var xn = Object.defineProperty, An = Object.getOwnPropertyDescriptor, Z = (s, r, o, i) => {
1798
+ for (var c = i > 1 ? void 0 : i ? An(r, o) : r, t = s.length - 1, p; t >= 0; t--)
1799
+ (p = s[t]) && (c = (i ? p(r, o, c) : p(c)) || c);
1800
+ return i && c && xn(r, o, c), c;
1801
+ };
1802
+ let B = class extends L {
1803
+ constructor() {
1804
+ super(...arguments), this.showHeader = !0, this.headerSticky = !0, this.classificationLevel = Yt.None, this.classificationText = "", this.notifications = [], this.showCreateAccount = !1, this.showLoginButton = !0, this.username = "";
1805
+ }
1806
+ // protected createRenderRoot(): HTMLElement | DocumentFragment {
1807
+ // return this
1808
+ // }
1809
+ render() {
1810
+ this.classificationLevel && !ct[this.classificationLevel] && (console.warn("Unknown classification", this.classificationLevel), this.classificationLevel = Yt.None);
1811
+ const s = this.classificationLevel ? this.classificationText || ct[this.classificationLevel].content : "", r = this.showHeader ? A`<spectric-header ?showCreateAccount=${this.showCreateAccount} .showLoginButton=${this.showLoginButton} username=${Wt(this.username)}>
1812
+ <slot name="branding" slot="branding"></slot>
1813
+ <slot name="name" slot="name"></slot>
1814
+ <slot name="center" slot="center"></slot>
1815
+ <slot name="end" slot="end"></slot>
1816
+ </spectric-header>` : null;
1817
+ return A`
1818
+ ${this.classificationLevel && s ? A`
1819
+ <!-- Classification Banner -->
1820
+ <spectric-banner ${qt({ text: s, headerStyle: ct[this.classificationLevel] })}></spectric-banner>
1821
+ ` : null}
1822
+ <spectric-theme theme=${Wt(this.theme)}>
1823
+ ${this.notifications ? this.notifications.map((o) => A`<spectric-banner ${qt(o)} ></spectric-banner>`) : null}
1824
+ ${this.headerSticky ? r : null}
1825
+ <article>
1826
+ ${this.headerSticky ? null : r}
1827
+ <section class="spectric-page">
1828
+ <slot name="content"></slot>
1829
+ <slot></slot>
1830
+ </section>
1831
+ </article>
1832
+ </spectric-theme>
1833
+ ${this.classificationLevel && s ? A`<spectric-banner ${qt({ text: s, headerStyle: ct[this.classificationLevel] })}></spectric-banner>` : null}
1834
+
1835
+ `;
1836
+ }
1837
+ };
1838
+ B.styles = _n;
1839
+ Z([
1840
+ v({ type: Boolean, reflect: !0 })
1841
+ ], B.prototype, "showHeader", 2);
1842
+ Z([
1843
+ v({ type: Boolean, reflect: !0 })
1844
+ ], B.prototype, "headerSticky", 2);
1845
+ Z([
1846
+ v({ type: String, reflect: !0 })
1847
+ ], B.prototype, "classificationLevel", 2);
1848
+ Z([
1849
+ v({ type: String, reflect: !0 })
1850
+ ], B.prototype, "classificationText", 2);
1851
+ Z([
1852
+ v({ type: Array, reflect: !0 })
1853
+ ], B.prototype, "notifications", 2);
1854
+ Z([
1855
+ v({ type: Boolean, reflect: !0 })
1856
+ ], B.prototype, "showCreateAccount", 2);
1857
+ Z([
1858
+ v({ type: Boolean, reflect: !0 })
1859
+ ], B.prototype, "showLoginButton", 2);
1860
+ Z([
1861
+ v({ type: String, reflect: !0 })
1862
+ ], B.prototype, "username", 2);
1863
+ Z([
1864
+ v({ type: String, reflect: !0 })
1865
+ ], B.prototype, "theme", 2);
1866
+ B = Z([
1867
+ Q("spectric-page")
1868
+ ], B);
1869
+ var kn = Object.defineProperty, Sn = Object.getOwnPropertyDescriptor, O = (s, r, o, i) => {
1870
+ for (var c = i > 1 ? void 0 : i ? Sn(r, o) : r, t = s.length - 1, p; t >= 0; t--)
1871
+ (p = s[t]) && (c = (i ? p(r, o, c) : p(c)) || c);
1872
+ return i && c && kn(r, o, c), c;
1873
+ }, Cn = /* @__PURE__ */ ((s) => (s.Text = "text", s.TextArea = "text-area", s.number = "number", s.color = "color", s.date = "date", s.datetime = "datetime-local", s.email = "email", s.file = "file", s.hidden = "hidden", s.password = "password", s))(Cn || {});
1874
+ let E = class extends L {
1875
+ constructor() {
1876
+ 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: s }) => {
1877
+ const r = s;
1878
+ this.value = r.value, this.invalid = !r.validity.valid;
1879
+ }, this.handleTogglePasswordVisibility = () => {
1880
+ this._showPassword = !this._showPassword, this.requestUpdate();
1881
+ };
1882
+ }
1883
+ //static styles?: CSSResultGroup | undefined = style;
1884
+ createRenderRoot() {
1885
+ return this;
1886
+ }
1887
+ get selectionStart() {
1888
+ return this._input.selectionStart;
1889
+ }
1890
+ get value() {
1891
+ return this._input ? this.variant == "number" ? parseFloat(this._input.value) : this._input.value : this._value;
1892
+ }
1893
+ set value(s) {
1894
+ const r = this._value;
1895
+ this._value = s, this.requestUpdate("value", r), this._input && (this._input.value = String(s));
1896
+ }
1897
+ setSelectionRange(s, r, o = "none") {
1898
+ this._input.setSelectionRange(s, r, o);
1899
+ }
1900
+ render() {
1901
+ switch (this.variant) {
1902
+ case "text":
1903
+ case "password":
1904
+ case "number":
1905
+ case "email":
1906
+ case "date":
1907
+ case "datetime-local":
1908
+ case "file":
1909
+ case "color":
1910
+ return A`
1911
+ <div class="inputWrapper">
1912
+ <div class="text-input__label-helper-wrapper">
1913
+ <div class="--text-input__label-wrapper">
1914
+ ${this.label} ${this.maxCount > 0 && this._value ? `${this._value.length}/${this.maxCount}` : null}
1915
+ </div>
1916
+ </div>
1917
+ <div class="fieldwrapper">
1918
+ <div ?data-invalid="${this.invalid}" class="inputContainer">
1919
+ <input
1920
+ ?data-invalid="${this.invalid}"
1921
+ ?disabled="${this.disabled}"
1922
+ aria-describedby="helper-text"
1923
+ id="input"
1924
+ name="${Ae(this.name)}"
1925
+ pattern="${Ae(this.pattern)}"
1926
+ placeholder="${Ae(this.placeholder)}"
1927
+ autocomplete="${Ae(this.autocomplete)}"
1928
+ ?readonly="${this.readonly}"
1929
+ ?required="${this.required}"
1930
+ type="${Ae(
1931
+ this.variant !== "password" ? this.variant : this._showPassword ? "text" : "password"
1932
+ /* password */
1933
+ )}"
1934
+ .value="${this._value}"
1935
+ maxlength="${Ae(this.maxCount > 0 ? this.maxCount : void 0)}"
1936
+ @input="${this._handleInput}"
1937
+ @change=${() => {
1938
+ this.dispatchEvent(new Event("change", { bubbles: !0 }));
1939
+ }}
1940
+ />
1941
+
1942
+ ${this.variant === "password" && this.showPasswordVisibilityToggle ? A`
1943
+ <spectric-button
1944
+ size="small"
1945
+ type="button"
1946
+ ?disabled="${this.disabled}"
1947
+ @click=${this.handleTogglePasswordVisibility}>
1948
+ ${this._showPassword ? this.hidePasswordLabel : this.showPasswordLabel}
1949
+ </spectric-button>
1950
+ ` : null}
1951
+ </div>
1952
+ <div
1953
+ id="helper-text"
1954
+ >
1955
+ <slot name="helper-text"> ${this.invalid ? this.invalidText : this.helperText} </slot>
1956
+ </div>
1957
+
1958
+ </div>
1959
+ </div>
1960
+ `;
1961
+ case "hidden":
1962
+ return A`<input type="hidden"></input>`;
1963
+ }
1964
+ return `Not yet implemented ${this.variant}`;
1965
+ }
1966
+ };
1967
+ O([
1968
+ v({ type: String, reflect: !0 })
1969
+ ], E.prototype, "placeholder", 2);
1970
+ O([
1971
+ v({ type: Boolean, reflect: !0 })
1972
+ ], E.prototype, "readonly", 2);
1973
+ O([
1974
+ v({ type: String, reflect: !0 })
1975
+ ], E.prototype, "variant", 2);
1976
+ O([
1977
+ v({ type: Boolean, reflect: !0 })
1978
+ ], E.prototype, "disabled", 2);
1979
+ O([
1980
+ v({ type: String, reflect: !0 })
1981
+ ], E.prototype, "label", 2);
1982
+ O([
1983
+ v()
1984
+ ], E.prototype, "hidePasswordLabel", 2);
1985
+ O([
1986
+ v()
1987
+ ], E.prototype, "showPasswordLabel", 2);
1988
+ O([
1989
+ v({
1990
+ type: Boolean,
1991
+ reflect: !0
1992
+ })
1993
+ ], E.prototype, "showPasswordVisibilityToggle", 2);
1994
+ O([
1995
+ v({ type: String, reflect: !0 })
1996
+ ], E.prototype, "helperText", 2);
1997
+ O([
1998
+ v({ type: Boolean, reflect: !0 })
1999
+ ], E.prototype, "invalid", 2);
2000
+ O([
2001
+ v({ type: Boolean, reflect: !0 })
2002
+ ], E.prototype, "required", 2);
2003
+ O([
2004
+ v({ type: String, reflect: !0 })
2005
+ ], E.prototype, "invalidText", 2);
2006
+ O([
2007
+ v()
2008
+ ], E.prototype, "name", 2);
2009
+ O([
2010
+ v()
2011
+ ], E.prototype, "pattern", 2);
2012
+ O([
2013
+ v({ type: Number, reflect: !0 })
2014
+ ], E.prototype, "maxCount", 2);
2015
+ O([
2016
+ v({ reflect: !0 })
2017
+ ], E.prototype, "autocomplete", 2);
2018
+ O([
2019
+ v({ reflect: !0 })
2020
+ ], E.prototype, "value", 1);
2021
+ O([
2022
+ We("input")
2023
+ ], E.prototype, "_input", 2);
2024
+ E = O([
2025
+ Q("spectric-input")
2026
+ ], E);
2027
+ const Ae = (s) => Wt(s === "" ? void 0 : s ?? void 0), En = "end of input", On = {
2028
+ fieldName: "field name",
2029
+ value: "value",
2030
+ literal: "literal",
2031
+ whitespace: "whitespace"
2032
+ };
2033
+ class Is extends Error {
2034
+ constructor(r, o) {
2035
+ let i = r.message;
2036
+ if (r.expected) {
2037
+ const p = r.expected.map((g) => On[g.description] || g.description).join(", ");
2038
+ let b = r.found ? `"${r.found}"` : En;
2039
+ i = `Expected ${p} but ${b} found.`;
2040
+ }
2041
+ const c = [i, o, "-".repeat(r.location.start.offset) + "^"].join(
2042
+ `
2043
+ `
2044
+ );
2045
+ super(c), this.name = "DQLSyntaxError", this.shortMessage = i;
2046
+ }
2047
+ }
2048
+ function Se(s) {
2049
+ return {
2050
+ type: "literal",
2051
+ value: s
2052
+ };
2053
+ }
2054
+ function tr(s) {
2055
+ return s.value;
2056
+ }
2057
+ const Tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2058
+ __proto__: null,
2059
+ buildNode: Se,
2060
+ toOpenSearchQuery: tr
2061
+ }, Symbol.toStringTag, { value: "Module" })), {
2062
+ SyntaxError: nc,
2063
+ parse: wt
2064
+ } = function() {
2065
+ function s(i, c) {
2066
+ function t() {
2067
+ this.constructor = i;
2068
+ }
2069
+ t.prototype = c.prototype, i.prototype = new t();
2070
+ }
2071
+ function r(i, c, t, p) {
2072
+ this.message = i, this.expected = c, this.found = t, this.location = p, this.name = "SyntaxError", typeof Error.captureStackTrace == "function" && Error.captureStackTrace(this, r);
2073
+ }
2074
+ s(r, Error);
2075
+ function o(i) {
2076
+ var c = arguments.length > 1 ? arguments[1] : {}, t = {}, p = { start: Kr, Literal: Bt }, b = Kr, g = function(e, n) {
2077
+ return n.type === "cursor" ? {
2078
+ ...n,
2079
+ suggestionTypes: ["conjunction"]
2080
+ } : e !== null ? e : le.function.buildNode("is", "*", "*");
2081
+ }, w = function() {
2082
+ return ko;
2083
+ }, x = function(e, n) {
2084
+ const l = [e, n].find((u) => u.type === "cursor");
2085
+ return l || W("or", [e, n]);
2086
+ }, _ = function(e, n) {
2087
+ const l = [e, n].find((u) => u.type === "cursor");
2088
+ return l || W("and", [e, n]);
2089
+ }, k = function(e) {
2090
+ return e.type === "cursor" ? e : W("not", [e]);
2091
+ }, S = "(", j = { type: "literal", value: "(", description: '"("' }, Ye = ")", te = { type: "literal", value: ")", description: '")"' }, I = function(e, n) {
2092
+ return n.type === "cursor" ? {
2093
+ ...n,
2094
+ suggestionTypes: ["conjunction"]
2095
+ } : e;
2096
+ }, H = ":", R = { type: "literal", value: ":", description: '":"' }, ye = "{", xt = { type: "literal", value: "{", description: '"{"' }, At = "}", kt = { type: "literal", value: "}", description: '"}"' }, Gs = function(e, n, l) {
2097
+ return n.type === "cursor" ? {
2098
+ ...n,
2099
+ nestedPath: n.nestedPath ? `${e.value}.${n.nestedPath}` : e.value
2100
+ } : l.type === "cursor" ? {
2101
+ ...l,
2102
+ suggestionTypes: ["conjunction"]
2103
+ } : W("nested", [e, n]);
2104
+ }, Js = { type: "other", description: "fieldName" }, Vs = function(e, n, l) {
2105
+ if (l.type === "cursor")
2106
+ return {
2107
+ ...l,
2108
+ suggestionTypes: ["conjunction"]
2109
+ };
2110
+ const u = To(n, l);
2111
+ return W("range", [e, u]);
2112
+ }, ei = function(e, n) {
2113
+ return n.type === "cursor" ? {
2114
+ ...n,
2115
+ fieldName: e.value,
2116
+ suggestionTypes: ["value", "conjunction"]
2117
+ } : n(e);
2118
+ }, ti = function(e) {
2119
+ if (e.type === "cursor") {
2120
+ const l = `${e.prefix}${e.suffix}`.trim();
2121
+ return {
2122
+ ...e,
2123
+ fieldName: l,
2124
+ suggestionTypes: ["field", "operator", "conjunction"]
2125
+ };
2126
+ }
2127
+ const n = re(null);
2128
+ return e(n);
2129
+ }, ri = function(e, n) {
2130
+ return n.type === "cursor" ? {
2131
+ ...n,
2132
+ suggestionTypes: ["conjunction"]
2133
+ } : e;
2134
+ }, si = function(e, n) {
2135
+ const l = [e, n].find((u) => u.type === "cursor");
2136
+ return l ? {
2137
+ ...l,
2138
+ suggestionTypes: ["value"]
2139
+ } : (u) => W("or", [e(u), n(u)]);
2140
+ }, ii = function(e, n) {
2141
+ const l = [e, n].find((u) => u.type === "cursor");
2142
+ return l ? {
2143
+ ...l,
2144
+ suggestionTypes: ["value"]
2145
+ } : (u) => W("and", [e(u), n(u)]);
2146
+ }, oi = function(e) {
2147
+ return e.type === "cursor" ? {
2148
+ ...list,
2149
+ suggestionTypes: ["value"]
2150
+ } : (n) => W("not", [e(n)]);
2151
+ }, ni = { type: "other", description: "value" }, ai = function(e) {
2152
+ if (e.type === "cursor") return e;
2153
+ const n = re(!0);
2154
+ return (l) => W("is", [l, e, n]);
2155
+ }, ci = function(e) {
2156
+ if (e.type === "cursor") return e;
2157
+ !Eo && e.type === "wildcard" && le.wildcard.hasLeadingWildcard(e) && M("Leading wildcards are disabled. See query:allowLeadingWildcards in Advanced Settings.");
2158
+ const n = re(!1);
2159
+ return (l) => W("is", [l, e, n]);
2160
+ }, li = { type: "other", description: "OR" }, nr = "or", ar = { type: "literal", value: "or", description: '"or"' }, ui = { type: "other", description: "AND" }, cr = "and", lr = { type: "literal", value: "and", description: '"and"' }, pi = { type: "other", description: "NOT" }, ur = "not", pr = { type: "literal", value: "not", description: '"not"' }, di = { type: "other", description: "literal" }, Pe = '"', Le = { type: "literal", value: '"', description: '"\\""' }, St = function(e, n, l) {
2161
+ const { start: u, end: f } = ro();
2162
+ return {
2163
+ type: "cursor",
2164
+ start: u.offset,
2165
+ end: f.offset - n.length,
2166
+ prefix: e.join(""),
2167
+ suffix: l.join(""),
2168
+ text: to().replace(n, "")
2169
+ };
2170
+ }, fi = function(e) {
2171
+ return re(e.join(""));
2172
+ }, Ne = "\\", De = { type: "literal", value: "\\", description: '"\\\\"' }, hi = /^[\\"]/, bi = { type: "class", value: '[\\\\"]', description: '[\\\\"]' }, Ke = function(e) {
2173
+ return e;
2174
+ }, gi = /^[^"]/, vi = { type: "class", value: '[^"]', description: '[^"]' }, yi = function(e) {
2175
+ const n = e.join("").trim();
2176
+ return n === "null" ? re(null) : n === "true" ? re(!0) : n === "false" ? re(!1) : e.includes(us) ? Oo(n) : re(
2177
+ /^(-?[1-9]+\d*([.]\d+)?)$|^(-?0[.]\d*[1-9]+)$|^0$|^0.0$|^[.]\d{1,}$/.test(n) ? isFinite(n) && (n > Number.MAX_SAFE_INTEGER || n < Number.MIN_SAFE_INTEGER) ? BigInt(n) : Number(n) : n
2178
+ );
2179
+ }, dr = { type: "any", description: "any character" }, Ze = "*", Xe = { type: "literal", value: "*", description: '"*"' }, mi = function() {
2180
+ return us;
2181
+ }, fr = "\\t", $i = { type: "literal", value: "\\t", description: '"\\\\t"' }, _i = function() {
2182
+ return " ";
2183
+ }, hr = "\\r", wi = { type: "literal", value: "\\r", description: '"\\\\r"' }, xi = function() {
2184
+ return "\r";
2185
+ }, br = "\\n", Ai = { type: "literal", value: "\\n", description: '"\\\\n"' }, ki = function() {
2186
+ return `
2187
+ `;
2188
+ }, Si = function(e) {
2189
+ return e;
2190
+ }, Ci = /^[\\():<>"*{}]/, Ei = { type: "class", value: '[\\\\():<>"*{}]', description: '[\\\\():<>"*{}]' }, gr = "<=", Oi = { type: "literal", value: "<=", description: '"<="' }, Ti = function() {
2191
+ return "lte";
2192
+ }, vr = ">=", Pi = { type: "literal", value: ">=", description: '">="' }, Li = function() {
2193
+ return "gte";
2194
+ }, yr = "<", mr = { type: "literal", value: "<", description: '"<"' }, Ni = function() {
2195
+ return "lt";
2196
+ }, $r = ">", _r = { type: "literal", value: ">", description: '">"' }, Di = function() {
2197
+ return "gt";
2198
+ }, ji = { type: "other", description: "whitespace" }, Ri = /^[ \t\r\n]/, Bi = { type: "class", value: "[\\ \\t\\r\\n]", description: "[\\ \\t\\r\\n]" }, Ui = function() {
2199
+ return So;
2200
+ }, wr = "@kuery-cursor@", Mi = { type: "literal", value: "@kuery-cursor@", description: '"@kuery-cursor@"' }, zi = function() {
2201
+ return Co;
2202
+ }, xr = "||", Fi = { type: "literal", value: "||", description: '"||"' }, Qi = function() {
2203
+ M("LuceneOr");
2204
+ }, Ar = "&&", Ii = { type: "literal", value: "&&", description: '"&&"' }, kr = function() {
2205
+ M("LuceneAnd");
2206
+ }, Sr = "+", Cr = { type: "literal", value: "+", description: '"+"' }, Er = "-", Or = { type: "literal", value: "-", description: '"-"' }, Tr = function() {
2207
+ M("LuceneNot");
2208
+ }, Pr = "!", Lr = { type: "literal", value: "!", description: '"!"' }, Nr = "_exists_", Hi = { type: "literal", value: "_exists_", description: '"_exists_"' }, qi = function() {
2209
+ M("LuceneExists");
2210
+ }, Dr = function() {
2211
+ M("LuceneRange");
2212
+ }, jr = "?", Rr = { type: "literal", value: "?", description: '"?"' }, Wi = function() {
2213
+ M("LuceneWildcard");
2214
+ }, Ct = "/", Et = { type: "literal", value: "/", description: '"/"' }, Br = /^[^\/]/, Ur = { type: "class", value: "[^/]", description: "[^/]" }, Yi = function() {
2215
+ M("LuceneRegex");
2216
+ }, Ot = "~", Tt = { type: "literal", value: "~", description: '"~"' }, me = /^[0-9]/, $e = { type: "class", value: "[0-9]", description: "[0-9]" }, Ki = function() {
2217
+ M("LuceneFuzzy");
2218
+ }, Zi = function() {
2219
+ M("LuceneProximity");
2220
+ }, Mr = "^", zr = { type: "literal", value: "^", description: '"^"' }, Xi = function() {
2221
+ M("LuceneBoost");
2222
+ }, Gi = function() {
2223
+ return char;
2224
+ }, Ji = "=", Vi = { type: "literal", value: "=", description: '"="' }, Fr = "[", Qr = { type: "literal", value: "[", description: '"["' }, Ir = "]", Hr = { type: "literal", value: "]", description: '"]"' }, qr = "TO", eo = { type: "literal", value: "TO", description: '"TO"' }, a = 0, $ = 0, Ge = [{ line: 1, column: 1, seenCR: !1 }], q = 0, Pt = [], d = 0, Je;
2225
+ if ("startRule" in c) {
2226
+ if (!(c.startRule in p))
2227
+ throw new Error(`Can't start parsing from rule "` + c.startRule + '".');
2228
+ b = p[c.startRule];
2229
+ }
2230
+ function to() {
2231
+ return i.substring($, a);
2232
+ }
2233
+ function ro() {
2234
+ return Ve($, a);
2235
+ }
2236
+ function M(e) {
2237
+ throw Yr(
2238
+ e,
2239
+ null,
2240
+ i.substring($, a),
2241
+ Ve($, a)
2242
+ );
2243
+ }
2244
+ function Wr(e) {
2245
+ var n = Ge[e], l, u;
2246
+ if (n)
2247
+ return n;
2248
+ for (l = e - 1; !Ge[l]; )
2249
+ l--;
2250
+ for (n = Ge[l], n = {
2251
+ line: n.line,
2252
+ column: n.column,
2253
+ seenCR: n.seenCR
2254
+ }; l < e; )
2255
+ u = i.charAt(l), u === `
2256
+ ` ? (n.seenCR || n.line++, n.column = 1, n.seenCR = !1) : u === "\r" || u === "\u2028" || u === "\u2029" ? (n.line++, n.column = 1, n.seenCR = !0) : (n.column++, n.seenCR = !1), l++;
2257
+ return Ge[e] = n, n;
2258
+ }
2259
+ function Ve(e, n) {
2260
+ var l = Wr(e), u = Wr(n);
2261
+ return {
2262
+ start: {
2263
+ offset: e,
2264
+ line: l.line,
2265
+ column: l.column
2266
+ },
2267
+ end: {
2268
+ offset: n,
2269
+ line: u.line,
2270
+ column: u.column
2271
+ }
2272
+ };
2273
+ }
2274
+ function h(e) {
2275
+ a < q || (a > q && (q = a, Pt = []), Pt.push(e));
2276
+ }
2277
+ function Yr(e, n, l, u) {
2278
+ function f(T) {
2279
+ var P = 1;
2280
+ for (T.sort(function(se, z) {
2281
+ return se.description < z.description ? -1 : se.description > z.description ? 1 : 0;
2282
+ }); P < T.length; )
2283
+ T[P - 1] === T[P] ? T.splice(P, 1) : P++;
2284
+ }
2285
+ function m(T, P) {
2286
+ function se(Po) {
2287
+ function nt(X) {
2288
+ return X.charCodeAt(0).toString(16).toUpperCase();
2289
+ }
2290
+ return Po.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(X) {
2291
+ return "\\x0" + nt(X);
2292
+ }).replace(/[\x10-\x1F\x80-\xFF]/g, function(X) {
2293
+ return "\\x" + nt(X);
2294
+ }).replace(/[\u0100-\u0FFF]/g, function(X) {
2295
+ return "\\u0" + nt(X);
2296
+ }).replace(/[\u1000-\uFFFF]/g, function(X) {
2297
+ return "\\u" + nt(X);
2298
+ });
2299
+ }
2300
+ var z = new Array(T.length), ps, ds, Re;
2301
+ for (Re = 0; Re < T.length; Re++)
2302
+ z[Re] = T[Re].description;
2303
+ return ps = T.length > 1 ? z.slice(0, -1).join(", ") + " or " + z[T.length - 1] : z[0], ds = P ? '"' + se(P) + '"' : "end of input", "Expected " + ps + " but " + ds + " found.";
2304
+ }
2305
+ return n !== null && f(n), new r(
2306
+ e !== null ? e : m(n, l),
2307
+ n,
2308
+ l,
2309
+ u
2310
+ );
2311
+ }
2312
+ function Kr() {
2313
+ var e, n, l, u;
2314
+ for (e = a, n = [], l = y(); l !== t; )
2315
+ n.push(l), l = y();
2316
+ return n !== t ? (l = et(), l === t && (l = null), l !== t ? (u = it(), u !== t ? ($ = e, n = g(l, u), e = n) : (a = e, e = t)) : (a = e, e = t)) : (a = e, e = t), e;
2317
+ }
2318
+ function et() {
2319
+ var e, n, l, u;
2320
+ return e = a, $ = a, n = w(), n ? n = void 0 : n = t, n !== t ? (l = fo(), l !== t ? (n = [n, l], e = n) : (a = e, e = t)) : (a = e, e = t), e === t && (e = a, n = Lt(), n !== t ? (l = tt(), l !== t ? (u = et(), u !== t ? ($ = e, n = x(n, u), e = n) : (a = e, e = t)) : (a = e, e = t)) : (a = e, e = t), e === t && (e = Lt())), e;
2321
+ }
2322
+ function Lt() {
2323
+ var e, n, l, u;
2324
+ return e = a, n = Zr(), n !== t ? (l = rt(), l !== t ? (u = Lt(), u !== t ? ($ = e, n = _(n, u), e = n) : (a = e, e = t)) : (a = e, e = t)) : (a = e, e = t), e === t && (e = Zr()), e;
2325
+ }
2326
+ function Zr() {
2327
+ var e, n, l;
2328
+ return e = a, n = Rt(), n !== t ? (l = Xr(), l !== t ? ($ = e, n = k(l), e = n) : (a = e, e = t)) : (a = e, e = t), e === t && (e = Xr()), e;
2329
+ }
2330
+ function Xr() {
2331
+ var e, n, l, u, f, m;
2332
+ if (e = a, i.charCodeAt(a) === 40 ? (n = S, a++) : (n = t, d === 0 && h(j)), n !== t) {
2333
+ for (l = [], u = y(); u !== t; )
2334
+ l.push(u), u = y();
2335
+ l !== t ? (u = et(), u !== t ? (f = it(), f !== t ? (i.charCodeAt(a) === 41 ? (m = Ye, a++) : (m = t, d === 0 && h(te)), m !== t ? ($ = e, n = I(u, f), e = n) : (a = e, e = t)) : (a = e, e = t)) : (a = e, e = t)) : (a = e, e = t);
2336
+ } else
2337
+ a = e, e = t;
2338
+ return e === t && (e = so()), e;
2339
+ }
2340
+ function so() {
2341
+ var e, n, l, u, f, m, T, P, se, z;
2342
+ if (e = a, n = Nt(), n !== t) {
2343
+ for (l = [], u = y(); u !== t; )
2344
+ l.push(u), u = y();
2345
+ if (l !== t)
2346
+ if (i.charCodeAt(a) === 58 ? (u = H, a++) : (u = t, d === 0 && h(R)), u !== t) {
2347
+ for (f = [], m = y(); m !== t; )
2348
+ f.push(m), m = y();
2349
+ if (f !== t)
2350
+ if (i.charCodeAt(a) === 123 ? (m = ye, a++) : (m = t, d === 0 && h(xt)), m !== t) {
2351
+ for (T = [], P = y(); P !== t; )
2352
+ T.push(P), P = y();
2353
+ T !== t ? (P = et(), P !== t ? (se = it(), se !== t ? (i.charCodeAt(a) === 125 ? (z = At, a++) : (z = t, d === 0 && h(kt)), z !== t ? ($ = e, n = Gs(n, P, se), e = n) : (a = e, e = t)) : (a = e, e = t)) : (a = e, e = t)) : (a = e, e = t);
2354
+ } else
2355
+ a = e, e = t;
2356
+ else
2357
+ a = e, e = t;
2358
+ } else
2359
+ a = e, e = t;
2360
+ else
2361
+ a = e, e = t;
2362
+ } else
2363
+ a = e, e = t;
2364
+ return e === t && (e = io()), e;
2365
+ }
2366
+ function io() {
2367
+ var e;
2368
+ return e = oo(), e === t && (e = no(), e === t && (e = ao())), e;
2369
+ }
2370
+ function Nt() {
2371
+ var e;
2372
+ return d++, e = Bt(), d--, e === t && d === 0 && h(Js), e;
2373
+ }
2374
+ function oo() {
2375
+ var e, n, l, u, f, m;
2376
+ if (e = a, n = Nt(), n !== t) {
2377
+ for (l = [], u = y(); u !== t; )
2378
+ l.push(u), u = y();
2379
+ if (l !== t)
2380
+ if (u = rs(), u !== t) {
2381
+ for (f = [], m = y(); m !== t; )
2382
+ f.push(m), m = y();
2383
+ f !== t ? (m = Bt(), m !== t ? ($ = e, n = Vs(n, u, m), e = n) : (a = e, e = t)) : (a = e, e = t);
2384
+ } else
2385
+ a = e, e = t;
2386
+ else
2387
+ a = e, e = t;
2388
+ } else
2389
+ a = e, e = t;
2390
+ return e;
2391
+ }
2392
+ function no() {
2393
+ var e, n, l, u, f, m;
2394
+ if (e = a, n = Nt(), n !== t) {
2395
+ for (l = [], u = y(); u !== t; )
2396
+ l.push(u), u = y();
2397
+ if (l !== t)
2398
+ if (i.charCodeAt(a) === 58 ? (u = H, a++) : (u = t, d === 0 && h(R)), u !== t) {
2399
+ for (f = [], m = y(); m !== t; )
2400
+ f.push(m), m = y();
2401
+ f !== t ? (m = Dt(), m !== t ? ($ = e, n = ei(n, m), e = n) : (a = e, e = t)) : (a = e, e = t);
2402
+ } else
2403
+ a = e, e = t;
2404
+ else
2405
+ a = e, e = t;
2406
+ } else
2407
+ a = e, e = t;
2408
+ return e;
2409
+ }
2410
+ function ao() {
2411
+ var e, n;
2412
+ return e = a, n = Vr(), n !== t && ($ = e, n = ti(n)), e = n, e;
2413
+ }
2414
+ function Dt() {
2415
+ var e, n, l, u, f, m;
2416
+ if (e = a, i.charCodeAt(a) === 40 ? (n = S, a++) : (n = t, d === 0 && h(j)), n !== t) {
2417
+ for (l = [], u = y(); u !== t; )
2418
+ l.push(u), u = y();
2419
+ l !== t ? (u = Gr(), u !== t ? (f = it(), f !== t ? (i.charCodeAt(a) === 41 ? (m = Ye, a++) : (m = t, d === 0 && h(te)), m !== t ? ($ = e, n = ri(u, f), e = n) : (a = e, e = t)) : (a = e, e = t)) : (a = e, e = t)) : (a = e, e = t);
2420
+ } else
2421
+ a = e, e = t;
2422
+ return e === t && (e = Vr()), e;
2423
+ }
2424
+ function Gr() {
2425
+ var e, n, l, u;
2426
+ return e = a, n = jt(), n !== t ? (l = tt(), l !== t ? (u = Gr(), u !== t ? ($ = e, n = si(n, u), e = n) : (a = e, e = t)) : (a = e, e = t)) : (a = e, e = t), e === t && (e = jt()), e;
2427
+ }
2428
+ function jt() {
2429
+ var e, n, l, u;
2430
+ return e = a, n = Jr(), n !== t ? (l = rt(), l !== t ? (u = jt(), u !== t ? ($ = e, n = ii(n, u), e = n) : (a = e, e = t)) : (a = e, e = t)) : (a = e, e = t), e === t && (e = Jr()), e;
2431
+ }
2432
+ function Jr() {
2433
+ var e, n, l;
2434
+ return e = a, n = Rt(), n !== t ? (l = Dt(), l !== t ? ($ = e, n = oi(l), e = n) : (a = e, e = t)) : (a = e, e = t), e === t && (e = Dt()), e;
2435
+ }
2436
+ function Vr() {
2437
+ var e, n;
2438
+ return d++, e = a, n = st(), n !== t && ($ = e, n = ai(n)), e = n, e === t && (e = a, n = es(), n !== t && ($ = e, n = ci(n)), e = n), d--, e === t && (n = t, d === 0 && h(ni)), e;
2439
+ }
2440
+ function tt() {
2441
+ var e, n, l, u, f;
2442
+ if (d++, e = a, n = [], l = y(), l !== t)
2443
+ for (; l !== t; )
2444
+ n.push(l), l = y();
2445
+ else
2446
+ n = t;
2447
+ if (n !== t)
2448
+ if (i.substr(a, 2).toLowerCase() === nr ? (l = i.substr(a, 2), a += 2) : (l = t, d === 0 && h(ar)), l !== t) {
2449
+ if (u = [], f = y(), f !== t)
2450
+ for (; f !== t; )
2451
+ u.push(f), f = y();
2452
+ else
2453
+ u = t;
2454
+ u !== t ? (n = [n, l, u], e = n) : (a = e, e = t);
2455
+ } else
2456
+ a = e, e = t;
2457
+ else
2458
+ a = e, e = t;
2459
+ return e === t && (e = a, $ = a, n = w(), n ? n = void 0 : n = t, n !== t ? (l = ss(), l !== t ? (n = [n, l], e = n) : (a = e, e = t)) : (a = e, e = t)), d--, e === t && (n = t, d === 0 && h(li)), e;
2460
+ }
2461
+ function rt() {
2462
+ var e, n, l, u, f;
2463
+ if (d++, e = a, n = [], l = y(), l !== t)
2464
+ for (; l !== t; )
2465
+ n.push(l), l = y();
2466
+ else
2467
+ n = t;
2468
+ if (n !== t)
2469
+ if (i.substr(a, 3).toLowerCase() === cr ? (l = i.substr(a, 3), a += 3) : (l = t, d === 0 && h(lr)), l !== t) {
2470
+ if (u = [], f = y(), f !== t)
2471
+ for (; f !== t; )
2472
+ u.push(f), f = y();
2473
+ else
2474
+ u = t;
2475
+ u !== t ? (n = [n, l, u], e = n) : (a = e, e = t);
2476
+ } else
2477
+ a = e, e = t;
2478
+ else
2479
+ a = e, e = t;
2480
+ return e === t && (e = a, $ = a, n = w(), n ? n = void 0 : n = t, n !== t ? (l = is(), l !== t ? (n = [n, l], e = n) : (a = e, e = t)) : (a = e, e = t)), d--, e === t && (n = t, d === 0 && h(ui)), e;
2481
+ }
2482
+ function Rt() {
2483
+ var e, n, l, u;
2484
+ if (d++, e = a, i.substr(a, 3).toLowerCase() === ur ? (n = i.substr(a, 3), a += 3) : (n = t, d === 0 && h(pr)), n !== t) {
2485
+ if (l = [], u = y(), u !== t)
2486
+ for (; u !== t; )
2487
+ l.push(u), u = y();
2488
+ else
2489
+ l = t;
2490
+ l !== t ? (n = [n, l], e = n) : (a = e, e = t);
2491
+ } else
2492
+ a = e, e = t;
2493
+ return e === t && (e = a, $ = a, n = w(), n ? n = void 0 : n = t, n !== t ? (l = os(), l !== t ? (n = [n, l], e = n) : (a = e, e = t)) : (a = e, e = t)), d--, e === t && (n = t, d === 0 && h(pi)), e;
2494
+ }
2495
+ function Bt() {
2496
+ var e;
2497
+ return d++, e = st(), e === t && (e = es()), d--, e === t && d === 0 && h(di), e;
2498
+ }
2499
+ function st() {
2500
+ var e, n, l, u, f, m;
2501
+ if (e = a, i.charCodeAt(a) === 34 ? (n = Pe, a++) : (n = t, d === 0 && h(Le)), n !== t) {
2502
+ for (l = [], u = _e(); u !== t; )
2503
+ l.push(u), u = _e();
2504
+ if (l !== t)
2505
+ if (u = je(), u !== t) {
2506
+ for (f = [], m = _e(); m !== t; )
2507
+ f.push(m), m = _e();
2508
+ f !== t ? (i.charCodeAt(a) === 34 ? (m = Pe, a++) : (m = t, d === 0 && h(Le)), m !== t ? ($ = e, n = St(l, u, f), e = n) : (a = e, e = t)) : (a = e, e = t);
2509
+ } else
2510
+ a = e, e = t;
2511
+ else
2512
+ a = e, e = t;
2513
+ } else
2514
+ a = e, e = t;
2515
+ if (e === t)
2516
+ if (e = a, i.charCodeAt(a) === 34 ? (n = Pe, a++) : (n = t, d === 0 && h(Le)), n !== t) {
2517
+ for (l = [], u = _e(); u !== t; )
2518
+ l.push(u), u = _e();
2519
+ l !== t ? (i.charCodeAt(a) === 34 ? (u = Pe, a++) : (u = t, d === 0 && h(Le)), u !== t ? ($ = e, n = fi(l), e = n) : (a = e, e = t)) : (a = e, e = t);
2520
+ } else
2521
+ a = e, e = t;
2522
+ return e;
2523
+ }
2524
+ function _e() {
2525
+ var e, n, l;
2526
+ return e = Ut(), e === t && (e = a, i.charCodeAt(a) === 92 ? (n = Ne, a++) : (n = t, d === 0 && h(De)), n !== t ? (hi.test(i.charAt(a)) ? (l = i.charAt(a), a++) : (l = t, d === 0 && h(bi)), l !== t ? ($ = e, n = Ke(l), e = n) : (a = e, e = t)) : (a = e, e = t), e === t && (e = a, n = a, d++, l = je(), d--, l === t ? n = void 0 : (a = n, n = t), n !== t ? (gi.test(i.charAt(a)) ? (l = i.charAt(a), a++) : (l = t, d === 0 && h(vi)), l !== t ? ($ = e, n = Ke(l), e = n) : (a = e, e = t)) : (a = e, e = t))), e;
2527
+ }
2528
+ function es() {
2529
+ var e, n, l, u, f;
2530
+ for (e = a, n = [], l = we(); l !== t; )
2531
+ n.push(l), l = we();
2532
+ if (n !== t)
2533
+ if (l = je(), l !== t) {
2534
+ for (u = [], f = we(); f !== t; )
2535
+ u.push(f), f = we();
2536
+ u !== t ? ($ = e, n = St(n, l, u), e = n) : (a = e, e = t);
2537
+ } else
2538
+ a = e, e = t;
2539
+ else
2540
+ a = e, e = t;
2541
+ if (e === t) {
2542
+ if (e = a, n = [], l = we(), l !== t)
2543
+ for (; l !== t; )
2544
+ n.push(l), l = we();
2545
+ else
2546
+ n = t;
2547
+ n !== t && ($ = e, n = yi(n)), e = n;
2548
+ }
2549
+ return e;
2550
+ }
2551
+ function we() {
2552
+ var e, n, l, u, f;
2553
+ return e = Ut(), e === t && (e = lo(), e === t && (e = uo(), e === t && (e = co(), e === t && (e = a, n = a, d++, l = ts(), d--, l === t ? n = void 0 : (a = n, n = t), n !== t ? (l = a, d++, u = po(), d--, u === t ? l = void 0 : (a = l, l = t), l !== t ? (u = a, d++, f = je(), d--, f === t ? u = void 0 : (a = u, u = t), u !== t ? (i.length > a ? (f = i.charAt(a), a++) : (f = t, d === 0 && h(dr)), f !== t ? ($ = e, n = Ke(f), e = n) : (a = e, e = t)) : (a = e, e = t)) : (a = e, e = t)) : (a = e, e = t))))), e;
2554
+ }
2555
+ function co() {
2556
+ var e, n;
2557
+ return e = a, i.charCodeAt(a) === 42 ? (n = Ze, a++) : (n = t, d === 0 && h(Xe)), n !== t && ($ = e, n = mi()), e = n, e;
2558
+ }
2559
+ function it() {
2560
+ var e, n, l, u, f;
2561
+ for (e = a, n = [], l = y(); l !== t; )
2562
+ n.push(l), l = y();
2563
+ if (n !== t)
2564
+ if (l = je(), l !== t) {
2565
+ for (u = [], f = y(); f !== t; )
2566
+ u.push(f), f = y();
2567
+ u !== t ? ($ = e, n = St(n, l, u), e = n) : (a = e, e = t);
2568
+ } else
2569
+ a = e, e = t;
2570
+ else
2571
+ a = e, e = t;
2572
+ if (e === t)
2573
+ for (e = [], n = y(); n !== t; )
2574
+ e.push(n), n = y();
2575
+ return e;
2576
+ }
2577
+ function Ut() {
2578
+ var e, n;
2579
+ return e = a, i.substr(a, 2) === fr ? (n = fr, a += 2) : (n = t, d === 0 && h($i)), n !== t && ($ = e, n = _i()), e = n, e === t && (e = a, i.substr(a, 2) === hr ? (n = hr, a += 2) : (n = t, d === 0 && h(wi)), n !== t && ($ = e, n = xi()), e = n, e === t && (e = a, i.substr(a, 2) === br ? (n = br, a += 2) : (n = t, d === 0 && h(Ai)), n !== t && ($ = e, n = ki()), e = n)), e;
2580
+ }
2581
+ function lo() {
2582
+ var e, n, l;
2583
+ return e = a, i.charCodeAt(a) === 92 ? (n = Ne, a++) : (n = t, d === 0 && h(De)), n !== t ? (l = ts(), l !== t ? ($ = e, n = Ke(l), e = n) : (a = e, e = t)) : (a = e, e = t), e;
2584
+ }
2585
+ function uo() {
2586
+ var e, n, l;
2587
+ return e = a, i.charCodeAt(a) === 92 ? (n = Ne, a++) : (n = t, d === 0 && h(De)), n !== t ? (i.substr(a, 2).toLowerCase() === nr ? (l = i.substr(a, 2), a += 2) : (l = t, d === 0 && h(ar)), l === t && (i.substr(a, 3).toLowerCase() === cr ? (l = i.substr(a, 3), a += 3) : (l = t, d === 0 && h(lr)), l === t && (i.substr(a, 3).toLowerCase() === ur ? (l = i.substr(a, 3), a += 3) : (l = t, d === 0 && h(pr)))), l !== t ? ($ = e, n = Si(l), e = n) : (a = e, e = t)) : (a = e, e = t), e;
2588
+ }
2589
+ function po() {
2590
+ var e;
2591
+ return e = tt(), e === t && (e = rt(), e === t && (e = Rt())), e;
2592
+ }
2593
+ function ts() {
2594
+ var e;
2595
+ return Ci.test(i.charAt(a)) ? (e = i.charAt(a), a++) : (e = t, d === 0 && h(Ei)), e;
2596
+ }
2597
+ function rs() {
2598
+ var e, n;
2599
+ return e = a, i.substr(a, 2) === gr ? (n = gr, a += 2) : (n = t, d === 0 && h(Oi)), n !== t && ($ = e, n = Ti()), e = n, e === t && (e = a, i.substr(a, 2) === vr ? (n = vr, a += 2) : (n = t, d === 0 && h(Pi)), n !== t && ($ = e, n = Li()), e = n, e === t && (e = a, i.charCodeAt(a) === 60 ? (n = yr, a++) : (n = t, d === 0 && h(mr)), n !== t && ($ = e, n = Ni()), e = n, e === t && (e = a, i.charCodeAt(a) === 62 ? (n = $r, a++) : (n = t, d === 0 && h(_r)), n !== t && ($ = e, n = Di()), e = n))), e;
2600
+ }
2601
+ function y() {
2602
+ var e;
2603
+ return d++, Ri.test(i.charAt(a)) ? (e = i.charAt(a), a++) : (e = t, d === 0 && h(Bi)), d--, e === t && d === 0 && h(ji), e;
2604
+ }
2605
+ function je() {
2606
+ var e, n, l;
2607
+ return e = a, $ = a, n = Ui(), n ? n = void 0 : n = t, n !== t ? (i.substr(a, 14) === wr ? (l = wr, a += 14) : (l = t, d === 0 && h(Mi)), l !== t ? ($ = e, n = zi(), e = n) : (a = e, e = t)) : (a = e, e = t), e;
2608
+ }
2609
+ function ss() {
2610
+ var e, n, l, u, f;
2611
+ for (e = a, n = [], l = y(); l !== t; )
2612
+ n.push(l), l = y();
2613
+ if (n !== t)
2614
+ if (i.substr(a, 2) === xr ? (l = xr, a += 2) : (l = t, d === 0 && h(Fi)), l !== t) {
2615
+ for (u = [], f = y(); f !== t; )
2616
+ u.push(f), f = y();
2617
+ u !== t ? ($ = e, n = Qi(), e = n) : (a = e, e = t);
2618
+ } else
2619
+ a = e, e = t;
2620
+ else
2621
+ a = e, e = t;
2622
+ return e;
2623
+ }
2624
+ function is() {
2625
+ var e, n, l, u, f;
2626
+ for (e = a, n = [], l = y(); l !== t; )
2627
+ n.push(l), l = y();
2628
+ if (n !== t)
2629
+ if (i.substr(a, 2) === Ar ? (l = Ar, a += 2) : (l = t, d === 0 && h(Ii)), l !== t) {
2630
+ for (u = [], f = y(); f !== t; )
2631
+ u.push(f), f = y();
2632
+ u !== t ? ($ = e, n = kr(), e = n) : (a = e, e = t);
2633
+ } else
2634
+ a = e, e = t;
2635
+ else
2636
+ a = e, e = t;
2637
+ return e === t && (e = a, i.charCodeAt(a) === 43 ? (n = Sr, a++) : (n = t, d === 0 && h(Cr)), n !== t && ($ = e, n = kr()), e = n), e;
2638
+ }
2639
+ function os() {
2640
+ var e, n;
2641
+ return e = a, i.charCodeAt(a) === 45 ? (n = Er, a++) : (n = t, d === 0 && h(Or)), n !== t && ($ = e, n = Tr()), e = n, e === t && (e = a, i.charCodeAt(a) === 33 ? (n = Pr, a++) : (n = t, d === 0 && h(Lr)), n !== t && ($ = e, n = Tr()), e = n), e;
2642
+ }
2643
+ function fo() {
2644
+ var e;
2645
+ return e = ho(), e === t && (e = ns(), e === t && (e = bo())), e;
2646
+ }
2647
+ function ho() {
2648
+ var e, n, l, u, f, m;
2649
+ if (e = a, n = xe(), n !== t) {
2650
+ for (l = [], u = y(); u !== t; )
2651
+ l.push(u), u = y();
2652
+ if (l !== t)
2653
+ if (i.charCodeAt(a) === 58 ? (u = H, a++) : (u = t, d === 0 && h(R)), u !== t) {
2654
+ for (f = [], m = y(); m !== t; )
2655
+ f.push(m), m = y();
2656
+ f !== t ? (m = ns(), m !== t ? (n = [n, l, u, f, m], e = n) : (a = e, e = t)) : (a = e, e = t);
2657
+ } else
2658
+ a = e, e = t;
2659
+ else
2660
+ a = e, e = t;
2661
+ } else
2662
+ a = e, e = t;
2663
+ return e;
2664
+ }
2665
+ function ns() {
2666
+ var e;
2667
+ return e = go(), e === t && (e = Mt(), e === t && (e = vo(), e === t && (e = yo(), e === t && (e = mo(), e === t && (e = $o()))))), e;
2668
+ }
2669
+ function bo() {
2670
+ var e, n, l, u, f, m;
2671
+ if (e = a, i.substr(a, 8) === Nr ? (n = Nr, a += 8) : (n = t, d === 0 && h(Hi)), n !== t) {
2672
+ for (l = [], u = y(); u !== t; )
2673
+ l.push(u), u = y();
2674
+ if (l !== t)
2675
+ if (i.charCodeAt(a) === 58 ? (u = H, a++) : (u = t, d === 0 && h(R)), u !== t) {
2676
+ for (f = [], m = y(); m !== t; )
2677
+ f.push(m), m = y();
2678
+ f !== t ? (m = xe(), m !== t ? ($ = e, n = qi(), e = n) : (a = e, e = t)) : (a = e, e = t);
2679
+ } else
2680
+ a = e, e = t;
2681
+ else
2682
+ a = e, e = t;
2683
+ } else
2684
+ a = e, e = t;
2685
+ return e;
2686
+ }
2687
+ function go() {
2688
+ var e, n, l, u, f, m, T;
2689
+ if (e = a, n = rs(), n !== t) {
2690
+ for (l = [], u = y(); u !== t; )
2691
+ l.push(u), u = y();
2692
+ l !== t ? (u = xe(), u !== t ? ($ = e, n = Dr(), e = n) : (a = e, e = t)) : (a = e, e = t);
2693
+ } else
2694
+ a = e, e = t;
2695
+ if (e === t)
2696
+ if (e = a, n = xo(), n !== t) {
2697
+ for (l = [], u = y(); u !== t; )
2698
+ l.push(u), u = y();
2699
+ l !== t ? (u = xe(), u !== t ? (f = ls(), f !== t ? (m = xe(), m !== t ? (T = Ao(), T !== t ? ($ = e, n = Dr(), e = n) : (a = e, e = t)) : (a = e, e = t)) : (a = e, e = t)) : (a = e, e = t)) : (a = e, e = t);
2700
+ } else
2701
+ a = e, e = t;
2702
+ return e;
2703
+ }
2704
+ function Mt() {
2705
+ var e, n, l, u, f;
2706
+ for (e = a, n = [], l = ot(), l === t && (i.charCodeAt(a) === 42 ? (l = Ze, a++) : (l = t, d === 0 && h(Xe))); l !== t; )
2707
+ n.push(l), l = ot(), l === t && (i.charCodeAt(a) === 42 ? (l = Ze, a++) : (l = t, d === 0 && h(Xe)));
2708
+ if (n !== t)
2709
+ if (i.charCodeAt(a) === 63 ? (l = jr, a++) : (l = t, d === 0 && h(Rr)), l !== t) {
2710
+ for (u = [], f = Mt(); f !== t; )
2711
+ u.push(f), f = Mt();
2712
+ u !== t ? ($ = e, n = Wi(), e = n) : (a = e, e = t);
2713
+ } else
2714
+ a = e, e = t;
2715
+ else
2716
+ a = e, e = t;
2717
+ return e;
2718
+ }
2719
+ function vo() {
2720
+ var e, n, l, u;
2721
+ if (e = a, i.charCodeAt(a) === 47 ? (n = Ct, a++) : (n = t, d === 0 && h(Et)), n !== t) {
2722
+ for (l = [], Br.test(i.charAt(a)) ? (u = i.charAt(a), a++) : (u = t, d === 0 && h(Ur)); u !== t; )
2723
+ l.push(u), Br.test(i.charAt(a)) ? (u = i.charAt(a), a++) : (u = t, d === 0 && h(Ur));
2724
+ l !== t ? (i.charCodeAt(a) === 47 ? (u = Ct, a++) : (u = t, d === 0 && h(Et)), u !== t ? ($ = e, n = Yi(), e = n) : (a = e, e = t)) : (a = e, e = t);
2725
+ } else
2726
+ a = e, e = t;
2727
+ return e;
2728
+ }
2729
+ function yo() {
2730
+ var e, n, l, u, f;
2731
+ if (e = a, n = as(), n !== t)
2732
+ if (i.charCodeAt(a) === 126 ? (l = Ot, a++) : (l = t, d === 0 && h(Tt)), l !== t) {
2733
+ for (u = [], me.test(i.charAt(a)) ? (f = i.charAt(a), a++) : (f = t, d === 0 && h($e)); f !== t; )
2734
+ u.push(f), me.test(i.charAt(a)) ? (f = i.charAt(a), a++) : (f = t, d === 0 && h($e));
2735
+ u !== t ? ($ = e, n = Ki(), e = n) : (a = e, e = t);
2736
+ } else
2737
+ a = e, e = t;
2738
+ else
2739
+ a = e, e = t;
2740
+ return e;
2741
+ }
2742
+ function mo() {
2743
+ var e, n, l, u, f;
2744
+ if (e = a, n = st(), n !== t)
2745
+ if (i.charCodeAt(a) === 126 ? (l = Ot, a++) : (l = t, d === 0 && h(Tt)), l !== t) {
2746
+ for (u = [], me.test(i.charAt(a)) ? (f = i.charAt(a), a++) : (f = t, d === 0 && h($e)); f !== t; )
2747
+ u.push(f), me.test(i.charAt(a)) ? (f = i.charAt(a), a++) : (f = t, d === 0 && h($e));
2748
+ u !== t ? ($ = e, n = Zi(), e = n) : (a = e, e = t);
2749
+ } else
2750
+ a = e, e = t;
2751
+ else
2752
+ a = e, e = t;
2753
+ return e;
2754
+ }
2755
+ function $o() {
2756
+ var e, n, l, u, f;
2757
+ if (e = a, n = xe(), n !== t)
2758
+ if (i.charCodeAt(a) === 94 ? (l = Mr, a++) : (l = t, d === 0 && h(zr)), l !== t) {
2759
+ for (u = [], me.test(i.charAt(a)) ? (f = i.charAt(a), a++) : (f = t, d === 0 && h($e)); f !== t; )
2760
+ u.push(f), me.test(i.charAt(a)) ? (f = i.charAt(a), a++) : (f = t, d === 0 && h($e));
2761
+ u !== t ? ($ = e, n = Xi(), e = n) : (a = e, e = t);
2762
+ } else
2763
+ a = e, e = t;
2764
+ else
2765
+ a = e, e = t;
2766
+ return e;
2767
+ }
2768
+ function xe() {
2769
+ var e;
2770
+ return e = st(), e === t && (e = as()), e;
2771
+ }
2772
+ function as() {
2773
+ var e, n;
2774
+ if (e = [], n = ot(), n !== t)
2775
+ for (; n !== t; )
2776
+ e.push(n), n = ot();
2777
+ else
2778
+ e = t;
2779
+ return e;
2780
+ }
2781
+ function ot() {
2782
+ var e, n, l, u;
2783
+ return e = Ut(), e === t && (e = wo(), e === t && (e = a, n = a, d++, l = cs(), d--, l === t ? n = void 0 : (a = n, n = t), n !== t ? (l = a, d++, u = _o(), d--, u === t ? l = void 0 : (a = l, l = t), l !== t ? (i.length > a ? (u = i.charAt(a), a++) : (u = t, d === 0 && h(dr)), u !== t ? (n = [n, l, u], e = n) : (a = e, e = t)) : (a = e, e = t)) : (a = e, e = t))), e;
2784
+ }
2785
+ function _o() {
2786
+ var e;
2787
+ return e = tt(), e === t && (e = rt(), e === t && (e = ss(), e === t && (e = is(), e === t && (e = os(), e === t && (e = ls()))))), e;
2788
+ }
2789
+ function wo() {
2790
+ var e, n, l;
2791
+ return e = a, i.charCodeAt(a) === 92 ? (n = Ne, a++) : (n = t, d === 0 && h(De)), n !== t ? (l = cs(), l !== t ? ($ = e, n = Gi(), e = n) : (a = e, e = t)) : (a = e, e = t), e;
2792
+ }
2793
+ function cs() {
2794
+ var e;
2795
+ return i.charCodeAt(a) === 43 ? (e = Sr, a++) : (e = t, d === 0 && h(Cr)), e === t && (i.charCodeAt(a) === 45 ? (e = Er, a++) : (e = t, d === 0 && h(Or)), e === t && (i.charCodeAt(a) === 61 ? (e = Ji, a++) : (e = t, d === 0 && h(Vi)), e === t && (i.charCodeAt(a) === 62 ? (e = $r, a++) : (e = t, d === 0 && h(_r)), e === t && (i.charCodeAt(a) === 60 ? (e = yr, a++) : (e = t, d === 0 && h(mr)), e === t && (i.charCodeAt(a) === 33 ? (e = Pr, a++) : (e = t, d === 0 && h(Lr)), e === t && (i.charCodeAt(a) === 40 ? (e = S, a++) : (e = t, d === 0 && h(j)), e === t && (i.charCodeAt(a) === 41 ? (e = Ye, a++) : (e = t, d === 0 && h(te)), e === t && (i.charCodeAt(a) === 123 ? (e = ye, a++) : (e = t, d === 0 && h(xt)), e === t && (i.charCodeAt(a) === 125 ? (e = At, a++) : (e = t, d === 0 && h(kt)), e === t && (i.charCodeAt(a) === 91 ? (e = Fr, a++) : (e = t, d === 0 && h(Qr)), e === t && (i.charCodeAt(a) === 93 ? (e = Ir, a++) : (e = t, d === 0 && h(Hr)), e === t && (i.charCodeAt(a) === 94 ? (e = Mr, a++) : (e = t, d === 0 && h(zr)), e === t && (i.charCodeAt(a) === 34 ? (e = Pe, a++) : (e = t, d === 0 && h(Le)), e === t && (i.charCodeAt(a) === 126 ? (e = Ot, a++) : (e = t, d === 0 && h(Tt)), e === t && (i.charCodeAt(a) === 42 ? (e = Ze, a++) : (e = t, d === 0 && h(Xe)), e === t && (i.charCodeAt(a) === 63 ? (e = jr, a++) : (e = t, d === 0 && h(Rr)), e === t && (i.charCodeAt(a) === 58 ? (e = H, a++) : (e = t, d === 0 && h(R)), e === t && (i.charCodeAt(a) === 92 ? (e = Ne, a++) : (e = t, d === 0 && h(De)), e === t && (i.charCodeAt(a) === 47 ? (e = Ct, a++) : (e = t, d === 0 && h(Et))))))))))))))))))))), e;
2796
+ }
2797
+ function ls() {
2798
+ var e, n, l, u, f;
2799
+ if (e = a, n = [], l = y(), l !== t)
2800
+ for (; l !== t; )
2801
+ n.push(l), l = y();
2802
+ else
2803
+ n = t;
2804
+ if (n !== t)
2805
+ if (i.substr(a, 2) === qr ? (l = qr, a += 2) : (l = t, d === 0 && h(eo)), l !== t) {
2806
+ if (u = [], f = y(), f !== t)
2807
+ for (; f !== t; )
2808
+ u.push(f), f = y();
2809
+ else
2810
+ u = t;
2811
+ u !== t ? (n = [n, l, u], e = n) : (a = e, e = t);
2812
+ } else
2813
+ a = e, e = t;
2814
+ else
2815
+ a = e, e = t;
2816
+ return e;
2817
+ }
2818
+ function xo() {
2819
+ var e;
2820
+ return i.charCodeAt(a) === 91 ? (e = Fr, a++) : (e = t, d === 0 && h(Qr)), e === t && (i.charCodeAt(a) === 123 ? (e = ye, a++) : (e = t, d === 0 && h(xt))), e;
2821
+ }
2822
+ function Ao() {
2823
+ var e;
2824
+ return i.charCodeAt(a) === 93 ? (e = Ir, a++) : (e = t, d === 0 && h(Hr)), e === t && (i.charCodeAt(a) === 125 ? (e = At, a++) : (e = t, d === 0 && h(kt))), e;
2825
+ }
2826
+ const { errorOnLuceneSyntax: ko, parseCursor: So, cursorSymbol: Co, allowLeadingWildcards: Eo = !0, helpers: { nodeTypes: le } } = c, W = le.function.buildNodeWithArgumentNodes, re = le.literal.buildNode, Oo = le.wildcard.buildNode, To = le.namedArg.buildNode, { wildcardSymbol: us } = le.wildcard;
2827
+ if (Je = b(), Je !== t && a === i.length)
2828
+ return Je;
2829
+ throw Je !== t && a < i.length && h({ type: "end", description: "end of input" }), Yr(
2830
+ null,
2831
+ Pt,
2832
+ q < i.length ? i.charAt(q) : null,
2833
+ q < i.length ? Ve(q, q + 1) : Ve(q, q)
2834
+ );
2835
+ }
2836
+ return {
2837
+ SyntaxError: r,
2838
+ parse: o
2839
+ };
2840
+ }(), rr = (s, r = {}, o = wt) => {
2841
+ if (typeof s > "u")
2842
+ throw new Error("expression must be a string, got undefined instead");
2843
+ return o(s, { ...r, helpers: { nodeTypes: ne } });
2844
+ }, Oe = (s, r = {}) => rr(
2845
+ s,
2846
+ {
2847
+ ...r,
2848
+ startRule: "Literal"
2849
+ },
2850
+ wt
2851
+ ), gt = (s, r = {}) => {
2852
+ try {
2853
+ return rr(s, r, wt);
2854
+ } catch (o) {
2855
+ throw o.name === "SyntaxError" ? new Is(o, s) : o;
2856
+ }
2857
+ }, Pn = (s) => {
2858
+ try {
2859
+ return rr(s, { errorOnLuceneSyntax: !0 }, wt), !1;
2860
+ } catch (r) {
2861
+ return r.message.startsWith("Lucene");
2862
+ }
2863
+ }, N = (s, r, o, i) => (r = void 0, !s || !s.type || !ne[s.type] ? N(ne.function.buildNode("and", []), r) : ne[s.type].toOpenSearchQuery(s, r, o, i)), V = "@kuery-wildcard@";
2864
+ function Ln(s) {
2865
+ return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
2866
+ }
2867
+ function Nn(s) {
2868
+ return s.replace(/[+-=&|><!(){}[\]^"~*?:\\/]/g, "\\$&");
2869
+ }
2870
+ function Dn(s) {
2871
+ return s.includes(V) ? {
2872
+ type: "wildcard",
2873
+ value: s
2874
+ } : Oe(s);
2875
+ }
2876
+ function Hs(s, r) {
2877
+ const { value: o } = s, i = o.split(V).map(Ln).join("[\\s\\S]*");
2878
+ return new RegExp(`^${i}$`).test(r);
2879
+ }
2880
+ function jn(s) {
2881
+ const { value: r } = s;
2882
+ return r.split(V).join("*");
2883
+ }
2884
+ function Kt(s) {
2885
+ const { value: r } = s;
2886
+ return r.split(V).map(Nn).join("*");
2887
+ }
2888
+ function Rn(s) {
2889
+ const { value: r } = s;
2890
+ return r.startsWith(V) && r.replace(V, "").length > 0;
2891
+ }
2892
+ const Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2893
+ __proto__: null,
2894
+ buildNode: Dn,
2895
+ hasLeadingWildcard: Rn,
2896
+ test: Hs,
2897
+ toOpenSearchQuery: jn,
2898
+ toQueryStringQuery: Kt,
2899
+ wildcardSymbol: V
2900
+ }, Symbol.toStringTag, { value: "Module" }));
2901
+ function sr(s, r) {
2902
+ if (!r) return [];
2903
+ if (s.type === "literal") {
2904
+ const o = tr(s), i = r.fields.find((c) => c.name === o);
2905
+ return i ? [i] : [];
2906
+ } else if (s.type === "wildcard")
2907
+ return r.fields.filter((i) => Hs(s, i.name));
2908
+ }
2909
+ function qs(s, r, o) {
2910
+ const i = {
2911
+ ...s,
2912
+ value: o ? `${o}.${s.value}` : s.value
2913
+ };
2914
+ if (!r || i.type === "wildcard" && !o)
2915
+ return i;
2916
+ const t = sr(i, r).reduce((p, b) => {
2917
+ const g = b.subType && b.subType.nested ? b.subType.nested.path : void 0;
2918
+ return o && !g ? [
2919
+ ...p,
2920
+ `${b.name} is not a nested field but is in nested group "${o}" in the DQL expression.`
2921
+ ] : g && !o ? [
2922
+ ...p,
2923
+ `${b.name} is a nested field, but is not in a nested group in the DQL expression.`
2924
+ ] : g !== o ? [
2925
+ ...p,
2926
+ `Nested field ${b.name} is being queried with the incorrect nested path. The correct path is ${b.subType.nested.path}.`
2927
+ ] : p;
2928
+ }, []);
2929
+ if (t.length > 0)
2930
+ throw new Error(t.join(`
2931
+ `));
2932
+ return i;
2933
+ }
2934
+ function Un(s, r, o = !1) {
2935
+ if (s === void 0)
2936
+ throw new Error("fieldName is a required argument");
2937
+ if (r === void 0)
2938
+ throw new Error("value is a required argument");
2939
+ const i = typeof s == "string" ? Oe(s) : Se(s), c = typeof r == "string" ? Oe(r) : Se(r), t = Se(o);
2940
+ return {
2941
+ arguments: [i, c, t]
2942
+ };
2943
+ }
2944
+ function Mn(s, r, o = {}, i = {}) {
2945
+ const {
2946
+ arguments: [c, t, p]
2947
+ } = s, b = qs(
2948
+ c,
2949
+ r,
2950
+ i != null && i.nested ? i.nested.path : void 0
2951
+ ), g = N(b), w = t !== void 0 ? N(t) : t, x = p.value ? "phrase" : "best_fields";
2952
+ if (b.value === null)
2953
+ return t.type === "wildcard" ? {
2954
+ query_string: {
2955
+ query: Kt(t)
2956
+ }
2957
+ } : {
2958
+ multi_match: {
2959
+ type: x,
2960
+ query: w,
2961
+ lenient: !0
2962
+ }
2963
+ };
2964
+ const _ = r ? sr(b, r) : [];
2965
+ _ && _.length === 0 && _.push({
2966
+ name: N(b),
2967
+ scripted: !1,
2968
+ type: ""
2969
+ });
2970
+ const k = t.type === "wildcard" && w === "*", S = b.type === "wildcard" && g === "*" || _ && r && _.length === r.fields.length;
2971
+ return k && S ? { match_all: {} } : {
2972
+ bool: {
2973
+ should: _.reduce((te, I) => {
2974
+ const H = (R) => {
2975
+ var ye;
2976
+ return b.type !== "wildcard" || !((ye = I.subType) != null && ye.nested) || i != null && i.nested ? R : {
2977
+ nested: {
2978
+ path: I.subType.nested.path,
2979
+ query: R,
2980
+ score_mode: "none"
2981
+ }
2982
+ };
2983
+ };
2984
+ if (I.scripted)
2985
+ return [];
2986
+ if (k)
2987
+ return [
2988
+ ...te,
2989
+ H({
2990
+ exists: {
2991
+ field: I.name
2992
+ }
2993
+ })
2994
+ ];
2995
+ if (t.type === "wildcard")
2996
+ return [
2997
+ ...te,
2998
+ H({
2999
+ query_string: {
3000
+ fields: [I.name],
3001
+ query: Kt(t)
3002
+ }
3003
+ })
3004
+ ];
3005
+ if (I.type === "date") {
3006
+ const R = o.dateFormatTZ ? { time_zone: o.dateFormatTZ } : {};
3007
+ return [
3008
+ ...te,
3009
+ H({
3010
+ range: {
3011
+ [I.name]: {
3012
+ gte: w,
3013
+ lte: w,
3014
+ ...R
3015
+ }
3016
+ }
3017
+ })
3018
+ ];
3019
+ } else {
3020
+ const R = x === "phrase" ? "match_phrase" : "match";
3021
+ return [
3022
+ ...te,
3023
+ H({
3024
+ [R]: {
3025
+ [I.name]: w
3026
+ }
3027
+ })
3028
+ ];
3029
+ }
3030
+ }, []) || [],
3031
+ minimum_should_match: 1
3032
+ }
3033
+ };
3034
+ }
3035
+ const zn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3036
+ __proto__: null,
3037
+ buildNodeParams: Un,
3038
+ toOpenSearchQuery: Mn
3039
+ }, Symbol.toStringTag, { value: "Module" }));
3040
+ function Fn(s) {
3041
+ return {
3042
+ arguments: s
3043
+ };
3044
+ }
3045
+ function Qn(s, r, o = {}, i = {}) {
3046
+ return {
3047
+ bool: {
3048
+ filter: (s.arguments || []).map((t) => N(t, r, o, i))
3049
+ }
3050
+ };
3051
+ }
3052
+ const In = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3053
+ __proto__: null,
3054
+ buildNodeParams: Fn,
3055
+ toOpenSearchQuery: Qn
3056
+ }, Symbol.toStringTag, { value: "Module" }));
3057
+ function Hn(s) {
3058
+ return {
3059
+ arguments: s
3060
+ };
3061
+ }
3062
+ function qn(s, r, o = {}, i = {}) {
3063
+ return {
3064
+ bool: {
3065
+ should: (s.arguments || []).map((t) => N(t, r, o, i)),
3066
+ minimum_should_match: 1
3067
+ }
3068
+ };
3069
+ }
3070
+ const Wn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3071
+ __proto__: null,
3072
+ buildNodeParams: Hn,
3073
+ toOpenSearchQuery: qn
3074
+ }, Symbol.toStringTag, { value: "Module" }));
3075
+ function Yn(s) {
3076
+ return {
3077
+ arguments: [s]
3078
+ };
3079
+ }
3080
+ function Kn(s, r, o = {}, i = {}) {
3081
+ const [c] = s.arguments;
3082
+ return {
3083
+ bool: {
3084
+ must_not: N(c, r, o, i)
3085
+ }
3086
+ };
3087
+ }
3088
+ const Zn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3089
+ __proto__: null,
3090
+ buildNodeParams: Yn,
3091
+ toOpenSearchQuery: Kn
3092
+ }, Symbol.toStringTag, { value: "Module" }));
3093
+ function Xn(s, ...r) {
3094
+ let o = {};
3095
+ for (let i of r)
3096
+ o[i] = s[i];
3097
+ return o;
3098
+ }
3099
+ function Gn(s, r) {
3100
+ const o = Xn(r, "gt", "lt", "gte", "lte", "format"), i = typeof s == "string" ? Oe(s) : ne.literal.buildNode(s), c = Object.entries(o).map((t) => {
3101
+ let [p, b] = t;
3102
+ return ne.namedArg.buildNode(p, b);
3103
+ });
3104
+ return {
3105
+ arguments: [i, ...c]
3106
+ };
3107
+ }
3108
+ function Jn(s, r, o = {}, i = {}) {
3109
+ const [c, ...t] = s.arguments, p = qs(
3110
+ c,
3111
+ r,
3112
+ i != null && i.nested ? i.nested.path : void 0
3113
+ ), b = r ? sr(p, r) : [], g = Vn(t), w = Object.fromEntries(Object.entries(g).map(([_, k]) => [_, N(k)]));
3114
+ return b && b.length === 0 && b.push({
3115
+ name: N(p),
3116
+ scripted: !1,
3117
+ type: ""
3118
+ }), {
3119
+ bool: {
3120
+ should: b.map((_) => {
3121
+ const k = (S) => {
3122
+ var j;
3123
+ return p.type !== "wildcard" || !((j = _.subType) != null && j.nested) || i.nested ? S : {
3124
+ nested: {
3125
+ path: _.subType.nested.path,
3126
+ query: S,
3127
+ score_mode: "none"
3128
+ }
3129
+ };
3130
+ };
3131
+ if (_.scripted)
3132
+ return {};
3133
+ if (_.type === "date") {
3134
+ const S = o.dateFormatTZ ? { time_zone: o.dateFormatTZ } : {};
3135
+ return k({
3136
+ range: {
3137
+ [_.name]: {
3138
+ ...w,
3139
+ ...S
3140
+ }
3141
+ }
3142
+ });
3143
+ }
3144
+ return k({
3145
+ range: {
3146
+ [_.name]: w
3147
+ }
3148
+ });
3149
+ }),
3150
+ minimum_should_match: 1
3151
+ }
3152
+ };
3153
+ }
3154
+ function Vn(s) {
3155
+ if (s.gt && s.gte || s.lt && s.lte)
3156
+ throw new Error("range ends cannot be both inclusive and exclusive");
3157
+ const r = ["gte", "lte", "format"];
3158
+ return s.reduce((o, i, c) => (i.type === "namedArg" ? o[i.name] = i.value : o[r[c]] = i, o), {});
3159
+ }
3160
+ const ea = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3161
+ __proto__: null,
3162
+ buildNodeParams: Gn,
3163
+ toOpenSearchQuery: Jn
3164
+ }, Symbol.toStringTag, { value: "Module" }));
3165
+ function ta(s) {
3166
+ return {
3167
+ arguments: [Se(s)]
3168
+ };
3169
+ }
3170
+ function ra(s, r, o = {}, i = {}) {
3171
+ const {
3172
+ arguments: [c]
3173
+ } = s, t = {
3174
+ ...c,
3175
+ value: i != null && i.nested ? `${i.nested.path}.${c.value}` : c.value
3176
+ }, p = tr(t), b = ((r == null ? void 0 : r.fields) || []).find((g) => g.name === p);
3177
+ if (b && b.scripted)
3178
+ throw new Error("Exists query does not support scripted fields");
3179
+ return {
3180
+ exists: { field: p }
3181
+ };
3182
+ }
3183
+ const sa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3184
+ __proto__: null,
3185
+ buildNodeParams: ta,
3186
+ toOpenSearchQuery: ra
3187
+ }, Symbol.toStringTag, { value: "Module" }));
3188
+ function ia(s, r) {
3189
+ return {
3190
+ arguments: [typeof s == "string" ? Oe(s) : Se(s), r]
3191
+ };
3192
+ }
3193
+ function oa(s, r, o = {}, i = {}) {
3194
+ var g;
3195
+ const [c, t] = s.arguments, p = N(c), b = (g = i == null ? void 0 : i.nested) != null && g.path ? `${i.nested.path}.${p}` : p;
3196
+ return {
3197
+ nested: {
3198
+ path: b,
3199
+ query: N(t, r, o, {
3200
+ ...i,
3201
+ nested: { path: b }
3202
+ }),
3203
+ score_mode: "none"
3204
+ }
3205
+ };
3206
+ }
3207
+ const na = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3208
+ __proto__: null,
3209
+ buildNodeParams: ia,
3210
+ toOpenSearchQuery: oa
3211
+ }, Symbol.toStringTag, { value: "Module" })), ir = {
3212
+ is: zn,
3213
+ and: In,
3214
+ or: Wn,
3215
+ not: Zn,
3216
+ range: ea,
3217
+ exists: sa,
3218
+ nested: na
3219
+ };
3220
+ function aa(s, ...r) {
3221
+ const o = ir[s];
3222
+ if (o === void 0)
3223
+ throw new Error(`Unknown function "${s}"`);
3224
+ return {
3225
+ type: "function",
3226
+ function: s,
3227
+ // This requires better typing of the different typings and their return types.
3228
+ // @ts-ignore
3229
+ ...o.buildNodeParams(...r)
3230
+ };
3231
+ }
3232
+ function ca(s, r) {
3233
+ if (ir[s] === void 0)
3234
+ throw new Error(`Unknown function "${s}"`);
3235
+ return {
3236
+ type: "function",
3237
+ function: s,
3238
+ arguments: r
3239
+ };
3240
+ }
3241
+ function la(s, r, o, i) {
3242
+ return ir[s.function].toOpenSearchQuery(s, r, o, i);
3243
+ }
3244
+ const ua = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3245
+ __proto__: null,
3246
+ buildNode: aa,
3247
+ buildNodeWithArgumentNodes: ca,
3248
+ toOpenSearchQuery: la
3249
+ }, Symbol.toStringTag, { value: "Module" }));
3250
+ function pa(s, r) {
3251
+ const o = r.type === "literal" ? r : ne.literal.buildNode(r);
3252
+ return {
3253
+ type: "namedArg",
3254
+ name: s,
3255
+ value: o
3256
+ };
3257
+ }
3258
+ function da(s) {
3259
+ return N(s.value);
3260
+ }
3261
+ const fa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3262
+ __proto__: null,
3263
+ buildNode: pa,
3264
+ toOpenSearchQuery: da
3265
+ }, Symbol.toStringTag, { value: "Module" })), ne = {
3266
+ // This requires better typing of the different typings and their return types.
3267
+ // @ts-ignore
3268
+ function: ua,
3269
+ literal: Tn,
3270
+ namedArg: fa,
3271
+ wildcard: Bn
3272
+ }, ha = V, ba = (s, r) => "(" + (s.arguments || []).map((i) => be(i, r)).join(" AND ") + ")", ga = (s, r) => {
3273
+ var {
3274
+ arguments: [o, i, c]
3275
+ } = s;
3276
+ let t = "=";
3277
+ i.type === "wildcard" && (t = "");
3278
+ let p = be(i);
3279
+ c = c.value || typeof p == "string", i.type === "literal" && c && (p = `'${p}'`), i.type === "literal" && !c && (p = `${p}`);
3280
+ let b = be(o);
3281
+ return b == null ? r && c ? `(${r.filter((g) => g.type === "string").map((g) => `${g.name} ILIKE '%${i.value}%'`).join(" OR ")})` : r && !c && (i.value === !0 || i.value === !1) ? `(${r.filter((g) => g.type === "boolean").map((g) => `${g.name}=${i.value}`).join(" OR ")})` : "" : b + t + p;
3282
+ }, va = (s, r) => "(" + (s.arguments || []).map((i) => be(i, r)).join(" OR ") + ")", ya = (s, r) => {
3283
+ const [o] = s.arguments;
3284
+ return "NOT (" + be(o, r) + ")";
3285
+ }, ma = {
3286
+ gt: ">",
3287
+ lt: "<",
3288
+ gte: ">=",
3289
+ lte: "<="
3290
+ }, $a = (s) => {
3291
+ const [r, o] = s.arguments;
3292
+ let i = o.value;
3293
+ const c = ma[o.name];
3294
+ let t = be(i);
3295
+ return i.type === "literal" && (t = `${t}`), `${r.value} ${c} ${t}`;
3296
+ }, _a = (s) => {
3297
+ const [r] = s.arguments;
3298
+ return `${r.value} IS NOT NULL`;
3299
+ }, wa = (s) => (console.warn("Nested types dont exist in CQL", s), ""), xa = {
3300
+ is: ga,
3301
+ and: ba,
3302
+ or: va,
3303
+ not: ya,
3304
+ range: $a,
3305
+ exists: _a,
3306
+ nested: wa
3307
+ }, Aa = {
3308
+ function: (s, r) => xa[s.function](s, r),
3309
+ literal: (s) => s.value,
3310
+ wildcard: (s) => {
3311
+ const { value: r } = s;
3312
+ return ` LIKE '${r.split(ha).join("%")}'`;
3313
+ }
3314
+ }, be = (s, r) => {
3315
+ const o = Aa[s.type];
3316
+ return o(s, r);
3317
+ }, ka = V, Sa = (s) => ({ $and: (s.arguments || []).map((i) => ae(i)) }), Ca = (s) => {
3318
+ const {
3319
+ arguments: [r, o]
3320
+ } = s;
3321
+ let i = ae(o);
3322
+ if (o.type === "wildcard" && o.value === "@kuery-wildcard@")
3323
+ return Ws(s);
3324
+ let t = {};
3325
+ return t[ae(r)] = { $eq: i }, t;
3326
+ }, Ea = (s) => ({
3327
+ $or: (s.arguments || []).map((o) => ae(o))
3328
+ }), Oa = (s) => {
3329
+ const [r] = s.arguments;
3330
+ let o = {};
3331
+ return o = { $ne: ae(r) }, o;
3332
+ }, Ta = {
3333
+ gt: "$gt",
3334
+ lt: "$lt",
3335
+ gte: "$gte",
3336
+ lte: "$lte"
3337
+ }, Pa = (s) => {
3338
+ const [r, o] = s.arguments;
3339
+ let i = o.value;
3340
+ const c = Ta[o.name];
3341
+ let t = ae(i), p = {};
3342
+ return p[r.value] = {}, p[r.value][c] = t, p;
3343
+ }, Ws = (s) => {
3344
+ const [r] = s.arguments;
3345
+ return { [ae(r)]: { $ne: null } };
3346
+ }, La = (s) => (console.warn("TODO Implement nested search", s), ""), Na = {
3347
+ is: Ca,
3348
+ and: Sa,
3349
+ or: Ea,
3350
+ not: Oa,
3351
+ range: Pa,
3352
+ exists: Ws,
3353
+ nested: La
3354
+ }, Da = {
3355
+ function: (s) => Na[s.function](s),
3356
+ literal: (s) => s.value,
3357
+ wildcard: (s) => {
3358
+ const { value: r } = s;
3359
+ return `/${r.split(ka).join(".*")}/`;
3360
+ }
3361
+ }, ae = (s, r) => {
3362
+ const o = Da[s.type];
3363
+ return o(s, r);
3364
+ }, ja = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3365
+ __proto__: null,
3366
+ DQLSyntaxError: Is,
3367
+ doesKueryExpressionHaveLuceneSyntaxError: Pn,
3368
+ fromKueryExpression: gt,
3369
+ fromLiteralExpression: Oe,
3370
+ nodeTypes: ne,
3371
+ parse: gt,
3372
+ toCql: be,
3373
+ toDSL: N,
3374
+ toMongo: ae,
3375
+ toOpenSearchQuery: N
3376
+ }, Symbol.toStringTag, { value: "Module" })), Ra = K`
3377
+ :host {
3378
+ --dialog-padding: var(--spectric-dialog-padding, 5px);
3379
+ --dialog-background:var(--spectric-background,rgb(246, 249, 252));
3380
+ }
3381
+ dialog {
3382
+ border: 0px solid var(--background-inverse);
3383
+ --spectric-background: var(--dialog-background);
3384
+ --panel-color:var(--dialog-background);
3385
+ padding: 0;
3386
+ border-radius: var(--spectric-border-radius);
3387
+ overflow:hidden;
3388
+
3389
+ }
3390
+ dialog[open]{
3391
+ display:flex;
3392
+ }
3393
+ spectric-panel{
3394
+ margin:0px
3395
+ }
3396
+ dialog::backdrop {
3397
+ background-color: transparent;
3398
+ }
3399
+ dialog.backdrop::backdrop {
3400
+ background-color: rgba(0, 0, 0, 0.5);
3401
+ }
3402
+ .modal{
3403
+ display: flex;
3404
+ overflow: hidden;
3405
+ flex-direction: column;
3406
+ height: 100%;
3407
+ }
3408
+ .content{
3409
+ flex-shrink: 1;
3410
+ overflow: auto;
3411
+ }
3412
+
3413
+ h3 {
3414
+ padding: 1em var(--dialog-padding);
3415
+ margin: 0;
3416
+ }
3417
+
3418
+ spectric-button{
3419
+ position: absolute;
3420
+ right: 0;
3421
+ top: 0;
3422
+ }
3423
+ `;
3424
+ var Ba = Object.defineProperty, Ua = Object.getOwnPropertyDescriptor, ce = (s, r, o, i) => {
3425
+ for (var c = i > 1 ? void 0 : i ? Ua(r, o) : r, t = s.length - 1, p; t >= 0; t--)
3426
+ (p = s[t]) && (c = (i ? p(r, o, c) : p(c)) || c);
3427
+ return i && c && Ba(r, o, c), c;
3428
+ };
3429
+ const Ys = "spectric-dialog";
3430
+ let F = class extends L {
3431
+ constructor() {
3432
+ super(...arguments), this.open = !1, this.dismissable = !0, this.hideBackdrop = !1, this.title = "", this.closeOnEscape = !0, this.closeOnOutsideClick = !0, this.clickHandler = async (s) => {
3433
+ const r = await this.dialogElement;
3434
+ !this.dismissable || !this.closeOnOutsideClick || r === s.target && (this.open = !1);
3435
+ }, this._handleKeyDown = (s) => {
3436
+ this.closeOnEscape || s.preventDefault(), this.open && this.closeOnEscape && s.key === "Escape" && (this.open = !1);
3437
+ }, this._onClose = (s) => {
3438
+ s.preventDefault(), s.stopPropagation(), this.open = !1, this.dispatchEvent(new CustomEvent("close", {
3439
+ bubbles: !0,
3440
+ composed: !0
3441
+ }));
3442
+ };
3443
+ }
3444
+ static display(s, r) {
3445
+ let o = document.createElement(Ys);
3446
+ o.addEventListener("close", () => {
3447
+ o.remove();
3448
+ });
3449
+ for (let c in s)
3450
+ o[c] = s[c];
3451
+ let i = document.createDocumentFragment();
3452
+ return Ns(r, i), o.appendChild(i), o.open = !0, document.body.appendChild(o), o;
3453
+ }
3454
+ connectedCallback() {
3455
+ super.connectedCallback(), this.dialogElement.then((s) => s.addEventListener("keydown", this._handleKeyDown));
3456
+ }
3457
+ disconnectedCallback() {
3458
+ super.disconnectedCallback(), this.dialogElement.then((s) => s.removeEventListener("keydown", this._handleKeyDown));
3459
+ }
3460
+ updated(s) {
3461
+ s.has("open") && this.dialogElement.then((r) => {
3462
+ this.open ? r.showModal() : r.close();
3463
+ });
3464
+ }
3465
+ render() {
3466
+ return A`
3467
+ <dialog class=${this.hideBackdrop ? "" : "backdrop"} @close=${this._onClose} @click=${this.clickHandler}>
3468
+ <spectric-panel>
3469
+ <div class="modal">
3470
+ ${this.dismissable ? A`<spectric-button variant="text" size="small" @click=${() => {
3471
+ this.open = !1;
3472
+ }}>X</spectric-button>` : null}
3473
+ <h3 >
3474
+ <slot name="title">
3475
+ ${this.title.length ? this.title : null}
3476
+ </slot>
3477
+ </h3>
3478
+
3479
+ <div class="content"><slot></slot></div>
3480
+ <div class="footer"><slot name="footer"></slot></div>
3481
+ </div>
3482
+ </spectric-panel>
3483
+ </dialog>
3484
+ `;
3485
+ }
3486
+ };
3487
+ F.styles = Ra;
3488
+ ce([
3489
+ v({ type: Boolean, reflect: !0 })
3490
+ ], F.prototype, "open", 2);
3491
+ ce([
3492
+ v({ type: Boolean, reflect: !0 })
3493
+ ], F.prototype, "dismissable", 2);
3494
+ ce([
3495
+ v({ type: Boolean, reflect: !0 })
3496
+ ], F.prototype, "hideBackdrop", 2);
3497
+ ce([
3498
+ v({ type: String, reflect: !0 })
3499
+ ], F.prototype, "title", 2);
3500
+ ce([
3501
+ v({ type: Boolean, reflect: !0 })
3502
+ ], F.prototype, "closeOnEscape", 2);
3503
+ ce([
3504
+ v({ type: Boolean, reflect: !0 })
3505
+ ], F.prototype, "closeOnOutsideClick", 2);
3506
+ ce([
3507
+ $t("dialog")
3508
+ ], F.prototype, "dialogElement", 2);
3509
+ F = ce([
3510
+ Q(Ys)
3511
+ ], F);
3512
+ var Ma = Object.defineProperty, za = Object.getOwnPropertyDescriptor, ee = (s, r, o, i) => {
3513
+ for (var c = i > 1 ? void 0 : i ? za(r, o) : r, t = s.length - 1, p; t >= 0; t--)
3514
+ (p = s[t]) && (c = (i ? p(r, o, c) : p(c)) || c);
3515
+ return i && c && Ma(r, o, c), c;
3516
+ }, Fa = /* @__PURE__ */ ((s) => (s.MONGO = "toMongo", s.CQL = "toCql", s.DSL = "toDSL", s.AST = "AST", s))(Fa || {});
3517
+ const Ks = {
3518
+ eq: { value: " : ", label: " equals some value" },
3519
+ gt: { value: " > ", label: " is greater than some value" },
3520
+ lt: { value: " < ", label: " is less than some value" },
3521
+ gte: { value: " >= ", label: " is greater than or equal to some value" },
3522
+ lte: { value: " <= ", label: " is less than or equal to some value" }
3523
+ }, Qa = {
3524
+ eq: { value: ": ", label: " equals some value" },
3525
+ exists: { value: ": *", label: " exists in any form" }
3526
+ }, Ia = [
3527
+ { value: ": true", label: " value is true" },
3528
+ { value: ": false", label: "value is false" }
3529
+ ], Ha = Object.fromEntries(Object.entries(Ks).map(([s, r]) => [s, { value: r.value, label: (r.label || "").replace("value", "date-time") }]));
3530
+ let Y = class extends L {
3531
+ constructor() {
3532
+ super(), this._value = "", this.outputLanguage = "AST", this.completions = [], this.completionIndex = 0, this.fields = [], this._parseQuery = (s = void 0) => {
3533
+ let r;
3534
+ if (this.value == "")
3535
+ return;
3536
+ try {
3537
+ s && s.data == "(" && (this.value = this.value + " )", this._input.setSelectionRange(this.value.length - 2, this.value.length - 2));
3538
+ let c = this.value;
3539
+ this._input.selectionStart !== null && (c = c.substring(0, this._input.selectionStart) + "@kuery-cursor@" + c.substring(this._input.selectionStart));
3540
+ let t = gt(c, { parseCursor: !0, cursorSymbol: "@kuery-cursor@", allowLeadingWildcards: !1 });
3541
+ this.autoComplete(t), r = gt(this.value, { allowLeadingWildcards: !1 });
3542
+ } catch {
3543
+ return;
3544
+ }
3545
+ let o;
3546
+ this.outputLanguage == "AST" ? o = r : o = ja[this.outputLanguage](r, this.fields);
3547
+ let i = new CustomEvent("change", { detail: o });
3548
+ this.dispatchEvent(i);
3549
+ }, this.getValuesForField = async (s, r) => (console.log("getValuesForField isn't set no values returned", s, r), []), this._selectCompletion = async () => {
3550
+ if (!this.suggestion)
3551
+ return;
3552
+ let s = this.completions[this.completionIndex], r = this.value.substring(0, s.start) + s.value, o = r.length, i = this.value.substring(s.end);
3553
+ if (s.value.includes(i) ? this.value = r : this.value = r + this.value.substring(s.end), this._input.setSelectionRange(o, o), s.onSelect) {
3554
+ let c = await s.onSelect();
3555
+ c !== void 0 && (this.value += c);
3556
+ }
3557
+ this.completionIndex = 0, this.completions = [], this._parseQuery();
3558
+ }, this._handleArrows = (s) => {
3559
+ var r;
3560
+ s.key === "Escape" && (this.completions = []), (s.key == "ArrowLeft" || s.key === "ArrowRight") && setTimeout(this._parseQuery, 100), this.completions.length && ["ArrowUp", "ArrowDown", "Enter", "Tab"].includes(s.key) && this.suggestion && (s.preventDefault(), (s.key === "ArrowDown" || s.key === "Tab") && (this.completionIndex += 1, this.completionIndex > this.completions.length - 1 && (this.completionIndex = 0)), s.key === "ArrowUp" && (this.completionIndex -= 1, this.completionIndex < 0 && (this.completionIndex = this.completions.length - 1)), (r = this._asyncAutocomplete) == null || r.then((o) => {
3561
+ let i = o.querySelector(".option.active");
3562
+ i && i.scrollIntoView({ block: "nearest" });
3563
+ }), s.key === "Enter" && this._selectCompletion());
3564
+ }, this.uuid = crypto.randomUUID();
3565
+ }
3566
+ createRenderRoot() {
3567
+ return this;
3568
+ }
3569
+ get value() {
3570
+ return this._input ? String(this._input.value) : this._value;
3571
+ }
3572
+ set value(s) {
3573
+ const r = this._value;
3574
+ this._value = s, this.requestUpdate("value", r), this._input && (this._input.value = String(s));
3575
+ }
3576
+ async autoComplete(s) {
3577
+ if (this.completions = [], s.type !== "cursor")
3578
+ return;
3579
+ let r = [];
3580
+ this.suggestion = s;
3581
+ let { start: o, end: i } = s;
3582
+ for (let c of s.suggestionTypes) {
3583
+ if (c == "conjunction" && s.text.endsWith(" ") && r.push(...["and ", "or "].map((t) => ({ type: c, value: t, start: i, end: i }))), c === "field") {
3584
+ let t = this.fields.filter((p) => p.name.includes(s.fieldName) || p.name.includes(s.prefix)).map((p) => [{ type: c, value: p.name, start: o, end: i }]).flat();
3585
+ r.push(...t);
3586
+ }
3587
+ if (c === "operator") {
3588
+ let t = this.fields.find((p) => p.name === s.fieldName);
3589
+ t && (t.type === "number" ? r.push(...Object.values(Ks).map((p) => ({ type: c, ...p, start: i, end: i }))) : t.type === "string" ? t.format === "date-time" ? r.push(...Object.values(Ha).map((p) => ({
3590
+ type: c,
3591
+ ...p,
3592
+ start: i,
3593
+ end: i,
3594
+ onSelect: async () => {
3595
+ let b = await this.getValuesForField(s.fieldName, s.prefix);
3596
+ b.length === 0 && (b = ["now-1m", "now-1d", "now-1M"]);
3597
+ let g, w = ut();
3598
+ return await new Promise((x) => {
3599
+ let _ = F.display({}, A`
3600
+ <div class="query-bar-date-quick-select">
3601
+ ${b.map((k) => A`<a href="#" @click=${(S) => {
3602
+ S.preventDefault(), g = `"${k}"`, x(g), _.open = !1;
3603
+ }}>${k}</a>`)}
3604
+ </div>
3605
+ <spectric-input variant="datetime-local" @change=${(k) => {
3606
+ if (!k.target)
3607
+ return;
3608
+ g = `"${(/* @__PURE__ */ new Date(k.target.value + ":00.000Z")).toISOString()}"`, w.value.disabled = g === void 0;
3609
+ }}></spectric-input>
3610
+ <spectric-button ${pt(w)} .disabled=${!0} @click=${() => {
3611
+ x(g), _.open = !1;
3612
+ }}>Submit</spectric-button>
3613
+ `);
3614
+ }), g;
3615
+ }
3616
+ }))) : r.push(...Object.values(Qa).map((p) => ({ type: c, ...p, start: i, end: i }))) : t.type === "boolean" && r.push(...Ia.map((p) => ({ type: c, ...p, start: i, end: i }))));
3617
+ }
3618
+ if (c === "value") {
3619
+ let t = this.fields.find((p) => p.name === s.fieldName);
3620
+ if (t && t.type == "boolean")
3621
+ r.push({ type: c, value: "true", start: o, end: i }, { type: c, value: "false", start: o, end: i });
3622
+ else {
3623
+ console.log(`invoke callback to get values for ${s.fieldName}`);
3624
+ let p = await this.getValuesForField(s.fieldName, s.prefix);
3625
+ (t == null ? void 0 : t.type) === "string" && (p = p.map((b) => `"${b}"`)), r.push(...p.map((b) => ({ type: c, value: b, start: o, end: i })));
3626
+ }
3627
+ }
3628
+ }
3629
+ if (this.completions = r, this.completions.length && this._autocomplete) {
3630
+ let { width: c } = this._input.getBoundingClientRect();
3631
+ this._autocomplete.showPopover(), this._autocomplete.style.width = `${c - 15}px`;
3632
+ }
3633
+ }
3634
+ updated(s) {
3635
+ s.has("outputLanguage") && this._parseQuery();
3636
+ }
3637
+ render() {
3638
+ return A`
3639
+ <spectric-input style=${`anchor-name:--${this.uuid};`} autocomplete="off" @input=${this._parseQuery} @keydown=${this._handleArrows}></spectric-input>
3640
+ <div class="autocomplete" popover style=${`position-anchor: --${this.uuid};`}>
3641
+ ${this.completions.map(
3642
+ (s, r) => A`<div @click=${() => {
3643
+ this.completionIndex = r, this._selectCompletion();
3644
+ }} class=${this.completionIndex == r ? "option active" : "option"}><span class="optiontype ${s.type}">${s.type}</span> <span class="value">${s.value}</span> <span class="label">${s.label}</span></span> </div></div>`
3645
+ )}
3646
+ </div>`;
3647
+ }
3648
+ };
3649
+ ee([
3650
+ v({ type: String, reflect: !0 })
3651
+ ], Y.prototype, "value", 1);
3652
+ ee([
3653
+ v({ type: String, reflect: !0 })
3654
+ ], Y.prototype, "outputLanguage", 2);
3655
+ ee([
3656
+ mt()
3657
+ ], Y.prototype, "completions", 2);
3658
+ ee([
3659
+ mt()
3660
+ ], Y.prototype, "completionIndex", 2);
3661
+ ee([
3662
+ v({ type: Array, reflect: !0 })
3663
+ ], Y.prototype, "fields", 2);
3664
+ ee([
3665
+ We(".autocomplete")
3666
+ ], Y.prototype, "_autocomplete", 2);
3667
+ ee([
3668
+ $t(".autocomplete")
3669
+ ], Y.prototype, "_asyncAutocomplete", 2);
3670
+ ee([
3671
+ We("spectric-input")
3672
+ ], Y.prototype, "_input", 2);
3673
+ Y = ee([
3674
+ Q("spectric-query")
3675
+ ], Y);
3676
+ const As = K`
3677
+ border-color: color-mix(in hsl, var(--panel-color, #0b0b0b), var(--spectric-input-color, #000000) 3%);
3678
+ background-color: var(--panel-color,#0b0b0b);
3679
+ --spectric-input-color: var(--spectric-background);
3680
+ color:var(--text-secondary,#3c4c5b);
3681
+ --spectric-text-primary:var(--text-primary);
3682
+ --spectric-text-secondary:var(--text-secondary);
3683
+ filter: drop-shadow(0px 1px 3px color-mix(in srgb, var(--text-secondary, #3c4c5b), transparent 50%));
3684
+ `, ks = K`
3685
+ border-color: color-mix(in hsl, var(--panel-color-inverse,#f4f4f4), var(--spectric-input-color, #000000) 3%);
3686
+ background-color: var(--panel-color-inverse,#0b0b0b);
3687
+ color:var(--text-primary,#3c4c5b);
3688
+ --spectric-input-color: var(--panel-color);
3689
+ --spectric-text-primary:var(--text-secondary);
3690
+ --spectric-text-secondary:var(--text-primary);
3691
+ filter: drop-shadow(0px 1px 3px color-mix(in srgb, var(--text-primary, #3c4c5b), transparent 70%));
3692
+ `, qa = K`
3693
+ :host{
3694
+ display:block;
3695
+ border:2px solid black;
3696
+ margin: 5px;
3697
+ border-radius:var(--spectric-border-radius,0.4em);
3698
+ padding: calc(var(--spectric-border-radius,0.4em) + 2px);
3699
+
3700
+ }
3701
+ :host(spectric-panel[level='0']) {
3702
+ ${As};
3703
+ }
3704
+
3705
+ :host(spectric-panel[level='1']) {
3706
+ ${ks};
3707
+ }
3708
+
3709
+ :host(spectric-panel[level='2']) {
3710
+ ${As};
3711
+ }
3712
+ :host(spectric-panel[level='3']) {
3713
+ ${ks};
3714
+ }
3715
+ `;
3716
+ var Wa = Object.defineProperty, Ya = Object.getOwnPropertyDescriptor, or = (s, r, o, i) => {
3717
+ for (var c = i > 1 ? void 0 : i ? Ya(r, o) : r, t = s.length - 1, p; t >= 0; t--)
3718
+ (p = s[t]) && (c = (i ? p(r, o, c) : p(c)) || c);
3719
+ return i && c && Wa(r, o, c), c;
3720
+ };
3721
+ let He = class extends L {
3722
+ constructor() {
3723
+ super(...arguments), this.level = 0;
3724
+ }
3725
+ updated() {
3726
+ this.layers || (this.layers = this.querySelectorAll(
3727
+ "spectric-panel"
3728
+ )), this.layers.forEach((s) => {
3729
+ s.setAttribute(
3730
+ "level",
3731
+ ((this.level + 1) % 4).toString()
3732
+ );
3733
+ }), this.dispatchEvent(
3734
+ new CustomEvent("use-layer", {
3735
+ bubbles: !0,
3736
+ cancelable: !0,
3737
+ composed: !0,
3738
+ detail: {
3739
+ layer: this,
3740
+ level: this.level
3741
+ }
3742
+ })
3743
+ );
3744
+ }
3745
+ render() {
3746
+ return A` <slot></slot> `;
3747
+ }
3748
+ };
3749
+ He.styles = qa;
3750
+ or([
3751
+ v({ type: Number, reflect: !0 })
3752
+ ], He.prototype, "level", 2);
3753
+ or([
3754
+ v({ attribute: !1 })
3755
+ ], He.prototype, "layers", 2);
3756
+ He = or([
3757
+ Q("spectric-panel")
3758
+ ], He);
3759
+ var Ka = Object.defineProperty, Za = Object.getOwnPropertyDescriptor, Zs = (s, r, o, i) => {
3760
+ for (var c = i > 1 ? void 0 : i ? Za(r, o) : r, t = s.length - 1, p; t >= 0; t--)
3761
+ (p = s[t]) && (c = (i ? p(r, o, c) : p(c)) || c);
3762
+ return i && c && Ka(r, o, c), c;
3763
+ };
3764
+ const ac = {
3765
+ "--primary": { control: "color" },
3766
+ "--secondary": { control: "color" },
3767
+ "--tertiary": { control: "color" },
3768
+ "--disabled": { control: "color" },
3769
+ "--background": { control: "color" },
3770
+ "--background-inverse": { control: "color" },
3771
+ "--text-primary": { control: "color" },
3772
+ "--text-secondary": { control: "color" },
3773
+ "--text-on-color": { control: "color" },
3774
+ "--border-radius": { control: "text" }
3775
+ }, Xs = {
3776
+ "--secondary": "#77878b",
3777
+ "--tertiary": "#c7c7c7",
3778
+ "--disabled": "#000000",
3779
+ "--text-primary": "#cccccc",
3780
+ "--text-secondary": "#cccccc",
3781
+ "--text-on-color": "#ededed",
3782
+ "--background": "#181818",
3783
+ "--background-inverse": "#37373d"
3784
+ }, Ss = {
3785
+ ...Xs,
3786
+ "--primary": "#ffd45a",
3787
+ "--text-on-color": "#4f4f4f"
3788
+ }, Zt = {
3789
+ undefined: {},
3790
+ light: {},
3791
+ dark: Xs,
3792
+ spectric: Ss,
3793
+ spectricFlat: {
3794
+ ...Ss,
3795
+ "--border-radius": "1px"
3796
+ }
3797
+ }, cc = Object.fromEntries(Object.keys(Zt).map((s) => [s, s])), Xa = `
3798
+ --spectric-background: var(--background,#ffffff);
3799
+ --spectric-background-hover:var(--background-hover,rgba(141, 141, 141, 0.12));
3800
+ --spectric-background-inverse: var(--background-inverse,#f4f4f4);
3801
+ --spectric-background-inverse-hover: var(--background-inverse-hover,#474747);
3802
+ --spectric-border-radius: var(--border-radius,.4em);
3803
+ --spectric-primary:var(--primary,#1ea7fd);
3804
+ --spectric-secondary: var(--secondary,#77878b);
3805
+ --spectric-tertiary: var(--tertiary,#0f62fe);
3806
+ --spectric-disabled: var(--disabled,#c6c6c6);
3807
+
3808
+ /* panel */
3809
+ --panel-color:var(--spectric-background-inverse);
3810
+ --panel-color-inverse:var(--spectric-background);
3811
+ --spectric-border-disabled: var(--disabled);
3812
+
3813
+ /*inputs*/
3814
+ --spectric-input-color: var(--panel-color-inverse);
3815
+ --spectric-input-bottom: var(--panel-color);
3816
+
3817
+ --spectric-text-on-color: var(--text-on-color,#ffffff);
3818
+ --spectric-text-on-color-disabled: var(--text-on-color-disabled,#8d8d8d);
3819
+ --spectric-text-placeholder: var(--text-placeholder,rgba(22, 22, 22, 0.4));
3820
+ --spectric-text-primary: var(--text-primary,#161616);
3821
+ --spectric-text-secondary: var(--text-secondary,#525252);
3822
+ /* Buttons */
3823
+ --spectric-button-separator: #e0e0e0;
3824
+ --spectric-button-primary: var(--primary,#1ea7fd);
3825
+ --spectric-button-secondary: var(--secondary,#77878b);
3826
+ --spectric-button-tertiary: var(--tertiary);
3827
+ --spectric-button-danger-primary: #da1e28;
3828
+ --spectric-button-danger-secondary: #da1e28;
3829
+ --spectric-button-danger-active: #750e13;
3830
+ --spectric-button-primary-active: #002d9c;
3831
+ --spectric-button-secondary-active: #6f6f6f;
3832
+ --spectric-button-tertiary-active: #002d9c;
3833
+ --spectric-button-danger-hover: #b81921;
3834
+ --spectric-button-primary-hover: #0050e6;
3835
+ --spectric-button-secondary-hover: #474747;
3836
+ --spectric-button-tertiary-hover: #0050e6;
3837
+ --spectric-text-on-color-disabled: var(--disabled,#c6c6c6)
3838
+ --spectric-button-disabled: #c6c6c6;
3839
+ color: var(--spectric-text-primary);
3840
+ `;
3841
+ let vt = class extends L {
3842
+ constructor() {
3843
+ super(...arguments), this.theme = "undefined";
3844
+ }
3845
+ updated(s) {
3846
+ if (s.has("theme") && this.theme != s.get("theme")) {
3847
+ const r = {
3848
+ old: s.get("theme"),
3849
+ new: this.theme
3850
+ };
3851
+ this.dispatchEvent(new CustomEvent("theme-change", { detail: r, bubbles: !0, composed: !0 }));
3852
+ }
3853
+ }
3854
+ render() {
3855
+ let s = Object.keys(Zt).includes(this.theme) ? this.theme : "undefined", r = Object.entries(
3856
+ Zt[s]
3857
+ ).map((o) => `${o[0]}:${o[1]};`).join(`
3858
+ `);
3859
+ return A`
3860
+ ${this.theme && this.theme !== "light" ? A`
3861
+ <style>:host{
3862
+ ${r};
3863
+ ${Xa}
3864
+ }
3865
+ /* Webkit psudo elements don't pick up variables defined by the host */
3866
+ ::-webkit-scrollbar-thumb {
3867
+ background: var(--spectric-background-inverse,#393939);
3868
+ border-radius: var(--spectric-border-radius,4em);
3869
+ -webkit-border-radius: var(--spectric-border-radius,4em);
3870
+ padding-top: 1px;
3871
+ padding-bottom: 1px;
3872
+ }
3873
+ ::-webkit-scrollbar-thumb:hover {
3874
+ background: var(--spectric-background-inverse-hover,#474747);
3875
+
3876
+ }
3877
+ ::-webkit-scrollbar-corner {
3878
+ background: var(--spectric-background, #ffffff);
3879
+ }
3880
+ /* Buttons */
3881
+
3882
+ ::-webkit-scrollbar-button:single-button {
3883
+ background-color: transparent;
3884
+ display: block;
3885
+ border-style: solid;
3886
+ }
3887
+ /* Up */
3888
+ ::-webkit-scrollbar-button:single-button:vertical:decrement {
3889
+ border-width: 0 5px 5px 5px;
3890
+ border-color: var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-background-inverse,#393939) var(--spectric-background, #ffffff);
3891
+ }
3892
+ ::-webkit-scrollbar-button:single-button:vertical:decrement:hover {
3893
+ border-color: var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-background-inverse-hover,#474747) var(--spectric-background, #ffffff);
3894
+ }
3895
+ /* Down */
3896
+ ::-webkit-scrollbar-button:single-button:vertical:increment {
3897
+ border-width: 5px 5px 0 5px;
3898
+ border-color: var(--spectric-background-inverse,#393939) var(--spectric-background, #ffffff) transparent var(--spectric-background, #ffffff);
3899
+ }
3900
+
3901
+ ::-webkit-scrollbar-button:vertical:single-button:increment:hover {
3902
+ border-color: var(--spectric-background-inverse-hover,#474747) var(--spectric-background, #ffffff) transparent var(--spectric-background, #ffffff);
3903
+ }
3904
+
3905
+ /* Left */
3906
+ ::-webkit-scrollbar-button:single-button:horizontal:decrement {
3907
+ border-width: 5px 5px 5px 0;
3908
+ border-color:var(--spectric-background, #ffffff) var(--spectric-background-inverse,#393939) var(--spectric-background, #ffffff) var(--spectric-background, #ffffff);
3909
+
3910
+ }
3911
+
3912
+ ::-webkit-scrollbar-button:single-button:horizontal:decrement:hover {
3913
+ border-width: 5px 5px 5px 0;
3914
+ border-color:var(--spectric-background, #ffffff) var(--spectric-background-inverse-hover,#474747) var(--spectric-background, #ffffff) var(--spectric-background, #ffffff);
3915
+
3916
+ }
3917
+
3918
+
3919
+
3920
+ /* Right */
3921
+ ::-webkit-scrollbar-button:single-button:horizontal:increment {
3922
+ border-width: 5px 0 5px 5px;
3923
+ border-color:var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-background-inverse,#393939);
3924
+
3925
+ }
3926
+
3927
+ ::-webkit-scrollbar-button:single-button:horizontal:increment:hover {
3928
+ border-width: 5px 0 5px 5px;
3929
+ border-color:var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-background-inverse-hover,#474747);
3930
+
3931
+ }
3932
+ </style>` : null}
3933
+ <slot></slot>
3934
+ `;
3935
+ }
3936
+ };
3937
+ vt.styles = K`:host{
3938
+ display:contents;
3939
+ }`;
3940
+ Zs([
3941
+ v({ reflect: !0 })
3942
+ ], vt.prototype, "theme", 2);
3943
+ vt = Zs([
3944
+ Q("spectric-theme")
3945
+ ], vt);
3946
+ const Ga = K`
3947
+ :host {
3948
+ display: block;
3949
+ height: 100%;
3950
+ width: 100%;
3951
+
3952
+ }
3953
+ .split-view {
3954
+ display: flex;
3955
+ height: 100%;
3956
+ width: 100%;
3957
+ position:relative;
3958
+ }
3959
+ .split-view.active{
3960
+ cursor:ew-resize;
3961
+ }
3962
+ .split-view.active.vertical{
3963
+ cursor:ns-resize;
3964
+ }
3965
+ .split-view.vertical {
3966
+ flex-direction: column;
3967
+ }
3968
+ .panel {
3969
+ flex: 1;
3970
+ overflow: auto;
3971
+ }
3972
+ .splitter {
3973
+ border-radius: var(--spectric-border-radius, .4em);
3974
+ background-color: var(--spectric-input-color,#ccc);
3975
+ user-select: none;
3976
+ transition: background-color 100ms linear;
3977
+ }
3978
+
3979
+ .splitter.invisible {
3980
+ background-color: #00000000;
3981
+ }
3982
+ .splitter:hover {
3983
+ background-color: var(--spectric-button-primary, #1ea7fd);
3984
+ transition: background-color 500ms linear;
3985
+ }
3986
+ .splitter.active {
3987
+ background-color: var(--spectric-button-primary, #1ea7fd);
3988
+ transition: background-color 500ms linear;
3989
+ }
3990
+ .split-view > .error-display{
3991
+ display:none;
3992
+ position:absolute;
3993
+ top:0;
3994
+ right:0
3995
+ }
3996
+ .split-view.error > .error-display{
3997
+ display:inline-block;
3998
+
3999
+ }
4000
+ .split-view.vertical .splitter {
4001
+ cursor: ns-resize;
4002
+ height: 5px;
4003
+ width: 100%;
4004
+ }
4005
+ .split-view:not(.vertical) .splitter {
4006
+ width: 5px;
4007
+ cursor: ew-resize;
4008
+ }
4009
+ `;
4010
+ var Ja = Object.defineProperty, Va = Object.getOwnPropertyDescriptor, U = (s, r, o, i) => {
4011
+ for (var c = i > 1 ? void 0 : i ? Va(r, o) : r, t = s.length - 1, p; t >= 0; t--)
4012
+ (p = s[t]) && (c = (i ? p(r, o, c) : p(c)) || c);
4013
+ return i && c && Ja(r, o, c), c;
4014
+ }, ec = /* @__PURE__ */ ((s) => (s.horizontal = "horizontal", s.vertical = "vertical", s))(ec || {});
4015
+ const tc = "spectric-splitview";
4016
+ let D = class extends Fs {
4017
+ constructor() {
4018
+ 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 = () => {
4019
+ let { percentage: r, orientation: o, invisible: i, min: c, max: t, useSavedState: p } = this, b = this.getAttribute("id");
4020
+ b && this.useSavedState && localStorage.setItem(`splitview-${b}`, String(r)), this.dispatchEvent(new CustomEvent("change", { detail: { orientation: o, percentage: r, invisible: i, min: c, max: t, useSavedState: p } }));
4021
+ }, this._onMouseMove = Qs((r) => {
4022
+ if (this.isDragging) {
4023
+ const o = this.getBoundingClientRect();
4024
+ let i, c;
4025
+ this.orientation === "horizontal" ? (i = r.clientX - o.left, c = i / o.width * 100) : (i = r.clientY - o.top, c = i / o.height * 100), c = Math.min(Math.max(c, this.min), this.max), this.percentage = c, this._emitChange();
4026
+ }
4027
+ }), this._assignSlot = (r) => {
4028
+ if (!r.target)
4029
+ return;
4030
+ let i = r.target.assignedNodes().filter((c) => c instanceof HTMLElement);
4031
+ i.length > 2 && console.log("cannot assign more than 2 elements to a split view"), i.forEach(
4032
+ (c) => {
4033
+ if (this._panel1.assignedNodes().length === 0) {
4034
+ c.slot = "panel1";
4035
+ return;
4036
+ }
4037
+ if (this._panel2.assignedNodes().length === 0) {
4038
+ c.slot = "panel2";
4039
+ return;
4040
+ }
4041
+ 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");
4042
+ }
4043
+ );
4044
+ };
4045
+ let s = this.getAttribute("id");
4046
+ if (s && this.useSavedState) {
4047
+ let r = localStorage.getItem(`splitview-${s}`);
4048
+ r && (this.percentage = parseFloat(r));
4049
+ }
4050
+ this.addDisposableListener(this._splitter, "mousedown", () => {
4051
+ this.isDragging = !0;
4052
+ }), this.addDisposableListener(this._splitter, "dblclick", () => {
4053
+ this.percentage = 50, this._emitChange();
4054
+ }), this.addDisposableListener(document.body, "mousemove", this._onMouseMove), this.addDisposableListener(document.body, "mouseup", () => {
4055
+ this.isDragging = !1;
4056
+ });
4057
+ }
4058
+ updated(s) {
4059
+ s.has("percentage") && (this.percentage = Math.min(Math.max(Number(this.percentage), this.min), this.max));
4060
+ }
4061
+ render() {
4062
+ return A`
4063
+ <div class="split-view ${this.orientation} ${this._error ? "error" : ""} ${this.isDragging ? "active" : ""}" style="--split-percentage: ${this.percentage}%;">
4064
+ <span class="error-display">${this._error}</span>
4065
+ <div class="panel" style="${this.orientation === "horizontal" ? "flex: var(--split-percentage, 50%)" : "max-height: var(--split-percentage, 50%)"}">
4066
+ <slot name="panel1"></slot>
4067
+ </div>
4068
+ <div class="splitter ${this.invisible ? "invisible" : ""} ${this.isDragging ? "active" : ""}"></div>
4069
+ <div class="panel" style="${this.orientation === "horizontal" ? "flex: calc(100% - var(--split-percentage, 50%))" : "max-height: calc(100% - var(--split-percentage, 50%))"}">
4070
+ <slot name="panel2"></slot>
4071
+ </div>
4072
+ </div>
4073
+ <slot @slotchange=${this._assignSlot} style="display:none"></slot>
4074
+ `;
4075
+ }
4076
+ };
4077
+ D.styles = Ga;
4078
+ U([
4079
+ v({ type: String })
4080
+ ], D.prototype, "orientation", 2);
4081
+ U([
4082
+ v({ type: Number, reflect: !0 })
4083
+ ], D.prototype, "percentage", 2);
4084
+ U([
4085
+ v({ type: Boolean })
4086
+ ], D.prototype, "invisible", 2);
4087
+ U([
4088
+ v({ type: Number, reflect: !0 })
4089
+ ], D.prototype, "min", 2);
4090
+ U([
4091
+ v({ type: Number, reflect: !0 })
4092
+ ], D.prototype, "max", 2);
4093
+ U([
4094
+ v({ type: Boolean, reflect: !0 })
4095
+ ], D.prototype, "useSavedState", 2);
4096
+ U([
4097
+ mt()
4098
+ ], D.prototype, "isDragging", 2);
4099
+ U([
4100
+ mt()
4101
+ ], D.prototype, "_error", 2);
4102
+ U([
4103
+ $t(".splitter")
4104
+ ], D.prototype, "_splitter", 2);
4105
+ U([
4106
+ We("slot[name='panel1']")
4107
+ ], D.prototype, "_panel1", 2);
4108
+ U([
4109
+ We("slot[name='panel2']")
4110
+ ], D.prototype, "_panel2", 2);
4111
+ D = U([
4112
+ Q(tc)
4113
+ ], D);
4114
+ export {
4115
+ J as BitDisplayCanvas,
4116
+ rn as ButtonSizes,
4117
+ sn as ButtonVariants,
4118
+ ac as CSSPropsControls,
4119
+ F as DialogElement,
4120
+ Ys as DialogElementTag,
4121
+ tc as ElementTag,
4122
+ Ee as Header,
4123
+ Cn as InputVariants,
4124
+ ec as Orientations,
4125
+ G as SpectricButton,
4126
+ E as SpectricInput,
4127
+ B as SpectricPage,
4128
+ He as SpectricPanel,
4129
+ Y as SpectricQuery,
4130
+ vt as SpectricThemeProvider,
4131
+ D as SplitView,
4132
+ Fa as SupportedLanguages,
4133
+ cc as ThemeSelections,
4134
+ ne as nodeTypes
4135
+ };
4136
+ //# sourceMappingURL=index.es.js.map