@shortfuse/materialdesignweb 0.9.2 → 0.9.4
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/README.md +5 -1
- package/components/Grid.js +1 -1
- package/components/NavItem.js +4 -1
- package/core/observe.js +5 -3
- package/dist/CustomElement.min.js +1 -1
- package/dist/CustomElement.min.js.map +2 -2
- package/dist/index.min.js +27 -24
- package/dist/index.min.js.map +4 -4
- package/dist/meta.json +1 -1
- package/mixins/FlexableMixin.js +1 -1
- package/package.json +27 -8
- package/types/components/NavBarItem.d.ts +1 -0
- package/types/components/NavDrawerItem.d.ts +1 -0
- package/types/components/NavItem.d.ts +1 -0
- package/types/components/NavItem.d.ts.map +1 -1
- package/types/components/NavRailItem.d.ts +1 -0
- package/types/core/observe.d.ts +2 -2
- package/types/core/observe.d.ts.map +1 -1
- package/dist/core/CustomElement.min.js +0 -2
- package/dist/core/CustomElement.min.js.map +0 -7
package/dist/meta.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"core/optimizations.js":{"bytes":597,"imports":[],"format":"esm"},"core/CompositionAdapter.js":{"bytes":9660,"imports":[{"path":"core/optimizations.js","kind":"import-statement","original":"./optimizations.js"}],"format":"esm"},"core/css.js":{"bytes":4807,"imports":[],"format":"esm"},"core/dom.js":{"bytes":2583,"imports":[],"format":"esm"},"core/jsonMergePatch.js":{"bytes":3901,"imports":[],"format":"esm"},"core/observe.js":{"bytes":
|
|
1
|
+
{"inputs":{"core/optimizations.js":{"bytes":597,"imports":[],"format":"esm"},"core/CompositionAdapter.js":{"bytes":9660,"imports":[{"path":"core/optimizations.js","kind":"import-statement","original":"./optimizations.js"}],"format":"esm"},"core/css.js":{"bytes":4807,"imports":[],"format":"esm"},"core/dom.js":{"bytes":2583,"imports":[],"format":"esm"},"core/jsonMergePatch.js":{"bytes":3901,"imports":[],"format":"esm"},"core/observe.js":{"bytes":13402,"imports":[{"path":"core/dom.js","kind":"import-statement","original":"./dom.js"},{"path":"core/jsonMergePatch.js","kind":"import-statement","original":"./jsonMergePatch.js"}],"format":"esm"},"core/uid.js":{"bytes":475,"imports":[],"format":"esm"},"core/template.js":{"bytes":3062,"imports":[{"path":"core/uid.js","kind":"import-statement","original":"./uid.js"}],"format":"esm"},"core/Composition.js":{"bytes":45317,"imports":[{"path":"core/CompositionAdapter.js","kind":"import-statement","original":"./CompositionAdapter.js"},{"path":"core/css.js","kind":"import-statement","original":"./css.js"},{"path":"core/observe.js","kind":"import-statement","original":"./observe.js"},{"path":"core/optimizations.js","kind":"import-statement","original":"./optimizations.js"},{"path":"core/template.js","kind":"import-statement","original":"./template.js"},{"path":"core/uid.js","kind":"import-statement","original":"./uid.js"}],"format":"esm"},"core/CustomElement.js":{"bytes":38833,"imports":[{"path":"core/Composition.js","kind":"import-statement","original":"./Composition.js"},{"path":"core/css.js","kind":"import-statement","original":"./css.js"},{"path":"core/dom.js","kind":"import-statement","original":"./dom.js"},{"path":"core/jsonMergePatch.js","kind":"import-statement","original":"./jsonMergePatch.js"},{"path":"core/observe.js","kind":"import-statement","original":"./observe.js"},{"path":"core/template.js","kind":"import-statement","original":"./template.js"}],"format":"esm"}},"outputs":{"dist/CustomElement.min.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":174233},"dist/CustomElement.min.js":{"imports":[],"exports":["cloneAttributeCallback","default"],"entryPoint":"core/CustomElement.js","inputs":{"core/optimizations.js":{"bytesInOutput":108},"core/CompositionAdapter.js":{"bytesInOutput":2522},"core/css.js":{"bytesInOutput":1031},"core/dom.js":{"bytesInOutput":586},"core/jsonMergePatch.js":{"bytesInOutput":1011},"core/observe.js":{"bytesInOutput":3366},"core/uid.js":{"bytesInOutput":131},"core/template.js":{"bytesInOutput":723},"core/Composition.js":{"bytesInOutput":12418},"core/CustomElement.js":{"bytesInOutput":8967}},"bytes":30960}}}
|
package/mixins/FlexableMixin.js
CHANGED
|
@@ -130,7 +130,7 @@ export default function FlexableMixin(Base) {
|
|
|
130
130
|
:host(:is([gap="24"])) {gap: 24px;}
|
|
131
131
|
|
|
132
132
|
:host(:is([padding])) {padding: 0;}
|
|
133
|
-
:host(:is([padding="pane"])) { padding-inline: var(--mdw-pane__padding-inline,
|
|
133
|
+
:host(:is([padding="pane"])) { padding-inline: var(--mdw-pane__padding-inline, 16px) }
|
|
134
134
|
:host(:is([padding="4"])) {padding: 4px;}
|
|
135
135
|
:host(:is([padding="8"])) {padding: 8px;}
|
|
136
136
|
:host(:is([padding="12"])) {padding: 12px;}
|
package/package.json
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"@babel/preset-env": "^7.26.9",
|
|
14
14
|
"@esm-bundle/chai": "^4.3.4-fix.0",
|
|
15
15
|
"@playwright/test": "^1.50.1",
|
|
16
|
+
"@pwrs/cem": "^0.7.5",
|
|
16
17
|
"@rollup/plugin-babel": "^6.0.4",
|
|
17
18
|
"@rollup/plugin-node-resolve": "^15.3.1",
|
|
18
19
|
"@rollup/plugin-terser": "^0.4.4",
|
|
@@ -31,9 +32,10 @@
|
|
|
31
32
|
"ajv": "^8.17.1",
|
|
32
33
|
"browserslist-to-esbuild": "^2.1.1",
|
|
33
34
|
"clean-css": "^5.3.3",
|
|
35
|
+
"custom-element-vs-code-integration": "^1.5.0",
|
|
34
36
|
"custom-elements-manifest": "^2.1.0",
|
|
35
37
|
"element-internals-polyfill": "^1.3.13",
|
|
36
|
-
"esbuild": "^0.
|
|
38
|
+
"esbuild": "^0.27.2",
|
|
37
39
|
"esbuild-postcss": "^0.0.4",
|
|
38
40
|
"eslint": "^8.57.1",
|
|
39
41
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
@@ -98,19 +100,24 @@
|
|
|
98
100
|
"url": "git+https://github.com/clshortfuse/materialdesignweb.git"
|
|
99
101
|
},
|
|
100
102
|
"scripts": {
|
|
101
|
-
"cem": "node scripts/cem-generate.js",
|
|
102
|
-
"demo": "node build/esbuild.js demo/demo.js --outdir=demo --minify --metafile",
|
|
103
|
+
"cem": "node scripts/cem-generate.js && node scripts/cem-vscode.js",
|
|
103
104
|
"demo:rollup": "rollup -c build/rollup.config.js demo/demo.js --dir=demo --compact",
|
|
104
105
|
"build:index": "node build/esbuild.js index.js --outdir=dist --minify --metafile --production --format=iife",
|
|
106
|
+
"build:demo": "node build/esbuild.js demo/demo.js --outdir=demo --minify --metafile",
|
|
105
107
|
"build:custom-element": "node build/esbuild.js core/CustomElement.js --outdir=dist --minify --metafile --production --format=esm",
|
|
106
|
-
"
|
|
108
|
+
"build": "npm run build:index && npm run build:custom-element",
|
|
109
|
+
"demo": "npm run build:demo",
|
|
110
|
+
"dist": "npm run build",
|
|
107
111
|
"predemo": "node bin/mdw-css.js --custom=yellow,orange:orange,green:0f0,alias:aqua | npx esbuild --minify --loader=css > demo/theme.css",
|
|
108
112
|
"predemo-alt": "node bin/mdw-css.js --color=a46750 --custom=yellow,orange:orange,green:0f0,alias:aqua | npx esbuild --minify --loader=css > demo/alt-theme.css",
|
|
109
113
|
"prepublishOnly": "npm run types && npm run cem && npm run dist",
|
|
110
|
-
"
|
|
114
|
+
"eslint": "eslint --ignore-path .gitignore",
|
|
115
|
+
"pretest": "npm run eslint && npm run build:index",
|
|
116
|
+
"preversion": "npm run prepublishOnly",
|
|
111
117
|
"serve": "node build/esbuild.js demo/demo.js --outdir=demo --metafile --serve --live --tree-shaking=true",
|
|
112
118
|
"serve:rollup": "rollup -c build/rollup.config.js demo/demo.js --dir=demo --watch --environment SERVE",
|
|
113
119
|
"test": "web-test-runner \"test/**/*.test.js\" --node-resolve --playwright --browsers chromium firefox webkit --concurrency 1",
|
|
120
|
+
"test:cem": "npx @pwrs/cem validate",
|
|
114
121
|
"test:custom": "web-test-runner \"test/**/*.test.js\" --node-resolve --concurrency 1",
|
|
115
122
|
"test:chromium": "web-test-runner \"test/**/*.test.js\" --node-resolve --playwright --browsers chromium",
|
|
116
123
|
"test:firefox": "web-test-runner \"test/**/*.test.js\" --node-resolve --playwright --browsers firefox --concurrency 1",
|
|
@@ -128,10 +135,22 @@
|
|
|
128
135
|
"sideEffects": [
|
|
129
136
|
"./components/*.js",
|
|
130
137
|
"./loaders/*.js",
|
|
131
|
-
"./polyfills/*.js",
|
|
132
138
|
"./demo/custom.js",
|
|
133
|
-
"./demo/demo/*.js"
|
|
139
|
+
"./demo/demo/*.js",
|
|
140
|
+
"./demo/polyfills/*.js"
|
|
134
141
|
],
|
|
142
|
+
"contributes": {
|
|
143
|
+
"html": {
|
|
144
|
+
"customData": [
|
|
145
|
+
"./docs/html.html-data.json"
|
|
146
|
+
]
|
|
147
|
+
},
|
|
148
|
+
"css": {
|
|
149
|
+
"customData": [
|
|
150
|
+
"./docs/css.css-data.json"
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
},
|
|
135
154
|
"type": "module",
|
|
136
155
|
"typesVersions": {
|
|
137
156
|
"*": {
|
|
@@ -140,5 +159,5 @@
|
|
|
140
159
|
]
|
|
141
160
|
}
|
|
142
161
|
},
|
|
143
|
-
"version": "0.9.
|
|
162
|
+
"version": "0.9.4"
|
|
144
163
|
}
|
|
@@ -92,6 +92,7 @@ declare const _default: typeof import("../index.js").CustomElement & import("../
|
|
|
92
92
|
_anchorAriaLabelledby: never;
|
|
93
93
|
_anchorHref: never;
|
|
94
94
|
iconVariation: () => string;
|
|
95
|
+
_customRippleState: never;
|
|
95
96
|
}, any[]>;
|
|
96
97
|
export default _default;
|
|
97
98
|
//# sourceMappingURL=NavBarItem.d.ts.map
|
|
@@ -92,6 +92,7 @@ declare const _default: typeof import("../index.js").CustomElement & import("../
|
|
|
92
92
|
_anchorAriaLabelledby: never;
|
|
93
93
|
_anchorHref: never;
|
|
94
94
|
iconVariation: () => string;
|
|
95
|
+
_customRippleState: never;
|
|
95
96
|
}, any[]>;
|
|
96
97
|
export default _default;
|
|
97
98
|
//# sourceMappingURL=NavDrawerItem.d.ts.map
|
|
@@ -92,6 +92,7 @@ declare const _default: typeof CustomElement & import("../core/CustomElement.js"
|
|
|
92
92
|
_anchorAriaLabelledby: never;
|
|
93
93
|
_anchorHref: never;
|
|
94
94
|
iconVariation: () => string;
|
|
95
|
+
_customRippleState: never;
|
|
95
96
|
}, any[]>;
|
|
96
97
|
export default _default;
|
|
97
98
|
export type DeprecatedHTMLAnchorElementProperties = "charset" | "coords" | "name" | "shape";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavItem.d.ts","sourceRoot":"","sources":["../../components/NavItem.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NavItem.d.ts","sourceRoot":"","sources":["../../components/NavItem.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oDAYc,SAAS,GAAC,QAAQ,GAAC,MAAM,GAAC,OAAO;0BAPrB,0BAA0B"}
|
|
@@ -92,6 +92,7 @@ declare const _default: typeof import("../index.js").CustomElement & import("../
|
|
|
92
92
|
_anchorAriaLabelledby: never;
|
|
93
93
|
_anchorHref: never;
|
|
94
94
|
iconVariation: () => string;
|
|
95
|
+
_customRippleState: never;
|
|
95
96
|
}, any[]>;
|
|
96
97
|
export default _default;
|
|
97
98
|
//# sourceMappingURL=NavRailItem.d.ts.map
|
package/types/core/observe.d.ts
CHANGED
|
@@ -62,8 +62,8 @@ export function parsePropertyValue(this: ObserverConfiguration<any, any, any, an
|
|
|
62
62
|
* @return {ObserverConfiguration<T1,T2,C,K>}
|
|
63
63
|
*/
|
|
64
64
|
export function defineObservableProperty<T1 extends ObserverPropertyType, T2 extends unknown, C extends Object, K extends keyof C & string>(object: C, key: K, options: ObserverOptions<T1, T2, C>): ObserverConfiguration<T1, T2, C, K>;
|
|
65
|
-
export type ObserverPropertyType = "string" | "boolean" | "map" | "set" | "float" | "integer" | "object" | "function" | "array";
|
|
66
|
-
export type ParsedObserverPropertyType<T extends ObserverPropertyType> = (T extends "boolean" ? boolean : T extends "string" ? string : T extends "float" | "integer" ? number : T extends "array" ? any[] : T extends "object" ? any : T extends "function" ? (...args: any) => any : unknown);
|
|
65
|
+
export type ObserverPropertyType = "string" | "boolean" | "map" | "set" | "float" | "integer" | "number" | "object" | "function" | "array";
|
|
66
|
+
export type ParsedObserverPropertyType<T extends ObserverPropertyType> = (T extends "boolean" ? boolean : T extends "string" ? string : T extends "float" | "integer" | "number" ? number : T extends "array" ? any[] : T extends "object" ? any : T extends "function" ? (...args: any) => any : unknown);
|
|
67
67
|
export type ObserverOptions<T1 extends ObserverPropertyType, T2 extends unknown, C extends Object = any> = {
|
|
68
68
|
type?: T1;
|
|
69
69
|
enumerable?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observe.d.ts","sourceRoot":"","sources":["../../core/observe.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"observe.d.ts","sourceRoot":"","sources":["../../core/observe.js"],"names":[],"mappings":"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"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
(()=>{var Pt,_t;function lt(){return(Pt??=new Text).cloneNode()}function F(){return(_t??=new Comment).cloneNode()}var D=class{constructor(t){this.anchorNode=t.anchorNode,this.metadata=[],this.keys=[],this.needsArrayKeyFastPath=!1,this.composition=t.composition,this.renderOptions=t.renderOptions,this.metadataCache=null,this.queuedElements=[],this.batchStartIndex=null,this.batchEndIndex=null}render(t,e){return this.composition.render(t,e,this.renderOptions)}startBatch(){this.needsArrayKeyFastPath=!0}writeBatch(){var e;if(!this.queuedElements.length)return;(((e=this.metadata[this.batchStartIndex-1])==null?void 0:e.domNode)??this.anchorNode).after(...this.queuedElements),this.queuedElements.length=0}stopBatch(){if(this.writeBatch(),this.needsArrayKeyFastPath=!1,this.batchStartIndex=null,this.batchEndIndex=null,this.metadataCache){for(let{domNode:t}of this.metadataCache.values())t.remove();this.metadataCache.clear()}}removeByIndex(t){let[e]=this.metadata.splice(t,1),{domNode:s,key:n}=e;this.keys.splice(t,1),s.remove(),this.metadataCache?this.metadataCache.set(n,e):this.metadataCache=new Map([[n,e]])}renderData(t,e,s,n,i,o){var h;if(t<this.metadata.length){let c=this.metadata[t],u=c.key,p=u===n,m=i!==n;if(p){m?c.render(e,s):o||c.render(e,s);return}let b=this.metadataCache??=new Map,g=!1;this.needsArrayKeyFastPath&&(g=!this.keys.includes(n),this.needsArrayFastPath=!1);let S=g?-1:this.keys.indexOf(n,t+1);if(S===-1){if(b.has(n)){let d=b.get(n);this.metadata.splice(t,0,d),this.keys.splice(t,0,n),(((h=this.metadata[t-1])==null?void 0:h.domNode)??this.anchorNode).after(d.domNode),b.delete(n);return}b.set(u,c)}else{if(t-S===-1){this.removeByIndex(t);return}let d=this.metadata[S];this.metadata[t]=d,this.metadata.splice(S,1);let{domNode:f}=c;f.replaceWith(d.domNode),o||d.render(e,s),this.keys[t]=n,this.keys.splice(S,1),f.remove(),b.set(u,c);return}}let a=this.render(e,s),l=a.target;this.metadata[t]={render:a,element:l,key:n,domNode:l},this.keys[t]=n,(this.batchEndIndex===null||this.batchEndIndex!==t-1)&&(this.writeBatch(),this.batchStartIndex=t),this.batchEndIndex=t,this.queuedElements.push(l)}removeEntries(t=0){let{length:e}=this.metadata;for(let s=e-1;s>=t;s--)this.metadata[s].domNode.remove();this.metadata.length=t,this.keys.length=t}hide(t,e,s){if(!e&&(t==null&&(t=this.keys.indexOf(s)),e=this.metadata[t],!e)||e.hidden)return!1;let{comment:n,element:i}=e;return n||(n=F(),e.comment=n),i.replaceWith(n),e.domNode=n,e.hidden=!0,!0}show(t,e,s){if(!e&&(t==null&&(t=this.keys.indexOf(s)),e=this.metadata[t],!e)||!e.hidden)return!1;let{comment:n,element:i}=e;return n.replaceWith(i),e.domNode=i,e.hidden=!1,!0}};var G=new Map;function V(r,t=!0){if(t&&G.has(r))return G.get(r);let e=new CSSStyleSheet;return e.replaceSync(r),t&&G.set(r,e),e}var X=new Map,ct;function At(r,t=!0){let e;return t&&X.has(r)?e=X.get(r):(ct??=document.implementation.createHTMLDocument(),e=ct.createElement("style"),e.textContent=r,t&&X.set(r,e)),e.cloneNode(!0)}var q;function ht(r,t=!0){if(q==null)try{let e=V(r,t);return q=!0,e}catch{q=!1}return q?V(r,t):At(r,t)}function*ut(r,t=!0){for(let e of r)e instanceof HTMLStyleElement?yield V(e.textContent,t):e.ownerNode?yield V([...e.cssRules].map(s=>s.cssText).join(""),t):yield e}var z=new WeakMap;function*dt(r,t=!0){for(let e of r)if(e instanceof HTMLStyleElement)yield e;else if(e.ownerNode instanceof HTMLStyleElement)yield e.ownerNode.cloneNode(!0);else if(t&&z.has(e))yield z.get(e).cloneNode(!0);else{let s=document.createElement("style");s.textContent=[...e.cssRules].map(n=>n.cssText).join(""),t&&z.set(e,s),yield s.cloneNode(!0)}}function ft(r,...t){return ht(typeof r=="string"?r:String.raw({raw:r},...t))}function gt(r){switch(r){case void 0:case null:case!1:return null;case!0:return"";default:return`${r}`}}var $;function j(r){if($??=new Map,$.has(r))return $.get(r);let t=r.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`);return $.set(r,t),t}var pt,Ot=Number.parseFloat((pt=navigator.userAgent.match(/Chrome\/([\d.]+)/))==null?void 0:pt[1]),mt,Gt=Number.parseFloat((mt=navigator.userAgent.match(/Firefox\/([\d.]+)/))==null?void 0:mt[1]),bt,Xt=Ot||!navigator.userAgent.includes("AppleWebKit")?Number.NaN:Number.parseFloat((bt=navigator.userAgent.match(/Version\/([\d.]+)/))==null?void 0:bt[1]);function Y(r,t){if(r===t)return r;if(r==null||t==null||typeof t!="object")return t;typeof r!="object"&&(r={});for(let[e,s]of Object.entries(t))s==null?e in r&&delete r[e]:r[e]=Y(r[e],s);return r}function H(r,t,e="reference"){if(r===t)return null;if(t==null||typeof t!="object")return t;if(r==null||typeof r!="object")return structuredClone(t);let s={};if(Array.isArray(t)){if(e==="reference")return t;if(e==="clone")return structuredClone(t);for(let[i,o]of t.entries()){if(o===null){s[i]=null;continue}if(o==null)continue;let a=H(r[i],o,e);a!==null&&(s[i]=a)}return t.length!==r.length&&(s.length=t.length),s}let n=new Set(Object.keys(r));for(let[i,o]of Object.entries(t)){if(n.delete(i),o===null){s[i]=null;continue}if(o==null)continue;let a=H(r[i],o,e);a!==null&&(s[i]=a)}for(let i of n)s[i]=null;return s}function Z(r,t){if(r===t)return!1;if(t==null||typeof t!="object"||r!=null&&typeof r!="object")return!0;for(let[e,s]of Object.entries(t))if(s==null){if(e in r)return!0}else if(Z(r[e],s))return!0;return!1}function yt(r){switch(r){case"boolean":return!1;case"integer":case"float":return 0;case"map":return new Map;case"set":return new Set;case"array":return[];case"object":return null;default:case"string":return""}}function tt(r,t,e,s){return r??={},new Proxy(r,{get(n,i){let o=n[i];if(typeof i!="symbol"){let a=s?`${s}.${i}`:i;if(s?e.add(a):t.add(a),typeof o=="object"&&o!=null)return tt(o,t,e,a)}return o},has(n,i){let o=Reflect.has(n,i);if(typeof i!="symbol"){let a=s?`${s}.p`:i;s?e.add(a):t.add(a)}return o}})}function Mt(r){switch(r){case"boolean":return t=>!!t;case"integer":return Math.round;case"float":return t=>+t;case"map":return Map;case"set":return Set;case"object":case"array":return t=>t;default:case"string":return t=>`${t}`}}function et(r,...t){let e=new Set,s=new Set,n=t.map(l=>{let h=new Set,c=new Set,u=tt(l,h,c);return{poked:h,pokedDeep:c,proxy:u}}),i=tt(this??{},e,s),o=r.apply(i,n.map(l=>l.proxy)),a=r.name?!0:!e.size;return{props:{this:[...e],args:n.map(l=>[...l.poked])},deepPropStrings:{this:[...s],args:n.map(l=>[...l.pokedDeep])},deepProps:{this:[...s].map(l=>l.split(".")),args:n.map(l=>[...l.pokedDeep].map(h=>h.split(".")))},defaultValue:o,reusable:a}}function Tt(){return null}function Ft(r,t,e){let s=typeof t=="string"?{type:t}:t,{watchers:n,value:i,readonly:o,empty:a,type:l,enumerable:h,reflect:c,attr:u,nullable:p,parser:m,nullParser:b,get:g,is:S,diff:d,props:f}=s;if(n??=[],o??=!1,a===void 0&&(a=null),i??=a,g&&!f){let E=et(g.bind(e),e,()=>i);i??=E.defaultValue,f=new Set([...E.props.this,...E.props.args[0]])}if(!l)if(i==null)l="string";else{let E=typeof i;l=E==="number"?Number.isInteger(i)?"integer":"number":E}return h??=r[0]!=="_",p??=l==="boolean"?!1:a==null,p||(a??=yt(l),i??=a),c??=h?l!=="object":u?"write":!1,u??=c?j(r):null,m??=Mt(l),b||(p?b=Tt:b=a===null?()=>yt(l):()=>a),S??=l==="object"?(E,N)=>!Z(E,N):l==="array"?()=>!1:Object.is,d===void 0&&(d=l==="object"?(E,N)=>H(E,N,"reference"):null),{...s,type:l,is:S,diff:d,attr:u,reflect:c,readonly:o,enumerable:h,value:i,parser:m,nullParser:b,key:r,props:f,watchers:n}}function J(r,t,e){var i,o;r.get;let s=e==null?r.nullParser.call(this,e):r.parser.call(this,e),n=s;if(t==null){if(s==null)return!1}else if(s!=null){if(r.diff){if(n=r.diff.call(this,t,s),n==null)return!1}else if(r.is.call(this,t,s))return!1}return r.values?r.values.set(this,s):r.values=new WeakMap([[this,s]]),(i=r.propChangedCallback)==null||i.call(this,r.key,t,s,n),(o=r.changedCallback)==null||o.call(this,t,s,n),!0}function st(r,t,e){let s=Ft(t,e,r);function n(){var c;return(c=s.values)!=null&&c.has(this)?s.values.get(this):s.value}function i(c){let u=this[t];J.call(this,s,u,c)}function o(){var p,m;let c=(p=s.computedValues)==null?void 0:p.get(this),u=this[t];(m=s.needsSelfInvalidation)==null||m.delete(this),J.call(this,s,c,u)}if(s.props)for(let c of s.props)s.watchers.push([c,o]);function a(){let c=s.get.call(this,this,n.bind(this));return(s.computedValues??=new WeakMap).set(this,c),c}function l(c){s.needsSelfInvalidation?s.needsSelfInvalidation.add(this):s.needsSelfInvalidation=new WeakSet([this]);let u=this[t];s.set.call(this,c,i.bind(this));let p=this[t];s.needsSelfInvalidation.has(this)&&(s.needsSelfInvalidation.delete(this),J.call(this,s,u,p))}let h={enumerable:s.enumerable,configurable:!0,get:s.get?a:n,set:s.set?l:i};return Object.defineProperty(r,t,h),s}var Ct=new Set;function U(r="mdw_",t=4){let e;for(;Ct.has(e=Math.random().toString(36).slice(2,t+2)););return Ct.add(e),`${r}${e}`}var nt,St,xt;function B(r){return nt??=document.implementation.createHTMLDocument(),r?(xt??=nt.createRange(),xt.createContextualFragment(r)):(St??=nt.createDocumentFragment(),St.cloneNode())}var K=new Map;function rt(r){let t=`#${U()}`;return K.set(t,{fn:r}),`{${t}}`}var it=new Map;function ot(r,...t){let e,s=t.map(o=>{switch(typeof o){case"string":return o;case"function":return rt(o);case"object":{if(o==null)return"";let a=U();return e??=new Map,e.set(a,o),`<div id="${a}"></div>`}default:throw new Error(`Unexpected substitution: ${o}`)}}),n=String.raw({raw:r},...s);if(e){let o=B(n);for(let[a,l]of e)o.getElementById(a).replaceWith(l);return o}let i;return it.has(n)?i=it.get(n):(i=B(n),it.set(n,i)),i.cloneNode(!0)}function jt({nodes:r},t){let{nodeIndex:e,attrName:s}=this,n=r[e];switch(t){case void 0:case null:case!1:return n.removeAttribute(s),!1;case!0:return n.setAttribute(s,""),"";default:return n.setAttribute(s,t),t}}function Bt({nodeStates:r,comments:t,nodes:e},s){let{commentIndex:n,nodeIndex:i}=this,o=r[i],a=o&1;if(!(s!=null&&s!==!1)){if(a)return;let u=t[n];u||(u=F(),t[n]=u),e[i].replaceWith(u),r[i]|=1;return}let h=e[i],c=o&2;if(typeof s!="object")if(c){let u=new Text(s);h.replaceWith(u),e[i]=u,r[i]&=-3}else h.data=s;a&&(t[n].replaceWith(h),r[i]&=-2)}function Rt({nodeStates:r,nodes:t,comments:e},s){let{commentIndex:n,nodeIndex:i}=this,o=r[i]&1,a=s!=null&&s!==!1;if(a===!o)return;let l=t[i],h=e[n];h||(h=F(),e[n]=h),a?(h.replaceWith(l),r[i]&=-2):(l.replaceWith(h),r[i]|=1)}function Lt({comments:r,nodeStates:t,nodes:e}){let{commentIndex:s,nodeIndex:n}=this,i=F();r[s]=i,t[n]|=1,e[n].replaceWith(i)}function at(r,...t){let[{caches:e,searchStates:s}]=t,{cacheIndex:n,searchIndex:i,subSearch:o,invocation:a}=r,l=e[n],h=s[i];if(h&1)return{value:l,dirty:(h&2)===2};s[i]|=1;let c;if(a){if(o){let u=at(o,...t);if(!u.dirty&&l!==void 0)return s[i]&=-3,{value:l,dirty:!1};c=r.invocation(u.value)}else c=r.invocation(...t);if(c===void 0||l===c)return{value:c,dirty:!1}}return e[n]=c,s[i]|=2,{value:c,dirty:!0}}function wt({options:{context:r,store:t,injections:e}},s,n){return this.expression.call(r,t??n,e)}function Wt(r,t){return t[this.prop]}function Dt(r,t,e){let s=t;for(let n of this.deepProp){if(s===null)return null;if(!(n in s))return;s=s[n]}return s}var Ut=/{([^}]*)}/g;function qt(r,t){if(t)return t[r]}function Et(r,t){if(!t)return;let e=t,s;for(s of r)if(typeof e=="object"){if(e===null)return null;if(!(s in e))return;e=e[s]}else return e[s];return e}function Vt(r,t){let e=t;for(let s of r.split("."))if(!s||(e=e[s],e==null))return null;return e===t?null:e}var Nt=new Map,R=class r{static EVENT_PREFIX_REGEX=/^([*1~]+)?(.*)$/;_interpolationState={nodeIndex:-1,searchIndex:0,cacheIndex:0,commentIndex:0,nodeEntry:null};static shadowRootTag=Symbol();nodesToBind=[];props=[];searches=[];initCache=[];searchByQuery;actionsByPropsUsed;postInitActions=[];tagsWithBindings;tags=[];adapter;events;cloneable;styles=[];adoptedStyleSheets=[];stylesFragment;allIds=[];temporaryIds;interpolated=!1;constructor(...t){this.template=B(),this.append(...t)}*[Symbol.iterator](){for(let t of this.styles)yield t;yield this.template}static compose(...t){for(let[s,n]of Nt)if(s.length===t.length&&t.every((i,o)=>i===s[o]))return n;let e=new r(...t);return Nt.set(t,e),e}append(...t){for(let e of t)typeof e=="string"?this.append(B(e.trim())):e instanceof r?this.append(...e):e instanceof DocumentFragment?this.template.append(e):(e instanceof CSSStyleSheet||e instanceof HTMLStyleElement)&&this.styles.push(e);return this}addCompositionEventListener(t){let e=t.tag??"",s=this.events??=new Map;return s.has(e)?s.get(e).push(t):s.set(e,[t]),this}#n(t,e,s){var n;if((n=this.events)!=null&&n.has(t))for(let i of this.events.get(t)){let o;i.handleEvent?o=i.handleEvent:i.deepProp.length?o=Et(i.deepProp,this.interpolateOptions.defaults):o=qt(i.prop,this.interpolateOptions.defaults),e.addEventListener(i.type,s?o.bind(s):o,i)}}render(t,e,s={}){this.interpolated||this.interpolate({defaults:e??t,...s});let n=this.cloneable.cloneNode(!0),i=s.shadowRoot,o=i??s.target??n.firstElementChild,a={lastChildNode:null,lastChildNodeIndex:0,lastElement:null,nodeStates:new Uint8Array(this._interpolationState.nodeIndex+1),searchStates:new Uint8Array(this._interpolationState.searchIndex),comments:[],nodes:[],caches:this.initCache.slice(),refs:[],options:s},{nodes:l,refs:h,searchStates:c,caches:u}=a;for(let{tag:m,textNodes:b}of this.nodesToBind){let g;if(m===""){if(!b.length)continue;h.push(null),l.push(null),g=n.firstChild}else{let d=n.getElementById(m);if(h.push(d),l.push(d),this.#n(m,d,s.context),!b.length)continue;g=d.firstChild}let S=0;for(let d of b){for(;d!==S;)g=g.nextSibling,S++;l.push(g)}}this.#n("",s.context),this.#n(r.shadowRootTag,s.context.shadowRoot,s.context);for(let m of this.postInitActions)m.invocation(a);let p=(m,b)=>{var S;let g=!1;for(let d of this.props){if(!((S=this.actionsByPropsUsed)!=null&&S.has(d))||!(d in m))continue;let f=this.actionsByPropsUsed.get(d);for(let E of f){g=!0;let{dirty:N,value:P}=at(E.search,a,m,b);N&&E.invocation(a,P,m,b)}}g&&c.fill(0)};return i?(s.context??=i.host,"adoptedStyleSheets"in i?this.adoptedStyleSheets.length&&(i.adoptedStyleSheets=[...i.adoptedStyleSheets,...this.adoptedStyleSheets]):this.stylesFragment.hasChildNodes()&&n.prepend(this.stylesFragment.cloneNode(!0))):s.context??=o,t!==this.interpolateOptions.defaults&&p(t,e),i&&(i.append(n),customElements.upgrade(i)),p.target=o,p.byProp=(m,b,g)=>{var E,N;if(!((E=this.actionsByPropsUsed)!=null&&E.has(m)))return;let S=!1;if((N=this.searchByQuery)!=null&&N.has(m)){S=!0;let P=this.searchByQuery.get(m);if(u[P.cacheIndex]===b)return;u[P.cacheIndex]=b,c[P.searchIndex]=3}let d,f=this.actionsByPropsUsed.get(m);for(let P of f)if(P.search.query===m)P.invocation(a,b);else{d??={[m]:b},g??=d,S=!0;let _=at(P.search,a,d,g);_.dirty&&P.invocation(a,_.value,d,g)}S&&c.fill(0)},p.state=a,p}#s(t,e,s,n){var _,T;let{nodeValue:i,nodeName:o,nodeType:a}=t,l,h;if(a===Node.ATTRIBUTE_NODE?l=t:h=t,n==null){if(!i)return;let y=i.trim();if(!y)return;if(l||(e==null?void 0:e.tagName)==="STYLE"){if(y[0]!=="{")return;let{length:I}=y;if(y[I-1]!=="}")return;n=y.slice(1,-1)}else{let I=y.split(Ut);if(I.length<3)return;if(I.length===3&&!I[0]&&!I[2])n=I[1];else{for(let[C,k]of I.entries())if(C%2){let x=lt();h.before(x),this.#s(x,e,s,k)}else k&&h.before(k);return!0}}}let c=n,u=n[0]==="!",p=!1;u&&(n=n.slice(1),p=n[0]==="!",p&&(n=n.slice(1)));let m,b;if(h){e!==h.parentElement&&(e=h.parentElement),b=0;let y=h;for(;y=y.previousSibling;)b++}else if(e!==l.ownerElement&&(e=l.ownerElement),o.startsWith("on")){let y=o.indexOf("-");if(y===-1)return;m=y===2}if(m){e.removeAttribute(o);let y=this.#e(e),I=o.slice(3),[,C,k]=I.match(/^([*1~]+)?(.*)$/),x,v,w=[];if(n.startsWith("#"))x=K.get(n).fn;else{let O=n.split(".");O.length===1?(v=n,w=[]):(v=O[0],w=O)}this.addCompositionEventListener({tag:y,type:k,handleEvent:x,prop:v,deepProp:w,once:C==null?void 0:C.includes("1"),passive:C==null?void 0:C.includes("~"),capture:C==null?void 0:C.includes("*")});return}let g;if((_=this.searchByQuery)!=null&&_.has(c))g=this.searchByQuery.get(c);else{let y=n,I=y!==c,C;if(I&&((T=this.searchByQuery)!=null&&T.has(y)))C=this.searchByQuery.get(y);else{let k,x,v,w,O,L,W,A;if(n.startsWith("#")){if(A=K.get(n),!A)return;k=A.fn,W=wt,A.props?(x=A.props,v=A.deepProps,w=A.defaultValue??null):w=A.fn}else w=null,s!=null&&s.defaults&&(w=Et(n.split("."),s.defaults)??null),w==null&&(s!=null&&s.injections)&&(w=Vt(n,s.injections));if(!x)if(typeof w=="function"){let M=et.call(this,w,s==null?void 0:s.defaults,s==null?void 0:s.injections),It=new Set([...M.props.this,...M.props.args[0],...M.props.args[1]]),vt=new Set([...M.deepPropStrings.this,...M.deepPropStrings.args[0]]);k=w,w=M.defaultValue,x=[...It],v=[...vt].map(kt=>kt.split(".")),W=wt}else{let M=n.split(".");M.length===1?(O=n,x=[O],W=Wt):(x=[M[0]],L=M,v=[M],W=Dt)}A&&(A.defaultValue=w,A.props=x,A.deepProps=v),C={cacheIndex:this._interpolationState.cacheIndex++,searchIndex:this._interpolationState.searchIndex++,query:y,defaultValue:w,subSearch:null,prop:O,propsUsed:x,deepProp:L,deepPropsUsed:v,invocation:W,expression:k},this.addSearch(C)}I?(g={cacheIndex:this._interpolationState.cacheIndex++,searchIndex:this._interpolationState.searchIndex++,query:c,subSearch:C,negate:u,doubleNegate:p,prop:C.prop,deepProp:C.deepProp,propsUsed:C.propsUsed,deepPropsUsed:C.deepPropsUsed,defaultValue:p?!!C.defaultValue:u?!C.defaultValue:C.defaultValue,invocation(k){return this.doubleNegate?!!k:this.negate?!k:k}},this.addSearch(g)):g=C}let S,d=null,f=g.defaultValue;h?d=b:o==="mdw-if"?(S=this.#e(e),e.removeAttribute(o),f=f!=null&&f!==!1):(d=o,o==="id"||f==null||f===!1?e.removeAttribute(o):e.setAttribute(o,f===!0?"":f)),S??=this.#e(e);let E=this._interpolationState.nodeEntry;(!E||E.tag!==S)&&(E={tag:S,textNodes:[]},this._interpolationState.nodeEntry=E,this.nodesToBind.push(E),this._interpolationState.nodeIndex++);let N;if(h)switch(E.textNodes.push(b),this._interpolationState.nodeIndex++,N={nodeIndex:this._interpolationState.nodeIndex,commentIndex:this._interpolationState.commentIndex++,invocation:Bt,defaultValue:f,search:g},typeof f){case"string":h.data=f;break;case"number":h.data=`${f}`;break;default:h.data="";break}else d?N={nodeIndex:this._interpolationState.nodeIndex,attrName:d,defaultValue:f,invocation:jt,search:g}:(N={nodeIndex:this._interpolationState.nodeIndex,commentIndex:this._interpolationState.commentIndex++,defaultValue:f,invocation:Rt,search:g},f||this.postInitActions.push({...N,invocation:Lt}));this.addAction(N),(this.tagsWithBindings??=new Set).add(S)}#e(t){if(!t)return"";let e=t.id;return e?this.allIds.includes(e)||this.allIds.push(e):(e=U(),(this.temporaryIds??=new Set).add(e),this.allIds.push(e),t.id=e),e}#t(t,e){let s=t.getAttribute("mdw-for"),n=s==null?void 0:s.trim();if(!n||n[0]!=="{")return null;let{length:i}=n;if(n[i-1]!=="}")return null;let o=n.slice(1,-1),[a,l]=o.split(/\s+of\s+/);t.removeAttribute("mdw-for");let h=t.ownerDocument.createElement("template");t.replaceWith(h);let c=this.#e(h),u=this._interpolationState.nodeEntry;(!u||u.tag!==c)&&(u={tag:c,textNodes:[]},this._interpolationState.nodeEntry=u,this.nodesToBind.push(u),this._interpolationState.nodeIndex++);let p=new r;p.template.append(t);let m={...e.injections,[a]:null,index:null},b=[l],g={cacheIndex:this._interpolationState.cacheIndex++,searchIndex:this._interpolationState.searchIndex++,query:null,prop:null,deepProp:null,propsUsed:b,deepPropsUsed:[[l]],defaultValue:{},invocation:null},S={defaultValue:null,nodeIndex:this._interpolationState.nodeIndex,search:g,commentIndex:this._interpolationState.commentIndex++,injections:m,invocation(f,E,N,P){if(!p.adapter){let x=f.nodes[this.nodeIndex],v=F();f.comments[this.commentIndex]=v,x.replaceWith(v),p.adapter=new D({anchorNode:v,composition:p,renderOptions:{target:null,context:f.options.context,store:f.options.store,injections:this.injections}})}let{adapter:_}=p,T=(P??f.options.store)[l];if(!T||T.length===0){_.removeEntries();return}let y=N[l],I={...N},C=p.props.some(x=>x!==l&&x in N);_.startBatch();let k;if(!C&&!(k=Array.isArray(y))){let x=k?y.entries():Object.entries(y);for(let[v,w]of x){if(v==="length"||w===null)continue;let O=+v,L=T[O];I[a]=w,this.injections[a]=L,this.injections.index=O,_.renderData(O,I,P,L,w)}}else{y||delete I[a];for(let[x,v]of T.entries()){let w;if(y){if(!C&&!(x in y)||(w=y[x],w===null))continue;I[a]=w}this.injections[a]=v,this.injections.index=x,_.renderData(x,I,P,v,w)}}_.stopBatch(),_.removeEntries(T.length)}};return p.interpolate({defaults:e.defaults,injections:m}),b.push(...p.props),this.addSearch(g),this.addAction(S),(this.tagsWithBindings??=new Set).add(c),p}interpolate(t){var i;this.interpolateOptions=t,this.cloneable=this.template.cloneNode(!0);let s=document.createTreeWalker(this.cloneable,5),n=s.nextNode();for(;n;){let o=null;switch(n.nodeType){case Node.ELEMENT_NODE:if(o=n,o.tagName==="TEMPLATE"){for(;o.contains(n=s.nextNode()););continue}if(o.tagName==="SCRIPT"){for(;o.contains(n=s.nextNode()););continue}if(o.hasAttribute("mdw-for")){for(;o.contains(n=s.nextNode()););this.#t(o,t);continue}else{let a=o.attributes.id;a&&(this.#s(a,o,t),this.#e(o));for(let l of[...o.attributes].reverse())l.nodeName!=="id"&&this.#s(l,o,t)}break;case Node.TEXT_NODE:if(o=n.parentElement,this.#s(n,o,t)){let a=s.nextNode();n.remove(),n=a;continue}break;default:throw new Error(`Unexpected node type: ${n.nodeType}`)}n=s.nextNode()}"adoptedStyleSheets"in document?this.adoptedStyleSheets=[...ut(this.styles)]:(this.stylesFragment=B(),this.stylesFragment.append(...dt(this.styles))),this.props=this.actionsByPropsUsed?[...this.actionsByPropsUsed.keys()]:[];for(let o of this.allIds)(i=this.tagsWithBindings)!=null&&i.has(o)||this.nodesToBind.push({tag:o,textNodes:[]});this.tags=this.nodesToBind.map(o=>o.tag),this.interpolated=!0}addSearch(t){return this.searches.push(t),t.query&&((this.searchByQuery??=new Map).set(t.query,t),this.initCache[t.cacheIndex]=t.defaultValue),t}addAction(t){let e=this.actionsByPropsUsed??=new Map;for(let s of t.search.propsUsed)e.has(s)?e.get(s).push(t):e.set(s,[t]);return t}};function ge(r,t){return(e,s,n)=>{s==null?n.refs[t].removeAttribute(r):n.refs[t].setAttribute(r,s)}}var Q=class r extends HTMLElement{static elementName;static get observedAttributes(){return this.attrList.keys()}compose(){return this.#t??=new R}static _composition=null;static _props=new Map;static _attrs=new Map;static _propChangedCallbacks=new Map;static _attributeChangedCallbacks=new Map;static _onComposeCallbacks=[];static _onConnectedCallbacks=[];static _onDisconnectedCallbacks=[];static _onConstructedCallbacks=[];static interpolatesTemplate=!0;static supportsElementInternals="attachInternals"in HTMLElement.prototype;static supportsElementInternalsRole=r.supportsElementInternals&&"role"in ElementInternals.prototype;static templatable=null;static defined=!1;static autoRegistration=!0;static registrations=new Map;static expressions=this.set;static methods=this.set;static overrides=this.set;static props=this.observe;static idl=this.prop;static _addCallback(t,e){if(!this.hasOwnProperty(t)){this[t]=[...this[t],e];return}this[t].push(e)}static append(...t){return this._onComposeCallbacks.push(({composition:e})=>{e.append(...t)}),this._addCallback("_onComposeCallbacks",(e=>{let{composition:s}=e;s.append(...t)})),this}static recompose(t){return this._addCallback("_onComposeCallbacks",t),this}static css(t,...e){return this._addCallback("_onComposeCallbacks",(s=>{let{composition:n}=s;typeof t=="string"||Array.isArray(t)?n.append(ft(t,...e)):n.append(t,...e)})),this}static autoRegister(t){return this.hasOwnProperty("defined")&&this.defined?this:(this.register(t),this)}static html(t,...e){return this._addCallback("_onComposeCallbacks",(s=>{let{composition:n}=s;n.append(ot(t,...e))})),this}static extend(t){return t?t(this):class extends this{}}static setStatic(t){return Object.assign(this,t),this}static readonly(t,e){return this.set(t,{...e,writable:!1})}static set(t,e){return Object.defineProperties(this.prototype,Object.fromEntries([...Object.entries(t).map(([s,n])=>(this.undefine(s),[s,{enumerable:s[0]!=="_",configurable:!0,value:n,writable:!0,...e}])),...Object.getOwnPropertySymbols(t).map(s=>[s,{enumerable:!1,configurable:!0,value:t[s],writable:!0,...e}])])),this}static mixin(t){return t(this)}static register(t){return t&&(this.elementName=t),customElements.define(this.elementName,this),r.registrations.set(this.elementName,this),this.defined=!0,this}static get propList(){return this.hasOwnProperty("_props")||(this._props=new Map(this._props)),this._props}static get attrList(){return this.hasOwnProperty("_attrs")||(this._attrs=new Map(this._attrs)),this._attrs}static get propChangedCallbacks(){return this.hasOwnProperty("_propChangedCallbacks")||(this._propChangedCallbacks=new Map([...this._propChangedCallbacks].map(([t,e])=>[t,e.slice()]))),this._propChangedCallbacks}static get attributeChangedCallbacks(){return this.hasOwnProperty("_attributeChangedCallbacks")||(this._attributeChangedCallbacks=new Map([...this._attributeChangedCallbacks].map(([t,e])=>[t,e.slice()]))),this._attributeChangedCallbacks}static prop(t,e){let s=st(this.prototype,t,e),{changedCallback:n,attr:i,reflect:o,watchers:a}=s;return n&&a.push([t,n]),s.changedCallback=function(h,c,u){this._onObserverPropertyChanged.call(this,t,h,c,u)},this.propList.set(t,s),i&&(o===!0||o==="read")&&(s.enumerable||!this.attrList.has(i)||!this.attrList.get(i).enumerable)&&this.attrList.set(i,s),this.onPropChanged(a),this}static define(t){return Object.defineProperties(this.prototype,Object.fromEntries(Object.entries(t).map(([e,s])=>(this.undefine(e),[e,{enumerable:e[0]!=="_",configurable:!0,...typeof s=="function"?{get:s}:s}])))),this}static undefine(t){if(Reflect.deleteProperty(this.prototype,t),this.propList.has(t)){let{watchers:e,attr:s,reflect:n}=this.propList.get(t);if(e.length&&this.propChangedCallbacks.has(t)){let i=this.propChangedCallbacks.get(t);for(let[o,a]of e){let l=i.indexOf(a);l!==-1&&i.splice(l,1)}}s&&(n===!0||n==="read")&&this.attrList.delete(s),this.propList.delete(t)}return this}static observe(t){for(let[e,s]of Object.entries(t??{})){let n=typeof s=="function"?{reflect:!1,get:s}:s;this.prop(e,n)}return this}static defineStatic(t){for(let[e,s]of Object.entries(t??{}))st(this,e,{reflect:!1,...typeof s=="function"?{get:s}:typeof s=="string"?{type:s}:s});return this}static events(t,e){return this.on({composed({composition:s}){for(let[n,i]of Object.entries(t)){let[,o,a]=n.match(/^([*1~]+)?(.*)$/),l,h=[];if(typeof i=="string"){let c=i.split(".");c.length===1?(l=i,h=[]):(l=c[0],h=c)}s.addCompositionEventListener({type:a,once:o==null?void 0:o.includes("1"),passive:o==null?void 0:o.includes("~"),capture:o==null?void 0:o.includes("*"),...typeof i=="function"?{handleEvent:i}:typeof i=="string"?{prop:l,deepProp:h}:i,...e})}}}),this}static childEvents(t,e){for(let[s,n]of Object.entries(t))this.events(n,{tag:j(s),...e});return this}static rootEvents(t,e){return this.events(t,{tag:R.shadowRootTag,...e})}static on(t,e){let s=typeof t=="string"?{[t]:e}:t;for(let[n,i]of Object.entries(s)){let o;switch(n){case"composed":o="_onComposeCallbacks";break;case"constructed":o="_onConstructedCallbacks";break;case"connected":o="_onConnectedCallbacks";break;case"disconnected":o="_onDisconnectedCallbacks";break;case"props":this.onPropChanged(i);continue;case"attrs":this.onAttributeChanged(i);continue;default:if(n.endsWith("Changed")){let a=n.slice(0,n.length-7);this.onPropChanged({[a]:i});continue}throw new Error("Invalid callback name")}this._addCallback(o,i)}return this}static onPropChanged(t){let e=Array.isArray(t)?t:Object.entries(t),{propChangedCallbacks:s}=this;for(let[n,i]of e)s.has(n)?s.get(n).push(i):s.set(n,[i]);return this}static onAttributeChanged(t){let e=Array.isArray(t)?t:Object.entries(t),{attributeChangedCallbacks:s}=this;for(let[n,i]of e)s.has(n)?s.get(n).push(i):s.set(n,[i]);return this}#n;#s=new Map;#e=new Map;#t;#r=!1;#i=[];_propAttributeCache;_callbackArguments=null;constructor(...t){super(),r.supportsElementInternals&&(this.elementInternals=this.attachInternals()),this.attachShadow({mode:"open",delegatesFocus:this.delegatesFocus}),this.render=this.composition.render(this.constructor.prototype,this,{defaults:this.constructor.prototype,store:this,shadowRoot:this.shadowRoot,context:this});for(let e of this.static._onConstructedCallbacks)e.call(this,this.callbackArguments)}propChangedCallback(t,e,s,n=s){this.#r?this.#i.push([t,n,this]):this.render.byProp(t,n,this);let{_propChangedCallbacks:i}=this.static;if(i.has(t))for(let o of i.get(t))o.call(this,e,s,n,this)}attributeChangedCallback(t,e,s){let{attributeChangedCallbacks:n}=this.static;if(n.has(t))for(let c of n.get(t))c.call(this,e,s,this);let{attrList:i}=this.static;if(!i.has(t))return;let o=i.get(t);if(o.attributeChangedCallback){o.attributeChangedCallback.call(this,t,e,s);return}let a;if(this.attributeCache.has(t)&&(a=this.attributeCache.get(t),a.stringValue===s))return;let l=this[o.key],h=s===null?o.nullParser(s):o.type==="boolean"?!0:o.parser(s);h!==l&&(a?(a.stringValue=s,a.parsedValue=h):this.attributeCache.set(t,{stringValue:s,parsedValue:h}),this[o.key]=h)}get#o(){var t;return(t=this.#t)==null?void 0:t.template}_onObserverPropertyChanged(t,e,s,n){let{propList:i}=this.static;if(i.has(t)){let{reflect:o,attr:a}=i.get(t);if(a&&(o===!0||o==="write")){let l,h=!1,{attributeCache:c}=this;if(c.has(a)?(l=c.get(a),h=l.parsedValue!==s):(l={},c.set(a,l),h=!0),h){let u=gt(s);l.parsedValue=s,l.stringValue=u,u==null?this.removeAttribute(a):this.setAttribute(a,u)}}}this.propChangedCallback(t,e,s,n)}patch(t){this.#r=!0,Y(this,t);for(let[e,s,n]of this.#i)e in t||this.render.byProp(e,s,n);this.#i.slice(0,this.#i.length),this.render(t),this.#r=!1}get refs(){return this.#n??=new Proxy({},{get:(t,e)=>{this.#t;let s=this.composition,n;if(!s.interpolated){if(this.#e.has(e)&&(n=this.#e.get(e).deref(),n))return n;let a=j(e);return n=s.template.getElementById(a),n?(this.#e.set(e,new WeakRef(n)),n):null}if(this.#s.has(e)&&(n=this.#s.get(e).deref(),n))return n;let i=j(e),o=this.composition.tags.indexOf(i);return n=this.render.state.refs[o],n?(this.#s.set(e,new WeakRef(n)),n):null}})}get attributeCache(){return this._propAttributeCache??=new Map}get static(){return this.constructor}get unique(){return!1}get callbackArguments(){return this._callbackArguments??={composition:this.#t,refs:this.refs,html:ot.bind(this),inline:rt,template:this.#o,element:this}}get composition(){if(this.#t)return this.#t;if(!this.unique&&this.static.hasOwnProperty("_composition"))return this.#t=this.static._composition,this.static._composition;this.compose();for(let t of this.static._onComposeCallbacks)t.call(this,this.callbackArguments);return this.unique||(this.static._composition=this.#t),this.#t}connectedCallback(){for(let t of this.static._onConnectedCallbacks)t.call(this,this.callbackArguments)}disconnectedCallback(){for(let t of this.static._onDisconnectedCallbacks)t.call(this,this.callbackArguments)}};Q.prototype.delegatesFocus=!1;})();
|
|
2
|
-
//# sourceMappingURL=CustomElement.min.js.map
|