@epa-wg/custom-element-dist 0.0.31 → 0.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.idea/inspectionProfiles/Project_Default.xml +2 -1
- package/.storybook/main.ts +3 -7
- package/.storybook/preview.ts +4 -6
- package/README.md +4 -4
- package/coverage/coverage-final.json +7 -18
- package/coverage/index.html +30 -30
- package/coverage/src/custom-element/coverage.svg +1 -1
- package/coverage/src/custom-element/custom-element.js/coverage.svg +1 -1
- package/coverage/src/custom-element/custom-element.js.html +719 -473
- package/coverage/src/custom-element/http-request.js/coverage.svg +1 -1
- package/coverage/src/custom-element/http-request.js.html +6 -6
- package/coverage/src/custom-element/index.html +29 -29
- package/coverage/src/custom-element/local-storage.js.html +1 -1
- package/coverage/src/custom-element/location-element.js.html +31 -31
- package/coverage/src/custom-element/module-url.js/coverage.svg +1 -1
- package/coverage/src/custom-element/module-url.js.html +20 -20
- package/coverage/src/index.html +1 -1
- package/coverage/src/mocks/handlers.ts.html +1 -1
- package/coverage/src/mocks/index.html +1 -1
- package/coverage/src/stories/coverage.svg +1 -1
- package/coverage/src/stories/{attributes.test.stories.ts → frame.canvas.ts}/coverage.svg +1 -1
- package/coverage/src/stories/frame.canvas.ts.html +175 -0
- package/coverage/src/stories/http-request.stories.ts.html +1 -1
- package/coverage/src/stories/index.html +14 -179
- package/coverage/src/stories/testStoryBook.ts.html +8 -8
- package/coverage/src/sum.ts.html +1 -1
- package/dist/custom-element-6slVaFEs.cjs +97 -0
- package/dist/custom-element-WnOqmEOe.js +609 -0
- package/dist/custom-element-bundle.cjs +1 -1
- package/dist/custom-element-bundle.js +30 -28
- package/dist/demo/a.html +51 -38
- package/dist/demo/attributes.html +153 -0
- package/dist/demo/data-slices.html +2 -2
- package/dist/demo/external-template.html +1 -0
- package/dist/demo/external-templates-sb-6.html +42 -0
- package/dist/demo/external-templates-sb-7.html +42 -0
- package/dist/demo/form.html +42 -0
- package/dist/demo/hex-grid-dce.html +1 -1
- package/dist/demo/hex-grid.html +1 -1
- package/dist/demo/html-template.html +1 -1
- package/dist/demo/module-url-sb-2.html +46 -0
- package/dist/demo/module-url-sb-4.html +48 -0
- package/dist/demo/module-url-sb-5.html +53 -0
- package/dist/demo/parameters.html +20 -1
- package/dist/demo/s.xml +66 -9
- package/dist/demo/s.xslt +89 -16
- package/dist/demo/ss.html +12 -22
- package/dist/mockServiceWorker.js +31 -8
- package/package.json +25 -26
- package/public/demo/a.html +51 -38
- package/public/demo/attributes.html +153 -0
- package/public/demo/data-slices.html +2 -2
- package/public/demo/external-template.html +1 -0
- package/public/demo/external-templates-sb-6.html +42 -0
- package/public/demo/external-templates-sb-7.html +42 -0
- package/public/demo/form.html +42 -0
- package/public/demo/hex-grid-dce.html +1 -1
- package/public/demo/hex-grid.html +1 -1
- package/public/demo/html-template.html +1 -1
- package/public/demo/module-url-sb-2.html +46 -0
- package/public/demo/module-url-sb-4.html +48 -0
- package/public/demo/module-url-sb-5.html +53 -0
- package/public/demo/parameters.html +20 -1
- package/public/demo/s.xml +66 -9
- package/public/demo/s.xslt +89 -16
- package/public/demo/ss.html +12 -22
- package/public/mockServiceWorker.js +31 -8
- package/src/custom-element/custom-element.d.ts +4 -0
- package/src/custom-element/custom-element.js +148 -66
- package/src/custom-element/demo/a.html +51 -38
- package/src/custom-element/demo/attributes.html +153 -0
- package/src/custom-element/demo/data-slices.html +2 -2
- package/src/custom-element/demo/external-template.html +1 -0
- package/src/custom-element/demo/form.html +42 -0
- package/src/custom-element/demo/hex-grid-dce.html +1 -1
- package/src/custom-element/demo/hex-grid.html +1 -1
- package/src/custom-element/demo/html-template.html +1 -1
- package/src/custom-element/demo/parameters.html +20 -1
- package/src/custom-element/demo/s.xml +66 -9
- package/src/custom-element/demo/s.xslt +89 -16
- package/src/custom-element/demo/ss.html +12 -22
- package/src/custom-element/ide/web-types-dce.json +1 -1
- package/src/custom-element/ide/web-types-xsl.json +1 -1
- package/src/custom-element/index.html +1 -1
- package/src/material/components/badge.html +240 -0
- package/src/material/components/dropdown.html +26 -14
- package/src/material/components/icon-link.html +1 -0
- package/src/material/components/icon.html +253 -0
- package/src/material/components/input.html +571 -0
- package/src/material/components/menu.html +7 -5
- package/src/material/components.html +48 -11
- package/src/material/theme/semantic.css +20 -1
- package/src/mocks/versions.mock.ts +1 -1
- package/src/stories/__screenshots__/attributes.test.stories.ts +1 -0
- package/src/stories/__screenshots__/external-template.test.stories.ts +1 -0
- package/src/stories/__screenshots__/module-url.test.stories.ts +1 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-Attributes-definition-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-Attributes-runtime-change-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-Instance-Attributes-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-Instance-Attributes-2.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-cloneAs-el-newTag--1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-mergeAttr--from--to---1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-mergeAttr--from--to---2.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-mergeAttr--from--to---3.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-mix-to-from--1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-Attributes-definition-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-Attributes-runtime-change-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-Instance-Attributes-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-Instance-Attributes-2.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-cloneAs-el-newTag--1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-http-request-headers-and-response-status-and-headers-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-http-request-with-delayed--5-seconds-response-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-http-request-with-error-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-mergeAttr--from--to---1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-mergeAttr--from--to---2.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-mergeAttr--from--to---3.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-mix-to-from--1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-url-and-slice-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-url-change-1.png +0 -0
- package/src/stories/attributes.test.stories.ts +177 -11
- package/src/stories/external-template.test.stories.ts +17 -15
- package/src/stories/frame.canvas.ts +31 -0
- package/src/stories/module-url.test.stories.ts +29 -61
- package/storybook-static/assets/Color-F6OSRLHC-Cbp293x2.js +1 -0
- package/storybook-static/assets/Configure-BrFr4SLE.js +165 -0
- package/storybook-static/assets/DocsRenderer-CFRXHY34-DhHzJiIO.js +2 -0
- package/storybook-static/assets/attributes.test.stories-CzWkKw0e.js +1 -0
- package/storybook-static/assets/attributes.test.stories-Gg9LQTEK.js +349 -0
- package/storybook-static/assets/{css.test.stories-Cgn6ICr0.js → css.test.stories-B_3ltOrx.js} +1 -1
- package/storybook-static/assets/custom-element-CPnvJnn8.js +97 -0
- package/storybook-static/assets/{dom-merge.test.stories-CBObfPWg.js → dom-merge.test.stories-nQxcgLoM.js} +1 -1
- package/storybook-static/assets/entry-preview-docs-Dwczwtsc.js +2 -0
- package/storybook-static/assets/external-template.test.stories-BivZqBTp.js +1 -0
- package/storybook-static/assets/{external-template.test.stories-VfKUQ8eu.js → external-template.test.stories-DZ-rjnfd.js} +39 -41
- package/storybook-static/assets/{form.test.stories-CnuGN7Zw.js → form.test.stories-DQhPYtMj.js} +1 -1
- package/storybook-static/assets/frame.canvas-ClTqYyMN.js +1 -0
- package/storybook-static/assets/{handlers-V_T7WjNK.js → handlers-CLkps6Nz.js} +17 -14
- package/storybook-static/assets/{http-request.stories-8NN1Coqm.js → http-request.stories-jo0f73nw.js} +1 -1
- package/storybook-static/assets/iframe-CZwRpnn9.js +199 -0
- package/storybook-static/assets/index-B68YUdzy.js +621 -0
- package/storybook-static/assets/index-BwkS7JH_.js +8 -0
- package/storybook-static/assets/index-CJQtnF9V.js +1 -0
- package/storybook-static/assets/index-Dr4PwNfd.js +240 -0
- package/storybook-static/assets/{local-storage.test.stories-Dk5Yqc7m.js → local-storage.test.stories-uA5EKRPf.js} +1 -1
- package/storybook-static/assets/{location-element.test.stories-56um6s5L.js → location-element.test.stories-Cu-6Elcg.js} +1 -1
- package/storybook-static/assets/module-url.test.stories-CD_wusXQ.js +142 -0
- package/storybook-static/assets/module-url.test.stories-CTjUAk3J.js +1 -0
- package/storybook-static/assets/preview-1xJJ3sKE.js +1 -0
- package/storybook-static/assets/preview-BFlNN3Wj.js +1 -0
- package/storybook-static/assets/preview-CTOeX_lO.js +1 -0
- package/storybook-static/assets/preview-Cm4PPhHS.js +50 -0
- package/storybook-static/assets/preview-CuCH40jj.js +2 -0
- package/storybook-static/assets/preview-DfTudP20.js +1 -0
- package/storybook-static/assets/{set-url.test.stories-B4E6hIe-.js → set-url.test.stories-CY7B9BVZ.js} +1 -1
- package/storybook-static/assets/{slice-events.test.stories-BR0F-B6I.js → slice-events.test.stories-BVnPXm6e.js} +1 -1
- package/storybook-static/assets/{slots.test.stories-CgfJIyCr.js → slots.test.stories-Dxsa9KdA.js} +1 -1
- package/storybook-static/assets/{version-select.test.stories-nmxATIwv.js → version-select.test.stories-Buga1PAa.js} +1 -1
- package/storybook-static/demo/a.html +51 -38
- package/storybook-static/demo/attributes.html +153 -0
- package/storybook-static/demo/data-slices.html +2 -2
- package/storybook-static/demo/external-template.html +1 -0
- package/storybook-static/demo/external-templates-sb-6.html +42 -0
- package/storybook-static/demo/external-templates-sb-7.html +42 -0
- package/storybook-static/demo/form.html +42 -0
- package/storybook-static/demo/hex-grid-dce.html +1 -1
- package/storybook-static/demo/hex-grid.html +1 -1
- package/storybook-static/demo/html-template.html +1 -1
- package/storybook-static/demo/module-url-sb-2.html +46 -0
- package/storybook-static/demo/module-url-sb-4.html +48 -0
- package/storybook-static/demo/module-url-sb-5.html +53 -0
- package/storybook-static/demo/parameters.html +20 -1
- package/storybook-static/demo/s.xml +66 -9
- package/storybook-static/demo/s.xslt +89 -16
- package/storybook-static/demo/ss.html +12 -22
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/index.html +6 -10
- package/storybook-static/index.json +1 -1
- package/storybook-static/mockServiceWorker.js +31 -8
- package/storybook-static/project.json +1 -1
- package/storybook-static/sb-addons/essentials-actions-2/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-backgrounds-4/manager-bundle.js +8 -8
- package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js +391 -0
- package/storybook-static/sb-addons/essentials-docs-3/manager-bundle.js +230 -0
- package/storybook-static/sb-addons/essentials-measure-7/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/essentials-outline-8/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/essentials-toolbars-6/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/essentials-viewport-5/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/interactions-9/manager-bundle.js +58 -58
- package/storybook-static/sb-manager/globals-module-info.js +9 -0
- package/storybook-static/sb-manager/globals-runtime.js +10719 -10473
- package/storybook-static/sb-manager/runtime.js +4944 -6321
- package/coverage/src/stories/attributes.test.stories.ts.html +0 -514
- package/coverage/src/stories/css.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/css.test.stories.ts.html +0 -460
- package/coverage/src/stories/dom-merge.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/dom-merge.test.stories.ts.html +0 -706
- package/coverage/src/stories/external-template.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/external-template.test.stories.ts.html +0 -865
- package/coverage/src/stories/form.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/form.test.stories.ts.html +0 -661
- package/coverage/src/stories/local-storage.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/local-storage.test.stories.ts.html +0 -1315
- package/coverage/src/stories/location-element.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/location-element.test.stories.ts.html +0 -523
- package/coverage/src/stories/module-url.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/module-url.test.stories.ts.html +0 -640
- package/coverage/src/stories/set-url.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/set-url.test.stories.ts.html +0 -433
- package/coverage/src/stories/slice-events.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/slice-events.test.stories.ts.html +0 -952
- package/coverage/src/stories/slots.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/slots.test.stories.ts.html +0 -742
- package/coverage/src/stories/version-select.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/version-select.test.stories.ts.html +0 -397
- package/dist/custom-element-BbJMY20-.cjs +0 -97
- package/dist/custom-element-CoRNKeEP.js +0 -567
- package/storybook-static/assets/Color-F6OSRLHC-CFyd3TND.js +0 -1
- package/storybook-static/assets/Configure-UGTbPRKK.js +0 -165
- package/storybook-static/assets/DocsRenderer-CFRXHY34-Dpr5iB0o.js +0 -2
- package/storybook-static/assets/attributes.test.stories-DSOLHHOW.js +0 -152
- package/storybook-static/assets/custom-element-D59Fok1f.js +0 -97
- package/storybook-static/assets/entry-preview-docs-BbcIMweR.js +0 -2
- package/storybook-static/assets/iframe-DnhkgdtG.js +0 -2
- package/storybook-static/assets/index-3Sfy-t3H.js +0 -769
- package/storybook-static/assets/index-BcZLpTeD.js +0 -8
- package/storybook-static/assets/index-CIBI7sCB.js +0 -1
- package/storybook-static/assets/index-CxRwF5Or.js +0 -234
- package/storybook-static/assets/index-D-8MO0q_.js +0 -1
- package/storybook-static/assets/index-DN1RoK17.js +0 -1
- package/storybook-static/assets/index-DjJD7gkO.js +0 -1
- package/storybook-static/assets/module-url.test.stories-DEponQ7l.js +0 -208
- package/storybook-static/assets/preview-BhhEZcNS.js +0 -1
- package/storybook-static/assets/preview-CNKoaWES.js +0 -1
- package/storybook-static/assets/preview-Czc-sw5H.js +0 -2
- package/storybook-static/assets/preview-DAeyCMnM.js +0 -1
- package/storybook-static/assets/preview-DHPc-V4N.js +0 -1
- package/storybook-static/assets/preview-DYzi3Z2p.js +0 -1
- package/storybook-static/assets/preview-vbpHsp94.js +0 -52
- package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js +0 -333
- package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js.LEGAL.txt +0 -40
- package/storybook-static/sb-addons/essentials-actions-3/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js +0 -391
- package/storybook-static/sb-addons/links-1/manager-bundle.js +0 -3
- package/storybook-static/sb-preview/globals.js +0 -33
- package/storybook-static/sb-preview/runtime.js +0 -7174
- package/test-runner-jest.config.js +0 -15
- /package/storybook-static/sb-addons/{essentials-actions-3 → essentials-actions-2}/manager-bundle.js.LEGAL.txt +0 -0
- /package/storybook-static/sb-addons/{essentials-controls-2 → essentials-controls-1}/manager-bundle.js.LEGAL.txt +0 -0
- /package/storybook-static/sb-addons/{links-1 → essentials-docs-3}/manager-bundle.js.LEGAL.txt +0 -0
|
@@ -1,567 +0,0 @@
|
|
|
1
|
-
const W = "http://www.w3.org/1999/XSL/Transform", H = "http://www.w3.org/1999/xhtml", ue = "http://exslt.org/common", f = (e, l) => e.getAttribute?.(l), Z = (e) => e.nodeType === 3, de = (e) => typeof e == "string", pe = (e) => e && typeof e.nodeType == "number", D = (e, l) => (e.ownerDocument || e).createTextNode(l), se = (e) => {
|
|
2
|
-
for (; e.firstChild; ) e.firstChild.remove();
|
|
3
|
-
return e;
|
|
4
|
-
}, V = (e) => (e.getAttributeNames().map((l) => e.removeAttribute(l)), se(e)), le = (e) => (e?.setAttribute("xmlns:xsl", W), e), ae = (e) => (e?.setAttribute("xmlns:xhtml", H), le(e)), ne = (e) => /^[_a-zA-Z][-_:a-zA-Z0-9]*$/.test(e), T = (e, l = "", t = document) => {
|
|
5
|
-
const s = (i) => ((r) => (l && r.append(D(t.ownerDocument || t, l)), r))((t.ownerDocument || t).createElement(i));
|
|
6
|
-
if (ne(e))
|
|
7
|
-
return s(e);
|
|
8
|
-
const a = s("dce-object");
|
|
9
|
-
return a.setAttribute("dce-object-name", e), a;
|
|
10
|
-
}, J = (e, l) => {
|
|
11
|
-
const t = e.ownerDocument.createElementNS(e.namespaceURI, l);
|
|
12
|
-
for (let s of e.attributes)
|
|
13
|
-
t.setAttribute(s.name, s.value);
|
|
14
|
-
for (; e.firstChild; )
|
|
15
|
-
t.append(e.firstChild);
|
|
16
|
-
return t;
|
|
17
|
-
};
|
|
18
|
-
function q(e) {
|
|
19
|
-
return new DOMParser().parseFromString(e, "application/xml");
|
|
20
|
-
}
|
|
21
|
-
function X(e) {
|
|
22
|
-
return new XMLSerializer().serializeToString(e);
|
|
23
|
-
}
|
|
24
|
-
function U(e, l, t, s) {
|
|
25
|
-
const a = (x) => e.ownerDocument.createElement(x), r = ((x, p, N) => (p.append(N = a(x)), N))(l, e);
|
|
26
|
-
return [...t].forEach((x) => r.append(s(x))), r;
|
|
27
|
-
}
|
|
28
|
-
function fe(e) {
|
|
29
|
-
return e.slot || (e.setAttribute || (e = T("span", e.textContent.replaceAll(`
|
|
30
|
-
`, ""))), e.setAttribute("slot", "")), e;
|
|
31
|
-
}
|
|
32
|
-
function K(e, l) {
|
|
33
|
-
e.getAttributeNames().forEach((t) => l.includes(t) || e.removeAttribute(t));
|
|
34
|
-
}
|
|
35
|
-
const Q = (e) => [...e].filter((l) => !(l.nodeType === 3 && l.data.trim() === ""));
|
|
36
|
-
function z(e, l, t) {
|
|
37
|
-
const s = typeof e;
|
|
38
|
-
if (s === "string")
|
|
39
|
-
return T(l, e, t);
|
|
40
|
-
if (s === "number")
|
|
41
|
-
return T(l, "" + e, t);
|
|
42
|
-
if (e instanceof Array) {
|
|
43
|
-
const i = T("array", "", t);
|
|
44
|
-
return e.map((r) => i.append(z(r, l, t))), i;
|
|
45
|
-
}
|
|
46
|
-
if (e instanceof FormData) {
|
|
47
|
-
const i = T("form-data", "", t);
|
|
48
|
-
for (const r of e)
|
|
49
|
-
i.append(z(r[1], r[0], t));
|
|
50
|
-
return i;
|
|
51
|
-
}
|
|
52
|
-
const a = T(l, "", t);
|
|
53
|
-
for (let i in e)
|
|
54
|
-
pe(e[i]) || typeof e[i] == "function" || e[i] instanceof Window || (typeof e[i] != "object" && ne(i) ? a.setAttribute(i, e[i]) : a.append(z(e[i], i, t)));
|
|
55
|
-
return a;
|
|
56
|
-
}
|
|
57
|
-
function ee(e) {
|
|
58
|
-
if ($(e, "*", (l) => [...l.childNodes].filter((t) => t.nodeType === 3 && t.parentNode.localName !== "style" && t.data).forEach((t) => {
|
|
59
|
-
const s = t.data, a = s.matchAll(/{([^}]*)}/g);
|
|
60
|
-
if (a) {
|
|
61
|
-
let i = 0, r = (p) => D(t, p), x = [];
|
|
62
|
-
if ([...a].forEach((p) => {
|
|
63
|
-
p.index > i && x.push(r(p.input.substring(i, p.index)));
|
|
64
|
-
const N = e.querySelector("value-of").cloneNode();
|
|
65
|
-
N.setAttribute("select", p[1]), x.push(N), i = p.index + p[0].length;
|
|
66
|
-
}), i < s.length && x.push(r(s.substring(i, s.length))), x.length) {
|
|
67
|
-
for (let p of x)
|
|
68
|
-
l.insertBefore(p, t);
|
|
69
|
-
l.removeChild(t);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
})), "all" in e) {
|
|
73
|
-
let l = 1;
|
|
74
|
-
for (let t of e.all)
|
|
75
|
-
t.setAttribute && !t.tagName.startsWith("xsl:") && t.setAttribute("data-dce-id", "" + l++);
|
|
76
|
-
}
|
|
77
|
-
return e;
|
|
78
|
-
}
|
|
79
|
-
function he(e, l = "xsl:stylesheet") {
|
|
80
|
-
if (e.tagName === l || e.documentElement?.tagName === l)
|
|
81
|
-
return ee(e);
|
|
82
|
-
const t = q(`<xsl:stylesheet version="1.0" xmlns:xsl="${W}" xmlns:xhtml="${H}" xmlns:exsl="${ue}" exclude-result-prefixes="exsl" >
|
|
83
|
-
<xsl:output method="xml"/>
|
|
84
|
-
<xsl:template match="/"><dce-root xmlns="${H}"><xsl:apply-templates select="*" /></dce-root></xsl:template>
|
|
85
|
-
<xsl:template match="*[name()='template']">
|
|
86
|
-
<xsl:apply-templates mode="sanitize" select="*|text()"/>
|
|
87
|
-
</xsl:template>
|
|
88
|
-
<xsl:template match="*">
|
|
89
|
-
<xsl:apply-templates mode="sanitize" select="*|text()"/>
|
|
90
|
-
</xsl:template>
|
|
91
|
-
<xsl:template match="*[name()='svg']|*[name()='math']">
|
|
92
|
-
<xsl:apply-templates mode="sanitize" select="."/>
|
|
93
|
-
</xsl:template>
|
|
94
|
-
<xsl:template mode="sanitize" match="*[count(text())=1 and count(*)=0]">
|
|
95
|
-
<xsl:copy>
|
|
96
|
-
<xsl:apply-templates mode="sanitize" select="@*"/>
|
|
97
|
-
<xsl:value-of select="text()"></xsl:value-of>
|
|
98
|
-
</xsl:copy>
|
|
99
|
-
</xsl:template>
|
|
100
|
-
<xsl:template mode="sanitize" match="xhtml:*[count(text())=1 and count(*)=0]">
|
|
101
|
-
<xsl:element name="{local-name()}">
|
|
102
|
-
<xsl:apply-templates mode="sanitize" select="@*"/>
|
|
103
|
-
<xsl:value-of select="text()"></xsl:value-of>
|
|
104
|
-
</xsl:element>
|
|
105
|
-
</xsl:template>
|
|
106
|
-
<xsl:template mode="sanitize" match="*|@*">
|
|
107
|
-
<xsl:copy>
|
|
108
|
-
<xsl:apply-templates mode="sanitize" select="*|@*|text()"/>
|
|
109
|
-
</xsl:copy>
|
|
110
|
-
</xsl:template>
|
|
111
|
-
<xsl:template mode="sanitize" match="text()[normalize-space(.) = '']"/>
|
|
112
|
-
<xsl:template mode="sanitize" match="text()">
|
|
113
|
-
<dce-text>
|
|
114
|
-
<xsl:copy/>
|
|
115
|
-
</dce-text>
|
|
116
|
-
</xsl:template>
|
|
117
|
-
<xsl:template mode="sanitize" match="xsl:value-of|*[name()='slot']">
|
|
118
|
-
<xsl:copy>
|
|
119
|
-
<xsl:apply-templates mode="sanitize" select="*|@*|text()"/>
|
|
120
|
-
</xsl:copy>
|
|
121
|
-
</xsl:template>
|
|
122
|
-
<xsl:template mode="sanitize" match="xhtml:*">
|
|
123
|
-
<xsl:element name="{local-name()}">
|
|
124
|
-
<xsl:apply-templates mode="sanitize" select="*|@*|text()"/>
|
|
125
|
-
</xsl:element>
|
|
126
|
-
</xsl:template>
|
|
127
|
-
<xsl:template mode="sanitize" match="xhtml:input">
|
|
128
|
-
<xsl:element name="{local-name()}">
|
|
129
|
-
<xsl:apply-templates mode="sanitize" select="*|@*|text()"/>
|
|
130
|
-
</xsl:element>
|
|
131
|
-
<xsl:for-each select="*">
|
|
132
|
-
<xsl:copy>
|
|
133
|
-
<xsl:attribute name="for" >^</xsl:attribute>
|
|
134
|
-
<xsl:apply-templates mode="sanitize" select="*|@*|text()"/>
|
|
135
|
-
</xsl:copy>
|
|
136
|
-
</xsl:for-each>
|
|
137
|
-
</xsl:template>
|
|
138
|
-
</xsl:stylesheet>`), s = new XSLTProcessor(), a = ((n) => {
|
|
139
|
-
$(n, "custom-element", (b) => {
|
|
140
|
-
b.firstElementChild.localName === "template" && ([...b.firstElementChild.content.childNodes].forEach((y) => b.append(y)), b.firstElementChild.remove());
|
|
141
|
-
}), $(n, "script", (b) => b.remove());
|
|
142
|
-
const c = n.content ?? n.firstElementChild?.content ?? n.body ?? n;
|
|
143
|
-
we.forEach((b) => $(c, b, (y) => Te(y, c)));
|
|
144
|
-
const A = n.firstElementChild?.content || n.content, E = (b) => {
|
|
145
|
-
const y = q("<xhtml/>"), j = y.importNode(b, !0);
|
|
146
|
-
return y.replaceChild(j, y.documentElement), ae(j);
|
|
147
|
-
};
|
|
148
|
-
if (A) {
|
|
149
|
-
const b = T("div");
|
|
150
|
-
return [...A.childNodes].map((y) => b.append(y.cloneNode(!0))), E(b);
|
|
151
|
-
}
|
|
152
|
-
return E(n.documentElement || n.body || n);
|
|
153
|
-
})(e), i = q(
|
|
154
|
-
`<xsl:stylesheet version="1.0"
|
|
155
|
-
xmlns:xsl="${W}"
|
|
156
|
-
xmlns:xhtml="${H}"
|
|
157
|
-
xmlns:dce="urn:schemas-epa-wg:dce"
|
|
158
|
-
xmlns:exsl="http://exslt.org/common"
|
|
159
|
-
exclude-result-prefixes="exsl"
|
|
160
|
-
>
|
|
161
|
-
<xsl:template match="ignore">
|
|
162
|
-
<xsl:choose>
|
|
163
|
-
<xsl:when test="//attr">{//attr}</xsl:when>
|
|
164
|
-
<xsl:otherwise>{def}</xsl:otherwise>
|
|
165
|
-
</xsl:choose><xsl:value-of select="."></xsl:value-of></xsl:template>
|
|
166
|
-
<xsl:template mode="payload" match="attributes"></xsl:template>
|
|
167
|
-
<xsl:template match="/">
|
|
168
|
-
<xsl:apply-templates mode="payload" select="/datadom/attributes"/>
|
|
169
|
-
</xsl:template>
|
|
170
|
-
<xsl:template name="slot" >
|
|
171
|
-
<xsl:param name="slotname" />
|
|
172
|
-
<xsl:param name="defaultvalue" />
|
|
173
|
-
<xsl:choose>
|
|
174
|
-
<xsl:when test="//payload/*[@slot=$slotname]">
|
|
175
|
-
<xsl:copy-of select="//payload/*[@slot=$slotname]"/>
|
|
176
|
-
</xsl:when>
|
|
177
|
-
<xsl:otherwise>
|
|
178
|
-
<xsl:copy-of select="$defaultvalue"/>
|
|
179
|
-
</xsl:otherwise>
|
|
180
|
-
</xsl:choose>
|
|
181
|
-
</xsl:template>
|
|
182
|
-
<xsl:variable name="js-injected-body">
|
|
183
|
-
<xsl:call-template name="slot" >
|
|
184
|
-
<xsl:with-param name="slotname" select="''"/>
|
|
185
|
-
<xsl:with-param name="defaultvalue"/>
|
|
186
|
-
</xsl:call-template>
|
|
187
|
-
</xsl:variable>
|
|
188
|
-
</xsl:stylesheet>`
|
|
189
|
-
);
|
|
190
|
-
s.importStylesheet(t);
|
|
191
|
-
const r = s.transformToFragment(a, document), x = (n, c) => n.querySelector(c), p = x(i, 'template[mode="payload"]');
|
|
192
|
-
if (!r)
|
|
193
|
-
return console.error("transformation error", { xml: a.outerHTML, xsl: X(t) });
|
|
194
|
-
if (r.firstElementChild.localName !== "dce-root") {
|
|
195
|
-
const n = r.ownerDocument.createElement("dce-root");
|
|
196
|
-
[...r.childNodes].forEach((c) => n.append(c)), r.append(n);
|
|
197
|
-
}
|
|
198
|
-
const N = [];
|
|
199
|
-
[...r.querySelectorAll("dce-root>attribute")].forEach((n) => {
|
|
200
|
-
K(n, "namespace,name,select");
|
|
201
|
-
const c = J(n, "xsl:param"), A = f(n, "name");
|
|
202
|
-
p.append(c), K(c, "select,name");
|
|
203
|
-
let E = f(c, "select")?.split("??");
|
|
204
|
-
E || (E = ["//" + A, `'${c.textContent}'`], V(c), c.setAttribute("name", A));
|
|
205
|
-
let b;
|
|
206
|
-
if (E?.length > 1) {
|
|
207
|
-
c.removeAttribute("select");
|
|
208
|
-
const y = x(i, 'template[match="ignore"]>choose').cloneNode(!0);
|
|
209
|
-
V(y.firstElementChild).append(D(y, "{" + E[0] + "}")), V(y.lastElementChild).append(D(y, "{" + E[1] + "}")), y.firstElementChild.setAttribute("test", E[0]), c.append(y), b = y.cloneNode(!0);
|
|
210
|
-
} else
|
|
211
|
-
b = J(n, "xsl:value-of");
|
|
212
|
-
b.removeAttribute("name"), n.append(b), n.removeAttribute("select"), N.push(c);
|
|
213
|
-
}), [...r.querySelectorAll("[value]")].filter((n) => n.getAttribute("value").match(/\{(.*)\?\?(.*)\}/g)).forEach((n) => {
|
|
214
|
-
const c = f(n, "value");
|
|
215
|
-
c && n.setAttribute("value", Ae(c));
|
|
216
|
-
});
|
|
217
|
-
for (const n of r.childNodes)
|
|
218
|
-
p.append(i.importNode(n, !0));
|
|
219
|
-
[...p.getElementsByTagName("xsl:template")].forEach((n) => p.ownerDocument.documentElement.append(n));
|
|
220
|
-
const S = x(i, 'call-template[name="slot"]'), u = (n) => {
|
|
221
|
-
const c = S.cloneNode(!0), A = f(n, "name");
|
|
222
|
-
A && c.firstElementChild.setAttribute("select", `'${A}'`);
|
|
223
|
-
for (let E of n.childNodes)
|
|
224
|
-
c.lastElementChild.append(E);
|
|
225
|
-
return c;
|
|
226
|
-
};
|
|
227
|
-
$(p, "slot", (n) => n.parentNode.replaceChild(u(n), n));
|
|
228
|
-
const m = ee(i);
|
|
229
|
-
return m.params = N, m;
|
|
230
|
-
}
|
|
231
|
-
async function xe(e) {
|
|
232
|
-
return await new Promise((t, s) => {
|
|
233
|
-
const a = new XMLHttpRequest();
|
|
234
|
-
a.open("GET", e), a.responseType = "document", a.onload = () => {
|
|
235
|
-
a.readyState === a.DONE && a.status === 200 ? t(a.responseXML?.body || a.responseXML || T("div", a.responseText)) : s(`${a.statusText} - ${e}`);
|
|
236
|
-
}, a.addEventListener("error", (i) => s(i)), a.send();
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
function be(e, l, t = !1) {
|
|
240
|
-
if (e === l)
|
|
241
|
-
return !0;
|
|
242
|
-
if (typeof e != "object" || e === null || typeof l != "object" || l === null || Object.keys(e).length !== Object.keys(l).length)
|
|
243
|
-
return t;
|
|
244
|
-
for (let s in e)
|
|
245
|
-
if (!(s in l) || !be(e[s], l[s]))
|
|
246
|
-
return t;
|
|
247
|
-
return !0;
|
|
248
|
-
}
|
|
249
|
-
const ie = (e) => e.split("|").map((l) => l.trim()).filter((l) => l), ye = (e, l) => ie(l).map((t) => {
|
|
250
|
-
let s = e.ownerDocument, a = (i) => (e.append(i), i);
|
|
251
|
-
if (t.includes("/")) {
|
|
252
|
-
const i = [], r = s.evaluate(t, e);
|
|
253
|
-
for (let x; x = r.iterateNext(); )
|
|
254
|
-
i.push(x);
|
|
255
|
-
return i;
|
|
256
|
-
}
|
|
257
|
-
return [...e.childNodes].find((i) => i.localName === t) || a(T(t, "", s));
|
|
258
|
-
}).flat();
|
|
259
|
-
function te(e, l, t, s) {
|
|
260
|
-
if (!t.sliceProcessed)
|
|
261
|
-
return t.sliceProcessed = 1, ye(e, l ?? "").map((a) => {
|
|
262
|
-
const i = e.ownerDocument, r = t.sliceEventSource, x = t.sliceElement, p = () => [...a.childNodes].filter((d) => d.nodeType === 3 || d.localName === "value" || d.localName === "form-data").map((d) => d.remove());
|
|
263
|
-
r.getAttributeNames().map((d) => a.setAttribute(d, f(r, d))), [...a.childNodes].filter((d) => d.localName === "event").map((d) => d.remove()), "validationMessage" in r && a.setAttribute("validation-message", r.validationMessage), t.type === "init" && p(), a.append(z(t, "event", i));
|
|
264
|
-
const N = (r.type === "checkbox" || r.type === "radio") && !r.checked;
|
|
265
|
-
if (x.hasAttribute("slice-value")) {
|
|
266
|
-
r.value === void 0 ? a.removeAttribute("value") : a.setAttribute("value", r.value);
|
|
267
|
-
const d = N ? "" : M(f(x, "slice-value"), a);
|
|
268
|
-
p(), a.append(D(i, d));
|
|
269
|
-
} else {
|
|
270
|
-
if ("elements" in r)
|
|
271
|
-
return p(), a.append(z(new FormData(r), "value", a.ownerDocument)), a;
|
|
272
|
-
const d = N ? "" : r.value ?? f(r, "value");
|
|
273
|
-
p(), d == null ? [...a.childNodes].filter((S) => S.localName !== "event").map((S) => S.remove()) : de(d) ? a.append(D(i, d)) : a.append(z(d, "value", a.ownerDocument));
|
|
274
|
-
}
|
|
275
|
-
return a;
|
|
276
|
-
});
|
|
277
|
-
}
|
|
278
|
-
function $(e, l, t) {
|
|
279
|
-
e.querySelectorAll && [...e.querySelectorAll(l)].forEach(t);
|
|
280
|
-
}
|
|
281
|
-
const ge = async (e, l) => {
|
|
282
|
-
if (!e || !e.trim())
|
|
283
|
-
return [l];
|
|
284
|
-
if (e.startsWith("#"))
|
|
285
|
-
return ((t) => {
|
|
286
|
-
const s = t.querySelectorAll(e);
|
|
287
|
-
return [...s.length ? s : t.getRootNode().querySelectorAll(e)];
|
|
288
|
-
})(l.parentElement);
|
|
289
|
-
try {
|
|
290
|
-
const [t, s] = e.split("#");
|
|
291
|
-
if (e.charAt(0) === ".")
|
|
292
|
-
e = new URL(t, l.closest("[base]")?.getAttribute("base") || location).href;
|
|
293
|
-
else
|
|
294
|
-
try {
|
|
295
|
-
e = import.meta.resolve(t), s && (e += "#" + s);
|
|
296
|
-
} catch (i) {
|
|
297
|
-
console.error(i.message);
|
|
298
|
-
}
|
|
299
|
-
const a = await xe(e);
|
|
300
|
-
if (l.setAttributeNS("xml", "base", e), s) {
|
|
301
|
-
const i = a.querySelectorAll("#" + s);
|
|
302
|
-
return i.length ? [...i] : (console.error("template not found", e + "#" + s), [l]);
|
|
303
|
-
}
|
|
304
|
-
return [a];
|
|
305
|
-
} catch {
|
|
306
|
-
return [l];
|
|
307
|
-
}
|
|
308
|
-
};
|
|
309
|
-
function ve(e, l) {
|
|
310
|
-
for (let t of e.attributes)
|
|
311
|
-
t.namespaceURI ? l.setAttributeNS(t.namespaceURI, t.name, t.value) : l.setAttribute(t.name, t.value), t.name === "value" && (l.value = t.value);
|
|
312
|
-
}
|
|
313
|
-
function oe(e, l = 0) {
|
|
314
|
-
const t = {};
|
|
315
|
-
for (const s of e.childNodes) {
|
|
316
|
-
const a = f(s, "data-dce-id") || s.dceId || 0;
|
|
317
|
-
if (!t[a])
|
|
318
|
-
a ? t[a] = 1 : (t[a] = s.dceId = ++l, s.setAttribute && s.setAttribute("data-dce-id", s.dceId));
|
|
319
|
-
else {
|
|
320
|
-
const i = s.dceId = a + "-" + t[a]++;
|
|
321
|
-
s.setAttribute && s.setAttribute("data-dce-id", i);
|
|
322
|
-
}
|
|
323
|
-
s.childNodes.length && oe(s);
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
function Ee(e, l, t) {
|
|
327
|
-
t = 1 * t;
|
|
328
|
-
for (let s of e.childNodes)
|
|
329
|
-
if ((s.dceId ?? s.getAttribute("data-dce-id") * 1) > t)
|
|
330
|
-
return e.insertBefore(l, s);
|
|
331
|
-
e.append(l);
|
|
332
|
-
}
|
|
333
|
-
function re(e, l) {
|
|
334
|
-
if (e.firstElementChild?.localName === "dce-root" && l[0].localName !== "dce-root")
|
|
335
|
-
return;
|
|
336
|
-
if (!l.length)
|
|
337
|
-
return e.firstElementChild?.localName !== "dce-root" && se(e);
|
|
338
|
-
const t = {};
|
|
339
|
-
for (let s of e.childNodes)
|
|
340
|
-
t[s.dceId], Z(s) ? (s.data.trim(), t[s.dceId || 0] = s) : t[f(s, "data-dce-id") || 0] = s;
|
|
341
|
-
for (let s of [...l]) {
|
|
342
|
-
const a = f(s, "data-dce-id") || s.dceId, i = t[a];
|
|
343
|
-
i ? (Z(s) ? i.nodeValue !== s.nodeValue && (i.nodeValue = s.nodeValue) : (ve(s, i), (i.childNodes.length || s.childNodes.length) && re(i, s.childNodes)), delete t[a]) : Ee(e, s, a);
|
|
344
|
-
}
|
|
345
|
-
for (let s of Object.values(t))
|
|
346
|
-
s.localName !== "dce-root" && s.remove();
|
|
347
|
-
}
|
|
348
|
-
function Ne(e, l) {
|
|
349
|
-
return e.hasAttribute(l) || e.setAttribute(l, crypto.randomUUID()), e.getAttribute(l);
|
|
350
|
-
}
|
|
351
|
-
const Ae = (e) => [...e?.matchAll(/([^{}]*)(\{)([^}]+)}([^{}]*)/g)].map((t) => `${t[1]}{${Y(t[3])}}${t[4]}`).join(""), Y = (e) => {
|
|
352
|
-
if (!e.trim())
|
|
353
|
-
return e;
|
|
354
|
-
const l = e.split("??"), t = l.shift(), s = Y(l.join("??"));
|
|
355
|
-
return l.length ? `concat( ${t} , substring( ${s} , (1+string-length( ${s} )) * string-length( ${t} ) ) )` : e;
|
|
356
|
-
}, M = (e, l) => {
|
|
357
|
-
const t = e.split("??");
|
|
358
|
-
if (t.length > 1)
|
|
359
|
-
return M(t[0], l) || M(t[1], l);
|
|
360
|
-
e = Y(e);
|
|
361
|
-
const s = l.ownerDocument.evaluate(e, l);
|
|
362
|
-
switch (s.resultType) {
|
|
363
|
-
case XPathResult.NUMBER_TYPE:
|
|
364
|
-
return s.numberValue;
|
|
365
|
-
case XPathResult.STRING_TYPE:
|
|
366
|
-
return s.stringValue;
|
|
367
|
-
case XPathResult.BOOLEAN_TYPE:
|
|
368
|
-
return s.booleanValue;
|
|
369
|
-
}
|
|
370
|
-
let a = "";
|
|
371
|
-
for (let i; i = s.iterateNext(); )
|
|
372
|
-
a += i.textContent;
|
|
373
|
-
return a;
|
|
374
|
-
}, we = "stylesheet,transform,import,include,strip-space,preserve-space,output,key,decimal-format,namespace-alias,value-of,copy-of,number,apply-templates,apply-imports,for-each,sort,if,choose,when,otherwise,attribute-set,call-template,with-param,variable,param,text,processing-instruction,element,attribute,comment,copy,message,fallback".split(","), Te = (e, l) => {
|
|
375
|
-
const t = T("xsl:" + e.localName);
|
|
376
|
-
for (let s of e.attributes)
|
|
377
|
-
t.setAttribute(s.name, s.value);
|
|
378
|
-
for (; e.firstChild; )
|
|
379
|
-
t.append(e.firstChild);
|
|
380
|
-
if (e.parentElement)
|
|
381
|
-
e.parentElement.replaceChild(t, e);
|
|
382
|
-
else {
|
|
383
|
-
const s = e.parentElement || l, a = [...s.childNodes];
|
|
384
|
-
a.forEach((i, r) => {
|
|
385
|
-
i === e && (a[r] = t);
|
|
386
|
-
}), s.replaceChildren(...a);
|
|
387
|
-
}
|
|
388
|
-
};
|
|
389
|
-
class Ce extends HTMLElement {
|
|
390
|
-
static observedAttributes = ["src", "tag", "hidden"];
|
|
391
|
-
async connectedCallback() {
|
|
392
|
-
this.firstElementChild && this.firstElementChild.localName !== "template" && console.warn(`custom-element used without template wrapping content
|
|
393
|
-
`, this.outerHTML);
|
|
394
|
-
const l = await ge(f(this, "src"), this), t = f(this, "tag"), s = t || "dce-" + crypto.randomUUID();
|
|
395
|
-
for (const u of l)
|
|
396
|
-
$(u.templateNode || u.content || u, "style", (m) => {
|
|
397
|
-
const n = m.closest("slot"), c = n ? `slot[name="${n.name}"]` : "";
|
|
398
|
-
m.innerHTML = `${s} ${c}{${m.innerHTML}}`, this.append(m);
|
|
399
|
-
});
|
|
400
|
-
const a = l.map((u) => he(u)), i = a.map((u, m) => {
|
|
401
|
-
m = new XSLTProcessor();
|
|
402
|
-
try {
|
|
403
|
-
m.importStylesheet(u);
|
|
404
|
-
} catch (n) {
|
|
405
|
-
console.error(n, X(u));
|
|
406
|
-
}
|
|
407
|
-
return m;
|
|
408
|
-
});
|
|
409
|
-
Object.defineProperty(this, "xsltString", { get: () => a.map((u) => X(u)).join(`
|
|
410
|
-
`) });
|
|
411
|
-
const r = this, x = [...this.templateNode.querySelectorAll("[slice]")], p = x.map((u) => f(u, "slice")).filter((u) => !u.includes("/")).filter((u, m, n) => n.indexOf(u) === m).map(ie).flat(), N = a.reduce((u, m) => (m.params && u.push(...m.params), u), []);
|
|
412
|
-
class d extends HTMLElement {
|
|
413
|
-
static get observedAttributes() {
|
|
414
|
-
return N.map((m) => f(m, "name"));
|
|
415
|
-
}
|
|
416
|
-
#e = 0;
|
|
417
|
-
connectedCallback() {
|
|
418
|
-
let m = Q(this.childNodes);
|
|
419
|
-
if (this.firstElementChild?.tagName === "TEMPLATE") {
|
|
420
|
-
this.firstElementChild !== this.lastElementChild && console.error("payload should have TEMPLATE as only child", this.outerHTML);
|
|
421
|
-
const h = this.firstElementChild;
|
|
422
|
-
h.remove(), m = Q(h.content.childNodes);
|
|
423
|
-
for (const g of m)
|
|
424
|
-
if (g.localName === "style") {
|
|
425
|
-
const o = Ne(this, "data-dce-style");
|
|
426
|
-
g.innerHTML = `${s}[data-dce-style="${o}"]{${g.innerHTML}}`, h.insertAdjacentElement("beforebegin", g);
|
|
427
|
-
} else
|
|
428
|
-
g.nodeType === 1 ? h.insertAdjacentElement("beforebegin", g) : g.nodeType === 3 && h.insertAdjacentText("beforebegin", g.data);
|
|
429
|
-
}
|
|
430
|
-
const n = q("<datadom/>").documentElement, c = (h, g = "") => ((o) => (g && o.append(D(n, g)), o))(n.ownerDocument.createElement(h)), A = U(n, "payload", m, fe);
|
|
431
|
-
le(A), ae(A), this.innerHTML = "";
|
|
432
|
-
const E = U(n, "attributes", this.attributes, (h) => c(h.nodeName, h.value));
|
|
433
|
-
U(n, "dataset", Object.keys(this.dataset), (h) => c(h, this.dataset[h]));
|
|
434
|
-
const b = U(n, "slice", p, (h) => c(h, "")), y = (h) => M(h, b);
|
|
435
|
-
this.xml = n;
|
|
436
|
-
const j = [], G = () => {
|
|
437
|
-
const h = {};
|
|
438
|
-
for (let g; g = j.pop(); ) {
|
|
439
|
-
const o = f(g.sliceElement, "slice");
|
|
440
|
-
h[o] || (te(b, o, g), h[o] = g);
|
|
441
|
-
}
|
|
442
|
-
Object.keys(h).length !== 0 && k();
|
|
443
|
-
};
|
|
444
|
-
let O;
|
|
445
|
-
this.onSlice = (h) => {
|
|
446
|
-
j.push(h), O || (O = setTimeout(() => {
|
|
447
|
-
G(), O = 0;
|
|
448
|
-
}, 1));
|
|
449
|
-
};
|
|
450
|
-
const k = this.transform = () => {
|
|
451
|
-
if (this.#e)
|
|
452
|
-
debugger;
|
|
453
|
-
this.#e = 1, i.map((o, v) => {
|
|
454
|
-
const C = o.transformToFragment(n.ownerDocument, document);
|
|
455
|
-
return C || console.error(`XSLT transformation error. xsl:
|
|
456
|
-
`, X(a[v]), `
|
|
457
|
-
xml:
|
|
458
|
-
`, X(n)), C;
|
|
459
|
-
}).map((o) => {
|
|
460
|
-
o && (oe(o), re(this, o.childNodes));
|
|
461
|
-
}), d.observedAttributes.map((o) => {
|
|
462
|
-
let v = f(this.firstElementChild, o);
|
|
463
|
-
v !== f(this, o) && (this.setAttribute(o, v), this.#t(o, v));
|
|
464
|
-
});
|
|
465
|
-
function g(o) {
|
|
466
|
-
let v = o;
|
|
467
|
-
if (o.localName === "slice") {
|
|
468
|
-
const C = f(o, "for");
|
|
469
|
-
if (C || (v = o.parentElement), C === "^")
|
|
470
|
-
do
|
|
471
|
-
v = v.previousElementSibling;
|
|
472
|
-
while (v.localName === "slice");
|
|
473
|
-
else
|
|
474
|
-
v = this.querySelector(C);
|
|
475
|
-
if (!v)
|
|
476
|
-
return console.warn(`can not find selector in "slice for=${C}" `, o.outerHTML);
|
|
477
|
-
f(o, "slice") || o.setAttribute("slice", f(o, "name"));
|
|
478
|
-
}
|
|
479
|
-
return v;
|
|
480
|
-
}
|
|
481
|
-
$(this, "[slice],[slice-event]", (o) => {
|
|
482
|
-
let v = f(o, "slice-event");
|
|
483
|
-
const C = o.hasAttribute("slice-value") || o.hasAttribute("value") || o.value, P = g(o);
|
|
484
|
-
o.dceInitialized || (o.dceInitialized = 1, P.hasAttribute("custom-validity") && (v += " change submit"), [...new Set((v || "change").split(" "))].forEach((ce) => P.addEventListener(ce, (w) => {
|
|
485
|
-
w.sliceElement = o, w.sliceEventSource = w.currentTarget || w.target, w.sliceProcessed = 0;
|
|
486
|
-
const me = te(b, f(w.sliceElement, "slice"), w);
|
|
487
|
-
$(this, "[custom-validity]", (R) => {
|
|
488
|
-
if (!R.setCustomValidity)
|
|
489
|
-
return;
|
|
490
|
-
const F = f(R, "custom-validity");
|
|
491
|
-
try {
|
|
492
|
-
const I = F && M(F, E);
|
|
493
|
-
R.setCustomValidity(I === !0 ? "" : I === !1 ? "invalid" : I);
|
|
494
|
-
} catch (I) {
|
|
495
|
-
console.error(I, "xPath", F);
|
|
496
|
-
}
|
|
497
|
-
});
|
|
498
|
-
const _ = f(P, "custom-validity"), L = _ && M(_, E), B = L === !0 ? "" : L;
|
|
499
|
-
if (_) {
|
|
500
|
-
if (o.setCustomValidity ? o.setCustomValidity(B) : o.validationMessage = B, me.map((R) => R.setAttribute("validation-message", B)), w.type === "submit")
|
|
501
|
-
return L === !0 ? void 0 : (setTimeout(k, 1), !!L === L ? (L || w.preventDefault(), L) : L ? (w.preventDefault(), !1) : void 0);
|
|
502
|
-
setTimeout(k, 1);
|
|
503
|
-
}
|
|
504
|
-
this.onSlice(w);
|
|
505
|
-
})), (!v || v.includes("init")) && (C ? this.onSlice({ type: "init", target: P, sliceElement: o, sliceEventSource: P }) : o.value = y(f(o, "slice"))));
|
|
506
|
-
}), this.#e = 0;
|
|
507
|
-
};
|
|
508
|
-
k(), G();
|
|
509
|
-
}
|
|
510
|
-
#t(m, n) {
|
|
511
|
-
m === "value" && (this.value = n);
|
|
512
|
-
let c = this.xml.querySelector(`attributes>${m}`);
|
|
513
|
-
c ? V(c).append(D(c, n)) : (c = T(m, n, this.xml), this.xml.querySelector("attributes").append(c)), this.dispatchEvent(new CustomEvent("change", { bubbles: !0, detail: { [m]: n } }));
|
|
514
|
-
}
|
|
515
|
-
attributeChangedCallback(m, n, c) {
|
|
516
|
-
!this.xml || this.#e || (this.#t(m, c), this.transform());
|
|
517
|
-
}
|
|
518
|
-
get dce() {
|
|
519
|
-
return r;
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
const S = (u) => {
|
|
523
|
-
window.customElements.get(u) !== d && window.customElements.define(u, d);
|
|
524
|
-
};
|
|
525
|
-
if (t)
|
|
526
|
-
S(t);
|
|
527
|
-
else {
|
|
528
|
-
const u = s;
|
|
529
|
-
this.setAttribute("tag", u), S(u);
|
|
530
|
-
const m = document.createElement(u);
|
|
531
|
-
this.getAttributeNames().forEach((n) => m.setAttribute(n, this.getAttribute(n))), m.append(...[...this.childNodes].filter((n) => n.localName !== "style")), this.append(m);
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
get templateNode() {
|
|
535
|
-
return this.firstElementChild?.tagName === "TEMPLATE" ? this.firstElementChild.content : this;
|
|
536
|
-
}
|
|
537
|
-
get dce() {
|
|
538
|
-
return this;
|
|
539
|
-
}
|
|
540
|
-
get xslt() {
|
|
541
|
-
return q(this.xsltString);
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
window.customElements.define("custom-element", Ce);
|
|
545
|
-
export {
|
|
546
|
-
Ce as C,
|
|
547
|
-
X as a,
|
|
548
|
-
xe as b,
|
|
549
|
-
he as c,
|
|
550
|
-
be as d,
|
|
551
|
-
ye as e,
|
|
552
|
-
te as f,
|
|
553
|
-
oe as g,
|
|
554
|
-
Ee as h,
|
|
555
|
-
re as i,
|
|
556
|
-
Ne as j,
|
|
557
|
-
Ae as k,
|
|
558
|
-
Y as l,
|
|
559
|
-
ve as m,
|
|
560
|
-
M as n,
|
|
561
|
-
z as o,
|
|
562
|
-
we as p,
|
|
563
|
-
Te as q,
|
|
564
|
-
Q as s,
|
|
565
|
-
ee as t,
|
|
566
|
-
q as x
|
|
567
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ae as ce,af as v,ag as p,ah as E,a2 as Y,a0 as he,N as fe,ai as de,aj as ge,ak as be,al as H}from"./index-3Sfy-t3H.js";import"./iframe-DnhkgdtG.js";import"../sb-preview/runtime.js";import"./index-BcZLpTeD.js";import"./index-D-8MO0q_.js";import"./index-DrFu-skq.js";var ve=H({"../../node_modules/color-name/index.js"(n,l){l.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}}),J=H({"../../node_modules/color-convert/conversions.js"(n,l){var c=ve(),h={};for(let e of Object.keys(c))h[c[e]]=e;var i={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};l.exports=i;for(let e of Object.keys(i)){if(!("channels"in i[e]))throw new Error("missing channels property: "+e);if(!("labels"in i[e]))throw new Error("missing channel labels property: "+e);if(i[e].labels.length!==i[e].channels)throw new Error("channel and label counts mismatch: "+e);let{channels:t,labels:r}=i[e];delete i[e].channels,delete i[e].labels,Object.defineProperty(i[e],"channels",{value:t}),Object.defineProperty(i[e],"labels",{value:r})}i.rgb.hsl=function(e){let t=e[0]/255,r=e[1]/255,a=e[2]/255,o=Math.min(t,r,a),u=Math.max(t,r,a),s=u-o,f,g;u===o?f=0:t===u?f=(r-a)/s:r===u?f=2+(a-t)/s:a===u&&(f=4+(t-r)/s),f=Math.min(f*60,360),f<0&&(f+=360);let b=(o+u)/2;return u===o?g=0:b<=.5?g=s/(u+o):g=s/(2-u-o),[f,g*100,b*100]},i.rgb.hsv=function(e){let t,r,a,o,u,s=e[0]/255,f=e[1]/255,g=e[2]/255,b=Math.max(s,f,g),y=b-Math.min(s,f,g),m=function(k){return(b-k)/6/y+1/2};return y===0?(o=0,u=0):(u=y/b,t=m(s),r=m(f),a=m(g),s===b?o=a-r:f===b?o=1/3+t-a:g===b&&(o=2/3+r-t),o<0?o+=1:o>1&&(o-=1)),[o*360,u*100,b*100]},i.rgb.hwb=function(e){let t=e[0],r=e[1],a=e[2],o=i.rgb.hsl(e)[0],u=1/255*Math.min(t,Math.min(r,a));return a=1-1/255*Math.max(t,Math.max(r,a)),[o,u*100,a*100]},i.rgb.cmyk=function(e){let t=e[0]/255,r=e[1]/255,a=e[2]/255,o=Math.min(1-t,1-r,1-a),u=(1-t-o)/(1-o)||0,s=(1-r-o)/(1-o)||0,f=(1-a-o)/(1-o)||0;return[u*100,s*100,f*100,o*100]};function d(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}i.rgb.keyword=function(e){let t=h[e];if(t)return t;let r=1/0,a;for(let o of Object.keys(c)){let u=c[o],s=d(e,u);s<r&&(r=s,a=o)}return a},i.keyword.rgb=function(e){return c[e]},i.rgb.xyz=function(e){let t=e[0]/255,r=e[1]/255,a=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,a=a>.04045?((a+.055)/1.055)**2.4:a/12.92;let o=t*.4124+r*.3576+a*.1805,u=t*.2126+r*.7152+a*.0722,s=t*.0193+r*.1192+a*.9505;return[o*100,u*100,s*100]},i.rgb.lab=function(e){let t=i.rgb.xyz(e),r=t[0],a=t[1],o=t[2];r/=95.047,a/=100,o/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,a=a>.008856?a**(1/3):7.787*a+16/116,o=o>.008856?o**(1/3):7.787*o+16/116;let u=116*a-16,s=500*(r-a),f=200*(a-o);return[u,s,f]},i.hsl.rgb=function(e){let t=e[0]/360,r=e[1]/100,a=e[2]/100,o,u,s;if(r===0)return s=a*255,[s,s,s];a<.5?o=a*(1+r):o=a+r-a*r;let f=2*a-o,g=[0,0,0];for(let b=0;b<3;b++)u=t+1/3*-(b-1),u<0&&u++,u>1&&u--,6*u<1?s=f+(o-f)*6*u:2*u<1?s=o:3*u<2?s=f+(o-f)*(2/3-u)*6:s=f,g[b]=s*255;return g},i.hsl.hsv=function(e){let t=e[0],r=e[1]/100,a=e[2]/100,o=r,u=Math.max(a,.01);a*=2,r*=a<=1?a:2-a,o*=u<=1?u:2-u;let s=(a+r)/2,f=a===0?2*o/(u+o):2*r/(a+r);return[t,f*100,s*100]},i.hsv.rgb=function(e){let t=e[0]/60,r=e[1]/100,a=e[2]/100,o=Math.floor(t)%6,u=t-Math.floor(t),s=255*a*(1-r),f=255*a*(1-r*u),g=255*a*(1-r*(1-u));switch(a*=255,o){case 0:return[a,g,s];case 1:return[f,a,s];case 2:return[s,a,g];case 3:return[s,f,a];case 4:return[g,s,a];case 5:return[a,s,f]}},i.hsv.hsl=function(e){let t=e[0],r=e[1]/100,a=e[2]/100,o=Math.max(a,.01),u,s;s=(2-r)*a;let f=(2-r)*o;return u=r*o,u/=f<=1?f:2-f,u=u||0,s/=2,[t,u*100,s*100]},i.hwb.rgb=function(e){let t=e[0]/360,r=e[1]/100,a=e[2]/100,o=r+a,u;o>1&&(r/=o,a/=o);let s=Math.floor(6*t),f=1-a;u=6*t-s,s&1&&(u=1-u);let g=r+u*(f-r),b,y,m;switch(s){default:case 6:case 0:b=f,y=g,m=r;break;case 1:b=g,y=f,m=r;break;case 2:b=r,y=f,m=g;break;case 3:b=r,y=g,m=f;break;case 4:b=g,y=r,m=f;break;case 5:b=f,y=r,m=g;break}return[b*255,y*255,m*255]},i.cmyk.rgb=function(e){let t=e[0]/100,r=e[1]/100,a=e[2]/100,o=e[3]/100,u=1-Math.min(1,t*(1-o)+o),s=1-Math.min(1,r*(1-o)+o),f=1-Math.min(1,a*(1-o)+o);return[u*255,s*255,f*255]},i.xyz.rgb=function(e){let t=e[0]/100,r=e[1]/100,a=e[2]/100,o,u,s;return o=t*3.2406+r*-1.5372+a*-.4986,u=t*-.9689+r*1.8758+a*.0415,s=t*.0557+r*-.204+a*1.057,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,u=u>.0031308?1.055*u**(1/2.4)-.055:u*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,o=Math.min(Math.max(0,o),1),u=Math.min(Math.max(0,u),1),s=Math.min(Math.max(0,s),1),[o*255,u*255,s*255]},i.xyz.lab=function(e){let t=e[0],r=e[1],a=e[2];t/=95.047,r/=100,a/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,a=a>.008856?a**(1/3):7.787*a+16/116;let o=116*r-16,u=500*(t-r),s=200*(r-a);return[o,u,s]},i.lab.xyz=function(e){let t=e[0],r=e[1],a=e[2],o,u,s;u=(t+16)/116,o=r/500+u,s=u-a/200;let f=u**3,g=o**3,b=s**3;return u=f>.008856?f:(u-16/116)/7.787,o=g>.008856?g:(o-16/116)/7.787,s=b>.008856?b:(s-16/116)/7.787,o*=95.047,u*=100,s*=108.883,[o,u,s]},i.lab.lch=function(e){let t=e[0],r=e[1],a=e[2],o;o=Math.atan2(a,r)*360/2/Math.PI,o<0&&(o+=360);let u=Math.sqrt(r*r+a*a);return[t,u,o]},i.lch.lab=function(e){let t=e[0],r=e[1],a=e[2]/360*2*Math.PI,o=r*Math.cos(a),u=r*Math.sin(a);return[t,o,u]},i.rgb.ansi16=function(e,t=null){let[r,a,o]=e,u=t===null?i.rgb.hsv(e)[2]:t;if(u=Math.round(u/50),u===0)return 30;let s=30+(Math.round(o/255)<<2|Math.round(a/255)<<1|Math.round(r/255));return u===2&&(s+=60),s},i.hsv.ansi16=function(e){return i.rgb.ansi16(i.hsv.rgb(e),e[2])},i.rgb.ansi256=function(e){let t=e[0],r=e[1],a=e[2];return t===r&&r===a?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(a/255*5)},i.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let r=(~~(e>50)+1)*.5,a=(t&1)*r*255,o=(t>>1&1)*r*255,u=(t>>2&1)*r*255;return[a,o,u]},i.ansi256.rgb=function(e){if(e>=232){let u=(e-232)*10+8;return[u,u,u]}e-=16;let t,r=Math.floor(e/36)/5*255,a=Math.floor((t=e%36)/6)/5*255,o=t%6/5*255;return[r,a,o]},i.rgb.hex=function(e){let t=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(t.length)+t},i.hex.rgb=function(e){let t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let r=t[0];t[0].length===3&&(r=r.split("").map(f=>f+f).join(""));let a=parseInt(r,16),o=a>>16&255,u=a>>8&255,s=a&255;return[o,u,s]},i.rgb.hcg=function(e){let t=e[0]/255,r=e[1]/255,a=e[2]/255,o=Math.max(Math.max(t,r),a),u=Math.min(Math.min(t,r),a),s=o-u,f,g;return s<1?f=u/(1-s):f=0,s<=0?g=0:o===t?g=(r-a)/s%6:o===r?g=2+(a-t)/s:g=4+(t-r)/s,g/=6,g%=1,[g*360,s*100,f*100]},i.hsl.hcg=function(e){let t=e[1]/100,r=e[2]/100,a=r<.5?2*t*r:2*t*(1-r),o=0;return a<1&&(o=(r-.5*a)/(1-a)),[e[0],a*100,o*100]},i.hsv.hcg=function(e){let t=e[1]/100,r=e[2]/100,a=t*r,o=0;return a<1&&(o=(r-a)/(1-a)),[e[0],a*100,o*100]},i.hcg.rgb=function(e){let t=e[0]/360,r=e[1]/100,a=e[2]/100;if(r===0)return[a*255,a*255,a*255];let o=[0,0,0],u=t%1*6,s=u%1,f=1-s,g=0;switch(Math.floor(u)){case 0:o[0]=1,o[1]=s,o[2]=0;break;case 1:o[0]=f,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=s;break;case 3:o[0]=0,o[1]=f,o[2]=1;break;case 4:o[0]=s,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=f}return g=(1-r)*a,[(r*o[0]+g)*255,(r*o[1]+g)*255,(r*o[2]+g)*255]},i.hcg.hsv=function(e){let t=e[1]/100,r=e[2]/100,a=t+r*(1-t),o=0;return a>0&&(o=t/a),[e[0],o*100,a*100]},i.hcg.hsl=function(e){let t=e[1]/100,r=e[2]/100*(1-t)+.5*t,a=0;return r>0&&r<.5?a=t/(2*r):r>=.5&&r<1&&(a=t/(2*(1-r))),[e[0],a*100,r*100]},i.hcg.hwb=function(e){let t=e[1]/100,r=e[2]/100,a=t+r*(1-t);return[e[0],(a-t)*100,(1-a)*100]},i.hwb.hcg=function(e){let t=e[1]/100,r=1-e[2]/100,a=r-t,o=0;return a<1&&(o=(r-a)/(1-a)),[e[0],a*100,o*100]},i.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},i.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},i.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},i.gray.hsl=function(e){return[0,0,e[0]]},i.gray.hsv=i.gray.hsl,i.gray.hwb=function(e){return[0,100,e[0]]},i.gray.cmyk=function(e){return[0,0,0,e[0]]},i.gray.lab=function(e){return[e[0],0,0]},i.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r},i.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}}}),me=H({"../../node_modules/color-convert/route.js"(n,l){var c=J();function h(){let t={},r=Object.keys(c);for(let a=r.length,o=0;o<a;o++)t[r[o]]={distance:-1,parent:null};return t}function i(t){let r=h(),a=[t];for(r[t].distance=0;a.length;){let o=a.pop(),u=Object.keys(c[o]);for(let s=u.length,f=0;f<s;f++){let g=u[f],b=r[g];b.distance===-1&&(b.distance=r[o].distance+1,b.parent=o,a.unshift(g))}}return r}function d(t,r){return function(a){return r(t(a))}}function e(t,r){let a=[r[t].parent,t],o=c[r[t].parent][t],u=r[t].parent;for(;r[u].parent;)a.unshift(r[u].parent),o=d(c[r[u].parent][u],o),u=r[u].parent;return o.conversion=a,o}l.exports=function(t){let r=i(t),a={},o=Object.keys(r);for(let u=o.length,s=0;s<u;s++){let f=o[s];r[f].parent!==null&&(a[f]=e(f,r))}return a}}}),pe=H({"../../node_modules/color-convert/index.js"(n,l){var c=J(),h=me(),i={},d=Object.keys(c);function e(r){let a=function(...o){let u=o[0];return u==null?u:(u.length>1&&(o=u),r(o))};return"conversion"in r&&(a.conversion=r.conversion),a}function t(r){let a=function(...o){let u=o[0];if(u==null)return u;u.length>1&&(o=u);let s=r(o);if(typeof s=="object")for(let f=s.length,g=0;g<f;g++)s[g]=Math.round(s[g]);return s};return"conversion"in r&&(a.conversion=r.conversion),a}d.forEach(r=>{i[r]={},Object.defineProperty(i[r],"channels",{value:c[r].channels}),Object.defineProperty(i[r],"labels",{value:c[r].labels});let a=h(r);Object.keys(a).forEach(o=>{let u=a[o];i[r][o]=t(u),i[r][o].raw=e(u)})}),l.exports=i}}),_=ce(pe());function M(){return(M=Object.assign||function(n){for(var l=1;l<arguments.length;l++){var c=arguments[l];for(var h in c)Object.prototype.hasOwnProperty.call(c,h)&&(n[h]=c[h])}return n}).apply(this,arguments)}function X(n,l){if(n==null)return{};var c,h,i={},d=Object.keys(n);for(h=0;h<d.length;h++)l.indexOf(c=d[h])>=0||(i[c]=n[c]);return i}function P(n){var l=p.useRef(n),c=p.useRef(function(h){l.current&&l.current(h)});return l.current=n,c.current}var $=function(n,l,c){return l===void 0&&(l=0),c===void 0&&(c=1),n>c?c:n<l?l:n},N=function(n){return"touches"in n},L=function(n){return n&&n.ownerDocument.defaultView||self},G=function(n,l,c){var h=n.getBoundingClientRect(),i=N(l)?function(d,e){for(var t=0;t<d.length;t++)if(d[t].identifier===e)return d[t];return d[0]}(l.touches,c):l;return{left:$((i.pageX-(h.left+L(n).pageXOffset))/h.width),top:$((i.pageY-(h.top+L(n).pageYOffset))/h.height)}},F=function(n){!N(n)&&n.preventDefault()},D=v.memo(function(n){var l=n.onMove,c=n.onKey,h=X(n,["onMove","onKey"]),i=p.useRef(null),d=P(l),e=P(c),t=p.useRef(null),r=p.useRef(!1),a=p.useMemo(function(){var f=function(y){F(y),(N(y)?y.touches.length>0:y.buttons>0)&&i.current?d(G(i.current,y,t.current)):b(!1)},g=function(){return b(!1)};function b(y){var m=r.current,k=L(i.current),w=y?k.addEventListener:k.removeEventListener;w(m?"touchmove":"mousemove",f),w(m?"touchend":"mouseup",g)}return[function(y){var m=y.nativeEvent,k=i.current;if(k&&(F(m),!function(q,se){return se&&!N(q)}(m,r.current)&&k)){if(N(m)){r.current=!0;var w=m.changedTouches||[];w.length&&(t.current=w[0].identifier)}k.focus(),d(G(k,m,t.current)),b(!0)}},function(y){var m=y.which||y.keyCode;m<37||m>40||(y.preventDefault(),e({left:m===39?.05:m===37?-.05:0,top:m===40?.05:m===38?-.05:0}))},b]},[e,d]),o=a[0],u=a[1],s=a[2];return p.useEffect(function(){return s},[s]),v.createElement("div",M({},h,{onTouchStart:o,onMouseDown:o,className:"react-colorful__interactive",ref:i,onKeyDown:u,tabIndex:0,role:"slider"}))}),O=function(n){return n.filter(Boolean).join(" ")},V=function(n){var l=n.color,c=n.left,h=n.top,i=h===void 0?.5:h,d=O(["react-colorful__pointer",n.className]);return v.createElement("div",{className:d,style:{top:100*i+"%",left:100*c+"%"}},v.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:l}}))},x=function(n,l,c){return l===void 0&&(l=0),c===void 0&&(c=Math.pow(10,l)),Math.round(c*n)/c},ye={grad:.9,turn:360,rad:360/(2*Math.PI)},xe=function(n){return ee(B(n))},B=function(n){return n[0]==="#"&&(n=n.substring(1)),n.length<6?{r:parseInt(n[0]+n[0],16),g:parseInt(n[1]+n[1],16),b:parseInt(n[2]+n[2],16),a:n.length===4?x(parseInt(n[3]+n[3],16)/255,2):1}:{r:parseInt(n.substring(0,2),16),g:parseInt(n.substring(2,4),16),b:parseInt(n.substring(4,6),16),a:n.length===8?x(parseInt(n.substring(6,8),16)/255,2):1}},we=function(n,l){return l===void 0&&(l="deg"),Number(n)*(ye[l]||1)},ke=function(n){var l=/hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(n);return l?_e({h:we(l[1],l[2]),s:Number(l[3]),l:Number(l[4]),a:l[5]===void 0?1:Number(l[5])/(l[6]?100:1)}):{h:0,s:0,v:0,a:1}},_e=function(n){var l=n.s,c=n.l;return{h:n.h,s:(l*=(c<50?c:100-c)/100)>0?2*l/(c+l)*100:0,v:c+l,a:n.a}},Ee=function(n){return Ce(Z(n))},Q=function(n){var l=n.s,c=n.v,h=n.a,i=(200-l)*c/100;return{h:x(n.h),s:x(i>0&&i<200?l*c/100/(i<=100?i:200-i)*100:0),l:x(i/2),a:x(h,2)}},T=function(n){var l=Q(n);return"hsl("+l.h+", "+l.s+"%, "+l.l+"%)"},z=function(n){var l=Q(n);return"hsla("+l.h+", "+l.s+"%, "+l.l+"%, "+l.a+")"},Z=function(n){var l=n.h,c=n.s,h=n.v,i=n.a;l=l/360*6,c/=100,h/=100;var d=Math.floor(l),e=h*(1-c),t=h*(1-(l-d)*c),r=h*(1-(1-l+d)*c),a=d%6;return{r:x(255*[h,t,e,e,r,h][a]),g:x(255*[r,h,h,t,e,e][a]),b:x(255*[e,e,r,h,h,t][a]),a:x(i,2)}},Me=function(n){var l=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(n);return l?ee({r:Number(l[1])/(l[2]?100/255:1),g:Number(l[3])/(l[4]?100/255:1),b:Number(l[5])/(l[6]?100/255:1),a:l[7]===void 0?1:Number(l[7])/(l[8]?100:1)}):{h:0,s:0,v:0,a:1}},S=function(n){var l=n.toString(16);return l.length<2?"0"+l:l},Ce=function(n){var l=n.r,c=n.g,h=n.b,i=n.a,d=i<1?S(x(255*i)):"";return"#"+S(l)+S(c)+S(h)+d},ee=function(n){var l=n.r,c=n.g,h=n.b,i=n.a,d=Math.max(l,c,h),e=d-Math.min(l,c,h),t=e?d===l?(c-h)/e:d===c?2+(h-l)/e:4+(l-c)/e:0;return{h:x(60*(t<0?t+6:t)),s:x(d?e/d*100:0),v:x(d/255*100),a:i}},re=v.memo(function(n){var l=n.hue,c=n.onChange,h=O(["react-colorful__hue",n.className]);return v.createElement("div",{className:h},v.createElement(D,{onMove:function(i){c({h:360*i.left})},onKey:function(i){c({h:$(l+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":x(l),"aria-valuemax":"360","aria-valuemin":"0"},v.createElement(V,{className:"react-colorful__hue-pointer",left:l/360,color:T({h:l,s:100,v:100,a:1})})))}),te=v.memo(function(n){var l=n.hsva,c=n.onChange,h={backgroundColor:T({h:l.h,s:100,v:100,a:1})};return v.createElement("div",{className:"react-colorful__saturation",style:h},v.createElement(D,{onMove:function(i){c({s:100*i.left,v:100-100*i.top})},onKey:function(i){c({s:$(l.s+100*i.left,0,100),v:$(l.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+x(l.s)+"%, Brightness "+x(l.v)+"%"},v.createElement(V,{className:"react-colorful__saturation-pointer",top:1-l.v/100,left:l.s/100,color:T(l)})))}),ne=function(n,l){if(n===l)return!0;for(var c in n)if(n[c]!==l[c])return!1;return!0},ae=function(n,l){return n.replace(/\s/g,"")===l.replace(/\s/g,"")},$e=function(n,l){return n.toLowerCase()===l.toLowerCase()||ne(B(n),B(l))};function oe(n,l,c){var h=P(c),i=p.useState(function(){return n.toHsva(l)}),d=i[0],e=i[1],t=p.useRef({color:l,hsva:d});p.useEffect(function(){if(!n.equal(l,t.current.color)){var a=n.toHsva(l);t.current={hsva:a,color:l},e(a)}},[l,n]),p.useEffect(function(){var a;ne(d,t.current.hsva)||n.equal(a=n.fromHsva(d),t.current.color)||(t.current={hsva:d,color:a},h(a))},[d,n,h]);var r=p.useCallback(function(a){e(function(o){return Object.assign({},o,a)})},[]);return[d,r]}var Ne=typeof window<"u"?p.useLayoutEffect:p.useEffect,Oe=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},W=new Map,le=function(n){Ne(function(){var l=n.current?n.current.ownerDocument:document;if(l!==void 0&&!W.has(l)){var c=l.createElement("style");c.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,W.set(l,c);var h=Oe();h&&c.setAttribute("nonce",h),l.head.appendChild(c)}},[])},Se=function(n){var l=n.className,c=n.colorModel,h=n.color,i=h===void 0?c.defaultColor:h,d=n.onChange,e=X(n,["className","colorModel","color","onChange"]),t=p.useRef(null);le(t);var r=oe(c,i,d),a=r[0],o=r[1],u=O(["react-colorful",l]);return v.createElement("div",M({},e,{ref:t,className:u}),v.createElement(te,{hsva:a,onChange:o}),v.createElement(re,{hue:a.h,onChange:o,className:"react-colorful__last-control"}))},je={defaultColor:"000",toHsva:xe,fromHsva:function(n){return Ee({h:n.h,s:n.s,v:n.v,a:1})},equal:$e},Re=function(n){return v.createElement(Se,M({},n,{colorModel:je}))},ze=function(n){var l=n.className,c=n.hsva,h=n.onChange,i={backgroundImage:"linear-gradient(90deg, "+z(Object.assign({},c,{a:0}))+", "+z(Object.assign({},c,{a:1}))+")"},d=O(["react-colorful__alpha",l]),e=x(100*c.a);return v.createElement("div",{className:d},v.createElement("div",{className:"react-colorful__alpha-gradient",style:i}),v.createElement(D,{onMove:function(t){h({a:t.left})},onKey:function(t){h({a:$(c.a+t.left)})},"aria-label":"Alpha","aria-valuetext":e+"%","aria-valuenow":e,"aria-valuemin":"0","aria-valuemax":"100"},v.createElement(V,{className:"react-colorful__alpha-pointer",left:c.a,color:z(c)})))},ue=function(n){var l=n.className,c=n.colorModel,h=n.color,i=h===void 0?c.defaultColor:h,d=n.onChange,e=X(n,["className","colorModel","color","onChange"]),t=p.useRef(null);le(t);var r=oe(c,i,d),a=r[0],o=r[1],u=O(["react-colorful",l]);return v.createElement("div",M({},e,{ref:t,className:u}),v.createElement(te,{hsva:a,onChange:o}),v.createElement(re,{hue:a.h,onChange:o}),v.createElement(ze,{hsva:a,onChange:o,className:"react-colorful__last-control"}))},Ie={defaultColor:"hsla(0, 0%, 0%, 1)",toHsva:ke,fromHsva:z,equal:ae},He=function(n){return v.createElement(ue,M({},n,{colorModel:Ie}))},qe={defaultColor:"rgba(0, 0, 0, 1)",toHsva:Me,fromHsva:function(n){var l=Z(n);return"rgba("+l.r+", "+l.g+", "+l.b+", "+l.a+")"},equal:ae},Pe=function(n){return v.createElement(ue,M({},n,{colorModel:qe}))},Le=E.div({position:"relative",maxWidth:250,'&[aria-readonly="true"]':{opacity:.5}}),Be=E(Y)({position:"absolute",zIndex:1,top:4,left:4,"[aria-readonly=true] &":{cursor:"not-allowed"}}),Te=E.div({width:200,margin:5,".react-colorful__saturation":{borderRadius:"4px 4px 0 0"},".react-colorful__hue":{boxShadow:"inset 0 0 0 1px rgb(0 0 0 / 5%)"},".react-colorful__last-control":{borderRadius:"0 0 4px 4px"}}),Ke=E(he)(({theme:n})=>({fontFamily:n.typography.fonts.base})),Xe=E.div({display:"grid",gridTemplateColumns:"repeat(9, 16px)",gap:6,padding:3,marginTop:5,width:200}),De=E.div(({theme:n,active:l})=>({width:16,height:16,boxShadow:l?`${n.appBorderColor} 0 0 0 1px inset, ${n.textMutedColor}50 0 0 0 4px`:`${n.appBorderColor} 0 0 0 1px inset`,borderRadius:n.appBorderRadius})),Ve=`url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')`,A=({value:n,style:l,...c})=>{let h=`linear-gradient(${n}, ${n}), ${Ve}, linear-gradient(#fff, #fff)`;return v.createElement(De,{...c,style:{...l,backgroundImage:h}})},Ge=E(fe.Input)(({theme:n,readOnly:l})=>({width:"100%",paddingLeft:30,paddingRight:30,boxSizing:"border-box",fontFamily:n.typography.fonts.base})),Fe=E(de)(({theme:n})=>({position:"absolute",zIndex:1,top:6,right:7,width:20,height:20,padding:4,boxSizing:"border-box",cursor:"pointer",color:n.input.color})),ie=(n=>(n.RGB="rgb",n.HSL="hsl",n.HEX="hex",n))(ie||{}),j=Object.values(ie),We=/\(([0-9]+),\s*([0-9]+)%?,\s*([0-9]+)%?,?\s*([0-9.]+)?\)/,Ae=/^\s*rgba?\(([0-9]+),\s*([0-9]+),\s*([0-9]+),?\s*([0-9.]+)?\)\s*$/i,Ue=/^\s*hsla?\(([0-9]+),\s*([0-9]+)%,\s*([0-9]+)%,?\s*([0-9.]+)?\)\s*$/i,K=/^\s*#?([0-9a-f]{3}|[0-9a-f]{6})\s*$/i,Ye=/^\s*#?([0-9a-f]{3})\s*$/i,Je={hex:Re,rgb:Pe,hsl:He},R={hex:"transparent",rgb:"rgba(0, 0, 0, 0)",hsl:"hsla(0, 0%, 0%, 0)"},U=n=>{let l=n?.match(We);if(!l)return[0,0,0,1];let[,c,h,i,d=1]=l;return[c,h,i,d].map(Number)},C=n=>{if(!n)return;let l=!0;if(Ae.test(n)){let[e,t,r,a]=U(n),[o,u,s]=_.default.rgb.hsl([e,t,r])||[0,0,0];return{valid:l,value:n,keyword:_.default.rgb.keyword([e,t,r]),colorSpace:"rgb",rgb:n,hsl:`hsla(${o}, ${u}%, ${s}%, ${a})`,hex:`#${_.default.rgb.hex([e,t,r]).toLowerCase()}`}}if(Ue.test(n)){let[e,t,r,a]=U(n),[o,u,s]=_.default.hsl.rgb([e,t,r])||[0,0,0];return{valid:l,value:n,keyword:_.default.hsl.keyword([e,t,r]),colorSpace:"hsl",rgb:`rgba(${o}, ${u}, ${s}, ${a})`,hsl:n,hex:`#${_.default.hsl.hex([e,t,r]).toLowerCase()}`}}let c=n.replace("#",""),h=_.default.keyword.rgb(c)||_.default.hex.rgb(c),i=_.default.rgb.hsl(h),d=n;if(/[^#a-f0-9]/i.test(n)?d=c:K.test(n)&&(d=`#${c}`),d.startsWith("#"))l=K.test(d);else try{_.default.keyword.hex(d)}catch{l=!1}return{valid:l,value:d,keyword:_.default.rgb.keyword(h),colorSpace:"hex",rgb:`rgba(${h[0]}, ${h[1]}, ${h[2]}, 1)`,hsl:`hsla(${i[0]}, ${i[1]}%, ${i[2]}%, 1)`,hex:d}},Qe=(n,l,c)=>{if(!n||!l?.valid)return R[c];if(c!=="hex")return l?.[c]||R[c];if(!l.hex.startsWith("#"))try{return`#${_.default.keyword.hex(l.hex)}`}catch{return R.hex}let h=l.hex.match(Ye);if(!h)return K.test(l.hex)?l.hex:R.hex;let[i,d,e]=h[1].split("");return`#${i}${i}${d}${d}${e}${e}`},Ze=(n,l)=>{let[c,h]=p.useState(n||""),[i,d]=p.useState(()=>C(c)),[e,t]=p.useState(i?.colorSpace||"hex");p.useEffect(()=>{let u=n||"",s=C(u);h(u),d(s),t(s?.colorSpace||"hex")},[n]);let r=p.useMemo(()=>Qe(c,i,e).toLowerCase(),[c,i,e]),a=p.useCallback(u=>{let s=C(u),f=s?.value||u||"";h(f),f===""&&(d(void 0),l(void 0)),s&&(d(s),t(s.colorSpace),l(s.value))},[l]),o=p.useCallback(()=>{let u=j.indexOf(e)+1;u>=j.length&&(u=0),t(j[u]);let s=i?.[j[u]]||"";h(s),l(s)},[i,e,l]);return{value:c,realValue:r,updateValue:a,color:i,colorSpace:e,cycleColorSpace:o}},I=n=>n.replace(/\s*/,"").toLowerCase(),er=(n,l,c)=>{let[h,i]=p.useState(l?.valid?[l]:[]);p.useEffect(()=>{l===void 0&&i([])},[l]);let d=p.useMemo(()=>(n||[]).map(t=>typeof t=="string"?C(t):t.title?{...C(t.color),keyword:t.title}:C(t.color)).concat(h).filter(Boolean).slice(-27),[n,h]),e=p.useCallback(t=>{t?.valid&&(d.some(r=>I(r[c])===I(t[c]))||i(r=>r.concat(t)))},[c,d]);return{presets:d,addPreset:e}},rr=({name:n,value:l,onChange:c,onFocus:h,onBlur:i,presetColors:d,startOpen:e=!1,argType:t})=>{let r=p.useCallback(ge(c,200),[c]),{value:a,realValue:o,updateValue:u,color:s,colorSpace:f,cycleColorSpace:g}=Ze(l,r),{presets:b,addPreset:y}=er(d,s,f),m=Je[f],k=!!t?.table?.readonly;return v.createElement(Le,{"aria-readonly":k},v.createElement(Be,{startOpen:e,trigger:k?[null]:void 0,closeOnOutsideClick:!0,onVisibleChange:()=>y(s),tooltip:v.createElement(Te,null,v.createElement(m,{color:o==="transparent"?"#000000":o,onChange:u,onFocus:h,onBlur:i}),b.length>0&&v.createElement(Xe,null,b.map((w,q)=>v.createElement(Y,{key:`${w.value}-${q}`,hasChrome:!1,tooltip:v.createElement(Ke,{note:w.keyword||w.value})},v.createElement(A,{value:w[f],active:s&&I(w[f])===I(s[f]),onClick:()=>u(w.value)})))))},v.createElement(A,{value:o,style:{margin:4}})),v.createElement(Ge,{id:be(n),value:a,onChange:w=>u(w.target.value),onFocus:w=>w.target.select(),readOnly:k,placeholder:"Choose color..."}),a?v.createElement(Fe,{onClick:g}):null)},ir=rr;export{rr as ColorControl,ir as default};
|