@epa-wg/custom-element-dist 0.0.29 → 0.0.31
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/custom-element-dist.iml +11 -0
- package/.idea/inspectionProfiles/Project_Default.xml +24 -0
- package/.idea/misc.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/.storybook/main.ts +21 -19
- package/.storybook/preview.ts +25 -25
- package/README.md +4 -4
- package/coverage/coverage-final.json +21 -21
- package/coverage/index.html +24 -24
- 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 +247 -241
- package/coverage/src/custom-element/http-request.js.html +3 -3
- package/coverage/src/custom-element/index.html +14 -14
- package/coverage/src/custom-element/local-storage.js.html +52 -52
- package/coverage/src/custom-element/location-element.js.html +4 -4
- package/coverage/src/custom-element/module-url.js.html +1 -1
- 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/attributes.test.stories.ts.html +28 -28
- package/coverage/src/stories/coverage.svg +1 -1
- package/coverage/src/stories/css.test.stories.ts.html +1 -1
- package/coverage/src/stories/dom-merge.test.stories.ts.html +1 -1
- package/coverage/src/stories/external-template.test.stories.ts.html +1 -1
- package/coverage/src/stories/form.test.stories.ts.html +1 -1
- package/coverage/src/stories/http-request.stories.ts.html +1 -1
- package/coverage/src/stories/index.html +19 -19
- package/coverage/src/stories/local-storage.test.stories.ts.html +17 -17
- package/coverage/src/stories/location-element.test.stories.ts.html +3 -6
- package/coverage/src/stories/module-url.test.stories.ts.html +1 -1
- package/coverage/src/stories/set-url.test.stories.ts.html +1 -1
- package/coverage/src/stories/slice-events.test.stories.ts/coverage.svg +1 -1
- package/coverage/src/stories/slice-events.test.stories.ts.html +284 -23
- package/coverage/src/stories/slots.test.stories.ts.html +1 -1
- package/coverage/src/stories/testStoryBook.ts.html +7 -7
- package/coverage/src/stories/version-select.test.stories.ts.html +1 -1
- package/coverage/src/sum.ts.html +1 -1
- package/dist/custom-element-BbJMY20-.cjs +97 -0
- package/dist/{custom-element-BOIPgtxz.js → custom-element-CoRNKeEP.js} +122 -120
- package/dist/custom-element-bundle.cjs +1 -1
- package/dist/custom-element-bundle.js +2 -2
- package/dist/demo/a.svg +26 -26
- package/dist/demo/data-slices.html +37 -0
- package/package.json +13 -13
- package/public/demo/a.svg +26 -26
- package/public/demo/data-slices.html +37 -0
- package/src/custom-element/custom-element.js +4 -2
- package/src/custom-element/demo/a.svg +26 -26
- package/src/custom-element/demo/data-slices.html +37 -0
- package/src/custom-element/ide/web-types-dce.json +1 -1
- package/src/custom-element/ide/web-types-xsl.json +1 -1
- package/src/material/angular.css +987 -987
- package/src/material/components/autocomplete.html +239 -240
- package/src/material/components/dropdown.html +92 -45
- package/src/material/components/icon-link.html +160 -160
- package/src/material/components/menu.html +234 -234
- package/src/material/components.html +121 -120
- package/src/material/demo.css +36 -31
- package/src/material/index.html +110 -110
- package/src/material/material.css +356 -356
- package/src/material/theme/README.md +17 -17
- package/src/material/theme/semantic.css +113 -112
- package/src/mocks/versions.mock.ts +8 -8
- package/src/stories/attributes.test.stories.ts +20 -20
- package/src/stories/location-element.test.stories.ts +1 -2
- package/src/stories/slice-events.test.stories.ts +87 -0
- package/storybook-static/assets/Color-F6OSRLHC-CFyd3TND.js +1 -0
- package/storybook-static/assets/{Configure-DOhzHFEs.js → Configure-UGTbPRKK.js} +1 -1
- package/storybook-static/assets/{DocsRenderer-CFRXHY34-BSJkbsd6.js → DocsRenderer-CFRXHY34-Dpr5iB0o.js} +2 -2
- package/storybook-static/assets/{attributes.test.stories-BJBuuXgZ.js → attributes.test.stories-DSOLHHOW.js} +38 -36
- package/storybook-static/assets/{css.test.stories-pgbBc17d.js → css.test.stories-Cgn6ICr0.js} +1 -1
- package/storybook-static/assets/custom-element-D59Fok1f.js +97 -0
- package/storybook-static/assets/{dom-merge.test.stories-CXcYP_-J.js → dom-merge.test.stories-CBObfPWg.js} +1 -1
- package/storybook-static/assets/entry-preview-DHVXbf3x.js +26 -0
- package/storybook-static/assets/entry-preview-docs-BbcIMweR.js +2 -0
- package/storybook-static/assets/{external-template.test.stories-CpJ68Ghy.js → external-template.test.stories-VfKUQ8eu.js} +1 -1
- package/storybook-static/assets/{form.test.stories-D35lyqd8.js → form.test.stories-CnuGN7Zw.js} +1 -1
- package/storybook-static/assets/{handlers-CW9pDZnt.js → handlers-V_T7WjNK.js} +21 -21
- package/storybook-static/assets/{http-request.stories-CBbknCOO.js → http-request.stories-8NN1Coqm.js} +1 -1
- package/storybook-static/assets/iframe-DnhkgdtG.js +2 -0
- package/storybook-static/assets/index-3Sfy-t3H.js +769 -0
- package/storybook-static/assets/index-BcZLpTeD.js +8 -0
- package/storybook-static/assets/index-CIBI7sCB.js +1 -0
- package/storybook-static/assets/{index-BSz1w4Gl.js → index-CxRwF5Or.js} +130 -130
- package/storybook-static/assets/{index-YxUFxnQR.js → index-DN1RoK17.js} +1 -1
- package/storybook-static/assets/{index-B3QjF0Ed.js → index-DjJD7gkO.js} +1 -1
- package/storybook-static/assets/{local-storage.test.stories-BY-PWhuk.js → local-storage.test.stories-Dk5Yqc7m.js} +1 -1
- package/storybook-static/assets/{location-element.test.stories-3auBYEaU.js → location-element.test.stories-56um6s5L.js} +1 -1
- package/storybook-static/assets/{module-url.test.stories-B7L9cL60.js → module-url.test.stories-DEponQ7l.js} +1 -1
- package/storybook-static/assets/{preview-BRPR-UXC.js → preview-CNKoaWES.js} +1 -1
- package/storybook-static/assets/preview-Czc-sw5H.js +2 -0
- package/storybook-static/assets/preview-DAeyCMnM.js +1 -0
- package/storybook-static/assets/{preview-CfWMRsRq.js → preview-vbpHsp94.js} +2 -2
- package/storybook-static/assets/{set-url.test.stories-CuSuDLIx.js → set-url.test.stories-B4E6hIe-.js} +1 -1
- package/storybook-static/assets/{slice-events.test.stories-BkRKsKem.js → slice-events.test.stories-BR0F-B6I.js} +138 -13
- package/storybook-static/assets/{slots.test.stories-BJCUWFkE.js → slots.test.stories-CgfJIyCr.js} +1 -1
- package/storybook-static/assets/tiny-invariant-CopsF_GD.js +1 -0
- package/storybook-static/assets/{version-select.test.stories-B3ybJn_Z.js → version-select.test.stories-nmxATIwv.js} +1 -1
- package/storybook-static/demo/a.svg +26 -26
- package/storybook-static/demo/data-slices.html +37 -0
- package/storybook-static/iframe.html +2 -2
- package/storybook-static/index.html +4 -0
- package/storybook-static/index.json +1 -1
- package/storybook-static/project.json +1 -1
- package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js +333 -0
- package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js.LEGAL.txt +40 -0
- package/storybook-static/sb-addons/essentials-actions-3/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/essentials-backgrounds-4/manager-bundle.js +8 -8
- package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js +82 -85
- 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-viewport-5/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/interactions-9/manager-bundle.js +66 -67
- package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +1 -1
- package/storybook-static/sb-manager/globals-module-info.js +25 -3
- package/storybook-static/sb-manager/globals-runtime.js +29585 -43124
- package/storybook-static/sb-manager/runtime.js +10647 -9399
- package/storybook-static/sb-preview/runtime.js +3536 -5860
- package/test-runner-jest.config.js +15 -0
- package/dist/custom-element-CUsSENWc.cjs +0 -97
- package/src/stories/__screenshots__/http-request.test.ts/http-request-url-change-1.png +0 -0
- package/storybook-static/assets/Color-ERTF36HU-CQkSD2nd.js +0 -1
- package/storybook-static/assets/custom-element-BDGsYgbP.js +0 -97
- package/storybook-static/assets/entry-preview-C313OLrj.js +0 -26
- package/storybook-static/assets/entry-preview-docs-B7ORr9w5.js +0 -2
- package/storybook-static/assets/iframe-DOi4N7qI.js +0 -2
- package/storybook-static/assets/index-BdcJ-iJ7.js +0 -8
- package/storybook-static/assets/index-CaL3Qp7t.js +0 -634
- package/storybook-static/assets/index-DgFM0Ce3.js +0 -1
- package/storybook-static/assets/preview-C992A1Y-.js +0 -2
- package/storybook-static/assets/preview-CcS4DQh8.js +0 -1
- package/storybook-static/assets/tiny-invariant-BxWVcicq.js +0 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const { getJestConfig } = require('@storybook/test-runner');
|
|
2
|
+
|
|
3
|
+
// The default Jest configuration comes from @storybook/test-runner
|
|
4
|
+
const testRunnerConfig = getJestConfig();
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @type {import('@jest/types').Config.InitialOptions}
|
|
8
|
+
*/
|
|
9
|
+
module.exports = {
|
|
10
|
+
...testRunnerConfig,
|
|
11
|
+
/** Add your own overrides below, and make sure
|
|
12
|
+
* to merge testRunnerConfig properties with your own
|
|
13
|
+
* @see https://jestjs.io/docs/configuration
|
|
14
|
+
*/
|
|
15
|
+
};
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
"use strict";const Y="http://www.w3.org/1999/XSL/Transform",k="http://www.w3.org/1999/xhtml",Ne="http://exslt.org/common",f=(e,l)=>e.getAttribute?.(l),te=e=>e.nodeType===3,Ae=e=>typeof e=="string",Te=e=>e&&typeof e.nodeType=="number",L=(e,l)=>(e.ownerDocument||e).createTextNode(l),ne=e=>{for(;e.firstChild;)e.firstChild.remove();return e},V=e=>(e.getAttributeNames().map(l=>e.removeAttribute(l)),ne(e)),ae=e=>(e?.setAttribute("xmlns:xsl",Y),e),ie=e=>(e?.setAttribute("xmlns:xhtml",k),ae(e)),oe=e=>/^[_a-zA-Z][-_:a-zA-Z0-9]*$/.test(e),T=(e,l="",t=document)=>{const s=i=>(r=>(l&&r.append(L(t.ownerDocument||t,l)),r))((t.ownerDocument||t).createElement(i));if(oe(e))return s(e);const n=s("dce-object");return n.setAttribute("dce-object-name",e),n},se=(e,l)=>{const t=e.ownerDocument.createElementNS(e.namespaceURI,l);for(let s of e.attributes)t.setAttribute(s.name,s.value);for(;e.firstChild;)t.append(e.firstChild);return t};function P(e){return new DOMParser().parseFromString(e,"application/xml")}function M(e){return new XMLSerializer().serializeToString(e)}function H(e,l,t,s){const n=x=>e.ownerDocument.createElement(x),r=((x,p,u)=>(p.append(u=n(x)),u))(l,e);return[...t].forEach(x=>r.append(s(x))),r}function we(e){return e.slot||(e.setAttribute||(e=T("span",e.textContent.replaceAll(`
|
|
2
|
-
`,""))),e.setAttribute("slot","")),e}function le(e,l){e.getAttributeNames().forEach(t=>l.includes(t)||e.removeAttribute(t))}const G=e=>[...e].filter(l=>!(l.nodeType===3&&l.data.trim()===""));function $(e,l,t){const s=typeof e;if(s==="string")return T(l,e,t);if(s==="number")return T(l,""+e,t);if(e instanceof Array){const i=T("array","",t);return e.map(r=>i.append($(r,l,t))),i}if(e instanceof FormData){const i=T("form-data","",t);for(const r of e)i.append($(r[1],r[0],t));return i}const n=T(l,"",t);for(let i in e)Te(e[i])||typeof e[i]=="function"||e[i]instanceof Window||(typeof e[i]!="object"&&oe(i)?n.setAttribute(i,e[i]):n.append($(e[i],i,t)));return n}function Z(e){if(D(e,"*",l=>[...l.childNodes].filter(t=>t.nodeType===3&&t.parentNode.localName!=="style"&&t.data).forEach(t=>{const s=t.data,n=s.matchAll(/{([^}]*)}/g);if(n){let i=0,r=p=>L(t,p),x=[];if([...n].forEach(p=>{p.index>i&&x.push(r(p.input.substring(i,p.index)));const u=e.querySelector("value-of").cloneNode();u.setAttribute("select",p[1]),x.push(u),i=p.index+p[0].length}),i<s.length&&x.push(r(s.substring(i,s.length))),x.length){for(let p of x)l.insertBefore(p,t);l.removeChild(t)}}})),"all"in e){let l=1;for(let t of e.all)t.setAttribute&&!t.tagName.startsWith("xsl:")&&t.setAttribute("data-dce-id",""+l++)}return e}function re(e,l="xsl:stylesheet"){if(e.tagName===l||e.documentElement?.tagName===l)return Z(e);const t=P(`<xsl:stylesheet version="1.0" xmlns:xsl="${Y}" xmlns:xhtml="${k}" xmlns:exsl="${Ne}" exclude-result-prefixes="exsl" >
|
|
3
|
-
<xsl:output method="xml"/>
|
|
4
|
-
<xsl:template match="/"><dce-root xmlns="${k}"><xsl:apply-templates select="*" /></dce-root></xsl:template>
|
|
5
|
-
<xsl:template match="*[name()='template']">
|
|
6
|
-
<xsl:apply-templates mode="sanitize" select="*|text()"/>
|
|
7
|
-
</xsl:template>
|
|
8
|
-
<xsl:template match="*">
|
|
9
|
-
<xsl:apply-templates mode="sanitize" select="*|text()"/>
|
|
10
|
-
</xsl:template>
|
|
11
|
-
<xsl:template match="*[name()='svg']|*[name()='math']">
|
|
12
|
-
<xsl:apply-templates mode="sanitize" select="."/>
|
|
13
|
-
</xsl:template>
|
|
14
|
-
<xsl:template mode="sanitize" match="*[count(text())=1 and count(*)=0]">
|
|
15
|
-
<xsl:copy>
|
|
16
|
-
<xsl:apply-templates mode="sanitize" select="@*"/>
|
|
17
|
-
<xsl:value-of select="text()"></xsl:value-of>
|
|
18
|
-
</xsl:copy>
|
|
19
|
-
</xsl:template>
|
|
20
|
-
<xsl:template mode="sanitize" match="xhtml:*[count(text())=1 and count(*)=0]">
|
|
21
|
-
<xsl:element name="{local-name()}">
|
|
22
|
-
<xsl:apply-templates mode="sanitize" select="@*"/>
|
|
23
|
-
<xsl:value-of select="text()"></xsl:value-of>
|
|
24
|
-
</xsl:element>
|
|
25
|
-
</xsl:template>
|
|
26
|
-
<xsl:template mode="sanitize" match="*|@*">
|
|
27
|
-
<xsl:copy>
|
|
28
|
-
<xsl:apply-templates mode="sanitize" select="*|@*|text()"/>
|
|
29
|
-
</xsl:copy>
|
|
30
|
-
</xsl:template>
|
|
31
|
-
<xsl:template mode="sanitize" match="text()[normalize-space(.) = '']"/>
|
|
32
|
-
<xsl:template mode="sanitize" match="text()">
|
|
33
|
-
<dce-text>
|
|
34
|
-
<xsl:copy/>
|
|
35
|
-
</dce-text>
|
|
36
|
-
</xsl:template>
|
|
37
|
-
<xsl:template mode="sanitize" match="xsl:value-of|*[name()='slot']">
|
|
38
|
-
<xsl:copy>
|
|
39
|
-
<xsl:apply-templates mode="sanitize" select="*|@*|text()"/>
|
|
40
|
-
</xsl:copy>
|
|
41
|
-
</xsl:template>
|
|
42
|
-
<xsl:template mode="sanitize" match="xhtml:*">
|
|
43
|
-
<xsl:element name="{local-name()}">
|
|
44
|
-
<xsl:apply-templates mode="sanitize" select="*|@*|text()"/>
|
|
45
|
-
</xsl:element>
|
|
46
|
-
</xsl:template>
|
|
47
|
-
<xsl:template mode="sanitize" match="xhtml:input">
|
|
48
|
-
<xsl:element name="{local-name()}">
|
|
49
|
-
<xsl:apply-templates mode="sanitize" select="*|@*|text()"/>
|
|
50
|
-
</xsl:element>
|
|
51
|
-
<xsl:for-each select="*">
|
|
52
|
-
<xsl:copy>
|
|
53
|
-
<xsl:attribute name="for" >^</xsl:attribute>
|
|
54
|
-
<xsl:apply-templates mode="sanitize" select="*|@*|text()"/>
|
|
55
|
-
</xsl:copy>
|
|
56
|
-
</xsl:for-each>
|
|
57
|
-
</xsl:template>
|
|
58
|
-
</xsl:stylesheet>`),s=new XSLTProcessor,n=(a=>{D(a,"custom-element",b=>{b.firstElementChild.localName==="template"&&([...b.firstElementChild.content.childNodes].forEach(y=>b.append(y)),b.firstElementChild.remove())}),D(a,"script",b=>b.remove());const c=a.content??a.firstElementChild?.content??a.body??a;be.forEach(b=>D(c,b,y=>ye(y,c)));const N=a.firstElementChild?.content||a.content,E=b=>{const y=P("<xhtml/>"),j=y.importNode(b,!0);return y.replaceChild(j,y.documentElement),ie(j)};if(N){const b=T("div");return[...N.childNodes].map(y=>b.append(y.cloneNode(!0))),E(b)}return E(a.documentElement||a.body||a)})(e),i=P(`<xsl:stylesheet version="1.0"
|
|
59
|
-
xmlns:xsl="${Y}"
|
|
60
|
-
xmlns:xhtml="${k}"
|
|
61
|
-
xmlns:dce="urn:schemas-epa-wg:dce"
|
|
62
|
-
xmlns:exsl="http://exslt.org/common"
|
|
63
|
-
exclude-result-prefixes="exsl"
|
|
64
|
-
>
|
|
65
|
-
<xsl:template match="ignore">
|
|
66
|
-
<xsl:choose>
|
|
67
|
-
<xsl:when test="//attr">{//attr}</xsl:when>
|
|
68
|
-
<xsl:otherwise>{def}</xsl:otherwise>
|
|
69
|
-
</xsl:choose><xsl:value-of select="."></xsl:value-of></xsl:template>
|
|
70
|
-
<xsl:template mode="payload" match="attributes"></xsl:template>
|
|
71
|
-
<xsl:template match="/">
|
|
72
|
-
<xsl:apply-templates mode="payload" select="/datadom/attributes"/>
|
|
73
|
-
</xsl:template>
|
|
74
|
-
<xsl:template name="slot" >
|
|
75
|
-
<xsl:param name="slotname" />
|
|
76
|
-
<xsl:param name="defaultvalue" />
|
|
77
|
-
<xsl:choose>
|
|
78
|
-
<xsl:when test="//payload/*[@slot=$slotname]">
|
|
79
|
-
<xsl:copy-of select="//payload/*[@slot=$slotname]"/>
|
|
80
|
-
</xsl:when>
|
|
81
|
-
<xsl:otherwise>
|
|
82
|
-
<xsl:copy-of select="$defaultvalue"/>
|
|
83
|
-
</xsl:otherwise>
|
|
84
|
-
</xsl:choose>
|
|
85
|
-
</xsl:template>
|
|
86
|
-
<xsl:variable name="js-injected-body">
|
|
87
|
-
<xsl:call-template name="slot" >
|
|
88
|
-
<xsl:with-param name="slotname" select="''"/>
|
|
89
|
-
<xsl:with-param name="defaultvalue"/>
|
|
90
|
-
</xsl:call-template>
|
|
91
|
-
</xsl:variable>
|
|
92
|
-
</xsl:stylesheet>`);s.importStylesheet(t);const r=s.transformToFragment(n,document),x=(a,c)=>a.querySelector(c),p=x(i,'template[mode="payload"]');if(!r)return console.error("transformation error",{xml:n.outerHTML,xsl:M(t)});if(r.firstElementChild.localName!=="dce-root"){const a=r.ownerDocument.createElement("dce-root");[...r.childNodes].forEach(c=>a.append(c)),r.append(a)}const u=[];[...r.querySelectorAll("dce-root>attribute")].forEach(a=>{le(a,"namespace,name,select");const c=se(a,"xsl:param"),N=f(a,"name");p.append(c),le(c,"select,name");let E=f(c,"select")?.split("??");E||(E=["//"+N,`'${c.textContent}'`],V(c),c.setAttribute("name",N));let b;if(E?.length>1){c.removeAttribute("select");const y=x(i,'template[match="ignore"]>choose').cloneNode(!0);V(y.firstElementChild).append(L(y,"{"+E[0]+"}")),V(y.lastElementChild).append(L(y,"{"+E[1]+"}")),y.firstElementChild.setAttribute("test",E[0]),c.append(y),b=y.cloneNode(!0)}else b=se(a,"xsl:value-of");b.removeAttribute("name"),a.append(b),a.removeAttribute("select"),u.push(c)}),[...r.querySelectorAll("[value]")].filter(a=>a.getAttribute("value").match(/\{(.*)\?\?(.*)\}/g)).forEach(a=>{const c=f(a,"value");c&&a.setAttribute("value",xe(c))});for(const a of r.childNodes)p.append(i.importNode(a,!0));[...p.getElementsByTagName("xsl:template")].forEach(a=>p.ownerDocument.documentElement.append(a));const q=x(i,'call-template[name="slot"]'),d=a=>{const c=q.cloneNode(!0),N=f(a,"name");N&&c.firstElementChild.setAttribute("select",`'${N}'`);for(let E of a.childNodes)c.lastElementChild.append(E);return c};D(p,"slot",a=>a.parentNode.replaceChild(d(a),a));const m=Z(i);return m.params=u,m}async function ce(e){return await new Promise((t,s)=>{const n=new XMLHttpRequest;n.open("GET",e),n.responseType="document",n.onload=()=>{n.readyState===n.DONE&&n.status===200?t(n.responseXML?.body||n.responseXML||T("div",n.responseText)):s(`${n.statusText} - ${e}`)},n.addEventListener("error",i=>s(i)),n.send()})}function me(e,l,t=!1){if(e===l)return!0;if(typeof e!="object"||e===null||typeof l!="object"||l===null||Object.keys(e).length!==Object.keys(l).length)return t;for(let s in e)if(!(s in l)||!me(e[s],l[s]))return t;return!0}const ue=e=>e.split("|").map(l=>l.trim()).filter(l=>l),de=(e,l)=>ue(l).map(t=>{let s=e.ownerDocument,n=i=>(e.append(i),i);if(t.includes("/")){const i=[],r=s.evaluate(t,e);for(let x;x=r.iterateNext();)i.push(x);return i}return[...e.childNodes].find(i=>i.localName===t)||n(T(t,"",s))}).flat();function J(e,l,t,s){if(!t.sliceProcessed)return t.sliceProcessed=1,de(e,l??"").map(n=>{const i=e.ownerDocument,r=t.sliceEventSource,x=t.sliceElement,p=()=>[...n.childNodes].filter(u=>u.nodeType===3||u.localName==="value"||u.localName==="form-data").map(u=>u.remove());if(r.getAttributeNames().map(u=>n.setAttribute(u,f(r,u))),[...n.childNodes].filter(u=>u.localName==="event").map(u=>u.remove()),"validationMessage"in r&&n.setAttribute("validation-message",r.validationMessage),t.type==="init"&&p(),n.append($(t,"event",i)),x.hasAttribute("slice-value")){r.value===void 0?n.removeAttribute("value"):n.setAttribute("value",r.value);const u=z(f(x,"slice-value"),n);p(),n.append(L(i,u))}else{if("elements"in r)return p(),n.append($(new FormData(r),"value",n.ownerDocument)),n;const u=r.value??f(r,"value");p(),u==null?[...n.childNodes].filter(w=>w.localName!=="event").map(w=>w.remove()):Ae(u)?n.append(L(i,u)):n.append($(u,"value",n.ownerDocument))}return n})}function D(e,l,t){e.querySelectorAll&&[...e.querySelectorAll(l)].forEach(t)}const Se=async(e,l)=>{if(!e||!e.trim())return[l];if(e.startsWith("#"))return(t=>{const s=t.querySelectorAll(e);return[...s.length?s:t.getRootNode().querySelectorAll(e)]})(l.parentElement);try{const[t,s]=e.split("#");if(e.charAt(0)===".")e=new URL(t,l.closest("[base]")?.getAttribute("base")||location).href;else try{e=(void 0)(t),s&&(e+="#"+s)}catch(i){console.error(i.message)}const n=await ce(e);if(l.setAttributeNS("xml","base",e),s){const i=n.querySelectorAll("#"+s);return i.length?[...i]:(console.error("template not found",e+"#"+s),[l])}return[n]}catch{return[l]}};function pe(e,l){for(let t of e.attributes)t.namespaceURI?l.setAttributeNS(t.namespaceURI,t.name,t.value):l.setAttribute(t.name,t.value),t.name==="value"&&(l.value=t.value)}function K(e,l=0){const t={};for(const s of e.childNodes){const n=f(s,"data-dce-id")||s.dceId||0;if(!t[n])n?t[n]=1:(t[n]=s.dceId=++l,s.setAttribute&&s.setAttribute("data-dce-id",s.dceId));else{const i=s.dceId=n+"-"+t[n]++;s.setAttribute&&s.setAttribute("data-dce-id",i)}s.childNodes.length&&K(s)}}function fe(e,l,t){t=1*t;for(let s of e.childNodes)if((s.dceId??s.getAttribute("data-dce-id")*1)>t)return e.insertBefore(l,s);e.append(l)}function Q(e,l){if(e.firstElementChild?.localName==="dce-root"&&l[0].localName!=="dce-root")return;if(!l.length)return e.firstElementChild?.localName!=="dce-root"&&ne(e);const t={};for(let s of e.childNodes)t[s.dceId],te(s)?(s.data.trim(),t[s.dceId||0]=s):t[f(s,"data-dce-id")||0]=s;for(let s of[...l]){const n=f(s,"data-dce-id")||s.dceId,i=t[n];i?(te(s)?i.nodeValue!==s.nodeValue&&(i.nodeValue=s.nodeValue):(pe(s,i),(i.childNodes.length||s.childNodes.length)&&Q(i,s.childNodes)),delete t[n]):fe(e,s,n)}for(let s of Object.values(t))s.localName!=="dce-root"&&s.remove()}function he(e,l){return e.hasAttribute(l)||e.setAttribute(l,crypto.randomUUID()),e.getAttribute(l)}const xe=e=>[...e?.matchAll(/([^{}]*)(\{)([^}]+)}([^{}]*)/g)].map(t=>`${t[1]}{${O(t[3])}}${t[4]}`).join(""),O=e=>{if(!e.trim())return e;const l=e.split("??"),t=l.shift(),s=O(l.join("??"));return l.length?`concat( ${t} , substring( ${s} , (1+string-length( ${s} )) * string-length( ${t} ) ) )`:e},z=(e,l)=>{const t=e.split("??");if(t.length>1)return z(t[0],l)||z(t[1],l);e=O(e);const s=l.ownerDocument.evaluate(e,l);switch(s.resultType){case XPathResult.NUMBER_TYPE:return s.numberValue;case XPathResult.STRING_TYPE:return s.stringValue;case XPathResult.BOOLEAN_TYPE:return s.booleanValue}let n="";for(let i;i=s.iterateNext();)n+=i.textContent;return n},be="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(","),ye=(e,l)=>{const t=T("xsl:"+e.localName);for(let s of e.attributes)t.setAttribute(s.name,s.value);for(;e.firstChild;)t.append(e.firstChild);if(e.parentElement)e.parentElement.replaceChild(t,e);else{const s=e.parentElement||l,n=[...s.childNodes];n.forEach((i,r)=>{i===e&&(n[r]=t)}),s.replaceChildren(...n)}};class ge extends HTMLElement{static observedAttributes=["src","tag","hidden"];async connectedCallback(){this.firstElementChild&&this.firstElementChild.localName!=="template"&&console.warn(`custom-element used without template wrapping content
|
|
93
|
-
`,this.outerHTML);const l=await Se(f(this,"src"),this),t=f(this,"tag"),s=t||"dce-"+crypto.randomUUID();for(const d of l)D(d.templateNode||d.content||d,"style",m=>{const a=m.closest("slot"),c=a?`slot[name="${a.name}"]`:"";m.innerHTML=`${s} ${c}{${m.innerHTML}}`,this.append(m)});const n=l.map(d=>re(d)),i=n.map((d,m)=>{m=new XSLTProcessor;try{m.importStylesheet(d)}catch(a){console.error(a,M(d))}return m});Object.defineProperty(this,"xsltString",{get:()=>n.map(d=>M(d)).join(`
|
|
94
|
-
`)});const r=this,x=[...this.templateNode.querySelectorAll("[slice]")],p=x.map(d=>f(d,"slice")).filter(d=>!d.includes("/")).filter((d,m,a)=>a.indexOf(d)===m).map(ue).flat(),u=n.reduce((d,m)=>(m.params&&d.push(...m.params),d),[]);class w extends HTMLElement{static get observedAttributes(){return u.map(m=>f(m,"name"))}#e=0;connectedCallback(){let m=G(this.childNodes);if(this.firstElementChild?.tagName==="TEMPLATE"){this.firstElementChild!==this.lastElementChild&&console.error("payload should have TEMPLATE as only child",this.outerHTML);const h=this.firstElementChild;h.remove(),m=G(h.content.childNodes);for(const g of m)if(g.localName==="style"){const o=he(this,"data-dce-style");g.innerHTML=`${s}[data-dce-style="${o}"]{${g.innerHTML}}`,h.insertAdjacentElement("beforebegin",g)}else g.nodeType===1?h.insertAdjacentElement("beforebegin",g):g.nodeType===3&&h.insertAdjacentText("beforebegin",g.data)}const a=P("<datadom/>").documentElement,c=(h,g="")=>(o=>(g&&o.append(L(a,g)),o))(a.ownerDocument.createElement(h)),N=H(a,"payload",m,we);ae(N),ie(N),this.innerHTML="";const E=H(a,"attributes",this.attributes,h=>c(h.nodeName,h.value));H(a,"dataset",Object.keys(this.dataset),h=>c(h,this.dataset[h]));const b=H(a,"slice",p,h=>c(h,"")),y=h=>z(h,b);this.xml=a;const j=[],ee=()=>{const h={};for(let g;g=j.pop();){const o=f(g.sliceElement,"slice");h[o]||(J(b,o,g),h[o]=g)}Object.keys(h).length!==0&&U()};let _;this.onSlice=h=>{j.push(h),_||(_=setTimeout(()=>{ee(),_=0},1))};const U=this.transform=()=>{if(this.#e)debugger;this.#e=1,i.map((o,v)=>{const S=o.transformToFragment(a.ownerDocument,document);return S||console.error(`XSLT transformation error. xsl:
|
|
95
|
-
`,M(n[v]),`
|
|
96
|
-
xml:
|
|
97
|
-
`,M(a)),S}).map(o=>{o&&(K(o),Q(this,o.childNodes))}),w.observedAttributes.map(o=>{let v=f(this.firstElementChild,o);v!==f(this,o)&&(this.setAttribute(o,v),this.#t(o,v))});function g(o){let v=o;if(o.localName==="slice"){const S=f(o,"for");if(S||(v=o.parentElement),S==="^")do v=v.previousElementSibling;while(v.localName==="slice");else v=this.querySelector(S);if(!v)return console.warn(`can not find selector in "slice for=${S}" `,o.outerHTML);f(o,"slice")||o.setAttribute("slice",f(o,"name"))}return v}D(this,"[slice],[slice-event]",o=>{let v=f(o,"slice-event");const S=o.hasAttribute("slice-value")||o.hasAttribute("value")||o.value,I=g(o);o.dceInitialized||(o.dceInitialized=1,I.hasAttribute("custom-validity")&&(v+=" change submit"),[...new Set((v||"change").split(" "))].forEach(ve=>I.addEventListener(ve,A=>{A.sliceElement=o,A.sliceEventSource=A.currentTarget||A.target,A.sliceProcessed=0;const Ee=J(b,f(A.sliceElement,"slice"),A);D(this,"[custom-validity]",X=>{if(!X.setCustomValidity)return;const W=f(X,"custom-validity");try{const R=W&&z(W,E);X.setCustomValidity(R===!0?"":R===!1?"invalid":R)}catch(R){console.error(R,"xPath",W)}});const B=f(I,"custom-validity"),C=B&&z(B,E),F=C===!0?"":C;if(B){if(o.setCustomValidity?o.setCustomValidity(F):o.validationMessage=F,Ee.map(X=>X.setAttribute("validation-message",F)),A.type==="submit")return C===!0?void 0:(setTimeout(U,1),!!C===C?(C||A.preventDefault(),C):C?(A.preventDefault(),!1):void 0);setTimeout(U,1)}this.onSlice(A)})),(!v||v.includes("init"))&&(S?this.onSlice({type:"init",target:I,sliceElement:o,sliceEventSource:I}):o.value=y(f(o,"slice"))))}),this.#e=0};U(),ee()}#t(m,a){m==="value"&&(this.value=a);let c=this.xml.querySelector(`attributes>${m}`);c?V(c).append(L(c,a)):(c=T(m,a,this.xml),this.xml.querySelector("attributes").append(c)),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{[m]:a}}))}attributeChangedCallback(m,a,c){!this.xml||this.#e||(this.#t(m,c),this.transform())}get dce(){return r}}const q=d=>{window.customElements.get(d)!==w&&window.customElements.define(d,w)};if(t)q(t);else{const d=s;this.setAttribute("tag",d),q(d);const m=document.createElement(d);this.getAttributeNames().forEach(a=>m.setAttribute(a,this.getAttribute(a))),m.append(...[...this.childNodes].filter(a=>a.localName!=="style")),this.append(m)}}get templateNode(){return this.firstElementChild?.tagName==="TEMPLATE"?this.firstElementChild.content:this}get dce(){return this}get xslt(){return P(this.xsltString)}}window.customElements.define("custom-element",ge);exports.CustomElement=ge;exports.appendByDceId=fe;exports.assureSlices=de;exports.assureUID=he;exports.assureUnique=K;exports.createXsltFromDom=re;exports.deepEqual=me;exports.evalCurly=xe;exports.event2slice=J;exports.merge=Q;exports.mergeAttr=pe;exports.obj2node=$;exports.sanitizeBlankText=G;exports.tagUid=Z;exports.toXsl=ye;exports.xPath=z;exports.xPathDefaults=O;exports.xhrTemplate=ce;exports.xml2dom=P;exports.xmlString=M;exports.xslTags=be;
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{al as Me,am as ie,an as Ce,ae as h,ag as b,ao as C,a2 as ue,a0 as $e,x as Ie,ap as Oe,aq as Ne}from"./index-CaL3Qp7t.js";import{g as fe}from"./index-BdcJ-iJ7.js";import"./iframe-DOi4N7qI.js";import"../sb-preview/runtime.js";import"./index-D-8MO0q_.js";import"./index-DrFu-skq.js";var Se={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]};const H=Se,he={};for(const e of Object.keys(H))he[H[e]]=e;const u={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"]}};var de=u;for(const e of Object.keys(u)){if(!("channels"in u[e]))throw new Error("missing channels property: "+e);if(!("labels"in u[e]))throw new Error("missing channel labels property: "+e);if(u[e].labels.length!==u[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:n}=u[e];delete u[e].channels,delete u[e].labels,Object.defineProperty(u[e],"channels",{value:t}),Object.defineProperty(u[e],"labels",{value:n})}u.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.min(t,n,r),a=Math.max(t,n,r),l=a-o;let s,c;a===o?s=0:t===a?s=(n-r)/l:n===a?s=2+(r-t)/l:r===a&&(s=4+(t-n)/l),s=Math.min(s*60,360),s<0&&(s+=360);const i=(o+a)/2;return a===o?c=0:i<=.5?c=l/(a+o):c=l/(2-a-o),[s,c*100,i*100]};u.rgb.hsv=function(e){let t,n,r,o,a;const l=e[0]/255,s=e[1]/255,c=e[2]/255,i=Math.max(l,s,c),d=i-Math.min(l,s,c),f=function(g){return(i-g)/6/d+1/2};return d===0?(o=0,a=0):(a=d/i,t=f(l),n=f(s),r=f(c),l===i?o=r-n:s===i?o=1/3+t-r:c===i&&(o=2/3+n-t),o<0?o+=1:o>1&&(o-=1)),[o*360,a*100,i*100]};u.rgb.hwb=function(e){const t=e[0],n=e[1];let r=e[2];const o=u.rgb.hsl(e)[0],a=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[o,a*100,r*100]};u.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.min(1-t,1-n,1-r),a=(1-t-o)/(1-o)||0,l=(1-n-o)/(1-o)||0,s=(1-r-o)/(1-o)||0;return[a*100,l*100,s*100,o*100]};function Re(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}u.rgb.keyword=function(e){const t=he[e];if(t)return t;let n=1/0,r;for(const o of Object.keys(H)){const a=H[o],l=Re(e,a);l<n&&(n=l,r=o)}return r};u.keyword.rgb=function(e){return H[e]};u.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;const o=t*.4124+n*.3576+r*.1805,a=t*.2126+n*.7152+r*.0722,l=t*.0193+n*.1192+r*.9505;return[o*100,a*100,l*100]};u.rgb.lab=function(e){const t=u.rgb.xyz(e);let n=t[0],r=t[1],o=t[2];n/=95.047,r/=100,o/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,o=o>.008856?o**(1/3):7.787*o+16/116;const a=116*r-16,l=500*(n-r),s=200*(r-o);return[a,l,s]};u.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let o,a,l;if(n===0)return l=r*255,[l,l,l];r<.5?o=r*(1+n):o=r+n-r*n;const s=2*r-o,c=[0,0,0];for(let i=0;i<3;i++)a=t+1/3*-(i-1),a<0&&a++,a>1&&a--,6*a<1?l=s+(o-s)*6*a:2*a<1?l=o:3*a<2?l=s+(o-s)*(2/3-a)*6:l=s,c[i]=l*255;return c};u.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,o=n;const a=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,o*=a<=1?a:2-a;const l=(r+n)/2,s=r===0?2*o/(a+o):2*n/(r+n);return[t,s*100,l*100]};u.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const o=Math.floor(t)%6,a=t-Math.floor(t),l=255*r*(1-n),s=255*r*(1-n*a),c=255*r*(1-n*(1-a));switch(r*=255,o){case 0:return[r,c,l];case 1:return[s,r,l];case 2:return[l,r,c];case 3:return[l,s,r];case 4:return[c,l,r];case 5:return[r,l,s]}};u.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,o=Math.max(r,.01);let a,l;l=(2-n)*r;const s=(2-n)*o;return a=n*o,a/=s<=1?s:2-s,a=a||0,l/=2,[t,a*100,l*100]};u.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const o=n+r;let a;o>1&&(n/=o,r/=o);const l=Math.floor(6*t),s=1-r;a=6*t-l,l&1&&(a=1-a);const c=n+a*(s-n);let i,d,f;switch(l){default:case 6:case 0:i=s,d=c,f=n;break;case 1:i=c,d=s,f=n;break;case 2:i=n,d=s,f=c;break;case 3:i=n,d=c,f=s;break;case 4:i=c,d=n,f=s;break;case 5:i=s,d=n,f=c;break}return[i*255,d*255,f*255]};u.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,o=e[3]/100,a=1-Math.min(1,t*(1-o)+o),l=1-Math.min(1,n*(1-o)+o),s=1-Math.min(1,r*(1-o)+o);return[a*255,l*255,s*255]};u.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let o,a,l;return o=t*3.2406+n*-1.5372+r*-.4986,a=t*-.9689+n*1.8758+r*.0415,l=t*.0557+n*-.204+r*1.057,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,l=l>.0031308?1.055*l**(1/2.4)-.055:l*12.92,o=Math.min(Math.max(0,o),1),a=Math.min(Math.max(0,a),1),l=Math.min(Math.max(0,l),1),[o*255,a*255,l*255]};u.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;const o=116*n-16,a=500*(t-n),l=200*(n-r);return[o,a,l]};u.lab.xyz=function(e){const t=e[0],n=e[1],r=e[2];let o,a,l;a=(t+16)/116,o=n/500+a,l=a-r/200;const s=a**3,c=o**3,i=l**3;return a=s>.008856?s:(a-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,l=i>.008856?i:(l-16/116)/7.787,o*=95.047,a*=100,l*=108.883,[o,a,l]};u.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let o;o=Math.atan2(r,n)*360/2/Math.PI,o<0&&(o+=360);const l=Math.sqrt(n*n+r*r);return[t,l,o]};u.lch.lab=function(e){const t=e[0],n=e[1],o=e[2]/360*2*Math.PI,a=n*Math.cos(o),l=n*Math.sin(o);return[t,a,l]};u.rgb.ansi16=function(e,t=null){const[n,r,o]=e;let a=t===null?u.rgb.hsv(e)[2]:t;if(a=Math.round(a/50),a===0)return 30;let l=30+(Math.round(o/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return a===2&&(l+=60),l};u.hsv.ansi16=function(e){return u.rgb.ansi16(u.hsv.rgb(e),e[2])};u.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)};u.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];const n=(~~(e>50)+1)*.5,r=(t&1)*n*255,o=(t>>1&1)*n*255,a=(t>>2&1)*n*255;return[r,o,a]};u.ansi256.rgb=function(e){if(e>=232){const a=(e-232)*10+8;return[a,a,a]}e-=16;let t;const n=Math.floor(e/36)/5*255,r=Math.floor((t=e%36)/6)/5*255,o=t%6/5*255;return[n,r,o]};u.rgb.hex=function(e){const n=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(n.length)+n};u.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=n.split("").map(s=>s+s).join(""));const r=parseInt(n,16),o=r>>16&255,a=r>>8&255,l=r&255;return[o,a,l]};u.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.max(Math.max(t,n),r),a=Math.min(Math.min(t,n),r),l=o-a;let s,c;return l<1?s=a/(1-l):s=0,l<=0?c=0:o===t?c=(n-r)/l%6:o===n?c=2+(r-t)/l:c=4+(t-n)/l,c/=6,c%=1,[c*360,l*100,s*100]};u.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let o=0;return r<1&&(o=(n-.5*r)/(1-r)),[e[0],r*100,o*100]};u.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=t*n;let o=0;return r<1&&(o=(n-r)/(1-r)),[e[0],r*100,o*100]};u.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[r*255,r*255,r*255];const o=[0,0,0],a=t%1*6,l=a%1,s=1-l;let c=0;switch(Math.floor(a)){case 0:o[0]=1,o[1]=l,o[2]=0;break;case 1:o[0]=s,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=l;break;case 3:o[0]=0,o[1]=s,o[2]=1;break;case 4:o[0]=l,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=s}return c=(1-n)*r,[(n*o[0]+c)*255,(n*o[1]+c)*255,(n*o[2]+c)*255]};u.hcg.hsv=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);let o=0;return r>0&&(o=t/r),[e[0],o*100,r*100]};u.hcg.hsl=function(e){const t=e[1]/100,r=e[2]/100*(1-t)+.5*t;let o=0;return r>0&&r<.5?o=t/(2*r):r>=.5&&r<1&&(o=t/(2*(1-r))),[e[0],o*100,r*100]};u.hcg.hwb=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);return[e[0],(r-t)*100,(1-r)*100]};u.hwb.hcg=function(e){const t=e[1]/100,r=1-e[2]/100,o=r-t;let a=0;return o<1&&(a=(r-o)/(1-o)),[e[0],o*100,a*100]};u.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};u.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};u.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};u.gray.hsl=function(e){return[0,0,e[0]]};u.gray.hsv=u.gray.hsl;u.gray.hwb=function(e){return[0,100,e[0]]};u.gray.cmyk=function(e){return[0,0,0,e[0]]};u.gray.lab=function(e){return[e[0],0,0]};u.gray.hex=function(e){const t=Math.round(e[0]/100*255)&255,r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r};u.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};const X=de;function je(){const e={},t=Object.keys(X);for(let n=t.length,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}function Te(e){const t=je(),n=[e];for(t[e].distance=0;n.length;){const r=n.pop(),o=Object.keys(X[r]);for(let a=o.length,l=0;l<a;l++){const s=o[l],c=t[s];c.distance===-1&&(c.distance=t[r].distance+1,c.parent=r,n.unshift(s))}}return t}function ze(e,t){return function(n){return t(e(n))}}function He(e,t){const n=[t[e].parent,e];let r=X[t[e].parent][e],o=t[e].parent;for(;t[o].parent;)n.unshift(t[o].parent),r=ze(X[t[o].parent][o],r),o=t[o].parent;return r.conversion=n,r}var Fe=function(e){const t=Te(e),n={},r=Object.keys(t);for(let o=r.length,a=0;a<o;a++){const l=r[a];t[l].parent!==null&&(n[l]=He(l,t))}return n};const K=de,Pe=Fe,I={},Le=Object.keys(K);function qe(e){const t=function(...n){const r=n[0];return r==null?r:(r.length>1&&(n=r),e(n))};return"conversion"in e&&(t.conversion=e.conversion),t}function Be(e){const t=function(...n){const r=n[0];if(r==null)return r;r.length>1&&(n=r);const o=e(n);if(typeof o=="object")for(let a=o.length,l=0;l<a;l++)o[l]=Math.round(o[l]);return o};return"conversion"in e&&(t.conversion=e.conversion),t}Le.forEach(e=>{I[e]={},Object.defineProperty(I[e],"channels",{value:K[e].channels}),Object.defineProperty(I[e],"labels",{value:K[e].labels});const t=Pe(e);Object.keys(t).forEach(r=>{const o=t[r];I[e][r]=Be(o),I[e][r].raw=qe(o)})});var Xe=I;const _=fe(Xe);var De=Me,We=function(){return De.Date.now()},Ke=We,Ve=/\s/;function Ae(e){for(var t=e.length;t--&&Ve.test(e.charAt(t)););return t}var Ge=Ae,Ue=Ge,Ye=/^\s+/;function Je(e){return e&&e.slice(0,Ue(e)+1).replace(Ye,"")}var Qe=Je,Ze=Qe,te=ie,et=Ce,ne=NaN,tt=/^[-+]0x[0-9a-f]+$/i,nt=/^0b[01]+$/i,rt=/^0o[0-7]+$/i,ot=parseInt;function at(e){if(typeof e=="number")return e;if(et(e))return ne;if(te(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=te(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Ze(e);var n=nt.test(e);return n||rt.test(e)?ot(e.slice(2),n?2:8):tt.test(e)?ne:+e}var lt=at,st=ie,W=Ke,re=lt,ct="Expected a function",it=Math.max,ut=Math.min;function ft(e,t,n){var r,o,a,l,s,c,i=0,d=!1,f=!1,g=!0;if(typeof e!="function")throw new TypeError(ct);t=re(t)||0,st(n)&&(d=!!n.leading,f="maxWait"in n,a=f?it(re(n.maxWait)||0,t):a,g="trailing"in n?!!n.trailing:g);function w(v){var M=r,T=o;return r=o=void 0,i=v,l=e.apply(T,M),l}function S(v){return i=v,s=setTimeout(m,t),d?w(v):l}function E(v){var M=v-c,T=v-i,ee=t-M;return f?ut(ee,a-T):ee}function p(v){var M=v-c,T=v-i;return c===void 0||M>=t||M<0||f&&T>=a}function m(){var v=W();if(p(v))return k(v);s=setTimeout(m,E(v))}function k(v){return s=void 0,g&&r?w(v):(r=o=void 0,l)}function y(){s!==void 0&&clearTimeout(s),i=0,r=c=o=s=void 0}function R(){return s===void 0?l:k(W())}function j(){var v=W(),M=p(v);if(r=arguments,o=this,c=v,M){if(s===void 0)return S(c);if(f)return clearTimeout(s),s=setTimeout(m,t),w(c)}return s===void 0&&(s=setTimeout(m,t)),l}return j.cancel=y,j.flush=R,j}var ht=ft;const dt=fe(ht);function $(){return($=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function J(e,t){if(e==null)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(o[n]=e[n]);return o}function V(e){var t=b.useRef(e),n=b.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var N=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},z=function(e){return"touches"in e},A=function(e){return e&&e.ownerDocument.defaultView||self},oe=function(e,t,n){var r=e.getBoundingClientRect(),o=z(t)?function(a,l){for(var s=0;s<a.length;s++)if(a[s].identifier===l)return a[s];return a[0]}(t.touches,n):t;return{left:N((o.pageX-(r.left+A(e).pageXOffset))/r.width),top:N((o.pageY-(r.top+A(e).pageYOffset))/r.height)}},ae=function(e){!z(e)&&e.preventDefault()},Q=h.memo(function(e){var t=e.onMove,n=e.onKey,r=J(e,["onMove","onKey"]),o=b.useRef(null),a=V(t),l=V(n),s=b.useRef(null),c=b.useRef(!1),i=b.useMemo(function(){var w=function(p){ae(p),(z(p)?p.touches.length>0:p.buttons>0)&&o.current?a(oe(o.current,p,s.current)):E(!1)},S=function(){return E(!1)};function E(p){var m=c.current,k=A(o.current),y=p?k.addEventListener:k.removeEventListener;y(m?"touchmove":"mousemove",w),y(m?"touchend":"mouseup",S)}return[function(p){var m=p.nativeEvent,k=o.current;if(k&&(ae(m),!function(R,j){return j&&!z(R)}(m,c.current)&&k)){if(z(m)){c.current=!0;var y=m.changedTouches||[];y.length&&(s.current=y[0].identifier)}k.focus(),a(oe(k,m,s.current)),E(!0)}},function(p){var m=p.which||p.keyCode;m<37||m>40||(p.preventDefault(),l({left:m===39?.05:m===37?-.05:0,top:m===40?.05:m===38?-.05:0}))},E]},[l,a]),d=i[0],f=i[1],g=i[2];return b.useEffect(function(){return g},[g]),h.createElement("div",$({},r,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:o,onKeyDown:f,tabIndex:0,role:"slider"}))}),F=function(e){return e.filter(Boolean).join(" ")},Z=function(e){var t=e.color,n=e.left,r=e.top,o=r===void 0?.5:r,a=F(["react-colorful__pointer",e.className]);return h.createElement("div",{className:a,style:{top:100*o+"%",left:100*n+"%"}},h.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},x=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},gt={grad:.9,turn:360,rad:360/(2*Math.PI)},bt=function(e){return me(G(e))},G=function(e){return e[0]==="#"&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?x(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?x(parseInt(e.substring(6,8),16)/255,2):1}},mt=function(e,t){return t===void 0&&(t="deg"),Number(e)*(gt[t]||1)},vt=function(e){var t=/hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?pt({h:mt(t[1],t[2]),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)}):{h:0,s:0,v:0,a:1}},pt=function(e){var t=e.s,n=e.l;return{h:e.h,s:(t*=(n<50?n:100-n)/100)>0?2*t/(n+t)*100:0,v:n+t,a:e.a}},yt=function(e){return wt(be(e))},ge=function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:x(e.h),s:x(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:x(o/2),a:x(r,2)}},U=function(e){var t=ge(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},B=function(e){var t=ge(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},be=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var a=Math.floor(t),l=r*(1-n),s=r*(1-(t-a)*n),c=r*(1-(1-t+a)*n),i=a%6;return{r:x(255*[r,s,l,l,c,r][i]),g:x(255*[c,r,r,s,l,l][i]),b:x(255*[l,l,c,r,r,s][i]),a:x(o,2)}},xt=function(e){var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?me({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):{h:0,s:0,v:0,a:1}},P=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},wt=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,a=o<1?P(x(255*o)):"";return"#"+P(t)+P(n)+P(r)+a},me=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,a=Math.max(t,n,r),l=a-Math.min(t,n,r),s=l?a===t?(n-r)/l:a===n?2+(r-t)/l:4+(t-n)/l:0;return{h:x(60*(s<0?s+6:s)),s:x(a?l/a*100:0),v:x(a/255*100),a:o}},ve=h.memo(function(e){var t=e.hue,n=e.onChange,r=F(["react-colorful__hue",e.className]);return h.createElement("div",{className:r},h.createElement(Q,{onMove:function(o){n({h:360*o.left})},onKey:function(o){n({h:N(t+360*o.left,0,360)})},"aria-label":"Hue","aria-valuenow":x(t),"aria-valuemax":"360","aria-valuemin":"0"},h.createElement(Z,{className:"react-colorful__hue-pointer",left:t/360,color:U({h:t,s:100,v:100,a:1})})))}),pe=h.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:U({h:t.h,s:100,v:100,a:1})};return h.createElement("div",{className:"react-colorful__saturation",style:r},h.createElement(Q,{onMove:function(o){n({s:100*o.left,v:100-100*o.top})},onKey:function(o){n({s:N(t.s+100*o.left,0,100),v:N(t.v-100*o.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+x(t.s)+"%, Brightness "+x(t.v)+"%"},h.createElement(Z,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:U(t)})))}),ye=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},xe=function(e,t){return e.replace(/\s/g,"")===t.replace(/\s/g,"")},kt=function(e,t){return e.toLowerCase()===t.toLowerCase()||ye(G(e),G(t))};function we(e,t,n){var r=V(n),o=b.useState(function(){return e.toHsva(t)}),a=o[0],l=o[1],s=b.useRef({color:t,hsva:a});b.useEffect(function(){if(!e.equal(t,s.current.color)){var i=e.toHsva(t);s.current={hsva:i,color:t},l(i)}},[t,e]),b.useEffect(function(){var i;ye(a,s.current.hsva)||e.equal(i=e.fromHsva(a),s.current.color)||(s.current={hsva:a,color:i},r(i))},[a,e,r]);var c=b.useCallback(function(i){l(function(d){return Object.assign({},d,i)})},[]);return[a,c]}var _t=typeof window<"u"?b.useLayoutEffect:b.useEffect,Et=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},le=new Map,ke=function(e){_t(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!le.has(t)){var n=t.createElement("style");n.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}`,le.set(t,n);var r=Et();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},Mt=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,a=e.onChange,l=J(e,["className","colorModel","color","onChange"]),s=b.useRef(null);ke(s);var c=we(n,o,a),i=c[0],d=c[1],f=F(["react-colorful",t]);return h.createElement("div",$({},l,{ref:s,className:f}),h.createElement(pe,{hsva:i,onChange:d}),h.createElement(ve,{hue:i.h,onChange:d,className:"react-colorful__last-control"}))},Ct={defaultColor:"000",toHsva:bt,fromHsva:function(e){return yt({h:e.h,s:e.s,v:e.v,a:1})},equal:kt},$t=function(e){return h.createElement(Mt,$({},e,{colorModel:Ct}))},It=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+B(Object.assign({},n,{a:0}))+", "+B(Object.assign({},n,{a:1}))+")"},a=F(["react-colorful__alpha",t]),l=x(100*n.a);return h.createElement("div",{className:a},h.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),h.createElement(Q,{onMove:function(s){r({a:s.left})},onKey:function(s){r({a:N(n.a+s.left)})},"aria-label":"Alpha","aria-valuetext":l+"%","aria-valuenow":l,"aria-valuemin":"0","aria-valuemax":"100"},h.createElement(Z,{className:"react-colorful__alpha-pointer",left:n.a,color:B(n)})))},_e=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,a=e.onChange,l=J(e,["className","colorModel","color","onChange"]),s=b.useRef(null);ke(s);var c=we(n,o,a),i=c[0],d=c[1],f=F(["react-colorful",t]);return h.createElement("div",$({},l,{ref:s,className:f}),h.createElement(pe,{hsva:i,onChange:d}),h.createElement(ve,{hue:i.h,onChange:d}),h.createElement(It,{hsva:i,onChange:d,className:"react-colorful__last-control"}))},Ot={defaultColor:"hsla(0, 0%, 0%, 1)",toHsva:vt,fromHsva:B,equal:xe},Nt=function(e){return h.createElement(_e,$({},e,{colorModel:Ot}))},St={defaultColor:"rgba(0, 0, 0, 1)",toHsva:xt,fromHsva:function(e){var t=be(e);return"rgba("+t.r+", "+t.g+", "+t.b+", "+t.a+")"},equal:xe},Rt=function(e){return h.createElement(_e,$({},e,{colorModel:St}))},jt=C.div({position:"relative",maxWidth:250,'&[aria-readonly="true"]':{opacity:.5}}),Tt=C(ue)({position:"absolute",zIndex:1,top:4,left:4,"[aria-readonly=true] &":{cursor:"not-allowed"}}),zt=C.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"}}),Ht=C($e)(({theme:e})=>({fontFamily:e.typography.fonts.base})),Ft=C.div({display:"grid",gridTemplateColumns:"repeat(9, 16px)",gap:6,padding:3,marginTop:5,width:200}),Pt=C.div(({theme:e,active:t})=>({width:16,height:16,boxShadow:t?`${e.appBorderColor} 0 0 0 1px inset, ${e.textMutedColor}50 0 0 0 4px`:`${e.appBorderColor} 0 0 0 1px inset`,borderRadius:e.appBorderRadius})),Lt=`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>')`,se=({value:e,style:t,...n})=>{let r=`linear-gradient(${e}, ${e}), ${Lt}, linear-gradient(#fff, #fff)`;return h.createElement(Pt,{...n,style:{...t,backgroundImage:r}})},qt=C(Ie.Input)(({theme:e,readOnly:t})=>({width:"100%",paddingLeft:30,paddingRight:30,boxSizing:"border-box",fontFamily:e.typography.fonts.base})),Bt=C(Oe)(({theme:e})=>({position:"absolute",zIndex:1,top:6,right:7,width:20,height:20,padding:4,boxSizing:"border-box",cursor:"pointer",color:e.input.color})),Ee=(e=>(e.RGB="rgb",e.HSL="hsl",e.HEX="hex",e))(Ee||{}),L=Object.values(Ee),Xt=/\(([0-9]+),\s*([0-9]+)%?,\s*([0-9]+)%?,?\s*([0-9.]+)?\)/,Dt=/^\s*rgba?\(([0-9]+),\s*([0-9]+),\s*([0-9]+),?\s*([0-9.]+)?\)\s*$/i,Wt=/^\s*hsla?\(([0-9]+),\s*([0-9]+)%,\s*([0-9]+)%,?\s*([0-9.]+)?\)\s*$/i,Y=/^\s*#?([0-9a-f]{3}|[0-9a-f]{6})\s*$/i,Kt=/^\s*#?([0-9a-f]{3})\s*$/i,Vt={hex:$t,rgb:Rt,hsl:Nt},q={hex:"transparent",rgb:"rgba(0, 0, 0, 0)",hsl:"hsla(0, 0%, 0%, 0)"},ce=e=>{let t=e?.match(Xt);if(!t)return[0,0,0,1];let[,n,r,o,a=1]=t;return[n,r,o,a].map(Number)},O=e=>{if(!e)return;let t=!0;if(Dt.test(e)){let[l,s,c,i]=ce(e),[d,f,g]=_.rgb.hsl([l,s,c])||[0,0,0];return{valid:t,value:e,keyword:_.rgb.keyword([l,s,c]),colorSpace:"rgb",rgb:e,hsl:`hsla(${d}, ${f}%, ${g}%, ${i})`,hex:`#${_.rgb.hex([l,s,c]).toLowerCase()}`}}if(Wt.test(e)){let[l,s,c,i]=ce(e),[d,f,g]=_.hsl.rgb([l,s,c])||[0,0,0];return{valid:t,value:e,keyword:_.hsl.keyword([l,s,c]),colorSpace:"hsl",rgb:`rgba(${d}, ${f}, ${g}, ${i})`,hsl:e,hex:`#${_.hsl.hex([l,s,c]).toLowerCase()}`}}let n=e.replace("#",""),r=_.keyword.rgb(n)||_.hex.rgb(n),o=_.rgb.hsl(r),a=e;if(/[^#a-f0-9]/i.test(e)?a=n:Y.test(e)&&(a=`#${n}`),a.startsWith("#"))t=Y.test(a);else try{_.keyword.hex(a)}catch{t=!1}return{valid:t,value:a,keyword:_.rgb.keyword(r),colorSpace:"hex",rgb:`rgba(${r[0]}, ${r[1]}, ${r[2]}, 1)`,hsl:`hsla(${o[0]}, ${o[1]}%, ${o[2]}%, 1)`,hex:a}},At=(e,t,n)=>{if(!e||!t?.valid)return q[n];if(n!=="hex")return t?.[n]||q[n];if(!t.hex.startsWith("#"))try{return`#${_.keyword.hex(t.hex)}`}catch{return q.hex}let r=t.hex.match(Kt);if(!r)return Y.test(t.hex)?t.hex:q.hex;let[o,a,l]=r[1].split("");return`#${o}${o}${a}${a}${l}${l}`},Gt=(e,t)=>{let[n,r]=b.useState(e||""),[o,a]=b.useState(()=>O(n)),[l,s]=b.useState(o?.colorSpace||"hex");b.useEffect(()=>{let f=e||"",g=O(f);r(f),a(g),s(g?.colorSpace||"hex")},[e]);let c=b.useMemo(()=>At(n,o,l).toLowerCase(),[n,o,l]),i=b.useCallback(f=>{let g=O(f),w=g?.value||f||"";r(w),w===""&&(a(void 0),t(void 0)),g&&(a(g),s(g.colorSpace),t(g.value))},[t]),d=b.useCallback(()=>{let f=L.indexOf(l)+1;f>=L.length&&(f=0),s(L[f]);let g=o?.[L[f]]||"";r(g),t(g)},[o,l,t]);return{value:n,realValue:c,updateValue:i,color:o,colorSpace:l,cycleColorSpace:d}},D=e=>e.replace(/\s*/,"").toLowerCase(),Ut=(e,t,n)=>{let[r,o]=b.useState(t?.valid?[t]:[]);b.useEffect(()=>{t===void 0&&o([])},[t]);let a=b.useMemo(()=>(e||[]).map(s=>typeof s=="string"?O(s):s.title?{...O(s.color),keyword:s.title}:O(s.color)).concat(r).filter(Boolean).slice(-27),[e,r]),l=b.useCallback(s=>{s?.valid&&(a.some(c=>D(c[n])===D(s[n]))||o(c=>c.concat(s)))},[n,a]);return{presets:a,addPreset:l}},Yt=({name:e,value:t,onChange:n,onFocus:r,onBlur:o,presetColors:a,startOpen:l=!1,argType:s})=>{let c=b.useCallback(dt(n,200),[n]),{value:i,realValue:d,updateValue:f,color:g,colorSpace:w,cycleColorSpace:S}=Gt(t,c),{presets:E,addPreset:p}=Ut(a,g,w),m=Vt[w],k=!!s?.table?.readonly;return h.createElement(jt,{"aria-readonly":k},h.createElement(Tt,{startOpen:l,trigger:k?[null]:void 0,closeOnOutsideClick:!0,onVisibleChange:()=>p(g),tooltip:h.createElement(zt,null,h.createElement(m,{color:d==="transparent"?"#000000":d,onChange:f,onFocus:r,onBlur:o}),E.length>0&&h.createElement(Ft,null,E.map((y,R)=>h.createElement(ue,{key:`${y.value}-${R}`,hasChrome:!1,tooltip:h.createElement(Ht,{note:y.keyword||y.value})},h.createElement(se,{value:y[w],active:g&&D(y[w])===D(g[w]),onClick:()=>f(y.value)})))))},h.createElement(se,{value:d,style:{margin:4}})),h.createElement(qt,{id:Ne(e),value:i,onChange:y=>f(y.target.value),onFocus:y=>y.target.select(),readOnly:k,placeholder:"Choose color..."}),i?h.createElement(Bt,{onClick:S}):null)},rn=Yt;export{Yt as ColorControl,rn as default};
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
const W="http://www.w3.org/1999/XSL/Transform",V="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",$=(e,l)=>(e.ownerDocument||e).createTextNode(l),se=e=>{for(;e.firstChild;)e.firstChild.remove();return e},_=e=>(e.getAttributeNames().map(l=>e.removeAttribute(l)),se(e)),le=e=>(e?.setAttribute("xmlns:xsl",W),e),ne=e=>(e?.setAttribute("xmlns:xhtml",V),le(e)),ae=e=>/^[_a-zA-Z][-_:a-zA-Z0-9]*$/.test(e),w=(e,l="",t=document)=>{const s=i=>(r=>(l&&r.append($(t.ownerDocument||t,l)),r))((t.ownerDocument||t).createElement(i));if(ae(e))return s(e);const n=s("dce-object");return n.setAttribute("dce-object-name",e),n},J=(e,l)=>{const t=e.ownerDocument.createElementNS(e.namespaceURI,l);for(let s of e.attributes)t.setAttribute(s.name,s.value);for(;e.firstChild;)t.append(e.firstChild);return t};function j(e){return new DOMParser().parseFromString(e,"application/xml")}function X(e){return new XMLSerializer().serializeToString(e)}function H(e,l,t,s){const n=x=>e.ownerDocument.createElement(x),r=((x,p,u)=>(p.append(u=n(x)),u))(l,e);return[...t].forEach(x=>r.append(s(x))),r}function fe(e){return e.slot||(e.setAttribute||(e=w("span",e.textContent.replaceAll(`
|
|
2
|
-
`,""))),e.setAttribute("slot","")),e}function K(e,l){e.getAttributeNames().forEach(t=>l.includes(t)||e.removeAttribute(t))}const Q=e=>[...e].filter(l=>!(l.nodeType===3&&l.data.trim()===""));function D(e,l,t){const s=typeof e;if(s==="string")return w(l,e,t);if(s==="number")return w(l,""+e,t);if(e instanceof Array){const i=w("array","",t);return e.map(r=>i.append(D(r,l,t))),i}if(e instanceof FormData){const i=w("form-data","",t);for(const r of e)i.append(D(r[1],r[0],t));return i}const n=w(l,"",t);for(let i in e)pe(e[i])||typeof e[i]=="function"||e[i]instanceof Window||(typeof e[i]!="object"&&ae(i)?n.setAttribute(i,e[i]):n.append(D(e[i],i,t)));return n}function ee(e){if(L(e,"*",l=>[...l.childNodes].filter(t=>t.nodeType===3&&t.parentNode.localName!=="style"&&t.data).forEach(t=>{const s=t.data,n=s.matchAll(/{([^}]*)}/g);if(n){let i=0,r=p=>$(t,p),x=[];if([...n].forEach(p=>{p.index>i&&x.push(r(p.input.substring(i,p.index)));const u=e.querySelector("value-of").cloneNode();u.setAttribute("select",p[1]),x.push(u),i=p.index+p[0].length}),i<s.length&&x.push(r(s.substring(i,s.length))),x.length){for(let p of x)l.insertBefore(p,t);l.removeChild(t)}}})),"all"in e){let l=1;for(let t of e.all)t.setAttribute&&!t.tagName.startsWith("xsl:")&&t.setAttribute("data-dce-id",""+l++)}return e}function he(e,l="xsl:stylesheet"){if(e.tagName===l||e.documentElement?.tagName===l)return ee(e);const t=j(`<xsl:stylesheet version="1.0" xmlns:xsl="${W}" xmlns:xhtml="${V}" xmlns:exsl="${ue}" exclude-result-prefixes="exsl" >
|
|
3
|
-
<xsl:output method="xml"/>
|
|
4
|
-
<xsl:template match="/"><dce-root xmlns="${V}"><xsl:apply-templates select="*" /></dce-root></xsl:template>
|
|
5
|
-
<xsl:template match="*[name()='template']">
|
|
6
|
-
<xsl:apply-templates mode="sanitize" select="*|text()"/>
|
|
7
|
-
</xsl:template>
|
|
8
|
-
<xsl:template match="*">
|
|
9
|
-
<xsl:apply-templates mode="sanitize" select="*|text()"/>
|
|
10
|
-
</xsl:template>
|
|
11
|
-
<xsl:template match="*[name()='svg']|*[name()='math']">
|
|
12
|
-
<xsl:apply-templates mode="sanitize" select="."/>
|
|
13
|
-
</xsl:template>
|
|
14
|
-
<xsl:template mode="sanitize" match="*[count(text())=1 and count(*)=0]">
|
|
15
|
-
<xsl:copy>
|
|
16
|
-
<xsl:apply-templates mode="sanitize" select="@*"/>
|
|
17
|
-
<xsl:value-of select="text()"></xsl:value-of>
|
|
18
|
-
</xsl:copy>
|
|
19
|
-
</xsl:template>
|
|
20
|
-
<xsl:template mode="sanitize" match="xhtml:*[count(text())=1 and count(*)=0]">
|
|
21
|
-
<xsl:element name="{local-name()}">
|
|
22
|
-
<xsl:apply-templates mode="sanitize" select="@*"/>
|
|
23
|
-
<xsl:value-of select="text()"></xsl:value-of>
|
|
24
|
-
</xsl:element>
|
|
25
|
-
</xsl:template>
|
|
26
|
-
<xsl:template mode="sanitize" match="*|@*">
|
|
27
|
-
<xsl:copy>
|
|
28
|
-
<xsl:apply-templates mode="sanitize" select="*|@*|text()"/>
|
|
29
|
-
</xsl:copy>
|
|
30
|
-
</xsl:template>
|
|
31
|
-
<xsl:template mode="sanitize" match="text()[normalize-space(.) = '']"/>
|
|
32
|
-
<xsl:template mode="sanitize" match="text()">
|
|
33
|
-
<dce-text>
|
|
34
|
-
<xsl:copy/>
|
|
35
|
-
</dce-text>
|
|
36
|
-
</xsl:template>
|
|
37
|
-
<xsl:template mode="sanitize" match="xsl:value-of|*[name()='slot']">
|
|
38
|
-
<xsl:copy>
|
|
39
|
-
<xsl:apply-templates mode="sanitize" select="*|@*|text()"/>
|
|
40
|
-
</xsl:copy>
|
|
41
|
-
</xsl:template>
|
|
42
|
-
<xsl:template mode="sanitize" match="xhtml:*">
|
|
43
|
-
<xsl:element name="{local-name()}">
|
|
44
|
-
<xsl:apply-templates mode="sanitize" select="*|@*|text()"/>
|
|
45
|
-
</xsl:element>
|
|
46
|
-
</xsl:template>
|
|
47
|
-
<xsl:template mode="sanitize" match="xhtml:input">
|
|
48
|
-
<xsl:element name="{local-name()}">
|
|
49
|
-
<xsl:apply-templates mode="sanitize" select="*|@*|text()"/>
|
|
50
|
-
</xsl:element>
|
|
51
|
-
<xsl:for-each select="*">
|
|
52
|
-
<xsl:copy>
|
|
53
|
-
<xsl:attribute name="for" >^</xsl:attribute>
|
|
54
|
-
<xsl:apply-templates mode="sanitize" select="*|@*|text()"/>
|
|
55
|
-
</xsl:copy>
|
|
56
|
-
</xsl:for-each>
|
|
57
|
-
</xsl:template>
|
|
58
|
-
</xsl:stylesheet>`),s=new XSLTProcessor,n=(a=>{L(a,"custom-element",b=>{b.firstElementChild.localName==="template"&&([...b.firstElementChild.content.childNodes].forEach(y=>b.append(y)),b.firstElementChild.remove())}),L(a,"script",b=>b.remove());const c=a.content??a.firstElementChild?.content??a.body??a;Ae.forEach(b=>L(c,b,y=>we(y,c)));const N=a.firstElementChild?.content||a.content,E=b=>{const y=j("<xhtml/>"),M=y.importNode(b,!0);return y.replaceChild(M,y.documentElement),ne(M)};if(N){const b=w("div");return[...N.childNodes].map(y=>b.append(y.cloneNode(!0))),E(b)}return E(a.documentElement||a.body||a)})(e),i=j(`<xsl:stylesheet version="1.0"
|
|
59
|
-
xmlns:xsl="${W}"
|
|
60
|
-
xmlns:xhtml="${V}"
|
|
61
|
-
xmlns:dce="urn:schemas-epa-wg:dce"
|
|
62
|
-
xmlns:exsl="http://exslt.org/common"
|
|
63
|
-
exclude-result-prefixes="exsl"
|
|
64
|
-
>
|
|
65
|
-
<xsl:template match="ignore">
|
|
66
|
-
<xsl:choose>
|
|
67
|
-
<xsl:when test="//attr">{//attr}</xsl:when>
|
|
68
|
-
<xsl:otherwise>{def}</xsl:otherwise>
|
|
69
|
-
</xsl:choose><xsl:value-of select="."></xsl:value-of></xsl:template>
|
|
70
|
-
<xsl:template mode="payload" match="attributes"></xsl:template>
|
|
71
|
-
<xsl:template match="/">
|
|
72
|
-
<xsl:apply-templates mode="payload" select="/datadom/attributes"/>
|
|
73
|
-
</xsl:template>
|
|
74
|
-
<xsl:template name="slot" >
|
|
75
|
-
<xsl:param name="slotname" />
|
|
76
|
-
<xsl:param name="defaultvalue" />
|
|
77
|
-
<xsl:choose>
|
|
78
|
-
<xsl:when test="//payload/*[@slot=$slotname]">
|
|
79
|
-
<xsl:copy-of select="//payload/*[@slot=$slotname]"/>
|
|
80
|
-
</xsl:when>
|
|
81
|
-
<xsl:otherwise>
|
|
82
|
-
<xsl:copy-of select="$defaultvalue"/>
|
|
83
|
-
</xsl:otherwise>
|
|
84
|
-
</xsl:choose>
|
|
85
|
-
</xsl:template>
|
|
86
|
-
<xsl:variable name="js-injected-body">
|
|
87
|
-
<xsl:call-template name="slot" >
|
|
88
|
-
<xsl:with-param name="slotname" select="''"/>
|
|
89
|
-
<xsl:with-param name="defaultvalue"/>
|
|
90
|
-
</xsl:call-template>
|
|
91
|
-
</xsl:variable>
|
|
92
|
-
</xsl:stylesheet>`);s.importStylesheet(t);const r=s.transformToFragment(n,document),x=(a,c)=>a.querySelector(c),p=x(i,'template[mode="payload"]');if(!r)return console.error("transformation error",{xml:n.outerHTML,xsl:X(t)});if(r.firstElementChild.localName!=="dce-root"){const a=r.ownerDocument.createElement("dce-root");[...r.childNodes].forEach(c=>a.append(c)),r.append(a)}const u=[];[...r.querySelectorAll("dce-root>attribute")].forEach(a=>{K(a,"namespace,name,select");const c=J(a,"xsl:param"),N=f(a,"name");p.append(c),K(c,"select,name");let E=f(c,"select")?.split("??");E||(E=["//"+N,`'${c.textContent}'`],_(c),c.setAttribute("name",N));let b;if(E?.length>1){c.removeAttribute("select");const y=x(i,'template[match="ignore"]>choose').cloneNode(!0);_(y.firstElementChild).append($(y,"{"+E[0]+"}")),_(y.lastElementChild).append($(y,"{"+E[1]+"}")),y.firstElementChild.setAttribute("test",E[0]),c.append(y),b=y.cloneNode(!0)}else b=J(a,"xsl:value-of");b.removeAttribute("name"),a.append(b),a.removeAttribute("select"),u.push(c)}),[...r.querySelectorAll("[value]")].filter(a=>a.getAttribute("value").match(/\{(.*)\?\?(.*)\}/g)).forEach(a=>{const c=f(a,"value");c&&a.setAttribute("value",Ne(c))});for(const a of r.childNodes)p.append(i.importNode(a,!0));[...p.getElementsByTagName("xsl:template")].forEach(a=>p.ownerDocument.documentElement.append(a));const q=x(i,'call-template[name="slot"]'),d=a=>{const c=q.cloneNode(!0),N=f(a,"name");N&&c.firstElementChild.setAttribute("select",`'${N}'`);for(let E of a.childNodes)c.lastElementChild.append(E);return c};L(p,"slot",a=>a.parentNode.replaceChild(d(a),a));const m=ee(i);return m.params=u,m}async function xe(e){return await new Promise((t,s)=>{const n=new XMLHttpRequest;n.open("GET",e),n.responseType="document",n.onload=()=>{n.readyState===n.DONE&&n.status===200?t(n.responseXML?.body||n.responseXML||w("div",n.responseText)):s(`${n.statusText} - ${e}`)},n.addEventListener("error",i=>s(i)),n.send()})}const ie=e=>e.split("|").map(l=>l.trim()).filter(l=>l),be=(e,l)=>ie(l).map(t=>{let s=e.ownerDocument,n=i=>(e.append(i),i);if(t.includes("/")){const i=[],r=s.evaluate(t,e);for(let x;x=r.iterateNext();)i.push(x);return i}return[...e.childNodes].find(i=>i.localName===t)||n(w(t,"",s))}).flat();function te(e,l,t,s){if(!t.sliceProcessed)return t.sliceProcessed=1,be(e,l??"").map(n=>{const i=e.ownerDocument,r=t.sliceEventSource,x=t.sliceElement,p=()=>[...n.childNodes].filter(u=>u.nodeType===3||u.localName==="value"||u.localName==="form-data").map(u=>u.remove());if(r.getAttributeNames().map(u=>n.setAttribute(u,f(r,u))),[...n.childNodes].filter(u=>u.localName==="event").map(u=>u.remove()),"validationMessage"in r&&n.setAttribute("validation-message",r.validationMessage),t.type==="init"&&p(),n.append(D(t,"event",i)),x.hasAttribute("slice-value")){r.value===void 0?n.removeAttribute("value"):n.setAttribute("value",r.value);const u=z(f(x,"slice-value"),n);p(),n.append($(i,u))}else{if("elements"in r)return p(),n.append(D(new FormData(r),"value",n.ownerDocument)),n;const u=r.value??f(r,"value");p(),u==null?[...n.childNodes].filter(T=>T.localName!=="event").map(T=>T.remove()):de(u)?n.append($(i,u)):n.append(D(u,"value",n.ownerDocument))}return n})}function L(e,l,t){e.querySelectorAll&&[...e.querySelectorAll(l)].forEach(t)}const ye=async(e,l)=>{if(!e||!e.trim())return[l];if(e.startsWith("#"))return(t=>{const s=t.querySelectorAll(e);return[...s.length?s:t.getRootNode().querySelectorAll(e)]})(l.parentElement);try{const[t,s]=e.split("#");if(e.charAt(0)===".")e=new URL(t,l.closest("[base]")?.getAttribute("base")||location).href;else try{e=import.meta.resolve(t),s&&(e+="#"+s)}catch(i){console.error(i.message)}const n=await xe(e);if(l.setAttributeNS("xml","base",e),s){const i=n.querySelectorAll("#"+s);return i.length?[...i]:(console.error("template not found",e+"#"+s),[l])}return[n]}catch{return[l]}};function ve(e,l){for(let t of e.attributes)t.namespaceURI?l.setAttributeNS(t.namespaceURI,t.name,t.value):l.setAttribute(t.name,t.value),t.name==="value"&&(l.value=t.value)}function oe(e,l=0){const t={};for(const s of e.childNodes){const n=f(s,"data-dce-id")||s.dceId||0;if(!t[n])n?t[n]=1:(t[n]=s.dceId=++l,s.setAttribute&&s.setAttribute("data-dce-id",s.dceId));else{const i=s.dceId=n+"-"+t[n]++;s.setAttribute&&s.setAttribute("data-dce-id",i)}s.childNodes.length&&oe(s)}}function ge(e,l,t){t=1*t;for(let s of e.childNodes)if((s.dceId??s.getAttribute("data-dce-id")*1)>t)return e.insertBefore(l,s);e.append(l)}function re(e,l){if(e.firstElementChild?.localName==="dce-root"&&l[0].localName!=="dce-root")return;if(!l.length)return e.firstElementChild?.localName!=="dce-root"&&se(e);const t={};for(let s of e.childNodes)t[s.dceId],Z(s)?(s.data.trim(),t[s.dceId||0]=s):t[f(s,"data-dce-id")||0]=s;for(let s of[...l]){const n=f(s,"data-dce-id")||s.dceId,i=t[n];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[n]):ge(e,s,n)}for(let s of Object.values(t))s.localName!=="dce-root"&&s.remove()}function Ee(e,l){return e.hasAttribute(l)||e.setAttribute(l,crypto.randomUUID()),e.getAttribute(l)}const Ne=e=>[...e?.matchAll(/([^{}]*)(\{)([^}]+)}([^{}]*)/g)].map(t=>`${t[1]}{${Y(t[3])}}${t[4]}`).join(""),Y=e=>{if(!e.trim())return e;const l=e.split("??"),t=l.shift(),s=Y(l.join("??"));return l.length?`concat( ${t} , substring( ${s} , (1+string-length( ${s} )) * string-length( ${t} ) ) )`:e},z=(e,l)=>{const t=e.split("??");if(t.length>1)return z(t[0],l)||z(t[1],l);e=Y(e);const s=l.ownerDocument.evaluate(e,l);switch(s.resultType){case XPathResult.NUMBER_TYPE:return s.numberValue;case XPathResult.STRING_TYPE:return s.stringValue;case XPathResult.BOOLEAN_TYPE:return s.booleanValue}let n="";for(let i;i=s.iterateNext();)n+=i.textContent;return n},Ae="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(","),we=(e,l)=>{const t=w("xsl:"+e.localName);for(let s of e.attributes)t.setAttribute(s.name,s.value);for(;e.firstChild;)t.append(e.firstChild);if(e.parentElement)e.parentElement.replaceChild(t,e);else{const s=e.parentElement||l,n=[...s.childNodes];n.forEach((i,r)=>{i===e&&(n[r]=t)}),s.replaceChildren(...n)}};class Te extends HTMLElement{static observedAttributes=["src","tag","hidden"];async connectedCallback(){this.firstElementChild&&this.firstElementChild.localName!=="template"&&console.warn(`custom-element used without template wrapping content
|
|
93
|
-
`,this.outerHTML);const l=await ye(f(this,"src"),this),t=f(this,"tag"),s=t||"dce-"+crypto.randomUUID();for(const d of l)L(d.templateNode||d.content||d,"style",m=>{const a=m.closest("slot"),c=a?`slot[name="${a.name}"]`:"";m.innerHTML=`${s} ${c}{${m.innerHTML}}`,this.append(m)});const n=l.map(d=>he(d)),i=n.map((d,m)=>{m=new XSLTProcessor;try{m.importStylesheet(d)}catch(a){console.error(a,X(d))}return m});Object.defineProperty(this,"xsltString",{get:()=>n.map(d=>X(d)).join(`
|
|
94
|
-
`)});const r=this,x=[...this.templateNode.querySelectorAll("[slice]")],p=x.map(d=>f(d,"slice")).filter(d=>!d.includes("/")).filter((d,m,a)=>a.indexOf(d)===m).map(ie).flat(),u=n.reduce((d,m)=>(m.params&&d.push(...m.params),d),[]);class T extends HTMLElement{static get observedAttributes(){return u.map(m=>f(m,"name"))}#e=0;connectedCallback(){let m=Q(this.childNodes);if(this.firstElementChild?.tagName==="TEMPLATE"){this.firstElementChild!==this.lastElementChild&&console.error("payload should have TEMPLATE as only child",this.outerHTML);const h=this.firstElementChild;h.remove(),m=Q(h.content.childNodes);for(const v of m)if(v.localName==="style"){const o=Ee(this,"data-dce-style");v.innerHTML=`${s}[data-dce-style="${o}"]{${v.innerHTML}}`,h.insertAdjacentElement("beforebegin",v)}else v.nodeType===1?h.insertAdjacentElement("beforebegin",v):v.nodeType===3&&h.insertAdjacentText("beforebegin",v.data)}const a=j("<datadom/>").documentElement,c=(h,v="")=>(o=>(v&&o.append($(a,v)),o))(a.ownerDocument.createElement(h)),N=H(a,"payload",m,fe);le(N),ne(N),this.innerHTML="";const E=H(a,"attributes",this.attributes,h=>c(h.nodeName,h.value));H(a,"dataset",Object.keys(this.dataset),h=>c(h,this.dataset[h]));const b=H(a,"slice",p,h=>c(h,"")),y=h=>z(h,b);this.xml=a;const M=[],G=()=>{const h={};for(let v;v=M.pop();){const o=f(v.sliceElement,"slice");h[o]||(te(b,o,v),h[o]=v)}Object.keys(h).length!==0&&U()};let O;this.onSlice=h=>{M.push(h),O||(O=setTimeout(()=>{G(),O=0},1))};const U=this.transform=()=>{if(this.#e)debugger;this.#e=1,i.map((o,g)=>{const S=o.transformToFragment(a.ownerDocument,document);return S||console.error(`XSLT transformation error. xsl:
|
|
95
|
-
`,X(n[g]),`
|
|
96
|
-
xml:
|
|
97
|
-
`,X(a)),S}).map(o=>{o&&(oe(o),re(this,o.childNodes))}),T.observedAttributes.map(o=>{let g=f(this.firstElementChild,o);g!==f(this,o)&&(this.setAttribute(o,g),this.#t(o,g))});function v(o){let g=o;if(o.localName==="slice"){const S=f(o,"for");if(S||(g=o.parentElement),S==="^")do g=g.previousElementSibling;while(g.localName==="slice");else g=this.querySelector(S);if(!g)return console.warn(`can not find selector in "slice for=${S}" `,o.outerHTML);f(o,"slice")||o.setAttribute("slice",f(o,"name"))}return g}L(this,"[slice],[slice-event]",o=>{let g=f(o,"slice-event");const S=o.hasAttribute("slice-value")||o.hasAttribute("value")||o.value,P=v(o);o.dceInitialized||(o.dceInitialized=1,P.hasAttribute("custom-validity")&&(g+=" change submit"),[...new Set((g||"change").split(" "))].forEach(ce=>P.addEventListener(ce,A=>{A.sliceElement=o,A.sliceEventSource=A.currentTarget||A.target,A.sliceProcessed=0;const me=te(b,f(A.sliceElement,"slice"),A);L(this,"[custom-validity]",R=>{if(!R.setCustomValidity)return;const F=f(R,"custom-validity");try{const I=F&&z(F,E);R.setCustomValidity(I===!0?"":I===!1?"invalid":I)}catch(I){console.error(I,"xPath",F)}});const k=f(P,"custom-validity"),C=k&&z(k,E),B=C===!0?"":C;if(k){if(o.setCustomValidity?o.setCustomValidity(B):o.validationMessage=B,me.map(R=>R.setAttribute("validation-message",B)),A.type==="submit")return C===!0?void 0:(setTimeout(U,1),!!C===C?(C||A.preventDefault(),C):C?(A.preventDefault(),!1):void 0);setTimeout(U,1)}this.onSlice(A)})),(!g||g.includes("init"))&&(S?this.onSlice({type:"init",target:P,sliceElement:o,sliceEventSource:P}):o.value=y(f(o,"slice"))))}),this.#e=0};U(),G()}#t(m,a){m==="value"&&(this.value=a);let c=this.xml.querySelector(`attributes>${m}`);c?_(c).append($(c,a)):(c=w(m,a,this.xml),this.xml.querySelector("attributes").append(c)),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{[m]:a}}))}attributeChangedCallback(m,a,c){!this.xml||this.#e||(this.#t(m,c),this.transform())}get dce(){return r}}const q=d=>{window.customElements.get(d)!==T&&window.customElements.define(d,T)};if(t)q(t);else{const d=s;this.setAttribute("tag",d),q(d);const m=document.createElement(d);this.getAttributeNames().forEach(a=>m.setAttribute(a,this.getAttribute(a))),m.append(...[...this.childNodes].filter(a=>a.localName!=="style")),this.append(m)}}get templateNode(){return this.firstElementChild?.tagName==="TEMPLATE"?this.firstElementChild.content:this}get dce(){return this}get xslt(){return j(this.xsltString)}}window.customElements.define("custom-element",Te);
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import{d as ot}from"./index-DrFu-skq.js";/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2019 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/const U=globalThis,L=U.ShadowRoot&&(U.ShadyCSS===void 0||U.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,G=Symbol(),z=new WeakMap;let ht=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==G)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(L&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=z.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&z.set(e,t))}return t}toString(){return this.cssText}};const lt=r=>new ht(typeof r=="string"?r:r+"",void 0,G),at=(r,t)=>{if(L)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const s=document.createElement("style"),i=U.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},B=L?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return lt(e)})(r):r;/**
|
|
6
|
-
* @license
|
|
7
|
-
* Copyright 2017 Google LLC
|
|
8
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/const{is:ct,defineProperty:dt,getOwnPropertyDescriptor:pt,getOwnPropertyNames:ut,getOwnPropertySymbols:$t,getPrototypeOf:_t}=Object,H=globalThis,D=H.trustedTypes,ft=D?D.emptyScript:"",At=H.reactiveElementPolyfillSupport,E=(r,t)=>r,R={toAttribute(r,t){switch(t){case Boolean:r=r?ft:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},J=(r,t)=>!ct(r,t),I={attribute:!0,type:String,converter:R,reflect:!1,hasChanged:J};Symbol.metadata??=Symbol("metadata"),H.litPropertyMetadata??=new WeakMap;class y extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=I){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&dt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:n}=pt(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get(){return i?.call(this)},set(o){const a=i?.call(this);n.call(this,o),this.requestUpdate(t,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??I}static _$Ei(){if(this.hasOwnProperty(E("elementProperties")))return;const t=_t(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(E("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(E("properties"))){const e=this.properties,s=[...ut(e),...$t(e)];for(const i of s)this.createProperty(i,e[i])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const i of s)e.unshift(B(i))}else t!==void 0&&e.push(B(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return at(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){const n=(s.converter?.toAttribute!==void 0?s.converter:R).toAttribute(e,s.type);this._$Em=t,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(t,e){const s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){const n=s.getPropertyOptions(i),o=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:R;this._$Em=i,this[i]=o.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??J)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[i,n]of this._$Ep)this[i]=n;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[i,n]of s)n.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],n)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}}y.elementStyles=[],y.shadowRootOptions={mode:"open"},y[E("elementProperties")]=new Map,y[E("finalized")]=new Map,At?.({ReactiveElement:y}),(H.reactiveElementVersions??=[]).push("2.0.4");/**
|
|
10
|
-
* @license
|
|
11
|
-
* Copyright 2017 Google LLC
|
|
12
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
-
*/const k=globalThis,x=k.trustedTypes,W=x?x.createPolicy("lit-html",{createHTML:r=>r}):void 0,Q="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,X="?"+_,mt=`<${X}>`,m=document,b=()=>m.createComment(""),w=r=>r===null||typeof r!="object"&&typeof r!="function",j=Array.isArray,yt=r=>j(r)||typeof r?.[Symbol.iterator]=="function",N=`[
|
|
14
|
-
\f\r]`,S=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,q=/>/g,f=RegExp(`>|${N}(?:([^\\s"'>=/]+)(${N}*=${N}*(?:[^
|
|
15
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),K=/'/g,Y=/"/g,tt=/^(?:script|style|textarea|title)$/i,g=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),Z=new WeakMap,A=m.createTreeWalker(m,129);function et(r,t){if(!j(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return W!==void 0?W.createHTML(t):t}const gt=(r,t)=>{const e=r.length-1,s=[];let i,n=t===2?"<svg>":t===3?"<math>":"",o=S;for(let a=0;a<e;a++){const h=r[a];let c,p,l=-1,u=0;for(;u<h.length&&(o.lastIndex=u,p=o.exec(h),p!==null);)u=o.lastIndex,o===S?p[1]==="!--"?o=V:p[1]!==void 0?o=q:p[2]!==void 0?(tt.test(p[2])&&(i=RegExp("</"+p[2],"g")),o=f):p[3]!==void 0&&(o=f):o===f?p[0]===">"?(o=i??S,l=-1):p[1]===void 0?l=-2:(l=o.lastIndex-p[2].length,c=p[1],o=p[3]===void 0?f:p[3]==='"'?Y:K):o===Y||o===K?o=f:o===V||o===q?o=S:(o=f,i=void 0);const $=o===f&&r[a+1].startsWith("/>")?" ":"";n+=o===S?h+mt:l>=0?(s.push(c),h.slice(0,l)+Q+h.slice(l)+_+$):h+_+(l===-2?a:$)}return[et(r,n+(r[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};class P{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,o=0;const a=t.length-1,h=this.parts,[c,p]=gt(t,e);if(this.el=P.createElement(c,s),A.currentNode=this.el.content,e===2||e===3){const l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=A.nextNode())!==null&&h.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(const l of i.getAttributeNames())if(l.endsWith(Q)){const u=p[o++],$=i.getAttribute(l).split(_),C=/([.?@])?(.*)/.exec(u);h.push({type:1,index:n,name:C[2],strings:$,ctor:C[1]==="."?St:C[1]==="?"?Et:C[1]==="@"?bt:M}),i.removeAttribute(l)}else l.startsWith(_)&&(h.push({type:6,index:n}),i.removeAttribute(l));if(tt.test(i.tagName)){const l=i.textContent.split(_),u=l.length-1;if(u>0){i.textContent=x?x.emptyScript:"";for(let $=0;$<u;$++)i.append(l[$],b()),A.nextNode(),h.push({type:2,index:++n});i.append(l[u],b())}}}else if(i.nodeType===8)if(i.data===X)h.push({type:2,index:n});else{let l=-1;for(;(l=i.data.indexOf(_,l+1))!==-1;)h.push({type:7,index:n}),l+=_.length-1}n++}}static createElement(t,e){const s=m.createElement("template");return s.innerHTML=t,s}}function v(r,t,e=r,s){if(t===g)return t;let i=s!==void 0?e.o?.[s]:e.l;const n=w(t)?void 0:t._$litDirective$;return i?.constructor!==n&&(i?._$AO?.(!1),n===void 0?i=void 0:(i=new n(r),i._$AT(r,e,s)),s!==void 0?(e.o??=[])[s]=i:e.l=i),i!==void 0&&(t=v(r,i._$AS(r,t.values),i,s)),t}class vt{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,i=(t?.creationScope??m).importNode(e,!0);A.currentNode=i;let n=A.nextNode(),o=0,a=0,h=s[0];for(;h!==void 0;){if(o===h.index){let c;h.type===2?c=new O(n,n.nextSibling,this,t):h.type===1?c=new h.ctor(n,h.name,h.strings,this,t):h.type===6&&(c=new wt(n,this,t)),this._$AV.push(c),h=s[++a]}o!==h?.index&&(n=A.nextNode(),o++)}return A.currentNode=m,i}p(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class O{get _$AU(){return this._$AM?._$AU??this.v}constructor(t,e,s,i){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this.v=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=v(this,t,e),w(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==g&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):yt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==d&&w(this._$AH)?this._$AA.nextSibling.data=t:this.T(m.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=P.createElement(et(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(e);else{const n=new vt(i,this),o=n.u(this.options);n.p(e),this.T(o),this._$AH=n}}_$AC(t){let e=Z.get(t.strings);return e===void 0&&Z.set(t.strings,e=new P(t)),e}k(t){j(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const n of t)i===e.length?e.push(s=new O(this.O(b()),this.O(b()),this,this.options)):s=e[i],s._$AI(n),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){const s=t.nextSibling;t.remove(),t=s}}setConnected(t){this._$AM===void 0&&(this.v=t,this._$AP?.(t))}}class M{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,n){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,i){const n=this.strings;let o=!1;if(n===void 0)t=v(this,t,e,0),o=!w(t)||t!==this._$AH&&t!==g,o&&(this._$AH=t);else{const a=t;let h,c;for(t=n[0],h=0;h<n.length-1;h++)c=v(this,a[s+h],e,h),c===g&&(c=this._$AH[h]),o||=!w(c)||c!==this._$AH[h],c===d?t=d:t!==d&&(t+=(c??"")+n[h+1]),this._$AH[h]=c}o&&!i&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class St extends M{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}}class Et extends M{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}}class bt extends M{constructor(t,e,s,i,n){super(t,e,s,i,n),this.type=5}_$AI(t,e=this){if((t=v(this,t,e,0)??d)===g)return;const s=this._$AH,i=t===d&&s!==d||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==d&&(s===d||i);i&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class wt{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){v(this,t)}}const Pt=k.litHtmlPolyfillSupport;Pt?.(P,O),(k.litHtmlVersions??=[]).push("3.2.0");const st=(r,t,e)=>{const s=e?.renderBefore??t;let i=s._$litPart$;if(i===void 0){const n=e?.renderBefore??null;s._$litPart$=i=new O(t.insertBefore(b(),n),n,void 0,e??{})}return i._$AI(r),i};/**
|
|
16
|
-
* @license
|
|
17
|
-
* Copyright 2017 Google LLC
|
|
18
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
-
*/class T extends y{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=st(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return g}}T._$litElement$=!0,T.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:T});const Ot=globalThis.litElementPolyfillSupport;Ot?.({LitElement:T});(globalThis.litElementVersions??=[]).push("4.1.0");/**
|
|
20
|
-
* @license
|
|
21
|
-
* Copyright 2020 Google LLC
|
|
22
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
-
*/const Ct=(r,t)=>t===void 0?r?._$litType$!==void 0:r?._$litType$===t,{simulatePageLoad:F,simulateDOMContentLoaded:Ut}=__STORYBOOK_MODULE_PREVIEW_API__,{global:Tt}=__STORYBOOK_MODULE_GLOBAL__;var xt=Object.defineProperty,Ht=(r,t)=>{for(var e in t)xt(r,e,{get:t[e],enumerable:!0})},Mt={};Ht(Mt,{parameters:()=>nt,render:()=>it,renderToCanvas:()=>rt});var{Node:Nt}=Tt,it=(r,t)=>{let{id:e,component:s}=t;if(!s)throw new Error(`Unable to render story ${e} as the component annotation is missing from the default export`);let i=document.createElement(s);return Object.entries(r).forEach(([n,o])=>{i[n]=o}),i};function rt({storyFn:r,kind:t,name:e,showMain:s,showError:i,forceRemount:n},o){let a=r();if(s(),Ct(a)){(n||!o.querySelector('[id="root-inner"]'))&&(o.innerHTML='<div id="root-inner"></div>');let h=o.querySelector('[id="root-inner"]');st(a,h),F(o)}else if(typeof a=="string")o.innerHTML=a,F(o);else if(a instanceof Nt){if(o.firstChild===a&&!n)return;o.innerHTML="",o.appendChild(a),Ut()}else i({title:`Expecting an HTML snippet or DOM node from the story: "${e}" of "${t}".`,description:ot`
|
|
24
|
-
Did you forget to return the HTML snippet from the story?
|
|
25
|
-
Use "() => <your snippet or node>" or when defining the story.
|
|
26
|
-
`})}var nt={renderer:"web-components"};const kt=Object.freeze(Object.defineProperty({__proto__:null,parameters:nt,render:it,renderToCanvas:rt},Symbol.toStringTag,{value:"Module"}));export{st as Q,kt as e};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Q as p}from"./entry-preview-C313OLrj.js";import{D as u,c as E,y}from"./index-BdcJ-iJ7.js";import{i as g}from"./tiny-invariant-BxWVcicq.js";import"./index-DrFu-skq.js";const{global:i}=__STORYBOOK_MODULE_GLOBAL__;__STORYBOOK_MODULE_PREVIEW_API__;var{window:v}=i;v.STORYBOOK_ENV="web-components";function d(e){if(!e)return!1;if(typeof e=="string")return!0;throw new Error('Provided component needs to be a string. e.g. component: "my-element"')}function l(e){if(!e)return!1;if(e.tags&&Array.isArray(e.tags)||e.modules&&Array.isArray(e.modules))return!0;throw new Error(`You need to setup valid meta data in your config.js via setCustomElements().
|
|
2
|
-
See the readme of addon-docs for web components for more details.`)}function c(){return i.__STORYBOOK_CUSTOM_ELEMENTS__||i.__STORYBOOK_CUSTOM_ELEMENTS_MANIFEST__}var{window:w,EventSource:S}=i;typeof module<"u"&&module?.hot?.decline&&(module.hot.decline(),new S("__webpack_hmr").addEventListener("message",function(e){try{let{action:r}=JSON.parse(e.data);r==="built"&&w.location.reload()}catch{}}));const{logger:m}=__STORYBOOK_MODULE_CLIENT_LOGGER__,{useEffect:D,addons:b}=__STORYBOOK_MODULE_PREVIEW_API__;function _(e,r){let t;switch(r){case"attributes":case"properties":t={name:e.type?.text||e.type};break;case"slots":t={name:"string"};break;default:t={name:"void"};break}return{name:e.name,required:!1,description:e.description,type:t,table:{category:r,type:{summary:e.type?.text||e.type},defaultValue:{summary:e.default!==void 0?e.default:e.defaultValue}}}}function h(e){let r=e.name.replace(/(-|_|:|\.|\s)+(.)?/g,(t,n,a)=>a?a.toUpperCase():"").replace(/^([A-Z])/,t=>t.toLowerCase());return r=`on${r.charAt(0).toUpperCase()+r.substr(1)}`,[{name:r,action:{name:e.name},table:{disable:!0}},_(e,"events")]}function o(e,r){return e&&e.filter(t=>t&&t.name).reduce((t,n)=>{if(n.kind==="method")return t;switch(r){case"events":h(n).forEach(a=>{g(a.name,`${a} should have a name property.`),t[a.name]=a});break;default:t[n.name]=_(n,r);break}return t},{})}var C=(e,r)=>{if(!d(e)||!l(r))return null;let t=r.tags.find(n=>n.name.toUpperCase()===e.toUpperCase());return t||m.warn(`Component not found in custom-elements.json: ${e}`),t},M=(e,r)=>{if(!d(e)||!l(r))return null;let t;return r?.modules?.forEach(n=>{n?.declarations?.forEach(a=>{a.tagName===e&&(t=a)})}),t||m.warn(`Component not found in custom-elements.json: ${e}`),t},f=(e,r)=>r?.version==="experimental"?C(e,r):M(e,r),A=(e,r)=>{let t=f(e,r);return t&&{...o(t.members??[],"properties"),...o(t.properties??[],"properties"),...o(t.attributes??[],"attributes"),...o(t.events??[],"events"),...o(t.slots??[],"slots"),...o(t.cssProperties??[],"css custom properties"),...o(t.cssParts??[],"css shadow parts")}},T=e=>{let r=c();return A(e,r)},L=e=>{let r=f(e,c());return r&&r.description},R=/<!--\?lit\$[0-9]+\$-->|<!--\??-->/g;function I(e){let r=e?.parameters.docs?.source,t=e?.parameters.__isArgsStory;return r?.type===u.DYNAMIC?!1:!t||r?.code||r?.type===u.CODE}function U(e,r){let t=e(),n=r?.parameters.docs?.source?.excludeDecorators?r.originalStoryFn(r.args,r):t,a;if(D(()=>{let{id:s,unmappedArgs:O}=r;a&&b.getChannel().emit(y,{id:s,source:a,args:O})}),!I(r)){let s=window.document.createElement("div");n instanceof DocumentFragment?p(n.cloneNode(!0),s):p(n,s),a=s.innerHTML.replace(R,"")}return t}var V=[U],K={docs:{extractArgTypes:T,extractComponentDescription:L,story:{inline:!0},source:{type:u.DYNAMIC,language:"html"}}},$=[E];export{$ as argTypesEnhancers,V as decorators,K as parameters};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Configure-DOhzHFEs.js","./index-CaL3Qp7t.js","./index-BdcJ-iJ7.js","./index-D-8MO0q_.js","./index-DrFu-skq.js","./index-B3QjF0Ed.js","./attributes.test.stories-BJBuuXgZ.js","./index-BSz1w4Gl.js","./custom-element-BDGsYgbP.js","./css.test.stories-pgbBc17d.js","./dom-merge.test.stories-CXcYP_-J.js","./external-template.test.stories-CpJ68Ghy.js","./form.test.stories-D35lyqd8.js","./http-request.stories-CBbknCOO.js","./http-request-DNq59pnj.js","./handlers-CW9pDZnt.js","./local-storage.test.stories-BY-PWhuk.js","./location-element-hKpcXCdn.js","./location-element.test.stories-3auBYEaU.js","./module-url.test.stories-B7L9cL60.js","./set-url.test.stories-CuSuDLIx.js","./slice-events.test.stories-BkRKsKem.js","./slots.test.stories-BJCUWFkE.js","./version-select.test.stories-B3ybJn_Z.js","./entry-preview-C313OLrj.js","./entry-preview-docs-B7ORr9w5.js","./tiny-invariant-BxWVcicq.js","./preview-BhhEZcNS.js","./preview-ncvtW_hb.js","./preview-CcS4DQh8.js","./preview-BWzBA1C2.js","./preview-BRPR-UXC.js","./preview-CfWMRsRq.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import"../sb-preview/runtime.js";(function(){const _=document.createElement("link").relList;if(_&&_.supports&&_.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))m(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&m(o)}).observe(document,{childList:!0,subtree:!0});function a(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function m(r){if(r.ep)return;r.ep=!0;const s=a(r);fetch(r.href,s)}})();const R="modulepreload",T=function(e,_){return new URL(e,_).href},d={},t=function(_,a,m){let r=Promise.resolve();if(a&&a.length>0){const o=document.getElementsByTagName("link"),i=document.querySelector("meta[property=csp-nonce]"),O=i?.nonce||i?.getAttribute("nonce");r=Promise.allSettled(a.map(n=>{if(n=T(n,m),n in d)return;d[n]=!0;const u=n.endsWith(".css"),f=u?'[rel="stylesheet"]':"";if(!!m)for(let l=o.length-1;l>=0;l--){const E=o[l];if(E.href===n&&(!u||E.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${n}"]${f}`))return;const c=document.createElement("link");if(c.rel=u?"stylesheet":R,u||(c.as="script"),c.crossOrigin="",c.href=n,O&&c.setAttribute("nonce",O),document.head.appendChild(c),u)return new Promise((l,E)=>{c.addEventListener("load",l),c.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${n}`)))})}))}function s(o){const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=o,window.dispatchEvent(i),!i.defaultPrevented)throw o}return r.then(o=>{for(const i of o||[])i.status==="rejected"&&s(i.reason);return _().catch(s)})},{createBrowserChannel:L}=__STORYBOOK_MODULE_CHANNELS__,{addons:P}=__STORYBOOK_MODULE_PREVIEW_API__,p=L({page:"preview"});P.setChannel(p);window.__STORYBOOK_ADDONS_CHANNEL__=p;window.CONFIG_TYPE==="DEVELOPMENT"&&(window.__STORYBOOK_SERVER_CHANNEL__=p);const y={"./src/stories/Configure.mdx":async()=>t(()=>import("./Configure-DOhzHFEs.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url),"./src/stories/attributes.test.stories.ts":async()=>t(()=>import("./attributes.test.stories-BJBuuXgZ.js"),__vite__mapDeps([6,7,8]),import.meta.url),"./src/stories/css.test.stories.ts":async()=>t(()=>import("./css.test.stories-pgbBc17d.js"),__vite__mapDeps([9,7,8]),import.meta.url),"./src/stories/dom-merge.test.stories.ts":async()=>t(()=>import("./dom-merge.test.stories-CXcYP_-J.js"),__vite__mapDeps([10,7,8]),import.meta.url),"./src/stories/external-template.test.stories.ts":async()=>t(()=>import("./external-template.test.stories-CpJ68Ghy.js"),__vite__mapDeps([11,7,8]),import.meta.url),"./src/stories/form.test.stories.ts":async()=>t(()=>import("./form.test.stories-D35lyqd8.js"),__vite__mapDeps([12,7,8]),import.meta.url),"./src/stories/http-request.stories.ts":async()=>t(()=>import("./http-request.stories-CBbknCOO.js"),__vite__mapDeps([13,7,8,14,15]),import.meta.url),"./src/stories/local-storage.test.stories.ts":async()=>t(()=>import("./local-storage.test.stories-BY-PWhuk.js"),__vite__mapDeps([16,7,8,14,17]),import.meta.url),"./src/stories/location-element.test.stories.ts":async()=>t(()=>import("./location-element.test.stories-3auBYEaU.js"),__vite__mapDeps([18,7,8,17]),import.meta.url),"./src/stories/module-url.test.stories.ts":async()=>t(()=>import("./module-url.test.stories-B7L9cL60.js"),__vite__mapDeps([19,7,8]),import.meta.url),"./src/stories/set-url.test.stories.ts":async()=>t(()=>import("./set-url.test.stories-CuSuDLIx.js"),__vite__mapDeps([20,7,8,17]),import.meta.url),"./src/stories/slice-events.test.stories.ts":async()=>t(()=>import("./slice-events.test.stories-BkRKsKem.js"),__vite__mapDeps([21,7,8]),import.meta.url),"./src/stories/slots.test.stories.ts":async()=>t(()=>import("./slots.test.stories-BJCUWFkE.js"),__vite__mapDeps([22,7,8]),import.meta.url),"./src/stories/version-select.test.stories.ts":async()=>t(()=>import("./version-select.test.stories-B3ybJn_Z.js"),__vite__mapDeps([23,7,8,14,17]),import.meta.url)};async function I(e){return y[e]()}const{composeConfigs:V,PreviewWeb:D,ClientApi:g}=__STORYBOOK_MODULE_PREVIEW_API__,v=async(e=[])=>{const _=await Promise.all([e.at(0)??t(()=>import("./entry-preview-C313OLrj.js").then(a=>a.e),__vite__mapDeps([24,4]),import.meta.url),e.at(1)??t(()=>import("./entry-preview-docs-B7ORr9w5.js"),__vite__mapDeps([25,24,4,2,26]),import.meta.url),e.at(2)??t(()=>import("./preview-BhhEZcNS.js"),__vite__mapDeps([27,3]),import.meta.url),e.at(3)??t(()=>import("./preview-C992A1Y-.js"),[],import.meta.url),e.at(4)??t(()=>import("./preview-DHPc-V4N.js"),[],import.meta.url),e.at(5)??t(()=>import("./preview-ncvtW_hb.js"),__vite__mapDeps([28,4]),import.meta.url),e.at(6)??t(()=>import("./preview-DYzi3Z2p.js"),[],import.meta.url),e.at(7)??t(()=>import("./preview-CcS4DQh8.js"),__vite__mapDeps([29,26]),import.meta.url),e.at(8)??t(()=>import("./preview-BWzBA1C2.js"),__vite__mapDeps([30,4]),import.meta.url),e.at(9)??t(()=>import("./preview-caVMbCIR.js"),[],import.meta.url),e.at(10)??t(()=>import("./preview-BRPR-UXC.js"),__vite__mapDeps([31,7]),import.meta.url),e.at(11)??t(()=>import("./preview-CfWMRsRq.js"),__vite__mapDeps([32,15]),import.meta.url)]);return V(_)};window.__STORYBOOK_PREVIEW__=window.__STORYBOOK_PREVIEW__||new D(I,v);window.__STORYBOOK_STORY_STORE__=window.__STORYBOOK_STORY_STORE__||window.__STORYBOOK_PREVIEW__.storyStore;export{t as _};
|