@vuu-ui/vuu-layout 0.5.15 → 0.5.17
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 +16 -10
- package/types/Component.d.ts +7 -0
- package/types/DraggableLayout.d.ts +6 -0
- package/types/chest-of-drawers/Chest.d.ts +10 -0
- package/types/chest-of-drawers/Drawer.d.ts +18 -0
- package/{src/chest-of-drawers/index.ts → types/chest-of-drawers/index.d.ts} +0 -0
- package/types/common-types.d.ts +8 -0
- package/types/debug.d.ts +2 -0
- package/types/drag-drop/BoxModel.d.ts +143 -0
- package/types/drag-drop/DragState.d.ts +46 -0
- package/types/drag-drop/Draggable.d.ts +23 -0
- package/types/drag-drop/DropMenu.d.ts +10 -0
- package/types/drag-drop/DropTarget.d.ts +61 -0
- package/types/drag-drop/DropTargetRenderer.d.ts +18 -0
- package/types/drag-drop/dragDropTypes.d.ts +51 -0
- package/{src/drag-drop/index.ts → types/drag-drop/index.d.ts} +0 -1
- package/types/editable-label/EditableLabel.d.ts +9 -0
- package/{src/editable-label/index.ts → types/editable-label/index.d.ts} +0 -0
- package/types/flexbox/Flexbox.d.ts +5 -0
- package/types/flexbox/FlexboxLayout.d.ts +6 -0
- package/types/flexbox/FluidGrid.d.ts +7 -0
- package/types/flexbox/FluidGridLayout.d.ts +6 -0
- package/types/flexbox/Splitter.d.ts +13 -0
- package/types/flexbox/flexbox-utils.d.ts +12 -0
- package/types/flexbox/flexboxTypes.d.ts +51 -0
- package/{src/flexbox/index.ts → types/flexbox/index.d.ts} +0 -1
- package/types/flexbox/useResponsiveSizing.d.ts +10 -0
- package/types/flexbox/useSplitterResizing.d.ts +2 -0
- package/{src/index.ts → types/index.d.ts} +0 -1
- package/types/layout-action.d.ts +21 -0
- package/types/layout-header/ActionButton.d.ts +8 -0
- package/types/layout-header/Header.d.ts +13 -0
- package/{src/layout-header/index.ts → types/layout-header/index.d.ts} +0 -0
- package/types/layout-provider/LayoutProvider.d.ts +14 -0
- package/types/layout-provider/LayoutProviderContext.d.ts +8 -0
- package/{src/layout-provider/index.ts → types/layout-provider/index.d.ts} +0 -1
- package/types/layout-provider/useLayoutDragDrop.d.ts +4 -0
- package/types/layout-reducer/flexUtils.d.ts +22 -0
- package/{src/layout-reducer/index.ts → types/layout-reducer/index.d.ts} +0 -1
- package/types/layout-reducer/insert-layout-element.d.ts +8 -0
- package/types/layout-reducer/layout-reducer.d.ts +3 -0
- package/types/layout-reducer/layoutTypes.d.ts +130 -0
- package/types/layout-reducer/layoutUtils.d.ts +28 -0
- package/types/layout-reducer/remove-layout-element.d.ts +3 -0
- package/types/layout-reducer/replace-layout-element.d.ts +6 -0
- package/types/layout-reducer/resize-flex-children.d.ts +3 -0
- package/types/layout-reducer/wrap-layout-element.d.ts +9 -0
- package/types/layout-view/View.d.ts +5 -0
- package/types/layout-view/ViewContext.d.ts +18 -0
- package/{src/layout-view/index.ts → types/layout-view/index.d.ts} +0 -1
- package/types/layout-view/useView.d.ts +21 -0
- package/types/layout-view/useViewActionDispatcher.d.ts +8 -0
- package/types/layout-view/useViewResize.d.ts +7 -0
- package/types/layout-view/viewTypes.d.ts +18 -0
- package/types/palette/Palette.d.ts +18 -0
- package/types/palette/PaletteSalt.d.ts +14 -0
- package/{src/palette/index.ts → types/palette/index.d.ts} +0 -1
- package/types/placeholder/Placeholder.d.ts +12 -0
- package/{src/placeholder/index.ts → types/placeholder/index.d.ts} +0 -0
- package/types/registry/ComponentRegistry.d.ts +14 -0
- package/{src/registry/index.ts → types/registry/index.d.ts} +0 -0
- package/types/responsive/breakpoints.d.ts +4 -0
- package/{src/responsive/index.ts → types/responsive/index.d.ts} +0 -0
- package/types/responsive/measureMinimumNodeSize.d.ts +1 -0
- package/types/responsive/overflowUtils.d.ts +2 -0
- package/types/responsive/use-breakpoints.d.ts +7 -0
- package/types/responsive/useResizeObserver.d.ts +12 -0
- package/types/responsive/utils.d.ts +6 -0
- package/types/stack/Stack.d.ts +4 -0
- package/types/stack/StackLayout.d.ts +7 -0
- package/{src/stack/index.ts → types/stack/index.d.ts} +0 -1
- package/types/stack/stackTypes.d.ts +20 -0
- package/types/tabs/TabPanel.d.ts +7 -0
- package/{src/tabs/index.ts → types/tabs/index.d.ts} +0 -0
- package/types/tools/config-wrapper/ConfigWrapper.d.ts +2 -0
- package/{src/tools/config-wrapper/index.ts → types/tools/config-wrapper/index.d.ts} +0 -0
- package/types/tools/devtools-box/layout-configurator.d.ts +31 -0
- package/types/tools/devtools-tree/layout-tree-viewer.d.ts +5 -0
- package/{src/tools/index.ts → types/tools/index.d.ts} +0 -1
- package/types/use-persistent-state.d.ts +11 -0
- package/{src/utils/index.ts → types/utils/index.d.ts} +0 -0
- package/types/utils/pathUtils.d.ts +18 -0
- package/types/utils/propUtils.d.ts +5 -0
- package/types/utils/refUtils.d.ts +2 -0
- package/types/utils/styleUtils.d.ts +3 -0
- package/types/utils/typeOf.d.ts +4 -0
- 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/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/editable-label/EditableLabel.css +0 -28
- package/src/editable-label/EditableLabel.tsx +0 -99
- 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/useResponsiveSizing.ts +0 -82
- package/src/flexbox/useSplitterResizing.ts +0 -270
- 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-provider/LayoutProvider.tsx +0 -161
- package/src/layout-provider/LayoutProviderContext.ts +0 -17
- package/src/layout-provider/useLayoutDragDrop.ts +0 -210
- package/src/layout-reducer/flexUtils.ts +0 -276
- 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/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/placeholder/Placeholder.css +0 -10
- package/src/placeholder/Placeholder.tsx +0 -38
- package/src/registry/ComponentRegistry.ts +0 -44
- package/src/responsive/breakpoints.ts +0 -62
- 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/stackTypes.ts +0 -22
- package/src/tabs/TabPanel.css +0 -12
- package/src/tabs/TabPanel.tsx +0 -17
- package/src/tools/config-wrapper/ConfigWrapper.tsx +0 -55
- 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/use-persistent-state.ts +0 -112
- 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 si=Object.create;var ct=Object.defineProperty;var ai=Object.getOwnPropertyDescriptor;var li=Object.getOwnPropertyNames;var ci=Object.getPrototypeOf,pi=Object.prototype.hasOwnProperty;var ui=(e,t)=>{for(var o in t)ct(e,o,{get:t[o],enumerable:!0})},Jo=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of li(t))!pi.call(e,r)&&r!==o&&ct(e,r,{get:()=>t[r],enumerable:!(n=ai(t,r))||n.enumerable});return e};var M=(e,t,o)=>(o=e!=null?si(ci(e)):{},Jo(t||!e||!e.__esModule?ct(o,"default",{value:e,enumerable:!0}):o,e)),mi=e=>Jo(ct({},"__esModule",{value:!0}),e);var va={};ui(va,{Action:()=>Me,BORDER_STYLES:()=>Sa,Chest:()=>nn,Component:()=>mt,ComponentRegistry:()=>pe,ConfigWrapper:()=>ba,Draggable:()=>Pt,DraggableLayout:()=>po,Drawer:()=>pt,DropMenu:()=>so,DropTarget:()=>ue,Flexbox:()=>Mt,FlexboxLayout:()=>Io,FluidGrid:()=>kt,FluidGridLayout:()=>$o,Header:()=>No,HeightOnly:()=>Js,LayoutConfigurator:()=>Go,LayoutProvider:()=>Zs,LayoutProviderContext:()=>Ve,LayoutProviderVersion:()=>Xs,LayoutTreeViewer:()=>Uo,MARGIN_STYLES:()=>Ra,PADDING_STYLES:()=>Ea,Palette:()=>_r,PaletteItem:()=>Wo,PaletteListItem:()=>da,PaletteSalt:()=>Xr,Placeholder:()=>qe,Stack:()=>Wt,StackLayout:()=>_o,View:()=>fe,ViewContext:()=>lt,WidthHeight:()=>Ys,WidthOnly:()=>js,XXXnormalizeStyles:()=>wa,computeMenuPosition:()=>io,containerOf:()=>an,expandFlex:()=>ht,extractResponsiveProps:()=>ia,findTarget:()=>ae,followPath:()=>V,followPathToComponent:()=>qt,followPathToParent:()=>se,getChild:()=>ln,getChildProp:()=>Kt,getPersistentState:()=>Ro,getProp:()=>w,getProps:()=>T,hasPersistentState:()=>Eo,identifyDropTarget:()=>bt,isContainer:()=>N,isLayoutComponent:()=>Zt,isRegistered:()=>fi,isResponsiveAttribute:()=>Lr,isTabstrip:()=>Ai,isTypeOf:()=>bi,isView:()=>tn,nextLeaf:()=>Ri,nextStep:()=>J,previousLeaf:()=>Ei,registerComponent:()=>B,resetPath:()=>$,setPersistentState:()=>So,setRef:()=>Si,typeOf:()=>P,useBreakpoints:()=>Ho,useLayoutProviderDispatch:()=>Z,useLayoutProviderVersion:()=>Er,usePersistentState:()=>Ae,useResizeObserver:()=>ko,useViewActionDispatcher:()=>st,useViewContext:()=>pa,useViewDispatch:()=>Fo});module.exports=mi(va);var on=M(require("classnames"));var Xe=require("@salt-ds/core"),Xt=M(require("classnames")),Ko=require("react");var be=require("react/jsx-runtime"),ye="vuuDrawer",jo=e=>typeof e=="string"?e:e+"px",di=(e,t,o)=>{let n=t!==void 0,r=o!==void 0;if(!(!e&&!r&&!n))return!r&&!n?e:{...e,"--drawer-size":n?jo(t):void 0,"--drawer-peek-size":r?jo(o):void 0}},qo=({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,Xe.useControlled)({controlled:a,default:n!=null?n:!1,name:"Drawer",state:"open"}),y=(0,Xt.default)(ye,t,`${ye}-${l}`,{[`${ye}-open`]:h,[`${ye}-inline`]:c,[`${ye}-over`]:!c,[`${ye}-peekaboo`]:m}),d=(0,Ko.useCallback)(()=>{console.log("toggleDrawer"),g(!h)},[h,g]),b=di(s,r,i),E=o?d:p,R=()=>(0,be.jsx)("div",{className:(0,Xt.default)("vuuToggleButton-container"),children:h?(0,be.jsx)(Xe.Button,{"aria-label":"close",onClick:d,"data-icon":"close",variant:"secondary"}):(0,be.jsx)(Xe.Button,{"aria-label":"open",onClick:d,"data-icon":"close",variant:"secondary"})});return(0,be.jsxs)("div",{...f,className:y,onClick:E,style:b,children:[u=="start"?R():null,(0,be.jsx)("div",{className:`${ye}-liner`,children:(0,be.jsx)("div",{className:`${ye}-content`,children:e})}),u=="end"?R():null]})};qo.displayName="Drawer";var pt=qo;var Yt=require("@vuu-ui/vuu-utils");var Qo={},en={},pe={};function N(e){return Qo[e]===!0}function tn(e){return en[e]===!0}var Zt=e=>N(e)||tn(e),fi=e=>!!pe[e];function B(e,t,o="component"){pe[e]=t,o==="container"?Qo[e]=!0:o==="view"&&(en[e]=!0)}var ut=require("react/jsx-runtime"),hi=e=>e.type===pt,gi=({props:{position:e="left"}})=>e.match(/top|bottom/),Jt=e=>{let{children:t,className:o,id:n,style:r}=e,i="hwChest",[s,a]=(0,Yt.partition)(t,hi),[l,c]=(0,Yt.partition)(s,gi),p=l.length===0?"horizontal":c.length===0?"vertical":"both",m=(0,on.default)(i,o,`${i}-${p}`);return(0,ut.jsxs)("div",{className:m,id:n,style:r,children:[s,(0,ut.jsx)("div",{className:`${i}-content`,children:a})]})};Jt.displayName="Chest";var nn=Jt;B("Chest",Jt,"container");var rn=require("react");var sn=require("react/jsx-runtime"),jt=(0,rn.forwardRef)(function({resizeable:t,...o},n){return(0,sn.jsx)("div",{...o,className:"Component",ref:n})});jt.displayName="Component";var mt=jt;B("Component",jt);var xe=M(require("react"));var yi={},w=(e,t)=>{var n;let o=T(e);return(n=o[t])!=null?n:o[`data-${t}`]},T=e=>(e==null?void 0:e.props)||e||yi,Kt=e=>{let t=T(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 bi=(e,t)=>P(e)===t;var xi=e=>{let t=e.lastIndexOf(".");return t===-1?e:e.slice(0,t)};function se(e,t){let{"data-path":o,path:n=o}=T(e);return t==="0"||t===n?null:V(e,xi(t),!0)}function ae(e,t){let{children:o,...n}=T(e);if(t(n))return e;if(xe.default.Children.count(o)>0){let r=xe.default.isValidElement(o)?[o]:o;for(let i of r){let s=ae(i,t);if(s)return s}}}function an(e,t){if(t===e)return null;let{path:o,children:n}=T(e),{idx:r,finalStep:i}=J(o,w(t,"path"));return i?e:n===void 0||n[r]===void 0?null:an(n[r],t)}var ln=(e,t)=>{if(xe.default.isValidElement(e)&&t==0)return e;if(Array.isArray(e))return e[t]};function qt(e,t){let o=t.split("."),n=[e],r=i=>xe.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}=T(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(xe.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=ln(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 Ri(e,t){let o=se(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 dt(i[r+1]);{let s=n.pop(),a=se(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 N(P(l))?dt(l):l}}}return dt(e)}function Ei(e,t){let o=t.split(".").map(i=>parseInt(i,10)),n=o.pop(),r=se(e,t);if(r!=null&&typeof n=="number"){let{children:i}=r.props;if(n>0)return ft(i[n-1]);for(;o.length>1;)if(n=o.pop(),r=se(e,w(r,"path")),n>0){let s=r.props.children[n-1];return N(P(s))?ft(s):s}}return ft(e)}function dt(e){if(N(P(e))){let{children:t}=e.props||e;return dt(t[0])}return e}function ft(e){if(N(P(e))){let{children:t}=e.props||e;return ft(t[t.length-1])}return e}function J(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=[];xe.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 xe.default.cloneElement(e,{[r]:t,...o},n)}function Si(e,t){typeof e=="function"?e(t):e&&(e.current=t)}var ht=e=>{if(typeof e!="number")throw Error(`"no support yet for flex value ${e}`);return{flexBasis:0,flexGrow:1,flexShrink:1}};var Le={north:1,east:2,south:4,west:8,header:16,centre:32,absolute:64},Ze={AFTER:"after",BEFORE:"before"},W=Object.freeze({North:ve("north"),East:ve("east"),South:ve("south"),West:ve("west"),Header:ve("header"),Centre:ve("centre"),Absolute:ve("absolute")});function ve(e){return Object.freeze({offset:e==="north"||e==="west"?0:e==="south"||e==="east"?1:NaN,valueOf:function(){return Le[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 cn=W.North,pn=W.South,Qt=W.East,eo=W.West,Di=W.Header,Ti=W.Centre,$e=class{static measure(t,o=[]){let n={};return vi(t,n,o),n}static allBoxesContainingPoint(t,o,n,r,i){return fn(t,o,n,r,i).reverse()}};function to(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 oo(e,t,o,n){let{BEFORE:r,AFTER:i}=Ze,{pctX:s,pctY:a,closeToTheEdge:l}=to(e,t,o),c,p;if(n==="row")c=s<.5?eo:Qt;else if(o.header&>(o.header,e,t))if(c=Di,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=wi(e,t,o,s,a);return{position:c,x:e,y:t,closeToTheEdge:l,tab:p}}function wi(e,t,o,n,r){let i=Pi(o,.2);if(gt(i,e,t))return Ti;switch(`${r<.5?"north":"south"}${n<.5?"west":"east"}`){case"northwest":return n>r?cn:eo;case"northeast":return 1-n>r?cn:Qt;case"southeast":return n>r?Qt:pn;case"southwest":return 1-n>r?eo:pn;default:}}function Pi({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 vi(e,t,o){let{id:n,"data-path":r,path:i=r}=T(e),s=P(e);if(n&&i){let[a,l]=dn(e);un(e,a,l,t),N(s)&&mn(e,t,o)}}function un(e,t,o,n){let{"data-path":r,path:i=r,header:s}=T(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 mn(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}=T(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(Li)).map(R=>{let[S,x]=dn(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],D,v)=>{let A,F,L,H,C,z,k=v.length-1;y?(C=D===0?0:R.left-v[D-1][0].right,z=D===k?0:v[D+1][0].left-R.right,A=D===0||C===0?0:C,F=D===k||z===0?0:z-z/2,R.left-=A,R.right+=F,L=i,H=s):g&&(C=D===0?0:R.top-v[D-1][0].bottom,z=D===k?0:v[D+1][0].top-R.bottom,L=D===0||C===0?0:C,H=D===k||z===0?0:z-z/2,R.top-=L,R.bottom+=H,A=n,F=r);let Q=un(x,R,S,t),X=P(x);return N(X)&&mn(x,t,o,A,F,L,H),Q});b.length&&(t[c].children=E)}function Li(e){let{id:t}=T(e),o=document.getElementById(t);return o?o.dataset.dragging!=="true":(console.warn(`BoxModel: no element found with id #${t}`),!1)}function dn(e){let{id:t}=T(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(N(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 fn(e,t,o,n,r,i=[]){let{children:s,"data-path":a,path:l=a}=T(e),c=P(e),p=t[l];if(!gt(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(!N(c)||p.header&>(p.header,o,n))return i;p.scrolling&&Mi(p,o,n);for(let m=0;m<s.length;m++){if(c==="Stack"&&e.props.active!==m)continue;let u=fn(s[m],t,o,n,r);if(u.length)return i.concat(u)}return i}function gt(e,t,o){if(e)return t>=e.left&&t<e.right&&o>=e.top&&o<e.bottom}function Mi({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 Ci=.4,yt=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}=to(o,n,r),p=Ci,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 Ai=e=>e.pos.tab&&P(e.component)==="Stack"&&e.pos.position.Header,{north:zi,south:Ii,east:ki,west:Bi}=Le,Oi=ki+Bi,Hi=zi+Ii,ue=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===Ze.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:ue.getActiveDropTarget(t.nextDropTarget)}};function bt(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}=T(c),h=n[u],y=oo(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 D=$i(E,y,d,n,e,t);if(D){let[v,A]=D;return new ue({component:E,pos:v,clientRect:A,nextDropTarget:(x=b(R))!=null?x:null})}else if(R.length)return b(R)}};s=new ue({component:c,pos:y,clientRect:h,nextDropTarget:(l=b(p))!=null?l:null}).activate()}return s}function $i(e,{closeToTheEdge:t,position:o},n,r,i,s){if(!e||e.type==="DraggableLayout")return;let a=r[e.props.path],l=t&Le.north,c=t&Le.east,p=t&Le.south,m=t&Le.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=oo(i,s,b);if((Fi(e)||hn(e))&&t&Oi)return E.width=120,[E,b];if((Ni(e)||hn(e))&&(o.Header||t&Hi))return E.height=120,[E,b]}}function hn(e){return P(e)==="Stack"}function Fi(e){return P(e)==="Flexbox"&&e.props.style.flexDirection==="column"}function Ni(e){return P(e)==="Flexbox"&&e.props.style.flexDirection==="row"}var xt=require("@vuu-ui/vuu-popups");var gn=M(require("classnames"));var ro=require("react/jsx-runtime");function io(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 no="vuuDropMenu",so=({className:e,dropTarget:t,onHover:o,orientation:n})=>{let r=t.toArray();return(0,ro.jsx)("div",{className:(0,gn.default)(no,e,`${no}-${n}`),onMouseLeave:()=>o(null),children:r.map((i,s)=>(0,ro.jsx)("div",{className:`${no}-item`,"data-icon":s===0?"column-2A":"column-2B",onMouseEnter:()=>o(i)},s))})};var Rn=require("react/jsx-runtime"),ao=!1,Ye=null,ee=null,Vi=e=>Ye=e,Wi=([e,t])=>`M${e},${t}`,_i=([e,t])=>`L${e},${t}`,yn=([e,...t])=>`${Wi(e)} ${t.map(_i)}Z`,Gi=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 Ui(){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 Je=class{constructor(){this.currentPath=null;this.tabMode=null;Ui()}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=yn(n),i=document.getElementById("vuu-drop-outline");i==null||i.setAttribute("d",r),this.currentPath=r}clear(){Ye=null,Rt(),document.body.classList.remove("drawing"),xt.PopupService.hidePopup()}get hoverDropTarget(){return Ye}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=ao;if(Ye!==null)this.drawTarget(Ye);else if(ao=t.nextDropTarget!=null,t.pos.tab?Xi(t):ee&&Rt(),this.drawTarget(t,o),ao){let[i,s,a]=io(t);{let l=(0,Rn.jsx)(so,{dropTarget:t,onHover:Vi,orientation:a});xt.PopupService.showPopup({left:i,top:s,component:l})}}else xt.PopupService.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=yn(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",Gi(u))}}},bn="transition:margin-left .4s ease-out;margin-left: 63px",xn="transition:margin-left .4s ease-out;margin-left: 0px";function Xi(e){var a,l;let{AFTER:t,BEFORE:o}=Ze,{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?(ee===null||ee!==s)&&(s.style.cssText=bn,ee&&(ee.style.cssText=xn),ee=s):Rt()}else if((r==null?void 0:r.positionRelativeToTab)===o){if(ee===null){let c=".vuuHeader-title";s=(l=document.getElementById(i))==null?void 0:l.querySelector(c),s.style.cssText=bn,ee=s}}else Rt()}function Rt(){ee&&(ee.style.cssText=xn,ee=null)}var me,je,Re,Sn,Dn,Ee,Et,Fe=null,co,Tn,Ke,wn,lo,St=null,Zi=3,Dt=new Je,En=.4;function Yi(e,t){return t?V(e,t):ae(e,o=>o.dropTarget)}var Pt={handleMousedown(e,t,o={}){me=t,Tn=o,Sn=e.clientX,Dn=e.clientY,lo=o.dragThreshold===void 0?Zi:o.dragThreshold,lo===0?me(e,0,0):(window.addEventListener("mousemove",Tt,!1),window.addEventListener("mouseup",wt,!1),St=window.setTimeout(()=>{console.log("mousedownTimer fires"),window.removeEventListener("mousemove",Tt,!1),window.removeEventListener("mouseup",wt,!1),me==null||me(e,0,0)},500)),e.preventDefault()},initDrag(e,t,{top:o,left:n,right:r,bottom:i},s,a,l,c){return{drag:je,drop:Re}=a,Ji(e,t,{top:o,left:n,right:r,bottom:i},s,l,c)}};function Tt(e){let n=e.clientX-Sn,r=e.clientY-Dn;Math.max(Math.abs(n),Math.abs(r))>lo&&(window.removeEventListener("mousemove",Tt,!1),window.removeEventListener("mouseup",wt,!1),me==null||me(e,n,r),me=null)}function wt(){St&&(window.clearTimeout(St),St=null),window.removeEventListener("mousemove",Tt,!1),window.removeEventListener("mouseup",wt,!1)}function Ji(e,t,o,n,r,i){Ee=Yi(e,t);let{"data-path":s,path:a=s}=T(Ee);i&&(co=i.map(u=>ae(e,f=>f.id===u)).map(u=>u.props.path)),Ke=$e.measure(Ee,i),console.log({_measurements:Ke});let l=Ke[a];Et=new yt(l,n.x,n.y,o,r);let c=Math.round(Et.x.mousePct*100),p=Math.round(Et.y.mousePct*100);return window.addEventListener("mousemove",Pn,!1),window.addEventListener("mouseup",vn,!1),wn=!1,Dt.prepare(o,"tab-only"),Tn.DoNotTransform?"transform:none":`transform:scale(${En},${En});transform-origin:${c}% ${p}%;`}function Pn(e){let t=e.clientX,o=e.clientY,n=Et,r=Fe,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||je==null||je(s,a),!(wn||Ee===void 0)&&(n.inBounds()?i=bt(t,o,Ee,Ke,n.hasIntrinsicSize(),co):i=bt(n.dropX(),n.dropY(),Ee,Ke),r&&(i==null||i.box!==r.box)&&(Fe=null),i&&(Dt.draw(i,n),Fe=i))}function vn(){ji()}function ji(){if(Fe){let e=Dt.hoverDropTarget||ue.getActiveDropTarget(Fe);Re==null||Re(e),Fe=null}else Re==null||Re({component:Ee,pos:{position:W.Absolute}});je=null,Re=null,Ee=void 0,Dt.clear(),co=void 0,window.removeEventListener("mousemove",Pn,!1),window.removeEventListener("mouseup",vn,!1)}var Ln=M(require("classnames")),Mn=require("react");var An=require("react/jsx-runtime"),po=function(t){let o=(0,Mn.useRef)();o.current=t;let{className:n,id:r,style:i}=t,s=(0,Ln.default)("DraggableLayout",n);return(0,An.jsx)("div",{className:s,id:r,style:i,children:t.children})},Cn="DraggableLayout";po.displayName=Cn;B(Cn,po,"container");var Xn=require("@salt-ds/core"),Zn=M(require("classnames")),Yn=require("react");var Gn=require("@vuu-ui/vuu-utils"),O=M(require("react"));var In=M(require("classnames"));var kn=require("react/jsx-runtime"),zn="vuuPlaceholder",qe=({className:e,closeable:t,flexFill:o,resizeable:n,shim:r,...i})=>(0,kn.jsx)("div",{className:(0,In.default)(zn,e,{[`${zn}-shim`]:r}),...i,"data-placeholder":!0,"data-resizeable":!0});qe.displayName="Placeholder";B("Placeholder",qe);var Bn=M(require("classnames")),_=M(require("react"));var uo=require("react/jsx-runtime"),On=_.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:D})=>{let v=D?10:1;t&&x==="ArrowDown"?n(o,v):t&&x==="ArrowUp"||!t&&x==="ArrowLeft"?n(o,-v):!t&&x==="ArrowRight"&&n(o,v)},[t,o,n]),f=(0,_.useCallback)(x=>{let{key:D}=x;(t&&(D==="ArrowUp"||D==="ArrowDown")||!t&&(D==="ArrowLeft"||D==="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 D=x[t?"clientY":"clientX"],v=D-c.current;D&&D!==c.current&&n(o,v),c.current=D},[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,Bn.default)("Splitter","focusable",{active:p,column:t});return(0,uo.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,uo.jsx)("div",{className:"grab-zone"})})});var fo=require("@vuu-ui/vuu-utils"),ho=M(require("react"));var Ki={"data-placeholder":!0,"data-resizeable":!0},vt={},Se="auto",mo={flexBasis:0,flexGrow:1,flexShrink:1,height:Se,width:Se},Hn={height:"width",width:"height"},$n=(e="row")=>e==="row"?["width","height","column"]:["height","width","row"],qi=e=>typeof e=="string"&&e.endsWith("%"),j=e=>{let{style:{width:t=Se,height:o=Se}=vt}=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 go(e,t,o){let n=Hn[t],{style:{[n]:r=Se,...i}=vt}=e.props;return o&&o[t]?{...i,...mo,flexBasis:o[t],flexGrow:0,flexShrink:0}:{...i,...mo,[n]:r}}function Fn(e){let{style:{flex:t,flexGrow:o,flexShrink:n,flexBasis:r}=vt}=e.props;return typeof t=="number"||r===0&&o===1&&n===1?!0:typeof r!="number"}function yo(e,t,o){let n=Hn[t],{style:{[t]:r=Se,[n]:i=Se,...s}=vt}=e.props;return r!==Se?qi(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,...mo,flexBasis:o[t],flexGrow:0,flexShrink:0}:{...s,[n]:i}}function Qe(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(le(`${o}.${s++}`,p,{flexGrow:0,flexShrink:0}))}else a=!0;let{version:l=0,style:c}=T(e);return i.push($(e,`${o}.${s++}`,{version:l+1,style:{...c,flexBasis:"auto",flexGrow:0,flexShrink:0}})),a&&i.push(le(`${o}.${s++}`,0,void 0,{[`data-${t}-placeholder`]:!0})),bo(t,{resizeable:!1,style:{flexBasis:"auto"}},i,o)}var Qi=(e,t)=>{if(!t)return e===0?1:0};function bo(e,t,o,n){let r=(0,fo.uuid)(),{flexFill:i,style:s,resizeable:a=!0}=t,{flexBasis:l=i?void 0:"auto"}=s,c=Qi(l,i);return ho.default.createElement(pe.Flexbox,{id:r,key:r,path:n,flexFill:i,style:{...s,flexDirection:e,flexBasis:l,flexGrow:c,flexShrink:c},resizeable:a},o)}var es={flexGrow:1,flexShrink:1};function le(e,t,o,n){let r=(0,fo.uuid)();return ho.default.createElement("div",{...Ki,...n,"data-path":e,id:r,key:r,style:{...es,...o,flexBasis:t}})}var ts={},et=1,tt=2,os=e=>typeof e.intrinsicSize=="number",ns=(e,t)=>{let o={};return e.forEach(n=>{o[n]=w(t,n)}),o},Lt=(e,t,o)=>e.map((n,r)=>{var l;let i=w(n,"resizeable"),{[t]:s}=(l=j(n))!=null?l:ts,a=Fn(n);return o?{index:r,flexOpen:a,intrinsicSize:s,resizeable:i,...ns(o,n)}:{index:r,flexOpen:a,intrinsicSize:s,resizeable:i}}),Nn=e=>{let t=e.length,o=e.every(os),n=Array(t).fill(0);if(o&&(n[0]=tt,n[t-1]=tt),t<2)return n;for(let r=0,i=0;r<t-1;r++)e[r].resizeable&&!i&&(i=et),n[r]+=i;for(let r=t-1;r>0&&(n[r]&et&&(n[r]-=et),!e[r].resizeable);r--);return n},Vn=(e,t)=>{let o=is(e,t),n=ss(e,t),r=o!==-1&&n!==-1?[o,n]:void 0,i=rs(e,r);return[r,i]};function rs(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 is(e,t){let o=t,n=!1;for(;o>=1&&!n;)o=o-1,n=Wn(e,o);return o}function ss(e,t){let o=t,n=!1,r=e.length;for(;o<r&&!n;)o=o+1,n=Wn(e,o);return o===r?-1:o}function Wn(e,t){let{placeholder:o,splitter:n,resizeable:r,intrinsicSize:i}=e[t];return Boolean(!n&&!i&&(o||r))}var as=e=>!e.splitter&&!e.placeholder,Un=({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]=Vn(d,y);b&&(b.forEach(R=>{var x;let S=(x=n.current)==null?void 0:x.childNodes[R];if(S){let{size:D,minSize:v}=us(S,p);d[R].currentSize=D,d[R].minSize=v}}),E&&E.forEach(R=>{var x;let S=(x=n.current)==null?void 0:x.childNodes[R];if(S){let{[p]:D}=S.getBoundingClientRect();d[R].flexBasis=D}}))}},[p]),f=(0,O.useCallback)((y,d)=>{i.current&&r.current&&l(cs(i.current,r.current,d,p))},[p]),h=(0,O.useCallback)(()=>{let y=r.current;y&&(t==null||t(y.filter(as))),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(On,{column:c,index:y,key:`splitter-${y}`,onDrag:f,onDragEnd:h,onDragStart:u}),[f,h,u,c]);return(0,O.useMemo)(()=>{let[y,d]=ls(m,p,g,s.current);r.current=d,i.current=y},[m,g,p]),{content:i.current||[],rootRef:n}};function ls(e,t,o,n){let r=Lt(e,t),i=Nn(r),s=[],a=[];for(let l=0;l<e.length;l++){let c=e[l];if(l===0&&i[l]&tt&&(s.push(_n(l)),a.push({placeholder:!0,shim:!0})),c.key==null){let p=n[l]||(n[l]=(0,Gn.getUniqueId)());s.push(O.default.cloneElement(c,{key:p}))}else s.push(c);a.push(r[l]),l>0&&i[l]&tt?(s.push(_n(l)),a.push({placeholder:!0})):i[l]&et&&(s.push(o(s.length)),a.push({splitter:!0}))}return[s,a]}function cs(e,t,o,n){return ps(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 ps(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 _n(e){return O.default.createElement(qe,{shim:e===0,key:`placeholder-${e}`})}function us(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 jn=require("react/jsx-runtime"),xo="hwFlexbox",Jn=(0,Yn.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}=Un({children:r,onSplitterMoved:m,style:y}),R=(0,Zn.default)(xo,s,{[`${xo}-column`]:i,[`${xo}-row`]:f,"flex-fill":a,"full-page":c});return(0,jn.jsx)("div",{...d,className:R,"data-resizeable":u||void 0,id:p,ref:(0,Xn.useForkRef)(E,o),style:{...y,gap:l,"--spacing":h},children:b})});Jn.displayName="Flexbox";var Mt=Jn;var Sr=require("react");var Me={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 Ao=M(require("react"));var vo=require("@vuu-ui/vuu-utils"),Ne=M(require("react"));var To=require("@vuu-ui/vuu-utils"),De=M(require("react"));var Ce=require("react"),G=new Map,K=new Map,Ro=e=>G.get(e),Eo=e=>G.has(e),So=(e,t)=>G.set(e,t),Ae=()=>{let e=(0,Ce.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,Ce.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,Ce.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,Ce.useCallback)((s,a)=>{let l=G.get(s);if(l)return a!==void 0?l[a]:l},[]),r=(0,Ce.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,Ce.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 Kn=e=>e.flexDirection==="column"?["height","width"]:["width","height"],ms={},ot=(e,t="0")=>{let[o,n]=Po(P(e),e.props,t);return De.default.cloneElement(e,o,n)},wo=(e,t)=>{let o=P(e),[n,r]=Po(o,e.props,"0",void 0,t);return(0,De.cloneElement)(e,n,r)};function ds(e,t,o="0",n=null,r){var g,y;let{active:i=0,"data-path":s,path:a=s,id:l,style:c}=T(r),p=P(r)===e&&o===a,m=p?l:(g=t.id)!=null?g:(0,To.uuid)(),u=e==="Stack"?(y=t.active)!=null?y:i:void 0,f=m,h=p?c:hs(e,t,n);return Zt(e)?{id:m,key:f,path:o,style:h,type:e,active:u}:{id:m,key:f,style:h,"data-path":o}}function Po(e,t,o,n=null,r){var c,p;let i=ds(e,t,o,n,r);if(t.layout&&!r)return[i,[Ct(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:fs(e,t.children,o,s);return[i,l]}function fs(e,t,o="0",n){let r=Array.isArray(t)?t:De.default.isValidElement(t)?[t]:[];return N(e)?r.map((i,s)=>{let a=P(i),l=P(n==null?void 0:n[s]);if(!l||a===l){let[c,p]=Po(a,i.props,`${o}.${s}`,e,n==null?void 0:n[s]);return De.default.cloneElement(i,c,p)}return n==null?void 0:n[s]}):t}var hs=(e,t,o)=>{let{style:n=ms}=t;if(e==="Flexbox"&&(n={flexDirection:t.column?"column":"row",...n,display:"flex"}),n.flex){let{flex:r,...i}=n;n={...i,...ht(typeof r=="number"?r:0)}}else o==="Stack"?n={...n,...ht(1)}:o==="Flexbox"&&(n.width||n.height)&&n.flexBasis===void 0&&(n={...n,flexBasis:"auto",flexGrow:0,flexShrink:0});return n};function Ct({id:e=(0,To.uuid)(),type:t,children:o,props:n,state:r},i){let s=t.match(/^[a-z]/)?t:pe[t];if(s===void 0)throw Error(`layoutUtils unable to create component from JSON, unknown type ${t}`);return r&&So(e,r),De.default.createElement(s,{id:e,...n,key:e,path:i},o?o.map((a,l)=>Ct(a,`${i}.${l}`)):void 0)}function qn(e){return Qn(e)}function Qn(e){let t=P(e),{id:o,children:n,type:r,...i}=T(e),s=Eo(o)?Ro(o):void 0;return{id:o,type:t,props:gs(i),state:s,children:De.default.Children.map(n,Qn)}}function gs(e){if(e){let{path:t,...o}=e,n={};for(let[r,i]of Object.entries(o))n[r]=Do(i);return n}}function Do(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e;if(Array.isArray(e))return e.map(Do);if(typeof e=="object"&&e!==null){let t={};for(let[o,n]of Object.entries(e))t[o]=Do(n);return t}}function er(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 At(e,t,o){let{active:n,children:r=[],path:i}=T(e),s=w(t,"path"),{idx:a,finalStep:l}=J(i,s,!0),[c,p]=l?ys(e,r,o):[n,r==null?void 0:r.map((u,f)=>f===a?At(u,t,o):u)],m=P(e)==="Stack"?Array.isArray(c)?c[0]:c:n;return Ne.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,vo.uuid)()}=T(o);return r?[r,t.concat($(o,`${n}.${r}`,{id:i,key:i}))]:[0,[$(o,`${n}.0`,{id:i})]]}function zt(e,t,o,n,r,i,s){let{active:a,children:l,path:c}=T(e),p=w(t,"path"),{idx:m,finalStep:u}=J(c,p),[f,h]=u?bs(e,l,m,o,n,r,i,s):[a,l.map((y,d)=>d===m?zt(y,t,o,n,r,i,s):y)],g=P(e)==="Stack"?f:a;return Ne.default.cloneElement(e,{active:g},h)}function bs(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)?Rs(e,t,o,n,r,s,a):tr(e,t,o,n,r,(i==null?void 0:i.width)||(i==null?void 0:i.height),s)}var xs=(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 Rs(e,t,o,n,r,i,s){let{style:{flexDirection:a}}=T(e),[l,c,p]=$n(a),{[c]:m,[l]:u}=j(n),f=w(t[o],"path"),h=xs(a,r,i,s),[g,y]=m<i[c]?[Qe(n,p,f,i,s),u]:[n,void 0],d=h?le(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?Qe(b,p,w(b,"path")):b}})),tr(e,t,o,g,r,y,i,d)}function tr(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]=Es(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 Es(e,t,o,n){let r=(0,vo.uuid)(),{version:i=0}=T(o);if(i+=1,P(e)==="Flexbox"){let[s]=Kn(e.props.style),a=6,l={[s]:(n[s]-a)/2},c=yo(t,s,l),p=yo(o,s,l);return[Ne.default.cloneElement(t,{style:c}),Ne.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}}=T(o);return[t,Ne.default.cloneElement(o,{id:r,version:i,style:c})]}}var q={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 Te=M(require("react"));var nt=M(require("react"));function or(e,{target:t,replacement:o}){return Lo(e,t,o)}function Lo(e,t,o){let n=w(t,"path"),r=w(t,"resizeable"),{style:i}=T(t),s=ot(nt.default.cloneElement(o,{resizeable:r,style:{...i,...o.props.style}}),n);return te(e,t,s)}function te(e,t,o,n){if(e===t)return o;let{idx:r,finalStep:i}=J(w(e,"path"),w(t,"path")),s=e.props.children.slice();return i?n?n===Me.MINIMIZE?s[r]=Ss(e,s[r]):n===Me.RESTORE&&(s[r]=Ds(s[r])):s[r]=o:s[r]=te(s[r],t,o,n),nt.default.cloneElement(e,void 0,s)}function Ss(e,t){let{style:o}=T(e),{style:n}=T(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?nt.default.cloneElement(t,{collapsed:u,restoreStyle:p,style:m}):t}function Ds(e){let{style:t,restoreStyle:o}=T(e),{flexBasis:n,flexShrink:r,flexGrow:i,...s}=t,a={...s,...o};return nt.default.cloneElement(e,{collapsed:!1,style:a,restoreStyle:void 0})}function Mo(e,{path:t}){let o=V(e,t),n=se(e,t);if(n===null)return e;let{children:r}=T(n);if(r.length>1&&rr(r,t)){let{style:{flexBasis:i,display:s,flexDirection:a,...l}}=T(n),c=w(n,"path"),p=te(e,n,le(c,i,l));for(;(n=se(p,c))&&w(n,"path")!=="0";){let{children:m}=T(n);if(rr(m)){c=w(n,"path");let{style:{flexBasis:u,display:f,flexDirection:h,...g}}=T(n);p=te(e,n,le(c,u,g))}else if(vs(m))p=ar(e,n);else break}return p}return ir(e,o)}function ir(e,t){let o=T(e),{children:n,path:r,preserve:i}=o,{active:s}=o,{idx:a,finalStep:l}=J(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 Ts(e,p[0]);!p.some(ws)&&p.some(sr)&&(p=Ps(p))}else p[a]=ir(p[a],t);return p=p.map((m,u)=>$(m,`${r}.${u}`)),Te.default.cloneElement(e,{active:s},p)}function Ts(e,t){let o=P(e),{path:n,style:{flexBasis:r,flexGrow:i,flexShrink:s,width:a,height:l}}=T(e),c=$(t,n);if(n==="0")c=Te.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=Te.default.cloneElement(c,{flexFill:void 0,style:{...u,flexGrow:i,flexShrink:s,flexBasis:r,width:a,height:l}})}return c}var ws=e=>e.props.style.flexGrow>0,sr=e=>{let{width:t,height:o,flexGrow:n}=e.props.style;return n===0&&typeof t!="number"&&typeof o!="number"},Ps=e=>e.map(t=>sr(t)?Te.default.cloneElement(t,{style:{...t.props.style,flexGrow:1}}):t),vs=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}}},ar=(e,t)=>{let{children:o,path:n}=T(e),{idx:r,finalStep:i}=J(n,w(t,"path")),s=o.slice();return i?s[r]=Ls(t):s[r]=ar(s[r],t),s=s.map((a,l)=>$(a,`${n}.${l}`)),Te.default.cloneElement(e,void 0,s)},Ls=e=>{let{children:t}=T(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(nr(n)),n.length=0),o.push(t[i]));n.length===1?o.push(n.pop()):n.length>0&&o.push(nr(n));let r=w(e,"path");return Te.default.cloneElement(e,void 0,o.map((i,s)=>$(i,`${r}.${s}`)))},nr=([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 Te.default.cloneElement(e,{style:{...o,flexBasis:n,flexGrow:r,flexShrink:i}})},rr=(e,t)=>e.every(o=>w(o,"placeholder")||t&&w(o,"path")===t);var Co=M(require("react"));function lr(e,{path:t,sizes:o}){let n=V(e,t,!0),{children:r,style:i}=T(n),s=i.flexDirection==="column"?"height":"width",a=Ms(r,o,s),l=Co.default.cloneElement(n,void 0,a);return te(e,n,l)}function Ms(e,t,o){return e.map((n,r)=>{let{style:{[o]:i,flexBasis:s}}=T(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:Co.default.cloneElement(n,{style:Cs(n.props.style,o,m)})})}function Cs(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 cr=require("@vuu-ui/vuu-utils"),rt=M(require("react"));var pr=e=>{let[t]=P(e);return t===t.toLowerCase()};function it(e,t,o,n,r,i){let{children:s,path:a}=T(e),l=w(t,"path"),{idx:c,finalStep:p}=J(a,l),m=p?As(e,s,t,o,n,r,i):s.map((u,f)=>f===c?it(u,t,o,n,r,i):u);return rt.default.cloneElement(e,void 0,m)}function As(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 Is(t,o,n,r,i,s)}return zs(e,t,o,n,r)}function zs(e,t,o,n,r){var x;let{version:i=0}=T(n),s=w(o,"path"),{type:a,flexDirection:l,showTabs:c}=mr(r),[p,m,u]=ks(a,o,n,l,r),f=ur(r),h=f?1:0,g={resizeable:!0,style:u,version:i+1},d={[pr(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,cr.uuid)(),S=rt.default.createElement(pe[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),ot(rt.default.cloneElement(n,g),`${s}.1`)]:[ot(rt.default.cloneElement(n,g),`${s}.0`),$(o,`${s}.1`,d)]);return t.map(D=>D===o?S:D)}function Is(e,t,o,n,r,i){let{flexDirection:s}=mr(n),a=s==="column"?"row":"column",l=ur(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=pr(t)?"data-resizeable":"resizeable",b=[];f&&b.push(l?$(t,`${g}.${y++}`,{[d]:!0,style:{flexBasis:f,flexGrow:1,flexShrink:1}}):le(`${g}.${y++}`,f,{flexGrow:0,flexShrink:0})),b.push(Qe(o,a,`${g}.${y++}`,r,i)),h&&b.push(l?le(`${g}.${y++}`,0):$(t,`${g}.${y++}`,{[d]:!0,style:{flexBasis:0,flexGrow:1,flexShrink:1}}));let E=bo(s,t.props,b,g);return e.map(R=>R===t?E:R)}function ks(e,t,o,n,r){let i={...t.props.style,flexDirection:n},s=e==="Flexbox"&&n==="column"?"height":"width",a=go(o,s,r),l=go(t,s);return[i,l,a]}var ur=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 mr(e){return e.position.Header?{type:"Stack",flexDirection:"column",showTabs:!0}:{type:"Flexbox",flexDirection:e.position.EastOrWest?"row":"column"}}var gr=(e,t)=>{switch(t.type){case q.ADD:return Fs(e,t);case q.DRAG_DROP:return $s(e,t);case q.MAXIMIZE:return Hs(e,t);case q.REMOVE:return Mo(e,t);case q.REPLACE:return or(e,t);case q.SET_TITLE:return Os(e,t);case q.SPLITTER_RESIZE:return lr(e,t);case q.SWITCH_TAB:return Bs(e,t);default:return e}},Bs=(e,{path:t,nextIdx:o})=>{let n=V(e,t,!0),r=Ao.default.cloneElement(n,{active:o});return te(e,n,r)},Os=(e,{path:t,title:o})=>{debugger;let n=V(e,t,!0),r=Ao.default.cloneElement(n,{title:o});return te(e,n,r)},Hs=(e,{path:t,type:o})=>{if(t){let n=V(e,t,!0);return te(e,n,n,o)}else return e},$s=(e,t)=>{var h,g;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}=T(o),p=j(o),m;if(a){let[y,d]=er(i,s);y===void 0?m=At(e,i,o):m=zt(e,y,o,d)}else!p&&((g=s==null?void 0:s.position)==null?void 0:g.Centre)?m=Lo(e,i,o):m=Ns(e,r,o);if(n.DoNotRemove)return m;let u=ae(m,y=>y.id===l&&y.version===c),f=w(u,"path");return Mo(m,{path:f,type:"remove"})},Fs=(e,{path:t,component:o})=>At(e,V(e,t),o),Ns=(e,t,o)=>{let{component:n,pos:r,clientRect:i,dropRect:s}=t,a=w(n,"path");if(a==="0.0")return it(e,n,o,r);let l=se(e,a);if(dr(r,l)){let c=r.position.SouthOrEast?"after":"before";return zt(e,n,o,c,r,i,s)}if(!dr(r,l))return it(e,n,o,r,i,s);if(N(P(l)))return it(e,n,o,r);throw Error(`no support right now for position = ${r.position}`)},dr=(e,t)=>e.position.Centre?hr(t)||fr(t):e.position.NorthOrSouth?fr(t):e.position.EastOrWest?hr(t):!1,fr=e=>P(e)==="Flexbox"&&e.props.style.flexDirection==="column",hr=e=>P(e)==="Flexbox"&&e.props.style.flexDirection!=="column";var yr=require("react"),Vs=e=>console.log(`dispatch ${e.type}, have you forgotten to provide a LayoutProvider ?`),Ve=(0,yr.createContext)({dispatchLayoutProvider:Vs,version:-1});var de=require("react");var Ws={},br=[0,0],_s=(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]},Gs=e=>{let{offsetParent:t}=e;if(t===null)return br;{let{left:o,top:n}=t.getBoundingClientRect();return[o,n]}},xr=(e,t)=>{let o=(0,de.useRef)(),n=(0,de.useRef)(),r=(0,de.useRef)(),i=(0,de.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,de.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,de.useCallback)(c=>{if(o.current){let{payload:p,dragContainerPath:m,dragElement:u,dragRect:f,instructions:h=Ws,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="",D="",v=-1,A=-1,F=br,L=document.getElementById(E);if(L===null)[L,x,v,A]=_s(f,E,u);else{F=Gs(L);let[H,C]=F,{width:z,height:k,left:Q,top:X}=L.getBoundingClientRect();v=Q-H,A=X-C,x=`width:${z}px;height:${k}px;left:${v}px;top:${A}px;z-index: 100;background-color:#ccc;opacity: 0.6;`,L.dataset.dragging="true",S=L.style.cssText}D=Pt.initDrag(e.current,m,f,d,{drag:i,drop:s},R),L.style.cssText=x+D,r.current=L,n.current={payload:b,originalCSS:S,dragRect:f,dragOffsets:F,dragInstructions:h,targetPosition:{left:v,top:A}}}},[i,s,e]);return(0,de.useCallback)(c=>{let{evt:p,...m}=c;console.log("prepare to drag",{options:m}),o.current={...m,dragContainerPath:""},Pt.handleMousedown(p,a,m.instructions)},[a])};var zo=require("react/jsx-runtime"),Rr=e=>e.dropTarget,Us=e=>["drag-drop","remove","set-title","splitter-resize","switch-tab"].includes(e.type),Xs=()=>{let e=Er();return(0,zo.jsx)("div",{children:`Context: ${e} `})},Zs=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=ae(m,Rr)||r.current,h=P(u)==="DraggableLayout"?T(u).children[0]:u,g=qn(h);n(g,"drag-root")}},[n]),l=(0,U.useCallback)((m,u=!1)=>{let f=gr(r.current,m);f!==r.current&&(r.current=f,s({}),!u&&Us(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=xr(r,c);return(0,U.useEffect)(()=>{if(o){let m=ae(r.current,Rr),u=Kt(m),f=Ct(o,`${m.props.path}.0`),h=u?{type:q.REPLACE,target:u,replacement:f}:{type:q.ADD,path:m.props.path,component:f};l(h,!0)}},[l,o]),r.current===void 0?r.current=wo(t):t!==i.current&&(r.current=wo(t,r.current),i.current=t),(0,zo.jsx)(Ve.Provider,{value:{dispatchLayoutProvider:c,version:0},children:r.current})},Z=()=>{let{dispatchLayoutProvider:e}=(0,U.useContext)(Ve);return e},Er=()=>{console.log({LayoutProviderContext:Ve});let{version:e}=(0,U.useContext)(Ve);return e};var Dr=require("react/jsx-runtime"),Io=function(t){let{path:o}=t,n=Z(),r=(0,Sr.useCallback)(i=>{n({type:Me.SPLITTER_RESIZE,path:o,sizes:i})},[n,o]);return(0,Dr.jsx)(Mt,{...t,onSplitterMoved:r})};Io.displayName="Flexbox";B("Flexbox",Io,"container");var Ar=require("@salt-ds/core"),zr=M(require("classnames")),Ir=require("react");var oe=require("react");var Ie=require("react"),Ys=["height","width"],Js=["height"],js=["width"],ze=new WeakMap,wr=(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}},Tr=new ResizeObserver(e=>{for(let t of e){let{target:o,contentRect:n}=t,r=ze.get(o);if(r){let{onResize:i,measurements:s}=r,a=!1;for(let[l,c]of Object.entries(s)){let p=wr(o,n,l);p!==c&&(a=!0,s[l]=p)}a&&i&&i(s)}}});function ko(e,t,o,n=!1){let r=(0,Ie.useRef)(t),i=(0,Ie.useCallback)(s=>{let a=s.getBoundingClientRect();return r.current.reduce((l,c)=>(l[c]=wr(s,a,c),l),{})},[]);(0,Ie.useLayoutEffect)(()=>{let s=e.current,a=!1;async function l(){ze.set(s,{measurements:{}}),a=!1;let{fonts:c}=document;if(c&&await c.ready,!a){let p=ze.get(s);if(p){let m=i(s);p.measurements=m,Tr.observe(s),n&&o(m)}}}if(s){if(ze.has(s))throw Error("useResizeObserver attemping to observe same element twice");l()}return()=>{s&&ze.has(s)&&(Tr.unobserve(s),ze.delete(s),a=!0)}},[e,i]),(0,Ie.useLayoutEffect)(()=>{let s=e.current,a=ze.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 Ks(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 qs=([,e],[,t])=>t-e,Oo=e=>Object.entries(e).sort(qs).map(([t,o],n,r)=>[t,o,n<r.length-1?r[n+1][1]:9999]),Bo=null,Qs=(e="salt")=>{let{xs:t,sm:o,md:n,lg:r,xl:i}=Ks(e);return Oo({xs:t,sm:o,md:n,lg:r,xl:i})},Pr=e=>(Bo===null&&(Bo=Qs(e)),Bo);var ea=[],Ho=({breakPoints:e,smallerThan:t},o)=>{let[n,r]=(0,oe.useState)(t?!1:"lg"),i=(0,oe.useRef)(document.body),s=(0,oe.useRef)(e?Oo(e):Pr()),a=(0,oe.useRef)("lg"),l=(0,oe.useCallback)(p=>{if(s.current){for(let[m,u]of s.current)if(p>=u)return m}},[s]),c=(0,oe.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 ko(o||i,s.current?["width"]:ea,({width:p})=>{let m=c(p);m!==a.current&&(a.current=m,r(m))},!0),(0,oe.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 vr="data-collapsible",ta={[vr]:!0,"data-pad-start":!0,"data-pad-end":!0},Lr=e=>{var t;return(t=ta[e])!=null?t:!1},oa=e=>e===vr,na={dynamic:"dynamic",instant:"instant",true:"instant"},ra=e=>{var t;return(t=na[e])!=null?t:"none"},ia=e=>Object.keys(e).reduce((t,o)=>{let[n,r]=t;if(Lr(o)){let i=oa(o)?ra(e[o]):e[o];n[o]=i,r[o]=void 0}return t},[{},{}]);var Mr=require("@vuu-ui/vuu-utils"),Y=require("react");var sa=["xs","sm","md","lg","xl"],aa=12,Cr=({children:e,cols:t,style:o})=>{let n=(0,Y.useRef)(null),r=(0,Y.useRef)(null),i=(0,Y.useRef)(),s=t!=null?t:aa,l=(o==null?void 0:o.flexDirection)==="column"?"height":"width",c=(0,Y.useMemo)(()=>Array.isArray(e)?e:(0,Y.isValidElement)(e)?[e]:[],[e]),p=(0,Y.useCallback)((m,u)=>{let f=Lt(m,u,sa),h=[],g=[];for(let y=0;y<m.length;y++){let d=m[y],{style:{flex:b,...E}}=d.props;h.push((0,Y.cloneElement)(d,{key:(0,Mr.getUniqueId)(),style:{...E,"--parent-col-count":s}})),g.push(f[y])}return[h,g]},[s]);return(0,Y.useMemo)(()=>{let[m,u]=p(c,l);r.current=u,i.current=m},[p,c,l]),{cols:s,content:i.current,rootRef:n}};var kr=require("react/jsx-runtime"),It="hwFluidGrid",kt=(0,Ir.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}=Cr({children:r,cols:s,style:b}),D=Ho({breakPoints:n},x),v=(0,zr.default)(It,a,{[`${It}-column`]:i,[`${It}-row`]:h,[`${It}-show-grid`]:g,"flex-fill":l,"full-page":p}),A={...b,"--spacing":y,"--grid-col-count":R,"--grid-gap":c};return(0,kr.jsx)("div",{...E,className:v,"data-breakpoint":D,"data-cols":R,"data-resizeable":f||void 0,id:m,ref:(0,Ar.useForkRef)(x,o),style:A,children:S})});kt.displayName="FluidGrid";var Br=require("react/jsx-runtime"),$o=function(t){return(0,Br.jsx)(kt,{...t})};$o.displayName="FluidGrid";B("FluidGrid",$o,"container");var Nr=M(require("classnames")),ke=M(require("react"));var we=require("react");var st=(e,t,o,n)=>{var y;let{loadSessionState:r,purgeSessionState:i,purgeState:s,saveSessionState:a}=Ae(),[l,c]=(0,we.useState)((y=r(e,"contributions"))!=null?y:[]),p=Z(),m=(0,we.useCallback)((d,b)=>{let E=l.concat([{location:d,content:b}]);a(e,"contributions",E),c(E)},[l,e,a]),u=(0,we.useCallback)(()=>{i(e,"contributions"),c([])},[e,i]),f=(0,we.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,we.useCallback)(async(d,b,E)=>{var S;d.stopPropagation();let R=(S=t.current)==null?void 0:S.getBoundingClientRect();return new Promise((x,D)=>{p({type:"drag-start",evt:d,path:b===void 0?o:`${o}.${b}`,dragRect:R,preDragActivity:E,dropTargets:n,resolveDragStart:x,rejectDragStart:D})})},[t,p,o,n]);return[(0,we.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 Ot=require("@salt-ds/core"),$r=M(require("classnames")),re=M(require("react"));var ne=require("react");var Or=({id:e,rootRef:t,path:o,dropTargets:n,title:r})=>{let i=Z(),{loadState:s,loadSessionState:a,purgeState:l,saveState:c,saveSessionState:p}=Ae(),[m,u]=st(e,t,o,n),f=(0,ne.useMemo)(()=>{var x;return(x=s("view-title"))!=null?x:r},[s,r]),h=(0,ne.useCallback)(x=>{o&&i({type:"set-title",path:o,title:x})},[i,o]),g=(0,ne.useMemo)(()=>s(e),[e,s]),y=(0,ne.useCallback)(x=>s(e,x),[e,s]),d=(0,ne.useCallback)(x=>{l(e,x),i({type:"save"})},[e,i,l]),b=(0,ne.useCallback)((x,D)=>{c(e,D,x),i({type:"save"})},[e,i,c]),E=(0,ne.useCallback)(x=>a(e,x),[e,a]),R=(0,ne.useCallback)((x,D)=>p(e,D,x),[e,p]),S=(0,ne.useCallback)(({type:x,...D})=>{let{[x]:v}=D;b(v,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 Bt=require("@heswell/salt-lab"),We=require("react"),la=[],Hr=({mainRef:e,resize:t="responsive",rootRef:o})=>{let n=t==="defer",r=(0,We.useRef)({}),i=(0,We.useRef)(),s=(0,We.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,We.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,Bt.useResizeObserver)(o,n?Bt.WidthHeight:la,a,n)};var at=M(require("react")),ca={dispatch:null},lt=at.default.createContext(ca),Fo=()=>{var t;let e=(0,at.useContext)(lt);return(t=e==null?void 0:e.dispatch)!=null?t:null},pa=()=>(0,at.useContext)(lt);var _e=require("react/jsx-runtime"),Fr=(0,re.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,Ot.useIdMemo)(m),x=(0,re.useRef)(null),D=(0,re.useRef)(null),{contributions:v,dispatchViewAction:A,load:F,loadSession:L,onConfigChange:H,onEditTitle:C,purge:z,restoredState:k,save:Q,saveSession:X,title:He}=Or({id:S,rootRef:x,path:h,dropTargets:l,title:E});Hr({mainRef:D,resize:g,rootRef:x});let Ue="vuuView",ni=()=>re.default.isValidElement(n)&&k?re.default.cloneElement(n,k):n,ri=(0,re.useMemo)(()=>({dispatch:A,id:S,path:h,title:He,load:F,loadSession:L,onConfigChange:H,purge:z,save:Q,saveSession:X}),[A,S,F,L,H,h,z,Q,X,He]),ii=typeof u=="object"?u:{};return(0,_e.jsx)("div",{...R,className:(0,$r.default)(Ue,r,{[`${Ue}-collapsed`]:i,[`${Ue}-expanded`]:c,[`${Ue}-resize-defer`]:g==="defer"}),"data-resizeable":y,id:S,ref:(0,Ot.useForkRef)(o,x),style:b,tabIndex:-1,children:(0,_e.jsxs)(lt.Provider,{value:ri,children:[u?(0,_e.jsx)(No,{...ii,collapsed:i,contributions:v,expanded:c,closeable:s,onEditTitle:C,orientation:f,tearOut:d,title:He}):null,(0,_e.jsx)("div",{className:`${Ue}-main`,ref:D,children:ni()})]})})});Fr.displayName="View";var fe=re.default.memo(Fr);fe.displayName="View";B("View",fe,"view");var ie=require("@heswell/salt-lab"),Vr=require("@salt-ds/icons");var he=require("react/jsx-runtime"),No=({className:e,contributions:t,collapsed:o,closeable:n,onEditTitle:r,orientation:i="horizontal",style:s,title:a="Untitled"})=>{let l=(0,ke.useRef)(null),[c,p]=(0,ke.useState)(a),[m,u]=(0,ke.useState)(!1),f=Fo(),h=L=>f==null?void 0:f({type:"remove"},L),g="vuuHeader",y=()=>{var L;(L=l.current)==null||L.focus()},d=L=>{L.stopPropagation()},E=(0,Nr.default)(g,e,`${g}-${o||i}`),R=()=>{u(!0)},S=L=>{L.key==="Enter"&&u(!0)},x=(L="",H="",C=!0,z=!1)=>{var k;u(!1),z?p(L):H!==L&&(p(H),r==null||r(H)),C===!1&&((k=l.current)==null||k.focus())},D=L=>{f==null||f({type:"mousedown"},L)},v=[],A=[],F=[];return a&&v.push((0,he.jsx)(ie.ToolbarField,{className:"vuuHeader-title",children:(0,he.jsx)(ie.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((L,H)=>{A.push(ke.default.cloneElement(L.content,{key:H}))}),n&&F.push((0,he.jsxs)(ie.ToolbarButton,{onClick:h,onMouseDown:d,children:[(0,he.jsx)(Vr.CloseIcon,{})," Close"]},"close")),A.length>0&&v.push((0,he.jsx)(ie.Tooltray,{"data-align-end":!0,children:A},"contributions")),F.length>0&&v.push((0,he.jsx)(ie.Tooltray,{"data-align-end":!0,children:F},"actions")),(0,he.jsx)(ie.Toolbar,{className:E,orientation:i,style:s,onMouseDown:D,children:v})};var Wr=require("@vuu-ui/vuu-utils"),$t=require("@heswell/salt-lab"),Vo=M(require("classnames")),Ft=require("react");var Ht=require("react/jsx-runtime"),ua=e=>{let t=e.cloneNode(!0);return t.id="",delete t.dataset.idx,t},Wo=(0,Ft.memo)(({className:e,children:t,idx:o,resizeable:n,header:r,closeable:i,...s})=>(0,Ht.jsx)($t.ListItem,{className:(0,Vo.default)("vuuPaletteItem",e),"data-draggable":!0,...s}));Wo.displayName="PaletteItem";var _r=({children:e,className:t,orientation:o="horizontal",...n})=>{let r=Z(),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,Wr.uuid)(),S=f?u:(0,Ht.jsx)(fe,{...{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:ua(c),evt:a.nativeEvent,instructions:{DoNotRemove:!0,DoNotTransform:!0,RemoveDraggableOnDragEnd:!0,dragThreshold:10},path:"*",payload:S,type:"drag-start"})}return(0,Ht.jsx)($t.List,{...n,borderless:!0,className:(0,Vo.default)(i,t,`${i}-${o}`),maxHeight:800,selected:null,children:e.map((a,l)=>a.type===Wo?(0,Ft.cloneElement)(a,{key:l,onMouseDown:s}):a)})};B("Palette",_r,"view");var Gr=require("@vuu-ui/vuu-utils"),Vt=require("@heswell/salt-lab"),Ur=M(require("classnames"));var Nt=require("react/jsx-runtime"),ma="vuuPalette",da=e=>{let{children:t,ViewProps:o,label:n,onMouseDown:r,template:i,...s}=e,a=Z();return(0,Nt.jsx)(Vt.ListItem,{onMouseDown:c=>{let{left:p,top:m,width:u}=c.currentTarget.getBoundingClientRect(),f=(0,Gr.uuid)(),g=i?t:(0,Nt.jsx)(fe,{...{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})},Xr=({className:e,...t})=>(0,Nt.jsx)(Vt.List,{...t,className:(0,Ur.default)(ma,e),height:"100%",selectionStrategy:"none"});B("PaletteSalt",Xr,"view");var Pe=require("@heswell/salt-lab"),Yr=require("@salt-ds/core"),Jr=M(require("classnames")),ge=M(require("react"));var Be=require("react/jsx-runtime"),Zr="Tabs",fa=()=>{},ha=(e,t)=>{var o,n;return(n=(o=e.props)==null?void 0:o.title)!=null?n:`Tab ${t+1}`},ga=e=>{let t=[];return ge.default.Children.forEach(e,o=>{ge.default.isValidElement(o)?t.push(o):console.warn("Stack has unexpected child element type")}),t},Wt=(0,ge.forwardRef)(function({active:t=0,children:o,className:n,enableAddTab:r,enableCloseTabs:i,getTabIcon:s=fa,getTabLabel:a=ha,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,Yr.useIdMemo)(l),R=C=>{h==null||h(C)},S=C=>{u==null||u(C)},x=()=>{m==null||m(ge.default.Children.count(o))},D=C=>{var X;let k=C.target.closest('[role^="tab"]');if((k==null?void 0:k.getAttribute("role"))==="tab"){let He=parseInt((X=k.dataset.idx)!=null?X:"-1");if(He===-1)throw Error("Stack: mousedown on tab with unknown index");p==null||p(C,He)}},v=(0,ge.useCallback)((C,z,k,Q)=>{f==null||f(Q,z)},[f]),A=()=>{var C;return ge.default.isValidElement(o)?o:Array.isArray(o)&&(C=o[t])!=null?C:null},F=()=>ga(o).map((C,z)=>{let k=`${E}-${z}`,{closeable:Q,id:X}=C.props;return(0,Be.jsx)(Pe.Tab,{ariaControls:`${k}-tab`,"data-icon":s(C,z),draggable:!0,id:k,label:a(C,z),closeable:Q,editable:(d==null?void 0:d.enableRenameTab)!==!1},X!=null?X:z)}),L=A();return(0,Be.jsxs)("div",{className:(0,Jr.default)(Zr,n,{[`${Zr}-horizontal`]:(d==null?void 0:d.orientation)==="vertical"}),style:y,id:E,ref:b,children:[g?(0,Be.jsx)(Pe.Toolbar,{className:"vuuTabHeader vuuHeader",orientation:d==null?void 0:d.orientation,children:(0,Be.jsx)(Pe.ToolbarField,{disableFocusRing:!0,"data-collapsible":"dynamic","data-priority":"3",style:{alignSelf:"flex-end"},children:(0,Be.jsx)(Pe.Tabstrip,{...d,enableRenameTab:(d==null?void 0:d.enableRenameTab)!==!1,enableAddTab:r,enableCloseTab:i,keyBoardActivation:c,onActiveChange:R,onAddTab:x,onCloseTab:S,onExitEditMode:v,onMouseDown:D,activeTabIndex:(H=d==null?void 0:d.activeTabIndex)!=null?H:L===null?-1:t,children:F()})})}):null,L]})});Wt.displayName="Stack";var jr=require("@salt-ds/core"),Gt=M(require("react"));var _t=require("react/jsx-runtime"),ya=e=>(0,_t.jsx)(fe,{resizeable:!0,title:`Tab ${e}`,style:{flexGrow:1,flexShrink:0,flexBasis:0},header:!0,closeable:!0,children:(0,_t.jsx)(mt,{style:{flex:1}})}),_o=e=>{let t=(0,Gt.useRef)(null),o=Z(),{loadState:n}=Ae(),{createNewChild:r=ya,id:i,onTabSelectionChanged:s,path:a,...l}=e,{children:c}=e,p=(0,jr.useIdMemo)(i),[m]=st(p,t,a);return(0,_t.jsx)(Wt,{...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(D=>{console.log("preDragActivity: Ok, gonna release the drag"),R=D})},b)&&(R==null||R(void 0))},onTabAdd:(b,E=Gt.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})};_o.displayName="Stack";B("Stack",_o,"container");var Ge=M(require("react"));var Oe=require("react/jsx-runtime"),ba=({children:e})=>{let[o,n]=(0,Ge.useState)(e),[r,i]=(0,Ge.useState)(e),s=l=>{let c=qt(o,l);i(c)},a=(l,c)=>{console.log(`change ${l} -> ${c}`);let p=Ge.default.cloneElement(r,{style:{...r.props.style,[l]:c}});i(p),n(Ge.default.cloneElement(o,{},p))};return(0,Oe.jsxs)("div",{"data-design-mode":`${!1}`,children:[o,(0,Oe.jsx)("br",{}),(0,Oe.jsxs)("div",{style:{display:"flex"},children:[(0,Oe.jsx)(Go,{height:300,managedStyle:r.props.style,width:300,onChange:a,style:void 0}),(0,Oe.jsx)(Uo,{layout:o,onSelect:s,style:{width:300,height:300,backgroundColor:"#ccc"}})]})]})};var ce=require("@heswell/salt-lab"),I=require("react/jsx-runtime"),Zo={},xa={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"}},Xo=({feature:e,children:t,style:o,onChange:n})=>(0,I.jsxs)("div",{className:`LayoutBox layout-${e} layout-outer`,children:[(0,I.jsxs)("div",{className:"layout-top",children:[(0,I.jsx)("span",{className:"layout-title",children:e}),(0,I.jsx)(ce.FormField,{className:"layout-input",style:{width:30},children:(0,I.jsx)(ce.Input,{value:o.top,onChange:(r,i)=>n(e,"top",i)})})]}),(0,I.jsxs)("div",{className:"layout-inner",children:[(0,I.jsx)("div",{className:"layout-left",children:(0,I.jsx)(ce.FormField,{className:"layout-input",style:{width:30},children:(0,I.jsx)(ce.Input,{value:o.left,onChange:(r,i)=>n(e,"left",i)})})}),t,(0,I.jsx)("div",{className:"layout-right",children:(0,I.jsx)(ce.FormField,{className:"layout-input",style:{width:30},children:(0,I.jsx)(ce.Input,{value:o.right,onChange:(r,i)=>n(e,"right",i)})})})]}),(0,I.jsx)("div",{className:"layout-bottom",children:(0,I.jsx)(ce.FormField,{className:"layout-input",style:{width:30},children:(0,I.jsx)(ce.Input,{value:o.bottom,onChange:(r,i)=>n(e,"bottom",i)})})})]}),Ra={margin:!0,marginTop:!0,marginRight:!0,marginBottom:!0,marginLeft:!0},Ea={padding:!0,paddingTop:!0,paddingRight:!0,paddingBottom:!0,paddingLeft:!0},Sa={border:!0,borderColor:!0,borderWidth:!0,borderTopWidth:!0,borderRightWidth:!0,borderBottomWidth:!0,borderLeftWidth:!0},Ut="(\\d+)(?:px)?",Da=`^(?:${Ut}(?:\\s${Ut}(?:\\s${Ut}(?:\\s${Ut})?)?)?)$`,Kr=new RegExp(Da),Ta=/^(?:(\d+)(?:px)\ssolid\s([a-zA-Z,0-9().]+))$/,Go=({height:e,managedStyle:t,onChange:o,style:n,width:r})=>{let i=qr(t),s=(E,R,S)=>{let x=parseInt(S||"0",10),D=xa[E][R];o(D,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,I.jsx)("div",{className:"LayoutConfigurator",style:{width:r,height:e,...n},children:(0,I.jsx)(Xo,{feature:"margin",style:{top:a,right:l,bottom:c,left:p},onChange:s,children:(0,I.jsx)(Xo,{feature:"border",style:{top:m,right:u,bottom:f,left:h},onChange:s,children:(0,I.jsx)(Xo,{feature:"padding",style:{top:g,right:y,bottom:d,left:b},onChange:s,children:(0,I.jsx)("div",{className:"layout-content"})})})})})};function wa(e=Zo,t=Zo){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=Kr.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=Kr.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),qr(u,t)}function qr(e=Zo){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=Ta.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 D=`
|
|
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:D}}else return t}var Qr=M(require("react")),ei=M(require("classnames"));var ti=require("@heswell/salt-lab"),Yo=require("react/jsx-runtime"),Pa="hwLayoutTreeViewer",oi=(e,t="0")=>({label:P(e),path:t,childNodes:Qr.default.Children.map(e.props.children,(o,n)=>oi(o,t?`${t}.${n}`:`${n}`))}),Uo=({layout:e,onSelect:t,style:o})=>{let n=[oi(e)],r=(i,[{path:s}])=>{t(s)};return(0,Yo.jsx)("div",{className:(0,ei.default)(Pa),style:o,children:(0,Yo.jsx)(ti.Tree,{source:n,groupSelection:"single",onSelectionChange:r})})};
|
|
20
|
+
//# sourceMappingURL=index.js.map
|