@vuu-ui/vuu-layout 0.5.10 → 0.5.11
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 +201 -0
- package/cjs/index.js +20 -0
- package/cjs/index.js.map +7 -0
- package/esm/index.js +20 -0
- package/esm/index.js.map +7 -0
- package/index.css +2 -0
- package/index.css.map +7 -0
- package/package.json +13 -10
- package/src/Component.css +0 -0
- package/src/Component.tsx +0 -20
- package/src/DraggableLayout.css +0 -18
- package/src/DraggableLayout.tsx +0 -26
- package/src/__tests__/flexbox-utils.spec.js +0 -90
- package/src/chest-of-drawers/Chest.css +0 -36
- package/src/chest-of-drawers/Chest.tsx +0 -42
- package/src/chest-of-drawers/Drawer.css +0 -159
- package/src/chest-of-drawers/Drawer.tsx +0 -118
- package/src/chest-of-drawers/index.ts +0 -2
- package/src/common-types.ts +0 -9
- package/src/debug.ts +0 -16
- package/src/drag-drop/BoxModel.ts +0 -551
- package/src/drag-drop/DragState.ts +0 -219
- package/src/drag-drop/Draggable.ts +0 -282
- package/src/drag-drop/DropMenu.css +0 -71
- package/src/drag-drop/DropMenu.tsx +0 -61
- package/src/drag-drop/DropTarget.ts +0 -393
- package/src/drag-drop/DropTargetRenderer.css +0 -40
- package/src/drag-drop/DropTargetRenderer.tsx +0 -277
- package/src/drag-drop/dragDropTypes.ts +0 -47
- package/src/drag-drop/index.ts +0 -5
- package/src/editable-label/EditableLabel.css +0 -28
- package/src/editable-label/EditableLabel.tsx +0 -99
- package/src/editable-label/index.ts +0 -1
- package/src/flexbox/Flexbox.css +0 -45
- package/src/flexbox/Flexbox.tsx +0 -70
- package/src/flexbox/FlexboxLayout.tsx +0 -28
- package/src/flexbox/FluidGrid.css +0 -134
- package/src/flexbox/FluidGrid.tsx +0 -82
- package/src/flexbox/FluidGridLayout.tsx +0 -9
- package/src/flexbox/Splitter.css +0 -140
- package/src/flexbox/Splitter.tsx +0 -127
- package/src/flexbox/flexbox-utils.ts +0 -128
- package/src/flexbox/flexboxTypes.ts +0 -68
- package/src/flexbox/index.ts +0 -5
- package/src/flexbox/useResponsiveSizing.ts +0 -82
- package/src/flexbox/useSplitterResizing.ts +0 -270
- package/src/index.ts +0 -19
- package/src/layout-action.ts +0 -21
- package/src/layout-header/ActionButton.tsx +0 -23
- package/src/layout-header/Header.css +0 -8
- package/src/layout-header/Header.tsx +0 -216
- package/src/layout-header/index.ts +0 -1
- package/src/layout-provider/LayoutProvider.tsx +0 -161
- package/src/layout-provider/LayoutProviderContext.ts +0 -17
- package/src/layout-provider/index.ts +0 -3
- package/src/layout-provider/useLayoutDragDrop.ts +0 -210
- package/src/layout-reducer/flexUtils.ts +0 -276
- package/src/layout-reducer/index.ts +0 -5
- package/src/layout-reducer/insert-layout-element.ts +0 -365
- package/src/layout-reducer/layout-reducer.ts +0 -237
- package/src/layout-reducer/layoutTypes.ts +0 -159
- package/src/layout-reducer/layoutUtils.ts +0 -288
- package/src/layout-reducer/remove-layout-element.ts +0 -226
- package/src/layout-reducer/replace-layout-element.ts +0 -113
- package/src/layout-reducer/resize-flex-children.ts +0 -55
- package/src/layout-reducer/wrap-layout-element.ts +0 -307
- package/src/layout-view/View.css +0 -61
- package/src/layout-view/View.tsx +0 -143
- package/src/layout-view/ViewContext.ts +0 -30
- package/src/layout-view/index.ts +0 -5
- package/src/layout-view/useView.tsx +0 -104
- package/src/layout-view/useViewActionDispatcher.ts +0 -123
- package/src/layout-view/useViewResize.ts +0 -53
- package/src/layout-view/viewTypes.ts +0 -35
- package/src/palette/Palette.css +0 -33
- package/src/palette/Palette.tsx +0 -140
- package/src/palette/PaletteSalt.css +0 -9
- package/src/palette/PaletteSalt.tsx +0 -79
- package/src/palette/index.ts +0 -3
- package/src/placeholder/Placeholder.css +0 -10
- package/src/placeholder/Placeholder.tsx +0 -38
- package/src/placeholder/index.ts +0 -1
- package/src/registry/ComponentRegistry.ts +0 -44
- package/src/registry/index.ts +0 -1
- package/src/responsive/breakpoints.ts +0 -62
- package/src/responsive/index.ts +0 -3
- package/src/responsive/measureMinimumNodeSize.ts +0 -23
- package/src/responsive/overflowUtils.js +0 -14
- package/src/responsive/use-breakpoints.ts +0 -101
- package/src/responsive/useResizeObserver.ts +0 -154
- package/src/responsive/utils.ts +0 -37
- package/src/stack/Stack.css +0 -39
- package/src/stack/Stack.tsx +0 -173
- package/src/stack/StackLayout.tsx +0 -119
- package/src/stack/index.ts +0 -4
- package/src/stack/stackTypes.ts +0 -22
- package/src/tabs/TabPanel.css +0 -12
- package/src/tabs/TabPanel.tsx +0 -17
- package/src/tabs/index.ts +0 -1
- package/src/tools/config-wrapper/ConfigWrapper.tsx +0 -55
- package/src/tools/config-wrapper/index.ts +0 -1
- package/src/tools/devtools-box/layout-configurator.css +0 -112
- package/src/tools/devtools-box/layout-configurator.jsx +0 -369
- package/src/tools/devtools-tree/layout-tree-viewer.css +0 -15
- package/src/tools/devtools-tree/layout-tree-viewer.jsx +0 -36
- package/src/tools/index.ts +0 -4
- package/src/use-persistent-state.ts +0 -112
- package/src/utils/index.ts +0 -5
- package/src/utils/pathUtils.ts +0 -283
- package/src/utils/propUtils.ts +0 -26
- package/src/utils/refUtils.ts +0 -16
- package/src/utils/styleUtils.ts +0 -13
- package/src/utils/typeOf.ts +0 -25
- package/tsconfig-emit-types.json +0 -11
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2015 UBS
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/cjs/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";var Mi=Object.create;var gt=Object.defineProperty;var Ci=Object.getOwnPropertyDescriptor;var Ai=Object.getOwnPropertyNames;var ki=Object.getPrototypeOf,zi=Object.prototype.hasOwnProperty;var Ii=(e,t)=>{for(var o in t)gt(e,o,{get:t[o],enumerable:!0})},sn=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Ai(t))!zi.call(e,r)&&r!==o&>(e,r,{get:()=>t[r],enumerable:!(n=Ci(t,r))||n.enumerable});return e};var v=(e,t,o)=>(o=e!=null?Mi(ki(e)):{},sn(t||!e||!e.__esModule?gt(o,"default",{value:e,enumerable:!0}):o,e)),Bi=e=>sn(gt({},"__esModule",{value:!0}),e);var nl={};Ii(nl,{Action:()=>ze,BORDER_STYLES:()=>ja,Chest:()=>Sn,Component:()=>Rt,ComponentRegistry:()=>ue,ConfigWrapper:()=>Za,Dialog:()=>Ni,Draggable:()=>It,DraggableLayout:()=>Eo,Drawer:()=>bt,DropMenu:()=>yo,DropTarget:()=>me,Flexbox:()=>Ht,FlexboxLayout:()=>_o,FluidGrid:()=>Wt,FluidGridLayout:()=>Zo,Header:()=>Jo,HeightOnly:()=>wa,LayoutConfigurator:()=>en,LayoutProvider:()=>Ta,LayoutProviderContext:()=>Ye,LayoutProviderVersion:()=>Sa,LayoutTreeViewer:()=>tn,MARGIN_STYLES:()=>Ja,PADDING_STYLES:()=>Ka,Palette:()=>mi,PaletteItem:()=>jo,PaletteListItem:()=>_a,PaletteSalt:()=>hi,Placeholder:()=>it,Stack:()=>Jt,StackLayout:()=>Qo,View:()=>he,ViewContext:()=>ht,WidthHeight:()=>Da,WidthOnly:()=>Pa,XXXnormalizeStyles:()=>tl,computeMenuPosition:()=>go,containerOf:()=>wn,expandFlex:()=>Tt,extractResponsiveProps:()=>Ba,findTarget:()=>le,followPath:()=>V,followPathToComponent:()=>ao,followPathToParent:()=>ae,getChild:()=>Pn,getChildProp:()=>so,getPersistentState:()=>Co,getProp:()=>w,getProps:()=>D,hasPersistentState:()=>Ao,identifyDropTarget:()=>Pt,isContainer:()=>F,isLayoutComponent:()=>oo,isRegistered:()=>Vi,isResponsiveAttribute:()=>Kr,isTabstrip:()=>rs,isTypeOf:()=>Ui,isView:()=>Rn,nextLeaf:()=>Yi,nextStep:()=>q,previousLeaf:()=>Zi,registerComponent:()=>B,resetPath:()=>$,setPersistentState:()=>ko,setRef:()=>qi,typeOf:()=>P,useBreakpoints:()=>Yo,useLayoutProviderDispatch:()=>Y,useLayoutProviderVersion:()=>Gr,usePersistentState:()=>Be,useResizeObserver:()=>Go,useViewActionDispatcher:()=>dt,useViewContext:()=>Fa,useViewDispatch:()=>qo});module.exports=Bi(nl);var We=require("@heswell/salt-lab"),dn=require("@salt-ds/core"),fn=v(require("classnames")),xe=require("react");var je=require("react"),un=v(require("react-dom"));var an=v(require("react-dom")),ln=require("@salt-ds/core"),pn=require("react/jsx-runtime"),Oi=1,Hi=(e=0,t=0,o=window)=>{let n=o.document.createElement("div");return n.className="vuuPopup "+Oi++,n.style.cssText=`left:${e}px; top:${t}px;`,o.document.body.appendChild(n),n},$i=(e,t)=>Hi(e,t),yt=(e,t,o,n,r)=>{t.style.cssText=`left:${o}px; top:${n}px;position: absolute;`,an.render((0,pn.jsx)(ln.SaltProvider,{applyClassesTo:"child",children:e}),t,r)},cn=$i;var mn=function({children:t,x:o=0,y:n=0,onRender:r}){let i=(0,je.useMemo)(()=>cn(),[]);return(0,je.useLayoutEffect)(()=>{yt(t,i,o,n,r)},[t,r,i,o,n]),(0,je.useLayoutEffect)(()=>()=>{var s;i&&(un.unmountComponentAtNode(i),i.classList.contains("vuuPopup")&&((s=i.parentElement)==null||s.removeChild(i)))},[i]),null};var be=require("react/jsx-runtime"),eo="vuuDialog",Ni=({children:e,className:t,isOpen:o=!1,onClose:n,title:r,...i})=>{let s=(0,xe.useRef)(null),[a]=(0,xe.useState)(0),[l]=(0,xe.useState)(0),c=(0,xe.useCallback)(()=>{n==null||n()},[n]),p=(0,xe.useCallback)(()=>{},[]);return o?(0,be.jsx)(mn,{onRender:p,x:a,y:l,children:(0,be.jsx)(We.Scrim,{className:`${eo}-scrim`,open:o,children:(0,be.jsxs)("div",{...i,className:(0,fn.default)(eo,t),ref:s,children:[(0,be.jsxs)(We.Toolbar,{className:`${eo}-header`,children:[(0,be.jsx)(dn.Text,{children:r}),(0,be.jsx)(We.ToolbarButton,{onClick:c,"data-align-end":!0,"data-icon":"close"},"close")]}),e]})})}):null};var En=v(require("classnames"));var Qe=require("@salt-ds/core"),to=v(require("classnames")),gn=require("react");var Ee=require("react/jsx-runtime"),Re="vuuDrawer",hn=e=>typeof e=="string"?e:e+"px",Fi=(e,t,o)=>{let n=t!==void 0,r=o!==void 0;if(!(!e&&!r&&!n))return!r&&!n?e:{...e,"--drawer-size":n?hn(t):void 0,"--drawer-peek-size":r?hn(o):void 0}},yn=({children:e,className:t,clickToOpen:o,defaultOpen:n,sizeOpen:r,sizeClosed:i,style:s,open:a,position:l="left",inline:c,onClick:p,peekaboo:m=!1,toggleButton:u,...f})=>{let[h,g]=(0,Qe.useControlled)({controlled:a,default:n!=null?n:!1,name:"Drawer",state:"open"}),y=(0,to.default)(Re,t,`${Re}-${l}`,{[`${Re}-open`]:h,[`${Re}-inline`]:c,[`${Re}-over`]:!c,[`${Re}-peekaboo`]:m}),d=(0,gn.useCallback)(()=>{console.log("toggleDrawer"),g(!h)},[h,g]),b=Fi(s,r,i),E=o?d:p,R=()=>(0,Ee.jsx)("div",{className:(0,to.default)("vuuToggleButton-container"),children:h?(0,Ee.jsx)(Qe.Button,{"aria-label":"close",onClick:d,"data-icon":"close",variant:"secondary"}):(0,Ee.jsx)(Qe.Button,{"aria-label":"open",onClick:d,"data-icon":"close",variant:"secondary"})});return(0,Ee.jsxs)("div",{...f,className:y,onClick:E,style:b,children:[u=="start"?R():null,(0,Ee.jsx)("div",{className:`${Re}-liner`,children:(0,Ee.jsx)("div",{className:`${Re}-content`,children:e})}),u=="end"?R():null]})};yn.displayName="Drawer";var bt=yn;var no=require("@vuu-ui/vuu-utils");var bn={},xn={},ue={};function F(e){return bn[e]===!0}function Rn(e){return xn[e]===!0}var oo=e=>F(e)||Rn(e),Vi=e=>!!ue[e];function B(e,t,o="component"){ue[e]=t,o==="container"?bn[e]=!0:o==="view"&&(xn[e]=!0)}var xt=require("react/jsx-runtime"),Wi=e=>e.type===bt,_i=({props:{position:e="left"}})=>e.match(/top|bottom/),ro=e=>{let{children:t,className:o,id:n,style:r}=e,i="hwChest",[s,a]=(0,no.partition)(t,Wi),[l,c]=(0,no.partition)(s,_i),p=l.length===0?"horizontal":c.length===0?"vertical":"both",m=(0,En.default)(i,o,`${i}-${p}`);return(0,xt.jsxs)("div",{className:m,id:n,style:r,children:[s,(0,xt.jsx)("div",{className:`${i}-content`,children:a})]})};ro.displayName="Chest";var Sn=ro;B("Chest",ro,"container");var Tn=require("react");var Dn=require("react/jsx-runtime"),io=(0,Tn.forwardRef)(function({resizeable:t,...o},n){return(0,Dn.jsx)("div",{...o,className:"Component",ref:n})});io.displayName="Component";var Rt=io;B("Component",io);var Se=v(require("react"));var Gi={},w=(e,t)=>{var n;let o=D(e);return(n=o[t])!=null?n:o[`data-${t}`]},D=e=>(e==null?void 0:e.props)||e||Gi,so=e=>{let t=D(e);if(t.children){let{children:[o,...n]}=t;return n.length>0&&console.warn(`getChild expected a single child, found ${n.length+1}`),o}};function P(e){var t;if(e){let o=e.type;if(typeof o=="function"||typeof o=="object"){let n=o.displayName||o.name||((t=o.type)==null?void 0:t.name);if(typeof n=="string")return n}if(typeof e.type=="string")return e.type;if(e.constructor)return e.constructor.displayName;throw Error("typeOf unable to determine type of element")}}var Ui=(e,t)=>P(e)===t;var Xi=e=>{let t=e.lastIndexOf(".");return t===-1?e:e.slice(0,t)};function ae(e,t){let{"data-path":o,path:n=o}=D(e);return t==="0"||t===n?null:V(e,Xi(t),!0)}function le(e,t){let{children:o,...n}=D(e);if(t(n))return e;if(Se.default.Children.count(o)>0){let r=Se.default.isValidElement(o)?[o]:o;for(let i of r){let s=le(i,t);if(s)return s}}}function wn(e,t){if(t===e)return null;let{path:o,children:n}=D(e),{idx:r,finalStep:i}=q(o,w(t,"path"));return i?e:n===void 0||n[r]===void 0?null:wn(n[r],t)}var Pn=(e,t)=>{if(Se.default.isValidElement(e)&&t==0)return e;if(Array.isArray(e))return e[t]};function ao(e,t){let o=t.split("."),n=[e],r=i=>Se.default.isValidElement(i.props.children)?[i.props.children]:i.props.children;for(let i=0;i<o.length;i++){let s=parseInt(o[i]),a=n[s];if(i===o.length-1)return a;n=r(a)}}function V(e,t,o=!1){let{"data-path":n,path:r=n}=D(e);if(t.indexOf(r)!==0)throw Error(`pathUtils.followPath path ${t} is not within source path ${r}`);let i=t.slice(r.length+1);if(i==="")return e;let s=e,a=i.split(".");for(let l=0;l<a.length;l++){if(Se.default.Children.count(s.props.children)===0){let c=`element at 0.${a.slice(0,l).join(".")} has no children, so cannot fulfill rest of path ${a.slice(l).join(".")}`;if(o)throw Error(c);console.warn(c);return}if(s=Pn(s.props.children,parseInt(a[l])),s===void 0){let c=`model at 0.${a.slice(0,l).join(".")} has no children that fulfill next step of path ${a.slice(l).join(".")}`;if(o)throw Error(c);console.warn(c)}}return s}function Yi(e,t){let o=ae(e,t),n=t.split(".").map(r=>parseInt(r,10));if(o){let r=n.pop(),{children:i}=o.props;if(i.length-1>r)return Et(i[r+1]);{let s=n.pop(),a=ae(e,w(o,"path"));if(a&&typeof s=="number"&&(n=a.props.path.split(".").map(l=>parseInt(l,10)),a.props.children.length-1>s)){let l=a.props.children[s+1];return F(P(l))?Et(l):l}}}return Et(e)}function Zi(e,t){let o=t.split(".").map(i=>parseInt(i,10)),n=o.pop(),r=ae(e,t);if(r!=null&&typeof n=="number"){let{children:i}=r.props;if(n>0)return St(i[n-1]);for(;o.length>1;)if(n=o.pop(),r=ae(e,w(r,"path")),n>0){let s=r.props.children[n-1];return F(P(s))?St(s):s}}return St(e)}function Et(e){if(F(P(e))){let{children:t}=e.props||e;return Et(t[0])}return e}function St(e){if(F(P(e))){let{children:t}=e.props||e;return St(t[t.length-1])}return e}function q(e,t,o=!1){if(e===t)return{idx:-1,finalStep:!0};let n=`${e}.`;if(!t.startsWith(n))throw Error("pathUtils nextStep has strayed from the path");let r=o?0:1,i=t.replace(n,"").split(".").map(s=>parseInt(s,10));return{idx:i[0],finalStep:i.length===r}}function $(e,t,o){if(w(e,"path")===t)return e;let n=[];Se.default.Children.forEach(e.props.children,(i,s)=>{w(i,"path")?n.push($(i,`${t}.${s}`)):n.push(i)});let r=e.props["data-path"]?"data-path":"path";return Se.default.cloneElement(e,{[r]:t,...o},n)}function qi(e,t){typeof e=="function"?e(t):e&&(e.current=t)}var Tt=e=>{if(typeof e!="number")throw Error(`"no support yet for flex value ${e}`);return{flexBasis:0,flexGrow:1,flexShrink:1}};var ke={north:1,east:2,south:4,west:8,header:16,centre:32,absolute:64},et={AFTER:"after",BEFORE:"before"},W=Object.freeze({North:Ae("north"),East:Ae("east"),South:Ae("south"),West:Ae("west"),Header:Ae("header"),Centre:Ae("centre"),Absolute:Ae("absolute")});function Ae(e){return Object.freeze({offset:e==="north"||e==="west"?0:e==="south"||e==="east"?1:NaN,valueOf:function(){return ke[e]},toString:function(){return e},North:e==="north",South:e==="south",East:e==="east",West:e==="west",Header:e==="header",Centre:e==="centre",NorthOrSouth:e==="north"||e==="south",EastOrWest:e==="east"||e==="west",NorthOrWest:e==="north"||e==="west",SouthOrEast:e==="east"||e==="south",Absolute:e==="absolute"})}var vn=W.North,Ln=W.South,lo=W.East,co=W.West,Ji=W.Header,Ki=W.Centre,_e=class{static measure(t,o=[]){let n={};return es(t,n,o),n}static allBoxesContainingPoint(t,o,n,r,i){return kn(t,o,n,r,i).reverse()}};function po(e,t,o,n=30){let r=o.right-o.left,i=o.bottom-o.top,s=e-o.left,a=t-o.top,l=0;return s<n&&(l+=8),s>r-n&&(l+=2),a<n&&(l+=1),a>i-n&&(l+=4),{pctX:s/r,pctY:a/i,closeToTheEdge:l}}function uo(e,t,o,n){let{BEFORE:r,AFTER:i}=et,{pctX:s,pctY:a,closeToTheEdge:l}=po(e,t,o),c,p;if(n==="row")c=s<.5?co:lo;else if(o.header&&Dt(o.header,e,t))if(c=Ji,o.Stack){let m=o.Stack.length;if(m===0)p={index:-1,left:o.left,positionRelativeToTab:i,width:0};else{let u=o.Stack.find(({left:f,right:h})=>e>=f&&e<=h);if(u){let f=u.right-u.left;p={index:o.Stack.indexOf(u),left:u.left,positionRelativeToTab:(e-u.left)/f<.5?r:i,width:f}}else p={left:o.Stack[m-1].right,width:0,index:m,positionRelativeToTab:i}}}else if(o.header.titleWidth){let m=o.header.titleWidth;p={index:-1,left:o.left,positionRelativeToTab:(e-o.left)/m<.5?r:i,width:m}}else p={left:o.left,width:0,positionRelativeToTab:r,index:-1};else c=ji(e,t,o,s,a);return{position:c,x:e,y:t,closeToTheEdge:l,tab:p}}function ji(e,t,o,n,r){let i=Qi(o,.2);if(Dt(i,e,t))return Ki;switch(`${r<.5?"north":"south"}${n<.5?"west":"east"}`){case"northwest":return n>r?vn:co;case"northeast":return 1-n>r?vn:lo;case"southeast":return n>r?lo:Ln;case"southwest":return 1-n>r?co:Ln;default:}}function Qi({right:e,left:t,top:o,bottom:n},r){let i=(1-r)/2,s=(e-t)*i,a=(n-o)*i;return{left:t+s,top:o+a,right:e-s,bottom:n-a}}function es(e,t,o){let{id:n,"data-path":r,path:i=r}=D(e),s=P(e);if(n&&i){let[a,l]=An(e);Mn(e,a,l,t),F(s)&&Cn(e,t,o)}}function Mn(e,t,o,n){let{"data-path":r,path:i=r,header:s}=D(e);n[i]=t;let a=P(e);if(s||a==="Stack"){let l=o.querySelector(".vuuHeader");if(l){let{top:c,left:p,right:m,bottom:u}=l.getBoundingClientRect();if(n[i].header={top:Math.round(c),left:Math.round(p),right:Math.round(m),bottom:Math.round(u)},a==="Stack")n[i].Stack=Array.from(l.querySelectorAll(".saltTab")).map(f=>f.getBoundingClientRect()).map(({left:f,right:h})=>({left:f,right:h}));else{let f=l.querySelector('[class^="vuuHeader-title"]'),{header:h}=n[i];f&&h&&(h.titleWidth=f.clientWidth)}}}return n[i]}function Cn(e,t,o,n=0,r=0,i=0,s=0){let{children:a,"data-path":l,path:c=l,style:p,active:m=0}=D(e),u=P(e),f=u==="Flexbox",h=u==="Stack",g=f&&p.flexDirection==="column",y=f&&p.flexDirection==="row",b=(h?a.filter((R,S)=>S===m):a.filter(ts)).map(R=>{let[S,x]=An(R);return[{...S,top:S.top-i,right:S.right+r,bottom:S.bottom+s,left:S.left-n},x,R]}),E=b.map(([R,S,x],T,L)=>{let A,N,M,H,C,k,I=L.length-1;y?(C=T===0?0:R.left-L[T-1][0].right,k=T===I?0:L[T+1][0].left-R.right,A=T===0||C===0?0:C,N=T===I||k===0?0:k-k/2,R.left-=A,R.right+=N,M=i,H=s):g&&(C=T===0?0:R.top-L[T-1][0].bottom,k=T===I?0:L[T+1][0].top-R.bottom,M=T===0||C===0?0:C,H=T===I||k===0?0:k-k/2,R.top-=M,R.bottom+=H,A=n,N=r);let Q=Mn(x,R,S,t),X=P(x);return F(X)&&Cn(x,t,o,A,N,M,H),Q});b.length&&(t[c].children=E)}function ts(e){let{id:t}=D(e),o=document.getElementById(t);return o?o.dataset.dragging!=="true":(console.warn(`BoxModel: no element found with id #${t}`),!1)}function An(e){let{id:t}=D(e);if(t===void 0)throw Error("`BoxModel.measureComponentElement, component has no id");let o=document.getElementById(t);if(!o)throw Error("BoxModel.measureComponentElement, no DOM element found for component");let{top:n,left:r,right:i,bottom:s,height:a,width:l}=o.getBoundingClientRect(),c,p=P(e);if(F(p)){let m=o.scrollHeight;m>a&&(c={id:t,scrollHeight:m,scrollTop:o.scrollTop})}return[{top:Math.round(n),left:Math.round(r),right:Math.round(i),bottom:Math.round(s),height:Math.round(a),width:Math.round(l),scrolling:c},o,e]}function kn(e,t,o,n,r,i=[]){let{children:s,"data-path":a,path:l=a}=D(e),c=P(e),p=t[l];if(!Dt(p,o,n))return i;if(r&&r.length){if(r.includes(l))i.push(e);else if(!r.some(m=>m.startsWith(l)))return i}else i.push(e);if(!F(c)||p.header&&Dt(p.header,o,n))return i;p.scrolling&&os(p,o,n);for(let m=0;m<s.length;m++){if(c==="Stack"&&e.props.active!==m)continue;let u=kn(s[m],t,o,n,r);if(u.length)return i.concat(u)}return i}function Dt(e,t,o){if(e)return t>=e.left&&t<e.right&&o>=e.top&&o<e.bottom}function os({top:e,bottom:t,scrolling:o},n,r){if(o){let{id:i,scrollTop:s,scrollHeight:a}=o,l=t-e;if(s===0&&t-r<50){let c=a-l;document.getElementById(i).scrollTo({left:0,top:c,behavior:"smooth"}),o.scrollTop=c}else if(s>0&&r-e<50)document.getElementById(i).scrollTo({left:0,top:0,behavior:"smooth"}),o.scrollTop=0;else return!1}else return!1}var ns=.4,wt=class{constructor(t,o,n,r,i){this.init(t,o,n,r,i)}init(t,o,n,r,i){let{left:s,top:a}=r,{pctX:l,pctY:c}=po(o,n,r),p=ns,m=l*r.width,u=r.width-m,f=c*r.height,h=r.height-f,g=r.width*p,y=r.height*p,d=1-p,b=m*d,E=f*d,R=u*d,S=h*d;this.intrinsicSize=i,this.constraint={zone:{x:{lo:t.left,hi:t.right},y:{lo:t.top,hi:t.bottom}},pos:{x:{lo:t.left-b,hi:t.right-r.width+R},y:{lo:t.top-E,hi:t.bottom-r.height+S}},mouse:{x:{lo:t.left+g*l,hi:t.right-g*(1-l)},y:{lo:t.top+y*c,hi:t.bottom-y*(1-c)}}},this.x={pos:s,lo:!1,hi:!1,mousePos:o,mousePct:l},this.y={pos:a,lo:!1,hi:!1,mousePos:n,mousePct:c}}outOfBounds(){return this.x.lo||this.x.hi||this.y.lo||this.y.hi}inBounds(){return!this.outOfBounds()}dropX(){return this.dropXY("x")}dropY(){return this.dropXY("y")}hasIntrinsicSize(){var t,o;return((t=this==null?void 0:this.intrinsicSize)==null?void 0:t.height)&&((o=this==null?void 0:this.intrinsicSize)==null?void 0:o.width)}update(t,o){let n=this[t],r=this.constraint.mouse[t],i=this.constraint.pos[t],s=n.pos,a=o-n.mousePos;return a<0?n.lo||(o<r.lo?(n.lo=!0,n.pos=i.lo):n.hi?o<r.hi&&(n.hi=!1,n.pos+=a):n.pos+=a):a>0&&(n.hi||(o>r.hi?(n.hi=!0,n.pos=i.hi):n.lo?o>r.lo&&(n.lo=!1,n.pos+=a):n.pos+=a)),n.mousePos=o,s!==n.pos}dropXY(t){let o=this[t],n=this.constraint.zone[t];return o.lo?Math.max(n.lo,o.mousePos):o.hi?Math.min(o.mousePos,Math.round(n.hi)-1):o.mousePos}};var rs=e=>e.pos.tab&&P(e.component)==="Stack"&&e.pos.position.Header,{north:is,south:ss,east:as,west:ls}=ke,cs=as+ls,ps=is+ss,me=class{constructor({component:t,pos:o,clientRect:n,nextDropTarget:r}){this.component=t,this.pos=o,this.clientRect=n,this.nextDropTarget=r,this.active=!1,this.dropRect=void 0}targetTabPos(t){let{left:o,width:n,positionRelativeToTab:r}=t;return r===et.BEFORE?o:o+n}getTargetDropOutline(t,o){if(this.pos.tab)return this.getDropTabOutline(t,this.pos.tab);if(o&&o.hasIntrinsicSize())return this.getIntrinsicDropRect(o);{let[n,r,i,s]=this.getDropRectOutline(t,o);return{l:n,t:r,r:i,b:s}}}getDropTabOutline(t,o){var d,b;let{clientRect:{top:n,left:r,right:i,bottom:s,header:a}}=this,l=0,c=Math.round(t/2)+l,p=Math.round(n),m=Math.round(r+c),u=Math.round(i-c),f=Math.round(s-c),h=this.targetTabPos(o),g=60,y=((d=a==null?void 0:a.bottom)!=null?d:0)-((b=a==null?void 0:a.top)!=null?b:0);return{l:m,t:p,r:u,b:f,tabLeft:h,tabWidth:g,tabHeight:y}}getIntrinsicDropRect(t){var g,y,d,b;let{pos:o,clientRect:n}=this,{x:r,y:i}=t,s=(y=(g=t.intrinsicSize)==null?void 0:g.height)!=null?y:0,a=(b=(d=t.intrinsicSize)==null?void 0:d.height)!=null?b:0;s&&s>n.height?(console.log("DropTarget: we're going to blow the gaff"),s=n.height):a&&a>n.width&&(console.log("DropTarget: we're going to blow the gaff"),a=n.width);let l=Math.min(n.right-a,Math.max(n.left,Math.round(o.x-r.mousePct*a))),c=Math.min(n.bottom-s,Math.max(n.top,Math.round(o.y-i.mousePct*s))),[p,m,u,f]=this.dropRect=[l,c,l+a,c+s],h=o.position.EastOrWest?[p,n.top,p,n.bottom,u,n.top,u,n.bottom]:[n.left,m,n.right,m,n.left,f,n.right,f];return{l:p,r:u,t:m,b:f,guideLines:h}}getDropRectOutline(t,o){var b,E,R;let{pos:n,clientRect:r}=this,{width:i,height:s,position:a}=n,{width:l,height:c}=(b=o==null?void 0:o.intrinsicSize)!=null?b:{},p=(E=c!=null?c:s)!=null?E:0,m=(R=l!=null?l:i)!=null?R:0;this.dropRect=void 0;let{top:u,left:f,right:h,bottom:g}=r,y=0,d=Math.round(t/2)+y;switch(a){case W.North:case W.Header:{let S=Math.round((g-u)/2),x=p?Math.min(S,Math.round(p)):S;return m&&f+m<h?[f+d,u+d,f+m-d,u+d+x]:[f+d,u+d,h-d,u+d+x]}case W.West:{let S=Math.round((h-f)/2),x=m?Math.min(S,Math.round(m)):S;return p&&u+p<g?[f+d,u+d,f-d+x,u+p+d]:[f+d,u+d,f-d+x,g-d]}case W.East:{let S=Math.round((h-f)/2),x=m?Math.min(S,Math.round(m)):S;return p&&u+p<g?[h-d-x,u+d,h-d,u+p+d]:[h-d-x,u+d,h-d,g-d]}case W.South:{let S=Math.round((g-u)/2),x=p?Math.min(S,Math.round(p)):S;return m&&f+m<h?[f+d,g-d-x,f+m-d,g-d]:[f+d,g-d-x,h-d,g-d]}case W.Centre:return[f+d,u+d,h-d,g-d];default:return console.warn(`DropTarget does not recognize position ${a}`),null}}activate(){return this.active=!0,this}toArray(){let t=this,o=[t];for(;t=t.nextDropTarget;)o.push(t);return o}static getActiveDropTarget(t){return t===null?null:t!=null&&t.active?t:me.getActiveDropTarget(t.nextDropTarget)}};function Pt(e,t,o,n,r,i){var l;let s=null,a=_e.allBoxesContainingPoint(o,n,e,t,i);if(a.length){let[c,...p]=a,{"data-path":m,path:u=m,"data-row-placeholder":f}=D(c),h=n[u],y=uo(e,t,h,r&&f?"row":void 0),d=n[u],b=([E,...R])=>{var S,x;if(((S=y.position)==null?void 0:S.Header)||y.closeToTheEdge){let T=us(E,y,d,n,e,t);if(T){let[L,A]=T;return new me({component:E,pos:L,clientRect:A,nextDropTarget:(x=b(R))!=null?x:null})}else if(R.length)return b(R)}};s=new me({component:c,pos:y,clientRect:h,nextDropTarget:(l=b(p))!=null?l:null}).activate()}return s}function us(e,{closeToTheEdge:t,position:o},n,r,i,s){if(!e||e.type==="DraggableLayout")return;let a=r[e.props.path],l=t&ke.north,c=t&ke.east,p=t&ke.south,m=t&ke.west,u=(l||o.Header)&&Math.round(n.top)===Math.round(a.top),f=c&&Math.round(n.right)===Math.round(a.right),h=p&&Math.round(n.bottom)===Math.round(a.bottom),g=m&&Math.round(n.left)===Math.round(a.left);if(u||f||h||g){let{"data-path":y,path:d=y}=e.props,b=r[d],E=uo(i,s,b);if((ms(e)||zn(e))&&t&cs)return E.width=120,[E,b];if((ds(e)||zn(e))&&(o.Header||t&ps))return E.height=120,[E,b]}}function zn(e){return P(e)==="Stack"}function ms(e){return P(e)==="Flexbox"&&e.props.style.flexDirection==="column"}function ds(e){return P(e)==="Flexbox"&&e.props.style.flexDirection==="row"}var In=v(require("classnames")),Ge=v(require("react")),vt=v(require("react-dom"));var mo=!1,ee=[];function Bn(e){if(e.key==="Esc"){if(ee.length)Hn();else if(mo){let t=document.body.querySelector(".vuuDialog");t&&vt.default.unmountComponentAtNode(t)}}}function On(e){if(ee.length){let t=document.body.querySelectorAll(".vuuPopup");for(let o=0;o<t.length;o++)if(t[o].contains(e.target))return;Hn()}}function Hn(){if(ee.length){let e=document.body.querySelectorAll(".vuuPopup");for(let t=0;t<e.length;t++)vt.default.unmountComponentAtNode(e[t]);$n("*")}}function fs(e){ee.indexOf(e)===-1&&(ee.push(e),mo===!1&&(window.addEventListener("keydown",Bn,!0),window.addEventListener("click",On,!0)))}function $n(e){if(ee.length){if(e==="*")ee.length=0;else{let t=ee.indexOf(e);t!==-1&&ee.splice(t,1)}ee.length===0&&mo===!1&&(window.removeEventListener("keydown",Bn,!0),window.removeEventListener("click",On,!0))}}var hs=({children:e,position:t,style:o})=>{let n=(0,In.default)("hwPopup","hwPopupContainer",t);return(0,Ge.createElement)("div",{className:n,style:o},e)},gs=1,Te=class{static showPopup({name:t="anon",group:o="all",position:n="",left:r=0,right:i="auto",top:s=0,width:a="auto",component:l}){if(!l)throw Error("PopupService showPopup, no component supplied");fs(t);let c=document.body.querySelector(".vuuPopup."+o);c===null&&(c=document.createElement("div"),c.className="vuuPopup "+o,document.body.appendChild(c));let p={width:a};yt((0,Ge.createElement)(hs,{key:gs++,position:n,style:p},l),c,r,s,()=>{Te.keepWithinThePage(c,i)})}static hidePopup(t="anon",o="all"){if(ee.indexOf(t)!==-1){$n(t);let n=document.body.querySelector(`.vuuPopup.${o}`);n&&vt.default.unmountComponentAtNode(n)}}static keepWithinThePage(t,o="auto"){let n=t.querySelector(".vuuPopupContainer > *");if(n){let{top:r,left:i,width:s,height:a,right:l}=n.getBoundingClientRect(),c=window.innerWidth,m=window.innerHeight-(r+a);m<0&&(n.style.top=Math.round(r)+m+"px");let u=c-(i+s);if(u<0&&(n.style.left=Math.round(i)+u+"px"),typeof o=="number"&&o!==l){let f=o-l;n.style.left=i+f+"px"}}}};var Nn=v(require("classnames"));var ho=require("react/jsx-runtime");function go(e,t=0,o=0){let{pos:n,clientRect:r}=e,i=20;return n.position.West?[r.left-o+i,n.y-t,"left"]:n.position.South?[n.x-o,r.bottom-t-i,"bottom"]:n.position.East?[r.right-o-i,n.y-t,"right"]:[n.x-o,r.top-t+i,"top"]}var fo="vuuDropMenu",yo=({className:e,dropTarget:t,onHover:o,orientation:n})=>{let r=t.toArray();return(0,ho.jsx)("div",{className:(0,Nn.default)(fo,e,`${fo}-${n}`),onMouseLeave:()=>o(null),children:r.map((i,s)=>(0,ho.jsx)("div",{className:`${fo}-item`,"data-icon":s===0?"column-2A":"column-2B",onMouseEnter:()=>o(i)},s))})};var _n=require("react/jsx-runtime"),bo=!1,tt=null,te=null,ys=e=>tt=e,bs=([e,t])=>`M${e},${t}`,xs=([e,t])=>`L${e},${t}`,Fn=([e,...t])=>`${bs(e)} ${t.map(xs)}Z`,Rs=e=>{if(e){let[t,o,n,r,i,s,a,l]=e;return`M${t},${o} L${n},${r} M${i},${s} L${a},${l}`}else return""};function Es(){if(document.getElementById("hw-drag-canvas")===null){let e=document.getElementById("root"),t=document.createElement("div");t.id="hw-drag-canvas",t.innerHTML=`
|
|
2
|
+
<svg width="100%" height="100%">
|
|
3
|
+
<path id="hw-drop-guides" />
|
|
4
|
+
<path
|
|
5
|
+
id="vuu-drop-outline"
|
|
6
|
+
d="M300,132 L380,132 L380,100 L460,100 L460,132, L550,132 L550,350 L300,350z">
|
|
7
|
+
<animate
|
|
8
|
+
attributeName="d"
|
|
9
|
+
id="hw-drop-outline-animate"
|
|
10
|
+
begin="indefinite"
|
|
11
|
+
dur="300ms"
|
|
12
|
+
fill="freeze"
|
|
13
|
+
to="M255,33 L255,33,L255,1,L315,1,L315,1,L794,1,L794,164,L255,164Z"
|
|
14
|
+
/>
|
|
15
|
+
</path>
|
|
16
|
+
</svg>
|
|
17
|
+
`,document.body.insertBefore(t,e)}}var ot=class{constructor(){this.currentPath=null;this.tabMode=null;Es()}prepare(t,o="full-view"){document.body.classList.add("drawing"),this.currentPath=null,this.tabMode=o;let n=this.getPoints(0,0,0,0),r=Fn(n),i=document.getElementById("vuu-drop-outline");i==null||i.setAttribute("d",r),this.currentPath=r}clear(){tt=null,Lt(),document.body.classList.remove("drawing"),Te.hidePopup()}get hoverDropTarget(){return tt}getPoints(t,o,n,r,i=0,s=0,a=0){let l=this.tabMode==="tab-only";if(s===0)return[[t,o+a],[t,o+a],[t,o],[t+s,o],[t+s,o],[t+n,o],[t+n,o+r],[t,o+r]];if(l){let c=i;return[[c,o],[c,o],[c+s,o],[c+s,o],[c+s,o+a],[c+s,o+a],[c,o+a],[c,o+a]]}else return i===0?[[t,o+a],[t,o+a],[t,o],[t+s,o],[t+s,o+a],[t+n,o+a],[t+n,o+r],[t,o+r]]:[[t,o+a],[t+i,o+a],[t+i,o],[t+i,o],[t+i,o+a],[t+n,o+a],[t+n,o+r],[t,o+r]]}draw(t,o){let r=bo;if(tt!==null)this.drawTarget(tt);else if(bo=t.nextDropTarget!=null,t.pos.tab?Ss(t):te&&Lt(),this.drawTarget(t,o),bo){let[i,s,a]=go(t);{let l=(0,_n.jsx)(yo,{dropTarget:t,onHover:ys,orientation:a});Te.showPopup({left:i,top:s,component:l})}}else Te.hidePopup()}drawTarget(t,o){let r=t.getTargetDropOutline(6,o);if(r){let{l:i,t:s,r:a,b:l,tabLeft:c,tabWidth:p,tabHeight:m,guideLines:u}=r,f=a-i,h=l-s;if(this.currentPath){let E=document.getElementById("vuu-drop-outline");E==null||E.setAttribute("d",this.currentPath)}let g=this.getPoints(i,s,f,h,c,p,m),y=Fn(g),d=document.getElementById("hw-drop-outline-animate");d==null||d.setAttribute("to",y),d==null||d.beginElement(),this.currentPath=y;let b=document.getElementById("hw-drop-guides");b==null||b.setAttribute("d",Rs(u))}}},Vn="transition:margin-left .4s ease-out;margin-left: 63px",Wn="transition:margin-left .4s ease-out;margin-left: 0px";function Ss(e){var a,l;let{AFTER:t,BEFORE:o}=et,{clientRect:{Stack:n},pos:{tab:r}}=e,{id:i}=e.component.props,s=null;if(n&&r&&r.positionRelativeToTab!==t){let c=r.positionRelativeToTab===o?1:2,p=`:scope .hwTabstrip > .hwTabstrip-inner > .hwTab:nth-child(${r.index+c})`;s=(a=document.getElementById(i))==null?void 0:a.querySelector(p),s?(te===null||te!==s)&&(s.style.cssText=Vn,te&&(te.style.cssText=Wn),te=s):Lt()}else if((r==null?void 0:r.positionRelativeToTab)===o){if(te===null){let c=".vuuHeader-title";s=(l=document.getElementById(i))==null?void 0:l.querySelector(c),s.style.cssText=Vn,te=s}}else Lt()}function Lt(){te&&(te.style.cssText=Wn,te=null)}var de,nt,De,Un,Xn,we,Mt,Ue=null,Ro,Yn,rt,Zn,xo,Ct=null,Ts=3,At=new ot,Gn=.4;function Ds(e,t){return t?V(e,t):le(e,o=>o.dropTarget)}var It={handleMousedown(e,t,o={}){de=t,Yn=o,Un=e.clientX,Xn=e.clientY,xo=o.dragThreshold===void 0?Ts:o.dragThreshold,xo===0?de(e,0,0):(window.addEventListener("mousemove",kt,!1),window.addEventListener("mouseup",zt,!1),Ct=window.setTimeout(()=>{console.log("mousedownTimer fires"),window.removeEventListener("mousemove",kt,!1),window.removeEventListener("mouseup",zt,!1),de==null||de(e,0,0)},500)),e.preventDefault()},initDrag(e,t,{top:o,left:n,right:r,bottom:i},s,a,l,c){return{drag:nt,drop:De}=a,ws(e,t,{top:o,left:n,right:r,bottom:i},s,l,c)}};function kt(e){let n=e.clientX-Un,r=e.clientY-Xn;Math.max(Math.abs(n),Math.abs(r))>xo&&(window.removeEventListener("mousemove",kt,!1),window.removeEventListener("mouseup",zt,!1),de==null||de(e,n,r),de=null)}function zt(){Ct&&(window.clearTimeout(Ct),Ct=null),window.removeEventListener("mousemove",kt,!1),window.removeEventListener("mouseup",zt,!1)}function ws(e,t,o,n,r,i){we=Ds(e,t);let{"data-path":s,path:a=s}=D(we);i&&(Ro=i.map(u=>le(e,f=>f.id===u)).map(u=>u.props.path)),rt=_e.measure(we,i),console.log({_measurements:rt});let l=rt[a];Mt=new wt(l,n.x,n.y,o,r);let c=Math.round(Mt.x.mousePct*100),p=Math.round(Mt.y.mousePct*100);return window.addEventListener("mousemove",qn,!1),window.addEventListener("mouseup",Jn,!1),Zn=!1,At.prepare(o,"tab-only"),Yn.DoNotTransform?"transform:none":`transform:scale(${Gn},${Gn});transform-origin:${c}% ${p}%;`}function qn(e){let t=e.clientX,o=e.clientY,n=Mt,r=Ue,i,s,a;n.update("x",t)&&(s=n.x.pos),n.update("y",o)&&(a=n.y.pos),s===void 0&&a===void 0||nt==null||nt(s,a),!(Zn||we===void 0)&&(n.inBounds()?i=Pt(t,o,we,rt,n.hasIntrinsicSize(),Ro):i=Pt(n.dropX(),n.dropY(),we,rt),r&&(i==null||i.box!==r.box)&&(Ue=null),i&&(At.draw(i,n),Ue=i))}function Jn(){Ps()}function Ps(){if(Ue){let e=At.hoverDropTarget||me.getActiveDropTarget(Ue);De==null||De(e),Ue=null}else De==null||De({component:we,pos:{position:W.Absolute}});nt=null,De=null,we=void 0,At.clear(),Ro=void 0,window.removeEventListener("mousemove",qn,!1),window.removeEventListener("mouseup",Jn,!1)}var Kn=v(require("classnames")),jn=require("react");var er=require("react/jsx-runtime"),Eo=function(t){let o=(0,jn.useRef)();o.current=t;let{className:n,id:r,style:i}=t,s=(0,Kn.default)("DraggableLayout",n);return(0,er.jsx)("div",{className:s,id:r,style:i,children:t.children})},Qn="DraggableLayout";Eo.displayName=Qn;B(Qn,Eo,"container");var hr=require("@salt-ds/core"),gr=v(require("classnames")),yr=require("react");var dr=require("@vuu-ui/vuu-utils"),O=v(require("react"));var or=v(require("classnames"));var nr=require("react/jsx-runtime"),tr="vuuPlaceholder",it=({className:e,closeable:t,flexFill:o,resizeable:n,shim:r,...i})=>(0,nr.jsx)("div",{className:(0,or.default)(tr,e,{[`${tr}-shim`]:r}),...i,"data-placeholder":!0,"data-resizeable":!0});it.displayName="Placeholder";B("Placeholder",it);var rr=v(require("classnames")),_=v(require("react"));var So=require("react/jsx-runtime"),ir=_.default.memo(function({column:t,index:o,onDrag:n,onDragEnd:r,onDragStart:i,style:s}){let a=(0,_.useRef)(),l=(0,_.useRef)(null),c=(0,_.useRef)(0),[p,m]=(0,_.useState)(!1),u=(0,_.useCallback)(({key:x,shiftKey:T})=>{let L=T?10:1;t&&x==="ArrowDown"?n(o,L):t&&x==="ArrowUp"||!t&&x==="ArrowLeft"?n(o,-L):!t&&x==="ArrowRight"&&n(o,L)},[t,o,n]),f=(0,_.useCallback)(x=>{let{key:T}=x;(t&&(T==="ArrowUp"||T==="ArrowDown")||!t&&(T==="ArrowLeft"||T==="ArrowRIght"))&&(i(o),u(x),h.current=u)},[t,u,o,i]),h=(0,_.useRef)(f),g=x=>h.current(x),y=(0,_.useCallback)(x=>{a.current=!0;let T=x[t?"clientY":"clientX"],L=T-c.current;T&&T!==c.current&&n(o,L),c.current=T},[t,o,n]),d=(0,_.useCallback)(()=>{var x;window.removeEventListener("mousemove",y,!1),window.removeEventListener("mouseup",d,!1),r(),m(!1),(x=l.current)==null||x.focus()},[y,r,m]),b=(0,_.useCallback)(x=>{c.current=t?x.clientY:x.clientX,i(o),window.addEventListener("mousemove",y,!1),window.addEventListener("mouseup",d,!1),x.preventDefault(),m(!0)},[t,y,d,o,i,m]),E=()=>{var x;a.current?a.current=!1:(x=l.current)==null||x.focus()},R=()=>{h.current=f},S=(0,rr.default)("Splitter","focusable",{active:p,column:t});return(0,So.jsx)("div",{className:S,"data-splitter":!0,ref:l,role:"separator",style:s,onBlur:R,onClick:E,onKeyDown:g,onMouseDown:b,tabIndex:0,children:(0,So.jsx)("div",{className:"grab-zone"})})});var Do=require("@vuu-ui/vuu-utils"),wo=v(require("react"));var vs={"data-placeholder":!0,"data-resizeable":!0},Bt={},Pe="auto",To={flexBasis:0,flexGrow:1,flexShrink:1,height:Pe,width:Pe},sr={height:"width",width:"height"},ar=(e="row")=>e==="row"?["width","height","column"]:["height","width","row"],Ls=e=>typeof e=="string"&&e.endsWith("%"),J=e=>{let{style:{width:t=Pe,height:o=Pe}=Bt}=e.props,n=typeof o=="number",r=typeof t=="number";return n&&r?{height:o,width:t}:n?{height:o}:r?{width:t}:void 0};function Po(e,t,o){let n=sr[t],{style:{[n]:r=Pe,...i}=Bt}=e.props;return o&&o[t]?{...i,...To,flexBasis:o[t],flexGrow:0,flexShrink:0}:{...i,...To,[n]:r}}function lr(e){let{style:{flex:t,flexGrow:o,flexShrink:n,flexBasis:r}=Bt}=e.props;return typeof t=="number"||r===0&&o===1&&n===1?!0:typeof r!="number"}function vo(e,t,o){let n=sr[t],{style:{[t]:r=Pe,[n]:i=Pe,...s}=Bt}=e.props;return r!==Pe?Ls(r)?{flexBasis:0,flexGrow:1,flexShrink:1,[t]:void 0,[n]:i}:{flexBasis:r,flexGrow:0,flexShrink:0,[t]:r,[n]:i}:o&&o[t]?{...s,...To,flexBasis:o[t],flexGrow:0,flexShrink:0}:{...s,[n]:i}}function st(e,t,o,n,r){let i=[],s=0,a;if(n&&r){let p,[m,u,f,h]=r;[p,a]=t==="column"?[u-n.top,n.bottom-h]:[m-n.left,n.right-f],p&&i.push(ce(`${o}.${s++}`,p,{flexGrow:0,flexShrink:0}))}else a=!0;let{version:l=0,style:c}=D(e);return i.push($(e,`${o}.${s++}`,{version:l+1,style:{...c,flexBasis:"auto",flexGrow:0,flexShrink:0}})),a&&i.push(ce(`${o}.${s++}`,0,void 0,{[`data-${t}-placeholder`]:!0})),Lo(t,{resizeable:!1,style:{flexBasis:"auto"}},i,o)}var Ms=(e,t)=>{if(!t)return e===0?1:0};function Lo(e,t,o,n){let r=(0,Do.uuid)(),{flexFill:i,style:s,resizeable:a=!0}=t,{flexBasis:l=i?void 0:"auto"}=s,c=Ms(l,i);return wo.default.createElement(ue.Flexbox,{id:r,key:r,path:n,flexFill:i,style:{...s,flexDirection:e,flexBasis:l,flexGrow:c,flexShrink:c},resizeable:a},o)}var Cs={flexGrow:1,flexShrink:1};function ce(e,t,o,n){let r=(0,Do.uuid)();return wo.default.createElement("div",{...vs,...n,"data-path":e,id:r,key:r,style:{...Cs,...o,flexBasis:t}})}var As={},at=1,lt=2,ks=e=>typeof e.intrinsicSize=="number",zs=(e,t)=>{let o={};return e.forEach(n=>{o[n]=w(t,n)}),o},Ot=(e,t,o)=>e.map((n,r)=>{var l;let i=w(n,"resizeable"),{[t]:s}=(l=J(n))!=null?l:As,a=lr(n);return o?{index:r,flexOpen:a,intrinsicSize:s,resizeable:i,...zs(o,n)}:{index:r,flexOpen:a,intrinsicSize:s,resizeable:i}}),cr=e=>{let t=e.length,o=e.every(ks),n=Array(t).fill(0);if(o&&(n[0]=lt,n[t-1]=lt),t<2)return n;for(let r=0,i=0;r<t-1;r++)e[r].resizeable&&!i&&(i=at),n[r]+=i;for(let r=t-1;r>0&&(n[r]&at&&(n[r]-=at),!e[r].resizeable);r--);return n},pr=(e,t)=>{let o=Bs(e,t),n=Os(e,t),r=o!==-1&&n!==-1?[o,n]:void 0,i=Is(e,r);return[r,i]};function Is(e,t){if(t){let o=[];for(let n=0;n<e.length;n++)e[n].flexOpen&&!t.includes(n)&&o.push(n);return o}}function Bs(e,t){let o=t,n=!1;for(;o>=1&&!n;)o=o-1,n=ur(e,o);return o}function Os(e,t){let o=t,n=!1,r=e.length;for(;o<r&&!n;)o=o+1,n=ur(e,o);return o===r?-1:o}function ur(e,t){let{placeholder:o,splitter:n,resizeable:r,intrinsicSize:i}=e[t];return Boolean(!n&&!i&&(o||r))}var Hs=e=>!e.splitter&&!e.placeholder,fr=({children:e,onSplitterMoved:t,style:o})=>{let n=(0,O.useRef)(null),r=(0,O.useRef)(),i=(0,O.useRef)(),s=(0,O.useRef)([]),[,a]=(0,O.useState)({}),l=y=>{i.current=y,a({})},c=(o==null?void 0:o.flexDirection)==="column",p=c?"height":"width",m=(0,O.useMemo)(()=>Array.isArray(e)?e:O.default.isValidElement(e)?[e]:[],[e]),u=(0,O.useCallback)(y=>{let{current:d}=r;if(d){let[b,E]=pr(d,y);b&&(b.forEach(R=>{var x;let S=(x=n.current)==null?void 0:x.childNodes[R];if(S){let{size:T,minSize:L}=Vs(S,p);d[R].currentSize=T,d[R].minSize=L}}),E&&E.forEach(R=>{var x;let S=(x=n.current)==null?void 0:x.childNodes[R];if(S){let{[p]:T}=S.getBoundingClientRect();d[R].flexBasis=T}}))}},[p]),f=(0,O.useCallback)((y,d)=>{i.current&&r.current&&l(Ns(i.current,r.current,d,p))},[p]),h=(0,O.useCallback)(()=>{let y=r.current;y&&(t==null||t(y.filter(Hs))),y==null||y.forEach(d=>{d.currentSize=void 0,d.flexBasis=void 0,d.flexOpen=!1})},[t]),g=(0,O.useCallback)(y=>O.default.createElement(ir,{column:c,index:y,key:`splitter-${y}`,onDrag:f,onDragEnd:h,onDragStart:u}),[f,h,u,c]);return(0,O.useMemo)(()=>{let[y,d]=$s(m,p,g,s.current);r.current=d,i.current=y},[m,g,p]),{content:i.current||[],rootRef:n}};function $s(e,t,o,n){let r=Ot(e,t),i=cr(r),s=[],a=[];for(let l=0;l<e.length;l++){let c=e[l];if(l===0&&i[l]<&&(s.push(mr(l)),a.push({placeholder:!0,shim:!0})),c.key==null){let p=n[l]||(n[l]=(0,dr.getUniqueId)());s.push(O.default.cloneElement(c,{key:p}))}else s.push(c);a.push(r[l]),l>0&&i[l]<?(s.push(mr(l)),a.push({placeholder:!0})):i[l]&at&&(s.push(o(s.length)),a.push({splitter:!0}))}return[s,a]}function Ns(e,t,o,n){return Fs(t,o)?e.map((i,s)=>{let a=t[s],{currentSize:l,flexOpen:c,flexBasis:p}=a,m=l!==void 0;if(m||c){let{flexBasis:u}=i.props.style||{},f=m?a.currentSize:p;return f!==u?O.default.cloneElement(i,{style:{...i.props.style,flexBasis:f,[n]:"auto"}}):i}else return i}):e}function Fs(e,t){let o=[];e.forEach((p,m)=>{p.currentSize!==void 0&&o.push(m)});let n=t<0?o[0]:o[1],{currentSize:r=0,minSize:i=0}=e[n];if(r===i)return!1;if(Math.abs(t)>r-i){let p=t<0?-1:1;t=Math.max(0,r-i)*p}let s=e[o[0]],{currentSize:a=0}=s;s.currentSize=a+t;let l=e[o[1]],{currentSize:c=0}=l;return l.currentSize=c-t,!0}function mr(e){return O.default.createElement(it,{shim:e===0,key:`placeholder-${e}`})}function Vs(e,t){let{[t]:o}=e.getBoundingClientRect(),r=getComputedStyle(e).getPropertyValue(`min-${t}`),i=r.endsWith("px")?parseInt(r,10):0;return{size:o,minSize:i}}var xr=require("react/jsx-runtime"),Mo="hwFlexbox",br=(0,yr.forwardRef)(function(t,o){let{breakPoints:n,children:r,column:i,className:s,flexFill:a,gap:l,fullPage:c,id:p,onSplitterMoved:m,resizeable:u,row:f,spacing:h,splitterSize:g,style:y,...d}=t,{content:b,rootRef:E}=fr({children:r,onSplitterMoved:m,style:y}),R=(0,gr.default)(Mo,s,{[`${Mo}-column`]:i,[`${Mo}-row`]:f,"flex-fill":a,"full-page":c});return(0,xr.jsx)("div",{...d,className:R,"data-resizeable":u||void 0,id:p,ref:(0,hr.useForkRef)(E,o),style:{...y,gap:l,"--spacing":h},children:b})});br.displayName="Flexbox";var Ht=br;var Ur=require("react");var ze={ADD:"add",BLUR:"blur",BLUR_SPLITTER:"blur-splitter",DRAG_START:"drag-start",DRAG_STARTED:"drag-started",DRAG_DROP:"drag-drop",FOCUS:"focus",FOCUS_SPLITTER:"focus-splitter",INITIALIZE:"initialize",MAXIMIZE:"maximize",MINIMIZE:"minimize",REMOVE:"remove",REPLACE:"replace",RESTORE:"restore",SAVE:"save",SET_TITLE:"set-title",SPLITTER_RESIZE:"splitter-resize",SWITCH_TAB:"switch-tab",TEAR_OUT:"tear-out"};var U=require("react");var Vo=v(require("react"));var Ho=require("@vuu-ui/vuu-utils"),Xe=v(require("react"));var Io=require("@vuu-ui/vuu-utils"),ve=v(require("react"));var Ie=require("react"),G=new Map,K=new Map,Co=e=>G.get(e),Ao=e=>G.has(e),ko=(e,t)=>G.set(e,t),Be=()=>{let e=(0,Ie.useCallback)((s,a)=>{let l=K.get(s);if(l)return a!==void 0&&l[a]!==void 0?l[a]:a!==void 0?void 0:l},[]),t=(0,Ie.useCallback)((s,a,l)=>{if(a===void 0)K.set(s,l);else if(K.has(s)){let c=K.get(s);K.set(s,{...c,[a]:l})}else K.set(s,{[a]:l})},[]),o=(0,Ie.useCallback)((s,a)=>{if(K.has(s)){if(a===void 0)K.delete(s);else if(K.get(s)[a]){let{[a]:c,...p}=K.get(s);Object.keys(p).length>0?K.set(s,p):K.delete(s)}}},[]),n=(0,Ie.useCallback)((s,a)=>{let l=G.get(s);if(l)return a!==void 0?l[a]:l},[]),r=(0,Ie.useCallback)((s,a,l)=>{if(a===void 0)G.set(s,l);else if(G.has(s)){let c=G.get(s);G.set(s,{...c,[a]:l})}else G.set(s,{[a]:l})},[]),i=(0,Ie.useCallback)((s,a)=>{if(G.has(s)){if(a===void 0)G.delete(s);else if(G.get(s)[a]){let{[a]:c,...p}=G.get(s);Object.keys(p).length>0?G.set(s,p):G.delete(s)}}},[]);return{loadSessionState:e,loadState:n,saveSessionState:t,saveState:r,purgeState:i,purgeSessionState:o}};var Rr=e=>e.flexDirection==="column"?["height","width"]:["width","height"],Ws={},ct=(e,t="0")=>{let[o,n]=Oo(P(e),e.props,t);return ve.default.cloneElement(e,o,n)},Bo=(e,t)=>{let o=P(e),[n,r]=Oo(o,e.props,"0",void 0,t);return(0,ve.cloneElement)(e,n,r)};function _s(e,t,o="0",n=null,r){var g,y;let{active:i=0,"data-path":s,path:a=s,id:l,style:c}=D(r),p=P(r)===e&&o===a,m=p?l:(g=t.id)!=null?g:(0,Io.uuid)(),u=e==="Stack"?(y=t.active)!=null?y:i:void 0,f=m,h=p?c:Us(e,t,n);return oo(e)?{id:m,key:f,path:o,style:h,type:e,active:u}:{id:m,key:f,style:h,"data-path":o}}function Oo(e,t,o,n=null,r){var c,p;let i=_s(e,t,o,n,r);if(t.layout&&!r)return[i,[$t(t.layout,`${o}.0`)]];let s=(p=r==null?void 0:r.children)!=null?p:(c=r==null?void 0:r.props)==null?void 0:c.children,l=t.dropTarget&&s?s:Gs(e,t.children,o,s);return[i,l]}function Gs(e,t,o="0",n){let r=Array.isArray(t)?t:ve.default.isValidElement(t)?[t]:[];return F(e)?r.map((i,s)=>{let a=P(i),l=P(n==null?void 0:n[s]);if(!l||a===l){let[c,p]=Oo(a,i.props,`${o}.${s}`,e,n==null?void 0:n[s]);return ve.default.cloneElement(i,c,p)}return n==null?void 0:n[s]}):t}var Us=(e,t,o)=>{let{style:n=Ws}=t;if(e==="Flexbox"&&(n={flexDirection:t.column?"column":"row",...n,display:"flex"}),n.flex){let{flex:r,...i}=n;n={...i,...Tt(typeof r=="number"?r:0)}}else o==="Stack"?n={...n,...Tt(1)}:o==="Flexbox"&&(n.width||n.height)&&n.flexBasis===void 0&&(n={...n,flexBasis:"auto",flexGrow:0,flexShrink:0});return n};function $t({id:e=(0,Io.uuid)(),type:t,children:o,props:n,state:r},i){let s=t.match(/^[a-z]/)?t:ue[t];if(s===void 0)throw Error(`layoutUtils unable to create component from JSON, unknown type ${t}`);return r&&ko(e,r),ve.default.createElement(s,{id:e,...n,key:e,path:i},o?o.map((a,l)=>$t(a,`${i}.${l}`)):void 0)}function Er(e){return Sr(e)}function Sr(e){let t=P(e),{id:o,children:n,type:r,...i}=D(e),s=Ao(o)?Co(o):void 0;return{id:o,type:t,props:Xs(i),state:s,children:ve.default.Children.map(n,Sr)}}function Xs(e){if(e){let{path:t,...o}=e,n={};for(let[r,i]of Object.entries(o))n[r]=zo(i);return n}}function zo(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e;if(Array.isArray(e))return e.map(zo);if(typeof e=="object"&&e!==null){let t={};for(let[o,n]of Object.entries(e))t[o]=zo(n);return t}}function Tr(e,t){var s;let o=e.props.children,n=o.length,{index:r=-1,positionRelativeToTab:i="after"}=t.tab||{};return r===-1||r>=n?[o[n-1],"after"]:[(s=o[r])!=null?s:null,i]}function Nt(e,t,o){let{active:n,children:r=[],path:i}=D(e),s=w(t,"path"),{idx:a,finalStep:l}=q(i,s,!0),[c,p]=l?Ys(e,r,o):[n,r==null?void 0:r.map((u,f)=>f===a?Nt(u,t,o):u)],m=P(e)==="Stack"?Array.isArray(c)?c[0]:c:n;return Xe.default.cloneElement(e,{active:m},p)}function Ys(e,t,o){let n=w(e,"path"),r=t==null?void 0:t.length,{id:i=(0,Ho.uuid)()}=D(o);return r?[r,t.concat($(o,`${n}.${r}`,{id:i,key:i}))]:[0,[$(o,`${n}.0`,{id:i})]]}function Ft(e,t,o,n,r,i,s){let{active:a,children:l,path:c}=D(e),p=w(t,"path"),{idx:m,finalStep:u}=q(c,p),[f,h]=u?Zs(e,l,m,o,n,r,i,s):[a,l.map((y,d)=>d===m?Ft(y,t,o,n,r,i,s):y)],g=P(e)==="Stack"?f:a;return Xe.default.cloneElement(e,{active:g},h)}function Zs(e,t,o,n,r,i,s,a){let l=J(n);return(l==null?void 0:l.width)&&(l==null?void 0:l.height)?Js(e,t,o,n,r,s,a):Dr(e,t,o,n,r,(i==null?void 0:i.width)||(i==null?void 0:i.height),s)}var qs=(e,t,{top:o,right:n,bottom:r,left:i},[s,a,l,c])=>{if(e==="column"&&t==="before")return a-o;if(e==="column")return r-c;if(e==="row"&&t==="before")return s-i;if(e==="row")return n-l};function Js(e,t,o,n,r,i,s){let{style:{flexDirection:a}}=D(e),[l,c,p]=ar(a),{[c]:m,[l]:u}=J(n),f=w(t[o],"path"),h=qs(a,r,i,s),[g,y]=m<i[c]?[st(n,p,f,i,s),u]:[n,void 0],d=h?ce(f,h,{flexGrow:0,flexShrink:0}):void 0;return m>i[c]&&(t=t.map(b=>{if(w(b,"placeholder"))return b;{let{[c]:E}=J(b);return E&&E<m?st(b,p,w(b,"path")):b}})),Dr(e,t,o,g,r,y,i,d)}function Dr(e,t,o,n,r,i,s,a){let l=w(e,"path"),c=0,p=!t||t.length===0?[n]:t.reduce((m,u,f)=>{if(o===f){let[h,g]=Ks(e,u,n,s);r==="before"?a?m.push(a,g,h):m.push(g,h):a?m.push(h,g,a):m.push(h,g),c=m.indexOf(g)}else m.push(u);return m},[]).map((m,u)=>u<c?m:$(m,`${l}.${u}`));return[c,p]}function Ks(e,t,o,n){let r=(0,Ho.uuid)(),{version:i=0}=D(o);if(i+=1,P(e)==="Flexbox"){let[s]=Rr(e.props.style),a=6,l={[s]:(n[s]-a)/2},c=vo(t,s,l),p=vo(o,s,l);return[Xe.default.cloneElement(t,{style:c}),Xe.default.cloneElement(o,{id:r,version:i,style:p})]}else{let{style:{left:s,top:a,flex:l,...c}={left:void 0,top:void 0,flex:void 0}}=D(o);return[t,Xe.default.cloneElement(o,{id:r,version:i,style:c})]}}var j={ADD:"add",DRAG_START:"drag-start",DRAG_DROP:"drag-drop",MAXIMIZE:"maximize",MINIMIZE:"minimize",REMOVE:"remove",REPLACE:"replace",RESTORE:"restore",SAVE:"save",SET_TITLE:"set-title",SPLITTER_RESIZE:"splitter-resize",SWITCH_TAB:"switch-tab",TEAROUT:"tearout"};var Le=v(require("react"));var pt=v(require("react"));function wr(e,{target:t,replacement:o}){return $o(e,t,o)}function $o(e,t,o){let n=w(t,"path"),r=w(t,"resizeable"),{style:i}=D(t),s=ct(pt.default.cloneElement(o,{resizeable:r,style:{...i,...o.props.style}}),n);return oe(e,t,s)}function oe(e,t,o,n){if(e===t)return o;let{idx:r,finalStep:i}=q(w(e,"path"),w(t,"path")),s=e.props.children.slice();return i?n?n===ze.MINIMIZE?s[r]=js(e,s[r]):n===ze.RESTORE&&(s[r]=Qs(s[r])):s[r]=o:s[r]=oe(s[r],t,o,n),pt.default.cloneElement(e,void 0,s)}function js(e,t){let{style:o}=D(e),{style:n}=D(t),{width:r,height:i,flexBasis:s,flexShrink:a,flexGrow:l,...c}=n,p={width:r,height:i,flexBasis:s,flexShrink:a,flexGrow:l},m={...c,flexBasis:0,flexGrow:0,flexShrink:0},u=o.flexDirection==="row"?"vertical":o.flexDirection==="column"?"horizontal":!1;return u?pt.default.cloneElement(t,{collapsed:u,restoreStyle:p,style:m}):t}function Qs(e){let{style:t,restoreStyle:o}=D(e),{flexBasis:n,flexShrink:r,flexGrow:i,...s}=t,a={...s,...o};return pt.default.cloneElement(e,{collapsed:!1,style:a,restoreStyle:void 0})}function No(e,{path:t}){let o=V(e,t),n=ae(e,t);if(n===null)return e;let{children:r}=D(n);if(r.length>1&&vr(r,t)){let{style:{flexBasis:i,display:s,flexDirection:a,...l}}=D(n),c=w(n,"path"),p=oe(e,n,ce(c,i,l));for(;(n=ae(p,c))&&w(n,"path")!=="0";){let{children:m}=D(n);if(vr(m)){c=w(n,"path");let{style:{flexBasis:u,display:f,flexDirection:h,...g}}=D(n);p=oe(e,n,ce(c,u,g))}else if(na(m))p=Cr(e,n);else break}return p}return Lr(e,o)}function Lr(e,t){let o=D(e),{children:n,path:r,preserve:i}=o,{active:s}=o,{idx:a,finalStep:l}=q(r,w(t,"path")),c=P(e),p=n.slice();if(l){if(p.splice(a,1),s!==void 0&&s>=a&&(s=Math.max(0,s-1)),p.length===1&&!i&&r!=="0"&&c.match(/Flexbox|Stack/))return ea(e,p[0]);!p.some(ta)&&p.some(Mr)&&(p=oa(p))}else p[a]=Lr(p[a],t);return p=p.map((m,u)=>$(m,`${r}.${u}`)),Le.default.cloneElement(e,{active:s},p)}function ea(e,t){let o=P(e),{path:n,style:{flexBasis:r,flexGrow:i,flexShrink:s,width:a,height:l}}=D(e),c=$(t,n);if(n==="0")c=Le.default.cloneElement(c,{style:{...t.props.style,width:a,height:l}});else if(o==="Flexbox"){let p=e.props.style.flexDirection==="column"?"height":"width",{style:{[p]:m,...u}}=c.props;c=Le.default.cloneElement(c,{flexFill:void 0,style:{...u,flexGrow:i,flexShrink:s,flexBasis:r,width:a,height:l}})}return c}var ta=e=>e.props.style.flexGrow>0,Mr=e=>{let{width:t,height:o,flexGrow:n}=e.props.style;return n===0&&typeof t!="number"&&typeof o!="number"},oa=e=>e.map(t=>Mr(t)?Le.default.cloneElement(t,{style:{...t.props.style,flexGrow:1}}):t),na=e=>{if(e&&e.length>0){let t=w(e[0],"placeholder"),o=!1;for(let n=1;n<e.length;n++){if(o=w(e[n],"placeholder"),t&&o)return!0;t=o}}},Cr=(e,t)=>{let{children:o,path:n}=D(e),{idx:r,finalStep:i}=q(n,w(t,"path")),s=o.slice();return i?s[r]=ra(t):s[r]=Cr(s[r],t),s=s.map((a,l)=>$(a,`${n}.${l}`)),Le.default.cloneElement(e,void 0,s)},ra=e=>{let{children:t}=D(e),o=[],n=[];for(let i=0;i<t.length;i++)w(t[i],"placeholder")?n.push(t[i]):(n.length===1?o.push(n.pop()):n.length>0&&(o.push(Pr(n)),n.length=0),o.push(t[i]));n.length===1?o.push(n.pop()):n.length>0&&o.push(Pr(n));let r=w(e,"path");return Le.default.cloneElement(e,void 0,o.map((i,s)=>$(i,`${r}.${s}`)))},Pr=([e,...t])=>{let o=w(e,"style"),{flexBasis:n,flexGrow:r,flexShrink:i}=o;for(let{props:{style:s}}of t)n+=s.flexBasis,r=Math.max(r,s.flexGrow),i=Math.max(i,s.flexShrink);return Le.default.cloneElement(e,{style:{...o,flexBasis:n,flexGrow:r,flexShrink:i}})},vr=(e,t)=>e.every(o=>w(o,"placeholder")||t&&w(o,"path")===t);var Fo=v(require("react"));function Ar(e,{path:t,sizes:o}){let n=V(e,t,!0),{children:r,style:i}=D(n),s=i.flexDirection==="column"?"height":"width",a=ia(r,o,s),l=Fo.default.cloneElement(n,void 0,a);return oe(e,n,l)}function ia(e,t,o){return e.map((n,r)=>{let{style:{[o]:i,flexBasis:s}}=D(n),a=t[r],{currentSize:l,flexBasis:c}=a,m=l!==void 0?a.currentSize:c;return m===void 0||i===m||s===m?n:Fo.default.cloneElement(n,{style:sa(n.props.style,o,m)})})}function sa(e,t,o){let n=typeof e[t]=="number",{flexShrink:r=1,flexGrow:i=1}=e;return{...e,[t]:n?o:"auto",flexBasis:n?"auto":o,flexShrink:r,flexGrow:i}}var kr=require("@vuu-ui/vuu-utils"),ut=v(require("react"));var zr=e=>{let[t]=P(e);return t===t.toLowerCase()};function mt(e,t,o,n,r,i){let{children:s,path:a}=D(e),l=w(t,"path"),{idx:c,finalStep:p}=q(a,l),m=p?aa(e,s,t,o,n,r,i):s.map((u,f)=>f===c?mt(u,t,o,n,r,i):u);return ut.default.cloneElement(e,void 0,m)}function aa(e,t,o,n,r,i,s){let a=J(n);if((a==null?void 0:a.width)&&(a==null?void 0:a.height)){if(i===void 0||s===void 0)throw Error("wrap-layout-element, updateChildren clientRect and dropRect must both be available");return ca(t,o,n,r,i,s)}return la(e,t,o,n,r)}function la(e,t,o,n,r){var x;let{version:i=0}=D(n),s=w(o,"path"),{type:a,flexDirection:l,showTabs:c}=Br(r),[p,m,u]=pa(a,o,n,l,r),f=Ir(r),h=f?1:0,g={resizeable:!0,style:u,version:i+1},d={[zr(o)?"data-resizeable":"resizeable"]:!0,style:m},b=a==="Stack"?{showTabs:c}:void 0,E=a==="Flexbox"?{splitterSize:(x=P(e)==="Flexbox"&&e.props.splitterSize)!=null?x:void 0}:void 0,R=(0,kr.uuid)(),S=ut.default.createElement(ue[a],{active:h,id:R,key:R,path:w(o,"path"),flexFill:w(o,"flexFill"),...E,...b,style:p,resizeable:w(o,"resizeable")},f?[$(o,`${s}.0`,d),ct(ut.default.cloneElement(n,g),`${s}.1`)]:[ct(ut.default.cloneElement(n,g),`${s}.0`),$(o,`${s}.1`,d)]);return t.map(T=>T===o?S:T)}function ca(e,t,o,n,r,i){let{flexDirection:s}=Br(n),a=s==="column"?"row":"column",l=Ir(n),[c,p,m,u]=i,[f,h]=s==="column"?[p-r.top,r.bottom-u]:[c-r.left,r.right-m],g=w(t,"path"),y=0,d=zr(t)?"data-resizeable":"resizeable",b=[];f&&b.push(l?$(t,`${g}.${y++}`,{[d]:!0,style:{flexBasis:f,flexGrow:1,flexShrink:1}}):ce(`${g}.${y++}`,f,{flexGrow:0,flexShrink:0})),b.push(st(o,a,`${g}.${y++}`,r,i)),h&&b.push(l?ce(`${g}.${y++}`,0):$(t,`${g}.${y++}`,{[d]:!0,style:{flexBasis:0,flexGrow:1,flexShrink:1}}));let E=Lo(s,t.props,b,g);return e.map(R=>R===t?E:R)}function pa(e,t,o,n,r){let i={...t.props.style,flexDirection:n},s=e==="Flexbox"&&n==="column"?"height":"width",a=Po(o,s,r),l=Po(t,s);return[i,l,a]}var Ir=e=>{var t;return e.position.SouthOrEast?!0:((t=e==null?void 0:e.tab)==null?void 0:t.positionRelativeToTab)==="before"?!1:!!e.position.Header};function Br(e){return e.position.Header?{type:"Stack",flexDirection:"column",showTabs:!0}:{type:"Flexbox",flexDirection:e.position.EastOrWest?"row":"column"}}var Nr=(e,t)=>{switch(t.type){case j.ADD:return ha(e,t);case j.DRAG_DROP:return fa(e,t);case j.MAXIMIZE:return da(e,t);case j.REMOVE:return No(e,t);case j.REPLACE:return wr(e,t);case j.SET_TITLE:return ma(e,t);case j.SPLITTER_RESIZE:return Ar(e,t);case j.SWITCH_TAB:return ua(e,t);default:return e}},ua=(e,{path:t,nextIdx:o})=>{let n=V(e,t,!0),r=Vo.default.cloneElement(n,{active:o});return oe(e,n,r)},ma=(e,{path:t,title:o})=>{let n=V(e,t,!0),r=Vo.default.cloneElement(n,{title:o});return oe(e,n,r)},da=(e,{path:t,type:o})=>{if(t){let n=V(e,t,!0);return oe(e,n,n,o)}else return e},fa=(e,t)=>{var h,g;console.log("drag drop");let{draggedReactElement:o,dragInstructions:n,dropTarget:r}=t,i=r.component,{pos:s}=r,a=((h=s==null?void 0:s.position)==null?void 0:h.Header)&&P(i)==="Stack",{id:l,version:c}=D(o),p=J(o),m;if(a){let[y,d]=Tr(i,s);y===void 0?m=Nt(e,i,o):m=Ft(e,y,o,d)}else!p&&((g=s==null?void 0:s.position)==null?void 0:g.Centre)?m=$o(e,i,o):m=ga(e,r,o);if(n.DoNotRemove)return m;let u=le(m,y=>y.id===l&&y.version===c),f=w(u,"path");return No(m,{path:f,type:"remove"})},ha=(e,{path:t,component:o})=>Nt(e,V(e,t),o),ga=(e,t,o)=>{let{component:n,pos:r,clientRect:i,dropRect:s}=t,a=w(n,"path");if(a==="0.0")return mt(e,n,o,r);let l=ae(e,a);if(Or(r,l)){let c=r.position.SouthOrEast?"after":"before";return Ft(e,n,o,c,r,i,s)}if(!Or(r,l))return mt(e,n,o,r,i,s);if(F(P(l)))return mt(e,n,o,r);throw Error(`no support right now for position = ${r.position}`)},Or=(e,t)=>e.position.Centre?$r(t)||Hr(t):e.position.NorthOrSouth?Hr(t):e.position.EastOrWest?$r(t):!1,Hr=e=>P(e)==="Flexbox"&&e.props.style.flexDirection==="column",$r=e=>P(e)==="Flexbox"&&e.props.style.flexDirection!=="column";var Fr=require("react"),ya=e=>console.log(`dispatch ${e.type}, have you forgotten to provide a LayoutProvider ?`),Ye=(0,Fr.createContext)({dispatchLayoutProvider:ya,version:-1});var fe=require("react");var ba={},Vr=[0,0],xa=(e,t,o)=>{let n=document.createElement("div");n.className="vuuSimpleDraggableWrapper",n.classList.add("vuuSimpleDraggableWrapper","salt-theme","salt-density-medium"),n.dataset.dragging="true";let r=o!=null?o:document.createElement("div");r.id=t,n.appendChild(r),document.body.appendChild(n);let i=`top:${e.top}px;left:${e.left}px;width:${e.width}px;height:${e.height}px;`;return[n,i,e.left,e.top]},Ra=e=>{let{offsetParent:t}=e;if(t===null)return Vr;{let{left:o,top:n}=t.getBoundingClientRect();return[o,n]}},Wr=(e,t)=>{let o=(0,fe.useRef)(),n=(0,fe.useRef)(),r=(0,fe.useRef)(),i=(0,fe.useCallback)((c,p)=>{if(n.current&&r.current){let{dragOffsets:[m,u],targetPosition:f}=n.current,h=typeof c=="number"?c-m:f.left,g=typeof p=="number"?p-u:f.top;(h!==f.left||g!==f.top)&&(n.current.targetPosition.left=h,n.current.targetPosition.top=g,r.current.style.top=g+"px",r.current.style.left=h+"px")}},[]),s=(0,fe.useCallback)(c=>{if(n.current){let{dragInstructions:p,payload:m,originalCSS:u}=n.current;t({type:"drag-drop",draggedReactElement:m,dragInstructions:p,dropTarget:c}),console.log("[useLayoutDragDrop]",{dragInstructions:p}),r.current&&(p.RemoveDraggableOnDragEnd?document.body.removeChild(r.current):(r.current.style.cssText=u,delete r.current.dataset.dragging)),o.current=void 0,n.current=void 0,r.current=void 0}},[t]),a=(0,fe.useCallback)(c=>{if(o.current){let{payload:p,dragContainerPath:m,dragElement:u,dragRect:f,instructions:h=ba,path:g}=o.current,{current:y}=e,d={x:c.clientX,y:c.clientY},b=p!=null?p:V(y,g,!0),{id:E}=b.props,R=J(b),S="",x="",T="",L=-1,A=-1,N=Vr,M=document.getElementById(E);if(M===null)[M,x,L,A]=xa(f,E,u);else{N=Ra(M);let[H,C]=N,{width:k,height:I,left:Q,top:X}=M.getBoundingClientRect();L=Q-H,A=X-C,x=`width:${k}px;height:${I}px;left:${L}px;top:${A}px;z-index: 100;background-color:#ccc;opacity: 0.6;`,M.dataset.dragging="true",S=M.style.cssText}T=It.initDrag(e.current,m,f,d,{drag:i,drop:s},R),M.style.cssText=x+T,r.current=M,n.current={payload:b,originalCSS:S,dragRect:f,dragOffsets:N,dragInstructions:h,targetPosition:{left:L,top:A}}}},[i,s,e]);return(0,fe.useCallback)(c=>{let{evt:p,...m}=c;console.log("prepare to drag",{options:m}),o.current={...m,dragContainerPath:""},It.handleMousedown(p,a,m.instructions)},[a])};var Wo=require("react/jsx-runtime"),_r=e=>e.dropTarget,Ea=e=>["drag-drop","remove","set-title","splitter-resize","switch-tab"].includes(e.type),Sa=()=>{let e=Gr();return(0,Wo.jsx)("div",{children:`Context: ${e} `})},Ta=e=>{let{children:t,layout:o,onLayoutChange:n}=e,r=(0,U.useRef)(void 0),i=(0,U.useRef)(t),[,s]=(0,U.useState)(null),a=(0,U.useCallback)(m=>{if(n){let u=le(m,_r)||r.current,h=P(u)==="DraggableLayout"?D(u).children[0]:u,g=Er(h);n(g,"drag-root")}},[n]),l=(0,U.useCallback)((m,u=!1)=>{let f=Nr(r.current,m);f!==r.current&&(r.current=f,s({}),!u&&Ea(m)&&a(f))},[a]),c=(0,U.useCallback)(m=>{switch(m.type){case"drag-start":{p(m);break}case"save":{a(r.current);break}default:{l(m);break}}},[l,a]),p=Wr(r,c);return(0,U.useEffect)(()=>{if(o){let m=le(r.current,_r),u=so(m),f=$t(o,`${m.props.path}.0`),h=u?{type:j.REPLACE,target:u,replacement:f}:{type:j.ADD,path:m.props.path,component:f};l(h,!0)}},[l,o]),r.current===void 0?r.current=Bo(t):t!==i.current&&(r.current=Bo(t,r.current),i.current=t),(0,Wo.jsx)(Ye.Provider,{value:{dispatchLayoutProvider:c,version:0},children:r.current})},Y=()=>{let{dispatchLayoutProvider:e}=(0,U.useContext)(Ye);return e},Gr=()=>{console.log({LayoutProviderContext:Ye});let{version:e}=(0,U.useContext)(Ye);return e};var Xr=require("react/jsx-runtime"),_o=function(t){let{path:o}=t,n=Y(),r=(0,Ur.useCallback)(i=>{n({type:ze.SPLITTER_RESIZE,path:o,sizes:i})},[n,o]);return(0,Xr.jsx)(Ht,{...t,onSplitterMoved:r})};_o.displayName="Flexbox";B("Flexbox",_o,"container");var ei=require("@salt-ds/core"),ti=v(require("classnames")),oi=require("react");var ne=require("react");var He=require("react"),Da=["height","width"],wa=["height"],Pa=["width"],Oe=new WeakMap,Zr=(e,t,o)=>{switch(o){case"height":return t.height;case"scrollHeight":return e.scrollHeight;case"scrollWidth":return e.scrollWidth;case"width":return t.width;default:return 0}},Yr=new ResizeObserver(e=>{for(let t of e){let{target:o,contentRect:n}=t,r=Oe.get(o);if(r){let{onResize:i,measurements:s}=r,a=!1;for(let[l,c]of Object.entries(s)){let p=Zr(o,n,l);p!==c&&(a=!0,s[l]=p)}a&&i&&i(s)}}});function Go(e,t,o,n=!1){let r=(0,He.useRef)(t),i=(0,He.useCallback)(s=>{let a=s.getBoundingClientRect();return r.current.reduce((l,c)=>(l[c]=Zr(s,a,c),l),{})},[]);(0,He.useLayoutEffect)(()=>{let s=e.current,a=!1;async function l(){Oe.set(s,{measurements:{}}),a=!1;let{fonts:c}=document;if(c&&await c.ready,!a){let p=Oe.get(s);if(p){let m=i(s);p.measurements=m,Yr.observe(s),n&&o(m)}}}if(s){if(Oe.has(s))throw Error("useResizeObserver attemping to observe same element twice");l()}return()=>{s&&Oe.has(s)&&(Yr.unobserve(s),Oe.delete(s),a=!0)}},[e,i]),(0,He.useLayoutEffect)(()=>{let s=e.current,a=Oe.get(s);if(a){if(r.current!==t){r.current=t;let l=i(s);a.measurements=l}a.onResize=o}},[t,i,e,o])}function va(e,t){let o=document.body.querySelector(`.${e}`),n={get:function(r,i){let s=r.getPropertyValue(`--${e}-breakpoint-${i}`);return s?parseInt(s):void 0}};return o?new Proxy(getComputedStyle(o),n):t!=null?t:{}}var La=([,e],[,t])=>t-e,Xo=e=>Object.entries(e).sort(La).map(([t,o],n,r)=>[t,o,n<r.length-1?r[n+1][1]:9999]),Uo=null,Ma=(e="salt")=>{let{xs:t,sm:o,md:n,lg:r,xl:i}=va(e);return Xo({xs:t,sm:o,md:n,lg:r,xl:i})},qr=e=>(Uo===null&&(Uo=Ma(e)),Uo);var Ca=[],Yo=({breakPoints:e,smallerThan:t},o)=>{let[n,r]=(0,ne.useState)(t?!1:"lg"),i=(0,ne.useRef)(document.body),s=(0,ne.useRef)(e?Xo(e):qr()),a=(0,ne.useRef)("lg"),l=(0,ne.useCallback)(p=>{if(s.current){for(let[m,u]of s.current)if(p>=u)return m}},[s]),c=(0,ne.useCallback)(p=>{if(t){let m=s.current.find(([u])=>u===t);if(m){let[,,u]=m;return p<u}}else return l(p);return p},[t,l]);return Go(o||i,s.current?["width"]:Ca,({width:p})=>{let m=c(p);m!==a.current&&(a.current=m,r(m))},!0),(0,ne.useEffect)(()=>{let p=o||i;if(p.current){let m=a.current;if(s.current){let{clientWidth:u}=p.current,f=c(u);a.current=f,f!==m&&r(f)}}},[r,c,o]),n};var Jr="data-collapsible",Aa={[Jr]:!0,"data-pad-start":!0,"data-pad-end":!0},Kr=e=>{var t;return(t=Aa[e])!=null?t:!1},ka=e=>e===Jr,za={dynamic:"dynamic",instant:"instant",true:"instant"},Ia=e=>{var t;return(t=za[e])!=null?t:"none"},Ba=e=>Object.keys(e).reduce((t,o)=>{let[n,r]=t;if(Kr(o)){let i=ka(o)?Ia(e[o]):e[o];n[o]=i,r[o]=void 0}return t},[{},{}]);var jr=require("@vuu-ui/vuu-utils"),Z=require("react");var Oa=["xs","sm","md","lg","xl"],Ha=12,Qr=({children:e,cols:t,style:o})=>{let n=(0,Z.useRef)(null),r=(0,Z.useRef)(null),i=(0,Z.useRef)(),s=t!=null?t:Ha,l=(o==null?void 0:o.flexDirection)==="column"?"height":"width",c=(0,Z.useMemo)(()=>Array.isArray(e)?e:(0,Z.isValidElement)(e)?[e]:[],[e]),p=(0,Z.useCallback)((m,u)=>{let f=Ot(m,u,Oa),h=[],g=[];for(let y=0;y<m.length;y++){let d=m[y],{style:{flex:b,...E}}=d.props;h.push((0,Z.cloneElement)(d,{key:(0,jr.getUniqueId)(),style:{...E,"--parent-col-count":s}})),g.push(f[y])}return[h,g]},[s]);return(0,Z.useMemo)(()=>{let[m,u]=p(c,l);r.current=u,i.current=m},[p,c,l]),{cols:s,content:i.current,rootRef:n}};var ni=require("react/jsx-runtime"),Vt="hwFluidGrid",Wt=(0,oi.forwardRef)(function(t,o){let{breakPoints:n,children:r,column:i,cols:s=12,className:a,flexFill:l,gap:c=3,fullPage:p,id:m,onSplitterMoved:u,resizeable:f,row:h,showGrid:g,spacing:y,splitterSize:d,style:b,...E}=t,{cols:R,content:S,rootRef:x}=Qr({children:r,cols:s,style:b}),T=Yo({breakPoints:n},x),L=(0,ti.default)(Vt,a,{[`${Vt}-column`]:i,[`${Vt}-row`]:h,[`${Vt}-show-grid`]:g,"flex-fill":l,"full-page":p}),A={...b,"--spacing":y,"--grid-col-count":R,"--grid-gap":c};return(0,ni.jsx)("div",{...E,className:L,"data-breakpoint":T,"data-cols":R,"data-resizeable":f||void 0,id:m,ref:(0,ei.useForkRef)(x,o),style:A,children:S})});Wt.displayName="FluidGrid";var ri=require("react/jsx-runtime"),Zo=function(t){return(0,ri.jsx)(Wt,{...t})};Zo.displayName="FluidGrid";B("FluidGrid",Zo,"container");var ci=v(require("classnames")),$e=v(require("react"));var Me=require("react");var dt=(e,t,o,n)=>{var y;let{loadSessionState:r,purgeSessionState:i,purgeState:s,saveSessionState:a}=Be(),[l,c]=(0,Me.useState)((y=r(e,"contributions"))!=null?y:[]),p=Y(),m=(0,Me.useCallback)((d,b)=>{let E=l.concat([{location:d,content:b}]);a(e,"contributions",E),c(E)},[l,e,a]),u=(0,Me.useCallback)(()=>{i(e,"contributions"),c([])},[e,i]),f=(0,Me.useCallback)(()=>{let d=r(e,"data-source");d&&d.unsubscribe(),i(e),s(e),p({type:"remove",path:o})},[p,e,r,i,s,o]),h=(0,Me.useCallback)(async(d,b,E)=>{var S;d.stopPropagation();let R=(S=t.current)==null?void 0:S.getBoundingClientRect();return new Promise((x,T)=>{p({type:"drag-start",evt:d,path:b===void 0?o:`${o}.${b}`,dragRect:R,preDragActivity:E,dropTargets:n,resolveDragStart:x,rejectDragStart:T})})},[t,p,o,n]);return[(0,Me.useCallback)(async(d,b)=>{var R;let{type:E}=d;switch(E){case"maximize":case"minimize":case"restore":return p({type:E,path:(R=d.path)!=null?R:o});case"remove":return f();case"mousedown":return console.log("2) ViewActionDispatch Hook dispatch Action mousedown"),h(b,d.index,d.preDragActivity);case"add-toolbar-contribution":return m(d.location,d.content);case"remove-toolbar-contribution":return u();default:return}},[p,o,f,h,m,u]),l]};var Gt=require("@salt-ds/core"),ai=v(require("classnames")),ie=v(require("react"));var re=require("react");var ii=({id:e,rootRef:t,path:o,dropTargets:n,title:r})=>{let i=Y(),{loadState:s,loadSessionState:a,purgeState:l,saveState:c,saveSessionState:p}=Be(),[m,u]=dt(e,t,o,n),f=(0,re.useMemo)(()=>{var x;return(x=s("view-title"))!=null?x:r},[s,r]),h=(0,re.useCallback)(x=>{o&&i({type:"set-title",path:o,title:x})},[i,o]),g=(0,re.useMemo)(()=>s(e),[e,s]),y=(0,re.useCallback)(x=>s(e,x),[e,s]),d=(0,re.useCallback)(x=>{l(e,x),i({type:"save"})},[e,i,l]),b=(0,re.useCallback)((x,T)=>{c(e,T,x),i({type:"save"})},[e,i,c]),E=(0,re.useCallback)(x=>a(e,x),[e,a]),R=(0,re.useCallback)((x,T)=>p(e,T,x),[e,p]),S=(0,re.useCallback)(({type:x,...T})=>{let{[x]:L}=T;b(L,x)},[b]);return{contributions:u,dispatchViewAction:m,load:y,loadSession:E,onConfigChange:S,onEditTitle:h,purge:d,restoredState:g,save:b,saveSession:R,title:f}};var _t=require("@heswell/salt-lab"),Ze=require("react"),$a=[],si=({mainRef:e,resize:t="responsive",rootRef:o})=>{let n=t==="defer",r=(0,Ze.useRef)({}),i=(0,Ze.useRef)(),s=(0,Ze.useCallback)(()=>{e.current&&(e.current.style.height=r.current.height+"px",e.current.style.width=r.current.width+"px"),i.current=void 0},[e]),a=(0,Ze.useCallback)(({height:l,width:c})=>{r.current.height=l,r.current.width=c,i.current!==null&&clearTimeout(i.current),i.current=window.setTimeout(s,40)},[s]);(0,_t.useResizeObserver)(o,n?_t.WidthHeight:$a,a,n)};var ft=v(require("react")),Na={dispatch:null},ht=ft.default.createContext(Na),qo=()=>{var t;let e=(0,ft.useContext)(ht);return(t=e==null?void 0:e.dispatch)!=null?t:null},Fa=()=>(0,ft.useContext)(ht);var qe=require("react/jsx-runtime"),li=(0,ie.forwardRef)(function(t,o){let{children:n,className:r,collapsed:i,closeable:s,"data-resizeable":a,dropTargets:l,expanded:c,flexFill:p,id:m,header:u,orientation:f="horizontal",path:h,resize:g="responsive",resizeable:y=a,tearOut:d,style:b={},title:E,...R}=t,S=(0,Gt.useIdMemo)(m),x=(0,ie.useRef)(null),T=(0,ie.useRef)(null),{contributions:L,dispatchViewAction:A,load:N,loadSession:M,onConfigChange:H,onEditTitle:C,purge:k,restoredState:I,save:Q,saveSession:X,title:Ve}=ii({id:S,rootRef:x,path:h,dropTargets:l,title:E});si({mainRef:T,resize:g,rootRef:x});let Ke="vuuView",Pi=()=>ie.default.isValidElement(n)&&I?ie.default.cloneElement(n,I):n,vi=(0,ie.useMemo)(()=>({dispatch:A,id:S,path:h,title:Ve,load:N,loadSession:M,onConfigChange:H,purge:k,save:Q,saveSession:X}),[A,S,N,M,H,h,k,Q,X,Ve]),Li=typeof u=="object"?u:{};return(0,qe.jsx)("div",{...R,className:(0,ai.default)(Ke,r,{[`${Ke}-collapsed`]:i,[`${Ke}-expanded`]:c,[`${Ke}-resize-defer`]:g==="defer"}),"data-resizeable":y,id:S,ref:(0,Gt.useForkRef)(o,x),style:b,tabIndex:-1,children:(0,qe.jsxs)(ht.Provider,{value:vi,children:[u?(0,qe.jsx)(Jo,{...Li,collapsed:i,contributions:L,expanded:c,closeable:s,onEditTitle:C,orientation:f,tearOut:d,title:Ve}):null,(0,qe.jsx)("div",{className:`${Ke}-main`,ref:T,children:Pi()})]})})});li.displayName="View";var he=ie.default.memo(li);he.displayName="View";B("View",he,"view");var se=require("@heswell/salt-lab"),pi=require("@salt-ds/icons");var ge=require("react/jsx-runtime"),Jo=({className:e,contributions:t,collapsed:o,closeable:n,onEditTitle:r,orientation:i="horizontal",style:s,title:a="Untitled"})=>{let l=(0,$e.useRef)(null),[c,p]=(0,$e.useState)(a),[m,u]=(0,$e.useState)(!1),f=qo(),h=M=>f==null?void 0:f({type:"remove"},M),g="vuuHeader",y=()=>{var M;(M=l.current)==null||M.focus()},d=M=>{M.stopPropagation()},E=(0,ci.default)(g,e,`${g}-${o||i}`),R=()=>{u(!0)},S=M=>{M.key==="Enter"&&u(!0)},x=(M="",H="",C=!0,k=!1)=>{var I;u(!1),k?p(M):H!==M&&(p(H),r==null||r(H)),C===!1&&((I=l.current)==null||I.focus())},T=M=>{f==null||f({type:"mousedown"},M)},L=[],A=[],N=[];return a&&L.push((0,ge.jsx)(se.ToolbarField,{className:"vuuHeader-title",children:(0,ge.jsx)(se.EditableLabel,{editing:m,value:c,onChange:p,onMouseDownCapture:y,onEnterEditMode:R,onExitEditMode:x,onKeyDown:S,ref:l,tabIndex:0},"title")},"title")),t==null||t.forEach((M,H)=>{A.push($e.default.cloneElement(M.content,{key:H}))}),n&&N.push((0,ge.jsxs)(se.ToolbarButton,{onClick:h,onMouseDown:d,children:[(0,ge.jsx)(pi.CloseIcon,{})," Close"]},"close")),A.length>0&&L.push((0,ge.jsx)(se.Tooltray,{"data-align-end":!0,children:A},"contributions")),N.length>0&&L.push((0,ge.jsx)(se.Tooltray,{"data-align-end":!0,children:N},"actions")),(0,ge.jsx)(se.Toolbar,{className:E,orientation:i,style:s,onMouseDown:T,children:L})};var ui=require("@vuu-ui/vuu-utils"),Xt=require("@heswell/salt-lab"),Ko=v(require("classnames")),Yt=require("react");var Ut=require("react/jsx-runtime"),Va=e=>{let t=e.cloneNode(!0);return t.id="",delete t.dataset.idx,t},jo=(0,Yt.memo)(({className:e,children:t,idx:o,resizeable:n,header:r,closeable:i,...s})=>(0,Ut.jsx)(Xt.ListItem,{className:(0,Ko.default)("vuuPaletteItem",e),"data-draggable":!0,...s}));jo.displayName="PaletteItem";var mi=({children:e,className:t,orientation:o="horizontal",...n})=>{let r=Y(),i="vuuPalette";function s(a){var x;let c=a.target.closest(".vuuPaletteItem"),p=parseInt((x=c.dataset.idx)!=null?x:"-1");p!==-1&&console.log({children:e,idx:p,listItemElement:c});let{props:{caption:m,children:u,template:f,...h}}=e[p],{height:g,left:y,top:d,width:b}=c.getBoundingClientRect(),E=(0,ui.uuid)(),S=f?u:(0,Ut.jsx)(he,{...{id:E,key:E},...h,title:h.label,children:u});r({dragRect:{left:y,top:d,right:y+b,bottom:d+150,width:b,height:g},dragElement:Va(c),evt:a.nativeEvent,instructions:{DoNotRemove:!0,DoNotTransform:!0,RemoveDraggableOnDragEnd:!0,dragThreshold:10},path:"*",payload:S,type:"drag-start"})}return(0,Ut.jsx)(Xt.List,{...n,borderless:!0,className:(0,Ko.default)(i,t,`${i}-${o}`),maxHeight:800,selected:null,children:e.map((a,l)=>a.type===jo?(0,Yt.cloneElement)(a,{key:l,onMouseDown:s}):a)})};B("Palette",mi,"view");var di=require("@vuu-ui/vuu-utils"),qt=require("@heswell/salt-lab"),fi=v(require("classnames"));var Zt=require("react/jsx-runtime"),Wa="vuuPalette",_a=e=>{let{children:t,ViewProps:o,label:n,onMouseDown:r,template:i,...s}=e,a=Y();return(0,Zt.jsx)(qt.ListItem,{onMouseDown:c=>{let{left:p,top:m,width:u}=c.currentTarget.getBoundingClientRect(),f=(0,di.uuid)(),g=i?t:(0,Zt.jsx)(he,{...{id:f,key:f},...o,title:e.label,children:t});a({type:"drag-start",evt:c.nativeEvent,path:"*",payload:g,instructions:{DoNotRemove:!0,DoNotTransform:!0,RemoveDraggableOnDragEnd:!0,dragThreshold:10},dragRect:{left:p,top:m,right:p+u,bottom:m+150,width:u,height:100}})},...s,children:n})},hi=({className:e,...t})=>(0,Zt.jsx)(qt.List,{...t,className:(0,fi.default)(Wa,e),height:"100%",selectionStrategy:"none"});B("PaletteSalt",hi,"view");var Ce=require("@heswell/salt-lab"),yi=require("@salt-ds/core"),bi=v(require("classnames")),ye=v(require("react"));var Ne=require("react/jsx-runtime"),gi="Tabs",Ga=()=>{},Ua=(e,t)=>{var o,n;return(n=(o=e.props)==null?void 0:o.title)!=null?n:`Tab ${t+1}`},Xa=e=>{let t=[];return ye.default.Children.forEach(e,o=>{ye.default.isValidElement(o)?t.push(o):console.warn("Stack has unexpected child element type")}),t},Jt=(0,ye.forwardRef)(function({active:t=0,children:o,className:n,enableAddTab:r,enableCloseTabs:i,getTabIcon:s=Ga,getTabLabel:a=Ua,id:l,keyBoardActivation:c="manual",onMouseDown:p,onTabAdd:m,onTabClose:u,onTabEdit:f,onTabSelectionChanged:h,showTabs:g,style:y,TabstripProps:d},b){var H;let E=(0,yi.useIdMemo)(l),R=C=>{h==null||h(C)},S=C=>{u==null||u(C)},x=()=>{m==null||m(ye.default.Children.count(o))},T=C=>{var X;let I=C.target.closest('[role^="tab"]');if((I==null?void 0:I.getAttribute("role"))==="tab"){let Ve=parseInt((X=I.dataset.idx)!=null?X:"-1");if(Ve===-1)throw Error("Stack: mousedown on tab with unknown index");p==null||p(C,Ve)}},L=(0,ye.useCallback)((C,k,I,Q)=>{f==null||f(Q,k)},[f]),A=()=>{var C;return ye.default.isValidElement(o)?o:Array.isArray(o)&&(C=o[t])!=null?C:null},N=()=>Xa(o).map((C,k)=>{let I=`${E}-${k}`,{closeable:Q,id:X}=C.props;return(0,Ne.jsx)(Ce.Tab,{ariaControls:`${I}-tab`,"data-icon":s(C,k),draggable:!0,id:I,label:a(C,k),closeable:Q,editable:(d==null?void 0:d.enableRenameTab)!==!1},X!=null?X:k)}),M=A();return(0,Ne.jsxs)("div",{className:(0,bi.default)(gi,n,{[`${gi}-horizontal`]:(d==null?void 0:d.orientation)==="vertical"}),style:y,id:E,ref:b,children:[g?(0,Ne.jsx)(Ce.Toolbar,{className:"vuuTabHeader vuuHeader",orientation:d==null?void 0:d.orientation,children:(0,Ne.jsx)(Ce.ToolbarField,{disableFocusRing:!0,"data-collapsible":"dynamic","data-priority":"3",style:{alignSelf:"flex-end"},children:(0,Ne.jsx)(Ce.Tabstrip,{...d,enableRenameTab:(d==null?void 0:d.enableRenameTab)!==!1,enableAddTab:r,enableCloseTab:i,keyBoardActivation:c,onActiveChange:R,onAddTab:x,onCloseTab:S,onExitEditMode:L,onMouseDown:T,activeTabIndex:(H=d==null?void 0:d.activeTabIndex)!=null?H:M===null?-1:t,children:N()})})}):null,M]})});Jt.displayName="Stack";var xi=require("@salt-ds/core"),jt=v(require("react"));var Kt=require("react/jsx-runtime"),Ya=e=>(0,Kt.jsx)(he,{resizeable:!0,title:`Tab ${e}`,style:{flexGrow:1,flexShrink:0,flexBasis:0},header:!0,closeable:!0,children:(0,Kt.jsx)(Rt,{style:{flex:1}})}),Qo=e=>{let t=(0,jt.useRef)(null),o=Y(),{loadState:n}=Be(),{createNewChild:r=Ya,id:i,onTabSelectionChanged:s,path:a,...l}=e,{children:c}=e,p=(0,xi.useIdMemo)(i),[m]=dt(p,t,a);return(0,Kt.jsx)(Jt,{...l,id:p,getTabLabel:(b,E)=>{let{id:R,title:S}=b.props;return n(R,"view-title")||S||`Tab ${E+1}`},onMouseDown:async(b,E)=>{let R;await m({type:"mousedown",index:E,preDragActivity:async()=>new Promise(T=>{console.log("preDragActivity: Ok, gonna release the drag"),R=T})},b)&&(R==null||R(void 0))},onTabAdd:(b,E=jt.default.Children.count(c))=>{if(a){console.log("[StackLayout] handleTabAdd");let R=r(E);console.log({component:R}),o({type:"add",path:a,component:R})}},onTabClose:b=>{if(Array.isArray(c)){let{props:{"data-path":E,path:R=E}}=c[b];o({type:"remove",path:R})}},onTabEdit:(b,E)=>{o({type:"set-title",path:`${a}.${b}`,title:E})},onTabSelectionChanged:b=>{console.log(`StackLayout handleTabSelection nextTab = ${b}`),a&&(o({type:"switch-tab",path:a,nextIdx:b}),s==null||s(b))},ref:t})};Qo.displayName="Stack";B("Stack",Qo,"container");var Je=v(require("react"));var Fe=require("react/jsx-runtime"),Za=({children:e})=>{let[o,n]=(0,Je.useState)(e),[r,i]=(0,Je.useState)(e),s=l=>{let c=ao(o,l);i(c)},a=(l,c)=>{console.log(`change ${l} -> ${c}`);let p=Je.default.cloneElement(r,{style:{...r.props.style,[l]:c}});i(p),n(Je.default.cloneElement(o,{},p))};return(0,Fe.jsxs)("div",{"data-design-mode":`${!1}`,children:[o,(0,Fe.jsx)("br",{}),(0,Fe.jsxs)("div",{style:{display:"flex"},children:[(0,Fe.jsx)(en,{height:300,managedStyle:r.props.style,width:300,onChange:a,style:void 0}),(0,Fe.jsx)(tn,{layout:o,onSelect:s,style:{width:300,height:300,backgroundColor:"#ccc"}})]})]})};var pe=require("@heswell/salt-lab"),z=require("react/jsx-runtime"),nn={},qa={margin:{top:"marginTop",right:"marginRight",bottom:"marginBottom",left:"marginLeft"},border:{top:"borderTopWidth",right:"borderRightWidth",bottom:"borderBottomWidth",left:"borderLeftWidth"},padding:{top:"paddingTop",right:"paddingRight",bottom:"paddingBottom",left:"paddingLeft"}},on=({feature:e,children:t,style:o,onChange:n})=>(0,z.jsxs)("div",{className:`LayoutBox layout-${e} layout-outer`,children:[(0,z.jsxs)("div",{className:"layout-top",children:[(0,z.jsx)("span",{className:"layout-title",children:e}),(0,z.jsx)(pe.FormField,{className:"layout-input",style:{width:30},children:(0,z.jsx)(pe.Input,{value:o.top,onChange:(r,i)=>n(e,"top",i)})})]}),(0,z.jsxs)("div",{className:"layout-inner",children:[(0,z.jsx)("div",{className:"layout-left",children:(0,z.jsx)(pe.FormField,{className:"layout-input",style:{width:30},children:(0,z.jsx)(pe.Input,{value:o.left,onChange:(r,i)=>n(e,"left",i)})})}),t,(0,z.jsx)("div",{className:"layout-right",children:(0,z.jsx)(pe.FormField,{className:"layout-input",style:{width:30},children:(0,z.jsx)(pe.Input,{value:o.right,onChange:(r,i)=>n(e,"right",i)})})})]}),(0,z.jsx)("div",{className:"layout-bottom",children:(0,z.jsx)(pe.FormField,{className:"layout-input",style:{width:30},children:(0,z.jsx)(pe.Input,{value:o.bottom,onChange:(r,i)=>n(e,"bottom",i)})})})]}),Ja={margin:!0,marginTop:!0,marginRight:!0,marginBottom:!0,marginLeft:!0},Ka={padding:!0,paddingTop:!0,paddingRight:!0,paddingBottom:!0,paddingLeft:!0},ja={border:!0,borderColor:!0,borderWidth:!0,borderTopWidth:!0,borderRightWidth:!0,borderBottomWidth:!0,borderLeftWidth:!0},Qt="(\\d+)(?:px)?",Qa=`^(?:${Qt}(?:\\s${Qt}(?:\\s${Qt}(?:\\s${Qt})?)?)?)$`,Ri=new RegExp(Qa),el=/^(?:(\d+)(?:px)\ssolid\s([a-zA-Z,0-9().]+))$/,en=({height:e,managedStyle:t,onChange:o,style:n,width:r})=>{let i=Ei(t),s=(E,R,S)=>{let x=parseInt(S||"0",10),T=qa[E][R];o(T,x)},{marginTop:a=0,marginRight:l=0,marginBottom:c=0,marginLeft:p=0}=i,{borderTopWidth:m=0,borderRightWidth:u=0,borderBottomWidth:f=0,borderLeftWidth:h=0}=i,{paddingTop:g=0,paddingRight:y=0,paddingBottom:d=0,paddingLeft:b=0}=i;return(0,z.jsx)("div",{className:"LayoutConfigurator",style:{width:r,height:e,...n},children:(0,z.jsx)(on,{feature:"margin",style:{top:a,right:l,bottom:c,left:p},onChange:s,children:(0,z.jsx)(on,{feature:"border",style:{top:m,right:u,bottom:f,left:h},onChange:s,children:(0,z.jsx)(on,{feature:"padding",style:{top:g,right:y,bottom:d,left:b},onChange:s,children:(0,z.jsx)("div",{className:"layout-content"})})})})})};function tl(e=nn,t=nn){let{margin:o,marginTop:n,marginRight:r,marginBottom:i,marginLeft:s,padding:a,paddingTop:l,paddingRight:c,paddingBottom:p,paddingLeft:m,...u}=e;if(typeof o=="number")u.marginTop=u.marginRight=u.marginBottom=u.marginLeft=o;else if(typeof o=="string"){let f=Ri.exec(o);if(f===null)console.error(`Invalid css value for margin '${o}'`);else{let[,h,g,y,d]=f,b=h&&g&&y;b&&d?(u.marginTop=parseInt(h,10),u.marginRight=parseInt(g,10),u.marginBottom=parseInt(y,10),u.marginLeft=parseInt(d,10)):b?(u.marginTop=parseInt(h,10),u.marginRight=u.marginLeft=parseInt(g,10),u.marginBottom=parseInt(y,10)):h&&g?(u.marginTop=u.marginBottom=parseInt(h,10),u.marginRight=u.marginLeft=parseInt(g,10)):u.marginTop=u.marginRight=u.marginBottom=u.marginLeft=parseInt(h,10)}}if(typeof n=="number"&&(u.marginTop=n),typeof r=="number"&&(u.marginRight=r),typeof i=="number"&&(u.marginBottom=i),typeof s=="number"&&(u.marginLeft=s),typeof a=="number")u.paddingTop=u.paddingRight=u.paddingBottom=u.paddingLeft=a;else if(typeof a=="string"){let f=Ri.exec(a);if(f===null)console.error(`Invalid css value for padding '${a}'`);else{let[,h,g,y,d]=f,b=h&&g&&y;b&&d?(u.paddingTop=parseInt(h,10),u.paddingRight=parseInt(g,10),u.paddingBottom=parseInt(y,10),u.paddingLeft=parseInt(d,10)):b?(u.paddingTop=parseInt(h,10),u.paddingRight=u.paddingLeft=parseInt(g,10),u.paddingBottom=parseInt(y,10)):h&&g?(u.paddingTop=u.paddingBottom=parseInt(h,10),u.paddingRight=u.paddingLeft=parseInt(g,10)):u.paddingTop=u.paddingRight=u.paddingBottom=u.paddinggLeft=parseInt(h,10)}}return typeof l=="number"&&(u.paddingTop=l),typeof c=="number"&&(u.paddingRight=c),typeof p=="number"&&(u.paddingBottom=p),typeof m=="number"&&(u.paddingLeft=m),Ei(u,t)}function Ei(e=nn){let t={...e},o,{border:n,borderWidth:r,borderTopWidth:i,borderRightWidth:s,borderBottomWidth:a,borderLeftWidth:l,borderColor:c,margin:p,marginTop:m,marginRight:u,marginBottom:f,marginLeft:h,padding:g,paddingTop:y,paddingRight:d,paddingBottom:b,paddingLeft:E,...R}=t,S={},x={};if(typeof p=="number"&&(t.marginTop=t.marginRight=t.marginBottom=t.marginLeft=p,S={marginTop:p,marginRight:p,marginBottom:p,marginLeft:p}),typeof g=="number"&&(t.paddingTop=t.paddingRight=t.paddingBottom=t.paddingLeft=g,x={paddingTop:g,paddingRight:g,paddingBottom:g,paddingLeft:g}),n||r||i||s||a||l){typeof n=="string"&&(o=el.exec(n))&&([,r,c]=o,r=parseInt(r,10)),r&&(i=i===void 0?r:i,s=s===void 0?r:s,a=a===void 0?r:a,l=l===void 0?r:l),c=c||"black";let T=`
|
|
18
|
+
${c} ${l||0}px ${i||0}px 0 0 inset,
|
|
19
|
+
${c} ${-s||0}px ${-a||0}px 0 0 inset`;return{...R,...S,...x,borderTopWidth:i,borderRightWidth:s,borderBottomWidth:a,borderLeftWidth:l,borderColor:c,borderStyle:"solid",boxShadow:T}}else return t}var Si=v(require("react")),Ti=v(require("classnames"));var Di=require("@heswell/salt-lab"),rn=require("react/jsx-runtime"),ol="hwLayoutTreeViewer",wi=(e,t="0")=>({label:P(e),path:t,childNodes:Si.default.Children.map(e.props.children,(o,n)=>wi(o,t?`${t}.${n}`:`${n}`))}),tn=({layout:e,onSelect:t,style:o})=>{let n=[wi(e)],r=(i,[{path:s}])=>{t(s)};return(0,rn.jsx)("div",{className:(0,Ti.default)(ol),style:o,children:(0,rn.jsx)(Di.Tree,{source:n,groupSelection:"single",onSelectionChange:r})})};
|
|
20
|
+
//# sourceMappingURL=index.js.map
|