@stonecrop/desktop 0.6.2 → 0.7.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"desktop.umd.cjs","sources":["../src/components/ActionSet.vue","../src/components/CommandPalette.vue","../../stonecrop/dist/stonecrop.js","../../aform/dist/aform.js","../src/components/SheetNav.vue","../src/components/Desktop.vue","../src/plugins/index.ts"],"sourcesContent":["<template>\n\t<div\n\t\t:class=\"{ 'open-set': isOpen, 'hovered-and-closed': closeClicked }\"\n\t\tclass=\"action-set collapse\"\n\t\t@mouseover=\"onHover\"\n\t\t@mouseleave=\"onHoverLeave\">\n\t\t<div class=\"action-menu-icon\">\n\t\t\t<div id=\"chevron\" @click=\"closeClicked = !closeClicked\">\n\t\t\t\t<svg\n\t\t\t\t\tid=\"Layer_1\"\n\t\t\t\t\tclass=\"leftBar\"\n\t\t\t\t\tversion=\"1.1\"\n\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\txmlns:xlink=\"http://www.w3.org/1999/xlink\"\n\t\t\t\t\tx=\"0px\"\n\t\t\t\t\ty=\"0px\"\n\t\t\t\t\tviewBox=\"0 0 100 100\"\n\t\t\t\t\txml:space=\"preserve\"\n\t\t\t\t\twidth=\"50\"\n\t\t\t\t\theight=\"50\">\n\t\t\t\t\t<polygon points=\"54.2,33.4 29.2,58.8 25,54.6 50,29.2 \" />\n\t\t\t\t</svg>\n\n\t\t\t\t<svg\n\t\t\t\t\tid=\"Layer_1\"\n\t\t\t\t\tclass=\"rightBar\"\n\t\t\t\t\tversion=\"1.1\"\n\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\txmlns:xlink=\"http://www.w3.org/1999/xlink\"\n\t\t\t\t\tx=\"0px\"\n\t\t\t\t\ty=\"0px\"\n\t\t\t\t\tviewBox=\"0 0 100 100\"\n\t\t\t\t\txml:space=\"preserve\"\n\t\t\t\t\twidth=\"50\"\n\t\t\t\t\theight=\"50\">\n\t\t\t\t\t<polygon points=\"70.8,58.8 45.8,33.4 50,29.2 75,54.6 \" />\n\t\t\t\t</svg>\n\t\t\t</div>\n\t\t</div>\n\t\t<div style=\"margin-right: 30px\"></div>\n\t\t<div v-for=\"(el, index) in elements\" :key=\"el.label\" class=\"action-element\">\n\t\t\t<button\n\t\t\t\tv-if=\"el.type == 'button'\"\n\t\t\t\t:disabled=\"el.disabled\"\n\t\t\t\tclass=\"button-default\"\n\t\t\t\t@click=\"handleClick(el.action, el.label)\">\n\t\t\t\t{{ el.label }}\n\t\t\t</button>\n\t\t\t<div v-if=\"el.type == 'dropdown'\">\n\t\t\t\t<button class=\"button-default\" @click=\"toggleDropdown(index)\">{{ el.label }}</button>\n\t\t\t\t<div v-show=\"dropdownStates[index]\" class=\"dropdown-container\">\n\t\t\t\t\t<div class=\"dropdown\">\n\t\t\t\t\t\t<div v-for=\"(item, itemIndex) in el.actions\" :key=\"item.label\">\n\t\t\t\t\t\t\t<button v-if=\"item.action != null\" class=\"dropdown-item\" @click=\"handleClick(item.action, item.label)\">\n\t\t\t\t\t\t\t\t{{ item.label }}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t<a v-else-if=\"item.link != null\" :href=\"item.link\"\n\t\t\t\t\t\t\t\t><button class=\"dropdown-item\">{{ item.label }}</button></a\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { onMounted, ref } from 'vue'\n\nimport type { ActionElements } from '../types'\n\nconst { elements = [] } = defineProps<{ elements?: ActionElements[] }>()\nconst emit = defineEmits<{\n\tactionClick: [label: string, action: (() => void | Promise<void>) | undefined]\n}>()\n\n// Track dropdown open state separately (index -> boolean)\nconst dropdownStates = ref<Record<number, boolean>>({})\n\nconst isOpen = ref(false)\nconst timeoutId = ref<number>(-1)\nconst hover = ref(false)\nconst closeClicked = ref(false)\n\nonMounted(() => {\n\tcloseDropdowns()\n})\n\nconst closeDropdowns = () => {\n\tdropdownStates.value = {}\n}\n\nconst onHover = () => {\n\thover.value = true\n\ttimeoutId.value = setTimeout(() => {\n\t\tif (hover.value) {\n\t\t\tisOpen.value = true\n\t\t}\n\t}, 500)\n}\n\nconst onHoverLeave = () => {\n\thover.value = false\n\tcloseClicked.value = false\n\tclearTimeout(timeoutId.value)\n\tisOpen.value = false\n}\n\nconst toggleDropdown = (index: number) => {\n\tconst showDropdown = !dropdownStates.value[index]\n\tcloseDropdowns()\n\tif (showDropdown) {\n\t\tdropdownStates.value[index] = true\n\t}\n}\n\nconst handleClick = (action: (() => void | Promise<void>) | undefined, label: string) => {\n\t// Emit event to parent - parent will handle execution\n\temit('actionClick', label, action)\n}\n</script>\n\n<style scoped>\n#chevron {\n\tposition: relative;\n\ttransform: rotate(90deg);\n}\n\n.leftBar,\n.rightBar {\n\ttransition-duration: 0.225s;\n\ttransition-property: transform;\n}\n\n.leftBar,\n.action-set.collapse.hovered-and-closed:hover .leftBar {\n\ttransform-origin: 33.4% 50%;\n\ttransform: rotate(90deg);\n}\n\n.rightBar,\n.action-set.collapse.hovered-and-closed:hover .rightBar {\n\ttransform-origin: 67% 50%;\n\ttransform: rotate(-90deg);\n}\n\n.rightBar {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n}\n\n.action-set.collapse:hover .leftBar {\n\ttransform: rotate(0);\n}\n\n.action-set.collapse:hover .rightBar {\n\ttransform: rotate(0);\n}\n\n.action-set {\n\tposition: fixed;\n\ttop: 10px;\n\tright: 10px;\n\tpadding: 20px;\n\tbox-shadow: 0px 1px 2px rgba(25, 39, 52, 0.05), 0px 0px 4px rgba(25, 39, 52, 0.1);\n\tborder-radius: 10px;\n\tdisplay: flex;\n\tflex-direction: row-reverse;\n\tbackground-color: white;\n\toverflow: hidden;\n\tz-index: 1001; /* Above SheetNav (100) and operation log button (999) */\n}\n\n.action-menu-icon {\n\tposition: absolute;\n\ttop: 6px;\n\tright: 4px;\n}\n\n.action-menu-icon svg {\n\tfill: #333333;\n}\n\n.action-set.collapse,\n.action-set.collapse.hovered-and-closed:hover {\n\tmax-width: 25px;\n\toverflow: hidden;\n\n\t-webkit-transition: max-width 0.5s ease-in-out;\n\t-moz-transition: max-width 0.5s ease-in-out;\n\t-o-transition: max-width 0.5s ease-in-out;\n\ttransition: max-width 0.5s ease-in-out;\n}\n\n.action-set.collapse .action-element,\n.action-set.collapse.hovered-and-closed:hover .action-element {\n\topacity: 0;\n\t-webkit-transition: opacity 0.25s ease-in-out;\n\t-moz-transition: opacity 0.25s ease-in-out;\n\t-o-transition: opacity 0.25s ease-in-out;\n\ttransition: opacity 0.25s ease-in-out;\n\ttransition-delay: 0s;\n}\n\n.action-set.collapse:hover {\n\tmax-width: 500px;\n}\n\n.action-set.collapse.open-set:hover {\n\toverflow: visible !important;\n}\n\n.action-set.collapse.hovered-and-closed:hover .action-element {\n\topacity: 0 !important;\n\t/* transition-delay: 0.5s; */\n}\n\n.action-set.collapse:hover .action-element {\n\topacity: 100 !important;\n\t/* transition-delay: 0.5s; */\n}\n\n.action-element {\n\tmargin-left: 5px;\n\tmargin-right: 5px;\n\tposition: relative; /* Make this the positioning context for absolute children */\n}\nbutton.button-default {\n\tbackground-color: #ffffff;\n\tpadding: 5px 12px;\n\tborder-radius: 3px;\n\tbox-shadow: rgba(0, 0, 0, 0.05) 0px 0.5px 0px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px,\n\t\trgba(0, 0, 0, 0.05) 0px 2px 4px 0px;\n\tborder: none;\n\tcursor: pointer;\n\twhite-space: nowrap;\n}\n\nbutton.button-default:hover {\n\tbackground-color: #f2f2f2;\n}\n\nbutton.button-default:disabled {\n\topacity: 0.5;\n\tcursor: not-allowed;\n\tbackground-color: #f5f5f5;\n\tcolor: #999;\n}\n\nbutton.button-default:disabled:hover {\n\tbackground-color: #f5f5f5;\n}\n\n.dropdown-container {\n\tposition: relative;\n}\n\n.dropdown {\n\tposition: absolute;\n\tright: 0;\n\tmin-width: 200px;\n\tbox-shadow: 0 0.5rem 1rem rgb(0 0 0 / 18%);\n\tborder-radius: 10px;\n\tbackground-color: #ffffff;\n\tpadding: 10px;\n\tz-index: 1000;\n}\n\nbutton.dropdown-item {\n\twidth: 100%;\n\tpadding: 8px 5px;\n\ttext-align: left;\n\tborder: none;\n\tbackground-color: #ffffff;\n\tcursor: pointer;\n\tborder-radius: 5px;\n}\n\nbutton.dropdown-item:hover {\n\tbackground-color: #f2f2f2;\n}\n</style>\n","<template>\n\t<Teleport to=\"body\">\n\t\t<Transition name=\"fade\">\n\t\t\t<div v-if=\"isOpen\" class=\"command-palette-overlay\" @click=\"closeModal\">\n\t\t\t\t<div class=\"command-palette\" @click.stop>\n\t\t\t\t\t<div class=\"command-palette-header\">\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tref=\"input\"\n\t\t\t\t\t\t\tv-model=\"query\"\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tclass=\"command-palette-input\"\n\t\t\t\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t\t\t\tautofocus\n\t\t\t\t\t\t\t@keydown=\"handleKeydown\" />\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div v-if=\"results.length\" class=\"command-palette-results\">\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tv-for=\"(result, index) in results\"\n\t\t\t\t\t\t\t:key=\"index\"\n\t\t\t\t\t\t\tclass=\"command-palette-result\"\n\t\t\t\t\t\t\t:class=\"{ selected: index === selectedIndex }\"\n\t\t\t\t\t\t\t@click=\"selectResult(result)\"\n\t\t\t\t\t\t\t@mouseover=\"selectedIndex = index\">\n\t\t\t\t\t\t\t<div class=\"result-title\">\n\t\t\t\t\t\t\t\t<slot name=\"title\" :result=\"result\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"result-content\">\n\t\t\t\t\t\t\t\t<slot name=\"content\" :result=\"result\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div v-else-if=\"query && !results.length\" class=\"command-palette-no-results\">\n\t\t\t\t\t\t<slot name=\"empty\"> No results found for \"{{ query }}\" </slot>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</Transition>\n\t</Teleport>\n</template>\n\n<script setup lang=\"ts\" generic=\"T\">\nimport { ref, computed, watch, nextTick, useTemplateRef } from 'vue'\n\ndefineSlots<{\n\ttitle?: { result: T }\n\tcontent?: { result: T }\n\tempty?: null\n}>()\n\nconst {\n\tsearch,\n\tisOpen = false,\n\tplaceholder = 'Type a command or search...',\n\tmaxResults = 10,\n} = defineProps<{\n\tsearch: (query: string) => T[]\n\tisOpen?: boolean\n\tplaceholder?: string\n\tmaxResults?: number\n}>()\n\nconst emit = defineEmits<{\n\tselect: [T]\n\tclose: []\n}>()\n\nconst query = ref('')\nconst selectedIndex = ref(0)\nconst inputRef = useTemplateRef('input')\n\nconst results = computed(() => {\n\tif (!query.value) return []\n\tconst results = search(query.value)\n\treturn results.slice(0, maxResults)\n})\n\n// reset search query when modal opens\nwatch(\n\t() => isOpen,\n\tasync isOpen => {\n\t\tif (isOpen) {\n\t\t\tquery.value = ''\n\t\t\tselectedIndex.value = 0\n\t\t\tawait nextTick()\n\t\t\t;(inputRef.value as HTMLInputElement)?.focus()\n\t\t}\n\t}\n)\n\n// reset selected index when results change\nwatch(results, () => {\n\tselectedIndex.value = 0\n})\n\nconst closeModal = () => {\n\temit('close')\n}\n\nconst handleKeydown = (e: KeyboardEvent) => {\n\tswitch (e.key) {\n\t\tcase 'Escape':\n\t\t\tcloseModal()\n\t\t\tbreak\n\t\tcase 'ArrowDown':\n\t\t\te.preventDefault()\n\t\t\tif (results.value.length) {\n\t\t\t\tselectedIndex.value = (selectedIndex.value + 1) % results.value.length\n\t\t\t}\n\t\t\tbreak\n\t\tcase 'ArrowUp':\n\t\t\te.preventDefault()\n\t\t\tif (results.value.length) {\n\t\t\t\tselectedIndex.value = (selectedIndex.value - 1 + results.value.length) % results.value.length\n\t\t\t}\n\t\t\tbreak\n\t\tcase 'Enter':\n\t\t\tif (results.value.length && selectedIndex.value >= 0) {\n\t\t\t\tselectResult(results.value[selectedIndex.value])\n\t\t\t}\n\t\t\tbreak\n\t}\n}\n\nconst selectResult = (result: T) => {\n\temit('select', result)\n\tcloseModal()\n}\n</script>\n\n<style>\n.fade-enter-active,\n.fade-leave-active {\n\ttransition: opacity 0.2s ease;\n}\n\n.fade-enter-from,\n.fade-leave-to {\n\topacity: 0;\n}\n\n.command-palette-overlay {\n\tposition: fixed;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 100%;\n\tbackground-color: rgba(0, 0, 0, 0.5);\n\tdisplay: flex;\n\talign-items: flex-start;\n\tjustify-content: center;\n\tz-index: 9999;\n\tpadding-top: 100px;\n}\n\n.command-palette {\n\twidth: 600px;\n\tmax-width: 90%;\n\tbackground-color: white;\n\tborder-radius: 8px;\n\tbox-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);\n\toverflow: hidden;\n\tmax-height: 80vh;\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n.command-palette-header {\n\tdisplay: flex;\n\tborder-bottom: 1px solid #eaeaea;\n\tpadding: 12px;\n}\n\n.command-palette-input {\n\tflex: 1;\n\tborder: none;\n\toutline: none;\n\tfont-size: 16px;\n\tpadding: 8px 12px;\n\tbackground-color: transparent;\n}\n\n.command-palette-close {\n\tbackground: transparent;\n\tborder: none;\n\tfont-size: 24px;\n\tcursor: pointer;\n\tcolor: #666;\n\tpadding: 0 8px;\n}\n\n.command-palette-close:hover {\n\tcolor: #333;\n}\n\n.command-palette-results {\n\toverflow-y: auto;\n\tmax-height: 60vh;\n}\n\n.command-palette-result {\n\tpadding: 12px 16px;\n\tcursor: pointer;\n\tborder-bottom: 1px solid #f0f0f0;\n}\n\n.command-palette-result:hover,\n.command-palette-result.selected {\n\tbackground-color: #f5f5f5;\n}\n\n.command-palette-result.selected {\n\tbackground-color: rgba(132, 60, 3, 0.1);\n}\n\n.result-title {\n\tfont-weight: 500;\n\tmargin-bottom: 4px;\n\tcolor: #333;\n}\n\n.result-content {\n\tfont-size: 14px;\n\tcolor: #666;\n\twhite-space: nowrap;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n}\n\n.command-palette-no-results {\n\tpadding: 20px 16px;\n\ttext-align: center;\n\tcolor: #666;\n}\n</style>\n","import { hasInjectionContext as Ke, inject as he, getCurrentInstance as Ae, toRaw as Ve, computed as B, isRef as X, isReactive as ye, toRef as oe, ref as M, reactive as we, markRaw as te, effectScope as Ze, nextTick as ce, getCurrentScope as Fe, onScopeDispose as ke, watch as H, toRefs as Re, onMounted as Le, readonly as Me, customRef as Ge, toValue as J, shallowRef as xe, unref as qe, provide as _e } from \"vue\";\n/*!\n * pinia v3.0.3\n * (c) 2025 Eduardo San Martin Morote\n * @license MIT\n */\nlet re;\nconst ge = (r) => re = r, Ye = process.env.NODE_ENV !== \"production\" ? Symbol(\"pinia\") : (\n /* istanbul ignore next */\n Symbol()\n);\nfunction Z(r) {\n return r && typeof r == \"object\" && Object.prototype.toString.call(r) === \"[object Object]\" && typeof r.toJSON != \"function\";\n}\nvar se;\n(function(r) {\n r.direct = \"direct\", r.patchObject = \"patch object\", r.patchFunction = \"patch function\";\n})(se || (se = {}));\nconst ne = typeof window < \"u\";\nfunction Be(r, e) {\n for (const t in e) {\n const n = e[t];\n if (!(t in r))\n continue;\n const o = r[t];\n Z(o) && Z(n) && !X(n) && !ye(n) ? r[t] = Be(o, n) : r[t] = n;\n }\n return r;\n}\nconst je = () => {\n};\nfunction Pe(r, e, t, n = je) {\n r.push(e);\n const o = () => {\n const s = r.indexOf(e);\n s > -1 && (r.splice(s, 1), n());\n };\n return !t && Fe() && ke(o), o;\n}\nfunction q(r, ...e) {\n r.slice().forEach((t) => {\n t(...e);\n });\n}\nconst Qe = (r) => r(), Ne = Symbol(), me = Symbol();\nfunction Ee(r, e) {\n r instanceof Map && e instanceof Map ? e.forEach((t, n) => r.set(n, t)) : r instanceof Set && e instanceof Set && e.forEach(r.add, r);\n for (const t in e) {\n if (!e.hasOwnProperty(t))\n continue;\n const n = e[t], o = r[t];\n Z(o) && Z(n) && r.hasOwnProperty(t) && !X(n) && !ye(n) ? r[t] = Ee(o, n) : r[t] = n;\n }\n return r;\n}\nconst Xe = process.env.NODE_ENV !== \"production\" ? Symbol(\"pinia:skipHydration\") : (\n /* istanbul ignore next */\n Symbol()\n);\nfunction et(r) {\n return !Z(r) || !Object.prototype.hasOwnProperty.call(r, Xe);\n}\nconst { assign: U } = Object;\nfunction Ie(r) {\n return !!(X(r) && r.effect);\n}\nfunction $e(r, e, t, n) {\n const { state: o, actions: s, getters: i } = e, a = t.state.value[r];\n let c;\n function l() {\n !a && (process.env.NODE_ENV === \"production\" || !n) && (t.state.value[r] = o ? o() : {});\n const S = process.env.NODE_ENV !== \"production\" && n ? (\n // use ref() to unwrap refs inside state TODO: check if this is still necessary\n Re(M(o ? o() : {}).value)\n ) : Re(t.state.value[r]);\n return U(S, s, Object.keys(i || {}).reduce((w, P) => (process.env.NODE_ENV !== \"production\" && P in S && console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with \"${P}\" in store \"${r}\".`), w[P] = te(B(() => {\n ge(t);\n const $ = t._s.get(r);\n return i[P].call($, $);\n })), w), {}));\n }\n return c = Oe(r, l, e, t, n, !0), c;\n}\nfunction Oe(r, e, t = {}, n, o, s) {\n let i;\n const a = U({ actions: {} }, t);\n if (process.env.NODE_ENV !== \"production\" && !n._e.active)\n throw new Error(\"Pinia destroyed\");\n const c = { deep: !0 };\n process.env.NODE_ENV !== \"production\" && (c.onTrigger = (u) => {\n l ? $ = u : l == !1 && !g._hotUpdating && (Array.isArray($) ? $.push(u) : console.error(\"🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug.\"));\n });\n let l, S, w = [], P = [], $;\n const T = n.state.value[r];\n !s && !T && (process.env.NODE_ENV === \"production\" || !o) && (n.state.value[r] = {});\n const k = M({});\n let _;\n function D(u) {\n let f;\n l = S = !1, process.env.NODE_ENV !== \"production\" && ($ = []), typeof u == \"function\" ? (u(n.state.value[r]), f = {\n type: se.patchFunction,\n storeId: r,\n events: $\n }) : (Ee(n.state.value[r], u), f = {\n type: se.patchObject,\n payload: u,\n storeId: r,\n events: $\n });\n const O = _ = Symbol();\n ce().then(() => {\n _ === O && (l = !0);\n }), S = !0, q(w, f, n.state.value[r]);\n }\n const R = s ? function() {\n const { state: f } = t, O = f ? f() : {};\n this.$patch((y) => {\n U(y, O);\n });\n } : (\n /* istanbul ignore next */\n process.env.NODE_ENV !== \"production\" ? () => {\n throw new Error(`🍍: Store \"${r}\" is built using the setup syntax and does not implement $reset().`);\n } : je\n );\n function b() {\n i.stop(), w = [], P = [], n._s.delete(r);\n }\n const C = (u, f = \"\") => {\n if (Ne in u)\n return u[me] = f, u;\n const O = function() {\n ge(n);\n const y = Array.from(arguments), d = [], m = [];\n function N(V) {\n d.push(V);\n }\n function A(V) {\n m.push(V);\n }\n q(P, {\n args: y,\n name: O[me],\n store: g,\n after: N,\n onError: A\n });\n let j;\n try {\n j = u.apply(this && this.$id === r ? this : g, y);\n } catch (V) {\n throw q(m, V), V;\n }\n return j instanceof Promise ? j.then((V) => (q(d, V), V)).catch((V) => (q(m, V), Promise.reject(V))) : (q(d, j), j);\n };\n return O[Ne] = !0, O[me] = f, O;\n }, E = /* @__PURE__ */ te({\n actions: {},\n getters: {},\n state: [],\n hotState: k\n }), I = {\n _p: n,\n // _s: scope,\n $id: r,\n $onAction: Pe.bind(null, P),\n $patch: D,\n $reset: R,\n $subscribe(u, f = {}) {\n const O = Pe(w, u, f.detached, () => y()), y = i.run(() => H(() => n.state.value[r], (d) => {\n (f.flush === \"sync\" ? S : l) && u({\n storeId: r,\n type: se.direct,\n events: $\n }, d);\n }, U({}, c, f)));\n return O;\n },\n $dispose: b\n }, g = we(process.env.NODE_ENV !== \"production\" || process.env.NODE_ENV !== \"production\" && process.env.NODE_ENV !== \"test\" && ne ? U(\n {\n _hmrPayload: E,\n _customProperties: te(/* @__PURE__ */ new Set())\n // devtools custom properties\n },\n I\n // must be added later\n // setupStore\n ) : I);\n n._s.set(r, g);\n const L = (n._a && n._a.runWithContext || Qe)(() => n._e.run(() => (i = Ze()).run(() => e({ action: C }))));\n for (const u in L) {\n const f = L[u];\n if (X(f) && !Ie(f) || ye(f))\n process.env.NODE_ENV !== \"production\" && o ? k.value[u] = oe(L, u) : s || (T && et(f) && (X(f) ? f.value = T[u] : Ee(f, T[u])), n.state.value[r][u] = f), process.env.NODE_ENV !== \"production\" && E.state.push(u);\n else if (typeof f == \"function\") {\n const O = process.env.NODE_ENV !== \"production\" && o ? f : C(f, u);\n L[u] = O, process.env.NODE_ENV !== \"production\" && (E.actions[u] = f), a.actions[u] = f;\n } else process.env.NODE_ENV !== \"production\" && Ie(f) && (E.getters[u] = s ? (\n // @ts-expect-error\n t.getters[u]\n ) : f, ne && (L._getters || // @ts-expect-error: same\n (L._getters = te([]))).push(u));\n }\n if (U(g, L), U(Ve(g), L), Object.defineProperty(g, \"$state\", {\n get: () => process.env.NODE_ENV !== \"production\" && o ? k.value : n.state.value[r],\n set: (u) => {\n if (process.env.NODE_ENV !== \"production\" && o)\n throw new Error(\"cannot set hotState\");\n D((f) => {\n U(f, u);\n });\n }\n }), process.env.NODE_ENV !== \"production\" && (g._hotUpdate = te((u) => {\n g._hotUpdating = !0, u._hmrPayload.state.forEach((f) => {\n if (f in g.$state) {\n const O = u.$state[f], y = g.$state[f];\n typeof O == \"object\" && Z(O) && Z(y) ? Be(O, y) : u.$state[f] = y;\n }\n g[f] = oe(u.$state, f);\n }), Object.keys(g.$state).forEach((f) => {\n f in u.$state || delete g[f];\n }), l = !1, S = !1, n.state.value[r] = oe(u._hmrPayload, \"hotState\"), S = !0, ce().then(() => {\n l = !0;\n });\n for (const f in u._hmrPayload.actions) {\n const O = u[f];\n g[f] = //\n C(O, f);\n }\n for (const f in u._hmrPayload.getters) {\n const O = u._hmrPayload.getters[f], y = s ? (\n // special handling of options api\n B(() => (ge(n), O.call(g, g)))\n ) : O;\n g[f] = //\n y;\n }\n Object.keys(g._hmrPayload.getters).forEach((f) => {\n f in u._hmrPayload.getters || delete g[f];\n }), Object.keys(g._hmrPayload.actions).forEach((f) => {\n f in u._hmrPayload.actions || delete g[f];\n }), g._hmrPayload = u._hmrPayload, g._getters = u._getters, g._hotUpdating = !1;\n })), process.env.NODE_ENV !== \"production\" && process.env.NODE_ENV !== \"test\" && ne) {\n const u = {\n writable: !0,\n configurable: !0,\n // avoid warning on devtools trying to display this property\n enumerable: !1\n };\n [\"_p\", \"_hmrPayload\", \"_getters\", \"_customProperties\"].forEach((f) => {\n Object.defineProperty(g, f, U({ value: g[f] }, u));\n });\n }\n return n._p.forEach((u) => {\n if (process.env.NODE_ENV !== \"production\" && process.env.NODE_ENV !== \"test\" && ne) {\n const f = i.run(() => u({\n store: g,\n app: n._a,\n pinia: n,\n options: a\n }));\n Object.keys(f || {}).forEach((O) => g._customProperties.add(O)), U(g, f);\n } else\n U(g, i.run(() => u({\n store: g,\n app: n._a,\n pinia: n,\n options: a\n })));\n }), process.env.NODE_ENV !== \"production\" && g.$state && typeof g.$state == \"object\" && typeof g.$state.constructor == \"function\" && !g.$state.constructor.toString().includes(\"[native code]\") && console.warn(`[🍍]: The \"state\" must be a plain object. It cannot be\n\tstate: () => new MyClass()\nFound in store \"${g.$id}\".`), T && s && t.hydrate && t.hydrate(g.$state, T), l = !0, S = !0, g;\n}\n/*! #__NO_SIDE_EFFECTS__ */\n// @__NO_SIDE_EFFECTS__\nfunction tt(r, e, t) {\n let n;\n const o = typeof e == \"function\";\n n = o ? t : e;\n function s(i, a) {\n const c = Ke();\n if (i = // in test mode, ignore the argument provided as we can always retrieve a\n // pinia instance with getActivePinia()\n (process.env.NODE_ENV === \"test\" && re && re._testing ? null : i) || (c ? he(Ye, null) : null), i && ge(i), process.env.NODE_ENV !== \"production\" && !re)\n throw new Error(`[🍍]: \"getActivePinia()\" was called but there was no active Pinia. Are you trying to use a store before calling \"app.use(pinia)\"?\nSee https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.\nThis will fail in production.`);\n i = re, i._s.has(r) || (o ? Oe(r, e, n, i) : $e(r, n, i), process.env.NODE_ENV !== \"production\" && (s._pinia = i));\n const l = i._s.get(r);\n if (process.env.NODE_ENV !== \"production\" && a) {\n const S = \"__hot:\" + r, w = o ? Oe(S, e, n, i, !0) : $e(S, U({}, n), i, !0);\n a._hotUpdate(w), delete i.state.value[S], i._s.delete(S);\n }\n if (process.env.NODE_ENV !== \"production\" && ne) {\n const S = Ae();\n if (S && S.proxy && // avoid adding stores that are just built for hot module replacement\n !a) {\n const w = S.proxy, P = \"_pStores\" in w ? w._pStores : w._pStores = {};\n P[r] = l;\n }\n }\n return l;\n }\n return s.$id = r, s;\n}\nfunction Ue(r) {\n const e = Ve(r), t = {};\n for (const n in e) {\n const o = e[n];\n o.effect ? t[n] = // ...\n B({\n get: () => r[n],\n set(s) {\n r[n] = s;\n }\n }) : (X(o) || ye(o)) && (t[n] = // ---\n oe(r, n));\n }\n return t;\n}\nfunction rt(r, e) {\n return Fe() ? (ke(r, e), !0) : !1;\n}\nconst nt = typeof window < \"u\" && typeof document < \"u\";\ntypeof WorkerGlobalScope < \"u\" && globalThis instanceof WorkerGlobalScope;\nconst ot = Object.prototype.toString, st = (r) => ot.call(r) === \"[object Object]\", We = () => {\n};\nfunction it(...r) {\n if (r.length !== 1) return oe(...r);\n const e = r[0];\n return typeof e == \"function\" ? Me(Ge(() => ({\n get: e,\n set: We\n }))) : M(e);\n}\nfunction at(r, e) {\n function t(...n) {\n return new Promise((o, s) => {\n Promise.resolve(r(() => e.apply(this, n), {\n fn: e,\n thisArg: this,\n args: n\n })).then(o).catch(s);\n });\n }\n return t;\n}\nconst ze = (r) => r();\nfunction ct(r = ze, e = {}) {\n const { initialState: t = \"active\" } = e, n = it(t === \"active\");\n function o() {\n n.value = !1;\n }\n function s() {\n n.value = !0;\n }\n const i = (...a) => {\n n.value && r(...a);\n };\n return {\n isActive: Me(n),\n pause: o,\n resume: s,\n eventFilter: i\n };\n}\nfunction Se(r) {\n return Array.isArray(r) ? r : [r];\n}\nfunction ut(r) {\n return Ae();\n}\nfunction lt(r, e, t = {}) {\n const { eventFilter: n = ze, ...o } = t;\n return H(r, at(n, e), o);\n}\nfunction ft(r, e, t = {}) {\n const { eventFilter: n, initialState: o = \"active\", ...s } = t, { eventFilter: i, pause: a, resume: c, isActive: l } = ct(n, { initialState: o });\n return {\n stop: lt(r, e, {\n ...s,\n eventFilter: i\n }),\n pause: a,\n resume: c,\n isActive: l\n };\n}\nconst dt = ft;\nfunction pt(r, e = !0, t) {\n ut() ? Le(r, t) : e ? r() : ce(r);\n}\nfunction ht(r, e, t) {\n return H(r, e, {\n ...t,\n immediate: !0\n });\n}\nfunction ee(r, e, t) {\n return H(r, (o, s, i) => {\n o && e(o, s, i);\n }, {\n ...t,\n once: !1\n });\n}\nconst K = nt ? window : void 0;\nfunction gt(r) {\n var e;\n const t = J(r);\n return (e = t?.$el) !== null && e !== void 0 ? e : t;\n}\nfunction Y(...r) {\n const e = [], t = () => {\n e.forEach((a) => a()), e.length = 0;\n }, n = (a, c, l, S) => (a.addEventListener(c, l, S), () => a.removeEventListener(c, l, S)), o = B(() => {\n const a = Se(J(r[0])).filter((c) => c != null);\n return a.every((c) => typeof c != \"string\") ? a : void 0;\n }), s = ht(() => {\n var a, c;\n return [\n (a = (c = o.value) === null || c === void 0 ? void 0 : c.map((l) => gt(l))) !== null && a !== void 0 ? a : [K].filter((l) => l != null),\n Se(J(o.value ? r[1] : r[0])),\n Se(qe(o.value ? r[2] : r[1])),\n J(o.value ? r[3] : r[2])\n ];\n }, ([a, c, l, S]) => {\n if (t(), !a?.length || !c?.length || !l?.length) return;\n const w = st(S) ? { ...S } : S;\n e.push(...a.flatMap((P) => c.flatMap(($) => l.map((T) => n(P, $, T, w)))));\n }, { flush: \"post\" }), i = () => {\n s(), t();\n };\n return rt(t), i;\n}\nconst le = typeof globalThis < \"u\" ? globalThis : typeof window < \"u\" ? window : typeof global < \"u\" ? global : typeof self < \"u\" ? self : {}, fe = \"__vueuse_ssr_handlers__\", vt = /* @__PURE__ */ yt();\nfunction yt() {\n return fe in le || (le[fe] = le[fe] || {}), le[fe];\n}\nfunction mt(r, e) {\n return vt[r] || e;\n}\nfunction St(r) {\n return r == null ? \"any\" : r instanceof Set ? \"set\" : r instanceof Map ? \"map\" : r instanceof Date ? \"date\" : typeof r == \"boolean\" ? \"boolean\" : typeof r == \"string\" ? \"string\" : typeof r == \"object\" ? \"object\" : Number.isNaN(r) ? \"any\" : \"number\";\n}\nconst bt = {\n boolean: {\n read: (r) => r === \"true\",\n write: (r) => String(r)\n },\n object: {\n read: (r) => JSON.parse(r),\n write: (r) => JSON.stringify(r)\n },\n number: {\n read: (r) => Number.parseFloat(r),\n write: (r) => String(r)\n },\n any: {\n read: (r) => r,\n write: (r) => String(r)\n },\n string: {\n read: (r) => r,\n write: (r) => String(r)\n },\n map: {\n read: (r) => new Map(JSON.parse(r)),\n write: (r) => JSON.stringify(Array.from(r.entries()))\n },\n set: {\n read: (r) => new Set(JSON.parse(r)),\n write: (r) => JSON.stringify(Array.from(r))\n },\n date: {\n read: (r) => new Date(r),\n write: (r) => r.toISOString()\n }\n}, De = \"vueuse-storage\";\nfunction wt(r, e, t, n = {}) {\n var o;\n const { flush: s = \"pre\", deep: i = !0, listenToStorageChanges: a = !0, writeDefaults: c = !0, mergeDefaults: l = !1, shallow: S, window: w = K, eventFilter: P, onError: $ = (d) => {\n console.error(d);\n }, initOnMounted: T } = n, k = (S ? xe : M)(e), _ = B(() => J(r));\n if (!t) try {\n t = mt(\"getDefaultStorage\", () => K?.localStorage)();\n } catch (d) {\n $(d);\n }\n if (!t) return k;\n const D = J(e), R = St(D), b = (o = n.serializer) !== null && o !== void 0 ? o : bt[R], { pause: C, resume: E } = dt(k, (d) => u(d), {\n flush: s,\n deep: i,\n eventFilter: P\n });\n H(_, () => O(), { flush: s });\n let I = !1;\n const g = (d) => {\n T && !I || O(d);\n }, x = (d) => {\n T && !I || y(d);\n };\n w && a && (t instanceof Storage ? Y(w, \"storage\", g, { passive: !0 }) : Y(w, De, x)), T ? pt(() => {\n I = !0, O();\n }) : O();\n function L(d, m) {\n if (w) {\n const N = {\n key: _.value,\n oldValue: d,\n newValue: m,\n storageArea: t\n };\n w.dispatchEvent(t instanceof Storage ? new StorageEvent(\"storage\", N) : new CustomEvent(De, { detail: N }));\n }\n }\n function u(d) {\n try {\n const m = t.getItem(_.value);\n if (d == null)\n L(m, null), t.removeItem(_.value);\n else {\n const N = b.write(d);\n m !== N && (t.setItem(_.value, N), L(m, N));\n }\n } catch (m) {\n $(m);\n }\n }\n function f(d) {\n const m = d ? d.newValue : t.getItem(_.value);\n if (m == null)\n return c && D != null && t.setItem(_.value, b.write(D)), D;\n if (!d && l) {\n const N = b.read(m);\n return typeof l == \"function\" ? l(N, D) : R === \"object\" && !Array.isArray(N) ? {\n ...D,\n ...N\n } : N;\n } else return typeof m != \"string\" ? m : b.read(m);\n }\n function O(d) {\n if (!(d && d.storageArea !== t)) {\n if (d && d.key == null) {\n k.value = D;\n return;\n }\n if (!(d && d.key !== _.value)) {\n C();\n try {\n const m = b.write(k.value);\n (d === void 0 || d?.newValue !== m) && (k.value = f(d));\n } catch (m) {\n $(m);\n } finally {\n d ? ce(E) : E();\n }\n }\n }\n }\n function y(d) {\n O(d.detail);\n }\n return k;\n}\nfunction Et(r, e, t = {}) {\n const { window: n = K } = t;\n return wt(r, e, n?.localStorage, t);\n}\nconst Ot = {\n ctrl: \"control\",\n command: \"meta\",\n cmd: \"meta\",\n option: \"alt\",\n up: \"arrowup\",\n down: \"arrowdown\",\n left: \"arrowleft\",\n right: \"arrowright\"\n};\nfunction Rt(r = {}) {\n const { reactive: e = !1, target: t = K, aliasMap: n = Ot, passive: o = !0, onEventFired: s = We } = r, i = we(/* @__PURE__ */ new Set()), a = {\n toJSON() {\n return {};\n },\n current: i\n }, c = e ? we(a) : a, l = /* @__PURE__ */ new Set(), S = /* @__PURE__ */ new Map([\n [\"Meta\", l],\n [\"Shift\", /* @__PURE__ */ new Set()],\n [\"Alt\", /* @__PURE__ */ new Set()]\n ]), w = /* @__PURE__ */ new Set();\n function P(R, b) {\n R in c && (e ? c[R] = b : c[R].value = b);\n }\n function $() {\n i.clear();\n for (const R of w) P(R, !1);\n }\n function T(R, b, C) {\n if (!(!R || typeof b.getModifierState != \"function\")) {\n for (const [E, I] of S) if (b.getModifierState(E)) {\n C.forEach((g) => I.add(g));\n break;\n }\n }\n }\n function k(R, b) {\n if (R) return;\n const C = `${b[0].toUpperCase()}${b.slice(1)}`, E = S.get(C);\n if (![\"shift\", \"alt\"].includes(b) || !E) return;\n const I = Array.from(E), g = I.indexOf(b);\n I.forEach((x, L) => {\n L >= g && (i.delete(x), P(x, !1));\n }), E.clear();\n }\n function _(R, b) {\n var C, E;\n const I = (C = R.key) === null || C === void 0 ? void 0 : C.toLowerCase(), g = [(E = R.code) === null || E === void 0 ? void 0 : E.toLowerCase(), I].filter(Boolean);\n I && (b ? i.add(I) : i.delete(I));\n for (const x of g)\n w.add(x), P(x, b);\n T(b, R, [...i, ...g]), k(b, I), I === \"meta\" && !b && (l.forEach((x) => {\n i.delete(x), P(x, !1);\n }), l.clear());\n }\n Y(t, \"keydown\", (R) => (_(R, !0), s(R)), { passive: o }), Y(t, \"keyup\", (R) => (_(R, !1), s(R)), { passive: o }), Y(\"blur\", $, { passive: o }), Y(\"focus\", $, { passive: o });\n const D = new Proxy(c, { get(R, b, C) {\n if (typeof b != \"string\") return Reflect.get(R, b, C);\n if (b = b.toLowerCase(), b in n && (b = n[b]), !(b in c)) if (/[+_-]/.test(b)) {\n const I = b.split(/[+_-]/g).map((g) => g.trim());\n c[b] = B(() => I.map((g) => J(D[g])).every(Boolean));\n } else c[b] = xe(!1);\n const E = Reflect.get(R, b, C);\n return e ? J(E) : E;\n } });\n return D;\n}\nfunction be() {\n return typeof crypto < \"u\" && crypto.randomUUID ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;\n}\nfunction de(r) {\n const e = {\n type: r.type,\n clientId: r.clientId,\n timestamp: r.timestamp.toISOString()\n };\n return r.operation && (e.operation = {\n ...r.operation,\n timestamp: r.operation.timestamp.toISOString()\n }), r.operations && (e.operations = r.operations.map((t) => ({\n ...t,\n timestamp: t.timestamp.toISOString()\n }))), e;\n}\nfunction _t(r) {\n const e = {\n type: r.type,\n clientId: r.clientId,\n timestamp: new Date(r.timestamp)\n };\n return r.operation && (e.operation = {\n ...r.operation,\n timestamp: new Date(r.operation.timestamp)\n }), r.operations && (e.operations = r.operations.map((t) => ({\n ...t,\n timestamp: new Date(t.timestamp)\n }))), e;\n}\nconst ue = /* @__PURE__ */ tt(\"hst-operation-log\", () => {\n const r = M({\n maxOperations: 100,\n enableCrossTabSync: !0,\n autoSyncInterval: 3e4,\n enablePersistence: !1,\n persistenceKeyPrefix: \"stonecrop-ops\"\n }), e = M([]), t = M(-1), n = M(be()), o = M(!1), s = M([]), i = M(null), a = B(() => t.value < 0 ? !1 : e.value[t.value]?.reversible ?? !1), c = B(() => t.value < e.value.length - 1), l = B(() => {\n let p = 0;\n for (let h = t.value; h >= 0 && e.value[h]?.reversible; h--)\n p++;\n return p;\n }), S = B(() => e.value.length - 1 - t.value), w = B(() => ({\n canUndo: a.value,\n canRedo: c.value,\n undoCount: l.value,\n redoCount: S.value,\n currentIndex: t.value\n }));\n function P(p) {\n r.value = { ...r.value, ...p }, r.value.enablePersistence && (A(), V()), r.value.enableCrossTabSync && f();\n }\n function $(p, h = \"user\") {\n const v = {\n ...p,\n id: be(),\n timestamp: /* @__PURE__ */ new Date(),\n source: h,\n userId: r.value.userId\n };\n if (r.value.operationFilter && !r.value.operationFilter(v))\n return v.id;\n if (o.value)\n return s.value.push(v), v.id;\n if (t.value < e.value.length - 1 && (e.value = e.value.slice(0, t.value + 1)), e.value.push(v), t.value++, r.value.maxOperations && e.value.length > r.value.maxOperations) {\n const F = e.value.length - r.value.maxOperations;\n e.value = e.value.slice(F), t.value -= F;\n }\n return r.value.enableCrossTabSync && O(v), v.id;\n }\n function T() {\n o.value = !0, s.value = [], i.value = be();\n }\n function k(p) {\n if (!o.value || s.value.length === 0)\n return o.value = !1, s.value = [], i.value = null, null;\n const h = i.value, v = s.value.every((W) => W.reversible), F = {\n id: h,\n type: \"batch\",\n path: \"\",\n // Batch doesn't have a single path\n fieldname: \"\",\n beforeValue: null,\n afterValue: null,\n doctype: s.value[0]?.doctype || \"\",\n timestamp: /* @__PURE__ */ new Date(),\n source: \"user\",\n reversible: v,\n irreversibleReason: v ? void 0 : \"Contains irreversible operations\",\n childOperationIds: s.value.map((W) => W.id),\n metadata: { description: p }\n };\n s.value.forEach((W) => {\n W.parentOperationId = h;\n }), e.value.push(...s.value, F), t.value = e.value.length - 1, r.value.enableCrossTabSync && y(s.value, F);\n const z = h;\n return o.value = !1, s.value = [], i.value = null, z;\n }\n function _() {\n o.value = !1, s.value = [], i.value = null;\n }\n function D(p) {\n if (!a.value) return !1;\n const h = e.value[t.value];\n if (!h.reversible)\n return typeof console < \"u\" && h.irreversibleReason && console.warn(\"Cannot undo irreversible operation:\", h.irreversibleReason), !1;\n try {\n if (h.type === \"batch\" && h.childOperationIds)\n for (let v = h.childOperationIds.length - 1; v >= 0; v--) {\n const F = h.childOperationIds[v], z = e.value.find((W) => W.id === F);\n z && b(z, p);\n }\n else\n b(h, p);\n return t.value--, r.value.enableCrossTabSync && d(h), !0;\n } catch (v) {\n return typeof console < \"u\" && console.error(\"Undo failed:\", v), !1;\n }\n }\n function R(p) {\n if (!c.value) return !1;\n const h = e.value[t.value + 1];\n try {\n if (h.type === \"batch\" && h.childOperationIds)\n for (const v of h.childOperationIds) {\n const F = e.value.find((z) => z.id === v);\n F && C(F, p);\n }\n else\n C(h, p);\n return t.value++, r.value.enableCrossTabSync && m(h), !0;\n } catch (v) {\n return typeof console < \"u\" && console.error(\"Redo failed:\", v), !1;\n }\n }\n function b(p, h) {\n (p.type === \"set\" || p.type === \"delete\") && h && typeof h.set == \"function\" && h.set(p.path, p.beforeValue, \"undo\");\n }\n function C(p, h) {\n (p.type === \"set\" || p.type === \"delete\") && h && typeof h.set == \"function\" && h.set(p.path, p.afterValue, \"redo\");\n }\n function E() {\n const p = e.value.filter((v) => v.reversible).length, h = e.value.map((v) => v.timestamp);\n return {\n operations: [...e.value],\n currentIndex: t.value,\n totalOperations: e.value.length,\n reversibleOperations: p,\n irreversibleOperations: e.value.length - p,\n oldestOperation: h.length > 0 ? new Date(Math.min(...h.map((v) => v.getTime()))) : void 0,\n newestOperation: h.length > 0 ? new Date(Math.max(...h.map((v) => v.getTime()))) : void 0\n };\n }\n function I() {\n e.value = [], t.value = -1;\n }\n function g(p, h) {\n return e.value.filter((v) => v.doctype === p && (h === void 0 || v.recordId === h));\n }\n function x(p, h) {\n const v = e.value.find((F) => F.id === p);\n v && (v.reversible = !1, v.irreversibleReason = h);\n }\n function L(p, h, v, F = \"success\", z) {\n const W = {\n type: \"action\",\n path: v && v.length > 0 ? `${p}.${v[0]}` : p,\n fieldname: \"\",\n beforeValue: null,\n afterValue: null,\n doctype: p,\n recordId: v && v.length > 0 ? v[0] : void 0,\n reversible: !1,\n // Actions are typically not reversible\n actionName: h,\n actionRecordIds: v,\n actionResult: F,\n actionError: z\n };\n return $(W);\n }\n let u = null;\n function f() {\n typeof window > \"u\" || !window.BroadcastChannel || (u = new BroadcastChannel(\"stonecrop-operation-log\"), u.addEventListener(\"message\", (p) => {\n const h = p.data;\n if (!h || typeof h != \"object\") return;\n const v = _t(h);\n v.clientId !== n.value && (v.type === \"operation\" && v.operation ? (e.value.push({ ...v.operation, source: \"sync\" }), t.value = e.value.length - 1) : v.type === \"operation\" && v.operations && (e.value.push(...v.operations.map((F) => ({ ...F, source: \"sync\" }))), t.value = e.value.length - 1));\n }));\n }\n function O(p) {\n if (!u) return;\n const h = {\n type: \"operation\",\n operation: p,\n clientId: n.value,\n timestamp: /* @__PURE__ */ new Date()\n };\n u.postMessage(de(h));\n }\n function y(p, h) {\n if (!u) return;\n const v = {\n type: \"operation\",\n operations: [...p, h],\n clientId: n.value,\n timestamp: /* @__PURE__ */ new Date()\n };\n u.postMessage(de(v));\n }\n function d(p) {\n if (!u) return;\n const h = {\n type: \"undo\",\n operation: p,\n clientId: n.value,\n timestamp: /* @__PURE__ */ new Date()\n };\n u.postMessage(de(h));\n }\n function m(p) {\n if (!u) return;\n const h = {\n type: \"redo\",\n operation: p,\n clientId: n.value,\n timestamp: /* @__PURE__ */ new Date()\n };\n u.postMessage(de(h));\n }\n const N = Et(\"stonecrop-ops-operations\", null, {\n serializer: {\n read: (p) => {\n try {\n return JSON.parse(p);\n } catch {\n return null;\n }\n },\n write: (p) => p ? JSON.stringify(p) : \"\"\n }\n });\n function A() {\n if (!(typeof window > \"u\"))\n try {\n const p = N.value;\n p && Array.isArray(p.operations) && (e.value = p.operations.map((h) => ({\n ...h,\n timestamp: new Date(h.timestamp)\n })), t.value = p.currentIndex ?? -1);\n } catch (p) {\n typeof console < \"u\" && console.error(\"Failed to load operations from persistence:\", p);\n }\n }\n function j() {\n if (!(typeof window > \"u\"))\n try {\n N.value = {\n operations: e.value.map((p) => ({\n ...p,\n timestamp: p.timestamp.toISOString()\n })),\n currentIndex: t.value\n };\n } catch (p) {\n typeof console < \"u\" && console.error(\"Failed to save operations to persistence:\", p);\n }\n }\n function V() {\n H(\n [e, t],\n () => {\n r.value.enablePersistence && j();\n },\n { deep: !0 }\n );\n }\n return {\n // State\n operations: e,\n currentIndex: t,\n config: r,\n clientId: n,\n undoRedoState: w,\n // Computed\n canUndo: a,\n canRedo: c,\n undoCount: l,\n redoCount: S,\n // Methods\n configure: P,\n addOperation: $,\n startBatch: T,\n commitBatch: k,\n cancelBatch: _,\n undo: D,\n redo: R,\n clear: I,\n getOperationsFor: g,\n getSnapshot: E,\n markIrreversible: x,\n logAction: L\n };\n});\nclass ie {\n /**\n * The root FieldTriggerEngine instance\n */\n static _root;\n options;\n doctypeActions = /* @__PURE__ */ new Map();\n // doctype -> action/field -> functions\n doctypeTransitions = /* @__PURE__ */ new Map();\n // doctype -> transition -> functions\n fieldRollbackConfig = /* @__PURE__ */ new Map();\n // doctype -> field -> rollback enabled\n globalActions = /* @__PURE__ */ new Map();\n // action name -> function\n globalTransitionActions = /* @__PURE__ */ new Map();\n // transition action name -> function\n /**\n * Creates a new FieldTriggerEngine instance (singleton pattern)\n * @param options - Configuration options for the field trigger engine\n */\n constructor(e = {}) {\n if (ie._root)\n return ie._root;\n ie._root = this, this.options = {\n defaultTimeout: e.defaultTimeout ?? 5e3,\n debug: e.debug ?? !1,\n enableRollback: e.enableRollback ?? !0,\n errorHandler: e.errorHandler\n };\n }\n /**\n * Register a global action function\n * @param name - The name of the action\n * @param fn - The action function\n */\n registerAction(e, t) {\n this.globalActions.set(e, t);\n }\n /**\n * Register a global XState transition action function\n * @param name - The name of the transition action\n * @param fn - The transition action function\n */\n registerTransitionAction(e, t) {\n this.globalTransitionActions.set(e, t);\n }\n /**\n * Configure rollback behavior for a specific field trigger\n * @param doctype - The doctype name\n * @param fieldname - The field name\n * @param enableRollback - Whether to enable rollback\n */\n setFieldRollback(e, t, n) {\n this.fieldRollbackConfig.has(e) || this.fieldRollbackConfig.set(e, /* @__PURE__ */ new Map()), this.fieldRollbackConfig.get(e).set(t, n);\n }\n /**\n * Get rollback configuration for a specific field trigger\n */\n getFieldRollback(e, t) {\n return this.fieldRollbackConfig.get(e)?.get(t);\n }\n /**\n * Register actions from a doctype - both regular actions and field triggers\n * Separates XState transitions (uppercase) from field triggers (lowercase)\n * @param doctype - The doctype name\n * @param actions - The actions to register (supports Immutable Map, Map, or plain object)\n */\n registerDoctypeActions(e, t) {\n if (!t) return;\n const n = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();\n if (typeof t.entrySeq == \"function\")\n t.entrySeq().forEach(([s, i]) => {\n this.categorizeAction(s, i, n, o);\n });\n else if (t instanceof Map)\n for (const [s, i] of t)\n this.categorizeAction(s, i, n, o);\n else t && typeof t == \"object\" && Object.entries(t).forEach(([s, i]) => {\n this.categorizeAction(s, i, n, o);\n });\n this.doctypeActions.set(e, n), this.doctypeTransitions.set(e, o);\n }\n /**\n * Categorize an action as either a field trigger or XState transition\n * Uses uppercase convention: UPPERCASE = transition, lowercase/mixed = field trigger\n */\n categorizeAction(e, t, n, o) {\n this.isTransitionKey(e) ? o.set(e, t) : n.set(e, t);\n }\n /**\n * Determine if a key represents an XState transition\n * Transitions are identified by being all uppercase\n */\n isTransitionKey(e) {\n return /^[A-Z0-9_]+$/.test(e) && e.length > 0;\n }\n /**\n * Execute field triggers for a changed field\n * @param context - The field change context\n * @param options - Execution options (timeout and enableRollback)\n */\n async executeFieldTriggers(e, t = {}) {\n const { doctype: n, fieldname: o } = e, s = this.findFieldTriggers(n, o);\n if (s.length === 0)\n return {\n path: e.path,\n actionResults: [],\n totalExecutionTime: 0,\n allSucceeded: !0,\n stoppedOnError: !1,\n rolledBack: !1\n };\n const i = performance.now(), a = [];\n let c = !1, l = !1, S;\n const w = this.getFieldRollback(n, o), P = t.enableRollback ?? w ?? this.options.enableRollback;\n P && e.store && (S = this.captureSnapshot(e));\n for (const _ of s)\n try {\n const D = await this.executeAction(_, e, t.timeout);\n if (a.push(D), !D.success) {\n c = !0;\n break;\n }\n } catch (D) {\n const b = {\n success: !1,\n error: D instanceof Error ? D : new Error(String(D)),\n executionTime: 0,\n action: _\n };\n a.push(b), c = !0;\n break;\n }\n if (P && c && S && e.store)\n try {\n this.restoreSnapshot(e, S), l = !0;\n } catch (_) {\n console.error(\"[FieldTriggers] Rollback failed:\", _);\n }\n const $ = performance.now() - i, T = a.filter((_) => !_.success);\n if (T.length > 0 && this.options.errorHandler)\n for (const _ of T)\n try {\n this.options.errorHandler(_.error, e, _.action);\n } catch (D) {\n console.error(\"[FieldTriggers] Error in global error handler:\", D);\n }\n return {\n path: e.path,\n actionResults: a,\n totalExecutionTime: $,\n allSucceeded: a.every((_) => _.success),\n stoppedOnError: c,\n rolledBack: l,\n snapshot: this.options.debug && P ? S : void 0\n // Only include snapshot in debug mode if rollback is enabled\n };\n }\n /**\n * Execute XState transition actions\n * Similar to field triggers but specifically for FSM state transitions\n * @param context - The transition change context\n * @param options - Execution options (timeout)\n */\n async executeTransitionActions(e, t = {}) {\n const { doctype: n, transition: o } = e, s = this.findTransitionActions(n, o);\n if (s.length === 0)\n return [];\n const i = [];\n for (const c of s)\n try {\n const l = await this.executeTransitionAction(c, e, t.timeout);\n if (i.push(l), !l.success)\n break;\n } catch (l) {\n const w = {\n success: !1,\n error: l instanceof Error ? l : new Error(String(l)),\n executionTime: 0,\n action: c,\n transition: o\n };\n i.push(w);\n break;\n }\n const a = i.filter((c) => !c.success);\n if (a.length > 0 && this.options.errorHandler)\n for (const c of a)\n try {\n this.options.errorHandler(c.error, e, c.action);\n } catch (l) {\n console.error(\"[FieldTriggers] Error in global error handler:\", l);\n }\n return i;\n }\n /**\n * Find transition actions for a specific doctype and transition\n */\n findTransitionActions(e, t) {\n const n = this.doctypeTransitions.get(e);\n return n ? n.get(t) || [] : [];\n }\n /**\n * Execute a single transition action by name\n */\n async executeTransitionAction(e, t, n) {\n const o = performance.now(), s = n ?? this.options.defaultTimeout;\n try {\n let i = this.globalTransitionActions.get(e);\n if (!i) {\n const c = this.globalActions.get(e);\n c && (i = c);\n }\n if (!i)\n throw new Error(`Transition action \"${e}\" not found in registry`);\n return await this.executeWithTimeout(i, t, s), {\n success: !0,\n executionTime: performance.now() - o,\n action: e,\n transition: t.transition\n };\n } catch (i) {\n const a = performance.now() - o;\n return {\n success: !1,\n error: i instanceof Error ? i : new Error(String(i)),\n executionTime: a,\n action: e,\n transition: t.transition\n };\n }\n }\n /**\n * Find field triggers for a specific doctype and field\n * Field triggers are identified by keys that look like field paths (contain dots or match field names)\n */\n findFieldTriggers(e, t) {\n const n = this.doctypeActions.get(e);\n if (!n) return [];\n const o = [];\n for (const [s, i] of n)\n this.isFieldTriggerKey(s, t) && o.push(...i);\n return o;\n }\n /**\n * Determine if an action key represents a field trigger\n * Field triggers can be:\n * - Exact field name match: \"emailAddress\"\n * - Wildcard patterns: \"emailAddress.*\", \"*.is_primary\"\n * - Nested field paths: \"address.street\", \"contact.email\"\n */\n isFieldTriggerKey(e, t) {\n return e === t ? !0 : e.includes(\".\") ? this.matchFieldPattern(e, t) : e.includes(\"*\") ? this.matchFieldPattern(e, t) : !1;\n }\n /**\n * Match a field pattern against a field name\n * Supports wildcards (*) for dynamic segments\n */\n matchFieldPattern(e, t) {\n const n = e.split(\".\"), o = t.split(\".\");\n if (n.length !== o.length)\n return !1;\n for (let s = 0; s < n.length; s++) {\n const i = n[s], a = o[s];\n if (i !== \"*\" && i !== a)\n return !1;\n }\n return !0;\n }\n /**\n * Execute a single action by name\n */\n async executeAction(e, t, n) {\n const o = performance.now(), s = n ?? this.options.defaultTimeout;\n try {\n const i = this.globalActions.get(e);\n if (!i)\n throw new Error(`Action \"${e}\" not found in registry`);\n return await this.executeWithTimeout(i, t, s), {\n success: !0,\n executionTime: performance.now() - o,\n action: e\n };\n } catch (i) {\n const a = performance.now() - o;\n return {\n success: !1,\n error: i instanceof Error ? i : new Error(String(i)),\n executionTime: a,\n action: e\n };\n }\n }\n /**\n * Execute a function with timeout\n */\n async executeWithTimeout(e, t, n) {\n return new Promise((o, s) => {\n const i = setTimeout(() => {\n s(new Error(`Action timeout after ${n}ms`));\n }, n);\n Promise.resolve(e(t)).then((a) => {\n clearTimeout(i), o(a);\n }).catch((a) => {\n clearTimeout(i), s(a);\n });\n });\n }\n /**\n * Capture a snapshot of the record state before executing actions\n * This creates a deep copy of the record data for potential rollback\n */\n captureSnapshot(e) {\n if (!(!e.store || !e.doctype || !e.recordId))\n try {\n const t = `${e.doctype}.${e.recordId}`, n = e.store.get(t);\n return !n || typeof n != \"object\" ? void 0 : JSON.parse(JSON.stringify(n));\n } catch (t) {\n this.options.debug && console.warn(\"[FieldTriggers] Failed to capture snapshot:\", t);\n return;\n }\n }\n /**\n * Restore a previously captured snapshot\n * This reverts the record to its state before actions were executed\n */\n restoreSnapshot(e, t) {\n if (!(!e.store || !e.doctype || !e.recordId || !t))\n try {\n const n = `${e.doctype}.${e.recordId}`;\n e.store.set(n, t), this.options.debug && console.log(`[FieldTriggers] Rolled back ${n} to previous state`);\n } catch (n) {\n throw console.error(\"[FieldTriggers] Failed to restore snapshot:\", n), n;\n }\n }\n}\nfunction G(r) {\n return new ie(r);\n}\nfunction Dt(r, e) {\n G().registerAction(r, e);\n}\nfunction Tt(r, e) {\n G().registerTransitionAction(r, e);\n}\nfunction Ct(r, e, t) {\n G().setFieldRollback(r, e, t);\n}\nasync function At(r, e, t) {\n const n = G(), o = {\n path: t?.path || (t?.recordId ? `${r}.${t.recordId}` : r),\n fieldname: \"\",\n beforeValue: void 0,\n afterValue: void 0,\n operation: \"set\",\n doctype: r,\n recordId: t?.recordId,\n timestamp: /* @__PURE__ */ new Date(),\n transition: e,\n currentState: t?.currentState,\n targetState: t?.targetState,\n fsmContext: t?.fsmContext\n };\n return await n.executeTransitionActions(o);\n}\nfunction Vt(r, e) {\n if (r)\n try {\n ue().markIrreversible(r, e);\n } catch {\n }\n}\nfunction Te() {\n try {\n return ue();\n } catch {\n return null;\n }\n}\nclass Q {\n static instance;\n /**\n * Gets the singleton instance of HST\n * @returns The HST singleton instance\n */\n static getInstance() {\n return Q.instance || (Q.instance = new Q()), Q.instance;\n }\n /**\n * Gets the global registry instance\n * @returns The global registry object or undefined if not found\n */\n getRegistry() {\n if (typeof globalThis < \"u\") {\n const e = globalThis.Registry?._root;\n if (e)\n return e;\n }\n if (typeof window < \"u\") {\n const e = window.Registry?._root;\n if (e)\n return e;\n }\n if (typeof global < \"u\" && global) {\n const e = global.Registry?._root;\n if (e)\n return e;\n }\n }\n /**\n * Helper method to get doctype metadata from the registry\n * @param doctype - The name of the doctype to retrieve metadata for\n * @returns The doctype metadata object or undefined if not found\n */\n getDoctypeMeta(e) {\n const t = this.getRegistry();\n if (t && typeof t == \"object\" && \"registry\" in t)\n return t.registry[e];\n }\n}\nclass ve {\n target;\n parentPath;\n rootNode;\n doctype;\n parentDoctype;\n hst;\n constructor(e, t, n = \"\", o = null, s) {\n return this.target = e, this.parentPath = n, this.rootNode = o || this, this.doctype = t, this.parentDoctype = s, this.hst = Q.getInstance(), new Proxy(this, {\n get(i, a) {\n if (a in i) return i[a];\n const c = String(a);\n return i.getNode(c);\n },\n set(i, a, c) {\n const l = String(a);\n return i.set(l, c), !0;\n }\n });\n }\n get(e) {\n return this.resolveValue(e);\n }\n // Method to get a tree-wrapped node for navigation\n getNode(e) {\n const t = this.resolvePath(e), n = this.resolveValue(e), o = t.split(\".\");\n let s = this.doctype;\n return this.doctype === \"StonecropStore\" && o.length >= 1 && (s = o[0]), typeof n == \"object\" && n !== null && !this.isPrimitive(n) ? new ve(n, s, t, this.rootNode, this.parentDoctype) : new ve(n, s, t, this.rootNode, this.parentDoctype);\n }\n set(e, t, n = \"user\") {\n const o = this.resolvePath(e), s = this.has(e) ? this.get(e) : void 0;\n if (n !== \"undo\" && n !== \"redo\") {\n const i = Te();\n if (i && typeof i.addOperation == \"function\") {\n const a = o.split(\".\"), c = this.doctype === \"StonecropStore\" && a.length >= 1 ? a[0] : this.doctype, l = a.length >= 2 ? a[1] : void 0, S = a.slice(2).join(\".\") || a[a.length - 1], P = t === void 0 && s !== void 0 ? \"delete\" : \"set\";\n i.addOperation(\n {\n type: P,\n path: o,\n fieldname: S,\n beforeValue: s,\n afterValue: t,\n doctype: c,\n recordId: l,\n reversible: !0\n // Default to reversible, can be changed by field triggers\n },\n n\n );\n }\n }\n this.updateValue(e, t), this.triggerFieldActions(o, s, t);\n }\n has(e) {\n try {\n if (e === \"\")\n return !0;\n const t = this.parsePath(e);\n let n = this.target;\n for (let o = 0; o < t.length; o++) {\n const s = t[o];\n if (n == null)\n return !1;\n if (o === t.length - 1)\n return this.isImmutable(n) ? n.has(s) : this.isPiniaStore(n) && n.$state && s in n.$state || s in n;\n n = this.getProperty(n, s);\n }\n return !1;\n } catch {\n return !1;\n }\n }\n // Tree navigation methods\n getParent() {\n if (!this.parentPath) return null;\n const t = this.parentPath.split(\".\").slice(0, -1).join(\".\");\n return t === \"\" ? this.rootNode : this.rootNode.getNode(t);\n }\n getRoot() {\n return this.rootNode;\n }\n getPath() {\n return this.parentPath;\n }\n getDepth() {\n return this.parentPath ? this.parentPath.split(\".\").length : 0;\n }\n getBreadcrumbs() {\n return this.parentPath ? this.parentPath.split(\".\") : [];\n }\n /**\n * Trigger an XState transition with optional context data\n */\n async triggerTransition(e, t) {\n const n = G(), o = this.parentPath.split(\".\");\n let s = this.doctype, i;\n this.doctype === \"StonecropStore\" && o.length >= 1 && (s = o[0]), o.length >= 2 && (i = o[1]);\n const a = {\n path: this.parentPath,\n fieldname: \"\",\n // No specific field for transitions\n beforeValue: void 0,\n afterValue: void 0,\n operation: \"set\",\n doctype: s,\n recordId: i,\n timestamp: /* @__PURE__ */ new Date(),\n store: this.rootNode || void 0,\n transition: e,\n currentState: t?.currentState,\n targetState: t?.targetState,\n fsmContext: t?.fsmContext\n }, c = Te();\n return c && typeof c.addOperation == \"function\" && c.addOperation(\n {\n type: \"transition\",\n path: this.parentPath,\n fieldname: e,\n beforeValue: t?.currentState,\n afterValue: t?.targetState,\n doctype: s,\n recordId: i,\n reversible: !1,\n // FSM transitions are generally not reversible\n metadata: {\n transition: e,\n currentState: t?.currentState,\n targetState: t?.targetState,\n fsmContext: t?.fsmContext\n }\n },\n \"user\"\n ), await n.executeTransitionActions(a);\n }\n // Private helper methods\n resolvePath(e) {\n return e === \"\" ? this.parentPath : this.parentPath ? `${this.parentPath}.${e}` : e;\n }\n resolveValue(e) {\n if (e === \"\")\n return this.target;\n const t = this.parsePath(e);\n let n = this.target;\n for (const o of t) {\n if (n == null)\n return;\n n = this.getProperty(n, o);\n }\n return n;\n }\n updateValue(e, t) {\n if (e === \"\")\n throw new Error(\"Cannot set value on empty path\");\n const n = this.parsePath(e), o = n.pop();\n let s = this.target;\n for (const i of n)\n if (s = this.getProperty(s, i), s == null)\n throw new Error(`Cannot set property on null/undefined path: ${e}`);\n this.setProperty(s, o, t);\n }\n getProperty(e, t) {\n return this.isImmutable(e) ? e.get(t) : this.isVueReactive(e) ? e[t] : this.isPiniaStore(e) ? e.$state?.[t] ?? e[t] : e[t];\n }\n setProperty(e, t, n) {\n if (this.isImmutable(e))\n throw new Error(\"Cannot directly mutate immutable objects. Use immutable update methods instead.\");\n if (this.isPiniaStore(e)) {\n e.$patch ? e.$patch({ [t]: n }) : e[t] = n;\n return;\n }\n e[t] = n;\n }\n async triggerFieldActions(e, t, n) {\n try {\n if (!e || typeof e != \"string\")\n return;\n const o = e.split(\".\");\n if (o.length < 3)\n return;\n const s = G(), i = o.slice(2).join(\".\") || o[o.length - 1];\n let a = this.doctype;\n this.doctype === \"StonecropStore\" && o.length >= 1 && (a = o[0]);\n let c;\n o.length >= 2 && (c = o[1]);\n const l = {\n path: e,\n fieldname: i,\n beforeValue: t,\n afterValue: n,\n operation: \"set\",\n doctype: a,\n recordId: c,\n timestamp: /* @__PURE__ */ new Date(),\n store: this.rootNode || void 0\n // Pass the root store for snapshot/rollback capabilities\n };\n await s.executeFieldTriggers(l);\n } catch (o) {\n o instanceof Error && console.warn(\"Field trigger error:\", o.message);\n }\n }\n isVueReactive(e) {\n return e && typeof e == \"object\" && \"__v_isReactive\" in e && e.__v_isReactive === !0;\n }\n isPiniaStore(e) {\n return e && typeof e == \"object\" && (\"$state\" in e || \"$patch\" in e || \"$id\" in e);\n }\n isImmutable(e) {\n if (!e || typeof e != \"object\")\n return !1;\n const t = \"get\" in e && typeof e.get == \"function\", n = \"set\" in e && typeof e.set == \"function\", o = \"has\" in e && typeof e.has == \"function\", s = \"__ownerID\" in e || \"_map\" in e || \"_list\" in e || \"_origin\" in e || \"_capacity\" in e || \"_defaultValues\" in e || \"_tail\" in e || \"_root\" in e || \"size\" in e && t && n;\n let i;\n try {\n const c = e;\n if (\"constructor\" in c && c.constructor && typeof c.constructor == \"object\" && \"name\" in c.constructor) {\n const l = c.constructor.name;\n i = typeof l == \"string\" ? l : void 0;\n }\n } catch {\n i = void 0;\n }\n const a = i && (i.includes(\"Map\") || i.includes(\"List\") || i.includes(\"Set\") || i.includes(\"Stack\") || i.includes(\"Seq\")) && (t || n);\n return !!(t && n && o && s || t && n && a);\n }\n isPrimitive(e) {\n return e == null || typeof e == \"string\" || typeof e == \"number\" || typeof e == \"boolean\" || typeof e == \"function\" || typeof e == \"symbol\" || typeof e == \"bigint\";\n }\n parsePath(e) {\n return e ? e.split(\".\").filter((t) => t.length > 0) : [];\n }\n}\nfunction Pt(r, e, t) {\n return new ve(r, e, \"\", null, t);\n}\nclass He {\n hstStore;\n _operationLogStore;\n _operationLogConfig;\n /** The registry instance containing all doctype definitions */\n registry;\n /**\n * Creates a new Stonecrop instance with HST integration\n * @param registry - The Registry instance containing doctype definitions\n * @param operationLogConfig - Optional configuration for the operation log\n */\n constructor(e, t) {\n this.registry = e, this._operationLogConfig = t, this.initializeHSTStore(), this.setupRegistrySync();\n }\n /**\n * Get the operation log store (lazy initialization)\n * @internal\n */\n getOperationLogStore() {\n return this._operationLogStore || (this._operationLogStore = ue(), this._operationLogConfig && this._operationLogStore.configure(this._operationLogConfig)), this._operationLogStore;\n }\n /**\n * Initialize the HST store structure\n */\n initializeHSTStore() {\n const e = {};\n Object.keys(this.registry.registry).forEach((t) => {\n e[t] = {};\n }), this.hstStore = Pt(e, \"StonecropStore\");\n }\n /**\n * Setup automatic sync with Registry when doctypes are added\n */\n setupRegistrySync() {\n const e = this.registry.addDoctype.bind(this.registry);\n this.registry.addDoctype = (t) => {\n e(t), this.hstStore.has(t.slug) || this.hstStore.set(t.slug, {});\n };\n }\n /**\n * Get records hash for a doctype\n * @param doctype - The doctype to get records for\n * @returns HST node containing records hash\n */\n records(e) {\n const t = typeof e == \"string\" ? e : e.slug;\n return this.ensureDoctypeExists(t), this.hstStore.getNode(t);\n }\n /**\n * Add a record to the store\n * @param doctype - The doctype\n * @param recordId - The record ID\n * @param recordData - The record data\n */\n addRecord(e, t, n) {\n const o = typeof e == \"string\" ? e : e.slug;\n this.ensureDoctypeExists(o), this.hstStore.set(`${o}.${t}`, n);\n }\n /**\n * Get a specific record\n * @param doctype - The doctype\n * @param recordId - The record ID\n * @returns HST node for the record or undefined\n */\n getRecordById(e, t) {\n const n = typeof e == \"string\" ? e : e.slug;\n if (this.ensureDoctypeExists(n), !(!this.hstStore.has(`${n}.${t}`) || this.hstStore.get(`${n}.${t}`) === void 0))\n return this.hstStore.getNode(`${n}.${t}`);\n }\n /**\n * Remove a record from the store\n * @param doctype - The doctype\n * @param recordId - The record ID\n */\n removeRecord(e, t) {\n const n = typeof e == \"string\" ? e : e.slug;\n this.ensureDoctypeExists(n), this.hstStore.has(`${n}.${t}`) && this.hstStore.set(`${n}.${t}`, void 0);\n }\n /**\n * Get all record IDs for a doctype\n * @param doctype - The doctype\n * @returns Array of record IDs\n */\n getRecordIds(e) {\n const t = typeof e == \"string\" ? e : e.slug;\n this.ensureDoctypeExists(t);\n const n = this.hstStore.get(t);\n return !n || typeof n != \"object\" ? [] : Object.keys(n).filter((o) => n[o] !== void 0);\n }\n /**\n * Clear all records for a doctype\n * @param doctype - The doctype\n */\n clearRecords(e) {\n const t = typeof e == \"string\" ? e : e.slug;\n this.ensureDoctypeExists(t), this.getRecordIds(t).forEach((o) => {\n this.hstStore.set(`${t}.${o}`, void 0);\n });\n }\n /**\n * Setup method for doctype initialization\n * @param doctype - The doctype to setup\n */\n setup(e) {\n this.ensureDoctypeExists(e.slug);\n }\n /**\n * Run action on doctype\n * Executes the action and logs it to the operation log for audit tracking\n * @param doctype - The doctype\n * @param action - The action to run\n * @param args - Action arguments (typically record IDs)\n */\n runAction(e, t, n) {\n const s = this.registry.registry[e.slug]?.actions?.get(t), i = Array.isArray(n) ? n.filter((S) => typeof S == \"string\") : void 0, a = this.getOperationLogStore();\n let c = \"success\", l;\n try {\n s && s.length > 0 && s.forEach((S) => {\n try {\n new Function(\"args\", S)(n);\n } catch (w) {\n throw c = \"failure\", l = w instanceof Error ? w.message : \"Unknown error\", w;\n }\n });\n } catch {\n } finally {\n a.logAction(e.doctype, t, i, c, l);\n }\n }\n /**\n * Get records from server (maintains compatibility)\n * @param doctype - The doctype\n */\n async getRecords(e) {\n (await (await fetch(`/${e.slug}`)).json()).forEach((o) => {\n o.id && this.addRecord(e, o.id, o);\n });\n }\n /**\n * Get single record from server (maintains compatibility)\n * @param doctype - The doctype\n * @param recordId - The record ID\n */\n async getRecord(e, t) {\n const o = await (await fetch(`/${e.slug}/${t}`)).json();\n this.addRecord(e, t, o);\n }\n /**\n * Ensure doctype section exists in HST store\n * @param slug - The doctype slug\n */\n ensureDoctypeExists(e) {\n this.hstStore.has(e) || this.hstStore.set(e, {});\n }\n /**\n * Get doctype metadata from the registry\n * @param context - The route context\n * @returns The doctype metadata\n */\n async getMeta(e) {\n if (!this.registry.getMeta)\n throw new Error(\"No getMeta function provided to Registry\");\n return await this.registry.getMeta(e);\n }\n /**\n * Get the root HST store node for advanced usage\n * @returns Root HST node\n */\n getStore() {\n return this.hstStore;\n }\n}\nfunction Ft(r) {\n r || (r = {});\n const e = r.registry || he(\"$registry\"), t = he(\"$stonecrop\"), n = M(), o = M(), s = M({}), i = M(), a = M(), c = M([]), l = M(-1), S = B(() => n.value?.getOperationLogStore().canUndo ?? !1), w = B(() => n.value?.getOperationLogStore().canRedo ?? !1), P = B(() => n.value?.getOperationLogStore().undoCount ?? 0), $ = B(() => n.value?.getOperationLogStore().redoCount ?? 0), T = B(\n () => n.value?.getOperationLogStore().undoRedoState ?? {\n canUndo: !1,\n canRedo: !1,\n undoCount: 0,\n redoCount: 0,\n currentIndex: -1\n }\n ), k = (y) => n.value?.getOperationLogStore().undo(y) ?? !1, _ = (y) => n.value?.getOperationLogStore().redo(y) ?? !1, D = () => {\n n.value?.getOperationLogStore().startBatch();\n }, R = (y) => n.value?.getOperationLogStore().commitBatch(y) ?? null, b = () => {\n n.value?.getOperationLogStore().cancelBatch();\n }, C = () => {\n n.value?.getOperationLogStore().clear();\n }, E = (y, d) => n.value?.getOperationLogStore().getOperationsFor(y, d) ?? [], I = () => n.value?.getOperationLogStore().getSnapshot() ?? {\n operations: [],\n currentIndex: -1,\n totalOperations: 0,\n reversibleOperations: 0,\n irreversibleOperations: 0\n }, g = (y, d) => {\n n.value?.getOperationLogStore().markIrreversible(y, d);\n }, x = (y, d, m, N = \"success\", A) => n.value?.getOperationLogStore().logAction(y, d, m, N, A) ?? \"\", L = (y) => {\n n.value?.getOperationLogStore().configure(y);\n };\n Le(async () => {\n if (e) {\n n.value = t || new He(e);\n try {\n const y = n.value.getOperationLogStore(), d = Ue(y);\n c.value = d.operations.value, l.value = d.currentIndex.value, H(\n () => d.operations.value,\n (m) => {\n c.value = m;\n }\n ), H(\n () => d.currentIndex.value,\n (m) => {\n l.value = m;\n }\n );\n } catch {\n }\n if (!r.doctype && e.router) {\n const y = e.router.currentRoute.value;\n if (!y.path) return;\n const d = y.path.split(\"/\").filter((N) => N.length > 0), m = d[1]?.toLowerCase();\n if (d.length > 0) {\n const N = {\n path: y.path,\n segments: d\n }, A = await e.getMeta?.(N);\n if (A) {\n if (e.addDoctype(A), n.value.setup(A), i.value = A, a.value = m, o.value = n.value.getStore(), m && m !== \"new\") {\n const j = n.value.getRecordById(A, m);\n if (j)\n s.value = j.get(\"\") || {};\n else\n try {\n await n.value.getRecord(A, m);\n const V = n.value.getRecordById(A, m);\n V && (s.value = V.get(\"\") || {});\n } catch {\n s.value = pe(A);\n }\n } else\n s.value = pe(A);\n o.value && Ce(A, m || \"new\", s, o.value), n.value.runAction(A, \"load\", m ? [m] : void 0);\n }\n }\n }\n if (r.doctype) {\n o.value = n.value.getStore();\n const y = r.doctype, d = r.recordId;\n if (d && d !== \"new\") {\n const m = n.value.getRecordById(y, d);\n if (m)\n s.value = m.get(\"\") || {};\n else\n try {\n await n.value.getRecord(y, d);\n const N = n.value.getRecordById(y, d);\n N && (s.value = N.get(\"\") || {});\n } catch {\n s.value = pe(y);\n }\n } else\n s.value = pe(y);\n o.value && Ce(y, d || \"new\", s, o.value);\n }\n }\n });\n const u = (y, d) => {\n const m = r.doctype || i.value;\n if (!m) return \"\";\n const N = d || r.recordId || a.value || \"new\";\n return `${m.slug}.${N}.${y}`;\n }, f = (y) => {\n const d = r.doctype || i.value;\n if (!(!o.value || !n.value || !d))\n try {\n const m = y.path.split(\".\");\n if (m.length >= 2) {\n const j = m[0], V = m[1];\n if (o.value.has(`${j}.${V}`) || n.value.addRecord(d, V, { ...s.value }), m.length > 3) {\n const p = `${j}.${V}`, h = m.slice(2);\n let v = p;\n for (let F = 0; F < h.length - 1; F++)\n if (v += `.${h[F]}`, !o.value.has(v)) {\n const z = h[F + 1], W = !isNaN(Number(z));\n o.value.set(v, W ? [] : {});\n }\n }\n }\n o.value.set(y.path, y.value);\n const N = y.fieldname.split(\".\"), A = { ...s.value };\n N.length === 1 ? A[N[0]] = y.value : Nt(A, N, y.value), s.value = A;\n } catch {\n }\n };\n (r.doctype || e?.router) && (_e(\"hstPathProvider\", u), _e(\"hstChangeHandler\", f));\n const O = {\n operations: c,\n currentIndex: l,\n undoRedoState: T,\n canUndo: S,\n canRedo: w,\n undoCount: P,\n redoCount: $,\n undo: k,\n redo: _,\n startBatch: D,\n commitBatch: R,\n cancelBatch: b,\n clear: C,\n getOperationsFor: E,\n getSnapshot: I,\n markIrreversible: g,\n logAction: x,\n configure: L\n };\n return r.doctype ? {\n stonecrop: n,\n operationLog: O,\n provideHSTPath: u,\n handleHSTChange: f,\n hstStore: o,\n formData: s\n } : !r.doctype && e?.router ? {\n stonecrop: n,\n operationLog: O,\n provideHSTPath: u,\n handleHSTChange: f,\n hstStore: o,\n formData: s\n } : {\n stonecrop: n,\n operationLog: O\n };\n}\nfunction pe(r) {\n const e = {};\n return r.schema && r.schema.forEach((t) => {\n switch (\"fieldtype\" in t ? t.fieldtype : \"Data\") {\n case \"Data\":\n case \"Text\":\n e[t.fieldname] = \"\";\n break;\n case \"Check\":\n e[t.fieldname] = !1;\n break;\n case \"Int\":\n case \"Float\":\n e[t.fieldname] = 0;\n break;\n case \"Table\":\n e[t.fieldname] = [];\n break;\n case \"JSON\":\n e[t.fieldname] = {};\n break;\n default:\n e[t.fieldname] = null;\n }\n }), e;\n}\nfunction Ce(r, e, t, n) {\n H(\n t,\n (o) => {\n const s = `${r.slug}.${e}`;\n Object.keys(o).forEach((i) => {\n const a = `${s}.${i}`;\n try {\n n.set(a, o[i]);\n } catch {\n }\n });\n },\n { deep: !0 }\n );\n}\nfunction Nt(r, e, t) {\n let n = r;\n for (let s = 0; s < e.length - 1; s++) {\n const i = e[s];\n (!(i in n) || typeof n[i] != \"object\") && (n[i] = isNaN(Number(e[s + 1])) ? {} : []), n = n[i];\n }\n const o = e[e.length - 1];\n n[o] = t;\n}\nfunction Je(r) {\n const t = he(\"$operationLogStore\", void 0) || ue();\n r && t.configure(r);\n const { operations: n, currentIndex: o, undoRedoState: s, canUndo: i, canRedo: a, undoCount: c, redoCount: l } = Ue(t);\n function S(E) {\n return t.undo(E);\n }\n function w(E) {\n return t.redo(E);\n }\n function P() {\n t.startBatch();\n }\n function $(E) {\n return t.commitBatch(E);\n }\n function T() {\n t.cancelBatch();\n }\n function k() {\n t.clear();\n }\n function _(E, I) {\n return t.getOperationsFor(E, I);\n }\n function D() {\n return t.getSnapshot();\n }\n function R(E, I) {\n t.markIrreversible(E, I);\n }\n function b(E, I, g, x = \"success\", L) {\n return t.logAction(E, I, g, x, L);\n }\n function C(E) {\n t.configure(E);\n }\n return {\n // State\n operations: n,\n currentIndex: o,\n undoRedoState: s,\n canUndo: i,\n canRedo: a,\n undoCount: c,\n redoCount: l,\n // Methods\n undo: S,\n redo: w,\n startBatch: P,\n commitBatch: $,\n cancelBatch: T,\n clear: k,\n getOperationsFor: _,\n getSnapshot: D,\n markIrreversible: R,\n logAction: b,\n configure: C\n };\n}\nfunction kt(r, e = !0) {\n if (!e) return;\n const { undo: t, redo: n, canUndo: o, canRedo: s } = Je(), i = Rt();\n ee(i[\"Ctrl+Z\"], () => {\n o.value && t(r);\n }), ee(i[\"Meta+Z\"], () => {\n o.value && t(r);\n }), ee(i[\"Ctrl+Shift+Z\"], () => {\n s.value && n(r);\n }), ee(i[\"Meta+Shift+Z\"], () => {\n s.value && n(r);\n }), ee(i[\"Ctrl+Y\"], () => {\n s.value && n(r);\n });\n}\nasync function Lt(r, e) {\n const { startBatch: t, commitBatch: n, cancelBatch: o } = Je();\n t();\n try {\n return await r(), n(e);\n } catch (s) {\n throw o(), s;\n }\n}\nclass Mt {\n /**\n * The doctype name\n * @public\n * @readonly\n */\n doctype;\n /**\n * The doctype schema\n * @public\n * @readonly\n */\n schema;\n /**\n * The doctype workflow\n * @public\n * @readonly\n */\n workflow;\n /**\n * The doctype actions and field triggers\n * @public\n * @readonly\n */\n actions;\n /**\n * The doctype component\n * @public\n * @readonly\n */\n component;\n /**\n * Creates a new DoctypeMeta instance\n * @param doctype - The doctype name\n * @param schema - The doctype schema definition\n * @param workflow - The doctype workflow configuration (XState machine)\n * @param actions - The doctype actions and field triggers\n * @param component - Optional Vue component for rendering the doctype\n */\n constructor(e, t, n, o, s) {\n this.doctype = e, this.schema = t, this.workflow = n, this.actions = o, this.component = s;\n }\n /**\n * Converts the registered doctype string to a slug (kebab-case). The following conversions are made:\n * - It replaces camelCase and PascalCase with kebab-case strings\n * - It replaces spaces and underscores with hyphens\n * - It converts the string to lowercase\n *\n * @returns The slugified doctype string\n *\n * @example\n * ```ts\n * const doctype = new DoctypeMeta('TaskItem', schema, workflow, actions\n * console.log(doctype.slug) // 'task-item'\n * ```\n *\n * @public\n */\n get slug() {\n return this.doctype.replace(/([a-z])([A-Z])/g, \"$1-$2\").replace(/[\\s_]+/g, \"-\").toLowerCase();\n }\n}\nclass ae {\n /**\n * The root Registry instance\n */\n static _root;\n /**\n * The name of the Registry instance\n *\n * @defaultValue 'Registry'\n */\n name;\n /**\n * The registry property contains a collection of doctypes\n * @see {@link DoctypeMeta}\n */\n registry;\n /**\n * The Vue router instance\n * @see {@link https://router.vuejs.org/}\n */\n router;\n /**\n * Creates a new Registry instance (singleton pattern)\n * @param router - Optional Vue router instance for route management\n * @param getMeta - Optional function to fetch doctype metadata from an API\n */\n constructor(e, t) {\n if (ae._root)\n return ae._root;\n ae._root = this, this.name = \"Registry\", this.registry = {}, this.router = e, this.getMeta = t;\n }\n /**\n * The getMeta function fetches doctype metadata from an API based on route context\n * @see {@link DoctypeMeta}\n */\n getMeta;\n /**\n * Get doctype metadata\n * @param doctype - The doctype to fetch metadata for\n * @returns The doctype metadata\n * @see {@link DoctypeMeta}\n */\n addDoctype(e) {\n e.doctype in Object.keys(this.registry) || (this.registry[e.slug] = e);\n const t = G();\n t.registerDoctypeActions(e.doctype, e.actions), e.slug !== e.doctype && t.registerDoctypeActions(e.slug, e.actions), e.component && this.router && !this.router.hasRoute(e.doctype) && this.router.addRoute({\n path: `/${e.slug}`,\n name: e.slug,\n component: e.component\n });\n }\n // TODO: should we allow clearing the registry at all?\n // clear() {\n // \tthis.registry = {}\n // \tif (this.router) {\n // \t\tconst routes = this.router.getRoutes()\n // \t\tfor (const route of routes) {\n // \t\t\tif (route.name) {\n // \t\t\t\tthis.router.removeRoute(route.name)\n // \t\t\t}\n // \t\t}\n // \t}\n // }\n}\nasync function It(r, e, t) {\n await ce();\n try {\n await t(r, e);\n } catch {\n }\n}\nconst xt = {\n install: (r, e) => {\n const t = r.config.globalProperties.$router, n = e?.router, o = t || n;\n !t && n && r.use(n);\n const s = new ae(o, e?.getMeta);\n r.provide(\"$registry\", s), r.config.globalProperties.$registry = s;\n const i = new He(s);\n r.provide(\"$stonecrop\", i), r.config.globalProperties.$stonecrop = i;\n try {\n const a = r.config.globalProperties.$pinia;\n if (a) {\n const c = ue(a);\n r.provide(\"$operationLogStore\", c), r.config.globalProperties.$operationLogStore = c;\n }\n } catch (a) {\n console.warn(\"Pinia not available - operation log features will be disabled:\", a);\n }\n if (e?.components)\n for (const [a, c] of Object.entries(e.components))\n r.component(a, c);\n e?.autoInitializeRouter && e.onRouterInitialized && It(s, i, e.onRouterInitialized);\n }\n};\nexport {\n Mt as DoctypeMeta,\n Q as HST,\n ae as Registry,\n He as Stonecrop,\n Pt as createHST,\n xt as default,\n G as getGlobalTriggerEngine,\n Vt as markOperationIrreversible,\n Dt as registerGlobalAction,\n Tt as registerTransitionAction,\n Ct as setFieldRollback,\n At as triggerTransition,\n Je as useOperationLog,\n ue as useOperationLogStore,\n Ft as useStonecrop,\n kt as useUndoRedoShortcuts,\n Lt as withBatch\n};\n//# sourceMappingURL=stonecrop.js.map\n","import { defineComponent as C, mergeModels as z, useModel as q, createElementBlock as b, openBlock as g, createElementVNode as c, withDirectives as M, toDisplayString as I, vModelCheckbox as Pe, vShow as U, resolveComponent as Fe, createBlock as le, withCtx as Re, useTemplateRef as Ee, vModelText as H, watch as F, getCurrentScope as Me, onScopeDispose as Ie, toRef as Oe, readonly as Ae, ref as D, customRef as He, computed as T, watchEffect as ae, toValue as w, unref as S, shallowRef as G, reactive as Be, normalizeClass as X, withKeys as R, Fragment as j, renderList as Y, withModifiers as Te, onMounted as se, onBeforeUnmount as qe, getCurrentInstance as Ue, nextTick as We, resolveDynamicComponent as Ne, mergeProps as je, renderSlot as Ye, createTextVNode as Ce, createCommentVNode as re, createVNode as Ke } from \"vue\";\nimport './assets/index.css';const ze = { class: \"aform_form-element\" }, Ge = [\"for\"], Je = { class: \"aform_checkbox-container aform_input-field\" }, Qe = [\"id\", \"readonly\", \"required\"], Xe = [\"innerHTML\"], Ze = /* @__PURE__ */ C({\n __name: \"ACheckbox\",\n props: /* @__PURE__ */ z({\n schema: {},\n label: {},\n mask: {},\n required: { type: Boolean },\n readonly: { type: Boolean },\n uuid: {},\n validation: { default: () => ({ errorMessage: \"&nbsp;\" }) }\n }, {\n modelValue: {},\n modelModifiers: {}\n }),\n emits: [\"update:modelValue\"],\n setup(e) {\n const t = q(e, \"modelValue\");\n return (n, o) => (g(), b(\"div\", ze, [\n c(\"label\", {\n class: \"aform_field-label\",\n for: e.uuid\n }, I(e.label), 9, Ge),\n c(\"span\", Je, [\n M(c(\"input\", {\n id: e.uuid,\n \"onUpdate:modelValue\": o[0] || (o[0] = (r) => t.value = r),\n type: \"checkbox\",\n class: \"aform_checkbox\",\n readonly: e.readonly,\n required: e.required\n }, null, 8, Qe), [\n [Pe, t.value]\n ])\n ]),\n M(c(\"p\", {\n class: \"aform_error\",\n innerHTML: e.validation.errorMessage\n }, null, 8, Xe), [\n [U, e.validation.errorMessage]\n ])\n ]));\n }\n}), L = (e, t) => {\n const n = e.__vccOpts || e;\n for (const [o, r] of t)\n n[o] = r;\n return n;\n}, et = /* @__PURE__ */ L(Ze, [[\"__scopeId\", \"data-v-aaa1a4c4\"]]), tt = /* @__PURE__ */ C({\n __name: \"AComboBox\",\n props: [\"event\", \"cellData\", \"tableID\"],\n setup(e) {\n return (t, n) => {\n const o = Fe(\"ATableModal\");\n return g(), le(o, {\n event: e.event,\n \"cell-data\": e.cellData,\n class: \"amodal\"\n }, {\n default: Re(() => [...n[0] || (n[0] = [\n c(\"div\", null, [\n c(\"input\", { type: \"text\" }),\n c(\"input\", { type: \"text\" }),\n c(\"input\", { type: \"text\" })\n ], -1)\n ])]),\n _: 1\n }, 8, [\"event\", \"cell-data\"]);\n };\n }\n}), nt = [\"id\", \"disabled\", \"required\"], ot = [\"for\"], lt = [\"innerHTML\"], at = /* @__PURE__ */ C({\n __name: \"ADate\",\n props: /* @__PURE__ */ z({\n schema: {},\n label: { default: \"Date\" },\n mask: {},\n required: { type: Boolean },\n readonly: { type: Boolean },\n uuid: {},\n validation: { default: () => ({ errorMessage: \"&nbsp;\" }) }\n }, {\n modelValue: {\n // format the date to be compatible with the native input datepicker\n },\n modelModifiers: {}\n }),\n emits: [\"update:modelValue\"],\n setup(e) {\n const t = q(e, \"modelValue\", {\n // format the date to be compatible with the native input datepicker\n set: (r) => new Date(r).toISOString().split(\"T\")[0]\n }), n = Ee(\"date\"), o = () => {\n n.value && \"showPicker\" in HTMLInputElement.prototype && n.value.showPicker();\n };\n return (r, u) => (g(), b(\"div\", null, [\n M(c(\"input\", {\n id: e.uuid,\n ref: \"date\",\n \"onUpdate:modelValue\": u[0] || (u[0] = (s) => t.value = s),\n type: \"date\",\n disabled: e.readonly,\n required: e.required,\n onClick: o\n }, null, 8, nt), [\n [H, t.value]\n ]),\n c(\"label\", { for: e.uuid }, I(e.label), 9, ot),\n M(c(\"p\", {\n innerHTML: e.validation.errorMessage\n }, null, 8, lt), [\n [U, e.validation.errorMessage]\n ])\n ]));\n }\n}), st = /* @__PURE__ */ L(at, [[\"__scopeId\", \"data-v-455d9e30\"]]);\nfunction ie(e, t) {\n return Me() ? (Ie(e, t), !0) : !1;\n}\n// @__NO_SIDE_EFFECTS__\nfunction ve() {\n const e = /* @__PURE__ */ new Set(), t = (u) => {\n e.delete(u);\n };\n return {\n on: (u) => {\n e.add(u);\n const s = () => t(u);\n return ie(s), { off: s };\n },\n off: t,\n trigger: (...u) => Promise.all(Array.from(e).map((s) => s(...u))),\n clear: () => {\n e.clear();\n }\n };\n}\nconst $e = typeof window < \"u\" && typeof document < \"u\";\ntypeof WorkerGlobalScope < \"u\" && globalThis instanceof WorkerGlobalScope;\nconst rt = Object.prototype.toString, it = (e) => rt.call(e) === \"[object Object]\", N = () => {\n}, ut = (e, t) => Object.prototype.hasOwnProperty.call(e, t);\nfunction ct(...e) {\n if (e.length !== 1) return Oe(...e);\n const t = e[0];\n return typeof t == \"function\" ? Ae(He(() => ({\n get: t,\n set: N\n }))) : D(t);\n}\nfunction Z(e) {\n return Array.isArray(e) ? e : [e];\n}\nfunction dt(e, t, n) {\n return F(e, t, {\n ...n,\n immediate: !0\n });\n}\nconst Se = $e ? window : void 0, ft = $e ? window.document : void 0;\nfunction O(e) {\n var t;\n const n = w(e);\n return (t = n?.$el) !== null && t !== void 0 ? t : n;\n}\nfunction ee(...e) {\n const t = [], n = () => {\n t.forEach((l) => l()), t.length = 0;\n }, o = (l, a, i, f) => (l.addEventListener(a, i, f), () => l.removeEventListener(a, i, f)), r = T(() => {\n const l = Z(w(e[0])).filter((a) => a != null);\n return l.every((a) => typeof a != \"string\") ? l : void 0;\n }), u = dt(() => {\n var l, a;\n return [\n (l = (a = r.value) === null || a === void 0 ? void 0 : a.map((i) => O(i))) !== null && l !== void 0 ? l : [Se].filter((i) => i != null),\n Z(w(r.value ? e[1] : e[0])),\n Z(S(r.value ? e[2] : e[1])),\n w(r.value ? e[3] : e[2])\n ];\n }, ([l, a, i, f]) => {\n if (n(), !l?.length || !a?.length || !i?.length) return;\n const v = it(f) ? { ...f } : f;\n t.push(...l.flatMap((d) => a.flatMap((p) => i.map((k) => o(d, p, k, v)))));\n }, { flush: \"post\" }), s = () => {\n u(), n();\n };\n return ie(n), s;\n}\nfunction pe(e, t, n = {}) {\n const { window: o = Se, ignore: r = [], capture: u = !0, detectIframe: s = !1, controls: l = !1 } = n;\n if (!o) return l ? {\n stop: N,\n cancel: N,\n trigger: N\n } : N;\n let a = !0;\n const i = (m) => w(r).some((h) => {\n if (typeof h == \"string\") return Array.from(o.document.querySelectorAll(h)).some((E) => E === m.target || m.composedPath().includes(E));\n {\n const E = O(h);\n return E && (m.target === E || m.composedPath().includes(E));\n }\n });\n function f(m) {\n const h = w(m);\n return h && h.$.subTree.shapeFlag === 16;\n }\n function v(m, h) {\n const E = w(m), y = E.$.subTree && E.$.subTree.children;\n return y == null || !Array.isArray(y) ? !1 : y.some((x) => x.el === h.target || h.composedPath().includes(x.el));\n }\n const d = (m) => {\n const h = O(e);\n if (m.target != null && !(!(h instanceof Element) && f(e) && v(e, m)) && !(!h || h === m.target || m.composedPath().includes(h))) {\n if (\"detail\" in m && m.detail === 0 && (a = !i(m)), !a) {\n a = !0;\n return;\n }\n t(m);\n }\n };\n let p = !1;\n const k = [\n ee(o, \"click\", (m) => {\n p || (p = !0, setTimeout(() => {\n p = !1;\n }, 0), d(m));\n }, {\n passive: !0,\n capture: u\n }),\n ee(o, \"pointerdown\", (m) => {\n const h = O(e);\n a = !i(m) && !!(h && !m.composedPath().includes(h));\n }, { passive: !0 }),\n s && ee(o, \"blur\", (m) => {\n setTimeout(() => {\n var h;\n const E = O(e);\n ((h = o.document.activeElement) === null || h === void 0 ? void 0 : h.tagName) === \"IFRAME\" && !E?.contains(o.document.activeElement) && t(m);\n }, 0);\n }, { passive: !0 })\n ].filter(Boolean), A = () => k.forEach((m) => m());\n return l ? {\n stop: A,\n cancel: () => {\n a = !1;\n },\n trigger: (m) => {\n a = !0, d(m), a = !1;\n }\n } : A;\n}\nconst mt = {\n multiple: !0,\n accept: \"*\",\n reset: !1,\n directory: !1\n};\nfunction vt(e) {\n if (!e) return null;\n if (e instanceof FileList) return e;\n const t = new DataTransfer();\n for (const n of e) t.items.add(n);\n return t.files;\n}\nfunction pt(e = {}) {\n const { document: t = ft } = e, n = D(vt(e.initialFiles)), { on: o, trigger: r } = /* @__PURE__ */ ve(), { on: u, trigger: s } = /* @__PURE__ */ ve(), l = T(() => {\n var v;\n const d = (v = O(e.input)) !== null && v !== void 0 ? v : t ? t.createElement(\"input\") : void 0;\n return d && (d.type = \"file\", d.onchange = (p) => {\n n.value = p.target.files, r(n.value);\n }, d.oncancel = () => {\n s();\n }), d;\n }), a = () => {\n n.value = null, l.value && l.value.value && (l.value.value = \"\", r(null));\n }, i = (v) => {\n const d = l.value;\n d && (d.multiple = w(v.multiple), d.accept = w(v.accept), d.webkitdirectory = w(v.directory), ut(v, \"capture\") && (d.capture = w(v.capture)));\n }, f = (v) => {\n const d = l.value;\n if (!d) return;\n const p = {\n ...mt,\n ...e,\n ...v\n };\n i(p), w(p.reset) && a(), d.click();\n };\n return ae(() => {\n i(e);\n }), {\n files: Ae(n),\n open: f,\n reset: a,\n onCancel: u,\n onChange: o\n };\n}\nfunction te(e) {\n return typeof Window < \"u\" && e instanceof Window ? e.document.documentElement : typeof Document < \"u\" && e instanceof Document ? e.documentElement : e;\n}\nconst ne = /* @__PURE__ */ new WeakMap();\nfunction ht(e, t = !1) {\n const n = G(t);\n let o = \"\";\n F(ct(e), (s) => {\n const l = te(w(s));\n if (l) {\n const a = l;\n if (ne.get(a) || ne.set(a, a.style.overflow), a.style.overflow !== \"hidden\" && (o = a.style.overflow), a.style.overflow === \"hidden\") return n.value = !0;\n if (n.value) return a.style.overflow = \"hidden\";\n }\n }, { immediate: !0 });\n const r = () => {\n const s = te(w(e));\n !s || n.value || (s.style.overflow = \"hidden\", n.value = !0);\n }, u = () => {\n const s = te(w(e));\n !s || !n.value || (s.style.overflow = o, ne.delete(s), n.value = !1);\n };\n return ie(u), T({\n get() {\n return n.value;\n },\n set(s) {\n s ? r() : u();\n }\n });\n}\nconst oe = /* @__PURE__ */ new WeakMap(), gt = {\n mounted(e, t) {\n const n = !t.modifiers.bubble;\n let o;\n if (typeof t.value == \"function\") o = pe(e, t.value, { capture: n });\n else {\n const [r, u] = t.value;\n o = pe(e, r, Object.assign({ capture: n }, u));\n }\n oe.set(e, o);\n },\n unmounted(e) {\n const t = oe.get(e);\n t && typeof t == \"function\" ? t() : t?.stop(), oe.delete(e);\n }\n};\nfunction yt() {\n let e = !1;\n const t = G(!1);\n return (n, o) => {\n if (t.value = o.value, e) return;\n e = !0;\n const r = ht(n, o.value);\n F(t, (u) => r.value = u);\n };\n}\nyt();\nconst bt = { class: \"input-wrapper\" }, wt = {\n id: \"autocomplete-results\",\n class: \"autocomplete-results\"\n}, kt = {\n key: 0,\n class: \"loading autocomplete-result\"\n}, xt = [\"onClick\"], Dt = /* @__PURE__ */ C({\n __name: \"ADropdown\",\n props: /* @__PURE__ */ z({\n label: {},\n items: { default: () => [] },\n isAsync: { type: Boolean, default: !1 },\n filterFunction: { type: Function, default: void 0 }\n }, {\n modelValue: {},\n modelModifiers: {}\n }),\n emits: [\"update:modelValue\"],\n setup(e) {\n const t = q(e, \"modelValue\"), n = Be({\n activeItemIndex: null,\n open: !1,\n loading: !1,\n results: e.items\n }), o = () => l(), r = async () => {\n if (n.open = !0, n.activeItemIndex = null, e.filterFunction) {\n e.isAsync && (n.loading = !0);\n try {\n const d = await e.filterFunction(t.value || \"\");\n n.results = d || [];\n } catch {\n n.results = [];\n } finally {\n e.isAsync && (n.loading = !1);\n }\n } else\n a();\n }, u = (d) => {\n t.value = d, l(d);\n }, s = () => {\n n.activeItemIndex = e.isAsync ? null : t.value && e.items?.indexOf(t.value) || null, n.open = !0, n.results = e.isAsync ? [] : e.items;\n }, l = (d) => {\n n.activeItemIndex = null, n.open = !1, e.items?.includes(d || t.value || \"\") || (t.value = \"\");\n }, a = () => {\n t.value ? n.results = e.items?.filter((d) => d.toLowerCase().includes((t.value ?? \"\").toLowerCase())) : n.results = e.items;\n }, i = () => {\n const d = n.results?.length || 0;\n if (n.activeItemIndex != null) {\n const p = isNaN(n.activeItemIndex) ? 0 : n.activeItemIndex;\n n.activeItemIndex = (p + 1) % d;\n } else\n n.activeItemIndex = 0;\n }, f = () => {\n const d = n.results?.length || 0;\n if (n.activeItemIndex != null) {\n const p = isNaN(n.activeItemIndex) ? 0 : n.activeItemIndex;\n p === 0 ? n.activeItemIndex = null : n.activeItemIndex = p - 1;\n } else\n n.activeItemIndex = d - 1;\n }, v = () => {\n if (n.results) {\n const d = n.activeItemIndex || 0, p = n.results[d];\n u(p);\n }\n n.activeItemIndex = 0;\n };\n return (d, p) => M((g(), b(\"div\", {\n class: X([\"autocomplete\", { isOpen: n.open }])\n }, [\n c(\"div\", bt, [\n M(c(\"input\", {\n \"onUpdate:modelValue\": p[0] || (p[0] = (k) => t.value = k),\n type: \"text\",\n onInput: r,\n onFocus: s,\n onKeydown: [\n R(i, [\"down\"]),\n R(f, [\"up\"]),\n R(v, [\"enter\"]),\n R(o, [\"esc\"]),\n R(o, [\"tab\"])\n ]\n }, null, 544), [\n [H, t.value]\n ]),\n M(c(\"ul\", wt, [\n n.loading ? (g(), b(\"li\", kt, \"Loading results...\")) : (g(!0), b(j, { key: 1 }, Y(n.results, (k, A) => (g(), b(\"li\", {\n key: k,\n class: X([\"autocomplete-result\", { \"is-active\": A === n.activeItemIndex }]),\n onClick: Te((m) => u(k), [\"stop\"])\n }, I(k), 11, xt))), 128))\n ], 512), [\n [U, n.open]\n ]),\n c(\"label\", null, I(e.label), 1)\n ])\n ], 2)), [\n [S(gt), o]\n ]);\n }\n}), Et = /* @__PURE__ */ L(Dt, [[\"__scopeId\", \"data-v-31a6db8c\"]]);\nfunction ue(e, t) {\n return Me() ? (Ie(e, t), !0) : !1;\n}\nconst Mt = typeof window < \"u\" && typeof document < \"u\";\ntypeof WorkerGlobalScope < \"u\" && globalThis instanceof WorkerGlobalScope;\nconst It = (e) => e != null, At = Object.prototype.toString, Tt = (e) => At.call(e) === \"[object Object]\", Ct = () => {\n};\nfunction Q(e) {\n return Array.isArray(e) ? e : [e];\n}\nfunction $t(e, t, n) {\n return F(e, t, {\n ...n,\n immediate: !0\n });\n}\nconst W = Mt ? window : void 0;\nfunction B(e) {\n var t;\n const n = w(e);\n return (t = n?.$el) !== null && t !== void 0 ? t : n;\n}\nfunction K(...e) {\n const t = [], n = () => {\n t.forEach((l) => l()), t.length = 0;\n }, o = (l, a, i, f) => (l.addEventListener(a, i, f), () => l.removeEventListener(a, i, f)), r = T(() => {\n const l = Q(w(e[0])).filter((a) => a != null);\n return l.every((a) => typeof a != \"string\") ? l : void 0;\n }), u = $t(() => {\n var l, a;\n return [\n (l = (a = r.value) === null || a === void 0 ? void 0 : a.map((i) => B(i))) !== null && l !== void 0 ? l : [W].filter((i) => i != null),\n Q(w(r.value ? e[1] : e[0])),\n Q(S(r.value ? e[2] : e[1])),\n w(r.value ? e[3] : e[2])\n ];\n }, ([l, a, i, f]) => {\n if (n(), !l?.length || !a?.length || !i?.length) return;\n const v = Tt(f) ? { ...f } : f;\n t.push(...l.flatMap((d) => a.flatMap((p) => i.map((k) => o(d, p, k, v)))));\n }, { flush: \"post\" }), s = () => {\n u(), n();\n };\n return ue(n), s;\n}\n// @__NO_SIDE_EFFECTS__\nfunction St() {\n const e = G(!1), t = Ue();\n return t && se(() => {\n e.value = !0;\n }, t), e;\n}\n// @__NO_SIDE_EFFECTS__\nfunction Lt(e) {\n const t = /* @__PURE__ */ St();\n return T(() => (t.value, !!e()));\n}\nfunction _t(e, t, n = {}) {\n const { window: o = W, ...r } = n;\n let u;\n const s = /* @__PURE__ */ Lt(() => o && \"MutationObserver\" in o), l = () => {\n u && (u.disconnect(), u = void 0);\n }, a = F(T(() => {\n const v = Q(w(e)).map(B).filter(It);\n return new Set(v);\n }), (v) => {\n l(), s.value && v.size && (u = new MutationObserver(t), v.forEach((d) => u.observe(d, r)));\n }, {\n immediate: !0,\n flush: \"post\"\n }), i = () => u?.takeRecords(), f = () => {\n a(), l();\n };\n return ue(f), {\n isSupported: s,\n stop: f,\n takeRecords: i\n };\n}\nfunction Vt(e, t, n = {}) {\n const { window: o = W, document: r = o?.document, flush: u = \"sync\" } = n;\n if (!o || !r) return Ct;\n let s;\n const l = (f) => {\n s?.(), s = f;\n }, a = ae(() => {\n const f = B(e);\n if (f) {\n const { stop: v } = _t(r, (d) => {\n d.map((p) => [...p.removedNodes]).flat().some((p) => p === f || p.contains(f)) && t(d);\n }, {\n window: o,\n childList: !0,\n subtree: !0\n });\n l(v);\n }\n }, { flush: u }), i = () => {\n a(), l();\n };\n return ue(i), i;\n}\n// @__NO_SIDE_EFFECTS__\nfunction Pt(e = {}) {\n var t;\n const { window: n = W, deep: o = !0, triggerOnRemoval: r = !1 } = e, u = (t = e.document) !== null && t !== void 0 ? t : n?.document, s = () => {\n let i = u?.activeElement;\n if (o)\n for (var f; i?.shadowRoot; ) i = i == null || (f = i.shadowRoot) === null || f === void 0 ? void 0 : f.activeElement;\n return i;\n }, l = G(), a = () => {\n l.value = s();\n };\n if (n) {\n const i = {\n capture: !0,\n passive: !0\n };\n K(n, \"blur\", (f) => {\n f.relatedTarget === null && a();\n }, i), K(n, \"focus\", a, i);\n }\n return r && Vt(l, a, { document: u }), a(), l;\n}\nconst Ft = \"focusin\", Rt = \"focusout\", Ot = \":focus-within\";\nfunction Ht(e, t = {}) {\n const { window: n = W } = t, o = T(() => B(e)), r = G(!1), u = T(() => r.value);\n if (!n || !(/* @__PURE__ */ Pt(t)).value) return { focused: u };\n const s = { passive: !0 };\n return K(o, Ft, () => r.value = !0, s), K(o, Rt, () => {\n var l, a, i;\n return r.value = (l = (a = o.value) === null || a === void 0 || (i = a.matches) === null || i === void 0 ? void 0 : i.call(a, Ot)) !== null && l !== void 0 ? l : !1;\n }, s), { focused: u };\n}\nfunction Bt(e, { window: t = W, scrollTarget: n } = {}) {\n const o = D(!1), r = () => {\n if (!t) return;\n const u = t.document, s = B(e);\n if (!s)\n o.value = !1;\n else {\n const l = s.getBoundingClientRect();\n o.value = l.top <= (t.innerHeight || u.documentElement.clientHeight) && l.left <= (t.innerWidth || u.documentElement.clientWidth) && l.bottom >= 0 && l.right >= 0;\n }\n };\n return F(\n () => B(e),\n () => r(),\n { immediate: !0, flush: \"post\" }\n ), t && K(n || t, \"scroll\", r, {\n capture: !1,\n passive: !0\n }), o;\n}\nconst _ = (e) => {\n let t = Bt(e).value;\n return t = t && e.offsetHeight > 0, t;\n}, V = (e) => e.tabIndex >= 0, he = (e) => {\n const t = e.target;\n return ce(t);\n}, ce = (e) => {\n let t;\n if (e instanceof HTMLTableCellElement) {\n const n = e.parentElement?.previousElementSibling;\n if (n) {\n const o = Array.from(n.children)[e.cellIndex];\n o && (t = o);\n }\n } else if (e instanceof HTMLTableRowElement) {\n const n = e.previousElementSibling;\n n && (t = n);\n }\n return t && (!V(t) || !_(t)) ? ce(t) : t;\n}, qt = (e) => {\n const t = e.target;\n let n;\n if (t instanceof HTMLTableCellElement) {\n const o = t.parentElement?.parentElement;\n if (o) {\n const r = o.firstElementChild?.children[t.cellIndex];\n r && (n = r);\n }\n } else if (t instanceof HTMLTableRowElement) {\n const o = t.parentElement;\n if (o) {\n const r = o.firstElementChild;\n r && (n = r);\n }\n }\n return n && (!V(n) || !_(n)) ? de(n) : n;\n}, ge = (e) => {\n const t = e.target;\n return de(t);\n}, de = (e) => {\n let t;\n if (e instanceof HTMLTableCellElement) {\n const n = e.parentElement?.nextElementSibling;\n if (n) {\n const o = Array.from(n.children)[e.cellIndex];\n o && (t = o);\n }\n } else if (e instanceof HTMLTableRowElement) {\n const n = e.nextElementSibling;\n n && (t = n);\n }\n return t && (!V(t) || !_(t)) ? de(t) : t;\n}, Ut = (e) => {\n const t = e.target;\n let n;\n if (t instanceof HTMLTableCellElement) {\n const o = t.parentElement?.parentElement;\n if (o) {\n const r = o.lastElementChild?.children[t.cellIndex];\n r && (n = r);\n }\n } else if (t instanceof HTMLTableRowElement) {\n const o = t.parentElement;\n if (o) {\n const r = o.lastElementChild;\n r && (n = r);\n }\n }\n return n && (!V(n) || !_(n)) ? ce(n) : n;\n}, ye = (e) => {\n const t = e.target;\n return fe(t);\n}, fe = (e) => {\n let t;\n return e.previousElementSibling ? t = e.previousElementSibling : t = e.parentElement?.previousElementSibling?.lastElementChild, t && (!V(t) || !_(t)) ? fe(t) : t;\n}, be = (e) => {\n const t = e.target;\n return me(t);\n}, me = (e) => {\n let t;\n return e.nextElementSibling ? t = e.nextElementSibling : t = e.parentElement?.nextElementSibling?.firstElementChild, t && (!V(t) || !_(t)) ? me(t) : t;\n}, we = (e) => {\n const t = e.target.parentElement?.firstElementChild;\n return t && (!V(t) || !_(t)) ? me(t) : t;\n}, ke = (e) => {\n const t = e.target.parentElement?.lastElementChild;\n return t && (!V(t) || !_(t)) ? fe(t) : t;\n}, J = [\"alt\", \"control\", \"shift\", \"meta\"], Wt = {\n ArrowUp: \"up\",\n ArrowDown: \"down\",\n ArrowLeft: \"left\",\n ArrowRight: \"right\"\n}, Le = {\n \"keydown.up\": (e) => {\n const t = he(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.down\": (e) => {\n const t = ge(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.left\": (e) => {\n const t = ye(e);\n e.preventDefault(), e.stopPropagation(), t && t.focus();\n },\n \"keydown.right\": (e) => {\n const t = be(e);\n e.preventDefault(), e.stopPropagation(), t && t.focus();\n },\n \"keydown.control.up\": (e) => {\n const t = qt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.down\": (e) => {\n const t = Ut(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.left\": (e) => {\n const t = we(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.right\": (e) => {\n const t = ke(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.end\": (e) => {\n const t = ke(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.enter\": (e) => {\n if (e.target instanceof HTMLTableCellElement) {\n e.preventDefault(), e.stopPropagation();\n const t = ge(e);\n t && t.focus();\n }\n },\n \"keydown.shift.enter\": (e) => {\n if (e.target instanceof HTMLTableCellElement) {\n e.preventDefault(), e.stopPropagation();\n const t = he(e);\n t && t.focus();\n }\n },\n \"keydown.home\": (e) => {\n const t = we(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.tab\": (e) => {\n const t = be(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.shift.tab\": (e) => {\n const t = ye(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n }\n};\nfunction Nt(e) {\n const t = (s) => {\n let l = null;\n return s.parent && (typeof s.parent == \"string\" ? l = document.querySelector(s.parent) : s.parent instanceof HTMLElement ? l = s.parent : l = s.parent.value), l;\n }, n = (s) => {\n const l = t(s);\n let a = [];\n if (typeof s.selectors == \"string\")\n a = l ? Array.from(l.querySelectorAll(s.selectors)) : Array.from(document.querySelectorAll(s.selectors));\n else if (Array.isArray(s.selectors))\n for (const i of s.selectors)\n i instanceof HTMLElement ? a.push(i) : a.push(i.$el);\n else if (s.selectors instanceof HTMLElement)\n a.push(s.selectors);\n else if (s.selectors?.value)\n if (Array.isArray(s.selectors.value))\n for (const i of s.selectors.value)\n i instanceof HTMLElement ? a.push(i) : a.push(i.$el);\n else\n a.push(s.selectors.value);\n return a;\n }, o = (s) => {\n const l = t(s);\n let a = [];\n return s.selectors ? a = n(s) : l && (a = Array.from(l.children).filter((i) => V(i) && _(i))), a;\n }, r = (s) => (l) => {\n const a = Wt[l.key] || l.key.toLowerCase();\n if (J.includes(a)) return;\n const i = s.handlers || Le;\n for (const f of Object.keys(i)) {\n const [v, ...d] = f.split(\".\");\n if (v === \"keydown\" && d.includes(a)) {\n const p = i[f], k = d.filter((m) => J.includes(m)), A = J.some((m) => {\n const h = m.charAt(0).toUpperCase() + m.slice(1);\n return l.getModifierState(h);\n });\n if (k.length > 0) {\n if (A) {\n for (const m of J)\n if (d.includes(m)) {\n const h = m.charAt(0).toUpperCase() + m.slice(1);\n l.getModifierState(h) && p(l);\n }\n }\n } else\n A || p(l);\n }\n }\n }, u = [];\n se(() => {\n for (const s of e) {\n const l = t(s), a = o(s), i = r(s), f = l ? [l] : a;\n for (const v of f) {\n const { focused: d } = Ht(D(v)), p = F(d, (k) => {\n k ? v.addEventListener(\"keydown\", i) : v.removeEventListener(\"keydown\", i);\n });\n u.push(p);\n }\n }\n }), qe(() => {\n for (const s of u)\n s();\n });\n}\nconst jt = {\n ref: \"datepicker\",\n class: \"adatepicker\",\n tabindex: \"0\"\n}, Yt = {\n colspan: \"5\",\n tabindex: -1\n}, Kt = [\"onClick\", \"onKeydown\"], zt = 6, xe = 7, Gt = /* @__PURE__ */ C({\n __name: \"ADatePicker\",\n props: {\n modelValue: { default: /* @__PURE__ */ new Date() },\n modelModifiers: {}\n },\n emits: [\"update:modelValue\"],\n setup(e, { expose: t }) {\n const n = q(e, \"modelValue\"), o = D(new Date(n.value)), r = D(o.value.getMonth()), u = D(o.value.getFullYear()), s = D([]), l = Ee(\"datepicker\");\n se(async () => {\n a(), await We();\n const y = document.getElementsByClassName(\"selectedDate\");\n if (y.length > 0)\n y[0].focus();\n else {\n const x = document.getElementsByClassName(\"todaysDate\");\n x.length > 0 && x[0].focus();\n }\n });\n const a = () => {\n s.value = [];\n const y = new Date(u.value, r.value, 1), x = y.getDay(), $ = y.setDate(y.getDate() - x);\n for (const P of Array(43).keys())\n s.value.push($ + P * 864e5);\n };\n F([r, u], a);\n const i = () => u.value -= 1, f = () => u.value += 1, v = () => {\n r.value == 0 ? (r.value = 11, i()) : r.value -= 1;\n }, d = () => {\n r.value == 11 ? (r.value = 0, f()) : r.value += 1;\n }, p = (y) => {\n const x = /* @__PURE__ */ new Date();\n if (r.value === x.getMonth())\n return x.toDateString() === new Date(y).toDateString();\n }, k = (y) => new Date(y).toDateString() === new Date(o.value).toDateString(), A = (y, x) => (y - 1) * xe + x, m = (y, x) => s.value[A(y, x)], h = (y) => {\n n.value = o.value = new Date(s.value[y]);\n }, E = T(() => new Date(u.value, r.value, 1).toLocaleDateString(void 0, {\n year: \"numeric\",\n month: \"long\"\n }));\n return Nt([\n {\n parent: l,\n selectors: \"td\",\n handlers: {\n ...Le,\n \"keydown.pageup\": v,\n \"keydown.shift.pageup\": i,\n \"keydown.pagedown\": d,\n \"keydown.shift.pagedown\": f,\n // TODO: this is a hack to override the stonecrop enter handler;\n // store context inside the component so that handlers can be setup consistently\n \"keydown.enter\": () => {\n }\n }\n }\n ]), t({ currentMonth: r, currentYear: u, selectedDate: o }), (y, x) => (g(), b(\"div\", jt, [\n c(\"table\", null, [\n c(\"tbody\", null, [\n c(\"tr\", null, [\n c(\"td\", {\n id: \"previous-month-btn\",\n tabindex: -1,\n onClick: v\n }, \"<\"),\n c(\"th\", Yt, I(E.value), 1),\n c(\"td\", {\n id: \"next-month-btn\",\n tabindex: -1,\n onClick: d\n }, \">\")\n ]),\n x[0] || (x[0] = c(\"tr\", { class: \"days-header\" }, [\n c(\"td\", null, \"M\"),\n c(\"td\", null, \"T\"),\n c(\"td\", null, \"W\"),\n c(\"td\", null, \"T\"),\n c(\"td\", null, \"F\"),\n c(\"td\", null, \"S\"),\n c(\"td\", null, \"S\")\n ], -1)),\n (g(), b(j, null, Y(zt, ($) => c(\"tr\", { key: $ }, [\n (g(), b(j, null, Y(xe, (P) => c(\"td\", {\n ref_for: !0,\n ref: \"celldate\",\n key: A($, P),\n contenteditable: !1,\n spellcheck: !1,\n tabindex: 0,\n class: X({\n todaysDate: p(m($, P)),\n selectedDate: k(m($, P))\n }),\n onClick: Te((Ve) => h(A($, P)), [\"prevent\", \"stop\"]),\n onKeydown: R((Ve) => h(A($, P)), [\"enter\"])\n }, I(new Date(m($, P)).getDate()), 43, Kt)), 64))\n ])), 64))\n ])\n ])\n ], 512));\n }\n}), Jt = /* @__PURE__ */ L(Gt, [[\"__scopeId\", \"data-v-056d2b5e\"]]), Qt = /* @__PURE__ */ C({\n __name: \"CollapseButton\",\n props: {\n collapsed: { type: Boolean }\n },\n setup(e) {\n return (t, n) => (g(), b(\"button\", {\n class: X([\"collapse-button\", e.collapsed ? \"rotated\" : \"unrotated\"])\n }, \"×\", 2));\n }\n}), Xt = /* @__PURE__ */ L(Qt, [[\"__scopeId\", \"data-v-6f1c1b45\"]]), Zt = { class: \"aform\" }, en = /* @__PURE__ */ C({\n __name: \"AForm\",\n props: {\n modelValue: {},\n data: {},\n readonly: { type: Boolean }\n },\n emits: [\"update:modelValue\"],\n setup(e, { emit: t }) {\n const n = t, o = D(e.data || {});\n ae(() => {\n e.data && (o.value = e.data, e.modelValue.forEach((s) => {\n s.fieldname && e.data[s.fieldname] !== void 0 && (s.value = e.data[s.fieldname]);\n }));\n });\n const r = (s) => {\n let l = {};\n for (const [a, i] of Object.entries(s))\n [\"component\", \"fieldtype\"].includes(a) || (l[a] = i), a === \"rows\" && i && i.length === 0 && (l.rows = o.value[s.fieldname]);\n return l;\n }, u = T({\n get: () => e.modelValue.map((s, l) => T({\n get() {\n return s.value;\n },\n set: (a) => {\n e.modelValue[l].value = a, n(\"update:modelValue\", e.modelValue);\n }\n })),\n set: () => {\n }\n });\n return (s, l) => (g(), b(\"form\", Zt, [\n (g(!0), b(j, null, Y(e.modelValue, (a, i) => (g(), le(Ne(a.component), je({\n key: i,\n modelValue: u.value[i].value,\n \"onUpdate:modelValue\": (f) => u.value[i].value = f,\n schema: a,\n data: o.value[a.fieldname],\n readonly: e.readonly\n }, { ref_for: !0 }, r(a)), null, 16, [\"modelValue\", \"onUpdate:modelValue\", \"schema\", \"data\", \"readonly\"]))), 128))\n ]));\n }\n}), _e = /* @__PURE__ */ L(en, [[\"__scopeId\", \"data-v-82d33d5b\"]]), tn = /* @__PURE__ */ C({\n __name: \"AFieldset\",\n props: {\n schema: {},\n label: {},\n collapsible: { type: Boolean },\n data: { default: () => ({}) }\n },\n setup(e, { expose: t }) {\n const n = D(!1), o = D(e.data || []), r = D(e.schema), u = (s) => {\n s.preventDefault(), e.collapsible && (n.value = !n.value);\n };\n return t({ collapsed: n }), (s, l) => (g(), b(\"fieldset\", null, [\n c(\"legend\", {\n onClick: u,\n onSubmit: u\n }, [\n Ce(I(e.label) + \" \", 1),\n e.collapsible ? (g(), le(Xt, {\n key: 0,\n collapsed: n.value\n }, null, 8, [\"collapsed\"])) : re(\"\", !0)\n ], 32),\n Ye(s.$slots, \"default\", { collapsed: n.value }, () => [\n M(Ke(_e, {\n modelValue: r.value,\n \"onUpdate:modelValue\": l[0] || (l[0] = (a) => r.value = a),\n data: o.value\n }, null, 8, [\"modelValue\", \"data\"]), [\n [U, !n.value]\n ])\n ], !0)\n ]));\n }\n}), nn = /* @__PURE__ */ L(tn, [[\"__scopeId\", \"data-v-40b2a95d\"]]), on = { class: \"aform_form-element aform_file-attach aform__grid--full\" }, ln = {\n key: 0,\n class: \"aform_file-attach-feedback\"\n}, an = [\"disabled\"], sn = /* @__PURE__ */ C({\n __name: \"AFileAttach\",\n props: {\n label: {}\n },\n setup(e) {\n const { files: t, open: n, reset: o, onChange: r } = pt(), u = T(() => `${t.value.length} ${t.value.length === 1 ? \"file\" : \"files\"}`);\n return r((s) => s), (s, l) => (g(), b(\"div\", on, [\n S(t) ? (g(), b(\"div\", ln, [\n c(\"p\", null, [\n l[2] || (l[2] = Ce(\" You have selected: \", -1)),\n c(\"b\", null, I(u.value), 1)\n ]),\n (g(!0), b(j, null, Y(S(t), (a) => (g(), b(\"li\", {\n key: a.name\n }, I(a.name), 1))), 128))\n ])) : re(\"\", !0),\n c(\"button\", {\n type: \"button\",\n class: \"aform_form-btn\",\n onClick: l[0] || (l[0] = (a) => S(n)())\n }, I(e.label), 1),\n c(\"button\", {\n type: \"button\",\n disabled: !S(t),\n class: \"aform_form-btn\",\n onClick: l[1] || (l[1] = (a) => S(o)())\n }, \"Reset\", 8, an)\n ]));\n }\n}), rn = /* @__PURE__ */ L(sn, [[\"__scopeId\", \"data-v-b700734f\"]]), un = { class: \"aform_form-element\" }, cn = [\"id\", \"disabled\", \"required\"], dn = [\"for\"], fn = [\"innerHTML\"], mn = /* @__PURE__ */ C({\n __name: \"ANumericInput\",\n props: /* @__PURE__ */ z({\n schema: {},\n label: {},\n mask: {},\n required: { type: Boolean },\n readonly: { type: Boolean },\n uuid: {},\n validation: { default: () => ({ errorMessage: \"&nbsp;\" }) }\n }, {\n modelValue: {},\n modelModifiers: {}\n }),\n emits: [\"update:modelValue\"],\n setup(e) {\n const t = q(e, \"modelValue\");\n return (n, o) => (g(), b(\"div\", un, [\n M(c(\"input\", {\n id: e.uuid,\n \"onUpdate:modelValue\": o[0] || (o[0] = (r) => t.value = r),\n class: \"aform_input-field\",\n type: \"number\",\n disabled: e.readonly,\n required: e.required\n }, null, 8, cn), [\n [H, t.value]\n ]),\n c(\"label\", {\n class: \"aform_field-label\",\n for: e.uuid\n }, I(e.label), 9, dn),\n M(c(\"p\", {\n class: \"aform_error\",\n innerHTML: e.validation.errorMessage\n }, null, 8, fn), [\n [U, e.validation.errorMessage]\n ])\n ]));\n }\n}), De = {\n date: \"##/##/####\",\n datetime: \"####/##/## ##:##\",\n time: \"##:##\",\n fulltime: \"##:##:##\",\n phone: \"(###) ### - ####\",\n card: \"#### #### #### ####\"\n};\nfunction vn(e) {\n try {\n return Function(`\"use strict\";return (${e})`)();\n } catch {\n }\n}\nfunction pn(e) {\n let t = e.value;\n if (t) {\n const n = vn(t);\n if (n) {\n const o = e.instance?.locale;\n t = n(o);\n }\n } else {\n const o = e.instance?.schema?.fieldtype?.toLowerCase();\n o && De[o] && (t = De[o]);\n }\n return t;\n}\nfunction hn(e, t) {\n let n = e;\n const o = [t, \"/\", \"-\", \"(\", \")\", \" \"];\n for (const r of o)\n n = n.replaceAll(r, \"\");\n return n;\n}\nfunction gn(e, t, n) {\n let o = t;\n for (const r of e) {\n const u = o.indexOf(n);\n if (u !== -1) {\n const s = o.substring(0, u), l = o.substring(u + 1);\n o = s + r + l;\n }\n }\n return o.slice(0, t.length);\n}\nfunction yn(e, t) {\n const n = pn(t);\n if (!n) return;\n const o = \"#\", r = e.value, u = hn(r, o);\n if (u) {\n const s = gn(u, n, o);\n t.instance?.maskFilled && (t.instance.maskFilled = !s.includes(o)), e.value = s;\n } else\n e.value = n;\n}\nconst bn = { class: \"aform_form-element\" }, wn = [\"id\", \"disabled\", \"maxlength\", \"required\"], kn = [\"for\"], xn = [\"innerHTML\"], Dn = /* @__PURE__ */ C({\n __name: \"ATextInput\",\n props: /* @__PURE__ */ z({\n schema: {},\n label: {},\n mask: {},\n required: { type: Boolean },\n readonly: { type: Boolean },\n uuid: {},\n validation: { default: () => ({ errorMessage: \"&nbsp;\" }) }\n }, {\n modelValue: {},\n modelModifiers: {}\n }),\n emits: [\"update:modelValue\"],\n setup(e) {\n const t = D(!0), n = q(e, \"modelValue\");\n return (o, r) => (g(), b(\"div\", bn, [\n M(c(\"input\", {\n id: e.uuid,\n \"onUpdate:modelValue\": r[0] || (r[0] = (u) => n.value = u),\n class: \"aform_input-field\",\n disabled: e.readonly,\n maxlength: e.mask && t.value ? e.mask.length : void 0,\n required: e.required\n }, null, 8, wn), [\n [H, n.value],\n [S(yn), e.mask]\n ]),\n c(\"label\", {\n class: \"aform_field-label\",\n for: e.uuid\n }, I(e.label), 9, kn),\n M(c(\"p\", {\n class: \"aform_error\",\n innerHTML: e.validation.errorMessage\n }, null, 8, xn), [\n [U, e.validation.errorMessage]\n ])\n ]));\n }\n}), En = { class: \"login-container\" }, Mn = { class: \"account-container\" }, In = { class: \"account-header\" }, An = { id: \"account-title\" }, Tn = { id: \"account-subtitle\" }, Cn = { class: \"login-form-container\" }, $n = { class: \"login-form-email aform_form-element\" }, Sn = [\"disabled\"], Ln = { class: \"login-form-password aform_form-element\" }, _n = [\"disabled\"], Vn = [\"disabled\"], Pn = {\n key: 0,\n class: \"material-symbols-outlined loading-icon\"\n}, Fn = /* @__PURE__ */ C({\n __name: \"Login\",\n props: {\n headerTitle: { default: \"Login\" },\n headerSubtitle: { default: \"Enter your email and password to login\" }\n },\n emits: [\"loginFailed\", \"loginSuccess\"],\n setup(e, { emit: t }) {\n const n = t, o = D(\"\"), r = D(\"\"), u = D(!1), s = D(!1);\n function l(a) {\n if (a.preventDefault(), u.value = !0, s.value) {\n u.value = !1, n(\"loginFailed\");\n return;\n }\n u.value = !1, n(\"loginSuccess\");\n }\n return (a, i) => (g(), b(\"div\", En, [\n c(\"div\", null, [\n c(\"div\", Mn, [\n c(\"div\", In, [\n c(\"h1\", An, I(e.headerTitle), 1),\n c(\"p\", Tn, I(e.headerSubtitle), 1)\n ]),\n c(\"form\", { onSubmit: l }, [\n c(\"div\", Cn, [\n c(\"div\", $n, [\n i[2] || (i[2] = c(\"label\", {\n id: \"login-email\",\n for: \"email\",\n class: \"aform_field-label\"\n }, \"Email\", -1)),\n M(c(\"input\", {\n id: \"email\",\n \"onUpdate:modelValue\": i[0] || (i[0] = (f) => o.value = f),\n class: \"aform_input-field\",\n name: \"email\",\n placeholder: \"name@example.com\",\n type: \"email\",\n \"auto-capitalize\": \"none\",\n \"auto-complete\": \"email\",\n \"auto-correct\": \"off\",\n disabled: u.value\n }, null, 8, Sn), [\n [H, o.value]\n ])\n ]),\n c(\"div\", Ln, [\n i[3] || (i[3] = c(\"label\", {\n id: \"login-password\",\n for: \"password\",\n class: \"aform_field-label\"\n }, \"Password\", -1)),\n M(c(\"input\", {\n id: \"password\",\n \"onUpdate:modelValue\": i[1] || (i[1] = (f) => r.value = f),\n class: \"aform_input-field\",\n name: \"password\",\n type: \"password\",\n disabled: u.value\n }, null, 8, _n), [\n [H, r.value]\n ])\n ]),\n c(\"button\", {\n class: \"btn\",\n disabled: u.value || !o.value || !r.value,\n onClick: l\n }, [\n u.value ? (g(), b(\"span\", Pn, \"progress_activity\")) : re(\"\", !0),\n i[4] || (i[4] = c(\"span\", { id: \"login-form-button\" }, \"Login\", -1))\n ], 8, Vn)\n ])\n ], 32),\n i[5] || (i[5] = c(\"button\", { class: \"btn\" }, [\n c(\"span\", { id: \"forgot-password-button\" }, \"Forgot password?\")\n ], -1))\n ])\n ])\n ]));\n }\n}), On = /* @__PURE__ */ L(Fn, [[\"__scopeId\", \"data-v-d9ffd0a7\"]]);\nfunction Hn(e) {\n e.component(\"ACheckbox\", et), e.component(\"ACombobox\", tt), e.component(\"ADate\", st), e.component(\"ADropdown\", Et), e.component(\"ADatePicker\", Jt), e.component(\"AFieldset\", nn), e.component(\"AFileAttach\", rn), e.component(\"AForm\", _e), e.component(\"ANumericInput\", mn), e.component(\"ATextInput\", Dn);\n}\nexport {\n et as ACheckbox,\n tt as AComboBox,\n st as ADate,\n Jt as ADatePicker,\n Et as ADropdown,\n nn as AFieldset,\n rn as AFileAttach,\n _e as AForm,\n mn as ANumericInput,\n Dn as ATextInput,\n On as Login,\n Hn as install\n};\n//# sourceMappingURL=aform.js.map\n","<template>\n\t<footer>\n\t\t<ul class=\"tabs\">\n\t\t\t<li class=\"hidebreadcrumbs\" @click=\"toggleBreadcrumbs\" @keydown.enter=\"toggleBreadcrumbs\">\n\t\t\t\t<a tabindex=\"0\"><div :class=\"rotateHideTabIcon\">×</div></a>\n\t\t\t</li>\n\t\t\t<li\n\t\t\t\tclass=\"hometab\"\n\t\t\t\t:style=\"{ display: breadcrumbsVisibile ? 'block' : 'none' }\"\n\t\t\t\t@click=\"navigateHome\"\n\t\t\t\t@keydown.enter=\"navigateHome\">\n\t\t\t\t<router-link to=\"/\" tabindex=\"0\">\n\t\t\t\t\t<span class=\"icon-placeholder\" aria-label=\"Home\">🏠</span>\n\t\t\t\t</router-link>\n\t\t\t</li>\n\t\t\t<li\n\t\t\t\t:class=\"['searchtab', { 'search-active': searchVisible }]\"\n\t\t\t\t:style=\"{ display: breadcrumbsVisibile ? 'block' : 'none' }\">\n\t\t\t\t<a tabindex=\"0\">\n\t\t\t\t\t<span\n\t\t\t\t\t\tv-show=\"!searchVisible\"\n\t\t\t\t\t\tclass=\"search-icon\"\n\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\taria-label=\"Search\"\n\t\t\t\t\t\t@click=\"toggleSearch\"\n\t\t\t\t\t\t@keydown.enter=\"toggleSearch\"\n\t\t\t\t\t\t>🔍</span\n\t\t\t\t\t>\n\t\t\t\t\t<input\n\t\t\t\t\t\tv-show=\"searchVisible\"\n\t\t\t\t\t\tref=\"searchinput\"\n\t\t\t\t\t\tv-model=\"searchText\"\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tplaceholder=\"Search...\"\n\t\t\t\t\t\t@click.stop\n\t\t\t\t\t\t@input=\"handleSearchInput($event)\"\n\t\t\t\t\t\t@blur=\"handleSearch($event)\"\n\t\t\t\t\t\t@keydown.enter=\"handleSearch($event)\"\n\t\t\t\t\t\t@keydown.escape=\"toggleSearch\" />\n\t\t\t\t</a>\n\t\t\t</li>\n\t\t\t<li\n\t\t\t\tv-for=\"breadcrumb in breadcrumbs\"\n\t\t\t\t:key=\"breadcrumb.title\"\n\t\t\t\t:style=\"{ display: breadcrumbsVisibile ? 'block' : 'none' }\">\n\t\t\t\t<router-link tabindex=\"0\" :to=\"breadcrumb.to\"> {{ breadcrumb.title }} </router-link>\n\t\t\t</li>\n\t\t</ul>\n\t</footer>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, nextTick, ref, useTemplateRef } from 'vue'\n\nconst { breadcrumbs = [] } = defineProps<{ breadcrumbs?: { title: string; to: string }[] }>()\n\nconst breadcrumbsVisibile = ref(true)\nconst searchVisible = ref(false)\nconst searchText = ref('')\nconst inputRef = useTemplateRef<HTMLInputElement>('searchinput')\n\nconst rotateHideTabIcon = computed(() => {\n\treturn breadcrumbsVisibile.value ? 'unrotated' : 'rotated'\n})\n\nconst toggleBreadcrumbs = () => {\n\tbreadcrumbsVisibile.value = !breadcrumbsVisibile.value\n}\n\nconst toggleSearch = async () => {\n\tsearchVisible.value = !searchVisible.value\n\tawait nextTick(() => {\n\t\tinputRef.value?.focus()\n\t})\n}\n\nconst handleSearchInput = (event: Event | MouseEvent) => {\n\tevent.preventDefault()\n\tevent.stopPropagation()\n}\n\nconst handleSearch = async (event: FocusEvent | KeyboardEvent) => {\n\tevent.preventDefault()\n\tevent.stopPropagation()\n\tawait toggleSearch()\n}\n\nconst navigateHome = (/* event: MouseEvent | KeyboardEvent */) => {\n\t// navigate home\n}\n</script>\n\n<style scoped>\nfooter {\n\tposition: fixed;\n\tbottom: 0px;\n\twidth: 100%;\n\tbackground-color: transparent;\n\theight: auto;\n\tmin-height: 2rem;\n\tz-index: 100;\n\ttext-align: left;\n\tfont-size: 100%;\n\tdisplay: flex;\n\tjustify-content: right;\n\tpadding: 0 1rem 0 0;\n\tbox-sizing: border-box;\n}\nul {\n\tdisplay: flex;\n\tflex-direction: row-reverse;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n\n.tabs li {\n\tfloat: left;\n\tlist-style-type: none;\n\tposition: relative;\n\tmargin-left: -1px;\n}\n\n/* Base tab styling - 15% larger for easier interaction */\n.tabs a {\n\tfloat: left;\n\tpadding: 0.575rem 1.725rem;\n\theight: 2.6rem;\n\tbox-sizing: border-box;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\ttext-decoration: none;\n\tcolor: var(--sc-gray-80, #333);\n\tbackground: var(--sc-btn-color, #ffffff);\n\tborder: 1px solid var(--sc-btn-border, #ccc);\n\tfont-size: 1.15rem;\n\ttransition: all 0.2s ease;\n\n\t/* Only round the top corners */\n\t-webkit-border-top-left-radius: 15px;\n\t-webkit-border-top-right-radius: 15px;\n\t-moz-border-radius-topleft: 15px;\n\t-moz-border-radius-topright: 15px;\n\tborder-top-left-radius: 15px;\n\tborder-top-right-radius: 15px;\n}\n\n.tabs a:hover {\n\tbackground: var(--sc-btn-hover, #f2f2f2);\n}\n\n.tabs .router-link-active {\n\tz-index: 3;\n\tbackground: var(--sc-primary-color, #827553) !important;\n\tborder-color: var(--sc-primary-color, #827553) !important;\n\tcolor: var(--sc-primary-text-color, #fff) !important;\n}\n\n.tabs li:before,\n.tabs li:after,\n.tabs li a:before,\n.tabs li a:after {\n\tposition: absolute;\n\tbottom: 0;\n}\n\n.tabs li:last-child:after,\n.tabs li:last-child a:after,\n.tabs li:first-child:before,\n.tabs li:first-child a:before,\n.tabs .router-link-active:after,\n.tabs .router-link-active:before,\n.tabs .router-link-active a:after,\n.tabs .router-link-active a:before {\n\tcontent: '';\n}\n\n.tabs .router-link-active:before,\n.tabs .router-link-active:after {\n\tbackground: transparent;\n\tz-index: 1;\n}\n\n/* Squares */\n.tabs li:before,\n.tabs li:after {\n\tbackground: transparent;\n\twidth: 10px;\n\theight: 10px;\n}\n.tabs li:before {\n\tleft: -10px;\n}\n.tabs li:after {\n\tright: -10px;\n}\n\n/* Circles */\n.tabs li a:after,\n.tabs li a:before {\n\twidth: 20px;\n\theight: 20px;\n\t-webkit-border-radius: 10px;\n\t-moz-border-radius: 10px;\n\tborder-radius: 10px;\n\tbackground: transparent;\n\tz-index: 2;\n}\n.tabs .router-link-active a:after,\n.tabs .router-link-active a:before {\n\tbackground: transparent;\n}\n.tabs li:first-child.router-link-active a:before,\n.tabs li:last-child.router-link-active a:after {\n\tbackground: transparent;\n}\n.tabs li a:before {\n\tleft: -20px;\n}\n.tabs li a:after {\n\tright: -20px;\n}\n\n/* Hide breadcrumbs tab - 15% larger */\n.hidebreadcrumbs a {\n\tmin-width: 2.875rem;\n\twidth: 2.875rem;\n\theight: 2.6rem;\n\tpadding: 0.575rem;\n\tbackground: var(--sc-btn-color, #ffffff);\n\tborder: 1px solid var(--sc-btn-border, #ccc);\n\tcolor: var(--sc-gray-80, #333);\n}\n\n.hidebreadcrumbs a div {\n\tfont-size: 1.45rem;\n}\n\n.rotated {\n\ttransform: rotate(45deg);\n\t-webkit-transform: rotate(45deg);\n\t-moz-transform: rotate(45deg);\n\t-ms-transform: rotate(45deg);\n\t-o-transform: rotate(45deg);\n\ttransition: transform 250ms ease;\n}\n.unrotated {\n\ttransform: rotate(0deg);\n\t-webkit-transform: rotate(0deg);\n\t-moz-transform: rotate(0deg);\n\t-ms-transform: rotate(0deg);\n\t-o-transform: rotate(0deg);\n\ttransition: transform 250ms ease;\n}\n\nli:active,\nli:hover,\nli:focus,\nli > a:active,\nli > a:hover,\nli > a:focus {\n\tz-index: 3;\n}\n\na:active,\na:hover,\na:focus {\n\toutline: 2px solid var(--sc-input-active-border-color, black);\n\tz-index: 3;\n}\n\n/* Home tab - 15% larger */\n.hometab a {\n\tmin-width: 2.875rem;\n\twidth: 2.875rem;\n\theight: 2.6rem;\n\tpadding: 0.575rem;\n\tbackground: var(--sc-btn-color, #ffffff);\n\tborder: 1px solid var(--sc-btn-border, #ccc);\n\tcolor: var(--sc-gray-80, #333);\n}\n\n.hometab .icon-placeholder {\n\tfont-size: 1.15rem;\n\tline-height: 1;\n}\n\n/* Search tab with animation - similar to ActionSet expand/collapse */\n.searchtab {\n\toverflow: hidden;\n}\n\n.searchtab a {\n\tmin-width: 2.875rem;\n\theight: 2.6rem;\n\tpadding: 0.575rem;\n\tbackground: var(--sc-btn-color, #ffffff);\n\tborder: 1px solid var(--sc-btn-border, #ccc);\n\tcolor: var(--sc-gray-80, #333);\n\toverflow: hidden;\n\t/* Animation for smooth expand/collapse */\n\tmax-width: 2.875rem;\n\ttransition: max-width 0.35s ease-in-out, padding 0.35s ease-in-out, background 0.2s ease;\n}\n\n.searchtab .search-icon {\n\tfont-size: 1.15rem;\n\twidth: 1.15rem;\n\theight: 1.15rem;\n\tline-height: 1;\n\tcursor: pointer;\n\tflex-shrink: 0;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n.searchtab input {\n\toutline: none;\n\tborder: 1px solid var(--sc-input-border-color, #ccc);\n\tborder-radius: 0.25rem;\n\tbackground-color: var(--sc-form-background, #ffffff);\n\tcolor: var(--sc-gray-80, #333);\n\ttext-align: left;\n\tfont-size: 0.875rem;\n\tpadding: 0.25rem 0.5rem;\n\twidth: 180px;\n\theight: 1.5rem;\n\tflex-shrink: 0;\n\topacity: 0;\n\ttransition: opacity 0.2s ease-in-out;\n\ttransition-delay: 0s;\n}\n\n.searchtab input:focus {\n\tborder-color: var(--sc-input-active-border-color, #4f46e5);\n\toutline: none;\n}\n\n.searchtab input::placeholder {\n\tcolor: var(--sc-input-label-color, #999);\n}\n\n/* Search active state - expanded with animation */\n.searchtab.search-active a {\n\tmax-width: 220px;\n\tmin-width: auto;\n\twidth: auto;\n\tpadding: 0.575rem 0.75rem;\n}\n\n.searchtab.search-active input {\n\topacity: 1;\n\ttransition-delay: 0.15s;\n}\n</style>\n","<template>\n\t<div class=\"desktop\" @click=\"handleClick\">\n\t\t<!-- Action Set -->\n\t\t<ActionSet :elements=\"actionElements\" @action-click=\"handleActionClick\" />\n\n\t\t<!-- Main content using AForm -->\n\t\t<AForm v-if=\"writableSchema.length > 0\" v-model=\"writableSchema\" :data=\"currentViewData\" />\n\t\t<div v-else-if=\"!stonecrop\" class=\"loading\"><p>Initializing Stonecrop...</p></div>\n\t\t<div v-else class=\"loading\">\n\t\t\t<p>Loading {{ currentView }} data...</p>\n\t\t</div>\n\n\t\t<!-- Sheet Navigation -->\n\t\t<SheetNav :breadcrumbs=\"navigationBreadcrumbs\" />\n\n\t\t<!-- Command Palette -->\n\t\t<CommandPalette\n\t\t\t:is-open=\"commandPaletteOpen\"\n\t\t\t:search=\"searchCommands\"\n\t\t\tplaceholder=\"Type a command or search...\"\n\t\t\t@select=\"executeCommand\"\n\t\t\t@close=\"commandPaletteOpen = false\">\n\t\t\t<template #title=\"{ result }\">\n\t\t\t\t{{ result.title }}\n\t\t\t</template>\n\t\t\t<template #content=\"{ result }\">\n\t\t\t\t{{ result.description }}\n\t\t\t</template>\n\t\t</CommandPalette>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { useStonecrop } from '@stonecrop/stonecrop'\nimport { AForm, type SchemaTypes, type TableColumn, type TableConfig } from '@stonecrop/aform'\nimport { computed, nextTick, onMounted, provide, ref, unref, watch } from 'vue'\n\nimport ActionSet from './ActionSet.vue'\nimport SheetNav from './SheetNav.vue'\nimport CommandPalette from './CommandPalette.vue'\nimport type { ActionElements } from '../types'\n\nconst { availableDoctypes = [] } = defineProps<{ availableDoctypes?: string[] }>()\n\nconst { stonecrop } = useStonecrop()\n\n// State\nconst loading = ref(false)\nconst saving = ref(false)\nconst commandPaletteOpen = ref(false)\n\n// HST-based form data management - field triggers are handled automatically by HST\n\n// Computed property that reads from HST store for reactive form data\nconst currentViewData = computed<Record<string, any>>({\n\tget() {\n\t\tif (!stonecrop.value || !currentDoctype.value || !currentRecordId.value) {\n\t\t\treturn {}\n\t\t}\n\n\t\ttry {\n\t\t\tconst record = stonecrop.value.getRecordById(currentDoctype.value, currentRecordId.value)\n\t\t\treturn record?.get('') || {}\n\t\t} catch {\n\t\t\treturn {}\n\t\t}\n\t},\n\tset(newData: Record<string, any>) {\n\t\tif (!stonecrop.value || !currentDoctype.value || !currentRecordId.value) {\n\t\t\treturn\n\t\t}\n\n\t\ttry {\n\t\t\t// Update each field in HST, which will automatically trigger field actions\n\t\t\tconst hstStore = stonecrop.value.getStore()\n\t\t\tfor (const [fieldname, value] of Object.entries(newData)) {\n\t\t\t\tconst fieldPath = `${currentDoctype.value}.${currentRecordId.value}.${fieldname}`\n\t\t\t\thstStore.set(fieldPath, value)\n\t\t\t}\n\t\t} catch (error) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn('HST update failed:', error)\n\t\t}\n\t},\n})\n\n// HST-based form data management - field triggers are handled automatically by HST\n\n// Computed properties for current route context\nconst route = computed(() => unref(stonecrop.value?.registry.router?.currentRoute))\nconst router = computed(() => stonecrop.value?.registry.router)\nconst currentDoctype = computed(() => {\n\tif (!route.value) return ''\n\n\t// First check if we have actualDoctype in meta (from registered routes)\n\tif (route.value.meta?.actualDoctype) {\n\t\treturn route.value.meta.actualDoctype as string\n\t}\n\n\t// For named routes, use params.doctype\n\tif (route.value.params.doctype) {\n\t\treturn route.value.params.doctype as string\n\t}\n\n\t// For catch-all routes that haven't been registered yet, extract from path\n\tconst pathMatch = route.value.params.pathMatch as string[] | undefined\n\tif (pathMatch && pathMatch.length > 0) {\n\t\treturn pathMatch[0]\n\t}\n\n\treturn ''\n})\n\n// The route doctype for display and navigation (e.g., 'todo')\nconst routeDoctype = computed(() => {\n\tif (!route.value) return ''\n\n\t// Check route meta first\n\tif (route.value.meta?.doctype) {\n\t\treturn route.value.meta.doctype as string\n\t}\n\n\t// For named routes, use params.doctype\n\tif (route.value.params.doctype) {\n\t\treturn route.value.params.doctype as string\n\t}\n\n\t// For catch-all routes, extract from path\n\tconst pathMatch = route.value.params.pathMatch as string[] | undefined\n\tif (pathMatch && pathMatch.length > 0) {\n\t\treturn pathMatch[0]\n\t}\n\n\treturn ''\n})\n\nconst currentRecordId = computed(() => {\n\tif (!route.value) return ''\n\n\t// For named routes, use params.recordId\n\tif (route.value.params.recordId) {\n\t\treturn route.value.params.recordId as string\n\t}\n\n\t// For catch-all routes that haven't been registered yet, extract from path\n\tconst pathMatch = route.value.params.pathMatch as string[] | undefined\n\tif (pathMatch && pathMatch.length > 1) {\n\t\treturn pathMatch[1]\n\t}\n\n\treturn ''\n})\nconst isNewRecord = computed(() => currentRecordId.value?.startsWith('new-'))\n\n// Determine current view based on route\nconst currentView = computed(() => {\n\tif (!route.value) {\n\t\treturn 'doctypes'\n\t}\n\n\t// Home route\n\tif (route.value.name === 'home' || route.value.path === '/') {\n\t\treturn 'doctypes'\n\t}\n\n\t// Named routes from registered doctypes\n\tif (route.value.name && route.value.name !== 'catch-all') {\n\t\tconst routeName = route.value.name as string\n\t\tif (routeName.includes('form') || route.value.params.recordId) {\n\t\t\treturn 'record'\n\t\t} else if (routeName.includes('list') || route.value.params.doctype) {\n\t\t\treturn 'records'\n\t\t}\n\t}\n\n\t// Catch-all route - determine from path structure\n\tconst pathMatch = route.value.params.pathMatch as string[] | undefined\n\tif (pathMatch && pathMatch.length > 0) {\n\t\tconst view = pathMatch.length === 1 ? 'records' : 'record'\n\t\treturn view\n\t}\n\n\treturn 'doctypes'\n})\n\n// Computed properties (now that all helper functions are defined)\n// Helper function to get available transitions for current record\nconst getAvailableTransitions = () => {\n\tif (!stonecrop.value || !currentDoctype.value || !currentRecordId.value) {\n\t\treturn []\n\t}\n\n\ttry {\n\t\tconst registry = stonecrop.value.registry\n\t\tconst meta = registry.registry[currentDoctype.value]\n\n\t\tif (!meta?.workflow?.states) {\n\t\t\treturn []\n\t\t}\n\n\t\t// Get current FSM state (for now, use workflow initial state or 'editing')\n\t\t// In a full implementation, this would track actual FSM state\n\t\tconst currentState = isNewRecord.value ? 'creating' : 'editing'\n\t\tconst stateConfig = meta.workflow.states[currentState]\n\n\t\tif (!stateConfig?.on) {\n\t\t\treturn []\n\t\t}\n\n\t\t// Get available transitions from current state\n\t\tconst transitions = Object.keys(stateConfig.on)\n\n\t\t// Create action elements for each transition\n\t\tconst actionElements = transitions.map(transition => {\n\t\t\tconst targetState = stateConfig.on?.[transition]\n\t\t\tconst targetStateName = typeof targetState === 'string' ? targetState : 'unknown'\n\n\t\t\tconst actionFn = async () => {\n\t\t\t\tconst node = stonecrop.value?.getRecordById(currentDoctype.value, currentRecordId.value)\n\t\t\t\tif (node) {\n\t\t\t\t\tconst recordData = currentViewData.value || {}\n\t\t\t\t\tawait node.triggerTransition(transition, {\n\t\t\t\t\t\tcurrentState,\n\t\t\t\t\t\ttargetState: targetStateName,\n\t\t\t\t\t\tfsmContext: recordData,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst element = {\n\t\t\t\tlabel: `${transition} (→ ${targetStateName})`,\n\t\t\t\taction: actionFn,\n\t\t\t}\n\n\t\t\treturn element\n\t\t})\n\n\t\treturn actionElements\n\t} catch (error) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn('Error getting available transitions:', error)\n\t\treturn []\n\t}\n}\n\n// New component reactive properties// New component reactive properties\nconst actionElements = computed<ActionElements[]>(() => {\n\tconst elements: ActionElements[] = []\n\n\tswitch (currentView.value) {\n\t\tcase 'doctypes':\n\t\t\telements.push({\n\t\t\t\ttype: 'button',\n\t\t\t\tlabel: 'Refresh',\n\t\t\t\taction: () => {\n\t\t\t\t\t// Refresh doctypes\n\t\t\t\t\twindow.location.reload()\n\t\t\t\t},\n\t\t\t})\n\t\t\tbreak\n\t\tcase 'records':\n\t\t\telements.push(\n\t\t\t\t{\n\t\t\t\t\ttype: 'button',\n\t\t\t\t\tlabel: 'New Record',\n\t\t\t\t\taction: () => void createNewRecord(),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttype: 'button',\n\t\t\t\t\tlabel: 'Refresh',\n\t\t\t\t\taction: () => {\n\t\t\t\t\t\t// Refresh records\n\t\t\t\t\t\twindow.location.reload()\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t)\n\t\t\tbreak\n\t\tcase 'record': {\n\t\t\t// Add XState Transitions dropdown for record view\n\t\t\tconst transitionActions = getAvailableTransitions()\n\t\t\tif (transitionActions.length > 0) {\n\t\t\t\telements.push({\n\t\t\t\t\ttype: 'dropdown',\n\t\t\t\t\tlabel: 'Actions',\n\t\t\t\t\tactions: transitionActions,\n\t\t\t\t})\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn elements\n})\n\nconst navigationBreadcrumbs = computed(() => {\n\tconst breadcrumbs: { title: string; to: string }[] = []\n\n\tif (currentView.value === 'records' && routeDoctype.value) {\n\t\tbreadcrumbs.push(\n\t\t\t{ title: 'Home', to: '/' },\n\t\t\t{ title: formatDoctypeName(routeDoctype.value), to: `/${routeDoctype.value}` }\n\t\t)\n\t} else if (currentView.value === 'record' && routeDoctype.value) {\n\t\tbreadcrumbs.push(\n\t\t\t{ title: 'Home', to: '/' },\n\t\t\t{ title: formatDoctypeName(routeDoctype.value), to: `/${routeDoctype.value}` },\n\t\t\t{ title: isNewRecord.value ? 'New Record' : 'Edit Record', to: route.value?.fullPath || '' }\n\t\t)\n\t}\n\n\treturn breadcrumbs\n})\n\n// Command palette functionality\ntype Command = {\n\ttitle: string\n\tdescription: string\n\taction: () => void\n}\n\nconst searchCommands = (query: string): Command[] => {\n\tconst commands: Command[] = [\n\t\t{\n\t\t\ttitle: 'Go Home',\n\t\t\tdescription: 'Navigate to the home page',\n\t\t\taction: () => void router.value?.push('/'),\n\t\t},\n\t\t{\n\t\t\ttitle: 'Toggle Command Palette',\n\t\t\tdescription: 'Open/close the command palette',\n\t\t\taction: () => (commandPaletteOpen.value = !commandPaletteOpen.value),\n\t\t},\n\t]\n\n\t// Add doctype-specific commands\n\tif (routeDoctype.value) {\n\t\tcommands.push({\n\t\t\ttitle: `View ${formatDoctypeName(routeDoctype.value)} Records`,\n\t\t\tdescription: `Navigate to ${routeDoctype.value} list`,\n\t\t\taction: () => void router.value?.push(`/${routeDoctype.value}`),\n\t\t})\n\n\t\tcommands.push({\n\t\t\ttitle: `Create New ${formatDoctypeName(routeDoctype.value)}`,\n\t\t\tdescription: `Create a new ${routeDoctype.value} record`,\n\t\t\taction: () => void createNewRecord(),\n\t\t})\n\t}\n\n\t// Add available doctypes as commands\n\tavailableDoctypes.forEach(doctype => {\n\t\tcommands.push({\n\t\t\ttitle: `View ${formatDoctypeName(doctype)}`,\n\t\t\tdescription: `Navigate to ${doctype} list`,\n\t\t\taction: () => void router.value?.push(`/${doctype}`),\n\t\t})\n\t})\n\n\t// Filter commands based on query\n\tif (!query) return commands\n\n\treturn commands.filter(\n\t\tcmd =>\n\t\t\tcmd.title.toLowerCase().includes(query.toLowerCase()) ||\n\t\t\tcmd.description.toLowerCase().includes(query.toLowerCase())\n\t)\n}\n\nconst executeCommand = (command: Command) => {\n\tcommand.action()\n\tcommandPaletteOpen.value = false\n}\n\n// Helper functions - moved here to avoid \"before initialization\" errors\nconst formatDoctypeName = (doctype: string): string => {\n\treturn doctype\n\t\t.split('-')\n\t\t.map(word => word.charAt(0).toUpperCase() + word.slice(1))\n\t\t.join(' ')\n}\n\nconst getRecordCount = (doctype: string): number => {\n\tif (!stonecrop.value) return 0\n\tconst recordIds = stonecrop.value.getRecordIds(doctype)\n\treturn recordIds.length\n}\n\nconst navigateToDoctype = async (doctype: string) => {\n\tawait router.value?.push(`/${doctype}`)\n}\n\nconst openRecord = async (recordId: string) => {\n\tawait router.value?.push(`/${routeDoctype.value}/${recordId}`)\n}\n\nconst createNewRecord = async () => {\n\tconst newId = `new-${Date.now()}`\n\tawait router.value?.push(`/${routeDoctype.value}/${newId}`)\n}\n\n// Doctype metadata loader - simplified since router handles most of this\nconst loadDoctypeMetadata = (doctype: string) => {\n\tif (!stonecrop.value) return\n\n\t// Ensure the doctype structure exists in HST\n\t// The router should have already loaded the metadata, but this ensures the HST structure exists\n\ttry {\n\t\tstonecrop.value.records(doctype)\n\t} catch (error) {\n\t\t// Silent error handling - structure will be created if needed\n\t}\n}\n\n// Schema generator functions - moved here to be available to computed properties\nconst getDoctypesSchema = (): SchemaTypes[] => {\n\tif (!availableDoctypes.length) return []\n\n\tconst rows = availableDoctypes.map(doctype => ({\n\t\tid: doctype,\n\t\tdoctype,\n\t\tdisplay_name: formatDoctypeName(doctype),\n\t\trecord_count: getRecordCount(doctype),\n\t\tactions: 'View Records',\n\t}))\n\n\treturn [\n\t\t{\n\t\t\tfieldname: 'header',\n\t\t\tcomponent: 'div',\n\t\t\tvalue: `\n\t\t\t\t<div class=\"view-header\">\n\t\t\t\t\t<h1>Available Doctypes</h1>\n\t\t\t\t</div>\n\t\t\t`,\n\t\t},\n\t\t{\n\t\t\tfieldname: 'doctypes_table',\n\t\t\tcomponent: 'ATable',\n\t\t\tcolumns: [\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Doctype',\n\t\t\t\t\tname: 'doctype',\n\t\t\t\t\ttype: 'Data',\n\t\t\t\t\talign: 'left',\n\t\t\t\t\tedit: false,\n\t\t\t\t\twidth: '20ch',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Name',\n\t\t\t\t\tname: 'display_name',\n\t\t\t\t\ttype: 'Data',\n\t\t\t\t\talign: 'left',\n\t\t\t\t\tedit: false,\n\t\t\t\t\twidth: '30ch',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Records',\n\t\t\t\t\tname: 'record_count',\n\t\t\t\t\ttype: 'Data',\n\t\t\t\t\talign: 'center',\n\t\t\t\t\tedit: false,\n\t\t\t\t\twidth: '15ch',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Actions',\n\t\t\t\t\tname: 'actions',\n\t\t\t\t\ttype: 'Data',\n\t\t\t\t\talign: 'center',\n\t\t\t\t\tedit: false,\n\t\t\t\t\twidth: '20ch',\n\t\t\t\t},\n\t\t\t] as TableColumn[],\n\t\t\tconfig: {\n\t\t\t\tview: 'list',\n\t\t\t\tfullWidth: true,\n\t\t\t} as TableConfig,\n\t\t\trows,\n\t\t},\n\t]\n}\n\nconst getRecordsSchema = (): SchemaTypes[] => {\n\tif (!currentDoctype.value) return []\n\tif (!stonecrop.value) return []\n\n\tconst records = getRecords()\n\tconst columns = getColumns()\n\n\t// If no columns are available, show a loading or empty state\n\tif (columns.length === 0) {\n\t\treturn [\n\t\t\t{\n\t\t\t\tfieldname: 'header',\n\t\t\t\tcomponent: 'div',\n\t\t\t\tvalue: `\n\t\t\t\t\t<div class=\"view-header\">\n\t\t\t\t\t\t<nav class=\"breadcrumbs\">\n\t\t\t\t\t\t\t<a href=\"/\">Home</a>\n\t\t\t\t\t\t\t<span class=\"separator\">/</span>\n\t\t\t\t\t\t\t<span class=\"current\">${formatDoctypeName(routeDoctype.value || currentDoctype.value)}</span>\n\t\t\t\t\t\t</nav>\n\t\t\t\t\t\t<h1>${formatDoctypeName(routeDoctype.value || currentDoctype.value)} Records</h1>\n\t\t\t\t\t</div>\n\t\t\t\t`,\n\t\t\t},\n\t\t\t{\n\t\t\t\tfieldname: 'loading',\n\t\t\t\tcomponent: 'div',\n\t\t\t\tvalue: `\n\t\t\t\t\t<div class=\"loading-state\">\n\t\t\t\t\t\t<p>Loading ${formatDoctypeName(routeDoctype.value || currentDoctype.value)} schema...</p>\n\t\t\t\t\t</div>\n\t\t\t\t`,\n\t\t\t},\n\t\t]\n\t}\n\n\tconst rows = records.map((record: any) => ({\n\t\t...record,\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\t\tid: record.id || '',\n\t\tactions: 'Edit | Delete',\n\t}))\n\n\treturn [\n\t\t{\n\t\t\tfieldname: 'header',\n\t\t\tcomponent: 'div',\n\t\t\tvalue: `\n\t\t\t\t<div class=\"view-header\">\n\t\t\t\t\t<nav class=\"breadcrumbs\">\n\t\t\t\t\t\t<a href=\"/\">Home</a>\n\t\t\t\t\t\t<span class=\"separator\">/</span>\n\t\t\t\t\t\t<span class=\"current\">${formatDoctypeName(routeDoctype.value || currentDoctype.value)}</span>\n\t\t\t\t\t</nav>\n\t\t\t\t\t<h1>${formatDoctypeName(routeDoctype.value || currentDoctype.value)} Records</h1>\n\t\t\t\t</div>\n\t\t\t`,\n\t\t},\n\t\t{\n\t\t\tfieldname: 'actions',\n\t\t\tcomponent: 'div',\n\t\t\tvalue: `\n\t\t\t\t<div class=\"view-actions\">\n\t\t\t\t\t<button class=\"btn-primary\" data-action=\"create\">\n\t\t\t\t\t\tNew ${formatDoctypeName(routeDoctype.value || currentDoctype.value)}\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t`,\n\t\t},\n\t\t...(records.length === 0\n\t\t\t? [\n\t\t\t\t\t{\n\t\t\t\t\t\tfieldname: 'empty_state',\n\t\t\t\t\t\tcomponent: 'div',\n\t\t\t\t\t\tvalue: `\n\t\t\t\t\t\t\t<div class=\"empty-state\">\n\t\t\t\t\t\t\t\t<p>No ${routeDoctype.value || currentDoctype.value} records found.</p>\n\t\t\t\t\t\t\t\t<button class=\"btn-primary\" data-action=\"create\">\n\t\t\t\t\t\t\t\t\tCreate First Record\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t`,\n\t\t\t\t\t},\n\t\t\t ]\n\t\t\t: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfieldname: 'records_table',\n\t\t\t\t\t\tcomponent: 'ATable',\n\t\t\t\t\t\tcolumns: [\n\t\t\t\t\t\t\t...columns.map(col => ({\n\t\t\t\t\t\t\t\tlabel: col.label,\n\t\t\t\t\t\t\t\tname: col.fieldname,\n\t\t\t\t\t\t\t\ttype: col.fieldtype,\n\t\t\t\t\t\t\t\talign: 'left',\n\t\t\t\t\t\t\t\tedit: false,\n\t\t\t\t\t\t\t\twidth: '20ch',\n\t\t\t\t\t\t\t})),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: 'Actions',\n\t\t\t\t\t\t\t\tname: 'actions',\n\t\t\t\t\t\t\t\ttype: 'Data',\n\t\t\t\t\t\t\t\talign: 'center',\n\t\t\t\t\t\t\t\tedit: false,\n\t\t\t\t\t\t\t\twidth: '20ch',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t] as TableColumn[],\n\t\t\t\t\t\tconfig: {\n\t\t\t\t\t\t\tview: 'list',\n\t\t\t\t\t\t\tfullWidth: true,\n\t\t\t\t\t\t} as TableConfig,\n\t\t\t\t\t\trows,\n\t\t\t\t\t},\n\t\t\t ]),\n\t]\n}\n\nconst getRecordFormSchema = (): SchemaTypes[] => {\n\tif (!currentDoctype.value) return []\n\tif (!stonecrop.value) return []\n\n\ttry {\n\t\tconst registry = stonecrop.value?.registry\n\t\tconst meta = registry?.registry[currentDoctype.value]\n\n\t\tif (!meta?.schema) {\n\t\t\t// Return loading state if schema isn't available yet\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tfieldname: 'header',\n\t\t\t\t\tcomponent: 'div',\n\t\t\t\t\tvalue: `\n\t\t\t\t\t\t<div class=\"view-header\">\n\t\t\t\t\t\t\t<nav class=\"breadcrumbs\">\n\t\t\t\t\t\t\t\t<a href=\"/\">Home</a>\n\t\t\t\t\t\t\t\t<span class=\"separator\">/</span>\n\t\t\t\t\t\t\t\t<a href=\"/${routeDoctype.value || currentDoctype.value}\">${formatDoctypeName(\n\t\t\t\t\t\trouteDoctype.value || currentDoctype.value\n\t\t\t\t\t)}</a>\n\t\t\t\t\t\t\t\t<span class=\"separator\">/</span>\n\t\t\t\t\t\t\t\t<span class=\"current\">${isNewRecord.value ? 'New Record' : currentRecordId.value}</span>\n\t\t\t\t\t\t\t</nav>\n\t\t\t\t\t\t\t<h1>${\n\t\t\t\t\t\t\t\tisNewRecord.value\n\t\t\t\t\t\t\t\t\t? `New ${formatDoctypeName(routeDoctype.value || currentDoctype.value)}`\n\t\t\t\t\t\t\t\t\t: `Edit ${formatDoctypeName(routeDoctype.value || currentDoctype.value)}`\n\t\t\t\t\t\t\t}</h1>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t`,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tfieldname: 'loading',\n\t\t\t\t\tcomponent: 'div',\n\t\t\t\t\tvalue: `\n\t\t\t\t\t\t<div class=\"loading-state\">\n\t\t\t\t\t\t\t<p>Loading ${formatDoctypeName(routeDoctype.value || currentDoctype.value)} form...</p>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t`,\n\t\t\t\t},\n\t\t\t]\n\t\t}\n\n\t\tconst schemaArray = 'toArray' in meta.schema ? meta.schema.toArray() : meta.schema\n\t\tconst currentRecord = getCurrentRecord()\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tfieldname: 'header',\n\t\t\t\tcomponent: 'div',\n\t\t\t\tvalue: `\n\t\t\t\t\t<div class=\"view-header\">\n\t\t\t\t\t\t<nav class=\"breadcrumbs\">\n\t\t\t\t\t\t\t<a href=\"/\">Home</a>\n\t\t\t\t\t\t\t<span class=\"separator\">/</span>\n\t\t\t\t\t\t\t<a href=\"/${routeDoctype.value || currentDoctype.value}\">${formatDoctypeName(\n\t\t\t\t\trouteDoctype.value || currentDoctype.value\n\t\t\t\t)}</a>\n\t\t\t\t\t\t\t<span class=\"separator\">/</span>\n\t\t\t\t\t\t\t<span class=\"current\">${isNewRecord.value ? 'New Record' : currentRecordId.value}</span>\n\t\t\t\t\t\t</nav>\n\t\t\t\t\t\t<h1>\n\t\t\t\t\t\t\t${\n\t\t\t\t\t\t\t\tisNewRecord.value\n\t\t\t\t\t\t\t\t\t? `New ${formatDoctypeName(routeDoctype.value || currentDoctype.value)}`\n\t\t\t\t\t\t\t\t\t: `Edit ${formatDoctypeName(routeDoctype.value || currentDoctype.value)}`\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</h1>\n\t\t\t\t\t</div>\n\t\t\t\t`,\n\t\t\t},\n\t\t\t{\n\t\t\t\tfieldname: 'actions',\n\t\t\t\tcomponent: 'div',\n\t\t\t\tvalue: `\n\t\t\t\t\t<div class=\"view-actions\">\n\t\t\t\t\t\t<button class=\"btn-primary\" data-action=\"save\" ${saving.value ? 'disabled' : ''}>\n\t\t\t\t\t\t\t${saving.value ? 'Saving...' : 'Save'}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<button class=\"btn-secondary\" data-action=\"cancel\">Cancel</button>\n\t\t\t\t\t\t${!isNewRecord.value ? '<button class=\"btn-danger\" data-action=\"delete\">Delete</button>' : ''}\n\t\t\t\t\t</div>\n\t\t\t\t`,\n\t\t\t},\n\t\t\t...schemaArray.map(field => ({\n\t\t\t\t...field,\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\t\t\t\tvalue: currentRecord[field.fieldname] || '',\n\t\t\t})),\n\t\t]\n\t} catch (error) {\n\t\treturn [\n\t\t\t{\n\t\t\t\tfieldname: 'error',\n\t\t\t\tcomponent: 'div',\n\t\t\t\tvalue: `\n\t\t\t\t\t<div class=\"error-state\">\n\t\t\t\t\t\t<p>Unable to load form schema for ${formatDoctypeName(routeDoctype.value || currentDoctype.value)}</p>\n\t\t\t\t\t</div>\n\t\t\t\t`,\n\t\t\t},\n\t\t]\n\t}\n}\n\n// Additional data helper functions\nconst getRecords = () => {\n\tif (!stonecrop.value || !currentDoctype.value) {\n\t\treturn []\n\t}\n\n\tconst recordsNode = stonecrop.value.records(currentDoctype.value)\n\tconst recordsData = recordsNode?.get('')\n\n\tif (recordsData && typeof recordsData === 'object' && !Array.isArray(recordsData)) {\n\t\treturn Object.values(recordsData as Record<string, any>)\n\t}\n\n\treturn []\n}\n\nconst getColumns = () => {\n\tif (!stonecrop.value || !currentDoctype.value) return []\n\n\ttry {\n\t\tconst registry = stonecrop.value.registry\n\t\tconst meta = registry.registry[currentDoctype.value]\n\n\t\tif (meta?.schema) {\n\t\t\tconst schemaArray = 'toArray' in meta.schema ? meta.schema.toArray() : meta.schema\n\t\t\treturn schemaArray.map(field => ({\n\t\t\t\tfieldname: field.fieldname,\n\t\t\t\tlabel: ('label' in field && field.label) || field.fieldname,\n\t\t\t\tfieldtype: ('fieldtype' in field && field.fieldtype) || 'Data',\n\t\t\t}))\n\t\t}\n\t} catch (error) {\n\t\t// Error getting schema - return empty array\n\t}\n\n\treturn []\n}\n\nconst getCurrentRecord = () => {\n\tif (!stonecrop.value || !currentDoctype.value || isNewRecord.value) return {}\n\n\tconst record = stonecrop.value.getRecordById(currentDoctype.value, currentRecordId.value)\n\treturn record?.get('') || {}\n}\n\n// Schema for different views - defined here after all helper functions are available\nconst currentViewSchema = computed<SchemaTypes[]>(() => {\n\tswitch (currentView.value) {\n\t\tcase 'doctypes':\n\t\t\treturn getDoctypesSchema()\n\t\tcase 'records':\n\t\t\treturn getRecordsSchema()\n\t\tcase 'record':\n\t\t\treturn getRecordFormSchema()\n\t\tdefault:\n\t\t\treturn []\n\t}\n})\n\n// Writable schema for AForm v-model binding\nconst writableSchema = ref<SchemaTypes[]>([])\n\n// Sync computed schema to writable schema when it changes\nwatch(\n\tcurrentViewSchema,\n\tnewSchema => {\n\t\twritableSchema.value = [...newSchema]\n\t},\n\t{ immediate: true, deep: true }\n)\n\n// Watch for field changes in writable schema and sync to HST\nwatch(\n\twritableSchema,\n\tnewSchema => {\n\t\tif (!stonecrop.value || !currentDoctype.value || !currentRecordId.value || isNewRecord.value) {\n\t\t\treturn\n\t\t}\n\n\t\ttry {\n\t\t\tconst hstStore = stonecrop.value.getStore()\n\n\t\t\t// Process form field updates from schema\n\t\t\tnewSchema.forEach(field => {\n\t\t\t\t// Only process fields that have a fieldname and value (form fields)\n\t\t\t\tif (\n\t\t\t\t\tfield.fieldname &&\n\t\t\t\t\t'value' in field &&\n\t\t\t\t\t!['header', 'actions', 'loading', 'error'].includes(field.fieldname)\n\t\t\t\t) {\n\t\t\t\t\tconst fieldPath = `${currentDoctype.value}.${currentRecordId.value}.${field.fieldname}`\n\t\t\t\t\tconst currentValue = hstStore.has(fieldPath) ? hstStore.get(fieldPath) : undefined\n\n\t\t\t\t\t// Only update if value actually changed to avoid infinite loops\n\t\t\t\t\tif (currentValue !== field.value) {\n\t\t\t\t\t\thstStore.set(fieldPath, field.value)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t} catch (error) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn('HST schema sync failed:', error)\n\t\t}\n\t},\n\t{ deep: true }\n)\n\n// Action handlers (will be triggered by button clicks in the UI)\nconst handleSave = async () => {\n\t// eslint-disable-next-line no-console\n\tif (!stonecrop.value) return\n\n\tsaving.value = true\n\n\ttry {\n\t\tconst formData = currentViewData.value || {}\n\n\t\tif (isNewRecord.value) {\n\t\t\tconst newId = `record-${Date.now()}`\n\t\t\tconst recordData = { id: newId, ...formData }\n\n\t\t\tstonecrop.value.addRecord(currentDoctype.value, newId, recordData)\n\n\t\t\t// Trigger SAVE transition for new record\n\t\t\tconst node = stonecrop.value.getRecordById(currentDoctype.value, newId)\n\t\t\tif (node) {\n\t\t\t\tawait node.triggerTransition('SAVE', {\n\t\t\t\t\tcurrentState: 'creating',\n\t\t\t\t\ttargetState: 'saved',\n\t\t\t\t\tfsmContext: recordData,\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tawait router.value?.replace(`/${routeDoctype.value}/${newId}`)\n\t\t} else {\n\t\t\tconst recordData = { id: currentRecordId.value, ...formData }\n\t\t\tstonecrop.value.addRecord(currentDoctype.value, currentRecordId.value, recordData)\n\n\t\t\t// Trigger SAVE transition for existing record\n\t\t\tconst node = stonecrop.value.getRecordById(currentDoctype.value, currentRecordId.value)\n\t\t\tif (node) {\n\t\t\t\tawait node.triggerTransition('SAVE', {\n\t\t\t\t\tcurrentState: 'editing',\n\t\t\t\t\ttargetState: 'saved',\n\t\t\t\t\tfsmContext: recordData,\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t} catch (error) {\n\t\t// Silently handle error\n\t} finally {\n\t\tsaving.value = false\n\t}\n}\n\nconst handleCancel = async () => {\n\tif (isNewRecord.value) {\n\t\t// For new records, we don't have a specific record node yet\n\t\t// Just navigate back without triggering transition\n\t\tawait router.value?.push(`/${routeDoctype.value}`)\n\t} else {\n\t\t// Trigger CANCEL transition for existing record\n\t\tif (stonecrop.value) {\n\t\t\tconst node = stonecrop.value.getRecordById(currentDoctype.value, currentRecordId.value)\n\t\t\tif (node) {\n\t\t\t\tawait node.triggerTransition('CANCEL', {\n\t\t\t\t\tcurrentState: 'editing',\n\t\t\t\t\ttargetState: 'cancelled',\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\t// Reload current record data\n\t\tloadRecordData()\n\t}\n}\n\nconst handleActionClick = (label: string, action: (() => void | Promise<void>) | undefined) => {\n\t// eslint-disable-next-line no-console\n\tif (action) {\n\t\tvoid action()\n\t}\n}\n\nconst handleDelete = async (recordId?: string) => {\n\tif (!stonecrop.value) return\n\n\tconst targetRecordId = recordId || currentRecordId.value\n\tif (!targetRecordId) return\n\n\tif (confirm('Are you sure you want to delete this record?')) {\n\t\t// Trigger DELETE transition before removing\n\t\tconst node = stonecrop.value.getRecordById(currentDoctype.value, targetRecordId)\n\t\tif (node) {\n\t\t\tawait node.triggerTransition('DELETE', {\n\t\t\t\tcurrentState: 'editing',\n\t\t\t\ttargetState: 'deleted',\n\t\t\t})\n\t\t}\n\n\t\tstonecrop.value.removeRecord(currentDoctype.value, targetRecordId)\n\n\t\tif (currentView.value === 'record') {\n\t\t\tawait router.value?.push(`/${routeDoctype.value}`)\n\t\t}\n\t}\n}\n\n// Event handlers\nconst handleClick = async (event: Event) => {\n\tconst target = event.target as HTMLElement\n\tconst action = target.getAttribute('data-action')\n\n\tif (action) {\n\t\tswitch (action) {\n\t\t\tcase 'create':\n\t\t\t\tawait createNewRecord()\n\t\t\t\tbreak\n\t\t\tcase 'save':\n\t\t\t\tawait handleSave()\n\t\t\t\tbreak\n\t\t\tcase 'cancel':\n\t\t\t\tawait handleCancel()\n\t\t\t\tbreak\n\t\t\tcase 'delete':\n\t\t\t\tawait handleDelete()\n\t\t\t\tbreak\n\t\t}\n\t}\n\n\t// Handle table cell clicks for actions\n\tconst cell = target.closest('td, th')\n\tif (cell) {\n\t\tconst cellText = cell.textContent?.trim()\n\t\tconst row = cell.closest('tr')\n\n\t\tif (cellText === 'View Records' && row) {\n\t\t\t// Get the doctype from the row data\n\t\t\tconst cells = row.querySelectorAll('td')\n\t\t\tif (cells.length > 0) {\n\t\t\t\tconst doctypeCell = cells[1] // Assuming doctype is in second column (first column is index)\n\t\t\t\tconst doctype = doctypeCell.textContent?.trim()\n\t\t\t\tif (doctype) {\n\t\t\t\t\tawait navigateToDoctype(doctype)\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (cellText?.includes('Edit') && row) {\n\t\t\t// Get the record ID from the row\n\t\t\tconst cells = row.querySelectorAll('td')\n\t\t\tif (cells.length > 0) {\n\t\t\t\tconst idCell = cells[0] // Assuming ID is in first column\n\t\t\t\tconst recordId = idCell.textContent?.trim()\n\t\t\t\tif (recordId) {\n\t\t\t\t\tawait openRecord(recordId)\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (cellText?.includes('Delete') && row) {\n\t\t\t// Get the record ID from the row\n\t\t\tconst cells = row.querySelectorAll('td')\n\t\t\tif (cells.length > 0) {\n\t\t\t\tconst idCell = cells[0] // Assuming ID is in first column\n\t\t\t\tconst recordId = idCell.textContent?.trim()\n\t\t\t\tif (recordId) {\n\t\t\t\t\tawait handleDelete(recordId)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n// Watch for route changes to load appropriate data\nwatch(\n\t[currentView, currentDoctype, currentRecordId],\n\t() => {\n\t\tif (currentView.value === 'record') {\n\t\t\tloadRecordData()\n\t\t}\n\t},\n\t{ immediate: true }\n)\n\n// Watch for Stonecrop instance to become available\nwatch(\n\tstonecrop,\n\tnewStonecrop => {\n\t\tif (newStonecrop) {\n\t\t\t// Force a re-evaluation of the current view schema when Stonecrop becomes available\n\t\t\t// This is handled automatically by the reactive computed properties\n\t\t}\n\t},\n\t{ immediate: true }\n)\n\n// Watch for when we need to load data for records view\nwatch(\n\t[currentView, currentDoctype, stonecrop],\n\t([view, doctype, stonecropInstance]) => {\n\t\tif (view === 'records' && doctype && stonecropInstance) {\n\t\t\t// Ensure doctype metadata is loaded\n\t\t\tloadDoctypeMetadata(doctype)\n\t\t}\n\t},\n\t{ immediate: true }\n)\n\nconst loadRecordData = () => {\n\tif (!stonecrop.value || !currentDoctype.value) return\n\n\tloading.value = true\n\n\ttry {\n\t\tif (!isNewRecord.value) {\n\t\t\t// For existing records, ensure the record exists in HST\n\t\t\t// The computed currentViewData will automatically read from HST\n\t\t\tstonecrop.value.getRecordById(currentDoctype.value, currentRecordId.value)\n\t\t}\n\t\t// For new records, currentViewData computed property will return {} automatically\n\t} catch (error) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn('Error loading record data:', error)\n\t} finally {\n\t\tloading.value = false\n\t}\n}\n\n// Provide methods for action components\nconst desktopMethods = {\n\tnavigateToDoctype,\n\topenRecord,\n\tcreateNewRecord,\n\thandleSave,\n\thandleCancel,\n\thandleDelete,\n}\n\nprovide('desktopMethods', desktopMethods)\n\n// Register action components in Vue app\nonMounted(() => {\n\t// Wait a tick for stonecrop to be ready, then load initial data\n\tvoid nextTick(() => {\n\t\tif (currentView.value === 'records' && currentDoctype.value && stonecrop.value) {\n\t\t\tloadDoctypeMetadata(currentDoctype.value)\n\t\t}\n\t})\n\n\t// Components will be automatically registered via the global component system\n\n\t// Add keyboard shortcuts\n\tconst handleKeydown = (event: KeyboardEvent) => {\n\t\t// Ctrl+K or Cmd+K to open command palette\n\t\tif ((event.ctrlKey || event.metaKey) && event.key === 'k') {\n\t\t\tevent.preventDefault()\n\t\t\tcommandPaletteOpen.value = true\n\t\t}\n\t\t// Escape to close command palette\n\t\tif (event.key === 'Escape' && commandPaletteOpen.value) {\n\t\t\tcommandPaletteOpen.value = false\n\t\t}\n\t}\n\n\tdocument.addEventListener('keydown', handleKeydown)\n\n\t// Cleanup event listener on unmount\n\treturn () => {\n\t\tdocument.removeEventListener('keydown', handleKeydown)\n\t}\n})\n</script>\n","import { App, type Plugin } from 'vue'\n\nimport ActionSet from '../components/ActionSet.vue'\nimport CommandPalette from '../components/CommandPalette.vue'\nimport Desktop from '../components/Desktop.vue'\nimport SheetNav from '../components/SheetNav.vue'\n\n/**\n * This is the main plugin that will be used to register all the desktop components.\n * @public\n */\nconst plugin: Plugin = {\n\tinstall: (app: App) => {\n\t\tapp.component('ActionSet', ActionSet)\n\t\tapp.component('CommandPalette', CommandPalette)\n\t\tapp.component('Desktop', Desktop)\n\t\tapp.component('SheetNav', SheetNav)\n\t},\n}\n\nexport default plugin\n"],"names":["emit","__emit","dropdownStates","ref","isOpen","timeoutId","hover","closeClicked","onMounted","closeDropdowns","onHover","onHoverLeave","toggleDropdown","index","showDropdown","handleClick","action","label","_createElementBlock","_normalizeClass","_createElementVNode","_hoisted_1","_cache","$event","_openBlock","_Fragment","_renderList","__props","el","_toDisplayString","_hoisted_2","_hoisted_3","_hoisted_4","_withDirectives","_hoisted_5","_hoisted_6","item","itemIndex","_hoisted_7","_hoisted_9","_vShow","query","selectedIndex","inputRef","useTemplateRef","results","computed","watch","nextTick","closeModal","handleKeydown","e","selectResult","result","_createBlock","_Teleport","_createVNode","_Transition","_renderSlot","_ctx","re","ge","r","Ye","Z","se","ne","Be","t","n","o","X","ye","je","Pe","s","Fe","ke","q","Qe","Ne","me","Ee","Xe","et","Ie","$e","i","a","c","l","S","Re","M","w","P","te","B","$","Oe","u","g","T","k","_","D","f","O","ce","R","y","b","C","d","m","N","V","A","j","E","I","H","we","L","Ze","oe","Ve","tt","Ke","he","Ae","Ue","rt","nt","ot","st","We","it","Me","Ge","at","ze","ct","Se","ut","lt","ft","dt","pt","Le","ht","K","gt","J","Y","qe","le","fe","vt","yt","mt","St","bt","De","wt","xe","x","Et","be","de","_t","ue","p","h","v","F","W","z","ie$1","ie","G","Te","Q","ve","Pt","He","Ft","pe","Ce","Nt","_e","Zt","en","ae","breadcrumbsVisibile","searchVisible","searchText","rotateHideTabIcon","toggleBreadcrumbs","toggleSearch","handleSearchInput","event","handleSearch","navigateHome","_component_router_link","_withKeys","breadcrumb","_createTextVNode","stonecrop","useStonecrop","loading","saving","commandPaletteOpen","currentViewData","currentDoctype","currentRecordId","newData","hstStore","fieldname","value","fieldPath","error","route","unref","router","pathMatch","routeDoctype","isNewRecord","currentView","routeName","getAvailableTransitions","meta","currentState","stateConfig","transition","targetState","targetStateName","actionFn","node","recordData","actionElements","elements","createNewRecord","transitionActions","navigationBreadcrumbs","breadcrumbs","formatDoctypeName","searchCommands","commands","doctype","cmd","executeCommand","command","word","getRecordCount","navigateToDoctype","openRecord","recordId","newId","loadDoctypeMetadata","getDoctypesSchema","rows","getRecordsSchema","records","getRecords","columns","getColumns","record","col","getRecordFormSchema","schemaArray","currentRecord","getCurrentRecord","field","recordsData","currentViewSchema","writableSchema","newSchema","handleSave","formData","handleCancel","loadRecordData","handleActionClick","handleDelete","targetRecordId","target","cell","cellText","row","cells","newStonecrop","view","stonecropInstance","desktopMethods","provide","ActionSet","_unref","AForm","SheetNav","CommandPalette","_withCtx","plugin","app","Desktop"],"mappings":"kkBAyEA,MAAMA,EAAOC,EAKPC,EAAiBC,EAAAA,IAA6B,EAAE,EAEhDC,EAASD,EAAAA,IAAI,EAAK,EAClBE,EAAYF,EAAAA,IAAY,EAAE,EAC1BG,EAAQH,EAAAA,IAAI,EAAK,EACjBI,EAAeJ,EAAAA,IAAI,EAAK,EAE9BK,EAAAA,UAAU,IAAM,CACfC,EAAA,CACD,CAAC,EAED,MAAMA,EAAiB,IAAM,CAC5BP,EAAe,MAAQ,CAAA,CACxB,EAEMQ,EAAU,IAAM,CACrBJ,EAAM,MAAQ,GACdD,EAAU,MAAQ,WAAW,IAAM,CAC9BC,EAAM,QACTF,EAAO,MAAQ,GAEjB,EAAG,GAAG,CACP,EAEMO,EAAe,IAAM,CAC1BL,EAAM,MAAQ,GACdC,EAAa,MAAQ,GACrB,aAAaF,EAAU,KAAK,EAC5BD,EAAO,MAAQ,EAChB,EAEM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WAAYJ,EAAQ,CACnC,CACD"}
1
+ {"version":3,"file":"desktop.umd.cjs","sources":["../src/components/ActionSet.vue","../src/components/CommandPalette.vue","../../stonecrop/dist/stonecrop.js","../../aform/dist/aform.js","../src/components/SheetNav.vue","../src/components/Desktop.vue","../src/plugins/index.ts"],"sourcesContent":["<template>\n\t<div\n\t\t:class=\"{ 'open-set': isOpen, 'hovered-and-closed': closeClicked }\"\n\t\tclass=\"action-set collapse\"\n\t\t@mouseover=\"onHover\"\n\t\t@mouseleave=\"onHoverLeave\">\n\t\t<div class=\"action-menu-icon\">\n\t\t\t<div id=\"chevron\" @click=\"closeClicked = !closeClicked\">\n\t\t\t\t<svg\n\t\t\t\t\tid=\"Layer_1\"\n\t\t\t\t\tclass=\"leftBar\"\n\t\t\t\t\tversion=\"1.1\"\n\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\txmlns:xlink=\"http://www.w3.org/1999/xlink\"\n\t\t\t\t\tx=\"0px\"\n\t\t\t\t\ty=\"0px\"\n\t\t\t\t\tviewBox=\"0 0 100 100\"\n\t\t\t\t\txml:space=\"preserve\"\n\t\t\t\t\twidth=\"50\"\n\t\t\t\t\theight=\"50\">\n\t\t\t\t\t<polygon points=\"54.2,33.4 29.2,58.8 25,54.6 50,29.2 \" />\n\t\t\t\t</svg>\n\n\t\t\t\t<svg\n\t\t\t\t\tid=\"Layer_1\"\n\t\t\t\t\tclass=\"rightBar\"\n\t\t\t\t\tversion=\"1.1\"\n\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\txmlns:xlink=\"http://www.w3.org/1999/xlink\"\n\t\t\t\t\tx=\"0px\"\n\t\t\t\t\ty=\"0px\"\n\t\t\t\t\tviewBox=\"0 0 100 100\"\n\t\t\t\t\txml:space=\"preserve\"\n\t\t\t\t\twidth=\"50\"\n\t\t\t\t\theight=\"50\">\n\t\t\t\t\t<polygon points=\"70.8,58.8 45.8,33.4 50,29.2 75,54.6 \" />\n\t\t\t\t</svg>\n\t\t\t</div>\n\t\t</div>\n\t\t<div style=\"margin-right: 30px\"></div>\n\t\t<div v-for=\"(el, index) in elements\" :key=\"el.label\" class=\"action-element\">\n\t\t\t<button\n\t\t\t\tv-if=\"el.type == 'button'\"\n\t\t\t\t:disabled=\"el.disabled\"\n\t\t\t\tclass=\"button-default\"\n\t\t\t\t@click=\"handleClick(el.action, el.label)\">\n\t\t\t\t{{ el.label }}\n\t\t\t</button>\n\t\t\t<div v-if=\"el.type == 'dropdown'\">\n\t\t\t\t<button class=\"button-default\" @click=\"toggleDropdown(index)\">{{ el.label }}</button>\n\t\t\t\t<div v-show=\"dropdownStates[index]\" class=\"dropdown-container\">\n\t\t\t\t\t<div class=\"dropdown\">\n\t\t\t\t\t\t<div v-for=\"(item, itemIndex) in el.actions\" :key=\"item.label\">\n\t\t\t\t\t\t\t<button v-if=\"item.action != null\" class=\"dropdown-item\" @click=\"handleClick(item.action, item.label)\">\n\t\t\t\t\t\t\t\t{{ item.label }}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t<a v-else-if=\"item.link != null\" :href=\"item.link\"\n\t\t\t\t\t\t\t\t><button class=\"dropdown-item\">{{ item.label }}</button></a\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { onMounted, ref } from 'vue'\n\nimport type { ActionElements } from '../types'\n\nconst { elements = [] } = defineProps<{ elements?: ActionElements[] }>()\nconst emit = defineEmits<{\n\tactionClick: [label: string, action: (() => void | Promise<void>) | undefined]\n}>()\n\n// Track dropdown open state separately (index -> boolean)\nconst dropdownStates = ref<Record<number, boolean>>({})\n\nconst isOpen = ref(false)\nconst timeoutId = ref<number>(-1)\nconst hover = ref(false)\nconst closeClicked = ref(false)\n\nonMounted(() => {\n\tcloseDropdowns()\n})\n\nconst closeDropdowns = () => {\n\tdropdownStates.value = {}\n}\n\nconst onHover = () => {\n\thover.value = true\n\ttimeoutId.value = setTimeout(() => {\n\t\tif (hover.value) {\n\t\t\tisOpen.value = true\n\t\t}\n\t}, 500)\n}\n\nconst onHoverLeave = () => {\n\thover.value = false\n\tcloseClicked.value = false\n\tclearTimeout(timeoutId.value)\n\tisOpen.value = false\n}\n\nconst toggleDropdown = (index: number) => {\n\tconst showDropdown = !dropdownStates.value[index]\n\tcloseDropdowns()\n\tif (showDropdown) {\n\t\tdropdownStates.value[index] = true\n\t}\n}\n\nconst handleClick = (action: (() => void | Promise<void>) | undefined, label: string) => {\n\t// Emit event to parent - parent will handle execution\n\temit('actionClick', label, action)\n}\n</script>\n\n<style scoped>\n#chevron {\n\tposition: relative;\n\ttransform: rotate(90deg);\n}\n\n.leftBar,\n.rightBar {\n\ttransition-duration: 0.225s;\n\ttransition-property: transform;\n}\n\n.leftBar,\n.action-set.collapse.hovered-and-closed:hover .leftBar {\n\ttransform-origin: 33.4% 50%;\n\ttransform: rotate(90deg);\n}\n\n.rightBar,\n.action-set.collapse.hovered-and-closed:hover .rightBar {\n\ttransform-origin: 67% 50%;\n\ttransform: rotate(-90deg);\n}\n\n.rightBar {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n}\n\n.action-set.collapse:hover .leftBar {\n\ttransform: rotate(0);\n}\n\n.action-set.collapse:hover .rightBar {\n\ttransform: rotate(0);\n}\n\n.action-set {\n\tposition: fixed;\n\ttop: 10px;\n\tright: 10px;\n\tpadding: 20px;\n\tbox-shadow: 0px 1px 2px rgba(25, 39, 52, 0.05), 0px 0px 4px rgba(25, 39, 52, 0.1);\n\tborder-radius: 10px;\n\tdisplay: flex;\n\tflex-direction: row-reverse;\n\tbackground-color: white;\n\toverflow: hidden;\n\tz-index: 1001; /* Above SheetNav (100) and operation log button (999) */\n}\n\n.action-menu-icon {\n\tposition: absolute;\n\ttop: 6px;\n\tright: 4px;\n}\n\n.action-menu-icon svg {\n\tfill: #333333;\n}\n\n.action-set.collapse,\n.action-set.collapse.hovered-and-closed:hover {\n\tmax-width: 25px;\n\toverflow: hidden;\n\n\t-webkit-transition: max-width 0.5s ease-in-out;\n\t-moz-transition: max-width 0.5s ease-in-out;\n\t-o-transition: max-width 0.5s ease-in-out;\n\ttransition: max-width 0.5s ease-in-out;\n}\n\n.action-set.collapse .action-element,\n.action-set.collapse.hovered-and-closed:hover .action-element {\n\topacity: 0;\n\t-webkit-transition: opacity 0.25s ease-in-out;\n\t-moz-transition: opacity 0.25s ease-in-out;\n\t-o-transition: opacity 0.25s ease-in-out;\n\ttransition: opacity 0.25s ease-in-out;\n\ttransition-delay: 0s;\n}\n\n.action-set.collapse:hover {\n\tmax-width: 500px;\n}\n\n.action-set.collapse.open-set:hover {\n\toverflow: visible !important;\n}\n\n.action-set.collapse.hovered-and-closed:hover .action-element {\n\topacity: 0 !important;\n\t/* transition-delay: 0.5s; */\n}\n\n.action-set.collapse:hover .action-element {\n\topacity: 100 !important;\n\t/* transition-delay: 0.5s; */\n}\n\n.action-element {\n\tmargin-left: 5px;\n\tmargin-right: 5px;\n\tposition: relative; /* Make this the positioning context for absolute children */\n}\nbutton.button-default {\n\tbackground-color: #ffffff;\n\tpadding: 5px 12px;\n\tborder-radius: 3px;\n\tbox-shadow: rgba(0, 0, 0, 0.05) 0px 0.5px 0px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px,\n\t\trgba(0, 0, 0, 0.05) 0px 2px 4px 0px;\n\tborder: none;\n\tcursor: pointer;\n\twhite-space: nowrap;\n}\n\nbutton.button-default:hover {\n\tbackground-color: #f2f2f2;\n}\n\nbutton.button-default:disabled {\n\topacity: 0.5;\n\tcursor: not-allowed;\n\tbackground-color: #f5f5f5;\n\tcolor: #999;\n}\n\nbutton.button-default:disabled:hover {\n\tbackground-color: #f5f5f5;\n}\n\n.dropdown-container {\n\tposition: relative;\n}\n\n.dropdown {\n\tposition: absolute;\n\tright: 0;\n\tmin-width: 200px;\n\tbox-shadow: 0 0.5rem 1rem rgb(0 0 0 / 18%);\n\tborder-radius: 10px;\n\tbackground-color: #ffffff;\n\tpadding: 10px;\n\tz-index: 1000;\n}\n\nbutton.dropdown-item {\n\twidth: 100%;\n\tpadding: 8px 5px;\n\ttext-align: left;\n\tborder: none;\n\tbackground-color: #ffffff;\n\tcursor: pointer;\n\tborder-radius: 5px;\n}\n\nbutton.dropdown-item:hover {\n\tbackground-color: #f2f2f2;\n}\n</style>\n","<template>\n\t<Teleport to=\"body\">\n\t\t<Transition name=\"fade\">\n\t\t\t<div v-if=\"isOpen\" class=\"command-palette-overlay\" @click=\"closeModal\">\n\t\t\t\t<div class=\"command-palette\" @click.stop>\n\t\t\t\t\t<div class=\"command-palette-header\">\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tref=\"input\"\n\t\t\t\t\t\t\tv-model=\"query\"\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tclass=\"command-palette-input\"\n\t\t\t\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t\t\t\tautofocus\n\t\t\t\t\t\t\t@keydown=\"handleKeydown\" />\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div v-if=\"results.length\" class=\"command-palette-results\">\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tv-for=\"(result, index) in results\"\n\t\t\t\t\t\t\t:key=\"index\"\n\t\t\t\t\t\t\tclass=\"command-palette-result\"\n\t\t\t\t\t\t\t:class=\"{ selected: index === selectedIndex }\"\n\t\t\t\t\t\t\t@click=\"selectResult(result)\"\n\t\t\t\t\t\t\t@mouseover=\"selectedIndex = index\">\n\t\t\t\t\t\t\t<div class=\"result-title\">\n\t\t\t\t\t\t\t\t<slot name=\"title\" :result=\"result\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"result-content\">\n\t\t\t\t\t\t\t\t<slot name=\"content\" :result=\"result\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div v-else-if=\"query && !results.length\" class=\"command-palette-no-results\">\n\t\t\t\t\t\t<slot name=\"empty\"> No results found for \"{{ query }}\" </slot>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</Transition>\n\t</Teleport>\n</template>\n\n<script setup lang=\"ts\" generic=\"T\">\nimport { ref, computed, watch, nextTick, useTemplateRef } from 'vue'\n\ndefineSlots<{\n\ttitle?: { result: T }\n\tcontent?: { result: T }\n\tempty?: null\n}>()\n\nconst {\n\tsearch,\n\tisOpen = false,\n\tplaceholder = 'Type a command or search...',\n\tmaxResults = 10,\n} = defineProps<{\n\tsearch: (query: string) => T[]\n\tisOpen?: boolean\n\tplaceholder?: string\n\tmaxResults?: number\n}>()\n\nconst emit = defineEmits<{\n\tselect: [T]\n\tclose: []\n}>()\n\nconst query = ref('')\nconst selectedIndex = ref(0)\nconst inputRef = useTemplateRef('input')\n\nconst results = computed(() => {\n\tif (!query.value) return []\n\tconst results = search(query.value)\n\treturn results.slice(0, maxResults)\n})\n\n// reset search query when modal opens\nwatch(\n\t() => isOpen,\n\tasync isOpen => {\n\t\tif (isOpen) {\n\t\t\tquery.value = ''\n\t\t\tselectedIndex.value = 0\n\t\t\tawait nextTick()\n\t\t\t;(inputRef.value as HTMLInputElement)?.focus()\n\t\t}\n\t}\n)\n\n// reset selected index when results change\nwatch(results, () => {\n\tselectedIndex.value = 0\n})\n\nconst closeModal = () => {\n\temit('close')\n}\n\nconst handleKeydown = (e: KeyboardEvent) => {\n\tswitch (e.key) {\n\t\tcase 'Escape':\n\t\t\tcloseModal()\n\t\t\tbreak\n\t\tcase 'ArrowDown':\n\t\t\te.preventDefault()\n\t\t\tif (results.value.length) {\n\t\t\t\tselectedIndex.value = (selectedIndex.value + 1) % results.value.length\n\t\t\t}\n\t\t\tbreak\n\t\tcase 'ArrowUp':\n\t\t\te.preventDefault()\n\t\t\tif (results.value.length) {\n\t\t\t\tselectedIndex.value = (selectedIndex.value - 1 + results.value.length) % results.value.length\n\t\t\t}\n\t\t\tbreak\n\t\tcase 'Enter':\n\t\t\tif (results.value.length && selectedIndex.value >= 0) {\n\t\t\t\tselectResult(results.value[selectedIndex.value])\n\t\t\t}\n\t\t\tbreak\n\t}\n}\n\nconst selectResult = (result: T) => {\n\temit('select', result)\n\tcloseModal()\n}\n</script>\n\n<style>\n.fade-enter-active,\n.fade-leave-active {\n\ttransition: opacity 0.2s ease;\n}\n\n.fade-enter-from,\n.fade-leave-to {\n\topacity: 0;\n}\n\n.command-palette-overlay {\n\tposition: fixed;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 100%;\n\tbackground-color: rgba(0, 0, 0, 0.5);\n\tdisplay: flex;\n\talign-items: flex-start;\n\tjustify-content: center;\n\tz-index: 9999;\n\tpadding-top: 100px;\n}\n\n.command-palette {\n\twidth: 600px;\n\tmax-width: 90%;\n\tbackground-color: white;\n\tborder-radius: 8px;\n\tbox-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);\n\toverflow: hidden;\n\tmax-height: 80vh;\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n.command-palette-header {\n\tdisplay: flex;\n\tborder-bottom: 1px solid #eaeaea;\n\tpadding: 12px;\n}\n\n.command-palette-input {\n\tflex: 1;\n\tborder: none;\n\toutline: none;\n\tfont-size: 16px;\n\tpadding: 8px 12px;\n\tbackground-color: transparent;\n}\n\n.command-palette-close {\n\tbackground: transparent;\n\tborder: none;\n\tfont-size: 24px;\n\tcursor: pointer;\n\tcolor: #666;\n\tpadding: 0 8px;\n}\n\n.command-palette-close:hover {\n\tcolor: #333;\n}\n\n.command-palette-results {\n\toverflow-y: auto;\n\tmax-height: 60vh;\n}\n\n.command-palette-result {\n\tpadding: 12px 16px;\n\tcursor: pointer;\n\tborder-bottom: 1px solid #f0f0f0;\n}\n\n.command-palette-result:hover,\n.command-palette-result.selected {\n\tbackground-color: #f5f5f5;\n}\n\n.command-palette-result.selected {\n\tbackground-color: rgba(132, 60, 3, 0.1);\n}\n\n.result-title {\n\tfont-weight: 500;\n\tmargin-bottom: 4px;\n\tcolor: #333;\n}\n\n.result-content {\n\tfont-size: 14px;\n\tcolor: #666;\n\twhite-space: nowrap;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n}\n\n.command-palette-no-results {\n\tpadding: 20px 16px;\n\ttext-align: center;\n\tcolor: #666;\n}\n</style>\n","import { hasInjectionContext as we, inject as te, getCurrentInstance as Fe, toRaw as Le, computed as B, isRef as re, isReactive as ye, toRef as se, ref as M, reactive as Ee, markRaw as oe, effectScope as Je, nextTick as le, getCurrentScope as Ke, onScopeDispose as Ze, watch as H, toRefs as Pe, onMounted as Ve, readonly as Me, customRef as Ge, toValue as q, shallowRef as xe, unref as Ye, provide as _e } from \"vue\";\nconst Q = typeof window < \"u\";\nlet K;\nconst ge = (n) => K = n;\nprocess.env.NODE_ENV;\nconst Oe = process.env.NODE_ENV !== \"production\" ? /* @__PURE__ */ Symbol(\"pinia\") : (\n /* istanbul ignore next */\n /* @__PURE__ */ Symbol()\n);\nfunction G(n) {\n return n && typeof n == \"object\" && Object.prototype.toString.call(n) === \"[object Object]\" && typeof n.toJSON != \"function\";\n}\nvar ie;\n(function(n) {\n n.direct = \"direct\", n.patchObject = \"patch object\", n.patchFunction = \"patch function\";\n})(ie || (ie = {}));\nfunction Be(n, e) {\n for (const t in e) {\n const r = e[t];\n if (!(t in n))\n continue;\n const o = n[t];\n G(o) && G(r) && !re(r) && !ye(r) ? n[t] = Be(o, r) : n[t] = r;\n }\n return n;\n}\nconst je = () => {\n};\nfunction Ae(n, e, t, r = je) {\n n.add(e);\n const o = () => {\n n.delete(e) && r();\n };\n return !t && Ke() && Ze(o), o;\n}\nfunction Y(n, ...e) {\n n.forEach((t) => {\n t(...e);\n });\n}\nconst Qe = (n) => n(), $e = /* @__PURE__ */ Symbol(), me = /* @__PURE__ */ Symbol();\nfunction Re(n, e) {\n n instanceof Map && e instanceof Map ? e.forEach((t, r) => n.set(r, t)) : n instanceof Set && e instanceof Set && e.forEach(n.add, n);\n for (const t in e) {\n if (!e.hasOwnProperty(t))\n continue;\n const r = e[t], o = n[t];\n G(o) && G(r) && n.hasOwnProperty(t) && !re(r) && !ye(r) ? n[t] = Re(o, r) : n[t] = r;\n }\n return n;\n}\nconst Xe = process.env.NODE_ENV !== \"production\" ? /* @__PURE__ */ Symbol(\"pinia:skipHydration\") : (\n /* istanbul ignore next */\n /* @__PURE__ */ Symbol()\n);\nfunction et(n) {\n return !G(n) || !Object.prototype.hasOwnProperty.call(n, Xe);\n}\nconst { assign: W } = Object;\nfunction Ie(n) {\n return !!(re(n) && n.effect);\n}\nfunction De(n, e, t, r) {\n const { state: o, actions: s, getters: i } = e, a = t.state.value[n];\n let c;\n function h() {\n !a && (process.env.NODE_ENV === \"production\" || !r) && (t.state.value[n] = o ? o() : {});\n const g = process.env.NODE_ENV !== \"production\" && r ? (\n // use ref() to unwrap refs inside state TODO: check if this is still necessary\n Pe(M(o ? o() : {}).value)\n ) : Pe(t.state.value[n]);\n return W(g, s, Object.keys(i || {}).reduce((w, R) => (process.env.NODE_ENV !== \"production\" && R in g && console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with \"${R}\" in store \"${n}\".`), w[R] = oe(B(() => {\n ge(t);\n const $ = t._s.get(n);\n return i[R].call($, $);\n })), w), {}));\n }\n return c = Ne(n, h, e, t, r, !0), c;\n}\nfunction Ne(n, e, t = {}, r, o, s) {\n let i;\n const a = W({ actions: {} }, t);\n if (process.env.NODE_ENV !== \"production\" && !r._e.active)\n throw new Error(\"Pinia destroyed\");\n const c = { deep: !0 };\n process.env.NODE_ENV !== \"production\" && (c.onTrigger = (l) => {\n h ? $ = l : h == !1 && !v._hotUpdating && (Array.isArray($) ? $.push(l) : console.error(\"🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug.\"));\n });\n let h, g, w = /* @__PURE__ */ new Set(), R = /* @__PURE__ */ new Set(), $;\n const T = r.state.value[n];\n !s && !T && (process.env.NODE_ENV === \"production\" || !o) && (r.state.value[n] = {});\n const L = M({});\n let P;\n function I(l) {\n let u;\n h = g = !1, process.env.NODE_ENV !== \"production\" && ($ = []), typeof l == \"function\" ? (l(r.state.value[n]), u = {\n type: ie.patchFunction,\n storeId: n,\n events: $\n }) : (Re(r.state.value[n], l), u = {\n type: ie.patchObject,\n payload: l,\n storeId: n,\n events: $\n });\n const O = P = /* @__PURE__ */ Symbol();\n le().then(() => {\n P === O && (h = !0);\n }), g = !0, Y(w, u, r.state.value[n]);\n }\n const N = s ? function() {\n const { state: u } = t, O = u ? u() : {};\n this.$patch((m) => {\n W(m, O);\n });\n } : (\n /* istanbul ignore next */\n process.env.NODE_ENV !== \"production\" ? () => {\n throw new Error(`🍍: Store \"${n}\" is built using the setup syntax and does not implement $reset().`);\n } : je\n );\n function S() {\n i.stop(), w.clear(), R.clear(), r._s.delete(n);\n }\n const D = (l, u = \"\") => {\n if ($e in l)\n return l[me] = u, l;\n const O = function() {\n ge(r);\n const m = Array.from(arguments), f = /* @__PURE__ */ new Set(), b = /* @__PURE__ */ new Set();\n function A(k) {\n f.add(k);\n }\n function C(k) {\n b.add(k);\n }\n Y(R, {\n args: m,\n name: O[me],\n store: v,\n after: A,\n onError: C\n });\n let j;\n try {\n j = l.apply(this && this.$id === n ? this : v, m);\n } catch (k) {\n throw Y(b, k), k;\n }\n return j instanceof Promise ? j.then((k) => (Y(f, k), k)).catch((k) => (Y(b, k), Promise.reject(k))) : (Y(f, j), j);\n };\n return O[$e] = !0, O[me] = u, O;\n }, E = /* @__PURE__ */ oe({\n actions: {},\n getters: {},\n state: [],\n hotState: L\n }), _ = {\n _p: r,\n // _s: scope,\n $id: n,\n $onAction: Ae.bind(null, R),\n $patch: I,\n $reset: N,\n $subscribe(l, u = {}) {\n const O = Ae(w, l, u.detached, () => m()), m = i.run(() => H(() => r.state.value[n], (f) => {\n (u.flush === \"sync\" ? g : h) && l({\n storeId: n,\n type: ie.direct,\n events: $\n }, f);\n }, W({}, c, u)));\n return O;\n },\n $dispose: S\n }, v = Ee(process.env.NODE_ENV !== \"production\" || process.env.NODE_ENV !== \"production\" && process.env.NODE_ENV !== \"test\" && Q ? W(\n {\n _hmrPayload: E,\n _customProperties: oe(/* @__PURE__ */ new Set())\n // devtools custom properties\n },\n _\n // must be added later\n // setupStore\n ) : _);\n r._s.set(n, v);\n const V = (r._a && r._a.runWithContext || Qe)(() => r._e.run(() => (i = Je()).run(() => e({ action: D }))));\n for (const l in V) {\n const u = V[l];\n if (re(u) && !Ie(u) || ye(u))\n process.env.NODE_ENV !== \"production\" && o ? L.value[l] = se(V, l) : s || (T && et(u) && (re(u) ? u.value = T[l] : Re(u, T[l])), r.state.value[n][l] = u), process.env.NODE_ENV !== \"production\" && E.state.push(l);\n else if (typeof u == \"function\") {\n const O = process.env.NODE_ENV !== \"production\" && o ? u : D(u, l);\n V[l] = O, process.env.NODE_ENV !== \"production\" && (E.actions[l] = u), a.actions[l] = u;\n } else process.env.NODE_ENV !== \"production\" && Ie(u) && (E.getters[l] = s ? (\n // @ts-expect-error\n t.getters[l]\n ) : u, Q && (V._getters || // @ts-expect-error: same\n (V._getters = oe([]))).push(l));\n }\n if (W(v, V), W(Le(v), V), Object.defineProperty(v, \"$state\", {\n get: () => process.env.NODE_ENV !== \"production\" && o ? L.value : r.state.value[n],\n set: (l) => {\n if (process.env.NODE_ENV !== \"production\" && o)\n throw new Error(\"cannot set hotState\");\n I((u) => {\n W(u, l);\n });\n }\n }), process.env.NODE_ENV !== \"production\" && (v._hotUpdate = oe((l) => {\n v._hotUpdating = !0, l._hmrPayload.state.forEach((u) => {\n if (u in v.$state) {\n const O = l.$state[u], m = v.$state[u];\n typeof O == \"object\" && G(O) && G(m) ? Be(O, m) : l.$state[u] = m;\n }\n v[u] = se(l.$state, u);\n }), Object.keys(v.$state).forEach((u) => {\n u in l.$state || delete v[u];\n }), h = !1, g = !1, r.state.value[n] = se(l._hmrPayload, \"hotState\"), g = !0, le().then(() => {\n h = !0;\n });\n for (const u in l._hmrPayload.actions) {\n const O = l[u];\n v[u] = //\n D(O, u);\n }\n for (const u in l._hmrPayload.getters) {\n const O = l._hmrPayload.getters[u], m = s ? (\n // special handling of options api\n B(() => (ge(r), O.call(v, v)))\n ) : O;\n v[u] = //\n m;\n }\n Object.keys(v._hmrPayload.getters).forEach((u) => {\n u in l._hmrPayload.getters || delete v[u];\n }), Object.keys(v._hmrPayload.actions).forEach((u) => {\n u in l._hmrPayload.actions || delete v[u];\n }), v._hmrPayload = l._hmrPayload, v._getters = l._getters, v._hotUpdating = !1;\n })), process.env.NODE_ENV !== \"production\" && process.env.NODE_ENV !== \"test\" && Q) {\n const l = {\n writable: !0,\n configurable: !0,\n // avoid warning on devtools trying to display this property\n enumerable: !1\n };\n [\"_p\", \"_hmrPayload\", \"_getters\", \"_customProperties\"].forEach((u) => {\n Object.defineProperty(v, u, W({ value: v[u] }, l));\n });\n }\n return r._p.forEach((l) => {\n if (process.env.NODE_ENV !== \"production\" && process.env.NODE_ENV !== \"test\" && Q) {\n const u = i.run(() => l({\n store: v,\n app: r._a,\n pinia: r,\n options: a\n }));\n Object.keys(u || {}).forEach((O) => v._customProperties.add(O)), W(v, u);\n } else\n W(v, i.run(() => l({\n store: v,\n app: r._a,\n pinia: r,\n options: a\n })));\n }), process.env.NODE_ENV !== \"production\" && v.$state && typeof v.$state == \"object\" && typeof v.$state.constructor == \"function\" && !v.$state.constructor.toString().includes(\"[native code]\") && console.warn(`[🍍]: The \"state\" must be a plain object. It cannot be\n\tstate: () => new MyClass()\nFound in store \"${v.$id}\".`), T && s && t.hydrate && t.hydrate(v.$state, T), h = !0, g = !0, v;\n}\n// @__NO_SIDE_EFFECTS__\nfunction tt(n, e, t) {\n let r;\n const o = typeof e == \"function\";\n r = o ? t : e;\n function s(i, a) {\n const c = we();\n if (i = // in test mode, ignore the argument provided as we can always retrieve a\n // pinia instance with getActivePinia()\n (process.env.NODE_ENV === \"test\" && K && K._testing ? null : i) || (c ? te(Oe, null) : null), i && ge(i), process.env.NODE_ENV !== \"production\" && !K)\n throw new Error(`[🍍]: \"getActivePinia()\" was called but there was no active Pinia. Are you trying to use a store before calling \"app.use(pinia)\"?\nSee https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.\nThis will fail in production.`);\n i = K, i._s.has(n) || (o ? Ne(n, e, r, i) : De(n, r, i), process.env.NODE_ENV !== \"production\" && (s._pinia = i));\n const h = i._s.get(n);\n if (process.env.NODE_ENV !== \"production\" && a) {\n const g = \"__hot:\" + n, w = o ? Ne(g, e, r, i, !0) : De(g, W({}, r), i, !0);\n a._hotUpdate(w), delete i.state.value[g], i._s.delete(g);\n }\n if (process.env.NODE_ENV !== \"production\" && Q) {\n const g = Fe();\n if (g && g.proxy && // avoid adding stores that are just built for hot module replacement\n !a) {\n const w = g.proxy, R = \"_pStores\" in w ? w._pStores : w._pStores = {};\n R[n] = h;\n }\n }\n return h;\n }\n return s.$id = n, s;\n}\nfunction We(n) {\n const e = Le(n), t = {};\n for (const r in e) {\n const o = e[r];\n o.effect ? t[r] = // ...\n B({\n get: () => n[r],\n set(s) {\n n[r] = s;\n }\n }) : (re(o) || ye(o)) && (t[r] = // ---\n se(n, r));\n }\n return t;\n}\nconst rt = typeof window < \"u\" && typeof document < \"u\";\ntypeof WorkerGlobalScope < \"u\" && globalThis instanceof WorkerGlobalScope;\nconst nt = Object.prototype.toString, ot = (n) => nt.call(n) === \"[object Object]\", Ue = () => {\n};\nfunction st(...n) {\n if (n.length !== 1) return se(...n);\n const e = n[0];\n return typeof e == \"function\" ? Me(Ge(() => ({\n get: e,\n set: Ue\n }))) : M(e);\n}\nfunction it(n, e) {\n function t(...r) {\n return new Promise((o, s) => {\n Promise.resolve(n(() => e.apply(this, r), {\n fn: e,\n thisArg: this,\n args: r\n })).then(o).catch(s);\n });\n }\n return t;\n}\nconst ze = (n) => n();\nfunction at(n = ze, e = {}) {\n const { initialState: t = \"active\" } = e, r = st(t === \"active\");\n function o() {\n r.value = !1;\n }\n function s() {\n r.value = !0;\n }\n const i = (...a) => {\n r.value && n(...a);\n };\n return {\n isActive: Me(r),\n pause: o,\n resume: s,\n eventFilter: i\n };\n}\nfunction be(n) {\n return Array.isArray(n) ? n : [n];\n}\nfunction ct(n) {\n return Fe();\n}\nfunction lt(n, e, t = {}) {\n const { eventFilter: r = ze, ...o } = t;\n return H(n, it(r, e), o);\n}\nfunction ut(n, e, t = {}) {\n const { eventFilter: r, initialState: o = \"active\", ...s } = t, { eventFilter: i, pause: a, resume: c, isActive: h } = at(r, { initialState: o });\n return {\n stop: lt(n, e, {\n ...s,\n eventFilter: i\n }),\n pause: a,\n resume: c,\n isActive: h\n };\n}\nconst ft = ut;\nfunction dt(n, e = !0, t) {\n ct() ? Ve(n, t) : e ? n() : le(n);\n}\nfunction pt(n, e, t) {\n return H(n, e, {\n ...t,\n immediate: !0\n });\n}\nfunction ne(n, e, t) {\n return H(n, (o, s, i) => {\n o && e(o, s, i);\n }, {\n ...t,\n once: !1\n });\n}\nconst Z = rt ? window : void 0;\nfunction ht(n) {\n var e;\n const t = q(n);\n return (e = t?.$el) !== null && e !== void 0 ? e : t;\n}\nfunction X(...n) {\n const e = (r, o, s, i) => (r.addEventListener(o, s, i), () => r.removeEventListener(o, s, i)), t = B(() => {\n const r = be(q(n[0])).filter((o) => o != null);\n return r.every((o) => typeof o != \"string\") ? r : void 0;\n });\n return pt(() => {\n var r, o;\n return [\n (r = (o = t.value) === null || o === void 0 ? void 0 : o.map((s) => ht(s))) !== null && r !== void 0 ? r : [Z].filter((s) => s != null),\n be(q(t.value ? n[1] : n[0])),\n be(Ye(t.value ? n[2] : n[1])),\n q(t.value ? n[3] : n[2])\n ];\n }, ([r, o, s, i], a, c) => {\n if (!r?.length || !o?.length || !s?.length) return;\n const h = ot(i) ? { ...i } : i, g = r.flatMap((w) => o.flatMap((R) => s.map(($) => e(w, R, $, h))));\n c(() => {\n g.forEach((w) => w());\n });\n }, { flush: \"post\" });\n}\nconst fe = typeof globalThis < \"u\" ? globalThis : typeof window < \"u\" ? window : typeof global < \"u\" ? global : typeof self < \"u\" ? self : {}, de = \"__vueuse_ssr_handlers__\", gt = /* @__PURE__ */ vt();\nfunction vt() {\n return de in fe || (fe[de] = fe[de] || {}), fe[de];\n}\nfunction yt(n, e) {\n return gt[n] || e;\n}\nfunction mt(n) {\n return n == null ? \"any\" : n instanceof Set ? \"set\" : n instanceof Map ? \"map\" : n instanceof Date ? \"date\" : typeof n == \"boolean\" ? \"boolean\" : typeof n == \"string\" ? \"string\" : typeof n == \"object\" ? \"object\" : Number.isNaN(n) ? \"any\" : \"number\";\n}\nconst bt = {\n boolean: {\n read: (n) => n === \"true\",\n write: (n) => String(n)\n },\n object: {\n read: (n) => JSON.parse(n),\n write: (n) => JSON.stringify(n)\n },\n number: {\n read: (n) => Number.parseFloat(n),\n write: (n) => String(n)\n },\n any: {\n read: (n) => n,\n write: (n) => String(n)\n },\n string: {\n read: (n) => n,\n write: (n) => String(n)\n },\n map: {\n read: (n) => new Map(JSON.parse(n)),\n write: (n) => JSON.stringify(Array.from(n.entries()))\n },\n set: {\n read: (n) => new Set(JSON.parse(n)),\n write: (n) => JSON.stringify(Array.from(n))\n },\n date: {\n read: (n) => new Date(n),\n write: (n) => n.toISOString()\n }\n}, Te = \"vueuse-storage\";\nfunction St(n, e, t, r = {}) {\n var o;\n const { flush: s = \"pre\", deep: i = !0, listenToStorageChanges: a = !0, writeDefaults: c = !0, mergeDefaults: h = !1, shallow: g, window: w = Z, eventFilter: R, onError: $ = (f) => {\n console.error(f);\n }, initOnMounted: T } = r, L = (g ? xe : M)(e), P = B(() => q(n));\n if (!t) try {\n t = yt(\"getDefaultStorage\", () => Z?.localStorage)();\n } catch (f) {\n $(f);\n }\n if (!t) return L;\n const I = q(e), N = mt(I), S = (o = r.serializer) !== null && o !== void 0 ? o : bt[N], { pause: D, resume: E } = ft(L, (f) => l(f), {\n flush: s,\n deep: i,\n eventFilter: R\n });\n H(P, () => O(), { flush: s });\n let _ = !1;\n const v = (f) => {\n T && !_ || O(f);\n }, x = (f) => {\n T && !_ || m(f);\n };\n w && a && (t instanceof Storage ? X(w, \"storage\", v, { passive: !0 }) : X(w, Te, x)), T ? dt(() => {\n _ = !0, O();\n }) : O();\n function V(f, b) {\n if (w) {\n const A = {\n key: P.value,\n oldValue: f,\n newValue: b,\n storageArea: t\n };\n w.dispatchEvent(t instanceof Storage ? new StorageEvent(\"storage\", A) : new CustomEvent(Te, { detail: A }));\n }\n }\n function l(f) {\n try {\n const b = t.getItem(P.value);\n if (f == null)\n V(b, null), t.removeItem(P.value);\n else {\n const A = S.write(f);\n b !== A && (t.setItem(P.value, A), V(b, A));\n }\n } catch (b) {\n $(b);\n }\n }\n function u(f) {\n const b = f ? f.newValue : t.getItem(P.value);\n if (b == null)\n return c && I != null && t.setItem(P.value, S.write(I)), I;\n if (!f && h) {\n const A = S.read(b);\n return typeof h == \"function\" ? h(A, I) : N === \"object\" && !Array.isArray(A) ? {\n ...I,\n ...A\n } : A;\n } else return typeof b != \"string\" ? b : S.read(b);\n }\n function O(f) {\n if (!(f && f.storageArea !== t)) {\n if (f && f.key == null) {\n L.value = I;\n return;\n }\n if (!(f && f.key !== P.value)) {\n D();\n try {\n const b = S.write(L.value);\n (f === void 0 || f?.newValue !== b) && (L.value = u(f));\n } catch (b) {\n $(b);\n } finally {\n f ? le(E) : E();\n }\n }\n }\n }\n function m(f) {\n O(f.detail);\n }\n return L;\n}\nfunction wt(n, e, t = {}) {\n const { window: r = Z } = t;\n return St(n, e, r?.localStorage, t);\n}\nconst Et = {\n ctrl: \"control\",\n command: \"meta\",\n cmd: \"meta\",\n option: \"alt\",\n up: \"arrowup\",\n down: \"arrowdown\",\n left: \"arrowleft\",\n right: \"arrowright\"\n};\nfunction Ot(n = {}) {\n const { reactive: e = !1, target: t = Z, aliasMap: r = Et, passive: o = !0, onEventFired: s = Ue } = n, i = Ee(/* @__PURE__ */ new Set()), a = {\n toJSON() {\n return {};\n },\n current: i\n }, c = e ? Ee(a) : a, h = /* @__PURE__ */ new Set(), g = /* @__PURE__ */ new Map([\n [\"Meta\", h],\n [\"Shift\", /* @__PURE__ */ new Set()],\n [\"Alt\", /* @__PURE__ */ new Set()]\n ]), w = /* @__PURE__ */ new Set();\n function R(N, S) {\n N in c && (e ? c[N] = S : c[N].value = S);\n }\n function $() {\n i.clear();\n for (const N of w) R(N, !1);\n }\n function T(N, S, D) {\n if (!(!N || typeof S.getModifierState != \"function\")) {\n for (const [E, _] of g) if (S.getModifierState(E)) {\n D.forEach((v) => _.add(v));\n break;\n }\n }\n }\n function L(N, S) {\n if (N) return;\n const D = `${S[0].toUpperCase()}${S.slice(1)}`, E = g.get(D);\n if (![\"shift\", \"alt\"].includes(S) || !E) return;\n const _ = Array.from(E), v = _.indexOf(S);\n _.forEach((x, V) => {\n V >= v && (i.delete(x), R(x, !1));\n }), E.clear();\n }\n function P(N, S) {\n var D, E;\n const _ = (D = N.key) === null || D === void 0 ? void 0 : D.toLowerCase(), v = [(E = N.code) === null || E === void 0 ? void 0 : E.toLowerCase(), _].filter(Boolean);\n if (_ !== \"\") {\n _ && (S ? i.add(_) : i.delete(_));\n for (const x of v)\n w.add(x), R(x, S);\n T(S, N, [...i, ...v]), L(S, _), _ === \"meta\" && !S && (h.forEach((x) => {\n i.delete(x), R(x, !1);\n }), h.clear());\n }\n }\n X(t, \"keydown\", (N) => (P(N, !0), s(N)), { passive: o }), X(t, \"keyup\", (N) => (P(N, !1), s(N)), { passive: o }), X(\"blur\", $, { passive: o }), X(\"focus\", $, { passive: o });\n const I = new Proxy(c, { get(N, S, D) {\n if (typeof S != \"string\") return Reflect.get(N, S, D);\n if (S = S.toLowerCase(), S in r && (S = r[S]), !(S in c)) if (/[+_-]/.test(S)) {\n const _ = S.split(/[+_-]/g).map((v) => v.trim());\n c[S] = B(() => _.map((v) => q(I[v])).every(Boolean));\n } else c[S] = xe(!1);\n const E = Reflect.get(N, S, D);\n return e ? q(E) : E;\n } });\n return I;\n}\nfunction Se() {\n return typeof crypto < \"u\" && crypto.randomUUID ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;\n}\nfunction pe(n) {\n const e = {\n type: n.type,\n clientId: n.clientId,\n timestamp: n.timestamp.toISOString()\n };\n return n.operation && (e.operation = {\n ...n.operation,\n timestamp: n.operation.timestamp.toISOString()\n }), n.operations && (e.operations = n.operations.map((t) => ({\n ...t,\n timestamp: t.timestamp.toISOString()\n }))), e;\n}\nfunction Rt(n) {\n const e = {\n type: n.type,\n clientId: n.clientId,\n timestamp: new Date(n.timestamp)\n };\n return n.operation && (e.operation = {\n ...n.operation,\n timestamp: new Date(n.operation.timestamp)\n }), n.operations && (e.operations = n.operations.map((t) => ({\n ...t,\n timestamp: new Date(t.timestamp)\n }))), e;\n}\nconst ue = /* @__PURE__ */ tt(\"hst-operation-log\", () => {\n const n = M({\n maxOperations: 100,\n enableCrossTabSync: !0,\n autoSyncInterval: 3e4,\n enablePersistence: !1,\n persistenceKeyPrefix: \"stonecrop-ops\"\n }), e = M([]), t = M(-1), r = M(Se()), o = M(!1), s = M([]), i = M(null), a = B(() => t.value < 0 ? !1 : e.value[t.value]?.reversible ?? !1), c = B(() => t.value < e.value.length - 1), h = B(() => {\n let d = 0;\n for (let p = t.value; p >= 0 && e.value[p]?.reversible; p--)\n d++;\n return d;\n }), g = B(() => e.value.length - 1 - t.value), w = B(() => ({\n canUndo: a.value,\n canRedo: c.value,\n undoCount: h.value,\n redoCount: g.value,\n currentIndex: t.value\n }));\n function R(d) {\n n.value = { ...n.value, ...d }, n.value.enablePersistence && (C(), k()), n.value.enableCrossTabSync && u();\n }\n function $(d, p = \"user\") {\n const y = {\n ...d,\n id: Se(),\n timestamp: /* @__PURE__ */ new Date(),\n source: p,\n userId: n.value.userId\n };\n if (n.value.operationFilter && !n.value.operationFilter(y))\n return y.id;\n if (o.value)\n return s.value.push(y), y.id;\n if (t.value < e.value.length - 1 && (e.value = e.value.slice(0, t.value + 1)), e.value.push(y), t.value++, n.value.maxOperations && e.value.length > n.value.maxOperations) {\n const F = e.value.length - n.value.maxOperations;\n e.value = e.value.slice(F), t.value -= F;\n }\n return n.value.enableCrossTabSync && O(y), y.id;\n }\n function T() {\n o.value = !0, s.value = [], i.value = Se();\n }\n function L(d) {\n if (!o.value || s.value.length === 0)\n return o.value = !1, s.value = [], i.value = null, null;\n const p = i.value, y = s.value.every((U) => U.reversible), F = {\n id: p,\n type: \"batch\",\n path: \"\",\n // Batch doesn't have a single path\n fieldname: \"\",\n beforeValue: null,\n afterValue: null,\n doctype: s.value[0]?.doctype || \"\",\n timestamp: /* @__PURE__ */ new Date(),\n source: \"user\",\n reversible: y,\n irreversibleReason: y ? void 0 : \"Contains irreversible operations\",\n childOperationIds: s.value.map((U) => U.id),\n metadata: { description: d }\n };\n s.value.forEach((U) => {\n U.parentOperationId = p;\n }), e.value.push(...s.value, F), t.value = e.value.length - 1, n.value.enableCrossTabSync && m(s.value, F);\n const z = p;\n return o.value = !1, s.value = [], i.value = null, z;\n }\n function P() {\n o.value = !1, s.value = [], i.value = null;\n }\n function I(d) {\n if (!a.value) return !1;\n const p = e.value[t.value];\n if (!p.reversible)\n return typeof console < \"u\" && p.irreversibleReason && console.warn(\"Cannot undo irreversible operation:\", p.irreversibleReason), !1;\n try {\n if (p.type === \"batch\" && p.childOperationIds)\n for (let y = p.childOperationIds.length - 1; y >= 0; y--) {\n const F = p.childOperationIds[y], z = e.value.find((U) => U.id === F);\n z && S(z, d);\n }\n else\n S(p, d);\n return t.value--, n.value.enableCrossTabSync && f(p), !0;\n } catch (y) {\n return typeof console < \"u\" && console.error(\"Undo failed:\", y), !1;\n }\n }\n function N(d) {\n if (!c.value) return !1;\n const p = e.value[t.value + 1];\n try {\n if (p.type === \"batch\" && p.childOperationIds)\n for (const y of p.childOperationIds) {\n const F = e.value.find((z) => z.id === y);\n F && D(F, d);\n }\n else\n D(p, d);\n return t.value++, n.value.enableCrossTabSync && b(p), !0;\n } catch (y) {\n return typeof console < \"u\" && console.error(\"Redo failed:\", y), !1;\n }\n }\n function S(d, p) {\n (d.type === \"set\" || d.type === \"delete\") && p && typeof p.set == \"function\" && p.set(d.path, d.beforeValue, \"undo\");\n }\n function D(d, p) {\n (d.type === \"set\" || d.type === \"delete\") && p && typeof p.set == \"function\" && p.set(d.path, d.afterValue, \"redo\");\n }\n function E() {\n const d = e.value.filter((y) => y.reversible).length, p = e.value.map((y) => y.timestamp);\n return {\n operations: [...e.value],\n currentIndex: t.value,\n totalOperations: e.value.length,\n reversibleOperations: d,\n irreversibleOperations: e.value.length - d,\n oldestOperation: p.length > 0 ? new Date(Math.min(...p.map((y) => y.getTime()))) : void 0,\n newestOperation: p.length > 0 ? new Date(Math.max(...p.map((y) => y.getTime()))) : void 0\n };\n }\n function _() {\n e.value = [], t.value = -1;\n }\n function v(d, p) {\n return e.value.filter((y) => y.doctype === d && (p === void 0 || y.recordId === p));\n }\n function x(d, p) {\n const y = e.value.find((F) => F.id === d);\n y && (y.reversible = !1, y.irreversibleReason = p);\n }\n function V(d, p, y, F = \"success\", z) {\n const U = {\n type: \"action\",\n path: y && y.length > 0 ? `${d}.${y[0]}` : d,\n fieldname: \"\",\n beforeValue: null,\n afterValue: null,\n doctype: d,\n recordId: y && y.length > 0 ? y[0] : void 0,\n reversible: !1,\n // Actions are typically not reversible\n actionName: p,\n actionRecordIds: y,\n actionResult: F,\n actionError: z\n };\n return $(U);\n }\n let l = null;\n function u() {\n typeof window > \"u\" || !window.BroadcastChannel || (l = new BroadcastChannel(\"stonecrop-operation-log\"), l.addEventListener(\"message\", (d) => {\n const p = d.data;\n if (!p || typeof p != \"object\") return;\n const y = Rt(p);\n y.clientId !== r.value && (y.type === \"operation\" && y.operation ? (e.value.push({ ...y.operation, source: \"sync\" }), t.value = e.value.length - 1) : y.type === \"operation\" && y.operations && (e.value.push(...y.operations.map((F) => ({ ...F, source: \"sync\" }))), t.value = e.value.length - 1));\n }));\n }\n function O(d) {\n if (!l) return;\n const p = {\n type: \"operation\",\n operation: d,\n clientId: r.value,\n timestamp: /* @__PURE__ */ new Date()\n };\n l.postMessage(pe(p));\n }\n function m(d, p) {\n if (!l) return;\n const y = {\n type: \"operation\",\n operations: [...d, p],\n clientId: r.value,\n timestamp: /* @__PURE__ */ new Date()\n };\n l.postMessage(pe(y));\n }\n function f(d) {\n if (!l) return;\n const p = {\n type: \"undo\",\n operation: d,\n clientId: r.value,\n timestamp: /* @__PURE__ */ new Date()\n };\n l.postMessage(pe(p));\n }\n function b(d) {\n if (!l) return;\n const p = {\n type: \"redo\",\n operation: d,\n clientId: r.value,\n timestamp: /* @__PURE__ */ new Date()\n };\n l.postMessage(pe(p));\n }\n const A = wt(\"stonecrop-ops-operations\", null, {\n serializer: {\n read: (d) => {\n try {\n return JSON.parse(d);\n } catch {\n return null;\n }\n },\n write: (d) => d ? JSON.stringify(d) : \"\"\n }\n });\n function C() {\n if (!(typeof window > \"u\"))\n try {\n const d = A.value;\n d && Array.isArray(d.operations) && (e.value = d.operations.map((p) => ({\n ...p,\n timestamp: new Date(p.timestamp)\n })), t.value = d.currentIndex ?? -1);\n } catch (d) {\n typeof console < \"u\" && console.error(\"Failed to load operations from persistence:\", d);\n }\n }\n function j() {\n if (!(typeof window > \"u\"))\n try {\n A.value = {\n operations: e.value.map((d) => ({\n ...d,\n timestamp: d.timestamp.toISOString()\n })),\n currentIndex: t.value\n };\n } catch (d) {\n typeof console < \"u\" && console.error(\"Failed to save operations to persistence:\", d);\n }\n }\n function k() {\n H(\n [e, t],\n () => {\n n.value.enablePersistence && j();\n },\n { deep: !0 }\n );\n }\n return {\n // State\n operations: e,\n currentIndex: t,\n config: n,\n clientId: r,\n undoRedoState: w,\n // Computed\n canUndo: a,\n canRedo: c,\n undoCount: h,\n redoCount: g,\n // Methods\n configure: R,\n addOperation: $,\n startBatch: T,\n commitBatch: L,\n cancelBatch: P,\n undo: I,\n redo: N,\n clear: _,\n getOperationsFor: v,\n getSnapshot: E,\n markIrreversible: x,\n logAction: V\n };\n});\nclass ae {\n /**\n * The root FieldTriggerEngine instance\n */\n static _root;\n options;\n doctypeActions = /* @__PURE__ */ new Map();\n // doctype -> action/field -> functions\n doctypeTransitions = /* @__PURE__ */ new Map();\n // doctype -> transition -> functions\n fieldRollbackConfig = /* @__PURE__ */ new Map();\n // doctype -> field -> rollback enabled\n globalActions = /* @__PURE__ */ new Map();\n // action name -> function\n globalTransitionActions = /* @__PURE__ */ new Map();\n // transition action name -> function\n /**\n * Creates a new FieldTriggerEngine instance (singleton pattern)\n * @param options - Configuration options for the field trigger engine\n */\n constructor(e = {}) {\n if (ae._root)\n return ae._root;\n ae._root = this, this.options = {\n defaultTimeout: e.defaultTimeout ?? 5e3,\n debug: e.debug ?? !1,\n enableRollback: e.enableRollback ?? !0,\n errorHandler: e.errorHandler\n };\n }\n /**\n * Register a global action function\n * @param name - The name of the action\n * @param fn - The action function\n */\n registerAction(e, t) {\n this.globalActions.set(e, t);\n }\n /**\n * Register a global XState transition action function\n * @param name - The name of the transition action\n * @param fn - The transition action function\n */\n registerTransitionAction(e, t) {\n this.globalTransitionActions.set(e, t);\n }\n /**\n * Configure rollback behavior for a specific field trigger\n * @param doctype - The doctype name\n * @param fieldname - The field name\n * @param enableRollback - Whether to enable rollback\n */\n setFieldRollback(e, t, r) {\n this.fieldRollbackConfig.has(e) || this.fieldRollbackConfig.set(e, /* @__PURE__ */ new Map()), this.fieldRollbackConfig.get(e).set(t, r);\n }\n /**\n * Get rollback configuration for a specific field trigger\n */\n getFieldRollback(e, t) {\n return this.fieldRollbackConfig.get(e)?.get(t);\n }\n /**\n * Register actions from a doctype - both regular actions and field triggers\n * Separates XState transitions (uppercase) from field triggers (lowercase)\n * @param doctype - The doctype name\n * @param actions - The actions to register (supports Immutable Map, Map, or plain object)\n */\n registerDoctypeActions(e, t) {\n if (!t) return;\n const r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();\n if (typeof t.entrySeq == \"function\")\n t.entrySeq().forEach(([s, i]) => {\n this.categorizeAction(s, i, r, o);\n });\n else if (t instanceof Map)\n for (const [s, i] of t)\n this.categorizeAction(s, i, r, o);\n else t && typeof t == \"object\" && Object.entries(t).forEach(([s, i]) => {\n this.categorizeAction(s, i, r, o);\n });\n this.doctypeActions.set(e, r), this.doctypeTransitions.set(e, o);\n }\n /**\n * Categorize an action as either a field trigger or XState transition\n * Uses uppercase convention: UPPERCASE = transition, lowercase/mixed = field trigger\n */\n categorizeAction(e, t, r, o) {\n this.isTransitionKey(e) ? o.set(e, t) : r.set(e, t);\n }\n /**\n * Determine if a key represents an XState transition\n * Transitions are identified by being all uppercase\n */\n isTransitionKey(e) {\n return /^[A-Z0-9_]+$/.test(e) && e.length > 0;\n }\n /**\n * Execute field triggers for a changed field\n * @param context - The field change context\n * @param options - Execution options (timeout and enableRollback)\n */\n async executeFieldTriggers(e, t = {}) {\n const { doctype: r, fieldname: o } = e, s = this.findFieldTriggers(r, o);\n if (s.length === 0)\n return {\n path: e.path,\n actionResults: [],\n totalExecutionTime: 0,\n allSucceeded: !0,\n stoppedOnError: !1,\n rolledBack: !1\n };\n const i = performance.now(), a = [];\n let c = !1, h = !1, g;\n const w = this.getFieldRollback(r, o), R = t.enableRollback ?? w ?? this.options.enableRollback;\n R && e.store && (g = this.captureSnapshot(e));\n for (const P of s)\n try {\n const I = await this.executeAction(P, e, t.timeout);\n if (a.push(I), !I.success) {\n c = !0;\n break;\n }\n } catch (I) {\n const S = {\n success: !1,\n error: I instanceof Error ? I : new Error(String(I)),\n executionTime: 0,\n action: P\n };\n a.push(S), c = !0;\n break;\n }\n if (R && c && g && e.store)\n try {\n this.restoreSnapshot(e, g), h = !0;\n } catch (P) {\n console.error(\"[FieldTriggers] Rollback failed:\", P);\n }\n const $ = performance.now() - i, T = a.filter((P) => !P.success);\n if (T.length > 0 && this.options.errorHandler)\n for (const P of T)\n try {\n this.options.errorHandler(P.error, e, P.action);\n } catch (I) {\n console.error(\"[FieldTriggers] Error in global error handler:\", I);\n }\n return {\n path: e.path,\n actionResults: a,\n totalExecutionTime: $,\n allSucceeded: a.every((P) => P.success),\n stoppedOnError: c,\n rolledBack: h,\n snapshot: this.options.debug && R ? g : void 0\n // Only include snapshot in debug mode if rollback is enabled\n };\n }\n /**\n * Execute XState transition actions\n * Similar to field triggers but specifically for FSM state transitions\n * @param context - The transition change context\n * @param options - Execution options (timeout)\n */\n async executeTransitionActions(e, t = {}) {\n const { doctype: r, transition: o } = e, s = this.findTransitionActions(r, o);\n if (s.length === 0)\n return [];\n const i = [];\n for (const c of s)\n try {\n const h = await this.executeTransitionAction(c, e, t.timeout);\n if (i.push(h), !h.success)\n break;\n } catch (h) {\n const w = {\n success: !1,\n error: h instanceof Error ? h : new Error(String(h)),\n executionTime: 0,\n action: c,\n transition: o\n };\n i.push(w);\n break;\n }\n const a = i.filter((c) => !c.success);\n if (a.length > 0 && this.options.errorHandler)\n for (const c of a)\n try {\n this.options.errorHandler(c.error, e, c.action);\n } catch (h) {\n console.error(\"[FieldTriggers] Error in global error handler:\", h);\n }\n return i;\n }\n /**\n * Find transition actions for a specific doctype and transition\n */\n findTransitionActions(e, t) {\n const r = this.doctypeTransitions.get(e);\n return r ? r.get(t) || [] : [];\n }\n /**\n * Execute a single transition action by name\n */\n async executeTransitionAction(e, t, r) {\n const o = performance.now(), s = r ?? this.options.defaultTimeout;\n try {\n let i = this.globalTransitionActions.get(e);\n if (!i) {\n const c = this.globalActions.get(e);\n c && (i = c);\n }\n if (!i)\n throw new Error(`Transition action \"${e}\" not found in registry`);\n return await this.executeWithTimeout(i, t, s), {\n success: !0,\n executionTime: performance.now() - o,\n action: e,\n transition: t.transition\n };\n } catch (i) {\n const a = performance.now() - o;\n return {\n success: !1,\n error: i instanceof Error ? i : new Error(String(i)),\n executionTime: a,\n action: e,\n transition: t.transition\n };\n }\n }\n /**\n * Find field triggers for a specific doctype and field\n * Field triggers are identified by keys that look like field paths (contain dots or match field names)\n */\n findFieldTriggers(e, t) {\n const r = this.doctypeActions.get(e);\n if (!r) return [];\n const o = [];\n for (const [s, i] of r)\n this.isFieldTriggerKey(s, t) && o.push(...i);\n return o;\n }\n /**\n * Determine if an action key represents a field trigger\n * Field triggers can be:\n * - Exact field name match: \"emailAddress\"\n * - Wildcard patterns: \"emailAddress.*\", \"*.is_primary\"\n * - Nested field paths: \"address.street\", \"contact.email\"\n */\n isFieldTriggerKey(e, t) {\n return e === t ? !0 : e.includes(\".\") ? this.matchFieldPattern(e, t) : e.includes(\"*\") ? this.matchFieldPattern(e, t) : !1;\n }\n /**\n * Match a field pattern against a field name\n * Supports wildcards (*) for dynamic segments\n */\n matchFieldPattern(e, t) {\n const r = e.split(\".\"), o = t.split(\".\");\n if (r.length !== o.length)\n return !1;\n for (let s = 0; s < r.length; s++) {\n const i = r[s], a = o[s];\n if (i !== \"*\" && i !== a)\n return !1;\n }\n return !0;\n }\n /**\n * Execute a single action by name\n */\n async executeAction(e, t, r) {\n const o = performance.now(), s = r ?? this.options.defaultTimeout;\n try {\n const i = this.globalActions.get(e);\n if (!i)\n throw new Error(`Action \"${e}\" not found in registry`);\n return await this.executeWithTimeout(i, t, s), {\n success: !0,\n executionTime: performance.now() - o,\n action: e\n };\n } catch (i) {\n const a = performance.now() - o;\n return {\n success: !1,\n error: i instanceof Error ? i : new Error(String(i)),\n executionTime: a,\n action: e\n };\n }\n }\n /**\n * Execute a function with timeout\n */\n async executeWithTimeout(e, t, r) {\n return new Promise((o, s) => {\n const i = setTimeout(() => {\n s(new Error(`Action timeout after ${r}ms`));\n }, r);\n Promise.resolve(e(t)).then((a) => {\n clearTimeout(i), o(a);\n }).catch((a) => {\n clearTimeout(i), s(a);\n });\n });\n }\n /**\n * Capture a snapshot of the record state before executing actions\n * This creates a deep copy of the record data for potential rollback\n */\n captureSnapshot(e) {\n if (!(!e.store || !e.doctype || !e.recordId))\n try {\n const t = `${e.doctype}.${e.recordId}`, r = e.store.get(t);\n return !r || typeof r != \"object\" ? void 0 : JSON.parse(JSON.stringify(r));\n } catch (t) {\n this.options.debug && console.warn(\"[FieldTriggers] Failed to capture snapshot:\", t);\n return;\n }\n }\n /**\n * Restore a previously captured snapshot\n * This reverts the record to its state before actions were executed\n */\n restoreSnapshot(e, t) {\n if (!(!e.store || !e.doctype || !e.recordId || !t))\n try {\n const r = `${e.doctype}.${e.recordId}`;\n e.store.set(r, t), this.options.debug && console.log(`[FieldTriggers] Rolled back ${r} to previous state`);\n } catch (r) {\n throw console.error(\"[FieldTriggers] Failed to restore snapshot:\", r), r;\n }\n }\n}\nfunction J(n) {\n return new ae(n);\n}\nfunction Tt(n, e) {\n J().registerAction(n, e);\n}\nfunction Ct(n, e) {\n J().registerTransitionAction(n, e);\n}\nfunction kt(n, e, t) {\n J().setFieldRollback(n, e, t);\n}\nasync function Ft(n, e, t) {\n const r = J(), o = {\n path: t?.path || (t?.recordId ? `${n}.${t.recordId}` : n),\n fieldname: \"\",\n beforeValue: void 0,\n afterValue: void 0,\n operation: \"set\",\n doctype: n,\n recordId: t?.recordId,\n timestamp: /* @__PURE__ */ new Date(),\n transition: e,\n currentState: t?.currentState,\n targetState: t?.targetState,\n fsmContext: t?.fsmContext\n };\n return await r.executeTransitionActions(o);\n}\nfunction Lt(n, e) {\n if (n)\n try {\n ue().markIrreversible(n, e);\n } catch {\n }\n}\nfunction Ce() {\n try {\n return ue();\n } catch {\n return null;\n }\n}\nclass ee {\n static instance;\n /**\n * Gets the singleton instance of HST\n * @returns The HST singleton instance\n */\n static getInstance() {\n return ee.instance || (ee.instance = new ee()), ee.instance;\n }\n /**\n * Gets the global registry instance\n * @returns The global registry object or undefined if not found\n */\n getRegistry() {\n if (typeof globalThis < \"u\") {\n const e = globalThis.Registry?._root;\n if (e)\n return e;\n }\n if (typeof window < \"u\") {\n const e = window.Registry?._root;\n if (e)\n return e;\n }\n if (typeof global < \"u\" && global) {\n const e = global.Registry?._root;\n if (e)\n return e;\n }\n }\n /**\n * Helper method to get doctype metadata from the registry\n * @param doctype - The name of the doctype to retrieve metadata for\n * @returns The doctype metadata object or undefined if not found\n */\n getDoctypeMeta(e) {\n const t = this.getRegistry();\n if (t && typeof t == \"object\" && \"registry\" in t)\n return t.registry[e];\n }\n}\nclass ve {\n target;\n parentPath;\n rootNode;\n doctype;\n parentDoctype;\n hst;\n constructor(e, t, r = \"\", o = null, s) {\n return this.target = e, this.parentPath = r, this.rootNode = o || this, this.doctype = t, this.parentDoctype = s, this.hst = ee.getInstance(), new Proxy(this, {\n get(i, a) {\n if (a in i) return i[a];\n const c = String(a);\n return i.getNode(c);\n },\n set(i, a, c) {\n const h = String(a);\n return i.set(h, c), !0;\n }\n });\n }\n get(e) {\n return this.resolveValue(e);\n }\n // Method to get a tree-wrapped node for navigation\n getNode(e) {\n const t = this.resolvePath(e), r = this.resolveValue(e), o = t.split(\".\");\n let s = this.doctype;\n return this.doctype === \"StonecropStore\" && o.length >= 1 && (s = o[0]), typeof r == \"object\" && r !== null && !this.isPrimitive(r) ? new ve(r, s, t, this.rootNode, this.parentDoctype) : new ve(r, s, t, this.rootNode, this.parentDoctype);\n }\n set(e, t, r = \"user\") {\n const o = this.resolvePath(e), s = this.has(e) ? this.get(e) : void 0;\n if (r !== \"undo\" && r !== \"redo\") {\n const i = Ce();\n if (i && typeof i.addOperation == \"function\") {\n const a = o.split(\".\"), c = this.doctype === \"StonecropStore\" && a.length >= 1 ? a[0] : this.doctype, h = a.length >= 2 ? a[1] : void 0, g = a.slice(2).join(\".\") || a[a.length - 1], R = t === void 0 && s !== void 0 ? \"delete\" : \"set\";\n i.addOperation(\n {\n type: R,\n path: o,\n fieldname: g,\n beforeValue: s,\n afterValue: t,\n doctype: c,\n recordId: h,\n reversible: !0\n // Default to reversible, can be changed by field triggers\n },\n r\n );\n }\n }\n this.updateValue(e, t), this.triggerFieldActions(o, s, t);\n }\n has(e) {\n try {\n if (e === \"\")\n return !0;\n const t = this.parsePath(e);\n let r = this.target;\n for (let o = 0; o < t.length; o++) {\n const s = t[o];\n if (r == null)\n return !1;\n if (o === t.length - 1)\n return this.isImmutable(r) ? r.has(s) : this.isPiniaStore(r) && r.$state && s in r.$state || s in r;\n r = this.getProperty(r, s);\n }\n return !1;\n } catch {\n return !1;\n }\n }\n // Tree navigation methods\n getParent() {\n if (!this.parentPath) return null;\n const t = this.parentPath.split(\".\").slice(0, -1).join(\".\");\n return t === \"\" ? this.rootNode : this.rootNode.getNode(t);\n }\n getRoot() {\n return this.rootNode;\n }\n getPath() {\n return this.parentPath;\n }\n getDepth() {\n return this.parentPath ? this.parentPath.split(\".\").length : 0;\n }\n getBreadcrumbs() {\n return this.parentPath ? this.parentPath.split(\".\") : [];\n }\n /**\n * Trigger an XState transition with optional context data\n */\n async triggerTransition(e, t) {\n const r = J(), o = this.parentPath.split(\".\");\n let s = this.doctype, i;\n this.doctype === \"StonecropStore\" && o.length >= 1 && (s = o[0]), o.length >= 2 && (i = o[1]);\n const a = {\n path: this.parentPath,\n fieldname: \"\",\n // No specific field for transitions\n beforeValue: void 0,\n afterValue: void 0,\n operation: \"set\",\n doctype: s,\n recordId: i,\n timestamp: /* @__PURE__ */ new Date(),\n store: this.rootNode || void 0,\n transition: e,\n currentState: t?.currentState,\n targetState: t?.targetState,\n fsmContext: t?.fsmContext\n }, c = Ce();\n return c && typeof c.addOperation == \"function\" && c.addOperation(\n {\n type: \"transition\",\n path: this.parentPath,\n fieldname: e,\n beforeValue: t?.currentState,\n afterValue: t?.targetState,\n doctype: s,\n recordId: i,\n reversible: !1,\n // FSM transitions are generally not reversible\n metadata: {\n transition: e,\n currentState: t?.currentState,\n targetState: t?.targetState,\n fsmContext: t?.fsmContext\n }\n },\n \"user\"\n ), await r.executeTransitionActions(a);\n }\n // Private helper methods\n resolvePath(e) {\n return e === \"\" ? this.parentPath : this.parentPath ? `${this.parentPath}.${e}` : e;\n }\n resolveValue(e) {\n if (e === \"\")\n return this.target;\n const t = this.parsePath(e);\n let r = this.target;\n for (const o of t) {\n if (r == null)\n return;\n r = this.getProperty(r, o);\n }\n return r;\n }\n updateValue(e, t) {\n if (e === \"\")\n throw new Error(\"Cannot set value on empty path\");\n const r = this.parsePath(e), o = r.pop();\n let s = this.target;\n for (const i of r)\n if (s = this.getProperty(s, i), s == null)\n throw new Error(`Cannot set property on null/undefined path: ${e}`);\n this.setProperty(s, o, t);\n }\n getProperty(e, t) {\n return this.isImmutable(e) ? e.get(t) : this.isVueReactive(e) ? e[t] : this.isPiniaStore(e) ? e.$state?.[t] ?? e[t] : e[t];\n }\n setProperty(e, t, r) {\n if (this.isImmutable(e))\n throw new Error(\"Cannot directly mutate immutable objects. Use immutable update methods instead.\");\n if (this.isPiniaStore(e)) {\n e.$patch ? e.$patch({ [t]: r }) : e[t] = r;\n return;\n }\n e[t] = r;\n }\n async triggerFieldActions(e, t, r) {\n try {\n if (!e || typeof e != \"string\")\n return;\n const o = e.split(\".\");\n if (o.length < 3)\n return;\n const s = J(), i = o.slice(2).join(\".\") || o[o.length - 1];\n let a = this.doctype;\n this.doctype === \"StonecropStore\" && o.length >= 1 && (a = o[0]);\n let c;\n o.length >= 2 && (c = o[1]);\n const h = {\n path: e,\n fieldname: i,\n beforeValue: t,\n afterValue: r,\n operation: \"set\",\n doctype: a,\n recordId: c,\n timestamp: /* @__PURE__ */ new Date(),\n store: this.rootNode || void 0\n // Pass the root store for snapshot/rollback capabilities\n };\n await s.executeFieldTriggers(h);\n } catch (o) {\n o instanceof Error && console.warn(\"Field trigger error:\", o.message);\n }\n }\n isVueReactive(e) {\n return e && typeof e == \"object\" && \"__v_isReactive\" in e && e.__v_isReactive === !0;\n }\n isPiniaStore(e) {\n return e && typeof e == \"object\" && (\"$state\" in e || \"$patch\" in e || \"$id\" in e);\n }\n isImmutable(e) {\n if (!e || typeof e != \"object\")\n return !1;\n const t = \"get\" in e && typeof e.get == \"function\", r = \"set\" in e && typeof e.set == \"function\", o = \"has\" in e && typeof e.has == \"function\", s = \"__ownerID\" in e || \"_map\" in e || \"_list\" in e || \"_origin\" in e || \"_capacity\" in e || \"_defaultValues\" in e || \"_tail\" in e || \"_root\" in e || \"size\" in e && t && r;\n let i;\n try {\n const c = e;\n if (\"constructor\" in c && c.constructor && typeof c.constructor == \"object\" && \"name\" in c.constructor) {\n const h = c.constructor.name;\n i = typeof h == \"string\" ? h : void 0;\n }\n } catch {\n i = void 0;\n }\n const a = i && (i.includes(\"Map\") || i.includes(\"List\") || i.includes(\"Set\") || i.includes(\"Stack\") || i.includes(\"Seq\")) && (t || r);\n return !!(t && r && o && s || t && r && a);\n }\n isPrimitive(e) {\n return e == null || typeof e == \"string\" || typeof e == \"number\" || typeof e == \"boolean\" || typeof e == \"function\" || typeof e == \"symbol\" || typeof e == \"bigint\";\n }\n parsePath(e) {\n return e ? e.split(\".\").filter((t) => t.length > 0) : [];\n }\n}\nfunction Nt(n, e, t) {\n return new ve(n, e, \"\", null, t);\n}\nclass He {\n hstStore;\n _operationLogStore;\n _operationLogConfig;\n /** The registry instance containing all doctype definitions */\n registry;\n /**\n * Creates a new Stonecrop instance with HST integration\n * @param registry - The Registry instance containing doctype definitions\n * @param operationLogConfig - Optional configuration for the operation log\n */\n constructor(e, t) {\n this.registry = e, this._operationLogConfig = t, this.initializeHSTStore(), this.setupRegistrySync();\n }\n /**\n * Get the operation log store (lazy initialization)\n * @internal\n */\n getOperationLogStore() {\n return this._operationLogStore || (this._operationLogStore = ue(), this._operationLogConfig && this._operationLogStore.configure(this._operationLogConfig)), this._operationLogStore;\n }\n /**\n * Initialize the HST store structure\n */\n initializeHSTStore() {\n const e = {};\n Object.keys(this.registry.registry).forEach((t) => {\n e[t] = {};\n }), this.hstStore = Nt(e, \"StonecropStore\");\n }\n /**\n * Setup automatic sync with Registry when doctypes are added\n */\n setupRegistrySync() {\n const e = this.registry.addDoctype.bind(this.registry);\n this.registry.addDoctype = (t) => {\n e(t), this.hstStore.has(t.slug) || this.hstStore.set(t.slug, {});\n };\n }\n /**\n * Get records hash for a doctype\n * @param doctype - The doctype to get records for\n * @returns HST node containing records hash\n */\n records(e) {\n const t = typeof e == \"string\" ? e : e.slug;\n return this.ensureDoctypeExists(t), this.hstStore.getNode(t);\n }\n /**\n * Add a record to the store\n * @param doctype - The doctype\n * @param recordId - The record ID\n * @param recordData - The record data\n */\n addRecord(e, t, r) {\n const o = typeof e == \"string\" ? e : e.slug;\n this.ensureDoctypeExists(o), this.hstStore.set(`${o}.${t}`, r);\n }\n /**\n * Get a specific record\n * @param doctype - The doctype\n * @param recordId - The record ID\n * @returns HST node for the record or undefined\n */\n getRecordById(e, t) {\n const r = typeof e == \"string\" ? e : e.slug;\n if (this.ensureDoctypeExists(r), !(!this.hstStore.has(`${r}.${t}`) || this.hstStore.get(`${r}.${t}`) === void 0))\n return this.hstStore.getNode(`${r}.${t}`);\n }\n /**\n * Remove a record from the store\n * @param doctype - The doctype\n * @param recordId - The record ID\n */\n removeRecord(e, t) {\n const r = typeof e == \"string\" ? e : e.slug;\n this.ensureDoctypeExists(r), this.hstStore.has(`${r}.${t}`) && this.hstStore.set(`${r}.${t}`, void 0);\n }\n /**\n * Get all record IDs for a doctype\n * @param doctype - The doctype\n * @returns Array of record IDs\n */\n getRecordIds(e) {\n const t = typeof e == \"string\" ? e : e.slug;\n this.ensureDoctypeExists(t);\n const r = this.hstStore.get(t);\n return !r || typeof r != \"object\" ? [] : Object.keys(r).filter((o) => r[o] !== void 0);\n }\n /**\n * Clear all records for a doctype\n * @param doctype - The doctype\n */\n clearRecords(e) {\n const t = typeof e == \"string\" ? e : e.slug;\n this.ensureDoctypeExists(t), this.getRecordIds(t).forEach((o) => {\n this.hstStore.set(`${t}.${o}`, void 0);\n });\n }\n /**\n * Setup method for doctype initialization\n * @param doctype - The doctype to setup\n */\n setup(e) {\n this.ensureDoctypeExists(e.slug);\n }\n /**\n * Run action on doctype\n * Executes the action and logs it to the operation log for audit tracking\n * @param doctype - The doctype\n * @param action - The action to run\n * @param args - Action arguments (typically record IDs)\n */\n runAction(e, t, r) {\n const s = this.registry.registry[e.slug]?.actions?.get(t), i = Array.isArray(r) ? r.filter((g) => typeof g == \"string\") : void 0, a = this.getOperationLogStore();\n let c = \"success\", h;\n try {\n s && s.length > 0 && s.forEach((g) => {\n try {\n new Function(\"args\", g)(r);\n } catch (w) {\n throw c = \"failure\", h = w instanceof Error ? w.message : \"Unknown error\", w;\n }\n });\n } catch {\n } finally {\n a.logAction(e.doctype, t, i, c, h);\n }\n }\n /**\n * Get records from server (maintains compatibility)\n * @param doctype - The doctype\n */\n async getRecords(e) {\n (await (await fetch(`/${e.slug}`)).json()).forEach((o) => {\n o.id && this.addRecord(e, o.id, o);\n });\n }\n /**\n * Get single record from server (maintains compatibility)\n * @param doctype - The doctype\n * @param recordId - The record ID\n */\n async getRecord(e, t) {\n const o = await (await fetch(`/${e.slug}/${t}`)).json();\n this.addRecord(e, t, o);\n }\n /**\n * Ensure doctype section exists in HST store\n * @param slug - The doctype slug\n */\n ensureDoctypeExists(e) {\n this.hstStore.has(e) || this.hstStore.set(e, {});\n }\n /**\n * Get doctype metadata from the registry\n * @param context - The route context\n * @returns The doctype metadata\n */\n async getMeta(e) {\n if (!this.registry.getMeta)\n throw new Error(\"No getMeta function provided to Registry\");\n return await this.registry.getMeta(e);\n }\n /**\n * Get the root HST store node for advanced usage\n * @returns Root HST node\n */\n getStore() {\n return this.hstStore;\n }\n}\nfunction Vt(n) {\n n || (n = {});\n const e = n.registry || te(\"$registry\"), t = te(\"$stonecrop\"), r = M(), o = M(), s = M({}), i = M(), a = M(), c = M([]), h = M(-1), g = B(() => r.value?.getOperationLogStore().canUndo ?? !1), w = B(() => r.value?.getOperationLogStore().canRedo ?? !1), R = B(() => r.value?.getOperationLogStore().undoCount ?? 0), $ = B(() => r.value?.getOperationLogStore().redoCount ?? 0), T = B(\n () => r.value?.getOperationLogStore().undoRedoState ?? {\n canUndo: !1,\n canRedo: !1,\n undoCount: 0,\n redoCount: 0,\n currentIndex: -1\n }\n ), L = (m) => r.value?.getOperationLogStore().undo(m) ?? !1, P = (m) => r.value?.getOperationLogStore().redo(m) ?? !1, I = () => {\n r.value?.getOperationLogStore().startBatch();\n }, N = (m) => r.value?.getOperationLogStore().commitBatch(m) ?? null, S = () => {\n r.value?.getOperationLogStore().cancelBatch();\n }, D = () => {\n r.value?.getOperationLogStore().clear();\n }, E = (m, f) => r.value?.getOperationLogStore().getOperationsFor(m, f) ?? [], _ = () => r.value?.getOperationLogStore().getSnapshot() ?? {\n operations: [],\n currentIndex: -1,\n totalOperations: 0,\n reversibleOperations: 0,\n irreversibleOperations: 0\n }, v = (m, f) => {\n r.value?.getOperationLogStore().markIrreversible(m, f);\n }, x = (m, f, b, A = \"success\", C) => r.value?.getOperationLogStore().logAction(m, f, b, A, C) ?? \"\", V = (m) => {\n r.value?.getOperationLogStore().configure(m);\n };\n Ve(async () => {\n if (e) {\n r.value = t || new He(e);\n try {\n const m = r.value.getOperationLogStore(), f = We(m);\n c.value = f.operations.value, h.value = f.currentIndex.value, H(\n () => f.operations.value,\n (b) => {\n c.value = b;\n }\n ), H(\n () => f.currentIndex.value,\n (b) => {\n h.value = b;\n }\n );\n } catch {\n }\n if (!n.doctype && e.router) {\n const m = e.router.currentRoute.value;\n if (!m.path) return;\n const f = m.path.split(\"/\").filter((A) => A.length > 0), b = f[1]?.toLowerCase();\n if (f.length > 0) {\n const A = {\n path: m.path,\n segments: f\n }, C = await e.getMeta?.(A);\n if (C) {\n if (e.addDoctype(C), r.value.setup(C), i.value = C, a.value = b, o.value = r.value.getStore(), b && b !== \"new\") {\n const j = r.value.getRecordById(C, b);\n if (j)\n s.value = j.get(\"\") || {};\n else\n try {\n await r.value.getRecord(C, b);\n const k = r.value.getRecordById(C, b);\n k && (s.value = k.get(\"\") || {});\n } catch {\n s.value = he(C);\n }\n } else\n s.value = he(C);\n o.value && ke(C, b || \"new\", s, o.value), r.value.runAction(C, \"load\", b ? [b] : void 0);\n }\n }\n }\n if (n.doctype) {\n o.value = r.value.getStore();\n const m = n.doctype, f = n.recordId;\n if (f && f !== \"new\") {\n const b = r.value.getRecordById(m, f);\n if (b)\n s.value = b.get(\"\") || {};\n else\n try {\n await r.value.getRecord(m, f);\n const A = r.value.getRecordById(m, f);\n A && (s.value = A.get(\"\") || {});\n } catch {\n s.value = he(m);\n }\n } else\n s.value = he(m);\n o.value && ke(m, f || \"new\", s, o.value);\n }\n }\n });\n const l = (m, f) => {\n const b = n.doctype || i.value;\n if (!b) return \"\";\n const A = f || n.recordId || a.value || \"new\";\n return `${b.slug}.${A}.${m}`;\n }, u = (m) => {\n const f = n.doctype || i.value;\n if (!(!o.value || !r.value || !f))\n try {\n const b = m.path.split(\".\");\n if (b.length >= 2) {\n const j = b[0], k = b[1];\n if (o.value.has(`${j}.${k}`) || r.value.addRecord(f, k, { ...s.value }), b.length > 3) {\n const d = `${j}.${k}`, p = b.slice(2);\n let y = d;\n for (let F = 0; F < p.length - 1; F++)\n if (y += `.${p[F]}`, !o.value.has(y)) {\n const z = p[F + 1], U = !isNaN(Number(z));\n o.value.set(y, U ? [] : {});\n }\n }\n }\n o.value.set(m.path, m.value);\n const A = m.fieldname.split(\".\"), C = { ...s.value };\n A.length === 1 ? C[A[0]] = m.value : Pt(C, A, m.value), s.value = C;\n } catch {\n }\n };\n (n.doctype || e?.router) && (_e(\"hstPathProvider\", l), _e(\"hstChangeHandler\", u));\n const O = {\n operations: c,\n currentIndex: h,\n undoRedoState: T,\n canUndo: g,\n canRedo: w,\n undoCount: R,\n redoCount: $,\n undo: L,\n redo: P,\n startBatch: I,\n commitBatch: N,\n cancelBatch: S,\n clear: D,\n getOperationsFor: E,\n getSnapshot: _,\n markIrreversible: v,\n logAction: x,\n configure: V\n };\n return n.doctype ? {\n stonecrop: r,\n operationLog: O,\n provideHSTPath: l,\n handleHSTChange: u,\n hstStore: o,\n formData: s\n } : !n.doctype && e?.router ? {\n stonecrop: r,\n operationLog: O,\n provideHSTPath: l,\n handleHSTChange: u,\n hstStore: o,\n formData: s\n } : {\n stonecrop: r,\n operationLog: O\n };\n}\nfunction he(n) {\n const e = {};\n return n.schema && n.schema.forEach((t) => {\n switch (\"fieldtype\" in t ? t.fieldtype : \"Data\") {\n case \"Data\":\n case \"Text\":\n e[t.fieldname] = \"\";\n break;\n case \"Check\":\n e[t.fieldname] = !1;\n break;\n case \"Int\":\n case \"Float\":\n e[t.fieldname] = 0;\n break;\n case \"Table\":\n e[t.fieldname] = [];\n break;\n case \"JSON\":\n e[t.fieldname] = {};\n break;\n default:\n e[t.fieldname] = null;\n }\n }), e;\n}\nfunction ke(n, e, t, r) {\n H(\n t,\n (o) => {\n const s = `${n.slug}.${e}`;\n Object.keys(o).forEach((i) => {\n const a = `${s}.${i}`;\n try {\n r.set(a, o[i]);\n } catch {\n }\n });\n },\n { deep: !0 }\n );\n}\nfunction Pt(n, e, t) {\n let r = n;\n for (let s = 0; s < e.length - 1; s++) {\n const i = e[s];\n (!(i in r) || typeof r[i] != \"object\") && (r[i] = isNaN(Number(e[s + 1])) ? {} : []), r = r[i];\n }\n const o = e[e.length - 1];\n r[o] = t;\n}\nfunction qe(n) {\n const t = te(\"$operationLogStore\", void 0) || ue();\n n && t.configure(n);\n const { operations: r, currentIndex: o, undoRedoState: s, canUndo: i, canRedo: a, undoCount: c, redoCount: h } = We(t);\n function g(E) {\n return t.undo(E);\n }\n function w(E) {\n return t.redo(E);\n }\n function R() {\n t.startBatch();\n }\n function $(E) {\n return t.commitBatch(E);\n }\n function T() {\n t.cancelBatch();\n }\n function L() {\n t.clear();\n }\n function P(E, _) {\n return t.getOperationsFor(E, _);\n }\n function I() {\n return t.getSnapshot();\n }\n function N(E, _) {\n t.markIrreversible(E, _);\n }\n function S(E, _, v, x = \"success\", V) {\n return t.logAction(E, _, v, x, V);\n }\n function D(E) {\n t.configure(E);\n }\n return {\n // State\n operations: r,\n currentIndex: o,\n undoRedoState: s,\n canUndo: i,\n canRedo: a,\n undoCount: c,\n redoCount: h,\n // Methods\n undo: g,\n redo: w,\n startBatch: R,\n commitBatch: $,\n cancelBatch: T,\n clear: L,\n getOperationsFor: P,\n getSnapshot: I,\n markIrreversible: N,\n logAction: S,\n configure: D\n };\n}\nfunction Mt(n, e = !0) {\n if (!e) return;\n const { undo: t, redo: r, canUndo: o, canRedo: s } = qe(), i = Ot();\n ne(i[\"Ctrl+Z\"], () => {\n o.value && t(n);\n }), ne(i[\"Meta+Z\"], () => {\n o.value && t(n);\n }), ne(i[\"Ctrl+Shift+Z\"], () => {\n s.value && r(n);\n }), ne(i[\"Meta+Shift+Z\"], () => {\n s.value && r(n);\n }), ne(i[\"Ctrl+Y\"], () => {\n s.value && r(n);\n });\n}\nasync function xt(n, e) {\n const { startBatch: t, commitBatch: r, cancelBatch: o } = qe();\n t();\n try {\n return await n(), r(e);\n } catch (s) {\n throw o(), s;\n }\n}\nclass Bt {\n /**\n * The doctype name\n * @public\n * @readonly\n */\n doctype;\n /**\n * The doctype schema\n * @public\n * @readonly\n */\n schema;\n /**\n * The doctype workflow\n * @public\n * @readonly\n */\n workflow;\n /**\n * The doctype actions and field triggers\n * @public\n * @readonly\n */\n actions;\n /**\n * The doctype component\n * @public\n * @readonly\n */\n component;\n /**\n * Creates a new DoctypeMeta instance\n * @param doctype - The doctype name\n * @param schema - The doctype schema definition\n * @param workflow - The doctype workflow configuration (XState machine)\n * @param actions - The doctype actions and field triggers\n * @param component - Optional Vue component for rendering the doctype\n */\n constructor(e, t, r, o, s) {\n this.doctype = e, this.schema = t, this.workflow = r, this.actions = o, this.component = s;\n }\n /**\n * Converts the registered doctype string to a slug (kebab-case). The following conversions are made:\n * - It replaces camelCase and PascalCase with kebab-case strings\n * - It replaces spaces and underscores with hyphens\n * - It converts the string to lowercase\n *\n * @returns The slugified doctype string\n *\n * @example\n * ```ts\n * const doctype = new DoctypeMeta('TaskItem', schema, workflow, actions\n * console.log(doctype.slug) // 'task-item'\n * ```\n *\n * @public\n */\n get slug() {\n return this.doctype.replace(/([a-z])([A-Z])/g, \"$1-$2\").replace(/[\\s_]+/g, \"-\").toLowerCase();\n }\n}\nclass ce {\n /**\n * The root Registry instance\n */\n static _root;\n /**\n * The name of the Registry instance\n *\n * @defaultValue 'Registry'\n */\n name;\n /**\n * The registry property contains a collection of doctypes\n * @see {@link DoctypeMeta}\n */\n registry;\n /**\n * The Vue router instance\n * @see {@link https://router.vuejs.org/}\n */\n router;\n /**\n * Creates a new Registry instance (singleton pattern)\n * @param router - Optional Vue router instance for route management\n * @param getMeta - Optional function to fetch doctype metadata from an API\n */\n constructor(e, t) {\n if (ce._root)\n return ce._root;\n ce._root = this, this.name = \"Registry\", this.registry = {}, this.router = e, this.getMeta = t;\n }\n /**\n * The getMeta function fetches doctype metadata from an API based on route context\n * @see {@link DoctypeMeta}\n */\n getMeta;\n /**\n * Get doctype metadata\n * @param doctype - The doctype to fetch metadata for\n * @returns The doctype metadata\n * @see {@link DoctypeMeta}\n */\n addDoctype(e) {\n e.doctype in Object.keys(this.registry) || (this.registry[e.slug] = e);\n const t = J();\n t.registerDoctypeActions(e.doctype, e.actions), e.slug !== e.doctype && t.registerDoctypeActions(e.slug, e.actions), e.component && this.router && !this.router.hasRoute(e.doctype) && this.router.addRoute({\n path: `/${e.slug}`,\n name: e.slug,\n component: e.component\n });\n }\n // TODO: should we allow clearing the registry at all?\n // clear() {\n // \tthis.registry = {}\n // \tif (this.router) {\n // \t\tconst routes = this.router.getRoutes()\n // \t\tfor (const route of routes) {\n // \t\t\tif (route.name) {\n // \t\t\t\tthis.router.removeRoute(route.name)\n // \t\t\t}\n // \t\t}\n // \t}\n // }\n}\nasync function _t(n, e, t) {\n await le();\n try {\n await t(n, e);\n } catch {\n }\n}\nconst jt = {\n install: (n, e) => {\n const t = n.config.globalProperties.$router, r = e?.router, o = t || r;\n !t && r && n.use(r);\n const s = new ce(o, e?.getMeta);\n n.provide(\"$registry\", s), n.config.globalProperties.$registry = s;\n const i = new He(s);\n n.provide(\"$stonecrop\", i), n.config.globalProperties.$stonecrop = i;\n try {\n const a = n.config.globalProperties.$pinia;\n if (a) {\n const c = ue(a);\n n.provide(\"$operationLogStore\", c), n.config.globalProperties.$operationLogStore = c;\n }\n } catch (a) {\n console.warn(\"Pinia not available - operation log features will be disabled:\", a);\n }\n if (e?.components)\n for (const [a, c] of Object.entries(e.components))\n n.component(a, c);\n e?.autoInitializeRouter && e.onRouterInitialized && _t(s, i, e.onRouterInitialized);\n }\n};\nvar At = /* @__PURE__ */ ((n) => (n.ERROR = \"error\", n.WARNING = \"warning\", n.INFO = \"info\", n))(At || {});\nclass $t {\n options;\n /**\n * Creates a new SchemaValidator instance\n * @param options - Validator configuration options\n */\n constructor(e = {}) {\n this.options = {\n registry: e.registry || null,\n validateLinkTargets: e.validateLinkTargets ?? !0,\n validateActions: e.validateActions ?? !0,\n validateWorkflows: e.validateWorkflows ?? !0,\n validateRequiredProperties: e.validateRequiredProperties ?? !0\n };\n }\n /**\n * Validates a complete doctype schema\n * @param doctype - Doctype name\n * @param schema - Schema fields (List or Array)\n * @param workflow - Optional workflow configuration\n * @param actions - Optional actions map\n * @returns Validation result\n */\n validate(e, t, r, o) {\n const s = [], i = t ? Array.isArray(t) ? t : t.toArray() : [];\n if (this.options.validateRequiredProperties && s.push(...this.validateRequiredProperties(e, i)), this.options.validateLinkTargets && this.options.registry && s.push(...this.validateLinkFields(e, i, this.options.registry)), this.options.validateWorkflows && r && s.push(...this.validateWorkflow(e, r)), this.options.validateActions && o) {\n const g = o instanceof Map ? o : o.toObject();\n s.push(...this.validateActionRegistration(e, g));\n }\n const a = s.filter(\n (g) => g.severity === \"error\"\n /* ERROR */\n ).length, c = s.filter(\n (g) => g.severity === \"warning\"\n /* WARNING */\n ).length, h = s.filter(\n (g) => g.severity === \"info\"\n /* INFO */\n ).length;\n return {\n valid: a === 0,\n issues: s,\n errorCount: a,\n warningCount: c,\n infoCount: h\n };\n }\n /**\n * Validates that required schema properties are present\n * @internal\n */\n validateRequiredProperties(e, t) {\n const r = [];\n for (const o of t) {\n if (!o.fieldname) {\n r.push({\n severity: \"error\",\n rule: \"required-fieldname\",\n message: \"Field is missing required property: fieldname\",\n doctype: e,\n context: { field: o }\n });\n continue;\n }\n if (!o.component && !(\"fieldtype\" in o) && r.push({\n severity: \"error\",\n rule: \"required-component-or-fieldtype\",\n message: `Field \"${o.fieldname}\" must have either component or fieldtype property`,\n doctype: e,\n fieldname: o.fieldname\n }), \"schema\" in o) {\n const s = o.schema, i = Array.isArray(s) ? s : s.toArray?.() || [];\n r.push(...this.validateRequiredProperties(e, i));\n }\n }\n return r;\n }\n /**\n * Validates Link field targets exist in registry\n * @internal\n */\n validateLinkFields(e, t, r) {\n const o = [];\n for (const s of t) {\n if ((\"fieldtype\" in s ? s.fieldtype : void 0) === \"Link\") {\n const a = \"options\" in s ? s.options : void 0;\n if (!a) {\n o.push({\n severity: \"error\",\n rule: \"link-missing-options\",\n message: `Link field \"${s.fieldname}\" is missing options property (target doctype)`,\n doctype: e,\n fieldname: s.fieldname\n });\n continue;\n }\n const c = typeof a == \"string\" ? a : \"\";\n if (!c) {\n o.push({\n severity: \"error\",\n rule: \"link-invalid-options\",\n message: `Link field \"${s.fieldname}\" has invalid options format (expected string doctype name)`,\n doctype: e,\n fieldname: s.fieldname\n });\n continue;\n }\n r.registry[c] || r.registry[c.toLowerCase()] || o.push({\n severity: \"error\",\n rule: \"link-invalid-target\",\n message: `Link field \"${s.fieldname}\" references non-existent doctype: \"${c}\"`,\n doctype: e,\n fieldname: s.fieldname,\n context: { targetDoctype: c }\n });\n }\n if (\"schema\" in s) {\n const a = s.schema, c = Array.isArray(a) ? a : a.toArray?.() || [];\n o.push(...this.validateLinkFields(e, c, r));\n }\n }\n return o;\n }\n /**\n * Validates workflow state machine configuration\n * @internal\n */\n validateWorkflow(e, t) {\n const r = [];\n if (!t.initial && !t.type && r.push({\n severity: \"warning\",\n rule: \"workflow-missing-initial\",\n message: \"Workflow is missing initial state property\",\n doctype: e\n }), !t.states || Object.keys(t.states).length === 0)\n return r.push({\n severity: \"warning\",\n rule: \"workflow-no-states\",\n message: \"Workflow has no states defined\",\n doctype: e\n }), r;\n t.initial && typeof t.initial == \"string\" && !t.states[t.initial] && r.push({\n severity: \"error\",\n rule: \"workflow-invalid-initial\",\n message: `Workflow initial state \"${t.initial}\" does not exist in states`,\n doctype: e,\n context: { initialState: t.initial }\n });\n const o = Object.keys(t.states), s = /* @__PURE__ */ new Set();\n t.initial && typeof t.initial == \"string\" && s.add(t.initial);\n for (const [i, a] of Object.entries(t.states)) {\n const c = a;\n if (c.on) {\n for (const [h, g] of Object.entries(c.on))\n if (typeof g == \"string\")\n s.add(g);\n else if (g && typeof g == \"object\") {\n const w = \"target\" in g ? g.target : void 0;\n typeof w == \"string\" ? s.add(w) : Array.isArray(w) && w.forEach((R) => {\n typeof R == \"string\" && s.add(R);\n });\n }\n }\n }\n for (const i of o)\n s.has(i) || r.push({\n severity: \"warning\",\n rule: \"workflow-unreachable-state\",\n message: `Workflow state \"${i}\" may not be reachable`,\n doctype: e,\n context: { stateName: i }\n });\n return r;\n }\n /**\n * Validates that actions are registered in the FieldTriggerEngine\n * @internal\n */\n validateActionRegistration(e, t) {\n const r = [], o = J();\n for (const [s, i] of Object.entries(t)) {\n if (!Array.isArray(i)) {\n r.push({\n severity: \"error\",\n rule: \"action-invalid-format\",\n message: `Action configuration for \"${s}\" must be an array`,\n doctype: e,\n context: { triggerName: s, actionNames: i }\n });\n continue;\n }\n for (const a of i) {\n const c = o;\n c.globalActions?.has(a) || c.globalTransitionActions?.has(a) || r.push({\n severity: \"warning\",\n rule: \"action-not-registered\",\n message: `Action \"${a}\" referenced in \"${s}\" is not registered in FieldTriggerEngine`,\n doctype: e,\n context: { triggerName: s, actionName: a }\n });\n }\n }\n return r;\n }\n}\nfunction It(n, e) {\n return new $t({\n registry: n,\n ...e\n });\n}\nfunction Wt(n, e, t, r, o) {\n return It(t).validate(n, e, r, o);\n}\nexport {\n Bt as DoctypeMeta,\n ee as HST,\n ce as Registry,\n $t as SchemaValidator,\n He as Stonecrop,\n At as ValidationSeverity,\n Nt as createHST,\n It as createValidator,\n jt as default,\n J as getGlobalTriggerEngine,\n Lt as markOperationIrreversible,\n Tt as registerGlobalAction,\n Ct as registerTransitionAction,\n kt as setFieldRollback,\n Ft as triggerTransition,\n qe as useOperationLog,\n ue as useOperationLogStore,\n Vt as useStonecrop,\n Mt as useUndoRedoShortcuts,\n Wt as validateSchema,\n xt as withBatch\n};\n//# sourceMappingURL=stonecrop.js.map\n","import { defineComponent as C, mergeModels as z, useModel as q, createElementBlock as b, openBlock as g, createElementVNode as c, withDirectives as E, toDisplayString as M, vModelCheckbox as Oe, vShow as U, resolveComponent as Pe, createBlock as le, withCtx as Fe, useTemplateRef as xe, vModelText as H, watch as P, getCurrentScope as De, onScopeDispose as Ee, toRef as Re, readonly as Me, ref as x, customRef as He, computed as T, watchEffect as ae, toValue as w, unref as S, shallowRef as G, reactive as Be, normalizeClass as X, withKeys as F, Fragment as j, renderList as Y, withModifiers as Ie, onMounted as se, onBeforeUnmount as qe, getCurrentInstance as Ue, nextTick as We, resolveDynamicComponent as Ne, mergeProps as je, renderSlot as Ye, createTextVNode as Ae, createCommentVNode as re, createVNode as Ke } from \"vue\";\nimport './assets/index.css';const ze = { class: \"aform_form-element\" }, Ge = [\"for\"], Je = { class: \"aform_checkbox-container aform_input-field\" }, Qe = [\"id\", \"readonly\", \"required\"], Xe = [\"innerHTML\"], Ze = /* @__PURE__ */ C({\n __name: \"ACheckbox\",\n props: /* @__PURE__ */ z({\n schema: {},\n label: {},\n mask: {},\n required: { type: Boolean },\n readOnly: { type: Boolean },\n uuid: {},\n validation: { default: () => ({ errorMessage: \"&nbsp;\" }) }\n }, {\n modelValue: {},\n modelModifiers: {}\n }),\n emits: [\"update:modelValue\"],\n setup(e) {\n const t = q(e, \"modelValue\");\n return (n, o) => (g(), b(\"div\", ze, [\n c(\"label\", {\n class: \"aform_field-label\",\n for: e.uuid\n }, M(e.label), 9, Ge),\n c(\"span\", Je, [\n E(c(\"input\", {\n id: e.uuid,\n \"onUpdate:modelValue\": o[0] || (o[0] = (a) => t.value = a),\n type: \"checkbox\",\n class: \"aform_checkbox\",\n readonly: e.readOnly,\n required: e.required\n }, null, 8, Qe), [\n [Oe, t.value]\n ])\n ]),\n E(c(\"p\", {\n class: \"aform_error\",\n innerHTML: e.validation.errorMessage\n }, null, 8, Xe), [\n [U, e.validation.errorMessage]\n ])\n ]));\n }\n}), L = (e, t) => {\n const n = e.__vccOpts || e;\n for (const [o, a] of t)\n n[o] = a;\n return n;\n}, et = /* @__PURE__ */ L(Ze, [[\"__scopeId\", \"data-v-f13fd4d6\"]]), tt = /* @__PURE__ */ C({\n __name: \"AComboBox\",\n props: [\"event\", \"cellData\", \"tableID\"],\n setup(e) {\n return (t, n) => {\n const o = Pe(\"ATableModal\");\n return g(), le(o, {\n event: e.event,\n \"cell-data\": e.cellData,\n class: \"amodal\"\n }, {\n default: Fe(() => [...n[0] || (n[0] = [\n c(\"div\", null, [\n c(\"input\", { type: \"text\" }),\n c(\"input\", { type: \"text\" }),\n c(\"input\", { type: \"text\" })\n ], -1)\n ])]),\n _: 1\n }, 8, [\"event\", \"cell-data\"]);\n };\n }\n}), nt = [\"id\", \"disabled\", \"required\"], ot = [\"for\"], lt = [\"innerHTML\"], at = /* @__PURE__ */ C({\n __name: \"ADate\",\n props: /* @__PURE__ */ z({\n schema: {},\n label: { default: \"Date\" },\n mask: {},\n required: { type: Boolean },\n readOnly: { type: Boolean },\n uuid: {},\n validation: { default: () => ({ errorMessage: \"&nbsp;\" }) }\n }, {\n modelValue: {\n // format the date to be compatible with the native input datepicker\n },\n modelModifiers: {}\n }),\n emits: [\"update:modelValue\"],\n setup(e) {\n const t = q(e, \"modelValue\", {\n // format the date to be compatible with the native input datepicker\n set: (a) => new Date(a).toISOString().split(\"T\")[0]\n }), n = xe(\"date\"), o = () => {\n n.value && \"showPicker\" in HTMLInputElement.prototype && n.value.showPicker();\n };\n return (a, s) => (g(), b(\"div\", null, [\n E(c(\"input\", {\n id: e.uuid,\n ref: \"date\",\n \"onUpdate:modelValue\": s[0] || (s[0] = (l) => t.value = l),\n type: \"date\",\n disabled: e.readOnly,\n required: e.required,\n onClick: o\n }, null, 8, nt), [\n [H, t.value]\n ]),\n c(\"label\", { for: e.uuid }, M(e.label), 9, ot),\n E(c(\"p\", {\n innerHTML: e.validation.errorMessage\n }, null, 8, lt), [\n [U, e.validation.errorMessage]\n ])\n ]));\n }\n}), st = /* @__PURE__ */ L(at, [[\"__scopeId\", \"data-v-a15ed922\"]]);\nfunction Te(e, t) {\n return De() ? (Ee(e, t), !0) : !1;\n}\n// @__NO_SIDE_EFFECTS__\nfunction fe() {\n const e = /* @__PURE__ */ new Set(), t = (s) => {\n e.delete(s);\n };\n return {\n on: (s) => {\n e.add(s);\n const l = () => t(s);\n return Te(l), { off: l };\n },\n off: t,\n trigger: (...s) => Promise.all(Array.from(e).map((l) => l(...s))),\n clear: () => {\n e.clear();\n }\n };\n}\nconst Ce = typeof window < \"u\" && typeof document < \"u\";\ntypeof WorkerGlobalScope < \"u\" && globalThis instanceof WorkerGlobalScope;\nconst rt = Object.prototype.toString, it = (e) => rt.call(e) === \"[object Object]\", N = () => {\n}, ut = (e, t) => Object.prototype.hasOwnProperty.call(e, t);\nfunction ct(...e) {\n if (e.length !== 1) return Re(...e);\n const t = e[0];\n return typeof t == \"function\" ? Me(He(() => ({\n get: t,\n set: N\n }))) : x(t);\n}\nfunction Z(e) {\n return Array.isArray(e) ? e : [e];\n}\nfunction dt(e, t, n) {\n return P(e, t, {\n ...n,\n immediate: !0\n });\n}\nconst $e = Ce ? window : void 0, ft = Ce ? window.document : void 0;\nfunction R(e) {\n var t;\n const n = w(e);\n return (t = n?.$el) !== null && t !== void 0 ? t : n;\n}\nfunction ee(...e) {\n const t = (o, a, s, l) => (o.addEventListener(a, s, l), () => o.removeEventListener(a, s, l)), n = T(() => {\n const o = Z(w(e[0])).filter((a) => a != null);\n return o.every((a) => typeof a != \"string\") ? o : void 0;\n });\n return dt(() => {\n var o, a;\n return [\n (o = (a = n.value) === null || a === void 0 ? void 0 : a.map((s) => R(s))) !== null && o !== void 0 ? o : [$e].filter((s) => s != null),\n Z(w(n.value ? e[1] : e[0])),\n Z(S(n.value ? e[2] : e[1])),\n w(n.value ? e[3] : e[2])\n ];\n }, ([o, a, s, l], r, i) => {\n if (!o?.length || !a?.length || !s?.length) return;\n const u = it(l) ? { ...l } : l, v = o.flatMap((m) => a.flatMap((d) => s.map((p) => t(m, d, p, u))));\n i(() => {\n v.forEach((m) => m());\n });\n }, { flush: \"post\" });\n}\nfunction me(e, t, n = {}) {\n const { window: o = $e, ignore: a = [], capture: s = !0, detectIframe: l = !1, controls: r = !1 } = n;\n if (!o) return r ? {\n stop: N,\n cancel: N,\n trigger: N\n } : N;\n let i = !0;\n const u = (f) => w(a).some((h) => {\n if (typeof h == \"string\") return Array.from(o.document.querySelectorAll(h)).some((D) => D === f.target || f.composedPath().includes(D));\n {\n const D = R(h);\n return D && (f.target === D || f.composedPath().includes(D));\n }\n });\n function v(f) {\n const h = w(f);\n return h && h.$.subTree.shapeFlag === 16;\n }\n function m(f, h) {\n const D = w(f), y = D.$.subTree && D.$.subTree.children;\n return y == null || !Array.isArray(y) ? !1 : y.some((k) => k.el === h.target || h.composedPath().includes(k.el));\n }\n const d = (f) => {\n const h = R(e);\n if (f.target != null && !(!(h instanceof Element) && v(e) && m(e, f)) && !(!h || h === f.target || f.composedPath().includes(h))) {\n if (\"detail\" in f && f.detail === 0 && (i = !u(f)), !i) {\n i = !0;\n return;\n }\n t(f);\n }\n };\n let p = !1;\n const I = [\n ee(o, \"click\", (f) => {\n p || (p = !0, setTimeout(() => {\n p = !1;\n }, 0), d(f));\n }, {\n passive: !0,\n capture: s\n }),\n ee(o, \"pointerdown\", (f) => {\n const h = R(e);\n i = !u(f) && !!(h && !f.composedPath().includes(h));\n }, { passive: !0 }),\n l && ee(o, \"blur\", (f) => {\n setTimeout(() => {\n var h;\n const D = R(e);\n ((h = o.document.activeElement) === null || h === void 0 ? void 0 : h.tagName) === \"IFRAME\" && !D?.contains(o.document.activeElement) && t(f);\n }, 0);\n }, { passive: !0 })\n ].filter(Boolean), A = () => I.forEach((f) => f());\n return r ? {\n stop: A,\n cancel: () => {\n i = !1;\n },\n trigger: (f) => {\n i = !0, d(f), i = !1;\n }\n } : A;\n}\nconst mt = {\n multiple: !0,\n accept: \"*\",\n reset: !1,\n directory: !1\n};\nfunction vt(e) {\n if (!e) return null;\n if (e instanceof FileList) return e;\n const t = new DataTransfer();\n for (const n of e) t.items.add(n);\n return t.files;\n}\nfunction pt(e = {}) {\n const { document: t = ft } = e, n = x(vt(e.initialFiles)), { on: o, trigger: a } = /* @__PURE__ */ fe(), { on: s, trigger: l } = /* @__PURE__ */ fe(), r = T(() => {\n var m;\n const d = (m = R(e.input)) !== null && m !== void 0 ? m : t ? t.createElement(\"input\") : void 0;\n return d && (d.type = \"file\", d.onchange = (p) => {\n n.value = p.target.files, a(n.value);\n }, d.oncancel = () => {\n l();\n }), d;\n }), i = () => {\n n.value = null, r.value && r.value.value && (r.value.value = \"\", a(null));\n }, u = (m) => {\n const d = r.value;\n d && (d.multiple = w(m.multiple), d.accept = w(m.accept), d.webkitdirectory = w(m.directory), ut(m, \"capture\") && (d.capture = w(m.capture)));\n }, v = (m) => {\n const d = r.value;\n if (!d) return;\n const p = {\n ...mt,\n ...e,\n ...m\n };\n u(p), w(p.reset) && i(), d.click();\n };\n return ae(() => {\n u(e);\n }), {\n files: Me(n),\n open: v,\n reset: i,\n onCancel: s,\n onChange: o\n };\n}\nfunction te(e) {\n return typeof Window < \"u\" && e instanceof Window ? e.document.documentElement : typeof Document < \"u\" && e instanceof Document ? e.documentElement : e;\n}\nconst ne = /* @__PURE__ */ new WeakMap();\nfunction ht(e, t = !1) {\n const n = G(t);\n let o = \"\";\n P(ct(e), (l) => {\n const r = te(w(l));\n if (r) {\n const i = r;\n if (ne.get(i) || ne.set(i, i.style.overflow), i.style.overflow !== \"hidden\" && (o = i.style.overflow), i.style.overflow === \"hidden\") return n.value = !0;\n if (n.value) return i.style.overflow = \"hidden\";\n }\n }, { immediate: !0 });\n const a = () => {\n const l = te(w(e));\n !l || n.value || (l.style.overflow = \"hidden\", n.value = !0);\n }, s = () => {\n const l = te(w(e));\n !l || !n.value || (l.style.overflow = o, ne.delete(l), n.value = !1);\n };\n return Te(s), T({\n get() {\n return n.value;\n },\n set(l) {\n l ? a() : s();\n }\n });\n}\nconst oe = /* @__PURE__ */ new WeakMap(), gt = {\n mounted(e, t) {\n const n = !t.modifiers.bubble;\n let o;\n if (typeof t.value == \"function\") o = me(e, t.value, { capture: n });\n else {\n const [a, s] = t.value;\n o = me(e, a, Object.assign({ capture: n }, s));\n }\n oe.set(e, o);\n },\n unmounted(e) {\n const t = oe.get(e);\n t && typeof t == \"function\" ? t() : t?.stop(), oe.delete(e);\n }\n};\nfunction yt() {\n let e = !1;\n const t = G(!1);\n return (n, o) => {\n if (t.value = o.value, e) return;\n e = !0;\n const a = ht(n, o.value);\n P(t, (s) => a.value = s);\n };\n}\nyt();\nconst bt = { class: \"input-wrapper\" }, wt = {\n id: \"autocomplete-results\",\n class: \"autocomplete-results\"\n}, kt = {\n key: 0,\n class: \"loading autocomplete-result\"\n}, xt = [\"onClick\"], Dt = /* @__PURE__ */ C({\n __name: \"ADropdown\",\n props: /* @__PURE__ */ z({\n label: {},\n items: { default: () => [] },\n isAsync: { type: Boolean, default: !1 },\n filterFunction: { type: Function, default: void 0 }\n }, {\n modelValue: {},\n modelModifiers: {}\n }),\n emits: [\"update:modelValue\"],\n setup(e) {\n const t = q(e, \"modelValue\"), n = Be({\n activeItemIndex: null,\n open: !1,\n loading: !1,\n results: e.items\n }), o = () => r(), a = async () => {\n if (n.open = !0, n.activeItemIndex = null, e.filterFunction) {\n e.isAsync && (n.loading = !0);\n try {\n const d = await e.filterFunction(t.value || \"\");\n n.results = d || [];\n } catch {\n n.results = [];\n } finally {\n e.isAsync && (n.loading = !1);\n }\n } else\n i();\n }, s = (d) => {\n t.value = d, r(d);\n }, l = () => {\n n.activeItemIndex = e.isAsync ? null : t.value && e.items?.indexOf(t.value) || null, n.open = !0, n.results = e.isAsync ? [] : e.items;\n }, r = (d) => {\n n.activeItemIndex = null, n.open = !1, e.items?.includes(d || t.value || \"\") || (t.value = \"\");\n }, i = () => {\n t.value ? n.results = e.items?.filter((d) => d.toLowerCase().includes((t.value ?? \"\").toLowerCase())) : n.results = e.items;\n }, u = () => {\n const d = n.results?.length || 0;\n if (n.activeItemIndex != null) {\n const p = isNaN(n.activeItemIndex) ? 0 : n.activeItemIndex;\n n.activeItemIndex = (p + 1) % d;\n } else\n n.activeItemIndex = 0;\n }, v = () => {\n const d = n.results?.length || 0;\n if (n.activeItemIndex != null) {\n const p = isNaN(n.activeItemIndex) ? 0 : n.activeItemIndex;\n p === 0 ? n.activeItemIndex = null : n.activeItemIndex = p - 1;\n } else\n n.activeItemIndex = d - 1;\n }, m = () => {\n if (n.results) {\n const d = n.activeItemIndex || 0, p = n.results[d];\n s(p);\n }\n n.activeItemIndex = 0;\n };\n return (d, p) => E((g(), b(\"div\", {\n class: X([\"autocomplete\", { isOpen: n.open }])\n }, [\n c(\"div\", bt, [\n E(c(\"input\", {\n \"onUpdate:modelValue\": p[0] || (p[0] = (I) => t.value = I),\n type: \"text\",\n onInput: a,\n onFocus: l,\n onKeydown: [\n F(u, [\"down\"]),\n F(v, [\"up\"]),\n F(m, [\"enter\"]),\n F(o, [\"esc\"]),\n F(o, [\"tab\"])\n ]\n }, null, 544), [\n [H, t.value]\n ]),\n E(c(\"ul\", wt, [\n n.loading ? (g(), b(\"li\", kt, \"Loading results...\")) : (g(!0), b(j, { key: 1 }, Y(n.results, (I, A) => (g(), b(\"li\", {\n key: I,\n class: X([\"autocomplete-result\", { \"is-active\": A === n.activeItemIndex }]),\n onClick: Ie((f) => s(I), [\"stop\"])\n }, M(I), 11, xt))), 128))\n ], 512), [\n [U, n.open]\n ]),\n c(\"label\", null, M(e.label), 1)\n ])\n ], 2)), [\n [S(gt), o]\n ]);\n }\n}), Et = /* @__PURE__ */ L(Dt, [[\"__scopeId\", \"data-v-31a6db8c\"]]);\nfunction Se(e, t) {\n return De() ? (Ee(e, t), !0) : !1;\n}\nconst Mt = typeof window < \"u\" && typeof document < \"u\";\ntypeof WorkerGlobalScope < \"u\" && globalThis instanceof WorkerGlobalScope;\nconst It = (e) => e != null, At = Object.prototype.toString, Tt = (e) => At.call(e) === \"[object Object]\", Ct = () => {\n};\nfunction Q(e) {\n return Array.isArray(e) ? e : [e];\n}\nfunction $t(e, t, n) {\n return P(e, t, {\n ...n,\n immediate: !0\n });\n}\nconst W = Mt ? window : void 0;\nfunction B(e) {\n var t;\n const n = w(e);\n return (t = n?.$el) !== null && t !== void 0 ? t : n;\n}\nfunction K(...e) {\n const t = (o, a, s, l) => (o.addEventListener(a, s, l), () => o.removeEventListener(a, s, l)), n = T(() => {\n const o = Q(w(e[0])).filter((a) => a != null);\n return o.every((a) => typeof a != \"string\") ? o : void 0;\n });\n return $t(() => {\n var o, a;\n return [\n (o = (a = n.value) === null || a === void 0 ? void 0 : a.map((s) => B(s))) !== null && o !== void 0 ? o : [W].filter((s) => s != null),\n Q(w(n.value ? e[1] : e[0])),\n Q(S(n.value ? e[2] : e[1])),\n w(n.value ? e[3] : e[2])\n ];\n }, ([o, a, s, l], r, i) => {\n if (!o?.length || !a?.length || !s?.length) return;\n const u = Tt(l) ? { ...l } : l, v = o.flatMap((m) => a.flatMap((d) => s.map((p) => t(m, d, p, u))));\n i(() => {\n v.forEach((m) => m());\n });\n }, { flush: \"post\" });\n}\n// @__NO_SIDE_EFFECTS__\nfunction St() {\n const e = G(!1), t = Ue();\n return t && se(() => {\n e.value = !0;\n }, t), e;\n}\n// @__NO_SIDE_EFFECTS__\nfunction Lt(e) {\n const t = /* @__PURE__ */ St();\n return T(() => (t.value, !!e()));\n}\nfunction _t(e, t, n = {}) {\n const { window: o = W, ...a } = n;\n let s;\n const l = /* @__PURE__ */ Lt(() => o && \"MutationObserver\" in o), r = () => {\n s && (s.disconnect(), s = void 0);\n }, i = P(T(() => {\n const m = Q(w(e)).map(B).filter(It);\n return new Set(m);\n }), (m) => {\n r(), l.value && m.size && (s = new MutationObserver(t), m.forEach((d) => s.observe(d, a)));\n }, {\n immediate: !0,\n flush: \"post\"\n }), u = () => s?.takeRecords(), v = () => {\n i(), r();\n };\n return Se(v), {\n isSupported: l,\n stop: v,\n takeRecords: u\n };\n}\nfunction Vt(e, t, n = {}) {\n const { window: o = W, document: a = o?.document, flush: s = \"sync\" } = n;\n if (!o || !a) return Ct;\n let l;\n const r = (v) => {\n l?.(), l = v;\n }, i = ae(() => {\n const v = B(e);\n if (v) {\n const { stop: m } = _t(a, (d) => {\n d.map((p) => [...p.removedNodes]).flat().some((p) => p === v || p.contains(v)) && t(d);\n }, {\n window: o,\n childList: !0,\n subtree: !0\n });\n r(m);\n }\n }, { flush: s }), u = () => {\n i(), r();\n };\n return Se(u), u;\n}\n// @__NO_SIDE_EFFECTS__\nfunction Ot(e = {}) {\n var t;\n const { window: n = W, deep: o = !0, triggerOnRemoval: a = !1 } = e, s = (t = e.document) !== null && t !== void 0 ? t : n?.document, l = () => {\n let u = s?.activeElement;\n if (o)\n for (var v; u?.shadowRoot; ) u = u == null || (v = u.shadowRoot) === null || v === void 0 ? void 0 : v.activeElement;\n return u;\n }, r = G(), i = () => {\n r.value = l();\n };\n if (n) {\n const u = {\n capture: !0,\n passive: !0\n };\n K(n, \"blur\", (v) => {\n v.relatedTarget === null && i();\n }, u), K(n, \"focus\", i, u);\n }\n return a && Vt(r, i, { document: s }), i(), r;\n}\nconst Pt = \"focusin\", Ft = \"focusout\", Rt = \":focus-within\";\nfunction Ht(e, t = {}) {\n const { window: n = W } = t, o = T(() => B(e)), a = G(!1), s = T(() => a.value);\n if (!n || !(/* @__PURE__ */ Ot(t)).value) return { focused: s };\n const l = { passive: !0 };\n return K(o, Pt, () => a.value = !0, l), K(o, Ft, () => {\n var r, i, u;\n return a.value = (r = (i = o.value) === null || i === void 0 || (u = i.matches) === null || u === void 0 ? void 0 : u.call(i, Rt)) !== null && r !== void 0 ? r : !1;\n }, l), { focused: s };\n}\nfunction Bt(e, { window: t = W, scrollTarget: n } = {}) {\n const o = x(!1), a = () => {\n if (!t) return;\n const s = t.document, l = B(e);\n if (!l)\n o.value = !1;\n else {\n const r = l.getBoundingClientRect();\n o.value = r.top <= (t.innerHeight || s.documentElement.clientHeight) && r.left <= (t.innerWidth || s.documentElement.clientWidth) && r.bottom >= 0 && r.right >= 0;\n }\n };\n return P(\n () => B(e),\n () => a(),\n { immediate: !0, flush: \"post\" }\n ), t && K(n || t, \"scroll\", a, {\n capture: !1,\n passive: !0\n }), o;\n}\nconst _ = (e) => {\n let t = Bt(e).value;\n return t = t && e.offsetHeight > 0, t;\n}, V = (e) => e.tabIndex >= 0, ve = (e) => {\n const t = e.target;\n return ie(t);\n}, ie = (e) => {\n let t;\n if (e instanceof HTMLTableCellElement) {\n const n = e.parentElement?.previousElementSibling;\n if (n) {\n const o = Array.from(n.children)[e.cellIndex];\n o && (t = o);\n }\n } else if (e instanceof HTMLTableRowElement) {\n const n = e.previousElementSibling;\n n && (t = n);\n }\n return t && (!V(t) || !_(t)) ? ie(t) : t;\n}, qt = (e) => {\n const t = e.target;\n let n;\n if (t instanceof HTMLTableCellElement) {\n const o = t.parentElement?.parentElement;\n if (o) {\n const a = o.firstElementChild?.children[t.cellIndex];\n a && (n = a);\n }\n } else if (t instanceof HTMLTableRowElement) {\n const o = t.parentElement;\n if (o) {\n const a = o.firstElementChild;\n a && (n = a);\n }\n }\n return n && (!V(n) || !_(n)) ? ue(n) : n;\n}, pe = (e) => {\n const t = e.target;\n return ue(t);\n}, ue = (e) => {\n let t;\n if (e instanceof HTMLTableCellElement) {\n const n = e.parentElement?.nextElementSibling;\n if (n) {\n const o = Array.from(n.children)[e.cellIndex];\n o && (t = o);\n }\n } else if (e instanceof HTMLTableRowElement) {\n const n = e.nextElementSibling;\n n && (t = n);\n }\n return t && (!V(t) || !_(t)) ? ue(t) : t;\n}, Ut = (e) => {\n const t = e.target;\n let n;\n if (t instanceof HTMLTableCellElement) {\n const o = t.parentElement?.parentElement;\n if (o) {\n const a = o.lastElementChild?.children[t.cellIndex];\n a && (n = a);\n }\n } else if (t instanceof HTMLTableRowElement) {\n const o = t.parentElement;\n if (o) {\n const a = o.lastElementChild;\n a && (n = a);\n }\n }\n return n && (!V(n) || !_(n)) ? ie(n) : n;\n}, he = (e) => {\n const t = e.target;\n return ce(t);\n}, ce = (e) => {\n let t;\n return e.previousElementSibling ? t = e.previousElementSibling : t = e.parentElement?.previousElementSibling?.lastElementChild, t && (!V(t) || !_(t)) ? ce(t) : t;\n}, ge = (e) => {\n const t = e.target;\n return de(t);\n}, de = (e) => {\n let t;\n return e.nextElementSibling ? t = e.nextElementSibling : t = e.parentElement?.nextElementSibling?.firstElementChild, t && (!V(t) || !_(t)) ? de(t) : t;\n}, ye = (e) => {\n const t = e.target.parentElement?.firstElementChild;\n return t && (!V(t) || !_(t)) ? de(t) : t;\n}, be = (e) => {\n const t = e.target.parentElement?.lastElementChild;\n return t && (!V(t) || !_(t)) ? ce(t) : t;\n}, J = [\"alt\", \"control\", \"shift\", \"meta\"], Wt = {\n ArrowUp: \"up\",\n ArrowDown: \"down\",\n ArrowLeft: \"left\",\n ArrowRight: \"right\"\n}, Le = {\n \"keydown.up\": (e) => {\n const t = ve(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.down\": (e) => {\n const t = pe(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.left\": (e) => {\n const t = he(e);\n e.preventDefault(), e.stopPropagation(), t && t.focus();\n },\n \"keydown.right\": (e) => {\n const t = ge(e);\n e.preventDefault(), e.stopPropagation(), t && t.focus();\n },\n \"keydown.control.up\": (e) => {\n const t = qt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.down\": (e) => {\n const t = Ut(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.left\": (e) => {\n const t = ye(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.right\": (e) => {\n const t = be(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.end\": (e) => {\n const t = be(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.enter\": (e) => {\n if (e.target instanceof HTMLTableCellElement) {\n e.preventDefault(), e.stopPropagation();\n const t = pe(e);\n t && t.focus();\n }\n },\n \"keydown.shift.enter\": (e) => {\n if (e.target instanceof HTMLTableCellElement) {\n e.preventDefault(), e.stopPropagation();\n const t = ve(e);\n t && t.focus();\n }\n },\n \"keydown.home\": (e) => {\n const t = ye(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.tab\": (e) => {\n const t = ge(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.shift.tab\": (e) => {\n const t = he(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n }\n};\nfunction Nt(e) {\n const t = (l) => {\n let r = null;\n return l.parent && (typeof l.parent == \"string\" ? r = document.querySelector(l.parent) : l.parent instanceof HTMLElement ? r = l.parent : r = l.parent.value), r;\n }, n = (l) => {\n const r = t(l);\n let i = [];\n if (typeof l.selectors == \"string\")\n i = Array.from(r ? r.querySelectorAll(l.selectors) : document.querySelectorAll(l.selectors));\n else if (Array.isArray(l.selectors))\n for (const u of l.selectors)\n u instanceof HTMLElement ? i.push(u) : i.push(u.$el);\n else if (l.selectors instanceof HTMLElement)\n i.push(l.selectors);\n else if (l.selectors?.value)\n if (Array.isArray(l.selectors.value))\n for (const u of l.selectors.value)\n u instanceof HTMLElement ? i.push(u) : i.push(u.$el);\n else\n i.push(l.selectors.value);\n return i;\n }, o = (l) => {\n const r = t(l);\n let i = [];\n return l.selectors ? i = n(l) : r && (i = Array.from(r.children).filter((u) => V(u) && _(u))), i;\n }, a = (l) => (r) => {\n const i = Wt[r.key] || r.key.toLowerCase();\n if (J.includes(i)) return;\n const u = l.handlers || Le;\n for (const v of Object.keys(u)) {\n const [m, ...d] = v.split(\".\");\n if (m === \"keydown\" && d.includes(i)) {\n const p = u[v], I = d.filter((f) => J.includes(f)), A = J.some((f) => {\n const h = f.charAt(0).toUpperCase() + f.slice(1);\n return r.getModifierState(h);\n });\n if (I.length > 0) {\n if (A) {\n for (const f of J)\n if (d.includes(f)) {\n const h = f.charAt(0).toUpperCase() + f.slice(1);\n r.getModifierState(h) && p(r);\n }\n }\n } else\n A || p(r);\n }\n }\n }, s = [];\n se(() => {\n for (const l of e) {\n const r = t(l), i = o(l), u = a(l), v = r ? [r] : i;\n for (const m of v) {\n const { focused: d } = Ht(x(m)), p = P(d, (I) => {\n I ? m.addEventListener(\"keydown\", u) : m.removeEventListener(\"keydown\", u);\n });\n s.push(p);\n }\n }\n }), qe(() => {\n for (const l of s)\n l();\n });\n}\nconst jt = {\n ref: \"datepicker\",\n class: \"adatepicker\",\n tabindex: \"0\"\n}, Yt = {\n colspan: \"5\",\n tabindex: -1\n}, Kt = [\"onClick\", \"onKeydown\"], zt = 6, we = 7, Gt = /* @__PURE__ */ C({\n __name: \"ADatePicker\",\n props: {\n modelValue: { default: /* @__PURE__ */ new Date() },\n modelModifiers: {}\n },\n emits: [\"update:modelValue\"],\n setup(e, { expose: t }) {\n const n = q(e, \"modelValue\"), o = x(new Date(n.value)), a = x(o.value.getMonth()), s = x(o.value.getFullYear()), l = x([]), r = xe(\"datepicker\");\n se(async () => {\n i(), await We();\n const y = document.getElementsByClassName(\"selectedDate\");\n if (y.length > 0)\n y[0].focus();\n else {\n const k = document.getElementsByClassName(\"todaysDate\");\n k.length > 0 && k[0].focus();\n }\n });\n const i = () => {\n l.value = [];\n const y = new Date(s.value, a.value, 1), k = y.getDay(), $ = y.setDate(y.getDate() - k);\n for (const O of Array(43).keys())\n l.value.push($ + O * 864e5);\n };\n P([a, s], i);\n const u = () => s.value -= 1, v = () => s.value += 1, m = () => {\n a.value == 0 ? (a.value = 11, u()) : a.value -= 1;\n }, d = () => {\n a.value == 11 ? (a.value = 0, v()) : a.value += 1;\n }, p = (y) => {\n const k = /* @__PURE__ */ new Date();\n if (a.value === k.getMonth())\n return k.toDateString() === new Date(y).toDateString();\n }, I = (y) => new Date(y).toDateString() === new Date(o.value).toDateString(), A = (y, k) => (y - 1) * we + k, f = (y, k) => l.value[A(y, k)], h = (y) => {\n n.value = o.value = new Date(l.value[y]);\n }, D = T(() => new Date(s.value, a.value, 1).toLocaleDateString(void 0, {\n year: \"numeric\",\n month: \"long\"\n }));\n return Nt([\n {\n parent: r,\n selectors: \"td\",\n handlers: {\n ...Le,\n \"keydown.pageup\": m,\n \"keydown.shift.pageup\": u,\n \"keydown.pagedown\": d,\n \"keydown.shift.pagedown\": v,\n // TODO: this is a hack to override the stonecrop enter handler;\n // store context inside the component so that handlers can be setup consistently\n \"keydown.enter\": () => {\n }\n }\n }\n ]), t({ currentMonth: a, currentYear: s, selectedDate: o }), (y, k) => (g(), b(\"div\", jt, [\n c(\"table\", null, [\n c(\"tbody\", null, [\n c(\"tr\", null, [\n c(\"td\", {\n id: \"previous-month-btn\",\n tabindex: -1,\n onClick: m\n }, \"<\"),\n c(\"th\", Yt, M(D.value), 1),\n c(\"td\", {\n id: \"next-month-btn\",\n tabindex: -1,\n onClick: d\n }, \">\")\n ]),\n k[0] || (k[0] = c(\"tr\", { class: \"days-header\" }, [\n c(\"td\", null, \"M\"),\n c(\"td\", null, \"T\"),\n c(\"td\", null, \"W\"),\n c(\"td\", null, \"T\"),\n c(\"td\", null, \"F\"),\n c(\"td\", null, \"S\"),\n c(\"td\", null, \"S\")\n ], -1)),\n (g(), b(j, null, Y(zt, ($) => c(\"tr\", { key: $ }, [\n (g(), b(j, null, Y(we, (O) => c(\"td\", {\n ref_for: !0,\n ref: \"celldate\",\n key: A($, O),\n contenteditable: !1,\n spellcheck: !1,\n tabindex: 0,\n class: X({\n todaysDate: p(f($, O)),\n selectedDate: I(f($, O))\n }),\n onClick: Ie((Ve) => h(A($, O)), [\"prevent\", \"stop\"]),\n onKeydown: F((Ve) => h(A($, O)), [\"enter\"])\n }, M(new Date(f($, O)).getDate()), 43, Kt)), 64))\n ])), 64))\n ])\n ])\n ], 512));\n }\n}), Jt = /* @__PURE__ */ L(Gt, [[\"__scopeId\", \"data-v-056d2b5e\"]]), Qt = /* @__PURE__ */ C({\n __name: \"CollapseButton\",\n props: {\n collapsed: { type: Boolean }\n },\n setup(e) {\n return (t, n) => (g(), b(\"button\", {\n class: X([\"collapse-button\", e.collapsed ? \"rotated\" : \"unrotated\"])\n }, \"×\", 2));\n }\n}), Xt = /* @__PURE__ */ L(Qt, [[\"__scopeId\", \"data-v-6f1c1b45\"]]), Zt = { class: \"aform\" }, en = /* @__PURE__ */ C({\n __name: \"AForm\",\n props: {\n modelValue: {},\n data: {},\n readOnly: { type: Boolean }\n },\n emits: [\"update:modelValue\"],\n setup(e, { emit: t }) {\n const n = t, o = x(e.data || {});\n ae(() => {\n e.data && (o.value = e.data, e.modelValue.forEach((l) => {\n l.fieldname && e.data[l.fieldname] !== void 0 && (l.value = e.data[l.fieldname]);\n }));\n });\n const a = (l) => {\n let r = {};\n for (const [i, u] of Object.entries(l))\n [\"component\", \"fieldtype\"].includes(i) || (r[i] = u), i === \"rows\" && u && u.length === 0 && (r.rows = o.value[l.fieldname]);\n return r;\n }, s = T({\n get: () => e.modelValue.map((l, r) => T({\n get() {\n return l.value;\n },\n set: (i) => {\n e.modelValue[r].value = i, n(\"update:modelValue\", e.modelValue);\n }\n })),\n set: () => {\n }\n });\n return (l, r) => (g(), b(\"form\", Zt, [\n (g(!0), b(j, null, Y(e.modelValue, (i, u) => (g(), le(Ne(i.component), je({\n key: u,\n modelValue: s.value[u].value,\n \"onUpdate:modelValue\": (v) => s.value[u].value = v,\n schema: i,\n data: o.value[i.fieldname],\n readOnly: e.readOnly\n }, { ref_for: !0 }, a(i)), null, 16, [\"modelValue\", \"onUpdate:modelValue\", \"schema\", \"data\", \"readOnly\"]))), 128))\n ]));\n }\n}), _e = /* @__PURE__ */ L(en, [[\"__scopeId\", \"data-v-5336a410\"]]), tn = /* @__PURE__ */ C({\n __name: \"AFieldset\",\n props: {\n schema: {},\n label: {},\n collapsible: { type: Boolean },\n data: { default: () => ({}) }\n },\n setup(e, { expose: t }) {\n const n = x(!1), o = x(e.data || []), a = x(e.schema), s = (l) => {\n l.preventDefault(), e.collapsible && (n.value = !n.value);\n };\n return t({ collapsed: n }), (l, r) => (g(), b(\"fieldset\", null, [\n c(\"legend\", {\n onClick: s,\n onSubmit: s\n }, [\n Ae(M(e.label) + \" \", 1),\n e.collapsible ? (g(), le(Xt, {\n key: 0,\n collapsed: n.value\n }, null, 8, [\"collapsed\"])) : re(\"\", !0)\n ], 32),\n Ye(l.$slots, \"default\", { collapsed: n.value }, () => [\n E(Ke(_e, {\n modelValue: a.value,\n \"onUpdate:modelValue\": r[0] || (r[0] = (i) => a.value = i),\n data: o.value\n }, null, 8, [\"modelValue\", \"data\"]), [\n [U, !n.value]\n ])\n ], !0)\n ]));\n }\n}), nn = /* @__PURE__ */ L(tn, [[\"__scopeId\", \"data-v-40b2a95d\"]]), on = { class: \"aform_form-element aform_file-attach aform__grid--full\" }, ln = {\n key: 0,\n class: \"aform_file-attach-feedback\"\n}, an = [\"disabled\"], sn = /* @__PURE__ */ C({\n __name: \"AFileAttach\",\n props: {\n label: {}\n },\n setup(e) {\n const { files: t, open: n, reset: o, onChange: a } = pt(), s = T(() => `${t.value.length} ${t.value.length === 1 ? \"file\" : \"files\"}`);\n return a((l) => l), (l, r) => (g(), b(\"div\", on, [\n S(t) ? (g(), b(\"div\", ln, [\n c(\"p\", null, [\n r[2] || (r[2] = Ae(\" You have selected: \", -1)),\n c(\"b\", null, M(s.value), 1)\n ]),\n (g(!0), b(j, null, Y(S(t), (i) => (g(), b(\"li\", {\n key: i.name\n }, M(i.name), 1))), 128))\n ])) : re(\"\", !0),\n c(\"button\", {\n type: \"button\",\n class: \"aform_form-btn\",\n onClick: r[0] || (r[0] = (i) => S(n)())\n }, M(e.label), 1),\n c(\"button\", {\n type: \"button\",\n disabled: !S(t),\n class: \"aform_form-btn\",\n onClick: r[1] || (r[1] = (i) => S(o)())\n }, \"Reset\", 8, an)\n ]));\n }\n}), rn = /* @__PURE__ */ L(sn, [[\"__scopeId\", \"data-v-b700734f\"]]), un = { class: \"aform_form-element\" }, cn = [\"id\", \"disabled\", \"required\"], dn = [\"for\"], fn = [\"innerHTML\"], mn = /* @__PURE__ */ C({\n __name: \"ANumericInput\",\n props: /* @__PURE__ */ z({\n schema: {},\n label: {},\n mask: {},\n required: { type: Boolean },\n readOnly: { type: Boolean },\n uuid: {},\n validation: { default: () => ({ errorMessage: \"&nbsp;\" }) }\n }, {\n modelValue: {},\n modelModifiers: {}\n }),\n emits: [\"update:modelValue\"],\n setup(e) {\n const t = q(e, \"modelValue\");\n return (n, o) => (g(), b(\"div\", un, [\n E(c(\"input\", {\n id: e.uuid,\n \"onUpdate:modelValue\": o[0] || (o[0] = (a) => t.value = a),\n class: \"aform_input-field\",\n type: \"number\",\n disabled: e.readOnly,\n required: e.required\n }, null, 8, cn), [\n [H, t.value]\n ]),\n c(\"label\", {\n class: \"aform_field-label\",\n for: e.uuid\n }, M(e.label), 9, dn),\n E(c(\"p\", {\n class: \"aform_error\",\n innerHTML: e.validation.errorMessage\n }, null, 8, fn), [\n [U, e.validation.errorMessage]\n ])\n ]));\n }\n}), ke = {\n date: \"##/##/####\",\n datetime: \"####/##/## ##:##\",\n time: \"##:##\",\n fulltime: \"##:##:##\",\n phone: \"(###) ### - ####\",\n card: \"#### #### #### ####\"\n};\nfunction vn(e) {\n try {\n return Function(`\"use strict\";return (${e})`)();\n } catch {\n }\n}\nfunction pn(e) {\n let t = e.value;\n if (t) {\n const n = vn(t);\n if (n) {\n const o = e.instance?.locale;\n t = n(o);\n }\n } else {\n const o = e.instance?.schema?.fieldtype?.toLowerCase();\n o && ke[o] && (t = ke[o]);\n }\n return t;\n}\nfunction hn(e, t) {\n let n = e;\n const o = [t, \"/\", \"-\", \"(\", \")\", \" \"];\n for (const a of o)\n n = n.replaceAll(a, \"\");\n return n;\n}\nfunction gn(e, t, n) {\n let o = t;\n for (const a of e) {\n const s = o.indexOf(n);\n if (s !== -1) {\n const l = o.substring(0, s), r = o.substring(s + 1);\n o = l + a + r;\n }\n }\n return o.slice(0, t.length);\n}\nfunction yn(e, t) {\n const n = pn(t);\n if (!n) return;\n const o = \"#\", a = e.value, s = hn(a, o);\n if (s) {\n const l = gn(s, n, o);\n t.instance?.maskFilled && (t.instance.maskFilled = !l.includes(o)), e.value = l;\n } else\n e.value = n;\n}\nconst bn = { class: \"aform_form-element\" }, wn = [\"id\", \"disabled\", \"maxlength\", \"required\"], kn = [\"for\"], xn = [\"innerHTML\"], Dn = /* @__PURE__ */ C({\n __name: \"ATextInput\",\n props: /* @__PURE__ */ z({\n schema: {},\n label: {},\n mask: {},\n required: { type: Boolean },\n readOnly: { type: Boolean },\n uuid: {},\n validation: { default: () => ({ errorMessage: \"&nbsp;\" }) }\n }, {\n modelValue: {},\n modelModifiers: {}\n }),\n emits: [\"update:modelValue\"],\n setup(e) {\n const t = x(!0), n = q(e, \"modelValue\");\n return (o, a) => (g(), b(\"div\", bn, [\n E(c(\"input\", {\n id: e.uuid,\n \"onUpdate:modelValue\": a[0] || (a[0] = (s) => n.value = s),\n class: \"aform_input-field\",\n disabled: e.readOnly,\n maxlength: e.mask && t.value ? e.mask.length : void 0,\n required: e.required\n }, null, 8, wn), [\n [H, n.value],\n [S(yn), e.mask]\n ]),\n c(\"label\", {\n class: \"aform_field-label\",\n for: e.uuid\n }, M(e.label), 9, kn),\n E(c(\"p\", {\n class: \"aform_error\",\n innerHTML: e.validation.errorMessage\n }, null, 8, xn), [\n [U, e.validation.errorMessage]\n ])\n ]));\n }\n}), En = { class: \"login-container\" }, Mn = { class: \"account-container\" }, In = { class: \"account-header\" }, An = { id: \"account-title\" }, Tn = { id: \"account-subtitle\" }, Cn = { class: \"login-form-container\" }, $n = { class: \"login-form-email aform_form-element\" }, Sn = [\"disabled\"], Ln = { class: \"login-form-password aform_form-element\" }, _n = [\"disabled\"], Vn = [\"disabled\"], On = {\n key: 0,\n class: \"material-symbols-outlined loading-icon\"\n}, Pn = /* @__PURE__ */ C({\n __name: \"Login\",\n props: {\n headerTitle: { default: \"Login\" },\n headerSubtitle: { default: \"Enter your email and password to login\" }\n },\n emits: [\"loginFailed\", \"loginSuccess\"],\n setup(e, { emit: t }) {\n const n = t, o = x(\"\"), a = x(\"\"), s = x(!1), l = x(!1);\n function r(i) {\n if (i.preventDefault(), s.value = !0, l.value) {\n s.value = !1, n(\"loginFailed\");\n return;\n }\n s.value = !1, n(\"loginSuccess\");\n }\n return (i, u) => (g(), b(\"div\", En, [\n c(\"div\", null, [\n c(\"div\", Mn, [\n c(\"div\", In, [\n c(\"h1\", An, M(e.headerTitle), 1),\n c(\"p\", Tn, M(e.headerSubtitle), 1)\n ]),\n c(\"form\", { onSubmit: r }, [\n c(\"div\", Cn, [\n c(\"div\", $n, [\n u[2] || (u[2] = c(\"label\", {\n id: \"login-email\",\n for: \"email\",\n class: \"aform_field-label\"\n }, \"Email\", -1)),\n E(c(\"input\", {\n id: \"email\",\n \"onUpdate:modelValue\": u[0] || (u[0] = (v) => o.value = v),\n class: \"aform_input-field\",\n name: \"email\",\n placeholder: \"name@example.com\",\n type: \"email\",\n \"auto-capitalize\": \"none\",\n \"auto-complete\": \"email\",\n \"auto-correct\": \"off\",\n disabled: s.value\n }, null, 8, Sn), [\n [H, o.value]\n ])\n ]),\n c(\"div\", Ln, [\n u[3] || (u[3] = c(\"label\", {\n id: \"login-password\",\n for: \"password\",\n class: \"aform_field-label\"\n }, \"Password\", -1)),\n E(c(\"input\", {\n id: \"password\",\n \"onUpdate:modelValue\": u[1] || (u[1] = (v) => a.value = v),\n class: \"aform_input-field\",\n name: \"password\",\n type: \"password\",\n disabled: s.value\n }, null, 8, _n), [\n [H, a.value]\n ])\n ]),\n c(\"button\", {\n class: \"btn\",\n disabled: s.value || !o.value || !a.value,\n onClick: r\n }, [\n s.value ? (g(), b(\"span\", On, \"progress_activity\")) : re(\"\", !0),\n u[4] || (u[4] = c(\"span\", { id: \"login-form-button\" }, \"Login\", -1))\n ], 8, Vn)\n ])\n ], 32),\n u[5] || (u[5] = c(\"button\", { class: \"btn\" }, [\n c(\"span\", { id: \"forgot-password-button\" }, \"Forgot password?\")\n ], -1))\n ])\n ])\n ]));\n }\n}), Rn = /* @__PURE__ */ L(Pn, [[\"__scopeId\", \"data-v-d9ffd0a7\"]]);\nfunction Hn(e) {\n e.component(\"ACheckbox\", et), e.component(\"ACombobox\", tt), e.component(\"ADate\", st), e.component(\"ADropdown\", Et), e.component(\"ADatePicker\", Jt), e.component(\"AFieldset\", nn), e.component(\"AFileAttach\", rn), e.component(\"AForm\", _e), e.component(\"ANumericInput\", mn), e.component(\"ATextInput\", Dn);\n}\nexport {\n et as ACheckbox,\n tt as AComboBox,\n st as ADate,\n Jt as ADatePicker,\n Et as ADropdown,\n nn as AFieldset,\n rn as AFileAttach,\n _e as AForm,\n mn as ANumericInput,\n Dn as ATextInput,\n Rn as Login,\n Hn as install\n};\n//# sourceMappingURL=aform.js.map\n","<template>\n\t<footer>\n\t\t<ul class=\"tabs\">\n\t\t\t<li class=\"hidebreadcrumbs\" @click=\"toggleBreadcrumbs\" @keydown.enter=\"toggleBreadcrumbs\">\n\t\t\t\t<a tabindex=\"0\"><div :class=\"rotateHideTabIcon\">×</div></a>\n\t\t\t</li>\n\t\t\t<li\n\t\t\t\tclass=\"hometab\"\n\t\t\t\t:style=\"{ display: breadcrumbsVisibile ? 'block' : 'none' }\"\n\t\t\t\t@click=\"navigateHome\"\n\t\t\t\t@keydown.enter=\"navigateHome\">\n\t\t\t\t<router-link to=\"/\" tabindex=\"0\">\n\t\t\t\t\t<svg class=\"icon\" aria-label=\"Home\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\">\n\t\t\t\t\t\t<path d=\"M3 12l9-9 9 9\" />\n\t\t\t\t\t\t<path d=\"M9 21V12h6v9\" />\n\t\t\t\t\t</svg>\n\t\t\t\t</router-link>\n\t\t\t</li>\n\t\t\t<li\n\t\t\t\t:class=\"['searchtab', { 'search-active': searchVisible }]\"\n\t\t\t\t:style=\"{ display: breadcrumbsVisibile ? 'block' : 'none' }\">\n\t\t\t\t<a tabindex=\"0\">\n\t\t\t\t\t<svg\n\t\t\t\t\t\tv-show=\"!searchVisible\"\n\t\t\t\t\t\tclass=\"icon search-icon\"\n\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\taria-label=\"Search\"\n\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\t\t@click=\"toggleSearch\"\n\t\t\t\t\t\t@keydown.enter=\"toggleSearch\">\n\t\t\t\t\t\t<circle cx=\"11\" cy=\"11\" r=\"7\" />\n\t\t\t\t\t\t<path d=\"M21 21l-4.35-4.35\" />\n\t\t\t\t\t</svg>\n\t\t\t\t\t<input\n\t\t\t\t\t\tv-show=\"searchVisible\"\n\t\t\t\t\t\tref=\"searchinput\"\n\t\t\t\t\t\tv-model=\"searchText\"\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tplaceholder=\"Search...\"\n\t\t\t\t\t\t@click.stop\n\t\t\t\t\t\t@input=\"handleSearchInput($event)\"\n\t\t\t\t\t\t@blur=\"handleSearch($event)\"\n\t\t\t\t\t\t@keydown.enter=\"handleSearch($event)\"\n\t\t\t\t\t\t@keydown.escape=\"toggleSearch\" />\n\t\t\t\t</a>\n\t\t\t</li>\n\t\t\t<li\n\t\t\t\tv-for=\"breadcrumb in breadcrumbs\"\n\t\t\t\t:key=\"breadcrumb.title\"\n\t\t\t\t:style=\"{ display: breadcrumbsVisibile ? 'block' : 'none' }\">\n\t\t\t\t<router-link tabindex=\"0\" :to=\"breadcrumb.to\"> {{ breadcrumb.title }} </router-link>\n\t\t\t</li>\n\t\t</ul>\n\t</footer>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, nextTick, ref, useTemplateRef } from 'vue'\n\nconst { breadcrumbs = [] } = defineProps<{ breadcrumbs?: { title: string; to: string }[] }>()\n\nconst breadcrumbsVisibile = ref(true)\nconst searchVisible = ref(false)\nconst searchText = ref('')\nconst inputRef = useTemplateRef<HTMLInputElement>('searchinput')\n\nconst rotateHideTabIcon = computed(() => {\n\treturn breadcrumbsVisibile.value ? 'unrotated' : 'rotated'\n})\n\nconst toggleBreadcrumbs = () => {\n\tbreadcrumbsVisibile.value = !breadcrumbsVisibile.value\n}\n\nconst toggleSearch = async () => {\n\tsearchVisible.value = !searchVisible.value\n\tawait nextTick(() => {\n\t\tinputRef.value?.focus()\n\t})\n}\n\nconst handleSearchInput = (event: Event | MouseEvent) => {\n\tevent.preventDefault()\n\tevent.stopPropagation()\n}\n\nconst handleSearch = async (event: FocusEvent | KeyboardEvent) => {\n\tevent.preventDefault()\n\tevent.stopPropagation()\n\tawait toggleSearch()\n}\n\nconst navigateHome = (/* event: MouseEvent | KeyboardEvent */) => {\n\t// navigate home\n}\n</script>\n\n<style scoped>\nfooter {\n\tposition: fixed;\n\tbottom: 0px;\n\twidth: 100%;\n\tbackground-color: transparent;\n\theight: auto;\n\tmin-height: 2.4rem;\n\tz-index: 100;\n\ttext-align: left;\n\tfont-size: 100%;\n\tdisplay: flex;\n\tjustify-content: right;\n\tpadding: 0 0.75rem 0 0;\n\tbox-sizing: border-box;\n}\nul {\n\tdisplay: flex;\n\tflex-direction: row-reverse;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n\n.tabs li {\n\tfloat: left;\n\tlist-style-type: none;\n\tposition: relative;\n\tmargin-left: -1px;\n}\n\n/* Base tab styling */\n.tabs a {\n\tfloat: left;\n\tpadding: 0.5rem 1rem;\n\theight: 2.4rem;\n\tbox-sizing: border-box;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\ttext-decoration: none;\n\tcolor: var(--sc-gray-60, #666);\n\tbackground: var(--sc-btn-color, #ffffff);\n\tborder: 1px solid var(--sc-btn-border, #ccc);\n\tfont-size: 0.85rem;\n\tfont-family: var(--sc-font-family, system-ui, sans-serif);\n\ttransition: all 0.15s ease;\n\n\t/* Minimal ornamentation - subtle top radius only */\n\tborder-top-left-radius: 2px;\n\tborder-top-right-radius: 2px;\n}\n\n.tabs a:hover {\n\tbackground: var(--sc-btn-hover, #f2f2f2);\n}\n\n.tabs .router-link-active {\n\tz-index: 3;\n\tbackground: var(--sc-primary-color, #827553) !important;\n\tborder-color: var(--sc-primary-color, #827553) !important;\n\tcolor: var(--sc-primary-text-color, #fff) !important;\n}\n\n/* Pseudo-elements removed - minimal ornamentation style */\n\n/* Hide breadcrumbs tab */\n.hidebreadcrumbs a {\n\tmin-width: 2.4rem;\n\twidth: 2.4rem;\n\theight: 2.4rem;\n\tpadding: 0.5rem;\n\tbackground: var(--sc-btn-color, #ffffff);\n\tborder: 1px solid var(--sc-btn-border, #ccc);\n\tcolor: var(--sc-gray-60, #666);\n}\n\n.hidebreadcrumbs a div {\n\tfont-size: 1.2rem;\n}\n\n.rotated {\n\ttransform: rotate(45deg);\n\t-webkit-transform: rotate(45deg);\n\t-moz-transform: rotate(45deg);\n\t-ms-transform: rotate(45deg);\n\t-o-transform: rotate(45deg);\n\ttransition: transform 250ms ease;\n}\n.unrotated {\n\ttransform: rotate(0deg);\n\t-webkit-transform: rotate(0deg);\n\t-moz-transform: rotate(0deg);\n\t-ms-transform: rotate(0deg);\n\t-o-transform: rotate(0deg);\n\ttransition: transform 250ms ease;\n}\n\nli:active,\nli:hover,\nli:focus,\nli > a:active,\nli > a:hover,\nli > a:focus {\n\tz-index: 3;\n}\n\na:active,\na:hover,\na:focus {\n\toutline: 2px solid var(--sc-input-active-border-color, black);\n\tz-index: 3;\n}\n\n/* Home tab */\n.hometab a {\n\tmin-width: 2.4rem;\n\twidth: 2.4rem;\n\theight: 2.4rem;\n\tpadding: 0.5rem;\n\tbackground: var(--sc-btn-color, #ffffff);\n\tborder: 1px solid var(--sc-btn-border, #ccc);\n\tcolor: var(--sc-gray-60, #666);\n}\n\n/* SVG icon styling */\n.icon {\n\twidth: 1rem;\n\theight: 1rem;\n\tstroke: currentColor;\n\tflex-shrink: 0;\n}\n\n/* Search tab with animation */\n.searchtab {\n\toverflow: hidden;\n}\n\n.searchtab a {\n\tmin-width: 2.4rem;\n\theight: 2.4rem;\n\tpadding: 0.5rem;\n\tbackground: var(--sc-btn-color, #ffffff);\n\tborder: 1px solid var(--sc-btn-border, #ccc);\n\tcolor: var(--sc-gray-60, #666);\n\toverflow: hidden;\n\t/* Animation for smooth expand/collapse */\n\tmax-width: 2.4rem;\n\ttransition: max-width 0.35s ease-in-out, padding 0.35s ease-in-out, background 0.2s ease;\n}\n\n.searchtab .search-icon {\n\tcursor: pointer;\n}\n\n.searchtab input {\n\toutline: none;\n\tborder: 1px solid var(--sc-input-border-color, #ccc);\n\tborder-radius: 0.25rem;\n\tbackground-color: var(--sc-form-background, #ffffff);\n\tcolor: var(--sc-gray-80, #333);\n\ttext-align: left;\n\tfont-size: 0.875rem;\n\tpadding: 0.25rem 0.5rem;\n\twidth: 180px;\n\theight: 1.5rem;\n\tflex-shrink: 0;\n\topacity: 0;\n\ttransition: opacity 0.2s ease-in-out;\n\ttransition-delay: 0s;\n}\n\n.searchtab input:focus {\n\tborder-color: var(--sc-input-active-border-color, #4f46e5);\n\toutline: none;\n}\n\n.searchtab input::placeholder {\n\tcolor: var(--sc-input-label-color, #999);\n}\n\n/* Search active state - expanded with animation */\n.searchtab.search-active a {\n\tmax-width: 200px;\n\tmin-width: auto;\n\twidth: auto;\n\tpadding: 0.5rem 0.75rem;\n}\n\n.searchtab.search-active input {\n\topacity: 1;\n\ttransition-delay: 0.15s;\n}\n</style>\n","<template>\n\t<div class=\"desktop\" @click=\"handleClick\">\n\t\t<!-- Action Set -->\n\t\t<ActionSet :elements=\"actionElements\" @action-click=\"handleActionClick\" />\n\n\t\t<!-- Main content using AForm -->\n\t\t<AForm v-if=\"writableSchema.length > 0\" v-model=\"writableSchema\" :data=\"currentViewData\" />\n\t\t<div v-else-if=\"!stonecrop\" class=\"loading\"><p>Initializing Stonecrop...</p></div>\n\t\t<div v-else class=\"loading\">\n\t\t\t<p>Loading {{ currentView }} data...</p>\n\t\t</div>\n\n\t\t<!-- Sheet Navigation -->\n\t\t<SheetNav :breadcrumbs=\"navigationBreadcrumbs\" />\n\n\t\t<!-- Command Palette -->\n\t\t<CommandPalette\n\t\t\t:is-open=\"commandPaletteOpen\"\n\t\t\t:search=\"searchCommands\"\n\t\t\tplaceholder=\"Type a command or search...\"\n\t\t\t@select=\"executeCommand\"\n\t\t\t@close=\"commandPaletteOpen = false\">\n\t\t\t<template #title=\"{ result }\">\n\t\t\t\t{{ result.title }}\n\t\t\t</template>\n\t\t\t<template #content=\"{ result }\">\n\t\t\t\t{{ result.description }}\n\t\t\t</template>\n\t\t</CommandPalette>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { useStonecrop } from '@stonecrop/stonecrop'\nimport { AForm, type SchemaTypes, type TableColumn, type TableConfig } from '@stonecrop/aform'\nimport { computed, nextTick, onMounted, provide, ref, unref, watch } from 'vue'\n\nimport ActionSet from './ActionSet.vue'\nimport SheetNav from './SheetNav.vue'\nimport CommandPalette from './CommandPalette.vue'\nimport type { ActionElements } from '../types'\n\nconst { availableDoctypes = [] } = defineProps<{ availableDoctypes?: string[] }>()\n\nconst { stonecrop } = useStonecrop()\n\n// State\nconst loading = ref(false)\nconst saving = ref(false)\nconst commandPaletteOpen = ref(false)\n\n// HST-based form data management - field triggers are handled automatically by HST\n\n// Computed property that reads from HST store for reactive form data\nconst currentViewData = computed<Record<string, any>>({\n\tget() {\n\t\tif (!stonecrop.value || !currentDoctype.value || !currentRecordId.value) {\n\t\t\treturn {}\n\t\t}\n\n\t\ttry {\n\t\t\tconst record = stonecrop.value.getRecordById(currentDoctype.value, currentRecordId.value)\n\t\t\treturn record?.get('') || {}\n\t\t} catch {\n\t\t\treturn {}\n\t\t}\n\t},\n\tset(newData: Record<string, any>) {\n\t\tif (!stonecrop.value || !currentDoctype.value || !currentRecordId.value) {\n\t\t\treturn\n\t\t}\n\n\t\ttry {\n\t\t\t// Update each field in HST, which will automatically trigger field actions\n\t\t\tconst hstStore = stonecrop.value.getStore()\n\t\t\tfor (const [fieldname, value] of Object.entries(newData)) {\n\t\t\t\tconst fieldPath = `${currentDoctype.value}.${currentRecordId.value}.${fieldname}`\n\t\t\t\thstStore.set(fieldPath, value)\n\t\t\t}\n\t\t} catch (error) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn('HST update failed:', error)\n\t\t}\n\t},\n})\n\n// HST-based form data management - field triggers are handled automatically by HST\n\n// Computed properties for current route context\nconst route = computed(() => unref(stonecrop.value?.registry.router?.currentRoute))\nconst router = computed(() => stonecrop.value?.registry.router)\nconst currentDoctype = computed(() => {\n\tif (!route.value) return ''\n\n\t// First check if we have actualDoctype in meta (from registered routes)\n\tif (route.value.meta?.actualDoctype) {\n\t\treturn route.value.meta.actualDoctype as string\n\t}\n\n\t// For named routes, use params.doctype\n\tif (route.value.params.doctype) {\n\t\treturn route.value.params.doctype as string\n\t}\n\n\t// For catch-all routes that haven't been registered yet, extract from path\n\tconst pathMatch = route.value.params.pathMatch as string[] | undefined\n\tif (pathMatch && pathMatch.length > 0) {\n\t\treturn pathMatch[0]\n\t}\n\n\treturn ''\n})\n\n// The route doctype for display and navigation (e.g., 'todo')\nconst routeDoctype = computed(() => {\n\tif (!route.value) return ''\n\n\t// Check route meta first\n\tif (route.value.meta?.doctype) {\n\t\treturn route.value.meta.doctype as string\n\t}\n\n\t// For named routes, use params.doctype\n\tif (route.value.params.doctype) {\n\t\treturn route.value.params.doctype as string\n\t}\n\n\t// For catch-all routes, extract from path\n\tconst pathMatch = route.value.params.pathMatch as string[] | undefined\n\tif (pathMatch && pathMatch.length > 0) {\n\t\treturn pathMatch[0]\n\t}\n\n\treturn ''\n})\n\nconst currentRecordId = computed(() => {\n\tif (!route.value) return ''\n\n\t// For named routes, use params.recordId\n\tif (route.value.params.recordId) {\n\t\treturn route.value.params.recordId as string\n\t}\n\n\t// For catch-all routes that haven't been registered yet, extract from path\n\tconst pathMatch = route.value.params.pathMatch as string[] | undefined\n\tif (pathMatch && pathMatch.length > 1) {\n\t\treturn pathMatch[1]\n\t}\n\n\treturn ''\n})\nconst isNewRecord = computed(() => currentRecordId.value?.startsWith('new-'))\n\n// Determine current view based on route\nconst currentView = computed(() => {\n\tif (!route.value) {\n\t\treturn 'doctypes'\n\t}\n\n\t// Home route\n\tif (route.value.name === 'home' || route.value.path === '/') {\n\t\treturn 'doctypes'\n\t}\n\n\t// Named routes from registered doctypes\n\tif (route.value.name && route.value.name !== 'catch-all') {\n\t\tconst routeName = route.value.name as string\n\t\tif (routeName.includes('form') || route.value.params.recordId) {\n\t\t\treturn 'record'\n\t\t} else if (routeName.includes('list') || route.value.params.doctype) {\n\t\t\treturn 'records'\n\t\t}\n\t}\n\n\t// Catch-all route - determine from path structure\n\tconst pathMatch = route.value.params.pathMatch as string[] | undefined\n\tif (pathMatch && pathMatch.length > 0) {\n\t\tconst view = pathMatch.length === 1 ? 'records' : 'record'\n\t\treturn view\n\t}\n\n\treturn 'doctypes'\n})\n\n// Computed properties (now that all helper functions are defined)\n// Helper function to get available transitions for current record\nconst getAvailableTransitions = () => {\n\tif (!stonecrop.value || !currentDoctype.value || !currentRecordId.value) {\n\t\treturn []\n\t}\n\n\ttry {\n\t\tconst registry = stonecrop.value.registry\n\t\tconst meta = registry.registry[currentDoctype.value]\n\n\t\tif (!meta?.workflow?.states) {\n\t\t\treturn []\n\t\t}\n\n\t\t// Get current FSM state (for now, use workflow initial state or 'editing')\n\t\t// In a full implementation, this would track actual FSM state\n\t\tconst currentState = isNewRecord.value ? 'creating' : 'editing'\n\t\tconst stateConfig = meta.workflow.states[currentState]\n\n\t\tif (!stateConfig?.on) {\n\t\t\treturn []\n\t\t}\n\n\t\t// Get available transitions from current state\n\t\tconst transitions = Object.keys(stateConfig.on)\n\n\t\t// Create action elements for each transition\n\t\tconst actionElements = transitions.map(transition => {\n\t\t\tconst targetState = stateConfig.on?.[transition]\n\t\t\tconst targetStateName = typeof targetState === 'string' ? targetState : 'unknown'\n\n\t\t\tconst actionFn = async () => {\n\t\t\t\tconst node = stonecrop.value?.getRecordById(currentDoctype.value, currentRecordId.value)\n\t\t\t\tif (node) {\n\t\t\t\t\tconst recordData = currentViewData.value || {}\n\t\t\t\t\tawait node.triggerTransition(transition, {\n\t\t\t\t\t\tcurrentState,\n\t\t\t\t\t\ttargetState: targetStateName,\n\t\t\t\t\t\tfsmContext: recordData,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst element = {\n\t\t\t\tlabel: `${transition} (→ ${targetStateName})`,\n\t\t\t\taction: actionFn,\n\t\t\t}\n\n\t\t\treturn element\n\t\t})\n\n\t\treturn actionElements\n\t} catch (error) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn('Error getting available transitions:', error)\n\t\treturn []\n\t}\n}\n\n// New component reactive properties// New component reactive properties\nconst actionElements = computed<ActionElements[]>(() => {\n\tconst elements: ActionElements[] = []\n\n\tswitch (currentView.value) {\n\t\tcase 'doctypes':\n\t\t\telements.push({\n\t\t\t\ttype: 'button',\n\t\t\t\tlabel: 'Refresh',\n\t\t\t\taction: () => {\n\t\t\t\t\t// Refresh doctypes\n\t\t\t\t\twindow.location.reload()\n\t\t\t\t},\n\t\t\t})\n\t\t\tbreak\n\t\tcase 'records':\n\t\t\telements.push(\n\t\t\t\t{\n\t\t\t\t\ttype: 'button',\n\t\t\t\t\tlabel: 'New Record',\n\t\t\t\t\taction: () => void createNewRecord(),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttype: 'button',\n\t\t\t\t\tlabel: 'Refresh',\n\t\t\t\t\taction: () => {\n\t\t\t\t\t\t// Refresh records\n\t\t\t\t\t\twindow.location.reload()\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t)\n\t\t\tbreak\n\t\tcase 'record': {\n\t\t\t// Add XState Transitions dropdown for record view\n\t\t\tconst transitionActions = getAvailableTransitions()\n\t\t\tif (transitionActions.length > 0) {\n\t\t\t\telements.push({\n\t\t\t\t\ttype: 'dropdown',\n\t\t\t\t\tlabel: 'Actions',\n\t\t\t\t\tactions: transitionActions,\n\t\t\t\t})\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn elements\n})\n\nconst navigationBreadcrumbs = computed(() => {\n\tconst breadcrumbs: { title: string; to: string }[] = []\n\n\tif (currentView.value === 'records' && routeDoctype.value) {\n\t\tbreadcrumbs.push(\n\t\t\t{ title: 'Home', to: '/' },\n\t\t\t{ title: formatDoctypeName(routeDoctype.value), to: `/${routeDoctype.value}` }\n\t\t)\n\t} else if (currentView.value === 'record' && routeDoctype.value) {\n\t\tbreadcrumbs.push(\n\t\t\t{ title: 'Home', to: '/' },\n\t\t\t{ title: formatDoctypeName(routeDoctype.value), to: `/${routeDoctype.value}` },\n\t\t\t{ title: isNewRecord.value ? 'New Record' : 'Edit Record', to: route.value?.fullPath || '' }\n\t\t)\n\t}\n\n\treturn breadcrumbs\n})\n\n// Command palette functionality\ntype Command = {\n\ttitle: string\n\tdescription: string\n\taction: () => void\n}\n\nconst searchCommands = (query: string): Command[] => {\n\tconst commands: Command[] = [\n\t\t{\n\t\t\ttitle: 'Go Home',\n\t\t\tdescription: 'Navigate to the home page',\n\t\t\taction: () => void router.value?.push('/'),\n\t\t},\n\t\t{\n\t\t\ttitle: 'Toggle Command Palette',\n\t\t\tdescription: 'Open/close the command palette',\n\t\t\taction: () => (commandPaletteOpen.value = !commandPaletteOpen.value),\n\t\t},\n\t]\n\n\t// Add doctype-specific commands\n\tif (routeDoctype.value) {\n\t\tcommands.push({\n\t\t\ttitle: `View ${formatDoctypeName(routeDoctype.value)} Records`,\n\t\t\tdescription: `Navigate to ${routeDoctype.value} list`,\n\t\t\taction: () => void router.value?.push(`/${routeDoctype.value}`),\n\t\t})\n\n\t\tcommands.push({\n\t\t\ttitle: `Create New ${formatDoctypeName(routeDoctype.value)}`,\n\t\t\tdescription: `Create a new ${routeDoctype.value} record`,\n\t\t\taction: () => void createNewRecord(),\n\t\t})\n\t}\n\n\t// Add available doctypes as commands\n\tavailableDoctypes.forEach(doctype => {\n\t\tcommands.push({\n\t\t\ttitle: `View ${formatDoctypeName(doctype)}`,\n\t\t\tdescription: `Navigate to ${doctype} list`,\n\t\t\taction: () => void router.value?.push(`/${doctype}`),\n\t\t})\n\t})\n\n\t// Filter commands based on query\n\tif (!query) return commands\n\n\treturn commands.filter(\n\t\tcmd =>\n\t\t\tcmd.title.toLowerCase().includes(query.toLowerCase()) ||\n\t\t\tcmd.description.toLowerCase().includes(query.toLowerCase())\n\t)\n}\n\nconst executeCommand = (command: Command) => {\n\tcommand.action()\n\tcommandPaletteOpen.value = false\n}\n\n// Helper functions - moved here to avoid \"before initialization\" errors\nconst formatDoctypeName = (doctype: string): string => {\n\treturn doctype\n\t\t.split('-')\n\t\t.map(word => word.charAt(0).toUpperCase() + word.slice(1))\n\t\t.join(' ')\n}\n\nconst getRecordCount = (doctype: string): number => {\n\tif (!stonecrop.value) return 0\n\tconst recordIds = stonecrop.value.getRecordIds(doctype)\n\treturn recordIds.length\n}\n\nconst navigateToDoctype = async (doctype: string) => {\n\tawait router.value?.push(`/${doctype}`)\n}\n\nconst openRecord = async (recordId: string) => {\n\tawait router.value?.push(`/${routeDoctype.value}/${recordId}`)\n}\n\nconst createNewRecord = async () => {\n\tconst newId = `new-${Date.now()}`\n\tawait router.value?.push(`/${routeDoctype.value}/${newId}`)\n}\n\n// Doctype metadata loader - simplified since router handles most of this\nconst loadDoctypeMetadata = (doctype: string) => {\n\tif (!stonecrop.value) return\n\n\t// Ensure the doctype structure exists in HST\n\t// The router should have already loaded the metadata, but this ensures the HST structure exists\n\ttry {\n\t\tstonecrop.value.records(doctype)\n\t} catch (error) {\n\t\t// Silent error handling - structure will be created if needed\n\t}\n}\n\n// Schema generator functions - moved here to be available to computed properties\nconst getDoctypesSchema = (): SchemaTypes[] => {\n\tif (!availableDoctypes.length) return []\n\n\tconst rows = availableDoctypes.map(doctype => ({\n\t\tid: doctype,\n\t\tdoctype,\n\t\tdisplay_name: formatDoctypeName(doctype),\n\t\trecord_count: getRecordCount(doctype),\n\t\tactions: 'View Records',\n\t}))\n\n\treturn [\n\t\t{\n\t\t\tfieldname: 'header',\n\t\t\tcomponent: 'div',\n\t\t\tvalue: `\n\t\t\t\t<div class=\"view-header\">\n\t\t\t\t\t<h1>Available Doctypes</h1>\n\t\t\t\t</div>\n\t\t\t`,\n\t\t},\n\t\t{\n\t\t\tfieldname: 'doctypes_table',\n\t\t\tcomponent: 'ATable',\n\t\t\tcolumns: [\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Doctype',\n\t\t\t\t\tname: 'doctype',\n\t\t\t\t\tfieldtype: 'Data',\n\t\t\t\t\talign: 'left',\n\t\t\t\t\tedit: false,\n\t\t\t\t\twidth: '20ch',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Name',\n\t\t\t\t\tname: 'display_name',\n\t\t\t\t\tfieldtype: 'Data',\n\t\t\t\t\talign: 'left',\n\t\t\t\t\tedit: false,\n\t\t\t\t\twidth: '30ch',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Records',\n\t\t\t\t\tname: 'record_count',\n\t\t\t\t\tfieldtype: 'Int',\n\t\t\t\t\talign: 'center',\n\t\t\t\t\tedit: false,\n\t\t\t\t\twidth: '15ch',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Actions',\n\t\t\t\t\tname: 'actions',\n\t\t\t\t\tfieldtype: 'Data',\n\t\t\t\t\talign: 'center',\n\t\t\t\t\tedit: false,\n\t\t\t\t\twidth: '20ch',\n\t\t\t\t},\n\t\t\t] as TableColumn[],\n\t\t\tconfig: {\n\t\t\t\tview: 'list',\n\t\t\t\tfullWidth: true,\n\t\t\t} as TableConfig,\n\t\t\trows,\n\t\t},\n\t]\n}\n\nconst getRecordsSchema = (): SchemaTypes[] => {\n\tif (!currentDoctype.value) return []\n\tif (!stonecrop.value) return []\n\n\tconst records = getRecords()\n\tconst columns = getColumns()\n\n\t// If no columns are available, show a loading or empty state\n\tif (columns.length === 0) {\n\t\treturn [\n\t\t\t{\n\t\t\t\tfieldname: 'header',\n\t\t\t\tcomponent: 'div',\n\t\t\t\tvalue: `\n\t\t\t\t\t<div class=\"view-header\">\n\t\t\t\t\t\t<nav class=\"breadcrumbs\">\n\t\t\t\t\t\t\t<a href=\"/\">Home</a>\n\t\t\t\t\t\t\t<span class=\"separator\">/</span>\n\t\t\t\t\t\t\t<span class=\"current\">${formatDoctypeName(routeDoctype.value || currentDoctype.value)}</span>\n\t\t\t\t\t\t</nav>\n\t\t\t\t\t\t<h1>${formatDoctypeName(routeDoctype.value || currentDoctype.value)} Records</h1>\n\t\t\t\t\t</div>\n\t\t\t\t`,\n\t\t\t},\n\t\t\t{\n\t\t\t\tfieldname: 'loading',\n\t\t\t\tcomponent: 'div',\n\t\t\t\tvalue: `\n\t\t\t\t\t<div class=\"loading-state\">\n\t\t\t\t\t\t<p>Loading ${formatDoctypeName(routeDoctype.value || currentDoctype.value)} schema...</p>\n\t\t\t\t\t</div>\n\t\t\t\t`,\n\t\t\t},\n\t\t]\n\t}\n\n\tconst rows = records.map((record: any) => ({\n\t\t...record,\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\t\tid: record.id || '',\n\t\tactions: 'Edit | Delete',\n\t}))\n\n\treturn [\n\t\t{\n\t\t\tfieldname: 'header',\n\t\t\tcomponent: 'div',\n\t\t\tvalue: `\n\t\t\t\t<div class=\"view-header\">\n\t\t\t\t\t<nav class=\"breadcrumbs\">\n\t\t\t\t\t\t<a href=\"/\">Home</a>\n\t\t\t\t\t\t<span class=\"separator\">/</span>\n\t\t\t\t\t\t<span class=\"current\">${formatDoctypeName(routeDoctype.value || currentDoctype.value)}</span>\n\t\t\t\t\t</nav>\n\t\t\t\t\t<h1>${formatDoctypeName(routeDoctype.value || currentDoctype.value)} Records</h1>\n\t\t\t\t</div>\n\t\t\t`,\n\t\t},\n\t\t{\n\t\t\tfieldname: 'actions',\n\t\t\tcomponent: 'div',\n\t\t\tvalue: `\n\t\t\t\t<div class=\"view-actions\">\n\t\t\t\t\t<button class=\"btn-primary\" data-action=\"create\">\n\t\t\t\t\t\tNew ${formatDoctypeName(routeDoctype.value || currentDoctype.value)}\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t`,\n\t\t},\n\t\t...(records.length === 0\n\t\t\t? [\n\t\t\t\t\t{\n\t\t\t\t\t\tfieldname: 'empty_state',\n\t\t\t\t\t\tcomponent: 'div',\n\t\t\t\t\t\tvalue: `\n\t\t\t\t\t\t\t<div class=\"empty-state\">\n\t\t\t\t\t\t\t\t<p>No ${routeDoctype.value || currentDoctype.value} records found.</p>\n\t\t\t\t\t\t\t\t<button class=\"btn-primary\" data-action=\"create\">\n\t\t\t\t\t\t\t\t\tCreate First Record\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t`,\n\t\t\t\t\t},\n\t\t\t ]\n\t\t\t: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfieldname: 'records_table',\n\t\t\t\t\t\tcomponent: 'ATable',\n\t\t\t\t\t\tcolumns: [\n\t\t\t\t\t\t\t...columns.map(col => ({\n\t\t\t\t\t\t\t\tlabel: col.label,\n\t\t\t\t\t\t\t\tname: col.fieldname,\n\t\t\t\t\t\t\t\tfieldtype: col.fieldtype,\n\t\t\t\t\t\t\t\talign: 'left',\n\t\t\t\t\t\t\t\tedit: false,\n\t\t\t\t\t\t\t\twidth: '20ch',\n\t\t\t\t\t\t\t})),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: 'Actions',\n\t\t\t\t\t\t\t\tname: 'actions',\n\t\t\t\t\t\t\t\tfieldtype: 'Data',\n\t\t\t\t\t\t\t\talign: 'center',\n\t\t\t\t\t\t\t\tedit: false,\n\t\t\t\t\t\t\t\twidth: '20ch',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t] as TableColumn[],\n\t\t\t\t\t\tconfig: {\n\t\t\t\t\t\t\tview: 'list',\n\t\t\t\t\t\t\tfullWidth: true,\n\t\t\t\t\t\t} as TableConfig,\n\t\t\t\t\t\trows,\n\t\t\t\t\t},\n\t\t\t ]),\n\t]\n}\n\nconst getRecordFormSchema = (): SchemaTypes[] => {\n\tif (!currentDoctype.value) return []\n\tif (!stonecrop.value) return []\n\n\ttry {\n\t\tconst registry = stonecrop.value?.registry\n\t\tconst meta = registry?.registry[currentDoctype.value]\n\n\t\tif (!meta?.schema) {\n\t\t\t// Return loading state if schema isn't available yet\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tfieldname: 'header',\n\t\t\t\t\tcomponent: 'div',\n\t\t\t\t\tvalue: `\n\t\t\t\t\t\t<div class=\"view-header\">\n\t\t\t\t\t\t\t<nav class=\"breadcrumbs\">\n\t\t\t\t\t\t\t\t<a href=\"/\">Home</a>\n\t\t\t\t\t\t\t\t<span class=\"separator\">/</span>\n\t\t\t\t\t\t\t\t<a href=\"/${routeDoctype.value || currentDoctype.value}\">${formatDoctypeName(\n\t\t\t\t\t\trouteDoctype.value || currentDoctype.value\n\t\t\t\t\t)}</a>\n\t\t\t\t\t\t\t\t<span class=\"separator\">/</span>\n\t\t\t\t\t\t\t\t<span class=\"current\">${isNewRecord.value ? 'New Record' : currentRecordId.value}</span>\n\t\t\t\t\t\t\t</nav>\n\t\t\t\t\t\t\t<h1>${\n\t\t\t\t\t\t\t\tisNewRecord.value\n\t\t\t\t\t\t\t\t\t? `New ${formatDoctypeName(routeDoctype.value || currentDoctype.value)}`\n\t\t\t\t\t\t\t\t\t: `Edit ${formatDoctypeName(routeDoctype.value || currentDoctype.value)}`\n\t\t\t\t\t\t\t}</h1>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t`,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tfieldname: 'loading',\n\t\t\t\t\tcomponent: 'div',\n\t\t\t\t\tvalue: `\n\t\t\t\t\t\t<div class=\"loading-state\">\n\t\t\t\t\t\t\t<p>Loading ${formatDoctypeName(routeDoctype.value || currentDoctype.value)} form...</p>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t`,\n\t\t\t\t},\n\t\t\t]\n\t\t}\n\n\t\tconst schemaArray = 'toArray' in meta.schema ? meta.schema.toArray() : meta.schema\n\t\tconst currentRecord = getCurrentRecord()\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tfieldname: 'header',\n\t\t\t\tcomponent: 'div',\n\t\t\t\tvalue: `\n\t\t\t\t\t<div class=\"view-header\">\n\t\t\t\t\t\t<nav class=\"breadcrumbs\">\n\t\t\t\t\t\t\t<a href=\"/\">Home</a>\n\t\t\t\t\t\t\t<span class=\"separator\">/</span>\n\t\t\t\t\t\t\t<a href=\"/${routeDoctype.value || currentDoctype.value}\">${formatDoctypeName(\n\t\t\t\t\trouteDoctype.value || currentDoctype.value\n\t\t\t\t)}</a>\n\t\t\t\t\t\t\t<span class=\"separator\">/</span>\n\t\t\t\t\t\t\t<span class=\"current\">${isNewRecord.value ? 'New Record' : currentRecordId.value}</span>\n\t\t\t\t\t\t</nav>\n\t\t\t\t\t\t<h1>\n\t\t\t\t\t\t\t${\n\t\t\t\t\t\t\t\tisNewRecord.value\n\t\t\t\t\t\t\t\t\t? `New ${formatDoctypeName(routeDoctype.value || currentDoctype.value)}`\n\t\t\t\t\t\t\t\t\t: `Edit ${formatDoctypeName(routeDoctype.value || currentDoctype.value)}`\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</h1>\n\t\t\t\t\t</div>\n\t\t\t\t`,\n\t\t\t},\n\t\t\t{\n\t\t\t\tfieldname: 'actions',\n\t\t\t\tcomponent: 'div',\n\t\t\t\tvalue: `\n\t\t\t\t\t<div class=\"view-actions\">\n\t\t\t\t\t\t<button class=\"btn-primary\" data-action=\"save\" ${saving.value ? 'disabled' : ''}>\n\t\t\t\t\t\t\t${saving.value ? 'Saving...' : 'Save'}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<button class=\"btn-secondary\" data-action=\"cancel\">Cancel</button>\n\t\t\t\t\t\t${!isNewRecord.value ? '<button class=\"btn-danger\" data-action=\"delete\">Delete</button>' : ''}\n\t\t\t\t\t</div>\n\t\t\t\t`,\n\t\t\t},\n\t\t\t...schemaArray.map(field => ({\n\t\t\t\t...field,\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\t\t\t\tvalue: currentRecord[field.fieldname] || '',\n\t\t\t})),\n\t\t]\n\t} catch (error) {\n\t\treturn [\n\t\t\t{\n\t\t\t\tfieldname: 'error',\n\t\t\t\tcomponent: 'div',\n\t\t\t\tvalue: `\n\t\t\t\t\t<div class=\"error-state\">\n\t\t\t\t\t\t<p>Unable to load form schema for ${formatDoctypeName(routeDoctype.value || currentDoctype.value)}</p>\n\t\t\t\t\t</div>\n\t\t\t\t`,\n\t\t\t},\n\t\t]\n\t}\n}\n\n// Additional data helper functions\nconst getRecords = () => {\n\tif (!stonecrop.value || !currentDoctype.value) {\n\t\treturn []\n\t}\n\n\tconst recordsNode = stonecrop.value.records(currentDoctype.value)\n\tconst recordsData = recordsNode?.get('')\n\n\tif (recordsData && typeof recordsData === 'object' && !Array.isArray(recordsData)) {\n\t\treturn Object.values(recordsData as Record<string, any>)\n\t}\n\n\treturn []\n}\n\nconst getColumns = () => {\n\tif (!stonecrop.value || !currentDoctype.value) return []\n\n\ttry {\n\t\tconst registry = stonecrop.value.registry\n\t\tconst meta = registry.registry[currentDoctype.value]\n\n\t\tif (meta?.schema) {\n\t\t\tconst schemaArray = 'toArray' in meta.schema ? meta.schema.toArray() : meta.schema\n\t\t\treturn schemaArray.map(field => ({\n\t\t\t\tfieldname: field.fieldname,\n\t\t\t\tlabel: ('label' in field && field.label) || field.fieldname,\n\t\t\t\tfieldtype: ('fieldtype' in field && field.fieldtype) || 'Data',\n\t\t\t}))\n\t\t}\n\t} catch (error) {\n\t\t// Error getting schema - return empty array\n\t}\n\n\treturn []\n}\n\nconst getCurrentRecord = () => {\n\tif (!stonecrop.value || !currentDoctype.value || isNewRecord.value) return {}\n\n\tconst record = stonecrop.value.getRecordById(currentDoctype.value, currentRecordId.value)\n\treturn record?.get('') || {}\n}\n\n// Schema for different views - defined here after all helper functions are available\nconst currentViewSchema = computed<SchemaTypes[]>(() => {\n\tswitch (currentView.value) {\n\t\tcase 'doctypes':\n\t\t\treturn getDoctypesSchema()\n\t\tcase 'records':\n\t\t\treturn getRecordsSchema()\n\t\tcase 'record':\n\t\t\treturn getRecordFormSchema()\n\t\tdefault:\n\t\t\treturn []\n\t}\n})\n\n// Writable schema for AForm v-model binding\nconst writableSchema = ref<SchemaTypes[]>([])\n\n// Sync computed schema to writable schema when it changes\nwatch(\n\tcurrentViewSchema,\n\tnewSchema => {\n\t\twritableSchema.value = [...newSchema]\n\t},\n\t{ immediate: true, deep: true }\n)\n\n// Watch for field changes in writable schema and sync to HST\nwatch(\n\twritableSchema,\n\tnewSchema => {\n\t\tif (!stonecrop.value || !currentDoctype.value || !currentRecordId.value || isNewRecord.value) {\n\t\t\treturn\n\t\t}\n\n\t\ttry {\n\t\t\tconst hstStore = stonecrop.value.getStore()\n\n\t\t\t// Process form field updates from schema\n\t\t\tnewSchema.forEach(field => {\n\t\t\t\t// Only process fields that have a fieldname and value (form fields)\n\t\t\t\tif (\n\t\t\t\t\tfield.fieldname &&\n\t\t\t\t\t'value' in field &&\n\t\t\t\t\t!['header', 'actions', 'loading', 'error'].includes(field.fieldname)\n\t\t\t\t) {\n\t\t\t\t\tconst fieldPath = `${currentDoctype.value}.${currentRecordId.value}.${field.fieldname}`\n\t\t\t\t\tconst currentValue = hstStore.has(fieldPath) ? hstStore.get(fieldPath) : undefined\n\n\t\t\t\t\t// Only update if value actually changed to avoid infinite loops\n\t\t\t\t\tif (currentValue !== field.value) {\n\t\t\t\t\t\thstStore.set(fieldPath, field.value)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t} catch (error) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn('HST schema sync failed:', error)\n\t\t}\n\t},\n\t{ deep: true }\n)\n\n// Action handlers (will be triggered by button clicks in the UI)\nconst handleSave = async () => {\n\t// eslint-disable-next-line no-console\n\tif (!stonecrop.value) return\n\n\tsaving.value = true\n\n\ttry {\n\t\tconst formData = currentViewData.value || {}\n\n\t\tif (isNewRecord.value) {\n\t\t\tconst newId = `record-${Date.now()}`\n\t\t\tconst recordData = { id: newId, ...formData }\n\n\t\t\tstonecrop.value.addRecord(currentDoctype.value, newId, recordData)\n\n\t\t\t// Trigger SAVE transition for new record\n\t\t\tconst node = stonecrop.value.getRecordById(currentDoctype.value, newId)\n\t\t\tif (node) {\n\t\t\t\tawait node.triggerTransition('SAVE', {\n\t\t\t\t\tcurrentState: 'creating',\n\t\t\t\t\ttargetState: 'saved',\n\t\t\t\t\tfsmContext: recordData,\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tawait router.value?.replace(`/${routeDoctype.value}/${newId}`)\n\t\t} else {\n\t\t\tconst recordData = { id: currentRecordId.value, ...formData }\n\t\t\tstonecrop.value.addRecord(currentDoctype.value, currentRecordId.value, recordData)\n\n\t\t\t// Trigger SAVE transition for existing record\n\t\t\tconst node = stonecrop.value.getRecordById(currentDoctype.value, currentRecordId.value)\n\t\t\tif (node) {\n\t\t\t\tawait node.triggerTransition('SAVE', {\n\t\t\t\t\tcurrentState: 'editing',\n\t\t\t\t\ttargetState: 'saved',\n\t\t\t\t\tfsmContext: recordData,\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t} catch (error) {\n\t\t// Silently handle error\n\t} finally {\n\t\tsaving.value = false\n\t}\n}\n\nconst handleCancel = async () => {\n\tif (isNewRecord.value) {\n\t\t// For new records, we don't have a specific record node yet\n\t\t// Just navigate back without triggering transition\n\t\tawait router.value?.push(`/${routeDoctype.value}`)\n\t} else {\n\t\t// Trigger CANCEL transition for existing record\n\t\tif (stonecrop.value) {\n\t\t\tconst node = stonecrop.value.getRecordById(currentDoctype.value, currentRecordId.value)\n\t\t\tif (node) {\n\t\t\t\tawait node.triggerTransition('CANCEL', {\n\t\t\t\t\tcurrentState: 'editing',\n\t\t\t\t\ttargetState: 'cancelled',\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\t// Reload current record data\n\t\tloadRecordData()\n\t}\n}\n\nconst handleActionClick = (label: string, action: (() => void | Promise<void>) | undefined) => {\n\t// eslint-disable-next-line no-console\n\tif (action) {\n\t\tvoid action()\n\t}\n}\n\nconst handleDelete = async (recordId?: string) => {\n\tif (!stonecrop.value) return\n\n\tconst targetRecordId = recordId || currentRecordId.value\n\tif (!targetRecordId) return\n\n\tif (confirm('Are you sure you want to delete this record?')) {\n\t\t// Trigger DELETE transition before removing\n\t\tconst node = stonecrop.value.getRecordById(currentDoctype.value, targetRecordId)\n\t\tif (node) {\n\t\t\tawait node.triggerTransition('DELETE', {\n\t\t\t\tcurrentState: 'editing',\n\t\t\t\ttargetState: 'deleted',\n\t\t\t})\n\t\t}\n\n\t\tstonecrop.value.removeRecord(currentDoctype.value, targetRecordId)\n\n\t\tif (currentView.value === 'record') {\n\t\t\tawait router.value?.push(`/${routeDoctype.value}`)\n\t\t}\n\t}\n}\n\n// Event handlers\nconst handleClick = async (event: Event) => {\n\tconst target = event.target as HTMLElement\n\tconst action = target.getAttribute('data-action')\n\n\tif (action) {\n\t\tswitch (action) {\n\t\t\tcase 'create':\n\t\t\t\tawait createNewRecord()\n\t\t\t\tbreak\n\t\t\tcase 'save':\n\t\t\t\tawait handleSave()\n\t\t\t\tbreak\n\t\t\tcase 'cancel':\n\t\t\t\tawait handleCancel()\n\t\t\t\tbreak\n\t\t\tcase 'delete':\n\t\t\t\tawait handleDelete()\n\t\t\t\tbreak\n\t\t}\n\t}\n\n\t// Handle table cell clicks for actions\n\tconst cell = target.closest('td, th')\n\tif (cell) {\n\t\tconst cellText = cell.textContent?.trim()\n\t\tconst row = cell.closest('tr')\n\n\t\tif (cellText === 'View Records' && row) {\n\t\t\t// Get the doctype from the row data\n\t\t\tconst cells = row.querySelectorAll('td')\n\t\t\tif (cells.length > 0) {\n\t\t\t\tconst doctypeCell = cells[1] // Assuming doctype is in second column (first column is index)\n\t\t\t\tconst doctype = doctypeCell.textContent?.trim()\n\t\t\t\tif (doctype) {\n\t\t\t\t\tawait navigateToDoctype(doctype)\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (cellText?.includes('Edit') && row) {\n\t\t\t// Get the record ID from the row\n\t\t\tconst cells = row.querySelectorAll('td')\n\t\t\tif (cells.length > 0) {\n\t\t\t\tconst idCell = cells[0] // Assuming ID is in first column\n\t\t\t\tconst recordId = idCell.textContent?.trim()\n\t\t\t\tif (recordId) {\n\t\t\t\t\tawait openRecord(recordId)\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (cellText?.includes('Delete') && row) {\n\t\t\t// Get the record ID from the row\n\t\t\tconst cells = row.querySelectorAll('td')\n\t\t\tif (cells.length > 0) {\n\t\t\t\tconst idCell = cells[0] // Assuming ID is in first column\n\t\t\t\tconst recordId = idCell.textContent?.trim()\n\t\t\t\tif (recordId) {\n\t\t\t\t\tawait handleDelete(recordId)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n// Watch for route changes to load appropriate data\nwatch(\n\t[currentView, currentDoctype, currentRecordId],\n\t() => {\n\t\tif (currentView.value === 'record') {\n\t\t\tloadRecordData()\n\t\t}\n\t},\n\t{ immediate: true }\n)\n\n// Watch for Stonecrop instance to become available\nwatch(\n\tstonecrop,\n\tnewStonecrop => {\n\t\tif (newStonecrop) {\n\t\t\t// Force a re-evaluation of the current view schema when Stonecrop becomes available\n\t\t\t// This is handled automatically by the reactive computed properties\n\t\t}\n\t},\n\t{ immediate: true }\n)\n\n// Watch for when we need to load data for records view\nwatch(\n\t[currentView, currentDoctype, stonecrop],\n\t([view, doctype, stonecropInstance]) => {\n\t\tif (view === 'records' && doctype && stonecropInstance) {\n\t\t\t// Ensure doctype metadata is loaded\n\t\t\tloadDoctypeMetadata(doctype)\n\t\t}\n\t},\n\t{ immediate: true }\n)\n\nconst loadRecordData = () => {\n\tif (!stonecrop.value || !currentDoctype.value) return\n\n\tloading.value = true\n\n\ttry {\n\t\tif (!isNewRecord.value) {\n\t\t\t// For existing records, ensure the record exists in HST\n\t\t\t// The computed currentViewData will automatically read from HST\n\t\t\tstonecrop.value.getRecordById(currentDoctype.value, currentRecordId.value)\n\t\t}\n\t\t// For new records, currentViewData computed property will return {} automatically\n\t} catch (error) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn('Error loading record data:', error)\n\t} finally {\n\t\tloading.value = false\n\t}\n}\n\n// Provide methods for action components\nconst desktopMethods = {\n\tnavigateToDoctype,\n\topenRecord,\n\tcreateNewRecord,\n\thandleSave,\n\thandleCancel,\n\thandleDelete,\n}\n\nprovide('desktopMethods', desktopMethods)\n\n// Register action components in Vue app\nonMounted(() => {\n\t// Wait a tick for stonecrop to be ready, then load initial data\n\tvoid nextTick(() => {\n\t\tif (currentView.value === 'records' && currentDoctype.value && stonecrop.value) {\n\t\t\tloadDoctypeMetadata(currentDoctype.value)\n\t\t}\n\t})\n\n\t// Components will be automatically registered via the global component system\n\n\t// Add keyboard shortcuts\n\tconst handleKeydown = (event: KeyboardEvent) => {\n\t\t// Ctrl+K or Cmd+K to open command palette\n\t\tif ((event.ctrlKey || event.metaKey) && event.key === 'k') {\n\t\t\tevent.preventDefault()\n\t\t\tcommandPaletteOpen.value = true\n\t\t}\n\t\t// Escape to close command palette\n\t\tif (event.key === 'Escape' && commandPaletteOpen.value) {\n\t\t\tcommandPaletteOpen.value = false\n\t\t}\n\t}\n\n\tdocument.addEventListener('keydown', handleKeydown)\n\n\t// Cleanup event listener on unmount\n\treturn () => {\n\t\tdocument.removeEventListener('keydown', handleKeydown)\n\t}\n})\n</script>\n","import { App, type Plugin } from 'vue'\n\nimport ActionSet from '../components/ActionSet.vue'\nimport CommandPalette from '../components/CommandPalette.vue'\nimport Desktop from '../components/Desktop.vue'\nimport SheetNav from '../components/SheetNav.vue'\n\n/**\n * This is the main plugin that will be used to register all the desktop components.\n * @public\n */\nconst plugin: Plugin = {\n\tinstall: (app: App) => {\n\t\tapp.component('ActionSet', ActionSet)\n\t\tapp.component('CommandPalette', CommandPalette)\n\t\tapp.component('Desktop', Desktop)\n\t\tapp.component('SheetNav', SheetNav)\n\t},\n}\n\nexport default plugin\n"],"names":["emit","__emit","dropdownStates","ref","isOpen","timeoutId","hover","closeClicked","onMounted","closeDropdowns","onHover","onHoverLeave","toggleDropdown","index","showDropdown","handleClick","action","label","_createElementBlock","_normalizeClass","_createElementVNode","_hoisted_1","_cache","$event","_openBlock","_Fragment","_renderList","__props","el","_toDisplayString","_hoisted_2","_hoisted_3","_hoisted_4","_withDirectives","_hoisted_5","_hoisted_6","item","itemIndex","_hoisted_7","_hoisted_9","_vShow","query","selectedIndex","inputRef","useTemplateRef","results","computed","watch","nextTick","closeModal","handleKeydown","e","selectResult","result","_createBlock","_Teleport","_createVNode","_Transition","_renderSlot","_ctx","Q","K","ge","n","Oe","G","ie","Be","t","r","o","re","ye","je","Ae","Ke","Ze","Y","Qe","me","Re","Xe","et","W","Ie","De","s","i","a","c","h","g","Pe","M","w","R","oe","B","$","Ne","l","v","T","L","P","I","u","O","le","N","m","S","D","f","b","A","k","C","j","E","_","H","Ee","V","Je","se","Le","tt","we","te","Fe","We","rt","nt","ot","Ue","st","Me","Ge","it","ze","at","be","ct","lt","ut","ft","dt","Ve","pt","Z","ht","q","X","Ye","fe","de","gt","vt","yt","mt","bt","Te","St","xe","x","wt","Se","pe","Rt","ue","d","p","y","F","U","z","ae","J","Ce","ee","ve","Nt","He","Vt","he","ke","Pt","_e","ne","Zt","en","breadcrumbsVisibile","searchVisible","searchText","rotateHideTabIcon","toggleBreadcrumbs","toggleSearch","handleSearchInput","event","handleSearch","navigateHome","_component_router_link","_withKeys","breadcrumb","_createTextVNode","stonecrop","useStonecrop","loading","saving","commandPaletteOpen","currentViewData","currentDoctype","currentRecordId","newData","hstStore","fieldname","value","fieldPath","error","route","unref","router","pathMatch","routeDoctype","isNewRecord","currentView","routeName","getAvailableTransitions","meta","currentState","stateConfig","transition","targetState","targetStateName","actionFn","node","recordData","actionElements","elements","createNewRecord","transitionActions","navigationBreadcrumbs","breadcrumbs","formatDoctypeName","searchCommands","commands","doctype","cmd","executeCommand","command","word","getRecordCount","navigateToDoctype","openRecord","recordId","newId","loadDoctypeMetadata","getDoctypesSchema","rows","getRecordsSchema","records","getRecords","columns","getColumns","record","col","getRecordFormSchema","schemaArray","currentRecord","getCurrentRecord","field","recordsData","currentViewSchema","writableSchema","newSchema","handleSave","formData","handleCancel","loadRecordData","handleActionClick","handleDelete","targetRecordId","target","cell","cellText","row","cells","newStonecrop","view","stonecropInstance","desktopMethods","provide","ActionSet","_unref","AForm","SheetNav","CommandPalette","_withCtx","plugin","app","Desktop"],"mappings":"kkBAyEA,MAAMA,EAAOC,EAKPC,EAAiBC,EAAAA,IAA6B,EAAE,EAEhDC,EAASD,EAAAA,IAAI,EAAK,EAClBE,EAAYF,EAAAA,IAAY,EAAE,EAC1BG,EAAQH,EAAAA,IAAI,EAAK,EACjBI,EAAeJ,EAAAA,IAAI,EAAK,EAE9BK,EAAAA,UAAU,IAAM,CACfC,EAAA,CACD,CAAC,EAED,MAAMA,EAAiB,IAAM,CAC5BP,EAAe,MAAQ,CAAA,CACxB,EAEMQ,EAAU,IAAM,CACrBJ,EAAM,MAAQ,GACdD,EAAU,MAAQ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