@feedmepos/mf-miniprogram-v2 0.2.9-dev.8 → 0.2.9

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 (26) hide show
  1. package/dist/{App-DvS0M-h7.js → App-DDgjAONU.js} +3 -3
  2. package/dist/{BrandFontPicker-D8OXBoHt.js → BrandFontPicker-BVfiQBLP.js} +1 -1
  3. package/dist/BrandKitView-BLH-bglF.js +329 -0
  4. package/dist/{ControlPlaneView-CgALjn7t.js → ControlPlaneView-B852gLmR.js} +9058 -8599
  5. package/dist/{EcosystemView-BMleE1Oz.js → EcosystemView-BY2B_LEL.js} +5 -5
  6. package/dist/{LegacyWorkspaceEntry-DBIDEJNj.js → LegacyWorkspaceEntry-DrL-C0xx.js} +1 -1
  7. package/dist/{MobileProjectDialog-B3fhhssO.js → MobileProjectDialog-DsXmMUHH.js} +2 -2
  8. package/dist/{MobileProjectsView-BQ3f5seS.js → MobileProjectsView-CMj0mnZh.js} +4 -4
  9. package/dist/{ModuleCenterView-_yy5EJVi.js → ModuleCenterView-DG7ea0p5.js} +1 -1
  10. package/dist/{ModuleDetailView-oe44R9vG.js → ModuleDetailView-DweKadjB.js} +1 -1
  11. package/dist/{PagesView-CRJ9PifL.js → PagesView-W8d-G5HZ.js} +1 -1
  12. package/dist/{PortalSettingsView-CP87BEmb.js → PortalSettingsView-DFsXYy48.js} +10 -10
  13. package/dist/{TemplateCenterView-Kl3rlE4I.js → TemplateCenterView-BH3C5h50.js} +2 -2
  14. package/dist/{WorkspaceEntryView-hi6v5jO2.js → WorkspaceEntryView-Dx8stquZ.js} +1 -1
  15. package/dist/app.js +11 -11
  16. package/dist/{controlPlane-D17RrVO0.js → controlPlane-CiuLVd7s.js} +19 -18
  17. package/dist/{localPreference-cX7JCvEc.js → localPreference-Cdti49bE.js} +2 -2
  18. package/dist/package.json +1 -1
  19. package/dist/{portalContext-BWcPaz4H.js → portalContext-CCW6O5KF.js} +2 -2
  20. package/dist/{routes-D17DkfPa.js → routes-W8KfuhWL.js} +12 -2
  21. package/dist/style.css +1 -1
  22. package/dist/useBrandKit-fmzepsFY.js +1096 -0
  23. package/dist/{useModuleCatalog-D_F-vVPX.js → useModuleCatalog-C7kO_Rjg.js} +2 -2
  24. package/package.json +1 -1
  25. package/dist/BrandKitView-lDQ2s5BD.js +0 -276
  26. package/dist/useBrandKit-C8qxHPWH.js +0 -1048
@@ -5,9 +5,9 @@ import { readonly as ee, ref as V, watch as we, defineComponent as Te, computed
5
5
  import { useCoreStore as oe } from "@feedmepos/mf-common";
6
6
  import { useRoute as Re, useRouter as Ke, RouterView as Ue } from "vue-router";
7
7
  import { P as St } from "./PortalIcon-DO0VrIoY.js";
8
- import { r as Ce, u as Me, w as _e } from "./localPreference-cX7JCvEc.js";
8
+ import { r as Ce, u as Me, w as _e } from "./localPreference-Cdti49bE.js";
9
9
  import { c as Ot } from "./_commonjsHelpers-DaMA6jEr.js";
10
- import { p as De } from "./portalContext-BWcPaz4H.js";
10
+ import { p as De } from "./portalContext-CCW6O5KF.js";
11
11
  import { e as Ge, p as dt } from "./portalNavigation-DLcC7Koh.js";
12
12
  import { _ as Be } from "./_plugin-vue_export-helper-CHgC5LLL.js";
13
13
  var re = { exports: {} };
@@ -944,7 +944,7 @@ const tn = {
944
944
  }
945
945
  }
946
946
  }), Xe(v.namespace.value);
947
- const I = Ze("fmmf:dev"), w = st(() => l.name === "miniprogram-v2-project"), W = st(() => ({
947
+ const I = Ze("fmmf:prod"), w = st(() => l.name === "miniprogram-v2-project"), W = st(() => ({
948
948
  ...dt(l.query),
949
949
  ...w.value ? { returnProjectId: String(l.params.projectId) } : {}
950
950
  })), E = st(() => I.loading.value || I.enabled.value), g = V(
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as te, ref as n, computed as F, watch as G, resolveComponent as I, openBlock as s, createElementBlock as u, withKeys as L, withModifiers as N, createElementVNode as a, toDisplayString as k, createVNode as P, withCtx as J, normalizeStyle as E, withDirectives as K, vModelText as q, Fragment as S, renderList as oe, createCommentVNode as v, unref as T, createBlock as ae, createTextVNode as W, nextTick as le } from "vue";
2
- import { G as V, f as ne, b as p, l as se } from "./useBrandKit-C8qxHPWH.js";
2
+ import { G as V, f as ne, b as p, l as se } from "./useBrandKit-fmzepsFY.js";
3
3
  import { _ as re } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
4
  const xe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAACXBIWXMAACE4AAAhOAFFljFgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAADbZJREFUeAHtW2lsXNUV/t4yi5cZO4mdxUlsEmiBkI2dCkJBAloQSEBaCUoKkahUCYLUqjRFbVVVqlS6qAKVlqpIVBRRlqjwg1KKQNCUJIWELEBQQkgIcZzEThzimfF4PDNv63fufTNeMuN4TSXgSMd3ljfvve9+55577nefjVwuH+BzZCY+Z/YF4M+62fg/W8YB+sRdwA9MOlkwNRNR/qmxAzpQb09OqjntgD9KA139wMcZIOWYsAwoQFHTQJxtjK1NoDY/l9Y0TDoQ4ev6SIDmuIeWuI/x2mkBvI8gt3YDrx8W9gzURYBaeh2vXhOBYlUsCF3MMIaew+EXJxwDx10b+zmxLCDwueMAPqWANx/28fhOYE/GQH0tGYobSEQBj98FgW7FqgaroT0IW1+cL3KegfdzJjodD8vqXUQMjNqmBPDGAx4efsvDu8fIYJ2JRI0Jh+PUtegci55varBEGghJlv6dSTAhttCMcmeU2Bfw8lsOeXQULaTSBr7a4Iwa9KQCTvf7WPtCP9bt9BGLW4jXGfB4haIV0A1E4yaWTzcxr54hmYQK7Xp+L+PYMAImMAMFTxKYgbQzAD0I2RXAJbB+GCHdrol/pyO4rtEZ1T1OGuD3DhRx26MZdGR8WBygLkE6BQuxOuA7SyK4dL6F82cNp2FoMM+uGXjvEuWxvI+uvIUTrmba48AWkBIUxUCPa5d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m0iK+3r9hCvtfXTeOETeRHV6if0IuFn9y8P8OWGsW/zjOkJgPZPfax+NIO1dzZRzzO5Me3jghkuaocVWn/+wMTvtptqe0SAmGYJvL5Z6QQBbw0CZYcdY4efR8Lv5GGYaNhZUYJOcET9+EIf8+swLhvzIw+yBl37dBarVzarxw1k3J7LCufsYb3dQdXzZ1sMvMqtEXMQu6oDwvdWGZTuAHsQYAFaCmErbM9kKfnDZQGa4hi3jesZD1EaNrVzuqqJK/0r62gWL2vycGHT0GPX7TPwl90s7HuMMmB7MOMlwIPBlsCHHSOV1s0LWBcsMlE7QaFlQk/xrN9dxKFYjdqhyBJ4pqCzZyvXpMubNBMzKf61MPw2c9X10I4AW7k5Z0eMISxbg1gvhbh0gMOTdu/txV0E+sDKJCbDJvyc1tGMjz39NmtahnGfgNaPR2SLIiIEXHHJQydSk/vI81JSE8s4iMjTAkQYjZJxojNlqqE+HLAwzlN16D1SUELEY/c14crFE4jhYTbhdd2spEn3saQR2M2l5LqPuZwkQC8wyk/1SBr25dFRJiZ5REKWe/mszxq5qMtF0ZPyvtaVnCIaGAH335TEmhuTVfeIxmvGVPxXyycsgTd0GnibYbypU0R04inIlgmUPCMSqyzzfF7aZysrnwZm/JsWWVh1eQxXLpr8rdiSGafj33h2M2F1ZAK1PdOTF52K7HJXUuZgFlJYOsdA6/TJZbKaGV/839Jn3L4A/Fm3/wGRTH3CBVOXMAAAAABJRU5ErkJggg==", ue = ["onKeydown"], ie = { class: "font-picker__label" }, de = ["disabled", "aria-label", "aria-expanded"], ce = ["onKeydown", "aria-label"], ve = {
5
5
  key: 0,
@@ -0,0 +1,329 @@
1
+ import { defineComponent as J, ref as M, computed as q, onMounted as E, onScopeDispose as T, resolveComponent as k, openBlock as r, createElementBlock as l, createElementVNode as t, createTextVNode as v, createBlock as _, Teleport as Q, unref as a, toDisplayString as m, createCommentVNode as u, createVNode as b, withCtx as B, normalizeStyle as C, normalizeClass as X, Fragment as y, renderList as w, withDirectives as R, vModelText as P, watch as W } from "vue";
2
+ import { _ as ee, B as te } from "./BrandFontPicker-BVfiQBLP.js";
3
+ import { useRouter as ae, onBeforeRouteLeave as se } from "vue-router";
4
+ import { useDialog as oe, useSnackbar as ne } from "@feedmepos/ui-library";
5
+ import { a as re, C as N, t as $, F as le, u as ie, i as de } from "./useBrandKit-fmzepsFY.js";
6
+ import { detectLocale as ue } from "@feedmepos/mf-common";
7
+ import { _ as pe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
+ const U = "data:image/svg+xml,%3csvg%20preserveAspectRatio='none'%20overflow='visible'%20style='display:%20block;'%20width='14.9999'%20height='13.75'%20viewBox='0%200%2014.9999%2013.75'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group%201197147821'%3e%3cpath%20id='Ellipse%201329'%20d='M12.5%206.875C12.5%203.42322%209.84169%200.625%206.5625%200.625C3.28331%200.625%200.625%203.42322%200.625%206.875C0.625%2010.3268%203.28331%2013.125%206.5625%2013.125'%20stroke='%23B2B3B6'%20stroke-width='1.25'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cg%20id='Group%201197147762'%3e%3cpath%20id='Line%20297'%20d='M10.4952%206.53566C10.2511%206.2916%2010.2511%205.89592%2010.4953%205.65189C10.7394%205.40785%2011.1352%205.40787%2011.3793%205.65193L10.9372%206.0938L10.4952%206.53566ZM13.0982%207.37064C13.3423%207.6147%2013.3423%208.01038%2013.0982%208.25441C12.854%208.49845%2012.4583%208.49843%2012.2142%208.25437L12.6562%207.8125L13.0982%207.37064ZM10.9372%206.0938L11.3793%205.65193L13.0982%207.37064L12.6562%207.8125L12.2142%208.25437L10.4952%206.53566L10.9372%206.0938Z'%20fill='%23B2B3B6'/%3e%3cpath%20id='Line%20298'%20d='M13.0982%208.25433C12.8542%208.49841%2012.4584%208.49846%2012.2143%208.25444C11.9701%208.01042%2011.9701%207.61475%2012.2141%207.37067L12.6562%207.8125L13.0982%208.25433ZM13.9328%205.65201C14.1769%205.40793%2014.5727%205.40788%2014.8168%205.6519C15.0609%205.89592%2015.061%206.29159%2014.8169%206.53567L14.3749%206.09384L13.9328%205.65201ZM12.6562%207.8125L12.2141%207.37067L13.9328%205.65201L14.3749%206.09384L14.8169%206.53567L13.0982%208.25433L12.6562%207.8125Z'%20fill='%23B2B3B6'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e", ce = "@feedmepos/mf-remy-panel", L = {
9
+ en: "Help me with my mini-program Brand Kit: ",
10
+ zh: "帮我调整小程序的品牌设置(颜色和字体):",
11
+ "zh-TW": "幫我調整小程式的品牌設定(顏色和字體):",
12
+ "zh-Hant": "幫我調整小程式的品牌設定(顏色和字體):",
13
+ th: "ช่วยปรับ Brand Kit ของมินิโปรแกรม (สีและฟอนต์) ให้หน่อย: ",
14
+ ja: "ミニプログラムのブランドキット(色とフォント)を調整したいです:",
15
+ ko: "미니 프로그램 브랜드 키트(색상과 글꼴)를 조정하고 싶어요: ",
16
+ id: "Bantu saya mengatur Brand Kit mini-program (warna dan font): ",
17
+ ms: "Bantu saya ubah Brand Kit mini-program (warna dan fon): ",
18
+ vi: "Giúp tôi chỉnh Brand Kit của mini-program (màu sắc và phông chữ): ",
19
+ fr: "Aide-moi à modifier le Brand Kit de mon mini-programme (couleurs et polices) : "
20
+ };
21
+ function ve(p) {
22
+ const e = (p ?? "").trim();
23
+ return L[e] ?? L[e.split("-")[0].toLowerCase()] ?? L.en;
24
+ }
25
+ async function me() {
26
+ try {
27
+ const { useAppStore: p } = await import(
28
+ /* @vite-ignore */
29
+ ce
30
+ ), e = p();
31
+ return e.activate({ prompt: ve(ue()) }), e;
32
+ } catch (p) {
33
+ return console.warn("Remy panel unavailable", p), null;
34
+ }
35
+ }
36
+ const he = { class: "portal-page bg-portal-bg-canvas text-portal-text-primary" }, be = { class: "portal-page-inner brand-page" }, ge = { class: "brand-actions" }, ye = {
37
+ key: 0,
38
+ class: "brand-unsaved"
39
+ }, fe = {
40
+ key: 1,
41
+ class: "portal-notice"
42
+ }, ke = {
43
+ key: 2,
44
+ class: "portal-loading",
45
+ role: "status"
46
+ }, _e = {
47
+ key: 3,
48
+ role: "alert",
49
+ class: "portal-section portal-error"
50
+ }, Be = {
51
+ key: 4,
52
+ role: "status"
53
+ }, Ce = { class: "portal-section" }, we = { class: "portal-section-head" }, Le = { class: "brand-reset-content fm-typo-en-body-lg-600" }, xe = { class: "brand-color-grid" }, Ke = ["value", "aria-label", "disabled", "onInput"], Ae = { class: "brand-field-label" }, Se = ["onUpdate:modelValue", "aria-label", "aria-invalid", "disabled"], De = {
54
+ key: 0,
55
+ class: "portal-error"
56
+ }, Fe = { class: "brand-advanced" }, Ie = { class: "brand-role-grid" }, Ve = ["value", "aria-label", "disabled", "onInput"], Me = ["onUpdate:modelValue", "aria-label", "aria-invalid", "disabled"], Ee = { class: "portal-section" }, Te = { class: "portal-section-head" }, Re = { class: "brand-reset-content fm-typo-en-body-lg-600" }, Pe = { class: "brand-font-grid" }, Ne = /* @__PURE__ */ J({
57
+ __name: "BrandKitView",
58
+ setup(p) {
59
+ const e = ie(), h = re(), x = oe(), K = ne(), A = M(!1), z = ae(), c = M(!1), S = ["primary", "secondary", "accent", "background.base", "text.primary"], H = S.map((n) => N.find((s) => s.path === n)), O = N.filter((n) => !S.includes(n.path)), D = q(
60
+ () => !h.value || !e.state.loaded || e.state.loading || e.state.saving || e.hasInvalidColor.value || e.dirtyCount.value === 0
61
+ ), f = (n) => !!(e.state.colors[n] && !de(e.state.colors[n]));
62
+ function F(n, s) {
63
+ e.state.colors[n] = s.target.value, c.value = !1;
64
+ }
65
+ function I(n) {
66
+ e.resetToDefault(n), c.value = !1;
67
+ }
68
+ function Z() {
69
+ x.open({
70
+ title: "Save the live Brand Kit?",
71
+ message: "Colors and fonts are shared business settings. Apps using this kit pick up the change immediately. This does not build or publish application code.",
72
+ dismissAway: !0,
73
+ primaryActions: { text: "Save Brand Kit", close: !0 },
74
+ secondaryActions: { text: "Cancel", close: !0 }
75
+ }).onPrimary(() => {
76
+ e.save().then(() => {
77
+ c.value = !0;
78
+ }).catch(() => {
79
+ c.value = !1;
80
+ });
81
+ });
82
+ }
83
+ E(() => {
84
+ A.value = !0, e.load();
85
+ });
86
+ let i = null;
87
+ async function G() {
88
+ const n = await me();
89
+ if (!n) {
90
+ K.open({ message: "Remy is not available on this page." }, 3e3);
91
+ return;
92
+ }
93
+ i == null || i(), i = W(
94
+ () => n.dialogShowing,
95
+ (s) => {
96
+ if (!s && (i == null || i(), i = null, !e.state.saving)) {
97
+ if (e.dirtyCount.value) {
98
+ K.open(
99
+ { message: "Remy may have changed your Brand Kit. Save or discard your edits, then reload to see it." },
100
+ 5e3
101
+ );
102
+ return;
103
+ }
104
+ e.load(!0);
105
+ }
106
+ }
107
+ );
108
+ }
109
+ T(() => i == null ? void 0 : i());
110
+ function V(n) {
111
+ !e.dirtyCount.value && !e.state.saving || (n.preventDefault(), n.returnValue = "");
112
+ }
113
+ return E(() => window.addEventListener("beforeunload", V)), T(() => window.removeEventListener("beforeunload", V)), se((n) => e.state.saving ? !1 : e.dirtyCount.value ? (x.open({
114
+ title: "Discard unsaved Brand Kit changes?",
115
+ message: "Your live Brand Kit has not changed. Leave this page and discard the changes you have not saved?",
116
+ dismissAway: !0,
117
+ primaryActions: { text: "Discard and leave", close: !0 },
118
+ secondaryActions: { text: "Keep editing", close: !0 }
119
+ }).onPrimary(() => {
120
+ e.discardEdits(), z.push(n);
121
+ }), !1) : !0), (n, s) => {
122
+ const Y = k("FmIcon"), g = k("FmButton"), j = k("FmCircularProgress");
123
+ return r(), l("div", he, [
124
+ t("div", be, [
125
+ t("header", { class: "portal-page-heading" }, [
126
+ s[6] || (s[6] = t("div", null, [
127
+ t("p", { class: "portal-eyebrow" }, "Applies to every surface"),
128
+ t("h1", null, "Your Business Identity")
129
+ ], -1)),
130
+ t("div", { class: "brand-help" }, [
131
+ s[5] || (s[5] = t("span", null, "Need help on brand kit?", -1)),
132
+ t("button", {
133
+ class: "brand-ask-remy",
134
+ type: "button",
135
+ onClick: G
136
+ }, [...s[4] || (s[4] = [
137
+ t("img", {
138
+ src: ee,
139
+ alt: "",
140
+ width: "20",
141
+ height: "20"
142
+ }, null, -1),
143
+ v(" Ask Remy ", -1)
144
+ ])])
145
+ ])
146
+ ]),
147
+ A.value ? (r(), _(Q, {
148
+ key: 0,
149
+ to: "#portal-page-actions"
150
+ }, [
151
+ t("div", ge, [
152
+ a(e).dirtyCount.value ? (r(), l("span", ye, m(a(e).dirtyCount.value) + " unsaved", 1)) : u("", !0),
153
+ b(g, {
154
+ label: "Save",
155
+ disabled: D.value,
156
+ loading: a(e).state.saving,
157
+ onClick: Z
158
+ }, {
159
+ default: B(() => [
160
+ t("span", {
161
+ class: X(["brand-save-content fm-typo-en-body-lg-600", { invisible: a(e).state.saving }]),
162
+ style: C({ color: D.value ? "var(--fm-color-neutral-gray-200)" : "var(--fm-color-neutral-white)" })
163
+ }, [
164
+ b(Y, {
165
+ name: "save",
166
+ "aria-hidden": "true",
167
+ style: { color: "inherit", fontSize: "20px", width: "20px", height: "20px", lineHeight: "20px", flex: "0 0 20px" }
168
+ }),
169
+ s[7] || (s[7] = v(" Save ", -1))
170
+ ], 6)
171
+ ]),
172
+ _: 1
173
+ }, 8, ["disabled", "loading"])
174
+ ])
175
+ ])) : u("", !0),
176
+ a(h) ? u("", !0) : (r(), l("p", fe, " You can view this Brand Kit, but need Brand Kit management permission to save changes. ")),
177
+ a(e).state.loading ? (r(), l("div", ke, [
178
+ b(j, { size: "xl" }),
179
+ s[8] || (s[8] = v("Loading Brand Kit… ", -1))
180
+ ])) : u("", !0),
181
+ a(e).state.error ? (r(), l("div", _e, [
182
+ t("p", null, m(a(e).state.error), 1),
183
+ a(e).state.loaded ? u("", !0) : (r(), _(g, {
184
+ key: 0,
185
+ label: "Try again",
186
+ variant: "secondary",
187
+ onClick: s[0] || (s[0] = (o) => a(e).load(!0))
188
+ }))
189
+ ])) : u("", !0),
190
+ c.value && !a(e).dirtyCount.value && !a(e).state.error ? (r(), l("p", Be, " Brand Kit saved. Apps using this kit can now pick up the changes. ")) : u("", !0),
191
+ a(e).state.loaded && !a(e).state.loading ? (r(), l(y, { key: 5 }, [
192
+ t("section", Ce, [
193
+ t("div", we, [
194
+ s[10] || (s[10] = t("div", null, [
195
+ t("h2", null, "Colors"),
196
+ t("p", { class: "portal-description" }, "The colors that represent your brand identity.")
197
+ ], -1)),
198
+ b(g, {
199
+ label: "Reset to default",
200
+ class: "brand-reset-button",
201
+ variant: "tertiary",
202
+ disabled: !a(h) || a(e).state.saving || a(e).colorsAreDefault.value,
203
+ onClick: s[1] || (s[1] = (o) => I("colors"))
204
+ }, {
205
+ default: B(() => [
206
+ t("span", Le, [
207
+ t("span", {
208
+ class: "brand-reset-icon",
209
+ style: C({ maskImage: `url(${JSON.stringify(a(U))})` }),
210
+ "aria-hidden": "true"
211
+ }, null, 4),
212
+ s[9] || (s[9] = v(" Reset to default ", -1))
213
+ ])
214
+ ]),
215
+ _: 1
216
+ }, 8, ["disabled"])
217
+ ]),
218
+ t("div", xe, [
219
+ (r(!0), l(y, null, w(a(H), (o) => (r(), l("label", {
220
+ key: o.path,
221
+ class: "brand-color-card"
222
+ }, [
223
+ t("input", {
224
+ type: "color",
225
+ value: a($)(a(e).state.colors[o.path] ?? ""),
226
+ "aria-label": `${o.label} color picker`,
227
+ disabled: a(e).state.saving,
228
+ onInput: (d) => F(o.path, d)
229
+ }, null, 40, Ke),
230
+ t("span", Ae, m(o.path === "background.base" ? "Background" : o.path === "text.primary" ? "Text" : o.label), 1),
231
+ R(t("input", {
232
+ "onUpdate:modelValue": (d) => a(e).state.colors[o.path] = d,
233
+ class: "brand-value",
234
+ "aria-label": `${o.path} hex color`,
235
+ "aria-invalid": f(o.path),
236
+ disabled: a(e).state.saving,
237
+ placeholder: "App default",
238
+ spellcheck: "false"
239
+ }, null, 8, Se), [
240
+ [P, a(e).state.colors[o.path]]
241
+ ]),
242
+ f(o.path) ? (r(), l("small", De, "Enter a hex color")) : u("", !0)
243
+ ]))), 128))
244
+ ]),
245
+ t("details", Fe, [
246
+ s[11] || (s[11] = t("summary", null, [
247
+ v("More color roles "),
248
+ t("span", null, "Keep control of text, surfaces and status colors")
249
+ ], -1)),
250
+ s[12] || (s[12] = t("p", { class: "portal-description" }, " Each role is saved independently. Changing a brand color does not automatically replace text or status colors. ", -1)),
251
+ t("div", Ie, [
252
+ (r(!0), l(y, null, w(a(O), (o) => (r(), l("label", {
253
+ key: o.path
254
+ }, [
255
+ t("span", null, m(o.group) + " · " + m(o.label), 1),
256
+ t("div", null, [
257
+ t("input", {
258
+ type: "color",
259
+ value: a($)(a(e).state.colors[o.path] ?? ""),
260
+ "aria-label": `${o.path} color picker`,
261
+ disabled: a(e).state.saving,
262
+ onInput: (d) => F(o.path, d)
263
+ }, null, 40, Ve),
264
+ R(t("input", {
265
+ "onUpdate:modelValue": (d) => a(e).state.colors[o.path] = d,
266
+ "aria-label": `${o.path} hex color`,
267
+ "aria-invalid": f(o.path),
268
+ disabled: a(e).state.saving,
269
+ class: "brand-value",
270
+ placeholder: "App default",
271
+ spellcheck: "false"
272
+ }, null, 8, Me), [
273
+ [P, a(e).state.colors[o.path]]
274
+ ])
275
+ ]),
276
+ t("small", null, m(o.hint), 1)
277
+ ]))), 128))
278
+ ])
279
+ ])
280
+ ]),
281
+ t("section", Ee, [
282
+ t("div", Te, [
283
+ s[14] || (s[14] = t("div", null, [
284
+ t("h2", null, "Typeface"),
285
+ t("p", { class: "portal-description" }, "Fonts used in your interfaces.")
286
+ ], -1)),
287
+ b(g, {
288
+ label: "Reset to default",
289
+ class: "brand-reset-button",
290
+ variant: "tertiary",
291
+ disabled: !a(h) || a(e).state.saving || a(e).fontsAreDefault.value,
292
+ onClick: s[2] || (s[2] = (o) => I("fonts"))
293
+ }, {
294
+ default: B(() => [
295
+ t("span", Re, [
296
+ t("span", {
297
+ class: "brand-reset-icon",
298
+ style: C({ maskImage: `url(${JSON.stringify(a(U))})` }),
299
+ "aria-hidden": "true"
300
+ }, null, 4),
301
+ s[13] || (s[13] = v(" Reset to default ", -1))
302
+ ])
303
+ ]),
304
+ _: 1
305
+ }, 8, ["disabled"])
306
+ ]),
307
+ t("div", Pe, [
308
+ (r(!0), l(y, null, w(a(le), (o) => (r(), _(te, {
309
+ key: o.path,
310
+ modelValue: a(e).state.fonts[o.path],
311
+ "onUpdate:modelValue": [
312
+ (d) => a(e).state.fonts[o.path] = d,
313
+ s[3] || (s[3] = (d) => c.value = !1)
314
+ ],
315
+ label: o.label === "Heading" ? "Headings" : o.label,
316
+ disabled: !a(h) || a(e).state.saving
317
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "label", "disabled"]))), 128))
318
+ ]),
319
+ s[15] || (s[15] = t("p", { class: "portal-description brand-font-help" }, "Supported by Google Fonts", -1))
320
+ ])
321
+ ], 64)) : u("", !0)
322
+ ])
323
+ ]);
324
+ };
325
+ }
326
+ }), Ye = /* @__PURE__ */ pe(Ne, [["__scopeId", "data-v-15b800ed"]]);
327
+ export {
328
+ Ye as default
329
+ };