reddokia 0.0.0-stage → 1.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +193 -2
- package/dist/core/RedDokiaEngine.d.ts +20 -0
- package/dist/core/RedDokiaEngine.d.ts.map +1 -0
- package/dist/core/RedDokiaStore.d.ts +115 -0
- package/dist/core/RedDokiaStore.d.ts.map +1 -0
- package/dist/core/dom/DockOverlaysDom.d.ts +13 -0
- package/dist/core/dom/DockOverlaysDom.d.ts.map +1 -0
- package/dist/core/dom/EdgeBarDom.d.ts +12 -0
- package/dist/core/dom/EdgeBarDom.d.ts.map +1 -0
- package/dist/core/dom/FloatingLayerDom.d.ts +14 -0
- package/dist/core/dom/FloatingLayerDom.d.ts.map +1 -0
- package/dist/core/dom/GridGroupDom.d.ts +25 -0
- package/dist/core/dom/GridGroupDom.d.ts.map +1 -0
- package/dist/core/dom/PopoutWindowDom.d.ts +16 -0
- package/dist/core/dom/PopoutWindowDom.d.ts.map +1 -0
- package/dist/core/dom/SashLayerDom.d.ts +11 -0
- package/dist/core/dom/SashLayerDom.d.ts.map +1 -0
- package/dist/core/dom/StatusBarDom.d.ts +12 -0
- package/dist/core/dom/StatusBarDom.d.ts.map +1 -0
- package/dist/core/dom/TabContextMenuDom.d.ts +47 -0
- package/dist/core/dom/TabContextMenuDom.d.ts.map +1 -0
- package/dist/core/dom/TopBarDom.d.ts +16 -0
- package/dist/core/dom/TopBarDom.d.ts.map +1 -0
- package/dist/core/dom/domUtils.d.ts +69 -0
- package/dist/core/dom/domUtils.d.ts.map +1 -0
- package/dist/core/geometrySolver.d.ts +25 -0
- package/dist/core/geometrySolver.d.ts.map +1 -0
- package/dist/core/hitTester.d.ts +26 -0
- package/dist/core/hitTester.d.ts.map +1 -0
- package/dist/core/icons/svgRegistry.d.ts +83 -0
- package/dist/core/icons/svgRegistry.d.ts.map +1 -0
- package/dist/core/interactions/DockDragManager.d.ts +43 -0
- package/dist/core/interactions/DockDragManager.d.ts.map +1 -0
- package/dist/core/interactions/FloatingWindowManager.d.ts +14 -0
- package/dist/core/interactions/FloatingWindowManager.d.ts.map +1 -0
- package/dist/core/interactions/SashResizeManager.d.ts +14 -0
- package/dist/core/interactions/SashResizeManager.d.ts.map +1 -0
- package/dist/core/interactions/floatingUtils.d.ts +28 -0
- package/dist/core/interactions/floatingUtils.d.ts.map +1 -0
- package/dist/core/locales/index.d.ts +11 -0
- package/dist/core/locales/index.d.ts.map +1 -0
- package/dist/core/publicApi.d.ts +8 -0
- package/dist/core/publicApi.d.ts.map +1 -0
- package/dist/core/sashResizeSolver.d.ts +47 -0
- package/dist/core/sashResizeSolver.d.ts.map +1 -0
- package/dist/core/snapshotSerializer.d.ts +60 -0
- package/dist/core/snapshotSerializer.d.ts.map +1 -0
- package/dist/core/styles/ensureRedDokiaStyles.d.ts +25 -0
- package/dist/core/styles/ensureRedDokiaStyles.d.ts.map +1 -0
- package/dist/core/tabScrollErgonomics.d.ts +18 -0
- package/dist/core/tabScrollErgonomics.d.ts.map +1 -0
- package/dist/core/themes/index.d.ts +6 -0
- package/dist/core/themes/index.d.ts.map +1 -0
- package/dist/core/treeOps.d.ts +259 -0
- package/dist/core/treeOps.d.ts.map +1 -0
- package/dist/core/types/index.d.ts +1379 -0
- package/dist/core/types/index.d.ts.map +1 -0
- package/dist/favicon.svg +18 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/logo-dark.svg +13 -0
- package/dist/logo-light.svg +13 -0
- package/dist/react/RedDokiaReact.d.ts +11 -0
- package/dist/react/RedDokiaReact.d.ts.map +1 -0
- package/dist/react/ViewIcon.d.ts +13 -0
- package/dist/react/ViewIcon.d.ts.map +1 -0
- package/dist/react/index.d.ts +10 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react.js +1 -0
- package/dist/reddokia.js +1 -0
- package/dist/style.css +2 -0
- package/dist/svelte/RedDokiaSvelte.d.ts +33 -0
- package/dist/svelte/RedDokiaSvelte.d.ts.map +1 -0
- package/dist/svelte/index.d.ts +9 -0
- package/dist/svelte/index.d.ts.map +1 -0
- package/dist/svelte.js +1 -0
- package/dist/vue/RedDokiaVue.d.ts +25 -0
- package/dist/vue/RedDokiaVue.d.ts.map +1 -0
- package/dist/vue/index.d.ts +9 -0
- package/dist/vue/index.d.ts.map +1 -0
- package/dist/vue.js +1 -0
- package/package.json +101 -4
package/dist/vue.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Teleport as e,defineComponent as t,h as n,onBeforeUnmount as r,onMounted as i,ref as a,shallowRef as o,watch as s}from"vue";var c=`.reddokia-root,[data-reddokia-theme=dark]{--rd-font-sans:"Pretendard Variable", Pretendard, "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;--rd-font-mono:"JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;--rd-font-size-tab:12.5px;--rd-font-size-ui:13px;--rd-font-size-content:14px;--rd-font-size-badge:11px;--rd-topbar-height:40px;--rd-edgebar-width:42px;--rd-tabbar-height:40px;--rd-statusbar-height:28px;--rd-shell-bg:#0f1014;--rd-topbar-bg:#181a20;--rd-edgebar-bg:#181a20;--rd-group-header-bg:#20232b;--rd-contents-bg:#13151a;--rd-panel-bg:#1c1e24;--rd-border:#2b2f3a;--rd-accent:#3574f0;--rd-accent-secondary:#06b6d4;--rd-text-main:#d4d7df;--rd-text-muted:#848a96;--rd-tab-active-bg:#13151a;--rd-island-radius:10px;--rd-warning:#fbbf24;--rd-danger:#fb7185;--rd-danger-bg:#f43f5e29;--rd-text-on-accent:#fff;--rd-text-on-accent-secondary:#041316;--rd-sash-grip:#ffffffc7;--rd-shadow-group:0 4px 14px #0000003d;--rd-shadow-floating:0 24px 52px #00000094, 0 0 0 1px color-mix(in srgb, var(--rd-accent-secondary) 32%, transparent);--rd-shadow-floating-active:0 28px 60px #000000a8, 0 0 0 1.5px color-mix(in srgb, var(--rd-accent-secondary) 68%, transparent);--rd-shadow-popover:0 18px 38px #0000007a, 0 4px 12px #00000047}[data-reddokia-theme=light],[data-reddokia-base-theme=light]{--rd-shell-bg:#ebecf0;--rd-topbar-bg:#f7f8fa;--rd-edgebar-bg:#f7f8fa;--rd-group-header-bg:#f7f8fa;--rd-contents-bg:#fff;--rd-panel-bg:#f7f8fa;--rd-border:#dfe1e5;--rd-accent:#3574f0;--rd-accent-secondary:#0891b2;--rd-text-main:#1e1f22;--rd-text-muted:#6c707e;--rd-tab-active-bg:#fff;--rd-island-radius:10px;--rd-warning:#d97706;--rd-danger:#e11d48;--rd-danger-bg:#e11d481a;--rd-text-on-accent:#fff;--rd-text-on-accent-secondary:#fff;--rd-sash-grip:#ffffffeb;--rd-shadow-group:0 2px 8px #0f172a0f, 0 1px 2px #0f172a0a;--rd-shadow-floating:0 20px 44px #0f172a33, 0 0 0 1px color-mix(in srgb, var(--rd-accent-secondary) 38%, transparent);--rd-shadow-floating-active:0 24px 52px #0f172a42, 0 0 0 1.5px color-mix(in srgb, var(--rd-accent-secondary) 72%, transparent);--rd-shadow-popover:0 14px 32px #0f172a29, 0 2px 8px #0f172a14}.reddokia-root{background-color:var(--rd-shell-bg);width:100%;height:100%;color:var(--rd-text-main);font-family:var(--rd-font-sans);font-size:var(--rd-font-size-ui,13px);letter-spacing:-.011em;box-sizing:border-box;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;flex-direction:column;line-height:1.5;display:flex;position:relative;overflow:hidden}.reddokia-root *,.reddokia-root :before,.reddokia-root :after{box-sizing:border-box}:where(.reddokia-root>header button,.reddokia-root>footer button,.reddokia-root .rd-main-area>aside button,.reddokia-root .rd-group-header button,.reddokia-root .rd-floating-header button,.reddokia-root .rd-popout__header button,.reddokia-root .rd-context-menu button){color:inherit;border-style:solid;border-width:0;border-color:var(--rd-border);background-color:#0000;margin:0;padding:0;font-family:inherit}.reddokia-root code,.reddokia-root pre,.reddokia-root kbd,.reddokia-root samp{font-family:var(--rd-font-mono);letter-spacing:-.01em}.reddokia-root button:not(:disabled),.reddokia-root [role=button]:not(:disabled),.reddokia-root [role=tab],.reddokia-root select:not(:disabled),.reddokia-root summary,.reddokia-root a[href],.reddokia-root input[type=range]:not(:disabled),.reddokia-root input[type=color]:not(:disabled),.reddokia-root input[type=checkbox]:not(:disabled),.reddokia-root input[type=radio]:not(:disabled){cursor:pointer}.reddokia-root button:disabled,.reddokia-root [role=button]:disabled,.reddokia-root select:disabled,.reddokia-root input:disabled{cursor:not-allowed}.reddokia-root button:focus-visible,.reddokia-root [role=tab]:focus-visible{outline:2px solid var(--rd-accent-secondary);outline-offset:-2px}:where(.reddokia-root *):not(.rd-tab-list){scrollbar-width:thin;scrollbar-color:color-mix(in srgb, var(--rd-border) 85%, transparent) transparent}.reddokia-root ::-webkit-scrollbar{width:6px;height:6px}.reddokia-root ::-webkit-scrollbar-track{background:0 0}.reddokia-root ::-webkit-scrollbar-thumb{background-color:color-mix(in srgb, var(--rd-border) 85%, transparent);border-radius:999px}.reddokia-root ::-webkit-scrollbar-thumb:hover{background-color:var(--rd-text-muted)}.rd-tab-list[data-can-scroll-left=true]:not([data-can-scroll-right=true]){-webkit-mask-image:linear-gradient(90deg,#0000 0,#000 20px 100%);mask-image:linear-gradient(90deg,#0000 0,#000 20px 100%)}.rd-tab-list[data-can-scroll-right=true]:not([data-can-scroll-left=true]){-webkit-mask-image:linear-gradient(90deg,#000 0 calc(100% - 20px),#0000 100%);mask-image:linear-gradient(90deg,#000 0 calc(100% - 20px),#0000 100%)}.rd-tab-list[data-can-scroll-left=true][data-can-scroll-right=true]{-webkit-mask-image:linear-gradient(90deg,#0000 0,#000 20px calc(100% - 20px),#0000 100%);mask-image:linear-gradient(90deg,#0000 0,#000 20px calc(100% - 20px),#0000 100%)}@keyframes rd-popover-in{0%{opacity:0;transform:translateY(-4px)scale(.98)}to{opacity:1;transform:translateY(0)scale(1)}}@media (prefers-reduced-motion:reduce){.reddokia-root *,.reddokia-root :before,.reddokia-root :after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}`,l=`.rd-icon-wrap{flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}.rd-icon-wrap>svg{width:100%;height:100%}.rd-icon-xs{flex-shrink:0;width:14px;height:14px}.rd-icon-sm{flex-shrink:0;width:16px;height:16px}.rd-icon-md{flex-shrink:0;width:18px;height:18px}.rd-kbd{background-color:var(--rd-group-header-bg);border:1px solid color-mix(in srgb, var(--rd-border) 70%, transparent);color:var(--rd-text-muted);font-family:var(--rd-font-mono);border-radius:5px;flex-shrink:0;align-items:center;padding:2.5px 6px;font-size:11px;font-weight:500;line-height:1;display:inline-flex}.rd-topbar{height:var(--rd-topbar-height,40px);border-bottom:1px solid var(--rd-border);background-color:var(--rd-topbar-bg);color:var(--rd-text-main);z-index:150;-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:space-between;align-items:center;gap:8px;padding:0 12px;display:flex}.rd-topbar__left{align-items:center;gap:8px;min-width:0;display:flex}.rd-topbar__logo{background:linear-gradient(135deg, #f43f5e, var(--rd-accent));color:#fff;border-radius:6px;flex-shrink:0;justify-content:center;align-items:center;width:24px;height:24px;font-size:11px;font-weight:900;display:flex;box-shadow:0 1px 3px #00000040}.rd-topbar__title{letter-spacing:-.02em;text-overflow:ellipsis;white-space:nowrap;font-size:13.5px;font-weight:650;overflow:hidden}.rd-topbar__menubar{align-items:center;gap:2px;margin-left:4px;display:flex}.rd-topbar__menu-wrap{align-items:center;display:flex;position:relative}.rd-topbar__menu-btn{height:28px;color:var(--rd-text-main);white-space:nowrap;border-radius:6px;align-items:center;padding:0 9px;font-size:12.5px;font-weight:500;transition:background-color .12s,color .12s;display:inline-flex}.rd-topbar__menu-btn:hover,.rd-topbar__menu-btn.active{background-color:color-mix(in srgb, var(--rd-text-main) 14%, transparent)}.rd-topbar__dropdown{z-index:350;min-width:224px;top:calc(100% + 4px);left:0;max-height:none!important;position:absolute!important;overflow:visible!important}.rd-topbar__item-wrap{position:relative}.rd-topbar__submenu{z-index:360;min-width:212px;display:none;top:-6px;left:calc(100% + 2px);max-height:none!important;position:absolute!important;overflow:visible!important}.rd-topbar__item-wrap.has-submenu:hover>.rd-topbar__submenu,.rd-topbar__item-wrap.has-submenu:focus-within>.rd-topbar__submenu{display:block}.rd-topbar__item-wrap.has-submenu:hover>.rd-context-item{background-color:color-mix(in srgb, var(--rd-accent) 14%, transparent)}.rd-context-icon-slot{flex-shrink:0;justify-content:center;align-items:center;width:16px;height:16px;display:inline-flex}.rd-submenu-arrow{color:var(--rd-text-muted);flex-shrink:0;margin-left:8px}.rd-topbar__right{flex-shrink:0;align-items:center;gap:6px;display:flex}.rd-edgebar{width:var(--rd-edgebar-width,42px);background-color:var(--rd-edgebar-bg);border-color:var(--rd-border);z-index:20;-webkit-user-select:none;user-select:none;flex-direction:column;flex-shrink:0;justify-content:flex-start;align-items:center;padding:6px 4px;display:flex}.rd-edgebar--left{border-right:1px solid var(--rd-border)}.rd-edgebar--right{border-left:1px solid var(--rd-border)}.rd-edgebar--labeled{width:64px;padding:6px 4px}.rd-edgebar--labeled .rd-edgebar__btn{flex-direction:column;gap:3px;width:56px;height:auto;min-height:46px;padding:6px 3px 5px}.rd-edgebar__label{text-overflow:ellipsis;white-space:nowrap;text-align:center;opacity:.9;max-width:52px;font-size:9.5px;font-weight:500;line-height:1.15;overflow:hidden}.rd-edgebar__bucket{border-radius:6px;flex-direction:column;flex:none;justify-content:flex-start;align-items:center;gap:4px;width:100%;padding:4px 0;transition:background-color .15s;display:flex}.rd-edgebar__bucket--bottom{flex:none;justify-content:flex-start}.rd-edgebar__bucket--corner{flex:none;justify-content:flex-end;margin-top:auto}.rd-edgebar__sep{background-color:var(--rd-border);opacity:.6;width:20px;height:1px;margin:4px 0}.rd-edgebar__btn{width:34px;height:34px;color:var(--rd-text-muted);touch-action:none;border-radius:7px;justify-content:center;align-items:center;transition:background-color .15s,color .15s;display:flex;position:relative}.rd-edgebar__btn:hover{color:var(--rd-text-main);background-color:color-mix(in srgb, var(--rd-text-main) 14%, transparent)}.rd-edgebar__btn--active,.rd-edgebar__btn--active:hover{background-color:color-mix(in srgb, var(--rd-accent) 16%, transparent);color:var(--rd-accent)}.rd-edgebar__indicator{background-color:var(--rd-accent);border-radius:999px;width:3px;height:16px;position:absolute;top:50%;transform:translateY(-50%)}.rd-edgebar__dirty-dot{background-color:var(--rd-warning);width:5px;height:5px;box-shadow:0 0 4px color-mix(in srgb, var(--rd-warning) 55%, transparent);border-radius:999px;position:absolute;bottom:5px;right:5px}.rd-edgebar__badge{background-color:var(--rd-accent-secondary);min-width:14px;height:14px;color:var(--rd-text-on-accent-secondary);font-family:var(--rd-font-mono);text-align:center;border-radius:999px;padding:0 3px;font-size:9px;font-weight:700;line-height:14px;position:absolute;top:2px;right:2px}.rd-edgebar__indicator--left{left:-4px}.rd-edgebar__indicator--right{right:-4px}.rd-statusbar{height:var(--rd-statusbar-height,28px);border-top:1px solid var(--rd-border);background-color:var(--rd-topbar-bg);color:var(--rd-text-main);z-index:30;-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:space-between;align-items:center;padding:0 12px;font-size:12px;display:flex}.rd-statusbar__left{align-items:center;gap:8px;min-width:0;display:flex}.rd-statusbar__right{font-family:var(--rd-font-mono);color:var(--rd-text-muted);font-variant-numeric:tabular-nums;flex-shrink:0;align-items:center;gap:10px;font-size:11.5px;display:flex}.rd-main-area{flex:1;min-width:0;min-height:0;display:flex;position:relative;overflow:hidden}.rd-grid-container{background-color:var(--rd-shell-bg);flex:1;min-width:0;min-height:0;position:relative;overflow:visible}`,u=`.rd-group{background-color:var(--rd-panel-bg);border:1px solid var(--rd-border);border-radius:var(--rd-island-radius);box-shadow:var(--rd-shadow-group);flex-direction:column;transition:border-color .14s,box-shadow .14s;overflow:visible}.rd-group.contents-group{background-color:var(--rd-contents-bg)}.rd-tab{height:35px;color:var(--rd-text-muted);font-size:var(--rd-font-size-tab,12.5px);cursor:pointer;touch-action:none;background-color:#0000;border-top:2px solid #0000;border-left:1px solid #0000;border-right:1px solid #0000;border-top-left-radius:7px;border-top-right-radius:7px;flex-shrink:0;align-items:center;gap:7px;padding-left:12px;padding-right:8px;font-weight:500;transition:background-color .14s,color .14s,border-color .14s;display:flex;position:relative}.rd-tab:hover:not(.active){background-color:color-mix(in srgb, var(--rd-tab-active-bg) 52%, transparent);color:var(--rd-text-main)}.rd-tab:active{cursor:grabbing}.rd-tab.active{background-color:var(--rd-tab-active-bg);color:var(--rd-text-main);border-top-color:var(--rd-accent);border-left-color:color-mix(in srgb, var(--rd-border) 70%, transparent);border-right-color:color-mix(in srgb, var(--rd-border) 70%, transparent);font-weight:600}.rd-group.contents-group .rd-tab.active{background-color:var(--rd-contents-bg)}.rd-group:not(.contents-group) .rd-tab.active{background-color:var(--rd-panel-bg)}.rd-floating-window .rd-tab.active,.rd-popout__header .rd-tab.active{border-top-color:var(--rd-accent-secondary)}.rd-tab__icon,.rd-view-svg-icon{object-fit:contain;opacity:.8;flex-shrink:0;width:15px;height:15px;transition:opacity .14s,color .14s}.rd-tab.active .rd-tab__icon,.rd-tab.active .rd-view-svg-icon{opacity:1;color:var(--rd-accent)}.rd-floating-window .rd-tab.active .rd-tab__icon,.rd-popout__header .rd-tab.active .rd-tab__icon{color:var(--rd-accent-secondary)}.rd-tab:hover .rd-tab__icon{opacity:1}.rd-tab__title{text-overflow:ellipsis;white-space:nowrap;max-width:172px;overflow:hidden}.rd-tab-badge{background-color:color-mix(in srgb, var(--rd-accent) 16%, transparent);border:1px solid color-mix(in srgb, var(--rd-accent) 28%, transparent);color:var(--rd-accent-secondary);font-family:var(--rd-font-mono);font-size:var(--rd-font-size-badge,11px);border-radius:999px;flex-shrink:0;padding:2px 6px;font-weight:600;line-height:1.1}.rd-tab__btn{border-radius:5px;justify-content:center;align-items:center;width:22px;height:22px;margin-right:-2px;transition:background-color .14s,opacity .14s,color .14s;display:flex}.rd-tab__btn:hover{background-color:color-mix(in srgb, var(--rd-text-main) 16%, transparent);color:var(--rd-text-main)}.rd-tab__btn--pin{color:var(--rd-accent-secondary)}.rd-tab__btn--close{opacity:0;pointer-events:none}.rd-tab.active .rd-tab__btn--close{opacity:.78;pointer-events:auto}.rd-tab:hover .rd-tab__btn--close,.rd-tab:focus-within .rd-tab__btn--close{opacity:.75;pointer-events:auto}.rd-tab__btn--close:hover{opacity:1!important}.rd-tab__dirty-dot{background-color:var(--rd-accent-secondary);width:8px;height:8px;box-shadow:0 0 6px color-mix(in srgb, var(--rd-accent-secondary) 50%, transparent);border-radius:999px}.rd-tab__dirty-close-icon{opacity:.9;width:15px;height:15px;display:none}.rd-tab:hover .rd-tab__btn--dirty .rd-tab__dirty-dot{display:none}.rd-tab:hover .rd-tab__btn--dirty .rd-tab__dirty-close-icon{display:block}.rd-sash{z-index:20;touch-action:none;outline:none;justify-content:center;align-items:center;display:flex}.rd-sash--horiz{cursor:col-resize}.rd-sash--vert{cursor:row-resize}.rd-sash__line{background-color:#0000;border-radius:999px;justify-content:center;align-items:center;transition:background-color .15s;display:flex}.rd-sash--horiz .rd-sash__line{width:4px;height:100%}.rd-sash--vert .rd-sash__line{width:100%;height:4px}.rd-sash:hover .rd-sash__line,.rd-sash[data-dragging=true] .rd-sash__line{background-color:var(--rd-accent);transition-delay:80ms}.rd-sash[data-dragging=true] .rd-sash__line{transition-delay:0s}.rd-sash__grip{background-color:#0000;border-radius:999px;transition:background-color .15s}.rd-sash--horiz .rd-sash__grip{width:2px;height:24px}.rd-sash--vert .rd-sash__grip{width:24px;height:2px}.rd-sash:hover .rd-sash__grip,.rd-sash[data-dragging=true] .rd-sash__grip{background-color:var(--rd-sash-grip);transition-delay:80ms}.rd-sash[data-dragging=true] .rd-sash__grip{transition-delay:0s}.rd-floating__se-corner{border-right:2px solid var(--rd-text-muted);border-bottom:2px solid var(--rd-text-muted);opacity:.42;border-bottom-right-radius:2px;width:8px;height:8px;transition:border-color .14s,opacity .14s}.rd-floating-resize-handle.se:hover .rd-floating__se-corner{border-right-color:var(--rd-accent-secondary);border-bottom-color:var(--rd-accent-secondary);opacity:1}.rd-popout{-webkit-user-select:none;user-select:none;width:100%;height:100%;font-family:var(--rd-font-sans);background-color:var(--rd-shell-bg);color:var(--rd-text-main);flex-direction:column;display:flex;overflow:hidden}.rd-popout__header{height:var(--rd-tabbar-height,40px);border-bottom:1px solid var(--rd-border);background-color:var(--rd-group-header-bg);flex-shrink:0;justify-content:space-between;align-items:center;gap:10px;padding:0 12px;display:flex}.rd-popout__title-wrap{flex:1;align-items:center;gap:8px;min-width:0;height:100%;display:flex;overflow:hidden}.rd-popout__dock-btn{background-color:var(--rd-accent);height:27px;color:var(--rd-text-on-accent);font-family:var(--rd-font-sans);cursor:pointer;border-radius:6px;flex-shrink:0;align-items:center;gap:6px;padding:0 12px;font-size:12px;font-weight:600;transition:filter .14s,transform .14s;display:inline-flex}.rd-popout__dock-btn:hover{filter:brightness(1.08)}.rd-popout__body{background-color:var(--rd-contents-bg);min-width:0;min-height:0;color:var(--rd-text-main);-webkit-user-select:text;user-select:text;flex-direction:column;flex:1;display:flex;position:relative;overflow:hidden}body[data-reddokia-dragging=true],body[data-reddokia-dragging=true] *{-webkit-user-select:none!important;user-select:none!important}body[data-reddokia-dragging=true] .rd-view-host,body[data-reddokia-dragging=true] iframe,body[data-reddokia-dragging=true] canvas{pointer-events:none!important}.rd-group.focused:not(.edgebar-group){border-color:color-mix(in srgb, var(--rd-accent) 34%, var(--rd-border))}.rd-group-header{height:var(--rd-tabbar-height,40px);border-bottom:1px solid var(--rd-border);background-color:var(--rd-group-header-bg);-webkit-user-select:none;user-select:none;border-top-left-radius:calc(max(0px, var(--rd-island-radius) - 1px));border-top-right-radius:calc(max(0px, var(--rd-island-radius) - 1px));flex-shrink:0;justify-content:space-between;align-items:center;gap:6px;padding:0 8px;display:flex;position:relative}.rd-tab-list{flex:1;gap:2px;min-width:0;height:100%;padding-top:4px;display:flex;overflow:auto hidden;scrollbar-width:none!important;align-items:flex-end!important}.rd-tab-list::-webkit-scrollbar{width:0!important;height:0!important;display:none!important}.rd-group.edgebar-group .rd-group-header,.rd-floating-window--edge .rd-floating-header,.rd-popout--edge .rd-popout__header{padding:0 10px}.rd-group.edgebar-group .rd-tab-list,.rd-floating-window--edge .rd-tab-list,.rd-popout--edge .rd-tab-list{gap:4px;padding-top:0;align-items:center!important}.rd-group.edgebar-group .rd-tab.edgebar-single,.rd-floating-window--edge .rd-tab.edgebar-single,.rd-popout--edge .rd-tab.edgebar-single{min-width:0;height:100%;color:var(--rd-text-main);letter-spacing:-.01em;cursor:default;border-radius:0;flex:1;padding:0 4px;font-size:12.5px;font-weight:600;background-color:#0000!important;border:none!important;outline:none!important}.rd-floating-window--edge .rd-tab.edgebar-single{cursor:move}.rd-group.edgebar-group .rd-tab.edgebar-single .rd-tab__icon,.rd-group.edgebar-group .rd-tab.edgebar-single .rd-view-svg-icon,.rd-floating-window--edge .rd-tab.edgebar-single .rd-tab__icon,.rd-floating-window--edge .rd-tab.edgebar-single .rd-view-svg-icon,.rd-popout--edge .rd-tab.edgebar-single .rd-tab__icon,.rd-popout--edge .rd-tab.edgebar-single .rd-view-svg-icon{opacity:1;color:var(--rd-accent)}.rd-tab-pin-svg{width:14px;height:14px;color:var(--rd-accent-secondary);flex-shrink:0}.rd-group-actions{flex-shrink:0;align-items:center;gap:3px;padding-left:6px;display:flex}.rd-group-action-btn{width:26px;height:26px;color:var(--rd-text-muted);cursor:pointer;border:1px solid #0000;border-radius:6px;justify-content:center;align-items:center;transition:background-color .14s,border-color .14s,color .14s,transform .1s;display:flex}.rd-group-action-btn:hover{background-color:color-mix(in srgb, var(--rd-text-main) 16%, transparent);border-color:color-mix(in srgb, var(--rd-text-main) 20%, transparent);color:var(--rd-text-main)}.rd-group-action-btn:active{transform:scale(.94)}.rd-group-action-svg{flex-shrink:0;width:15px;height:15px}.rd-group-lock-badge{background-color:color-mix(in srgb, var(--rd-warning) 15%, transparent);border:1px solid color-mix(in srgb, var(--rd-warning) 40%, transparent);color:var(--rd-warning);border-radius:5px;align-items:center;padding:3px 6px;display:inline-flex}.rd-tab-overflow-wrap{position:relative}.rd-tab-overflow-btn{background-color:color-mix(in srgb, var(--rd-border) 26%, transparent);width:auto;height:26px;font-family:var(--rd-font-mono);gap:4px;padding:0 8px;font-size:11.5px;font-weight:600}.rd-tab-overflow-dropdown{border:1px solid var(--rd-border);background-color:var(--rd-panel-bg);min-width:236px;max-height:min(340px,68vh);color:var(--rd-text-main);box-shadow:var(--rd-shadow-popover);z-index:300;border-radius:10px;padding:6px;font-size:12.5px;animation:.12s cubic-bezier(.16,1,.3,1) rd-popover-in;position:absolute;top:32px;right:0;overflow-y:auto}.rd-group-body{background-color:var(--rd-panel-bg);-webkit-user-select:text;user-select:text;border-bottom-left-radius:calc(max(0px, var(--rd-island-radius) - 1px));border-bottom-right-radius:calc(max(0px, var(--rd-island-radius) - 1px));flex-direction:column;flex:1;min-width:0;min-height:0;display:flex;position:relative;overflow:hidden}.rd-group.contents-group .rd-group-body{background-color:var(--rd-contents-bg)}.rd-empty-contents{text-align:center;background-color:var(--rd-contents-bg);color:var(--rd-text-main);-webkit-user-select:text;user-select:text;flex-direction:column;flex:1;justify-content:center;align-items:center;gap:8px;padding:24px;font-size:13px;font-weight:600;display:flex}.rd-empty-contents-svg{width:32px;height:32px;color:var(--rd-accent);opacity:.85}.rd-view-host{box-sizing:border-box;width:100%;height:100%;font-size:var(--rd-font-size-content);-webkit-user-select:text;user-select:text;scrollbar-width:thin;scrollbar-color:color-mix(in srgb, var(--rd-text-muted) 35%, transparent) transparent;flex-direction:column;line-height:1.6;overflow:auto}.rd-floating-window{pointer-events:auto;border-radius:var(--rd-island-radius);border:1px solid color-mix(in srgb, var(--rd-accent-secondary) 58%, var(--rd-border));background-color:var(--rd-panel-bg);box-shadow:var(--rd-shadow-floating);flex-direction:column;display:flex;position:absolute;overflow:hidden}.rd-floating-window.focused{border-color:var(--rd-accent-secondary);box-shadow:var(--rd-shadow-floating-active)}.rd-floating-window.focused .rd-floating__se-corner{border-right-color:var(--rd-accent-secondary);border-bottom-color:var(--rd-accent-secondary);opacity:1}.rd-floating-window--edge{border-color:color-mix(in srgb, var(--rd-accent) 42%, var(--rd-border))}.rd-floating-window--edge.focused{border-color:color-mix(in srgb, var(--rd-accent) 72%, var(--rd-border))}.rd-floating-window--edge.focused .rd-floating__se-corner{border-right-color:var(--rd-accent);border-bottom-color:var(--rd-accent)}.rd-floating-header{height:var(--rd-tabbar-height,40px);border-bottom:1px solid var(--rd-border);background-color:var(--rd-group-header-bg);cursor:move;-webkit-user-select:none;user-select:none;touch-action:none;flex-shrink:0;justify-content:space-between;align-items:center;gap:6px;padding:0 8px;display:flex}.rd-floating-body{background-color:var(--rd-contents-bg);-webkit-user-select:text;user-select:text;flex-direction:column;flex:1;min-width:0;min-height:0;display:flex;position:relative;overflow:hidden}.rd-floating-resize-handle{z-index:50;touch-action:none;border-radius:4px;transition:background-color .14s;position:absolute}.rd-floating-resize-handle:hover{background-color:color-mix(in srgb, var(--rd-accent-secondary) 24%, transparent)}.rd-floating-resize-handle.n{cursor:ns-resize;height:6px;top:0;left:12px;right:12px}.rd-floating-resize-handle.s{cursor:ns-resize;height:6px;bottom:0;left:12px;right:12px}.rd-floating-resize-handle.w{cursor:ew-resize;width:6px;top:12px;bottom:12px;left:0}.rd-floating-resize-handle.e{cursor:ew-resize;width:6px;top:12px;bottom:12px;right:0}.rd-floating-resize-handle.nw{cursor:nwse-resize;width:14px;height:14px;top:0;left:0}.rd-floating-resize-handle.ne{cursor:nesw-resize;width:14px;height:14px;top:0;right:0}.rd-floating-resize-handle.sw{cursor:nesw-resize;width:14px;height:14px;bottom:0;left:0}.rd-floating-resize-handle.se{cursor:nwse-resize;width:16px;height:16px;color:var(--rd-accent-secondary);justify-content:flex-end;align-items:flex-end;padding:3px;display:flex;bottom:0;right:0}.rd-group-custom-actions{flex-shrink:0;align-items:center;gap:2px;display:inline-flex}`,d=`.rd-drop-preview{pointer-events:none;z-index:200;border:2px solid var(--rd-accent-secondary);background-color:color-mix(in srgb, var(--rd-accent) 22%, transparent);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);will-change:top, left, width, height;border-radius:8px;justify-content:center;align-items:center;transition:top .13s cubic-bezier(.22,1,.36,1),left .13s cubic-bezier(.22,1,.36,1),width .13s cubic-bezier(.22,1,.36,1),height .13s cubic-bezier(.22,1,.36,1);display:flex;position:absolute}.rd-drop-preview[data-preview-mode=noop]{border-style:dashed;border-color:var(--rd-border);background-color:color-mix(in srgb, var(--rd-panel-bg) 36%, transparent)}.rd-drop-preview[data-preview-mode=float]{border-radius:var(--rd-island-radius);border-color:var(--rd-accent-secondary);background-color:color-mix(in srgb, var(--rd-accent-secondary) 18%, transparent);box-shadow:var(--rd-shadow-floating)}.rd-drag-ghost{pointer-events:none;z-index:400;border:1px solid var(--rd-accent-secondary);background-color:var(--rd-panel-bg);color:var(--rd-text-main);box-shadow:var(--rd-shadow-popover);border-radius:8px;align-items:center;gap:7px;padding:7px 13px;font-size:12.5px;font-weight:600;display:flex;position:fixed}.rd-tab-insert-pin{pointer-events:none;background-color:var(--rd-accent-secondary);width:3px;box-shadow:0 0 10px var(--rd-accent-secondary);border-radius:999px}.rd-tab-insert-pin__cap{background-color:var(--rd-accent-secondary);width:8px;height:8px;box-shadow:0 0 6px var(--rd-accent-secondary);border-radius:999px;position:absolute;left:50%;transform:translate(-50%)}.rd-tab-insert-pin__cap--top{top:-4px}.rd-tab-insert-pin__cap--bottom{bottom:-4px}.rd-context-menu{z-index:300;border:1px solid var(--rd-border);background-color:var(--rd-panel-bg);min-width:256px;max-height:calc(100vh - 16px);color:var(--rd-text-main);box-shadow:var(--rd-shadow-popover);-webkit-user-select:none;user-select:none;border-radius:10px;padding:6px;font-size:12.5px;animation:.12s cubic-bezier(.16,1,.3,1) rd-popover-in;position:fixed;overflow-y:auto}.rd-drag-ghost-svg{flex-shrink:0;width:15px;height:15px}.rd-context-item{text-align:left;border-radius:6px;justify-content:space-between;align-items:center;gap:10px;width:100%;padding:7px 10px;transition:background-color .14s,color .14s;display:flex}.rd-context-item:hover:not(:disabled),.rd-context-item:focus-visible:not(:disabled){background-color:color-mix(in srgb, var(--rd-accent) 14%, transparent)}.rd-context-item:disabled{opacity:.38}.rd-context-item.danger{color:var(--rd-danger)}.rd-context-item.danger:hover:not(:disabled){background-color:var(--rd-danger-bg)}.rd-context-item-label{text-overflow:ellipsis;white-space:nowrap;align-items:center;gap:8px;min-width:0;display:flex;overflow:hidden}.rd-context-svg-icon{width:15px;height:15px;color:var(--rd-accent);flex-shrink:0}.rd-context-item.danger .rd-context-svg-icon{color:var(--rd-danger)}.rd-context-svg-icon.active{color:var(--rd-accent-secondary)}.rd-context-svg-icon.muted{opacity:.25}.rd-context-divider{border-top:1px solid var(--rd-border);margin:5px 6px}.rd-context-item--submenu-open{background-color:color-mix(in srgb, var(--rd-accent) 16%, transparent)}.rd-context-submenu-arrow{opacity:.65;flex-shrink:0;width:14px;height:14px}.rd-context-check-icon{width:14px;height:14px;color:var(--rd-accent);flex-shrink:0}.rd-context-submenu{z-index:310;border:1px solid var(--rd-border);background-color:var(--rd-panel-bg);min-width:196px;max-height:calc(100vh - 16px);color:var(--rd-text-main);box-shadow:var(--rd-shadow-popover);-webkit-user-select:none;user-select:none;border-radius:10px;padding:6px;font-size:12.5px;animation:.11s cubic-bezier(.16,1,.3,1) rd-popover-in;position:fixed;overflow-y:auto}`,f=`reddokia-core-styles`,p=`${c}\n${l}\n${u}\n${d}`,m=null;function h(e){if(typeof e.querySelector!=`function`)return!1;try{return!!e.querySelector(`link[data-reddokia-styles], style[data-reddokia-styles], link[rel="stylesheet"][href*="reddokia"][href$=".css"]`)}catch{return!1}}function g(e,t){if(t?.disabled===!0||globalThis.__REDDOKIA_DISABLE_STYLE_INJECTION__===!0)return null;let n=e??(typeof document<`u`?document:void 0);if(!n||!n.head)return null;let r=typeof document<`u`&&n===document,i=t?.nonce;if(r&&m&&m.ownerDocument===n&&m.isConnected)return m.textContent!==p&&(m.textContent=p),i&&m.setAttribute(`nonce`,i),m;try{let e=n.getElementById(f);if(e)return e.textContent!==p&&(e.textContent=p),i&&e.setAttribute(`nonce`,i),r&&(m=e),e;if(h(n))return null;let t=n.createElement(`style`);return t.id=f,t.setAttribute(`data-reddokia-styles`,`core`),i&&t.setAttribute(`nonce`,i),t.textContent=p,n.head.firstChild?n.head.insertBefore(t,n.head.firstChild):n.head.appendChild(t),r&&(m=t),t}catch{return null}}var _=0;function v(e){return _=_+1&2147483647,`${e}-${Date.now().toString(36).slice(-4)}-${_.toString(36)}`}function y(e){return Array.isArray(e)||typeof e!=`object`||!e?!1:e.type===`row`||e.type===`col`||Array.isArray(e.children)&&e.children.length>0&&typeof e.children[0]!=`string`}function b(e){return e?Array.isArray(e)?e.length>0:Array.isArray(e.children)&&e.children.length>0:!1}function x(e){if(e&&!Array.isArray(e))return e.size}function S(e){return e?Array.isArray(e)?e.slice():Array.isArray(e.children)?e.children.slice():[]:[]}function C(e){if(!e)return;let t=S(e);return{...Array.isArray(e)?{children:t}:e,children:t,edgeBar:!0}}function w(e,t,n){let r=b(e),i=b(t);if(!r&&!i)return null;let{splitId:a,topId:o,bottomId:s,topSlot:c,bottomSlot:l,colSize:u}=n;return r&&i?{type:`col`,id:a,size:u,minSize:120,children:[T(e,{id:o,edgeSlot:c,size:500}),T(t,{id:s,edgeSlot:l,size:500})]}:r?T(e,{id:o,edgeSlot:c,size:u,minSize:120}):T(t,{id:s,edgeSlot:l,size:u,minSize:120})}function T(e,t){let{id:n,edgeSlot:r,contentsStage:i,size:a,minSize:o}=t;if(!e||Array.isArray(e)){let t=Array.isArray(e)?e.slice():[];return{id:n,edgeSlot:r,contentsStage:i,size:a,minSize:o,children:t,activeViewId:t[0]||null}}if(y(e)){let{id:t,size:r,minSize:s,contentsStage:c}=e;return{...e,id:t??n,size:r??a,minSize:s??o,contentsStage:c===void 0?i:c}}let s=e,{id:c,edgeSlot:l,contentsStage:u,size:d,minSize:f,children:p,activeViewId:m}=s,h=Array.isArray(p)?p.slice():[];return{...s,id:c??n,edgeSlot:l===void 0?r:l,contentsStage:u===void 0?i:u,size:d??a,minSize:f??o,children:h,activeViewId:m===void 0?h[0]||null:m}}function E(e,t,n){let r=b(e),i=b(t);return!r&&!i?null:r&&i?{type:`row`,id:`split-bottom`,size:n,minSize:120,children:[T(e,{id:`group-bottom-left`,edgeSlot:`bottom-left`,size:500,minSize:120}),T(t,{id:`group-bottom-right`,edgeSlot:`bottom-right`,size:500,minSize:120})]}:r?T(e,{id:`group-bottom-left`,edgeSlot:`bottom-left`,size:n,minSize:120}):T(t,{id:`group-bottom-right`,edgeSlot:`bottom-right`,size:n,minSize:120})}function D(e){let{leftTopEdgeBar:t,leftBottomEdgeBar:n,rightTopEdgeBar:r,rightBottomEdgeBar:i,bottomLeftEdgeBar:a,bottomRightEdgeBar:o,contents:s}=e,c=C(t),l=C(n),u=C(r),d=C(i),f=C(a),p=C(o),m=b(c)||b(l),h=b(u)||b(d),g=b(f)||b(p),_=s===void 0&&(m||h||g),v=m?x(c)??x(l)??(_?500:240):0,S=h?x(u)??x(d)??(_?500:240):0,D=v+S,O=x(s)??Math.max(200,1e3-D),k=[],A=w(c,l,{splitId:`split-left`,topId:`group-left-top`,bottomId:`group-left-bottom`,topSlot:`left-top`,bottomSlot:`left-bottom`,colSize:v});A&&k.push(A),_||k.push(T(s,{id:`group-contents-1`,contentsStage:!0,size:O}));let ee=w(u,d,{splitId:`split-right`,topId:`group-right-top`,bottomId:`group-right-bottom`,topSlot:`right-top`,bottomSlot:`right-bottom`,colSize:S});if(ee&&k.push(ee),g){let e=x(f)??x(p)??(k.length===0?1e3:280),t=E(f,p,e);if(k.length===0)return{type:`col`,id:`root-split`,children:[t]};let n=Math.max(200,1e3-e);return{type:`col`,id:`root-split`,children:[k.length===1?{...k[0],size:n}:{type:`row`,id:`split-main-row`,contentsStage:!_,size:n,children:k},t]}}return k.length===1&&y(k[0])?{...k[0],id:`root-split`}:{type:`row`,id:`root-split`,children:k}}function O(e){let t=e&&typeof e==`object`&&(`type`in e&&(e.type===`row`||e.type===`col`)||`children`in e&&Array.isArray(e.children))?e:D(e||{}),n=0,r=0,i=!1,a=!1;function o(e){if(Array.isArray(e)||!e||typeof e!=`object`)return!1;if(y(e)){for(let t=0;t<e.children.length;t++)if(o(e.children[t]))return!0;return!1}return!!e.contentsStage}let s=o(t);function c(e,t,o){let l=Array.isArray(e)?{children:e}:e;if(y(l)){n+=1;let e=l.type===`col`?`vertical`:`horizontal`,r=!!l.contentsStage,i=t||r,a=l.size??(o||r?1e3:500),s=l.id||(o?`root-split`:r?`split-editors`:`split-${n}`),u=Array(l.children.length);for(let e=0;e<l.children.length;e++)u[e]=c(l.children[e],i,!1);return{id:s,type:`split`,orientation:e,size:a,cachedSize:a,collapsed:l.collapsed??!1,isContentsStage:r||void 0,constraints:{minSize:l.minSize??(r?180:120),maxSize:l.maxSize,minWidth:l.minWidth,maxWidth:l.maxWidth,minHeight:l.minHeight,maxHeight:l.maxHeight,snap:l.snap??!1,fixed:l.fixed??!1},children:u}}let u=l;r+=1;let d=!!u.edgeSlot,f=!!u.contentsStage||!s&&t&&!d&&!i;f&&(i=!0);let p=u.size??(d?240:500),m=u.id;m||(f&&!a?(a=!0,m=`group-contents-1`):m=u.edgeSlot?`group-${u.edgeSlot}`:`group-${r}`);let h=Array.isArray(u.children)?u.children.slice():[],g=u.activeViewId===void 0?h[0]??null:u.activeViewId;return{id:m,type:`group`,size:p,cachedSize:p,collapsed:u.collapsed??!1,isContentsRootGroup:f||void 0,emptyBehavior:f?`keep`:`prune`,edgeSlot:u.edgeSlot,edgeBar:u.edgeBar||void 0,constraints:{minSize:u.minSize??(f?180:120),maxSize:u.maxSize,minWidth:u.minWidth,maxWidth:u.maxWidth,minHeight:u.minHeight,maxHeight:u.maxHeight,snap:u.snap??!1,fixed:u.fixed??!1},views:h,activeViewId:g,showHeader:u.showHeader,locked:u.locked}}let l=c(t,!1,!0);if(!i){function e(t){if(t.type===`group`&&!t.edgeSlot)return t.isContentsRootGroup=!0,t.emptyBehavior=`keep`,t.id&&t.id!==`group-1`||(t.id=`group-contents-1`),!0;if(t.type===`split`){for(let n=0;n<t.children.length;n++)if(e(t.children[n]))return t.children[n].type===`group`&&(t.isContentsStage=!0),!0}return!1}e(l)}return l}function k(e,t){if(!t)return t;let n=!1,r=null,i=null,a=null,o=null,s=null,c=null,l=null,u=[];function d(e){if(e.type===`group`)u.push(e),e.id===t&&(n=!0),e.isContentsRootGroup&&!r&&(r=e),e.edgeSlot===`left-top`&&!i?i=e:e.edgeSlot===`left-bottom`&&!a?a=e:e.edgeSlot===`right-top`&&!o?o=e:e.edgeSlot===`right-bottom`&&!s?s=e:e.edgeSlot===`bottom-left`&&!c?c=e:e.edgeSlot===`bottom-right`&&!l&&(l=e);else for(let t=0;t<e.children.length;t++)d(e.children[t])}if(d(e),n)return t;switch(t){case`leftTopEdgeBar`:return i?.id??t;case`leftBottomEdgeBar`:return a?.id??t;case`contents`:return r?.id??u[0]?.id??t;case`rightTopEdgeBar`:return o?.id??t;case`rightBottomEdgeBar`:return s?.id??t;case`bottomLeftEdgeBar`:return c?.id??t;case`bottomRightEdgeBar`:return l?.id??t;default:return t}}function A(e){if(e.type===`group`){let{constraints:t,views:n}=e;return{...e,constraints:t?{...t}:void 0,views:n.slice()}}let{constraints:t,children:n}=e,r=Array(n.length);for(let e=0;e<n.length;e++)r[e]=A(n[e]);return{...e,constraints:t?{...t}:void 0,children:r}}function ee(e){if(!e)return!0;if(e.type===`split`){if(e.isContentsStage)return!1;if(e.collapsed)return!0;let t=e.children;for(let e=0;e<t.length;e++)if(!ee(t[e]))return!1;return!0}return e.isContentsRootGroup?!1:e.collapsed?!0:!!(e.edgeSlot&&e.views.length===0)}function te(e,t,n){let r=e.constraints,i=(t===`horizontal`?r?.minWidth??r?.minSize:r?.minHeight??r?.minSize)||90;if(e.type===`group`){if(n&&e.activeViewId){let r=n[e.activeViewId];if(r){let e=t===`horizontal`?r.minWidth:r.minHeight;e!==void 0&&e>i&&(i=e)}}return i}let a=e.children,o=0,s=e.orientation===t;for(let e=0;e<a.length;e++){let r=a[e];if(ee(r))continue;let i=te(r,t,n);s?o+=i:i>o&&(o=i)}return o>i?o:i}function ne(e,t,n,r){let i=e.constraints,a=(t===`horizontal`?i?.maxWidth??i?.maxSize:i?.maxHeight??i?.maxSize)??1e5;if(e.type===`group`&&n&&e.activeViewId){let r=n[e.activeViewId];if(r){let e=t===`horizontal`?r.maxWidth:r.maxHeight;e!==void 0&&e<a&&(a=e)}}let o=r===void 0?te(e,t,n):r;return a<o?o:a}function j(){return{id:`root-split`,type:`split`,orientation:`horizontal`,size:1e3,children:[{id:`split-contents`,type:`split`,orientation:`vertical`,size:1e3,constraints:{minSize:280,snap:!1},children:[{id:`split-editors`,type:`split`,orientation:`horizontal`,size:1e3,isContentsStage:!0,constraints:{minSize:180,snap:!1},children:[{id:`group-contents-1`,type:`group`,size:1e3,cachedSize:1e3,collapsed:!1,isContentsRootGroup:!0,emptyBehavior:`keep`,constraints:{minSize:180,snap:!1},views:[],activeViewId:null}]}]}]}}function re(e,t,n){if(e.type===`group`)return t&&e.id===t||e.edgeSlot||e.locked||e.showHeader===!1||e.views.length===0?!1:n&&n.size>0?e.views.some(e=>!n.has(e)):!0;for(let r=0;r<e.children.length;r++)if(re(e.children[r],t,n))return!0;return!1}function M(e){if(e.type===`group`)return!!e.isContentsRootGroup;for(let t=0;t<e.children.length;t++)if(M(e.children[t]))return!0;return!1}function N(e,t=!1,n){if(e.type===`group`){let r=!!(n&&n.size>0)&&e.views.length>0&&e.views.every(e=>n.has(e));return(t||!e.edgeSlot)&&!e.edgeBar&&!e.locked&&e.showHeader!==!1&&!r?(e.isContentsRootGroup=!0,e.emptyBehavior=`keep`,e.collapsed=!1,!0):!1}for(let r=0;r<e.children.length;r++)if(N(e.children[r],t,n))return!0;return!1}function ie(e){let t=[],n=e=>{if(e.type===`group`)e.isContentsRootGroup&&t.push(e);else for(let t=0;t<e.children.length;t++)n(e.children[t])};if(n(e),t.length<=1)return;let r=t.find(e=>e.views.length===0)||t[t.length-1];for(let e=0;e<t.length;e++)t[e]!==r&&(t[e].isContentsRootGroup=void 0,t[e].edgeSlot||(t[e].emptyBehavior=`prune`))}function P(e,t=!0,n=j,r,i){if(!e)return null;let a=t?M(e):!1,o=r||(t?{hasOtherNonEdgeViews:t=>re(e,t,i)}:void 0);if(e.type===`group`){let n=!e.edgeSlot&&!e.edgeBar&&!e.locked&&e.showHeader!==!1;if(e.views.length===0){if(e.edgeSlot)return e.emptyBehavior===`prune`&&!t?null:{...e,collapsed:!0,activeViewId:null};if(n)return!t&&o?.hasOtherNonEdgeViews(e.id)?null:{...e,isContentsRootGroup:!0,collapsed:!1,emptyBehavior:`keep`,activeViewId:null};if(e.emptyBehavior===`prune`&&!t)return null}let r=e.activeViewId&&e.views.includes(e.activeViewId)?e.activeViewId:e.views[0]||null;return e.isContentsRootGroup?{...e,collapsed:!1,emptyBehavior:`keep`,activeViewId:r}:{...e,activeViewId:r}}let s=e.id===`split-contents`||!!e.isContentsStage,c=[];for(let t=0;t<e.children.length;t++){let r=P(e.children[t],!1,n,o,i);if(r){if(r.type===`split`&&r.orientation===e.orientation&&!r.isContentsStage)for(let e=0;e<r.children.length;e++)c.push(r.children[e]);else c.push(r)}}if(e.isContentsStage){if(c.length===0)c.push({id:`group-contents-1`,type:`group`,size:500,cachedSize:500,collapsed:!1,isContentsRootGroup:!0,emptyBehavior:`keep`,constraints:{minSize:150,snap:!1},views:[],activeViewId:null});else if(!M({...e,children:c}))for(let e=0;e<c.length&&!N(c[e],!1,i);e++);return{...e,collapsed:!1,children:c}}if(c.length===0)return t?n():null;if(c.length===1&&!t&&!s)return{...c[0],size:e.size};let l={...e,children:c};return t&&c.length===1&&c[0].type===`split`&&(l={...c[0],id:e.id,size:1e3,collapsed:!1}),t&&a&&!M(l)&&(N(l,!1,i)||N(l,!1)||N(l,!0)),t&&ie(l),l}function F(e,t){let n=k(e,t),r=n===t?t===`root`?e.id:t:n,i=A(e);function a(e,t=null){if(e.id===r){if(e.type===`group`&&e.isContentsRootGroup||e.type===`split`&&e.isContentsStage||e.type===`group`&&e.views.length===0)return!0;let n=!e.collapsed;if(n)e.cachedSize=e.size||220;else if(e.size=e.cachedSize||220,t&&(t.collapsed=!1),e.type===`split`&&e.children.every(e=>e.collapsed||e.type===`group`&&e.views.length===0))for(let t=0;t<e.children.length;t++){let n=e.children[t];n.type===`group`&&n.views.length>0&&(n.collapsed=!1)}return e.collapsed=n,!0}if(e.type===`split`){for(let t=0;t<e.children.length;t++)if(a(e.children[t],e))return!0}return!1}return a(i,null),i}function ae(e,t){let n=Se(e),r={"left-top":n.leftTopEdgeBar,"left-bottom":n.leftBottomEdgeBar,"right-top":n.rightTopEdgeBar,"right-bottom":n.rightBottomEdgeBar,"bottom-left":n.bottomLeftEdgeBar,"bottom-right":n.bottomRightEdgeBar}[t];return r?F(e,r.id):e}function oe(e,t,n){let r=k(e,t),i=A(e);function a(e,t=null){if(e.type===`group`&&e.id===r)return e.views.includes(n)&&(e.collapsed||t?.collapsed||e.activeViewId!==n?(e.collapsed=!1,e.size=e.size||e.cachedSize||220,e.activeViewId=n,t&&(t.collapsed=!1,t.size=t.size||t.cachedSize||240)):e.isContentsRootGroup||(e.cachedSize=e.size||220,e.collapsed=!0)),!0;if(e.type===`split`){for(let t=0;t<e.children.length;t++)if(a(e.children[t],e))return!0}return!1}return a(i,null),i}function se(e,t,n,r){let i=r?k(e,r):void 0,a=A(e),o=null,s=null,c=null,l=null,u=null;function d(e,n=null){if(e.type===`group`)e.views.includes(t)&&(o=e,s=n),i&&e.id===i&&(c=e,l=n),(e.isContentsRootGroup||!e.edgeBar&&!e.edgeSlot)&&!u&&(u=e);else for(let t=0;t<e.children.length;t++)d(e.children[t],e)}if(d(a,null),o)return o.collapsed=!1,o.activeViewId=t,s&&(s.collapsed=!1),{rootGrid:a,activeGroupId:o.id};let f=c||u;if(f){let e=f;return e.collapsed=!1,e.views.push(t),e.activeViewId=t,l&&(l.collapsed=!1),{rootGrid:P(a,!0,n)||a,activeGroupId:e.id}}return{rootGrid:a,activeGroupId:null}}function ce(e,t,n){if(e.length===0)return null;if(n&&n.length>0)for(let t=0;t<n.length;t++){let r=n[t];if(e.includes(r))return r}return e[Math.min(Math.max(0,t),e.length-1)]||e[0]||null}function le(e,t,n,r,i){let a=A(e);function o(e){if(e.type===`group`){let n=e.views.indexOf(t);n!==-1&&(e.views.splice(n,1),e.activeViewId===t&&(e.activeViewId=ce(e.views,n,r)))}else for(let t=0;t<e.children.length;t++)o(e.children[t])}return o(a),P(a,!0,n,void 0,i)||a}function ue(e,t,n,r,i){let a=k(e,t),o=A(e);function s(e){if(e.type===`group`&&e.id===a){if(e.views.includes(n)){let t=[];for(let r=0;r<e.views.length;r++){let a=e.views[r];(a===n||i&&i.has(a))&&t.push(a)}e.views=t,e.activeViewId=n}return!0}if(e.type===`split`){for(let t=0;t<e.children.length;t++)if(s(e.children[t]))return!0}return!1}return s(o),P(o,!0,r,void 0,i)||o}function de(e,t,n,r,i,a){let o=k(e,t),s=A(e);function c(e){if(e.type===`group`&&e.id===o){let t=e.views.indexOf(n);if(t!==-1){let r=[];for(let n=0;n<e.views.length;n++){let a=e.views[n];(n<=t||i&&i.has(a))&&r.push(a)}e.views=r,e.activeViewId&&r.includes(e.activeViewId)||(e.activeViewId=ce(r,t,a)||n)}return!0}if(e.type===`split`){for(let t=0;t<e.children.length;t++)if(c(e.children[t]))return!0}return!1}return c(s),P(s,!0,r,void 0,i)||s}function fe(e,t,n,r,i,a){let o=k(e,t),s=A(e);function c(e){if(e.type===`group`&&e.id===o){let t=[];for(let n=0;n<e.views.length;n++){let i=e.views[n];r&&r.has(i)&&t.push(i)}return e.views=t,e.activeViewId&&t.includes(e.activeViewId)||(e.activeViewId=ce(t,t.length-1,i)),!0}if(e.type===`split`){for(let t=0;t<e.children.length;t++)if(c(e.children[t]))return!0}return!1}return c(s),P(s,!0,n,void 0,a??r)||s}function pe(e,t,n,r,i){return fe(e,t,n,r,i,r)}function me(e,t){if(e.type===`group`){let n=e.views.indexOf(t);n!==-1&&(e.views.splice(n,1),e.activeViewId===t&&(e.activeViewId=e.views[0]||null),e.views.length===0&&(e.edgeBar||(e.emptyBehavior=`prune`)))}else for(let n=0;n<e.children.length;n++)me(e.children[n],t)}function he(e){return e.type===`group`?!!e.edgeBar:e.children.length>0&&e.children.every(e=>he(e))}function ge(e,t,n){if(e.orientation===`horizontal`){let r=0;for(;r<e.children.length&&he(e.children[r]);)r+=1;let i=e.children.length;for(;i>r&&he(e.children[i-1]);)--i;if(n===`left`)return e.children.splice(r,0,t),e;if(n===`right`)return e.children.splice(i,0,t),e;if(r>0||i<e.children.length){let a=e.children.slice(r,i);if(a.length===1&&a[0].type===`split`&&a[0].orientation===`vertical`)return n===`top`?a[0].children.unshift(t):a[0].children.push(t),e;let o=a.reduce((e,t)=>e+(t.size||500),0)||760,s={id:v(`split-contents`),type:`split`,orientation:`vertical`,size:o,cachedSize:o,children:n===`top`?[t,...a]:[...a,t]};return e.children.splice(r,i-r,s),e}return e.id=e.id===`root-split`?`split-main-row`:e.id,{id:`root-split`,type:`split`,orientation:`vertical`,size:1e3,children:n===`top`?[t,e]:[e,t]}}return n===`top`||n===`bottom`?(n===`top`?e.children.unshift(t):e.children.push(t),e):(e.id=e.id===`root-split`?`split-main-col`:e.id,{id:`root-split`,type:`split`,orientation:`horizontal`,size:1e3,children:n===`left`?[t,e]:[e,t]})}function _e(e,t,n,r,i){n=k(e,n);let a=A(e);if(r!==`center`){let r=!1,i=e=>{if(e.type===`group`)e.id===n&&e.views.length===1&&e.views[0]===t&&(r=!0);else for(let t=0;t<e.children.length;t++)i(e.children[t])};if(i(a),r)return{rootGrid:e,activeGroupId:n}}if(me(a,t),r===`center`){let e=!1;function r(i,a=null){if(!e){if(i.type===`group`&&i.id===n)i.views.includes(t)||i.views.push(t),i.activeViewId=t,i.collapsed=!1,a&&(a.collapsed=!1),e=!0;else if(i.type===`split`){for(let t=0;t<i.children.length;t++)if(r(i.children[t],i),e)return}}}return r(a,null),{activeGroupId:n,rootGrid:P(a,!0,i)||a}}let o=r===`left`||r===`right`?`horizontal`:`vertical`,s=r===`left`||r===`top`,c=v(`group`),l=!1;function u(e){if(e.type===`split`&&!l){let r=Array(e.children.length);for(let i=0;i<e.children.length;i++){let a=e.children[i];if(!l&&a.type===`group`&&a.id===n){l=!0;let n=e.orientation===o,u=a.size||500,d=Math.max(120,Math.round(u/2)),f=n?d:500,p={id:c,type:`group`,size:f,cachedSize:f,collapsed:!1,emptyBehavior:`prune`,constraints:{minSize:120,snap:!1},views:[t],activeViewId:t},m={...a,size:f,cachedSize:f,constraints:n?a.constraints?{...a.constraints}:void 0:{minSize:120,snap:!1}};r[i]={id:v(`split`),type:`split`,orientation:o,size:u,cachedSize:a.cachedSize||u,constraints:!n&&a.constraints?{...a.constraints}:void 0,children:s?[p,m]:[m,p]}}else r[i]=u(a)}e.children=r}return e}return{activeGroupId:c,rootGrid:P(u(a),!0,i)||a}}function ve(e,t,n,r,i){let a=A(e),o=i;if(o!=null){let e=r=>{if(r.type===`group`&&r.edgeSlot===n){let e=r.views.indexOf(t);e!==-1&&e<o&&--o}else if(r.type===`split`)for(let t=0;t<r.children.length;t++)e(r.children[t])};e(a)}me(a,t);let s=``,c=n===`bottom-left`||n===`bottom-right`;function l(e,r=null){if(e.type===`group`&&e.edgeSlot===n){let n=e.views.indexOf(t);n!==-1&&e.views.splice(n,1);let i=o==null?e.views.length:Math.max(0,Math.min(e.views.length,o));return e.views.splice(i,0,t),e.edgeBar=!0,e.activeViewId=t,e.collapsed=!1,e.size=e.cachedSize||e.size||240,r&&(r.collapsed=!1,r.size=r.cachedSize||r.size||240),s=e.id,!0}if(e.type===`split`){for(let t=0;t<e.children.length;t++)if(l(e.children[t],e))return e.collapsed=!1,!0}return!1}if(!l(a,null)){let e={id:`group-${n}`,type:`group`,size:c?210:250,cachedSize:c?210:250,collapsed:!1,emptyBehavior:`keep`,edgeSlot:n,edgeBar:!0,constraints:{minSize:120,maxSize:c?520:560,snap:!1},views:[t],activeViewId:t};s=e.id;let r=a.orientation===`horizontal`?a:a.children.find(e=>e.type===`split`&&e.orientation===`horizontal`)||a;if(n===`left-top`||n===`left-bottom`){let t=r.children.findIndex(e=>e.type===`split`&&e.orientation===`vertical`&&e.children.some(e=>e.type===`group`&&(e.edgeSlot===`left-top`||e.edgeSlot===`left-bottom`))||e.type===`group`&&(e.edgeSlot===`left-top`||e.edgeSlot===`left-bottom`));if(t!==-1){let i=r.children[t];if(i.type===`split`)e.size=500,e.cachedSize=500,n===`left-top`?i.children.unshift(e):i.children.push(e),i.collapsed=!1;else{let a=i.size||i.cachedSize||240;i.size=500,i.cachedSize=500,e.size=500,e.cachedSize=500,r.children[t]={id:v(`split`),type:`split`,orientation:`vertical`,size:a,cachedSize:a,collapsed:!1,constraints:{minSize:120,maxSize:520,snap:!1},children:n===`left-top`?[e,i]:[i,e]}}}else r.children.unshift(e)}else if(n===`right-top`||n===`right-bottom`){let t=r.children.findIndex(e=>e.type===`split`&&e.orientation===`vertical`&&e.children.some(e=>e.type===`group`&&(e.edgeSlot===`right-top`||e.edgeSlot===`right-bottom`))||e.type===`group`&&(e.edgeSlot===`right-top`||e.edgeSlot===`right-bottom`));if(t!==-1){let i=r.children[t];if(i.type===`split`)e.size=500,e.cachedSize=500,n===`right-top`?i.children.unshift(e):i.children.push(e),i.collapsed=!1;else{let a=i.size||i.cachedSize||270;i.size=500,i.cachedSize=500,e.size=500,e.cachedSize=500,r.children[t]={id:v(`split`),type:`split`,orientation:`vertical`,size:a,cachedSize:a,collapsed:!1,constraints:{minSize:120,maxSize:560,snap:!1},children:n===`right-top`?[e,i]:[i,e]}}}else r.children.push(e)}else if(c){if(a.orientation!==`vertical`){let t={...a,id:a.id===`root-split`?`split-main-row`:a.id,size:720,cachedSize:720};a.id=`root-split`,a.orientation=`vertical`,a.size=1e3,a.cachedSize=1e3,a.children=[t,e]}else{let t=a.children.findIndex(e=>e.type===`split`&&e.orientation===`horizontal`&&e.children.some(e=>e.type===`group`&&(e.edgeSlot===`bottom-left`||e.edgeSlot===`bottom-right`))||e.type===`group`&&(e.edgeSlot===`bottom-left`||e.edgeSlot===`bottom-right`));if(t!==-1){let r=a.children[t];if(r.type===`split`)e.size=500,e.cachedSize=500,n===`bottom-left`?r.children.unshift(e):r.children.push(e),r.collapsed=!1;else{let i=r.size||r.cachedSize||210;r.size=500,r.cachedSize=500,e.size=500,e.cachedSize=500,a.children[t]={id:v(`split`),type:`split`,orientation:`horizontal`,size:i,cachedSize:i,collapsed:!1,constraints:{minSize:120,maxSize:520,snap:!1},children:n===`bottom-left`?[e,r]:[r,e]}}}else a.children.push(e)}}}return{activeGroupId:s,rootGrid:P(a,!0,r)||a}}function ye(e,t,n,r){let i=null,a=0;function o(e){if(e.type===`group`)e.views.length>0&&!e.collapsed&&(a+=1),e.views.includes(t)&&(i=e);else for(let t=0;t<e.children.length;t++)o(e.children[t])}o(e);let s=i;if(s&&s.views.length===1){if(a<=1)return{rootGrid:e,activeGroupId:s.id};let t=n===`left`||n===`right`?`horizontal`:`vertical`;if(e.orientation===t&&e.children.length>0){let t=n===`left`||n===`top`?e.children[0]:e.children[e.children.length-1];if(t.type===`group`&&t.id===s.id)return{rootGrid:e,activeGroupId:s.id}}}let c=A(e);me(c,t);let l=v(`group-root-${n}`),u=ge(c,{id:l,type:`group`,size:240,cachedSize:240,collapsed:!1,emptyBehavior:`prune`,constraints:{minSize:120,snap:!1},views:[t],activeViewId:t},n);return{activeGroupId:l,rootGrid:P(u,!0,r)||u}}function be(e,t,n,r,i,a){t=k(e,t);let o=A(e);function s(e){if(e.type===`group`){let r=e.views.indexOf(n);r!==-1&&(e.views.splice(r,1),e.activeViewId===n&&(e.activeViewId=e.views[Math.min(r,e.views.length-1)]||null),e.views.length===0&&e.id!==t&&(e.edgeBar||(e.emptyBehavior=`prune`)))}else for(let t=0;t<e.children.length;t++)s(e.children[t])}s(o);function c(e,i=null){if(e.type===`group`&&e.id===t){let t=0,o=e.views.length;if(a){let r=0;for(let t=0;t<e.views.length;t++)a.has(e.views[t])&&(r+=1);a.has(n)?o=r:t=r}let s=Math.max(t,Math.min(o,r));return e.views.splice(s,0,n),e.activeViewId=n,e.collapsed=!1,i&&(i.collapsed=!1),!0}if(e.type===`split`){for(let t=0;t<e.children.length;t++)if(c(e.children[t],e))return!0}return!1}return c(o,null),P(o,!0,i)||o}function xe(e,t){t===`root`&&(t=e.id);let n=A(e);function r(e){if(e.type===`split`){if(e.id===t){let t=e.children.length;if(t>0){let n=Math.round(1e3/t);for(let r=0;r<t;r++){let t=e.children[r];(t.type===`group`&&t.views.length>0||t.type===`split`)&&(t.collapsed=!1),t.size=n,t.cachedSize=n}}return!0}for(let t=0;t<e.children.length;t++)if(r(e.children[t]))return!0}return!1}return r(n),n}function Se(e){let t={leftCol:null,leftTopEdgeBar:null,leftBottomEdgeBar:null,rightCol:null,rightTopEdgeBar:null,rightBottomEdgeBar:null,bottomRow:null,bottomLeftEdgeBar:null,bottomRightEdgeBar:null};function n(e){if(e.type===`split`)for(let r=0;r<e.children.length;r++){let i=e.children[r];i.type===`group`&&(i.edgeSlot===`left-top`||i.edgeSlot===`left-bottom`?!t.leftCol&&e.orientation===`vertical`&&(t.leftCol=e):i.edgeSlot===`right-top`||i.edgeSlot===`right-bottom`?!t.rightCol&&e.orientation===`vertical`&&(t.rightCol=e):i.edgeSlot!==`bottom-left`&&i.edgeSlot!==`bottom-right`||t.bottomRow||e.orientation!==`horizontal`||(t.bottomRow=e)),n(i)}else e.edgeSlot===`left-top`?t.leftTopEdgeBar=e:e.edgeSlot===`left-bottom`?t.leftBottomEdgeBar=e:e.edgeSlot===`right-top`?t.rightTopEdgeBar=e:e.edgeSlot===`right-bottom`?t.rightBottomEdgeBar=e:e.edgeSlot===`bottom-left`?t.bottomLeftEdgeBar=e:e.edgeSlot===`bottom-right`&&(t.bottomRightEdgeBar=e)}return n(e),t}function Ce(e,t,n=j){let r=A(e);function i(e){if(e.type===`group`){let n=[];for(let r=0;r<e.views.length;r++){let i=e.views[r];t.has(i)&&!n.includes(i)&&n.push(i)}e.views=n,e.activeViewId&&n.includes(e.activeViewId)||(e.activeViewId=n[0]||null)}else for(let t=0;t<e.children.length;t++)i(e.children[t])}i(r);let a=P(r,!0,n);return a&&a.type===`split`?a:n()}function we(e,t,n){t=k(e,t);let r=A(e),i=[],a=null;function o(e){if(e.type===`group`)return e.id===t&&e.views.length>0&&(i=e.views.slice(),a=e.activeViewId||i[0]||null,e.views=[],e.activeViewId=null,!0);for(let t=0;t<e.children.length;t++)if(o(e.children[t]))return!0;return!1}return o(r),i.length===0?{rootGrid:e,extractedViews:[],extractedActiveViewId:null}:{rootGrid:P(r,!0,n)||r,extractedViews:i,extractedActiveViewId:a}}var Te=4,Ee=32,De=32,I=/* @__PURE__ */ new Uint8Array(1024),L=/* @__PURE__ */ new Uint8Array(1024),R=/* @__PURE__ */ new Float64Array(1024),z=/* @__PURE__ */ new Float64Array(1024),B=/* @__PURE__ */ new Float64Array(1024);function Oe(){return{nodeRects:Object.create(null),groupRects:Object.create(null),viewRects:Object.create(null),sashes:[]}}function ke(e,t,n,r,i,a,o){let s=o?e[t]:void 0;s?(s.top=n,s.left=r,s.width=i,s.height=a):e[t]={top:n,left:r,width:i,height:a}}function Ae(e,t,n,r,i=0,a,o){let s=!!n,c=n||{nodeRects:{},groupRects:{},viewRects:{},sashes:[]},{nodeRects:l,groupRects:u,viewRects:d,sashes:f}=c,{top:p,left:m,width:h,height:g}=t;if(s){for(let e in d)d[e].visible=!1,d[e].floating=!1,d[e].zOrder=0;for(let e in u){let t=u[e];t.collapsed=!0,t.top=0,t.left=0,t.width=0,t.height=0}for(let e in l){let t=l[e];t.top=0,t.left=0,t.width=0,t.height=0}}let _=0,v=i>0?Math.max(1,Math.round(i*.5)):0;function y(){if(a&&a.length!==0)for(let e=0;e<a.length;e++){let{id:t,activeViewId:n,top:r,left:i,width:o,height:c,zOrder:l}=a[e];if(!n)continue;let u=r+40,f=i+1,p=o>2?o-2:0,m=c>41?c-40-1:0,h=p>0&&m>0,g=s?d[n]:void 0;g?(g.top=u,g.left=f,g.width=p,g.height=m,g.groupId=t,g.visible=h,g.floating=!0,g.zOrder=l||e+1):d[n]={top:u,left:f,width:p,height:m,groupId:t,visible:h,floating:!0,zOrder:l||e+1}}}function b(e,t){if(e.type===`group`)return e.id===t;for(let n=0;n<e.children.length;n++)if(b(e.children[n],t))return!0;return!1}if(r&&e&&b(e,r)){function t(e){if(e.type===`group`){let{id:t,activeViewId:n,showHeader:i}=e,a=t===r,o=a?p:0,c=a?m:0,f=a?h:0,_=a?g:0,v=!a;ke(l,t,o,c,f,_,s);let y=s?u[t]:void 0;if(y?(y.top=o,y.left=c,y.width=f,y.height=_,y.collapsed=v,y.node=e):u[t]={top:o,left:c,width:f,height:_,collapsed:v,node:e},a&&n){let e=i===!1?0:40,r=o+e,a=c,l=f>0?f:0,u=_>e?_-e:0,p=s?d[n]:void 0;p?(p.top=r,p.left=a,p.width=l,p.height=u,p.groupId=t,p.visible=!0,p.floating=!1,p.zOrder=0):d[n]={top:r,left:a,width:l,height:u,groupId:t,visible:!0,floating:!1,zOrder:0}}}else{ke(l,e.id,p,m,h,g,s);for(let n=0;n<e.children.length;n++)t(e.children[n])}}return t(e),f.length>0&&(f.length=0),y(),c}function x(e,t,n,r,a,c){if(!e)return;if(ke(l,e.id,t,n,r,a,s),e.type===`group`){let{id:i,isContentsRootGroup:o,edgeSlot:c,collapsed:l,views:f,activeViewId:p,showHeader:m}=e,h=!o&&(!!l||!!(c&&f.length===0)||r<=1||a<=1),g=!h&&v>0?t+v:t,_=!h&&v>0?n+v:n,y=!h&&v>0?Math.max(0,r-v*2):r,b=!h&&v>0?Math.max(0,a-v*2):a,x=s?u[i]:void 0;if(x?(x.top=g,x.left=_,x.width=y,x.height=b,x.collapsed=h,x.node=e):u[i]={top:g,left:_,width:y,height:b,collapsed:h,node:e},!h&&p){let e=+(v>0),t=m===!1?0:40,n=g+t+(t===0?e:0),r=_+e,a=y>e*2?y-e*2:0,o=b>t+e*(t===0?2:1)?b-t-e*(t===0?2:1):0,c=s?d[p]:void 0;c?(c.top=n,c.left=r,c.width=a,c.height=o,c.groupId=i,c.visible=!0,c.floating=!1,c.zOrder=0):d[p]={top:n,left:r,width:a,height:o,groupId:i,visible:!0,floating:!1,zOrder:0}}return}let p=e.children,m=p.length;if(m===0)return;let h=e.orientation===`horizontal`,g=h?r:a,y=c<Ee?c*De:0,b=0,S=0,C=0,w=0,T=-1;for(let e=0;e<m;e++){let t=p[e],n=y+e,r=ee(t);if(I[n]=+!!r,r)L[n]=0;else{b++;let r=t.size||200,i=r>40?r:40;S+=i;let a=!!t.constraints?.fixed;L[n]=+!!a,a?C++:w+=i,T=e}}if(b===0||e.collapsed&&!e.isContentsStage){for(let e=0;e<m;e++)x(p[e],t,n,0,0,c+1);return}let E=C>0&&C<b,D=S||1,O=g/b,k=0,A=0;for(let t=0;t<m;t++){let n=y+t;if(I[n]===1){R[n]=0,z[n]=0,B[n]=0;continue}let r=p[t],i=te(r,e.orientation,o),a=i<O?i:O,s=Math.min(g,ne(r,e.orientation,o,i)),c=s>a?s:a;if(z[n]=a,B[n]=c,E&&L[n]===1){let e=r.size||200,t=e>40?e:40;t<a&&(t=a),t>c&&(t=c),R[n]=t,A+=t,k+=t}}let j=E?Math.max(0,g-A):g,re=w||1;for(let e=0;e<m;e++){let t=y+e;if(I[t]===1||E&&L[t]===1)continue;let n=p[e].size||200,r=n>40?n:40,i=z[t],a=B[t],o=E?r/re*j:r/D*g;o<i&&(o=i),o>a&&(o=a),R[t]=o,k+=o}for(let e=0;e<2;e++){let e=g-k;if(e>.5){let t=0,n=!1;if(E){for(let e=0;e<m;e++){let n=y+e;if(I[n]===1||L[n]===1)continue;let r=B[n]-R[n];r>0&&(t+=r)}t>0&&(n=!0)}if(!n){t=0;for(let e=0;e<m;e++){let n=y+e;if(I[n]===1)continue;let r=B[n]-R[n];r>0&&(t+=r)}}if(t<=0)break;let r=e<t?e:t;k=0;for(let e=0;e<m;e++){let i=y+e;if(I[i]!==1){if(!n||L[i]===0){let e=B[i]-R[i];e>0&&(R[i]+=e/t*r)}k+=R[i]}}}else if(e<-.5){let t=-e,n=0,r=!1;if(E){for(let e=0;e<m;e++){let t=y+e;if(I[t]===1||L[t]===1)continue;let r=R[t]-z[t];r>0&&(n+=r)}n>0&&(r=!0)}if(!r){n=0;for(let e=0;e<m;e++){let t=y+e;if(I[t]===1)continue;let r=R[t]-z[t];r>0&&(n+=r)}}if(n<=0)break;let i=t<n?t:n;k=0;for(let e=0;e<m;e++){let t=y+e;if(I[t]!==1){if(!r||L[t]===0){let e=R[t]-z[t];e>0&&(R[t]-=e/n*i)}k+=R[t]}}}else break}let M=0;for(let e=0;e<m;e++){let t=y+e;if(I[t]===1)continue;let n=Math.max(0,Math.round(R[t]));R[t]=n,M+=n}let N=g-M;if(N!==0&&T!==-1){let e=-1;if(E)for(let t=m-1;t>=0;t--){let n=y+t;if(I[n]===1||L[n]===1)continue;let r=R[n];if(N>0&&r+N<=B[n]||N<0&&r+N>=z[n]){e=t;break}}if(e===-1){e=T;for(let t=m-1;t>=0;t--){let n=y+t;if(I[n]===1)continue;let r=R[n];if(N>0&&r+N<=B[n]||N<0&&r+N>=z[n]){e=t;break}}}let t=y+e,n=R[t]+N;R[t]=n>0?n:0}let ie=h?n:t,P=Math.max(Te,i),F=P/2;for(let i=0;i<m;i++){let o=p[i],l=I[y+i]===1,u=l?0:R[y+i];if(h?x(o,t,ie,u,a,c+1):x(o,ie,n,r,u,c+1),!l){let c=-1;for(let e=i+1;e<m;e++)if(I[y+e]===0){c=e;break}if(c!==-1){let l=h?t:ie+u-F,d=h?ie+u-F:n,m=h?P:r,g=h?a:P,v=`sash-${e.id}-${i}-${c}`,y=p[c].id;if(s&&_<f.length){let t=f[_];t.id=v,t.splitId=e.id,t.orientation=e.orientation,t.beforeId=o.id,t.afterId=y,t.rect.top=l,t.rect.left=d,t.rect.width=m,t.rect.height=g}else{let t={id:v,splitId:e.id,orientation:e.orientation,beforeId:o.id,afterId:y,rect:{top:l,left:d,width:m,height:g}};_<f.length?f[_]=t:f.push(t)}_++}}ie+=u}}return x(e,p,m,h,g,0),f.length>_&&(f.length=_),y(),c}function je(e,t,n,r,i,a){if(!t)return;let o=/* @__PURE__ */ new Set;function s(e){if(e.type===`group`)for(let t=0;t<e.views.length;t++)o.add(e.views[t]);else for(let t=0;t<e.children.length;t++)s(e.children[t])}if(s(e),n)for(let e=0;e<n.length;e++){let t=n[e];for(let e=0;e<t.views.length;e++)o.add(t.views[e])}if(a)for(let e=0;e<a.length;e++)o.add(a[e]);let c={},l=!1;for(let e in t)r[e]||o.has(e)?(c[e]=t[e],l=!0):i&&i(e);return l?c:void 0}function Me(e){if(!e)return;let t={},n=!1;for(let r in e){let i=e[r];if(!i||typeof i!=`object`)continue;let a={...i};a.icon!==void 0&&typeof a.icon!=`string`&&delete a.icon,t[r]=a,n=!0}return n?t:void 0}function Ne(e,t=`1`,n,r){let{rootGrid:i,themeId:a,edgeBars:o,activeGroupId:s,floatingGroups:c,runtimeViews:l}=e,u=i;if(n&&n.length>0)for(let e=0;e<n.length;e++){let t=n[e];t&&(u=se(u,t,r).rootGrid)}let d={__reddokiaSnapshot:!0,version:String(t),themeId:a,edgeBars:o,activeGroupId:s,rootGrid:u,floatingGroups:c,runtimeViews:Me(l)};return JSON.stringify(d,null,2)}function Pe(e,t){let{baseViews:n,fallbackTreeFactory:r,defaultThemeId:i,defaultActiveGroupId:a,existingState:o,hasDirectDynamicComponent:s}=t;try{let t=typeof e==`string`?JSON.parse(e):e;if(!t||typeof t!=`object`)return null;let{rootGrid:c,runtimeViews:l,floatingGroups:u,themeId:d,edgeBars:f,activeGroupId:p}=t;if(c&&typeof c==`object`){if(c.type!==`split`)return null;let e=P(c,!0,r),t=e&&e.type===`split`?e:null;if(!t)return null;let m=new Set(Object.keys(n)),h;if(l&&typeof l==`object`)for(let e in l){let t=l[e];if(!t)continue;let r=!!n[e],i=!!(t.templateId&&n[t.templateId]),a=!!(s&&s(e));if(r||i||a){h||={};let n={...t};n.icon!==void 0&&typeof n.icon!=`string`&&delete n.icon,h[e]=n,m.add(e)}}let g=Ce(t,m,r),_;if(Array.isArray(u)){let e=[];for(let t=0;t<u.length;t++){let n=u[t];if(!n||!Array.isArray(n.views))continue;let r=n.views.filter(e=>m.has(e));r.length>0&&e.push({...n,views:r,activeViewId:n.activeViewId&&r.includes(n.activeViewId)?n.activeViewId:r[0]})}e.length>0&&(_=e)}return{themeId:d||o?.themeId||i,edgeBars:{left:!!(f?.left??o?.edgeBars?.left??!0),right:!!(f?.right??o?.edgeBars?.right??!0),...f?.showLabels!==void 0||o?.edgeBars?.showLabels!==void 0?{showLabels:!!(f?.showLabels??o?.edgeBars?.showLabels??!1)}:{}},activeGroupId:p||o?.activeGroupId||a,maximizedGroupId:null,rootGrid:g,floatingGroups:_,runtimeViews:h?je(g,h,_,n):void 0}}}catch{}return null}var Fe={pinnedTooltip:`고정됨 (클릭하여 고정 해제)`,dirtyClosableTooltip:`저장되지 않은 변경사항 (클릭하여 닫기)`,dirtyTooltip:`저장되지 않은 변경사항`,closeTabTooltip:`탭 닫기`,overflowTabsTooltip:`열려 있는 전체 탭 목록 보기`,restoreGroupTooltip:`그룹 크기 복원 (Restore Group)`,collapsePanelTooltip:`패널 접기`,lockedGroupTooltip:`외부 탭 드롭 잠금 활성화됨 (Locked Group)`,emptyContentsMessage:`열려 있는 탭이 없습니다`,emptyContentsSubMessage:`탭을 이곳으로 드래그하거나, emptyContents 옵션으로 이 화면을 자유롭게 커스텀하세요.`,sashResizeTooltip:`드래그하여 크기 조절 · 더블클릭하여 균등 분할`,pinTab:`탭 고정 (Pin Tab)`,unpinTab:`탭 고정 해제 (Unpin Tab)`,closeTab:`탭 닫기 (Close)`,closeOtherTabs:`다른 탭 모두 닫기 (Close Others)`,closeTabsToRight:`우측 탭 모두 닫기 (Close to the Right)`,closeSavedTabs:`저장된 탭 모두 닫기 (Close Saved)`,closeAllTabs:`이 그룹의 모든 탭 닫기 (Close All)`,splitRightMove:`우측으로 분할 이동`,splitDownMove:`하단으로 분할 이동`,redockToGrid:`그리드로 다시 도킹 (Re-dock)`,redockGroupToGrid:`이 플로팅 창 전체 그리드로 도킹 (Re-dock All)`,floatWindow:`플로팅 창으로 분리 (Float)`,floatGroupWindow:`이 그룹 전체 플로팅 창으로 분리 (Float Group)`,popoutWindow:`새 브라우저 창으로 팝아웃 (Pop-out)`,popoutGroupWindow:`이 그룹 전체 팝아웃 창으로 분리 (Pop-out Group)`,maximizeRestoreGroup:`그룹 최대화 / 복원`,collapsePanel:`패널 접기`,lockGroup:`그룹 잠금 (Lock Group)`,unlockGroup:`그룹 잠금 해제 (Unlock Group)`,redockToMainWindow:`메인 창으로 복귀 (Re-dock)`,redockToEdgeBar:`에지바로 다시 도킹`,floatingResizeTooltip:`드래그하여 플로팅 창 크기 조절 (8방향 지원)`,edgeHide:`숨기기`,edgeMoveTo:`다음으로 이동`,edgeShowToolWindowNames:`도구 창 이름 표시`,edgeSlotLeftTop:`왼쪽 맨 위`,edgeSlotLeftBottom:`왼쪽 맨 아래`,edgeSlotBottomLeft:`맨 아래 왼쪽`,edgeSlotBottomRight:`맨 아래 오른쪽`,edgeSlotRightBottom:`오른쪽 맨 아래`,edgeSlotRightTop:`오른쪽 맨 위`},Ie={pinnedTooltip:`Pinned (Click to unpin)`,dirtyClosableTooltip:`Unsaved changes (Click to close)`,dirtyTooltip:`Unsaved changes`,closeTabTooltip:`Close Tab`,overflowTabsTooltip:`Show all open tabs`,restoreGroupTooltip:`Restore Group`,collapsePanelTooltip:`Collapse Panel`,lockedGroupTooltip:`External tab drop locked (Locked Group)`,emptyContentsMessage:`No open tabs`,emptyContentsSubMessage:`Drag a tab here, or customize this screen using the emptyContents option.`,sashResizeTooltip:`Drag to resize · Double-click to equalize`,pinTab:`Pin Tab`,unpinTab:`Unpin Tab`,closeTab:`Close`,closeOtherTabs:`Close Others`,closeTabsToRight:`Close to the Right`,closeSavedTabs:`Close Saved`,closeAllTabs:`Close All`,splitRightMove:`Move & Split Right`,splitDownMove:`Move & Split Down`,redockToGrid:`Re-dock to Grid`,redockGroupToGrid:`Re-dock All Tabs to Grid`,floatWindow:`Float Window`,floatGroupWindow:`Float Entire Group`,popoutWindow:`Pop-out to Browser Window`,popoutGroupWindow:`Pop-out Entire Group`,maximizeRestoreGroup:`Maximize / Restore Group`,collapsePanel:`Collapse Panel`,lockGroup:`Lock Group`,unlockGroup:`Unlock Group`,redockToMainWindow:`Re-dock to Main Window`,redockToEdgeBar:`Dock Back to EdgeBar`,floatingResizeTooltip:`Drag to resize Floating Window (8-way)`,edgeHide:`Hide`,edgeMoveTo:`Move to`,edgeShowToolWindowNames:`Show Tool Window Names`,edgeSlotLeftTop:`Left Top`,edgeSlotLeftBottom:`Left Bottom`,edgeSlotBottomLeft:`Bottom Left`,edgeSlotBottomRight:`Bottom Right`,edgeSlotRightBottom:`Right Bottom`,edgeSlotRightTop:`Right Top`},Le={ko:Fe,en:Ie,ja:{pinnedTooltip:`ピン留め済み(クリックして解除)`,dirtyClosableTooltip:`未保存の変更あり(クリックして閉じる)`,dirtyTooltip:`未保存の変更あり`,closeTabTooltip:`タブを閉じる`,overflowTabsTooltip:`開いているすべてのタブを表示`,restoreGroupTooltip:`グループサイズを復元 (Restore Group)`,collapsePanelTooltip:`パネルを折りたたむ`,lockedGroupTooltip:`外部タブドロップがロックされています (Locked Group)`,emptyContentsMessage:`開いているタブはありません`,emptyContentsSubMessage:`タブをここにドラッグするか、emptyContents オプションでこの画面をカスタマイズできます。`,sashResizeTooltip:`ドラッグしてサイズ調整 · ダブルクリックで均等分割`,pinTab:`タブをピン留め (Pin Tab)`,unpinTab:`ピン留めを解除 (Unpin Tab)`,closeTab:`閉じる (Close)`,closeOtherTabs:`他のタブをすべて閉じる (Close Others)`,closeTabsToRight:`右側のタブをすべて閉じる (Close to the Right)`,closeSavedTabs:`保存済みのタブをすべて閉じる (Close Saved)`,closeAllTabs:`このグループのタブをすべて閉じる (Close All)`,splitRightMove:`右へ分割して移動`,splitDownMove:`下へ分割して移動`,redockToGrid:`グリッドに再ドッキング (Re-dock)`,redockGroupToGrid:`このフローティングウィンドウをすべて再ドッキング (Re-dock All)`,floatWindow:`フローティングウィンドウに分離 (Float)`,floatGroupWindow:`グループ全体をフローティングに分離 (Float Group)`,popoutWindow:`新しいブラウザウィンドウへポップアウト (Pop-out)`,popoutGroupWindow:`グループ全体をポップアウト (Pop-out Group)`,maximizeRestoreGroup:`グループの最大化 / 元に戻す`,collapsePanel:`パネルを折りたたむ`,lockGroup:`グループをロック (Lock Group)`,unlockGroup:`グループのロックを解除 (Unlock Group)`,redockToMainWindow:`メインウィンドウへ戻す (Re-dock)`,redockToEdgeBar:`エッジバーへ再ドッキング`,floatingResizeTooltip:`ドラッグしてフローティングウィンドウをリサイズ(8方向対応)`,edgeHide:`非表示`,edgeMoveTo:`移動先`,edgeShowToolWindowNames:`ツールウィンドウ名を表示`,edgeSlotLeftTop:`左上`,edgeSlotLeftBottom:`左下`,edgeSlotBottomLeft:`下側・左`,edgeSlotBottomRight:`下側・右`,edgeSlotRightBottom:`右下`,edgeSlotRightTop:`右上`}};function Re(e){for(let t in e){let n=e[t];if(typeof n==`object`&&n)return!0}return!1}function ze(e=`en`,t){let n=Le[e]||Ie;if(!t)return n;if(Re(t)){let r=t[e];return r?{...n,...r}:n}return{...n,...t}}var Be={dark:{id:`dark`,islandGap:5},light:{id:`light`,islandGap:5}};function V(e,t){if(e.length===0)return e;let n=[...e].sort((e,n)=>{if(t){if(e.id===t&&n.id!==t)return 1;if(n.id===t&&e.id!==t)return-1}return(e.zOrder||0)-(n.zOrder||0)}),r=!1,i=n.map((e,t)=>{let n=t+1;return e.zOrder===n?e:(r=!0,{...e,zOrder:n})});if(!r)return e;let a=new Map(i.map(e=>[e.id,e]));return e.map(e=>a.get(e.id)??e)}function H(e,t,n){let r=!1,i=[];for(let a=0;a<e.length;a++){let o=e[a],s=o.views&&o.views.length>0?o.views:[o.viewId],c=s.indexOf(t);if(c===-1){i.push(o);continue}r=!0;let l=s.filter(e=>e!==t);if(l.length===0)continue;let u=o.viewId===t?ce(l,c,n)||l[0]:o.viewId;i.push({...o,viewId:u,views:l})}return r?i:e}function Ve(e,t){if(!e||e.length===0)return e||[];let n=!1,r=[];for(let i=0;i<e.length;i++){let a=e[i];if(a.views.indexOf(t)===-1){r.push(a);continue}n=!0;let o=a.views.filter(e=>e!==t);o.length!==0&&r.push({...a,views:o,activeViewId:a.activeViewId===t?o[0]||null:a.activeViewId})}return n?r:e}function He(e,t){if(e.type===`group`)for(let n=0;n<e.views.length;n++)t.add(e.views[n]);else for(let n=0;n<e.children.length;n++)He(e.children[n],t)}function Ue(e,t,n){if(e.length===0)return e;let{rootGrid:r,floatingGroups:i=[]}=t,a=/* @__PURE__ */ new Set;He(r,a);for(let e=0;e<i.length;e++){let t=i[e].views;for(let e=0;e<t.length;e++)a.add(t[e])}let o=e;for(let t=0;t<e.length;t++){let{views:r,viewId:i}=e[t],s=r&&r.length>0?r:[i];for(let e=0;e<s.length;e++){let t=s[e];a.has(t)&&(o=H(o,t,n))}}return o}function We(e){return e?e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[-_]+/g,` `).trim().replace(/\b\w/g,e=>e.toUpperCase()):`View`}function Ge(e){if(e.length===0)return j();let t=e.map(e=>e.id);return O({contents:{id:`group-contents-1`,size:1e3,children:t,activeViewId:t[0]||null}})}function Ke(e){return!e||!Array.isArray(e)?[]:e.map(e=>{let{id:t,title:n}=e;return n?e:{...e,title:We(t)}})}function qe(e,t){return e?O(e):Ge(Ke(t))}function U(e){let t=[];function n(e){if(e.type===`group`)t.push(e);else for(let t=0;t<e.children.length;t++)n(e.children[t])}return n(e),t}function W(e,t){if(e.type===`group`)return e.views.includes(t)?e:null;for(let n=0;n<e.children.length;n++){let r=W(e.children[n],t);if(r)return r}return null}function G(e,t){function n(e,t){if(e.type===`group`)return e.id===t?e:null;for(let r=0;r<e.children.length;r++){let i=n(e.children[r],t);if(i)return i}return null}let r=n(e,t);if(r)return r;if(e.type===`split`){let r=k(e,t);if(r!==t)return n(e,r)}return null}function Je(e,t,n){let r=A(e);function i(e,r=null){if(e.type===`group`)return(!n||e.id===n)&&e.views.includes(t)?(e.activeViewId=t,e.collapsed=!1,r&&(r.collapsed=!1),!0):!1;for(let t=0;t<e.children.length;t++)if(i(e.children[t],e))return!0;return!1}return i(r,null),r}function Ye(e,t,n){let r=G(e,t);return!r||!!r.collapsed===n?e:F(e,t)}function Xe(e,t){let n=A(e),r=G(n,t);return r&&(r.locked=!r.locked),n}var Ze=class{#e;#t;#n=[];#r=[];#i=/* @__PURE__ */ new Set;#a=/* @__PURE__ */ new Map;#o=0;#s=void 0;#c=-1;#l=void 0;#u=null;#d=null;#f=null;#p=void 0;#m=void 0;#h=null;#g=null;#_=void 0;#v=null;#y=null;#b=null;#x={width:1280,height:800};#S=null;#C;#w=null;#T=Oe();#E=/* @__PURE__ */ new Set;constructor(e){this.#e=e,this.#t=this.#M(e),this.#P(),this.#F(),this.#C=this.#U()}get options(){return this.#e}get layoutState(){return this.#t}set layoutState(e){this.#t=e}get popoutWindows(){return this.#n}get mruViewIds(){return this.#r}get everMountedViewIds(){return this.#i}get dynamicRegisteredSchemas(){return this.#a}get containerSize(){return this.#x}set containerSize(e){this.#x=e}get contextMenu(){return this.#S}set contextMenu(e){this.#S=e}setExternalDragStarter(e){this.#w=e}prepareExternalViewPatch(e){let{viewId:t,templateId:n,title:r,icon:i,params:a}=e;if(!t||n===void 0&&r===void 0&&i===void 0&&a===void 0)return;let o=this.#t.runtimeViews?.[t];this.#t={...this.#t,runtimeViews:{...this.#t.runtimeViews||{},[t]:{...o,...n===void 0?{}:{templateId:n},...r===void 0?{}:{title:r},...i===void 0?{}:{icon:i},...a===void 0?{}:{params:a}}}}}get controller(){return this.#C}#D=()=>qe(this.#e.layout,this.#e.views);getFallbackTreeFactory(){return this.#D}#O(){return Ke(this.#e.views)}#k(){let e={},t=this.#O();for(let n=0;n<t.length;n++){let r=t[n];e[r.id]=r}return e}getActiveTopBarSchema(e=this.#e){let t=this.#b;if(t&&typeof t==`object`&&`topBar`in t){let e=t.topBar;return e?e===!0?{}:e:null}let n=e.layout;if(n&&typeof n==`object`&&`topBar`in n){let e=n.topBar;return e?e===!0?{}:e:null}return null}getActiveStatusBarSchema(e=this.#e){let t=this.#b;if(t&&typeof t==`object`&&`statusBar`in t){let e=t.statusBar;return e?e===!0?{}:e:null}let n=e.layout;if(n&&typeof n==`object`&&`statusBar`in n){let e=n.statusBar;return e?e===!0?{}:e:null}return null}isTopBarEnabled(e=this.#e){return this.getActiveTopBarSchema(e)!==null}getActiveEmptyContentsRenderer(e=this.#e){let t=e=>{if(e&&typeof e==`object`){if(`emptyContents`in e&&e.emptyContents)return e.emptyContents;if(`contents`in e){let t=e.contents;if(t&&typeof t==`object`&&!Array.isArray(t)&&`emptyContents`in t&&t.emptyContents)return t.emptyContents}}};return t(this.#b)??t(e.layout)}#A(e){let t=e||this.#t?.rootGrid;return t?U(t).some(e=>!(!e.edgeSlot?.startsWith(`left`)&&e.edgeSlot!==`bottom-left`||!e.edgeBar)):!1}#j(e){let t=e||this.#t?.rootGrid;return t?U(t).some(e=>!(!e.edgeSlot?.startsWith(`right`)&&e.edgeSlot!==`bottom-right`||!e.edgeBar)):!1}#M(e){let{theme:t,layout:n,views:r,storageKey:i}=e,a=t||`dark`,o=()=>qe(n,r),s=o(),c=this.#A(s),l=this.#j(s),u=U(s),d=(u.find(e=>e.isContentsRootGroup||!e.edgeBar&&!e.edgeSlot)||u[0])?.id||`group-contents-1`;if(i&&typeof localStorage<`u`)try{let e=localStorage.getItem(i);if(e){let t={},n=Ke(r);for(let e=0;e<n.length;e++)t[n[e].id]=n[e];let i=Pe(e,{baseViews:t,fallbackTreeFactory:o,defaultThemeId:a,defaultActiveGroupId:d});if(i)return i}}catch{}return{themeId:a,edgeBars:{left:c,right:l},activeGroupId:d,maximizedGroupId:null,rootGrid:s,floatingGroups:[],runtimeViews:{}}}subscribe(e){return this.#E.add(e),()=>{this.#E.delete(e)}}notify(){for(let e of this.#E)e()}updateOptions(e){let t=this.#e;this.#e={...t,...e};let n=!1;if(e.theme!==void 0&&e.theme!==t.theme&&e.theme!==this.#t.themeId&&(this.#t={...this.#t,themeId:e.theme},n=!0),e.layout!==t.layout){let e=this.#A(this.#t.rootGrid),t=this.#j(this.#t.rootGrid);this.#t={...this.#t,edgeBars:{...this.#t.edgeBars,left:e,right:t}},n=!0}e.locale!==void 0&&e.locale!==t.locale&&(this.#y=null,n=!0),(e.views!==t.views||e.layout!==t.layout||e.themeTokens!==t.themeTokens||e.themes!==t.themes||e.locale!==t.locale||e.groupActions!==t.groupActions||e.tabContextMenu!==t.tabContextMenu||e.localeStrings!==t.localeStrings||e.popoutFavicon!==t.popoutFavicon||e.className!==t.className||e.style!==t.style)&&(n=!0),n&&(this.#P(),this.notify())}getActiveLocale(){return this.#y??this.#e.locale??`en`}resolveGroupActions(e){if(e){let t=this.getViewsMap().get(e)?.groupActions;if(t!==void 0)return t}return this.#e.groupActions}getLocaleStrings(){let e=this.getActiveLocale(),t=this.#e.localeStrings;if(this.#v&&this.#g===e&&this.#_===t)return this.#v;let n=ze(e,t);return this.#g=e,this.#_=t,this.#v=n,n}getActiveTheme(){let{themeId:e}=this.#t,{themeTokens:t,themes:n}=this.#e;if(this.#h&&this.#f===e&&this.#p===t&&this.#m===n)return this.#h;let r=n?.[e],i=r?.base??(e===`light`?`light`:`dark`),a={...Be[i]||Be.dark,...t??{},...r??{},id:e,base:i};return this.#f=e,this.#p=t,this.#m=n,this.#h=a,a}getViewsMap(){let e=this.#e.views,t=this.#o,n=this.#t.runtimeViews;if(this.#u&&this.#s===e&&this.#c===t&&this.#l===n)return this.#u;let r=/* @__PURE__ */ new Map,i=this.#O();for(let e=0;e<i.length;e++){let t=i[e];r.set(t.id,t)}for(let[e,t]of this.#a.entries()){let n=r.get(e);r.set(e,n?{...n,...t}:t)}if(n)for(let e in n){let t=n[e];if(!t)continue;let i=r.get(e)||(t.templateId?r.get(t.templateId):void 0),a={};for(let e in t){let n=t[e];n!==void 0&&(a[e]=n)}i?r.set(e,{...i,...a,id:e,params:t.params===void 0?i.params:{...i.params||{},...t.params}}):r.set(e,{id:e,title:t.title||e,...a})}return this.#s=e,this.#c=t,this.#l=n,this.#u=r,this.#d=null,r}getViewsRecord(){let e=this.getViewsMap();if(this.#d)return this.#d;let t={};for(let[n,r]of e)t[n]=r;return this.#d=t,t}getAllGroups(){return U(this.layoutState.rootGrid)}getEdgeGroups(){return Se(this.layoutState.rootGrid)}getActiveGroup(){let e=this.getAllGroups();return e.find(e=>e.id===this.layoutState.activeGroupId)||e[0]}#N(){return(this.#t.floatingGroups||[]).find(e=>e.id===this.#t.activeGroupId)||null}getActiveViewId(){let e=this.#N();return e?e.activeViewId||e.views[0]||null:this.getActiveGroup()?.activeViewId||null}solveGeometry(){let{islandGap:e}=this.getActiveTheme(),t=this.getViewsRecord(),{rootGrid:n,maximizedGroupId:r,floatingGroups:i}=this.layoutState,{width:a,height:o}=this.containerSize;return Ae(n,{top:0,left:0,width:a,height:o},this.#T,r,e,i||[],t)}activateGroup(e){this.setLayoutState(t=>{let n=G(t.rootGrid,e),r=n?n.id:e;return t.activeGroupId===r?t:{...t,activeGroupId:r}})}#P(){let e=this.getViewsMap();for(let[t,n]of e.entries())n.eagerMount&&this.#i.add(t);let t=this.getAllGroups();for(let e=0;e<t.length;e++){let n=t[e];!n.collapsed&&n.activeViewId&&this.#i.add(n.activeViewId)}let n=this.#t.floatingGroups||[];for(let e=0;e<n.length;e++){let t=n[e],r=t.activeViewId||t.views[0];r&&this.#i.add(r)}for(let e=0;e<this.#n.length;e++){let t=this.#n[e],n=t.views&&t.views.length>0?t.views:[t.viewId];for(let e=0;e<n.length;e++)this.#i.add(n[e])}}#F(){let e=this.getActiveViewId();e&&!this.#r.includes(e)&&(this.#r=[e,...this.#r].slice(0,24))}#I(e){e&&this.#r[0]!==e&&(this.#r=[e,...this.#r.filter(t=>t!==e)].slice(0,24))}#L(){let e=[];for(let t=0;t<this.#n.length;t++){let n=this.#n[t],r=n.views&&n.views.length>0?n.views:[n.viewId];for(let t=0;t<r.length;t++)e.push(r[t])}return e}#R(e,t,n){let r=this.#k(),i=this.#L(),a=je(e,t,n,r,e=>{this.#a.delete(e)&&this.#o++,this.#i.delete(e)},i),o=new Set(i),s=e=>{if(e.type===`group`)for(let t=0;t<e.views.length;t++)o.add(e.views[t]);else for(let t=0;t<e.children.length;t++)s(e.children[t])};if(s(e),n)for(let e=0;e<n.length;e++)for(let t=0;t<n[e].views.length;t++)o.add(n[e].views[t]);for(let e of Array.from(this.#a.keys()))!r[e]&&!o.has(e)&&this.#i.has(e)&&(this.#a.delete(e)&&this.#o++,this.#i.delete(e));return a}#z(e){if(this.#e.storageKey&&typeof localStorage<`u`)try{let t=Ne(e,`1`,this.#L(),this.getFallbackTreeFactory());localStorage.setItem(this.#e.storageKey,t)}catch{}}setLayoutState(e){let t=this.#t,n=typeof e==`function`?e(t):e;n!==t&&(this.#t=n,this.#n=Ue(this.#n,n,this.#r),this.#P(),this.#I(this.getActiveViewId()),this.#z(n),this.notify(),this.#e.onLayoutChange?.(n))}setPopoutWindows(e){let t=typeof e==`function`?e(this.#n):e;t!==this.#n&&(this.#n=t,this.#P(),this.#z(this.#t),this.notify())}setContainerSize(e,t){if(e<=0||t<=0||this.#x.width===e&&this.#x.height===t)return;this.#x={width:e,height:t};let n=this.#t.floatingGroups;if(n&&n.length>0){let r=Math.max(180,e-16),i=Math.max(120,t-16),a=!1;for(let o=0;o<n.length;o++){let s=n[o],c=Math.min(s.width,r),l=Math.min(s.height,i),u=Math.max(0,e-c),d=Math.max(0,t-l),f=Math.max(0,Math.min(s.left,u)),p=Math.max(0,Math.min(s.top,d));if(c!==s.width||l!==s.height||f!==s.left||p!==s.top){a=!0;break}}if(a){let a=n.map(n=>{let a=Math.min(n.width,r),o=Math.min(n.height,i),s=Math.max(0,e-a),c=Math.max(0,t-o),l=Math.max(0,Math.min(n.left,s)),u=Math.max(0,Math.min(n.top,c));return a===n.width&&o===n.height&&l===n.left&&u===n.top?n:{...n,left:l,top:u,width:a,height:o}});this.#t={...this.#t,floatingGroups:a}}}this.notify()}#B(){let e=/* @__PURE__ */ new Set;for(let[t,n]of this.getViewsMap().entries())(n.pinned||n.closable===!1)&&e.add(t);return e}getPinnedViewIdsSet(){let e=/* @__PURE__ */ new Set;for(let[t,n]of this.getViewsMap().entries())n.pinned&&e.add(t);return e}requestCloseView(e){let t=this.getViewsMap().get(e);if(t?.closable===!1||t?.pinned)return;let n=()=>{this.popoutWindows.find(t=>(t.views&&t.views.length>0?t.views:[t.viewId]).includes(e))?this.setPopoutWindows(t=>H(t,e,this.mruViewIds)):this.setLayoutState(t=>{let n=t.floatingGroups||[],r=n.find(t=>t.views.includes(e)),i=n,a=t.rootGrid;if(r){let t=r.views.filter(t=>t!==e);i=t.length===0?n.filter(e=>e.id!==r.id):n.map(n=>n.id===r.id?{...n,views:t,activeViewId:n.activeViewId===e?t[t.length-1]||null:n.activeViewId}:n)}else{let n=W(t.rootGrid,e),r=n?.edgeSlot===`left-top`||n?.edgeSlot===`left-bottom`||n?.edgeSlot===`bottom-left`,i=n?.edgeSlot===`right-top`||n?.edgeSlot===`right-bottom`||n?.edgeSlot===`bottom-right`,o=r&&t.edgeBars.left||i&&t.edgeBars.right;a=n&&o&&n.views.length===1&&n.views[0]===e?n.collapsed?t.rootGrid:F(t.rootGrid,n.id):le(t.rootGrid,e,j,this.mruViewIds,this.#B())}let o=this.#R(a,t.runtimeViews,i);return{...t,rootGrid:a,floatingGroups:i,runtimeViews:o}})},r=t?.onBeforeClose??this.options.onBeforeCloseView;if(!r)n();else try{let i=r(e,t);i&&typeof i.then==`function`?i.then(e=>{e!==!1&&n()}).catch(()=>{}):i!==!1&&n()}catch{}}toggleEdgeSlot(e){this.setLayoutState(t=>({...t,rootGrid:ae(t.rootGrid,e)}))}activateTabInEdgeSlot(e,t){let n=this.getEdgeGroups(),r={"left-top":n.leftTopEdgeBar,"left-bottom":n.leftBottomEdgeBar,"right-top":n.rightTopEdgeBar,"right-bottom":n.rightBottomEdgeBar,"bottom-left":n.bottomLeftEdgeBar,"bottom-right":n.bottomRightEdgeBar}[e];r&&this.setLayoutState(e=>{let n=oe(e.rootGrid,r.id,t),i=G(n,r.id),a=!(!i||i.collapsed);return{...e,activeGroupId:a?r.id:e.activeGroupId,rootGrid:n}})}toggleEdgeBar(e){let{leftCol:t,leftTopEdgeBar:n,leftBottomEdgeBar:r,rightCol:i,rightTopEdgeBar:a,rightBottomEdgeBar:o,bottomRow:s,bottomLeftEdgeBar:c,bottomRightEdgeBar:l}=this.getEdgeGroups();if(e===`left`){let e=t||n||r;e&&this.setLayoutState(t=>({...t,rootGrid:F(t.rootGrid,e.id)}))}else if(e===`right`){let e=i||a||o;e&&this.setLayoutState(t=>({...t,rootGrid:F(t.rootGrid,e.id)}))}else{let e=s||c||l;e&&this.setLayoutState(t=>({...t,rootGrid:F(t.rootGrid,e.id)}))}}toggleMaximizeGroup(e){let t=e||this.layoutState.activeGroupId;if((this.layoutState.floatingGroups||[]).some(e=>e.id===t))return;let n=G(this.layoutState.rootGrid,t),r=n?n.id:t;this.setLayoutState(e=>({...e,activeGroupId:r,maximizedGroupId:e.maximizedGroupId===r?null:r}))}resetLayout(){this.#b=null,this.setLayoutState(e=>{let t=qe(this.#e.layout,this.#e.views),n=this.#A(t),r=this.#j(t),i=U(t),a=i.find(e=>e.isContentsRootGroup||!e.edgeBar&&!e.edgeSlot)||i[0];return this.#R(t,e.runtimeViews,[]),{...e,edgeBars:{...e.edgeBars,left:n,right:r},activeGroupId:a?.id||`group-contents-1`,maximizedGroupId:null,rootGrid:t,floatingGroups:[],runtimeViews:{}}}),this.setPopoutWindows([])}setLayout(e){e&&(this.#b=e,this.setLayoutState(t=>{let n=O(e),r=this.#A(n),i=this.#j(n),a=U(n),o=a.find(e=>e.isContentsRootGroup||!e.edgeBar&&!e.edgeSlot)||a[0];return{...t,edgeBars:{...t.edgeBars,left:r,right:i},activeGroupId:o?.id||t.activeGroupId,maximizedGroupId:null,rootGrid:n,floatingGroups:[]}}))}splitGroupWithView(e,t,n){let r=G(this.layoutState.rootGrid,e);r&&!r.locked&&(r.views.includes(t)&&r.views.length<=1||this.setLayoutState(r=>{let i=_e(r.rootGrid,t,e,n,this.getFallbackTreeFactory());return{...r,activeGroupId:i.activeGroupId,maximizedGroupId:null,rootGrid:i.rootGrid}}))}#V(e,t,n,r,i,a){let o=this.containerSize.width,s=this.containerSize.height,c=o>0&&s>0,l=c?Math.max(n,Math.round(o*.75)):1/0,u=c?Math.max(r,Math.round(s*.8)):1/0,d,f;if(e&&c&&(a?.width===void 0||a?.height===void 0)){let t=this.solveGeometry().groupRects[e];t&&t.width>=60&&t.height>=60&&(d=Math.round(t.width),f=Math.round(t.height))}let p=t===`left-top`||t===`left-bottom`||t===`right-top`||t===`right-bottom`,m=t===`bottom-left`||t===`bottom-right`,h=p?320:m?520:440,g=p?440:m?260:320,_=a?.width??d??h,v=a?.height??f??g,y=a?.width===void 0?Math.max(n,Math.min(l,Math.round(_))):Math.max(n,Math.round(_)),b=a?.height===void 0?Math.max(r,Math.min(u,Math.round(v))):Math.max(r,Math.round(v)),x=i%5,S=Math.max(16,Math.round((o-y)/2)+x*24),C=Math.max(16,Math.round((s-b)/2)+x*24),w=a?.left??S,T=a?.top??C;return a?.left===void 0&&c&&(w=Math.max(8,Math.min(w,Math.max(8,o-y-8)))),a?.top===void 0&&c&&(T=Math.max(8,Math.min(T,Math.max(8,s-b-8)))),{left:w,top:T,width:y,height:b}}floatView(e,t){let n=this.getViewsMap().get(e);n&&(this.setPopoutWindows(t=>H(t,e,this.mruViewIds)),this.setLayoutState(r=>{let i=r.floatingGroups||[],a=i.find(t=>t.views.includes(e));if(a){let n=i.map(n=>n.id===a.id?{...n,activeViewId:e,left:t?.left??n.left,top:t?.top??n.top,width:t?.width??n.width,height:t?.height??n.height}:n);return{...r,activeGroupId:a.id,floatingGroups:V(n,a.id)}}let o=W(r.rootGrid,e),s=o?.edgeSlot,c=!(!o||!o.edgeBar&&!o.edgeSlot||o.collapsed||o.activeViewId!==e),l=this.#V(o?.id,s,n.minWidth||260,n.minHeight||180,i.length,t),u=le(r.rootGrid,e,j,this.mruViewIds,this.#B());c&&o&&(u=Ye(u,o.id,!0));let d=i.reduce((e,t)=>Math.max(e,t.zOrder||0),0),f={id:`float_${e}_${Date.now().toString(36)}`,left:l.left,top:l.top,width:l.width,height:l.height,views:[e],activeViewId:e,zOrder:d+1,...s?{originEdgeSlot:s}:{}};return{...r,activeGroupId:f.id,rootGrid:u,floatingGroups:V([...i,f],f.id)}}))}floatGroup(e,t){let n=G(this.layoutState.rootGrid,e);if(!n||n.locked||n.edgeBar||n.edgeSlot||n.views.length===0)return;let r=[...n.views];if(this.#n.length>0){let e=this.#n;for(let t=0;t<r.length;t++)e=H(e,r[t],this.mruViewIds);this.#n=e}this.setLayoutState(n=>{let r=we(n.rootGrid,e,j);if(r.extractedViews.length===0)return n;let i=n.floatingGroups||[],a=this.#V(e,void 0,260,180,i.length,t),o=i.reduce((e,t)=>Math.max(e,t.zOrder||0),0),s={id:`float_grp_${e}_${Date.now().toString(36)}`,left:a.left,top:a.top,width:a.width,height:a.height,views:r.extractedViews,activeViewId:r.extractedActiveViewId,zOrder:o+1};return{...n,activeGroupId:s.id,maximizedGroupId:n.maximizedGroupId===e?null:n.maximizedGroupId,rootGrid:r.rootGrid,floatingGroups:V([...i,s],s.id)}})}#H(e,t,n){if(t)return t;if(n){let t=G(e,n);if(t&&!t.edgeBar&&!t.edgeSlot&&!t.locked)return t.id}let r=U(e);return(r.find(e=>!e.edgeBar&&!e.edgeSlot&&!e.locked&&e.isContentsRootGroup)||r.find(e=>!e.edgeBar&&!e.edgeSlot&&!e.locked))?.id}redockFloatingView(e,t){this.setLayoutState(n=>{let r=n.floatingGroups||[],i=r.find(t=>t.views.includes(e)),a=i?i.views.length<=1?r.filter(e=>e.id!==i.id):r.map(t=>{if(t.id!==i.id)return t;let n=t.views.filter(t=>t!==e);return{...t,views:n,activeViewId:t.activeViewId===e?n[0]||null:t.activeViewId}}):r,o=this.#H(n.rootGrid,t,n.activeGroupId),s=se(n.rootGrid,e,this.getFallbackTreeFactory(),o);return{...n,activeGroupId:s.activeGroupId||n.activeGroupId,rootGrid:s.rootGrid,floatingGroups:a}})}redockFloatingGroup(e,t){let n=(this.layoutState.floatingGroups||[]).find(t=>t.id===e);n&&this.setLayoutState(r=>{let i=(r.floatingGroups||[]).filter(t=>t.id!==e),a=r.rootGrid,o=null;if(!t&&n.originEdgeSlot){let e=n.originEdgeSlot;for(let t=0;t<n.views.length;t++){let r=ve(a,n.views[t],e,this.getFallbackTreeFactory());a=r.rootGrid,r.activeGroupId&&(o=r.activeGroupId)}}else{o=this.#H(r.rootGrid,t,r.activeGroupId);for(let e=0;e<n.views.length;e++){let t=se(a,n.views[e],this.getFallbackTreeFactory(),o);a=t.rootGrid,t.activeGroupId&&(o=t.activeGroupId)}}return n.activeViewId&&o&&(a=Je(a,n.activeViewId,o)),{...r,activeGroupId:o||r.activeGroupId,rootGrid:a,floatingGroups:i}})}popoutView(e,t){if(!this.getViewsMap().get(e))return;let n=(this.layoutState.floatingGroups||[]).find(t=>t.views.includes(e)),r=n?null:W(this.layoutState.rootGrid,e),i=n?.originEdgeSlot??r?.edgeSlot;this.setPopoutWindows(n=>[...H(n,e,this.mruViewIds),{id:`popout_${e}_${Date.now().toString(36)}`,viewId:e,views:[e],width:t?.width??760,height:t?.height??540,...i?{originEdgeSlot:i}:{}}]),this.setLayoutState(t=>{let n=t.floatingGroups||[],r=n.find(t=>t.views.includes(e)),i=r?r.views.length<=1?n.filter(e=>e.id!==r.id):n.map(t=>{if(t.id!==r.id)return t;let n=t.views.filter(t=>t!==e);return{...t,views:n,activeViewId:t.activeViewId===e?n[0]||null:t.activeViewId}}):n,a=r?null:W(t.rootGrid,e),o=!(!a||!a.edgeBar&&!a.edgeSlot||a.collapsed||a.activeViewId!==e),s=le(t.rootGrid,e,j,this.mruViewIds,this.#B());return o&&a&&(s=Ye(s,a.id,!0)),{...t,rootGrid:s,floatingGroups:i}})}popoutGroup(e,t){let n=(this.layoutState.floatingGroups||[]).find(t=>t.id===e),r=G(this.layoutState.rootGrid,e),i=n?[...n.views]:r&&!r.locked&&!r.edgeBar&&!r.edgeSlot?[...r.views]:[];if(i.length===0)return;let a=(n?n.activeViewId:r?.activeViewId)||i[0],o=n?.originEdgeSlot;this.setPopoutWindows(n=>{let r=n;for(let e=0;e<i.length;e++)r=H(r,i[e],this.mruViewIds);return[...r,{id:`popout_grp_${e}_${Date.now().toString(36)}`,viewId:a,views:i,width:t?.width??820,height:t?.height??580,...o?{originEdgeSlot:o}:{}}]}),this.setLayoutState(t=>{if(n)return{...t,floatingGroups:(t.floatingGroups||[]).filter(t=>t.id!==e)};let r=t.rootGrid,a=this.#B();for(let e=0;e<i.length;e++)r=le(r,i[e],j,this.mruViewIds,a);return{...t,maximizedGroupId:t.maximizedGroupId===e?null:t.maximizedGroupId,rootGrid:r}})}redockPopoutGroup(e,t){let n=this.popoutWindows.find(t=>(t.id||t.viewId)===e||(t.views&&t.views.length>0?t.views:[t.viewId]).includes(e)),r=n?n.views&&n.views.length>0?n.views:[n.viewId]:[e],i=n?.viewId||e,a=n?.originEdgeSlot;this.setPopoutWindows(t=>t.filter(t=>t!==n&&(t.id||t.viewId)!==e&&t.viewId!==e)),this.setLayoutState(e=>{let n=e.rootGrid,o=null;if(!t&&a)for(let e=0;e<r.length;e++){let t=ve(n,r[e],a,this.getFallbackTreeFactory());n=t.rootGrid,t.activeGroupId&&(o=t.activeGroupId)}else{o=this.#H(e.rootGrid,t,e.activeGroupId);for(let e=0;e<r.length;e++){let t=se(n,r[e],this.getFallbackTreeFactory(),o);n=t.rootGrid,t.activeGroupId&&(o=t.activeGroupId)}}return o&&(n=Je(n,i,o)),{...e,activeGroupId:o||e.activeGroupId,rootGrid:n}})}redockPopoutView(e,t){let n=this.popoutWindows.find(t=>(t.views&&t.views.length>0?t.views:[t.viewId]).includes(e))?.originEdgeSlot;this.setPopoutWindows(t=>H(t,e,this.mruViewIds)),this.setLayoutState(r=>{if(!t&&n){let t=ve(r.rootGrid,e,n,this.getFallbackTreeFactory());return{...r,activeGroupId:t.activeGroupId||r.activeGroupId,rootGrid:t.rootGrid}}let i=this.#H(r.rootGrid,t,r.activeGroupId),a=se(r.rootGrid,e,this.getFallbackTreeFactory(),i);return{...r,activeGroupId:a.activeGroupId||r.activeGroupId,rootGrid:a.rootGrid}})}activatePopoutTab(e,t){this.setPopoutWindows(n=>n.map(n=>(n.id||n.viewId)===e?{...n,viewId:t}:n))}moveViewToEdgeSlot(e,t){this.setLayoutState(n=>{let r=W(n.rootGrid,e);if(r?.edgeSlot===t)return n;let i=!(!r||!r.edgeBar&&!r.edgeSlot||r.collapsed||r.activeViewId!==e),a=ve(n.rootGrid,e,t,j),o=a.rootGrid;i&&r&&r.id!==a.activeGroupId&&(o=Ye(o,r.id,!0));let s=Ve(n.floatingGroups,e);return{...n,activeGroupId:a.activeGroupId||n.activeGroupId,rootGrid:o,floatingGroups:s}})}setEdgeBarLabelsVisible(e){let t=!!e;!!this.layoutState.edgeBars.showLabels!==t&&this.setLayoutState(e=>({...e,edgeBars:{...e.edgeBars,showLabels:t}}))}#U(){return{openView:(e,t)=>{let n=typeof t==`string`?{targetGroupId:t}:t||{},{component:r,targetGroupId:i,templateId:a,title:o,icon:s,badge:c,closable:l,dirty:u,pinned:d,minWidth:f,maxWidth:p,minHeight:m,maxHeight:h,params:g}=n;if(r){let t=this.getViewsMap().get(e);this.#a.set(e,{...t||{id:e,title:o||e},...n,id:e,title:o||t?.title||e}),this.#o+=1}let _=a!==void 0||o!==void 0||s!==void 0||c!==void 0||l!==void 0||u!==void 0||d!==void 0||f!==void 0||p!==void 0||m!==void 0||h!==void 0||g!==void 0;this.setPopoutWindows(t=>H(t,e,this.mruViewIds)),this.setLayoutState(t=>{let n={...t.runtimeViews||{}};if(_){let t=n[e]||{},r={};a!==void 0&&(r.templateId=a),o!==void 0&&(r.title=o),s!==void 0&&(r.icon=s),c!==void 0&&(r.badge=c),l!==void 0&&(r.closable=l),u!==void 0&&(r.dirty=u),d!==void 0&&(r.pinned=d),f!==void 0&&(r.minWidth=f),p!==void 0&&(r.maxWidth=p),m!==void 0&&(r.minHeight=m),h!==void 0&&(r.maxHeight=h),g!==void 0&&(r.params=g),n[e]={...t,...r}}let r=t.floatingGroups||[],v=r.find(t=>t.views.includes(e));if(v&&!i){let i=r.map(t=>t.id===v.id?{...t,activeViewId:e}:t);return{...t,activeGroupId:v.id,floatingGroups:V(i,v.id),runtimeViews:n}}let y=se(t.rootGrid,e,this.getFallbackTreeFactory(),i||t.activeGroupId),b=y.rootGrid,x=y.activeGroupId||t.activeGroupId;if(d){let t=this.getPinnedViewIdsSet();t.add(e),b=be(b,x,e,0,this.getFallbackTreeFactory(),t)}return{...t,activeGroupId:x,rootGrid:b,runtimeViews:n}})},updateView:(e,t)=>{this.setLayoutState(n=>{let r={...n.runtimeViews?.[e]||{},...t},i=n.rootGrid;if(t.pinned!==void 0){let r=W(n.rootGrid,e);if(r){let a=this.getPinnedViewIdsSet();t.pinned?a.add(e):a.delete(e),i=be(n.rootGrid,r.id,e,t.pinned?0:r.views.length,this.getFallbackTreeFactory(),a)}}return{...n,rootGrid:i,runtimeViews:{...n.runtimeViews||{},[e]:r}}})},registerView:(e,t)=>{let{id:n,templateId:r,title:i,icon:a,badge:o,closable:s,dirty:c,pinned:l,minWidth:u,maxWidth:d,minHeight:f,maxHeight:p,params:m}=e;this.#a.set(n,e),this.#o++,t?.open?this.controller.openView(n,{targetGroupId:t.targetGroupId,templateId:r,title:i,icon:a,badge:o,closable:s,dirty:c,pinned:l,minWidth:u,maxWidth:d,minHeight:f,maxHeight:p,params:m}):(this.#P(),this.notify())},togglePinView:e=>{let t=!this.getViewsMap().get(e)?.pinned;this.controller.updateView(e,{pinned:t})},closeView:e=>{this.requestCloseView(e)},closeOtherViews:(e,t)=>{let n=this.#B(),r=e||W(this.layoutState.rootGrid,t)?.id||this.layoutState.activeGroupId;this.setLayoutState(e=>{let i=ue(e.rootGrid,r,t,j,n),a=this.#R(i,e.runtimeViews,e.floatingGroups);return{...e,rootGrid:i,runtimeViews:a}})},closeViewsToRight:(e,t)=>{let n=this.#B(),r=e||W(this.layoutState.rootGrid,t)?.id||this.layoutState.activeGroupId;this.setLayoutState(e=>{let i=de(e.rootGrid,r,t,j,n,this.mruViewIds),a=this.#R(i,e.runtimeViews,e.floatingGroups);return{...e,rootGrid:i,runtimeViews:a}})},closeSavedViews:e=>{let t=this.#B(),n=new Set(t);for(let[e,t]of this.getViewsMap().entries())t.dirty&&n.add(e);let r=e||this.layoutState.activeGroupId;this.setLayoutState(e=>{let i=fe(e.rootGrid,r,j,n,this.mruViewIds,t),a=this.#R(i,e.runtimeViews,e.floatingGroups);return{...e,rootGrid:i,runtimeViews:a}})},closeAllViews:e=>{let t=this.#B(),n=e||this.layoutState.activeGroupId;this.setLayoutState(e=>{let r=pe(e.rootGrid,n,j,t,this.mruViewIds),i=this.#R(r,e.runtimeViews,e.floatingGroups);return{...e,rootGrid:r,runtimeViews:i}})},splitGroup:(e,t,n)=>{let r=e?G(this.layoutState.rootGrid,e):this.getActiveGroup();if(!r||r.locked)return;let i=n||r.activeViewId||r.views[r.views.length-1];if(!i)return;let a=t===`horizontal`?`right`:`bottom`;this.splitGroupWithView(r.id,i,a)},dockViewToGroup:(e,t,n)=>{this.setLayoutState(r=>{let i=_e(r.rootGrid,e,t,n,this.getFallbackTreeFactory());return{...r,activeGroupId:i.activeGroupId,rootGrid:i.rootGrid}})},floatView:(e,t)=>{this.floatView(e,t)},floatGroup:(e,t)=>{let n=e||this.layoutState.activeGroupId;this.floatGroup(n,t)},redockFloatingView:(e,t)=>{this.redockFloatingView(e,t)},redockFloatingGroup:(e,t)=>{this.redockFloatingGroup(e,t)},popoutView:(e,t)=>{this.popoutView(e,t)},popoutGroup:(e,t)=>{let n=e||this.layoutState.activeGroupId;this.popoutGroup(n,t)},getPopoutViewIds:()=>this.#L(),redockPopoutView:(e,t)=>{this.redockPopoutView(e,t)},redockPopoutGroup:(e,t)=>{this.redockPopoutGroup(e,t)},setGroupOptions:(e,t)=>{this.setLayoutState(n=>{let r=A(n.rootGrid),i=G(r,e);return i&&(t.showHeader!==void 0&&(i.showHeader=t.showHeader),t.locked!==void 0&&(i.locked=t.locked)),{...n,rootGrid:r}})},toggleCollapseGroup:e=>{this.setLayoutState(t=>({...t,rootGrid:F(t.rootGrid,e)}))},toggleLockGroup:e=>{let t=e||this.layoutState.activeGroupId;this.setLayoutState(e=>({...e,rootGrid:Xe(e.rootGrid,t)}))},toggleEdgeSlot:e=>{this.toggleEdgeSlot(e)},toggleEdgeBar:e=>{this.toggleEdgeBar(e)},moveViewToEdgeSlot:(e,t)=>{this.moveViewToEdgeSlot(e,t)},setEdgeBarLabelsVisible:e=>{this.setEdgeBarLabelsVisible(e)},toggleMaximizeGroup:e=>{this.toggleMaximizeGroup(e)},resetLayout:()=>{this.resetLayout()},setLayout:e=>{this.setLayout(e)},startExternalDrag:(e,t)=>{this.#w?.(e,t)},setTheme:e=>{this.setLayoutState(t=>({...t,themeId:e}))},getTheme:()=>this.#t.themeId||`dark`,setLocale:e=>{this.#y=e,this.notify()},getLocale:()=>this.getActiveLocale(),exportLayoutJson:()=>Ne(this.#t,`1`,this.#L(),this.getFallbackTreeFactory()),importLayoutJson:e=>{let t=Pe(e,{baseViews:this.#k(),fallbackTreeFactory:this.getFallbackTreeFactory(),defaultThemeId:this.#e.theme||`dark`,defaultActiveGroupId:this.#t.activeGroupId,existingState:this.#t,hasDirectDynamicComponent:e=>this.#a.has(e)});return t?(this.setLayoutState(t),!0):!1},getLayoutState:()=>this.#t}}destroy(){this.#E.clear()}},Qe={AppWindow:`AppWindow`,ArrowRightToLine:`ArrowRightToLine`,Check:`Check`,CheckCircle2:`CheckCircle2`,ChevronDown:`ChevronDown`,ChevronRight:`ChevronRight`,Columns:`Columns`,EdgeSlotBottomLeft:`EdgeSlotBottomLeft`,EdgeSlotBottomRight:`EdgeSlotBottomRight`,EdgeSlotLeftBottom:`EdgeSlotLeftBottom`,EdgeSlotLeftTop:`EdgeSlotLeftTop`,EdgeSlotRightBottom:`EdgeSlotRightBottom`,EdgeSlotRightTop:`EdgeSlotRightTop`,ExternalLink:`ExternalLink`,Layers:`Layers`,Layout:`Layout`,Lock:`Lock`,Maximize2:`Maximize2`,Minimize2:`Minimize2`,Minus:`Minus`,Pin:`Pin`,PinOff:`PinOff`,Rows:`Rows`,Terminal:`Terminal`,Trash2:`Trash2`,Unlock:`Unlock`,X:`X`,XCircle:`XCircle`},$e={AppWindow:[[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`}],[`path`,{d:`M10 4v4`}],[`path`,{d:`M2 8h20`}],[`path`,{d:`M6 4v4`}]],ArrowRightToLine:[[`path`,{d:`M17 12H3`}],[`path`,{d:`m11 18 6-6-6-6`}],[`path`,{d:`M21 5v14`}]],Check:[[`path`,{d:`M20 6 9 17l-5-5`}]],CheckCircle2:[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`m16 9-5.5 5.5L8 12`}]],ChevronDown:[[`path`,{d:`m6 9 6 6 6-6`}]],ChevronRight:[[`path`,{d:`m9 18 6-6-6-6`}]],Columns:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M12 3v18`}]],EdgeSlotLeftTop:[[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`3`}],[`rect`,{x:`5.5`,y:`5.5`,width:`5`,height:`7.5`,rx:`1`,fill:`currentColor`,stroke:`none`}]],EdgeSlotLeftBottom:[[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`3`}],[`rect`,{x:`5.5`,y:`11`,width:`5`,height:`7.5`,rx:`1`,fill:`currentColor`,stroke:`none`}]],EdgeSlotBottomLeft:[[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`3`}],[`rect`,{x:`5.5`,y:`13.5`,width:`7.5`,height:`5`,rx:`1`,fill:`currentColor`,stroke:`none`}]],EdgeSlotBottomRight:[[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`3`}],[`rect`,{x:`11`,y:`13.5`,width:`7.5`,height:`5`,rx:`1`,fill:`currentColor`,stroke:`none`}]],EdgeSlotRightBottom:[[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`3`}],[`rect`,{x:`13.5`,y:`11`,width:`5`,height:`7.5`,rx:`1`,fill:`currentColor`,stroke:`none`}]],EdgeSlotRightTop:[[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`3`}],[`rect`,{x:`13.5`,y:`5.5`,width:`5`,height:`7.5`,rx:`1`,fill:`currentColor`,stroke:`none`}]],ExternalLink:[[`path`,{d:`M15 3h6v6`}],[`path`,{d:`M10 14 21 3`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`}]],Layers:[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`}]],Layout:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M3 9h18`}],[`path`,{d:`M9 21V9`}]],Lock:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`}]],Maximize2:[[`path`,{d:`M15 3h6v6`}],[`path`,{d:`m21 3-7 7`}],[`path`,{d:`m3 21 7-7`}],[`path`,{d:`M9 21H3v-6`}]],Minimize2:[[`path`,{d:`m14 10 7-7`}],[`path`,{d:`M20 10h-6V4`}],[`path`,{d:`m3 21 7-7`}],[`path`,{d:`M4 14h6v6`}]],Minus:[[`path`,{d:`M5 12h14`}]],Pin:[[`path`,{d:`M12 17v5`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`}]],PinOff:[[`path`,{d:`M12 17v5`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`}],[`path`,{d:`m2 2 20 20`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`}]],Rows:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M3 12h18`}]],Terminal:[[`path`,{d:`M12 19h8`}],[`path`,{d:`m4 17 6-6-6-6`}]],Trash2:[[`path`,{d:`M10 11v6`}],[`path`,{d:`M14 11v6`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`}],[`path`,{d:`M3 6h18`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`}]],Unlock:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`}],[`path`,{d:`M7 11V7a5 5 0 0 1 9.9-1`}]],X:[[`path`,{d:`M18 6 6 18`}],[`path`,{d:`m6 6 12 12`}]],XCircle:[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`m15 9-6 6`}],[`path`,{d:`m9 9 6 6`}]]},et=`http://www.w3.org/2000/svg`,tt=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" fill="none"><defs><linearGradient id="rd-dock" x1="2" y1="8" x2="60" y2="62" gradientUnits="userSpaceOnUse"><stop offset="0%" stop-color="#4A608A"/><stop offset="100%" stop-color="#2D3C59"/></linearGradient><linearGradient id="rd-portal" x1="26" y1="2" x2="62" y2="38" gradientUnits="userSpaceOnUse"><stop offset="0%" stop-color="#FF4747"/><stop offset="100%" stop-color="#FD9466"/></linearGradient></defs><path d="M2 17C2 12.0294 6.02944 8 11 8H32V30C32 32.7614 34.2386 35 37 35H60V53C60 57.9706 55.9706 62 51 62H11C6.02944 62 2 57.9706 2 53V17Z" fill="url(#rd-dock)" stroke="#647EB0" stroke-width="3"/><path d="M13 42V51H22" stroke="#CBD5E1" stroke-width="4.2" stroke-linecap="round" stroke-linejoin="round"/><rect x="23" y="5" width="38" height="38" rx="10.5" fill="#090C14" fill-opacity="0.5"/><rect x="26" y="2" width="36" height="36" rx="9.5" fill="url(#rd-portal)"/><rect x="27" y="3" width="34" height="34" rx="8.5" stroke="#FFFFFF" stroke-opacity="0.28" stroke-width="2"/><rect x="33.5" y="9.5" width="15.5" height="5" rx="2.5" fill="#FFFFFF" fill-opacity="0.95"/></svg>`,nt=/\.(?:svg|png|webp|jpe?g|gif|avif|ico)(?:[?#].*)?$/i;function rt(e){let t=e.trim();return t?t.startsWith(`/`)||t.startsWith(`./`)||t.startsWith(`../`)||t.startsWith(`http://`)||t.startsWith(`https://`)||t.startsWith(`data:image/`)||t.startsWith(`blob:`)?!0:nt.test(t):!1}function it(e){let t=e.trim();return t.startsWith(`<svg`)&&t.toLowerCase().endsWith(`</svg>`)}function at(e){if(e==null||e===!1||e===!0)return!1;if(typeof e==`string`){let t=e.trim();return t?Object.prototype.hasOwnProperty.call($e,t)||rt(t)||it(t):!1}return typeof e==`function`?!0:typeof e==`object`?typeof Node<`u`&&e instanceof Node||!!e.$$typeof:!1}var ot=/* @__PURE__ */ new WeakMap;function st(e){let t=ot.get(e);return t||(t=/* @__PURE__ */ new Map,ot.set(e,t)),t}function K(e,t=`rd-view-svg-icon`,n){let r=n??(typeof document<`u`?document:void 0);if(!r)return null;let i=e.trim(),a=$e[i];if(a){let e=st(r),n=e.get(i);if(!n){n=r.createElementNS(et,`svg`),n.setAttribute(`xmlns`,et),n.setAttribute(`width`,`24`),n.setAttribute(`height`,`24`),n.setAttribute(`viewBox`,`0 0 24 24`),n.setAttribute(`fill`,`none`),n.setAttribute(`stroke`,`currentColor`),n.setAttribute(`stroke-width`,`2`),n.setAttribute(`stroke-linecap`,`round`),n.setAttribute(`stroke-linejoin`,`round`),n.setAttribute(`aria-hidden`,`true`);for(let e=0;e<a.length;e++){let[t,i]=a[e],o=r.createElementNS(et,t);for(let e in i)o.setAttribute(e,i[e]);n.appendChild(o)}e.set(i,n)}let o=n.cloneNode(!0);return t&&o.setAttribute(`class`,t),o}if(it(i)){let e=st(r),n=`inline:${i}`,a=e.get(n);if(!a){let t=r.createElement(`template`);t.innerHTML=i;let o=t.content.querySelector(`svg`);if(!o)return null;o.querySelectorAll(`script, foreignObject`).forEach(e=>e.remove());let s=[o,...Array.from(o.querySelectorAll(`*`))];for(let e=0;e<s.length;e++){let t=s[e];for(let e of Array.from(t.attributes))e.name.toLowerCase().startsWith(`on`)&&t.removeAttribute(e.name)}o.setAttribute(`aria-hidden`,`true`),e.set(n,o),a=o}let o=a.cloneNode(!0);if(t){let e=o.getAttribute(`class`);o.setAttribute(`class`,e?`${e} ${t}`:t)}return o}if(rt(i)){let e=r.createElement(`img`);return e.src=i,e.alt=``,e.draggable=!1,e.setAttribute(`aria-hidden`,`true`),t&&(e.className=t),e}return null}function ct(e,t=16){let n=e.trim(),r=$e[n];if(r){let e=``;for(let t=0;t<r.length;t++){let[n,i]=r[t],a=``;for(let[e,t]of Object.entries(i))a+=` ${e}="${t}"`;e+=`<${n}${a}/>`}return`<svg xmlns="${et}" width="${t}" height="${t}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${e}</svg>`}return it(n)?n:``}var lt=class{#e;#t;#n;#r=null;#i=null;#a=null;#o=null;#s=``;constructor(e,t,n){this.#e=e,this.#t=t,this.#n=n}sync(e,t){this.#c(e,t)}#c(e,t){let n=t?.hitTarget;if(t&&n&&n.kind!==`none`&&n.kind!==`tab-bar`){this.#r||(this.#r=document.createElement(`div`),this.#r.className=`rd-drop-preview`,this.#n.appendChild(this.#r));let{kind:r,groupId:i,zone:a,previewRect:o}=n,{top:s,left:c,width:l,height:u}=o,{sourceGroupId:d}=t,f=i?e.groupRects[i]?.node.views.length??0:0,p=r===`group-zone`&&i===d&&(a===`center`||f<=1);this.#r.style.top=`${s}px`,this.#r.style.left=`${c}px`,this.#r.style.width=`${l}px`,this.#r.style.height=`${u}px`,this.#r.style.borderStyle=r===`tear-off-float`||p?`dashed`:`solid`,this.#r.style.borderColor=r===`root-zone`?`var(--rd-accent-secondary)`:`var(--rd-accent)`,this.#r.setAttribute(`data-preview-mode`,p?`noop`:r===`tear-off-float`?`float`:r===`root-zone`?`root`:`dock`)}else this.#r&&=(this.#r.remove(),null);if(t&&(n?.kind===`tab-bar`||t.pinHorizontal&&n?.kind===`edge-slot`)&&t.pinLeft!==void 0&&t.pinTop!==void 0){let{pinHorizontal:e,pinLeft:r,pinTop:i,pinSpan:a}=t,o=e?this.#t:this.#n;if(this.#i)this.#i.parentElement!==o&&o.appendChild(this.#i);else{this.#i=document.createElement(`div`),this.#i.className=`rd-tab-insert-pin`,this.#i.style.position=`absolute`,this.#i.style.zIndex=`210`;let e=document.createElement(`span`);e.className=`rd-tab-insert-pin__cap rd-tab-insert-pin__cap--top`;let t=document.createElement(`span`);t.className=`rd-tab-insert-pin__cap rd-tab-insert-pin__cap--bottom`,this.#i.appendChild(e),this.#i.appendChild(t),o.appendChild(this.#i)}this.#i.style.left=`${r}px`,this.#i.style.top=`${i}px`,e?(this.#i.style.width=`${a||30}px`,this.#i.style.height=`2px`):(this.#i.style.width=`2px`,this.#i.style.height=`${n.previewRect.height||28}px`)}else this.#i&&=(this.#i.remove(),null);if(t&&!t.hideGhost){let{cursorX:e,cursorY:n,viewId:r}=t;if(!this.#a){this.#a=document.createElement(`div`),this.#a.className=`rd-drag-ghost`;let e=K(`AppWindow`,`rd-drag-ghost-svg`);e&&this.#a.appendChild(e),this.#o=document.createElement(`span`),this.#a.appendChild(this.#o),this.#s=``,this.#t.appendChild(this.#a)}this.#a.style.left=`${e+14}px`,this.#a.style.top=`${n+14}px`;let i=t.ghostTitle||this.#e.getViewsMap().get(r)?.title||r;this.#o&&i!==this.#s&&(this.#o.textContent=i,this.#s=i)}else this.#a&&(this.#a.remove(),this.#a=null,this.#o=null,this.#s=``)}destroy(){this.#r?.remove(),this.#i?.remove(),this.#a?.remove()}};function ut(e,t){if(t.parentElement===e)return;let n=e;if(typeof n.moveBefore==`function`&&e.ownerDocument===t.ownerDocument&&t.isConnected)try{n.moveBefore(t,null);return}catch{}e.appendChild(t)}function dt(e){if(e&&typeof e.scrollIntoView==`function`)try{e.scrollIntoView({block:`nearest`,inline:`nearest`,container:`nearest`})}catch{}}function ft(e,t,n=`rd-view-svg-icon`,r,i){if(at(t)){if(typeof t==`string`){let r=K(t,n,i);r&&e.appendChild(r)}else if(typeof Node<`u`&&t instanceof Node){let n=t.cloneNode(!0);e.appendChild(n)}else if(r){let a=(i??document).createElement(`span`);a.className=`rd-custom-icon-slot`,a.style.display=`inline-flex`,a.style.alignItems=`center`,e.appendChild(a);let o=r(a,t,n);return typeof o==`function`?o:void 0}}}function pt(e,t,n,r=``){let i=document.createElement(`button`);i.type=`button`,i.className=r?`rd-group-action-btn ${r}`:`rd-group-action-btn`,i.title=t;let a=K(e,`rd-group-action-svg`);return a&&i.appendChild(a),i.addEventListener(`click`,e=>{e.stopPropagation(),n()}),i}function mt(e,t,n){let{id:r,base:i,shellBg:a,topBarBg:o,edgeBarBg:s,groupHeaderBg:c,contentsBg:l,panelBg:u,border:d,accent:f,accentSecondary:p,textMain:m,textMuted:h,tabActiveBg:g,islandRadius:_,fontSans:v,fontMono:y,warning:b,danger:x}=t;e.setAttribute(`data-reddokia-theme`,r),e.setAttribute(`data-reddokia-base-theme`,i??(r===`light`?`light`:`dark`));let S=(t,n)=>{n?e.style.setProperty(t,n):e.style.removeProperty(t)};if(S(`--rd-shell-bg`,a),S(`--rd-topbar-bg`,o),S(`--rd-edgebar-bg`,s),S(`--rd-group-header-bg`,c),S(`--rd-contents-bg`,l),S(`--rd-panel-bg`,u),S(`--rd-border`,d),S(`--rd-accent`,f),S(`--rd-accent-secondary`,p),S(`--rd-text-main`,m),S(`--rd-text-muted`,h),S(`--rd-tab-active-bg`,g),S(`--rd-island-radius`,_),S(`--rd-font-sans`,v),S(`--rd-font-mono`,y),S(`--rd-warning`,b),S(`--rd-danger`,x),n)for(let[t,r]of Object.entries(n))r!=null&&(t.startsWith(`--`)?e.style.setProperty(t,String(r)):e.style[t]=String(r))}function ht(e,t,n){if(typeof e!=`function`)return;let r=e(t,n);if(typeof Node<`u`&&r instanceof Node&&r!==t)t.appendChild(r);else if(typeof r==`string`)t.innerHTML=r;else return r}var gt=class{#e=void 0;#t=!1;#n=null;#r=null;get mountedRef(){return this.#e}sync(e,t,n,r,i){if(!t)this.teardown();else if(this.#e!==t){this.teardown(),e.innerHTML=``,this.#e=t;let a;i&&(typeof t==`object`||typeof t==`function`)?(this.#t=!0,a=i(t,e,r)):typeof t==`function`&&(this.#t=!1,a=ht(t,e,n)),typeof a==`function`?this.#n=a:a&&typeof a==`object`&&(this.#r=typeof a.update==`function`?a.update.bind(a):null,this.#n=typeof a.unmount==`function`?a.unmount.bind(a):null)}else this.#r&&this.#r(this.#t?r:n)}teardown(){this.#n&&=(this.#n(),null),this.#r=null,this.#e=void 0,this.#t=!1}};function _t(e,t){let{title:n,icon:r,badge:i,pinned:a,dirty:o,isClosable:s,localeStrings:c,customIconBridge:l,doc:u=document,fallbackIconName:d,resolveRelativeImageUrl:f=!1,closeIconClass:p=`rd-icon-sm`,onClose:m,onTogglePin:h}=t,g;if(f){if(typeof r==`string`&&rt(r.trim())){let t=u.createElement(`img`);try{t.src=new URL(r.trim(),window.location.href).href}catch{t.src=r.trim()}t.alt=``,t.className=`rd-tab__icon`,t.draggable=!1,e.appendChild(t)}else{let t=typeof r==`string`&&r?r:d;if(t){let n=K(t,`rd-tab__icon`,u);n&&e.appendChild(n)}}}else g=ft(e,r??d,`rd-tab__icon`,l,u);let _=u.createElement(`span`);if(_.className=`rd-tab__title`,_.textContent=n,e.appendChild(_),i!==void 0&&i!==``){let t=u.createElement(`span`);t.className=`rd-tab-badge`,t.textContent=String(i),e.appendChild(t)}if(a){if(h){let t=u.createElement(`button`);t.type=`button`,t.className=`rd-tab__btn rd-tab__btn--pin`,t.title=c.pinnedTooltip;let n=K(`Pin`,`rd-icon-xs rd-tab-pin-svg`,u);n&&t.appendChild(n),t.addEventListener(`click`,e=>{e.stopPropagation(),h()}),e.appendChild(t)}else{let t=K(`Pin`,`rd-tab-pin-svg`,u);t&&e.appendChild(t)}}else if(o){if(s){let t=u.createElement(`button`);t.type=`button`,t.className=`rd-tab__btn rd-tab__btn--dirty`,t.title=c.dirtyClosableTooltip;let n=u.createElement(`span`);n.className=`rd-tab__dirty-dot`,t.appendChild(n);let r=K(`X`,`rd-tab__dirty-close-icon`,u);r&&t.appendChild(r),t.addEventListener(`click`,e=>{e.stopPropagation(),m()}),e.appendChild(t)}else{let t=u.createElement(`span`);t.className=`rd-tab__btn`,t.title=c.dirtyTooltip;let n=u.createElement(`span`);n.className=`rd-tab__dirty-dot`,t.appendChild(n),e.appendChild(t)}}else if(s){let t=u.createElement(`button`);t.type=`button`,t.className=`rd-tab__btn rd-tab__btn--close`,t.title=c.closeTabTooltip;let n=K(`X`,p,u);n&&t.appendChild(n),t.addEventListener(`click`,e=>{e.stopPropagation(),m()}),e.appendChild(t)}return g}var vt=class{#e;#t;#n;#r;#i;#a=null;#o=[];#s=``;constructor(e,t,n,r,i){this.#e=e,this.#t=t,this.#n=n,this.#i=r,this.#r=i}sync(e,t){let n=this.#e===`left`,{edgeBars:r}=this.#t.layoutState,i=n?r.left:r.right,{leftTopEdgeBar:a,leftBottomEdgeBar:o,rightTopEdgeBar:s,rightBottomEdgeBar:c,bottomLeftEdgeBar:l,bottomRightEdgeBar:u}=t??this.#t.getEdgeGroups(),d=n?`left-top`:`right-top`,f=n?`left-bottom`:`right-bottom`,p=n?`bottom-left`:`bottom-right`,m=n?a:s,h=n?o:c,g=n?l:u,_=i||m?.collapsed?m:null,v=i||h?.collapsed?h:null,y=i||g?.collapsed?g:null,b=!!(_&&_.views.length>0),x=!!(v&&v.views.length>0),S=!!(y&&y.views.length>0);if(!b&&!x&&!S){this.#a&&=(this.#u(),this.#a.remove(),null),this.#s=``;return}let C=this.#t.getViewsMap(),w=!!r.showLabels,T=this.#c(i,w,_,v,y,C);if(!(this.#a&&T===this.#s&&!this.#i)){if(this.#s=T,this.#u(),this.#a||(this.#a=document.createElement(`aside`),e?this.#n.insertBefore(this.#a,e):this.#n.appendChild(this.#a)),this.#a.className=`rd-edgebar ${n?`rd-edgebar--left`:`rd-edgebar--right`}${w?` rd-edgebar--labeled`:``}`,this.#a.innerHTML=``,this.#a.appendChild(this.#l(d,_,`top`,w)),b&&x){let e=document.createElement(`div`);e.className=`rd-edgebar__sep`,this.#a.appendChild(e)}this.#a.appendChild(this.#l(f,v,`bottom`,w)),this.#a.appendChild(this.#l(p,y,`corner`,w))}}#c(e,t,n,r,i,a){let o=e=>{if(!e||e.views.length===0)return`-`;let t=`${e.id}:${+!!e.collapsed}:${e.activeViewId||``}:`;for(let n=0;n<e.views.length;n++){let r=e.views[n],i=a.get(r),o=typeof i?.icon==`string`?i.icon:i?.icon?`#`:``;t+=`${r},${i?.title||``},${o},${+!!i?.dirty},${i?.badge??``};`}return t};return`${+!!e}:${+!!t}|${o(n)}|${o(r)}|${o(i)}`}#l(e,t,n,r){let i=this.#e===`left`,a=document.createElement(`div`);a.className=`rd-edgebar__bucket${n===`bottom`?` rd-edgebar__bucket--bottom`:n===`corner`?` rd-edgebar__bucket--corner`:``}`,a.setAttribute(`data-edge-slot`,e);let o=this.#t.getViewsMap();if(t&&t.views.length>0){let{id:n,views:s,collapsed:c,activeViewId:l}=t;for(let t=0;t<s.length;t++){let u=s[t],d=o.get(u);if(!d)continue;let{title:f,icon:p,dirty:m,badge:h}=d,g=!c&&l===u,_=document.createElement(`button`);if(_.type=`button`,_.setAttribute(`aria-label`,f||u),_.setAttribute(`aria-expanded`,String(g)),_.setAttribute(`data-edge-slot`,e),_.setAttribute(`data-edge-view-id`,u),_.className=`rd-edgebar__btn${g?` rd-edgebar__btn--active`:``}`,_.title=f||u,g){let e=document.createElement(`span`);e.className=`rd-edgebar__indicator ${i?`rd-edgebar__indicator--left`:`rd-edgebar__indicator--right`}`,_.appendChild(e)}let v=ft(_,p||`AppWindow`,`rd-icon-md`,this.#i);if(v&&this.#o.push(v),r){let e=document.createElement(`span`);e.className=`rd-edgebar__label`,e.textContent=f||u,_.appendChild(e)}if(m){let e=document.createElement(`span`);e.className=`rd-edgebar__dirty-dot`,_.appendChild(e)}if(h!==void 0&&h!==``){let e=document.createElement(`span`);e.className=`rd-edgebar__badge`,e.textContent=String(h),_.appendChild(e)}_.ondragstart=e=>e.preventDefault(),_.addEventListener(`pointerdown`,e=>{e.button===0&&this.#r&&this.#r.startDockDragSession(e,`edge-item`,u,n)}),_.addEventListener(`click`,()=>{this.#r?.consumeClickSuppression()||this.#t.activateTabInEdgeSlot(e,u)}),_.addEventListener(`contextmenu`,t=>{t.preventDefault(),t.stopPropagation(),this.#t.contextMenu={x:t.clientX,y:t.clientY,viewId:u,groupId:n,source:`edgebar`,edgeSlot:e},this.#t.notify()}),a.appendChild(_)}}return a}#u(){for(let e=0;e<this.#o.length;e++)this.#o[e]();this.#o.length=0}destroy(){this.#u(),this.#a&&=(this.#a.remove(),null)}};function q(e){if(!e)return;let t=e.scrollLeft>2,n=e.scrollLeft+e.clientWidth<e.scrollWidth-2,r=t?`true`:`false`,i=n?`true`:`false`;e.getAttribute(`data-can-scroll-left`)!==r&&e.setAttribute(`data-can-scroll-left`,r),e.getAttribute(`data-can-scroll-right`)!==i&&e.setAttribute(`data-can-scroll-right`,i)}function yt(e,t){if(!e||e.scrollWidth<=e.clientWidth)return!1;let n=e.getBoundingClientRect(),r=e.scrollLeft;if(t>=n.left&&t<n.left+36){let i=1-(t-n.left)/36;return e.scrollLeft=Math.max(0,r-Math.ceil(10*i)),q(e),e.scrollLeft!==r}if(t<=n.right&&t>n.right-36){let i=1-(n.right-t)/36,a=Math.max(0,e.scrollWidth-e.clientWidth);return e.scrollLeft=Math.min(a,r+Math.ceil(10*i)),q(e),e.scrollLeft!==r}return!1}var bt=[`n`,`s`,`e`,`w`,`nw`,`ne`,`sw`,`se`],xt=class{#e;#t;#n;#r;#i;#a;#o=/* @__PURE__ */ new Map;#s=/* @__PURE__ */ new Set;#c=/* @__PURE__ */ new Set;#l=[];#u=[];constructor(e,t,n,r,i,a){this.#e=e,this.#t=t,this.#n=n,this.#r=r,this.#i=i,this.#a=a}sync(){this.#f();let e=this.#e.layoutState.floatingGroups||[],t=this.#s;t.clear(),this.#l.length=0;for(let n=0;n<e.length;n++){let r=e[n];t.add(r.id),this.#d(r)}for(let[e,n]of this.#o)t.has(e)||(n.winEl.remove(),this.#o.delete(e));for(let e=0;e<this.#l.length;e++)q(this.#l[e]);this.#l.length=0}#d(e){let{id:t,views:n,activeViewId:r,left:i,top:a,width:o,height:s,zOrder:c}=e,l=this.#o.get(t);if(!l){let e=document.createElement(`div`);e.setAttribute(`data-floating-id`,t),e.setAttribute(`role`,`dialog`),e.addEventListener(`pointerdown`,e=>{e.target.closest(`button, input, .rd-tab`)||this.#n.bringFloatingWindowToFront(t)});let n=document.createElement(`div`);n.className=`rd-floating-header`;let r=document.createElement(`div`);r.className=`rd-tab-list`,r.setAttribute(`role`,`tablist`),r.setAttribute(`data-tab-list-group`,t),r.style.flex=`1`,r.style.minWidth=`0`,r.style.overflowX=`auto`,r.addEventListener(`scroll`,()=>q(r),{passive:!0}),r.addEventListener(`wheel`,e=>{Math.abs(e.deltaY)>Math.abs(e.deltaX)&&(r.scrollLeft+=e.deltaY,q(r))},{passive:!0}),n.appendChild(r);let i=document.createElement(`div`);i.className=`rd-group-actions`,n.appendChild(i);let a=document.createElement(`div`);a.className=`rd-floating-body`,e.appendChild(n),e.appendChild(a);let o=/* @__PURE__ */ new Map;for(let n=0;n<bt.length;n++){let r=bt[n],i=document.createElement(`div`);if(i.className=`rd-floating-resize-handle ${r}`,r===`se`){let e=document.createElement(`span`);e.className=`rd-floating__se-corner`,i.appendChild(e)}i.addEventListener(`pointerdown`,e=>{let n=(this.#e.layoutState.floatingGroups||[]).find(e=>e.id===t);n&&this.#n.handleFloatingResizePointerDown(e,n,r)}),o.set(r,i),e.appendChild(i)}this.#t.appendChild(e),l={winId:t,winEl:e,headerEl:n,tabListEl:r,tabElements:/* @__PURE__ */ new Map,actionsEl:i,bodyEl:a,resizeHandles:o,lastActiveViewId:null},this.#o.set(t,l)}let u=this.#e.getLocaleStrings(),d=this.#e.getViewsMap(),f=r||n[0]||``,p=d.get(f),m=this.#e.layoutState.activeGroupId===t,{winEl:h,headerEl:g,tabListEl:_,tabElements:v,actionsEl:y,bodyEl:b,resizeHandles:x}=l,S=!!e.originEdgeSlot;e.originEdgeSlot?h.setAttribute(`data-origin-edge-slot`,e.originEdgeSlot):h.removeAttribute(`data-origin-edge-slot`),h.setAttribute(`aria-label`,p?.title||`Floating panel ${t}`),h.className=[`rd-floating-window`,S?`rd-floating-window--edge`:``,m?`focused`:``].filter(Boolean).join(` `),h.style.left=`${i}px`,h.style.top=`${a}px`,h.style.width=`${o}px`,h.style.height=`${s}px`,h.style.zIndex=String(80+(c||1)),g.onpointerdown=t=>{this.#n.handleFloatingHeaderPointerDown(t,e)};let C=null,w=!1,T=this.#c;T.clear();for(let e=0;e<n.length;e++){let r=n[e],i=d.get(r);if(!i)continue;T.add(r);let{title:a,icon:o,closable:s,pinned:c,badge:p,dirty:h}=i,g=f===r,y=!c&&(S?s===!0:s!==!1);y&&(w=!0);let b=v.get(r);b||(b=document.createElement(`div`),v.set(r,b)),b.setAttribute(`role`,`tab`),b.setAttribute(`aria-selected`,String(g)),b.setAttribute(`aria-controls`,`rd-tabpanel-${r}`),b.id=`rd-tab-${t}-${r}`,b.tabIndex=g?0:-1,b.setAttribute(`data-tab-view-id`,r);let x=S&&n.length===1;b.className=[`rd-tab`,x?`edgebar-single`:``,g?`active`:``,c?`pinned`:``].filter(Boolean).join(` `),b.title=a;let E=()=>{this.#e.setLayoutState(e=>({...e,activeGroupId:t,floatingGroups:(e.floatingGroups||[]).map(e=>e.id===t?{...e,activeViewId:r}:e)}))},D=()=>{this.#e.requestCloseView(r)};b.onpointerdown=e=>{e.target.closest(`.rd-tab__btn`)||(x?g&&m||E():(e.stopPropagation(),g&&m||E(),this.#r.startDockDragSession(e,S?`edge-item`:`tab`,r,t)))},b.onauxclick=e=>{e.button===1&&y&&(e.preventDefault(),e.stopPropagation(),D())},b.ondblclick=null,b.oncontextmenu=e=>{e.preventDefault(),e.stopPropagation(),this.#e.contextMenu={x:e.clientX,y:e.clientY,viewId:r,groupId:t},this.#e.notify()},b.onkeydown=r=>{if(r.key===`ArrowRight`||r.key===`ArrowLeft`){r.preventDefault(),r.stopPropagation();let i=r.key===`ArrowRight`?1:-1,a=(e+i+n.length)%n.length,o=n[a];this.#e.setLayoutState(e=>({...e,activeGroupId:t,floatingGroups:(e.floatingGroups||[]).map(e=>e.id===t?{...e,activeViewId:o}:e)}))}else r.key===`Delete`&&y&&(r.preventDefault(),r.stopPropagation(),D())},b.innerHTML=``;let O=_t(b,{title:a,icon:o,badge:p,pinned:c,dirty:h,isClosable:y,localeStrings:u,customIconBridge:this.#a,onClose:D,onTogglePin:()=>this.#e.controller.togglePinView(r)});O&&this.#u.push(O);let k=_.children[e];k!==b&&_.insertBefore(b,k||null),g&&l.lastActiveViewId!==r&&(C=b)}for(let[e,t]of v.entries())T.has(e)||(t.remove(),v.delete(e));C&&(l.lastActiveViewId=f,dt(C)),this.#l.push(_),y.innerHTML=``,e.originEdgeSlot&&y.appendChild(pt(`ArrowRightToLine`,u.redockToEdgeBar,()=>{this.#e.controller.redockFloatingGroup(t)})),y.appendChild(pt(`ExternalLink`,n.length>1?u.popoutGroupWindow||`Pop-out Group`:u.popoutWindow,()=>{n.length>1?this.#e.popoutGroup(t):f&&this.#e.popoutView(f)})),w&&y.appendChild(pt(`X`,u.closeTabTooltip,()=>{let e=[...n];for(let t=0;t<e.length;t++)this.#e.requestCloseView(e[t])})),b.style.display=`flex`,b.style.flexDirection=`column`;for(let e of x.values())e.style.display=``,e.title=u.floatingResizeTooltip;if(f){let e=this.#i(f);e.style.display=`flex`,ut(b,e)}}#f(){for(let e=0;e<this.#u.length;e++)this.#u[e]();this.#u.length=0}destroy(){this.#f();for(let e of this.#o.values())e.winEl.remove();this.#o.clear()}},St=class{#e;#t;#n;#r;#i;#a;#o=/* @__PURE__ */ new Map;#s=/* @__PURE__ */ new Set;#c=/* @__PURE__ */ new Set;#l=[];#u=null;#d=[];#f=/* @__PURE__ */ new Map;#p=/* @__PURE__ */ new Map;get customEmptyContentsSlots(){return this.#f}get customGroupActionsSlots(){return this.#p}constructor(e,t,n,r,i,a){this.#e=e,this.#t=t,this.#n=n,this.#r=r,this.#i=i,this.#a=a}closeOverflowDropdown(){this.#u!==null&&(this.#u=null,this.#e.notify())}sync(e,t){this.#_(),this.#f.clear(),this.#p.clear();let n=this.#s;n.clear(),this.#l.length=0;let r=e.groupRects;for(let e in r){let i=r[e];i.collapsed||(n.add(e),this.#m(e,i,t))}for(let[e,t]of this.#o)n.has(e)||(this.#v(t),t.sectionEl.remove(),this.#o.delete(e));for(let e=0;e<this.#l.length;e++)q(this.#l[e]);this.#l.length=0}#m(e,t,n){let r=this.#o.get(e);if(!r){let t=document.createElement(`section`);t.setAttribute(`data-group-id`,e),t.style.position=`absolute`,t.style.display=`flex`,t.style.flexDirection=`column`,t.style.overflow=`hidden`,t.style.boxSizing=`border-box`,t.addEventListener(`pointerdown`,t=>{t.target.closest(`button, input, .rd-tab`)||this.#e.activateGroup(e)});let n=document.createElement(`div`);n.className=`rd-group-header`,n.style.display=`flex`,n.style.alignItems=`center`,n.style.flexShrink=`0`;let i=document.createElement(`div`);i.className=`rd-tab-list`,i.style.display=`flex`,i.style.alignItems=`center`,i.style.flex=`1 1 0%`,i.style.minWidth=`0`,i.style.overflowX=`auto`,i.setAttribute(`role`,`tablist`),i.setAttribute(`data-tab-list-group`,e),i.addEventListener(`scroll`,()=>q(i),{passive:!0}),i.addEventListener(`wheel`,e=>{Math.abs(e.deltaY)>Math.abs(e.deltaX)&&(i.scrollLeft+=e.deltaY,q(i))},{passive:!0}),n.appendChild(i);let a=document.createElement(`div`);a.className=`rd-group-actions`,a.style.display=`flex`,a.style.alignItems=`center`,a.style.flexShrink=`0`,n.appendChild(a);let o=document.createElement(`div`);o.className=`rd-group-body`,o.style.flex=`1 1 0%`,o.style.minWidth=`0`,o.style.minHeight=`0`,o.style.position=`relative`,o.style.overflow=`hidden`,o.style.display=`flex`,o.style.flexDirection=`column`,t.appendChild(n),t.appendChild(o),this.#t.appendChild(t),r={groupId:e,sectionEl:t,headerEl:n,tabListEl:i,tabElements:/* @__PURE__ */ new Map,actionsWrapEl:a,customActionsEl:null,actionsSlot:new gt,bodyEl:o,emptyContentsEl:null,emptySlot:new gt,lastActiveViewId:null},this.#o.set(e,r)}let{top:i,left:a,width:o,height:s,node:c}=t,{locked:l,showHeader:u,edgeBar:d,edgeSlot:f,views:p,activeViewId:m}=c,{activeGroupId:h,maximizedGroupId:g}=this.#e.layoutState,_=h===e,v=g===e,y=!!l,b=u!==!1,x=this.#e.getLocaleStrings(),S=this.#e.getViewsMap(),C=!!d,w=!C&&!f,{hasCustomEmptyContents:T,hasCustomGroupActions:E}=n;r.sectionEl.setAttribute(`aria-label`,`Panel group ${e}`);let D=`rd-group`+(_?` focused`:``)+(w?` contents-group`:``)+(C?` edgebar-group`:``)+(y?` locked`:``);r.sectionEl.className!==D&&(r.sectionEl.className=D),r.sectionEl.style.top=`${i}px`,r.sectionEl.style.left=`${a}px`,r.sectionEl.style.width=`${o}px`,r.sectionEl.style.height=`${s}px`,r.sectionEl.style.zIndex=_?`2`:`1`,r.headerEl.style.display=b?`flex`:`none`,r.headerEl.ondblclick=t=>{let n=t.target;n.closest(`button, input, .rd-group-actions`)||(C||!n.closest(`.rd-tab`))&&this.#e.toggleMaximizeGroup(e)},r.headerEl.oncontextmenu=C?t=>{if(t.target.closest(`button, input, .rd-group-actions`))return;let n=m||p[0];n&&(t.preventDefault(),t.stopPropagation(),this.#e.contextMenu={x:t.clientX,y:t.clientY,viewId:n,groupId:e},this.#e.notify())}:null,r.headerEl.onpointerdown=C?t=>{if(t.target.closest(`button, input, .rd-group-actions, .rd-tab`))return;let n=m||p[0];n&&(_||this.#e.activateGroup(e),y||this.#n.startDockDragSession(t,`edge-item`,n,e))}:null;let O=null,k=this.#c;k.clear();let A=C?m?[m]:p.slice(0,1):p;for(let t=0;t<A.length;t++){let n=A[t],i=S.get(n);if(!i)continue;k.add(n);let{title:a,pinned:o,closable:s}=i,c=m===n,l=!o&&(C?s===!0:s!==!1),u=r.tabElements.get(n);u||(u=document.createElement(`div`),r.tabElements.set(n,u)),u.style.cursor=C?`default`:y?`pointer`:``,u.setAttribute(`role`,`tab`),u.setAttribute(`aria-selected`,String(c)),u.setAttribute(`aria-controls`,`rd-tabpanel-${n}`),u.id=`rd-tab-${e}-${n}`,u.tabIndex=C?-1:c?0:-1,u.setAttribute(`data-tab-view-id`,n),u.className=[`rd-tab`,c?`active`:``,C?`edgebar-single`:``,o?`pinned`:``].filter(Boolean).join(` `),u.title=`${a}${o?` [Pinned]`:``}`;let d=()=>{this.#e.setLayoutState(t=>({...t,activeGroupId:e,rootGrid:Je(t.rootGrid,n,e)}))},f=()=>{this.#e.requestCloseView(n)};u.ondragstart=e=>e.preventDefault(),u.onpointerdown=t=>{t.target.closest(`.rd-tab__btn`)||(c&&_||d(),y||this.#n.startDockDragSession(t,C?`edge-item`:`tab`,n,e))},u.onauxclick=e=>{e.button===1&&l&&!y&&(e.preventDefault(),e.stopPropagation(),f())},u.ondblclick=t=>{t.target.closest(`.rd-tab__btn`)||(t.stopPropagation(),C&&this.#e.toggleMaximizeGroup(e))},u.oncontextmenu=t=>{t.preventDefault(),t.stopPropagation(),this.#e.contextMenu={x:t.clientX,y:t.clientY,viewId:n,groupId:e},this.#e.notify()},u.onkeydown=n=>{if(p.length===0)return;let{key:i}=n;if(i===`ArrowRight`||i===`ArrowLeft`){n.preventDefault(),n.stopPropagation();let a=(t+(i===`ArrowRight`?1:-1)+p.length)%p.length,o=p[a];this.#e.setLayoutState(t=>({...t,activeGroupId:e,rootGrid:Je(t.rootGrid,o,e)})),(r?.tabListEl.querySelector(`[data-tab-view-id="${o}"]`))?.focus()}else if(i===`Home`||i===`End`){n.preventDefault(),n.stopPropagation();let t=i===`Home`?p[0]:p[p.length-1];this.#e.setLayoutState(n=>({...n,activeGroupId:e,rootGrid:Je(n.rootGrid,t,e)})),(r?.tabListEl.querySelector(`[data-tab-view-id="${t}"]`))?.focus()}else i===`Enter`||i===` `?(n.preventDefault(),d()):i===`Delete`&&l&&(n.preventDefault(),n.stopPropagation(),f())},u.innerHTML=``,this.#h(u,i,l&&!y,f,()=>this.#e.controller.togglePinView(n));let h=r.tabListEl.children[t];h!==u&&r.tabListEl.insertBefore(u,h||null),c&&r.lastActiveViewId!==n&&(O=u)}for(let[e,t]of r.tabElements.entries())k.has(e)||(t.remove(),r.tabElements.delete(e));if(O&&(r.lastActiveViewId=m,dt(O)),this.#l.push(r.tabListEl),this.#g(r,t,v,y,E),p.length===0){r.emptyContentsEl||(r.emptyContentsEl=document.createElement(`div`),r.emptyContentsEl.className=`rd-empty-contents`,r.bodyEl.appendChild(r.emptyContentsEl));let t=T?void 0:this.#e.getActiveEmptyContentsRenderer();if(T)r.emptyContentsEl.hasAttribute(`data-default-empty`)&&(r.emptyContentsEl.innerHTML=``,r.emptyContentsEl.removeAttribute(`data-default-empty`)),this.#f.set(e,r.emptyContentsEl);else if(t){let{controller:e}=this.#e;r.emptyContentsEl.removeAttribute(`data-default-empty`),r.emptySlot.sync(r.emptyContentsEl,t,e,{controller:e},this.#a)}else{let e=x.emptyContentsSubMessage||`Drag a tab here or customize via emptyContents`,t=`${x.emptyContentsMessage}|${e}`;if(r.emptyContentsEl.getAttribute(`data-default-empty`)!==t){r.emptyContentsEl.innerHTML=``,r.emptyContentsEl.setAttribute(`data-default-empty`,t);let n=K(tt,`rd-empty-contents-svg`);n&&r.emptyContentsEl.appendChild(n);let i=document.createElement(`div`);i.textContent=x.emptyContentsMessage,r.emptyContentsEl.appendChild(i);let a=document.createElement(`div`);a.style.fontSize=`11px`,a.style.opacity=`0.75`,a.textContent=e,r.emptyContentsEl.appendChild(a)}}}else if(r.emptyContentsEl&&(r.emptySlot.teardown(),r.emptyContentsEl.remove(),r.emptyContentsEl=null),m){let e=this.#r(m);e.style.display=`flex`,ut(r.bodyEl,e)}}#h(e,t,n,r,i){let a=_t(e,{title:t.title,icon:t.icon,badge:t.badge,pinned:t.pinned,dirty:t.dirty,isClosable:n,localeStrings:this.#e.getLocaleStrings(),customIconBridge:this.#i,onClose:r,onTogglePin:i});a&&this.#d.push(a)}#g(e,t,n,r,i){let{groupId:a,actionsWrapEl:o}=e,{node:s}=t,{edgeBar:c,views:l,activeViewId:u,edgeSlot:d,isContentsRootGroup:f}=s,p=this.#e.getLocaleStrings(),m=this.#e.getViewsMap(),h=this.#u===a;e.customActionsEl&&e.customActionsEl.parentNode===o&&o.removeChild(e.customActionsEl),o.innerHTML=``;let g=u||l[0]||null,_=this.#e.resolveGroupActions(g),v=!!i?.(_),y=v?void 0:_;if(v||y){let t={groupId:a,activeViewId:g,viewSchema:g?m.get(g):void 0,views:[...l],controller:this.#e.controller,layoutState:this.#e.layoutState};e.customActionsEl||(e.customActionsEl=document.createElement(`div`),e.customActionsEl.className=`rd-group-custom-actions`,e.customActionsEl.addEventListener(`pointerdown`,e=>e.stopPropagation())),o.appendChild(e.customActionsEl),v?(e.actionsSlot.mountedRef!==void 0&&(e.actionsSlot.teardown(),e.customActionsEl.innerHTML=``),this.#p.set(a,{hostEl:e.customActionsEl,props:t,renderer:_})):y&&e.actionsSlot.sync(e.customActionsEl,y,t,t,this.#a)}else e.customActionsEl&&=(e.actionsSlot.teardown(),null);if(!c&&l.length>=2){let e=document.createElement(`div`);e.className=`rd-tab-overflow-wrap`;let t=document.createElement(`button`);t.type=`button`,t.className=`rd-group-action-btn rd-tab-overflow-btn${h?` active`:``}`,t.title=`${p.overflowTabsTooltip} (${l.length})`;let n=K(`ChevronDown`,`rd-group-action-svg`);n&&t.appendChild(n);let r=document.createElement(`span`);if(r.className=`rd-tab-overflow-count`,r.textContent=String(l.length),t.appendChild(r),t.addEventListener(`click`,e=>{e.stopPropagation(),this.#u=h?null:a,this.#e.notify()}),e.appendChild(t),h){let t=document.createElement(`div`);t.className=`rd-tab-overflow-dropdown`,t.addEventListener(`pointerdown`,e=>e.stopPropagation());for(let e=0;e<l.length;e++){let n=l[e],r=m.get(n);if(!r)continue;let i=u===n,o=document.createElement(`button`);o.type=`button`,o.className=`rd-context-item`;let s=document.createElement(`span`);s.className=`rd-context-item-label`;let c=K(`Check`,`rd-context-svg-icon${i?` active`:` muted`}`);c&&s.appendChild(c);let d=ft(s,r.icon,`rd-context-svg-icon`,this.#i);d&&this.#d.push(d);let f=document.createElement(`span`);if(f.textContent=r.title,s.appendChild(f),r.pinned){let e=K(`Pin`,`rd-tab-pin-svg`);e&&s.appendChild(e)}if(r.dirty){let e=document.createElement(`span`);e.className=`rd-tab__dirty-dot`,s.appendChild(e)}o.appendChild(s),o.addEventListener(`click`,e=>{e.stopPropagation(),this.#e.setLayoutState(e=>({...e,activeGroupId:a,rootGrid:Je(e.rootGrid,n,a)})),this.#u=null,this.#e.notify()}),t.appendChild(o)}e.appendChild(t)}o.appendChild(e)}if(r){let e=document.createElement(`span`);e.className=`rd-group-lock-badge`,e.title=p.lockedGroupTooltip;let t=K(`Lock`,`rd-group-action-svg`);t&&e.appendChild(t),o.appendChild(e)}let{edgeBars:b}=this.#e.layoutState,x=this.#e.isTopBarEnabled(),S=!!(d&&((d.startsWith(`left`)||d===`bottom-left`)&&(b.left||x)||(d.startsWith(`right`)||d===`bottom-right`)&&(b.right||x)));n&&o.appendChild(pt(`Minimize2`,p.restoreGroupTooltip,()=>this.#e.toggleMaximizeGroup(a))),!r&&!n&&!f&&S&&o.appendChild(pt(`Minus`,p.collapsePanelTooltip,()=>{this.#e.setLayoutState(e=>({...e,rootGrid:Ye(e.rootGrid,a,!0)}))}))}#_(){for(let e=0;e<this.#d.length;e++)this.#d[e]();this.#d.length=0}#v(e){e.emptySlot.teardown(),e.actionsSlot.teardown()}destroy(){this.#_();for(let e of this.#o.values())this.#v(e),e.sectionEl.remove();this.#o.clear()}},Ct=`data:image/svg+xml;charset=utf-8,`+encodeURIComponent(tt);function wt(e,t,n){let r=e?.trim();if(r){let e=r;try{e=new URL(r,n).href}catch{e=r}let t=/^data:image\/svg\+xml/i.test(e)||/\.svg(?:[?#].*)?$/i.test(e);return{mode:`custom`,href:e,isSvg:t}}return t?{mode:`host`}:{mode:`default`,href:Ct,isSvg:!0}}var Tt=class{#e;#t;#n;#r=/* @__PURE__ */ new Map;#i=null;constructor(e,t,n){this.#e=e,this.#t=t,this.#n=n,typeof window<`u`&&(this.#i=()=>{for(let e of this.#r.values())if(!e.childWin.closed)try{e.childWin.close()}catch{}},window.addEventListener(`beforeunload`,this.#i),window.addEventListener(`pagehide`,this.#i))}sync(){if(typeof window>`u`)return;let{popoutWindows:e}=this.#e,t=/* @__PURE__ */ new Set;for(let n=0;n<e.length;n++){let r=e[n],i=r.id||r.viewId;t.add(i),this.#a(i,r)}for(let[e,n]of this.#r.entries())t.has(e)||(this.#s(n),this.#r.delete(e))}#a(e,t){let{views:n,viewId:r,width:i,height:a}=t,o=n&&n.length>0?n:[r],s=o.includes(r)?r:o[0],c=this.#e.getViewsMap(),l=this.#e.getLocaleStrings(),u=this.#e.getActiveTheme(),d=c.get(s),f=this.#r.get(e);if(!f||f.childWin.closed){let t=`width=${i||760},height=${a||540},menubar=no,toolbar=no,location=no,status=no,resizable=yes`,n=window.open(``,`reddokia_popout_${e}`,t);if(!n){this.#e.redockPopoutGroup(s);return}let r=n.document;r.head.innerHTML=``,r.body.innerHTML=``,r.body.style.margin=`0`,r.body.style.padding=`0`,r.body.style.overflow=`hidden`;let o=(u.base??(u.id===`light`?`light`:`dark`))===`light`;r.body.style.background=u.shellBg||(o?`#ebecf0`:`#090b10`),r.body.style.color=u.textMain||(o?`#1e1f22`:`#e2e8f0`),r.body.style.fontFamily=u.fontSans||`Inter, system-ui, sans-serif`;let c=()=>{let{injectStyles:e,styleNonce:t}=this.#e.options;g(r,{disabled:e===!1,nonce:t}),r.head.querySelectorAll(`[data-rd-synced-style]`).forEach(e=>e.remove()),document.head.querySelectorAll(`style, link[rel="stylesheet"]`).forEach(e=>{if(e.id===`reddokia-core-styles`)return;let n=e.cloneNode(!0);e.tagName===`LINK`&&e.href?n.href=e.href:e.tagName===`STYLE`&&t&&n.setAttribute(`nonce`,t),n.setAttribute(`data-rd-synced-style`,`true`),r.head.appendChild(n)})};c();let l=new MutationObserver(()=>{c();let t=this.#r.get(e);t&&this.#o(t)});l.observe(document.head,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:[`href`,`rel`]});let d=r.createElement(`div`);d.className=`reddokia-root rd-popout`,d.style.width=`100vw`,d.style.height=`100vh`,d.style.display=`flex`,d.style.flexDirection=`column`;let p=r.createElement(`header`);p.className=`rd-popout__header`;let m=r.createElement(`div`);m.className=`rd-popout__title-wrap`;let h=r.createElement(`div`);h.className=`rd-tab-list`,h.setAttribute(`role`,`tablist`),h.style.flex=`1`,m.appendChild(h),p.appendChild(m);let _=r.createElement(`div`);_.className=`rd-group-actions`,p.appendChild(_);let v=r.createElement(`div`);v.className=`rd-popout__body`,v.style.flex=`1 1 0%`,v.style.display=`flex`,v.style.flexDirection=`column`,v.style.minWidth=`0`,v.style.minHeight=`0`,v.style.position=`relative`,v.style.overflow=`hidden`,d.appendChild(p),d.appendChild(v),r.body.appendChild(d);let y=!1,b=()=>{if(y)return;y=!0;let t=this.#r.get(e);if(!t)return;t.resizeRafId&&=(cancelAnimationFrame(t.resizeRafId),0);let n=t.mountedViewId||s;if(t.mountedViewId){let e=this.#t(t.mountedViewId);e.style.display=`none`,this.#n.appendChild(e),t.mountedViewId=null}t.observer?.disconnect(),this.#r.delete(e),this.#e.redockPopoutGroup(n)},x=()=>{let t=this.#r.get(e);t&&!t.resizeRafId&&(t.resizeRafId=requestAnimationFrame(()=>{t.resizeRafId=0;let n=t.mountedViewId;if(!n)return;let{clientWidth:r,clientHeight:i}=t.bodyEl;this.#e.options.onViewResize?.({[n]:{viewId:n,groupId:e,top:0,left:0,width:r,height:i,element:this.#t(n)}})}))};f={popId:e,childWin:n,rootEl:d,tabListEl:h,actionsEl:_,bodyEl:v,observer:l,mountedViewId:null,appliedFaviconKey:null,resizeRafId:0,onResize:x,onClosed:b},this.#r.set(e,f),n.addEventListener(`beforeunload`,b),n.addEventListener(`pagehide`,b),n.addEventListener(`resize`,x)}let{childWin:p,rootEl:m,tabListEl:h,actionsEl:_,bodyEl:v,mountedViewId:y}=f,b=p.document;this.#o(f),b.title=`${d?.title||s}${o.length>1?` (+${o.length-1})`:``} — RedDokia Pop-out`,mt(m,u);let x=!!t.originEdgeSlot;m.classList.toggle(`rd-popout--edge`,x),h.innerHTML=``;for(let t=0;t<o.length;t++){let n=o[t],r=c.get(n),i=n===s,a=b.createElement(`div`);a.setAttribute(`role`,`tab`),a.setAttribute(`aria-selected`,String(i)),a.tabIndex=i?0:-1,a.className=[`rd-tab`,x&&o.length===1?`edgebar-single`:``,i?`active`:``,r?.pinned?`pinned`:``].filter(Boolean).join(` `);let u=!r?.pinned&&(x?r?.closable===!0:r?.closable!==!1);_t(a,{title:r?.title||n,icon:r?.icon,badge:r?.badge,pinned:r?.pinned,dirty:r?.dirty,isClosable:u,localeStrings:l,doc:b,fallbackIconName:`AppWindow`,resolveRelativeImageUrl:!0,closeIconClass:`rd-icon-xs`,onClose:()=>this.#e.requestCloseView(n)}),a.addEventListener(`click`,()=>{this.#e.activatePopoutTab(e,n)}),a.addEventListener(`auxclick`,e=>{e.button===1&&u&&(e.preventDefault(),e.stopPropagation(),this.#e.requestCloseView(n))}),a.addEventListener(`keydown`,r=>{if(r.key===`ArrowRight`||r.key===`ArrowLeft`){r.preventDefault();let n=r.key===`ArrowRight`?1:-1,i=(t+n+o.length)%o.length;this.#e.activatePopoutTab(e,o[i])}else r.key===`Delete`&&u&&(r.preventDefault(),this.#e.requestCloseView(n))}),h.appendChild(a)}_.innerHTML=``;let S=b.createElement(`button`);S.type=`button`,S.className=`rd-popout__dock-btn`;let C=K(x?`ArrowRightToLine`:`Layout`,`rd-icon-xs`,b);C&&S.appendChild(C);let w=b.createElement(`span`);if(w.textContent=x?l.redockToEdgeBar:l.redockToMainWindow,S.appendChild(w),S.addEventListener(`click`,()=>{this.#e.redockPopoutGroup(s)}),_.appendChild(S),y&&y!==s){let e=this.#t(y);e.style.display=`none`,this.#n.appendChild(e)}let T=this.#t(s);T.style.display=`flex`,ut(v,T),f.mountedViewId=s}#o(e){let t=e.childWin.document,n=document.head.querySelectorAll(`link[rel*="icon"]`),r=wt(this.#e.options.popoutFavicon,n.length>0,window.location.href);if(r.mode===`custom`||r.mode==="default"){let n=`${r.mode}:${r.href}`;if(e.appliedFaviconKey===n)return;e.appliedFaviconKey=n,t.head.querySelectorAll(`[data-rd-popout-favicon]`).forEach(e=>e.remove());let i=t.createElement(`link`);i.rel=`icon`,r.isSvg&&(i.type=`image/svg+xml`),i.href=r.href,i.setAttribute(`data-rd-popout-favicon`,`true`),t.head.appendChild(i);return}let i=`host:`;for(let e=0;e<n.length;e++){let t=n[e];i+=`${t.rel}|${t.href}|${t.type};`}if(e.appliedFaviconKey!==i){e.appliedFaviconKey=i,t.head.querySelectorAll(`[data-rd-popout-favicon]`).forEach(e=>e.remove());for(let e=0;e<n.length;e++){let r=n[e],i=r.cloneNode(!0);r.href&&(i.href=r.href),i.setAttribute(`data-rd-popout-favicon`,`true`),t.head.appendChild(i)}}}#s(e){let{observer:t,mountedViewId:n,childWin:r,resizeRafId:i,onResize:a,onClosed:o}=e;t?.disconnect(),i&&(cancelAnimationFrame(i),e.resizeRafId=0);try{r.removeEventListener(`beforeunload`,o),r.removeEventListener(`pagehide`,o),r.removeEventListener(`resize`,a)}catch{}if(n){let t=this.#t(n);t.style.display=`none`,this.#n.appendChild(t),e.mountedViewId=null}if(!r.closed)try{r.close()}catch{}}destroy(){this.#i&&typeof window<`u`&&(window.removeEventListener(`beforeunload`,this.#i),window.removeEventListener(`pagehide`,this.#i),this.#i=null);for(let e of this.#r.values())this.#s(e);this.#r.clear()}},Et=class{#e;#t;#n;#r=/* @__PURE__ */ new Map;#i=/* @__PURE__ */ new Map;#a=/* @__PURE__ */ new Set;#o=null;constructor(e,t,n){this.#e=e,this.#t=t,this.#n=n}#s=null;#c(e){this.#s?.(),e.setAttribute(`data-dragging`,`true`);let t=()=>{e.removeAttribute(`data-dragging`),window.removeEventListener(`pointerup`,t),window.removeEventListener(`pointercancel`,t),this.#s===t&&(this.#s=null)};this.#s=t,window.addEventListener(`pointerup`,t),window.addEventListener(`pointercancel`,t)}sync(e){this.#o=e;let{sashResizeTooltip:t}=this.#e.getLocaleStrings(),{sashes:n}=e,r=this.#a;r.clear(),this.#i.clear();for(let e=0;e<n.length;e++){let i=n[e],{id:a,orientation:o,beforeId:s,afterId:c,rect:l}=i;r.add(a),this.#i.set(a,i);let u=this.#r.get(a);if(!u){u=document.createElement(`div`),u.setAttribute(`role`,`separator`),u.setAttribute(`data-sash-id`,a),u.style.position=`absolute`;let e=document.createElement(`div`);e.className=`rd-sash__line`;let t=document.createElement(`span`);t.className=`rd-sash__grip`,e.appendChild(t),u.appendChild(e);let n=u;u.addEventListener(`pointerdown`,e=>{let t=this.#i.get(a);t&&this.#o&&(this.#c(n),this.#n.handleSashPointerDown(e,t,this.#o))}),u.addEventListener(`dblclick`,()=>{let e=this.#i.get(a);e&&this.#n.handleSashDoubleClick(e)}),this.#t.appendChild(u),this.#r.set(a,u)}let d=`rd-sash ${o===`horizontal`?`rd-sash--horiz`:`rd-sash--vert`}`;u.className!==d&&(u.className=d),u.getAttribute(`aria-orientation`)!==o&&u.setAttribute(`aria-orientation`,o);let f=`Resize ${s} and ${c}`;u.getAttribute(`aria-label`)!==f&&u.setAttribute(`aria-label`,f),u.title!==t&&(u.title=t),u.style.left=`${l.left}px`,u.style.top=`${l.top}px`,u.style.width=`${l.width}px`,u.style.height=`${l.height}px`}for(let[e,t]of this.#r.entries())r.has(e)||(t.remove(),this.#r.delete(e))}destroy(){this.#s?.();for(let e of this.#r.values())e.remove();this.#r.clear()}},Dt=class{#e;#t;#n;#r=null;#i=null;#a=null;#o=null;#s=new gt;#c=null;#l=new gt;constructor(e,t,n){this.#e=e,this.#t=t,this.#n=n}getCustomLeftSlotElement(){return this.#o}getCustomRightSlotElement(){return this.#c}sync(e,t=!1){let n=this.#e.getActiveStatusBarSchema();if(!n){this.#r&&(this.#s.teardown(),this.#l.teardown(),this.#r.remove(),this.#r=null,this.#i=null,this.#a=null,this.#o=null,this.#c=null);return}this.#r||(this.#r=document.createElement(`footer`),this.#r.className=`rd-statusbar`,this.#i=document.createElement(`div`),this.#i.className=`rd-statusbar__left`,this.#r.appendChild(this.#i),this.#a=document.createElement(`div`),this.#a.className=`rd-statusbar__right`,this.#r.appendChild(this.#a),this.#t.appendChild(this.#r));let{left:r,right:i}=n,{controller:a,layoutState:o}=this.#e,s={controller:a,layoutState:o};if(this.#i){let e=t?void 0:r;t||e?(this.#o||(this.#o=document.createElement(`div`),this.#o.className=`rd-statusbar__left`),this.#s.sync(this.#o,e,a,s,this.#n),this.#o.parentElement!==this.#i&&this.#i.appendChild(this.#o)):this.#o&&=(this.#s.teardown(),this.#o.remove(),null)}if(this.#a){let t=e?void 0:i;e||t?(this.#c||(this.#c=document.createElement(`div`),this.#c.className=`rd-statusbar__right`),this.#l.sync(this.#c,t,a,s,this.#n),this.#c.parentElement!==this.#a&&this.#a.appendChild(this.#c)):this.#c&&=(this.#l.teardown(),this.#c.remove(),null)}}destroy(){this.#s.teardown(),this.#l.teardown(),this.#r&&=(this.#r.remove(),null)}};function Ot(e,t,n=228,r=460,i,a,o=8){let s=i??(typeof window<`u`&&window.innerWidth>0?window.innerWidth:1280),c=a??(typeof window<`u`&&window.innerHeight>0?window.innerHeight:800);return{x:Math.max(o,Math.min(e,s-n-o)),y:Math.max(o,Math.min(t,c-r-o))}}var kt=[{slot:`left-top`,icon:`EdgeSlotLeftTop`,localeKey:`edgeSlotLeftTop`},{slot:`left-bottom`,icon:`EdgeSlotLeftBottom`,localeKey:`edgeSlotLeftBottom`},{slot:`bottom-left`,icon:`EdgeSlotBottomLeft`,localeKey:`edgeSlotBottomLeft`},{slot:`bottom-right`,icon:`EdgeSlotBottomRight`,localeKey:`edgeSlotBottomRight`},{slot:`right-bottom`,icon:`EdgeSlotRightBottom`,localeKey:`edgeSlotRightBottom`},{slot:`right-top`,icon:`EdgeSlotRightTop`,localeKey:`edgeSlotRightTop`}];function At(e,t,n,r){let i=e.getLocaleStrings(),a=e.getAllGroups().find(e=>e.id===n)||null,o=r??a?.edgeSlot,s=!(!a||a.collapsed||a.activeViewId!==t),c=!!e.layoutState.edgeBars.showLabels,l=()=>{e.contextMenu=null,e.notify()},u=kt.map(({slot:n,icon:r,localeKey:a})=>{let s=o===n;return{id:`edge-move-to:${n}`,label:i[a],icon:r,disabled:s,onClick:()=>{s||(e.contextMenu=null,e.moveViewToEdgeSlot(t,n),l())}}});return[{id:`edge-hide`,label:i.edgeHide,disabled:!s,onClick:()=>{s&&(e.contextMenu=null,e.controller.toggleCollapseGroup(n),l())}},{id:`edge-move-to`,label:i.edgeMoveTo,dividerBefore:!0,children:u,onClick:()=>{}},{id:`edge-float`,label:i.floatWindow,icon:`AppWindow`,dividerBefore:!0,onClick:()=>{e.contextMenu=null,e.floatView(t),l()}},{id:`edge-popout`,label:i.popoutWindow,icon:`ExternalLink`,onClick:()=>{e.contextMenu=null,e.popoutView(t),l()}},{id:`edge-show-names`,label:i.edgeShowToolWindowNames,checked:c,dividerBefore:!0,onClick:()=>{e.contextMenu=null,e.setEdgeBarLabelsVisible(!c),l()}}]}function jt(e,t,n){let{layoutState:r,controller:i,options:a}=e,{floatingGroups:o}=r,s=e.getLocaleStrings(),c=e.getViewsMap().get(t),l=(o||[]).find(e=>e.id===n||e.views.includes(t))||null,u=!!l,d=e.getAllGroups().find(e=>e.id===n)||null,f=!!d?.edgeBar,p=!!(d?.locked||f),m=l?l.views.length:d?d.views.length:1,h=!!l?.originEdgeSlot,g=!c?.pinned&&(f||h?c?.closable===!0:c?.closable!==!1),_=()=>{e.contextMenu=null,e.notify()},v=[];f?(g&&v.push({id:`close-tab`,label:s.closeTab,shortcut:`Del`,icon:`X`,danger:!0,onClick:()=>{e.contextMenu=null,e.requestCloseView(t),_()}}),v.push({id:`maximize-group`,label:s.maximizeRestoreGroup,icon:`Maximize2`,dividerBefore:v.length>0,onClick:()=>{e.contextMenu=null,e.toggleMaximizeGroup(n),_()}},{id:`collapse-panel`,label:s.collapsePanel,icon:`Minus`,onClick:()=>{e.contextMenu=null,e.controller.toggleCollapseGroup(n),_()}})):(v.push({id:`toggle-pin`,label:c?.pinned?s.unpinTab:s.pinTab,icon:c?.pinned?`PinOff`:`Pin`,onClick:()=>{e.contextMenu=null,e.controller.togglePinView(t),_()}}),g&&v.push({id:`close-tab`,label:s.closeTab,shortcut:`Del`,icon:`X`,danger:!0,onClick:()=>{e.contextMenu=null,e.requestCloseView(t),_()}}),u||v.push({id:`close-others`,label:s.closeOtherTabs,icon:`XCircle`,dividerBefore:!0,onClick:()=>{e.contextMenu=null,e.controller.closeOtherViews(n,t),_()}},{id:`close-right`,label:s.closeTabsToRight,icon:`ArrowRightToLine`,onClick:()=>{e.contextMenu=null,e.controller.closeViewsToRight(n,t),_()}},{id:`close-saved`,label:s.closeSavedTabs,icon:`CheckCircle2`,onClick:()=>{e.contextMenu=null,e.controller.closeSavedViews(n),_()}},{id:`close-all`,label:s.closeAllTabs,icon:`Trash2`,danger:!0,onClick:()=>{e.contextMenu=null,e.controller.closeAllViews(n),_()}}),!u&&!p&&m>1&&v.push({id:`split-right`,label:s.splitRightMove,icon:`Columns`,dividerBefore:!0,onClick:()=>{e.contextMenu=null,e.splitGroupWithView(n,t,`right`),_()}},{id:`split-down`,label:s.splitDownMove,icon:`Rows`,onClick:()=>{e.contextMenu=null,e.splitGroupWithView(n,t,`bottom`),_()}}),u?(v.push({id:`redock-view`,label:h?s.redockToEdgeBar:s.redockToGrid,shortcut:`Dock`,icon:h?`ArrowRightToLine`:`Layout`,dividerBefore:!0,onClick:()=>{e.contextMenu=null,h&&l?e.redockFloatingGroup(l.id):e.redockFloatingView(t),_()}}),m>1&&l&&v.push({id:`redock-group`,label:s.redockGroupToGrid,shortcut:`Dock All`,icon:`Layers`,onClick:()=>{e.contextMenu=null,e.redockFloatingGroup(l.id),_()}})):(v.push({id:`float-view`,label:s.floatWindow,shortcut:`Alt+Drag`,icon:`AppWindow`,dividerBefore:!0,onClick:()=>{e.contextMenu=null,e.floatView(t),_()}}),!p&&m>1&&v.push({id:`float-group`,label:s.floatGroupWindow,shortcut:`Group`,icon:`Layers`,onClick:()=>{e.contextMenu=null,e.floatGroup(n),_()}})),v.push({id:`popout-view`,label:s.popoutWindow,shortcut:`Pop-out`,icon:`ExternalLink`,onClick:()=>{e.contextMenu=null,e.popoutView(t),_()}}),(!p||u)&&m>1&&v.push({id:`popout-group`,label:s.popoutGroupWindow,shortcut:`Pop-out All`,icon:`ExternalLink`,onClick:()=>{e.contextMenu=null,e.popoutGroup(l?l.id:n),_()}}),u||v.push({id:`maximize-group`,label:s.maximizeRestoreGroup,icon:`Maximize2`,dividerBefore:!0,onClick:()=>{e.contextMenu=null,e.toggleMaximizeGroup(n),_()}},{id:`lock-group`,label:p?s.unlockGroup:s.lockGroup,icon:p?`Unlock`:`Lock`,onClick:()=>{e.contextMenu=null,e.controller.toggleLockGroup(n),_()}}));let y={viewId:t,viewSchema:c,groupId:n,controller:i,defaultItems:v.map(e=>({id:e.id,label:e.label,shortcut:e.shortcut,icon:e.icon,danger:e.danger,disabled:e.disabled,dividerBefore:e.dividerBefore,action:e.onClick}))},b=c?.tabContextMenu===void 0?a.tabContextMenu:c.tabContextMenu,x=!1,S=[];if(c&&b!==void 0){if(Array.isArray(b))S=b;else if(typeof b==`function`)S=b(y)||[];else{x=b.mode===`replace`;let e=b.items;S=typeof e==`function`?e(y)||[]:e||[]}}if(x){let t=[];for(let n=0;n<S.length;n++){let{id:r,label:i,shortcut:a,icon:o,danger:s,disabled:c,dividerBefore:l,action:u}=S[n];t.push({id:r,label:i,shortcut:a,icon:o,danger:s,disabled:c,dividerBefore:l,onClick:()=>{c||(e.contextMenu=null,u(),_())}})}return t}for(let t=0;t<S.length;t++){let{id:n,label:r,shortcut:i,icon:a,danger:o,disabled:s,dividerBefore:c,action:l}=S[t];v.push({id:`custom:${n}`,label:r,shortcut:i,icon:a,danger:o,disabled:s,dividerBefore:t===0||c,onClick:()=>{s||(e.contextMenu=null,l(),_())}})}return v}var Mt=class{#e;#t;#n;#r=null;#i=null;#a=null;#o=[];#s;constructor(e,t,n){this.#e=e,this.#t=t,this.#n=n,this.#s=e=>{e.key===`Escape`&&this.#e.contextMenu&&(this.#u(),this.#e.contextMenu=null,this.#e.notify())}}sync(){this.#d(),this.#u();let e=this.#e.contextMenu;if(!e){this.#r&&(this.#r.remove(),this.#r=null,typeof window<`u`&&window.removeEventListener(`keydown`,this.#s));return}this.#r||(this.#r=document.createElement(`div`),this.#r.className=`rd-context-menu`,this.#r.setAttribute(`role`,`menu`),this.#r.addEventListener(`pointerdown`,e=>e.stopPropagation()),this.#t.appendChild(this.#r),typeof window<`u`&&window.addEventListener(`keydown`,this.#s));let{x:t,y:n,viewId:r,groupId:i,source:a,edgeSlot:o}=e,s=a===`edgebar`?At(this.#e,r,i,o):jt(this.#e,r,i);if(s.length===0){this.#r.remove(),this.#r=null,typeof window<`u`&&window.removeEventListener(`keydown`,this.#s);return}this.#r.innerHTML=``;for(let e=0;e<s.length;e++)this.#c(this.#r,s[e],e,!1);let c=Ot(t,n,this.#r.offsetWidth||256,this.#r.offsetHeight||460);this.#r.style.left=`${c.x}px`,this.#r.style.top=`${c.y}px`}#c(e,t,n,r){let{dividerBefore:i,danger:a,disabled:o,checked:s,icon:c,label:l,shortcut:u,children:d,onClick:f}=t;if(i&&n>0){let t=document.createElement(`div`);t.className=`rd-context-divider`,e.appendChild(t)}let p=!!(d&&d.length>0),m=document.createElement(`button`);m.type=`button`,m.setAttribute(`role`,s===void 0?`menuitem`:`menuitemcheckbox`),s!==void 0&&m.setAttribute(`aria-checked`,String(s)),p&&(m.setAttribute(`aria-haspopup`,`menu`),m.setAttribute(`aria-expanded`,`false`)),m.className=`rd-context-item${a?` danger`:``}`,o&&(m.disabled=!0);let h=document.createElement(`span`);if(h.className=`rd-context-item-label`,c){let e=ft(h,c,`rd-context-svg-icon`,this.#n);e&&this.#o.push(e)}let g=document.createElement(`span`);if(g.textContent=l,h.appendChild(g),m.appendChild(h),p){let e=K(`ChevronRight`,`rd-context-submenu-arrow`);e&&m.appendChild(e)}else if(s){let e=K(`Check`,`rd-context-check-icon`);e&&m.appendChild(e)}else if(u){let e=document.createElement(`span`);e.className=`rd-kbd`,e.textContent=u,m.appendChild(e)}if(p&&d){let e=()=>this.#l(m,d);m.addEventListener(`mouseenter`,e),m.addEventListener(`click`,t=>{t.stopPropagation(),e()}),m.addEventListener(`keydown`,t=>{(t.key===`ArrowRight`||t.key===`Enter`||t.key===` `)&&(t.preventDefault(),e())})}else r||m.addEventListener(`mouseenter`,()=>this.#u()),m.addEventListener(`click`,()=>{f?.()});e.appendChild(m)}#l(e,t){if(this.#a===e&&this.#i)return;this.#u();let n=document.createElement(`div`);n.className=`rd-context-submenu`,n.setAttribute(`role`,`menu`),n.addEventListener(`pointerdown`,e=>e.stopPropagation()),n.addEventListener(`keydown`,t=>{t.key===`ArrowLeft`&&(t.preventDefault(),this.#u(),e.focus())});for(let e=0;e<t.length;e++)this.#c(n,t[e],e,!0);this.#t.appendChild(n),this.#i=n,this.#a=e,e.classList.add(`rd-context-item--submenu-open`),e.setAttribute(`aria-expanded`,`true`);let r=e.getBoundingClientRect(),i=this.#r?.getBoundingClientRect()??r,a=n.offsetWidth||200,o=n.offsetHeight||220,s=typeof window<`u`&&window.innerWidth>0?window.innerWidth:1280,c=typeof window<`u`&&window.innerHeight>0?window.innerHeight:800,l=i.right+4;l+a+8>s&&(l=Math.max(8,i.left-a-4));let u=Math.max(8,Math.min(r.top-6,c-o-8));n.style.left=`${l}px`,n.style.top=`${u}px`}#u(){this.#a&&=(this.#a.classList.remove(`rd-context-item--submenu-open`),this.#a.setAttribute(`aria-expanded`,`false`),null),this.#i&&=(this.#i.remove(),null)}#d(){for(let e=0;e<this.#o.length;e++)this.#o[e]();this.#o.length=0}destroy(){this.#d(),this.#u(),typeof window<`u`&&window.removeEventListener(`keydown`,this.#s),this.#r&&=(this.#r.remove(),null)}},Nt=class{#e;#t;#n;#r;#i=null;#a=null;#o=null;#s=null;#c=[];#l=null;#u=new gt;#d=null;#f=new gt;constructor(e,t,n,r){this.#e=e,this.#t=t,this.#n=n,this.#r=r}getCustomLeftSlotElement(){return this.#l}getCustomRightSlotElement(){return this.#d}closeMenuDropdown(){this.#s!==null&&(this.#s=null,this.#e.notify())}sync(e,t=!1){this.#h();let n=this.#e.getActiveTopBarSchema();if(!n){this.#s=null,this.#i&&(this.#u.teardown(),this.#f.teardown(),this.#i.remove(),this.#i=null,this.#a=null,this.#o=null,this.#l=null,this.#d=null);return}this.#i||(this.#i=document.createElement(`header`),this.#i.className=`rd-topbar`,this.#a=document.createElement(`div`),this.#a.className=`rd-topbar__left`,this.#i.appendChild(this.#a),this.#o=document.createElement(`div`),this.#o.className=`rd-topbar__right`,this.#i.appendChild(this.#o),this.#t.insertBefore(this.#i,this.#t.firstChild));let{logoText:r,title:i,menus:a,left:o,right:s}=n,{controller:c,layoutState:l}=this.#e;if(this.#a){if(this.#a.innerHTML=``,r){let e=document.createElement(`div`);e.className=`rd-topbar__logo`,e.textContent=r,this.#a.appendChild(e)}if(i){let e=document.createElement(`span`);e.className=`rd-topbar__title`,e.textContent=i,this.#a.appendChild(e)}a&&a.length>0?this.#a.appendChild(this.#p(a)):this.#s=null;let e=t?void 0:o;t||e?(this.#l||(this.#l=document.createElement(`div`),this.#l.className=`rd-topbar__left`),this.#u.sync(this.#l,e,c,{controller:c,layoutState:l},this.#n),this.#a.appendChild(this.#l)):this.#l&&=(this.#u.teardown(),null)}if(this.#o){let t=e?void 0:s;e||t?(this.#d||(this.#d=document.createElement(`div`),this.#d.className=`rd-topbar__right`),this.#f.sync(this.#d,t,c,{controller:c,layoutState:l},this.#n),this.#d.parentElement!==this.#o&&this.#o.appendChild(this.#d)):this.#d&&=(this.#f.teardown(),this.#d.remove(),null)}}#p(e){let t=document.createElement(`nav`);t.className=`rd-topbar__menubar`,t.setAttribute(`role`,`menubar`),t.addEventListener(`pointerdown`,e=>e.stopPropagation());for(let n=0;n<e.length;n++){let r=e[n],i=this.#s===n,a=document.createElement(`div`);a.className=`rd-topbar__menu-wrap`;let o=document.createElement(`button`);if(o.type=`button`,o.setAttribute(`role`,`menuitem`),o.setAttribute(`aria-haspopup`,`true`),o.setAttribute(`aria-expanded`,String(i)),o.className=`rd-topbar__menu-btn${i?` active`:``}`,o.textContent=r.label,o.addEventListener(`click`,e=>{e.stopPropagation(),this.#s=this.#s===n?null:n,this.#e.notify()}),o.addEventListener(`pointerenter`,()=>{this.#s!==null&&this.#s!==n&&(this.#s=n,this.#e.notify())}),a.appendChild(o),i&&r.items.length>0){let e=this.#m(r.items,`rd-topbar__dropdown rd-context-menu`);a.appendChild(e)}t.appendChild(a)}return t}#m(e,t){let n=document.createElement(`div`);n.className=t,n.setAttribute(`role`,`menu`),n.addEventListener(`pointerdown`,e=>e.stopPropagation());let{controller:r}=this.#e;for(let t=0;t<e.length;t++){let{label:i,icon:a,shortcut:o,disabled:s,danger:c,dividerBefore:l,items:u,action:d}=e[t],f=!!(u&&u.length>0);if(l&&t>0){let e=document.createElement(`div`);e.className=`rd-context-divider`,n.appendChild(e)}let p=document.createElement(`div`);p.className=`rd-topbar__item-wrap${f?` has-submenu`:``}`;let m=document.createElement(`button`);m.type=`button`,m.setAttribute(`role`,`menuitem`),m.disabled=!!s,m.className=`rd-context-item${c?` danger`:``}`;let h=document.createElement(`span`);h.className=`rd-context-item-label`;let g=document.createElement(`span`);if(g.className=`rd-context-icon-slot`,a){let e=ft(g,a,`rd-context-svg-icon`,this.#r);e&&this.#c.push(e)}h.appendChild(g);let _=document.createElement(`span`);if(_.textContent=i,h.appendChild(_),m.appendChild(h),f){let e=K(`ChevronRight`,`rd-icon-xs rd-submenu-arrow`);e&&m.appendChild(e)}else if(o){let e=document.createElement(`span`);e.className=`rd-kbd`,e.textContent=o,m.appendChild(e)}if(m.addEventListener(`click`,e=>{e.stopPropagation(),s||f||(this.#s=null,d?.(r),this.#e.notify())}),p.appendChild(m),f&&u&&!s){let e=this.#m(u,`rd-topbar__submenu rd-context-menu`);p.appendChild(e)}n.appendChild(p)}return n}#h(){for(let e=0;e<this.#c.length;e++)this.#c[e]();this.#c.length=0}destroy(){this.#h(),this.#u.teardown(),this.#f.teardown(),this.#i&&=(this.#i.remove(),null)}};function Pt(){return{kind:`none`,groupId:null,zone:null,edgeSlot:null,tabInsertIndex:null,previewRect:{top:0,left:0,width:0,height:0}}}var Ft=Pt();function It(e){return e.kind=`none`,e.groupId=null,e.zone=null,e.edgeSlot=null,e.tabInsertIndex=null,e.previewRect.top=0,e.previewRect.left=0,e.previewRect.width=0,e.previewRect.height=0,e}var Lt=8,Rt=5;function zt(e,t,n,r,i){e.kind=`tear-off-float`;let a=Math.min(Math.max(260,r-24),Math.max(280,Math.round(r*.42))),o=Math.min(Math.max(200,i-24),Math.max(220,Math.round(i*.46))),s=Math.max(12,r-a-12),c=Math.max(12,i-o-12);return e.previewRect.width=a,e.previewRect.height=o,e.previewRect.left=Math.max(12,Math.min(s,Math.round(t-a*.5))),e.previewRect.top=Math.max(12,Math.min(c,Math.round(n-20))),e}function Bt(e,t,n,r,i,a=null,o=Ft,s,c,l=!1,u=!1){let d=It(o),{previewRect:f}=d;if(l&&!u)return zt(d,e,t,n,r);if(a){if(d.kind=`edge-slot`,d.edgeSlot=a,a===`left-top`)f.top=0,f.left=0,f.width=Math.min(260,Math.round(n*.25)),f.height=Math.round(r*.5);else if(a===`left-bottom`)f.top=Math.round(r*.5),f.left=0,f.width=Math.min(260,Math.round(n*.25)),f.height=Math.round(r*.5);else if(a===`right-top`){let e=Math.min(260,Math.round(n*.25));f.top=0,f.left=n-e,f.width=e,f.height=Math.round(r*.5)}else if(a===`right-bottom`){let e=Math.min(260,Math.round(n*.25));f.top=Math.round(r*.5),f.left=n-e,f.width=e,f.height=Math.round(r*.5)}else if(a===`bottom-left`){let e=Math.min(220,Math.round(r*.32));f.top=r-e,f.left=0,f.width=Math.round(n*.5),f.height=e}else if(a===`bottom-right`){let e=Math.min(220,Math.round(r*.32)),t=Math.round(n*.5);f.top=r-e,f.left=n-t,f.width=t,f.height=e}return d}if(u){for(let n in i){let{collapsed:r,width:a,height:o,left:s,top:c,node:l}=i[n];if(r||a<=1||o<=1)continue;let{edgeBar:u,edgeSlot:p}=l;if(u&&p&&e>=s&&e<=s+a&&t>=c&&t<=c+o){if(p===`left-top`||p===`left-bottom`||p===`right-top`||p===`right-bottom`){let e=p.startsWith(`right`)?`right`:`left`,n=(t-c)/Math.max(1,o);if(d.kind=`edge-slot`,n<.25)d.edgeSlot=`${e}-top`,f.top=c,f.left=s,f.width=a,f.height=Math.round(o*.5);else if(n>.75){let t=Math.round(o*.5);d.edgeSlot=`${e}-bottom`,f.top=c+o-t,f.left=s,f.width=a,f.height=t}else d.edgeSlot=p,f.top=c,f.left=s,f.width=a,f.height=o}else{let t=(e-s)/Math.max(1,a);if(d.kind=`edge-slot`,t<.25)d.edgeSlot=`bottom-left`,f.top=c,f.left=s,f.width=Math.round(a*.5),f.height=o;else if(t>.75){let e=Math.round(a*.5);d.edgeSlot=`bottom-right`,f.top=c,f.left=s+a-e,f.width=e,f.height=o}else d.edgeSlot=p,f.top=c,f.left=s,f.width=a,f.height=o}return d}}return d}if(e<0||t<0||e>n||t>r)return zt(d,e,t,n,r);if(t<=Rt)return d.kind=`root-zone`,d.zone=`top`,f.top=0,f.left=0,f.width=n,f.height=Math.round(r*.22),d;if(t>=r-Lt){let e=Math.round(r*.22);return d.kind=`root-zone`,d.zone=`bottom`,f.top=r-e,f.left=0,f.width=n,f.height=e,d}if(e<=Lt)return d.kind=`root-zone`,d.zone=`left`,f.top=0,f.left=0,f.width=Math.round(n*.22),f.height=r,d;if(e>=n-Lt){let e=Math.round(n*.22);return d.kind=`root-zone`,d.zone=`right`,f.top=0,f.left=n-e,f.width=e,f.height=r,d}if(s&&s.length>0){let n=null,r=-1/0,i=0,a=0,o=0,l=0;for(let c=0;c<s.length;c++){let u=s[c];if(!u)continue;let{left:d,top:f,width:p,height:m,zOrder:h}=u,g=d,_=f,v=p,y=m;if(e>=g&&e<=g+v&&t>=_&&t<=_+y){let e=h||0;e>=r&&(r=e,n=u,i=g,a=_,o=v,l=y)}}if(n&&!n.originEdgeSlot){let{id:r,views:s}=n;if(t<=a+40){let t=s.length,n=Math.max(0,e-i-44),c=Math.min(t,Math.max(0,Math.floor((n+58)/116)));d.kind=`tab-bar`,d.groupId=r,d.tabInsertIndex=c;let l=Math.min(i+o-8,i+44+c*116);return f.top=a+4,f.left=l,f.width=4,f.height=32,d}return r!==c&&(d.kind=`floating-group`,d.groupId=r,d.zone=`center`,f.top=a,f.left=i,f.width=o,f.height=l),d}}for(let a in i){let{collapsed:o,width:s,height:c,left:l,top:u,node:p}=i[a];if(!(o||s<=1||c<=1)&&e>=l&&e<=l+s&&t>=u&&t<=u+c){let{locked:i,edgeBar:o,showHeader:m,views:h}=p;if(i||o)return zt(d,e,t,n,r);let g=m!==!1;if(g&&t<=u+40){let t=h.length,n=Math.max(0,e-l-6),r=Math.min(t,Math.max(0,Math.floor((n+64)/128)));d.kind=`tab-bar`,d.groupId=a,d.tabInsertIndex=r;let i=Math.min(l+s-8,l+6+r*128);return f.top=u+4,f.left=i,f.width=4,f.height=32,d}let _=g?40:0,v=u+_,y=Math.max(1,c-_),b=(e-l)/s,x=(t-v)/y,S=.25,C=`center`;if(b<S?C=`left`:b>.75?C=`right`:x<S?C=`top`:x>.75&&(C=`bottom`),d.kind=`group-zone`,d.groupId=a,d.zone=C,C===`center`)f.top=u,f.left=l,f.width=s,f.height=c;else if(C===`left`)f.top=u,f.left=l,f.width=Math.round(s*.5),f.height=c;else if(C===`right`){let e=Math.round(s*.5);f.top=u,f.left=l+s-e,f.width=e,f.height=c}else if(C===`top`)f.top=u,f.left=l,f.width=s,f.height=Math.round(c*.5);else{let e=Math.round(c*.5);f.top=u+c-e,f.left=l,f.width=s,f.height=e}return d}}return d}var Vt=class{#e;#t;#n;#r;#i=null;#a={mode:`tab`,viewId:``,sourceGroupId:``,cursorX:0,cursorY:0,hitTarget:null};#o={mode:`tab`,viewId:``,sourceGroupId:``,hideGhost:!0,cursorX:0,cursorY:0,hitTarget:null};#s=Pt();#c=0;get dragSession(){return this.#i}#l=!1;#u=!1;#d=!1;#f=`tab`;#p=``;#m=``;#h=null;#g=0;#_=0;#v=0;#y=0;#b=!1;#x;#S;#C;#w;#T;constructor(e,t,n,r){this.#e=e,this.#t=t,this.#n=n,this.#r=r,this.#T=()=>{this.#c=0,this.#u&&this.#E()},this.#x=e=>{if(!this.#l&&!this.#u)return;let{clientX:t,clientY:n,altKey:r}=e;if(this.#v=t,this.#y=n,this.#b=r,!this.#u){if(Math.hypot(this.#v-this.#g,this.#y-this.#_)<6)return;this.#u=!0,document.body.style.cursor=`grabbing`,document.body.style.userSelect=`none`,document.body.setAttribute(`data-reddokia-dragging`,`true`)}this.#c||=requestAnimationFrame(this.#T)},this.#S=()=>{this.#D(!1)},this.#C=()=>{this.#D(!0)},this.#w=e=>{e.key===`Escape`&&(e.preventDefault(),this.#D(!0))}}consumeClickSuppression(){return this.#d?(this.#d=!1,!0):!1}startDockDragSession(e,t,n,r){if(e.button!==void 0&&e.button!==0)return;let{clientX:i,clientY:a,altKey:o}=e;this.#d=!1,this.#l=!0,this.#u=!1,this.#f=t,this.#p=n,this.#m=r,this.#h=null,this.#g=i,this.#_=a,this.#v=i,this.#y=a,this.#b=!!o,window.addEventListener(`pointermove`,this.#x),window.addEventListener(`pointerup`,this.#S),window.addEventListener(`pointercancel`,this.#C),window.addEventListener(`keydown`,this.#w)}startExternalDragSession(e,t){t?.viewId&&(this.startDockDragSession(e,`tab`,t.viewId,``),this.#h=t)}handleNativeDragOver(e){if(this.#u||!this.#e.options.onExternalNativeDrop)return;let t=this.#n();if(!t)return;e.preventDefault();try{e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`)}catch{}let n=t.getBoundingClientRect(),r=e.clientX-n.left,i=e.clientY-n.top,a=this.#e.solveGeometry(),{width:o,height:s}=this.#e.containerSize,c=Bt(r,i,o,s,a.groupRects,null,this.#s,this.#e.layoutState.floatingGroups||[],``,!1,!1),l=this.#o;l.cursorX=e.clientX,l.cursorY=e.clientY,l.hitTarget=c,l.pinLeft=void 0,l.pinTop=void 0,l.pinHorizontal=!1,l.pinSpan=void 0,this.#i=l,this.#r(a)}handleNativeDragLeave(e){if(this.#i!==this.#o)return;let t=this.#n(),n=e.relatedTarget;t&&n&&t.contains(n)||(this.#i=null,this.#r())}handleNativeDrop(e){let t=this.#e.options.onExternalNativeDrop;if(this.#u||!t)return;let n=this.#n();if(!n)return;e.preventDefault();let r=n.getBoundingClientRect(),i=e.clientX-r.left,a=e.clientY-r.top,o=this.#e.solveGeometry(),{width:s,height:c}=this.#e.containerSize,l=Bt(i,a,s,c,o.groupRects,null,this.#s,this.#e.layoutState.floatingGroups||[],``,!1,!1),u={kind:l.kind,groupId:l.groupId,zone:l.zone,edgeSlot:l.edgeSlot,tabInsertIndex:l.tabInsertIndex,previewRect:{...l.previewRect}};this.#i===this.#o&&(this.#i=null,this.#r());let d=e.dataTransfer?.files?Array.from(e.dataTransfer.files):[],f=t({event:e,dataTransfer:e.dataTransfer,files:d,targetGroupId:u.groupId||null,zone:u.zone||`center`,clientX:e.clientX,clientY:e.clientY,controller:this.#e.controller});if(!f)return;let p=Array.isArray(f)?f:[f];for(let e=0;e<p.length;e++){let t=p[e];t?.viewId&&(this.#e.prepareExternalViewPatch(t),u.kind===`none`?this.#e.controller.openView(t.viewId,{templateId:t.templateId,title:t.title,icon:t.icon,params:t.params}):this.#O(u,t.viewId,``))}}#E(){let e=this.#n(),t=this.#t();if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=this.#v-r.left,a=this.#y-r.top,o=this.#e.solveGeometry(),{width:s,height:c}=this.#e.containerSize,l=null,u,d,f,p=!1,m;if(this.#f===`edge-item`){let e=t.querySelector(`.rd-edgebar--left`),r=t.querySelector(`.rd-edgebar--right`),o=null,h=null;if(e){let t=e.getBoundingClientRect();this.#v>=t.left-8&&this.#v<=t.right+8&&this.#y>=t.top&&this.#y<=t.bottom&&(o=`left`,h=e)}if(!o&&r){let e=r.getBoundingClientRect();this.#v>=e.left-8&&this.#v<=e.right+8&&this.#y>=e.top&&this.#y<=e.bottom&&(o=`right`,h=r)}if(o||(i<=24&&a>=0&&a<=c?o=`left`:i>=s-24&&a>=0&&a<=c&&(o=`right`)),o){let e=o===`left`?`left-top`:`right-top`,t=o===`left`?`left-bottom`:`right-bottom`,r=o===`left`?`bottom-left`:`bottom-right`;if(h){let i=h.getBoundingClientRect(),a=h.querySelector(`[data-edge-slot="${e}"]`),o=h.querySelector(`[data-edge-slot="${t}"]`),s=h.querySelector(`[data-edge-slot="${r}"]`),c=a?a.querySelectorAll(`[data-edge-view-id]`):null,g=o?o.querySelectorAll(`[data-edge-view-id]`):null,_=s?s.querySelectorAll(`[data-edge-view-id]`):null,v=!!(c&&c.length>0),y=!!(g&&g.length>0),b=!!(_&&_.length>0),x=v?c[c.length-1].getBoundingClientRect().bottom:i.top+8,S=y?g[0].getBoundingClientRect().top:x+20,C=y?g[g.length-1].getBoundingClientRect().bottom:x,w=b?_[0].getBoundingClientRect().top:i.bottom-36,T=b?Math.max(C+12,w-16):Math.max(C+24,i.top+i.height*.7),E=v&&y?(x+S)*.5:y?S-8:x+20,D=this.#y>=T,O=!D&&this.#y>=E;l=D?r:O?t:e;let k=D?_:O?g:c;if(p=!0,d=i.left-n.left+5,m=Math.max(16,i.width-10),k&&k.length>0){let e=k.length;for(let t=0;t<k.length;t++){let r=k[t].getBoundingClientRect(),i=r.top+r.height*.5;if(this.#y<i){e=t,f=r.top-n.top-2;break}f=r.bottom-n.top+2}u=e}else u=0,f=(D?i.bottom-18:O?v?x+10:i.top+28:i.top+10)-n.top}else l=a>=c*.7?r:a<c*.35?e:t,u=0}}let h=Bt(i,a,s,c,o.groupRects,l,this.#s,this.#e.layoutState.floatingGroups||[],this.#m,this.#b,this.#f===`edge-item`);if(u!==void 0&&h.kind===`edge-slot`&&(h.tabInsertIndex=u),h.kind===`tab-bar`&&h.groupId){let e=h.groupId,n=o.groupRects[e];if(n&&!n.collapsed&&!n.node.locked){let i=t.querySelector(`[data-tab-list-group="${e}"]`);i&&yt(i,this.#v);let a=t.querySelectorAll(`[data-group-id="${e}"] [data-tab-view-id]`),o=n.node.views.length;f=n.top+4,d=n.left+8;for(let e=0;e<a.length;e++){let t=a[e].getBoundingClientRect(),n=t.left+t.width/2;if(this.#v<n){o=e,d=t.left-r.left;break}d=t.right-r.left}h.tabInsertIndex=o}}let g=this.#a;g.mode=this.#f,g.viewId=this.#p,g.sourceGroupId=this.#m,g.ghostTitle=this.#h?.title,g.hideGhost=!1,g.cursorX=this.#v,g.cursorY=this.#y,g.hitTarget=h,g.pinLeft=d,g.pinTop=f,g.pinHorizontal=p,g.pinSpan=m,this.#i=g,this.#r(o)}#D(e){this.#c&&=(cancelAnimationFrame(this.#c),0),window.removeEventListener(`pointermove`,this.#x),window.removeEventListener(`pointerup`,this.#S),window.removeEventListener(`pointercancel`,this.#C),window.removeEventListener(`keydown`,this.#w),document.body.style.cursor=``,document.body.style.userSelect=``,document.body.removeAttribute(`data-reddokia-dragging`);let t=this.#u,n=this.#i,r=this.#h;if(this.#l=!1,this.#u=!1,this.#i=null,this.#h=null,t&&(this.#d=!0),!t||e||!n?.hitTarget||n.hitTarget.kind===`none`){this.#r();return}r&&this.#e.prepareExternalViewPatch(r);let{hitTarget:i,viewId:a,sourceGroupId:o}=n;this.#O(i,a,o),this.#r()}#O(e,t,n){let{kind:r,groupId:i,zone:a,edgeSlot:o,tabInsertIndex:s,previewRect:c}=e;if(r===`edge-slot`&&o)this.#e.setLayoutState(e=>{let n=Ve(e.floatingGroups,t),r=ve(e.rootGrid,t,o,this.#e.getFallbackTreeFactory(),s);return{...e,activeGroupId:r.activeGroupId||e.activeGroupId,rootGrid:r.rootGrid,floatingGroups:n}});else if(r===`root-zone`&&a&&a!==`center`){let e=a;this.#e.setLayoutState(n=>{let r=Ve(n.floatingGroups,t),i=ye(n.rootGrid,t,e,this.#e.getFallbackTreeFactory());return{...n,activeGroupId:i.activeGroupId,rootGrid:i.rootGrid,floatingGroups:r}})}else if((r===`floating-group`||r===`tab-bar`&&(this.#e.layoutState.floatingGroups||[]).some(e=>e.id===i))&&i)this.#e.setLayoutState(e=>{let n=le(e.rootGrid,t,this.#e.getFallbackTreeFactory(),this.#e.mruViewIds),r=(e.floatingGroups||[]).map(e=>{if(e.id===i){let n=[...e.views.filter(e=>e!==t)],r=s===null?n.length:Math.min(s,n.length);return n.splice(r,0,t),{...e,views:n,activeViewId:t}}if(e.views.includes(t)){let n=e.views.filter(e=>e!==t);return{...e,views:n,activeViewId:e.activeViewId===t?n[0]||null:e.activeViewId}}return e}).filter(e=>e.views.length>0);return{...e,activeGroupId:i,rootGrid:n,floatingGroups:V(r,i)}});else if(r===`tear-off-float`)this.#e.floatView(t,{left:c.left,top:c.top});else if((r===`tab-bar`||r===`group-zone`)&&i){let e=G(this.#e.layoutState.rootGrid,i);if(!e?.locked){let o=a||`center`;n===i&&e&&e.views.length<=1||this.#e.setLayoutState(e=>{let n=Ve(e.floatingGroups,t);if(r===`tab-bar`||o===`center`){let r=be(e.rootGrid,i,t,s??999,this.#e.getFallbackTreeFactory(),this.#e.getPinnedViewIdsSet());return{...e,activeGroupId:i,rootGrid:r,floatingGroups:n}}let a=_e(e.rootGrid,t,i,o,this.#e.getFallbackTreeFactory());return{...e,activeGroupId:a.activeGroupId,rootGrid:a.rootGrid,floatingGroups:n}})}}}destroy(){this.#D(!0)}},Ht=class{#e;#t=0;#n=!1;#r=``;#i=0;#a=0;#o=0;#s=0;#c=0;#l=0;#u=0;#d=0;#f=!1;#p=``;#m=`se`;#h=0;#g=0;#_=0;#v=0;#y=0;#b=0;#x=0;#S=0;#C=240;#w=160;#T=9999;#E=9999;#D;#O;#k;#A;#j;#M;constructor(e){this.#e=e,this.#k=()=>{if(this.#t=0,!this.#n)return;let e=this.#o-this.#i,t=this.#s-this.#a,{width:n,height:r}=this.#e.containerSize,i=Math.max(0,n-this.#u),a=Math.max(0,r-this.#d),o=Math.max(0,Math.min(i,this.#c+e)),s=Math.max(0,Math.min(a,this.#l+t)),c=this.#e.layoutState;this.#e.layoutState={...c,floatingGroups:(c.floatingGroups||[]).map(e=>e.id===this.#r?{...e,left:Math.round(o),top:Math.round(s)}:e)},this.#e.notify()},this.#D=e=>{if(!this.#n)return;let{clientX:t,clientY:n}=e;this.#o=t,this.#s=n,this.#t||=requestAnimationFrame(this.#k)},this.#O=()=>{this.#n&&(this.#n=!1,this.#t&&=(cancelAnimationFrame(this.#t),0),document.body.style.cursor=``,document.body.style.userSelect=``,document.body.removeAttribute(`data-reddokia-dragging`),window.removeEventListener(`pointermove`,this.#D),window.removeEventListener(`pointerup`,this.#O),window.removeEventListener(`pointercancel`,this.#O),this.#e.setLayoutState(e=>({...e})))},this.#M=()=>{if(this.#t=0,!this.#f)return;let e=this.#_-this.#h,t=this.#v-this.#g,n=this.#m,r=this.#y,i=this.#b,a=this.#x,o=this.#S;if(n.includes(`e`)&&(a=Math.max(this.#C,Math.min(this.#T,this.#x+e))),n.includes(`s`)&&(o=Math.max(this.#w,Math.min(this.#E,this.#S+t))),n.includes(`w`)){let t=Math.max(this.#C,Math.min(this.#T,this.#x-e));r=this.#y+(this.#x-t),a=t}if(n.includes(`n`)){let e=Math.max(this.#w,Math.min(this.#E,this.#S-t));i=Math.max(0,this.#b+(this.#S-e)),o=e}let s=this.#e.layoutState;this.#e.layoutState={...s,floatingGroups:(s.floatingGroups||[]).map(e=>e.id===this.#p?{...e,left:Math.round(r),top:Math.round(i),width:Math.round(a),height:Math.round(o)}:e)},this.#e.notify()},this.#A=e=>{if(!this.#f)return;let{clientX:t,clientY:n}=e;this.#_=t,this.#v=n,this.#t||=requestAnimationFrame(this.#M)},this.#j=()=>{this.#f&&(this.#f=!1,this.#t&&=(cancelAnimationFrame(this.#t),0),document.body.style.cursor=``,document.body.style.userSelect=``,document.body.removeAttribute(`data-reddokia-dragging`),window.removeEventListener(`pointermove`,this.#A),window.removeEventListener(`pointerup`,this.#j),window.removeEventListener(`pointercancel`,this.#j),this.#e.setLayoutState(e=>({...e})))}}bringFloatingWindowToFront(e){this.#e.setLayoutState(t=>{let n=t.floatingGroups||[],r=n.reduce((e,t)=>Math.max(e,t.zOrder||0),0),i=n.find(t=>t.id===e);return t.activeGroupId===e&&i&&(i.zOrder||0)===r?t:{...t,activeGroupId:e,floatingGroups:V(n,e)}})}handleFloatingHeaderPointerDown(e,t){if(e.button!==0||e.target?.closest(`button, input, .rd-tab:not(.edgebar-single)`))return;e.preventDefault();let{id:n,left:r,top:i,width:a,height:o}=t,{clientX:s,clientY:c}=e;this.bringFloatingWindowToFront(n),this.#n=!0,this.#r=n,this.#i=s,this.#a=c,this.#o=s,this.#s=c,this.#c=r,this.#l=i,this.#u=a,this.#d=o,document.body.style.cursor=`grabbing`,document.body.style.userSelect=`none`,document.body.setAttribute(`data-reddokia-dragging`,`true`),window.addEventListener(`pointermove`,this.#D),window.addEventListener(`pointerup`,this.#O),window.addEventListener(`pointercancel`,this.#O)}handleFloatingResizePointerDown(e,t,n){if(e.button!==0)return;e.preventDefault(),e.stopPropagation();let{id:r,activeViewId:i,views:a,left:o,top:s,width:c,height:l}=t,{clientX:u,clientY:d}=e;this.bringFloatingWindowToFront(r);let f=this.#e.getViewsMap(),p=i||a[0],m=p?f.get(p):void 0;this.#f=!0,this.#p=r,this.#m=n,this.#h=u,this.#g=d,this.#_=u,this.#v=d,this.#y=o,this.#b=s,this.#x=c,this.#S=l,this.#C=Math.max(220,m?.minWidth||240),this.#w=Math.max(140,(m?.minHeight||120)+32),this.#T=m?.maxWidth||9999,this.#E=m?.maxHeight?m.maxHeight+32:9999,document.body.style.userSelect=`none`,document.body.setAttribute(`data-reddokia-dragging`,`true`),window.addEventListener(`pointermove`,this.#A),window.addEventListener(`pointerup`,this.#j),window.addEventListener(`pointercancel`,this.#j)}destroy(){let e=this.#n||this.#f;this.#n=!1,this.#f=!1,this.#t&&=(cancelAnimationFrame(this.#t),0),typeof window<`u`&&(window.removeEventListener(`pointermove`,this.#D),window.removeEventListener(`pointerup`,this.#O),window.removeEventListener(`pointercancel`,this.#O),window.removeEventListener(`pointermove`,this.#A),window.removeEventListener(`pointerup`,this.#j),window.removeEventListener(`pointercancel`,this.#j)),e&&typeof document<`u`&&(document.body.style.cursor=``,document.body.style.userSelect=``,document.body.removeAttribute(`data-reddokia-dragging`))}},Ut=32,J=new Uint8Array(Ut),Y=new Float64Array(Ut),X=new Float64Array(Ut),Z=new Float64Array(Ut),Wt=new Float64Array(Ut);function Gt(e,t){if(e.type===`split`){if(e.id===t)return e;for(let n=0;n<e.children.length;n++){let r=Gt(e.children[n],t);if(r)return r}}return null}function Kt(e,t,n,r){let{splitId:i,orientation:a,beforeId:o,afterId:s}=t,c=Gt(e,i);if(!c)return null;let l=a===`horizontal`,{children:u,orientation:d}=c,f=Math.min(u.length,Ut),p=-1,m=-1,h=0,g=0;for(let e=0;e<f;e++){let t=u[e],{id:i,size:a,constraints:c}=t;i===o?p=e:i===s&&(m=e);let f=ee(t);J[e]=+!f;let _=n[i],v=(_?l?_.width:_.height:0)||a||220;Y[e]=f?0:v,X[e]=Y[e],Z[e]=te(t,d,r),Wt[e]=ne(t,d,r),!f&&!c?.fixed&&(h+=Math.max(1,a||100),g+=v)}let _=h>0&&g>0?g/h:1;for(let e=0;e<f;e++){let t=u[e],{cachedSize:n,size:r,constraints:i}=t;if(J[e]===1)t.size=Y[e];else if(!i?.fixed&&_>1.2){let i=Z[e],a=Wt[e],o=Math.max(i,Math.min(a,Math.round((n||r||20)*_)));t.size=o,t.cachedSize=o}}if(p===-1||m===-1)return null;let v=u[p],y=u[m],b=Y[p],x=Y[m],S=Z[p],C=Z[m],w=!(!v.constraints?.snap||v.type===`split`&&v.isContentsStage||v.type===`group`&&v.isContentsRootGroup),T=!(!y.constraints?.snap||y.type===`split`&&y.isContentsStage||y.type===`group`&&y.isContentsRootGroup);return{targetSplit:c,childCount:f,beforeIdx:p,afterIdx:m,initialBeforePx:b,initialAfterPx:x,minBefore:S,minAfter:C,canSnapBefore:w,canSnapAfter:T}}function qt(e,t){let{targetSplit:n,childCount:r,beforeIdx:i,afterIdx:a,initialBeforePx:o,initialAfterPx:s,minBefore:c,minAfter:l,canSnapBefore:u,canSnapAfter:d}=e,f=n.children;for(let e=0;e<r;e++)X[e]=Y[e],J[e]===1&&(f[e].collapsed=!1);let p=f[i],m=f[a],h=o+s,g=0;for(let e=i;e>=0;e--){if(J[e]===0)continue;let t=Y[e]-Z[e];t>0&&(g+=t)}let _=0;for(let e=a;e<r;e++){if(J[e]===0)continue;let t=Y[e]-Z[e];t>0&&(_+=t)}let v=-t-g,y=t-_;if(t<0&&v>c*.55&&u)p.collapsed=!0,p.cachedSize=o,m.collapsed=!1,m.size=h;else if(t>0&&y>l*.55&&d)m.collapsed=!0,m.cachedSize=s,p.collapsed=!1,p.size=h;else if(t>0){let e=0;for(let t=i;t>=0;t--){if(J[t]===0)continue;let n=Wt[t]-Y[t];n>0&&(e+=n)}let n=t<e?t:e,o=0;for(let e=a;e<r&&n>0;e++){if(J[e]===0)continue;let t=Math.max(0,Y[e]-Z[e]),r=n<t?n:t;X[e]=Y[e]-r,n-=r,o+=r}let s=o;for(let e=i;e>=0&&s>0;e--){if(J[e]===0)continue;let t=Math.max(0,Wt[e]-Y[e]),n=s<t?s:t;X[e]=Y[e]+n,s-=n}for(let e=0;e<r;e++)J[e]===1&&(f[e].size=X[e])}else if(t<0){let e=-t,n=0;for(let e=a;e<r;e++){if(J[e]===0)continue;let t=Wt[e]-Y[e];t>0&&(n+=t)}let o=e<n?e:n,s=0;for(let e=i;e>=0&&o>0;e--){if(J[e]===0)continue;let t=Math.max(0,Y[e]-Z[e]),n=o<t?o:t;X[e]=Y[e]-n,o-=n,s+=n}let c=s;for(let e=a;e<r&&c>0;e++){if(J[e]===0)continue;let t=Math.max(0,Wt[e]-Y[e]),n=c<t?c:t;X[e]=Y[e]+n,c-=n}for(let e=0;e<r;e++)J[e]===1&&(f[e].size=X[e])}}var Jt=class{#e;#t=0;#n=!1;#r=null;#i=!1;#a=null;#o=!0;#s=0;#c=0;#l=0;#u=0;#d;#f;#p;constructor(e){this.#e=e,this.#p=()=>{if(this.#t=0,!this.#n||!this.#a||!this.#r)return;let e=this.#o?this.#l-this.#s:this.#u-this.#c;Math.abs(e)>0&&(this.#i=!0),qt(this.#a,e),this.#e.layoutState={...this.#e.layoutState,rootGrid:this.#r},this.#e.notify()},this.#d=e=>{if(!this.#n)return;let{clientX:t,clientY:n}=e;this.#l=t,this.#u=n,this.#t||=requestAnimationFrame(this.#p)},this.#f=()=>{if(!this.#n)return;this.#n=!1,this.#a=null;let e=this.#r,t=this.#i;this.#r=null,this.#i=!1,this.#t&&=(cancelAnimationFrame(this.#t),0),document.body.style.cursor=``,document.body.style.userSelect=``,document.body.removeAttribute(`data-reddokia-dragging`),window.removeEventListener(`pointermove`,this.#d),window.removeEventListener(`pointerup`,this.#f),window.removeEventListener(`pointercancel`,this.#f),e&&t&&this.#e.setLayoutState(t=>({...t,rootGrid:e}))}}handleSashPointerDown(e,t,n){e.preventDefault(),e.stopPropagation();let{rootGrid:r}=this.#e.layoutState,i=A(r),a=Kt(i,t,n.nodeRects,this.#e.getViewsRecord());if(!a)return;let{clientX:o,clientY:s}=e,c=t.orientation===`horizontal`;this.#n=!0,this.#r=i,this.#i=!1,this.#a=a,this.#o=c,this.#s=o,this.#c=s,this.#l=o,this.#u=s,document.body.style.cursor=c?`col-resize`:`row-resize`,document.body.style.userSelect=`none`,document.body.setAttribute(`data-reddokia-dragging`,`true`),window.addEventListener(`pointermove`,this.#d),window.addEventListener(`pointerup`,this.#f),window.addEventListener(`pointercancel`,this.#f)}handleSashDoubleClick(e){let{splitId:t}=e;this.#e.setLayoutState(e=>({...e,rootGrid:xe(e.rootGrid,t)}))}destroy(){let e=this.#n||!!this.#a;this.#n=!1,this.#a=null,this.#r=null,this.#i=!1,this.#t&&=(cancelAnimationFrame(this.#t),0),typeof window<`u`&&(window.removeEventListener(`pointermove`,this.#d),window.removeEventListener(`pointerup`,this.#f),window.removeEventListener(`pointercancel`,this.#f)),e&&typeof document<`u`&&(document.body.style.cursor=``,document.body.style.userSelect=``,document.body.removeAttribute(`data-reddokia-dragging`))}};function Yt(e,t){return e>0&&t===0&&(console.warn(`[RedDokia] Host container has 0px height (width: ${Math.round(e)}px, height: 0px). Ensure the parent element has an explicit height (e.g., style="height: 100vh" or flex: 1).`),!0)}var Xt=class{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;#x=/* @__PURE__ */ new Map;#S=/* @__PURE__ */ new Map;#C=/* @__PURE__ */ new Map;#w=/* @__PURE__ */ new Map;#T=/* @__PURE__ */ new Set;#E=/* @__PURE__ */ new Set;#D=/* @__PURE__ */ new Map;#O=null;#k=void 0;#A=null;#j;#M=!1;constructor(e,t,n){g(e?.ownerDocument,{disabled:t.injectStyles===!1,nonce:t.styleNonce}),this.#o=e,this.#s=n,this.#e=new Ze(t),this.#t=this.#e.controller,Object.assign(this,this.#t),this.#n=document.createElement(`div`),this.#n.className=`reddokia-root${t.className?` ${t.className}`:``}`,this.#n.style.width=`100%`,this.#n.style.height=`100%`,this.#n.style.flex=`1 1 0%`,this.#n.style.minWidth=`0`,this.#n.style.minHeight=`0`,this.#n.style.display=`flex`,this.#n.style.flexDirection=`column`,this.#n.style.position=`relative`,this.#n.style.overflow=`hidden`,this.#n.addEventListener(`pointerdown`,()=>{let e=!1;this.#e.contextMenu&&(this.#e.contextMenu=null,e=!0),this.#d.closeMenuDropdown(),this.#m.closeOverflowDropdown(),e&&this.#e.notify()}),this.#r=document.createElement(`div`),this.#r.className=`rd-main-area`,this.#r.style.flex=`1 1 0%`,this.#r.style.minWidth=`0`,this.#r.style.minHeight=`0`,this.#r.style.display=`flex`,this.#r.style.position=`relative`,this.#r.style.overflow=`hidden`,this.#i=document.createElement(`main`),this.#i.className=`rd-grid-container`,this.#i.style.flex=`1 1 0%`,this.#i.style.minWidth=`0`,this.#i.style.minHeight=`0`,this.#i.style.position=`relative`,this.#i.style.overflow=`visible`,this.#i.setAttribute(`aria-label`,`Workspace docking grid`),this.#a=document.createElement(`div`),this.#a.setAttribute(`aria-hidden`,`true`),this.#a.style.display=`none`,this.#r.appendChild(this.#i),this.#n.appendChild(this.#r),this.#n.appendChild(this.#a),this.#o.appendChild(this.#n),this.#c=new Jt(this.#e),this.#l=new Ht(this.#e),this.#u=new Vt(this.#e,()=>this.#n,()=>this.#i,e=>{if(!this.#M){let t=e??this.#e.solveGeometry();this.#_.sync(t,this.#u.dragSession)}}),this.#e.setExternalDragStarter((e,t)=>{this.#u.startExternalDragSession(e,t)}),this.#i.addEventListener(`dragover`,e=>{this.#u.handleNativeDragOver(e)}),this.#i.addEventListener(`dragleave`,e=>{this.#u.handleNativeDragLeave(e)}),this.#i.addEventListener(`drop`,e=>{this.#u.handleNativeDrop(e)});let r=e=>this.#P(e),i=n?.customIconBridge,a=n?.mountDynamicComponent;this.#d=new Nt(this.#e,this.#n,a,i),this.#f=new vt(`left`,this.#e,this.#r,i,this.#u),this.#p=new vt(`right`,this.#e,this.#r,i,this.#u),this.#m=new St(this.#e,this.#i,this.#u,r,i,a),this.#h=new xt(this.#e,this.#i,this.#l,this.#u,r,i),this.#g=new Et(this.#e,this.#i,this.#c),this.#_=new lt(this.#e,this.#n,this.#i),this.#v=new Mt(this.#e,this.#n,i),this.#y=new Dt(this.#e,this.#n,a),this.#b=new Tt(this.#e,r,this.#a);let o=this.#e.getActiveTheme(),s=this.#e.options.style;mt(this.#n,o,s),this.#O=o,this.#k=s;let c=this.#e.getActiveTopBarSchema();this.#d.sync(!!this.#s?.hasTopBarRight?.(c?.right),!!this.#s?.hasTopBarLeft?.(c?.left)),this.#f.sync(this.#i),this.#p.sync(null);let l=this.#e.getActiveStatusBarSchema();this.#y.sync(!!this.#s?.hasStatusBarRight?.(l?.right),!!this.#s?.hasStatusBarLeft?.(l?.left)),this.#N(),this.#j=this.#e.subscribe(()=>{this.#F()}),this.#F(),this.#e.options.onReady?.(this.#t),typeof requestAnimationFrame==`function`&&requestAnimationFrame(()=>{if(this.#M)return;let{width:e,height:t}=this.#o.getBoundingClientRect();Yt(e,t)})}get controller(){return this.#t}get rootElement(){return this.#n}#N(){let{width:e,height:t}=this.#i.getBoundingClientRect();e>0&&t>0&&this.#e.setContainerSize(Math.round(e),Math.round(t)),typeof ResizeObserver<`u`&&(this.#A=new ResizeObserver(e=>{for(let t=0;t<e.length;t++){let{width:n,height:r}=e[t].contentRect;n>0&&r>0&&this.#e.setContainerSize(Math.round(n),Math.round(r))}}),this.#A.observe(this.#i))}#P(e){let t=this.#x.get(e);return t||(t=document.createElement(`div`),t.id=`rd-tabpanel-${e}`,t.setAttribute(`role`,`tabpanel`),t.setAttribute(`data-view-host`,e),t.className=`rd-view-host`,t.style.width=`100%`,t.style.height=`100%`,t.style.flex=`1 1 0%`,t.style.minWidth=`0`,t.style.minHeight=`0`,t.style.position=`relative`,this.#a.appendChild(t),this.#x.set(e,t)),t}getViewHostElement(e){return this.#x.get(e)??null}getMountedViewEntries(){let e=[];for(let t of this.#e.everMountedViewIds){let n=this.#x.get(t),r=this.#S.get(t);n&&r&&e.push({viewId:t,hostEl:n,renderProps:r})}return e}getActiveTopBarSchema(){return this.#e.getActiveTopBarSchema()}getActiveStatusBarSchema(){return this.#e.getActiveStatusBarSchema()}getActiveEmptyContentsRenderer(){return this.#e.getActiveEmptyContentsRenderer()}getCustomEmptyContentsSlots(){return this.#m.customEmptyContentsSlots}getCustomGroupActionsSlots(){return this.#m.customGroupActionsSlots}getCustomTopBarLeftElement(){return this.#d.getCustomLeftSlotElement()}getCustomTopBarRightElement(){return this.#d.getCustomRightSlotElement()}getCustomStatusBarLeftElement(){return this.#y.getCustomLeftSlotElement()}getCustomStatusBarRightElement(){return this.#y.getCustomRightSlotElement()}setOptions(e){this.#M||(e.className!==void 0&&(this.#n.className=`reddokia-root${e.className?` ${e.className}`:``}`),this.#e.updateOptions(e))}#F(){if(this.#M)return;let e=this.#e.getActiveTheme(),t=this.#e.options.style;(e!==this.#O||t!==this.#k)&&(mt(this.#n,e,t),this.#O=e,this.#k=t);let n=this.#e.getActiveTopBarSchema();this.#d.sync(!!this.#s?.hasTopBarRight?.(n?.right),!!this.#s?.hasTopBarLeft?.(n?.left));let r=this.#e.getEdgeGroups();this.#f.sync(this.#i,r),this.#p.sync(null,r);let i=this.#e.getActiveStatusBarSchema();this.#y.sync(!!this.#s?.hasStatusBarRight?.(i?.right),!!this.#s?.hasStatusBarLeft?.(i?.left));let a=this.#i.clientWidth,o=this.#i.clientHeight;a>0&&o>0&&(this.#e.containerSize.width!==a||this.#e.containerSize.height!==o)&&(this.#e.containerSize={width:a,height:o});let s=this.#e.solveGeometry();for(let e of this.#e.everMountedViewIds)this.#P(e);for(let[e,t]of this.#x)if(!this.#e.everMountedViewIds.has(e)){let n=this.#C.get(e);if(n){try{n.cleanup?.()}catch{}this.#C.delete(e)}t.remove(),this.#x.delete(e),this.#S.delete(e),this.#w.delete(e)}this.#m.sync(s,{hasCustomEmptyContents:!!this.#s?.hasEmptyContents?.(this.#e.getActiveEmptyContentsRenderer()),hasCustomGroupActions:this.#s?.hasGroupActions}),this.#h.sync(),this.#b.sync();let c=this.#T;c.clear();let l=s.groupRects;for(let e in l){let t=l[e];!t.collapsed&&t.node.activeViewId&&c.add(t.node.activeViewId)}let u=this.#e.layoutState.floatingGroups;if(u)for(let e=0;e<u.length;e++){let t=u[e],n=t.activeViewId||t.views[0];n&&c.add(n)}let d=this.#D;d.clear();let f=this.#e.popoutWindows;for(let e=0;e<f.length;e++){let t=f[e],n=t.views&&t.views.length>0?t.views:[t.viewId],r=n.includes(t.viewId)?t.viewId:n[0];r&&c.add(r);for(let e=0;e<n.length;e++)d.set(n[e],t)}let p=this.#E;if(p.clear(),u&&u.length>0)for(let e=0;e<u.length;e++){let t=u[e].views;for(let e=0;e<t.length;e++)p.add(t[e])}let m=this.#e.getViewsMap();for(let e of this.#e.everMountedViewIds){let t=this.#P(e);c.has(e)||(t.style.display=`none`,ut(this.#a,t));let n=s.viewRects[e],r=d.size>0?d.get(e):void 0,i=m.get(e),a=!!(r&&r.viewId===e||n?.visible),o=!!r,l=!o&&p.has(e),u={viewId:e,viewSchema:i,params:i?.params||{},groupId:r?`popout`:n?.groupId||null,active:a,visible:a,isFloating:l,isPopout:o,width:r?r.width:n?.width||0,height:r?r.height:n?.height||0,layoutState:this.#e.layoutState,geometry:s,controller:this.#t};this.#S.set(e,u);let f=this.#C.get(e);if(f)f.update&&f.update(u);else if(i?.component){let n=this.#s?.mountDynamicComponent?this.#s.mountDynamicComponent(i.component,t,u):!this.#s&&typeof i.component==`function`?i.component(t,u):void 0;if(this.#s?.mountDynamicComponent||!this.#s&&typeof i.component==`function`){let t=null,r=null;if(typeof n==`function`)t=n;else if(n&&typeof n==`object`){let e=n;r=e.update??null,t=e.unmount??null}f={viewId:e,cleanup:t,update:r},this.#C.set(e,f)}}}this.#g.sync(s),this.#_.sync(s,this.#u.dragSession),this.#v.sync();let h=this.#e.options.onViewResize;if(h){let e=s.viewRects,t=null;for(let n in e){let{visible:r,groupId:i,top:a,left:o,width:s,height:c}=e[n];if(!r)continue;let l=`${i}:${s}x${c}`;this.#w.get(n)!==l&&(this.#w.set(n,l),t||={},t[n]={viewId:n,groupId:i,top:a,left:o,width:s,height:c,element:this.#x.get(n)??null})}t&&h(t)}this.#s?.onSync?.()}destroy(){if(!this.#M){this.#M=!0,this.#j(),this.#A?.disconnect(),this.#A=null;for(let e of this.#C.values())e.cleanup?.();this.#C.clear(),this.#u.destroy(),this.#l.destroy(),this.#c.destroy(),this.#b.destroy(),this.#v.destroy(),this.#_.destroy(),this.#g.destroy(),this.#h.destroy(),this.#m.destroy(),this.#f.destroy(),this.#p.destroy(),this.#d.destroy(),this.#y.destroy(),this.#e.destroy(),this.#n.remove(),this.#x.clear(),this.#S.clear()}}};function Q(e){return e?typeof e==`object`||typeof e==`function`&&e.length<2:!1}var Zt=[`viewId`,`viewSchema`,`groupId`,`active`,`visible`,`isFloating`,`isPopout`,`width`,`height`,`layoutState`,`geometry`,`controller`,`params`];function $(e){return e&&(typeof e==`object`||typeof e==`function`)&&!e.props&&(e.props=Zt),e}function Qt(e){return!e||!Array.isArray(e)?[]:e.map(e=>(e.component&&Q(e.component)&&$(e.component),e))}var $t=[`views`,`layout`,`onLayoutChange`,`onBeforeCloseView`,`onViewResize`,`onReady`,`tabContextMenu`,`theme`,`themeTokens`,`themes`,`locale`,`localeStrings`,`storageKey`,`className`,`style`,`groupActions`,`injectStyles`,`styleNonce`,`popoutFavicon`,`onExternalNativeDrop`];function en(c){return t({name:c,props:$t,emits:[`ready`,`layoutChange`,`viewResize`],setup(t,{slots:c,expose:l,emit:u}){let d=a(null),f=o(null),p=a(0),m=o([]),h={get controller(){return f.value?.controller??null}},_=()=>{let e=t.layout,n=e;return(c[`top-bar-left`]||c[`top-bar-right`]||c[`status-bar-left`]||c[`status-bar-right`])&&e&&typeof e==`object`&&!(`children`in e)&&(n={...e,...(c[`top-bar-left`]||c[`top-bar-right`])&&!e.topBar?{topBar:!0}:{},...(c[`status-bar-left`]||c[`status-bar-right`])&&!e.statusBar?{statusBar:!0}:{}}),{...t,views:Qt(t.views),layout:n,onReady:e=>{Object.assign(h,e),t.onReady?.(e),u(`ready`,e)},onLayoutChange:e=>{t.onLayoutChange?.(e),u(`layoutChange`,e)},onViewResize:e=>{t.onViewResize?.(e),u(`viewResize`,e)}}};return i(()=>{g(void 0,{disabled:t.injectStyles===!1,nonce:t.styleNonce});let e=d.value;if(!e)return;let n=new Xt(e,_(),{hasTopBarLeft:e=>!!c[`top-bar-left`]||Q(e),hasTopBarRight:e=>!!c[`top-bar-right`]||Q(e),hasStatusBarLeft:e=>!!c[`status-bar-left`]||Q(e),hasStatusBarRight:e=>!!c[`status-bar-right`]||Q(e),hasEmptyContents:e=>!!c[`empty-contents`]||Q(e),hasGroupActions:e=>!!c[`group-actions`]||Q(e),mountDynamicComponent:(e,t,n)=>{if(typeof e==`function`&&!Q(e))return e(t,n)},onSync:()=>{f.value&&(m.value=f.value.getMountedViewEntries(),p.value+=1)}});Object.assign(h,n.controller),f.value=n,m.value=n.getMountedViewEntries(),p.value+=1}),s(()=>[t.views,t.layout,t.theme,t.themeTokens,t.themes,t.locale,t.localeStrings,t.className,t.style,t.groupActions,t.tabContextMenu,t.onBeforeCloseView,t.popoutFavicon,t.onExternalNativeDrop],()=>{f.value&&f.value.setOptions(_())}),r(()=>{f.value&&=(f.value.destroy(),null),m.value=[]}),l(new Proxy(h,{get(e,t,n){if(t in e)return Reflect.get(e,t,n);let r=f.value?.controller;return r&&t in r?r[t]:Reflect.get(e,t,n)},has(e,t){if(t in e)return!0;let n=f.value?.controller;return!!(n&&t in n)}})),()=>{p.value;let t=[],r=m.value;for(let i=0;i<r.length;i++){let a=r[i],o=a.renderProps.viewSchema?.component;o&&Q(o)&&($(o),t.push(n(e,{to:a.hostEl,key:a.viewId},[n(o,a.renderProps)])))}let i=f.value;if(i){let r=c[`top-bar-left`],a=i.getActiveTopBarSchema()?.left;if(r||Q(a)){let o=i.getCustomTopBarLeftElement();if(o){let s={controller:i.controller,layoutState:i.getLayoutState()};r?t.push(n(e,{to:o,key:`topbar-left`},r(s))):a&&($(a),t.push(n(e,{to:o,key:`topbar-left`},[n(a,s)])))}}let o=c[`top-bar-right`],s=i.getActiveTopBarSchema()?.right;if(o||Q(s)){let r=i.getCustomTopBarRightElement();if(r){let a={controller:i.controller,layoutState:i.getLayoutState()};o?t.push(n(e,{to:r,key:`topbar-right`},o(a))):s&&($(s),t.push(n(e,{to:r,key:`topbar-right`},[n(s,a)])))}}let l=c[`status-bar-left`],u=i.getActiveStatusBarSchema()?.left;if(l||Q(u)){let r=i.getCustomStatusBarLeftElement();if(r){let a={controller:i.controller,layoutState:i.getLayoutState()};l?t.push(n(e,{to:r,key:`statusbar-left`},l(a))):u&&($(u),t.push(n(e,{to:r,key:`statusbar-left`},[n(u,a)])))}}let d=c[`status-bar-right`],f=i.getActiveStatusBarSchema()?.right;if(d||Q(f)){let r=i.getCustomStatusBarRightElement();if(r){let a={controller:i.controller,layoutState:i.getLayoutState()};d?t.push(n(e,{to:r,key:`statusbar-right`},d(a))):f&&($(f),t.push(n(e,{to:r,key:`statusbar-right`},[n(f,a)])))}}let p=c[`empty-contents`],m=i.getActiveEmptyContentsRenderer();if(p||Q(m))for(let[r,a]of i.getCustomEmptyContentsSlots().entries())p?t.push(n(e,{to:a,key:`empty:${r}`},p({controller:i.controller}))):m&&($(m),t.push(n(e,{to:a,key:`empty:${r}`},[n(m,{controller:i.controller})])));let h=c[`group-actions`];for(let[r,{hostEl:a,props:o,renderer:s}]of i.getCustomGroupActionsSlots().entries())Q(s)?($(s),t.push(n(e,{to:a,key:`group-actions:${r}`},[n(s,o)]))):h&&t.push(n(e,{to:a,key:`group-actions:${r}`},h(o)))}return n(`div`,{class:`reddokia-vue-host`,style:{width:`100%`,height:`100%`,flex:`1 1 0%`,minWidth:`0`,minHeight:`0`,display:`flex`,position:`relative`}},[n(`div`,{ref:d,class:`reddokia-vue-stage`,style:{width:`100%`,height:`100%`,flex:`1 1 0%`,minWidth:`0`,minHeight:`0`,display:`flex`,position:`relative`}}),...t])}}})}var tn=en(`RedDokia`);g();export{tn as RedDokia,Qe as RedDokiaIcons,ct as getRedDokiaIconSvg};
|
package/package.json
CHANGED
|
@@ -1,6 +1,103 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reddokia",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0-alpha.1",
|
|
4
|
+
"description": "Zero-dependency docking workbench engine for Vanilla, React, Vue 3 & Svelte 5.",
|
|
5
|
+
"author": "RedCamel (https://github.com/redcamel)",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"homepage": "https://redcamel.github.io/RedDokia/",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/redcamel/RedDokia.git"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/redcamel/RedDokia/issues"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"docking",
|
|
17
|
+
"layout",
|
|
18
|
+
"docking-layout",
|
|
19
|
+
"ide",
|
|
20
|
+
"workbench",
|
|
21
|
+
"tabs",
|
|
22
|
+
"split-pane",
|
|
23
|
+
"floating-window",
|
|
24
|
+
"popout",
|
|
25
|
+
"react",
|
|
26
|
+
"vue",
|
|
27
|
+
"svelte",
|
|
28
|
+
"typescript"
|
|
29
|
+
],
|
|
30
|
+
"type": "module",
|
|
31
|
+
"main": "./dist/reddokia.js",
|
|
32
|
+
"module": "./dist/reddokia.js",
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"exports": {
|
|
35
|
+
".": {
|
|
36
|
+
"types": "./dist/index.d.ts",
|
|
37
|
+
"import": "./dist/reddokia.js"
|
|
38
|
+
},
|
|
39
|
+
"./react": {
|
|
40
|
+
"types": "./dist/react/index.d.ts",
|
|
41
|
+
"import": "./dist/react.js"
|
|
42
|
+
},
|
|
43
|
+
"./vue": {
|
|
44
|
+
"types": "./dist/vue/index.d.ts",
|
|
45
|
+
"import": "./dist/vue.js"
|
|
46
|
+
},
|
|
47
|
+
"./svelte": {
|
|
48
|
+
"types": "./dist/svelte/index.d.ts",
|
|
49
|
+
"import": "./dist/svelte.js"
|
|
50
|
+
},
|
|
51
|
+
"./style.css": "./dist/style.css"
|
|
52
|
+
},
|
|
53
|
+
"files": [
|
|
54
|
+
"dist"
|
|
55
|
+
],
|
|
56
|
+
"scripts": {
|
|
57
|
+
"dev": "npm run build:lib && npm run build:docs && vite",
|
|
58
|
+
"build": "npm run build:pages",
|
|
59
|
+
"build:lib": "node scripts/build-lib.mjs && tsc -p tsconfig.lib.json && node scripts/clean-dts-comments.mjs",
|
|
60
|
+
"build:docs": "node scripts/build-docs.mjs",
|
|
61
|
+
"build:pages": "node scripts/build-pages.mjs",
|
|
62
|
+
"preview:pages": "vite preview --outDir dist-pages --base /RedDokia/",
|
|
63
|
+
"test": "vitest run",
|
|
64
|
+
"test:e2e": "playwright test"
|
|
65
|
+
},
|
|
66
|
+
"peerDependencies": {
|
|
67
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
68
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
69
|
+
"svelte": "^5.0.0",
|
|
70
|
+
"vue": "^3.0.0"
|
|
71
|
+
},
|
|
72
|
+
"peerDependenciesMeta": {
|
|
73
|
+
"react": {
|
|
74
|
+
"optional": true
|
|
75
|
+
},
|
|
76
|
+
"react-dom": {
|
|
77
|
+
"optional": true
|
|
78
|
+
},
|
|
79
|
+
"vue": {
|
|
80
|
+
"optional": true
|
|
81
|
+
},
|
|
82
|
+
"svelte": {
|
|
83
|
+
"optional": true
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"devDependencies": {
|
|
87
|
+
"@playwright/test": "^1.65.1",
|
|
88
|
+
"@types/react": "^19.3.0",
|
|
89
|
+
"@types/react-dom": "^19.3.0",
|
|
90
|
+
"@vitejs/plugin-react": "^6.2.1",
|
|
91
|
+
"lucide-react": "^1.70.0",
|
|
92
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
93
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
94
|
+
"svelte": "^5.59.2",
|
|
95
|
+
"typedoc": "^0.28.20",
|
|
96
|
+
"typedoc-plugin-markdown": "^4.14.1",
|
|
97
|
+
"typescript": "^6.0.3",
|
|
98
|
+
"vite": "^8.3.6",
|
|
99
|
+
"vitepress": "^1.6.4",
|
|
100
|
+
"vitest": "^5.1.0",
|
|
101
|
+
"vue": "^3.5.45"
|
|
102
|
+
}
|
|
103
|
+
}
|