@imagineio/configurator-sdk 0.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +294 -0
- package/README.md +103 -0
- package/dist/00a41227ff.js +1 -0
- package/dist/00ab3dcbb5.js +1 -0
- package/dist/01a664fa9f.css +51 -0
- package/dist/04746bff9a.js +1 -0
- package/dist/04931f795e.js +1 -0
- package/dist/05973a4da2.js +3 -0
- package/dist/061b81ad81.js +1 -0
- package/dist/066fc9aa40.js +1 -0
- package/dist/09c4973968.js +1 -0
- package/dist/0a35b2c5f4.js +1 -0
- package/dist/0af28430ab.js +1 -0
- package/dist/0e2dedae0d.js +1 -0
- package/dist/0f7c8345a8.js +1 -0
- package/dist/12b8165d6d.js +1 -0
- package/dist/1458417bdb.js +1 -0
- package/dist/14c83bc57a.js +1 -0
- package/dist/15d6bec3b5.css +150 -0
- package/dist/16a399703e.js +1 -0
- package/dist/17876f4322.css +114 -0
- package/dist/1870fc037b.js +1 -0
- package/dist/1a2629800a.css +196 -0
- package/dist/1e243363f6.js +1 -0
- package/dist/1fac915f8b.js +1 -0
- package/dist/1fff100656.js +1 -0
- package/dist/205827c5c8.js +1 -0
- package/dist/20b0104576.js +1 -0
- package/dist/2239b22616.js +1 -0
- package/dist/22bd38ddcf.js +1 -0
- package/dist/239b619005.css +1849 -0
- package/dist/23dc0ccf32.js +1 -0
- package/dist/26155bf68c.js +1 -0
- package/dist/2774152dd2.js +1 -0
- package/dist/27fee7007f.js +1 -0
- package/dist/281cf952fa.js +1 -0
- package/dist/28a9d58274.js +1 -0
- package/dist/28d887bf8a.js +1 -0
- package/dist/28df2aa12f.js +1 -0
- package/dist/297e653adf.js +1 -0
- package/dist/2990ba64d6.js +1 -0
- package/dist/2b6aa27f6d.js +1 -0
- package/dist/2c7c1bcef1.js +1 -0
- package/dist/2cab5c5c23.js +1 -0
- package/dist/2cafe3274b.js +1 -0
- package/dist/2e366d7386.js +1 -0
- package/dist/2f8cc8b292.js +1 -0
- package/dist/30be653f00.css +110 -0
- package/dist/31ea036f5c.js +1 -0
- package/dist/32861ea2b0.js +1 -0
- package/dist/33fa2c8ca2.js +1 -0
- package/dist/35d8449ed8.js +1 -0
- package/dist/3656ffa1b8.js +1 -0
- package/dist/367a479d3a.js +1 -0
- package/dist/371ed78aa2.js +1 -0
- package/dist/37596ace72.js +1 -0
- package/dist/37addc7fb3.js +1 -0
- package/dist/388cadacbd.js +1 -0
- package/dist/39a62ef7b8.js +1 -0
- package/dist/3bbcee0334.js +1 -0
- package/dist/3c916f744f.js +1 -0
- package/dist/3f37665dd1.js +1 -0
- package/dist/3fb3ab6757.js +1 -0
- package/dist/40d6aeb28c.js +1 -0
- package/dist/41ed5985ad.js +1 -0
- package/dist/431a2d8618.js +1 -0
- package/dist/44a229099f.js +1 -0
- package/dist/4741e5d07d.css +263 -0
- package/dist/4910c07ca8.css +411 -0
- package/dist/4a99ddb3fd.js +1 -0
- package/dist/4aa671f9f6.js +1 -0
- package/dist/4b8958aa4c.js +1 -0
- package/dist/4ba4f544b9.js +1 -0
- package/dist/4c24338793.js +1 -0
- package/dist/4d7a0d1897.js +1 -0
- package/dist/4e1db1e3b0.js +1 -0
- package/dist/4e7d0a0d4a.js +1 -0
- package/dist/51b23203e5.css +1447 -0
- package/dist/52436e0169.js +1 -0
- package/dist/54413c1eae.js +1 -0
- package/dist/54f0fcf38b.js +1 -0
- package/dist/55ab45ada4.css +370 -0
- package/dist/561dc3f1ab.js +1 -0
- package/dist/58e6419ba8.js +1 -0
- package/dist/5c9fd9201c.js +1 -0
- package/dist/5d05e8982e.js +1 -0
- package/dist/5d5e8a9c58.js +3 -0
- package/dist/5e4f2349ff.js +1 -0
- package/dist/609e5e5d28.js +1 -0
- package/dist/60d697292c.js +1 -0
- package/dist/61e0c0c9b5.js +1 -0
- package/dist/631a9f7fac.js +1 -0
- package/dist/64e9020b49.js +1 -0
- package/dist/66c461dc2c.js +1 -0
- package/dist/672404d987.js +1 -0
- package/dist/67f6338a4a.js +1 -0
- package/dist/6855e6a3b1.js +1 -0
- package/dist/6b0a81e4f8.js +1 -0
- package/dist/6ba86aa3b8.js +1 -0
- package/dist/6bff84d27e.js +1 -0
- package/dist/6c0a2572dd.js +1 -0
- package/dist/6d238282c1.js +1 -0
- package/dist/6e2595aa36.js +1 -0
- package/dist/6f9ae59d6c.js +1 -0
- package/dist/70dd811d74.js +1 -0
- package/dist/710c1ab641.js +1 -0
- package/dist/7206ce49c6.js +1 -0
- package/dist/7281d77ed9.js +1 -0
- package/dist/73f7d65985.js +1 -0
- package/dist/776277593f.js +1 -0
- package/dist/79a397bb92.js +1 -0
- package/dist/7a748aae59.js +1 -0
- package/dist/7bfb0ecfbb.css +572 -0
- package/dist/7bfcd0a517.js +1 -0
- package/dist/7d9ddaeb47.js +1 -0
- package/dist/7f833bc5af.js +1 -0
- package/dist/811b403d43.js +1 -0
- package/dist/817d930a49.js +1 -0
- package/dist/81802759ca.js +1 -0
- package/dist/81eb433604.js +1 -0
- package/dist/82a8a4bc35.js +1 -0
- package/dist/85af90fade.js +1 -0
- package/dist/872c4302e0.js +1 -0
- package/dist/87bb469216.js +1 -0
- package/dist/87dcc12b65.js +1 -0
- package/dist/87f511c4a8.js +1 -0
- package/dist/88251d6671.js +1 -0
- package/dist/882bc739c8.js +1 -0
- package/dist/89ab18ebc5.js +1 -0
- package/dist/8a22e8944f.css +563 -0
- package/dist/8a3a57c008.js +1 -0
- package/dist/8ade32d067.js +1 -0
- package/dist/8bf6d26ad6.css +233 -0
- package/dist/8c27edda0f.js +1 -0
- package/dist/8db8655f21.js +24 -0
- package/dist/8f60e5059a.js +1 -0
- package/dist/91707f5ca0.css +78 -0
- package/dist/921bf270dd.js +20 -0
- package/dist/9326c23506.js +1 -0
- package/dist/94a0a79c65.js +1 -0
- package/dist/9526094bb7.js +1 -0
- package/dist/9544661159.js +1 -0
- package/dist/95a44ebec2.js +1 -0
- package/dist/970313b92b.js +1 -0
- package/dist/9794652102.js +1 -0
- package/dist/983cbed22c.js +1 -0
- package/dist/9840b9ce12.js +1 -0
- package/dist/98f3644031.js +1 -0
- package/dist/992778075d.css +353 -0
- package/dist/9c6c598569.js +1 -0
- package/dist/9f474b5d1a.js +1 -0
- package/dist/a0f71d0bf5.js +1 -0
- package/dist/a3c983d431.js +1 -0
- package/dist/a3f18e76fe.js +1 -0
- package/dist/a493e9aa8f.js +1 -0
- package/dist/a77b15c0d6.js +1 -0
- package/dist/a811c90bd5.js +1 -0
- package/dist/a822c5e4f2.js +1 -0
- package/dist/aaa0e82d7f.css +69 -0
- package/dist/ab6c80484f.js +1 -0
- package/dist/ae96f219e3.js +1 -0
- package/dist/b11b38869d.css +427 -0
- package/dist/b1349d5a21.js +4 -0
- package/dist/b14379d31b.css +151 -0
- package/dist/b3efb26fd7.js +1 -0
- package/dist/b59b0dde17.js +1 -0
- package/dist/b5c372377f.js +1 -0
- package/dist/b976df09ec.js +1 -0
- package/dist/baeaed46c9.js +1 -0
- package/dist/bb719febc6.js +1 -0
- package/dist/bcd44b4040.js +1 -0
- package/dist/bdc4e4c5b9.css +209 -0
- package/dist/bdec200d00.js +1 -0
- package/dist/be0cfe2236.js +1 -0
- package/dist/be337ddda5.js +1 -0
- package/dist/c12c112c6f.js +1 -0
- package/dist/c2a14a77ae.js +1 -0
- package/dist/c3b8f1973b.js +1 -0
- package/dist/c44d37da7a.js +1 -0
- package/dist/c4790179f1.js +1 -0
- package/dist/c5e990946e.js +1 -0
- package/dist/c71892453b.js +1 -0
- package/dist/c9a1656c62.js +1 -0
- package/dist/ca497b066c.js +1 -0
- package/dist/cdb4a0f7b3.js +3 -0
- package/dist/ce663020e4.js +60 -0
- package/dist/cec035efb1.js +1 -0
- package/dist/d0f9681634.js +1 -0
- package/dist/d118c2e7ba.js +1 -0
- package/dist/d20718159b.js +3 -0
- package/dist/d30f1f506e.js +1 -0
- package/dist/d3cd7f1bc1.js +1 -0
- package/dist/d4378d9afa.js +1 -0
- package/dist/d464da28a5.js +1 -0
- package/dist/d566d3874b.js +1 -0
- package/dist/d617bbb9f5.js +26 -0
- package/dist/d65f32e004.js +1 -0
- package/dist/d6851ea979.js +1 -0
- package/dist/d7c9500ba9.js +1 -0
- package/dist/d803155241.js +1 -0
- package/dist/d903df4e0d.js +1 -0
- package/dist/d94df858ea.js +1 -0
- package/dist/da7b5f450d.js +1 -0
- package/dist/daa11edd01.js +1 -0
- package/dist/db4afd43c9.js +1 -0
- package/dist/dbd5ba1d07.js +1 -0
- package/dist/dc2a1a0e13.js +1 -0
- package/dist/dc812f3e14.js +1 -0
- package/dist/dcbf419090.css +122 -0
- package/dist/dcdba78ddf.js +1 -0
- package/dist/de408c4516.js +1 -0
- package/dist/e1cd279733.js +1 -0
- package/dist/e379e0039b.js +1 -0
- package/dist/e4fe0551fd.js +1 -0
- package/dist/e6eed481cc.css +28 -0
- package/dist/e75f1e5992.js +1 -0
- package/dist/ea8577d22b.js +1 -0
- package/dist/ec4a34fc80.css +313 -0
- package/dist/ed6a54cdf6.js +1 -0
- package/dist/ee242c0099.js +1 -0
- package/dist/ee9b9fd7d1.js +1 -0
- package/dist/f0c3d8a28a.js +1 -0
- package/dist/f11a45a150.js +1 -0
- package/dist/f1b3b2622a.js +1 -0
- package/dist/f7b4a178e3.js +1 -0
- package/dist/f89d7cd931.js +1 -0
- package/dist/f8cb80a93c.js +1 -0
- package/dist/f8fec86f10.js +1 -0
- package/dist/fbd844f2d1.js +1 -0
- package/dist/fe235d7160.js +1 -0
- package/dist/fe58a84b85.js +1 -0
- package/dist/fe68b361ba.js +1 -0
- package/dist/ff5b3d17e2.js +1 -0
- package/dist/styles/globals.css +442 -0
- package/dist/styles/themes.css +532 -0
- package/dist/styles/variables.css +299 -0
- package/package.json +68 -0
- package/static/assets/draco/README.md +32 -0
- package/static/assets/draco/draco_decoder.js +34 -0
- package/static/assets/draco/draco_decoder.wasm +0 -0
- package/static/assets/draco/draco_encoder.js +35 -0
- package/static/assets/draco/draco_encoder.wasm +0 -0
- package/static/assets/draco/draco_encoder_wrapper.js +98 -0
- package/static/assets/draco/draco_wasm_wrapper.js +117 -0
- package/static/favicon.svg +28 -0
- package/static/version.txt +1 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
@layer sdk-base, vendor, sdk;
|
|
2
|
+
@layer sdk {
|
|
3
|
+
/**
|
|
4
|
+
* SelectionActionPanel styles — self-contained in the SDK so the panel is
|
|
5
|
+
* positioned + styled wherever it's used (the shared canvas, any configurator),
|
|
6
|
+
* not only where SceneCanvas.css happens to be imported. The overlay is absolutely
|
|
7
|
+
* positioned at the bottom-center of the nearest positioned ancestor (the
|
|
8
|
+
* `.scene-canvas` wrapper SceneStage provides), so it floats over the scene.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
.selection-options-panel {
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
gap: var(--spacing-sm, 8px);
|
|
15
|
+
background: rgba(255, 255, 255, 0.98);
|
|
16
|
+
border-radius: var(--radius-full, 9999px);
|
|
17
|
+
padding: var(--spacing-sm, 8px) var(--spacing-lg, 16px);
|
|
18
|
+
box-shadow: var(--shadow-xl, 0 10px 30px rgba(0, 0, 0, 0.18)), 0 0 0 1px rgba(0, 0, 0, 0.05);
|
|
19
|
+
animation: panelFadeIn 0.2s ease-out;
|
|
20
|
+
white-space: nowrap;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* 3D-positioned panel (rendered via Html from drei) */
|
|
24
|
+
.selection-options-panel--3d {
|
|
25
|
+
position: relative;
|
|
26
|
+
transform: translateX(-50%);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* Fixed overlay panel at bottom center of scene */
|
|
30
|
+
.selection-panel-overlay {
|
|
31
|
+
position: absolute;
|
|
32
|
+
bottom: 24px;
|
|
33
|
+
left: 50%;
|
|
34
|
+
transform: translateX(-50%);
|
|
35
|
+
z-index: 50;
|
|
36
|
+
pointer-events: auto;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.selection-panel-overlay .selection-options-panel {
|
|
40
|
+
animation: overlayPanelFadeIn 0.2s ease-out;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.main-layout--mobile .selection-panel-overlay {
|
|
44
|
+
bottom: 2px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.main-layout--mobile .selection-options-panel {
|
|
48
|
+
padding: 4px;
|
|
49
|
+
gap: 4px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.main-layout--mobile .selection-options-panel__btn {
|
|
53
|
+
width: 30px;
|
|
54
|
+
height: 30px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.main-layout--mobile .selection-options-panel__btn svg {
|
|
58
|
+
width: 16px;
|
|
59
|
+
height: 16px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@keyframes overlayPanelFadeIn {
|
|
63
|
+
from { opacity: 0; transform: translateY(10px); }
|
|
64
|
+
to { opacity: 1; transform: translateY(0); }
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@keyframes panelFadeIn {
|
|
68
|
+
from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
|
|
69
|
+
to { opacity: 1; transform: translateX(-50%) translateY(0); }
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* Per-piece price chip (backend placementPricing[pid]). Sits at the left of the
|
|
73
|
+
action row; hovering/focusing it reveals the adjustments breakdown popover. */
|
|
74
|
+
.selection-options-panel__price {
|
|
75
|
+
position: relative;
|
|
76
|
+
display: flex;
|
|
77
|
+
align-items: center;
|
|
78
|
+
padding: 0 10px 0 4px;
|
|
79
|
+
margin-right: 2px;
|
|
80
|
+
border-right: 1px solid var(--color-neutral-200, #e4e4e7);
|
|
81
|
+
cursor: default;
|
|
82
|
+
outline: none;
|
|
83
|
+
}
|
|
84
|
+
.selection-options-panel__price-value {
|
|
85
|
+
font-size: 14px;
|
|
86
|
+
font-weight: 700;
|
|
87
|
+
color: var(--color-neutral-900, #18181b);
|
|
88
|
+
white-space: nowrap;
|
|
89
|
+
}
|
|
90
|
+
.selection-options-panel__price-breakdown {
|
|
91
|
+
position: absolute;
|
|
92
|
+
bottom: calc(100% + 12px);
|
|
93
|
+
left: 0;
|
|
94
|
+
min-width: 190px;
|
|
95
|
+
max-width: 280px;
|
|
96
|
+
background: var(--bg-tooltip, #18181b);
|
|
97
|
+
color: var(--text-inverse, #fff);
|
|
98
|
+
border-radius: 8px;
|
|
99
|
+
padding: 8px 10px;
|
|
100
|
+
font-size: 12px;
|
|
101
|
+
box-shadow: var(--shadow-md, 0 6px 18px rgba(0, 0, 0, 0.22));
|
|
102
|
+
opacity: 0;
|
|
103
|
+
visibility: hidden;
|
|
104
|
+
transform: translateY(4px);
|
|
105
|
+
transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
|
|
106
|
+
z-index: var(--z-tooltip, 1000);
|
|
107
|
+
white-space: normal;
|
|
108
|
+
}
|
|
109
|
+
.selection-options-panel__price:hover .selection-options-panel__price-breakdown,
|
|
110
|
+
.selection-options-panel__price:focus .selection-options-panel__price-breakdown,
|
|
111
|
+
.selection-options-panel__price:focus-within .selection-options-panel__price-breakdown {
|
|
112
|
+
opacity: 1;
|
|
113
|
+
visibility: visible;
|
|
114
|
+
transform: translateY(0);
|
|
115
|
+
}
|
|
116
|
+
.selection-options-panel__price-row {
|
|
117
|
+
display: flex;
|
|
118
|
+
align-items: baseline;
|
|
119
|
+
justify-content: space-between;
|
|
120
|
+
gap: 14px;
|
|
121
|
+
padding: 2px 0;
|
|
122
|
+
}
|
|
123
|
+
.selection-options-panel__price-label { opacity: 0.85; }
|
|
124
|
+
.selection-options-panel__price-amount { font-variant-numeric: tabular-nums; font-weight: 600; }
|
|
125
|
+
|
|
126
|
+
.main-layout--mobile .selection-options-panel__price { padding: 0 7px 0 3px; }
|
|
127
|
+
.main-layout--mobile .selection-options-panel__price-value { font-size: 12px; }
|
|
128
|
+
|
|
129
|
+
.selection-options-panel__btn {
|
|
130
|
+
position: relative;
|
|
131
|
+
display: flex;
|
|
132
|
+
align-items: center;
|
|
133
|
+
justify-content: center;
|
|
134
|
+
width: 40px;
|
|
135
|
+
height: 40px;
|
|
136
|
+
border: none;
|
|
137
|
+
background: var(--bg-secondary, #f1f1f3);
|
|
138
|
+
border-radius: var(--radius-circle, 50%);
|
|
139
|
+
cursor: pointer;
|
|
140
|
+
color: var(--color-neutral-700, #3f3f46);
|
|
141
|
+
transition: all var(--transition-fast, 0.15s ease);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.selection-options-panel__btn:hover {
|
|
145
|
+
background: var(--color-neutral-100, #f4f4f5);
|
|
146
|
+
color: var(--color-neutral-800, #27272a);
|
|
147
|
+
transform: scale(1.05);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.selection-options-panel__btn:active {
|
|
151
|
+
transform: scale(0.95);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.selection-options-panel__btn svg {
|
|
155
|
+
width: 20px;
|
|
156
|
+
height: 20px;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/* Delete button */
|
|
160
|
+
.selection-options-panel__btn--delete {
|
|
161
|
+
color: var(--color-neutral-400, #a1a1aa);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.selection-options-panel__btn--delete:hover:not(.selection-options-panel__btn--disabled) {
|
|
165
|
+
background: var(--color-danger-bg, #fee2e2);
|
|
166
|
+
color: var(--color-danger, #dc2626);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/* Disabled button — color changes (not opacity) so the tooltip stays visible */
|
|
170
|
+
.selection-options-panel__btn--disabled {
|
|
171
|
+
cursor: not-allowed;
|
|
172
|
+
background: var(--color-neutral-100, #f4f4f5);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.selection-options-panel__btn--disabled svg {
|
|
176
|
+
color: var(--color-neutral-disabled, #d4d4d8);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.selection-options-panel__btn--disabled:hover {
|
|
180
|
+
background: var(--color-neutral-100, #f4f4f5);
|
|
181
|
+
transform: none;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.selection-options-panel__btn--disabled:hover svg {
|
|
185
|
+
color: var(--color-neutral-disabled, #d4d4d8);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/* Tooltip */
|
|
189
|
+
.selection-options-panel__tooltip {
|
|
190
|
+
position: absolute;
|
|
191
|
+
bottom: calc(100% + 10px);
|
|
192
|
+
left: 50%;
|
|
193
|
+
transform: translateX(-50%);
|
|
194
|
+
background: var(--bg-tooltip, #18181b);
|
|
195
|
+
color: var(--text-inverse, #fff);
|
|
196
|
+
padding: var(--tooltip-padding, 4px 8px);
|
|
197
|
+
border-radius: var(--tooltip-border-radius, 6px);
|
|
198
|
+
font-size: var(--tooltip-font-size, 12px);
|
|
199
|
+
font-weight: var(--font-weight-medium, 500);
|
|
200
|
+
white-space: nowrap;
|
|
201
|
+
opacity: 0;
|
|
202
|
+
visibility: hidden;
|
|
203
|
+
transition: opacity var(--transition-fast, 0.15s ease), visibility var(--transition-fast, 0.15s ease);
|
|
204
|
+
pointer-events: none;
|
|
205
|
+
z-index: var(--z-tooltip, 1000);
|
|
206
|
+
box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.15));
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.selection-options-panel__tooltip::after {
|
|
210
|
+
content: '';
|
|
211
|
+
position: absolute;
|
|
212
|
+
top: 100%;
|
|
213
|
+
left: 50%;
|
|
214
|
+
transform: translateX(-50%);
|
|
215
|
+
border: 6px solid transparent;
|
|
216
|
+
border-top-color: var(--bg-tooltip, #18181b);
|
|
217
|
+
border-bottom: none;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.selection-options-panel__btn:hover .selection-options-panel__tooltip {
|
|
221
|
+
opacity: 1;
|
|
222
|
+
visibility: visible;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.selection-options-panel__tooltip--warning {
|
|
226
|
+
background: var(--tooltip-warning-bg, #b45309);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.selection-options-panel__tooltip--warning::after {
|
|
230
|
+
border-top-color: var(--tooltip-warning-bg, #b45309);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=Object.freeze({ADD:"add",SWAP_VARIANT:"swap_variant",SWAP_COMPONENT:"swap_component",FINISH:"finish",OTHER:"other"});function o(n,{productSelected:r=!1}={}){const t=n?.type;return t==="finish_change"?e.FINISH:t==="load_new_component"?e.SWAP_COMPONENT:t==="product_change"?e.SWAP_VARIANT:t==="load_new_product"?r?e.SWAP_VARIANT:e.ADD:e.OTHER}function A(n,r){return o(n,r)===e.ADD}export{e as FEATURE_ACTIONS,A as isAddFeature,o as resolveFeatureAction};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import{jsx as C}from"react/jsx-runtime";import{useEffect as d,useLayoutEffect as w,useRef as x,useState as m,useSyncExternalStore as v}from"react";import{subscribeWatermark as O,getWatermarkShown as g}from"./d3cd7f1bc1.js";import h from"./8f60e5059a.js";import{LOGO_SVG_INNER as S,LOGO_VIEWBOX as b,LOGO_ASPECT as L}from"./b3efb26fd7.js";const M="https://configurator-platform.imagine.io/",_=400,r=10,R={position:"absolute",display:"block",visibility:"visible",opacity:"1","pointer-events":"auto","z-index":"2147483646",transform:"none","clip-path":"none",filter:"none",width:"auto",height:"auto",margin:"0"},E=`
|
|
2
|
+
:host { all: initial; }
|
|
3
|
+
.pill {
|
|
4
|
+
display: inline-flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
gap: 6px;
|
|
7
|
+
padding: 5px 11px 5px 12px;
|
|
8
|
+
border-radius: 999px;
|
|
9
|
+
background: linear-gradient(135deg, rgba(26, 26, 34, 0.88), rgba(14, 14, 18, 0.80));
|
|
10
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
|
|
11
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
12
|
+
font-size: 11.5px;
|
|
13
|
+
line-height: 1;
|
|
14
|
+
white-space: nowrap;
|
|
15
|
+
text-decoration: none;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
}
|
|
18
|
+
.by { color: rgba(255, 255, 255, 0.72); font-weight: 400; }
|
|
19
|
+
svg { display: block; flex: 0 0 auto; }
|
|
20
|
+
`;function k(n){const i=document.createElement("style");i.textContent=E;const t=document.createElement("a");t.className="pill",t.href=M,t.target="_blank",t.rel="noopener noreferrer",t.setAttribute("aria-label","Powered by imagine.io \u2014 open the configurator platform");const s=12;t.innerHTML=`
|
|
21
|
+
<span class="by">Powered by</span>
|
|
22
|
+
<svg width="${Math.round(s*L)}" height="${s}"
|
|
23
|
+
viewBox="0 0 ${b.width} ${b.height}"
|
|
24
|
+
role="img" aria-label="imagine.io">${S}</svg>`,n.replaceChildren(i,t)}function A(n){const i=n?.parentElement;if(!i)return null;const t=i.getBoundingClientRect();if(!(t.width>0))return null;const o=document.querySelector(".header__toolbar, .mobile-toolbar")?.getBoundingClientRect(),e=n.offsetWidth||150,f=n.offsetHeight||26,a={left:Math.max(r,t.width-e-r),top:r};if(o&&o.width>0&&o.height>0){if(o.height>o.width*1.5)return a;const p=Math.min(Math.max(r,o.top-t.top+(o.height-f)/2),Math.max(r,t.height-f-r)),u=o.left-t.left-e-r;if(u>=r)return{left:u,top:p};const l=o.right-t.left+r;return l+e+r<=t.width?{left:l,top:p}:a}return a}const I=8e3;function P(){const n=h(e=>e.bootLoading),i=h(e=>e.modalOpen),t=h(e=>e.isLayoutLoading),[s,o]=m(!1);return d(()=>{n||o(!0)},[n]),d(()=>{const e=setTimeout(()=>o(!0),I);return()=>clearTimeout(e)},[]),s&&!i&&!t}function T(){const n=v(O,g,g),i=P(),t=n&&i,s=x(null),[,o]=m(0);return w(()=>{if(!t)return;const e=s.current;if(!e)return;const f=()=>{for(const[l,y]of Object.entries(R))e.style.setProperty(l,y,"important")};f();let a=e.shadowRoot;if(!a)try{a=e.attachShadow({mode:"open"})}catch{a=null}a&&k(a);const c=()=>{const l=A(e);l&&(e.style.setProperty("left",`${Math.round(l.left)}px`,"important"),e.style.setProperty("top",`${Math.round(l.top)}px`,"important"))};c();const p=setInterval(c,_);let u=null;try{u=new MutationObserver(()=>{f(),c()}),u.observe(e,{attributes:!0,attributeFilter:["style","class"]})}catch{}return window.addEventListener("resize",c),()=>{clearInterval(p),u?.disconnect(),window.removeEventListener("resize",c)}},[t]),d(()=>{t&&o(e=>e+1)},[t]),t?C("div",{ref:s,className:"sdk-brand-mark","data-part":"brand-mark"}):null}export{T as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{HOSTED_PLACEMENT_ID_PREFIX as V}from"./23dc0ccf32.js";import{create as k}from"zustand";import{devtools as E}from"./52436e0169.js";import R from"./d94df858ea.js";import T from"./872c4302e0.js";import{productRefsMatch as C,pieceKindOf as U}from"./9326c23506.js";import{getHostedProductShapeSuffix as j}from"./70dd811d74.js";let $=0;const L=()=>{const t=typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,p=>{const e=Math.random()*16|0;return(p==="x"?e:e&3|8).toString(16)});return`${V}${t}`},K=k(E((t,p)=>({guiVisible:!0,regions:{sidebar:!0,header:!0,toolbar:!0,panels:!0,chat:!0,notifications:!0},ownsSceneGraph:!1,sidebarOpen:!0,sidebarTab:"features",jsonPanelOpen:!0,chatPanelOpen:!1,debugPanelOpen:!1,activeModal:null,modalData:null,modalOpen:!1,notifications:[],constraintWarnings:[],inlineMessages:[],messageModal:null,isExporting:!1,isSharing:!1,isSceneLoading:!1,sceneLoadingMessage:"",isLayoutLoading:!1,isEvaluating:!1,isMobile:!1,mobileMenuOpen:!1,mobileActiveAccordion:"configurator",isLandscapeMode:!1,landscapeMethod:null,landscapeSidebarOpen:!0,liveStatusSummary:"",initialSceneLoading:!1,bootEvaluating:!1,bootLoading:!0,bootProgress:null,bootDetail:"",themeReady:!1,setBootPhase:(e,o=null)=>t(n=>n.bootDetail===e&&n.bootProgress===o?n:{bootDetail:e,bootProgress:o}),endBootLoading:()=>t(e=>e.bootLoading?{bootLoading:!1}:e),is3D:!0,showDimensions:!1,showWalls:!0,showFloor:!1,showCeiling:!1,wallOverflowDetected:!1,pieceOverlapDetected:!1,tallWallOverlapDetected:!1,wallPieceOverlapDetected:!1,wallPieceHostedOverlapDetected:!1,skipWallPieceOverlapCheck:!0,overlappingPieces:[],highlightOverlappingPieces:!0,islandOverlapDetected:!1,cornerOverflowDetected:!1,wallOverflowSide:null,wallOverflowRecenterMode:!1,wallOverflowSuppressUntil:0,showWallGuide:!1,captureMode:!1,showOptionLabels:!1,theme:"light",freePieceTier:"single",freePieceWidthOption:"6ft",freePiecePosition:null,freePieceRotation:null,selectedFeatureId:null,selectedElementType:null,selectedPieceIndex:null,hostFinishes:{},hostMaterials:{},hostWidths:{},hostDoorTypes:{},hostStyles:{},sceneCapabilities:{dimensions:!0,walls:!0},globals:{},disabledOptions:new Set,hiddenOptions:new Set,currentVisibleOptionSets:null,managedOptionSets:new Set,featureToOptionsMap:{},hostHardwareFinishes:{},hostHandleTypes:{},hostProductOverrides:{},hostMaterialOverrides:{},sceneHostedProducts:[],pendingHostedProduct:null,showHostedProductSlots:!1,pendingSlotPlacement:null,pendingAutoPlacePieceIdx:null,deferredHostedProductPlacement:null,pendingPieceAdd:null,pendingPieceAddQueue:[],pendingPieceDelete:null,disabledWalls:[],currentLayoutType:"single_wall",currentPerpendicularWalls:[],validCornerSlots:[],pendingWallCornerAdd:null,wallCornerCount:0,validWallCornerSlots:[],occupiedPieceSlots:{},pieceConfigSnapshot:null,initialPieceConfigSnapshot:null,initialPerPieceOverrides:null,_snapshotOverridesOnLoadComplete:!1,basePiecePositions:{},sceneModelTransforms:[],setGuiVisible:e=>t({guiVisible:e}),setRegions:e=>t(o=>({regions:{...o.regions,...e&&typeof e=="object"?e:{}}})),toggleSidebar:()=>{t(e=>({sidebarOpen:!e.sidebarOpen}))},setSidebarOpen:e=>{t({sidebarOpen:e})},closeSidebar:()=>{t({sidebarOpen:!1})},openSidebar:()=>{t({sidebarOpen:!0})},setSidebarTab:e=>{t({sidebarTab:e})},setMobileActiveAccordion:e=>{t({mobileActiveAccordion:e})},toggleMobileAccordion:e=>{t(o=>({mobileActiveAccordion:o.mobileActiveAccordion===e?null:e}))},setLandscapeMode:(e,o=null)=>{t({isLandscapeMode:e,landscapeMethod:e?o:null})},toggleLandscapeSidebar:()=>{t(e=>({landscapeSidebarOpen:!e.landscapeSidebarOpen}))},setLiveStatusSummary:e=>{t({liveStatusSummary:e})},toggleView:()=>{t(e=>({is3D:!e.is3D}))},toggleDimensions:()=>{t(e=>({showDimensions:!e.showDimensions}))},toggleWalls:()=>{t(e=>({showWalls:!e.showWalls}))},toggleFloor:()=>{t(e=>({showFloor:!e.showFloor}))},toggleCeiling:()=>{t(e=>({showCeiling:!e.showCeiling}))},toggleOptionLabels:()=>{t(e=>({showOptionLabels:!e.showOptionLabels}))},toggleJsonPanel:()=>{t(e=>({jsonPanelOpen:!e.jsonPanelOpen}))},setJsonPanelOpen:e=>{t({jsonPanelOpen:e})},toggleChatPanel:()=>{t(e=>({chatPanelOpen:!e.chatPanelOpen}))},setChatPanelOpen:e=>{t({chatPanelOpen:e})},toggleDebugPanel:()=>{t(e=>({debugPanelOpen:!e.debugPanelOpen}))},setDebugPanelOpen:e=>{t({debugPanelOpen:e})},openModal:(e,o=null)=>{t({activeModal:e,modalData:o,modalOpen:!0})},closeModal:()=>{t({activeModal:null,modalData:null,modalOpen:!1})},addNotification:e=>{if(p().isLayoutLoading)return null;const o={type:"info",duration:5e3,...e},n=p().notifications.find(c=>c.type===o.type&&(c.title??"")===(o.title??"")&&c.message===o.message);if(n)return n.id;const s=`${Date.now()}-${++$}`,r={id:s,...o};return t(c=>({notifications:[...c.notifications,r]})),r.duration>0&&setTimeout(()=>{p().removeNotification(s)},r.duration),s},removeNotification:e=>{t(o=>({notifications:o.notifications.filter(n=>n.id!==e)}))},clearNotifications:()=>{t({notifications:[]})},setConstraintWarnings:e=>{t({constraintWarnings:Array.isArray(e)?e:[]})},setInlineMessages:e=>{t({inlineMessages:Array.isArray(e)?e:[]})},lastModalKeys:[],setMessageModal:e=>{t({messageModal:e??null})},dismissMessageModal:()=>{t({messageModal:null})},setExporting:e=>{t({isExporting:e})},setSharing:e=>{t({isSharing:e})},setSceneLoading:(e,o="")=>{t({isSceneLoading:e,sceneLoadingMessage:o})},clearSceneLoading:()=>{const e=p()._snapshotOverridesOnLoadComplete;t({isSceneLoading:!1,sceneLoadingMessage:""}),e&&(p().setInitialPerPieceOverrides(),t({_snapshotOverridesOnLoadComplete:!1,isLayoutLoading:!1,selectedFeatureId:null,selectedElementType:null,selectedPieceIndex:null}),import("./1fac915f8b.js").then(o=>o.default.getState().clearHistory()))},setIsMobile:e=>{t({isMobile:e})},toggleMobileMenu:()=>{t(e=>({mobileMenuOpen:!e.mobileMenuOpen}))},setMobileMenuOpen:e=>{t({mobileMenuOpen:e})},setTheme:e=>{t({theme:e}),document.documentElement.setAttribute("data-theme",e)},toggleTheme:()=>{const e=p().theme==="light"?"dark":"light";t({theme:e}),document.documentElement.setAttribute("data-theme",e)},setFreePieceTier:e=>t({freePieceTier:e}),setFreePieceWidthOption:e=>t({freePieceWidthOption:e}),setFreePiecePosition:e=>t({freePiecePosition:e}),setFreePieceRotation:e=>t({freePieceRotation:e}),resetFreePiece:()=>t({freePieceTier:"single",freePieceWidthOption:"6ft",freePiecePosition:null,freePieceRotation:null}),setSelectedFeature:(e,o=null)=>{t({selectedFeatureId:e,selectedElementType:o})},setSelectedPieceIndex:e=>{const o=p().selectedPieceIndex;t({selectedPieceIndex:e});const n=c=>{if(c==null)return null;const l=p().hostProductOverrides?.[c];return l??p().basePiecePositions?.[c]?.productId??null},s=n(o),r=n(e);String(s)!==String(r)&&t({currentVisibleOptionSets:null})},clearSelectedFeature:()=>{t({selectedFeatureId:null,selectedElementType:null,selectedPieceIndex:null})},setHostFinish:(e,o,n)=>{t(s=>({hostFinishes:{...s.hostFinishes,[e]:o},hostMaterials:{...s.hostMaterials,[e]:n}}))},clearHostFinishes:()=>{t({hostFinishes:{},hostMaterials:{}})},clearHostMaterials:()=>{t({hostMaterials:{}})},setHostStyle:(e,o)=>{t(n=>({hostStyles:{...n.hostStyles,[e]:o}}))},clearHostStyles:()=>{t({hostStyles:{}})},setGlobal:(e,o)=>{t(n=>({globals:{...n.globals,[e]:o}}))},roomFootprint:null,setRoomFootprint:e=>t(o=>{const n=o.roomFootprint;return n&&Math.abs(n.width-e.width)<1e-4&&Math.abs(n.depth-e.depth)<1e-4?o:{roomFootprint:{width:e.width,depth:e.depth}}}),setHostHandleType:(e,o)=>{t(n=>({hostHandleTypes:{...n.hostHandleTypes,[e]:o}}))},clearHostHandleTypes:()=>{t({hostHandleTypes:{}})},setHostHardwareFinish:(e,o)=>{t(n=>({hostHardwareFinishes:{...n.hostHardwareFinishes,[e]:o}}))},clearHostHardwareFinishes:()=>{t({hostHardwareFinishes:{}})},setHostMaterialOverride:(e,o,n)=>{!e||!o||t(s=>({hostMaterialOverrides:{...s.hostMaterialOverrides,[e]:{...s.hostMaterialOverrides[e]||{},[o]:n}}}))},clearHostMaterialOverrides:()=>{t({hostMaterialOverrides:{}})},setHostWidth:(e,o)=>{t(n=>({hostWidths:{...n.hostWidths,[e]:o}}))},clearHostWidths:()=>{t({hostWidths:{}})},setHostDoorType:(e,o,n,s)=>{t(r=>({hostDoorTypes:{...r.hostDoorTypes,[e]:{optionId:o,modelUrl:n,value:s}}}))},clearHostDoorTypes:()=>{t({hostDoorTypes:{}})},setHostProductOverride:(e,o)=>{t(n=>{const s=n.occupiedPieceSlots[e];if(s&&s.compatibleProductIds){const r=String(o);if(!s.compatibleProductIds.some(l=>String(l)===r)){const l={...n.occupiedPieceSlots};return delete l[e],{hostProductOverrides:{...n.hostProductOverrides,[e]:o},sceneHostedProducts:n.sceneHostedProducts.filter(u=>u.id!==s.hostedProductId),occupiedPieceSlots:l}}if(s.hostedProductSlots){const l=s.hostedProductSlots.find(u=>u.product_id!=null&&String(u.product_id)===String(o));if(l){const u={...n.occupiedPieceSlots};u[e]={...s,component_overrides:l.component_overrides||s.component_overrides,component_transforms:l.component_transforms||s.component_transforms};const m=l.position||null,P=l.rotation||null;return{hostProductOverrides:{...n.hostProductOverrides,[e]:o},occupiedPieceSlots:u,sceneHostedProducts:n.sceneHostedProducts.map(f=>f.id===s.hostedProductId?{...f,modelOffset:m,modelRotation:P}:f)}}}}return{hostProductOverrides:{...n.hostProductOverrides,[e]:o}}})},clearHostProductOverrides:()=>{t({hostProductOverrides:{}})},cleanupPieceState:e=>{t(o=>{const n={...o.hostWidths},s={...o.hostProductOverrides},r={...o.hostDoorTypes},c={...o.hostFinishes},l={...o.hostMaterials},u={...o.hostStyles},m={...o.hostHandleTypes},P={...o.occupiedPieceSlots},f=P[e],d=f?.pairedHostedProductId;let i=f?.pairedWith;if(delete n[e],delete s[e],delete r[e],delete c[e],delete l[e],delete u[e],delete m[e],delete P[e],i&&P[i]){const h=P[i];h.previousWidth!==void 0?n[i]=h.previousWidth:delete n[i],h.previousProductOverride!==void 0?s[i]=h.previousProductOverride:delete s[i],h.previousDoorType!==void 0?r[i]=h.previousDoorType:delete r[i],delete P[i]}let g=o.sceneHostedProducts.filter(h=>h.replacedPiece!==e);return d&&(g=g.filter(h=>h.id!==d)),{hostWidths:n,hostProductOverrides:s,hostDoorTypes:r,hostFinishes:c,hostMaterials:l,hostStyles:u,hostHandleTypes:m,occupiedPieceSlots:P,sceneHostedProducts:g}})},setPendingHostedProduct:(e,o={})=>{const n=o.autoPlacePieceIdx??null;t({pendingHostedProduct:e,showHostedProductSlots:!0,pendingAutoPlacePieceIdx:n,selectedFeatureId:null,selectedElementType:null,selectedPieceIndex:null})},clearPendingAutoPlacePieceIdx:()=>{t({pendingAutoPlacePieceIdx:null})},clearPendingHostedProduct:()=>{t({pendingHostedProduct:null,showHostedProductSlots:!1,pendingAutoPlacePieceIdx:null})},setPendingSlotPlacement:e=>t({pendingSlotPlacement:e||null}),clearPendingSlotPlacement:()=>t({pendingSlotPlacement:null}),setDeferredHostedProductPlacement:e=>t({deferredHostedProductPlacement:e}),clearDeferredHostedProductPlacement:()=>t({deferredHostedProductPlacement:null}),setPendingPieceAdd:e=>t(o=>o.pendingPieceAdd?{pendingPieceAddQueue:[...o.pendingPieceAddQueue,e]}:{pendingPieceAdd:e}),clearPendingPieceAdd:()=>t(e=>{const o=e.pendingPieceAddQueue;if(o.length>0){const[n,...s]=o;return{pendingPieceAdd:n,pendingPieceAddQueue:s}}return{pendingPieceAdd:null}}),setPendingPieceDelete:e=>t({pendingPieceDelete:e}),clearPendingPieceDelete:()=>t({pendingPieceDelete:null}),addDisabledWall:e=>t(o=>({disabledWalls:o.disabledWalls.includes(e)?o.disabledWalls:[...o.disabledWalls,e]})),removeDisabledWall:e=>t(o=>({disabledWalls:o.disabledWalls.filter(n=>n!==e)})),clearDisabledWalls:()=>t({disabledWalls:[]}),setSkipWallPieceOverlapCheck:e=>t({skipWallPieceOverlapCheck:e}),setCurrentLayoutType:e=>t({currentLayoutType:e}),setCurrentPerpendicularWalls:e=>t({currentPerpendicularWalls:e}),setValidCornerSlots:e=>t({validCornerSlots:e}),setWallCornerCount:e=>t({wallCornerCount:e}),setValidWallCornerSlots:e=>t({validWallCornerSlots:e}),clearPendingWallCornerAdd:()=>t({pendingWallCornerAdd:null}),placeHostedProductAtSlot:(e,o=[0,0,0])=>{const{pendingHostedProduct:n}=p();if(!n)return null;const s=L(),r={id:s,hostedProductId:n.id,name:n.name,modelUrl:n.modelUrl,position:e,rotation:o,scale:n.scale||[1,1,1]},c=p()._snapshotOverridesOnLoadComplete;return t(l=>({sceneHostedProducts:[...l.sceneHostedProducts,r],pendingHostedProduct:null,showHostedProductSlots:!1,...c?{sceneLoadingMessage:`Placing ${n.name}...`}:{isSceneLoading:!0,sceneLoadingMessage:`Placing ${n.name}...`}})),s},addHostedProduct:e=>{const o=L(),n={id:o,hostedProductId:e.id,name:e.name,modelUrl:e.modelUrl,position:e.position||[0,0,0],rotation:e.rotation||[0,0,0],scale:e.scale||[1,1,1],...e.pairedWith?{pairedWith:e.pairedWith}:{}},s=p()._snapshotOverridesOnLoadComplete;return t(r=>({sceneHostedProducts:[...r.sceneHostedProducts,n],...s?{sceneLoadingMessage:`Adding ${e.name}...`}:{isSceneLoading:!0,sceneLoadingMessage:`Adding ${e.name}...`}})),o},setHostedProductLoaded:()=>{p()._snapshotOverridesOnLoadComplete||t({isSceneLoading:!1,sceneLoadingMessage:""})},removeHostedProduct:e=>{t(o=>{const n={...o.occupiedPieceSlots},s={...o.hostWidths},r={...o.hostProductOverrides},c={...o.hostDoorTypes};let l=null,u=null,m=!1;for(const[d,i]of Object.entries(n))i.surfaceHostedProductId===e&&(n[d]={...i},delete n[d].surfaceHostedProductId,m=!0);if(!m){for(const[d,i]of Object.entries(n))if(i.hostedProductId===e){i.surfaceHostedProductId&&(u=i.surfaceHostedProductId),i.previousWidth!==void 0?s[d]=i.previousWidth:delete s[d],i.previousProductOverride!==void 0?r[d]=i.previousProductOverride:delete r[d],i.previousDoorType!==void 0?c[d]=i.previousDoorType:delete c[d];try{const g=T.getState().products||{},h=r[d]??o.basePiecePositions?.[d]?.productId??null,b=h!=null?g[h]||g[String(h)]:null,W=v=>{const _=v?.components_configuration??v?.componentsConfiguration??{},y=_.comp_base_slab??_.comp_corner_slab??null;return String(y?.variant_key??y?.variantKey??"")};if(b){const v=W(b),_=b.product_graph??b.productGraph??null,y=v?Object.values(g).find(w=>{if(!w||w.id===b.id||b.width!=null&&Number(w.width)!==Number(b.width)||_!=null&&(w.product_graph??w.productGraph??null)!==_)return!1;const M=W(w);if(!M||M===v||!v.startsWith(M+"_"))return!1;const I=v.slice(M.length+1);return/^[a-z0-9]+$/i.test(I)}):null;y?.id!=null&&(r[d]=y.id)}}catch{}i.pairedHostedProductId&&(l=i.pairedHostedProductId),delete n[d]}else if(i.linkedToBase){const g=o.occupiedPieceSlots[i.linkedToBase];g&&g.hostedProductId===e&&delete n[d]}}if(!l){const d=o.sceneHostedProducts.find(i=>i.id===e);d?.pairedWithHostedProductId&&(l=d.pairedWithHostedProductId)}if(l)for(const[d,i]of Object.entries(n))i.hostedProductId===l&&i.pairedHostedProductId&&(n[d]={...i},delete n[d].pairedHostedProductId);const P=new Set([e,u].filter(Boolean));for(let d=!0;d;){d=!1;for(const i of o.sceneHostedProducts)P.has(i.id)||i.pairedWithHostedProductId!=null&&P.has(i.pairedWithHostedProductId)&&(P.add(i.id),d=!0)}for(const[d,i]of Object.entries(n))P.has(i.hostedProductId)&&delete n[d];let f=o.sceneHostedProducts.filter(d=>!P.has(d.id));return l&&!P.has(l)&&(f=f.map(d=>d.id===l?{...d,pairedWithHostedProductId:void 0,pairedWithPiece:void 0}:d)),{sceneHostedProducts:f,occupiedPieceSlots:n,hostWidths:s,hostProductOverrides:r,hostDoorTypes:c}})},moveHostedProductLeft:e=>{t(o=>{const n=o.sceneHostedProducts.findIndex(r=>r.id===e);if(n<=0)return o;const s=[...o.sceneHostedProducts];return[s[n-1],s[n]]=[s[n],s[n-1]],{sceneHostedProducts:s}})},moveHostedProductRight:e=>{t(o=>{const n=o.sceneHostedProducts.findIndex(r=>r.id===e);if(n===-1||n>=o.sceneHostedProducts.length-1)return o;const s=[...o.sceneHostedProducts];return[s[n],s[n+1]]=[s[n+1],s[n]],{sceneHostedProducts:s}})},updateHostedProductPosition:(e,o)=>{t(n=>({sceneHostedProducts:n.sceneHostedProducts.map(s=>s.id===e?{...s,position:o}:s)}))},updateHostedProductRotation:(e,o)=>{t(n=>({sceneHostedProducts:n.sceneHostedProducts.map(s=>s.id===e?{...s,rotation:o}:s)}))},clearHostedProducts:()=>{t({sceneHostedProducts:[],occupiedPieceSlots:{}})},occupyPieceSlot:(e,o,n,s)=>{t(r=>({occupiedPieceSlots:{...r.occupiedPieceSlots,[e]:{hostedProductId:o,position:n,rotation:s}}}))},freePieceSlot:e=>{t(o=>{const n={...o.occupiedPieceSlots};return delete n[e],{occupiedPieceSlots:n}})},setHostedProductFeatureForSlot:(e,o,n)=>{t(s=>{const r=s.occupiedPieceSlots[e];return r?{occupiedPieceSlots:{...s.occupiedPieceSlots,[e]:{...r,featureSelections:{...r.featureSelections,[o]:n}}}}:s})},updateHostedProductSlotForProduct:(e,o)=>{const n=p().occupiedPieceSlots[e];if(!n)return;const s=n.hostedProductSlots?.find(r=>r.product_id===o);s&&t(r=>{const c={...r.occupiedPieceSlots[e]};s.component_overrides&&(c.component_overrides=s.component_overrides),s.component_transforms?c.component_transforms=s.component_transforms:delete c.component_transforms;const l=c.hostedProductId;return{occupiedPieceSlots:{...r.occupiedPieceSlots,[e]:c},sceneHostedProducts:r.sceneHostedProducts.map(u=>u.id===l?{...u,modelOffset:s.position||null,modelRotation:s.rotation||null,additionalModels:s.additionalModels||u.additionalModels,...s.modelUrl?{modelUrl:s.modelUrl}:{}}:u)}})},setPieceConfigSnapshot:e=>{t({pieceConfigSnapshot:e})},setInitialPieceConfigSnapshot:e=>{t({initialPieceConfigSnapshot:e})},setInitialPerPieceOverrides:()=>{const e=p(),o=R.getState().sceneSelections;t({initialPerPieceOverrides:{hostFinishes:{...e.hostFinishes},hostStyles:{...e.hostStyles},hostHandleTypes:{...e.hostHandleTypes},hostWidths:{...e.hostWidths},hostDoorTypes:{...e.hostDoorTypes},hostProductOverrides:{...e.hostProductOverrides},hostHardwareFinishes:{...e.hostHardwareFinishes},sceneHostedProducts:[...e.sceneHostedProducts],sceneSelections:{...o}}})},setBasePiecePositions:e=>{const o=p().basePiecePositions||{},n=Object.keys(o),s=Object.keys(e||{});if(n.length===s.length){let r=!1;for(const c of s){const l=o[c],u=e[c];if(!l||!u){r=!0;break}const m=l.position,P=u.position,f=l.rotation||[0,0,0],d=u.rotation||[0,0,0];if(!Array.isArray(m)||!Array.isArray(P)){r=!0;break}if(Math.abs((m[0]||0)-(P[0]||0))>1e-6||Math.abs((m[1]||0)-(P[1]||0))>1e-6||Math.abs((m[2]||0)-(P[2]||0))>1e-6||Math.abs((f[1]||0)-(d[1]||0))>1e-6||String(l.productId??"")!==String(u.productId??"")){r=!0;break}}if(!r)return}t({basePiecePositions:e})},getBasePiecePosition:e=>p().basePiecePositions[e],setSceneModelTransforms:e=>{t({sceneModelTransforms:e})},placeHostedProductAtPiece:(e,o,n,s=[0,0,0],r=null)=>{const c=L();let l=e.placement_type||"replace_full";const u=r||p().basePiecePositions[o]?.productId,m=u!=null?String(u):null,P=T.getState().products||{},f=a=>{if(a==null)return null;const H=P[a]||P[String(a)];return H||Object.values(P).find(O=>O&&C(O.id,a))||null},d=(a,H)=>{const O=f(a),S=f(H);return!O||!S?!1:String(O.id)===String(S.id)};let i=e.slots?.find(a=>a.product_id!=null&&d(a.product_id,u))||e.slots?.find(a=>a.product_id==null)||e.slots?.find(a=>a.product_id!=null&&C(a.product_id,u))||(e.id==="oven_stove"?e.slots?.find(a=>a.product_id!=null&&C(a.product_id,e.target_product_id)):null);const g=U(o);if(g==="corner"||g==="wall_corner"){const a=j(e,P);if(a){const H=f(u),S=(H?.components_configuration??H?.componentsConfiguration??{}).comp_corner_slab,D=String(S?.variant_key??S?.variantKey??"");if(D){const A=T.getState().components||{},x=A.comp_corner_slab??A.comp_corner_slab,F=D+a;x?.variants?.[F]!=null&&(i={...i||{position:null,rotation:null},product_id:null,component_overrides:{...i?.component_overrides||{},comp_corner_slab:{variant_key:F}}},l="replace_components")}}}if(l==="replace_components"){const a=Array.isArray(e.slots)?e.slots:[],H=a.some(S=>S&&S.component_overrides&&Object.keys(S.component_overrides).length>0);!(i?.component_overrides&&Object.keys(i.component_overrides).length>0)&&(a.length===0||!H)&&(l="replace_full")}const b=i?.position||e.componentModelOffset||null,W=i?.rotation||e.componentModelRotation||null,v={id:c,hostedProductId:e.id,name:e.name,modelUrl:i?.modelUrl||e.modelUrl,position:n,rotation:s,scale:e.scale||[1,1,1],placement_type:l,modelOffset:b,modelRotation:W,replacedPiece:o,additionalModels:i?.additionalModels||e.additionalModels||[]},_=Array.isArray(e.hostVariants)&&e.hostVariants.length>0,y={hostedProductId:c,position:n,rotation:s,placement_type:l,isHostSwap:_,compatibleProductIds:e.slots?.map(a=>a.product_id)||[],hostedProductSlots:e.slots||[],featureSelections:(()=>{const a=e.features||[],H=e.feature_defaults||{},O={};for(const S of a){const D=T.getState().features[S];O[S]=H[S]||D?.default_option_id}return O})()};l==="replace_components"&&i?.component_overrides&&(y.component_overrides=i.component_overrides),l==="replace_components"&&i?.component_transforms&&(y.component_transforms=i.component_transforms);const w={},M=e?.target_width??e?.auto_target_width??null,I=p()._snapshotOverridesOnLoadComplete;return t(a=>({sceneHostedProducts:[...a.sceneHostedProducts,v],occupiedPieceSlots:{...a.occupiedPieceSlots,[o]:y,...w},...M!=null?{hostWidths:{...a.hostWidths,[o]:M}}:{},pendingHostedProduct:null,showHostedProductSlots:!1,...I?{sceneLoadingMessage:`Placing ${e.name}...`}:{isSceneLoading:!0,sceneLoadingMessage:`Placing ${e.name}...`},selectedFeatureId:null,selectedElementType:null,selectedPieceIndex:null})),c},addSurfaceHostedProduct:(e,o)=>{const n=L(),s={id:n,hostedProductId:e.id,name:e.name,modelUrl:e.modelUrl,position:[0,0,0],rotation:[0,0,0],scale:e.scale||[1,1,1],placement_type:"countertop_overlay",replacedPiece:o},r=p()._snapshotOverridesOnLoadComplete;return t(c=>({sceneHostedProducts:[...c.sceneHostedProducts,s],occupiedPieceSlots:{...c.occupiedPieceSlots,[o]:{...c.occupiedPieceSlots[o],surfaceHostedProductId:n}},pendingHostedProduct:null,showHostedProductSlots:!1,...r?{sceneLoadingMessage:`Placing ${e.name}...`}:{isSceneLoading:!0,sceneLoadingMessage:`Placing ${e.name}...`},selectedFeatureId:null,selectedElementType:null,selectedPieceIndex:null})),n},setPair:(e,o,n,s)=>{t(r=>({occupiedPieceSlots:{...r.occupiedPieceSlots,[e]:{...r.occupiedPieceSlots[e],pairedWith:n,pairedHostedProductId:s},[n]:{...r.occupiedPieceSlots[n],pairedWith:e,pairedHostedProductId:o}}}))},setPairing:(e,o,n,s)=>p().setPair(e,o,n,s),showSuccess:e=>p().addNotification({type:"success",message:e}),showError:e=>p().addNotification({type:"error",message:e}),showWarning:e=>p().addNotification({type:"warning",message:e}),showInfo:e=>p().addNotification({type:"info",message:e})}),{name:"ui-store"}));var Z=K;export{Z as default};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
@layer sdk-base, vendor, sdk;
|
|
2
|
+
@layer sdk {
|
|
3
|
+
/* ============================================================================
|
|
4
|
+
ConfigurationSummary — read-only review rows.
|
|
5
|
+
|
|
6
|
+
Deliberately token-driven and shell-neutral: it reads the same --color-* /
|
|
7
|
+
--text-* variables every other panel does, so it sits correctly in the default
|
|
8
|
+
layout and in a theme's own shell (the wizard remaps those tokens on its root,
|
|
9
|
+
and this follows without a wizard-specific rule).
|
|
10
|
+
============================================================================ */
|
|
11
|
+
|
|
12
|
+
.config-summary {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
gap: 22px;
|
|
16
|
+
padding: 4px 20px 20px;
|
|
17
|
+
overflow-y: auto;
|
|
18
|
+
min-height: 0;
|
|
19
|
+
flex: 1 1 auto;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.config-summary__group {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
gap: 8px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.config-summary__group-title {
|
|
29
|
+
margin: 0;
|
|
30
|
+
font-size: 11px;
|
|
31
|
+
font-weight: 700;
|
|
32
|
+
letter-spacing: 0.12em;
|
|
33
|
+
text-transform: uppercase;
|
|
34
|
+
color: var(--color-accent, var(--text-secondary, #6f665d));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.config-summary__rows {
|
|
38
|
+
margin: 0;
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* One line per choice: name on the left, chosen option on the right. The dotted
|
|
44
|
+
rule between them keeps long labels readable without a table layout. */
|
|
45
|
+
.config-summary__row {
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: baseline;
|
|
48
|
+
gap: 10px;
|
|
49
|
+
padding: 9px 0;
|
|
50
|
+
border-bottom: 1px solid var(--color-border, #e4ddd3);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.config-summary__row:last-child {
|
|
54
|
+
border-bottom: 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.config-summary__label {
|
|
58
|
+
flex: 0 1 auto;
|
|
59
|
+
font-size: 13px;
|
|
60
|
+
color: var(--text-secondary, #6f665d);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.config-summary__value {
|
|
64
|
+
margin: 0 0 0 auto;
|
|
65
|
+
text-align: right;
|
|
66
|
+
font-size: 13px;
|
|
67
|
+
font-weight: 600;
|
|
68
|
+
color: var(--text-primary, #2b2724);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.config-summary__empty {
|
|
72
|
+
margin: 0;
|
|
73
|
+
padding: 18px 0;
|
|
74
|
+
font-size: 13px;
|
|
75
|
+
color: var(--text-tertiary, #999);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import*as p from"three";import K from"./8f60e5059a.js";import oe from"./9c6c598569.js";import ve from"./d94df858ea.js";import le from"./872c4302e0.js";import ce,{deriveSceneFeatures as Pe}from"./be337ddda5.js";import y,{ASSET_IDS as Q}from"./3f37665dd1.js";import{refreshAiQuota as tt,aiQuotaBlock as De,aiQuotaBlockText as Fe,aiQuotaImageBudget as ot,aiQuotaPartialText as at}from"./2f8cc8b292.js";import{imageAsDataUrl as rt,captureAndWarm as $e}from"./0e2dedae0d.js";import{useEffect as nt,useRef as st}from"react";import{runIntent as it,INTENTS as lt}from"./6d238282c1.js";import{registerBuiltinCommand as ct,COMMANDS as dt}from"./d6851ea979.js";import{uploadReferenceImage as ut,generateImage as ft,generationErrorMessage as pt}from"./d7c9500ba9.js";import{getR3FState as Ve}from"./e1cd279733.js";import{isStructureConsistent as mt,buildStructureSignature as gt,scoreAgainstSignature as ht}from"./2239b22616.js";import{generateARModel as wt}from"./f7b4a178e3.js";import{FRONT_VIEW_POSITION as yt,VIEW_PRESETS as St,PERSPECTIVE_VIEW_DIR as Ge,PERSPECTIVE_VIEW_DIR_LEFT as vt}from"./23dc0ccf32.js";import{dataUrlToFile as bt}from"./00ab3dcbb5.js";import{isHostFloating as xt,isHostedProduct as _t}from"./061b81ad81.js";import{isAddFeature as Tt}from"./8c27edda0f.js";const O={mood:["modern warm minimalist","Scandinavian","mid-century modern","luxurious contemporary","farmhouse","Japandi","industrial-chic","coastal","quiet contemporary","warm traditional","soft brutalist","eclectic collected"],floor:["wide oak plank floors","light ash floors","herringbone walnut floors","polished concrete floors","reclaimed timber floors","pale oak floors","dark stained timber floors","whitewashed plank floors","large-format stone tiles","warm terracotta tiles"],walls:["off-white walls","warm greige walls","soft taupe walls","cream walls with exposed beams","pale blue-grey walls","chalky white plaster walls","muted sage walls","limewashed clay walls","warm beige walls","deep charcoal feature wall behind"],light:["warm pendants overhead","soft diffused daylight","low warm recessed lighting","bright even daylight","warm late-afternoon light raking across the floor","soft overcast daylight","warm wall sconces","gentle ambient light with soft shadows"],furnishing:["a defocused dining table with mismatched chairs at the side","a defocused low bench with a stone tea set","a defocused reading chair and floor lamp at the rear","a defocused sideboard with ceramics beyond a doorway","a defocused rattan nook at the side","a defocused console table with stacked books","a defocused upholstered bench at the rear","a defocused open shelving unit with pottery to one side"],greenery:["a fiddle-leaf fig in a woven basket","an olive tree in a terracotta pot","a monstera in a ribbed planter","a snake plant in a concrete pot","trailing pothos on a high shelf","a small bonsai on a side counter","eucalyptus stems in a stoneware vase","a potted fern on the floor"],detail:["framed art on an empty wall","a jute rug underfoot","a linen runner and a ceramic bowl","a stack of art books","a woven throw over a chair back","a stoneware jug with wildflowers","a flat-weave runner rug","a pair of hand-thrown vases"]},Y=(n,r=Math.random)=>n[Math.floor(r()*n.length)];function Ne(n,r={}){const a=r.rng||Math.random,o=new Set([n?.productLabel||"",...(n?.pieces||[]).map(l=>l.name)].join(" ").toLowerCase().match(/[a-z]+/g)||[]),t=l=>(l.toLowerCase().match(/[a-z]+/g)||[]).some(g=>g.length>3&&o.has(g)),m=O.furnishing.filter(l=>!t(l)),i=r.avoidMood?O.mood.filter(l=>l!==r.avoidMood):O.mood,s=Y(i.length?i:O.mood,a),c=[Y(O.floor,a),Y(O.walls,a),Y(O.light,a),m.length?Y(m,a):null,Y(O.greenery,a),Y(O.detail,a)].filter(Boolean);return{mood:s,text:`${s}: ${c.join(", ")}`}}function Ct(){const n=ve.getState().sceneSelections||{},r=le.getState().options||{},a=le.getState().materials||{},o=le.getState().products||{},t=oe.getState().activeSceneConfigId,i=(ce.getState().sceneConfigurations||{})[t],s=ce.getState(),c=oe.getState().productInstances||{},l=Pe(i)||[],g=[];let d=null,h=null;for(const f of l){if(Tt(f,{productSelected:!1}))continue;const v=n[f.id]??n[f.feature_id]??n[String(f.id)];if(v==null)continue;const e=r[v]||r[String(v)];if(!e)continue;const I=(e.value!=null?a[e.value]||a[String(e.value)]:null)?.color||e.color_hex||null,R=String(f.type||"").toLowerCase();R==="layout_change"&&(d=e.name||null,h=e.value||null),g.push({feature:f.name||f.feature_id||f.id,value:e.name||String(e.value??""),colorHex:I,type:R})}const T=f=>{const v=o[f?.variantId]||o[f?.productId]||o[String(f?.variantId)]||o[String(f?.productId)];return{name:String(v?.name||f?.name||"part"),product:v}},k=new Map;let w=!1,S=!1;for(const f of Object.values(c)){const{name:v,product:e}=T(f);k.set(v,(k.get(v)||0)+1),e&&xt(e)&&(w=!0),e&&_t(e)&&(S=!0)}const A=[...k.entries()].map(([f,v])=>({name:f,count:v})).sort((f,v)=>v.count-f.count);return{productLabel:s.systemName||s.systemRoom?.name||A[0]?.name||"product",selections:g,pieces:A,hasWallMountedParts:w,hasHostedParts:S,layoutName:d,layoutType:h}}function Et(n){const r=[`${n.productLabel} \u2014 Product Master:`];for(const a of n.selections||[])r.push(`\u2022 ${a.feature}: ${a.value}${a.colorHex?` (${a.colorHex})`:""}`);return n.pieces&&n.pieces.length&&r.push(`\u2022 Parts: ${n.pieces.map(a=>`${a.count} ${a.name}`).join(", ")}`),r.join(`
|
|
2
|
+
`)}const Le=(n,r,a)=>{const o=r.productLabel||"product",t=r.hasWallMountedParts?`
|
|
3
|
+
|
|
4
|
+
WALLS (CRITICAL): The reference image shows the ${o} ALONE, with no room around it \u2014 you must BUILD the walls. Every wall-mounted part must end up against a continuous solid wall directly behind it \u2014 wall-mounted parts DO NOT FLOAT. The wall surface continues above and beside each one to the ceiling. Windows, doorways, archways, and open passages are ONLY allowed on wall sections that have NO mounted parts. The wall continues past the outer edge of any tall/end part to the room corner \u2014 do not crop the frame at that edge or place another room beside it, and keep a clean material boundary where a part meets the wall.`:"";return`TASK: Place the EXACT ${o} from the reference image into a styled, lived-in interior \u2014 ${n}. The ${o} is the hero object; the room around it is secondary context.
|
|
5
|
+
|
|
6
|
+
PRESERVE pixel-faithful from the reference: every part, panel/surface design, hardware, colour, material, proportion, and layout exactly as shown.${t}
|
|
7
|
+
|
|
8
|
+
EDIT: only the room around the ${o} \u2014 flooring, ceiling lighting, defocused furniture at the side or rear, plants, decor, framed art on an empty wall, a window on an empty wall.
|
|
9
|
+
|
|
10
|
+
CAMERA: front-facing catalog shot, 28mm full-frame, eye level, the ${o} 70-85% of frame width, all of it visible. Photoreal materials, 4K.
|
|
11
|
+
|
|
12
|
+
${a}
|
|
13
|
+
|
|
14
|
+
NEGATIVE: any part not in the reference, added parts, removed parts, replaced product, substituted design, altered materials or colours, moved or resized parts, distorted geometry, rotation, mirroring, scaling, empty/unfurnished room, fisheye, 3D render look, CGI look, cartoonish, illustration, cropped or partial ${o}, different camera angle, wide architectural shot, clutter obscuring the ${o}, a second ${o} in the scene, a duplicate ${o} in the background${r.hasWallMountedParts?", floating wall-mounted parts, wall-mounted parts in mid-air, missing wall behind mounted parts, window or open passage behind mounted parts, frame cropped at a part edge":""}`};function kt(){const n=ve.getState().sceneSelections,r=oe.getState().activeSceneConfigId,o=(ce.getState().sceneConfigurations||{})[r],t=Pe(o).find(s=>s.type==="layout_change");if(!t)return!1;const m=n[t.id];return le.getState().options[m]?.value==="galley"}function At(){const n=ve.getState().sceneSelections||{},r=oe.getState(),a=K.getState(),o=r.productInstances||{},t=Object.entries(o).map(([m,i])=>({id:m,v:i?.variantId??i?.productId??null,seq:i?.sequence??null,g:i?.placementGroup??i?.placement_group??null}));return JSON.stringify({sceneSelections:n,pieces:t,componentStates:r.componentStates||{},hostMaterialOverrides:a.hostMaterialOverrides||{}})}const eo=rt;function to(n=2){return new Promise(r=>{const a=o=>{if(o<=0){r();return}requestAnimationFrame(()=>a(o-1))};a(n)})}function ze(n){const r=new p.Box3;return n.traverse(a=>{if(!a.isMesh||!a.visible)return;const o=a.material;if(!(o&&o.transparent&&o.opacity<.01))try{const t=new p.Box3().setFromObject(a);if(!isFinite(t.min.x)||!isFinite(t.max.x))return;const m=t.max.x-t.min.x,i=t.max.y-t.min.y,s=t.max.z-t.min.z;if(m>20||i>10||s>20)return;r.union(t)}catch{}}),r.isEmpty()?null:r}function Rt(n,r,a,o=45){const t=ze(n);if(!t||!r)return null;const m=o*Math.PI/180/2;if(m<=0)return null;const i=new p.Vector3;t.getCenter(i);const s=new p.Vector3;if(r.getWorldDirection(s),!isFinite(s.x)||s.lengthSq()===0)return null;s.normalize();const c=new p.Vector3().crossVectors(s,r.up).normalize();if(c.lengthSq()===0)return null;const l=new p.Vector3().crossVectors(c,s).normalize(),g=Math.tan(m),d=g*a;let h=1.8;const T=new p.Vector3;for(let w=0;w<8;w++){T.set(w&1?t.max.x:t.min.x,w&2?t.max.y:t.min.y,w&4?t.max.z:t.min.z).sub(i);const S=-T.dot(s);h=Math.max(h,S+Math.abs(T.dot(c))/d,S+Math.abs(T.dot(l))/g)}h*=1.06;const k=i.clone().addScaledVector(s.clone().negate(),h);return{position:[k.x,k.y,k.z],target:[i.x,i.y,i.z],up:[r.up.x,r.up.y,r.up.z]}}function It(n,r,a=45,o="front"){const t=ze(n);if(!t)return null;const m=new p.Vector3;t.getCenter(m);const i=new p.Vector3;t.getSize(i);const s=a*Math.PI/180/2;if(s<=0)return null;let c;const l=1.5;if(o==="front"){const w=i.y/2*l,S=i.x/2*l,A=w/Math.tan(s),W=S/(Math.tan(s)*r);c=Math.max(A,W,1.8)}else if(o==="side"){const w=i.y/2*l,S=i.z/2*l,A=w/Math.tan(s),W=S/(Math.tan(s)*r);c=Math.max(A,W,1.8)}else{const w=Math.max(i.length()*.5,.5),S=w/Math.sin(s),A=w/Math.sin(Math.atan(Math.tan(s)*r));c=Math.max(S,A,1.8)*1.15}const g={front:new p.Vector3(0,.15,1),side:new p.Vector3(-1,.2,0),perspective:new p.Vector3(...Ge),perspective_left:new p.Vector3(...vt),perspective_right:new p.Vector3(...Ge),top:new p.Vector3(0,1,0)},d=(g[o]||g.front).clone().normalize(),h=m.clone();o!=="top"&&(h.y=m.y*.92);const T=m.clone().addScaledVector(d,c),k=o==="top"?[0,0,-1]:[0,1,0];return{position:[T.x,T.y,T.z],target:[h.x,h.y,h.z],up:k}}async function Mt(n,r){const a=Ve()||n?.__r3f?.store?.getState();if(!a)return{};const{scene:o,gl:t,camera:m}=a,i=t.domElement,s=m.fov||45,c=1536,l=1152,g=c/l,d={},h=new p.PerspectiveCamera(s,g,.1,1e3),T=r||St,k=t.getRenderTarget(),w=t.getSize(new p.Vector2),S=t.getPixelRatio(),A=o.background,W=t.getClearColor(new p.Color),f=t.getClearAlpha(),v=a.frameloop;a.setFrameloop?.("never"),o.background=null,t.setClearColor(16777215,1);const e=new p.WebGLRenderTarget(c,l,{minFilter:p.LinearFilter,magFilter:p.LinearFilter,format:p.RGBAFormat,type:p.UnsignedByteType,colorSpace:p.SRGBColorSpace}),$=document.createElement("canvas");$.width=c,$.height=l;const I=$.getContext("2d"),R=new Uint8Array(c*l*4),M=I.createImageData(c,l);try{for(const b of T){try{let F=b.position,U=b.target,P=[0,1,0];if(b.liveAngle)try{const x=Rt(o,m,g,s);x&&(F=x.position,U=x.target,P=x.up||P)}catch{}else if(b.autoFit)try{const x=It(o,g,s,b.key);x&&(F=x.position,U=x.target,P=x.up||P)}catch{}h.position.set(...F),h.up.set(...P),h.lookAt(new p.Vector3(...U)),h.updateMatrixWorld(!0),t.setRenderTarget(e),t.setSize(c,l,!1),t.render(o,h),t.readRenderTargetPixels(e,0,0,c,l,R);for(let x=0;x<l;x++){const ae=(l-x-1)*c*4,be=x*c*4;M.data.set(R.subarray(ae,ae+c*4),be)}I.putImageData(M,0,0),d[b.key]=$.toDataURL("image/jpeg",.9)}catch{d[b.key]=null}await new Promise(F=>setTimeout(F,0))}}finally{e.dispose(),o.background=A,t.setClearColor(W,f),t.setRenderTarget(k),t.setPixelRatio(S),t.setSize(w.x,w.y,!1),t.render(o,m),a.setFrameloop?.(v??"demand"),a.invalidate?.()}return d}function Pt({openModal:n,setCameraPosition:r}={}){const a=K(e=>e.openModal),o=oe(e=>e.setCameraPosition),t=n??a,m=r??o,i=y(e=>e.setScreenshot),s=y(e=>e.setScreenshotViews),c=y(e=>e.setUploadStatus),l=y(e=>e.setAiGenerationStatus),g=y(e=>e.setPipelineMessage),d=y(e=>e.updateAsset),h=y(e=>e.startSlowProgress),T=y(e=>e.startPdfFakeProgress),k=y(e=>e.setUploadedImageUrl),w=y(e=>e.isGenerating),S=y(e=>e.setIsGenerating),A=({wantSilo:e,wantLifestyle:$,wantAr:I,wantPdf:R})=>[...e?Q.silo:[],...$?Q.lifestyle:[],...I?["ar-viewer"]:[],...R?["bom-pdf"]:[]],W=async(e={})=>{const $=e.silent===!0,I=()=>{$||t("generateAssets")},R=Array.isArray(e.families)&&e.families.length?e.families:["silo","lifestyle","ar","pdf"];let M=R.includes("silo"),b=R.includes("lifestyle");const F=R.includes("ar"),U=R.includes("pdf"),P=y.getState(),x=At();if(P.isGenerating){const C=A({wantSilo:M,wantLifestyle:b,wantAr:F,wantPdf:U}).filter(_=>P.assets.find(D=>D.id===_)?.status==="idle");I();return}const ae=A({wantSilo:M,wantLifestyle:b,wantAr:F,wantPdf:U});if(P._lastConfigSnapshot===x&&ae.every(C=>{const _=P.assets.find(D=>D.id===C)?.status;return _==="complete"||_==="blocked"})){I();return}R.length===4&&P.resetAssets(),S(!0),P.setLastConfigSnapshot(x);let Z=null;const ee=[...M?Q.silo:[],...b?Q.lifestyle:[]];if(ee.length){const C=await tt();y.getState().setAiQuota(C);const _=De(C),D=_?0:ot(C);if(!_&&ee.length>D&&(Z=new Set(ee.slice(0,D)),ee.slice(D).forEach(V=>d(V,{status:"blocked",progress:0,error:at(D)})),Q.silo.some(V=>Z.has(V))||(M=!1),Q.lifestyle.some(V=>Z.has(V))||(b=!1),I()),_&&(ee.forEach(V=>d(V,{status:"blocked",progress:0,error:Fe(_)})),M=!1,b=!1,I(),!F&&!U)){S(!1);return}}const de=C=>!Z||Z.has(C),ue=[...M?Q.silo:[],...b?Q.lifestyle:[]].filter(de);ue.forEach(C=>d(C,{status:"generating",progress:0,error:null})),I();const Oe=K.getState().showWalls,We=K.getState().showDimensions,Ft=kt();K.setState({showWalls:!1,showDimensions:!1,captureMode:!0}),setTimeout(async()=>{const C=document.querySelector(".scene-canvas canvas");if(!C){ue.forEach(H=>d(H,{status:"idle",progress:0,error:null})),S(!1);return}const _=await Mt(C,[{key:"front",liveAngle:!0,position:yt,target:[0,1,0],label:"Front"}]),D=_.front||C.toDataURL("image/jpeg",.9);if(i(D),K.setState({showWalls:Oe,showDimensions:We,captureMode:!1}),F){d("ar-viewer",{status:"generating",progress:0,error:null});const H=Ve()?.scene??null;if(!H)d("ar-viewer",{status:"error",progress:0,error:"3D scene not ready \u2014 open the configurator first, then click generate again."});else try{wt({scene:H,onProgress:E=>{d("ar-viewer",{progress:E})},onComplete:E=>{d("ar-viewer",{status:"complete",progress:100,url:E})},onError:E=>{d("ar-viewer",{status:"error",progress:0,error:E||"AR generation failed"})}})}catch(E){d("ar-viewer",{status:"error",progress:0,error:E?.message||"AR generation failed"})}}const V=Date.now().toString(36),fe=[];let xe=null,pe=!1;try{g("Processing data..."),c("in_progress",0);const H=_.front||_.perspective||_.side||_.top||D,E=M||b?[{key:"front",dataUrl:H}]:[],J={},_e=E.length;let B=0;[5,10,15,20,25,28].forEach((u,N)=>{const j=setTimeout(()=>{if(pe)return;const L=y.getState().uploadProgress;u>L&&c("in_progress",u)},(N+1)*1e3);fe.push(j)}),await Promise.all(E.map(async({key:u,dataUrl:N})=>{const j=`${u}_${V}.jpg`,L=bt(N,j),{url:ge}=await ut(L);J[u]=ge,B++,c("in_progress",Math.round(B/_e*100))})),pe=!0,fe.forEach(clearTimeout);for(const u of Object.keys(_))_[u]=null;xe=await gt((E.find(u=>u.key==="front")||{}).dataUrl||null);for(const u of E)u.dataUrl=null;c("complete",100),k(J.front),g("Generating Content"),l("in_progress"),ue.forEach(u=>h(u)),U&&(T(),y.getState()._checkPdfNotStranded?.({lifestyleRequested:b,siloRequested:M}));const Ue="1024x768",G=Ct(),me=Et(G),re=G.productLabel||"product",He=re,Be=G.layoutName||null,qe=G.layoutType||null,Te=`3D render look, CGI look, modified ${re}, changed layout, added or removed parts, altered materials or colours, moved or resized parts, distorted geometry, rotation, mirroring, scaling, cropped or partial ${re}, different camera angle, wide architectural shot, clutter, obstruction`,Ce=`${Te}, room background, walls, floor pattern, ceiling, lighting fixtures, plants, props`,Qe=`${Te}${G.hasWallMountedParts?", floating wall-mounted parts, missing wall behind mounted parts, window or open passage behind mounted parts":""}`,je=`TASK: Take the ${re} from the reference image and upgrade ONLY the surface materials to be photorealistic \u2014 real wood grain with subtle natural imperfections, real metallic anisotropy on any metal, real stone veining and slight specular highlights on any stone, real fabric weave on any upholstery. Remove any 3D-render or CGI look on the surfaces.
|
|
15
|
+
|
|
16
|
+
EVERYTHING ELSE STAYS IDENTICAL TO THE REFERENCE: same background, same camera angle, same framing, same part count, same positions, same design of every part, same colours, same proportions, same layout, same lighting direction. Do NOT add or remove any part or accessory. Do NOT change the camera angle, perspective, or zoom. Do NOT add walls, floors, decor, lighting fixtures, plants, or props. Do NOT replace the background. The output and the reference must look like the SAME image with only the materials re-rendered as real photographic textures.
|
|
17
|
+
|
|
18
|
+
${me}
|
|
19
|
+
|
|
20
|
+
NEGATIVE: any element not in the reference, added parts, removed parts, different camera angle, perspective change, replaced background, added decoration, room background, walls, floor pattern, lighting fixtures, plants, accessories, props, colour shift, layout change, 3D render look, CGI look, cartoonish, illustration, ${Ce}`,Ee=Ne(G),Ye=Ne(G,{avoidMood:Ee.mood}),Je=Le(Ee.text,G,me),Xe=Le(Ye.text,G,me),{setAssetGenParams:Ke}=y.getState(),ke=async(u,N,j,L,ge,Ze=null)=>{const he=u.startsWith("silo-"),Ae=u.startsWith("lifestyle-"),Re=he,Ie=.72,ne=Re?3:Ae?2:1;let te=ge,Me=!1,we=N;const se=async q=>{if(he&&L){const ie=await $e(L);return d(u,{status:"complete",progress:100,url:L,dataUrl:ie,source:"reference-render",validated:!1,reason:q}),L}return d(u,{status:"error",progress:0,error:"Generation failed. Try again."}),null};for(let q=1;q<=ne;q++){const ie={assetId:u,systemId:ce.getState().systemId??null,attempt:q,productName:He,productDescription:we,imageUrl:L,allowedAngles:j,size:Ze||Ue,imageStrength:te,negativePrompt:he?Ce:Qe,layoutType:qe,layoutName:Be};Ke(u,ie);try{const z=await ft(ie),X=z.images[0].url;if(Re){const ye=await ht(xe,X),Se=mt(ye,Ie);if(Se===null&&(Me=!0),Se===!1&&q<ne){te=Math.min(.98,te+.04),we=`${N} [STRICT] Preserve the geometry and placement of every part exactly. Do not alter any part's width, height, spacing, or position.`;continue}if(Se===!1&&q>=ne)return await se(`Consistency floor reached (last score=${ye?.toFixed?.(3)??ye}, threshold=${Ie})`)}const et=await $e(X);return d(u,{status:"complete",progress:100,url:X,dataUrl:et,source:"generated",validated:!Me}),z.quota&&y.getState().setAiQuota(z.quota),X}catch(z){if(z?.isQuota){z.quota&&y.getState().setAiQuota(z.quota);const X=De(z.quota)||{code:"limit_reached"};return d(u,{status:"blocked",progress:0,error:Fe(X)}),null}if(z?.isDeadReference)return await se("Reference render expired");if(q>=ne)return await se("API error on final attempt");te=Math.min(.98,te+.04),Ae&&(we=`${N} [RETRY \u2014 STRICT] Preserve the geometry, layout, and every part exactly as in the reference. Only generate the room background. Match the catalog photography style precisely.`)}}return await se("Exhausted all attempts")};await Promise.all([...M&&de("silo-front")?[ke("silo-front",je,["silo_front"],J.front,.94)]:[],...b?[...[["lifestyle-1",Je,["lifestyle_1"]],["lifestyle-2",Xe,["lifestyle_2"]]].filter(([u])=>de(u)).map(([u,N,j])=>ke(u,N,j,J.front,.85,"1536x1152"))]:[]]),l("complete"),g("Content generated successfully"),S(!1)}catch(H){pe=!0,fe.forEach(clearTimeout);const{uploadStatus:E}=y.getState();E!=="complete"?(c("error"),g("Failed to upload screenshot")):(l("error"),g("Content generation failed"));const J=pt(H,"Generation failed before this asset started.");y.getState().assets.filter(B=>B.status==="generating").map(B=>B.id).forEach(B=>d(B,{status:"error",progress:0,error:J})),S(!1)}},500)},f=e=>it({type:lt.ASSETS_GENERATE,families:e?.families??null},()=>W(e)),v=st(null);return v.current=f,nt(()=>ct(dt.GENERATE_ASSETS,e=>v.current?.(e)),[]),{handleGenerateAssets:f,isGenerating:w}}export{eo as _imageAsDataUrl,Et as buildProductMasterText,Ct as buildSceneJson,Mt as captureMultipleViews,Pt as default,It as getAutoFitCamera,At as getConfigSnapshot,Rt as getLiveAngleCamera,kt as isGalleyLayout,Ne as pickBackdrop,to as waitForRenderFrames};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as v from"three";import A from"./872c4302e0.js";import rt from"./8f60e5059a.js";function _t(o){return o?"product_"+String(o).toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,""):""}function yt(o,e){if(o==null||e==null)return!1;if(String(o)===String(e))return!0;const s=A.getState(),l=s.products||{},a=s.productsByRef||{},p=w=>{const X=l[w]||l[String(w)];if(X)return X;const m=a[String(w).toLowerCase()];return m!=null&&(l[m]||l[String(m)])||null},u=p(o),t=p(e);if(u&&t&&String(u.id??"")===String(t.id??""))return!0;const c=u?.productGraph??u?.product_graph??null,S=t?.productGraph??t?.product_graph??null;if(u&&S!=null&&String(u.id??"")===String(S)||t&&c!=null&&String(c)===String(t.id??"")||u&&S==null&&c!=null&&String(c)===String(e)||t&&c==null&&S!=null&&String(S)===String(o))return!0;if(u==null&&t!=null){const w=t.productGraph??t.product_graph;if(w!=null&&String(w)===String(o))return!0}if(t==null&&u!=null){const w=u.productGraph??u.product_graph;if(w!=null&&String(w)===String(e))return!0}return!1}function T(o,e){return Array.isArray(o)&&o.length>=3?[o[0],o[1],o[2]]:o&&typeof o=="object"?[o.x??0,o.y??0,o.z??0]:e}function M(o,e){return Array.isArray(o)&&o.length>=3?[Number(o[0])||0,Number(o[1])||0,Number(o[2])||0]:o&&typeof o=="object"?[Number(o.x)||0,Number(o.y)||0,Number(o.z)||0]:Array.isArray(e)?[Number(e[0])||0,Number(e[1])||0,Number(e[2])||0]:[0,0,0]}function B(o){if(!o||typeof o!="object")return!1;const e=s=>o[s]!=null||o[`${s}_x`]!=null||o[`${s}X`]!=null||o[`${s}_y`]!=null||o[`${s}Y`]!=null||o[`${s}_z`]!=null||o[`${s}Z`]!=null;return e("position")||e("orientation")}function J(o){if(o==null)return null;if(typeof o=="object"&&!Array.isArray(o))return o.placement_group??o.placementGroup??null;const e=A.getState();let s=e.products?.[o];if(s)return s.placement_group??s.placementGroup??null;const l=e.options?.[o];if(l){const a=l.value_product??l.valueProduct??(typeof l.value=="number"?l.value:null);if(a!=null&&(s=e.products?.[a],s))return s.placement_group??s.placementGroup??null}return null}function et(o){const e=J(o);return e==="floor_back_overlay"||e==="wall_back_overlay"||e==="tall_back_overlay"}function it(o){return J(o)==="countertop_overlay"}const st=new Set(["base","upper","tall","corner","wall_corner","island"]);function tt(o){if(typeof o!="string"||!o)return null;const[e,...s]=o.split("-"),l=e==="wcorner"?"wall_corner":e;return st.has(l)?s[0]==="part"?`${l}_part`:l:null}function lt(o,e={}){if(!o||typeof o!="string")return null;const s=e.hostProductOverrides??null,l=e.basePiecePositions??null;let a=null;if(s&&s[o]!=null)a=s[o];else if(l&&l[o]?.productId!=null)a=l[o].productId;else{const p=rt.getState();a=p.hostProductOverrides?.[o]??p.basePiecePositions?.[o]?.productId??null}if(a!=null){const p=A.getState().products||{},u=p[a]||p[String(a)],t=u?.cabinet_type??u?.cabinetType;if(t)return String(t).toLowerCase();if(u?.category==="island")return"island"}return tt(o)}function at(o,e){if(!o||e==null)return null;const s=A.getState().components||{},l=String(o),a=new Set([l,l.replace(/__.*$/,""),l.replace(/_\d+$/,"")]),p=String(e);for(const u of Object.values(s)){const t=String(u?.slotKey??u?.slot_key??""),c=String(u?.variantKey??u?.variant_key??"");if(a.has(t)&&c===p)return u.modelPath||u.model_path||u.modelUrl||u.model_url||null}return null}const H=(o,e,s)=>{if(!o)return null;const l=o.modelPath||o.modelUrl||o.model_url||o.url||o.asset_url||o.assetUrl,a=o.variants;if(a&&!Array.isArray(a)&&typeof a=="object"&&Object.keys(a).length>0){if(e!=null){const p=String(e);if((o.type==="door"||o.type==="drawer")&&s){const t=`${p}_${s}`;if(a[t])return L(a[t])}if(a[p])return L(a[p]);const u=Object.entries(a).find(([t])=>t.startsWith(p+"_"));if(u)return L(u[1])}return L(Object.values(a)[0])}if(Array.isArray(a)&&a.length>0){if(e!=null){const p=String(e),u=a.find(t=>String(t?.key??t?.id??t?.variantKey)===p);if(u)return L(u);if((o.type==="door"||o.type==="drawer")&&s){const t=`${p}_${s}`,c=a.find(S=>String(S?.key??S?.id??S?.variantKey)===t);if(c)return L(c)}}return L(a[0])}return l||null},L=o=>typeof o=="string"?o:o&&typeof o=="object"&&(o.url||o.modelUrl||o.model_url||o.asset_url||o.assetUrl)||null,ut=o=>{const e=A.getState().products[o];if(!e?.components_configuration)return null;for(const[s,l]of Object.entries(e.components_configuration)){const a=l&&typeof l=="object"&&(l.componentId??l.component_id)!=null?l.componentId??l.component_id:s,p=A.getState().components[a];if(p?.type==="body"){const u=l.variant_key??l.variantKey??e.width,t=H(p,u)||p.modelPath||p.model_path||p.modelUrl||p.model_url;if(t)return t}}return null},ct=(o,e=null,s=null,l=null)=>{const a=A.getState().products[o];if(!a)return[];if(Array.isArray(a.components_config)&&a.components_config.length>0){const u=a.components_config.map(t=>{const c=t?.component;if(!c)return null;let S=c.modelPath||c.model_path||c.modelUrl||c.model_url;if((c.type==="door"||c.type==="drawer")&&s){const h=A.getState(),k=c.groups||c.group_ids||[];for(const D of k){const P=h.componentGroups?.[D]?.variants?.[s];if(P!=null){const i=h.components?.[P],r=i?.modelPath||i?.model_path||i?.modelUrl||i?.model_url;if(r){S=r;break}}}}if(!S)return null;const w=[Number(t.position_x??0)||0,Number(t.position_y??0)||0,Number(t.position_z??0)||0],X=[Number(t.rotation_x??0)||0,Number(t.rotation_y??0)||0,Number(t.rotation_z??0)||0],m=[Number(t.scale_x??1)||1,Number(t.scale_y??1)||1,Number(t.scale_z??1)||1];return{id:c.id??c.name??Math.random().toString(36).slice(2),type:c.type||null,materialSlot:c.materialSlot??c.material_slot??null,variantKey:t.variant_key??t.variantKey??null,url:S,position:w,rotation:X.map(h=>h*Math.PI/180),scale:m}}).filter(Boolean);return ot(u,l,s)}if(!a.components_configuration)return[];const p=Object.entries(a.components_configuration).flatMap(([u,t])=>{let c=u,S=null;if(t&&typeof t=="object"&&!Array.isArray(t)){const g=t.componentId??t.component_id;g!=null&&(c=g,S=u)}const w=t&&typeof t=="object"&&!Array.isArray(t)&&(t.is_multi_instance===!0||t.isMultiInstance===!0)||Array.isArray(t),X=Array.isArray(t)?t:t?.instances||[];if(w&&X.length>0){const g=A.getState().components;let P=g[c];if(!P){for(const i of Object.values(g))if(String(i?.slotKey??i?.slot_key??"")===u){P=i;break}}return X.map((i,r)=>{const d=i?.componentId??i?.component_id,n=(d!=null?A.getState().components[d]:null)||P;if(!n)return null;const I=n.type==="handle",K=n.type==="door"||n.type==="drawer";let _;if(I?_=l||i.variant_key||i.variantKey:K?_=s||i.variant_key||i.variantKey:_=i.variant_key||i.variantKey,_==="none")return null;let N=null,Z=n;if(_!=null){const x=A.getState(),U=n.groups||n.group_ids||[];for(const b of U){const F=x.componentGroups?.[b]?.variants?.[_];if(F!=null){const $=x.components?.[F],G=$?.modelPath||$?.model_path||$?.modelUrl||$?.model_url;if(G){N=G,Z=$;break}}}}if(N||(N=H(n,_,null)||n.modelPath||n.model_path||n.modelUrl||n.model_url),!N)return null;const f=i.type_overrides?.[_]||{},R=f.style_overrides?.[s]||{},z=i.style_overrides?.[s]||{},E=R.position||f.position||z.position||i.position,y=R.rotation||f.rotation||z.rotation||i.rotation,Y=R.scale||f.scale||z.scale||i.scale;return{id:`${c}_${r}`,componentId:d??n.id,resolvedComponentId:Z?.id??d??n.id,slotKey:I?"comp_handle":u,type:n.type,materialSlot:n.materialSlot??n.material_slot??null,variantKey:_??null,url:N,position:M(E,[i.position_x??i.positionX,i.position_y??i.positionY,i.position_z??i.positionZ]),rotation:M(y,[i.rotation_x??i.rotationX,i.rotation_y??i.rotationY,i.rotation_z??i.rotationZ]).map(x=>x*Math.PI/180),scale:T(Y,[1,1,1]),anchor_points:i?.anchor_points??i?.anchorPoints??Z?.anchor_points??Z?.anchorPoints??null,groups:Z?.groups??Z?.group_ids??n?.groups??n?.group_ids??null}}).filter(Boolean)}const m=A.getState().components[c];if(!m||m.type==="handle"&&l!=null&&l==="none")return null;let h=m.type==="handle"&&l!=null&&l!=="none"?l:t.variant_key??t.variantKey;if(m.type!=="handle"&&e!==null&&e!==a.width){const g=String(e);g.includes("x")?h=g:h&&h.includes("x")?h=`${h.split("x")[0]}x${g}`:h=g}h==null&&(h=e!==null?e:a.width);let k=null,D=null;if(m.type==="handle"&&h!=null){const g=A.getState(),P=m.groups||m.group_ids||[];for(const i of P){const d=g.componentGroups?.[i]?.variants?.[h];if(d!=null){const n=g.components?.[d],I=n?.modelPath||n?.model_path||n?.modelUrl||n?.model_url;if(I){k=I,D=d;break}}}}if((m.type==="door"||m.type==="drawer")&&s){const g=A.getState(),P=m.groups||m.group_ids||[];for(const i of P){const d=g.componentGroups?.[i]?.variants?.[s];if(d!=null){const n=g.components?.[d],I=n?.modelPath||n?.model_path||n?.modelUrl||n?.model_url;if(I){k=I,D=d;break}}}}if(k||(k=H(m,h,s)),!k&&S&&h!=null){const g=A.getState().components;for(const[P,i]of Object.entries(g))if(i?.slotKey===S&&String(i?.variantKey??"")===String(h)&&(k=i.modelPath||i.model_path||i.modelUrl||i.model_url,k)){D=P;break}}return k||(k=m.modelPath||m.model_path||m.modelUrl||m.model_url),k?{id:S??String(c),componentId:c,resolvedComponentId:D,slotKey:S||(typeof c=="string"?c:null),type:m.type,materialSlot:m.materialSlot??m.material_slot??null,variantKey:h??null,url:k,position:M(t.position,[t.position_x??t.positionX,t.position_y??t.positionY,t.position_z??t.positionZ]),rotation:M(t.rotation,[t.rotation_x??t.rotationX,t.rotation_y??t.rotationY,t.rotation_z??t.rotationZ]).map(g=>g*Math.PI/180),scale:T(t.scale,[1,1,1])}:null}).filter(Boolean);return ot(p,l,s)};function ot(o,e,s=null){const l=A.getState().components,a=[],p=new Set;for(const t of o){const c=t.resolvedComponentId!=null&&(l[t.resolvedComponentId]||l[String(t.resolvedComponentId)])||t.componentId!=null&&(l[t.componentId]||l[String(t.componentId)])||l[t.id]||null;if(!c)continue;const S=t.anchor_points||t.anchorPoints||c.anchor_points||c.anchorPoints;if(Array.isArray(S)&&S.length>0){const r=S,d=A.getState().componentGroups||{};for(const n of r){const I=n.acceptedGroups||n.accepted_groups||[],K=n.excludedGroups||n.excluded_groups||[];if(!Array.isArray(I)||I.length===0)continue;const _=new Set(I.map(String)),N=new Set(K.map(String));let Z=!1;for(const f of o){if(f===t||p.has(f.id))continue;const R=l[f.id]||l[f.componentId]||(f.resolvedComponentId!=null?l[f.resolvedComponentId]:null),z=f.groups??R?.groups??[],E=Array.isArray(z)?z.map(String):[];if(!E.some(C=>_.has(C))||N.size&&E.some(C=>N.has(C)))continue;if((f.type??R?.type)==="handle"&&e==="none"){p.add(f.id);continue}const Y=M(n.position,[n.position_x??n.positionX,n.position_y??n.positionY,n.position_z??n.positionZ]),U=M(n.orientation,[n.orientation_x??n.orientationX,n.orientation_y??n.orientationY,n.orientation_z??n.orientationZ]).map(C=>C*Math.PI/180),b=Array.isArray(f.position)?f.position:[0,0,0],q=Array.isArray(f.rotation)?f.rotation:[0,0,0],F=t.rotation.some(C=>C!==0);let $,G;if(B(n))if(!F)$=[t.position[0]+Y[0],t.position[1]+Y[1],t.position[2]+Y[2]],G=U;else{const C=new v.Vector3(Y[0],Y[1],Y[2]);C.applyEuler(new v.Euler(t.rotation[0],t.rotation[1],t.rotation[2],"XYZ")),$=[t.position[0]+C.x,t.position[1]+C.y,t.position[2]+C.z];const Q=new v.Quaternion().setFromEuler(new v.Euler(t.rotation[0],t.rotation[1],t.rotation[2],"XYZ")),j=new v.Quaternion().setFromEuler(new v.Euler(U[0],U[1],U[2],"XYZ")),O=Q.clone().multiply(j),V=new v.Euler().setFromQuaternion(O,"XYZ");G=[V.x,V.y,V.z]}else $=b,G=q;a.push({...f,id:`${f.id}__${t.id}_${n.name||a.length}`,position:$,rotation:G}),p.add(f.id),Z=!0;break}if(!Z&&e!=="none")for(const f of I){const R=d[f]||d[String(f)];if(!R?.variants)continue;const z=e||R.defaultVariant||R.default_variant||Object.keys(R.variants)[0],E=R.variants[z]??R.variants[String(z)];if(E==null)continue;const y=l[E]||l[String(E)];if(!y)continue;const Y=y.modelPath||y.model_path||y.modelUrl||y.model_url;if(!Y)continue;const x=M(n.position,[n.position_x??n.positionX,n.position_y??n.positionY,n.position_z??n.positionZ]),b=M(n.orientation,[n.orientation_x??n.orientationX,n.orientation_y??n.orientationY,n.orientation_z??n.orientationZ]).map(j=>j*Math.PI/180),q=M(y.position,[y.position_x??y.positionX,y.position_y??y.positionY,y.position_z??y.positionZ]),$=M(y.rotation,[y.rotation_x??y.rotationX,y.rotation_y??y.rotationY,y.rotation_z??y.rotationZ]).map(j=>j*Math.PI/180),G=t.rotation.some(j=>j!==0);let C,Q;if(B(n))if(!G)C=[t.position[0]+x[0],t.position[1]+x[1],t.position[2]+x[2]],Q=b;else{const j=new v.Vector3(x[0],x[1],x[2]);j.applyEuler(new v.Euler(t.rotation[0],t.rotation[1],t.rotation[2],"XYZ")),C=[t.position[0]+j.x,t.position[1]+j.y,t.position[2]+j.z];const O=new v.Quaternion().setFromEuler(new v.Euler(t.rotation[0],t.rotation[1],t.rotation[2],"XYZ")),V=new v.Quaternion().setFromEuler(new v.Euler(b[0],b[1],b[2],"XYZ")),nt=O.clone().multiply(V),W=new v.Euler().setFromQuaternion(nt,"XYZ");Q=[W.x,W.y,W.z]}else C=q,Q=$;a.push({id:`synth_${E}__${t.id}_${n.name||a.length}`,componentId:E,resolvedComponentId:E,type:y.type||"handle",materialSlot:y.materialSlot??y.material_slot??null,variantKey:z,url:Y,position:C,rotation:Q,scale:[1,1,1]});break}}continue}const w=t.variantKey??t.variant_key,X=[];w!=null&&s!=null&&X.push(`${w}_${s}`),w!=null&&X.push(String(w)),s!=null&&X.push(String(s));const m=c.variants,h=[];if(Array.isArray(m))for(const r of m){if(!r||typeof r!="object")continue;const d=r.key??r.id??r.variantKey??r.variant_key??null;d!=null&&h.push({key:String(d).toLowerCase(),entry:r})}else if(m&&typeof m=="object")for(const[r,d]of Object.entries(m))h.push({key:String(r).toLowerCase(),entry:d});const k=c.variant_anchor_points||c.variantAnchorPoints||{},D=Array.isArray(k)?k.map(r=>({key:String(r?.key??r?.variant_key??r?.variantKey??"").toLowerCase(),entry:r})):Object.entries(k).map(([r,d])=>({key:String(r).toLowerCase(),entry:d})),g=[];for(const r of X)g.push(String(r).toLowerCase()),r.includes("_")&&g.push(r.split("_").reverse().join("_").toLowerCase());const P=r=>r&&typeof r=="object"?Array.isArray(r)?r:r.anchor_points||r.anchorPoints:null;let i=null;for(const r of g){const d=h.find(_=>_.key===r),n=P(d?.entry);if(Array.isArray(n)&&n.length>0){i=n;break}const I=D.find(_=>_.key===r),K=P(I?.entry);if(Array.isArray(K)&&K.length>0){i=K;break}}if(i||(i=c.anchor_points||c.anchorPoints),!i||i.length===0)for(const r of h){const d=P(r.entry);if(Array.isArray(d)&&d.length>0){i=d;break}}if(!i||i.length===0)for(const r of D){const d=P(r.entry);if(Array.isArray(d)&&d.length>0){i=d;break}}if(!(!Array.isArray(i)||i.length===0))for(const r of i){const d=r.acceptedGroups||r.accepted_groups||[],n=r.excludedGroups||r.excluded_groups||[];if(!Array.isArray(d)||d.length===0)continue;const I=new Set(d.map(String)),K=new Set(n.map(String));for(const _ of o){if(_===t||p.has(_.id))continue;const N=l[_.id],Z=(N?.groups||[]).map(String);if(!Z.some(b=>I.has(b))||K.size&&Z.some(b=>K.has(b)))continue;if(N?.type==="handle"&&e==="none"){p.add(_.id);continue}const f=M(r.position,[r.position_x??r.positionX,r.position_y??r.positionY,r.position_z??r.positionZ]),z=M(r.orientation,[r.orientation_x??r.orientationX,r.orientation_y??r.orientationY,r.orientation_z??r.orientationZ]).map(b=>b*Math.PI/180),E=Array.isArray(_.position)?_.position:[0,0,0],y=Array.isArray(_.rotation)?_.rotation:[0,0,0],Y=t.rotation.some(b=>b!==0);let x,U;if(B(r))if(!Y)x=[t.position[0]+f[0],t.position[1]+f[1],t.position[2]+f[2]],U=z;else{const b=new v.Vector3(f[0],f[1],f[2]);b.applyEuler(new v.Euler(t.rotation[0],t.rotation[1],t.rotation[2],"XYZ")),x=[t.position[0]+b.x,t.position[1]+b.y,t.position[2]+b.z];const q=new v.Quaternion().setFromEuler(new v.Euler(t.rotation[0],t.rotation[1],t.rotation[2],"XYZ")),F=new v.Quaternion().setFromEuler(new v.Euler(z[0],z[1],z[2],"XYZ")),$=q.clone().multiply(F),G=new v.Euler().setFromQuaternion($,"XYZ");U=[G.x,G.y,G.z]}else x=E,U=y;a.push({..._,id:`${_.id}__${t.id}_${r.name||a.length}`,position:x,rotation:U}),p.add(_.id);break}}}let u=p.size===0&&a.length===0?o:[...o.filter(t=>!p.has(t.id)),...a];return e==="none"&&(u=u.filter(t=>{const c=String(t.id).split("__")[0];return l[c]?.type!=="handle"})),u.map(t=>({...t,rotationRad:!0}))}const pt=()=>{for(const[,o]of Object.entries(A.getState().products))if(o.width)for(const[e,s]of Object.entries(o.components_configuration||{})){const l=s&&typeof s=="object"&&(s.componentId??s.component_id)!=null?s.componentId??s.component_id:e,a=A.getState().components[l];if(a?.type==="body"){const p=s.variant_key??s.variantKey??o.width,u=H(a,p)||a.modelPath||a.model_path||a.modelUrl||a.model_url;if(u)return{url:u,widthInches:o.width}}}return null};function dt(o){const e=new v.Box3().setFromObject(o);return{width:e.max.x-e.min.x,height:e.max.y-e.min.y,depth:e.max.z-e.min.z}}export{B as _anchorHasData,pt as findReferenceBodyModel,lt as getHostType,dt as getModelDimensions,ct as getProductAllComponents,ut as getProductBodyModelUrl,J as getProductPlacementGroup,at as lookupVariantUrl,tt as pieceKindOf,it as productIsSurfaceOverlay,yt as productRefsMatch,et as productReplacesPieceBody,H as resolveComponentUrl};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as a}from"react/jsx-runtime";import t from"react";class o extends t.Component{constructor(r){super(r),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(r,s){}render(){return this.state.hasError?a("div",{style:{padding:"16px",textAlign:"center",color:"var(--text-tertiary, #999)",fontSize:"14px"},children:[e("p",{children:"\u274C Not Connected"}),e("p",{style:{fontSize:"12px",marginTop:"8px"},children:"Chat is temporarily unavailable. Please refresh the page."})]}):this.props.children}}var p=o;export{p as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import S from"./8f60e5059a.js";import w from"./872c4302e0.js";import L,{deriveSceneFeatures as b}from"./be337ddda5.js";import D from"./9c6c598569.js";import N from"./d94df858ea.js";import{extractHostedProductsFromProducts as W,placeHostedProductsFromList as j}from"./37addc7fb3.js";import{isWallCornerProduct as R}from"./5e4f2349ff.js";import{FEATURE_ROLES as u,FEATURE_TYPES as x,findFeatureByType as Y,pickToggleOption as $,roleSelectionsToFeatureIds as U}from"./f8cb80a93c.js";import{normalizeLayoutConfig as z}from"./bb719febc6.js";function k(a,y,O){if(!a)return{color:null,materialId:null};if(a.startsWith("#"))return{color:a,materialId:null};const f=y[a];if(!f)return{color:null,materialId:null};const o=f.value||null;return{color:(o?O[o]:null)?.color||f.color||f.color_hex||null,materialId:o}}function M(a,y,O,f){const o={finishes:{},materials:{},styles:{},handleTypes:{},hardwareFinishes:{}},d=s=>O[s]?.value??s,p=(s,l,m,{fillOnly:H=!1}={})=>{const E=(e,i)=>{i==null||i===""||H&&o[e][s]!=null||(o[e][s]=i)},_=l||{};if(_[u.PIECE_FINISH]){const{color:e,materialId:i}=k(_[u.PIECE_FINISH],O,f);E("finishes",e),E("materials",i)}m&&E("materials",m),_[u.DOOR_STYLE]&&E("styles",d(_[u.DOOR_STYLE])),_[u.HANDLE_TYPE]&&E("handleTypes",d(_[u.HANDLE_TYPE])),_[u.HARDWARE_FINISH]&&E("hardwareFinishes",d(_[u.HARDWARE_FINISH]))},t="island",c={corner:0,[t]:0},r=(s,l)=>{const m=s.type||"base";return m==="corner"?`corner-${c.corner++}`:m===t?`${t}-part-${c[t]++}`:`${m}-${l}`},n=a.map((s,l)=>r(s,l));a.forEach((s,l)=>p(n[l],s.selections,s.materialId));const g=c[t],h=y?.freePieceConfig;if(h&&g>0){p(t,h.selections,null,{fillOnly:!0});for(let s=0;s<g;s++){const l=`${t}-part-${s}`;for(const m of Object.keys(o))o[m][l]==null&&o[m][t]!=null&&(o[m][l]=o[m][t])}}else if(g>0){const s=a.find(l=>(l.type||"base")===t);s&&p(t,s.selections,s.materialId)}const P=S.getState(),F={},T={finishes:"hostFinishes",materials:"hostMaterials",styles:"hostStyles",handleTypes:"hostHandleTypes",hardwareFinishes:"hostHardwareFinishes"};for(const[s,l]of Object.entries(T))Object.keys(o[s]).length>0&&(F[l]={...P[l],...o[s]});const C={};return a.forEach((s,l)=>{s.product_id&&(C[n[l]]=s.product_id)}),{stylingUpdate:F,overridesToRestore:C}}function G(a,y,O){const f=S.getState(),o={finishes:{},materials:{},styles:{},handleTypes:{},hardwareFinishes:{}},d=c=>y[c]?.value??c;a.forEach((c,r)=>{const n=`wcorner-${r}`,g=c.selections||{};if(g[u.PIECE_FINISH]){const{color:h,materialId:P}=k(g[u.PIECE_FINISH],y,O);h&&(o.finishes[n]=h),P&&(o.materials[n]=P)}c.materialId&&(o.materials[n]=c.materialId),g[u.DOOR_STYLE]&&(o.styles[n]=d(g[u.DOOR_STYLE])),g[u.HANDLE_TYPE]&&(o.handleTypes[n]=d(g[u.HANDLE_TYPE])),g[u.HARDWARE_FINISH]&&(o.hardwareFinishes[n]=d(g[u.HARDWARE_FINISH]))});const p={},t={finishes:"hostFinishes",materials:"hostMaterials",styles:"hostStyles",handleTypes:"hostHandleTypes",hardwareFinishes:"hostHardwareFinishes"};for(const[c,r]of Object.entries(t))Object.keys(o[c]).length>0&&(p[r]={...f[r],...o[c]});Object.keys(p).length>0&&S.setState(p)}function V(a,y,O,f){const o=()=>S.getState().clearSceneLoading(),d=()=>{y.length>0?setTimeout(()=>{j(y)},400):o()};if(a.length>0){let p=0;const t=()=>{if(p>=a.length){G(a,O,f),setTimeout(()=>{const{pieceConfigSnapshot:r}=S.getState();r&&S.getState().setInitialPieceConfigSnapshot(r)},400),setTimeout(d,300);return}const c=a[p];S.setState({pendingWallCornerAdd:{productId:c.product_id}}),p++,setTimeout(t,300)};t()}else setTimeout(d,300)}function se(a,y){const O=w.getState().options,f=L.getState().sceneConfigurations,o=L.getState().originalSceneConfigurations,d=N.getState().setSceneSelection,p=D.getState().initializeScene,t=S.getState();D.getState().resetCameraToDefault(),t.clearHostedProducts(),t.clearHostWidths(),t.clearHostDoorTypes(),t.clearHostProductOverrides(),t.clearHostFinishes(),t.clearHostStyles(),t.clearHostHandleTypes(),t.clearHostHardwareFinishes(),t.clearDisabledWalls(),t.clearSelectedFeature(),S.setState({_snapshotOverridesOnLoadComplete:!0,isLayoutLoading:!0,pieceOverlapDetected:!1,tallWallOverlapDetected:!1,wallPieceOverlapDetected:!1,wallPieceHostedOverlapDetected:!1,overlappingPieces:[],islandOverlapDetected:!1,skipWallPieceOverlapCheck:!0,cornerOverflowDetected:!1,wallOverflowDetected:!1,wallOverflowRecenterMode:!1,wallOverflowSuppressUntil:Date.now()+1500}),t.setFreePiecePosition(null),t.setFreePieceRotation(null),y.forEach(e=>{e.type!=="layout_change"&&(e.default_option_id?d(e.id,e.default_option_id):d(e.id,null))});const c=()=>(S.setState({isSceneLoading:!1,sceneLoadingMessage:null,isLayoutLoading:!1}),!1),r=O[a];if(!r)return c();let n=null;for(const[e,i]of Object.entries(f)){const I=i?.scene_option_id??i?.sceneOptionId;if(I!=null&&String(I)===String(a)){n=e;break}}if(!n){const e=[r.value,r.valueText,r.value_text,a].filter(i=>i!=null).map(String);for(const i of e)if(f[i]){n=i;break}}if(!n){let e=r.value??r.valueText??r.value_text;if(!e&&Array.isArray(r.rules))for(const i of r.rules){const I=i?.effectParams??i?.effect_params??{},v=I.layout??I.value??I.variant_key;if(v){e=v;break}}if(!e&&r.name&&(e=String(r.name).trim().toLowerCase().replace(/[\s-]+/g,"_")),e){const i=`scene_config_${e}_internal`;f[i]&&(n=i)}}if(!n||!f[n])return c();const g=o[n]||f[n],h=z(g,b(g),U),P=h?.products||[],F=h?.freePieceConfig?.product_id||[],T=[...P,...F],{pendingHostedProducts:C}=W(T),s=T.filter(R),l=T.filter(e=>!R(e)),m=l.some(e=>e.type==="island")||F.length>0,H=Y(b(h),x.FREE_PIECE);if(H){const e=$(H,O,{on:m,tier:h?.freePieceConfig?.tier??null});e!=null&&d(H.id,e)}if(h?.freePieceConfig){const e=h.freePieceConfig;e.tier&&t.setFreePieceTier(e.tier),e.width&&t.setFreePieceWidthOption(e.width)}for(const[e,i]of Object.entries(h?.default_scene_selections||{}))i!=null&&d(e,i);const E=o[n];E&&L.setState(e=>({sceneConfigurations:{...e.sceneConfigurations,[n]:E}})),p(n);const _=C.length>0||s.length>0||P.some(e=>e.selections&&Object.keys(e.selections).length>0||e.materialId);setTimeout(_?()=>{const e=w.getState().options,i=w.getState().materials,{stylingUpdate:I,overridesToRestore:v}=M(l,h,e,i);if(Object.keys(I).length>0&&S.setState(I),Object.keys(v).length>0){const A=S.getState().hostProductOverrides;S.setState({hostProductOverrides:{...A,...v}})}V(s,C,e,i)}:()=>{S.getState().clearSceneLoading()},600)}export{se as executeLayoutChange,k as resolveFinish,M as restorePieceStyling};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t={arExportApi:"https://umxjb5nojofpnpe5dt4wtpf3ca0nplsl.lambda-url.us-east-1.on.aws/",mediaBase:"https://media-stag.imagine.io/",modelViewerSrc:"https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js",arViewerBase:"https://configurator.imagine.io/ar-viewer"};function a(e={}){if(!(!e||typeof e!="object"))for(const o of Object.keys(e))o in t&&typeof e[o]=="string"&&e[o]&&(t[o]=e[o])}const r=()=>t.arExportApi,i=()=>t.mediaBase,s=()=>t.modelViewerSrc,p=()=>t.arViewerBase;export{r as getArExportApiUrl,p as getArViewerBase,i as getMediaBaseUrl,s as getModelViewerSrc,a as setServiceUrls};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{emitEvent as g,EVENTS as _}from"./2e366d7386.js";const i=new Map,s=new Map,f=[],p=[],l=[];let a=null;const y=t=>typeof t=="string"?t.trim().toLowerCase():"";function S(t,e){const n=y(t);return!n||typeof e!="function"?()=>{}:(i.set(n,e),c(),()=>{i.get(n)===e&&(i.delete(n),c())})}function C(t){const e=y(t);return e&&i.get(e)||null}function v(){return Array.from(i.keys())}function E(t){return typeof t!="function"?()=>{}:(f.unshift(t),c(),()=>{const e=f.indexOf(t);e!==-1&&(f.splice(e,1),c())})}function k(t,{Default:e,THREE:n}={}){for(const r of f.slice())try{const o=r({spec:t,Default:e,THREE:n});if(o)return o}catch{}return null}function M(){return f.length}function w(t,e){const n=y(t);return!n||typeof e!="function"?()=>{}:(s.set(n,e),c(),()=>{s.get(n)===e&&(s.delete(n),c())})}function D(t,e,n){const r=s.get(y(t));if(!r)return n?.(e);try{return r({...e,Default:n?u=>n(u===void 0?e:u):void 0})}catch{return n?.(e)}}function b(){return Array.from(s.keys())}function A(t){if(typeof t!="function")return()=>{};p.push(t);const e=[];return a&&d(t,r=>{typeof r=="function"&&(e.push(r),l.push(r))}),()=>{const r=p.indexOf(t);r!==-1&&p.splice(r,1);for(const o of e){try{o()}catch{}const u=l.indexOf(o);u!==-1&&l.splice(u,1)}}}function d(t,e){try{const n=t({...a,registerDisposable:e});typeof n=="function"&&e(n)}catch{}}function I(t){if(a=t||null,!!a){try{g(_.SCENE_READY,{})}catch{}for(const e of p.slice())d(e,n=>{typeof n=="function"&&l.push(n)})}}function O(){return a}function m(){for(const t of l.splice(0))try{t()}catch{}}let h=0;const x=new Set;function c(){h+=1;for(const t of x)try{t()}catch{}}function N(t){return x.add(t),()=>{x.delete(t)}}function V(){return h}function j(){i.clear(),s.clear(),f.length=0,p.length=0,m(),c()}export{j as _resetSceneRegistry,m as disposeSceneExtras,O as getSceneContext,V as getSceneRegistryVersion,v as listComponentRenderers,b as listInteractions,M as listMaterialResolvers,A as onSceneReady,S as registerComponentRenderer,w as registerInteraction,E as registerMaterialResolver,C as resolveComponentRenderer,k as resolveMaterial,D as runInteraction,I as setSceneContext,N as subscribeSceneRegistry};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const n=new Map,f=new Map;function i(r,e){if(r==null||typeof e!="function")return()=>{};const t=String(r),o=n.get(t)||[];return o.push(e),n.set(t,o),()=>{const c=n.get(t)||[];n.set(t,c.filter(s=>s!==e))}}function u(r,e){if(r==null||typeof e!="function")return()=>{};const t=String(r);return f.set(t,e),()=>{f.get(t)===e&&f.delete(t)}}function p(r){if(!Array.isArray(r))return;const e=n.get("*")||[];for(const t of r){if(!t||typeof t.name!="string")continue;const o=n.get(t.name)||[];for(const c of o)try{c(t)}catch{}for(const c of e)try{c(t)}catch{}}}function y(r){if(Array.isArray(r))for(const e of r){if(!e||typeof e.type!="string")continue;const t=f.get(e.type);if(t)try{t(e)}catch{}}}function a(){n.clear(),f.clear()}export{a as _resetEventBus,y as dispatchCustomEffects,p as dispatchEvents,i as on,u as registerEffectHandler};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as s}from"react/jsx-runtime";import{useEffect as p,useState as L,useRef as S}from"react";import{useLabels as b}from"./28d887bf8a.js";import t from"./8f60e5059a.js";import y from"./88251d6671.js";import{resolveComponent as E,useComponentRegistry as I}from"./882bc739c8.js";import"./e6eed481cc.css";const a=400;function M(){const r=b(),u=t(e=>e.isEvaluating),l=t(e=>e.isSceneLoading),c=t(e=>e.sceneLoadingMessage),g=t(e=>e.initialSceneLoading),d=t(e=>e.bootEvaluating),[f,n]=L(!1),o=S(0);I();const m=E("LoadingScreen",y),i=u||l;return p(()=>{if(i){o.current=Date.now(),n(!0);return}const e=Date.now()-o.current;if(e>=a){n(!1);return}const v=setTimeout(()=>n(!1),a-e);return()=>clearTimeout(v)},[i]),!f||g||d?null:s("div",{className:"evaluating-overlay evaluating-overlay--visible",role:"status","aria-busy":"true","aria-live":"polite",children:s(m,{compact:!0,message:c||r("overlay.updating","Updating\u2026")})})}export{M as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"react";class e extends t.Component{constructor(r){super(r),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(){}render(){return this.state.hasError?null:this.props.children}}var n=e;export{n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useMemo as d}from"react";import o from"./8f60e5059a.js";import{useAiChatEntitled as l}from"./6b0a81e4f8.js";function g(){const e=o(r=>r.isMobile),t=o(r=>r.selectedFeatureId),s=o(r=>r.selectedElementType),n=o(r=>r.isLayoutLoading),i=o(r=>r.pieceConfigSnapshot);return d(()=>({isMobile:!!e,selectedFeatureId:t??null,selectedElementType:s??null,isLayoutLoading:!!n,pieceConfigSnapshot:i??null}),[e,t,s,n,i])}function S(){const e=o(i=>i.disabledOptions),t=o(i=>i.hiddenOptions),s=o(i=>i.managedOptionSets),n=o(i=>i.featureToOptionsMap);return d(()=>({disabled:e||{},hidden:t||{},managedOptionSets:s||{},featureToOptions:n||{}}),[e,t,s,n])}function h(){const e=o(c=>c.pendingHostedProduct),t=o(c=>c.pendingSlotPlacement),s=o(c=>c.sceneHostedProducts),n=o(c=>c.occupiedPieceSlots),i=o(c=>c.standalonePlacements),r=o(c=>c.deferredHostedProductPlacement);return d(()=>({pending:e??null,pendingSlot:t??null,placed:s||[],occupiedSlots:n||{},standalone:i||[],deferred:r??null}),[e,t,s,n,i,r])}const a=Object.freeze(["sidebar","header","toolbar","panels","chat","notifications","save","generateAssets","selection"]);function m(e){const t=o(n=>n.regions?n.regions[e]!==!1:!0),s=l();return e==="chat"?t&&s:t}function P(){const e=o(n=>n.guiVisible)!==!1,t=o(n=>n.regions),s=l();return d(()=>{const n={};for(const i of a)n[i]=e&&(t?t[i]!==!1:!0);return n.chat=n.chat&&s,n},[e,t,s])}function O(){try{const e=o.getState().regions||{},t={};for(const s of a)t[s]=e[s]!==!1;return t}catch{return a.reduce((e,t)=>({...e,[t]:!0}),{})}}function I(){const e=o.getState();return{deferred:e.deferredHostedProductPlacement??null,standalone:e.standalonePlacements||[],hostProductOverrides:e.hostProductOverrides||{},pieceConfigSnapshot:e.pieceConfigSnapshot??null,initialPerPieceOverrides:e.initialPerPieceOverrides||{}}}export{a as UI_REGIONS,O as getUIRegions,I as getUIState,h as useHostedProductState,S as useOptionGating,m as useUIRegion,P as useUIRegions,g as useUIState};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Fragment as fe,jsx as e,jsxs as E}from"react/jsx-runtime";import{Suspense as W,useEffect as I,useRef as x,useSyncExternalStore as N}from"react";import{getSceneAccessGranted as j,subscribeSceneAccess as Q}from"./87f511c4a8.js";import*as R from"three";import{Canvas as U,useThree as A}from"@react-three/fiber";import{setSceneContext as T,disposeSceneExtras as _}from"./95a44ebec2.js";import{PerspectiveCamera as q,OrbitControls as J}from"@react-three/drei";import K from"./be337ddda5.js";import F from"./8f60e5059a.js";import"./9c6c598569.js";import X from"./d4378d9afa.js";import Y from"./00a41227ff.js";import Z from"./28a9d58274.js";import $ from"./8db8655f21.js";import{rememberRenderer as ee}from"./b59b0dde17.js";import te from"./14c83bc57a.js";import{applyEnvironmentToRenderer as oe}from"./4e7d0a0d4a.js";import{setR3FState as L}from"./e1cd279733.js";import{computeTopDownView as re,computeFitView as ne,ORTHO_FOV as z}from"./85af90fade.js";const B=(t,o)=>t?o:Math.max(o,1e5);function ie({defaultPosition:t,fov:o,controlsRef:a,controlsTarget:f,maxDistance:c}){const{scene:p,size:m,invalidate:h}=A(),u=F(r=>r.is3D)!==!1,g=x(),w=x(u),D=x(!1);return I(()=>{const r=g.current,n=a?.current;if(!r)return;const y=w.current;w.current=u;const b=!D.current;D.current=!0;const C=m.width/Math.max(m.height,1);if(n&&(n.maxDistance=B(u,c)),!u){const i=re({scene:p,aspect:C,fov:z});if(!i)return;r.fov=z,r.position.set(i.position[0],i.position[1],i.position[2]),r.updateProjectionMatrix(),n&&(n.target.set(i.target[0],i.target[1],i.target[2]),n.update()),h?.();return}if(y&&!b){r.updateProjectionMatrix(),h?.();return}r.fov=o;const S=y?null:ne({scene:p,aspect:C,fov:o}),v=S?.position||t,M=S?.target||f;r.position.set(v[0],v[1],v[2]),r.updateProjectionMatrix(),n&&(n.target.set(M[0],M[1],M[2]),n.update()),h?.()},[u,p,m.width,m.height]),e(q,{ref:g,makeDefault:!0,position:t,fov:o})}function ae(){const{gl:t,scene:o,camera:a,invalidate:f}=A(),c=N(Q,j,()=>!1);return I(()=>(L({gl:t,scene:o,camera:a}),c?T({THREE:R,scene:o,camera:a,renderer:t,invalidate:f}):T(null),()=>{_(),T(null),L(null)}),[t,o,a,c]),null}function se({background:t="#f4f4f5"}){return E(fe,{children:[e("color",{attach:"background",args:[t]}),e("ambientLight",{intensity:.7}),e("directionalLight",{position:[4,6,4],intensity:1.1,castShadow:!0,"shadow-mapSize-width":1024,"shadow-mapSize-height":1024})]})}function ce({env:t}){return!!t&&Object.keys(t).length>0?null:E("mesh",{rotation:[-Math.PI/2,0,0],position:[0,.001,0],receiveShadow:!0,children:[e("circleGeometry",{args:[21,64]}),e("shadowMaterial",{transparent:!0,opacity:.28,color:"#000000"})]})}function ue({children:t,overlay:o,isMobile:a=!1,is3D:f,camera:c={position:[2.6,2.2,4],fov:45},controlsTarget:p=[0,.5,0],renderCamera:m=!0,renderControls:h=!0,minDistance:u=1.2,maxDistance:g=14,orbitProps:w,renderFallbackLighting:D=!0,fallbackBackground:r="#f4f4f5",groundShadowCatcher:n=!1,fallback:y=null,dpr:b=[1,2],shadows:C=!0,frameloop:S,canvasStyle:v,onPointerMissed:M,onCreated:i}){const k=x(),P=K(s=>s.systemEnvironment),V=F(s=>s.is3D),G=F(s=>s.captureMode)===!0,O=f??V!==!1,l=P&&Object.keys(P).length>0?P:null,H=B(O,g);return E("div",{className:"scene-canvas",style:{position:"relative",width:"100%",height:"100%"},children:[E(U,{shadows:C,dpr:b,...S?{frameloop:S}:{},style:{width:"100%",height:"100%",...v||{}},onPointerMissed:M,onCreated:s=>{const{gl:d}=s;ee(d),d.outputColorSpace=R.SRGBColorSpace,d.toneMapping=R.ACESFilmicToneMapping,d.toneMappingExposure=.9,d.shadowMap.type=R.PCFSoftShadowMap,l&&oe(l,d),j()&&i?.(s)},children:[l&&e(X,{env:l,isMobile:a,is3D:O,reducedQuality:!!a,captureMode:G}),!l&&D&&e(se,{background:r}),n&&O&&!G&&e(ce,{env:l}),m&&e(ie,{defaultPosition:c.position,fov:c.fov,controlsRef:k,controlsTarget:p,maxDistance:g}),e(W,{fallback:y,children:t}),h&&e(J,{ref:k,makeDefault:!0,target:p,enablePan:!0,minDistance:u,maxDistance:H,maxPolarAngle:Math.PI/2.05,...w||{}}),e(ae,{}),e(te,{controlsRef:k}),e(Y,{})]}),o,e(Z,{}),e($,{})]})}export{ue as default};
|