mancha 0.18.5 → 0.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.d.ts +11 -4
- package/dist/browser.js +3 -3
- package/dist/browser.js.map +1 -1
- package/dist/css_gen_basic.js +74 -16
- package/dist/css_gen_basic.js.map +1 -1
- package/dist/css_gen_minimal.d.ts +2 -0
- package/dist/css_gen_minimal.js +22 -0
- package/dist/css_gen_minimal.js.map +1 -0
- package/dist/mancha.js +24 -24
- package/docs/css.md +15 -3
- package/docs/quickstart.md +1 -1
- package/package.json +1 -1
- package/scripts/generate-css-docs.ts +15 -3
package/dist/browser.d.ts
CHANGED
|
@@ -4,9 +4,12 @@ import { SafeStyleSheet } from "safevalues";
|
|
|
4
4
|
//#region src/css_gen_basic.d.ts
|
|
5
5
|
declare function rules(): SafeStyleSheet;
|
|
6
6
|
//#endregion
|
|
7
|
+
//#region src/css_gen_minimal.d.ts
|
|
8
|
+
declare function rules$1(): SafeStyleSheet;
|
|
9
|
+
//#endregion
|
|
7
10
|
//#region src/css_gen_utils.d.ts
|
|
8
11
|
|
|
9
|
-
declare function rules$
|
|
12
|
+
declare function rules$2(): string;
|
|
10
13
|
//#endregion
|
|
11
14
|
//#region src/browser.d.ts
|
|
12
15
|
declare class Renderer<T extends StoreState = StoreState> extends IRenderer<T> {
|
|
@@ -21,12 +24,16 @@ declare class Renderer<T extends StoreState = StoreState> extends IRenderer<T> {
|
|
|
21
24
|
}
|
|
22
25
|
declare const Mancha: Renderer<StoreState>;
|
|
23
26
|
/** Options for CSS injection. */
|
|
24
|
-
type CssName = "
|
|
27
|
+
type CssName = "minimal" | "utils" | "basic";
|
|
25
28
|
/**
|
|
26
29
|
* Injects CSS rules into the document head.
|
|
27
|
-
* @param names - Array of CSS names to inject ("
|
|
30
|
+
* @param names - Array of CSS names to inject ("minimal", "utils", "basic").
|
|
28
31
|
*/
|
|
29
32
|
declare function injectCss(names: CssName[]): void;
|
|
33
|
+
/**
|
|
34
|
+
* Injects the minimal CSS rules into the document head.
|
|
35
|
+
*/
|
|
36
|
+
declare function injectMinimalCss(): void;
|
|
30
37
|
/**
|
|
31
38
|
* Injects the basic CSS rules into the document head.
|
|
32
39
|
*/
|
|
@@ -57,4 +64,4 @@ interface InitManchaOptions {
|
|
|
57
64
|
*/
|
|
58
65
|
declare function initMancha<T extends StoreState = StoreState>(options?: InitManchaOptions): Promise<Renderer<T>>;
|
|
59
66
|
//#endregion
|
|
60
|
-
export { CssName, IRenderer, InitManchaOptions, Mancha, type ParserParams, type RenderParams, Renderer, type RendererPlugin, rules as basicCssRules, initMancha, injectBasicCss, injectCss, injectUtilsCss, rules$1 as utilsCssRules };
|
|
67
|
+
export { CssName, IRenderer, InitManchaOptions, Mancha, type ParserParams, type RenderParams, Renderer, type RendererPlugin, rules as basicCssRules, initMancha, injectBasicCss, injectCss, injectMinimalCss, injectUtilsCss, rules$1 as minimalCssRules, rules$2 as utilsCssRules };
|
package/dist/browser.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,t}from"./renderer-B3R6_o-2.js";import{safeStyleEl as n}from"safevalues/dom";import{concatStyleSheets as r,safeStyleSheet as i}from"safevalues";function a(){return r([i`html{`,i`max-width: 70ch;`,i`padding: 2em 1em;`,i`margin: auto;`,i`line-height: 1.75;`,i`font-size: 1.25em;`,i`font-family: sans-serif;`,i`}`,i`h1,h2,h3,h4,h5,h6{`,i`margin: 1em 0 0.5em;`,i`}`,i`p,ul,ol{`,i`margin-bottom: 1em;`,i`color: #1d1d1d;`,i`}`])}const o={sm:640,md:768,lg:1024,xl:1280},s=Object.entries(o),c=.25,l=[...Array(15)].map((e,t)=>t+1),u=[16,20,24,25,28,30,32,36,40,44,48,50,52,56,60],d=[64,72,80,96,100,112,128,144,160,192,200,224,256,288,300,320,384,400,448,500,512],f=[...l,...u,...d,...Object.values(o)],p=Array.from({length:100},(e,t)=>t+1),m=[25,50,75,100,150,200,300,500,700,1e3],h=[`hover`,`focus`,`disabled`,`active`],g={margin:`m`,padding:`p`},_={width:`w`,height:`h`},v={top:`top`,right:`right`,bottom:`bottom`,left:`left`},y={"min-width":`min-w`,"min-height":`min-h`,"max-width":`max-w`,"max-height":`max-h`},b={"font-mono":{"font-family":`monospace`},"font-sans":{"font-family":`sans-serif`},"font-serif":{"font-family":`serif`},"font-cursive":{"font-family":`cursive`},"text-xs":{"font-size":`.75rem`,"line-height":`calc(1 / 0.75)`},"text-sm":{"font-size":`.875rem`,"line-height":`calc(1.25 / 0.875)`},"text-base":{"font-size":`1rem`,"line-height":`calc(1.5 / 1)`},"text-lg":{"font-size":`1.125rem`,"line-height":`calc(1.75 / 1.125)`},"text-xl":{"font-size":`1.25rem`,"line-height":`calc(1.75 / 1.25)`},"text-2xl":{"font-size":`1.5rem`,"line-height":`calc(2 / 1.5)`},"text-3xl":{"font-size":`1.875rem`,"line-height":`calc(2.25 / 1.875)`},"text-4xl":{"font-size":`2.25rem`,"line-height":`calc(2.5 / 2.25)`},"text-5xl":{"font-size":`3rem`,"line-height":`1`},"text-6xl":{"font-size":`3.75rem`,"line-height":`1`},"text-7xl":{"font-size":`4.5rem`,"line-height":`1`},"font-thin":{"font-weight":100},"font-extralight":{"font-weight":200},"font-light":{"font-weight":300},"font-normal":{"font-weight":400},"font-medium":{"font-weight":500},"font-semibold":{"font-weight":600},"font-bold":{"font-weight":700},"font-extrabold":{"font-weight":800},"font-black":{"font-weight":900},italic:{"font-style":`italic`},"not-italic":{"font-style":`normal`},"w-max":{width:`max-content`},"w-min":{width:`min-content`},"w-fit":{width:`fit-content`},"h-max":{height:`max-content`},"h-min":{height:`min-content`},"h-fit":{height:`fit-content`},"size-auto":{width:`auto`,height:`auto`},"size-px":{width:`1px`,height:`1px`},"size-full":{width:`100%`,height:`100%`},"size-dvw":{width:`100dvw`,height:`100dvw`},"size-dvh":{width:`100dvh`,height:`100dvh`},"size-lvw":{width:`100lvw`,height:`100lvw`},"size-lvh":{width:`100lvh`,height:`100lvh`},"size-svw":{width:`100svw`,height:`100svw`},"size-svh":{width:`100svh`,height:`100svh`},"size-min":{width:`min-content`,height:`min-content`},"size-max":{width:`max-content`,height:`max-content`},"size-fit":{width:`fit-content`,height:`fit-content`},"tracking-tighter":{"letter-spacing":`-0.05em`},"tracking-tight":{"letter-spacing":`-0.025em`},"tracking-normal":{"letter-spacing":`0`},"tracking-wide":{"letter-spacing":`0.025em`},"tracking-wider":{"letter-spacing":`0.05em`},"tracking-widest":{"letter-spacing":`0.1em`},"leading-none":{"line-height":`1`},"leading-tight":{"line-height":`1.25`},"leading-snug":{"line-height":`1.375`},"leading-normal":{"line-height":`1.5`},"leading-relaxed":{"line-height":`1.625`},"leading-loose":{"line-height":`2`},"text-left":{"text-align":`left`},"text-right":{"text-align":`right`},"text-center":{"text-align":`center`},"text-justify":{"text-align":`justify`},underline:{"text-decoration":`underline`},"no-underline":{"text-decoration":`none`},"decoration-none":{"text-decoration":`none`},"line-through":{"text-decoration":`line-through`},uppercase:{"text-transform":`uppercase`},lowercase:{"text-transform":`lowercase`},capitalize:{"text-transform":`capitalize`},truncate:{"white-space":`nowrap`,overflow:`hidden`,"text-overflow":`ellipsis`},"text-elipsis":{"text-overflow":`ellipsis`},"text-clip":{"text-overflow":`clip`},"text-wrap":{"text-wrap":`wrap`},"text-nowrap":{"text-wrap":`nowrap`},"text-balance":{"text-wrap":`balance`},"text-pretty":{"text-wrap":`pretty`},"whitespace-normal":{"white-space":`normal`},"whitespace-nowrap":{"white-space":`nowrap`},"whitespace-pre":{"white-space":`pre`},"whitespace-pre-line":{"white-space":`pre-line`},"whitespace-pre-wrap":{"white-space":`pre-wrap`},"whitespace-break-spaces":{"white-space":`break-spaces`},relative:{position:`relative`},fixed:{position:`fixed`},absolute:{position:`absolute`},sticky:{position:`sticky`},"object-contain":{"object-fit":`contain`},"object-cover":{"object-fit":`cover`},"object-fill":{"object-fit":`fill`},"object-none":{"object-fit":`none`},block:{display:`block`},contents:{display:`contents`},hidden:{display:`none`},inline:{display:`inline`},"inline-block":{display:`inline-block`},visible:{visibility:`visible`},invisible:{visibility:`hidden`},collapse:{visibility:`collapse`},"list-none":{"list-style-type":`none`},"list-disc":{"list-style-type":`disc`},"list-decimal":{"list-style-type":`decimal`},flex:{display:`flex`},grid:{display:`grid`},"flex-1":{flex:`1 1 0%`},"flex-inline":{display:`inline-flex`},"flex-row":{"flex-direction":`row`},"flex-col":{"flex-direction":`column`},"flex-row-reverse":{"flex-direction":`row-reverse`},"flex-col-reverse":{"flex-direction":`column-reverse`},"flex-wrap":{"flex-wrap":`wrap`},"flex-wrap-reverse":{"flex-wrap":`wrap-reverse`},"flex-nowrap":{"flex-wrap":`nowrap`},"justify-start":{"justify-content":`flex-start`},"justify-end":{"justify-content":`flex-end`},"justify-center":{"justify-content":`center`},"justify-between":{"justify-content":`space-between`},"justify-around":{"justify-content":`space-around`},"justify-evenly":{"justify-content":`space-evenly`},"justify-stretch":{"justify-content":`stretch`},"items-start":{"align-items":`flex-start`},"items-end":{"align-items":`flex-end`},"items-center":{"align-items":`center`},"items-stretch":{"align-items":`stretch`},"flex-grow":{"flex-grow":1},"flex-shrink":{"flex-shrink":1},"align-baseline":{"vertical-align":`baseline`},"align-top":{"vertical-align":`top`},"align-middle":{"vertical-align":`middle`},"align-bottom":{"vertical-align":`bottom`},"align-text-top":{"vertical-align":`text-top`},"align-text-bottom":{"vertical-align":`text-bottom`},"overflow-auto":{overflow:`auto`},"overflow-x-auto":{"overflow-x":`auto`},"overflow-y-auto":{"overflow-y":`auto`},"overflow-hidden":{overflow:`hidden`},"overflow-x-hidden":{"overflow-x":`hidden`},"overflow-y-hidden":{"overflow-y":`hidden`},"overflow-visible":{overflow:`visible`},"overscroll-auto":{"overscroll-behavior":`auto`},"overscroll-contain":{"overscroll-behavior":`contain`},"overscroll-none":{"overscroll-behavior":`none`},"overscroll-x-auto":{"overscroll-behavior-x":`auto`},"overscroll-x-contain":{"overscroll-behavior-x":`contain`},"overscroll-x-none":{"overscroll-behavior-x":`none`},"overscroll-y-auto":{"overscroll-behavior-y":`auto`},"overscroll-y-contain":{"overscroll-behavior-y":`contain`},"overscroll-y-none":{"overscroll-behavior-y":`none`},"z-auto":{"z-index":`auto`},"cursor-pointer":{cursor:`pointer`},"cursor-wait":{cursor:`wait`},"cursor-not-allowed":{cursor:`not-allowed`},"select-none":{"user-select":`none`},"select-all":{"user-select":`all`},"pointer-events-auto":{"pointer-events":`auto`},"pointer-events-none":{"pointer-events":`none`},"box-border":{"box-sizing":`border-box`},"box-content":{"box-sizing":`content-box`},resize:{resize:`both`},"resize-x":{resize:`horizontal`},"resize-y":{resize:`vertical`},"resize-none":{resize:`none`},border:{border:`1px solid`},"border-none":{border:`none`},"border-solid":{"border-style":`solid`},"border-dashed":{"border-style":`dashed`},"border-dotted":{"border-style":`dotted`},"border-collapse":{"border-collapse":`collapse`},"rounded-none":{"border-radius":`0`},rounded:{"border-radius":`.25rem`},"rounded-sm":{"border-radius":`.125rem`},"rounded-md":{"border-radius":`.375rem`},"rounded-lg":{"border-radius":`.5rem`},"rounded-xl":{"border-radius":`.75rem`},"rounded-full":{"border-radius":`9999px`},"shadow-2xs":{"box-shadow":`0 1px rgb(0 0 0 / 0.05)`},"shadow-xs":{"box-shadow":`0 1px 2px 0 rgb(0 0 0 / 0.05)`},shadow:{"box-shadow":`0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)`},"shadow-sm":{"box-shadow":`0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)`},"shadow-md":{"box-shadow":`0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)`},"shadow-lg":{"box-shadow":`0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)`},"shadow-xl":{"box-shadow":`0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)`},"shadow-2xl":{"box-shadow":`0 25px 50px -12px rgb(0 0 0 / 0.25)`},"shadow-inner":{"box-shadow":`inset 0 2px 4px 0 rgb(0 0 0 / 0.05)`},"shadow-none":{"box-shadow":`0 0 #0000`},ring:{"box-shadow":`var(--ring-inset, ) 0 0 0 3px rgb(59 130 246 / 0.5)`},"ring-0":{"box-shadow":`var(--ring-inset, ) 0 0 0 0px rgb(59 130 246 / 0.5)`},"ring-1":{"box-shadow":`var(--ring-inset, ) 0 0 0 1px rgb(59 130 246 / 0.5)`},"ring-2":{"box-shadow":`var(--ring-inset, ) 0 0 0 2px rgb(59 130 246 / 0.5)`},"ring-4":{"box-shadow":`var(--ring-inset, ) 0 0 0 4px rgb(59 130 246 / 0.5)`},"ring-8":{"box-shadow":`var(--ring-inset, ) 0 0 0 8px rgb(59 130 246 / 0.5)`},"ring-inset":{"--ring-inset":`inset`},outline:{"outline-style":`solid`},"outline-none":{outline:`2px solid transparent`,"outline-offset":`2px`},"outline-dashed":{"outline-style":`dashed`},"outline-dotted":{"outline-style":`dotted`},"outline-double":{"outline-style":`double`},"outline-0":{"outline-width":`0px`},"outline-1":{"outline-width":`1px`},"outline-2":{"outline-width":`2px`},"outline-4":{"outline-width":`4px`},"outline-8":{"outline-width":`8px`},"outline-offset-0":{"outline-offset":`0px`},"outline-offset-1":{"outline-offset":`1px`},"outline-offset-2":{"outline-offset":`2px`},"outline-offset-4":{"outline-offset":`4px`},"outline-offset-8":{"outline-offset":`8px`},"aspect-auto":{"aspect-ratio":`auto`},"aspect-square":{"aspect-ratio":`1 / 1`},"aspect-video":{"aspect-ratio":`16 / 9`},"backdrop-blur-none":{"backdrop-filter":`blur(0)`},"backdrop-blur-sm":{"backdrop-filter":`blur(4px)`},"backdrop-blur":{"backdrop-filter":`blur(8px)`},"backdrop-blur-md":{"backdrop-filter":`blur(12px)`},"backdrop-blur-lg":{"backdrop-filter":`blur(16px)`},"backdrop-blur-xl":{"backdrop-filter":`blur(24px)`},"backdrop-blur-2xl":{"backdrop-filter":`blur(40px)`},"backdrop-blur-3xl":{"backdrop-filter":`blur(64px)`},"transition-none":{transition:`none`},transition:{"transition-property":`all`,"transition-timing-function":`ease-in-out`,"transition-duration":`var(--transition-duration, 150ms)`},"animate-none":{animation:`none`},"animate-spin":{animation:`spin 1s linear infinite`},"animate-ping":{animation:`ping 1s cubic-bezier(0, 0, 0.2, 1) infinite`},"animate-pulse":{animation:`pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite`},"bg-auto":{"background-size":`auto`},"bg-cover":{"background-size":`cover`},"bg-contain":{"background-size":`contain`},"bg-no-repeat":{"background-repeat":`no-repeat`},"bg-fixed":{"background-attachment":`fixed`},"bg-local":{"background-attachment":`local`},"bg-scroll":{"background-attachment":`scroll`},"min-h-screen":{"min-height":`100vh`},"max-h-screen":{"max-height":`100vh`},"min-w-screen":{"min-width":`100vw`},"h-dvh":{height:`100dvh`},"h-svh":{height:`100svh`},"h-lvh":{height:`100lvh`},"w-dvw":{width:`100dvw`},"w-svw":{width:`100svw`},"w-lvw":{width:`100lvw`},"min-h-dvh":{"min-height":`100dvh`},"min-h-svh":{"min-height":`100svh`},"min-h-lvh":{"min-height":`100lvh`},"flex-none":{flex:`none`},"flex-auto":{flex:`1 1 auto`},"flex-initial":{flex:`0 1 auto`},grow:{"flex-grow":`1`},"grow-0":{"flex-grow":`0`},shrink:{"flex-shrink":`1`},"shrink-0":{"flex-shrink":`0`},"self-auto":{"align-self":`auto`},"self-start":{"align-self":`flex-start`},"self-end":{"align-self":`flex-end`},"self-center":{"align-self":`center`},"self-stretch":{"align-self":`stretch`},"self-baseline":{"align-self":`baseline`},"content-normal":{"align-content":`normal`},"content-start":{"align-content":`flex-start`},"content-end":{"align-content":`flex-end`},"content-center":{"align-content":`center`},"content-between":{"align-content":`space-between`},"content-around":{"align-content":`space-around`},"content-evenly":{"align-content":`space-evenly`},"content-stretch":{"align-content":`stretch`},"items-baseline":{"align-items":`baseline`},"inset-0":{inset:`0`},"inset-auto":{inset:`auto`},"inset-x-0":{left:`0`,right:`0`},"inset-y-0":{top:`0`,bottom:`0`},"inset-x-auto":{left:`auto`,right:`auto`},"inset-y-auto":{top:`auto`,bottom:`auto`},"sr-only":{position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,"white-space":`nowrap`,"border-width":`0`},"not-sr-only":{position:`static`,width:`auto`,height:`auto`,padding:`0`,margin:`0`,overflow:`visible`,clip:`auto`,"white-space":`normal`}},x=[`@keyframes spin {
|
|
1
|
+
import{n as e,t}from"./renderer-B3R6_o-2.js";import{safeStyleEl as n}from"safevalues/dom";import{concatStyleSheets as r,safeStyleSheet as i}from"safevalues";function a(){return r([i`*,::before,::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}`,i`html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}`,i`body{margin:0;line-height:inherit}`,i`hr{height:0;color:inherit;border-top-width:1px}`,i`abbr:where([title]){text-decoration:underline dotted}`,i`b,strong{font-weight:bolder}`,i`code,kbd,samp,pre{font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;font-size:1em}`,i`small{font-size:80%}`,i`sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}`,i`sub{bottom:-0.25em}`,i`sup{top:-0.5em}`,i`button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}`,i`button,select{text-transform:none}`,i`button,[type='button'],[type='reset'],[type='submit']{-webkit-appearance:button;background-color:transparent;background-image:none;cursor:pointer}`,i`:-moz-focusring{outline:auto}`,i`:-moz-ui-invalid{box-shadow:none}`,i`progress{vertical-align:baseline}`,i`::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}`,i`[type='search']{-webkit-appearance:textfield;outline-offset:-2px}`,i`::-webkit-search-decoration{-webkit-appearance:none}`,i`::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}`,i`summary{display:list-item}`,i`blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}`,i`fieldset{margin:0;padding:0}`,i`legend{padding:0}`,i`ol,ul,menu{list-style:none;margin:0;padding:0}`,i`textarea{resize:vertical}`,i`::placeholder{opacity:1;color:#9ca3af}`,i`button,[role="button"]{cursor:pointer}`,i`:disabled{cursor:default}`,i`img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}`,i`img,video{max-width:100%;height:auto}`,i`[hidden]{display:none}`,i`dialog{padding:0}`,i`dialog::backdrop{background:rgba(0,0,0,0.5)}`])}function o(){return r([i`html{`,i`max-width: 70ch;`,i`padding: 2em 1em;`,i`margin: auto;`,i`line-height: 1.75;`,i`font-size: 1.25em;`,i`font-family: sans-serif;`,i`}`,i`h1,h2,h3,h4,h5,h6{`,i`margin: 1em 0 0.5em;`,i`}`,i`p,ul,ol{`,i`margin-bottom: 1em;`,i`color: #1d1d1d;`,i`}`])}const s={sm:640,md:768,lg:1024,xl:1280},c=Object.entries(s),l=.25,u=[...Array(15)].map((e,t)=>t+1),d=[16,20,24,25,28,30,32,36,40,44,48,50,52,56,60],f=[64,72,80,96,100,112,128,144,160,192,200,224,256,288,300,320,384,400,448,500,512],p=[...u,...d,...f,...Object.values(s)],m=Array.from({length:100},(e,t)=>t+1),h=[25,50,75,100,150,200,300,500,700,1e3],g=[`hover`,`focus`,`disabled`,`active`],_={margin:`m`,padding:`p`},v={width:`w`,height:`h`},y={top:`top`,right:`right`,bottom:`bottom`,left:`left`},b={"min-width":`min-w`,"min-height":`min-h`,"max-width":`max-w`,"max-height":`max-h`},x={"font-mono":{"font-family":`monospace`},"font-sans":{"font-family":`sans-serif`},"font-serif":{"font-family":`serif`},"font-cursive":{"font-family":`cursive`},"text-xs":{"font-size":`.75rem`,"line-height":`calc(1 / 0.75)`},"text-sm":{"font-size":`.875rem`,"line-height":`calc(1.25 / 0.875)`},"text-base":{"font-size":`1rem`,"line-height":`calc(1.5 / 1)`},"text-lg":{"font-size":`1.125rem`,"line-height":`calc(1.75 / 1.125)`},"text-xl":{"font-size":`1.25rem`,"line-height":`calc(1.75 / 1.25)`},"text-2xl":{"font-size":`1.5rem`,"line-height":`calc(2 / 1.5)`},"text-3xl":{"font-size":`1.875rem`,"line-height":`calc(2.25 / 1.875)`},"text-4xl":{"font-size":`2.25rem`,"line-height":`calc(2.5 / 2.25)`},"text-5xl":{"font-size":`3rem`,"line-height":`1`},"text-6xl":{"font-size":`3.75rem`,"line-height":`1`},"text-7xl":{"font-size":`4.5rem`,"line-height":`1`},"font-thin":{"font-weight":100},"font-extralight":{"font-weight":200},"font-light":{"font-weight":300},"font-normal":{"font-weight":400},"font-medium":{"font-weight":500},"font-semibold":{"font-weight":600},"font-bold":{"font-weight":700},"font-extrabold":{"font-weight":800},"font-black":{"font-weight":900},italic:{"font-style":`italic`},"not-italic":{"font-style":`normal`},"w-max":{width:`max-content`},"w-min":{width:`min-content`},"w-fit":{width:`fit-content`},"h-max":{height:`max-content`},"h-min":{height:`min-content`},"h-fit":{height:`fit-content`},"size-auto":{width:`auto`,height:`auto`},"size-px":{width:`1px`,height:`1px`},"size-full":{width:`100%`,height:`100%`},"size-dvw":{width:`100dvw`,height:`100dvw`},"size-dvh":{width:`100dvh`,height:`100dvh`},"size-lvw":{width:`100lvw`,height:`100lvw`},"size-lvh":{width:`100lvh`,height:`100lvh`},"size-svw":{width:`100svw`,height:`100svw`},"size-svh":{width:`100svh`,height:`100svh`},"size-min":{width:`min-content`,height:`min-content`},"size-max":{width:`max-content`,height:`max-content`},"size-fit":{width:`fit-content`,height:`fit-content`},"tracking-tighter":{"letter-spacing":`-0.05em`},"tracking-tight":{"letter-spacing":`-0.025em`},"tracking-normal":{"letter-spacing":`0`},"tracking-wide":{"letter-spacing":`0.025em`},"tracking-wider":{"letter-spacing":`0.05em`},"tracking-widest":{"letter-spacing":`0.1em`},"leading-none":{"line-height":`1`},"leading-tight":{"line-height":`1.25`},"leading-snug":{"line-height":`1.375`},"leading-normal":{"line-height":`1.5`},"leading-relaxed":{"line-height":`1.625`},"leading-loose":{"line-height":`2`},"text-left":{"text-align":`left`},"text-right":{"text-align":`right`},"text-center":{"text-align":`center`},"text-justify":{"text-align":`justify`},underline:{"text-decoration":`underline`},"no-underline":{"text-decoration":`none`},"decoration-none":{"text-decoration":`none`},"line-through":{"text-decoration":`line-through`},uppercase:{"text-transform":`uppercase`},lowercase:{"text-transform":`lowercase`},capitalize:{"text-transform":`capitalize`},truncate:{"white-space":`nowrap`,overflow:`hidden`,"text-overflow":`ellipsis`},"text-elipsis":{"text-overflow":`ellipsis`},"text-clip":{"text-overflow":`clip`},"text-wrap":{"text-wrap":`wrap`},"text-nowrap":{"text-wrap":`nowrap`},"text-balance":{"text-wrap":`balance`},"text-pretty":{"text-wrap":`pretty`},"whitespace-normal":{"white-space":`normal`},"whitespace-nowrap":{"white-space":`nowrap`},"whitespace-pre":{"white-space":`pre`},"whitespace-pre-line":{"white-space":`pre-line`},"whitespace-pre-wrap":{"white-space":`pre-wrap`},"whitespace-break-spaces":{"white-space":`break-spaces`},relative:{position:`relative`},fixed:{position:`fixed`},absolute:{position:`absolute`},sticky:{position:`sticky`},"object-contain":{"object-fit":`contain`},"object-cover":{"object-fit":`cover`},"object-fill":{"object-fit":`fill`},"object-none":{"object-fit":`none`},block:{display:`block`},contents:{display:`contents`},hidden:{display:`none`},inline:{display:`inline`},"inline-block":{display:`inline-block`},visible:{visibility:`visible`},invisible:{visibility:`hidden`},collapse:{visibility:`collapse`},"list-none":{"list-style-type":`none`},"list-disc":{"list-style-type":`disc`},"list-decimal":{"list-style-type":`decimal`},flex:{display:`flex`},grid:{display:`grid`},"flex-1":{flex:`1 1 0%`},"flex-inline":{display:`inline-flex`},"flex-row":{"flex-direction":`row`},"flex-col":{"flex-direction":`column`},"flex-row-reverse":{"flex-direction":`row-reverse`},"flex-col-reverse":{"flex-direction":`column-reverse`},"flex-wrap":{"flex-wrap":`wrap`},"flex-wrap-reverse":{"flex-wrap":`wrap-reverse`},"flex-nowrap":{"flex-wrap":`nowrap`},"justify-start":{"justify-content":`flex-start`},"justify-end":{"justify-content":`flex-end`},"justify-center":{"justify-content":`center`},"justify-between":{"justify-content":`space-between`},"justify-around":{"justify-content":`space-around`},"justify-evenly":{"justify-content":`space-evenly`},"justify-stretch":{"justify-content":`stretch`},"items-start":{"align-items":`flex-start`},"items-end":{"align-items":`flex-end`},"items-center":{"align-items":`center`},"items-stretch":{"align-items":`stretch`},"flex-grow":{"flex-grow":1},"flex-shrink":{"flex-shrink":1},"align-baseline":{"vertical-align":`baseline`},"align-top":{"vertical-align":`top`},"align-middle":{"vertical-align":`middle`},"align-bottom":{"vertical-align":`bottom`},"align-text-top":{"vertical-align":`text-top`},"align-text-bottom":{"vertical-align":`text-bottom`},"overflow-auto":{overflow:`auto`},"overflow-x-auto":{"overflow-x":`auto`},"overflow-y-auto":{"overflow-y":`auto`},"overflow-hidden":{overflow:`hidden`},"overflow-x-hidden":{"overflow-x":`hidden`},"overflow-y-hidden":{"overflow-y":`hidden`},"overflow-visible":{overflow:`visible`},"overscroll-auto":{"overscroll-behavior":`auto`},"overscroll-contain":{"overscroll-behavior":`contain`},"overscroll-none":{"overscroll-behavior":`none`},"overscroll-x-auto":{"overscroll-behavior-x":`auto`},"overscroll-x-contain":{"overscroll-behavior-x":`contain`},"overscroll-x-none":{"overscroll-behavior-x":`none`},"overscroll-y-auto":{"overscroll-behavior-y":`auto`},"overscroll-y-contain":{"overscroll-behavior-y":`contain`},"overscroll-y-none":{"overscroll-behavior-y":`none`},"z-auto":{"z-index":`auto`},"cursor-pointer":{cursor:`pointer`},"cursor-wait":{cursor:`wait`},"cursor-not-allowed":{cursor:`not-allowed`},"select-none":{"user-select":`none`},"select-all":{"user-select":`all`},"pointer-events-auto":{"pointer-events":`auto`},"pointer-events-none":{"pointer-events":`none`},"box-border":{"box-sizing":`border-box`},"box-content":{"box-sizing":`content-box`},resize:{resize:`both`},"resize-x":{resize:`horizontal`},"resize-y":{resize:`vertical`},"resize-none":{resize:`none`},border:{border:`1px solid`},"border-none":{border:`none`},"border-solid":{"border-style":`solid`},"border-dashed":{"border-style":`dashed`},"border-dotted":{"border-style":`dotted`},"border-collapse":{"border-collapse":`collapse`},"rounded-none":{"border-radius":`0`},rounded:{"border-radius":`.25rem`},"rounded-sm":{"border-radius":`.125rem`},"rounded-md":{"border-radius":`.375rem`},"rounded-lg":{"border-radius":`.5rem`},"rounded-xl":{"border-radius":`.75rem`},"rounded-full":{"border-radius":`9999px`},"shadow-2xs":{"box-shadow":`0 1px rgb(0 0 0 / 0.05)`},"shadow-xs":{"box-shadow":`0 1px 2px 0 rgb(0 0 0 / 0.05)`},shadow:{"box-shadow":`0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)`},"shadow-sm":{"box-shadow":`0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)`},"shadow-md":{"box-shadow":`0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)`},"shadow-lg":{"box-shadow":`0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)`},"shadow-xl":{"box-shadow":`0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)`},"shadow-2xl":{"box-shadow":`0 25px 50px -12px rgb(0 0 0 / 0.25)`},"shadow-inner":{"box-shadow":`inset 0 2px 4px 0 rgb(0 0 0 / 0.05)`},"shadow-none":{"box-shadow":`0 0 #0000`},ring:{"box-shadow":`var(--ring-inset, ) 0 0 0 3px rgb(59 130 246 / 0.5)`},"ring-0":{"box-shadow":`var(--ring-inset, ) 0 0 0 0px rgb(59 130 246 / 0.5)`},"ring-1":{"box-shadow":`var(--ring-inset, ) 0 0 0 1px rgb(59 130 246 / 0.5)`},"ring-2":{"box-shadow":`var(--ring-inset, ) 0 0 0 2px rgb(59 130 246 / 0.5)`},"ring-4":{"box-shadow":`var(--ring-inset, ) 0 0 0 4px rgb(59 130 246 / 0.5)`},"ring-8":{"box-shadow":`var(--ring-inset, ) 0 0 0 8px rgb(59 130 246 / 0.5)`},"ring-inset":{"--ring-inset":`inset`},outline:{"outline-style":`solid`},"outline-none":{outline:`2px solid transparent`,"outline-offset":`2px`},"outline-dashed":{"outline-style":`dashed`},"outline-dotted":{"outline-style":`dotted`},"outline-double":{"outline-style":`double`},"outline-0":{"outline-width":`0px`},"outline-1":{"outline-width":`1px`},"outline-2":{"outline-width":`2px`},"outline-4":{"outline-width":`4px`},"outline-8":{"outline-width":`8px`},"outline-offset-0":{"outline-offset":`0px`},"outline-offset-1":{"outline-offset":`1px`},"outline-offset-2":{"outline-offset":`2px`},"outline-offset-4":{"outline-offset":`4px`},"outline-offset-8":{"outline-offset":`8px`},"aspect-auto":{"aspect-ratio":`auto`},"aspect-square":{"aspect-ratio":`1 / 1`},"aspect-video":{"aspect-ratio":`16 / 9`},"backdrop-blur-none":{"backdrop-filter":`blur(0)`},"backdrop-blur-sm":{"backdrop-filter":`blur(4px)`},"backdrop-blur":{"backdrop-filter":`blur(8px)`},"backdrop-blur-md":{"backdrop-filter":`blur(12px)`},"backdrop-blur-lg":{"backdrop-filter":`blur(16px)`},"backdrop-blur-xl":{"backdrop-filter":`blur(24px)`},"backdrop-blur-2xl":{"backdrop-filter":`blur(40px)`},"backdrop-blur-3xl":{"backdrop-filter":`blur(64px)`},"transition-none":{transition:`none`},transition:{"transition-property":`all`,"transition-timing-function":`ease-in-out`,"transition-duration":`var(--transition-duration, 150ms)`},"animate-none":{animation:`none`},"animate-spin":{animation:`spin 1s linear infinite`},"animate-ping":{animation:`ping 1s cubic-bezier(0, 0, 0.2, 1) infinite`},"animate-pulse":{animation:`pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite`},"bg-auto":{"background-size":`auto`},"bg-cover":{"background-size":`cover`},"bg-contain":{"background-size":`contain`},"bg-no-repeat":{"background-repeat":`no-repeat`},"bg-fixed":{"background-attachment":`fixed`},"bg-local":{"background-attachment":`local`},"bg-scroll":{"background-attachment":`scroll`},"min-h-screen":{"min-height":`100vh`},"max-h-screen":{"max-height":`100vh`},"min-w-screen":{"min-width":`100vw`},"h-dvh":{height:`100dvh`},"h-svh":{height:`100svh`},"h-lvh":{height:`100lvh`},"w-dvw":{width:`100dvw`},"w-svw":{width:`100svw`},"w-lvw":{width:`100lvw`},"min-h-dvh":{"min-height":`100dvh`},"min-h-svh":{"min-height":`100svh`},"min-h-lvh":{"min-height":`100lvh`},"flex-none":{flex:`none`},"flex-auto":{flex:`1 1 auto`},"flex-initial":{flex:`0 1 auto`},grow:{"flex-grow":`1`},"grow-0":{"flex-grow":`0`},shrink:{"flex-shrink":`1`},"shrink-0":{"flex-shrink":`0`},"self-auto":{"align-self":`auto`},"self-start":{"align-self":`flex-start`},"self-end":{"align-self":`flex-end`},"self-center":{"align-self":`center`},"self-stretch":{"align-self":`stretch`},"self-baseline":{"align-self":`baseline`},"content-normal":{"align-content":`normal`},"content-start":{"align-content":`flex-start`},"content-end":{"align-content":`flex-end`},"content-center":{"align-content":`center`},"content-between":{"align-content":`space-between`},"content-around":{"align-content":`space-around`},"content-evenly":{"align-content":`space-evenly`},"content-stretch":{"align-content":`stretch`},"items-baseline":{"align-items":`baseline`},"inset-0":{inset:`0`},"inset-auto":{inset:`auto`},"inset-x-0":{left:`0`,right:`0`},"inset-y-0":{top:`0`,bottom:`0`},"inset-x-auto":{left:`auto`,right:`auto`},"inset-y-auto":{top:`auto`,bottom:`auto`},"sr-only":{position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,"white-space":`nowrap`,"border-width":`0`},"not-sr-only":{position:`static`,width:`auto`,height:`auto`,padding:`0`,margin:`0`,overflow:`visible`,clip:`auto`,"white-space":`normal`}},S=[`@keyframes spin {
|
|
2
2
|
from { transform: rotate(0deg) }
|
|
3
3
|
to { transform: rotate(360deg) }
|
|
4
4
|
}`,`@keyframes ping {
|
|
@@ -9,5 +9,5 @@ import{n as e,t}from"./renderer-B3R6_o-2.js";import{safeStyleEl as n}from"safeva
|
|
|
9
9
|
}`,`@keyframes pulse {
|
|
10
10
|
0%, 100% { opacity: 1 }
|
|
11
11
|
50% { opacity: .5 }
|
|
12
|
-
}`],
|
|
13
|
-
`)),
|
|
12
|
+
}`],C={red:{50:`#ffebee`,100:`#ffcdd2`,200:`#ef9a9a`,300:`#e57373`,400:`#ef5350`,500:`#f44336`,600:`#e53935`,700:`#d32f2f`,800:`#c62828`,900:`#b71c1c`},pink:{50:`#fce4ec`,100:`#f8bbd0`,200:`#f48fb1`,300:`#f06292`,400:`#ec407a`,500:`#e91e63`,600:`#d81b60`,700:`#c2185b`,800:`#ad1457`,900:`#880e4f`},purple:{50:`#f3e5f5`,100:`#e1bee7`,200:`#ce93d8`,300:`#ba68c8`,400:`#ab47bc`,500:`#9c27b0`,600:`#8e24aa`,700:`#7b1fa2`,800:`#6a1b9a`,900:`#4a148c`},"deep-purple":{50:`#ede7f6`,100:`#d1c4e9`,200:`#b39ddb`,300:`#9575cd`,400:`#7e57c2`,500:`#673ab7`,600:`#5e35b1`,700:`#512da8`,800:`#4527a0`,900:`#311b92`},indigo:{50:`#e8eaf6`,100:`#c5cae9`,200:`#9fa8da`,300:`#7986cb`,400:`#5c6bc0`,500:`#3f51b5`,600:`#3949ab`,700:`#303f9f`,800:`#283593`,900:`#1a237e`},blue:{50:`#e3f2fd`,100:`#bbdefb`,200:`#90caf9`,300:`#64b5f6`,400:`#42a5f5`,500:`#2196f3`,600:`#1e88e5`,700:`#1976d2`,800:`#1565c0`,900:`#0d47a1`},"light-blue":{50:`#e1f5fe`,100:`#b3e5fc`,200:`#81d4fa`,300:`#4fc3f7`,400:`#29b6f6`,500:`#03a9f4`,600:`#039be5`,700:`#0288d1`,800:`#0277bd`,900:`#01579b`},cyan:{50:`#e0f7fa`,100:`#b2ebf2`,200:`#80deea`,300:`#4dd0e1`,400:`#26c6da`,500:`#00bcd4`,600:`#00acc1`,700:`#0097a7`,800:`#00838f`,900:`#006064`},teal:{50:`#e0f2f1`,100:`#b2dfdb`,200:`#80cbc4`,300:`#4db6ac`,400:`#26a69a`,500:`#009688`,600:`#00897b`,700:`#00796b`,800:`#00695c`,900:`#004d40`},green:{50:`#e8f5e9`,100:`#c8e6c9`,200:`#a5d6a7`,300:`#81c784`,400:`#66bb6a`,500:`#4caf50`,600:`#43a047`,700:`#388e3c`,800:`#2e7d32`,900:`#1b5e20`},"light-green":{50:`#f1f8e9`,100:`#dcedc8`,200:`#c5e1a5`,300:`#aed581`,400:`#9ccc65`,500:`#8bc34a`,600:`#7cb342`,700:`#689f38`,800:`#558b2f`,900:`#33691e`},lime:{50:`#f9fbe7`,100:`#f0f4c3`,200:`#e6ee9c`,300:`#dce775`,400:`#d4e157`,500:`#cddc39`,600:`#c0ca33`,700:`#afb42b`,800:`#9e9d24`,900:`#827717`},yellow:{50:`#fffde7`,100:`#fff9c4`,200:`#fff59d`,300:`#fff176`,400:`#ffee58`,500:`#ffeb3b`,600:`#fdd835`,700:`#fbc02d`,800:`#f9a825`,900:`#f57f17`},amber:{50:`#fff8e1`,100:`#ffecb3`,200:`#ffe082`,300:`#ffd54f`,400:`#ffca28`,500:`#ffc107`,600:`#ffb300`,700:`#ffa000`,800:`#ff8f00`,900:`#ff6f00`},orange:{50:`#fff3e0`,100:`#ffe0b2`,200:`#ffcc80`,300:`#ffb74d`,400:`#ffa726`,500:`#ff9800`,600:`#fb8c00`,700:`#f57c00`,800:`#ef6c00`,900:`#e65100`},"deep-orange":{50:`#fbe9e7`,100:`#ffccbc`,200:`#ffab91`,300:`#ff8a65`,400:`#ff7043`,500:`#ff5722`,600:`#f4511e`,700:`#e64a19`,800:`#d84315`,900:`#bf360c`},brown:{50:`#efebe9`,100:`#d7ccc8`,200:`#bcaaa4`,300:`#a1887f`,400:`#8d6e63`,500:`#795548`,600:`#6d4c41`,700:`#5d4037`,800:`#4e342e`,900:`#3e2723`},gray:{50:`#fafafa`,100:`#f5f5f5`,200:`#eeeeee`,300:`#e0e0e0`,400:`#bdbdbd`,500:`#9e9e9e`,600:`#757575`,700:`#616161`,800:`#424242`,900:`#212121`},"blue-gray":{50:`#eceff1`,100:`#cfd8dc`,200:`#b0bec5`,300:`#90a4ae`,400:`#78909c`,500:`#607d8b`,600:`#546e7a`,700:`#455a64`,800:`#37474f`,900:`#263238`}};function w(e){return g.map(t=>`.${t}\\:${e}:${t}`)}function T(e,t){return c.map(([n,r])=>`@media (min-width: ${r}px) { .${n}\\:${e} { ${t} } }`)}function E(e){return e.flatMap(([e,t])=>[`.${e} { ${t} }`,`${w(e).join(`,`)} { ${t} }`,...T(e,t)])}function D(e,t){let n=e[0]===`@`,r=t[0]===`@`;return n&&!r?1:!n&&r?-1:e.localeCompare(t)}function O(e){return E(Object.entries(e).flatMap(([e,t])=>[[`${t}-0`,`${e}: 0`],[`${t}-screen`,`${e}: 100v${e.includes(`height`)?`h`:`w`}`],[`${t}-full`,`${e}: 100%`],...p.map(n=>[`${t}-${n}`,`${e}: ${n*l}rem`]),...p.map(n=>[`-${t}-${n}`,`${e}: -${n*l}rem`]),...p.map(n=>[`${t}-${n}px`,`${e}: ${n}px`]),...p.map(n=>[`-${t}-${n}px`,`${e}: -${n}px`]),...m.map(n=>[`${t}-${n}\\%`,`${e}: ${n}%`]),...m.map(n=>[`-${t}-${n}\\%`,`${e}: -${n}%`]),...c.map(([n,r])=>[`${t}-${n}`,`${e}: ${r}px`])]))}function k(e){return E(Object.entries(e).flatMap(([e,t])=>[[`${t}-auto`,`${e}: auto`],[`${t}x-auto`,`${e}-left: auto; ${e}-right: auto;`],[`${t}y-auto`,`${e}-top: auto; ${e}-bottom: auto;`],[`${t}x-0`,`${e}-left: 0; ${e}-right: 0;`],[`${t}y-0`,`${e}-top: 0; ${e}-bottom: 0;`],...p.map(n=>[`${t}x-${n}`,`${e}-left: ${n*l}rem; ${e}-right: ${n*l}rem;`]),...p.map(n=>[`${t}y-${n}`,`${e}-top: ${n*l}rem; ${e}-bottom: ${n*l}rem;`]),...p.map(n=>[`${t}x-${n}px`,`${e}-left: ${n}px; ${e}-right: ${n}px;`]),...p.map(n=>[`${t}y-${n}px`,`${e}-top: ${n}px; ${e}-bottom: ${n}px;`]),...m.map(n=>[`${t}x-${n}\\%`,`${e}-left: ${n}%; ${e}-right: ${n}%;`]),...m.map(n=>[`${t}y-${n}\\%`,`${e}-top: ${n}%; ${e}-bottom: ${n}%;`])]))}function A(e){return E(Object.entries(e).flatMap(([e,t])=>[[`${t}t-0`,`${e}-top: 0`],[`${t}b-0`,`${e}-bottom: 0`],[`${t}l-0`,`${e}-left: 0`],[`${t}r-0`,`${e}-right: 0`],[`${t}t-auto`,`${e}-top: auto`],[`${t}b-auto`,`${e}-bottom: auto`],[`${t}l-auto`,`${e}-left: auto`],[`${t}r-auto`,`${e}-right: auto`],...[``,`-`].flatMap(n=>[...p.map(r=>[`${n}${t}t-${r}`,`${e}-top: ${n}${r*l}rem`]),...p.map(r=>[`${n}${t}b-${r}`,`${e}-bottom: ${n}${r*l}rem`]),...p.map(r=>[`${n}${t}l-${r}`,`${e}-left: ${n}${r*l}rem`]),...p.map(r=>[`${n}${t}r-${r}`,`${e}-right: ${n}${r*l}rem`]),...p.map(r=>[`${n}${t}t-${r}px`,`${e}-top: ${n}${r}px`]),...p.map(r=>[`${n}${t}b-${r}px`,`${e}-bottom: ${n}${r}px`]),...p.map(r=>[`${n}${t}l-${r}px`,`${e}-left: ${n}${r}px`]),...p.map(r=>[`${n}${t}r-${r}px`,`${e}-right: ${n}${r}px`]),...m.map(r=>[`${n}${t}t-${r}\\%`,`${e}-top: ${n}${r}%`]),...m.map(r=>[`${n}${t}b-${r}\\%`,`${e}-bottom: ${n}${r}%`]),...m.map(r=>[`${n}${t}l-${r}\\%`,`${e}-left: ${n}${r}%`]),...m.map(r=>[`${n}${t}r-${r}\\%`,`${e}-right: ${n}${r}%`])])]))}function j(){return E([[`border`,`border: 1px`],[`border-x`,`border-inline-width: 1px`],[`border-y`,`border-block-width: 1px`],...[0,...u].map(e=>[`border-${e}`,`border-width: ${e}px`]),...[0,...u].map(e=>[`border-x-${e}`,`border-inline-width: ${e}px;`]),...[0,...u].map(e=>[`border-y-${e}`,`border-block-width: ${e}px;`]),...[`top`,`bottom`,`left`,`right`].flatMap(e=>[[`border-${e.slice(0,1)}`,`border-${e}: 1px`],...[0,...u].map(t=>[`border-${e.slice(0,1)}-${t}`,`border-${e}-width: ${t}px`])])])}function M(){return E(m.map(e=>[`z-${e}`,`z-index: ${e}`]))}function N(){return E(h.map(e=>[`duration-${e}`,`--transition-duration: ${e}ms; transition-duration: ${e}ms`]))}function P(){return E([[`space-x-0 > *`,`margin-left: 0`],[`space-y-0 > *`,`margin-top: 0`],...p.map(e=>[`space-x-${e} > :not(:first-child)`,`margin-left: ${e*l}rem`]),...p.map(e=>[`space-y-${e} > :not(:first-child)`,`margin-top: ${e*l}rem`]),...p.map(e=>[`space-x-${e}px > :not(:first-child)`,`margin-left: ${e}px`]),...p.map(e=>[`space-y-${e}px > :not(:first-child)`,`margin-top: ${e}px`]),[`gap-0`,`gap: 0`],...p.map(e=>[`gap-${e}`,`gap: ${e*l}rem`]),...p.map(e=>[`gap-${e}px`,`gap: ${e}px`]),...p.map(e=>[`gap-x-${e}`,`column-gap: ${e*l}rem`]),...p.map(e=>[`gap-y-${e}`,`row-gap: ${e*l}rem`]),...p.map(e=>[`gap-x-${e}px`,`column-gap: ${e}px`]),...p.map(e=>[`gap-y-${e}px`,`row-gap: ${e}px`]),[`divide-x > :not(:last-child)`,`border-inline-end-width: 1px`],[`divide-y > :not(:last-child)`,`border-bottom-width: 1px`],[`divide-x-0 > :not(:last-child)`,`border-inline-end-width: 0px`],[`divide-y-0 > :not(:last-child)`,`border-bottom-width: 0px`],...[2,4,8].map(e=>[`divide-x-${e} > :not(:last-child)`,`border-inline-end-width: ${e}px`]),...[2,4,8].map(e=>[`divide-y-${e} > :not(:last-child)`,`border-bottom-width: ${e}px`]),[`divide-solid > :not(:last-child)`,`border-style: solid`],[`divide-dashed > :not(:last-child)`,`border-style: dashed`],[`divide-dotted > :not(:last-child)`,`border-style: dotted`],[`divide-none > :not(:last-child)`,`border-style: none`]])}function F(){return E([...Array.from({length:100},(e,t)=>[`text-${t}px`,`font-size: ${t}px`]),...Array.from({length:100},(e,t)=>[`text-${t*l}rem`,`font-size: ${t*l}rem`])])}function I(){return E([...Array.from({length:12},(e,t)=>t+1).map(e=>[`grid-cols-${e}`,`grid-template-columns: repeat(${e}, minmax(0, 1fr))`]),[`grid-cols-none`,`grid-template-columns: none`],...Array.from({length:12},(e,t)=>t+1).map(e=>[`col-span-${e}`,`grid-column: span ${e} / span ${e}`]),[`col-span-full`,`grid-column: 1 / -1`],...Array.from({length:13},(e,t)=>t+1).map(e=>[`col-start-${e}`,`grid-column-start: ${e}`]),[`col-start-auto`,`grid-column-start: auto`],...Array.from({length:13},(e,t)=>t+1).map(e=>[`col-end-${e}`,`grid-column-end: ${e}`]),[`col-end-auto`,`grid-column-end: auto`]])}function L(){return Object.entries(x).flatMap(([e,t])=>{let n=Object.entries(t).map(([e,t])=>`${e}: ${t}`).join(`; `);return[`.${e} { ${n} }`,`${w(e).join(`,`)} { ${n} }`,...T(e,n)]})}function R(e){let t=0,n=0,r=0;return e.length===4?(t=parseInt(e[1]+e[1],16),n=parseInt(e[2]+e[2],16),r=parseInt(e[3]+e[3],16)):e.length===7&&(t=parseInt(e.slice(1,3),16),n=parseInt(e.slice(3,5),16),r=parseInt(e.slice(5,7),16)),`${t} ${n} ${r}`}function z(){let e=(e,t)=>{let n=[[`text-${e}`,`color: ${t}`],[`fill-${e}`,`fill: ${t}`],[`bg-${e}`,`background-color: ${t}`],[`border-${e}`,`border-color: ${t}`]];if(t.startsWith(`#`)){let r=R(t);for(let t of m){let i=t/100;n.push([`text-${e}\\/${t}`,`color: rgb(${r} / ${i})`],[`bg-${e}\\/${t}`,`background-color: rgb(${r} / ${i})`],[`border-${e}\\/${t}`,`border-color: rgb(${r} / ${i})`])}}return n};return E([...e(`white`,`#fff`),...e(`black`,`#000`),...e(`transparent`,`transparent`),...Object.entries(C).flatMap(([t,n])=>[...e(t,n[500]),...Object.entries(n).flatMap(([n,r])=>e(`${t}-${n}`,r))])])}function B(){return E([[`opacity-0`,`opacity: 0`],...m.map(e=>[`opacity-${e}`,`opacity: ${e/100}`])])}let V=null;function H(){return V===null&&(V=[...S,...L(),...z(),...B(),...M(),...N(),...O(y),...O(v),...k(v),...A(_),...O(_),...k(_),...P(),...O(b),...j(),...F(),...I()].sort(D).join(`
|
|
13
|
+
`)),V}var U=class extends t{impl=`browser`;dirpath=e(globalThis.location?.href??`http://localhost/`);parseHTML(e,t={rootDocument:!1}){if(t.rootDocument)return new DOMParser().parseFromString(e,`text/html`);{let t=document.createRange();return t.selectNodeContents(document.body),t.createContextualFragment(e)}}serializeHTML(e){return new XMLSerializer().serializeToString(e).replace(/\s?xmlns="[^"]+"/gm,``)}preprocessLocal(e,t){return this.preprocessRemote(e,t)}createElement(e,t){return(t||document).createElement(e)}createComment(e,t){return(t||document).createComment(e)}textContent(e,t){e.textContent=t}};const W=new U;function G(e){for(let t of e){let e=document.createElement(`style`);switch(t){case`minimal`:n.setTextContent(e,o());break;case`basic`:n.setTextContent(e,a());break;case`utils`:e.textContent=H();break;default:console.error(`Unknown style name: "${t}"`);continue}globalThis.document.head.appendChild(e)}}function K(){G([`minimal`])}function q(){G([`basic`])}function J(){G([`utils`])}async function Y(e={}){let t=new U;if(e.css&&e.css.length>0&&G(e.css),e.debug&&t.debug(!0),e.state)for(let[n,r]of Object.entries(e.state))await t.set(n,r);if(e.target){let n=Array.isArray(e.target)?e.target:[e.target];for(let r of n){let n=globalThis.document.querySelector(r);n?await t.mount(n,{cache:e.cache}):console.error(`Target element not found: "${r}"`)}}return t}export{t as IRenderer,W as Mancha,U as Renderer,a as basicCssRules,Y as initMancha,q as injectBasicCss,G as injectCss,K as injectMinimalCss,J as injectUtilsCss,o as minimalCssRules,H as utilsCssRules};
|
package/dist/browser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"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"}
|
package/dist/css_gen_basic.js
CHANGED
|
@@ -1,22 +1,80 @@
|
|
|
1
1
|
import { concatStyleSheets, safeStyleSheet } from "safevalues";
|
|
2
2
|
export default function rules() {
|
|
3
|
-
//
|
|
3
|
+
// Inspired by Tailwind CSS.
|
|
4
4
|
return concatStyleSheets([
|
|
5
|
-
|
|
6
|
-
safeStyleSheet
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
safeStyleSheet `font-family: sans-serif
|
|
12
|
-
|
|
13
|
-
safeStyleSheet `
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
safeStyleSheet `
|
|
18
|
-
|
|
19
|
-
safeStyleSheet `}`,
|
|
5
|
+
// Prevent padding and border from affecting element width.
|
|
6
|
+
safeStyleSheet `*,::before,::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}`,
|
|
7
|
+
// Use a consistent sensible line-height in all browsers.
|
|
8
|
+
// Prevent adjustments of font size after orientation changes in iOS.
|
|
9
|
+
// Use a more readable tab size.
|
|
10
|
+
// Use the user's configured 'sans' font-family by default.
|
|
11
|
+
safeStyleSheet `html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}`,
|
|
12
|
+
// Remove default margin.
|
|
13
|
+
safeStyleSheet `body{margin:0;line-height:inherit}`,
|
|
14
|
+
// Add the correct height in Firefox.
|
|
15
|
+
// Correct the inheritance of border color in Firefox.
|
|
16
|
+
// Ensure horizontal rules are visible by default.
|
|
17
|
+
safeStyleSheet `hr{height:0;color:inherit;border-top-width:1px}`,
|
|
18
|
+
// Add the correct text decoration in Chrome, Edge, and Safari.
|
|
19
|
+
safeStyleSheet `abbr:where([title]){text-decoration:underline dotted}`,
|
|
20
|
+
// Add the correct font weight in Edge and Safari.
|
|
21
|
+
safeStyleSheet `b,strong{font-weight:bolder}`,
|
|
22
|
+
// Typography for code elements.
|
|
23
|
+
safeStyleSheet `code,kbd,samp,pre{font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;font-size:1em}`,
|
|
24
|
+
// Add the correct font size in all browsers.
|
|
25
|
+
safeStyleSheet `small{font-size:80%}`,
|
|
26
|
+
// Prevent 'sub' and 'sup' elements from affecting the line height in all browsers.
|
|
27
|
+
safeStyleSheet `sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}`,
|
|
28
|
+
safeStyleSheet `sub{bottom:-0.25em}`,
|
|
29
|
+
safeStyleSheet `sup{top:-0.5em}`,
|
|
30
|
+
// Form elements inheritance and resets.
|
|
31
|
+
safeStyleSheet `button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}`,
|
|
32
|
+
// Remove the inheritance of text transform in Edge and Firefox.
|
|
33
|
+
safeStyleSheet `button,select{text-transform:none}`,
|
|
34
|
+
// Correct the inability to style clickable types in iOS and Safari.
|
|
35
|
+
// Remove default appearance in most browsers.
|
|
36
|
+
// Add cursor: pointer to buttons as requested.
|
|
37
|
+
safeStyleSheet `button,[type='button'],[type='reset'],[type='submit']{-webkit-appearance:button;background-color:transparent;background-image:none;cursor:pointer}`,
|
|
38
|
+
// Use the modern Firefox focus style for all focusable elements.
|
|
39
|
+
safeStyleSheet `:-moz-focusring{outline:auto}`,
|
|
40
|
+
// Remove the additional :invalid styles in Firefox.
|
|
41
|
+
safeStyleSheet `:-moz-ui-invalid{box-shadow:none}`,
|
|
42
|
+
// Add the correct vertical alignment in Chrome and Firefox.
|
|
43
|
+
safeStyleSheet `progress{vertical-align:baseline}`,
|
|
44
|
+
// Correct the cursor style of increment and decrement buttons in Safari.
|
|
45
|
+
safeStyleSheet `::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}`,
|
|
46
|
+
// Search input styles.
|
|
47
|
+
safeStyleSheet `[type='search']{-webkit-appearance:textfield;outline-offset:-2px}`,
|
|
48
|
+
safeStyleSheet `::-webkit-search-decoration{-webkit-appearance:none}`,
|
|
49
|
+
// File upload button.
|
|
50
|
+
safeStyleSheet `::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}`,
|
|
51
|
+
// Summary element style.
|
|
52
|
+
safeStyleSheet `summary{display:list-item}`,
|
|
53
|
+
// Block quotes, descriptions etc resets.
|
|
54
|
+
safeStyleSheet `blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}`,
|
|
55
|
+
// Fieldset reset.
|
|
56
|
+
safeStyleSheet `fieldset{margin:0;padding:0}`,
|
|
57
|
+
// Legend reset.
|
|
58
|
+
safeStyleSheet `legend{padding:0}`,
|
|
59
|
+
// List resets.
|
|
60
|
+
safeStyleSheet `ol,ul,menu{list-style:none;margin:0;padding:0}`,
|
|
61
|
+
// Textareas resizing.
|
|
62
|
+
safeStyleSheet `textarea{resize:vertical}`,
|
|
63
|
+
// Placeholder color.
|
|
64
|
+
safeStyleSheet `::placeholder{opacity:1;color:#9ca3af}`,
|
|
65
|
+
// Button roles.
|
|
66
|
+
safeStyleSheet `button,[role="button"]{cursor:pointer}`,
|
|
67
|
+
// Disabled cursor.
|
|
68
|
+
safeStyleSheet `:disabled{cursor:default}`,
|
|
69
|
+
// Image display.
|
|
70
|
+
safeStyleSheet `img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}`,
|
|
71
|
+
// Image constraints.
|
|
72
|
+
safeStyleSheet `img,video{max-width:100%;height:auto}`,
|
|
73
|
+
// Hidden attribute.
|
|
74
|
+
safeStyleSheet `[hidden]{display:none}`,
|
|
75
|
+
// Dialog backdrop as requested.
|
|
76
|
+
safeStyleSheet `dialog{padding:0}`,
|
|
77
|
+
safeStyleSheet `dialog::backdrop{background:rgba(0,0,0,0.5)}`,
|
|
20
78
|
]);
|
|
21
79
|
}
|
|
22
80
|
//# sourceMappingURL=css_gen_basic.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css_gen_basic.js","sourceRoot":"","sources":["../src/css_gen_basic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAuB,cAAc,EAAE,MAAM,YAAY,CAAC;AAEpF,MAAM,CAAC,OAAO,UAAU,KAAK;IAC5B,
|
|
1
|
+
{"version":3,"file":"css_gen_basic.js","sourceRoot":"","sources":["../src/css_gen_basic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAuB,cAAc,EAAE,MAAM,YAAY,CAAC;AAEpF,MAAM,CAAC,OAAO,UAAU,KAAK;IAC5B,4BAA4B;IAC5B,OAAO,iBAAiB,CAAC;QACxB,2DAA2D;QAC3D,cAAc,CAAA,kGAAkG;QAEhH,yDAAyD;QACzD,qEAAqE;QACrE,gCAAgC;QAChC,2DAA2D;QAC3D,cAAc,CAAA,2QAA2Q;QAEzR,yBAAyB;QACzB,cAAc,CAAA,oCAAoC;QAElD,qCAAqC;QACrC,sDAAsD;QACtD,kDAAkD;QAClD,cAAc,CAAA,iDAAiD;QAE/D,+DAA+D;QAC/D,cAAc,CAAA,uDAAuD;QAErE,kDAAkD;QAClD,cAAc,CAAA,8BAA8B;QAE5C,gCAAgC;QAChC,cAAc,CAAA,iJAAiJ;QAE/J,6CAA6C;QAC7C,cAAc,CAAA,sBAAsB;QAEpC,mFAAmF;QACnF,cAAc,CAAA,gFAAgF;QAC9F,cAAc,CAAA,qBAAqB;QACnC,cAAc,CAAA,iBAAiB;QAE/B,wCAAwC;QACxC,cAAc,CAAA,kNAAkN;QAEhO,gEAAgE;QAChE,cAAc,CAAA,oCAAoC;QAElD,oEAAoE;QACpE,8CAA8C;QAC9C,+CAA+C;QAC/C,cAAc,CAAA,oJAAoJ;QAElK,iEAAiE;QACjE,cAAc,CAAA,+BAA+B;QAE7C,oDAAoD;QACpD,cAAc,CAAA,mCAAmC;QAEjD,4DAA4D;QAC5D,cAAc,CAAA,mCAAmC;QAEjD,yEAAyE;QACzE,cAAc,CAAA,sEAAsE;QAEpF,uBAAuB;QACvB,cAAc,CAAA,mEAAmE;QACjF,cAAc,CAAA,sDAAsD;QAEpE,sBAAsB;QACtB,cAAc,CAAA,sEAAsE;QAEpF,yBAAyB;QACzB,cAAc,CAAA,4BAA4B;QAE1C,yCAAyC;QACzC,cAAc,CAAA,8DAA8D;QAE5E,kBAAkB;QAClB,cAAc,CAAA,8BAA8B;QAE5C,gBAAgB;QAChB,cAAc,CAAA,mBAAmB;QAEjC,eAAe;QACf,cAAc,CAAA,gDAAgD;QAE9D,sBAAsB;QACtB,cAAc,CAAA,2BAA2B;QAEzC,qBAAqB;QACrB,cAAc,CAAA,wCAAwC;QAEtD,gBAAgB;QAChB,cAAc,CAAA,wCAAwC;QAEtD,mBAAmB;QACnB,cAAc,CAAA,2BAA2B;QAEzC,iBAAiB;QACjB,cAAc,CAAA,qFAAqF;QAEnG,qBAAqB;QACrB,cAAc,CAAA,uCAAuC;QAErD,oBAAoB;QACpB,cAAc,CAAA,wBAAwB;QAEtC,gCAAgC;QAChC,cAAc,CAAA,mBAAmB;QACjC,cAAc,CAAA,8CAA8C;KAC5D,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { concatStyleSheets, safeStyleSheet } from "safevalues";
|
|
2
|
+
export default function rules() {
|
|
3
|
+
// Based on https://www.swyx.io/css-100-bytes.
|
|
4
|
+
return concatStyleSheets([
|
|
5
|
+
safeStyleSheet `html{`,
|
|
6
|
+
safeStyleSheet `max-width: 70ch;`,
|
|
7
|
+
safeStyleSheet `padding: 2em 1em;`,
|
|
8
|
+
safeStyleSheet `margin: auto;`,
|
|
9
|
+
safeStyleSheet `line-height: 1.75;`,
|
|
10
|
+
safeStyleSheet `font-size: 1.25em;`,
|
|
11
|
+
safeStyleSheet `font-family: sans-serif;`,
|
|
12
|
+
safeStyleSheet `}`,
|
|
13
|
+
safeStyleSheet `h1,h2,h3,h4,h5,h6{`,
|
|
14
|
+
safeStyleSheet `margin: 1em 0 0.5em;`,
|
|
15
|
+
safeStyleSheet `}`,
|
|
16
|
+
safeStyleSheet `p,ul,ol{`,
|
|
17
|
+
safeStyleSheet `margin-bottom: 1em;`,
|
|
18
|
+
safeStyleSheet `color: #1d1d1d;`,
|
|
19
|
+
safeStyleSheet `}`,
|
|
20
|
+
]);
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=css_gen_minimal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css_gen_minimal.js","sourceRoot":"","sources":["../src/css_gen_minimal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAuB,cAAc,EAAE,MAAM,YAAY,CAAC;AAEpF,MAAM,CAAC,OAAO,UAAU,KAAK;IAC5B,8CAA8C;IAC9C,OAAO,iBAAiB,CAAC;QACxB,cAAc,CAAA,OAAO;QACrB,cAAc,CAAA,kBAAkB;QAChC,cAAc,CAAA,mBAAmB;QACjC,cAAc,CAAA,eAAe;QAC7B,cAAc,CAAA,oBAAoB;QAClC,cAAc,CAAA,oBAAoB;QAClC,cAAc,CAAA,0BAA0B;QACxC,cAAc,CAAA,GAAG;QACjB,cAAc,CAAA,oBAAoB;QAClC,cAAc,CAAA,sBAAsB;QACpC,cAAc,CAAA,GAAG;QACjB,cAAc,CAAA,UAAU;QACxB,cAAc,CAAA,qBAAqB;QACnC,cAAc,CAAA,iBAAiB;QAC/B,cAAc,CAAA,GAAG;KACjB,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/mancha.js
CHANGED
|
@@ -8,27 +8,27 @@ function i(e,t){let n=r(t);n!==void 0&&(e.href=n)}
|
|
|
8
8
|
* @license
|
|
9
9
|
* SPDX-License-Identifier: Apache-2.0
|
|
10
10
|
*/
|
|
11
|
-
function a(e,t){let n=r(t);n!==void 0&&(e.href=n)}let o={};var s=class{constructor(e,t){this.privateDoNotAccessOrElseWrappedAttributePrefix=t}toString(){return this.privateDoNotAccessOrElseWrappedAttributePrefix}};let c=s;function l(e){return new c(o,e)}function u(e){return e instanceof s}function ee(e){if(u(e))return e.privateDoNotAccessOrElseWrappedAttributePrefix;throw Error(``)}function te(e,t,n,r){if(e.length===0)throw Error(``);let i=e.map(e=>ee(e)),a=n.toLowerCase();if(i.every(e=>a.indexOf(e)!==0))throw Error(`Attribute "${n}" does not match any of the allowed prefixes.`);t.setAttribute(n,r)}var ne=class{},d=class extends ne{constructor(e,t){super(),this.privateDoNotAccessOrElseWrappedStyleSheet=e}toString(){return this.privateDoNotAccessOrElseWrappedStyleSheet}};function re(e){return new d(e,o)}function
|
|
11
|
+
function a(e,t){let n=r(t);n!==void 0&&(e.href=n)}let o={};var s=class{constructor(e,t){this.privateDoNotAccessOrElseWrappedAttributePrefix=t}toString(){return this.privateDoNotAccessOrElseWrappedAttributePrefix}};let c=s;function l(e){return new c(o,e)}function u(e){return e instanceof s}function ee(e){if(u(e))return e.privateDoNotAccessOrElseWrappedAttributePrefix;throw Error(``)}function te(e,t,n,r){if(e.length===0)throw Error(``);let i=e.map(e=>ee(e)),a=n.toLowerCase();if(i.every(e=>a.indexOf(e)!==0))throw Error(`Attribute "${n}" does not match any of the allowed prefixes.`);t.setAttribute(n,r)}var ne=class{},d=class extends ne{constructor(e,t){super(),this.privateDoNotAccessOrElseWrappedStyleSheet=e}toString(){return this.privateDoNotAccessOrElseWrappedStyleSheet}};function re(e){return new d(e,o)}function ie(e){if(e instanceof d)return e.privateDoNotAccessOrElseWrappedStyleSheet;throw Error(``)}
|
|
12
12
|
/**
|
|
13
13
|
* @license
|
|
14
14
|
* SPDX-License-Identifier: Apache-2.0
|
|
15
15
|
*/
|
|
16
|
-
function
|
|
17
|
-
`,
|
|
18
|
-
`,
|
|
19
|
-
`,
|
|
20
|
-
`,
|
|
21
|
-
`,
|
|
22
|
-
`,
|
|
23
|
-
`,
|
|
24
|
-
`,
|
|
25
|
-
`,
|
|
26
|
-
`,
|
|
27
|
-
`,
|
|
28
|
-
`,
|
|
29
|
-
`,
|
|
30
|
-
`,
|
|
31
|
-
`,
|
|
16
|
+
function f(e,t){e.textContent=ie(t)}function p(e){return l(e[0].toLowerCase())}function m(e){let t=e[0];return re(t)}function ae(e){return re(e.map(ie).join(``))}let oe=[p`:`,p`style`,p`class`];function*h(e,t=new Set){let n=new Set,r=Array.from(e.childNodes).filter(e=>!t.has(e));for(yield e;r.length;){let e=r.shift();n.has(e)||(n.add(e),yield e),e.childNodes&&Array.from(e.childNodes).filter(e=>!t.has(e)).forEach(e=>{r.push(e)})}}function g(e,t){return e?.[t]!==void 0}function _(e,t){return typeof e?.[t]==`function`}function v(e){return e.replace(/-./g,e=>e[1].toUpperCase())}function y(e,t){return e.attribs?e.attribs[t]??null:e.getAttribute?.(t)??null}function se(e,t){return e.attribs?t in e.attribs:e.hasAttribute?.(t)??!1}function b(e,t,n=``){return y(e,n+t)||y(e,`data-${t}`)||(e.dataset?.[v(t)]??null)}function x(e,t,n){e.attribs?e.attribs[t]=n:e.setAttribute?.(t,n)}function S(e,t,n){e.attribs?e.attribs[t]=n:te(oe,e,t,n)}function C(e,t,n){switch(t){case`disabled`:e.disabled=n;return;case`selected`:e.selected=n;return;case`checked`:e.checked=n;return;default:e[t]=n}}function w(e,t){e.attribs?delete e.attribs[t]:e.removeAttribute?.(t)}function ce(e,t,n,r=``){se(e,`${r}${t}`)?x(e,`${r}${t}`,n):se(e,`data-${t}`)?x(e,`data-${t}`,n):x(e,`${r}${t}`,n)}function T(e,t,n=``){w(e,`${n}${t}`),w(e,`data-${t}`)}function le(e,t,n){if(e.attribs&&t.attribs)t.attribs[n]=e.attribs[n];else if(n.startsWith(`data-`)){let r=v(n.slice(5));t.dataset&&e.dataset&&(t.dataset[r]=e.dataset[r])}else{let r=e?.getAttribute?.(n);S(t,n,r||``)}}function ue(e){return g(e,`firstElementChild`)?e.firstElementChild:Array.from(e.children).find(e=>e.nodeType===1)}function E(e,...t){if(_(e,`replaceWith`)){e.replaceWith(...t);return}else{let n=e,r=n.parentNode;if(!r)return;let i=Array.from(r.childNodes).indexOf(n);n.parentNode=null,t.forEach(e=>{e.parentNode=r}),r.childNodes=[].concat(Array.from(r.childNodes).slice(0,i),t,Array.from(r.childNodes).slice(i+1))}}function D(e,...t){_(e,`replaceChildren`)?e.replaceChildren(...t):(e.childNodes=t,t.forEach(t=>{t.parentNode=e}))}function O(e,t){return _(t,`appendChild`)?e.appendChild(t):(e.childNodes.push(t),t.parentNode=e,t)}function k(e,t){return _(t,`removeChild`)?e.removeChild(t):(D(e,...Array.from(e.childNodes).filter(e=>e!==t)),t)}function A(e,t,n){return n?_(e,`insertBefore`)?e.insertBefore(t,n):(E(n,t,n),t):O(e,t)}function de(e,t=0){return e?e.length<=t?e:`${e.slice(0,t-1)}…`:``}function j(e,t=0){return globalThis.DocumentFragment&&e instanceof DocumentFragment?Array.from(e.childNodes).map(e=>j(e,t)).join(``):de(e.outerHTML||e.nodeValue||String(e),t)}function M(e){return e.includes(`/`)?e.split(`/`).slice(0,-1).join(`/`):``}function fe(e){return!e.includes(`://`)&&!e.startsWith(`/`)&&!e.startsWith(`#`)&&!e.startsWith(`data:`)}var pe=class e{iterable;constructor(e){this.iterable=e}filter(t){return new e(e.filterGenerator(t,this.iterable))}map(t){return new e(e.mapGenerator(t,this.iterable))}find(e){for(let t of this.iterable)if(e(t))return t}array(){return Array.from(this.iterable)}*generator(){for(let e of this.iterable)yield e}static*filterGenerator(e,t){for(let n of t)e(n)&&(yield n)}static*mapGenerator(e,t){for(let n of t)yield e(n)}static equals(e,t){let n=e[Symbol.iterator](),r=t[Symbol.iterator](),i=n.next(),a=r.next();for(;!i.done&&!a.done;){if(i.value!==a.value)return!1;i=n.next(),a=r.next()}return i.done===a.done}};let N;(function(e){e.resolveIncludes=async function(e,t){let n=e,r=n.tagName?.toLowerCase();if(![`include`,`link`].includes(r)||r===`link`&&y(n,`rel`)!==`subresource`)return;this.log(`include directive found in:
|
|
17
|
+
`,j(e,128)),this.log(`include params:`,t);let i=n.tagName.toLocaleLowerCase()===`link`?`href`:`src`,a=y(n,i);if(!a)throw Error(`"${i}" attribute missing from ${j(e,128)}.`);let o=[];r===`include`&&o.push(`src`),r===`link`&&o.push(`rel`,`href`);let s=t=>{let r=ue(t);for(let e of Array.from(n.attributes))r&&!o.includes(e.name)&&le(n,r,e.name);E(e,...t.childNodes)},c={...t,rootDocument:!1,maxdepth:(t?.maxdepth??100)-1};if(c.maxdepth===0)throw Error(`Maximum recursion depth reached.`);if(a.includes(`://`)||a.startsWith(`//`))this.log(`Including remote file from absolute path:`,a),await this.preprocessRemote(a,c).then(s);else if(t?.dirpath?.includes(`://`)||t?.dirpath?.startsWith(`//`)){let e=a.startsWith(`/`)?a:`${t.dirpath}/${a}`;this.log(`Including remote file from relative path:`,e),await this.preprocessRemote(e,c).then(s)}else if(a.charAt(0)===`/`)this.log(`Including local file from absolute path:`,a),await this.preprocessLocal(a,c).then(s);else{let e=t?.dirpath&&t?.dirpath!==`.`?`${t?.dirpath}/${a}`:a;this.log(`Including local file from relative path:`,e),await this.preprocessLocal(e,c).then(s)}},e.rebaseRelativePaths=function(e,t){let n=e,r=n.tagName?.toLowerCase();if(!t?.dirpath)return;let o=y(n,`src`),s=y(n,`href`),c=b(n,`render`,`:`),l=o||s||c;if(!l||!fe(l))return;let u=`${t.dirpath}/${l}`;this.log(`Rebasing relative path as:`,u),c?ce(n,`render`,u,`:`):g(n,`attribs`)?S(n,o?`src`:`href`,u):r===`img`?n.src=u:r===`a`?i(n,u):r===`source`||r===`audio`||r===`video`||r===`track`||r===`input`?n.src=u:r===`area`?a(n,u):this.log(`Unable to rebase relative path for element:`,r)},e.registerCustomElements=function(e,t){let n=e,r=n.tagName?.toLowerCase(),i=(y(n,`is`)||y(n,`alt`))?.toLowerCase();if([`template`,`div`].includes(r)&&i){if(r===`div`&&y(n,`role`)!==`template`)return;if(!this._customElements.has(i)){this.log(`Registering custom element: ${i}\n`,j(n,128));let e=n.content||n,r=Array.from(h(e));for(let e=1;e<r.length;e++)N.rebaseRelativePaths.call(this,r[e],t);this._customElements.set(i,n),n?.parentNode&&k(n.parentNode,n)}}},e.resolveCustomElements=function(e,t){let n=e,r=n.tagName?.toLowerCase(),i=r;if(i===`div`&&(i=y(n,`role`)?.toLowerCase()||i),i&&this._customElements.has(i)){this.log(`Processing custom element: ${i}\n`,j(n,128));let t=this._customElements.get(i),a=(t.content||t).cloneNode(!0),o=ue(a);if(o)for(let e of Array.from(n.attributes))(r!==`div`||e.name!==`role`)&&le(n,o,e.name);let s=new pe(h(a)).find(e=>e.tagName?.toLowerCase()===`slot`);s&&E(s,...n.childNodes),E(e,...a.childNodes)}},e.resolveTextNodeExpressions=function(e,t){let n=e.nodeValue||``;if(e.nodeType!==3||!n?.trim())return;this.log(`Processing node content value:
|
|
18
|
+
`,de(n,128));let r=new RegExp(/{{ ([^}]+) }}/gm),i=Array.from(n.matchAll(r)).map(e=>e[1]);return this.effect(function(){let t=n;for(let n of i){let r=this.eval(n,{$elem:e});t=t.replace(`{{ ${n} }}`,String(r))}e.nodeValue=t})},e.resolveDataAttribute=async function(e,t){if(this._skipNodes.has(e))return;let n=e,r=b(n,`data`,`:`);if(r){this.log(`:data attribute found in:
|
|
19
|
+
`,j(e,128)),T(n,`data`,`:`);let i;g(e,`renderer`)?(i=e.renderer,this.log(`Reusing existing subrenderer for node:`,j(e,64))):(i=this.subrenderer(),C(e,`renderer`,i),this.log(`Created and attached new subrenderer for node:`,j(e,64)));let a=i.eval(r,{$elem:e});if(await Promise.all(Object.entries(a).map(([e,t])=>e.startsWith(`$$`)?(i._store.get(`$rootRenderer`)||i).set(e,t):i._store.set(e,t))),i===this)return;for(let t of h(e,this._skipNodes))this._skipNodes.add(t);await i.mount(e,t)}},e.resolveClassAttribute=function(e,t){if(this._skipNodes.has(e))return;let n=e,r=b(n,`class`,`:`);if(r){this.log(`:class attribute found in:
|
|
20
|
+
`,j(e,128)),T(n,`class`,`:`);let t=y(n,`class`)||``;return this.effect(function(){let i=this.eval(r,{$elem:e});S(n,`class`,(i?`${t} ${i}`:t).trim())})}},e.resolveTextAttributes=function(e,t){if(this._skipNodes.has(e))return;let n=e,r=b(n,`text`,`:`);if(r){this.log(`:text attribute found in:
|
|
21
|
+
`,j(e,128)),T(n,`text`,`:`);let t=t=>this.textContent(e,t);return this.effect(function(){t(this.eval(r,{$elem:e}))})}},e.resolveHtmlAttribute=async function(e,t){if(this._skipNodes.has(e))return;let n=e,r=b(n,`html`,`:`);if(r)return this.log(`:html attribute found in:
|
|
22
|
+
`,j(e,128)),T(n,`html`,`:`),this.effect(function(){let i=this.eval(r,{$elem:e});return new Promise(e=>{(async()=>{let r=await this.preprocessString(i,t);await this.renderNode(r),D(n,r),e()})()})})},e.resolveEventAttributes=function(e,t){if(this._skipNodes.has(e))return;let n=e;for(let t of Array.from(n.attributes||[]))if(t.name.startsWith(`:on:`)||t.name.startsWith(`data-on-`)){let r=``,i=[];if(t.name.startsWith(`:on:`)?[r,...i]=t.name.substring(4).split(`.`):t.name.startsWith(`data-on-`)&&([r,...i]=t.name.substring(8).split(`.`)),!r)throw Error(`Invalid event attribute: ${t.name}`);this.log(t.name,`attribute found in:
|
|
23
|
+
`,j(e,128)),T(n,t.name);let a=r===`submit`&&n.tagName.toUpperCase()===`FORM`;e.addEventListener?.(r,n=>((i.includes(`prevent`)||a)&&n.preventDefault(),this.eval(t.value,{$elem:e,$event:n})))}},e.resolveForAttribute=async function(e,t){if(this._skipNodes.has(e))return;let n=e,r=b(n,`for`,`:`)?.trim();if(r){this.log(`:for attribute found in:
|
|
24
|
+
`,j(e,128)),T(n,`for`,`:`);for(let t of h(e,this._skipNodes))this._skipNodes.add(t);let i=y(n,`style`)||``;x(n,`style`,`display: none;`);let a=e.parentNode;if(!a)return;let o=this.createElement(`template`,e.ownerDocument);A(a,o,e),k(a,e),`content`in o?O(o.content,e):O(o,e),this.log(`:for template:
|
|
25
|
+
`,j(o,128));let s=r.split(` in `,2);if(s.length!==2)throw Error(`Invalid :for format: \`${r}\`. Expected "{key} in {expression}".`);let c=[],[l,u]=s;await this.effect(function(){let n=this.eval(u,{$elem:e});if(this.log(`:for list items:`,n),c.splice(0,c.length).forEach(e=>{e.parentNode===a&&k(a,e),this._skipNodes.delete(e)}),!Array.isArray(n))return console.error(`Expression did not yield a list: \`${u}\` => \`${n}\``),Promise.resolve();let r=[];for(let a of n){let n=this.subrenderer();n._store.set(l,a);let o=e.cloneNode(!0);x(o,`style`,i),c.push(o),this._skipNodes.add(o),r.push(n.mount(o,t)),this.log(`Rendered list child:
|
|
26
|
+
`,j(o,128))}let s=o.nextSibling;for(let e of c)A(a,e,s);return Promise.all(r)})}},e.resolveBindAttribute=function(e,t){if(this._skipNodes.has(e))return;let n=e,r=b(n,`bind`,`:`);if(r){this.log(`:bind attribute found in:
|
|
27
|
+
`,j(e,128));let t=y(n,`:bind:on`)?.split(`,`)||n.dataset?.bindOn?.split(`,`)||[`change`,`input`];T(n,`bind`,`:`),w(n,`:bind:on`),w(n,`data-bind-on`);let i=y(n,`type`)===`checkbox`?`checked`:`value`;!r.includes(`.`)&&!this.has(r)&&this.set(r,``),this.effect(function(){let t=this.eval(r,{$elem:e});i===`checked`?n.checked=!!t:n.value=t});let a=`${r} = $elem.${i}`;for(let n of t)e.addEventListener(n,()=>this.eval(a,{$elem:e}))}},e.resolveIfAttribute=function(e,t){if(this._skipNodes.has(e))return;let n=e,r=b(n,`if`,`:`);if(r){this.log(`:if attribute found in:
|
|
28
|
+
`,j(e,128)),T(n,`if`,`:`);let t=this.createComment(` :if placeholder `,e.ownerDocument);this.effect(function(){this.eval(r,{$elem:e})?!n.parentNode&&t.parentNode&&E(t,n):n.parentNode&&E(n,t)})}},e.resolveShowAttribute=function(e,t){if(this._skipNodes.has(e))return;let n=e,r=b(n,`show`,`:`);if(r){this.log(`:show attribute found in:
|
|
29
|
+
`,j(e,128)),T(n,`show`,`:`);let t=n.style?.display===`none`?``:n.style?.display??y(n,`style`)?.split(`;`)?.find(e=>e.split(`:`)[0]===`display`)?.split(`:`)?.at(1)?.trim();this.effect(function(){let i=this.eval(r,{$elem:e});n.style?n.style.display=i?t:`none`:S(n,`style`,`display: ${i?t:`none`};`)})}},e.resolveCustomAttribute=function(e,t){if(this._skipNodes.has(e))return;let n=e;for(let t of Array.from(n.attributes||[])){let r=`:attr:`,i=`data-attr-`;if(t.name.startsWith(r)||t.name.startsWith(i)){this.log(t.name,`attribute found in:
|
|
30
|
+
`,j(e,128)),w(n,t.name);let a=(t.name.split(r,2).at(-1)||``).split(i,2).at(-1)??``;this.effect(function(){x(n,a,this.eval(t.value,{$elem:e}))})}}},e.resolveCustomProperty=function(e,t){if(this._skipNodes.has(e))return;let n=e;for(let t of Array.from(n.attributes||[])){let r=`:prop:`,i=`data-prop-`;if(t.name.startsWith(r)||t.name.startsWith(i)){this.log(t.name,`property found in:
|
|
31
|
+
`,j(e,128)),w(n,t.name);let a=v((t.name.split(r,2).at(-1)||``).split(i,2).at(-1)??``);this.effect(function(){C(n,a,this.eval(t.value,{$elem:e}))})}}},e.stripTypes=(e,t)=>{let n=e;y(n,`:types`)&&w(n,`:types`),y(n,`data-types`)&&w(n,`data-types`)},e.resolveRenderAttribute=async function(e,t){if(this._skipNodes.has(e))return;let n=e,r=b(n,`render`,`:`);if(!r)return;this.log(`:render attribute found: ${r}`),T(n,`render`,`:`);let i;g(e,`renderer`)?(i=e.renderer,this.log(`Reusing existing subrenderer for :render:`,j(e,64))):(i=this.subrenderer(),C(n,`renderer`,i)),await i.mount(e,t);for(let t of h(e,this._skipNodes))this._skipNodes.add(t);try{let e=await import(r);typeof e.default==`function`?await e.default(n,i):e.default!==void 0&&console.warn(`Module ${r} default export is not a function`)}catch(e){console.error(`Failed to execute render init from ${r}:`,e)}}})(N||={});function P(){return new URL(globalThis.window?.location?.href||`http://localhost/`)}function me(e){return e.substring(2)}function he(e){return`\$\$${e}`}function ge(e){return e.keys().filter(e=>e.startsWith(`$$`))}async function _e(e,t){for(let[n,r]of t.searchParams.entries()){let t=he(n);e.get(t)!==r&&await e.set(t,r)}}function ve(e,t,n){let r=me(t),i=!1;if(!n)e.searchParams.has(r)&&(e.searchParams.delete(r),i=!0);else{let t=String(n);e.searchParams.get(r)!==t&&(e.searchParams.set(r,t),i=!0)}return i}function ye(e,t){let n=!1;for(let r of ge(t))ve(e,r,t.get(r))&&(n=!0);n&&globalThis.window?.history?.replaceState({},``,e.toString())}function be(e){return async()=>{let t=P(),n=new Set;for(let[r,i]of t.searchParams.entries()){let t=he(r);n.add(t),e.get(t)!==i&&e.set(t,i)}let r=ge(e);for(let t of r)n.has(t)||e.del(t)}}async function xe(e){let t=P();await _e(e,t),ye(t,e),e.addKeyHandler(/^\$\$/,(e,t)=>{let n=P();ve(n,e,t)&&globalThis.window?.history?.replaceState({},``,n.toString())}),globalThis.window?.addEventListener(`popstate`,be(e))}
|
|
32
32
|
/*
|
|
33
33
|
* @license
|
|
34
34
|
* Portions Copyright (c) 2013, the Dart project authors.
|
|
@@ -38,11 +38,11 @@ let Se=new Set([`this`,`typeof`]),Ce=new Set([`in`]),we=new Set([`+`,`-`,`!`,`ty
|
|
|
38
38
|
* @license
|
|
39
39
|
* Portions Copyright (c) 2013, the Dart project authors.
|
|
40
40
|
*/
|
|
41
|
-
let ke=new Set([`==`,`!=`,`<=`,`>=`,`||`,`&&`,`??`,`?.`]),Ae=new Set([`===`,`!==`]),I=function(e){return e[e.STRING=1]=`STRING`,e[e.IDENTIFIER=2]=`IDENTIFIER`,e[e.DOT=3]=`DOT`,e[e.COMMA=4]=`COMMA`,e[e.COLON=5]=`COLON`,e[e.INTEGER=6]=`INTEGER`,e[e.DECIMAL=7]=`DECIMAL`,e[e.OPERATOR=8]=`OPERATOR`,e[e.GROUPER=9]=`GROUPER`,e[e.KEYWORD=10]=`KEYWORD`,e[e.ARROW=11]=`ARROW`,e[e.OPTIONAL_DOT=12]=`OPTIONAL_DOT`,e[e.SPREAD=13]=`SPREAD`,e}({}),L=(e,t,n=0)=>({kind:e,value:t,precedence:n}),je=e=>e===9||e===10||e===13||e===32,
|
|
42
|
-
`;case`r`:return`\r`;case`t`:return` `;case`b`:return`\b`;case`f`:return`\f`;default:return t}});var ze=class{_input;_index=-1;_tokenStart=0;_next;constructor(e){this._input=e,this._advance()}nextToken(){for(;je(this._next??-1);)this._advance(!0);if(Fe(this._next??-1))return this._tokenizeString();if(Me(this._next??-1))return this._tokenizeIdentOrKeyword();if(R(this._next??-1))return this._tokenizeNumber();if(this._next===46)return this._tokenizeDot();if(this._next===44)return this._tokenizeComma();if(this._next===58)return this._tokenizeColon();if(Ie(this._next??-1))return this._tokenizeOperator();if(Le(this._next??-1))return this._tokenizeGrouper();if(this._advance(),this._next!==void 0)throw Error(`Expected end of input, got ${this._next}`)}_advance(e){this._index++,this._index<this._input.length?(this._next=this._input.charCodeAt(this._index),e===!0&&(this._tokenStart=this._index)):this._next=void 0}_getValue(e=0){let t=this._input.substring(this._tokenStart,this._index+e);return e===0&&this._clearValue(),t}_clearValue(){this._tokenStart=this._index}_tokenizeString(){let e=this._next;for(this._advance(!0);this._next!==e;){if(this._next===void 0||this._next===92&&(this._advance(),this._next===void 0))throw Error(`unterminated string`);this._advance()}let t=L(I.STRING,Re(this._getValue()));return this._advance(),t}_tokenizeIdentOrKeyword(){do this._advance();while(Ne(this._next??-1));let e=this._getValue();return L(Pe(e)?I.KEYWORD:Ce.has(e)?I.OPERATOR:I.IDENTIFIER,e,F[e]??0)}_tokenizeNumber(){do this._advance();while(R(this._next??-1));return this._next===46?this._tokenizeDot():L(I.INTEGER,this._getValue())}_tokenizeDot(){if(this._advance(),R(this._next??-1))return this._tokenizeFraction();if(this._next===46){if(this._advance(),this._next===46)return this._advance(),this._clearValue(),L(I.SPREAD,`...`);throw Error(`Unexpected token ..`)}return this._clearValue(),L(I.DOT,`.`,13)}_tokenizeComma(){return this._advance(!0),L(I.COMMA,`,`)}_tokenizeColon(){return this._advance(!0),L(I.COLON,`:`)}_tokenizeFraction(){do this._advance();while(R(this._next??-1));return L(I.DECIMAL,this._getValue())}_tokenizeOperator(){this._advance();let e=this._getValue(2);if(Ae.has(e))this._advance(),this._advance();else{if(e=this._getValue(1),e===`=>`)return this._advance(),L(I.ARROW,e);ke.has(e)&&this._advance()}return e=this._getValue(),e===`?.`?L(I.OPTIONAL_DOT,e,13):L(I.OPERATOR,e,F[e])}_tokenizeGrouper(){let e=String.fromCharCode(this._next??0),t=L(I.GROUPER,e,F[e]);return this._advance(!0),t}};let Be=(e,t)=>new Ve(e,t).parse();var Ve=class{_kind;_tokenizer;_ast;_token;_value;constructor(e,t){this._tokenizer=new ze(e),this._ast=t}parse(){this._advance();let e=this._parseExpression();if(this._token)throw Error(`Unexpected token: ${this._token.value}`);return e}_advance(e,t){if(!this._matches(e,t))throw Error(`Expected kind ${e} (${t}), was ${this._token?.kind} (${this._token?.value})`);let n=this._tokenizer.nextToken();this._token=n,this._kind=n?.kind,this._value=n?.value}_matches(e,t){return!(e&&this._kind!==e||t&&this._value!==t)}_parseExpression(){if(!this._token)return this._ast.empty();let e=this._parseUnary();return e===void 0?void 0:this._parsePrecedence(e,0)}_parsePrecedence(e,t){if(e===void 0)throw Error(`Expected left to be defined.`);for(;this._token;)if(this._matches(I.GROUPER,`(`)){let t=this._parseArguments();e=this._ast.invoke(e,void 0,t)}else if(this._matches(I.GROUPER,`[`)){let t=this._parseIndex();e=this._ast.index(e,t)}else if(this._matches(I.DOT)||this._matches(I.OPTIONAL_DOT)){let t=this._kind===I.OPTIONAL_DOT;if(this._advance(),t&&this._matches(I.GROUPER,`[`)){let t=this._parseIndex();e=this._ast.index(e,t,!0)}else if(t&&this._matches(I.GROUPER,`(`)){let t=this._parseArguments();e=this._ast.invoke(e,void 0,t,!0)}else{let n=this._parseUnary();e=this._makeInvokeOrGetter(e,n,t)}}else if(this._matches(I.KEYWORD))break;else if(this._matches(I.OPERATOR)&&this._token.precedence>=t)e=this._value===`?`?this._parseTernary(e):this._parseBinary(e,this._token);else break;return e}_makeInvokeOrGetter(e,t,n){if(t===void 0)throw Error(`expected identifier`);if(t.type===`ID`)return this._ast.getter(e,t.value,n);if(t.type===`Invoke`&&t.receiver.type===`ID`){let r=t.receiver;return this._ast.invoke(e,r.value,t.arguments,n)}else throw Error(`expected identifier: ${t}`)}_parseBinary(e,t){if(!Te.has(t.value))throw Error(`unknown operator: ${t.value}`);this._advance();let n=this._parseUnary();for(;(this._kind===I.OPERATOR||this._kind===I.DOT||this._kind===I.GROUPER)&&this._token&&(this._token.precedence??0)>t.precedence;)n=this._parsePrecedence(n,this._token?.precedence??0);if(n===void 0)throw Error(`Expected expression after ${t.value}`);return this._ast.binary(e,t.value,n)}_parseUnary(){if(this._matches(I.KEYWORD,`typeof`)){this._advance();let e=this._parsePrecedence(this._parsePrimary(),13);return this._ast.unary(`typeof`,e)}if(this._matches(I.OPERATOR)){let e=this._value;if(this._advance(),e===`+`||e===`-`){if(this._matches(I.INTEGER))return this._parseInteger(e);if(this._matches(I.DECIMAL))return this._parseDecimal(e)}if(!e||!we.has(e))throw Error(`unexpected token: ${e}`);let t=this._parsePrecedence(this._parsePrimary(),13);return this._ast.unary(e,t)}return this._parsePrimary()}_parseTernary(e){this._advance(I.OPERATOR,`?`);let t=this._parseExpression();this._advance(I.COLON);let n=this._parseExpression();return this._ast.ternary(e,t,n)}_parsePrimary(){switch(this._kind){case I.KEYWORD:{let e=this._value??``;if(e===`this`)return this._advance(),this._ast.id(e);throw Se.has(e)?Error(`unexpected keyword: ${e}`):Error(`unrecognized keyword: ${e}`)}case I.IDENTIFIER:return this._parseInvokeOrIdentifier();case I.STRING:return this._parseString();case I.INTEGER:return this._parseInteger();case I.DECIMAL:return this._parseDecimal();case I.GROUPER:return this._value===`(`?this._parseParenOrFunction():this._value===`{`?this._parseMap():this._value===`[`?this._parseList():void 0;case I.COLON:throw Error(`unexpected token ":"`);default:return}}_parseList(){let e=[];do{if(this._advance(),this._matches(I.GROUPER,`]`))break;if(this._matches(I.SPREAD)){this._advance();let t=this._parseExpression();t&&e.push(this._ast.spreadElement(t))}else e.push(this._parseExpression())}while(this._matches(I.COMMA));return this._advance(I.GROUPER,`]`),this._ast.list(e)}_parseMap(){let e=[];do{if(this._advance(),this._matches(I.GROUPER,`}`))break;if(this._matches(I.SPREAD)){this._advance();let t=this._parseExpression();t&&e.push(this._ast.spreadProperty(t))}else{let t=this._value??``;if((this._matches(I.STRING)||this._matches(I.IDENTIFIER))&&this._advance(),this._matches(I.COLON)){this._advance(I.COLON);let n=this._parseExpression();n&&e.push(this._ast.property(t,n))}else e.push(this._ast.property(t,this._ast.id(t)))}}while(this._matches(I.COMMA));return this._advance(I.GROUPER,`}`),this._ast.map(e)}_parseInvokeOrIdentifier(){let e=this._value;if(e===`true`)return this._advance(),this._ast.literal(!0);if(e===`false`)return this._advance(),this._ast.literal(!1);if(e===`null`)return this._advance(),this._ast.literal(null);if(e===`undefined`)return this._advance(),this._ast.literal(void 0);let t=this._parseIdentifier(),n=this._parseArguments();return n?this._ast.invoke(t,void 0,n):t}_parseIdentifier(){if(!this._matches(I.IDENTIFIER))throw Error(`expected identifier: ${this._value}`);let e=this._value;return this._advance(),this._ast.id(e??``)}_parseArguments(){if(!this._matches(I.GROUPER,`(`))return;let e=[];do{if(this._advance(),this._matches(I.GROUPER,`)`))break;if(this._matches(I.SPREAD)){this._advance();let t=this._parseExpression();t&&e.push(this._ast.spreadElement(t))}else{let t=this._parseExpression();e.push(t)}}while(this._matches(I.COMMA));return this._advance(I.GROUPER,`)`),e}_parseIndex(){this._advance();let e=this._parseExpression();return this._advance(I.GROUPER,`]`),e}_parseParenOrFunction(){let e=this._parseArguments();if(this._matches(I.ARROW)){this._advance();let t=this._parseExpression(),n=e?.map(e=>e.value)??[];return this._ast.arrowFunction(n,t)}else return this._ast.paren(e?.[0])}_parseString(){let e=this._ast.literal(this._value??``);return this._advance(),e}_parseInteger(e=``){let t=this._ast.literal(parseInt(`${e}${this._value}`,10));return this._advance(),t}_parseDecimal(e=``){let t=this._ast.literal(parseFloat(`${e}${this._value}`));return this._advance(),t}},He=class{timeouts=new Map;debounce(e,t){return new Promise((n,r)=>{let i=this.timeouts.get(t);i&&clearTimeout(i),this.timeouts.set(t,setTimeout(()=>{try{n(t()),this.timeouts.delete(t)}catch(e){r(e)}},e))})}};let Ue=new Oe,z=`__is_proxy__`;function We(e){return e instanceof H||e[z]===!0}function B(e,t){let n=e?._store;if(n?.has(t))return n.get(t);if(n?.has(`$parent`))return B(n.get(`$parent`),t)}function V(e,t){let n=e?._store;return n?.has(t)?e:n?.has(`$parent`)?V(n.get(`$parent`),t):null}function Ge(e,t,n){let r=V(e,t);r?r._store.set(t,n):e._store.set(t,n)}var H=class extends He{evalkeys=[`$elem`,`$event`];expressionCache=new Map;observers=new Map;keyHandlers=new Map;_observer=null;_store=new Map;_lock=Promise.resolve();constructor(e){super();for(let[t,n]of Object.entries(e||{}))this.set(t,n)}wrapFunction(e){return(...t)=>e.call(this.$,...t)}wrapObject(e,t){return e==null||We(e)||e.constructor!==Object&&!Array.isArray(e)?e:new Proxy(e,{deleteProperty:(e,n)=>typeof n==`string`&&n in e?(delete e[n],t(),!0):!1,set:(e,n,r,i)=>{typeof r==`object`&&r&&(r=this.wrapObject(r,t));let a=Reflect.set(e,n,r,i);return t(),a},get:(e,t,n)=>t===z?!0:Reflect.get(e,t,n)})}watch(e,t){let n=V(this,e);if(!n)throw Error(`Cannot watch key "${e}" as it does not exist in the store.`);n.observers.has(e)||n.observers.set(e,new Set),n.observers.get(e)?.has(t)||n.observers.get(e)?.add(t)}addKeyHandler(e,t){this.keyHandlers.has(e)||this.keyHandlers.set(e,new Set),this.keyHandlers.get(e)?.add(t)}async notify(e,t=10){let n=V(this,e),r=Array.from(n?.observers.get(e)||[]);await this.debounce(t,()=>Promise.all(r.map(e=>e.call(this.proxify(e)))))}get(e,t){return t&&this.watch(e,t),B(this,e)}async set(e,t){if(this._store.has(e)&&t===this._store.get(e))return;let n=()=>this.notify(e);t&&typeof t==`function`&&(t=this.wrapFunction(t)),t&&typeof t==`object`&&(t=this.wrapObject(t,n)),Ge(this,e,t);for(let[n,r]of this.keyHandlers.entries())if(n.test(e))for(let n of r)await Promise.resolve(n.call(this.$,e,t));await n()}async del(e){await this.set(e,null),this._store.delete(e),this.observers.delete(e)}keys(){return Array.from(this._store.keys())}has(e){return this._store.has(e)}effect(e){return e.call(this.proxify(e))}proxify(e){let t=Array.from(this._store.entries()).map(([e])=>e),n=Object.fromEntries(t.map(e=>[e,null]));return new Proxy(n,{has:(e,t)=>typeof t==`string`&&(V(this,t)||Reflect.has(this,t))?!0:Reflect.has(n,t),get:(t,n,r)=>{if(typeof n==`string`){if(V(this,n))return this.get(n,e);if(e&&n!==z&&!Reflect.has(this,n))return this.set(n,void 0),this.get(n,e)}return n===`$`?this.proxify(e):Reflect.get(this,n,r)},set:(e,t,n,r)=>(typeof t!=`string`||t in this?Reflect.set(this,t,n,r):this.set(t,n),!0)})}get $(){return this.proxify()}makeEvalFunction(e){return(t,n)=>{let r=Be(e,Ue),i=new Proxy(n,{has(e,n){return n in e||n in t||n in globalThis},get(e,n){if(typeof n==`string`)return n in e?e[n]:n in t?t[n]:n in globalThis?globalThis[n]:t[n]},set(e,n,r){return typeof n==`string`?n in e?(e[n]=r,!0):(t[n]=r,!0):!1}});return r?.evaluate(i)}}cachedExpressionFunction(e){e=e.trim(),this.expressionCache.has(e)||this.expressionCache.set(e,this.makeEvalFunction(e));let t=this.expressionCache.get(e);if(!t)throw Error(`Failed to retrieve cached expression: ${e}`);return t}eval(e,t={}){let n=this._observer?this:this.$;if(this._store.has(e))return n[e];{let r=this.cachedExpressionFunction(e);try{return r(n,t)}catch(t){return console.error(`Failed to evaluate expression: ${e}`),console.error(t),null}}}$resolve(e,t){let n={$pending:!0,$result:null,$error:null};return Promise.resolve().then(()=>e(t)).then(e=>{n.$result=e}).catch(e=>{n.$error=e instanceof Error?e:Error(String(e))}).finally(()=>{n.$pending=!1}),n}},Ke=class extends H{debugging=!1;dirpath=``;_skipNodes=new Set;_customElements=new Map;debug(e){return this.debugging=e,this}async fetchRemote(e,t){return fetch(e,{cache:t?.cache??`default`}).then(e=>e.text())}async fetchLocal(e,t){return this.fetchRemote(e,t)}async preprocessString(e,t){this.log(`Preprocessing string content with params:
|
|
43
|
-
`,t);let n=this.parseHTML(e,t);return await this.preprocessNode(n,t),n}async preprocessRemote(e,t){let n={};t?.cache&&(n.cache=t.cache);let r=await fetch(e,n).then(e=>e.text());return this.preprocessString(r,{...t,dirpath:
|
|
44
|
-
`,
|
|
45
|
-
`,A(n,128)),await N.resolveForAttribute.call(this,n,t),await N.resolveRenderAttribute.call(this,n,t),await N.resolveDataAttribute.call(this,n,t),await N.resolveTextAttributes.call(this,n,t),await N.resolveHtmlAttribute.call(this,n,t),await N.resolveIfAttribute.call(this,n,t),await N.resolveShowAttribute.call(this,n,t),await N.resolveClassAttribute.call(this,n,t),await N.resolveBindAttribute.call(this,n,t),await N.resolveEventAttributes.call(this,n,t),await N.resolveTextNodeExpressions.call(this,n,t),await N.resolveCustomAttribute.call(this,n,t),await N.resolveCustomProperty.call(this,n,t),await N.stripTypes.call(this,n,t);return e}async mount(e,t){t={...t,rootNode:e},C(e,`renderer`,this),this._store.set(`$rootNode`,e),this.has(`$rootRenderer`)||this._store.set(`$rootRenderer`,this),this.get(`$rootRenderer`)===this&&await xe(this),await this.preprocessNode(e,t),await this.renderNode(e,t)}};function qe(){return ae([m`html{`,m`max-width: 70ch;`,m`padding: 2em 1em;`,m`margin: auto;`,m`line-height: 1.75;`,m`font-size: 1.25em;`,m`font-family: sans-serif;`,m`}`,m`h1,h2,h3,h4,h5,h6{`,m`margin: 1em 0 0.5em;`,m`}`,m`p,ul,ol{`,m`margin-bottom: 1em;`,m`color: #1d1d1d;`,m`}`])}let U={sm:640,md:768,lg:1024,xl:1280},Je=Object.entries(U),W=.25,G=[...Array(15)].map((e,t)=>t+1),Ye=[16,20,24,25,28,30,32,36,40,44,48,50,52,56,60],Xe=[64,72,80,96,100,112,128,144,160,192,200,224,256,288,300,320,384,400,448,500,512],K=[...G,...Ye,...Xe,...Object.values(U)],q=Array.from({length:100},(e,t)=>t+1),Ze=[25,50,75,100,150,200,300,500,700,1e3],Qe=[`hover`,`focus`,`disabled`,`active`],J={margin:`m`,padding:`p`},$e={width:`w`,height:`h`},et={top:`top`,right:`right`,bottom:`bottom`,left:`left`},tt={"min-width":`min-w`,"min-height":`min-h`,"max-width":`max-w`,"max-height":`max-h`},nt={"font-mono":{"font-family":`monospace`},"font-sans":{"font-family":`sans-serif`},"font-serif":{"font-family":`serif`},"font-cursive":{"font-family":`cursive`},"text-xs":{"font-size":`.75rem`,"line-height":`calc(1 / 0.75)`},"text-sm":{"font-size":`.875rem`,"line-height":`calc(1.25 / 0.875)`},"text-base":{"font-size":`1rem`,"line-height":`calc(1.5 / 1)`},"text-lg":{"font-size":`1.125rem`,"line-height":`calc(1.75 / 1.125)`},"text-xl":{"font-size":`1.25rem`,"line-height":`calc(1.75 / 1.25)`},"text-2xl":{"font-size":`1.5rem`,"line-height":`calc(2 / 1.5)`},"text-3xl":{"font-size":`1.875rem`,"line-height":`calc(2.25 / 1.875)`},"text-4xl":{"font-size":`2.25rem`,"line-height":`calc(2.5 / 2.25)`},"text-5xl":{"font-size":`3rem`,"line-height":`1`},"text-6xl":{"font-size":`3.75rem`,"line-height":`1`},"text-7xl":{"font-size":`4.5rem`,"line-height":`1`},"font-thin":{"font-weight":100},"font-extralight":{"font-weight":200},"font-light":{"font-weight":300},"font-normal":{"font-weight":400},"font-medium":{"font-weight":500},"font-semibold":{"font-weight":600},"font-bold":{"font-weight":700},"font-extrabold":{"font-weight":800},"font-black":{"font-weight":900},italic:{"font-style":`italic`},"not-italic":{"font-style":`normal`},"w-max":{width:`max-content`},"w-min":{width:`min-content`},"w-fit":{width:`fit-content`},"h-max":{height:`max-content`},"h-min":{height:`min-content`},"h-fit":{height:`fit-content`},"size-auto":{width:`auto`,height:`auto`},"size-px":{width:`1px`,height:`1px`},"size-full":{width:`100%`,height:`100%`},"size-dvw":{width:`100dvw`,height:`100dvw`},"size-dvh":{width:`100dvh`,height:`100dvh`},"size-lvw":{width:`100lvw`,height:`100lvw`},"size-lvh":{width:`100lvh`,height:`100lvh`},"size-svw":{width:`100svw`,height:`100svw`},"size-svh":{width:`100svh`,height:`100svh`},"size-min":{width:`min-content`,height:`min-content`},"size-max":{width:`max-content`,height:`max-content`},"size-fit":{width:`fit-content`,height:`fit-content`},"tracking-tighter":{"letter-spacing":`-0.05em`},"tracking-tight":{"letter-spacing":`-0.025em`},"tracking-normal":{"letter-spacing":`0`},"tracking-wide":{"letter-spacing":`0.025em`},"tracking-wider":{"letter-spacing":`0.05em`},"tracking-widest":{"letter-spacing":`0.1em`},"leading-none":{"line-height":`1`},"leading-tight":{"line-height":`1.25`},"leading-snug":{"line-height":`1.375`},"leading-normal":{"line-height":`1.5`},"leading-relaxed":{"line-height":`1.625`},"leading-loose":{"line-height":`2`},"text-left":{"text-align":`left`},"text-right":{"text-align":`right`},"text-center":{"text-align":`center`},"text-justify":{"text-align":`justify`},underline:{"text-decoration":`underline`},"no-underline":{"text-decoration":`none`},"decoration-none":{"text-decoration":`none`},"line-through":{"text-decoration":`line-through`},uppercase:{"text-transform":`uppercase`},lowercase:{"text-transform":`lowercase`},capitalize:{"text-transform":`capitalize`},truncate:{"white-space":`nowrap`,overflow:`hidden`,"text-overflow":`ellipsis`},"text-elipsis":{"text-overflow":`ellipsis`},"text-clip":{"text-overflow":`clip`},"text-wrap":{"text-wrap":`wrap`},"text-nowrap":{"text-wrap":`nowrap`},"text-balance":{"text-wrap":`balance`},"text-pretty":{"text-wrap":`pretty`},"whitespace-normal":{"white-space":`normal`},"whitespace-nowrap":{"white-space":`nowrap`},"whitespace-pre":{"white-space":`pre`},"whitespace-pre-line":{"white-space":`pre-line`},"whitespace-pre-wrap":{"white-space":`pre-wrap`},"whitespace-break-spaces":{"white-space":`break-spaces`},relative:{position:`relative`},fixed:{position:`fixed`},absolute:{position:`absolute`},sticky:{position:`sticky`},"object-contain":{"object-fit":`contain`},"object-cover":{"object-fit":`cover`},"object-fill":{"object-fit":`fill`},"object-none":{"object-fit":`none`},block:{display:`block`},contents:{display:`contents`},hidden:{display:`none`},inline:{display:`inline`},"inline-block":{display:`inline-block`},visible:{visibility:`visible`},invisible:{visibility:`hidden`},collapse:{visibility:`collapse`},"list-none":{"list-style-type":`none`},"list-disc":{"list-style-type":`disc`},"list-decimal":{"list-style-type":`decimal`},flex:{display:`flex`},grid:{display:`grid`},"flex-1":{flex:`1 1 0%`},"flex-inline":{display:`inline-flex`},"flex-row":{"flex-direction":`row`},"flex-col":{"flex-direction":`column`},"flex-row-reverse":{"flex-direction":`row-reverse`},"flex-col-reverse":{"flex-direction":`column-reverse`},"flex-wrap":{"flex-wrap":`wrap`},"flex-wrap-reverse":{"flex-wrap":`wrap-reverse`},"flex-nowrap":{"flex-wrap":`nowrap`},"justify-start":{"justify-content":`flex-start`},"justify-end":{"justify-content":`flex-end`},"justify-center":{"justify-content":`center`},"justify-between":{"justify-content":`space-between`},"justify-around":{"justify-content":`space-around`},"justify-evenly":{"justify-content":`space-evenly`},"justify-stretch":{"justify-content":`stretch`},"items-start":{"align-items":`flex-start`},"items-end":{"align-items":`flex-end`},"items-center":{"align-items":`center`},"items-stretch":{"align-items":`stretch`},"flex-grow":{"flex-grow":1},"flex-shrink":{"flex-shrink":1},"align-baseline":{"vertical-align":`baseline`},"align-top":{"vertical-align":`top`},"align-middle":{"vertical-align":`middle`},"align-bottom":{"vertical-align":`bottom`},"align-text-top":{"vertical-align":`text-top`},"align-text-bottom":{"vertical-align":`text-bottom`},"overflow-auto":{overflow:`auto`},"overflow-x-auto":{"overflow-x":`auto`},"overflow-y-auto":{"overflow-y":`auto`},"overflow-hidden":{overflow:`hidden`},"overflow-x-hidden":{"overflow-x":`hidden`},"overflow-y-hidden":{"overflow-y":`hidden`},"overflow-visible":{overflow:`visible`},"overscroll-auto":{"overscroll-behavior":`auto`},"overscroll-contain":{"overscroll-behavior":`contain`},"overscroll-none":{"overscroll-behavior":`none`},"overscroll-x-auto":{"overscroll-behavior-x":`auto`},"overscroll-x-contain":{"overscroll-behavior-x":`contain`},"overscroll-x-none":{"overscroll-behavior-x":`none`},"overscroll-y-auto":{"overscroll-behavior-y":`auto`},"overscroll-y-contain":{"overscroll-behavior-y":`contain`},"overscroll-y-none":{"overscroll-behavior-y":`none`},"z-auto":{"z-index":`auto`},"cursor-pointer":{cursor:`pointer`},"cursor-wait":{cursor:`wait`},"cursor-not-allowed":{cursor:`not-allowed`},"select-none":{"user-select":`none`},"select-all":{"user-select":`all`},"pointer-events-auto":{"pointer-events":`auto`},"pointer-events-none":{"pointer-events":`none`},"box-border":{"box-sizing":`border-box`},"box-content":{"box-sizing":`content-box`},resize:{resize:`both`},"resize-x":{resize:`horizontal`},"resize-y":{resize:`vertical`},"resize-none":{resize:`none`},border:{border:`1px solid`},"border-none":{border:`none`},"border-solid":{"border-style":`solid`},"border-dashed":{"border-style":`dashed`},"border-dotted":{"border-style":`dotted`},"border-collapse":{"border-collapse":`collapse`},"rounded-none":{"border-radius":`0`},rounded:{"border-radius":`.25rem`},"rounded-sm":{"border-radius":`.125rem`},"rounded-md":{"border-radius":`.375rem`},"rounded-lg":{"border-radius":`.5rem`},"rounded-xl":{"border-radius":`.75rem`},"rounded-full":{"border-radius":`9999px`},"shadow-2xs":{"box-shadow":`0 1px rgb(0 0 0 / 0.05)`},"shadow-xs":{"box-shadow":`0 1px 2px 0 rgb(0 0 0 / 0.05)`},shadow:{"box-shadow":`0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)`},"shadow-sm":{"box-shadow":`0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)`},"shadow-md":{"box-shadow":`0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)`},"shadow-lg":{"box-shadow":`0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)`},"shadow-xl":{"box-shadow":`0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)`},"shadow-2xl":{"box-shadow":`0 25px 50px -12px rgb(0 0 0 / 0.25)`},"shadow-inner":{"box-shadow":`inset 0 2px 4px 0 rgb(0 0 0 / 0.05)`},"shadow-none":{"box-shadow":`0 0 #0000`},ring:{"box-shadow":`var(--ring-inset, ) 0 0 0 3px rgb(59 130 246 / 0.5)`},"ring-0":{"box-shadow":`var(--ring-inset, ) 0 0 0 0px rgb(59 130 246 / 0.5)`},"ring-1":{"box-shadow":`var(--ring-inset, ) 0 0 0 1px rgb(59 130 246 / 0.5)`},"ring-2":{"box-shadow":`var(--ring-inset, ) 0 0 0 2px rgb(59 130 246 / 0.5)`},"ring-4":{"box-shadow":`var(--ring-inset, ) 0 0 0 4px rgb(59 130 246 / 0.5)`},"ring-8":{"box-shadow":`var(--ring-inset, ) 0 0 0 8px rgb(59 130 246 / 0.5)`},"ring-inset":{"--ring-inset":`inset`},outline:{"outline-style":`solid`},"outline-none":{outline:`2px solid transparent`,"outline-offset":`2px`},"outline-dashed":{"outline-style":`dashed`},"outline-dotted":{"outline-style":`dotted`},"outline-double":{"outline-style":`double`},"outline-0":{"outline-width":`0px`},"outline-1":{"outline-width":`1px`},"outline-2":{"outline-width":`2px`},"outline-4":{"outline-width":`4px`},"outline-8":{"outline-width":`8px`},"outline-offset-0":{"outline-offset":`0px`},"outline-offset-1":{"outline-offset":`1px`},"outline-offset-2":{"outline-offset":`2px`},"outline-offset-4":{"outline-offset":`4px`},"outline-offset-8":{"outline-offset":`8px`},"aspect-auto":{"aspect-ratio":`auto`},"aspect-square":{"aspect-ratio":`1 / 1`},"aspect-video":{"aspect-ratio":`16 / 9`},"backdrop-blur-none":{"backdrop-filter":`blur(0)`},"backdrop-blur-sm":{"backdrop-filter":`blur(4px)`},"backdrop-blur":{"backdrop-filter":`blur(8px)`},"backdrop-blur-md":{"backdrop-filter":`blur(12px)`},"backdrop-blur-lg":{"backdrop-filter":`blur(16px)`},"backdrop-blur-xl":{"backdrop-filter":`blur(24px)`},"backdrop-blur-2xl":{"backdrop-filter":`blur(40px)`},"backdrop-blur-3xl":{"backdrop-filter":`blur(64px)`},"transition-none":{transition:`none`},transition:{"transition-property":`all`,"transition-timing-function":`ease-in-out`,"transition-duration":`var(--transition-duration, 150ms)`},"animate-none":{animation:`none`},"animate-spin":{animation:`spin 1s linear infinite`},"animate-ping":{animation:`ping 1s cubic-bezier(0, 0, 0.2, 1) infinite`},"animate-pulse":{animation:`pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite`},"bg-auto":{"background-size":`auto`},"bg-cover":{"background-size":`cover`},"bg-contain":{"background-size":`contain`},"bg-no-repeat":{"background-repeat":`no-repeat`},"bg-fixed":{"background-attachment":`fixed`},"bg-local":{"background-attachment":`local`},"bg-scroll":{"background-attachment":`scroll`},"min-h-screen":{"min-height":`100vh`},"max-h-screen":{"max-height":`100vh`},"min-w-screen":{"min-width":`100vw`},"h-dvh":{height:`100dvh`},"h-svh":{height:`100svh`},"h-lvh":{height:`100lvh`},"w-dvw":{width:`100dvw`},"w-svw":{width:`100svw`},"w-lvw":{width:`100lvw`},"min-h-dvh":{"min-height":`100dvh`},"min-h-svh":{"min-height":`100svh`},"min-h-lvh":{"min-height":`100lvh`},"flex-none":{flex:`none`},"flex-auto":{flex:`1 1 auto`},"flex-initial":{flex:`0 1 auto`},grow:{"flex-grow":`1`},"grow-0":{"flex-grow":`0`},shrink:{"flex-shrink":`1`},"shrink-0":{"flex-shrink":`0`},"self-auto":{"align-self":`auto`},"self-start":{"align-self":`flex-start`},"self-end":{"align-self":`flex-end`},"self-center":{"align-self":`center`},"self-stretch":{"align-self":`stretch`},"self-baseline":{"align-self":`baseline`},"content-normal":{"align-content":`normal`},"content-start":{"align-content":`flex-start`},"content-end":{"align-content":`flex-end`},"content-center":{"align-content":`center`},"content-between":{"align-content":`space-between`},"content-around":{"align-content":`space-around`},"content-evenly":{"align-content":`space-evenly`},"content-stretch":{"align-content":`stretch`},"items-baseline":{"align-items":`baseline`},"inset-0":{inset:`0`},"inset-auto":{inset:`auto`},"inset-x-0":{left:`0`,right:`0`},"inset-y-0":{top:`0`,bottom:`0`},"inset-x-auto":{left:`auto`,right:`auto`},"inset-y-auto":{top:`auto`,bottom:`auto`},"sr-only":{position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,"white-space":`nowrap`,"border-width":`0`},"not-sr-only":{position:`static`,width:`auto`,height:`auto`,padding:`0`,margin:`0`,overflow:`visible`,clip:`auto`,"white-space":`normal`}},rt=[`@keyframes spin {
|
|
41
|
+
let ke=new Set([`==`,`!=`,`<=`,`>=`,`||`,`&&`,`??`,`?.`]),Ae=new Set([`===`,`!==`]),I=function(e){return e[e.STRING=1]=`STRING`,e[e.IDENTIFIER=2]=`IDENTIFIER`,e[e.DOT=3]=`DOT`,e[e.COMMA=4]=`COMMA`,e[e.COLON=5]=`COLON`,e[e.INTEGER=6]=`INTEGER`,e[e.DECIMAL=7]=`DECIMAL`,e[e.OPERATOR=8]=`OPERATOR`,e[e.GROUPER=9]=`GROUPER`,e[e.KEYWORD=10]=`KEYWORD`,e[e.ARROW=11]=`ARROW`,e[e.OPTIONAL_DOT=12]=`OPTIONAL_DOT`,e[e.SPREAD=13]=`SPREAD`,e}({}),L=(e,t,n=0)=>({kind:e,value:t,precedence:n}),je=e=>e===9||e===10||e===13||e===32,R=e=>{if(e===95||e===36)return!0;let t=e&-33;return 65<=t&&t<=90},Me=e=>R(e)||z(e),Ne=e=>Se.has(e),Pe=e=>e===34||e===39,z=e=>48<=e&&e<=57,Fe=e=>e===43||e===45||e===42||e===47||e===33||e===38||e===37||e===60||e===61||e===62||e===63||e===94||e===124,Ie=e=>e===40||e===41||e===91||e===93||e===123||e===125,Le=e=>e.replace(/\\(.)/g,(e,t)=>{switch(t){case`n`:return`
|
|
42
|
+
`;case`r`:return`\r`;case`t`:return` `;case`b`:return`\b`;case`f`:return`\f`;default:return t}});var Re=class{_input;_index=-1;_tokenStart=0;_next;constructor(e){this._input=e,this._advance()}nextToken(){for(;je(this._next??-1);)this._advance(!0);if(Pe(this._next??-1))return this._tokenizeString();if(R(this._next??-1))return this._tokenizeIdentOrKeyword();if(z(this._next??-1))return this._tokenizeNumber();if(this._next===46)return this._tokenizeDot();if(this._next===44)return this._tokenizeComma();if(this._next===58)return this._tokenizeColon();if(Fe(this._next??-1))return this._tokenizeOperator();if(Ie(this._next??-1))return this._tokenizeGrouper();if(this._advance(),this._next!==void 0)throw Error(`Expected end of input, got ${this._next}`)}_advance(e){this._index++,this._index<this._input.length?(this._next=this._input.charCodeAt(this._index),e===!0&&(this._tokenStart=this._index)):this._next=void 0}_getValue(e=0){let t=this._input.substring(this._tokenStart,this._index+e);return e===0&&this._clearValue(),t}_clearValue(){this._tokenStart=this._index}_tokenizeString(){let e=this._next;for(this._advance(!0);this._next!==e;){if(this._next===void 0||this._next===92&&(this._advance(),this._next===void 0))throw Error(`unterminated string`);this._advance()}let t=L(I.STRING,Le(this._getValue()));return this._advance(),t}_tokenizeIdentOrKeyword(){do this._advance();while(Me(this._next??-1));let e=this._getValue();return L(Ne(e)?I.KEYWORD:Ce.has(e)?I.OPERATOR:I.IDENTIFIER,e,F[e]??0)}_tokenizeNumber(){do this._advance();while(z(this._next??-1));return this._next===46?this._tokenizeDot():L(I.INTEGER,this._getValue())}_tokenizeDot(){if(this._advance(),z(this._next??-1))return this._tokenizeFraction();if(this._next===46){if(this._advance(),this._next===46)return this._advance(),this._clearValue(),L(I.SPREAD,`...`);throw Error(`Unexpected token ..`)}return this._clearValue(),L(I.DOT,`.`,13)}_tokenizeComma(){return this._advance(!0),L(I.COMMA,`,`)}_tokenizeColon(){return this._advance(!0),L(I.COLON,`:`)}_tokenizeFraction(){do this._advance();while(z(this._next??-1));return L(I.DECIMAL,this._getValue())}_tokenizeOperator(){this._advance();let e=this._getValue(2);if(Ae.has(e))this._advance(),this._advance();else{if(e=this._getValue(1),e===`=>`)return this._advance(),L(I.ARROW,e);ke.has(e)&&this._advance()}return e=this._getValue(),e===`?.`?L(I.OPTIONAL_DOT,e,13):L(I.OPERATOR,e,F[e])}_tokenizeGrouper(){let e=String.fromCharCode(this._next??0),t=L(I.GROUPER,e,F[e]);return this._advance(!0),t}};let ze=(e,t)=>new Be(e,t).parse();var Be=class{_kind;_tokenizer;_ast;_token;_value;constructor(e,t){this._tokenizer=new Re(e),this._ast=t}parse(){this._advance();let e=this._parseExpression();if(this._token)throw Error(`Unexpected token: ${this._token.value}`);return e}_advance(e,t){if(!this._matches(e,t))throw Error(`Expected kind ${e} (${t}), was ${this._token?.kind} (${this._token?.value})`);let n=this._tokenizer.nextToken();this._token=n,this._kind=n?.kind,this._value=n?.value}_matches(e,t){return!(e&&this._kind!==e||t&&this._value!==t)}_parseExpression(){if(!this._token)return this._ast.empty();let e=this._parseUnary();return e===void 0?void 0:this._parsePrecedence(e,0)}_parsePrecedence(e,t){if(e===void 0)throw Error(`Expected left to be defined.`);for(;this._token;)if(this._matches(I.GROUPER,`(`)){let t=this._parseArguments();e=this._ast.invoke(e,void 0,t)}else if(this._matches(I.GROUPER,`[`)){let t=this._parseIndex();e=this._ast.index(e,t)}else if(this._matches(I.DOT)||this._matches(I.OPTIONAL_DOT)){let t=this._kind===I.OPTIONAL_DOT;if(this._advance(),t&&this._matches(I.GROUPER,`[`)){let t=this._parseIndex();e=this._ast.index(e,t,!0)}else if(t&&this._matches(I.GROUPER,`(`)){let t=this._parseArguments();e=this._ast.invoke(e,void 0,t,!0)}else{let n=this._parseUnary();e=this._makeInvokeOrGetter(e,n,t)}}else if(this._matches(I.KEYWORD))break;else if(this._matches(I.OPERATOR)&&this._token.precedence>=t)e=this._value===`?`?this._parseTernary(e):this._parseBinary(e,this._token);else break;return e}_makeInvokeOrGetter(e,t,n){if(t===void 0)throw Error(`expected identifier`);if(t.type===`ID`)return this._ast.getter(e,t.value,n);if(t.type===`Invoke`&&t.receiver.type===`ID`){let r=t.receiver;return this._ast.invoke(e,r.value,t.arguments,n)}else throw Error(`expected identifier: ${t}`)}_parseBinary(e,t){if(!Te.has(t.value))throw Error(`unknown operator: ${t.value}`);this._advance();let n=this._parseUnary();for(;(this._kind===I.OPERATOR||this._kind===I.DOT||this._kind===I.GROUPER)&&this._token&&(this._token.precedence??0)>t.precedence;)n=this._parsePrecedence(n,this._token?.precedence??0);if(n===void 0)throw Error(`Expected expression after ${t.value}`);return this._ast.binary(e,t.value,n)}_parseUnary(){if(this._matches(I.KEYWORD,`typeof`)){this._advance();let e=this._parsePrecedence(this._parsePrimary(),13);return this._ast.unary(`typeof`,e)}if(this._matches(I.OPERATOR)){let e=this._value;if(this._advance(),e===`+`||e===`-`){if(this._matches(I.INTEGER))return this._parseInteger(e);if(this._matches(I.DECIMAL))return this._parseDecimal(e)}if(!e||!we.has(e))throw Error(`unexpected token: ${e}`);let t=this._parsePrecedence(this._parsePrimary(),13);return this._ast.unary(e,t)}return this._parsePrimary()}_parseTernary(e){this._advance(I.OPERATOR,`?`);let t=this._parseExpression();this._advance(I.COLON);let n=this._parseExpression();return this._ast.ternary(e,t,n)}_parsePrimary(){switch(this._kind){case I.KEYWORD:{let e=this._value??``;if(e===`this`)return this._advance(),this._ast.id(e);throw Se.has(e)?Error(`unexpected keyword: ${e}`):Error(`unrecognized keyword: ${e}`)}case I.IDENTIFIER:return this._parseInvokeOrIdentifier();case I.STRING:return this._parseString();case I.INTEGER:return this._parseInteger();case I.DECIMAL:return this._parseDecimal();case I.GROUPER:return this._value===`(`?this._parseParenOrFunction():this._value===`{`?this._parseMap():this._value===`[`?this._parseList():void 0;case I.COLON:throw Error(`unexpected token ":"`);default:return}}_parseList(){let e=[];do{if(this._advance(),this._matches(I.GROUPER,`]`))break;if(this._matches(I.SPREAD)){this._advance();let t=this._parseExpression();t&&e.push(this._ast.spreadElement(t))}else e.push(this._parseExpression())}while(this._matches(I.COMMA));return this._advance(I.GROUPER,`]`),this._ast.list(e)}_parseMap(){let e=[];do{if(this._advance(),this._matches(I.GROUPER,`}`))break;if(this._matches(I.SPREAD)){this._advance();let t=this._parseExpression();t&&e.push(this._ast.spreadProperty(t))}else{let t=this._value??``;if((this._matches(I.STRING)||this._matches(I.IDENTIFIER))&&this._advance(),this._matches(I.COLON)){this._advance(I.COLON);let n=this._parseExpression();n&&e.push(this._ast.property(t,n))}else e.push(this._ast.property(t,this._ast.id(t)))}}while(this._matches(I.COMMA));return this._advance(I.GROUPER,`}`),this._ast.map(e)}_parseInvokeOrIdentifier(){let e=this._value;if(e===`true`)return this._advance(),this._ast.literal(!0);if(e===`false`)return this._advance(),this._ast.literal(!1);if(e===`null`)return this._advance(),this._ast.literal(null);if(e===`undefined`)return this._advance(),this._ast.literal(void 0);let t=this._parseIdentifier(),n=this._parseArguments();return n?this._ast.invoke(t,void 0,n):t}_parseIdentifier(){if(!this._matches(I.IDENTIFIER))throw Error(`expected identifier: ${this._value}`);let e=this._value;return this._advance(),this._ast.id(e??``)}_parseArguments(){if(!this._matches(I.GROUPER,`(`))return;let e=[];do{if(this._advance(),this._matches(I.GROUPER,`)`))break;if(this._matches(I.SPREAD)){this._advance();let t=this._parseExpression();t&&e.push(this._ast.spreadElement(t))}else{let t=this._parseExpression();e.push(t)}}while(this._matches(I.COMMA));return this._advance(I.GROUPER,`)`),e}_parseIndex(){this._advance();let e=this._parseExpression();return this._advance(I.GROUPER,`]`),e}_parseParenOrFunction(){let e=this._parseArguments();if(this._matches(I.ARROW)){this._advance();let t=this._parseExpression(),n=e?.map(e=>e.value)??[];return this._ast.arrowFunction(n,t)}else return this._ast.paren(e?.[0])}_parseString(){let e=this._ast.literal(this._value??``);return this._advance(),e}_parseInteger(e=``){let t=this._ast.literal(parseInt(`${e}${this._value}`,10));return this._advance(),t}_parseDecimal(e=``){let t=this._ast.literal(parseFloat(`${e}${this._value}`));return this._advance(),t}},Ve=class{timeouts=new Map;debounce(e,t){return new Promise((n,r)=>{let i=this.timeouts.get(t);i&&clearTimeout(i),this.timeouts.set(t,setTimeout(()=>{try{n(t()),this.timeouts.delete(t)}catch(e){r(e)}},e))})}};let He=new Oe,B=`__is_proxy__`;function Ue(e){return e instanceof Ge||e[B]===!0}function V(e,t){let n=e?._store;if(n?.has(t))return n.get(t);if(n?.has(`$parent`))return V(n.get(`$parent`),t)}function H(e,t){let n=e?._store;return n?.has(t)?e:n?.has(`$parent`)?H(n.get(`$parent`),t):null}function We(e,t,n){let r=H(e,t);r?r._store.set(t,n):e._store.set(t,n)}var Ge=class extends Ve{evalkeys=[`$elem`,`$event`];expressionCache=new Map;observers=new Map;keyHandlers=new Map;_observer=null;_store=new Map;_lock=Promise.resolve();constructor(e){super();for(let[t,n]of Object.entries(e||{}))this.set(t,n)}wrapFunction(e){return(...t)=>e.call(this.$,...t)}wrapObject(e,t){return e==null||Ue(e)||e.constructor!==Object&&!Array.isArray(e)?e:new Proxy(e,{deleteProperty:(e,n)=>typeof n==`string`&&n in e?(delete e[n],t(),!0):!1,set:(e,n,r,i)=>{typeof r==`object`&&r&&(r=this.wrapObject(r,t));let a=Reflect.set(e,n,r,i);return t(),a},get:(e,t,n)=>t===B?!0:Reflect.get(e,t,n)})}watch(e,t){let n=H(this,e);if(!n)throw Error(`Cannot watch key "${e}" as it does not exist in the store.`);n.observers.has(e)||n.observers.set(e,new Set),n.observers.get(e)?.has(t)||n.observers.get(e)?.add(t)}addKeyHandler(e,t){this.keyHandlers.has(e)||this.keyHandlers.set(e,new Set),this.keyHandlers.get(e)?.add(t)}async notify(e,t=10){let n=H(this,e),r=Array.from(n?.observers.get(e)||[]);await this.debounce(t,()=>Promise.all(r.map(e=>e.call(this.proxify(e)))))}get(e,t){return t&&this.watch(e,t),V(this,e)}async set(e,t){if(this._store.has(e)&&t===this._store.get(e))return;let n=()=>this.notify(e);t&&typeof t==`function`&&(t=this.wrapFunction(t)),t&&typeof t==`object`&&(t=this.wrapObject(t,n)),We(this,e,t);for(let[n,r]of this.keyHandlers.entries())if(n.test(e))for(let n of r)await Promise.resolve(n.call(this.$,e,t));await n()}async del(e){await this.set(e,null),this._store.delete(e),this.observers.delete(e)}keys(){return Array.from(this._store.keys())}has(e){return this._store.has(e)}effect(e){return e.call(this.proxify(e))}proxify(e){let t=Array.from(this._store.entries()).map(([e])=>e),n=Object.fromEntries(t.map(e=>[e,null]));return new Proxy(n,{has:(e,t)=>typeof t==`string`&&(H(this,t)||Reflect.has(this,t))?!0:Reflect.has(n,t),get:(t,n,r)=>{if(typeof n==`string`){if(H(this,n))return this.get(n,e);if(e&&n!==B&&!Reflect.has(this,n))return this.set(n,void 0),this.get(n,e)}return n===`$`?this.proxify(e):Reflect.get(this,n,r)},set:(e,t,n,r)=>(typeof t!=`string`||t in this?Reflect.set(this,t,n,r):this.set(t,n),!0)})}get $(){return this.proxify()}makeEvalFunction(e){return(t,n)=>{let r=ze(e,He),i=new Proxy(n,{has(e,n){return n in e||n in t||n in globalThis},get(e,n){if(typeof n==`string`)return n in e?e[n]:n in t?t[n]:n in globalThis?globalThis[n]:t[n]},set(e,n,r){return typeof n==`string`?n in e?(e[n]=r,!0):(t[n]=r,!0):!1}});return r?.evaluate(i)}}cachedExpressionFunction(e){e=e.trim(),this.expressionCache.has(e)||this.expressionCache.set(e,this.makeEvalFunction(e));let t=this.expressionCache.get(e);if(!t)throw Error(`Failed to retrieve cached expression: ${e}`);return t}eval(e,t={}){let n=this._observer?this:this.$;if(this._store.has(e))return n[e];{let r=this.cachedExpressionFunction(e);try{return r(n,t)}catch(t){return console.error(`Failed to evaluate expression: ${e}`),console.error(t),null}}}$resolve(e,t){let n={$pending:!0,$result:null,$error:null};return Promise.resolve().then(()=>e(t)).then(e=>{n.$result=e}).catch(e=>{n.$error=e instanceof Error?e:Error(String(e))}).finally(()=>{n.$pending=!1}),n}},Ke=class extends Ge{debugging=!1;dirpath=``;_skipNodes=new Set;_customElements=new Map;debug(e){return this.debugging=e,this}async fetchRemote(e,t){return fetch(e,{cache:t?.cache??`default`}).then(e=>e.text())}async fetchLocal(e,t){return this.fetchRemote(e,t)}async preprocessString(e,t){this.log(`Preprocessing string content with params:
|
|
43
|
+
`,t);let n=this.parseHTML(e,t);return await this.preprocessNode(n,t),n}async preprocessRemote(e,t){let n={};t?.cache&&(n.cache=t.cache);let r=await fetch(e,n).then(e=>e.text());return this.preprocessString(r,{...t,dirpath:M(e),rootDocument:t?.rootDocument??!e.endsWith(`.tpl.html`)})}async preprocessLocal(e,t){let n=await this.fetchLocal(e,t);return this.preprocessString(n,{...t,dirpath:M(e),rootDocument:t?.rootDocument??!e.endsWith(`.tpl.html`)})}subrenderer(){let e=new this.constructor().debug(this.debugging);return e._store.set(`$parent`,this),e._store.set(`$rootRenderer`,this.get(`$rootRenderer`)??this),e._customElements=this._customElements,e}log(...e){this.debugging&&console.debug(...e)}async preprocessNode(e,t){t={dirpath:this.dirpath,maxdepth:10,...t};let n=new pe(h(e,this._skipNodes)).map(async e=>{this.log(`Preprocessing node:
|
|
44
|
+
`,j(e,128)),await N.resolveIncludes.call(this,e,t),await N.rebaseRelativePaths.call(this,e,t),await N.registerCustomElements.call(this,e,t),await N.resolveCustomElements.call(this,e,t)});return await Promise.all(n.generator()),e}async renderNode(e,t){for(let n of h(e,this._skipNodes))this.log(`Rendering node:
|
|
45
|
+
`,j(n,128)),await N.resolveForAttribute.call(this,n,t),await N.resolveRenderAttribute.call(this,n,t),await N.resolveDataAttribute.call(this,n,t),await N.resolveTextAttributes.call(this,n,t),await N.resolveHtmlAttribute.call(this,n,t),await N.resolveIfAttribute.call(this,n,t),await N.resolveShowAttribute.call(this,n,t),await N.resolveClassAttribute.call(this,n,t),await N.resolveBindAttribute.call(this,n,t),await N.resolveEventAttributes.call(this,n,t),await N.resolveTextNodeExpressions.call(this,n,t),await N.resolveCustomAttribute.call(this,n,t),await N.resolveCustomProperty.call(this,n,t),await N.stripTypes.call(this,n,t);return e}async mount(e,t){t={...t,rootNode:e},C(e,`renderer`,this),this._store.set(`$rootNode`,e),this.has(`$rootRenderer`)||this._store.set(`$rootRenderer`,this),this.get(`$rootRenderer`)===this&&await xe(this),await this.preprocessNode(e,t),await this.renderNode(e,t)}};function qe(){return ae([m`*,::before,::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}`,m`html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}`,m`body{margin:0;line-height:inherit}`,m`hr{height:0;color:inherit;border-top-width:1px}`,m`abbr:where([title]){text-decoration:underline dotted}`,m`b,strong{font-weight:bolder}`,m`code,kbd,samp,pre{font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;font-size:1em}`,m`small{font-size:80%}`,m`sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}`,m`sub{bottom:-0.25em}`,m`sup{top:-0.5em}`,m`button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}`,m`button,select{text-transform:none}`,m`button,[type='button'],[type='reset'],[type='submit']{-webkit-appearance:button;background-color:transparent;background-image:none;cursor:pointer}`,m`:-moz-focusring{outline:auto}`,m`:-moz-ui-invalid{box-shadow:none}`,m`progress{vertical-align:baseline}`,m`::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}`,m`[type='search']{-webkit-appearance:textfield;outline-offset:-2px}`,m`::-webkit-search-decoration{-webkit-appearance:none}`,m`::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}`,m`summary{display:list-item}`,m`blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}`,m`fieldset{margin:0;padding:0}`,m`legend{padding:0}`,m`ol,ul,menu{list-style:none;margin:0;padding:0}`,m`textarea{resize:vertical}`,m`::placeholder{opacity:1;color:#9ca3af}`,m`button,[role="button"]{cursor:pointer}`,m`:disabled{cursor:default}`,m`img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}`,m`img,video{max-width:100%;height:auto}`,m`[hidden]{display:none}`,m`dialog{padding:0}`,m`dialog::backdrop{background:rgba(0,0,0,0.5)}`])}function Je(){return ae([m`html{`,m`max-width: 70ch;`,m`padding: 2em 1em;`,m`margin: auto;`,m`line-height: 1.75;`,m`font-size: 1.25em;`,m`font-family: sans-serif;`,m`}`,m`h1,h2,h3,h4,h5,h6{`,m`margin: 1em 0 0.5em;`,m`}`,m`p,ul,ol{`,m`margin-bottom: 1em;`,m`color: #1d1d1d;`,m`}`])}let Ye={sm:640,md:768,lg:1024,xl:1280},Xe=Object.entries(Ye),U=.25,W=[...Array(15)].map((e,t)=>t+1),Ze=[16,20,24,25,28,30,32,36,40,44,48,50,52,56,60],Qe=[64,72,80,96,100,112,128,144,160,192,200,224,256,288,300,320,384,400,448,500,512],G=[...W,...Ze,...Qe,...Object.values(Ye)],K=Array.from({length:100},(e,t)=>t+1),$e=[25,50,75,100,150,200,300,500,700,1e3],et=[`hover`,`focus`,`disabled`,`active`],q={margin:`m`,padding:`p`},tt={width:`w`,height:`h`},nt={top:`top`,right:`right`,bottom:`bottom`,left:`left`},rt={"min-width":`min-w`,"min-height":`min-h`,"max-width":`max-w`,"max-height":`max-h`},it={"font-mono":{"font-family":`monospace`},"font-sans":{"font-family":`sans-serif`},"font-serif":{"font-family":`serif`},"font-cursive":{"font-family":`cursive`},"text-xs":{"font-size":`.75rem`,"line-height":`calc(1 / 0.75)`},"text-sm":{"font-size":`.875rem`,"line-height":`calc(1.25 / 0.875)`},"text-base":{"font-size":`1rem`,"line-height":`calc(1.5 / 1)`},"text-lg":{"font-size":`1.125rem`,"line-height":`calc(1.75 / 1.125)`},"text-xl":{"font-size":`1.25rem`,"line-height":`calc(1.75 / 1.25)`},"text-2xl":{"font-size":`1.5rem`,"line-height":`calc(2 / 1.5)`},"text-3xl":{"font-size":`1.875rem`,"line-height":`calc(2.25 / 1.875)`},"text-4xl":{"font-size":`2.25rem`,"line-height":`calc(2.5 / 2.25)`},"text-5xl":{"font-size":`3rem`,"line-height":`1`},"text-6xl":{"font-size":`3.75rem`,"line-height":`1`},"text-7xl":{"font-size":`4.5rem`,"line-height":`1`},"font-thin":{"font-weight":100},"font-extralight":{"font-weight":200},"font-light":{"font-weight":300},"font-normal":{"font-weight":400},"font-medium":{"font-weight":500},"font-semibold":{"font-weight":600},"font-bold":{"font-weight":700},"font-extrabold":{"font-weight":800},"font-black":{"font-weight":900},italic:{"font-style":`italic`},"not-italic":{"font-style":`normal`},"w-max":{width:`max-content`},"w-min":{width:`min-content`},"w-fit":{width:`fit-content`},"h-max":{height:`max-content`},"h-min":{height:`min-content`},"h-fit":{height:`fit-content`},"size-auto":{width:`auto`,height:`auto`},"size-px":{width:`1px`,height:`1px`},"size-full":{width:`100%`,height:`100%`},"size-dvw":{width:`100dvw`,height:`100dvw`},"size-dvh":{width:`100dvh`,height:`100dvh`},"size-lvw":{width:`100lvw`,height:`100lvw`},"size-lvh":{width:`100lvh`,height:`100lvh`},"size-svw":{width:`100svw`,height:`100svw`},"size-svh":{width:`100svh`,height:`100svh`},"size-min":{width:`min-content`,height:`min-content`},"size-max":{width:`max-content`,height:`max-content`},"size-fit":{width:`fit-content`,height:`fit-content`},"tracking-tighter":{"letter-spacing":`-0.05em`},"tracking-tight":{"letter-spacing":`-0.025em`},"tracking-normal":{"letter-spacing":`0`},"tracking-wide":{"letter-spacing":`0.025em`},"tracking-wider":{"letter-spacing":`0.05em`},"tracking-widest":{"letter-spacing":`0.1em`},"leading-none":{"line-height":`1`},"leading-tight":{"line-height":`1.25`},"leading-snug":{"line-height":`1.375`},"leading-normal":{"line-height":`1.5`},"leading-relaxed":{"line-height":`1.625`},"leading-loose":{"line-height":`2`},"text-left":{"text-align":`left`},"text-right":{"text-align":`right`},"text-center":{"text-align":`center`},"text-justify":{"text-align":`justify`},underline:{"text-decoration":`underline`},"no-underline":{"text-decoration":`none`},"decoration-none":{"text-decoration":`none`},"line-through":{"text-decoration":`line-through`},uppercase:{"text-transform":`uppercase`},lowercase:{"text-transform":`lowercase`},capitalize:{"text-transform":`capitalize`},truncate:{"white-space":`nowrap`,overflow:`hidden`,"text-overflow":`ellipsis`},"text-elipsis":{"text-overflow":`ellipsis`},"text-clip":{"text-overflow":`clip`},"text-wrap":{"text-wrap":`wrap`},"text-nowrap":{"text-wrap":`nowrap`},"text-balance":{"text-wrap":`balance`},"text-pretty":{"text-wrap":`pretty`},"whitespace-normal":{"white-space":`normal`},"whitespace-nowrap":{"white-space":`nowrap`},"whitespace-pre":{"white-space":`pre`},"whitespace-pre-line":{"white-space":`pre-line`},"whitespace-pre-wrap":{"white-space":`pre-wrap`},"whitespace-break-spaces":{"white-space":`break-spaces`},relative:{position:`relative`},fixed:{position:`fixed`},absolute:{position:`absolute`},sticky:{position:`sticky`},"object-contain":{"object-fit":`contain`},"object-cover":{"object-fit":`cover`},"object-fill":{"object-fit":`fill`},"object-none":{"object-fit":`none`},block:{display:`block`},contents:{display:`contents`},hidden:{display:`none`},inline:{display:`inline`},"inline-block":{display:`inline-block`},visible:{visibility:`visible`},invisible:{visibility:`hidden`},collapse:{visibility:`collapse`},"list-none":{"list-style-type":`none`},"list-disc":{"list-style-type":`disc`},"list-decimal":{"list-style-type":`decimal`},flex:{display:`flex`},grid:{display:`grid`},"flex-1":{flex:`1 1 0%`},"flex-inline":{display:`inline-flex`},"flex-row":{"flex-direction":`row`},"flex-col":{"flex-direction":`column`},"flex-row-reverse":{"flex-direction":`row-reverse`},"flex-col-reverse":{"flex-direction":`column-reverse`},"flex-wrap":{"flex-wrap":`wrap`},"flex-wrap-reverse":{"flex-wrap":`wrap-reverse`},"flex-nowrap":{"flex-wrap":`nowrap`},"justify-start":{"justify-content":`flex-start`},"justify-end":{"justify-content":`flex-end`},"justify-center":{"justify-content":`center`},"justify-between":{"justify-content":`space-between`},"justify-around":{"justify-content":`space-around`},"justify-evenly":{"justify-content":`space-evenly`},"justify-stretch":{"justify-content":`stretch`},"items-start":{"align-items":`flex-start`},"items-end":{"align-items":`flex-end`},"items-center":{"align-items":`center`},"items-stretch":{"align-items":`stretch`},"flex-grow":{"flex-grow":1},"flex-shrink":{"flex-shrink":1},"align-baseline":{"vertical-align":`baseline`},"align-top":{"vertical-align":`top`},"align-middle":{"vertical-align":`middle`},"align-bottom":{"vertical-align":`bottom`},"align-text-top":{"vertical-align":`text-top`},"align-text-bottom":{"vertical-align":`text-bottom`},"overflow-auto":{overflow:`auto`},"overflow-x-auto":{"overflow-x":`auto`},"overflow-y-auto":{"overflow-y":`auto`},"overflow-hidden":{overflow:`hidden`},"overflow-x-hidden":{"overflow-x":`hidden`},"overflow-y-hidden":{"overflow-y":`hidden`},"overflow-visible":{overflow:`visible`},"overscroll-auto":{"overscroll-behavior":`auto`},"overscroll-contain":{"overscroll-behavior":`contain`},"overscroll-none":{"overscroll-behavior":`none`},"overscroll-x-auto":{"overscroll-behavior-x":`auto`},"overscroll-x-contain":{"overscroll-behavior-x":`contain`},"overscroll-x-none":{"overscroll-behavior-x":`none`},"overscroll-y-auto":{"overscroll-behavior-y":`auto`},"overscroll-y-contain":{"overscroll-behavior-y":`contain`},"overscroll-y-none":{"overscroll-behavior-y":`none`},"z-auto":{"z-index":`auto`},"cursor-pointer":{cursor:`pointer`},"cursor-wait":{cursor:`wait`},"cursor-not-allowed":{cursor:`not-allowed`},"select-none":{"user-select":`none`},"select-all":{"user-select":`all`},"pointer-events-auto":{"pointer-events":`auto`},"pointer-events-none":{"pointer-events":`none`},"box-border":{"box-sizing":`border-box`},"box-content":{"box-sizing":`content-box`},resize:{resize:`both`},"resize-x":{resize:`horizontal`},"resize-y":{resize:`vertical`},"resize-none":{resize:`none`},border:{border:`1px solid`},"border-none":{border:`none`},"border-solid":{"border-style":`solid`},"border-dashed":{"border-style":`dashed`},"border-dotted":{"border-style":`dotted`},"border-collapse":{"border-collapse":`collapse`},"rounded-none":{"border-radius":`0`},rounded:{"border-radius":`.25rem`},"rounded-sm":{"border-radius":`.125rem`},"rounded-md":{"border-radius":`.375rem`},"rounded-lg":{"border-radius":`.5rem`},"rounded-xl":{"border-radius":`.75rem`},"rounded-full":{"border-radius":`9999px`},"shadow-2xs":{"box-shadow":`0 1px rgb(0 0 0 / 0.05)`},"shadow-xs":{"box-shadow":`0 1px 2px 0 rgb(0 0 0 / 0.05)`},shadow:{"box-shadow":`0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)`},"shadow-sm":{"box-shadow":`0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)`},"shadow-md":{"box-shadow":`0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)`},"shadow-lg":{"box-shadow":`0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)`},"shadow-xl":{"box-shadow":`0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)`},"shadow-2xl":{"box-shadow":`0 25px 50px -12px rgb(0 0 0 / 0.25)`},"shadow-inner":{"box-shadow":`inset 0 2px 4px 0 rgb(0 0 0 / 0.05)`},"shadow-none":{"box-shadow":`0 0 #0000`},ring:{"box-shadow":`var(--ring-inset, ) 0 0 0 3px rgb(59 130 246 / 0.5)`},"ring-0":{"box-shadow":`var(--ring-inset, ) 0 0 0 0px rgb(59 130 246 / 0.5)`},"ring-1":{"box-shadow":`var(--ring-inset, ) 0 0 0 1px rgb(59 130 246 / 0.5)`},"ring-2":{"box-shadow":`var(--ring-inset, ) 0 0 0 2px rgb(59 130 246 / 0.5)`},"ring-4":{"box-shadow":`var(--ring-inset, ) 0 0 0 4px rgb(59 130 246 / 0.5)`},"ring-8":{"box-shadow":`var(--ring-inset, ) 0 0 0 8px rgb(59 130 246 / 0.5)`},"ring-inset":{"--ring-inset":`inset`},outline:{"outline-style":`solid`},"outline-none":{outline:`2px solid transparent`,"outline-offset":`2px`},"outline-dashed":{"outline-style":`dashed`},"outline-dotted":{"outline-style":`dotted`},"outline-double":{"outline-style":`double`},"outline-0":{"outline-width":`0px`},"outline-1":{"outline-width":`1px`},"outline-2":{"outline-width":`2px`},"outline-4":{"outline-width":`4px`},"outline-8":{"outline-width":`8px`},"outline-offset-0":{"outline-offset":`0px`},"outline-offset-1":{"outline-offset":`1px`},"outline-offset-2":{"outline-offset":`2px`},"outline-offset-4":{"outline-offset":`4px`},"outline-offset-8":{"outline-offset":`8px`},"aspect-auto":{"aspect-ratio":`auto`},"aspect-square":{"aspect-ratio":`1 / 1`},"aspect-video":{"aspect-ratio":`16 / 9`},"backdrop-blur-none":{"backdrop-filter":`blur(0)`},"backdrop-blur-sm":{"backdrop-filter":`blur(4px)`},"backdrop-blur":{"backdrop-filter":`blur(8px)`},"backdrop-blur-md":{"backdrop-filter":`blur(12px)`},"backdrop-blur-lg":{"backdrop-filter":`blur(16px)`},"backdrop-blur-xl":{"backdrop-filter":`blur(24px)`},"backdrop-blur-2xl":{"backdrop-filter":`blur(40px)`},"backdrop-blur-3xl":{"backdrop-filter":`blur(64px)`},"transition-none":{transition:`none`},transition:{"transition-property":`all`,"transition-timing-function":`ease-in-out`,"transition-duration":`var(--transition-duration, 150ms)`},"animate-none":{animation:`none`},"animate-spin":{animation:`spin 1s linear infinite`},"animate-ping":{animation:`ping 1s cubic-bezier(0, 0, 0.2, 1) infinite`},"animate-pulse":{animation:`pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite`},"bg-auto":{"background-size":`auto`},"bg-cover":{"background-size":`cover`},"bg-contain":{"background-size":`contain`},"bg-no-repeat":{"background-repeat":`no-repeat`},"bg-fixed":{"background-attachment":`fixed`},"bg-local":{"background-attachment":`local`},"bg-scroll":{"background-attachment":`scroll`},"min-h-screen":{"min-height":`100vh`},"max-h-screen":{"max-height":`100vh`},"min-w-screen":{"min-width":`100vw`},"h-dvh":{height:`100dvh`},"h-svh":{height:`100svh`},"h-lvh":{height:`100lvh`},"w-dvw":{width:`100dvw`},"w-svw":{width:`100svw`},"w-lvw":{width:`100lvw`},"min-h-dvh":{"min-height":`100dvh`},"min-h-svh":{"min-height":`100svh`},"min-h-lvh":{"min-height":`100lvh`},"flex-none":{flex:`none`},"flex-auto":{flex:`1 1 auto`},"flex-initial":{flex:`0 1 auto`},grow:{"flex-grow":`1`},"grow-0":{"flex-grow":`0`},shrink:{"flex-shrink":`1`},"shrink-0":{"flex-shrink":`0`},"self-auto":{"align-self":`auto`},"self-start":{"align-self":`flex-start`},"self-end":{"align-self":`flex-end`},"self-center":{"align-self":`center`},"self-stretch":{"align-self":`stretch`},"self-baseline":{"align-self":`baseline`},"content-normal":{"align-content":`normal`},"content-start":{"align-content":`flex-start`},"content-end":{"align-content":`flex-end`},"content-center":{"align-content":`center`},"content-between":{"align-content":`space-between`},"content-around":{"align-content":`space-around`},"content-evenly":{"align-content":`space-evenly`},"content-stretch":{"align-content":`stretch`},"items-baseline":{"align-items":`baseline`},"inset-0":{inset:`0`},"inset-auto":{inset:`auto`},"inset-x-0":{left:`0`,right:`0`},"inset-y-0":{top:`0`,bottom:`0`},"inset-x-auto":{left:`auto`,right:`auto`},"inset-y-auto":{top:`auto`,bottom:`auto`},"sr-only":{position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,"white-space":`nowrap`,"border-width":`0`},"not-sr-only":{position:`static`,width:`auto`,height:`auto`,padding:`0`,margin:`0`,overflow:`visible`,clip:`auto`,"white-space":`normal`}},at=[`@keyframes spin {
|
|
46
46
|
from { transform: rotate(0deg) }
|
|
47
47
|
to { transform: rotate(360deg) }
|
|
48
48
|
}`,`@keyframes ping {
|
|
@@ -53,5 +53,5 @@ let ke=new Set([`==`,`!=`,`<=`,`>=`,`||`,`&&`,`??`,`?.`]),Ae=new Set([`===`,`!==
|
|
|
53
53
|
}`,`@keyframes pulse {
|
|
54
54
|
0%, 100% { opacity: 1 }
|
|
55
55
|
50% { opacity: .5 }
|
|
56
|
-
}`],
|
|
57
|
-
`)),Z}var
|
|
56
|
+
}`],ot={red:{50:`#ffebee`,100:`#ffcdd2`,200:`#ef9a9a`,300:`#e57373`,400:`#ef5350`,500:`#f44336`,600:`#e53935`,700:`#d32f2f`,800:`#c62828`,900:`#b71c1c`},pink:{50:`#fce4ec`,100:`#f8bbd0`,200:`#f48fb1`,300:`#f06292`,400:`#ec407a`,500:`#e91e63`,600:`#d81b60`,700:`#c2185b`,800:`#ad1457`,900:`#880e4f`},purple:{50:`#f3e5f5`,100:`#e1bee7`,200:`#ce93d8`,300:`#ba68c8`,400:`#ab47bc`,500:`#9c27b0`,600:`#8e24aa`,700:`#7b1fa2`,800:`#6a1b9a`,900:`#4a148c`},"deep-purple":{50:`#ede7f6`,100:`#d1c4e9`,200:`#b39ddb`,300:`#9575cd`,400:`#7e57c2`,500:`#673ab7`,600:`#5e35b1`,700:`#512da8`,800:`#4527a0`,900:`#311b92`},indigo:{50:`#e8eaf6`,100:`#c5cae9`,200:`#9fa8da`,300:`#7986cb`,400:`#5c6bc0`,500:`#3f51b5`,600:`#3949ab`,700:`#303f9f`,800:`#283593`,900:`#1a237e`},blue:{50:`#e3f2fd`,100:`#bbdefb`,200:`#90caf9`,300:`#64b5f6`,400:`#42a5f5`,500:`#2196f3`,600:`#1e88e5`,700:`#1976d2`,800:`#1565c0`,900:`#0d47a1`},"light-blue":{50:`#e1f5fe`,100:`#b3e5fc`,200:`#81d4fa`,300:`#4fc3f7`,400:`#29b6f6`,500:`#03a9f4`,600:`#039be5`,700:`#0288d1`,800:`#0277bd`,900:`#01579b`},cyan:{50:`#e0f7fa`,100:`#b2ebf2`,200:`#80deea`,300:`#4dd0e1`,400:`#26c6da`,500:`#00bcd4`,600:`#00acc1`,700:`#0097a7`,800:`#00838f`,900:`#006064`},teal:{50:`#e0f2f1`,100:`#b2dfdb`,200:`#80cbc4`,300:`#4db6ac`,400:`#26a69a`,500:`#009688`,600:`#00897b`,700:`#00796b`,800:`#00695c`,900:`#004d40`},green:{50:`#e8f5e9`,100:`#c8e6c9`,200:`#a5d6a7`,300:`#81c784`,400:`#66bb6a`,500:`#4caf50`,600:`#43a047`,700:`#388e3c`,800:`#2e7d32`,900:`#1b5e20`},"light-green":{50:`#f1f8e9`,100:`#dcedc8`,200:`#c5e1a5`,300:`#aed581`,400:`#9ccc65`,500:`#8bc34a`,600:`#7cb342`,700:`#689f38`,800:`#558b2f`,900:`#33691e`},lime:{50:`#f9fbe7`,100:`#f0f4c3`,200:`#e6ee9c`,300:`#dce775`,400:`#d4e157`,500:`#cddc39`,600:`#c0ca33`,700:`#afb42b`,800:`#9e9d24`,900:`#827717`},yellow:{50:`#fffde7`,100:`#fff9c4`,200:`#fff59d`,300:`#fff176`,400:`#ffee58`,500:`#ffeb3b`,600:`#fdd835`,700:`#fbc02d`,800:`#f9a825`,900:`#f57f17`},amber:{50:`#fff8e1`,100:`#ffecb3`,200:`#ffe082`,300:`#ffd54f`,400:`#ffca28`,500:`#ffc107`,600:`#ffb300`,700:`#ffa000`,800:`#ff8f00`,900:`#ff6f00`},orange:{50:`#fff3e0`,100:`#ffe0b2`,200:`#ffcc80`,300:`#ffb74d`,400:`#ffa726`,500:`#ff9800`,600:`#fb8c00`,700:`#f57c00`,800:`#ef6c00`,900:`#e65100`},"deep-orange":{50:`#fbe9e7`,100:`#ffccbc`,200:`#ffab91`,300:`#ff8a65`,400:`#ff7043`,500:`#ff5722`,600:`#f4511e`,700:`#e64a19`,800:`#d84315`,900:`#bf360c`},brown:{50:`#efebe9`,100:`#d7ccc8`,200:`#bcaaa4`,300:`#a1887f`,400:`#8d6e63`,500:`#795548`,600:`#6d4c41`,700:`#5d4037`,800:`#4e342e`,900:`#3e2723`},gray:{50:`#fafafa`,100:`#f5f5f5`,200:`#eeeeee`,300:`#e0e0e0`,400:`#bdbdbd`,500:`#9e9e9e`,600:`#757575`,700:`#616161`,800:`#424242`,900:`#212121`},"blue-gray":{50:`#eceff1`,100:`#cfd8dc`,200:`#b0bec5`,300:`#90a4ae`,400:`#78909c`,500:`#607d8b`,600:`#546e7a`,700:`#455a64`,800:`#37474f`,900:`#263238`}};function st(e){return et.map(t=>`.${t}\\:${e}:${t}`)}function ct(e,t){return Xe.map(([n,r])=>`@media (min-width: ${r}px) { .${n}\\:${e} { ${t} } }`)}function J(e){return e.flatMap(([e,t])=>[`.${e} { ${t} }`,`${st(e).join(`,`)} { ${t} }`,...ct(e,t)])}function lt(e,t){let n=e[0]===`@`,r=t[0]===`@`;return n&&!r?1:!n&&r?-1:e.localeCompare(t)}function Y(e){return J(Object.entries(e).flatMap(([e,t])=>[[`${t}-0`,`${e}: 0`],[`${t}-screen`,`${e}: 100v${e.includes(`height`)?`h`:`w`}`],[`${t}-full`,`${e}: 100%`],...G.map(n=>[`${t}-${n}`,`${e}: ${n*U}rem`]),...G.map(n=>[`-${t}-${n}`,`${e}: -${n*U}rem`]),...G.map(n=>[`${t}-${n}px`,`${e}: ${n}px`]),...G.map(n=>[`-${t}-${n}px`,`${e}: -${n}px`]),...K.map(n=>[`${t}-${n}\\%`,`${e}: ${n}%`]),...K.map(n=>[`-${t}-${n}\\%`,`${e}: -${n}%`]),...Xe.map(([n,r])=>[`${t}-${n}`,`${e}: ${r}px`])]))}function X(e){return J(Object.entries(e).flatMap(([e,t])=>[[`${t}-auto`,`${e}: auto`],[`${t}x-auto`,`${e}-left: auto; ${e}-right: auto;`],[`${t}y-auto`,`${e}-top: auto; ${e}-bottom: auto;`],[`${t}x-0`,`${e}-left: 0; ${e}-right: 0;`],[`${t}y-0`,`${e}-top: 0; ${e}-bottom: 0;`],...G.map(n=>[`${t}x-${n}`,`${e}-left: ${n*U}rem; ${e}-right: ${n*U}rem;`]),...G.map(n=>[`${t}y-${n}`,`${e}-top: ${n*U}rem; ${e}-bottom: ${n*U}rem;`]),...G.map(n=>[`${t}x-${n}px`,`${e}-left: ${n}px; ${e}-right: ${n}px;`]),...G.map(n=>[`${t}y-${n}px`,`${e}-top: ${n}px; ${e}-bottom: ${n}px;`]),...K.map(n=>[`${t}x-${n}\\%`,`${e}-left: ${n}%; ${e}-right: ${n}%;`]),...K.map(n=>[`${t}y-${n}\\%`,`${e}-top: ${n}%; ${e}-bottom: ${n}%;`])]))}function ut(e){return J(Object.entries(e).flatMap(([e,t])=>[[`${t}t-0`,`${e}-top: 0`],[`${t}b-0`,`${e}-bottom: 0`],[`${t}l-0`,`${e}-left: 0`],[`${t}r-0`,`${e}-right: 0`],[`${t}t-auto`,`${e}-top: auto`],[`${t}b-auto`,`${e}-bottom: auto`],[`${t}l-auto`,`${e}-left: auto`],[`${t}r-auto`,`${e}-right: auto`],...[``,`-`].flatMap(n=>[...G.map(r=>[`${n}${t}t-${r}`,`${e}-top: ${n}${r*U}rem`]),...G.map(r=>[`${n}${t}b-${r}`,`${e}-bottom: ${n}${r*U}rem`]),...G.map(r=>[`${n}${t}l-${r}`,`${e}-left: ${n}${r*U}rem`]),...G.map(r=>[`${n}${t}r-${r}`,`${e}-right: ${n}${r*U}rem`]),...G.map(r=>[`${n}${t}t-${r}px`,`${e}-top: ${n}${r}px`]),...G.map(r=>[`${n}${t}b-${r}px`,`${e}-bottom: ${n}${r}px`]),...G.map(r=>[`${n}${t}l-${r}px`,`${e}-left: ${n}${r}px`]),...G.map(r=>[`${n}${t}r-${r}px`,`${e}-right: ${n}${r}px`]),...K.map(r=>[`${n}${t}t-${r}\\%`,`${e}-top: ${n}${r}%`]),...K.map(r=>[`${n}${t}b-${r}\\%`,`${e}-bottom: ${n}${r}%`]),...K.map(r=>[`${n}${t}l-${r}\\%`,`${e}-left: ${n}${r}%`]),...K.map(r=>[`${n}${t}r-${r}\\%`,`${e}-right: ${n}${r}%`])])]))}function dt(){return J([[`border`,`border: 1px`],[`border-x`,`border-inline-width: 1px`],[`border-y`,`border-block-width: 1px`],...[0,...W].map(e=>[`border-${e}`,`border-width: ${e}px`]),...[0,...W].map(e=>[`border-x-${e}`,`border-inline-width: ${e}px;`]),...[0,...W].map(e=>[`border-y-${e}`,`border-block-width: ${e}px;`]),...[`top`,`bottom`,`left`,`right`].flatMap(e=>[[`border-${e.slice(0,1)}`,`border-${e}: 1px`],...[0,...W].map(t=>[`border-${e.slice(0,1)}-${t}`,`border-${e}-width: ${t}px`])])])}function ft(){return J(K.map(e=>[`z-${e}`,`z-index: ${e}`]))}function pt(){return J($e.map(e=>[`duration-${e}`,`--transition-duration: ${e}ms; transition-duration: ${e}ms`]))}function mt(){return J([[`space-x-0 > *`,`margin-left: 0`],[`space-y-0 > *`,`margin-top: 0`],...G.map(e=>[`space-x-${e} > :not(:first-child)`,`margin-left: ${e*U}rem`]),...G.map(e=>[`space-y-${e} > :not(:first-child)`,`margin-top: ${e*U}rem`]),...G.map(e=>[`space-x-${e}px > :not(:first-child)`,`margin-left: ${e}px`]),...G.map(e=>[`space-y-${e}px > :not(:first-child)`,`margin-top: ${e}px`]),[`gap-0`,`gap: 0`],...G.map(e=>[`gap-${e}`,`gap: ${e*U}rem`]),...G.map(e=>[`gap-${e}px`,`gap: ${e}px`]),...G.map(e=>[`gap-x-${e}`,`column-gap: ${e*U}rem`]),...G.map(e=>[`gap-y-${e}`,`row-gap: ${e*U}rem`]),...G.map(e=>[`gap-x-${e}px`,`column-gap: ${e}px`]),...G.map(e=>[`gap-y-${e}px`,`row-gap: ${e}px`]),[`divide-x > :not(:last-child)`,`border-inline-end-width: 1px`],[`divide-y > :not(:last-child)`,`border-bottom-width: 1px`],[`divide-x-0 > :not(:last-child)`,`border-inline-end-width: 0px`],[`divide-y-0 > :not(:last-child)`,`border-bottom-width: 0px`],...[2,4,8].map(e=>[`divide-x-${e} > :not(:last-child)`,`border-inline-end-width: ${e}px`]),...[2,4,8].map(e=>[`divide-y-${e} > :not(:last-child)`,`border-bottom-width: ${e}px`]),[`divide-solid > :not(:last-child)`,`border-style: solid`],[`divide-dashed > :not(:last-child)`,`border-style: dashed`],[`divide-dotted > :not(:last-child)`,`border-style: dotted`],[`divide-none > :not(:last-child)`,`border-style: none`]])}function ht(){return J([...Array.from({length:100},(e,t)=>[`text-${t}px`,`font-size: ${t}px`]),...Array.from({length:100},(e,t)=>[`text-${t*U}rem`,`font-size: ${t*U}rem`])])}function gt(){return J([...Array.from({length:12},(e,t)=>t+1).map(e=>[`grid-cols-${e}`,`grid-template-columns: repeat(${e}, minmax(0, 1fr))`]),[`grid-cols-none`,`grid-template-columns: none`],...Array.from({length:12},(e,t)=>t+1).map(e=>[`col-span-${e}`,`grid-column: span ${e} / span ${e}`]),[`col-span-full`,`grid-column: 1 / -1`],...Array.from({length:13},(e,t)=>t+1).map(e=>[`col-start-${e}`,`grid-column-start: ${e}`]),[`col-start-auto`,`grid-column-start: auto`],...Array.from({length:13},(e,t)=>t+1).map(e=>[`col-end-${e}`,`grid-column-end: ${e}`]),[`col-end-auto`,`grid-column-end: auto`]])}function _t(){return Object.entries(it).flatMap(([e,t])=>{let n=Object.entries(t).map(([e,t])=>`${e}: ${t}`).join(`; `);return[`.${e} { ${n} }`,`${st(e).join(`,`)} { ${n} }`,...ct(e,n)]})}function vt(e){let t=0,n=0,r=0;return e.length===4?(t=parseInt(e[1]+e[1],16),n=parseInt(e[2]+e[2],16),r=parseInt(e[3]+e[3],16)):e.length===7&&(t=parseInt(e.slice(1,3),16),n=parseInt(e.slice(3,5),16),r=parseInt(e.slice(5,7),16)),`${t} ${n} ${r}`}function yt(){let e=(e,t)=>{let n=[[`text-${e}`,`color: ${t}`],[`fill-${e}`,`fill: ${t}`],[`bg-${e}`,`background-color: ${t}`],[`border-${e}`,`border-color: ${t}`]];if(t.startsWith(`#`)){let r=vt(t);for(let t of K){let i=t/100;n.push([`text-${e}\\/${t}`,`color: rgb(${r} / ${i})`],[`bg-${e}\\/${t}`,`background-color: rgb(${r} / ${i})`],[`border-${e}\\/${t}`,`border-color: rgb(${r} / ${i})`])}}return n};return J([...e(`white`,`#fff`),...e(`black`,`#000`),...e(`transparent`,`transparent`),...Object.entries(ot).flatMap(([t,n])=>[...e(t,n[500]),...Object.entries(n).flatMap(([n,r])=>e(`${t}-${n}`,r))])])}function bt(){return J([[`opacity-0`,`opacity: 0`],...K.map(e=>[`opacity-${e}`,`opacity: ${e/100}`])])}let Z=null;function xt(){return Z===null&&(Z=[...at,..._t(),...yt(),...bt(),...ft(),...pt(),...Y(nt),...Y(tt),...X(tt),...ut(q),...Y(q),...X(q),...mt(),...Y(rt),...dt(),...ht(),...gt()].sort(lt).join(`
|
|
57
|
+
`)),Z}var St=class extends Ke{impl=`browser`;dirpath=M(globalThis.location?.href??`http://localhost/`);parseHTML(e,t={rootDocument:!1}){if(t.rootDocument)return new DOMParser().parseFromString(e,`text/html`);{let t=document.createRange();return t.selectNodeContents(document.body),t.createContextualFragment(e)}}serializeHTML(e){return new XMLSerializer().serializeToString(e).replace(/\s?xmlns="[^"]+"/gm,``)}preprocessLocal(e,t){return this.preprocessRemote(e,t)}createElement(e,t){return(t||document).createElement(e)}createComment(e,t){return(t||document).createComment(e)}textContent(e,t){e.textContent=t}};new St;function Ct(e){for(let t of e){let e=document.createElement(`style`);switch(t){case`minimal`:f(e,Je());break;case`basic`:f(e,qe());break;case`utils`:e.textContent=xt();break;default:console.error(`Unknown style name: "${t}"`);continue}globalThis.document.head.appendChild(e)}}let Q=new St;globalThis.Mancha=Q;let $=globalThis.document?.currentScript;if(globalThis.document?.currentScript?.hasAttribute(`init`)){let e=$?.hasAttribute(`debug`),t=$?.getAttribute(`cache`),n=$?.getAttribute(`target`)?.split(`+`)||[`body`];window.addEventListener(`load`,()=>{n.map(async n=>{let r=globalThis.document.querySelector(n);await Q.debug(!!e).mount(r,{cache:t})})})}if(globalThis.document?.currentScript?.hasAttribute(`css`)){let e=$?.getAttribute(`css`)?.split(`+`);Ct(e)}return Q})();
|
package/docs/css.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# CSS Documentation
|
|
2
2
|
|
|
3
|
-
Mancha provides a set of CSS utilities and
|
|
3
|
+
Mancha provides a set of CSS utilities and minimal styles to help you build your application.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Minimal CSS
|
|
6
6
|
|
|
7
|
-
The
|
|
7
|
+
The minimal CSS rules provide a clean, readable default style for standard HTML elements. You can inject them using `injectMinimalCss()` or by adding `css="minimal"` to your script tag.
|
|
8
8
|
|
|
9
9
|
### Reset & Defaults
|
|
10
10
|
- **Max Width**: 70ch (centered)
|
|
@@ -14,6 +14,18 @@ The basic CSS rules provide a clean, readable default style for standard HTML el
|
|
|
14
14
|
- **H1-H6 Margin**: 1em 0 0.5em
|
|
15
15
|
- **P, UL, OL Margin Bottom**: 1em
|
|
16
16
|
|
|
17
|
+
## Basic CSS
|
|
18
|
+
|
|
19
|
+
The basic CSS rules provide a more comprehensive reset and set of defaults, widely based on Tailwind CSS Preflight. You can inject them using `injectBasicCss()` or by adding `css="basic"` to your script tag.
|
|
20
|
+
|
|
21
|
+
### Key Features
|
|
22
|
+
- **Box Sizing**: `border-box` globally
|
|
23
|
+
- **Typography**: Default sans-serif font stack, consistent line-height
|
|
24
|
+
- **Form Elements**: Inherit font styles, transparent backgrounds, `cursor: pointer` for buttons
|
|
25
|
+
- **Media**: Images/videos max-width 100%
|
|
26
|
+
- **Dialog**: Default backdrop styling
|
|
27
|
+
- **Resets**: Removes default margins/paddings from most block elements
|
|
28
|
+
|
|
17
29
|
## Utility CSS
|
|
18
30
|
|
|
19
31
|
The utility CSS rules are inspired by Tailwind CSS. You can inject them using `injectUtilsCss()` or by adding `css="utils"` to your script tag.
|
package/docs/quickstart.md
CHANGED
|
@@ -10,7 +10,7 @@ To get started, simply add this to your HTML head attribute:
|
|
|
10
10
|
|
|
11
11
|
## Basic Form
|
|
12
12
|
|
|
13
|
-
After importing `Mancha`, you can take advantage of reactivity and tailwind-compatible CSS styling. For a full list of supported CSS utilities and
|
|
13
|
+
After importing `Mancha`, you can take advantage of reactivity and tailwind-compatible CSS styling. For a full list of supported CSS utilities and minimal styles, see the [CSS Documentation](./css.md).
|
|
14
14
|
|
|
15
15
|
For example, a basic form might look like this:
|
|
16
16
|
|
package/package.json
CHANGED
|
@@ -21,11 +21,11 @@ function generateMarkdown() {
|
|
|
21
21
|
let md = "# CSS Documentation\n\n";
|
|
22
22
|
|
|
23
23
|
md +=
|
|
24
|
-
"Mancha provides a set of CSS utilities and
|
|
24
|
+
"Mancha provides a set of CSS utilities and minimal styles to help you build your application.\n\n";
|
|
25
25
|
|
|
26
|
-
md += "##
|
|
26
|
+
md += "## Minimal CSS\n\n";
|
|
27
27
|
md +=
|
|
28
|
-
'The
|
|
28
|
+
'The minimal CSS rules provide a clean, readable default style for standard HTML elements. You can inject them using `injectMinimalCss()` or by adding `css="minimal"` to your script tag.\n\n';
|
|
29
29
|
md += "### Reset & Defaults\n";
|
|
30
30
|
md += "- **Max Width**: 70ch (centered)\n";
|
|
31
31
|
md += "- **Padding**: 2em 1em\n";
|
|
@@ -34,6 +34,18 @@ function generateMarkdown() {
|
|
|
34
34
|
md += "- **H1-H6 Margin**: 1em 0 0.5em\n";
|
|
35
35
|
md += "- **P, UL, OL Margin Bottom**: 1em\n\n";
|
|
36
36
|
|
|
37
|
+
md += "## Basic CSS\n\n";
|
|
38
|
+
md +=
|
|
39
|
+
'The basic CSS rules provide a more comprehensive reset and set of defaults, widely based on Tailwind CSS Preflight. You can inject them using `injectBasicCss()` or by adding `css="basic"` to your script tag.\n\n';
|
|
40
|
+
md += "### Key Features\n";
|
|
41
|
+
md += "- **Box Sizing**: `border-box` globally\n";
|
|
42
|
+
md += "- **Typography**: Default sans-serif font stack, consistent line-height\n";
|
|
43
|
+
md +=
|
|
44
|
+
"- **Form Elements**: Inherit font styles, transparent backgrounds, `cursor: pointer` for buttons\n";
|
|
45
|
+
md += "- **Media**: Images/videos max-width 100%\n";
|
|
46
|
+
md += "- **Dialog**: Default backdrop styling\n";
|
|
47
|
+
md += "- **Resets**: Removes default margins/paddings from most block elements\n\n";
|
|
48
|
+
|
|
37
49
|
md += "## Utility CSS\n\n";
|
|
38
50
|
md +=
|
|
39
51
|
'The utility CSS rules are inspired by Tailwind CSS. You can inject them using `injectUtilsCss()` or by adding `css="utils"` to your script tag.\n\n';
|