@xpert-ai/plugin-motion 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,910 +1,48 @@
|
|
|
1
1
|
;
|
|
2
|
-
"use strict";(()=>{var Qf=Object.defineProperty;var em=(e,t)=>{for(var a in t)Qf(e,a,{get:t[a],enumerable:!0})};var G={};em(G,{Children:()=>ft,Component:()=>om,Fragment:()=>Ye,Profiler:()=>rm,PureComponent:()=>nm,StrictMode:()=>im,Suspense:()=>sm,cloneElement:()=>Rt,createContext:()=>Pt,createElement:()=>N,createFactory:()=>lm,createRef:()=>dm,default:()=>am,forwardRef:()=>I,isValidElement:()=>Ia,lazy:()=>um,memo:()=>cm,startTransition:()=>fm,useCallback:()=>Q,useContext:()=>kt,useDebugValue:()=>mm,useDeferredValue:()=>pm,useEffect:()=>F,useId:()=>hm,useImperativeHandle:()=>gm,useInsertionEffect:()=>xm,useLayoutEffect:()=>Jt,useMemo:()=>he,useReducer:()=>_o,useRef:()=>D,useState:()=>k,useSyncExternalStore:()=>vm,useTransition:()=>ym,version:()=>bm});function tm(e){return window[e]}var me=tm("React"),am=me,ft=me.Children,om=me.Component,Ye=me.Fragment,rm=me.Profiler,nm=me.PureComponent,im=me.StrictMode,sm=me.Suspense,Rt=me.cloneElement,Pt=me.createContext,N=me.createElement,lm=me.createFactory,dm=me.createRef,I=me.forwardRef,Ia=me.isValidElement,um=me.lazy,cm=me.memo,fm=me.startTransition,Q=me.useCallback,kt=me.useContext,mm=me.useDebugValue,pm=me.useDeferredValue,F=me.useEffect,hm=me.useId,gm=me.useImperativeHandle,xm=me.useInsertionEffect,Jt=me.useLayoutEffect,he=me.useMemo,_o=me.useReducer,D=me.useRef,k=me.useState,vm=me.useSyncExternalStore,ym=me.useTransition,bm=me.version;function wm(e){return window[e]}var Ss=wm("ReactDOM"),Is=Ss.createRoot,ky=Ss.hydrateRoot;function Rs(e={}){let t=e.styleId??"xpert-plugin-shadcn-ui-vars";if(typeof document>"u"||document.getElementById(t))return;let a=document.createElement("style");a.id=t,a.textContent=`
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
--xps-destructive-foreground: var(--xui-color-destructive-foreground, #ffffff);
|
|
20
|
-
--xps-destructive-background: var(--xui-color-destructive-background, #fee2e2);
|
|
21
|
-
--xps-warning: var(--xui-color-warning, #b45309);
|
|
22
|
-
--xps-warning-background: var(--xui-color-warning-background, #fffbeb);
|
|
23
|
-
--xps-success: var(--xui-color-success, #047857);
|
|
24
|
-
--xps-success-background: var(--xui-color-success-background, #ecfdf5);
|
|
25
|
-
--xps-border: var(--xui-color-border, #e2e8f0);
|
|
26
|
-
--xps-input: var(--xui-color-input, var(--xps-border));
|
|
27
|
-
--xps-ring: var(--xui-color-ring, var(--xps-primary));
|
|
28
|
-
--xps-radius: var(--xui-radius-md, 0.5rem);
|
|
29
|
-
--xps-font-sans: var(--xui-font-sans, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
|
|
30
|
-
--xps-control-height: var(--xui-control-height, 2rem);
|
|
31
|
-
--xps-control-height-sm: var(--xui-control-height-sm, 1.75rem);
|
|
32
|
-
--xps-control-height-lg: var(--xui-control-height-lg, 2.25rem);
|
|
33
|
-
--xps-control-padding-x: var(--xui-control-padding-x, 0.625rem);
|
|
34
|
-
--xps-control-padding-x-sm: var(--xui-control-padding-x-sm, 0.625rem);
|
|
35
|
-
--xps-control-padding-x-lg: var(--xui-control-padding-x-lg, 0.875rem);
|
|
36
|
-
--xps-control-font-size: var(--xui-control-font-size, 0.8125rem);
|
|
37
|
-
--xps-control-font-size-sm: var(--xui-control-font-size-sm, 0.75rem);
|
|
38
|
-
--xps-sidebar-rail-width: var(--xui-sidebar-rail-width, 2.75rem);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.xps-button {
|
|
42
|
-
display: inline-flex;
|
|
43
|
-
align-items: center;
|
|
44
|
-
justify-content: center;
|
|
45
|
-
gap: 0.5rem;
|
|
46
|
-
height: var(--xps-control-height);
|
|
47
|
-
border-radius: calc(var(--xps-radius) - 1px);
|
|
48
|
-
border: 1px solid transparent;
|
|
49
|
-
padding: 0 var(--xps-control-padding-x);
|
|
50
|
-
font-family: inherit;
|
|
51
|
-
font-size: var(--xps-control-font-size);
|
|
52
|
-
font-weight: 600;
|
|
53
|
-
line-height: 1;
|
|
54
|
-
white-space: nowrap;
|
|
55
|
-
cursor: pointer;
|
|
56
|
-
user-select: none;
|
|
57
|
-
transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
|
|
58
|
-
}
|
|
59
|
-
.xps-button:focus-visible,
|
|
60
|
-
.xps-checkbox:focus-visible,
|
|
61
|
-
.xps-command-input:focus,
|
|
62
|
-
.xps-dropdown-menu-item:focus,
|
|
63
|
-
.xps-input:focus,
|
|
64
|
-
.xps-select-trigger:focus,
|
|
65
|
-
.xps-slider-thumb:focus-visible,
|
|
66
|
-
.xps-switch:focus-visible,
|
|
67
|
-
.xps-tabs-trigger:focus-visible,
|
|
68
|
-
.xps-textarea:focus {
|
|
69
|
-
outline: none;
|
|
70
|
-
border-color: var(--xps-ring);
|
|
71
|
-
box-shadow: 0 0 0 2px color-mix(in srgb, var(--xps-ring) 18%, transparent);
|
|
72
|
-
}
|
|
73
|
-
.xps-button:disabled {
|
|
74
|
-
opacity: 0.55;
|
|
75
|
-
cursor: not-allowed;
|
|
76
|
-
pointer-events: none;
|
|
77
|
-
}
|
|
78
|
-
.xps-button--default {
|
|
79
|
-
background: var(--xps-primary);
|
|
80
|
-
color: var(--xps-primary-foreground);
|
|
81
|
-
border-color: var(--xps-primary);
|
|
82
|
-
}
|
|
83
|
-
.xps-button--default:hover {
|
|
84
|
-
background: color-mix(in srgb, var(--xps-primary) 90%, #000000 10%);
|
|
85
|
-
border-color: color-mix(in srgb, var(--xps-primary) 90%, #000000 10%);
|
|
86
|
-
}
|
|
87
|
-
.xps-button--secondary {
|
|
88
|
-
background: var(--xps-secondary);
|
|
89
|
-
color: var(--xps-secondary-foreground);
|
|
90
|
-
border-color: var(--xps-secondary);
|
|
91
|
-
}
|
|
92
|
-
.xps-button--secondary:hover,
|
|
93
|
-
.xps-button--ghost:hover {
|
|
94
|
-
background: color-mix(in srgb, var(--xps-muted) 82%, var(--xps-foreground) 6%);
|
|
95
|
-
}
|
|
96
|
-
.xps-button--outline {
|
|
97
|
-
background: var(--xps-card);
|
|
98
|
-
color: var(--xps-foreground);
|
|
99
|
-
border-color: var(--xps-border);
|
|
100
|
-
}
|
|
101
|
-
.xps-button--outline:hover {
|
|
102
|
-
background: var(--xps-muted);
|
|
103
|
-
}
|
|
104
|
-
.xps-button--ghost {
|
|
105
|
-
background: transparent;
|
|
106
|
-
color: var(--xps-foreground);
|
|
107
|
-
border-color: transparent;
|
|
108
|
-
}
|
|
109
|
-
.xps-button--destructive {
|
|
110
|
-
background: var(--xps-card);
|
|
111
|
-
color: var(--xps-destructive);
|
|
112
|
-
border-color: color-mix(in srgb, var(--xps-destructive) 28%, var(--xps-border));
|
|
113
|
-
}
|
|
114
|
-
.xps-button--destructive:hover {
|
|
115
|
-
background: var(--xps-destructive);
|
|
116
|
-
color: var(--xps-destructive-foreground);
|
|
117
|
-
border-color: var(--xps-destructive);
|
|
118
|
-
}
|
|
119
|
-
.xps-button--destructive-outline {
|
|
120
|
-
background: var(--xps-card);
|
|
121
|
-
color: var(--xps-destructive);
|
|
122
|
-
border-color: color-mix(in srgb, var(--xps-destructive) 24%, var(--xps-border));
|
|
123
|
-
}
|
|
124
|
-
.xps-button--sm {
|
|
125
|
-
height: var(--xps-control-height-sm);
|
|
126
|
-
padding: 0 var(--xps-control-padding-x-sm);
|
|
127
|
-
font-size: var(--xps-control-font-size-sm);
|
|
128
|
-
}
|
|
129
|
-
.xps-button--lg {
|
|
130
|
-
height: var(--xps-control-height-lg);
|
|
131
|
-
padding: 0 var(--xps-control-padding-x-lg);
|
|
132
|
-
}
|
|
133
|
-
.xps-button--icon {
|
|
134
|
-
width: var(--xps-control-height);
|
|
135
|
-
padding: 0;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.xps-input,
|
|
139
|
-
.xps-select-trigger,
|
|
140
|
-
.xps-textarea {
|
|
141
|
-
width: 100%;
|
|
142
|
-
border: 1px solid var(--xps-input);
|
|
143
|
-
border-radius: calc(var(--xps-radius) - 1px);
|
|
144
|
-
background: var(--xps-card);
|
|
145
|
-
color: var(--xps-foreground);
|
|
146
|
-
box-sizing: border-box;
|
|
147
|
-
font-family: inherit;
|
|
148
|
-
font-size: var(--xps-control-font-size);
|
|
149
|
-
transition: border-color 120ms ease, box-shadow 120ms ease;
|
|
150
|
-
}
|
|
151
|
-
.xps-input,
|
|
152
|
-
.xps-select-trigger {
|
|
153
|
-
height: var(--xps-control-height);
|
|
154
|
-
padding: 0 var(--xps-control-padding-x);
|
|
155
|
-
}
|
|
156
|
-
.xps-select-trigger {
|
|
157
|
-
display: flex;
|
|
158
|
-
align-items: center;
|
|
159
|
-
justify-content: space-between;
|
|
160
|
-
gap: 0.5rem;
|
|
161
|
-
cursor: pointer;
|
|
162
|
-
line-height: 1;
|
|
163
|
-
}
|
|
164
|
-
.xps-select-trigger[data-placeholder] {
|
|
165
|
-
color: var(--xps-muted-foreground);
|
|
166
|
-
}
|
|
167
|
-
.xps-select-content {
|
|
168
|
-
z-index: 2147483647;
|
|
169
|
-
max-height: min(320px, var(--radix-select-content-available-height));
|
|
170
|
-
min-width: 8rem;
|
|
171
|
-
overflow: hidden;
|
|
172
|
-
border: 1px solid var(--xps-border);
|
|
173
|
-
border-radius: var(--xps-radius);
|
|
174
|
-
background: var(--xps-popover);
|
|
175
|
-
color: var(--xps-popover-foreground);
|
|
176
|
-
box-shadow: 0 10px 30px color-mix(in srgb, var(--xps-foreground) 12%, transparent);
|
|
177
|
-
}
|
|
178
|
-
.xps-select-content-popper {
|
|
179
|
-
transform-origin: var(--radix-select-content-transform-origin);
|
|
180
|
-
}
|
|
181
|
-
.xps-select-viewport {
|
|
182
|
-
padding: 0.25rem;
|
|
183
|
-
}
|
|
184
|
-
.xps-select-viewport-popper {
|
|
185
|
-
min-width: var(--radix-select-trigger-width);
|
|
186
|
-
}
|
|
187
|
-
.xps-select-label {
|
|
188
|
-
padding: 0.3125rem 1.75rem 0.3125rem 0.5rem;
|
|
189
|
-
color: var(--xps-muted-foreground);
|
|
190
|
-
font-size: 0.75rem;
|
|
191
|
-
font-weight: 700;
|
|
192
|
-
}
|
|
193
|
-
.xps-select-item {
|
|
194
|
-
position: relative;
|
|
195
|
-
display: flex;
|
|
196
|
-
min-height: var(--xps-control-height);
|
|
197
|
-
width: 100%;
|
|
198
|
-
cursor: pointer;
|
|
199
|
-
user-select: none;
|
|
200
|
-
align-items: center;
|
|
201
|
-
border-radius: calc(var(--xps-radius) - 2px);
|
|
202
|
-
padding: 0.3125rem 1.75rem 0.3125rem 0.5rem;
|
|
203
|
-
font-size: var(--xps-control-font-size);
|
|
204
|
-
line-height: 1.2;
|
|
205
|
-
outline: none;
|
|
206
|
-
}
|
|
207
|
-
.xps-select-item[data-highlighted] {
|
|
208
|
-
background: var(--xps-accent);
|
|
209
|
-
color: var(--xps-accent-foreground);
|
|
210
|
-
}
|
|
211
|
-
.xps-select-item[data-disabled] {
|
|
212
|
-
pointer-events: none;
|
|
213
|
-
opacity: 0.5;
|
|
214
|
-
}
|
|
215
|
-
.xps-select-item-indicator {
|
|
216
|
-
position: absolute;
|
|
217
|
-
right: 0.5rem;
|
|
218
|
-
display: inline-flex;
|
|
219
|
-
width: 1rem;
|
|
220
|
-
align-items: center;
|
|
221
|
-
justify-content: center;
|
|
222
|
-
}
|
|
223
|
-
.xps-select-scroll-button {
|
|
224
|
-
display: flex;
|
|
225
|
-
height: 1.5rem;
|
|
226
|
-
align-items: center;
|
|
227
|
-
justify-content: center;
|
|
228
|
-
color: var(--xps-muted-foreground);
|
|
229
|
-
}
|
|
230
|
-
.xps-select-separator {
|
|
231
|
-
height: 1px;
|
|
232
|
-
margin: 0.25rem -0.25rem;
|
|
233
|
-
background: var(--xps-border);
|
|
234
|
-
}
|
|
235
|
-
.xps-textarea {
|
|
236
|
-
min-height: 5rem;
|
|
237
|
-
padding: 0.5rem var(--xps-control-padding-x);
|
|
238
|
-
resize: vertical;
|
|
239
|
-
line-height: 1.45;
|
|
240
|
-
}
|
|
241
|
-
.xps-input::placeholder,
|
|
242
|
-
.xps-textarea::placeholder {
|
|
243
|
-
color: var(--xps-muted-foreground);
|
|
244
|
-
}
|
|
2
|
+
"use strict";(()=>{var Um=Object.defineProperty;var il=e=>{throw TypeError(e)};var Ka=(e,t)=>{for(var a in t)Um(e,a,{get:t[a],enumerable:!0})};var sl=(e,t,a)=>t.has(e)||il("Cannot "+a);var $a=(e,t,a)=>(sl(e,t,"read from private field"),a?a.call(e):t.get(e)),qn=(e,t,a)=>t.has(e)?il("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,a),jn=(e,t,a,o)=>(sl(e,t,"write to private field"),o?o.call(e,a):t.set(e,a),a);var ae={};Ka(ae,{Children:()=>St,Component:()=>Wm,Fragment:()=>nt,Profiler:()=>Gm,PureComponent:()=>Km,StrictMode:()=>$m,Suspense:()=>Xm,cloneElement:()=>Bt,createContext:()=>Ke,createElement:()=>Te,createFactory:()=>Zm,createRef:()=>Jm,default:()=>jm,forwardRef:()=>V,isValidElement:()=>Xa,lazy:()=>Ym,memo:()=>Qm,startTransition:()=>eg,useCallback:()=>Q,useContext:()=>Qe,useDebugValue:()=>tg,useDeferredValue:()=>ag,useEffect:()=>H,useId:()=>Wn,useImperativeHandle:()=>br,useInsertionEffect:()=>og,useLayoutEffect:()=>Ht,useMemo:()=>me,useReducer:()=>wr,useRef:()=>z,useState:()=>M,useSyncExternalStore:()=>Gn,useTransition:()=>rg,version:()=>ng});function qm(e){return window[e]}var ve=qm("React"),jm=ve,St=ve.Children,Wm=ve.Component,nt=ve.Fragment,Gm=ve.Profiler,Km=ve.PureComponent,$m=ve.StrictMode,Xm=ve.Suspense,Bt=ve.cloneElement,Ke=ve.createContext,Te=ve.createElement,Zm=ve.createFactory,Jm=ve.createRef,V=ve.forwardRef,Xa=ve.isValidElement,Ym=ve.lazy,Qm=ve.memo,eg=ve.startTransition,Q=ve.useCallback,Qe=ve.useContext,tg=ve.useDebugValue,ag=ve.useDeferredValue,H=ve.useEffect,Wn=ve.useId,br=ve.useImperativeHandle,og=ve.useInsertionEffect,Ht=ve.useLayoutEffect,me=ve.useMemo,wr=ve.useReducer,z=ve.useRef,M=ve.useState,Gn=ve.useSyncExternalStore,rg=ve.useTransition,ng=ve.version;function ig(e){return window[e]}var ll=ig("ReactDOM"),dl=ll.createRoot,l0=ll.hydrateRoot;function ul(e){var t,a,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(a=ul(e[t]))&&(o&&(o+=" "),o+=a)}else for(a in e)e[a]&&(o&&(o+=" "),o+=a);return o}function yr(){for(var e,t,a=0,o="",r=arguments.length;a<r;a++)(e=arguments[a])&&(t=ul(e))&&(o&&(o+=" "),o+=t);return o}var sg=(e,t)=>{let a=new Array(e.length+t.length);for(let o=0;o<e.length;o++)a[o]=e[o];for(let o=0;o<t.length;o++)a[e.length+o]=t[o];return a},lg=(e,t)=>({classGroupId:e,validator:t}),hl=(e=new Map,t=null,a)=>({nextPart:e,validators:t,classGroupId:a});var cl=[],dg="arbitrary..",ug=e=>{let t=fg(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return cg(i);let s=i.split("-"),l=s[0]===""&&s.length>1?1:0;return vl(s,l,t)},getConflictingClassGroupIds:(i,s)=>{if(s){let l=o[i],d=a[i];return l?d?sg(d,l):l:d||cl}return a[i]||cl}}},vl=(e,t,a)=>{if(e.length-t===0)return a.classGroupId;let r=e[t],n=a.nextPart.get(r);if(n){let d=vl(e,t+1,n);if(d)return d}let i=a.validators;if(i===null)return;let s=t===0?e.join("-"):e.slice(t).join("-"),l=i.length;for(let d=0;d<l;d++){let u=i[d];if(u.validator(s))return u.classGroupId}},cg=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{let t=e.slice(1,-1),a=t.indexOf(":"),o=t.slice(0,a);return o?dg+o:void 0})(),fg=e=>{let{theme:t,classGroups:a}=e;return pg(a,t)},pg=(e,t)=>{let a=hl();for(let o in e){let r=e[o];$n(r,a,o,t)}return a},$n=(e,t,a,o)=>{let r=e.length;for(let n=0;n<r;n++){let i=e[n];mg(i,t,a,o)}},mg=(e,t,a,o)=>{if(typeof e=="string"){gg(e,t,a);return}if(typeof e=="function"){hg(e,t,a,o);return}vg(e,t,a,o)},gg=(e,t,a)=>{let o=e===""?t:xl(t,e);o.classGroupId=a},hg=(e,t,a,o)=>{if(xg(e)){$n(e(o),t,a,o);return}t.validators===null&&(t.validators=[]),t.validators.push(lg(a,e))},vg=(e,t,a,o)=>{let r=Object.entries(e),n=r.length;for(let i=0;i<n;i++){let[s,l]=r[i];$n(l,xl(t,s),a,o)}},xl=(e,t)=>{let a=e,o=t.split("-"),r=o.length;for(let n=0;n<r;n++){let i=o[n],s=a.nextPart.get(i);s||(s=hl(),a.nextPart.set(i,s)),a=s}return a},xg=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,bg=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=Object.create(null),o=Object.create(null),r=(n,i)=>{a[n]=i,t++,t>e&&(t=0,o=a,a=Object.create(null))};return{get(n){let i=a[n];if(i!==void 0)return i;if((i=o[n])!==void 0)return r(n,i),i},set(n,i){n in a?a[n]=i:r(n,i)}}};var wg=[],fl=(e,t,a,o,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:a,maybePostfixModifierPosition:o,isExternal:r}),yg=e=>{let{prefix:t,experimentalParseClassName:a}=e,o=r=>{let n=[],i=0,s=0,l=0,d,u=r.length;for(let p=0;p<u;p++){let g=r[p];if(i===0&&s===0){if(g===":"){n.push(r.slice(l,p)),l=p+1;continue}if(g==="/"){d=p;continue}}g==="["?i++:g==="]"?i--:g==="("?s++:g===")"&&s--}let c=n.length===0?r:r.slice(l),m=c,h=!1;c.endsWith("!")?(m=c.slice(0,-1),h=!0):c.startsWith("!")&&(m=c.slice(1),h=!0);let x=d&&d>l?d-l:void 0;return fl(n,h,m,x)};if(t){let r=t+":",n=o;o=i=>i.startsWith(r)?n(i.slice(r.length)):fl(wg,!1,i,void 0,!0)}if(a){let r=o;o=n=>a({className:n,parseClassName:r})}return o},Cg=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((a,o)=>{t.set(a,1e6+o)}),a=>{let o=[],r=[];for(let n=0;n<a.length;n++){let i=a[n],s=i[0]==="[",l=t.has(i);s||l?(r.length>0&&(r.sort(),o.push(...r),r=[]),o.push(i)):r.push(i)}return r.length>0&&(r.sort(),o.push(...r)),o}},Sg=e=>({cache:bg(e.cacheSize),parseClassName:yg(e),sortModifiers:Cg(e),postfixLookupClassGroupIds:Lg(e),...ug(e)}),Lg=e=>{let t=Object.create(null),a=e.postfixLookupClassGroups;if(a)for(let o=0;o<a.length;o++)t[a[o]]=!0;return t},Ig=/\s+/,kg=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:r,sortModifiers:n,postfixLookupClassGroupIds:i}=t,s=[],l=e.trim().split(Ig),d="";for(let u=l.length-1;u>=0;u-=1){let c=l[u],{isExternal:m,modifiers:h,hasImportantModifier:x,baseClassName:p,maybePostfixModifierPosition:g}=a(c);if(m){d=c+(d.length>0?" "+d:d);continue}let v=!!g,w;if(v){let T=p.substring(0,g);w=o(T);let I=w&&i[w]?o(p):void 0;I&&I!==w&&(w=I,v=!1)}else w=o(p);if(!w){if(!v){d=c+(d.length>0?" "+d:d);continue}if(w=o(p),!w){d=c+(d.length>0?" "+d:d);continue}v=!1}let b=h.length===0?"":h.length===1?h[0]:n(h).join(":"),C=x?b+"!":b,S=C+w;if(s.indexOf(S)>-1)continue;s.push(S);let R=r(w,v);for(let T=0;T<R.length;++T){let I=R[T];s.push(C+I)}d=c+(d.length>0?" "+d:d)}return d},Rg=(...e)=>{let t=0,a,o,r="";for(;t<e.length;)(a=e[t++])&&(o=bl(a))&&(r&&(r+=" "),r+=o);return r},bl=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=bl(e[o]))&&(a&&(a+=" "),a+=t);return a},Pg=(e,...t)=>{let a,o,r,n,i=l=>{let d=t.reduce((u,c)=>c(u),e());return a=Sg(d),o=a.cache.get,r=a.cache.set,n=s,s(l)},s=l=>{let d=o(l);if(d)return d;let u=kg(l,a);return r(l,u),u};return n=i,(...l)=>n(Rg(...l))},Tg=[],Oe=e=>{let t=a=>a[e]||Tg;return t.isThemeGetter=!0,t},wl=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,yl=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Mg=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Ag=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Dg=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,zg=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Eg=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Og=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Xt=e=>Mg.test(e),pe=e=>!!e&&!Number.isNaN(Number(e)),Lt=e=>!!e&&Number.isInteger(Number(e)),Kn=e=>e.endsWith("%")&&pe(e.slice(0,-1)),_t=e=>Ag.test(e),Cl=()=>!0,Ng=e=>Dg.test(e)&&!zg.test(e),Xn=()=>!1,Fg=e=>Eg.test(e),Bg=e=>Og.test(e),Hg=e=>!W(e)&&!K(e),_g=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),Vg=e=>Zt(e,Il,Xn),W=e=>wl.test(e),ua=e=>Zt(e,kl,Ng),pl=e=>Zt(e,Xg,pe),Ug=e=>Zt(e,Pl,Cl),qg=e=>Zt(e,Rl,Xn),ml=e=>Zt(e,Sl,Xn),jg=e=>Zt(e,Ll,Bg),Cr=e=>Zt(e,Tl,Fg),K=e=>yl.test(e),Po=e=>ca(e,kl),Wg=e=>ca(e,Rl),gl=e=>ca(e,Sl),Gg=e=>ca(e,Il),Kg=e=>ca(e,Ll),Sr=e=>ca(e,Tl,!0),$g=e=>ca(e,Pl,!0),Zt=(e,t,a)=>{let o=wl.exec(e);return o?o[1]?t(o[1]):a(o[2]):!1},ca=(e,t,a=!1)=>{let o=yl.exec(e);return o?o[1]?t(o[1]):a:!1},Sl=e=>e==="position"||e==="percentage",Ll=e=>e==="image"||e==="url",Il=e=>e==="length"||e==="size"||e==="bg-size",kl=e=>e==="length",Xg=e=>e==="number",Rl=e=>e==="family-name",Pl=e=>e==="number"||e==="weight",Tl=e=>e==="shadow";var Zg=()=>{let e=Oe("color"),t=Oe("font"),a=Oe("text"),o=Oe("font-weight"),r=Oe("tracking"),n=Oe("leading"),i=Oe("breakpoint"),s=Oe("container"),l=Oe("spacing"),d=Oe("radius"),u=Oe("shadow"),c=Oe("inset-shadow"),m=Oe("text-shadow"),h=Oe("drop-shadow"),x=Oe("blur"),p=Oe("perspective"),g=Oe("aspect"),v=Oe("ease"),w=Oe("animate"),b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...C(),K,W],R=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],I=()=>[K,W,l],F=()=>[Xt,"full","auto",...I()],X=()=>[Lt,"none","subgrid",K,W],D=()=>["auto",{span:["full",Lt,K,W]},Lt,K,W],O=()=>[Lt,"auto",K,W],U=()=>["auto","min","max","fr",K,W],q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],k=()=>["start","end","center","stretch","center-safe","end-safe"],A=()=>["auto",...I()],j=()=>[Xt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],B=()=>[Xt,"screen","full","dvw","lvw","svw","min","max","fit",...I()],te=()=>[Xt,"screen","full","lh","dvh","lvh","svh","min","max","fit",...I()],E=()=>[e,K,W],P=()=>[...C(),gl,ml,{position:[K,W]}],_=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Y=()=>["auto","cover","contain",Gg,Vg,{size:[K,W]}],be=()=>[Kn,Po,ua],ie=()=>["","none","full",d,K,W],ne=()=>["",pe,Po,ua],J=()=>["solid","dashed","dotted","double"],fe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],de=()=>[pe,Kn,gl,ml],we=()=>["","none",x,K,W],ye=()=>["none",pe,K,W],Se=()=>["none",pe,K,W],Ve=()=>[pe,K,W],Ae=()=>[Xt,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[_t],breakpoint:[_t],color:[Cl],container:[_t],"drop-shadow":[_t],ease:["in","out","in-out"],font:[Hg],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[_t],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[_t],shadow:[_t],spacing:["px",pe],text:[_t],"text-shadow":[_t],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Xt,W,K,g]}],container:["container"],"container-type":[{"@container":["","normal","size",K,W]}],"container-named":[_g],columns:[{columns:[pe,W,K,s]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:S()}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:F()}],"inset-x":[{"inset-x":F()}],"inset-y":[{"inset-y":F()}],start:[{"inset-s":F(),start:F()}],end:[{"inset-e":F(),end:F()}],"inset-bs":[{"inset-bs":F()}],"inset-be":[{"inset-be":F()}],top:[{top:F()}],right:[{right:F()}],bottom:[{bottom:F()}],left:[{left:F()}],visibility:["visible","invisible","collapse"],z:[{z:[Lt,"auto",K,W]}],basis:[{basis:[Xt,"full","auto",s,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[pe,Xt,"auto","initial","none",W]}],grow:[{grow:["",pe,K,W]}],shrink:[{shrink:["",pe,K,W]}],order:[{order:[Lt,"first","last","none",K,W]}],"grid-cols":[{"grid-cols":X()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":X()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":U()}],"auto-rows":[{"auto-rows":U()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...k(),"normal"]}],"justify-self":[{"justify-self":["auto",...k()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...k(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...k(),{baseline:["","last"]}]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...k(),"baseline"]}],"place-self":[{"place-self":["auto",...k()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pbs:[{pbs:I()}],pbe:[{pbe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mbs:[{mbs:A()}],mbe:[{mbe:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:j()}],"inline-size":[{inline:["auto",...B()]}],"min-inline-size":[{"min-inline":["auto",...B()]}],"max-inline-size":[{"max-inline":["none",...B()]}],"block-size":[{block:["auto",...te()]}],"min-block-size":[{"min-block":["auto",...te()]}],"max-block-size":[{"max-block":["none",...te()]}],w:[{w:[s,"screen",...j()]}],"min-w":[{"min-w":[s,"screen","none",...j()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[i]},...j()]}],h:[{h:["screen","lh",...j()]}],"min-h":[{"min-h":["screen","lh","none",...j()]}],"max-h":[{"max-h":["screen","lh",...j()]}],"font-size":[{text:["base",a,Po,ua]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,$g,Ug]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Kn,W]}],"font-family":[{font:[Wg,qg,t]}],"font-features":[{"font-features":[W]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,K,W]}],"line-clamp":[{"line-clamp":[pe,"none",K,pl]}],leading:[{leading:[n,...I()]}],"list-image":[{"list-image":["none",K,W]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",K,W]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:E()}],"text-color":[{text:E()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:[pe,"from-font","auto",K,ua]}],"text-decoration-color":[{decoration:E()}],"underline-offset":[{"underline-offset":[pe,"auto",K,W]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"tab-size":[{tab:[Lt,K,W]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",K,W]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",K,W]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:_()}],"bg-size":[{bg:Y()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Lt,K,W],radial:["",K,W],conic:[Lt,K,W]},Kg,jg]}],"bg-color":[{bg:E()}],"gradient-from-pos":[{from:be()}],"gradient-via-pos":[{via:be()}],"gradient-to-pos":[{to:be()}],"gradient-from":[{from:E()}],"gradient-via":[{via:E()}],"gradient-to":[{to:E()}],rounded:[{rounded:ie()}],"rounded-s":[{"rounded-s":ie()}],"rounded-e":[{"rounded-e":ie()}],"rounded-t":[{"rounded-t":ie()}],"rounded-r":[{"rounded-r":ie()}],"rounded-b":[{"rounded-b":ie()}],"rounded-l":[{"rounded-l":ie()}],"rounded-ss":[{"rounded-ss":ie()}],"rounded-se":[{"rounded-se":ie()}],"rounded-ee":[{"rounded-ee":ie()}],"rounded-es":[{"rounded-es":ie()}],"rounded-tl":[{"rounded-tl":ie()}],"rounded-tr":[{"rounded-tr":ie()}],"rounded-br":[{"rounded-br":ie()}],"rounded-bl":[{"rounded-bl":ie()}],"border-w":[{border:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-bs":[{"border-bs":ne()}],"border-w-be":[{"border-be":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...J(),"hidden","none"]}],"divide-style":[{divide:[...J(),"hidden","none"]}],"border-color":[{border:E()}],"border-color-x":[{"border-x":E()}],"border-color-y":[{"border-y":E()}],"border-color-s":[{"border-s":E()}],"border-color-e":[{"border-e":E()}],"border-color-bs":[{"border-bs":E()}],"border-color-be":[{"border-be":E()}],"border-color-t":[{"border-t":E()}],"border-color-r":[{"border-r":E()}],"border-color-b":[{"border-b":E()}],"border-color-l":[{"border-l":E()}],"divide-color":[{divide:E()}],"outline-style":[{outline:[...J(),"none","hidden"]}],"outline-offset":[{"outline-offset":[pe,K,W]}],"outline-w":[{outline:["",pe,Po,ua]}],"outline-color":[{outline:E()}],shadow:[{shadow:["","none",u,Sr,Cr]}],"shadow-color":[{shadow:E()}],"inset-shadow":[{"inset-shadow":["none",c,Sr,Cr]}],"inset-shadow-color":[{"inset-shadow":E()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:E()}],"ring-offset-w":[{"ring-offset":[pe,ua]}],"ring-offset-color":[{"ring-offset":E()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":E()}],"text-shadow":[{"text-shadow":["none",m,Sr,Cr]}],"text-shadow-color":[{"text-shadow":E()}],opacity:[{opacity:[pe,K,W]}],"mix-blend":[{"mix-blend":[...fe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":fe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[pe]}],"mask-image-linear-from-pos":[{"mask-linear-from":de()}],"mask-image-linear-to-pos":[{"mask-linear-to":de()}],"mask-image-linear-from-color":[{"mask-linear-from":E()}],"mask-image-linear-to-color":[{"mask-linear-to":E()}],"mask-image-t-from-pos":[{"mask-t-from":de()}],"mask-image-t-to-pos":[{"mask-t-to":de()}],"mask-image-t-from-color":[{"mask-t-from":E()}],"mask-image-t-to-color":[{"mask-t-to":E()}],"mask-image-r-from-pos":[{"mask-r-from":de()}],"mask-image-r-to-pos":[{"mask-r-to":de()}],"mask-image-r-from-color":[{"mask-r-from":E()}],"mask-image-r-to-color":[{"mask-r-to":E()}],"mask-image-b-from-pos":[{"mask-b-from":de()}],"mask-image-b-to-pos":[{"mask-b-to":de()}],"mask-image-b-from-color":[{"mask-b-from":E()}],"mask-image-b-to-color":[{"mask-b-to":E()}],"mask-image-l-from-pos":[{"mask-l-from":de()}],"mask-image-l-to-pos":[{"mask-l-to":de()}],"mask-image-l-from-color":[{"mask-l-from":E()}],"mask-image-l-to-color":[{"mask-l-to":E()}],"mask-image-x-from-pos":[{"mask-x-from":de()}],"mask-image-x-to-pos":[{"mask-x-to":de()}],"mask-image-x-from-color":[{"mask-x-from":E()}],"mask-image-x-to-color":[{"mask-x-to":E()}],"mask-image-y-from-pos":[{"mask-y-from":de()}],"mask-image-y-to-pos":[{"mask-y-to":de()}],"mask-image-y-from-color":[{"mask-y-from":E()}],"mask-image-y-to-color":[{"mask-y-to":E()}],"mask-image-radial":[{"mask-radial":[K,W]}],"mask-image-radial-from-pos":[{"mask-radial-from":de()}],"mask-image-radial-to-pos":[{"mask-radial-to":de()}],"mask-image-radial-from-color":[{"mask-radial-from":E()}],"mask-image-radial-to-color":[{"mask-radial-to":E()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[pe]}],"mask-image-conic-from-pos":[{"mask-conic-from":de()}],"mask-image-conic-to-pos":[{"mask-conic-to":de()}],"mask-image-conic-from-color":[{"mask-conic-from":E()}],"mask-image-conic-to-color":[{"mask-conic-to":E()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:_()}],"mask-size":[{mask:Y()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",K,W]}],filter:[{filter:["","none",K,W]}],blur:[{blur:we()}],brightness:[{brightness:[pe,K,W]}],contrast:[{contrast:[pe,K,W]}],"drop-shadow":[{"drop-shadow":["","none",h,Sr,Cr]}],"drop-shadow-color":[{"drop-shadow":E()}],grayscale:[{grayscale:["",pe,K,W]}],"hue-rotate":[{"hue-rotate":[pe,K,W]}],invert:[{invert:["",pe,K,W]}],saturate:[{saturate:[pe,K,W]}],sepia:[{sepia:["",pe,K,W]}],"backdrop-filter":[{"backdrop-filter":["","none",K,W]}],"backdrop-blur":[{"backdrop-blur":we()}],"backdrop-brightness":[{"backdrop-brightness":[pe,K,W]}],"backdrop-contrast":[{"backdrop-contrast":[pe,K,W]}],"backdrop-grayscale":[{"backdrop-grayscale":["",pe,K,W]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[pe,K,W]}],"backdrop-invert":[{"backdrop-invert":["",pe,K,W]}],"backdrop-opacity":[{"backdrop-opacity":[pe,K,W]}],"backdrop-saturate":[{"backdrop-saturate":[pe,K,W]}],"backdrop-sepia":[{"backdrop-sepia":["",pe,K,W]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",K,W]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[pe,"initial",K,W]}],ease:[{ease:["linear","initial",v,K,W]}],delay:[{delay:[pe,K,W]}],animate:[{animate:["none",w,K,W]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,K,W]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:ye()}],"rotate-x":[{"rotate-x":ye()}],"rotate-y":[{"rotate-y":ye()}],"rotate-z":[{"rotate-z":ye()}],scale:[{scale:Se()}],"scale-x":[{"scale-x":Se()}],"scale-y":[{"scale-y":Se()}],"scale-z":[{"scale-z":Se()}],"scale-3d":["scale-3d"],skew:[{skew:Ve()}],"skew-x":[{"skew-x":Ve()}],"skew-y":[{"skew-y":Ve()}],transform:[{transform:[K,W,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ae()}],"translate-x":[{"translate-x":Ae()}],"translate-y":[{"translate-y":Ae()}],"translate-z":[{"translate-z":Ae()}],"translate-none":["translate-none"],zoom:[{zoom:[Lt,K,W]}],accent:[{accent:E()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:E()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",K,W]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":E()}],"scrollbar-track-color":[{"scrollbar-track":E()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mbs":[{"scroll-mbs":I()}],"scroll-mbe":[{"scroll-mbe":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pbs":[{"scroll-pbs":I()}],"scroll-pbe":[{"scroll-pbe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",K,W]}],fill:[{fill:["none",...E()]}],"stroke-w":[{stroke:[pe,Po,ua,pl]}],stroke:[{stroke:["none",...E()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}};var Ml=Pg(Zg);var Lr=(...e)=>e.filter((t,a,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===a).join(" ").trim();var Al=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var Dl=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,o)=>o?o.toUpperCase():a.toLowerCase());var Zn=e=>{let t=Dl(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Ir={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var zl=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var Jg=Ke({});var El=()=>Qe(Jg);var Ol=V(({color:e,size:t,strokeWidth:a,absoluteStrokeWidth:o,className:r="",children:n,iconNode:i,...s},l)=>{let{size:d=24,strokeWidth:u=2,absoluteStrokeWidth:c=!1,color:m="currentColor",className:h=""}=El()??{},x=o??c?Number(a??u)*24/Number(t??d):a??u;return Te("svg",{ref:l,...Ir,width:t??d??Ir.width,height:t??d??Ir.height,stroke:e??m,strokeWidth:x,className:Lr("lucide",h,r),...!n&&!zl(s)&&{"aria-hidden":"true"},...s},[...i.map(([p,g])=>Te(p,g)),...Array.isArray(n)?n:[n]])});var Jt=(e,t)=>{let a=V(({className:o,...r},n)=>Te(Ol,{ref:n,iconNode:t,className:Lr(`lucide-${Al(Zn(e))}`,`lucide-${e}`,o),...r}));return a.displayName=Zn(e),a};var Yg=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],To=Jt("check",Yg);var Qg=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Za=Jt("chevron-down",Qg);var eh=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Mo=Jt("chevron-up",eh);var th=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ao=Jt("x",th);function ah(e){return window[e]}var Fl=ah("React"),oh=Fl.createElement;function Nl(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function rh(e,t){return t===void 0?Nl(e)?e:null:{...Nl(e)?e:{},key:t}}var Yt=Fl.Fragment,L=(e,t,a)=>oh(e,rh(t,a)),qe=L;function nh(e){return window[e]}var Qt=nh("ReactDOM");var Do=Qt.createPortal,kr=Qt.flushSync,K0=Qt.findDOMNode,$0=Qt.hydrate,X0=Qt.render,Z0=Qt.unstable_batchedUpdates,J0=Qt.unmountComponentAtNode,Y0=Qt.version;var zo={};Ka(zo,{Root:()=>sh,Slot:()=>sh,Slottable:()=>lh,createSlot:()=>mt,createSlottable:()=>Vl});function Bl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ih(...e){return t=>{let a=!1,o=e.map(r=>{let n=Bl(r,t);return!a&&typeof n=="function"&&(a=!0),n});if(a)return()=>{for(let r=0;r<o.length;r++){let n=o[r];typeof n=="function"?n():Bl(e[r],null)}}}}function ge(...e){return Q(ih(...e),e)}function mt(e){let t=V((a,o)=>{let{children:r,...n}=a,i=null,s=!1,l=[];Hl(r)&&typeof Pr=="function"&&(r=Pr(r._payload)),St.forEach(r,m=>{if(fh(m)){s=!0;let h=m,x="child"in h.props?h.props.child:h.props.children;Hl(x)&&typeof Pr=="function"&&(x=Pr(x._payload)),i=dh(h,x),l.push(i?.props?.children)}else l.push(m)}),i?i=Bt(i,void 0,l):!s&&St.count(r)===1&&Xa(r)&&(i=r);let d=i?ch(i):void 0,u=ge(o,d);if(!i){if(r||r===0)throw new Error(s?hh(e):gh(e));return r}let c=uh(n,i.props??{});return i.type!==nt&&(c.ref=o?u:d),Bt(i,c)});return t.displayName=`${e}.Slot`,t}var sh=mt("Slot"),_l=Symbol.for("radix.slottable");function Vl(e){let t=a=>"child"in a?a.children(a.child):a.children;return t.displayName=`${e}.Slottable`,t.__radixId=_l,t}var lh=Vl("Slottable"),dh=(e,t)=>{if("child"in e.props){let a=e.props.child;return Xa(a)?Bt(a,void 0,e.props.children(a.props.children)):null}return Xa(t)?t:null};function uh(e,t){let a={...t};for(let o in t){let r=e[o],n=t[o];/^on[A-Z]/.test(o)?r&&n?a[o]=(...s)=>{let l=n(...s);return r(...s),l}:r&&(a[o]=r):o==="style"?a[o]={...r,...n}:o==="className"&&(a[o]=[r,n].filter(Boolean).join(" "))}return{...e,...a}}function ch(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}function fh(e){return Xa(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===_l}var ph=Symbol.for("react.lazy");function Hl(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===ph&&"_payload"in e&&mh(e._payload)}function mh(e){return typeof e=="object"&&e!==null&&"then"in e}var gh=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,hh=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Pr=ae[" use ".trim().toString()];var vh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],oe=vh.reduce((e,t)=>{let a=mt(`Primitive.${t}`),o=V((r,n)=>{let{asChild:i,...s}=r,l=i?a:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),L(l,{...s,ref:n})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function Ul(e,t){e&&kr(()=>e.dispatchEvent(t))}var Jn=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),xh="VisuallyHidden",bh=V((e,t)=>L(oe.span,{...e,ref:t,style:{...Jn,...e.style}}));bh.displayName=xh;function et(e,t=[]){let a=[];function o(n,i){let s=Ke(i);s.displayName=n+"Context";let l=a.length;a=[...a,i];let d=c=>{let{scope:m,children:h,...x}=c,p=m?.[e]?.[l]||s,g=me(()=>x,Object.values(x));return L(p.Provider,{value:g,children:h})};d.displayName=n+"Provider";function u(c,m,h={}){let{optional:x=!1}=h,p=m?.[e]?.[l]||s,g=Qe(p);if(g)return g;if(i!==void 0)return i;if(!x)throw new Error(`\`${c}\` must be used within \`${n}\``)}return[d,u]}let r=()=>{let n=a.map(i=>Ke(i));return function(s){let l=s?.[e]||n;return me(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return r.scopeName=e,[o,wh(r,...t)]}function wh(...e){let t=e[0];if(e.length===1)return t;let a=()=>{let o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(n){let i=o.reduce((s,{useScope:l,scopeName:d})=>{let c=l(n)[`__scope${d}`];return{...s,...c}},{});return me(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return a.scopeName=t.scopeName,a}function Ja(e){let t=e+"CollectionProvider",[a,o]=et(t),[r,n]=a(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{let{scope:g,children:v}=p,w=z(null),b=z(new Map).current;return L(r,{scope:g,itemMap:b,collectionRef:w,children:v})};i.displayName=t;let s=e+"CollectionSlot",l=mt(s),d=V((p,g)=>{let{scope:v,children:w}=p,b=n(s,v),C=ge(g,b.collectionRef);return L(l,{ref:C,children:w})});d.displayName=s;let u=e+"CollectionItemSlot",c="data-radix-collection-item",m=mt(u),h=V((p,g)=>{let{scope:v,children:w,...b}=p,C=z(null),S=ge(g,C),R=n(u,v);return H(()=>(R.itemMap.set(C,{ref:C,...b}),()=>{R.itemMap.delete(C)})),L(m,{[c]:"",ref:S,children:w})});h.displayName=u;function x(p){let g=n(e+"CollectionConsumer",p);return Q(()=>{let w=g.collectionRef.current;if(!w)return[];let b=Array.from(w.querySelectorAll(`[${c}]`));return Array.from(g.itemMap.values()).sort((R,T)=>b.indexOf(R.ref.current)-b.indexOf(T.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:i,Slot:d,ItemSlot:h},x,o]}var hC=!!(typeof window<"u"&&window.document&&window.document.createElement);function se(e,t,{checkForDefaultPrevented:a=!0}={}){return function(r){if(e?.(r),a===!1||!r||!r.defaultPrevented)return t?.(r)}}var ke=globalThis?.document?Ht:()=>{};var yh=ae[" useInsertionEffect ".trim().toString()]||ke;function gt({prop:e,defaultProp:t,onChange:a=()=>{},caller:o}){let[r,n,i]=Ch({defaultProp:t,onChange:a}),s=e!==void 0,l=s?e:r;{let u=z(e!==void 0);H(()=>{let c=u.current;c!==s&&console.warn(`${o} is changing from ${c?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=s},[s,o])}let d=Q(u=>{if(s){let c=Sh(u)?u(e):u;c!==e&&i.current?.(c)}else n(u)},[s,e,n,i]);return[l,d]}function Ch({defaultProp:e,onChange:t}){let[a,o]=M(e),r=z(a),n=z(t);return yh(()=>{n.current=t},[t]),H(()=>{r.current!==a&&(n.current?.(a),r.current=a)},[a,r]),[a,o,n]}function Sh(e){return typeof e=="function"}function Lh(e,t){return wr((a,o)=>t[a][o]??a,e)}var Vt=e=>{let{present:t,children:a}=e,o=Ih(t),r=typeof a=="function"?a({present:o.isPresent}):St.only(a),n=kh(o.ref,Rh(r));return typeof a=="function"||o.isPresent?Bt(r,{ref:n}):null};Vt.displayName="Presence";function Ih(e){let[t,a]=M(),o=z(null),r=z(e),n=z("none"),i=z(void 0),s=e?"mounted":"unmounted",[l,d]=Lh(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return H(()=>{l==="mounted"?(n.current=i.current??Eo(o.current),i.current=void 0):n.current="none"},[l]),ke(()=>{let u=o.current,c=r.current;if(c!==e){let h=n.current,x=Eo(u);e?(i.current=x,d("MOUNT")):x==="none"||u?.display==="none"?d("UNMOUNT"):d(c&&h!==x?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,d]),ke(()=>{if(t){let u,c=t.ownerDocument.defaultView??window,m=x=>{let g=Eo(o.current).includes(CSS.escape(x.animationName));if(x.target===t&&g&&(d("ANIMATION_END"),!r.current)){let v=t.style.animationFillMode;t.style.animationFillMode="forwards",u=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},h=x=>{x.target===t&&(n.current=Eo(o.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{c.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:Q(u=>{if(u){let c=getComputedStyle(u);o.current=c,i.current=Eo(c)}else o.current=null;a(u)},[])}}function ql(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function kh(...e){let t=z(e);return t.current=e,Q(a=>{let o=t.current,r=!1,n=o.map(i=>{let s=ql(i,a);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let i=0;i<n.length;i++){let s=n[i];typeof s=="function"?s():ql(o[i],null)}}},[])}function Eo(e){return e?.animationName||"none"}function Rh(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var Ph=ae[" useId ".trim().toString()]||(()=>{}),Th=0;function dt(e){let[t,a]=M(Ph());return ke(()=>{e||a(o=>o??String(Th++))},[e]),e||(t?`radix-${t}`:"")}var Mh=Ke(void 0);function ea(e){let t=Qe(Mh);return e||t||"ltr"}var vt={};Ka(vt,{Close:()=>Ad,Content:()=>Ld,Description:()=>Td,Dialog:()=>xd,DialogClose:()=>Ad,DialogContent:()=>Ld,DialogDescription:()=>Td,DialogOverlay:()=>Sd,DialogPortal:()=>Cd,DialogTitle:()=>Rd,DialogTrigger:()=>wd,Overlay:()=>Sd,Portal:()=>Cd,Root:()=>xd,Title:()=>Rd,Trigger:()=>wd,WarningProvider:()=>Lv,createDialogScope:()=>vv});function $e(e){let t=z(e);return H(()=>{t.current=e}),me(()=>((...a)=>t.current?.(...a)),[])}var Ah="DismissableLayer",Yn="dismissableLayer.update",Dh="dismissableLayer.pointerDownOutside",zh="dismissableLayer.focusOutside",jl,Qn=Ke({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Oo=V((e,t)=>{let{disableOutsidePointerEvents:a=!1,deferPointerDownOutside:o=!1,onEscapeKeyDown:r,onPointerDownOutside:n,onFocusOutside:i,onInteractOutside:s,onDismiss:l,...d}=e,u=Qe(Qn),[c,m]=M(null),h=c?.ownerDocument??globalThis?.document,[,x]=M({}),p=ge(t,m),g=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),w=v?g.indexOf(v):-1,b=c?g.indexOf(c):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=w,R=z(!1),T=Fh(D=>{n?.(D),s?.(D),D.defaultPrevented||l?.()},{ownerDocument:h,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:R,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:Q(D=>{if(!(D instanceof Node))return!1;let O=[...u.branches].some(U=>U.contains(D));return S&&!O},[u.branches,S])}),I=Bh(D=>{if(o&&R.current)return;let O=D.target;[...u.branches].some(q=>q.contains(O))||(i?.(D),s?.(D),D.defaultPrevented||l?.())},h),F=c?b===g.length-1:!1,X=$e(D=>{D.key==="Escape"&&(r?.(D),!D.defaultPrevented&&l&&(D.preventDefault(),l()))});return H(()=>{if(F)return h.addEventListener("keydown",X,{capture:!0}),()=>h.removeEventListener("keydown",X,{capture:!0})},[h,F,X]),H(()=>{if(c)return a&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(jl=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),Wl(),()=>{a&&(u.layersWithOutsidePointerEventsDisabled.delete(c),u.layersWithOutsidePointerEventsDisabled.size===0&&(h.body.style.pointerEvents=jl))}},[c,h,a,u]),H(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),Wl())},[c,u]),H(()=>{let D=()=>x({});return document.addEventListener(Yn,D),()=>document.removeEventListener(Yn,D)},[]),L(oe.div,{...d,ref:p,style:{pointerEvents:C?S?"auto":"none":void 0,...e.style},onFocusCapture:se(e.onFocusCapture,I.onFocusCapture),onBlurCapture:se(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:se(e.onPointerDownCapture,T.onPointerDownCapture)})});Oo.displayName=Ah;var Eh="DismissableLayerBranch",Oh=V((e,t)=>{let a=Qe(Qn),o=z(null),r=ge(t,o);return H(()=>{let n=o.current;if(n)return a.branches.add(n),()=>{a.branches.delete(n)}},[a.branches]),L(oe.div,{...e,ref:r})});Oh.displayName=Eh;function Gl(){let e=Qe(Qn),[t,a]=M(null);return H(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),a}var Nh=()=>!0;function Fh(e,t){let{ownerDocument:a=globalThis?.document,deferPointerDownOutside:o=!1,isDeferredPointerDownOutsideRef:r,dismissableSurfaces:n,shouldHandlePointerDownOutside:i=Nh}=t,s=$e(e),l=z(!1),d=z(!1),u=z(new Map),c=z(()=>{});return H(()=>{function m(){d.current=!1,r.current=!1,u.current.clear()}function h(){return Array.from(u.current.values()).some(Boolean)}function x(b){if(!d.current)return;let C=b.target;C instanceof Node&&[...n].some(R=>R.contains(C))||u.current.set(b.type,!0),b.type==="click"&&window.setTimeout(()=>{d.current&&c.current()},0)}function p(b){d.current&&u.current.set(b.type,!1)}let g=b=>{if(b.target&&!l.current){let S=function(){a.removeEventListener("click",c.current);let T=h();m(),T||Kl(Dh,s,R,{discrete:!0})};var C=S;if(!i(b.target)){a.removeEventListener("click",c.current),m(),l.current=!1;return}let R={originalEvent:b};d.current=!0,r.current=o&&b.button===0,u.current.clear(),!o||b.button!==0?S():(a.removeEventListener("click",c.current),c.current=S,a.addEventListener("click",c.current,{once:!0}))}else a.removeEventListener("click",c.current),m();l.current=!1},v=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(let b of v)a.addEventListener(b,x,!0),a.addEventListener(b,p);let w=window.setTimeout(()=>{a.addEventListener("pointerdown",g)},0);return()=>{window.clearTimeout(w),a.removeEventListener("pointerdown",g),a.removeEventListener("click",c.current);for(let b of v)a.removeEventListener(b,x,!0),a.removeEventListener(b,p)}},[a,s,o,r,n,i]),{onPointerDownCapture:()=>l.current=!0}}function Bh(e,t=globalThis?.document){let a=$e(e),o=z(!1);return H(()=>{let r=n=>{n.target&&!o.current&&Kl(zh,a,{originalEvent:n},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,a]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Wl(){let e=new CustomEvent(Yn);document.dispatchEvent(e)}function Kl(e,t,a,{discrete:o}){let r=a.originalEvent.target,n=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:a});t&&r.addEventListener(e,t,{once:!0}),o?Ul(r,n):r.dispatchEvent(n)}var ei="focusScope.autoFocusOnMount",ti="focusScope.autoFocusOnUnmount",$l={bubbles:!1,cancelable:!0},Hh="FocusScope",No=V((e,t)=>{let{loop:a=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:n,...i}=e,[s,l]=M(null),d=$e(r),u=$e(n),c=z(null),m=ge(t,l),h=z({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;H(()=>{if(o){let w=function(R){if(h.paused||!s)return;let T=R.target;s.contains(T)?c.current=T:ta(c.current,{select:!0})},b=function(R){if(h.paused||!s)return;let T=R.relatedTarget;T!==null&&(s.contains(T)||ta(c.current,{select:!0}))},C=function(R){if(document.activeElement===document.body)for(let I of R)I.removedNodes.length>0&&ta(s)};var p=w,g=b,v=C;document.addEventListener("focusin",w),document.addEventListener("focusout",b);let S=new MutationObserver(C);return s&&S.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",b),S.disconnect()}}},[o,s,h.paused]),H(()=>{if(s){Zl.add(h);let p=document.activeElement;if(!s.contains(p)){let v=new CustomEvent(ei,$l);s.addEventListener(ei,d),s.dispatchEvent(v),v.defaultPrevented||(_h(Wh(Yl(s)),{select:!0}),document.activeElement===p&&ta(s))}return()=>{s.removeEventListener(ei,d),setTimeout(()=>{let v=new CustomEvent(ti,$l);s.addEventListener(ti,u),s.dispatchEvent(v),v.defaultPrevented||ta(p??document.body,{select:!0}),s.removeEventListener(ti,u),Zl.remove(h)},0)}}},[s,d,u,h]);let x=Q(p=>{if(!a&&!o||h.paused)return;let g=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,v=document.activeElement;if(g&&v){let w=p.currentTarget,[b,C]=Vh(w);b&&C?!p.shiftKey&&v===C?(p.preventDefault(),a&&ta(b,{select:!0})):p.shiftKey&&v===b&&(p.preventDefault(),a&&ta(C,{select:!0})):v===w&&p.preventDefault()}},[a,o,h.paused]);return L(oe.div,{tabIndex:-1,...i,ref:m,onKeyDown:x})});No.displayName=Hh;function _h(e,{select:t=!1}={}){let a=document.activeElement;for(let o of e)if(ta(o,{select:t}),document.activeElement!==a)return}function Vh(e){let t=Yl(e),a=Xl(t,e),o=Xl(t.reverse(),e);return[a,o]}function Yl(e){let t=[],a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{let r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)t.push(a.currentNode);return t}function Xl(e,t){let a=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(let o of e)if(!(a?!o.checkVisibility({checkVisibilityCSS:!0}):Uh(o,{upTo:t})))return o}function Uh(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function qh(e){return e instanceof HTMLInputElement&&"select"in e}function ta(e,{select:t=!1}={}){if(e&&e.focus){let a=document.activeElement;e.focus({preventScroll:!0}),e!==a&&qh(e)&&t&&e.select()}}var Zl=jh();function jh(){let e=[];return{add(t){let a=e[0];t!==a&&a?.pause(),e=Jl(e,t),e.unshift(t)},remove(t){e=Jl(e,t),e[0]?.resume()}}}function Jl(e,t){let a=[...e],o=a.indexOf(t);return o!==-1&&a.splice(o,1),a}function Wh(e){return e.filter(t=>t.tagName!=="A")}var Gh="Portal",Fo=V((e,t)=>{let{container:a,...o}=e,[r,n]=M(!1);ke(()=>n(!0),[]);let i=a||r&&globalThis?.document?.body;return i?Do(L(oe.div,{...o,ref:t}),i):null});Fo.displayName=Gh;var Tr=0,Ya=null;function Mr(){H(()=>{Ya||(Ya={start:Ql(),end:Ql()});let{start:e,end:t}=Ya;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Tr++,()=>{Tr===1&&(Ya?.start.remove(),Ya?.end.remove(),Ya=null),Tr=Math.max(0,Tr-1)}},[])}function Ql(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var tt=function(){return tt=Object.assign||function(t){for(var a,o=1,r=arguments.length;o<r;o++){a=arguments[o];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n])}return t},tt.apply(this,arguments)};function Ar(e,t){var a={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(a[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(a[o[r]]=e[o[r]]);return a}function ed(e,t,a){if(a||arguments.length===2)for(var o=0,r=t.length,n;o<r;o++)(n||!(o in t))&&(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}var fa="right-scroll-bar-position",pa="width-before-scroll-bar",ai="with-scroll-bars-hidden",oi="--removed-body-scroll-bar-size";function Dr(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function td(e,t){var a=M(function(){return{value:e,callback:t,facade:{get current(){return a.value},set current(o){var r=a.value;r!==o&&(a.value=o,a.callback(o,r))}}}})[0];return a.callback=t,a.facade}var Kh=typeof window<"u"?Ht:H,ad=new WeakMap;function ri(e,t){var a=td(t||null,function(o){return e.forEach(function(r){return Dr(r,o)})});return Kh(function(){var o=ad.get(a);if(o){var r=new Set(o),n=new Set(e),i=a.current;r.forEach(function(s){n.has(s)||Dr(s,null)}),n.forEach(function(s){r.has(s)||Dr(s,i)})}ad.set(a,e)},[e]),a}function $h(e){return e}function Xh(e,t){t===void 0&&(t=$h);var a=[],o=!1,r={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return a.length?a[a.length-1]:e},useMedium:function(n){var i=t(n,o);return a.push(i),function(){a=a.filter(function(s){return s!==i})}},assignSyncMedium:function(n){for(o=!0;a.length;){var i=a;a=[],i.forEach(n)}a={push:function(s){return n(s)},filter:function(){return a}}},assignMedium:function(n){o=!0;var i=[];if(a.length){var s=a;a=[],s.forEach(n),i=a}var l=function(){var u=i;i=[],u.forEach(n)},d=function(){return Promise.resolve().then(l)};d(),a={push:function(u){i.push(u),d()},filter:function(u){return i=i.filter(u),a}}}};return r}function ni(e){e===void 0&&(e={});var t=Xh(null);return t.options=tt({async:!0,ssr:!1},e),t}var od=function(e){var t=e.sideCar,a=Ar(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return Te(o,tt({},a))};od.isSideCarExport=!0;function ii(e,t){return e.useMedium(t),od}var zr=ni();var si=function(){},Bo=V(function(e,t){var a=z(null),o=M({onScrollCapture:si,onWheelCapture:si,onTouchMoveCapture:si}),r=o[0],n=o[1],i=e.forwardProps,s=e.children,l=e.className,d=e.removeScrollBar,u=e.enabled,c=e.shards,m=e.sideCar,h=e.noRelative,x=e.noIsolation,p=e.inert,g=e.allowPinchZoom,v=e.as,w=v===void 0?"div":v,b=e.gapMode,C=Ar(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=m,R=ri([a,t]),T=tt(tt({},C),r);return Te(nt,null,u&&Te(S,{sideCar:zr,removeScrollBar:d,shards:c,noRelative:h,noIsolation:x,inert:p,setCallbacks:n,allowPinchZoom:!!g,lockRef:a,gapMode:b}),i?Bt(St.only(s),tt(tt({},T),{ref:R})):Te(w,tt({},T,{className:l,ref:R}),s))});Bo.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Bo.classNames={fullWidth:pa,zeroRight:fa};var rd;var nd=function(){if(rd)return rd;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Zh(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=nd();return t&&e.setAttribute("nonce",t),e}function Jh(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Yh(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var li=function(){var e=0,t=null;return{add:function(a){e==0&&(t=Zh())&&(Jh(t,a),Yh(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}};var di=function(){var e=li();return function(t,a){H(function(){return e.add(t),function(){e.remove()}},[t&&a])}};var Ho=function(){var e=di(),t=function(a){var o=a.styles,r=a.dynamic;return e(o,r),null};return t};var Qh={left:0,top:0,right:0,gap:0},ui=function(e){return parseInt(e||"",10)||0},ev=function(e){var t=window.getComputedStyle(document.body),a=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[ui(a),ui(o),ui(r)]},ci=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Qh;var t=ev(e),a=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-a+t[2]-t[0])}};var tv=Ho(),Qa="data-scroll-locked",av=function(e,t,a,o){var r=e.left,n=e.top,i=e.right,s=e.gap;return a===void 0&&(a="margin"),`
|
|
3
|
+
.`.concat(ai,` {
|
|
4
|
+
overflow: hidden `).concat(o,`;
|
|
5
|
+
padding-right: `).concat(s,"px ").concat(o,`;
|
|
6
|
+
}
|
|
7
|
+
body[`).concat(Qa,`] {
|
|
8
|
+
overflow: hidden `).concat(o,`;
|
|
9
|
+
overscroll-behavior: contain;
|
|
10
|
+
`).concat([t&&"position: relative ".concat(o,";"),a==="margin"&&`
|
|
11
|
+
padding-left: `.concat(r,`px;
|
|
12
|
+
padding-top: `).concat(n,`px;
|
|
13
|
+
padding-right: `).concat(i,`px;
|
|
14
|
+
margin-left:0;
|
|
15
|
+
margin-top:0;
|
|
16
|
+
margin-right: `).concat(s,"px ").concat(o,`;
|
|
17
|
+
`),a==="padding"&&"padding-right: ".concat(s,"px ").concat(o,";")].filter(Boolean).join(""),`
|
|
18
|
+
}
|
|
245
19
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
background: var(--xps-card);
|
|
250
|
-
color: var(--xps-card-foreground);
|
|
251
|
-
}
|
|
252
|
-
.xps-card-header {
|
|
253
|
-
display: flex;
|
|
254
|
-
flex-direction: column;
|
|
255
|
-
gap: 0.375rem;
|
|
256
|
-
padding: 1rem;
|
|
257
|
-
}
|
|
258
|
-
.xps-card-title {
|
|
259
|
-
margin: 0;
|
|
260
|
-
font-size: 0.9375rem;
|
|
261
|
-
font-weight: 700;
|
|
262
|
-
line-height: 1.2;
|
|
263
|
-
}
|
|
264
|
-
.xps-card-description {
|
|
265
|
-
margin: 0;
|
|
266
|
-
color: var(--xps-muted-foreground);
|
|
267
|
-
font-size: 0.8125rem;
|
|
268
|
-
line-height: 1.35;
|
|
269
|
-
}
|
|
270
|
-
.xps-card-content {
|
|
271
|
-
padding: 0 1rem 1rem;
|
|
272
|
-
}
|
|
20
|
+
.`).concat(fa,` {
|
|
21
|
+
right: `).concat(s,"px ").concat(o,`;
|
|
22
|
+
}
|
|
273
23
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
border-spacing: 0;
|
|
278
|
-
color: var(--xps-foreground);
|
|
279
|
-
font-size: var(--xps-control-font-size);
|
|
280
|
-
line-height: 1.45;
|
|
281
|
-
}
|
|
282
|
-
.xps-table-header {
|
|
283
|
-
background: color-mix(in srgb, var(--xps-muted) 72%, var(--xps-card) 28%);
|
|
284
|
-
}
|
|
285
|
-
.xps-table-row {
|
|
286
|
-
transition: background-color 120ms ease;
|
|
287
|
-
}
|
|
288
|
-
.xps-table-body .xps-table-row:hover {
|
|
289
|
-
background: color-mix(in srgb, var(--xps-muted) 56%, transparent);
|
|
290
|
-
}
|
|
291
|
-
.xps-table-head,
|
|
292
|
-
.xps-table-cell {
|
|
293
|
-
border-bottom: 1px solid var(--xps-border);
|
|
294
|
-
padding: 0.625rem 0.75rem;
|
|
295
|
-
text-align: left;
|
|
296
|
-
vertical-align: middle;
|
|
297
|
-
}
|
|
298
|
-
.xps-table-head {
|
|
299
|
-
color: var(--xps-muted-foreground);
|
|
300
|
-
font-weight: 700;
|
|
301
|
-
white-space: nowrap;
|
|
302
|
-
}
|
|
303
|
-
.xps-table-cell {
|
|
304
|
-
color: var(--xps-foreground);
|
|
305
|
-
}
|
|
306
|
-
.xps-table-caption {
|
|
307
|
-
margin-top: 0.625rem;
|
|
308
|
-
color: var(--xps-muted-foreground);
|
|
309
|
-
font-size: 0.75rem;
|
|
310
|
-
}
|
|
311
|
-
.xps-table-footer {
|
|
312
|
-
background: var(--xps-muted);
|
|
313
|
-
font-weight: 700;
|
|
314
|
-
}
|
|
24
|
+
.`).concat(pa,` {
|
|
25
|
+
margin-right: `).concat(s,"px ").concat(o,`;
|
|
26
|
+
}
|
|
315
27
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
width: fit-content;
|
|
320
|
-
border-radius: 999px;
|
|
321
|
-
border: 1px solid transparent;
|
|
322
|
-
padding: 0.0625rem 0.4375rem;
|
|
323
|
-
font-size: 0.75rem;
|
|
324
|
-
font-weight: 700;
|
|
325
|
-
line-height: 1.25;
|
|
326
|
-
white-space: nowrap;
|
|
327
|
-
}
|
|
328
|
-
.xps-badge--default {
|
|
329
|
-
background: color-mix(in srgb, var(--xps-primary) 12%, transparent);
|
|
330
|
-
color: var(--xps-primary);
|
|
331
|
-
border-color: color-mix(in srgb, var(--xps-primary) 18%, transparent);
|
|
332
|
-
}
|
|
333
|
-
.xps-badge--secondary {
|
|
334
|
-
background: var(--xps-muted);
|
|
335
|
-
color: var(--xps-muted-foreground);
|
|
336
|
-
border-color: var(--xps-border);
|
|
337
|
-
}
|
|
338
|
-
.xps-badge--success {
|
|
339
|
-
background: var(--xps-success-background);
|
|
340
|
-
color: var(--xps-success);
|
|
341
|
-
border-color: color-mix(in srgb, var(--xps-success) 16%, transparent);
|
|
342
|
-
}
|
|
343
|
-
.xps-badge--warning {
|
|
344
|
-
background: var(--xps-warning-background);
|
|
345
|
-
color: var(--xps-warning);
|
|
346
|
-
border-color: color-mix(in srgb, var(--xps-warning) 18%, transparent);
|
|
347
|
-
}
|
|
348
|
-
.xps-badge--destructive {
|
|
349
|
-
background: var(--xps-destructive-background);
|
|
350
|
-
color: var(--xps-destructive);
|
|
351
|
-
border-color: color-mix(in srgb, var(--xps-destructive) 18%, transparent);
|
|
352
|
-
}
|
|
353
|
-
.xps-separator {
|
|
354
|
-
flex-shrink: 0;
|
|
355
|
-
background: var(--xps-border);
|
|
356
|
-
}
|
|
357
|
-
.xps-separator--horizontal {
|
|
358
|
-
width: 100%;
|
|
359
|
-
height: 1px;
|
|
360
|
-
}
|
|
361
|
-
.xps-separator--vertical {
|
|
362
|
-
width: 1px;
|
|
363
|
-
height: 100%;
|
|
364
|
-
}
|
|
365
|
-
.xps-sidebar {
|
|
366
|
-
min-width: 0;
|
|
367
|
-
min-height: 0;
|
|
368
|
-
height: 100%;
|
|
369
|
-
display: grid;
|
|
370
|
-
grid-template-rows: auto minmax(0, 1fr);
|
|
371
|
-
overflow: hidden;
|
|
372
|
-
background: var(--xps-card);
|
|
373
|
-
color: var(--xps-card-foreground);
|
|
374
|
-
border-color: var(--xps-border);
|
|
375
|
-
border-style: solid;
|
|
376
|
-
}
|
|
377
|
-
.xps-sidebar--left {
|
|
378
|
-
border-width: 0 1px 0 0;
|
|
379
|
-
}
|
|
380
|
-
.xps-sidebar--right {
|
|
381
|
-
border-width: 0 0 0 1px;
|
|
382
|
-
}
|
|
383
|
-
.xps-sidebar-header {
|
|
384
|
-
min-height: 2.5rem;
|
|
385
|
-
padding: 0.375rem;
|
|
386
|
-
display: flex;
|
|
387
|
-
gap: 0.5rem;
|
|
388
|
-
align-items: center;
|
|
389
|
-
border-bottom: 1px solid var(--xps-border);
|
|
390
|
-
min-width: 0;
|
|
391
|
-
}
|
|
392
|
-
.xps-sidebar-title {
|
|
393
|
-
min-width: 0;
|
|
394
|
-
color: var(--xps-foreground);
|
|
395
|
-
font-size: var(--xps-control-font-size);
|
|
396
|
-
font-weight: 750;
|
|
397
|
-
line-height: 1.2;
|
|
398
|
-
}
|
|
399
|
-
.xps-sidebar-content {
|
|
400
|
-
min-height: 0;
|
|
401
|
-
display: flex;
|
|
402
|
-
flex-direction: column;
|
|
403
|
-
}
|
|
404
|
-
.xps-sidebar-footer {
|
|
405
|
-
padding: 0.5rem;
|
|
406
|
-
border-top: 1px solid var(--xps-border);
|
|
407
|
-
}
|
|
408
|
-
.xps-sidebar-trigger.xps-button {
|
|
409
|
-
flex: 0 0 auto;
|
|
410
|
-
color: var(--xps-muted-foreground);
|
|
411
|
-
}
|
|
412
|
-
.xps-sidebar-rail {
|
|
413
|
-
min-height: 0;
|
|
414
|
-
display: flex;
|
|
415
|
-
align-items: flex-start;
|
|
416
|
-
justify-content: center;
|
|
417
|
-
padding-top: 0.625rem;
|
|
418
|
-
color: var(--xps-muted-foreground);
|
|
419
|
-
background: color-mix(in srgb, var(--xps-card) 94%, var(--xps-muted) 6%);
|
|
420
|
-
}
|
|
421
|
-
.xps-sidebar-rail > span {
|
|
422
|
-
writing-mode: vertical-rl;
|
|
423
|
-
letter-spacing: 0;
|
|
424
|
-
font-size: 0.75rem;
|
|
425
|
-
font-weight: 700;
|
|
426
|
-
}
|
|
427
|
-
.xps-sidebar-group {
|
|
428
|
-
display: flex;
|
|
429
|
-
min-width: 0;
|
|
430
|
-
flex-direction: column;
|
|
431
|
-
gap: 0.5rem;
|
|
432
|
-
}
|
|
433
|
-
.xps-sidebar-group-label {
|
|
434
|
-
color: var(--xps-muted-foreground);
|
|
435
|
-
font-size: 0.75rem;
|
|
436
|
-
font-weight: 700;
|
|
437
|
-
line-height: 1.2;
|
|
438
|
-
}
|
|
439
|
-
.xps-sidebar-menu {
|
|
440
|
-
display: flex;
|
|
441
|
-
min-width: 0;
|
|
442
|
-
flex-direction: column;
|
|
443
|
-
gap: 0.375rem;
|
|
444
|
-
}
|
|
445
|
-
.xps-sidebar-menu-item {
|
|
446
|
-
min-width: 0;
|
|
447
|
-
}
|
|
448
|
-
.xps-sidebar-menu-button.xps-button {
|
|
449
|
-
width: 100%;
|
|
450
|
-
height: auto;
|
|
451
|
-
min-height: 3.25rem;
|
|
452
|
-
display: flex;
|
|
453
|
-
flex-direction: column;
|
|
454
|
-
align-items: flex-start;
|
|
455
|
-
justify-content: center;
|
|
456
|
-
gap: 0.25rem;
|
|
457
|
-
border: 1px solid transparent;
|
|
458
|
-
border-radius: var(--xps-radius);
|
|
459
|
-
padding: 0.5rem;
|
|
460
|
-
text-align: left;
|
|
461
|
-
white-space: normal;
|
|
462
|
-
}
|
|
463
|
-
.xps-sidebar-menu-button.xps-button:hover {
|
|
464
|
-
background: var(--xps-muted);
|
|
465
|
-
}
|
|
466
|
-
.xps-sidebar-menu-button--active.xps-button {
|
|
467
|
-
background: color-mix(in srgb, var(--xps-primary) 10%, transparent);
|
|
468
|
-
border-color: color-mix(in srgb, var(--xps-primary) 26%, var(--xps-border));
|
|
469
|
-
color: var(--xps-foreground);
|
|
470
|
-
}
|
|
471
|
-
.xps-scroll-area {
|
|
472
|
-
position: relative;
|
|
473
|
-
min-height: 0;
|
|
474
|
-
overflow: hidden;
|
|
475
|
-
}
|
|
476
|
-
.xps-scroll-area-viewport {
|
|
477
|
-
width: 100%;
|
|
478
|
-
height: 100%;
|
|
479
|
-
min-height: inherit;
|
|
480
|
-
border-radius: inherit;
|
|
481
|
-
}
|
|
482
|
-
.xps-scroll-bar {
|
|
483
|
-
display: flex;
|
|
484
|
-
touch-action: none;
|
|
485
|
-
user-select: none;
|
|
486
|
-
transition: background-color 120ms ease;
|
|
487
|
-
}
|
|
488
|
-
.xps-scroll-bar-vertical {
|
|
489
|
-
width: 0.5rem;
|
|
490
|
-
border-left: 1px solid transparent;
|
|
491
|
-
padding: 1px;
|
|
492
|
-
}
|
|
493
|
-
.xps-scroll-bar-horizontal {
|
|
494
|
-
height: 0.5rem;
|
|
495
|
-
flex-direction: column;
|
|
496
|
-
border-top: 1px solid transparent;
|
|
497
|
-
padding: 1px;
|
|
498
|
-
}
|
|
499
|
-
.xps-scroll-thumb {
|
|
500
|
-
position: relative;
|
|
501
|
-
flex: 1;
|
|
502
|
-
border-radius: 999px;
|
|
503
|
-
background: color-mix(in srgb, var(--xps-muted-foreground) 36%, transparent);
|
|
504
|
-
}
|
|
505
|
-
.xps-dialog-overlay {
|
|
506
|
-
position: fixed;
|
|
507
|
-
inset: 0;
|
|
508
|
-
z-index: 2147483646;
|
|
509
|
-
background: color-mix(in srgb, var(--xps-foreground) 42%, transparent);
|
|
510
|
-
}
|
|
511
|
-
.xps-dialog-content,
|
|
512
|
-
.xps-sheet-content {
|
|
513
|
-
position: fixed;
|
|
514
|
-
z-index: 2147483647;
|
|
515
|
-
border: 1px solid var(--xps-border);
|
|
516
|
-
background: var(--xps-card);
|
|
517
|
-
color: var(--xps-card-foreground);
|
|
518
|
-
box-shadow: 0 18px 54px color-mix(in srgb, var(--xps-foreground) 20%, transparent);
|
|
519
|
-
}
|
|
520
|
-
.xps-dialog-content {
|
|
521
|
-
left: 50%;
|
|
522
|
-
top: 50%;
|
|
523
|
-
width: min(520px, calc(100vw - 2rem));
|
|
524
|
-
max-height: calc(100vh - 2rem);
|
|
525
|
-
transform: translate(-50%, -50%);
|
|
526
|
-
border-radius: var(--xps-radius);
|
|
527
|
-
padding: 1rem;
|
|
528
|
-
overflow: auto;
|
|
529
|
-
}
|
|
530
|
-
.xps-sheet-content {
|
|
531
|
-
display: flex;
|
|
532
|
-
flex-direction: column;
|
|
533
|
-
gap: 1rem;
|
|
534
|
-
padding: 1rem;
|
|
535
|
-
}
|
|
536
|
-
.xps-sheet-content--right,
|
|
537
|
-
.xps-sheet-content--left {
|
|
538
|
-
top: 0;
|
|
539
|
-
bottom: 0;
|
|
540
|
-
width: min(380px, calc(100vw - 2rem));
|
|
541
|
-
}
|
|
542
|
-
.xps-sheet-content--right { right: 0; border-radius: var(--xps-radius) 0 0 var(--xps-radius); }
|
|
543
|
-
.xps-sheet-content--left { left: 0; border-radius: 0 var(--xps-radius) var(--xps-radius) 0; }
|
|
544
|
-
.xps-sheet-content--top,
|
|
545
|
-
.xps-sheet-content--bottom {
|
|
546
|
-
left: 0;
|
|
547
|
-
right: 0;
|
|
548
|
-
max-height: min(420px, calc(100vh - 2rem));
|
|
549
|
-
}
|
|
550
|
-
.xps-sheet-content--top { top: 0; border-radius: 0 0 var(--xps-radius) var(--xps-radius); }
|
|
551
|
-
.xps-sheet-content--bottom { bottom: 0; border-radius: var(--xps-radius) var(--xps-radius) 0 0; }
|
|
552
|
-
.xps-dialog-close {
|
|
553
|
-
position: absolute;
|
|
554
|
-
right: 0.625rem;
|
|
555
|
-
top: 0.625rem;
|
|
556
|
-
display: inline-flex;
|
|
557
|
-
align-items: center;
|
|
558
|
-
justify-content: center;
|
|
559
|
-
width: var(--xps-control-height-sm);
|
|
560
|
-
height: var(--xps-control-height-sm);
|
|
561
|
-
border: 0;
|
|
562
|
-
border-radius: calc(var(--xps-radius) - 2px);
|
|
563
|
-
background: transparent;
|
|
564
|
-
color: var(--xps-muted-foreground);
|
|
565
|
-
cursor: pointer;
|
|
566
|
-
}
|
|
567
|
-
.xps-dialog-close:hover {
|
|
568
|
-
background: var(--xps-muted);
|
|
569
|
-
color: var(--xps-foreground);
|
|
570
|
-
}
|
|
571
|
-
.xps-dialog-header,
|
|
572
|
-
.xps-dialog-footer {
|
|
573
|
-
display: flex;
|
|
574
|
-
gap: 0.5rem;
|
|
575
|
-
}
|
|
576
|
-
.xps-dialog-header {
|
|
577
|
-
flex-direction: column;
|
|
578
|
-
padding-right: 2rem;
|
|
579
|
-
}
|
|
580
|
-
.xps-dialog-footer {
|
|
581
|
-
justify-content: flex-end;
|
|
582
|
-
flex-wrap: wrap;
|
|
583
|
-
}
|
|
584
|
-
.xps-dialog-title {
|
|
585
|
-
margin: 0;
|
|
586
|
-
color: var(--xps-foreground);
|
|
587
|
-
font-size: 1rem;
|
|
588
|
-
font-weight: 750;
|
|
589
|
-
line-height: 1.2;
|
|
590
|
-
}
|
|
591
|
-
.xps-dialog-description {
|
|
592
|
-
margin: 0;
|
|
593
|
-
color: var(--xps-muted-foreground);
|
|
594
|
-
font-size: var(--xps-control-font-size);
|
|
595
|
-
line-height: 1.45;
|
|
596
|
-
}
|
|
597
|
-
.xps-dropdown-menu-content {
|
|
598
|
-
z-index: 2147483647;
|
|
599
|
-
min-width: 10rem;
|
|
600
|
-
overflow: hidden;
|
|
601
|
-
border: 1px solid var(--xps-border);
|
|
602
|
-
border-radius: var(--xps-radius);
|
|
603
|
-
background: var(--xps-popover);
|
|
604
|
-
color: var(--xps-popover-foreground);
|
|
605
|
-
padding: 0.25rem;
|
|
606
|
-
box-shadow: 0 10px 30px color-mix(in srgb, var(--xps-foreground) 12%, transparent);
|
|
607
|
-
}
|
|
608
|
-
.xps-dropdown-menu-item,
|
|
609
|
-
.xps-dropdown-menu-sub-trigger {
|
|
610
|
-
position: relative;
|
|
611
|
-
display: flex;
|
|
612
|
-
min-height: var(--xps-control-height);
|
|
613
|
-
align-items: center;
|
|
614
|
-
gap: 0.5rem;
|
|
615
|
-
border-radius: calc(var(--xps-radius) - 2px);
|
|
616
|
-
padding: 0.3125rem 0.5rem;
|
|
617
|
-
color: var(--xps-foreground);
|
|
618
|
-
cursor: pointer;
|
|
619
|
-
font-size: var(--xps-control-font-size);
|
|
620
|
-
line-height: 1.2;
|
|
621
|
-
outline: none;
|
|
622
|
-
user-select: none;
|
|
623
|
-
}
|
|
624
|
-
.xps-dropdown-menu-item[data-highlighted],
|
|
625
|
-
.xps-dropdown-menu-sub-trigger[data-highlighted] {
|
|
626
|
-
background: var(--xps-accent);
|
|
627
|
-
color: var(--xps-accent-foreground);
|
|
628
|
-
}
|
|
629
|
-
.xps-dropdown-menu-item[data-disabled],
|
|
630
|
-
.xps-dropdown-menu-sub-trigger[data-disabled] {
|
|
631
|
-
pointer-events: none;
|
|
632
|
-
opacity: 0.5;
|
|
633
|
-
}
|
|
634
|
-
.xps-dropdown-menu-item--inset {
|
|
635
|
-
padding-left: 1.75rem;
|
|
636
|
-
}
|
|
637
|
-
.xps-dropdown-menu-check-item {
|
|
638
|
-
padding-left: 1.75rem;
|
|
639
|
-
}
|
|
640
|
-
.xps-dropdown-menu-item-indicator {
|
|
641
|
-
position: absolute;
|
|
642
|
-
left: 0.5rem;
|
|
643
|
-
display: inline-flex;
|
|
644
|
-
width: 1rem;
|
|
645
|
-
align-items: center;
|
|
646
|
-
justify-content: center;
|
|
647
|
-
}
|
|
648
|
-
.xps-dropdown-menu-label {
|
|
649
|
-
padding: 0.3125rem 0.5rem;
|
|
650
|
-
color: var(--xps-muted-foreground);
|
|
651
|
-
font-size: 0.75rem;
|
|
652
|
-
font-weight: 700;
|
|
653
|
-
}
|
|
654
|
-
.xps-dropdown-menu-separator {
|
|
655
|
-
height: 1px;
|
|
656
|
-
margin: 0.25rem -0.25rem;
|
|
657
|
-
background: var(--xps-border);
|
|
658
|
-
}
|
|
659
|
-
.xps-dropdown-menu-shortcut {
|
|
660
|
-
margin-left: auto;
|
|
661
|
-
color: var(--xps-muted-foreground);
|
|
662
|
-
font-size: 0.75rem;
|
|
663
|
-
}
|
|
28
|
+
.`).concat(fa," .").concat(fa,` {
|
|
29
|
+
right: 0 `).concat(o,`;
|
|
30
|
+
}
|
|
664
31
|
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
border-radius: var(--xps-radius);
|
|
669
|
-
background: var(--xps-popover);
|
|
670
|
-
color: var(--xps-popover-foreground);
|
|
671
|
-
}
|
|
672
|
-
.xps-command-input-wrapper {
|
|
673
|
-
display: flex;
|
|
674
|
-
align-items: center;
|
|
675
|
-
gap: 0.5rem;
|
|
676
|
-
border-bottom: 1px solid var(--xps-border);
|
|
677
|
-
padding: 0 0.625rem;
|
|
678
|
-
color: var(--xps-muted-foreground);
|
|
679
|
-
}
|
|
680
|
-
.xps-command-input {
|
|
681
|
-
width: 100%;
|
|
682
|
-
height: 2.25rem;
|
|
683
|
-
border: 0;
|
|
684
|
-
outline: none;
|
|
685
|
-
background: transparent;
|
|
686
|
-
color: var(--xps-foreground);
|
|
687
|
-
font-family: inherit;
|
|
688
|
-
font-size: var(--xps-control-font-size);
|
|
689
|
-
}
|
|
690
|
-
.xps-command-input::placeholder {
|
|
691
|
-
color: var(--xps-muted-foreground);
|
|
692
|
-
}
|
|
693
|
-
.xps-command-list {
|
|
694
|
-
max-height: 18rem;
|
|
695
|
-
overflow: auto;
|
|
696
|
-
overscroll-behavior: contain;
|
|
697
|
-
padding: 0.25rem;
|
|
698
|
-
}
|
|
699
|
-
.xps-command-empty {
|
|
700
|
-
padding: 1.25rem 0.75rem;
|
|
701
|
-
color: var(--xps-muted-foreground);
|
|
702
|
-
text-align: center;
|
|
703
|
-
font-size: var(--xps-control-font-size);
|
|
704
|
-
}
|
|
705
|
-
.xps-command-group {
|
|
706
|
-
overflow: hidden;
|
|
707
|
-
padding: 0.25rem;
|
|
708
|
-
}
|
|
709
|
-
.xps-command-group [cmdk-group-heading] {
|
|
710
|
-
padding: 0.375rem 0.5rem;
|
|
711
|
-
color: var(--xps-muted-foreground);
|
|
712
|
-
font-size: 0.75rem;
|
|
713
|
-
font-weight: 700;
|
|
714
|
-
}
|
|
715
|
-
.xps-command-item {
|
|
716
|
-
display: flex;
|
|
717
|
-
min-height: var(--xps-control-height);
|
|
718
|
-
cursor: pointer;
|
|
719
|
-
user-select: none;
|
|
720
|
-
align-items: center;
|
|
721
|
-
gap: 0.5rem;
|
|
722
|
-
border-radius: calc(var(--xps-radius) - 2px);
|
|
723
|
-
padding: 0.375rem 0.5rem;
|
|
724
|
-
color: var(--xps-foreground);
|
|
725
|
-
font-size: var(--xps-control-font-size);
|
|
726
|
-
outline: none;
|
|
727
|
-
}
|
|
728
|
-
.xps-command-item[data-selected="true"] {
|
|
729
|
-
background: var(--xps-accent);
|
|
730
|
-
color: var(--xps-accent-foreground);
|
|
731
|
-
}
|
|
732
|
-
.xps-command-item[data-disabled="true"] {
|
|
733
|
-
pointer-events: none;
|
|
734
|
-
opacity: 0.5;
|
|
735
|
-
}
|
|
736
|
-
.xps-command-separator {
|
|
737
|
-
height: 1px;
|
|
738
|
-
margin: 0.25rem -0.25rem;
|
|
739
|
-
background: var(--xps-border);
|
|
740
|
-
}
|
|
32
|
+
.`).concat(pa," .").concat(pa,` {
|
|
33
|
+
margin-right: 0 `).concat(o,`;
|
|
34
|
+
}
|
|
741
35
|
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
background: var(--xps-muted);
|
|
749
|
-
padding: 0.1875rem;
|
|
750
|
-
}
|
|
751
|
-
.xps-tabs-trigger {
|
|
752
|
-
display: inline-flex;
|
|
753
|
-
align-items: center;
|
|
754
|
-
justify-content: center;
|
|
755
|
-
min-height: calc(var(--xps-control-height) - 0.375rem);
|
|
756
|
-
border: 0;
|
|
757
|
-
border-radius: calc(var(--xps-radius) - 2px);
|
|
758
|
-
background: transparent;
|
|
759
|
-
color: var(--xps-muted-foreground);
|
|
760
|
-
cursor: pointer;
|
|
761
|
-
font-family: inherit;
|
|
762
|
-
font-size: var(--xps-control-font-size);
|
|
763
|
-
font-weight: 650;
|
|
764
|
-
padding: 0 0.625rem;
|
|
765
|
-
white-space: nowrap;
|
|
766
|
-
}
|
|
767
|
-
.xps-tabs-trigger[data-state='active'] {
|
|
768
|
-
background: var(--xps-card);
|
|
769
|
-
color: var(--xps-foreground);
|
|
770
|
-
box-shadow: 0 1px 2px color-mix(in srgb, var(--xps-foreground) 10%, transparent);
|
|
771
|
-
}
|
|
772
|
-
.xps-tabs-trigger:disabled {
|
|
773
|
-
cursor: not-allowed;
|
|
774
|
-
opacity: 0.5;
|
|
775
|
-
}
|
|
776
|
-
.xps-tabs-content {
|
|
777
|
-
min-width: 0;
|
|
778
|
-
outline: none;
|
|
779
|
-
}
|
|
780
|
-
.xps-tooltip-content {
|
|
781
|
-
z-index: 2147483647;
|
|
782
|
-
max-width: min(320px, calc(100vw - 2rem));
|
|
783
|
-
border-radius: calc(var(--xps-radius) - 2px);
|
|
784
|
-
background: var(--xps-foreground);
|
|
785
|
-
color: var(--xps-background);
|
|
786
|
-
padding: 0.375rem 0.625rem;
|
|
787
|
-
font-size: 0.75rem;
|
|
788
|
-
line-height: 1.3;
|
|
789
|
-
box-shadow: 0 10px 30px color-mix(in srgb, var(--xps-foreground) 14%, transparent);
|
|
790
|
-
}
|
|
791
|
-
.xps-checkbox {
|
|
792
|
-
display: inline-flex;
|
|
793
|
-
align-items: center;
|
|
794
|
-
justify-content: center;
|
|
795
|
-
width: 1rem;
|
|
796
|
-
height: 1rem;
|
|
797
|
-
border: 1px solid var(--xps-input);
|
|
798
|
-
border-radius: calc(var(--xps-radius) - 3px);
|
|
799
|
-
background: var(--xps-card);
|
|
800
|
-
color: var(--xps-primary-foreground);
|
|
801
|
-
cursor: pointer;
|
|
802
|
-
}
|
|
803
|
-
.xps-checkbox[data-state='checked'] {
|
|
804
|
-
background: var(--xps-primary);
|
|
805
|
-
border-color: var(--xps-primary);
|
|
806
|
-
}
|
|
807
|
-
.xps-checkbox:disabled {
|
|
808
|
-
cursor: not-allowed;
|
|
809
|
-
opacity: 0.5;
|
|
810
|
-
}
|
|
811
|
-
.xps-checkbox-indicator {
|
|
812
|
-
display: inline-flex;
|
|
813
|
-
align-items: center;
|
|
814
|
-
justify-content: center;
|
|
815
|
-
}
|
|
816
|
-
.xps-switch {
|
|
817
|
-
position: relative;
|
|
818
|
-
display: inline-flex;
|
|
819
|
-
align-items: center;
|
|
820
|
-
width: 2.25rem;
|
|
821
|
-
height: 1.25rem;
|
|
822
|
-
border: 1px solid transparent;
|
|
823
|
-
border-radius: 999px;
|
|
824
|
-
background: color-mix(in srgb, var(--xps-muted-foreground) 34%, transparent);
|
|
825
|
-
cursor: pointer;
|
|
826
|
-
transition: background-color 120ms ease, box-shadow 120ms ease;
|
|
827
|
-
}
|
|
828
|
-
.xps-switch[data-state='checked'] {
|
|
829
|
-
background: var(--xps-primary);
|
|
830
|
-
}
|
|
831
|
-
.xps-switch:disabled {
|
|
832
|
-
cursor: not-allowed;
|
|
833
|
-
opacity: 0.5;
|
|
834
|
-
}
|
|
835
|
-
.xps-switch-thumb {
|
|
836
|
-
display: block;
|
|
837
|
-
width: 1rem;
|
|
838
|
-
height: 1rem;
|
|
839
|
-
border-radius: 999px;
|
|
840
|
-
background: #ffffff;
|
|
841
|
-
box-shadow: 0 1px 3px color-mix(in srgb, #000000 20%, transparent);
|
|
842
|
-
transform: translateX(0.125rem);
|
|
843
|
-
transition: transform 120ms ease;
|
|
844
|
-
}
|
|
845
|
-
.xps-switch[data-state='checked'] .xps-switch-thumb {
|
|
846
|
-
transform: translateX(1rem);
|
|
847
|
-
}
|
|
848
|
-
.xps-slider {
|
|
849
|
-
position: relative;
|
|
850
|
-
display: flex;
|
|
851
|
-
width: 100%;
|
|
852
|
-
touch-action: none;
|
|
853
|
-
user-select: none;
|
|
854
|
-
align-items: center;
|
|
855
|
-
}
|
|
856
|
-
.xps-slider-track {
|
|
857
|
-
position: relative;
|
|
858
|
-
height: 0.375rem;
|
|
859
|
-
width: 100%;
|
|
860
|
-
flex: 1;
|
|
861
|
-
overflow: hidden;
|
|
862
|
-
border-radius: 999px;
|
|
863
|
-
background: var(--xps-muted);
|
|
864
|
-
}
|
|
865
|
-
.xps-slider-range {
|
|
866
|
-
position: absolute;
|
|
867
|
-
height: 100%;
|
|
868
|
-
background: var(--xps-primary);
|
|
869
|
-
}
|
|
870
|
-
.xps-slider-thumb {
|
|
871
|
-
display: block;
|
|
872
|
-
width: 1rem;
|
|
873
|
-
height: 1rem;
|
|
874
|
-
border: 2px solid var(--xps-primary);
|
|
875
|
-
border-radius: 999px;
|
|
876
|
-
background: var(--xps-card);
|
|
877
|
-
box-shadow: 0 1px 3px color-mix(in srgb, var(--xps-foreground) 12%, transparent);
|
|
878
|
-
transition: box-shadow 120ms ease;
|
|
879
|
-
}
|
|
880
|
-
.xps-slider-thumb:disabled {
|
|
881
|
-
cursor: not-allowed;
|
|
882
|
-
opacity: 0.5;
|
|
883
|
-
}
|
|
884
|
-
.xps-icon--filled {
|
|
885
|
-
fill: currentColor;
|
|
886
|
-
}
|
|
887
|
-
.xps-sr-only {
|
|
888
|
-
position: absolute;
|
|
889
|
-
width: 1px;
|
|
890
|
-
height: 1px;
|
|
891
|
-
padding: 0;
|
|
892
|
-
margin: -1px;
|
|
893
|
-
overflow: hidden;
|
|
894
|
-
clip: rect(0, 0, 0, 0);
|
|
895
|
-
white-space: nowrap;
|
|
896
|
-
border: 0;
|
|
897
|
-
}
|
|
898
|
-
.xps-icon {
|
|
899
|
-
width: 1rem;
|
|
900
|
-
height: 1rem;
|
|
901
|
-
flex: 0 0 auto;
|
|
902
|
-
stroke-width: 2;
|
|
903
|
-
}
|
|
904
|
-
`,document.head.appendChild(a)}function Ps(e){var t,a,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(a=Ps(e[t]))&&(o&&(o+=" "),o+=a)}else for(a in e)e[a]&&(o&&(o+=" "),o+=a);return o}function Vo(){for(var e,t,a=0,o="",r=arguments.length;a<r;a++)(e=arguments[a])&&(t=Ps(e))&&(o&&(o+=" "),o+=t);return o}var Cm=e=>{let t=Sm(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:i=>{let s=i.split("-");return s[0]===""&&s.length!==1&&s.shift(),Ms(s,t)||Lm(i)},getConflictingClassGroupIds:(i,s)=>{let l=a[i]||[];return s&&o[i]?[...l,...o[i]]:l}}},Ms=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],o=t.nextPart.get(a),r=o?Ms(e.slice(1),o):void 0;if(r)return r;if(t.validators.length===0)return;let n=e.join("-");return t.validators.find(({validator:i})=>i(n))?.classGroupId},ks=/^\[(.+)\]$/,Lm=e=>{if(ks.test(e)){let t=ks.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},Sm=e=>{let{theme:t,prefix:a}=e,o={nextPart:new Map,validators:[]};return Rm(Object.entries(e.classGroups),a).forEach(([n,i])=>{cn(i,o,n,t)}),o},cn=(e,t,a,o)=>{e.forEach(r=>{if(typeof r=="string"){let n=r===""?t:Ts(t,r);n.classGroupId=a;return}if(typeof r=="function"){if(Im(r)){cn(r(o),t,a,o);return}t.validators.push({validator:r,classGroupId:a});return}Object.entries(r).forEach(([n,i])=>{cn(i,Ts(t,n),a,o)})})},Ts=(e,t)=>{let a=e;return t.split("-").forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},Im=e=>e.isThemeGetter,Rm=(e,t)=>t?e.map(([a,o])=>{let r=o.map(n=>typeof n=="string"?t+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([i,s])=>[t+i,s])):n);return[a,r]}):e,Pm=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,o=new Map,r=(n,i)=>{a.set(n,i),t++,t>e&&(t=0,o=a,a=new Map)};return{get(n){let i=a.get(n);if(i!==void 0)return i;if((i=o.get(n))!==void 0)return r(n,i),i},set(n,i){a.has(n)?a.set(n,i):r(n,i)}}};var km=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,r=t[0],n=t.length,i=s=>{let l=[],u=0,c=0,f;for(let h=0;h<s.length;h++){let y=s[h];if(u===0){if(y===r&&(o||s.slice(h,h+n)===t)){l.push(s.slice(c,h)),c=h+n;continue}if(y==="/"){f=h;continue}}y==="["?u++:y==="]"&&u--}let p=l.length===0?s:s.substring(c),g=p.startsWith("!"),v=g?p.substring(1):p,m=f&&f>c?f-c:void 0;return{modifiers:l,hasImportantModifier:g,baseClassName:v,maybePostfixModifierPosition:m}};return a?s=>a({className:s,parseClassName:i}):i},Tm=e=>{if(e.length<=1)return e;let t=[],a=[];return e.forEach(o=>{o[0]==="["?(t.push(...a.sort(),o),a=[]):a.push(o)}),t.push(...a.sort()),t},Mm=e=>({cache:Pm(e.cacheSize),parseClassName:km(e),...Cm(e)}),Am=/\s+/,Dm=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:r}=t,n=[],i=e.trim().split(Am),s="";for(let l=i.length-1;l>=0;l-=1){let u=i[l],{modifiers:c,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:g}=a(u),v=!!g,m=o(v?p.substring(0,g):p);if(!m){if(!v){s=u+(s.length>0?" "+s:s);continue}if(m=o(p),!m){s=u+(s.length>0?" "+s:s);continue}v=!1}let h=Tm(c).join(":"),y=f?h+"!":h,b=y+m;if(n.includes(b))continue;n.push(b);let w=r(m,v);for(let C=0;C<w.length;++C){let P=w[C];n.push(y+P)}s=u+(s.length>0?" "+s:s)}return s};function Em(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=As(t))&&(o&&(o+=" "),o+=a);return o}var As=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=As(e[o]))&&(a&&(a+=" "),a+=t);return a};function Om(e,...t){let a,o,r,n=i;function i(l){let u=t.reduce((c,f)=>f(c),e());return a=Mm(u),o=a.cache.get,r=a.cache.set,n=s,s(l)}function s(l){let u=o(l);if(u)return u;let c=Dm(l,a);return r(l,c),c}return function(){return n(Em.apply(null,arguments))}}var we=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},Ds=/^\[(?:([a-z-]+):)?(.+)\]$/i,Bm=/^\d+\/\d+$/,Fm=new Set(["px","full","screen"]),Nm=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Hm=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,zm=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,_m=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Vm=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Tt=e=>Ra(e)||Fm.has(e)||Bm.test(e),Ht=e=>Pa(e,"length",Xm),Ra=e=>!!e&&!Number.isNaN(Number(e)),un=e=>Pa(e,"number",Ra),ao=e=>!!e&&Number.isInteger(Number(e)),Um=e=>e.endsWith("%")&&Ra(e.slice(0,-1)),ne=e=>Ds.test(e),zt=e=>Nm.test(e),qm=new Set(["length","size","percentage"]),jm=e=>Pa(e,qm,Es),Wm=e=>Pa(e,"position",Es),Gm=new Set(["image","url"]),Km=e=>Pa(e,Gm,Ym),$m=e=>Pa(e,"",Jm),oo=()=>!0,Pa=(e,t,a)=>{let o=Ds.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},Xm=e=>Hm.test(e)&&!zm.test(e),Es=()=>!1,Jm=e=>_m.test(e),Ym=e=>Vm.test(e);var Zm=()=>{let e=we("colors"),t=we("spacing"),a=we("blur"),o=we("brightness"),r=we("borderColor"),n=we("borderRadius"),i=we("borderSpacing"),s=we("borderWidth"),l=we("contrast"),u=we("grayscale"),c=we("hueRotate"),f=we("invert"),p=we("gap"),g=we("gradientColorStops"),v=we("gradientColorStopPositions"),m=we("inset"),h=we("margin"),y=we("opacity"),b=we("padding"),w=we("saturate"),C=we("scale"),P=we("sepia"),M=we("skew"),T=we("space"),B=we("translate"),U=()=>["auto","contain","none"],Y=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto",ne,t],E=()=>[ne,t],W=()=>["",Tt,Ht],Z=()=>["auto",Ra,ne],R=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],H=()=>["solid","dashed","dotted","double","none"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],O=()=>["start","end","center","between","around","evenly","stretch"],X=()=>["","0",ne],se=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>[Ra,ne];return{cacheSize:500,separator:":",theme:{colors:[oo],spacing:[Tt,Ht],blur:["none","",zt,ne],brightness:S(),borderColor:[e],borderRadius:["none","","full",zt,ne],borderSpacing:E(),borderWidth:W(),contrast:S(),grayscale:X(),hueRotate:S(),invert:X(),gap:E(),gradientColorStops:[e],gradientColorStopPositions:[Um,Ht],inset:j(),margin:j(),opacity:S(),padding:E(),saturate:S(),scale:S(),sepia:X(),skew:S(),space:E(),translate:E()},classGroups:{aspect:[{aspect:["auto","square","video",ne]}],container:["container"],columns:[{columns:[zt]}],"break-after":[{"break-after":se()}],"break-before":[{"break-before":se()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...R(),ne]}],overflow:[{overflow:Y()}],"overflow-x":[{"overflow-x":Y()}],"overflow-y":[{"overflow-y":Y()}],overscroll:[{overscroll:U()}],"overscroll-x":[{"overscroll-x":U()}],"overscroll-y":[{"overscroll-y":U()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ao,ne]}],basis:[{basis:j()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ne]}],grow:[{grow:X()}],shrink:[{shrink:X()}],order:[{order:["first","last","none",ao,ne]}],"grid-cols":[{"grid-cols":[oo]}],"col-start-end":[{col:["auto",{span:["full",ao,ne]},ne]}],"col-start":[{"col-start":Z()}],"col-end":[{"col-end":Z()}],"grid-rows":[{"grid-rows":[oo]}],"row-start-end":[{row:["auto",{span:[ao,ne]},ne]}],"row-start":[{"row-start":Z()}],"row-end":[{"row-end":Z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ne]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ne]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...O()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...O(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...O(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[h]}],mx:[{mx:[h]}],my:[{my:[h]}],ms:[{ms:[h]}],me:[{me:[h]}],mt:[{mt:[h]}],mr:[{mr:[h]}],mb:[{mb:[h]}],ml:[{ml:[h]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ne,t]}],"min-w":[{"min-w":[ne,t,"min","max","fit"]}],"max-w":[{"max-w":[ne,t,"none","full","min","max","fit","prose",{screen:[zt]},zt]}],h:[{h:[ne,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ne,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ne,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ne,t,"auto","min","max","fit"]}],"font-size":[{text:["base",zt,Ht]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",un]}],"font-family":[{font:[oo]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ne]}],"line-clamp":[{"line-clamp":["none",Ra,un]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Tt,ne]}],"list-image":[{"list-image":["none",ne]}],"list-style-type":[{list:["none","disc","decimal",ne]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Tt,Ht]}],"underline-offset":[{"underline-offset":["auto",Tt,ne]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ne]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...R(),Wm]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",jm]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Km]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[n]}],"rounded-s":[{"rounded-s":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-r":[{"rounded-r":[n]}],"rounded-b":[{"rounded-b":[n]}],"rounded-l":[{"rounded-l":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-se":[{"rounded-se":[n]}],"rounded-ee":[{"rounded-ee":[n]}],"rounded-es":[{"rounded-es":[n]}],"rounded-tl":[{"rounded-tl":[n]}],"rounded-tr":[{"rounded-tr":[n]}],"rounded-br":[{"rounded-br":[n]}],"rounded-bl":[{"rounded-bl":[n]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...H(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:H()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-l":[{"border-l":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...H()]}],"outline-offset":[{"outline-offset":[Tt,ne]}],"outline-w":[{outline:[Tt,Ht]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Tt,Ht]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",zt,$m]}],"shadow-color":[{shadow:[oo]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...K(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":K()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",zt,ne]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[P]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[P]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ne]}],duration:[{duration:S()}],ease:[{ease:["linear","in","out","in-out",ne]}],delay:[{delay:S()}],animate:[{animate:["none","spin","ping","pulse","bounce",ne]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[ao,ne]}],"translate-x":[{"translate-x":[B]}],"translate-y":[{"translate-y":[B]}],"skew-x":[{"skew-x":[M]}],"skew-y":[{"skew-y":[M]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ne]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ne]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ne]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Tt,Ht,un]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Os=Om(Zm);function de(...e){return Os(Vo(e))}var ze=I(({className:e,type:t,...a},o)=>N("input",{ref:o,type:t,className:de("xps-input",e),...a}));ze.displayName="Input";var Cn=(e,t,a)=>{if(!t.has(e))throw TypeError("Cannot "+a)},x=(e,t,a)=>(Cn(e,t,"read from private field"),a?a.call(e):t.get(e)),ie=(e,t,a)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,a)},Be=(e,t,a,o)=>(Cn(e,t,"write to private field"),o?o.call(e,a):t.set(e,a),a),Qm=(e,t,a,o)=>({set _(r){Be(e,t,r,a)},get _(){return x(e,t,o)}}),ue=(e,t,a)=>(Cn(e,t,"access private method"),a),pe=new Uint8Array(8),gt=new DataView(pe.buffer),De=e=>[(e%256+256)%256],ge=e=>(gt.setUint16(0,e,!1),[pe[0],pe[1]]),ep=e=>(gt.setInt16(0,e,!1),[pe[0],pe[1]]),Fs=e=>(gt.setUint32(0,e,!1),[pe[1],pe[2],pe[3]]),z=e=>(gt.setUint32(0,e,!1),[pe[0],pe[1],pe[2],pe[3]]),tp=e=>(gt.setInt32(0,e,!1),[pe[0],pe[1],pe[2],pe[3]]),aa=e=>(gt.setUint32(0,Math.floor(e/2**32),!1),gt.setUint32(4,e,!1),[pe[0],pe[1],pe[2],pe[3],pe[4],pe[5],pe[6],pe[7]]),Ln=e=>(gt.setInt16(0,2**8*e,!1),[pe[0],pe[1]]),pt=e=>(gt.setInt32(0,2**16*e,!1),[pe[0],pe[1],pe[2],pe[3]]),fn=e=>(gt.setInt32(0,2**30*e,!1),[pe[0],pe[1],pe[2],pe[3]]),et=(e,t=!1)=>{let a=Array(e.length).fill(null).map((o,r)=>e.charCodeAt(r));return t&&a.push(0),a},Ko=e=>e&&e[e.length-1],Sn=e=>{let t;for(let a of e)(!t||a.presentationTimestamp>t.presentationTimestamp)&&(t=a);return t},ht=(e,t,a=!0)=>{let o=e*t;return a?Math.round(o):o},Ns=e=>{let t=e*(Math.PI/180),a=Math.cos(t),o=Math.sin(t);return[a,o,0,-o,a,0,0,0,1]},Hs=Ns(0),zs=e=>[pt(e[0]),pt(e[1]),fn(e[2]),pt(e[3]),pt(e[4]),fn(e[5]),pt(e[6]),pt(e[7]),fn(e[8])],io=e=>!e||typeof e!="object"?e:Array.isArray(e)?e.map(io):Object.fromEntries(Object.entries(e).map(([t,a])=>[t,io(a)])),Aa=e=>e>=0&&e<2**32,Me=(e,t,a)=>({type:e,contents:t&&new Uint8Array(t.flat(10)),children:a}),Ce=(e,t,a,o,r)=>Me(e,[De(t),Fs(a),o??[]],r),ap=e=>{let t=512;return e.fragmented?Me("ftyp",[et("iso5"),z(t),et("iso5"),et("iso6"),et("mp41")]):Me("ftyp",[et("isom"),z(t),et("isom"),e.holdsAvc?et("avc1"):[],et("mp41")])},mn=e=>({type:"mdat",largeSize:e}),op=e=>({type:"free",size:e}),Uo=(e,t,a=!1)=>Me("moov",null,[rp(t,e),...e.map(o=>np(o,t)),a?Fp(e):null]),rp=(e,t)=>{let a=ht(Math.max(0,...t.filter(i=>i.samples.length>0).map(i=>{let s=Sn(i.samples);return s.presentationTimestamp+s.duration})),gn),o=Math.max(...t.map(i=>i.id))+1,r=!Aa(e)||!Aa(a),n=r?aa:z;return Ce("mvhd",+r,0,[n(e),n(e),z(gn),n(a),pt(1),Ln(1),Array(10).fill(0),zs(Hs),Array(24).fill(0),z(o)])},np=(e,t)=>Me("trak",null,[ip(e,t),sp(e,t)]),ip=(e,t)=>{let a=Sn(e.samples),o=ht(a?a.presentationTimestamp+a.duration:0,gn),r=!Aa(t)||!Aa(o),n=r?aa:z,i;return e.info.type==="video"?i=typeof e.info.rotation=="number"?Ns(e.info.rotation):e.info.rotation:i=Hs,Ce("tkhd",+r,3,[n(t),n(t),z(e.id),z(0),n(o),Array(8).fill(0),ge(0),ge(0),Ln(e.info.type==="audio"?1:0),ge(0),zs(i),pt(e.info.type==="video"?e.info.width:0),pt(e.info.type==="video"?e.info.height:0)])},sp=(e,t)=>Me("mdia",null,[lp(e,t),dp(e.info.type==="video"?"vide":"soun"),up(e)]),lp=(e,t)=>{let a=Sn(e.samples),o=ht(a?a.presentationTimestamp+a.duration:0,e.timescale),r=!Aa(t)||!Aa(o),n=r?aa:z;return Ce("mdhd",+r,0,[n(t),n(t),z(e.timescale),n(o),ge(21956),ge(0)])},dp=e=>Ce("hdlr",0,0,[et("mhlr"),et(e),z(0),z(0),z(0),et("mp4-muxer-hdlr",!0)]),up=e=>Me("minf",null,[e.info.type==="video"?cp():fp(),mp(),gp(e)]),cp=()=>Ce("vmhd",0,1,[ge(0),ge(0),ge(0),ge(0)]),fp=()=>Ce("smhd",0,0,[ge(0),ge(0)]),mp=()=>Me("dinf",null,[pp()]),pp=()=>Ce("dref",0,0,[z(1)],[hp()]),hp=()=>Ce("url ",0,1),gp=e=>{let t=e.compositionTimeOffsetTable.length>1||e.compositionTimeOffsetTable.some(a=>a.sampleCompositionTimeOffset!==0);return Me("stbl",null,[xp(e),Mp(e),Ap(e),Dp(e),Ep(e),Op(e),t?Bp(e):null])},xp=e=>Ce("stsd",0,0,[z(1)],[e.info.type==="video"?vp(Gp[e.info.codec],e):Pp($p[e.info.codec],e)]),vp=(e,t)=>Me(e,[Array(6).fill(0),ge(1),ge(0),ge(0),Array(12).fill(0),ge(t.info.width),ge(t.info.height),z(4718592),z(4718592),z(0),ge(1),Array(32).fill(0),ge(24),ep(65535)],[Kp[t.info.codec](t),t.info.decoderConfig.colorSpace?Cp(t):null]),yp={bt709:1,bt470bg:5,smpte170m:6},bp={bt709:1,smpte170m:6,"iec61966-2-1":13},wp={rgb:0,bt709:1,bt470bg:5,smpte170m:6},Cp=e=>Me("colr",[et("nclx"),ge(yp[e.info.decoderConfig.colorSpace.primaries]),ge(bp[e.info.decoderConfig.colorSpace.transfer]),ge(wp[e.info.decoderConfig.colorSpace.matrix]),De((e.info.decoderConfig.colorSpace.fullRange?1:0)<<7)]),Lp=e=>e.info.decoderConfig&&Me("avcC",[...new Uint8Array(e.info.decoderConfig.description)]),Sp=e=>e.info.decoderConfig&&Me("hvcC",[...new Uint8Array(e.info.decoderConfig.description)]),Ip=e=>{if(!e.info.decoderConfig)return null;let t=e.info.decoderConfig;if(!t.colorSpace)throw new Error("'colorSpace' is required in the decoder config for VP9.");let a=t.codec.split("."),o=Number(a[1]),r=Number(a[2]),s=(Number(a[3])<<4)+(0<<1)+Number(t.colorSpace.fullRange);return Ce("vpcC",1,0,[De(o),De(r),De(s),De(2),De(2),De(2),ge(0)])},Rp=()=>{let a=(1<<7)+1;return Me("av1C",[a,0,0,0])},Pp=(e,t)=>Me(e,[Array(6).fill(0),ge(1),ge(0),ge(0),z(0),ge(t.info.numberOfChannels),ge(16),ge(0),ge(0),pt(t.info.sampleRate)],[Xp[t.info.codec](t)]),kp=e=>{let t=new Uint8Array(e.info.decoderConfig.description);return Ce("esds",0,0,[z(58753152),De(32+t.byteLength),ge(1),De(0),z(75530368),De(18+t.byteLength),De(64),De(21),Fs(0),z(130071),z(130071),z(92307584),De(t.byteLength),...t,z(109084800),De(1),De(2)])},Tp=e=>{let t=3840,a=0,o=e.info.decoderConfig?.description;if(o){if(o.byteLength<18)throw new TypeError("Invalid decoder description provided for Opus; must be at least 18 bytes long.");let r=ArrayBuffer.isView(o)?new DataView(o.buffer,o.byteOffset,o.byteLength):new DataView(o);t=r.getUint16(10,!0),a=r.getInt16(14,!0)}return Me("dOps",[De(0),De(e.info.numberOfChannels),ge(t),z(e.info.sampleRate),Ln(a),De(0)])},Mp=e=>Ce("stts",0,0,[z(e.timeToSampleTable.length),e.timeToSampleTable.map(t=>[z(t.sampleCount),z(t.sampleDelta)])]),Ap=e=>{if(e.samples.every(a=>a.type==="key"))return null;let t=[...e.samples.entries()].filter(([,a])=>a.type==="key");return Ce("stss",0,0,[z(t.length),t.map(([a])=>z(a+1))])},Dp=e=>Ce("stsc",0,0,[z(e.compactlyCodedChunkTable.length),e.compactlyCodedChunkTable.map(t=>[z(t.firstChunk),z(t.samplesPerChunk),z(1)])]),Ep=e=>Ce("stsz",0,0,[z(0),z(e.samples.length),e.samples.map(t=>z(t.size))]),Op=e=>e.finalizedChunks.length>0&&Ko(e.finalizedChunks).offset>=2**32?Ce("co64",0,0,[z(e.finalizedChunks.length),e.finalizedChunks.map(t=>aa(t.offset))]):Ce("stco",0,0,[z(e.finalizedChunks.length),e.finalizedChunks.map(t=>z(t.offset))]),Bp=e=>Ce("ctts",0,0,[z(e.compositionTimeOffsetTable.length),e.compositionTimeOffsetTable.map(t=>[z(t.sampleCount),z(t.sampleCompositionTimeOffset)])]),Fp=e=>Me("mvex",null,e.map(Np)),Np=e=>Ce("trex",0,0,[z(e.id),z(1),z(0),z(0),z(0)]),Bs=(e,t)=>Me("moof",null,[Hp(e),...t.map(zp)]),Hp=e=>Ce("mfhd",0,0,[z(e)]),_s=e=>{let t=0,a=0,o=0,r=0,n=e.type==="delta";return a|=+n,n?t|=1:t|=2,t<<24|a<<16|o<<8|r},zp=e=>Me("traf",null,[_p(e),Vp(e),Up(e)]),_p=e=>{let t=0;t|=8,t|=16,t|=32,t|=131072;let a=e.currentChunk.samples[1]??e.currentChunk.samples[0],o={duration:a.timescaleUnitsToNextSample,size:a.size,flags:_s(a)};return Ce("tfhd",0,t,[z(e.id),z(o.duration),z(o.size),z(o.flags)])},Vp=e=>Ce("tfdt",1,0,[aa(ht(e.currentChunk.startTimestamp,e.timescale))]),Up=e=>{let t=e.currentChunk.samples.map(m=>m.timescaleUnitsToNextSample),a=e.currentChunk.samples.map(m=>m.size),o=e.currentChunk.samples.map(_s),r=e.currentChunk.samples.map(m=>ht(m.presentationTimestamp-m.decodeTimestamp,e.timescale)),n=new Set(t),i=new Set(a),s=new Set(o),l=new Set(r),u=s.size===2&&o[0]!==o[1],c=n.size>1,f=i.size>1,p=!u&&s.size>1,g=l.size>1||[...l].some(m=>m!==0),v=0;return v|=1,v|=4*+u,v|=256*+c,v|=512*+f,v|=1024*+p,v|=2048*+g,Ce("trun",1,v,[z(e.currentChunk.samples.length),z(e.currentChunk.offset-e.currentChunk.moofOffset||0),u?z(o[0]):[],e.currentChunk.samples.map((m,h)=>[c?z(t[h]):[],f?z(a[h]):[],p?z(o[h]):[],g?tp(r[h]):[]])])},qp=e=>Me("mfra",null,[...e.map(jp),Wp()]),jp=(e,t)=>Ce("tfra",1,0,[z(e.id),z(63),z(e.finalizedChunks.length),e.finalizedChunks.map(o=>[aa(ht(o.startTimestamp,e.timescale)),aa(o.moofOffset),z(t+1),z(1),z(1)])]),Wp=()=>Ce("mfro",0,0,[z(0)]),Gp={avc:"avc1",hevc:"hvc1",vp9:"vp09",av1:"av01"},Kp={avc:Lp,hevc:Sp,vp9:Ip,av1:Rp},$p={aac:"mp4a",opus:"Opus"},Xp={aac:kp,opus:Tp};var Qo=class{},In=class extends Qo{constructor(){super(...arguments),this.buffer=null}},Vs=class extends Qo{constructor(e){if(super(),this.options=e,typeof e!="object")throw new TypeError("StreamTarget requires an options object to be passed to its constructor.");if(e.onData){if(typeof e.onData!="function")throw new TypeError("options.onData, when provided, must be a function.");if(e.onData.length<2)throw new TypeError("options.onData, when provided, must be a function that takes in at least two arguments (data and position). Ignoring the position argument, which specifies the byte offset at which the data is to be written, can lead to broken outputs.")}if(e.chunked!==void 0&&typeof e.chunked!="boolean")throw new TypeError("options.chunked, when provided, must be a boolean.");if(e.chunkSize!==void 0&&(!Number.isInteger(e.chunkSize)||e.chunkSize<1024))throw new TypeError("options.chunkSize, when provided, must be an integer and not smaller than 1024.")}},Jp=class extends Qo{constructor(e,t){if(super(),this.stream=e,this.options=t,!(e instanceof FileSystemWritableFileStream))throw new TypeError("FileSystemWritableFileStreamTarget requires a FileSystemWritableFileStream instance.");if(t!==void 0&&typeof t!="object")throw new TypeError("FileSystemWritableFileStreamTarget's options, when provided, must be an object.");if(t&&t.chunkSize!==void 0&&(!Number.isInteger(t.chunkSize)||t.chunkSize<=0))throw new TypeError("options.chunkSize, when provided, must be a positive integer")}},Yt,ka,Us=class{constructor(){this.pos=0,ie(this,Yt,new Uint8Array(8)),ie(this,ka,new DataView(x(this,Yt).buffer)),this.offsets=new WeakMap}seek(e){this.pos=e}writeU32(e){x(this,ka).setUint32(0,e,!1),this.write(x(this,Yt).subarray(0,4))}writeU64(e){x(this,ka).setUint32(0,Math.floor(e/2**32),!1),x(this,ka).setUint32(4,e,!1),this.write(x(this,Yt).subarray(0,8))}writeAscii(e){for(let t=0;t<e.length;t++)x(this,ka).setUint8(t%8,e.charCodeAt(t)),t%8===7&&this.write(x(this,Yt));e.length%8!==0&&this.write(x(this,Yt).subarray(0,e.length%8))}writeBox(e){if(this.offsets.set(e,this.pos),e.contents&&!e.children)this.writeBoxHeader(e,e.size??e.contents.byteLength+8),this.write(e.contents);else{let t=this.pos;if(this.writeBoxHeader(e,0),e.contents&&this.write(e.contents),e.children)for(let r of e.children)r&&this.writeBox(r);let a=this.pos,o=e.size??a-t;this.seek(t),this.writeBoxHeader(e,o),this.seek(a)}}writeBoxHeader(e,t){this.writeU32(e.largeSize?1:t),this.writeAscii(e.type),e.largeSize&&this.writeU64(t)}measureBoxHeader(e){return 8+(e.largeSize?8:0)}patchBox(e){let t=this.pos;this.seek(this.offsets.get(e)),this.writeBox(e),this.seek(t)}measureBox(e){if(e.contents&&!e.children)return this.measureBoxHeader(e)+e.contents.byteLength;{let t=this.measureBoxHeader(e);if(e.contents&&(t+=e.contents.byteLength),e.children)for(let a of e.children)a&&(t+=this.measureBox(a));return t}}};Yt=new WeakMap;ka=new WeakMap;var qo,ta,fo,ro,jo,pn,Yp=class extends Us{constructor(e){super(),ie(this,jo),ie(this,qo,void 0),ie(this,ta,new ArrayBuffer(2**16)),ie(this,fo,new Uint8Array(x(this,ta))),ie(this,ro,0),Be(this,qo,e)}write(e){ue(this,jo,pn).call(this,this.pos+e.byteLength),x(this,fo).set(e,this.pos),this.pos+=e.byteLength,Be(this,ro,Math.max(x(this,ro),this.pos))}finalize(){ue(this,jo,pn).call(this,this.pos),x(this,qo).buffer=x(this,ta).slice(0,Math.max(x(this,ro),this.pos))}};qo=new WeakMap;ta=new WeakMap;fo=new WeakMap;ro=new WeakMap;jo=new WeakSet;pn=function(e){let t=x(this,ta).byteLength;for(;t<e;)t*=2;if(t===x(this,ta).byteLength)return;let a=new ArrayBuffer(t),o=new Uint8Array(a);o.set(x(this,fo),0),Be(this,ta,a),Be(this,fo,o)};var Zp=2**24,Qp=2,so,Zt,no,At,Qe,$o,hn,Rn,qs,Pn,js,lo,Xo,kn=class extends Us{constructor(e){super(),ie(this,$o),ie(this,Rn),ie(this,Pn),ie(this,lo),ie(this,so,void 0),ie(this,Zt,[]),ie(this,no,void 0),ie(this,At,void 0),ie(this,Qe,[]),Be(this,so,e),Be(this,no,e.options?.chunked??!1),Be(this,At,e.options?.chunkSize??Zp)}write(e){x(this,Zt).push({data:e.slice(),start:this.pos}),this.pos+=e.byteLength}flush(){if(x(this,Zt).length===0)return;let e=[],t=[...x(this,Zt)].sort((a,o)=>a.start-o.start);e.push({start:t[0].start,size:t[0].data.byteLength});for(let a=1;a<t.length;a++){let o=e[e.length-1],r=t[a];r.start<=o.start+o.size?o.size=Math.max(o.size,r.start+r.data.byteLength-o.start):e.push({start:r.start,size:r.data.byteLength})}for(let a of e){a.data=new Uint8Array(a.size);for(let o of x(this,Zt))a.start<=o.start&&o.start<a.start+a.size&&a.data.set(o.data,o.start-a.start);x(this,no)?(ue(this,$o,hn).call(this,a.data,a.start),ue(this,lo,Xo).call(this)):x(this,so).options.onData?.(a.data,a.start)}x(this,Zt).length=0}finalize(){x(this,no)&&ue(this,lo,Xo).call(this,!0)}};so=new WeakMap;Zt=new WeakMap;no=new WeakMap;At=new WeakMap;Qe=new WeakMap;$o=new WeakSet;hn=function(e,t){let a=x(this,Qe).findIndex(s=>s.start<=t&&t<s.start+x(this,At));a===-1&&(a=ue(this,Pn,js).call(this,t));let o=x(this,Qe)[a],r=t-o.start,n=e.subarray(0,Math.min(x(this,At)-r,e.byteLength));o.data.set(n,r);let i={start:r,end:r+n.byteLength};if(ue(this,Rn,qs).call(this,o,i),o.written[0].start===0&&o.written[0].end===x(this,At)&&(o.shouldFlush=!0),x(this,Qe).length>Qp){for(let s=0;s<x(this,Qe).length-1;s++)x(this,Qe)[s].shouldFlush=!0;ue(this,lo,Xo).call(this)}n.byteLength<e.byteLength&&ue(this,$o,hn).call(this,e.subarray(n.byteLength),t+n.byteLength)};Rn=new WeakSet;qs=function(e,t){let a=0,o=e.written.length-1,r=-1;for(;a<=o;){let n=Math.floor(a+(o-a+1)/2);e.written[n].start<=t.start?(a=n+1,r=n):o=n-1}for(e.written.splice(r+1,0,t),(r===-1||e.written[r].end<t.start)&&r++;r<e.written.length-1&&e.written[r].end>=e.written[r+1].start;)e.written[r].end=Math.max(e.written[r].end,e.written[r+1].end),e.written.splice(r+1,1)};Pn=new WeakSet;js=function(e){let a={start:Math.floor(e/x(this,At))*x(this,At),data:new Uint8Array(x(this,At)),written:[],shouldFlush:!1};return x(this,Qe).push(a),x(this,Qe).sort((o,r)=>o.start-r.start),x(this,Qe).indexOf(a)};lo=new WeakSet;Xo=function(e=!1){for(let t=0;t<x(this,Qe).length;t++){let a=x(this,Qe)[t];if(!(!a.shouldFlush&&!e)){for(let o of a.written)x(this,so).options.onData?.(a.data.subarray(o.start,o.end),a.start+o.start);x(this,Qe).splice(t--,1)}}};var eh=class extends kn{constructor(e){super(new Vs({onData:(t,a)=>e.stream.write({type:"write",data:t,position:a}),chunked:!0,chunkSize:e.options?.chunkSize}))}},gn=1e3,th=["avc","hevc","vp9","av1"],ah=["aac","opus"],oh=2082844800,rh=["strict","offset","cross-track-offset"],$,ee,Jo,Ze,Ne,Oe,Ta,Ma,Tn,Qt,ea,uo,xn,Ws,vn,Gs,Mn,Ks,yn,$s,An,Xs,Wo,bn,mt,Mt,Dn,Js,co,Yo,Zo,En,Da,mo,Go,wn,Ys=class{constructor(e){if(ie(this,xn),ie(this,vn),ie(this,Mn),ie(this,yn),ie(this,An),ie(this,Wo),ie(this,mt),ie(this,Dn),ie(this,co),ie(this,Zo),ie(this,Da),ie(this,Go),ie(this,$,void 0),ie(this,ee,void 0),ie(this,Jo,void 0),ie(this,Ze,void 0),ie(this,Ne,null),ie(this,Oe,null),ie(this,Ta,Math.floor(Date.now()/1e3)+oh),ie(this,Ma,[]),ie(this,Tn,1),ie(this,Qt,[]),ie(this,ea,[]),ie(this,uo,!1),ue(this,xn,Ws).call(this,e),e.video=io(e.video),e.audio=io(e.audio),e.fastStart=io(e.fastStart),this.target=e.target,Be(this,$,{firstTimestampBehavior:"strict",...e}),e.target instanceof In)Be(this,ee,new Yp(e.target));else if(e.target instanceof Vs)Be(this,ee,new kn(e.target));else if(e.target instanceof Jp)Be(this,ee,new eh(e.target));else throw new Error(`Invalid target: ${e.target}`);ue(this,yn,$s).call(this),ue(this,vn,Gs).call(this)}addVideoChunk(e,t,a,o){if(!(e instanceof EncodedVideoChunk))throw new TypeError("addVideoChunk's first argument (sample) must be of type EncodedVideoChunk.");if(t&&typeof t!="object")throw new TypeError("addVideoChunk's second argument (meta), when provided, must be an object.");if(a!==void 0&&(!Number.isFinite(a)||a<0))throw new TypeError("addVideoChunk's third argument (timestamp), when provided, must be a non-negative real number.");if(o!==void 0&&!Number.isFinite(o))throw new TypeError("addVideoChunk's fourth argument (compositionTimeOffset), when provided, must be a real number.");let r=new Uint8Array(e.byteLength);e.copyTo(r),this.addVideoChunkRaw(r,e.type,a??e.timestamp,e.duration,t,o)}addVideoChunkRaw(e,t,a,o,r,n){if(!(e instanceof Uint8Array))throw new TypeError("addVideoChunkRaw's first argument (data) must be an instance of Uint8Array.");if(t!=="key"&&t!=="delta")throw new TypeError("addVideoChunkRaw's second argument (type) must be either 'key' or 'delta'.");if(!Number.isFinite(a)||a<0)throw new TypeError("addVideoChunkRaw's third argument (timestamp) must be a non-negative real number.");if(!Number.isFinite(o)||o<0)throw new TypeError("addVideoChunkRaw's fourth argument (duration) must be a non-negative real number.");if(r&&typeof r!="object")throw new TypeError("addVideoChunkRaw's fifth argument (meta), when provided, must be an object.");if(n!==void 0&&!Number.isFinite(n))throw new TypeError("addVideoChunkRaw's sixth argument (compositionTimeOffset), when provided, must be a real number.");if(ue(this,Go,wn).call(this),!x(this,$).video)throw new Error("No video track declared.");if(typeof x(this,$).fastStart=="object"&&x(this,Ne).samples.length===x(this,$).fastStart.expectedVideoChunks)throw new Error(`Cannot add more video chunks than specified in 'fastStart' (${x(this,$).fastStart.expectedVideoChunks}).`);let i=ue(this,Wo,bn).call(this,x(this,Ne),e,t,a,o,r,n);if(x(this,$).fastStart==="fragmented"&&x(this,Oe)){for(;x(this,ea).length>0&&x(this,ea)[0].decodeTimestamp<=i.decodeTimestamp;){let s=x(this,ea).shift();ue(this,mt,Mt).call(this,x(this,Oe),s)}i.decodeTimestamp<=x(this,Oe).lastDecodeTimestamp?ue(this,mt,Mt).call(this,x(this,Ne),i):x(this,Qt).push(i)}else ue(this,mt,Mt).call(this,x(this,Ne),i)}addAudioChunk(e,t,a){if(!(e instanceof EncodedAudioChunk))throw new TypeError("addAudioChunk's first argument (sample) must be of type EncodedAudioChunk.");if(t&&typeof t!="object")throw new TypeError("addAudioChunk's second argument (meta), when provided, must be an object.");if(a!==void 0&&(!Number.isFinite(a)||a<0))throw new TypeError("addAudioChunk's third argument (timestamp), when provided, must be a non-negative real number.");let o=new Uint8Array(e.byteLength);e.copyTo(o),this.addAudioChunkRaw(o,e.type,a??e.timestamp,e.duration,t)}addAudioChunkRaw(e,t,a,o,r){if(!(e instanceof Uint8Array))throw new TypeError("addAudioChunkRaw's first argument (data) must be an instance of Uint8Array.");if(t!=="key"&&t!=="delta")throw new TypeError("addAudioChunkRaw's second argument (type) must be either 'key' or 'delta'.");if(!Number.isFinite(a)||a<0)throw new TypeError("addAudioChunkRaw's third argument (timestamp) must be a non-negative real number.");if(!Number.isFinite(o)||o<0)throw new TypeError("addAudioChunkRaw's fourth argument (duration) must be a non-negative real number.");if(r&&typeof r!="object")throw new TypeError("addAudioChunkRaw's fifth argument (meta), when provided, must be an object.");if(ue(this,Go,wn).call(this),!x(this,$).audio)throw new Error("No audio track declared.");if(typeof x(this,$).fastStart=="object"&&x(this,Oe).samples.length===x(this,$).fastStart.expectedAudioChunks)throw new Error(`Cannot add more audio chunks than specified in 'fastStart' (${x(this,$).fastStart.expectedAudioChunks}).`);let n=ue(this,Wo,bn).call(this,x(this,Oe),e,t,a,o,r);if(x(this,$).fastStart==="fragmented"&&x(this,Ne)){for(;x(this,Qt).length>0&&x(this,Qt)[0].decodeTimestamp<=n.decodeTimestamp;){let i=x(this,Qt).shift();ue(this,mt,Mt).call(this,x(this,Ne),i)}n.decodeTimestamp<=x(this,Ne).lastDecodeTimestamp?ue(this,mt,Mt).call(this,x(this,Oe),n):x(this,ea).push(n)}else ue(this,mt,Mt).call(this,x(this,Oe),n)}finalize(){if(x(this,uo))throw new Error("Cannot finalize a muxer more than once.");if(x(this,$).fastStart==="fragmented"){for(let t of x(this,Qt))ue(this,mt,Mt).call(this,x(this,Ne),t);for(let t of x(this,ea))ue(this,mt,Mt).call(this,x(this,Oe),t);ue(this,Zo,En).call(this,!1)}else x(this,Ne)&&ue(this,co,Yo).call(this,x(this,Ne)),x(this,Oe)&&ue(this,co,Yo).call(this,x(this,Oe));let e=[x(this,Ne),x(this,Oe)].filter(Boolean);if(x(this,$).fastStart==="in-memory"){let t;for(let o=0;o<2;o++){let r=Uo(e,x(this,Ta)),n=x(this,ee).measureBox(r);t=x(this,ee).measureBox(x(this,Ze));let i=x(this,ee).pos+n+t;for(let s of x(this,Ma)){s.offset=i;for(let{data:l}of s.samples)i+=l.byteLength,t+=l.byteLength}if(i<2**32)break;t>=2**32&&(x(this,Ze).largeSize=!0)}let a=Uo(e,x(this,Ta));x(this,ee).writeBox(a),x(this,Ze).size=t,x(this,ee).writeBox(x(this,Ze));for(let o of x(this,Ma))for(let r of o.samples)x(this,ee).write(r.data),r.data=null}else if(x(this,$).fastStart==="fragmented"){let t=x(this,ee).pos,a=qp(e);x(this,ee).writeBox(a);let o=x(this,ee).pos-t;x(this,ee).seek(x(this,ee).pos-4),x(this,ee).writeU32(o)}else{let t=x(this,ee).offsets.get(x(this,Ze)),a=x(this,ee).pos-t;x(this,Ze).size=a,x(this,Ze).largeSize=a>=2**32,x(this,ee).patchBox(x(this,Ze));let o=Uo(e,x(this,Ta));if(typeof x(this,$).fastStart=="object"){x(this,ee).seek(x(this,Jo)),x(this,ee).writeBox(o);let r=t-x(this,ee).pos;x(this,ee).writeBox(op(r))}else x(this,ee).writeBox(o)}ue(this,Da,mo).call(this),x(this,ee).finalize(),Be(this,uo,!0)}};$=new WeakMap;ee=new WeakMap;Jo=new WeakMap;Ze=new WeakMap;Ne=new WeakMap;Oe=new WeakMap;Ta=new WeakMap;Ma=new WeakMap;Tn=new WeakMap;Qt=new WeakMap;ea=new WeakMap;uo=new WeakMap;xn=new WeakSet;Ws=function(e){if(typeof e!="object")throw new TypeError("The muxer requires an options object to be passed to its constructor.");if(!(e.target instanceof Qo))throw new TypeError("The target must be provided and an instance of Target.");if(e.video){if(!th.includes(e.video.codec))throw new TypeError(`Unsupported video codec: ${e.video.codec}`);if(!Number.isInteger(e.video.width)||e.video.width<=0)throw new TypeError(`Invalid video width: ${e.video.width}. Must be a positive integer.`);if(!Number.isInteger(e.video.height)||e.video.height<=0)throw new TypeError(`Invalid video height: ${e.video.height}. Must be a positive integer.`);let t=e.video.rotation;if(typeof t=="number"&&![0,90,180,270].includes(t))throw new TypeError(`Invalid video rotation: ${t}. Has to be 0, 90, 180 or 270.`);if(Array.isArray(t)&&(t.length!==9||t.some(a=>typeof a!="number")))throw new TypeError(`Invalid video transformation matrix: ${t.join()}`);if(e.video.frameRate!==void 0&&(!Number.isInteger(e.video.frameRate)||e.video.frameRate<=0))throw new TypeError(`Invalid video frame rate: ${e.video.frameRate}. Must be a positive integer.`)}if(e.audio){if(!ah.includes(e.audio.codec))throw new TypeError(`Unsupported audio codec: ${e.audio.codec}`);if(!Number.isInteger(e.audio.numberOfChannels)||e.audio.numberOfChannels<=0)throw new TypeError(`Invalid number of audio channels: ${e.audio.numberOfChannels}. Must be a positive integer.`);if(!Number.isInteger(e.audio.sampleRate)||e.audio.sampleRate<=0)throw new TypeError(`Invalid audio sample rate: ${e.audio.sampleRate}. Must be a positive integer.`)}if(e.firstTimestampBehavior&&!rh.includes(e.firstTimestampBehavior))throw new TypeError(`Invalid first timestamp behavior: ${e.firstTimestampBehavior}`);if(typeof e.fastStart=="object"){if(e.video){if(e.fastStart.expectedVideoChunks===void 0)throw new TypeError("'fastStart' is an object but is missing property 'expectedVideoChunks'.");if(!Number.isInteger(e.fastStart.expectedVideoChunks)||e.fastStart.expectedVideoChunks<0)throw new TypeError("'expectedVideoChunks' must be a non-negative integer.")}if(e.audio){if(e.fastStart.expectedAudioChunks===void 0)throw new TypeError("'fastStart' is an object but is missing property 'expectedAudioChunks'.");if(!Number.isInteger(e.fastStart.expectedAudioChunks)||e.fastStart.expectedAudioChunks<0)throw new TypeError("'expectedAudioChunks' must be a non-negative integer.")}}else if(![!1,"in-memory","fragmented"].includes(e.fastStart))throw new TypeError("'fastStart' option must be false, 'in-memory', 'fragmented' or an object.");if(e.minFragmentDuration!==void 0&&(!Number.isFinite(e.minFragmentDuration)||e.minFragmentDuration<0))throw new TypeError("'minFragmentDuration' must be a non-negative number.")};vn=new WeakSet;Gs=function(){if(x(this,ee).writeBox(ap({holdsAvc:x(this,$).video?.codec==="avc",fragmented:x(this,$).fastStart==="fragmented"})),Be(this,Jo,x(this,ee).pos),x(this,$).fastStart==="in-memory")Be(this,Ze,mn(!1));else if(x(this,$).fastStart!=="fragmented"){if(typeof x(this,$).fastStart=="object"){let e=ue(this,Mn,Ks).call(this);x(this,ee).seek(x(this,ee).pos+e)}Be(this,Ze,mn(!0)),x(this,ee).writeBox(x(this,Ze))}ue(this,Da,mo).call(this)};Mn=new WeakSet;Ks=function(){if(typeof x(this,$).fastStart!="object")return;let e=0,t=[x(this,$).fastStart.expectedVideoChunks,x(this,$).fastStart.expectedAudioChunks];for(let a of t)a&&(e+=8*Math.ceil(2/3*a),e+=4*a,e+=12*Math.ceil(2/3*a),e+=4*a,e+=8*a);return e+=4096,e};yn=new WeakSet;$s=function(){if(x(this,$).video&&Be(this,Ne,{id:1,info:{type:"video",codec:x(this,$).video.codec,width:x(this,$).video.width,height:x(this,$).video.height,rotation:x(this,$).video.rotation??0,decoderConfig:null},timescale:x(this,$).video.frameRate??57600,samples:[],finalizedChunks:[],currentChunk:null,firstDecodeTimestamp:void 0,lastDecodeTimestamp:-1,timeToSampleTable:[],compositionTimeOffsetTable:[],lastTimescaleUnits:null,lastSample:null,compactlyCodedChunkTable:[]}),x(this,$).audio&&(Be(this,Oe,{id:x(this,$).video?2:1,info:{type:"audio",codec:x(this,$).audio.codec,numberOfChannels:x(this,$).audio.numberOfChannels,sampleRate:x(this,$).audio.sampleRate,decoderConfig:null},timescale:x(this,$).audio.sampleRate,samples:[],finalizedChunks:[],currentChunk:null,firstDecodeTimestamp:void 0,lastDecodeTimestamp:-1,timeToSampleTable:[],compositionTimeOffsetTable:[],lastTimescaleUnits:null,lastSample:null,compactlyCodedChunkTable:[]}),x(this,$).audio.codec==="aac")){let e=ue(this,An,Xs).call(this,2,x(this,$).audio.sampleRate,x(this,$).audio.numberOfChannels);x(this,Oe).info.decoderConfig={codec:x(this,$).audio.codec,description:e,numberOfChannels:x(this,$).audio.numberOfChannels,sampleRate:x(this,$).audio.sampleRate}}};An=new WeakSet;Xs=function(e,t,a){let r=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350].indexOf(t),n=a,i="";i+=e.toString(2).padStart(5,"0"),i+=r.toString(2).padStart(4,"0"),r===15&&(i+=t.toString(2).padStart(24,"0")),i+=n.toString(2).padStart(4,"0");let s=Math.ceil(i.length/8)*8;i=i.padEnd(s,"0");let l=new Uint8Array(i.length/8);for(let u=0;u<i.length;u+=8)l[u/8]=parseInt(i.slice(u,u+8),2);return l};Wo=new WeakSet;bn=function(e,t,a,o,r,n,i){let s=o/1e6,l=(o-(i??0))/1e6,u=r/1e6,c=ue(this,Dn,Js).call(this,s,l,e);return s=c.presentationTimestamp,l=c.decodeTimestamp,n?.decoderConfig&&(e.info.decoderConfig===null?e.info.decoderConfig=n.decoderConfig:Object.assign(e.info.decoderConfig,n.decoderConfig)),{presentationTimestamp:s,decodeTimestamp:l,duration:u,data:t,size:t.byteLength,type:a,timescaleUnitsToNextSample:ht(u,e.timescale)}};mt=new WeakSet;Mt=function(e,t){x(this,$).fastStart!=="fragmented"&&e.samples.push(t);let a=ht(t.presentationTimestamp-t.decodeTimestamp,e.timescale);if(e.lastTimescaleUnits!==null){let r=ht(t.decodeTimestamp,e.timescale,!1),n=Math.round(r-e.lastTimescaleUnits);if(e.lastTimescaleUnits+=n,e.lastSample.timescaleUnitsToNextSample=n,x(this,$).fastStart!=="fragmented"){let i=Ko(e.timeToSampleTable);i.sampleCount===1?(i.sampleDelta=n,i.sampleCount++):i.sampleDelta===n?i.sampleCount++:(i.sampleCount--,e.timeToSampleTable.push({sampleCount:2,sampleDelta:n}));let s=Ko(e.compositionTimeOffsetTable);s.sampleCompositionTimeOffset===a?s.sampleCount++:e.compositionTimeOffsetTable.push({sampleCount:1,sampleCompositionTimeOffset:a})}}else e.lastTimescaleUnits=0,x(this,$).fastStart!=="fragmented"&&(e.timeToSampleTable.push({sampleCount:1,sampleDelta:ht(t.duration,e.timescale)}),e.compositionTimeOffsetTable.push({sampleCount:1,sampleCompositionTimeOffset:a}));e.lastSample=t;let o=!1;if(!e.currentChunk)o=!0;else{let r=t.presentationTimestamp-e.currentChunk.startTimestamp;if(x(this,$).fastStart==="fragmented"){let n=x(this,Ne)??x(this,Oe),i=x(this,$).minFragmentDuration??1;e===n&&t.type==="key"&&r>=i&&(o=!0,ue(this,Zo,En).call(this))}else o=r>=.5}o&&(e.currentChunk&&ue(this,co,Yo).call(this,e),e.currentChunk={startTimestamp:t.presentationTimestamp,samples:[]}),e.currentChunk.samples.push(t)};Dn=new WeakSet;Js=function(e,t,a){let o=x(this,$).firstTimestampBehavior==="strict",r=a.lastDecodeTimestamp===-1;if(o&&r&&t!==0)throw new Error(`The first chunk for your media track must have a timestamp of 0 (received DTS=${t}).Non-zero first timestamps are often caused by directly piping frames or audio data from a MediaStreamTrack into the encoder. Their timestamps are typically relative to the age of thedocument, which is probably what you want.
|
|
36
|
+
body[`).concat(Qa,`] {
|
|
37
|
+
`).concat(oi,": ").concat(s,`px;
|
|
38
|
+
}
|
|
39
|
+
`)},id=function(){var e=parseInt(document.body.getAttribute(Qa)||"0",10);return isFinite(e)?e:0},ov=function(){H(function(){return document.body.setAttribute(Qa,(id()+1).toString()),function(){var e=id()-1;e<=0?document.body.removeAttribute(Qa):document.body.setAttribute(Qa,e.toString())}},[])},fi=function(e){var t=e.noRelative,a=e.noImportant,o=e.gapMode,r=o===void 0?"margin":o;ov();var n=me(function(){return ci(r)},[r]);return Te(tv,{styles:av(n,!t,r,a?"":"!important")})};var pi=!1;if(typeof window<"u")try{_o=Object.defineProperty({},"passive",{get:function(){return pi=!0,!0}}),window.addEventListener("test",_o,_o),window.removeEventListener("test",_o,_o)}catch{pi=!1}var _o,ma=pi?{passive:!1}:!1;var rv=function(e){return e.tagName==="TEXTAREA"},sd=function(e,t){if(!(e instanceof Element))return!1;var a=window.getComputedStyle(e);return a[t]!=="hidden"&&!(a.overflowY===a.overflowX&&!rv(e)&&a[t]==="visible")},nv=function(e){return sd(e,"overflowY")},iv=function(e){return sd(e,"overflowX")},mi=function(e,t){var a=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var r=ld(e,o);if(r){var n=dd(e,o),i=n[1],s=n[2];if(i>s)return!0}o=o.parentNode}while(o&&o!==a.body);return!1},sv=function(e){var t=e.scrollTop,a=e.scrollHeight,o=e.clientHeight;return[t,a,o]},lv=function(e){var t=e.scrollLeft,a=e.scrollWidth,o=e.clientWidth;return[t,a,o]},ld=function(e,t){return e==="v"?nv(t):iv(t)},dd=function(e,t){return e==="v"?sv(t):lv(t)},dv=function(e,t){return e==="h"&&t==="rtl"?-1:1},ud=function(e,t,a,o,r){var n=dv(e,window.getComputedStyle(t).direction),i=n*o,s=a.target,l=t.contains(s),d=!1,u=i>0,c=0,m=0;do{if(!s)break;var h=dd(e,s),x=h[0],p=h[1],g=h[2],v=p-g-n*x;(x||v)&&ld(e,s)&&(c+=v,m+=x);var w=s.parentNode;s=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(u&&(r&&Math.abs(c)<1||!r&&i>c)||!u&&(r&&Math.abs(m)<1||!r&&-i>m))&&(d=!0),d};var Er=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},cd=function(e){return[e.deltaX,e.deltaY]},fd=function(e){return e&&"current"in e?e.current:e},uv=function(e,t){return e[0]===t[0]&&e[1]===t[1]},cv=function(e){return`
|
|
40
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
41
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
42
|
+
`)},fv=0,eo=[];function pd(e){var t=z([]),a=z([0,0]),o=z(),r=M(fv++)[0],n=M(Ho)[0],i=z(e);H(function(){i.current=e},[e]),H(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var p=ed([e.lockRef.current],(e.shards||[]).map(fd),!0).filter(Boolean);return p.forEach(function(g){return g.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),p.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var s=Q(function(p,g){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!i.current.allowPinchZoom;var v=Er(p),w=a.current,b="deltaX"in p?p.deltaX:w[0]-v[0],C="deltaY"in p?p.deltaY:w[1]-v[1],S,R=p.target,T=Math.abs(b)>Math.abs(C)?"h":"v";if("touches"in p&&T==="h"&&R.type==="range")return!1;var I=window.getSelection(),F=I&&I.anchorNode,X=F?F===R||F.contains(R):!1;if(X)return!1;var D=mi(T,R);if(!D)return!0;if(D?S=T:(S=T==="v"?"h":"v",D=mi(T,R)),!D)return!1;if(!o.current&&"changedTouches"in p&&(b||C)&&(o.current=S),!S)return!0;var O=o.current||S;return ud(O,g,p,O==="h"?b:C,!0)},[]),l=Q(function(p){var g=p;if(!(!eo.length||eo[eo.length-1]!==n)){var v="deltaY"in g?cd(g):Er(g),w=t.current.filter(function(S){return S.name===g.type&&(S.target===g.target||g.target===S.shadowParent)&&uv(S.delta,v)})[0];if(w&&w.should){g.cancelable&&g.preventDefault();return}if(!w){var b=(i.current.shards||[]).map(fd).filter(Boolean).filter(function(S){return S.contains(g.target)}),C=b.length>0?s(g,b[0]):!i.current.noIsolation;C&&g.cancelable&&g.preventDefault()}}},[]),d=Q(function(p,g,v,w){var b={name:p,delta:g,target:v,should:w,shadowParent:pv(v)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(C){return C!==b})},1)},[]),u=Q(function(p){a.current=Er(p),o.current=void 0},[]),c=Q(function(p){d(p.type,cd(p),p.target,s(p,e.lockRef.current))},[]),m=Q(function(p){d(p.type,Er(p),p.target,s(p,e.lockRef.current))},[]);H(function(){return eo.push(n),e.setCallbacks({onScrollCapture:c,onWheelCapture:c,onTouchMoveCapture:m}),document.addEventListener("wheel",l,ma),document.addEventListener("touchmove",l,ma),document.addEventListener("touchstart",u,ma),function(){eo=eo.filter(function(p){return p!==n}),document.removeEventListener("wheel",l,ma),document.removeEventListener("touchmove",l,ma),document.removeEventListener("touchstart",u,ma)}},[]);var h=e.removeScrollBar,x=e.inert;return Te(nt,null,x?Te(n,{styles:cv(r)}):null,h?Te(fi,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function pv(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var md=ii(zr,pd);var gd=V(function(e,t){return Te(Bo,tt({},e,{ref:t,sideCar:md}))});gd.classNames=Bo.classNames;var Vo=gd;var mv=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},to=new WeakMap,Or=new WeakMap,Nr={},gi=0,hd=function(e){return e&&(e.host||hd(e.parentNode))},gv=function(e,t){return t.map(function(a){if(e.contains(a))return a;var o=hd(a);return o&&e.contains(o)?o:(console.error("aria-hidden",a,"in not contained inside",e,". Doing nothing"),null)}).filter(function(a){return!!a})},hv=function(e,t,a,o){var r=gv(t,Array.isArray(e)?e:[e]);Nr[a]||(Nr[a]=new WeakMap);var n=Nr[a],i=[],s=new Set,l=new Set(r),d=function(c){!c||s.has(c)||(s.add(c),d(c.parentNode))};r.forEach(d);var u=function(c){!c||l.has(c)||Array.prototype.forEach.call(c.children,function(m){if(s.has(m))u(m);else try{var h=m.getAttribute(o),x=h!==null&&h!=="false",p=(to.get(m)||0)+1,g=(n.get(m)||0)+1;to.set(m,p),n.set(m,g),i.push(m),p===1&&x&&Or.set(m,!0),g===1&&m.setAttribute(a,"true"),x||m.setAttribute(o,"true")}catch(v){console.error("aria-hidden: cannot operate on ",m,v)}})};return u(t),s.clear(),gi++,function(){i.forEach(function(c){var m=to.get(c)-1,h=n.get(c)-1;to.set(c,m),n.set(c,h),m||(Or.has(c)||c.removeAttribute(o),Or.delete(c)),h||c.removeAttribute(a)}),gi--,gi||(to=new WeakMap,to=new WeakMap,Or=new WeakMap,Nr={})}},Fr=function(e,t,a){a===void 0&&(a="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=t||mv(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),hv(o,r,a,"aria-hidden")):function(){return null}};var Hr="Dialog",[vd,vv]=et(Hr),[xv,ht]=vd(Hr),xd=e=>{let{__scopeDialog:t,children:a,open:o,defaultOpen:r,onOpenChange:n,modal:i=!0}=e,s=z(null),l=z(null),[d,u]=gt({prop:o,defaultProp:r??!1,onChange:n,caller:Hr});return L(xv,{scope:t,triggerRef:s,contentRef:l,contentId:dt(),titleId:dt(),descriptionId:dt(),open:d,onOpenChange:u,onOpenToggle:Q(()=>u(c=>!c),[u]),modal:i,children:a})};xd.displayName=Hr;var bd="DialogTrigger",wd=V((e,t)=>{let{__scopeDialog:a,...o}=e,r=ht(bd,a),n=ge(t,r.triggerRef);return L(oe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.open?r.contentId:void 0,"data-state":vi(r.open),...o,ref:n,onClick:se(e.onClick,r.onOpenToggle)})});wd.displayName=bd;var hi="DialogPortal",[bv,yd]=vd(hi,{forceMount:void 0}),Cd=e=>{let{__scopeDialog:t,forceMount:a,children:o,container:r}=e,n=ht(hi,t);return L(bv,{scope:t,forceMount:a,children:St.map(o,i=>L(Vt,{present:a||n.open,children:L(Fo,{asChild:!0,container:r,children:i})}))})};Cd.displayName=hi;var Br="DialogOverlay",Sd=V((e,t)=>{let a=yd(Br,e.__scopeDialog),{forceMount:o=a.forceMount,...r}=e,n=ht(Br,e.__scopeDialog);return n.modal?L(Vt,{present:o||n.open,children:L(yv,{...r,ref:t})}):null});Sd.displayName=Br;var wv=mt("DialogOverlay.RemoveScroll"),yv=V((e,t)=>{let{__scopeDialog:a,...o}=e,r=ht(Br,a),n=Gl(),i=ge(t,n);return L(Vo,{as:wv,allowPinchZoom:!0,shards:[r.contentRef],children:L(oe.div,{"data-state":vi(r.open),...o,ref:i,style:{pointerEvents:"auto",...o.style}})})}),ao="DialogContent",Ld=V((e,t)=>{let a=yd(ao,e.__scopeDialog),{forceMount:o=a.forceMount,...r}=e,n=ht(ao,e.__scopeDialog);return L(Vt,{present:o||n.open,children:n.modal?L(Cv,{...r,ref:t}):L(Sv,{...r,ref:t})})});Ld.displayName=ao;var Cv=V((e,t)=>{let a=ht(ao,e.__scopeDialog),o=z(null),r=ge(t,a.contentRef,o);return H(()=>{let n=o.current;if(n)return Fr(n)},[]),L(Id,{...e,ref:r,trapFocus:a.open,disableOutsidePointerEvents:a.open,onCloseAutoFocus:se(e.onCloseAutoFocus,n=>{n.preventDefault(),a.triggerRef.current?.focus()}),onPointerDownOutside:se(e.onPointerDownOutside,n=>{let i=n.detail.originalEvent,s=i.button===0&&i.ctrlKey===!0;(i.button===2||s)&&n.preventDefault()}),onFocusOutside:se(e.onFocusOutside,n=>n.preventDefault())})}),Sv=V((e,t)=>{let a=ht(ao,e.__scopeDialog),o=z(!1),r=z(!1);return L(Id,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:n=>{e.onCloseAutoFocus?.(n),n.defaultPrevented||(o.current||a.triggerRef.current?.focus(),n.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:n=>{e.onInteractOutside?.(n),n.defaultPrevented||(o.current=!0,n.detail.originalEvent.type==="pointerdown"&&(r.current=!0));let i=n.target;a.triggerRef.current?.contains(i)&&n.preventDefault(),n.detail.originalEvent.type==="focusin"&&r.current&&n.preventDefault()}})}),Id=V((e,t)=>{let{__scopeDialog:a,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:n,...i}=e,s=ht(ao,a);return Mr(),L(Yt,{children:L(No,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:n,children:L(Oo,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":vi(s.open),...i,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})}),kd="DialogTitle",Rd=V((e,t)=>{let{__scopeDialog:a,...o}=e,r=ht(kd,a);return L(oe.h2,{id:r.titleId,...o,ref:t})});Rd.displayName=kd;var Pd="DialogDescription",Td=V((e,t)=>{let{__scopeDialog:a,...o}=e,r=ht(Pd,a);return L(oe.p,{id:r.descriptionId,...o,ref:t})});Td.displayName=Pd;var Md="DialogClose",Ad=V((e,t)=>{let{__scopeDialog:a,...o}=e,r=ht(Md,a);return L(oe.button,{type:"button",...o,ref:t,onClick:se(e.onClick,()=>r.onOpenChange(!1))})});Ad.displayName=Md;var Lv=e=>e.children;function vi(e){return e?"open":"closed"}function _r(e){let t=z({value:e,previous:e});return me(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Vr(e){let[t,a]=M(void 0);return ke(()=>{if(e){a({width:e.offsetWidth,height:e.offsetHeight});let o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;let n=r[0],i,s;if("borderBoxSize"in n){let l=n.borderBoxSize,d=Array.isArray(l)?l[0]:l;i=d.inlineSize,s=d.blockSize}else i=e.offsetWidth,s=e.offsetHeight;a({width:i,height:s})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else a(void 0)},[e]),t}var Ed=["top","right","bottom","left"];var It=Math.min,Xe=Math.max,qo=Math.round,jo=Math.floor,xt=e=>({x:e,y:e}),Iv={left:"right",right:"left",bottom:"top",top:"bottom"};function qr(e,t,a){return Xe(e,It(t,a))}function kt(e,t){return typeof e=="function"?e(t):e}function Rt(e){return e.split("-")[0]}function ga(e){return e.split("-")[1]}function jr(e){return e==="x"?"y":"x"}function Wr(e){return e==="y"?"height":"width"}function bt(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function Gr(e){return jr(bt(e))}function Od(e,t,a){a===void 0&&(a=!1);let o=ga(e),r=Gr(e),n=Wr(r),i=r==="x"?o===(a?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[n]>t.floating[n]&&(i=Uo(i)),[i,Uo(i)]}function Nd(e){let t=Uo(e);return[Ur(e),t,Ur(t)]}function Ur(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var Dd=["left","right"],zd=["right","left"],kv=["top","bottom"],Rv=["bottom","top"];function Pv(e,t,a){switch(e){case"top":case"bottom":return a?t?zd:Dd:t?Dd:zd;case"left":case"right":return t?kv:Rv;default:return[]}}function Fd(e,t,a,o){let r=ga(e),n=Pv(Rt(e),a==="start",o);return r&&(n=n.map(i=>i+"-"+r),t&&(n=n.concat(n.map(Ur)))),n}function Uo(e){let t=Rt(e);return Iv[t]+e.slice(t.length)}function Tv(e){return{top:0,right:0,bottom:0,left:0,...e}}function xi(e){return typeof e!="number"?Tv(e):{top:e,right:e,bottom:e,left:e}}function ha(e){let{x:t,y:a,width:o,height:r}=e;return{width:o,height:r,top:a,left:t,right:t+o,bottom:a+r,x:t,y:a}}function Bd(e,t,a){let{reference:o,floating:r}=e,n=bt(t),i=Gr(t),s=Wr(i),l=Rt(t),d=n==="y",u=o.x+o.width/2-r.width/2,c=o.y+o.height/2-r.height/2,m=o[s]/2-r[s]/2,h;switch(l){case"top":h={x:u,y:o.y-r.height};break;case"bottom":h={x:u,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:c};break;case"left":h={x:o.x-r.width,y:c};break;default:h={x:o.x,y:o.y}}switch(ga(t)){case"start":h[i]-=m*(a&&d?-1:1);break;case"end":h[i]+=m*(a&&d?-1:1);break}return h}async function Vd(e,t){var a;t===void 0&&(t={});let{x:o,y:r,platform:n,rects:i,elements:s,strategy:l}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:c="floating",altBoundary:m=!1,padding:h=0}=kt(t,e),x=xi(h),g=s[m?c==="floating"?"reference":"floating":c],v=ha(await n.getClippingRect({element:(a=await(n.isElement==null?void 0:n.isElement(g)))==null||a?g:g.contextElement||await(n.getDocumentElement==null?void 0:n.getDocumentElement(s.floating)),boundary:d,rootBoundary:u,strategy:l})),w=c==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,b=await(n.getOffsetParent==null?void 0:n.getOffsetParent(s.floating)),C=await(n.isElement==null?void 0:n.isElement(b))?await(n.getScale==null?void 0:n.getScale(b))||{x:1,y:1}:{x:1,y:1},S=ha(n.convertOffsetParentRelativeRectToViewportRelativeRect?await n.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:w,offsetParent:b,strategy:l}):w);return{top:(v.top-S.top+x.top)/C.y,bottom:(S.bottom-v.bottom+x.bottom)/C.y,left:(v.left-S.left+x.left)/C.x,right:(S.right-v.right+x.right)/C.x}}var Mv=50,Ud=async(e,t,a)=>{let{placement:o="bottom",strategy:r="absolute",middleware:n=[],platform:i}=a,s=i.detectOverflow?i:{...i,detectOverflow:Vd},l=await(i.isRTL==null?void 0:i.isRTL(t)),d=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:c}=Bd(d,o,l),m=o,h=0,x={};for(let p=0;p<n.length;p++){let g=n[p];if(!g)continue;let{name:v,fn:w}=g,{x:b,y:C,data:S,reset:R}=await w({x:u,y:c,initialPlacement:o,placement:m,strategy:r,middlewareData:x,rects:d,platform:s,elements:{reference:e,floating:t}});u=b??u,c=C??c,x[v]={...x[v],...S},R&&h<Mv&&(h++,typeof R=="object"&&(R.placement&&(m=R.placement),R.rects&&(d=R.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):R.rects),{x:u,y:c}=Bd(d,m,l)),p=-1)}return{x:u,y:c,placement:m,strategy:r,middlewareData:x}},qd=e=>({name:"arrow",options:e,async fn(t){let{x:a,y:o,placement:r,rects:n,platform:i,elements:s,middlewareData:l}=t,{element:d,padding:u=0}=kt(e,t)||{};if(d==null)return{};let c=xi(u),m={x:a,y:o},h=Gr(r),x=Wr(h),p=await i.getDimensions(d),g=h==="y",v=g?"top":"left",w=g?"bottom":"right",b=g?"clientHeight":"clientWidth",C=n.reference[x]+n.reference[h]-m[h]-n.floating[x],S=m[h]-n.reference[h],R=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d)),T=R?R[b]:0;(!T||!await(i.isElement==null?void 0:i.isElement(R)))&&(T=s.floating[b]||n.floating[x]);let I=C/2-S/2,F=T/2-p[x]/2-1,X=It(c[v],F),D=It(c[w],F),O=X,U=T-p[x]-D,q=T/2-p[x]/2+I,k=qr(O,q,U),A=!l.arrow&&ga(r)!=null&&q!==k&&n.reference[x]/2-(q<O?X:D)-p[x]/2<0,j=A?q<O?q-O:q-U:0;return{[h]:m[h]+j,data:{[h]:k,centerOffset:q-k-j,...A&&{alignmentOffset:j}},reset:A}}});var jd=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var a,o;let{placement:r,middlewareData:n,rects:i,initialPlacement:s,platform:l,elements:d}=t,{mainAxis:u=!0,crossAxis:c=!0,fallbackPlacements:m,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:p=!0,...g}=kt(e,t);if((a=n.arrow)!=null&&a.alignmentOffset)return{};let v=Rt(r),w=bt(s),b=Rt(s)===s,C=await(l.isRTL==null?void 0:l.isRTL(d.floating)),S=m||(b||!p?[Uo(s)]:Nd(s)),R=x!=="none";!m&&R&&S.push(...Fd(s,p,x,C));let T=[s,...S],I=await l.detectOverflow(t,g),F=[],X=((o=n.flip)==null?void 0:o.overflows)||[];if(u&&F.push(I[v]),c){let q=Od(r,i,C);F.push(I[q[0]],I[q[1]])}if(X=[...X,{placement:r,overflows:F}],!F.every(q=>q<=0)){var D,O;let q=(((D=n.flip)==null?void 0:D.index)||0)+1,k=T[q];if(k&&(!(c==="alignment"?w!==bt(k):!1)||X.every(B=>bt(B.placement)===w?B.overflows[0]>0:!0)))return{data:{index:q,overflows:X},reset:{placement:k}};let A=(O=X.filter(j=>j.overflows[0]<=0).sort((j,B)=>j.overflows[1]-B.overflows[1])[0])==null?void 0:O.placement;if(!A)switch(h){case"bestFit":{var U;let j=(U=X.filter(B=>{if(R){let te=bt(B.placement);return te===w||te==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(te=>te>0).reduce((te,E)=>te+E,0)]).sort((B,te)=>B[1]-te[1])[0])==null?void 0:U[0];j&&(A=j);break}case"initialPlacement":A=s;break}if(r!==A)return{reset:{placement:A}}}return{}}}};function Hd(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function _d(e){return Ed.some(t=>e[t]>=0)}var Wd=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){let{rects:a,platform:o}=t,{strategy:r="referenceHidden",...n}=kt(e,t);switch(r){case"referenceHidden":{let i=await o.detectOverflow(t,{...n,elementContext:"reference"}),s=Hd(i,a.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:_d(s)}}}case"escaped":{let i=await o.detectOverflow(t,{...n,altBoundary:!0}),s=Hd(i,a.floating);return{data:{escapedOffsets:s,escaped:_d(s)}}}default:return{}}}}};var Gd=new Set(["left","top"]);async function Av(e,t){let{placement:a,platform:o,elements:r}=e,n=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=Rt(a),s=ga(a),l=bt(a)==="y",d=Gd.has(i)?-1:1,u=n&&l?-1:1,c=kt(t,e),{mainAxis:m,crossAxis:h,alignmentAxis:x}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return s&&typeof x=="number"&&(h=s==="end"?x*-1:x),l?{x:h*u,y:m*d}:{x:m*d,y:h*u}}var Kd=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var a,o;let{x:r,y:n,placement:i,middlewareData:s}=t,l=await Av(t,e);return i===((a=s.offset)==null?void 0:a.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:n+l.y,data:{...l,placement:i}}}}},$d=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:a,y:o,placement:r,platform:n}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:v=>{let{x:w,y:b}=v;return{x:w,y:b}}},...d}=kt(e,t),u={x:a,y:o},c=await n.detectOverflow(t,d),m=bt(Rt(r)),h=jr(m),x=u[h],p=u[m];if(i){let v=h==="y"?"top":"left",w=h==="y"?"bottom":"right",b=x+c[v],C=x-c[w];x=qr(b,x,C)}if(s){let v=m==="y"?"top":"left",w=m==="y"?"bottom":"right",b=p+c[v],C=p-c[w];p=qr(b,p,C)}let g=l.fn({...t,[h]:x,[m]:p});return{...g,data:{x:g.x-a,y:g.y-o,enabled:{[h]:i,[m]:s}}}}}},Xd=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:a,y:o,placement:r,rects:n,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:d=!0}=kt(e,t),u={x:a,y:o},c=bt(r),m=jr(c),h=u[m],x=u[c],p=kt(s,t),g=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){let b=m==="y"?"height":"width",C=n.reference[m]-n.floating[b]+g.mainAxis,S=n.reference[m]+n.reference[b]-g.mainAxis;h<C?h=C:h>S&&(h=S)}if(d){var v,w;let b=m==="y"?"width":"height",C=Gd.has(Rt(r)),S=n.reference[c]-n.floating[b]+(C&&((v=i.offset)==null?void 0:v[c])||0)+(C?0:g.crossAxis),R=n.reference[c]+n.reference[b]+(C?0:((w=i.offset)==null?void 0:w[c])||0)-(C?g.crossAxis:0);x<S?x=S:x>R&&(x=R)}return{[m]:h,[c]:x}}}},Zd=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var a,o;let{placement:r,rects:n,platform:i,elements:s}=t,{apply:l=()=>{},...d}=kt(e,t),u=await i.detectOverflow(t,d),c=Rt(r),m=ga(r),h=bt(r)==="y",{width:x,height:p}=n.floating,g,v;c==="top"||c==="bottom"?(g=c,v=m===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(v=c,g=m==="end"?"top":"bottom");let w=p-u.top-u.bottom,b=x-u.left-u.right,C=It(p-u[g],w),S=It(x-u[v],b),R=!t.middlewareData.shift,T=C,I=S;if((a=t.middlewareData.shift)!=null&&a.enabled.x&&(I=b),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(T=w),R&&!m){let X=Xe(u.left,0),D=Xe(u.right,0),O=Xe(u.top,0),U=Xe(u.bottom,0);h?I=x-2*(X!==0||D!==0?X+D:Xe(u.left,u.right)):T=p-2*(O!==0||U!==0?O+U:Xe(u.top,u.bottom))}await l({...t,availableWidth:I,availableHeight:T});let F=await i.getDimensions(s.floating);return x!==F.width||p!==F.height?{reset:{rects:!0}}:{}}}};function Kr(){return typeof window<"u"}function ba(e){return Yd(e)?(e.nodeName||"").toLowerCase():"#document"}function at(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function wt(e){var t;return(t=(Yd(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Yd(e){return Kr()?e instanceof Node||e instanceof at(e).Node:!1}function ut(e){return Kr()?e instanceof Element||e instanceof at(e).Element:!1}function Pt(e){return Kr()?e instanceof HTMLElement||e instanceof at(e).HTMLElement:!1}function Jd(e){return!Kr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof at(e).ShadowRoot}function oo(e){let{overflow:t,overflowX:a,overflowY:o,display:r}=ct(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+a)&&r!=="inline"&&r!=="contents"}function Qd(e){return/^(table|td|th)$/.test(ba(e))}function Wo(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}var Dv=/transform|translate|scale|rotate|perspective|filter/,zv=/paint|layout|strict|content/,va=e=>!!e&&e!=="none",bi;function $r(e){let t=ut(e)?ct(e):e;return va(t.transform)||va(t.translate)||va(t.scale)||va(t.rotate)||va(t.perspective)||!Xr()&&(va(t.backdropFilter)||va(t.filter))||Dv.test(t.willChange||"")||zv.test(t.contain||"")}function eu(e){let t=Ut(e);for(;Pt(t)&&!wa(t);){if($r(t))return t;if(Wo(t))return null;t=Ut(t)}return null}function Xr(){return bi==null&&(bi=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),bi}function wa(e){return/^(html|body|#document)$/.test(ba(e))}function ct(e){return at(e).getComputedStyle(e)}function Go(e){return ut(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ut(e){if(ba(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Jd(e)&&e.host||wt(e);return Jd(t)?t.host:t}function tu(e){let t=Ut(e);return wa(t)?e.ownerDocument?e.ownerDocument.body:e.body:Pt(t)&&oo(t)?t:tu(t)}function xa(e,t,a){var o;t===void 0&&(t=[]),a===void 0&&(a=!0);let r=tu(e),n=r===((o=e.ownerDocument)==null?void 0:o.body),i=at(r);if(n){let s=Zr(i);return t.concat(i,i.visualViewport||[],oo(r)?r:[],s&&a?xa(s):[])}else return t.concat(r,xa(r,[],a))}function Zr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function nu(e){let t=ct(e),a=parseFloat(t.width)||0,o=parseFloat(t.height)||0,r=Pt(e),n=r?e.offsetWidth:a,i=r?e.offsetHeight:o,s=qo(a)!==n||qo(o)!==i;return s&&(a=n,o=i),{width:a,height:o,$:s}}function yi(e){return ut(e)?e:e.contextElement}function ro(e){let t=yi(e);if(!Pt(t))return xt(1);let a=t.getBoundingClientRect(),{width:o,height:r,$:n}=nu(t),i=(n?qo(a.width):a.width)/o,s=(n?qo(a.height):a.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}var Ev=xt(0);function iu(e){let t=at(e);return!Xr()||!t.visualViewport?Ev:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ov(e,t,a){return t===void 0&&(t=!1),!a||t&&a!==at(e)?!1:t}function ya(e,t,a,o){t===void 0&&(t=!1),a===void 0&&(a=!1);let r=e.getBoundingClientRect(),n=yi(e),i=xt(1);t&&(o?ut(o)&&(i=ro(o)):i=ro(e));let s=Ov(n,a,o)?iu(n):xt(0),l=(r.left+s.x)/i.x,d=(r.top+s.y)/i.y,u=r.width/i.x,c=r.height/i.y;if(n){let m=at(n),h=o&&ut(o)?at(o):o,x=m,p=Zr(x);for(;p&&o&&h!==x;){let g=ro(p),v=p.getBoundingClientRect(),w=ct(p),b=v.left+(p.clientLeft+parseFloat(w.paddingLeft))*g.x,C=v.top+(p.clientTop+parseFloat(w.paddingTop))*g.y;l*=g.x,d*=g.y,u*=g.x,c*=g.y,l+=b,d+=C,x=at(p),p=Zr(x)}}return ha({width:u,height:c,x:l,y:d})}function Jr(e,t){let a=Go(e).scrollLeft;return t?t.left+a:ya(wt(e)).left+a}function su(e,t){let a=e.getBoundingClientRect(),o=a.left+t.scrollLeft-Jr(e,a),r=a.top+t.scrollTop;return{x:o,y:r}}function Nv(e){let{elements:t,rect:a,offsetParent:o,strategy:r}=e,n=r==="fixed",i=wt(o),s=t?Wo(t.floating):!1;if(o===i||s&&n)return a;let l={scrollLeft:0,scrollTop:0},d=xt(1),u=xt(0),c=Pt(o);if((c||!c&&!n)&&((ba(o)!=="body"||oo(i))&&(l=Go(o)),c)){let h=ya(o);d=ro(o),u.x=h.x+o.clientLeft,u.y=h.y+o.clientTop}let m=i&&!c&&!n?su(i,l):xt(0);return{width:a.width*d.x,height:a.height*d.y,x:a.x*d.x-l.scrollLeft*d.x+u.x+m.x,y:a.y*d.y-l.scrollTop*d.y+u.y+m.y}}function Fv(e){return Array.from(e.getClientRects())}function Bv(e){let t=wt(e),a=Go(e),o=e.ownerDocument.body,r=Xe(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),n=Xe(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight),i=-a.scrollLeft+Jr(e),s=-a.scrollTop;return ct(o).direction==="rtl"&&(i+=Xe(t.clientWidth,o.clientWidth)-r),{width:r,height:n,x:i,y:s}}var au=25;function Hv(e,t){let a=at(e),o=wt(e),r=a.visualViewport,n=o.clientWidth,i=o.clientHeight,s=0,l=0;if(r){n=r.width,i=r.height;let u=Xr();(!u||u&&t==="fixed")&&(s=r.offsetLeft,l=r.offsetTop)}let d=Jr(o);if(d<=0){let u=o.ownerDocument,c=u.body,m=getComputedStyle(c),h=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,x=Math.abs(o.clientWidth-c.clientWidth-h);x<=au&&(n-=x)}else d<=au&&(n+=d);return{width:n,height:i,x:s,y:l}}function _v(e,t){let a=ya(e,!0,t==="fixed"),o=a.top+e.clientTop,r=a.left+e.clientLeft,n=Pt(e)?ro(e):xt(1),i=e.clientWidth*n.x,s=e.clientHeight*n.y,l=r*n.x,d=o*n.y;return{width:i,height:s,x:l,y:d}}function ou(e,t,a){let o;if(t==="viewport")o=Hv(e,a);else if(t==="document")o=Bv(wt(e));else if(ut(t))o=_v(t,a);else{let r=iu(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return ha(o)}function lu(e,t){let a=Ut(e);return a===t||!ut(a)||wa(a)?!1:ct(a).position==="fixed"||lu(a,t)}function Vv(e,t){let a=t.get(e);if(a)return a;let o=xa(e,[],!1).filter(s=>ut(s)&&ba(s)!=="body"),r=null,n=ct(e).position==="fixed",i=n?Ut(e):e;for(;ut(i)&&!wa(i);){let s=ct(i),l=$r(i);!l&&s.position==="fixed"&&(r=null),(n?!l&&!r:!l&&s.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||oo(i)&&!l&&lu(e,i))?o=o.filter(u=>u!==i):r=s,i=Ut(i)}return t.set(e,o),o}function Uv(e){let{element:t,boundary:a,rootBoundary:o,strategy:r}=e,i=[...a==="clippingAncestors"?Wo(t)?[]:Vv(t,this._c):[].concat(a),o],s=ou(t,i[0],r),l=s.top,d=s.right,u=s.bottom,c=s.left;for(let m=1;m<i.length;m++){let h=ou(t,i[m],r);l=Xe(h.top,l),d=It(h.right,d),u=It(h.bottom,u),c=Xe(h.left,c)}return{width:d-c,height:u-l,x:c,y:l}}function qv(e){let{width:t,height:a}=nu(e);return{width:t,height:a}}function jv(e,t,a){let o=Pt(t),r=wt(t),n=a==="fixed",i=ya(e,!0,n,t),s={scrollLeft:0,scrollTop:0},l=xt(0);function d(){l.x=Jr(r)}if(o||!o&&!n)if((ba(t)!=="body"||oo(r))&&(s=Go(t)),o){let h=ya(t,!0,n,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else r&&d();n&&!o&&r&&d();let u=r&&!o&&!n?su(r,s):xt(0),c=i.left+s.scrollLeft-l.x-u.x,m=i.top+s.scrollTop-l.y-u.y;return{x:c,y:m,width:i.width,height:i.height}}function wi(e){return ct(e).position==="static"}function ru(e,t){if(!Pt(e)||ct(e).position==="fixed")return null;if(t)return t(e);let a=e.offsetParent;return wt(e)===a&&(a=a.ownerDocument.body),a}function du(e,t){let a=at(e);if(Wo(e))return a;if(!Pt(e)){let r=Ut(e);for(;r&&!wa(r);){if(ut(r)&&!wi(r))return r;r=Ut(r)}return a}let o=ru(e,t);for(;o&&Qd(o)&&wi(o);)o=ru(o,t);return o&&wa(o)&&wi(o)&&!$r(o)?a:o||eu(e)||a}var Wv=async function(e){let t=this.getOffsetParent||du,a=this.getDimensions,o=await a(e.floating);return{reference:jv(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Gv(e){return ct(e).direction==="rtl"}var uu={convertOffsetParentRelativeRectToViewportRelativeRect:Nv,getDocumentElement:wt,getClippingRect:Uv,getOffsetParent:du,getElementRects:Wv,getClientRects:Fv,getDimensions:qv,getScale:ro,isElement:ut,isRTL:Gv};function cu(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Kv(e,t){let a=null,o,r=wt(e);function n(){var s;clearTimeout(o),(s=a)==null||s.disconnect(),a=null}function i(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),n();let d=e.getBoundingClientRect(),{left:u,top:c,width:m,height:h}=d;if(s||t(),!m||!h)return;let x=jo(c),p=jo(r.clientWidth-(u+m)),g=jo(r.clientHeight-(c+h)),v=jo(u),b={rootMargin:-x+"px "+-p+"px "+-g+"px "+-v+"px",threshold:Xe(0,It(1,l))||1},C=!0;function S(R){let T=R[0].intersectionRatio;if(T!==l){if(!C)return i();T?i(!1,T):o=setTimeout(()=>{i(!1,1e-7)},1e3)}T===1&&!cu(d,e.getBoundingClientRect())&&i(),C=!1}try{a=new IntersectionObserver(S,{...b,root:r.ownerDocument})}catch{a=new IntersectionObserver(S,b)}a.observe(e)}return i(!0),n}function Ci(e,t,a,o){o===void 0&&(o={});let{ancestorScroll:r=!0,ancestorResize:n=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,d=yi(e),u=r||n?[...d?xa(d):[],...t?xa(t):[]]:[];u.forEach(v=>{r&&v.addEventListener("scroll",a,{passive:!0}),n&&v.addEventListener("resize",a)});let c=d&&s?Kv(d,a):null,m=-1,h=null;i&&(h=new ResizeObserver(v=>{let[w]=v;w&&w.target===d&&h&&t&&(h.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var b;(b=h)==null||b.observe(t)})),a()}),d&&!l&&h.observe(d),t&&h.observe(t));let x,p=l?ya(e):null;l&&g();function g(){let v=ya(e);p&&!cu(p,v)&&a(),p=v,x=requestAnimationFrame(g)}return a(),()=>{var v;u.forEach(w=>{r&&w.removeEventListener("scroll",a),n&&w.removeEventListener("resize",a)}),c?.(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(x)}}var fu=Kd;var pu=$d,mu=jd,gu=Zd,hu=Wd,Si=qd;var vu=Xd,Li=(e,t,a)=>{let o=new Map,r={platform:uu,...a},n={...r.platform,_c:o};return Ud(e,t,{...r,platform:n})};var $v=typeof document<"u",Xv=function(){},Yr=$v?Ht:Xv;function Qr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let a,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(a=e.length,a!==t.length)return!1;for(o=a;o--!==0;)if(!Qr(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),a=r.length,a!==Object.keys(t).length)return!1;for(o=a;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=a;o--!==0;){let n=r[o];if(!(n==="_owner"&&e.$$typeof)&&!Qr(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function bu(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function xu(e,t){let a=bu(e);return Math.round(t*a)/a}function Ii(e){let t=z(e);return Yr(()=>{t.current=e}),t}function wu(e){e===void 0&&(e={});let{placement:t="bottom",strategy:a="absolute",middleware:o=[],platform:r,elements:{reference:n,floating:i}={},transform:s=!0,whileElementsMounted:l,open:d}=e,[u,c]=M({x:0,y:0,strategy:a,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=M(o);Qr(m,o)||h(o);let[x,p]=M(null),[g,v]=M(null),w=Q(B=>{B!==R.current&&(R.current=B,p(B))},[]),b=Q(B=>{B!==T.current&&(T.current=B,v(B))},[]),C=n||x,S=i||g,R=z(null),T=z(null),I=z(u),F=l!=null,X=Ii(l),D=Ii(r),O=Ii(d),U=Q(()=>{if(!R.current||!T.current)return;let B={placement:t,strategy:a,middleware:m};D.current&&(B.platform=D.current),Li(R.current,T.current,B).then(te=>{let E={...te,isPositioned:O.current!==!1};q.current&&!Qr(I.current,E)&&(I.current=E,kr(()=>{c(E)}))})},[m,t,a,D,O]);Yr(()=>{d===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,c(B=>({...B,isPositioned:!1})))},[d]);let q=z(!1);Yr(()=>(q.current=!0,()=>{q.current=!1}),[]),Yr(()=>{if(C&&(R.current=C),S&&(T.current=S),C&&S){if(X.current)return X.current(C,S,U);U()}},[C,S,U,X,F]);let k=me(()=>({reference:R,floating:T,setReference:w,setFloating:b}),[w,b]),A=me(()=>({reference:C,floating:S}),[C,S]),j=me(()=>{let B={position:a,left:0,top:0};if(!A.floating)return B;let te=xu(A.floating,u.x),E=xu(A.floating,u.y);return s?{...B,transform:"translate("+te+"px, "+E+"px)",...bu(A.floating)>=1.5&&{willChange:"transform"}}:{position:a,left:te,top:E}},[a,s,A.floating,u.x,u.y]);return me(()=>({...u,update:U,refs:k,elements:A,floatingStyles:j}),[u,U,k,A,j])}var Zv=e=>{function t(a){return{}.hasOwnProperty.call(a,"current")}return{name:"arrow",options:e,fn(a){let{element:o,padding:r}=typeof e=="function"?e(a):e;return o&&t(o)?o.current!=null?Si({element:o.current,padding:r}).fn(a):{}:o?Si({element:o,padding:r}).fn(a):{}}}},yu=(e,t)=>{let a=fu(e);return{name:a.name,fn:a.fn,options:[e,t]}},Cu=(e,t)=>{let a=pu(e);return{name:a.name,fn:a.fn,options:[e,t]}},Su=(e,t)=>({fn:vu(e).fn,options:[e,t]}),Lu=(e,t)=>{let a=mu(e);return{name:a.name,fn:a.fn,options:[e,t]}},Iu=(e,t)=>{let a=gu(e);return{name:a.name,fn:a.fn,options:[e,t]}};var ku=(e,t)=>{let a=hu(e);return{name:a.name,fn:a.fn,options:[e,t]}};var Ru=(e,t)=>{let a=Zv(e);return{name:a.name,fn:a.fn,options:[e,t]}};var Jv="Arrow",Pu=V((e,t)=>{let{children:a,width:o=10,height:r=5,...n}=e;return L(oe.svg,{...n,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?a:L("polygon",{points:"0,0 30,0 15,10"})})});Pu.displayName=Jv;var Tu=Pu;var ki="Popper",[Mu,Ri]=et(ki),[Qv,Au]=Mu(ki),Du=e=>{let{__scopePopper:t,children:a}=e,[o,r]=M(null),[n,i]=M(void 0);return L(Qv,{scope:t,anchor:o,onAnchorChange:r,placementState:n,setPlacementState:i,children:a})};Du.displayName=ki;var zu="PopperAnchor",Eu=V((e,t)=>{let{__scopePopper:a,virtualRef:o,...r}=e,n=Au(zu,a),i=z(null),s=n.onAnchorChange,l=Q(x=>{i.current=x,x&&s(x)},[s]),d=ge(t,l),u=z(null);H(()=>{if(!o)return;let x=u.current;u.current=o.current,x!==u.current&&s(u.current)});let c=n.placementState&&Ti(n.placementState),m=c?.[0],h=c?.[1];return o?null:L(oe.div,{"data-radix-popper-side":m,"data-radix-popper-align":h,...r,ref:d})});Eu.displayName=zu;var Pi="PopperContent",[ex,tx]=Mu(Pi),Ou=V((e,t)=>{let{__scopePopper:a,side:o="bottom",sideOffset:r=0,align:n="center",alignOffset:i=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:c="partial",hideWhenDetached:m=!1,updatePositionStrategy:h="optimized",onPlaced:x,...p}=e,g=Au(Pi,a),[v,w]=M(null),b=ge(t,w),[C,S]=M(null),R=Vr(C),T=R?.width??0,I=R?.height??0,F=o+(n!=="center"?"-"+n:""),X=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(d)?d:[d],O=D.length>0,U={padding:X,boundary:D.filter(ox),altBoundary:O},{refs:q,floatingStyles:k,placement:A,isPositioned:j,middlewareData:B}=wu({strategy:"fixed",placement:F,whileElementsMounted:(...fe)=>Ci(...fe,{animationFrame:h==="always"}),elements:{reference:g.anchor},middleware:[yu({mainAxis:r+I,alignmentAxis:i}),l&&Cu({mainAxis:!0,crossAxis:!1,limiter:c==="partial"?Su():void 0,...U}),l&&Lu({...U}),Iu({...U,apply:({elements:fe,rects:de,availableWidth:we,availableHeight:ye})=>{let{width:Se,height:Ve}=de.reference,Ae=fe.floating.style;Ae.setProperty("--radix-popper-available-width",`${we}px`),Ae.setProperty("--radix-popper-available-height",`${ye}px`),Ae.setProperty("--radix-popper-anchor-width",`${Se}px`),Ae.setProperty("--radix-popper-anchor-height",`${Ve}px`)}}),C&&Ru({element:C,padding:s}),rx({arrowWidth:T,arrowHeight:I}),m&&ku({strategy:"referenceHidden",...U,boundary:O?U.boundary:void 0})]}),te=g.setPlacementState;ke(()=>(te(A),()=>{te(void 0)}),[A,te]);let[E,P]=Ti(A),_=$e(x);ke(()=>{j&&_?.()},[j,_]);let Y=B.arrow?.x,be=B.arrow?.y,ie=B.arrow?.centerOffset!==0,[ne,J]=M();return ke(()=>{v&&J(window.getComputedStyle(v).zIndex)},[v]),L("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...k,transform:j?k.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[B.transformOrigin?.x,B.transformOrigin?.y].join(" "),...B.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:L(ex,{scope:a,placedSide:E,placedAlign:P,onArrowChange:S,arrowX:Y,arrowY:be,shouldHideArrow:ie,children:L(oe.div,{"data-side":E,"data-align":P,...p,ref:b,style:{...p.style,animation:j?void 0:"none"}})})})});Ou.displayName=Pi;var Nu="PopperArrow",ax={top:"bottom",right:"left",bottom:"top",left:"right"},Fu=V(function(t,a){let{__scopePopper:o,...r}=t,n=tx(Nu,o),i=ax[n.placedSide];return L("span",{ref:n.onArrowChange,style:{position:"absolute",left:n.arrowX,top:n.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[n.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[n.placedSide],visibility:n.shouldHideArrow?"hidden":void 0},children:L(Tu,{...r,ref:a,style:{...r.style,display:"block"}})})});Fu.displayName=Nu;function ox(e){return e!==null}var rx=e=>({name:"transformOrigin",options:e,fn(t){let{placement:a,rects:o,middlewareData:r}=t,i=r.arrow?.centerOffset!==0,s=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[d,u]=Ti(a),c={start:"0%",center:"50%",end:"100%"}[u],m=(r.arrow?.x??0)+s/2,h=(r.arrow?.y??0)+l/2,x="",p="";return d==="bottom"?(x=i?c:`${m}px`,p=`${-l}px`):d==="top"?(x=i?c:`${m}px`,p=`${o.floating.height+l}px`):d==="right"?(x=`${-l}px`,p=i?c:`${h}px`):d==="left"&&(x=`${o.floating.width+l}px`,p=i?c:`${h}px`),{data:{x,y:p}}}});function Ti(e){let[t,a="center"]=e.split("-");return[t,a]}var Bu=Du,Hu=Eu,_u=Ou,Vu=Fu;var Mi=!1;function ix(){let[e,t]=M(Mi);return H(()=>{Mi||(Mi=!0,t(!0))},[]),e}var Uu=ae[" useSyncExternalStore ".trim().toString()];function sx(){return()=>{}}function lx(){return Uu(sx,()=>!0,()=>!1)}var qu=typeof Uu=="function"?lx:ix;var Ai="rovingFocusGroup.onEntryFocus",dx={bubbles:!1,cancelable:!0},Ko="RovingFocusGroup",[Di,ju,ux]=Ja(Ko),[cx,zi]=et(Ko,[ux]),[fx,px]=cx(Ko),Wu=V((e,t)=>L(Di.Provider,{scope:e.__scopeRovingFocusGroup,children:L(Di.Slot,{scope:e.__scopeRovingFocusGroup,children:L(mx,{...e,ref:t})})}));Wu.displayName=Ko;var mx=V((e,t)=>{let{__scopeRovingFocusGroup:a,orientation:o,loop:r=!1,dir:n,currentTabStopId:i,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...c}=e,m=z(null),h=ge(t,m),x=ea(n),[p,g]=gt({prop:i,defaultProp:s??null,onChange:l,caller:Ko}),[v,w]=M(!1),b=$e(d),C=ju(a),S=z(!1),[R,T]=M(0);return H(()=>{let I=m.current;if(I)return I.addEventListener(Ai,b),()=>I.removeEventListener(Ai,b)},[b]),L(fx,{scope:a,orientation:o,dir:x,loop:r,currentTabStopId:p,onItemFocus:Q(I=>g(I),[g]),onItemShiftTab:Q(()=>w(!0),[]),onFocusableItemAdd:Q(()=>T(I=>I+1),[]),onFocusableItemRemove:Q(()=>T(I=>I-1),[]),children:L(oe.div,{tabIndex:v||R===0?-1:0,"data-orientation":o,...c,ref:h,style:{outline:"none",...e.style},onMouseDown:se(e.onMouseDown,()=>{S.current=!0}),onFocus:se(e.onFocus,I=>{let F=!S.current;if(I.target===I.currentTarget&&F&&!v){let X=new CustomEvent(Ai,dx);if(I.currentTarget.dispatchEvent(X),!X.defaultPrevented){let D=C().filter(A=>A.focusable),O=D.find(A=>A.active),U=D.find(A=>A.id===p),k=[O,U,...D].filter(Boolean).map(A=>A.ref.current);$u(k,u)}}S.current=!1}),onBlur:se(e.onBlur,()=>w(!1))})})}),Gu="RovingFocusGroupItem",Ku=V((e,t)=>{let{__scopeRovingFocusGroup:a,focusable:o=!0,active:r=!1,tabStopId:n,children:i,...s}=e,l=dt(),d=n||l,u=px(Gu,a),c=u.currentTabStopId===d,m=ju(a),{onFocusableItemAdd:h,onFocusableItemRemove:x,currentTabStopId:p}=u,g=qu();return ke(()=>{if(!(!g||!o))return h(),()=>x()},[g,o,h,x]),H(()=>{if(!(g||!o))return h(),()=>x()},[g,o,h,x]),L(Di.ItemSlot,{scope:a,id:d,focusable:o,active:r,children:L(oe.span,{tabIndex:c?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:se(e.onMouseDown,v=>{o?u.onItemFocus(d):v.preventDefault()}),onFocus:se(e.onFocus,()=>u.onItemFocus(d)),onKeyDown:se(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){u.onItemShiftTab();return}if(v.target!==v.currentTarget)return;let w=vx(v,u.orientation,u.dir);if(w!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let C=m().filter(S=>S.focusable).map(S=>S.ref.current);if(w==="last")C.reverse();else if(w==="prev"||w==="next"){w==="prev"&&C.reverse();let S=C.indexOf(v.currentTarget);C=u.loop?xx(C,S+1):C.slice(S+1)}setTimeout(()=>$u(C))}}),children:typeof i=="function"?i({isCurrentTabStop:c,hasTabStop:p!=null}):i})})});Ku.displayName=Gu;var gx={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function hx(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function vx(e,t,a){let o=hx(e.key,a);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return gx[o]}function $u(e,t=!1){let a=document.activeElement;for(let o of e)if(o===a||(o.focus({preventScroll:t}),document.activeElement!==a))return}function xx(e,t){return e.map((a,o)=>e[(t+o)%e.length])}var Xu=Wu,Zu=Ku;function no(e,[t,a]){return Math.min(a,Math.max(t,e))}var Ze={};Ka(Ze,{Arrow:()=>Ic,Content:()=>nc,Group:()=>fc,Icon:()=>ac,Item:()=>hc,ItemIndicator:()=>bc,ItemText:()=>vc,Label:()=>mc,Portal:()=>rc,Root:()=>Ju,ScrollDownButton:()=>yc,ScrollUpButton:()=>wc,Select:()=>Ju,SelectArrow:()=>Ic,SelectContent:()=>nc,SelectGroup:()=>fc,SelectIcon:()=>ac,SelectItem:()=>hc,SelectItemIndicator:()=>bc,SelectItemText:()=>vc,SelectLabel:()=>mc,SelectPortal:()=>rc,SelectScrollDownButton:()=>yc,SelectScrollUpButton:()=>wc,SelectSeparator:()=>Sc,SelectTrigger:()=>Qu,SelectValue:()=>tc,SelectViewport:()=>uc,Separator:()=>Sc,Trigger:()=>Qu,Value:()=>tc,Viewport:()=>uc,createSelectScope:()=>Sx,unstable_BubbleInput:()=>_i,unstable_Provider:()=>Bi,unstable_SelectBubbleInput:()=>_i,unstable_SelectProvider:()=>Bi});var wx=[" ","Enter","ArrowUp","ArrowDown"],yx=[" ","Enter"],Ca="Select",[tn,an,Cx]=Ja(Ca),[Sa,Sx]=et(Ca,[Cx,Ri]),on=Ri(),[Lx,oa]=Sa(Ca),[Ix,kx]=Sa(Ca),Rx="SelectProvider";function Bi(e){let{__scopeSelect:t,children:a,open:o,defaultOpen:r,onOpenChange:n,value:i,defaultValue:s,onValueChange:l,dir:d,name:u,autoComplete:c,disabled:m,required:h,form:x,internal_do_not_use_render:p}=e,g=on(t),[v,w]=M(null),[b,C]=M(null),[S,R]=M(!1),T=ea(d),[I,F]=gt({prop:o,defaultProp:r??!1,onChange:n,caller:Ca}),[X,D]=gt({prop:i,defaultProp:s,onChange:l,caller:Ca}),O=z(null),U=z(X);H(()=>{let _=x?v?.ownerDocument.getElementById(x):v?.form;if(_ instanceof HTMLFormElement){let Y=()=>D(U.current);return _.addEventListener("reset",Y),()=>_.removeEventListener("reset",Y)}},[x,v,D]);let q=v?!!x||!!v.closest("form"):!0,[k,A]=M(new Set),j=dt(),B=Array.from(k).map(_=>_.props.value).join(";"),te=Q(_=>{A(Y=>new Set(Y).add(_))},[]),E=Q(_=>{A(Y=>{let be=new Set(Y);return be.delete(_),be})},[]),P={required:h,trigger:v,onTriggerChange:w,valueNode:b,onValueNodeChange:C,valueNodeHasChildren:S,onValueNodeHasChildrenChange:R,contentId:j,value:X,onValueChange:D,open:I,onOpenChange:F,dir:T,triggerPointerDownPosRef:O,disabled:m,name:u,autoComplete:c,form:x,nativeOptions:k,nativeSelectKey:B,isFormControl:q};return L(Bu,{...g,children:L(Lx,{scope:t,...P,children:L(tn.Provider,{scope:t,children:L(Ix,{scope:t,onNativeOptionAdd:te,onNativeOptionRemove:E,children:_x(p)?p(P):a})})})})}Bi.displayName=Rx;var Ju=e=>{let{__scopeSelect:t,children:a,...o}=e;return L(Bi,{__scopeSelect:t,...o,internal_do_not_use_render:({isFormControl:r})=>qe(Yt,{children:[a,r?L(_i,{__scopeSelect:t}):null]})})};Ju.displayName=Ca;var Yu="SelectTrigger",Qu=V((e,t)=>{let{__scopeSelect:a,disabled:o=!1,...r}=e,n=on(a),i=oa(Yu,a),s=i.disabled||o,l=ge(t,i.onTriggerChange),d=an(a),u=z("touch"),[c,m,h]=Rc(p=>{let g=d().filter(b=>!b.disabled),v=g.find(b=>b.value===i.value),w=Pc(g,p,v);w!==void 0&&i.onValueChange(w.value)}),x=p=>{s||(i.onOpenChange(!0),h()),p&&(i.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return L(Hu,{asChild:!0,...n,children:L(oe.button,{type:"button",role:"combobox","aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":rn(i.value)?"":void 0,...r,ref:l,onClick:se(r.onClick,p=>{p.currentTarget.focus(),u.current!=="mouse"&&x(p)}),onPointerDown:se(r.onPointerDown,p=>{u.current=p.pointerType;let g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(x(p),p.preventDefault())}),onKeyDown:se(r.onKeyDown,p=>{let g=c.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&m(p.key),!(g&&p.key===" ")&&wx.includes(p.key)&&(x(),p.preventDefault())})})})});Qu.displayName=Yu;var ec="SelectValue",tc=V((e,t)=>{let{__scopeSelect:a,className:o,style:r,children:n,placeholder:i="",...s}=e,l=oa(ec,a),{onValueNodeHasChildrenChange:d}=l,u=n!==void 0,c=ge(t,l.onValueNodeChange);ke(()=>{d(u)},[d,u]);let m=rn(l.value);return L(oe.span,{...s,asChild:m?!1:s.asChild,ref:c,style:{pointerEvents:"none"},children:L(nt,{children:m?i:n},m?"placeholder":"value")})});tc.displayName=ec;var Px="SelectIcon",ac=V((e,t)=>{let{__scopeSelect:a,children:o,...r}=e;return L(oe.span,{"aria-hidden":!0,...r,ref:t,children:o||"\u25BC"})});ac.displayName=Px;var oc="SelectPortal",[Tx,Mx]=Sa(oc,{forceMount:void 0}),rc=e=>{let{__scopeSelect:t,forceMount:a,...o}=e;return L(Tx,{scope:e.__scopeSelect,forceMount:a,children:L(Fo,{asChild:!0,...o})})};rc.displayName=oc;var aa="SelectContent",nc=V((e,t)=>{let a=Mx(aa,e.__scopeSelect),{forceMount:o=a.forceMount,...r}=e,n=oa(aa,e.__scopeSelect),[i,s]=M();return ke(()=>{s(new DocumentFragment)},[]),L(Vt,{present:o||n.open,children:({present:l})=>l?L(lc,{...r,ref:t}):L(ic,{...r,fragment:i})})});nc.displayName=aa;var ic=V((e,t)=>{let{__scopeSelect:a,children:o,fragment:r}=e;return r?Do(L(sc,{scope:a,children:L(tn.Slot,{scope:a,children:L("div",{ref:t,children:o})})}),r):null});ic.displayName="SelectContentFragment";var yt=10,[sc,ra]=Sa(aa),Ax="SelectContentImpl",Dx=mt("SelectContent.RemoveScroll"),lc=V((e,t)=>{let{__scopeSelect:a}=e,{position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:n,onPointerDownOutside:i,side:s,sideOffset:l,align:d,alignOffset:u,arrowPadding:c,collisionBoundary:m,collisionPadding:h,sticky:x,hideWhenDetached:p,avoidCollisions:g,...v}=e,w=oa(aa,a),[b,C]=M(null),[S,R]=M(null),T=ge(t,C),[I,F]=M(null),[X,D]=M(null),O=an(a),[U,q]=M(!1),k=z(!1);H(()=>{if(b)return Fr(b)},[b]),Mr();let A=Q(J=>{let[fe,...de]=O().map(Se=>Se.ref.current),[we]=de.slice(-1),ye=document.activeElement;for(let Se of J)if(Se===ye||(Se?.scrollIntoView({block:"nearest"}),Se===fe&&S&&(S.scrollTop=0),Se===we&&S&&(S.scrollTop=S.scrollHeight),Se?.focus(),document.activeElement!==ye))return},[O,S]),j=Q(()=>A([I,b]),[A,I,b]);H(()=>{U&&j()},[U,j]);let{onOpenChange:B,triggerPointerDownPosRef:te}=w;H(()=>{if(b){let J={x:0,y:0},fe=we=>{J={x:Math.abs(Math.round(we.pageX)-(te.current?.x??0)),y:Math.abs(Math.round(we.pageY)-(te.current?.y??0))}},de=we=>{J.x<=10&&J.y<=10?we.preventDefault():we.composedPath().includes(b)||B(!1),document.removeEventListener("pointermove",fe),te.current=null};return te.current!==null&&(document.addEventListener("pointermove",fe),document.addEventListener("pointerup",de,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",fe),document.removeEventListener("pointerup",de,{capture:!0})}}},[b,B,te]),H(()=>{let J=()=>B(!1);return window.addEventListener("blur",J),window.addEventListener("resize",J),()=>{window.removeEventListener("blur",J),window.removeEventListener("resize",J)}},[B]);let[E,P]=Rc(J=>{let fe=O().filter(ye=>!ye.disabled),de=fe.find(ye=>ye.ref.current===document.activeElement),we=Pc(fe,J,de);we&&setTimeout(()=>we.ref.current?.focus())}),_=Q((J,fe,de)=>{let we=!k.current&&!de;(w.value!==void 0&&w.value===fe||we)&&(F(J),we&&(k.current=!0))},[w.value]),Y=Q(()=>b?.focus(),[b]),be=Q((J,fe,de)=>{let we=!k.current&&!de;(w.value!==void 0&&w.value===fe||we)&&D(J)},[w.value]),ie=o==="popper"?Ei:dc,ne=ie===Ei?{side:s,sideOffset:l,align:d,alignOffset:u,arrowPadding:c,collisionBoundary:m,collisionPadding:h,sticky:x,hideWhenDetached:p,avoidCollisions:g}:{};return L(sc,{scope:a,content:b,viewport:S,onViewportChange:R,itemRefCallback:_,selectedItem:I,onItemLeave:Y,itemTextRefCallback:be,focusSelectedItem:j,selectedItemText:X,position:o,isPositioned:U,searchRef:E,children:L(Vo,{as:Dx,allowPinchZoom:!0,children:L(No,{asChild:!0,trapped:w.open,onMountAutoFocus:J=>{J.preventDefault()},onUnmountAutoFocus:se(r,J=>{w.trigger?.focus({preventScroll:!0}),J.preventDefault()}),children:L(Oo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:n,onPointerDownOutside:i,onFocusOutside:J=>J.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:L(ie,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:J=>J.preventDefault(),...v,...ne,onPlaced:()=>q(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:se(v.onKeyDown,J=>{let fe=J.ctrlKey||J.altKey||J.metaKey;if(J.key==="Tab"&&J.preventDefault(),!fe&&J.key.length===1&&P(J.key),["ArrowUp","ArrowDown","Home","End"].includes(J.key)){let we=O().filter(ye=>!ye.disabled).map(ye=>ye.ref.current);if(["ArrowUp","End"].includes(J.key)&&(we=we.slice().reverse()),["ArrowUp","ArrowDown"].includes(J.key)){let ye=J.target,Se=we.indexOf(ye);we=we.slice(Se+1)}setTimeout(()=>A(we)),J.preventDefault()}})})})})})})});lc.displayName=Ax;var zx="SelectItemAlignedPosition",dc=V((e,t)=>{let{__scopeSelect:a,onPlaced:o,...r}=e,n=oa(aa,a),i=ra(aa,a),[s,l]=M(null),[d,u]=M(null),c=ge(t,u),m=an(a),h=z(!1),x=z(!0),{viewport:p,selectedItem:g,selectedItemText:v,focusSelectedItem:w}=i,b=Q(()=>{if(n.trigger&&n.valueNode&&s&&d&&p&&g&&v){let T=n.trigger.getBoundingClientRect(),I=d.getBoundingClientRect(),F=n.valueNode.getBoundingClientRect(),X=v.getBoundingClientRect();if(n.dir!=="rtl"){let ye=X.left-I.left,Se=F.left-ye,Ve=T.left-Se,Ae=T.width+Ve,Ga=Math.max(Ae,I.width),ue=window.innerWidth-yt,Kt=no(Se,[yt,Math.max(yt,ue-Ga)]);s.style.minWidth=Ae+"px",s.style.left=Kt+"px"}else{let ye=I.right-X.right,Se=window.innerWidth-F.right-ye,Ve=window.innerWidth-T.right-Se,Ae=T.width+Ve,Ga=Math.max(Ae,I.width),ue=window.innerWidth-yt,Kt=no(Se,[yt,Math.max(yt,ue-Ga)]);s.style.minWidth=Ae+"px",s.style.right=Kt+"px"}let D=m(),O=window.innerHeight-yt*2,U=p.scrollHeight,q=window.getComputedStyle(d),k=parseInt(q.borderTopWidth,10),A=parseInt(q.paddingTop,10),j=parseInt(q.borderBottomWidth,10),B=parseInt(q.paddingBottom,10),te=k+A+U+B+j,E=Math.min(g.offsetHeight*5,te),P=window.getComputedStyle(p),_=parseInt(P.paddingTop,10),Y=parseInt(P.paddingBottom,10),be=T.top+T.height/2-yt,ie=O-be,ne=g.offsetHeight/2,J=g.offsetTop+ne,fe=k+A+J,de=te-fe;if(fe<=be){let ye=D.length>0&&g===D[D.length-1].ref.current;s.style.bottom="0px";let Se=d.clientHeight-p.offsetTop-p.offsetHeight,Ve=Math.max(ie,ne+(ye?Y:0)+Se+j),Ae=fe+Ve;s.style.height=Ae+"px"}else{let ye=D.length>0&&g===D[0].ref.current;s.style.top="0px";let Ve=Math.max(be,k+p.offsetTop+(ye?_:0)+ne)+de;s.style.height=Ve+"px",p.scrollTop=fe-be+p.offsetTop}s.style.margin=`${yt}px 0`,s.style.minHeight=E+"px",s.style.maxHeight=O+"px",o?.(),requestAnimationFrame(()=>h.current=!0)}},[m,n.trigger,n.valueNode,s,d,p,g,v,n.dir,o]);ke(()=>b(),[b]);let[C,S]=M();ke(()=>{d&&S(window.getComputedStyle(d).zIndex)},[d]);let R=Q(T=>{T&&x.current===!0&&(b(),w?.(),x.current=!1)},[b,w]);return L(Ox,{scope:a,contentWrapper:s,shouldExpandOnScrollRef:h,onScrollButtonChange:R,children:L("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:L(oe.div,{...r,ref:c,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});dc.displayName=zx;var Ex="SelectPopperPosition",Ei=V((e,t)=>{let{__scopeSelect:a,align:o="start",collisionPadding:r=yt,...n}=e,i=on(a);return L(_u,{...i,...n,ref:t,align:o,collisionPadding:r,style:{boxSizing:"border-box",...n.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Ei.displayName=Ex;var[Ox,Hi]=Sa(aa,{}),Oi="SelectViewport",uc=V((e,t)=>{let{__scopeSelect:a,nonce:o,...r}=e,n=ra(Oi,a),i=Hi(Oi,a),s=ge(t,n.onViewportChange),l=z(0);return qe(Yt,{children:[L("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),L(tn.Slot,{scope:a,children:L(oe.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:se(r.onScroll,d=>{let u=d.currentTarget,{contentWrapper:c,shouldExpandOnScrollRef:m}=i;if(m?.current&&c){let h=Math.abs(l.current-u.scrollTop);if(h>0){let x=window.innerHeight-yt*2,p=parseFloat(c.style.minHeight),g=parseFloat(c.style.height),v=Math.max(p,g);if(v<x){let w=v+h,b=Math.min(x,w),C=w-b;c.style.height=b+"px",c.style.bottom==="0px"&&(u.scrollTop=C>0?C:0,c.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});uc.displayName=Oi;var cc="SelectGroup",[Nx,Fx]=Sa(cc),fc=V((e,t)=>{let{__scopeSelect:a,...o}=e,r=dt();return L(Nx,{scope:a,id:r,children:L(oe.div,{role:"group","aria-labelledby":r,...o,ref:t})})});fc.displayName=cc;var pc="SelectLabel",mc=V((e,t)=>{let{__scopeSelect:a,...o}=e,r=Fx(pc,a);return L(oe.div,{id:r.id,...o,ref:t})});mc.displayName=pc;var en="SelectItem",[Bx,gc]=Sa(en),hc=V((e,t)=>{let{__scopeSelect:a,value:o,disabled:r=!1,textValue:n,...i}=e,s=oa(en,a),l=ra(en,a),d=s.value===o,[u,c]=M(n??""),[m,h]=M(!1),x=$e(b=>l.itemRefCallback?.(b,o,r)),p=ge(t,x),g=dt(),v=z("touch"),w=()=>{r||(s.onValueChange(o),s.onOpenChange(!1))};return L(Bx,{scope:a,value:o,disabled:r,textId:g,isSelected:d,onItemTextChange:Q(b=>{c(C=>C||(b?.textContent??"").trim())},[]),children:L(tn.ItemSlot,{scope:a,value:o,disabled:r,textValue:u,children:L(oe.div,{role:"option","aria-labelledby":g,"data-highlighted":m?"":void 0,"aria-selected":d&&m,"data-state":d?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...i,ref:p,onFocus:se(i.onFocus,()=>h(!0)),onBlur:se(i.onBlur,()=>h(!1)),onClick:se(i.onClick,()=>{v.current!=="mouse"&&w()}),onPointerUp:se(i.onPointerUp,()=>{v.current==="mouse"&&w()}),onPointerDown:se(i.onPointerDown,b=>{v.current=b.pointerType}),onPointerMove:se(i.onPointerMove,b=>{v.current=b.pointerType,r?l.onItemLeave?.():v.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:se(i.onPointerLeave,b=>{b.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:se(i.onKeyDown,b=>{r||b.target!==b.currentTarget||l.searchRef?.current!==""&&b.key===" "||(yx.includes(b.key)&&w(),b.key===" "&&b.preventDefault())})})})})});hc.displayName=en;var $o="SelectItemText",vc=V((e,t)=>{let{__scopeSelect:a,className:o,style:r,...n}=e,i=oa($o,a),s=ra($o,a),l=gc($o,a),d=kx($o,a),[u,c]=M(null),m=$e(w=>s.itemTextRefCallback?.(w,l.value,l.disabled)),h=ge(t,c,l.onItemTextChange,m),x=u?.textContent,p=me(()=>L("option",{value:l.value,disabled:l.disabled,children:x},l.value),[l.disabled,l.value,x]),{onNativeOptionAdd:g,onNativeOptionRemove:v}=d;return ke(()=>(g(p),()=>v(p)),[g,v,p]),qe(Yt,{children:[L(oe.span,{id:l.textId,...n,ref:h}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren&&!rn(i.value)?Do(n.children,i.valueNode):null]})});vc.displayName=$o;var xc="SelectItemIndicator",bc=V((e,t)=>{let{__scopeSelect:a,...o}=e;return gc(xc,a).isSelected?L(oe.span,{"aria-hidden":!0,...o,ref:t}):null});bc.displayName=xc;var Ni="SelectScrollUpButton",wc=V((e,t)=>{let a=ra(Ni,e.__scopeSelect),o=Hi(Ni,e.__scopeSelect),[r,n]=M(!1),i=ge(t,o.onScrollButtonChange);return ke(()=>{if(a.viewport&&a.isPositioned){let l=function(){let u=d.scrollTop>0;n(u)};var s=l;let d=a.viewport;return l(),d.addEventListener("scroll",l),()=>d.removeEventListener("scroll",l)}},[a.viewport,a.isPositioned]),r?L(Cc,{...e,ref:i,onAutoScroll:()=>{let{viewport:s,selectedItem:l}=a;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null});wc.displayName=Ni;var Fi="SelectScrollDownButton",yc=V((e,t)=>{let a=ra(Fi,e.__scopeSelect),o=Hi(Fi,e.__scopeSelect),[r,n]=M(!1),i=ge(t,o.onScrollButtonChange);return ke(()=>{if(a.viewport&&a.isPositioned){let l=function(){let u=d.scrollHeight-d.clientHeight,c=Math.ceil(d.scrollTop)<u;n(c)};var s=l;let d=a.viewport;return l(),d.addEventListener("scroll",l),()=>d.removeEventListener("scroll",l)}},[a.viewport,a.isPositioned]),r?L(Cc,{...e,ref:i,onAutoScroll:()=>{let{viewport:s,selectedItem:l}=a;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null});yc.displayName=Fi;var Cc=V((e,t)=>{let{__scopeSelect:a,onAutoScroll:o,...r}=e,n=ra("SelectScrollButton",a),i=z(null),s=an(a),l=Q(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return H(()=>()=>l(),[l]),ke(()=>{s().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[s]),L(oe.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:se(r.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(o,50))}),onPointerMove:se(r.onPointerMove,()=>{n.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(o,50))}),onPointerLeave:se(r.onPointerLeave,()=>{l()})})}),Hx="SelectSeparator",Sc=V((e,t)=>{let{__scopeSelect:a,...o}=e;return L(oe.div,{"aria-hidden":!0,...o,ref:t})});Sc.displayName=Hx;var Lc="SelectArrow",Ic=V((e,t)=>{let{__scopeSelect:a,...o}=e,r=on(a);return ra(Lc,a).position==="popper"?L(Vu,{...r,...o,ref:t}):null});Ic.displayName=Lc;var kc="SelectBubbleInput",_i=V(({__scopeSelect:e,...t},a)=>{let o=oa(kc,e),{value:r,onValueChange:n,required:i,disabled:s,name:l,autoComplete:d,form:u}=o,{nativeOptions:c,nativeSelectKey:m}=o,h=z(null),x=ge(a,h),p=r??"",g=_r(p),v=Array.from(c).some(w=>(w.props.value??"")==="");return H(()=>{let w=h.current;if(!w)return;let b=window.HTMLSelectElement.prototype,S=Object.getOwnPropertyDescriptor(b,"value").set;if(g!==p&&S){let R=new Event("change",{bubbles:!0});S.call(w,p),w.dispatchEvent(R)}},[g,p]),qe(oe.select,{"aria-hidden":!0,required:i,tabIndex:-1,name:l,autoComplete:d,disabled:s,form:u,onChange:w=>n(w.target.value),...t,style:{...Jn,...t.style},ref:x,defaultValue:p,children:[rn(r)&&!v?L("option",{value:""}):null,Array.from(c)]},m)});_i.displayName=kc;function _x(e){return typeof e=="function"}function rn(e){return e===""||e===void 0}function Rc(e){let t=$e(e),a=z(""),o=z(0),r=Q(i=>{let s=a.current+i;t(s),(function l(d){a.current=d,window.clearTimeout(o.current),d!==""&&(o.current=window.setTimeout(()=>l(""),1e3))})(s)},[t]),n=Q(()=>{a.current="",window.clearTimeout(o.current)},[]);return H(()=>()=>window.clearTimeout(o.current),[]),[a,r,n]}function Pc(e,t,a){let r=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,n=a?e.indexOf(a):-1,i=Vx(e,Math.max(n,0));r.length===1&&(i=i.filter(d=>d!==a));let l=i.find(d=>d.textValue.toLowerCase().startsWith(r.toLowerCase()));return l!==a?l:void 0}function Vx(e,t){return e.map((a,o)=>e[(t+o)%e.length])}var La={};Ka(La,{Range:()=>Bc,Root:()=>Dc,Slider:()=>Dc,SliderRange:()=>Bc,SliderThumb:()=>Uc,SliderTrack:()=>Fc,Thumb:()=>Uc,Track:()=>Fc,createSliderScope:()=>jx,unstable_BubbleInput:()=>Gi,unstable_SliderBubbleInput:()=>Gi,unstable_SliderThumbProvider:()=>ji,unstable_SliderThumbTrigger:()=>Wi,unstable_ThumbProvider:()=>ji,unstable_ThumbTrigger:()=>Wi});var Tc=["PageUp","PageDown"],Mc=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Ac={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},io="Slider",[Vi,Ux,qx]=Ja(io),[qi,jx]=et(io,[qx]),[Wx,Xo]=qi(io),Dc=V((e,t)=>{let{name:a,min:o=0,max:r=100,step:n=1,orientation:i="horizontal",disabled:s=!1,minStepsBetweenThumbs:l=0,defaultValue:d=[o],value:u,onValueChange:c=()=>{},onValueCommit:m=()=>{},inverted:h=!1,form:x,...p}=e,g=z(new Set),v=z(0),w=z(!1),C=i==="horizontal"?Gx:Kx,[S,R]=M(null),T=ge(t,R),[I=[],F]=gt({prop:u,defaultProp:d,onChange:A=>{[...g.current][v.current]?.focus({preventScroll:!0,focusVisible:w.current}),w.current=!1,c(A)}}),X=z(I),D=z(I);H(()=>{let A=x?S?.ownerDocument.getElementById(x):S?.closest("form");if(A instanceof HTMLFormElement){let j=()=>F(D.current);return A.addEventListener("reset",j),()=>A.removeEventListener("reset",j)}},[S,x,F]);function O(A){let j=Jx(I,A);k(A,j)}function U(A){k(A,v.current)}function q(){let A=X.current[v.current];I[v.current]!==A&&m(I)}function k(A,j,{commit:B}={commit:!1}){let te=Wc(n),E=sn(Math.round((A-o)/n)*n+o,te),P=no(E,[o,r]);F((_=[])=>{let Y=Xx(_,P,j);if(eb(Y,l*n)){v.current=Y.indexOf(P);let be=String(Y)!==String(_);return be&&B&&m(Y),be?Y:_}else return _})}return L(Wx,{scope:e.__scopeSlider,name:a,disabled:s,min:o,max:r,valueIndexToChangeRef:v,thumbs:g.current,values:I,orientation:i,form:x,children:L(Vi.Provider,{scope:e.__scopeSlider,children:L(Vi.Slot,{scope:e.__scopeSlider,children:L(C,{"aria-disabled":s,"data-disabled":s?"":void 0,...p,ref:T,onPointerDown:se(p.onPointerDown,()=>{s||(X.current=I,w.current=!1)}),min:o,max:r,inverted:h,onSlideStart:s?void 0:O,onSlideMove:s?void 0:U,onSlideEnd:s?void 0:q,onHomeKeyDown:()=>{s||(w.current=!0,k(o,0,{commit:!0}))},onEndKeyDown:()=>{s||(w.current=!0,k(r,I.length-1,{commit:!0}))},onStepKeyDown:({event:A,direction:j})=>{if(!s){w.current=!0;let E=Tc.includes(A.key)||A.shiftKey&&Mc.includes(A.key)?10:1,P=v.current,_=I[P],Y=tb(_,{min:o,step:n,direction:j,multiplier:E});k(Y,P,{commit:!0})}}})})})})});Dc.displayName=io;var[zc,Ec]=qi(io,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Gx=V((e,t)=>{let{min:a,max:o,dir:r,inverted:n,onSlideStart:i,onSlideMove:s,onSlideEnd:l,onStepKeyDown:d,...u}=e,[c,m]=M(null),h=ge(t,m),x=z(void 0),p=ea(r),g=p==="ltr",v=g&&!n||!g&&n;function w(b){let C=x.current||c.getBoundingClientRect(),S=[0,C.width],T=Ki(S,v?[a,o]:[o,a]);return x.current=C,T(b-C.left)}return L(zc,{scope:e.__scopeSlider,startEdge:v?"left":"right",endEdge:v?"right":"left",direction:v?1:-1,size:"width",children:L(Oc,{dir:p,"data-orientation":"horizontal",...u,ref:h,style:{...u.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:b=>{let C=w(b.clientX);i?.(C)},onSlideMove:b=>{let C=w(b.clientX);s?.(C)},onSlideEnd:()=>{x.current=void 0,l?.()},onStepKeyDown:b=>{let S=Ac[v?"from-left":"from-right"].includes(b.key);d?.({event:b,direction:S?-1:1})}})})}),Kx=V((e,t)=>{let{min:a,max:o,inverted:r,onSlideStart:n,onSlideMove:i,onSlideEnd:s,onStepKeyDown:l,...d}=e,u=z(null),c=ge(t,u),m=z(void 0),h=!r;function x(p){let g=m.current||u.current.getBoundingClientRect(),v=[0,g.height],b=Ki(v,h?[o,a]:[a,o]);return m.current=g,b(p-g.top)}return L(zc,{scope:e.__scopeSlider,startEdge:h?"bottom":"top",endEdge:h?"top":"bottom",size:"height",direction:h?1:-1,children:L(Oc,{"data-orientation":"vertical",...d,ref:c,style:{...d.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:p=>{let g=x(p.clientY);n?.(g)},onSlideMove:p=>{let g=x(p.clientY);i?.(g)},onSlideEnd:()=>{m.current=void 0,s?.()},onStepKeyDown:p=>{let v=Ac[h?"from-bottom":"from-top"].includes(p.key);l?.({event:p,direction:v?-1:1})}})})}),Oc=V((e,t)=>{let{__scopeSlider:a,onSlideStart:o,onSlideMove:r,onSlideEnd:n,onHomeKeyDown:i,onEndKeyDown:s,onStepKeyDown:l,...d}=e,u=Xo(io,a);return L(oe.span,{...d,ref:t,onKeyDown:se(e.onKeyDown,c=>{c.key==="Home"?(i(c),c.preventDefault()):c.key==="End"?(s(c),c.preventDefault()):Tc.concat(Mc).includes(c.key)&&(l(c),c.preventDefault())}),onPointerDown:se(e.onPointerDown,c=>{let m=c.target;m.setPointerCapture(c.pointerId),c.preventDefault(),u.thumbs.has(m)?m.focus({preventScroll:!0,focusVisible:!1}):o(c)}),onPointerMove:se(e.onPointerMove,c=>{c.target.hasPointerCapture(c.pointerId)&&r(c)}),onPointerUp:se(e.onPointerUp,c=>{let m=c.target;m.hasPointerCapture(c.pointerId)&&(m.releasePointerCapture(c.pointerId),n(c))})})}),Nc="SliderTrack",Fc=V((e,t)=>{let{__scopeSlider:a,...o}=e,r=Xo(Nc,a);return L(oe.span,{"data-disabled":r.disabled?"":void 0,"data-orientation":r.orientation,...o,ref:t})});Fc.displayName=Nc;var Ui="SliderRange",Bc=V((e,t)=>{let{__scopeSlider:a,...o}=e,r=Xo(Ui,a),n=Ec(Ui,a),i=z(null),s=ge(t,i),l=r.values.length,d=r.values.map(m=>jc(m,r.min,r.max)),u=l>1?Math.min(...d):0,c=100-Math.max(...d);return L(oe.span,{"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,...o,ref:s,style:{...e.style,[n.startEdge]:u+"%",[n.endEdge]:c+"%"}})});Bc.displayName=Ui;var Hc="SliderThumb",[$x,_c]=qi(Hc),Vc="SliderThumbProvider";function ji(e){let{__scopeSlider:t,name:a,children:o,internal_do_not_use_render:r}=e,n=Xo(Vc,t),i=Ux(t),[s,l]=M(null),d=me(()=>s?i().findIndex(g=>g.ref.current===s):-1,[i,s]),u=Vr(s),c=s?!!n.form||!!s.closest("form"):!0,m=n.values[d],h=a??(n.name?n.name+(n.values.length>1?"[]":""):void 0),x=m===void 0?0:jc(m,n.min,n.max);H(()=>{if(s)return n.thumbs.add(s),()=>{n.thumbs.delete(s)}},[s,n.thumbs]);let p={value:m,name:h,form:n.form,isFormControl:c,index:d,thumb:s,onThumbChange:l,percent:x,size:u};return L($x,{scope:t,...p,children:ab(r)?r(p):o})}ji.displayName=Vc;var nn="SliderThumbTrigger",Wi=V((e,t)=>{let{__scopeSlider:a,...o}=e,r=Xo(nn,a),n=Ec(nn,a),{index:i,value:s,percent:l,size:d,onThumbChange:u}=_c(nn,a),c=ge(t,u),m=Zx(i,r.values.length),h=d?.[n.size],x=h?Yx(h,l,n.direction):0;return L("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[n.startEdge]:`calc(${l}% + ${x}px)`},children:L(Vi.ItemSlot,{scope:a,children:L(oe.span,{role:"slider","aria-label":e["aria-label"]||m,"aria-valuemin":r.min,"aria-valuenow":s,"aria-valuemax":r.max,"aria-orientation":r.orientation,"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,tabIndex:r.disabled?void 0:0,...o,ref:c,style:s===void 0?{display:"none"}:e.style,onFocus:se(e.onFocus,()=>{r.valueIndexToChangeRef.current=i})})})})});Wi.displayName=nn;var Uc=V((e,t)=>{let{__scopeSlider:a,name:o,...r}=e;return L(ji,{__scopeSlider:a,name:o,internal_do_not_use_render:({index:n,isFormControl:i})=>qe(Yt,{children:[L(Wi,{...r,ref:t,__scopeSlider:a}),i?L(Gi,{__scopeSlider:a},n):null]})})});Uc.displayName=Hc;var qc="SliderBubbleInput",Gi=V(({__scopeSlider:e,...t},a)=>{let{value:o,name:r,form:n}=_c(qc,e),i=z(null),s=ge(i,a),l=_r(o);return H(()=>{let d=i.current;if(!d)return;let u=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(u,"value").set;if(l!==o&&m){let h=new Event("input",{bubbles:!0});m.call(d,o),d.dispatchEvent(h)}},[l,o]),L(oe.input,{style:{display:"none"},name:r,form:n,...t,ref:s,defaultValue:o})});Gi.displayName=qc;function Xx(e=[],t,a){let o=[...e];return o[a]=t,o.sort((r,n)=>r-n)}function jc(e,t,a){let n=100/(a-t)*(e-t);return no(n,[0,100])}function Zx(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Jx(e,t){if(e.length===1)return 0;let a=e.map(r=>Math.abs(r-t)),o=Math.min(...a);return a.indexOf(o)}function Yx(e,t,a){let o=e/2,n=Ki([0,50],[0,o]);return(o-n(t)*a)*a}function Qx(e){return e.slice(0,-1).map((t,a)=>e[a+1]-t)}function eb(e,t){if(t>0){let a=Qx(e);return Math.min(...a)>=t}return!0}function Ki(e,t){return a=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let o=(t[1]-t[0])/(e[1]-e[0]);return t[0]+o*(a-e[0])}}function Wc(e){if(!Number.isFinite(e))return 0;let t=e.toString();if(t.includes("e")){let[o,r]=t.split("e"),n=o.split(".")[1]||"",i=Number(r);return Math.max(0,n.length-i)}let a=t.split(".")[1];return a?a.length:0}function sn(e,t){let a=Math.pow(10,t);return Math.round(e*a)/a}function tb(e,{min:t,step:a,direction:o,multiplier:r}){let n=Wc(a),i=(e-t)/a,s=Math.round(i),l=sn(s*a+t,n)===sn(e,n),d;return l?d=s+r*o:o>0?d=Math.ceil(i):d=Math.floor(i),sn(d*a+t,n)}function ab(e){return typeof e=="function"}var so={};Ka(so,{Content:()=>db,List:()=>sb,Root:()=>ib,Tabs:()=>Xi,TabsContent:()=>Yi,TabsList:()=>Zi,TabsTrigger:()=>Ji,Trigger:()=>lb,createTabsScope:()=>rb});var ln="Tabs",[ob,rb]=et(ln,[zi]),Gc=zi(),[nb,$i]=ob(ln),Xi=V((e,t)=>{let{__scopeTabs:a,value:o,onValueChange:r,defaultValue:n,orientation:i="horizontal",dir:s,activationMode:l="automatic",...d}=e,u=ea(s),[c,m]=gt({prop:o,onChange:r,defaultProp:n??"",caller:ln});return L(nb,{scope:a,baseId:dt(),value:c,onValueChange:m,orientation:i,dir:u,activationMode:l,children:L(oe.div,{dir:u,"data-orientation":i,...d,ref:t})})});Xi.displayName=ln;var Kc="TabsList",Zi=V((e,t)=>{let{__scopeTabs:a,loop:o=!0,...r}=e,n=$i(Kc,a),i=Gc(a);return L(Xu,{asChild:!0,...i,orientation:n.orientation,dir:n.dir,loop:o,children:L(oe.div,{role:"tablist","aria-orientation":n.orientation,...r,ref:t})})});Zi.displayName=Kc;var $c="TabsTrigger",Ji=V((e,t)=>{let{__scopeTabs:a,value:o,disabled:r=!1,...n}=e,i=$i($c,a),s=Gc(a),l=Zc(i.baseId,o),d=Jc(i.baseId,o),u=o===i.value;return L(Zu,{asChild:!0,...s,focusable:!r,active:u,children:L(oe.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:l,...n,ref:t,onMouseDown:se(e.onMouseDown,c=>{!r&&c.button===0&&c.ctrlKey===!1?i.onValueChange(o):c.preventDefault()}),onKeyDown:se(e.onKeyDown,c=>{r||c.target!==c.currentTarget||[" ","Enter"].includes(c.key)&&i.onValueChange(o)}),onFocus:se(e.onFocus,()=>{let c=i.activationMode!=="manual";!u&&!r&&c&&i.onValueChange(o)})})})});Ji.displayName=$c;var Xc="TabsContent",Yi=V((e,t)=>{let{__scopeTabs:a,value:o,forceMount:r,children:n,...i}=e,s=$i(Xc,a),l=Zc(s.baseId,o),d=Jc(s.baseId,o),u=o===s.value,c=z(u);return H(()=>{let m=requestAnimationFrame(()=>c.current=!1);return()=>cancelAnimationFrame(m)},[]),L(Vt,{present:r||u,children:({present:m})=>L(oe.div,{"data-state":u?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":l,hidden:!m,id:d,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:c.current?"0s":void 0},children:m&&n})})});Yi.displayName=Xc;function Zc(e,t){return`${e}-trigger-${t}`}function Jc(e,t){return`${e}-content-${t}`}var ib=Xi,sb=Zi,lb=Ji,db=Yi;var Yc=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Qc=yr,na=(e,t)=>a=>{var o;if(t?.variants==null)return Qc(e,a?.class,a?.className);let{variants:r,defaultVariants:n}=t,i=Object.keys(r).map(d=>{let u=a?.[d],c=n?.[d];if(u===null)return null;let m=Yc(u)||Yc(c);return r[d][m]}),s=a&&Object.entries(a).reduce((d,u)=>{let[c,m]=u;return m===void 0||(d[c]=m),d},{}),l=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((d,u)=>{let{class:c,className:m,...h}=u;return Object.entries(h).every(x=>{let[p,g]=x;return Array.isArray(g)?g.includes({...n,...s}[p]):{...n,...s}[p]===g})?[...d,c,m]:d},[]);return Qc(e,i,l,a?.class,a?.className)};function ub(e,t){let a=getComputedStyle(e),o=parseFloat(a.fontSize);return t*o}function cb(e,t){let a=getComputedStyle(e.ownerDocument.documentElement),o=parseFloat(a.fontSize);return t*o}function fb(e){return e/100*window.innerHeight}function pb(e){return e/100*window.innerWidth}function mb(e){switch(typeof e){case"number":return[e,"px"];case"string":{let t=parseFloat(e);return e.endsWith("%")?[t,"%"]:e.endsWith("px")?[t,"px"]:e.endsWith("rem")?[t,"rem"]:e.endsWith("em")?[t,"em"]:e.endsWith("vh")?[t,"vh"]:e.endsWith("vw")?[t,"vw"]:[t,"%"]}}}function Zo({groupSize:e,panelElement:t,styleProp:a}){let o,[r,n]=mb(a);switch(n){case"%":{o=r/100*e;break}case"px":{o=r;break}case"rem":{o=cb(t,r);break}case"em":{o=ub(t,r);break}case"vh":{o=fb(r);break}case"vw":{o=pb(r);break}}return o}function Je(e){return parseFloat(e.toFixed(3))}function po({group:e}){let{orientation:t,panels:a}=e;return a.reduce((o,r)=>(o+=t==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,o),0)}function es(e){let{panels:t}=e,a=po({group:e});return a===0?t.map(o=>({groupResizeBehavior:o.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:o.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:o.panelConstraints.disabled,minSize:0,maxSize:100,panelId:o.id})):t.map(o=>{let{element:r,panelConstraints:n}=o,i=0;if(n.collapsedSize!==void 0){let u=Zo({groupSize:a,panelElement:r,styleProp:n.collapsedSize});i=Je(u/a*100)}let s;if(n.defaultSize!==void 0){let u=Zo({groupSize:a,panelElement:r,styleProp:n.defaultSize});s=Je(u/a*100)}let l=0;if(n.minSize!==void 0){let u=Zo({groupSize:a,panelElement:r,styleProp:n.minSize});l=Je(u/a*100)}let d=100;if(n.maxSize!==void 0){let u=Zo({groupSize:a,panelElement:r,styleProp:n.maxSize});d=Je(u/a*100)}return{groupResizeBehavior:n.groupResizeBehavior,collapsedSize:i,collapsible:n.collapsible===!0,defaultSize:s,disabled:n.disabled,minSize:l,maxSize:d,panelId:o.id}})}function Ie(e,t="Assertion error"){if(!e)throw Error(t)}function ts(e,t){return Array.from(t).sort(e==="horizontal"?gb:hb)}function gb(e,t){let a=e.element.offsetLeft-t.element.offsetLeft;return a!==0?a:e.element.offsetWidth-t.element.offsetWidth}function hb(e,t){let a=e.element.offsetTop-t.element.offsetTop;return a!==0?a:e.element.offsetHeight-t.element.offsetHeight}function xf(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function bf(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function vb({orientation:e,rects:t,targetRect:a}){let o={x:a.x+a.width/2,y:a.y+a.height/2},r,n=Number.MAX_VALUE;for(let i of t){let{x:s,y:l}=bf(o,i),d=e==="horizontal"?s:l;d<n&&(n=d,r=i)}return Ie(r,"No rect found"),r}var dn;function xb(){return dn===void 0&&(typeof matchMedia=="function"?dn=!!matchMedia("(pointer:coarse)").matches:dn=!1),dn}function wf(e){let{element:t,orientation:a,panels:o,separators:r}=e,n=ts(a,Array.from(t.children).filter(xf).map(x=>({element:x}))).map(({element:x})=>x),i=[],s=!1,l=!1,d=-1,u=-1,c=0,m,h=[];{let x=-1;for(let p of n)p.hasAttribute("data-panel")&&(x++,p.hasAttribute("data-disabled")||(c++,d===-1&&(d=x),u=x))}if(c>1){let x=-1;for(let p of n)if(p.hasAttribute("data-panel")){x++;let g=o.find(v=>v.element===p);if(g){if(m){let v=m.element.getBoundingClientRect(),w=p.getBoundingClientRect(),b;if(l){let C=a==="horizontal"?new DOMRect(v.right,v.top,0,v.height):new DOMRect(v.left,v.bottom,v.width,0),S=a==="horizontal"?new DOMRect(w.left,w.top,0,w.height):new DOMRect(w.left,w.top,w.width,0);switch(h.length){case 0:{b=[C,S];break}case 1:{let R=h[0],T=vb({orientation:a,rects:[v,w],targetRect:R.element.getBoundingClientRect()});b=[R,T===v?S:C];break}default:{b=h;break}}}else h.length?b=h:b=[a==="horizontal"?new DOMRect(v.right,w.top,w.left-v.right,w.height):new DOMRect(w.left,v.bottom,w.width,w.top-v.bottom)];for(let C of b){let S="width"in C?C:C.element.getBoundingClientRect(),R=xb()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(S.width<R){let I=R-S.width;S=new DOMRect(S.x-I/2,S.y,S.width+I,S.height)}if(S.height<R){let I=R-S.height;S=new DOMRect(S.x,S.y-I/2,S.width,S.height+I)}let T=x<=d||x>u;!s&&!T&&i.push({group:e,groupSize:po({group:e}),panels:[m,g],separator:"width"in C?void 0:C,rect:S}),s=!1}}l=!1,m=g,h=[]}}else if(p.hasAttribute("data-separator")){p.ariaDisabled!==null&&(s=!0);let g=r.find(v=>v.element===p);g?h.push(g):(m=void 0,h=[])}else l=!0}return i}var ia,fn=class{constructor(){qn(this,ia,{})}addListener(t,a){let o=$a(this,ia)[t];return o===void 0?$a(this,ia)[t]=[a]:o.includes(a)||o.push(a),()=>{this.removeListener(t,a)}}emit(t,a){let o=$a(this,ia)[t];if(o!==void 0)if(o.length===1)o[0].call(null,a);else{let r=!1,n=null,i=Array.from(o);for(let s=0;s<i.length;s++){let l=i[s];try{l.call(null,a)}catch(d){n===null&&(r=!0,n=d)}}if(r)throw n}}removeAllListeners(){jn(this,ia,{})}removeListener(t,a){let o=$a(this,ia)[t];if(o!==void 0){let r=o.indexOf(a);r>=0&&o.splice(r,1)}}};ia=new WeakMap;var co={cursorFlags:0,state:"inactive"},as=new fn;function ka(){return co}function bb(e){return as.addListener("change",e)}function wb(e){let t=co,a={...co};a.cursorFlags=e,co=a,as.emit("change",{prev:t,next:a})}function fo(e){let t=co;co=e,as.emit("change",{prev:t,next:e})}var yb=e=>e,Qi=()=>{},yf=1,Cf=2,Sf=4,Lf=8,ef=3,tf=12,un;function af(){return un===void 0&&(un=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(un=!0)),un}function Cb({cursorFlags:e,groups:t,state:a}){let o=0,r=0;switch(a){case"active":case"hover":t.forEach(n=>{if(!n.mutableState.disableCursor)switch(n.orientation){case"horizontal":{o++;break}case"vertical":{r++;break}}})}if(!(o===0&&r===0)){switch(a){case"active":{if(e&&af()){let n=(e&yf)!==0,i=(e&Cf)!==0,s=(e&Sf)!==0,l=(e&Lf)!==0;if(n)return s?"se-resize":l?"ne-resize":"e-resize";if(i)return s?"sw-resize":l?"nw-resize":"w-resize";if(s)return"s-resize";if(l)return"n-resize"}break}}return af()?o>0&&r>0?"move":o>0?"ew-resize":"ns-resize":o>0&&r>0?"grab":o>0?"col-resize":"row-resize"}}var of=new WeakMap;function os(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:a}=of.get(e)??{};a===void 0&&(a=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&(Object.isExtensible(e.adoptedStyleSheets)?e.adoptedStyleSheets.push(a):e.adoptedStyleSheets=[...e.adoptedStyleSheets,a]));let o=ka();switch(o.state){case"active":case"hover":{let r=Cb({cursorFlags:o.cursorFlags,groups:o.hitRegions.map(i=>i.group),state:o.state}),n=`*, *:hover {cursor: ${r} !important; }`;if(t===n)return;t=n,r?a.cssRules.length===0?a.insertRule(n):a.replaceSync(n):a.cssRules.length===1&&a.deleteRule(0);break}case"inactive":{t=void 0,a.cssRules.length===1&&a.deleteRule(0);break}}of.set(e,{prevStyle:t,styleSheet:a})}var Mt=new Map,If=new fn;function Sb(e){Mt=new Map(Mt),Mt.delete(e)}function rf(e,t){for(let[a]of Mt)if(a.id===e)return a}function sa(e,t){for(let[a,o]of Mt)if(a.id===e)return o;if(t)throw Error(`Could not find data for Group with id ${e}`)}function Ta(){return Mt}function rs(e,t){return If.addListener("groupChange",a=>{a.group.id===e&&t(a)})}function qt(e,t,a){let o=Mt.get(e);Mt=new Map(Mt),Mt.set(e,t),If.emit("groupChange",{group:e,isUserInteraction:a?.isUserInteraction===!0,prev:o,next:t})}function kf(e){let t=ka(),a=!1;return t.state==="active"&&(fo({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(os(e),a=!0,t.hitRegions.forEach(o=>{let r=sa(o.group.id,!0);qt(o.group,r,{isUserInteraction:!0})}))),a}function nf(e){e.defaultPrevented||kf(e.currentTarget)}function Lb(e,t,a){let o,r={x:1/0,y:1/0};for(let n of t){let i=bf(a,n.rect);switch(e){case"horizontal":{i.x<=r.x&&(o=n,r=i);break}case"vertical":{i.y<=r.y&&(o=n,r=i);break}}}return o?{distance:r,hitRegion:o}:void 0}function Ib(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function kb(e,t){if(e===t)throw new Error("Cannot compare node with itself");let a={a:df(e),b:df(t)},o;for(;a.a.at(-1)===a.b.at(-1);)o=a.a.pop(),a.b.pop();Ie(o,"Stacking order can only be calculated for elements with a common ancestor");let r={a:lf(sf(a.a)),b:lf(sf(a.b))};if(r.a===r.b){let n=o.childNodes,i={a:a.a.at(-1),b:a.b.at(-1)},s=n.length;for(;s--;){let l=n[s];if(l===i.a)return 1;if(l===i.b)return-1}}return Math.sign(r.a-r.b)}var Rb=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Pb(e){let t=getComputedStyle(Rf(e)??e).display;return t==="flex"||t==="inline-flex"}function Tb(e){let t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||Pb(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||Rb.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function sf(e){let t=e.length;for(;t--;){let a=e[t];if(Ie(a,"Missing node"),Tb(a))return a}return null}function lf(e){return e&&Number(getComputedStyle(e).zIndex)||0}function df(e){let t=[];for(;e;)t.push(e),e=Rf(e);return t}function Rf(e){let{parentNode:t}=e;return Ib(t)?t.host:t}function Mb(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function Ab({groupElement:e,hitRegion:t,pointerEventTarget:a}){if(!xf(a)||a.contains(e)||e.contains(a))return!0;if(kb(a,e)>0){let o=a;for(;o;){if(o.contains(e))return!0;if(Mb(o.getBoundingClientRect(),t))return!1;o=o.parentElement}}return!0}function ns(e,t){let a=[];return t.forEach((o,r)=>{if(r.disabled)return;let n=wf(r),i=Lb(r.orientation,n,{x:e.clientX,y:e.clientY});i&&i.distance.x<=0&&i.distance.y<=0&&Ab({groupElement:r.element,hitRegion:i.hitRegion.rect,pointerEventTarget:e.target})&&a.push(i.hitRegion)}),a}function Db(e,t){if(e.length!==t.length)return!1;for(let a=0;a<e.length;a++)if(e[a]!=t[a])return!1;return!0}function je(e,t,a=0){return Math.abs(Je(e)-Je(t))<=a}function Tt(e,t){return je(e,t)?0:e>t?1:-1}function uo({overrideDisabledPanels:e,panelConstraints:t,prevSize:a,size:o}){let{collapsedSize:r=0,collapsible:n,disabled:i,maxSize:s=100,minSize:l=0}=t;if(i&&!e)return a;if(Tt(o,l)<0)if(n){let d=(r+l)/2;Tt(o,d)<0?o=r:o=l}else o=l;return o=Math.min(s,o),o=Je(o),o}function Yo({delta:e,initialLayout:t,panelConstraints:a,pivotIndices:o,prevLayout:r,trigger:n}){if(je(e,0))return t;let i=n==="imperative-api",s=Object.values(t),l=Object.values(r),d=[...s],[u,c]=o;Ie(u!=null,"Invalid first pivot index"),Ie(c!=null,"Invalid second pivot index");let m=0;switch(n){case"keyboard":{{let p=e<0?c:u,g=a[p];Ie(g,`Panel constraints not found for index ${p}`);let{collapsedSize:v=0,collapsible:w,minSize:b=0}=g;if(w){let C=s[p];if(Ie(C!=null,`Previous layout not found for panel index ${p}`),je(C,v)){let S=b-C;Tt(S,Math.abs(e))>0&&(e=e<0?0-S:S)}}}{let p=e<0?u:c,g=a[p];Ie(g,`No panel constraints found for index ${p}`);let{collapsedSize:v=0,collapsible:w,minSize:b=0}=g;if(w){let C=s[p];if(Ie(C!=null,`Previous layout not found for panel index ${p}`),je(C,b)){let S=C-v;Tt(S,Math.abs(e))>0&&(e=e<0?0-S:S)}}}break}default:{let p=e<0?c:u,g=a[p];Ie(g,`Panel constraints not found for index ${p}`);let v=s[p],{collapsible:w,collapsedSize:b,minSize:C}=g;if(w&&Tt(v,C)<0)if(e>0){let S=C-b,R=S/2,T=v+e;Tt(T,C)<0&&(e=Tt(e,R)<=0?0:S)}else{let S=C-b,R=100-S/2,T=v-e;Tt(T,C)<0&&(e=Tt(100+e,R)>0?0:-S)}break}}{let p=e<0?1:-1,g=e<0?c:u,v=0;for(;;){let b=s[g];Ie(b!=null,`Previous layout not found for panel index ${g}`);let C=uo({overrideDisabledPanels:i,panelConstraints:a[g],prevSize:b,size:100})-b;if(v+=C,g+=p,g<0||g>=a.length)break}let w=Math.min(Math.abs(e),Math.abs(v));e=e<0?0-w:w}{let p=e<0?u:c;for(;p>=0&&p<a.length;){let g=Math.abs(e)-Math.abs(m),v=s[p];Ie(v!=null,`Previous layout not found for panel index ${p}`);let w=v-g,b=uo({overrideDisabledPanels:i,panelConstraints:a[p],prevSize:v,size:w});if(!je(v,b)&&(m+=v-b,d[p]=b,m.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?p--:p++}}if(Db(l,d))return r;{let p=e<0?c:u,g=s[p];Ie(g!=null,`Previous layout not found for panel index ${p}`);let v=g+m,w=uo({overrideDisabledPanels:i,panelConstraints:a[p],prevSize:g,size:v});if(d[p]=w,!je(w,v)){let b=v-w,C=e<0?c:u;for(;C>=0&&C<a.length;){let S=d[C];Ie(S!=null,`Previous layout not found for panel index ${C}`);let R=S+b,T=uo({overrideDisabledPanels:i,panelConstraints:a[C],prevSize:S,size:R});if(je(S,T)||(b-=T-S,d[C]=T),je(b,0))break;e>0?C--:C++}}}let h=Object.values(d).reduce((p,g)=>g+p,0);if(!je(h,100,.1))return r;let x=Object.keys(r);return d.reduce((p,g,v)=>(p[x[v]]=g,p),{})}function Ra(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let a in e)if(t[a]===void 0||Tt(e[a],t[a])!==0)return!1;return!0}function Pa({layout:e,panelConstraints:t}){let a=Object.values(e),o=[...a],r=o.reduce((s,l)=>s+l,0);if(o.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${o.map(s=>`${s}%`).join(", ")}`);if(!je(r,100)&&o.length>0)for(let s=0;s<t.length;s++){let l=o[s];Ie(l!=null,`No layout data found for index ${s}`);let d=100/r*l;o[s]=d}let n=0;for(let s=0;s<t.length;s++){let l=a[s];Ie(l!=null,`No layout data found for index ${s}`);let d=o[s];Ie(d!=null,`No layout data found for index ${s}`);let u=uo({overrideDisabledPanels:!0,panelConstraints:t[s],prevSize:l,size:d});d!=u&&(n+=d-u,o[s]=u)}if(!je(n,0))for(let s=0;s<t.length;s++){let l=o[s];Ie(l!=null,`No layout data found for index ${s}`);let d=l+n,u=uo({overrideDisabledPanels:!0,panelConstraints:t[s],prevSize:l,size:d});if(l!==u&&(n-=u-l,o[s]=u,je(n,0)))break}let i=Object.keys(e);return o.reduce((s,l,d)=>(s[i[d]]=l,s),{})}function Pf({groupId:e,panelId:t}){let a=()=>{let l=Ta();for(let[d,{defaultLayoutDeferred:u,derivedPanelConstraints:c,layout:m,groupSize:h,separatorToPanels:x}]of l)if(d.id===e)return{defaultLayoutDeferred:u,derivedPanelConstraints:c,group:d,groupSize:h,layout:m,separatorToPanels:x};throw Error(`Group ${e} not found`)},o=()=>{let l=a().derivedPanelConstraints.find(d=>d.panelId===t);if(l!==void 0)return l;throw Error(`Panel constraints not found for Panel ${t}`)},r=()=>{let l=a().group.panels.find(d=>d.id===t);if(l!==void 0)return l;throw Error(`Layout not found for Panel ${t}`)},n=()=>{let l=a().layout[t];if(l!==void 0)return l;throw Error(`Layout not found for Panel ${t}`)},i=({nextSize:l,panels:d,prevLayout:u,derivedPanelConstraints:c})=>{let m=n(),h=d.findIndex(g=>g.id===t),x=h===0,p=h===d.length-1;if(p&&l<m&&(x||d.slice(0,h).every((g,v)=>{let w=c[v];return w?.collapsible&&je(w.collapsedSize,u[w.panelId])}))){let g=d.slice(0,h).reduce((v,w)=>v+u[w.id],0);return{...u,[t]:Je(100-g)}}return Yo({delta:p?m-l:l-m,initialLayout:u,panelConstraints:c,pivotIndices:p?[h-1,h]:[h,h+1],prevLayout:u,trigger:"imperative-api"})},s=l=>{let d=n();if(l===d)return;let{defaultLayoutDeferred:u,derivedPanelConstraints:c,group:m,groupSize:h,layout:x,separatorToPanels:p}=a(),g=i({nextSize:l,panels:m.panels,prevLayout:x,derivedPanelConstraints:c}),v=Pa({layout:g,panelConstraints:c});Ra(x,v)||qt(m,{defaultLayoutDeferred:u,derivedPanelConstraints:c,groupSize:h,layout:v,separatorToPanels:p})};return{collapse:()=>{let{collapsible:l,collapsedSize:d}=o(),{mutableValues:u}=r(),c=n();l&&c!==d&&(u.expandToSize=c,s(d))},expand:()=>{let{collapsible:l,collapsedSize:d,minSize:u}=o(),{mutableValues:c}=r(),m=n();if(l&&m===d){let h=c.expandToSize??u;h===0&&(h=1),s(h)}},getSize:()=>{let{group:l}=a(),d=n(),{element:u}=r(),c=l.orientation==="horizontal"?u.offsetWidth:u.offsetHeight;return{asPercentage:d,inPixels:c}},isCollapsed:()=>{let{collapsible:l,collapsedSize:d}=o(),u=n();return l&&je(d,u)},resize:l=>{let{group:d}=a(),{element:u}=r(),c=po({group:d}),m=Zo({groupSize:c,panelElement:u,styleProp:l}),h=Je(m/c*100);s(h)}}}function uf(e){if(e.defaultPrevented)return;let t=Ta();ns(e,t).forEach(a=>{if(a.separator&&!a.separator.disableDoubleClick){let o=a.panels.find(r=>r.panelConstraints.defaultSize!==void 0);if(o){let r=o.panelConstraints.defaultSize,n=Pf({groupId:a.group.id,panelId:o.id});n&&r!==void 0&&(n.resize(r),e.preventDefault())}}})}function cn(e){let t=Ta();for(let[a]of t)if(a.separators.some(o=>o.element===e))return a;throw Error("Could not find parent Group for separator element")}function Tf({groupId:e}){let t=()=>{let a=Ta();for(let[o,r]of a)if(o.id===e)return{group:o,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:a,layout:o}=t();return a?{}:o},setLayout(a){let{defaultLayoutDeferred:o,derivedPanelConstraints:r,group:n,groupSize:i,layout:s,separatorToPanels:l}=t(),d=Pa({layout:a,panelConstraints:r});return o?s:(Ra(s,d)||qt(n,{defaultLayoutDeferred:o,derivedPanelConstraints:r,groupSize:i,layout:d,separatorToPanels:l}),d)}}}function Ia(e,t){let a=cn(e),o=sa(a.id,!0),r=a.separators.find(u=>u.element===e);Ie(r,"Matching separator not found");let n=o.separatorToPanels.get(r);Ie(n,"Matching panels not found");let i=n.map(u=>a.panels.indexOf(u)),s=Tf({groupId:a.id}).getLayout(),l=Yo({delta:t,initialLayout:s,panelConstraints:o.derivedPanelConstraints,pivotIndices:i,prevLayout:s,trigger:"keyboard"}),d=Pa({layout:l,panelConstraints:o.derivedPanelConstraints});Ra(s,d)||qt(a,{defaultLayoutDeferred:o.defaultLayoutDeferred,derivedPanelConstraints:o.derivedPanelConstraints,groupSize:o.groupSize,layout:d,separatorToPanels:o.separatorToPanels},{isUserInteraction:!0})}function cf(e){if(e.defaultPrevented)return;let t=e.currentTarget,a=cn(t);if(!a.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),a.orientation==="vertical"&&Ia(t,5);break}case"ArrowLeft":{e.preventDefault(),a.orientation==="horizontal"&&Ia(t,-5);break}case"ArrowRight":{e.preventDefault(),a.orientation==="horizontal"&&Ia(t,5);break}case"ArrowUp":{e.preventDefault(),a.orientation==="vertical"&&Ia(t,-5);break}case"End":{e.preventDefault(),Ia(t,100);break}case"Enter":{e.preventDefault();let o=cn(t),r=sa(o.id,!0),{derivedPanelConstraints:n,layout:i,separatorToPanels:s}=r,l=o.separators.find(m=>m.element===t);Ie(l,"Matching separator not found");let d=s.get(l);Ie(d,"Matching panels not found");let u=d[0],c=n.find(m=>m.panelId===u.id);if(Ie(c,"Panel metadata not found"),c.collapsible){let m=i[u.id],h=c.collapsedSize===m?o.mutableState.expandedPanelSizes[u.id]??c.minSize:c.collapsedSize;Ia(t,h-m)}break}case"F6":{e.preventDefault();let o=cn(t).separators.map(i=>i.element),r=Array.from(o).findIndex(i=>i===e.currentTarget);Ie(r!==null,"Index not found");let n=e.shiftKey?r>0?r-1:o.length-1:r+1<o.length?r+1:0;o[n].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),Ia(t,-100);break}}}function ff(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;let t=Ta(),a=ns(e,t),o=new Map,r=!1;a.forEach(n=>{n.separator&&(r||(r=!0,n.separator.element.focus({focusVisible:!1,preventScroll:!0})));let i=t.get(n.group);i&&o.set(n.group,i.layout)}),fo({cursorFlags:0,hitRegions:a,initialLayoutMap:o,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),a.length&&e.preventDefault()}function Mf({document:e,event:t,hitRegions:a,initialLayoutMap:o,mountedGroups:r,pointerDownAtPoint:n,prevCursorFlags:i}){let s=0;a.forEach(d=>{let{group:u,groupSize:c}=d,{orientation:m,panels:h}=u,{disableCursor:x}=u.mutableState,p=0;n?m==="horizontal"?p=(t.clientX-n.x)/c*100:p=(t.clientY-n.y)/c*100:m==="horizontal"?p=t.clientX<0?-100:100:p=t.clientY<0?-100:100;let g=o.get(u),v=r.get(u);if(!g||!v)return;let{defaultLayoutDeferred:w,derivedPanelConstraints:b,groupSize:C,layout:S,separatorToPanels:R}=v;if(b&&S&&R){let T=Yo({delta:p,initialLayout:g,panelConstraints:b,pivotIndices:d.panels.map(I=>h.indexOf(I)),prevLayout:S,trigger:"mouse-or-touch"});if(Ra(T,S)){if(p!==0&&!x)switch(m){case"horizontal":{s|=p<0?yf:Cf;break}case"vertical":{s|=p<0?Sf:Lf;break}}}else qt(d.group,{defaultLayoutDeferred:w,derivedPanelConstraints:b,groupSize:C,layout:T,separatorToPanels:R})}});let l=0;t.movementX===0?l|=i&ef:l|=s&ef,t.movementY===0?l|=i&tf:l|=s&tf,wb(l),os(e)}function pf(e){let t=Ta(),a=ka();a.state==="active"&&Mf({document:e.currentTarget,event:e,hitRegions:a.hitRegions,initialLayoutMap:a.initialLayoutMap,mountedGroups:t,prevCursorFlags:a.cursorFlags})}function mf(e){if(e.defaultPrevented)return;let t=ka(),a=Ta();switch(t.state){case"active":{if(e.buttons===0){fo({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(o=>{let r=sa(o.group.id,!0);qt(o.group,r,{isUserInteraction:!0})});return}for(let o of t.hitRegions)if(o.separator){let{element:r}=o.separator;r.hasPointerCapture?.(e.pointerId)||r.setPointerCapture?.(e.pointerId)}Mf({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:a,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{let o=ns(e,a);o.length===0?t.state!=="inactive"&&fo({cursorFlags:0,state:"inactive"}):fo({cursorFlags:0,hitRegions:o,state:"hover"}),os(e.currentTarget);break}}}function gf(e){e.relatedTarget instanceof HTMLIFrameElement&&ka().state==="hover"&&fo({cursorFlags:0,state:"inactive"})}function hf(e){e.defaultPrevented||e.pointerType==="mouse"&&e.button>0||kf(e.currentTarget)&&e.preventDefault()}function vf(e){let t=0,a=0,o={};for(let n of e)if(n.defaultSize!==void 0){t++;let i=Je(n.defaultSize);a+=i,o[n.panelId]=i}else o[n.panelId]=void 0;let r=e.length-t;if(r!==0){let n=Je((100-a)/r);for(let i of e)i.defaultSize===void 0&&(o[i.panelId]=n)}return o}function zb(e,t,a){if(!a[0])return;let o=e.panels.find(l=>l.element===t);if(!o||!o.onResize)return;let r=po({group:e}),n=e.orientation==="horizontal"?o.element.offsetWidth:o.element.offsetHeight,i=o.mutableValues.prevSize,s={asPercentage:Je(n/r*100),inPixels:n};o.mutableValues.prevSize=s,o.onResize(s,o.id,i)}function Eb(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let a in e)if(e[a]!==t[a])return!1;return!0}function Ob({group:e,nextGroupSize:t,prevGroupSize:a,prevLayout:o}){if(a<=0||t<=0||a===t)return o;let r=0,n=0,i=!1,s=new Map,l=[];for(let c of e.panels){let m=o[c.id]??0;if(c.panelConstraints.groupResizeBehavior==="preserve-pixel-size"){i=!0;let h=m/100*a,x=Je(h/t*100);s.set(c.id,x),r+=x}else l.push(c.id),n+=m}if(!i||l.length===0)return o;let d=100-r,u={...o};if(s.forEach((c,m)=>{u[m]=c}),n>0)for(let c of l){let m=o[c]??0;u[c]=Je(m/n*d)}else{let c=Je(d/l.length);for(let m of l)u[m]=c}return u}function Nb(e,t){let a=e.map(r=>r.id),o=Object.keys(t);if(a.length!==o.length)return!1;for(let r of a)if(!o.includes(r))return!1;return!0}var lo=new Map;function Fb(e){let t=!0;Ie(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");let a=e.element.ownerDocument.defaultView.ResizeObserver,o=new Set,r=new Set,n=new a(x=>{for(let p of x){let{borderBoxSize:g,target:v}=p;if(v===e.element){if(t){let w=po({group:e});if(w===0)return;let b=sa(e.id);if(!b)return;let C=es(e),S=b.defaultLayoutDeferred?vf(C):b.layout,R=Ob({group:e,nextGroupSize:w,prevGroupSize:b.groupSize,prevLayout:S}),T=Pa({layout:R,panelConstraints:C});if(!b.defaultLayoutDeferred&&Ra(b.layout,T)&&Eb(b.derivedPanelConstraints,C)&&b.groupSize===w)return;qt(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:C,groupSize:w,layout:T,separatorToPanels:b.separatorToPanels})}}else zb(e,v,g)}});n.observe(e.element),e.panels.forEach(x=>{Ie(!o.has(x.id),`Panel ids must be unique; id "${x.id}" was used more than once`),o.add(x.id),x.onResize&&n.observe(x.element)});let i=po({group:e}),s=es(e),l=e.panels.map(({id:x})=>x).join(","),d=e.mutableState.defaultLayout;d&&(Nb(e.panels,d)||(d=void 0));let u=e.mutableState.layouts[l]??d??vf(s),c=Pa({layout:u,panelConstraints:s}),m=e.element.ownerDocument;lo.set(m,(lo.get(m)??0)+1);let h=new Map;return wf(e).forEach(x=>{x.separator&&h.set(x.separator,x.panels)}),qt(e,{defaultLayoutDeferred:i===0,derivedPanelConstraints:s,groupSize:i,layout:c,separatorToPanels:h}),e.separators.forEach(x=>{Ie(!r.has(x.id),`Separator ids must be unique; id "${x.id}" was used more than once`),r.add(x.id),x.element.addEventListener("keydown",cf)}),lo.get(m)===1&&(m.addEventListener("contextmenu",nf,!0),m.addEventListener("dblclick",uf,!0),m.addEventListener("pointerdown",ff,!0),m.addEventListener("pointerleave",pf),m.addEventListener("pointermove",mf),m.addEventListener("pointerout",gf),m.addEventListener("pointerup",hf,!0)),function(){t=!1,lo.set(m,Math.max(0,(lo.get(m)??0)-1)),Sb(e),e.separators.forEach(x=>{x.element.removeEventListener("keydown",cf)}),lo.get(m)||(m.removeEventListener("contextmenu",nf,!0),m.removeEventListener("dblclick",uf,!0),m.removeEventListener("pointerdown",ff,!0),m.removeEventListener("pointerleave",pf),m.removeEventListener("pointermove",mf),m.removeEventListener("pointerout",gf),m.removeEventListener("pointerup",hf,!0)),n.disconnect()}}function Bb(){let[e,t]=M({}),a=Q(()=>t({}),[]);return[e,a]}function is(e){let t=Wn();return`${e??t}`}var Ma=typeof window<"u"?Ht:H;function Jo(e){let t=z(e);return Ma(()=>{t.current=e},[e]),Q((...a)=>t.current?.(...a),[t])}function ss(...e){return Jo(t=>{e.forEach(a=>{if(a)switch(typeof a){case"function":{a(t);break}case"object":{a.current=t;break}}})})}function ls(e){let t=z({...e});return Ma(()=>{for(let a in e)t.current[a]=e[a]},[e]),t.current}var Af=Ke(null);function Hb(e,t){let a=z({getLayout:()=>({}),setLayout:yb});br(t,()=>a.current,[]),Ma(()=>{Object.assign(a.current,Tf({groupId:e}))})}function Df({children:e,className:t,defaultLayout:a,disableCursor:o,disabled:r,elementRef:n,groupRef:i,id:s,onLayoutChange:l,onLayoutChanged:d,orientation:u="horizontal",resizeTargetMinimumSize:c={coarse:20,fine:10},style:m,...h}){let x=z({onLayoutChange:{},onLayoutChanged:{}}),p=Jo(D=>{Ra(x.current.onLayoutChange,D)||(x.current.onLayoutChange=D,l?.(D))}),g=Jo((D,O)=>{Ra(x.current.onLayoutChanged,D)||(x.current.onLayoutChanged=D,d?.(D,{isUserInteraction:O}))}),v=is(s),w=z(null),[b,C]=Bb(),S=z({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:c,separators:[]}),R=ss(w,n);Hb(v,i);let T=Jo((D,O)=>{let U=ka(),q=rf(D),k=sa(D);if(k){let A=!1;return U.state==="active"&&(A=U.hitRegions.some(j=>j.group===q)),{flexGrow:k.layout[O]??1,pointerEvents:A?"none":void 0}}if(a?.[O])return{flexGrow:a?.[O]}}),I=ls({defaultLayout:a,disableCursor:o}),F=me(()=>({get disableCursor(){return!!I.disableCursor},getPanelStyles:T,id:v,orientation:u,registerPanel:D=>{let O=S.current;return O.panels=ts(u,[...O.panels,D]),C(),()=>{O.panels=O.panels.filter(U=>U!==D),C()}},registerSeparator:D=>{let O=S.current;return O.separators=ts(u,[...O.separators,D]),C(),()=>{O.separators=O.separators.filter(U=>U!==D),C()}},updatePanelProps:(D,{disabled:O})=>{let U=S.current.panels.find(A=>A.id===D);U&&(U.panelConstraints.disabled=O);let q=rf(v),k=sa(v);q&&k&&qt(q,{...k,derivedPanelConstraints:es(q)})},updateSeparatorProps:(D,{disabled:O,disableDoubleClick:U})=>{let q=S.current.separators.find(k=>k.id===D);q&&(q.disabled=O,q.disableDoubleClick=U)}}),[T,v,C,u,I]),X=z(null);return Ma(()=>{let D=w.current;if(D===null)return;let O=S.current,U;if(I.defaultLayout!==void 0&&Object.keys(I.defaultLayout).length===O.panels.length){U={};for(let E of O.panels){let P=I.defaultLayout[E.id];P!==void 0&&(U[E.id]=P)}}let q={disabled:!!r,element:D,id:v,mutableState:{defaultLayout:U,disableCursor:!!I.disableCursor,expandedPanelSizes:S.current.lastExpandedPanelSizes,layouts:S.current.layouts},orientation:u,panels:O.panels,resizeTargetMinimumSize:O.resizeTargetMinimumSize,separators:O.separators};X.current=q;let k=Fb(q),{defaultLayoutDeferred:A,derivedPanelConstraints:j,layout:B}=sa(q.id,!0);!A&&j.length>0&&(p(B),g(B,!1));let te=rs(v,E=>{let{defaultLayoutDeferred:P,derivedPanelConstraints:_,layout:Y}=E.next;if(P||_.length===0)return;let be=q.panels.map(({id:ne})=>ne).join(",");q.mutableState.layouts[be]=Y,_.forEach(ne=>{if(ne.collapsible){let{layout:J}=E.prev??{};if(J){let fe=je(ne.collapsedSize,Y[ne.panelId]),de=je(ne.collapsedSize,J[ne.panelId]);fe&&!de&&(q.mutableState.expandedPanelSizes[ne.panelId]=J[ne.panelId])}}});let ie=ka().state!=="active";p(Y),ie&&g(Y,E.isUserInteraction)});return()=>{X.current=null,k(),te()}},[r,v,g,p,u,b,I]),H(()=>{let D=X.current;D&&(D.mutableState.defaultLayout=a,D.mutableState.disableCursor=!!o)}),L(Af.Provider,{value:F,children:L("div",{...h,className:t,"data-group":!0,"data-testid":v,id:v,ref:R,style:{height:"100%",width:"100%",overflow:"hidden",...m,display:"flex",flexDirection:u==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:u==="horizontal"?"pan-y":"pan-x"},children:e})})}Df.displayName="Group";function ds(){let e=Qe(Af);return Ie(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function _b(e,t){let{id:a}=ds(),o=z({collapse:Qi,expand:Qi,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Qi});br(t,()=>o.current,[]),Ma(()=>{Object.assign(o.current,Pf({groupId:a,panelId:e}))})}function zf({children:e,className:t,collapsedSize:a="0%",collapsible:o=!1,defaultSize:r,disabled:n,elementRef:i,groupResizeBehavior:s="preserve-relative-size",id:l,maxSize:d="100%",minSize:u="0%",onResize:c,panelRef:m,style:h,...x}){let p=!!l,g=is(l),v=ls({disabled:n}),w=z(null),b=ss(w,i),{getPanelStyles:C,id:S,orientation:R,registerPanel:T,updatePanelProps:I}=ds(),F=c!==null,X=Jo((q,k,A)=>{c?.(q,l,A)});Ma(()=>{let q=w.current;if(q!==null){let k={element:q,id:g,idIsStable:p,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:F?X:void 0,panelConstraints:{groupResizeBehavior:s,collapsedSize:a,collapsible:o,defaultSize:r,disabled:v.disabled,maxSize:d,minSize:u}};return T(k)}},[s,a,o,r,F,g,p,d,u,X,T,v]),H(()=>{I(g,{disabled:n})},[n,g,I]),_b(g,m);let D=()=>{let q=C(S,g);if(q)return JSON.stringify(q)},O=Gn(q=>rs(S,q),D,D),U;return O?U=JSON.parse(O):r!==void 0?U={flexGrow:void 0,flexShrink:void 0,flexBasis:r}:U={flexGrow:1},L("div",{...x,"data-disabled":n||void 0,"data-panel":!0,"data-testid":g,id:g,ref:b,style:{...Vb,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...U},children:L("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...h,touchAction:R==="horizontal"?"pan-y":"pan-x"},children:e})})}zf.displayName="Panel";var Vb={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function Ub({layout:e,panelConstraints:t,panelId:a,panelIndex:o}){let r,n,i=e[a],s=t.find(l=>l.panelId===a);if(s){let l=s.maxSize,d=s.collapsible?s.collapsedSize:s.minSize,u=[o,o+1];n=Pa({layout:Yo({delta:d-i,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[a],r=Pa({layout:Yo({delta:l-i,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[a]}return{valueControls:a,valueMax:r,valueMin:n,valueNow:i}}function Ef({children:e,className:t,disabled:a,disableDoubleClick:o,elementRef:r,id:n,style:i,...s}){let l=is(n),d=ls({disabled:a,disableDoubleClick:o}),[u,c]=M({}),[m,h]=M("inactive"),[x,p]=M(!1),g=z(null),v=ss(g,r),{disableCursor:w,id:b,orientation:C,registerSeparator:S,updateSeparatorProps:R}=ds(),T=C==="horizontal"?"vertical":"horizontal";Ma(()=>{let X=g.current;if(X!==null){let D={disabled:d.disabled,disableDoubleClick:d.disableDoubleClick,element:X,id:l},O=S(D),U=bb(k=>{h(k.next.state!=="inactive"&&k.next.hitRegions.some(A=>A.separator===D)?k.next.state:"inactive")}),q=rs(b,k=>{let{derivedPanelConstraints:A,layout:j,separatorToPanels:B}=k.next,te=B.get(D);if(te){let E=te[0],P=te.indexOf(E);c(Ub({layout:j,panelConstraints:A,panelId:E.id,panelIndex:P}))}});return()=>{U(),q(),O()}}},[b,l,S,d]),H(()=>{R(l,{disabled:a,disableDoubleClick:o})},[a,o,l,R]);let I;a&&!w&&(I="not-allowed");let F;return a?F="disabled":m==="active"?F="active":x?F="focus":F=m,L("div",{...s,"aria-controls":u.valueControls,"aria-disabled":a||void 0,"aria-orientation":T,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:e,className:t,"data-separator":F,"data-testid":l,id:l,onBlur:()=>p(!1),onFocus:()=>p(!0),ref:v,role:"separator",style:{flexBasis:"auto",cursor:I,...i,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:a?void 0:0})}Ef.displayName="Separator";function De(...e){return Ml(yr(e))}var jb=na("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function pn({className:e,variant:t="default",size:a="default",asChild:o=!1,...r}){let n=o?zo.Root:"button";return L(n,{"data-slot":"button","data-variant":t,"data-size":a,className:De(jb({variant:t,size:a,className:e})),...r})}var Wb=na("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function mo({className:e,variant:t="default",asChild:a=!1,...o}){let r=a?zo.Root:"span";return L(r,{"data-slot":"badge","data-variant":t,className:De(Wb({variant:t}),e),...o})}function it({className:e,size:t="default",...a}){return L("div",{"data-slot":"card","data-size":t,className:De("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...a})}function Qo({...e}){return L(vt.Root,{"data-slot":"dialog",...e})}function Gb({...e}){return L(vt.Portal,{"data-slot":"dialog-portal",...e})}function Kb({className:e,...t}){return L(vt.Overlay,{"data-slot":"dialog-overlay",className:De("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...t})}function er({className:e,children:t,showCloseButton:a=!0,...o}){return qe(Gb,{children:[L(Kb,{}),qe(vt.Content,{"data-slot":"dialog-content",className:De("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...o,children:[t,a&&L(vt.Close,{"data-slot":"dialog-close",asChild:!0,children:qe(pn,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm",children:[L(Ao,{}),L("span",{className:"sr-only",children:"Close"})]})})]})]})}function tr({className:e,...t}){return L("div",{"data-slot":"dialog-header",className:De("flex flex-col gap-2",e),...t})}function Of({className:e,showCloseButton:t=!1,children:a,...o}){return qe("div",{"data-slot":"dialog-footer",className:De("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",e),...o,children:[a,t&&L(vt.Close,{asChild:!0,children:L(pn,{variant:"outline",children:"Close"})})]})}function ar({className:e,...t}){return L(vt.Title,{"data-slot":"dialog-title",className:De("text-base leading-none font-medium",e),...t})}function or({className:e,...t}){return L(vt.Description,{"data-slot":"dialog-description",className:De("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}function Ye({className:e,type:t,...a}){return L("input",{type:t,"data-slot":"input",className:De("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...a})}function Aa({className:e,...t}){return L("textarea",{"data-slot":"textarea",className:De("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...t})}var Ik=na("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});var kk=na("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",sm:"","icon-xs":"size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function Nf({...e}){return L(Ze.Root,{"data-slot":"select",...e})}function Ff({...e}){return L(Ze.Value,{"data-slot":"select-value",...e})}function Bf({className:e,size:t="default",children:a,...o}){return qe(Ze.Trigger,{"data-slot":"select-trigger","data-size":t,className:De("flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...o,children:[a,L(Ze.Icon,{asChild:!0,children:L(Za,{className:"pointer-events-none size-4 text-muted-foreground"})})]})}function Hf({className:e,children:t,position:a="item-aligned",align:o="center",...r}){return L(Ze.Portal,{children:qe(Ze.Content,{"data-slot":"select-content","data-align-trigger":a==="item-aligned",className:De("relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:a,align:o,...r,children:[L($b,{}),L(Ze.Viewport,{"data-position":a,className:De("data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)",a==="popper"&&""),children:t}),L(Xb,{})]})})}function _f({className:e,children:t,...a}){return qe(Ze.Item,{"data-slot":"select-item",className:De("relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...a,children:[L("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center",children:L(Ze.ItemIndicator,{children:L(To,{className:"pointer-events-none"})})}),L(Ze.ItemText,{children:t})]})}function $b({className:e,...t}){return L(Ze.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:De("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...t,children:L(Mo,{})})}function Xb({className:e,...t}){return L(Ze.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:De("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...t,children:L(Za,{})})}var Rk=3600*24*7;var Pk=Ke(null);var Tk=na("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Vf({className:e,defaultValue:t,value:a,min:o=0,max:r=100,...n}){let i=me(()=>Array.isArray(a)?a:Array.isArray(t)?t:[o,r],[a,t,o,r]);return qe(La.Root,{"data-slot":"slider",defaultValue:t,value:a,min:o,max:r,className:De("relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col",e),...n,children:[L(La.Track,{"data-slot":"slider-track",className:"relative grow overflow-hidden rounded-full bg-muted data-horizontal:h-1 data-horizontal:w-full data-vertical:h-full data-vertical:w-1",children:L(La.Range,{"data-slot":"slider-range",className:"absolute bg-primary select-none data-horizontal:h-full data-vertical:w-full"})}),Array.from({length:i.length},(s,l)=>L(La.Thumb,{"data-slot":"slider-thumb",className:"relative block size-3 shrink-0 rounded-full border border-ring bg-white ring-ring/50 transition-[color,box-shadow] select-none after:absolute after:-inset-2 hover:ring-3 focus-visible:ring-3 focus-visible:outline-hidden active:ring-3 disabled:pointer-events-none disabled:opacity-50"},l))]})}function Uf({className:e,orientation:t="horizontal",...a}){return L(so.Root,{"data-slot":"tabs","data-orientation":t,className:De("group/tabs flex gap-2 data-horizontal:flex-col",e),...a})}var Zb=na("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function qf({className:e,variant:t="default",...a}){return L(so.List,{"data-slot":"tabs-list","data-variant":t,className:De(Zb({variant:t}),e),...a})}function us({className:e,...t}){return L(so.Trigger,{"data-slot":"tabs-trigger",className:De("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",e),...t})}var Mk=na("group/toggle inline-flex items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-muted"},size:{default:"h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",sm:"h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2"}},defaultVariants:{variant:"default",size:"default"}});var Ak=Ke({size:"default",variant:"default",spacing:2,orientation:"horizontal"});var ys=(e,t,a)=>{if(!t.has(e))throw TypeError("Cannot "+a)},y=(e,t,a)=>(ys(e,t,"read from private field"),a?a.call(e):t.get(e)),ce=(e,t,a)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,a)},He=(e,t,a,o)=>(ys(e,t,"write to private field"),o?o.call(e,a):t.set(e,a),a),Jb=(e,t,a,o)=>({set _(r){He(e,t,r,a)},get _(){return y(e,t,o)}}),he=(e,t,a)=>(ys(e,t,"access private method"),a),xe=new Uint8Array(8),Et=new DataView(xe.buffer),Ne=e=>[(e%256+256)%256],Ce=e=>(Et.setUint16(0,e,!1),[xe[0],xe[1]]),Yb=e=>(Et.setInt16(0,e,!1),[xe[0],xe[1]]),Wf=e=>(Et.setUint32(0,e,!1),[xe[1],xe[2],xe[3]]),G=e=>(Et.setUint32(0,e,!1),[xe[0],xe[1],xe[2],xe[3]]),Qb=e=>(Et.setInt32(0,e,!1),[xe[0],xe[1],xe[2],xe[3]]),Fa=e=>(Et.setUint32(0,Math.floor(e/2**32),!1),Et.setUint32(4,e,!1),[xe[0],xe[1],xe[2],xe[3],xe[4],xe[5],xe[6],xe[7]]),Cs=e=>(Et.setInt16(0,2**8*e,!1),[xe[0],xe[1]]),Dt=e=>(Et.setInt32(0,2**16*e,!1),[xe[0],xe[1],xe[2],xe[3]]),cs=e=>(Et.setInt32(0,2**30*e,!1),[xe[0],xe[1],xe[2],xe[3]]),ft=(e,t=!1)=>{let a=Array(e.length).fill(null).map((o,r)=>e.charCodeAt(r));return t&&a.push(0),a},bn=e=>e&&e[e.length-1],Ss=e=>{let t;for(let a of e)(!t||a.presentationTimestamp>t.presentationTimestamp)&&(t=a);return t},zt=(e,t,a=!0)=>{let o=e*t;return a?Math.round(o):o},Gf=e=>{let t=e*(Math.PI/180),a=Math.cos(t),o=Math.sin(t);return[a,o,0,-o,a,0,0,0,1]},Kf=Gf(0),$f=e=>[Dt(e[0]),Dt(e[1]),cs(e[2]),Dt(e[3]),Dt(e[4]),cs(e[5]),Dt(e[6]),Dt(e[7]),cs(e[8])],ir=e=>!e||typeof e!="object"?e:Array.isArray(e)?e.map(ir):Object.fromEntries(Object.entries(e).map(([t,a])=>[t,ir(a)])),xo=e=>e>=0&&e<2**32,ze=(e,t,a)=>({type:e,contents:t&&new Uint8Array(t.flat(10)),children:a}),Re=(e,t,a,o,r)=>ze(e,[Ne(t),Wf(a),o??[]],r),ew=e=>{let t=512;return e.fragmented?ze("ftyp",[ft("iso5"),G(t),ft("iso5"),ft("iso6"),ft("mp41")]):ze("ftyp",[ft("isom"),G(t),ft("isom"),e.holdsAvc?ft("avc1"):[],ft("mp41")])},fs=e=>({type:"mdat",largeSize:e}),tw=e=>({type:"free",size:e}),mn=(e,t,a=!1)=>ze("moov",null,[aw(t,e),...e.map(o=>ow(o,t)),a?Ew(e):null]),aw=(e,t)=>{let a=zt(Math.max(0,...t.filter(i=>i.samples.length>0).map(i=>{let s=Ss(i.samples);return s.presentationTimestamp+s.duration})),gs),o=Math.max(...t.map(i=>i.id))+1,r=!xo(e)||!xo(a),n=r?Fa:G;return Re("mvhd",+r,0,[n(e),n(e),G(gs),n(a),Dt(1),Cs(1),Array(10).fill(0),$f(Kf),Array(24).fill(0),G(o)])},ow=(e,t)=>ze("trak",null,[rw(e,t),nw(e,t)]),rw=(e,t)=>{let a=Ss(e.samples),o=zt(a?a.presentationTimestamp+a.duration:0,gs),r=!xo(t)||!xo(o),n=r?Fa:G,i;return e.info.type==="video"?i=typeof e.info.rotation=="number"?Gf(e.info.rotation):e.info.rotation:i=Kf,Re("tkhd",+r,3,[n(t),n(t),G(e.id),G(0),n(o),Array(8).fill(0),Ce(0),Ce(0),Cs(e.info.type==="audio"?1:0),Ce(0),$f(i),Dt(e.info.type==="video"?e.info.width:0),Dt(e.info.type==="video"?e.info.height:0)])},nw=(e,t)=>ze("mdia",null,[iw(e,t),sw(e.info.type==="video"?"vide":"soun"),lw(e)]),iw=(e,t)=>{let a=Ss(e.samples),o=zt(a?a.presentationTimestamp+a.duration:0,e.timescale),r=!xo(t)||!xo(o),n=r?Fa:G;return Re("mdhd",+r,0,[n(t),n(t),G(e.timescale),n(o),Ce(21956),Ce(0)])},sw=e=>Re("hdlr",0,0,[ft("mhlr"),ft(e),G(0),G(0),G(0),ft("mp4-muxer-hdlr",!0)]),lw=e=>ze("minf",null,[e.info.type==="video"?dw():uw(),cw(),mw(e)]),dw=()=>Re("vmhd",0,1,[Ce(0),Ce(0),Ce(0),Ce(0)]),uw=()=>Re("smhd",0,0,[Ce(0),Ce(0)]),cw=()=>ze("dinf",null,[fw()]),fw=()=>Re("dref",0,0,[G(1)],[pw()]),pw=()=>Re("url ",0,1),mw=e=>{let t=e.compositionTimeOffsetTable.length>1||e.compositionTimeOffsetTable.some(a=>a.sampleCompositionTimeOffset!==0);return ze("stbl",null,[gw(e),Pw(e),Tw(e),Mw(e),Aw(e),Dw(e),t?zw(e):null])},gw=e=>Re("stsd",0,0,[G(1)],[e.info.type==="video"?hw(jw[e.info.codec],e):Iw(Gw[e.info.codec],e)]),hw=(e,t)=>ze(e,[Array(6).fill(0),Ce(1),Ce(0),Ce(0),Array(12).fill(0),Ce(t.info.width),Ce(t.info.height),G(4718592),G(4718592),G(0),Ce(1),Array(32).fill(0),Ce(24),Yb(65535)],[Ww[t.info.codec](t),t.info.decoderConfig.colorSpace?ww(t):null]),vw={bt709:1,bt470bg:5,smpte170m:6},xw={bt709:1,smpte170m:6,"iec61966-2-1":13},bw={rgb:0,bt709:1,bt470bg:5,smpte170m:6},ww=e=>ze("colr",[ft("nclx"),Ce(vw[e.info.decoderConfig.colorSpace.primaries]),Ce(xw[e.info.decoderConfig.colorSpace.transfer]),Ce(bw[e.info.decoderConfig.colorSpace.matrix]),Ne((e.info.decoderConfig.colorSpace.fullRange?1:0)<<7)]),yw=e=>e.info.decoderConfig&&ze("avcC",[...new Uint8Array(e.info.decoderConfig.description)]),Cw=e=>e.info.decoderConfig&&ze("hvcC",[...new Uint8Array(e.info.decoderConfig.description)]),Sw=e=>{if(!e.info.decoderConfig)return null;let t=e.info.decoderConfig;if(!t.colorSpace)throw new Error("'colorSpace' is required in the decoder config for VP9.");let a=t.codec.split("."),o=Number(a[1]),r=Number(a[2]),s=(Number(a[3])<<4)+(0<<1)+Number(t.colorSpace.fullRange);return Re("vpcC",1,0,[Ne(o),Ne(r),Ne(s),Ne(2),Ne(2),Ne(2),Ce(0)])},Lw=()=>{let a=(1<<7)+1;return ze("av1C",[a,0,0,0])},Iw=(e,t)=>ze(e,[Array(6).fill(0),Ce(1),Ce(0),Ce(0),G(0),Ce(t.info.numberOfChannels),Ce(16),Ce(0),Ce(0),Dt(t.info.sampleRate)],[Kw[t.info.codec](t)]),kw=e=>{let t=new Uint8Array(e.info.decoderConfig.description);return Re("esds",0,0,[G(58753152),Ne(32+t.byteLength),Ce(1),Ne(0),G(75530368),Ne(18+t.byteLength),Ne(64),Ne(21),Wf(0),G(130071),G(130071),G(92307584),Ne(t.byteLength),...t,G(109084800),Ne(1),Ne(2)])},Rw=e=>{let t=3840,a=0,o=e.info.decoderConfig?.description;if(o){if(o.byteLength<18)throw new TypeError("Invalid decoder description provided for Opus; must be at least 18 bytes long.");let r=ArrayBuffer.isView(o)?new DataView(o.buffer,o.byteOffset,o.byteLength):new DataView(o);t=r.getUint16(10,!0),a=r.getInt16(14,!0)}return ze("dOps",[Ne(0),Ne(e.info.numberOfChannels),Ce(t),G(e.info.sampleRate),Cs(a),Ne(0)])},Pw=e=>Re("stts",0,0,[G(e.timeToSampleTable.length),e.timeToSampleTable.map(t=>[G(t.sampleCount),G(t.sampleDelta)])]),Tw=e=>{if(e.samples.every(a=>a.type==="key"))return null;let t=[...e.samples.entries()].filter(([,a])=>a.type==="key");return Re("stss",0,0,[G(t.length),t.map(([a])=>G(a+1))])},Mw=e=>Re("stsc",0,0,[G(e.compactlyCodedChunkTable.length),e.compactlyCodedChunkTable.map(t=>[G(t.firstChunk),G(t.samplesPerChunk),G(1)])]),Aw=e=>Re("stsz",0,0,[G(0),G(e.samples.length),e.samples.map(t=>G(t.size))]),Dw=e=>e.finalizedChunks.length>0&&bn(e.finalizedChunks).offset>=2**32?Re("co64",0,0,[G(e.finalizedChunks.length),e.finalizedChunks.map(t=>Fa(t.offset))]):Re("stco",0,0,[G(e.finalizedChunks.length),e.finalizedChunks.map(t=>G(t.offset))]),zw=e=>Re("ctts",0,0,[G(e.compositionTimeOffsetTable.length),e.compositionTimeOffsetTable.map(t=>[G(t.sampleCount),G(t.sampleCompositionTimeOffset)])]),Ew=e=>ze("mvex",null,e.map(Ow)),Ow=e=>Re("trex",0,0,[G(e.id),G(1),G(0),G(0),G(0)]),jf=(e,t)=>ze("moof",null,[Nw(e),...t.map(Fw)]),Nw=e=>Re("mfhd",0,0,[G(e)]),Xf=e=>{let t=0,a=0,o=0,r=0,n=e.type==="delta";return a|=+n,n?t|=1:t|=2,t<<24|a<<16|o<<8|r},Fw=e=>ze("traf",null,[Bw(e),Hw(e),_w(e)]),Bw=e=>{let t=0;t|=8,t|=16,t|=32,t|=131072;let a=e.currentChunk.samples[1]??e.currentChunk.samples[0],o={duration:a.timescaleUnitsToNextSample,size:a.size,flags:Xf(a)};return Re("tfhd",0,t,[G(e.id),G(o.duration),G(o.size),G(o.flags)])},Hw=e=>Re("tfdt",1,0,[Fa(zt(e.currentChunk.startTimestamp,e.timescale))]),_w=e=>{let t=e.currentChunk.samples.map(p=>p.timescaleUnitsToNextSample),a=e.currentChunk.samples.map(p=>p.size),o=e.currentChunk.samples.map(Xf),r=e.currentChunk.samples.map(p=>zt(p.presentationTimestamp-p.decodeTimestamp,e.timescale)),n=new Set(t),i=new Set(a),s=new Set(o),l=new Set(r),d=s.size===2&&o[0]!==o[1],u=n.size>1,c=i.size>1,m=!d&&s.size>1,h=l.size>1||[...l].some(p=>p!==0),x=0;return x|=1,x|=4*+d,x|=256*+u,x|=512*+c,x|=1024*+m,x|=2048*+h,Re("trun",1,x,[G(e.currentChunk.samples.length),G(e.currentChunk.offset-e.currentChunk.moofOffset||0),d?G(o[0]):[],e.currentChunk.samples.map((p,g)=>[u?G(t[g]):[],c?G(a[g]):[],m?G(o[g]):[],h?Qb(r[g]):[]])])},Vw=e=>ze("mfra",null,[...e.map(Uw),qw()]),Uw=(e,t)=>Re("tfra",1,0,[G(e.id),G(63),G(e.finalizedChunks.length),e.finalizedChunks.map(o=>[Fa(zt(o.startTimestamp,e.timescale)),Fa(o.moofOffset),G(t+1),G(1),G(1)])]),qw=()=>Re("mfro",0,0,[G(0)]),jw={avc:"avc1",hevc:"hvc1",vp9:"vp09",av1:"av01"},Ww={avc:yw,hevc:Cw,vp9:Sw,av1:Lw},Gw={aac:"mp4a",opus:"Opus"},Kw={aac:kw,opus:Rw};var In=class{},Ls=class extends In{constructor(){super(...arguments),this.buffer=null}},Zf=class extends In{constructor(e){if(super(),this.options=e,typeof e!="object")throw new TypeError("StreamTarget requires an options object to be passed to its constructor.");if(e.onData){if(typeof e.onData!="function")throw new TypeError("options.onData, when provided, must be a function.");if(e.onData.length<2)throw new TypeError("options.onData, when provided, must be a function that takes in at least two arguments (data and position). Ignoring the position argument, which specifies the byte offset at which the data is to be written, can lead to broken outputs.")}if(e.chunked!==void 0&&typeof e.chunked!="boolean")throw new TypeError("options.chunked, when provided, must be a boolean.");if(e.chunkSize!==void 0&&(!Number.isInteger(e.chunkSize)||e.chunkSize<1024))throw new TypeError("options.chunkSize, when provided, must be an integer and not smaller than 1024.")}},$w=class extends In{constructor(e,t){if(super(),this.stream=e,this.options=t,!(e instanceof FileSystemWritableFileStream))throw new TypeError("FileSystemWritableFileStreamTarget requires a FileSystemWritableFileStream instance.");if(t!==void 0&&typeof t!="object")throw new TypeError("FileSystemWritableFileStreamTarget's options, when provided, must be an object.");if(t&&t.chunkSize!==void 0&&(!Number.isInteger(t.chunkSize)||t.chunkSize<=0))throw new TypeError("options.chunkSize, when provided, must be a positive integer")}},Da,go,Jf=class{constructor(){this.pos=0,ce(this,Da,new Uint8Array(8)),ce(this,go,new DataView(y(this,Da).buffer)),this.offsets=new WeakMap}seek(e){this.pos=e}writeU32(e){y(this,go).setUint32(0,e,!1),this.write(y(this,Da).subarray(0,4))}writeU64(e){y(this,go).setUint32(0,Math.floor(e/2**32),!1),y(this,go).setUint32(4,e,!1),this.write(y(this,Da).subarray(0,8))}writeAscii(e){for(let t=0;t<e.length;t++)y(this,go).setUint8(t%8,e.charCodeAt(t)),t%8===7&&this.write(y(this,Da));e.length%8!==0&&this.write(y(this,Da).subarray(0,e.length%8))}writeBox(e){if(this.offsets.set(e,this.pos),e.contents&&!e.children)this.writeBoxHeader(e,e.size??e.contents.byteLength+8),this.write(e.contents);else{let t=this.pos;if(this.writeBoxHeader(e,0),e.contents&&this.write(e.contents),e.children)for(let r of e.children)r&&this.writeBox(r);let a=this.pos,o=e.size??a-t;this.seek(t),this.writeBoxHeader(e,o),this.seek(a)}}writeBoxHeader(e,t){this.writeU32(e.largeSize?1:t),this.writeAscii(e.type),e.largeSize&&this.writeU64(t)}measureBoxHeader(e){return 8+(e.largeSize?8:0)}patchBox(e){let t=this.pos;this.seek(this.offsets.get(e)),this.writeBox(e),this.seek(t)}measureBox(e){if(e.contents&&!e.children)return this.measureBoxHeader(e)+e.contents.byteLength;{let t=this.measureBoxHeader(e);if(e.contents&&(t+=e.contents.byteLength),e.children)for(let a of e.children)a&&(t+=this.measureBox(a));return t}}};Da=new WeakMap;go=new WeakMap;var gn,Na,cr,rr,hn,ps,Xw=class extends Jf{constructor(e){super(),ce(this,hn),ce(this,gn,void 0),ce(this,Na,new ArrayBuffer(2**16)),ce(this,cr,new Uint8Array(y(this,Na))),ce(this,rr,0),He(this,gn,e)}write(e){he(this,hn,ps).call(this,this.pos+e.byteLength),y(this,cr).set(e,this.pos),this.pos+=e.byteLength,He(this,rr,Math.max(y(this,rr),this.pos))}finalize(){he(this,hn,ps).call(this,this.pos),y(this,gn).buffer=y(this,Na).slice(0,Math.max(y(this,rr),this.pos))}};gn=new WeakMap;Na=new WeakMap;cr=new WeakMap;rr=new WeakMap;hn=new WeakSet;ps=function(e){let t=y(this,Na).byteLength;for(;t<e;)t*=2;if(t===y(this,Na).byteLength)return;let a=new ArrayBuffer(t),o=new Uint8Array(a);o.set(y(this,cr),0),He(this,Na,a),He(this,cr,o)};var Zw=2**24,Jw=2,sr,za,nr,Wt,lt,wn,ms,Is,Yf,ks,Qf,lr,yn,Rs=class extends Jf{constructor(e){super(),ce(this,wn),ce(this,Is),ce(this,ks),ce(this,lr),ce(this,sr,void 0),ce(this,za,[]),ce(this,nr,void 0),ce(this,Wt,void 0),ce(this,lt,[]),He(this,sr,e),He(this,nr,e.options?.chunked??!1),He(this,Wt,e.options?.chunkSize??Zw)}write(e){y(this,za).push({data:e.slice(),start:this.pos}),this.pos+=e.byteLength}flush(){if(y(this,za).length===0)return;let e=[],t=[...y(this,za)].sort((a,o)=>a.start-o.start);e.push({start:t[0].start,size:t[0].data.byteLength});for(let a=1;a<t.length;a++){let o=e[e.length-1],r=t[a];r.start<=o.start+o.size?o.size=Math.max(o.size,r.start+r.data.byteLength-o.start):e.push({start:r.start,size:r.data.byteLength})}for(let a of e){a.data=new Uint8Array(a.size);for(let o of y(this,za))a.start<=o.start&&o.start<a.start+a.size&&a.data.set(o.data,o.start-a.start);y(this,nr)?(he(this,wn,ms).call(this,a.data,a.start),he(this,lr,yn).call(this)):y(this,sr).options.onData?.(a.data,a.start)}y(this,za).length=0}finalize(){y(this,nr)&&he(this,lr,yn).call(this,!0)}};sr=new WeakMap;za=new WeakMap;nr=new WeakMap;Wt=new WeakMap;lt=new WeakMap;wn=new WeakSet;ms=function(e,t){let a=y(this,lt).findIndex(s=>s.start<=t&&t<s.start+y(this,Wt));a===-1&&(a=he(this,ks,Qf).call(this,t));let o=y(this,lt)[a],r=t-o.start,n=e.subarray(0,Math.min(y(this,Wt)-r,e.byteLength));o.data.set(n,r);let i={start:r,end:r+n.byteLength};if(he(this,Is,Yf).call(this,o,i),o.written[0].start===0&&o.written[0].end===y(this,Wt)&&(o.shouldFlush=!0),y(this,lt).length>Jw){for(let s=0;s<y(this,lt).length-1;s++)y(this,lt)[s].shouldFlush=!0;he(this,lr,yn).call(this)}n.byteLength<e.byteLength&&he(this,wn,ms).call(this,e.subarray(n.byteLength),t+n.byteLength)};Is=new WeakSet;Yf=function(e,t){let a=0,o=e.written.length-1,r=-1;for(;a<=o;){let n=Math.floor(a+(o-a+1)/2);e.written[n].start<=t.start?(a=n+1,r=n):o=n-1}for(e.written.splice(r+1,0,t),(r===-1||e.written[r].end<t.start)&&r++;r<e.written.length-1&&e.written[r].end>=e.written[r+1].start;)e.written[r].end=Math.max(e.written[r].end,e.written[r+1].end),e.written.splice(r+1,1)};ks=new WeakSet;Qf=function(e){let a={start:Math.floor(e/y(this,Wt))*y(this,Wt),data:new Uint8Array(y(this,Wt)),written:[],shouldFlush:!1};return y(this,lt).push(a),y(this,lt).sort((o,r)=>o.start-r.start),y(this,lt).indexOf(a)};lr=new WeakSet;yn=function(e=!1){for(let t=0;t<y(this,lt).length;t++){let a=y(this,lt)[t];if(!(!a.shouldFlush&&!e)){for(let o of a.written)y(this,sr).options.onData?.(a.data.subarray(o.start,o.end),a.start+o.start);y(this,lt).splice(t--,1)}}};var Yw=class extends Rs{constructor(e){super(new Zf({onData:(t,a)=>e.stream.write({type:"write",data:t,position:a}),chunked:!0,chunkSize:e.options?.chunkSize}))}},gs=1e3,Qw=["avc","hevc","vp9","av1"],ey=["aac","opus"],ty=2082844800,ay=["strict","offset","cross-track-offset"],ee,re,Cn,st,Ue,Be,ho,vo,Ps,Ea,Oa,dr,hs,ep,vs,tp,Ts,ap,xs,op,Ms,rp,vn,bs,At,jt,As,np,ur,Sn,Ln,Ds,bo,fr,xn,ws,ip=class{constructor(e){if(ce(this,hs),ce(this,vs),ce(this,Ts),ce(this,xs),ce(this,Ms),ce(this,vn),ce(this,At),ce(this,As),ce(this,ur),ce(this,Ln),ce(this,bo),ce(this,xn),ce(this,ee,void 0),ce(this,re,void 0),ce(this,Cn,void 0),ce(this,st,void 0),ce(this,Ue,null),ce(this,Be,null),ce(this,ho,Math.floor(Date.now()/1e3)+ty),ce(this,vo,[]),ce(this,Ps,1),ce(this,Ea,[]),ce(this,Oa,[]),ce(this,dr,!1),he(this,hs,ep).call(this,e),e.video=ir(e.video),e.audio=ir(e.audio),e.fastStart=ir(e.fastStart),this.target=e.target,He(this,ee,{firstTimestampBehavior:"strict",...e}),e.target instanceof Ls)He(this,re,new Xw(e.target));else if(e.target instanceof Zf)He(this,re,new Rs(e.target));else if(e.target instanceof $w)He(this,re,new Yw(e.target));else throw new Error(`Invalid target: ${e.target}`);he(this,xs,op).call(this),he(this,vs,tp).call(this)}addVideoChunk(e,t,a,o){if(!(e instanceof EncodedVideoChunk))throw new TypeError("addVideoChunk's first argument (sample) must be of type EncodedVideoChunk.");if(t&&typeof t!="object")throw new TypeError("addVideoChunk's second argument (meta), when provided, must be an object.");if(a!==void 0&&(!Number.isFinite(a)||a<0))throw new TypeError("addVideoChunk's third argument (timestamp), when provided, must be a non-negative real number.");if(o!==void 0&&!Number.isFinite(o))throw new TypeError("addVideoChunk's fourth argument (compositionTimeOffset), when provided, must be a real number.");let r=new Uint8Array(e.byteLength);e.copyTo(r),this.addVideoChunkRaw(r,e.type,a??e.timestamp,e.duration,t,o)}addVideoChunkRaw(e,t,a,o,r,n){if(!(e instanceof Uint8Array))throw new TypeError("addVideoChunkRaw's first argument (data) must be an instance of Uint8Array.");if(t!=="key"&&t!=="delta")throw new TypeError("addVideoChunkRaw's second argument (type) must be either 'key' or 'delta'.");if(!Number.isFinite(a)||a<0)throw new TypeError("addVideoChunkRaw's third argument (timestamp) must be a non-negative real number.");if(!Number.isFinite(o)||o<0)throw new TypeError("addVideoChunkRaw's fourth argument (duration) must be a non-negative real number.");if(r&&typeof r!="object")throw new TypeError("addVideoChunkRaw's fifth argument (meta), when provided, must be an object.");if(n!==void 0&&!Number.isFinite(n))throw new TypeError("addVideoChunkRaw's sixth argument (compositionTimeOffset), when provided, must be a real number.");if(he(this,xn,ws).call(this),!y(this,ee).video)throw new Error("No video track declared.");if(typeof y(this,ee).fastStart=="object"&&y(this,Ue).samples.length===y(this,ee).fastStart.expectedVideoChunks)throw new Error(`Cannot add more video chunks than specified in 'fastStart' (${y(this,ee).fastStart.expectedVideoChunks}).`);let i=he(this,vn,bs).call(this,y(this,Ue),e,t,a,o,r,n);if(y(this,ee).fastStart==="fragmented"&&y(this,Be)){for(;y(this,Oa).length>0&&y(this,Oa)[0].decodeTimestamp<=i.decodeTimestamp;){let s=y(this,Oa).shift();he(this,At,jt).call(this,y(this,Be),s)}i.decodeTimestamp<=y(this,Be).lastDecodeTimestamp?he(this,At,jt).call(this,y(this,Ue),i):y(this,Ea).push(i)}else he(this,At,jt).call(this,y(this,Ue),i)}addAudioChunk(e,t,a){if(!(e instanceof EncodedAudioChunk))throw new TypeError("addAudioChunk's first argument (sample) must be of type EncodedAudioChunk.");if(t&&typeof t!="object")throw new TypeError("addAudioChunk's second argument (meta), when provided, must be an object.");if(a!==void 0&&(!Number.isFinite(a)||a<0))throw new TypeError("addAudioChunk's third argument (timestamp), when provided, must be a non-negative real number.");let o=new Uint8Array(e.byteLength);e.copyTo(o),this.addAudioChunkRaw(o,e.type,a??e.timestamp,e.duration,t)}addAudioChunkRaw(e,t,a,o,r){if(!(e instanceof Uint8Array))throw new TypeError("addAudioChunkRaw's first argument (data) must be an instance of Uint8Array.");if(t!=="key"&&t!=="delta")throw new TypeError("addAudioChunkRaw's second argument (type) must be either 'key' or 'delta'.");if(!Number.isFinite(a)||a<0)throw new TypeError("addAudioChunkRaw's third argument (timestamp) must be a non-negative real number.");if(!Number.isFinite(o)||o<0)throw new TypeError("addAudioChunkRaw's fourth argument (duration) must be a non-negative real number.");if(r&&typeof r!="object")throw new TypeError("addAudioChunkRaw's fifth argument (meta), when provided, must be an object.");if(he(this,xn,ws).call(this),!y(this,ee).audio)throw new Error("No audio track declared.");if(typeof y(this,ee).fastStart=="object"&&y(this,Be).samples.length===y(this,ee).fastStart.expectedAudioChunks)throw new Error(`Cannot add more audio chunks than specified in 'fastStart' (${y(this,ee).fastStart.expectedAudioChunks}).`);let n=he(this,vn,bs).call(this,y(this,Be),e,t,a,o,r);if(y(this,ee).fastStart==="fragmented"&&y(this,Ue)){for(;y(this,Ea).length>0&&y(this,Ea)[0].decodeTimestamp<=n.decodeTimestamp;){let i=y(this,Ea).shift();he(this,At,jt).call(this,y(this,Ue),i)}n.decodeTimestamp<=y(this,Ue).lastDecodeTimestamp?he(this,At,jt).call(this,y(this,Be),n):y(this,Oa).push(n)}else he(this,At,jt).call(this,y(this,Be),n)}finalize(){if(y(this,dr))throw new Error("Cannot finalize a muxer more than once.");if(y(this,ee).fastStart==="fragmented"){for(let t of y(this,Ea))he(this,At,jt).call(this,y(this,Ue),t);for(let t of y(this,Oa))he(this,At,jt).call(this,y(this,Be),t);he(this,Ln,Ds).call(this,!1)}else y(this,Ue)&&he(this,ur,Sn).call(this,y(this,Ue)),y(this,Be)&&he(this,ur,Sn).call(this,y(this,Be));let e=[y(this,Ue),y(this,Be)].filter(Boolean);if(y(this,ee).fastStart==="in-memory"){let t;for(let o=0;o<2;o++){let r=mn(e,y(this,ho)),n=y(this,re).measureBox(r);t=y(this,re).measureBox(y(this,st));let i=y(this,re).pos+n+t;for(let s of y(this,vo)){s.offset=i;for(let{data:l}of s.samples)i+=l.byteLength,t+=l.byteLength}if(i<2**32)break;t>=2**32&&(y(this,st).largeSize=!0)}let a=mn(e,y(this,ho));y(this,re).writeBox(a),y(this,st).size=t,y(this,re).writeBox(y(this,st));for(let o of y(this,vo))for(let r of o.samples)y(this,re).write(r.data),r.data=null}else if(y(this,ee).fastStart==="fragmented"){let t=y(this,re).pos,a=Vw(e);y(this,re).writeBox(a);let o=y(this,re).pos-t;y(this,re).seek(y(this,re).pos-4),y(this,re).writeU32(o)}else{let t=y(this,re).offsets.get(y(this,st)),a=y(this,re).pos-t;y(this,st).size=a,y(this,st).largeSize=a>=2**32,y(this,re).patchBox(y(this,st));let o=mn(e,y(this,ho));if(typeof y(this,ee).fastStart=="object"){y(this,re).seek(y(this,Cn)),y(this,re).writeBox(o);let r=t-y(this,re).pos;y(this,re).writeBox(tw(r))}else y(this,re).writeBox(o)}he(this,bo,fr).call(this),y(this,re).finalize(),He(this,dr,!0)}};ee=new WeakMap;re=new WeakMap;Cn=new WeakMap;st=new WeakMap;Ue=new WeakMap;Be=new WeakMap;ho=new WeakMap;vo=new WeakMap;Ps=new WeakMap;Ea=new WeakMap;Oa=new WeakMap;dr=new WeakMap;hs=new WeakSet;ep=function(e){if(typeof e!="object")throw new TypeError("The muxer requires an options object to be passed to its constructor.");if(!(e.target instanceof In))throw new TypeError("The target must be provided and an instance of Target.");if(e.video){if(!Qw.includes(e.video.codec))throw new TypeError(`Unsupported video codec: ${e.video.codec}`);if(!Number.isInteger(e.video.width)||e.video.width<=0)throw new TypeError(`Invalid video width: ${e.video.width}. Must be a positive integer.`);if(!Number.isInteger(e.video.height)||e.video.height<=0)throw new TypeError(`Invalid video height: ${e.video.height}. Must be a positive integer.`);let t=e.video.rotation;if(typeof t=="number"&&![0,90,180,270].includes(t))throw new TypeError(`Invalid video rotation: ${t}. Has to be 0, 90, 180 or 270.`);if(Array.isArray(t)&&(t.length!==9||t.some(a=>typeof a!="number")))throw new TypeError(`Invalid video transformation matrix: ${t.join()}`);if(e.video.frameRate!==void 0&&(!Number.isInteger(e.video.frameRate)||e.video.frameRate<=0))throw new TypeError(`Invalid video frame rate: ${e.video.frameRate}. Must be a positive integer.`)}if(e.audio){if(!ey.includes(e.audio.codec))throw new TypeError(`Unsupported audio codec: ${e.audio.codec}`);if(!Number.isInteger(e.audio.numberOfChannels)||e.audio.numberOfChannels<=0)throw new TypeError(`Invalid number of audio channels: ${e.audio.numberOfChannels}. Must be a positive integer.`);if(!Number.isInteger(e.audio.sampleRate)||e.audio.sampleRate<=0)throw new TypeError(`Invalid audio sample rate: ${e.audio.sampleRate}. Must be a positive integer.`)}if(e.firstTimestampBehavior&&!ay.includes(e.firstTimestampBehavior))throw new TypeError(`Invalid first timestamp behavior: ${e.firstTimestampBehavior}`);if(typeof e.fastStart=="object"){if(e.video){if(e.fastStart.expectedVideoChunks===void 0)throw new TypeError("'fastStart' is an object but is missing property 'expectedVideoChunks'.");if(!Number.isInteger(e.fastStart.expectedVideoChunks)||e.fastStart.expectedVideoChunks<0)throw new TypeError("'expectedVideoChunks' must be a non-negative integer.")}if(e.audio){if(e.fastStart.expectedAudioChunks===void 0)throw new TypeError("'fastStart' is an object but is missing property 'expectedAudioChunks'.");if(!Number.isInteger(e.fastStart.expectedAudioChunks)||e.fastStart.expectedAudioChunks<0)throw new TypeError("'expectedAudioChunks' must be a non-negative integer.")}}else if(![!1,"in-memory","fragmented"].includes(e.fastStart))throw new TypeError("'fastStart' option must be false, 'in-memory', 'fragmented' or an object.");if(e.minFragmentDuration!==void 0&&(!Number.isFinite(e.minFragmentDuration)||e.minFragmentDuration<0))throw new TypeError("'minFragmentDuration' must be a non-negative number.")};vs=new WeakSet;tp=function(){if(y(this,re).writeBox(ew({holdsAvc:y(this,ee).video?.codec==="avc",fragmented:y(this,ee).fastStart==="fragmented"})),He(this,Cn,y(this,re).pos),y(this,ee).fastStart==="in-memory")He(this,st,fs(!1));else if(y(this,ee).fastStart!=="fragmented"){if(typeof y(this,ee).fastStart=="object"){let e=he(this,Ts,ap).call(this);y(this,re).seek(y(this,re).pos+e)}He(this,st,fs(!0)),y(this,re).writeBox(y(this,st))}he(this,bo,fr).call(this)};Ts=new WeakSet;ap=function(){if(typeof y(this,ee).fastStart!="object")return;let e=0,t=[y(this,ee).fastStart.expectedVideoChunks,y(this,ee).fastStart.expectedAudioChunks];for(let a of t)a&&(e+=8*Math.ceil(2/3*a),e+=4*a,e+=12*Math.ceil(2/3*a),e+=4*a,e+=8*a);return e+=4096,e};xs=new WeakSet;op=function(){if(y(this,ee).video&&He(this,Ue,{id:1,info:{type:"video",codec:y(this,ee).video.codec,width:y(this,ee).video.width,height:y(this,ee).video.height,rotation:y(this,ee).video.rotation??0,decoderConfig:null},timescale:y(this,ee).video.frameRate??57600,samples:[],finalizedChunks:[],currentChunk:null,firstDecodeTimestamp:void 0,lastDecodeTimestamp:-1,timeToSampleTable:[],compositionTimeOffsetTable:[],lastTimescaleUnits:null,lastSample:null,compactlyCodedChunkTable:[]}),y(this,ee).audio&&(He(this,Be,{id:y(this,ee).video?2:1,info:{type:"audio",codec:y(this,ee).audio.codec,numberOfChannels:y(this,ee).audio.numberOfChannels,sampleRate:y(this,ee).audio.sampleRate,decoderConfig:null},timescale:y(this,ee).audio.sampleRate,samples:[],finalizedChunks:[],currentChunk:null,firstDecodeTimestamp:void 0,lastDecodeTimestamp:-1,timeToSampleTable:[],compositionTimeOffsetTable:[],lastTimescaleUnits:null,lastSample:null,compactlyCodedChunkTable:[]}),y(this,ee).audio.codec==="aac")){let e=he(this,Ms,rp).call(this,2,y(this,ee).audio.sampleRate,y(this,ee).audio.numberOfChannels);y(this,Be).info.decoderConfig={codec:y(this,ee).audio.codec,description:e,numberOfChannels:y(this,ee).audio.numberOfChannels,sampleRate:y(this,ee).audio.sampleRate}}};Ms=new WeakSet;rp=function(e,t,a){let r=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350].indexOf(t),n=a,i="";i+=e.toString(2).padStart(5,"0"),i+=r.toString(2).padStart(4,"0"),r===15&&(i+=t.toString(2).padStart(24,"0")),i+=n.toString(2).padStart(4,"0");let s=Math.ceil(i.length/8)*8;i=i.padEnd(s,"0");let l=new Uint8Array(i.length/8);for(let d=0;d<i.length;d+=8)l[d/8]=parseInt(i.slice(d,d+8),2);return l};vn=new WeakSet;bs=function(e,t,a,o,r,n,i){let s=o/1e6,l=(o-(i??0))/1e6,d=r/1e6,u=he(this,As,np).call(this,s,l,e);return s=u.presentationTimestamp,l=u.decodeTimestamp,n?.decoderConfig&&(e.info.decoderConfig===null?e.info.decoderConfig=n.decoderConfig:Object.assign(e.info.decoderConfig,n.decoderConfig)),{presentationTimestamp:s,decodeTimestamp:l,duration:d,data:t,size:t.byteLength,type:a,timescaleUnitsToNextSample:zt(d,e.timescale)}};At=new WeakSet;jt=function(e,t){y(this,ee).fastStart!=="fragmented"&&e.samples.push(t);let a=zt(t.presentationTimestamp-t.decodeTimestamp,e.timescale);if(e.lastTimescaleUnits!==null){let r=zt(t.decodeTimestamp,e.timescale,!1),n=Math.round(r-e.lastTimescaleUnits);if(e.lastTimescaleUnits+=n,e.lastSample.timescaleUnitsToNextSample=n,y(this,ee).fastStart!=="fragmented"){let i=bn(e.timeToSampleTable);i.sampleCount===1?(i.sampleDelta=n,i.sampleCount++):i.sampleDelta===n?i.sampleCount++:(i.sampleCount--,e.timeToSampleTable.push({sampleCount:2,sampleDelta:n}));let s=bn(e.compositionTimeOffsetTable);s.sampleCompositionTimeOffset===a?s.sampleCount++:e.compositionTimeOffsetTable.push({sampleCount:1,sampleCompositionTimeOffset:a})}}else e.lastTimescaleUnits=0,y(this,ee).fastStart!=="fragmented"&&(e.timeToSampleTable.push({sampleCount:1,sampleDelta:zt(t.duration,e.timescale)}),e.compositionTimeOffsetTable.push({sampleCount:1,sampleCompositionTimeOffset:a}));e.lastSample=t;let o=!1;if(!e.currentChunk)o=!0;else{let r=t.presentationTimestamp-e.currentChunk.startTimestamp;if(y(this,ee).fastStart==="fragmented"){let n=y(this,Ue)??y(this,Be),i=y(this,ee).minFragmentDuration??1;e===n&&t.type==="key"&&r>=i&&(o=!0,he(this,Ln,Ds).call(this))}else o=r>=.5}o&&(e.currentChunk&&he(this,ur,Sn).call(this,e),e.currentChunk={startTimestamp:t.presentationTimestamp,samples:[]}),e.currentChunk.samples.push(t)};As=new WeakSet;np=function(e,t,a){let o=y(this,ee).firstTimestampBehavior==="strict",r=a.lastDecodeTimestamp===-1;if(o&&r&&t!==0)throw new Error(`The first chunk for your media track must have a timestamp of 0 (received DTS=${t}).Non-zero first timestamps are often caused by directly piping frames or audio data from a MediaStreamTrack into the encoder. Their timestamps are typically relative to the age of thedocument, which is probably what you want.
|
|
905
43
|
|
|
906
44
|
If you want to offset all timestamps of a track such that the first one is zero, set firstTimestampBehavior: 'offset' in the options.
|
|
907
|
-
`);if(x(this,$).firstTimestampBehavior==="offset"||x(this,$).firstTimestampBehavior==="cross-track-offset"){a.firstDecodeTimestamp===void 0&&(a.firstDecodeTimestamp=t);let i;x(this,$).firstTimestampBehavior==="offset"?i=a.firstDecodeTimestamp:i=Math.min(x(this,Ne)?.firstDecodeTimestamp??1/0,x(this,Oe)?.firstDecodeTimestamp??1/0),t-=i,e-=i}if(t<a.lastDecodeTimestamp)throw new Error(`Timestamps must be monotonically increasing (DTS went from ${a.lastDecodeTimestamp*1e6} to ${t*1e6}).`);return a.lastDecodeTimestamp=t,{presentationTimestamp:e,decodeTimestamp:t}};co=new WeakSet;Yo=function(e){if(x(this,$).fastStart==="fragmented")throw new Error("Can't finalize individual chunks if 'fastStart' is set to 'fragmented'.");if(e.currentChunk){if(e.finalizedChunks.push(e.currentChunk),x(this,Ma).push(e.currentChunk),(e.compactlyCodedChunkTable.length===0||Ko(e.compactlyCodedChunkTable).samplesPerChunk!==e.currentChunk.samples.length)&&e.compactlyCodedChunkTable.push({firstChunk:e.finalizedChunks.length,samplesPerChunk:e.currentChunk.samples.length}),x(this,$).fastStart==="in-memory"){e.currentChunk.offset=0;return}e.currentChunk.offset=x(this,ee).pos;for(let t of e.currentChunk.samples)x(this,ee).write(t.data),t.data=null;ue(this,Da,mo).call(this)}};Zo=new WeakSet;En=function(e=!0){if(x(this,$).fastStart!=="fragmented")throw new Error("Can't finalize a fragment unless 'fastStart' is set to 'fragmented'.");let t=[x(this,Ne),x(this,Oe)].filter(s=>s&&s.currentChunk);if(t.length===0)return;let a=Qm(this,Tn)._++;if(a===1){let s=Uo(t,x(this,Ta),!0);x(this,ee).writeBox(s)}let o=x(this,ee).pos,r=Bs(a,t);x(this,ee).writeBox(r);{let s=mn(!1),l=0;for(let c of t)for(let f of c.currentChunk.samples)l+=f.size;let u=x(this,ee).measureBox(s)+l;u>=2**32&&(s.largeSize=!0,u=x(this,ee).measureBox(s)+l),s.size=u,x(this,ee).writeBox(s)}for(let s of t){s.currentChunk.offset=x(this,ee).pos,s.currentChunk.moofOffset=o;for(let l of s.currentChunk.samples)x(this,ee).write(l.data),l.data=null}let n=x(this,ee).pos;x(this,ee).seek(x(this,ee).offsets.get(r));let i=Bs(a,t);x(this,ee).writeBox(i),x(this,ee).seek(n);for(let s of t)s.finalizedChunks.push(s.currentChunk),x(this,Ma).push(s.currentChunk),s.currentChunk=null;e&&ue(this,Da,mo).call(this)};Da=new WeakSet;mo=function(){x(this,ee)instanceof kn&&x(this,ee).flush()};Go=new WeakSet;wn=function(){if(x(this,uo))throw new Error("Cannot add new video or audio chunks after the file has been finalized.")};function On(){return typeof window<"u"&&"VideoEncoder"in window&&"VideoFrame"in window}async function nh(e,t,a,o){for(var r=["avc1.640028","avc1.4D0028","avc1.42E01E","avc1.42001f"],n=0;n<r.length;n++)try{var i=await VideoEncoder.isConfigSupported({codec:r[n],width:e,height:t,bitrate:o,framerate:a});if(i&&i.supported)return r[n]}catch{}return null}async function Zs(e,t,a){if(t=t||{},!On())throw new Error("\u8FD9\u4E2A\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 WebCodecs\uFF08\u8BF7\u7528\u8F83\u65B0\u7684 Chrome/Edge\uFF09\u3002");var o=t.fps||e.fps||30,r=Math.round((e.w||1280)*(t.scale||1)),n=Math.round((e.h||720)*(t.scale||1));r%2&&r++,n%2&&n++;var i=t.bitrate||Math.min(24e6,Math.max(2e6,Math.round(r*n*o*.2))),s=await nh(r,n,o,i);if(!s)throw new Error("\u8FD9\u4E2A\u8BBE\u5907\u65E0\u6CD5\u7528 WebCodecs \u7F16\u7801 H.264\u3002");var l=e.duration(),u=Math.max(1,Math.round(l*o)),c=document.createElement("canvas");c.width=r,c.height=n;var f=c.getContext("2d",{alpha:!1}),p=r/(e.w||r),g=n/(e.h||n),v=new Ys({target:new In,video:{codec:"avc",width:r,height:n,frameRate:o},fastStart:"in-memory"}),m=new VideoEncoder({output:function(P,M){v.addVideoChunk(P,M)},error:function(P){throw P}});m.configure({codec:s,width:r,height:n,bitrate:i,framerate:o});for(var h=Math.round(1e6/o),y=0;y<u;y++){var b=y/o;if(e.seekMedia)try{await e.seekMedia(Math.min(b,l))}catch{}f.save(),(p!==1||g!==1)&&f.scale(p,g),e.renderFrame(f,Math.min(b,l)),f.restore();var w=new VideoFrame(c,{timestamp:y*h,duration:h});if(m.encode(w,{keyFrame:y%(o*2)===0}),w.close(),a&&a(y/u),m.encodeQueueSize>8)for(await new Promise(function(P){setTimeout(P,0)});m.encodeQueueSize>4;)await new Promise(function(P){setTimeout(P,4)})}await m.flush(),v.finalize(),a&&a(1);var C=v.target.buffer;return new Blob([C],{type:"video/mp4"})}var Qs={add:{en:"Add","zh-Hans":"\u6DFB\u52A0"},addScene:{en:"Add scene","zh-Hans":"\u6DFB\u52A0\u573A\u666F"},allTargets:{en:"All targets","zh-Hans":"\u5168\u90E8\u76EE\u6807"},applyMotion:{en:"Apply motion","zh-Hans":"\u5E94\u7528\u52A8\u6548"},applySelected:{en:"Apply selected","zh-Hans":"\u5E94\u7528\u9009\u4E2D\u9879"},applyToHtml:{en:"Apply to HTML","zh-Hans":"\u5E94\u7528\u5230 HTML"},applyToVideo:{en:"Apply to video","zh-Hans":"\u5E94\u7528\u5230\u89C6\u9891"},appliesToTarget:{en:"applies to {target}","zh-Hans":"\u5E94\u7528\u5230 {target}"},archive:{en:"Archive","zh-Hans":"\u5F52\u6863"},artifact:{en:"Artifact","zh-Hans":"\u4EA7\u7269"},background:{en:"Background","zh-Hans":"\u80CC\u666F"},block:{en:"Block","zh-Hans":"\u5757"},brief:{en:"Brief","zh-Hans":"\u7B80\u4ECB"},card:{en:"Card","zh-Hans":"\u5361\u7247"},clearPath:{en:"Clear path","zh-Hans":"\u6E05\u9664\u8DEF\u5F84"},click:{en:"Click","zh-Hans":"\u70B9\u51FB"},close:{en:"Close","zh-Hans":"\u5173\u95ED"},code:{en:"Code","zh-Hans":"\u4EE3\u7801"},color:{en:"Color","zh-Hans":"\u989C\u8272"},create:{en:"Create","zh-Hans":"\u521B\u5EFA"},createOrSaveBeforeUpload:{en:"Create or save a Motion project before uploading media.","zh-Hans":"\u4E0A\u4F20\u5A92\u4F53\u524D\u8BF7\u5148\u521B\u5EFA\u6216\u4FDD\u5B58 Motion \u9879\u76EE\u3002"},createProject:{en:"Create project","zh-Hans":"\u521B\u5EFA\u9879\u76EE"},createVideo:{en:"Video","zh-Hans":"\u89C6\u9891"},createWeb:{en:"HTML","zh-Hans":"HTML"},currentProject:{en:"Current project","zh-Hans":"\u5F53\u524D\u9879\u76EE"},currentSelector:{en:"current selector","zh-Hans":"\u5F53\u524D\u9009\u62E9\u5668"},circle:{en:"Circle","zh-Hans":"\u5706\u5F62"},delete:{en:"Delete","zh-Hans":"\u5220\u9664"},delay:{en:"Delay","zh-Hans":"\u5EF6\u8FDF"},deviceDesktop:{en:"Desktop","zh-Hans":"\u684C\u9762"},deviceMobile:{en:"Mobile","zh-Hans":"\u624B\u673A"},deviceTablet:{en:"Tablet","zh-Hans":"\u5E73\u677F"},dirtyWarning:{en:"Unsaved edits are open. Save or reload before accepting agent updates.","zh-Hans":"\u5F53\u524D\u6709\u672A\u4FDD\u5B58\u7F16\u8F91\u3002\u4FDD\u5B58\u6216\u91CD\u65B0\u52A0\u8F7D\u540E\u518D\u63A5\u6536 Agent \u66F4\u65B0\u3002"},distance:{en:"Distance","zh-Hans":"\u8DDD\u79BB"},down:{en:"Down","zh-Hans":"\u4E0B\u79FB"},download:{en:"Download","zh-Hans":"\u4E0B\u8F7D"},duration:{en:"Duration","zh-Hans":"\u65F6\u957F"},draft:{en:"Draft","zh-Hans":"\u8349\u7A3F"},dragLayerHint:{en:"Drag a layer to move and keyframe it.","zh-Hans":"\u62D6\u52A8\u56FE\u5C42\u5373\u53EF\u79FB\u52A8\u5E76\u8BB0\u5F55\u5173\u952E\u5E27\u3002"},drawPathHint:{en:"Draw a path, then release to attach it to the selected layer.","zh-Hans":"\u7ED8\u5236\u8DEF\u5F84\uFF0C\u677E\u5F00\u540E\u7ED1\u5B9A\u5230\u9009\u4E2D\u56FE\u5C42\u3002"},editProjectHint:{en:"Create or switch projects from the dialog to keep the canvas focused.","zh-Hans":"\u901A\u8FC7\u5BF9\u8BDD\u6846\u521B\u5EFA\u6216\u5207\u6362\u9879\u76EE\uFF0C\u8BA9\u753B\u5E03\u4FDD\u6301\u805A\u7126\u3002"},export:{en:"Export","zh-Hans":"\u5BFC\u51FA"},exportHistory:{en:"Export history","zh-Hans":"\u5BFC\u51FA\u8BB0\u5F55"},exportHistoryDescription:{en:"Review generated artifacts for the current project and update project status.","zh-Hans":"\u67E5\u770B\u5F53\u524D\u9879\u76EE\u751F\u6210\u7684\u4EA7\u7269\uFF0C\u5E76\u66F4\u65B0\u9879\u76EE\u72B6\u6001\u3002"},exportMp4:{en:"Export MP4","zh-Hans":"\u5BFC\u51FA MP4"},exports:{en:"Exports","zh-Hans":"\u5BFC\u51FA"},filterAllStatuses:{en:"All statuses","zh-Hans":"\u5168\u90E8\u72B6\u6001"},filterAllSurfaces:{en:"All surfaces","zh-Hans":"\u5168\u90E8\u7C7B\u578B"},filterAllTargets:{en:"All targets","zh-Hans":"\u5168\u90E8\u76EE\u6807"},filterBackground:{en:"Background","zh-Hans":"\u80CC\u666F"},filterButton:{en:"Button","zh-Hans":"\u6309\u94AE"},filterCard:{en:"Card","zh-Hans":"\u5361\u7247"},filterImage:{en:"Image","zh-Hans":"\u56FE\u7247"},filterReady:{en:"Ready","zh-Hans":"\u53EF\u7528"},filterText:{en:"Text","zh-Hans":"\u6587\u672C"},filterVideo:{en:"Video","zh-Hans":"\u89C6\u9891"},filterVideoLayer:{en:"Video layer","zh-Hans":"\u89C6\u9891\u56FE\u5C42"},filterWeb:{en:"HTML / web","zh-Hans":"HTML / \u7F51\u9875"},convertedToLayerTemplate:{en:"converted to layer template","zh-Hans":"\u8F6C\u6362\u4E3A\u56FE\u5C42\u6A21\u677F"},firstAvailableLayer:{en:"first available layer","zh-Hans":"\u7B2C\u4E00\u4E2A\u53EF\u7528\u56FE\u5C42"},html:{en:"HTML Workbench","zh-Hans":"HTML \u5DE5\u4F5C\u53F0"},htmlFit:{en:"HTML fit","zh-Hans":"HTML \u9002\u914D"},htmlSaved:{en:"Motion HTML saved","zh-Hans":"Motion HTML \u5DF2\u4FDD\u5B58"},htmlSelection:{en:"HTML selection","zh-Hans":"HTML \u9009\u4E2D\u9879"},htmlTemplates:{en:"HTML templates","zh-Hans":"HTML \u6A21\u677F"},icons:{en:"Icons","zh-Hans":"\u56FE\u6807"},image:{en:"Image","zh-Hans":"\u56FE\u7247"},invalidCompositionJson:{en:"Invalid composition JSON","zh-Hans":"\u89C6\u9891\u7F16\u6392 JSON \u65E0\u6548"},keyframes:{en:"Keyframes","zh-Hans":"\u5173\u952E\u5E27"},keyframeDot:{en:"{properties} keyframe at {time}s","zh-Hans":"{properties} \u5173\u952E\u5E27\uFF0C{time}s"},keyframeLegend:{en:"Keyframe","zh-Hans":"\u5173\u952E\u5E27"},keyframeTimeline:{en:"Layer keyframes","zh-Hans":"\u56FE\u5C42\u5173\u952E\u5E27"},keyframeTimelineHelp:{en:"Each row is one layer. Click a track to seek; diamond points are saved keyframes.","zh-Hans":"\u6BCF\u884C\u5BF9\u5E94\u4E00\u4E2A\u56FE\u5C42\u3002\u70B9\u51FB\u8F68\u9053\u8DF3\u8F6C\u65F6\u95F4\uFF0C\u83F1\u5F62\u70B9\u662F\u5DF2\u8BB0\u5F55\u7684\u5173\u952E\u5E27\u3002"},kineticCharPop:{en:"Char pop","zh-Hans":"\u5B57\u7B26\u5F39\u51FA"},kineticCharRise:{en:"Char rise","zh-Hans":"\u5B57\u7B26\u4E0A\u5347"},kineticNone:{en:"None","zh-Hans":"\u65E0"},kineticText:{en:"Kinetic text","zh-Hans":"\u52A8\u6001\u6587\u5B57"},kineticTypewriter:{en:"Typewriter","zh-Hans":"\u6253\u5B57\u673A"},kineticWordRise:{en:"Word rise","zh-Hans":"\u8BCD\u7EC4\u4E0A\u5347"},layer:{en:"Layer","zh-Hans":"\u56FE\u5C42"},layerWithId:{en:"Layer {id}","zh-Hans":"\u56FE\u5C42 {id}"},layers:{en:"Layers","zh-Hans":"\u56FE\u5C42"},library:{en:"Motion Library","zh-Hans":"\u52A8\u6548\u5E93"},libraryHelp:{en:"Pick a recipe, preview its intent, then apply it to the selected HTML component or video layer.","zh-Hans":"\u9009\u62E9\u52A8\u6548\u914D\u65B9\uFF0C\u9884\u89C8\u610F\u56FE\uFF0C\u7136\u540E\u5E94\u7528\u5230\u9009\u4E2D\u7684 HTML \u7EC4\u4EF6\u6216\u89C6\u9891\u56FE\u5C42\u3002"},line:{en:"Line","zh-Hans":"\u76F4\u7EBF"},loading:{en:"Loading","zh-Hans":"\u52A0\u8F7D\u4E2D"},main:{en:"Main","zh-Hans":"\u4E3B\u753B\u9762"},manageProjects:{en:"Projects","zh-Hans":"\u9879\u76EE"},mediaUploaded:{en:"Motion media uploaded","zh-Hans":"Motion \u5A92\u4F53\u5DF2\u4E0A\u4F20"},mediaUploadNoSource:{en:"Motion media upload returned no source.","zh-Hans":"Motion \u5A92\u4F53\u4E0A\u4F20\u672A\u8FD4\u56DE\u53EF\u7528\u8D44\u6E90\u3002"},mappedFromRecipeIntent:{en:"mapped from recipe intent","zh-Hans":"\u7531\u914D\u65B9\u610F\u56FE\u6620\u5C04"},motion:{en:"Motion","zh-Hans":"Motion"},motionApplied:{en:"Motion attributes applied","zh-Hans":"\u52A8\u6548\u5C5E\u6027\u5DF2\u5E94\u7528"},motionLabel:{en:"Motion","zh-Hans":"\u52A8\u6548"},motionPath:{en:"Motion path","zh-Hans":"\u8FD0\u52A8\u8DEF\u5F84"},motionStyles:{en:"Motion styles","zh-Hans":"\u52A8\u6548\u6837\u5F0F"},motionVersion:{en:"Motion version","zh-Hans":"Motion \u7248\u672C"},mp4Exported:{en:"Motion MP4 exported","zh-Hans":"Motion MP4 \u5DF2\u5BFC\u51FA"},nameMotionPlaceholder:{en:"Name this motion...","zh-Hans":"\u547D\u540D\u8FD9\u4E2A\u52A8\u6548..."},nameStyleFirst:{en:"Name the motion style first.","zh-Hans":"\u8BF7\u5148\u547D\u540D\u52A8\u6548\u6837\u5F0F\u3002"},newProject:{en:"New project","zh-Hans":"\u65B0\u5EFA\u9879\u76EE"},newVideo:{en:"New video","zh-Hans":"\u65B0\u5EFA\u89C6\u9891"},newWeb:{en:"New HTML","zh-Hans":"\u65B0\u5EFA HTML"},nativeVideoRecipe:{en:"native video recipe","zh-Hans":"\u539F\u751F\u89C6\u9891\u914D\u65B9"},nativeWebRecipe:{en:"native web recipe","zh-Hans":"\u539F\u751F\u7F51\u9875\u914D\u65B9"},noExports:{en:"No exports","zh-Hans":"\u6682\u65E0\u5BFC\u51FA"},noKeyframes:{en:"No keyframes","zh-Hans":"\u6682\u65E0\u5173\u952E\u5E27"},noProjects:{en:"No projects","zh-Hans":"\u6682\u65E0\u9879\u76EE"},noRecipes:{en:"No recipes matched the current filters.","zh-Hans":"\u6CA1\u6709\u5339\u914D\u5F53\u524D\u7B5B\u9009\u7684\u52A8\u6548\u914D\u65B9\u3002"},noVersions:{en:"No versions","zh-Hans":"\u6682\u65E0\u7248\u672C"},oneRowPerLayer:{en:"One row per layer; dots are keyframes.","zh-Hans":"\u6BCF\u4E2A\u56FE\u5C42\u4E00\u884C\uFF0C\u5706\u70B9\u8868\u793A\u5173\u952E\u5E27\u3002"},open:{en:"Open","zh-Hans":"\u6253\u5F00"},path:{en:"Path","zh-Hans":"\u8DEF\u5F84"},preview:{en:"Preview","zh-Hans":"\u9884\u89C8"},previewFilmControl:{en:"Film preview","zh-Hans":"\u6574\u7247\u9884\u89C8"},previewFilmHelp:{en:"Play or scrub the whole composition; the canvas reflects this time.","zh-Hans":"\u64AD\u653E\u6216\u62D6\u52A8\u6574\u6BB5\u89C6\u9891\uFF0C\u753B\u5E03\u4F1A\u663E\u793A\u5BF9\u5E94\u65F6\u95F4\u3002"},preset:{en:"Preset","zh-Hans":"\u9884\u8BBE"},properties:{en:"Properties","zh-Hans":"\u5C5E\u6027"},projects:{en:"Projects","zh-Hans":"\u9879\u76EE"},artifactExported:{en:"Motion {kind} exported","zh-Hans":"Motion {kind} \u5DF2\u5BFC\u51FA"},projectCreated:{en:"{title} created","zh-Hans":"{title} \u5DF2\u521B\u5EFA"},projectDialogDescription:{en:"Create a new Motion project or switch to an existing draft.","zh-Hans":"\u521B\u5EFA\u65B0\u7684 Motion \u9879\u76EE\uFF0C\u6216\u5207\u6362\u5230\u5DF2\u6709\u8349\u7A3F\u3002"},projectDialogTitle:{en:"Motion projects","zh-Hans":"Motion \u9879\u76EE"},projectStatusUpdated:{en:"Motion project {status}","zh-Hans":"Motion \u9879\u76EE\u5DF2\u8BBE\u4E3A {status}"},projectSummary:{en:"{surface} \xB7 v{version} \xB7 {status}","zh-Hans":"{surface} \xB7 v{version} \xB7 {status}"},ready:{en:"Ready","zh-Hans":"\u5C31\u7EEA"},recipeApplied:{en:"Applied {name}","zh-Hans":"\u5DF2\u5E94\u7528 {name}"},recipeAppliedToHtml:{en:"Applied {name} to HTML","zh-Hans":"\u5DF2\u5C06 {name} \u5E94\u7528\u5230 HTML"},recipeAppliedToVideo:{en:"Applied {name} to video","zh-Hans":"\u5DF2\u5C06 {name} \u5E94\u7528\u5230\u89C6\u9891"},recipeSelectEmpty:{en:"Select a recipe to preview and apply it.","zh-Hans":"\u9009\u62E9\u4E00\u4E2A\u52A8\u6548\u914D\u65B9\u6765\u9884\u89C8\u5E76\u5E94\u7528\u3002"},recipeUsageSummary:{en:"{trigger} trigger for {htmlTarget}; {template} template for {videoTarget}.","zh-Hans":"{htmlTarget} \u4F7F\u7528 {trigger} \u89E6\u53D1\uFF1B{videoTarget} \u4F7F\u7528 {template} \u6A21\u677F\u3002"},referencedDraft:{en:"Current draft","zh-Hans":"\u5F53\u524D\u8349\u7A3F"},replayAllHint:{en:"Reload the preview and replay the whole page or composition.","zh-Hans":"\u91CD\u65B0\u52A0\u8F7D\u9884\u89C8\uFF0C\u5E76\u91CD\u64AD\u6574\u4E2A\u9875\u9762\u6216\u7F16\u6392\u3002"},replayMotion:{en:"Replay all","zh-Hans":"\u91CD\u64AD\u5168\u90E8"},recipes:{en:"Recipes","zh-Hans":"\u914D\u65B9"},restore:{en:"Restore","zh-Hans":"\u6062\u590D"},reviewed:{en:"Reviewed","zh-Hans":"\u5DF2\u5BA1\u6838"},save:{en:"Save","zh-Hans":"\u4FDD\u5B58"},saveCurrentVersion:{en:"Save current version","zh-Hans":"\u4FDD\u5B58\u5F53\u524D\u7248\u672C"},saveStyle:{en:"Save style","zh-Hans":"\u4FDD\u5B58\u6837\u5F0F"},sceneLength:{en:"Scene length","zh-Hans":"\u573A\u666F\u65F6\u957F"},sceneStrip:{en:"Scene strip","zh-Hans":"\u573A\u666F\u6BB5\u843D"},sceneStripHelp:{en:"Switch scenes, set transitions, and edit the current scene duration.","zh-Hans":"\u5207\u6362\u573A\u666F\u3001\u8BBE\u7F6E\u8F6C\u573A\uFF0C\u5E76\u8C03\u6574\u5F53\u524D\u573A\u666F\u65F6\u957F\u3002"},scenes:{en:"Scenes","zh-Hans":"\u573A\u666F"},scrub:{en:"Scrub","zh-Hans":"\u62D6\u52A8\u9884\u89C8"},search:{en:"Search","zh-Hans":"\u641C\u7D22"},selectedRecipe:{en:"Selected recipe","zh-Hans":"\u9009\u4E2D\u914D\u65B9"},select:{en:"Select","zh-Hans":"\u9009\u62E9"},selectElement:{en:"Select an element","zh-Hans":"\u9009\u62E9\u5143\u7D20"},selectElementFirst:{en:"Select an element in the preview first.","zh-Hans":"\u8BF7\u5148\u5728\u9884\u89C8\u4E2D\u9009\u62E9\u4E00\u4E2A\u5143\u7D20\u3002"},selectLayerFirst:{en:"Select or add a video layer before applying a Motion recipe.","zh-Hans":"\u5E94\u7528 Motion \u914D\u65B9\u524D\u8BF7\u5148\u9009\u62E9\u6216\u6DFB\u52A0\u89C6\u9891\u56FE\u5C42\u3002"},selectLayerHint:{en:"Click an element on the canvas, or a layer above, to select it.","zh-Hans":"\u70B9\u51FB\u753B\u5E03\u5143\u7D20\u6216\u4E0A\u65B9\u56FE\u5C42\u6765\u9009\u62E9\u3002"},sendToAssistant:{en:"Ask Assistant","zh-Hans":"\u8BE2\u95EE Assistant"},setProperty:{en:"Set {property}","zh-Hans":"\u8BBE\u7F6E {property}"},statusArchived:{en:"Archived","zh-Hans":"\u5DF2\u5F52\u6863"},statusDraft:{en:"Draft","zh-Hans":"\u8349\u7A3F"},statusReady:{en:"Ready","zh-Hans":"\u5C31\u7EEA"},statusReviewed:{en:"Reviewed","zh-Hans":"\u5DF2\u5BA1\u6838"},styleReady:{en:'Style "{name}" is ready to save from the main Motion style action.',"zh-Hans":"\u6837\u5F0F\u201C{name}\u201D\u53EF\u901A\u8FC7\u4E3B Motion \u6837\u5F0F\u64CD\u4F5C\u4FDD\u5B58\u3002"},templateAttention:{en:"Attention","zh-Hans":"\u5438\u5F15\u6CE8\u610F"},templateEmphasis:{en:"Emphasis","zh-Hans":"\u5F3A\u8C03"},templateEntrance:{en:"Entrance","zh-Hans":"\u5165\u573A"},templateExit:{en:"Exit","zh-Hans":"\u9000\u573A"},text:{en:"Text","zh-Hans":"\u6587\u672C"},timeline:{en:"Timeline","zh-Hans":"\u65F6\u95F4\u7EBF"},timelineCurrentTime:{en:"Current time","zh-Hans":"\u5F53\u524D\u65F6\u95F4"},timelinePause:{en:"Pause timeline","zh-Hans":"\u6682\u505C\u65F6\u95F4\u7EBF"},timelinePlay:{en:"Play timeline","zh-Hans":"\u64AD\u653E\u65F6\u95F4\u7EBF"},timelineRestraintWarning:{en:"More than four load motions start early; consider delaying or changing some triggers.","zh-Hans":"\u8D85\u8FC7\u56DB\u4E2A\u52A0\u8F7D\u52A8\u6548\u8FC7\u65E9\u5F00\u59CB\uFF1B\u5EFA\u8BAE\u5EF6\u8FDF\u6216\u8C03\u6574\u90E8\u5206\u89E6\u53D1\u65B9\u5F0F\u3002"},timelineScopeAll:{en:"All motions","zh-Hans":"\u5168\u90E8\u52A8\u6548"},timelineScopeSelection:{en:"Current selection","zh-Hans":"\u5F53\u524D\u9009\u4E2D"},title:{en:"Title","zh-Hans":"\u6807\u9898"},transitionCut:{en:"Cut","zh-Hans":"\u786C\u5207"},transitionDissolve:{en:"Dissolve","zh-Hans":"\u6EB6\u89E3"},transitionFade:{en:"Fade","zh-Hans":"\u6DE1\u5165\u6DE1\u51FA"},transitionPush:{en:"Push","zh-Hans":"\u63A8\u5165"},trigger:{en:"Trigger","zh-Hans":"\u89E6\u53D1"},triggerClick:{en:"On click","zh-Hans":"\u70B9\u51FB\u65F6"},triggerHover:{en:"On hover","zh-Hans":"\u60AC\u505C\u65F6"},triggerLoad:{en:"On load","zh-Hans":"\u52A0\u8F7D\u65F6"},triggerScroll:{en:"On scroll","zh-Hans":"\u6EDA\u52A8\u65F6"},undo:{en:"Undo","zh-Hans":"\u64A4\u9500"},untitled:{en:"Untitled","zh-Hans":"\u672A\u547D\u540D"},unsaved:{en:"Unsaved","zh-Hans":"\u672A\u4FDD\u5B58"},up:{en:"Up","zh-Hans":"\u4E0A\u79FB"},uploadLayerMedia:{en:"Upload layer media","zh-Hans":"\u4E0A\u4F20\u56FE\u5C42\u5A92\u4F53"},uploadReference:{en:"Upload reference","zh-Hans":"\u4E0A\u4F20\u53C2\u8003"},uploadVideoBackground:{en:"Upload video background","zh-Hans":"\u4E0A\u4F20\u89C6\u9891\u80CC\u666F"},version:{en:"Version","zh-Hans":"\u7248\u672C"},versionHistory:{en:"Version history","zh-Hans":"\u7248\u672C\u8BB0\u5F55"},versionHistoryDescription:{en:"Save a reviewable snapshot or restore a previous Motion project version.","zh-Hans":"\u4FDD\u5B58\u53EF\u5BA1\u9605\u5FEB\u7167\uFF0C\u6216\u6062\u590D\u4E4B\u524D\u7684 Motion \u9879\u76EE\u7248\u672C\u3002"},versionLabel:{en:"Version {number}","zh-Hans":"\u7248\u672C {number}"},versionRestored:{en:"Motion version restored","zh-Hans":"Motion \u7248\u672C\u5DF2\u6062\u590D"},versionSaved:{en:"Motion version saved","zh-Hans":"Motion \u7248\u672C\u5DF2\u4FDD\u5B58"},versions:{en:"Versions","zh-Hans":"\u7248\u672C"},video:{en:"Video Composer","zh-Hans":"\u89C6\u9891\u5408\u6210"},videoPause:{en:"Pause film preview","zh-Hans":"\u6682\u505C\u6574\u7247\u9884\u89C8"},videoPlay:{en:"Play film preview","zh-Hans":"\u64AD\u653E\u6574\u7247\u9884\u89C8"},videoLayer:{en:"video layer","zh-Hans":"\u89C6\u9891\u56FE\u5C42"},videoFit:{en:"Video fit","zh-Hans":"\u89C6\u9891\u9002\u914D"},videoSaved:{en:"Motion video composition saved","zh-Hans":"Motion \u89C6\u9891\u7F16\u6392\u5DF2\u4FDD\u5B58"},videoTemplates:{en:"Video templates","zh-Hans":"\u89C6\u9891\u6A21\u677F"},webCodecsUnavailable:{en:"WebCodecs MP4 export is not available in this browser.","zh-Hans":"\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 WebCodecs MP4 \u5BFC\u51FA\u3002"},workbenchHeaderLabel:{en:"Motion workbench header","zh-Hans":"Motion \u5DE5\u4F5C\u53F0\u5934\u90E8"}};function el(e){let a=String(e||"").toLowerCase().startsWith("zh")?"zh-Hans":"en";return(o,r)=>ih(Qs[o]?.[a]??Qs[o]?.en??o,r)}function xt(e,t){return e.map(a=>({value:a.value,label:t(a.labelKey)}))}function tl(e,t){return e==="projects"?t("projects"):e==="library"?t("library"):e==="html"?t("html"):e==="video"?t("video"):e==="versions"?t("versions"):e==="exports"?t("exports"):e}function er(e,t){return e==="load"?t("triggerLoad"):e==="scroll"?t("triggerScroll"):e==="hover"?t("triggerHover"):e==="click"?t("triggerClick"):e}function tr(e,t){if(!e)return t("draft");let a=e.toLowerCase();return a==="draft"?t("statusDraft"):a==="reviewed"?t("statusReviewed"):a==="archived"?t("statusArchived"):a==="ready"?t("statusReady"):e}function ih(e,t){return t?e.replace(/\{([a-zA-Z0-9_]+)\}/g,(a,o)=>t[o]===void 0?a:String(t[o])):e}var Fn=new Map,ar=new Map;function or(e){let t=Fe(e.w,1280),a=Fe(e.h,720),o=Fe(e.fps,30),r=Math.max(.5,Fe(e.duration,ol(e)));return{w:t,h:a,fps:o,duration:()=>r,preload:async()=>hh(e),seekMedia:async n=>vh(e,n),renderFrame(n,i){sh(n,e,{w:t,h:a,time:i,duration:r})}}}function sh(e,t,a){e.clearRect(0,0,a.w,a.h),al(e,t.bg||"#0f172a",a.w,a.h);let o=ph(t,a.time),r=Array.isArray(t.shared)?t.shared:[];Bn(e,t,o,a,r,1);let n=o.scene?.transition||"cut",i=Math.min(.65,o.duration/3);if(o.nextScene&&n!=="cut"&&o.localTime>o.duration-i){let s=rr((o.localTime-(o.duration-i))/i,0,1);n==="push"?(e.save(),e.translate(a.w*(1-s),0),Bn(e,t,{...o,scene:o.nextScene,localTime:0},a,r,1),e.restore()):Bn(e,t,{...o,scene:o.nextScene,localTime:0},a,r,s)}}function Bn(e,t,a,o,r,n){e.save(),e.globalAlpha*=n,a.scene?.bg&&al(e,a.scene.bg,o.w,o.h);let i=a.scene?a.scene.layers||[]:t.layers||[];for(let s of[...r,...i])lh(e,s,a.localTime,o);e.restore()}function al(e,t,a,o){if(/^linear-gradient/i.test(t)){let r=e.createLinearGradient(0,0,a,o);r.addColorStop(0,"#0f172a"),r.addColorStop(.45,"#2563eb"),r.addColorStop(1,"#14b8a6"),e.fillStyle=r}else e.fillStyle=t;e.fillRect(0,0,a,o)}function lh(e,t,a,o){let r=qe(t.start,0),n=qe(t.end,o.duration);if(a<r||a>n)return;let i=Math.max(0,a-r),s=oa(t,"x",i,qe(t.x,o.w/2)),l=oa(t,"y",i,qe(t.y,o.h/2)),u=oa(t,"offset",i,0),c=wh(t.path,u),f=c?.x??s,p=c?.y??l,g=rr(oa(t,"opacity",i,qe(t.opacity,1)),0,1),v=oa(t,"scale",i,qe(t.scale,1)),m=oa(t,"rotate",i,qe(t.rotate,0)),h=Math.max(0,oa(t,"blur",i,0));e.save(),e.globalAlpha=g,e.translate(f,p),e.rotate(m*Math.PI/180),e.scale(v,v),h>0&&(e.filter=`blur(${h}px)`),t.type==="video"&&t.src?mh(e,t):t.type==="image"&&t.src?fh(e,t):t.type==="ellipse"?ch(e,t):t.type==="rect"?uh(e,t):dh(e,t),e.restore()}function dh(e,t){let a=Fe(t.size,64),o=Fe(t.weight,800);e.font=`${o} ${a}px ${t.font||"Inter"}, ui-sans-serif, system-ui, sans-serif`,e.textAlign=t.align||"center",e.textBaseline="middle",e.fillStyle=t.color||"#ffffff",t.kinetic?.type==="char-rise"||t.kinetic?.type==="char-pop"?bh(e,t.text||"Motion",a,t):yh(e,t.text||"Motion",0,0,Fe(t.w,980),a*1.15)}function uh(e,t){let a=Fe(t.w,360),o=Fe(t.h,180);e.fillStyle=t.fill||t.color||t.bg||"#ffffff",Ch(e,-a/2,-o/2,a,o,Fe(t.radius,28)),e.fill()}function ch(e,t){e.fillStyle=t.fill||t.color||t.bg||"#22c55e",e.beginPath(),e.ellipse(0,0,Fe(t.w,220)/2,Fe(t.h,220)/2,0,0,Math.PI*2),e.fill()}function fh(e,t){let a=t.src?Fn.get(t.src):null,o=Fe(t.w,480),r=Fe(t.h,270);a&&a.complete?e.drawImage(a,-o/2,-r/2,o,r):(e.fillStyle="#e2e8f0",e.fillRect(-o/2,-r/2,o,r))}function mh(e,t){let a=t.src?ar.get(t.src):null,o=Fe(t.w,480),r=Fe(t.h,270);a&&a.readyState>=2?e.drawImage(a,-o/2,-r/2,o,r):(e.fillStyle="#020617",e.fillRect(-o/2,-r/2,o,r),e.fillStyle="#94a3b8",e.font="700 28px Inter, ui-sans-serif, system-ui, sans-serif",e.textAlign="center",e.textBaseline="middle",e.fillText("Video",0,0))}function ph(e,t){let a=Array.isArray(e.scenes)?e.scenes:[],o=0;for(let r=0;r<a.length;r+=1){let n=a[r],i=Fe(n.duration,3);if(t<=o+i)return{scene:n,sceneIndex:r,nextScene:a[r+1]||null,duration:i,localTime:Math.max(0,t-o)};o+=i}return{scene:null,sceneIndex:-1,nextScene:null,duration:ol(e),localTime:t}}function oa(e,t,a,o){let r=e.tracks?.[t];if(!Array.isArray(r)||r.length===0)return o;let n=r.filter(i=>typeof i=="object"&&i!==null).map(i=>({t:qe(i.t,0),v:qe(i.v,o),ease:i.ease})).sort((i,s)=>i.t-s.t);if(n.length===0||a<=n[0].t)return n[0]?.v??o;for(let i=1;i<n.length;i+=1){let s=n[i-1],l=n[i];if(a<=l.t){let u=Math.max(.001,l.t-s.t),c=rr((a-s.t)/u,0,1),f=l.ease==="ease-out"?1-Math.pow(1-c,3):l.ease==="ease-in"?c*c*c:c;return s.v+(l.v-s.v)*f}}return n[n.length-1].v}function hh(e){let t=Nn(e).filter(o=>o.type==="image"&&o.src).map(o=>String(o.src)),a=Nn(e).filter(o=>o.type==="video"&&o.src).map(o=>String(o.src));return Promise.all([...t.map(gh),...a.map(xh)]).then(()=>{})}function gh(e){return new Promise(t=>{if(Fn.has(e)){t();return}let a=new Image;a.crossOrigin="anonymous",a.onload=()=>{Fn.set(e,a),t()},a.onerror=()=>t(),a.src=e})}function xh(e){return new Promise(t=>{if(ar.has(e)){t();return}let a=document.createElement("video");a.crossOrigin="anonymous",a.muted=!0,a.preload="auto",a.playsInline=!0,a.onloadeddata=()=>{ar.set(e,a),t()},a.onerror=()=>t(),a.src=e})}function vh(e,t){let a=Nn(e).filter(o=>o.type==="video"&&o.src).map(o=>({layer:o,video:ar.get(String(o.src))})).filter(o=>!!o.video);return Promise.all(a.map(({layer:o,video:r})=>new Promise(n=>{let i=qe(o.start,0),s=Math.max(0,t-i);if(!Number.isFinite(r.duration)||Math.abs(r.currentTime-s)<.03){n();return}let l=()=>{r.removeEventListener("seeked",l),n()};r.addEventListener("seeked",l,{once:!0}),r.currentTime=o.loop&&Number.isFinite(r.duration)&&r.duration>0?s%r.duration:Math.min(s,r.duration||s),setTimeout(l,250)}))).then(()=>{})}function Nn(e){let t=[...e.layers||[],...e.shared||[]];for(let a of e.scenes||[])t.push(...a.layers||[]);return t}function ol(e){return Array.isArray(e.scenes)&&e.scenes.length>0?e.scenes.reduce((o,r)=>o+Fe(r.duration,3),0):(e.layers||[]).reduce((o,r)=>Math.max(o,qe(r.end,qe(r.start,0)+3)),0)||5}function yh(e,t,a,o,r,n){let i=t.split(/\s+/),s=[],l="";for(let c of i){let f=l?`${l} ${c}`:c;e.measureText(f).width>r&&l?(s.push(l),l=c):l=f}l&&s.push(l);let u=o-(s.length-1)*n/2;s.forEach((c,f)=>e.fillText(c,a,u+f*n))}function bh(e,t,a,o){let r=Array.from(t),i=-r.reduce((s,l)=>s+e.measureText(l).width,0)/2;r.forEach((s,l)=>{let u=e.measureText(s).width,c=o.kinetic?.type==="char-pop"?Math.sin(l*.85)*a*.08:-Math.sin(l*.55)*a*.05;e.fillText(s,i+u/2,c),i+=u})}function wh(e,t){let a=(e?.points||[]).map(u=>({x:qe(u.x,NaN),y:qe(u.y,NaN)})).filter(u=>Number.isFinite(u.x)&&Number.isFinite(u.y));if(a.length===0)return null;if(a.length===1)return a[0];let r=rr(t,0,1)*(a.length-1),n=Math.min(a.length-2,Math.floor(r)),i=r-n,s=a[n],l=a[n+1];return{x:s.x+(l.x-s.x)*i,y:s.y+(l.y-s.y)*i}}function Ch(e,t,a,o,r,n){let i=Math.min(n,o/2,r/2);e.beginPath(),e.moveTo(t+i,a),e.arcTo(t+o,a,t+o,a+r,i),e.arcTo(t+o,a+r,t,a+r,i),e.arcTo(t,a+r,t,a,i),e.arcTo(t,a,t+o,a,i),e.closePath()}function Fe(e,t){let a=Number(e);return Number.isFinite(a)&&a>0?a:t}function qe(e,t){let a=Number(e);return Number.isFinite(a)?a:t}function rr(e,t,a){return Math.min(a,Math.max(t,e))}var rl=["opacity","x","y","scale","rotate","blur"],Lh=`
|
|
45
|
+
`);if(y(this,ee).firstTimestampBehavior==="offset"||y(this,ee).firstTimestampBehavior==="cross-track-offset"){a.firstDecodeTimestamp===void 0&&(a.firstDecodeTimestamp=t);let i;y(this,ee).firstTimestampBehavior==="offset"?i=a.firstDecodeTimestamp:i=Math.min(y(this,Ue)?.firstDecodeTimestamp??1/0,y(this,Be)?.firstDecodeTimestamp??1/0),t-=i,e-=i}if(t<a.lastDecodeTimestamp)throw new Error(`Timestamps must be monotonically increasing (DTS went from ${a.lastDecodeTimestamp*1e6} to ${t*1e6}).`);return a.lastDecodeTimestamp=t,{presentationTimestamp:e,decodeTimestamp:t}};ur=new WeakSet;Sn=function(e){if(y(this,ee).fastStart==="fragmented")throw new Error("Can't finalize individual chunks if 'fastStart' is set to 'fragmented'.");if(e.currentChunk){if(e.finalizedChunks.push(e.currentChunk),y(this,vo).push(e.currentChunk),(e.compactlyCodedChunkTable.length===0||bn(e.compactlyCodedChunkTable).samplesPerChunk!==e.currentChunk.samples.length)&&e.compactlyCodedChunkTable.push({firstChunk:e.finalizedChunks.length,samplesPerChunk:e.currentChunk.samples.length}),y(this,ee).fastStart==="in-memory"){e.currentChunk.offset=0;return}e.currentChunk.offset=y(this,re).pos;for(let t of e.currentChunk.samples)y(this,re).write(t.data),t.data=null;he(this,bo,fr).call(this)}};Ln=new WeakSet;Ds=function(e=!0){if(y(this,ee).fastStart!=="fragmented")throw new Error("Can't finalize a fragment unless 'fastStart' is set to 'fragmented'.");let t=[y(this,Ue),y(this,Be)].filter(s=>s&&s.currentChunk);if(t.length===0)return;let a=Jb(this,Ps)._++;if(a===1){let s=mn(t,y(this,ho),!0);y(this,re).writeBox(s)}let o=y(this,re).pos,r=jf(a,t);y(this,re).writeBox(r);{let s=fs(!1),l=0;for(let u of t)for(let c of u.currentChunk.samples)l+=c.size;let d=y(this,re).measureBox(s)+l;d>=2**32&&(s.largeSize=!0,d=y(this,re).measureBox(s)+l),s.size=d,y(this,re).writeBox(s)}for(let s of t){s.currentChunk.offset=y(this,re).pos,s.currentChunk.moofOffset=o;for(let l of s.currentChunk.samples)y(this,re).write(l.data),l.data=null}let n=y(this,re).pos;y(this,re).seek(y(this,re).offsets.get(r));let i=jf(a,t);y(this,re).writeBox(i),y(this,re).seek(n);for(let s of t)s.finalizedChunks.push(s.currentChunk),y(this,vo).push(s.currentChunk),s.currentChunk=null;e&&he(this,bo,fr).call(this)};bo=new WeakSet;fr=function(){y(this,re)instanceof Rs&&y(this,re).flush()};xn=new WeakSet;ws=function(){if(y(this,dr))throw new Error("Cannot add new video or audio chunks after the file has been finalized.")};function zs(){return typeof window<"u"&&"VideoEncoder"in window&&"VideoFrame"in window}async function oy(e,t,a,o){for(var r=["avc1.640028","avc1.4D0028","avc1.42E01E","avc1.42001f"],n=0;n<r.length;n++)try{var i=await VideoEncoder.isConfigSupported({codec:r[n],width:e,height:t,bitrate:o,framerate:a});if(i&&i.supported)return r[n]}catch{}return null}async function sp(e,t,a){if(t=t||{},!zs())throw new Error("\u8FD9\u4E2A\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 WebCodecs\uFF08\u8BF7\u7528\u8F83\u65B0\u7684 Chrome/Edge\uFF09\u3002");var o=t.fps||e.fps||30,r=Math.round((e.w||1280)*(t.scale||1)),n=Math.round((e.h||720)*(t.scale||1));r%2&&r++,n%2&&n++;var i=t.bitrate||Math.min(24e6,Math.max(2e6,Math.round(r*n*o*.2))),s=await oy(r,n,o,i);if(!s)throw new Error("\u8FD9\u4E2A\u8BBE\u5907\u65E0\u6CD5\u7528 WebCodecs \u7F16\u7801 H.264\u3002");var l=e.duration(),d=Math.max(1,Math.round(l*o)),u=document.createElement("canvas");u.width=r,u.height=n;var c=u.getContext("2d",{alpha:!1}),m=r/(e.w||r),h=n/(e.h||n),x=new ip({target:new Ls,video:{codec:"avc",width:r,height:n,frameRate:o},fastStart:"in-memory"}),p=new VideoEncoder({output:function(S,R){x.addVideoChunk(S,R)},error:function(S){throw S}});p.configure({codec:s,width:r,height:n,bitrate:i,framerate:o});for(var g=Math.round(1e6/o),v=0;v<d;v++){var w=v/o;if(e.seekMedia)try{await e.seekMedia(Math.min(w,l))}catch{}c.save(),(m!==1||h!==1)&&c.scale(m,h),e.renderFrame(c,Math.min(w,l)),c.restore();var b=new VideoFrame(u,{timestamp:v*g,duration:g});if(p.encode(b,{keyFrame:v%(o*2)===0}),b.close(),a&&a(v/d),p.encodeQueueSize>8)for(await new Promise(function(S){setTimeout(S,0)});p.encodeQueueSize>4;)await new Promise(function(S){setTimeout(S,4)})}await p.flush(),x.finalize(),a&&a(1);var C=x.target.buffer;return new Blob([C],{type:"video/mp4"})}var lp={add:{en:"Add","zh-Hans":"\u6DFB\u52A0"},addScene:{en:"Add scene","zh-Hans":"\u6DFB\u52A0\u573A\u666F"},allTargets:{en:"All targets","zh-Hans":"\u5168\u90E8\u76EE\u6807"},applyMotion:{en:"Apply motion","zh-Hans":"\u5E94\u7528\u52A8\u6548"},applySelected:{en:"Apply selected","zh-Hans":"\u5E94\u7528\u9009\u4E2D\u9879"},applyToHtml:{en:"Apply to HTML","zh-Hans":"\u5E94\u7528\u5230 HTML"},applyToVideo:{en:"Apply to video","zh-Hans":"\u5E94\u7528\u5230\u89C6\u9891"},appliesToTarget:{en:"applies to {target}","zh-Hans":"\u5E94\u7528\u5230 {target}"},archive:{en:"Archive","zh-Hans":"\u5F52\u6863"},artifact:{en:"Artifact","zh-Hans":"\u4EA7\u7269"},background:{en:"Background","zh-Hans":"\u80CC\u666F"},block:{en:"Block","zh-Hans":"\u5757"},brief:{en:"Brief","zh-Hans":"\u7B80\u4ECB"},card:{en:"Card","zh-Hans":"\u5361\u7247"},clearPath:{en:"Clear path","zh-Hans":"\u6E05\u9664\u8DEF\u5F84"},click:{en:"Click","zh-Hans":"\u70B9\u51FB"},close:{en:"Close","zh-Hans":"\u5173\u95ED"},code:{en:"Code","zh-Hans":"\u4EE3\u7801"},color:{en:"Color","zh-Hans":"\u989C\u8272"},create:{en:"Create","zh-Hans":"\u521B\u5EFA"},createOrSaveBeforeUpload:{en:"Create or save a Motion project before uploading media.","zh-Hans":"\u4E0A\u4F20\u5A92\u4F53\u524D\u8BF7\u5148\u521B\u5EFA\u6216\u4FDD\u5B58 Motion \u9879\u76EE\u3002"},createProject:{en:"Create project","zh-Hans":"\u521B\u5EFA\u9879\u76EE"},createVideo:{en:"Video","zh-Hans":"\u89C6\u9891"},createWeb:{en:"HTML","zh-Hans":"HTML"},currentProject:{en:"Current project","zh-Hans":"\u5F53\u524D\u9879\u76EE"},currentSelector:{en:"current selector","zh-Hans":"\u5F53\u524D\u9009\u62E9\u5668"},circle:{en:"Circle","zh-Hans":"\u5706\u5F62"},delete:{en:"Delete","zh-Hans":"\u5220\u9664"},delay:{en:"Delay","zh-Hans":"\u5EF6\u8FDF"},deviceDesktop:{en:"Desktop","zh-Hans":"\u684C\u9762"},deviceMobile:{en:"Mobile","zh-Hans":"\u624B\u673A"},deviceTablet:{en:"Tablet","zh-Hans":"\u5E73\u677F"},dirtyWarning:{en:"Unsaved edits are open. Save or reload before accepting agent updates.","zh-Hans":"\u5F53\u524D\u6709\u672A\u4FDD\u5B58\u7F16\u8F91\u3002\u4FDD\u5B58\u6216\u91CD\u65B0\u52A0\u8F7D\u540E\u518D\u63A5\u6536 Agent \u66F4\u65B0\u3002"},distance:{en:"Distance","zh-Hans":"\u8DDD\u79BB"},down:{en:"Down","zh-Hans":"\u4E0B\u79FB"},download:{en:"Download","zh-Hans":"\u4E0B\u8F7D"},duration:{en:"Duration","zh-Hans":"\u65F6\u957F"},draft:{en:"Draft","zh-Hans":"\u8349\u7A3F"},dragLayerHint:{en:"Drag a layer to move and keyframe it.","zh-Hans":"\u62D6\u52A8\u56FE\u5C42\u5373\u53EF\u79FB\u52A8\u5E76\u8BB0\u5F55\u5173\u952E\u5E27\u3002"},drawPathHint:{en:"Draw a path, then release to attach it to the selected layer.","zh-Hans":"\u7ED8\u5236\u8DEF\u5F84\uFF0C\u677E\u5F00\u540E\u7ED1\u5B9A\u5230\u9009\u4E2D\u56FE\u5C42\u3002"},editProjectHint:{en:"Create or switch projects from the dialog to keep the canvas focused.","zh-Hans":"\u901A\u8FC7\u5BF9\u8BDD\u6846\u521B\u5EFA\u6216\u5207\u6362\u9879\u76EE\uFF0C\u8BA9\u753B\u5E03\u4FDD\u6301\u805A\u7126\u3002"},export:{en:"Export","zh-Hans":"\u5BFC\u51FA"},exportHistory:{en:"Export history","zh-Hans":"\u5BFC\u51FA\u8BB0\u5F55"},exportHistoryDescription:{en:"Review generated artifacts for the current project and update project status.","zh-Hans":"\u67E5\u770B\u5F53\u524D\u9879\u76EE\u751F\u6210\u7684\u4EA7\u7269\uFF0C\u5E76\u66F4\u65B0\u9879\u76EE\u72B6\u6001\u3002"},exportMp4:{en:"Export MP4","zh-Hans":"\u5BFC\u51FA MP4"},exports:{en:"Exports","zh-Hans":"\u5BFC\u51FA"},filterAllStatuses:{en:"All statuses","zh-Hans":"\u5168\u90E8\u72B6\u6001"},filterAllSurfaces:{en:"All surfaces","zh-Hans":"\u5168\u90E8\u7C7B\u578B"},filterAllTargets:{en:"All targets","zh-Hans":"\u5168\u90E8\u76EE\u6807"},filterBackground:{en:"Background","zh-Hans":"\u80CC\u666F"},filterButton:{en:"Button","zh-Hans":"\u6309\u94AE"},filterCard:{en:"Card","zh-Hans":"\u5361\u7247"},filterImage:{en:"Image","zh-Hans":"\u56FE\u7247"},filterReady:{en:"Ready","zh-Hans":"\u53EF\u7528"},filterText:{en:"Text","zh-Hans":"\u6587\u672C"},filterVideo:{en:"Video","zh-Hans":"\u89C6\u9891"},filterVideoLayer:{en:"Video layer","zh-Hans":"\u89C6\u9891\u56FE\u5C42"},filterWeb:{en:"HTML / web","zh-Hans":"HTML / \u7F51\u9875"},convertedToLayerTemplate:{en:"converted to layer template","zh-Hans":"\u8F6C\u6362\u4E3A\u56FE\u5C42\u6A21\u677F"},firstAvailableLayer:{en:"first available layer","zh-Hans":"\u7B2C\u4E00\u4E2A\u53EF\u7528\u56FE\u5C42"},html:{en:"HTML Workbench","zh-Hans":"HTML \u5DE5\u4F5C\u53F0"},htmlFit:{en:"HTML fit","zh-Hans":"HTML \u9002\u914D"},htmlSaved:{en:"Motion HTML saved","zh-Hans":"Motion HTML \u5DF2\u4FDD\u5B58"},htmlSelection:{en:"HTML selection","zh-Hans":"HTML \u9009\u4E2D\u9879"},htmlTemplates:{en:"HTML templates","zh-Hans":"HTML \u6A21\u677F"},icons:{en:"Icons","zh-Hans":"\u56FE\u6807"},image:{en:"Image","zh-Hans":"\u56FE\u7247"},invalidCompositionJson:{en:"Invalid composition JSON","zh-Hans":"\u89C6\u9891\u7F16\u6392 JSON \u65E0\u6548"},keyframes:{en:"Keyframes","zh-Hans":"\u5173\u952E\u5E27"},keyframeDot:{en:"{properties} keyframe at {time}s","zh-Hans":"{properties} \u5173\u952E\u5E27\uFF0C{time}s"},keyframeLegend:{en:"Keyframe","zh-Hans":"\u5173\u952E\u5E27"},keyframeTimeline:{en:"Layer keyframes","zh-Hans":"\u56FE\u5C42\u5173\u952E\u5E27"},keyframeTimelineHelp:{en:"Each row is one layer. Click a track to seek; diamond points are saved keyframes.","zh-Hans":"\u6BCF\u884C\u5BF9\u5E94\u4E00\u4E2A\u56FE\u5C42\u3002\u70B9\u51FB\u8F68\u9053\u8DF3\u8F6C\u65F6\u95F4\uFF0C\u83F1\u5F62\u70B9\u662F\u5DF2\u8BB0\u5F55\u7684\u5173\u952E\u5E27\u3002"},kineticCharPop:{en:"Char pop","zh-Hans":"\u5B57\u7B26\u5F39\u51FA"},kineticCharRise:{en:"Char rise","zh-Hans":"\u5B57\u7B26\u4E0A\u5347"},kineticNone:{en:"None","zh-Hans":"\u65E0"},kineticText:{en:"Kinetic text","zh-Hans":"\u52A8\u6001\u6587\u5B57"},kineticTypewriter:{en:"Typewriter","zh-Hans":"\u6253\u5B57\u673A"},kineticWordRise:{en:"Word rise","zh-Hans":"\u8BCD\u7EC4\u4E0A\u5347"},layer:{en:"Layer","zh-Hans":"\u56FE\u5C42"},layerWithId:{en:"Layer {id}","zh-Hans":"\u56FE\u5C42 {id}"},layers:{en:"Layers","zh-Hans":"\u56FE\u5C42"},library:{en:"Motion Library","zh-Hans":"\u52A8\u6548\u5E93"},libraryHelp:{en:"Pick a recipe, preview its intent, then apply it to the selected HTML component or video layer.","zh-Hans":"\u9009\u62E9\u52A8\u6548\u914D\u65B9\uFF0C\u9884\u89C8\u610F\u56FE\uFF0C\u7136\u540E\u5E94\u7528\u5230\u9009\u4E2D\u7684 HTML \u7EC4\u4EF6\u6216\u89C6\u9891\u56FE\u5C42\u3002"},line:{en:"Line","zh-Hans":"\u76F4\u7EBF"},loading:{en:"Loading","zh-Hans":"\u52A0\u8F7D\u4E2D"},main:{en:"Main","zh-Hans":"\u4E3B\u753B\u9762"},manageProjects:{en:"Projects","zh-Hans":"\u9879\u76EE"},mediaUploaded:{en:"Motion media uploaded","zh-Hans":"Motion \u5A92\u4F53\u5DF2\u4E0A\u4F20"},mediaUploadNoSource:{en:"Motion media upload returned no source.","zh-Hans":"Motion \u5A92\u4F53\u4E0A\u4F20\u672A\u8FD4\u56DE\u53EF\u7528\u8D44\u6E90\u3002"},mappedFromRecipeIntent:{en:"mapped from recipe intent","zh-Hans":"\u7531\u914D\u65B9\u610F\u56FE\u6620\u5C04"},motion:{en:"Motion","zh-Hans":"Motion"},motionApplied:{en:"Motion attributes applied","zh-Hans":"\u52A8\u6548\u5C5E\u6027\u5DF2\u5E94\u7528"},motionLabel:{en:"Motion","zh-Hans":"\u52A8\u6548"},motionPath:{en:"Motion path","zh-Hans":"\u8FD0\u52A8\u8DEF\u5F84"},motionStyles:{en:"Motion styles","zh-Hans":"\u52A8\u6548\u6837\u5F0F"},motionVersion:{en:"Motion version","zh-Hans":"Motion \u7248\u672C"},mp4Exported:{en:"Motion MP4 exported","zh-Hans":"Motion MP4 \u5DF2\u5BFC\u51FA"},nameMotionPlaceholder:{en:"Name this motion...","zh-Hans":"\u547D\u540D\u8FD9\u4E2A\u52A8\u6548..."},nameStyleFirst:{en:"Name the motion style first.","zh-Hans":"\u8BF7\u5148\u547D\u540D\u52A8\u6548\u6837\u5F0F\u3002"},newProject:{en:"New project","zh-Hans":"\u65B0\u5EFA\u9879\u76EE"},newVideo:{en:"New video","zh-Hans":"\u65B0\u5EFA\u89C6\u9891"},newWeb:{en:"New HTML","zh-Hans":"\u65B0\u5EFA HTML"},nativeVideoRecipe:{en:"native video recipe","zh-Hans":"\u539F\u751F\u89C6\u9891\u914D\u65B9"},nativeWebRecipe:{en:"native web recipe","zh-Hans":"\u539F\u751F\u7F51\u9875\u914D\u65B9"},noExports:{en:"No exports","zh-Hans":"\u6682\u65E0\u5BFC\u51FA"},noKeyframes:{en:"No keyframes","zh-Hans":"\u6682\u65E0\u5173\u952E\u5E27"},noProjects:{en:"No projects","zh-Hans":"\u6682\u65E0\u9879\u76EE"},noRecipes:{en:"No recipes matched the current filters.","zh-Hans":"\u6CA1\u6709\u5339\u914D\u5F53\u524D\u7B5B\u9009\u7684\u52A8\u6548\u914D\u65B9\u3002"},noVersions:{en:"No versions","zh-Hans":"\u6682\u65E0\u7248\u672C"},oneRowPerLayer:{en:"One row per layer; dots are keyframes.","zh-Hans":"\u6BCF\u4E2A\u56FE\u5C42\u4E00\u884C\uFF0C\u5706\u70B9\u8868\u793A\u5173\u952E\u5E27\u3002"},open:{en:"Open","zh-Hans":"\u6253\u5F00"},path:{en:"Path","zh-Hans":"\u8DEF\u5F84"},preview:{en:"Preview","zh-Hans":"\u9884\u89C8"},previewFilmControl:{en:"Film preview","zh-Hans":"\u6574\u7247\u9884\u89C8"},previewFilmHelp:{en:"Play or scrub the whole composition; the canvas reflects this time.","zh-Hans":"\u64AD\u653E\u6216\u62D6\u52A8\u6574\u6BB5\u89C6\u9891\uFF0C\u753B\u5E03\u4F1A\u663E\u793A\u5BF9\u5E94\u65F6\u95F4\u3002"},preset:{en:"Preset","zh-Hans":"\u9884\u8BBE"},properties:{en:"Properties","zh-Hans":"\u5C5E\u6027"},projects:{en:"Projects","zh-Hans":"\u9879\u76EE"},artifactExported:{en:"Motion {kind} exported","zh-Hans":"Motion {kind} \u5DF2\u5BFC\u51FA"},projectCreated:{en:"{title} created","zh-Hans":"{title} \u5DF2\u521B\u5EFA"},projectDialogDescription:{en:"Create a new Motion project or switch to an existing draft.","zh-Hans":"\u521B\u5EFA\u65B0\u7684 Motion \u9879\u76EE\uFF0C\u6216\u5207\u6362\u5230\u5DF2\u6709\u8349\u7A3F\u3002"},projectDialogTitle:{en:"Motion projects","zh-Hans":"Motion \u9879\u76EE"},projectStatusUpdated:{en:"Motion project {status}","zh-Hans":"Motion \u9879\u76EE\u5DF2\u8BBE\u4E3A {status}"},projectSummary:{en:"{surface} \xB7 v{version} \xB7 {status}","zh-Hans":"{surface} \xB7 v{version} \xB7 {status}"},ready:{en:"Ready","zh-Hans":"\u5C31\u7EEA"},recipeApplied:{en:"Applied {name}","zh-Hans":"\u5DF2\u5E94\u7528 {name}"},recipeAppliedToHtml:{en:"Applied {name} to HTML","zh-Hans":"\u5DF2\u5C06 {name} \u5E94\u7528\u5230 HTML"},recipeAppliedToVideo:{en:"Applied {name} to video","zh-Hans":"\u5DF2\u5C06 {name} \u5E94\u7528\u5230\u89C6\u9891"},recipeSelectEmpty:{en:"Select a recipe to preview and apply it.","zh-Hans":"\u9009\u62E9\u4E00\u4E2A\u52A8\u6548\u914D\u65B9\u6765\u9884\u89C8\u5E76\u5E94\u7528\u3002"},recipeUsageSummary:{en:"{trigger} trigger for {htmlTarget}; {template} template for {videoTarget}.","zh-Hans":"{htmlTarget} \u4F7F\u7528 {trigger} \u89E6\u53D1\uFF1B{videoTarget} \u4F7F\u7528 {template} \u6A21\u677F\u3002"},referencedDraft:{en:"Current draft","zh-Hans":"\u5F53\u524D\u8349\u7A3F"},replayAllHint:{en:"Reload the preview and replay the whole page or composition.","zh-Hans":"\u91CD\u65B0\u52A0\u8F7D\u9884\u89C8\uFF0C\u5E76\u91CD\u64AD\u6574\u4E2A\u9875\u9762\u6216\u7F16\u6392\u3002"},replayMotion:{en:"Replay all","zh-Hans":"\u91CD\u64AD\u5168\u90E8"},recipes:{en:"Recipes","zh-Hans":"\u914D\u65B9"},restore:{en:"Restore","zh-Hans":"\u6062\u590D"},reviewed:{en:"Reviewed","zh-Hans":"\u5DF2\u5BA1\u6838"},save:{en:"Save","zh-Hans":"\u4FDD\u5B58"},saveCurrentVersion:{en:"Save current version","zh-Hans":"\u4FDD\u5B58\u5F53\u524D\u7248\u672C"},saveStyle:{en:"Save style","zh-Hans":"\u4FDD\u5B58\u6837\u5F0F"},sceneLength:{en:"Scene length","zh-Hans":"\u573A\u666F\u65F6\u957F"},sceneStrip:{en:"Scene strip","zh-Hans":"\u573A\u666F\u6BB5\u843D"},sceneStripHelp:{en:"Switch scenes, set transitions, and edit the current scene duration.","zh-Hans":"\u5207\u6362\u573A\u666F\u3001\u8BBE\u7F6E\u8F6C\u573A\uFF0C\u5E76\u8C03\u6574\u5F53\u524D\u573A\u666F\u65F6\u957F\u3002"},scenes:{en:"Scenes","zh-Hans":"\u573A\u666F"},scrub:{en:"Scrub","zh-Hans":"\u62D6\u52A8\u9884\u89C8"},search:{en:"Search","zh-Hans":"\u641C\u7D22"},selectedRecipe:{en:"Selected recipe","zh-Hans":"\u9009\u4E2D\u914D\u65B9"},select:{en:"Select","zh-Hans":"\u9009\u62E9"},selectElement:{en:"Select an element","zh-Hans":"\u9009\u62E9\u5143\u7D20"},selectElementFirst:{en:"Select an element in the preview first.","zh-Hans":"\u8BF7\u5148\u5728\u9884\u89C8\u4E2D\u9009\u62E9\u4E00\u4E2A\u5143\u7D20\u3002"},selectLayerFirst:{en:"Select or add a video layer before applying a Motion recipe.","zh-Hans":"\u5E94\u7528 Motion \u914D\u65B9\u524D\u8BF7\u5148\u9009\u62E9\u6216\u6DFB\u52A0\u89C6\u9891\u56FE\u5C42\u3002"},selectLayerHint:{en:"Click an element on the canvas, or a layer above, to select it.","zh-Hans":"\u70B9\u51FB\u753B\u5E03\u5143\u7D20\u6216\u4E0A\u65B9\u56FE\u5C42\u6765\u9009\u62E9\u3002"},sendToAssistant:{en:"Ask Assistant","zh-Hans":"\u8BE2\u95EE Assistant"},setProperty:{en:"Set {property}","zh-Hans":"\u8BBE\u7F6E {property}"},statusArchived:{en:"Archived","zh-Hans":"\u5DF2\u5F52\u6863"},statusDraft:{en:"Draft","zh-Hans":"\u8349\u7A3F"},statusReady:{en:"Ready","zh-Hans":"\u5C31\u7EEA"},statusReviewed:{en:"Reviewed","zh-Hans":"\u5DF2\u5BA1\u6838"},styleReady:{en:'Style "{name}" is ready to save from the main Motion style action.',"zh-Hans":"\u6837\u5F0F\u201C{name}\u201D\u53EF\u901A\u8FC7\u4E3B Motion \u6837\u5F0F\u64CD\u4F5C\u4FDD\u5B58\u3002"},templateAttention:{en:"Attention","zh-Hans":"\u5438\u5F15\u6CE8\u610F"},templateEmphasis:{en:"Emphasis","zh-Hans":"\u5F3A\u8C03"},templateEntrance:{en:"Entrance","zh-Hans":"\u5165\u573A"},templateExit:{en:"Exit","zh-Hans":"\u9000\u573A"},text:{en:"Text","zh-Hans":"\u6587\u672C"},timeline:{en:"Timeline","zh-Hans":"\u65F6\u95F4\u7EBF"},timelineCurrentTime:{en:"Current time","zh-Hans":"\u5F53\u524D\u65F6\u95F4"},timelinePause:{en:"Pause timeline","zh-Hans":"\u6682\u505C\u65F6\u95F4\u7EBF"},timelinePlay:{en:"Play timeline","zh-Hans":"\u64AD\u653E\u65F6\u95F4\u7EBF"},timelineRestraintWarning:{en:"More than four load motions start early; consider delaying or changing some triggers.","zh-Hans":"\u8D85\u8FC7\u56DB\u4E2A\u52A0\u8F7D\u52A8\u6548\u8FC7\u65E9\u5F00\u59CB\uFF1B\u5EFA\u8BAE\u5EF6\u8FDF\u6216\u8C03\u6574\u90E8\u5206\u89E6\u53D1\u65B9\u5F0F\u3002"},timelineScopeAll:{en:"All motions","zh-Hans":"\u5168\u90E8\u52A8\u6548"},timelineScopeSelection:{en:"Current selection","zh-Hans":"\u5F53\u524D\u9009\u4E2D"},title:{en:"Title","zh-Hans":"\u6807\u9898"},transitionCut:{en:"Cut","zh-Hans":"\u786C\u5207"},transitionDissolve:{en:"Dissolve","zh-Hans":"\u6EB6\u89E3"},transitionFade:{en:"Fade","zh-Hans":"\u6DE1\u5165\u6DE1\u51FA"},transitionPush:{en:"Push","zh-Hans":"\u63A8\u5165"},trigger:{en:"Trigger","zh-Hans":"\u89E6\u53D1"},triggerClick:{en:"On click","zh-Hans":"\u70B9\u51FB\u65F6"},triggerHover:{en:"On hover","zh-Hans":"\u60AC\u505C\u65F6"},triggerLoad:{en:"On load","zh-Hans":"\u52A0\u8F7D\u65F6"},triggerScroll:{en:"On scroll","zh-Hans":"\u6EDA\u52A8\u65F6"},undo:{en:"Undo","zh-Hans":"\u64A4\u9500"},untitled:{en:"Untitled","zh-Hans":"\u672A\u547D\u540D"},unsaved:{en:"Unsaved","zh-Hans":"\u672A\u4FDD\u5B58"},up:{en:"Up","zh-Hans":"\u4E0A\u79FB"},uploadLayerMedia:{en:"Upload layer media","zh-Hans":"\u4E0A\u4F20\u56FE\u5C42\u5A92\u4F53"},uploadReference:{en:"Upload reference","zh-Hans":"\u4E0A\u4F20\u53C2\u8003"},uploadVideoBackground:{en:"Upload video background","zh-Hans":"\u4E0A\u4F20\u89C6\u9891\u80CC\u666F"},version:{en:"Version","zh-Hans":"\u7248\u672C"},versionHistory:{en:"Version history","zh-Hans":"\u7248\u672C\u8BB0\u5F55"},versionHistoryDescription:{en:"Save a reviewable snapshot or restore a previous Motion project version.","zh-Hans":"\u4FDD\u5B58\u53EF\u5BA1\u9605\u5FEB\u7167\uFF0C\u6216\u6062\u590D\u4E4B\u524D\u7684 Motion \u9879\u76EE\u7248\u672C\u3002"},versionLabel:{en:"Version {number}","zh-Hans":"\u7248\u672C {number}"},versionRestored:{en:"Motion version restored","zh-Hans":"Motion \u7248\u672C\u5DF2\u6062\u590D"},versionSaved:{en:"Motion version saved","zh-Hans":"Motion \u7248\u672C\u5DF2\u4FDD\u5B58"},versions:{en:"Versions","zh-Hans":"\u7248\u672C"},video:{en:"Video Composer","zh-Hans":"\u89C6\u9891\u5408\u6210"},videoPause:{en:"Pause film preview","zh-Hans":"\u6682\u505C\u6574\u7247\u9884\u89C8"},videoPlay:{en:"Play film preview","zh-Hans":"\u64AD\u653E\u6574\u7247\u9884\u89C8"},videoLayer:{en:"video layer","zh-Hans":"\u89C6\u9891\u56FE\u5C42"},videoFit:{en:"Video fit","zh-Hans":"\u89C6\u9891\u9002\u914D"},videoSaved:{en:"Motion video composition saved","zh-Hans":"Motion \u89C6\u9891\u7F16\u6392\u5DF2\u4FDD\u5B58"},videoTemplates:{en:"Video templates","zh-Hans":"\u89C6\u9891\u6A21\u677F"},webCodecsUnavailable:{en:"WebCodecs MP4 export is not available in this browser.","zh-Hans":"\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 WebCodecs MP4 \u5BFC\u51FA\u3002"},workbenchHeaderLabel:{en:"Motion workbench header","zh-Hans":"Motion \u5DE5\u4F5C\u53F0\u5934\u90E8"}};function dp(e){let a=String(e||"").toLowerCase().startsWith("zh")?"zh-Hans":"en";return(o,r)=>ry(lp[o]?.[a]??lp[o]?.en??o,r)}function Ot(e,t){return e.map(a=>({value:a.value,label:t(a.labelKey)}))}function up(e,t){return e==="projects"?t("projects"):e==="library"?t("library"):e==="html"?t("html"):e==="video"?t("video"):e==="versions"?t("versions"):e==="exports"?t("exports"):e}function kn(e,t){return e==="load"?t("triggerLoad"):e==="scroll"?t("triggerScroll"):e==="hover"?t("triggerHover"):e==="click"?t("triggerClick"):e}function Rn(e,t){if(!e)return t("draft");let a=e.toLowerCase();return a==="draft"?t("statusDraft"):a==="reviewed"?t("statusReviewed"):a==="archived"?t("statusArchived"):a==="ready"?t("statusReady"):e}function ry(e,t){return t?e.replace(/\{([a-zA-Z0-9_]+)\}/g,(a,o)=>t[o]===void 0?a:String(t[o])):e}var Os=new Map,Pn=new Map;function Tn(e){let t=_e(e.w,1280),a=_e(e.h,720),o=_e(e.fps,30),r=Math.max(.5,_e(e.duration,fp(e)));return{w:t,h:a,fps:o,duration:()=>r,preload:async()=>py(e),seekMedia:async n=>hy(e,n),renderFrame(n,i){ny(n,e,{w:t,h:a,time:i,duration:r})}}}function ny(e,t,a){e.clearRect(0,0,a.w,a.h),cp(e,t.bg||"#0f172a",a.w,a.h);let o=fy(t,a.time),r=Array.isArray(t.shared)?t.shared:[];Es(e,t,o,a,r,1);let n=o.scene?.transition||"cut",i=Math.min(.65,o.duration/3);if(o.nextScene&&n!=="cut"&&o.localTime>o.duration-i){let s=Mn((o.localTime-(o.duration-i))/i,0,1);n==="push"?(e.save(),e.translate(a.w*(1-s),0),Es(e,t,{...o,scene:o.nextScene,localTime:0},a,r,1),e.restore()):Es(e,t,{...o,scene:o.nextScene,localTime:0},a,r,s)}}function Es(e,t,a,o,r,n){e.save(),e.globalAlpha*=n,a.scene?.bg&&cp(e,a.scene.bg,o.w,o.h);let i=a.scene?a.scene.layers||[]:t.layers||[];for(let s of[...r,...i])iy(e,s,a.localTime,o);e.restore()}function cp(e,t,a,o){if(/^linear-gradient/i.test(t)){let r=e.createLinearGradient(0,0,a,o);r.addColorStop(0,"#0f172a"),r.addColorStop(.45,"#2563eb"),r.addColorStop(1,"#14b8a6"),e.fillStyle=r}else e.fillStyle=t;e.fillRect(0,0,a,o)}function iy(e,t,a,o){let r=ot(t.start,0),n=ot(t.end,o.duration);if(a<r||a>n)return;let i=Math.max(0,a-r),s=Ba(t,"x",i,ot(t.x,o.w/2)),l=Ba(t,"y",i,ot(t.y,o.h/2)),d=Ba(t,"offset",i,0),u=by(t.path,d),c=u?.x??s,m=u?.y??l,h=Mn(Ba(t,"opacity",i,ot(t.opacity,1)),0,1),x=Ba(t,"scale",i,ot(t.scale,1)),p=Ba(t,"rotate",i,ot(t.rotate,0)),g=Math.max(0,Ba(t,"blur",i,0));e.save(),e.globalAlpha=h,e.translate(c,m),e.rotate(p*Math.PI/180),e.scale(x,x),g>0&&(e.filter=`blur(${g}px)`),t.type==="video"&&t.src?cy(e,t):t.type==="image"&&t.src?uy(e,t):t.type==="ellipse"?dy(e,t):t.type==="rect"?ly(e,t):sy(e,t),e.restore()}function sy(e,t){let a=_e(t.size,64),o=_e(t.weight,800);e.font=`${o} ${a}px ${t.font||"Inter"}, ui-sans-serif, system-ui, sans-serif`,e.textAlign=t.align||"center",e.textBaseline="middle",e.fillStyle=t.color||"#ffffff",t.kinetic?.type==="char-rise"||t.kinetic?.type==="char-pop"?xy(e,t.text||"Motion",a,t):vy(e,t.text||"Motion",0,0,_e(t.w,980),a*1.15)}function ly(e,t){let a=_e(t.w,360),o=_e(t.h,180);e.fillStyle=t.fill||t.color||t.bg||"#ffffff",wy(e,-a/2,-o/2,a,o,_e(t.radius,28)),e.fill()}function dy(e,t){e.fillStyle=t.fill||t.color||t.bg||"#22c55e",e.beginPath(),e.ellipse(0,0,_e(t.w,220)/2,_e(t.h,220)/2,0,0,Math.PI*2),e.fill()}function uy(e,t){let a=t.src?Os.get(t.src):null,o=_e(t.w,480),r=_e(t.h,270);a&&a.complete?e.drawImage(a,-o/2,-r/2,o,r):(e.fillStyle="#e2e8f0",e.fillRect(-o/2,-r/2,o,r))}function cy(e,t){let a=t.src?Pn.get(t.src):null,o=_e(t.w,480),r=_e(t.h,270);a&&a.readyState>=2?e.drawImage(a,-o/2,-r/2,o,r):(e.fillStyle="#020617",e.fillRect(-o/2,-r/2,o,r),e.fillStyle="#94a3b8",e.font="700 28px Inter, ui-sans-serif, system-ui, sans-serif",e.textAlign="center",e.textBaseline="middle",e.fillText("Video",0,0))}function fy(e,t){let a=Array.isArray(e.scenes)?e.scenes:[],o=0;for(let r=0;r<a.length;r+=1){let n=a[r],i=_e(n.duration,3);if(t<=o+i)return{scene:n,sceneIndex:r,nextScene:a[r+1]||null,duration:i,localTime:Math.max(0,t-o)};o+=i}return{scene:null,sceneIndex:-1,nextScene:null,duration:fp(e),localTime:t}}function Ba(e,t,a,o){let r=e.tracks?.[t];if(!Array.isArray(r)||r.length===0)return o;let n=r.filter(i=>typeof i=="object"&&i!==null).map(i=>({t:ot(i.t,0),v:ot(i.v,o),ease:i.ease})).sort((i,s)=>i.t-s.t);if(n.length===0||a<=n[0].t)return n[0]?.v??o;for(let i=1;i<n.length;i+=1){let s=n[i-1],l=n[i];if(a<=l.t){let d=Math.max(.001,l.t-s.t),u=Mn((a-s.t)/d,0,1),c=l.ease==="ease-out"?1-Math.pow(1-u,3):l.ease==="ease-in"?u*u*u:u;return s.v+(l.v-s.v)*c}}return n[n.length-1].v}function py(e){let t=Ns(e).filter(o=>o.type==="image"&&o.src).map(o=>String(o.src)),a=Ns(e).filter(o=>o.type==="video"&&o.src).map(o=>String(o.src));return Promise.all([...t.map(my),...a.map(gy)]).then(()=>{})}function my(e){return new Promise(t=>{if(Os.has(e)){t();return}let a=new Image;a.crossOrigin="anonymous",a.onload=()=>{Os.set(e,a),t()},a.onerror=()=>t(),a.src=e})}function gy(e){return new Promise(t=>{if(Pn.has(e)){t();return}let a=document.createElement("video");a.crossOrigin="anonymous",a.muted=!0,a.preload="auto",a.playsInline=!0,a.onloadeddata=()=>{Pn.set(e,a),t()},a.onerror=()=>t(),a.src=e})}function hy(e,t){let a=Ns(e).filter(o=>o.type==="video"&&o.src).map(o=>({layer:o,video:Pn.get(String(o.src))})).filter(o=>!!o.video);return Promise.all(a.map(({layer:o,video:r})=>new Promise(n=>{let i=ot(o.start,0),s=Math.max(0,t-i);if(!Number.isFinite(r.duration)||Math.abs(r.currentTime-s)<.03){n();return}let l=()=>{r.removeEventListener("seeked",l),n()};r.addEventListener("seeked",l,{once:!0}),r.currentTime=o.loop&&Number.isFinite(r.duration)&&r.duration>0?s%r.duration:Math.min(s,r.duration||s),setTimeout(l,250)}))).then(()=>{})}function Ns(e){let t=[...e.layers||[],...e.shared||[]];for(let a of e.scenes||[])t.push(...a.layers||[]);return t}function fp(e){return Array.isArray(e.scenes)&&e.scenes.length>0?e.scenes.reduce((o,r)=>o+_e(r.duration,3),0):(e.layers||[]).reduce((o,r)=>Math.max(o,ot(r.end,ot(r.start,0)+3)),0)||5}function vy(e,t,a,o,r,n){let i=t.split(/\s+/),s=[],l="";for(let u of i){let c=l?`${l} ${u}`:u;e.measureText(c).width>r&&l?(s.push(l),l=u):l=c}l&&s.push(l);let d=o-(s.length-1)*n/2;s.forEach((u,c)=>e.fillText(u,a,d+c*n))}function xy(e,t,a,o){let r=Array.from(t),i=-r.reduce((s,l)=>s+e.measureText(l).width,0)/2;r.forEach((s,l)=>{let d=e.measureText(s).width,u=o.kinetic?.type==="char-pop"?Math.sin(l*.85)*a*.08:-Math.sin(l*.55)*a*.05;e.fillText(s,i+d/2,u),i+=d})}function by(e,t){let a=(e?.points||[]).map(d=>({x:ot(d.x,NaN),y:ot(d.y,NaN)})).filter(d=>Number.isFinite(d.x)&&Number.isFinite(d.y));if(a.length===0)return null;if(a.length===1)return a[0];let r=Mn(t,0,1)*(a.length-1),n=Math.min(a.length-2,Math.floor(r)),i=r-n,s=a[n],l=a[n+1];return{x:s.x+(l.x-s.x)*i,y:s.y+(l.y-s.y)*i}}function wy(e,t,a,o,r,n){let i=Math.min(n,o/2,r/2);e.beginPath(),e.moveTo(t+i,a),e.arcTo(t+o,a,t+o,a+r,i),e.arcTo(t+o,a+r,t,a+r,i),e.arcTo(t,a+r,t,a,i),e.arcTo(t,a,t+o,a,i),e.closePath()}function _e(e,t){let a=Number(e);return Number.isFinite(a)&&a>0?a:t}function ot(e,t){let a=Number(e);return Number.isFinite(a)?a:t}function Mn(e,t,a){return Math.min(a,Math.max(t,e))}var pp=["opacity","x","y","scale","rotate","blur"],yy=`
|
|
908
46
|
@keyframes ma-fade{from{opacity:0}to{opacity:1}}
|
|
909
47
|
@keyframes ma-slide-up{from{opacity:0;transform:translateY(var(--ma-d,24px))}to{opacity:1;transform:none}}
|
|
910
48
|
@keyframes ma-slide-down{from{opacity:0;transform:translateY(calc(var(--ma-d,24px)*-1))}to{opacity:1;transform:none}}
|
|
@@ -919,7 +57,7 @@ If you want to offset all timestamps of a track such that the first one is zero,
|
|
|
919
57
|
@keyframes ma-wobble{0%,100%{transform:rotate(0)}25%{transform:rotate(-4deg)}50%{transform:rotate(3deg)}75%{transform:rotate(-2deg)}}
|
|
920
58
|
@keyframes ma-sink{0%{transform:none}50%{transform:scale(.94)}100%{transform:none}}
|
|
921
59
|
@media(prefers-reduced-motion:reduce){[data-ma-anim]{animation:none!important;opacity:1!important;filter:none!important;transform:none!important}}
|
|
922
|
-
`.trim(),
|
|
60
|
+
`.trim(),Cy=`(function(){
|
|
923
61
|
if(window.maMotion) return;
|
|
924
62
|
var RM = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
925
63
|
function animName(el){
|
|
@@ -957,74 +95,30 @@ If you want to offset all timestamps of a track such that the first one is zero,
|
|
|
957
95
|
window.__maTimeline={seek:seek,duration:timelineDuration,resume:resume};
|
|
958
96
|
window.maMotion={play:play,wire:wire,wireAll:wireAll,seek:seek,timelineDuration:timelineDuration};
|
|
959
97
|
if(document.readyState==='loading') document.addEventListener('DOMContentLoaded', wireAll); else wireAll();
|
|
960
|
-
})();`;function
|
|
961
|
-
${
|
|
98
|
+
})();`;function Sy(e){let t=e.trim();if(!t)throw new Error("HTML artifact is empty.");if(t.length>5*1024*1024)throw new Error("HTML artifact is too large.");if(!/<html[\s>]|<!doctype html/i.test(t))throw new Error("HTML artifact must be a complete HTML document.");return t}function mp(e){let t=Sy(e);if(!/id=["']ma-motion-kf["']/.test(t)){let a=`<style id="ma-motion-kf">
|
|
99
|
+
${yy}
|
|
962
100
|
</style>`;t=/<\/head>/i.test(t)?t.replace(/<\/head>/i,`${a}
|
|
963
101
|
</head>`):`${a}
|
|
964
102
|
${t}`}if(!/id=["']ma-motion-runtime["']/.test(t)){let a=`<script id="ma-motion-runtime">
|
|
965
|
-
${
|
|
103
|
+
${Cy}
|
|
966
104
|
<\/script>`;t=/<\/body>/i.test(t)?t.replace(/<\/body>/i,`${a}
|
|
967
105
|
</body>`):`${t}
|
|
968
|
-
${a}`}return t}function
|
|
106
|
+
${a}`}return t}function Ha(e){let t={},a=e??{};for(let o of pp){let r=a[o];if(Array.isArray(r)){let n=r.filter(i=>typeof i=="object"&&i!==null).map(i=>({t:Fs(Number(i.t??0),0,999),v:Number.isFinite(Number(i.v))?Number(i.v):0,...typeof i.ease=="string"&&i.ease.trim()?{ease:i.ease.trim()}:{}})).sort((i,s)=>Number(i.t??0)-Number(s.t??0));n.length>0&&(t[o]=n)}}return t}function gp(e){return`ma-kf-${e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")||"custom"}`}function Ly(e,t){let a=Ha(t),o=new Set;for(let i of Object.values(a))for(let s of i||[])o.add(Fs(Number(s.t??0),0,1));if(o.size===0)return"";let n=Array.from(o).sort((i,s)=>i-s).map(i=>{let s=Math.round(i*1e3)/10,l=wo(a.opacity,i,void 0),d=wo(a.x,i,0)??0,u=wo(a.y,i,0)??0,c=wo(a.scale,i,1)??1,m=wo(a.rotate,i,0)??0,h=wo(a.blur,i,0)??0,x=[l!==void 0?`opacity:${yo(l)}`:"",`transform:translate(${yo(d)}px,${yo(u)}px) scale(${yo(c)}) rotate(${yo(m)}deg)`,h>0?`filter:blur(${yo(h)}px)`:"filter:blur(0)"].filter(Boolean);return`${s}%{${x.join(";")}}`});return`@keyframes ${e}{${n.join("")}}`}function hp(e,t,a){let o=Ly(t,a);if(!o)return e;let r=`ma-custom-${t}`,n=`<style id="${r}">
|
|
969
107
|
${o}
|
|
970
|
-
</style>`,i=new RegExp(`<style\\s+id=["']${
|
|
108
|
+
</style>`,i=new RegExp(`<style\\s+id=["']${Iy(r)}["'][\\s\\S]*?<\\/style>`,"i");return i.test(e)?e.replace(i,n):/<\/head>/i.test(e)?e.replace(/<\/head>/i,`${n}
|
|
971
109
|
</head>`):`${n}
|
|
972
|
-
${e}`}function Ea(e,t,a){if(!e||e.length===0)return a;let o=e.map(r=>({t:Number(r.t??0),v:Number(r.v??a??0)})).sort((r,n)=>r.t-n.t);if(t<=o[0].t)return o[0].v;for(let r=1;r<o.length;r+=1){let n=o[r-1],i=o[r];if(t<=i.t){let s=Math.max(.001,i.t-n.t),l=Hn((t-n.t)/s,0,1);return n.v+(i.v-n.v)*l}}return o[o.length-1].v}function Hn(e,t,a){return Math.max(t,Math.min(a,Number.isFinite(e)?e:t))}function Oa(e){return Math.round(e*1e3)/1e3}function Ph(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var ll=["text","rect","ellipse","image","video"];var kh='h1,h2,h3,p,button,a.btn,a.button,[class*="btn"],[class*="button"],[class*="card"],img,[data-ma-anim],[data-ma-kf]',Th=14,dl=[{group:"Entrance",templates:["fade-in","slide-up","slide-down","slide-left","slide-right","zoom-in","rotate-in","pop","bounce-in"]},{group:"Emphasis",templates:["pulse","float","wobble"]},{group:"Attention",templates:["shake","heartbeat"]},{group:"Exit",templates:["fade-out","zoom-out"]}];function ul(e){let t=[],a=/<([a-zA-Z0-9-]+)\b([^>]*(?:data-ma-anim|data-ma-kf)[^>]*)>([\s\S]*?)<\/\1>|<([a-zA-Z0-9-]+)\b([^>]*(?:data-ma-anim|data-ma-kf)[^>]*)\/?>/gi,o;for(;(o=a.exec(e))!==null;){let r=o[1]||o[4]||"element",n=o[2]||o[5]||"",i=Ba(n,"data-ma-anim"),s=Ba(n,"data-ma-kf");if(!i&&!s)continue;let l=Ba(n,"data-ma-id")||`${r}-${t.length+1}`,u=Eh(o[3]||"").trim();t.push({id:l,label:u?`${r} \xB7 ${u.slice(0,32)}`:r,verb:i||s||"custom",trigger:Ba(n,"data-ma-trigger")||"load",delay:Ae(Ba(n,"data-ma-delay"),0),duration:Ae(Ba(n,"data-ma-dur"),520)})}return t}function Vn(e){let t=e.tagName.toLowerCase(),a=(e.text||"").replace(/\s+/g," ").trim(),o=e.className||"",r=Math.max(0,Number(e.index||0));return t==="img"?`Image${e.alt?` \xB7 ${e.alt.slice(0,36)}`:` ${r+1}`}`:t==="button"||t==="a"||/\b(btn|button)\b/i.test(o)?`Button${a?` \xB7 ${a.slice(0,36)}`:` ${r+1}`}`:/\b(card|tile|panel)\b/i.test(o)?`Card${a?` \xB7 ${a.slice(0,36)}`:` ${r+1}`}`:/^h[1-3]$/.test(t)?`Headline${a?` \xB7 ${a.slice(0,42)}`:` ${r+1}`}`:t==="p"?`Text${a?` \xB7 ${a.slice(0,42)}`:` ${r+1}`}`:`${t}${a?` \xB7 ${a.slice(0,42)}`:` ${r+1}`}`}function Mh(e){let t=e.width??999,a=e.height??999;return t>=24&&a>=12}function cl(e){let t=!1,a=Array.from(e.querySelectorAll(kh)),o=[];for(let r of a){if(o.length>=Th)break;let n=r.getBoundingClientRect();Mh({tagName:r.tagName,width:n.width,height:n.height})&&(o.some(i=>i!==r&&i.contains(r))||(r.getAttribute("data-ma-id")||(r.setAttribute("data-ma-id",`c${o.length}`),t=!0),o.push(r)))}return{changed:t,components:o.map((r,n)=>({id:r.getAttribute("data-ma-id")||`c${n}`,label:Vn({tagName:r.tagName,text:r.textContent,className:r.getAttribute("class"),alt:r.getAttribute("alt"),index:n}),element:r}))}}function fl(e,t=1200){let a=Math.max(t,...e.map(r=>Math.max(0,r.delay)+Math.max(80,r.duration))),o=e.filter(r=>r.trigger==="load"&&r.delay<150).length;return{duration:a,earlyLoadCount:o,restraintWarning:o>4?"More than four load motions start early; consider delaying or changing some triggers.":null,items:e.map(r=>({...r,leftPct:_n(Math.max(0,r.delay)/a*100,0,100),widthPct:_n(Math.max(80,r.duration)/a*100,2,100),startsEarly:r.trigger==="load"&&r.delay<150}))}}function na(){return{opacity:[{t:0,v:0},{t:.5,v:1}],x:[{t:0,v:0},{t:.5,v:0}],y:[{t:0,v:24},{t:.5,v:0,ease:"ease-out"}],scale:[{t:0,v:.96},{t:.5,v:1}],rotate:[{t:0,v:0},{t:.5,v:0}],blur:[{t:0,v:8},{t:.5,v:0}]}}function ml(e){return{w:_t(e.w,1280),h:_t(e.h,720),fps:_t(e.fps,30)}}function je(e){return Array.isArray(e.scenes)&&e.scenes.length>0?e.scenes:[]}function Ah(e){let t=je(e);if(t.length>0)return t.reduce((o,r)=>o+_t(r.duration,3),0);let a=Fa(e,-1).reduce((o,r)=>Math.max(o,Ae(r.end,Ae(r.start,0)+3)),0);return _t(e.duration,a||5)}function Fa(e,t){let a=je(e);return t>=0&&a[t]?a[t].layers||[]:e.layers||[]}function po(e,t,a){return(a!==void 0?[...e.shared||[],...Fa(e,a)]:[...e.layers||[],...e.shared||[],...je(e).flatMap(r=>r.layers||[])]).find(r=>r.id===t)??null}function pl(e,t,a=0){let{w:o,h:r}=ml(t),i={id:`${e}-${Date.now().toString(36)}-${a}`,type:e,start:0,end:Math.min(4,Ah(t)),x:o/2,y:r/2,opacity:1,scale:1,rotate:0,tracks:{opacity:[{t:0,v:0},{t:.45,v:1,ease:"ease-out"}]}};return e==="text"?{...i,text:"New text",w:720,h:96,size:64,weight:800,color:"#ffffff",kinetic:{type:"word-rise",stagger:.04}}:e==="rect"?{...i,w:360,h:180,color:"#8b5cf6",radius:28}:e==="ellipse"?{...i,w:220,h:220,color:"#22c55e"}:{...i,w:480,h:270,color:"#e2e8f0"}}function hl(e,t,a){let o=je(e);return t>=0&&o[t]?{...e,scenes:o.map((r,n)=>n===t?{...r,layers:[...r.layers||[],a]}:r)}:{...e,layers:[...e.layers||[],a]}}function ia(e,t,a,o){let r=s=>(s||[]).map(l=>l.id===a?o(l):l),n=je(e);return(e.shared||[]).some(s=>s.id===a)?{...e,shared:r(e.shared)}:t>=0&&n[t]?{...e,scenes:n.map((s,l)=>l===t?{...s,layers:r(s.layers)}:s)}:{...e,layers:r(e.layers)}}function gl(e,t,a){let o=n=>(n||[]).filter(i=>i.id!==a),r=je(e);return(e.shared||[]).some(n=>n.id===a)?{...e,shared:o(e.shared)}:t>=0&&r[t]?{...e,scenes:r.map((n,i)=>i===t?{...n,layers:o(n.layers)}:n)}:{...e,layers:o(e.layers)}}function Un(e,t,a,o){let r=i=>{let s=[...i||[]],l=s.findIndex(f=>f.id===a),u=l+o;if(l<0||u<0||u>=s.length)return s;let[c]=s.splice(l,1);return s.splice(u,0,c),s},n=je(e);return t>=0&&n[t]?{...e,scenes:n.map((i,s)=>s===t?{...i,layers:r(i.layers)}:i)}:{...e,layers:r(e.layers)}}function xl(e,t,a,o){let r=Ae(e.x,0)+t,n=Ae(e.y,0)+a;return{...e,x:r,y:n,tracks:{...e.tracks||{},x:zn(e.tracks?.x,o,r),y:zn(e.tracks?.y,o,n)}}}function vl(e,t,a,o){return{...e,tracks:{...e.tracks||{},[t]:zn(e.tracks?.[t],a,o)}}}function nr(e,t){let a=Ae(e.x,0),o=Ae(e.y,0),r={...e.tracks||{}};return t==="fade-in"&&(r.opacity=[{t:0,v:0},{t:.5,v:1,ease:"ease-out"}]),t==="slide-up"&&Object.assign(r,{opacity:[{t:0,v:0},{t:.55,v:1}],y:[{t:0,v:o+56},{t:.55,v:o,ease:"ease-out"}]}),t==="slide-down"&&Object.assign(r,{opacity:[{t:0,v:0},{t:.55,v:1}],y:[{t:0,v:o-56},{t:.55,v:o,ease:"ease-out"}]}),t==="slide-left"&&Object.assign(r,{opacity:[{t:0,v:0},{t:.55,v:1}],x:[{t:0,v:a+72},{t:.55,v:a,ease:"ease-out"}]}),t==="slide-right"&&Object.assign(r,{opacity:[{t:0,v:0},{t:.55,v:1}],x:[{t:0,v:a-72},{t:.55,v:a,ease:"ease-out"}]}),t==="zoom-in"&&Object.assign(r,{opacity:[{t:0,v:0},{t:.5,v:1}],scale:[{t:0,v:.82},{t:.5,v:1,ease:"ease-out"}]}),t==="rotate-in"&&Object.assign(r,{opacity:[{t:0,v:0},{t:.55,v:1}],rotate:[{t:0,v:-10},{t:.55,v:0,ease:"ease-out"}]}),(t==="pop"||t==="bounce-in")&&Object.assign(r,{scale:[{t:0,v:.82},{t:.28,v:1.08},{t:.48,v:1}]}),t==="pulse"&&(r.scale=[{t:0,v:1},{t:.35,v:1.08},{t:.7,v:1}]),t==="float"&&(r.y=[{t:0,v:o},{t:1,v:o-22},{t:2,v:o}]),t==="wobble"&&(r.rotate=[{t:0,v:0},{t:.18,v:-5},{t:.38,v:4},{t:.6,v:0}]),t==="shake"&&(r.x=[{t:0,v:a},{t:.12,v:a-14},{t:.24,v:a+14},{t:.36,v:a}]),t==="heartbeat"&&(r.scale=[{t:0,v:1},{t:.2,v:1.12},{t:.36,v:1},{t:.52,v:1.08},{t:.7,v:1}]),t==="fade-out"&&(r.opacity=[{t:0,v:1},{t:.55,v:0}]),t==="zoom-out"&&Object.assign(r,{opacity:[{t:0,v:1},{t:.55,v:0}],scale:[{t:0,v:1},{t:.55,v:.84}]}),{...e,tracks:r}}function qn(e,t,a="line"){let o=t.filter(r=>Number.isFinite(r.x)&&Number.isFinite(r.y)).slice(0,80);return{...e,path:{kind:a,points:o},tracks:{...e.tracks||{},offset:e.tracks?.offset||[{t:0,v:0},{t:Math.max(.5,Ae(e.end,3)-Ae(e.start,0)),v:1,ease:"ease-out"}]}}}function jn(e){let t=e.type||"text",a=t==="text"?520:t==="ellipse"?220:360,o=t==="text"?_t(e.size,64)*1.4:t==="ellipse"?220:180;return{x:Ae(e.x,0),y:Ae(e.y,0),w:_t(e.w,a),h:_t(e.h,o),rotate:Ae(e.rotate,0)}}function yl(e,t,a){for(let o=e.length-1;o>=0;o-=1){let r=e[o],n=jn(r);if(t>=n.x-n.w/2&&t<=n.x+n.w/2&&a>=n.y-n.h/2&&a<=n.y+n.h/2)return r}return null}function bl(e){let t=je(e),{w:a,h:o}=ml(e),r=t.length+1;return{...e,layers:t.length?e.layers:void 0,duration:void 0,scenes:[...t,{id:`scene-${r}`,name:`Scene ${r}`,duration:4,transition:r%2===0?"push":"dissolve",bg:r%2===0?"#111827":"#0f766e",layers:[{id:`scene-${r}-title`,type:"text",text:`Scene ${r}`,x:a/2,y:o/2,size:64,weight:800,color:"#ffffff",tracks:na()}]}]}}function wl(e,t,a){let o=je(e);return o[t]?{...e,scenes:o.map((r,n)=>n===t?{...r,duration:_n(a,.5,30)}:r)}:e}function Cl(e,t,a){let o=je(e);return o[t]?{...e,scenes:o.map((r,n)=>n===t?{...r,transition:a}:r)}:e}function zn(e,t,a){let o=Math.max(0,Math.round(t*100)/100),r=Dh(e||[]),n=r.find(i=>Math.abs(Ae(i.t,0)-o)<.02);return n?n.v=a:r.push({t:o,v:a}),r.sort((i,s)=>Ae(i.t,0)-Ae(s.t,0))}function Dh(e){return e.filter(t=>typeof t=="object"&&t!==null).map(t=>({t:Math.max(0,Ae(t.t,0)),v:Ae(t.v,0),...typeof t.ease=="string"&&t.ease.trim()?{ease:t.ease.trim()}:{}})).sort((t,a)=>Ae(t.t,0)-Ae(a.t,0))}function Ba(e,t){return new RegExp(`${t}=(["'])(.*?)\\1`,"i").exec(e)?.[2]}function Eh(e){return e.replace(/<[^>]*>/g," ").replace(/\s+/g," ")}function Ae(e,t){let a=Number(e);return Number.isFinite(a)?a:t}function _t(e,t){let a=Number(e);return Number.isFinite(a)&&a>0?a:t}function _n(e,t,a){return Math.max(t,Math.min(a,Number.isFinite(e)?e:t))}var ir=!1;function Ll(e){ir=e===!0||!!e&&e!==null&&typeof e=="object"&&("enabled"in e?!!e.enabled:!!e.motion)}var Sl={info(e,t){ir&&console.info(`[motion] ${e}`,t??{})},warn(e,t){ir&&console.warn(`[motion] ${e}`,t??{})},error(e,t){ir&&console.error(`[motion] ${e}`,t??{})}};var Il="xpertai.remote_component",Rl=1,sa=new Map,ho=null,Oh=0,Na={requestTimeout:"Request timed out",remoteRequestFailed:"Remote request failed",unknownError:"Unknown error"};function Ee(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function xo(e,t,a){!ho&&e!=="ready"||parent.postMessage(Object.assign({channel:Il,protocolVersion:Rl,instanceId:ho,type:e},t||{}),"*",a||[])}function Wn(e,t,a){let o=String(++Oh);return new Promise((r,n)=>{sa.set(o,{resolve:r,reject:n});try{xo(e,Object.assign({requestId:o},t||{}),a)}catch(i){sa.delete(o),n(i instanceof Error?i:new Error(Na.remoteRequestFailed));return}setTimeout(()=>{sa.has(o)&&(sa.delete(o),n(new Error(Na.requestTimeout)))},3e4)})}function Pl(e){return Wn("requestData",{query:e||{}})}function Vt(e,t,a,o){return Wn("executeAction",{actionKey:e,targetId:t,input:a,parameters:o})}async function sr(e,t,a,o,r){let n=await r.arrayBuffer();return Wn("executeFileAction",{actionKey:e,targetId:t,input:a,parameters:o,file:{name:r.name,type:r.type,size:r.size,buffer:n}},[n])}function Re(e,t){xo("notify",{level:e,message:t})}function go(){let e=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,window.innerHeight||0,720);xo("resize",{height:e,viewportBound:!0})}function Gn(e){return e?Ee(e)?e.payload!==void 0?e.payload:e.data!==void 0?e.data:e.result!==void 0?e.result:e:e:null}function la(e){return typeof e=="object"&&e&&"message"in e&&e.message?String(e.message):String(e||Na.unknownError)}function kl(e){Na={...Na,...e}}function Tl(e,t){let a=null;function o(n){window.XpertRemoteUI?.applyTheme?.(n)}function r(n){o(n);let i={...a||{},theme:n};a=i,e(i),setTimeout(go,0)}window.addEventListener("message",n=>{let i=n.data;if(!(!Ee(i)||i.channel!==Il||i.protocolVersion!==Rl)){if(i.type==="init"){ho=typeof i.instanceId=="string"?i.instanceId:null,Ll(i.debug);let s={manifest:i.manifest,payload:i.payload,initialQuery:Nh(i.initialQuery),locale:typeof i.locale=="string"?i.locale:void 0,theme:i.theme,debug:i.debug};a=s,o(i.theme),e(s),Sl.info("bridge.init",{instanceId:ho??"",locale:s.locale??"",hasInitialQuery:i.initialQuery!==void 0}),setTimeout(go,0);return}if(i.instanceId===ho){if(Fh(i)){r(Hh(i));return}if(i.type==="hostEvent"){t(Bh(i));return}if(i.requestId&&sa.has(String(i.requestId))){let s=sa.get(String(i.requestId));if(sa.delete(String(i.requestId)),!s)return;i.type==="error"?s.reject(new Error(String(i.message||Na.remoteRequestFailed))):s.resolve(i)}}}})}function Bh(e){return e.event!==void 0?e.event:e.payload!==void 0?e.payload:e.data!==void 0?e.data:e.result!==void 0?e.result:e}function Fh(e){return["theme","themeChanged","theme-change","hostThemeChanged","host-theme-changed"].includes(String(e.type||""))}function Nh(e){return Ee(e)?{...e,parameters:Ee(e.parameters)?e.parameters:void 0,selectionId:e.selectionId}:{}}function Hh(e){return e.theme!==void 0?e.theme:Ee(e.payload)&&e.payload.theme!==void 0?e.payload.theme:Ee(e.data)&&e.data.theme!==void 0?e.data.theme:e.payload??e.data??null}var Ml=["library","html","video"],Al=["load","scroll","hover","click"],Dl=["fade","slide-up","slide-down","slide-left","slide-right","zoom","rotate","blur","pop","pulse","shake","wobble","sink"],lr=["opacity","x","y","scale","rotate","blur"],El=[{value:"desktop",labelKey:"deviceDesktop"},{value:"tablet",labelKey:"deviceTablet"},{value:"mobile",labelKey:"deviceMobile"}],Ol=[{value:"all",labelKey:"filterAllSurfaces"},{value:"web",labelKey:"filterWeb"},{value:"video",labelKey:"filterVideo"}],Bl=[{value:"all",labelKey:"filterAllTargets"},{value:"text",labelKey:"filterText"},{value:"button",labelKey:"filterButton"},{value:"card",labelKey:"filterCard"},{value:"image",labelKey:"filterImage"},{value:"video",labelKey:"filterVideoLayer"},{value:"background",labelKey:"filterBackground"}],Fl=[{value:"all",labelKey:"filterAllStatuses"},{value:"ready",labelKey:"filterReady"}],Nl=[{value:"none",labelKey:"kineticNone"},{value:"word-rise",labelKey:"kineticWordRise"},{value:"char-rise",labelKey:"kineticCharRise"},{value:"char-pop",labelKey:"kineticCharPop"},{value:"typewriter",labelKey:"kineticTypewriter"}],Hl=[{value:"cut",labelKey:"transitionCut"},{value:"dissolve",labelKey:"transitionDissolve"},{value:"push",labelKey:"transitionPush"},{value:"fade",labelKey:"transitionFade"}];function zl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function zh(...e){return t=>{let a=!1,o=e.map(r=>{let n=zl(r,t);return!a&&typeof n=="function"&&(a=!0),n});if(a)return()=>{for(let r=0;r<o.length;r++){let n=o[r];typeof n=="function"?n():zl(e[r],null)}}}}function ce(...e){return Q(zh(...e),e)}function vt(e){let t=I((a,o)=>{let{children:r,...n}=a,i=null,s=!1,l=[];_l(r)&&typeof dr=="function"&&(r=dr(r._payload)),ft.forEach(r,p=>{if(jh(p)){s=!0;let g=p,v="child"in g.props?g.props.child:g.props.children;_l(v)&&typeof dr=="function"&&(v=dr(v._payload)),i=Vh(g,v),l.push(i?.props?.children)}else l.push(p)}),i?i=Rt(i,void 0,l):!s&&ft.count(r)===1&&Ia(r)&&(i=r);let u=i?qh(i):void 0,c=ce(o,u);if(!i){if(r||r===0)throw new Error(s?$h(e):Kh(e));return r}let f=Uh(n,i.props??{});return i.type!==Ye&&(f.ref=o?c:u),Rt(i,f)});return t.displayName=`${e}.Slot`,t}var Vl=vt("Slot"),_h=Symbol.for("radix.slottable");var Vh=(e,t)=>{if("child"in e.props){let a=e.props.child;return Ia(a)?Rt(a,void 0,e.props.children(a.props.children)):null}return Ia(t)?t:null};function Uh(e,t){let a={...t};for(let o in t){let r=e[o],n=t[o];/^on[A-Z]/.test(o)?r&&n?a[o]=(...s)=>{let l=n(...s);return r(...s),l}:r&&(a[o]=r):o==="style"?a[o]={...r,...n}:o==="className"&&(a[o]=[r,n].filter(Boolean).join(" "))}return{...e,...a}}function qh(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}function jh(e){return Ia(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===_h}var Wh=Symbol.for("react.lazy");function _l(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Wh&&"_payload"in e&&Gh(e._payload)}function Gh(e){return typeof e=="object"&&e!==null&&"then"in e}var Kh=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,$h=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,dr=G[" use ".trim().toString()];var Ul=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ql=Vo,ur=(e,t)=>a=>{var o;if(t?.variants==null)return ql(e,a?.class,a?.className);let{variants:r,defaultVariants:n}=t,i=Object.keys(r).map(u=>{let c=a?.[u],f=n?.[u];if(c===null)return null;let p=Ul(c)||Ul(f);return r[u][p]}),s=a&&Object.entries(a).reduce((u,c)=>{let[f,p]=c;return p===void 0||(u[f]=p),u},{}),l=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((u,c)=>{let{class:f,className:p,...g}=c;return Object.entries(g).every(v=>{let[m,h]=v;return Array.isArray(h)?h.includes({...n,...s}[m]):{...n,...s}[m]===h})?[...u,f,p]:u},[]);return ql(e,i,l,a?.class,a?.className)};var Xh=ur("xps-button",{variants:{variant:{default:"xps-button--default",secondary:"xps-button--secondary",outline:"xps-button--outline",ghost:"xps-button--ghost",destructive:"xps-button--destructive",destructiveOutline:"xps-button--destructive-outline"},size:{default:"",sm:"xps-button--sm",lg:"xps-button--lg",icon:"xps-button--icon"}},defaultVariants:{variant:"default",size:"default"}}),Kn=I(({className:e,variant:t,size:a,asChild:o=!1,type:r,...n},i)=>{let s=o?Vl:"button",l={className:de(Xh({variant:t,size:a}),e),ref:i,...n};return o||(l.type=r??"button"),N(s,l)});Kn.displayName="Button";function Jh(e){return window[e]}var Ut=Jh("ReactDOM");var vo=Ut.createPortal,cr=Ut.flushSync,pb=Ut.findDOMNode,hb=Ut.hydrate,gb=Ut.render,xb=Ut.unstable_batchedUpdates,vb=Ut.unmountComponentAtNode,yb=Ut.version;function Ha(e,[t,a]){return Math.min(a,Math.max(t,e))}var wb=!!(typeof window<"u"&&window.document&&window.document.createElement);function ae(e,t,{checkForDefaultPrevented:a=!0}={}){return function(r){if(e?.(r),a===!1||!r.defaultPrevented)return t?.(r)}}function Yh(e){return window[e]}var Wl=Yh("React"),Zh=Wl.createElement;function jl(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function Qh(e,t){return t===void 0?jl(e)?e:null:{...jl(e)?e:{},key:t}}var Dt=Wl.Fragment,L=(e,t,a)=>Zh(e,Qh(t,a)),yt=L;function Gl(e,t){let a=Pt(t);a.displayName=e+"Context";let o=n=>{let{children:i,...s}=n,l=he(()=>s,Object.values(s));return L(a.Provider,{value:l,children:i})};o.displayName=e+"Provider";function r(n){let i=kt(a);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${n}\` must be used within \`${e}\``)}return[o,r]}function We(e,t=[]){let a=[];function o(n,i){let s=Pt(i);s.displayName=n+"Context";let l=a.length;a=[...a,i];let u=f=>{let{scope:p,children:g,...v}=f,m=p?.[e]?.[l]||s,h=he(()=>v,Object.values(v));return L(m.Provider,{value:h,children:g})};u.displayName=n+"Provider";function c(f,p){let g=p?.[e]?.[l]||s,v=kt(g);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${n}\``)}return[u,c]}let r=()=>{let n=a.map(i=>Pt(i));return function(s){let l=s?.[e]||n;return he(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return r.scopeName=e,[o,eg(r,...t)]}function eg(...e){let t=e[0];if(e.length===1)return t;let a=()=>{let o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(n){let i=o.reduce((s,{useScope:l,scopeName:u})=>{let f=l(n)[`__scope${u}`];return{...s,...f}},{});return he(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return a.scopeName=t.scopeName,a}function za(e){let t=e+"CollectionProvider",[a,o]=We(t),[r,n]=a(t,{collectionRef:{current:null},itemMap:new Map}),i=m=>{let{scope:h,children:y}=m,b=D(null),w=D(new Map).current;return L(r,{scope:h,itemMap:w,collectionRef:b,children:y})};i.displayName=t;let s=e+"CollectionSlot",l=vt(s),u=I((m,h)=>{let{scope:y,children:b}=m,w=n(s,y),C=ce(h,w.collectionRef);return L(l,{ref:C,children:b})});u.displayName=s;let c=e+"CollectionItemSlot",f="data-radix-collection-item",p=vt(c),g=I((m,h)=>{let{scope:y,children:b,...w}=m,C=D(null),P=ce(h,C),M=n(c,y);return F(()=>(M.itemMap.set(C,{ref:C,...w}),()=>{M.itemMap.delete(C)})),L(p,{[f]:"",ref:P,children:b})});g.displayName=c;function v(m){let h=n(e+"CollectionConsumer",m);return Q(()=>{let b=h.collectionRef.current;if(!b)return[];let w=Array.from(b.querySelectorAll(`[${f}]`));return Array.from(h.itemMap.values()).sort((M,T)=>w.indexOf(M.ref.current)-w.indexOf(T.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:i,Slot:u,ItemSlot:g},v,o]}var tg=Pt(void 0);function qt(e){let t=kt(tg);return e||t||"ltr"}var ag=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],te=ag.reduce((e,t)=>{let a=vt(`Primitive.${t}`),o=I((r,n)=>{let{asChild:i,...s}=r,l=i?a:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),L(l,{...s,ref:n})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function Kl(e,t){e&&cr(()=>e.dispatchEvent(t))}function Ge(e){let t=D(e);return F(()=>{t.current=e}),he(()=>((...a)=>t.current?.(...a)),[])}function $l(e,t=globalThis?.document){let a=Ge(e);F(()=>{let o=r=>{r.key==="Escape"&&a(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[a,t])}var og="DismissableLayer",$n="dismissableLayer.update",rg="dismissableLayer.pointerDownOutside",ng="dismissableLayer.focusOutside",Xl,Yl=Pt({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),yo=I((e,t)=>{let{disableOutsidePointerEvents:a=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:n,onInteractOutside:i,onDismiss:s,...l}=e,u=kt(Yl),[c,f]=k(null),p=c?.ownerDocument??globalThis?.document,[,g]=k({}),v=ce(t,T=>f(T)),m=Array.from(u.layers),[h]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(h),b=c?m.indexOf(c):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,C=b>=y,P=lg(T=>{let B=T.target,U=[...u.branches].some(Y=>Y.contains(B));!C||U||(r?.(T),i?.(T),T.defaultPrevented||s?.())},p),M=dg(T=>{let B=T.target;[...u.branches].some(Y=>Y.contains(B))||(n?.(T),i?.(T),T.defaultPrevented||s?.())},p);return $l(T=>{b===u.layers.size-1&&(o?.(T),!T.defaultPrevented&&s&&(T.preventDefault(),s()))},p),F(()=>{if(c)return a&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Xl=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),Jl(),()=>{a&&(u.layersWithOutsidePointerEventsDisabled.delete(c),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=Xl))}},[c,p,a,u]),F(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),Jl())},[c,u]),F(()=>{let T=()=>g({});return document.addEventListener($n,T),()=>document.removeEventListener($n,T)},[]),L(te.div,{...l,ref:v,style:{pointerEvents:w?C?"auto":"none":void 0,...e.style},onFocusCapture:ae(e.onFocusCapture,M.onFocusCapture),onBlurCapture:ae(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:ae(e.onPointerDownCapture,P.onPointerDownCapture)})});yo.displayName=og;var ig="DismissableLayerBranch",sg=I((e,t)=>{let a=kt(Yl),o=D(null),r=ce(t,o);return F(()=>{let n=o.current;if(n)return a.branches.add(n),()=>{a.branches.delete(n)}},[a.branches]),L(te.div,{...e,ref:r})});sg.displayName=ig;function lg(e,t=globalThis?.document){let a=Ge(e),o=D(!1),r=D(()=>{});return F(()=>{let n=s=>{if(s.target&&!o.current){let u=function(){Zl(rg,a,c,{discrete:!0})};var l=u;let c={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=u,t.addEventListener("click",r.current,{once:!0})):u()}else t.removeEventListener("click",r.current);o.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",n)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",n),t.removeEventListener("click",r.current)}},[t,a]),{onPointerDownCapture:()=>o.current=!0}}function dg(e,t=globalThis?.document){let a=Ge(e),o=D(!1);return F(()=>{let r=n=>{n.target&&!o.current&&Zl(ng,a,{originalEvent:n},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,a]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Jl(){let e=new CustomEvent($n);document.dispatchEvent(e)}function Zl(e,t,a,{discrete:o}){let r=a.originalEvent.target,n=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:a});t&&r.addEventListener(e,t,{once:!0}),o?Kl(r,n):r.dispatchEvent(n)}var mr=0,_a=null;function pr(){F(()=>{_a||(_a={start:Ql(),end:Ql()});let{start:e,end:t}=_a;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),mr++,()=>{mr===1&&(_a?.start.remove(),_a?.end.remove(),_a=null),mr=Math.max(0,mr-1)}},[])}function Ql(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Xn="focusScope.autoFocusOnMount",Jn="focusScope.autoFocusOnUnmount",ed={bubbles:!1,cancelable:!0},ug="FocusScope",bo=I((e,t)=>{let{loop:a=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:n,...i}=e,[s,l]=k(null),u=Ge(r),c=Ge(n),f=D(null),p=ce(t,m=>l(m)),g=D({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;F(()=>{if(o){let b=function(M){if(g.paused||!s)return;let T=M.target;s.contains(T)?f.current=T:jt(f.current,{select:!0})},w=function(M){if(g.paused||!s)return;let T=M.relatedTarget;T!==null&&(s.contains(T)||jt(f.current,{select:!0}))},C=function(M){if(document.activeElement===document.body)for(let B of M)B.removedNodes.length>0&&jt(s)};var m=b,h=w,y=C;document.addEventListener("focusin",b),document.addEventListener("focusout",w);let P=new MutationObserver(C);return s&&P.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",w),P.disconnect()}}},[o,s,g.paused]),F(()=>{if(s){ad.add(g);let m=document.activeElement;if(!s.contains(m)){let y=new CustomEvent(Xn,ed);s.addEventListener(Xn,u),s.dispatchEvent(y),y.defaultPrevented||(cg(gg(rd(s)),{select:!0}),document.activeElement===m&&jt(s))}return()=>{s.removeEventListener(Xn,u),setTimeout(()=>{let y=new CustomEvent(Jn,ed);s.addEventListener(Jn,c),s.dispatchEvent(y),y.defaultPrevented||jt(m??document.body,{select:!0}),s.removeEventListener(Jn,c),ad.remove(g)},0)}}},[s,u,c,g]);let v=Q(m=>{if(!a&&!o||g.paused)return;let h=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(h&&y){let b=m.currentTarget,[w,C]=fg(b);w&&C?!m.shiftKey&&y===C?(m.preventDefault(),a&&jt(w,{select:!0})):m.shiftKey&&y===w&&(m.preventDefault(),a&&jt(C,{select:!0})):y===b&&m.preventDefault()}},[a,o,g.paused]);return L(te.div,{tabIndex:-1,...i,ref:p,onKeyDown:v})});bo.displayName=ug;function cg(e,{select:t=!1}={}){let a=document.activeElement;for(let o of e)if(jt(o,{select:t}),document.activeElement!==a)return}function fg(e){let t=rd(e),a=td(t,e),o=td(t.reverse(),e);return[a,o]}function rd(e){let t=[],a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{let r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)t.push(a.currentNode);return t}function td(e,t){for(let a of e)if(!mg(a,{upTo:t}))return a}function mg(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function pg(e){return e instanceof HTMLInputElement&&"select"in e}function jt(e,{select:t=!1}={}){if(e&&e.focus){let a=document.activeElement;e.focus({preventScroll:!0}),e!==a&&pg(e)&&t&&e.select()}}var ad=hg();function hg(){let e=[];return{add(t){let a=e[0];t!==a&&a?.pause(),e=od(e,t),e.unshift(t)},remove(t){e=od(e,t),e[0]?.resume()}}}function od(e,t){let a=[...e],o=a.indexOf(t);return o!==-1&&a.splice(o,1),a}function gg(e){return e.filter(t=>t.tagName!=="A")}var Le=globalThis?.document?Jt:()=>{};var xg=G[" useId ".trim().toString()]||(()=>{}),vg=0;function tt(e){let[t,a]=k(xg());return Le(()=>{e||a(o=>o??String(vg++))},[e]),e||(t?`radix-${t}`:"")}var sd=["top","right","bottom","left"];var bt=Math.min,Ue=Math.max,Co=Math.round,Lo=Math.floor,nt=e=>({x:e,y:e}),yg={left:"right",right:"left",bottom:"top",top:"bottom"};function gr(e,t,a){return Ue(e,bt(t,a))}function wt(e,t){return typeof e=="function"?e(t):e}function Ct(e){return e.split("-")[0]}function da(e){return e.split("-")[1]}function xr(e){return e==="x"?"y":"x"}function vr(e){return e==="y"?"height":"width"}function it(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function yr(e){return xr(it(e))}function ld(e,t,a){a===void 0&&(a=!1);let o=da(e),r=yr(e),n=vr(r),i=r==="x"?o===(a?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[n]>t.floating[n]&&(i=wo(i)),[i,wo(i)]}function dd(e){let t=wo(e);return[hr(e),t,hr(t)]}function hr(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var nd=["left","right"],id=["right","left"],bg=["top","bottom"],wg=["bottom","top"];function Cg(e,t,a){switch(e){case"top":case"bottom":return a?t?id:nd:t?nd:id;case"left":case"right":return t?bg:wg;default:return[]}}function ud(e,t,a,o){let r=da(e),n=Cg(Ct(e),a==="start",o);return r&&(n=n.map(i=>i+"-"+r),t&&(n=n.concat(n.map(hr)))),n}function wo(e){let t=Ct(e);return yg[t]+e.slice(t.length)}function Lg(e){return{top:0,right:0,bottom:0,left:0,...e}}function Yn(e){return typeof e!="number"?Lg(e):{top:e,right:e,bottom:e,left:e}}function ua(e){let{x:t,y:a,width:o,height:r}=e;return{width:o,height:r,top:a,left:t,right:t+o,bottom:a+r,x:t,y:a}}function cd(e,t,a){let{reference:o,floating:r}=e,n=it(t),i=yr(t),s=vr(i),l=Ct(t),u=n==="y",c=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,p=o[s]/2-r[s]/2,g;switch(l){case"top":g={x:c,y:o.y-r.height};break;case"bottom":g={x:c,y:o.y+o.height};break;case"right":g={x:o.x+o.width,y:f};break;case"left":g={x:o.x-r.width,y:f};break;default:g={x:o.x,y:o.y}}switch(da(t)){case"start":g[i]-=p*(a&&u?-1:1);break;case"end":g[i]+=p*(a&&u?-1:1);break}return g}async function pd(e,t){var a;t===void 0&&(t={});let{x:o,y:r,platform:n,rects:i,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:p=!1,padding:g=0}=wt(t,e),v=Yn(g),h=s[p?f==="floating"?"reference":"floating":f],y=ua(await n.getClippingRect({element:(a=await(n.isElement==null?void 0:n.isElement(h)))==null||a?h:h.contextElement||await(n.getDocumentElement==null?void 0:n.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),b=f==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,w=await(n.getOffsetParent==null?void 0:n.getOffsetParent(s.floating)),C=await(n.isElement==null?void 0:n.isElement(w))?await(n.getScale==null?void 0:n.getScale(w))||{x:1,y:1}:{x:1,y:1},P=ua(n.convertOffsetParentRelativeRectToViewportRelativeRect?await n.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:b,offsetParent:w,strategy:l}):b);return{top:(y.top-P.top+v.top)/C.y,bottom:(P.bottom-y.bottom+v.bottom)/C.y,left:(y.left-P.left+v.left)/C.x,right:(P.right-y.right+v.right)/C.x}}var Sg=50,hd=async(e,t,a)=>{let{placement:o="bottom",strategy:r="absolute",middleware:n=[],platform:i}=a,s=i.detectOverflow?i:{...i,detectOverflow:pd},l=await(i.isRTL==null?void 0:i.isRTL(t)),u=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:c,y:f}=cd(u,o,l),p=o,g=0,v={};for(let m=0;m<n.length;m++){let h=n[m];if(!h)continue;let{name:y,fn:b}=h,{x:w,y:C,data:P,reset:M}=await b({x:c,y:f,initialPlacement:o,placement:p,strategy:r,middlewareData:v,rects:u,platform:s,elements:{reference:e,floating:t}});c=w??c,f=C??f,v[y]={...v[y],...P},M&&g<Sg&&(g++,typeof M=="object"&&(M.placement&&(p=M.placement),M.rects&&(u=M.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):M.rects),{x:c,y:f}=cd(u,p,l)),m=-1)}return{x:c,y:f,placement:p,strategy:r,middlewareData:v}},gd=e=>({name:"arrow",options:e,async fn(t){let{x:a,y:o,placement:r,rects:n,platform:i,elements:s,middlewareData:l}=t,{element:u,padding:c=0}=wt(e,t)||{};if(u==null)return{};let f=Yn(c),p={x:a,y:o},g=yr(r),v=vr(g),m=await i.getDimensions(u),h=g==="y",y=h?"top":"left",b=h?"bottom":"right",w=h?"clientHeight":"clientWidth",C=n.reference[v]+n.reference[g]-p[g]-n.floating[v],P=p[g]-n.reference[g],M=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u)),T=M?M[w]:0;(!T||!await(i.isElement==null?void 0:i.isElement(M)))&&(T=s.floating[w]||n.floating[v]);let B=C/2-P/2,U=T/2-m[v]/2-1,Y=bt(f[y],U),j=bt(f[b],U),E=Y,W=T-m[v]-j,Z=T/2-m[v]/2+B,R=gr(E,Z,W),H=!l.arrow&&da(r)!=null&&Z!==R&&n.reference[v]/2-(Z<E?Y:j)-m[v]/2<0,K=H?Z<E?Z-E:Z-W:0;return{[g]:p[g]+K,data:{[g]:R,centerOffset:Z-R-K,...H&&{alignmentOffset:K}},reset:H}}});var xd=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var a,o;let{placement:r,middlewareData:n,rects:i,initialPlacement:s,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:m=!0,...h}=wt(e,t);if((a=n.arrow)!=null&&a.alignmentOffset)return{};let y=Ct(r),b=it(s),w=Ct(s)===s,C=await(l.isRTL==null?void 0:l.isRTL(u.floating)),P=p||(w||!m?[wo(s)]:dd(s)),M=v!=="none";!p&&M&&P.push(...ud(s,m,v,C));let T=[s,...P],B=await l.detectOverflow(t,h),U=[],Y=((o=n.flip)==null?void 0:o.overflows)||[];if(c&&U.push(B[y]),f){let Z=ld(r,i,C);U.push(B[Z[0]],B[Z[1]])}if(Y=[...Y,{placement:r,overflows:U}],!U.every(Z=>Z<=0)){var j,E;let Z=(((j=n.flip)==null?void 0:j.index)||0)+1,R=T[Z];if(R&&(!(f==="alignment"?b!==it(R):!1)||Y.every(O=>it(O.placement)===b?O.overflows[0]>0:!0)))return{data:{index:Z,overflows:Y},reset:{placement:R}};let H=(E=Y.filter(K=>K.overflows[0]<=0).sort((K,O)=>K.overflows[1]-O.overflows[1])[0])==null?void 0:E.placement;if(!H)switch(g){case"bestFit":{var W;let K=(W=Y.filter(O=>{if(M){let X=it(O.placement);return X===b||X==="y"}return!0}).map(O=>[O.placement,O.overflows.filter(X=>X>0).reduce((X,se)=>X+se,0)]).sort((O,X)=>O[1]-X[1])[0])==null?void 0:W[0];K&&(H=K);break}case"initialPlacement":H=s;break}if(r!==H)return{reset:{placement:H}}}return{}}}};function fd(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function md(e){return sd.some(t=>e[t]>=0)}var vd=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){let{rects:a,platform:o}=t,{strategy:r="referenceHidden",...n}=wt(e,t);switch(r){case"referenceHidden":{let i=await o.detectOverflow(t,{...n,elementContext:"reference"}),s=fd(i,a.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:md(s)}}}case"escaped":{let i=await o.detectOverflow(t,{...n,altBoundary:!0}),s=fd(i,a.floating);return{data:{escapedOffsets:s,escaped:md(s)}}}default:return{}}}}};var yd=new Set(["left","top"]);async function Ig(e,t){let{placement:a,platform:o,elements:r}=e,n=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=Ct(a),s=da(a),l=it(a)==="y",u=yd.has(i)?-1:1,c=n&&l?-1:1,f=wt(t,e),{mainAxis:p,crossAxis:g,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&typeof v=="number"&&(g=s==="end"?v*-1:v),l?{x:g*c,y:p*u}:{x:p*u,y:g*c}}var bd=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var a,o;let{x:r,y:n,placement:i,middlewareData:s}=t,l=await Ig(t,e);return i===((a=s.offset)==null?void 0:a.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:n+l.y,data:{...l,placement:i}}}}},wd=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:a,y:o,placement:r,platform:n}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:y=>{let{x:b,y:w}=y;return{x:b,y:w}}},...u}=wt(e,t),c={x:a,y:o},f=await n.detectOverflow(t,u),p=it(Ct(r)),g=xr(p),v=c[g],m=c[p];if(i){let y=g==="y"?"top":"left",b=g==="y"?"bottom":"right",w=v+f[y],C=v-f[b];v=gr(w,v,C)}if(s){let y=p==="y"?"top":"left",b=p==="y"?"bottom":"right",w=m+f[y],C=m-f[b];m=gr(w,m,C)}let h=l.fn({...t,[g]:v,[p]:m});return{...h,data:{x:h.x-a,y:h.y-o,enabled:{[g]:i,[p]:s}}}}}},Cd=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:a,y:o,placement:r,rects:n,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=wt(e,t),c={x:a,y:o},f=it(r),p=xr(f),g=c[p],v=c[f],m=wt(s,t),h=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){let w=p==="y"?"height":"width",C=n.reference[p]-n.floating[w]+h.mainAxis,P=n.reference[p]+n.reference[w]-h.mainAxis;g<C?g=C:g>P&&(g=P)}if(u){var y,b;let w=p==="y"?"width":"height",C=yd.has(Ct(r)),P=n.reference[f]-n.floating[w]+(C&&((y=i.offset)==null?void 0:y[f])||0)+(C?0:h.crossAxis),M=n.reference[f]+n.reference[w]+(C?0:((b=i.offset)==null?void 0:b[f])||0)-(C?h.crossAxis:0);v<P?v=P:v>M&&(v=M)}return{[p]:g,[f]:v}}}},Ld=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var a,o;let{placement:r,rects:n,platform:i,elements:s}=t,{apply:l=()=>{},...u}=wt(e,t),c=await i.detectOverflow(t,u),f=Ct(r),p=da(r),g=it(r)==="y",{width:v,height:m}=n.floating,h,y;f==="top"||f==="bottom"?(h=f,y=p===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(y=f,h=p==="end"?"top":"bottom");let b=m-c.top-c.bottom,w=v-c.left-c.right,C=bt(m-c[h],b),P=bt(v-c[y],w),M=!t.middlewareData.shift,T=C,B=P;if((a=t.middlewareData.shift)!=null&&a.enabled.x&&(B=w),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(T=b),M&&!p){let Y=Ue(c.left,0),j=Ue(c.right,0),E=Ue(c.top,0),W=Ue(c.bottom,0);g?B=v-2*(Y!==0||j!==0?Y+j:Ue(c.left,c.right)):T=m-2*(E!==0||W!==0?E+W:Ue(c.top,c.bottom))}await l({...t,availableWidth:B,availableHeight:T});let U=await i.getDimensions(s.floating);return v!==U.width||m!==U.height?{reset:{rects:!0}}:{}}}};function br(){return typeof window<"u"}function ma(e){return Id(e)?(e.nodeName||"").toLowerCase():"#document"}function Ke(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function st(e){var t;return(t=(Id(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Id(e){return br()?e instanceof Node||e instanceof Ke(e).Node:!1}function at(e){return br()?e instanceof Element||e instanceof Ke(e).Element:!1}function Lt(e){return br()?e instanceof HTMLElement||e instanceof Ke(e).HTMLElement:!1}function Sd(e){return!br()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ke(e).ShadowRoot}function Va(e){let{overflow:t,overflowX:a,overflowY:o,display:r}=ot(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+a)&&r!=="inline"&&r!=="contents"}function Rd(e){return/^(table|td|th)$/.test(ma(e))}function So(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}var Rg=/transform|translate|scale|rotate|perspective|filter/,Pg=/paint|layout|strict|content/,ca=e=>!!e&&e!=="none",Zn;function wr(e){let t=at(e)?ot(e):e;return ca(t.transform)||ca(t.translate)||ca(t.scale)||ca(t.rotate)||ca(t.perspective)||!Cr()&&(ca(t.backdropFilter)||ca(t.filter))||Rg.test(t.willChange||"")||Pg.test(t.contain||"")}function Pd(e){let t=Et(e);for(;Lt(t)&&!pa(t);){if(wr(t))return t;if(So(t))return null;t=Et(t)}return null}function Cr(){return Zn==null&&(Zn=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Zn}function pa(e){return/^(html|body|#document)$/.test(ma(e))}function ot(e){return Ke(e).getComputedStyle(e)}function Io(e){return at(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Et(e){if(ma(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Sd(e)&&e.host||st(e);return Sd(t)?t.host:t}function kd(e){let t=Et(e);return pa(t)?e.ownerDocument?e.ownerDocument.body:e.body:Lt(t)&&Va(t)?t:kd(t)}function fa(e,t,a){var o;t===void 0&&(t=[]),a===void 0&&(a=!0);let r=kd(e),n=r===((o=e.ownerDocument)==null?void 0:o.body),i=Ke(r);if(n){let s=Lr(i);return t.concat(i,i.visualViewport||[],Va(r)?r:[],s&&a?fa(s):[])}else return t.concat(r,fa(r,[],a))}function Lr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Dd(e){let t=ot(e),a=parseFloat(t.width)||0,o=parseFloat(t.height)||0,r=Lt(e),n=r?e.offsetWidth:a,i=r?e.offsetHeight:o,s=Co(a)!==n||Co(o)!==i;return s&&(a=n,o=i),{width:a,height:o,$:s}}function ei(e){return at(e)?e:e.contextElement}function Ua(e){let t=ei(e);if(!Lt(t))return nt(1);let a=t.getBoundingClientRect(),{width:o,height:r,$:n}=Dd(t),i=(n?Co(a.width):a.width)/o,s=(n?Co(a.height):a.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}var kg=nt(0);function Ed(e){let t=Ke(e);return!Cr()||!t.visualViewport?kg:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Tg(e,t,a){return t===void 0&&(t=!1),!a||t&&a!==Ke(e)?!1:t}function ha(e,t,a,o){t===void 0&&(t=!1),a===void 0&&(a=!1);let r=e.getBoundingClientRect(),n=ei(e),i=nt(1);t&&(o?at(o)&&(i=Ua(o)):i=Ua(e));let s=Tg(n,a,o)?Ed(n):nt(0),l=(r.left+s.x)/i.x,u=(r.top+s.y)/i.y,c=r.width/i.x,f=r.height/i.y;if(n){let p=Ke(n),g=o&&at(o)?Ke(o):o,v=p,m=Lr(v);for(;m&&o&&g!==v;){let h=Ua(m),y=m.getBoundingClientRect(),b=ot(m),w=y.left+(m.clientLeft+parseFloat(b.paddingLeft))*h.x,C=y.top+(m.clientTop+parseFloat(b.paddingTop))*h.y;l*=h.x,u*=h.y,c*=h.x,f*=h.y,l+=w,u+=C,v=Ke(m),m=Lr(v)}}return ua({width:c,height:f,x:l,y:u})}function Sr(e,t){let a=Io(e).scrollLeft;return t?t.left+a:ha(st(e)).left+a}function Od(e,t){let a=e.getBoundingClientRect(),o=a.left+t.scrollLeft-Sr(e,a),r=a.top+t.scrollTop;return{x:o,y:r}}function Mg(e){let{elements:t,rect:a,offsetParent:o,strategy:r}=e,n=r==="fixed",i=st(o),s=t?So(t.floating):!1;if(o===i||s&&n)return a;let l={scrollLeft:0,scrollTop:0},u=nt(1),c=nt(0),f=Lt(o);if((f||!f&&!n)&&((ma(o)!=="body"||Va(i))&&(l=Io(o)),f)){let g=ha(o);u=Ua(o),c.x=g.x+o.clientLeft,c.y=g.y+o.clientTop}let p=i&&!f&&!n?Od(i,l):nt(0);return{width:a.width*u.x,height:a.height*u.y,x:a.x*u.x-l.scrollLeft*u.x+c.x+p.x,y:a.y*u.y-l.scrollTop*u.y+c.y+p.y}}function Ag(e){return Array.from(e.getClientRects())}function Dg(e){let t=st(e),a=Io(e),o=e.ownerDocument.body,r=Ue(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),n=Ue(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight),i=-a.scrollLeft+Sr(e),s=-a.scrollTop;return ot(o).direction==="rtl"&&(i+=Ue(t.clientWidth,o.clientWidth)-r),{width:r,height:n,x:i,y:s}}var Td=25;function Eg(e,t){let a=Ke(e),o=st(e),r=a.visualViewport,n=o.clientWidth,i=o.clientHeight,s=0,l=0;if(r){n=r.width,i=r.height;let c=Cr();(!c||c&&t==="fixed")&&(s=r.offsetLeft,l=r.offsetTop)}let u=Sr(o);if(u<=0){let c=o.ownerDocument,f=c.body,p=getComputedStyle(f),g=c.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,v=Math.abs(o.clientWidth-f.clientWidth-g);v<=Td&&(n-=v)}else u<=Td&&(n+=u);return{width:n,height:i,x:s,y:l}}function Og(e,t){let a=ha(e,!0,t==="fixed"),o=a.top+e.clientTop,r=a.left+e.clientLeft,n=Lt(e)?Ua(e):nt(1),i=e.clientWidth*n.x,s=e.clientHeight*n.y,l=r*n.x,u=o*n.y;return{width:i,height:s,x:l,y:u}}function Md(e,t,a){let o;if(t==="viewport")o=Eg(e,a);else if(t==="document")o=Dg(st(e));else if(at(t))o=Og(t,a);else{let r=Ed(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return ua(o)}function Bd(e,t){let a=Et(e);return a===t||!at(a)||pa(a)?!1:ot(a).position==="fixed"||Bd(a,t)}function Bg(e,t){let a=t.get(e);if(a)return a;let o=fa(e,[],!1).filter(s=>at(s)&&ma(s)!=="body"),r=null,n=ot(e).position==="fixed",i=n?Et(e):e;for(;at(i)&&!pa(i);){let s=ot(i),l=wr(i);!l&&s.position==="fixed"&&(r=null),(n?!l&&!r:!l&&s.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||Va(i)&&!l&&Bd(e,i))?o=o.filter(c=>c!==i):r=s,i=Et(i)}return t.set(e,o),o}function Fg(e){let{element:t,boundary:a,rootBoundary:o,strategy:r}=e,i=[...a==="clippingAncestors"?So(t)?[]:Bg(t,this._c):[].concat(a),o],s=Md(t,i[0],r),l=s.top,u=s.right,c=s.bottom,f=s.left;for(let p=1;p<i.length;p++){let g=Md(t,i[p],r);l=Ue(g.top,l),u=bt(g.right,u),c=bt(g.bottom,c),f=Ue(g.left,f)}return{width:u-f,height:c-l,x:f,y:l}}function Ng(e){let{width:t,height:a}=Dd(e);return{width:t,height:a}}function Hg(e,t,a){let o=Lt(t),r=st(t),n=a==="fixed",i=ha(e,!0,n,t),s={scrollLeft:0,scrollTop:0},l=nt(0);function u(){l.x=Sr(r)}if(o||!o&&!n)if((ma(t)!=="body"||Va(r))&&(s=Io(t)),o){let g=ha(t,!0,n,t);l.x=g.x+t.clientLeft,l.y=g.y+t.clientTop}else r&&u();n&&!o&&r&&u();let c=r&&!o&&!n?Od(r,s):nt(0),f=i.left+s.scrollLeft-l.x-c.x,p=i.top+s.scrollTop-l.y-c.y;return{x:f,y:p,width:i.width,height:i.height}}function Qn(e){return ot(e).position==="static"}function Ad(e,t){if(!Lt(e)||ot(e).position==="fixed")return null;if(t)return t(e);let a=e.offsetParent;return st(e)===a&&(a=a.ownerDocument.body),a}function Fd(e,t){let a=Ke(e);if(So(e))return a;if(!Lt(e)){let r=Et(e);for(;r&&!pa(r);){if(at(r)&&!Qn(r))return r;r=Et(r)}return a}let o=Ad(e,t);for(;o&&Rd(o)&&Qn(o);)o=Ad(o,t);return o&&pa(o)&&Qn(o)&&!wr(o)?a:o||Pd(e)||a}var zg=async function(e){let t=this.getOffsetParent||Fd,a=this.getDimensions,o=await a(e.floating);return{reference:Hg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function _g(e){return ot(e).direction==="rtl"}var Nd={convertOffsetParentRelativeRectToViewportRelativeRect:Mg,getDocumentElement:st,getClippingRect:Fg,getOffsetParent:Fd,getElementRects:zg,getClientRects:Ag,getDimensions:Ng,getScale:Ua,isElement:at,isRTL:_g};function Hd(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Vg(e,t){let a=null,o,r=st(e);function n(){var s;clearTimeout(o),(s=a)==null||s.disconnect(),a=null}function i(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),n();let u=e.getBoundingClientRect(),{left:c,top:f,width:p,height:g}=u;if(s||t(),!p||!g)return;let v=Lo(f),m=Lo(r.clientWidth-(c+p)),h=Lo(r.clientHeight-(f+g)),y=Lo(c),w={rootMargin:-v+"px "+-m+"px "+-h+"px "+-y+"px",threshold:Ue(0,bt(1,l))||1},C=!0;function P(M){let T=M[0].intersectionRatio;if(T!==l){if(!C)return i();T?i(!1,T):o=setTimeout(()=>{i(!1,1e-7)},1e3)}T===1&&!Hd(u,e.getBoundingClientRect())&&i(),C=!1}try{a=new IntersectionObserver(P,{...w,root:r.ownerDocument})}catch{a=new IntersectionObserver(P,w)}a.observe(e)}return i(!0),n}function ti(e,t,a,o){o===void 0&&(o={});let{ancestorScroll:r=!0,ancestorResize:n=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,u=ei(e),c=r||n?[...u?fa(u):[],...t?fa(t):[]]:[];c.forEach(y=>{r&&y.addEventListener("scroll",a,{passive:!0}),n&&y.addEventListener("resize",a)});let f=u&&s?Vg(u,a):null,p=-1,g=null;i&&(g=new ResizeObserver(y=>{let[b]=y;b&&b.target===u&&g&&t&&(g.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=g)==null||w.observe(t)})),a()}),u&&!l&&g.observe(u),t&&g.observe(t));let v,m=l?ha(e):null;l&&h();function h(){let y=ha(e);m&&!Hd(m,y)&&a(),m=y,v=requestAnimationFrame(h)}return a(),()=>{var y;c.forEach(b=>{r&&b.removeEventListener("scroll",a),n&&b.removeEventListener("resize",a)}),f?.(),(y=g)==null||y.disconnect(),g=null,l&&cancelAnimationFrame(v)}}var zd=bd;var _d=wd,Vd=xd,Ud=Ld,qd=vd,ai=gd;var jd=Cd,oi=(e,t,a)=>{let o=new Map,r={platform:Nd,...a},n={...r.platform,_c:o};return hd(e,t,{...r,platform:n})};var Ug=typeof document<"u",qg=function(){},Ir=Ug?Jt:qg;function Rr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let a,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(a=e.length,a!==t.length)return!1;for(o=a;o--!==0;)if(!Rr(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),a=r.length,a!==Object.keys(t).length)return!1;for(o=a;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=a;o--!==0;){let n=r[o];if(!(n==="_owner"&&e.$$typeof)&&!Rr(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Gd(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Wd(e,t){let a=Gd(e);return Math.round(t*a)/a}function ri(e){let t=D(e);return Ir(()=>{t.current=e}),t}function Kd(e){e===void 0&&(e={});let{placement:t="bottom",strategy:a="absolute",middleware:o=[],platform:r,elements:{reference:n,floating:i}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[c,f]=k({x:0,y:0,strategy:a,placement:t,middlewareData:{},isPositioned:!1}),[p,g]=k(o);Rr(p,o)||g(o);let[v,m]=k(null),[h,y]=k(null),b=Q(O=>{O!==M.current&&(M.current=O,m(O))},[]),w=Q(O=>{O!==T.current&&(T.current=O,y(O))},[]),C=n||v,P=i||h,M=D(null),T=D(null),B=D(c),U=l!=null,Y=ri(l),j=ri(r),E=ri(u),W=Q(()=>{if(!M.current||!T.current)return;let O={placement:t,strategy:a,middleware:p};j.current&&(O.platform=j.current),oi(M.current,T.current,O).then(X=>{let se={...X,isPositioned:E.current!==!1};Z.current&&!Rr(B.current,se)&&(B.current=se,cr(()=>{f(se)}))})},[p,t,a,j,E]);Ir(()=>{u===!1&&B.current.isPositioned&&(B.current.isPositioned=!1,f(O=>({...O,isPositioned:!1})))},[u]);let Z=D(!1);Ir(()=>(Z.current=!0,()=>{Z.current=!1}),[]),Ir(()=>{if(C&&(M.current=C),P&&(T.current=P),C&&P){if(Y.current)return Y.current(C,P,W);W()}},[C,P,W,Y,U]);let R=he(()=>({reference:M,floating:T,setReference:b,setFloating:w}),[b,w]),H=he(()=>({reference:C,floating:P}),[C,P]),K=he(()=>{let O={position:a,left:0,top:0};if(!H.floating)return O;let X=Wd(H.floating,c.x),se=Wd(H.floating,c.y);return s?{...O,transform:"translate("+X+"px, "+se+"px)",...Gd(H.floating)>=1.5&&{willChange:"transform"}}:{position:a,left:X,top:se}},[a,s,H.floating,c.x,c.y]);return he(()=>({...c,update:W,refs:R,elements:H,floatingStyles:K}),[c,W,R,H,K])}var jg=e=>{function t(a){return{}.hasOwnProperty.call(a,"current")}return{name:"arrow",options:e,fn(a){let{element:o,padding:r}=typeof e=="function"?e(a):e;return o&&t(o)?o.current!=null?ai({element:o.current,padding:r}).fn(a):{}:o?ai({element:o,padding:r}).fn(a):{}}}},$d=(e,t)=>{let a=zd(e);return{name:a.name,fn:a.fn,options:[e,t]}},Xd=(e,t)=>{let a=_d(e);return{name:a.name,fn:a.fn,options:[e,t]}},Jd=(e,t)=>({fn:jd(e).fn,options:[e,t]}),Yd=(e,t)=>{let a=Vd(e);return{name:a.name,fn:a.fn,options:[e,t]}},Zd=(e,t)=>{let a=Ud(e);return{name:a.name,fn:a.fn,options:[e,t]}};var Qd=(e,t)=>{let a=qd(e);return{name:a.name,fn:a.fn,options:[e,t]}};var eu=(e,t)=>{let a=jg(e);return{name:a.name,fn:a.fn,options:[e,t]}};var Wg="Arrow",tu=I((e,t)=>{let{children:a,width:o=10,height:r=5,...n}=e;return L(te.svg,{...n,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?a:L("polygon",{points:"0,0 30,0 15,10"})})});tu.displayName=Wg;var au=tu;function Pr(e){let[t,a]=k(void 0);return Le(()=>{if(e){a({width:e.offsetWidth,height:e.offsetHeight});let o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;let n=r[0],i,s;if("borderBoxSize"in n){let l=n.borderBoxSize,u=Array.isArray(l)?l[0]:l;i=u.inlineSize,s=u.blockSize}else i=e.offsetWidth,s=e.offsetHeight;a({width:i,height:s})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else a(void 0)},[e]),t}var ni="Popper",[ou,ii]=We(ni),[Kg,ru]=ou(ni),nu=e=>{let{__scopePopper:t,children:a}=e,[o,r]=k(null),[n,i]=k(void 0);return L(Kg,{scope:t,anchor:o,onAnchorChange:r,placementState:n,setPlacementState:i,children:a})};nu.displayName=ni;var iu="PopperAnchor",su=I((e,t)=>{let{__scopePopper:a,virtualRef:o,...r}=e,n=ru(iu,a),i=D(null),s=n.onAnchorChange,l=Q(v=>{i.current=v,v&&s(v)},[s]),u=ce(t,l),c=D(null);F(()=>{if(!o)return;let v=c.current;c.current=o.current,v!==c.current&&s(c.current)});let f=n.placementState&&li(n.placementState),p=f?.[0],g=f?.[1];return o?null:L(te.div,{"data-radix-popper-side":p,"data-radix-popper-align":g,...r,ref:u})});su.displayName=iu;var si="PopperContent",[$g,Xg]=ou(si),lu=I((e,t)=>{let{__scopePopper:a,side:o="bottom",sideOffset:r=0,align:n="center",alignOffset:i=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:u,collisionPadding:c=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:g="optimized",onPlaced:v,...m}=e,h=ru(si,a),[y,b]=k(null),w=ce(t,le=>b(le)),[C,P]=k(null),M=Pr(C),T=M?.width??0,B=M?.height??0,U=o+(n!=="center"?"-"+n:""),Y=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},j=u?Array.isArray(u)?u:[u]:void 0,E=j!==void 0&&j.length>0,W={padding:Y,boundary:j?.filter(Yg),altBoundary:E},{refs:Z,floatingStyles:R,placement:H,isPositioned:K,middlewareData:O}=Kd({strategy:"fixed",placement:U,whileElementsMounted:(...le)=>ti(...le,{animationFrame:g==="always"}),elements:{reference:h.anchor},middleware:[$d({mainAxis:r+B,alignmentAxis:i}),l&&Xd({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Jd():void 0,...W}),l&&Yd({...W}),Zd({...W,apply:({elements:le,rects:Te,availableWidth:xe,availableHeight:be})=>{let{width:Se,height:Je}=Te.reference,He=le.floating.style;He.setProperty("--radix-popper-available-width",`${xe}px`),He.setProperty("--radix-popper-available-height",`${be}px`),He.setProperty("--radix-popper-anchor-width",`${Se}px`),He.setProperty("--radix-popper-anchor-height",`${Je}px`)}}),C&&eu({element:C,padding:s}),Zg({arrowWidth:T,arrowHeight:B}),p&&Qd({strategy:"referenceHidden",...W})]}),X=h.setPlacementState;Le(()=>(X(H),()=>{X(void 0)}),[H,X]);let[se,S]=li(H),_=Ge(v);Le(()=>{K&&_?.()},[K,_]);let fe=O.arrow?.x,Pe=O.arrow?.y,ve=O.arrow?.centerOffset!==0,[ke,J]=k();return Le(()=>{y&&J(window.getComputedStyle(y).zIndex)},[y]),L("div",{ref:Z.setFloating,"data-radix-popper-content-wrapper":"",style:{...R,transform:K?R.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ke,"--radix-popper-transform-origin":[O.transformOrigin?.x,O.transformOrigin?.y].join(" "),...O.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:L($g,{scope:a,placedSide:se,placedAlign:S,onArrowChange:P,arrowX:fe,arrowY:Pe,shouldHideArrow:ve,children:L(te.div,{"data-side":se,"data-align":S,...m,ref:w,style:{...m.style,animation:K?void 0:"none"}})})})});lu.displayName=si;var du="PopperArrow",Jg={top:"bottom",right:"left",bottom:"top",left:"right"},uu=I(function(t,a){let{__scopePopper:o,...r}=t,n=Xg(du,o),i=Jg[n.placedSide];return L("span",{ref:n.onArrowChange,style:{position:"absolute",left:n.arrowX,top:n.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[n.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[n.placedSide],visibility:n.shouldHideArrow?"hidden":void 0},children:L(au,{...r,ref:a,style:{...r.style,display:"block"}})})});uu.displayName=du;function Yg(e){return e!==null}var Zg=e=>({name:"transformOrigin",options:e,fn(t){let{placement:a,rects:o,middlewareData:r}=t,i=r.arrow?.centerOffset!==0,s=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[u,c]=li(a),f={start:"0%",center:"50%",end:"100%"}[c],p=(r.arrow?.x??0)+s/2,g=(r.arrow?.y??0)+l/2,v="",m="";return u==="bottom"?(v=i?f:`${p}px`,m=`${-l}px`):u==="top"?(v=i?f:`${p}px`,m=`${o.floating.height+l}px`):u==="right"?(v=`${-l}px`,m=i?f:`${g}px`):u==="left"&&(v=`${o.floating.width+l}px`,m=i?f:`${g}px`),{data:{x:v,y:m}}}});function li(e){let[t,a="center"]=e.split("-");return[t,a]}var cu=nu,fu=su,mu=lu,pu=uu;var ex="Portal",Ro=I((e,t)=>{let{container:a,...o}=e,[r,n]=k(!1);Le(()=>n(!0),[]);let i=a||r&&globalThis?.document?.body;return i?vo(L(te.div,{...o,ref:t}),i):null});Ro.displayName=ex;function tx(e,t){return _o((a,o)=>t[a][o]??a,e)}var Ot=e=>{let{present:t,children:a}=e,o=ax(t),r=typeof a=="function"?a({present:o.isPresent}):ft.only(a),n=ox(o.ref,rx(r));return typeof a=="function"||o.isPresent?Rt(r,{ref:n}):null};Ot.displayName="Presence";function ax(e){let[t,a]=k(),o=D(null),r=D(e),n=D("none"),i=e?"mounted":"unmounted",[s,l]=tx(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return F(()=>{let u=kr(o.current);n.current=s==="mounted"?u:"none"},[s]),Le(()=>{let u=o.current,c=r.current;if(c!==e){let p=n.current,g=kr(u);e?l("MOUNT"):g==="none"||u?.display==="none"?l("UNMOUNT"):l(c&&p!==g?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,l]),Le(()=>{if(t){let u,c=t.ownerDocument.defaultView??window,f=g=>{let m=kr(o.current).includes(CSS.escape(g.animationName));if(g.target===t&&m&&(l("ANIMATION_END"),!r.current)){let h=t.style.animationFillMode;t.style.animationFillMode="forwards",u=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=h)})}},p=g=>{g.target===t&&(n.current=kr(o.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{c.clearTimeout(u),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:Q(u=>{o.current=u?getComputedStyle(u):null,a(u)},[])}}function hu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ox(...e){let t=D(e);return t.current=e,Q(a=>{let o=t.current,r=!1,n=o.map(i=>{let s=hu(i,a);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let i=0;i<n.length;i++){let s=n[i];typeof s=="function"?s():hu(o[i],null)}}},[])}function kr(e){return e?.animationName||"none"}function rx(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var nx=G[" useInsertionEffect ".trim().toString()]||Le;function lt({prop:e,defaultProp:t,onChange:a=()=>{},caller:o}){let[r,n,i]=ix({defaultProp:t,onChange:a}),s=e!==void 0,l=s?e:r;{let c=D(e!==void 0);F(()=>{let f=c.current;f!==s&&console.warn(`${o} is changing from ${f?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),c.current=s},[s,o])}let u=Q(c=>{if(s){let f=sx(c)?c(e):c;f!==e&&i.current?.(f)}else n(c)},[s,e,n,i]);return[l,u]}function ix({defaultProp:e,onChange:t}){let[a,o]=k(e),r=D(a),n=D(t);return nx(()=>{n.current=t},[t]),F(()=>{r.current!==a&&(n.current?.(a),r.current=a)},[a,r]),[a,o,n]}function sx(e){return typeof e=="function"}function Tr(e){let t=D({value:e,previous:e});return he(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var di=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),lx="VisuallyHidden",dx=I((e,t)=>L(te.span,{...e,ref:t,style:{...di,...e.style}}));dx.displayName=lx;var ux=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},qa=new WeakMap,Mr=new WeakMap,Ar={},ui=0,gu=function(e){return e&&(e.host||gu(e.parentNode))},cx=function(e,t){return t.map(function(a){if(e.contains(a))return a;var o=gu(a);return o&&e.contains(o)?o:(console.error("aria-hidden",a,"in not contained inside",e,". Doing nothing"),null)}).filter(function(a){return!!a})},fx=function(e,t,a,o){var r=cx(t,Array.isArray(e)?e:[e]);Ar[a]||(Ar[a]=new WeakMap);var n=Ar[a],i=[],s=new Set,l=new Set(r),u=function(f){!f||s.has(f)||(s.add(f),u(f.parentNode))};r.forEach(u);var c=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(p){if(s.has(p))c(p);else try{var g=p.getAttribute(o),v=g!==null&&g!=="false",m=(qa.get(p)||0)+1,h=(n.get(p)||0)+1;qa.set(p,m),n.set(p,h),i.push(p),m===1&&v&&Mr.set(p,!0),h===1&&p.setAttribute(a,"true"),v||p.setAttribute(o,"true")}catch(y){console.error("aria-hidden: cannot operate on ",p,y)}})};return c(t),s.clear(),ui++,function(){i.forEach(function(f){var p=qa.get(f)-1,g=n.get(f)-1;qa.set(f,p),n.set(f,g),p||(Mr.has(f)||f.removeAttribute(o),Mr.delete(f)),g||f.removeAttribute(a)}),ui--,ui||(qa=new WeakMap,qa=new WeakMap,Mr=new WeakMap,Ar={})}},Dr=function(e,t,a){a===void 0&&(a="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=t||ux(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),fx(o,r,a,"aria-hidden")):function(){return null}};var $e=function(){return $e=Object.assign||function(t){for(var a,o=1,r=arguments.length;o<r;o++){a=arguments[o];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n])}return t},$e.apply(this,arguments)};function Er(e,t){var a={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(a[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(a[o[r]]=e[o[r]]);return a}function xu(e,t,a){if(a||arguments.length===2)for(var o=0,r=t.length,n;o<r;o++)(n||!(o in t))&&(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}var ga="right-scroll-bar-position",xa="width-before-scroll-bar",ci="with-scroll-bars-hidden",fi="--removed-body-scroll-bar-size";function Or(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function vu(e,t){var a=k(function(){return{value:e,callback:t,facade:{get current(){return a.value},set current(o){var r=a.value;r!==o&&(a.value=o,a.callback(o,r))}}}})[0];return a.callback=t,a.facade}var mx=typeof window<"u"?Jt:F,yu=new WeakMap;function mi(e,t){var a=vu(t||null,function(o){return e.forEach(function(r){return Or(r,o)})});return mx(function(){var o=yu.get(a);if(o){var r=new Set(o),n=new Set(e),i=a.current;r.forEach(function(s){n.has(s)||Or(s,null)}),n.forEach(function(s){r.has(s)||Or(s,i)})}yu.set(a,e)},[e]),a}function px(e){return e}function hx(e,t){t===void 0&&(t=px);var a=[],o=!1,r={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return a.length?a[a.length-1]:e},useMedium:function(n){var i=t(n,o);return a.push(i),function(){a=a.filter(function(s){return s!==i})}},assignSyncMedium:function(n){for(o=!0;a.length;){var i=a;a=[],i.forEach(n)}a={push:function(s){return n(s)},filter:function(){return a}}},assignMedium:function(n){o=!0;var i=[];if(a.length){var s=a;a=[],s.forEach(n),i=a}var l=function(){var c=i;i=[],c.forEach(n)},u=function(){return Promise.resolve().then(l)};u(),a={push:function(c){i.push(c),u()},filter:function(c){return i=i.filter(c),a}}}};return r}function pi(e){e===void 0&&(e={});var t=hx(null);return t.options=$e({async:!0,ssr:!1},e),t}var bu=function(e){var t=e.sideCar,a=Er(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return N(o,$e({},a))};bu.isSideCarExport=!0;function hi(e,t){return e.useMedium(t),bu}var Br=pi();var gi=function(){},Po=I(function(e,t){var a=D(null),o=k({onScrollCapture:gi,onWheelCapture:gi,onTouchMoveCapture:gi}),r=o[0],n=o[1],i=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,c=e.enabled,f=e.shards,p=e.sideCar,g=e.noRelative,v=e.noIsolation,m=e.inert,h=e.allowPinchZoom,y=e.as,b=y===void 0?"div":y,w=e.gapMode,C=Er(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=p,M=mi([a,t]),T=$e($e({},C),r);return N(Ye,null,c&&N(P,{sideCar:Br,removeScrollBar:u,shards:f,noRelative:g,noIsolation:v,inert:m,setCallbacks:n,allowPinchZoom:!!h,lockRef:a,gapMode:w}),i?Rt(ft.only(s),$e($e({},T),{ref:M})):N(b,$e({},T,{className:l,ref:M}),s))});Po.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Po.classNames={fullWidth:xa,zeroRight:ga};var wu;var Cu=function(){if(wu)return wu;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function gx(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Cu();return t&&e.setAttribute("nonce",t),e}function xx(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function vx(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var xi=function(){var e=0,t=null;return{add:function(a){e==0&&(t=gx())&&(xx(t,a),vx(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}};var vi=function(){var e=xi();return function(t,a){F(function(){return e.add(t),function(){e.remove()}},[t&&a])}};var ko=function(){var e=vi(),t=function(a){var o=a.styles,r=a.dynamic;return e(o,r),null};return t};var yx={left:0,top:0,right:0,gap:0},yi=function(e){return parseInt(e||"",10)||0},bx=function(e){var t=window.getComputedStyle(document.body),a=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[yi(a),yi(o),yi(r)]},bi=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return yx;var t=bx(e),a=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-a+t[2]-t[0])}};var wx=ko(),ja="data-scroll-locked",Cx=function(e,t,a,o){var r=e.left,n=e.top,i=e.right,s=e.gap;return a===void 0&&(a="margin"),`
|
|
973
|
-
.`.concat(ci,` {
|
|
974
|
-
overflow: hidden `).concat(o,`;
|
|
975
|
-
padding-right: `).concat(s,"px ").concat(o,`;
|
|
976
|
-
}
|
|
977
|
-
body[`).concat(ja,`] {
|
|
978
|
-
overflow: hidden `).concat(o,`;
|
|
979
|
-
overscroll-behavior: contain;
|
|
980
|
-
`).concat([t&&"position: relative ".concat(o,";"),a==="margin"&&`
|
|
981
|
-
padding-left: `.concat(r,`px;
|
|
982
|
-
padding-top: `).concat(n,`px;
|
|
983
|
-
padding-right: `).concat(i,`px;
|
|
984
|
-
margin-left:0;
|
|
985
|
-
margin-top:0;
|
|
986
|
-
margin-right: `).concat(s,"px ").concat(o,`;
|
|
987
|
-
`),a==="padding"&&"padding-right: ".concat(s,"px ").concat(o,";")].filter(Boolean).join(""),`
|
|
988
|
-
}
|
|
989
|
-
|
|
990
|
-
.`).concat(ga,` {
|
|
991
|
-
right: `).concat(s,"px ").concat(o,`;
|
|
992
|
-
}
|
|
993
|
-
|
|
994
|
-
.`).concat(xa,` {
|
|
995
|
-
margin-right: `).concat(s,"px ").concat(o,`;
|
|
996
|
-
}
|
|
997
|
-
|
|
998
|
-
.`).concat(ga," .").concat(ga,` {
|
|
999
|
-
right: 0 `).concat(o,`;
|
|
1000
|
-
}
|
|
1001
|
-
|
|
1002
|
-
.`).concat(xa," .").concat(xa,` {
|
|
1003
|
-
margin-right: 0 `).concat(o,`;
|
|
1004
|
-
}
|
|
1005
|
-
|
|
1006
|
-
body[`).concat(ja,`] {
|
|
1007
|
-
`).concat(fi,": ").concat(s,`px;
|
|
1008
|
-
}
|
|
1009
|
-
`)},Lu=function(){var e=parseInt(document.body.getAttribute(ja)||"0",10);return isFinite(e)?e:0},Lx=function(){F(function(){return document.body.setAttribute(ja,(Lu()+1).toString()),function(){var e=Lu()-1;e<=0?document.body.removeAttribute(ja):document.body.setAttribute(ja,e.toString())}},[])},wi=function(e){var t=e.noRelative,a=e.noImportant,o=e.gapMode,r=o===void 0?"margin":o;Lx();var n=he(function(){return bi(r)},[r]);return N(wx,{styles:Cx(n,!t,r,a?"":"!important")})};var Ci=!1;if(typeof window<"u")try{To=Object.defineProperty({},"passive",{get:function(){return Ci=!0,!0}}),window.addEventListener("test",To,To),window.removeEventListener("test",To,To)}catch{Ci=!1}var To,va=Ci?{passive:!1}:!1;var Sx=function(e){return e.tagName==="TEXTAREA"},Su=function(e,t){if(!(e instanceof Element))return!1;var a=window.getComputedStyle(e);return a[t]!=="hidden"&&!(a.overflowY===a.overflowX&&!Sx(e)&&a[t]==="visible")},Ix=function(e){return Su(e,"overflowY")},Rx=function(e){return Su(e,"overflowX")},Li=function(e,t){var a=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var r=Iu(e,o);if(r){var n=Ru(e,o),i=n[1],s=n[2];if(i>s)return!0}o=o.parentNode}while(o&&o!==a.body);return!1},Px=function(e){var t=e.scrollTop,a=e.scrollHeight,o=e.clientHeight;return[t,a,o]},kx=function(e){var t=e.scrollLeft,a=e.scrollWidth,o=e.clientWidth;return[t,a,o]},Iu=function(e,t){return e==="v"?Ix(t):Rx(t)},Ru=function(e,t){return e==="v"?Px(t):kx(t)},Tx=function(e,t){return e==="h"&&t==="rtl"?-1:1},Pu=function(e,t,a,o,r){var n=Tx(e,window.getComputedStyle(t).direction),i=n*o,s=a.target,l=t.contains(s),u=!1,c=i>0,f=0,p=0;do{if(!s)break;var g=Ru(e,s),v=g[0],m=g[1],h=g[2],y=m-h-n*v;(v||y)&&Iu(e,s)&&(f+=y,p+=v);var b=s.parentNode;s=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(c&&(r&&Math.abs(f)<1||!r&&i>f)||!c&&(r&&Math.abs(p)<1||!r&&-i>p))&&(u=!0),u};var Fr=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ku=function(e){return[e.deltaX,e.deltaY]},Tu=function(e){return e&&"current"in e?e.current:e},Mx=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Ax=function(e){return`
|
|
1010
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
1011
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
1012
|
-
`)},Dx=0,Wa=[];function Mu(e){var t=D([]),a=D([0,0]),o=D(),r=k(Dx++)[0],n=k(ko)[0],i=D(e);F(function(){i.current=e},[e]),F(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var m=xu([e.lockRef.current],(e.shards||[]).map(Tu),!0).filter(Boolean);return m.forEach(function(h){return h.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),m.forEach(function(h){return h.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var s=Q(function(m,h){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!i.current.allowPinchZoom;var y=Fr(m),b=a.current,w="deltaX"in m?m.deltaX:b[0]-y[0],C="deltaY"in m?m.deltaY:b[1]-y[1],P,M=m.target,T=Math.abs(w)>Math.abs(C)?"h":"v";if("touches"in m&&T==="h"&&M.type==="range")return!1;var B=window.getSelection(),U=B&&B.anchorNode,Y=U?U===M||U.contains(M):!1;if(Y)return!1;var j=Li(T,M);if(!j)return!0;if(j?P=T:(P=T==="v"?"h":"v",j=Li(T,M)),!j)return!1;if(!o.current&&"changedTouches"in m&&(w||C)&&(o.current=P),!P)return!0;var E=o.current||P;return Pu(E,h,m,E==="h"?w:C,!0)},[]),l=Q(function(m){var h=m;if(!(!Wa.length||Wa[Wa.length-1]!==n)){var y="deltaY"in h?ku(h):Fr(h),b=t.current.filter(function(P){return P.name===h.type&&(P.target===h.target||h.target===P.shadowParent)&&Mx(P.delta,y)})[0];if(b&&b.should){h.cancelable&&h.preventDefault();return}if(!b){var w=(i.current.shards||[]).map(Tu).filter(Boolean).filter(function(P){return P.contains(h.target)}),C=w.length>0?s(h,w[0]):!i.current.noIsolation;C&&h.cancelable&&h.preventDefault()}}},[]),u=Q(function(m,h,y,b){var w={name:m,delta:h,target:y,should:b,shadowParent:Ex(y)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(C){return C!==w})},1)},[]),c=Q(function(m){a.current=Fr(m),o.current=void 0},[]),f=Q(function(m){u(m.type,ku(m),m.target,s(m,e.lockRef.current))},[]),p=Q(function(m){u(m.type,Fr(m),m.target,s(m,e.lockRef.current))},[]);F(function(){return Wa.push(n),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",l,va),document.addEventListener("touchmove",l,va),document.addEventListener("touchstart",c,va),function(){Wa=Wa.filter(function(m){return m!==n}),document.removeEventListener("wheel",l,va),document.removeEventListener("touchmove",l,va),document.removeEventListener("touchstart",c,va)}},[]);var g=e.removeScrollBar,v=e.inert;return N(Ye,null,v?N(n,{styles:Ax(r)}):null,g?N(wi,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ex(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Au=hi(Br,Mu);var Du=I(function(e,t){return N(Po,$e({},e,{ref:t,sideCar:Au}))});Du.classNames=Po.classNames;var Mo=Du;var Ox=[" ","Enter","ArrowUp","ArrowDown"],Bx=[" ","Enter"],ya="Select",[Hr,zr,Fx]=za(ya),[ba,kL]=We(ya,[Fx,ii]),_r=ii(),[Nx,Gt]=ba(ya),[Hx,zx]=ba(ya),_x="SelectProvider";function Eu(e){let{__scopeSelect:t,children:a,open:o,defaultOpen:r,onOpenChange:n,value:i,defaultValue:s,onValueChange:l,dir:u,name:c,autoComplete:f,disabled:p,required:g,form:v,internal_do_not_use_render:m}=e,h=_r(t),[y,b]=k(null),[w,C]=k(null),[P,M]=k(!1),T=qt(u),[B,U]=lt({prop:o,defaultProp:r??!1,onChange:n,caller:ya}),[Y,j]=lt({prop:i,defaultProp:s,onChange:l,caller:ya}),E=D(null),W=y?!!v||!!y.closest("form"):!0,[Z,R]=k(new Set),H=tt(),K=Array.from(Z).map(S=>S.props.value).join(";"),O=Q(S=>{R(_=>new Set(_).add(S))},[]),X=Q(S=>{R(_=>{let fe=new Set(_);return fe.delete(S),fe})},[]),se={required:g,trigger:y,onTriggerChange:b,valueNode:w,onValueNodeChange:C,valueNodeHasChildren:P,onValueNodeHasChildrenChange:M,contentId:H,value:Y,onValueChange:j,open:B,onOpenChange:U,dir:T,triggerPointerDownPosRef:E,disabled:p,name:c,autoComplete:f,form:v,nativeOptions:Z,nativeSelectKey:K,isFormControl:W};return L(cu,{...h,children:L(Nx,{scope:t,...se,children:L(Hr.Provider,{scope:t,children:L(Hx,{scope:t,onNativeOptionAdd:O,onNativeOptionRemove:X,children:ev(m)?m(se):a})})})})}Eu.displayName=_x;var ki=e=>{let{__scopeSelect:t,children:a,...o}=e;return L(Eu,{__scopeSelect:t,...o,internal_do_not_use_render:({isFormControl:r})=>yt(Dt,{children:[a,r?L(Xu,{__scopeSelect:t}):null]})})};ki.displayName=ya;var Ou="SelectTrigger",Vr=I((e,t)=>{let{__scopeSelect:a,disabled:o=!1,...r}=e,n=_r(a),i=Gt(Ou,a),s=i.disabled||o,l=ce(t,i.onTriggerChange),u=zr(a),c=D("touch"),[f,p,g]=Ju(m=>{let h=u().filter(w=>!w.disabled),y=h.find(w=>w.value===i.value),b=Yu(h,m,y);b!==void 0&&i.onValueChange(b.value)}),v=m=>{s||(i.onOpenChange(!0),g()),m&&(i.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return L(fu,{asChild:!0,...n,children:L(te.button,{type:"button",role:"combobox","aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":Fi(i.value)?"":void 0,...r,ref:l,onClick:ae(r.onClick,m=>{m.currentTarget.focus(),c.current!=="mouse"&&v(m)}),onPointerDown:ae(r.onPointerDown,m=>{c.current=m.pointerType;let h=m.target;h.hasPointerCapture(m.pointerId)&&h.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(v(m),m.preventDefault())}),onKeyDown:ae(r.onKeyDown,m=>{let h=f.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&p(m.key),!(h&&m.key===" ")&&Ox.includes(m.key)&&(v(),m.preventDefault())})})})});Vr.displayName=Ou;var Bu="SelectValue",Ti=I((e,t)=>{let{__scopeSelect:a,className:o,style:r,children:n,placeholder:i="",...s}=e,l=Gt(Bu,a),{onValueNodeHasChildrenChange:u}=l,c=n!==void 0,f=ce(t,l.onValueNodeChange);Le(()=>{u(c)},[u,c]);let p=Fi(l.value);return L(te.span,{...s,asChild:p?!1:s.asChild,ref:f,style:{pointerEvents:"none"},children:L(Ye,{children:p?i:n},p?"placeholder":"value")})});Ti.displayName=Bu;var Vx="SelectIcon",Mi=I((e,t)=>{let{__scopeSelect:a,children:o,...r}=e;return L(te.span,{"aria-hidden":!0,...r,ref:t,children:o||"\u25BC"})});Mi.displayName=Vx;var Fu="SelectPortal",[Ux,qx]=ba(Fu,{forceMount:void 0}),Ai=e=>{let{__scopeSelect:t,forceMount:a,...o}=e;return L(Ux,{scope:e.__scopeSelect,forceMount:a,children:L(Ro,{asChild:!0,...o})})};Ai.displayName=Fu;var Wt="SelectContent",Ur=I((e,t)=>{let a=qx(Wt,e.__scopeSelect),{forceMount:o=a.forceMount,...r}=e,n=Gt(Wt,e.__scopeSelect),[i,s]=k();return Le(()=>{s(new DocumentFragment)},[]),L(Ot,{present:o||n.open,children:({present:l})=>l?L(zu,{...r,ref:t}):L(Nu,{...r,fragment:i})})});Ur.displayName=Wt;var Nu=I((e,t)=>{let{__scopeSelect:a,children:o,fragment:r}=e;return r?vo(L(Hu,{scope:a,children:L(Hr.Slot,{scope:a,children:L("div",{ref:t,children:o})})}),r):null});Nu.displayName="SelectContentFragment";var dt=10,[Hu,Kt]=ba(Wt),jx="SelectContentImpl",Wx=vt("SelectContent.RemoveScroll"),zu=I((e,t)=>{let{__scopeSelect:a}=e,{position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:n,onPointerDownOutside:i,side:s,sideOffset:l,align:u,alignOffset:c,arrowPadding:f,collisionBoundary:p,collisionPadding:g,sticky:v,hideWhenDetached:m,avoidCollisions:h,...y}=e,b=Gt(Wt,a),[w,C]=k(null),[P,M]=k(null),T=ce(t,J=>C(J)),[B,U]=k(null),[Y,j]=k(null),E=zr(a),[W,Z]=k(!1),R=D(!1);F(()=>{if(w)return Dr(w)},[w]),pr();let H=Q(J=>{let[le,...Te]=E().map(Se=>Se.ref.current),[xe]=Te.slice(-1),be=document.activeElement;for(let Se of J)if(Se===be||(Se?.scrollIntoView({block:"nearest"}),Se===le&&P&&(P.scrollTop=0),Se===xe&&P&&(P.scrollTop=P.scrollHeight),Se?.focus(),document.activeElement!==be))return},[E,P]),K=Q(()=>H([B,w]),[H,B,w]);F(()=>{W&&K()},[W,K]);let{onOpenChange:O,triggerPointerDownPosRef:X}=b;F(()=>{if(w){let J={x:0,y:0},le=xe=>{J={x:Math.abs(Math.round(xe.pageX)-(X.current?.x??0)),y:Math.abs(Math.round(xe.pageY)-(X.current?.y??0))}},Te=xe=>{J.x<=10&&J.y<=10?xe.preventDefault():xe.composedPath().includes(w)||O(!1),document.removeEventListener("pointermove",le),X.current=null};return X.current!==null&&(document.addEventListener("pointermove",le),document.addEventListener("pointerup",Te,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",le),document.removeEventListener("pointerup",Te,{capture:!0})}}},[w,O,X]),F(()=>{let J=()=>O(!1);return window.addEventListener("blur",J),window.addEventListener("resize",J),()=>{window.removeEventListener("blur",J),window.removeEventListener("resize",J)}},[O]);let[se,S]=Ju(J=>{let le=E().filter(be=>!be.disabled),Te=le.find(be=>be.ref.current===document.activeElement),xe=Yu(le,J,Te);xe&&setTimeout(()=>xe.ref.current.focus())}),_=Q((J,le,Te)=>{let xe=!R.current&&!Te;(b.value!==void 0&&b.value===le||xe)&&(U(J),xe&&(R.current=!0))},[b.value]),fe=Q(()=>w?.focus(),[w]),Pe=Q((J,le,Te)=>{let xe=!R.current&&!Te;(b.value!==void 0&&b.value===le||xe)&&j(J)},[b.value]),ve=o==="popper"?Si:_u,ke=ve===Si?{side:s,sideOffset:l,align:u,alignOffset:c,arrowPadding:f,collisionBoundary:p,collisionPadding:g,sticky:v,hideWhenDetached:m,avoidCollisions:h}:{};return L(Hu,{scope:a,content:w,viewport:P,onViewportChange:M,itemRefCallback:_,selectedItem:B,onItemLeave:fe,itemTextRefCallback:Pe,focusSelectedItem:K,selectedItemText:Y,position:o,isPositioned:W,searchRef:se,children:L(Mo,{as:Wx,allowPinchZoom:!0,children:L(bo,{asChild:!0,trapped:b.open,onMountAutoFocus:J=>{J.preventDefault()},onUnmountAutoFocus:ae(r,J=>{b.trigger?.focus({preventScroll:!0}),J.preventDefault()}),children:L(yo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:n,onPointerDownOutside:i,onFocusOutside:J=>J.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:L(ve,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:J=>J.preventDefault(),...y,...ke,onPlaced:()=>Z(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:ae(y.onKeyDown,J=>{let le=J.ctrlKey||J.altKey||J.metaKey;if(J.key==="Tab"&&J.preventDefault(),!le&&J.key.length===1&&S(J.key),["ArrowUp","ArrowDown","Home","End"].includes(J.key)){let xe=E().filter(be=>!be.disabled).map(be=>be.ref.current);if(["ArrowUp","End"].includes(J.key)&&(xe=xe.slice().reverse()),["ArrowUp","ArrowDown"].includes(J.key)){let be=J.target,Se=xe.indexOf(be);xe=xe.slice(Se+1)}setTimeout(()=>H(xe)),J.preventDefault()}})})})})})})});zu.displayName=jx;var Gx="SelectItemAlignedPosition",_u=I((e,t)=>{let{__scopeSelect:a,onPlaced:o,...r}=e,n=Gt(Wt,a),i=Kt(Wt,a),[s,l]=k(null),[u,c]=k(null),f=ce(t,T=>c(T)),p=zr(a),g=D(!1),v=D(!0),{viewport:m,selectedItem:h,selectedItemText:y,focusSelectedItem:b}=i,w=Q(()=>{if(n.trigger&&n.valueNode&&s&&u&&m&&h&&y){let T=n.trigger.getBoundingClientRect(),B=u.getBoundingClientRect(),U=n.valueNode.getBoundingClientRect(),Y=y.getBoundingClientRect();if(n.dir!=="rtl"){let be=Y.left-B.left,Se=U.left-be,Je=T.left-Se,He=T.width+Je,Sa=Math.max(He,B.width),re=window.innerWidth-dt,Ft=Ha(Se,[dt,Math.max(dt,re-Sa)]);s.style.minWidth=He+"px",s.style.left=Ft+"px"}else{let be=B.right-Y.right,Se=window.innerWidth-U.right-be,Je=window.innerWidth-T.right-Se,He=T.width+Je,Sa=Math.max(He,B.width),re=window.innerWidth-dt,Ft=Ha(Se,[dt,Math.max(dt,re-Sa)]);s.style.minWidth=He+"px",s.style.right=Ft+"px"}let j=p(),E=window.innerHeight-dt*2,W=m.scrollHeight,Z=window.getComputedStyle(u),R=parseInt(Z.borderTopWidth,10),H=parseInt(Z.paddingTop,10),K=parseInt(Z.borderBottomWidth,10),O=parseInt(Z.paddingBottom,10),X=R+H+W+O+K,se=Math.min(h.offsetHeight*5,X),S=window.getComputedStyle(m),_=parseInt(S.paddingTop,10),fe=parseInt(S.paddingBottom,10),Pe=T.top+T.height/2-dt,ve=E-Pe,ke=h.offsetHeight/2,J=h.offsetTop+ke,le=R+H+J,Te=X-le;if(le<=Pe){let be=j.length>0&&h===j[j.length-1].ref.current;s.style.bottom="0px";let Se=u.clientHeight-m.offsetTop-m.offsetHeight,Je=Math.max(ve,ke+(be?fe:0)+Se+K),He=le+Je;s.style.height=He+"px"}else{let be=j.length>0&&h===j[0].ref.current;s.style.top="0px";let Je=Math.max(Pe,R+m.offsetTop+(be?_:0)+ke)+Te;s.style.height=Je+"px",m.scrollTop=le-Pe+m.offsetTop}s.style.margin=`${dt}px 0`,s.style.minHeight=se+"px",s.style.maxHeight=E+"px",o?.(),requestAnimationFrame(()=>g.current=!0)}},[p,n.trigger,n.valueNode,s,u,m,h,y,n.dir,o]);Le(()=>w(),[w]);let[C,P]=k();Le(()=>{u&&P(window.getComputedStyle(u).zIndex)},[u]);let M=Q(T=>{T&&v.current===!0&&(w(),b?.(),v.current=!1)},[w,b]);return L($x,{scope:a,contentWrapper:s,shouldExpandOnScrollRef:g,onScrollButtonChange:M,children:L("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:L(te.div,{...r,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});_u.displayName=Gx;var Kx="SelectPopperPosition",Si=I((e,t)=>{let{__scopeSelect:a,align:o="start",collisionPadding:r=dt,...n}=e,i=_r(a);return L(mu,{...i,...n,ref:t,align:o,collisionPadding:r,style:{boxSizing:"border-box",...n.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Si.displayName=Kx;var[$x,Di]=ba(Wt,{}),Ii="SelectViewport",Ei=I((e,t)=>{let{__scopeSelect:a,nonce:o,...r}=e,n=Kt(Ii,a),i=Di(Ii,a),s=ce(t,n.onViewportChange),l=D(0);return yt(Dt,{children:[L("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),L(Hr.Slot,{scope:a,children:L(te.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:ae(r.onScroll,u=>{let c=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:p}=i;if(p?.current&&f){let g=Math.abs(l.current-c.scrollTop);if(g>0){let v=window.innerHeight-dt*2,m=parseFloat(f.style.minHeight),h=parseFloat(f.style.height),y=Math.max(m,h);if(y<v){let b=y+g,w=Math.min(v,b),C=b-w;f.style.height=w+"px",f.style.bottom==="0px"&&(c.scrollTop=C>0?C:0,f.style.justifyContent="flex-end")}}}l.current=c.scrollTop})})})]})});Ei.displayName=Ii;var Vu="SelectGroup",[Xx,Jx]=ba(Vu),Uu=I((e,t)=>{let{__scopeSelect:a,...o}=e,r=tt();return L(Xx,{scope:a,id:r,children:L(te.div,{role:"group","aria-labelledby":r,...o,ref:t})})});Uu.displayName=Vu;var qu="SelectLabel",qr=I((e,t)=>{let{__scopeSelect:a,...o}=e,r=Jx(qu,a);return L(te.div,{id:r.id,...o,ref:t})});qr.displayName=qu;var Nr="SelectItem",[Yx,ju]=ba(Nr),jr=I((e,t)=>{let{__scopeSelect:a,value:o,disabled:r=!1,textValue:n,...i}=e,s=Gt(Nr,a),l=Kt(Nr,a),u=s.value===o,[c,f]=k(n??""),[p,g]=k(!1),v=ce(t,b=>l.itemRefCallback?.(b,o,r)),m=tt(),h=D("touch"),y=()=>{r||(s.onValueChange(o),s.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return L(Yx,{scope:a,value:o,disabled:r,textId:m,isSelected:u,onItemTextChange:Q(b=>{f(w=>w||(b?.textContent??"").trim())},[]),children:L(Hr.ItemSlot,{scope:a,value:o,disabled:r,textValue:c,children:L(te.div,{role:"option","aria-labelledby":m,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...i,ref:v,onFocus:ae(i.onFocus,()=>g(!0)),onBlur:ae(i.onBlur,()=>g(!1)),onClick:ae(i.onClick,()=>{h.current!=="mouse"&&y()}),onPointerUp:ae(i.onPointerUp,()=>{h.current==="mouse"&&y()}),onPointerDown:ae(i.onPointerDown,b=>{h.current=b.pointerType}),onPointerMove:ae(i.onPointerMove,b=>{h.current=b.pointerType,r?l.onItemLeave?.():h.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ae(i.onPointerLeave,b=>{b.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:ae(i.onKeyDown,b=>{l.searchRef?.current!==""&&b.key===" "||(Bx.includes(b.key)&&y(),b.key===" "&&b.preventDefault())})})})})});jr.displayName=Nr;var Ao="SelectItemText",Oi=I((e,t)=>{let{__scopeSelect:a,className:o,style:r,...n}=e,i=Gt(Ao,a),s=Kt(Ao,a),l=ju(Ao,a),u=zx(Ao,a),[c,f]=k(null),p=ce(t,y=>f(y),l.onItemTextChange,y=>s.itemTextRefCallback?.(y,l.value,l.disabled)),g=c?.textContent,v=he(()=>L("option",{value:l.value,disabled:l.disabled,children:g},l.value),[l.disabled,l.value,g]),{onNativeOptionAdd:m,onNativeOptionRemove:h}=u;return Le(()=>(m(v),()=>h(v)),[m,h,v]),yt(Dt,{children:[L(te.span,{id:l.textId,...n,ref:p}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?vo(n.children,i.valueNode):null]})});Oi.displayName=Ao;var Wu="SelectItemIndicator",Bi=I((e,t)=>{let{__scopeSelect:a,...o}=e;return ju(Wu,a).isSelected?L(te.span,{"aria-hidden":!0,...o,ref:t}):null});Bi.displayName=Wu;var Ri="SelectScrollUpButton",Wr=I((e,t)=>{let a=Kt(Ri,e.__scopeSelect),o=Di(Ri,e.__scopeSelect),[r,n]=k(!1),i=ce(t,o.onScrollButtonChange);return Le(()=>{if(a.viewport&&a.isPositioned){let l=function(){let c=u.scrollTop>0;n(c)};var s=l;let u=a.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[a.viewport,a.isPositioned]),r?L(Gu,{...e,ref:i,onAutoScroll:()=>{let{viewport:s,selectedItem:l}=a;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null});Wr.displayName=Ri;var Pi="SelectScrollDownButton",Gr=I((e,t)=>{let a=Kt(Pi,e.__scopeSelect),o=Di(Pi,e.__scopeSelect),[r,n]=k(!1),i=ce(t,o.onScrollButtonChange);return Le(()=>{if(a.viewport&&a.isPositioned){let l=function(){let c=u.scrollHeight-u.clientHeight,f=Math.ceil(u.scrollTop)<c;n(f)};var s=l;let u=a.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[a.viewport,a.isPositioned]),r?L(Gu,{...e,ref:i,onAutoScroll:()=>{let{viewport:s,selectedItem:l}=a;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null});Gr.displayName=Pi;var Gu=I((e,t)=>{let{__scopeSelect:a,onAutoScroll:o,...r}=e,n=Kt("SelectScrollButton",a),i=D(null),s=zr(a),l=Q(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return F(()=>()=>l(),[l]),Le(()=>{s().find(c=>c.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[s]),L(te.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:ae(r.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(o,50))}),onPointerMove:ae(r.onPointerMove,()=>{n.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(o,50))}),onPointerLeave:ae(r.onPointerLeave,()=>{l()})})}),Zx="SelectSeparator",Kr=I((e,t)=>{let{__scopeSelect:a,...o}=e;return L(te.div,{"aria-hidden":!0,...o,ref:t})});Kr.displayName=Zx;var Ku="SelectArrow",Qx=I((e,t)=>{let{__scopeSelect:a,...o}=e,r=_r(a);return Kt(Ku,a).position==="popper"?L(pu,{...r,...o,ref:t}):null});Qx.displayName=Ku;var $u="SelectBubbleInput",Xu=I(({__scopeSelect:e,...t},a)=>{let o=Gt($u,e),{value:r,onValueChange:n,required:i,disabled:s,name:l,autoComplete:u,form:c}=o,{nativeOptions:f,nativeSelectKey:p}=o,g=D(null),v=ce(a,g),m=r??"",h=Tr(m);return F(()=>{let y=g.current;if(!y)return;let b=window.HTMLSelectElement.prototype,C=Object.getOwnPropertyDescriptor(b,"value").set;if(h!==m&&C){let P=new Event("change",{bubbles:!0});C.call(y,m),y.dispatchEvent(P)}},[h,m]),yt(te.select,{"aria-hidden":!0,required:i,tabIndex:-1,name:l,autoComplete:u,disabled:s,form:c,onChange:y=>n(y.target.value),...t,style:{...di,...t.style},ref:v,defaultValue:m,children:[Fi(r)?L("option",{value:""}):null,Array.from(f)]},p)});Xu.displayName=$u;function ev(e){return typeof e=="function"}function Fi(e){return e===""||e===void 0}function Ju(e){let t=Ge(e),a=D(""),o=D(0),r=Q(i=>{let s=a.current+i;t(s),(function l(u){a.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>l(""),1e3))})(s)},[t]),n=Q(()=>{a.current="",window.clearTimeout(o.current)},[]);return F(()=>()=>window.clearTimeout(o.current),[]),[a,r,n]}function Yu(e,t,a){let r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,n=a?e.indexOf(a):-1,i=tv(e,Math.max(n,0));r.length===1&&(i=i.filter(u=>u!==a));let l=i.find(u=>u.textValue.toLowerCase().startsWith(r.toLowerCase()));return l!==a?l:void 0}function tv(e,t){return e.map((a,o)=>e[(t+o)%e.length])}var Zu=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),$r=(...e)=>e.filter((t,a,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===a).join(" ").trim();var Qu={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var ec=I(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:o,className:r="",children:n,iconNode:i,...s},l)=>N("svg",{ref:l,...Qu,width:t,height:t,stroke:e,strokeWidth:o?Number(a)*24/Number(t):a,className:$r("lucide",r),...s},[...i.map(([u,c])=>N(u,c)),...Array.isArray(n)?n:[n]]));var $t=(e,t)=>{let a=I(({className:o,...r},n)=>N(ec,{ref:n,iconNode:t,className:$r(`lucide-${Zu(e)}`,o),...r}));return a.displayName=`${e}`,a};var ov=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Do=$t("Check",ov);var rv=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ga=$t("ChevronDown",rv);var nv=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Eo=$t("ChevronUp",nv);var iv=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Oo=$t("X",iv);var tc=ki;var ac=Ti,Ni=I(({className:e,children:t,...a},o)=>N(Vr,{ref:o,className:de("xps-select-trigger",e),...a},t,N(Mi,{asChild:!0},N(Ga,{className:"xps-icon"}))));Ni.displayName=Vr.displayName;var oc=I(({className:e,...t},a)=>N(Wr,{ref:a,className:de("xps-select-scroll-button",e),...t},N(Eo,{className:"xps-icon"})));oc.displayName=Wr.displayName;var rc=I(({className:e,...t},a)=>N(Gr,{ref:a,className:de("xps-select-scroll-button",e),...t},N(Ga,{className:"xps-icon"})));rc.displayName=Gr.displayName;var Hi=I(({className:e,children:t,position:a="popper",...o},r)=>N(Ai,null,N(Ur,{ref:r,className:de("xps-select-content",a==="popper"&&"xps-select-content-popper",e),position:a,...o},N(oc,null),N(Ei,{className:de("xps-select-viewport",a==="popper"&&"xps-select-viewport-popper")},t),N(rc,null))));Hi.displayName=Ur.displayName;var sv=I(({className:e,...t},a)=>N(qr,{ref:a,className:de("xps-select-label",e),...t}));sv.displayName=qr.displayName;var zi=I(({className:e,children:t,...a},o)=>N(jr,{ref:o,className:de("xps-select-item",e),...a},N("span",{className:"xps-select-item-indicator"},N(Bi,null,N(Do,{className:"xps-icon"}))),N(Oi,null,t)));zi.displayName=jr.displayName;var lv=I(({className:e,...t},a)=>N(Kr,{ref:a,className:de("xps-select-separator",e),...t}));lv.displayName=Kr.displayName;var nc=["PageUp","PageDown"],ic=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],sc={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Ka="Slider",[_i,dv,uv]=za(Ka),[Ui,fS]=We(Ka,[uv]),[cv,Bo]=Ui(Ka),Jr=I((e,t)=>{let{name:a,min:o=0,max:r=100,step:n=1,orientation:i="horizontal",disabled:s=!1,minStepsBetweenThumbs:l=0,defaultValue:u=[o],value:c,onValueChange:f=()=>{},onValueCommit:p=()=>{},inverted:g=!1,form:v,...m}=e,h=D(new Set),y=D(0),b=D(!1),C=i==="horizontal"?fv:mv,[P=[],M]=lt({prop:c,defaultProp:u,onChange:E=>{[...h.current][y.current]?.focus({preventScroll:!0,focusVisible:b.current}),b.current=!1,f(E)}}),T=D(P);function B(E){let W=xv(P,E);j(E,W)}function U(E){j(E,y.current)}function Y(){let E=T.current[y.current];P[y.current]!==E&&p(P)}function j(E,W,{commit:Z}={commit:!1}){let R=wv(n),H=Cv(Math.round((E-o)/n)*n+o,R),K=Ha(H,[o,r]);M((O=[])=>{let X=hv(O,K,W);if(bv(X,l*n)){y.current=X.indexOf(K);let se=String(X)!==String(O);return se&&Z&&p(X),se?X:O}else return O})}return L(cv,{scope:e.__scopeSlider,name:a,disabled:s,min:o,max:r,valueIndexToChangeRef:y,thumbs:h.current,values:P,orientation:i,form:v,children:L(_i.Provider,{scope:e.__scopeSlider,children:L(_i.Slot,{scope:e.__scopeSlider,children:L(C,{"aria-disabled":s,"data-disabled":s?"":void 0,...m,ref:t,onPointerDown:ae(m.onPointerDown,()=>{s||(T.current=P,b.current=!1)}),min:o,max:r,inverted:g,onSlideStart:s?void 0:B,onSlideMove:s?void 0:U,onSlideEnd:s?void 0:Y,onHomeKeyDown:()=>{s||(b.current=!0,j(o,0,{commit:!0}))},onEndKeyDown:()=>{s||(b.current=!0,j(r,P.length-1,{commit:!0}))},onStepKeyDown:({event:E,direction:W})=>{if(!s){b.current=!0;let H=nc.includes(E.key)||E.shiftKey&&ic.includes(E.key)?10:1,K=y.current,O=P[K],X=n*H*W;j(O+X,K,{commit:!0})}}})})})})});Jr.displayName=Ka;var[lc,dc]=Ui(Ka,{startEdge:"left",endEdge:"right",size:"width",direction:1}),fv=I((e,t)=>{let{min:a,max:o,dir:r,inverted:n,onSlideStart:i,onSlideMove:s,onSlideEnd:l,onStepKeyDown:u,...c}=e,[f,p]=k(null),g=ce(t,w=>p(w)),v=D(void 0),m=qt(r),h=m==="ltr",y=h&&!n||!h&&n;function b(w){let C=v.current||f.getBoundingClientRect(),P=[0,C.width],T=Gi(P,y?[a,o]:[o,a]);return v.current=C,T(w-C.left)}return L(lc,{scope:e.__scopeSlider,startEdge:y?"left":"right",endEdge:y?"right":"left",direction:y?1:-1,size:"width",children:L(uc,{dir:m,"data-orientation":"horizontal",...c,ref:g,style:{...c.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{let C=b(w.clientX);i?.(C)},onSlideMove:w=>{let C=b(w.clientX);s?.(C)},onSlideEnd:()=>{v.current=void 0,l?.()},onStepKeyDown:w=>{let P=sc[y?"from-left":"from-right"].includes(w.key);u?.({event:w,direction:P?-1:1})}})})}),mv=I((e,t)=>{let{min:a,max:o,inverted:r,onSlideStart:n,onSlideMove:i,onSlideEnd:s,onStepKeyDown:l,...u}=e,c=D(null),f=ce(t,c),p=D(void 0),g=!r;function v(m){let h=p.current||c.current.getBoundingClientRect(),y=[0,h.height],w=Gi(y,g?[o,a]:[a,o]);return p.current=h,w(m-h.top)}return L(lc,{scope:e.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:L(uc,{"data-orientation":"vertical",...u,ref:f,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:m=>{let h=v(m.clientY);n?.(h)},onSlideMove:m=>{let h=v(m.clientY);i?.(h)},onSlideEnd:()=>{p.current=void 0,s?.()},onStepKeyDown:m=>{let y=sc[g?"from-bottom":"from-top"].includes(m.key);l?.({event:m,direction:y?-1:1})}})})}),uc=I((e,t)=>{let{__scopeSlider:a,onSlideStart:o,onSlideMove:r,onSlideEnd:n,onHomeKeyDown:i,onEndKeyDown:s,onStepKeyDown:l,...u}=e,c=Bo(Ka,a);return L(te.span,{...u,ref:t,onKeyDown:ae(e.onKeyDown,f=>{f.key==="Home"?(i(f),f.preventDefault()):f.key==="End"?(s(f),f.preventDefault()):nc.concat(ic).includes(f.key)&&(l(f),f.preventDefault())}),onPointerDown:ae(e.onPointerDown,f=>{let p=f.target;p.setPointerCapture(f.pointerId),f.preventDefault(),c.thumbs.has(p)?p.focus({preventScroll:!0,focusVisible:!1}):o(f)}),onPointerMove:ae(e.onPointerMove,f=>{f.target.hasPointerCapture(f.pointerId)&&r(f)}),onPointerUp:ae(e.onPointerUp,f=>{let p=f.target;p.hasPointerCapture(f.pointerId)&&(p.releasePointerCapture(f.pointerId),n(f))})})}),cc="SliderTrack",qi=I((e,t)=>{let{__scopeSlider:a,...o}=e,r=Bo(cc,a);return L(te.span,{"data-disabled":r.disabled?"":void 0,"data-orientation":r.orientation,...o,ref:t})});qi.displayName=cc;var Vi="SliderRange",ji=I((e,t)=>{let{__scopeSlider:a,...o}=e,r=Bo(Vi,a),n=dc(Vi,a),i=D(null),s=ce(t,i),l=r.values.length,u=r.values.map(p=>yc(p,r.min,r.max)),c=l>1?Math.min(...u):0,f=100-Math.max(...u);return L(te.span,{"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,...o,ref:s,style:{...e.style,[n.startEdge]:c+"%",[n.endEdge]:f+"%"}})});ji.displayName=Vi;var fc="SliderThumb",[pv,mc]=Ui(fc),pc="SliderThumbProvider";function hc(e){let{__scopeSlider:t,name:a,children:o,internal_do_not_use_render:r}=e,n=Bo(pc,t),i=dv(t),[s,l]=k(null),u=he(()=>s?i().findIndex(h=>h.ref.current===s):-1,[i,s]),c=Pr(s),f=s?!!n.form||!!s.closest("form"):!0,p=n.values[u],g=a??(n.name?n.name+(n.values.length>1?"[]":""):void 0),v=p===void 0?0:yc(p,n.min,n.max);F(()=>{if(s)return n.thumbs.add(s),()=>{n.thumbs.delete(s)}},[s,n.thumbs]);let m={value:p,name:g,form:n.form,isFormControl:f,index:u,thumb:s,onThumbChange:l,percent:v,size:c};return L(pv,{scope:t,...m,children:Lv(r)?r(m):o})}hc.displayName=pc;var Xr="SliderThumbTrigger",gc=I((e,t)=>{let{__scopeSlider:a,...o}=e,r=Bo(Xr,a),n=dc(Xr,a),{index:i,value:s,percent:l,size:u,onThumbChange:c}=mc(Xr,a),f=ce(t,m=>c(m)),p=gv(i,r.values.length),g=u?.[n.size],v=g?vv(g,l,n.direction):0;return L("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[n.startEdge]:`calc(${l}% + ${v}px)`},children:L(_i.ItemSlot,{scope:a,children:L(te.span,{role:"slider","aria-label":e["aria-label"]||p,"aria-valuemin":r.min,"aria-valuenow":s,"aria-valuemax":r.max,"aria-orientation":r.orientation,"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,tabIndex:r.disabled?void 0:0,...o,ref:f,style:s===void 0?{display:"none"}:e.style,onFocus:ae(e.onFocus,()=>{r.valueIndexToChangeRef.current=i})})})})});gc.displayName=Xr;var Wi=I((e,t)=>{let{__scopeSlider:a,name:o,...r}=e;return L(hc,{__scopeSlider:a,name:o,internal_do_not_use_render:({index:n,isFormControl:i})=>yt(Dt,{children:[L(gc,{...r,ref:t,__scopeSlider:a}),i?L(vc,{__scopeSlider:a},n):null]})})});Wi.displayName=fc;var xc="SliderBubbleInput",vc=I(({__scopeSlider:e,...t},a)=>{let{value:o,name:r,form:n}=mc(xc,e),i=D(null),s=ce(i,a),l=Tr(o);return F(()=>{let u=i.current;if(!u)return;let c=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(c,"value").set;if(l!==o&&p){let g=new Event("input",{bubbles:!0});p.call(u,o),u.dispatchEvent(g)}},[l,o]),L(te.input,{style:{display:"none"},name:r,form:n,...t,ref:s,defaultValue:o})});vc.displayName=xc;function hv(e=[],t,a){let o=[...e];return o[a]=t,o.sort((r,n)=>r-n)}function yc(e,t,a){let n=100/(a-t)*(e-t);return Ha(n,[0,100])}function gv(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function xv(e,t){if(e.length===1)return 0;let a=e.map(r=>Math.abs(r-t)),o=Math.min(...a);return a.indexOf(o)}function vv(e,t,a){let o=e/2,n=Gi([0,50],[0,o]);return(o-n(t)*a)*a}function yv(e){return e.slice(0,-1).map((t,a)=>e[a+1]-t)}function bv(e,t){if(t>0){let a=yv(e);return Math.min(...a)>=t}return!0}function Gi(e,t){return a=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let o=(t[1]-t[0])/(e[1]-e[0]);return t[0]+o*(a-e[0])}}function wv(e){if(!Number.isFinite(e))return 0;let t=e.toString();if(t.includes("e")){let[o,r]=t.split("e"),n=o.split(".")[1]||"",i=Number(r);return Math.max(0,n.length-i)}let a=t.split(".")[1];return a?a.length:0}function Cv(e,t){let a=Math.pow(10,t);return Math.round(e*a)/a}function Lv(e){return typeof e=="function"}var Ki=I(({className:e,...t},a)=>N(Jr,{ref:a,className:de("xps-slider",e),...t},N(qi,{className:"xps-slider-track"},N(ji,{className:"xps-slider-range"})),N(Wi,{className:"xps-slider-thumb"})));Ki.displayName=Jr.displayName;var d=N,q=I(({size:e="sm",...t},a)=>d(Kn,{ref:a,size:e,...t}));q.displayName="MotionButton";function ut(e){return d(tc,{value:e.value,onValueChange:e.onValueChange},d(Ni,{className:e.className},d(ac,null)),d(Hi,null,e.options.map(t=>d(zi,{key:t.value,value:t.value},t.label))))}function wa(e){let t=Iv(e.value,e.min,e.max);return d(Ki,{className:e.className,min:e.min,max:e.max,step:e.step,value:[t],onValueChange:a=>{let o=a[0];typeof o=="number"&&e.onChange(o)}})}function Iv(e,t,a){return Number.isFinite(e)?Math.min(a,Math.max(t,e)):t}var Rv=ur("xps-badge",{variants:{variant:{default:"xps-badge--default",secondary:"xps-badge--secondary",success:"xps-badge--success",warning:"xps-badge--warning",destructive:"xps-badge--destructive"}},defaultVariants:{variant:"default"}});function $a({className:e,variant:t,...a}){return N("span",{className:de(Rv({variant:t}),e),...a})}var $i="rovingFocusGroup.onEntryFocus",Pv={bubbles:!1,cancelable:!0},Fo="RovingFocusGroup",[Xi,bc,kv]=za(Fo),[Tv,Ji]=We(Fo,[kv]),[Mv,Av]=Tv(Fo),wc=I((e,t)=>L(Xi.Provider,{scope:e.__scopeRovingFocusGroup,children:L(Xi.Slot,{scope:e.__scopeRovingFocusGroup,children:L(Dv,{...e,ref:t})})}));wc.displayName=Fo;var Dv=I((e,t)=>{let{__scopeRovingFocusGroup:a,orientation:o,loop:r=!1,dir:n,currentTabStopId:i,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:c=!1,...f}=e,p=D(null),g=ce(t,p),v=qt(n),[m,h]=lt({prop:i,defaultProp:s??null,onChange:l,caller:Fo}),[y,b]=k(!1),w=Ge(u),C=bc(a),P=D(!1),[M,T]=k(0);return F(()=>{let B=p.current;if(B)return B.addEventListener($i,w),()=>B.removeEventListener($i,w)},[w]),L(Mv,{scope:a,orientation:o,dir:v,loop:r,currentTabStopId:m,onItemFocus:Q(B=>h(B),[h]),onItemShiftTab:Q(()=>b(!0),[]),onFocusableItemAdd:Q(()=>T(B=>B+1),[]),onFocusableItemRemove:Q(()=>T(B=>B-1),[]),children:L(te.div,{tabIndex:y||M===0?-1:0,"data-orientation":o,...f,ref:g,style:{outline:"none",...e.style},onMouseDown:ae(e.onMouseDown,()=>{P.current=!0}),onFocus:ae(e.onFocus,B=>{let U=!P.current;if(B.target===B.currentTarget&&U&&!y){let Y=new CustomEvent($i,Pv);if(B.currentTarget.dispatchEvent(Y),!Y.defaultPrevented){let j=C().filter(H=>H.focusable),E=j.find(H=>H.active),W=j.find(H=>H.id===m),R=[E,W,...j].filter(Boolean).map(H=>H.ref.current);Sc(R,c)}}P.current=!1}),onBlur:ae(e.onBlur,()=>b(!1))})})}),Cc="RovingFocusGroupItem",Lc=I((e,t)=>{let{__scopeRovingFocusGroup:a,focusable:o=!0,active:r=!1,tabStopId:n,children:i,...s}=e,l=tt(),u=n||l,c=Av(Cc,a),f=c.currentTabStopId===u,p=bc(a),{onFocusableItemAdd:g,onFocusableItemRemove:v,currentTabStopId:m}=c;return F(()=>{if(o)return g(),()=>v()},[o,g,v]),L(Xi.ItemSlot,{scope:a,id:u,focusable:o,active:r,children:L(te.span,{tabIndex:f?0:-1,"data-orientation":c.orientation,...s,ref:t,onMouseDown:ae(e.onMouseDown,h=>{o?c.onItemFocus(u):h.preventDefault()}),onFocus:ae(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:ae(e.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){c.onItemShiftTab();return}if(h.target!==h.currentTarget)return;let y=Bv(h,c.orientation,c.dir);if(y!==void 0){if(h.metaKey||h.ctrlKey||h.altKey||h.shiftKey)return;h.preventDefault();let w=p().filter(C=>C.focusable).map(C=>C.ref.current);if(y==="last")w.reverse();else if(y==="prev"||y==="next"){y==="prev"&&w.reverse();let C=w.indexOf(h.currentTarget);w=c.loop?Fv(w,C+1):w.slice(C+1)}setTimeout(()=>Sc(w))}}),children:typeof i=="function"?i({isCurrentTabStop:f,hasTabStop:m!=null}):i})})});Lc.displayName=Cc;var Ev={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ov(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Bv(e,t,a){let o=Ov(e.key,a);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return Ev[o]}function Sc(e,t=!1){let a=document.activeElement;for(let o of e)if(o===a||(o.focus({preventScroll:t}),document.activeElement!==a))return}function Fv(e,t){return e.map((a,o)=>e[(t+o)%e.length])}var Ic=wc,Rc=Lc;var Yr="Tabs",[Hv,VS]=We(Yr,[Ji]),Pc=Ji(),[zv,Yi]=Hv(Yr),kc=I((e,t)=>{let{__scopeTabs:a,value:o,onValueChange:r,defaultValue:n,orientation:i="horizontal",dir:s,activationMode:l="automatic",...u}=e,c=qt(s),[f,p]=lt({prop:o,onChange:r,defaultProp:n??"",caller:Yr});return L(zv,{scope:a,baseId:tt(),value:f,onValueChange:p,orientation:i,dir:c,activationMode:l,children:L(te.div,{dir:c,"data-orientation":i,...u,ref:t})})});kc.displayName=Yr;var Tc="TabsList",Mc=I((e,t)=>{let{__scopeTabs:a,loop:o=!0,...r}=e,n=Yi(Tc,a),i=Pc(a);return L(Ic,{asChild:!0,...i,orientation:n.orientation,dir:n.dir,loop:o,children:L(te.div,{role:"tablist","aria-orientation":n.orientation,...r,ref:t})})});Mc.displayName=Tc;var Ac="TabsTrigger",Dc=I((e,t)=>{let{__scopeTabs:a,value:o,disabled:r=!1,...n}=e,i=Yi(Ac,a),s=Pc(a),l=Bc(i.baseId,o),u=Fc(i.baseId,o),c=o===i.value;return L(Rc,{asChild:!0,...s,focusable:!r,active:c,children:L(te.button,{type:"button",role:"tab","aria-selected":c,"aria-controls":u,"data-state":c?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:l,...n,ref:t,onMouseDown:ae(e.onMouseDown,f=>{!r&&f.button===0&&f.ctrlKey===!1?i.onValueChange(o):f.preventDefault()}),onKeyDown:ae(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&i.onValueChange(o)}),onFocus:ae(e.onFocus,()=>{let f=i.activationMode!=="manual";!c&&!r&&f&&i.onValueChange(o)})})})});Dc.displayName=Ac;var Ec="TabsContent",Oc=I((e,t)=>{let{__scopeTabs:a,value:o,forceMount:r,children:n,...i}=e,s=Yi(Ec,a),l=Bc(s.baseId,o),u=Fc(s.baseId,o),c=o===s.value,f=D(c);return F(()=>{let p=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(p)},[]),L(Ot,{present:r||c,children:({present:p})=>L(te.div,{"data-state":c?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:u,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:p&&n})})});Oc.displayName=Ec;function Bc(e,t){return`${e}-trigger-${t}`}function Fc(e,t){return`${e}-content-${t}`}var Nc=kc,Zi=Mc,Qi=Dc,es=Oc;var Hc=Nc,ts=I(({className:e,...t},a)=>N(Zi,{ref:a,className:de("xps-tabs-list",e),...t}));ts.displayName=Zi.displayName;var Zr=I(({className:e,...t},a)=>N(Qi,{ref:a,className:de("xps-tabs-trigger",e),...t}));Zr.displayName=Qi.displayName;var Vv=I(({className:e,...t},a)=>N(es,{ref:a,className:de("xps-tabs-content",e),...t}));Vv.displayName=es.displayName;function zc(e){return d("section",{className:"motion-unified-header motion-page-header","aria-label":e.t("workbenchHeaderLabel")},d(_c,{title:e.header.title,label:e.t("motion")}),d(q,{variant:"outline",className:"project-dialog-button",onClick:e.header.onOpenProjects},e.t("manageProjects")),d(Uc,{header:e.header,t:e.t}),d(Vc,{dirty:e.header.dirty,statusLabel:e.header.statusLabel,t:e.t}),d(q,{variant:"outline",onClick:e.header.onOpenVersions},e.t("versionHistory")),d(q,{variant:"outline",onClick:e.header.onOpenExports},e.t("exportHistory")))}function Qr(e){return d("div",{className:"motion-unified-header editor-toolbar"},d(_c,{title:e.header.title,label:e.t("motion")}),d(q,{variant:"outline",className:"project-dialog-button",onClick:e.header.onOpenProjects},e.t("manageProjects")),d(Uc,{header:e.header,t:e.t}),d(Vc,{dirty:e.header.dirty,statusLabel:e.header.statusLabel,t:e.t}),d("span",{className:"toolbar-divider"}),d(Hc,{className:"toolbar-tabs",value:e.viewMode,onValueChange:t=>e.onViewModeChange(t)},d(ts,{className:"segmented compact"},d(Zr,{value:"preview"},e.t("preview")),d(Zr,{value:"code"},e.t("code")))),d(ut,{className:"device-select",value:e.device,options:xt(El,e.t),onValueChange:t=>e.onDeviceChange(t)}),d(q,{variant:"outline",className:"replay-button",onClick:e.onReplay,title:e.t("replayAllHint")},e.t("replayMotion")),d("span",{className:"toolbar-spacer"}),d(q,{variant:"outline",className:"icon-button",onClick:e.onUndo,disabled:!e.canUndo,title:e.t("undo")},"\u21B6"),d("div",{className:"zoom-control"},d(q,{variant:"ghost",onClick:()=>e.onZoomChange(Math.max(.5,e.zoom-.1))},"\u2212"),d("span",null,Math.round(e.zoom*100),"%"),d(q,{variant:"ghost",onClick:()=>e.onZoomChange(Math.min(1.4,e.zoom+.1))},"+")),d(q,{onClick:e.onSave,disabled:e.saving},e.t("save")),d(q,{variant:"secondary",onClick:e.header.onOpenVersions,disabled:e.saving},e.t("versionHistory")),d("div",{className:"download-menu"},d(q,{disabled:e.saving,onClick:()=>e.onExport(e.exportKinds[0]||"html")},e.t("download")),e.exportKinds.length>1?d("div",{className:"download-popover"},e.exportKinds.map(t=>d(q,{key:t,variant:"ghost",onClick:()=>e.onExport(t)},t))):null),d(q,{variant:"outline",onClick:e.header.onOpenExports},e.t("exportHistory")))}function _c(e){return d("div",{className:"motion-header-title"},d("span",{className:"motion-kicker"},e.label),d("strong",null,e.title))}function Vc(e){return e.dirty?d($a,{variant:"warning"},e.t("unsaved")):d($a,{variant:"secondary"},tr(e.statusLabel,e.t))}function Uc(e){return d(ut,{className:"motion-header-view-select",value:e.header.activeTab,options:Ml.map(t=>({value:t,label:tl(t,e.t)})),onValueChange:t=>e.header.onTabChange(t)})}var tn="Dialog",[qc,cI]=We(tn),[Uv,ct]=qc(tn),jc=e=>{let{__scopeDialog:t,children:a,open:o,defaultOpen:r,onOpenChange:n,modal:i=!0}=e,s=D(null),l=D(null),[u,c]=lt({prop:o,defaultProp:r??!1,onChange:n,caller:tn});return L(Uv,{scope:t,triggerRef:s,contentRef:l,contentId:tt(),titleId:tt(),descriptionId:tt(),open:u,onOpenChange:c,onOpenToggle:Q(()=>c(f=>!f),[c]),modal:i,children:a})};jc.displayName=tn;var Wc="DialogTrigger",qv=I((e,t)=>{let{__scopeDialog:a,...o}=e,r=ct(Wc,a),n=ce(t,r.triggerRef);return L(te.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.open?r.contentId:void 0,"data-state":rs(r.open),...o,ref:n,onClick:ae(e.onClick,r.onOpenToggle)})});qv.displayName=Wc;var as="DialogPortal",[jv,Gc]=qc(as,{forceMount:void 0}),Kc=e=>{let{__scopeDialog:t,forceMount:a,children:o,container:r}=e,n=ct(as,t);return L(jv,{scope:t,forceMount:a,children:ft.map(o,i=>L(Ot,{present:a||n.open,children:L(Ro,{asChild:!0,container:r,children:i})}))})};Kc.displayName=as;var en="DialogOverlay",$c=I((e,t)=>{let a=Gc(en,e.__scopeDialog),{forceMount:o=a.forceMount,...r}=e,n=ct(en,e.__scopeDialog);return n.modal?L(Ot,{present:o||n.open,children:L(Gv,{...r,ref:t})}):null});$c.displayName=en;var Wv=vt("DialogOverlay.RemoveScroll"),Gv=I((e,t)=>{let{__scopeDialog:a,...o}=e,r=ct(en,a);return L(Mo,{as:Wv,allowPinchZoom:!0,shards:[r.contentRef],children:L(te.div,{"data-state":rs(r.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),Ca="DialogContent",Xc=I((e,t)=>{let a=Gc(Ca,e.__scopeDialog),{forceMount:o=a.forceMount,...r}=e,n=ct(Ca,e.__scopeDialog);return L(Ot,{present:o||n.open,children:n.modal?L(Kv,{...r,ref:t}):L($v,{...r,ref:t})})});Xc.displayName=Ca;var Kv=I((e,t)=>{let a=ct(Ca,e.__scopeDialog),o=D(null),r=ce(t,a.contentRef,o);return F(()=>{let n=o.current;if(n)return Dr(n)},[]),L(Jc,{...e,ref:r,trapFocus:a.open,disableOutsidePointerEvents:a.open,onCloseAutoFocus:ae(e.onCloseAutoFocus,n=>{n.preventDefault(),a.triggerRef.current?.focus()}),onPointerDownOutside:ae(e.onPointerDownOutside,n=>{let i=n.detail.originalEvent,s=i.button===0&&i.ctrlKey===!0;(i.button===2||s)&&n.preventDefault()}),onFocusOutside:ae(e.onFocusOutside,n=>n.preventDefault())})}),$v=I((e,t)=>{let a=ct(Ca,e.__scopeDialog),o=D(!1),r=D(!1);return L(Jc,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:n=>{e.onCloseAutoFocus?.(n),n.defaultPrevented||(o.current||a.triggerRef.current?.focus(),n.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:n=>{e.onInteractOutside?.(n),n.defaultPrevented||(o.current=!0,n.detail.originalEvent.type==="pointerdown"&&(r.current=!0));let i=n.target;a.triggerRef.current?.contains(i)&&n.preventDefault(),n.detail.originalEvent.type==="focusin"&&r.current&&n.preventDefault()}})}),Jc=I((e,t)=>{let{__scopeDialog:a,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:n,...i}=e,s=ct(Ca,a),l=D(null),u=ce(t,l);return pr(),yt(Dt,{children:[L(bo,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:n,children:L(yo,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":rs(s.open),...i,ref:u,onDismiss:()=>s.onOpenChange(!1)})}),yt(Dt,{children:[L(Xv,{titleId:s.titleId}),L(Yv,{contentRef:l,descriptionId:s.descriptionId})]})]})}),os="DialogTitle",Yc=I((e,t)=>{let{__scopeDialog:a,...o}=e,r=ct(os,a);return L(te.h2,{id:r.titleId,...o,ref:t})});Yc.displayName=os;var Zc="DialogDescription",Qc=I((e,t)=>{let{__scopeDialog:a,...o}=e,r=ct(Zc,a);return L(te.p,{id:r.descriptionId,...o,ref:t})});Qc.displayName=Zc;var ef="DialogClose",tf=I((e,t)=>{let{__scopeDialog:a,...o}=e,r=ct(ef,a);return L(te.button,{type:"button",...o,ref:t,onClick:ae(e.onClick,()=>r.onOpenChange(!1))})});tf.displayName=ef;function rs(e){return e?"open":"closed"}var af="DialogTitleWarning",[fI,of]=Gl(af,{contentName:Ca,titleName:os,docsSlug:"dialog"}),Xv=({titleId:e})=>{let t=of(af),a=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
1013
|
-
|
|
1014
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
1015
|
-
|
|
1016
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return F(()=>{e&&(document.getElementById(e)||console.error(a))},[a,e]),null},Jv="DialogDescriptionWarning",Yv=({contentRef:e,descriptionId:t})=>{let o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${of(Jv).contentName}}.`;return F(()=>{let r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},rf=jc;var nf=Kc,ns=$c,is=Xc,ss=Yc,ls=Qc,sf=tf;var No=rf;var Qv=nf;var lf=I(({className:e,...t},a)=>N(ns,{ref:a,className:de("xps-dialog-overlay",e),...t}));lf.displayName=ns.displayName;var Xa=I(({className:e,children:t,showClose:a=!0,...o},r)=>N(Qv,null,N(lf,null),N(is,{ref:r,className:de("xps-dialog-content",e),...o},t,a?N(sf,{className:"xps-dialog-close"},N(Oo,{className:"xps-icon","aria-hidden":"true"}),N("span",{className:"xps-sr-only"},"Close")):null)));Xa.displayName=is.displayName;var Ja=I(({className:e,...t},a)=>N("div",{ref:a,className:de("xps-dialog-header",e),...t}));Ja.displayName="DialogHeader";var ds=I(({className:e,...t},a)=>N("div",{ref:a,className:de("xps-dialog-footer",e),...t}));ds.displayName="DialogFooter";var Ya=I(({className:e,...t},a)=>N(ss,{ref:a,className:de("xps-dialog-title",e),...t}));Ya.displayName=ss.displayName;var Za=I(({className:e,...t},a)=>N(ls,{ref:a,className:de("xps-dialog-description",e),...t}));Za.displayName=ls.displayName;var Xt=I(({className:e,...t},a)=>N("textarea",{ref:a,className:de("xps-textarea",e),...t}));Xt.displayName="Textarea";function df(e){return d(No,{open:e.open,onOpenChange:e.onOpenChange},d(Xa,{className:"motion-project-dialog"},d(Ja,null,d(Ya,null,e.t("projectDialogTitle")),d(Za,null,e.t("projectDialogDescription"))),d("div",{className:"project-dialog-layout"},d("section",{className:"project-dialog-create"},d("h3",null,e.t("newProject")),d("label",null,d("span",null,e.t("title")),d(ze,{value:e.title,onChange:t=>e.onTitleChange(t.target.value)})),d("label",null,d("span",null,e.t("brief")),d(Xt,{value:e.brief,onChange:t=>e.onBriefChange(t.target.value),rows:5})),d("div",{className:"motion-button-row"},d(q,{onClick:()=>{e.onCreate("web")},disabled:e.saving},e.t("newWeb")),d(q,{variant:"secondary",onClick:()=>{e.onCreate("video")},disabled:e.saving},e.t("newVideo")))),d("section",{className:"project-dialog-list"},d("h3",null,e.t("currentProject")),d("div",{className:"motion-list"},e.projects.map(t=>d(q,{key:t.id,variant:t.id===e.selectedProjectId?"secondary":"outline",className:`motion-list-item ${t.id===e.selectedProjectId?"active":""}`,onClick:()=>{e.onSelect(t.id),e.onOpenChange(!1)}},d("strong",null,t.title),d("span",null,e.t("projectSummary",{surface:ey(t.surface,e.t),version:t.currentVersionNumber||0,status:tr(t.status,e.t)})))),e.projects.length===0?d("div",{className:"motion-empty"},e.t("noProjects")):null)))))}function ey(e,t){return t(e==="video"?"createVideo":"createWeb")}function uf(e){return d(No,{open:e.open,onOpenChange:e.onOpenChange},d(Xa,{className:"motion-history-dialog"},d(Ja,null,d(Ya,null,e.t("versionHistory")),d(Za,null,e.t("versionHistoryDescription"))),d("div",{className:"history-dialog-actions"},d(q,{onClick:()=>{e.onCreateVersion()},disabled:e.saving},e.t("saveCurrentVersion"))),d("div",{className:"history-dialog-body"},d(ty,{versions:e.versions,currentId:e.currentId,t:e.t,onRestore:e.onRestore}))))}function cf(e){return d(No,{open:e.open,onOpenChange:e.onOpenChange},d(Xa,{className:"motion-history-dialog"},d(Ja,null,d(Ya,null,e.t("exportHistory")),d(Za,null,e.t("exportHistoryDescription"))),d("div",{className:"history-dialog-body"},d(ay,{exports:e.exports,selectedProject:e.selectedProject,t:e.t,onReviewed:e.onReviewed,onDraft:e.onDraft,onArchive:e.onArchive})),d(ds,null,d(q,{variant:"outline",onClick:()=>e.onOpenChange(!1)},e.t("close")))))}function ty(e){return d("section",{className:"motion-list wide"},e.versions.map(t=>d("article",{key:t.id,className:`motion-record ${t.id===e.currentId?"active":""}`},d("div",null,d("strong",null,e.t("versionLabel",{number:t.versionNumber||0})),d("span",null,t.changeSummary||t.sourceType||e.t("motionVersion"))),d(q,{variant:"secondary",onClick:()=>{e.onRestore(t.id)}},e.t("restore")))),e.versions.length===0?d("div",{className:"motion-empty"},e.t("noVersions")):null)}function ay(e){return d("section",{className:"motion-list wide"},d("div",{className:"motion-toolbar"},d(q,{variant:"secondary",onClick:e.onReviewed,disabled:!e.selectedProject},e.t("reviewed")),d(q,{variant:"outline",onClick:e.onDraft,disabled:!e.selectedProject},e.t("draft")),d(q,{variant:"outline",onClick:e.onArchive,disabled:!e.selectedProject},e.t("archive"))),e.exports.map(t=>d("article",{key:t.id,className:"motion-record"},d("div",null,d("strong",null,String(t.kind||e.t("artifact")).toUpperCase()),d("span",null,t.filePath||t.fileUrl||t.checksum||t.id)),t.fileUrl?d(q,{asChild:!0,variant:"secondary"},d("a",{href:t.fileUrl,target:"_blank",rel:"noreferrer"},e.t("open"))):null)),e.exports.length===0?d("div",{className:"motion-empty"},e.t("noExports")):null)}var Xe=I(({className:e,...t},a)=>N("div",{ref:a,className:de("xps-card",e),...t}));Xe.displayName="Card";var oy=I(({className:e,...t},a)=>N("div",{ref:a,className:de("xps-card-header",e),...t}));oy.displayName="CardHeader";var ry=I(({className:e,...t},a)=>N("h3",{ref:a,className:de("xps-card-title",e),...t}));ry.displayName="CardTitle";var ny=I(({className:e,...t},a)=>N("p",{ref:a,className:de("xps-card-description",e),...t}));ny.displayName="CardDescription";var iy=I(({className:e,...t},a)=>N("div",{ref:a,className:de("xps-card-content",e),...t}));iy.displayName="CardContent";function ff(e){let t=Math.max(1,e.layout.duration),[a,o]=k(!1),r=D({time:e.time,duration:t,onSeek:e.onSeek}),n=D(null);F(()=>{r.current={time:e.time,duration:t,onSeek:e.onSeek}},[t,e.onSeek,e.time]),F(()=>{if(!a)return;let s=0,l=0,u=n.current??Math.min(r.current.time,r.current.duration);n.current=null;let c=f=>{l||(l=f);let p=r.current,g=Math.min(p.duration,u+f-l);if(p.onSeek(g),g>=p.duration){o(!1);return}s=window.requestAnimationFrame(c)};return s=window.requestAnimationFrame(c),()=>window.cancelAnimationFrame(s)},[a]);function i(){if(a){o(!1);return}let s=0;n.current=s,e.onSeek(s),r.current={...r.current,time:s},o(!0)}return d(Xe,{className:"html-timeline"},d("div",{className:"timeline-head"},d(q,{className:"play-button small",onClick:i,title:e.t(a?"timelinePause":"timelinePlay")},a?"||":"\u25B6"),d("strong",null,(e.time/1e3).toFixed(2),"s"),d("span",null,e.t("timeline")),d($a,{variant:"secondary"},e.t(e.scope==="all"?"timelineScopeAll":"timelineScopeSelection")),e.layout.restraintWarning?d($a,{variant:"warning"},e.t("timelineRestraintWarning")):null,d(wa,{min:0,max:t,step:20,value:e.time,onChange:e.onSeek})),d("div",{className:"timeline-ruler"},[0,.25,.5,.75,1].map(s=>d("span",{key:s,style:{left:hf(s)}},(t*s/1e3).toFixed(1),"s"))),d("div",{className:"timeline-body"},d("div",{className:"timeline-playhead",style:{left:`${e.time/t*100}%`}}),e.layout.items.map(s=>d(q,{key:s.id,variant:"ghost",className:s.id===e.selectedId?"timeline-row active":"timeline-row",onClick:()=>e.onSelect(s.id)},d("span",null,s.label),d("i",{className:s.startsEarly?"starts-early":"",style:{left:`${s.leftPct}%`,width:`${s.widthPct}%`}})))))}function mf(e){let t=je(e.composition);return d("div",{className:"scene-strip"},d("div",{className:"scene-strip-head"},d("strong",null,e.t("sceneStrip")),d("span",null,e.t("sceneStripHelp"))),d("div",{className:"scene-strip-controls"},t.length===0?d(q,{variant:"secondary",className:"scene-chip active",onClick:()=>e.onSelect(-1)},e.t("main")):t.map((a,o)=>d(Ye,{key:a.id||o},d(q,{variant:o===e.activeSceneIndex?"secondary":"outline",className:o===e.activeSceneIndex?"scene-chip active":"scene-chip",onClick:()=>e.onSelect(o)},a.name||`${e.t("scenes")} ${o+1}`),o<t.length-1?d(ut,{value:a.transition||"cut",options:xt(Hl,e.t),onValueChange:e.onTransition,className:"transition-select"}):null)),d(q,{variant:"outline",className:"scene-chip",onClick:e.onAdd},"+ ",e.t("addScene")),d("label",{className:"scene-duration"},d("span",null,e.t("sceneLength")),d(ze,{type:"number",min:"0.5",max:"30",step:"0.5",value:t[e.activeSceneIndex]?.duration||e.composition.duration||5,onChange:a=>e.onDuration(Number(a.target.value))}),d("em",null,"s"))))}function pf(e){let t=Math.max(.1,e.duration),a=Math.min(t,Math.max(0,e.time));return d(Xe,{className:"video-timeline"},d("div",{className:"timeline-head compact-head"},d("div",{className:"timeline-title"},d("strong",null,e.t("keyframeTimeline")),d("span",null,e.t("keyframeTimelineHelp"))),d("div",{className:"timeline-legend","aria-hidden":"true"},d("span",null,d("i",{className:"legend-playhead"}),e.t("timelineCurrentTime")),d("span",null,d("i",{className:"legend-keyframe"}),e.t("keyframeLegend")))),d("div",{className:"timeline-ruler"},[0,.25,.5,.75,1].map(o=>d("span",{key:o,style:{left:hf(o)}},(t*o).toFixed(1),"s"))),d("div",{className:"timeline-body"},d("div",{className:"timeline-playhead",style:{left:`${a/t*100}%`}}),e.layers.map(o=>{let r=sy(o,e.t),n=i=>{let l=(i.currentTarget.querySelector(".timeline-track")||i.currentTarget).getBoundingClientRect(),u=Math.min(1,Math.max(0,(i.clientX-l.left)/l.width));e.onSeek(u*t)};return d("div",{key:o.id||o.text,role:"button",tabIndex:0,className:o.id===e.selectedLayerId?"timeline-row active":"timeline-row",onClick:n,onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),e.onSeek(a))}},d("span",null,o.text||o.id||o.type),d("div",{className:"timeline-track"},r.length===0?d("em",{className:"timeline-row-empty"},e.t("noKeyframes")):null,r.map(i=>{let s=e.t("keyframeDot",{properties:i.properties.join(", "),time:i.t.toFixed(2)});return d("button",{key:`${o.id||o.text}-${i.t}-${i.properties.join("-")}`,type:"button",className:Math.abs(i.t-a)<.04?"timeline-keyframe-dot active":"timeline-keyframe-dot",style:{left:`${i.t/t*100}%`},title:s,"aria-label":s,onClick:l=>{l.stopPropagation(),e.onSeek(i.t)}})})))})))}function Ho(e){return d("div",{className:"motion-stat"},d("strong",null,e.value??0),d("span",null,e.label))}function hf(e){return e<=0?"var(--timeline-edge-offset)":e>=1?"calc(100% - var(--timeline-edge-offset))":`${e*100}%`}function sy(e,t){let a=new Map;for(let[o,r]of Object.entries(e.tracks||{}))if(Array.isArray(r))for(let n of r){let i=Number(n.t??0);if(!Number.isFinite(i))continue;let s=i.toFixed(3),l=a.get(s)??{t:i,properties:[]};l.properties.push(ly(o,t)),a.set(s,l)}return[...a.values()].map(o=>({...o,properties:[...new Set(o.properties)]})).sort((o,r)=>o.t-r.t)}function ly(e,t){return e==="offset"?t("motionPath"):e}function gf(e){let t=e.getElementById("ma-workbench-edit-style")||e.createElement("style");t.id="ma-workbench-edit-style",t.textContent=`
|
|
110
|
+
${e}`}function wo(e,t,a){if(!e||e.length===0)return a;let o=e.map(r=>({t:Number(r.t??0),v:Number(r.v??a??0)})).sort((r,n)=>r.t-n.t);if(t<=o[0].t)return o[0].v;for(let r=1;r<o.length;r+=1){let n=o[r-1],i=o[r];if(t<=i.t){let s=Math.max(.001,i.t-n.t),l=Fs((t-n.t)/s,0,1);return n.v+(i.v-n.v)*l}}return o[o.length-1].v}function Fs(e,t,a){return Math.max(t,Math.min(a,Number.isFinite(e)?e:t))}function yo(e){return Math.round(e*1e3)/1e3}function Iy(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var vp=["text","rect","ellipse","image","video"];var ky='h1,h2,h3,p,button,a.btn,a.button,[class*="btn"],[class*="button"],[class*="card"],img,[data-ma-anim],[data-ma-kf]',Ry=14,xp=[{group:"Entrance",templates:["fade-in","slide-up","slide-down","slide-left","slide-right","zoom-in","rotate-in","pop","bounce-in"]},{group:"Emphasis",templates:["pulse","float","wobble"]},{group:"Attention",templates:["shake","heartbeat"]},{group:"Exit",templates:["fade-out","zoom-out"]}];function bp(e){let t=[],a=/<([a-zA-Z0-9-]+)\b([^>]*(?:data-ma-anim|data-ma-kf)[^>]*)>([\s\S]*?)<\/\1>|<([a-zA-Z0-9-]+)\b([^>]*(?:data-ma-anim|data-ma-kf)[^>]*)\/?>/gi,o;for(;(o=a.exec(e))!==null;){let r=o[1]||o[4]||"element",n=o[2]||o[5]||"",i=Co(n,"data-ma-anim"),s=Co(n,"data-ma-kf");if(!i&&!s)continue;let l=Co(n,"data-ma-id")||`${r}-${t.length+1}`,d=Ay(o[3]||"").trim();t.push({id:l,label:d?`${r} \xB7 ${d.slice(0,32)}`:r,verb:i||s||"custom",trigger:Co(n,"data-ma-trigger")||"load",delay:Ee(Co(n,"data-ma-delay"),0),duration:Ee(Co(n,"data-ma-dur"),520)})}return t}function _s(e){let t=e.tagName.toLowerCase(),a=(e.text||"").replace(/\s+/g," ").trim(),o=e.className||"",r=Math.max(0,Number(e.index||0));return t==="img"?`Image${e.alt?` \xB7 ${e.alt.slice(0,36)}`:` ${r+1}`}`:t==="button"||t==="a"||/\b(btn|button)\b/i.test(o)?`Button${a?` \xB7 ${a.slice(0,36)}`:` ${r+1}`}`:/\b(card|tile|panel)\b/i.test(o)?`Card${a?` \xB7 ${a.slice(0,36)}`:` ${r+1}`}`:/^h[1-3]$/.test(t)?`Headline${a?` \xB7 ${a.slice(0,42)}`:` ${r+1}`}`:t==="p"?`Text${a?` \xB7 ${a.slice(0,42)}`:` ${r+1}`}`:`${t}${a?` \xB7 ${a.slice(0,42)}`:` ${r+1}`}`}function Py(e){let t=e.width??999,a=e.height??999;return t>=24&&a>=12}function wp(e){let t=!1,a=Array.from(e.querySelectorAll(ky)),o=[];for(let r of a){if(o.length>=Ry)break;let n=r.getBoundingClientRect();Py({tagName:r.tagName,width:n.width,height:n.height})&&(o.some(i=>i!==r&&i.contains(r))||(r.getAttribute("data-ma-id")||(r.setAttribute("data-ma-id",`c${o.length}`),t=!0),o.push(r)))}return{changed:t,components:o.map((r,n)=>({id:r.getAttribute("data-ma-id")||`c${n}`,label:_s({tagName:r.tagName,text:r.textContent,className:r.getAttribute("class"),alt:r.getAttribute("alt"),index:n}),element:r}))}}function yp(e,t=1200){let a=Math.max(t,...e.map(r=>Math.max(0,r.delay)+Math.max(80,r.duration))),o=e.filter(r=>r.trigger==="load"&&r.delay<150).length;return{duration:a,earlyLoadCount:o,restraintWarning:o>4?"More than four load motions start early; consider delaying or changing some triggers.":null,items:e.map(r=>({...r,leftPct:Hs(Math.max(0,r.delay)/a*100,0,100),widthPct:Hs(Math.max(80,r.duration)/a*100,2,100),startsEarly:r.trigger==="load"&&r.delay<150}))}}function _a(){return{opacity:[{t:0,v:0},{t:.5,v:1}],x:[{t:0,v:0},{t:.5,v:0}],y:[{t:0,v:24},{t:.5,v:0,ease:"ease-out"}],scale:[{t:0,v:.96},{t:.5,v:1}],rotate:[{t:0,v:0},{t:.5,v:0}],blur:[{t:0,v:8},{t:.5,v:0}]}}function Cp(e){return{w:la(e.w,1280),h:la(e.h,720),fps:la(e.fps,30)}}function rt(e){return Array.isArray(e.scenes)&&e.scenes.length>0?e.scenes:[]}function Ty(e){let t=rt(e);if(t.length>0)return t.reduce((o,r)=>o+la(r.duration,3),0);let a=So(e,-1).reduce((o,r)=>Math.max(o,Ee(r.end,Ee(r.start,0)+3)),0);return la(e.duration,a||5)}function So(e,t){let a=rt(e);return t>=0&&a[t]?a[t].layers||[]:e.layers||[]}function pr(e,t,a){return(a!==void 0?[...e.shared||[],...So(e,a)]:[...e.layers||[],...e.shared||[],...rt(e).flatMap(r=>r.layers||[])]).find(r=>r.id===t)??null}function Sp(e,t,a=0){let{w:o,h:r}=Cp(t),i={id:`${e}-${Date.now().toString(36)}-${a}`,type:e,start:0,end:Math.min(4,Ty(t)),x:o/2,y:r/2,opacity:1,scale:1,rotate:0,tracks:{opacity:[{t:0,v:0},{t:.45,v:1,ease:"ease-out"}]}};return e==="text"?{...i,text:"New text",w:720,h:96,size:64,weight:800,color:"#ffffff",kinetic:{type:"word-rise",stagger:.04}}:e==="rect"?{...i,w:360,h:180,color:"#8b5cf6",radius:28}:e==="ellipse"?{...i,w:220,h:220,color:"#22c55e"}:{...i,w:480,h:270,color:"#e2e8f0"}}function Lp(e,t,a){let o=rt(e);return t>=0&&o[t]?{...e,scenes:o.map((r,n)=>n===t?{...r,layers:[...r.layers||[],a]}:r)}:{...e,layers:[...e.layers||[],a]}}function Va(e,t,a,o){let r=s=>(s||[]).map(l=>l.id===a?o(l):l),n=rt(e);return(e.shared||[]).some(s=>s.id===a)?{...e,shared:r(e.shared)}:t>=0&&n[t]?{...e,scenes:n.map((s,l)=>l===t?{...s,layers:r(s.layers)}:s)}:{...e,layers:r(e.layers)}}function Ip(e,t,a){let o=n=>(n||[]).filter(i=>i.id!==a),r=rt(e);return(e.shared||[]).some(n=>n.id===a)?{...e,shared:o(e.shared)}:t>=0&&r[t]?{...e,scenes:r.map((n,i)=>i===t?{...n,layers:o(n.layers)}:n)}:{...e,layers:o(e.layers)}}function Vs(e,t,a,o){let r=i=>{let s=[...i||[]],l=s.findIndex(c=>c.id===a),d=l+o;if(l<0||d<0||d>=s.length)return s;let[u]=s.splice(l,1);return s.splice(d,0,u),s},n=rt(e);return t>=0&&n[t]?{...e,scenes:n.map((i,s)=>s===t?{...i,layers:r(i.layers)}:i)}:{...e,layers:r(e.layers)}}function kp(e,t,a,o){let r=Ee(e.x,0)+t,n=Ee(e.y,0)+a;return{...e,x:r,y:n,tracks:{...e.tracks||{},x:Bs(e.tracks?.x,o,r),y:Bs(e.tracks?.y,o,n)}}}function Rp(e,t,a,o){return{...e,tracks:{...e.tracks||{},[t]:Bs(e.tracks?.[t],a,o)}}}function An(e,t){let a=Ee(e.x,0),o=Ee(e.y,0),r={...e.tracks||{}};return t==="fade-in"&&(r.opacity=[{t:0,v:0},{t:.5,v:1,ease:"ease-out"}]),t==="slide-up"&&Object.assign(r,{opacity:[{t:0,v:0},{t:.55,v:1}],y:[{t:0,v:o+56},{t:.55,v:o,ease:"ease-out"}]}),t==="slide-down"&&Object.assign(r,{opacity:[{t:0,v:0},{t:.55,v:1}],y:[{t:0,v:o-56},{t:.55,v:o,ease:"ease-out"}]}),t==="slide-left"&&Object.assign(r,{opacity:[{t:0,v:0},{t:.55,v:1}],x:[{t:0,v:a+72},{t:.55,v:a,ease:"ease-out"}]}),t==="slide-right"&&Object.assign(r,{opacity:[{t:0,v:0},{t:.55,v:1}],x:[{t:0,v:a-72},{t:.55,v:a,ease:"ease-out"}]}),t==="zoom-in"&&Object.assign(r,{opacity:[{t:0,v:0},{t:.5,v:1}],scale:[{t:0,v:.82},{t:.5,v:1,ease:"ease-out"}]}),t==="rotate-in"&&Object.assign(r,{opacity:[{t:0,v:0},{t:.55,v:1}],rotate:[{t:0,v:-10},{t:.55,v:0,ease:"ease-out"}]}),(t==="pop"||t==="bounce-in")&&Object.assign(r,{scale:[{t:0,v:.82},{t:.28,v:1.08},{t:.48,v:1}]}),t==="pulse"&&(r.scale=[{t:0,v:1},{t:.35,v:1.08},{t:.7,v:1}]),t==="float"&&(r.y=[{t:0,v:o},{t:1,v:o-22},{t:2,v:o}]),t==="wobble"&&(r.rotate=[{t:0,v:0},{t:.18,v:-5},{t:.38,v:4},{t:.6,v:0}]),t==="shake"&&(r.x=[{t:0,v:a},{t:.12,v:a-14},{t:.24,v:a+14},{t:.36,v:a}]),t==="heartbeat"&&(r.scale=[{t:0,v:1},{t:.2,v:1.12},{t:.36,v:1},{t:.52,v:1.08},{t:.7,v:1}]),t==="fade-out"&&(r.opacity=[{t:0,v:1},{t:.55,v:0}]),t==="zoom-out"&&Object.assign(r,{opacity:[{t:0,v:1},{t:.55,v:0}],scale:[{t:0,v:1},{t:.55,v:.84}]}),{...e,tracks:r}}function Us(e,t,a="line"){let o=t.filter(r=>Number.isFinite(r.x)&&Number.isFinite(r.y)).slice(0,80);return{...e,path:{kind:a,points:o},tracks:{...e.tracks||{},offset:e.tracks?.offset||[{t:0,v:0},{t:Math.max(.5,Ee(e.end,3)-Ee(e.start,0)),v:1,ease:"ease-out"}]}}}function qs(e){let t=e.type||"text",a=t==="text"?520:t==="ellipse"?220:360,o=t==="text"?la(e.size,64)*1.4:t==="ellipse"?220:180;return{x:Ee(e.x,0),y:Ee(e.y,0),w:la(e.w,a),h:la(e.h,o),rotate:Ee(e.rotate,0)}}function Pp(e,t,a){for(let o=e.length-1;o>=0;o-=1){let r=e[o],n=qs(r);if(t>=n.x-n.w/2&&t<=n.x+n.w/2&&a>=n.y-n.h/2&&a<=n.y+n.h/2)return r}return null}function Tp(e){let t=rt(e),{w:a,h:o}=Cp(e),r=t.length+1;return{...e,layers:t.length?e.layers:void 0,duration:void 0,scenes:[...t,{id:`scene-${r}`,name:`Scene ${r}`,duration:4,transition:r%2===0?"push":"dissolve",bg:r%2===0?"#111827":"#0f766e",layers:[{id:`scene-${r}-title`,type:"text",text:`Scene ${r}`,x:a/2,y:o/2,size:64,weight:800,color:"#ffffff",tracks:_a()}]}]}}function Mp(e,t,a){let o=rt(e);return o[t]?{...e,scenes:o.map((r,n)=>n===t?{...r,duration:Hs(a,.5,30)}:r)}:e}function Ap(e,t,a){let o=rt(e);return o[t]?{...e,scenes:o.map((r,n)=>n===t?{...r,transition:a}:r)}:e}function Bs(e,t,a){let o=Math.max(0,Math.round(t*100)/100),r=My(e||[]),n=r.find(i=>Math.abs(Ee(i.t,0)-o)<.02);return n?n.v=a:r.push({t:o,v:a}),r.sort((i,s)=>Ee(i.t,0)-Ee(s.t,0))}function My(e){return e.filter(t=>typeof t=="object"&&t!==null).map(t=>({t:Math.max(0,Ee(t.t,0)),v:Ee(t.v,0),...typeof t.ease=="string"&&t.ease.trim()?{ease:t.ease.trim()}:{}})).sort((t,a)=>Ee(t.t,0)-Ee(a.t,0))}function Co(e,t){return new RegExp(`${t}=(["'])(.*?)\\1`,"i").exec(e)?.[2]}function Ay(e){return e.replace(/<[^>]*>/g," ").replace(/\s+/g," ")}function Ee(e,t){let a=Number(e);return Number.isFinite(a)?a:t}function la(e,t){let a=Number(e);return Number.isFinite(a)&&a>0?a:t}function Hs(e,t,a){return Math.max(t,Math.min(a,Number.isFinite(e)?e:t))}var Dn=!1;function Dp(e){Dn=e===!0||!!e&&e!==null&&typeof e=="object"&&("enabled"in e?!!e.enabled:!!e.motion)}var zp={info(e,t){Dn&&console.info(`[motion] ${e}`,t??{})},warn(e,t){Dn&&console.warn(`[motion] ${e}`,t??{})},error(e,t){Dn&&console.error(`[motion] ${e}`,t??{})}};var Ep="xpertai.remote_component",Op=1,Ua=new Map,mr=null,Dy=0,Lo={requestTimeout:"Request timed out",remoteRequestFailed:"Remote request failed",unknownError:"Unknown error"};function Fe(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function hr(e,t,a){!mr&&e!=="ready"||parent.postMessage(Object.assign({channel:Ep,protocolVersion:Op,instanceId:mr,type:e},t||{}),"*",a||[])}function js(e,t,a){let o=String(++Dy);return new Promise((r,n)=>{Ua.set(o,{resolve:r,reject:n});try{hr(e,Object.assign({requestId:o},t||{}),a)}catch(i){Ua.delete(o),n(i instanceof Error?i:new Error(Lo.remoteRequestFailed));return}setTimeout(()=>{Ua.has(o)&&(Ua.delete(o),n(new Error(Lo.requestTimeout)))},3e4)})}function Np(e){return js("requestData",{query:e||{}})}function da(e,t,a,o){return js("executeAction",{actionKey:e,targetId:t,input:a,parameters:o})}async function zn(e,t,a,o,r){let n=await r.arrayBuffer();return js("executeFileAction",{actionKey:e,targetId:t,input:a,parameters:o,file:{name:r.name,type:r.type,size:r.size,buffer:n}},[n])}function Me(e,t){hr("notify",{level:e,message:t})}function gr(){let e=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,window.innerHeight||0,720);hr("resize",{height:e,viewportBound:!0})}function Ws(e){return e?Fe(e)?e.payload!==void 0?e.payload:e.data!==void 0?e.data:e.result!==void 0?e.result:e:e:null}function qa(e){return typeof e=="object"&&e&&"message"in e&&e.message?String(e.message):String(e||Lo.unknownError)}function Fp(e){Lo={...Lo,...e}}function Bp(e,t){let a=null;function o(n){window.XpertRemoteUI?.applyTheme?.(n)}function r(n){o(n);let i={...a||{},theme:n};a=i,e(i),setTimeout(gr,0)}window.addEventListener("message",n=>{let i=n.data;if(!(!Fe(i)||i.channel!==Ep||i.protocolVersion!==Op)){if(i.type==="init"){mr=typeof i.instanceId=="string"?i.instanceId:null,Dp(i.debug);let s={manifest:i.manifest,payload:i.payload,initialQuery:Oy(i.initialQuery),locale:typeof i.locale=="string"?i.locale:void 0,theme:i.theme,debug:i.debug};a=s,o(i.theme),e(s),zp.info("bridge.init",{instanceId:mr??"",locale:s.locale??"",hasInitialQuery:i.initialQuery!==void 0}),setTimeout(gr,0);return}if(i.instanceId===mr){if(Ey(i)){r(Ny(i));return}if(i.type==="hostEvent"){t(zy(i));return}if(i.requestId&&Ua.has(String(i.requestId))){let s=Ua.get(String(i.requestId));if(Ua.delete(String(i.requestId)),!s)return;i.type==="error"?s.reject(new Error(String(i.message||Lo.remoteRequestFailed))):s.resolve(i)}}}})}function zy(e){return e.event!==void 0?e.event:e.payload!==void 0?e.payload:e.data!==void 0?e.data:e.result!==void 0?e.result:e}function Ey(e){return["theme","themeChanged","theme-change","hostThemeChanged","host-theme-changed"].includes(String(e.type||""))}function Oy(e){return Fe(e)?{...e,parameters:Fe(e.parameters)?e.parameters:void 0,selectionId:e.selectionId}:{}}function Ny(e){return e.theme!==void 0?e.theme:Fe(e.payload)&&e.payload.theme!==void 0?e.payload.theme:Fe(e.data)&&e.data.theme!==void 0?e.data.theme:e.payload??e.data??null}var Hp=["library","html","video"],_p=["load","scroll","hover","click"],Vp=["fade","slide-up","slide-down","slide-left","slide-right","zoom","rotate","blur","pop","pulse","shake","wobble","sink"],En=["opacity","x","y","scale","rotate","blur"],Up=[{value:"desktop",labelKey:"deviceDesktop"},{value:"tablet",labelKey:"deviceTablet"},{value:"mobile",labelKey:"deviceMobile"}],qp=[{value:"all",labelKey:"filterAllSurfaces"},{value:"web",labelKey:"filterWeb"},{value:"video",labelKey:"filterVideo"}],jp=[{value:"all",labelKey:"filterAllTargets"},{value:"text",labelKey:"filterText"},{value:"button",labelKey:"filterButton"},{value:"card",labelKey:"filterCard"},{value:"image",labelKey:"filterImage"},{value:"video",labelKey:"filterVideoLayer"},{value:"background",labelKey:"filterBackground"}],Wp=[{value:"all",labelKey:"filterAllStatuses"},{value:"ready",labelKey:"filterReady"}],Gp=[{value:"none",labelKey:"kineticNone"},{value:"word-rise",labelKey:"kineticWordRise"},{value:"char-rise",labelKey:"kineticCharRise"},{value:"char-pop",labelKey:"kineticCharPop"},{value:"typewriter",labelKey:"kineticTypewriter"}],Kp=[{value:"cut",labelKey:"transitionCut"},{value:"dissolve",labelKey:"transitionDissolve"},{value:"push",labelKey:"transitionPush"},{value:"fade",labelKey:"transitionFade"}];var f=Te;function Z({size:e="sm",...t}){return f(pn,{size:e,...t})}function Ct(e){return f(Nf,{value:e.value,onValueChange:e.onValueChange},f(Bf,{className:e.className},f(Ff,null)),f(Hf,null,e.options.map(t=>f(_f,{key:t.value,value:t.value},t.label))))}function ja(e){let t=Fy(e.value,e.min,e.max);return f(Vf,{className:e.className,min:e.min,max:e.max,step:e.step,value:[t],onValueChange:a=>{let o=a[0];typeof o=="number"&&e.onChange(o)}})}function Fy(e,t,a){return Number.isFinite(e)?Math.min(a,Math.max(t,e)):t}function $p(e){return f("section",{className:"motion-unified-header motion-page-header","aria-label":e.t("workbenchHeaderLabel")},f(Xp,{title:e.header.title,label:e.t("motion")}),f(Z,{variant:"outline",className:"project-dialog-button",onClick:e.header.onOpenProjects},e.t("manageProjects")),f(Jp,{header:e.header,t:e.t}),f(Zp,{dirty:e.header.dirty,statusLabel:e.header.statusLabel,t:e.t}),f(Z,{variant:"outline",onClick:e.header.onOpenVersions},e.t("versionHistory")),f(Z,{variant:"outline",onClick:e.header.onOpenExports},e.t("exportHistory")))}function On(e){return f("div",{className:"motion-unified-header editor-toolbar"},f(Xp,{title:e.header.title,label:e.t("motion")}),f(Z,{variant:"outline",className:"project-dialog-button",onClick:e.header.onOpenProjects},e.t("manageProjects")),f(Jp,{header:e.header,t:e.t}),f(Zp,{dirty:e.header.dirty,statusLabel:e.header.statusLabel,t:e.t}),f("span",{className:"toolbar-divider"}),f(Uf,{className:"toolbar-tabs",value:e.viewMode,onValueChange:t=>e.onViewModeChange(t)},f(qf,{className:"segmented compact"},f(us,{value:"preview"},e.t("preview")),f(us,{value:"code"},e.t("code")))),f(Ct,{className:"device-select",value:e.device,options:Ot(Up,e.t),onValueChange:t=>e.onDeviceChange(t)}),f(Z,{variant:"outline",className:"replay-button",onClick:e.onReplay,title:e.t("replayAllHint")},e.t("replayMotion")),f("span",{className:"toolbar-spacer"}),f(Z,{variant:"outline",className:"icon-button",onClick:e.onUndo,disabled:!e.canUndo,title:e.t("undo")},"\u21B6"),f("div",{className:"zoom-control"},f(Z,{variant:"ghost",onClick:()=>e.onZoomChange(Math.max(.5,e.zoom-.1))},"\u2212"),f("span",null,Math.round(e.zoom*100),"%"),f(Z,{variant:"ghost",onClick:()=>e.onZoomChange(Math.min(1.4,e.zoom+.1))},"+")),f(Z,{onClick:e.onSave,disabled:e.saving},e.t("save")),f(Z,{variant:"secondary",onClick:e.header.onOpenVersions,disabled:e.saving},e.t("versionHistory")),f("div",{className:"download-menu"},f(Z,{disabled:e.saving,onClick:()=>e.onExport(e.exportKinds[0]||"html")},e.t("download")),e.exportKinds.length>1?f("div",{className:"download-popover"},e.exportKinds.map(t=>f(Z,{key:t,variant:"ghost",onClick:()=>e.onExport(t)},t))):null),f(Z,{variant:"outline",onClick:e.header.onOpenExports},e.t("exportHistory")))}function Xp(e){return f("div",{className:"motion-header-title"},f("span",{className:"motion-kicker"},e.label),f("strong",null,e.title))}function Zp(e){return e.dirty?f(mo,{variant:"outline","data-status":"warning"},e.t("unsaved")):f(mo,{variant:"secondary"},Rn(e.statusLabel,e.t))}function Jp(e){return f(Ct,{className:"motion-header-view-select",value:e.header.activeTab,options:Hp.map(t=>({value:t,label:up(t,e.t)})),onValueChange:t=>e.header.onTabChange(t)})}function Yp(e){return f(Qo,{open:e.open,onOpenChange:e.onOpenChange},f(er,{className:"motion-project-dialog"},f(tr,null,f(ar,null,e.t("projectDialogTitle")),f(or,null,e.t("projectDialogDescription"))),f("div",{className:"project-dialog-layout"},f("section",{className:"project-dialog-create"},f("h3",null,e.t("newProject")),f("label",null,f("span",null,e.t("title")),f(Ye,{value:e.title,onChange:t=>e.onTitleChange(t.target.value)})),f("label",null,f("span",null,e.t("brief")),f(Aa,{value:e.brief,onChange:t=>e.onBriefChange(t.target.value),rows:5})),f("div",{className:"motion-button-row"},f(Z,{onClick:()=>{e.onCreate("web")},disabled:e.saving},e.t("newWeb")),f(Z,{variant:"secondary",onClick:()=>{e.onCreate("video")},disabled:e.saving},e.t("newVideo")))),f("section",{className:"project-dialog-list"},f("h3",null,e.t("currentProject")),f("div",{className:"motion-list"},e.projects.map(t=>f(Z,{key:t.id,variant:t.id===e.selectedProjectId?"secondary":"outline",className:`motion-list-item ${t.id===e.selectedProjectId?"active":""}`,onClick:()=>{e.onSelect(t.id),e.onOpenChange(!1)}},f("strong",null,t.title),f("span",null,e.t("projectSummary",{surface:By(t.surface,e.t),version:t.currentVersionNumber||0,status:Rn(t.status,e.t)})))),e.projects.length===0?f("div",{className:"motion-empty"},e.t("noProjects")):null)))))}function By(e,t){return t(e==="video"?"createVideo":"createWeb")}function Qp(e){return f(Qo,{open:e.open,onOpenChange:e.onOpenChange},f(er,{className:"motion-history-dialog"},f(tr,null,f(ar,null,e.t("versionHistory")),f(or,null,e.t("versionHistoryDescription"))),f("div",{className:"history-dialog-actions"},f(Z,{onClick:()=>{e.onCreateVersion()},disabled:e.saving},e.t("saveCurrentVersion"))),f("div",{className:"history-dialog-body"},f(Hy,{versions:e.versions,currentId:e.currentId,t:e.t,onRestore:e.onRestore}))))}function em(e){return f(Qo,{open:e.open,onOpenChange:e.onOpenChange},f(er,{className:"motion-history-dialog"},f(tr,null,f(ar,null,e.t("exportHistory")),f(or,null,e.t("exportHistoryDescription"))),f("div",{className:"history-dialog-body"},f(_y,{exports:e.exports,selectedProject:e.selectedProject,t:e.t,onReviewed:e.onReviewed,onDraft:e.onDraft,onArchive:e.onArchive})),f(Of,null,f(Z,{variant:"outline",onClick:()=>e.onOpenChange(!1)},e.t("close")))))}function Hy(e){return f("section",{className:"motion-list wide"},e.versions.map(t=>f("article",{key:t.id,className:`motion-record ${t.id===e.currentId?"active":""}`},f("div",null,f("strong",null,e.t("versionLabel",{number:t.versionNumber||0})),f("span",null,t.changeSummary||t.sourceType||e.t("motionVersion"))),f(Z,{variant:"secondary",onClick:()=>{e.onRestore(t.id)}},e.t("restore")))),e.versions.length===0?f("div",{className:"motion-empty"},e.t("noVersions")):null)}function _y(e){return f("section",{className:"motion-list wide"},f("div",{className:"motion-toolbar"},f(Z,{variant:"secondary",onClick:e.onReviewed,disabled:!e.selectedProject},e.t("reviewed")),f(Z,{variant:"outline",onClick:e.onDraft,disabled:!e.selectedProject},e.t("draft")),f(Z,{variant:"outline",onClick:e.onArchive,disabled:!e.selectedProject},e.t("archive"))),e.exports.map(t=>f("article",{key:t.id,className:"motion-record"},f("div",null,f("strong",null,String(t.kind||e.t("artifact")).toUpperCase()),f("span",null,t.filePath||t.fileUrl||t.checksum||t.id)),t.fileUrl?f(Z,{asChild:!0,variant:"secondary"},f("a",{href:t.fileUrl,target:"_blank",rel:"noreferrer"},e.t("open"))):null)),e.exports.length===0?f("div",{className:"motion-empty"},e.t("noExports")):null)}function tm(e){let t=Math.max(1,e.layout.duration),[a,o]=M(!1),r=z({time:e.time,duration:t,onSeek:e.onSeek}),n=z(null);H(()=>{r.current={time:e.time,duration:t,onSeek:e.onSeek}},[t,e.onSeek,e.time]),H(()=>{if(!a)return;let s=0,l=0,d=n.current??Math.min(r.current.time,r.current.duration);n.current=null;let u=c=>{l||(l=c);let m=r.current,h=Math.min(m.duration,d+c-l);if(m.onSeek(h),h>=m.duration){o(!1);return}s=window.requestAnimationFrame(u)};return s=window.requestAnimationFrame(u),()=>window.cancelAnimationFrame(s)},[a]);function i(){if(a){o(!1);return}let s=0;n.current=s,e.onSeek(s),r.current={...r.current,time:s},o(!0)}return f(it,{className:"html-timeline"},f("div",{className:"timeline-head"},f(Z,{className:"play-button small",onClick:i,title:e.t(a?"timelinePause":"timelinePlay")},a?"||":"\u25B6"),f("strong",null,(e.time/1e3).toFixed(2),"s"),f("span",null,e.t("timeline")),f(mo,{variant:"secondary"},e.t(e.scope==="all"?"timelineScopeAll":"timelineScopeSelection")),e.layout.restraintWarning?f(mo,{variant:"outline","data-status":"warning"},e.t("timelineRestraintWarning")):null,f(ja,{min:0,max:t,step:20,value:e.time,onChange:e.onSeek})),f("div",{className:"timeline-ruler"},[0,.25,.5,.75,1].map(s=>f("span",{key:s,style:{left:rm(s)}},(t*s/1e3).toFixed(1),"s"))),f("div",{className:"timeline-body"},f("div",{className:"timeline-playhead",style:{left:`${e.time/t*100}%`}}),e.layout.items.map(s=>f(Z,{key:s.id,variant:"ghost",className:s.id===e.selectedId?"timeline-row active":"timeline-row",onClick:()=>e.onSelect(s.id)},f("span",null,s.label),f("i",{className:s.startsEarly?"starts-early":"",style:{left:`${s.leftPct}%`,width:`${s.widthPct}%`}})))))}function am(e){let t=rt(e.composition);return f("div",{className:"scene-strip"},f("div",{className:"scene-strip-head"},f("strong",null,e.t("sceneStrip")),f("span",null,e.t("sceneStripHelp"))),f("div",{className:"scene-strip-controls"},t.length===0?f(Z,{variant:"secondary",className:"scene-chip active",onClick:()=>e.onSelect(-1)},e.t("main")):t.map((a,o)=>f(nt,{key:a.id||o},f(Z,{variant:o===e.activeSceneIndex?"secondary":"outline",className:o===e.activeSceneIndex?"scene-chip active":"scene-chip",onClick:()=>e.onSelect(o)},a.name||`${e.t("scenes")} ${o+1}`),o<t.length-1?f(Ct,{value:a.transition||"cut",options:Ot(Kp,e.t),onValueChange:e.onTransition,className:"transition-select"}):null)),f(Z,{variant:"outline",className:"scene-chip",onClick:e.onAdd},"+ ",e.t("addScene")),f("label",{className:"scene-duration"},f("span",null,e.t("sceneLength")),f(Ye,{type:"number",min:"0.5",max:"30",step:"0.5",value:t[e.activeSceneIndex]?.duration||e.composition.duration||5,onChange:a=>e.onDuration(Number(a.target.value))}),f("em",null,"s"))))}function om(e){let t=Math.max(.1,e.duration),a=Math.min(t,Math.max(0,e.time));return f(it,{className:"video-timeline"},f("div",{className:"timeline-head compact-head"},f("div",{className:"timeline-title"},f("strong",null,e.t("keyframeTimeline")),f("span",null,e.t("keyframeTimelineHelp"))),f("div",{className:"timeline-legend","aria-hidden":"true"},f("span",null,f("i",{className:"legend-playhead"}),e.t("timelineCurrentTime")),f("span",null,f("i",{className:"legend-keyframe"}),e.t("keyframeLegend")))),f("div",{className:"timeline-ruler"},[0,.25,.5,.75,1].map(o=>f("span",{key:o,style:{left:rm(o)}},(t*o).toFixed(1),"s"))),f("div",{className:"timeline-body"},f("div",{className:"timeline-playhead",style:{left:`${a/t*100}%`}}),e.layers.map(o=>{let r=Vy(o,e.t),n=i=>{let l=(i.currentTarget.querySelector(".timeline-track")||i.currentTarget).getBoundingClientRect(),d=Math.min(1,Math.max(0,(i.clientX-l.left)/l.width));e.onSeek(d*t)};return f("div",{key:o.id||o.text,role:"button",tabIndex:0,className:o.id===e.selectedLayerId?"timeline-row active":"timeline-row",onClick:n,onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),e.onSeek(a))}},f("span",null,o.text||o.id||o.type),f("div",{className:"timeline-track"},r.length===0?f("em",{className:"timeline-row-empty"},e.t("noKeyframes")):null,r.map(i=>{let s=e.t("keyframeDot",{properties:i.properties.join(", "),time:i.t.toFixed(2)});return f("button",{key:`${o.id||o.text}-${i.t}-${i.properties.join("-")}`,type:"button",className:Math.abs(i.t-a)<.04?"timeline-keyframe-dot active":"timeline-keyframe-dot",style:{left:`${i.t/t*100}%`},title:s,"aria-label":s,onClick:l=>{l.stopPropagation(),e.onSeek(i.t)}})})))})))}function vr(e){return f("div",{className:"motion-stat"},f("strong",null,e.value??0),f("span",null,e.label))}function rm(e){return e<=0?"var(--timeline-edge-offset)":e>=1?"calc(100% - var(--timeline-edge-offset))":`${e*100}%`}function Vy(e,t){let a=new Map;for(let[o,r]of Object.entries(e.tracks||{}))if(Array.isArray(r))for(let n of r){let i=Number(n.t??0);if(!Number.isFinite(i))continue;let s=i.toFixed(3),l=a.get(s)??{t:i,properties:[]};l.properties.push(Uy(o,t)),a.set(s,l)}return[...a.values()].map(o=>({...o,properties:[...new Set(o.properties)]})).sort((o,r)=>o.t-r.t)}function Uy(e,t){return e==="offset"?t("motionPath"):e}function nm(e){let t=e.getElementById("ma-workbench-edit-style")||e.createElement("style");t.id="ma-workbench-edit-style",t.textContent=`
|
|
1017
111
|
.ma-editable{cursor:pointer}
|
|
1018
112
|
.ma-selected{outline:3px solid #8b5cf6!important;outline-offset:4px!important}
|
|
1019
113
|
.ma-hover{outline:2px dashed rgba(139,92,246,.55)!important;outline-offset:3px!important}
|
|
1020
|
-
`,t.parentElement||e.head?.appendChild(t);let a=
|
|
1021
|
-
${e.documentElement.outerHTML}`}function yf(e){return Vn({tagName:e.tagName,text:e.textContent,className:e.getAttribute("class"),alt:e.getAttribute("alt")})}function to(e){try{let t=JSON.parse(e);return t&&typeof t=="object"&&!Array.isArray(t)?t:null}catch{return null}}function fs(e,t){return e&&e.length>0?Number(e[e.length-1].v??0):t==="opacity"||t==="scale"?1:0}function bf(e,t){return e==="opacity"||e==="scale"?t.toFixed(2):e==="rotate"?`${Math.round(t)}\xB0`:`${Math.round(t)}px`}function zo(e){return e.replace(/["\\]/g,"\\$&")}function Bt(e,t,a){return Number.isFinite(e)?Math.min(a,Math.max(t,e)):t}function dy(e){return Object.values(e).some(t=>Array.isArray(t)&&t.length>0)}function uy(e,t){let a=t?to(t.tracksJson):null,o=to(e.getAttribute("data-ma-tracks")||"");return{verb:e.getAttribute("data-ma-anim")||t?.verb||"fade",duration:Bt(Number(e.getAttribute("data-ma-dur")||t?.duration||520),80,4e3),delay:Bt(Number(e.getAttribute("data-ma-delay")||t?.delay||0),0,8e3),distance:Bt(Number(e.getAttribute("data-ma-dist")||t?.distance||24),-400,400),tracks:ra(o??a??na())}}function cy(e,t){return{opacity:Qa(e.opacity,t,void 0),x:Qa(e.x,t,0)??0,y:Qa(e.y,t,0)??0,scale:Qa(e.scale,t,1)??1,rotate:Qa(e.rotate,t,0)??0,blur:Qa(e.blur,t,0)??0}}function fy(e,t,a){let o=Bt(t,0,1),r=1-o;switch(e){case"slide-up":return{opacity:o,x:0,y:a*r,scale:1,rotate:0,blur:0};case"slide-down":return{opacity:o,x:0,y:-a*r,scale:1,rotate:0,blur:0};case"slide-left":return{opacity:o,x:-a*r,y:0,scale:1,rotate:0,blur:0};case"slide-right":return{opacity:o,x:a*r,y:0,scale:1,rotate:0,blur:0};case"zoom":return{opacity:o,x:0,y:0,scale:.9+.1*o,rotate:0,blur:0};case"rotate":return{opacity:o,x:0,y:0,scale:.96+.04*o,rotate:-8*r,blur:0};case"blur":return{opacity:o,x:0,y:0,scale:1,rotate:0,blur:10*r};case"pop":{let n=o<.45?o/.45:1-(o-.45)/.55;return{opacity:1,x:0,y:-Math.max(0,n)*Math.min(Math.abs(a),24),scale:1+Math.max(0,n)*.06,rotate:0,blur:0}}case"pulse":return{opacity:1,x:0,y:0,scale:1+Math.sin(Math.PI*o)*.08,rotate:0,blur:0};case"shake":return{opacity:1,x:Math.sin(Math.PI*o*8)*6*r,y:0,scale:1,rotate:0,blur:0};case"wobble":return{opacity:1,x:0,y:0,scale:1,rotate:Math.sin(Math.PI*o*6)*4*r,blur:0};case"sink":return{opacity:1,x:0,y:0,scale:1-Math.sin(Math.PI*o)*.06,rotate:0,blur:0};default:return{opacity:o,x:0,y:0,scale:1,rotate:0,blur:0}}}function my(e,t){e.style.animation="none",e.style.animationPlayState="paused",t.opacity!==void 0&&(e.style.opacity=String(eo(t.opacity))),e.style.transform=`translate(${eo(t.x)}px, ${eo(t.y)}px) scale(${eo(t.scale)}) rotate(${eo(t.rotate)}deg)`,e.style.filter=t.blur>0?`blur(${eo(t.blur)}px)`:"blur(0)",e.style.willChange="opacity, transform, filter"}function Qa(e,t,a){if(!e||e.length===0)return a;let o=e.map(r=>({t:Number(r.t??0),v:Number(r.v??a??0)})).sort((r,n)=>r.t-n.t);if(t<=o[0].t)return o[0].v;for(let r=1;r<o.length;r+=1){let n=o[r-1],i=o[r];if(t<=i.t){let s=Math.max(.001,i.t-n.t),l=Bt((t-n.t)/s,0,1);return n.v+(i.v-n.v)*l}}return o[o.length-1].v}function eo(e){return Math.round(e*1e3)/1e3}function wf(e){let t=D(null),[a,o]=k("preview"),[r,n]=k("desktop"),[i,s]=k(1),[l,u]=k("keyframes"),[c,f]=k(()=>typeof e.componentSelection?.componentId=="string"?e.componentSelection.componentId:""),[p,g]=k(0),[v,m]=k(0),[h,y]=k([]),b=he(()=>ul(e.htmlDraft),[e.htmlDraft]),w=he(()=>{if(b.length>0)return b;let R=c||(typeof e.componentSelection?.componentId=="string"?e.componentSelection.componentId:"");return R?[{id:R,label:typeof e.componentSelection?.label=="string"?e.componentSelection.label:e.t("selectElement"),verb:e.controls.verb,trigger:e.controls.trigger,delay:Number(e.controls.delay||0),duration:Number(e.controls.duration||520)}]:[]},[b,e.componentSelection,e.controls,e.t,c]),C=he(()=>fl(w),[w]),P=w.find(R=>R.id===c)??w[0]??null,M=he(()=>ra(to(e.controls.tracksJson)??na()),[e.controls.tracksJson]),T=C.duration,B=he(()=>{try{return nl(e.htmlDraft)}catch{return e.htmlDraft}},[e.htmlDraft]);F(()=>{!c&&P?.id&&(f(P.id),e.onComponentSelectionChange({componentId:P.id,label:P.label}))},[e,c,P]);function U(){let H=t.current?.contentDocument;if(!H)return;let K=gf(H);if(K.changed&&e.onDraftChange(cs(H)),!c&&K.components[0]){let O=K.components[0];f(O.id),e.onComponentSelectionChange({componentId:O.id,label:O.label}),e.onControlsChange({...e.controls,selector:`[data-ma-id="${O.id}"]`})}xf(H,O=>{let X=O.getAttribute("data-ma-id")||"";X&&(f(X),e.onComponentSelectionChange({componentId:X,label:yf(O)}),e.onControlsChange({...e.controls,selector:`[data-ma-id="${X}"]`,verb:O.getAttribute("data-ma-anim")||e.controls.verb,trigger:O.getAttribute("data-ma-trigger")||e.controls.trigger,duration:Number(O.getAttribute("data-ma-dur")||e.controls.duration),delay:Number(O.getAttribute("data-ma-delay")||e.controls.delay),distance:Number(O.getAttribute("data-ma-dist")||e.controls.distance),tracksJson:O.getAttribute("data-ma-tracks")||e.controls.tracksJson}))}),us(H,c)}F(()=>{let R=t.current?.contentDocument;R&&us(R,c)},[c]);function Y(){g(0),o("preview"),m(R=>R+1)}function j(R){g(R),t.current?.contentWindow?.__maTimeline?.seek?.(R);let K=t.current?.contentDocument;K&&vf(K,R,{selectedId:c,controls:e.controls})}function E(R,H){let K=ra(to(e.controls.tracksJson)??na()),O=K[R]&&K[R].length>=2?[...K[R]]:[{t:0,v:R==="opacity"?0:R==="scale"?.96:0},{t:.5,v:R==="opacity"||R==="scale"?1:0}];O[O.length-1]={...O[O.length-1],v:H},e.onControlsChange({...e.controls,tracksJson:JSON.stringify({...K,[R]:O},null,2)})}function W(R=e.controls){if(!c){Re("warning",e.t("selectElementFirst"));return}try{y(K=>[...K.slice(-9),e.htmlDraft]);let H=an(e.htmlDraft,c,R);e.onDraftChange(H),e.onComponentSelectionChange({componentId:c,label:P?.label??c,trigger:R.trigger,verb:R.verb})}catch(H){Re("error",la(H))}}function Z(){let R=h[h.length-1];R&&(y(H=>H.slice(0,-1)),e.onDraftChange(R))}return d("section",{className:"motion-workbench-surface html-surface"},d(Qr,{header:e.header,t:e.t,viewMode:a,device:r,zoom:i,canUndo:h.length>0,onViewModeChange:o,onDeviceChange:n,onZoomChange:s,onReplay:Y,onUndo:Z,onSave:e.onSave,onExport:R=>e.onExport(R),saving:e.saving,exportKinds:["html","css","json","react","lottie"]}),a==="code"?d(Xe,{className:"motion-panel motion-code-panel"},d(Xt,{className:"motion-code",value:e.htmlDraft,onChange:R=>e.onDraftChange(R.target.value),spellCheck:!1})):d("div",{className:"html-stage-layout"},d("div",{className:`html-device-frame ${r}`,style:{transform:`scale(${i})`}},d("iframe",{key:`${r}-${v}`,ref:t,title:e.t("html"),sandbox:"allow-scripts allow-same-origin",srcDoc:B,onLoad:U})),d(Xe,{className:"motion-inspector"},d("div",{className:"inspector-title"},d("div",null,d("span",{className:"selection-dot"}),d("strong",null,P?.label||e.t("selectElement")))),d("div",{className:"segmented"},d(q,{variant:l==="preset"?"default":"outline",className:l==="preset"?"active":"",onClick:()=>u("preset")},e.t("preset")),d(q,{variant:l==="keyframes"?"default":"outline",className:l==="keyframes"?"active":"",onClick:()=>u("keyframes")},e.t("keyframes"))),d("section",{className:"inspector-section"},d("span",{className:"section-eyebrow"},e.t("trigger")),d("div",{className:"chip-grid four"},Al.map(R=>d(q,{key:R,variant:R===e.controls.trigger?"default":"outline",className:R===e.controls.trigger?"chip-button active":"chip-button",onClick:()=>{let H={...e.controls,trigger:R};e.onControlsChange(H),W(H)}},er(R,e.t))))),l==="preset"?d("section",{className:"inspector-section"},d("span",{className:"section-eyebrow"},e.t("motionLabel")),d("div",{className:"chip-grid"},Dl.map(R=>d(q,{key:R,variant:R===e.controls.verb?"default":"outline",className:R===e.controls.verb?"chip-button active":"chip-button",onClick:()=>{let H={...e.controls,verb:R};e.onControlsChange(H),W(H)}},R)))):d("section",{className:"inspector-section"},d("span",{className:"section-eyebrow"},e.t("keyframes")),d("label",{className:"range-row"},d("span",null,e.t("scrub")),d(wa,{min:0,max:T,step:20,value:p,onChange:j}),d("em",null,Math.round(p),"ms")),lr.map(R=>d("label",{key:R,className:"range-row"},d("span",null,R),d(wa,{min:R==="opacity"?0:R==="scale"?.2:R==="rotate"?-180:-160,max:R==="opacity"?1:R==="scale"?2:R==="rotate"?180:160,step:R==="opacity"||R==="scale"?.01:1,value:fs(M[R],R),onChange:H=>E(R,H)}),d("em",null,bf(R,fs(M[R],R))))),d(Xt,{className:"motion-code-small",value:e.controls.tracksJson,onChange:R=>e.onControlsChange({...e.controls,tracksJson:R.target.value})})),d("section",{className:"inspector-section compact-form"},d("div",{className:"motion-form-grid"},d("label",null,d("span",null,e.t("duration")),d(ze,{type:"number",value:e.controls.duration,onChange:R=>e.onControlsChange({...e.controls,duration:Number(R.target.value)})})),d("label",null,d("span",null,e.t("delay")),d(ze,{type:"number",value:e.controls.delay,onChange:R=>e.onControlsChange({...e.controls,delay:Number(R.target.value)})})),d("label",null,d("span",null,e.t("distance")),d(ze,{type:"number",value:e.controls.distance,onChange:R=>e.onControlsChange({...e.controls,distance:Number(R.target.value)})}))),d(q,{className:"full-width",onClick:()=>W(),disabled:!c},e.t("applyMotion"))))),d(ff,{layout:C,selectedId:c,scope:b.length>0?"all":"selection",time:p,t:e.t,onSelect:R=>f(R),onSeek:j}))}function Lf(e){let[t,a]=k("preview"),[o,r]=k("desktop"),[n,i]=k(1),[s,l]=k("select"),[u,c]=k(0),[f,p]=k("slide-up"),[g,v]=k(""),[m,h]=k(!1),y=D(null),b=D([]),w=D({time:e.videoTime,duration:e.duration,onTimeChange:e.onTimeChange}),C=he(()=>{try{return e.parseVideoComposition(e.videoDraft)}catch{return e.defaultComposition(e.t("invalidCompositionJson"))}},[e]),P=je(C),M=P.length>0?Math.min(u,P.length-1):-1,T=[...C.shared||[],...Fa(C,M)],B=typeof e.layerSelection?.layerId=="string"?e.layerSelection.layerId:T[0]?.id||"",U=B?po(C,B,M):null;F(()=>{w.current={time:e.videoTime,duration:e.duration,onTimeChange:e.onTimeChange}},[e.duration,e.onTimeChange,e.videoTime]),F(()=>{if(!m)return;let S=0,_=performance.now(),fe=Pe=>{let ve=w.current,ke=Math.min(.08,Math.max(0,(Pe-_)/1e3));_=Pe;let J=Math.min(ve.duration,ve.time+ke);if(ve.onTimeChange(J),J>=ve.duration-.01){h(!1);return}S=requestAnimationFrame(fe)};return S=requestAnimationFrame(fe),()=>cancelAnimationFrame(S)},[m]),F(()=>{!B&&T[0]?.id&&e.onLayerSelectionChange({layerId:T[0].id,sceneIndex:M})},[M,T,e,B]);function Y(){e.onTimeChange(0),h(!0)}function j(){if(m){h(!1);return}e.videoTime>=e.duration-.05&&e.onTimeChange(0),h(!0)}function E(S,_){e.onDraftChange(JSON.stringify(S,null,2)),_!==void 0&&e.onLayerSelectionChange(_)}function W(S){e.onLayerSelectionChange(S?{layerId:S,sceneIndex:M}:null)}function Z(S){let _=pl(S,C,T.length+1);E(hl(C,M,_),{layerId:_.id||"",sceneIndex:M})}function R(S){B&&E(ia(C,M,B,_=>S(_)??_))}function H(S){let fe=e.canvasRef.current?.getBoundingClientRect(),Pe=C.w||1280,ve=C.h||720;return fe?{x:(S.clientX-fe.left)/fe.width*Pe,y:(S.clientY-fe.top)/fe.height*ve}:{x:0,y:0}}function K(S){let _=H(S);if(s==="path"){b.current=[_];return}let fe=yl(T,_.x,_.y);fe?.id?(W(fe.id),y.current={id:fe.id,x:_.x,y:_.y}):W(null)}function O(S){let _=H(S);if(s==="path"&&b.current.length>0){b.current.push(_);return}let fe=y.current;if(!fe)return;let Pe=_.x-fe.x,ve=_.y-fe.y;y.current={...fe,x:_.x,y:_.y},E(ia(C,M,fe.id,ke=>xl(ke,Pe,ve,e.videoTime)))}function X(){let S=b.current;s==="path"&&B&&S.length>1&&E(ia(C,M,B,_=>qn(_,S,"raw"))),b.current=[],y.current=null}async function se(S,_,fe){if(!e.selectedProject?.id){Re("warning",e.t("createOrSaveBeforeUpload"));return}try{let Pe=await sr("upload_media_file",e.selectedProject.id,{projectId:e.selectedProject.id,purpose:_},{projectId:e.selectedProject.id},S),ve=e.extractMediaPayload(Pe);if(!ve?.src)throw new Error(e.t("mediaUploadNoSource"));fe==="background"?E({...C,bg:ve.src}):fe==="reference"?E({...C,reference:{src:ve.src,filePath:ve.filePath||null,mimeType:ve.mimeType||S.type}}):B&&E(ia(C,M,B,ke=>({...ke,src:ve.src,filePath:ve.filePath,fileUrl:ve.fileUrl}))),Re("success",e.t("mediaUploaded"))}catch(Pe){Re("error",la(Pe))}}return d("section",{className:"motion-workbench-surface video-surface"},d(Qr,{header:e.header,t:e.t,viewMode:t,device:o,zoom:n,canUndo:!1,onViewModeChange:a,onDeviceChange:r,onZoomChange:i,onReplay:Y,onUndo:()=>{},onSave:e.onSave,onExport:()=>e.onExportMp4(),saving:e.saving,exportKinds:["mp4"]}),t==="code"?d(Xe,{className:"motion-panel motion-code-panel"},d(Xt,{className:"motion-code motion-video-code",value:e.videoDraft,onChange:S=>e.onDraftChange(S.target.value),spellCheck:!1})):d("div",{className:"video-stage-layout"},d(Xe,{className:"video-main"},d("div",{className:"tool-row"},d(q,{variant:s==="select"?"default":"outline",className:s==="select"?"tool-button active":"tool-button",onClick:()=>l("select")},e.t("select")),d(q,{variant:s==="path"?"default":"outline",className:s==="path"?"tool-button active":"tool-button",onClick:()=>l("path")},e.t("path")),d("span",null,s==="path"?e.t("drawPathHint"):e.t("dragLayerHint"))),d("div",{className:`video-canvas-wrap ${o}`,style:{transform:`scale(${n})`}},d("canvas",{ref:e.canvasRef,onPointerDown:K,onPointerMove:O,onPointerUp:X,onPointerLeave:X})),d("div",{className:"video-transport-panel"},d("div",{className:"video-transport-title"},d("strong",null,e.t("previewFilmControl")),d("span",null,e.t("previewFilmHelp"))),d("div",{className:"transport-row"},d(q,{className:"play-button",onClick:j,title:e.t(m?"videoPause":"videoPlay")},m?"||":"\u25B6"),d(wa,{min:0,max:Math.max(.5,e.duration),step:.05,value:Math.min(e.videoTime,e.duration),onChange:e.onTimeChange}),d("strong",null,e.videoTime.toFixed(2)," / ",e.duration.toFixed(2),"s"),d(q,{variant:"outline",onClick:e.onExportMp4,disabled:e.saving},e.t("exportMp4")),e.exportProgress!==null?d("span",null,Math.round(e.exportProgress*100),"%"):null)),d(mf,{composition:C,activeSceneIndex:M,t:e.t,onSelect:c,onAdd:()=>E(bl(C)),onDuration:S=>E(wl(C,M,S)),onTransition:S=>E(Cl(C,M,S))}),d("div",{className:"media-row"},d("label",{className:"upload-pill"},e.t("uploadVideoBackground"),d("input",{type:"file",accept:"video/*,image/*",onChange:S=>S.target.files?.[0]&&void se(S.target.files[0],"background","background")})),d("label",{className:"upload-pill"},e.t("uploadReference"),d("input",{type:"file",accept:"video/*,image/*,.gif",onChange:S=>S.target.files?.[0]&&void se(S.target.files[0],"reference","reference")}))),d(pf,{layers:T,selectedLayerId:B,duration:e.duration,time:e.videoTime,t:e.t,onSeek:e.onTimeChange})),d("aside",{className:"video-side"},d(Xe,{className:"side-card"},d("h3",null,e.t("layers")),d("div",{className:"layer-add-grid"},ll.map(S=>d(q,{key:S,variant:"outline",className:"chip-button",onClick:()=>Z(S)},"+ ",Cf(S,e.t)))),d("div",{className:"layer-list"},T.map(S=>d("div",{key:S.id||S.text,role:"button",tabIndex:0,className:S.id===B?"layer-row active":"layer-row",onClick:()=>S.id&&W(S.id),onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&S.id&&(_.preventDefault(),W(S.id))}},d("span",null,Cf(S.type,e.t)),d("strong",null,S.text||S.id||e.t("untitled")),d(q,{variant:"destructiveOutline",className:"mini-danger",onClick:_=>{_.stopPropagation(),S.id&&E(gl(C,M,S.id),null)}},e.t("delete")))))),d(Xe,{className:"side-card"},d("h3",null,e.t("properties")),U?d("div",{className:"property-grid"},d("label",null,d("span",null,e.t("text")),d(ze,{value:U.text||"",onChange:S=>R(_=>({..._,text:S.target.value})),disabled:U.type!=="text"})),d("label",null,d("span",null,e.t("color")),d(ze,{type:"color",value:(U.color||U.fill||"#ffffff").slice(0,7),onChange:S=>R(_=>({..._,color:S.target.value,fill:S.target.value}))})),["x","y","w","h","opacity","scale","rotate"].map(S=>d("label",{key:S},d("span",null,S),d(ze,{type:"number",step:S==="opacity"||S==="scale"?.05:1,value:Number(U[S]??(S==="opacity"||S==="scale"?1:0)),onChange:_=>R(fe=>({...fe,[S]:Number(_.target.value)}))}))),d("label",null,d("span",null,e.t("kineticText")),d(ut,{value:typeof U.kinetic?.type=="string"?U.kinetic.type:"none",options:xt(Nl,e.t),onValueChange:S=>R(_=>({..._,kinetic:S==="none"?void 0:{type:S,stagger:.04}}))})),d("label",{className:"upload-pill inline"},e.t("uploadLayerMedia"),d("input",{type:"file",accept:"image/*,video/*",onChange:S=>S.target.files?.[0]&&void se(S.target.files[0],"layer","selected-layer")})),d("div",{className:"accordion-block"},d("strong",null,e.t("keyframes")),["opacity","x","y","scale","rotate","blur"].map(S=>d(q,{key:S,variant:"outline",className:"chip-button",onClick:()=>R(_=>vl(_,S,e.videoTime,Number(_[S]??(S==="opacity"||S==="scale"?1:0))))},e.t("setProperty",{property:S})))),d("div",{className:"accordion-block"},d("strong",null,e.t("motionPath")),d(q,{variant:"outline",className:"chip-button",onClick:()=>R(S=>qn(S,[{x:Number(S.x||0)-160,y:Number(S.y||0)},{x:Number(S.x||0)+160,y:Number(S.y||0)}],"line"))},e.t("line")),d(q,{variant:"outline",className:"chip-button",onClick:()=>R(S=>({...S,path:void 0}))},e.t("clearPath"))),d("div",{className:"accordion-block"},d("strong",null,e.t("motionLabel")),dl.map(S=>d("div",{key:S.group,className:"template-group"},d("span",null,py(S.group,e.t)),d("div",{className:"chip-grid"},S.templates.map(_=>d(q,{key:_,variant:_===f?"default":"outline",className:_===f?"chip-button active":"chip-button",onClick:()=>p(_)},_))))),d(q,{className:"full-width",onClick:()=>R(S=>nr(S,f))},e.t("applySelected"))),d("div",{className:"accordion-block"},d("strong",null,e.t("motionStyles")),d(ze,{value:g,onChange:S=>v(S.target.value),placeholder:e.t("nameMotionPlaceholder")}),d(q,{variant:"outline",onClick:()=>Re("info",g?e.t("styleReady",{name:g}):e.t("nameStyleFirst"))},e.t("saveStyle"))),d("div",{className:"motion-button-row"},d(q,{variant:"outline",onClick:()=>B&&E(Un(C,M,B,-1))},e.t("up")),d(q,{variant:"outline",onClick:()=>B&&E(Un(C,M,B,1))},e.t("down")))):d("p",{className:"muted"},e.t("selectLayerHint"))))))}function Cf(e,t){return t(e==="text"?"text":e==="rect"?"block":e==="ellipse"?"circle":e==="image"?"image":e==="video"?"filterVideo":"layer")}function py(e,t){return e==="Entrance"?t("templateEntrance"):e==="Emphasis"?t("templateEmphasis"):e==="Attention"?t("templateAttention"):e==="Exit"?t("templateExit"):e}function ms(e){return e.name.split(/\s+/).filter(Boolean).map(a=>a[0]).join("").slice(0,2).toUpperCase()||"MO"}function on(e){return[e.id,e.name,e.category,e.cat,e.desc,e.description,...e.surfaces||[],...e.target||[],...e.runtime||[],...e.export||[],...e.tags||[]].filter(t=>typeof t=="string"&&t.length>0).join(" ").toLowerCase()}function If(e,t,a){let o=on(e),r=hy(o),n=o.includes("subtle")||o.includes("restrained")?18:o.includes("bold")||o.includes("spark")?34:t.distance,i=o.includes("typewriter")?960:o.includes("spark")||o.includes("click")?420:o.includes("slow")?900:t.duration,s=typeof a?.componentId=="string"?a.componentId:"";return{...t,selector:s?`[data-ma-id="${zo(s)}"]`:t.selector||"h1",trigger:Pf(o,t.trigger),verb:r,duration:i,distance:n,tracksJson:JSON.stringify(gy(r,n,o),null,2)}}function Rf(e,t){let o=new DOMParser().parseFromString(e,"text/html"),r=t.trim();return r&&Sf(o,r)?r:["[data-ma-id]","h1","h2","h3","button","a","p",'[class*="card"]',"main > *","body > *"].find(i=>Sf(o,i))??r??"body > *"}function Pf(e,t){return e.includes("hover")?"hover":e.includes("click")||e.includes("spark")?"click":e.includes("scroll")||e.includes("reveal")?"scroll":e.includes("load")||e.includes("entrance")||e.includes("intro")?"load":t}function hy(e){return e.includes("slide left")?"slide-left":e.includes("slide right")?"slide-right":e.includes("slide down")?"slide-down":e.includes("slide")||e.includes("rise")||e.includes("falling")?"slide-up":e.includes("zoom")?"zoom":e.includes("rotate")||e.includes("rotating")?"rotate":e.includes("blur")||e.includes("focus")?"blur":e.includes("pop")||e.includes("spark")||e.includes("bounce")?"pop":e.includes("pulse")||e.includes("heartbeat")?"pulse":e.includes("shake")||e.includes("glitch")?"shake":e.includes("wobble")?"wobble":e.includes("sink")?"sink":"fade"}function gy(e,t,a){let o=hs();return e==="fade"&&(o.y=[{t:0,v:0},{t:.5,v:0}],o.scale=[{t:0,v:1},{t:.5,v:1}],o.blur=[{t:0,v:0},{t:.5,v:0}]),e==="slide-down"&&(o.y=[{t:0,v:-t},{t:.55,v:0,ease:"ease-out"}]),e==="slide-left"&&(o.x=[{t:0,v:t},{t:.55,v:0,ease:"ease-out"}],o.y=[{t:0,v:0},{t:.55,v:0}]),e==="slide-right"&&(o.x=[{t:0,v:-t},{t:.55,v:0,ease:"ease-out"}],o.y=[{t:0,v:0},{t:.55,v:0}]),e==="zoom"&&(o.scale=[{t:0,v:.82},{t:.5,v:1,ease:"ease-out"}],o.y=[{t:0,v:0},{t:.5,v:0}]),e==="rotate"&&(o.rotate=[{t:0,v:-8},{t:.55,v:0,ease:"ease-out"}]),e==="blur"&&(o.blur=[{t:0,v:16},{t:.6,v:0,ease:"ease-out"}]),e==="pop"&&(o.scale=[{t:0,v:.82},{t:.24,v:1.08},{t:.46,v:1}],o.blur=[{t:0,v:0},{t:.46,v:0}]),e==="pulse"&&(o.opacity=[{t:0,v:1},{t:.35,v:.82},{t:.7,v:1}],o.scale=[{t:0,v:1},{t:.35,v:1.06},{t:.7,v:1}]),e==="shake"&&(o.x=[{t:0,v:0},{t:.15,v:-t/2},{t:.3,v:t/2},{t:.45,v:0}]),e==="wobble"&&(o.rotate=[{t:0,v:0},{t:.18,v:-5},{t:.38,v:4},{t:.6,v:0}]),e==="sink"&&(o.y=[{t:0,v:-t/2},{t:.55,v:0,ease:"ease-out"}]),a.includes("typewriter")&&(o.opacity=[{t:0,v:0},{t:.08,v:1}]),o}function ps(e){let t=on(e);return t.includes("slide left")?"slide-left":t.includes("slide right")?"slide-right":t.includes("slide down")?"slide-down":t.includes("zoom out")?"zoom-out":t.includes("zoom")?"zoom-in":t.includes("rotate")||t.includes("rotating")?"rotate-in":t.includes("pop")||t.includes("spark")?"pop":t.includes("bounce")?"bounce-in":t.includes("pulse")?"pulse":t.includes("float")?"float":t.includes("wobble")?"wobble":t.includes("shake")||t.includes("glitch")?"shake":t.includes("heartbeat")?"heartbeat":t.includes("fade out")?"fade-out":t.includes("fade")?"fade-in":"slide-up"}function kf(e){let t=on(e);return t.includes("typewriter")?"typewriter":t.includes("char")||t.includes("letter")?t.includes("pop")?"char-pop":"char-rise":t.includes("word")?"word-rise":null}function Tf(e,t,a){let o=(e.surfaces||[]).includes("web")?a("nativeWebRecipe"):a("mappedFromRecipeIntent"),r=typeof t?.label=="string"?t.label:typeof t?.componentId=="string"?t.componentId:a("currentSelector");return`${o}; ${a("appliesToTarget",{target:r})}.`}function Mf(e,t,a){let o=(e.surfaces||[]).includes("video")?a("nativeVideoRecipe"):a("convertedToLayerTemplate"),r=typeof t?.layerId=="string"?t.layerId:a("firstAvailableLayer");return`${o}; ${a("appliesToTarget",{target:r})}.`}function Af(e,t,a,o){let r=er(Pf(on(e),"load"),o),n=typeof t?.label=="string"?t.label:o("htmlSelection"),i=typeof a?.layerId=="string"?o("layerWithId",{id:a.layerId}):o("videoLayer");return o("recipeUsageSummary",{trigger:r,htmlTarget:n,template:ps(e),videoTarget:i})}function Sf(e,t){try{return e.querySelector(t)!==null}catch{return!1}}function hs(){return{opacity:[{t:0,v:0},{t:.5,v:1}],x:[{t:0,v:0},{t:.5,v:0}],y:[{t:0,v:24},{t:.5,v:0,ease:"ease-out"}],scale:[{t:0,v:.96},{t:.5,v:1}],rotate:[{t:0,v:0},{t:.5,v:0}],blur:[{t:0,v:8},{t:.5,v:0}]}}function Df(e){let t=e.selectedRecipe;return d("section",{className:"motion-library"},d("div",{className:"motion-stat-row"},d(Ho,{label:e.t("recipes"),value:e.stats?.recipes}),d(Ho,{label:e.t("htmlTemplates"),value:e.stats?.htmlTemplates}),d(Ho,{label:e.t("videoTemplates"),value:e.stats?.videoTemplates}),d(Ho,{label:e.t("icons"),value:e.stats?.icons})),d("div",{className:"motion-library-layout"},d("div",{className:"motion-card-grid"},e.recipes.map(a=>d("button",{key:a.id,type:"button",className:t?.id===a.id?"motion-card motion-recipe-card active":"motion-card motion-recipe-card",onClick:()=>e.onSelectRecipe(a.id)},d("div",{className:"motion-card-preview","data-kind":a.category||a.cat||"motion"},d("span",null,ms(a))),d("div",null,d("h3",null,a.name),d("p",null,a.desc||a.description||a.id)),d("div",{className:"motion-chip-row"},(a.surfaces||[]).slice(0,2).map(o=>d("span",{key:o,className:"motion-chip"},o)),(a.target||[]).slice(0,1).map(o=>d("span",{key:o,className:"motion-chip"},o)),d("span",{className:"motion-chip"},a.status||e.t("ready"))))),e.recipes.length===0?d("div",{className:"motion-empty"},e.t("noRecipes")):null),d(Xe,{className:"motion-recipe-detail"},t?d(Ye,null,d("div",{className:"recipe-detail-head"},d("div",null,d("span",{className:"section-eyebrow"},e.t("selectedRecipe")),d("h2",null,t.name),d("p",null,t.desc||t.description||t.id)),d("div",{className:"motion-recipe-preview","data-kind":t.category||t.cat||"motion"},ms(t))),d("div",{className:"motion-chip-row"},d("span",{className:"motion-chip"},t.category||t.cat||"motion"),(t.surfaces||[]).map(a=>d("span",{key:a,className:"motion-chip"},a)),(t.runtime||[]).slice(0,2).map(a=>d("span",{key:a,className:"motion-chip"},a))),d("div",{className:"recipe-fit-grid"},d("div",null,d("strong",null,e.t("htmlFit")),d("span",null,Tf(t,e.componentSelection,e.t))),d("div",null,d("strong",null,e.t("videoFit")),d("span",null,Mf(t,e.layerSelection,e.t)))),d("div",{className:"recipe-action-grid"},d(q,{onClick:()=>e.onApplyHtml(t)},e.t("applyToHtml")),d(q,{variant:"secondary",onClick:()=>e.onApplyVideo(t)},e.t("applyToVideo"))),d("div",{className:"recipe-usage-note"},d("strong",null,e.selectedProject?.title||e.t("referencedDraft")),d("span",null,Af(t,e.componentSelection,e.layerSelection,e.t)))):d("div",{className:"motion-empty"},e.t("recipeSelectEmpty")))))}Rs({styleId:"motion-workbench-shadcn-ui-vars"});var vs={items:[],total:0,page:1,pageSize:20};function xy(){let[e,t]=k(null),[a,o]=k(()=>Hf()),[r,n]=k("html"),[i,s]=k(null),[l,u]=k(!1),[c,f]=k(!1),[p,g]=k(!1),[v,m]=k(""),[h,y]=k(()=>({surface:"all",target:"all",status:"ready"})),[b,w]=k(null),[C,P]=k([]),[M,T]=k(!1),[B,U]=k(!1),[Y,j]=k(!1),[E,W]=k(""),[Z,R]=k("Motion Launch"),[H,K]=k("Polished motion direction for a product moment."),[O,X]=k(Sy("Motion Launch")),[se,S]=k(()=>JSON.stringify(Ff("Motion Launch"),null,2)),[_,fe]=k(.85),[Pe,ve]=k(null),[ke,J]=k(null),[le,Te]=k(null),[xe,be]=k(()=>({selector:"h1",trigger:"load",verb:"slide-up",duration:520,delay:0,distance:24,tracksJson:JSON.stringify(hs(),null,2)})),Se=D(null),Je=D(!1),He=D(null),Sa=D(null),re=he(()=>el(e?.locale),[e?.locale]);F(()=>{Je.current=Y},[Y]),F(()=>{He.current=i},[i]);let Ft=a.detail,oe=Ft?.item??a.projects.items.find(A=>A.id===i)??null,ys=Q(A=>{if(!A)return;let V=A.workingCopy?.html,ye=A.workingCopy?.videoComposition;typeof V=="string"&&V.trim()&&X(V),ye&&typeof ye=="object"&&S(JSON.stringify(ye,null,2)),J(A.workingCopy?.componentSelection??null),Te(A.workingCopy?.layerSelection??null),P([]),j(!1)},[]),_e=Q(async A=>{T(!0);try{let V=A?.projectId??He.current??e?.initialQuery?.selectionId,ye=r==="library"?"recipes":void 0,Ie=Of({table:ye,projectId:typeof V=="string"?V:void 0,surface:ye==="recipes"&&h.surface!=="all"?h.surface:void 0,target:ye==="recipes"&&h.target!=="all"?h.target:void 0,status:ye==="recipes"&&h.status!=="all"?h.status:void 0}),Ve=Gn(await Pl(Of({page:1,pageSize:ye==="recipes"?36:20,search:r==="library"?v:void 0,parameters:Ie}))),St=yy(Ve);o(St);let Nt=St.detail;Nt?.item?.id&&(s(Nt.item.id),(!Je.current||A?.forceDraftSync)&&ys(Nt)),W(re("statusReady"))}catch(V){let ye=la(V);W(ye),Re("error",ye)}finally{T(!1),setTimeout(go,0)}},[r,e?.initialQuery?.selectionId,h,v,ys,re]);F(()=>{Sa.current=_e},[_e]),F(()=>{kl({requestTimeout:e?.locale?.startsWith("zh")?"\u8BF7\u6C42\u8D85\u65F6":"Request timed out",remoteRequestFailed:e?.locale?.startsWith("zh")?"\u8FDC\u7A0B\u8BF7\u6C42\u5931\u8D25":"Remote request failed"})},[e?.locale]),F(()=>{Tl(t,()=>{if(Je.current){W(re("dirtyWarning")),Re("warning",re("dirtyWarning"));return}Sa.current?.({projectId:He.current,forceDraftSync:!0})}),xo("ready")},[re]),F(()=>{e&&_e({forceDraftSync:!0})},[e,_e]),F(()=>{setTimeout(go,0)},[r,a,Y,E]),F(()=>{if(r!=="library")return;let A=a.recipes.items;if(A.length===0){w(null);return}A.some(V=>V.id===b)||w(A[0].id)},[r,b,a.recipes.items]),F(()=>{let A=Se.current;if(!A)return;let V=A.getContext("2d");if(V)try{let ye=La(se),Ie=or(ye),Ve=Math.min(1,960/Ie.w);A.width=Math.max(1,Math.round(Ie.w*Ve)),A.height=Math.max(1,Math.round(Ie.h*Ve)),V.save(),V.scale(Ve,Ve),Ie.renderFrame(V,Math.min(_,Ie.duration()));let St=typeof le?.layerId=="string"?le.layerId:"";if(St){let Nt=po(ye,St);if(Nt){let It=jn(Nt);V.save(),V.strokeStyle="#8b5cf6",V.lineWidth=4/Ve,V.setLineDash([10/Ve,7/Ve]),V.strokeRect(It.x-It.w/2,It.y-It.h/2,It.w,It.h),V.restore()}}V.restore()}catch{A.width=960,A.height=540,V.fillStyle="#111827",V.fillRect(0,0,A.width,A.height),V.fillStyle="#f8fafc",V.font="600 22px Inter, ui-sans-serif, system-ui, sans-serif",V.fillText(re("invalidCompositionJson"),32,56)}},[r,le,re,se,_]);async function rn(A){U(!0);try{let V=await Vt("create_project",null,{title:Z,brief:H,surface:A,html:A==="web"?O:void 0,videoComposition:A==="video"?La(se):void 0,changeSummary:"Created in Motion Workbench"}),ye=zf(V),Ie=wy(ye);Ie&&s(Ie),n(A==="video"?"video":"html"),j(!1),u(!1),await _e({projectId:Ie,forceDraftSync:!0}),Re("success",re("projectCreated",{title:Z}))}catch(V){rt(V)}finally{U(!1)}}async function _f(){if(!oe?.id){await rn("web");return}U(!0);try{await Vt("save_web_artifact",oe.id,{projectId:oe.id,html:O,selectedRecipeIds:gs([...oe.selectedRecipeIds||[],...C]),componentSelection:ke??void 0,changeSummary:"Saved from Motion HTML Workbench"},{projectId:oe.id}),j(!1),await _e({projectId:oe.id,forceDraftSync:!0}),Re("success",re("htmlSaved"))}catch(A){rt(A)}finally{U(!1)}}async function Vf(){if(!oe?.id){await rn("video");return}U(!0);try{await Vt("save_video_composition",oe.id,{projectId:oe.id,composition:La(se),selectedRecipeIds:gs([...oe.selectedRecipeIds||[],...C]),layerSelection:le??void 0,changeSummary:"Saved from Motion Video Composer"},{projectId:oe.id}),j(!1),await _e({projectId:oe.id,forceDraftSync:!0}),Re("success",re("videoSaved"))}catch(A){rt(A)}finally{U(!1)}}async function Uf(){if(oe?.id){U(!0);try{await Vt("finalize_version",oe.id,{projectId:oe.id,changeSummary:`Workbench version ${new Date().toLocaleString()}`},{projectId:oe.id}),await _e({projectId:oe.id,forceDraftSync:!0}),Re("success",re("versionSaved"))}catch(A){rt(A)}finally{U(!1)}}}async function qf(A){if(oe?.id){U(!0);try{await Vt("export_artifact",oe.id,{projectId:oe.id,kind:A,content:A==="html"?O:void 0,fileName:`${Nf(oe.title)}.${Iy(A)}`,changeSummary:`Exported ${A} from Motion Workbench`},{projectId:oe.id}),await _e({projectId:oe.id}),Re("success",re("artifactExported",{kind:A.toUpperCase()}))}catch(V){rt(V)}finally{U(!1)}}}async function jf(){if(oe?.id){if(!On()){Re("error",re("webCodecsUnavailable"));return}U(!0),ve(0);try{let A=La(se),V=or(A);await V.preload();let ye=await Zs(V,{fps:V.fps,bitrate:5e6,scale:1},Ve=>ve(Ve)),Ie=new File([ye],`${Nf(oe.title)}.mp4`,{type:"video/mp4"});await sr("save_export_file",oe.id,{projectId:oe.id,kind:"mp4",changeSummary:"Browser MP4 export from Motion Workbench"},{projectId:oe.id},Ie),await _e({projectId:oe.id}),Re("success",re("mp4Exported"))}catch(A){rt(A)}finally{U(!1),ve(null)}}}async function Wf(A){if(oe?.id){U(!0);try{await Vt("restore_version",oe.id,{projectId:oe.id,versionId:A,changeSummary:"Restored in Motion Workbench"},{projectId:oe.id}),j(!1),await _e({projectId:oe.id,forceDraftSync:!0}),Re("success",re("versionRestored"))}catch(V){rt(V)}finally{U(!1)}}}async function nn(A){if(oe?.id){U(!0);try{await Vt(A==="reviewed"?"mark_reviewed":A==="archived"?"archive_project":"mark_draft",oe.id,{projectId:oe.id},{projectId:oe.id}),await _e({projectId:oe.id}),Re("success",re("projectStatusUpdated",{status:A}))}catch(V){rt(V)}finally{U(!1)}}}function bs(A){w(A.id),P(V=>gs([...V,A.id]))}function Gf(A){try{let V=If(A,xe,ke),ye=typeof ke?.componentId=="string"?ke.componentId:"",Ie=ye?V:{...V,selector:Rf(O,V.selector)},Ve=ye?an(O,ye,Ie):Bf(O,Ie);be(Ie),J(ye?{...ke||{},componentId:ye,selectedRecipeId:A.id,selectedRecipeName:A.name}:{selectedRecipeId:A.id,selectedRecipeName:A.name,label:Ie.selector}),sn(Ve),bs(A),n("html"),W(re("recipeAppliedToHtml",{name:A.name})),Re("success",re("recipeApplied",{name:A.name}))}catch(V){rt(V)}}function Kf(A){try{let V=La(se),ye=typeof le?.layerId=="string"?le.layerId:"",Ie=typeof le?.sceneIndex=="number"?le.sceneIndex:-1,Ve=[...V.shared||[],...Fa(V,Ie)],St=ye?po(V,ye,Ie):Ve[0]??null;if(!St?.id)throw new Error(re("selectLayerFirst"));let Nt=ps(A),It=kf(A),Zf=ia(V,Ie,St.id,Cs=>{let Ls=nr(Cs,Nt);return It&&Cs.type==="text"?{...Ls,kinetic:{type:It,stagger:.04}}:Ls});ws(JSON.stringify(Zf,null,2)),Te({layerId:St.id,sceneIndex:Ie,selectedRecipeId:A.id,selectedRecipeName:A.name}),bs(A),n("video"),W(re("recipeAppliedToVideo",{name:A.name})),Re("success",re("recipeApplied",{name:A.name}))}catch(V){rt(V)}}function rt(A){let V=la(A);W(V),Re("error",V)}function sn(A){X(A),j(!0)}function ws(A){S(A),j(!0)}function $f(){try{sn(Bf(O,xe)),W(re("motionApplied"))}catch(A){rt(A)}}let Xf=he(()=>{try{return or(La(se)).duration()}catch{return 5}},[se]),ln=r==="html"||r==="video",Jf=r==="library",Yf=a.recipes.items.find(A=>A.id===b)??a.recipes.items[0]??null,dn={title:oe?.title||"Motion Workbench",dirty:Y,statusLabel:oe?.status||"draft",activeTab:r,onTabChange:n,onOpenProjects:()=>u(!0),onOpenVersions:()=>f(!0),onOpenExports:()=>g(!0)};return d("main",{className:ln?"motion-shell motion-shell-editor":"motion-shell"},d(df,{open:l,projects:a.projects.items,selectedProjectId:i,title:Z,brief:H,saving:B,t:re,onOpenChange:u,onTitleChange:R,onBriefChange:K,onCreate:rn,onSelect:A=>{_e({projectId:A,forceDraftSync:!0})}}),d(uf,{open:c,versions:Ft?.versions||[],currentId:Ft?.currentVersion?.id,saving:B,t:re,onOpenChange:f,onCreateVersion:Uf,onRestore:Wf}),d(cf,{open:p,exports:Ft?.exports||[],selectedProject:oe,t:re,onOpenChange:g,onReviewed:()=>{nn("reviewed")},onDraft:()=>{nn("draft")},onArchive:()=>{nn("archived")}}),ln?null:d(zc,{header:dn,t:re}),Jf&&!ln?d("section",{className:"motion-status-row"},d(ze,{value:v,onChange:A=>m(A.target.value),onKeyDown:A=>{A.key==="Enter"&&_e()},placeholder:re("search")}),d(q,{onClick:()=>{_e()},disabled:M},re("search")),d("span",null,M?re("loading"):E)):null,r==="library"?d("section",{className:"motion-library-command"},d("div",null,d("strong",null,re("library")),d("span",null,re("libraryHelp"))),d("div",{className:"motion-filter-row"},d(ut,{className:"library-filter-select",value:h.surface,options:xt(Ol,re),onValueChange:A=>y(V=>({...V,surface:A}))}),d(ut,{className:"library-filter-select",value:h.target,options:xt(Bl,re),onValueChange:A=>y(V=>({...V,target:A}))}),d(ut,{className:"library-filter-select",value:h.status,options:xt(Fl,re),onValueChange:A=>y(V=>({...V,status:A}))}))):null,r==="library"?d(Df,{recipes:a.recipes.items,stats:a.libraryStats,selectedRecipe:Yf,selectedProject:oe,componentSelection:ke,layerSelection:le,t:re,onSelectRecipe:w,onApplyHtml:Gf,onApplyVideo:Kf}):null,r==="html"?d(wf,{controls:xe,htmlDraft:O,componentSelection:ke,saving:B,selectedProject:oe,header:dn,t:re,onControlsChange:be,onApply:$f,onDraftChange:sn,onComponentSelectionChange:J,onSave:()=>{_f()},onExport:qf}):null,r==="video"?d(Lf,{canvasRef:Se,videoDraft:se,videoTime:_,selectedProject:oe,layerSelection:le,header:dn,t:re,duration:Xf,saving:B,exportProgress:Pe,parseVideoComposition:La,defaultComposition:Ff,extractMediaPayload:vy,onDraftChange:ws,onTimeChange:fe,onLayerSelectionChange:Te,onSave:()=>{Vf()},onExportMp4:()=>{jf()}}):null)}function gs(e){return Array.from(new Set(e.filter(t=>typeof t=="string"&&t.trim()).map(t=>t.trim())))}function vy(e){let t=zf(e);if(!Ee(t)||!Ee(t.media))return null;let a=t.media;return{src:typeof a.src=="string"?a.src:typeof a.fileUrl=="string"?a.fileUrl:typeof a.workspacePath=="string"?a.workspacePath:typeof a.filePath=="string"?a.filePath:"",filePath:typeof a.filePath=="string"?a.filePath:void 0,fileUrl:typeof a.fileUrl=="string"?a.fileUrl:void 0,mimeType:typeof a.mimeType=="string"?a.mimeType:void 0}}function Hf(){return{projects:vs,recipes:vs,styles:[],detail:null,libraryStats:{}}}function yy(e){return Ee(e)?{projects:Ef(e.projects),recipes:Ef(e.recipes),styles:Array.isArray(e.styles)?e.styles:[],detail:by(e.detail),libraryStats:Ee(e.libraryStats)?e.libraryStats:{}}:Hf()}function Ef(e){return Ee(e)?{items:Array.isArray(e.items)?e.items:[],total:typeof e.total=="number"?e.total:0,page:typeof e.page=="number"?e.page:1,pageSize:typeof e.pageSize=="number"?e.pageSize:20}:{...vs,items:[]}}function by(e){return!Ee(e)||!Ee(e.item)||typeof e.item.id!="string"?null:e}function zf(e){let t=Gn(e);return Ee(t)&&t.data!==void 0?t.data:t}function wy(e){return Ee(e)&&Ee(e.item)&&typeof e.item.id=="string"?e.item.id:Ee(e)&&Ee(e.project)&&typeof e.project.id=="string"?e.project.id:null}function Of(e){let t={};for(let[a,o]of Object.entries(e))o!=null&&o!==""&&(t[a]=o);return t}function La(e){let t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Composition must be a JSON object.");return t}function Bf(e,t){let o=new DOMParser().parseFromString(e,"text/html"),r=t.selector.trim()||"body > *",n;try{n=Array.from(o.querySelectorAll(r))}catch{throw new Error("Selector is invalid.")}if(n.length===0)throw new Error("Selector matched no elements.");let i=Cy(t.tracksJson);for(let s of n.slice(0,50))s.setAttribute("data-ma-anim",t.verb),s.setAttribute("data-ma-trigger",t.trigger),s.setAttribute("data-ma-dur",String(xs(t.duration,80,4e3))),s.setAttribute("data-ma-delay",String(xs(t.delay,0,8e3))),s.setAttribute("data-ma-dist",String(xs(t.distance,-400,400))),s.setAttribute("data-ma-tracks",JSON.stringify(i));return`<!doctype html>
|
|
1022
|
-
${o.documentElement.outerHTML}`}function
|
|
114
|
+
`,t.parentElement||e.head?.appendChild(t);let a=wp(e);return a.components.forEach(({element:o})=>{o.classList.add("ma-editable")}),a}function im(e,t){Array.from(e.querySelectorAll(".ma-editable")).forEach(o=>{o.addEventListener("mouseenter",()=>o.classList.add("ma-hover")),o.addEventListener("mouseleave",()=>o.classList.remove("ma-hover")),o.addEventListener("click",r=>{r.preventDefault(),r.stopPropagation(),t(o)})})}function Gs(e,t){if(Array.from(e.querySelectorAll(".ma-selected")).forEach(o=>o.classList.remove("ma-selected")),!t)return;e.querySelector(`[data-ma-id="${xr(t)}"]`)?.classList.add("ma-selected")}function sm(e,t,a){let o=Array.from(e.querySelectorAll("[data-ma-anim],[data-ma-kf]")),r=a?.selectedId?e.querySelector(`[data-ma-id="${xr(a.selectedId)}"]`):null,n=o.length>0?r&&!o.includes(r)?[r]:[]:r?[r]:Array.from(e.querySelectorAll(".ma-editable")).slice(0,6),i=[...o,...n];for(let s of i){let l=jy(s,a?.controls),d=Gt((t-l.delay)/l.duration,0,1),u=qy(l.tracks)?Wy(l.tracks,d):Gy(l.verb,d,l.distance);Ky(s,u)}}function Nn(e,t,a){let r=new DOMParser().parseFromString(e,"text/html"),n=r.querySelector(`[data-ma-id="${xr(t)}"]`);if(!n)throw new Error("Selected element was not found in the HTML draft.");let i=Ha(Ro(a.tracksJson)??_a()),s=gp(t);n.setAttribute("data-ma-id",t),n.setAttribute("data-ma-anim",a.verb),n.setAttribute("data-ma-kf",s),n.setAttribute("data-ma-trigger",a.trigger),n.setAttribute("data-ma-dur",String(Gt(a.duration,80,4e3))),n.setAttribute("data-ma-delay",String(Gt(a.delay,0,8e3))),n.setAttribute("data-ma-dist",String(Gt(a.distance,-400,400))),n.setAttribute("data-ma-tracks",JSON.stringify(i));let l=Ks(r);return hp(l,s,i)}function Ks(e){return`<!doctype html>
|
|
115
|
+
${e.documentElement.outerHTML}`}function lm(e){return _s({tagName:e.tagName,text:e.textContent,className:e.getAttribute("class"),alt:e.getAttribute("alt")})}function Ro(e){try{let t=JSON.parse(e);return t&&typeof t=="object"&&!Array.isArray(t)?t:null}catch{return null}}function $s(e,t){return e&&e.length>0?Number(e[e.length-1].v??0):t==="opacity"||t==="scale"?1:0}function dm(e,t){return e==="opacity"||e==="scale"?t.toFixed(2):e==="rotate"?`${Math.round(t)}\xB0`:`${Math.round(t)}px`}function xr(e){return e.replace(/["\\]/g,"\\$&")}function Gt(e,t,a){return Number.isFinite(e)?Math.min(a,Math.max(t,e)):t}function qy(e){return Object.values(e).some(t=>Array.isArray(t)&&t.length>0)}function jy(e,t){let a=t?Ro(t.tracksJson):null,o=Ro(e.getAttribute("data-ma-tracks")||"");return{verb:e.getAttribute("data-ma-anim")||t?.verb||"fade",duration:Gt(Number(e.getAttribute("data-ma-dur")||t?.duration||520),80,4e3),delay:Gt(Number(e.getAttribute("data-ma-delay")||t?.delay||0),0,8e3),distance:Gt(Number(e.getAttribute("data-ma-dist")||t?.distance||24),-400,400),tracks:Ha(o??a??_a())}}function Wy(e,t){return{opacity:Io(e.opacity,t,void 0),x:Io(e.x,t,0)??0,y:Io(e.y,t,0)??0,scale:Io(e.scale,t,1)??1,rotate:Io(e.rotate,t,0)??0,blur:Io(e.blur,t,0)??0}}function Gy(e,t,a){let o=Gt(t,0,1),r=1-o;switch(e){case"slide-up":return{opacity:o,x:0,y:a*r,scale:1,rotate:0,blur:0};case"slide-down":return{opacity:o,x:0,y:-a*r,scale:1,rotate:0,blur:0};case"slide-left":return{opacity:o,x:-a*r,y:0,scale:1,rotate:0,blur:0};case"slide-right":return{opacity:o,x:a*r,y:0,scale:1,rotate:0,blur:0};case"zoom":return{opacity:o,x:0,y:0,scale:.9+.1*o,rotate:0,blur:0};case"rotate":return{opacity:o,x:0,y:0,scale:.96+.04*o,rotate:-8*r,blur:0};case"blur":return{opacity:o,x:0,y:0,scale:1,rotate:0,blur:10*r};case"pop":{let n=o<.45?o/.45:1-(o-.45)/.55;return{opacity:1,x:0,y:-Math.max(0,n)*Math.min(Math.abs(a),24),scale:1+Math.max(0,n)*.06,rotate:0,blur:0}}case"pulse":return{opacity:1,x:0,y:0,scale:1+Math.sin(Math.PI*o)*.08,rotate:0,blur:0};case"shake":return{opacity:1,x:Math.sin(Math.PI*o*8)*6*r,y:0,scale:1,rotate:0,blur:0};case"wobble":return{opacity:1,x:0,y:0,scale:1,rotate:Math.sin(Math.PI*o*6)*4*r,blur:0};case"sink":return{opacity:1,x:0,y:0,scale:1-Math.sin(Math.PI*o)*.06,rotate:0,blur:0};default:return{opacity:o,x:0,y:0,scale:1,rotate:0,blur:0}}}function Ky(e,t){e.style.animation="none",e.style.animationPlayState="paused",t.opacity!==void 0&&(e.style.opacity=String(ko(t.opacity))),e.style.transform=`translate(${ko(t.x)}px, ${ko(t.y)}px) scale(${ko(t.scale)}) rotate(${ko(t.rotate)}deg)`,e.style.filter=t.blur>0?`blur(${ko(t.blur)}px)`:"blur(0)",e.style.willChange="opacity, transform, filter"}function Io(e,t,a){if(!e||e.length===0)return a;let o=e.map(r=>({t:Number(r.t??0),v:Number(r.v??a??0)})).sort((r,n)=>r.t-n.t);if(t<=o[0].t)return o[0].v;for(let r=1;r<o.length;r+=1){let n=o[r-1],i=o[r];if(t<=i.t){let s=Math.max(.001,i.t-n.t),l=Gt((t-n.t)/s,0,1);return n.v+(i.v-n.v)*l}}return o[o.length-1].v}function ko(e){return Math.round(e*1e3)/1e3}function um(e){let t=z(null),[a,o]=M("preview"),[r,n]=M("desktop"),[i,s]=M(1),[l,d]=M("keyframes"),[u,c]=M(()=>typeof e.componentSelection?.componentId=="string"?e.componentSelection.componentId:""),[m,h]=M(0),[x,p]=M(0),[g,v]=M([]),w=me(()=>bp(e.htmlDraft),[e.htmlDraft]),b=me(()=>{if(w.length>0)return w;let k=u||(typeof e.componentSelection?.componentId=="string"?e.componentSelection.componentId:"");return k?[{id:k,label:typeof e.componentSelection?.label=="string"?e.componentSelection.label:e.t("selectElement"),verb:e.controls.verb,trigger:e.controls.trigger,delay:Number(e.controls.delay||0),duration:Number(e.controls.duration||520)}]:[]},[w,e.componentSelection,e.controls,e.t,u]),C=me(()=>yp(b),[b]),S=b.find(k=>k.id===u)??b[0]??null,R=me(()=>Ha(Ro(e.controls.tracksJson)??_a()),[e.controls.tracksJson]),T=C.duration,I=me(()=>{try{return mp(e.htmlDraft)}catch{return e.htmlDraft}},[e.htmlDraft]);H(()=>{!u&&S?.id&&(c(S.id),e.onComponentSelectionChange({componentId:S.id,label:S.label}))},[e,u,S]);function F(){let A=t.current?.contentDocument;if(!A)return;let j=nm(A);if(j.changed&&e.onDraftChange(Ks(A)),!u&&j.components[0]){let B=j.components[0];c(B.id),e.onComponentSelectionChange({componentId:B.id,label:B.label}),e.onControlsChange({...e.controls,selector:`[data-ma-id="${B.id}"]`})}im(A,B=>{let te=B.getAttribute("data-ma-id")||"";te&&(c(te),e.onComponentSelectionChange({componentId:te,label:lm(B)}),e.onControlsChange({...e.controls,selector:`[data-ma-id="${te}"]`,verb:B.getAttribute("data-ma-anim")||e.controls.verb,trigger:B.getAttribute("data-ma-trigger")||e.controls.trigger,duration:Number(B.getAttribute("data-ma-dur")||e.controls.duration),delay:Number(B.getAttribute("data-ma-delay")||e.controls.delay),distance:Number(B.getAttribute("data-ma-dist")||e.controls.distance),tracksJson:B.getAttribute("data-ma-tracks")||e.controls.tracksJson}))}),Gs(A,u)}H(()=>{let k=t.current?.contentDocument;k&&Gs(k,u)},[u]);function X(){h(0),o("preview"),p(k=>k+1)}function D(k){h(k),t.current?.contentWindow?.__maTimeline?.seek?.(k);let j=t.current?.contentDocument;j&&sm(j,k,{selectedId:u,controls:e.controls})}function O(k,A){let j=Ha(Ro(e.controls.tracksJson)??_a()),B=j[k]&&j[k].length>=2?[...j[k]]:[{t:0,v:k==="opacity"?0:k==="scale"?.96:0},{t:.5,v:k==="opacity"||k==="scale"?1:0}];B[B.length-1]={...B[B.length-1],v:A},e.onControlsChange({...e.controls,tracksJson:JSON.stringify({...j,[k]:B},null,2)})}function U(k=e.controls){if(!u){Me("warning",e.t("selectElementFirst"));return}try{v(j=>[...j.slice(-9),e.htmlDraft]);let A=Nn(e.htmlDraft,u,k);e.onDraftChange(A),e.onComponentSelectionChange({componentId:u,label:S?.label??u,trigger:k.trigger,verb:k.verb})}catch(A){Me("error",qa(A))}}function q(){let k=g[g.length-1];k&&(v(A=>A.slice(0,-1)),e.onDraftChange(k))}return f("section",{className:"motion-workbench-surface html-surface"},f(On,{header:e.header,t:e.t,viewMode:a,device:r,zoom:i,canUndo:g.length>0,onViewModeChange:o,onDeviceChange:n,onZoomChange:s,onReplay:X,onUndo:q,onSave:e.onSave,onExport:k=>e.onExport(k),saving:e.saving,exportKinds:["html","css","json","react","lottie"]}),a==="code"?f(it,{className:"motion-panel motion-code-panel"},f(Aa,{className:"motion-code",value:e.htmlDraft,onChange:k=>e.onDraftChange(k.target.value),spellCheck:!1})):f("div",{className:"html-stage-layout"},f("div",{className:`html-device-frame ${r}`,style:{transform:`scale(${i})`}},f("iframe",{key:`${r}-${x}`,ref:t,title:e.t("html"),sandbox:"allow-scripts allow-same-origin",srcDoc:I,onLoad:F})),f(it,{className:"motion-inspector"},f("div",{className:"inspector-title"},f("div",null,f("span",{className:"selection-dot"}),f("strong",null,S?.label||e.t("selectElement")))),f("div",{className:"segmented"},f(Z,{variant:l==="preset"?"default":"outline",className:l==="preset"?"active":"",onClick:()=>d("preset")},e.t("preset")),f(Z,{variant:l==="keyframes"?"default":"outline",className:l==="keyframes"?"active":"",onClick:()=>d("keyframes")},e.t("keyframes"))),f("section",{className:"inspector-section"},f("span",{className:"section-eyebrow"},e.t("trigger")),f("div",{className:"chip-grid four"},_p.map(k=>f(Z,{key:k,variant:k===e.controls.trigger?"default":"outline",className:k===e.controls.trigger?"chip-button active":"chip-button",onClick:()=>{let A={...e.controls,trigger:k};e.onControlsChange(A),U(A)}},kn(k,e.t))))),l==="preset"?f("section",{className:"inspector-section"},f("span",{className:"section-eyebrow"},e.t("motionLabel")),f("div",{className:"chip-grid"},Vp.map(k=>f(Z,{key:k,variant:k===e.controls.verb?"default":"outline",className:k===e.controls.verb?"chip-button active":"chip-button",onClick:()=>{let A={...e.controls,verb:k};e.onControlsChange(A),U(A)}},k)))):f("section",{className:"inspector-section"},f("span",{className:"section-eyebrow"},e.t("keyframes")),f("label",{className:"range-row"},f("span",null,e.t("scrub")),f(ja,{min:0,max:T,step:20,value:m,onChange:D}),f("em",null,Math.round(m),"ms")),En.map(k=>f("label",{key:k,className:"range-row"},f("span",null,k),f(ja,{min:k==="opacity"?0:k==="scale"?.2:k==="rotate"?-180:-160,max:k==="opacity"?1:k==="scale"?2:k==="rotate"?180:160,step:k==="opacity"||k==="scale"?.01:1,value:$s(R[k],k),onChange:A=>O(k,A)}),f("em",null,dm(k,$s(R[k],k))))),f(Aa,{className:"motion-code-small",value:e.controls.tracksJson,onChange:k=>e.onControlsChange({...e.controls,tracksJson:k.target.value})})),f("section",{className:"inspector-section compact-form"},f("div",{className:"motion-form-grid"},f("label",null,f("span",null,e.t("duration")),f(Ye,{type:"number",value:e.controls.duration,onChange:k=>e.onControlsChange({...e.controls,duration:Number(k.target.value)})})),f("label",null,f("span",null,e.t("delay")),f(Ye,{type:"number",value:e.controls.delay,onChange:k=>e.onControlsChange({...e.controls,delay:Number(k.target.value)})})),f("label",null,f("span",null,e.t("distance")),f(Ye,{type:"number",value:e.controls.distance,onChange:k=>e.onControlsChange({...e.controls,distance:Number(k.target.value)})}))),f(Z,{className:"full-width",onClick:()=>U(),disabled:!u},e.t("applyMotion"))))),f(tm,{layout:C,selectedId:u,scope:w.length>0?"all":"selection",time:m,t:e.t,onSelect:k=>c(k),onSeek:D}))}function fm(e){let[t,a]=M("preview"),[o,r]=M("desktop"),[n,i]=M(1),[s,l]=M("select"),[d,u]=M(0),[c,m]=M("slide-up"),[h,x]=M(""),[p,g]=M(!1),v=z(null),w=z([]),b=z({time:e.videoTime,duration:e.duration,onTimeChange:e.onTimeChange}),C=me(()=>{try{return e.parseVideoComposition(e.videoDraft)}catch{return e.defaultComposition(e.t("invalidCompositionJson"))}},[e]),S=rt(C),R=S.length>0?Math.min(d,S.length-1):-1,T=[...C.shared||[],...So(C,R)],I=typeof e.layerSelection?.layerId=="string"?e.layerSelection.layerId:T[0]?.id||"",F=I?pr(C,I,R):null;H(()=>{b.current={time:e.videoTime,duration:e.duration,onTimeChange:e.onTimeChange}},[e.duration,e.onTimeChange,e.videoTime]),H(()=>{if(!p)return;let P=0,_=performance.now(),Y=be=>{let ie=b.current,ne=Math.min(.08,Math.max(0,(be-_)/1e3));_=be;let J=Math.min(ie.duration,ie.time+ne);if(ie.onTimeChange(J),J>=ie.duration-.01){g(!1);return}P=requestAnimationFrame(Y)};return P=requestAnimationFrame(Y),()=>cancelAnimationFrame(P)},[p]),H(()=>{!I&&T[0]?.id&&e.onLayerSelectionChange({layerId:T[0].id,sceneIndex:R})},[R,T,e,I]);function X(){e.onTimeChange(0),g(!0)}function D(){if(p){g(!1);return}e.videoTime>=e.duration-.05&&e.onTimeChange(0),g(!0)}function O(P,_){e.onDraftChange(JSON.stringify(P,null,2)),_!==void 0&&e.onLayerSelectionChange(_)}function U(P){e.onLayerSelectionChange(P?{layerId:P,sceneIndex:R}:null)}function q(P){let _=Sp(P,C,T.length+1);O(Lp(C,R,_),{layerId:_.id||"",sceneIndex:R})}function k(P){I&&O(Va(C,R,I,_=>P(_)??_))}function A(P){let Y=e.canvasRef.current?.getBoundingClientRect(),be=C.w||1280,ie=C.h||720;return Y?{x:(P.clientX-Y.left)/Y.width*be,y:(P.clientY-Y.top)/Y.height*ie}:{x:0,y:0}}function j(P){let _=A(P);if(s==="path"){w.current=[_];return}let Y=Pp(T,_.x,_.y);Y?.id?(U(Y.id),v.current={id:Y.id,x:_.x,y:_.y}):U(null)}function B(P){let _=A(P);if(s==="path"&&w.current.length>0){w.current.push(_);return}let Y=v.current;if(!Y)return;let be=_.x-Y.x,ie=_.y-Y.y;v.current={...Y,x:_.x,y:_.y},O(Va(C,R,Y.id,ne=>kp(ne,be,ie,e.videoTime)))}function te(){let P=w.current;s==="path"&&I&&P.length>1&&O(Va(C,R,I,_=>Us(_,P,"raw"))),w.current=[],v.current=null}async function E(P,_,Y){if(!e.selectedProject?.id){Me("warning",e.t("createOrSaveBeforeUpload"));return}try{let be=await zn("upload_media_file",e.selectedProject.id,{projectId:e.selectedProject.id,purpose:_},{projectId:e.selectedProject.id},P),ie=e.extractMediaPayload(be);if(!ie?.src)throw new Error(e.t("mediaUploadNoSource"));Y==="background"?O({...C,bg:ie.src}):Y==="reference"?O({...C,reference:{src:ie.src,filePath:ie.filePath||null,mimeType:ie.mimeType||P.type}}):I&&O(Va(C,R,I,ne=>({...ne,src:ie.src,filePath:ie.filePath,fileUrl:ie.fileUrl}))),Me("success",e.t("mediaUploaded"))}catch(be){Me("error",qa(be))}}return f("section",{className:"motion-workbench-surface video-surface"},f(On,{header:e.header,t:e.t,viewMode:t,device:o,zoom:n,canUndo:!1,onViewModeChange:a,onDeviceChange:r,onZoomChange:i,onReplay:X,onUndo:()=>{},onSave:e.onSave,onExport:()=>e.onExportMp4(),saving:e.saving,exportKinds:["mp4"]}),t==="code"?f(it,{className:"motion-panel motion-code-panel"},f(Aa,{className:"motion-code motion-video-code",value:e.videoDraft,onChange:P=>e.onDraftChange(P.target.value),spellCheck:!1})):f("div",{className:"video-stage-layout"},f(it,{className:"video-main"},f("div",{className:"tool-row"},f(Z,{variant:s==="select"?"default":"outline",className:s==="select"?"tool-button active":"tool-button",onClick:()=>l("select")},e.t("select")),f(Z,{variant:s==="path"?"default":"outline",className:s==="path"?"tool-button active":"tool-button",onClick:()=>l("path")},e.t("path")),f("span",null,s==="path"?e.t("drawPathHint"):e.t("dragLayerHint"))),f("div",{className:`video-canvas-wrap ${o}`,style:{transform:`scale(${n})`}},f("canvas",{ref:e.canvasRef,onPointerDown:j,onPointerMove:B,onPointerUp:te,onPointerLeave:te})),f("div",{className:"video-transport-panel"},f("div",{className:"video-transport-title"},f("strong",null,e.t("previewFilmControl")),f("span",null,e.t("previewFilmHelp"))),f("div",{className:"transport-row"},f(Z,{className:"play-button",onClick:D,title:e.t(p?"videoPause":"videoPlay")},p?"||":"\u25B6"),f(ja,{min:0,max:Math.max(.5,e.duration),step:.05,value:Math.min(e.videoTime,e.duration),onChange:e.onTimeChange}),f("strong",null,e.videoTime.toFixed(2)," / ",e.duration.toFixed(2),"s"),f(Z,{variant:"outline",onClick:e.onExportMp4,disabled:e.saving},e.t("exportMp4")),e.exportProgress!==null?f("span",null,Math.round(e.exportProgress*100),"%"):null)),f(am,{composition:C,activeSceneIndex:R,t:e.t,onSelect:u,onAdd:()=>O(Tp(C)),onDuration:P=>O(Mp(C,R,P)),onTransition:P=>O(Ap(C,R,P))}),f("div",{className:"media-row"},f("label",{className:"upload-pill"},e.t("uploadVideoBackground"),f("input",{type:"file",accept:"video/*,image/*",onChange:P=>P.target.files?.[0]&&void E(P.target.files[0],"background","background")})),f("label",{className:"upload-pill"},e.t("uploadReference"),f("input",{type:"file",accept:"video/*,image/*,.gif",onChange:P=>P.target.files?.[0]&&void E(P.target.files[0],"reference","reference")}))),f(om,{layers:T,selectedLayerId:I,duration:e.duration,time:e.videoTime,t:e.t,onSeek:e.onTimeChange})),f("aside",{className:"video-side"},f(it,{className:"side-card"},f("h3",null,e.t("layers")),f("div",{className:"layer-add-grid"},vp.map(P=>f(Z,{key:P,variant:"outline",className:"chip-button",onClick:()=>q(P)},"+ ",cm(P,e.t)))),f("div",{className:"layer-list"},T.map(P=>f("div",{key:P.id||P.text,role:"button",tabIndex:0,className:P.id===I?"layer-row active":"layer-row",onClick:()=>P.id&&U(P.id),onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&P.id&&(_.preventDefault(),U(P.id))}},f("span",null,cm(P.type,e.t)),f("strong",null,P.text||P.id||e.t("untitled")),f(Z,{variant:"destructive",className:"mini-danger",onClick:_=>{_.stopPropagation(),P.id&&O(Ip(C,R,P.id),null)}},e.t("delete")))))),f(it,{className:"side-card"},f("h3",null,e.t("properties")),F?f("div",{className:"property-grid"},f("label",null,f("span",null,e.t("text")),f(Ye,{value:F.text||"",onChange:P=>k(_=>({..._,text:P.target.value})),disabled:F.type!=="text"})),f("label",null,f("span",null,e.t("color")),f(Ye,{type:"color",value:(F.color||F.fill||"#ffffff").slice(0,7),onChange:P=>k(_=>({..._,color:P.target.value,fill:P.target.value}))})),["x","y","w","h","opacity","scale","rotate"].map(P=>f("label",{key:P},f("span",null,P),f(Ye,{type:"number",step:P==="opacity"||P==="scale"?.05:1,value:Number(F[P]??(P==="opacity"||P==="scale"?1:0)),onChange:_=>k(Y=>({...Y,[P]:Number(_.target.value)}))}))),f("label",null,f("span",null,e.t("kineticText")),f(Ct,{value:typeof F.kinetic?.type=="string"?F.kinetic.type:"none",options:Ot(Gp,e.t),onValueChange:P=>k(_=>({..._,kinetic:P==="none"?void 0:{type:P,stagger:.04}}))})),f("label",{className:"upload-pill inline"},e.t("uploadLayerMedia"),f("input",{type:"file",accept:"image/*,video/*",onChange:P=>P.target.files?.[0]&&void E(P.target.files[0],"layer","selected-layer")})),f("div",{className:"accordion-block"},f("strong",null,e.t("keyframes")),["opacity","x","y","scale","rotate","blur"].map(P=>f(Z,{key:P,variant:"outline",className:"chip-button",onClick:()=>k(_=>Rp(_,P,e.videoTime,Number(_[P]??(P==="opacity"||P==="scale"?1:0))))},e.t("setProperty",{property:P})))),f("div",{className:"accordion-block"},f("strong",null,e.t("motionPath")),f(Z,{variant:"outline",className:"chip-button",onClick:()=>k(P=>Us(P,[{x:Number(P.x||0)-160,y:Number(P.y||0)},{x:Number(P.x||0)+160,y:Number(P.y||0)}],"line"))},e.t("line")),f(Z,{variant:"outline",className:"chip-button",onClick:()=>k(P=>({...P,path:void 0}))},e.t("clearPath"))),f("div",{className:"accordion-block"},f("strong",null,e.t("motionLabel")),xp.map(P=>f("div",{key:P.group,className:"template-group"},f("span",null,$y(P.group,e.t)),f("div",{className:"chip-grid"},P.templates.map(_=>f(Z,{key:_,variant:_===c?"default":"outline",className:_===c?"chip-button active":"chip-button",onClick:()=>m(_)},_))))),f(Z,{className:"full-width",onClick:()=>k(P=>An(P,c))},e.t("applySelected"))),f("div",{className:"accordion-block"},f("strong",null,e.t("motionStyles")),f(Ye,{value:h,onChange:P=>x(P.target.value),placeholder:e.t("nameMotionPlaceholder")}),f(Z,{variant:"outline",onClick:()=>Me("info",h?e.t("styleReady",{name:h}):e.t("nameStyleFirst"))},e.t("saveStyle"))),f("div",{className:"motion-button-row"},f(Z,{variant:"outline",onClick:()=>I&&O(Vs(C,R,I,-1))},e.t("up")),f(Z,{variant:"outline",onClick:()=>I&&O(Vs(C,R,I,1))},e.t("down")))):f("p",{className:"muted"},e.t("selectLayerHint"))))))}function cm(e,t){return t(e==="text"?"text":e==="rect"?"block":e==="ellipse"?"circle":e==="image"?"image":e==="video"?"filterVideo":"layer")}function $y(e,t){return e==="Entrance"?t("templateEntrance"):e==="Emphasis"?t("templateEmphasis"):e==="Attention"?t("templateAttention"):e==="Exit"?t("templateExit"):e}function Xs(e){return e.name.split(/\s+/).filter(Boolean).map(a=>a[0]).join("").slice(0,2).toUpperCase()||"MO"}function Fn(e){return[e.id,e.name,e.category,e.cat,e.desc,e.description,...e.surfaces||[],...e.target||[],...e.runtime||[],...e.export||[],...e.tags||[]].filter(t=>typeof t=="string"&&t.length>0).join(" ").toLowerCase()}function mm(e,t,a){let o=Fn(e),r=Xy(o),n=o.includes("subtle")||o.includes("restrained")?18:o.includes("bold")||o.includes("spark")?34:t.distance,i=o.includes("typewriter")?960:o.includes("spark")||o.includes("click")?420:o.includes("slow")?900:t.duration,s=typeof a?.componentId=="string"?a.componentId:"";return{...t,selector:s?`[data-ma-id="${xr(s)}"]`:t.selector||"h1",trigger:hm(o,t.trigger),verb:r,duration:i,distance:n,tracksJson:JSON.stringify(Zy(r,n,o),null,2)}}function gm(e,t){let o=new DOMParser().parseFromString(e,"text/html"),r=t.trim();return r&&pm(o,r)?r:["[data-ma-id]","h1","h2","h3","button","a","p",'[class*="card"]',"main > *","body > *"].find(i=>pm(o,i))??r??"body > *"}function hm(e,t){return e.includes("hover")?"hover":e.includes("click")||e.includes("spark")?"click":e.includes("scroll")||e.includes("reveal")?"scroll":e.includes("load")||e.includes("entrance")||e.includes("intro")?"load":t}function Xy(e){return e.includes("slide left")?"slide-left":e.includes("slide right")?"slide-right":e.includes("slide down")?"slide-down":e.includes("slide")||e.includes("rise")||e.includes("falling")?"slide-up":e.includes("zoom")?"zoom":e.includes("rotate")||e.includes("rotating")?"rotate":e.includes("blur")||e.includes("focus")?"blur":e.includes("pop")||e.includes("spark")||e.includes("bounce")?"pop":e.includes("pulse")||e.includes("heartbeat")?"pulse":e.includes("shake")||e.includes("glitch")?"shake":e.includes("wobble")?"wobble":e.includes("sink")?"sink":"fade"}function Zy(e,t,a){let o=Js();return e==="fade"&&(o.y=[{t:0,v:0},{t:.5,v:0}],o.scale=[{t:0,v:1},{t:.5,v:1}],o.blur=[{t:0,v:0},{t:.5,v:0}]),e==="slide-down"&&(o.y=[{t:0,v:-t},{t:.55,v:0,ease:"ease-out"}]),e==="slide-left"&&(o.x=[{t:0,v:t},{t:.55,v:0,ease:"ease-out"}],o.y=[{t:0,v:0},{t:.55,v:0}]),e==="slide-right"&&(o.x=[{t:0,v:-t},{t:.55,v:0,ease:"ease-out"}],o.y=[{t:0,v:0},{t:.55,v:0}]),e==="zoom"&&(o.scale=[{t:0,v:.82},{t:.5,v:1,ease:"ease-out"}],o.y=[{t:0,v:0},{t:.5,v:0}]),e==="rotate"&&(o.rotate=[{t:0,v:-8},{t:.55,v:0,ease:"ease-out"}]),e==="blur"&&(o.blur=[{t:0,v:16},{t:.6,v:0,ease:"ease-out"}]),e==="pop"&&(o.scale=[{t:0,v:.82},{t:.24,v:1.08},{t:.46,v:1}],o.blur=[{t:0,v:0},{t:.46,v:0}]),e==="pulse"&&(o.opacity=[{t:0,v:1},{t:.35,v:.82},{t:.7,v:1}],o.scale=[{t:0,v:1},{t:.35,v:1.06},{t:.7,v:1}]),e==="shake"&&(o.x=[{t:0,v:0},{t:.15,v:-t/2},{t:.3,v:t/2},{t:.45,v:0}]),e==="wobble"&&(o.rotate=[{t:0,v:0},{t:.18,v:-5},{t:.38,v:4},{t:.6,v:0}]),e==="sink"&&(o.y=[{t:0,v:-t/2},{t:.55,v:0,ease:"ease-out"}]),a.includes("typewriter")&&(o.opacity=[{t:0,v:0},{t:.08,v:1}]),o}function Zs(e){let t=Fn(e);return t.includes("slide left")?"slide-left":t.includes("slide right")?"slide-right":t.includes("slide down")?"slide-down":t.includes("zoom out")?"zoom-out":t.includes("zoom")?"zoom-in":t.includes("rotate")||t.includes("rotating")?"rotate-in":t.includes("pop")||t.includes("spark")?"pop":t.includes("bounce")?"bounce-in":t.includes("pulse")?"pulse":t.includes("float")?"float":t.includes("wobble")?"wobble":t.includes("shake")||t.includes("glitch")?"shake":t.includes("heartbeat")?"heartbeat":t.includes("fade out")?"fade-out":t.includes("fade")?"fade-in":"slide-up"}function vm(e){let t=Fn(e);return t.includes("typewriter")?"typewriter":t.includes("char")||t.includes("letter")?t.includes("pop")?"char-pop":"char-rise":t.includes("word")?"word-rise":null}function xm(e,t,a){let o=(e.surfaces||[]).includes("web")?a("nativeWebRecipe"):a("mappedFromRecipeIntent"),r=typeof t?.label=="string"?t.label:typeof t?.componentId=="string"?t.componentId:a("currentSelector");return`${o}; ${a("appliesToTarget",{target:r})}.`}function bm(e,t,a){let o=(e.surfaces||[]).includes("video")?a("nativeVideoRecipe"):a("convertedToLayerTemplate"),r=typeof t?.layerId=="string"?t.layerId:a("firstAvailableLayer");return`${o}; ${a("appliesToTarget",{target:r})}.`}function wm(e,t,a,o){let r=kn(hm(Fn(e),"load"),o),n=typeof t?.label=="string"?t.label:o("htmlSelection"),i=typeof a?.layerId=="string"?o("layerWithId",{id:a.layerId}):o("videoLayer");return o("recipeUsageSummary",{trigger:r,htmlTarget:n,template:Zs(e),videoTarget:i})}function pm(e,t){try{return e.querySelector(t)!==null}catch{return!1}}function Js(){return{opacity:[{t:0,v:0},{t:.5,v:1}],x:[{t:0,v:0},{t:.5,v:0}],y:[{t:0,v:24},{t:.5,v:0,ease:"ease-out"}],scale:[{t:0,v:.96},{t:.5,v:1}],rotate:[{t:0,v:0},{t:.5,v:0}],blur:[{t:0,v:8},{t:.5,v:0}]}}function ym(e){let t=e.selectedRecipe;return f("section",{className:"motion-library"},f("div",{className:"motion-stat-row"},f(vr,{label:e.t("recipes"),value:e.stats?.recipes}),f(vr,{label:e.t("htmlTemplates"),value:e.stats?.htmlTemplates}),f(vr,{label:e.t("videoTemplates"),value:e.stats?.videoTemplates}),f(vr,{label:e.t("icons"),value:e.stats?.icons})),f("div",{className:"motion-library-layout"},f("div",{className:"motion-card-grid"},e.recipes.map(a=>f("button",{key:a.id,type:"button",className:t?.id===a.id?"motion-card motion-recipe-card active":"motion-card motion-recipe-card",onClick:()=>e.onSelectRecipe(a.id)},f("div",{className:"motion-card-preview","data-kind":a.category||a.cat||"motion"},f("span",null,Xs(a))),f("div",null,f("h3",null,a.name),f("p",null,a.desc||a.description||a.id)),f("div",{className:"motion-chip-row"},(a.surfaces||[]).slice(0,2).map(o=>f("span",{key:o,className:"motion-chip"},o)),(a.target||[]).slice(0,1).map(o=>f("span",{key:o,className:"motion-chip"},o)),f("span",{className:"motion-chip"},a.status||e.t("ready"))))),e.recipes.length===0?f("div",{className:"motion-empty"},e.t("noRecipes")):null),f(it,{className:"motion-recipe-detail"},t?f(nt,null,f("div",{className:"recipe-detail-head"},f("div",null,f("span",{className:"section-eyebrow"},e.t("selectedRecipe")),f("h2",null,t.name),f("p",null,t.desc||t.description||t.id)),f("div",{className:"motion-recipe-preview","data-kind":t.category||t.cat||"motion"},Xs(t))),f("div",{className:"motion-chip-row"},f("span",{className:"motion-chip"},t.category||t.cat||"motion"),(t.surfaces||[]).map(a=>f("span",{key:a,className:"motion-chip"},a)),(t.runtime||[]).slice(0,2).map(a=>f("span",{key:a,className:"motion-chip"},a))),f("div",{className:"recipe-fit-grid"},f("div",null,f("strong",null,e.t("htmlFit")),f("span",null,xm(t,e.componentSelection,e.t))),f("div",null,f("strong",null,e.t("videoFit")),f("span",null,bm(t,e.layerSelection,e.t)))),f("div",{className:"recipe-action-grid"},f(Z,{onClick:()=>e.onApplyHtml(t)},e.t("applyToHtml")),f(Z,{variant:"secondary",onClick:()=>e.onApplyVideo(t)},e.t("applyToVideo"))),f("div",{className:"recipe-usage-note"},f("strong",null,e.selectedProject?.title||e.t("referencedDraft")),f("span",null,wm(t,e.componentSelection,e.layerSelection,e.t)))):f("div",{className:"motion-empty"},e.t("recipeSelectEmpty")))))}var el={items:[],total:0,page:1,pageSize:20};function Jy(){let[e,t]=M(null),[a,o]=M(()=>Rm()),[r,n]=M("html"),[i,s]=M(null),[l,d]=M(!1),[u,c]=M(!1),[m,h]=M(!1),[x,p]=M(""),[g,v]=M(()=>({surface:"all",target:"all",status:"ready"})),[w,b]=M(null),[C,S]=M([]),[R,T]=M(!1),[I,F]=M(!1),[X,D]=M(!1),[O,U]=M(""),[q,k]=M("Motion Launch"),[A,j]=M("Polished motion direction for a product moment."),[B,te]=M(r0("Motion Launch")),[E,P]=M(()=>JSON.stringify(Im("Motion Launch"),null,2)),[_,Y]=M(.85),[be,ie]=M(null),[ne,J]=M(null),[fe,de]=M(null),[we,ye]=M(()=>({selector:"h1",trigger:"load",verb:"slide-up",duration:520,delay:0,distance:24,tracksJson:JSON.stringify(Js(),null,2)})),Se=z(null),Ve=z(!1),Ae=z(null),Ga=z(null),ue=me(()=>dp(e?.locale),[e?.locale]);H(()=>{Ve.current=X},[X]),H(()=>{Ae.current=i},[i]);let Kt=a.detail,le=Kt?.item??a.projects.items.find(N=>N.id===i)??null,tl=Q(N=>{if(!N)return;let $=N.workingCopy?.html,Le=N.workingCopy?.videoComposition;typeof $=="string"&&$.trim()&&te($),Le&&typeof Le=="object"&&P(JSON.stringify(Le,null,2)),J(N.workingCopy?.componentSelection??null),de(N.workingCopy?.layerSelection??null),S([]),D(!1)},[]),We=Q(async N=>{T(!0);try{let $=N?.projectId??Ae.current??e?.initialQuery?.selectionId,Le=r==="library"?"recipes":void 0,Pe=Sm({table:Le,projectId:typeof $=="string"?$:void 0,surface:Le==="recipes"&&g.surface!=="all"?g.surface:void 0,target:Le==="recipes"&&g.target!=="all"?g.target:void 0,status:Le==="recipes"&&g.status!=="all"?g.status:void 0}),Ge=Ws(await Np(Sm({page:1,pageSize:Le==="recipes"?36:20,search:r==="library"?x:void 0,parameters:Pe}))),Nt=Qy(Ge);o(Nt);let $t=Nt.detail;$t?.item?.id&&(s($t.item.id),(!Ve.current||N?.forceDraftSync)&&tl($t)),U(ue("statusReady"))}catch($){let Le=qa($);U(Le),Me("error",Le)}finally{T(!1),setTimeout(gr,0)}},[r,e?.initialQuery?.selectionId,g,x,tl,ue]);H(()=>{Ga.current=We},[We]),H(()=>{Fp({requestTimeout:e?.locale?.startsWith("zh")?"\u8BF7\u6C42\u8D85\u65F6":"Request timed out",remoteRequestFailed:e?.locale?.startsWith("zh")?"\u8FDC\u7A0B\u8BF7\u6C42\u5931\u8D25":"Remote request failed"})},[e?.locale]),H(()=>{Bp(t,()=>{if(Ve.current){U(ue("dirtyWarning")),Me("warning",ue("dirtyWarning"));return}Ga.current?.({projectId:Ae.current,forceDraftSync:!0})}),hr("ready")},[ue]),H(()=>{e&&We({forceDraftSync:!0})},[e,We]),H(()=>{setTimeout(gr,0)},[r,a,X,O]),H(()=>{if(r!=="library")return;let N=a.recipes.items;if(N.length===0){b(null);return}N.some($=>$.id===w)||b(N[0].id)},[r,w,a.recipes.items]),H(()=>{let N=Se.current;if(!N)return;let $=N.getContext("2d");if($)try{let Le=Wa(E),Pe=Tn(Le),Ge=Math.min(1,960/Pe.w);N.width=Math.max(1,Math.round(Pe.w*Ge)),N.height=Math.max(1,Math.round(Pe.h*Ge)),$.save(),$.scale(Ge,Ge),Pe.renderFrame($,Math.min(_,Pe.duration()));let Nt=typeof fe?.layerId=="string"?fe.layerId:"";if(Nt){let $t=pr(Le,Nt);if($t){let Ft=qs($t);$.save(),$.strokeStyle="#8b5cf6",$.lineWidth=4/Ge,$.setLineDash([10/Ge,7/Ge]),$.strokeRect(Ft.x-Ft.w/2,Ft.y-Ft.h/2,Ft.w,Ft.h),$.restore()}}$.restore()}catch{N.width=960,N.height=540,$.fillStyle="#111827",$.fillRect(0,0,N.width,N.height),$.fillStyle="#f8fafc",$.font="600 22px Inter, ui-sans-serif, system-ui, sans-serif",$.fillText(ue("invalidCompositionJson"),32,56)}},[r,fe,ue,E,_]);async function Bn(N){F(!0);try{let $=await da("create_project",null,{title:q,brief:A,surface:N,html:N==="web"?B:void 0,videoComposition:N==="video"?Wa(E):void 0,changeSummary:"Created in Motion Workbench"}),Le=Pm($),Pe=t0(Le);Pe&&s(Pe),n(N==="video"?"video":"html"),D(!1),d(!1),await We({projectId:Pe,forceDraftSync:!0}),Me("success",ue("projectCreated",{title:q}))}catch($){pt($)}finally{F(!1)}}async function Tm(){if(!le?.id){await Bn("web");return}F(!0);try{await da("save_web_artifact",le.id,{projectId:le.id,html:B,selectedRecipeIds:Ys([...le.selectedRecipeIds||[],...C]),componentSelection:ne??void 0,changeSummary:"Saved from Motion HTML Workbench"},{projectId:le.id}),D(!1),await We({projectId:le.id,forceDraftSync:!0}),Me("success",ue("htmlSaved"))}catch(N){pt(N)}finally{F(!1)}}async function Mm(){if(!le?.id){await Bn("video");return}F(!0);try{await da("save_video_composition",le.id,{projectId:le.id,composition:Wa(E),selectedRecipeIds:Ys([...le.selectedRecipeIds||[],...C]),layerSelection:fe??void 0,changeSummary:"Saved from Motion Video Composer"},{projectId:le.id}),D(!1),await We({projectId:le.id,forceDraftSync:!0}),Me("success",ue("videoSaved"))}catch(N){pt(N)}finally{F(!1)}}async function Am(){if(le?.id){F(!0);try{await da("finalize_version",le.id,{projectId:le.id,changeSummary:`Workbench version ${new Date().toLocaleString()}`},{projectId:le.id}),await We({projectId:le.id,forceDraftSync:!0}),Me("success",ue("versionSaved"))}catch(N){pt(N)}finally{F(!1)}}}async function Dm(N){if(le?.id){F(!0);try{await da("export_artifact",le.id,{projectId:le.id,kind:N,content:N==="html"?B:void 0,fileName:`${km(le.title)}.${n0(N)}`,changeSummary:`Exported ${N} from Motion Workbench`},{projectId:le.id}),await We({projectId:le.id}),Me("success",ue("artifactExported",{kind:N.toUpperCase()}))}catch($){pt($)}finally{F(!1)}}}async function zm(){if(le?.id){if(!zs()){Me("error",ue("webCodecsUnavailable"));return}F(!0),ie(0);try{let N=Wa(E),$=Tn(N);await $.preload();let Le=await sp($,{fps:$.fps,bitrate:5e6,scale:1},Ge=>ie(Ge)),Pe=new File([Le],`${km(le.title)}.mp4`,{type:"video/mp4"});await zn("save_export_file",le.id,{projectId:le.id,kind:"mp4",changeSummary:"Browser MP4 export from Motion Workbench"},{projectId:le.id},Pe),await We({projectId:le.id}),Me("success",ue("mp4Exported"))}catch(N){pt(N)}finally{F(!1),ie(null)}}}async function Em(N){if(le?.id){F(!0);try{await da("restore_version",le.id,{projectId:le.id,versionId:N,changeSummary:"Restored in Motion Workbench"},{projectId:le.id}),D(!1),await We({projectId:le.id,forceDraftSync:!0}),Me("success",ue("versionRestored"))}catch($){pt($)}finally{F(!1)}}}async function Hn(N){if(le?.id){F(!0);try{await da(N==="reviewed"?"mark_reviewed":N==="archived"?"archive_project":"mark_draft",le.id,{projectId:le.id},{projectId:le.id}),await We({projectId:le.id}),Me("success",ue("projectStatusUpdated",{status:N}))}catch($){pt($)}finally{F(!1)}}}function al(N){b(N.id),S($=>Ys([...$,N.id]))}function Om(N){try{let $=mm(N,we,ne),Le=typeof ne?.componentId=="string"?ne.componentId:"",Pe=Le?$:{...$,selector:gm(B,$.selector)},Ge=Le?Nn(B,Le,Pe):Lm(B,Pe);ye(Pe),J(Le?{...ne||{},componentId:Le,selectedRecipeId:N.id,selectedRecipeName:N.name}:{selectedRecipeId:N.id,selectedRecipeName:N.name,label:Pe.selector}),_n(Ge),al(N),n("html"),U(ue("recipeAppliedToHtml",{name:N.name})),Me("success",ue("recipeApplied",{name:N.name}))}catch($){pt($)}}function Nm(N){try{let $=Wa(E),Le=typeof fe?.layerId=="string"?fe.layerId:"",Pe=typeof fe?.sceneIndex=="number"?fe.sceneIndex:-1,Ge=[...$.shared||[],...So($,Pe)],Nt=Le?pr($,Le,Pe):Ge[0]??null;if(!Nt?.id)throw new Error(ue("selectLayerFirst"));let $t=Zs(N),Ft=vm(N),Vm=Va($,Pe,Nt.id,rl=>{let nl=An(rl,$t);return Ft&&rl.type==="text"?{...nl,kinetic:{type:Ft,stagger:.04}}:nl});ol(JSON.stringify(Vm,null,2)),de({layerId:Nt.id,sceneIndex:Pe,selectedRecipeId:N.id,selectedRecipeName:N.name}),al(N),n("video"),U(ue("recipeAppliedToVideo",{name:N.name})),Me("success",ue("recipeApplied",{name:N.name}))}catch($){pt($)}}function pt(N){let $=qa(N);U($),Me("error",$)}function _n(N){te(N),D(!0)}function ol(N){P(N),D(!0)}function Fm(){try{_n(Lm(B,we)),U(ue("motionApplied"))}catch(N){pt(N)}}let Bm=me(()=>{try{return Tn(Wa(E)).duration()}catch{return 5}},[E]),Vn=r==="html"||r==="video",Hm=r==="library",_m=a.recipes.items.find(N=>N.id===w)??a.recipes.items[0]??null,Un={title:le?.title||"Motion Workbench",dirty:X,statusLabel:le?.status||"draft",activeTab:r,onTabChange:n,onOpenProjects:()=>d(!0),onOpenVersions:()=>c(!0),onOpenExports:()=>h(!0)};return f("main",{className:Vn?"motion-shell motion-shell-editor":"motion-shell"},f(Yp,{open:l,projects:a.projects.items,selectedProjectId:i,title:q,brief:A,saving:I,t:ue,onOpenChange:d,onTitleChange:k,onBriefChange:j,onCreate:Bn,onSelect:N=>{We({projectId:N,forceDraftSync:!0})}}),f(Qp,{open:u,versions:Kt?.versions||[],currentId:Kt?.currentVersion?.id,saving:I,t:ue,onOpenChange:c,onCreateVersion:Am,onRestore:Em}),f(em,{open:m,exports:Kt?.exports||[],selectedProject:le,t:ue,onOpenChange:h,onReviewed:()=>{Hn("reviewed")},onDraft:()=>{Hn("draft")},onArchive:()=>{Hn("archived")}}),Vn?null:f($p,{header:Un,t:ue}),Hm&&!Vn?f("section",{className:"motion-status-row"},f(Ye,{value:x,onChange:N=>p(N.target.value),onKeyDown:N=>{N.key==="Enter"&&We()},placeholder:ue("search")}),f(Z,{onClick:()=>{We()},disabled:R},ue("search")),f("span",null,R?ue("loading"):O)):null,r==="library"?f("section",{className:"motion-library-command"},f("div",null,f("strong",null,ue("library")),f("span",null,ue("libraryHelp"))),f("div",{className:"motion-filter-row"},f(Ct,{className:"library-filter-select",value:g.surface,options:Ot(qp,ue),onValueChange:N=>v($=>({...$,surface:N}))}),f(Ct,{className:"library-filter-select",value:g.target,options:Ot(jp,ue),onValueChange:N=>v($=>({...$,target:N}))}),f(Ct,{className:"library-filter-select",value:g.status,options:Ot(Wp,ue),onValueChange:N=>v($=>({...$,status:N}))}))):null,r==="library"?f(ym,{recipes:a.recipes.items,stats:a.libraryStats,selectedRecipe:_m,selectedProject:le,componentSelection:ne,layerSelection:fe,t:ue,onSelectRecipe:b,onApplyHtml:Om,onApplyVideo:Nm}):null,r==="html"?f(um,{controls:we,htmlDraft:B,componentSelection:ne,saving:I,selectedProject:le,header:Un,t:ue,onControlsChange:ye,onApply:Fm,onDraftChange:_n,onComponentSelectionChange:J,onSave:()=>{Tm()},onExport:Dm}):null,r==="video"?f(fm,{canvasRef:Se,videoDraft:E,videoTime:_,selectedProject:le,layerSelection:fe,header:Un,t:ue,duration:Bm,saving:I,exportProgress:be,parseVideoComposition:Wa,defaultComposition:Im,extractMediaPayload:Yy,onDraftChange:ol,onTimeChange:Y,onLayerSelectionChange:de,onSave:()=>{Mm()},onExportMp4:()=>{zm()}}):null)}function Ys(e){return Array.from(new Set(e.filter(t=>typeof t=="string"&&t.trim()).map(t=>t.trim())))}function Yy(e){let t=Pm(e);if(!Fe(t)||!Fe(t.media))return null;let a=t.media;return{src:typeof a.src=="string"?a.src:typeof a.fileUrl=="string"?a.fileUrl:typeof a.workspacePath=="string"?a.workspacePath:typeof a.filePath=="string"?a.filePath:"",filePath:typeof a.filePath=="string"?a.filePath:void 0,fileUrl:typeof a.fileUrl=="string"?a.fileUrl:void 0,mimeType:typeof a.mimeType=="string"?a.mimeType:void 0}}function Rm(){return{projects:el,recipes:el,styles:[],detail:null,libraryStats:{}}}function Qy(e){return Fe(e)?{projects:Cm(e.projects),recipes:Cm(e.recipes),styles:Array.isArray(e.styles)?e.styles:[],detail:e0(e.detail),libraryStats:Fe(e.libraryStats)?e.libraryStats:{}}:Rm()}function Cm(e){return Fe(e)?{items:Array.isArray(e.items)?e.items:[],total:typeof e.total=="number"?e.total:0,page:typeof e.page=="number"?e.page:1,pageSize:typeof e.pageSize=="number"?e.pageSize:20}:{...el,items:[]}}function e0(e){return!Fe(e)||!Fe(e.item)||typeof e.item.id!="string"?null:e}function Pm(e){let t=Ws(e);return Fe(t)&&t.data!==void 0?t.data:t}function t0(e){return Fe(e)&&Fe(e.item)&&typeof e.item.id=="string"?e.item.id:Fe(e)&&Fe(e.project)&&typeof e.project.id=="string"?e.project.id:null}function Sm(e){let t={};for(let[a,o]of Object.entries(e))o!=null&&o!==""&&(t[a]=o);return t}function Wa(e){let t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Composition must be a JSON object.");return t}function Lm(e,t){let o=new DOMParser().parseFromString(e,"text/html"),r=t.selector.trim()||"body > *",n;try{n=Array.from(o.querySelectorAll(r))}catch{throw new Error("Selector is invalid.")}if(n.length===0)throw new Error("Selector matched no elements.");let i=a0(t.tracksJson);for(let s of n.slice(0,50))s.setAttribute("data-ma-anim",t.verb),s.setAttribute("data-ma-trigger",t.trigger),s.setAttribute("data-ma-dur",String(Qs(t.duration,80,4e3))),s.setAttribute("data-ma-delay",String(Qs(t.delay,0,8e3))),s.setAttribute("data-ma-dist",String(Qs(t.distance,-400,400))),s.setAttribute("data-ma-tracks",JSON.stringify(i));return`<!doctype html>
|
|
116
|
+
${o.documentElement.outerHTML}`}function a0(e){let t=JSON.parse(e),a={};for(let o of En)Array.isArray(t[o])&&(a[o]=t[o]);return a}function o0(e,t=40){return{opacity:[{t:0,v:0},{t:.5,v:1}],y:[{t:0,v:e+t},{t:.5,v:e,ease:"ease-out"}],scale:[{t:0,v:.96},{t:.5,v:1}],blur:[{t:0,v:8},{t:.5,v:0}]}}function r0(e){return`<!doctype html>
|
|
1023
117
|
<html lang="en">
|
|
1024
118
|
<head>
|
|
1025
119
|
<meta charset="utf-8">
|
|
1026
120
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
1027
|
-
<title>${
|
|
121
|
+
<title>${i0(e)}</title>
|
|
1028
122
|
<style>
|
|
1029
123
|
body{margin:0;font-family:Inter,ui-sans-serif,system-ui,sans-serif;background:#f8fafc;color:#111827}
|
|
1030
124
|
main{min-height:100vh;display:grid;place-items:center;padding:56px}
|
|
@@ -1041,4 +135,4 @@ ${o.documentElement.outerHTML}`}function Cy(e){let t=JSON.parse(e),a={};for(let
|
|
|
1041
135
|
</section>
|
|
1042
136
|
</main>
|
|
1043
137
|
</body>
|
|
1044
|
-
</html>`}function
|
|
138
|
+
</html>`}function Im(e){return{w:1280,h:720,fps:30,bg:"#111827",duration:5,shared:[{id:"backplate",type:"rect",x:640,y:360,w:920,h:360,color:"#1f2937",opacity:.86,tracks:{scale:[{t:0,v:.94},{t:.8,v:1,ease:"ease-out"}],opacity:[{t:0,v:0},{t:.6,v:.86}]}}],layers:[{id:"title",type:"text",text:e,x:640,y:330,size:76,weight:800,color:"#ffffff",tracks:o0(330,46)},{id:"subtitle",type:"text",text:"Agent-crafted motion, ready for review.",x:640,y:430,size:34,weight:500,color:"#a7f3d0",tracks:{opacity:[{t:.25,v:0},{t:1.1,v:1}],y:[{t:.25,v:458},{t:1.1,v:430,ease:"ease-out"}]}}]}}function n0(e){return e==="react"?"tsx":e==="lottie"?"lottie.json":e}function km(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,80)||"motion"}function Qs(e,t,a){return Math.max(t,Math.min(a,Number.isFinite(e)?e:t))}function i0(e){return e.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t]||t)}dl(document.getElementById("root")||document.body.appendChild(document.createElement("div"))).render(f(Jy,null));})();
|