@robosophy/ui-vue 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/AGENTS.md +32 -0
  2. package/README.md +123 -1
  3. package/ai-context.md +20 -1
  4. package/components.md +322 -0
  5. package/dist/components/RsAccountSelector/RsAccountSelector.types.d.ts +38 -0
  6. package/dist/components/RsAccountSelector/RsAccountSelector.types.d.ts.map +1 -0
  7. package/dist/components/RsAccountSelector/RsAccountSelector.vue.d.ts +52 -0
  8. package/dist/components/RsAccountSelector/RsAccountSelector.vue.d.ts.map +1 -0
  9. package/dist/components/RsAccountSelector/index.d.ts +4 -0
  10. package/dist/components/RsAccountSelector/index.d.ts.map +1 -0
  11. package/dist/components/RsIcon/RsIcon.types.d.ts +20 -0
  12. package/dist/components/RsIcon/RsIcon.types.d.ts.map +1 -0
  13. package/dist/components/RsIcon/RsIcon.vue.d.ts +13 -0
  14. package/dist/components/RsIcon/RsIcon.vue.d.ts.map +1 -0
  15. package/dist/components/RsIcon/index.d.ts +6 -0
  16. package/dist/components/RsIcon/index.d.ts.map +1 -0
  17. package/dist/components/RsSidebar/RsSidebar.types.d.ts +32 -0
  18. package/dist/components/RsSidebar/RsSidebar.types.d.ts.map +1 -0
  19. package/dist/components/RsSidebar/RsSidebar.vue.d.ts +77 -0
  20. package/dist/components/RsSidebar/RsSidebar.vue.d.ts.map +1 -0
  21. package/dist/components/RsSidebar/index.d.ts +4 -0
  22. package/dist/components/RsSidebar/index.d.ts.map +1 -0
  23. package/dist/index.css +1 -1
  24. package/dist/index.d.ts +7 -3
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +4401 -83
  27. package/dist/index.js.map +1 -1
  28. package/dist/plugin.d.ts +184 -25
  29. package/dist/plugin.d.ts.map +1 -1
  30. package/dist/vite.d.ts +33 -0
  31. package/dist/vite.d.ts.map +1 -0
  32. package/dist/vite.js +300 -0
  33. package/dist/vite.js.map +1 -0
  34. package/package.json +26 -7
  35. package/dist/components/RsCard/RsCard.types.d.ts +0 -14
  36. package/dist/components/RsCard/RsCard.types.d.ts.map +0 -1
  37. package/dist/components/RsCard/RsCard.vue.d.ts +0 -32
  38. package/dist/components/RsCard/RsCard.vue.d.ts.map +0 -1
  39. package/dist/components/RsCard/index.d.ts +0 -4
  40. package/dist/components/RsCard/index.d.ts.map +0 -1
package/dist/plugin.d.ts CHANGED
@@ -1,14 +1,22 @@
1
1
  import type { Plugin } from "vue";
2
2
  export declare const components: readonly [{
3
- new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import(".").RsCardProps> & Readonly<{
4
- onClick?: ((event: MouseEvent) => any) | undefined;
3
+ new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import(".").RsAccountSelectorProps> & Readonly<{
4
+ "onSelect-account"?: ((account: import(".").RsAccountSelectorAccount) => any) | undefined;
5
+ onAction?: ((action: import(".").RsAccountSelectorAction) => any) | undefined;
6
+ "onFooter-action"?: ((action: import(".").RsAccountSelectorAction) => any) | undefined;
5
7
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
- click: (event: MouseEvent) => any;
8
+ "select-account": (account: import(".").RsAccountSelectorAccount) => any;
9
+ action: (action: import(".").RsAccountSelectorAction) => any;
10
+ "footer-action": (action: import(".").RsAccountSelectorAction) => any;
7
11
  }, import("vue").PublicProps, {
8
- variant: import(".").RsCardVariant;
9
- padding: import(".").RsCardPadding;
10
- interactive: boolean;
11
- as: import(".").RsCardAs;
12
+ accounts: import(".").RsAccountSelectorAccount[];
13
+ actions: import(".").RsAccountSelectorAction[];
14
+ footerActions: import(".").RsAccountSelectorAction[];
15
+ loading: boolean;
16
+ emptyText: string;
17
+ activeText: string;
18
+ selectText: string;
19
+ width: string;
12
20
  }, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
13
21
  P: {};
14
22
  B: {};
@@ -16,37 +24,188 @@ export declare const components: readonly [{
16
24
  C: {};
17
25
  M: {};
18
26
  Defaults: {};
19
- }, Readonly<import(".").RsCardProps> & Readonly<{
20
- onClick?: ((event: MouseEvent) => any) | undefined;
27
+ }, Readonly<import(".").RsAccountSelectorProps> & Readonly<{
28
+ "onSelect-account"?: ((account: import(".").RsAccountSelectorAccount) => any) | undefined;
29
+ onAction?: ((action: import(".").RsAccountSelectorAction) => any) | undefined;
30
+ "onFooter-action"?: ((action: import(".").RsAccountSelectorAction) => any) | undefined;
21
31
  }>, {}, {}, {}, {}, {
22
- variant: import(".").RsCardVariant;
23
- padding: import(".").RsCardPadding;
24
- interactive: boolean;
25
- as: import(".").RsCardAs;
32
+ accounts: import(".").RsAccountSelectorAccount[];
33
+ actions: import(".").RsAccountSelectorAction[];
34
+ footerActions: import(".").RsAccountSelectorAction[];
35
+ loading: boolean;
36
+ emptyText: string;
37
+ activeText: string;
38
+ selectText: string;
39
+ width: string;
26
40
  }>;
27
41
  __isFragment?: never;
28
42
  __isTeleport?: never;
29
43
  __isSuspense?: never;
30
- } & import("vue").ComponentOptionsBase<Readonly<import(".").RsCardProps> & Readonly<{
31
- onClick?: ((event: MouseEvent) => any) | undefined;
44
+ } & import("vue").ComponentOptionsBase<Readonly<import(".").RsAccountSelectorProps> & Readonly<{
45
+ "onSelect-account"?: ((account: import(".").RsAccountSelectorAccount) => any) | undefined;
46
+ onAction?: ((action: import(".").RsAccountSelectorAction) => any) | undefined;
47
+ "onFooter-action"?: ((action: import(".").RsAccountSelectorAction) => any) | undefined;
32
48
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
33
- click: (event: MouseEvent) => any;
49
+ "select-account": (account: import(".").RsAccountSelectorAccount) => any;
50
+ action: (action: import(".").RsAccountSelectorAction) => any;
51
+ "footer-action": (action: import(".").RsAccountSelectorAction) => any;
34
52
  }, string, {
35
- variant: import(".").RsCardVariant;
36
- padding: import(".").RsCardPadding;
37
- interactive: boolean;
38
- as: import(".").RsCardAs;
53
+ accounts: import(".").RsAccountSelectorAccount[];
54
+ actions: import(".").RsAccountSelectorAction[];
55
+ footerActions: import(".").RsAccountSelectorAction[];
56
+ loading: boolean;
57
+ emptyText: string;
58
+ activeText: string;
59
+ selectText: string;
60
+ width: string;
39
61
  }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
40
62
  $slots: {
41
- media?: (props: {}) => any;
63
+ 'user-avatar'?: (props: {
64
+ user: import(".").RsAccountSelectorUser;
65
+ }) => any;
66
+ } & {
67
+ actions?: (props: {
68
+ actions: import(".").RsAccountSelectorAction[];
69
+ }) => any;
70
+ } & {
71
+ empty?: (props: {}) => any;
72
+ } & {
73
+ 'account-avatar'?: (props: {
74
+ account: import(".").RsAccountSelectorAccount;
75
+ }) => any;
42
76
  } & {
43
- header?: (props: {}) => any;
77
+ 'account-trailing'?: (props: {
78
+ account: import(".").RsAccountSelectorAccount;
79
+ }) => any;
80
+ } & {
81
+ footer?: (props: {
82
+ actions: import(".").RsAccountSelectorAction[];
83
+ }) => any;
84
+ };
85
+ }), import("vue").DefineComponent<import(".").RsIconProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import(".").RsIconProps> & Readonly<{}>, {
86
+ fill: boolean;
87
+ family: import(".").RsIconFamily;
88
+ size: import(".").RsIconSize;
89
+ color: import(".").RsIconColor;
90
+ weight: import(".").RsIconWeight;
91
+ grade: number;
92
+ interactive: boolean;
93
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
94
+ new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import(".").RsSidebarProps> & Readonly<{
95
+ "onItem-click"?: ((item: import(".").RsSidebarItem) => any) | undefined;
96
+ "onClose-mobile"?: (() => any) | undefined;
97
+ "onExpanded-change"?: ((expanded: boolean) => any) | undefined;
98
+ "onModule-select"?: ((module: import(".").RsSidebarModule) => any) | undefined;
99
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
100
+ "item-click": (item: import(".").RsSidebarItem) => any;
101
+ "close-mobile": () => any;
102
+ "expanded-change": (expanded: boolean) => any;
103
+ "module-select": (module: import(".").RsSidebarModule) => any;
104
+ }, import("vue").PublicProps, {
105
+ ariaLabel: string;
106
+ title: string;
107
+ icon: string;
108
+ variant: import(".").RsSidebarVariant;
109
+ footerItems: import(".").RsSidebarItem[];
110
+ modules: import(".").RsSidebarModule[];
111
+ navigateOnModuleSelect: boolean;
112
+ expanded: boolean;
113
+ expandOnHover: boolean;
114
+ mobileOpen: boolean;
115
+ widthCollapsed: string;
116
+ widthExpanded: string;
117
+ }, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
118
+ P: {};
119
+ B: {};
120
+ D: {};
121
+ C: {};
122
+ M: {};
123
+ Defaults: {};
124
+ }, Readonly<import(".").RsSidebarProps> & Readonly<{
125
+ "onItem-click"?: ((item: import(".").RsSidebarItem) => any) | undefined;
126
+ "onClose-mobile"?: (() => any) | undefined;
127
+ "onExpanded-change"?: ((expanded: boolean) => any) | undefined;
128
+ "onModule-select"?: ((module: import(".").RsSidebarModule) => any) | undefined;
129
+ }>, {}, {}, {}, {}, {
130
+ ariaLabel: string;
131
+ title: string;
132
+ icon: string;
133
+ variant: import(".").RsSidebarVariant;
134
+ footerItems: import(".").RsSidebarItem[];
135
+ modules: import(".").RsSidebarModule[];
136
+ navigateOnModuleSelect: boolean;
137
+ expanded: boolean;
138
+ expandOnHover: boolean;
139
+ mobileOpen: boolean;
140
+ widthCollapsed: string;
141
+ widthExpanded: string;
142
+ }>;
143
+ __isFragment?: never;
144
+ __isTeleport?: never;
145
+ __isSuspense?: never;
146
+ } & import("vue").ComponentOptionsBase<Readonly<import(".").RsSidebarProps> & Readonly<{
147
+ "onItem-click"?: ((item: import(".").RsSidebarItem) => any) | undefined;
148
+ "onClose-mobile"?: (() => any) | undefined;
149
+ "onExpanded-change"?: ((expanded: boolean) => any) | undefined;
150
+ "onModule-select"?: ((module: import(".").RsSidebarModule) => any) | undefined;
151
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
152
+ "item-click": (item: import(".").RsSidebarItem) => any;
153
+ "close-mobile": () => any;
154
+ "expanded-change": (expanded: boolean) => any;
155
+ "module-select": (module: import(".").RsSidebarModule) => any;
156
+ }, string, {
157
+ ariaLabel: string;
158
+ title: string;
159
+ icon: string;
160
+ variant: import(".").RsSidebarVariant;
161
+ footerItems: import(".").RsSidebarItem[];
162
+ modules: import(".").RsSidebarModule[];
163
+ navigateOnModuleSelect: boolean;
164
+ expanded: boolean;
165
+ expandOnHover: boolean;
166
+ mobileOpen: boolean;
167
+ widthCollapsed: string;
168
+ widthExpanded: string;
169
+ }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
170
+ $slots: {
171
+ header?: (props: {
172
+ expanded: boolean;
173
+ activeParent: {
174
+ id: string;
175
+ label: string;
176
+ icon?: string | undefined;
177
+ active?: boolean | undefined;
178
+ disabled?: boolean | undefined;
179
+ visible?: boolean | undefined;
180
+ children?: /*elided*/ any[] | undefined;
181
+ } | null;
182
+ closeMobile: () => void;
183
+ goBack: () => void;
184
+ }) => any;
44
185
  } & {
45
- actions?: (props: {}) => any;
186
+ 'header-action'?: (props: {
187
+ activeParent: {
188
+ id: string;
189
+ label: string;
190
+ icon?: string | undefined;
191
+ active?: boolean | undefined;
192
+ disabled?: boolean | undefined;
193
+ visible?: boolean | undefined;
194
+ children?: /*elided*/ any[] | undefined;
195
+ } | null;
196
+ closeMobile: () => void;
197
+ goBack: () => void;
198
+ }) => any;
46
199
  } & {
47
- default?: (props: {}) => any;
200
+ item?: (props: {
201
+ item: import(".").RsSidebarItem;
202
+ expanded: boolean;
203
+ }) => any;
48
204
  } & {
49
- footer?: (props: {}) => any;
205
+ footer?: (props: {
206
+ items: import(".").RsSidebarItem[];
207
+ expanded: boolean;
208
+ }) => any;
50
209
  };
51
210
  })];
52
211
  export declare const RobosophyUiVue: Plugin;
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAO,MAAM,EAAE,MAAM,KAAK,CAAC;AAIvC,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAoB,CAAC;AAE5C,eAAO,MAAM,cAAc,EAAE,MAM5B,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAO,MAAM,EAAE,MAAM,KAAK,CAAC;AAMvC,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAkD,CAAC;AAE1E,eAAO,MAAM,cAAc,EAAE,MAM5B,CAAC;AAEF,eAAe,cAAc,CAAC"}
package/dist/vite.d.ts ADDED
@@ -0,0 +1,33 @@
1
+ import type { HtmlTagDescriptor, Plugin, ResolvedConfig } from "vite";
2
+ import type { RsIconFamily } from "./components/RsIcon";
3
+ type IconInput = string | {
4
+ family?: RsIconFamily;
5
+ name: string;
6
+ };
7
+ export type RsIconFontDisplay = "block" | "swap" | "fallback" | "optional";
8
+ export type RobosophyMaterialSymbolsOptions = {
9
+ fontDisplay?: RsIconFontDisplay;
10
+ include?: IconInput[];
11
+ preload?: boolean;
12
+ roots?: string[];
13
+ scan?: boolean;
14
+ };
15
+ type IconUsageMap = Map<RsIconFamily, Set<string>>;
16
+ type MaterialSymbolsLinkAssets = {
17
+ cssHref: string;
18
+ fonts: Pick<GeneratedFontAsset, "href">[];
19
+ };
20
+ export declare function robosophyMaterialSymbols(options?: RobosophyMaterialSymbolsOptions): Plugin;
21
+ type GeneratedFontAsset = {
22
+ family: RsIconFamily;
23
+ fileName: string;
24
+ href: string;
25
+ source: Buffer;
26
+ };
27
+ export declare function collectMaterialSymbolUsages(config: Pick<ResolvedConfig, "root">, options?: RobosophyMaterialSymbolsOptions): Promise<IconUsageMap>;
28
+ export declare function buildMaterialSymbolsCss(usages: IconUsageMap, fonts: Pick<GeneratedFontAsset, "family" | "fileName">[], devMode?: boolean, fontDisplay?: RsIconFontDisplay): string;
29
+ export declare function buildMaterialSymbolsHtmlTags(assets: MaterialSymbolsLinkAssets, options?: Pick<RobosophyMaterialSymbolsOptions, "preload">): HtmlTagDescriptor[];
30
+ export declare function injectMaterialSymbolsHtmlLinks(html: string, assets: MaterialSymbolsLinkAssets, options?: Pick<RobosophyMaterialSymbolsOptions, "preload">): string;
31
+ export declare function formatDetectedMaterialSymbols(usages: IconUsageMap): string;
32
+ export {};
33
+ //# sourceMappingURL=vite.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAA4B,MAAM,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAEhG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,KAAK,SAAS,GAAG,MAAM,GAAG;IAAE,MAAM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AAM,GAC7D,iBAAiB,EAAE,CA6BrB;AAED,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,yBAAyB,EACjC,OAAO,GAAE,IAAI,CAAC,+BAA+B,EAAE,SAAS,CAAM,UAS/D;AAiKD,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,YAAY,UAIjE"}
package/dist/vite.js ADDED
@@ -0,0 +1,300 @@
1
+ import { createHash as M } from "node:crypto";
2
+ import { readFile as w, readdir as x } from "node:fs/promises";
3
+ import { join as g, extname as _, sep as H } from "node:path";
4
+ import { createRequire as N } from "node:module";
5
+ const m = ["outlined", "rounded", "sharp"], f = "outlined", P = /^[a-z0-9_]+$/, k = /* @__PURE__ */ new Set([".js", ".jsx", ".mjs", ".ts", ".tsx", ".vue"]), z = /* @__PURE__ */ new Set([".git", "dist", "node_modules", "storybook-static"]), I = [
6
+ "arrow_drop_down",
7
+ "arrow_drop_up",
8
+ "arrow_left",
9
+ "chevron_right",
10
+ "close",
11
+ "login",
12
+ "nest_eco_leaf"
13
+ ], d = {
14
+ outlined: "Material Symbols Outlined Variable",
15
+ rounded: "Material Symbols Rounded Variable",
16
+ sharp: "Material Symbols Sharp Variable"
17
+ }, T = {
18
+ outlined: "@fontsource-variable/material-symbols-outlined",
19
+ rounded: "@fontsource-variable/material-symbols-rounded",
20
+ sharp: "@fontsource-variable/material-symbols-sharp"
21
+ }, D = {
22
+ outlined: "wght",
23
+ rounded: "full",
24
+ sharp: "full"
25
+ }, $ = "block", R = !0, A = N(import.meta.url);
26
+ function Z(t = {}) {
27
+ let e;
28
+ return {
29
+ name: "robosophy-material-symbols",
30
+ async configResolved(o) {
31
+ e = o;
32
+ },
33
+ async transformIndexHtml() {
34
+ const o = await h(e, t);
35
+ return v(o, t);
36
+ },
37
+ configureServer(o) {
38
+ o.middlewares.use(async (s, n, a) => {
39
+ if (!s.url?.startsWith("/@robosophy-material-symbols/")) {
40
+ a();
41
+ return;
42
+ }
43
+ try {
44
+ const r = await h(e, t), i = decodeURIComponent(
45
+ s.url.replace("/@robosophy-material-symbols/", "").split("?")[0] ?? ""
46
+ );
47
+ if (i === "rs-material-symbols.css") {
48
+ n.setHeader("Content-Type", "text/css; charset=utf-8"), n.end(r.css);
49
+ return;
50
+ }
51
+ const c = r.fonts.find((l) => l.fileName === i);
52
+ if (c) {
53
+ n.setHeader("Content-Type", "font/woff2"), n.end(c.source);
54
+ return;
55
+ }
56
+ a();
57
+ } catch (r) {
58
+ a(r);
59
+ }
60
+ });
61
+ },
62
+ async generateBundle(o, s) {
63
+ const n = await h(e, t);
64
+ for (const a of n.fonts)
65
+ this.emitFile({
66
+ fileName: `assets/${a.fileName}`,
67
+ name: a.fileName,
68
+ source: a.source,
69
+ type: "asset"
70
+ });
71
+ this.emitFile({
72
+ fileName: "assets/rs-material-symbols.css",
73
+ name: "rs-material-symbols.css",
74
+ source: n.css,
75
+ type: "asset"
76
+ });
77
+ for (const a of Object.values(s))
78
+ a.type === "asset" && a.fileName.endsWith(".html") && (a.source = U(String(a.source), n, t));
79
+ }
80
+ };
81
+ }
82
+ async function h(t, e) {
83
+ const o = await C(t, e), s = t.command === "serve", n = await V(o, s, t.base);
84
+ return {
85
+ css: L(
86
+ o,
87
+ n,
88
+ s,
89
+ e.fontDisplay ?? $
90
+ ),
91
+ cssHref: s ? "/@robosophy-material-symbols/rs-material-symbols.css" : F(t.base, "assets/rs-material-symbols.css"),
92
+ fonts: n
93
+ };
94
+ }
95
+ async function C(t, e = {}) {
96
+ const o = J();
97
+ for (const s of I)
98
+ u(o, { family: f, name: s });
99
+ for (const s of e.include ?? [])
100
+ u(o, typeof s == "string" ? { family: f, name: s } : s);
101
+ if (e.scan !== !1) {
102
+ const s = e.roots ?? [g(t.root, "src")];
103
+ for (const n of s)
104
+ for (const a of await j(n)) {
105
+ const r = await w(a, "utf8");
106
+ q(r, o);
107
+ }
108
+ }
109
+ return o;
110
+ }
111
+ function L(t, e, o = !1, s = $) {
112
+ const n = [];
113
+ for (const r of e) {
114
+ const i = o ? `/@robosophy-material-symbols/${r.fileName}` : `./${r.fileName}`;
115
+ n.push(
116
+ "@font-face {",
117
+ ` font-family: "${d[r.family]}";`,
118
+ ` font-display: ${s};`,
119
+ " font-style: normal;",
120
+ " font-weight: 100 700;",
121
+ ` src: url("${i}") format("woff2-variations");`,
122
+ "}"
123
+ );
124
+ }
125
+ n.push(
126
+ ".rs-icon {",
127
+ " --rs-icon-color: currentColor;",
128
+ " --rs-icon-fill: 0;",
129
+ " --rs-icon-grade: 0;",
130
+ " --rs-icon-optical-size: 24;",
131
+ " --rs-icon-size: 24px;",
132
+ " --rs-icon-weight: 400;",
133
+ " align-items: center;",
134
+ " color: var(--rs-icon-color);",
135
+ " display: inline-flex;",
136
+ " flex: 0 0 auto;",
137
+ ` font-family: "${d.outlined}";`,
138
+ " font-size: var(--rs-icon-size);",
139
+ " font-style: normal;",
140
+ ' font-variation-settings: "FILL" var(--rs-icon-fill), "wght" var(--rs-icon-weight), "GRAD" var(--rs-icon-grade), "opsz" var(--rs-icon-optical-size);',
141
+ " font-weight: 400;",
142
+ " justify-content: center;",
143
+ " letter-spacing: normal;",
144
+ " line-height: 1;",
145
+ " text-transform: none;",
146
+ " user-select: none;",
147
+ " white-space: nowrap;",
148
+ " word-wrap: normal;",
149
+ "}",
150
+ `.rs-icon--rounded { font-family: "${d.rounded}"; }`,
151
+ `.rs-icon--sharp { font-family: "${d.sharp}"; }`,
152
+ ".rs-icon--prime::before { content: var(--rs-icon-content); }"
153
+ );
154
+ const a = /* @__PURE__ */ new Set();
155
+ for (const r of m)
156
+ for (const i of t.get(r) ?? [])
157
+ a.add(i);
158
+ for (const r of [...a].sort())
159
+ n.push(`.rs-icon-${r} { --rs-icon-content: "${r}"; }`);
160
+ return `${n.join(`
161
+ `)}
162
+ `;
163
+ }
164
+ function v(t, e = {}) {
165
+ const o = [];
166
+ if (e.preload ?? R)
167
+ for (const s of t.fonts)
168
+ o.push({
169
+ attrs: {
170
+ as: "font",
171
+ crossorigin: "",
172
+ href: s.href,
173
+ rel: "preload",
174
+ type: "font/woff2"
175
+ },
176
+ tag: "link",
177
+ injectTo: "head"
178
+ });
179
+ return o.push({
180
+ attrs: {
181
+ href: t.cssHref,
182
+ rel: "stylesheet"
183
+ },
184
+ tag: "link",
185
+ injectTo: "head"
186
+ }), o;
187
+ }
188
+ function U(t, e, o = {}) {
189
+ const s = v(e, o).map(W).filter((n) => !t.includes(`href="${G(n)}"`));
190
+ return s.length === 0 ? t : t.replace("</head>", `${s.map((n) => ` ${n}`).join(`
191
+ `)}
192
+ </head>`);
193
+ }
194
+ async function V(t, e, o) {
195
+ const s = (await import("subset-font")).default, n = [];
196
+ for (const a of m) {
197
+ const r = [...t.get(a) ?? []].sort();
198
+ if (r.length === 0)
199
+ continue;
200
+ const i = B(a), c = await w(i), l = await s(c, r.join(" "), {
201
+ targetFormat: "woff2"
202
+ }), y = M("sha256").update(l).digest("hex").slice(0, 8), p = `rs-material-symbols-${a}-${y}.woff2`;
203
+ n.push({
204
+ family: a,
205
+ fileName: p,
206
+ href: O(p, e, o),
207
+ source: l
208
+ });
209
+ }
210
+ return n;
211
+ }
212
+ function B(t) {
213
+ return A.resolve(
214
+ `${T[t]}/files/material-symbols-${t}-latin-${D[t]}-normal.woff2`
215
+ );
216
+ }
217
+ function O(t, e, o) {
218
+ return e ? `/@robosophy-material-symbols/${t}` : F(o, `assets/${t}`);
219
+ }
220
+ function W(t) {
221
+ const e = Object.entries(t.attrs ?? {}).map(([o, s]) => s === "" ? o : `${o}="${s}"`).join(" ");
222
+ return `<${t.tag}${e ? ` ${e}` : ""}>`;
223
+ }
224
+ function G(t) {
225
+ return t.match(/\bhref="([^"]+)"/)?.[1] ?? "";
226
+ }
227
+ function q(t, e) {
228
+ const o = /<RsIcon\b([^>]*)>/g;
229
+ let s;
230
+ for (; s = o.exec(t); ) {
231
+ const c = E(s[1] ?? ""), l = c.name ?? c[":name"], y = b(c.family ?? c[":family"]);
232
+ l && u(e, { family: y ?? f, name: S(l) });
233
+ }
234
+ const n = /\brsPrimeIcon\(\s*["']([a-z0-9_]+)["'](?:\s*,\s*\{([^)]*)\})?/g;
235
+ let a;
236
+ for (; a = n.exec(t); ) {
237
+ const c = b(a[2]?.match(/\bfamily\s*:\s*["'](\w+)["']/)?.[1]);
238
+ u(e, {
239
+ family: c ?? f,
240
+ name: a[1] ?? ""
241
+ });
242
+ }
243
+ const r = /\bicon\s*:\s*["']([a-z0-9_]+)["']/g;
244
+ let i;
245
+ for (; i = r.exec(t); )
246
+ u(e, {
247
+ family: f,
248
+ name: i[1] ?? ""
249
+ });
250
+ }
251
+ function E(t) {
252
+ const e = {}, o = /([:@\w-]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g;
253
+ let s;
254
+ for (; s = o.exec(t); )
255
+ e[s[1] ?? ""] = s[2] ?? s[3] ?? "";
256
+ return e;
257
+ }
258
+ function S(t) {
259
+ return t.replace(/^['"](.+)['"]$/, "$1");
260
+ }
261
+ function u(t, e) {
262
+ const o = e.family ?? f, s = e.name.trim();
263
+ !m.includes(o) || !P.test(s) || t.get(o)?.add(s);
264
+ }
265
+ function b(t) {
266
+ const e = t ? S(t) : "";
267
+ return m.includes(e) ? e : void 0;
268
+ }
269
+ function J() {
270
+ return new Map(m.map((t) => [t, /* @__PURE__ */ new Set()]));
271
+ }
272
+ async function j(t) {
273
+ try {
274
+ const e = await x(t, { withFileTypes: !0 });
275
+ return (await Promise.all(
276
+ e.map(async (s) => {
277
+ const n = g(t, s.name);
278
+ return s.isDirectory() ? z.has(s.name) ? [] : j(n) : k.has(_(s.name)) ? [n] : [];
279
+ })
280
+ )).flat();
281
+ } catch {
282
+ return [];
283
+ }
284
+ }
285
+ function F(t, e) {
286
+ return `${t.endsWith("/") ? t : `${t}/`}${e}`.replaceAll(`${H}`, "/");
287
+ }
288
+ function tt(t) {
289
+ return m.map((e) => `${e}: ${[...t.get(e) ?? []].sort().join(", ")}`).join(`
290
+ `);
291
+ }
292
+ export {
293
+ L as buildMaterialSymbolsCss,
294
+ v as buildMaterialSymbolsHtmlTags,
295
+ C as collectMaterialSymbolUsages,
296
+ tt as formatDetectedMaterialSymbols,
297
+ U as injectMaterialSymbolsHtmlLinks,
298
+ Z as robosophyMaterialSymbols
299
+ };
300
+ //# sourceMappingURL=vite.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vite.js","sources":["../src/vite.ts"],"sourcesContent":["import { createHash } from \"node:crypto\";\nimport { readdir, readFile } from \"node:fs/promises\";\nimport { extname, join, sep } from \"node:path\";\nimport { createRequire } from \"node:module\";\nimport type { HtmlTagDescriptor, IndexHtmlTransformResult, Plugin, ResolvedConfig } from \"vite\";\n\nimport type { RsIconFamily } from \"./components/RsIcon\";\n\ntype IconInput = string | { family?: RsIconFamily; name: string };\nexport type RsIconFontDisplay = \"block\" | \"swap\" | \"fallback\" | \"optional\";\n\nexport type RobosophyMaterialSymbolsOptions = {\n fontDisplay?: RsIconFontDisplay;\n include?: IconInput[];\n preload?: boolean;\n roots?: string[];\n scan?: boolean;\n};\n\ntype IconUsageMap = Map<RsIconFamily, Set<string>>;\ntype MaterialSymbolsLinkAssets = {\n cssHref: string;\n fonts: Pick<GeneratedFontAsset, \"href\">[];\n};\n\nconst families = [\"outlined\", \"rounded\", \"sharp\"] as const satisfies readonly RsIconFamily[];\nconst defaultFamily: RsIconFamily = \"outlined\";\nconst iconNamePattern = /^[a-z0-9_]+$/;\nconst sourceExtensions = new Set([\".js\", \".jsx\", \".mjs\", \".ts\", \".tsx\", \".vue\"]);\nconst skippedDirs = new Set([\".git\", \"dist\", \"node_modules\", \"storybook-static\"]);\nconst internalIconNames = [\n \"arrow_drop_down\",\n \"arrow_drop_up\",\n \"arrow_left\",\n \"chevron_right\",\n \"close\",\n \"login\",\n \"nest_eco_leaf\",\n];\n\nconst familyFontNames: Record<RsIconFamily, string> = {\n outlined: \"Material Symbols Outlined Variable\",\n rounded: \"Material Symbols Rounded Variable\",\n sharp: \"Material Symbols Sharp Variable\",\n};\n\nconst familyPackages: Record<RsIconFamily, string> = {\n outlined: \"@fontsource-variable/material-symbols-outlined\",\n rounded: \"@fontsource-variable/material-symbols-rounded\",\n sharp: \"@fontsource-variable/material-symbols-sharp\",\n};\n\nconst familyFontVariants: Record<RsIconFamily, string> = {\n outlined: \"wght\",\n rounded: \"full\",\n sharp: \"full\",\n};\n\nconst defaultFontDisplay: RsIconFontDisplay = \"block\";\nconst defaultPreload = true;\nconst require = createRequire(import.meta.url);\n\nexport function robosophyMaterialSymbols(\n options: RobosophyMaterialSymbolsOptions = {},\n): Plugin {\n let config: ResolvedConfig;\n return {\n name: \"robosophy-material-symbols\",\n async configResolved(resolvedConfig) {\n config = resolvedConfig;\n },\n async transformIndexHtml(): Promise<IndexHtmlTransformResult> {\n const assets = await ensureGeneratedAssets(config, options);\n\n return buildMaterialSymbolsHtmlTags(assets, options);\n },\n configureServer(server) {\n server.middlewares.use(async (request, response, next) => {\n if (!request.url?.startsWith(\"/@robosophy-material-symbols/\")) {\n next();\n return;\n }\n\n try {\n const assets = await ensureGeneratedAssets(config, options);\n const fileName = decodeURIComponent(\n request.url.replace(\"/@robosophy-material-symbols/\", \"\").split(\"?\")[0] ?? \"\",\n );\n\n if (fileName === \"rs-material-symbols.css\") {\n response.setHeader(\"Content-Type\", \"text/css; charset=utf-8\");\n response.end(assets.css);\n return;\n }\n\n const font = assets.fonts.find((asset) => asset.fileName === fileName);\n\n if (font) {\n response.setHeader(\"Content-Type\", \"font/woff2\");\n response.end(font.source);\n return;\n }\n\n next();\n } catch (error) {\n next(error);\n }\n });\n },\n async generateBundle(_outputOptions, bundle) {\n const assets = await ensureGeneratedAssets(config, options);\n\n for (const font of assets.fonts) {\n this.emitFile({\n fileName: `assets/${font.fileName}`,\n name: font.fileName,\n source: font.source,\n type: \"asset\",\n });\n }\n\n this.emitFile({\n fileName: \"assets/rs-material-symbols.css\",\n name: \"rs-material-symbols.css\",\n source: assets.css,\n type: \"asset\",\n });\n\n for (const asset of Object.values(bundle)) {\n if (asset.type === \"asset\" && asset.fileName.endsWith(\".html\")) {\n asset.source = injectMaterialSymbolsHtmlLinks(String(asset.source), assets, options);\n }\n }\n },\n };\n}\n\ntype GeneratedFontAsset = {\n family: RsIconFamily;\n fileName: string;\n href: string;\n source: Buffer;\n};\n\ntype GeneratedMaterialSymbolsAssets = {\n css: string;\n cssHref: string;\n fonts: GeneratedFontAsset[];\n};\n\nasync function ensureGeneratedAssets(\n config: ResolvedConfig,\n options: RobosophyMaterialSymbolsOptions,\n) {\n const usages = await collectMaterialSymbolUsages(config, options);\n const devMode = config.command === \"serve\";\n const fonts = await generateFontAssets(usages, devMode, config.base);\n const css = buildMaterialSymbolsCss(\n usages,\n fonts,\n devMode,\n options.fontDisplay ?? defaultFontDisplay,\n );\n\n return {\n css,\n cssHref: devMode\n ? \"/@robosophy-material-symbols/rs-material-symbols.css\"\n : withBase(config.base, \"assets/rs-material-symbols.css\"),\n fonts,\n };\n}\n\nexport async function collectMaterialSymbolUsages(\n config: Pick<ResolvedConfig, \"root\">,\n options: RobosophyMaterialSymbolsOptions = {},\n) {\n const usages = createUsageMap();\n\n for (const name of internalIconNames) {\n addUsage(usages, { family: defaultFamily, name });\n }\n\n for (const icon of options.include ?? []) {\n addUsage(usages, typeof icon === \"string\" ? { family: defaultFamily, name: icon } : icon);\n }\n\n if (options.scan !== false) {\n const roots = options.roots ?? [join(config.root, \"src\")];\n\n for (const root of roots) {\n for (const filePath of await listSourceFiles(root)) {\n const source = await readFile(filePath, \"utf8\");\n collectFromSource(source, usages);\n }\n }\n }\n\n return usages;\n}\n\nexport function buildMaterialSymbolsCss(\n usages: IconUsageMap,\n fonts: Pick<GeneratedFontAsset, \"family\" | \"fileName\">[],\n devMode = false,\n fontDisplay: RsIconFontDisplay = defaultFontDisplay,\n) {\n const lines: string[] = [];\n\n for (const font of fonts) {\n const fontUrl = devMode\n ? `/@robosophy-material-symbols/${font.fileName}`\n : `./${font.fileName}`;\n\n lines.push(\n \"@font-face {\",\n ` font-family: \"${familyFontNames[font.family]}\";`,\n ` font-display: ${fontDisplay};`,\n \" font-style: normal;\",\n \" font-weight: 100 700;\",\n ` src: url(\"${fontUrl}\") format(\"woff2-variations\");`,\n \"}\",\n );\n }\n\n lines.push(\n \".rs-icon {\",\n \" --rs-icon-color: currentColor;\",\n \" --rs-icon-fill: 0;\",\n \" --rs-icon-grade: 0;\",\n \" --rs-icon-optical-size: 24;\",\n \" --rs-icon-size: 24px;\",\n \" --rs-icon-weight: 400;\",\n \" align-items: center;\",\n \" color: var(--rs-icon-color);\",\n \" display: inline-flex;\",\n \" flex: 0 0 auto;\",\n ` font-family: \"${familyFontNames.outlined}\";`,\n \" font-size: var(--rs-icon-size);\",\n \" font-style: normal;\",\n ' font-variation-settings: \"FILL\" var(--rs-icon-fill), \"wght\" var(--rs-icon-weight), \"GRAD\" var(--rs-icon-grade), \"opsz\" var(--rs-icon-optical-size);',\n \" font-weight: 400;\",\n \" justify-content: center;\",\n \" letter-spacing: normal;\",\n \" line-height: 1;\",\n \" text-transform: none;\",\n \" user-select: none;\",\n \" white-space: nowrap;\",\n \" word-wrap: normal;\",\n \"}\",\n `.rs-icon--rounded { font-family: \"${familyFontNames.rounded}\"; }`,\n `.rs-icon--sharp { font-family: \"${familyFontNames.sharp}\"; }`,\n \".rs-icon--prime::before { content: var(--rs-icon-content); }\",\n );\n\n const names = new Set<string>();\n\n for (const family of families) {\n for (const name of usages.get(family) ?? []) {\n names.add(name);\n }\n }\n\n for (const name of [...names].sort()) {\n lines.push(`.rs-icon-${name} { --rs-icon-content: \"${name}\"; }`);\n }\n\n return `${lines.join(\"\\n\")}\\n`;\n}\n\nexport function buildMaterialSymbolsHtmlTags(\n assets: MaterialSymbolsLinkAssets,\n options: Pick<RobosophyMaterialSymbolsOptions, \"preload\"> = {},\n): HtmlTagDescriptor[] {\n const tags: HtmlTagDescriptor[] = [];\n\n if (options.preload ?? defaultPreload) {\n for (const font of assets.fonts) {\n tags.push({\n attrs: {\n as: \"font\",\n crossorigin: \"\",\n href: font.href,\n rel: \"preload\",\n type: \"font/woff2\",\n },\n tag: \"link\",\n injectTo: \"head\",\n });\n }\n }\n\n tags.push({\n attrs: {\n href: assets.cssHref,\n rel: \"stylesheet\",\n },\n tag: \"link\",\n injectTo: \"head\",\n });\n\n return tags;\n}\n\nexport function injectMaterialSymbolsHtmlLinks(\n html: string,\n assets: MaterialSymbolsLinkAssets,\n options: Pick<RobosophyMaterialSymbolsOptions, \"preload\"> = {},\n) {\n const links = buildMaterialSymbolsHtmlTags(assets, options)\n .map(formatHtmlLinkTag)\n .filter((link) => !html.includes(`href=\"${getLinkHref(link)}\"`));\n\n return links.length === 0\n ? html\n : html.replace(\"</head>\", `${links.map((link) => ` ${link}`).join(\"\\n\")}\\n</head>`);\n}\n\nasync function generateFontAssets(\n usages: IconUsageMap,\n devMode: boolean,\n base: string,\n): Promise<GeneratedFontAsset[]> {\n const subsetFont = (await import(\"subset-font\")).default;\n const fonts: GeneratedFontAsset[] = [];\n\n for (const family of families) {\n const names = [...(usages.get(family) ?? [])].sort();\n\n if (names.length === 0) {\n continue;\n }\n\n const sourcePath = resolveFontPath(family);\n const source = await readFile(sourcePath);\n const subset = await subsetFont(source, names.join(\" \"), {\n targetFormat: \"woff2\",\n });\n const hash = createHash(\"sha256\").update(subset).digest(\"hex\").slice(0, 8);\n const fileName = `rs-material-symbols-${family}-${hash}.woff2`;\n\n fonts.push({\n family,\n fileName,\n href: fontHref(fileName, devMode, base),\n source: subset,\n });\n }\n\n return fonts;\n}\n\nfunction resolveFontPath(family: RsIconFamily) {\n return require.resolve(\n `${familyPackages[family]}/files/material-symbols-${family}-latin-${familyFontVariants[family]}-normal.woff2`,\n );\n}\n\nfunction fontHref(fileName: string, devMode: boolean, base: string) {\n return devMode\n ? `/@robosophy-material-symbols/${fileName}`\n : withBase(base, `assets/${fileName}`);\n}\n\nfunction formatHtmlLinkTag(tag: HtmlTagDescriptor) {\n const attrs = Object.entries(tag.attrs ?? {})\n .map(([name, value]) => (value === \"\" ? name : `${name}=\"${value}\"`))\n .join(\" \");\n\n return `<${tag.tag}${attrs ? ` ${attrs}` : \"\"}>`;\n}\n\nfunction getLinkHref(link: string) {\n return link.match(/\\bhref=\"([^\"]+)\"/)?.[1] ?? \"\";\n}\n\nfunction collectFromSource(source: string, usages: IconUsageMap) {\n const rsIconTagPattern = /<RsIcon\\b([^>]*)>/g;\n let tagMatch: RegExpExecArray | null;\n\n while ((tagMatch = rsIconTagPattern.exec(source))) {\n const attrs = parseStaticAttributes(tagMatch[1] ?? \"\");\n const name = attrs.name ?? attrs[\":name\"];\n const family = toFamily(attrs.family ?? attrs[\":family\"]);\n\n if (name) {\n addUsage(usages, { family: family ?? defaultFamily, name: unwrapStaticValue(name) });\n }\n }\n\n const primeHelperPattern =\n /\\brsPrimeIcon\\(\\s*[\"']([a-z0-9_]+)[\"'](?:\\s*,\\s*\\{([^)]*)\\})?/g;\n let helperMatch: RegExpExecArray | null;\n\n while ((helperMatch = primeHelperPattern.exec(source))) {\n const family = toFamily(helperMatch[2]?.match(/\\bfamily\\s*:\\s*[\"'](\\w+)[\"']/)?.[1]);\n addUsage(usages, {\n family: family ?? defaultFamily,\n name: helperMatch[1] ?? \"\",\n });\n }\n\n const objectIconPattern = /\\bicon\\s*:\\s*[\"']([a-z0-9_]+)[\"']/g;\n let objectMatch: RegExpExecArray | null;\n\n while ((objectMatch = objectIconPattern.exec(source))) {\n addUsage(usages, {\n family: defaultFamily,\n name: objectMatch[1] ?? \"\",\n });\n }\n}\n\nfunction parseStaticAttributes(source: string) {\n const attrs: Record<string, string> = {};\n const attrPattern = /([:@\\w-]+)\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)')/g;\n let match: RegExpExecArray | null;\n\n while ((match = attrPattern.exec(source))) {\n attrs[match[1] ?? \"\"] = match[2] ?? match[3] ?? \"\";\n }\n\n return attrs;\n}\n\nfunction unwrapStaticValue(value: string) {\n return value.replace(/^['\"](.+)['\"]$/, \"$1\");\n}\n\nfunction addUsage(usages: IconUsageMap, icon: { family?: RsIconFamily; name: string }) {\n const family = icon.family ?? defaultFamily;\n const name = icon.name.trim();\n\n if (!families.includes(family) || !iconNamePattern.test(name)) {\n return;\n }\n\n usages.get(family)?.add(name);\n}\n\nfunction toFamily(value?: string): RsIconFamily | undefined {\n const normalized = value ? unwrapStaticValue(value) : \"\";\n return families.includes(normalized as RsIconFamily)\n ? (normalized as RsIconFamily)\n : undefined;\n}\n\nfunction createUsageMap(): IconUsageMap {\n return new Map(families.map((family) => [family, new Set<string>()]));\n}\n\nasync function listSourceFiles(root: string): Promise<string[]> {\n try {\n const entries = await readdir(root, { withFileTypes: true });\n const files = await Promise.all(\n entries.map(async (entry) => {\n const path = join(root, entry.name);\n\n if (entry.isDirectory()) {\n return skippedDirs.has(entry.name) ? [] : listSourceFiles(path);\n }\n\n return sourceExtensions.has(extname(entry.name)) ? [path] : [];\n }),\n );\n\n return files.flat();\n } catch {\n return [];\n }\n}\n\nfunction withBase(base: string, path: string) {\n const cleanBase = base.endsWith(\"/\") ? base : `${base}/`;\n return `${cleanBase}${path}`.replaceAll(`${sep}`, \"/\");\n}\n\nexport function formatDetectedMaterialSymbols(usages: IconUsageMap) {\n return families\n .map((family) => `${family}: ${[...(usages.get(family) ?? [])].sort().join(\", \")}`)\n .join(\"\\n\");\n}\n"],"names":["families","defaultFamily","iconNamePattern","sourceExtensions","skippedDirs","internalIconNames","familyFontNames","familyPackages","familyFontVariants","defaultFontDisplay","defaultPreload","require","createRequire","robosophyMaterialSymbols","options","config","resolvedConfig","assets","ensureGeneratedAssets","buildMaterialSymbolsHtmlTags","server","request","response","next","fileName","font","asset","error","_outputOptions","bundle","injectMaterialSymbolsHtmlLinks","usages","collectMaterialSymbolUsages","devMode","fonts","generateFontAssets","buildMaterialSymbolsCss","withBase","createUsageMap","name","addUsage","icon","roots","join","root","filePath","listSourceFiles","source","readFile","collectFromSource","fontDisplay","lines","fontUrl","names","family","tags","html","links","formatHtmlLinkTag","link","getLinkHref","base","subsetFont","sourcePath","resolveFontPath","subset","hash","createHash","fontHref","tag","attrs","value","rsIconTagPattern","tagMatch","parseStaticAttributes","toFamily","unwrapStaticValue","primeHelperPattern","helperMatch","objectIconPattern","objectMatch","attrPattern","match","normalized","entries","readdir","entry","path","extname","sep","formatDetectedMaterialSymbols"],"mappings":";;;;AAyBA,MAAMA,IAAW,CAAC,YAAY,WAAW,OAAO,GAC1CC,IAA8B,YAC9BC,IAAkB,gBAClBC,IAAmB,oBAAI,IAAI,CAAC,OAAO,QAAQ,QAAQ,OAAO,QAAQ,MAAM,CAAC,GACzEC,wBAAkB,IAAI,CAAC,QAAQ,QAAQ,gBAAgB,kBAAkB,CAAC,GAC1EC,IAAoB;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAEMC,IAAgD;AAAA,EACpD,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AACT,GAEMC,IAA+C;AAAA,EACnD,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AACT,GAEMC,IAAmD;AAAA,EACvD,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AACT,GAEMC,IAAwC,SACxCC,IAAiB,IACjBC,IAAUC,EAAc,YAAY,GAAG;AAEtC,SAASC,EACdC,IAA2C,IACnC;AACR,MAAIC;AACJ,SAAO;AAAA,IACL,MAAM;AAAA,IACN,MAAM,eAAeC,GAAgB;AACnC,MAAAD,IAASC;AAAA,IACX;AAAA,IACA,MAAM,qBAAwD;AAC5D,YAAMC,IAAS,MAAMC,EAAsBH,GAAQD,CAAO;AAE1D,aAAOK,EAA6BF,GAAQH,CAAO;AAAA,IACrD;AAAA,IACA,gBAAgBM,GAAQ;AACtB,MAAAA,EAAO,YAAY,IAAI,OAAOC,GAASC,GAAUC,MAAS;AACxD,YAAI,CAACF,EAAQ,KAAK,WAAW,+BAA+B,GAAG;AAC7D,U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